Re: [PATCH] dmaengine: xilinx_dma: Fix CPU stall in xilinx_dma_poll_timeout
From: Alex Bereza
Date: Wed Apr 01 2026 - 07:52:05 EST
Hi Suraj,
On Wed Apr 1, 2026 at 1:15 PM CEST, Suraj Gupta wrote:
>>>> Hi, in addition to this patch I also have a question: what is the point
>>>> of atomically polling for the HALTED or IDLE bit in the stop_transfer
>>>> functions? Does device_terminate_all really need to be callable from
>>>> atomic context? If not, one could switch to polling non-atomically and
>>>> avoid burning CPU cycles.
>>>>
>>>
>>> dmaengine_terminate_async(), which directly calls device_terminate_all
>>> can be called from atomic context.
>>
>> Right, thanks! Just for my understanding: I still think there is potential for improvement, because
>> from my understanding it would be beneficial to do the waiting for the bits in the status register
>> and the freeing of descriptors in xilinx_dma_synchronize. Do I understand correctly that this is
>> currently not possible due to how the DMA engine API is structured? To make this possible I think
>> the deprecated dmaengine_terminate_all would have to be removed and all users of this API would have
>> to be adapted accordingly, correct? So this would be a patch of much larger scope than xilinx_dma
>> driver alone.
>
> Yes, your understanding of xilinx_dma_synchronize()and proposed changes
> looks correct.
Thank you for the feedback on this. It is really helpful since I'm quite new to
writing patches for the kernel. I was thinking about whether I can improve the
xilinx_dma driver in this regard, but given the large scope of changing the
whole DMA engine API and all its users unfortunately this task is too big for
me.
BR
Alex