lan78xx: Fix boot-time RTNL warning

lan78xx_set_eee calls phylink_ethtool_set_eee, which WARNs if rtnl_lock
has not been called. This is fine when called via the ethtool_ops
.set_eee entry point, presumably because the lock is already held, but
lan78xx_probe also calls lan78xx_set_eee via lan78xx_phy_init, which
requires an explicit rtnl_lock/unlock pair to avoid the warning.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
This commit is contained in:
Phil Elwell
2025-11-28 09:28:25 +00:00
parent ecf040339a
commit 521b08840e

View File

@@ -2935,7 +2935,9 @@ static int lan78xx_phy_init(struct lan78xx_net *dev)
"microchip,tx-lpi-timer", "microchip,tx-lpi-timer",
&edata.tx_lpi_timer)) &edata.tx_lpi_timer))
edata.tx_lpi_timer = 600; /* non-aggressive */ edata.tx_lpi_timer = 600; /* non-aggressive */
rtnl_lock();
(void)lan78xx_set_eee(dev->net, &edata); (void)lan78xx_set_eee(dev->net, &edata);
rtnl_unlock();
phy_support_eee(phydev); phy_support_eee(phydev);
} }