[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230901094127.2010873-15-haowenchao2@huawei.com>
Date: Fri, 1 Sep 2023 17:41:22 +0800
From: Wenchao Hao <haowenchao2@...wei.com>
To: "James E . J . Bottomley" <jejb@...ux.ibm.com>,
"Martin K . Petersen" <martin.petersen@...cle.com>,
<linux-scsi@...r.kernel.org>
CC: Hannes Reinecke <hare@...e.de>, <linux-kernel@...r.kernel.org>,
<louhongxiang@...wei.com>, <lixiaokeng@...wei.com>,
Wenchao Hao <haowenchao2@...wei.com>
Subject: [RFC PATCH v2 14/19] scsi: mpt3sas: Add param to control LUN based error handle
Add new module param lun_eh to control if enable LUN based
error handler, since mpt3sas defined callback eh_host_reset
and eh_target_reset, so make it fallback to further recover
when LUN based recovery can not recover all error commands.
Signed-off-by: Wenchao Hao <haowenchao2@...wei.com>
---
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index c3c1f466fe01..7a48e89c3e5d 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -174,6 +174,10 @@ module_param(host_tagset_enable, int, 0444);
MODULE_PARM_DESC(host_tagset_enable,
"Shared host tagset enable/disable Default: enable(1)");
+static bool lun_eh;
+module_param(lun_eh, bool, 0444);
+MODULE_PARM_DESC(lun_eh, "LUN based error handle (def=0)");
+
/* raid transport support */
static struct raid_template *mpt3sas_raid_template;
static struct raid_template *mpt2sas_raid_template;
@@ -2044,6 +2048,13 @@ scsih_slave_alloc(struct scsi_device *sdev)
struct _sas_device *sas_device;
struct _pcie_device *pcie_device;
unsigned long flags;
+ int ret = 0;
+
+ if (lun_eh) {
+ ret = scsi_device_setup_eh(sdev, 1);
+ if (ret)
+ return ret;
+ }
sas_device_priv_data = kzalloc(sizeof(*sas_device_priv_data),
GFP_KERNEL);
@@ -2122,6 +2133,9 @@ scsih_slave_destroy(struct scsi_device *sdev)
struct _pcie_device *pcie_device;
unsigned long flags;
+ if (lun_eh)
+ scsi_device_clear_eh(sdev);
+
if (!sdev->hostdata)
return;
--
2.35.3
Powered by blists - more mailing lists