From owner-freebsd-mobile Thu Feb 22 18:13: 6 2001 Delivered-To: freebsd-mobile@freebsd.org Received: from sj-msg-core-2.cisco.com (sj-msg-core-2.cisco.com [171.69.43.88]) by hub.freebsd.org (Postfix) with ESMTP id 27B9537B4EC for ; Thu, 22 Feb 2001 18:13:03 -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-2.cisco.com (8.9.3/8.9.1) with ESMTP id SAA02299; Thu, 22 Feb 2001 18:13:18 -0800 (PST) Received: from kitab.cisco.com (kitab.cisco.com [171.69.187.233]) by mira-sjcm-2.cisco.com (Mirapoint) with ESMTP id AHX03610; Thu, 22 Feb 2001 18:12:59 -0800 (PST) Received: (from raj@localhost) by kitab.cisco.com (8.11.0/8.9.2) id f1N2CwU00508; Thu, 22 Feb 2001 18:12:58 -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.50981.777893.316152@kitab.cisco.com> Date: Thu, 22 Feb 2001 18:12:53 -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.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> 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: > 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