Re: [PATCH/RFC 4/6] drivers: firmware: psci: Fix non-PMIC wake-up if SYSTEM_SUSPEND cuts power

From: Sudeep Holla
Date: Tue Feb 21 2017 - 05:50:24 EST




On 20/02/17 20:33, Geert Uytterhoeven wrote:
> Nothing in the PSCI specification requires the SoC to remain powered and
> to support wake-up sources when suspended using SYSTEM_SUSPEND.
> If the firmware implements the PSCI SYSTEM_SUSPEND operation by cutting
> power to the SoC, the only possibly wake-up sources are thus the ones
> connected to the PMIC.
>
> Document and add support for an "arm,psci-system-suspend-is-power-down"
> DT property, so Linux uses a different suspend method when other wake-up
> sources (e.g. wake on LAN, UART or GPIO) are enabled.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
> ---
> Documentation/devicetree/bindings/arm/psci.txt | 11 +++++++++++
> drivers/firmware/psci.c | 13 ++++++++++---
> 2 files changed, 21 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/arm/psci.txt b/Documentation/devicetree/bindings/arm/psci.txt
> index a2c4f1d524929bb7..16e390ecb7531028 100644
> --- a/Documentation/devicetree/bindings/arm/psci.txt
> +++ b/Documentation/devicetree/bindings/arm/psci.txt
> @@ -68,6 +68,17 @@ state nodes, as per bindings in [1]) must specify the following properties:
> Definition: power_state parameter to pass to the PSCI
> suspend call.
>
> + - arm,psci-system-suspend-is-power-down
> + Nothing in the PSCI specification requires the SoC to remain
> + powered and to support wake-up sources when suspended using
> + SYSTEM_SUSPEND.

Again, yes SoC can be powered down but you give no reasons why this is
useful other than help you to hack around to implement suspend_ops. As
suggested please try using freeze_ops.

After commit a94e502c22b6 ("cpuidle: dt: assign ->enter_freeze to same
as ->enter callback function"), you can enter suspend-to-idle(a.k.a
freeze state) on all platforms using ARM DT cpuidle driver.

--
Regards,
Sudeep