LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Deepak Kumar Singh <deesin@codeaurora.org>
To: Stephen Boyd <swboyd@chromium.org>,
	bjorn.andersson@linaro.org, clew@codeaurora.org,
	sibis@codeaurora.org
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-remoteproc@vger.kernel.org, Andy Gross <agross@kernel.org>
Subject: Re: [PATCH V2 1/1] soc: qcom: smp2p: Add wakeup capability to SMP2P IRQ
Date: Mon, 13 Sep 2021 23:15:19 +0530	[thread overview]
Message-ID: <4697bec1-af58-53e4-9fd1-293bfd8754be@codeaurora.org> (raw)
In-Reply-To: <CAE-0n528DuP4MiAOhYY+Du+L=OZaGM5YJm=NwWia3JF7hp7sAA@mail.gmail.com>


On 8/17/2021 1:53 AM, Stephen Boyd wrote:
> 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.

Seems like not all targets use PM_AUTOSLEEP feature, even those targets 
may require wakeup to handle

modem crash so that important modem events are not missed. I think we 
can keep wake up as default behavior

and let the user space disable it through sysfs if it doesn't want it as 
wake up source.

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

  reply	other threads:[~2021-09-13 17:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 10:05 Deepak Kumar Singh
2021-08-16 18:31 ` Matthias Kaehlcke
2021-08-16 20:23 ` Stephen Boyd
2021-09-13 17:45   ` Deepak Kumar Singh [this message]
2021-09-13 19:42     ` Stephen Boyd

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=4697bec1-af58-53e4-9fd1-293bfd8754be@codeaurora.org \
    --to=deesin@codeaurora.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=clew@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=sibis@codeaurora.org \
    --cc=swboyd@chromium.org \
    --subject='Re: [PATCH V2 1/1] soc: qcom: smp2p: Add wakeup capability to SMP2P IRQ' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).