* [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
* Re: [PATCH] libata: fix reporting of drained bytes when clearing DRQ
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
0 siblings, 1 reply; 3+ messages in thread
From: Robert Hancock @ 2009-12-16 1:16 UTC (permalink / raw)
To: Jeff Garzik; +Cc: ide
On 12/08/2009 08:48 PM, Robert Hancock wrote:
> 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 */
Jeff, ping?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] libata: fix reporting of drained bytes when clearing DRQ
2009-12-16 1:16 ` Robert Hancock
@ 2009-12-16 10:21 ` Jeff Garzik
0 siblings, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2009-12-16 10:21 UTC (permalink / raw)
To: Robert Hancock; +Cc: ide
On 12/15/2009 08:16 PM, Robert Hancock wrote:
> On 12/08/2009 08:48 PM, Robert Hancock wrote:
>> 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 */
>
> Jeff, ping?
No worries, it's in the local queue...
Jeff
^ permalink raw reply [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).