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

Johannes Berg
2007-04-06T00:09:18Z

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

On Fri, 2007-04-06 at 02:02 +0200, Rafael J. Wysocki wrote:

> Well, this seems to be more natural ("if you want to do something before/after
> disabling the IRQs, define it" instead of "you can do something instead of
> calling local_irq_save(), but please remember to disable the IRQs yourself
> in that case").

Heh. Yeah, I guess. It just didn't seem worth it. I personally don't
care, I just need to be able to get at those spots.

> BTW, it need not be in pm_ops (actually, why should it be there?).
> Alternatively, you can define something like arch_prepare_for_disabling_irqs()
> and/or arch_prepare_device_power_down() that will be empty on x86, for
> example.

Not sure, it might be different for different suspend methods. We
actually need to do some platform-function stuff inbetween, and if we
ever want some S4-like state then we might need to do it differently.

> BTW2, I think BUG_ON(irqs_enabled) is needed after the arch does something
> instead of or after local_irq_save().

Sure, I can add that. Probably also in the resume path.

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 --]