Re: [PATCH] pm_ops: add irq enable/disable hooks

Rafael J. Wysocki
2007-04-05T23:30:52Z

On Thursday, 5 April 2007 23:54, Johannes Berg wrote:
> For powermac, we need to do some things between suspending devices and
> device_power_off, for example setting the decrementer. This patch
> introduces pm_ops.irq_off and pm_ops.irq_on which will be called instead
> of disabling/enabling irqs so platforms can do a bit more work there if
> necessary.
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
>
> ---
> My previous patches moving to the pm_ops interface for powermac were
> buggy due to exactly this issue, but the bug never surfaced on my
> machine, only on machines with an Apple Desktop Bus (or an emulation
> thereof)
>
> Does this look ok to you? Would you want different names? Should I stick
> in a BUG_ON(interrupts_enabled()) or such?

Well is this possible to do something like

if (pm_ops->do_something_before_disabling_irqs)
pm_ops->do_something_before_disabling_irqs()
local_irq_save(flags);
if (pm_ops->do_something_after_disabling_irqs)
pm_ops->do_something_after_disabling_irqs()

and analogously for enabling the IRQs?

Rafael