diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2026-06-04 17:29:02 -0700 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-06-09 10:13:04 -0700 |
| commit | ded86da4bbb78cad74cecc368fee3ae3a296e2ca (patch) | |
| tree | 5881ec9b5c0f2a3b4adc1705f6562877a7a1f1b7 /include | |
| parent | 8845484367dade6811bbc3c0c1d66a2a0721c3c0 (diff) | |
| download | lwn-ded86da4bbb78cad74cecc368fee3ae3a296e2ca.tar.gz lwn-ded86da4bbb78cad74cecc368fee3ae3a296e2ca.zip | |
net: ethtool: relax ethnl_req_get_phydev() locking assertion
phydev <> netdev linking and lifecycle depends on rtnl_lock.
We want to switch to instance locks for most ethtool ops.
Let's add an assert that ops locked devices don't use phydev
today. If one does we can either opt the phy ops out of
being purely ops locked, or do deeper surgery to make phy
locking ops-compatible. I don't think there's any fundamental
challenge to make that work.
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20260605002912.3456868-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/phy_link_topology.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/phy_link_topology.h b/include/linux/phy_link_topology.h index 68a59e25821c..95575f68d5bc 100644 --- a/include/linux/phy_link_topology.h +++ b/include/linux/phy_link_topology.h @@ -36,6 +36,11 @@ struct phy_device_node { struct phy_device *phy; }; +static inline bool phy_link_topo_empty(struct net_device *dev) +{ + return !dev->link_topo; +} + #if IS_ENABLED(CONFIG_PHYLIB) int phy_link_topo_add_phy(struct net_device *dev, struct phy_device *phy, |
