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

login
register
mail settings
Submitter Dan Williams
Date Sept. 20, 2011, 10:10 p.m.
Message ID <20110920221008.1094.34064.stgit@localhost6.localdomain6>
Download mbox | patch
Permalink /patch/115634/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Dan Williams - Sept. 20, 2011, 10:10 p.m.
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 <djwong@us.ibm.com>
Cc: Xiangliang Yu <yuxiangl@marvell.com>
Cc: Jack Wang <jack_wang@usish.com>
Cc: Mark Salyzyn <msalyzyn@us.xyratex.com>
Cc: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/scsi/scsi_transport_sas.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig - Sept. 20, 2011, 10:15 p.m.
On Tue, Sep 20, 2011 at 03:10:19PM -0700, Dan Williams wrote:
> 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.

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Salyzyn - Sept. 21, 2011, 12:28 p.m.
Good Stuff

-----Original Message-----
From: Dan Williams [mailto:dan.j.williams@intel.com] 
Sent: Tuesday, September 20, 2011 6:10 PM
To: linux-ide@vger.kernel.org; linux-scsi@vger.kernel.org
Cc: Luben Tuikov; jgarzik@pobox.com; JBottomley@parallels.com; 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 <djwong@us.ibm.com>
Cc: Xiangliang Yu <yuxiangl@marvell.com>
Cc: Jack Wang <jack_wang@usish.com>
Cc: Mark Salyzyn <msalyzyn@us.xyratex.com>
Cc: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/scsi/scsi_transport_sas.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
Jeff Garzik - Sept. 22, 2011, 2:29 a.m.
On 09/20/2011 06:10 PM, Dan Williams wrote:
> 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<djwong@us.ibm.com>
> Cc: Xiangliang Yu<yuxiangl@marvell.com>
> Cc: Jack Wang<jack_wang@usish.com>
> Cc: Mark Salyzyn<msalyzyn@us.xyratex.com>
> Cc: Luben Tuikov<ltuikov@yahoo.com>
> Signed-off-by: Dan Williams<dan.j.williams@intel.com>
> ---
>   drivers/scsi/scsi_transport_sas.c |   10 ++++++++--
>   1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
> index c6fcf76..9d9330a 100644
> --- a/drivers/scsi/scsi_transport_sas.c
> +++ b/drivers/scsi/scsi_transport_sas.c
> @@ -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);

Acked-by: Jeff Garzik <jgarzik@redhat.com>



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

Patch

diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index c6fcf76..9d9330a 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -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;