Skip to contentSkip to conversation

libsas fixes discovered via isci-atapi enabling effort

PATCH In review Dan Williams 6 participants 21 messages Sep 20, 2011 – Sep 22, 2011

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover libsas fixes discovered via isci-atapi enabling effort

While enabling atapi device support for isci we encountered a condition whereby multiple srX devices (one for every possible LUN) were exported by the midlayer. Looking at other drivers showed that they had a local workaround for this and other conditions in custom ->slave_{alloc|configure} methods. Rather than add custom workaround for isci this patchset uplevels those workarounds to libsas proper.

Patch 3/5 is tagged RFC as I do not know the original history behind hard limiting libsas end devices to a queue_depth of 32. At least mvsas has been bumping this up to 64 on its own.

---

Dan Williams (5):

      libsas: disable scanning lun > 0 on ata devices
      libsas: fix ->change_queue_{depth|type} for sata devices
      libsas: dynamic queue depth
      mvsas: remove mvs_slave_{alloc|configure}
      pm8001: remove pm8001_slave_{alloc|configure}
 drivers/ata/libata-core.c           |    1 +
 drivers/ata/libata-scsi.c           |   44 +++++++++++++++++++++++------------
 drivers/scsi/libsas/sas_scsi_host.c |   42 +++++++++++++++++++--------------
 drivers/scsi/mvsas/mv_init.c        |    4 ++-
 drivers/scsi/mvsas/mv_sas.c         |   30 ------------------------
 drivers/scsi/mvsas/mv_sas.h         |    2 --
 drivers/scsi/pm8001/pm8001_init.c   |    4 ++-
 drivers/scsi/pm8001/pm8001_sas.c    |   31 +------------------------
 drivers/scsi/pm8001/pm8001_sas.h    |    2 --
 drivers/scsi/scsi_transport_sas.c   |   10 ++++++--
 include/linux/libata.h              |    2 ++
 11 files changed, 69 insertions(+), 103 deletions(-)
#1 lore raw

PATCH 1/5 libsas: disable scanning lun > 0 on ata devices

Currently mvsas and pm8001 have custom ->slave_alloc implementations to achieve this. Uplevel it for all libsas drivers as isci encounters problems with atapi devices when scanning past lun0.

Just do what Darrick suggested [1], and limit the scan for ata devices.

[1] http://marc.info/?l=linux-scsi&m=116604101119861&w=2

Cc Darrick Wong <[email protected]>
Cc Xiangliang Yu <[email protected]>
Cc Jack Wang <[email protected]>
Cc Mark Salyzyn <[email protected]>
Cc Luben Tuikov <[email protected]>
---
 drivers/scsi/scsi_transport_sas.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
drivers/scsi/scsi_transport_sas.c +8 -2
index c6fcf76..9d9330a 100644
@@ -1545,8 +1545,14 @@ int sas_rphy_add(struct sas_rphy *rphy)
 
 	if (identify->device_type == SAS_END_DEVICE &&
 	    rphy->scsi_target_id != -1) {
-		scsi_scan_target(&rphy->dev, 0,
-				rphy->scsi_target_id, SCAN_WILD_CARD, 0);
+		int lun;
+
+		if (identify->target_port_protocols & SAS_PROTOCOL_SSP)
+			lun = SCAN_WILD_CARD;
+		else
+			lun = 0;
+
+		scsi_scan_target(&rphy->dev, 0, rphy->scsi_target_id, lun, 0);
 	}
 
 	return 0;
#5 lore raw

PATCH 2/5 libsas: fix ->change_queue_{depth|type} for sata devices

In reply to Dan Williams

Pass queue_depth change requests to libata, and prevent queue_type changes for ATA devices.

Otherwise:
1/ we do not honor the libata specific restrictions on the queue depth 2/ libsas drivers that do not set sdev->tagged_supported are unable to
change the queue_depth of ata devices via sysfs

Cc Tejun Heo <[email protected]>
Cc Xiangliang Yu <[email protected]>
Cc Jack Wang <[email protected]>
Cc Mark Salyzyn <[email protected]>
---
 drivers/ata/libata-core.c           |    1 +
 drivers/ata/libata-scsi.c           |   44 +++++++++++++++++++++++------------
 drivers/scsi/libsas/sas_scsi_host.c |   11 ++++++++-
 include/linux/libata.h              |    2 ++
 4 files changed, 42 insertions(+), 16 deletions(-)
drivers/ata/libata-core.c +1 -0
index 4a3a5ae..d26c7f4 100644
@@ -6713,6 +6713,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_queuecmd);
 EXPORT_SYMBOL_GPL(ata_scsi_slave_config);
 EXPORT_SYMBOL_GPL(ata_scsi_slave_destroy);
 EXPORT_SYMBOL_GPL(ata_scsi_change_queue_depth);
+EXPORT_SYMBOL_GPL(__ata_change_queue_depth);
 EXPORT_SYMBOL_GPL(sata_scr_valid);
 EXPORT_SYMBOL_GPL(sata_scr_read);
 EXPORT_SYMBOL_GPL(sata_scr_write);
drivers/ata/libata-scsi.c +29 -15

60 lines not on this page · raw message

