mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] rpmsg: glink: Avoid infinite loop on intent for missing channel
@ 2023-02-14 23:42 Bjorn Andersson
  2023-02-15  0:03 ` Chris Lew
  2023-02-15  4:30 ` Bjorn Andersson
  0 siblings, 2 replies; 3+ messages in thread
From: Bjorn Andersson @ 2023-02-14 23:42 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Mathieu Poirier,
	Sricharan R, Arun Kumar Neelakantam, Chris Lew
  Cc: linux-arm-msm, linux-remoteproc, linux-kernel

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>
---

Changes since v1:
- Don't drop packet if the following memory allocation fails.

 drivers/rpmsg/qcom_glink_native.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
index 89c3381f06c3..b6c60bf86009 100644
--- a/drivers/rpmsg/qcom_glink_native.c
+++ b/drivers/rpmsg/qcom_glink_native.c
@@ -966,6 +966,7 @@ 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");
+		qcom_glink_rx_advance(glink, ALIGN(msglen, 8));
 		return;
 	}
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] rpmsg: glink: Avoid infinite loop on intent for missing channel
  2023-02-14 23:42 [PATCH v2] rpmsg: glink: Avoid infinite loop on intent for missing channel Bjorn Andersson
@ 2023-02-15  0:03 ` Chris Lew
  2023-02-15  4:30 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Lew @ 2023-02-15  0:03 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Mathieu Poirier, Sricharan R, Arun Kumar Neelakantam
  Cc: linux-arm-msm, linux-remoteproc, linux-kernel



On 2/14/2023 3:42 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>

Reviewed-by: Chris Lew <quic_clew@quicinc.com>

> ---
> 
> Changes since v1:
> - Don't drop packet if the following memory allocation fails.
> 
>   drivers/rpmsg/qcom_glink_native.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
> index 89c3381f06c3..b6c60bf86009 100644
> --- a/drivers/rpmsg/qcom_glink_native.c
> +++ b/drivers/rpmsg/qcom_glink_native.c
> @@ -966,6 +966,7 @@ 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");
> +		qcom_glink_rx_advance(glink, ALIGN(msglen, 8));
>   		return;
>   	}
>   
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] rpmsg: glink: Avoid infinite loop on intent for missing channel
  2023-02-14 23:42 [PATCH v2] rpmsg: glink: Avoid infinite loop on intent for missing channel Bjorn Andersson
  2023-02-15  0:03 ` Chris Lew
@ 2023-02-15  4:30 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2023-02-15  4:30 UTC (permalink / raw)
  To: Arun Kumar Neelakantam, Andy Gross, Chris Lew, Mathieu Poirier,
	Bjorn Andersson, Sricharan R, Konrad Dybcio
  Cc: linux-arm-msm, linux-remoteproc, linux-kernel

On Tue, 14 Feb 2023 15:42:31 -0800, 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.
> 
> 

Applied, thanks!

[1/1] rpmsg: glink: Avoid infinite loop on intent for missing channel
      commit: 3e74ec2f39362bffbd42854acbb67c7f4cb808f9

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-15  4:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-14 23:42 [PATCH v2] rpmsg: glink: Avoid infinite loop on intent for missing channel Bjorn Andersson
2023-02-15  0:03 ` Chris Lew
2023-02-15  4:30 ` Bjorn Andersson

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®