From: Dominik Brodowski <linux@dominikbrodowski.net>
To: "Rafael J. Wysocki" <rjw@sisk.pl>,
Alan Stern <stern@rowland.harvard.edu>,
linux-pm@lists.linux-foundation.org
Cc: linux-pcmcia@lists.infradead.org
Subject: [RFC PATCH] power: support _noirq actions on device types and classes
Date: Mon, 15 Mar 2010 21:59:03 +0100 [thread overview]
Message-ID: <20100315205903.GA7094@comet.dominikbrodowski.net> (raw)
In-Reply-To: <201003152035.57927.rjw@sisk.pl>
Hey,
Does this look right? As PCMCIA seems to be the first user (for 2.6.35), I
can carry it if you prefer. Otherwise, we'd need to be careful that this
gets merged before the next big PCMCIA update for 2.6.35-rc1.
What's possible with this -- 66 insertions(+), 288 deletions(-) -- for the
PCMCIA subsystem can be seen here:
http://git.kernel.org/?p=linux/kernel/git/brodo/pcmcia-2.6.git;a=commitdiff;h=ac1986af0977c339dc6072f476e23a42103c980f
From: Dominik Brodowski <linux@dominikbrodowski.net>
Date: Mon, 15 Mar 2010 21:43:11 +0100
Subject: [PATCH] power: support _noirq actions on device types and classes
The new-style dev_pm_ops provide callbacks for both IRQs enabled
and disabled. However, the _noirq variants were only called for
buses registered with a device, not for classes and types.
In order to properly use dev_pm_ops in class pcmcia_socket_class,
support _noirq actions also on classes and types.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index d477f4d..941fcb8 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -439,8 +439,23 @@ static int device_resume_noirq(struct device *dev, pm_message_t state)
if (dev->bus && dev->bus->pm) {
pm_dev_dbg(dev, state, "EARLY ");
error = pm_noirq_op(dev, dev->bus->pm, state);
+ if (error)
+ goto End;
}
+ if (dev->type && dev->type->pm) {
+ pm_dev_dbg(dev, state, "EARLY type ");
+ error = pm_noirq_op(dev, dev->type->pm, state);
+ if (error)
+ goto End;
+ }
+
+ if (dev->class && dev->class->pm) {
+ pm_dev_dbg(dev, state, "EARLY class ");
+ error = pm_noirq_op(dev, dev->class->pm, state);
+ }
+
+End:
TRACE_RESUME(error);
return error;
}
@@ -735,10 +750,26 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state)
{
int error = 0;
+ if (dev->class && dev->class->pm) {
+ pm_dev_dbg(dev, state, "LATE class ");
+ error = pm_noirq_op(dev, dev->class->pm, state);
+ if (error)
+ goto End;
+ }
+
+ if (dev->type && dev->type->pm) {
+ pm_dev_dbg(dev, state, "LATE type ");
+ error = pm_noirq_op(dev, dev->type->pm, state);
+ if (error)
+ goto End;
+ }
+
if (dev->bus && dev->bus->pm) {
pm_dev_dbg(dev, state, "LATE ");
error = pm_noirq_op(dev, dev->bus->pm, state);
}
+
+End:
return error;
}
next prev parent reply other threads:[~2010-03-15 20:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-15 15:50 dev_pm_ops and PCMCIA sockets Dominik Brodowski
2010-03-15 17:09 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1003151247470.1257-100000@iolanthe.rowland.org>
2010-03-15 17:27 ` Dominik Brodowski
2010-03-15 19:35 ` Rafael J. Wysocki
[not found] ` <201003152035.57927.rjw@sisk.pl>
2010-03-15 20:59 ` Dominik Brodowski [this message]
2010-03-15 21:44 ` [RFC PATCH] power: support _noirq actions on device types and classes Rafael J. Wysocki
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=20100315205903.GA7094@comet.dominikbrodowski.net \
--to=linux@dominikbrodowski.net \
--cc=linux-pcmcia@lists.infradead.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=rjw@sisk.pl \
--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