[PATCH] Fallback to PCI IRQs for TI bridges

Pavel Roskin proski at gnu.org
Mon May 12 14:08:10 BST 2003


On Sat, 10 May 2003, Tim Small wrote:

> I wonder if I could hassle you guys into taking a quick look at this
> forum thread regarding a problem I'm having getting a TI1031 based
> PCI->PCMCIA bridge to work?

OK, but next time please copy to a mailing list.  I hate writing personal
e-mails when the discussion should remain open and archived.  The new
PCMCIA list would be the best place: linux-pcmcia at lists.infradead.org

P.S. Adding cc: after some internal struggle :-)

> https://sourceforge.net/forum/forum.php?thread_id=863984&forum_id=43629

OK, my understanding is that your patch may be correct.  I'm not
familiar with the internals of PCI implementation to judge.  However, it
may happen that you only need pci_read_irq(dev) and nothing else.  You may
want the attached patch that is less intrusive in terms of affected
devices (as opposed to affected lines of code).

> I'm referring back to this thread:
>
> http://lists.insecure.org/lists/linux-kernel/2003/Mar/0012.html

My patch may be needed as well, but it does a different thing - it
reprograms bridge-specific registers to use PCI IRQ is ISA IRQ wasn't
found.  Your patch fixes finding PCI IRQ for certain devices.

My TI and Ricoh cards are listed as "CardBus bridge", so they have their
IRQs determined from the PCI config space (if I understand the whole
situation correctly).  Your card identifies itself as a PCMCIA bridge, so
the kernel doesn't know its PCI IRQ.  Reprogramming the bridge registers
would be insufficient in this case.

I don't see corresponding code in drivers/pci/pci.c in Linux 2.5.69.  It
may happen that it will work for you without changes.

-- 
Regards,
Pavel Roskin-------------- next part --------------
--- linux.orig/drivers/pci/pci.c
+++ linux/drivers/pci/pci.c
@@ -1405,12 +1405,17 @@ int pci_setup_device(struct pci_dev * de
 		break;
 
 	case PCI_HEADER_TYPE_CARDBUS:		    /* CardBus bridge header */
-		if (class != PCI_CLASS_BRIDGE_CARDBUS)
+		switch (class) {
+		case PCI_CLASS_BRIDGE_CARDBUS:
+			pci_read_bases(dev, 1, 0);
+			pci_read_config_word(dev, PCI_CB_SUBSYSTEM_VENDOR_ID, &dev->subsystem_vendor);
+			pci_read_config_word(dev, PCI_CB_SUBSYSTEM_ID, &dev->subsystem_device);
+			/* fallthrough */
+		case PCI_CLASS_BRIDGE_PCMCIA:
+			pci_read_irq(dev);
+		default:
 			goto bad;
-		pci_read_irq(dev);
-		pci_read_bases(dev, 1, 0);
-		pci_read_config_word(dev, PCI_CB_SUBSYSTEM_VENDOR_ID, &dev->subsystem_vendor);
-		pci_read_config_word(dev, PCI_CB_SUBSYSTEM_ID, &dev->subsystem_device);
+		}
 		break;
 
 	default:				    /* unknown header */


More information about the linux-pcmcia mailing list