Skip to content

Commit ca7bb25

Browse files
Raghava Aditya Renukuntasashalevin
authored andcommitted
aacraid: Fix for aac_command_thread hang
[ Upstream commit fc4bf75 ] Typically under error conditions, it is possible for aac_command_thread() to miss the wakeup from kthread_stop() and go back to sleep, causing it to hang aac_shutdown. In the observed scenario, the adapter is not functioning correctly and so aac_fib_send() never completes (or time-outs depending on how it was called). Shortly after aac_command_thread() starts it performs aac_fib_send(SendHostTime) which hangs. When aac_probe_one /aac_get_adapter_info send time outs, kthread_stop is called which breaks the command thread out of it's hang. The code will still go back to sleep in schedule_timeout() without checking kthread_should_stop() so it causes aac_probe_one to hang until the schedule_timeout() which is 30 minutes. Fixed by: Adding another kthread_should_stop() before schedule_timeout() Cc: [email protected] Signed-off-by: Raghava Aditya Renukunta <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent e452f73 commit ca7bb25

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/scsi/aacraid/commsup.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,6 +1999,10 @@ int aac_command_thread(void *data)
19991999
if (difference <= 0)
20002000
difference = 1;
20012001
set_current_state(TASK_INTERRUPTIBLE);
2002+
2003+
if (kthread_should_stop())
2004+
break;
2005+
20022006
schedule_timeout(difference);
20032007

20042008
if (kthread_should_stop())

0 commit comments

Comments
 (0)