[PATCH v3 1/2] mailbox: ti-msgmgr: Do not report rx poll timeout as a send failure

From: Beleswar Padhi

Date: Wed Sep 30 2026 - 16:46:34 EST


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@xxxxxx>
---
v3: Changelog:
1. None to this patch.

Link to v2:
https://lore.kernel.org/all/20260930143810.2419010-2-b-padhi@xxxxxx/

v2: Changelog:
1. None to this patch.

Link to v1:
https://lore.kernel.org/all/20260929200159.4033010-2-b-padhi@xxxxxx/

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