linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Lord <liml@rtr.ca>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: jeff@garzik.org, linux-ide@vger.kernel.org
Subject: Re: [PATCH 2/4] libata: Drain data on errors
Date: Mon, 27 Oct 2008 15:14:51 -0400	[thread overview]
Message-ID: <4906132B.1000502@rtr.ca> (raw)
In-Reply-To: <20081017180837.7781.26372.stgit@localhost.localdomain>

Alan Cox wrote:
> From: Alan Cox <alan@redhat.com>
> 
> If the device is signalling that there is data to drain after an error we
> should read the bytes out and throw them away. Without this some devices
> and controllers get wedged and don't recover.
> 
> Based on earlier work by Mark Lord
> 
> Signed-off-by: Alan Cox <alan@redhat.com>
..
> +	/* 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 < 65536;)
> +		ioread8(ap->ioaddr.data_addr);
..

I'm just catching up on a few things here now that holiday season is over.
In the above loop, I wonder if it might be better to only check status
every NN iterations, where NN > 1 (say, 16), to speed things up a fair amount (?).

Sure it's rare, but when it happens the entire system is probably stopped
waiting for us to recover, so speed might matter some.

Cheers

  parent reply	other threads:[~2008-10-27 19:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-17 18:08 [PATCH 0/4] Small set of further libata patches Alan Cox
2008-10-17 18:08 ` [PATCH 1/4] pata_ninja32: suspend/resume support Alan Cox
2008-10-28  4:42   ` Jeff Garzik
2008-10-28  9:37     ` Alan Cox
2008-10-17 18:08 ` [PATCH 2/4] libata: Drain data on errors Alan Cox
2008-10-22 15:46   ` Elias Oltmanns
2008-10-22 16:44     ` Alan Cox
2008-10-27 19:14   ` Mark Lord [this message]
2008-10-27 21:54     ` Alan Cox
2008-10-17 18:08 ` [PATCH 3/4] libata: Improve timeout handling Alan Cox
2008-10-22 15:47   ` Elias Oltmanns
2008-10-22 16:04     ` Alan Cox
2008-10-17 18:09 ` [PATCH 4/4] libata: clean up the SFF code for coding style Alan Cox
2008-10-22 15:48   ` Elias Oltmanns
2008-10-22 16:02     ` Alan Cox
2008-10-23  0:35       ` Jeff Garzik
2008-10-28  1:49         ` Tejun Heo
2008-10-28  9:47           ` Elias Oltmanns
2008-10-29  2:05             ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4906132B.1000502@rtr.ca \
    --to=liml@rtr.ca \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).