All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: "Shilimkar, Santosh" <santosh.shilimkar@ti.com>
Cc: Linux PM list <linux-pm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>, Len Brown <lenb@kernel.org>,
	Colin Cross <ccross@android.com>, Kevin Hilman <khilman@ti.com>,
	Magnus Damm <magnus.damm@gmail.com>,
	Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: [RFC][PATCH 2/2] PM / Domains: Add preliminary cpuidle support
Date: Sat, 12 May 2012 21:33:57 +0200	[thread overview]
Message-ID: <201205122133.58164.rjw@sisk.pl> (raw)
In-Reply-To: <CAMQu2gzYrzei7Li+m6o0JtiF9LUSDvpQT71KhgMafC_f_KxPJQ@mail.gmail.com>

On Saturday, May 12, 2012, Shilimkar, Santosh wrote:
> On Sat, May 12, 2012 at 12:29 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > On Friday, May 11, 2012, Santosh Shilimkar wrote:
> >> On Friday 11 May 2012 12:11 AM, Rafael J. Wysocki wrote:
> >> > On Thursday, May 10, 2012, Santosh Shilimkar wrote:
[...]
> Your case is bit special because CPU is also part of the same power
> domain as IO's. Since CPU is part of the root power domain along
> with peripherals, you want CPU to be the device to cut the power in
> the end(idle) and all the notifiers prepares the IO's for the 'cut
> power' which CPU can do in the cpuidle.

No, no notifiers, please, they are clearly suboptimal.

> And then on the reverse chain, notifier will help devices to restore
> the context so that can resume without any issues.

The idea here is to avoid using notifiers.
 
> Well if CPU is added as one more device along with other
> peripherals, you can still make it work at power domain framework
> level.

What exactly do you mean by "power domain framework level"?  My patch
is at the power domain framework level as far as I can say.

> This can be debated further but I think, we need an agreement
> on CPUIDLE exclusivity.

What do you mean by cpuidle exclusivity?  And what agreement?

> Based on your hardware, say the USB is doing a huge DMA transfer
> and CPU is not doing anything so it will hit idle thread and can idle.

Sure, it will.

> At least your CPU sub-domain can idle because it is quite independent
> even if you can't cut the power for whole domain.

That's correct.  The CPU sub-domain is beyond the scope of my patch.

> Even with your patchset its not possible to cut the power because one of the
> device in the domain is busy. There can be scenario, where say
> SPI is not used for thousands of CPU idle entry/exit so there
> is no need to worry about its context save/restore for every
> idle entry/exit.

The CPU idle state I'm referring to is not the only CPU idle state.
It is an extra state allowing the CPU to go to even deeper idle that usually
if all of the devices in its domain happen to be idle.

Quite obviously there are other idle states along this one that will be used
if this extra state is not enabled.

> The way I am looking at your issue is, every device in a power domain
> including CPU will decrement the powerdomain usecount.

The CPU will not do that, only devices.

> This can be handled through runtime PM.

But this patchset is a part of runtime PM!  What exactly do you mean?

> When they idle, they can save the context
> and the context can be restored only when next time they needs to be
> used. CPU can also decrements the usecount in the idle entry and then check
> whether the usecound of the common PD is zero.

This is not how it is supposed to work.

It doesn't make sense for cpuidle to even try to use the "domain" state if
it is known that some I/O devices in the domain aren't idle.  That's why
that state is disabled in my code whenever one (the first) of the I/O devices
is resumed.  It is then enabled when the last I/O device in the domain goes
idle (the states of all devices are saved at this point, to allow cpuidle to
use the "domain" state without worrying of the devices).

I'll post a new version of the $subject patch shortly, because I found that
the previous one wasn't correct.

Thanks,
Rafael

  reply	other threads:[~2012-05-12 19:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-09 21:40 [RFC][PATCH 0/2] PM / Domains / cpuidle: Preliminary cpuidle support for generic PM domains Rafael J. Wysocki
2012-05-09 21:41 ` [RFC][PATCH 1/2] PM / cpuidle: Add driver reference counter Rafael J. Wysocki
2012-05-09 21:43 ` [RFC][PATCH 2/2] PM / Domains: Add preliminary cpuidle support Rafael J. Wysocki
2012-05-10 10:10   ` Santosh Shilimkar
2012-05-10 18:41     ` Rafael J. Wysocki
2012-05-11  8:23       ` Santosh Shilimkar
2012-05-11  8:35         ` Magnus Damm
2012-05-11 18:59         ` Rafael J. Wysocki
2012-05-12  6:32           ` Shilimkar, Santosh
2012-05-12 19:33             ` Rafael J. Wysocki [this message]
2012-05-14  6:14               ` Shilimkar, Santosh
2012-05-12 19:40   ` [Update][RFC][PATCH " Rafael J. Wysocki
2012-05-16 20:29     ` [Update 2x][RFC][PATCH " Rafael J. Wysocki
2012-05-23 22:23       ` Kevin Hilman
2012-05-24 16:17         ` Rafael J. Wysocki
2012-05-24 23:59           ` Kevin Hilman
2012-05-28 21:50             ` [Update 3x][PATCH 2/2] PM / Domains: Add preliminary support for cpuidle Rafael J. Wysocki
2012-05-30 22:18               ` Kevin Hilman
2012-05-31 19:02                 ` 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=201205122133.58164.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=arjan@linux.intel.com \
    --cc=ccross@android.com \
    --cc=khilman@ti.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=santosh.shilimkar@ti.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.