History

net: phylink: treat PSGMII as an inband capable interface

PSGMII (the Qualcomm 5-port SGMII) conveys the link negotiation result from the PHY back to the MAC through per-channel in-band SGMII words, exactly like SGMII and QSGMII. However, PHY_INTERFACE_MODE_PSGMII is missing from phylink_get_inband_type(), so phylink reports INBAND_NONE for it and phylink_pcs_neg_mode() falls back to PHYLINK_PCS_NEG_NONE. The PCS is then programmed in force mode and its control-register speed bits (which default to 1000base) are used, so a slower copper link - e.g. 100base-T - is reported as 1Gbps and cannot pass traffic. Classify PSGMII alongside SGMII and QSGMII as INBAND_CISCO_SGMII so the PCS negotiates in-band and the resolved link speed comes from the PHY in-band word. Also add PSGMII to the generic clause 22 PCS helper functions which handle the SGMII in-band word. Without this, a PCS using these helpers would still fall through to the default handling and force the link state to false in phylink_mii_c22_pcs_decode_state(), fail to encode the SGMII advertisement, and get rejected by phylink_get_link_timer_ns().

Sandeep Sondagar committed 3 months ago

Commit 5ba017f1 parent 77e80af2 files · +4 −0Browse files

Unified · Split

2 files
  1. drivers/net/phy/phylink.c +3 −0
  2. include/linux/phylink.h +1 −0
drivers/net/phy/phylink.c+3−0
@@ -1039,6 +1039,7 @@ static enum inband_type phylink_get_inband_type(phy_interface_t interface) · 1038 unmodified lines
10391039 {
10401040 switch (interface) {
10411041 case PHY_INTERFACE_MODE_SGMII:
1042+ case PHY_INTERFACE_MODE_PSGMII:
10421043 case PHY_INTERFACE_MODE_QSGMII:
10431044 case PHY_INTERFACE_MODE_QUSGMII:
10441045 case PHY_INTERFACE_MODE_USXGMII:
@@ -4178,6 +4179,7 @@ void phylink_mii_c22_pcs_decode_state(struct phylink_link_state *state, · 3133 unmodified lines
41784179 break;
41794180
41804181 case PHY_INTERFACE_MODE_SGMII:
4182+ case PHY_INTERFACE_MODE_PSGMII:
41814183 case PHY_INTERFACE_MODE_QSGMII:
41824184 if (neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED)
41834185 phylink_decode_sgmii_word(state, lpa);
@@ -4258,6 +4260,7 @@ int phylink_mii_c22_pcs_encode_advertisement(phy_interface_t interface, · 74 unmodified lines
42584260 adv |= ADVERTISE_1000XPSE_ASYM;
42594261 return adv;
42604262 case PHY_INTERFACE_MODE_SGMII:
4263+ case PHY_INTERFACE_MODE_PSGMII:
42614264 case PHY_INTERFACE_MODE_QSGMII:
42624265 return 0x0001;
42634266 default:
include/linux/phylink.h+1−0
@@ -791,6 +791,7 @@ static inline int phylink_get_link_timer_ns(phy_interface_t interface) · 790 unmodified lines
791791 {
792792 switch (interface) {
793793 case PHY_INTERFACE_MODE_SGMII:
794+ case PHY_INTERFACE_MODE_PSGMII:
794795 case PHY_INTERFACE_MODE_QSGMII:
795796 case PHY_INTERFACE_MODE_USXGMII:
796797 case PHY_INTERFACE_MODE_10G_QXGMII:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t