From: Stephen Cameron <stephenmcameron@xxxxxxxxx> 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@xxxxxxxx> Signed-off-by: Don Brace <don.brace@xxxxxxxx> --- drivers/scsi/hpsa.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 03fae8a..834ac78 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 && -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html