aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas/sas_scsi_host.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-09-20 15:10:33 -0700
committerJames Bottomley <JBottomley@Parallels.com>2011-10-02 12:30:30 -0500
commitf6e67035a9edd79b8b202c159d5bec560bb9c358 (patch)
treeba884b5a2de7cb60bd1e6f67813b47fdb8ff509a /drivers/scsi/libsas/sas_scsi_host.c
parent[SCSI] libsas: disable scanning lun > 0 on ata devices (diff)
downloadlinux-dev-f6e67035a9edd79b8b202c159d5bec560bb9c358.tar.xz
linux-dev-f6e67035a9edd79b8b202c159d5bec560bb9c358.zip
[SCSI] libsas,libata: 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 Signed-off-by: Dan Williams <dan.j.williams@intel.com> Acked-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/libsas/sas_scsi_host.c')
-rw-r--r--drivers/scsi/libsas/sas_scsi_host.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
index d625577ed152..8f3c4cc1bfe4 100644
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -808,8 +808,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;
@@ -817,7 +822,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);
@@ -830,6 +834,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;