drivers/scsi/libsas/sas_scsi_host.c +10 -1
index eeba76c..4c6923c 100644
@@ -831,8 +831,13 @@ void sas_slave_destroy(struct scsi_device *scsi_dev)
 int sas_change_queue_depth(struct scsi_device *scsi_dev, int new_depth,
 			   int reason)
 {
+	struct domain_device *dev = sdev_to_domain_dev(scsi_dev);
 	int res = min(new_depth, SAS_MAX_QD);
 
+	if (dev_is_sata(dev))
+		return __ata_change_queue_depth(dev->sata_dev.ap, scsi_dev,
+						new_depth, reason);
+
 	if (reason != SCSI_QDEPTH_DEFAULT)
 		return -EOPNOTSUPP;
 
@@ -840,7 +845,6 @@ int sas_change_queue_depth(struct scsi_device *scsi_dev, int new_depth,
 		scsi_adjust_queue_depth(scsi_dev, scsi_get_tag_type(scsi_dev),
 					res);
 	else {
-		struct domain_device *dev = sdev_to_domain_dev(scsi_dev);
 		sas_printk("device %llx LUN %x queue depth changed to 1\n",
 			   SAS_ADDR(dev->sas_addr),
 			   scsi_dev->lun);
@@ -853,6 +857,11 @@ int sas_change_queue_depth(struct scsi_device *scsi_dev, int new_depth,
 
 int sas_change_queue_type(struct scsi_device *scsi_dev, int qt)
 {
+	struct domain_device *dev = sdev_to_domain_dev(scsi_dev);
+
+	if (dev_is_sata(dev))
+		return -EINVAL;
+
 	if (!scsi_dev->tagged_supported)
 		return 0;
 
include/linux/libata.h +2 -0
index efd6f98..23fa829 100644
@@ -1052,6 +1052,8 @@ extern int ata_scsi_slave_config(struct scsi_device *sdev);
 extern void ata_scsi_slave_destroy(struct scsi_device *sdev);
 extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
 				       int queue_depth, int reason);
+extern int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev,
+				    int queue_depth, int reason);
 extern struct ata_device *ata_dev_pair(struct ata_device *adev);
 extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev);
 extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap);
#9 lore raw

RFC PATCH 3/5 libsas: dynamic queue depth

In reply to Dan Williams

The queue-depth for libsas-attached devices initializes to 32 and can only be increased manually via sysfs to a max of 64, while mpt2sas attached devices initialize to 254 and dynamically float via the midlayer ->change_queue_depth interface.

No performance regression was observed with this change on the isci driver.

Cc Christoph Hellwig <[email protected]>
Cc Mark Salyzyn <[email protected]>
Cc Xiangliang Yu <[email protected]>
Cc Jack Wang <[email protected]>
Cc Mark Salyzyn <[email protected]>
Cc Luben Tuikov <[email protected]>
---
 drivers/scsi/libsas/sas_scsi_host.c |   39 ++++++++++++++++-------------------
 1 files changed, 18 insertions(+), 21 deletions(-)
drivers/scsi/libsas/sas_scsi_host.c +18 -21
index 4c6923c..fe08ef0 100644
@@ -784,8 +784,7 @@ int sas_target_alloc(struct scsi_target *starget)
 	return 0;
 }
 
-#define SAS_DEF_QD 32
-#define SAS_MAX_QD 64
+#define SAS_DEF_QD 256
 
 int sas_slave_configure(struct scsi_device *scsi_dev)
 {
@@ -828,31 +827,29 @@ void sas_slave_destroy(struct scsi_device *scsi_dev)
 		dev->sata_dev.ap->link.device[0].class = ATA_DEV_NONE;
 }
 
-int sas_change_queue_depth(struct scsi_device *scsi_dev, int new_depth,
-			   int reason)
+int sas_change_queue_depth(struct scsi_device *sdev, int depth, int reason)
 {
-	struct domain_device *dev = sdev_to_domain_dev(scsi_dev);
-	int res = min(new_depth, SAS_MAX_QD);
+	struct domain_device *dev = sdev_to_domain_dev(sdev);
 
 	if (dev_is_sata(dev))
-		return __ata_change_queue_depth(dev->sata_dev.ap, scsi_dev,
-						new_depth, reason);
-
-	if (reason != SCSI_QDEPTH_DEFAULT)
+		return __ata_change_queue_depth(dev->sata_dev.ap, sdev, depth,
+						reason);
+
+	switch (reason) {
+	case SCSI_QDEPTH_DEFAULT:
+	case SCSI_QDEPTH_RAMP_UP:
+		if (!sdev->tagged_supported)
+			depth = 1;
+		scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth);
+		break;
+	case SCSI_QDEPTH_QFULL:
+		scsi_track_queue_full(sdev, depth);
+		break;
+	default:
 		return -EOPNOTSUPP;
-
-	if (scsi_dev->tagged_supported)
-		scsi_adjust_queue_depth(scsi_dev, scsi_get_tag_type(scsi_dev),
-					res);
-	else {
-		sas_printk("device %llx LUN %x queue depth changed to 1\n",
-			   SAS_ADDR(dev->sas_addr),
-			   scsi_dev->lun);
-		scsi_adjust_queue_depth(scsi_dev, 0, 1);
-		res = 1;
 	}
 
-	return res;
+	return depth;
 }
 
 int sas_change_queue_type(struct scsi_device *scsi_dev, int qt)
#14 lore raw

PATCH 4/5 mvsas: remove mvs_slave_{alloc|configure}

In reply to Dan Williams

libsas now handles:
1/ limiting ata scanning to lun0
2/ maximizing the queue_depth of sas devices (up to 256, mvsas only
supports 64)
3/ changes to /sys/block/<sdX>/device/queue_depth for ata devices

---
 drivers/scsi/mvsas/mv_init.c |    4 ++--
 drivers/scsi/mvsas/mv_sas.c  |   30 ------------------------------
 drivers/scsi/mvsas/mv_sas.h  |    2 --
 3 files changed, 2 insertions(+), 34 deletions(-)
drivers/scsi/mvsas/mv_init.c +2 -2
index 4e9af66..052861b 100644
@@ -59,7 +59,7 @@ static struct scsi_host_template mvs_sht = {
 	.name			= DRV_NAME,
 	.queuecommand		= sas_queuecommand,
 	.target_alloc		= sas_target_alloc,
-	.slave_configure	= mvs_slave_configure,
+	.slave_configure	= sas_slave_configure,
 	.slave_destroy		= sas_slave_destroy,
 	.scan_finished		= mvs_scan_finished,
 	.scan_start		= mvs_scan_start,
@@ -74,7 +74,7 @@ static struct scsi_host_template mvs_sht = {
 	.use_clustering		= ENABLE_CLUSTERING,
 	.eh_device_reset_handler = sas_eh_device_reset_handler,
 	.eh_bus_reset_handler	= sas_eh_bus_reset_handler,
-	.slave_alloc		= mvs_slave_alloc,
+	.slave_alloc		= sas_slave_alloc,
 	.target_destroy		= sas_target_destroy,
 	.ioctl			= sas_ioctl,
 	.shost_attrs		= mvst_host_attrs,
drivers/scsi/mvsas/mv_sas.c +0 -30
index 4196eee..f2ac01f 100644
@@ -276,36 +276,6 @@ static void mvs_bytes_dmaed(struct mvs_info *mvi, int i)
 				   PORTE_BYTES_DMAED);
 }
 
