Re: [PATCH 1/1] dmaengine: virt-dma: convert tasklet to BH workqueue for callback invocation

From: Andy Shevchenko
Date: Fri Jun 13 2025 - 12:34:25 EST


On Fri, Jun 13, 2025 at 02:34:44PM +0000, Alexander Kochetkov wrote:
> Currently DMA callbacks are called from tasklet. However the tasklet is
> marked deprecated and must be replaced by BH workqueue. Tasklet callbacks
> are executed either in the Soft IRQ context or from ksoftirqd thread. BH
> workqueue work items are executed in the BH context. Changing tasklet to
> BH workqueue improved DMA callback latencies.
>
> The commit changes virt-dma driver and all of its users:
> - tasklet is replaced to work_struct, tasklet callback updated accordingly
> - kill_tasklet() is replaced to cancel_work_sync()
> - added include of linux/interrupt.h where necessary
>
> Tested on Pine64 (Allwinner A64 ARMv8) with sun6i-dma driver. All other
> drivers are changed similarly and tested for compilation.

...

> --- a/drivers/dma/amd/qdma/qdma.c
> +++ b/drivers/dma/amd/qdma/qdma.c
> @@ -13,6 +13,7 @@
> #include <linux/platform_device.h>
> #include <linux/platform_data/amd_qdma.h>
> #include <linux/regmap.h>
> +#include <linux/interrupt.h>

It seems it was ordered. Please, preserve the order.
It not, try to squeeze to have longest possible ordered chain
(it can be interleaved with something unordered, just look at
the big picture).

(Same applies to other similar cases)

...

What about the driver(s) that use threaded IRQ instead?
Do you plan to convert them as well?

I am talking about current users of virt-dma that do not use tasklets.

--
With Best Regards,
Andy Shevchenko