From: Beleswar Padhi <b-padhi@ti.com>
To: <jassisinghbrar@gmail.com>, <linux-kernel@vger.kernel.org>
Cc: <afd@ti.com>, <u-kumar1@ti.com>, <nm@ti.com>, <vigneshr@ti.com>,
<b-padhi@ti.com>
Subject: [PATCH 1/2] mailbox: ti-msgmgr: Do not report rx poll timeout as a send failure
Date: Wed, 30 Sep 2026 01:31:58 +0530 [thread overview]
Message-ID: <20260929200159.4033010-2-b-padhi@ti.com> (raw)
In-Reply-To: <20260929200159.4033010-1-b-padhi@ti.com>
In polled rx mode, used from system suspend until resume,
ti_msgmgr_send_data() writes the message to the tx queue and then
waits for the response. If no response arrives in time it returns
the poll error.
The mailbox core treats a ->send_data() error as a send failure.
So, it leaves the message queued without making it the active request,
and mbox_send_message() still returns success. The message is then
submitted again on the next tx_tick() or mbox_send_message(), after the
client has probably timed out and moved on. So, the firmware receives
the same message twice, and later requests are sent late and can have
responses matched to the wrong request.
The message has already been transmitted at this point, so return 0
and only log the missing response. The client detects this case with
its own response timeout anyways.
Signed-off-by: Beleswar Padhi <b-padhi@ti.com>
---
drivers/mailbox/ti-msgmgr.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/drivers/mailbox/ti-msgmgr.c b/drivers/mailbox/ti-msgmgr.c
index 8eb8df8d95a4c..425d5f9d9d0e3 100644
--- a/drivers/mailbox/ti-msgmgr.c
+++ b/drivers/mailbox/ti-msgmgr.c
@@ -445,12 +445,24 @@ static int ti_msgmgr_send_data(struct mbox_chan *chan, void *data)
data_reg += sizeof(u32);
}
- /* If we are in polled mode, wait for a response before proceeding */
- if (ti_msgmgr_chan_has_polled_queue_rx(message->chan_rx))
+ /*
+ * If we are in polled mode, wait for a response before proceeding.
+ *
+ * The message has already been transmitted at this point, so do not
+ * report a missing response as a send failure. Doing so would make
+ * the mailbox core keep the message queued and submit it again later,
+ * after the client has possibly given up on it. The client detects the
+ * missing response by itself timing out.
+ */
+ if (ti_msgmgr_chan_has_polled_queue_rx(message->chan_rx)) {
ret = ti_msgmgr_queue_rx_poll_timeout(message->chan_rx,
message->timeout_rx_ms * 1000);
+ if (ret)
+ dev_err(dev, "Queue %s timed out waiting for response: %d\n",
+ qinst->name, ret);
+ }
- return ret;
+ return 0;
}
/**
--
2.34.1
next prev parent reply other threads:[~2026-09-29 20:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 20:01 [PATCH 0/2] mailbox: ti-msgmgr: Fixes for polled rx and trailing bytes Beleswar Padhi
2026-09-29 20:01 ` Beleswar Padhi [this message]
2026-09-29 20:01 ` [PATCH 2/2] mailbox: ti-msgmgr: Read exact number of trailing message bytes Beleswar Padhi
2026-09-30 4:13 ` Vignesh Raghavendra
2026-09-30 6:37 ` Padhi, Beleswar
2026-09-30 15:04 ` Andrew Davis
2026-09-30 15:11 ` Padhi, Beleswar
2026-09-30 15:38 ` Andrew Davis
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=20260929200159.4033010-2-b-padhi@ti.com \
--to=b-padhi@ti.com \
--cc=afd@ti.com \
--cc=jassisinghbrar@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nm@ti.com \
--cc=u-kumar1@ti.com \
--cc=vigneshr@ti.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®