ipmi_ssif: Use interruptible completion for waiting in the thread
authorCorey Minyard <cminyard@mvista.com>
Sat, 4 Apr 2015 06:54:26 +0000 (01:54 -0500)
committerCorey Minyard <cminyard@mvista.com>
Sat, 11 Apr 2015 01:51:42 +0000 (20:51 -0500)
The code was using an normal completion, but that caused stuck
task errors after a while.  Use an interruptible one to avoid that.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
drivers/char/ipmi/ipmi_ssif.c

index f6e378dac5f5b1031530839d5967ab96607f1f7b..f40e3bd2c69c265400f1241900be8dddd26b51e8 100644 (file)
@@ -468,11 +468,13 @@ static int ipmi_ssif_thread(void *data)
                int result;
 
                /* Wait for something to do */
-               wait_for_completion(&ssif_info->wake_thread);
-               init_completion(&ssif_info->wake_thread);
-
+               result = wait_for_completion_interruptible(
+                                               &ssif_info->wake_thread);
                if (ssif_info->stopping)
                        break;
+               if (result == -ERESTARTSYS)
+                       continue;
+               init_completion(&ssif_info->wake_thread);
 
                if (ssif_info->i2c_read_write == I2C_SMBUS_WRITE) {
                        result = i2c_smbus_write_block_data(