Skip to content

mailbox: Stop sending NULL mailbox messages

Douglas Anderson arm-scmi imx linux-acpi linux-arm-kernel linux-arm-msm linux-remoteproc linux-tegra lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest15 patches 8 repliesIn review
  2. v215 patches 8 repliesSuperseded

Changes in v3 from the cover letter

- Suggest mbox_ring_doorbell in the warning message
- Updated patch description based on Cristian's response.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15mailbox: Deprecate NULL mbox messages; Introduce mbox_ring_doorbell()drivers/mailbox/mailbox.c include/linux/mailbox_client.h include/linux/mailbox_controller.h+85 -22 replies
2/15ACPI: PCC: Use mbox_ring_doorbell() instead of NULL messagedrivers/acpi/acpi_pcc.c+1 -30 replies
3/15firmware: arm_scmi: Use mbox_ring_doorbell() instead of NULL messagedrivers/firmware/arm_scmi/transports/mailbox.c+1 -70 replies
4/15firmware: imx-dsp: Use mbox_ring_doorbell() instead of NULL messagedrivers/firmware/imx/imx-dsp.c+1 -10 replies
5/15firmware: tegra: bpmp: Use mbox_ring_doorbell() instead of NULL messagedrivers/firmware/tegra/bpmp-tegra186.c+1 -30 replies
6/15irqchip/qcom-mpm: Use mbox_ring_doorbell() instead of NULL messagedrivers/irqchip/irq-qcom-mpm.c+1 -11 reply
7/15remoteproc: xlnx: Use mbox_ring_doorbell() instead of NULL messagedrivers/remoteproc/xlnx_r5_remoteproc.c+1 -10 replies
8/15rpmsg: qcom_glink_rpm: Use mbox_ring_doorbell() instead of NULL messagedrivers/rpmsg/qcom_glink_rpm.c+1 -20 replies
9/15rpmsg: glink: smem: Use mbox_ring_doorbell() instead of NULL messagedrivers/rpmsg/qcom_glink_smem.c+1 -20 replies
10/15rpmsg: qcom_smd: Use mbox_ring_doorbell() instead of NULL messagedrivers/rpmsg/qcom_smd.c+3 -100 replies
11/15soc: qcom: aoss: Use mbox_ring_doorbell() instead of NULL messagedrivers/soc/qcom/qcom_aoss.c+1 -21 reply
12/15soc: qcom: smp2p: Use mbox_ring_doorbell() instead of NULL messagedrivers/soc/qcom/smp2p.c+3 -51 reply
13/15soc: qcom: smsm: Use mbox_ring_doorbell() instead of NULL messagedrivers/soc/qcom/smsm.c+3 -51 reply
14/15soc: ti: wkup_m3_ipc: Use mbox_ring_doorbell() instead of NULL messagedrivers/soc/ti/wkup_m3_ipc.c+4 -60 replies
15/15drivers: firmware: xilinx: Use mbox_ring_doorbell() instead of NULL messagedrivers/soc/xilinx/zynqmp_power.c+1 -10 replies

Reviews trailers per patch

10 of 15 patches have a Reviewed-by or Acked-by.

PatchBjorn AnderssonCristian MarussiDaniel BalutaThomas Gleixner
1/15R-b
2/15
3/15T-b
4/15R-b
5/15
6/15A-b
7/15A-b
8/15A-b
9/15A-b
10/15A-b
11/15A-b
12/15A-b
13/15A-b
14/15
15/15

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/15] mailbox: Stop sending NULL mailbox messages

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

 drivers/acpi/acpi_pcc.c                       |  4 +-
 .../firmware/arm_scmi/transports/mailbox.c    |  8 +-
 drivers/firmware/imx/imx-dsp.c                |  2 +-
 drivers/firmware/tegra/bpmp-tegra186.c        |  4 +-
 drivers/irqchip/irq-qcom-mpm.c                |  2 +-
 drivers/mailbox/mailbox.c                     | 82 ++++++++++++++++++-
 drivers/remoteproc/xlnx_r5_remoteproc.c       |  2 +-
 drivers/rpmsg/qcom_glink_rpm.c                |  3 +-
 drivers/rpmsg/qcom_glink_smem.c               |  3 +-
 drivers/rpmsg/qcom_smd.c                      | 13 +--
 drivers/soc/qcom/qcom_aoss.c                  |  3 +-
 drivers/soc/qcom/smp2p.c                      |  8 +-
 drivers/soc/qcom/smsm.c                       |  8 +-
 drivers/soc/ti/wkup_m3_ipc.c                  | 10 +--
 drivers/soc/xilinx/zynqmp_power.c             |  2 +-
 include/linux/mailbox_client.h                |  1 +
 include/linux/mailbox_controller.h            |  4 +-
 17 files changed, 108 insertions(+), 51 deletions(-)
Signature · 1 line
2.53.0.273.g2a3d683680-goog