aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev_ioctl.c
diff options
context:
space:
mode:
authorRussell King (Oracle) <[email protected]>2025-09-07 20:44:01 +0000
committerJakub Kicinski <[email protected]>2025-09-09 23:33:19 +0000
commite0d1c55501d377163eb57feed863777ed1c973ad (patch)
tree7057c53058c67a647a870fdf50badfc863ff4cbe /net/core/dev_ioctl.c
parenttunnels: reset the GSO metadata before reusing the skb (diff)
downloadkernel-e0d1c55501d377163eb57feed863777ed1c973ad.tar.gz
kernel-e0d1c55501d377163eb57feed863777ed1c973ad.zip
net: phy: fix phy_uses_state_machine()
The blamed commit changed the conditions which phylib uses to stop and start the state machine in the suspend and resume paths, and while improving it, has caused two issues. The original code used this test: phydev->attached_dev && phydev->adjust_link and if true, the paths would handle the PHY state machine. This test evaluates true for normal drivers that are using phylib directly while the PHY is attached to the network device, but false in all other cases, which include the following cases: - when the PHY has never been attached to a network device. - when the PHY has been detached from a network device (as phy_detach() sets phydev->attached_dev to NULL, phy_disconnect() calls phy_detach() and additionally sets phydev->adjust_link NULL.) - when phylink is using the driver (as phydev->adjust_link is NULL.) Only the third case was incorrect, and the blamed commit attempted to fix this by changing this test to (simplified for brevity, see phy_uses_state_machine()): phydev->phy_link_change == phy_link_change ? phydev->attached_dev && phydev->adjust_link : true However, this also incorrectly evaluates true in the first two cases. Fix the first case by ensuring that phy_uses_state_machine() returns false when phydev->phy_link_change is NULL. Fix the second case by ensuring that phydev->phy_link_change is set to NULL when phy_detach() is called. Reported-by: Xu Yang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: fc75ea20ffb4 ("net: phy: allow MDIO bus PM ops to start/stop state machine for phylink-controlled PHY") Signed-off-by: Russell King (Oracle) <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/core/dev_ioctl.c')
0 files changed, 0 insertions, 0 deletions