netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ftgmac100: access hardware register after clock ready
@ 2022-04-12 11:48 Dylan Hung
  2022-04-13 11:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Dylan Hung @ 2022-04-12 11:48 UTC (permalink / raw)
  To: davem, kuba, pabeni, guoheyi, huangguangbin2, chenhao288,
	dylan_hung, yangyingliang, joel, netdev, linux-kernel
  Cc: BMC-SW

AST2600 MAC register 0x58 is writable only when the MAC clock is
enabled.  Usually, the MAC clock is enabled by the bootloader so
register 0x58 is set normally when the bootloader is involved.  To make
ast2600 ftgmac100 work without the bootloader, postpone the register
write until the clock is ready.

Fixes: 137d23cea1c0 ("net: ftgmac100: Fix Aspeed ast2600 TX hang issue")
Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
---
 drivers/net/ethernet/faraday/ftgmac100.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index d5356db7539a..caf48023f8ea 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -1835,11 +1835,6 @@ static int ftgmac100_probe(struct platform_device *pdev)
 		priv->rxdes0_edorr_mask = BIT(30);
 		priv->txdes0_edotr_mask = BIT(30);
 		priv->is_aspeed = true;
-		/* Disable ast2600 problematic HW arbitration */
-		if (of_device_is_compatible(np, "aspeed,ast2600-mac")) {
-			iowrite32(FTGMAC100_TM_DEFAULT,
-				  priv->base + FTGMAC100_OFFSET_TM);
-		}
 	} else {
 		priv->rxdes0_edorr_mask = BIT(15);
 		priv->txdes0_edotr_mask = BIT(15);
@@ -1911,6 +1906,11 @@ static int ftgmac100_probe(struct platform_device *pdev)
 		err = ftgmac100_setup_clk(priv);
 		if (err)
 			goto err_phy_connect;
+
+		/* Disable ast2600 problematic HW arbitration */
+		if (of_device_is_compatible(np, "aspeed,ast2600-mac"))
+			iowrite32(FTGMAC100_TM_DEFAULT,
+				  priv->base + FTGMAC100_OFFSET_TM);
 	}
 
 	/* Default ring sizes */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: ftgmac100: access hardware register after clock ready
  2022-04-12 11:48 [PATCH] net: ftgmac100: access hardware register after clock ready Dylan Hung
@ 2022-04-13 11:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-04-13 11:50 UTC (permalink / raw)
  To: Dylan Hung
  Cc: davem, kuba, pabeni, guoheyi, huangguangbin2, chenhao288,
	yangyingliang, joel, netdev, linux-kernel, BMC-SW

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue, 12 Apr 2022 19:48:59 +0800 you wrote:
> AST2600 MAC register 0x58 is writable only when the MAC clock is
> enabled.  Usually, the MAC clock is enabled by the bootloader so
> register 0x58 is set normally when the bootloader is involved.  To make
> ast2600 ftgmac100 work without the bootloader, postpone the register
> write until the clock is ready.
> 
> Fixes: 137d23cea1c0 ("net: ftgmac100: Fix Aspeed ast2600 TX hang issue")
> Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
> 
> [...]

Here is the summary with links:
  - net: ftgmac100: access hardware register after clock ready
    https://git.kernel.org/netdev/net/c/3d2504524531

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] 2+ messages in thread

end of thread, other threads:[~2022-04-13 11:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-12 11:48 [PATCH] net: ftgmac100: access hardware register after clock ready Dylan Hung
2022-04-13 11:50 ` 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).