]> git.baikalelectronics.ru Git - 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)
commit5884c7437eebb351a635ef0886c06fc49ccc9da7
tree6901f91921f7b99647fac482d6e6a38c189340de
parent1e13af441fafdd416ea7b17a3a482837d60f4fbe
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