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

From: Johannes Berg
Date: Mon Feb 23 2009 - 10:54:03 EST


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: signature.asc
Description: This is a digitally signed message part