Skip to contentSkip to conversation

Support PHYs that have inband autoneg disabled with GEM

PATCH Applied Charles Perry 4 participants 25 messages Feb 24 – Mar 6

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover Support PHYs that have inband autoneg disabled with GEM

Changes in v2:
* Add a cover-letter
* Remove the spinlock in macb_pcs_config() (patch 1)
* Add the macb_pcs_inband_caps() ops (patch 3)

I'm testing SGMII with a VSC8574 PHY [1] and microchip HPSC SoC [2].

The link can work with or without autoneg, as long as the MAC and the PHY are configured the same way. This doesn't work with the current MAC driver because the MAC inband autoneg is always enabled (in the ->mac_config() phylink_mac_ops). More precisely, the PHY driver (mscc_main.c) has phylink's ->config_inband() implemented while the MAC ->pcs_config() ops has an empty body.

This is based on code written by Sean Anderson [3]. Let me know if I should add a From: or Co-developed-by: tag.

Logs with inband autoneg (managed = "in-band-status"):

````````````````````````````````````````````````````````
root@p64h:~# ifconfig eth1 up 10.180.59.33
macb 40004184000.ethernet eth1: PHY 4000c21e000.mdio-mdio:02 doesn't supply possible interfaces
macb 40004184000.ethernet eth1: PHY [4000c21e000.mdio-mdio:02] driver [Microsemi GE VSC8574 SyncE] (irq=POLL)
macb 40004184000.ethernet eth1: phy: sgmii setting supported 00000000,00000000,00000000,000042ff advertising 00000000,00000000,00000000,000042ff
macb 40004184000.ethernet eth1: configuring for inband/sgmii link mode
macb 40004184000.ethernet eth1: major config, requested inband/sgmii
macb 40004184000.ethernet eth1: interface sgmii inband modes: pcs=03 phy=03
macb 40004184000.ethernet eth1: major config, active inband/inband,an-enabled/sgmii
macb 40004184000.ethernet eth1: phylink_mac_config: mode=inband/sgmii/none adv=00000000,00000000,00000000,000042ff pause=00
macb_pcs_config: PCSANADV=0x1 PCSCNTRL=0x1040
macb_pcs_get_state: PCSSTS=0x109 PCSANLPBASE=0x1
macb_pcs_get_state: PCSSTS=0x12d PCSANLPBASE=0x1801
macb 40004184000.ethernet eth1: phy link down sgmii/Unknown/Unknown/none/off/nolpi
macb_pcs_get_state: PCSSTS=0x12d PCSANLPBASE=0x1801
macb_pcs_get_state: PCSSTS=0x12d PCSANLPBASE=0x1801
macb 40004184000.ethernet eth1: phy link up sgmii/1Gbps/Full/none/tx/nolpi
macb_pcs_get_state: PCSSTS=0x129 PCSANLPBASE=0x9801
macb_pcs_get_state: PCSSTS=0x12d PCSANLPBASE=0x9801
macb 40004184000.ethernet eth1: Link is Up - 1Gbps/Full - flow control tx
````````````````````````````````````````````````````````

Logs without inband autoneg:

````````````````````````````````````````````````````````
root@p64h:~# ifconfig eth1 up 10.180.59.33
macb 40004184000.ethernet eth1: PHY 4000c21e000.mdio-mdio:02 doesn't supply possible interfaces
macb 40004184000.ethernet eth1: PHY [4000c21e000.mdio-mdio:02] driver [Microsemi GE VSC8574 SyncE] (irq=POLL)
macb 40004184000.ethernet eth1: phy: sgmii setting supported 00000000,00000000,00000000,000042ff advertising 00000000,00000000,00000000,000042ff
macb 40004184000.ethernet eth1: configuring for phy/sgmii link mode
macb 40004184000.ethernet eth1: major config, requested phy/sgmii
macb 40004184000.ethernet eth1: interface sgmii inband modes: pcs=03 phy=03
macb 40004184000.ethernet eth1: major config, active phy/outband/sgmii
macb 40004184000.ethernet eth1: phylink_mac_config: mode=phy/sgmii/none adv=00000000,00000000,00000000,00000000 pause=00
macb_pcs_config: PCSANADV=0x1 PCSCNTRL=0x40
macb 40004184000.ethernet eth1: phy link down sgmii/Unknown/Unknown/none/off/nolpi
macb 40004184000.ethernet eth1: phy link up sgmii/1Gbps/Full/none/tx/nolpi
macb 40004184000.ethernet eth1: Link is Up - 1Gbps/Full - flow control tx
````````````````````````````````````````````````````````

The above logs are generated with an additional printk() in macb_psc_config() and macb_pcs_get_state() and "#define DEBUG" in phylink.c.

[1]: https://www.microchip.com/en-us/product/vsc8574
[2]: https://www.microchip.com/en-us/products/microprocessors/64-bit-mpus/pic64-hpsc
[3]: https://lore.kernel.org/all/[email protected]/

Charles Perry (3):
net: macb: fix SGMII with inband aneg disabled
net: macb: add support for reporting SGMII inband link status
net: macb: add the .pcs_inband_caps() callback for SGMII

 drivers/net/ethernet/cadence/macb_main.c | 50 ++++++++++++++++--------
 1 file changed, 33 insertions(+), 17 deletions(-)
Signature · 1 line
2.47.3
#1 lore raw

PATCH v2 1/3 net: macb: fix SGMII with inband aneg disabled

Make it possible to connect a PHY which does not use inband autoneg to a gem MAC using phylink's information.

The previous implementation relied on whether or not the link was a fixed-link to disable SGMII autoneg. This commit extend this to all link which are not configured for inband autonegotiation.

---

Notes:
Changes in v2:
* Move my notes to the cover letter
* Remove the spinlock in macb_pcs_config
* Keep the comment about the PCSSEL register

 drivers/net/ethernet/cadence/macb_main.c | 36 +++++++++++++-----------
 1 file changed, 20 insertions(+), 16 deletions(-)
drivers/net/ethernet/cadence/macb_main.c +20 -16
index f72270a39d25..f4250e76cef0 100644
@@ -574,6 +574,26 @@ static int macb_pcs_config(struct phylink_pcs *pcs,
 			   const unsigned long *advertising,
 			   bool permit_pause_to_mac)
 {
+	struct macb *bp = container_of(pcs, struct macb, phylink_sgmii_pcs);
+	u32 old, new;
+
+	old = gem_readl(bp, PCSANADV);
+	new = phylink_mii_c22_pcs_encode_advertisement(interface, advertising);
+	if (new != -EINVAL && old != new)
+		gem_writel(bp, PCSANADV, new);
+
+	/* Disable AN if it's not to be used, enable otherwise.
+	 * Must be written after PCSSEL is set in NCFGR which is done in
+	 * macb_mac_config(), otherwise writes will not take effect.
+	 */
+	old = gem_readl(bp, PCSCNTRL);
+	if (neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED)
+		new = old | BMCR_ANENABLE;
+	else
+		new = old & ~BMCR_ANENABLE;
+	if (old != new)
+		gem_writel(bp, PCSCNTRL, new);
+
 	return 0;
 }
 
@@ -628,22 +648,6 @@ static void macb_mac_config(struct phylink_config *config, unsigned int mode,
 	if (old_ncr ^ ncr)
 		macb_or_gem_writel(bp, NCR, ncr);
 
-	/* Disable AN for SGMII fixed link configuration, enable otherwise.
-	 * Must be written after PCSSEL is set in NCFGR,
-	 * otherwise writes will not take effect.
-	 */
-	if (macb_is_gem(bp) && state->interface == PHY_INTERFACE_MODE_SGMII) {
-		u32 pcsctrl, old_pcsctrl;
-
-		old_pcsctrl = gem_readl(bp, PCSCNTRL);
-		if (mode == MLO_AN_FIXED)
-			pcsctrl = old_pcsctrl & ~GEM_BIT(PCSAUTONEG);
-		else
-			pcsctrl = old_pcsctrl | GEM_BIT(PCSAUTONEG);
-		if (old_pcsctrl != pcsctrl)
-			gem_writel(bp, PCSCNTRL, pcsctrl);
-	}
-
 	spin_unlock_irqrestore(&bp->lock, flags);
 }
 
Signature · 1 line
2.47.3
#2 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

Quoted 9 lines · Charles Perry

Make it possible to connect a PHY which does not use inband autoneg to a gem MAC using phylink's information.

The previous implementation relied on whether or not the link was a fixed-link to disable SGMII autoneg. This commit extend this to all link which are not configured for inband autonegotiation.

This breaks the macb on mpfs-icicle-kit, I get stuck with:

[    7.189102] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    7.260946] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[    7.273881] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[    7.296580] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[    7.345782] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[    7.358082] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[    7.380479] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.
[   11.376763] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   11.398403] Sending DHCP requests .
[   11.472699] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   13.938425] ..... timed out!
[   93.598491] macb 20110000.ethernet eth0: Link is Down
[   93.641823] macb 20110000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.659433] macb 20112000.ethernet eth1: Link is Down
[   93.691724] macb 20112000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.703977] IP-Config: Retrying forever (NFS root)...
[   93.758382] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[   93.770655] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[   93.786497] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   93.795840] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[   93.844481] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[   93.856769] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[   93.870926] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   93.880302] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.

and because I am NFS root, it breaks boot :)

btw, I don't see an explanation in hte commit message for why the macb_is_gem(bp) got dropped? Is this now done unconditionally when it was conditional before?

Cheers,
Conor.

Quoted 68 lines

---

Notes:
Changes in v2:
* Move my notes to the cover letter
* Remove the spinlock in macb_pcs_config
* Keep the comment about the PCSSEL register

 drivers/net/ethernet/cadence/macb_main.c | 36 +++++++++++++-----------
 1 file changed, 20 insertions(+), 16 deletions(-)
