* [PATCH RESEND] dmaengine: ti: k3-udma: Use cap_mask directly from dma_device structure instead of a local copy
@ 2025-04-17 7:55 Yemike Abhilash Chandra
2025-04-17 15:18 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Yemike Abhilash Chandra @ 2025-04-17 7:55 UTC (permalink / raw)
To: peter.ujfalusi, grygorii.strashko, vkoul
Cc: vaishnav.a, u-kumar1, dmaengine, linux-kernel, y-abhilashchandra, stable
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: 25dcb5dd7b7c ("dmaengine: ti: New driver for K3 UDMA")
Cc: stable@vger.kernel.org
Signed-off-by: Vaishnav Achath <vaishnav.a@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
Signed-off-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com>
---
drivers/dma/ti/k3-udma.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
index b223a7aacb0c..08ed8cd7f1dd 100644
--- a/drivers/dma/ti/k3-udma.c
+++ b/drivers/dma/ti/k3-udma.c
@@ -4246,7 +4246,6 @@ static struct dma_chan *udma_of_xlate(struct of_phandle_args *dma_spec,
struct of_dma *ofdma)
{
struct udma_dev *ud = ofdma->of_dma_data;
- dma_cap_mask_t mask = ud->ddev.cap_mask;
struct udma_filter_param filter_param;
struct dma_chan *chan;
@@ -4278,7 +4277,7 @@ static struct dma_chan *udma_of_xlate(struct of_phandle_args *dma_spec,
}
}
- chan = __dma_request_channel(&mask, udma_dma_filter_fn, &filter_param,
+ chan = __dma_request_channel(&ud->ddev.cap_mask, udma_dma_filter_fn, &filter_param,
ofdma->of_node);
if (!chan) {
dev_err(ud->dev, "get channel fail in %s.\n", __func__);
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH RESEND] dmaengine: ti: k3-udma: Use cap_mask directly from dma_device structure instead of a local copy
2025-04-17 7:55 [PATCH RESEND] dmaengine: ti: k3-udma: Use cap_mask directly from dma_device structure instead of a local copy Yemike Abhilash Chandra
@ 2025-04-17 15:18 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2025-04-17 15:18 UTC (permalink / raw)
To: peter.ujfalusi, grygorii.strashko, Yemike Abhilash Chandra
Cc: vaishnav.a, u-kumar1, dmaengine, linux-kernel, stable
On Thu, 17 Apr 2025 13:25:21 +0530, Yemike Abhilash Chandra wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] dmaengine: ti: k3-udma: Use cap_mask directly from dma_device structure instead of a local copy
commit: 8ca9590c39b69b55a8de63d2b21b0d44f523b43a
Best regards,
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-17 15:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-17 7:55 [PATCH RESEND] dmaengine: ti: k3-udma: Use cap_mask directly from dma_device structure instead of a local copy Yemike Abhilash Chandra
2025-04-17 15:18 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®