Date: Sat, 8 Mar 2003 17:01:44 -0800 (PST) From: Seunghun Lee <seunghun_t_lee@yahoo.com> To: freebsd-questions@freebsd.org Subject: ata disk spindown timeout Message-ID: <20030309010144.53082.qmail@web20804.mail.yahoo.com>
next in thread | raw e-mail | index | archive | help
*** ata-disk.c.orig Tue Dec 17 12:46:56 2002
--- ata-disk.c Sat Mar 8 14:50:01 2003
***************
*** 87,95 ****
--- 87,97 ----
static int ata_dma = 1;
static int ata_wc = 1;
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);
static MALLOC_DEFINE(M_AD, "AD driver", "ATA disk driver");
/* sysctl vars */
***************
*** 100,105 ****
--- 102,110 ----
"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 (secs)");
+
void
ad_attach(struct ata_device *atadev)
***************
*** 201,206 ****
--- 206,218 ----
ata_prtdev(atadev, "disabling service interrupt failed\n");
}
+ if ( ata_suspend > 0 ) {
+ /* attempt suspend mode. The drive uses increments of ten seconds */
+ if (ata_command(atadev, 0xe2,
+ 0, ata_suspend/10, 0, ATA_WAIT_INTR))
+ printf("ad%d: suspend mode failed\n", adp->lun);
+ }
+
ATA_UNLOCK_CH(atadev->channel);
devstat_add_entry(&adp->stats, "ad", adp->lun, DEV_BSIZE,
***************
*** 888,893 ****
--- 900,912 ----
ata_umode(adp->device->param));
else
ata_dmainit(atadev, ata_pmode(adp->device->param), -1, -1);
+ if ( ata_suspend > 0 ) {
+ /* attempt suspend mode. The drive uses increments of ten seconds */
+ if (ata_command(atadev, 0xe2,
+ 0, ata_suspend/10, 0, ATA_WAIT_READY))
+ printf("ad%d: suspend mode failed\n", adp->lun);
+ }
+
}
void
=====
--Seunghun Lee
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030309010144.53082.qmail>
