[PATCH v3 4/5] firmware: raspberrypi: Document memory barriers in property list path

From: Sander Speetjens

Date: Tue Nov 10 2026 - 11:59:34 EST


Add comments explaining the wmb() before the firmware transaction and
the rmb() before reading the response, as required by coding style.

Reviewed-by: Manuel Ebner <manuelebnerli@xxxxxxxxxxx>
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 04163c3f385d..ef3326d5cf30 100644
--- a/drivers/firmware/raspberrypi.c
+++ b/drivers/firmware/raspberrypi.c
@@ -111,10 +111,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