summaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-sff.c
diff options
context:
space:
mode:
authorRobert Hancock2009-12-09 03:48:10 +0100
committerJeff Garzik2009-12-17 07:08:29 +0100
commit9a8fd68b15e7b047678a651b7f7e2f3dcd19d20d (patch)
tree2fcd55dc63893d0c2a0a2f27878b2528596c4d43 /drivers/ata/libata-sff.c
parentsata_mv: add power management support for the PCI controllers. (diff)
downloadkernel-qcow2-linux-9a8fd68b15e7b047678a651b7f7e2f3dcd19d20d.tar.gz
kernel-qcow2-linux-9a8fd68b15e7b047678a651b7f7e2f3dcd19d20d.tar.xz
kernel-qcow2-linux-9a8fd68b15e7b047678a651b7f7e2f3dcd19d20d.zip
libata: fix reporting of drained bytes when clearing DRQ
When we drain data from a device to clear DRQ during error recovery, the number of bytes reported as drained is too low by a factor of 2 because the count is actually reporting the number of words drained, not bytes. Fix this. Signed-off-by: Robert Hancock <hancockrwd@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libata-sff.c')
-rw-r--r--drivers/ata/libata-sff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index efa8773bef5a..741065c9da67 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -2275,7 +2275,7 @@ void ata_sff_drain_fifo(struct ata_queued_cmd *qc)
ap = qc->ap;
/* Drain up to 64K of data before we give up this recovery method */
for (count = 0; (ap->ops->sff_check_status(ap) & ATA_DRQ)
- && count < 32768; count++)
+ && count < 65536; count += 2)
ioread16(ap->ioaddr.data_addr);
/* Can become DEBUG later */