Re: [PATCH net-next v5 09/23] net: phy: start using genphy_c45_ethtool_get/set_eee()

From: Andrew Lunn
Date: Mon Feb 06 2023 - 20:06:05 EST


On Mon, Feb 06, 2023 at 02:50:36PM +0100, Oleksij Rempel wrote:
> All preparations are done. Now we can start using new functions and remove
> the old code.
>
> Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>

This change looks correct, in that it just replaces code with other
equivalent code.

But looking at it, i started to wonder about locking. I don't see
phydev->lock held anywhere. But it does access members of phydev, in
particular speed and duplex. If the PHY state machine is running at
the same time, and phy_read_status() is called, those members can
contain invalid information.

So i think another patch is needed to add locking to these two
functions.

Otherwise:

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew