Re: [PATCH v4] pm_ops: add system quiesce/activate hooks

Johannes Berg
2007-04-13T21:45:48Z

[-- Attachment #1.1: Type: text/plain, Size: 1226 bytes --]

On Fri, 2007-04-13 at 23:33 +0200, Pavel Machek wrote:

> Still, swsusp shuts down the devices:
>
> if ((error = arch_prepare_suspend()))
> return error;
>
> local_irq_disable();
> /* At this point, device_suspend() has been called, but *not*
> * device_power_down(). We *must* device_power_down() now.
> * Otherwise, drivers for some devices (e.g. interrupt
> controllers)
> * become desynchronized with the actual state of the hardware
> * at resume time, and evil weirdness ensues.
> */
> if ((error = device_power_down(PMSG_FREEZE))) {
> printk(KERN_ERR "Some devices failed to power down, aborting suspend\n");
> goto Enable_irqs;
> }
>
> This local_irq_disable() is very similar to the one you are doing in
> suspend-to-RAM. According to your description, it needs to play with
> the decrementor, too. But I'd really prefer not to have pm_ops call
> here -- exactly because swsusp has nothing to do with pm_ops in
> shutdown mode.

Right. But we don't actually care because we just power down, we don't
have to put the CPU into a proper state.

johannes

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]