Linux Remote Processor Subsystem development
 help / color / mirror / Atom feed
From: Tanmay Shah <tanmay.shah@amd.com>
To: <jassisinghbrar@gmail.com>, <andersson@kernel.org>,
	<mathieu.poirier@linaro.org>
Cc: <linux-kernel@vger.kernel.org>,
	<linux-remoteproc@vger.kernel.org>,
	Tanmay Shah <tanmay.shah@amd.com>
Subject: [PATCH v2 2/2] remoteproc: xlnx: do not kick if mbox queue is full
Date: Tue, 7 Oct 2025 08:18:28 -0700	[thread overview]
Message-ID: <20251007151828.1527105-3-tanmay.shah@amd.com> (raw)
In-Reply-To: <20251007151828.1527105-1-tanmay.shah@amd.com>

If MBOX_TX_QUEUE_LEN number of kicks are pending, then no need to keep
doing more kicks because it will fail anyway. Preventing further kicks
is needed because it avoids printing false positive warning messages
from mailbox framework. Functionally nothing changes from RPMsg or
remoteproc point of view.

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
---

v2:
  - Use msg_slot_ro to know if single slot is available in msg queue or not.
 drivers/remoteproc/xlnx_r5_remoteproc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c
index 0b7b173d0d26..d589f31f45b9 100644
--- a/drivers/remoteproc/xlnx_r5_remoteproc.c
+++ b/drivers/remoteproc/xlnx_r5_remoteproc.c
@@ -9,6 +9,7 @@
 #include <linux/firmware/xlnx-zynqmp.h>
 #include <linux/kernel.h>
 #include <linux/mailbox_client.h>
+#include <linux/mailbox_controller.h>
 #include <linux/mailbox/zynqmp-ipi-message.h>
 #include <linux/module.h>
 #include <linux/of_address.h>
@@ -335,6 +336,10 @@ static void zynqmp_r5_rproc_kick(struct rproc *rproc, int vqid)
 	if (!ipi)
 		return;
 
+	/* Do not need new kick as already many kicks are pending. */
+	if (ipi->tx_chan->msg_slot_ro == 0)
+		return;
+
 	mb_msg = (struct zynqmp_ipi_message *)ipi->tx_mc_buf;
 	memcpy(mb_msg->data, &vqid, sizeof(vqid));
 	mb_msg->len = sizeof(vqid);
-- 
2.34.1


      parent reply	other threads:[~2025-10-07 15:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-07 15:18 [PATCH v2 0/2] mailbox queue length check Tanmay Shah
2025-10-07 15:18 ` [PATCH v2 1/2] mailbox: check mailbox queue is full or not Tanmay Shah
2025-10-07 19:58   ` Jassi Brar
2025-10-08 15:55     ` Tanmay Shah
2025-10-08 16:49     ` Tanmay Shah
2025-10-15 15:26       ` Tanmay Shah
2025-11-13 21:22         ` Tanmay Shah
2025-11-15 17:38         ` Jassi Brar
2025-11-18 18:51           ` Tanmay Shah
2025-12-04  2:13             ` Jassi Brar
2025-12-15 18:31               ` Tanmay Shah
2025-10-07 15:18 ` Tanmay Shah [this message]

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=20251007151828.1527105-3-tanmay.shah@amd.com \
    --to=tanmay.shah@amd.com \
    --cc=andersson@kernel.org \
    --cc=jassisinghbrar@gmail.com \
    --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