Re: [PATCH v3 6/6] dmaengine: plx_dma: don't invoke client callbacks with ring_lock held
From: Logan Gunthorpe
Date: Tue Nov 17 2026 - 17:46:41 EST
On 2026-11-17 13:31, Frank Li wrote:
> On Tue, Nov 17, 2026 at 10:51:35AM -0600, Logan Gunthorpe wrote:
>> @@ -166,22 +171,35 @@ static void plx_dma_process_desc(struct plx_dma_dev *plxdev)
>>
>> dma_cookie_complete(&desc->txd);
>> dma_descriptor_unmap(&desc->txd);
>> - dmaengine_desc_get_callback_invoke(&desc->txd, &res);
>> + dmaengine_desc_get_callback(&desc->txd, &cb);
>> desc->txd.callback = NULL;
>> desc->txd.callback_result = NULL;
>> -
>> plxdev->tail++;
>> +
>> + spin_unlock_bh(&plxdev->ring_lock);
>> + dmaengine_desc_callback_invoke(&cb, &res);
>
> Common method is slice to local complete queue in ring_lock. Then unlock
> ring_lock after while loop. Then invoke cb in complete queue.
The PLX driver has no software queue. The hardware queue is large enough
that having a software queue would have been wasted overhead. So the
virt-dma pattern doesn't apply here. I'd really rather avoid adding a
whole other software queue just to fix this issue that isn't that complex.
Logan