aacraid: Relinquish CPU during timeout wait
authorRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Tue, 26 Apr 2016 06:31:26 +0000 (23:31 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 29 Apr 2016 23:08:24 +0000 (19:08 -0400)
aac_fib_send has a special function case for initial commands during
driver initialization using wait < 0(pseudo sync mode). In this case,
the command does not sleep but rather spins checking for timeout.This
loop is calls cpu_relax() in an attempt to allow other processes/threads
to use the CPU, but this function does not relinquish the CPU and so the
command will hog the processor. This was observed in a KDUMP
"crashkernel" and that prevented the "command thread" (which is
responsible for completing the command from being timed out) from
starting because it could not get the CPU.

Fixed by replacing "cpu_relax()" call with "schedule()"
Cc: stable@vger.kernel.org
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/aacraid/commsup.c

index 511bbc5..725aa78 100644 (file)
@@ -637,10 +637,10 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
                                        }
                                        return -EFAULT;
                                }
-                               /* We used to udelay() here but that absorbed
-                                * a CPU when a timeout occured. Not very
-                                * useful. */
-                               cpu_relax();
+                               /*
+                                * Allow other processes / CPUS to use core
+                                */
+                               schedule();
                        }
                } else if (down_interruptible(&fibptr->event_wait)) {
                        /* Do nothing ... satisfy