]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mailbox: add API to query available TX queue slots
authorJassi Brar <jassisinghbrar@gmail.com>
Mon, 9 Feb 2026 23:36:19 +0000 (17:36 -0600)
committerJassi Brar <jassisinghbrar@gmail.com>
Mon, 9 Mar 2026 03:34:38 +0000 (22:34 -0500)
commit57df858a46f0a4cc104716e0ec88864e5c386ca4
tree6840547beaf2eeb89236b0cb6b65f4f362d7b0d5
parent11439c4635edd669ae435eec308f4ab8a0804808
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>
drivers/mailbox/mailbox.c
include/linux/mailbox_client.h