PCI peer bridge problems: Next try

Martin Mares (mj@ucw.cz)
Sat, 15 Aug 1998 13:49:59 +0200


Hello,

If you have experienced any PCI related problems since approx. 2.1.108,
please try this patch (relative to 2.1.115) and tell me whether it does solve
the problems. Please do so even if 2.1.115 works for you since I've changed
several things and I'd like to make sure I didn't break anything.

Have a nice fortnight

-- 
Martin `MJ' Mares   <mj@ucw.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"I love complete delivery - with the screwdriver."

diff -uN /usr/src/linux-2.1/drivers/pci/oldproc.c linux/drivers/pci/oldproc.c --- /usr/src/linux-2.1/drivers/pci/oldproc.c Mon Aug 3 19:46:40 1998 +++ linux/drivers/pci/oldproc.c Mon Aug 10 14:43:32 1998 @@ -1,5 +1,5 @@ /* - * $Id: oldproc.c,v 1.16 1998/07/19 17:50:18 davem Exp $ + * $Id: oldproc.c,v 1.17 1998/08/07 23:50:40 cort Exp $ * * Backward-compatible procfs interface for PCI. * @@ -122,7 +122,9 @@ DEVICE( IBM, IBM_82351, "82351"), DEVICE( IBM, IBM_SERVERAID, "ServeRAID"), DEVICE( IBM, IBM_TR_WAKE, "Wake On LAN Token Ring"), + DEVICE( IBM, IBM_POWERMP, "TotalImpact PowerMP"), DEVICE( IBM, IBM_3780IDSP, "MWave DSP"), + DEVICE( WD, WD_7197, "WD 7197"), DEVICE( WD, WD_7197, "WD 7197"), DEVICE( AMD, AMD_LANCE, "79C970"), DEVICE( AMD, AMD_SCSI, "53C974"), diff -uN /usr/src/linux-2.1/drivers/pci/pci.c linux/drivers/pci/pci.c --- /usr/src/linux-2.1/drivers/pci/pci.c Tue Jul 21 12:52:59 1998 +++ linux/drivers/pci/pci.c Sat Aug 15 13:37:55 1998 @@ -1,5 +1,5 @@ /* - * $Id: pci.c,v 1.86 1998/07/15 20:34:47 mj Exp $ + * $Id: pci.c,v 1.88 1998/08/15 10:37:12 mj Exp $ * * PCI Bus Services, see include/linux/pci.h for further explanation. * @@ -170,13 +170,14 @@ /* not a multi-function device */ continue; } - pcibios_read_config_byte(bus->number, devfn, PCI_HEADER_TYPE, &hdr_type); + if (pcibios_read_config_byte(bus->number, devfn, PCI_HEADER_TYPE, &hdr_type)) + continue; if (!PCI_FUNC(devfn)) is_multi = hdr_type & 0x80; - pcibios_read_config_dword(bus->number, devfn, PCI_VENDOR_ID, &l); - /* some broken boards return 0 if a slot is empty: */ - if (l == 0xffffffff || l == 0x00000000 || l == 0x0000ffff || l == 0xffff0000) { + if (pcibios_read_config_dword(bus->number, devfn, PCI_VENDOR_ID, &l) || + /* some broken boards return 0 if a slot is empty: */ + l == 0xffffffff || l == 0x00000000 || l == 0x0000ffff || l == 0xffff0000) { is_multi = 0; continue; } --- /usr/src/linux-2.1/include/linux/pci.h Sun Jul 26 14:44:44 1998 +++ linux/include/linux/pci.h Fri Aug 14 23:31:56 1998 @@ -1,5 +1,5 @@ /* - * $Id: pci.h,v 1.80 1998/07/21 10:06:40 mj Exp $ + * $Id: pci.h,v 1.83 1998/08/13 20:21:41 philip Exp $ * * PCI defines and function prototypes * Copyright 1994, Drew Eckhardt @@ -381,6 +381,7 @@ #define PCI_DEVICE_ID_IBM_82351 0x0022 #define PCI_DEVICE_ID_IBM_SERVERAID 0x002e #define PCI_DEVICE_ID_IBM_TR_WAKE 0x003e +#define PCI_DEVICE_ID_IBM_POWERMP 0x0046 #define PCI_DEVICE_ID_IBM_3780IDSP 0x007d #define PCI_VENDOR_ID_WD 0x101c @@ -599,6 +600,9 @@ #define PCI_DEVICE_ID_DATABOOK_87144 0xb106 #define PCI_VENDOR_ID_PLX 0x10b5 +#define PCI_DEVICE_ID_PLX_9060 0x9060 +#define PCI_DEVICE_ID_PLX_9060ES 0x906E +#define PCI_DEVICE_ID_PLX_9060SD 0x906D #define PCI_DEVICE_ID_PLX_9080 0x9080 #define PCI_VENDOR_ID_MADGE 0x10b6 --- /usr/src/linux-2.1/arch/i386/kernel/bios32.c Mon Aug 10 16:42:12 1998 +++ linux/arch/i386/kernel/bios32.c Sat Aug 15 13:41:52 1998 @@ -1,7 +1,7 @@ /* * bios32.c - Low-Level PCI Access * - * $Id: bios32.c,v 1.44 1998/08/04 14:54:56 mj Exp $ + * $Id: bios32.c,v 1.45 1998/08/15 10:41:04 mj Exp $ * * Copyright 1993, 1994 Drew Eckhardt * Visionary Computing @@ -945,7 +945,8 @@ __initfunc(void pcibios_fixup_peer_bridges(void)) { struct pci_bus *b = &pci_root; - int i; + int i, cnt=-1; + struct pci_dev *d; #ifdef CONFIG_PCI_DIRECT /* @@ -956,23 +957,34 @@ if (access_pci == &pci_direct_conf2) return; #endif + for(d=b->devices; d; d=d->sibling) + if ((d->class >> 8) == PCI_CLASS_BRIDGE_HOST) + cnt++; do { int n = b->subordinate+1; + int found = 0; u16 l; for(i=0; i<256; i += 8) if (!pcibios_read_config_word(n, i, PCI_VENDOR_ID, &l) && l != 0x0000 && l != 0xffff) { DBG("Found device at %02x:%02x\n", n, i); - printk("PCI: Discovered primary peer bus %02x\n", n); - b = kmalloc(sizeof(*b), GFP_KERNEL); - memset(b, 0, sizeof(*b)); - b->next = pci_root.next; - pci_root.next = b; - b->number = b->secondary = n; - b->subordinate = 0xff; - b->subordinate = pci_scan_bus(b); - break; + found++; + if (!pcibios_read_config_word(n, i, PCI_CLASS_DEVICE, &l) && + l == PCI_CLASS_BRIDGE_HOST) + cnt++; } + if (found && cnt > 0) { + cnt--; + printk("PCI: Discovered primary peer bus %02x\n", n); + b = kmalloc(sizeof(*b), GFP_KERNEL); + memset(b, 0, sizeof(*b)); + b->next = pci_root.next; + pci_root.next = b; + b->number = b->secondary = n; + b->subordinate = 0xff; + b->subordinate = pci_scan_bus(b); + break; + } } while (i < 256); }

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html