Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a8fd68b authored by Robert Hancock's avatar Robert Hancock Committed by Jeff Garzik
Browse files

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: default avatarRobert Hancock <hancockrwd@gmail.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent b2dec48c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 */