Skip to contentSkip to conversation

libata: fix reporting of drained bytes when clearing DRQ

PATCH In review Robert Hancock 2 participants 3 messages Dec 9, 2009 – Dec 16, 2009 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

drivers/ata/libata-sff.c +1 -1
index 51eb1e2..3afa21b 100644
@@ -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 */
#1 lore raw
Quoted 11 lines · Robert Hancock

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.

drivers/ata/libata-sff.c +0 -0
index 51eb1e2..3afa21b 100644

drivers/ata/libata-sff.c void ata_sff_drain_fifo(struct ata_queued_cmd *qc) · line 2281

Quoted 8 lines
drivers/ata/libata-sff.c +1 -1
@@ -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 */

Jeff, ping?

#2 lore raw
Quoted 21 lines · Robert Hancock
Quoted 20 lines · Robert Hancock

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.

drivers/ata/libata-sff.c +1 -1
index 51eb1e2..3afa21b 100644
@@ -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);
 
Quoted 3 lines

drivers/ata/libata-sff.c void ata_sff_drain_fifo(struct ata_queued_cmd *qc) · line 2281

Quoted 1 line
drivers/ata/libata-sff.c +0 -0
 /* Can become DEBUG later */

Jeff, ping?

No worries, it's in the local queue...

Jeff