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: Runtime power management during system resume
Date: Wed, 25 Aug 2010 10:51:16 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1008251046400.1601-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <BLU102-W296D98B5535DEC8A7A973EB840@phx.gbl>

On Wed, 25 Aug 2010, Raj Kumar wrote:

> But since during system suspend power_usage counter is incremented by 1 But if the device is active
> 
> means its state is RPM_ACTIVE, its power_usage counter is 1 in run time power management core.
> 
>  
> 
> when the system suspend happens, it will also increment the power_usage_counter by 1 during dpm_prepare
> 
>  
> 
> Now   the power_usage_counter is 2.
> 
>  
> 
> So when dpm_complete is invoked, it will decrement the power_usage_counter by 1 during dpm_complete.
> 
>  
> 
> So now when the drivers gets system suspend, its power_usage counter is still 1.
> 
>  
> 
> So what in this scenario, does the device decrements the power_usage counter itself?

Firstly, the _device_ can't change the power_usage counter.  Only the
_driver_ can.  You seem to keep forgetting this point; you need to keep
it straight:

		Driver != Device

Secondly, after the system suspend the power_usage counter has the same
value as it did before.  In your case the usage_counter was 1 before
the system suspend and it is 1 after the system suspend.  Whatever
routine was responsible for setting the counter to 1 originally will
also be responsible for decrementing the counter to 0 some time later.

Alan Stern

  reply	other threads:[~2010-08-25 14:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23 19:17 Runtime PM and the block layer Alan Stern
2010-08-23 19:53 ` Jens Axboe
2010-08-23 21:51   ` Alan Stern
2010-08-24 13:15     ` Runtime power management during system resume Raj Kumar
2010-08-24 14:30       ` Alan Stern
2010-08-24 15:17         ` Raj Kumar
2010-08-24 17:50           ` Alan Stern
2010-08-25 13:27           ` Raj Kumar
2010-08-25 14:51             ` Alan Stern [this message]
2010-08-26 13:40             ` Raj Kumar
2010-08-26 14:33               ` Alan Stern
2010-09-18 11:49               ` (no subject) Raj Kumar
2010-09-18 15:36                 ` your mail Alan Stern
2010-09-18 15:56                   ` Dominik Brodowski
2010-10-05 21:40                 ` Question about hibernation Raj Kumar
2010-10-05 22:43                   ` Rafael J. Wysocki
2010-08-24 13:38     ` Runtime PM and the block layer Jens Axboe
2010-08-24 14:42       ` Alan Stern
2010-08-24 17:09         ` Jens Axboe
2010-08-24 20:06           ` Alan Stern
2010-08-24 20:10             ` Jens Axboe
2010-08-24 21:09               ` Alan Stern
2010-09-27 15:22           ` Alan Stern
2010-08-30 16:32       ` Alan Stern

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.1008251046400.1601-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.