[PATCH 5/6] firmware: raspberrypi: Document memory barriers in property list path
From: Sander Speetjens
Date: Sat Nov 07 2026 - 12:00:05 EST
Add comments explaining the wmb() before the firmware transaction and
the rmb() before reading the response, as required by coding style.
Signed-off-by: Sander Speetjens <sander.speetjens@xxxxxxxxx>
---
drivers/firmware/raspberrypi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c
index d9a569a6dae7..57f21e4e65d6 100644
--- a/drivers/firmware/raspberrypi.c
+++ b/drivers/firmware/raspberrypi.c
@@ -110,10 +110,12 @@ int rpi_firmware_property_list(struct rpi_firmware *fw,
buf[1] = RPI_FIRMWARE_STATUS_REQUEST;
memcpy(&buf[2], data, tag_size);
buf[size / 4 - 1] = RPI_FIRMWARE_PROPERTY_END;
+ /* Make sure the writes to the buffer are visible to the firmware. */
wmb();
ret = rpi_firmware_transaction(fw, MBOX_CHAN_PROPERTY, bus_addr);
+ /* Make sure we see the firmware's response before reading it. */
rmb();
memcpy(data, &buf[2], tag_size);
if (ret == 0 && buf[1] != RPI_FIRMWARE_STATUS_SUCCESS) {
--
2.56.0