Skip to content

Commit da62aba

Browse files
vladimirolteankuba-moo
authored andcommitted
net: dsa: sja1105: fix SGMII linking at 10M or 100M but not passing traffic
When using the SGMII PCS as a fixed-link chip-to-chip connection, it is easy to miss the fact that traffic passes only at 1G, since that's what any normal such connection would use. When using the SGMII PCS connected towards an on-board PHY or an SFP module, it is immediately noticeable that when the link resolves to a speed other than 1G, traffic from the MAC fails to pass: TX counters increase, but nothing gets decoded by the other end, and no local RX counters increase either. Artificially lowering a fixed-link rate to speed = <100> makes us able to see the same issue as in the case of having an SGMII PHY. Some debugging shows that the XPCS configuration is A-OK, but that the MAC Configuration Table entry for the port has the SPEED bits still set to 1000Mbps, due to a special condition in the driver. Deleting that condition, and letting the resolved link speed be programmed directly into the MAC speed field, results in a functional link at all 3 speeds. This piece of evidence, based on testing on both generations with SGMII support (SJA1105S and SJA1110A) directly contradicts the statement from the blamed commit that "the MAC is fixed at 1 Gbps and we need to configure the PCS only (if even that)". Worse, that statement is not backed by any documentation, and no one from NXP knows what it might refer to. I am unable to recall sufficient context regarding my testing from March 2020 to understand what led me to draw such a braindead and factually incorrect conclusion. Yet, there is nothing of value regarding forcing the MAC speed, either for SGMII or 2500Base-X (introduced at a later stage), so remove all such logic. Fixes: ffe10e6 ("net: dsa: sja1105: Add support for the SGMII port") Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/20251122111324.136761-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent b9ba633 commit da62aba

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

drivers/net/dsa/sja1105/sja1105_main.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,14 +1302,7 @@ static int sja1105_set_port_speed(struct sja1105_private *priv, int port,
13021302
* table, since this will be used for the clocking setup, and we no
13031303
* longer need to store it in the static config (already told hardware
13041304
* we want auto during upload phase).
1305-
* Actually for the SGMII port, the MAC is fixed at 1 Gbps and
1306-
* we need to configure the PCS only (if even that).
13071305
*/
1308-
if (priv->phy_mode[port] == PHY_INTERFACE_MODE_SGMII)
1309-
speed = priv->info->port_speed[SJA1105_SPEED_1000MBPS];
1310-
else if (priv->phy_mode[port] == PHY_INTERFACE_MODE_2500BASEX)
1311-
speed = priv->info->port_speed[SJA1105_SPEED_2500MBPS];
1312-
13131306
mac[port].speed = speed;
13141307

13151308
return 0;

0 commit comments

Comments
 (0)