]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.4.28/acpi-cpuidle-fix-null-pointer-issues-when-cpuidle-is-disabled.patch
Drop watchdog patch
[thirdparty/kernel/stable-queue.git] / releases / 3.4.28 / acpi-cpuidle-fix-null-pointer-issues-when-cpuidle-is-disabled.patch
1 From b88a634a903d9670aa5f2f785aa890628ce0dece Mon Sep 17 00:00:00 2001
2 From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
3 Date: Wed, 16 Jan 2013 23:40:07 +0100
4 Subject: ACPI / cpuidle: Fix NULL pointer issues when cpuidle is disabled
5
6 From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
7
8 commit b88a634a903d9670aa5f2f785aa890628ce0dece upstream.
9
10 If cpuidle is disabled, that means that:
11
12 per_cpu(acpi_cpuidle_device, pr->id)
13
14 is set to NULL as the acpi_processor_power_init ends up failing at
15
16 retval = cpuidle_register_driver(&acpi_idle_driver)
17
18 (in acpi_processor_power_init) and never sets the per_cpu idle
19 device. So when acpi_processor_hotplug on CPU online notification
20 tries to reference said device it crashes:
21
22 cpu 3 spinlock event irq 62
23 BUG: unable to handle kernel NULL pointer dereference at 0000000000000004
24 IP: [<ffffffff81381013>] acpi_processor_setup_cpuidle_cx+0x3f/0x105
25 PGD a259b067 PUD ab38b067 PMD 0
26 Oops: 0002 [#1] SMP
27 odules linked in: dm_multipath dm_mod xen_evtchn iscsi_boot_sysfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi libcrc32c crc32c nouveau mxm_wmi wmi radeon ttm sg sr_mod sd_mod cdrom ata_generic ata_piix libata crc32c_intel scsi_mod atl1c i915 fbcon tileblit font bitblit softcursor drm_kms_helper video xen_blkfront xen_netfront fb_sys_fops sysimgblt sysfillrect syscopyarea xenfs xen_privcmd mperf
28 CPU 1
29 Pid: 3047, comm: bash Not tainted 3.8.0-rc3upstream-00250-g165c029 #1 MSI MS-7680/H61M-P23 (MS-7680)
30 RIP: e030:[<ffffffff81381013>] [<ffffffff81381013>] acpi_processor_setup_cpuidle_cx+0x3f/0x105
31 RSP: e02b:ffff88001742dca8 EFLAGS: 00010202
32 RAX: 0000000000010be9 RBX: ffff8800a0a61800 RCX: ffff880105380000
33 RDX: 0000000000000003 RSI: 0000000000000200 RDI: ffff8800a0a61800
34 RBP: ffff88001742dce8 R08: ffffffff81812360 R09: 0000000000000200
35 R10: aaaaaaaaaaaaaaaa R11: 0000000000000001 R12: ffff8800a0a61800
36 R13: 00000000ffffff01 R14: 0000000000000000 R15: ffffffff81a907a0
37 FS: 00007fd6942f7700(0000) GS:ffff880105280000(0000) knlGS:0000000000000000
38 CS: e033 DS: 0000 ES: 0000 CR0: 0000000080050033
39 CR2: 0000000000000004 CR3: 00000000a6773000 CR4: 0000000000042660
40 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
41 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
42 Process bash (pid: 3047, threadinfo ffff88001742c000, task ffff880017944000)
43 Stack:
44 0000000000000150 ffff880100f59e00 ffff88001742dcd8 ffff8800a0a61800
45 0000000000000000 00000000ffffff01 0000000000000000 ffffffff81a907a0
46 ffff88001742dd18 ffffffff813815b1 ffff88001742dd08 ffffffff810ae336
47 Call Trace:
48 [<ffffffff813815b1>] acpi_processor_hotplug+0x7c/0x9f
49 [<ffffffff810ae336>] ? schedule_delayed_work_on+0x16/0x20
50 [<ffffffff8137ee8f>] acpi_cpu_soft_notify+0x90/0xca
51 [<ffffffff8166023d>] notifier_call_chain+0x4d/0x70
52 [<ffffffff810bc369>] __raw_notifier_call_chain+0x9/0x10
53 [<ffffffff81094a4b>] __cpu_notify+0x1b/0x30
54 [<ffffffff81652cf7>] _cpu_up+0x103/0x14b
55 [<ffffffff81652e18>] cpu_up+0xd9/0xec
56 [<ffffffff8164a254>] store_online+0x94/0xd0
57 [<ffffffff814122fb>] dev_attr_store+0x1b/0x20
58 [<ffffffff81216404>] sysfs_write_file+0xf4/0x170
59
60 This patch fixes it.
61
62 Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
63 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
64 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
65
66 ---
67 drivers/acpi/processor_idle.c | 3 +++
68 1 file changed, 3 insertions(+)
69
70 --- a/drivers/acpi/processor_idle.c
71 +++ b/drivers/acpi/processor_idle.c
72 @@ -1018,6 +1018,9 @@ static int acpi_processor_setup_cpuidle_
73 return -EINVAL;
74 }
75
76 + if (!dev)
77 + return -EINVAL;
78 +
79 dev->cpu = pr->id;
80
81 if (max_cstate == 0)