public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Lala <clala@riverbed.com>
To: jgarzik@pobox.com
Cc: linux-ide@vger.kernel.org, ajones@riverbed.com,
	rbecker@riverbed.com, clala@riverbed.com
Subject: [libata PATCH 1/1] libata: thaw port after maximum reset retries
Date: Fri, 11 Sep 2009 08:27:04 -0700	[thread overview]
Message-ID: <20090911152703.GA5222@clala-laptop> (raw)

The libata error recovery tries to reset a port a number
of times and if unsuccessful, gives up. The code does not
thaw the port before it exits. If the bad disk i.e. the disk
that could not be reset is removed and a healthy disk is
inserted, the new disk does not register, since the port is
frozen. This patch fixes the same.

Signed-off-by: Chaitanya Lala <clala@riverbed.com>
---
 drivers/ata/libata-eh.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 79711b6..724f86f 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2637,8 +2637,12 @@ int ata_eh_reset(struct ata_link *link, int classify,
 	    sata_scr_read(link, SCR_STATUS, &sstatus))
 		rc = -ERESTART;
 
-	if (rc == -ERESTART || try >= max_tries)
+	if (rc == -ERESTART || try >= max_tries) {
+		/* thaw the port */
+		if (ata_is_host_link(link))
+			ata_eh_thaw_port(ap);
 		goto out;
+	}
 
 	now = jiffies;
 	if (time_before(now, deadline)) {
-- 
1.6.0.4


             reply	other threads:[~2009-09-11 15:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 15:27 Chaitanya Lala [this message]
2009-11-09  8:17 ` [libata PATCH 1/1] libata: thaw port after maximum reset retries 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=20090911152703.GA5222@clala-laptop \
    --to=clala@riverbed.com \
    --cc=ajones@riverbed.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=rbecker@riverbed.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