Skip to contentSkip to conversation

mpi3mr: Return IOs to an unrecoverable HBA with DID_ERROR

PATCH Applied Sreekanth Reddy 2 participants 8 messages May 5, 2022 – May 17, 2022

Subsystems (2)
lore
Share & tools
lore

Sreekanth Reddy

author maintainer
#0 lore raw

PATCH 1/1 mpi3mr: Return IOs to an unrecoverable HBA with DID_ERROR

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 the unrecoverable state.

---
 drivers/scsi/mpi3mr/mpi3mr_os.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/scsi/mpi3mr/mpi3mr_os.c +6 -0
index 89a4918..5c57519 100644
@@ -3996,6 +3996,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;
Signature · 1 line
2.27.0
author maintainer
#1 lore raw

PATCH 1/1 mpi3mr: Hidden drives not removed during soft reset

If any drive is missing during the reset, the driver checks whether the device is exposed to the OS and if it is, then only it removes the device from the OS and
its own internal list. For hidden devices even if they are found as missing during reset the driver is not removing them from its internal list. Modified driver to remove hidden devices from the driver's target device list if they are missing during soft reset.

---
 drivers/scsi/mpi3mr/mpi3mr_os.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/scsi/mpi3mr/mpi3mr_os.c +5 -3
index 5c57519..5ba490c 100644
@@ -911,9 +911,11 @@ void mpi3mr_rfresh_tgtdevs(struct mpi3mr_ioc *mrioc)
 
 	list_for_each_entry_safe(tgtdev, tgtdev_next, &mrioc->tgtdev_list,
 	    list) {
-		if ((tgtdev->dev_handle == MPI3MR_INVALID_DEV_HANDLE) &&
-		    tgtdev->host_exposed) {
-			mpi3mr_remove_tgtdev_from_host(mrioc, tgtdev);
+		if (tgtdev->dev_handle == MPI3MR_INVALID_DEV_HANDLE) {
+			dprint_reset(mrioc, "removing target device with perst_id(%d)\n",
+			    tgtdev->perst_id);
+			if (tgtdev->host_exposed)
+				mpi3mr_remove_tgtdev_from_host(mrioc, tgtdev);
 			mpi3mr_tgtdev_del_from_list(mrioc, tgtdev);
 			mpi3mr_tgtdev_put(tgtdev);
 		}
Signature · 1 line
2.27.0
#2 lore raw

Re: [PATCH] mpi3mr: Hidden drives not removed during soft reset

Sreekanth,

Quoted 7 lines

If any drive is missing during the reset, the driver checks whether the device is exposed to the OS and if it is, then only it removes the device from the OS and its own internal list. For hidden devices even if they are found as missing during reset the driver is not removing them from its internal list. Modified driver to remove hidden devices from the driver's target device list if they are missing during soft reset.

Applied to 5.19/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#3 lore raw

Re: [PATCH] mpi3mr: Hidden drives not removed during soft reset

In reply to Sreekanth Reddy
Quoted 10 lines · Sreekanth Reddy

If any drive is missing during the reset, the driver checks whether the device is exposed to the OS and if it is, then only it removes the device from the OS and
its own internal list. For hidden devices even if they are found as missing during reset the driver is not removing them from its internal list. Modified driver to remove hidden devices from the driver's target device list if they are missing during soft reset.

[...]

Applied to 5.19/scsi-queue, thanks!

[1/1] mpi3mr: Hidden drives not removed during soft reset

      https://git.kernel.org/mkp/scsi/c/2dd8389f96d6
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
author maintainer
#4 lore raw

PATCH 1/1 mpi3mr: Increase IO timeout value to 60s

In reply to Sreekanth Reddy

Set each SCSI device's default IO timeout and
default error handling IO timeout to 60s.

---
 drivers/scsi/mpi3mr/mpi3mr.h    | 3 +++
 drivers/scsi/mpi3mr/mpi3mr_os.c | 4 ++++
 2 files changed, 7 insertions(+)
drivers/scsi/mpi3mr/mpi3mr.h +3 -0
index 8612b66..584659e 100644
@@ -124,6 +124,9 @@ extern atomic64_t event_counter;
 
 #define MPI3MR_WATCHDOG_INTERVAL		1000 /* in milli seconds */
 
+#define MPI3MR_SCMD_TIMEOUT    (60 * HZ)
+#define MPI3MR_EH_SCMD_TIMEOUT (60 * HZ)
+
 /* Internal admin command state definitions*/
 #define MPI3MR_CMD_NOTUSED	0x8000
 #define MPI3MR_CMD_COMPLETE	0x0001
drivers/scsi/mpi3mr/mpi3mr_os.c +4 -0
index 5ba490c..f5c345d 100644
@@ -3727,6 +3727,10 @@ static int mpi3mr_slave_configure(struct scsi_device *sdev)
 		return -ENXIO;
 
 	mpi3mr_change_queue_depth(sdev, tgt_dev->q_depth);
+
+	sdev->eh_timeout = MPI3MR_EH_SCMD_TIMEOUT;
+	blk_queue_rq_timeout(sdev->request_queue, MPI3MR_SCMD_TIMEOUT);
+
 	switch (tgt_dev->dev_type) {
 	case MPI3_DEVICE_DEVFORM_PCIE:
 		/*The block layer hw sector size = 512*/
Signature · 1 line
2.27.0
#5 lore raw

Re: [PATCH] mpi3mr: Increase IO timeout value to 60s

Sreekanth,

Quoted 2 lines

Set each SCSI device's default IO timeout and default error handling IO timeout to 60s.

Applied to 5.19/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#7 lore raw
In reply to Sreekanth Reddy

Sreekanth,

Quoted 4 lines

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 the unrecoverable state.

Applied to 5.19/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering