]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.32.10/thinkpad-acpi-fix-poll-thread-auto-start.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.10 / thinkpad-acpi-fix-poll-thread-auto-start.patch
1 From b589ea4c44170d3f7a845684e2d1b3b9571663af Mon Sep 17 00:00:00 2001
2 From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
3 Date: Thu, 25 Feb 2010 21:28:58 -0300
4 Subject: thinkpad-acpi: fix poll thread auto-start
5
6 From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
7
8 commit b589ea4c44170d3f7a845684e2d1b3b9571663af upstream.
9
10 The driver was not starting the NVRAM polling thread if the input
11 device was bound immediately after registration.
12
13 This fixes:
14 http://bugzilla.kernel.org/show_bug.cgi?id=15118
15
16 Reported-by: Florian Zumbiehl <florz@florz.de>
17 Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
19
20 ---
21 drivers/platform/x86/thinkpad_acpi.c | 15 ++++++---------
22 1 file changed, 6 insertions(+), 9 deletions(-)
23
24 --- a/drivers/platform/x86/thinkpad_acpi.c
25 +++ b/drivers/platform/x86/thinkpad_acpi.c
26 @@ -2597,16 +2597,11 @@ static int hotkey_inputdev_open(struct i
27 {
28 switch (tpacpi_lifecycle) {
29 case TPACPI_LIFE_INIT:
30 - /*
31 - * hotkey_init will call hotkey_poll_setup_safe
32 - * at the appropriate moment
33 - */
34 - return 0;
35 - case TPACPI_LIFE_EXITING:
36 - return -EBUSY;
37 case TPACPI_LIFE_RUNNING:
38 hotkey_poll_setup_safe(false);
39 return 0;
40 + case TPACPI_LIFE_EXITING:
41 + return -EBUSY;
42 }
43
44 /* Should only happen if tpacpi_lifecycle is corrupt */
45 @@ -2617,7 +2612,7 @@ static int hotkey_inputdev_open(struct i
46 static void hotkey_inputdev_close(struct input_dev *dev)
47 {
48 /* disable hotkey polling when possible */
49 - if (tpacpi_lifecycle == TPACPI_LIFE_RUNNING &&
50 + if (tpacpi_lifecycle != TPACPI_LIFE_EXITING &&
51 !(hotkey_source_mask & hotkey_driver_mask))
52 hotkey_poll_setup_safe(false);
53 }
54 @@ -8362,6 +8357,9 @@ static int __init thinkpad_acpi_module_i
55 return ret;
56 }
57 }
58 +
59 + tpacpi_lifecycle = TPACPI_LIFE_RUNNING;
60 +
61 ret = input_register_device(tpacpi_inputdev);
62 if (ret < 0) {
63 printk(TPACPI_ERR "unable to register input device\n");
64 @@ -8371,7 +8369,6 @@ static int __init thinkpad_acpi_module_i
65 tp_features.input_device_registered = 1;
66 }
67
68 - tpacpi_lifecycle = TPACPI_LIFE_RUNNING;
69 return 0;
70 }
71