All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Abhilash Kesavan <kesavan.abhilash@gmail.com>
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>,
	linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Kukjin Kim <kgene.kim@samsung.com>,
	Andrew Bresticker <abrestic@chromium.org>,
	Douglas Anderson <dianders@chromium.org>
Subject: Re: [PATCH v2] ARM: EXYNOS: Use MCPM call-backs to support S2R on Exynos5420
Date: Tue, 1 Jul 2014 14:50:37 +0100	[thread overview]
Message-ID: <20140701135037.GB7023@e102568-lin.cambridge.arm.com> (raw)
In-Reply-To: <CAM4voama9omO4=x2+GaQesLQOh+5U2q8FQSe4+VwA0_4pOukkg@mail.gmail.com>

On Tue, Jul 01, 2014 at 02:14:49PM +0100, Abhilash Kesavan wrote:
> Hi Nicolas,
> 
> On Tue, Jul 1, 2014 at 9:49 AM, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
> > On Mon, 30 Jun 2014, Abhilash Kesavan wrote:
> >
> >> Use the MCPM layer to handle core suspend/resume on Exynos5420.
> >> Also, restore the entry address setup code post-resume.
> >>
> >> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
> >> ---
> > [...]
> >
> > Could you tell me more about this?
> >
> >> @@ -150,7 +153,13 @@ static void exynos_power_down(void)
> >>       BUG_ON(__mcpm_cluster_state(cluster) != CLUSTER_UP);
> >>       cpu_use_count[cpu][cluster]--;
> >>       if (cpu_use_count[cpu][cluster] == 0) {
> >> -             exynos_cpu_power_down(cpunr);
> >> +             /*
> >> +              * Bypass power down for CPU0 during suspend. This is being
> >> +              * taken care by the SYS_PWR_CFG bit in CORE0_SYS_PWR_REG.
> >> +              */
> >> +             if ((cpunr != 0) ||
> >> +             (__raw_readl(pmu_base_addr + S5P_INFORM1) != S5P_CHECK_SLEEP))
> >> +                     exynos_cpu_power_down(cpunr);
> >
> > What happens if CPU0 is the first in the cluster to be idled?  Will it
> > remain powered up until all the others have gone idle too?
> This check is only for handling the S2R CPU0 case. In case of
> idle/switching the S5P_CHECK_SLEEP flag would not be set and hence
> there would be no change in behavior for them.
> During suspend, we enable the ARM_USE_STANDBY_WFI0 bit which tells the
> PMU when the CPU0 is ready to be suspended. This in conjunction with
> the sleep state core configuration (setting SYS_PWR_REG low) causes
> the CPU0 to go down. We should not write to the CPU0 power
> configuration register (exynos_cpu_power_down) along with this during
> suspend.

I think this should be part of a refactoring that includes the exynos MCPM
suspend call parameters. In particular, at the moment there is no code in
the back-end to detect if the last man should request core gating or cluster
gating (ie last man _always_ request cluster gating, that might not be what
we want), there is the residency value that can be also be used to imply a
S2R request (eg residency = ~0 ?).

The command sent must be implied by the state that is entered, not by
peeking at registers that should contain magic values, and that's true
not only for exynos but for all ARM platforms out there.

What I mean is: we can pass the requested state as a suspend parameter
and the power_down state machine will send the required command
accordingly.

It can be done using the residency value or by passing the power state "index"
as suspend parameter, the power down MCPM code will do a look-up and send
the respective command.

Thoughts appreciated.

Lorenzo

WARNING: multiple messages have this Message-ID (diff)
From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] ARM: EXYNOS: Use MCPM call-backs to support S2R on Exynos5420
Date: Tue, 1 Jul 2014 14:50:37 +0100	[thread overview]
Message-ID: <20140701135037.GB7023@e102568-lin.cambridge.arm.com> (raw)
In-Reply-To: <CAM4voama9omO4=x2+GaQesLQOh+5U2q8FQSe4+VwA0_4pOukkg@mail.gmail.com>

