libata: fix reporting of drained bytes when clearing DRQ
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
@@ -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 */
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.
Signed-off-by Robert Hancock<[email protected]>drivers/ata/libata-sff.c +0
-0
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?
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.Signed-off-by Robert Hancock<[email protected]>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);
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