linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Kyle McMartin <kyle@mcmartin.ca>
Cc: Jeff Garzik <jeff@garzik.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-ide@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [git patches] libata updates for 2.6.37
Date: Wed, 01 Dec 2010 15:19:06 +0100	[thread overview]
Message-ID: <4CF6595A.6010104@kernel.org> (raw)
In-Reply-To: <20101201124445.GG25668@bombadil.infradead.org>

Hello, again.

On 12/01/2010 01:44 PM, Kyle McMartin wrote:
> 00:1f.2 SATA controller [0106]: Intel Corporation 5 Series/3400 Series
...
> 	Model Number:       HITACHI HTS725032A9A364                 

Nothing peculiar.  Hmm... okay, I think I've found what went wrong.
Can you please try the following patch and see whether the problem
goes away?

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 5e59050..17a6378 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -3275,6 +3275,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
 	struct ata_port *ap = ata_is_host_link(link) ? link->ap : NULL;
 	struct ata_eh_context *ehc = &link->eh_context;
 	struct ata_device *dev, *link_dev = NULL, *lpm_dev = NULL;
+	enum ata_lpm_policy old_policy = link->lpm_policy;
 	unsigned int hints = ATA_LPM_EMPTY | ATA_LPM_HIPM;
 	unsigned int err_mask;
 	int rc;
@@ -3338,6 +3339,14 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
 		goto fail;
 	}

+	/*
+	 * Low level driver acked the transition.  Issue DIPM command
+	 * with the new policy set.
+	 */
+	link->lpm_policy = policy;
+	if (ap && ap->slave_link)
+		ap->slave_link->lpm_policy = policy;
+
 	/* host config updated, enable DIPM if transitioning to MIN_POWER */
 	ata_for_each_dev(dev, link, ENABLED) {
 		if (policy == ATA_LPM_MIN_POWER && ata_id_has_dipm(dev->id)) {
@@ -3353,12 +3362,14 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
 		}
 	}

-	link->lpm_policy = policy;
-	if (ap && ap->slave_link)
-		ap->slave_link->lpm_policy = policy;
 	return 0;

 fail:
+	/* restore the old policy */
+	link->lpm_policy = old_policy;
+	if (ap && ap->slave_link)
+		ap->slave_link->lpm_policy = old_policy;
+
 	/* if no device or only one more chance is left, disable LPM */
 	if (!dev || ehc->tries[dev->devno] <= 2) {
 		ata_link_printk(link, KERN_WARNING,

  reply	other threads:[~2010-12-01 14:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-22  1:23 [git patches] libata updates for 2.6.37 Jeff Garzik
2010-11-29 18:07 ` Kyle McMartin
2010-11-30 14:13   ` Tejun Heo
2010-11-30 15:38     ` Kyle McMartin
2010-11-30 16:29       ` Tejun Heo
2010-11-30 16:31         ` Kyle McMartin
2010-11-30 17:53           ` Kyle McMartin
2010-11-30 21:09             ` Kyle McMartin
2010-12-01 11:17               ` Tejun Heo
2010-12-01 12:44                 ` Kyle McMartin
2010-12-01 14:19                   ` Tejun Heo [this message]
2010-12-01 15:50                     ` Kyle McMartin
2010-12-01 20:09                       ` Kyle McMartin
2010-12-02 10:17                         ` Tejun Heo
2010-12-02 21:23                           ` Kyle McMartin
2010-12-03 10:10                             ` Tejun Heo
2010-12-03 11:59                               ` Kyle McMartin
2010-12-06 16:07                                 ` Kyle McMartin
2010-12-06 17:46                                   ` 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=4CF6595A.6010104@kernel.org \
    --to=tj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=jeff@garzik.org \
    --cc=kyle@mcmartin.ca \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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).