From owner-freebsd-mobile Thu Feb 22 17:23:11 2001 Delivered-To: freebsd-mobile@freebsd.org Received: from sj-msg-core-4.cisco.com (sj-msg-core-4.cisco.com [171.71.163.10]) by hub.freebsd.org (Postfix) with ESMTP id 76A3037B4EC for ; Thu, 22 Feb 2001 17:23:08 -0800 (PST) (envelope-from raj@cisco.com) Received: from mira-sjcm-2.cisco.com (mira-sjcm-2.cisco.com [171.69.43.98]) by sj-msg-core-4.cisco.com (8.9.3/8.9.1) with ESMTP id RAA14017; Thu, 22 Feb 2001 17:23:10 -0800 (PST) Received: from kitab.cisco.com (kitab.cisco.com [171.69.187.233]) by mira-sjcm-2.cisco.com (Mirapoint) with ESMTP id AHX02834; Thu, 22 Feb 2001 17:23:05 -0800 (PST) Received: (from raj@localhost) by kitab.cisco.com (8.11.0/8.9.2) id f1N1N5S00348; Thu, 22 Feb 2001 17:23:05 -0800 (PST) (envelope-from raj) From: Richard Johnson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14997.47991.879862.104215@kitab.cisco.com> Date: Thu, 22 Feb 2001 17:23:03 -0800 To: Tony Finch , Kevin Oberman , mobile@FreeBSD.ORG Subject: Re: Any ideas on keeping the disk spun down on laptop 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> X-Mailer: VM 6.90 under 20.4 "Emerald" XEmacs Lucid Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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