-int mvs_slave_alloc(struct scsi_device *scsi_dev)
-{
-	struct domain_device *dev = sdev_to_domain_dev(scsi_dev);
-	if (dev_is_sata(dev)) {
-		/* We don't need to rescan targets
-		 * if REPORT_LUNS request is failed
-		 */
-		if (scsi_dev->lun > 0)
-			return -ENXIO;
-		scsi_dev->tagged_supported = 1;
-	}
-
-	return sas_slave_alloc(scsi_dev);
-}
-
-int mvs_slave_configure(struct scsi_device *sdev)
-{
-	struct domain_device *dev = sdev_to_domain_dev(sdev);
-	int ret = sas_slave_configure(sdev);
-
-	if (ret)
-		return ret;
-	if (!dev_is_sata(dev)) {
-		sas_change_queue_depth(sdev,
-			MVS_QUEUE_SIZE,
-			SCSI_QDEPTH_DEFAULT);
-	}
-	return 0;
-}
-
 void mvs_scan_start(struct Scsi_Host *shost)
 {
 	int i, j;
drivers/scsi/mvsas/mv_sas.h +0 -2
index 44d7885..21ee8b0 100644
@@ -459,8 +459,6 @@ int mvs_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func,
 			void *funcdata);
 void __devinit mvs_set_sas_addr(struct mvs_info *mvi, int port_id,
 				u32 off_lo, u32 off_hi, u64 sas_addr);
