[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230901094127.2010873-17-haowenchao2@huawei.com>
Date: Fri, 1 Sep 2023 17:41:24 +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 16/19] scsi: smartpqi: Add param to control LUN based error handle
Add new param lun_eh to control if enable LUN based error handler, since
smartpqi did not define other further reset callbacks, it is not
necessary to fallback to further recover any more, so set the LUN
error handler with fallback set to 0.
Signed-off-by: Wenchao Hao <haowenchao2@...wei.com>
---
drivers/scsi/smartpqi/smartpqi_init.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 6aaaa7ebca37..107156d85d85 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -187,6 +187,10 @@ module_param_named(ctrl_ready_timeout,
MODULE_PARM_DESC(ctrl_ready_timeout,
"Timeout in seconds for driver to wait for controller ready.");
+static bool pqi_lun_eh;
+module_param_named(lun_eh, pqi_lun_eh, bool, 0444);
+MODULE_PARM_DESC(lun_eh, "LUN based error handle (def=0)");
+
static char *raid_levels[] = {
"RAID-0",
"RAID-4",
@@ -6356,6 +6360,13 @@ static int pqi_slave_alloc(struct scsi_device *sdev)
struct pqi_ctrl_info *ctrl_info;
struct scsi_target *starget;
struct sas_rphy *rphy;
+ int ret = 0;
+
+ if (pqi_lun_eh) {
+ ret = scsi_device_setup_eh(sdev, 0);
+ if (ret)
+ return ret;
+ }
ctrl_info = shost_to_hba(sdev->host);
@@ -6439,6 +6450,9 @@ static void pqi_slave_destroy(struct scsi_device *sdev)
ctrl_info = shost_to_hba(sdev->host);
+ if (pqi_lun_eh)
+ scsi_device_clear_eh(sdev);
+
mutex_acquired = mutex_trylock(&ctrl_info->scan_mutex);
if (!mutex_acquired)
return;
--
2.35.3
Powered by blists - more mailing lists