[Fwd: Re: via-pmu runs device_power_down in atomic context]
Andrew Morton
akpm at osdl.org
Thu May 25 15:36:58 EST 2006
Benjamin Herrenschmidt <benh at kernel.crashing.org> wrote:
>
>
> > Here, pmac has gone and unilaterally decided that device_power_down() is
> > atomic, even though device_power_down() _already_ calls suspend_device(),
> > which does down(). So I'd say you've gone and found a via-pmu bug here.
>
> No. Look at the implementation (and the comment) in device_power_down().
> It's designed to be called with irqs off... Of course, somebody changed
> the locking in there and it's indeed ending up calling suspend_device()
> for devices on the irq_off list which calls down ... bad bad... that's
> another bug in the drivers/power/* to add to an already long list.
> Fortunately, very few (if any) devics rely on this irq_off list. But
> sysdev's do.
uh-huh.
> > A way of shutting up the warning would be to use an atomic notifier, but
> > it'll still be buggy. Better would be to teach pmac_suspend_devices() not
> > to assume things which aren't true ;)
>
> No. If we call device_power_down with interrupts enabled, very bad
> things will happen. This powermac code is very carefully crafted to do
> things in a strict order and it's along those lines that the callbacks
> in the device model were initially defined. Now, people who don't
> understand shit about how to make power management reliable may have
> broken things around, but the powermac implementation is right there.
>
This requirement to keep interrupts off in there breaks things again and
again and again and again. And this time: again.
It looks like we (again) have to live with it in which case conversion to
an atomic notifier is probably needed. That may break other things though.
Alan would know.
More information about the Linuxppc-dev
mailing list