From: Alexander Wilhelm <alexander.wilhelm@westermo.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: "Russell King (Oracle)" <linux@armlinux.org.uk>,
Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Aquantia PHY in OCSGMII mode?
Date: Thu, 9 Oct 2025 08:05:32 +0200 [thread overview]
Message-ID: <aOdQrJMtafhOh3GQ@FUE-ALEWI-WINX> (raw)
In-Reply-To: <20251008145549.6zhlsvphgx62zwgp@skbuf>
On Wed, Oct 08, 2025 at 05:55:49PM +0300, Vladimir Oltean wrote:
> On Wed, Oct 08, 2025 at 03:28:07PM +0200, Alexander Wilhelm wrote:
> > I have the broken 100M link state again (IF_MODE=3). Below are the debug
> > details I was able to observe:
> >
> > * With 2.5G link:
> >
> > mdio_bus 0x0000000ffe4e5000:00: BMSR 0x2d, BMCR 0x1140, ADV 0x41a0, LPA 0xdc01, IF_MODE 0x3
> >
> > * With 1G link:
> >
> > mdio_bus 0x0000000ffe4e5000:00: BMSR 0x2d, BMCR 0x1140, ADV 0x41a0, LPA 0xd801, IF_MODE 0x3
> >
> > * With 100M link:
> >
> > mdio_bus 0x0000000ffe4e5000:00: BMSR 0x2d, BMCR 0x1140, ADV 0x41a0, LPA 0xd401, IF_MODE 0x3
>
> Ok, this is why I didn't trust the print from lynx_pcs_config(). BMSR was 0x29
> in your previous log (no link) and is 0x2d now. Also, the LPA for 100M is
> different (I trust this one).
>
> We have:
> 2.5G link: LPA_SGMII_SPD_MASK bits = 0b11 => undefined behaviour, reserved value
> 1G link: LPA_SGMII_SPD_MASK bits = 0b10 => 1G, the only proper value (by coincidence, of course)
> 100M link: LPA_SGMII_SPD_MASK bits = 0b01 => 100M, PHY practically requests 10x symbol replication, and the Lynx PCS obliges
>
> So the AQR115 PHY uses the SGMII base page format, and with the IF_MODE=0 fix,
> the Lynx PCS uses the Clause 37 base page format.
>
> We know that in-band autoneg is enabled in the AQR115 PHY and we don't
> know how to disable it, and we know that for traffic to pass, one of two
> things must happen:
>
> 1. In-band autoneg must complete (as required by LINK_INBAND_ENABLE).
> This happens when we have managed = "in-band-status" in the device tree.
> - From the AQR115 perspective, SGMII AN completes if it receives a base page
> with the ACK bit set. Since SGMII and Clause 37 are compatible in this
> regard (the ACK bit is in the same position, bit 14), the Lynx PCS
> fulfills what the AQR115 expects.
> - From the Lynx PCS perspective, clause 37 AN also completes if it
> receives a base page with the ACK bit set. Which again it does, but
> the SGMII code word overlaps in strange ways (Next Page and Remote
> Fault 1 end up being set, neither Half Duplex nor Full Duplex bits
> are set), so the Lynx PCS may behave in unpredictable ways.
> 2. In-band autoneg fails, but the AQR115 PHY falls back to full data
> rate anyway (as permitted by LINK_INBAND_BYPASS). This happens when
> we do _not_ have managed = "in-band-status" in the device tree.
> The Lynx PCS does not respond with code words having the ACK bit set,
> and does not generate clause 37 code words of its own, instead goes
> to data mode directly. AQR115 eventually goes to data mode too.
>
> I expect that your setup works through #2 right now.
>
> The symbol replication aspect is now clarified, there is a new question mark caused by
> the 0b11 speed bits also empirically passing traffic despite being a reserved value,
> and in order to gain a bit more control over things and make them more robust, we need
> to see how the PHY driver can implement aqr_gen2_inband_caps() and aqr_gen2_config_inband()
> for PHY_INTERFACE_MODE_2500BASEX, and fix up the base pages the PHY is sending
> (the current format is broken per all known standards).
>
> Thanks a lot for testing.
It was my pleasure to help. Thank you for your patch suggestions and especially
for the detailed explanations. I now have a much better understanding of how the
PHY and MAC interact.
Best regards
Alexander Wilhelm
next prev parent reply other threads:[~2025-10-09 6:06 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-31 14:59 Aquantia PHY in OCSGMII mode? Alexander Wilhelm
2025-07-31 15:14 ` Andrew Lunn
2025-07-31 16:02 ` Russell King (Oracle)
2025-08-01 5:44 ` Alexander Wilhelm
2025-08-04 14:53 ` Andrew Lunn
2025-07-31 17:16 ` Vladimir Oltean
2025-07-31 19:26 ` Russell King (Oracle)
2025-08-01 5:50 ` Alexander Wilhelm
2025-08-01 11:01 ` Vladimir Oltean
2025-08-01 11:54 ` Alexander Wilhelm
2025-08-01 11:58 ` Russell King (Oracle)
2025-08-01 12:06 ` Alexander Wilhelm
2025-08-01 12:23 ` Russell King (Oracle)
2025-08-01 12:36 ` Alexander Wilhelm
2025-08-01 13:04 ` Vladimir Oltean
2025-08-01 14:02 ` Russell King (Oracle)
2025-08-01 14:37 ` Vladimir Oltean
2025-08-04 6:17 ` Alexander Wilhelm
2025-08-04 10:01 ` Vladimir Oltean
2025-08-04 13:01 ` Alexander Wilhelm
2025-08-04 13:41 ` Vladimir Oltean
2025-08-04 14:47 ` Alexander Wilhelm
2025-08-04 16:00 ` Vladimir Oltean
2025-08-04 16:02 ` Vladimir Oltean
2025-08-05 7:59 ` Alexander Wilhelm
2025-08-05 10:20 ` Vladimir Oltean
2025-08-05 12:44 ` Alexander Wilhelm
2025-08-06 14:58 ` Vladimir Oltean
2025-08-07 5:56 ` Alexander Wilhelm
2025-08-27 5:57 ` Alexander Wilhelm
2025-08-27 7:31 ` Vladimir Oltean
2025-08-27 8:41 ` Alexander Wilhelm
2025-08-27 8:47 ` Russell King (Oracle)
2025-08-27 9:03 ` Alexander Wilhelm
2025-08-27 9:13 ` Russell King (Oracle)
2025-08-28 9:28 ` Vladimir Oltean
2025-10-02 5:54 ` Alexander Wilhelm
2025-10-07 14:08 ` Vladimir Oltean
2025-10-08 7:47 ` Alexander Wilhelm
2025-10-08 11:10 ` Vladimir Oltean
2025-10-08 12:52 ` Russell King (Oracle)
2025-10-08 13:00 ` Vladimir Oltean
2025-10-08 13:28 ` Alexander Wilhelm
2025-10-08 14:55 ` Vladimir Oltean
2025-10-09 6:05 ` Alexander Wilhelm [this message]
2025-08-27 8:08 ` Russell King (Oracle)
2025-08-27 8:32 ` Alexander Wilhelm
2025-08-27 8:45 ` Russell King (Oracle)
2025-08-04 14:22 ` Russell King (Oracle)
2025-08-04 14:51 ` Alexander Wilhelm
2025-08-04 14:56 ` Vladimir Oltean
2025-08-01 11:13 ` Vladimir Oltean
2025-08-01 5:53 ` Alexander Wilhelm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aOdQrJMtafhOh3GQ@FUE-ALEWI-WINX \
--to=alexander.wilhelm@westermo.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vladimir.oltean@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox