Skip to content

Commit cd665bf

Browse files
kmaincentvinodkoul
authored andcommitted
dmaengine: dw-edma: Fix the ch_count hdma callback
The current check of ch_en enabled to know the maximum number of available hardware channels is wrong as it check the number of ch_en register set but all of them are unset at probe. This register is set at the dw_hdma_v0_core_start function which is run lately before a DMA transfer. The HDMA IP have no way to know the number of hardware channels available like the eDMA IP, then let set it to maximum channels and let the platform set the right number of channels. Fixes: e74c395 ("dmaengine: dw-edma: Add support for native HDMA") Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> Link: https://lore.kernel.org/r/20240129-b4-feature_hdma_mainline-v7-1-8e8c1acb7a46@bootlin.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 54be6c6 commit cd665bf

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

drivers/dma/dw-edma/dw-hdma-v0-core.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,12 @@ static void dw_hdma_v0_core_off(struct dw_edma *dw)
6565

6666
static u16 dw_hdma_v0_core_ch_count(struct dw_edma *dw, enum dw_edma_dir dir)
6767
{
68-
u32 num_ch = 0;
69-
int id;
70-
71-
for (id = 0; id < HDMA_V0_MAX_NR_CH; id++) {
72-
if (GET_CH_32(dw, id, dir, ch_en) & BIT(0))
73-
num_ch++;
74-
}
75-
76-
if (num_ch > HDMA_V0_MAX_NR_CH)
77-
num_ch = HDMA_V0_MAX_NR_CH;
78-
79-
return (u16)num_ch;
68+
/*
69+
* The HDMA IP have no way to know the number of hardware channels
70+
* available, we set it to maximum channels and let the platform
71+
* set the right number of channels.
72+
*/
73+
return HDMA_V0_MAX_NR_CH;
8074
}
8175

8276
static enum dma_status dw_hdma_v0_core_ch_status(struct dw_edma_chan *chan)

0 commit comments

Comments
 (0)