diff options
author | David S. Miller <davem@davemloft.net> | 2023-09-17 14:31:24 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-09-17 14:31:24 +0100 |
commit | fbb49deb2103f70d2bc7dc7e79e5bfe33a3824ab (patch) | |
tree | fdf4160d57af28e9c7aa0ed1e460838bca907aa0 /MAINTAINERS | |
parent | 002841be134e60994a34b510eebf5f091d0cd6c6 (diff) | |
parent | adcbb85508c8bb181704154eec1dfe20554ddfe9 (diff) |
Merge branch 'phy-stopping-race'
Russell King says:
====================
net: phy: avoid race when erroring stopping PHY
This series addresses a problem reported by Jijie Shao where the PHY
state machine can race with phy_stop() leading to an incorrect state.
The issue centres around phy_state_machine() dropping the phydev->lock
mutex briefly, which allows phy_stop() to get in half-way through the
state machine, and when the state machine resumes, it overwrites
phydev->state with a value incompatible with a stopped PHY. This causes
a subsequent phy_start() to issue a warning.
We address this firstly by using versions of functions that do not take
tne lock, moving them into the locked region. The only function that
this can't be done with is phy_suspend() which needs to call into the
driver without taking the lock.
For phy_suspend(), we split the state machine into two parts - the
initial part which runs under the phydev->lock, and the second part
which runs without the lock.
We finish off by using the split state machine in phy_stop() which
removes another unnecessary unlock-lock sequence from phylib.
Changes from RFC:
- Added Jijie Shao's tested-by
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'MAINTAINERS')
0 files changed, 0 insertions, 0 deletions