aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schmidt <schmidt@digadd.de>2007-08-22 17:01:19 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-22 22:52:44 -0400
commit436bbd431d41e0fd3bfedb0312ab764b291ddf82 (patch)
treedaef32fdb1d5631f13ca651b72748fec547f833b
parentad4c2aa6354fad5316565b1cff57f80db0e04db8 (diff)
Add blacklisting capability to serial_pci to avoid misdetection of serial ports
The serial_pci driver tries to guess serial ports on unknown devices based on the PCI class (modem or serial). On certain softmodems (AC'97 modems) this can lead to the recognition of non-existing serial ports. This patch adds a blacklist of PCI IDs that are to be ignored by the driver. [akpm@linux-foundation.org: cleanups] Signed-off-by: Christian Schmidt <schmidt@digadd.de> Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Russell King <rmk+lkml@arm.linux.org.uk> Cc: Yinghai Lu <yinghai.lu@sun.com> Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/serial/8250_pci.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index fd76542c5977..e3140e5b16cc 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -1652,6 +1652,10 @@ static struct pciserial_board pci_boards[] __devinitdata = {
1652 }, 1652 },
1653}; 1653};
1654 1654
1655static const struct pci_device_id softmodem_blacklist[] = {
1656 { PCI_VDEVICE ( AL, 0x5457 ), }, /* ALi Corporation M5457 AC'97 Modem */
1657};
1658
1655/* 1659/*
1656 * Given a complete unknown PCI device, try to use some heuristics to 1660 * Given a complete unknown PCI device, try to use some heuristics to
1657 * guess what the configuration might be, based on the pitiful PCI 1661 * guess what the configuration might be, based on the pitiful PCI
@@ -1660,6 +1664,7 @@ static struct pciserial_board pci_boards[] __devinitdata = {
1660static int __devinit 1664static int __devinit
1661serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board) 1665serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board)
1662{ 1666{
1667 const struct pci_device_id *blacklist;
1663 int num_iomem, num_port, first_port = -1, i; 1668 int num_iomem, num_port, first_port = -1, i;
1664 1669
1665 /* 1670 /*
@@ -1674,6 +1679,18 @@ serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board)
1674 (dev->class & 0xff) > 6) 1679 (dev->class & 0xff) > 6)
1675 return -ENODEV; 1680 return -ENODEV;
1676 1681
1682 /*
1683 * Do not access blacklisted devices that are known not to
1684 * feature serial ports.
1685 */
1686 for (blacklist = softmodem_blacklist;
1687 blacklist < softmodem_blacklist + ARRAY_SIZE(softmodem_blacklist);
1688 blacklist++) {
1689 if (dev->vendor == blacklist->vendor &&
1690 dev->device == blacklist->device)
1691 return -ENODEV;
1692 }
1693
1677 num_iomem = num_port = 0; 1694 num_iomem = num_port = 0;
1678 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) { 1695 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
1679 if (pci_resource_flags(dev, i) & IORESOURCE_IO) { 1696 if (pci_resource_flags(dev, i) & IORESOURCE_IO) {