* [PATCH v3 01/15] mailbox: Deprecate NULL mbox messages; Introduce mbox_ring_doorbell()
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
@ 2026-02-16 18:09 ` Douglas Anderson
2026-03-10 3:23 ` Jassi Brar
2026-02-16 18:09 ` [PATCH v3 02/15] ACPI: PCC: Use mbox_ring_doorbell() instead of NULL message Douglas Anderson
` (15 subsequent siblings)
16 siblings, 1 reply; 24+ messages in thread
From: Douglas Anderson @ 2026-02-16 18:09 UTC (permalink / raw)
To: jassisinghbrar
Cc: Douglas Anderson, Bjorn Andersson, Frank.Li, arm-scmi,
cristian.marussi, festevam, imx, jay.buddhabhatti, jonathanh,
kernel, konradybcio, krzk, lenb, linux-acpi, linux-arm-kernel,
linux-arm-msm, linux-kernel, linux-remoteproc, linux-tegra,
lucaswei, mathieu.poirier, michal.simek, nm, rafael, robh,
s.hauer, shawn.guo, ssantosh, sudeep.holla, tglx, thierry.reding
The way the mailbox core behaves when you pass a NULL `mssg` parameter
to mbox_send_message() is a little questionable. Specifically, the
mailbox core stores the currently active message directly in its
`active_req` field. In at least two places it decides that if this
field is `NULL` then there is no active request. That means if `mssg`
is ever NULL it will cause the mailbox core to think is no active
request. The two places where it does this are:
1. When a client calls mbox_send_message(), if `active_req` is NULL
then it will call the mailbox controller to send the new message
even if the mailbox controller hasn't yet called mbox_chan_txdone()
on the previous (NULL) message.
2. The mailbox core will never call the client's `tx_done()` callback
with a NULL message because `tx_tick()` returns early whenever the
message is NULL.
Though the above doesn't look like it was a conscious design choice,
it does have the benefit of providing a simple way to assert an
edge-triggered interrupt to the remote processor on the other side of
the mailbox. Specifically:
1. Like a normal edge-triggered interrupt, if multiple edges arrive
before the interrupt is Acked they are coalesced.
2. Like a normal edge-triggered interrupt, as long as the receiver
(the remote processor in this case) "Ack"s the interrupt _before_
checking for work and the sender (the mailbox client in this case)
posts the interrupt _after_ adding new work then we can always be
certain that new work will be noticed. This assumes that the
mailbox client and remote processor have some out-of-band way to
communicate work and the mailbox is just being used as an
interrupt.
Doing a `git grep -A1 mbox_send_message | grep NULL` shows 14 hits in
mainline today, but it's not 100% clear if all of those users are
relying on the benefits/quirks of the existing behavior.
Since the current NULL `mssg` behavior is a bit questionable but has
some benefits, let's:
1. Deprecate the NULL behavior and print a warning.
2. Add a new mbox_ring_doorbell() function that is very similar to the
existing NULL `mssg` case but a tad bit cleaner.
The design of the new mbox_ring_doorbell() will be to maximize
compatibility with the old NULL `mssg` behavior. Specifically:
* We'll still pass NULL to the mailbox controller to indicate a
doorbell.
* Doorbells will not be queued and won't have txdone.
* We'll call immediately into the mailbox controller when a doorbell
is posted.
With the above, any mailbox clients that don't mix doorbells and
normal messages are intended to see no change in behavior when
switching to the new API. Using the new API, which officiall documents
that mbox_client_txdone() shouldn't be called for doorbells, does
allow us to remove those calls.
There are two differences in behavior between the old sending a NULL
message and the new mbox_ring_doorbell():
1. If the mailbox controller returned an error when trying to send a
NULL message, the old NULL message could have ended up being queued
up in the core's FIFO. Now we will just return the error.
2. If a client rings a doorbell while a non-doorbell message is in
progress, previously NULL messages would have been "queued" in that
case and now doorbells will be immediately posted.
I'm hoping that nobody was relying on either of the two differences.
In general holding NULL messages in the mailbox core's queue has odd
behavior and is hard to reason about. Hopefully it's reasonable to
assume nobody was doing this.
As mentioned above, it should be noted that it's now documented that
"txdone" shouldn't be called (by both mailbox drivers and clients) for
doorbells. That being said, in most cases it won't hurt since the
mailbox core will ignore the bogus "txdone". The only case where it's
critical for a mailbox controller not to call "txdone" for a doorbell
is when a mailbox channel mixes normal messages and doorbells and
cares about the txdone callback. Specifically, when you ring a
doorbell and immediately send a normal message, if the controller
calls "txdone" for the doorbell it could look as if the normal message
finished before it should have. This issue also would have happened
with the old NULL `mssg`, though.
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
Changes in v3:
- Suggest mbox_ring_doorbell in the warning message
Changes in v2:
- Instead of just documenting NULL, introduce a new function
drivers/mailbox/mailbox.c | 82 +++++++++++++++++++++++++++++-
include/linux/mailbox_client.h | 1 +
include/linux/mailbox_controller.h | 4 +-
3 files changed, 85 insertions(+), 2 deletions(-)
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index 617ba505691d..fe3f2f75e734 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -161,6 +161,9 @@ EXPORT_SYMBOL_GPL(mbox_chan_received_data);
* The controller that has IRQ for TX ACK calls this atomic API
* to tick the TX state machine. It works only if txdone_irq
* is set by the controller.
+ *
+ * Should not be called for "doorbell" messages (any time the message
+ * sent was NULL).
*/
void mbox_chan_txdone(struct mbox_chan *chan, int r)
{
@@ -182,6 +185,9 @@ EXPORT_SYMBOL_GPL(mbox_chan_txdone);
* The client/protocol had received some 'ACK' packet and it notifies
* the API that the last packet was sent successfully. This only works
* if the controller can't sense TX-Done.
+ *
+ * Should not be called for "doorbell" messages (any time the message
+ * sent was NULL).
*/
void mbox_client_txdone(struct mbox_chan *chan, int r)
{
@@ -222,7 +228,7 @@ EXPORT_SYMBOL_GPL(mbox_client_peek_data);
* mbox_send_message - For client to submit a message to be
* sent to the remote.
* @chan: Mailbox channel assigned to this client.
- * @mssg: Client specific message typecasted.
+ * @mssg: Client specific message typecasted. Should not be NULL.
*
* For client to submit data to the controller destined for a remote
* processor. If the client had set 'tx_block', the call will return
@@ -249,6 +255,28 @@ int mbox_send_message(struct mbox_chan *chan, void *mssg)
if (!chan || !chan->cl)
return -EINVAL;
+ /*
+ * The mailbox core gets confused when mbox_send_message() is called
+ * with NULL messages since the code directly stores messages in
+ * `active_req` and assumes that a NULL `active_req` means no request
+ * is active. This causes the core to call the mailbox controller a
+ * second time even if the previous message hasn't finished and also
+ * means the client's tx_done() callback will never be called. However,
+ * clients historically passed NULL anyway. Deprecate passing NULL
+ * here by adding a warning.
+ *
+ * Clients who don't have a message should switch to using
+ * mbox_ring_doorbell(), which explicitly documents the immediate
+ * sending of doorbells, the lack of txdone, and what happens if you
+ * mix doorbells and normal messages.
+ *
+ * TODO: when it's certain that all clients have transitioned, consider
+ * changing this to return -EINVAL.
+ */
+ if (!mssg)
+ dev_warn_once(chan->mbox->dev,
+ "NULL mbox messages are deprecated; use mbox_ring_doorbell\n");
+
t = add_to_rbuf(chan, mssg);
if (t < 0) {
dev_err(chan->mbox->dev, "Try increasing MBOX_TX_QUEUE_LEN\n");
@@ -277,6 +305,58 @@ int mbox_send_message(struct mbox_chan *chan, void *mssg)
}
EXPORT_SYMBOL_GPL(mbox_send_message);
+/**
+ * mbox_ring_doorbell - Client function to ring the doorbell with no message.
+ * @chan: Mailbox channel assigned to this client.
+ *
+ * Send a notification to the remote side of the mailbox but don't actually
+ * send any data. This is typically used when the client and the remote side
+ * of the mailbox have some other (non-mailbox) way to communicate and the
+ * mailbox is simply used as an "interrupt" to notify the remote side.
+ *
+ * This function has a few important differences from mbox_send_message():
+ * - There is no concept of "txdone" for mbox_ring_doorbell(), even if the
+ * controller itself would be able to tell when the remote CPU saw or Acked
+ * the doorbell.
+ * - Because there is no concept of "txdone", there is no need to wait for
+ * previous doorbells to "finish" before notifying the controller of another
+ * doorbell.
+ * - Because we never wait to notify a controller of a doorbell, there is no
+ * queue for doorbells.
+ *
+ * The above properties mean that calling mbox_ring_doorbell() is the equivalent
+ * of re-asserting an edge triggered interrupt to the remote side. If the remote
+ * side hasn't yet "cleared" the interrupt this is a no-op. If the remote side
+ * has cleared the interrupt, it will be re-asserted. Expected usage:
+ *
+ * This CPU:
+ * - Update out-of-band (OOB) memory shared between this CPU and remote CPU.
+ * - Ring doorbell.
+ * Remote CPU:
+ * - Clear doorbell.
+ * - Read OOB shared memory and act on it.
+ *
+ * The remote CPU will always be guaranteed to notice changes, even if this CPU
+ * updates / rings multiple times before the remote CPU has a chance to run.
+ *
+ * Mixing calls of mbox_ring_doorbell() and mbox_send_message() on the same
+ * mailbox channel is allowed, assuming the mailbox controller correctly avoids
+ * calling mbox_chan_txdone() for doorbells.
+ *
+ * NOTE: For compatibility reasons, doorbells are sent to the mailbox
+ * controller driver by passing NULL to the mailbox controller's
+ * send_data() callback.
+ *
+ * Return: Negative error code upon failure.
+ */
+int mbox_ring_doorbell(struct mbox_chan *chan)
+{
+ guard(spinlock_irqsave)(&chan->lock);
+
+ return chan->mbox->ops->send_data(chan, NULL);
+}
+EXPORT_SYMBOL_GPL(mbox_ring_doorbell);
+
/**
* mbox_flush - flush a mailbox channel
* @chan: mailbox channel to flush
diff --git a/include/linux/mailbox_client.h b/include/linux/mailbox_client.h
index c6eea9afb943..e3fc11e42c58 100644
--- a/include/linux/mailbox_client.h
+++ b/include/linux/mailbox_client.h
@@ -42,6 +42,7 @@ struct mbox_chan *mbox_request_channel_byname(struct mbox_client *cl,
const char *name);
struct mbox_chan *mbox_request_channel(struct mbox_client *cl, int index);
int mbox_send_message(struct mbox_chan *chan, void *mssg);
+int mbox_ring_doorbell(struct mbox_chan *chan);
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 */
diff --git a/include/linux/mailbox_controller.h b/include/linux/mailbox_controller.h
index 80a427c7ca29..36648fa7b6f3 100644
--- a/include/linux/mailbox_controller.h
+++ b/include/linux/mailbox_controller.h
@@ -19,7 +19,9 @@ struct mbox_chan;
* if the remote hasn't yet read the last data sent. Actual
* transmission of data is reported by the controller via
* mbox_chan_txdone (if it has some TX ACK irq). It must not
- * sleep.
+ * sleep. Will be passed NULL data for doorbell-only messages.
+ * Note that doorbell messages are always sent immediately with
+ * no queuing. mbox_chan_txdone() shouldn't be called on doorbells.
* @flush: Called when a client requests transmissions to be blocking but
* the context doesn't allow sleeping. Typically the controller
* will implement a busy loop waiting for the data to flush out.
--
2.53.0.273.g2a3d683680-goog
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH v3 01/15] mailbox: Deprecate NULL mbox messages; Introduce mbox_ring_doorbell()
2026-02-16 18:09 ` [PATCH v3 01/15] mailbox: Deprecate NULL mbox messages; Introduce mbox_ring_doorbell() Douglas Anderson
@ 2026-03-10 3:23 ` Jassi Brar
2026-03-10 15:08 ` Doug Anderson
0 siblings, 1 reply; 24+ messages in thread
From: Jassi Brar @ 2026-03-10 3:23 UTC (permalink / raw)
To: Douglas Anderson
Cc: Bjorn Andersson, Frank.Li, arm-scmi, cristian.marussi, festevam,
imx, jay.buddhabhatti, jonathanh, kernel, konradybcio, krzk, lenb,
linux-acpi, linux-arm-kernel, linux-arm-msm, linux-kernel,
linux-remoteproc, linux-tegra, lucaswei, mathieu.poirier,
michal.simek, nm, rafael, robh, s.hauer, shawn.guo, ssantosh,
sudeep.holla, tglx, thierry.reding
Hi Doug,
On Mon, Feb 16, 2026 at 12:11 PM Douglas Anderson <dianders@chromium.org> wrote:
> @@ -249,6 +255,28 @@ int mbox_send_message(struct mbox_chan *chan, void *mssg)
> if (!chan || !chan->cl)
> return -EINVAL;
>
> + /*
> + * The mailbox core gets confused when mbox_send_message() is called
> + * with NULL messages since the code directly stores messages in
> + * `active_req` and assumes that a NULL `active_req` means no request
> + * is active. This causes the core to call the mailbox controller a
> + * second time even if the previous message hasn't finished and also
> + * means the client's tx_done() callback will never be called. However,
> + * clients historically passed NULL anyway. Deprecate passing NULL
> + * here by adding a warning.
> + *
> + * Clients who don't have a message should switch to using
> + * mbox_ring_doorbell(), which explicitly documents the immediate
> + * sending of doorbells, the lack of txdone, and what happens if you
> + * mix doorbells and normal messages.
> + *
> + * TODO: when it's certain that all clients have transitioned, consider
> + * changing this to return -EINVAL.
> + */
> + if (!mssg)
> + dev_warn_once(chan->mbox->dev,
> + "NULL mbox messages are deprecated; use mbox_ring_doorbell\n");
> +
Does this patchset leave some such clients out? If not, should we
drop this block and return -EINVAL already?
Thanks,
Jassi
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v3 01/15] mailbox: Deprecate NULL mbox messages; Introduce mbox_ring_doorbell()
2026-03-10 3:23 ` Jassi Brar
@ 2026-03-10 15:08 ` Doug Anderson
0 siblings, 0 replies; 24+ messages in thread
From: Doug Anderson @ 2026-03-10 15:08 UTC (permalink / raw)
To: Jassi Brar
Cc: Bjorn Andersson, Frank.Li, arm-scmi, cristian.marussi, festevam,
imx, jay.buddhabhatti, jonathanh, kernel, konradybcio, krzk, lenb,
linux-acpi, linux-arm-kernel, linux-arm-msm, linux-kernel,
linux-remoteproc, linux-tegra, lucaswei, mathieu.poirier,
michal.simek, nm, rafael, robh, s.hauer, shawn.guo, ssantosh,
sudeep.holla, tglx, thierry.reding
Hi,
On Mon, Mar 9, 2026 at 8:24 PM Jassi Brar <jassisinghbrar@gmail.com> wrote:
>
> Hi Doug,
>
> On Mon, Feb 16, 2026 at 12:11 PM Douglas Anderson <dianders@chromium.org> wrote:
> > @@ -249,6 +255,28 @@ int mbox_send_message(struct mbox_chan *chan, void *mssg)
> > if (!chan || !chan->cl)
> > return -EINVAL;
> >
> > + /*
> > + * The mailbox core gets confused when mbox_send_message() is called
> > + * with NULL messages since the code directly stores messages in
> > + * `active_req` and assumes that a NULL `active_req` means no request
> > + * is active. This causes the core to call the mailbox controller a
> > + * second time even if the previous message hasn't finished and also
> > + * means the client's tx_done() callback will never be called. However,
> > + * clients historically passed NULL anyway. Deprecate passing NULL
> > + * here by adding a warning.
> > + *
> > + * Clients who don't have a message should switch to using
> > + * mbox_ring_doorbell(), which explicitly documents the immediate
> > + * sending of doorbells, the lack of txdone, and what happens if you
> > + * mix doorbells and normal messages.
> > + *
> > + * TODO: when it's certain that all clients have transitioned, consider
> > + * changing this to return -EINVAL.
> > + */
> > + if (!mssg)
> > + dev_warn_once(chan->mbox->dev,
> > + "NULL mbox messages are deprecated; use mbox_ring_doorbell\n");
> > +
> Does this patchset leave some such clients out? If not, should we
> drop this block and return -EINVAL already?
This patchset series got all the clients that were in mainline at the
time I last checked. However, it was unclear to me if all the patches
would all go through your tree or not, since they don't touch mailbox
drivers but the somewhat widespread places that were clients of
mailbox.
If all the patches aren't going through your tree, we'll need to keep
it like this until we can confirm all of the clients have been
updated. If all the patcheds are going through your tree, then we
could make it return -EINVAL right away, but it we'd have to do that
as a last patch in the series. I think it would still make sense for
the first patch (which adds the mbox_ring_doorbell() call) to have a
warning like this and then a final patch to switch to -EINVAL. That
keeps things bisectable.
What do you think?
I'm happy to post a patch atop my series that switches it to -EINVAL
and you can land it whenever you see fit. Would that work?
-Doug
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v3 02/15] ACPI: PCC: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
2026-02-16 18:09 ` [PATCH v3 01/15] mailbox: Deprecate NULL mbox messages; Introduce mbox_ring_doorbell() Douglas Anderson
@ 2026-02-16 18:09 ` Douglas Anderson
2026-02-16 18:09 ` [PATCH v3 03/15] firmware: arm_scmi: " Douglas Anderson
` (14 subsequent siblings)
16 siblings, 0 replies; 24+ messages in thread
From: Douglas Anderson @ 2026-02-16 18:09 UTC (permalink / raw)
To: jassisinghbrar; +Cc: Douglas Anderson, lenb, linux-acpi, linux-kernel, rafael
As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
messages to use mbox_ring_doorbell().
From code inspection, it appears that this driver only ever sends NULL
messages and thus the conversion is straightforward. The only change
is to remove the call to mbox_chan_txdone(). The call wouldn't have
done anything in the past anyway (since chan->active_req was NULL) but
with doorbells it's officially documented to not be needed.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
Something seemed a little fishy in this code. The code seems to be a
_client_ of a mailbox, yet it was calling mbox_chan_txdone() which is
something mailbox _controllers_ are supposed to call when their
"txdone" interrupt goes off.
It appears that this client even reaches into the mailbox controller
and confirms that `txdone_irq` is set, which should mean that the
controller itself signals txdone.
If the mailbox controller is actually signaling "txdone" it should
ideally be improved to not do so for doorbell (NULL) messages, but it
won't matter much for this client since we only ever send doorbells
and don't care about the txdone callback.
(no changes since v1)
drivers/acpi/acpi_pcc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/acpi/acpi_pcc.c b/drivers/acpi/acpi_pcc.c
index e3f302b9dee5..3d240ecd98f4 100644
--- a/drivers/acpi/acpi_pcc.c
+++ b/drivers/acpi/acpi_pcc.c
@@ -106,7 +106,7 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,
/* Write to Shared Memory */
memcpy_toio(data->pcc_chan->shmem, (void *)value, data->ctx.length);
- ret = mbox_send_message(data->pcc_chan->mchan, NULL);
+ ret = mbox_ring_doorbell(data->pcc_chan->mchan);
if (ret < 0)
return AE_ERROR;
@@ -123,8 +123,6 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,
return AE_TIME;
}
- mbox_chan_txdone(data->pcc_chan->mchan, ret);
-
memcpy_fromio(value, data->pcc_chan->shmem, data->ctx.length);
return AE_OK;
--
2.53.0.273.g2a3d683680-goog
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH v3 03/15] firmware: arm_scmi: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
2026-02-16 18:09 ` [PATCH v3 01/15] mailbox: Deprecate NULL mbox messages; Introduce mbox_ring_doorbell() Douglas Anderson
2026-02-16 18:09 ` [PATCH v3 02/15] ACPI: PCC: Use mbox_ring_doorbell() instead of NULL message Douglas Anderson
@ 2026-02-16 18:09 ` Douglas Anderson
2026-02-16 18:09 ` [PATCH v3 04/15] firmware: imx-dsp: " Douglas Anderson
` (13 subsequent siblings)
16 siblings, 0 replies; 24+ messages in thread
From: Douglas Anderson @ 2026-02-16 18:09 UTC (permalink / raw)
To: jassisinghbrar
Cc: Douglas Anderson, Cristian Marussi, arm-scmi, krzk,
linux-arm-kernel, linux-kernel, sudeep.holla
As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
messages to use mbox_ring_doorbell().
The mbox_ring_doorbell() explicitly documents not to call
mbox_client_txdone() for doorbells, so remove the call.
NOTE: upon first glance, this mailbox client appears to send doorbells
and regular messages on the same mailbox channel (smbox->chan), so it
needs some extra attention. Specifically, the new API behaves
differently if you ring a doorbell while a non-doorbell message is in
progress. I don't believe that this is something we have to worry
about with this mailbox client, though, because the code was calling
mbox_client_txdone() after sending the NULL message. Had a non-mailbox
message been in progress, that would have marked the in-progress
message as done instead of marking the NULL message as done.
In discussion [1], it was further clarified that the driver shouldn't
ever be sending doorbell and non-doorbell messages on the same
channel.
Link: http://lore.kernel.org/r/aYoPLzOjPvJbu0Kb@pluto [1]
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
Changes in v3:
- Updated patch description based on Cristian's response.
drivers/firmware/arm_scmi/transports/mailbox.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/firmware/arm_scmi/transports/mailbox.c b/drivers/firmware/arm_scmi/transports/mailbox.c
index ae0f67e6cc45..c4561441ac2e 100644
--- a/drivers/firmware/arm_scmi/transports/mailbox.c
+++ b/drivers/firmware/arm_scmi/transports/mailbox.c
@@ -324,7 +324,6 @@ static void mailbox_clear_channel(struct scmi_chan_info *cinfo)
{
struct scmi_mailbox *smbox = cinfo->transport_info;
struct mbox_chan *intr_chan;
- int ret;
core->shmem->clear_channel(smbox->shmem);
@@ -338,12 +337,7 @@ static void mailbox_clear_channel(struct scmi_chan_info *cinfo)
else
return;
- ret = mbox_send_message(intr_chan, NULL);
- /* mbox_send_message returns non-negative value on success, so reset */
- if (ret > 0)
- ret = 0;
-
- mbox_client_txdone(intr_chan, ret);
+ mbox_ring_doorbell(intr_chan);
}
static bool
--
2.53.0.273.g2a3d683680-goog
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH v3 04/15] firmware: imx-dsp: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
` (2 preceding siblings ...)
2026-02-16 18:09 ` [PATCH v3 03/15] firmware: arm_scmi: " Douglas Anderson
@ 2026-02-16 18:09 ` Douglas Anderson
2026-02-16 18:09 ` [PATCH v3 05/15] firmware: tegra: bpmp: " Douglas Anderson
` (12 subsequent siblings)
16 siblings, 0 replies; 24+ messages in thread
From: Douglas Anderson @ 2026-02-16 18:09 UTC (permalink / raw)
To: jassisinghbrar
Cc: Douglas Anderson, Daniel Baluta, Frank.Li, Sascha Hauer, festevam,
imx, kernel, linux-arm-kernel, linux-kernel
As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
messages to use mbox_ring_doorbell().
This client only ever sent NULL messages, so the transition is
straightforward.
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
(no changes since v1)
drivers/firmware/imx/imx-dsp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/imx/imx-dsp.c b/drivers/firmware/imx/imx-dsp.c
index ed79e823157a..231e9f841226 100644
--- a/drivers/firmware/imx/imx-dsp.c
+++ b/drivers/firmware/imx/imx-dsp.c
@@ -30,7 +30,7 @@ int imx_dsp_ring_doorbell(struct imx_dsp_ipc *ipc, unsigned int idx)
return -EINVAL;
dsp_chan = &ipc->chans[idx];
- ret = mbox_send_message(dsp_chan->ch, NULL);
+ ret = mbox_ring_doorbell(dsp_chan->ch);
if (ret < 0)
return ret;
--
2.53.0.273.g2a3d683680-goog
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH v3 05/15] firmware: tegra: bpmp: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
` (3 preceding siblings ...)
2026-02-16 18:09 ` [PATCH v3 04/15] firmware: imx-dsp: " Douglas Anderson
@ 2026-02-16 18:09 ` Douglas Anderson
2026-02-16 18:09 ` [PATCH v3 06/15] irqchip/qcom-mpm: " Douglas Anderson
` (11 subsequent siblings)
16 siblings, 0 replies; 24+ messages in thread
From: Douglas Anderson @ 2026-02-16 18:09 UTC (permalink / raw)
To: jassisinghbrar
Cc: Douglas Anderson, jonathanh, linux-kernel, linux-tegra, robh,
thierry.reding
As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
messages to use mbox_ring_doorbell().
This client only ever sent NULL messages, so the transition is
straightforward. We can remove the call to mbox_client_txdone(). The
call didn't do anything for NULL messages and it's now officially
documented not to be called for doorbells.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
(no changes since v1)
drivers/firmware/tegra/bpmp-tegra186.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/firmware/tegra/bpmp-tegra186.c b/drivers/firmware/tegra/bpmp-tegra186.c
index 64863db7a715..c45ea66aabfb 100644
--- a/drivers/firmware/tegra/bpmp-tegra186.c
+++ b/drivers/firmware/tegra/bpmp-tegra186.c
@@ -84,12 +84,10 @@ static int tegra186_bpmp_ring_doorbell(struct tegra_bpmp *bpmp)
struct tegra186_bpmp *priv = bpmp->priv;
int err;
- err = mbox_send_message(priv->mbox.channel, NULL);
+ err = mbox_ring_doorbell(priv->mbox.channel);
if (err < 0)
return err;
- mbox_client_txdone(priv->mbox.channel, 0);
-
return 0;
}
--
2.53.0.273.g2a3d683680-goog
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH v3 06/15] irqchip/qcom-mpm: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
` (4 preceding siblings ...)
2026-02-16 18:09 ` [PATCH v3 05/15] firmware: tegra: bpmp: " Douglas Anderson
@ 2026-02-16 18:09 ` Douglas Anderson
2026-02-17 10:11 ` Thomas Gleixner
2026-02-16 18:09 ` [PATCH v3 07/15] remoteproc: xlnx: " Douglas Anderson
` (10 subsequent siblings)
16 siblings, 1 reply; 24+ messages in thread
From: Douglas Anderson @ 2026-02-16 18:09 UTC (permalink / raw)
To: jassisinghbrar; +Cc: Douglas Anderson, linux-kernel, tglx
As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
messages to use mbox_ring_doorbell().
This client only ever sent NULL messages, so the transition is
straightforward.
This client didn't previously call mbox_client_txdone() and it appears
that the mailboxes it hooks up with (qcom-apcs-ipc-mailbox.c or
qcom-ipcc.c) have both `txdone_irq` and `txdone_poll` as
false. Presumably this means the client was relying the mailbox core's
quirky behavior when sending NULL messages.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
(no changes since v1)
drivers/irqchip/irq-qcom-mpm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-qcom-mpm.c b/drivers/irqchip/irq-qcom-mpm.c
index 83f31ea657b7..5b79d95bf1fb 100644
--- a/drivers/irqchip/irq-qcom-mpm.c
+++ b/drivers/irqchip/irq-qcom-mpm.c
@@ -302,7 +302,7 @@ static int mpm_pd_power_off(struct generic_pm_domain *genpd)
qcom_mpm_write(priv, MPM_REG_STATUS, i, 0);
/* Notify RPM to write vMPM into HW */
- ret = mbox_send_message(priv->mbox_chan, NULL);
+ ret = mbox_ring_doorbell(priv->mbox_chan);
if (ret < 0)
return ret;
--
2.53.0.273.g2a3d683680-goog
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH v3 06/15] irqchip/qcom-mpm: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 ` [PATCH v3 06/15] irqchip/qcom-mpm: " Douglas Anderson
@ 2026-02-17 10:11 ` Thomas Gleixner
0 siblings, 0 replies; 24+ messages in thread
From: Thomas Gleixner @ 2026-02-17 10:11 UTC (permalink / raw)
To: Douglas Anderson, jassisinghbrar; +Cc: Douglas Anderson, linux-kernel
On Mon, Feb 16 2026 at 10:09, Douglas Anderson wrote:
> As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
> mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
> messages to use mbox_ring_doorbell().
>
> This client only ever sent NULL messages, so the transition is
> straightforward.
>
> This client didn't previously call mbox_client_txdone() and it appears
> that the mailboxes it hooks up with (qcom-apcs-ipc-mailbox.c or
> qcom-ipcc.c) have both `txdone_irq` and `txdone_poll` as
> false. Presumably this means the client was relying the mailbox core's
> quirky behavior when sending NULL messages.
>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Thomas Gleixner <tglx@kernel.org>
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v3 07/15] remoteproc: xlnx: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
` (5 preceding siblings ...)
2026-02-16 18:09 ` [PATCH v3 06/15] irqchip/qcom-mpm: " Douglas Anderson
@ 2026-02-16 18:09 ` Douglas Anderson
2026-02-16 18:09 ` [PATCH v3 08/15] rpmsg: qcom_glink_rpm: " Douglas Anderson
` (9 subsequent siblings)
16 siblings, 0 replies; 24+ messages in thread
From: Douglas Anderson @ 2026-02-16 18:09 UTC (permalink / raw)
To: jassisinghbrar
Cc: Douglas Anderson, Bjorn Andersson, linux-kernel, linux-remoteproc,
mathieu.poirier
As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
messages to use mbox_ring_doorbell().
This client only ever sent NULL message on the rx channel, so the
transition is straightforward.
Acked-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
(no changes since v1)
drivers/remoteproc/xlnx_r5_remoteproc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c
index bd619a6c42aa..2acdc536d6b6 100644
--- a/drivers/remoteproc/xlnx_r5_remoteproc.c
+++ b/drivers/remoteproc/xlnx_r5_remoteproc.c
@@ -245,7 +245,7 @@ static void zynqmp_r5_mb_rx_cb(struct mbox_client *cl, void *msg)
memcpy(buf_msg->data, ipi_msg->data, len);
/* received and processed interrupt ack */
- if (mbox_send_message(ipi->rx_chan, NULL) < 0)
+ if (mbox_ring_doorbell(ipi->rx_chan) < 0)
dev_err(cl->dev, "ack failed to mbox rx_chan\n");
schedule_work(&ipi->mbox_work);
--
2.53.0.273.g2a3d683680-goog
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH v3 08/15] rpmsg: qcom_glink_rpm: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
` (6 preceding siblings ...)
2026-02-16 18:09 ` [PATCH v3 07/15] remoteproc: xlnx: " Douglas Anderson
@ 2026-02-16 18:09 ` Douglas Anderson
2026-02-16 18:09 ` [PATCH v3 09/15] rpmsg: glink: smem: " Douglas Anderson
` (8 subsequent siblings)
16 siblings, 0 replies; 24+ messages in thread
From: Douglas Anderson @ 2026-02-16 18:09 UTC (permalink / raw)
To: jassisinghbrar
Cc: Douglas Anderson, Bjorn Andersson, linux-arm-msm, linux-kernel,
linux-remoteproc, mathieu.poirier
As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
messages to use mbox_ring_doorbell().
This client only ever sent NULL messages, so the transition is
straightforward. We can remove the call to mbox_client_txdone(). The
call didn't do anything for NULL messages and it's now officially
documented not to be called for doorbells.
Acked-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
(no changes since v1)
drivers/rpmsg/qcom_glink_rpm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/rpmsg/qcom_glink_rpm.c b/drivers/rpmsg/qcom_glink_rpm.c
index e3ba2c63a5fc..4cb9c36adcd4 100644
--- a/drivers/rpmsg/qcom_glink_rpm.c
+++ b/drivers/rpmsg/qcom_glink_rpm.c
@@ -197,8 +197,7 @@ static void glink_rpm_tx_kick(struct qcom_glink_pipe *glink_pipe)
struct glink_rpm_pipe *pipe = to_rpm_pipe(glink_pipe);
struct glink_rpm *rpm = container_of(pipe, struct glink_rpm, tx_pipe);
- mbox_send_message(rpm->mbox_chan, NULL);
- mbox_client_txdone(rpm->mbox_chan, 0);
+ mbox_ring_doorbell(rpm->mbox_chan);
}
static irqreturn_t qcom_glink_rpm_intr(int irq, void *data)
--
2.53.0.273.g2a3d683680-goog
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH v3 09/15] rpmsg: glink: smem: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
` (7 preceding siblings ...)
2026-02-16 18:09 ` [PATCH v3 08/15] rpmsg: qcom_glink_rpm: " Douglas Anderson
@ 2026-02-16 18:09 ` Douglas Anderson
2026-02-16 18:09 ` [PATCH v3 10/15] rpmsg: qcom_smd: " Douglas Anderson
` (7 subsequent siblings)
16 siblings, 0 replies; 24+ messages in thread
From: Douglas Anderson @ 2026-02-16 18:09 UTC (permalink / raw)
To: jassisinghbrar
Cc: Douglas Anderson, Bjorn Andersson, linux-arm-msm, linux-kernel,
linux-remoteproc, mathieu.poirier
As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
messages to use mbox_ring_doorbell().
This client only ever sent NULL messages, so the transition is
straightforward. We can remove the call to mbox_client_txdone(). The
call didn't do anything for NULL messages and it's now officially
documented not to be called for doorbells.
Acked-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
This driver is used on my sc7180-trogdor Chromebook. While I haven't
stress tested with it, I can confirm that the system boots normally to
UI and can suspend/resume with this patch in place.
(no changes since v1)
drivers/rpmsg/qcom_glink_smem.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c
index 7a982c60a8dd..f2a6d94e72ea 100644
--- a/drivers/rpmsg/qcom_glink_smem.c
+++ b/drivers/rpmsg/qcom_glink_smem.c
@@ -197,8 +197,7 @@ static void glink_smem_tx_kick(struct qcom_glink_pipe *glink_pipe)
struct glink_smem_pipe *pipe = to_smem_pipe(glink_pipe);
struct qcom_glink_smem *smem = pipe->smem;
- mbox_send_message(smem->mbox_chan, NULL);
- mbox_client_txdone(smem->mbox_chan, 0);
+ mbox_ring_doorbell(smem->mbox_chan);
}
static irqreturn_t qcom_glink_smem_intr(int irq, void *data)
--
2.53.0.273.g2a3d683680-goog
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH v3 10/15] rpmsg: qcom_smd: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
` (8 preceding siblings ...)
2026-02-16 18:09 ` [PATCH v3 09/15] rpmsg: glink: smem: " Douglas Anderson
@ 2026-02-16 18:09 ` Douglas Anderson
2026-02-16 18:09 ` [PATCH v3 11/15] soc: qcom: aoss: " Douglas Anderson
` (6 subsequent siblings)
16 siblings, 0 replies; 24+ messages in thread
From: Douglas Anderson @ 2026-02-16 18:09 UTC (permalink / raw)
To: jassisinghbrar
Cc: Douglas Anderson, Bjorn Andersson, linux-arm-msm, linux-kernel,
linux-remoteproc, mathieu.poirier
As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
messages to use mbox_ring_doorbell().
This client only ever sent NULL messages, so the transition is
straightforward. We can remove the call to mbox_client_txdone(). The
call didn't do anything for NULL messages and it's now officially
documented not to be called for doorbells.
Also remove the comment about the only cause of errors for
mbox_send_message() being if the framework's FIFO was full since we
don't queue doorbells.
Acked-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
(no changes since v1)
drivers/rpmsg/qcom_smd.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
index 42594f5ee438..afe1177d092e 100644
--- a/drivers/rpmsg/qcom_smd.c
+++ b/drivers/rpmsg/qcom_smd.c
@@ -371,17 +371,10 @@ static void qcom_smd_signal_channel(struct qcom_smd_channel *channel)
{
struct qcom_smd_edge *edge = channel->edge;
- if (edge->mbox_chan) {
- /*
- * We can ignore a failing mbox_send_message() as the only
- * possible cause is that the FIFO in the framework is full of
- * other writes to the same bit.
- */
- mbox_send_message(edge->mbox_chan, NULL);
- mbox_client_txdone(edge->mbox_chan, 0);
- } else {
+ if (edge->mbox_chan)
+ mbox_ring_doorbell(edge->mbox_chan);
+ else
regmap_write(edge->ipc_regmap, edge->ipc_offset, BIT(edge->ipc_bit));
- }
}
/*
--
2.53.0.273.g2a3d683680-goog
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH v3 11/15] soc: qcom: aoss: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
` (9 preceding siblings ...)
2026-02-16 18:09 ` [PATCH v3 10/15] rpmsg: qcom_smd: " Douglas Anderson
@ 2026-02-16 18:09 ` Douglas Anderson
2026-02-23 15:45 ` Bjorn Andersson
2026-02-16 18:09 ` [PATCH v3 12/15] soc: qcom: smp2p: " Douglas Anderson
` (5 subsequent siblings)
16 siblings, 1 reply; 24+ messages in thread
From: Douglas Anderson @ 2026-02-16 18:09 UTC (permalink / raw)
To: jassisinghbrar
Cc: Douglas Anderson, andersson, konradybcio, linux-arm-msm,
linux-kernel
As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
messages to use mbox_ring_doorbell().
This client only ever sent NULL messages, so the transition is
straightforward. We can remove the call to mbox_client_txdone(). The
call didn't do anything for NULL messages and it's now officially
documented not to be called for doorbells.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
This driver is used on my sc7180-trogdor Chromebook. While I haven't
stress tested with it, I can confirm that the system boots normally to
UI and can suspend/resume with this patch in place.
(no changes since v1)
drivers/soc/qcom/qcom_aoss.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/soc/qcom/qcom_aoss.c b/drivers/soc/qcom/qcom_aoss.c
index a543ab9bee6c..2ecab93239d2 100644
--- a/drivers/soc/qcom/qcom_aoss.c
+++ b/drivers/soc/qcom/qcom_aoss.c
@@ -97,8 +97,7 @@ struct qmp {
static void qmp_kick(struct qmp *qmp)
{
- mbox_send_message(qmp->mbox_chan, NULL);
- mbox_client_txdone(qmp->mbox_chan, 0);
+ mbox_ring_doorbell(qmp->mbox_chan);
}
static bool qmp_magic_valid(struct qmp *qmp)
--
2.53.0.273.g2a3d683680-goog
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH v3 11/15] soc: qcom: aoss: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 ` [PATCH v3 11/15] soc: qcom: aoss: " Douglas Anderson
@ 2026-02-23 15:45 ` Bjorn Andersson
0 siblings, 0 replies; 24+ messages in thread
From: Bjorn Andersson @ 2026-02-23 15:45 UTC (permalink / raw)
To: Douglas Anderson; +Cc: jassisinghbrar, konradybcio, linux-arm-msm, linux-kernel
On Mon, Feb 16, 2026 at 10:09:48AM -0800, Douglas Anderson wrote:
> As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
> mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
> messages to use mbox_ring_doorbell().
>
> This client only ever sent NULL messages, so the transition is
> straightforward. We can remove the call to mbox_client_txdone(). The
> call didn't do anything for NULL messages and it's now officially
> documented not to be called for doorbells.
>
Acked-by: Bjorn Andersson <andersson@kernel.org>
Regards,
Bjorn
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> This driver is used on my sc7180-trogdor Chromebook. While I haven't
> stress tested with it, I can confirm that the system boots normally to
> UI and can suspend/resume with this patch in place.
>
> (no changes since v1)
>
> drivers/soc/qcom/qcom_aoss.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/soc/qcom/qcom_aoss.c b/drivers/soc/qcom/qcom_aoss.c
> index a543ab9bee6c..2ecab93239d2 100644
> --- a/drivers/soc/qcom/qcom_aoss.c
> +++ b/drivers/soc/qcom/qcom_aoss.c
> @@ -97,8 +97,7 @@ struct qmp {
>
> static void qmp_kick(struct qmp *qmp)
> {
> - mbox_send_message(qmp->mbox_chan, NULL);
> - mbox_client_txdone(qmp->mbox_chan, 0);
> + mbox_ring_doorbell(qmp->mbox_chan);
> }
>
> static bool qmp_magic_valid(struct qmp *qmp)
> --
> 2.53.0.273.g2a3d683680-goog
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v3 12/15] soc: qcom: smp2p: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
` (10 preceding siblings ...)
2026-02-16 18:09 ` [PATCH v3 11/15] soc: qcom: aoss: " Douglas Anderson
@ 2026-02-16 18:09 ` Douglas Anderson
2026-02-23 15:46 ` Bjorn Andersson
2026-02-16 18:09 ` [PATCH v3 13/15] soc: qcom: smsm: " Douglas Anderson
` (4 subsequent siblings)
16 siblings, 1 reply; 24+ messages in thread
From: Douglas Anderson @ 2026-02-16 18:09 UTC (permalink / raw)
To: jassisinghbrar
Cc: Douglas Anderson, andersson, konradybcio, linux-arm-msm,
linux-kernel
As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
messages to use mbox_ring_doorbell().
This client only ever sent NULL messages, so the transition is
straightforward. We can remove the call to mbox_client_txdone(). The
call didn't do anything for NULL messages and it's now officially
documented not to be called for doorbells.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
This driver is used on my sc7180-trogdor Chromebook. While I haven't
stress tested with it, I can confirm that the system boots normally to
UI and can suspend/resume with this patch in place.
(no changes since v1)
drivers/soc/qcom/smp2p.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c
index cb515c2340c1..139307b66a47 100644
--- a/drivers/soc/qcom/smp2p.c
+++ b/drivers/soc/qcom/smp2p.c
@@ -169,12 +169,10 @@ static void qcom_smp2p_kick(struct qcom_smp2p *smp2p)
/* Make sure any updated data is written before the kick */
wmb();
- if (smp2p->mbox_chan) {
- mbox_send_message(smp2p->mbox_chan, NULL);
- mbox_client_txdone(smp2p->mbox_chan, 0);
- } else {
+ if (smp2p->mbox_chan)
+ mbox_ring_doorbell(smp2p->mbox_chan);
+ else
regmap_write(smp2p->ipc_regmap, smp2p->ipc_offset, BIT(smp2p->ipc_bit));
- }
}
static bool qcom_smp2p_check_ssr(struct qcom_smp2p *smp2p)
--
2.53.0.273.g2a3d683680-goog
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH v3 12/15] soc: qcom: smp2p: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 ` [PATCH v3 12/15] soc: qcom: smp2p: " Douglas Anderson
@ 2026-02-23 15:46 ` Bjorn Andersson
0 siblings, 0 replies; 24+ messages in thread
From: Bjorn Andersson @ 2026-02-23 15:46 UTC (permalink / raw)
To: Douglas Anderson; +Cc: jassisinghbrar, konradybcio, linux-arm-msm, linux-kernel
On Mon, Feb 16, 2026 at 10:09:49AM -0800, Douglas Anderson wrote:
> As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
> mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
> messages to use mbox_ring_doorbell().
>
> This client only ever sent NULL messages, so the transition is
> straightforward. We can remove the call to mbox_client_txdone(). The
> call didn't do anything for NULL messages and it's now officially
> documented not to be called for doorbells.
>
Acked-by: Bjorn Andersson <andersson@kernel.org>
Regards,
Bjorn
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> This driver is used on my sc7180-trogdor Chromebook. While I haven't
> stress tested with it, I can confirm that the system boots normally to
> UI and can suspend/resume with this patch in place.
>
> (no changes since v1)
>
> drivers/soc/qcom/smp2p.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c
> index cb515c2340c1..139307b66a47 100644
> --- a/drivers/soc/qcom/smp2p.c
> +++ b/drivers/soc/qcom/smp2p.c
> @@ -169,12 +169,10 @@ static void qcom_smp2p_kick(struct qcom_smp2p *smp2p)
> /* Make sure any updated data is written before the kick */
> wmb();
>
> - if (smp2p->mbox_chan) {
> - mbox_send_message(smp2p->mbox_chan, NULL);
> - mbox_client_txdone(smp2p->mbox_chan, 0);
> - } else {
> + if (smp2p->mbox_chan)
> + mbox_ring_doorbell(smp2p->mbox_chan);
> + else
> regmap_write(smp2p->ipc_regmap, smp2p->ipc_offset, BIT(smp2p->ipc_bit));
> - }
> }
>
> static bool qcom_smp2p_check_ssr(struct qcom_smp2p *smp2p)
> --
> 2.53.0.273.g2a3d683680-goog
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v3 13/15] soc: qcom: smsm: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
` (11 preceding siblings ...)
2026-02-16 18:09 ` [PATCH v3 12/15] soc: qcom: smp2p: " Douglas Anderson
@ 2026-02-16 18:09 ` Douglas Anderson
2026-02-23 15:46 ` Bjorn Andersson
2026-02-16 18:09 ` [PATCH v3 14/15] soc: ti: wkup_m3_ipc: " Douglas Anderson
` (3 subsequent siblings)
16 siblings, 1 reply; 24+ messages in thread
From: Douglas Anderson @ 2026-02-16 18:09 UTC (permalink / raw)
To: jassisinghbrar
Cc: Douglas Anderson, andersson, konradybcio, linux-arm-msm,
linux-kernel
As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
messages to use mbox_ring_doorbell().
This client only ever sent NULL messages, so the transition is
straightforward. We can remove the call to mbox_client_txdone(). The
call didn't do anything for NULL messages and it's now officially
documented not to be called for doorbells.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
(no changes since v1)
drivers/soc/qcom/smsm.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/soc/qcom/smsm.c b/drivers/soc/qcom/smsm.c
index 021e9d1f61dc..1e127678fd9c 100644
--- a/drivers/soc/qcom/smsm.c
+++ b/drivers/soc/qcom/smsm.c
@@ -182,14 +182,12 @@ static int smsm_update_bits(void *data, u32 mask, u32 value)
if (!(val & changes))
continue;
- if (hostp->mbox_chan) {
- mbox_send_message(hostp->mbox_chan, NULL);
- mbox_client_txdone(hostp->mbox_chan, 0);
- } else if (hostp->ipc_regmap) {
+ if (hostp->mbox_chan)
+ mbox_ring_doorbell(hostp->mbox_chan);
+ else if (hostp->ipc_regmap)
regmap_write(hostp->ipc_regmap,
hostp->ipc_offset,
BIT(hostp->ipc_bit));
- }
}
done:
--
2.53.0.273.g2a3d683680-goog
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH v3 13/15] soc: qcom: smsm: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 ` [PATCH v3 13/15] soc: qcom: smsm: " Douglas Anderson
@ 2026-02-23 15:46 ` Bjorn Andersson
0 siblings, 0 replies; 24+ messages in thread
From: Bjorn Andersson @ 2026-02-23 15:46 UTC (permalink / raw)
To: Douglas Anderson; +Cc: jassisinghbrar, konradybcio, linux-arm-msm, linux-kernel
On Mon, Feb 16, 2026 at 10:09:50AM -0800, Douglas Anderson wrote:
> As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
> mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
> messages to use mbox_ring_doorbell().
>
> This client only ever sent NULL messages, so the transition is
> straightforward. We can remove the call to mbox_client_txdone(). The
> call didn't do anything for NULL messages and it's now officially
> documented not to be called for doorbells.
>
Acked-by: Bjorn Andersson <andersson@kernel.org>
Regards,
Bjorn
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
>
> (no changes since v1)
>
> drivers/soc/qcom/smsm.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/soc/qcom/smsm.c b/drivers/soc/qcom/smsm.c
> index 021e9d1f61dc..1e127678fd9c 100644
> --- a/drivers/soc/qcom/smsm.c
> +++ b/drivers/soc/qcom/smsm.c
> @@ -182,14 +182,12 @@ static int smsm_update_bits(void *data, u32 mask, u32 value)
> if (!(val & changes))
> continue;
>
> - if (hostp->mbox_chan) {
> - mbox_send_message(hostp->mbox_chan, NULL);
> - mbox_client_txdone(hostp->mbox_chan, 0);
> - } else if (hostp->ipc_regmap) {
> + if (hostp->mbox_chan)
> + mbox_ring_doorbell(hostp->mbox_chan);
> + else if (hostp->ipc_regmap)
> regmap_write(hostp->ipc_regmap,
> hostp->ipc_offset,
> BIT(hostp->ipc_bit));
> - }
> }
>
> done:
> --
> 2.53.0.273.g2a3d683680-goog
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v3 14/15] soc: ti: wkup_m3_ipc: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
` (12 preceding siblings ...)
2026-02-16 18:09 ` [PATCH v3 13/15] soc: qcom: smsm: " Douglas Anderson
@ 2026-02-16 18:09 ` Douglas Anderson
2026-02-16 18:09 ` [PATCH v3 15/15] drivers: firmware: xilinx: " Douglas Anderson
` (2 subsequent siblings)
16 siblings, 0 replies; 24+ messages in thread
From: Douglas Anderson @ 2026-02-16 18:09 UTC (permalink / raw)
To: jassisinghbrar
Cc: Douglas Anderson, Santosh Shilimkar, linux-arm-kernel,
linux-kernel, nm
As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
messages to use mbox_ring_doorbell().
This client only ever sent NULL messages, so the transition is
straightforward. We can remove the call to mbox_client_txdone(). The
call didn't do anything for NULL messages and it's now officially
documented not to be called for doorbells.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
(no changes since v1)
drivers/soc/ti/wkup_m3_ipc.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c
index 5845fc652adc..9f74f2dfc217 100644
--- a/drivers/soc/ti/wkup_m3_ipc.c
+++ b/drivers/soc/ti/wkup_m3_ipc.c
@@ -328,9 +328,9 @@ static int wkup_m3_ping(struct wkup_m3_ipc *m3_ipc)
* the RX callback to avoid multiple interrupts being received
* by the CM3.
*/
- ret = mbox_send_message(m3_ipc->mbox, NULL);
+ ret = mbox_ring_doorbell(m3_ipc->mbox);
if (ret < 0) {
- dev_err(dev, "%s: mbox_send_message() failed: %d\n",
+ dev_err(dev, "%s: mbox_ring_doorbell() failed: %d\n",
__func__, ret);
return ret;
}
@@ -343,7 +343,6 @@ static int wkup_m3_ping(struct wkup_m3_ipc *m3_ipc)
return -EIO;
}
- mbox_client_txdone(m3_ipc->mbox, 0);
return 0;
}
@@ -358,14 +357,13 @@ static int wkup_m3_ping_noirq(struct wkup_m3_ipc *m3_ipc)
return -EIO;
}
- ret = mbox_send_message(m3_ipc->mbox, NULL);
+ ret = mbox_ring_doorbell(m3_ipc->mbox);
if (ret < 0) {
- dev_err(dev, "%s: mbox_send_message() failed: %d\n",
+ dev_err(dev, "%s: mbox_ring_doorbell() failed: %d\n",
__func__, ret);
return ret;
}
- mbox_client_txdone(m3_ipc->mbox, 0);
return 0;
}
--
2.53.0.273.g2a3d683680-goog
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH v3 15/15] drivers: firmware: xilinx: Use mbox_ring_doorbell() instead of NULL message
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
` (13 preceding siblings ...)
2026-02-16 18:09 ` [PATCH v3 14/15] soc: ti: wkup_m3_ipc: " Douglas Anderson
@ 2026-02-16 18:09 ` Douglas Anderson
2026-03-09 15:19 ` [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Doug Anderson
2026-03-11 0:16 ` Doug Anderson
16 siblings, 0 replies; 24+ messages in thread
From: Douglas Anderson @ 2026-02-16 18:09 UTC (permalink / raw)
To: jassisinghbrar
Cc: Douglas Anderson, jay.buddhabhatti, linux-arm-kernel,
linux-kernel, marco.crivellari, michal.simek
As per the patch ("mailbox: Deprecate NULL mbox messages; Introduce
mbox_ring_doorbell()"), we want to switch all users of NULL mailbox
messages to use mbox_ring_doorbell().
This client only ever sent NULL messages, so the transition is
straightforward. We can remove the call to mbox_client_txdone(). The
call didn't do anything for NULL messages and it's now officially
documented not to be called for doorbells.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
(no changes since v1)
drivers/soc/xilinx/zynqmp_power.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c
index 9085db1b480a..b4e751247a35 100644
--- a/drivers/soc/xilinx/zynqmp_power.c
+++ b/drivers/soc/xilinx/zynqmp_power.c
@@ -144,7 +144,7 @@ static void ipi_receive_callback(struct mbox_client *cl, void *data)
&zynqmp_pm_init_suspend_work->callback_work);
/* Send NULL message to mbox controller to ack the message */
- ret = mbox_send_message(rx_chan, NULL);
+ ret = mbox_ring_doorbell(rx_chan);
if (ret)
pr_err("IPI ack failed. Error %d\n", ret);
}
--
2.53.0.273.g2a3d683680-goog
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
` (14 preceding siblings ...)
2026-02-16 18:09 ` [PATCH v3 15/15] drivers: firmware: xilinx: " Douglas Anderson
@ 2026-03-09 15:19 ` Doug Anderson
2026-03-11 0:16 ` Doug Anderson
16 siblings, 0 replies; 24+ messages in thread
From: Doug Anderson @ 2026-03-09 15:19 UTC (permalink / raw)
To: jassisinghbrar
Cc: Frank.Li, Santosh Shilimkar, Sascha Hauer, andersson, arm-scmi,
cristian.marussi, daniel.baluta, festevam, imx, jay.buddhabhatti,
jonathanh, kernel, konradybcio, krzk, lenb, linux-acpi,
linux-arm-kernel, linux-arm-msm, linux-kernel, linux-remoteproc,
linux-tegra, lucaswei, marco.crivellari, mathieu.poirier,
michal.simek, nm, rafael, robh, shawn.guo, sudeep.holla, tglx,
thierry.reding
Hi Jassi,
On Mon, Feb 16, 2026 at 10:11 AM Douglas Anderson <dianders@chromium.org> wrote:
>
> As talked about in the first patch in this series, passing NULL as the
> 'mssg' argument to mbox_send_message() ends up causing confusion and
> quirky behavior inside the mailbox core. Despite this, there are a
> number of drivers that pass NULL.
>
> It is plausible that some of the drivers passing NULL may have been
> taking advantage of the quirks of the mailbox core. Specifically, they
> may have been taking advantage that calling "tx_done" wasn't truly
> necessary for NULL messages (it was a noop) or that NULL messages were
> passed onto the mailbox controller right away without queuing.
>
> This series introduces a new API call: mbox_ring_doorbell(). The new
> API call tries to mimic the specific quirks that were helpful in the
> old behavior and it's expected to be a nearly drop-in replacement.
>
> There are some subtle differences between the new call and the old
> behavior, but it's expected that all of these differences are only for
> cases where the old behavior made little sense. The description of the
> first patch details these differences.
>
> The series attempts to convert all in-tree users to stop passing NULL
> for mssg. As per above, there are some slight differences in behavior.
> If any of the patches are causing problems, they can safely be
> reverted while debugging the problems. Eventually, all code should be
> converted over to stop passing NULL mssg.
>
> Changes in v3:
> - Suggest mbox_ring_doorbell in the warning message
> - Updated patch description based on Cristian's response.
>
> Changes in v2:
> - Instead of just documenting NULL, introduce a new function
>
> Douglas Anderson (15):
> mailbox: Deprecate NULL mbox messages; Introduce mbox_ring_doorbell()
> ACPI: PCC: Use mbox_ring_doorbell() instead of NULL message
> firmware: arm_scmi: Use mbox_ring_doorbell() instead of NULL message
> firmware: imx-dsp: Use mbox_ring_doorbell() instead of NULL message
> firmware: tegra: bpmp: Use mbox_ring_doorbell() instead of NULL
> message
> irqchip/qcom-mpm: Use mbox_ring_doorbell() instead of NULL message
> remoteproc: xlnx: Use mbox_ring_doorbell() instead of NULL message
> rpmsg: qcom_glink_rpm: Use mbox_ring_doorbell() instead of NULL
> message
> rpmsg: glink: smem: Use mbox_ring_doorbell() instead of NULL message
> rpmsg: qcom_smd: Use mbox_ring_doorbell() instead of NULL message
> soc: qcom: aoss: Use mbox_ring_doorbell() instead of NULL message
> soc: qcom: smp2p: Use mbox_ring_doorbell() instead of NULL message
> soc: qcom: smsm: Use mbox_ring_doorbell() instead of NULL message
> soc: ti: wkup_m3_ipc: Use mbox_ring_doorbell() instead of NULL message
> drivers: firmware: xilinx: Use mbox_ring_doorbell() instead of NULL
> message
Just checking to see if there is any addional changes you need from me
on this series. It looks like it's -rc3 which is maybe an ideal time
for this series to get some linux-next bake time? A good number of the
patches in this series have Acks from maintainers so they could all go
in your tree, I think. For those that don't, I guess worst case they
just don't land right now and I can re-post them later. ...or if you
think they would be OK to pickup that would be cool too.
Thanks!
-Doug
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages
2026-02-16 18:09 [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Douglas Anderson
` (15 preceding siblings ...)
2026-03-09 15:19 ` [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages Doug Anderson
@ 2026-03-11 0:16 ` Doug Anderson
16 siblings, 0 replies; 24+ messages in thread
From: Doug Anderson @ 2026-03-11 0:16 UTC (permalink / raw)
To: jassisinghbrar
Cc: Frank.Li, Santosh Shilimkar, Sascha Hauer, andersson, arm-scmi,
cristian.marussi, daniel.baluta, festevam, imx, jay.buddhabhatti,
jonathanh, kernel, konradybcio, krzk, lenb, linux-acpi,
linux-arm-kernel, linux-arm-msm, linux-kernel, linux-remoteproc,
linux-tegra, lucaswei, marco.crivellari, mathieu.poirier,
michal.simek, nm, rafael, robh, shawn.guo, sudeep.holla, tglx,
thierry.reding
Hi,
On Mon, Feb 16, 2026 at 10:11 AM Douglas Anderson <dianders@chromium.org> wrote:
>
> As talked about in the first patch in this series, passing NULL as the
> 'mssg' argument to mbox_send_message() ends up causing confusion and
> quirky behavior inside the mailbox core. Despite this, there are a
> number of drivers that pass NULL.
>
> It is plausible that some of the drivers passing NULL may have been
> taking advantage of the quirks of the mailbox core. Specifically, they
> may have been taking advantage that calling "tx_done" wasn't truly
> necessary for NULL messages (it was a noop) or that NULL messages were
> passed onto the mailbox controller right away without queuing.
>
> This series introduces a new API call: mbox_ring_doorbell(). The new
> API call tries to mimic the specific quirks that were helpful in the
> old behavior and it's expected to be a nearly drop-in replacement.
>
> There are some subtle differences between the new call and the old
> behavior, but it's expected that all of these differences are only for
> cases where the old behavior made little sense. The description of the
> first patch details these differences.
>
> The series attempts to convert all in-tree users to stop passing NULL
> for mssg. As per above, there are some slight differences in behavior.
> If any of the patches are causing problems, they can safely be
> reverted while debugging the problems. Eventually, all code should be
> converted over to stop passing NULL mssg.
>
> Changes in v3:
> - Suggest mbox_ring_doorbell in the warning message
> - Updated patch description based on Cristian's response.
>
> Changes in v2:
> - Instead of just documenting NULL, introduce a new function
In case any mailbox client API users want to comment, Jassi has
proposed an alternative to this series:
https://lore.kernel.org/r/20260310234616.334498-1-jassisinghbrar@gmail.com/
Feel free to join the conversation over there. :-)
-Doug
^ permalink raw reply [flat|nested] 24+ messages in thread