linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linuxppc-dev@ozlabs.org,
	Johannes Berg <johannes@sipsolutions.net>,
	Alan Stern <stern@rowland.harvard.edu>,
	cpufreq@lists.linux.org.uk
Subject: Re: [Fwd: Re: via-pmu runs device_power_down in atomic context]
Date: Thu, 25 May 2006 15:19:58 +1000	[thread overview]
Message-ID: <1148534398.13249.246.camel@localhost.localdomain> (raw)
In-Reply-To: <20060524215917.230af218.akpm@osdl.org>


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

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

Ben.

  reply	other threads:[~2006-05-25  5:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1148531830.13249.237.camel@localhost.localdomain>
2006-05-25  4:59 ` [Fwd: Re: via-pmu runs device_power_down in atomic context] Andrew Morton
2006-05-25  5:19   ` Benjamin Herrenschmidt [this message]
2006-05-25  5:36     ` Andrew Morton
2006-05-25  5:46       ` Benjamin Herrenschmidt
2006-05-25  5:53         ` Benjamin Herrenschmidt
2006-05-25  5:44     ` Benjamin Herrenschmidt
2006-05-25 14:12   ` Alan Stern
2006-05-25 14:44     ` Andrew Morton
2006-05-25 16:44       ` Jon Loeliger
2006-05-25 17:53         ` [PATCH] Make cpufreq_transition_notifier a raw notifier Alan Stern
2006-05-25 18:41           ` Johannes Berg
2006-05-25 19:14             ` Alan Stern
2006-05-25 23:18           ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1148534398.13249.246.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=cpufreq@lists.linux.org.uk \
    --cc=johannes@sipsolutions.net \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).