net: usb: lan78xx: don't modify phy_device state concurrently
authorIvan T. Ivanov <iivanov@suse.de>
Wed, 4 Aug 2021 08:13:39 +0000 (11:13 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Aug 2021 11:51:14 +0000 (12:51 +0100)
commit6b67d4d63edece1033972214704c04f36c5be89a
tree68a5c88229e74f91f392bce451c45c93912fb645
parent396492b4c5f249f616002bb5de787d060d2b2974
net: usb: lan78xx: don't modify phy_device state concurrently

Currently phy_device state could be left in inconsistent state shown
by following alert message[1]. This is because phy_read_status could
be called concurrently from lan78xx_delayedwork, phy_state_machine and
__ethtool_get_link. Fix this by making sure that phy_device state is
updated atomically.

[1] lan78xx 1-1.1.1:1.0 eth0: No phy led trigger registered for speed(-1)

Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/lan78xx.c