linux/drivers/dma
Lars-Peter Clausen 9e6985190f dmaengine: dmaengine_desc_callback_valid(): Check for callback_result
[ Upstream commit e7e1e880b114ca640a2f280b0d5d38aed98f98c6 ]

Before the `callback_result` callback was introduced drivers coded their
invocation to the callback in a similar way to:

	if (cb->callback) {
		spin_unlock(&dma->lock);
		cb->callback(cb->callback_param);
		spin_lock(&dma->lock);
	}

With the introduction of `callback_result` two helpers where introduced to
transparently handle both types of callbacks. And drivers where updated to
look like this:

	if (dmaengine_desc_callback_valid(cb)) {
		spin_unlock(&dma->lock);
		dmaengine_desc_callback_invoke(cb, ...);
		spin_lock(&dma->lock);
	}

dmaengine_desc_callback_invoke() correctly handles both `callback_result`
and `callback`. But we forgot to update the dmaengine_desc_callback_valid()
function to check for `callback_result`. As a result DMA descriptors that
use the `callback_result` rather than `callback` don't have their callback
invoked by drivers that follow the pattern above.

Fix this by checking for both `callback` and `callback_result` in
dmaengine_desc_callback_valid().

Fixes: f067025bc6 ("dmaengine: add support to provide error result from a DMA transation")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20211023134101.28042-1-lars@metafoo.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-17 09:48:46 +01:00
..
bestcomm
dw
dw-axi-dmac
dw-edma
hsu
ioat
ipu
mediatek
ppc4xx
qcom
sh dmaengine: usb-dmac: Fix PM reference leak in usb_dmac_probe() 2021-08-26 08:36:13 -04:00
ti
xilinx dmaengine: xilinx_dma: Set DMA mask for coherent APIs 2021-09-26 14:07:11 +02:00
acpi-dma.c dmaengine: acpi: Avoid comparison GSI with Linux vIRQ 2021-09-26 14:07:08 +02:00
altera-msgdma.c
amba-pl08x.c
at_hdmac_regs.h
at_hdmac.c
at_xdmac.c dmaengine: at_xdmac: fix AT_XDMAC_CC_PERID() macro 2021-11-17 09:48:45 +01:00
bcm2835-dma.c
bcm-sba-raid.c
coh901318_lli.c
coh901318.c
coh901318.h
dma-axi-dmac.c
dma-jz4780.c
dmaengine.c
dmaengine.h dmaengine: dmaengine_desc_callback_valid(): Check for callback_result 2021-11-17 09:48:46 +01:00
dmatest.c
ep93xx_dma.c
fsl_raid.c
fsl_raid.h
fsl-edma-common.c
fsl-edma-common.h
fsl-edma.c
fsl-qdma.c
fsldma.c
fsldma.h
idma64.c
idma64.h
img-mdc-dma.c
imx-dma.c dmaengine: imx-dma: configure the generic DMA type to make it work 2021-08-12 13:20:56 +02:00
imx-sdma.c dmaengine: imx-sdma: remove duplicated sdma_load_context 2021-09-22 12:26:21 +02:00
iop-adma.c
iop-adma.h
k3dma.c
Kconfig dmaengine: ioat: depends on !UML 2021-09-26 14:07:11 +02:00
lpc18xx-dmamux.c
Makefile
mcf-edma.c
mic_x100_dma.c
mic_x100_dma.h
mmp_pdma.c
mmp_tdma.c
moxart-dma.c
mpc512x_dma.c
mv_xor_v2.c
mv_xor.c
mv_xor.h
mxs-dma.c
nbpfaxi.c
of-dma.c dmaengine: of-dma: router_xlate to return -EPROBE_DEFER if controller is not yet available 2021-08-26 08:36:13 -04:00
owl-dma.c
pch_dma.c
pl330.c
pxa_dma.c
s3c24xx-dma.c
sa11x0-dma.c
sirf-dma.c
sprd-dma.c dmaengine: sprd: Add missing MODULE_DEVICE_TABLE 2021-09-26 14:07:10 +02:00
st_fdma.c
st_fdma.h
ste_dma40_ll.c
ste_dma40_ll.h
ste_dma40.c
stm32-dma.c
stm32-dmamux.c
stm32-mdma.c
sun4i-dma.c
sun6i-dma.c
tegra20-apb-dma.c
tegra210-adma.c
timb_dma.c
TODO
txx9dmac.c
txx9dmac.h
uniphier-mdmac.c
virt-dma.c
virt-dma.h
xgene-dma.c
zx_dma.c