Blob Blame History Raw
From: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Date: Fri, 6 May 2022 00:18:06 +0530
Subject: scsi: mpi3mr: Return I/Os to an unrecoverable HBA with DID_ERROR
Git-commit: 256bd4f23d9cecaba2e6795f0058fa9c2362698c
Patch-mainline: v5.19-rc1
References: jsc#PED-1446

Complete all new I/O requests issued to an unrecoverable controller with
DID_ERROR status instead of returning the I/O requests with
SCSI_MLQUEUE_HOST_BUSY. This will prevent the infinite retries of the new
I/Os when a controller is in an unrecoverable state.

Link: https://lore.kernel.org/r/20220505184808.24049-1-sreekanth.reddy@broadcom.com
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Lee Duncan <lduncan@suse.com>
---
 drivers/scsi/mpi3mr/mpi3mr_os.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 70da6d8e7c3c..f5c345d1ffa1 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -4002,6 +4002,12 @@ static int mpi3mr_qcmd(struct Scsi_Host *shost,
 	int iprio_class;
 	u8 is_pcie_dev = 0;
 
+	if (mrioc->unrecoverable) {
+		scmd->result = DID_ERROR << 16;
+		scsi_done(scmd);
+		goto out;
+	}
+
 	sdev_priv_data = scmd->device->hostdata;
 	if (!sdev_priv_data || !sdev_priv_data->tgt_priv_data) {
 		scmd->result = DID_NO_CONNECT << 16;