drivers/net/ethernet/cadence/macb_main.c +20 -16
index f72270a39d25..f4250e76cef0 100644
@@ -574,6 +574,26 @@ static int macb_pcs_config(struct phylink_pcs *pcs,
 			   const unsigned long *advertising,
 			   bool permit_pause_to_mac)
 {
+	struct macb *bp = container_of(pcs, struct macb, phylink_sgmii_pcs);
+	u32 old, new;
+
+	old = gem_readl(bp, PCSANADV);
+	new = phylink_mii_c22_pcs_encode_advertisement(interface, advertising);
+	if (new != -EINVAL && old != new)
+		gem_writel(bp, PCSANADV, new);
+
+	/* Disable AN if it's not to be used, enable otherwise.
+	 * Must be written after PCSSEL is set in NCFGR which is done in
+	 * macb_mac_config(), otherwise writes will not take effect.
+	 */
+	old = gem_readl(bp, PCSCNTRL);
+	if (neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED)
+		new = old | BMCR_ANENABLE;
+	else
+		new = old & ~BMCR_ANENABLE;
+	if (old != new)
+		gem_writel(bp, PCSCNTRL, new);
+
 	return 0;
 }
 
@@ -628,22 +648,6 @@ static void macb_mac_config(struct phylink_config *config, unsigned int mode,
 	if (old_ncr ^ ncr)
 		macb_or_gem_writel(bp, NCR, ncr);
 
-	/* Disable AN for SGMII fixed link configuration, enable otherwise.
-	 * Must be written after PCSSEL is set in NCFGR,
-	 * otherwise writes will not take effect.
-	 */
-	if (macb_is_gem(bp) && state->interface == PHY_INTERFACE_MODE_SGMII) {
-		u32 pcsctrl, old_pcsctrl;
-
-		old_pcsctrl = gem_readl(bp, PCSCNTRL);
-		if (mode == MLO_AN_FIXED)
-			pcsctrl = old_pcsctrl & ~GEM_BIT(PCSAUTONEG);
-		else
-			pcsctrl = old_pcsctrl | GEM_BIT(PCSAUTONEG);
-		if (old_pcsctrl != pcsctrl)
-			gem_writel(bp, PCSCNTRL, pcsctrl);
-	}
-
 	spin_unlock_irqrestore(&bp->lock, flags);
 }
 
Signature · 1 line
2.47.3
#3 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

Quoted 29 lines · Conor Dooley
Quoted 9 lines · Charles Perry

Make it possible to connect a PHY which does not use inband autoneg to a gem MAC using phylink's information.

The previous implementation relied on whether or not the link was a fixed-link to disable SGMII autoneg. This commit extend this to all link which are not configured for inband autonegotiation.

This breaks the macb on mpfs-icicle-kit, I get stuck with:

[    7.189102] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    7.260946] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[    7.273881] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[    7.296580] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[    7.345782] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[    7.358082] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[    7.380479] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.
[   11.376763] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   11.398403] Sending DHCP requests .
[   11.472699] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   13.938425] ..... timed out!
[   93.598491] macb 20110000.ethernet eth0: Link is Down
[   93.641823] macb 20110000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.659433] macb 20112000.ethernet eth1: Link is Down
[   93.691724] macb 20112000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.703977] IP-Config: Retrying forever (NFS root)...
Quoted 9 lines
[   93.758382] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[   93.770655] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[   93.786497] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   93.795840] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[   93.844481] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[   93.856769] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[   93.870926] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   93.880302] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.

Hello Conor,

I checked the driver for the VSC8662 and it doesn't have the ->inband_caps() and ->config_inband() callbacks so Linux leaves whatever the bootloader puts or uses the defaults. Looking at the datasheet, this should be register 23 (Extended PHY Control Set 1) bit 13 (MAC interface auto-negotiation)

My guess is that this bit is set and since this patch disable inband autonegotiation (because phylink decides it), there is a mismatch.

Can you add 'managed = "in-band-status"' in your device tree under the macb node? That's not necessarily the fix, I just want to confirm my theory. Also '#define DEBUG' in 'drivers/net/phy/phylink.c' can help if you can recompile your kernel.

Quoted 6 lines

and because I am NFS root, it breaks boot :)

btw, I don't see an explanation in hte commit message for why the macb_is_gem(bp) got dropped? Is this now done unconditionally when it was conditional before?

Well if you get to the ->macb_pcs_config() callback, you most certainly have an SGMII PCS block. Does your IP have the PCS registers? (0x200 to 0x23c) Also I thought that macb doesn't do SGMII (only GEM does) so it can't reach ->macb_pcs_config().

Thanks alot for the testing!

Regards,
Charles

Quoted 71 lines

Cheers,
Conor.

Quoted 68 lines

---

Notes:
Changes in v2:
* Move my notes to the cover letter
* Remove the spinlock in macb_pcs_config
* Keep the comment about the PCSSEL register

 drivers/net/ethernet/cadence/macb_main.c | 36 +++++++++++++-----------
 1 file changed, 20 insertions(+), 16 deletions(-)
drivers/net/ethernet/cadence/macb_main.c +20 -16
index f72270a39d25..f4250e76cef0 100644
@@ -574,6 +574,26 @@ static int macb_pcs_config(struct phylink_pcs *pcs,
 			   const unsigned long *advertising,
 			   bool permit_pause_to_mac)
 {
+	struct macb *bp = container_of(pcs, struct macb, phylink_sgmii_pcs);
+	u32 old, new;
+
+	old = gem_readl(bp, PCSANADV);
+	new = phylink_mii_c22_pcs_encode_advertisement(interface, advertising);
+	if (new != -EINVAL && old != new)
+		gem_writel(bp, PCSANADV, new);
+
+	/* Disable AN if it's not to be used, enable otherwise.
+	 * Must be written after PCSSEL is set in NCFGR which is done in
+	 * macb_mac_config(), otherwise writes will not take effect.
+	 */
+	old = gem_readl(bp, PCSCNTRL);
+	if (neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED)
+		new = old | BMCR_ANENABLE;
+	else
+		new = old & ~BMCR_ANENABLE;
+	if (old != new)
+		gem_writel(bp, PCSCNTRL, new);
+
 	return 0;
 }
 
@@ -628,22 +648,6 @@ static void macb_mac_config(struct phylink_config *config, unsigned int mode,
 	if (old_ncr ^ ncr)
 		macb_or_gem_writel(bp, NCR, ncr);
 
-	/* Disable AN for SGMII fixed link configuration, enable otherwise.
-	 * Must be written after PCSSEL is set in NCFGR,
-	 * otherwise writes will not take effect.
-	 */
-	if (macb_is_gem(bp) && state->interface == PHY_INTERFACE_MODE_SGMII) {
-		u32 pcsctrl, old_pcsctrl;
-
-		old_pcsctrl = gem_readl(bp, PCSCNTRL);
-		if (mode == MLO_AN_FIXED)
-			pcsctrl = old_pcsctrl & ~GEM_BIT(PCSAUTONEG);
-		else
-			pcsctrl = old_pcsctrl | GEM_BIT(PCSAUTONEG);
-		if (old_pcsctrl != pcsctrl)
-			gem_writel(bp, PCSCNTRL, pcsctrl);
-	}
-
 	spin_unlock_irqrestore(&bp->lock, flags);
 }
 
Signature · 1 line
2.47.3
#4 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

Quoted 48 lines · Charles Perry
Quoted 29 lines · Conor Dooley
Quoted 9 lines · Charles Perry

Make it possible to connect a PHY which does not use inband autoneg to a gem MAC using phylink's information.

The previous implementation relied on whether or not the link was a fixed-link to disable SGMII autoneg. This commit extend this to all link which are not configured for inband autonegotiation.

This breaks the macb on mpfs-icicle-kit, I get stuck with:

[    7.189102] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    7.260946] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[    7.273881] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[    7.296580] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[    7.345782] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[    7.358082] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[    7.380479] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.
[   11.376763] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   11.398403] Sending DHCP requests .
[   11.472699] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   13.938425] ..... timed out!
[   93.598491] macb 20110000.ethernet eth0: Link is Down
[   93.641823] macb 20110000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.659433] macb 20112000.ethernet eth1: Link is Down
[   93.691724] macb 20112000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.703977] IP-Config: Retrying forever (NFS root)...
Quoted 9 lines
[   93.758382] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[   93.770655] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[   93.786497] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   93.795840] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[   93.844481] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[   93.856769] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[   93.870926] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   93.880302] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.

Hello Conor,

I checked the driver for the VSC8662 and it doesn't have the ->inband_caps() and ->config_inband() callbacks so Linux leaves whatever the bootloader puts or uses the defaults. Looking at the datasheet, this should be register 23 (Extended PHY Control Set 1) bit 13 (MAC interface auto-negotiation)

Quoted 5 lines

My guess is that this bit is set and since this patch disable inband autonegotiation (because phylink decides it), there is a mismatch.

Can you add 'managed = "in-band-status"' in your device tree under the macb node? That's not necessarily the fix, I just want to confirm my theory.

No, it just produces a different error:

[    5.769864] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    5.829146] macb 20110000.ethernet eth0: Could not attach PHY (-19)
[    5.854232] IP-Config: Failed to open eth0
[    5.897152] macb 20112000.ethernet eth1: Could not attach PHY (-19)
[    5.921061] IP-Config: Failed to open eth1
[    5.925592] IP-Config: No network devices available
[    5.938800] clk: Disabling unused clocks
[    5.944156] PM: genpd: Disabling unused power domains
[    5.961029] check access for rdinit=/usr/sbin/init failed: -2, ignoring
Quoted 2 lines

Also '#define DEBUG' in 'drivers/net/phy/phylink.c' can help if you can recompile your kernel.

Setting this provided no further logs, seemingly.

