[PATCH v3 03/15] firmware: arm_scmi: Use mbox_ring_doorbell() instead of NULL message
Douglas Anderson
dianders at chromium.org
Mon Feb 16 10:09:40 PST 2026
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 at arm.com>
Signed-off-by: Douglas Anderson <dianders at 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
More information about the linux-arm-kernel
mailing list