From: Jeff Garzik <jeff@garzik.org>
To: Tejun Heo <htejun@gmail.com>
Cc: linux-ide@vger.kernel.org, liml@rtr.ca, alan@lxorguk.ukuu.org.uk,
James.Bottomley@HansenPartnership.com, brking@us.ibm.com,
ashish.kalra@freescale.com, leoli@freescale.com
Subject: Re: [PATCH 12/27] libata: restructure SFF post-reset readiness waits
Date: Fri, 04 Apr 2008 02:58:01 -0400 [thread overview]
Message-ID: <47F5D179.5010705@garzik.org> (raw)
In-Reply-To: <1206451027353-git-send-email-htejun@gmail.com>
Tejun Heo wrote:
> Previously, post-softreset readiness is waited as follows.
>
> 1. ata_sff_wait_after_reset() waits for 150ms and then for
> ATA_TMOUT_FF_WAIT if status is 0xff and other conditions meet.
>
> 2. ata_bus_softreset() finishes with -ENODEV if status is still 0xff.
> If not, continue to #3.
>
> 3. ata_bus_post_reset() waits readiness of dev0 and/or dev1 depending
> on devmask using ata_sff_wait_ready().
>
> And for post-hardreset readiness,
>
> 1. ata_sff_wait_after_reset() waits for 150ms and then for
> ATA_TMOUT_FF_WAIT if status is 0xff and other conditions meet.
>
> 2. sata_sff_hardreset waits for device readiness using
> ata_sff_wait_ready().
>
> This patch merges and unifies post-reset readiness waits into
> ata_sff_wait_ready() and ata_sff_wait_after_reset().
>
> ATA_TMOUT_FF_WAIT handling is merged into ata_sff_wait_ready(). If TF
> status is 0xff, link status is unknown and the port is SATA, it will
> continue polling till ATA_TMOUT_FF_WAIT.
>
> ata_sff_wait_after_reset() is updated to perform the following steps.
>
> 1. waits for 150ms.
>
> 2. waits for dev0 readiness using ata_sff_wait_ready(). Note that
> this is done regardless of devmask, as ata_sff_wait_ready() handles
> 0xff status correctly, this preserves the original behavior except
> that it may wait longer after softreset if link is online but
> status is 0xff. This behavior change is very unlikely to cause any
> actual difference and is intended. It brings softreset behavior to
> that of hardreset.
>
> 3. waits for dev1 readiness just the same way ata_bus_post_reset() did.
>
> Now both soft and hard resets call ata_sff_wait_after_reset() after
> reset to wait for readiness after resets. As
> ata_sff_wait_after_reset() contains calls to ->sff_dev_select(),
> explicit call near the end of sata_sff_hardreset() is removed.
>
> This change makes reset implementation simpler and more consistent.
>
> While at it, make the magical 150ms wait post-reset wait duration a
> constant and ata_sff_wait_ready() and ata_sff_wait_after_reset() take
> @link instead of @ap. This is to make them consistent with other
> reset helpers and ease core changes.
>
> pata_scc is updated accordingly.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
> drivers/ata/ahci.c | 11 +--
> drivers/ata/libata-sff.c | 161 ++++++++++++++++++-------------------------
> drivers/ata/pata_scc.c | 91 ++++++++++++++-----------
> drivers/ata/sata_inic162x.c | 6 +-
> drivers/ata/sata_via.c | 2 +-
> include/linux/libata.h | 18 ++++-
> 6 files changed, 139 insertions(+), 150 deletions(-)
This could definitely use some focused PATA testing... master/slave and
slave-only setups can be tricky and annoying, and this area is very very
fragile.
I'm applying, but just a note to watch for bug reports related to
probing caused by this (hopefully none...)
Jeff
next prev parent reply other threads:[~2008-04-04 6:58 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-25 13:16 [PATCHSET #upstream] libata: modularize SFF support, take #1 Tejun Heo
2008-03-25 13:16 ` [PATCH 01/27] libata: drop ata_dev_select() from ata_dev_read_id Tejun Heo
2008-03-25 13:16 ` [PATCH 02/27] libata: reorder functions in libata-sff.c Tejun Heo
2008-03-25 13:16 ` [PATCH 03/27] libata: reorganize SFF related stuff Tejun Heo
2008-03-25 13:16 ` [PATCH 04/27] libata: move ata_pci_default_filter() out of CONFIG_PCI Tejun Heo
2008-03-25 13:16 ` [PATCH 05/27] libata: kill ata_chk_status() call from ata_dev_configure() Tejun Heo
2008-03-25 13:16 ` [PATCH 06/27] libata: kill ata_chk_status() Tejun Heo
2008-04-04 7:29 ` Jeff Garzik
2008-03-25 13:16 ` [PATCH 07/27] libata: rename SFF functions Tejun Heo
2008-03-25 13:16 ` [PATCH 08/27] libata: rename SFF port ops Tejun Heo
2008-03-25 13:16 ` [PATCH 09/27] libata: clean up port_ops->sff_irq_clear() Tejun Heo
2008-03-25 13:16 ` [PATCH 10/27] libata: separate out ata_std_prereset() from ata_sff_prereset() Tejun Heo
2008-03-25 13:16 ` [PATCH 11/27] libata: separate out ata_std_postreset() from ata_sff_postreset() Tejun Heo
2008-03-25 13:16 ` [PATCH 12/27] libata: restructure SFF post-reset readiness waits Tejun Heo
2008-04-04 6:58 ` Jeff Garzik [this message]
2008-03-25 13:16 ` [PATCH 13/27] libata: separate out ata_wait_ready() and implement ata_wait_after_reset() Tejun Heo
2008-03-25 13:16 ` [PATCH 14/27] ahci: use ata_wait_after_reset() instead of ata_sff_wait_ready() Tejun Heo
2008-03-25 13:16 ` [PATCH 15/27] libata: move generic hardreset code from sata_sff_hardreset() to sata_link_hardreset() Tejun Heo
2008-03-25 13:16 ` [PATCH 16/27] libata: implement and use sata_std_hardreset() Tejun Heo
2008-03-25 13:16 ` [PATCH 17/27] libata: clear SError after link resume Tejun Heo
2008-03-25 13:16 ` [PATCH 18/27] libata: move PMP SCR access failure during reset to ata_eh_reset() Tejun Heo
2008-03-25 13:16 ` [PATCH 19/27] libata: unify mechanism to request follow-up SRST Tejun Heo
2008-04-04 7:00 ` Jeff Garzik
2008-03-25 13:16 ` [PATCH 20/27] libata: add qc_fill_rtf port operation Tejun Heo
2008-03-25 13:16 ` [PATCH 21/27] libata: drop @finish_qc from ata_qc_complete_multiple() Tejun Heo
2008-03-25 13:17 ` [PATCH 22/27] libata: replace tf_read with qc_fill_rtf for non-SFF drivers Tejun Heo
2008-03-25 13:17 ` [PATCH 23/27] libata: remove check_status from " Tejun Heo
2008-03-25 13:17 ` [PATCH 24/27] libata: kill ata_noop_dev_select() Tejun Heo
2008-03-25 13:17 ` [PATCH 25/27] libata: clean up dummy port_ops Tejun Heo
2008-03-25 13:17 ` [PATCH 26/27] libata: don't use ap->ioaddr in non-SFF drivers Tejun Heo
2008-03-25 13:17 ` [PATCH 27/27] libata: make SFF support 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=47F5D179.5010705@garzik.org \
--to=jeff@garzik.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=ashish.kalra@freescale.com \
--cc=brking@us.ibm.com \
--cc=htejun@gmail.com \
--cc=leoli@freescale.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).