Skip to contentSkip to conversation

net: phy: c45-tjaxx: add delay between MDIO write and read in soft_reset

PATCH Applied Milos Reljin 3 participants 3 messages Jan 24, 2025 – Jan 27, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 net: phy: c45-tjaxx: add delay between MDIO write and read in soft_reset

In application note (AN13663) for TJA1120, on page 30, there's a figure with average PHY startup timing values following software reset. The time it takes for SMI to become operational after software reset ranges roughly from 500 us to 1500 us.

This commit adds 2000 us delay after MDIO write which triggers software reset. Without this delay, soft_reset function returns an error and prevents successful PHY init.

Fixes b050f2f15e04 ("phy: nxp-c45: add driver for tja1103")

---
Changes in v3:
- Added Fixes and Cc tags, net tree indicator in Subject.

Changes in v2:
- Updated commit message to clear up where the delay value comes from.
- Delay added with usleep_range instead of changing sleep_before_read parameter of phy_read_mmd_poll_timeout to avoid excessive delay.

---
 drivers/net/phy/nxp-c45-tja11xx.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/phy/nxp-c45-tja11xx.c +2 -0
index ade544bc007d..872e582b7e83 100644
@@ -1297,6 +1297,8 @@ static int nxp_c45_soft_reset(struct phy_device *phydev)
 	if (ret)
 		return ret;
 
+	usleep_range(2000, 2050);
+
 	return phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1,
 					 VEND1_DEVICE_CONTROL, ret,
 					 !(ret & DEVICE_CONTROL_RESET), 20000,
Signature · 1 line
2.34.1
maintainer Reviewed-by on v3 1/1
#1 lore raw
Quoted 5 lines · Milos Reljin

In application note (AN13663) for TJA1120, on page 30, there's a figure with average PHY startup timing values following software reset. The time it takes for SMI to become operational after software reset ranges roughly from 500 us to 1500 us.

Quoted 7 lines

This commit adds 2000 us delay after MDIO write which triggers software reset. Without this delay, soft_reset function returns an error and prevents successful PHY init.

Fixes b050f2f15e04 ("phy: nxp-c45: add driver for tja1103")

Andrew

#2 lore raw
In reply to Milos Reljin
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Fri, 24 Jan 2025 10:41:02 +0000 you wrote:

In application note (AN13663) for TJA1120, on page 30, there's a figure with average PHY startup timing values following software reset. The time it takes for SMI to become operational after software reset ranges roughly from 500 us to 1500 us.

This commit adds 2000 us delay after MDIO write which triggers software reset. Without this delay, soft_reset function returns an error and prevents successful PHY init.

[...]

Here is the summary with links:
- [net,v3] net: phy: c45-tjaxx: add delay between MDIO write and read in soft_reset

    https://git.kernel.org/netdev/net/c/bd1bbab71760

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html