Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	"Daniel Golle" <daniel@makrotopia.org>,
	"Horatiu Vultur" <horatiu.vultur@microchip.com>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Vinod Koul" <vkoul@kernel.org>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Eric Woudstra" <ericwouds@gmail.com>,
	"Marek Beh√∫n" <kabel@kernel.org>, "Lee Jones" <lee@kernel.org>,
	"Patrice Chotard" <patrice.chotard@foss.st.com>,
	"Maxime Chevallier" <maxime.chevallier@bootlin.com>,
	"Holger Brunck" <holger.brunck@hitachienergy.com>
Subject: Re: [PATCH net-next 1/9] dt-bindings: phy: rename transmit-amplitude.yaml to phy-common-props.yaml
Date: Wed, 26 Nov 2025 09:26:38 +0200	[thread overview]
Message-ID: <20251126072638.wqwbhhab3afxvm7x@skbuf> (raw)
In-Reply-To: <b4597333-e485-426d-975e-3082895e09f6@lunn.ch>

+Maxime, Holger
thread at https://lore.kernel.org/netdev/20251122193341.332324-2-vladimir.oltean@nxp.com/

On Tue, Nov 25, 2025 at 11:33:09PM +0100, Andrew Lunn wrote:
> > Yeah, although as things currently stand, I'd say that is the lesser of
> > problems. The only user (mv88e6xxx) does something strange: it says it
> > wants to configure the TX amplitude of SerDes ports, but instead follows
> > the phy-handle and applies the amplitude specified in that node.
> > 
> > I tried to mentally follow how things would work in 2 cases:
> > 1. PHY referenced by phy-handle is internal, then by definition it's not
> >    a SerDes port.
> > 2. PHY referenced by phy-handle is external, then the mv88e6xxx driver
> >    looks at what is essentially a device tree description of the PHY's
> >    TX, and applies that as a mirror image to the local SerDes' TX.
> > 
> > I think the logic is used in mv88e6xxx through case #2, i.e. we
> > externalize the mv88e6xxx SerDes electrical properties to an unrelated
> > OF node, the connected Ethernet PHY.
> 
> My understanding of the code is the same, #2. Although i would
> probably not say it is an unrelated node. I expect the PHY is on the
> other end of the SERDES link which is having the TX amplitudes
> set. This clearly will not work if there is an SFP cage on the other
> end, but it does for an SGMII PHY.

It is unrelated in the sense that the SGMII PHY is a different kernel
object, and the mv88e6xxx is polluting its OF node with properties which
it then interprets as its own, when the PHY driver may have wanted to
configure its SGMII TX amplitude too, via those same generic properties.

> I guess this code is from before the time Russell converted the
> mv88e6xxx SERDES code into PCS drivers. The register being set is
> within the PCS register set.  The mv88e6xxx also does not make use of
> generic phys to represent the SERDES part of the PCS. So there is no
> phys phandle to follow since there is no phy.

In my view, the phy-common-props.yaml are supposed to be applicable to either:
(1) a network PHY with SerDes host-side connection (I suppose the media
    side electrical properties would be covered by Maxime's phy_port
    work - Maxime, please confirm).
(2) a phylink_pcs with SerDes registers within the same register set
(3) a generic PHY

My patch 8/9 (net: phy: air_en8811h: deprecate "airoha,pnswap-rx" and
"airoha,pnswap-tx") is an example of case (1) for polarities. Also, for
example, at least Aquantia Gen3 PHYs (AQR111, AQR112) have a (not very
well documented) "SerDes Lane 0 Amplitude" field in the PHY XS Receive
(XAUI TX) Reserved Vendor Provisioning 4 register (address 4.E413).

My patch 7/9 (net: pcs: xpcs: allow lane polarity inversion) is an
example of case (2).

I haven't submitted an example of case (3) yet, but the Lynx PCS and
Lynx SerDes would fall into that category. The PCS would be free of
describing electrical properties, and those would go to the generic PHY
(SerDes).

All I'm trying to say is that we're missing an OF node to describe
mv88e6xxx PCS electrical properties, because otherwise, it collides with
case (1). My note regarding "phys" was just a guess that the "phy-handle"
may have been mistaken for the port's SerDes PHY. Although there is a
chance Holger knew what he was doing. In any case, I think we need to
sort this one way or another, leaving the phy-handle logic a discouraged
fallback path.

