linux-remoteproc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Deepak Kumar Singh <deesin@codeaurora.org>
Cc: clew@codeaurora.org, mathieu.poirier@linaro.org,
	linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Konstantin Dorfman <kdorfman@codeaurora.org>
Subject: Re: [PATCH V1 1/6] rpmsg: glink: fix destroy channel endpoint logic
Date: Fri, 15 Oct 2021 09:47:44 -0500	[thread overview]
Message-ID: <YWmUkD0ABryJEsU8@builder.lan> (raw)
In-Reply-To: <1596086296-28529-2-git-send-email-deesin@codeaurora.org>

On Thu 30 Jul 00:18 CDT 2020, Deepak Kumar Singh wrote:

> From: Konstantin Dorfman <kdorfman@codeaurora.org>
> 
> When rpmsg client driver destroys last channel endpoint, remove rpmsg
> device is triggered. In both cases (destroy endpoint and remove device)
> a glink close command sent to the remote peer.
> 
> This change, when for removing rpmsg device endpoint already destroyed
> will avoid sending second glink close command.
> 

Should it really be considered valid to rpmsg_destroy_ept() the
rpmsg_device's primary endpoint?

Do you have a use case where this makes sense?


Also, I think this has a potential to hide a problems of clients doing a
"double free" on the ept.

Regards,
Bjorn

> Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
> Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
> ---
>  drivers/rpmsg/qcom_glink_native.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
> index 1995f5b..2668c66 100644
> --- a/drivers/rpmsg/qcom_glink_native.c
> +++ b/drivers/rpmsg/qcom_glink_native.c
> @@ -1210,6 +1210,10 @@ static void qcom_glink_destroy_ept(struct rpmsg_endpoint *ept)
>  	unsigned long flags;
>  
>  	spin_lock_irqsave(&channel->recv_lock, flags);
> +	if (!channel->ept.cb) {
> +		spin_unlock_irqrestore(&channel->recv_lock, flags);
> +		return;
> +	}
>  	channel->ept.cb = NULL;
>  	spin_unlock_irqrestore(&channel->recv_lock, flags);
>  
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

  reply	other threads:[~2021-10-15 14:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30  5:18 [PATCH V1 0/6] Glink native fixes upstreaming Deepak Kumar Singh
2020-07-30  5:18 ` [PATCH V1 1/6] rpmsg: glink: fix destroy channel endpoint logic Deepak Kumar Singh
2021-10-15 14:47   ` Bjorn Andersson [this message]
2020-07-30  5:18 ` [PATCH V1 2/6] rpmsg: glink: Deny intent request if reusable intent fits Deepak Kumar Singh
2021-10-15 15:14   ` Bjorn Andersson
2020-07-30  5:18 ` [PATCH V1 3/6] rpmsg: glink: Add TX_DATA_CONT command while sending Deepak Kumar Singh
2021-10-15 17:22   ` (subset) " Bjorn Andersson
2020-07-30  5:18 ` [PATCH V1 4/6] rpmsg: glink: Remove the rpmsg dev in close_ack Deepak Kumar Singh
2021-10-15 17:22   ` (subset) " Bjorn Andersson
2020-07-30  5:18 ` [PATCH V1 5/6] rpmsg: glink: Remove channel decouple from rpdev release Deepak Kumar Singh
2021-10-15 17:22   ` (subset) " Bjorn Andersson
2020-07-30  5:18 ` [PATCH V1 6/6] rpmsg: glink: Send READ_NOTIFY command in FIFO full case Deepak Kumar Singh
2021-10-15 17:22   ` (subset) " Bjorn Andersson

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=YWmUkD0ABryJEsU8@builder.lan \
    --to=bjorn.andersson@linaro.org \
    --cc=clew@codeaurora.org \
    --cc=deesin@codeaurora.org \
    --cc=kdorfman@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 \
    /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).