Re: [PATCH v11 2/3] dmaengine: switchtec-dma: Implement hardware initialization and cleanup

Logan Gunthorpe
2025-12-23T18:42:46Z

On 2025-12-23 03:26, Vinod Koul wrote:
> On 19-12-25, 10:19, Logan Gunthorpe wrote:
>> On 2025-12-16 04:00, Vinod Koul wrote:
>>> This is bit interesting. Any reason why you choose double pointer here.
>>> If you take a look at other driver, they follow similar approach but
>>> dont use double pointer for this.
>>>
>>
>> The ring size has had to be quite large. It is currently set to 32K in
>> order to be able to get maximum performance in some work loads. While
>> each element is only 104 bytes, the total array is more than 3MB which
>> is too much for a single allocation. The PLX dma driver this is based on
>> does the same thing even though it's queue size is only 2048.
>
> Ring size is fine, the question is about use of a double pointer instead
> of a single pointer

Ah, I guess we could make the array part of switchtec_dma_chan, I can
make that change. It is a large allocation (256KB) either way.

>> I'm not sure what you are looking for, I couldn't find any explicit
>> quiesce function that is commonly used on teardown in other drivers.
>> Clearing the pdev pointer above and synchronizing the RCU should ensure
>> there are no other jobs in progress or tasklets running.
>>
>> Note: I have tested teardown while running dmatest and have not found
>> any issues.
>
> The tasklet can be schedule and then you free irq which creates a racy
> situation, so I always recommend to kill the tasklet after freeing the
> irq!
>

Ok, yes, I think it should be possible to move the tasklet_kill down
below the free_irq. I'll give it a try.

Logan