All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mpt3sas: Stop Error handler escalation when device removed
@ 2022-08-16  8:08 Sreekanth Reddy
  2022-09-01  4:09 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Sreekanth Reddy @ 2022-08-16  8:08 UTC (permalink / raw)
  To: linux-scsi; +Cc: martin.petersen, Sreekanth Reddy

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

If SCSI Error Handler is going on for timedout I/Os on a drive
and that corresponding drive is removed then stop escalating to
higher level of reset by returning the TUR with
"I_T NEXUS LOSS OCCURRED" sense key.

Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index e54747a..465603b 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -5156,6 +5156,19 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
 
 	/* invalid device handle */
 	handle = sas_target_priv_data->handle;
+
+	/*
+	 * Avoid error handling escallation when device is disconnected
+	 */
+	if (handle == MPT3SAS_INVALID_DEVICE_HANDLE || sas_device_priv_data->block) {
+		if (scmd->device->host->shost_state == SHOST_RECOVERY &&
+		    scmd->cmnd[0] == TEST_UNIT_READY) {
+			scsi_build_sense(scmd, 0, UNIT_ATTENTION, 0x29, 0x07);
+			scsi_done(scmd);
+			return 0;
+		}
+	}
+
 	if (handle == MPT3SAS_INVALID_DEVICE_HANDLE) {
 		scmd->result = DID_NO_CONNECT << 16;
 		scsi_done(scmd);
-- 
2.27.0


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mpt3sas: Stop Error handler escalation when device removed
  2022-08-16  8:08 [PATCH] mpt3sas: Stop Error handler escalation when device removed Sreekanth Reddy
@ 2022-09-01  4:09 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2022-09-01  4:09 UTC (permalink / raw)
  To: Sreekanth Reddy; +Cc: linux-scsi, martin.petersen


Sreekanth,

> If SCSI Error Handler is going on for timedout I/Os on a drive and
> that corresponding drive is removed then stop escalating to higher
> level of reset by returning the TUR with "I_T NEXUS LOSS OCCURRED"
> sense key.

Applied to 6.1/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-01  4:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-16  8:08 [PATCH] mpt3sas: Stop Error handler escalation when device removed Sreekanth Reddy
2022-09-01  4:09 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.