Adding some basic prints shows that the driver changed the state of the PCSCNTRL register from 0x1040 to 0x40, so it disabled auto neg. The driver previously left it as it was, 0x1040 before and 0x1040 after.

Quoted 11 lines
Quoted 6 lines

and because I am NFS root, it breaks boot :)

btw, I don't see an explanation in hte commit message for why the macb_is_gem(bp) got dropped? Is this now done unconditionally when it was conditional before?

Well if you get to the ->macb_pcs_config() callback, you most certainly have an SGMII PCS block. Does your IP have the PCS registers? (0x200 to 0x23c) Also I thought that macb doesn't do SGMII (only GEM does) so it can't reach ->macb_pcs_config().

When I said "macb on" I meant to say "macb driver on", but omitted the word. Unfortunately, the idiot who added the original mpfs compatible, because the platform was using the "cdns,macb" compatible rather than a soc-specific one, did not check if the platform was actually a macb before doing so, and trusted the original dts author. This is actually a gem.

#5 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

Quoted 56 lines · Conor Dooley
Quoted 48 lines · Charles Perry
Quoted 29 lines · Conor Dooley
Quoted 9 lines · Charles Perry

Make it possible to connect a PHY which does not use inband autoneg to a gem MAC using phylink's information.

The previous implementation relied on whether or not the link was a fixed-link to disable SGMII autoneg. This commit extend this to all link which are not configured for inband autonegotiation.

This breaks the macb on mpfs-icicle-kit, I get stuck with:

[    7.189102] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    7.260946] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[    7.273881] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[    7.296580] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[    7.345782] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[    7.358082] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[    7.380479] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.
[   11.376763] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   11.398403] Sending DHCP requests .
[   11.472699] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   13.938425] ..... timed out!
[   93.598491] macb 20110000.ethernet eth0: Link is Down
[   93.641823] macb 20110000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.659433] macb 20112000.ethernet eth1: Link is Down
[   93.691724] macb 20112000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.703977] IP-Config: Retrying forever (NFS root)...
Quoted 9 lines
[   93.758382] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[   93.770655] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[   93.786497] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   93.795840] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[   93.844481] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[   93.856769] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[   93.870926] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   93.880302] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.

Hello Conor,

I checked the driver for the VSC8662 and it doesn't have the ->inband_caps() and ->config_inband() callbacks so Linux leaves whatever the bootloader puts or uses the defaults. Looking at the datasheet, this should be register 23 (Extended PHY Control Set 1) bit 13 (MAC interface auto-negotiation)

Quoted 5 lines

My guess is that this bit is set and since this patch disable inband autonegotiation (because phylink decides it), there is a mismatch.

Can you add 'managed = "in-band-status"' in your device tree under the macb node? That's not necessarily the fix, I just want to confirm my theory.

No, it just produces a different error:

Quoted 9 lines
[    5.769864] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    5.829146] macb 20110000.ethernet eth0: Could not attach PHY (-19)
[    5.854232] IP-Config: Failed to open eth0
[    5.897152] macb 20112000.ethernet eth1: Could not attach PHY (-19)
[    5.921061] IP-Config: Failed to open eth1
[    5.925592] IP-Config: No network devices available
[    5.938800] clk: Disabling unused clocks
[    5.944156] PM: genpd: Disabling unused power domains
[    5.961029] check access for rdinit=/usr/sbin/init failed: -2, ignoring

-19 is -ENODEV (I wish everyone would use %pe so we get english error messages rather than having to look up errno codes in the header files.)

macb uses either phylink_of_phy_connect() or phylink_connect_phy(). I don't think phylink_connect_phy() would return -ENODEV, but phylink_of_phy_connect() would - but I can't see that adding 'managed = "in-band-status";' to DT would cause that. The only case I can see is that fwnode_phy_find_device() fails to find the phydev, but there is a PHY node specified in DT, but that would fail without in-band-status.

Quoted 4 lines
Quoted 2 lines

Also '#define DEBUG' in 'drivers/net/phy/phylink.c' can help if you can recompile your kernel.

Setting this provided no further logs, seemingly.

It certainly would if you place it before the first #include - I routinely build kernels with it set as such. The messages are produced at debug level, so should appear via "dmesg". If you want to see them on the console, you need to add "debug" to the kernel command line.

However, the in-band-status thing needs to be root-caused first.

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!
#6 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

Quoted 71 lines · Russell King (Oracle)
Quoted 56 lines · Conor Dooley
Quoted 48 lines · Charles Perry
Quoted 29 lines · Conor Dooley
Quoted 9 lines · Charles Perry

Make it possible to connect a PHY which does not use inband autoneg to a gem MAC using phylink's information.

The previous implementation relied on whether or not the link was a fixed-link to disable SGMII autoneg. This commit extend this to all link which are not configured for inband autonegotiation.

This breaks the macb on mpfs-icicle-kit, I get stuck with:

[    7.189102] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    7.260946] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[    7.273881] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[    7.296580] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[    7.345782] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[    7.358082] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[    7.380479] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.
[   11.376763] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   11.398403] Sending DHCP requests .
[   11.472699] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   13.938425] ..... timed out!
[   93.598491] macb 20110000.ethernet eth0: Link is Down
[   93.641823] macb 20110000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.659433] macb 20112000.ethernet eth1: Link is Down
[   93.691724] macb 20112000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.703977] IP-Config: Retrying forever (NFS root)...
Quoted 9 lines
[   93.758382] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[   93.770655] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[   93.786497] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   93.795840] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[   93.844481] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[   93.856769] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[   93.870926] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   93.880302] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.

Hello Conor,

I checked the driver for the VSC8662 and it doesn't have the ->inband_caps() and ->config_inband() callbacks so Linux leaves whatever the bootloader puts or uses the defaults. Looking at the datasheet, this should be register 23 (Extended PHY Control Set 1) bit 13 (MAC interface auto-negotiation)

Quoted 5 lines

My guess is that this bit is set and since this patch disable inband autonegotiation (because phylink decides it), there is a mismatch.

Can you add 'managed = "in-band-status"' in your device tree under the macb node? That's not necessarily the fix, I just want to confirm my theory.

No, it just produces a different error:

Quoted 9 lines
[    5.769864] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    5.829146] macb 20110000.ethernet eth0: Could not attach PHY (-19)
[    5.854232] IP-Config: Failed to open eth0
[    5.897152] macb 20112000.ethernet eth1: Could not attach PHY (-19)
[    5.921061] IP-Config: Failed to open eth1
[    5.925592] IP-Config: No network devices available
[    5.938800] clk: Disabling unused clocks
[    5.944156] PM: genpd: Disabling unused power domains
[    5.961029] check access for rdinit=/usr/sbin/init failed: -2, ignoring

-19 is -ENODEV (I wish everyone would use %pe so we get english error messages rather than having to look up errno codes in the header files.)

Quoted 8 lines

macb uses either phylink_of_phy_connect() or phylink_connect_phy(). I don't think phylink_connect_phy() would return -ENODEV, but phylink_of_phy_connect() would - but I can't see that adding 'managed = "in-band-status";' to DT would cause that. The only case I can see is that fwnode_phy_find_device() fails to find the phydev, but there is a PHY node specified in DT, but that would fail without in-band-status.

Conor,

Can you send us a snippet of you device tree showing the gem node and the phy?

The idea behind adding 'managed = "in-band-status"' in the device tree is to hint phylink to use MLO_AN_INBAND. I'm afraid we'll get the same result if we come up with a different workaround.

Thanks,
Charles

Quoted 15 lines
Quoted 4 lines
Quoted 2 lines

Also '#define DEBUG' in 'drivers/net/phy/phylink.c' can help if you can recompile your kernel.

Setting this provided no further logs, seemingly.

It certainly would if you place it before the first #include - I routinely build kernels with it set as such. The messages are produced at debug level, so should appear via "dmesg". If you want to see them on the console, you need to add "debug" to the kernel command line.

However, the in-band-status thing needs to be root-caused first.

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!
#7 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

Quoted 4 lines · Charles Perry

Conor,

Can you send us a snippet of you device tree showing the gem node and the phy?

It's in-tree, mpfs.dtsi and mpfs-icicle-kit-common.dtsi.

#8 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

In reply to Russell King (Oracle)
Quoted 71 lines · Russell King (Oracle)
Quoted 56 lines · Conor Dooley
Quoted 48 lines · Charles Perry
Quoted 29 lines · Conor Dooley
Quoted 9 lines · Charles Perry

Make it possible to connect a PHY which does not use inband autoneg to a gem MAC using phylink's information.

The previous implementation relied on whether or not the link was a fixed-link to disable SGMII autoneg. This commit extend this to all link which are not configured for inband autonegotiation.

This breaks the macb on mpfs-icicle-kit, I get stuck with:

[    7.189102] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    7.260946] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[    7.273881] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[    7.296580] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[    7.345782] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[    7.358082] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[    7.380479] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.
[   11.376763] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   11.398403] Sending DHCP requests .
[   11.472699] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   13.938425] ..... timed out!
[   93.598491] macb 20110000.ethernet eth0: Link is Down
[   93.641823] macb 20110000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.659433] macb 20112000.ethernet eth1: Link is Down
[   93.691724] macb 20112000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.703977] IP-Config: Retrying forever (NFS root)...
Quoted 9 lines
[   93.758382] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[   93.770655] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[   93.786497] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   93.795840] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[   93.844481] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[   93.856769] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[   93.870926] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   93.880302] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.

Hello Conor,

I checked the driver for the VSC8662 and it doesn't have the ->inband_caps() and ->config_inband() callbacks so Linux leaves whatever the bootloader puts or uses the defaults. Looking at the datasheet, this should be register 23 (Extended PHY Control Set 1) bit 13 (MAC interface auto-negotiation)

Quoted 5 lines

My guess is that this bit is set and since this patch disable inband autonegotiation (because phylink decides it), there is a mismatch.

