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 |
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 --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;
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(+)