Linux Remote Processor Subsystem development
 help / color / mirror / Atom feed
From: Bjorn Andersson <andersson@kernel.org>
To: Caleb Connolly <caleb.connolly@linaro.org>,
	Chris Lew <quic_clew@quicinc.com>
Cc: Andy Gross <agross@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-remoteproc@vger.kernel.org
Subject: Re: [PATCH] rpmsg: qcom: glink: support waking up on channel rx
Date: Wed, 18 Jan 2023 12:01:33 -0600	[thread overview]
Message-ID: <20230118180133.vdfjkoxjb3hhdkjk@builder.lan> (raw)
In-Reply-To: <20230117142414.983946-1-caleb.connolly@linaro.org>

On Tue, Jan 17, 2023 at 02:24:13PM +0000, Caleb Connolly wrote:
> Configure all channels as wakeup capable and report a wakeup event
> when data is received.
> 
> This allows userspace to "subscribe" to a particular channel where
> it is useful to wake up to process new data. The expected usecase
> is to allow for handling incoming SMS or phone calls where the only
> notification mechanism is via QRTR on the IPCRTR glink channel.
> 
> As this behaviour is likely undesirable for most users, this patch
> doesn't enable a wakeup_source for any channels by default.
> 

This looks reasonable to me.

One suggestion that came up as we discussed this problem (elsewhere) a
while ago was the idea of using EPOLLWAKEUP to control the wakeup source
on a per-socket basis.

Would that suite your userspace?

Regards,
Bjorn

> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
>  drivers/rpmsg/qcom_glink_native.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
> index 115c0a1eddb1..1a96a7ae23bb 100644
> --- a/drivers/rpmsg/qcom_glink_native.c
> +++ b/drivers/rpmsg/qcom_glink_native.c
> @@ -914,6 +914,9 @@ static int qcom_glink_rx_data(struct qcom_glink *glink, size_t avail)
>  		channel->buf = NULL;
>  
>  		qcom_glink_rx_done(glink, channel, intent);
> +
> +		pm_wakeup_ws_event(channel->ept.rpdev->dev.power.wakeup, 0,
> +				   true);
>  	}
>  
>  advance_rx:
> @@ -1510,6 +1513,17 @@ static int qcom_glink_rx_open(struct qcom_glink *glink, unsigned int rcid,
>  		if (ret)
>  			goto rcid_remove;
>  
> +		/*
> +		 * Declare all channels as wakeup capable, but don't enable
> +		 * waking up by default.
> +		 *
> +		 * Userspace may wish to be woken up for incoming messages on a
> +		 * specific channel, for example to handle incoming calls or SMS
> +		 * messages on the IPCRTR channel. This can be done be enabling
> +		 * the wakeup source via sysfs.
> +		 */
> +		device_set_wakeup_capable(&rpdev->dev, true);
> +
>  		channel->rpdev = rpdev;
>  	}
>  
> -- 
> 2.39.0
> 

  reply	other threads:[~2023-01-18 18:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 14:24 [PATCH] rpmsg: qcom: glink: support waking up on channel rx Caleb Connolly
2023-01-18 18:01 ` Bjorn Andersson [this message]
2023-05-27 18:36   ` Caleb Connolly

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=20230118180133.vdfjkoxjb3hhdkjk@builder.lan \
    --to=andersson@kernel.org \
    --cc=agross@kernel.org \
    --cc=caleb.connolly@linaro.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=phone-devel@vger.kernel.org \
    --cc=quic_clew@quicinc.com \
    /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