lkml.org 
[lkml]   [2021]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH V2 1/1] soc: qcom: smp2p: Add wakeup capability to SMP2P IRQ
Quoting Deepak Kumar Singh (2021-08-16 03:05:35)
> Remote susbsystems notify fatal crash throught smp2p interrupt.
> When modem/wifi crashes it can cause soc to come out of low power state
> and may not allow again to enter in low power state until crash is handled.
>
> Mark smp2p interrupt wakeup capable so that interrupt handler is executed
> and remote susbsystem crash can be handled in system resume path.
>
> Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
> ---
> drivers/soc/qcom/smp2p.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c
> index 2df4883..646848b 100644
> --- a/drivers/soc/qcom/smp2p.c
> +++ b/drivers/soc/qcom/smp2p.c
> @@ -18,6 +18,7 @@
> #include <linux/soc/qcom/smem.h>
> #include <linux/soc/qcom/smem_state.h>
> #include <linux/spinlock.h>
> +#include <linux/pm_wakeirq.h>

Please sort alphabetically by include name, 'p' before 's'.

>
> /*
> * The Shared Memory Point to Point (SMP2P) protocol facilitates communication
> @@ -538,9 +539,20 @@ static int qcom_smp2p_probe(struct platform_device *pdev)
> goto unwind_interfaces;
> }
>
> + /* Setup smp2p interrupt as wakeup source */

This comment is bad. Please don't reiterate what the code is doing.
Instead, write something like

/*
* Treat remoteproc crashes as wakeups by default so we handle
* them sooner rather than along with the next wakeup (e.g.
* power button). This avoids leaving the system in a shallower
* suspend power state if a remoteproc crashes during suspend,
* but requires userspace to actively suspend the device after
* handling the crash, or CONFIG_PM_AUTOSLEEP to be true.
*/

> + ret = device_init_wakeup(&pdev->dev, true);

I still wonder if it's better to leave this off by default and only
enable it if the kernel is using autosuspend (PM_AUTOSLEEP). Then
userspace is responsible to decide if it can handle the wakeup with the
screen off, reload the remoteproc, and go back to suspend if it isn't
using autosuspend.

> + if (ret)
> + goto unwind_interfaces;
> +

\
 
 \ /
  Last update: 2021-08-16 22:25    [W:0.130 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site