Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Feb 2001 17:23:03 -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.47991.879862.104215@kitab.cisco.com>
In-Reply-To: <14997.39822.118192.470255@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>

next in thread | previous in thread | raw e-mail | index | archive | help
Richard Johnson writes:
 > I wanted to mention, along these lines, that netbsd has a command
 > which can program the disk controller to enter "idle" or "standby"
 > mode after a number of seconds.  The command is "atactl".  I looked at 
 > how this is done.  It's using a set of controller commands which
 > apparently aren't supported under FreeBSD.  The controller commands
 > are:

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:

*** bk_ata-disk.c       Tue Aug 22 01:41:29 2000
--- ata-disk.c  Thu Feb 22 17:11:56 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 30 seconds */
+     if (ata_command(adp->controller, adp->unit, 0xe2,
+                   0, 0, 0, 10, 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));

It'd be nice to have this more easily configurable via an ioctl, of
course.

/raj

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.47991.879862.104215>