Skip to content

Commit f745ef6

Browse files
committed
dmaengine: ti: k3-udma: Use cap_mask directly from dma_device structure instead of a local copy
JIRA: https://issues.redhat.com/browse/RHEL-114133 Upstream-Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git commit 8ca9590 Author: Yemike Abhilash Chandra <[email protected]> Date: Thu Apr 17 13:25:21 2025 +0530 dmaengine: ti: k3-udma: Use cap_mask directly from dma_device structure instead of a local copy Currently, a local dma_cap_mask_t variable is used to store device cap_mask within udma_of_xlate(). However, the DMA_PRIVATE flag in the device cap_mask can get cleared when the last channel is released. This can happen right after storing the cap_mask locally in udma_of_xlate(), and subsequent dma_request_channel() can fail due to mismatch in the cap_mask. Fix this by removing the local dma_cap_mask_t variable and directly using the one from the dma_device structure. Fixes: 25dcb5d ("dmaengine: ti: New driver for K3 UDMA") Cc: [email protected] Signed-off-by: Vaishnav Achath <[email protected]> Acked-by: Peter Ujfalusi <[email protected]> Reviewed-by: Udit Kumar <[email protected]> Signed-off-by: Yemike Abhilash Chandra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]> (cherry picked from commit 8ca9590) Signed-off-by: Jerry Snitselaar <[email protected]>
1 parent 688b017 commit f745ef6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/dma/ti/k3-udma.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4247,7 +4247,6 @@ static struct dma_chan *udma_of_xlate(struct of_phandle_args *dma_spec,
42474247
struct of_dma *ofdma)
42484248
{
42494249
struct udma_dev *ud = ofdma->of_dma_data;
4250-
dma_cap_mask_t mask = ud->ddev.cap_mask;
42514250
struct udma_filter_param filter_param;
42524251
struct dma_chan *chan;
42534252

@@ -4279,7 +4278,7 @@ static struct dma_chan *udma_of_xlate(struct of_phandle_args *dma_spec,
42794278
}
42804279
}
42814280

4282-
chan = __dma_request_channel(&mask, udma_dma_filter_fn, &filter_param,
4281+
chan = __dma_request_channel(&ud->ddev.cap_mask, udma_dma_filter_fn, &filter_param,
42834282
ofdma->of_node);
42844283
if (!chan) {
42854284
dev_err(ud->dev, "get channel fail in %s.\n", __func__);

0 commit comments

Comments
 (0)