fixes for Q-USGMII speeds and autoneg
Subsystems (4)
v2 cover fixes for Q-USGMII speeds and autoneg
This is the second version of a small changeset for QUSGMII support, fixing inconsistencies in reported max speed and control word parsing.
As reported here [1], there are some inconsistencies for the Q-USGMII mode speeds and configuration. The first patch in this fixup series makes so that we correctly report the max speed of 1Gbps for this mode.
The second patch uses a dedicated helper to decode the control word. This is necessary as although USGMII control words are close to USXGMII, they don't support the same speeds.
Thanks,
Maxime
[1] : https://lore.kernel.org/netdev/[email protected]/
V1->V2: Fix decoding logic for usgmii control word, as per Russell's review
Maxime Chevallier (2):
net: phylink: report correct max speed for QUSGMII
net: phylink: use a dedicated helper to parse usgmii control word
drivers/net/phy/phylink.c | 41 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-)
Signature · 7 lines
2.40.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 1/2 net: phylink: report correct max speed for QUSGMII
Q-USGMII is the quad port version of USGMII, and supports a max speed of 1Gbps on each line. Make so that phylink_interface_max_speed() reports this information correctly.
---V1->V2: No changes
drivers/net/phy/phylink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/phylink.c +1 -1
@@ -205,6 +205,7 @@ static int phylink_interface_max_speed(phy_interface_t interface)case PHY_INTERFACE_MODE_RGMII_ID :case PHY_INTERFACE_MODE_RGMII :case PHY_INTERFACE_MODE_QSGMII : +case PHY_INTERFACE_MODE_QUSGMII :case PHY_INTERFACE_MODE_SGMII :case PHY_INTERFACE_MODE_GMII :return SPEED_1000 ;
@@ -221,7 +222,6 @@ static int phylink_interface_max_speed(phy_interface_t interface)case PHY_INTERFACE_MODE_10GBASER :case PHY_INTERFACE_MODE_10GKR :case PHY_INTERFACE_MODE_USXGMII : -case PHY_INTERFACE_MODE_QUSGMII :return SPEED_10000 ;case PHY_INTERFACE_MODE_25GBASER :
Signature · 1 line
2.40.1
PATCH v2 2/2 net: phylink: use a dedicated helper to parse usgmii control word
In reply to Maxime ChevallierQ-USGMII is a derivative of USGMII, that uses a specific formatting for the control word. The layout is close to the USXGMII control word, but doesn't support speeds over 1Gbps. Use a dedicated decoding logic for the USGMII control word, re-using USXGMII definitions but only considering 10/100/1000Mbps speeds
---V1->V2: - Fix the decoding logic, by dropping the custom, wrong, speed mask
- Fix a typo in the function doc ("expect" -> "except")
- Slightly reword the commit log
drivers/net/phy/phylink.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-)
drivers/net/phy/phylink.c +38 -1
@@ -3359,6 +3359,41 @@ void phylink_decode_usxgmii_word(struct phylink_link_state *state, }EXPORT_SYMBOL_GPL (phylink_decode_usxgmii_word); +/** +* phylink_decode_usgmii_word() - decode the USGMII word from a MAC PCS +* @state: a pointer to a struct phylink_link_state. +* @lpa: a 16 bit value which stores the USGMII auto-negotiation word +* +* Helper for MAC PCS supporting the USGMII protocol and the auto-negotiation +* code word. Decode the USGMII code word and populate the corresponding fields +* (speed, duplex) into the phylink_link_state structure. The structure for this +* word is the same as the USXGMII word, except it only supports speeds up to +* 1Gbps. +*/ +static void phylink_decode_usgmii_word (struct phylink_link_state *state, +uint16_t lpa) +{ +switch (lpa &MDIO_USXGMII_SPD_MASK ) { +case MDIO_USXGMII_10 : + state->speed =SPEED_10 ; +break ; +case MDIO_USXGMII_100 : + state->speed =SPEED_100 ; +break ; +case MDIO_USXGMII_1000 : + state->speed =SPEED_1000 ; +break ; +default : + state->link = false; +return ; + } + +if (lpa &MDIO_USXGMII_FULL_DUPLEX ) + state->duplex =DUPLEX_FULL ; +else + state->duplex =DUPLEX_HALF ; +} +/** * phylink_mii_c22_pcs_decode_state() - Decode MAC PCS state from MII registers * @state: a pointer to a &struct phylink_link_state.
@@ -3396,9 +3431,11 @@ void phylink_mii_c22_pcs_decode_state(struct phylink_link_state *state,case PHY_INTERFACE_MODE_SGMII :case PHY_INTERFACE_MODE_QSGMII : -case PHY_INTERFACE_MODE_QUSGMII :phylink_decode_sgmii_word (state, lpa);break ; +case PHY_INTERFACE_MODE_QUSGMII : +phylink_decode_usgmii_word (state, lpa); +break ;default : state->link = false;
Signature · 1 line
2.40.1
Quoted 11 lines · Maxime Chevallier
This is the second version of a small changeset for QUSGMII support, fixing inconsistencies in reported max speed and control word parsing.
As reported here [1], there are some inconsistencies for the Q-USGMII mode speeds and configuration. The first patch in this fixup series makes so that we correctly report the max speed of 1Gbps for this mode.
The second patch uses a dedicated helper to decode the control word. This is necessary as although USGMII control words are close to USXGMII, they don't support the same speeds.
Quoted 7 lines
Thanks,
Maxime
[1] : https://lore.kernel.org/netdev/[email protected]/
V1->V2: Fix decoding logic for usgmii control word, as per Russell's review
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 series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Fri, 9 Jun 2023 10:03:03 +0200 you wrote:
This is the second version of a small changeset for QUSGMII support, fixing inconsistencies in reported max speed and control word parsing.
As reported here [1], there are some inconsistencies for the Q-USGMII mode speeds and configuration. The first patch in this fixup series makes so that we correctly report the max speed of 1Gbps for this mode.
[...]
Here is the summary with links:
- [net,v2,1/2] net: phylink: report correct max speed for QUSGMII
https://git.kernel.org/netdev/net/c/b9dc1046edfe - [net,v2,2/2] net: phylink: use a dedicated helper to parse usgmii control word https://git.kernel.org/netdev/net/c/923454c0368b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html