libata: SCT Write Same handle ATA_DFLAG_PIO
authorShaun Tancheff <shaun@tancheff.com>
Mon, 22 Aug 2016 04:23:21 +0000 (23:23 -0500)
committerTejun Heo <tj@kernel.org>
Thu, 25 Aug 2016 15:26:48 +0000 (11:26 -0400)
Use non DMA write log when ATA_DFLAG_PIO is set.

Signed-off-by: Shaun Tancheff <shaun.tancheff@seagate.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Acked-by: Tejun Heo <tj@kernel.org>
drivers/ata/libata-scsi.c

index 35b1f9e475cc4e4fcfa38ee429b3823e1d15c0cf..2f5487f02de14d143133971c0ba724c6dbe4c79a 100644 (file)
@@ -3485,6 +3485,8 @@ static unsigned int ata_scsi_write_same_xlat(struct ata_queued_cmd *qc)
                tf->device = ATA_CMD_STANDBYNOW1;
                tf->protocol = ATA_PROT_DMA;
                tf->command = ATA_CMD_WRITE_LOG_DMA_EXT;
+               if (unlikely(dev->flags & ATA_DFLAG_PIO))
+                       tf->command = ATA_CMD_WRITE_LOG_EXT;
        }
 
        tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48 |