dmaengine: virt-dma: convert tasklet to BH workqueue for callback invocation
Subsystems (31)
v2 cover dmaengine: virt-dma: convert tasklet to BH workqueue for callback invocation
Hello!
Here is v2.
I've updated patch accoding to recomendations from Andy Shevchenko:
- where possible I placed #include <linux/interrupt.h> in correct position to keep include list ordered.
Also I provide patch file for Kconfig files. It allows to compile most of virt-dma users on unsupported architecture. I've used ARM64 configuration to compile kernel.
One driver (qcom_adm.o) is impossible to compile on ARM64, and that intended behaviour. It has condition 'depends on (ARCH_QCOM || COMPILE_TEST) && !PHYS_ADDR_T_64BIT' preventing from building it on 64-bit architectures. I've checked it doesn't touch virt-dma fields directly and contains #include <linux/interrupt.h> already. It looks that it doesn't need any changes. Anyway, I tried to compile it and only get the following errors:
/kernel-source/drivers/dma/qcom/qcom_adm.c: In function 'adm_process_fc_descriptors':
/kernel-source/drivers/dma/qcom/qcom_adm.c:245:21: error: assignment to 'u32 *' {aka 'unsigned int *'} from incompatible pointer type 'phys_addr_t *'
{aka 'long long unsigned int *'} [-Werror=incompatible-pointer-types]
245 | src = &achan->slave.src_addr;
| ^
/kernel-source/drivers/dma/qcom/qcom_adm.c:251:21: error: assignment to 'u32 *' {aka 'unsigned int *'} from incompatible pointer type 'phys_addr_t *'
{aka 'long long unsigned int *'} [-Werror=incompatible-pointer-types]
251 | dst = &achan->slave.dst_addr;
| ^
/kernel-source/drivers/dma/qcom/qcom_adm.c: In function 'adm_process_non_fc_descriptors':
/kernel-source/drivers/dma/qcom/qcom_adm.c:309:21: error: assignment to 'u32 *' {aka 'unsigned int *'} from incompatible pointer type 'phys_addr_t *'
{aka 'long long unsigned int *'} [-Werror=incompatible-pointer-types]
309 | src = &achan->slave.src_addr;
| ^
/kernel-source/drivers/dma/qcom/qcom_adm.c:313:21: error: assignment to 'u32 *' {aka 'unsigned int *'} from incompatible pointer type 'phys_addr_t *'
{aka 'long long unsigned int *'} [-Werror=incompatible-pointer-types]
313 | dst = &achan->slave.dst_addr;
| ^
/kernel-source/drivers/dma/qcom/qcom_adm.c: In function 'adm_dma_probe':
/kernel-source/drivers/dma/qcom/qcom_adm.c:77:41: warning: conversion from 'long unsigned int' to 'u32' {aka 'unsigned int'} changes value from '18446744072371568648' to '2956984328' [-Woverflow]
77 | #define ADM_CI_RANGE_START(x) ((x) << 16)
/kernel-source/drivers/dma/qcom/qcom_adm.c:848:16: note: in expansion of macro 'ADM_CI_RANGE_START'
848 | writel(ADM_CI_RANGE_START(0x40) | ADM_CI_RANGE_END(0xb0) |
In order to detect all users of virt-dma, I did following.
I got all include files containing 'virt-dma.h' or 'struct virt_dma_chan'.
$ git grep -l -e virt-dma.h -e 'struct virt_dma_chan' -- '*.h' drivers/dma/amd/ae4dma/ae4dma.h drivers/dma/amd/ptdma/ptdma.h drivers/dma/amd/qdma/qdma.h drivers/dma/dw-axi-dmac/dw-axi-dmac.h drivers/dma/dw-edma/dw-edma-core.h drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.h drivers/dma/fsl-edma-common.h drivers/dma/hsu/hsu.h drivers/dma/idma64.h drivers/dma/sf-pdma/sf-pdma.h drivers/dma/st_fdma.h drivers/dma/virt-dma.h
I got all include files containing all include files found in step 1:
$ git grep -l -e ae4dma.h -e ptdma.h -e qdma.h -e dw-axi-dmac.h \
-e dw-edma-core.h -e dpaa2-qdma.h -e fsl-edma-common.h \
-e hsu.h -e idma64.h -e sf-pdma.h -e st_fdma.h -e virt-dma.h \
-e 'struct virt_dma_chan' -- '*.h'
drivers/dma/amd/ae4dma/ae4dma.h
drivers/dma/amd/ptdma/ptdma.h
drivers/dma/amd/qdma/qdma.h
drivers/dma/dw-axi-dmac/dw-axi-dmac.h
drivers/dma/dw-edma/dw-edma-core.h
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.h
drivers/dma/fsl-edma-common.h
drivers/dma/hsu/hsu.h
drivers/dma/idma64.h
drivers/dma/sf-pdma/sf-pdma.h
drivers/dma/st_fdma.h
drivers/dma/virt-dma.h
drivers/net/ethernet/mediatek/mtk_eth_soc.h
include/linux/dma/hsu.hAfter that I got all users of virt dma:
$ git grep -l -e ae4dma.h -e ptdma.h -e qdma.h -e dw-axi-dmac.h \
-e dw-edma-core.h -e dpaa2-qdma.h -e fsl-edma-common.h \
-e hsu.h -e idma64.h -e sf-pdma.h -e st_fdma.h -e virt-dma.h \
-e mtk_eth_soc.h -e 'struct virt_dma_chan' -- '*.c'drivers/dma/amba-pl08x.cdrivers/dma/amd/ae4dma/ae4dma-dev.cdrivers/dma/amd/ae4dma/ae4dma-pci.cdrivers/dma/amd/ptdma/ptdma-debugfs.cdrivers/dma/amd/ptdma/ptdma-dev.cdrivers/dma/amd/ptdma/ptdma-dmaengine.cdrivers/dma/amd/ptdma/ptdma-pci.cdrivers/dma/amd/qdma/qdma-comm-regs.cdrivers/dma/amd/qdma/qdma.cdrivers/dma/arm-dma350.cdrivers/dma/at_hdmac.cdrivers/dma/bcm2835-dma.cdrivers/dma/dma-axi-dmac.cdrivers/dma/dma-jz4780.cdrivers/dma/dw-axi-dmac/dw-axi-dmac-platform.cdrivers/dma/dw-edma/dw-edma-core.cdrivers/dma/dw-edma/dw-edma-pcie.cdrivers/dma/dw-edma/dw-edma-v0-core.cdrivers/dma/dw-edma/dw-edma-v0-debugfs.cdrivers/dma/dw-edma/dw-hdma-v0-core.cdrivers/dma/dw-edma/dw-hdma-v0-debugfs.cdrivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.cdrivers/dma/fsl-edma-common.cdrivers/dma/fsl-edma-main.cdrivers/dma/fsl-edma-trace.cdrivers/dma/fsl-qdma.cdrivers/dma/hisi_dma.cdrivers/dma/hsu/hsu.cdrivers/dma/hsu/pci.cdrivers/dma/idma64.cdrivers/dma/img-mdc-dma.cdrivers/dma/imx-sdma.cdrivers/dma/k3dma.cdrivers/dma/lgm/lgm-dma.cdrivers/dma/loongson1-apb-dma.cdrivers/dma/loongson2-apb-dma.cdrivers/dma/mcf-edma-main.cdrivers/dma/mediatek/mtk-cqdma.cdrivers/dma/mediatek/mtk-hsdma.cdrivers/dma/mediatek/mtk-uart-apdma.cdrivers/dma/milbeaut-hdmac.cdrivers/dma/milbeaut-xdmac.cdrivers/dma/moxart-dma.cdrivers/dma/owl-dma.cdrivers/dma/pxa_dma.cdrivers/dma/qcom/bam_dma.cdrivers/dma/qcom/gpi.cdrivers/dma/qcom/qcom_adm.cdrivers/dma/sa11x0-dma.cdrivers/dma/sf-pdma/sf-pdma.cdrivers/dma/sh/rz-dmac.cdrivers/dma/sh/usb-dmac.cdrivers/dma/sprd-dma.cdrivers/dma/st_fdma.cdrivers/dma/stm32/stm32-dma.cdrivers/dma/stm32/stm32-dma3.cdrivers/dma/stm32/stm32-mdma.cdrivers/dma/sun4i-dma.cdrivers/dma/sun6i-dma.cdrivers/dma/tegra186-gpc-dma.cdrivers/dma/tegra210-adma.cdrivers/dma/ti/edma.cdrivers/dma/ti/k3-udma.cdrivers/dma/ti/omap-dma.cdrivers/dma/uniphier-mdmac.cdrivers/dma/uniphier-xdmac.cdrivers/dma/virt-dma.cdrivers/dma/xilinx/xdma.cdrivers/dma/xilinx/xilinx_dpdma.cdrivers/mfd/intel-lpss.cdrivers/net/ethernet/airoha/airoha_eth.cdrivers/net/ethernet/mediatek/mtk_eth_path.cdrivers/net/ethernet/mediatek/mtk_eth_soc.cdrivers/net/ethernet/mediatek/mtk_ppe.cdrivers/net/ethernet/mediatek/mtk_ppe_debugfs.cdrivers/net/ethernet/mediatek/mtk_ppe_offload.cdrivers/net/ethernet/mediatek/mtk_wed.cdrivers/pci/controller/pcie-xilinx-dma-pl.cdrivers/tty/serial/8250/8250_mid.c
After that I compiled kernel with following options:CONFIG_COMPILE_TEST=yCONFIG_FORCE_PCI=yCONFIG_PCI=yCONFIG_PCI_MSI=yCONFIG_AMD_QDMA=yCONFIG_AMD_PTDMA=yCONFIG_DW_AXI_DMAC=yCONFIG_DW_EDMA=yCONFIG_DW_EDMA_PCIE=yCONFIG_INTEL_LDMA=yCONFIG_SERIAL_8250=yCONFIG_SERIAL_8250_MT6577=yCONFIG_MTK_HSDMA=yCONFIG_MTK_CQDMA=yCONFIG_MTK_UART_APDMA=y
# CONFIG_QCOM_ADM=y - error: assignment to 'u32 *' {aka 'unsigned int *'} from incompatible pointer type 'phys_addr_t *' CONFIG_QCOM_GPI_DMA=yCONFIG_QCOM_BAM_DMA=yCONFIG_SF_PDMA=yCONFIG_STM32_DMA=yCONFIG_STM32_MDMA=yCONFIG_STM32_DMA3=yCONFIG_DMA_OMAP=yCONFIG_TI_EDMA=yCONFIG_TI_MESSAGE_MANAGER=yCONFIG_TI_SCI_PROTOCOL=yCONFIG_TI_SCI_INTA_IRQCHIP=yCONFIG_TI_K3_UDMA=yCONFIG_XILINX_ZYNQMP_DPDMA=yCONFIG_XILINX_XDMA=yCONFIG_AMBA_PL08X=yCONFIG_ARM_DMA350=yCONFIG_FSL_EDMA=yCONFIG_FSL_QDMA=yCONFIG_MCF_EDMA=yCONFIG_INTEL_IDMA64=yCONFIG_DMA_SUN6I=yCONFIG_DMA_SUN4I=yCONFIG_AT_HDMAC=yCONFIG_REMOTEPROC=yCONFIG_ST_FDMA=yCONFIG_K3_DMA=yCONFIG_DMA_SA11X0=yCONFIG_AXI_DMAC=yCONFIG_IMG_MDC_DMA=yCONFIG_UNIPHIER_XDMAC=yCONFIG_UNIPHIER_MDMAC=yCONFIG_LOONGSON1_APB_DMA=yCONFIG_LOONGSON2_APB_DMA=yCONFIG_DMA_BCM2835=yCONFIG_TEGRA210_ADMA=yCONFIG_TEGRA186_GPC_DMA=yCONFIG_MOXART_DMA=yCONFIG_DMA_JZ4780=yCONFIG_IMX_SDMA=yCONFIG_OWL_DMA=yCONFIG_SPRD_DMA=yCONFIG_MILBEAUT_XDMAC=yCONFIG_MILBEAUT_HDMAC=yCONFIG_HISI_DMA=yCONFIG_FSL_MC_BUS=yCONFIG_FSL_MC_DPIO=yCONFIG_FSL_DPAA2_QDMA=yCONFIG_RZ_DMAC=yCONFIG_RENESAS_USB_DMAC=yCONFIG_PXA_DMA=yCONFIG_HSU_DMA=yCONFIG_HSU_DMA_PCI=yCONFIG_MFD_INTEL_LPSS=yCONFIG_NET_AIROHA=yCONFIG_NET_VENDOR_MEDIATEK=yCONFIG_NET_MEDIATEK_SOC=yCONFIG_NET_MEDIATEK_SOC_WED=yCONFIG_PCIE_XILINX_DMA_PL=yCONFIG_SERIAL_8250_MID=yCONFIG_AMD_AE4DMA=y
After that I've used following script to check compilation (it used file list obtained in previous step):
#!/bin/bash
for f in cat files; do
f=`echo $f | sed 's/.c$/.o/'`
test -f $f && echo $f: ok || echo $f: No such file or directorydone
It produced following output:
$ ./check drivers/dma/amba-pl08x.o: ok drivers/dma/amd/ae4dma/ae4dma-dev.o: ok drivers/dma/amd/ae4dma/ae4dma-pci.o: ok drivers/dma/amd/ptdma/ptdma-debugfs.o: ok drivers/dma/amd/ptdma/ptdma-dev.o: ok drivers/dma/amd/ptdma/ptdma-dmaengine.o: ok drivers/dma/amd/ptdma/ptdma-pci.o: ok drivers/dma/amd/qdma/qdma-comm-regs.o: ok drivers/dma/amd/qdma/qdma.o: ok drivers/dma/arm-dma350.o: ok drivers/dma/at_hdmac.o: ok drivers/dma/bcm2835-dma.o: ok drivers/dma/dma-axi-dmac.o: ok drivers/dma/dma-jz4780.o: ok drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.o: ok drivers/dma/dw-edma/dw-edma-core.o: ok drivers/dma/dw-edma/dw-edma-pcie.o: ok drivers/dma/dw-edma/dw-edma-v0-core.o: ok drivers/dma/dw-edma/dw-edma-v0-debugfs.o: ok drivers/dma/dw-edma/dw-hdma-v0-core.o: ok drivers/dma/dw-edma/dw-hdma-v0-debugfs.o: ok drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.o: ok drivers/dma/fsl-edma-common.o: ok drivers/dma/fsl-edma-main.o: ok drivers/dma/fsl-edma-trace.o: ok drivers/dma/fsl-qdma.o: ok drivers/dma/hisi_dma.o: ok drivers/dma/hsu/hsu.o: ok drivers/dma/hsu/pci.o: ok drivers/dma/idma64.o: ok drivers/dma/img-mdc-dma.o: ok drivers/dma/imx-sdma.o: ok drivers/dma/k3dma.o: ok drivers/dma/lgm/lgm-dma.o: ok drivers/dma/loongson1-apb-dma.o: ok drivers/dma/loongson2-apb-dma.o: ok drivers/dma/mcf-edma-main.o: ok drivers/dma/mediatek/mtk-cqdma.o: ok drivers/dma/mediatek/mtk-hsdma.o: ok drivers/dma/mediatek/mtk-uart-apdma.o: ok drivers/dma/milbeaut-hdmac.o: ok drivers/dma/milbeaut-xdmac.o: ok drivers/dma/moxart-dma.o: ok drivers/dma/owl-dma.o: ok drivers/dma/pxa_dma.o: ok drivers/dma/qcom/bam_dma.o: ok drivers/dma/qcom/gpi.o: ok drivers/dma/qcom/qcom_adm.o: No such file or directory drivers/dma/sa11x0-dma.o: ok drivers/dma/sf-pdma/sf-pdma.o: ok drivers/dma/sh/rz-dmac.o: ok drivers/dma/sh/usb-dmac.o: ok drivers/dma/sprd-dma.o: ok drivers/dma/st_fdma.o: ok drivers/dma/stm32/stm32-dma.o: ok drivers/dma/stm32/stm32-dma3.o: ok drivers/dma/stm32/stm32-mdma.o: ok drivers/dma/sun4i-dma.o: ok drivers/dma/sun6i-dma.o: ok drivers/dma/tegra186-gpc-dma.o: ok drivers/dma/tegra210-adma.o: ok drivers/dma/ti/edma.o: ok drivers/dma/ti/k3-udma.o: ok drivers/dma/ti/omap-dma.o: ok drivers/dma/uniphier-mdmac.o: ok drivers/dma/uniphier-xdmac.o: ok drivers/dma/virt-dma.o: ok drivers/dma/xilinx/xdma.o: ok drivers/dma/xilinx/xilinx_dpdma.o: ok drivers/mfd/intel-lpss.o: ok drivers/net/ethernet/airoha/airoha_eth.o: ok drivers/net/ethernet/mediatek/mtk_eth_path.o: ok drivers/net/ethernet/mediatek/mtk_eth_soc.o: ok drivers/net/ethernet/mediatek/mtk_ppe.o: ok drivers/net/ethernet/mediatek/mtk_ppe_debugfs.o: ok drivers/net/ethernet/mediatek/mtk_ppe_offload.o: ok drivers/net/ethernet/mediatek/mtk_wed.o: ok drivers/pci/controller/pcie-xilinx-dma-pl.o: ok drivers/tty/serial/8250/8250_mid.o: ok
Alexander Kochetkov (2):
dmaengine: virt-dma: convert tasklet to BH workqueue for callback
invocation
Allow compile virt-dma users on ARM64 platform
drivers/dma/Kconfig | 22 +++++++++---------- drivers/dma/amd/Kconfig | 4 ++-- drivers/dma/amd/qdma/qdma.c | 1 + drivers/dma/arm-dma350.c | 1 + drivers/dma/bcm2835-dma.c | 2 +- drivers/dma/dma-axi-dmac.c | 8 +++---- drivers/dma/dma-jz4780.c | 2 +- .../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 2 +- drivers/dma/dw-edma/dw-edma-core.c | 2 +- drivers/dma/fsl-edma-common.c | 2 +- drivers/dma/fsl-edma-common.h | 1 + drivers/dma/fsl-qdma.c | 3 ++- drivers/dma/hisi_dma.c | 2 +- drivers/dma/hsu/Kconfig | 4 ++-- drivers/dma/hsu/hsu.c | 2 +- drivers/dma/idma64.c | 3 ++- drivers/dma/img-mdc-dma.c | 2 +- drivers/dma/imx-sdma.c | 2 +- drivers/dma/k3dma.c | 2 +- drivers/dma/loongson1-apb-dma.c | 2 +- drivers/dma/mediatek/mtk-cqdma.c | 2 +- drivers/dma/mediatek/mtk-hsdma.c | 3 ++- drivers/dma/mediatek/mtk-uart-apdma.c | 4 ++-- drivers/dma/owl-dma.c | 2 +- drivers/dma/pxa_dma.c | 2 +- drivers/dma/qcom/Kconfig | 6 ++--- drivers/dma/qcom/bam_dma.c | 4 ++-- drivers/dma/qcom/gpi.c | 1 + drivers/dma/qcom/qcom_adm.c | 2 +- drivers/dma/sa11x0-dma.c | 2 +- drivers/dma/sf-pdma/sf-pdma.c | 3 ++- drivers/dma/sprd-dma.c | 2 +- drivers/dma/st_fdma.c | 2 +- drivers/dma/stm32/stm32-dma.c | 1 + drivers/dma/stm32/stm32-dma3.c | 1 + drivers/dma/stm32/stm32-mdma.c | 1 + drivers/dma/sun6i-dma.c | 2 +- drivers/dma/tegra186-gpc-dma.c | 2 +- drivers/dma/tegra210-adma.c | 3 ++- drivers/dma/ti/Kconfig | 2 +- drivers/dma/ti/edma.c | 2 +- drivers/dma/ti/k3-udma.c | 10 ++++----- drivers/dma/ti/omap-dma.c | 2 +- drivers/dma/uniphier-xdmac.c | 1 + drivers/dma/virt-dma.c | 8 +++---- drivers/dma/virt-dma.h | 10 ++++----- drivers/mfd/Kconfig | 2 +- 47 files changed, 82 insertions(+), 69 deletions(-)
Signature · 1 line
2.43.0
PATCH v2 1/2 dmaengine: virt-dma: convert tasklet to BH workqueue for callback invocation
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.
--- drivers/dma/amd/qdma/qdma.c | 1 + drivers/dma/arm-dma350.c | 1 + drivers/dma/bcm2835-dma.c | 2 +- drivers/dma/dma-axi-dmac.c | 8 ++++---- drivers/dma/dma-jz4780.c | 2 +- drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 2 +- drivers/dma/dw-edma/dw-edma-core.c | 2 +- drivers/dma/fsl-edma-common.c | 2 +- drivers/dma/fsl-edma-common.h | 1 + drivers/dma/fsl-qdma.c | 3 ++- drivers/dma/hisi_dma.c | 2 +- drivers/dma/hsu/hsu.c | 2 +- drivers/dma/idma64.c | 3 ++- drivers/dma/img-mdc-dma.c | 2 +- drivers/dma/imx-sdma.c | 2 +- drivers/dma/k3dma.c | 2 +- drivers/dma/loongson1-apb-dma.c | 2 +- drivers/dma/mediatek/mtk-cqdma.c | 2 +- drivers/dma/mediatek/mtk-hsdma.c | 3 ++- drivers/dma/mediatek/mtk-uart-apdma.c | 4 ++-- drivers/dma/owl-dma.c | 2 +- drivers/dma/pxa_dma.c | 2 +- drivers/dma/qcom/bam_dma.c | 4 ++-- drivers/dma/qcom/gpi.c | 1 + drivers/dma/qcom/qcom_adm.c | 2 +- drivers/dma/sa11x0-dma.c | 2 +- drivers/dma/sf-pdma/sf-pdma.c | 3 ++- drivers/dma/sprd-dma.c | 2 +- drivers/dma/st_fdma.c | 2 +- drivers/dma/stm32/stm32-dma.c | 1 + drivers/dma/stm32/stm32-dma3.c | 1 + drivers/dma/stm32/stm32-mdma.c | 1 + drivers/dma/sun6i-dma.c | 2 +- drivers/dma/tegra186-gpc-dma.c | 2 +- drivers/dma/tegra210-adma.c | 3 ++- drivers/dma/ti/edma.c | 2 +- drivers/dma/ti/k3-udma.c | 10 +++++----- drivers/dma/ti/omap-dma.c | 2 +- drivers/dma/uniphier-xdmac.c | 1 + drivers/dma/virt-dma.c | 8 ++++---- drivers/dma/virt-dma.h | 10 +++++----- 41 files changed, 62 insertions(+), 49 deletions(-)
drivers/dma/amd/qdma/qdma.c +1 -0
@@ -8,6 +8,7 @@#include <linux/bitops.h> #include <linux/dmaengine.h> #include <linux/dma-mapping.h> +#include <linux/interrupt.h> #include <linux/module.h> #include <linux/mod_devicetable.h> #include <linux/platform_device.h>
drivers/dma/arm-dma350.c +1 -0
@@ -5,6 +5,7 @@#include <linux/bitfield.h> #include <linux/dmaengine.h> #include <linux/dma-mapping.h> +#include <linux/interrupt.h> #include <linux/io.h> #include <linux/of.h> #include <linux/module.h>
drivers/dma/bcm2835-dma.c +1 -1
@@ -846,7 +846,7 @@ static void bcm2835_dma_free(struct bcm2835_dmadev *od)list_for_each_entry_safe (c, next, &od->ddev.channels, vc.chan.device_node) {list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work); } dma_unmap_page_attrs(od->ddev.dev, od->zero_page, PAGE_SIZE,
drivers/dma/dma-axi-dmac.c +4 -4
@@ -1041,9 +1041,9 @@ static int axi_dmac_detect_caps(struct axi_dmac *dmac, unsigned int version)return 0 ; } -static void axi_dmac_tasklet_kill (void *task) +static void axi_dmac_cancel_work_sync (void *work) { -tasklet_kill (task); +cancel_work_sync (work); }static void axi_dmac_free_dma_controller (void *of_node)
@@ -1146,8 +1146,8 @@ static int axi_dmac_probe(struct platform_device *pdev)* Put the action in here so it get's done before unregistering the DMA * device. */ - ret =devm_add_action_or_reset (&pdev->dev, axi_dmac_tasklet_kill, - &dmac->chan.vchan.task); + ret =devm_add_action_or_reset (&pdev->dev, axi_dmac_cancel_work_sync, + &dmac->chan.vchan.work);if (ret)return ret;
drivers/dma/dma-jz4780.c +1 -1
@@ -1019,7 +1019,7 @@ static void jz4780_dma_remove(struct platform_device *pdev)free_irq (jzdma->irq, jzdma);for (i =0 ; i < jzdma->soc_data->nb_channels; i++) -tasklet_kill (&jzdma->chan[i].vchan.task); +cancel_work_sync (&jzdma->chan[i].vchan.work); }static const struct jz4780_dma_soc_data jz4740_dma_soc_data = {
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +1 -1
@@ -1649,7 +1649,7 @@ static void dw_remove(struct platform_device *pdev)list_for_each_entry_safe (chan, _chan, &dw->dma.channels, vc.chan.device_node) {list_del (&chan->vc.chan.device_node); -tasklet_kill (&chan->vc.task); +cancel_work_sync (&chan->vc.work); } }
drivers/dma/dw-edma/dw-edma-core.c +1 -1
@@ -1005,7 +1005,7 @@ int dw_edma_remove(struct dw_edma_chip *chip)dma_async_device_unregister (&dw->dma);list_for_each_entry_safe (chan, _chan, &dw->dma.channels, vc.chan.device_node) { -tasklet_kill (&chan->vc.task); +cancel_work_sync (&chan->vc.work);list_del (&chan->vc.chan.device_node); }
drivers/dma/fsl-edma-common.c +1 -1
@@ -894,7 +894,7 @@ void fsl_edma_cleanup_vchan(struct dma_device *dmadev)list_for_each_entry_safe (chan, _chan, &dmadev->channels, vchan.chan.device_node) {list_del (&chan->vchan.chan.device_node); -tasklet_kill (&chan->vchan.task); +cancel_work_sync (&chan->vchan.work); } }
drivers/dma/fsl-edma-common.h +1 -0
@@ -7,6 +7,7 @@#define _FSL_EDMA_COMMON_H_#include <linux/dma-direction.h> +#include <linux/interrupt.h> #include <linux/platform_device.h> #include "virt-dma.h"
drivers/dma/fsl-qdma.c +2 -1
@@ -16,6 +16,7 @@#include <linux/of.h> #include <linux/of_dma.h> #include <linux/dma-mapping.h> +#include <linux/interrupt.h> #include <linux/platform_device.h> #include "virt-dma.h"
@@ -1261,7 +1262,7 @@ static void fsl_qdma_cleanup_vchan(struct dma_device *dmadev)list_for_each_entry_safe (chan, _chan, &dmadev->channels, vchan.chan.device_node) {list_del (&chan->vchan.chan.device_node); -tasklet_kill (&chan->vchan.task); +cancel_work_sync (&chan->vchan.work); } }
drivers/dma/hisi_dma.c +1 -1
@@ -720,7 +720,7 @@ static void hisi_dma_disable_qps(struct hisi_dma_dev *hdma_dev)for (i =0 ; i < hdma_dev->chan_num; i++) {hisi_dma_disable_qp (hdma_dev, i); -tasklet_kill (&hdma_dev->chan[i].vc.task); +cancel_work_sync (&hdma_dev->chan[i].vc.work); } }
drivers/dma/hsu/hsu.c +1 -1
@@ -500,7 +500,7 @@ int hsu_dma_remove(struct hsu_dma_chip *chip)for (i =0 ; i < hsu->nr_channels; i++) {struct hsu_dma_chan *hsuc = &hsu->chan[i]; -tasklet_kill (&hsuc->vchan.task); +cancel_work_sync (&hsuc->vchan.work); }return 0 ;
drivers/dma/idma64.c +2 -1
@@ -12,6 +12,7 @@#include <linux/dma-mapping.h> #include <linux/dmapool.h> #include <linux/init.h> +#include <linux/interrupt.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/slab.h>
@@ -624,7 +625,7 @@ static void idma64_remove(struct idma64_chip *chip)for (i =0 ; i < idma64->dma.chancnt; i++) {struct idma64_chan *idma64c = &idma64->chan[i]; -tasklet_kill (&idma64c->vchan.task); +cancel_work_sync (&idma64c->vchan.work); } }
drivers/dma/img-mdc-dma.c +1 -1
@@ -1031,7 +1031,7 @@ static void mdc_dma_remove(struct platform_device *pdev)devm_free_irq (&pdev->dev, mchan->irq, mchan); -tasklet_kill (&mchan->vc.task); +cancel_work_sync (&mchan->vc.work); }pm_runtime_disable (&pdev->dev);
drivers/dma/imx-sdma.c +1 -1
@@ -2427,7 +2427,7 @@ static void sdma_remove(struct platform_device *pdev)for (i =0 ; i <MAX_DMA_CHANNELS ; i++) {struct sdma_channel *sdmac = &sdma->channel[i]; -tasklet_kill (&sdmac->vc.task); +cancel_work_sync (&sdmac->vc.work);sdma_free_chan_resources (&sdmac->vc.chan); }
drivers/dma/k3dma.c +1 -1
@@ -981,7 +981,7 @@ static void k3_dma_remove(struct platform_device *op)list_for_each_entry_safe (c, cn, &d->slave.channels, vc.chan.device_node) {list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work); }tasklet_kill (&d->task);clk_disable_unprepare (d->clk);
drivers/dma/loongson1-apb-dma.c +1 -1
@@ -552,7 +552,7 @@ static void ls1x_dma_chan_remove(struct ls1x_dma *dma)if (chan->vc.chan.device == &dma->ddev) {list_del (&chan->vc.chan.device_node); -tasklet_kill (&chan->vc.task); +cancel_work_sync (&chan->vc.work); } } }
drivers/dma/mediatek/mtk-cqdma.c +1 -1
@@ -895,7 +895,7 @@ static void mtk_cqdma_remove(struct platform_device *pdev) vc = &cqdma->vc[i];list_del (&vc->vc.chan.device_node); -tasklet_kill (&vc->vc.task); +cancel_work_sync (&vc->vc.work); }/* disable interrupt */
drivers/dma/mediatek/mtk-hsdma.c +2 -1
@@ -13,6 +13,7 @@#include <linux/dmaengine.h> #include <linux/dma-mapping.h> #include <linux/err.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/list.h> #include <linux/module.h>
@@ -1020,7 +1021,7 @@ static void mtk_hsdma_remove(struct platform_device *pdev) vc = &hsdma->vc[i];list_del (&vc->vc.chan.device_node); -tasklet_kill (&vc->vc.task); +cancel_work_sync (&vc->vc.work); }/* Disable DMA interrupt */
drivers/dma/mediatek/mtk-uart-apdma.c +2 -2
@@ -312,7 +312,7 @@ static void mtk_uart_apdma_free_chan_resources(struct dma_chan *chan)free_irq (c->irq, chan); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work);vchan_free_chan_resources (&c->vc);
@@ -463,7 +463,7 @@ static void mtk_uart_apdma_free(struct mtk_uart_apdmadev *mtkd) struct mtk_chan, vc.chan.device_node);list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work); } }
drivers/dma/owl-dma.c +1 -1
@@ -1055,7 +1055,7 @@ static inline void owl_dma_free(struct owl_dma *od)list_for_each_entry_safe (vchan, next, &od->dma.channels, vc.chan.device_node) {list_del (&vchan->vc.chan.device_node); -tasklet_kill (&vchan->vc.task); +cancel_work_sync (&vchan->vc.work); } }
drivers/dma/pxa_dma.c +1 -1
@@ -1218,7 +1218,7 @@ static void pxad_free_channels(struct dma_device *dmadev)list_for_each_entry_safe (c, cn, &dmadev->channels, vc.chan.device_node) {list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work); } }
drivers/dma/qcom/bam_dma.c +2 -2
@@ -1373,7 +1373,7 @@ static int bam_dma_probe(struct platform_device *pdev)dma_async_device_unregister (&bdev->common); err_bam_channel_exit:for (i =0 ; i < bdev->num_channels; i++) -tasklet_kill (&bdev->channels[i].vc.task); +cancel_work_sync (&bdev->channels[i].vc.work); err_tasklet_kill:tasklet_kill (&bdev->task); err_disable_clk:
@@ -1399,7 +1399,7 @@ static void bam_dma_remove(struct platform_device *pdev)for (i =0 ; i < bdev->num_channels; i++) {bam_dma_terminate_all (&bdev->channels[i].vc.chan); -tasklet_kill (&bdev->channels[i].vc.task); +cancel_work_sync (&bdev->channels[i].vc.work);if (!bdev->channels[i].fifo_virt)continue ;
drivers/dma/qcom/gpi.c +1 -0
@@ -8,6 +8,7 @@#include <linux/bitfield.h> #include <linux/dma-mapping.h> #include <linux/dmaengine.h> +#include <linux/interrupt.h> #include <linux/module.h> #include <linux/of_dma.h> #include <linux/platform_device.h>
drivers/dma/qcom/qcom_adm.c +1 -1
@@ -919,7 +919,7 @@ static void adm_dma_remove(struct platform_device *pdev)/* mask IRQs for this channel/EE pair */ writel (0 , adev->regs +ADM_CH_RSLT_CONF (achan->id, adev->ee)); -tasklet_kill (&adev->channels[i].vc.task); +cancel_work_sync (&adev->channels[i].vc.work);adm_terminate_all (&adev->channels[i].vc.chan); }
drivers/dma/sa11x0-dma.c +1 -1
@@ -893,7 +893,7 @@ static void sa11x0_dma_free_channels(struct dma_device *dmadev)list_for_each_entry_safe (c, cn, &dmadev->channels, vc.chan.device_node) {list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work);kfree (c); } }
drivers/dma/sf-pdma/sf-pdma.c +2 -1
@@ -19,6 +19,7 @@#include <linux/platform_device.h> #include <linux/mod_devicetable.h> #include <linux/dma-mapping.h> +#include <linux/interrupt.h> #include <linux/of.h> #include <linux/of_dma.h> #include <linux/slab.h>
@@ -603,7 +604,7 @@ static void sf_pdma_remove(struct platform_device *pdev)devm_free_irq (&pdev->dev, ch->txirq, ch);devm_free_irq (&pdev->dev, ch->errirq, ch);list_del (&ch->vchan.chan.device_node); -tasklet_kill (&ch->vchan.task); +cancel_work_sync (&ch->vchan.work);tasklet_kill (&ch->done_tasklet);tasklet_kill (&ch->err_tasklet); }
drivers/dma/sprd-dma.c +1 -1
@@ -1253,7 +1253,7 @@ static void sprd_dma_remove(struct platform_device *pdev)list_for_each_entry_safe (c, cn, &sdev->dma_dev.channels, vc.chan.device_node) {list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work); }of_dma_controller_free (pdev->dev.of_node);
drivers/dma/st_fdma.c +1 -1
@@ -733,7 +733,7 @@ static void st_fdma_free(struct st_fdma_dev *fdev)for (i =0 ; i < fdev->nr_channels; i++) { fchan = &fdev->chans[i];list_del (&fchan->vchan.chan.device_node); -tasklet_kill (&fchan->vchan.task); +cancel_work_sync (&fchan->vchan.work); } }
drivers/dma/stm32/stm32-dma.c +1 -0
@@ -16,6 +16,7 @@#include <linux/dma-mapping.h> #include <linux/err.h> #include <linux/init.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/jiffies.h> #include <linux/list.h>
drivers/dma/stm32/stm32-dma3.c +1 -0
@@ -12,6 +12,7 @@#include <linux/dmaengine.h> #include <linux/dmapool.h> #include <linux/init.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/list.h> #include <linux/module.h>
drivers/dma/stm32/stm32-mdma.c +1 -0
@@ -18,6 +18,7 @@#include <linux/dmapool.h> #include <linux/err.h> #include <linux/init.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/jiffies.h> #include <linux/list.h>
drivers/dma/sun6i-dma.c +1 -1
@@ -1073,7 +1073,7 @@ static inline void sun6i_dma_free(struct sun6i_dma_dev *sdev)struct sun6i_vchan *vchan = &sdev->vchans[i];list_del (&vchan->vc.chan.device_node); -tasklet_kill (&vchan->vc.task); +cancel_work_sync (&vchan->vc.work); } }
drivers/dma/tegra186-gpc-dma.c +1 -1
@@ -1279,7 +1279,7 @@ static void tegra_dma_free_chan_resources(struct dma_chan *dc)tegra_dma_terminate_all (dc);synchronize_irq (tdc->irq); -tasklet_kill (&tdc->vc.task); +cancel_work_sync (&tdc->vc.work); tdc->config_init = false; tdc->slave_id =-1 ; tdc->sid_dir =DMA_TRANS_NONE ;
drivers/dma/tegra210-adma.c +2 -1
@@ -6,6 +6,7 @@*/ #include <linux/clk.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/module.h> #include <linux/of.h>
@@ -793,7 +794,7 @@ static void tegra_adma_free_chan_resources(struct dma_chan *dc)tegra_adma_terminate_all (dc);vchan_free_chan_resources (&tdc->vc); -tasklet_kill (&tdc->vc.task); +cancel_work_sync (&tdc->vc.work);free_irq (tdc->irq, tdc);pm_runtime_put (tdc2dev (tdc));
drivers/dma/ti/edma.c +1 -1
@@ -2560,7 +2560,7 @@ static void edma_cleanupp_vchan(struct dma_device *dmadev)list_for_each_entry_safe (echan, _echan, &dmadev->channels, vchan.chan.device_node) {list_del (&echan->vchan.chan.device_node); -tasklet_kill (&echan->vchan.task); +cancel_work_sync (&echan->vchan.work); } }
drivers/dma/ti/k3-udma.c +5 -5
@@ -4042,12 +4042,12 @@ static void udma_desc_pre_callback(struct virt_dma_chan *vc, }/* -* This tasklet handles the completion of a DMA descriptor by +* This workqueue handles the completion of a DMA descriptor by * calling its callback and freeing it. */ -static void udma_vchan_complete (struct tasklet_struct *t) +static void udma_vchan_complete (struct work_struct *w) { -struct virt_dma_chan *vc =from_tasklet (vc, t, task); +struct virt_dma_chan *vc =from_work (vc, w, work);struct virt_dma_desc *vd, *_vd;struct dmaengine_desc_callback cb;LIST_HEAD (head);
@@ -4112,7 +4112,7 @@ static void udma_free_chan_resources(struct dma_chan *chan) }vchan_free_chan_resources (&uc->vc); -tasklet_kill (&uc->vc.task); +cancel_work_sync (&uc->vc.work);bcdma_free_bchan_resources (uc);udma_free_tx_resources (uc);
@@ -5628,7 +5628,7 @@ static int udma_probe(struct platform_device *pdev)return -ENOMEM ;vchan_init (&uc->vc, &ud->ddev);/* Use custom vchan completion handling */ -tasklet_setup (&uc->vc.task, udma_vchan_complete); +INIT_WORK (&uc->vc.work, udma_vchan_complete);init_completion (&uc->teardown_completed);INIT_DELAYED_WORK (&uc->tx_drain.work, udma_check_tx_completion); }
drivers/dma/ti/omap-dma.c +1 -1
@@ -1521,7 +1521,7 @@ static void omap_dma_free(struct omap_dmadev *od) struct omap_chan, vc.chan.device_node);list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work);kfree (c); } }
drivers/dma/uniphier-xdmac.c +1 -0
@@ -7,6 +7,7 @@#include <linux/bitops.h> #include <linux/bitfield.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/module.h> #include <linux/of.h>
drivers/dma/virt-dma.c +4 -4
@@ -77,12 +77,12 @@ struct virt_dma_desc *vchan_find_desc(struct virt_dma_chan *vc,EXPORT_SYMBOL_GPL (vchan_find_desc);/* -* This tasklet handles the completion of a DMA descriptor by +* This workqueue handles the completion of a DMA descriptor by * calling its callback and freeing it. */ -static void vchan_complete (struct tasklet_struct *t) +static void vchan_complete (struct work_struct *work) { -struct virt_dma_chan *vc =from_tasklet (vc, t, task); +struct virt_dma_chan *vc =from_work (vc, work, work);struct virt_dma_desc *vd, *_vd;struct dmaengine_desc_callback cb;LIST_HEAD (head);
@@ -131,7 +131,7 @@ void vchan_init(struct virt_dma_chan *vc, struct dma_device *dmadev)INIT_LIST_HEAD (&vc->desc_completed);INIT_LIST_HEAD (&vc->desc_terminated); -tasklet_setup (&vc->task, vchan_complete); +INIT_WORK (&vc->work, vchan_complete); vc->chan.device = dmadev;list_add_tail (&vc->chan.device_node, &dmadev->channels);
drivers/dma/virt-dma.h +5 -5
@@ -8,7 +8,7 @@#define VIRT_DMA_H #include <linux/dmaengine.h> -#include <linux/interrupt.h> +#include <linux/workqueue.h> #include "dmaengine.h"
@@ -21,7 +21,7 @@ struct virt_dma_desc {struct virt_dma_chan {struct dma_chan chan; -struct tasklet_struct task; +struct work_struct work;void (*desc_free)(struct virt_dma_desc *);spinlock_t lock;
@@ -106,7 +106,7 @@ static inline void vchan_cookie_complete(struct virt_dma_desc *vd) vd, cookie);list_add_tail (&vd->node, &vc->desc_completed); -tasklet_schedule (&vc->task); +queue_work (system_bh_wq, &vc->work); }/**
@@ -137,7 +137,7 @@ static inline void vchan_cyclic_callback(struct virt_dma_desc *vd)struct virt_dma_chan *vc =to_virt_chan (vd->tx.chan); vc->cyclic = vd; -tasklet_schedule (&vc->task); +queue_work (system_bh_wq, &vc->work); }/**
@@ -223,7 +223,7 @@ static inline void vchan_synchronize(struct virt_dma_chan *vc)LIST_HEAD (head);unsigned long flags; -tasklet_kill (&vc->task); +cancel_work_sync (&vc->work);spin_lock_irqsave (&vc->lock, flags);
Signature · 1 line
2.43.0
Quoted 10 lines · Alexander Kochetkov
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 towork_struct, tasklet callback updated accordingly
-kill_tasklet()is replaced tocancel_work_sync()
- added include oflinux/interrupt.hwhere necessary
...
Quoted 2 lines
drivers/dma/hsu/hsu.c | 2 +- drivers/dma/idma64.c | 3 ++-
for the above two.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Ferry Toth
Tested-byOp 23-06-2025 om 12:39 schreef Andy Shevchenko:
Quoted 12 lines · Alexander Kochetkov
Quoted 10 lines
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 towork_struct, tasklet callback updated accordingly
-kill_tasklet()is replaced tocancel_work_sync()
- added include oflinux/interrupt.hwhere necessary
Quoted 7 lines
...
Quoted 2 lines
drivers/dma/hsu/hsu.c | 2 +- drivers/dma/idma64.c | 3 ++-Acked-by Andy Shevchenko <[email protected]>for the above two.
With and without PREEMPT_RT (on Intel Edison) same 2 drivers.
Quoted 26 lines · Alexander Kochetkov
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 towork_struct, tasklet callback updated accordingly
-kill_tasklet()is replaced tocancel_work_sync()
- added include oflinux/interrupt.hwhere necessaryTested on Pine64 (Allwinner A64 ARMv8) with sun6i-dma driver. All other drivers are changed similarly and tested for compilation.
Signed-off-by Alexander Kochetkov <[email protected]>--- drivers/dma/amd/qdma/qdma.c | 1 + drivers/dma/arm-dma350.c | 1 + drivers/dma/bcm2835-dma.c | 2 +- drivers/dma/dma-axi-dmac.c | 8 ++++---- drivers/dma/dma-jz4780.c | 2 +- drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 2 +- drivers/dma/dw-edma/dw-edma-core.c | 2 +- drivers/dma/fsl-edma-common.c | 2 +- drivers/dma/fsl-edma-common.h | 1 +
Quoted 8 lines
drivers/dma/fsl-qdma.c | 3 ++- drivers/dma/hisi_dma.c | 2 +- drivers/dma/hsu/hsu.c | 2 +- drivers/dma/idma64.c | 3 ++- drivers/dma/img-mdc-dma.c | 2 +- drivers/dma/imx-sdma.c | 2 +- drivers/dma/k3dma.c | 2 +- drivers/dma/loongson1-apb-dma.c | 2 +-
Quoted 703 lines
drivers/dma/mediatek/mtk-cqdma.c | 2 +- drivers/dma/mediatek/mtk-hsdma.c | 3 ++- drivers/dma/mediatek/mtk-uart-apdma.c | 4 ++-- drivers/dma/owl-dma.c | 2 +- drivers/dma/pxa_dma.c | 2 +- drivers/dma/qcom/bam_dma.c | 4 ++-- drivers/dma/qcom/gpi.c | 1 + drivers/dma/qcom/qcom_adm.c | 2 +- drivers/dma/sa11x0-dma.c | 2 +- drivers/dma/sf-pdma/sf-pdma.c | 3 ++- drivers/dma/sprd-dma.c | 2 +- drivers/dma/st_fdma.c | 2 +- drivers/dma/stm32/stm32-dma.c | 1 + drivers/dma/stm32/stm32-dma3.c | 1 + drivers/dma/stm32/stm32-mdma.c | 1 + drivers/dma/sun6i-dma.c | 2 +- drivers/dma/tegra186-gpc-dma.c | 2 +- drivers/dma/tegra210-adma.c | 3 ++- drivers/dma/ti/edma.c | 2 +- drivers/dma/ti/k3-udma.c | 10 +++++----- drivers/dma/ti/omap-dma.c | 2 +- drivers/dma/uniphier-xdmac.c | 1 + drivers/dma/virt-dma.c | 8 ++++---- drivers/dma/virt-dma.h | 10 +++++----- 41 files changed, 62 insertions(+), 49 deletions(-)drivers/dma/amd/qdma/qdma.c +1
-0@@ -8,6 +8,7 @@#include <linux/bitops.h> #include <linux/dmaengine.h> #include <linux/dma-mapping.h> +#include <linux/interrupt.h> #include <linux/module.h> #include <linux/mod_devicetable.h> #include <linux/platform_device.h> drivers/dma/arm-dma350.c +1
-0@@ -5,6 +5,7 @@#include <linux/bitfield.h> #include <linux/dmaengine.h> #include <linux/dma-mapping.h> +#include <linux/interrupt.h> #include <linux/io.h> #include <linux/of.h> #include <linux/module.h> drivers/dma/bcm2835-dma.c +1
-1@@ -846,7 +846,7 @@ static void bcm2835_dma_free(struct bcm2835_dmadev *od)list_for_each_entry_safe (c, next, &od->ddev.channels, vc.chan.device_node) {list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work); } dma_unmap_page_attrs(od->ddev.dev, od->zero_page, PAGE_SIZE,drivers/dma/dma-axi-dmac.c +4
-4@@ -1041,9 +1041,9 @@ static int axi_dmac_detect_caps(struct axi_dmac *dmac, unsigned int version)return 0 ; } -static void axi_dmac_tasklet_kill (void *task) +static void axi_dmac_cancel_work_sync (void *work) { -tasklet_kill (task); +cancel_work_sync (work); }static void axi_dmac_free_dma_controller (void *of_node)@@ -1146,8 +1146,8 @@ static int axi_dmac_probe(struct platform_device *pdev)* Put the action in here so it get's done before unregistering the DMA * device. */ - ret =devm_add_action_or_reset (&pdev->dev, axi_dmac_tasklet_kill, - &dmac->chan.vchan.task); + ret =devm_add_action_or_reset (&pdev->dev, axi_dmac_cancel_work_sync, + &dmac->chan.vchan.work);if (ret)return ret;drivers/dma/dma-jz4780.c +1
-1@@ -1019,7 +1019,7 @@ static void jz4780_dma_remove(struct platform_device *pdev)free_irq (jzdma->irq, jzdma);for (i =0 ; i < jzdma->soc_data->nb_channels; i++) -tasklet_kill (&jzdma->chan[i].vchan.task); +cancel_work_sync (&jzdma->chan[i].vchan.work); }static const struct jz4780_dma_soc_data jz4740_dma_soc_data = {drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +1
-1@@ -1649,7 +1649,7 @@ static void dw_remove(struct platform_device *pdev)list_for_each_entry_safe (chan, _chan, &dw->dma.channels, vc.chan.device_node) {list_del (&chan->vc.chan.device_node); -tasklet_kill (&chan->vc.task); +cancel_work_sync (&chan->vc.work); } }drivers/dma/dw-edma/dw-edma-core.c +1
-1@@ -1005,7 +1005,7 @@ int dw_edma_remove(struct dw_edma_chip *chip)dma_async_device_unregister (&dw->dma);list_for_each_entry_safe (chan, _chan, &dw->dma.channels, vc.chan.device_node) { -tasklet_kill (&chan->vc.task); +cancel_work_sync (&chan->vc.work);list_del (&chan->vc.chan.device_node); }drivers/dma/fsl-edma-common.c +1
-1@@ -894,7 +894,7 @@ void fsl_edma_cleanup_vchan(struct dma_device *dmadev)list_for_each_entry_safe (chan, _chan, &dmadev->channels, vchan.chan.device_node) {list_del (&chan->vchan.chan.device_node); -tasklet_kill (&chan->vchan.task); +cancel_work_sync (&chan->vchan.work); } }drivers/dma/fsl-edma-common.h +1
-0@@ -7,6 +7,7 @@#define _FSL_EDMA_COMMON_H_#include <linux/dma-direction.h> +#include <linux/interrupt.h> #include <linux/platform_device.h> #include "virt-dma.h" drivers/dma/fsl-qdma.c +2
-1@@ -16,6 +16,7 @@#include <linux/of.h> #include <linux/of_dma.h> #include <linux/dma-mapping.h> +#include <linux/interrupt.h> #include <linux/platform_device.h> #include "virt-dma.h" @@ -1261,7 +1262,7 @@ static void fsl_qdma_cleanup_vchan(struct dma_device *dmadev)list_for_each_entry_safe (chan, _chan, &dmadev->channels, vchan.chan.device_node) {list_del (&chan->vchan.chan.device_node); -tasklet_kill (&chan->vchan.task); +cancel_work_sync (&chan->vchan.work); } }drivers/dma/hisi_dma.c +1
-1@@ -720,7 +720,7 @@ static void hisi_dma_disable_qps(struct hisi_dma_dev *hdma_dev)for (i =0 ; i < hdma_dev->chan_num; i++) {hisi_dma_disable_qp (hdma_dev, i); -tasklet_kill (&hdma_dev->chan[i].vc.task); +cancel_work_sync (&hdma_dev->chan[i].vc.work); } }drivers/dma/hsu/hsu.c +1
-1@@ -500,7 +500,7 @@ int hsu_dma_remove(struct hsu_dma_chip *chip)for (i =0 ; i < hsu->nr_channels; i++) {struct hsu_dma_chan *hsuc = &hsu->chan[i]; -tasklet_kill (&hsuc->vchan.task); +cancel_work_sync (&hsuc->vchan.work); }return 0 ;drivers/dma/idma64.c +2
-1@@ -12,6 +12,7 @@#include <linux/dma-mapping.h> #include <linux/dmapool.h> #include <linux/init.h> +#include <linux/interrupt.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/slab.h> @@ -624,7 +625,7 @@ static void idma64_remove(struct idma64_chip *chip)for (i =0 ; i < idma64->dma.chancnt; i++) {struct idma64_chan *idma64c = &idma64->chan[i]; -tasklet_kill (&idma64c->vchan.task); +cancel_work_sync (&idma64c->vchan.work); } }drivers/dma/img-mdc-dma.c +1
-1@@ -1031,7 +1031,7 @@ static void mdc_dma_remove(struct platform_device *pdev)devm_free_irq (&pdev->dev, mchan->irq, mchan); -tasklet_kill (&mchan->vc.task); +cancel_work_sync (&mchan->vc.work); }pm_runtime_disable (&pdev->dev);drivers/dma/imx-sdma.c +1
-1@@ -2427,7 +2427,7 @@ static void sdma_remove(struct platform_device *pdev)for (i =0 ; i <MAX_DMA_CHANNELS ; i++) {struct sdma_channel *sdmac = &sdma->channel[i]; -tasklet_kill (&sdmac->vc.task); +cancel_work_sync (&sdmac->vc.work);sdma_free_chan_resources (&sdmac->vc.chan); }drivers/dma/k3dma.c +1
-1@@ -981,7 +981,7 @@ static void k3_dma_remove(struct platform_device *op)list_for_each_entry_safe (c, cn, &d->slave.channels, vc.chan.device_node) {list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work); }tasklet_kill (&d->task);clk_disable_unprepare (d->clk);drivers/dma/loongson1-apb-dma.c +1
-1@@ -552,7 +552,7 @@ static void ls1x_dma_chan_remove(struct ls1x_dma *dma)if (chan->vc.chan.device == &dma->ddev) {list_del (&chan->vc.chan.device_node); -tasklet_kill (&chan->vc.task); +cancel_work_sync (&chan->vc.work); } } }drivers/dma/mediatek/mtk-cqdma.c +1
-1@@ -895,7 +895,7 @@ static void mtk_cqdma_remove(struct platform_device *pdev) vc = &cqdma->vc[i];list_del (&vc->vc.chan.device_node); -tasklet_kill (&vc->vc.task); +cancel_work_sync (&vc->vc.work); }/* disable interrupt */ drivers/dma/mediatek/mtk-hsdma.c +2
-1@@ -13,6 +13,7 @@#include <linux/dmaengine.h> #include <linux/dma-mapping.h> #include <linux/err.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/list.h> #include <linux/module.h> @@ -1020,7 +1021,7 @@ static void mtk_hsdma_remove(struct platform_device *pdev) vc = &hsdma->vc[i];list_del (&vc->vc.chan.device_node); -tasklet_kill (&vc->vc.task); +cancel_work_sync (&vc->vc.work); }/* Disable DMA interrupt */ drivers/dma/mediatek/mtk-uart-apdma.c +2
-2@@ -312,7 +312,7 @@ static void mtk_uart_apdma_free_chan_resources(struct dma_chan *chan)free_irq (c->irq, chan); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work);vchan_free_chan_resources (&c->vc);@@ -463,7 +463,7 @@ static void mtk_uart_apdma_free(struct mtk_uart_apdmadev *mtkd) struct mtk_chan, vc.chan.device_node);list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work); } }drivers/dma/owl-dma.c +1
-1@@ -1055,7 +1055,7 @@ static inline void owl_dma_free(struct owl_dma *od)list_for_each_entry_safe (vchan, next, &od->dma.channels, vc.chan.device_node) {list_del (&vchan->vc.chan.device_node); -tasklet_kill (&vchan->vc.task); +cancel_work_sync (&vchan->vc.work); } }drivers/dma/pxa_dma.c +1
-1@@ -1218,7 +1218,7 @@ static void pxad_free_channels(struct dma_device *dmadev)list_for_each_entry_safe (c, cn, &dmadev->channels, vc.chan.device_node) {list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work); } }drivers/dma/qcom/bam_dma.c +2
-2@@ -1373,7 +1373,7 @@ static int bam_dma_probe(struct platform_device *pdev)dma_async_device_unregister (&bdev->common); err_bam_channel_exit:for (i =0 ; i < bdev->num_channels; i++) -tasklet_kill (&bdev->channels[i].vc.task); +cancel_work_sync (&bdev->channels[i].vc.work); err_tasklet_kill:tasklet_kill (&bdev->task); err_disable_clk:@@ -1399,7 +1399,7 @@ static void bam_dma_remove(struct platform_device *pdev)for (i =0 ; i < bdev->num_channels; i++) {bam_dma_terminate_all (&bdev->channels[i].vc.chan); -tasklet_kill (&bdev->channels[i].vc.task); +cancel_work_sync (&bdev->channels[i].vc.work);if (!bdev->channels[i].fifo_virt)continue ;drivers/dma/qcom/gpi.c +1
-0@@ -8,6 +8,7 @@#include <linux/bitfield.h> #include <linux/dma-mapping.h> #include <linux/dmaengine.h> +#include <linux/interrupt.h> #include <linux/module.h> #include <linux/of_dma.h> #include <linux/platform_device.h> drivers/dma/qcom/qcom_adm.c +1
-1@@ -919,7 +919,7 @@ static void adm_dma_remove(struct platform_device *pdev)/* mask IRQs for this channel/EE pair */ writel (0 , adev->regs +ADM_CH_RSLT_CONF (achan->id, adev->ee)); -tasklet_kill (&adev->channels[i].vc.task); +cancel_work_sync (&adev->channels[i].vc.work);adm_terminate_all (&adev->channels[i].vc.chan); }drivers/dma/sa11x0-dma.c +1
-1@@ -893,7 +893,7 @@ static void sa11x0_dma_free_channels(struct dma_device *dmadev)list_for_each_entry_safe (c, cn, &dmadev->channels, vc.chan.device_node) {list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work);kfree (c); } }drivers/dma/sf-pdma/sf-pdma.c +2
-1@@ -19,6 +19,7 @@#include <linux/platform_device.h> #include <linux/mod_devicetable.h> #include <linux/dma-mapping.h> +#include <linux/interrupt.h> #include <linux/of.h> #include <linux/of_dma.h> #include <linux/slab.h> @@ -603,7 +604,7 @@ static void sf_pdma_remove(struct platform_device *pdev)devm_free_irq (&pdev->dev, ch->txirq, ch);devm_free_irq (&pdev->dev, ch->errirq, ch);list_del (&ch->vchan.chan.device_node); -tasklet_kill (&ch->vchan.task); +cancel_work_sync (&ch->vchan.work);tasklet_kill (&ch->done_tasklet);tasklet_kill (&ch->err_tasklet); }drivers/dma/sprd-dma.c +1
-1@@ -1253,7 +1253,7 @@ static void sprd_dma_remove(struct platform_device *pdev)list_for_each_entry_safe (c, cn, &sdev->dma_dev.channels, vc.chan.device_node) {list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work); }of_dma_controller_free (pdev->dev.of_node);drivers/dma/st_fdma.c +1
-1@@ -733,7 +733,7 @@ static void st_fdma_free(struct st_fdma_dev *fdev)for (i =0 ; i < fdev->nr_channels; i++) { fchan = &fdev->chans[i];list_del (&fchan->vchan.chan.device_node); -tasklet_kill (&fchan->vchan.task); +cancel_work_sync (&fchan->vchan.work); } }drivers/dma/stm32/stm32-dma.c +1
-0@@ -16,6 +16,7 @@#include <linux/dma-mapping.h> #include <linux/err.h> #include <linux/init.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/jiffies.h> #include <linux/list.h> drivers/dma/stm32/stm32-dma3.c +1
-0@@ -12,6 +12,7 @@#include <linux/dmaengine.h> #include <linux/dmapool.h> #include <linux/init.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/list.h> #include <linux/module.h> drivers/dma/stm32/stm32-mdma.c +1
-0@@ -18,6 +18,7 @@#include <linux/dmapool.h> #include <linux/err.h> #include <linux/init.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/jiffies.h> #include <linux/list.h> drivers/dma/sun6i-dma.c +1
-1@@ -1073,7 +1073,7 @@ static inline void sun6i_dma_free(struct sun6i_dma_dev *sdev)struct sun6i_vchan *vchan = &sdev->vchans[i];list_del (&vchan->vc.chan.device_node); -tasklet_kill (&vchan->vc.task); +cancel_work_sync (&vchan->vc.work); } }drivers/dma/tegra186-gpc-dma.c +1
-1@@ -1279,7 +1279,7 @@ static void tegra_dma_free_chan_resources(struct dma_chan *dc)tegra_dma_terminate_all (dc);synchronize_irq (tdc->irq); -tasklet_kill (&tdc->vc.task); +cancel_work_sync (&tdc->vc.work); tdc->config_init = false; tdc->slave_id =-1 ; tdc->sid_dir =DMA_TRANS_NONE ;drivers/dma/tegra210-adma.c +2
-1@@ -6,6 +6,7 @@*/ #include <linux/clk.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/module.h> #include <linux/of.h> @@ -793,7 +794,7 @@ static void tegra_adma_free_chan_resources(struct dma_chan *dc)tegra_adma_terminate_all (dc);vchan_free_chan_resources (&tdc->vc); -tasklet_kill (&tdc->vc.task); +cancel_work_sync (&tdc->vc.work);free_irq (tdc->irq, tdc);pm_runtime_put (tdc2dev (tdc));drivers/dma/ti/edma.c +1
-1@@ -2560,7 +2560,7 @@ static void edma_cleanupp_vchan(struct dma_device *dmadev)list_for_each_entry_safe (echan, _echan, &dmadev->channels, vchan.chan.device_node) {list_del (&echan->vchan.chan.device_node); -tasklet_kill (&echan->vchan.task); +cancel_work_sync (&echan->vchan.work); } }drivers/dma/ti/k3-udma.c +5
-5@@ -4042,12 +4042,12 @@ static void udma_desc_pre_callback(struct virt_dma_chan *vc, }/* -* This tasklet handles the completion of a DMA descriptor by +* This workqueue handles the completion of a DMA descriptor by * calling its callback and freeing it. */ -static void udma_vchan_complete (struct tasklet_struct *t) +static void udma_vchan_complete (struct work_struct *w) { -struct virt_dma_chan *vc =from_tasklet (vc, t, task); +struct virt_dma_chan *vc =from_work (vc, w, work);struct virt_dma_desc *vd, *_vd;struct dmaengine_desc_callback cb;LIST_HEAD (head);@@ -4112,7 +4112,7 @@ static void udma_free_chan_resources(struct dma_chan *chan) }vchan_free_chan_resources (&uc->vc); -tasklet_kill (&uc->vc.task); +cancel_work_sync (&uc->vc.work);bcdma_free_bchan_resources (uc);udma_free_tx_resources (uc);@@ -5628,7 +5628,7 @@ static int udma_probe(struct platform_device *pdev)return -ENOMEM ;vchan_init (&uc->vc, &ud->ddev);/* Use custom vchan completion handling */ -tasklet_setup (&uc->vc.task, udma_vchan_complete); +INIT_WORK (&uc->vc.work, udma_vchan_complete);init_completion (&uc->teardown_completed);INIT_DELAYED_WORK (&uc->tx_drain.work, udma_check_tx_completion); }drivers/dma/ti/omap-dma.c +1
-1@@ -1521,7 +1521,7 @@ static void omap_dma_free(struct omap_dmadev *od) struct omap_chan, vc.chan.device_node);list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work);kfree (c); } }drivers/dma/uniphier-xdmac.c +1
-0@@ -7,6 +7,7 @@#include <linux/bitops.h> #include <linux/bitfield.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/module.h> #include <linux/of.h> drivers/dma/virt-dma.c +4
-4@@ -77,12 +77,12 @@ struct virt_dma_desc *vchan_find_desc(struct virt_dma_chan *vc,EXPORT_SYMBOL_GPL (vchan_find_desc);/* -* This tasklet handles the completion of a DMA descriptor by +* This workqueue handles the completion of a DMA descriptor by * calling its callback and freeing it. */ -static void vchan_complete (struct tasklet_struct *t) +static void vchan_complete (struct work_struct *work) { -struct virt_dma_chan *vc =from_tasklet (vc, t, task); +struct virt_dma_chan *vc =from_work (vc, work, work);struct virt_dma_desc *vd, *_vd;struct dmaengine_desc_callback cb;LIST_HEAD (head);@@ -131,7 +131,7 @@ void vchan_init(struct virt_dma_chan *vc, struct dma_device *dmadev)INIT_LIST_HEAD (&vc->desc_completed);INIT_LIST_HEAD (&vc->desc_terminated); -tasklet_setup (&vc->task, vchan_complete); +INIT_WORK (&vc->work, vchan_complete); vc->chan.device = dmadev;list_add_tail (&vc->chan.device_node, &dmadev->channels);drivers/dma/virt-dma.h +5
-6@@ -8,7 +8,7 @@#define VIRT_DMA_H #include <linux/dmaengine.h> -#include <linux/interrupt.h> +#include <linux/workqueue.h> #include "dmaengine.h" @@ -21,7 +21,7 @@ struct virt_dma_desc {struct virt_dma_chan {struct dma_chan chan; -struct tasklet_struct task; +struct work_struct work;void (*desc_free)(struct virt_dma_desc *);spinlock_t lock;@@ -106,7 +106,7 @@ static inline void vchan_cookie_complete(struct virt_dma_desc *vd) vd, cookie);list_add_tail (&vd->node, &vc->desc_completed); -tasklet_schedule (&vc->task); +queue_work (system_bh_wq, &vc->work); }/** @@ -137,7 +137,7 @@ static inline void vchan_cyclic_callback(struct virt_dma_desc *vd)struct virt_dma_chan *vc =to_virt_chan (vd->tx.chan); vc->cyclic = vd; -tasklet_schedule (&vc->task); +queue_work (system_bh_wq, &vc->work); }/** @@ -223,7 +223,7 @@ static inline void vchan_synchronize(struct virt_dma_chan *vc)LIST_HEAD (head);unsigned long flags; -tasklet_kill (&vc->task); +cancel_work_sync (&vc->work);spin_lock_irqsave (&vc->lock, flags); --2.43.0
Signature · 3 lines
Best regards, Keguang Zhang
Quoted 16 lines · Alexander Kochetkov
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 towork_struct, tasklet callback updated accordingly
-kill_tasklet()is replaced tocancel_work_sync()
- added include oflinux/interrupt.hwhere necessaryTested on Pine64 (Allwinner A64 ARMv8) with sun6i-dma driver. All other drivers are changed similarly and tested for compilation.
Signed-off-by Alexander Kochetkov <[email protected]>---
...
Quoted 3 lines
drivers/dma/stm32/stm32-dma.c | 1 + drivers/dma/stm32/stm32-dma3.c | 1 + drivers/dma/stm32/stm32-mdma.c | 1 +
For STM32:
Hello Vinod!
This patch [1] has not been merged into the linux. What do I need to do to get it accepted?
I guess what that happened, because I sent it as series [2] with test patch [3], that generate test robot error.
Regards,
Alexander.
[1] https://lore.kernel.org/dmaengine/[email protected]/
[2] https://lore.kernel.org/dmaengine/[email protected]/
[3] https://lore.kernel.org/dmaengine/[email protected]/
Quoted 738 lines
16 июня 2025 г., в 15:48, Alexander Kochetkov <[email protected]> написал(а):
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 towork_struct, tasklet callback updated accordingly
-kill_tasklet()is replaced tocancel_work_sync()
- added include oflinux/interrupt.hwhere necessaryTested on Pine64 (Allwinner A64 ARMv8) with sun6i-dma driver. All other drivers are changed similarly and tested for compilation.
Signed-off-by Alexander Kochetkov <[email protected]>---
drivers/dma/amd/qdma/qdma.c | 1 + drivers/dma/arm-dma350.c | 1 + drivers/dma/bcm2835-dma.c | 2 +- drivers/dma/dma-axi-dmac.c | 8 ++++---- drivers/dma/dma-jz4780.c | 2 +- drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 2 +- drivers/dma/dw-edma/dw-edma-core.c | 2 +- drivers/dma/fsl-edma-common.c | 2 +- drivers/dma/fsl-edma-common.h | 1 + drivers/dma/fsl-qdma.c | 3 ++- drivers/dma/hisi_dma.c | 2 +- drivers/dma/hsu/hsu.c | 2 +- drivers/dma/idma64.c | 3 ++- drivers/dma/img-mdc-dma.c | 2 +- drivers/dma/imx-sdma.c | 2 +- drivers/dma/k3dma.c | 2 +- drivers/dma/loongson1-apb-dma.c | 2 +- drivers/dma/mediatek/mtk-cqdma.c | 2 +- drivers/dma/mediatek/mtk-hsdma.c | 3 ++- drivers/dma/mediatek/mtk-uart-apdma.c | 4 ++-- drivers/dma/owl-dma.c | 2 +- drivers/dma/pxa_dma.c | 2 +- drivers/dma/qcom/bam_dma.c | 4 ++-- drivers/dma/qcom/gpi.c | 1 + drivers/dma/qcom/qcom_adm.c | 2 +- drivers/dma/sa11x0-dma.c | 2 +- drivers/dma/sf-pdma/sf-pdma.c | 3 ++- drivers/dma/sprd-dma.c | 2 +- drivers/dma/st_fdma.c | 2 +- drivers/dma/stm32/stm32-dma.c | 1 + drivers/dma/stm32/stm32-dma3.c | 1 + drivers/dma/stm32/stm32-mdma.c | 1 + drivers/dma/sun6i-dma.c | 2 +- drivers/dma/tegra186-gpc-dma.c | 2 +- drivers/dma/tegra210-adma.c | 3 ++- drivers/dma/ti/edma.c | 2 +- drivers/dma/ti/k3-udma.c | 10 +++++----- drivers/dma/ti/omap-dma.c | 2 +- drivers/dma/uniphier-xdmac.c | 1 + drivers/dma/virt-dma.c | 8 ++++---- drivers/dma/virt-dma.h | 10 +++++----- 41 files changed, 62 insertions(+), 49 deletions(-)drivers/dma/amd/qdma/qdma.c +1
-0@@ -8,6 +8,7 @@#include <linux/bitops.h> #include <linux/dmaengine.h> #include <linux/dma-mapping.h> +#include <linux/interrupt.h> #include <linux/module.h> #include <linux/mod_devicetable.h> #include <linux/platform_device.h> drivers/dma/arm-dma350.c +1
-0@@ -5,6 +5,7 @@#include <linux/bitfield.h> #include <linux/dmaengine.h> #include <linux/dma-mapping.h> +#include <linux/interrupt.h> #include <linux/io.h> #include <linux/of.h> #include <linux/module.h> drivers/dma/bcm2835-dma.c +1
-1@@ -846,7 +846,7 @@ static void bcm2835_dma_free(struct bcm2835_dmadev *od)list_for_each_entry_safe (c, next, &od->ddev.channels, vc.chan.device_node) {list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work); } dma_unmap_page_attrs(od->ddev.dev, od->zero_page, PAGE_SIZE,drivers/dma/dma-axi-dmac.c +4
-4@@ -1041,9 +1041,9 @@ static int axi_dmac_detect_caps(struct axi_dmac *dmac, unsigned int version)return 0 ; } -static void axi_dmac_tasklet_kill (void *task) +static void axi_dmac_cancel_work_sync (void *work) { -tasklet_kill (task); +cancel_work_sync (work); }static void axi_dmac_free_dma_controller (void *of_node)@@ -1146,8 +1146,8 @@ static int axi_dmac_probe(struct platform_device *pdev)* Put the action in here so it get's done before unregistering the DMA * device. */ - ret =devm_add_action_or_reset (&pdev->dev, axi_dmac_tasklet_kill, - &dmac->chan.vchan.task); + ret =devm_add_action_or_reset (&pdev->dev, axi_dmac_cancel_work_sync, + &dmac->chan.vchan.work);if (ret)return ret;drivers/dma/dma-jz4780.c +1
-1@@ -1019,7 +1019,7 @@ static void jz4780_dma_remove(struct platform_device *pdev)free_irq (jzdma->irq, jzdma);for (i =0 ; i < jzdma->soc_data->nb_channels; i++) -tasklet_kill (&jzdma->chan[i].vchan.task); +cancel_work_sync (&jzdma->chan[i].vchan.work); }static const struct jz4780_dma_soc_data jz4740_dma_soc_data = {drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +1
-1@@ -1649,7 +1649,7 @@ static void dw_remove(struct platform_device *pdev)list_for_each_entry_safe (chan, _chan, &dw->dma.channels, vc.chan.device_node) {list_del (&chan->vc.chan.device_node); -tasklet_kill (&chan->vc.task); +cancel_work_sync (&chan->vc.work); } }drivers/dma/dw-edma/dw-edma-core.c +1
-1@@ -1005,7 +1005,7 @@ int dw_edma_remove(struct dw_edma_chip *chip)dma_async_device_unregister (&dw->dma);list_for_each_entry_safe (chan, _chan, &dw->dma.channels, vc.chan.device_node) { -tasklet_kill (&chan->vc.task); +cancel_work_sync (&chan->vc.work);list_del (&chan->vc.chan.device_node); }drivers/dma/fsl-edma-common.c +1
-1@@ -894,7 +894,7 @@ void fsl_edma_cleanup_vchan(struct dma_device *dmadev)list_for_each_entry_safe (chan, _chan, &dmadev->channels, vchan.chan.device_node) {list_del (&chan->vchan.chan.device_node); -tasklet_kill (&chan->vchan.task); +cancel_work_sync (&chan->vchan.work); } }drivers/dma/fsl-edma-common.h +1
-0@@ -7,6 +7,7 @@#define _FSL_EDMA_COMMON_H_#include <linux/dma-direction.h> +#include <linux/interrupt.h> #include <linux/platform_device.h> #include "virt-dma.h" drivers/dma/fsl-qdma.c +2
-1@@ -16,6 +16,7 @@#include <linux/of.h> #include <linux/of_dma.h> #include <linux/dma-mapping.h> +#include <linux/interrupt.h> #include <linux/platform_device.h> #include "virt-dma.h" @@ -1261,7 +1262,7 @@ static void fsl_qdma_cleanup_vchan(struct dma_device *dmadev)list_for_each_entry_safe (chan, _chan, &dmadev->channels, vchan.chan.device_node) {list_del (&chan->vchan.chan.device_node); -tasklet_kill (&chan->vchan.task); +cancel_work_sync (&chan->vchan.work); } }drivers/dma/hisi_dma.c +1
-1@@ -720,7 +720,7 @@ static void hisi_dma_disable_qps(struct hisi_dma_dev *hdma_dev)for (i =0 ; i < hdma_dev->chan_num; i++) {hisi_dma_disable_qp (hdma_dev, i); -tasklet_kill (&hdma_dev->chan[i].vc.task); +cancel_work_sync (&hdma_dev->chan[i].vc.work); } }drivers/dma/hsu/hsu.c +1
-1@@ -500,7 +500,7 @@ int hsu_dma_remove(struct hsu_dma_chip *chip)for (i =0 ; i < hsu->nr_channels; i++) {struct hsu_dma_chan *hsuc = &hsu->chan[i]; -tasklet_kill (&hsuc->vchan.task); +cancel_work_sync (&hsuc->vchan.work); }return 0 ;drivers/dma/idma64.c +2
-1@@ -12,6 +12,7 @@#include <linux/dma-mapping.h> #include <linux/dmapool.h> #include <linux/init.h> +#include <linux/interrupt.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/slab.h> @@ -624,7 +625,7 @@ static void idma64_remove(struct idma64_chip *chip)for (i =0 ; i < idma64->dma.chancnt; i++) {struct idma64_chan *idma64c = &idma64->chan[i]; -tasklet_kill (&idma64c->vchan.task); +cancel_work_sync (&idma64c->vchan.work); } }drivers/dma/img-mdc-dma.c +1
-1@@ -1031,7 +1031,7 @@ static void mdc_dma_remove(struct platform_device *pdev)devm_free_irq (&pdev->dev, mchan->irq, mchan); -tasklet_kill (&mchan->vc.task); +cancel_work_sync (&mchan->vc.work); }pm_runtime_disable (&pdev->dev);drivers/dma/imx-sdma.c +1
-1@@ -2427,7 +2427,7 @@ static void sdma_remove(struct platform_device *pdev)for (i =0 ; i <MAX_DMA_CHANNELS ; i++) {struct sdma_channel *sdmac = &sdma->channel[i]; -tasklet_kill (&sdmac->vc.task); +cancel_work_sync (&sdmac->vc.work);sdma_free_chan_resources (&sdmac->vc.chan); }drivers/dma/k3dma.c +1
-1@@ -981,7 +981,7 @@ static void k3_dma_remove(struct platform_device *op) list_for_each_entry_safe(c, cn, &d->slave.channels, vc.chan.device_node) {list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work); }tasklet_kill (&d->task);clk_disable_unprepare (d->clk);drivers/dma/loongson1-apb-dma.c +1
-1@@ -552,7 +552,7 @@ static void ls1x_dma_chan_remove(struct ls1x_dma *dma)if (chan->vc.chan.device == &dma->ddev) {list_del (&chan->vc.chan.device_node); -tasklet_kill (&chan->vc.task); +cancel_work_sync (&chan->vc.work); } } }drivers/dma/mediatek/mtk-cqdma.c +1
-1@@ -895,7 +895,7 @@ static void mtk_cqdma_remove(struct platform_device *pdev) vc = &cqdma->vc[i];list_del (&vc->vc.chan.device_node); -tasklet_kill (&vc->vc.task); +cancel_work_sync (&vc->vc.work); }/* disable interrupt */ drivers/dma/mediatek/mtk-hsdma.c +2
-1@@ -13,6 +13,7 @@#include <linux/dmaengine.h> #include <linux/dma-mapping.h> #include <linux/err.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/list.h> #include <linux/module.h> @@ -1020,7 +1021,7 @@ static void mtk_hsdma_remove(struct platform_device *pdev) vc = &hsdma->vc[i];list_del (&vc->vc.chan.device_node); -tasklet_kill (&vc->vc.task); +cancel_work_sync (&vc->vc.work); }/* Disable DMA interrupt */ drivers/dma/mediatek/mtk-uart-apdma.c +2
-2@@ -312,7 +312,7 @@ static void mtk_uart_apdma_free_chan_resources(struct dma_chan *chan)free_irq (c->irq, chan); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work);vchan_free_chan_resources (&c->vc);@@ -463,7 +463,7 @@ static void mtk_uart_apdma_free(struct mtk_uart_apdmadev *mtkd) struct mtk_chan, vc.chan.device_node);list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work); } }drivers/dma/owl-dma.c +1
-1@@ -1055,7 +1055,7 @@ static inline void owl_dma_free(struct owl_dma *od)list_for_each_entry_safe (vchan, next, &od->dma.channels, vc.chan.device_node) {list_del (&vchan->vc.chan.device_node); -tasklet_kill (&vchan->vc.task); +cancel_work_sync (&vchan->vc.work); } }drivers/dma/pxa_dma.c +1
-1@@ -1218,7 +1218,7 @@ static void pxad_free_channels(struct dma_device *dmadev)list_for_each_entry_safe (c, cn, &dmadev->channels, vc.chan.device_node) {list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work); } }drivers/dma/qcom/bam_dma.c +0
-0@@ -1373,7 +1373,7 @@ static int bam_dma_probe(struct platform_device *pdev)dma_async_device_unregister (&bdev->common);
err_bam_channel_exit:
for (i = 0; i <bdev->num_channels; i++)
-tasklet_kill(&bdev->channels[i].vc.task);
+cancel_work_sync(&bdev->channels[i].vc.work);err_tasklet_kill:tasklet_kill(&bdev->task);err_disable_clk:drivers/dma/qcom/bam_dma.c +1
-1@@ -1399,7 +1399,7 @@ static void bam_dma_remove(struct platform_device *pdev)for (i =0 ; i < bdev->num_channels; i++) {bam_dma_terminate_all (&bdev->channels[i].vc.chan); -tasklet_kill (&bdev->channels[i].vc.task); +cancel_work_sync (&bdev->channels[i].vc.work);if (!bdev->channels[i].fifo_virt)continue ;drivers/dma/qcom/gpi.c +1
-0@@ -8,6 +8,7 @@#include <linux/bitfield.h> #include <linux/dma-mapping.h> #include <linux/dmaengine.h> +#include <linux/interrupt.h> #include <linux/module.h> #include <linux/of_dma.h> #include <linux/platform_device.h> drivers/dma/qcom/qcom_adm.c +1
-1@@ -919,7 +919,7 @@ static void adm_dma_remove(struct platform_device *pdev)/* mask IRQs for this channel/EE pair */ writel (0 , adev->regs +ADM_CH_RSLT_CONF (achan->id, adev->ee)); -tasklet_kill (&adev->channels[i].vc.task); +cancel_work_sync (&adev->channels[i].vc.work);adm_terminate_all (&adev->channels[i].vc.chan); }drivers/dma/sa11x0-dma.c +1
-1@@ -893,7 +893,7 @@ static void sa11x0_dma_free_channels(struct dma_device *dmadev) list_for_each_entry_safe(c, cn, &dmadev->channels, vc.chan.device_node) {list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work);kfree (c); } }drivers/dma/sf-pdma/sf-pdma.c +2
-1@@ -19,6 +19,7 @@#include <linux/platform_device.h> #include <linux/mod_devicetable.h> #include <linux/dma-mapping.h> +#include <linux/interrupt.h> #include <linux/of.h> #include <linux/of_dma.h> #include <linux/slab.h> @@ -603,7 +604,7 @@ static void sf_pdma_remove(struct platform_device *pdev)devm_free_irq (&pdev->dev, ch->txirq, ch);devm_free_irq (&pdev->dev, ch->errirq, ch);list_del (&ch->vchan.chan.device_node); -tasklet_kill (&ch->vchan.task); +cancel_work_sync (&ch->vchan.work);tasklet_kill (&ch->done_tasklet);tasklet_kill (&ch->err_tasklet); }drivers/dma/sprd-dma.c +1
-1@@ -1253,7 +1253,7 @@ static void sprd_dma_remove(struct platform_device *pdev)list_for_each_entry_safe (c, cn, &sdev->dma_dev.channels, vc.chan.device_node) {list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work); }of_dma_controller_free (pdev->dev.of_node);drivers/dma/st_fdma.c +1
-1@@ -733,7 +733,7 @@ static void st_fdma_free(struct st_fdma_dev *fdev)for (i =0 ; i < fdev->nr_channels; i++) { fchan = &fdev->chans[i];list_del (&fchan->vchan.chan.device_node); -tasklet_kill (&fchan->vchan.task); +cancel_work_sync (&fchan->vchan.work); } }drivers/dma/stm32/stm32-dma.c +1
-0@@ -16,6 +16,7 @@#include <linux/dma-mapping.h> #include <linux/err.h> #include <linux/init.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/jiffies.h> #include <linux/list.h> drivers/dma/stm32/stm32-dma3.c +1
-0@@ -12,6 +12,7 @@#include <linux/dmaengine.h> #include <linux/dmapool.h> #include <linux/init.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/list.h> #include <linux/module.h> drivers/dma/stm32/stm32-mdma.c +1
-0@@ -18,6 +18,7 @@#include <linux/dmapool.h> #include <linux/err.h> #include <linux/init.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/jiffies.h> #include <linux/list.h> drivers/dma/sun6i-dma.c +1
-1@@ -1073,7 +1073,7 @@ static inline void sun6i_dma_free(struct sun6i_dma_dev *sdev)struct sun6i_vchan *vchan = &sdev->vchans[i];list_del (&vchan->vc.chan.device_node); -tasklet_kill (&vchan->vc.task); +cancel_work_sync (&vchan->vc.work); } }drivers/dma/tegra186-gpc-dma.c +1
-1@@ -1279,7 +1279,7 @@ static void tegra_dma_free_chan_resources(struct dma_chan *dc)tegra_dma_terminate_all (dc);synchronize_irq (tdc->irq); -tasklet_kill (&tdc->vc.task); +cancel_work_sync (&tdc->vc.work); tdc->config_init = false; tdc->slave_id =-1 ; tdc->sid_dir =DMA_TRANS_NONE ;drivers/dma/tegra210-adma.c +2
-1@@ -6,6 +6,7 @@*/ #include <linux/clk.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/module.h> #include <linux/of.h> @@ -793,7 +794,7 @@ static void tegra_adma_free_chan_resources(struct dma_chan *dc)tegra_adma_terminate_all (dc);vchan_free_chan_resources (&tdc->vc); -tasklet_kill (&tdc->vc.task); +cancel_work_sync (&tdc->vc.work);free_irq (tdc->irq, tdc);pm_runtime_put (tdc2dev (tdc));drivers/dma/ti/edma.c +1
-1@@ -2560,7 +2560,7 @@ static void edma_cleanupp_vchan(struct dma_device *dmadev)list_for_each_entry_safe (echan, _echan, &dmadev->channels, vchan.chan.device_node) {list_del (&echan->vchan.chan.device_node); -tasklet_kill (&echan->vchan.task); +cancel_work_sync (&echan->vchan.work); } }drivers/dma/ti/k3-udma.c +5
-5@@ -4042,12 +4042,12 @@ static void udma_desc_pre_callback(struct virt_dma_chan *vc, }/* -* This tasklet handles the completion of a DMA descriptor by +* This workqueue handles the completion of a DMA descriptor by * calling its callback and freeing it. */ -static void udma_vchan_complete (struct tasklet_struct *t) +static void udma_vchan_complete (struct work_struct *w) { -struct virt_dma_chan *vc =from_tasklet (vc, t, task); +struct virt_dma_chan *vc =from_work (vc, w, work);struct virt_dma_desc *vd, *_vd;struct dmaengine_desc_callback cb;LIST_HEAD (head);@@ -4112,7 +4112,7 @@ static void udma_free_chan_resources(struct dma_chan *chan) }vchan_free_chan_resources (&uc->vc); -tasklet_kill (&uc->vc.task); +cancel_work_sync (&uc->vc.work);bcdma_free_bchan_resources (uc);udma_free_tx_resources (uc);@@ -5628,7 +5628,7 @@ static int udma_probe(struct platform_device *pdev)return -ENOMEM ;vchan_init (&uc->vc, &ud->ddev);/* Use custom vchan completion handling */ -tasklet_setup (&uc->vc.task, udma_vchan_complete); +INIT_WORK (&uc->vc.work, udma_vchan_complete);init_completion (&uc->teardown_completed);INIT_DELAYED_WORK (&uc->tx_drain.work, udma_check_tx_completion); }drivers/dma/ti/omap-dma.c +1
-1@@ -1521,7 +1521,7 @@ static void omap_dma_free(struct omap_dmadev *od) struct omap_chan, vc.chan.device_node);list_del (&c->vc.chan.device_node); -tasklet_kill (&c->vc.task); +cancel_work_sync (&c->vc.work);kfree (c); } }drivers/dma/uniphier-xdmac.c +1
-0@@ -7,6 +7,7 @@#include <linux/bitops.h> #include <linux/bitfield.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/module.h> #include <linux/of.h> drivers/dma/virt-dma.c +4
-4@@ -77,12 +77,12 @@ struct virt_dma_desc *vchan_find_desc(struct virt_dma_chan *vc,EXPORT_SYMBOL_GPL (vchan_find_desc);/* -* This tasklet handles the completion of a DMA descriptor by +* This workqueue handles the completion of a DMA descriptor by * calling its callback and freeing it. */ -static void vchan_complete (struct tasklet_struct *t) +static void vchan_complete (struct work_struct *work) { -struct virt_dma_chan *vc =from_tasklet (vc, t, task); +struct virt_dma_chan *vc =from_work (vc, work, work);struct virt_dma_desc *vd, *_vd;struct dmaengine_desc_callback cb;LIST_HEAD (head);@@ -131,7 +131,7 @@ void vchan_init(struct virt_dma_chan *vc, struct dma_device *dmadev)INIT_LIST_HEAD (&vc->desc_completed);INIT_LIST_HEAD (&vc->desc_terminated); -tasklet_setup (&vc->task, vchan_complete); +INIT_WORK (&vc->work, vchan_complete); vc->chan.device = dmadev;list_add_tail (&vc->chan.device_node, &dmadev->channels);drivers/dma/virt-dma.h +5
-5@@ -8,7 +8,7 @@#define VIRT_DMA_H #include <linux/dmaengine.h> -#include <linux/interrupt.h> +#include <linux/workqueue.h> #include "dmaengine.h" @@ -21,7 +21,7 @@ struct virt_dma_desc {struct virt_dma_chan {struct dma_chan chan; -struct tasklet_struct task; +struct work_struct work;void (*desc_free)(struct virt_dma_desc *);spinlock_t lock;@@ -106,7 +106,7 @@ static inline void vchan_cookie_complete(struct virt_dma_desc *vd) vd, cookie);list_add_tail (&vd->node, &vc->desc_completed); -tasklet_schedule (&vc->task); +queue_work (system_bh_wq, &vc->work); }/** @@ -137,7 +137,7 @@ static inline void vchan_cyclic_callback(struct virt_dma_desc *vd)struct virt_dma_chan *vc =to_virt_chan (vd->tx.chan); vc->cyclic = vd; -tasklet_schedule (&vc->task); +queue_work (system_bh_wq, &vc->work); }/** @@ -223,7 +223,7 @@ static inline void vchan_synchronize(struct virt_dma_chan *vc)LIST_HEAD (head);unsigned long flags; -tasklet_kill (&vc->task); +cancel_work_sync (&vc->work);spin_lock_irqsave (&vc->lock, flags);Signature · 1 line
2.43.0
PATCH v2 2/2 !!! TESTING ONLY !!! Allow compile virt-dma users on ARM64 platform
In reply to Alexander KochetkovThis patch is for testing only!
Most of DMA drivers are platform specific and their configuration options can be enabled only then building kernel for specific platform. In order to simplify compilation check of such drivers Kconfig files were modified.
--- drivers/dma/Kconfig | 22 +++++++++++----------- drivers/dma/amd/Kconfig | 4 ++-- drivers/dma/hsu/Kconfig | 4 ++-- drivers/dma/qcom/Kconfig | 6 +++--- drivers/dma/ti/Kconfig | 2 +- drivers/mfd/Kconfig | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-)
drivers/dma/Kconfig +11 -11
@@ -103,7 +103,7 @@ config ARM_DMA350 config AT_HDMAC tristate "Atmel AHB DMA support" - depends on ARCH_AT91 + depends on ARCH_AT91 || COMPILE_TEST select DMA_ENGINE select DMA_VIRTUAL_CHANNELS help
@@ -144,7 +144,7 @@ config BCM_SBA_RAID config DMA_BCM2835 tristate "BCM2835 DMA engine support" - depends on ARCH_BCM2835 + depends on ARCH_BCM2835 || COMPILE_TEST select DMA_ENGINE select DMA_VIRTUAL_CHANNELS
@@ -170,7 +170,7 @@ config DMA_SA11X0 config DMA_SUN4I tristate "Allwinner A10 DMA SoCs support" - depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUNIV + depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUNIV || COMPILE_TEST default (MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUNIV) select DMA_ENGINE select DMA_VIRTUAL_CHANNELS
@@ -207,7 +207,7 @@ config EP93XX_DMA config FSL_DMA tristate "Freescale Elo series DMA support" - depends on FSL_SOC + depends on FSL_SOC || COMPILE_TEST select DMA_ENGINE select ASYNC_TX_ENABLE_CHANNEL_SWITCH help
@@ -219,7 +219,7 @@ config FSL_DMA config FSL_EDMA tristate "Freescale eDMA engine support" depends on OF - depends on HAS_IOMEM + depends on HAS_IOMEM || COMPILE_TEST select DMA_ENGINE select DMA_VIRTUAL_CHANNELS help
@@ -280,7 +280,7 @@ config IMX_DMA config IMX_SDMA tristate "i.MX SDMA support" - depends on ARCH_MXC + depends on ARCH_MXC || COMPILE_TEST select DMA_ENGINE select DMA_VIRTUAL_CHANNELS help
@@ -289,7 +289,7 @@ config IMX_SDMA config INTEL_IDMA64 tristate "Intel integrated DMA 64-bit support" - depends on HAS_IOMEM + depends on HAS_IOMEM || COMPILE_TEST select DMA_ENGINE select DMA_VIRTUAL_CHANNELS help
@@ -420,7 +420,7 @@ config LPC32XX_DMAMUX config MCF_EDMA tristate "Freescale eDMA engine support, ColdFire mcf5441x SoCs" - depends on M5441x || (COMPILE_TEST && FSL_EDMA=n) + depends on M5441x || (COMPILE_TEST) select DMA_ENGINE select DMA_VIRTUAL_CHANNELS help
@@ -467,7 +467,7 @@ config MMP_TDMA config MOXART_DMA tristate "MOXART DMA support" - depends on ARCH_MOXART + depends on ARCH_MOXART || COMPILE_TEST select DMA_ENGINE select DMA_VIRTUAL_CHANNELS help
@@ -523,7 +523,7 @@ config NBPFAXI_DMA config OWL_DMA tristate "Actions Semi Owl SoCs DMA support" - depends on ARCH_ACTIONS + depends on ARCH_ACTIONS || COMPILE_TEST select DMA_ENGINE select DMA_VIRTUAL_CHANNELS help
@@ -582,7 +582,7 @@ config STE_DMA40 config ST_FDMA tristate "ST FDMA dmaengine support" - depends on ARCH_STI + depends on ARCH_STI || COMPILE_TEST depends on REMOTEPROC select ST_SLIM_REMOTEPROC select DMA_ENGINE
drivers/dma/amd/Kconfig +2 -2
@@ -2,7 +2,7 @@ # config AMD_AE4DMA - tristate "AMD AE4DMA Engine" + bool "AMD AE4DMA Engine" depends on (X86_64 || COMPILE_TEST) && PCI depends on AMD_PTDMA select DMA_ENGINE
@@ -17,7 +17,7 @@ config AMD_AE4DMA config AMD_PTDMA tristate "AMD PassThru DMA Engine" - depends on X86_64 && PCI + depends on (X86_64 || COMPILE_TEST) && PCI select DMA_ENGINE select DMA_VIRTUAL_CHANNELS help
drivers/dma/hsu/Kconfig +2 -2
@@ -1,10 +1,10 @@ # SPDX-License-Identifier: GPL-2.0-only # DMA engine configuration for hsu config HSU_DMA - tristate + bool "HSU_DMA" select DMA_ENGINE select DMA_VIRTUAL_CHANNELS config HSU_DMA_PCI - tristate + bool "HSU_DMA_PCI" depends on HSU_DMA && PCI
drivers/dma/qcom/Kconfig +3 -3
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only config QCOM_ADM tristate "Qualcomm ADM support" - depends on (ARCH_QCOM || COMPILE_TEST) && !PHYS_ADDR_T_64BIT + depends on (ARCH_QCOM || COMPILE_TEST) select DMA_ENGINE select DMA_VIRTUAL_CHANNELS help
@@ -12,7 +12,7 @@ config QCOM_ADM config QCOM_BAM_DMA tristate "QCOM BAM DMA support" - depends on ARCH_QCOM || (COMPILE_TEST && OF && ARM) + depends on ARCH_QCOM || (COMPILE_TEST && OF && ARM) || COMPILE_TEST select DMA_ENGINE select DMA_VIRTUAL_CHANNELS help
@@ -21,7 +21,7 @@ config QCOM_BAM_DMA config QCOM_GPI_DMA tristate "Qualcomm Technologies GPI DMA support" - depends on ARCH_QCOM + depends on ARCH_QCOM || COMPILE_TEST select DMA_ENGINE select DMA_VIRTUAL_CHANNELS help
drivers/dma/ti/Kconfig +1 -1
@@ -36,7 +36,7 @@ config DMA_OMAP config TI_K3_UDMA tristate "Texas Instruments UDMA support" - depends on ARCH_K3 + depends on ARCH_K3 || COMPILE_TEST depends on TI_SCI_PROTOCOL depends on TI_SCI_INTA_IRQCHIP select DMA_ENGINE
drivers/mfd/Kconfig +1 -1
@@ -702,7 +702,7 @@ config INTEL_SOC_PMIC_MRFLD that is found on Intel Merrifield systems. config MFD_INTEL_LPSS - tristate + bool "MFD_INTEL_LPSS" select COMMON_CLK select MFD_CORE
Signature · 1 line
2.43.0
kernel test robot
build botRe: [PATCH v2 2/2] !!! TESTING ONLY !!! Allow compile virt-dma users on ARM64 platform
kernel test robot noticed the following build warnings:
Hi Alexander,
kernel test robot noticed the following build warnings:
[auto build test WARNING on vkoul-dmaengine/next]
[also build test WARNING on shawnguo/for-next sunxi/sunxi/for-next lee-mfd/for-mfd-next linus/master v6.16-rc2 next-20250617] [cannot apply to atorgue-stm32/stm32-next lee-mfd/for-mfd-fixes]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Alexander-Kochetkov/dmaengine-virt-dma-convert-tasklet-to-BH-workqueue-for-callback-invocation/20250616-205118 base: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git next patch link: https://lore.kernel.org/r/20250616124934.141782-3-al.kochet%40gmail.com patch subject: [PATCH v2 2/2] !!! TESTING ONLY !!! Allow compile virt-dma users on ARM64 platform config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20250617/[email protected]/config) compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250617/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
drivers/dma/qcom/qcom_adm.c:245:7: error: incompatible pointer types assigning to 'u32 *' (aka 'unsigned int *') from 'phys_addr_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
245 | src = &achan->slave.src_addr;
| ^ ~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/qcom/qcom_adm.c:251:7: error: incompatible pointer types assigning to 'u32 *' (aka 'unsigned int *') from 'phys_addr_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
251 | dst = &achan->slave.dst_addr;
| ^ ~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/qcom/qcom_adm.c:309:7: error: incompatible pointer types assigning to 'u32 *' (aka 'unsigned int *') from 'phys_addr_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
309 | src = &achan->slave.src_addr;
| ^ ~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/qcom/qcom_adm.c:313:7: error: incompatible pointer types assigning to 'u32 *' (aka 'unsigned int *') from 'phys_addr_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
313 | dst = &achan->slave.dst_addr;
| ^ ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/dma/qcom/qcom_adm.c:848:59: warning: implicit conversion from 'unsigned long' to 'unsigned int' changes value from 18446744072371568648 to 2956984328 [-Wconstant-conversion]
848 | writel(ADM_CI_RANGE_START(0x40) | ADM_CI_RANGE_END(0xb0) |
| ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
849 | ADM_CI_BURST_8_WORDS, adev->regs + ADM_CI_CONF(0));
| ~~~~~~~~~~~~~~~~~~~~1 warning and 4 errors generated.
vim +848 drivers/dma/qcom/qcom_adm.c
03de6b273805b3 Arnd Bergmann 2021-11-22 745
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 746 static int adm_dma_probe(struct platform_device *pdev)
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 747 {
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 748 struct adm_device *adev;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 749 int ret;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 750 u32 i;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 751
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 752 adev = devm_kzalloc(&pdev->dev, sizeof(*adev), GFP_KERNEL);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 753 if (!adev)
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 754 return -ENOMEM;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 755
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 756 adev->dev = &pdev->dev;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 757
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 758 adev->regs = devm_platform_ioremap_resource(pdev, 0);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 759 if (IS_ERR(adev->regs))
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 760 return PTR_ERR(adev->regs);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 761
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 762 adev->irq = platform_get_irq(pdev, 0);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 763 if (adev->irq < 0)
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 764 return adev->irq;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 765
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 766 ret = of_property_read_u32(pdev->dev.of_node, "qcom,ee", &adev->ee);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 767 if (ret) {
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 768 dev_err(adev->dev, "Execution environment unspecified\n");
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 769 return ret;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 770 }
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 771
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 772 adev->core_clk = devm_clk_get(adev->dev, "core");
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 773 if (IS_ERR(adev->core_clk))
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 774 return PTR_ERR(adev->core_clk);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 775
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 776 adev->iface_clk = devm_clk_get(adev->dev, "iface");
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 777 if (IS_ERR(adev->iface_clk))
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 778 return PTR_ERR(adev->iface_clk);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 779
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 780 adev->clk_reset = devm_reset_control_get_exclusive(&pdev->dev, "clk");
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 781 if (IS_ERR(adev->clk_reset)) {
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 782 dev_err(adev->dev, "failed to get ADM0 reset\n");
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 783 return PTR_ERR(adev->clk_reset);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 784 }
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 785
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 786 adev->c0_reset = devm_reset_control_get_exclusive(&pdev->dev, "c0");
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 787 if (IS_ERR(adev->c0_reset)) {
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 788 dev_err(adev->dev, "failed to get ADM0 C0 reset\n");
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 789 return PTR_ERR(adev->c0_reset);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 790 }
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 791
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 792 adev->c1_reset = devm_reset_control_get_exclusive(&pdev->dev, "c1");
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 793 if (IS_ERR(adev->c1_reset)) {
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 794 dev_err(adev->dev, "failed to get ADM0 C1 reset\n");
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 795 return PTR_ERR(adev->c1_reset);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 796 }
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 797
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 798 adev->c2_reset = devm_reset_control_get_exclusive(&pdev->dev, "c2");
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 799 if (IS_ERR(adev->c2_reset)) {
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 800 dev_err(adev->dev, "failed to get ADM0 C2 reset\n");
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 801 return PTR_ERR(adev->c2_reset);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 802 }
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 803
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 804 ret = clk_prepare_enable(adev->core_clk);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 805 if (ret) {
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 806 dev_err(adev->dev, "failed to prepare/enable core clock\n");
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 807 return ret;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 808 }
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 809
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 810 ret = clk_prepare_enable(adev->iface_clk);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 811 if (ret) {
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 812 dev_err(adev->dev, "failed to prepare/enable iface clock\n");
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 813 goto err_disable_core_clk;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 814 }
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 815
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 816 reset_control_assert(adev->clk_reset);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 817 reset_control_assert(adev->c0_reset);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 818 reset_control_assert(adev->c1_reset);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 819 reset_control_assert(adev->c2_reset);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 820
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 821 udelay(2);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 822
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 823 reset_control_deassert(adev->clk_reset);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 824 reset_control_deassert(adev->c0_reset);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 825 reset_control_deassert(adev->c1_reset);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 826 reset_control_deassert(adev->c2_reset);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 827
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 828 adev->channels = devm_kcalloc(adev->dev, ADM_MAX_CHANNELS,
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 829 sizeof(*adev->channels), GFP_KERNEL);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 830
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 831 if (!adev->channels) {
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 832 ret = -ENOMEM;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 833 goto err_disable_clks;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 834 }
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 835
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 836 /* allocate and initialize channels */
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 837 INIT_LIST_HEAD(&adev->common.channels);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 838
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 839 for (i = 0; i < ADM_MAX_CHANNELS; i++)
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 840 adm_channel_init(adev, &adev->channels[i], i);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 841
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 842 /* reset CRCIs */
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 843 for (i = 0; i < 16; i++)
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 844 writel(ADM_CRCI_CTL_RST, adev->regs +
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 845 ADM_CRCI_CTL(i, adev->ee));
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 846
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 847 /* configure client interfaces */
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 @848 writel(ADM_CI_RANGE_START(0x40) | ADM_CI_RANGE_END(0xb0) |
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 849 ADM_CI_BURST_8_WORDS, adev->regs + ADM_CI_CONF(0));
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 850 writel(ADM_CI_RANGE_START(0x2a) | ADM_CI_RANGE_END(0x2c) |
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 851 ADM_CI_BURST_8_WORDS, adev->regs + ADM_CI_CONF(1));
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 852 writel(ADM_CI_RANGE_START(0x12) | ADM_CI_RANGE_END(0x28) |
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 853 ADM_CI_BURST_8_WORDS, adev->regs + ADM_CI_CONF(2));
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 854 writel(ADM_GP_CTL_LP_EN | ADM_GP_CTL_LP_CNT(0xf),
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 855 adev->regs + ADM_GP_CTL);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 856
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 857 ret = devm_request_irq(adev->dev, adev->irq, adm_dma_irq,
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 858 0, "adm_dma", adev);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 859 if (ret)
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 860 goto err_disable_clks;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 861
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 862 platform_set_drvdata(pdev, adev);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 863
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 864 adev->common.dev = adev->dev;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 865 adev->common.dev->dma_parms = &adev->dma_parms;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 866
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 867 /* set capabilities */
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 868 dma_cap_zero(adev->common.cap_mask);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 869 dma_cap_set(DMA_SLAVE, adev->common.cap_mask);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 870 dma_cap_set(DMA_PRIVATE, adev->common.cap_mask);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 871
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 872 /* initialize dmaengine apis */
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 873 adev->common.directions = BIT(DMA_DEV_TO_MEM | DMA_MEM_TO_DEV);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 874 adev->common.residue_granularity = DMA_RESIDUE_GRANULARITY_DESCRIPTOR;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 875 adev->common.src_addr_widths = DMA_SLAVE_BUSWIDTH_4_BYTES;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 876 adev->common.dst_addr_widths = DMA_SLAVE_BUSWIDTH_4_BYTES;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 877 adev->common.device_free_chan_resources = adm_free_chan;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 878 adev->common.device_prep_slave_sg = adm_prep_slave_sg;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 879 adev->common.device_issue_pending = adm_issue_pending;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 880 adev->common.device_tx_status = adm_tx_status;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 881 adev->common.device_terminate_all = adm_terminate_all;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 882 adev->common.device_config = adm_slave_config;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 883
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 884 ret = dma_async_device_register(&adev->common);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 885 if (ret) {
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 886 dev_err(adev->dev, "failed to register dma async device\n");
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 887 goto err_disable_clks;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 888 }
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 889
03de6b273805b3 Arnd Bergmann 2021-11-22 890 ret = of_dma_controller_register(pdev->dev.of_node, adm_dma_xlate,
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 891 &adev->common);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 892 if (ret)
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 893 goto err_unregister_dma;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 894
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 895 return 0;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 896
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 897 err_unregister_dma:
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 898 dma_async_device_unregister(&adev->common);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 899 err_disable_clks:
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 900 clk_disable_unprepare(adev->iface_clk);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 901 err_disable_core_clk:
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 902 clk_disable_unprepare(adev->core_clk);
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 903
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 904 return ret;
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 905 }
5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 906 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Re: [PATCH v2 2/2] !!! TESTING ONLY !!! Allow compile virt-dma users on ARM64 platform
One more question. I can translate all other dma drivers to BH workqueue. I cannot test all of them, but I did this for sun6i and it works as usual. Fix straightforward. Is it a good idea?
That happened because of this change and this driver doesn't compile on x64. Any action from me? Should I send v3 without this change?
drivers/dma/qcom/Kconfig +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only config QCOM_ADM tristate "Qualcomm ADM support" - depends on (ARCH_QCOM || COMPILE_TEST) && !PHYS_ADDR_T_64BIT + depends on (ARCH_QCOM || COMPILE_TEST) select DMA_ENGINE select DMA_VIRTUAL_CHANNELS help
вт, 17 июн. 2025 г. в 12:31, kernel test robot <[email protected]>:
Quoted 215 lines
Hi Alexander,
kernel test robot noticed the following build warnings:
[auto build test WARNING on vkoul-dmaengine/next]
[also build test WARNING on shawnguo/for-next sunxi/sunxi/for-next lee-mfd/for-mfd-next linus/master v6.16-rc2 next-20250617] [cannot apply to atorgue-stm32/stm32-next lee-mfd/for-mfd-fixes]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]url: https://github.com/intel-lab-lkp/linux/commits/Alexander-Kochetkov/dmaengine-virt-dma-convert-tasklet-to-BH-workqueue-for-callback-invocation/20250616-205118 base: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git next patch link: https://lore.kernel.org/r/20250616124934.141782-3-al.kochet%40gmail.com patch subject: [PATCH v2 2/2] !!! TESTING ONLY !!! Allow compile virt-dma users on ARM64 platform config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20250617/[email protected]/config) compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250617/[email protected]/reproduce)If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/All warnings (new ones prefixed by >>):
drivers/dma/qcom/qcom_adm.c:245:7: error: incompatible pointer types assigning to 'u32 *' (aka 'unsigned int *') from 'phys_addr_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types] 245 | src = &achan->slave.src_addr; | ^ ~~~~~~~~~~~~~~~~~~~~~~ drivers/dma/qcom/qcom_adm.c:251:7: error: incompatible pointer types assigning to 'u32 *' (aka 'unsigned int *') from 'phys_addr_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types] 251 | dst = &achan->slave.dst_addr; | ^ ~~~~~~~~~~~~~~~~~~~~~~ drivers/dma/qcom/qcom_adm.c:309:7: error: incompatible pointer types assigning to 'u32 *' (aka 'unsigned int *') from 'phys_addr_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types] 309 | src = &achan->slave.src_addr; | ^ ~~~~~~~~~~~~~~~~~~~~~~ drivers/dma/qcom/qcom_adm.c:313:7: error: incompatible pointer types assigning to 'u32 *' (aka 'unsigned int *') from 'phys_addr_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types] 313 | dst = &achan->slave.dst_addr; | ^ ~~~~~~~~~~~~~~~~~~~~~~Quoted 1 line
Quoted 1 line
drivers/dma/qcom/qcom_adm.c:848:59: warning: implicit conversion from 'unsigned long' to 'unsigned int' changes value from 18446744072371568648 to 2956984328 [-Wconstant-conversion]848 | writel(ADM_CI_RANGE_START(0x40) | ADM_CI_RANGE_END(0xb0) | | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 849 | ADM_CI_BURST_8_WORDS, adev->regs + ADM_CI_CONF(0)); | ~~~~~~~~~~~~~~~~~~~~1 warning and 4 errors generated.
vim +848
drivers/dma/qcom/qcom_adm.c03de6b273805b3 Arnd Bergmann 2021-11-22 745 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 746 static int adm_dma_probe(struct platform_device *pdev) 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 747 { 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 748 struct adm_device *adev; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 749 int ret; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 750 u32 i; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 751 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 752 adev = devm_kzalloc(&pdev->dev, sizeof(*adev), GFP_KERNEL); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 753 if (!adev) 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 754 return -ENOMEM; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 755 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 756 adev->dev = &pdev->dev; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 757 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 758 adev->regs = devm_platform_ioremap_resource(pdev, 0); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 759 if (IS_ERR(adev->regs)) 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 760 return PTR_ERR(adev->regs); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 761 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 762 adev->irq = platform_get_irq(pdev, 0); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 763 if (adev->irq < 0) 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 764 return adev->irq; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 765 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 766 ret = of_property_read_u32(pdev->dev.of_node, "qcom,ee", &adev->ee); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 767 if (ret) { 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 768 dev_err(adev->dev, "Execution environment unspecified\n"); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 769 return ret; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 770 } 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 771 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 772 adev->core_clk = devm_clk_get(adev->dev, "core"); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 773 if (IS_ERR(adev->core_clk)) 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 774 return PTR_ERR(adev->core_clk); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 775 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 776 adev->iface_clk = devm_clk_get(adev->dev, "iface"); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 777 if (IS_ERR(adev->iface_clk)) 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 778 return PTR_ERR(adev->iface_clk); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 779 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 780 adev->clk_reset = devm_reset_control_get_exclusive(&pdev->dev, "clk"); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 781 if (IS_ERR(adev->clk_reset)) { 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 782 dev_err(adev->dev, "failed to get ADM0 reset\n"); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 783 return PTR_ERR(adev->clk_reset); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 784 } 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 785 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 786 adev->c0_reset = devm_reset_control_get_exclusive(&pdev->dev, "c0"); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 787 if (IS_ERR(adev->c0_reset)) { 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 788 dev_err(adev->dev, "failed to get ADM0 C0 reset\n"); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 789 return PTR_ERR(adev->c0_reset); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 790 } 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 791 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 792 adev->c1_reset = devm_reset_control_get_exclusive(&pdev->dev, "c1"); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 793 if (IS_ERR(adev->c1_reset)) { 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 794 dev_err(adev->dev, "failed to get ADM0 C1 reset\n"); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 795 return PTR_ERR(adev->c1_reset); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 796 } 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 797 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 798 adev->c2_reset = devm_reset_control_get_exclusive(&pdev->dev, "c2"); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 799 if (IS_ERR(adev->c2_reset)) { 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 800 dev_err(adev->dev, "failed to get ADM0 C2 reset\n"); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 801 return PTR_ERR(adev->c2_reset); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 802 } 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 803 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 804 ret = clk_prepare_enable(adev->core_clk); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 805 if (ret) { 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 806 dev_err(adev->dev, "failed to prepare/enable core clock\n"); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 807 return ret; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 808 } 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 809 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 810 ret = clk_prepare_enable(adev->iface_clk); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 811 if (ret) { 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 812 dev_err(adev->dev, "failed to prepare/enable iface clock\n"); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 813 goto err_disable_core_clk; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 814 } 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 815 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 816 reset_control_assert(adev->clk_reset); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 817 reset_control_assert(adev->c0_reset); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 818 reset_control_assert(adev->c1_reset); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 819 reset_control_assert(adev->c2_reset); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 820 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 821 udelay(2); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 822 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 823 reset_control_deassert(adev->clk_reset); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 824 reset_control_deassert(adev->c0_reset); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 825 reset_control_deassert(adev->c1_reset); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 826 reset_control_deassert(adev->c2_reset); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 827 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 828 adev->channels = devm_kcalloc(adev->dev, ADM_MAX_CHANNELS, 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 829 sizeof(*adev->channels), GFP_KERNEL); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 830 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 831 if (!adev->channels) { 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 832 ret = -ENOMEM; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 833 goto err_disable_clks; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 834 } 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 835 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 836 /* allocate and initialize channels */ 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 837 INIT_LIST_HEAD(&adev->common.channels); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 838 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 839 for (i = 0; i < ADM_MAX_CHANNELS; i++) 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 840 adm_channel_init(adev, &adev->channels[i], i); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 841 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 842 /* reset CRCIs */ 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 843 for (i = 0; i < 16; i++) 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 844 writel(ADM_CRCI_CTL_RST, adev->regs + 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 845 ADM_CRCI_CTL(i, adev->ee)); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 846 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 847 /* configure client interfaces */ 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 @848 writel(ADM_CI_RANGE_START(0x40) | ADM_CI_RANGE_END(0xb0) | 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 849 ADM_CI_BURST_8_WORDS, adev->regs + ADM_CI_CONF(0)); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 850 writel(ADM_CI_RANGE_START(0x2a) | ADM_CI_RANGE_END(0x2c) | 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 851 ADM_CI_BURST_8_WORDS, adev->regs + ADM_CI_CONF(1)); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 852 writel(ADM_CI_RANGE_START(0x12) | ADM_CI_RANGE_END(0x28) | 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 853 ADM_CI_BURST_8_WORDS, adev->regs + ADM_CI_CONF(2)); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 854 writel(ADM_GP_CTL_LP_EN | ADM_GP_CTL_LP_CNT(0xf), 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 855 adev->regs + ADM_GP_CTL); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 856 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 857 ret = devm_request_irq(adev->dev, adev->irq, adm_dma_irq, 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 858 0, "adm_dma", adev); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 859 if (ret) 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 860 goto err_disable_clks; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 861 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 862 platform_set_drvdata(pdev, adev); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 863 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 864 adev->common.dev = adev->dev; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 865 adev->common.dev->dma_parms = &adev->dma_parms; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 866 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 867 /* set capabilities */ 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 868 dma_cap_zero(adev->common.cap_mask); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 869 dma_cap_set(DMA_SLAVE, adev->common.cap_mask); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 870 dma_cap_set(DMA_PRIVATE, adev->common.cap_mask); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 871 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 872 /* initialize dmaengine apis */ 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 873 adev->common.directions = BIT(DMA_DEV_TO_MEM | DMA_MEM_TO_DEV); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 874 adev->common.residue_granularity = DMA_RESIDUE_GRANULARITY_DESCRIPTOR; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 875 adev->common.src_addr_widths = DMA_SLAVE_BUSWIDTH_4_BYTES; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 876 adev->common.dst_addr_widths = DMA_SLAVE_BUSWIDTH_4_BYTES; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 877 adev->common.device_free_chan_resources = adm_free_chan; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 878 adev->common.device_prep_slave_sg = adm_prep_slave_sg; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 879 adev->common.device_issue_pending = adm_issue_pending; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 880 adev->common.device_tx_status = adm_tx_status; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 881 adev->common.device_terminate_all = adm_terminate_all; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 882 adev->common.device_config = adm_slave_config; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 883 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 884 ret = dma_async_device_register(&adev->common); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 885 if (ret) { 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 886 dev_err(adev->dev, "failed to register dma async device\n"); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 887 goto err_disable_clks; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 888 } 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 889 03de6b273805b3 Arnd Bergmann 2021-11-22 890 ret = of_dma_controller_register(pdev->dev.of_node, adm_dma_xlate, 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 891 &adev->common); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 892 if (ret) 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 893 goto err_unregister_dma; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 894 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 895 return 0; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 896 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 897 err_unregister_dma: 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 898 dma_async_device_unregister(&adev->common); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 899 err_disable_clks: 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 900 clk_disable_unprepare(adev->iface_clk); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 901 err_disable_core_clk: 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 902 clk_disable_unprepare(adev->core_clk); 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 903 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 904 return ret; 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 905 } 5c9f8c2dbdbe53 Jonathan McDowell 2020-11-14 906--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH v2 2/2] !!! TESTING ONLY !!! Allow compile virt-dma users on ARM64 platform
Quoted 7 lines · Alexander Kochetkov
One more question. I can translate all other dma drivers to BH workqueue. I cannot test all of them, but I did this for sun6i and it works as usual. Fix straightforward. Is it a good idea?
That happened because of this change and this driver doesn't compile on x64. Any action from me? Should I send v3 without this change?
I wouldn't do anything. You explained well what's going on beforehand along with the proper subject. This was expected, so only if the maintainer asks you to do something. But modern tools, such as b4, allows to pick up the certain patch(es) from the series, hence it can be done easily without any need of being re-sent.
Signature · 2 lines
With Best Regards, Andy Shevchenko
kernel test robot
build botRe: [PATCH v2 2/2] !!! TESTING ONLY !!! Allow compile virt-dma users on ARM64 platform
In reply to Alexander Kochetkovkernel test robot noticed the following build warnings:
Hi Alexander,
kernel test robot noticed the following build warnings:
[auto build test WARNING on vkoul-dmaengine/next]
[also build test WARNING on shawnguo/for-next sunxi/sunxi/for-next lee-mfd/for-mfd-next linus/master v6.16-rc2 next-20250617] [cannot apply to atorgue-stm32/stm32-next lee-mfd/for-mfd-fixes]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Alexander-Kochetkov/dmaengine-virt-dma-convert-tasklet-to-BH-workqueue-for-callback-invocation/20250616-205118 base: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git next patch link: https://lore.kernel.org/r/20250616124934.141782-3-al.kochet%40gmail.com patch subject: [PATCH v2 2/2] !!! TESTING ONLY !!! Allow compile virt-dma users on ARM64 platform config: arm64-kismet-CONFIG_TI_K3_RINGACC-CONFIG_TI_K3_UDMA-0-0 (https://download.01.org/0day-ci/archive/20250617/[email protected]/config) reproduce: (https://download.01.org/0day-ci/archive/20250617/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
kismet warnings: (new ones prefixed by >>)
>> kismet: WARNING: unmet direct dependencies detected for TI_K3_RINGACC when selected by TI_K3_UDMA
WARNING: unmet direct dependencies detected for TI_K3_RINGACC
Depends on [n]: SOC_TI [=n] && (ARCH_K3 [=n] || COMPILE_TEST [=y]) && TI_SCI_INTA_IRQCHIP [=y]
Selected by [y]:
- TI_K3_UDMA [=y] && DMADEVICES [=y] && (ARCH_K3 [=n] || COMPILE_TEST [=y]) && TI_SCI_PROTOCOL [=y] && TI_SCI_INTA_IRQCHIP [=y]
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botRe: [PATCH v2 2/2] !!! TESTING ONLY !!! Allow compile virt-dma users on ARM64 platform
In reply to Alexander Kochetkovkernel test robot noticed the following build errors:
Hi Alexander,
kernel test robot noticed the following build errors:
[auto build test ERROR on vkoul-dmaengine/next]
[also build test ERROR on shawnguo/for-next sunxi/sunxi/for-next lee-mfd/for-mfd-next linus/master v6.16-rc2 next-20250617] [cannot apply to atorgue-stm32/stm32-next lee-mfd/for-mfd-fixes]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Alexander-Kochetkov/dmaengine-virt-dma-convert-tasklet-to-BH-workqueue-for-callback-invocation/20250616-205118 base: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git next patch link: https://lore.kernel.org/r/20250616124934.141782-3-al.kochet%40gmail.com patch subject: [PATCH v2 2/2] !!! TESTING ONLY !!! Allow compile virt-dma users on ARM64 platform config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20250617/[email protected]/config) compiler: m68k-linux-gcc (GCC) 15.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250617/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
In file included from drivers/dma/fsldma.c:37:
drivers/dma/fsldma.c: In function 'set_sr':
>> drivers/dma/fsldma.h:254:25: error: implicit declaration of function 'fsl_iowrite32be'; did you mean 'iowrite32be'? [-Wimplicit-function-declaration]
254 | fsl_iowrite##width##be(val, addr) : fsl_iowrite \
| ^~~~~~~~~~~
drivers/dma/fsldma.c:52:9: note: in expansion of macro 'FSL_DMA_OUT'
52 | FSL_DMA_OUT(chan, &chan->regs->sr, val, 32);
| ^~~~~~~~~~~
>> drivers/dma/fsldma.h:254:61: error: implicit declaration of function 'fsl_iowrite32'; did you mean 'gf_iowrite32'? [-Wimplicit-function-declaration]
254 | fsl_iowrite##width##be(val, addr) : fsl_iowrite \
| ^~~~~~~~~~~
drivers/dma/fsldma.c:52:9: note: in expansion of macro 'FSL_DMA_OUT'
52 | FSL_DMA_OUT(chan, &chan->regs->sr, val, 32);
| ^~~~~~~~~~~
drivers/dma/fsldma.c: In function 'get_sr':
>> drivers/dma/fsldma.h:250:25: error: implicit declaration of function 'fsl_ioread32be'; did you mean 'ioread32be'? [-Wimplicit-function-declaration]
250 | fsl_ioread##width##be(addr) : fsl_ioread##width(addr))
| ^~~~~~~~~~
drivers/dma/fsldma.c:57:16: note: in expansion of macro 'FSL_DMA_IN'
57 | return FSL_DMA_IN(chan, &chan->regs->sr, 32);
| ^~~~~~~~~~
>> drivers/dma/fsldma.h:250:55: error: implicit declaration of function 'fsl_ioread32'; did you mean 'gf_ioread32'? [-Wimplicit-function-declaration]
250 | fsl_ioread##width##be(addr) : fsl_ioread##width(addr))
| ^~~~~~~~~~
drivers/dma/fsldma.c:57:16: note: in expansion of macro 'FSL_DMA_IN'
57 | return FSL_DMA_IN(chan, &chan->regs->sr, 32);
| ^~~~~~~~~~
drivers/dma/fsldma.c: In function 'set_cdar':
>> drivers/dma/fsldma.h:254:25: error: implicit declaration of function 'fsl_iowrite64be' [-Wimplicit-function-declaration]
254 | fsl_iowrite##width##be(val, addr) : fsl_iowrite \
| ^~~~~~~~~~~
drivers/dma/fsldma.c:72:9: note: in expansion of macro 'FSL_DMA_OUT'
72 | FSL_DMA_OUT(chan, &chan->regs->cdar, addr | FSL_DMA_SNEN, 64);
| ^~~~~~~~~~~
>> drivers/dma/fsldma.h:254:61: error: implicit declaration of function 'fsl_iowrite64' [-Wimplicit-function-declaration]
254 | fsl_iowrite##width##be(val, addr) : fsl_iowrite \
| ^~~~~~~~~~~
drivers/dma/fsldma.c:72:9: note: in expansion of macro 'FSL_DMA_OUT'
72 | FSL_DMA_OUT(chan, &chan->regs->cdar, addr | FSL_DMA_SNEN, 64);
| ^~~~~~~~~~~
drivers/dma/fsldma.c: In function 'get_cdar':
>> drivers/dma/fsldma.h:250:25: error: implicit declaration of function 'fsl_ioread64be' [-Wimplicit-function-declaration]
250 | fsl_ioread##width##be(addr) : fsl_ioread##width(addr))
| ^~~~~~~~~~
drivers/dma/fsldma.c:77:16: note: in expansion of macro 'FSL_DMA_IN'
77 | return FSL_DMA_IN(chan, &chan->regs->cdar, 64) & ~FSL_DMA_SNEN;
| ^~~~~~~~~~
>> drivers/dma/fsldma.h:250:55: error: implicit declaration of function 'fsl_ioread64' [-Wimplicit-function-declaration]
250 | fsl_ioread##width##be(addr) : fsl_ioread##width(addr))
| ^~~~~~~~~~
drivers/dma/fsldma.c:77:16: note: in expansion of macro 'FSL_DMA_IN'
77 | return FSL_DMA_IN(chan, &chan->regs->cdar, 64) & ~FSL_DMA_SNEN;
| ^~~~~~~~~~
drivers/dma/fsldma.c: In function 'fsl_chan_set_src_loop_size':
>> drivers/dma/fsldma.c:269:44: error: implicit declaration of function '__ilog2'; did you mean 'ilog2'? [-Wimplicit-function-declaration]
269 | mode |= FSL_DMA_MR_SAHE | (__ilog2(size) << 14);
| ^~~~~~~
| ilog2vim +254 drivers/dma/fsldma.h
a1ff82a9c165ba Peng Ma 2018-10-30 247 a1ff82a9c165ba Peng Ma 2018-10-30 248 #define FSL_DMA_IN(fsl_dma, addr, width) \ a1ff82a9c165ba Peng Ma 2018-10-30 249 (((fsl_dma)->feature & FSL_DMA_BIG_ENDIAN) ? \ a1ff82a9c165ba Peng Ma 2018-10-30 @250 fsl_ioread##width##be(addr) : fsl_ioread##width(addr)) a1ff82a9c165ba Peng Ma 2018-10-30 251 a1ff82a9c165ba Peng Ma 2018-10-30 252 #define FSL_DMA_OUT(fsl_dma, addr, val, width) \ a1ff82a9c165ba Peng Ma 2018-10-30 253 (((fsl_dma)->feature & FSL_DMA_BIG_ENDIAN) ? \ a1ff82a9c165ba Peng Ma 2018-10-30 @254 fsl_iowrite##width##be(val, addr) : fsl_iowrite \ a1ff82a9c165ba Peng Ma 2018-10-30 255 ##width(val, addr))
173acc7ce8538f Zhang Wei 2008-03-01 256
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botRe: [PATCH v2 2/2] !!! TESTING ONLY !!! Allow compile virt-dma users on ARM64 platform
In reply to Alexander Kochetkovkernel test robot noticed the following build warnings:
Hi Alexander,
kernel test robot noticed the following build warnings:
[auto build test WARNING on vkoul-dmaengine/next]
[also build test WARNING on shawnguo/for-next sunxi/sunxi/for-next lee-mfd/for-mfd-next linus/master v6.16-rc2 next-20250617] [cannot apply to atorgue-stm32/stm32-next lee-mfd/for-mfd-fixes]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Alexander-Kochetkov/dmaengine-virt-dma-convert-tasklet-to-BH-workqueue-for-callback-invocation/20250616-205118 base: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git next patch link: https://lore.kernel.org/r/20250616124934.141782-3-al.kochet%40gmail.com patch subject: [PATCH v2 2/2] !!! TESTING ONLY !!! Allow compile virt-dma users on ARM64 platform config: sh-kismet-CONFIG_COMMON_CLK-CONFIG_MFD_INTEL_LPSS-0-0 (https://download.01.org/0day-ci/archive/20250617/[email protected]/config) reproduce: (https://download.01.org/0day-ci/archive/20250617/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
kismet warnings: (new ones prefixed by >>)
>> kismet: WARNING: unmet direct dependencies detected for COMMON_CLK when selected by MFD_INTEL_LPSS
WARNING: unmet direct dependencies detected for COMMON_CLK
Depends on [n]: !HAVE_LEGACY_CLK [=y]
Selected by [y]:
- MFD_INTEL_LPSS [=y] && HAS_IOMEM [=y]
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki