Re: [PATCH v4 18/25] dmaengine: sdxi: Add context submission helper
From: Lynch, Nathan
Date: Tue Nov 17 2026 - 17:50:19 EST
On 11/13/2026 11:12 AM, Frank Li wrote:
> On Tue, Nov 03, 2026 at 08:49:59PM -0600, Nathan Lynch wrote:
>> +static inline void sdxi_desc_make_valid(struct sdxi_desc *desc)
>> +{
>> + u32 opcode = le32_to_cpu(desc->opcode);
>> +
>> + sdxi_desc_vl_expect(desc, 0);
>> + FIELD_MODIFY(SDXI_DSC_VL, &opcode, 1);
>> + /*
>> + * Once vl is set, no more modifications to the descriptor
>> + * payload are allowed. Ensure the vl update is ordered after
>> + * all other initialization of the descriptor.
>> + */
>> + dma_wmb();
>> + WRITE_ONCE(desc->opcode, cpu_to_le32(opcode));
>> +}
>> +
>> +static inline void sdxi_desc_set_fence(struct sdxi_desc *desc)
>> +{
>> + u32 opcode = le32_to_cpu(desc->opcode);
>> +
>> + sdxi_desc_vl_expect(desc, 0);
>> + FIELD_MODIFY(SDXI_DSC_FE, &opcode, 1);
>
> why no dma_wmb() here?
Because there are no ordering considerations until a descriptor is made
valid. All other descriptor initialization, including the fence bit's
value, must be visible to the SDXI implementation before it sees the
valid bit go to 1, after which software is not allowed to make any other
changes to the descriptor.