Subject: Re: CVS commit: src/sys/dev/ata
To: Cherry G. Mathew <cherry@zyx.in>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 04/06/2006 15:11:26
On Thu, Apr 06, 2006 at 01:24:06PM +0530, Cherry G. Mathew wrote:
>     Manuel> I have another issue with the way shutdown hooks work
>     Manuel> currently (mostly related to raidframe, but other drivers
>     Manuel> could probably have the same issue).  In short, some
>     Manuel> subsystems want a powerhook to be called from valid kernel
>     Manuel> thread context, before interrupts are blocked, to be able
>     Manuel> to stop operations in progress that need a callback from a
>     Manuel> lower subsystem to complete. This could be a second set of
>     Manuel> powerhooks, or the same powerhook list called with 2
>     Manuel> different parameters.
> 
> If they have to stop/flush at shutdown, wouldn't they have to do the
> same at, say just before PWR_STANDBY ? In which case couldn't we
> arrange to call those hooks before interrupts are blocked etc. ? 

I'm not sure it's really the same thing. For powerhooks we assume the kernel
will run again, whole for shutdown hooks it's not the case. Also I think
the power hooks are called in the opposite order, which may be a problem
for this specific case.
And in my case it would be a power hook for a pseudo device, I'm not sure
it makes sense. 

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