diff options
Diffstat (limited to 'drivers/ata/libata-scsi.c')
| -rw-r--r-- | drivers/ata/libata-scsi.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 3986ec8741b4..b0d0cc41f3e8 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
| @@ -889,6 +889,7 @@ int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth) | |||
| 889 | { | 889 | { |
| 890 | struct ata_port *ap = ata_shost_to_port(sdev->host); | 890 | struct ata_port *ap = ata_shost_to_port(sdev->host); |
| 891 | struct ata_device *dev; | 891 | struct ata_device *dev; |
| 892 | unsigned long flags; | ||
| 892 | int max_depth; | 893 | int max_depth; |
| 893 | 894 | ||
| 894 | if (queue_depth < 1) | 895 | if (queue_depth < 1) |
| @@ -904,6 +905,14 @@ int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth) | |||
| 904 | queue_depth = max_depth; | 905 | queue_depth = max_depth; |
| 905 | 906 | ||
| 906 | scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, queue_depth); | 907 | scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, queue_depth); |
| 908 | |||
| 909 | spin_lock_irqsave(ap->lock, flags); | ||
| 910 | if (queue_depth > 1) | ||
| 911 | dev->flags &= ~ATA_DFLAG_NCQ_OFF; | ||
| 912 | else | ||
| 913 | dev->flags |= ATA_DFLAG_NCQ_OFF; | ||
| 914 | spin_unlock_irqrestore(ap->lock, flags); | ||
| 915 | |||
| 907 | return queue_depth; | 916 | return queue_depth; |
| 908 | } | 917 | } |
| 909 | 918 | ||
| @@ -1293,7 +1302,8 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, const u8 *scsicm | |||
| 1293 | */ | 1302 | */ |
| 1294 | goto nothing_to_do; | 1303 | goto nothing_to_do; |
| 1295 | 1304 | ||
| 1296 | if ((dev->flags & (ATA_DFLAG_PIO | ATA_DFLAG_NCQ)) == ATA_DFLAG_NCQ) { | 1305 | if ((dev->flags & (ATA_DFLAG_PIO | ATA_DFLAG_NCQ_OFF | |
| 1306 | ATA_DFLAG_NCQ)) == ATA_DFLAG_NCQ) { | ||
| 1297 | /* yay, NCQ */ | 1307 | /* yay, NCQ */ |
| 1298 | if (!lba_48_ok(block, n_block)) | 1308 | if (!lba_48_ok(block, n_block)) |
| 1299 | goto out_of_range; | 1309 | goto out_of_range; |
| @@ -3174,7 +3184,7 @@ void ata_scsi_dev_rescan(void *data) | |||
| 3174 | 3184 | ||
| 3175 | /** | 3185 | /** |
| 3176 | * ata_sas_port_alloc - Allocate port for a SAS attached SATA device | 3186 | * ata_sas_port_alloc - Allocate port for a SAS attached SATA device |
| 3177 | * @pdev: PCI device that the scsi device is attached to | 3187 | * @host: ATA host container for all SAS ports |
| 3178 | * @port_info: Information from low-level host driver | 3188 | * @port_info: Information from low-level host driver |
| 3179 | * @shost: SCSI host that the scsi device is attached to | 3189 | * @shost: SCSI host that the scsi device is attached to |
| 3180 | * | 3190 | * |
