* [PATCH net V3] net: stmmac: dwmac-loongson: Add fix_soc_reset() callback
@ 2025-02-19 2:07 Qunqin Zhao
2025-02-19 23:31 ` Jacob Keller
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Qunqin Zhao @ 2025-02-19 2:07 UTC (permalink / raw)
To: kuba, andrew+netdev, davem, edumazet, pabeni
Cc: chenhuacai, si.yanteng, fancer.lancer, netdev, linux-kernel,
Qunqin Zhao, stable, Huacai Chen
Loongson's DWMAC device may take nearly two seconds to complete DMA reset,
however, the default waiting time for reset is 200 milliseconds.
Therefore, the following error message may appear:
[14.427169] dwmac-loongson-pci 0000:00:03.2: Failed to reset the dma
Fixes: 803fc61df261 ("net: stmmac: dwmac-loongson: Add Loongson Multi-channels GMAC support")
Cc: stable@vger.kernel.org
Signed-off-by: Qunqin Zhao <zhaoqunqin@loongson.cn>
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
---
v3: Added "Cc: stable@vger.kernel.org" tag.
Added error message to commit message.
v2: Added comments. Changed callback name to loongson_dwmac_fix_reset.
.../net/ethernet/stmicro/stmmac/dwmac-loongson.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
index bfe6e2d631bd..f5acfb7d4ff6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
@@ -516,6 +516,19 @@ static int loongson_dwmac_acpi_config(struct pci_dev *pdev,
return 0;
}
+/* Loongson's DWMAC device may take nearly two seconds to complete DMA reset */
+static int loongson_dwmac_fix_reset(void *priv, void __iomem *ioaddr)
+{
+ u32 value = readl(ioaddr + DMA_BUS_MODE);
+
+ value |= DMA_BUS_MODE_SFT_RESET;
+ writel(value, ioaddr + DMA_BUS_MODE);
+
+ return readl_poll_timeout(ioaddr + DMA_BUS_MODE, value,
+ !(value & DMA_BUS_MODE_SFT_RESET),
+ 10000, 2000000);
+}
+
static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
struct plat_stmmacenet_data *plat;
@@ -566,6 +579,7 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
plat->bsp_priv = ld;
plat->setup = loongson_dwmac_setup;
+ plat->fix_soc_reset = loongson_dwmac_fix_reset;
ld->dev = &pdev->dev;
ld->loongson_id = readl(res.addr + GMAC_VERSION) & 0xff;
base-commit: a64dcfb451e254085a7daee5fe51bf22959d52d3
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net V3] net: stmmac: dwmac-loongson: Add fix_soc_reset() callback
2025-02-19 2:07 [PATCH net V3] net: stmmac: dwmac-loongson: Add fix_soc_reset() callback Qunqin Zhao
@ 2025-02-19 23:31 ` Jacob Keller
2025-02-20 1:28 ` Yanteng Si
2025-02-21 2:17 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Jacob Keller @ 2025-02-19 23:31 UTC (permalink / raw)
To: Qunqin Zhao, kuba, andrew+netdev, davem, edumazet, pabeni
Cc: chenhuacai, si.yanteng, fancer.lancer, netdev, linux-kernel,
stable, Huacai Chen
On 2/18/2025 6:07 PM, Qunqin Zhao wrote:
> Loongson's DWMAC device may take nearly two seconds to complete DMA reset,
> however, the default waiting time for reset is 200 milliseconds.
> Therefore, the following error message may appear:
>
> [14.427169] dwmac-loongson-pci 0000:00:03.2: Failed to reset the dma
>
> Fixes: 803fc61df261 ("net: stmmac: dwmac-loongson: Add Loongson Multi-channels GMAC support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Qunqin Zhao <zhaoqunqin@loongson.cn>
> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
> ---
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net V3] net: stmmac: dwmac-loongson: Add fix_soc_reset() callback
2025-02-19 2:07 [PATCH net V3] net: stmmac: dwmac-loongson: Add fix_soc_reset() callback Qunqin Zhao
2025-02-19 23:31 ` Jacob Keller
@ 2025-02-20 1:28 ` Yanteng Si
2025-02-21 2:17 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Yanteng Si @ 2025-02-20 1:28 UTC (permalink / raw)
To: Qunqin Zhao, kuba, andrew+netdev, davem, edumazet, pabeni
Cc: chenhuacai, fancer.lancer, netdev, linux-kernel, stable,
Huacai Chen
在 2/19/25 10:07 AM, Qunqin Zhao 写道:
> Loongson's DWMAC device may take nearly two seconds to complete DMA reset,
> however, the default waiting time for reset is 200 milliseconds.
> Therefore, the following error message may appear:
>
> [14.427169] dwmac-loongson-pci 0000:00:03.2: Failed to reset the dma
>
> Fixes: 803fc61df261 ("net: stmmac: dwmac-loongson: Add Loongson Multi-channels GMAC support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Qunqin Zhao <zhaoqunqin@loongson.cn>
> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Acked-by: Yanteng Si <si.yanteng@linux.dev>
Thanks,
Yanteng
> ---
> v3: Added "Cc: stable@vger.kernel.org" tag.
> Added error message to commit message.
>
> v2: Added comments. Changed callback name to loongson_dwmac_fix_reset.
>
> .../net/ethernet/stmicro/stmmac/dwmac-loongson.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net V3] net: stmmac: dwmac-loongson: Add fix_soc_reset() callback
2025-02-19 2:07 [PATCH net V3] net: stmmac: dwmac-loongson: Add fix_soc_reset() callback Qunqin Zhao
2025-02-19 23:31 ` Jacob Keller
2025-02-20 1:28 ` Yanteng Si
@ 2025-02-21 2:17 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-02-21 2:17 UTC (permalink / raw)
To: Qunqin Zhao
Cc: kuba, andrew+netdev, davem, edumazet, pabeni, chenhuacai,
si.yanteng, fancer.lancer, netdev, linux-kernel, stable,
chenhuacai
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 19 Feb 2025 10:07:01 +0800 you wrote:
> Loongson's DWMAC device may take nearly two seconds to complete DMA reset,
> however, the default waiting time for reset is 200 milliseconds.
> Therefore, the following error message may appear:
>
> [14.427169] dwmac-loongson-pci 0000:00:03.2: Failed to reset the dma
>
> Fixes: 803fc61df261 ("net: stmmac: dwmac-loongson: Add Loongson Multi-channels GMAC support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Qunqin Zhao <zhaoqunqin@loongson.cn>
> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
>
> [...]
Here is the summary with links:
- [net,V3] net: stmmac: dwmac-loongson: Add fix_soc_reset() callback
https://git.kernel.org/netdev/net/c/f06e4bfd010f
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-02-21 2:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-19 2:07 [PATCH net V3] net: stmmac: dwmac-loongson: Add fix_soc_reset() callback Qunqin Zhao
2025-02-19 23:31 ` Jacob Keller
2025-02-20 1:28 ` Yanteng Si
2025-02-21 2:17 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).