linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <mka@chromium.org>
To: Deepak Kumar Singh <deesin@codeaurora.org>
Cc: bjorn.andersson@linaro.org, swboyd@chromium.org,
	clew@codeaurora.org, mathieu.poirier@linaro.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-remoteproc@vger.kernel.org, Andy Gross <agross@kernel.org>,
	Ohad Ben-Cohen <ohad@wizery.com>
Subject: Re: [PATCH V1 2/3] rpmsg: glink: Add support to handle signals command
Date: Wed, 24 Nov 2021 11:17:59 -0800	[thread overview]
Message-ID: <YZ6P56yRP9TAtcqa@google.com> (raw)
In-Reply-To: <1633015924-881-4-git-send-email-deesin@codeaurora.org>

On Thu, Sep 30, 2021 at 09:02:03PM +0530, Deepak Kumar Singh wrote:
> Remote peripherals send signal notifications over glink with commandID 15.
> 
> Add support to send and receive the signal command and convert the signals
> from NATIVE to TIOCM while receiving and vice versa while sending.
> 
> Signed-off-by: Chris Lew <clew@codeaurora.org>
> Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
> ---
>  drivers/rpmsg/qcom_glink_native.c | 75 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 75 insertions(+)
> 
> diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
> index 05533c7..384fcd2 100644
> --- a/drivers/rpmsg/qcom_glink_native.c
> +++ b/drivers/rpmsg/qcom_glink_native.c
>
> ...
>
> +static int qcom_glink_handle_signals(struct qcom_glink *glink,
> +				     unsigned int rcid, unsigned int sigs)
> +{
> +	struct glink_channel *channel;
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(&glink->idr_lock, flags);
> +	channel = idr_find(&glink->rcids, rcid);
> +	spin_unlock_irqrestore(&glink->idr_lock, flags);
> +	if (!channel) {
> +		dev_err(glink->dev, "signal for non-existing channel\n");
> +		return -EINVAL;
> +	}
> +
> +	/* convert signals from NATIVE to TIOCM */
> +	if (sigs & NATIVE_DTR_SIG)
> +		sigs |= TIOCM_DSR;
> +	if (sigs & NATIVE_CTS_SIG)
> +		sigs |= TIOCM_CTS;
> +	if (sigs & NATIVE_CD_SIG)
> +		sigs |= TIOCM_CD;
> +	if (sigs & NATIVE_RI_SIG)
> +		sigs |= TIOCM_RI;
> +	sigs &= 0x0fff;

'sigs' is only used when the channel has a signal handler, hence you could
return before the above block if there is no signal handler and remove the
condition below.

> +
> +	if (channel->ept.sig_cb)
> +		channel->ept.sig_cb(channel->ept.rpdev, channel->ept.priv, sigs);
> +
> +	return 0;
> +}

  parent reply	other threads:[~2021-11-24 19:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30 15:32 [PATCH V1 0/3] rpmsg and glink signaling api support Deepak Kumar Singh
2021-09-30 15:32 ` [PATCH V1 1/3] rpmsg: core: Add signal API support Deepak Kumar Singh
2021-09-30 16:22   ` Stephen Boyd
2021-10-11 18:02   ` Mathieu Poirier
2021-10-16  5:01     ` Bjorn Andersson
2021-10-18  9:00       ` Arnaud POULIQUEN
2021-10-19  2:48         ` Bjorn Andersson
2021-10-18 17:52       ` Mathieu Poirier
2021-10-19  3:05         ` Bjorn Andersson
2021-10-21 17:51           ` Mathieu Poirier
2021-11-06 13:45   ` kernel test robot
2021-11-10  6:23   ` kernel test robot
2021-09-30 15:32 ` [PATCH 1/1] soc: qcom: smp2p: add feature negotiation and ssr ack feature support Deepak Kumar Singh
2021-09-30 15:44   ` Deepak Kumar Singh
2021-09-30 15:32 ` [PATCH V1 2/3] rpmsg: glink: Add support to handle signals command Deepak Kumar Singh
2021-09-30 16:33   ` Stephen Boyd
2021-11-24 19:17   ` Matthias Kaehlcke [this message]
2021-09-30 15:32 ` [PATCH V1 3/3] rpmsg: char: Add TIOCMGET/TIOCMSET ioctl support Deepak Kumar Singh
2021-09-30 16:36   ` Stephen Boyd
2021-10-11 18:22   ` Mathieu Poirier
2021-10-08 17:54 ` [PATCH V1 0/3] rpmsg and glink signaling api support Mathieu Poirier

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=YZ6P56yRP9TAtcqa@google.com \
    --to=mka@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=mathieu.poirier@linaro.org \
    --cc=ohad@wizery.com \
    --cc=swboyd@chromium.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).