diff mbox series

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

Message ID AM8P250MB0124B5051DF9B54EC325644CE1E02@AM8P250MB0124.EURP250.PROD.OUTLOOK.COM (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [v2] net: phy: c45-tjaxx: add delay between MDIO write and read in soft_reset | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 2 this patch: 2
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-01-24--00-00 (tests: 879)

Commit Message

Milos Reljin Jan. 23, 2025, 3:43 p.m. UTC
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.

Signed-off-by: Milos Reljin <milos_reljin@outlook.com>
---
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(+)

Comments

Andrew Lunn Jan. 23, 2025, 4:26 p.m. UTC | #1
On Thu, Jan 23, 2025 at 03:43:46PM +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.

Is this a fix? Should it be backported to stable? If so:

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

and it should really indicate the net tree in the Subject: line.

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html

Otherwise the patch looks good. Thanks for the updated commit message.

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

    Andrew
diff mbox series

Patch

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,