Re: [PATCH v4 13/25] dmaengine: sdxi: Add descriptor ring management
From: Lynch, Nathan
Date: Tue Nov 17 2026 - 17:34:16 EST
On 11/13/2026 10:51 AM, Frank Li wrote:
> On Tue, Nov 03, 2026 at 08:49:54PM -0600, Nathan Lynch wrote:
>> @@ -72,6 +74,10 @@ static struct sdxi_cxt *sdxi_alloc_cxt(struct sdxi_dev *sdxi)
>>
>> cxt->sdxi = sdxi;
>>
>> + cxt->ring_state = kzalloc_obj(*cxt->ring_state, GFP_KERNEL);
>> + if (!cxt->ring_state)
>> + return NULL;
>> +
>> cxt->sq = sdxi_sq_alloc(sdxi, DEFAULT_DESC_RING_ENTRIES);
>> if (!cxt->sq)
>> return NULL;
>
> Is it possible embedded ring_state into sq or sq embedded ring state to
> alloc twice memory.
cxt->sq is a DMA-coherent allocation, so it shouldn't be combined with
ring_state.
Maybe the ring_state could be embedded in the context struct to avoid
the separate allocation though.