diff mbox series

net: phy: motorcomm: Fix yt8521 Speed issue

Message ID 20250110093358.2718748-1-zhangxiangqian@kylinos.cn (mailing list archive)
State New
Delegated to: Netdev Maintainers
Headers show
Series net: phy: motorcomm: Fix yt8521 Speed issue | 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: 1 this patch: 1
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: 1 this patch: 1
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 35 this patch: 35
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-01-10--15-00 (tests: 882)

Commit Message

Xiangqian Zhang Jan. 10, 2025, 9:33 a.m. UTC
yt8521 is 1000Mb/s after connecting to the network cable, but it is
still 1000Mb/s after unplugging the network cable.

Signed-off-by: Xiangqian Zhang <zhangxiangqian@kylinos.cn>
---
 drivers/net/phy/motorcomm.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Andrew Lunn Jan. 10, 2025, 4:50 p.m. UTC | #1
On Fri, Jan 10, 2025 at 05:33:58PM +0800, Xiangqian Zhang wrote:
> yt8521 is 1000Mb/s after connecting to the network cable, but it is
> still 1000Mb/s after unplugging the network cable.

If you look at genphy_read_status() it does:

        phydev->master_slave_get = MASTER_SLAVE_CFG_UNSUPPORTED;
        phydev->master_slave_state = MASTER_SLAVE_STATE_UNSUPPORTED;
        phydev->speed = SPEED_UNKNOWN;
        phydev->duplex = DUPLEX_UNKNOWN;
        phydev->pause = 0;
        phydev->asym_pause = 0;

and then reads the status from the hardware and sets all these. You
might want to make yt8521_read_status() more like
genphy_read_status().

	Andrew
diff mbox series

Patch

diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c
index 0e91f5d1a4fd..e1e33b1236e2 100644
--- a/drivers/net/phy/motorcomm.c
+++ b/drivers/net/phy/motorcomm.c
@@ -1487,6 +1487,7 @@  static int yt8521_read_status(struct phy_device *phydev)
 		}
 
 		phydev->link = 0;
+		phydev->speed = SPEED_UNKNOWN;
 	}
 
 	return 0;