From: Chris Wright <chrisw@sous-sol.org>
To: linux-kernel@vger.kernel.org, stable@kernel.org,
Jeff Garzik <jeff@garzik.org>,
IDE/ATA development list <linux-ide@vger.kernel.org>
Cc: Justin Forbes <jmforbes@linuxtx.org>,
Zwane Mwaikambo <zwane@arm.linux.org.uk>,
Theodore Ts'o <tytso@mit.edu>,
Randy Dunlap <rdunlap@xenotime.net>,
Dave Jones <davej@redhat.com>,
Chuck Wolber <chuckw@quantumlinux.com>,
Chris Wedgwood <reviews@ml.cw.f00f.org>,
Michael Krufky <mkrufky@linuxtv.org>,
Chuck Ebbert <cebbert@redhat.com>,
Domenico Andreoli <cavokz@gmail.com>,
torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk, Tejun Heo <htejun@gmail.com>,
matthieu.castet@parrot.com, Greg Kroah-Hartman <gregkh@suse.de>
Subject: [patch 10/50] libata: force hardreset if link is in powersave mode
Date: Fri, 06 Jun 2008 18:02:25 -0700 [thread overview]
Message-ID: <20080607010555.470605116@sous-sol.org> (raw)
In-Reply-To: 20080607010215.358296706@sous-sol.org
[-- Attachment #1: libata-force-hardreset-if-link-is-in-powersave-mode.patch --]
[-- Type: text/plain, Size: 1533 bytes --]
-stable review patch. If anyone has any objections, please let us know.
---------------------
From: Tejun Heo <htejun@gmail.com>
Inhibiting link PM mode doesn't bring the link back online if it's
already in powersave mode. If SRST is used in these cases, libata EH
thinks that the link is offline and fails detection. Force hardreset
if link is in powersave mode.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
drivers/ata/libata-core.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3947,6 +3947,7 @@ int ata_std_prereset(struct ata_link *li
struct ata_port *ap = link->ap;
struct ata_eh_context *ehc = &link->eh_context;
const unsigned long *timing = sata_ehc_deb_timing(ehc);
+ u32 sstatus;
int rc;
/* handle link resume */
@@ -3960,6 +3961,17 @@ int ata_std_prereset(struct ata_link *li
if (ap->flags & ATA_FLAG_PMP)
ehc->i.action |= ATA_EH_HARDRESET;
+ /* if link powersave is on, force hardreset */
+ if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0) {
+ u8 ipm = sstatus >> 8;
+
+ if (ipm == 2 || ipm == 6) {
+ ata_link_printk(link, KERN_INFO, "link in powersave "
+ "mode (ipm=%d), forcing hardreset\n", ipm);
+ ehc->i.action |= ATA_EH_HARDRESET;
+ }
+ }
+
/* if we're about to do hardreset, nothing more to do */
if (ehc->i.action & ATA_EH_HARDRESET)
return 0;
--
next parent reply other threads:[~2008-06-07 1:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080607010215.358296706@sous-sol.org>
2008-06-07 1:02 ` Chris Wright [this message]
2008-06-07 1:27 ` [patch 10/50] libata: force hardreset if link is in powersave mode Linus Torvalds
2008-06-07 1:57 ` [stable] " Greg KH
2008-06-07 16:51 ` Linus Torvalds
2008-06-07 3:14 ` 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=20080607010555.470605116@sous-sol.org \
--to=chrisw@sous-sol.org \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=cavokz@gmail.com \
--cc=cebbert@redhat.com \
--cc=chuckw@quantumlinux.com \
--cc=davej@redhat.com \
--cc=gregkh@suse.de \
--cc=htejun@gmail.com \
--cc=jeff@garzik.org \
--cc=jmforbes@linuxtx.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthieu.castet@parrot.com \
--cc=mkrufky@linuxtv.org \
--cc=rdunlap@xenotime.net \
--cc=reviews@ml.cw.f00f.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
--cc=zwane@arm.linux.org.uk \
/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).