hpsa: check for ctlr lockup after command allocation in main io path
authorStephen Cameron <stephenmcameron@gmail.com>
Fri, 23 Jan 2015 22:44:19 +0000 (16:44 -0600)
committerJames Bottomley <JBottomley@Parallels.com>
Mon, 2 Feb 2015 17:57:42 +0000 (09:57 -0800)
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>
drivers/scsi/hpsa.c

index 03fae8af23eca3fca8a290926382967695a702bd..834ac78c51a3cc233c43f6f721702747f65bbfa3 100644 (file)
@@ -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 &&
This page took 0.041383 seconds and 5 git commands to generate.