That being said, I'm not exactly an expert in determining _how_ we could
best retrofit SerDes/PCS OF nodes on top of the mv88e6xxx bindings.
It depends on how many SerDes ports there are in these switches
architecturally, and what is their register access method, so it would
need to be handled on a case-by-case basis rather than one-size-fits-all.
PCS node in port node could be a starting point, I guess, but I don't
know if it would work.

For SJA1105 and the XPCS, I thought the best course of action would be
to create a "regs" container node in the switch, under which we'd have
"ethernet-pcs" children, but that seems to be problematic in its own
ways, due to how MFD is seemingly abused to make that work:
https://lore.kernel.org/netdev/20251118190530.580267-15-vladimir.oltean@nxp.com/


  reply	other threads:[~2025-11-26  7:26 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-22 19:33 [PATCH net-next 0/9] XPCS polarity inversion via generic device tree properties Vladimir Oltean
2025-11-22 19:33 ` [PATCH net-next 1/9] dt-bindings: phy: rename transmit-amplitude.yaml to phy-common-props.yaml Vladimir Oltean
2025-11-25 21:19   ` Andrew Lunn
2025-11-25 21:44     ` Vladimir Oltean
2025-11-25 22:33       ` Andrew Lunn
2025-11-26  7:26         ` Vladimir Oltean [this message]
2025-11-26  9:32           ` Holger Brunck
2025-11-26 10:33             ` Vladimir Oltean
2025-11-26 10:45               ` Holger Brunck
2025-11-26 10:51                 ` Vladimir Oltean
2025-11-26 13:05                   ` Holger Brunck
2025-11-26 14:09           ` Andrew Lunn
2025-11-26 14:25           ` Maxime Chevallier
2025-12-04 16:11   ` Rob Herring (Arm)
2025-11-22 19:33 ` [PATCH net-next 2/9] dt-bindings: phy-common-props: create a reusable "protocol-names" definition Vladimir Oltean
2025-12-04 15:52   ` Rob Herring
2025-12-04 16:11     ` Rob Herring
2025-11-22 19:33 ` [PATCH net-next 3/9] dt-bindings: phy-common-props: RX and TX lane polarity inversion Vladimir Oltean
2025-12-04 16:13   ` Rob Herring (Arm)
2025-11-22 19:33 ` [PATCH net-next 4/9] dt-bindings: net: xpcs: allow properties from phy-common-props.yaml Vladimir Oltean
2025-12-04 16:13   ` Rob Herring (Arm)
2025-11-22 19:33 ` [PATCH net-next 5/9] phy: add phy_get_rx_polarity() and phy_get_tx_polarity() Vladimir Oltean
2025-11-25  4:01   ` Jakub Kicinski
2025-11-25 17:02     ` Vladimir Oltean
2025-12-01  8:37     ` Vinod Koul
2025-12-01  8:41       ` Krzysztof Kozlowski
2025-12-04 15:34         ` Vladimir Oltean
2025-12-04 16:48           ` Krzysztof Kozlowski
2025-12-01 19:03       ` Jakub Kicinski
2025-11-22 19:33 ` [PATCH net-next 6/9] net: pcs: xpcs: promote SJA1105 TX polarity inversion to core Vladimir Oltean
2025-11-22 19:33 ` [PATCH net-next 7/9] net: pcs: xpcs: allow lane polarity inversion Vladimir Oltean
2025-11-26 15:17   ` kernel test robot
2025-11-22 19:33 ` [PATCH net-next 8/9] net: phy: air_en8811h: deprecate "airoha,pnswap-rx" and "airoha,pnswap-tx" Vladimir Oltean
2025-11-22 19:33 ` [PATCH net-next 9/9] dt-bindings: net: airoha,en8811h: " Vladimir Oltean
2025-12-04 16:13   ` Rob Herring (Arm)
2025-11-25 14:36 ` [PATCH net-next 0/9] XPCS polarity inversion via generic device tree properties Daniel Golle
2025-12-27 16:12 ` Bjørn Mork

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=20251126072638.wqwbhhab3afxvm7x@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=ericwouds@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=holger.brunck@hitachienergy.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=kabel@kernel.org \
    --cc=kishon@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=matthias.bgg@gmail.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=patrice.chotard@foss.st.com \
    --cc=robh@kernel.org \
    --cc=vkoul@kernel.org \
    /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