From: Magnus Damm <magnus.damm@gmail.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Alan Stern <stern@rowland.harvard.edu>, Greg KH <gregkh@suse.de>,
LKML <linux-kernel@vger.kernel.org>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Linux-pm mailing list <linux-pm@lists.linux-foundation.org>,
Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH update] PM: Introduce core framework for run-time PM of I/O devices (rev. 11)
Date: Mon, 3 Aug 2009 12:26:14 +0900 [thread overview]
Message-ID: <aec7e5c30908022026t2fa8f328s27424073c9ff560b@mail.gmail.com> (raw)
In-Reply-To: <200907312053.17914.rjw@sisk.pl>
Hi again Rafael,
On Sat, Aug 1, 2009 at 3:53 AM, Rafael J. Wysocki<rjw@sisk.pl> wrote:
> On Friday 31 July 2009, Magnus Damm wrote:
>> [Runtime PM v11]
>> > @@ -202,7 +203,9 @@ int driver_probe_device(struct device_dr
>> > pr_debug("bus: '%s': %s: matched device %s with driver %s\n",
>> > drv->bus->name, __func__, dev_name(dev), drv->name);
>> >
>> > + pm_runtime_get_noresume(dev);
>> > ret = really_probe(dev, drv);
>> > + pm_runtime_put_noidle(dev);
>> >
>> > return ret;
>> > }
>>
>> This creates problems when drivers want to performing runtime resume
>> from within probe(). For more details please have a look at "[PATCH
>> 04/04] video: Runtime PM hack for SuperH LCDC driver".
>
> Ah, I see. You'd like to call pm_runtime_get_sync() from .probe(), but that
> sees the usage counter different from zero and exits immediately.
Exactly.
> OTOH, I think we should prevent suspends from racing with .probe() at the core
> level. Hmm.
Doesn't it make more sense to allow runtime suspend and resume to
happen after the pm_runtime_enable() call? What case are you trying to
protect against?
> One possible approach could be to call pm_runtime_resume() from
> sh_mobile_lcdc_probe() instead of pm_runtime_put_noidle(). Then, the platform
> code will have a chance to turn the device on and the later pm_runtime_get*()
> and pm_runtime_put*() calls will be balanced. Of course, in that case the
> pm_runtime_get_noresume() in sh_mobile_lcdc_probe() won't be necessary any
> more. Am I overlooking anything?
So for drivers that want to access hardware from .probe(), calling
pm_runtime_resume() after pm_runtime_enable() in should be enough?
Thanks for your help!
/ magnus
next prev parent reply other threads:[~2009-08-03 3:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-22 15:01 [PATCH] PM: Introduce core framework for run-time PM of I/O devices (rev. 10) Rafael J. Wysocki
2009-07-22 19:10 ` [PATCH update] PM: Introduce core framework for run-time PM of I/O devices (rev. 11) Rafael J. Wysocki
2009-07-31 14:32 ` Magnus Damm
2009-07-31 18:53 ` Rafael J. Wysocki
2009-08-03 3:26 ` Magnus Damm [this message]
2009-08-03 15:15 ` 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=aec7e5c30908022026t2fa8f328s27424073c9ff560b@mail.gmail.com \
--to=magnus.damm@gmail.com \
--cc=gregkh@suse.de \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=pavel@ucw.cz \
--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
all inboxes | Powered by JetHome®