diff mbox series

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

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

Commit Message

Jai Luthra June 4, 2024, 9:51 a.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: 017794739702 ("dmaengine: ti: k3-udma: Initial support for K3 BCDMA")
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Jai Luthra <j-luthra@ti.com>
---
 drivers/dma/ti/k3-udma.c | 1 +
 1 file changed, 1 insertion(+)


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

Best regards,

Comments

Péter Ujfalusi June 6, 2024, 5:40 p.m. UTC | #1
On 6/4/24 12:51 PM, 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.

Oh, it does not?
Back at the time of 017794739702 there were no devices with H/U BCHAN...

> So include them explicitly to arrive at
> total BC channel in the instance.
> 
> Fixes: 017794739702 ("dmaengine: ti: k3-udma: Initial support for K3 BCDMA")
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> Signed-off-by: Jai Luthra <j-luthra@ti.com>
> ---
>  drivers/dma/ti/k3-udma.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
> index 6400d06588a2..710296dfd0ae 100644
> --- a/drivers/dma/ti/k3-udma.c
> +++ b/drivers/dma/ti/k3-udma.c
> @@ -4473,6 +4473,7 @@ static int udma_get_mmrs(struct platform_device *pdev, struct udma_dev *ud)
>  		break;
>  	case DMA_TYPE_BCDMA:
>  		ud->bchan_cnt = BCDMA_CAP2_BCHAN_CNT(cap2);
> +		ud->bchan_cnt += BCDMA_CAP3_HBCHAN_CNT(cap3) + BCDMA_CAP3_UBCHAN_CNT(cap3);

I would add them in a single operation. Easier for the eye:
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,
diff mbox series

Patch

diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
index 6400d06588a2..710296dfd0ae 100644
--- a/drivers/dma/ti/k3-udma.c
+++ b/drivers/dma/ti/k3-udma.c
@@ -4473,6 +4473,7 @@  static int udma_get_mmrs(struct platform_device *pdev, struct udma_dev *ud)
 		break;
 	case DMA_TYPE_BCDMA:
 		ud->bchan_cnt = BCDMA_CAP2_BCHAN_CNT(cap2);
+		ud->bchan_cnt += 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;