diff options
| author | Jassi Brar <jassisinghbrar@gmail.com> | 2026-02-10 02:36:19 +0300 |
|---|---|---|
| committer | Jassi Brar <jassisinghbrar@gmail.com> | 2026-03-09 06:34:38 +0300 |
| commit | 57df858a46f0a4cc104716e0ec88864e5c386ca4 (patch) | |
| tree | 6840547beaf2eeb89236b0cb6b65f4f362d7b0d5 /include | |
| parent | 11439c4635edd669ae435eec308f4ab8a0804808 (diff) | |
| download | linux-57df858a46f0a4cc104716e0ec88864e5c386ca4.tar.xz | |
mailbox: add API to query available TX queue slots
Clients sometimes need to know whether the mailbox TX queue has room
before posting a new message. Rather than exposing internal queue state
through a struct field, provide a proper accessor function that returns
the number of available slots for a given channel.
This lets clients choose to back off when the queue is full instead of
hitting the -ENOBUFS error path and the misleading "Try increasing
MBOX_TX_QUEUE_LEN" warning.
Tested-by: Tanmay Shah <tanmay.shah@amd.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/mailbox_client.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mailbox_client.h b/include/linux/mailbox_client.h index c6eea9afb943..e5997120f45c 100644 --- a/include/linux/mailbox_client.h +++ b/include/linux/mailbox_client.h @@ -45,6 +45,7 @@ int mbox_send_message(struct mbox_chan *chan, void *mssg); int mbox_flush(struct mbox_chan *chan, unsigned long timeout); void mbox_client_txdone(struct mbox_chan *chan, int r); /* atomic */ bool mbox_client_peek_data(struct mbox_chan *chan); /* atomic */ +unsigned int mbox_chan_tx_slots_available(struct mbox_chan *chan); /* atomic */ void mbox_free_channel(struct mbox_chan *chan); /* may sleep */ #endif /* __MAILBOX_CLIENT_H */ |
