Re: PCI problems with multiple cpu bus - 2.1.110.

Eric Paire (e.paire@opengroup.org)
Thu, 23 Jul 1998 16:25:14 +0200


Hello Martin,

> Hello,
>
> Can you try this patch? It should hopefully fix scanning of peer bridges
> on all multi-bus motherboards known to me.
>
I applied your patch and it works fine for me, but I think that there are
some hidden bugs in it. Therefore I have fixed them and sent attached a patch
for your patch:
1) The next PCI bus number to try is the "b->subordinate+1" and not the
"b->number+1", since there may be other child PCI busses behind a
PCI bus (PCI-to-PCI bridges).
2) The kmalloc should have GFP_ATOMIC and not GFP_KERNEL, since we don't
want to have the GFP_WAIT flag set (this is for the coherency with
the way the child PCI busses structures are allocated in pci.c).
3) The new PCI busses discovered should not have any parent, since they are
directly attached to the processor bus (the pci_root is *NOT* their
parent).
4) The first argument of pci_find_slot() must be the bus number and not the
bus structure pointer.

Finally, the "pci_root.self" field is *NOT* initialized, as the other PCI
busses. I think that I should be coherent to do it in the driver/pci/pci.c
machine-independent file.

Best regards,
Eric
P.S. I won't be at work Friday, so don't try to reach me before next Monday.
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ Eric PAIRE
Email : e.paire@gr.opengroup.org | The Open Group - Grenoble Research
Institute
Phone : +33 (0) 476 63 48 71 | 2, avenue de Vignate
Fax : +33 (0) 476 51 05 32 | F-38610 Gieres FRANCE

------ Cut Here ------ Cut Here ------ Cut Here ------ Cut Here ------
--- arch/i386/kernel/bios32.c.MJ Thu Jul 23 15:53:04 1998
+++ arch/i386/kernel/bios32.c Thu Jul 23 16:07:53 1998
@@ -922,7 +922,7 @@
int i;

do {
- int n = b->number+1;
+ int n = b->subordinate+1;
u16 l;
for(i=0; i<256; i += 8)
if (!pcibios_read_config_word(n, i, PCI_VENDOR_ID, &l) &&
@@ -930,15 +930,14 @@
!pcibios_read_config_word(n, i, PCI_CLASS_DEVICE, &l) &&
l == PCI_CLASS_BRIDGE_HOST) {
DBG("PCI: Peer host bridge at %02x:%02x\n", n, i);
- b = kmalloc(sizeof(*b), GFP_KERNEL);
+ b = kmalloc(sizeof(*b), GFP_ATOMIC);
memset(b, 0, sizeof(*b));
- b->parent = &pci_root;
b->next = pci_root.next;
pci_root.next = b;
b->number = b->secondary = n;
b->subordinate = 0xff;
b->subordinate = pci_scan_bus(b);
- b->self = pci_find_slot(b, i);
+ b->self = pci_find_slot(n, i);
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