summaryrefslogtreecommitdiff
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
authorStephen Cameron <stephenmcameron@gmail.com>2015-01-23 16:44:19 -0600
committerJames Bottomley <JBottomley@Parallels.com>2015-02-02 09:57:42 -0800
commit407863cb9daddd99000c70cffb7013f47f67b29c (patch)
tree5a9011985997831a4528689283aeb13871396f86 /drivers/scsi/hpsa.c
parent07543e0c05de177f2e9612ae7756e904b329379c (diff)
hpsa: check for ctlr lockup after command allocation in main io path
Command allocation is the thing that takes the longest in the main i/o path, so check for controller lockup immediately after this to prevent submitting commands to locked up controller as much as possible. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 03fae8af23ec..834ac78c51a3 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -4097,8 +4097,15 @@ static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
dev_err(&h->pdev->dev, "cmd_alloc returned NULL!\n");
return SCSI_MLQUEUE_HOST_BUSY;
}
+ if (unlikely(lockup_detected(h))) {
+ cmd->result = DID_ERROR << 16;
+ cmd_free(h, c);
+ cmd->scsi_done(cmd);
+ return 0;
+ }
- /* Call alternate submit routine for I/O accelerated commands.
+ /*
+ * Call alternate submit routine for I/O accelerated commands.
* Retries always go down the normal I/O path.
*/
if (likely(cmd->retries == 0 &&