Skip to content

Commit 8ca9590

Browse files
Yemike-Abhilash-Chandravinodkoul
authored andcommitted
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]>
1 parent df180e6 commit 8ca9590

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
@@ -4246,7 +4246,6 @@ static struct dma_chan *udma_of_xlate(struct of_phandle_args *dma_spec,
42464246
struct of_dma *ofdma)
42474247
{
42484248
struct udma_dev *ud = ofdma->of_dma_data;
4249-
dma_cap_mask_t mask = ud->ddev.cap_mask;
42504249
struct udma_filter_param filter_param;
42514250
struct dma_chan *chan;
42524251

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

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

0 commit comments

Comments
 (0)