From owner-freebsd-hardware Mon Apr 1 21:34:34 1996 Return-Path: owner-hardware Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id VAA07872 for hardware-outgoing; Mon, 1 Apr 1996 21:34:34 -0800 (PST) Received: from lserver.infoworld.com (lserver.infoworld.com [192.216.48.4]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id VAA07862 for ; Mon, 1 Apr 1996 21:34:30 -0800 (PST) Received: from ccgate.infoworld.com by lserver.infoworld.com with smtp (Smail3.1.29.1 #12) id m0u3yt4-000wqNC; Mon, 1 Apr 96 21:44 PST Received: from cc:Mail by ccgate.infoworld.com id AA828422418; Mon, 01 Apr 96 21:54:25 PST Date: Mon, 01 Apr 96 21:54:25 PST From: "Brett Glass" Message-Id: <9603018284.AA828422418@ccgate.infoworld.com> To: Michael Smith Cc: jkh@time.cdrom.com, hardware@freebsd.org Subject: Re: Some solutions to disk problems.... I think. Sender: owner-hardware@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > Don't do it this way, particularly since you are adding a command > to activate a vendor-specific function. > You should create a rogues table, and define your Seagate fix as a > 'rogue feature', triggered by the drive id in wdattach(). If it were done this way, timeouts would always be turned off even when power savings were desired. It's better to keep it optional. Therefore, two configuration flags -- one for the master and one for the slave -- would still be a good idea, even in the presence of a "rogues" table. The best approach if we did NOT want to use kernel flags would be to create an IOCTL that lets a utility (running with proper permissions, of course) set the controller registers and execute an arbitrary ATA command. This would parallel what's done in the SCSI driver. A user who wanted to disable inactivity timeouts, or wanted to invoke any other drive feature, could write a very simple program to issue the ioctl. The program could be placed in rc, rc.boot, or whichever rc-like file was appropriate. But there's a big disavantage inherent in the latter approach: A user who was INSTALLING FreeBSD could well run into big problems. Why? Because the utility wouldn't be there during installation, and the install might fail if the drive spun down. (This is what happened to me.) Kernel configuration flags, on the other hand, are great because they are available right away. They can be set using the configuration editor at boot time, so that inactivity timeouts are disabled as soon as the OS starts up. So, all things considered, here's how I'd combine your ideas and mine to come up with the most workable solution. I think we should keep the kernel configuration flags, so that the inactivity timer can be turned off immediately (or not!) as the driver starts up. If a drive's NO_IDLE flag is turned on, wdgetctrlr() (which is called by wdattach()) can check a table, as you described. Better still, it can invoke a cascade of detection/configuration routines, each designed to handle some makes and models. The first routine that recognizes the drive configures it and exits the chain. If execution "falls out the bottom," or a configuration command fails, a warning message can be printed indicating that the drive was not recognized. Or we can simply clear the flag I've added to the disk record, so that there's no message indicating that the inactivity timer was turned off. (The big advantage of this approach over a table is that the routines can do specialized parsing on drive IDs, handling groups of model numbers and suffixes elegantly.) For the moment, we could detect just Seagate (which we know how to handle now; in fact, the code already checks to see if the command works on that drive). We can then add more makes and models as we learn how to deal with them. Sound like a plan? --Brett