1
The sil24 hardware has a built-in list of commands and associated protocols
2
that gets used by default to decide how to handle a given command. However,
3
if the command is not known to the controller then it presumably assumes it to
4
be a non-data command which then causes protocol mismatch errors if the device
5
ends up requesting data transfer. The new DATA SET MANAGEMENT - Trim command
6
causes this issue since it's a DMA data-out command.
8
Since we should always know best what protocol the command should be using,
9
let's just set the override flag to inform the controller what protocol to use
10
for all non-ATAPI commands with data transfer.
12
Signed-off-by: Robert Hancock <hancockrwd@gmail.com>
13
Tested-by: Mark Lord <liml@rtr.ca>
15
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
16
index 77aa8d7..e6946fc 100644
17
--- a/drivers/ata/sata_sil24.c
18
+++ b/drivers/ata/sata_sil24.c
19
@@ -846,6 +846,17 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc)
20
if (!ata_is_atapi(qc->tf.protocol)) {
23
+ if (ata_is_data(qc->tf.protocol)) {
25
+ ctrl = PRB_CTRL_PROTOCOL;
26
+ if (ata_is_ncq(qc->tf.protocol))
27
+ prot |= PRB_PROT_NCQ;
28
+ if (qc->tf.flags & ATA_TFLAG_WRITE)
29
+ prot |= PRB_PROT_WRITE;
31
+ prot |= PRB_PROT_READ;
32
+ prb->prot = cpu_to_le16(prot);