]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: phylink: avoid mvneta warning when setting pause parameters
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thu, 28 Oct 2021 14:55:34 +0000 (15:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 13:04:12 +0000 (14:04 +0100)
commitfb41b8f5e855794f180f0f8a118abeb662436a07
treeff4c7e74dc5c3f3fee68774422cd43778c333303
parent08449a5c0e56373847857cc20e2ea22a61bd6600
net: phylink: avoid mvneta warning when setting pause parameters

[ Upstream commit fd8d9731bcdfb22d28e45bce789bcb211c868c78 ]

mvneta does not support asymetric pause modes, and it flags this by the
lack of AsymPause in the supported field. When setting pause modes, we
check that pause->rx_pause == pause->tx_pause, but only when pause
autoneg is enabled. When pause autoneg is disabled, we still allow
pause->rx_pause != pause->tx_pause, which is incorrect when the MAC
does not support asymetric pause, and causes mvneta to issue a warning.

Fix this by removing the test for pause->autoneg, so we always check
that pause->rx_pause == pause->tx_pause for network devices that do not
support AsymPause.

Fixes: 9525ae83959b ("phylink: add phylink infrastructure")
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/phylink.c