From: Jeff Garzik <jgarzik@pobox.com>
To: Tejun Heo <htejun@gmail.com>,
linux-ide@vger.kernel.org, Jens Axboe <axboe@suse.de>,
Alan Cox <alan@lxorguk.ukuu.org.uk>, Mark Lord <liml@rtr.ca>
Cc: albertcc@tw.ibm.com
Subject: a word about ATA interrupts, and SATA (was Re: [PATCH libata-dev-2.6:upstream 00/02] libata: race fixes)
Date: Sun, 21 Aug 2005 16:08:21 -0400 [thread overview]
Message-ID: <4308DF35.4070503@pobox.com> (raw)
In-Reply-To: <20050820141408.62050C34@htj.dyndns.org>
BTW, here is food for thought:
In first generation SATA controllers, the host controller silicon
emulates a set of PATA taskfile registers. When you follow the ATA
command protocols (host state machines), handling ATA commands in the
specified manner, the host controller silicon is processing that stuff
behind your back, silently converting your actions into other actions:
* storing data in a H2D Register FIS buffer, for eventually sending to
the device
* storing data received from a D2H Register FIS or SDB FIS into the host
controller taskfile registers.
* handling PIO Setup and Data FISes, for PIO data xfer and PACKET
command protocol
* handling FIS's associated with DMA data transfer
I've never seen any documentation for any host controller, that
describes how the emulation is implemented in silicon. Probably nobody
outside of the original VHDL designers for each chip know that. All we
know, we must figure out from inference: we pretend a host chip is
PATA, and the host chip turns our actions into a SATA FIS conversion.
Because of this, we can discern several unique SATA quirks:
(a) writing most ATA registers simply involves storing a data value into
a buffer on the host controller
(b) writing to Device Control or Command registers causes a H2D Register
FIS to be sent.
(c) [most important to this thread] the ATA INTRQ is signalled by
setting the 'I' bit in certain FIS's. It is no longer a pure indication
of the INTRQ signal, as it was in PATA.
Due to the ramifications of (c), polling in general is possible but not
the best idea. libata currently uses polling for the IDENTIFY DEVICE
command, and I have long been thinking about turning off polling for
SATA controllers. Some SATA controllers, such as Vitesse/Intel, simply
do not support the ATA nIEN bit. It is emulated in the driver. Other
controllers may not honor the nIEN bit correctly (due to bad emulation
logic in silicon, probably).
Just factor this info into your decisions, when playing around with the
interrupt delivery code.
Jeff
prev parent reply other threads:[~2005-08-21 21:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-20 14:15 [PATCH libata-dev-2.6:upstream 00/02] libata: race fixes Tejun Heo
2005-08-20 14:15 ` [PATCH libata-dev-2.6:upstream 01/02] libata: implement ata_poll_qc_complete and use it in polling functions Tejun Heo
2005-08-21 19:53 ` Jeff Garzik
2005-08-22 8:12 ` Tejun Heo
2005-08-23 5:06 ` Jeff Garzik
2005-08-20 14:15 ` [PATCH libata-dev-2.6:upstream 02/02] libata: add host_set locking to ata_scsi_error() Tejun Heo
2005-08-21 19:52 ` Jeff Garzik
2005-08-22 8:23 ` Tejun Heo
2005-08-21 20:08 ` Jeff Garzik [this message]
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=4308DF35.4070503@pobox.com \
--to=jgarzik@pobox.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=albertcc@tw.ibm.com \
--cc=axboe@suse.de \
--cc=htejun@gmail.com \
--cc=liml@rtr.ca \
--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).