Skip to content

PHYLIB: Fix forcing mode reduction

Nathaniel Case netdev 1 version NAK

Status from this message: NAK, needs an EXPORT

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 7 repliesNAK

Patches in v1

#Subject and filesSizeRepliesApplied
1/2PHYLIB: Add get_link ethtool helper functiondrivers/net/phy/phy.c include/linux/phy.h+17 -02 replies
2/2PHYLIB/gianfar: Use phy_ethtool_get_link() for get_link opdrivers/net/gianfar_ethtool.c+13 -14 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] PHYLIB: Fix forcing mode reduction
Quoted 3 lines · Andy Fleming

Looks good. Feel free to send these patches to [email protected] (you may need to subscribe), and copy Jeff Garzik <[email protected]>.

This fixes a problem seen when a port without a cable connected would repeatedly print out "Trying 1000/HALF". While in the PHY_FORCING state, the call to phy_read_status() was resetting the value of phydev->speed and phydev->duplex, preventing it from incrementally trying the speed/duplex variations.

Since we really just want the link status updated for the PHY_FORCING state, calling genphy_update_link() instead of phy_read_status() fixes this issue.

Patch tested on a MPC8540 platform with a BCM5421 PHY.

---

drivers/net/phy/phy.c +1 -1
@@ -767,7 +783,7 @@
 			}
 			break;
 		case PHY_FORCING:
-			err = phy_read_status(phydev);
+			err = genphy_update_link(phydev);
 
 			if (err)
 				break;
drivers/net/phy/phy_device.c +1 -0
@@ -417,6 +417,7 @@
 
 	return 0;
 }
+EXPORT_SYMBOL(genphy_update_link);
 
 /* genphy_read_status
  *