Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Will Deacon <will@kernel.org>
Cc: mark.rutland@arm.com, wangzhe59@huawei.com,
	Catalin Marinas <catalin.marinas@arm.com>,
	huawei.libin@huawei.com, guohanjun@huawei.com,
	Xiongfeng Wang <wangxiongfeng2@huawei.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [Question] About handling PMU context loss in the deepest idle state where the core is powered down
Date: Thu, 9 Jan 2020 16:46:55 +0000	[thread overview]
Message-ID: <20200109164655.GA29943@e121166-lin.cambridge.arm.com> (raw)
In-Reply-To: <20200109150318.GF12236@willie-the-truck>

On Thu, Jan 09, 2020 at 03:03:19PM +0000, Will Deacon wrote:
> [+Lorenzo]
> 
> On Thu, Jan 09, 2020 at 10:43:40AM +0800, Xiongfeng Wang wrote:
> > Sorry to bother you. It's just that we have come across some problems
> > about PMU recently.
> 
> No bother, and thanks for including the mailing list.
> 
> > We are working on deep power state on CPU cores. In the deepest idle
> > state, the core will be powered down. In our implementation, the PMU
> > and the core are in the same power domain, so the PMU will also be
> > powered down. But I didn't find where we saved the PMU context in
> > kernel before entering the deepest idle state.
> > 
> > Before we enter the system sleep state, we update the kernel PMU
> > counter and stop the PMU in 'cpu_pm_pmu_notify()'. But we didn't do
> > that before we enter idle state.

ACPI or DT firmware ? I suspect that's ACPI, with LPI idle state
flags set to 0x0 (3.1.3 - save and restore flags):

http://infocenter.arm.com/help/topic/com.arm.doc.den0048a/DEN0048A_ARM_FFH_Specification.pdf

If that's the case a firmware update is needed (ie currently the kernel
expects the PMU state to be retained).

arch/arm64/kernel/cpuidle.c

ARM64_LPI_IS_RETENTION_STATE()

In DT in the PSCI CPUidle driver we run the notifiers irrespective
of the idle state depth so I don't think this behaviour can happen
in a DT bootstrapped system.

I am just guessing - please let me know if my assumption is correct.

> > I only find some system registers saving in 'psci_cpu_suspend_enter()->cpu_susend()->cpu_do_suspend()'
> 
> I'm not sure what you mean by "system sleep state"

I think they mean suspend-to-RAM - in suspend-to-RAM the notifiers
are run through syscore operations which are decoupled from CPUidle.

Regardless, CPUidle should call the notifiers if instructed by firmware
correctly.

Thanks,
Lorenzo

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-01-09 16:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09  2:43 [Question] About handling PMU context loss in the deepest idle state where the core is powered down Xiongfeng Wang
2020-01-09 15:03 ` Will Deacon
2020-01-09 16:46   ` Lorenzo Pieralisi [this message]
2020-01-10  3:28     ` Xiongfeng Wang
2020-01-10  3:45   ` Xiongfeng Wang

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=20200109164655.GA29943@e121166-lin.cambridge.arm.com \
    --to=lorenzo.pieralisi@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=guohanjun@huawei.com \
    --cc=huawei.libin@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=wangxiongfeng2@huawei.com \
    --cc=wangzhe59@huawei.com \
    --cc=will@kernel.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