Subject: Re: [PATCH net-next 04/14] net: ethtool: relax ethnl_req_get_phydev() locking assertion

From: Jakub Kicinski <[email-masked]>
Date: Fri, 29 May 2026 07:27:47 -0700

On Fri, 29 May 2026 10:43:04 +0200 Maxime Chevallier wrote:
> On 5/29/26 01:16, Jakub Kicinski wrote:
> > 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.  
> 
> Yeah untangling phylink/SFP/phylib from rtnl will be needed soon
> indeed, quite the can of worms...
> 
> But for the topo part, this change should do the trick.
> 
> At some point we'll need to convert a more embeded-oriented MAC
> driver to being ops-locked, to get a good idea of the amount of
> work in front of us.
> 
> Most of the constraints come from the different lifetimes of
> phy_device, sfp-bus and net_device, RTNL is the easy way to
> guarantee that the netdev doesn't dissapear under our feet.

True, I was thinking about it from an integrated driver perspective
where the same driver spawns all elements. In that case it's mostly
a matter of pointing them all to the right netdev instance lock.
But we'll figure it out :)

> Andrew and Russell were careful to get people to annotate
> the RTNL dependencies with assertions, this should make it easier
> to tackle the conversion :)