linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libata: fix reporting of drained bytes when clearing DRQ
@ 2009-12-09  2:48 Robert Hancock
  2009-12-16  1:16 ` Robert Hancock
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Hancock @ 2009-12-09  2:48 UTC (permalink / raw)
  To: ide, Jeff Garzik

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>

diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 51eb1e2..3afa21b 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 */

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-16 10:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-09  2:48 [PATCH] libata: fix reporting of drained bytes when clearing DRQ Robert Hancock
2009-12-16  1:16 ` Robert Hancock
2009-12-16 10:21   ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).