tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Spinning down sata disk before poweroff



On Fri, Jun 17, 2016 at 11:59:09AM -0500, David Young wrote:
> > The (untested) attached patch should fix this by calling pmf before detach;
> > can you give it a try ?
> 
> Careful!  The alternation of detaching devices and unmounting
> filesystems is purposeful.  You can have devices such as vnd(4) backed
> by filesystems backed by further devices.

Ha yes, in this case my patch won't work.

> 
> It's possible that unmounting a filesystem will counteract the PMF
> shutdown.

maybe we should call pmf_system_shutdown() before detach in the loop then ?
But this may also have unwanted side effect, such as powering off
a network adapter needed for NFS ...

> 
> A less intrusive change that's likely to work pretty well, I think, is
> to introduce a new flag, DETACH_REBOOT or DETACH_STAY_POWERED, that's
> passed to config_detach_all() by cpu_reboot() when the RB_* flags
> indicate a reboot is happening.  Then, in the wd(4) detach routine, put
> the device into standby mode if the flag is not set.

I'd prefer to have it the other way round then: a DETACH_POWEROFF
which is set only for halt -p.

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


Home | Main Index | Thread Index | Old Index