Can you add 'managed = "in-band-status"' in your device tree under the macb node? That's not necessarily the fix, I just want to confirm my theory.

No, it just produces a different error:

Quoted 9 lines
[    5.769864] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    5.829146] macb 20110000.ethernet eth0: Could not attach PHY (-19)
[    5.854232] IP-Config: Failed to open eth0
[    5.897152] macb 20112000.ethernet eth1: Could not attach PHY (-19)
[    5.921061] IP-Config: Failed to open eth1
[    5.925592] IP-Config: No network devices available
[    5.938800] clk: Disabling unused clocks
[    5.944156] PM: genpd: Disabling unused power domains
[    5.961029] check access for rdinit=/usr/sbin/init failed: -2, ignoring

-19 is -ENODEV (I wish everyone would use %pe so we get english error messages rather than having to look up errno codes in the header files.)

Quoted 7 lines

macb uses either phylink_of_phy_connect() or phylink_connect_phy(). I don't think phylink_connect_phy() would return -ENODEV, but phylink_of_phy_connect() would - but I can't see that adding 'managed = "in-band-status";' to DT would cause that. The only case I can see is that fwnode_phy_find_device() fails to find the phydev, but there is a PHY node specified in DT, but that would fail without in-band-status.

It's as you say, and fwnode_phy_find_device() is the source. fwnode_mdio_find_device() is what fails, returning NULL.

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

Also '#define DEBUG' in 'drivers/net/phy/phylink.c' can help if you can recompile your kernel.

Setting this provided no further logs, seemingly.

It certainly would if you place it before the first #include - I routinely build kernels with it set as such. The messages are produced at debug level, so should appear via "dmesg". If you want to see them on the console, you need to add "debug" to the kernel command line.

Clearly I'm too stupid for this, because I did it again and still got no more logs. I even disabled DYNAMIC_DEBUG since that has an interaction in the file.

#9 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

Quoted 80 lines · Conor Dooley
Quoted 71 lines · Russell King (Oracle)
Quoted 56 lines · Conor Dooley
Quoted 48 lines · Charles Perry
Quoted 29 lines · Conor Dooley
Quoted 9 lines · Charles Perry

Make it possible to connect a PHY which does not use inband autoneg to a gem MAC using phylink's information.

The previous implementation relied on whether or not the link was a fixed-link to disable SGMII autoneg. This commit extend this to all link which are not configured for inband autonegotiation.

This breaks the macb on mpfs-icicle-kit, I get stuck with:

[    7.189102] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    7.260946] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[    7.273881] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[    7.296580] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[    7.345782] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[    7.358082] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[    7.380479] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.
[   11.376763] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   11.398403] Sending DHCP requests .
[   11.472699] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   13.938425] ..... timed out!
[   93.598491] macb 20110000.ethernet eth0: Link is Down
[   93.641823] macb 20110000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.659433] macb 20112000.ethernet eth1: Link is Down
[   93.691724] macb 20112000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.703977] IP-Config: Retrying forever (NFS root)...
Quoted 9 lines
[   93.758382] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[   93.770655] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[   93.786497] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   93.795840] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[   93.844481] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[   93.856769] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[   93.870926] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   93.880302] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.

Hello Conor,

I checked the driver for the VSC8662 and it doesn't have the ->inband_caps() and ->config_inband() callbacks so Linux leaves whatever the bootloader puts or uses the defaults. Looking at the datasheet, this should be register 23 (Extended PHY Control Set 1) bit 13 (MAC interface auto-negotiation)

Quoted 5 lines

My guess is that this bit is set and since this patch disable inband autonegotiation (because phylink decides it), there is a mismatch.

Can you add 'managed = "in-band-status"' in your device tree under the macb node? That's not necessarily the fix, I just want to confirm my theory.

No, it just produces a different error:

Quoted 9 lines
[    5.769864] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    5.829146] macb 20110000.ethernet eth0: Could not attach PHY (-19)
[    5.854232] IP-Config: Failed to open eth0
[    5.897152] macb 20112000.ethernet eth1: Could not attach PHY (-19)
[    5.921061] IP-Config: Failed to open eth1
[    5.925592] IP-Config: No network devices available
[    5.938800] clk: Disabling unused clocks
[    5.944156] PM: genpd: Disabling unused power domains
[    5.961029] check access for rdinit=/usr/sbin/init failed: -2, ignoring

-19 is -ENODEV (I wish everyone would use %pe so we get english error messages rather than having to look up errno codes in the header files.)

Quoted 7 lines

macb uses either phylink_of_phy_connect() or phylink_connect_phy(). I don't think phylink_connect_phy() would return -ENODEV, but phylink_of_phy_connect() would - but I can't see that adding 'managed = "in-band-status";' to DT would cause that. The only case I can see is that fwnode_phy_find_device() fails to find the phydev, but there is a PHY node specified in DT, but that would fail without in-band-status.

Quoted 2 lines

It's as you say, and fwnode_phy_find_device() is the source. fwnode_mdio_find_device() is what fails, returning NULL.

Probably the last thing for today, since it's already getting late, bus_find_device_by_fwnode() is failing in that function.

Quoted 14 lines
Quoted 10 lines
Quoted 5 lines
Quoted 3 lines

Also '#define DEBUG' in 'drivers/net/phy/phylink.c' can help if you can recompile your kernel.

Setting this provided no further logs, seemingly.

It certainly would if you place it before the first #include - I routinely build kernels with it set as such. The messages are produced at debug level, so should appear via "dmesg". If you want to see them on the console, you need to add "debug" to the kernel command line.

Clearly I'm too stupid for this, because I did it again and still got no more logs. I even disabled DYNAMIC_DEBUG since that has an interaction in the file.

#10 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

In reply to Conor Dooley
Quoted 80 lines · Conor Dooley
Quoted 71 lines · Russell King (Oracle)
Quoted 56 lines · Conor Dooley
Quoted 48 lines · Charles Perry
Quoted 29 lines · Conor Dooley
Quoted 9 lines · Charles Perry

Make it possible to connect a PHY which does not use inband autoneg to a gem MAC using phylink's information.

The previous implementation relied on whether or not the link was a fixed-link to disable SGMII autoneg. This commit extend this to all link which are not configured for inband autonegotiation.

This breaks the macb on mpfs-icicle-kit, I get stuck with:

[    7.189102] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    7.260946] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[    7.273881] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[    7.296580] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[    7.345782] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[    7.358082] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[    7.380479] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.
[   11.376763] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   11.398403] Sending DHCP requests .
[   11.472699] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   13.938425] ..... timed out!
[   93.598491] macb 20110000.ethernet eth0: Link is Down
[   93.641823] macb 20110000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.659433] macb 20112000.ethernet eth1: Link is Down
[   93.691724] macb 20112000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.703977] IP-Config: Retrying forever (NFS root)...
Quoted 9 lines
[   93.758382] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[   93.770655] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[   93.786497] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   93.795840] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[   93.844481] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[   93.856769] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[   93.870926] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   93.880302] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.

Hello Conor,

I checked the driver for the VSC8662 and it doesn't have the ->inband_caps() and ->config_inband() callbacks so Linux leaves whatever the bootloader puts or uses the defaults. Looking at the datasheet, this should be register 23 (Extended PHY Control Set 1) bit 13 (MAC interface auto-negotiation)

Quoted 5 lines

My guess is that this bit is set and since this patch disable inband autonegotiation (because phylink decides it), there is a mismatch.

Can you add 'managed = "in-band-status"' in your device tree under the macb node? That's not necessarily the fix, I just want to confirm my theory.

No, it just produces a different error:

Quoted 9 lines
[    5.769864] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    5.829146] macb 20110000.ethernet eth0: Could not attach PHY (-19)
[    5.854232] IP-Config: Failed to open eth0
[    5.897152] macb 20112000.ethernet eth1: Could not attach PHY (-19)
[    5.921061] IP-Config: Failed to open eth1
[    5.925592] IP-Config: No network devices available
[    5.938800] clk: Disabling unused clocks
[    5.944156] PM: genpd: Disabling unused power domains
[    5.961029] check access for rdinit=/usr/sbin/init failed: -2, ignoring

-19 is -ENODEV (I wish everyone would use %pe so we get english error messages rather than having to look up errno codes in the header files.)

Quoted 7 lines

macb uses either phylink_of_phy_connect() or phylink_connect_phy(). I don't think phylink_connect_phy() would return -ENODEV, but phylink_of_phy_connect() would - but I can't see that adding 'managed = "in-band-status";' to DT would cause that. The only case I can see is that fwnode_phy_find_device() fails to find the phydev, but there is a PHY node specified in DT, but that would fail without in-band-status.

Quoted 2 lines

It's as you say, and fwnode_phy_find_device() is the source. fwnode_mdio_find_device() is what fails, returning NULL.

Ah, I've just found the reason:

        /* With fixed-link, we don't need to register the MDIO bus,
         * except if we have a child named "mdio" in the device tree.
         * In that case, some devices may be attached to the MACB's MDIO bus.
         */
        mdio_np = of_get_child_by_name(np, "mdio");
        if (!mdio_np && of_phy_is_fixed_link(np))
                return macb_mii_probe(bp->dev);

of_phy_is_fixed_link() will return true as soon as you add that managed property, and as the mac1 node just lists the PHYs without using a mdio child:

&mac1 {
        phy-mode = "sgmii";
        phy-handle = <&phy1>;
        status = "okay";

        phy1: ethernet-phy@9 {
                reg = <9>;
        };

        phy0: ethernet-phy@8 {
                reg = <8>;
        };
};

it means mdio_np is NULL above. Hence, no MDIO bus will be created.

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

Also '#define DEBUG' in 'drivers/net/phy/phylink.c' can help if you can recompile your kernel.

Setting this provided no further logs, seemingly.

Quoted 8 lines
Quoted 4 lines

