public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Harald Dunkel <harald.dunkel@t-online.de>
Cc: Pavel Machek <pavel@ucw.cz>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	davidsen@tmr.com
Subject: Re: 2.6.18-rc2, problem to wake up spinned down drive?
Date: Tue, 08 Aug 2006 04:26:30 +0900	[thread overview]
Message-ID: <44D793E6.8010500@gmail.com> (raw)
In-Reply-To: <44D789BA.4010206@t-online.de>

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

Harald Dunkel wrote:
> Tejun Heo wrote:
>> Pavel Machek wrote:
>>>> echo 1 > /sys/bus/scsi/devices/1:0:0:0/power/state
>>> Really? I thought power/state takes 0/3 (for D0 and D3)
>> Yes, of course.  My mistake.  Sorry about the confusion.  The correct
>> command is 'echo -n 3 > /sys/bus/scsi/devices/x:y:z:w/power/state'.
>>
> 
> (Sure?  :-)

The sleeping part is correct.  That will make libata put the disk to sleep.

> Now this did not work at all. The '-n 3' was probably
> correct, but when I tried to access the disk, then it
> did not spin up again (I waited for 5 minutes). There
> was no message on the console, either.
> 
> But I could not reproduce this problem.
> 
> How do I monitor that the disk spins down and up?

But the waking up part isn't.  You need to issue wake up explicitly by 
doing 'echo -n 0 > /sys/...'  I've been a complete idiot in this thread. 
  Please excuse me.  :-(

I think the solution to your problem is adjusting command timeout to 
more reasonable values which should make the problem more bearable. 
It'll take some time to figure out how to make timeouts more intelligent 
without breaking support for slow devices.  I'll work on that.

I'm attaching a temporary patch for the time being.

-- 
tejun

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 987 bytes --]

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 98bd3aa..5676388 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -99,7 +99,7 @@ #define SD_MAX_DISKS	(((26 * 26) + 26 + 
 /*
  * Time out in seconds for disks and Magneto-opticals (which are slower).
  */
-#define SD_TIMEOUT		(30 * HZ)
+#define SD_TIMEOUT		(7 * HZ)
 #define SD_MOD_TIMEOUT		(75 * HZ)
 
 /*
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b941670..45686f9 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -200,9 +200,9 @@ enum {
 	ATA_HOST_SIMPLEX	= (1 << 0),	/* Host is simplex, one DMA channel per host_set only */
 	
 	/* various lengths of time */
-	ATA_TMOUT_BOOT		= 30 * HZ,	/* heuristic */
-	ATA_TMOUT_BOOT_QUICK	= 7 * HZ,	/* heuristic */
-	ATA_TMOUT_INTERNAL	= 30 * HZ,
+	ATA_TMOUT_BOOT		= 10 * HZ,	/* heuristic */
+	ATA_TMOUT_BOOT_QUICK	= 5 * HZ,	/* heuristic */
+	ATA_TMOUT_INTERNAL	= 10 * HZ,
 	ATA_TMOUT_INTERNAL_QUICK = 5 * HZ,
 
 	/* ATA bus states */

  reply	other threads:[~2006-08-07 19:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-30 12:01 2.6.18-rc2, problem to wake up spinned down drive? Harald Dunkel
2006-07-30 12:22 ` Johannes Weiner
2006-07-30 12:57   ` Harald Dunkel
2006-08-01 16:16 ` Tejun Heo
2006-08-01 18:14   ` Harald Dunkel
2006-08-01 18:23     ` Tejun Heo
2006-08-02 16:56       ` Bill Davidsen
2006-08-05 19:32       ` Harald Dunkel
2006-08-05 21:23   ` Pavel Machek
2006-08-07  3:07     ` Tejun Heo
2006-08-07 18:43       ` Harald Dunkel
2006-08-07 19:26         ` Tejun Heo [this message]
2006-08-08 18:40           ` Bill Davidsen
2006-08-08 18:59             ` Tejun Heo
2006-08-02 10:18 ` Pavel Machek
2006-08-03  5:44   ` Harald Dunkel

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=44D793E6.8010500@gmail.com \
    --to=htejun@gmail.com \
    --cc=davidsen@tmr.com \
    --cc=harald.dunkel@t-online.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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