linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <gregkh@suse.de>
To: htejun@gmail.com, gregkh@suse.de, jeff@garzik.org,
	linux-ide@vger.kernel.org
Cc: stable@kernel.org, stable-commits@vger.kernel.org
Subject: patch libata-force-hardreset-if-link-is-in-powersave-mode.patch added to 2.6.25-stable tree
Date: Thu, 15 May 2008 12:04:46 -0700	[thread overview]
Message-ID: <20080515195022.89DFD14540CB@imap.suse.de> (raw)
In-Reply-To: <482C3751.8030206@gmail.com>


This is a note to let you know that we have just queued up the patch titled

     Subject: libata: force hardreset if link is in powersave mode

to the 2.6.25-stable tree.  Its filename is

     libata-force-hardreset-if-link-is-in-powersave-mode.patch

A git repo of this tree can be found at 
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary


>From stable-bounces@linux.kernel.org Thu May 15 06:15:27 2008
From: Tejun Heo <htejun@gmail.com>
Date: Thu, 15 May 2008 22:14:57 +0900
Subject: libata: force hardreset if link is in powersave mode
To: Jeff Garzik <jeff@garzik.org>, IDE/ATA development list <linux-ide@vger.kernel.org>, stable@kernel.org
Cc: matthieu.castet@parrot.com
Message-ID: <482C3751.8030206@gmail.com>

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>

---
 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;


Patches currently in stable-queue which might be from htejun@gmail.com are

queue-2.6.25/libata-force-hardreset-if-link-is-in-powersave-mode.patch

      reply	other threads:[~2008-05-15 19:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-15 13:14 libata: force hardreset if link is in powersave mode Tejun Heo
2008-05-15 19:04 ` gregkh [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=20080515195022.89DFD14540CB@imap.suse.de \
    --to=gregkh@suse.de \
    --cc=htejun@gmail.com \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@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).