aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRobert Hancock <hancockrwd@gmail.com>2009-07-30 16:11:29 -0400
committerJeff Garzik <jgarzik@redhat.com>2009-09-01 19:47:21 -0400
commit4f1a0ee11d6f9c104c8e6a13dae995709a6922a8 (patch)
tree5402b32fb0ba17c3d9f44c21faddbefd73d2812f /drivers
parent77cdec1ad527560b59ab8dbb063dbb3d0a138bf7 (diff)
sata_sil24: always set protocol override for non-ATAPI data commands
The sil24 hardware has a built-in list of commands and associated protocols that gets used by default to decide how to handle a given command. However, if the command is not known to the controller then it presumably assumes it to be a non-data command which then causes protocol mismatch errors if the device ends up requesting data transfer. The new DATA SET MANAGEMENT - Trim command causes this issue since it's a DMA data-out command. Since we should always know best what protocol the command should be using, let's just set the override flag to inform the controller what protocol to use for all non-ATAPI commands with data transfer. Signed-off-by: Robert Hancock <hancockrwd@gmail.com> Tested-by: Mark Lord <liml@rtr.ca> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/sata_sil24.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 77aa8d7ecec4..e6946fc527d0 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -846,6 +846,17 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc)
846 if (!ata_is_atapi(qc->tf.protocol)) { 846 if (!ata_is_atapi(qc->tf.protocol)) {
847 prb = &cb->ata.prb; 847 prb = &cb->ata.prb;
848 sge = cb->ata.sge; 848 sge = cb->ata.sge;
849 if (ata_is_data(qc->tf.protocol)) {
850 u16 prot = 0;
851 ctrl = PRB_CTRL_PROTOCOL;
852 if (ata_is_ncq(qc->tf.protocol))
853 prot |= PRB_PROT_NCQ;
854 if (qc->tf.flags & ATA_TFLAG_WRITE)
855 prot |= PRB_PROT_WRITE;
856 else
857 prot |= PRB_PROT_READ;
858 prb->prot = cpu_to_le16(prot);
859 }
849 } else { 860 } else {
850 prb = &cb->atapi.prb; 861 prb = &cb->atapi.prb;
851 sge = cb->atapi.sge; 862 sge = cb->atapi.sge;