From owner-freebsd-hackers Sun Feb 25 19:42:47 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from proxy4.ba.best.com (proxy4.ba.best.com [206.184.139.15]) by hub.freebsd.org (Postfix) with ESMTP id 2227A37B491 for ; Sun, 25 Feb 2001 19:42:42 -0800 (PST) (envelope-from scott@renfro.org) Received: from renfro.org (dynamic30.pm01.san-jose.best.com [209.24.164.30]) by proxy4.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id TAA17818; Sun, 25 Feb 2001 19:40:31 -0800 (PST) Received: (from scott@localhost) by renfro.org (8.11.2/8.11.2) id f1Q3fKE64126; Sun, 25 Feb 2001 19:41:20 -0800 (PST) (envelope-from scott) Date: Sun, 25 Feb 2001 19:41:20 -0800 From: Scott Renfro To: Soren Schmidt Cc: freebsd-hackers@freebsd.org, Richard Johnson Subject: ata-disk ioctl and atactl patch Message-ID: <20010225194120.A64003@bonsai.home.renfro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG As I promised on -mobile earlier this week, I've cleaned up my patches to port the {Net,Open}BSD atactl utility, including a simplistic ata-disk ioctl. They apply cleanly against this afternoon's -stable (including Soren's latest commit bringing -stable up to date with -current). I've been running them for some time and they ''work great here''. Before announcing this in a broader context, I wanted to get a bit of feedback on the ioctl implementation. In particular, is it safe to just do an ata_command inside adioctl() without any further checking? (e.g., can this cause bad things to happen under heavy i/o load?) Here's a snippet from the newly added adioctl() in ata-disk.c: switch (cmd) { case ATAIOCCOMMAND: { struct atareq *req = (struct atareq *)addr; if (!req) return EINVAL; /* request not valid */ /* issue an ata command */ switch (req->command) { case ATAPI_STANDBY_IMMEDIATE: case ATAPI_IDLE_IMMEDIATE: /* no count argument */ error = ata_command(adp->controller, adp->unit, req->command, 0, 0, 0, 0, 0, ATA_WAIT_INTR); The full diffs are at http://www.renfro.org/scott (at the bottom of the page). These patches only implement the idle, setidle, standby, and setstandby commands. I haven't tackled sleep, identify, or checkpower commands. (Sleep isn't hard to implement, but I haven't tested whether the driver would actually reset all state properly when coming out of sleep or whether more code is required to do this). For those that question the usefulness of atactl: I do find this extremely useful. On a laptop with noatime mounts, softupdates, and syslog, cron, and atrun disabled, I can go a long time (an hour or more) without the drive spinning up. It also cuts the noise level of my Z505L in half. (Now if I can just get the fan to shut up ;-) Thanks, -scott -- Scott Renfro +1 650 906 9618 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message