Skip to content

Commit

Permalink
libata: fix reporting of drained bytes when clearing DRQ
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Robert Hancock authored and Jeff Garzik committed Dec 17, 2009
1 parent b2dec48 commit 9a8fd68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ata/libata-sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 9a8fd68

Please sign in to comment.