Re: [PATCH 12/23] dmaengine: sdxi: Add descriptor ring management
From: Lynch, Nathan
Date: Mon Apr 20 2026 - 18:43:09 EST
On 4/20/2026 3:32 AM, Frank Li wrote:
>> +
>> +static u64 sdxi_ring_state_load_ridx(struct sdxi_ring_state *rs)
>> +{
>> + lockdep_assert_held(&rs->lock);
>> + return le64_to_cpu(READ_ONCE(*rs->read_index_ptr));
>> +}
>> +
>> +static void sdxi_ring_state_store_widx(struct sdxi_ring_state *rs, u64 new_widx)
>> +{
>> + lockdep_assert_held(&rs->lock);
>> + *rs->write_index_ptr = cpu_to_le64(rs->write_index = new_widx);
>
> Does it need WRITE_ONCE() ? you load_ridx() use READ_ONCE. I just not sure
>
> suppose doorbell will drain write buffer, most likely it is okay without
> WRITE_ONCE()
The SDXI implementation is free to sample the write index before software
hits the doorbell, so I believe WRITE_ONCE() is required here, thanks.