From: Tejun Heo <htejun@gmail.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: mlord@pobox.com, albertcc@tw.ibm.com, alan@lxorguk.ukuu.org.uk,
axboe@suse.de, forrest.zhao@intel.com, linux-ide@vger.kernel.org
Subject: Re: [PATCH 11/14] libata-hp-prep: make ops->tf_read() optional
Date: Tue, 23 May 2006 09:04:18 -0700 [thread overview]
Message-ID: <44733282.1010509@gmail.com> (raw)
In-Reply-To: <446DE034.6030103@pobox.com>
Jeff Garzik wrote:
> Tejun Heo wrote:
>> Not all controllers have single TF image and ops->tf_read() is
>> inappropriate for them. Newly implemented hotplug probing will allow
>> drivers for such controllers to get rid of ops->tf_read() completely.
>> Make ops->tf_read() optional in core layer.
>>
>> Signed-off-by: Tejun Heo <htejun@gmail.com>
>
> NAK.
>
> At the present time, the controller model expects to be able to obtain
> correct values from the shadow registers. For FIS-based controllers,
> this may imply that the driver needs to maintain an accurate shadow
> register image, if the chip doesn't automatically supply one.
>
> I think this is a quite reasonable expectation, given that ATA continues
> to have specifically defined shadow register outputs, and even in the
> face of NCQ, we have defined states where the shadow registers are
> available.
>
> On this basis, attempts to make ->check_status() optional are also NAK'd.
The reasons why I did this are...
* For controllers which don't maintain shadow register image, the cached
value gets out of sync easily and cause malfunction. In some cases, the
only way is to fake safe values.
* With generic TF access, LLDs cannot determine when TF will be accessed
and why. It must try to keep TF as up-to-date as possible. e.g. sil24
skips TF loading after a qc completion, this makes the cached TF go out
of sync, which can easily cause problems depending on the previous
cached value and how it will be used later.
* With PM, on both AHCI and sil24, each port's TF image must be
cached/faked. I think this would be true for many controllers.
* libata is heading toward high-level ops. At least, that's the plan.
With high-level qc_issue/complete interface, there's no reason for
libata-core layer to access TF directly.
Currently, for FIS-based controllers, the only places where libata-core
layer accesses TF are...
* waiting for !BSY. This is often broken (cache TF gets out of sync,
uncleared previous FIS value...)
* loading qc->result_tf when ATA_QCFLAG_RESULT_TF is set or the qc
failed. As noted above, I think it's best done in LLD completion routine.
I'll drop this and related patches from hotplug series, but I really
don't want to cache/fake TFs for all ports of PM. The cached values
wouldn't be accurate, sometimes values will have to be faked to bypass
TF accesses, and all those should be implemented in LLDs.
Thanks.
--
tejun
next prev parent reply other threads:[~2006-05-23 21:55 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-19 13:16 [PATCHSET 01/03] prep for hotplug support, take 3 Tejun Heo
2006-05-19 13:16 ` [PATCH 03/14] libata-hp-prep: make some ata_device fields persistent Tejun Heo
2006-05-19 15:00 ` Jeff Garzik
2006-05-19 13:16 ` [PATCH 01/14] libata-hp-prep: add flags and eh_info/context fields for hotplug Tejun Heo
2006-05-19 14:58 ` Jeff Garzik
2006-05-19 15:17 ` Tejun Heo
2006-05-19 15:28 ` Jeff Garzik
2006-05-19 13:16 ` [PATCH 02/14] libata-hp-prep: implement ata_dev_init() Tejun Heo
2006-05-19 13:16 ` [PATCH 04/14] libata-hp-prep: update ata_scsi_find_dev() and friends Tejun Heo
2006-05-19 15:03 ` Jeff Garzik
2006-05-23 14:25 ` Tejun Heo
2006-05-26 7:07 ` Jeff Garzik
2006-05-19 13:16 ` [PATCH 05/14] libata-hp-prep: use __ata_scsi_find_dev() Tejun Heo
2006-05-19 13:16 ` [PATCH 07/14] libata-hp-prep: store attached SCSI device Tejun Heo
2006-05-19 15:04 ` Jeff Garzik
2006-05-19 13:16 ` [PATCH 09/14] libata-hp-prep: make probing related functions global Tejun Heo
2006-05-19 13:16 ` [PATCH 06/14] libata-hp-prep: implement ap->hw_sata_spd_limit Tejun Heo
2006-05-19 13:16 ` [PATCH 11/14] libata-hp-prep: make ops->tf_read() optional Tejun Heo
2006-05-19 15:11 ` Jeff Garzik
2006-05-23 16:04 ` Tejun Heo [this message]
2006-05-19 13:16 ` [PATCH 12/14] libata-hp-prep: implement ata_noop_check_status() Tejun Heo
2006-05-19 15:12 ` Jeff Garzik
2006-05-19 13:16 ` [PATCH 08/14] libata-hp-prep: add ata_hotplug_wq Tejun Heo
2006-05-19 13:16 ` [PATCH 14/14] libata-hp-prep: implement followup softreset handling Tejun Heo
2006-05-19 15:21 ` Jeff Garzik
2006-05-19 13:16 ` [PATCH 10/14] libata-hp-prep: implement sata_phy_debounce() Tejun Heo
2006-05-19 15:07 ` Jeff Garzik
2006-05-19 13:16 ` [PATCH 13/14] libata-hp-prep: add prereset() method and implement ata_std_prereset() Tejun Heo
2006-05-19 15:20 ` Jeff Garzik
2006-05-23 14:44 ` Tejun Heo
2006-05-23 22:29 ` Alan Cox
2006-05-29 2:14 ` Tejun Heo
-- strict thread matches above, loose matches on Subject: below --
2006-05-19 13:06 [PATCH 10/14] libata-hp-prep: implement sata_phy_debounce() Tejun Heo
2006-05-19 13:06 ` [PATCH 11/14] libata-hp-prep: make ops->tf_read() optional Tejun Heo
2006-05-11 15:11 [PATCHSET 07/11] prep LLDDs for hotplug support, take 1 Tejun Heo
2006-05-11 15:12 ` [PATCH 11/14] libata-hp-prep: make ops->tf_read() optional Tejun Heo
2006-05-11 15:02 [PATCHSET 06/11] prep for hotplug support, take 2 Tejun Heo
2006-05-11 15:02 ` [PATCH 11/14] libata-hp-prep: make ops->tf_read() optional 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=44733282.1010509@gmail.com \
--to=htejun@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=albertcc@tw.ibm.com \
--cc=axboe@suse.de \
--cc=forrest.zhao@intel.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=mlord@pobox.com \
/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).