~ubuntu-branches/ubuntu/natty/hdparm/natty

« back to all changes in this revision

Viewing changes to wiper-2.5/sil24_trim_protocol_fix.patch

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Gran
  • Date: 2010-01-17 18:02:44 UTC
  • mto: (2.1.5 sid)
  • mto: This revision was merged to the branch mainline in revision 31.
  • Revision ID: james.westby@ubuntu.com-20100117180244-p53m2zbnkf9my7sp
Tags: upstream-9.27
ImportĀ upstreamĀ versionĀ 9.27

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.
 
7
 
 
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.
 
11
 
 
12
Signed-off-by: Robert Hancock <hancockrwd@gmail.com>
 
13
Tested-by: Mark Lord <liml@rtr.ca>
 
14
 
 
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)) {
 
21
                prb = &cb->ata.prb;
 
22
                sge = cb->ata.sge;
 
23
+               if (ata_is_data(qc->tf.protocol)) {
 
24
+                       u16 prot = 0;
 
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;
 
30
+                       else
 
31
+                               prot |= PRB_PROT_READ;
 
32
+                       prb->prot = cpu_to_le16(prot);
 
33
+               }
 
34
        } else {
 
35
                prb = &cb->atapi.prb;
 
36
                sge = cb->atapi.sge;