From owner-freebsd-mobile Wed Dec 19 3: 5: 8 2001 Delivered-To: freebsd-mobile@freebsd.org Received: from tabby.kudra.com (gw.kudra.com [199.6.32.20]) by hub.freebsd.org (Postfix) with ESMTP id 0D81737B417 for ; Wed, 19 Dec 2001 03:05:04 -0800 (PST) Received: (from robert@localhost) by tabby.kudra.com (8.11.6/8.11.5) id fBJB53372858; Wed, 19 Dec 2001 06:05:03 -0500 (EST) (envelope-from robert) Date: Wed, 19 Dec 2001 06:05:03 -0500 From: Robert Sexton To: freebsd-mobile@FreeBSD.ORG Cc: hanspeter_roth@hotmail.com Subject: Re: IDE standby timeout (hdparm) Message-ID: <20011219060503.B72034@kudra.com> References: <20011219104954.A5747@bs82.bsag.ch> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Q68bSM7Ycu6FN28Q" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011219104954.A5747@bs82.bsag.ch>; from hanspeter_roth@hotmail.com on Wed, Dec 19, 2001 at 10:49:54AM +0100 Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Dec 19, 2001 at 10:49:54AM +0100, Hanspeter Roth wrote: > > Hello, > > is it possible to finetune the standby timeout (spindown) of > IDE-disks? > Is there something like the Linux' `hdparm'? 'What patch?' Sorry for the extra list traffic. Its attached here. -- Robert Sexton - robert@kudra.com, Cincinnati OH, USA If car manufactures were the nra their slogan would be "Cars don't kill comunities, people kill communities." - Unknown --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ata.patch" *** dev/ata/ata-disk.c.orig Wed Oct 24 14:24:09 2001 --- dev/ata/ata-disk.c Sat Nov 10 02:16:55 2001 *************** *** 86,94 **** --- 86,96 ---- static int ata_dma = 1; static int ata_wc = 0; static int ata_tags = 0; + static int ata_suspend = 0; TUNABLE_INT("hw.ata.ata_dma", &ata_dma); TUNABLE_INT("hw.ata.wc", &ata_wc); TUNABLE_INT("hw.ata.tags", &ata_tags); + TUNABLE_INT("hw.ata.suspend", &ata_suspend); /* sysctl vars */ SYSCTL_DECL(_hw_ata); *************** *** 98,103 **** --- 100,107 ---- "ATA disk write caching"); SYSCTL_INT(_hw_ata, OID_AUTO, tags, CTLFLAG_RD, &ata_tags, 0, "ATA disk tagged queuing support"); + SYSCTL_INT(_hw_ata, OID_AUTO, suspend, CTLFLAG_RD, &ata_suspend, 0, + "ATA disk suspend timer"); /* defines */ #define AD_MAX_RETRIES 3 *************** *** 188,193 **** --- 192,204 ---- 0, 0, ATA_C_F_DIS_SRVIRQ, ATA_WAIT_INTR)) ata_printf(scp, device, "disabling service interrupt failed\n"); } + + if ( ata_suspend > 0 ) { + /* attempt suspend mode. The drive uses increments of ten seconds */ + if (ata_command(adp->controller, adp->unit, 0xe2, + 0, ata_suspend/10, 0, ATA_WAIT_INTR)) + printf("ad%d: suspend mode failed\n", adp->lun); + } devstat_add_entry(&adp->stats, "ad", adp->lun, DEV_BSIZE, DEVSTAT_NO_ORDERED_TAGS, --Q68bSM7Ycu6FN28Q-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message