On Tue, Jul 01, 2014 at 02:14:49PM +0100, Abhilash Kesavan wrote:
> Hi Nicolas,
> 
> On Tue, Jul 1, 2014 at 9:49 AM, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
> > On Mon, 30 Jun 2014, Abhilash Kesavan wrote:
> >
> >> Use the MCPM layer to handle core suspend/resume on Exynos5420.
> >> Also, restore the entry address setup code post-resume.
> >>
> >> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
> >> ---
> > [...]
> >
> > Could you tell me more about this?
> >
> >> @@ -150,7 +153,13 @@ static void exynos_power_down(void)
> >>       BUG_ON(__mcpm_cluster_state(cluster) != CLUSTER_UP);
> >>       cpu_use_count[cpu][cluster]--;
> >>       if (cpu_use_count[cpu][cluster] == 0) {
> >> -             exynos_cpu_power_down(cpunr);
> >> +             /*
> >> +              * Bypass power down for CPU0 during suspend. This is being
> >> +              * taken care by the SYS_PWR_CFG bit in CORE0_SYS_PWR_REG.
> >> +              */
> >> +             if ((cpunr != 0) ||
> >> +             (__raw_readl(pmu_base_addr + S5P_INFORM1) != S5P_CHECK_SLEEP))
> >> +                     exynos_cpu_power_down(cpunr);
> >
> > What happens if CPU0 is the first in the cluster to be idled?  Will it
> > remain powered up until all the others have gone idle too?
> This check is only for handling the S2R CPU0 case. In case of
> idle/switching the S5P_CHECK_SLEEP flag would not be set and hence
> there would be no change in behavior for them.
> During suspend, we enable the ARM_USE_STANDBY_WFI0 bit which tells the
> PMU when the CPU0 is ready to be suspended. This in conjunction with
> the sleep state core configuration (setting SYS_PWR_REG low) causes
> the CPU0 to go down. We should not write to the CPU0 power
> configuration register (exynos_cpu_power_down) along with this during
> suspend.

I think this should be part of a refactoring that includes the exynos MCPM
suspend call parameters. In particular, at the moment there is no code in
the back-end to detect if the last man should request core gating or cluster
gating (ie last man _always_ request cluster gating, that might not be what
we want), there is the residency value that can be also be used to imply a
S2R request (eg residency = ~0 ?).

The command sent must be implied by the state that is entered, not by
peeking at registers that should contain magic values, and that's true
not only for exynos but for all ARM platforms out there.

What I mean is: we can pass the requested state as a suspend parameter
and the power_down state machine will send the required command
accordingly.

It can be done using the residency value or by passing the power state "index"
as suspend parameter, the power down MCPM code will do a look-up and send
the respective command.

Thoughts appreciated.

Lorenzo

  reply	other threads:[~2014-07-01 13:50 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 10:58 [PATCH] ARM: EXYNOS: Restore the entry address setup code post-resume Abhilash Kesavan
2014-06-26 10:58 ` Abhilash Kesavan
2014-06-26 12:25 ` Abhilash Kesavan
2014-06-26 12:25   ` Abhilash Kesavan
2014-06-26 14:35   ` Lorenzo Pieralisi
2014-06-26 14:35     ` Lorenzo Pieralisi
2014-06-26 14:53   ` Lorenzo Pieralisi
2014-06-26 14:53     ` Lorenzo Pieralisi
2014-06-26 20:06   ` Nicolas Pitre
2014-06-26 20:06     ` Nicolas Pitre
2014-06-27  1:49     ` Abhilash Kesavan
2014-06-27  1:49       ` Abhilash Kesavan
2014-06-30 18:28 ` [PATCH v2] ARM: EXYNOS: Use MCPM call-backs to support S2R on Exynos5420 Abhilash Kesavan
2014-06-30 18:28   ` Abhilash Kesavan
2014-07-01  4:19   ` Nicolas Pitre
2014-07-01  4:19     ` Nicolas Pitre
2014-07-01 13:14     ` Abhilash Kesavan
2014-07-01 13:14       ` Abhilash Kesavan
2014-07-01 13:50       ` Lorenzo Pieralisi [this message]
2014-07-01 13:50         ` Lorenzo Pieralisi
2014-07-01 20:02         ` Nicolas Pitre
2014-07-01 20:02           ` Nicolas Pitre
2014-07-02 14:59   ` [RFC PATCH v3] " Abhilash Kesavan
2014-07-02 14:59     ` Abhilash Kesavan
2014-07-03  5:02     ` [RFC PATCH v4] " Abhilash Kesavan
2014-07-03  5:02       ` Abhilash Kesavan
2014-07-03 13:29       ` Nicolas Pitre
2014-07-03 13:29         ` Nicolas Pitre
2014-07-03 14:46         ` Abhilash Kesavan
2014-07-03 14:46           ` Abhilash Kesavan
2014-07-03 14:46       ` [PATCH v5] " Abhilash Kesavan
2014-07-03 14:46         ` Abhilash Kesavan
2014-07-03 15:45         ` several messages Nicolas Pitre
2014-07-03 15:45           ` Nicolas Pitre
2014-07-03 16:19           ` Abhilash Kesavan
2014-07-03 16:19             ` Abhilash Kesavan
2014-07-03 19:00             ` Nicolas Pitre
2014-07-03 19:00               ` Nicolas Pitre
2014-07-03 20:00               ` Abhilash Kesavan
2014-07-03 20:00                 ` Abhilash Kesavan
2014-07-04  4:13                 ` Nicolas Pitre
2014-07-04  4:13                   ` Nicolas Pitre
2014-07-04 17:45                   ` Abhilash Kesavan
2014-07-04 17:45                     ` Abhilash Kesavan
2014-07-04 17:47         ` [PATCH v6] ARM: EXYNOS: Use MCPM call-backs to support S2R on Exynos5420 Abhilash Kesavan
2014-07-04 17:47           ` Abhilash Kesavan
2014-07-04 19:45           ` [PATCH v7] " Abhilash Kesavan
2014-07-04 19:45             ` Abhilash Kesavan
2014-07-04 21:00             ` Nicolas Pitre
2014-07-04 21:00               ` Nicolas Pitre
2014-07-04 21:21               ` Abhilash Kesavan
2014-07-04 21:21                 ` Abhilash Kesavan
2014-07-08 10:53                 ` Lorenzo Pieralisi
2014-07-08 10:53                   ` Lorenzo Pieralisi
2014-07-08 13:39                   ` Abhilash Kesavan
2014-07-08 13:39                     ` Abhilash Kesavan
2014-07-08 15:19                     ` Lorenzo Pieralisi
2014-07-08 15:19                       ` Lorenzo Pieralisi

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=20140701135037.GB7023@e102568-lin.cambridge.arm.com \
    --to=lorenzo.pieralisi@arm.com \
    --cc=abrestic@chromium.org \
    --cc=dianders@chromium.org \
    --cc=kesavan.abhilash@gmail.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=nicolas.pitre@linaro.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 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.