linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Alex Vandiver <alex@chmrr.net>
Cc: linux-ide <linux-ide@vger.kernel.org>
Subject: Re: Intermittent SATA failures ("link offline, clearing class 1 to NONE")
Date: Tue, 01 Dec 2009 17:31:16 +0900	[thread overview]
Message-ID: <4B14D454.7010300@kernel.org> (raw)
In-Reply-To: <4B14D003.30407@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 105 bytes --]

Hello,

Can you please apply the attached patch and post the good and bad boot
logs?

Thanks.

-- 
tejun

[-- Attachment #2: debounce-debug.patch --]
[-- Type: text/x-patch, Size: 1506 bytes --]

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index dc72690..c501e1e 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3731,7 +3731,7 @@ int sata_link_debounce(struct ata_link *link, const unsigned long *params,
 	unsigned long interval = params[0];
 	unsigned long duration = params[1];
 	unsigned long last_jiffies, t;
-	u32 last, cur;
+	u32 last, cur, xxx;
 	int rc;
 
 	t = ata_deadline(jiffies, params[2]);
@@ -3740,7 +3740,9 @@ int sata_link_debounce(struct ata_link *link, const unsigned long *params,
 
 	if ((rc = sata_scr_read(link, SCR_STATUS, &cur)))
 		return rc;
+	xxx = cur;
 	cur &= 0xf;
+	ata_link_printk(link, KERN_INFO, "XXX debounce start, SStatus=%x\n", xxx);
 
 	last = cur;
 	last_jiffies = jiffies;
@@ -3749,6 +3751,7 @@ int sata_link_debounce(struct ata_link *link, const unsigned long *params,
 		msleep(interval);
 		if ((rc = sata_scr_read(link, SCR_STATUS, &cur)))
 			return rc;
+		xxx = cur;
 		cur &= 0xf;
 
 		/* DET stable? */
@@ -3756,8 +3759,12 @@ int sata_link_debounce(struct ata_link *link, const unsigned long *params,
 			if (cur == 1 && time_before(jiffies, deadline))
 				continue;
 			if (time_after(jiffies,
-				       ata_deadline(last_jiffies, duration)))
+				       ata_deadline(last_jiffies, duration))) {
+				ata_link_printk(link, KERN_INFO,
+						"XXX debounce done, SStatus=%x, DET stable for %u msecs\n",
+						xxx, jiffies_to_msecs(jiffies - last_jiffies));
 				return 0;
+			}
 			continue;
 		}
 

  reply	other threads:[~2009-12-01  8:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-12 19:43 Intermittent SATA failures ("link offline, clearing class 1 to NONE") Alex Vandiver
2009-12-01  6:04 ` Tejun Heo
2009-12-01  7:37   ` Alex Vandiver
2009-12-01  8:12     ` Tejun Heo
2009-12-01  8:31       ` Tejun Heo [this message]
2009-12-01 22:02         ` Alex Vandiver
2009-12-02  1:43           ` Tejun Heo
2009-12-02 17:45             ` Alex Vandiver
2009-12-03  0:19               ` Tejun Heo
2009-12-03  0:42                 ` Tejun Heo
2009-12-18 23:26                   ` Alex Vandiver
2009-12-21  4:50                     ` Tejun Heo
2009-12-21 19:13                       ` Alex Vandiver
2009-12-22  0:06                         ` Tejun Heo
     [not found] <r2qf7a305db1004270252le438bd88vb3ca3d9b753651a9@mail.gmail.com>
     [not found] ` <g2lf7a305db1004270255t5d50de0n1dc21fdc7b191d92@mail.gmail.com>
2010-05-17  9:52   ` 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=4B14D454.7010300@kernel.org \
    --to=tj@kernel.org \
    --cc=alex@chmrr.net \
    --cc=linux-ide@vger.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).