[PATCH v5 4/7] firmware: samsung: acpm: Add memory barrier before advancing RX pointer
Krzysztof Kozlowski
krzk at kernel.org
Fri May 29 05:10:11 PDT 2026
On 29/05/2026 13:44, Arnd Bergmann wrote:
> 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 at lists.linux.dev 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.
>
Yes, I will do that.
Best regards,
Krzysztof
More information about the linux-arm-kernel
mailing list