* [PATCH net-next v2 0/3] Support PHYs that have inband autoneg disabled with GEM
@ 2026-02-24 20:28 Charles Perry
2026-02-24 20:28 ` [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled Charles Perry
` (3 more replies)
0 siblings, 4 replies; 25+ messages in thread
From: Charles Perry @ 2026-02-24 20:28 UTC (permalink / raw)
To: netdev
Cc: Charles Perry, Sean Anderson, Nicolas Ferre, Claudiu Beznea,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Russell King, linux-kernel
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/20250610233547.3588356-1-sean.anderson@linux.dev/
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(-)
--
2.47.3
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-02-24 20:28 [PATCH net-next v2 0/3] Support PHYs that have inband autoneg disabled with GEM Charles Perry
@ 2026-02-24 20:28 ` Charles Perry
2026-03-04 11:15 ` Conor Dooley
2026-02-24 20:28 ` [PATCH net-next v2 2/3] net: macb: add support for reporting SGMII inband link status Charles Perry
` (2 subsequent siblings)
3 siblings, 1 reply; 25+ messages in thread
From: Charles Perry @ 2026-02-24 20:28 UTC (permalink / raw)
To: netdev
Cc: Charles Perry, Sean Anderson, Nicolas Ferre, Claudiu Beznea,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Russell King, linux-kernel
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.
Signed-off-by: Charles Perry <charles.perry@microchip.com>
---
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(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index f72270a39d25..f4250e76cef0 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -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);
}
--
2.47.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH net-next v2 2/3] net: macb: add support for reporting SGMII inband link status
2026-02-24 20:28 [PATCH net-next v2 0/3] Support PHYs that have inband autoneg disabled with GEM Charles Perry
2026-02-24 20:28 ` [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled Charles Perry
@ 2026-02-24 20:28 ` Charles Perry
2026-02-24 20:28 ` [PATCH net-next v2 3/3] net: macb: add the .pcs_inband_caps() callback for SGMII Charles Perry
2026-02-27 3:30 ` [PATCH net-next v2 0/3] Support PHYs that have inband autoneg disabled with GEM patchwork-bot+netdevbpf
3 siblings, 0 replies; 25+ messages in thread
From: Charles Perry @ 2026-02-24 20:28 UTC (permalink / raw)
To: netdev
Cc: Charles Perry, Sean Anderson, Nicolas Ferre, Claudiu Beznea,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Russell King, linux-kernel
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.
Signed-off-by: Charles Perry <charles.perry@microchip.com>
---
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(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index f4250e76cef0..f6efc1bb88b6 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -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)
--
2.47.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH net-next v2 3/3] net: macb: add the .pcs_inband_caps() callback for SGMII
2026-02-24 20:28 [PATCH net-next v2 0/3] Support PHYs that have inband autoneg disabled with GEM Charles Perry
2026-02-24 20:28 ` [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled Charles Perry
2026-02-24 20:28 ` [PATCH net-next v2 2/3] net: macb: add support for reporting SGMII inband link status Charles Perry
@ 2026-02-24 20:28 ` Charles Perry
2026-02-27 3:30 ` [PATCH net-next v2 0/3] Support PHYs that have inband autoneg disabled with GEM patchwork-bot+netdevbpf
3 siblings, 0 replies; 25+ messages in thread
From: Charles Perry @ 2026-02-24 20:28 UTC (permalink / raw)
To: netdev
Cc: Charles Perry, Sean Anderson, Nicolas Ferre, Claudiu Beznea,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Russell King, linux-kernel
In SGMII mode, GEM can work with or without inband
autonegotiation.
Signed-off-by: Charles Perry <charles.perry@microchip.com>
---
Notes:
Changes in v2:
* Added this patch
drivers/net/ethernet/cadence/macb_main.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index f6efc1bb88b6..4b1fe3beaa17 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -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,
--
2.47.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 0/3] Support PHYs that have inband autoneg disabled with GEM
2026-02-24 20:28 [PATCH net-next v2 0/3] Support PHYs that have inband autoneg disabled with GEM Charles Perry
` (2 preceding siblings ...)
2026-02-24 20:28 ` [PATCH net-next v2 3/3] net: macb: add the .pcs_inband_caps() callback for SGMII Charles Perry
@ 2026-02-27 3:30 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 25+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-02-27 3:30 UTC (permalink / raw)
To: Charles Perry
Cc: netdev, sean.anderson, nicolas.ferre, claudiu.beznea,
andrew+netdev, davem, edumazet, kuba, pabeni, linux, linux-kernel
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-02-24 20:28 ` [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled Charles Perry
@ 2026-03-04 11:15 ` Conor Dooley
2026-03-04 14:59 ` Charles Perry
0 siblings, 1 reply; 25+ messages in thread
From: Conor Dooley @ 2026-03-04 11:15 UTC (permalink / raw)
To: Charles Perry
Cc: netdev, Sean Anderson, Nicolas Ferre, Claudiu Beznea, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Russell King, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 5004 bytes --]
On Tue, Feb 24, 2026 at 12:28:52PM -0800, Charles Perry wrote:
> 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.
>
> Signed-off-by: Charles Perry <charles.perry@microchip.com>
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.
> ---
>
> 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(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index f72270a39d25..f4250e76cef0 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -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);
> }
>
> --
> 2.47.3
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-04 11:15 ` Conor Dooley
@ 2026-03-04 14:59 ` Charles Perry
2026-03-04 16:23 ` Conor Dooley
0 siblings, 1 reply; 25+ messages in thread
From: Charles Perry @ 2026-03-04 14:59 UTC (permalink / raw)
To: Conor Dooley
Cc: netdev, Sean Anderson, Nicolas Ferre, Claudiu Beznea, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Russell King, linux-kernel, charles.perry
On Wed, Mar 04, 2026 at 11:15:43AM +0000, Conor Dooley wrote:
> On Tue, Feb 24, 2026 at 12:28:52PM -0800, Charles Perry wrote:
> > 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.
> >
> > Signed-off-by: Charles Perry <charles.perry@microchip.com>
>
> 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.
>
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.
> 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
> Cheers,
> Conor.
>
> > ---
> >
> > 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(-)
> >
> > diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> > index f72270a39d25..f4250e76cef0 100644
> > --- a/drivers/net/ethernet/cadence/macb_main.c
> > +++ b/drivers/net/ethernet/cadence/macb_main.c
> > @@ -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);
> > }
> >
> > --
> > 2.47.3
> >
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-04 14:59 ` Charles Perry
@ 2026-03-04 16:23 ` Conor Dooley
2026-03-04 16:55 ` Russell King (Oracle)
2026-03-04 17:37 ` Charles Perry
0 siblings, 2 replies; 25+ messages in thread
From: Conor Dooley @ 2026-03-04 16:23 UTC (permalink / raw)
To: Charles Perry
Cc: netdev, Sean Anderson, Nicolas Ferre, Claudiu Beznea, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Russell King, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 5223 bytes --]
On Wed, Mar 04, 2026 at 06:59:35AM -0800, Charles Perry wrote:
> On Wed, Mar 04, 2026 at 11:15:43AM +0000, Conor Dooley wrote:
> > On Tue, Feb 24, 2026 at 12:28:52PM -0800, Charles Perry wrote:
> > > 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.
> > >
> > > Signed-off-by: Charles Perry <charles.perry@microchip.com>
> >
> > 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.
> >
>
> 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.
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
> 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.
> > 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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-04 16:23 ` Conor Dooley
@ 2026-03-04 16:55 ` Russell King (Oracle)
2026-03-04 17:25 ` Charles Perry
2026-03-04 18:06 ` Conor Dooley
2026-03-04 17:37 ` Charles Perry
1 sibling, 2 replies; 25+ messages in thread
From: Russell King (Oracle) @ 2026-03-04 16:55 UTC (permalink / raw)
To: Conor Dooley
Cc: Charles Perry, netdev, Sean Anderson, Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-kernel
On Wed, Mar 04, 2026 at 04:23:30PM +0000, Conor Dooley wrote:
> On Wed, Mar 04, 2026 at 06:59:35AM -0800, Charles Perry wrote:
> > On Wed, Mar 04, 2026 at 11:15:43AM +0000, Conor Dooley wrote:
> > > On Tue, Feb 24, 2026 at 12:28:52PM -0800, Charles Perry wrote:
> > > > 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.
> > > >
> > > > Signed-off-by: Charles Perry <charles.perry@microchip.com>
> > >
> > > 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.
> > >
> >
> > 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.
>
> 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
-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.
> > 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.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-04 16:55 ` Russell King (Oracle)
@ 2026-03-04 17:25 ` Charles Perry
2026-03-04 17:40 ` Conor Dooley
2026-03-04 18:06 ` Conor Dooley
1 sibling, 1 reply; 25+ messages in thread
From: Charles Perry @ 2026-03-04 17:25 UTC (permalink / raw)
To: Russell King (Oracle), Conor Dooley
Cc: Conor Dooley, netdev, Sean Anderson, Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-kernel
On Wed, Mar 04, 2026 at 04:55:37PM +0000, Russell King (Oracle) wrote:
> On Wed, Mar 04, 2026 at 04:23:30PM +0000, Conor Dooley wrote:
> > On Wed, Mar 04, 2026 at 06:59:35AM -0800, Charles Perry wrote:
> > > On Wed, Mar 04, 2026 at 11:15:43AM +0000, Conor Dooley wrote:
> > > > On Tue, Feb 24, 2026 at 12:28:52PM -0800, Charles Perry wrote:
> > > > > 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.
> > > > >
> > > > > Signed-off-by: Charles Perry <charles.perry@microchip.com>
> > > >
> > > > 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.
> > > >
> > >
> > > 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.
> >
> > 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
>
> -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.
>
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
> > > 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.
>
> --
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-04 16:23 ` Conor Dooley
2026-03-04 16:55 ` Russell King (Oracle)
@ 2026-03-04 17:37 ` Charles Perry
2026-03-05 9:42 ` Conor Dooley
1 sibling, 1 reply; 25+ messages in thread
From: Charles Perry @ 2026-03-04 17:37 UTC (permalink / raw)
To: Conor Dooley
Cc: netdev, Sean Anderson, Nicolas Ferre, Claudiu Beznea, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Russell King, linux-kernel
On Wed, Mar 04, 2026 at 04:23:30PM +0000, Conor Dooley wrote:
> On Wed, Mar 04, 2026 at 06:59:35AM -0800, Charles Perry wrote:
> > On Wed, Mar 04, 2026 at 11:15:43AM +0000, Conor Dooley wrote:
> > > On Tue, Feb 24, 2026 at 12:28:52PM -0800, Charles Perry wrote:
> > > > 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.
> > > >
> > > > Signed-off-by: Charles Perry <charles.perry@microchip.com>
> > >
> > > 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.
> > >
> >
> > 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.
>
> 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
>
> > 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.
> > > 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.
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
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-04 17:25 ` Charles Perry
@ 2026-03-04 17:40 ` Conor Dooley
0 siblings, 0 replies; 25+ messages in thread
From: Conor Dooley @ 2026-03-04 17:40 UTC (permalink / raw)
To: Charles Perry
Cc: Russell King (Oracle), netdev, Sean Anderson, Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 223 bytes --]
On Wed, Mar 04, 2026 at 09:25:57AM -0800, Charles Perry wrote:
> 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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-04 16:55 ` Russell King (Oracle)
2026-03-04 17:25 ` Charles Perry
@ 2026-03-04 18:06 ` Conor Dooley
2026-03-04 18:38 ` Conor Dooley
2026-03-04 18:39 ` Russell King (Oracle)
1 sibling, 2 replies; 25+ messages in thread
From: Conor Dooley @ 2026-03-04 18:06 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Charles Perry, netdev, Sean Anderson, Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 5718 bytes --]
On Wed, Mar 04, 2026 at 04:55:37PM +0000, Russell King (Oracle) wrote:
> On Wed, Mar 04, 2026 at 04:23:30PM +0000, Conor Dooley wrote:
> > On Wed, Mar 04, 2026 at 06:59:35AM -0800, Charles Perry wrote:
> > > On Wed, Mar 04, 2026 at 11:15:43AM +0000, Conor Dooley wrote:
> > > > On Tue, Feb 24, 2026 at 12:28:52PM -0800, Charles Perry wrote:
> > > > > 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.
> > > > >
> > > > > Signed-off-by: Charles Perry <charles.perry@microchip.com>
> > > >
> > > > 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.
> > > >
> > >
> > > 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.
> >
> > 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
>
> -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.
It's as you say, and fwnode_phy_find_device() is the source.
fwnode_mdio_find_device() is what fails, returning NULL.
> > > 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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-04 18:06 ` Conor Dooley
@ 2026-03-04 18:38 ` Conor Dooley
2026-03-04 18:39 ` Russell King (Oracle)
1 sibling, 0 replies; 25+ messages in thread
From: Conor Dooley @ 2026-03-04 18:38 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Charles Perry, netdev, Sean Anderson, Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 6108 bytes --]
On Wed, Mar 04, 2026 at 06:06:20PM +0000, Conor Dooley wrote:
> On Wed, Mar 04, 2026 at 04:55:37PM +0000, Russell King (Oracle) wrote:
> > On Wed, Mar 04, 2026 at 04:23:30PM +0000, Conor Dooley wrote:
> > > On Wed, Mar 04, 2026 at 06:59:35AM -0800, Charles Perry wrote:
> > > > On Wed, Mar 04, 2026 at 11:15:43AM +0000, Conor Dooley wrote:
> > > > > On Tue, Feb 24, 2026 at 12:28:52PM -0800, Charles Perry wrote:
> > > > > > 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.
> > > > > >
> > > > > > Signed-off-by: Charles Perry <charles.perry@microchip.com>
> > > > >
> > > > > 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.
> > > > >
> > > >
> > > > 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.
> > >
> > > 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
> >
> > -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.
>
> 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.
>
> > > > 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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-04 18:06 ` Conor Dooley
2026-03-04 18:38 ` Conor Dooley
@ 2026-03-04 18:39 ` Russell King (Oracle)
2026-03-05 9:37 ` Conor Dooley
2026-03-05 13:47 ` Charles Perry
1 sibling, 2 replies; 25+ messages in thread
From: Russell King (Oracle) @ 2026-03-04 18:39 UTC (permalink / raw)
To: Conor Dooley
Cc: Charles Perry, netdev, Sean Anderson, Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-kernel
On Wed, Mar 04, 2026 at 06:06:20PM +0000, Conor Dooley wrote:
> On Wed, Mar 04, 2026 at 04:55:37PM +0000, Russell King (Oracle) wrote:
> > On Wed, Mar 04, 2026 at 04:23:30PM +0000, Conor Dooley wrote:
> > > On Wed, Mar 04, 2026 at 06:59:35AM -0800, Charles Perry wrote:
> > > > On Wed, Mar 04, 2026 at 11:15:43AM +0000, Conor Dooley wrote:
> > > > > On Tue, Feb 24, 2026 at 12:28:52PM -0800, Charles Perry wrote:
> > > > > > 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.
> > > > > >
> > > > > > Signed-off-by: Charles Perry <charles.perry@microchip.com>
> > > > >
> > > > > 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.
> > > > >
> > > >
> > > > 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.
> > >
> > > 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
> >
> > -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.
>
> 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.
> > > > 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.
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>
...
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-04 18:39 ` Russell King (Oracle)
@ 2026-03-05 9:37 ` Conor Dooley
2026-03-05 13:47 ` Charles Perry
1 sibling, 0 replies; 25+ messages in thread
From: Conor Dooley @ 2026-03-05 9:37 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Charles Perry, netdev, Sean Anderson, Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 3814 bytes --]
On Wed, Mar 04, 2026 at 06:39:38PM +0000, Russell King (Oracle) wrote:
> > > > > 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.
>
> 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.
>
> [ 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>
> ...
>
> --
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-04 17:37 ` Charles Perry
@ 2026-03-05 9:42 ` Conor Dooley
2026-03-05 13:56 ` Charles Perry
0 siblings, 1 reply; 25+ messages in thread
From: Conor Dooley @ 2026-03-05 9:42 UTC (permalink / raw)
To: Charles Perry
Cc: netdev, Sean Anderson, Nicolas Ferre, Claudiu Beznea, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Russell King, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 329 bytes --]
On Wed, Mar 04, 2026 at 09:37:23AM -0800, Charles Perry wrote:
> 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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-04 18:39 ` Russell King (Oracle)
2026-03-05 9:37 ` Conor Dooley
@ 2026-03-05 13:47 ` Charles Perry
2026-03-05 14:19 ` Conor Dooley
1 sibling, 1 reply; 25+ messages in thread
From: Charles Perry @ 2026-03-05 13:47 UTC (permalink / raw)
To: Russell King (Oracle), Conor Dooley
Cc: Conor Dooley, netdev, Sean Anderson, Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-kernel
On Wed, Mar 04, 2026 at 06:39:38PM +0000, Russell King (Oracle) wrote:
> On Wed, Mar 04, 2026 at 06:06:20PM +0000, Conor Dooley wrote:
> > On Wed, Mar 04, 2026 at 04:55:37PM +0000, Russell King (Oracle) wrote:
> > > On Wed, Mar 04, 2026 at 04:23:30PM +0000, Conor Dooley wrote:
> > > > On Wed, Mar 04, 2026 at 06:59:35AM -0800, Charles Perry wrote:
> > > > > On Wed, Mar 04, 2026 at 11:15:43AM +0000, Conor Dooley wrote:
> > > > > > On Tue, Feb 24, 2026 at 12:28:52PM -0800, Charles Perry wrote:
> > > > > > > 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.
> > > > > > >
> > > > > > > Signed-off-by: Charles Perry <charles.perry@microchip.com>
> > > > > >
> > > > > > 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.
> > > > > >
> > > > >
> > > > > 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.
> > > >
> > > > 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
> > >
> > > -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.
> >
> > 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.
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
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-05 9:42 ` Conor Dooley
@ 2026-03-05 13:56 ` Charles Perry
2026-03-05 14:13 ` Conor Dooley
0 siblings, 1 reply; 25+ messages in thread
From: Charles Perry @ 2026-03-05 13:56 UTC (permalink / raw)
To: Conor Dooley
Cc: netdev, Sean Anderson, Nicolas Ferre, Claudiu Beznea, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Russell King, linux-kernel, charles.perry
On Thu, Mar 05, 2026 at 09:42:19AM +0000, Conor Dooley wrote:
> On Wed, Mar 04, 2026 at 09:37:23AM -0800, Charles Perry wrote:
> > 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
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-05 13:56 ` Charles Perry
@ 2026-03-05 14:13 ` Conor Dooley
2026-03-05 14:28 ` Russell King (Oracle)
0 siblings, 1 reply; 25+ messages in thread
From: Conor Dooley @ 2026-03-05 14:13 UTC (permalink / raw)
To: Charles Perry
Cc: netdev, Sean Anderson, Nicolas Ferre, Claudiu Beznea, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Russell King, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1040 bytes --]
On Thu, Mar 05, 2026 at 05:56:15AM -0800, Charles Perry wrote:
> On Thu, Mar 05, 2026 at 09:42:19AM +0000, Conor Dooley wrote:
> > On Wed, Mar 04, 2026 at 09:37:23AM -0800, Charles Perry wrote:
> > > 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".
Eh no, actually I thought that you meant register 0x23. I'm not used to
register addresses being given in decimal.
> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-05 13:47 ` Charles Perry
@ 2026-03-05 14:19 ` Conor Dooley
2026-03-05 15:07 ` Charles Perry
0 siblings, 1 reply; 25+ messages in thread
From: Conor Dooley @ 2026-03-05 14:19 UTC (permalink / raw)
To: Charles Perry
Cc: Russell King (Oracle), netdev, Sean Anderson, Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 7407 bytes --]
On Thu, Mar 05, 2026 at 05:47:34AM -0800, Charles Perry wrote:
> On Wed, Mar 04, 2026 at 06:39:38PM +0000, Russell King (Oracle) wrote:
> > On Wed, Mar 04, 2026 at 06:06:20PM +0000, Conor Dooley wrote:
> > > On Wed, Mar 04, 2026 at 04:55:37PM +0000, Russell King (Oracle) wrote:
> > > > On Wed, Mar 04, 2026 at 04:23:30PM +0000, Conor Dooley wrote:
> > > > > On Wed, Mar 04, 2026 at 06:59:35AM -0800, Charles Perry wrote:
> > > > > > On Wed, Mar 04, 2026 at 11:15:43AM +0000, Conor Dooley wrote:
> > > > > > > On Tue, Feb 24, 2026 at 12:28:52PM -0800, Charles Perry wrote:
> > > > > > > > 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.
> > > > > > > >
> > > > > > > > Signed-off-by: Charles Perry <charles.perry@microchip.com>
> > > > > > >
> > > > > > > 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.
> > > > > > >
> > > > > >
> > > > > > 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.
> > > > >
> > > > > 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
> > > >
> > > > -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.
> > >
> > > 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.
>
> 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.
With this, I can boot. Is that enough information for you to resolve the
problem?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-05 14:13 ` Conor Dooley
@ 2026-03-05 14:28 ` Russell King (Oracle)
2026-03-05 14:49 ` Conor Dooley
2026-03-06 16:24 ` Conor Dooley
0 siblings, 2 replies; 25+ messages in thread
From: Russell King (Oracle) @ 2026-03-05 14:28 UTC (permalink / raw)
To: Conor Dooley
Cc: Charles Perry, netdev, Sean Anderson, Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-kernel
On Thu, Mar 05, 2026 at 02:13:24PM +0000, Conor Dooley wrote:
> On Thu, Mar 05, 2026 at 05:56:15AM -0800, Charles Perry wrote:
> > On Thu, Mar 05, 2026 at 09:42:19AM +0000, Conor Dooley wrote:
> > > On Wed, Mar 04, 2026 at 09:37:23AM -0800, Charles Perry wrote:
> > > > 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".
>
> Eh no, actually I thought that you meant register 0x23. I'm not used to
> register addresses being given in decimal.
>
> > 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.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-05 14:28 ` Russell King (Oracle)
@ 2026-03-05 14:49 ` Conor Dooley
2026-03-06 16:24 ` Conor Dooley
1 sibling, 0 replies; 25+ messages in thread
From: Conor Dooley @ 2026-03-05 14:49 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Charles Perry, netdev, Sean Anderson, Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
On Thu, Mar 05, 2026 at 02:28:08PM +0000, Russell King (Oracle) wrote:
> On Thu, Mar 05, 2026 at 02:13:24PM +0000, Conor Dooley wrote:
> > On Thu, Mar 05, 2026 at 05:56:15AM -0800, Charles Perry wrote:
> > > On Thu, Mar 05, 2026 at 09:42:19AM +0000, Conor Dooley wrote:
> > > > On Wed, Mar 04, 2026 at 09:37:23AM -0800, Charles Perry wrote:
> > > > > 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".
> >
> > Eh no, actually I thought that you meant register 0x23. I'm not used to
> > register addresses being given in decimal.
> >
> > > 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.
They're both 0401, so yea. I'll give the vitesse driver change a go
later.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-05 14:19 ` Conor Dooley
@ 2026-03-05 15:07 ` Charles Perry
0 siblings, 0 replies; 25+ messages in thread
From: Charles Perry @ 2026-03-05 15:07 UTC (permalink / raw)
To: Conor Dooley, Russell King
Cc: Russell King (Oracle), netdev, Sean Anderson, Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-kernel, charles.perry
On Thu, Mar 05, 2026 at 02:19:06PM +0000, Conor Dooley wrote:
> On Thu, Mar 05, 2026 at 05:47:34AM -0800, Charles Perry wrote:
> > On Wed, Mar 04, 2026 at 06:39:38PM +0000, Russell King (Oracle) wrote:
> > > On Wed, Mar 04, 2026 at 06:06:20PM +0000, Conor Dooley wrote:
> > > > On Wed, Mar 04, 2026 at 04:55:37PM +0000, Russell King (Oracle) wrote:
> > > > > On Wed, Mar 04, 2026 at 04:23:30PM +0000, Conor Dooley wrote:
> > > > > > On Wed, Mar 04, 2026 at 06:59:35AM -0800, Charles Perry wrote:
> > > > > > > On Wed, Mar 04, 2026 at 11:15:43AM +0000, Conor Dooley wrote:
> > > > > > > > On Tue, Feb 24, 2026 at 12:28:52PM -0800, Charles Perry wrote:
> > > > > > > > > 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.
> > > > > > > > >
> > > > > > > > > Signed-off-by: Charles Perry <charles.perry@microchip.com>
> > > > > > > >
> > > > > > > > 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.
> > > > > > > >
> > > > > > >
> > > > > > > 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.
> > > > > >
> > > > > > 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
> > > > >
> > > > > -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.
> > > >
> > > > 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.
> >
> > 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.
>
> 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
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled
2026-03-05 14:28 ` Russell King (Oracle)
2026-03-05 14:49 ` Conor Dooley
@ 2026-03-06 16:24 ` Conor Dooley
1 sibling, 0 replies; 25+ messages in thread
From: Conor Dooley @ 2026-03-06 16:24 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Charles Perry, netdev, Sean Anderson, Nicolas Ferre,
Claudiu Beznea, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1689 bytes --]
On Thu, Mar 05, 2026 at 02:28:08PM +0000, Russell King (Oracle) wrote:
> 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;
FYI, clang warns that changed is set but not used.
> 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.
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2026-03-06 16:24 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-24 20:28 [PATCH net-next v2 0/3] Support PHYs that have inband autoneg disabled with GEM Charles Perry
2026-02-24 20:28 ` [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled Charles Perry
2026-03-04 11:15 ` Conor Dooley
2026-03-04 14:59 ` Charles Perry
2026-03-04 16:23 ` Conor Dooley
2026-03-04 16:55 ` Russell King (Oracle)
2026-03-04 17:25 ` Charles Perry
2026-03-04 17:40 ` Conor Dooley
2026-03-04 18:06 ` Conor Dooley
2026-03-04 18:38 ` Conor Dooley
2026-03-04 18:39 ` Russell King (Oracle)
2026-03-05 9:37 ` Conor Dooley
2026-03-05 13:47 ` Charles Perry
2026-03-05 14:19 ` Conor Dooley
2026-03-05 15:07 ` Charles Perry
2026-03-04 17:37 ` Charles Perry
2026-03-05 9:42 ` Conor Dooley
2026-03-05 13:56 ` Charles Perry
2026-03-05 14:13 ` Conor Dooley
2026-03-05 14:28 ` Russell King (Oracle)
2026-03-05 14:49 ` Conor Dooley
2026-03-06 16:24 ` Conor Dooley
2026-02-24 20:28 ` [PATCH net-next v2 2/3] net: macb: add support for reporting SGMII inband link status Charles Perry
2026-02-24 20:28 ` [PATCH net-next v2 3/3] net: macb: add the .pcs_inband_caps() callback for SGMII Charles Perry
2026-02-27 3:30 ` [PATCH net-next v2 0/3] Support PHYs that have inband autoneg disabled with GEM patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox