public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Kenneth Heitke <kheitke@codeaurora.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-pm@lists.linux-foundation.org
Subject: Re: Question about expected behavior when PM runtime is disabled
Date: Mon, 13 Jun 2011 12:42:18 -0600	[thread overview]
Message-ID: <4DF65A0A.5030309@codeaurora.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1106111204500.3439-100000@netrider.rowland.org>

Alan,

Thanks for taking the time to answer my questions.  See inline for 
additional comments.


On 06/11/2011 10:12 AM, Alan Stern wrote:
> On Fri, 10 Jun 2011, Kenneth Heitke wrote:
>
>> Hi Rafael,
>>
>> Sorry if this question has been raised before.  I actually have two
>> questions here.  These questions are related to PM runtime being
>> disabled at runtime (i.e. call to pm_runtime_disable() )
>>
>> If I call pm_runtime_enabled() to first determine if PM runtime is
>> enabled followed conditionally by a call to pm_runtime_get_sync(), it
>> would be possible for PM runtime to be disabled between these two calls
>> and the get_sync() will fail.  Is there any reason to even use the
>> enabled() call?
>
> As a general rule, a device won't be enabled or disabled for runtime PM
> unless its driver or subsystem enables or disables it.  Since you
> should already know what the driver and subsystem are doing, there
> usually isn't any reason for using pm_runtime_enabled().
>
>>   My goal here was to use the enabled() call to determine
>> if PM runtime was configured/enabled in the kernel and then to manage my
>> resources, clocks etc, in a different way if PM runtime is not present.
>
> If runtime PM isn't present, why do you want to manage your clocks etc.
> at all?  The fact that it's not in the kernel means the system manager
> doesn't care about power usage.

I am trying to be backwards compatible.  There is likely a period of 
time from when the runtime PM feature was added to when it was turned on 
by default.  If the feature happens to be disabled, I think it makes 
sense for the driver to still do what it can to manage its resources. 
The power guys aren't going to let me off the hook that easily :)

  >> My second question then is what if PM runtime is enabled in the kernel
>> and then gets disabled at runtime.  What is the expected behavior for a
>> driver?  Should it fail all requests with EGAIN until PM runtime is
>> enabled again? (in suspend state, PM runtime gets disable, new i/o
>> request is made, power and clocks need to be turned on).
>
> It's up to the driver and the subsystem, since they are the entities
> that are responsible for disabling runtime PM.  If you think disabling
> runtime PM will cause problems, then don't do it.

I'm thinking about within runtime PM itself.  I believe during system 
suspend, disable() followed by enable() can be called.  If that happens, 
are there any scenarios that I need to be concerned about?  Can my 
autosuspend timer just happen to fire during that window between disable 
and enable resulting in a failure to suspend?  My driver is part of the 
i2c subsystem, do I know for a fact that disable() won't be used?

>
>> What about delayed autosuspend?  I believe that if PM runtime is
>> disabled while there is a delayed autosuspend pending, the suspend will
>> fail without notification (clocks and power will be left on).
>
> That's right.
>
>>   Will PM
>> runtime still be in the idle state once PM runtime is re-enabled?
>
> The device will be in the same state as it was when it was disabled,
> unless you explicitly call pm_runtime_set_active() or
> pm_runtime_set_suspended().
>
> Alan Stern
>
>

thanks,
Ken


-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  reply	other threads:[~2011-06-13 18:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-10 22:54 Question about expected behavior when PM runtime is disabled Kenneth Heitke
2011-06-11 16:12 ` Alan Stern
2011-06-13 18:42   ` Kenneth Heitke [this message]
2011-06-13 19:28     ` Alan Stern
2011-06-13 19:51       ` Rafael J. Wysocki
2011-06-13 20:33         ` Alan Stern
2011-06-13 21:20           ` Rafael J. Wysocki
2011-06-14 13:47             ` Alan Stern
2011-06-14 20:01               ` Rafael J. Wysocki
2011-06-17 15:08                 ` Alan Stern
2011-06-17 19:29                   ` Rafael J. Wysocki
2011-06-20 23:21                     ` Kevin Hilman
2011-06-20 23:27                       ` 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=4DF65A0A.5030309@codeaurora.org \
    --to=kheitke@codeaurora.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --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