net: pcs: lynx: fix lynx_pcs_link_up_sgmii() not doing anything in fixed-link mode
Subsystems (4)
PATCH 1/1 net: pcs: lynx: fix lynx_pcs_link_up_sgmii() not doing anything in fixed-link mode
lynx_pcs_link_up_sgmii() is supposed to update the PCS speed and duplex for the non-inband operating modes, and prior to the blamed commit, it did just that, but a mistake sneaked into the conversion and reversed the condition.
It is easy for this to go undetected on platforms that also initialize the PCS in the bootloader, because Linux doesn't reset it (although maybe it should). The nature of the bug is that phylink will not touch the IF_MODE_HALF_DUPLEX | IF_MODE_SPEED_MSK fields when it should, and it will apparently keep working if the previous values set by the bootloader were correct.
--- drivers/net/pcs/pcs-lynx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/pcs/pcs-lynx.c +1 -1
@@ -216,7 +216,7 @@ static void lynx_pcs_link_up_sgmii(struct mdio_device *pcs,/* The PCS needs to be configured manually only * when not operating on in-band mode */ -if (neg_mode !=PHYLINK_PCS_NEG_INBAND_ENABLED ) +if (neg_mode ==PHYLINK_PCS_NEG_INBAND_ENABLED )return ;if (duplex ==DUPLEX_HALF )
Signature · 1 line
2.34.1
Quoted 4 lines · Vladimir Oltean
lynx_pcs_link_up_sgmii()is supposed to update the PCS speed and duplex for the non-inband operating modes, and prior to the blamed commit, it did just that, but a mistake sneaked into the conversion and reversed the condition.
Yes, it certainly looks that way, thanks for catching this.
Quoted 9 lines
It is easy for this to go undetected on platforms that also initialize the PCS in the bootloader, because Linux doesn't reset it (although maybe it should). The nature of the bug is that phylink will not touch the
IF_MODE_HALF_DUPLEX|IF_MODE_SPEED_MSKfields when it should, and it will apparently keep working if the previous values set by the bootloader were correct.Fixes c689a6528c22 ("net: pcs: lynx: update PCS driver to use neg_mode")Signed-off-by Vladimir Oltean <[email protected]>
Thanks!
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:
Quoted 5 lines · On Fri, 11 Aug 2023 14:53:52 +0300 you wrote:
lynx_pcs_link_up_sgmii()is supposed to update the PCS speed and duplex for the non-inband operating modes, and prior to the blamed commit, it did just that, but a mistake sneaked into the conversion and reversed the condition.
Quoted 8 lines
It is easy for this to go undetected on platforms that also initialize the PCS in the bootloader, because Linux doesn't reset it (although maybe it should). The nature of the bug is that phylink will not touch the
IF_MODE_HALF_DUPLEX|IF_MODE_SPEED_MSKfields when it should, and it will apparently keep working if the previous values set by the bootloader were correct.[...]
Here is the summary with links:
- [net-next] net: pcs: lynx: fix lynx_pcs_link_up_sgmii() not doing anything in fixed-link mode
https://git.kernel.org/netdev/net-next/c/2f4503f94c5d
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html