From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Magnus Damm <magnus.damm@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>, Greg KH <gregkh@suse.de>,
Pavel Machek <pavel@ucw.cz>, Len Brown <lenb@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
"Linux-pm mailing list" <linux-pm@lists.linux-foundation.org>
Subject: Re: [PATCH update] PM: Introduce core framework for run-time PM of I/O devices (rev. 15)
Date: Wed, 12 Aug 2009 22:13:14 +0200 [thread overview]
Message-ID: <200908122213.14174.rjw@sisk.pl> (raw)
In-Reply-To: <aec7e5c30908120337g2928b825m1a17a311a0756305@mail.gmail.com>
On Wednesday 12 August 2009, Magnus Damm wrote:
> Hi Rafael,
Hi,
> On Mon, Aug 10, 2009 at 6:13 AM, Rafael J. Wysocki<rjw@sisk.pl> wrote:
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> > Subject: PM: Introduce core framework for run-time PM of I/O devices (rev. 15)
> >
> > Introduce a core framework for run-time power management of I/O
> > devices. Add device run-time PM fields to 'struct dev_pm_info'
> > and device run-time PM callbacks to 'struct dev_pm_ops'. Introduce
> > a run-time PM workqueue and define some device run-time PM helper
> > functions at the core level. Document all these things.
> >
> > Special thanks to Alan Stern for his help with the design and
> > multiple detailed reviews of the pereceding versions of this patch
> > and to Magnus Damm for testing feedback.
> >
> > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
>
> Looking good! I have a few nitpicks below, but from a functional
> perspective it's all good. I've tested v15 with platform device
> drivers for I2C, UIO and framebuffer. Before adding my "Acked-by" I
> also want to test the V4L capture driver, but I need to wait a few
> days until I can get my hands on such a hardware platform.
>
> Thanks for folding in and fixing up the debug patch. I was able to
> drop most remaining patches thanks to feedback from Alan. So the only
> needed patch apart from this one (and the ones in your linux-next
> branch) is the one in this micro-series: "PM: Runtime PM v15 for
> Platform Devices 20090812".
>
> > --- linux-2.6.orig/include/linux/pm.h
> > +++ linux-2.6/include/linux/pm.h
> [..]
> > struct dev_pm_info {
> > pm_message_t power_state;
> > - unsigned can_wakeup:1;
> > - unsigned should_wakeup:1;
> > + unsigned int can_wakeup:1;
> > + unsigned int should_wakeup:1;
> > enum dpm_state status; /* Owned by the PM core */
> > -#ifdef CONFIG_PM_SLEEP
> > +#ifdef CONFIG_PM_SLEEP
> > struct list_head entry;
> > #endif
> > +#ifdef CONFIG_PM_RUNTIME
> > + struct timer_list suspend_timer;
> > + unsigned long timer_expires;
> > + struct work_struct work;
> > + wait_queue_head_t wait_queue;
> > + spinlock_t lock;
> > + atomic_t usage_count;
> > + atomic_t child_count;
>
> I suppose child_count has to be atomic?
I'd say so, it's modified in a few places without locking.
> > --- /dev/null
> > +++ linux-2.6/drivers/base/power/runtime.c
> [...]
> > +int __pm_runtime_suspend(struct device *dev, bool from_wq)
> > + __releases(&dev->power.lock) __acquires(&dev->power.lock)
> [...]
> > + if (dev->bus && dev->bus->pm && dev->bus->pm->runtime_suspend) {
> > + spin_unlock_irq(&dev->power.lock);
> > +
> > + retval = dev->bus->pm->runtime_suspend(dev);
> > +
> > + spin_lock_irq(&dev->power.lock);
> > + dev->power.runtime_error = retval;
> > + } else {
> > + retval = -ENOSYS;
> > + }
>
> Nit: { and } above do not follow the regular coding style.
Well, you've got a very good answer to this from Alan. ;-)
Thanks,
Rafael
next prev parent reply other threads:[~2009-08-12 20:12 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-08 14:25 [PATCH] PM: Introduce core framework for run-time PM of I/O devices (rev. 14) Rafael J. Wysocki
2009-08-09 21:13 ` [PATCH update] PM: Introduce core framework for run-time PM of I/O devices (rev. 15) Rafael J. Wysocki
2009-08-12 10:37 ` Magnus Damm
2009-08-12 15:47 ` Alan Stern
2009-08-12 20:13 ` Rafael J. Wysocki [this message]
2009-08-13 0:29 ` [RFC] PCI: Runtime power management Matthew Garrett
2009-08-13 0:35 ` [RFC] usb: Add support for runtime power management of the hcd Matthew Garrett
2009-08-13 12:16 ` [linux-pm] " Oliver Neukum
2009-08-13 12:30 ` Matthew Garrett
2009-08-13 14:26 ` Oliver Neukum
2009-08-13 21:42 ` Matthew Garrett
2009-08-13 15:22 ` Alan Stern
2009-08-13 21:47 ` Matthew Garrett
2009-08-13 15:17 ` [RFC] PCI: Runtime power management Alan Stern
2009-08-13 21:47 ` Matthew Garrett
2009-08-14 12:30 ` [linux-pm] " Matthew Garrett
2009-08-14 14:43 ` Alan Stern
2009-08-14 17:05 ` Rafael J. Wysocki
2009-08-14 17:13 ` Rafael J. Wysocki
2009-08-14 19:01 ` Alan Stern
2009-08-14 20:05 ` Rafael J. Wysocki
2009-08-14 22:21 ` Matthew Garrett
2009-08-15 14:18 ` Rafael J. Wysocki
2009-08-15 15:53 ` Alan Stern
2009-08-15 20:54 ` Rafael J. Wysocki
2009-08-15 20:58 ` Matthew Garrett
2009-08-15 21:21 ` Rafael J. Wysocki
2009-08-15 21:27 ` Matthew Garrett
2009-08-15 21:44 ` Rafael J. Wysocki
2009-08-16 16:09 ` Alan Stern
2009-08-16 15:57 ` Alan Stern
2009-08-16 16:04 ` Matthew Garrett
2009-08-16 15:50 ` Alan Stern
2009-08-14 17:37 ` Jesse Barnes
2009-08-14 19:15 ` Rafael J. Wysocki
2009-08-14 21:22 ` Rafael J. Wysocki
2009-08-14 22:30 ` Matthew Garrett
2009-08-15 14:41 ` Rafael J. Wysocki
2009-08-15 15:24 ` Rafael J. Wysocki
2009-08-13 20:56 ` [PATCH update 2x] PM: Introduce core framework for run-time PM of I/O devices (rev. 16) Rafael J. Wysocki
2009-08-13 21:03 ` Paul Mundt
2009-08-13 21:14 ` Rafael J. Wysocki
2009-08-14 9:08 ` Magnus Damm
2009-08-14 17:19 ` Rafael J. Wysocki
2009-08-14 17:25 ` [PATCH update 3x] PM: Introduce core framework for run-time PM of I/O devices (rev. 17) 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=200908122213.14174.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=gregkh@suse.de \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=magnus.damm@gmail.com \
--cc=pavel@ucw.cz \
--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
all inboxes | Powered by JetHome®