mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net v3] net: phy: c45-tjaxx: add delay between MDIO write and read in soft_reset
@ 2025-01-24 10:41 Milos Reljin
  2025-01-24 14:42 ` Andrew Lunn
  2025-01-27 23:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Milos Reljin @ 2025-01-24 10:41 UTC (permalink / raw)
  To: andrei.botila, andrew, hkallweit1, linux, davem, edumazet, kuba,
	pabeni, netdev, linux-kernel
  Cc: 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.

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.

Cc: stable@vger.kernel.org
Fixes: b050f2f15e04 ("phy: nxp-c45: add driver for tja1103")
Signed-off-by: Milos Reljin <milos_reljin@outlook.com>
---
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(+)

diff --git a/drivers/net/phy/nxp-c45-tja11xx.c b/drivers/net/phy/nxp-c45-tja11xx.c
index ade544bc007d..872e582b7e83 100644
--- a/drivers/net/phy/nxp-c45-tja11xx.c
+++ b/drivers/net/phy/nxp-c45-tja11xx.c
@@ -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,
-- 
2.34.1


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

* Re: [PATCH net v3] net: phy: c45-tjaxx: add delay between MDIO write and read in soft_reset
  2025-01-24 10:41 [PATCH net v3] net: phy: c45-tjaxx: add delay between MDIO write and read in soft_reset Milos Reljin
@ 2025-01-24 14:42 ` Andrew Lunn
  2025-01-27 23:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2025-01-24 14:42 UTC (permalink / raw)
  To: Milos Reljin
  Cc: andrei.botila, hkallweit1, linux, davem, edumazet, kuba, pabeni,
	netdev, linux-kernel, milos.reljin

On Fri, Jan 24, 2025 at 10:41:02AM +0000, Milos Reljin 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.
> 
> Cc: stable@vger.kernel.org
> Fixes: b050f2f15e04 ("phy: nxp-c45: add driver for tja1103")
> Signed-off-by: Milos Reljin <milos_reljin@outlook.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH net v3] net: phy: c45-tjaxx: add delay between MDIO write and read in soft_reset
  2025-01-24 10:41 [PATCH net v3] net: phy: c45-tjaxx: add delay between MDIO write and read in soft_reset Milos Reljin
  2025-01-24 14:42 ` Andrew Lunn
@ 2025-01-27 23:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-01-27 23:10 UTC (permalink / raw)
  To: Milos Reljin
  Cc: andrei.botila, andrew, hkallweit1, linux, davem, edumazet, kuba,
	pabeni, netdev, linux-kernel, milos.reljin

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-01-27 23:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-24 10:41 [PATCH net v3] net: phy: c45-tjaxx: add delay between MDIO write and read in soft_reset Milos Reljin
2025-01-24 14:42 ` Andrew Lunn
2025-01-27 23:10 ` 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

all inboxes | Powered by JetHome®