[PATCH net 1/1] net: stmmac: fix incorrect DMA channel intr enable setting of EQoS v4.10

Subsystems: networking drivers, stmmac ethernet driver, the rest

STALE1978d

3 messages, 3 authors, 2021-03-03 · open the first message on its own page

[PATCH net 1/1] net: stmmac: fix incorrect DMA channel intr enable setting of EQoS v4.10

From: <hidden>
Date: 2021-03-03 11:56:02

From: Ong Boon Leong <redacted>

We introduce dwmac410_dma_init_channel() here for both EQoS v4.10 and
above which use different DMA_CH(n)_Interrupt_Enable bit definitions for
NIE and AIE.

Fixes: 48863ce5940f ("stmmac: add DMA support for GMAC 4.xx")
Signed-off-by: Ong Boon Leong <redacted>
Signed-off-by: Ramesh Babu B <redacted>
---
 .../net/ethernet/stmicro/stmmac/dwmac4_dma.c  | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
index bb29bfcd62c3..62aa0e95beb7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
@@ -124,6 +124,23 @@ static void dwmac4_dma_init_channel(void __iomem *ioaddr,
 	       ioaddr + DMA_CHAN_INTR_ENA(chan));
 }
 
+static void dwmac410_dma_init_channel(void __iomem *ioaddr,
+				      struct stmmac_dma_cfg *dma_cfg, u32 chan)
+{
+	u32 value;
+
+	/* common channel control register config */
+	value = readl(ioaddr + DMA_CHAN_CONTROL(chan));
+	if (dma_cfg->pblx8)
+		value = value | DMA_BUS_MODE_PBL;
+
+	writel(value, ioaddr + DMA_CHAN_CONTROL(chan));
+
+	/* Mask interrupts by writing to CSR7 */
+	writel(DMA_CHAN_INTR_DEFAULT_MASK_4_10,
+	       ioaddr + DMA_CHAN_INTR_ENA(chan));
+}
+
 static void dwmac4_dma_init(void __iomem *ioaddr,
 			    struct stmmac_dma_cfg *dma_cfg, int atds)
 {
@@ -523,7 +540,7 @@ const struct stmmac_dma_ops dwmac4_dma_ops = {
 const struct stmmac_dma_ops dwmac410_dma_ops = {
 	.reset = dwmac4_dma_reset,
 	.init = dwmac4_dma_init,
-	.init_chan = dwmac4_dma_init_channel,
+	.init_chan = dwmac410_dma_init_channel,
 	.init_rx_chan = dwmac4_dma_init_rx_chan,
 	.init_tx_chan = dwmac4_dma_init_tx_chan,
 	.axi = dwmac4_dma_axi,
-- 
2.17.1

RE: [PATCH net 1/1] net: stmmac: fix incorrect DMA channel intr enable setting of EQoS v4.10

From: Joakim Zhang <hidden>
Date: 2021-03-03 12:56:28

-----Original Message-----
From: ramesh.babu.b@intel.com <redacted>
Sent: 2021年3月3日 23:09
To: Giuseppe Cavallaro <redacted>; Alexandre Torgue
[off-list ref]; Jose Abreu [off-list ref]; David S .
Miller [off-list ref]; Jakub Kicinski [off-list ref]; Maxime
Coquelin [off-list ref]
Cc: netdev@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com;
linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Ong Boon
Leong [off-list ref]; Voon Wei Feng
[off-list ref]; Wong Vee Khee [off-list ref];
Ramesh Babu B [off-list ref]
Subject: [PATCH net 1/1] net: stmmac: fix incorrect DMA channel intr enable
setting of EQoS v4.10

From: Ong Boon Leong <redacted>

We introduce dwmac410_dma_init_channel() here for both EQoS v4.10 and
above which use different DMA_CH(n)_Interrupt_Enable bit definitions for NIE
and AIE.

Fixes: 48863ce5940f ("stmmac: add DMA support for GMAC 4.xx")
Signed-off-by: Ong Boon Leong <redacted>
Signed-off-by: Ramesh Babu B <redacted>
Reviewed-by: Joakim Zhang <redacted>

Best Regards,
Joakim Zhang
quoted hunk
---
 .../net/ethernet/stmicro/stmmac/dwmac4_dma.c  | 19
++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
index bb29bfcd62c3..62aa0e95beb7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
@@ -124,6 +124,23 @@ static void dwmac4_dma_init_channel(void __iomem
*ioaddr,
 	       ioaddr + DMA_CHAN_INTR_ENA(chan));  }

+static void dwmac410_dma_init_channel(void __iomem *ioaddr,
+				      struct stmmac_dma_cfg *dma_cfg, u32 chan) {
+	u32 value;
+
+	/* common channel control register config */
+	value = readl(ioaddr + DMA_CHAN_CONTROL(chan));
+	if (dma_cfg->pblx8)
+		value = value | DMA_BUS_MODE_PBL;
+
+	writel(value, ioaddr + DMA_CHAN_CONTROL(chan));
+
+	/* Mask interrupts by writing to CSR7 */
+	writel(DMA_CHAN_INTR_DEFAULT_MASK_4_10,
+	       ioaddr + DMA_CHAN_INTR_ENA(chan)); }
+
 static void dwmac4_dma_init(void __iomem *ioaddr,
 			    struct stmmac_dma_cfg *dma_cfg, int atds)  { @@
-523,7 +540,7 @@ const struct stmmac_dma_ops dwmac4_dma_ops =
{  const struct stmmac_dma_ops dwmac410_dma_ops = {
 	.reset = dwmac4_dma_reset,
 	.init = dwmac4_dma_init,
-	.init_chan = dwmac4_dma_init_channel,
+	.init_chan = dwmac410_dma_init_channel,
 	.init_rx_chan = dwmac4_dma_init_rx_chan,
 	.init_tx_chan = dwmac4_dma_init_tx_chan,
 	.axi = dwmac4_dma_axi,
--
2.17.1

Re: [PATCH net 1/1] net: stmmac: fix incorrect DMA channel intr enable setting of EQoS v4.10

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-03-03 19:28:56

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Wed,  3 Mar 2021 20:38:40 +0530 you wrote:
From: Ong Boon Leong <redacted>

We introduce dwmac410_dma_init_channel() here for both EQoS v4.10 and
above which use different DMA_CH(n)_Interrupt_Enable bit definitions for
NIE and AIE.

Fixes: 48863ce5940f ("stmmac: add DMA support for GMAC 4.xx")
Signed-off-by: Ong Boon Leong <redacted>
Signed-off-by: Ramesh Babu B <redacted>

[...]
Here is the summary with links:
  - [net,1/1] net: stmmac: fix incorrect DMA channel intr enable setting of EQoS v4.10
    https://git.kernel.org/netdev/net/c/879c348c35bb

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help