summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlex Gonzalez <alex.gonzalez@digi.com>2012-01-25 17:33:43 +0100
committerAlex Gonzalez <alex.gonzalez@digi.com>2012-01-25 17:33:43 +0100
commitfd98745dd8f0866c5597ae731a5a69fe0b4d2515 (patch)
tree00a388fd78e4202d87cbaff735f65443a9811471 /drivers
parentf93b0d346a465f6659cf8a15632309906f5a5bc5 (diff)
ccxmx53: da9052 battery, stop kthread on SIGKILL.
The SIGKILL signal is received on system poweroff/reboot. If the thread is not stopped, the schedule() gets interrupted and the thread executes several consecutive times. It also fails to access the I2C bus printing error messages on the console. Making the thread TASK_UNINTERRUPTIBLE before schedule stops the multiple executions, but still prints I2C access error messages sometimes, when the thread is scheduled in the middle of the poweroff/reboot. Stopping the thread on SIGKILL provides a clean shutdown. The thread won't stop on suspend as a SIGKILL is not received. Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/power/da9052-ccxmx53js-battery.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/power/da9052-ccxmx53js-battery.c b/drivers/power/da9052-ccxmx53js-battery.c
index d52e1761cf0d..ecb9c9f52541 100644
--- a/drivers/power/da9052-ccxmx53js-battery.c
+++ b/drivers/power/da9052-ccxmx53js-battery.c
@@ -562,6 +562,17 @@ static s32 monitoring_thread(void *data)
while (monitoring_thread_state == ACTIVE) {
+ if ( signal_pending(current) ){
+ siginfo_t info;
+ unsigned long signr;
+
+ signr = dequeue_signal_lock(current, &current->blocked, &info);
+ if( signr == SIGKILL ){
+ monitoring_thread_state = INACTIVE;
+ break;
+ }
+ }
+
/* Make this thread friendly to system suspend and resume */
try_to_freeze();