]>
Commit | Line | Data |
---|---|---|
375caec0 GKH |
1 | From 07beca2be24cc710461c0b131832524c9ee08910 Mon Sep 17 00:00:00 2001 |
2 | From: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> | |
3 | Date: Mon, 25 Apr 2016 23:31:26 -0700 | |
4 | Subject: aacraid: Relinquish CPU during timeout wait | |
5 | ||
6 | From: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> | |
7 | ||
8 | commit 07beca2be24cc710461c0b131832524c9ee08910 upstream. | |
9 | ||
10 | aac_fib_send has a special function case for initial commands during | |
11 | driver initialization using wait < 0(pseudo sync mode). In this case, | |
12 | the command does not sleep but rather spins checking for timeout.This | |
13 | loop is calls cpu_relax() in an attempt to allow other processes/threads | |
14 | to use the CPU, but this function does not relinquish the CPU and so the | |
15 | command will hog the processor. This was observed in a KDUMP | |
16 | "crashkernel" and that prevented the "command thread" (which is | |
17 | responsible for completing the command from being timed out) from | |
18 | starting because it could not get the CPU. | |
19 | ||
20 | Fixed by replacing "cpu_relax()" call with "schedule()" | |
21 | Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> | |
22 | Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> | |
23 | Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> | |
24 | Signed-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 |