finally move buildroot-ng to trunk
[openwrt.git] / target / linux / rb532-2.6 / patches / 210-pci_fixes.patch
1 diff -urN linux.old/drivers/pci/probe.c linux.dev/drivers/pci/probe.c
2 --- linux.old/drivers/pci/probe.c       2006-06-08 20:21:20.000000000 +0200
3 +++ linux.dev/drivers/pci/probe.c       2006-06-08 20:19:40.000000000 +0200
4 @@ -760,15 +760,22 @@
5         u32 l;
6         u8 hdr_type;
7         int delay = 1;
8 -
9 -       if (pci_bus_read_config_dword(bus, devfn, PCI_VENDOR_ID, &l))
10 -               return NULL;
11 -
12 -       /* some broken boards return 0 or ~0 if a slot is empty: */
13 -       if (l == 0xffffffff || l == 0x00000000 ||
14 -           l == 0x0000ffff || l == 0xffff0000)
15 -               return NULL;
16 -
17 +       do {
18 +               if (pci_bus_read_config_dword(bus, devfn, PCI_VENDOR_ID, &l))
19 +                       return NULL;
20 +               /* some broken boards return 0 or ~0 if a slot is empty: */
21 +               if (l == 0xffffffff || l == 0x00000000 ||
22 +                   l == 0x0000ffff || l == 0xffff0000){
23 +                       if (delay > 4)
24 +                               return NULL;
25 +                       /* But that could also be the previous dev not settled */
26 +                       pr_debug("PCI: retrying scan at 0x%x, because config is 0x%x\n",devfn,l);
27 +                       msleep(delay);
28 +                       delay *=2;
29 +                       l=0;
30 +               }
31 +       }while (l==0);
32 +       
33         /* Configuration request Retry Status */
34         while (l == 0xffff0001) {
35                 msleep(delay);
36 @@ -903,7 +910,10 @@
37  
38         /* Go find them, Rover! */
39         for (devfn = 0; devfn < 0x100; devfn += 8)
40 +           {
41 +           if (bus->number == 0 && (devfn >> 3) > 21) break;
42                 pci_scan_slot(bus, devfn);
43 +           }
44  
45         /*
46          * After performing arch-dependent fixup of the bus, look behind