diff mbox series

[v2] dmaengine: ti: k3-udma: Fix BCHAN count with UHC and HC channels

Message ID 20240607-bcdma_chan_cnt-v2-1-bf1a55529d91@ti.com (mailing list archive)
State New, archived
Headers show
Series [v2] dmaengine: ti: k3-udma: Fix BCHAN count with UHC and HC channels | expand

Commit Message

Jai Luthra June 7, 2024, 6:11 p.m. UTC
From: Vignesh Raghavendra <vigneshr@ti.com>

Unlike other channel counts in CAPx registers, BCDMA BCHAN CNT doesn't
include UHC and HC BC channels. So include them explicitly to arrive at
total BC channel in the instance.

Fixes: 8844898028d4 ("dmaengine: ti: k3-udma: Add support for BCDMA channel TPL handling")
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Jai Luthra <j-luthra@ti.com>
---
Changes in v2:
- Add all BCHANs in a single operation
- Update the Fixes tag to the commit adding TPL support
- Link to v1: https://lore.kernel.org/r/20240604-bcdma_chan_cnt-v1-1-1e8932f68dca@ti.com
---
 drivers/dma/ti/k3-udma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


---
base-commit: d97496ca23a2d4ee80b7302849404859d9058bcd
change-id: 20240604-bcdma_chan_cnt-bbc6c0c95259

Best regards,

Comments

Jayesh Choudhary June 24, 2024, 9:10 a.m. UTC | #1
Hello Jai,

On 07/06/24 23:41, Jai Luthra wrote:
> From: Vignesh Raghavendra <vigneshr@ti.com>
> 
> Unlike other channel counts in CAPx registers, BCDMA BCHAN CNT doesn't
> include UHC and HC BC channels. So include them explicitly to arrive at
> total BC channel in the instance.
> 
> Fixes: 8844898028d4 ("dmaengine: ti: k3-udma: Add support for BCDMA channel TPL handling")
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> Signed-off-by: Jai Luthra <j-luthra@ti.com>

Tested audio on J722S platform on top of this patch.
McASP in J722S-EVM uses BCDMA.

Tested-by: Jayesh Choudhary <j-choudhary@ti.com>

> ---
> Changes in v2:
> - Add all BCHANs in a single operation
> - Update the Fixes tag to the commit adding TPL support
> - Link to v1: https://lore.kernel.org/r/20240604-bcdma_chan_cnt-v1-1-1e8932f68dca@ti.com
> ---
>   drivers/dma/ti/k3-udma.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
> index 6400d06588a2..df507d96660b 100644
> --- a/drivers/dma/ti/k3-udma.c
> +++ b/drivers/dma/ti/k3-udma.c
> @@ -4472,7 +4472,9 @@ static int udma_get_mmrs(struct platform_device *pdev, struct udma_dev *ud)
>   		ud->rchan_cnt = UDMA_CAP2_RCHAN_CNT(cap2);
>   		break;
>   	case DMA_TYPE_BCDMA:
> -		ud->bchan_cnt = BCDMA_CAP2_BCHAN_CNT(cap2);
> +		ud->bchan_cnt = BCDMA_CAP2_BCHAN_CNT(cap2) +
> +				BCDMA_CAP3_HBCHAN_CNT(cap3) +
> +				BCDMA_CAP3_UBCHAN_CNT(cap3);
>   		ud->tchan_cnt = BCDMA_CAP2_TCHAN_CNT(cap2);
>   		ud->rchan_cnt = BCDMA_CAP2_RCHAN_CNT(cap2);
>   		ud->rflow_cnt = ud->rchan_cnt;
> 
> ---
> base-commit: d97496ca23a2d4ee80b7302849404859d9058bcd
> change-id: 20240604-bcdma_chan_cnt-bbc6c0c95259
> 
> Best regards,

Thanks,
Jayesh
Vinod Koul June 28, 2024, 10:10 a.m. UTC | #2
On Fri, 07 Jun 2024 23:41:03 +0530, Jai Luthra wrote:
> Unlike other channel counts in CAPx registers, BCDMA BCHAN CNT doesn't
> include UHC and HC BC channels. So include them explicitly to arrive at
> total BC channel in the instance.
> 
> 

Applied, thanks!

[1/1] dmaengine: ti: k3-udma: Fix BCHAN count with UHC and HC channels
      commit: 372f8b3621294173f539b32976e41e6e12f5decf

Best regards,
diff mbox series

Patch

diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
index 6400d06588a2..df507d96660b 100644
--- a/drivers/dma/ti/k3-udma.c
+++ b/drivers/dma/ti/k3-udma.c
@@ -4472,7 +4472,9 @@  static int udma_get_mmrs(struct platform_device *pdev, struct udma_dev *ud)
 		ud->rchan_cnt = UDMA_CAP2_RCHAN_CNT(cap2);
 		break;
 	case DMA_TYPE_BCDMA:
-		ud->bchan_cnt = BCDMA_CAP2_BCHAN_CNT(cap2);
+		ud->bchan_cnt = BCDMA_CAP2_BCHAN_CNT(cap2) +
+				BCDMA_CAP3_HBCHAN_CNT(cap3) +
+				BCDMA_CAP3_UBCHAN_CNT(cap3);
 		ud->tchan_cnt = BCDMA_CAP2_TCHAN_CNT(cap2);
 		ud->rchan_cnt = BCDMA_CAP2_RCHAN_CNT(cap2);
 		ud->rflow_cnt = ud->rchan_cnt;