It certainly would if you place it before the first #include - I routinely build kernels with it set as such. The messages are produced at debug level, so should appear via "dmesg". If you want to see them on the console, you need to add "debug" to the kernel command line.

Clearly I'm too stupid for this, because I did it again and still got no more logs. I even disabled DYNAMIC_DEBUG since that has an interaction in the file.

I'm sorry, I don't know what's going on there. As I say, it works for me. E.g. from two days ago:

[  101.279224] mvneta f1034000.ethernet eno2: configuring for inband/2500base-x link mode
[  101.287194] mvneta f1034000.ethernet eno2: major config, requested inband/2500base-x
[  101.294986] mvneta f1034000.ethernet eno2: interface 2500base-x inband modes: pcs=02 phy=00
[  101.303423] mvneta f1034000.ethernet eno2: major config, active inband/inband,an-enabled/2500base-x
[  101.312541] mvneta f1034000.ethernet eno2: phylink_mac_config: mode=inband/2500base-x/none adv=00000000,00000000,00008000,0000a240 pause=04
[  101.325123] mvneta f1034000.ethernet eno2: pcs link down
...
[  101.447124] mvneta f1034000.ethernet eno2: phylink_sfp_connect_phy()
[  101.453541] mvneta f1034000.ethernet eno2: copper SFP: interfaces=[mac=4,9-12,19,22-23, sfp=4,23,27]
[  101.462789] mvneta f1034000.ethernet eno2: copper SFP: chosen 2500base-x interface
[  101.470563] mvneta f1034000.ethernet eno2: PHY i2c:sfp:16 uses interfaces 4,23,27, validating 4,23
[  101.479636] mvneta f1034000.ethernet eno2:  interface 4 (sgmii) rate match none supports 2-3,5-6,13
[  101.488730] mvneta f1034000.ethernet eno2:  interface 23 (2500base-x) rate match none supports 6,13,47
[  101.498079] mvneta f1034000.ethernet eno2: PHY [i2c:sfp:16] driver [Broadcom BCM84881] (irq=POLL)
[  101.507043] mvneta f1034000.ethernet eno2: phy: 2500base-x setting supported 00000000,00000000,00008000,0000206c advertising 00000000,00000000,00008000,0000206c
[  101.522979] mvneta f1034000.ethernet eno2: major config, requested inband/2500base-x
[  101.530778] mvneta f1034000.ethernet eno2: interface 2500base-x inband modes: pcs=02 phy=01
[  101.539213] mvneta f1034000.ethernet eno2: 2500base-x: incompatible in-band capabilities, trying in-band
[  101.548732] mvneta f1034000.ethernet eno2: major config, active inband/inband,an-enabled/2500base-x
[  101.557842] mvneta f1034000.ethernet eno2: phylink_mac_config: mode=inband/2500base-x/none adv=00000000,00000000,00008000,0000206c pause=04
[  101.570425] mvneta f1034000.ethernet eno2: phylink_sfp_module_start()
[  101.576903] mvneta f1034000.ethernet eno2: phylink_sfp_link_up()
[  101.692254] mvneta f1034000.ethernet eno2: phy link down 2500base-x/Unknown/Unknown/none/off/nolpi

with the following at the top of phylink.c:

// SPDX-License-Identifier: GPL-2.0
/*
* phylink models the MAC to optional PHY connection, supporting
* technologies such as SFP cages where the PHY is hot-pluggable. *
* Copyright (C) 2015 Russell King
*/
#define DEBUG
#include <linux/acpi.h>
...

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!
#11 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

Quoted 10 lines · Russell King (Oracle)
Quoted 10 lines
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

Also '#define DEBUG' in 'drivers/net/phy/phylink.c' can help if you can recompile your kernel.

Setting this provided no further logs, seemingly.

It certainly would if you place it before the first #include - I routinely build kernels with it set as such. The messages are produced at debug level, so should appear via "dmesg". If you want to see them on the console, you need to add "debug" to the kernel command line.

Quoted 6 lines
Quoted 3 lines

Clearly I'm too stupid for this, because I did it again and still got no more logs. I even disabled DYNAMIC_DEBUG since that has an interaction in the file.

I'm sorry, I don't know what's going on there. As I say, it works for me. E.g. from two days ago:

Thinking about it now, it's just because the codepaths that I took in the phy subsystem in the error case just didn't produce any logs. Adding it does produce more logs in a working system.

Quoted 41 lines
[  101.279224] mvneta f1034000.ethernet eno2: configuring for inband/2500base-x link mode
[  101.287194] mvneta f1034000.ethernet eno2: major config, requested inband/2500base-x
[  101.294986] mvneta f1034000.ethernet eno2: interface 2500base-x inband modes: pcs=02 phy=00
[  101.303423] mvneta f1034000.ethernet eno2: major config, active inband/inband,an-enabled/2500base-x
[  101.312541] mvneta f1034000.ethernet eno2: phylink_mac_config: mode=inband/2500base-x/none adv=00000000,00000000,00008000,0000a240 pause=04
[  101.325123] mvneta f1034000.ethernet eno2: pcs link down
...
[  101.447124] mvneta f1034000.ethernet eno2: phylink_sfp_connect_phy()
[  101.453541] mvneta f1034000.ethernet eno2: copper SFP: interfaces=[mac=4,9-12,19,22-23, sfp=4,23,27]
[  101.462789] mvneta f1034000.ethernet eno2: copper SFP: chosen 2500base-x interface
[  101.470563] mvneta f1034000.ethernet eno2: PHY i2c:sfp:16 uses interfaces 4,23,27, validating 4,23
[  101.479636] mvneta f1034000.ethernet eno2:  interface 4 (sgmii) rate match none supports 2-3,5-6,13
[  101.488730] mvneta f1034000.ethernet eno2:  interface 23 (2500base-x) rate match none supports 6,13,47
[  101.498079] mvneta f1034000.ethernet eno2: PHY [i2c:sfp:16] driver [Broadcom BCM84881] (irq=POLL)
[  101.507043] mvneta f1034000.ethernet eno2: phy: 2500base-x setting supported 00000000,00000000,00008000,0000206c advertising 00000000,00000000,00008000,0000206c
[  101.522979] mvneta f1034000.ethernet eno2: major config, requested inband/2500base-x
[  101.530778] mvneta f1034000.ethernet eno2: interface 2500base-x inband modes: pcs=02 phy=01
[  101.539213] mvneta f1034000.ethernet eno2: 2500base-x: incompatible in-band capabilities, trying in-band
[  101.548732] mvneta f1034000.ethernet eno2: major config, active inband/inband,an-enabled/2500base-x
[  101.557842] mvneta f1034000.ethernet eno2: phylink_mac_config: mode=inband/2500base-x/none adv=00000000,00000000,00008000,0000206c pause=04
[  101.570425] mvneta f1034000.ethernet eno2: phylink_sfp_module_start()
[  101.576903] mvneta f1034000.ethernet eno2: phylink_sfp_link_up()
[  101.692254] mvneta f1034000.ethernet eno2: phy link down 2500base-x/Unknown/Unknown/none/off/nolpi

with the following at the top of phylink.c:

// SPDX-License-Identifier: GPL-2.0
/*
* phylink models the MAC to optional PHY connection, supporting
* technologies such as SFP cages where the PHY is hot-pluggable. *
* Copyright (C) 2015 Russell King
*/
#define DEBUG
#include <linux/acpi.h>
...

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!
#12 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

In reply to Russell King (Oracle)
Quoted 112 lines · Russell King (Oracle)
Quoted 80 lines · Conor Dooley
Quoted 71 lines · Russell King (Oracle)
Quoted 56 lines · Conor Dooley
Quoted 48 lines · Charles Perry
Quoted 29 lines · Conor Dooley
Quoted 9 lines · Charles Perry

Make it possible to connect a PHY which does not use inband autoneg to a gem MAC using phylink's information.

The previous implementation relied on whether or not the link was a fixed-link to disable SGMII autoneg. This commit extend this to all link which are not configured for inband autonegotiation.

This breaks the macb on mpfs-icicle-kit, I get stuck with:

[    7.189102] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    7.260946] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[    7.273881] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[    7.296580] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[    7.345782] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[    7.358082] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[    7.380479] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.
[   11.376763] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   11.398403] Sending DHCP requests .
[   11.472699] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   13.938425] ..... timed out!
[   93.598491] macb 20110000.ethernet eth0: Link is Down
[   93.641823] macb 20110000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.659433] macb 20112000.ethernet eth1: Link is Down
[   93.691724] macb 20112000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.703977] IP-Config: Retrying forever (NFS root)...
Quoted 9 lines
[   93.758382] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[   93.770655] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[   93.786497] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   93.795840] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[   93.844481] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[   93.856769] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[   93.870926] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   93.880302] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.

Hello Conor,

I checked the driver for the VSC8662 and it doesn't have the ->inband_caps() and ->config_inband() callbacks so Linux leaves whatever the bootloader puts or uses the defaults. Looking at the datasheet, this should be register 23 (Extended PHY Control Set 1) bit 13 (MAC interface auto-negotiation)

Quoted 5 lines

My guess is that this bit is set and since this patch disable inband autonegotiation (because phylink decides it), there is a mismatch.

Can you add 'managed = "in-band-status"' in your device tree under the macb node? That's not necessarily the fix, I just want to confirm my theory.

No, it just produces a different error:

Quoted 9 lines
[    5.769864] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    5.829146] macb 20110000.ethernet eth0: Could not attach PHY (-19)
[    5.854232] IP-Config: Failed to open eth0
[    5.897152] macb 20112000.ethernet eth1: Could not attach PHY (-19)
[    5.921061] IP-Config: Failed to open eth1
[    5.925592] IP-Config: No network devices available
[    5.938800] clk: Disabling unused clocks
[    5.944156] PM: genpd: Disabling unused power domains
[    5.961029] check access for rdinit=/usr/sbin/init failed: -2, ignoring

