]> git.itanic.dy.fi Git - linux-stable/commit
net: transfer rtnl_lock() requirement from ethtool_set_ethtool_phy_ops() to caller
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 1 Aug 2023 14:28:22 +0000 (17:28 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 3 Aug 2023 02:11:06 +0000 (19:11 -0700)
commit70ef7d87f62a86674c21a99341dabc175c19681a
tree45483922267932b4dcd9fb072941b99b2796af9f
parent54e1ed69c40a3ea9a82cb59ad88e00af98a6628e
net: transfer rtnl_lock() requirement from ethtool_set_ethtool_phy_ops() to caller

phy_init() and phy_exit() will have to do more stuff under rtnl_lock()
in a future change. Since rtnl_unlock() -> netdev_run_todo() does a lot
of stuff under the hood, it's a pity to lock and unlock the rtnetlink
mutex twice in a row.

Change the calling convention such that the only caller of
ethtool_set_ethtool_phy_ops(), phy_device.c, provides a context where
the rtnl_mutex is already acquired.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20230801142824.1772134-11-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/phy_device.c
net/ethtool/common.c