ata: printf on every spinup/spindown?

Bruce Cran bruce at
Fri Mar 20 12:19:48 PDT 2009

On Fri, 20 Mar 2009 12:18:13 +0100
Dimitry Andric <dimitry at> wrote:

> On 2009-03-20 08:48, Bruce Cran wrote:
> > Related to this, the ATA driver should probably have some means,
> > either automatically or via atacontrol, of setting the APM value on
> > disks; I bought a new laptop and immediately had to install
> > sysutils/ataidle in order to stop the heads loading/unloading
> > several times per minute by setting APM to 254.  Apparently it's
> > fairly common for laptop drives to have overly aggressive power
> > settings that need intervention from the OS.
> I have been running with the attached patch since ages, and it still
> applies to -stable, hopefully to -current too.  I have forgotten who
> the original author is, so my apologies for not crediting it...

There's a reluctance to include code like this, I
think because it bypasses the ATA driver and talks directly to the
drive. Since the driver doesn't know what the drive's been told to do,
it can't know to adjust timers etc. to wait for the disk to spin back
up, for example.  I believe other systems like Linux and NetBSD do
bypass the driver as your patch to atacontrol does, but in FreeBSD the
driver appears to be much more sensitive to it, resulting in panics and
read timeouts because it assumes the drive is always active and ready
to respond to requests.

Bruce Cran

More information about the freebsd-current mailing list