Subject: Re: CVS commit: src/sys/dev/ata
To: Cherry G. Mathew <cherry.g.mathew@gmail.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 04/05/2006 13:31:21
On Wed, Apr 05, 2006 at 09:10:53AM +0530, Cherry G. Mathew wrote:
> Moving thread to tech-kern, tech-macppc:
> 
> On 4/4/06, Charles M. Hannum <mycroft@mit.edu> wrote:
> > On Tue, Apr 04, 2006 at 07:11:45AM +0000, Cherry G. Mathew wrote:
> > > Sleeps hard disk just before system shutdown.
> > > Some hardware (eg: Apple iBooks) don't do this automatically
> > > and the harddisk behaves as if the power plug were pulled.
> > >
> > > Closes PR: kern/32766
> >
> > This is not an acceptable implementation.  It causes the disks to spin
> > down when you're doing a "reboot" -- which puts considerably more wear
> > on the drive than an "emergency retract" ever did, and is also really,
> > really annoying to wait for.
> >
> > Furthermore, doing an "emergency retract" was never a big deal in the
> > first place.  Who cares?
> >
> 
> I'm no expert on hard disks but in the case of this particular issue
> on the iBook:
> 
> - Open Firmware, Linux and MacOSX do not cause this sound ( the
> emergency retract) to happen.
> - It is a SMART parameter, which means there is some significance to the event.
> 
> > Please back it out at your earliest convenience.
> >
> 
> Done, and sorry for the hasty commit.
> 
> Since it looks like this is a macppc specific thing, maybe a better
> way to do this would be to spin-down the disk in:
> machdep.c:cpu_reboot()

No, it's not a macppc specific thing, I think all systems with IDE disks
could benefit from this (it's possible that PC systems with ACPI also don't
sleep the drive before power off). This has to be done in the shutdown
hook, but the shutdown hook needs more informations to work properly.
I suspect this could benefit others drivers using shutdown hooks too.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--