From: Tejun Heo <htejun@gmail.com>
To: jeff@garzik.org, alan@lxorguk.ukuu.org.uk, ric@emc.com,
edmudama@gmail.com, linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 3/4] libata: improve ata_std_prereset()
Date: Fri, 2 Feb 2007 16:50:52 +0900 [thread overview]
Message-ID: <11704026523234-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <11704026511717-git-send-email-htejun@gmail.com>
This patch updates ata_std_prereset() as follows.
* Don't fail on phy resume failure. Just whine and continue. Failure
from prereset makes libata abort whole reset sequence and give up
the port, so prereset() should be best effort. This is more
important with the coming EH updates as prereset() will be called
with shorter timeout.
* If ata_wait_ready() fails, whine and request hardreset instead.
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
drivers/ata/libata-core.c | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index ef52beb..03ad181 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2928,7 +2928,11 @@ static void ata_wait_spinup(struct ata_port *ap, unsigned long deadline)
* @ap: ATA port to be reset
* @deadline: deadline jiffies for the operation
*
- * @ap is about to be reset. Initialize it.
+ * @ap is about to be reset. Initialize it. Failure from
+ * prereset makes libata abort whole reset sequence and give up
+ * that port, so prereset should be best-effort. It does its
+ * best to prepare for reset sequence but if things go wrong, it
+ * should just whine, not fail.
*
* LOCKING:
* Kernel thread context (may sleep)
@@ -2958,19 +2962,23 @@ int ata_std_prereset(struct ata_port *ap, unsigned long deadline)
/* if SATA, resume phy */
if (ap->cbl == ATA_CBL_SATA) {
rc = sata_phy_resume(ap, timing, deadline);
- if (rc && rc != -EOPNOTSUPP) {
- /* phy resume failed */
+ /* whine about phy resume failure but proceed */
+ if (rc && rc != -EOPNOTSUPP)
ata_port_printk(ap, KERN_WARNING, "failed to resume "
"link for reset (errno=%d)\n", rc);
- return rc;
- }
}
/* Wait for !BSY if the controller can wait for the first D2H
* Reg FIS and we don't know that no device is attached.
*/
- if (!(ap->flags & ATA_FLAG_SKIP_D2H_BSY) && !ata_port_offline(ap))
- ata_wait_ready(ap, deadline);
+ if (!(ap->flags & ATA_FLAG_SKIP_D2H_BSY) && !ata_port_offline(ap)) {
+ rc = ata_wait_ready(ap, deadline);
+ if (rc) {
+ ata_port_printk(ap, KERN_WARNING, "device not ready "
+ "(errno=%d), forcing hardreset\n", rc);
+ ehc->i.action |= ATA_EH_HARDRESET;
+ }
+ }
return 0;
}
--
1.4.4.4
prev parent reply other threads:[~2007-02-02 7:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-02 7:50 [PATCHSET] libata: reimplement reset sequencing Tejun Heo
2007-02-02 7:50 ` [PATCH 2/4] libata: improve 0xff status handling Tejun Heo
2007-02-02 7:50 ` [PATCH 1/4] libata: add deadline support to prereset and reset methods Tejun Heo
2007-03-07 11:45 ` Jeff Garzik
2007-02-02 7:50 ` [PATCH 4/4] libata: reimplement reset sequencing Tejun Heo
2007-02-02 7:50 ` Tejun Heo [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=11704026523234-git-send-email-htejun@gmail.com \
--to=htejun@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=edmudama@gmail.com \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.org \
--cc=ric@emc.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).