-int mvs_slave_alloc(struct scsi_device *scsi_dev);
-int mvs_slave_configure(struct scsi_device *sdev);
 void mvs_scan_start(struct Scsi_Host *shost);
 int mvs_scan_finished(struct Scsi_Host *shost, unsigned long time);
 int mvs_queue_command(struct sas_task *task, const int num,
#19 lore raw

PATCH 5/5 pm8001: remove pm8001_slave_{alloc|configure}

In reply to Dan Williams

libsas handles:
1/ limiting ata scanning to lun0
2/ changes to /sys/block/<sdX>/device/queue_depth for ata devices

libata handles turning off ncq globally via kernel command line (libata.force=noncq) or sysfs (echo 1 > /sys/block/<sdX>/device/queue_depth). A lldd specific compile option is not necessary.

---
 drivers/scsi/pm8001/pm8001_init.c |    4 ++--
 drivers/scsi/pm8001/pm8001_sas.c  |   31 +------------------------------
 drivers/scsi/pm8001/pm8001_sas.h  |    2 --
 3 files changed, 3 insertions(+), 34 deletions(-)
drivers/scsi/pm8001/pm8001_init.c +2 -2
index 172cefb..c21a216 100644
@@ -61,7 +61,7 @@ static struct scsi_host_template pm8001_sht = {
 	.name			= DRV_NAME,
 	.queuecommand		= sas_queuecommand,
 	.target_alloc		= sas_target_alloc,
-	.slave_configure	= pm8001_slave_configure,
+	.slave_configure	= sas_slave_configure,
 	.slave_destroy		= sas_slave_destroy,
 	.scan_finished		= pm8001_scan_finished,
 	.scan_start		= pm8001_scan_start,
@@ -76,7 +76,7 @@ static struct scsi_host_template pm8001_sht = {
 	.use_clustering		= ENABLE_CLUSTERING,
 	.eh_device_reset_handler = sas_eh_device_reset_handler,
 	.eh_bus_reset_handler	= sas_eh_bus_reset_handler,
-	.slave_alloc		= pm8001_slave_alloc,
+	.slave_alloc		= sas_slave_alloc,
 	.target_destroy		= sas_target_destroy,
 	.ioctl			= sas_ioctl,
 	.shost_attrs		= pm8001_host_attrs,
drivers/scsi/pm8001/pm8001_sas.c +1 -30
index 7dbbf8b..9068f12 100644
@@ -216,20 +216,6 @@ int pm8001_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func,
 	return rc;
 }
 
-int pm8001_slave_alloc(struct scsi_device *scsi_dev)
-{
-	struct domain_device *dev = sdev_to_domain_dev(scsi_dev);
-	if (dev_is_sata(dev)) {
-		/* We don't need to rescan targets
-		* if REPORT_LUNS request is failed
-		*/
-		if (scsi_dev->lun > 0)
-			return -ENXIO;
-		scsi_dev->tagged_supported = 1;
-	}
-	return sas_slave_alloc(scsi_dev);
-}
-
 /**
   * pm8001_scan_start - we should enable all HBA phys by sending the phy_start
   * command to HBA.
@@ -314,22 +300,7 @@ static int pm8001_task_prep_ssp(struct pm8001_hba_info *pm8001_ha,
 {
 	return PM8001_CHIP_DISP->ssp_io_req(pm8001_ha, ccb);
 }
-int pm8001_slave_configure(struct scsi_device *sdev)
-{
-	struct domain_device *dev = sdev_to_domain_dev(sdev);
-	int ret = sas_slave_configure(sdev);
-	if (ret)
-		return ret;
-	if (dev_is_sata(dev)) {
-	#ifdef PM8001_DISABLE_NCQ
-		struct ata_port *ap = dev->sata_dev.ap;
-		struct ata_device *adev = ap->link.device;
-		adev->flags |= ATA_DFLAG_NCQ_OFF;
-		scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, 1);
-	#endif
-	}
-	return 0;
-}
+
  /* Find the local port id that's attached to this device */
 static int sas_find_local_port_id(struct domain_device *dev)
 {
drivers/scsi/pm8001/pm8001_sas.h +0 -2
index b97c8ab..93959fe 100644
@@ -471,8 +471,6 @@ void pm8001_ccb_task_free(struct pm8001_hba_info *pm8001_ha,
 	struct sas_task *task, struct pm8001_ccb_info *ccb, u32 ccb_idx);
 int pm8001_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func,
 	void *funcdata);
-int pm8001_slave_alloc(struct scsi_device *scsi_dev);
-int pm8001_slave_configure(struct scsi_device *sdev);
 void pm8001_scan_start(struct Scsi_Host *shost);
 int pm8001_scan_finished(struct Scsi_Host *shost, unsigned long time);
 int pm8001_queue_command(struct sas_task *task, const int num,
#2 lore raw

Re: [PATCH 1/5] libsas: disable scanning lun > 0 on ata devices

In reply to Dan Williams
Quoted 7 lines · Dan Williams

Currently mvsas and pm8001 have custom ->slave_alloc implementations to achieve this. Uplevel it for all libsas drivers as isci encounters problems with atapi devices when scanning past lun0.

Just do what Darrick suggested [1], and limit the scan for ata devices.

[1] http://marc.info/?l=linux-scsi&m=116604101119861&w=2

Looks reasonable.

#10 lore raw

Re: [RFC PATCH 3/5] libsas: dynamic queue depth

In reply to Dan Williams
Quoted 7 lines · Dan Williams

The queue-depth for libsas-attached devices initializes to 32 and can only be increased manually via sysfs to a max of 64, while mpt2sas attached devices initialize to 254 and dynamically float via the midlayer ->change_queue_depth interface.

No performance regression was observed with this change on the isci driver.

Looks reasonable to me.

Reviewed-by on the v1 series
#20 lore raw
In reply to Dan Williams

Hi Dan

Thanks for doing this, I'm OK with the patchset.

[PATCH 0/5] libsas fixes discovered via isci-atapi enabling effort

Quoted 40 lines

While enabling atapi device support for isci we encountered a condition whereby multiple srX devices (one for every possible LUN) were exported by the midlayer. Looking at other drivers showed that they had a local workaround for this and other conditions in custom ->slave_{alloc|configure} methods. Rather than add custom workaround for isci this patchset uplevels those workarounds to libsas proper.

Patch 3/5 is tagged RFC as I do not know the original history behind hard limiting libsas end devices to a queue_depth of 32. At least mvsas has been bumping this up to 64 on its own.

---

Dan Williams (5):

      libsas: disable scanning lun > 0 on ata devices
      libsas: fix ->change_queue_{depth|type} for sata devices
      libsas: dynamic queue depth
      mvsas: remove mvs_slave_{alloc|configure}
      pm8001: remove pm8001_slave_{alloc|configure}
 drivers/ata/libata-core.c           |    1 +
 drivers/ata/libata-scsi.c           |   44
+++++++++++++++++++++++------------
 drivers/scsi/libsas/sas_scsi_host.c |   42
+++++++++++++++++++--------------
 drivers/scsi/mvsas/mv_init.c        |    4 ++-
 drivers/scsi/mvsas/mv_sas.c         |   30 ------------------------
 drivers/scsi/mvsas/mv_sas.h         |    2 --
 drivers/scsi/pm8001/pm8001_init.c   |    4 ++-
 drivers/scsi/pm8001/pm8001_sas.c    |   31 +------------------------
 drivers/scsi/pm8001/pm8001_sas.h    |    2 --
 drivers/scsi/scsi_transport_sas.c   |   10 ++++++--
 include/linux/libata.h              |    2 ++
 11 files changed, 69 insertions(+), 103 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw

Re: [RFC PATCH 3/5] libsas: dynamic queue depth

In reply to Dan Williams

I suppose to prepare a similar patch, thanks for ding this.
[RFC PATCH 3/5] libsas: dynamic queue depth

Quoted 38 lines

The queue-depth for libsas-attached devices initializes to 32 and can only be increased manually via sysfs to a max of 64, while mpt2sas attached devices initialize to 254 and dynamically float via the midlayer ->change_queue_depth interface.

No performance regression was observed with this change on the isci driver.

Cc Christoph Hellwig <[email protected]>
Cc Mark Salyzyn <[email protected]>
Cc Xiangliang Yu <[email protected]>
Cc Jack Wang <[email protected]>
Cc Mark Salyzyn <[email protected]>
Cc Luben Tuikov <[email protected]>
---
 drivers/scsi/libsas/sas_scsi_host.c |   39
++++++++++++++++-------------------
 1 files changed, 18 insertions(+), 21 deletions(-)
drivers/scsi/libsas/sas_scsi_host.c +1 -2
index 4c6923c..fe08ef0 100644
@@ -784,8 +784,7 @@ int sas_target_alloc(struct scsi_target *starget)
 	return 0;
 }
 
-#define SAS_DEF_QD 32
-#define SAS_MAX_QD 64
+#define SAS_DEF_QD 256
 
 int sas_slave_configure(struct scsi_device *scsi_dev)
 {

drivers/scsi/libsas/sas_scsi_host.c void sas_slave_destroy(struct scsi_device *scsi_dev) · line 830

Quoted 6 lines
drivers/scsi/libsas/sas_scsi_host.c +1 -2
@@ -828,31 +827,29 @@ void sas_slave_destroy(struct scsi_device *scsi_dev)
 		dev->sata_dev.ap->link.device[0].class = ATA_DEV_NONE;
 }
 
-int sas_change_queue_depth(struct scsi_device *scsi_dev, int new_depth,
-			   int reason)
+int sas_change_queue_depth(struct scsi_device *sdev, int depth, int

reason)

drivers/scsi/libsas/sas_scsi_host.c void sas_slave_destroy(struct scsi_device *scsi_dev)

Quoted 11 lines
drivers/scsi/libsas/sas_scsi_host.c +2 -6
 {
-	struct domain_device *dev = sdev_to_domain_dev(scsi_dev);
-	int res = min(new_depth, SAS_MAX_QD);
+	struct domain_device *dev = sdev_to_domain_dev(sdev);
 
 	if (dev_is_sata(dev))
-		return __ata_change_queue_depth(dev->sata_dev.ap, scsi_dev,
-						new_depth, reason);
-
-	if (reason != SCSI_QDEPTH_DEFAULT)
+		return __ata_change_queue_depth(dev->sata_dev.ap, sdev,

depth,

drivers/scsi/libsas/sas_scsi_host.c void sas_slave_destroy(struct scsi_device *scsi_dev)

Quoted 8 lines
drivers/scsi/libsas/sas_scsi_host.c +8 -0
+						reason);
+
+	switch (reason) {
+	case SCSI_QDEPTH_DEFAULT:
+	case SCSI_QDEPTH_RAMP_UP:
+		if (!sdev->tagged_supported)
+			depth = 1;
+		scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev),

depth);

drivers/scsi/libsas/sas_scsi_host.c void sas_slave_destroy(struct scsi_device *scsi_dev)

Quoted 9 lines
drivers/scsi/libsas/sas_scsi_host.c +5 -3
+		break;
+	case SCSI_QDEPTH_QFULL:
+		scsi_track_queue_full(sdev, depth);
+		break;
+	default:
 		return -EOPNOTSUPP;
-
-	if (scsi_dev->tagged_supported)
-		scsi_adjust_queue_depth(scsi_dev,

scsi_get_tag_type(scsi_dev),

Quoted 19 lines
drivers/scsi/libsas/sas_scsi_host.c +1 -9
-					res);
-	else {
-		sas_printk("device %llx LUN %x queue depth changed to 1\n",
-			   SAS_ADDR(dev->sas_addr),
-			   scsi_dev->lun);
-		scsi_adjust_queue_depth(scsi_dev, 0, 1);
-		res = 1;
 	}
 
-	return res;
+	return depth;
 }
 
 int sas_change_queue_type(struct scsi_device *scsi_dev, int qt)
 
--

To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw

RE: [PATCH 2/5] libsas: fix ->change_queue_{depth|type} for sata devices

In reply to Dan Williams

Good Stuff

-----Original Message-----
From: Dan Williams [mailto:[email protected]]
Sent: Tuesday, September 20, 2011 6:11 PM
To: [email protected]; [email protected]
Cc: [email protected]; [email protected]; Jack Wang; Tejun Heo; Xiangliang Yu; Mark Salyzyn
Subject: [PATCH 2/5] libsas: fix ->change_queue_{depth|type} for sata devices

Pass queue_depth change requests to libata, and prevent queue_type changes for ATA devices.

Otherwise:
1/ we do not honor the libata specific restrictions on the queue depth 2/ libsas drivers that do not set sdev->tagged_supported are unable to
change the queue_depth of ata devices via sysfs

Cc Tejun Heo <[email protected]>
Cc Xiangliang Yu <[email protected]>
Cc Jack Wang <[email protected]>
Cc Mark Salyzyn <[email protected]>
---
 drivers/ata/libata-core.c           |    1 +
 drivers/ata/libata-scsi.c           |   44
+++++++++++++++++++++++------------
 drivers/scsi/libsas/sas_scsi_host.c |   11 ++++++++-
 include/linux/libata.h              |    2 ++
 4 files changed, 42 insertions(+), 16 deletions(-)

______________________________________________________________________
This email may contain privileged or confidential information, which should only be used for the purpose for which it was sent by Xyratex. No further rights or licenses are granted to use such information. If you are not the intended recipient of this message, please notify the sender by return and delete it. You may not use, copy, disclose or rely on the information contained in it.

Internet email is susceptible to data corruption, interception and unauthorised amendment for which Xyratex does not accept liability. While we have taken reasonable precautions to ensure that this email is free of viruses, Xyratex does not accept liability for the presence of any computer viruses in this email, nor for any losses caused as a result of viruses.

Xyratex Technology Limited (03134912), Registered in England & Wales, Registered Office, Langstone Road, Havant, Hampshire, PO9 1SA.

The Xyratex group of companies also includes, Xyratex Ltd, registered in Bermuda, Xyratex International Inc, registered in California, Xyratex (Malaysia) Sdn Bhd registered in Malaysia, Xyratex Technology (Wuxi) Co Ltd registered in The People's Republic of China and Xyratex Japan Limited registered in Japan.
______________________________________________________________________

#3 lore raw

RE: [PATCH 1/5] libsas: disable scanning lun > 0 on ata devices

In reply to Dan Williams

Good Stuff

-----Original Message-----
From: Dan Williams [mailto:[email protected]]
Sent: Tuesday, September 20, 2011 6:10 PM
To: [email protected]; [email protected]
Cc: Luben Tuikov; [email protected]; [email protected]; Jack Wang; Xiangliang Yu; Mark Salyzyn; Darrick Wong
Subject: [PATCH 1/5] libsas: disable scanning lun > 0 on ata devices

Currently mvsas and pm8001 have custom ->slave_alloc implementations to achieve this. Uplevel it for all libsas drivers as isci encounters problems
with atapi devices when scanning past lun0.

Just do what Darrick suggested [1], and limit the scan for ata devices.

[1] http://marc.info/?l=linux-scsi&m=116604101119861&w=2

Cc Darrick Wong <[email protected]>
Cc Xiangliang Yu <[email protected]>
Cc Jack Wang <[email protected]>
Cc Mark Salyzyn <[email protected]>
Cc Luben Tuikov <[email protected]>
---
 drivers/scsi/scsi_transport_sas.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

______________________________________________________________________
This email may contain privileged or confidential information, which should only be used for the purpose for which it was sent by Xyratex. No further rights or licenses are granted to use such information. If you are not the intended recipient of this message, please notify the sender by return and delete it. You may not use, copy, disclose or rely on the information contained in it.

Internet email is susceptible to data corruption, interception and unauthorised amendment for which Xyratex does not accept liability. While we have taken reasonable precautions to ensure that this email is free of viruses, Xyratex does not accept liability for the presence of any computer viruses in this email, nor for any losses caused as a result of viruses.

Xyratex Technology Limited (03134912), Registered in England & Wales, Registered Office, Langstone Road, Havant, Hampshire, PO9 1SA.

The Xyratex group of companies also includes, Xyratex Ltd, registered in Bermuda, Xyratex International Inc, registered in California, Xyratex (Malaysia) Sdn Bhd registered in Malaysia, Xyratex Technology (Wuxi) Co Ltd registered in The People's Republic of China and Xyratex Japan Limited registered in Japan.
______________________________________________________________________

Tested-by Dave Jiang on v1 3/5
#12 lore raw

RE: [RFC PATCH 3/5] libsas: dynamic queue depth

In reply to Dan Williams

Good Stuff, 'cept I am worried about the host max queue depth of 128 on the pm8001 driver resulting in starvation. I defer to Jack Wang's judgement on that point (and will explore separately how we can increase the host queue depth reliably on the pm8001).

Consider this an Ack from me that has an interlock on Jack Wang's Ack
...

Sincerely -- Mark Salyzyn

-----Original Message-----
From: Dan Williams [mailto:[email protected]]
Sent: Tuesday, September 20, 2011 6:11 PM
To: [email protected]; [email protected]
Cc: Dave Jiang; Luben Tuikov; [email protected]; [email protected]; Jack Wang; Xiangliang Yu; Mark Salyzyn; Christoph Hellwig
Subject: [RFC PATCH 3/5] libsas: dynamic queue depth

The queue-depth for libsas-attached devices initializes to 32 and can only be increased manually via sysfs to a max of 64, while mpt2sas attached devices initialize to 254 and dynamically float via the midlayer ->change_queue_depth interface.

No performance regression was observed with this change on the isci driver.

Cc Christoph Hellwig <[email protected]>
Cc Mark Salyzyn <[email protected]>
Cc Xiangliang Yu <[email protected]>
Cc Jack Wang <[email protected]>
Cc Mark Salyzyn <[email protected]>
Cc Luben Tuikov <[email protected]>
---
 drivers/scsi/libsas/sas_scsi_host.c |   39
++++++++++++++++-------------------
 1 files changed, 18 insertions(+), 21 deletions(-)
(quoted diff) +0 -0

b/drivers/scsi/libsas/sas_scsi_host.c
index 4c6923c..fe08ef0 100644

drivers/scsi/libsas/sas_scsi_host.c +1 -2
@@ -784,8 +784,7 @@ int sas_target_alloc(struct scsi_target *starget)
 	return 0;
 }
 
