]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.13/aacraid-relinquish-cpu-during-timeout-wait.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.13 / aacraid-relinquish-cpu-during-timeout-wait.patch
CommitLineData
375caec0
GKH
1From 07beca2be24cc710461c0b131832524c9ee08910 Mon Sep 17 00:00:00 2001
2From: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
3Date: Mon, 25 Apr 2016 23:31:26 -0700
4Subject: aacraid: Relinquish CPU during timeout wait
5
6From: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
7
8commit 07beca2be24cc710461c0b131832524c9ee08910 upstream.
9
10aac_fib_send has a special function case for initial commands during
11driver initialization using wait < 0(pseudo sync mode). In this case,
12the command does not sleep but rather spins checking for timeout.This
13loop is calls cpu_relax() in an attempt to allow other processes/threads
14to use the CPU, but this function does not relinquish the CPU and so the
15command will hog the processor. This was observed in a KDUMP
16"crashkernel" and that prevented the "command thread" (which is
17responsible for completing the command from being timed out) from
18starting because it could not get the CPU.
19
20Fixed by replacing "cpu_relax()" call with "schedule()"
21Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
22Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
23Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25
26---
27 drivers/scsi/aacraid/commsup.c | 8 ++++----
28 1 file changed, 4 insertions(+), 4 deletions(-)
29
30--- a/drivers/scsi/aacraid/commsup.c
31+++ b/drivers/scsi/aacraid/commsup.c
32@@ -611,10 +611,10 @@ int aac_fib_send(u16 command, struct fib
33 }
34 return -EFAULT;
35 }
36- /* We used to udelay() here but that absorbed
37- * a CPU when a timeout occured. Not very
38- * useful. */
39- cpu_relax();
40+ /*
41+ * Allow other processes / CPUS to use core
42+ */
43+ schedule();
44 }
45 } else if (down_interruptible(&fibptr->event_wait)) {
46 /* Do nothing ... satisfy