Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 01 Apr 96 21:54:25 PST
From:      "Brett Glass" <Brett_Glass@ccgate.infoworld.com>
To:        Michael Smith <msmith@atrad.adelaide.edu.au>
Cc:        jkh@time.cdrom.com, hardware@freebsd.org
Subject:   Re: Some solutions to disk problems.... I think.
Message-ID:  <9603018284.AA828422418@ccgate.infoworld.com>

next in thread | raw e-mail | index | archive | help
> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9603018284.AA828422418>