]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.arch/x86_restrict_pci_early_quirks_to_root_bridges.patch
Fix oinkmaster patch.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.arch / x86_restrict_pci_early_quirks_to_root_bridges.patch
1 From: Andi Kleen <ak@linux.intel.com>
2 Subject: Only scan the root bus in early PCI quirks.
3 References: bnc#57886
4 Patch-Mainline: submitted for .29
5
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
13 other systems.
14
15 I checked all the devices which are currently checked for
16 by early_quirks and it turns out they are all located in
17 the root bus zero.
18
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
22 busses.
23
24 The graphics card is not on bus 0, so it is not matched
25 anymore.
26
27 Signed-off-by: Andi Kleen <ak@linux.intel.com>
28 Signed-off-by: Thomas Renninger <trenn@suse.de>
29
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);
36 };
37
38 +/*
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.
43 + */
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
48
49 void __init early_quirks(void)
50 {
51 - int num, slot, func;
52 + int slot, func;
53
54 if (!early_pci_allowed())
55 return;
56
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))
63 - break;
64 - }
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))
70 + break;
71 + }
72 }