All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Raj Kumar <rajkumar278@hotmail.com>
Cc: linux-pm@lists.linux-foundation.org
Subject: Re: Questions about run time power management
Date: Wed, 28 Jul 2010 11:32:39 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1007281124100.1744-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <BLU102-W87DD2A0042EBCEDB9C141EBA80@phx.gbl>

On Wed, 28 Jul 2010, Raj Kumar wrote:

> Hi ALan,
> 
>  
> 
> 1) As you mentioned that -EBUSY code is appropriate, But if the
> 
> device started doing activities during that time then it is not appropriate
> 
> to check every time if device is idle.
> 
>  
> 
> Because if -EBUSY is returned, then workqueue thread will check again and again
> 
> that if the device is idle.
> 
>  
> 
>         if (notify)
>                 __pm_runtime_idle(dev);
> 
> 
> That is notify flag will be true. right?

Yes.  But the thread won't check again and again; it will check only
once.  Your runtime_idle callback will know that the device is busy,
and therefore it won't schedule another suspend on the workqueue.  Not 
until the device really becomes idle again.

> 2) The 2nd thing is use case of deep sleep state i.e. system suspend.
> 
>  
> 
> Suppose device is active and its run time status is active. Now when the system suspend 
> 
> happens, it will increment usage_counter of device in power management framework,
> 
>  
> 
> now at that time since clocks and power are enabled, So what will device do?

It will continue running normally until the driver's suspend callback
is invoked.

> My point is when system suspend comes to device and device is doing activities at that time,
> 
> if the device will ask run time power management to shut its clock off and make it suspended,
> 
>  
> 
> and then it respond to system suspend????

The _device_ doesn't do any of these things; the _driver_ does them.

During system suspend, the driver has to shut off the clock and suspend
the device.  It can't do these things by using runtime PM calls; it has
to do them some other way.

> Run time power management will not do at the time as its usage counter is already increased,
> 
>  
> 
> Right? so what about this use case when this kind of overlapping occurs?

Right.  During system suspend, the driver has to do its job without
using runtime PM.

Alan Stern

      reply	other threads:[~2010-07-28 15:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22 21:23 Questions about run time power management Raj Kumar
2010-07-23 14:26 ` Alan Stern
2010-07-24 14:26   ` Raj Kumar
2010-07-25 15:48     ` Alan Stern
2010-07-28 11:35       ` Raj Kumar
2010-07-28 15:32         ` Alan Stern [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=Pine.LNX.4.44L0.1007281124100.1744-100000@iolanthe.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=rajkumar278@hotmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.