1 From: Andi Kleen <ak@linux.intel.com>
2 Subject: Only scan the root bus in early PCI quirks.
4 Patch-Mainline: submitted for .29
6 We found a situation on Linus' machine that the Nvidia timer
7 quirk hit on a Intel chipset system. The problem is that the
8 system has a fancy Nvidia card with an own PCI bridge, and
9 the early-quirks code looking for any NVidia bridge triggered
10 on it incorrectly. This didn't lead a boot failure by luck,
11 but the timer routing code selecting the wrong timer first and
12 some ugly messages. It might lead to real problems on
15 I checked all the devices which are currently checked for
16 by early_quirks and it turns out they are all located in
19 So change the early-quirks loop to only scan bus 0. This
20 incidently also saves quite some unnecessary scanning work,
21 because early_quirks doesn't go through all the non root
24 The graphics card is not on bus 0, so it is not matched
27 Signed-off-by: Andi Kleen <ak@linux.intel.com>
28 Signed-off-by: Thomas Renninger <trenn@suse.de>
30 Index: linux-2.6.28-rc5-test/arch/x86/kernel/early-quirks.c
31 ===================================================================
32 --- linux-2.6.28-rc5-test.orig/arch/x86/kernel/early-quirks.c
33 +++ linux-2.6.28-rc5-test/arch/x86/kernel/early-quirks.c
34 @@ -200,6 +200,12 @@ struct chipset {
35 void (*f)(int num, int slot, int func);
39 + * Only works for devices on the root bus. If you add any devices
40 + * not on bus 0 readd another loop level in early_quirks(). But
41 + * be careful because at least the Nvidia quirk here relies on
42 + * only matching on bus 0.
44 static struct chipset early_qrk[] __initdata = {
45 { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
46 PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, QFLAG_APPLY_ONCE, nvidia_bugs },
47 @@ -266,17 +272,17 @@ static int __init check_dev_quirk(int nu
49 void __init early_quirks(void)
51 - int num, slot, func;
54 if (!early_pci_allowed())
57 /* Poor man's PCI discovery */
58 - for (num = 0; num < 32; num++)
59 - for (slot = 0; slot < 32; slot++)
60 - for (func = 0; func < 8; func++) {
61 - /* Only probe function 0 on single fn devices */
62 - if (check_dev_quirk(num, slot, func))
65 + /* Only scan the root bus */
66 + for (slot = 0; slot < 32; slot++)
67 + for (func = 0; func < 8; func++) {
68 + /* Only probe function 0 on single fn devices */
69 + if (check_dev_quirk(0, slot, func))