]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.xen/xen3-acpi_assure_unique_processor_proc_creation.patch
Fix oinkmaster patch.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.xen / xen3-acpi_assure_unique_processor_proc_creation.patch
1 From: Zhao Yakui <yakui.zhao@intel.com>
2 Subject: ACPI: Rename ACPI processor device bus ID
3 References: bnc#528769
4 Patch-Mainline: yes
5 Commit-ID: 7a04b8491a077471a34938b8ca060c37220953be
6
7 Signed-off-by: Thomas Renninger <trenn@suse.de>
8
9 Some BIOS re-use the same processor bus id
10 in different scope:
11
12 \_SB.SCK0.CPU0
13 \_SB.SCK1.CPU0
14
15 But the (deprecated) /proc/acpi/ interface
16 assumes the bus-id's are unique, resulting in an OOPS
17 when the processor driver is loaded:
18
19 WARNING: at fs/proc/generic.c:590 proc_register+0x148/0x180()
20 Hardware name: Sunrise Ridge
21 proc_dir_entry 'processor/CPU0' already registered
22 Call Trace:
23 [<ffffffff8023f7ef>] warn_slowpath+0xb1/0xe5
24 [<ffffffff8036243b>] ? ida_get_new_above+0x190/0x1b1
25 [<ffffffff803625a8>] ? idr_pre_get+0x5f/0x75
26 [<ffffffff8030b2f6>] proc_register+0x148/0x180
27 [<ffffffff8030b4ff>] proc_mkdir_mode+0x3d/0x52
28 [<ffffffff8030b525>] proc_mkdir+0x11/0x13
29 [<ffffffffa0014b89>] acpi_processor_start+0x755/0x9bc [processor]
30
31 Rename the processor device bus id. And the new bus id will be
32 generated as the following format:
33 CPU+ CPU ID
34
35 For example: If the cpu ID is 5, then the bus ID will be "CPU5".
36 If the CPU ID is 10, then the bus ID will be "CPUA".
37
38 Yes, this will change the directory names seen
39 in /proc/acpi/processor/* on some systems.
40 Before this patch, those directory names where
41 totally arbitrary strings based on the interal AML device strings.
42
43 http://bugzilla.kernel.org/show_bug.cgi?id=13612
44
45 Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
46 Signed-off-by: Len Brown <len.brown@intel.com>
47
48 Automatically created from "patches.fixes/acpi_assure_unique_processor_proc_creation.patch" by xen-port-patches.py
49
50 --- sle11-2009-09-18.orig/drivers/acpi/processor_core.c 2009-09-24 11:28:54.000000000 +0200
51 +++ sle11-2009-09-18/drivers/acpi/processor_core.c 2009-09-21 09:15:34.000000000 +0200
52 @@ -634,7 +634,11 @@ static int acpi_processor_get_info(struc
53 * generated as the following format:
54 * CPU+CPU ID.
55 */
56 - sprintf(acpi_device_bid(device), "CPU%X", pr->id);
57 + if (pr->id != -1)
58 + sprintf(acpi_device_bid(device), "CPU%X", pr->id);
59 + else
60 + snprintf(acpi_device_bid(device), ACPI_DEVICE_BID_SIZE,
61 + "#%0*X", ACPI_DEVICE_BID_SIZE - 2, pr->acpi_id);
62 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Processor [%d:%d]\n", pr->id,
63 pr->acpi_id));
64
65 --- sle11-2009-09-18.orig/include/acpi/acpi_bus.h 2009-09-24 11:28:54.000000000 +0200
66 +++ sle11-2009-09-18/include/acpi/acpi_bus.h 2009-09-24 11:29:48.000000000 +0200
67 @@ -199,6 +199,10 @@ struct acpi_device_pnp {
68 acpi_device_class device_class; /* " */
69 };
70
71 +#define ACPI_DEVICE_BID_SIZE \
72 + ((unsigned int)(offsetof(struct acpi_device_pnp, bus_address) - \
73 + offsetof(struct acpi_device_pnp, bus_id)))
74 +
75 #define acpi_device_bid(d) ((d)->pnp.bus_id)
76 #define acpi_device_adr(d) ((d)->pnp.bus_address)
77 #define acpi_device_hid(d) ((d)->pnp.hardware_id)