[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YRqvFVw1EJl+dnM+@google.com>
Date: Mon, 16 Aug 2021 11:31:49 -0700
From: Matthias Kaehlcke <mka@...omium.org>
To: Deepak Kumar Singh <deesin@...eaurora.org>
Cc: bjorn.andersson@...aro.org, swboyd@...omium.org,
clew@...eaurora.org, sibis@...eaurora.org,
linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-remoteproc@...r.kernel.org, Andy Gross <agross@...nel.org>
Subject: Re: [PATCH V2 1/1] soc: qcom: smp2p: Add wakeup capability to SMP2P
IRQ
On Mon, Aug 16, 2021 at 03:35:35PM +0530, Deepak Kumar Singh wrote:
> 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@...eaurora.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>
>
> /*
> * 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 */
> + ret = device_init_wakeup(&pdev->dev, true);
> + if (ret)
> + goto unwind_interfaces;
> +
> + ret = dev_pm_set_wake_irq(&pdev->dev, irq);
> + if (ret)
> + goto set_wakeup_failed;
>
> return 0;
>
> +set_wakeup_failed:
> + device_init_wakeup(&pdev->dev, false);
> +
I think you need to call dev_pm_clear_wake_irq() and
device_init_wakeup(..., false) in qcom_smp2p_remove()
to free all resources.
Powered by blists - more mailing lists