-#define SAS_DEF_QD 32
-#define SAS_MAX_QD 64
+#define SAS_DEF_QD 256
 
 int sas_slave_configure(struct scsi_device *scsi_dev)
 {

______________________________________________________________________
This email may contain privileged or confidential information, which should only be used for the purpose for which it was sent by Xyratex. No further rights or licenses are granted to use such information. If you are not the intended recipient of this message, please notify the sender by return and delete it. You may not use, copy, disclose or rely on the information contained in it.

Internet email is susceptible to data corruption, interception and unauthorised amendment for which Xyratex does not accept liability. While we have taken reasonable precautions to ensure that this email is free of viruses, Xyratex does not accept liability for the presence of any computer viruses in this email, nor for any losses caused as a result of viruses.

Xyratex Technology Limited (03134912), Registered in England & Wales, Registered Office, Langstone Road, Havant, Hampshire, PO9 1SA.

The Xyratex group of companies also includes, Xyratex Ltd, registered in Bermuda, Xyratex International Inc, registered in California, Xyratex (Malaysia) Sdn Bhd registered in Malaysia, Xyratex Technology (Wuxi) Co Ltd registered in The People's Republic of China and Xyratex Japan Limited registered in Japan.
______________________________________________________________________

#13 lore raw

Re: [RFC PATCH 3/5] libsas: dynamic queue depth

Thanks Mark, I 'll post a patch to raise the default host can queue value, I'm OK with his change!
--Jack
RE: [RFC PATCH 3/5] libsas: dynamic queue depth

Quoted 56 lines

Good Stuff, 'cept I am worried about the host max queue depth of 128 on the pm8001 driver resulting in starvation. I defer to Jack Wang's judgement on that point (and will explore separately how we can increase the host queue depth reliably on the pm8001).

Consider this an Ack from me that has an interlock on Jack Wang's Ack
...

Sincerely -- Mark Salyzyn

-----Original Message-----
From: Dan Williams [mailto:[email protected]]
Sent: Tuesday, September 20, 2011 6:11 PM
To: [email protected]; [email protected]
Cc: Dave Jiang; Luben Tuikov; [email protected]; [email protected]; Jack Wang; Xiangliang Yu; Mark Salyzyn; Christoph Hellwig
Subject: [RFC PATCH 3/5] libsas: dynamic queue depth

The queue-depth for libsas-attached devices initializes to 32 and can only be increased manually via sysfs to a max of 64, while mpt2sas attached devices initialize to 254 and dynamically float via the midlayer ->change_queue_depth interface.

No performance regression was observed with this change on the isci driver.

Cc Christoph Hellwig <[email protected]>
Cc Mark Salyzyn <[email protected]>
Cc Xiangliang Yu <[email protected]>
Cc Jack Wang <[email protected]>
Cc Mark Salyzyn <[email protected]>
Cc Luben Tuikov <[email protected]>
---
 drivers/scsi/libsas/sas_scsi_host.c |   39
++++++++++++++++-------------------
 1 files changed, 18 insertions(+), 21 deletions(-)
drivers/scsi/libsas/sas_scsi_host.c +1 -2
index 4c6923c..fe08ef0 100644
@@ -784,8 +784,7 @@ int sas_target_alloc(struct scsi_target *starget)
 	return 0;
 }
 
