[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <da861885-998f-8e8d-52a0-6845189603ac@kernel.org>
Date: Wed, 23 Nov 2022 14:58:20 +0200
From: Roger Quadros <rogerq@...nel.org>
To: Georgi Vlaev <g-vlaev@...com>, Nishanth Menon <nm@...com>,
Tero Kristo <kristo@...nel.org>,
Santosh Shilimkar <ssantosh@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, Vibhore Vardhan <vibhore@...com>,
Vignesh Raghavendra <vigneshr@...com>
Subject: Re: [PATCH v4 5/5] firmware: ti_sci: Introduce prepare system suspend
call
Hi Georgi,
On 16/11/2022 20:13, Georgi Vlaev wrote:
> From: Dave Gerlach <d-gerlach@...com>
>
> Introduce a ti_sci_prepare_system_suspend call to be used in the driver
> suspend handler to allow the system to identify the low power mode being
> entered and if necessary, send TI_SCI_MSG_BEGIN_SLEEP with information
> about the mode is being entered and the address for allocated memory for
> storing the context during Deep Sleep.
>
> Signed-off-by: Dave Gerlach <d-gerlach@...com>
> Signed-off-by: Vibhore Vardhan <vibhore@...com>
> Signed-off-by: Georgi Vlaev <g-vlaev@...com>
> Tested-by: Roger Quadros <rogerq@...nel.org>
> ---
> drivers/firmware/ti_sci.c | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
> index fec4ef0ae4c3..3fad7209b722 100644
> --- a/drivers/firmware/ti_sci.c
> +++ b/drivers/firmware/ti_sci.c
> @@ -3510,9 +3510,39 @@ static void ti_sci_set_is_suspending(struct ti_sci_info *info, bool is_suspendin
> info->is_suspending = is_suspending;
> }
>
> +static int ti_sci_prepare_system_suspend(struct ti_sci_info *info)
> +{
> + int ret = 0;
> + int mode;
> +
> + switch (pm_suspend_target_state) {
lkp@...el reported the following error in some config which does not define pm_suspend_target_state
drivers/firmware/ti_sci.c: In function 'ti_sci_prepare_system_suspend':
>> drivers/firmware/ti_sci.c:3517:17: error: 'pm_suspend_target_state' undeclared (first use in this function)
3517 | switch (pm_suspend_target_state) {
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/firmware/ti_sci.c:3517:17: note: each undeclared identifier is reported only once for each function it appears in
config is attached
> + case PM_SUSPEND_MEM:
> + mode = TISCI_MSG_VALUE_SLEEP_MODE_DEEP_SLEEP;
> + break;
> + default:
> + ret = -EINVAL;
> + }
> +
> + /*
> + * Do not fail if we don't have action to take for a
> + * specific suspend mode.
> + */
> + if (ret)
> + return 0;
> +
> + return ti_sci_cmd_prepare_sleep(&info->handle, mode,
> + (u32)(info->ctx_mem_addr & 0xffffffff),
> + (u32)((u64)info->ctx_mem_addr >> 32), 0);
> +}
> +
> static int ti_sci_suspend(struct device *dev)
> {
> struct ti_sci_info *info = dev_get_drvdata(dev);
> + int ret;
> +
> + ret = ti_sci_prepare_system_suspend(info);
> + if (ret)
> + return ret;
> /*
> * We must switch operation to polled mode now as drivers and the genpd
> * layer may make late TI SCI calls to change clock and device states
View attachment "config" of type "text/plain" (176371 bytes)
Powered by blists - more mailing lists