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

From: Andrew Lunn
Date: Wed Aug 11 2021 - 18:23:56 EST


On Mon, Aug 09, 2021 at 03:16:33PM +0100, Russell King (Oracle) wrote:
> 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] https://lore.kernel.org/netdev/20210804081339.19909-1-iivanov@xxxxxxx/T/#u
>
> Thanks.
>
> 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'm cooking up a patchset which makes phy_read_status() take the
lock. I don't see any external callers taking the lock, so all the
changes are internal to phylib.

The change is however made a bit more complex by phy_read_status()
being in a header file, not phy.c. I wounder if there is some build
dependencies, modules vs built in. So my first patch simply moves it
into phy.c no other change. I will push it to github and let 0-day
chew on it for a while and see if it finds any build failures.

Andrew