Re: [PATCH] net: phy: leds: Trigger leds only if PHY speed is known

From: Russell King (Oracle)
Date: Mon Aug 09 2021 - 10:16:44 EST

On Wed, Aug 04, 2021 at 11:33:10AM +0300, Ivan T. Ivanov wrote:
> I have sent new patch[1] which I think is proper fix for this.
> [1]


I haven't reviewed the driver, but the patch itself LGTM from the
point of view that phy_read_status() should definitely only be
called with phydev->lock held.

I think we also need the "Doing it all yourself" section in
Documentation/networking/phy.rst fixed to specify that if you
call this function, you must be holding phydev->lock.

Lastly, I'm wondering how many other places call phy_read_status()
without holding phydev->lock - sounds like something that needs a
kernel-wide review, and then possibly we should introduce a lockdep
check for this in phy_read_status() to catch any new introductions.

RMK's Patch system:
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!