]> git.baikalelectronics.ru Git - kernel.git/commit
ethtool: Protect {get, set}_phy_tunable with PHY device mutex
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 22 Nov 2016 21:55:31 +0000 (13:55 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Nov 2016 21:02:32 +0000 (16:02 -0500)
commit3529778939aafa0eb8243eb5f2c51254e1484b59
tree28220d54e14d9ea7026adcdf13628d4815aa93ce
parent6df6d09299c7e904b90cd246b0c4f904876bd5ce
ethtool: Protect {get, set}_phy_tunable with PHY device mutex

PHY drivers should be able to rely on the caller of {get,set}_tunable to
have acquired the PHY device mutex, in order to both serialize against
concurrent calls of these functions, but also against PHY state machine
changes. All ethtool PHY-level functions do this, except
{get,set}_tunable, so we make them consistent here as well.

We need to update the Microsemi PHY driver in the same commit to avoid
introducing either deadlocks, or lack of proper locking.

Fixes: bc9da1dec0ef ("ethtool: Implements ETHTOOL_PHY_GTUNABLE/ETHTOOL_PHY_STUNABLE")
Fixes: 1b136b9bfa34 ("net: phy: Add downshift get/set support in Microsemi PHYs driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Allan W. Nielsen <allan.nielsen@microsemi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/mscc.c
net/core/ethtool.c