-19 is -ENODEV (I wish everyone would use %pe so we get english error messages rather than having to look up errno codes in the header files.)

Quoted 7 lines

macb uses either phylink_of_phy_connect() or phylink_connect_phy(). I don't think phylink_connect_phy() would return -ENODEV, but phylink_of_phy_connect() would - but I can't see that adding 'managed = "in-band-status";' to DT would cause that. The only case I can see is that fwnode_phy_find_device() fails to find the phydev, but there is a PHY node specified in DT, but that would fail without in-band-status.

Quoted 2 lines

It's as you say, and fwnode_phy_find_device() is the source. fwnode_mdio_find_device() is what fails, returning NULL.

Ah, I've just found the reason:

        /* With fixed-link, we don't need to register the MDIO bus,
         * except if we have a child named "mdio" in the device tree.
         * In that case, some devices may be attached to the MACB's MDIO bus.
         */
        mdio_np = of_get_child_by_name(np, "mdio");
        if (!mdio_np && of_phy_is_fixed_link(np))
                return macb_mii_probe(bp->dev);

of_phy_is_fixed_link() will return true as soon as you add that managed property, and as the mac1 node just lists the PHYs without using a mdio child:

&mac1 {
        phy-mode = "sgmii";
        phy-handle = <&phy1>;
        status = "okay";

        phy1: ethernet-phy@9 {
                reg = <9>;
        };

        phy0: ethernet-phy@8 {
                reg = <8>;
        };
};
Quoted 1 line

it means mdio_np is NULL above. Hence, no MDIO bus will be created.

Thank you Russell for finding this.

Conor, can you try with this:

````
&mac0 {
	phy-mode = "sgmii";
	phy-handle = <&phy0>;
	status = "okay";
	managed = "in-band-status";
};

&mac1 {
	phy-mode = "sgmii";
	phy-handle = <&phy1>;
	status = "okay";
	managed = "in-band-status";

	mdio {
		phy1: ethernet-phy@9 {
			reg = <9>;
		};
	
		phy0: ethernet-phy@8 {
			reg = <8>;
		};
	};
};
````

I think we're almost there.

Thanks,
Charles

#13 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

Quoted 145 lines · Charles Perry
Quoted 112 lines · Russell King (Oracle)
Quoted 80 lines · Conor Dooley
Quoted 71 lines · Russell King (Oracle)
Quoted 56 lines · Conor Dooley
Quoted 48 lines · Charles Perry
Quoted 29 lines · Conor Dooley
Quoted 9 lines · Charles Perry

Make it possible to connect a PHY which does not use inband autoneg to a gem MAC using phylink's information.

The previous implementation relied on whether or not the link was a fixed-link to disable SGMII autoneg. This commit extend this to all link which are not configured for inband autonegotiation.

This breaks the macb on mpfs-icicle-kit, I get stuck with:

[    7.189102] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    7.260946] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[    7.273881] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[    7.296580] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[    7.345782] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[    7.358082] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[    7.380479] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.
[   11.376763] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   11.398403] Sending DHCP requests .
[   11.472699] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   13.938425] ..... timed out!
[   93.598491] macb 20110000.ethernet eth0: Link is Down
[   93.641823] macb 20110000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.659433] macb 20112000.ethernet eth1: Link is Down
[   93.691724] macb 20112000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.703977] IP-Config: Retrying forever (NFS root)...
Quoted 9 lines
[   93.758382] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[   93.770655] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[   93.786497] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   93.795840] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[   93.844481] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[   93.856769] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[   93.870926] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   93.880302] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.

Hello Conor,

I checked the driver for the VSC8662 and it doesn't have the ->inband_caps() and ->config_inband() callbacks so Linux leaves whatever the bootloader puts or uses the defaults. Looking at the datasheet, this should be register 23 (Extended PHY Control Set 1) bit 13 (MAC interface auto-negotiation)

Quoted 5 lines

My guess is that this bit is set and since this patch disable inband autonegotiation (because phylink decides it), there is a mismatch.

Can you add 'managed = "in-band-status"' in your device tree under the macb node? That's not necessarily the fix, I just want to confirm my theory.

No, it just produces a different error:

Quoted 9 lines
[    5.769864] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    5.829146] macb 20110000.ethernet eth0: Could not attach PHY (-19)
[    5.854232] IP-Config: Failed to open eth0
[    5.897152] macb 20112000.ethernet eth1: Could not attach PHY (-19)
[    5.921061] IP-Config: Failed to open eth1
[    5.925592] IP-Config: No network devices available
[    5.938800] clk: Disabling unused clocks
[    5.944156] PM: genpd: Disabling unused power domains
[    5.961029] check access for rdinit=/usr/sbin/init failed: -2, ignoring

-19 is -ENODEV (I wish everyone would use %pe so we get english error messages rather than having to look up errno codes in the header files.)

Quoted 7 lines

macb uses either phylink_of_phy_connect() or phylink_connect_phy(). I don't think phylink_connect_phy() would return -ENODEV, but phylink_of_phy_connect() would - but I can't see that adding 'managed = "in-band-status";' to DT would cause that. The only case I can see is that fwnode_phy_find_device() fails to find the phydev, but there is a PHY node specified in DT, but that would fail without in-band-status.

Quoted 2 lines

It's as you say, and fwnode_phy_find_device() is the source. fwnode_mdio_find_device() is what fails, returning NULL.

Ah, I've just found the reason:

        /* With fixed-link, we don't need to register the MDIO bus,
         * except if we have a child named "mdio" in the device tree.
         * In that case, some devices may be attached to the MACB's MDIO bus.
         */
        mdio_np = of_get_child_by_name(np, "mdio");
        if (!mdio_np && of_phy_is_fixed_link(np))
                return macb_mii_probe(bp->dev);

of_phy_is_fixed_link() will return true as soon as you add that managed property, and as the mac1 node just lists the PHYs without using a mdio child:

&mac1 {
        phy-mode = "sgmii";
        phy-handle = <&phy1>;
        status = "okay";

        phy1: ethernet-phy@9 {
                reg = <9>;
        };

        phy0: ethernet-phy@8 {
                reg = <8>;
        };
};
Quoted 1 line

it means mdio_np is NULL above. Hence, no MDIO bus will be created.

Thank you Russell for finding this.

Conor, can you try with this:

````
&mac0 {
	phy-mode = "sgmii";
	phy-handle = <&phy0>;
	status = "okay";
	managed = "in-band-status";
};

&mac1 {
	phy-mode = "sgmii";
	phy-handle = <&phy1>;
	status = "okay";
	managed = "in-band-status";

	mdio {
		phy1: ethernet-phy@9 {
			reg = <9>;
		};
	
		phy0: ethernet-phy@8 {
			reg = <8>;
		};
	};
};
````
Quoted 1 line

I think we're almost there.

With this, I can boot. Is that enough information for you to resolve the problem?

#14 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

Quoted 146 lines · Conor Dooley
Quoted 145 lines · Charles Perry
Quoted 112 lines · Russell King (Oracle)
Quoted 80 lines · Conor Dooley
Quoted 71 lines · Russell King (Oracle)
Quoted 56 lines · Conor Dooley
Quoted 48 lines · Charles Perry
Quoted 29 lines · Conor Dooley
Quoted 9 lines · Charles Perry

Make it possible to connect a PHY which does not use inband autoneg to a gem MAC using phylink's information.

The previous implementation relied on whether or not the link was a fixed-link to disable SGMII autoneg. This commit extend this to all link which are not configured for inband autonegotiation.

This breaks the macb on mpfs-icicle-kit, I get stuck with:

[    7.189102] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    7.260946] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[    7.273881] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[    7.296580] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[    7.345782] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[    7.358082] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[    7.380479] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.
[   11.376763] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   11.398403] Sending DHCP requests .
[   11.472699] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   13.938425] ..... timed out!
[   93.598491] macb 20110000.ethernet eth0: Link is Down
[   93.641823] macb 20110000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.659433] macb 20112000.ethernet eth1: Link is Down
[   93.691724] macb 20112000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.703977] IP-Config: Retrying forever (NFS root)...
Quoted 9 lines
[   93.758382] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[   93.770655] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[   93.786497] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   93.795840] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[   93.844481] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[   93.856769] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[   93.870926] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   93.880302] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.

Hello Conor,

I checked the driver for the VSC8662 and it doesn't have the ->inband_caps() and ->config_inband() callbacks so Linux leaves whatever the bootloader puts or uses the defaults. Looking at the datasheet, this should be register 23 (Extended PHY Control Set 1) bit 13 (MAC interface auto-negotiation)

Quoted 5 lines

My guess is that this bit is set and since this patch disable inband autonegotiation (because phylink decides it), there is a mismatch.

Can you add 'managed = "in-band-status"' in your device tree under the macb node? That's not necessarily the fix, I just want to confirm my theory.

No, it just produces a different error:

Quoted 9 lines
[    5.769864] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    5.829146] macb 20110000.ethernet eth0: Could not attach PHY (-19)
[    5.854232] IP-Config: Failed to open eth0
[    5.897152] macb 20112000.ethernet eth1: Could not attach PHY (-19)
[    5.921061] IP-Config: Failed to open eth1
[    5.925592] IP-Config: No network devices available
[    5.938800] clk: Disabling unused clocks
[    5.944156] PM: genpd: Disabling unused power domains
[    5.961029] check access for rdinit=/usr/sbin/init failed: -2, ignoring

-19 is -ENODEV (I wish everyone would use %pe so we get english error messages rather than having to look up errno codes in the header files.)

Quoted 7 lines

macb uses either phylink_of_phy_connect() or phylink_connect_phy(). I don't think phylink_connect_phy() would return -ENODEV, but phylink_of_phy_connect() would - but I can't see that adding 'managed = "in-band-status";' to DT would cause that. The only case I can see is that fwnode_phy_find_device() fails to find the phydev, but there is a PHY node specified in DT, but that would fail without in-band-status.

