Re: [RFC][PATCH 2/2] PM: Rework handling of interrupts during suspend-resume

Johannes Berg
2009-02-23T15:52:59Z

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

On Mon, 2009-02-23 at 12:29 +0100, Rafael J. Wysocki wrote:

> > > + arch_suspend_disable_irqs();
> > > + BUG_ON(!irqs_disabled());
> >
> > Please. We just disabled all devices - a BUG_ON() is a very
> > counter-productive thing to do here - chances are the user will
> > never see anything but a hang. So please turn this into a nice
> > WARN_ONCE().
>
> This is just moving code. Also, the BUG_ON() can only affect powerpc and it's
> there on purpose AFAICS (Johannes?). Anyway, changing that would be a separate
> patch.

It can affect any platform that overrides the weak symbol
arch_suspend_disable_irqs(), and I think that if you're writing this
low-level code you better have a way to debug. As such, I don't think it
needs changing, because you can only ever see that while implementing
arch_suspend_disable_irqs(). OTOH, since it can only trigger then, a
WARN_ON is probably fine as well since you'll be getting your machine
into inconsistent states all the time while implementing this ;)

johannes

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

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