linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Tejun Heo <htejun@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-ide@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] libata: always use polling SETXFER
Date: Fri, 25 May 2007 06:58:12 -0400	[thread overview]
Message-ID: <4656C144.2080705@garzik.org> (raw)
In-Reply-To: <20070314053338.GA15600@htj.dyndns.org>

Tejun Heo wrote:
> Several people have reported LITE-ON LTR-48246S detection failed
> because SETXFER fails.  It seems the device raises IRQ too early after
> SETXFER.  This is controller independent.  The same problem has been
> reported for different controllers.
> 
> So, now we have pata_via where the controller raises IRQ before it's
> ready after SETXFER and a device which does similar thing.  This patch
> makes libata always execute SETXFER via polling.  As this only happens
> during EH, performance impact is nil.  Setting ATA_TFLAG_POLLING is
> also moved from issue hot path to ata_dev_set_xfermode() - the only
> place where SETXFER can be issued.
> 
> Jeff Garzik suggests that, in the long term, it might be better to
> modify libata HSM implementation such that we're more tolerant of
> erratic ATAPI IRQ behavior - e.g. default to IRQ but falling back to
> polling if the device doesn't seem ready at the point of interrupt.
> Such change might be necessary to support ancient/weird ATAPI devices.
> 
> Signed-off-by: Tejun Heo <htejun@gmail.com>

Since I wrote them up in IRC, I might as well post them here and get it 
archived:

We need to figure out a better polling solution.

For SAS and advanced SATA, polling really has no meaning at all, when 
you consider what polling IDENTIFY DEVICE and polling SET FEATURES are 
trying to solve.  To the advanced hardware, it's all a bunch of packets. 
  An event that appears "late" to the eyes of the PATA world is now 
presented as changing data fields in the packet stream.

We are going to have to deal with the HSM issue underlying the need to 
do SET FEATURES - XFER MODE polling, and ultimately IDENTIFY DEVICE 
polling too.

This is the main reason why I have resisted applying "[PATCH] libata: 
always use polling SETXFER" -- polling implies a model that does not 
exist on SAS/SATA and advanced SATA.  It's only luck that AHCI includes 
a real register to poll.

To illustrate:  Fixing this problem The Right Way(tm) will yield a 
result that would allow ahci.c to operate in an interrupt-driven mode, 
examining the contents of the FIS's returned. Polling status can already 
be replaced by examining the D2H and SDB FIS areas.

And by definition, on AHCI (and sata_sil24, IIRC) the status will not 
change unless a new FIS has arrived.

Polling is still fine on PCI IDE-like controllers (older ones), but 
advanced controllers require us to coalesce the polling bandaid into a 
test for a sequence of events.

We cannot escape the "hard part."  :)

	Jeff




  parent reply	other threads:[~2007-05-25 10:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-14  5:33 [PATCH] libata: always use polling SETXFER Tejun Heo
2007-03-14 14:09 ` Bartlomiej Zolnierkiewicz
2007-04-30  0:45 ` Tejun Heo
2007-05-25 10:58 ` Jeff Garzik [this message]
2007-05-25 11:58   ` Tejun Heo
2007-05-25 12:26     ` Jeff Garzik
2007-05-25 12:52       ` Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2007-05-27 13:10 Tejun Heo
2007-06-03 16:00 ` Jeff Garzik
2007-06-03 17:24   ` Bartlomiej Zolnierkiewicz
2007-06-03 18:45     ` Linus Torvalds
2007-06-03 18:17   ` Andrew Morton
2007-06-03 19:40   ` Linus Torvalds
2007-06-04 14:42   ` Alan Cox
2007-06-04 20:34     ` Linus Torvalds
2007-06-04 20:38       ` Jeff Garzik

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=4656C144.2080705@garzik.org \
    --to=jeff@garzik.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=htejun@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@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).