ksettings_{get|set} lock fixes
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | phy: phy_ethtool_ksettings_get: Lock the phy for consistencydrivers/ | +2 | 0 replies | |
| 2/4 | phy: phy_ethtool_ksettings_set: Move after phy_start_anegdrivers/ | +53 | 0 replies | |
| 3/4 | phy: phy_start_aneg: Add an unlocked versiondrivers/ | +24 | 0 replies | |
| 4/4 | phy: phy_ethtool_ksettings_set: Lock the PHY while changing settingsdrivers/ | +3 | 0 replies |
Reviews trailers per patch
None of the 4 patches has a Reviewed-by or Acked-by.
| Patch | Walter Stoll |
|---|---|
| 1/4 | |
| 2/4 | |
| 3/4 | |
| 4/4 | T-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net 0/4] ksettings_{get|set} lock fixes
Walter Stoll <[email protected]> reported a race condition between "ethtool -s eth0 speed 100 duplex full autoneg off" and phylib reading the current status from the PHY. Both ksetting_get and ksetting_set fail the take the phydev mutex, and as a result, there is a small window of time where the phydev members are not self consistent.
Patch 1 fixes phy_ethtool_ksettings_get by adding the needed lock. Patches 2 and 3 move code around and perform to refactoring, to allow patch 4 to fix phy_ethtool_ksettings_set by added the lock.
Thanks go to Walter for the detailed origional report, suggested fix, and testing of the proposed patches.
Andrew Lunn (4):
phy: phy_ethtool_ksettings_get: Lock the phy for consistency
phy: phy_ethtool_ksettings_set: Move after phy_start_aneg
phy: phy_start_aneg: Add an unlocked version
phy: phy_ethtool_ksettings_set: Lock the PHY while changing settings
drivers/net/phy/phy.c | 140 ++++++++++++++++++++++++------------------ 1 file changed, 81 insertions(+), 59 deletions(-)
Signature · 1 line
2.33.0