devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
To: Leo Yan <leo.yan-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Lorenzo Pieralisi
	<Lorenzo.Pieralisi-5wv7dgnIgG8@public.gmane.org>,
	Sudeep Holla <Sudeep.Holla-5wv7dgnIgG8@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Catalin Marinas <Catalin.Marinas-5wv7dgnIgG8@public.gmane.org>,
	Amit Daniel Kachhap
	<amit.daniel-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Jonghwa Lee
	<jonghwa3.lee-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Jisheng Zhang <jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH RFC 2/2] ARM64: psci: implement system suspend using PSCI v0.2 CPU SUSPEND
Date: Fri, 23 Jan 2015 10:58:18 +0000	[thread overview]
Message-ID: <20150123105818.GC23493@leverpostej> (raw)
In-Reply-To: <20150122143443.GA18425@leoy-linaro>

On Thu, Jan 22, 2015 at 02:34:43PM +0000, Leo Yan wrote:
> hi Lorenzo,
> 
> On Thu, Jan 22, 2015 at 12:08:50PM +0000, Lorenzo Pieralisi wrote:
> > On Thu, Jan 22, 2015 at 06:18:12AM +0000, Leo Yan wrote:
> > 
> > [...]
> > 
> > > How about unify the power states passing for cpu idle and suspend?
> > > 
> > > below is a example for dts which place all power state into psci
> > > entry, so that idle-states and system suspend both can reference
> > > the power state.
> > > 
> > > psci {
> > > 	compatible = "arm,psci-0.2";
> > > 	method = "smc";
> > > 
> > >         power_state {
> > >                 CPU_POWER_OFF: cpu_power_off {
> > >                         state = <0x00010000>;
> > >                 };
> > > 
> > >                 CLUSTER_POWER_OFF: cluster_power_off {
> > >                         state = <0x01010000>;
> > >                 };
> > > 
> > >                 SOC_SUSPEND: soc_suspend {
> > >                         state = <0x01010001>;
> > >                 };
> > >         };
> > > };
> > 
> > I do not see why this would help. We would end up with phandles to
> > the nodes above to get the parameter from idle-states, to me it
> > looks like churn honestly, I do not see where the improvement is.
> 
> My original thought is these power states actually are mainly used by
> the arm trusted firmware; in kernel, it only need maintain such power
> state ids and pass these power state to firmware according to the
> requirement from cpuidle or suspend flows.
> 
> For cpuidle and suspend, they only need to know the index which
> should use and simply pass this index to the function *cpu_suspend(idx)*
> will be enough. So finally we also can simplize the code to parse
> these power state.
> 
> Following upper idea, the dts can be written like this way:
> 
>         psci {
>         	compatible = "arm,psci-0.2";
>         	method = "smc";
> 
>                 power_state {
>                         CPU_POWER_OFF: cpu_power_off {
>                                 state = <0x00010000>;
>                         };
> 
>                         CLUSTER_POWER_OFF: cluster_power_off {
>                                 state = <0x01010000>;
>                         };
> 
>                         SOC_SUSPEND: soc_suspend {
>                                 state = <0x01010001>;
>                         };
>                 };
>         };

These are only glorified containers for single ID values, and all the
information which could potentially have been shared (e.g.
local-timer-stop) is not.

> 
> 	idle-states {
> 		entry-method = "arm,psci";
> 
> 		C1: cpu-power-down {
> 			compatible = "arm,idle-state";
> 			arm,psci-state-idx = 0;

This implicitly relies on the ordering of nodes above, which is not a
very good idea. As Lorenzo mentioned, we would have to use phandles to
explicitly refer to nodes in this matter.

So all that we've achieved here is replacing the raw state ID with an
indirection to the state ID, and haven't gained any uniformity across
idle and suspend states anyway.

I don't see the point in just indirecting in this manner unless some
additional information is shared.

Mark.

> 			entry-latency-us = <20>;
> 			exit-latency-us = <40>;
> 			min-residency-us = <80>;
> 		};
> 
> 		MP: cluster-power-down {
> 			compatible = "arm,idle-state";
> 			local-timer-stop;
> 			arm,psci-state-idx = 1;
> 			entry-latency-us = <50>;
> 			exit-latency-us = <100>;
> 			min-residency-us = <250>;
> 			wakeup-latency-us = <130>;
> 		};
>         };
> 
>         system-suspend {
>                 compatible = "arm,system-suspend";
>                 entry-method = "arm,psci";
>                 arm,psci-state-idx = 2;
>         };
> 
> Before i have not followed up the discussion tightly, so if i miss something
> introduce noise for this topic, sorry about that.
> 
> Thanks,
> Leo Yan
> 
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2015-01-23 10:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 11:35 [PATCH RFC 0/2] ARM: DT: add bindings for system suspend Sudeep Holla
     [not found] ` <1421840155-18990-1-git-send-email-sudeep.holla-5wv7dgnIgG8@public.gmane.org>
2015-01-21 11:35   ` [PATCH RFC 1/2] Documentation: arm: define DT " Sudeep Holla
     [not found]     ` <1421840155-18990-2-git-send-email-sudeep.holla-5wv7dgnIgG8@public.gmane.org>
2015-01-21 13:21       ` Jisheng Zhang
2015-01-21 13:35         ` Jisheng Zhang
2015-01-21 13:56           ` Lorenzo Pieralisi
     [not found]             ` <20150121135610.GA21950-7AyDDHkRsp3ZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2015-01-22  4:33               ` Jisheng Zhang
2015-01-22  6:29                 ` Jisheng Zhang
2015-01-22 11:59                   ` Lorenzo Pieralisi
2015-01-22 12:09                     ` Jisheng Zhang
2015-02-04 16:10       ` Mark Rutland
2015-02-05 13:28         ` Sudeep Holla
     [not found]           ` <54D37000.8000006-5wv7dgnIgG8@public.gmane.org>
2015-02-05 13:32             ` Mark Rutland
2015-02-05 13:49               ` Sudeep Holla
2015-01-21 11:35   ` [PATCH RFC 2/2] ARM64: psci: implement system suspend using PSCI v0.2 CPU SUSPEND Sudeep Holla
     [not found]     ` <1421840155-18990-3-git-send-email-sudeep.holla-5wv7dgnIgG8@public.gmane.org>
2015-01-22  6:18       ` Leo Yan
2015-01-22 12:08         ` Lorenzo Pieralisi
2015-01-22 14:34           ` Leo Yan
2015-01-23 10:58             ` Mark Rutland [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=20150123105818.GC23493@leverpostej \
    --to=mark.rutland-5wv7dgnigg8@public.gmane.org \
    --cc=Catalin.Marinas-5wv7dgnIgG8@public.gmane.org \
    --cc=Lorenzo.Pieralisi-5wv7dgnIgG8@public.gmane.org \
    --cc=Sudeep.Holla-5wv7dgnIgG8@public.gmane.org \
    --cc=amit.daniel-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jonghwa3.lee-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org \
    --cc=leo.yan-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).