Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b09e66da authored by Sumit.Saxena@lsi.com's avatar Sumit.Saxena@lsi.com Committed by James Bottomley
Browse files

[SCSI] megaraid_sas: Return DID_ERROR for SCSI IO, when controller is in critical h/w error



Do not return SCSI_MLQUEUE_HOST_BUSY, but send DID_ERROR to SCSI mid-layer, if
adapter is in critical error state.  "SCSI_MLQUEUE_HOST_BUSY" will keep same
SCSI command in loop and it is not a right return value, if controller is
hardware critical error.

Signed-off-by: default avatarSumit Saxena <sumit.saxena@lsi.com>
Signed-off-by: default avatarKashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 28ce280f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1471,6 +1471,14 @@ megasas_queue_command_lck(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd
		return SCSI_MLQUEUE_HOST_BUSY;

	spin_lock_irqsave(&instance->hba_lock, flags);

	if (instance->adprecovery == MEGASAS_HW_CRITICAL_ERROR) {
		spin_unlock_irqrestore(&instance->hba_lock, flags);
		scmd->result = DID_ERROR << 16;
		done(scmd);
		return 0;
	}

	if (instance->adprecovery != MEGASAS_HBA_OPERATIONAL) {
		spin_unlock_irqrestore(&instance->hba_lock, flags);
		return SCSI_MLQUEUE_HOST_BUSY;