yt8521_modify_bmcr_paged() waits up to 500ms for BMCR_RESET to clear. If the wait loop is exhausted, the last BMCR read value (a positive number) is kept in ret and returned through phy_restore_page(), so the caller sees a non-negative value and treats the failed reset as success. This contradicts the helper's documentation ("returns 0 or negative errno code"). Return -ETIMEDOUT when the reset is still not complete after the wait loop is exhausted. Fixes: 70479a40954c ("net: phy: Add driver for Motorcomm yt8521 gigabit ethernet phy") Signed-off-by: chengke --- New patch in v2; patch 2/2 depends on it. drivers/net/phy/motorcomm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c index a87e83fdf5..ba3421ca4d 100644 --- a/drivers/net/phy/motorcomm.c +++ b/drivers/net/phy/motorcomm.c @@ -1595,6 +1595,7 @@ static int yt8521_modify_bmcr_paged(struct phy_device *phydev, int page, if (!(ret & BMCR_RESET)) return phy_restore_page(phydev, old_page, 0); } + ret = -ETIMEDOUT; } err_restore_page: -- 2.43.0