Re: [PATCH v5 4/7] firmware: samsung: acpm: Add memory barrier before advancing RX pointer
From: Arnd Bergmann
Date: Fri May 29 2026 - 07:46:39 EST
On Fri, May 29, 2026, at 13:20, Tudor Ambarus wrote:
> On 5/29/26 11:25 AM, Arnd Bergmann wrote:
>
> I missed the data dependency chain. I focused too much on the read
> part in __ioread32_copy() that I missed the RAM store implications
> in it. The RAM store is forced to wait for its SRAM load, and the
> writel is forced to wait for all the RAM stores. So the entire
> payload is guaranteed to be visible in memory RAM before the writel.
>
> Maybe I thought about the reordering of the final __raw_readl() loop
> iteration with the writel(). But the dma_wmb() -> __dma_wmb() ->
> dmb(oshst) from writel has a compiler barrier, so the compiler can't
> reorder the code. And given the ARM64 device memory accesses ordering,
> the ordering is protected.
Ok, thanks for checking and confirming my thoughts.
> My bad, sorry. We shall either drop or revert the patch. Please let
> me know if you prefer a revert.
I'll leave it up to Krzysztof, as he's already sent it to
soc@xxxxxxxxxxxxxxx as part of the 7.1 fixes, and I'd
like to send the rest to Linus soon.
Krzysztof, if you can send an updated pull request without
this patch (and maybe also without b4a38606991c ("firmware:
samsung: acpm: Fix dummy stubs to return ERR_PTR"), see
separate email), I'll just merge the other fixes and
send that off instead.
Arnd