android_kernel_motorola_sm6375/drivers/dma
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Stephan Gerhold 2e257a6125 dmaengine: qcom: bam_dma: Fix DT error handling for num-channels/ees
commit 5068b5254812433e841a40886e695633148d362d upstream.

When we don't have a clock specified in the device tree, we have no way to
ensure the BAM is on. This is often the case for remotely-controlled or
remotely-powered BAM instances. In this case, we need to read num-channels
from the DT to have all the necessary information to complete probing.

However, at the moment invalid device trees without clock and without
num-channels still continue probing, because the error handling is missing
return statements. The driver will then later try to read the number of
channels from the registers. This is unsafe, because it relies on boot
firmware and lucky timing to succeed. Unfortunately, the lack of proper
error handling here has been abused for several Qualcomm SoCs upstream,
causing early boot crashes in several situations [1, 2].

Avoid these early crashes by erroring out when any of the required DT
properties are missing. Note that this will break some of the existing DTs
upstream (mainly BAM instances related to the crypto engine). However,
clearly these DTs have never been tested properly, since the error in the
kernel log was just ignored. It's safer to disable the crypto engine for
these broken DTBs.

[1]: https://lore.kernel.org/r/CY01EKQVWE36.B9X5TDXAREPF@fairphone.com/
[2]: https://lore.kernel.org/r/20230626145959.646747-1-krzysztof.kozlowski@linaro.org/

Cc: stable@vger.kernel.org
Fixes: 48d163b1aa ("dmaengine: qcom: bam_dma: get num-channels and num-ees from dt")
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250212-bam-dma-fixes-v1-8-f560889e65d8@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-02 13:34:29 +02:00
..
bestcomm
dw
dw-axi-dmac
dw-edma
hsu
ioat dmaengine: ioatdma: Fix missing kmem_cache_destroy() 2024-07-05 09:08:23 +02:00
ipu
mediatek dmaengine: mediatek: Fix a flag reuse error in mtk_cqdma_tx_status() 2025-09-09 18:44:02 +02:00
ppc4xx
qcom dmaengine: qcom: bam_dma: Fix DT error handling for num-channels/ees 2025-10-02 13:34:29 +02:00
sh dmaengine: shdma: increase size of 'dev_id' 2024-03-01 13:13:33 +01:00
ti dmaengine: ti: edma: Fix memory allocation size for queue_priority_map 2025-10-02 13:34:29 +02:00
xilinx dmaengine: xilinx_dma: Set dma_device directions 2025-07-17 18:24:49 +02:00
acpi-dma.c
altera-msgdma.c
amba-pl08x.c
at_hdmac.c
at_hdmac_regs.h
at_xdmac.c dmaengine: at_xdmac: avoid null_prt_deref in at_xdmac_prep_dma_memset 2025-01-09 13:23:31 +01:00
bcm-sba-raid.c
bcm2835-dma.c
coh901318.c
coh901318.h
coh901318_lli.c
dma-axi-dmac.c dmaengine: axi-dmac: fix possible race in remove() 2024-07-05 09:08:19 +02:00
dma-jz4780.c
dmaengine.c
dmaengine.h
dmatest.c dmaengine: Revert "dmaengine: dmatest: Fix dmatest waiting less when interrupted" 2025-06-04 14:32:29 +02:00
ep93xx_dma.c
fsl-edma-common.c
fsl-edma-common.h
fsl-edma.c
fsl-qdma.c dmaengine: fsl-qdma: init irq after reg initialization 2024-03-06 14:36:09 +00:00
fsl_raid.c
fsl_raid.h
fsldma.c
fsldma.h
idma64.c dmaengine: idma64: Add check for dma_set_max_seg_size 2024-06-16 13:28:41 +02:00
idma64.h
img-mdc-dma.c
imx-dma.c
imx-sdma.c
iop-adma.c
iop-adma.h
k3dma.c
Kconfig dmaengine: tegra210-adma: Update dependency to ARCH_TEGRA 2024-03-26 18:22:19 -04:00
lpc18xx-dmamux.c
Makefile
mcf-edma.c dmaengine: mcf-edma: Fix a potential un-allocated memory access 2023-08-16 18:19:24 +02:00
mic_x100_dma.c
mic_x100_dma.h
mmp_pdma.c
mmp_tdma.c
moxart-dma.c
mpc512x_dma.c
mv_xor.c dmaengine: mv_xor: Fix missing check after DMA map and missing unmap 2025-08-28 16:21:21 +02:00
mv_xor.h
mv_xor_v2.c
mxs-dma.c
nbpfaxi.c dmaengine: nbpfaxi: Add missing check after DMA map 2025-08-28 16:21:21 +02:00
of-dma.c
owl-dma.c dmaengine: owl: fix register access functions 2024-05-02 16:18:37 +02:00
pch_dma.c
pl330.c dmaengine: Revert "dmaengine: pl330: issue_pending waits until WFP state" 2024-05-17 11:43:46 +02:00
pxa_dma.c dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc() 2023-11-20 10:30:14 +01:00
s3c24xx-dma.c
sa11x0-dma.c
sirf-dma.c
sprd-dma.c
st_fdma.c
st_fdma.h
ste_dma40.c dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe 2023-11-08 11:23:40 +01:00
ste_dma40_ll.c
ste_dma40_ll.h
stm32-dma.c
stm32-dmamux.c
stm32-mdma.c dmaengine: stm32-mdma: correct desc prep when channel running 2023-11-28 16:50:19 +00:00
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