mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Lew <quic_clew@quicinc.com>
To: Bjorn Andersson <quic_bjorande@quicinc.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Sricharan Ramabadhran <quic_srichara@quicinc.com>,
	Arun Kumar Neelakantam <quic_aneelaka@quicinc.com>,
	<linux-arm-msm@vger.kernel.org>,
	<linux-remoteproc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <quic_clew@quicinc.com>
Subject: Re: [PATCH] rpmsg: glink: Avoid infinite loop on intent for missing channel
Date: Tue, 14 Feb 2023 14:55:02 -0800	[thread overview]
Message-ID: <393b7d5f-b565-6287-bbab-3bf51cc981f0@quicinc.com> (raw)
In-Reply-To: <20230109223801.1706213-1-quic_bjorande@quicinc.com>

On 1/9/2023 2:38 PM, Bjorn Andersson wrote:
> In the event that an intent advertisement arrives on an unknown channel
> the fifo is not advanced, resulting in the same message being handled
> over and over.
> 
> Fixes: dacbb35e930f ("rpmsg: glink: Receive and store the remote intent buffers")
> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
> ---
>   drivers/rpmsg/qcom_glink_native.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
> index f36740cb6866..7b1320b1579e 100644
> --- a/drivers/rpmsg/qcom_glink_native.c
> +++ b/drivers/rpmsg/qcom_glink_native.c
> @@ -946,12 +946,12 @@ static void qcom_glink_handle_intent(struct qcom_glink *glink,
>   	spin_unlock_irqrestore(&glink->idr_lock, flags);
>   	if (!channel) {
>   		dev_err(glink->dev, "intents for non-existing channel\n");
> -		return;
> +		goto advance_rx;
>   	}
>   
>   	msg = kmalloc(msglen, GFP_ATOMIC);
>   	if (!msg)
> -		return;
> +		goto advance_rx;


Should we be dropping the packet for this case? If we try again later 
more memory might be available to handle the command.

>   
>   	qcom_glink_rx_peak(glink, msg, 0, msglen);
>   
> @@ -973,6 +973,7 @@ static void qcom_glink_handle_intent(struct qcom_glink *glink,
>   	}
>   
>   	kfree(msg);
> +advance_rx:
>   	qcom_glink_rx_advance(glink, ALIGN(msglen, 8));
>   }
>   
> 

  reply	other threads:[~2023-02-14 22:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 22:38 Bjorn Andersson
2023-02-14 22:55 ` Chris Lew [this message]
2023-02-14 23:34   ` 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=393b7d5f-b565-6287-bbab-3bf51cc981f0@quicinc.com \
    --to=quic_clew@quicinc.com \
    --cc=andersson@kernel.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=quic_aneelaka@quicinc.com \
    --cc=quic_bjorande@quicinc.com \
    --cc=quic_srichara@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

all inboxes | Powered by JetHome®