-#define SAS_DEF_QD 32
-#define SAS_MAX_QD 64
+#define SAS_DEF_QD 256
 
 int sas_slave_configure(struct scsi_device *scsi_dev)
 {
Quoted 2 lines

______________________________________________________________________
This email may contain privileged or confidential information, which

should

Quoted 1 line

only be used for the purpose for which it was sent by Xyratex. No further

rights

Quoted 1 line

or licenses are granted to use such information. If you are not the

intended

Quoted 1 line

recipient of this message, please notify the sender by return and delete

it.

Quoted 1 line

You may not use, copy, disclose or rely on the information contained in

it.

Quoted 3 lines

Internet email is susceptible to data corruption, interception and unauthorised amendment for which Xyratex does not accept liability. While

we

Quoted 1 line

have taken reasonable precautions to ensure that this email is free of

viruses,

Quoted 1 line

Xyratex does not accept liability for the presence of any computer viruses

in

Quoted 8 lines

this email, nor for any losses caused as a result of viruses.

Xyratex Technology Limited (03134912), Registered in England & Wales, Registered Office, Langstone Road, Havant, Hampshire, PO9 1SA.

The Xyratex group of companies also includes, Xyratex Ltd, registered in Bermuda, Xyratex International Inc, registered in California, Xyratex (Malaysia) Sdn Bhd registered in Malaysia, Xyratex Technology (Wuxi) Co

Ltd

Quoted 4 lines

registered in The People's Republic of China and Xyratex Japan Limited registered in Japan.
______________________________________________________________________

#15 lore raw

RE: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}

In reply to Dan Williams
Quoted 40 lines

Subject: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}

libsas now handles:
1/ limiting ata scanning to lun0
2/ maximizing the queue_depth of sas devices (up to 256, mvsas only
supports 64)
3/ changes to /sys/block/<sdX>/device/queue_depth for ata devices

---
 drivers/scsi/mvsas/mv_init.c |    4 ++--
 drivers/scsi/mvsas/mv_sas.c  |   30 ------------------------------
 drivers/scsi/mvsas/mv_sas.h  |    2 --
 3 files changed, 2 insertions(+), 34 deletions(-)