Quoted 2 lines

It's as you say, and fwnode_phy_find_device() is the source. fwnode_mdio_find_device() is what fails, returning NULL.

Ah, I've just found the reason:

        /* With fixed-link, we don't need to register the MDIO bus,
         * except if we have a child named "mdio" in the device tree.
         * In that case, some devices may be attached to the MACB's MDIO bus.
         */
        mdio_np = of_get_child_by_name(np, "mdio");
        if (!mdio_np && of_phy_is_fixed_link(np))
                return macb_mii_probe(bp->dev);

of_phy_is_fixed_link() will return true as soon as you add that managed property, and as the mac1 node just lists the PHYs without using a mdio child:

&mac1 {
        phy-mode = "sgmii";
        phy-handle = <&phy1>;
        status = "okay";

        phy1: ethernet-phy@9 {
                reg = <9>;
        };

        phy0: ethernet-phy@8 {
                reg = <8>;
        };
};
Quoted 1 line

it means mdio_np is NULL above. Hence, no MDIO bus will be created.

Thank you Russell for finding this.

Conor, can you try with this:

````
&mac0 {
	phy-mode = "sgmii";
	phy-handle = <&phy0>;
	status = "okay";
	managed = "in-band-status";
};

&mac1 {
	phy-mode = "sgmii";
	phy-handle = <&phy1>;
	status = "okay";
	managed = "in-band-status";

	mdio {
		phy1: ethernet-phy@9 {
			reg = <9>;
		};
	
		phy0: ethernet-phy@8 {
			reg = <8>;
		};
	};
};
````
Quoted 4 lines
Quoted 1 line

I think we're almost there.

With this, I can boot. Is that enough information for you to resolve the problem?

Yes, thanks alot Conor!

The problem is that all the SGMII setups using GEM probably currently work with autonegotiation enabled while phylink doesn't know about it. This is because the PCSAUTONEG bit (12) in the PCSCNTRL register (0x200) is set by default and starting from e276e5e40e92 ("net: macb: Disable PCS auto-negotiation for SGMII fixed-link mode"), the bit is forced to 1 (for non fixed-link setups). So people have just worked a phy config with bootstrap resistors or bootloader code to enable it on the PHY. Now that this patch made the PCSAUTONEG bit follow what phylink knows, we end up misconfiguring the link because most PHYs probably don't have the ->inband_caps() and ->config_inband() callbacks.

I'm wondering if the "bool default_an_inband" from "struct phylink_config" could help us here. The comment reads: "if true, defaults to MLO_AN_INBAND rather than MLO_AN_PHY. A fixed-link specification will override." Could we use this in GEM to signify "all the legacy setups uses inband aneg so please used this". Russell, can you comment on this?

Patching PHY drivers to add ->inband_caps() and ->config_inband() is another solution but there are most likely other PHYs than the VSC8662 that would need this.

Adding 'managed = "in-band-status"' is another solution but it involves some changes on all the device tree using GEM and SGMII.

Thanks,
Charles

#15 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

In reply to Conor Dooley
Quoted 66 lines · Conor Dooley
Quoted 48 lines · Charles Perry
Quoted 29 lines · Conor Dooley
Quoted 9 lines · Charles Perry

Make it possible to connect a PHY which does not use inband autoneg to a gem MAC using phylink's information.

The previous implementation relied on whether or not the link was a fixed-link to disable SGMII autoneg. This commit extend this to all link which are not configured for inband autonegotiation.

This breaks the macb on mpfs-icicle-kit, I get stuck with:

[    7.189102] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    7.260946] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[    7.273881] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[    7.296580] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[    7.345782] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[    7.358082] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[    7.380479] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.
[   11.376763] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   11.398403] Sending DHCP requests .
[   11.472699] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   13.938425] ..... timed out!
[   93.598491] macb 20110000.ethernet eth0: Link is Down
[   93.641823] macb 20110000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.659433] macb 20112000.ethernet eth1: Link is Down
[   93.691724] macb 20112000.ethernet: gem-ptp-timer ptp clock unregistered.
[   93.703977] IP-Config: Retrying forever (NFS root)...
Quoted 9 lines
[   93.758382] macb 20110000.ethernet eth0: PHY [20112000.ethernet-ffffffff:08] driver [Vitesse VSC8662] (irq=POLL)
[   93.770655] macb 20110000.ethernet eth0: configuring for phy/sgmii link mode
[   93.786497] macb 20110000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   93.795840] macb 20110000.ethernet: gem-ptp-timer ptp clock registered.
[   93.844481] macb 20112000.ethernet eth1: PHY [20112000.ethernet-ffffffff:09] driver [Vitesse VSC8662] (irq=POLL)
[   93.856769] macb 20112000.ethernet eth1: configuring for phy/sgmii link mode
[   93.870926] macb 20112000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
[   93.880302] macb 20112000.ethernet: gem-ptp-timer ptp clock registered.

Hello Conor,

I checked the driver for the VSC8662 and it doesn't have the ->inband_caps() and ->config_inband() callbacks so Linux leaves whatever the bootloader puts or uses the defaults. Looking at the datasheet, this should be register 23 (Extended PHY Control Set 1) bit 13 (MAC interface auto-negotiation)

Quoted 5 lines

My guess is that this bit is set and since this patch disable inband autonegotiation (because phylink decides it), there is a mismatch.

Can you add 'managed = "in-band-status"' in your device tree under the macb node? That's not necessarily the fix, I just want to confirm my theory.

No, it just produces a different error:

[    5.769864] mpfs-sys-controller syscontroller: Registered MPFS system controller
[    5.829146] macb 20110000.ethernet eth0: Could not attach PHY (-19)
[    5.854232] IP-Config: Failed to open eth0
[    5.897152] macb 20112000.ethernet eth1: Could not attach PHY (-19)
[    5.921061] IP-Config: Failed to open eth1
[    5.925592] IP-Config: No network devices available
[    5.938800] clk: Disabling unused clocks
[    5.944156] PM: genpd: Disabling unused power domains
[    5.961029] check access for rdinit=/usr/sbin/init failed: -2, ignoring
Quoted 9 lines
Quoted 2 lines

Also '#define DEBUG' in 'drivers/net/phy/phylink.c' can help if you can recompile your kernel.

Setting this provided no further logs, seemingly.

Adding some basic prints shows that the driver changed the state of the PCSCNTRL register from 0x1040 to 0x40, so it disabled auto neg. The driver previously left it as it was, 0x1040 before and 0x1040 after.

Thank you for this info.

Are you able to check register 23, bit 13 of your PHY by any chance? Maybe with the mdio/mii commands in U-Boot if you have that.

Quoted 12 lines
Quoted 11 lines
Quoted 6 lines

and because I am NFS root, it breaks boot :)

btw, I don't see an explanation in hte commit message for why the macb_is_gem(bp) got dropped? Is this now done unconditionally when it was conditional before?

Well if you get to the ->macb_pcs_config() callback, you most certainly have an SGMII PCS block. Does your IP have the PCS registers? (0x200 to 0x23c) Also I thought that macb doesn't do SGMII (only GEM does) so it can't reach ->macb_pcs_config().

Quoted 6 lines

When I said "macb on" I meant to say "macb driver on", but omitted the word. Unfortunately, the idiot who added the original mpfs compatible, because the platform was using the "cdns,macb" compatible rather than a soc-specific one, did not check if the platform was actually a macb before doing so, and trusted the original dts author. This is actually a gem.

Ok, well I think its correct to remove the macb_is_gem() check in macb_pcs_config() because if we get to that function, SGMII was picked and macb doesn't have SGMII. Furthermore, __set_bit(PHY_INTERFACE_MODE_SGMII ...) is guarded by a macb_is_gem() so even if someone puts 'phy-mode = "sgmii"' in their macb device tree, we shouldn't get there.

Agreed that this should have been documented in the commit message.

Regards,
Charles

#16 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

Quoted 4 lines · Charles Perry

On Wed, Mar 04, 2026 at 04:23:30PM +0000, Conor Dooley wrote:

Are you able to check register 23, bit 13 of your PHY by any chance? Maybe with the mdio/mii commands in U-Boot if you have that.

"mii read addr 23" returns 0660 for both PHYs in U-Boot.

#17 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

Quoted 7 lines · Conor Dooley
Quoted 4 lines · Charles Perry

On Wed, Mar 04, 2026 at 04:23:30PM +0000, Conor Dooley wrote:

Are you able to check register 23, bit 13 of your PHY by any chance? Maybe with the mdio/mii commands in U-Boot if you have that.

"mii read addr 23" returns 0660 for both PHYs in U-Boot.

Oh, I think you fell into a trap of U-Boot's mii command.

The arguments are always in hex even if you dont prepend "0x".

What "mii read 8 23" did is most likely read register 0x23, masked with 0x1f because clause 22 has only 32 registers. So it read register 0x3 which is the device identifier 2 register: 0x0660.

The exact command should be "mii read 8 0x17", "mii read 9 0x17".

Sorry for that.

Thanks,
Charles

#18 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

Quoted 4 lines · Charles Perry
Quoted 3 lines · Conor Dooley
Quoted 2 lines · Charles Perry

On Wed, Mar 04, 2026 at 04:23:30PM +0000, Conor Dooley wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Are you able to check register 23, bit 13 of your PHY by any chance? Maybe with the mdio/mii commands in U-Boot if you have that.

"mii read addr 23" returns 0660 for both PHYs in U-Boot.

Oh, I think you fell into a trap of U-Boot's mii command.

The arguments are always in hex even if you dont prepend "0x".

Eh no, actually I thought that you meant register 0x23. I'm not used to register addresses being given in decimal.

Quoted 5 lines

