]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: fix duplex out of sync problem while changing settings
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 3 Nov 2021 21:08:28 +0000 (22:08 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 4 Nov 2021 23:46:29 +0000 (16:46 -0700)
commitc178c40be70229590e3c26a9699efab50c8db1ff
treec7624300d8f723dec2ffc1010cf44459b8b989b4
parentc38cf6af33186bc64a26528e37b301aa3ef9dddf
net: phy: fix duplex out of sync problem while changing settings

As reported by Zhang there's a small issue if in forced mode the duplex
mode changes with the link staying up [0]. In this case the MAC isn't
notified about the change.

The proposed patch relies on the phylib state machine and ignores the
fact that there are drivers that uses phylib but not the phylib state
machine. So let's don't change the behavior for such drivers and fix
it w/o re-adding state PHY_FORCING for the case that phylib state
machine is used.

[0] https://lore.kernel.org/netdev/a5c26ffd-4ee4-a5e6-4103-873208ce0dc5@huawei.com/T/

Fixes: abe1448d4e34 ("net: phy: remove state PHY_FORCING")
Reported-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Tested-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/7b8b9456-a93f-abbc-1dc5-a2c2542f932c@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/phy.c