drivers/scsi/mvsas/mv_init.c +2 -5
index 4e9af66..052861b 100644
@@ -59,7 +59,7 @@ static struct scsi_host_template mvs_sht = {
 	.name			= DRV_NAME,
 	.queuecommand		= sas_queuecommand,
 	.target_alloc		= sas_target_alloc,
-	.slave_configure	= mvs_slave_configure,
+	.slave_configure	= sas_slave_configure,
 	.slave_destroy		= sas_slave_destroy,
 	.scan_finished		= mvs_scan_finished,
 	.scan_start		= mvs_scan_start,
@@ -74,7 +74,7 @@ static struct scsi_host_template mvs_sht = {
 	.use_clustering		= ENABLE_CLUSTERING,
 	.eh_device_reset_handler = sas_eh_device_reset_handler,
 	.eh_bus_reset_handler	= sas_eh_bus_reset_handler,
-	.slave_alloc		= mvs_slave_alloc,
+	.slave_alloc		= sas_slave_alloc,
 	.target_destroy		= sas_target_destroy,
-int mvs_slave_configure(struct scsi_device *sdev)
-{
-	struct domain_device *dev = sdev_to_domain_dev(sdev);

drivers/scsi/mvsas/mv_init.c static struct scsi_host_template mvs_sht = {

Quoted 10 lines
drivers/scsi/mvsas/mv_init.c +0 -10
-	int ret = sas_slave_configure(sdev);
-
-	if (ret)
-		return ret;
-	if (!dev_is_sata(dev)) {
-		sas_change_queue_depth(sdev,
-			MVS_QUEUE_SIZE,
-			SCSI_QDEPTH_DEFAULT);
-	}
-	return 0;

Can you don't remove mvs_slave_configure function? Someday it will be useful, such as fixing some issue. Thanks!

Acked-by on v1 1/5
#4 lore raw

Re: [PATCH 1/5] libsas: disable scanning lun > 0 on ata devices

In reply to Dan Williams
Quoted 26 lines · Dan Williams

Currently mvsas and pm8001 have custom ->slave_alloc implementations to achieve this. Uplevel it for all libsas drivers as isci encounters problems with atapi devices when scanning past lun0.

Just do what Darrick suggested [1], and limit the scan for ata devices.

[1] http://marc.info/?l=linux-scsi&m=116604101119861&w=2

Cc Darrick Wong<[email protected]>
Cc Xiangliang Yu<[email protected]>
Cc Jack Wang<[email protected]>
Cc Mark Salyzyn<[email protected]>
Cc Luben Tuikov<[email protected]>
---
  drivers/scsi/scsi_transport_sas.c |   10 ++++++++--
  1 files changed, 8 insertions(+), 2 deletions(-)
drivers/scsi/scsi_transport_sas.c +0 -0
index c6fcf76..9d9330a 100644
@@ -1545,8 +1545,14 @@ int sas_rphy_add(struct sas_rphy *rphy)
 
  	if (identify->device_type == SAS_END_DEVICE&&
  	rphy->scsi_target_id != -1) {

drivers/scsi/scsi_transport_sas.c int sas_rphy_add(struct sas_rphy *rphy) · line 1555

Quoted 10 lines
drivers/scsi/scsi_transport_sas.c +8 -2
-		scsi_scan_target(&rphy->dev, 0,
-				rphy->scsi_target_id, SCAN_WILD_CARD, 0);
+		int lun;
+
+		if (identify->target_port_protocols&  SAS_PROTOCOL_SSP)
+			lun = SCAN_WILD_CARD;
+		else
+			lun = 0;
+
+		scsi_scan_target(&rphy->dev, 0, rphy->scsi_target_id, lun, 0);
Acked-by on v1 2/5
#8 lore raw

Re: [PATCH 2/5] libsas: fix ->change_queue_{depth|type} for sata devices

In reply to Dan Williams
Quoted 13 lines · Dan Williams

Pass queue_depth change requests to libata, and prevent queue_type changes for ATA devices.

Otherwise:
1/ we do not honor the libata specific restrictions on the queue depth 2/ libsas drivers that do not set sdev->tagged_supported are unable to
change the queue_depth of ata devices via sysfs

Cc Tejun Heo<[email protected]>
Cc Xiangliang Yu<[email protected]>
Cc Jack Wang<[email protected]>
Cc Mark Salyzyn<[email protected]>
Quoted 6 lines
---
  drivers/ata/libata-core.c           |    1 +
  drivers/ata/libata-scsi.c           |   44 +++++++++++++++++++++++------------
  drivers/scsi/libsas/sas_scsi_host.c |   11 ++++++++-
  include/linux/libata.h              |    2 ++
  4 files changed, 42 insertions(+), 16 deletions(-)
#16 lore raw

Re: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}

In reply to Xiangliang Yu
Quoted 44 lines · Xiangliang Yu
Quoted 44 lines

Subject: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}

libsas now handles:
1/ limiting ata scanning to lun0
2/ maximizing the queue_depth of sas devices (up to 256, mvsas only
supports 64)
3/ changes to /sys/block/<sdX>/device/queue_depth for ata devices

---
  drivers/scsi/mvsas/mv_init.c |    4 ++--
  drivers/scsi/mvsas/mv_sas.c  |   30 ------------------------------
  drivers/scsi/mvsas/mv_sas.h  |    2 --
  3 files changed, 2 insertions(+), 34 deletions(-)
drivers/scsi/mvsas/mv_init.c +2 -9
index 4e9af66..052861b 100644
@@ -59,7 +59,7 @@ static struct scsi_host_template mvs_sht = {
  	.name			= DRV_NAME,
  	.queuecommand		= sas_queuecommand,
  	.target_alloc		= sas_target_alloc,
-	.slave_configure	= mvs_slave_configure,
+	.slave_configure	= sas_slave_configure,
  	.slave_destroy		= sas_slave_destroy,
  	.scan_finished		= mvs_scan_finished,
  	.scan_start		= mvs_scan_start,
@@ -74,7 +74,7 @@ static struct scsi_host_template mvs_sht = {
  	.use_clustering		= ENABLE_CLUSTERING,
  	.eh_device_reset_handler = sas_eh_device_reset_handler,
  	.eh_bus_reset_handler	= sas_eh_bus_reset_handler,
-	.slave_alloc		= mvs_slave_alloc,
+	.slave_alloc		= sas_slave_alloc,
  	.target_destroy		= sas_target_destroy,
-int mvs_slave_configure(struct scsi_device *sdev)
-{
-	struct domain_device *dev = sdev_to_domain_dev(sdev);
-	int ret = sas_slave_configure(sdev);
-
-	if (ret)
-		return ret;
Quoted 8 lines

drivers/scsi/mvsas/mv_init.c

Quoted 6 lines
drivers/scsi/mvsas/mv_init.c +0 -6
-	if (!dev_is_sata(dev)) {
-		sas_change_queue_depth(sdev,
-			MVS_QUEUE_SIZE,
-			SCSI_QDEPTH_DEFAULT);
-	}
-	return 0;

Can you don't remove mvs_slave_configure function? Someday it will be useful, such as fixing some issue. Thanks!

There is no reason to keep a no-op function there.

Jeff

#17 lore raw

Re: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}

In reply to Xiangliang Yu
Quoted 43 lines · Xiangliang Yu
Quoted 43 lines

Subject: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}

libsas now handles:
1/ limiting ata scanning to lun0
2/ maximizing the queue_depth of sas devices (up to 256, mvsas only supports 64)
3/ changes to /sys/block/<sdX>/device/queue_depth for ata devices

---
 drivers/scsi/mvsas/mv_init.c |    4 ++-- drivers/scsi/mvsas/mv_sas.c  |   30 ------------------------------ drivers/scsi/mvsas/mv_sas.h  |    2 --

 3 files changed, 2 insertions(+), 34 deletions(-)
drivers/scsi/mvsas/mv_init.c +2 -8
index 4e9af66..052861b 100644
@@ -59,7 +59,7 @@ static struct scsi_host_template mvs_sht = {
       .name                   = DRV_NAME,
       .queuecommand           = sas_queuecommand,
       .target_alloc           = sas_target_alloc,
-     .slave_configure        = mvs_slave_configure,
+     .slave_configure        = sas_slave_configure,
       .slave_destroy          = sas_slave_destroy,
       .scan_finished          = mvs_scan_finished,
       .scan_start             = mvs_scan_start,
@@ -74,7 +74,7 @@ static struct scsi_host_template mvs_sht = {
       .use_clustering         = ENABLE_CLUSTERING,
       .eh_device_reset_handler = sas_eh_device_reset_handler,
       .eh_bus_reset_handler   = sas_eh_bus_reset_handler,
-     .slave_alloc            = mvs_slave_alloc,
+     .slave_alloc            = sas_slave_alloc,
       .target_destroy         = sas_target_destroy,
-int mvs_slave_configure(struct scsi_device *sdev)
-{
-     struct domain_device *dev = sdev_to_domain_dev(sdev);
-     int ret = sas_slave_configure(sdev);
-
-     if (ret)
Quoted 8 lines
Quoted 7 lines

-             return ret;
-     if (!dev_is_sata(dev)) {
-             sas_change_queue_depth(sdev,
-                     MVS_QUEUE_SIZE,
-                     SCSI_QDEPTH_DEFAULT);
-     }
-     return 0;

Can you don't remove mvs_slave_configure function? Someday it will be useful, such as fixing some issue.

That's exactly the point of the patch. The isci driver encountered a bug that the mvsas driver had fixed in its private mvs_slave_alloc() routine. If I had taken the same approach and "fixed" it with a isci_slave_alloc() routine that would still leave aic94xx or any other future libsas driver to rediscover the fix.

If you later find a problem with sas_slave_configure() there's a good chance the fix will be applicable to all libsas drivers. But if it is truly a mvsas specific issue you can always re-introduce mvs_slave_configure().

--
Dan

#18 lore raw

RE: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}

Quoted 62 lines

Subject: Re: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}

Quoted 43 lines · Xiangliang Yu
Quoted 43 lines

Subject: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}

libsas now handles:
1/ limiting ata scanning to lun0
2/ maximizing the queue_depth of sas devices (up to 256, mvsas only supports 64)
3/ changes to /sys/block/<sdX>/device/queue_depth for ata devices

---
 drivers/scsi/mvsas/mv_init.c |    4 ++-- drivers/scsi/mvsas/mv_sas.c  |   30 ------------------------------ drivers/scsi/mvsas/mv_sas.h  |    2 --

 3 files changed, 2 insertions(+), 34 deletions(-)
drivers/scsi/mvsas/mv_init.c +2 -8
index 4e9af66..052861b 100644
@@ -59,7 +59,7 @@ static struct scsi_host_template mvs_sht = {
       .name                   = DRV_NAME,
       .queuecommand           = sas_queuecommand,
       .target_alloc           = sas_target_alloc,
-     .slave_configure        = mvs_slave_configure,
+     .slave_configure        = sas_slave_configure,
       .slave_destroy          = sas_slave_destroy,
       .scan_finished          = mvs_scan_finished,
       .scan_start             = mvs_scan_start,
@@ -74,7 +74,7 @@ static struct scsi_host_template mvs_sht = {
       .use_clustering         = ENABLE_CLUSTERING,
       .eh_device_reset_handler = sas_eh_device_reset_handler,
       .eh_bus_reset_handler   = sas_eh_bus_reset_handler,
-     .slave_alloc            = mvs_slave_alloc,
+     .slave_alloc            = sas_slave_alloc,
       .target_destroy         = sas_target_destroy,
-int mvs_slave_configure(struct scsi_device *sdev)
-{
-     struct domain_device *dev = sdev_to_domain_dev(sdev);
-     int ret = sas_slave_configure(sdev);
-
-     if (ret)
Quoted 8 lines
Quoted 7 lines

-             return ret;
-     if (!dev_is_sata(dev)) {
-             sas_change_queue_depth(sdev,
-                     MVS_QUEUE_SIZE,
-                     SCSI_QDEPTH_DEFAULT);
-     }
-     return 0;

Can you don't remove mvs_slave_configure function? Someday it will be useful,

such as fixing some issue.

That's exactly the point of the patch. The isci driver encountered a bug that the mvsas driver had fixed in its private mvs_slave_alloc() routine. If I had taken the same approach and "fixed" it with a isci_slave_alloc() routine that would still leave aic94xx or any other future libsas driver to rediscover the fix.

Quoted 4 lines

If you later find a problem with sas_slave_configure() there's a good chance the fix will be applicable to all libsas drivers. But if it is truly a mvsas specific issue you can always re-introduce mvs_slave_configure().

Sound good.