aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/rb532-2.6/patches/210-pci_fixes.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-10-13 22:51:49 +0200
committerFelix Fietkau <nbd@openwrt.org>2016-03-20 17:29:15 +0100
commit60c1f0f64d23003a19a07d6b9638542130f6641d (patch)
tree8fb2787f4c49baded97cd55e0c371fe1cffce2b6 /target/linux/rb532-2.6/patches/210-pci_fixes.patch
parentd58a09110ccfa95f06c983fe796806f2e035c9d2 (diff)
parentb3ce218b51746d3a576221ea542facf3a1703ab2 (diff)
downloadupstream-60c1f0f64d23003a19a07d6b9638542130f6641d.tar.gz
upstream-60c1f0f64d23003a19a07d6b9638542130f6641d.tar.bz2
upstream-60c1f0f64d23003a19a07d6b9638542130f6641d.zip
finally move buildroot-ng to trunk
Diffstat (limited to 'target/linux/rb532-2.6/patches/210-pci_fixes.patch')
-rw-r--r--target/linux/rb532-2.6/patches/210-pci_fixes.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/target/linux/rb532-2.6/patches/210-pci_fixes.patch b/target/linux/rb532-2.6/patches/210-pci_fixes.patch
new file mode 100644
index 0000000000..02cd2f063c
--- /dev/null
+++ b/target/linux/rb532-2.6/patches/210-pci_fixes.patch
@@ -0,0 +1,46 @@
+diff -urN linux.old/drivers/pci/probe.c linux.dev/drivers/pci/probe.c
+--- linux.old/drivers/pci/probe.c 2006-06-08 20:21:20.000000000 +0200
++++ linux.dev/drivers/pci/probe.c 2006-06-08 20:19:40.000000000 +0200
+@@ -760,15 +760,22 @@
+ u32 l;
+ u8 hdr_type;
+ int delay = 1;
+-
+- if (pci_bus_read_config_dword(bus, devfn, PCI_VENDOR_ID, &l))
+- return NULL;
+-
+- /* some broken boards return 0 or ~0 if a slot is empty: */
+- if (l == 0xffffffff || l == 0x00000000 ||
+- l == 0x0000ffff || l == 0xffff0000)
+- return NULL;
+-
++ do {
++ if (pci_bus_read_config_dword(bus, devfn, PCI_VENDOR_ID, &l))
++ return NULL;
++ /* some broken boards return 0 or ~0 if a slot is empty: */
++ if (l == 0xffffffff || l == 0x00000000 ||
++ l == 0x0000ffff || l == 0xffff0000){
++ if (delay > 4)
++ return NULL;
++ /* But that could also be the previous dev not settled */
++ pr_debug("PCI: retrying scan at 0x%x, because config is 0x%x\n",devfn,l);
++ msleep(delay);
++ delay *=2;
++ l=0;
++ }
++ }while (l==0);
++
+ /* Configuration request Retry Status */
+ while (l == 0xffff0001) {
+ msleep(delay);
+@@ -903,7 +910,10 @@
+
+ /* Go find them, Rover! */
+ for (devfn = 0; devfn < 0x100; devfn += 8)
++ {
++ if (bus->number == 0 && (devfn >> 3) > 21) break;
+ pci_scan_slot(bus, devfn);
++ }
+
+ /*
+ * After performing arch-dependent fixup of the bus, look behind