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

Benjamin Herrenschmidt
2009-02-02T20:34:22Z

On Mon, 2009-02-02 at 09:06 -0800, Linus Torvalds wrote:
> > I don't know how x86 does but I'm sure there must be some kind ACPI
> > thingy that must be called too before you can touch a device, in case it
> > got powered off by more than just the standard D states (ie, clock
> > stopped on the bus or whole power plane switched off).
>
> It gets called later in that case.

And won't you have a potential problem here if ACPI is doing clock
gating or turning off the whole power plane ? IE. If that happens, your
pci_restore_state() done early with interrupts off will fail as well...

Since the root of that problem seems to be related to interrupts, maybe
the right approach is to have drivers disable it on suspend (ie,
disable_irq -> disabled at PIC level) and thus it would only get
re-enabled when all the drivers on a shared line have re-enabled it...
but that would mean drivers have to know they can not synchronously wait
for an interrupt from the device to happen at resume() time ...

It's not a trivial problem...

Ben.