]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
serial: 8250_pci: Enable device after we check black list
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 24 Jul 2017 17:28:32 +0000 (20:28 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 30 Jul 2017 14:44:55 +0000 (07:44 -0700)
commit7d8905d064058f4b65057e0101588f362f288bc0
tree6901f91921f7b99647fac482d6e6a38c189340de
parentc7ac15ce89242e3c25fcc49fa4d00028285fab05
serial: 8250_pci: Enable device after we check black list

If the board we are guessing has been listed in black list we don't need
to enable it twice. The associated driver, if any, will take care about
proper initialization.

To achieve this we split out two helper functions, i.e.
serial_pci_is_class_communication() and serial_pci_is_blacklisted() which will
be called before pcim_enable_device(). We can do this since PCI specification
requires class, device and vendor ID registers to be always present in the
configuration space.

As an example what happens before this patch applied
(These are some debug prints, don't search for them in kernel sources):

serial 0000:00:04.1: Mapped GSI28 to IRQ28
serial 0000:00:04.2: Mapped GSI29 to IRQ29
serial 0000:00:04.3: Mapped GSI54 to IRQ54
8250_mid 0000:00:04.1: Mapped GSI28 to IRQ28
8250_mid 0000:00:04.2: Mapped GSI29 to IRQ29
8250_mid 0000:00:04.3: Mapped GSI54 to IRQ54

After we will have just last three lines out of above.

8250_mid 0000:00:04.1: Mapped GSI28 to IRQ28
8250_mid 0000:00:04.2: Mapped GSI29 to IRQ29
8250_mid 0000:00:04.3: Mapped GSI54 to IRQ54

While here, correct a value of error code mentioned in the comment of
serial_pci_guess_board().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_pci.c