From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Alan Stern <stern@rowland.harvard.edu>,
Krzysztof Kozlowski <krzk@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PM / runtime: Document steps for device removal
Date: Tue, 15 Mar 2016 08:54:07 +0900 [thread overview]
Message-ID: <56E74F1F.1090103@samsung.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1603121153090.12240-100000@netrider.rowland.org>
On 13.03.2016 01:57, Alan Stern wrote:
> On Sat, 12 Mar 2016, Krzysztof Kozlowski wrote:
>
>> Put a reminder that during device removal drivers should revert all PM
>> runtime changes from the probe. Also add a note that
>> pm_runtime_disable() won't wait for pending suspend requests if
>> autosuspend is not disabled before.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
>> ---
>> Documentation/power/runtime_pm.txt | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
>> index 7328cf85236c..c05e5a17a52d 100644
>> --- a/Documentation/power/runtime_pm.txt
>> +++ b/Documentation/power/runtime_pm.txt
>> @@ -410,7 +410,8 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
>> field was previously zero, this prevents subsystem-level runtime PM
>> callbacks from being run for the device), make sure that all of the
>> pending runtime PM operations on the device are either completed or
>> - canceled; returns 1 if there was a resume request pending and it was
>> + canceled (although this depends on disabling autosuspend before
>> + calling this); returns 1 if there was a resume request pending and it was
>
> I don't agree with this change. All pending operations really are
> either completed or cancelled, even if autosuspend is enabled.
>
> Any strange behavior you saw after disabling runtime PM and then
> enabling it again was caused by new operations being started after you
> re-enabled runtime PM.
Hmmm, okay, I'll resend only with second part below.
Best regards,
Krzysztof
>
>> necessary to execute the subsystem-level resume callback for the device
>> to satisfy that request, otherwise 0 is returned
>>
>> @@ -586,6 +587,10 @@ drivers to make their ->remove() callbacks avoid races with runtime PM directly,
>> but also it allows of more flexibility in the handling of devices during the
>> removal of their drivers.
>>
>> +Drivers in ->remove() callback should undo the runtime PM changes done
>> +in ->probe(). Usually this means calling pm_runtime_disable(),
>> +pm_runtime_dont_use_autosuspend() etc.
>> +
>
> That's a good addition.
>
>> The user space can effectively disallow the driver of the device to power manage
>> it at run time by changing the value of its /sys/devices/.../power/control
>> attribute to "on", which causes pm_runtime_forbid() to be called. In principle,
>
> Alan Stern
>
>
>
prev parent reply other threads:[~2016-03-14 23:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-12 6:01 [PATCH] PM / runtime: Document steps for device removal Krzysztof Kozlowski
2016-03-12 16:57 ` Alan Stern
2016-03-14 23:54 ` Krzysztof Kozlowski [this message]
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=56E74F1F.1090103@samsung.com \
--to=k.kozlowski@samsung.com \
--cc=krzk@kernel.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
--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