Skip to content

remoteproc: Call mbox_client_txdone() after mbox_send_message() - #3498

Open
ukleinek wants to merge 1 commit into
analogdevicesinc:adsp-6.18.31-yfrom
ukleinek:remoteproc-mailbox-txdone
Open

remoteproc: Call mbox_client_txdone() after mbox_send_message()#3498
ukleinek wants to merge 1 commit into
analogdevicesinc:adsp-6.18.31-yfrom
ukleinek:remoteproc-mailbox-txdone

Conversation

@ukleinek

Copy link
Copy Markdown
Collaborator

It's necessary to call one of the txdone functions to get the mailbox state machine moving.

Currently it still works by some luck: The message being sent is NULL. The framework code thus sets chan->active_req = NULL to signal that this message is currently sending out. On the next call to mbox_send_message() chan->active_req == NULL is interpreted differently though, that is as not busy and the next message is processed.

The inner workings of the mailbox subsystem will change in commit c58e945 ("mailbox: Fix NULL message support in mbox_send_message()") that is part of v7.1-rc2 where this inconsistency is somewhat fixed. (Then -1 is the value that cannot be properly sent instead of (the more usual) NULL. The upside is that this -1 is properly catched as bogous.)

To prepare updating the code to after v7.1-rc2 add a call to mbox_client_txdone() which is already now required conceptually, but deviating doesn't hurt while only sending NULL.

PR Type

  • Bug fix (a change that fixes an issue, well somewhat)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have compiled my changes, including the documentation
  • I have tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly
  • I have provided links for the relevant upstream lore

It's necessary to call one of the txdone functions to get the mailbox
state machine moving.

Currently it still works by some luck: The message being sent is NULL.
The framework code thus sets chan->active_req = NULL to signal that this
message is currently sending out. On the next call to
mbox_send_message() chan->active_req == NULL is interpreted differently
though, that is as not busy and the next message is processed.

The inner workings of the mailbox subsystem will change in commit
c58e945 ("mailbox: Fix NULL message support in
mbox_send_message()") that is part of v7.1-rc2 where this inconsistency
is somewhat fixed. (Then -1 is the value that cannot be properly sent
instead of (the more usual) NULL. The upside is that this -1 is properly
catched as bogous.)

To prepare updating the code to after v7.1-rc2 add a call to
mbox_client_txdone() which is already now required conceptually, but
deviating doesn't hurt while only sending NULL.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
@pamolloy
pamolloy requested a review from a team August 18, 2026 14:39
@pamolloy pamolloy added this to ADSP Aug 18, 2026
@ukleinek

Copy link
Copy Markdown
Collaborator Author

I failed to mention: I'm not entirely sure this is correct. If it is the mailbox API has a strange consumer contract. But it makes the echo example work on v7.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants