Date: Thu, 22 Feb 2001 18:12:53 -0800 From: Richard Johnson <raj@cisco.com> To: Tony Finch <dot@dotat.at>, Kevin Oberman <oberman@es.net>, mobile@FreeBSD.ORG Subject: Re: Any ideas on keeping the disk spun down on laptop Message-ID: <14997.50981.777893.316152@kitab.cisco.com> In-Reply-To: <14997.47991.879862.104215@kitab.cisco.com> References: <200102112211.f1BMBCL23187@ptavv.es.net> <20010212211351.F35416@hand.dotat.at> <20010212234816.M35416@hand.dotat.at> <14997.39822.118192.470255@kitab.cisco.com> <14997.47991.879862.104215@kitab.cisco.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Richard Johnson writes:
> Let me followup on my own message...
>
> I put in the following kludge and it my disk drive now spins down
> after 10 seconds just fine:
Let me correct myself. I forgot that the disk spindown time is in 5
second increments up until 20 minutes (240*5 seconds). After that
it's 240 + (num. of 30 minute intervals). Here's the calculation:
if (idle <= 240*5)
req.sec_count = idle / 5;
else
req.sec_count = idle / (30*60) + 240;
so the real change I'm going with, which sets a 5 minute spindown
time, is:
*** bk_ata-disk.c Tue Aug 22 01:41:29 2000
--- ata-disk.c Thu Feb 22 18:07:07 2001
***************
*** 151,156 ****
--- 151,162 ----
0, 0, 0, 0, ATA_C_F_ENAB_WCACHE, ATA_WAIT_INTR))
printf("ad%d: enabling write cache failed\n", adp->lun);
+ /* Try to turn on suspend mode after 300 seconds */
+ if (ata_command(adp->controller, adp->unit, 0xe2,
+ 0, 0, 0, 60, 0, ATA_WAIT_INTR))
+ printf("ad%d: suspend mode failed\n", adp->lun);
+
+
/* use DMA if drive & controller supports it */
ata_dmainit(adp->controller, adp->unit, ata_pmode(AD_PARAM),
ata_wmode(AD_PARAM), ata_umode(AD_PARAM));
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14997.50981.777893.316152>