What "mii read 8 23" did is most likely read register 0x23, masked with 0x1f because clause 22 has only 32 registers. So it read register 0x3 which is the device identifier 2 register: 0x0660.

The exact command should be "mii read 8 0x17", "mii read 9 0x17".

Both read back 2004

#19 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

Quoted 17 lines · Conor Dooley
Quoted 4 lines · Charles Perry
Quoted 3 lines · Conor Dooley
Quoted 2 lines · Charles Perry

On Wed, Mar 04, 2026 at 04:23:30PM +0000, Conor Dooley wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Are you able to check register 23, bit 13 of your PHY by any chance? Maybe with the mdio/mii commands in U-Boot if you have that.

"mii read addr 23" returns 0660 for both PHYs in U-Boot.

Oh, I think you fell into a trap of U-Boot's mii command.

The arguments are always in hex even if you dont prepend "0x".

Eh no, actually I thought that you meant register 0x23. I'm not used to register addresses being given in decimal.

Quoted 7 lines
Quoted 5 lines

What "mii read 8 23" did is most likely read register 0x23, masked with 0x1f because clause 22 has only 32 registers. So it read register 0x3 which is the device identifier 2 register: 0x0660.

The exact command should be "mii read 8 0x17", "mii read 9 0x17".

Both read back 2004

It would would be good to see the content of 0x1b, specifically bit 13. The PHY supports AN bypass, and I suspect bit 13 is zero, which means in combination with bit 13 set in 0x17, the PHY must complete the SGMII exchange with the MAC.

I suggest something like the following in vitesse.c for this PHY:

#define VSC8662_EXT_CON1 0x17
#define VSC8662_EXT_CON_MAC_AN BIT(13)

#define VSC8662_MAC_AN 0x1b
#define VSC8662_MAC_AN_BYPASS BIT(13)

static unsigned int vsc8662_inband_caps(struct phy_device *phydev,
phy_interface_t interface)

{
	if (interface == PHY_INTERFACE_MODE_SGMII)
		return LINK_INBAND_DISABLE | LINK_INBAND_ENABLE |
		       LINK_INBAND_BYPASS;

	return 0;
}

static int vsc8662_config_inband(struct phy_device *phydev, unsigned int modes)

{
	bool changed = false;
	u16 mask;
	int ret;

	mask = VSC8662_EXT_CON_MAC_AN;
	ret = phy_modify_changed(phydev, VSC8662_EXT_CON1, mask,
				 modes & (LINK_INBAND_ENABLE |
				 	  LINK_INBAND_BYPASS) ? mask : 0);
	if (ret > 0)
		changed = true;
	else if (ret < 0)
		return ret;

	mask = VSC8662_MAC_AN_BYPASS;
	ret = phy_modify(phydev, VSC8662_MAC_AN, mask,
			 modes & LINK_INBAND_BYPASS ? mask : 0);
	if (ret < 0)
		return ret;

	return genphy_soft_reset(phydev);
}

and the appropriate initialisers in the phy_driver struct.

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!
#20 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

Quoted 22 lines · Russell King (Oracle)
Quoted 21 lines · Conor Dooley
Quoted 4 lines · Charles Perry
Quoted 3 lines · Conor Dooley
Quoted 2 lines · Charles Perry

On Wed, Mar 04, 2026 at 04:23:30PM +0000, Conor Dooley wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Are you able to check register 23, bit 13 of your PHY by any chance? Maybe with the mdio/mii commands in U-Boot if you have that.

"mii read addr 23" returns 0660 for both PHYs in U-Boot.

Oh, I think you fell into a trap of U-Boot's mii command.

The arguments are always in hex even if you dont prepend "0x".

Eh no, actually I thought that you meant register 0x23. I'm not used to register addresses being given in decimal.

Quoted 4 lines

What "mii read 8 23" did is most likely read register 0x23, masked with 0x1f because clause 22 has only 32 registers. So it read register 0x3 which is the device identifier 2 register: 0x0660.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

The exact command should be "mii read 8 0x17", "mii read 9 0x17".

Both read back 2004

It would would be good to see the content of 0x1b, specifically bit 13. The PHY supports AN bypass, and I suspect bit 13 is zero, which means in combination with bit 13 set in 0x17, the PHY must complete the SGMII exchange with the MAC.

They're both 0401, so yea. I'll give the vitesse driver change a go later.

#21 lore raw

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

In reply to Russell King (Oracle)
Quoted 19 lines · Russell King (Oracle)

I suggest something like the following in vitesse.c for this PHY:

#define VSC8662_EXT_CON1 0x17
#define VSC8662_EXT_CON_MAC_AN BIT(13)

#define VSC8662_MAC_AN 0x1b
#define VSC8662_MAC_AN_BYPASS BIT(13)

static unsigned int vsc8662_inband_caps(struct phy_device *phydev,
phy_interface_t interface)

{
	if (interface == PHY_INTERFACE_MODE_SGMII)
		return LINK_INBAND_DISABLE | LINK_INBAND_ENABLE |
		       LINK_INBAND_BYPASS;

	return 0;
}

static int vsc8662_config_inband(struct phy_device *phydev, unsigned int modes)

Quoted 11 lines
{
	bool changed = false;
	u16 mask;
	int ret;

	mask = VSC8662_EXT_CON_MAC_AN;
	ret = phy_modify_changed(phydev, VSC8662_EXT_CON1, mask,
				 modes & (LINK_INBAND_ENABLE |
				 	  LINK_INBAND_BYPASS) ? mask : 0);
	if (ret > 0)
		changed = true;

FYI, clang warns that changed is set but not used.

Quoted 12 lines
	else if (ret < 0)
		return ret;

	mask = VSC8662_MAC_AN_BYPASS;
	ret = phy_modify(phydev, VSC8662_MAC_AN, mask,
			 modes & LINK_INBAND_BYPASS ? mask : 0);
	if (ret < 0)
		return ret;

	return genphy_soft_reset(phydev);
}
Quoted 1 line

and the appropriate initialisers in the phy_driver struct.

I tested this, on top of the failing next that I found the problem on, and it seems to make things work. Thanks for coming up with it.

Could you please make this a patch, I don't understand why this is the correct way to fix the problem, or the impact on users of the 8662 other than me, so I wouldn't be able to write a suitable commit message.

Cheers,
Conor.

#22 lore raw

PATCH v2 2/3 net: macb: add support for reporting SGMII inband link status

In reply to Charles Perry

This makes it possible to use in-band autonegotiation with SGMII.

If using a device tree, this can be done by adding the managed = "in-band-status" property to the gem node.

---

Notes:
Changes in v2:
* Move my notes to the cover letter

 drivers/net/ethernet/cadence/macb_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/cadence/macb_main.c +6 -1
index f4250e76cef0..f6efc1bb88b6 100644
@@ -560,7 +560,12 @@ static int macb_usx_pcs_config(struct phylink_pcs *pcs,
 static void macb_pcs_get_state(struct phylink_pcs *pcs, unsigned int neg_mode,
 			       struct phylink_link_state *state)
 {
-	state->link = 0;
+	struct macb *bp = container_of(pcs, struct macb, phylink_sgmii_pcs);
+	u16 bmsr, lpa;
+
+	bmsr = gem_readl(bp, PCSSTS);
+	lpa = gem_readl(bp, PCSANLPBASE);
+	phylink_mii_c22_pcs_decode_state(state, neg_mode, bmsr, lpa);
 }
 
 static void macb_pcs_an_restart(struct phylink_pcs *pcs)
Signature · 1 line
2.47.3
#23 lore raw

PATCH v2 3/3 net: macb: add the .pcs_inband_caps() callback for SGMII

In reply to Charles Perry

In SGMII mode, GEM can work with or without inband autonegotiation.

---

Notes:
Changes in v2:
* Added this patch

 drivers/net/ethernet/cadence/macb_main.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/ethernet/cadence/macb_main.c +7 -0
index f6efc1bb88b6..4b1fe3beaa17 100644
@@ -557,6 +557,12 @@ static int macb_usx_pcs_config(struct phylink_pcs *pcs,
 	return 0;
 }
 
+static unsigned int macb_pcs_inband_caps(struct phylink_pcs *pcs,
+					 phy_interface_t interface)
+{
+	return LINK_INBAND_DISABLE | LINK_INBAND_ENABLE;
+}
+
 static void macb_pcs_get_state(struct phylink_pcs *pcs, unsigned int neg_mode,
 			       struct phylink_link_state *state)
 {
@@ -609,6 +615,7 @@ static const struct phylink_pcs_ops macb_phylink_usx_pcs_ops = {
 };
 
 static const struct phylink_pcs_ops macb_phylink_pcs_ops = {
+	.pcs_inband_caps = macb_pcs_inband_caps,
 	.pcs_get_state = macb_pcs_get_state,
 	.pcs_an_restart = macb_pcs_an_restart,
 	.pcs_config = macb_pcs_config,
Signature · 1 line
2.47.3
#24 lore raw
In reply to Charles Perry
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Tue, 24 Feb 2026 12:28:51 -0800 you wrote:

Changes in v2:
* Add a cover-letter
* Remove the spinlock in macb_pcs_config() (patch 1)
* Add the macb_pcs_inband_caps() ops (patch 3)

I'm testing SGMII with a VSC8574 PHY [1] and microchip HPSC SoC [2].

[...]

Here is the summary with links:
- [net-next,v2,1/3] net: macb: fix SGMII with inband aneg disabled

    https://git.kernel.org/netdev/net-next/c/1338cfef1ff1
  - [net-next,v2,2/3] net: macb: add support for reporting SGMII inband link status
    https://git.kernel.org/netdev/net-next/c/7f44b2acc5a1
  - [net-next,v2,3/3] net: macb: add the .pcs_inband_caps() callback for SGMII
    https://git.kernel.org/netdev/net-next/c/d3549e2b4818

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html