aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/thinkpad_acpi.c
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2010-02-25 19:28:58 -0500
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>2010-02-25 19:34:23 -0500
commitb589ea4c44170d3f7a845684e2d1b3b9571663af (patch)
treee467f59b6ae8e011ed787cb91bd39bbde78a073a /drivers/platform/x86/thinkpad_acpi.c
parent7d1894d8d1c411d2dad95abfe0f65bacf68c4afa (diff)
thinkpad-acpi: fix poll thread auto-start
The driver was not starting the NVRAM polling thread if the input device was bound immediately after registration. This fixes: http://bugzilla.kernel.org/show_bug.cgi?id=15118 Reported-by: Florian Zumbiehl <florz@florz.de> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: stable@kernel.org
Diffstat (limited to 'drivers/platform/x86/thinkpad_acpi.c')
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 06657b71171c..933bcc477f4a 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -2607,16 +2607,11 @@ static int hotkey_inputdev_open(struct input_dev *dev)
2607{ 2607{
2608 switch (tpacpi_lifecycle) { 2608 switch (tpacpi_lifecycle) {
2609 case TPACPI_LIFE_INIT: 2609 case TPACPI_LIFE_INIT:
2610 /*
2611 * hotkey_init will call hotkey_poll_setup_safe
2612 * at the appropriate moment
2613 */
2614 return 0;
2615 case TPACPI_LIFE_EXITING:
2616 return -EBUSY;
2617 case TPACPI_LIFE_RUNNING: 2610 case TPACPI_LIFE_RUNNING:
2618 hotkey_poll_setup_safe(false); 2611 hotkey_poll_setup_safe(false);
2619 return 0; 2612 return 0;
2613 case TPACPI_LIFE_EXITING:
2614 return -EBUSY;
2620 } 2615 }
2621 2616
2622 /* Should only happen if tpacpi_lifecycle is corrupt */ 2617 /* Should only happen if tpacpi_lifecycle is corrupt */
@@ -2627,7 +2622,7 @@ static int hotkey_inputdev_open(struct input_dev *dev)
2627static void hotkey_inputdev_close(struct input_dev *dev) 2622static void hotkey_inputdev_close(struct input_dev *dev)
2628{ 2623{
2629 /* disable hotkey polling when possible */ 2624 /* disable hotkey polling when possible */
2630 if (tpacpi_lifecycle == TPACPI_LIFE_RUNNING && 2625 if (tpacpi_lifecycle != TPACPI_LIFE_EXITING &&
2631 !(hotkey_source_mask & hotkey_driver_mask)) 2626 !(hotkey_source_mask & hotkey_driver_mask))
2632 hotkey_poll_setup_safe(false); 2627 hotkey_poll_setup_safe(false);
2633} 2628}
@@ -9038,6 +9033,9 @@ static int __init thinkpad_acpi_module_init(void)
9038 return ret; 9033 return ret;
9039 } 9034 }
9040 } 9035 }
9036
9037 tpacpi_lifecycle = TPACPI_LIFE_RUNNING;
9038
9041 ret = input_register_device(tpacpi_inputdev); 9039 ret = input_register_device(tpacpi_inputdev);
9042 if (ret < 0) { 9040 if (ret < 0) {
9043 printk(TPACPI_ERR "unable to register input device\n"); 9041 printk(TPACPI_ERR "unable to register input device\n");
@@ -9047,7 +9045,6 @@ static int __init thinkpad_acpi_module_init(void)
9047 tp_features.input_device_registered = 1; 9045 tp_features.input_device_registered = 1;
9048 } 9046 }
9049 9047
9050 tpacpi_lifecycle = TPACPI_LIFE_RUNNING;
9051 return 0; 9048 return 0;
9052} 9049}
9053 9050