Re: PCI PM: Restore standard config registers of all devices early

Rafael J. Wysocki
2009-02-03T00:30:43Z

On Tuesday 03 February 2009, Benjamin Herrenschmidt wrote:
>
> > But we can't tell no one is holding the mutex in question, AFAICS.
> >
> > I'm afraid we'd really need a special "no mutexes, no GFP_KERNEL allocations"
> > code path for that.
>
> No, the mutex shouldn't be held already, if it is, you're probably
> already in deep trouble. IE, you probably want to enfore that anyway,
> ie, it wouldn't be very sane to suspend the machine while ACPI was
> already in the -middle- of interpreting something anyway.
>
> IE, you should have something to ensure, before you turn interrupts off,
> that nobody else is inside the AML interpreter. You already know there
> are no other CPUs, so it's just a matter of making sure no other process
> has scheduled while holding that mutex.
>
> The easy way to do that is to do something like taking the mutex
> yourself and then setting a flag so that the intepreter stops trying to
> take it or release it itself, maybe just using the global system state.
>
> Then release the mutex on resume.

Yes, that should work.

> All of these are issues that exist today. IE. Regardless of that
> powermac problem, which is unrelated (see other posts), I think these
> things need to be sorted cleanly or suspend will not be as rock solid as
> it could/should be. IE. It's several order of magnitude better than it
> was, I agree, but I believe we have here a few reasonably simple things
> we can/should do to make it more robust.

Agreed.

Thanks,
Rafael