From: Stephen Boyd <swboyd@chromium.org>
To: Deepak Kumar Singh <deesin@codeaurora.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 V4 1/1] soc: qcom: smp2p: Add wakeup capability to SMP2P IRQ
Date: Mon, 20 Sep 2021 11:37:27 -0700 [thread overview]
Message-ID: <CAE-0n52Gqossa9V-tPLHsgggQ_MHt_zD7gzrjUVrU7Rno-4f8w@mail.gmail.com> (raw)
In-Reply-To: <1631991735-18920-1-git-send-email-deesin@codeaurora.org>
Quoting Deepak Kumar Singh (2021-09-18 12:02:15)
> diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c
> index 2df4883..60ad632 100644
> --- a/drivers/soc/qcom/smp2p.c
> +++ b/drivers/soc/qcom/smp2p.c
> @@ -14,6 +14,7 @@
> #include <linux/mfd/syscon.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> +#include <linux/pm_wakeirq.h>
> #include <linux/regmap.h>
> #include <linux/soc/qcom/smem.h>
> #include <linux/soc/qcom/smem_state.h>
> @@ -538,9 +539,26 @@ static int qcom_smp2p_probe(struct platform_device *pdev)
> goto unwind_interfaces;
> }
>
> + /*
> + * Treat smp2p interrupt as wakeup source, but keep it disabled
> + * by default. User space can decide enabling it depending on its
> + * use cases. For example if remoteproc crashes and device wants
> + * to handle it immediatedly (e.g. to not miss phone calls) it can
> + * enable wakeup source from user space, while other devices which
> + * do not have proper autosleep feature may want to handle it with
> + * other wakeup events (e.g. Power button) instead waking up immediately.
> + */
> + device_set_wakeup_capable(&pdev->dev, true);
> +
> + ret = dev_pm_set_wake_irq(&pdev->dev, irq);
> + if (ret)
> + goto set_wake_irq_fail;
>
> return 0;
>
> +set_wake_irq_fail:
> + dev_pm_clear_wake_irq(&pdev->dev);
> +
> unwind_interfaces:
> list_for_each_entry(entry, &smp2p->inbound, node)
> irq_domain_remove(entry->domain);
> @@ -565,6 +583,9 @@ static int qcom_smp2p_remove(struct platform_device *pdev)
> struct qcom_smp2p *smp2p = platform_get_drvdata(pdev);
> struct smp2p_entry *entry;
>
> + dev_pm_clear_wake_irq(&pdev->dev);
> + device_init_wakeup(&pdev->dev, false);
Is this device_init_wakeup() call necessary? It looks like we can get
away without it and then once this driver probes the device will have
the wakeup capability set on it. Future binding/unbinding of the driver
will keep working.
next prev parent reply other threads:[~2021-09-21 2:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-18 19:02 [PATCH V4 1/1] soc: qcom: smp2p: Add wakeup capability to SMP2P IRQ Deepak Kumar Singh
2021-09-20 18:37 ` Stephen Boyd [this message]
2021-09-21 10:28 ` Deepak Kumar Singh
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=CAE-0n52Gqossa9V-tPLHsgggQ_MHt_zD7gzrjUVrU7Rno-4f8w@mail.gmail.com \
--to=swboyd@chromium.org \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=clew@codeaurora.org \
--cc=deesin@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 \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).