tech-kern archive

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

Re: pmf(9) and Xen domU suspending?

On Sun, Mar 30, 2008 at 09:33:30PM +0100, Iain Hibbert wrote:
> > To indicate that the device was successfully suspended or resumed.
> and if a function fails (eg during suspend), what happens to the system?

Currently, you are end up with a somewhat broken system. I'll change
that to recover as much as possible when I am back home.

> in ubt.c, I see usage of "device_pmf_is_registered(self)" to guard against
> multiple instances of registering .. apart from I'm not sure this is
> possible [via the _attach function], is this recommended?

This might be a C&P error. The idea is to not overwrite if something
more specific already registered, but it might be unnecessary here.

> is it an error to deregister more than once? ie, if a _detach function
> fails something, it may be called multiple times..


> is it an error to call pmf_deregister() when pmf_register() has not been
> called, or possibly failed?


> wrt these last two, would it be 'best practice' to pmf_register() at the
> start of the _attach function, then pmf_deregister() at the end of the
> _detach (and protect that with an _is_registered() check)?

You should only register if you know that the hooks you are using will
work. That becomes less problematic once attach can finally fail.


Home | Main Index | Thread Index | Old Index