From: Lan Tianyu <tianyu.lan@intel.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: stern@rowland.harvard.edu, linux-pm@vger.kernel.org,
linux-acpi@vger.kernel.org
Subject: Re: [PATCH] PM / Qos: Ensure device not in PRM_SUSPENDED when pm qos flags request functions are invoked in the pm core.
Date: Sun, 04 Nov 2012 23:09:32 +0800 [thread overview]
Message-ID: <5096852C.3000707@intel.com> (raw)
In-Reply-To: <3462113.4oKq44aJDs@vostro.rjw.lan>
On 2012/11/3 4:11, Rafael J. Wysocki wrote:
>>>> }
>>>> > >> EXPORT_SYMBOL_GPL(dev_pm_qos_expose_flags);
>>>> > >>@@ -645,7 +649,9 @@ void dev_pm_qos_hide_flags(struct device *dev)
>>>> > >> {
>>>> > >> if (dev->power.qos && dev->power.qos->flags_req) {
>>>> > >> pm_qos_sysfs_remove_flags(dev);
>>>> > >>+ pm_runtime_get_sync(dev);
>>>> > >> __dev_pm_qos_drop_user_request(dev, DEV_PM_QOS_FLAGS);
>>>> > >>+ pm_runtime_put(dev);
>>> > >
>>> > >I'm not sure if these two are necessary. If we remove a request,
>>> > >then what happens worst case is that some flags will be cleared
>>> > >effectively which means fewer restrictions on the next sleep state.
>>> > >Then, it shouldn't hurt that the current sleep state is more
>>> > >restricted.
>> >
>> >But this mean the device can be put into lower power state(power off).
>> >So why not do that? that can save more power, right?
> Correct. On the other hand, though, if the device already is in the
> deepest low-power state available, we will resume it unnecessarily this
> way. Which may not be a big deal, however, and since we do that in other
> cases, we may as well do it here.
Yeah. This seems not very reasonable. But we can optimize this
later.From my previous opinion, add notifier for flags and let device
driver or bus driver to determine when the device should be resumed.
Since you said at another email you would remove all notifiers in the pm
qos to make some functions able to be invoked in interrupt context. I
have a thought that check the context before call notifiers chain. If it
was in interrupt, not call notifier chain and trigger a work queue or
other choices to do that. If not, call the chain. Does this make sense? :)
>
> Thanks,
> Rafael
--
Best Regards
Tianyu Lan
linux kernel enabling team
next prev parent reply other threads:[~2012-11-04 15:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-02 8:03 [PATCH] PM / Qos: Ensure device not in PRM_SUSPENDED when pm qos flags request functions are invoked in the pm core Lan Tianyu
2012-11-02 11:17 ` Rafael J. Wysocki
2012-11-02 16:16 ` Lan Tianyu
2012-11-02 20:11 ` Rafael J. Wysocki
2012-11-04 15:09 ` Lan Tianyu [this message]
2012-11-11 12:08 ` Lan Tianyu
2012-11-11 14:43 ` 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=5096852C.3000707@intel.com \
--to=tianyu.lan@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).