aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2013-04-17 18:58:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-17 19:10:44 -0400
commit355f1ecbcc81efb6611290b772e7ae77ece4059c (patch)
tree38a8e2067efa8bf06baa63217020ee51680027f0 /drivers/platform
parentfca83168aae6fa0c36a923ef99311587ad5b54f2 (diff)
thinkpad-acpi: kill hotkey_thread_mutex
hotkey_kthread() does try_to_freeze() under hotkey_thread_mutex. We can simply kill this mutex, hotkey_poll_stop_sync() does not need to serialize with hotkey_kthread(). When kthread_stop() returns the thread is already dead, it called do_exit()->complete_vfork_done(). Reported-by: Artem Savkov <artem.savkov@gmail.com> Reported-by: Maciej Rutecki <maciej.rutecki@gmail.com> Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: Matthew Garrett <matthew.garrett@nebula.com> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Reviewed-by: Mandeep Singh Baines <msb@chromium.org> Cc: Aaron Lu <aaron.lu@intel.com> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 9a907567f41e..edec135b1685 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -1964,9 +1964,6 @@ struct tp_nvram_state {
1964/* kthread for the hotkey poller */ 1964/* kthread for the hotkey poller */
1965static struct task_struct *tpacpi_hotkey_task; 1965static struct task_struct *tpacpi_hotkey_task;
1966 1966
1967/* Acquired while the poller kthread is running, use to sync start/stop */
1968static struct mutex hotkey_thread_mutex;
1969
1970/* 1967/*
1971 * Acquire mutex to write poller control variables as an 1968 * Acquire mutex to write poller control variables as an
1972 * atomic block. 1969 * atomic block.
@@ -2462,8 +2459,6 @@ static int hotkey_kthread(void *data)
2462 unsigned int poll_freq; 2459 unsigned int poll_freq;
2463 bool was_frozen; 2460 bool was_frozen;
2464 2461
2465 mutex_lock(&hotkey_thread_mutex);
2466
2467 if (tpacpi_lifecycle == TPACPI_LIFE_EXITING) 2462 if (tpacpi_lifecycle == TPACPI_LIFE_EXITING)
2468 goto exit; 2463 goto exit;
2469 2464
@@ -2523,7 +2518,6 @@ static int hotkey_kthread(void *data)
2523 } 2518 }
2524 2519
2525exit: 2520exit:
2526 mutex_unlock(&hotkey_thread_mutex);
2527 return 0; 2521 return 0;
2528} 2522}
2529 2523
@@ -2533,9 +2527,6 @@ static void hotkey_poll_stop_sync(void)
2533 if (tpacpi_hotkey_task) { 2527 if (tpacpi_hotkey_task) {
2534 kthread_stop(tpacpi_hotkey_task); 2528 kthread_stop(tpacpi_hotkey_task);
2535 tpacpi_hotkey_task = NULL; 2529 tpacpi_hotkey_task = NULL;
2536 mutex_lock(&hotkey_thread_mutex);
2537 /* at this point, the thread did exit */
2538 mutex_unlock(&hotkey_thread_mutex);
2539 } 2530 }
2540} 2531}
2541 2532
@@ -3234,7 +3225,6 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
3234 mutex_init(&hotkey_mutex); 3225 mutex_init(&hotkey_mutex);
3235 3226
3236#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL 3227#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
3237 mutex_init(&hotkey_thread_mutex);
3238 mutex_init(&hotkey_thread_data_mutex); 3228 mutex_init(&hotkey_thread_data_mutex);
3239#endif 3229#endif
3240 3230