@@ -173,6 +173,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;
@@ -2043,6 +2047,13 @@ scsih_sdev_init(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);
@@ -2121,6 +2132,9 @@ scsih_sdev_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;