]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.xen/xen3-bug-531260-x86-pci-insert-ioapic-resource-before-assigning-unassigned-resources.patch
Fix oinkmaster patch.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.xen / xen3-bug-531260-x86-pci-insert-ioapic-resource-before-assigning-unassigned-resources.patch
CommitLineData
82094b55
AF
1From: Rafael J. Wysocki <rjw@suse.de>
2Subject: x86_64 / PCI: Insert IO-APIC resources before unassigned resources
3References: bnc#531260
4Patch-upstream: Yes
5
6Based on upstream commit 857fdc53a0a90c3ba7fcf5b1fb4c7a62ae03cf82
7(x86/pci: insert ioapic resource before assigning unassigned
8resources) from Yinghai Lu <yinghai@kernel.org>.
9
10It turns out that:
11(1) AMD-based systems have two HT chains.
12(2) BIOS doesn't allocate resources for BAR 6 of devices under 8132
13 etc.
14(3) Multi-peer-root patch will try to split root resources to peer
15 root resources according to PCI conf of NB
16(4) PCI core assigns unassigned resources, but they overlap with BARs
17 that are used by IO-APIC addr of io4 and 8132.
18
19This happens because at that point the IO-APIC resources have not
20been inserted yet. The solution is to insert IO-APIC resources into
21the tree a bit earlier.
22
23Signed-off-by: Rafael J. Wysocki <rjw@suse.de>
24Automatically created from "patches.arch/bug-531260-x86-pci-insert-ioapic-resource-before-assigning-unassigned-resources.patch" by xen-port-patches.py
25
26--- sle11-2009-10-08.orig/arch/x86/kernel/io_apic_64-xen.c 2009-03-24 10:19:57.000000000 +0100
27+++ sle11-2009-10-08/arch/x86/kernel/io_apic_64-xen.c 2009-10-08 12:18:42.000000000 +0200
28@@ -2423,7 +2423,7 @@ void __init ioapic_init_mappings(void)
29 }
30 }
31
32-static int __init ioapic_insert_resources(void)
33+void __init ioapic_insert_resources(void)
34 {
35 int i;
36 struct resource *r = ioapic_resources;
37@@ -2431,18 +2431,12 @@ static int __init ioapic_insert_resource
38 if (!r) {
39 printk(KERN_ERR
40 "IO APIC resources could be not be allocated.\n");
41- return -1;
42+ return;
43 }
44
45 for (i = 0; i < nr_ioapics; i++) {
46 insert_resource(&iomem_resource, r);
47 r++;
48 }
49-
50- return 0;
51 }
52-
53-/* Insert the IO APIC resources after PCI initialization has occured to handle
54- * IO APICS that are mapped in on a BAR in PCI space. */
55-late_initcall(ioapic_insert_resources);
56 #endif /* !CONFIG_XEN */
57--- sle11-2009-10-08.orig/arch/x86/pci/i386.c 2009-10-08 12:08:34.000000000 +0200
58+++ sle11-2009-10-08/arch/x86/pci/i386.c 2009-10-08 12:19:13.000000000 +0200
59@@ -228,12 +228,14 @@ void __init pcibios_resource_survey(void
60 pcibios_allocate_bus_resources(&pci_root_buses);
61 pcibios_allocate_resources(0);
62 pcibios_allocate_resources(1);
63+#ifndef CONFIG_XEN
64 /*
65 * Insert the IO APIC resources after PCI initialization has
66 * occured to handle IO APICS that are mapped in on a BAR in
67 * PCI space, but before trying to assign unassigned pci res.
68 */
69 ioapic_insert_resources();
70+#endif
71 }
72
73 /**