From: Vladimir Oltean <olteanv@gmail.com>
To: Daniel Golle <daniel@makrotopia.org>
Cc: Hauke Mehrtens <hauke@hauke-m.de>, Andrew Lunn <andrew@lunn.ch>,
"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>,
Simon Horman <horms@kernel.org>,
Russell King <linux@armlinux.org.uk>,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
Andreas Schirm <andreas.schirm@siemens.com>,
Lukas Stockmann <lukas.stockmann@siemens.com>,
Alexander Sverdlin <alexander.sverdlin@siemens.com>,
Peter Christen <peter.christen@siemens.com>,
Avinash Jayaraman <ajayaraman@maxlinear.com>,
Bing tao Xu <bxu@maxlinear.com>, Liang Xu <lxu@maxlinear.com>,
Juraj Povazanec <jpovazanec@maxlinear.com>,
"Fanni (Fang-Yi) Chan" <fchan@maxlinear.com>,
"Benny (Ying-Tsan) Weng" <yweng@maxlinear.com>,
"Livia M. Rosu" <lrosu@maxlinear.com>,
John Crispin <john@phrozen.org>
Subject: Re: [PATCH net-next v3 09/12] net: dsa: lantiq_gswip: add vendor property to setup MII refclk output
Date: Tue, 28 Oct 2025 03:44:07 +0200 [thread overview]
Message-ID: <20251028014407.x5jrwpw6f5rsfi5f@skbuf> (raw)
In-Reply-To: <aQAEyn08Q3DCedUU@makrotopia.org>
On Mon, Oct 27, 2025 at 11:48:26PM +0000, Daniel Golle wrote:
> On Tue, Oct 28, 2025 at 01:36:26AM +0200, Vladimir Oltean wrote:
> > On Sun, Oct 26, 2025 at 11:47:21PM +0000, Daniel Golle wrote:
> > > Read boolean Device Tree property "maxlinear,rmii-refclk-out" and switch
> > > the RMII reference clock to be a clock output rather than an input if it
> > > is set.
> > >
> > > Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> > > ---
> > > drivers/net/dsa/lantiq/lantiq_gswip_common.c | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > diff --git a/drivers/net/dsa/lantiq/lantiq_gswip_common.c b/drivers/net/dsa/lantiq/lantiq_gswip_common.c
> > > index 60a83093cd10..bf38ecc13f76 100644
> > > --- a/drivers/net/dsa/lantiq/lantiq_gswip_common.c
> > > +++ b/drivers/net/dsa/lantiq/lantiq_gswip_common.c
> > > @@ -1442,6 +1442,10 @@ static void gswip_phylink_mac_config(struct phylink_config *config,
> > > return;
> > > }
> > >
> > > + if (of_property_read_bool(dp->dn, "maxlinear,rmii-refclk-out") &&
> > > + !(miicfg & GSWIP_MII_CFG_MODE_RGMII))
> > > + miicfg |= GSWIP_MII_CFG_RMII_CLK;
> > > +
> >
> > What did you mean with the !(miicfg & GSWIP_MII_CFG_MODE_RGMII) test?
> > If the schema says "Only applicable for RMII mode.", what's the purpose
> > of this extra condition? For example, GSWIP_MII_CFG_MODE_GMII also has
> > the "GSWIP_MII_CFG_MODE_RGMII" bit (0x4) unset. Does this have any significance?
>
> You are right, probably the best would be to test (if at all) that
> (miicfg == GSWIP_MII_CFG_MODE_RMIIM || miicfg ==
> GSWIP_MII_CFG_MODE_RMIIP) and only in this case allow setting the
> GSWIP_MII_CFG_RMII_CLK bit.
>
> I forgot that there is older hardware which supports "full" MII, and MII
> MAC as well as MII PHY modes also shouldn't allow to set the
> GSWIP_MII_CFG_RMII_CLK bit to not end up with undefined behavior.
Yeah, actually you'd be looking at FIELD_GET(GSWIP_MII_CFG_MODE_MASK, miicfg)
rather than miicfg directly.
If the schema restricted "maxlinear,rmii-refclk-out" to be used only in
combination with phy-mode = "rmii" and "rev-rmii", in theory that should
be sufficient with no further driver checks. But some checks that at
least make sense don't seem to hurt.
next prev parent reply other threads:[~2025-10-28 1:44 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-26 23:43 [PATCH net-next v3 00/12] net: dsa: lantiq_gswip: Add support for MaxLinear GSW1xx switch family Daniel Golle
2025-10-26 23:43 ` [PATCH net-next v3 01/12] net: dsa: lantiq_gswip: split into common and MMIO parts Daniel Golle
2025-10-27 11:37 ` Sverdlin, Alexander
2025-10-27 22:22 ` Vladimir Oltean
2025-10-26 23:44 ` [PATCH net-next v3 02/12] net: dsa: lantiq_gswip: support enable/disable learning Daniel Golle
2025-10-27 22:29 ` Vladimir Oltean
2025-10-26 23:44 ` [PATCH net-next v3 03/12] net: dsa: lantiq_gswip: support Energy Efficient Ethernet Daniel Golle
2025-10-26 23:44 ` [PATCH net-next v3 04/12] net: dsa: lantiq_gswip: set link parameters also for CPU port Daniel Golle
2025-10-27 22:39 ` Vladimir Oltean
2025-10-26 23:44 ` [PATCH net-next v3 05/12] net: dsa: lantiq_gswip: define and use GSWIP_TABLE_MAC_BRIDGE_VAL1_VALID Daniel Golle
2025-10-27 22:47 ` Vladimir Oltean
2025-10-26 23:45 ` [PATCH net-next v3 06/12] dt-bindings: net: dsa: lantiq,gswip: add support for MII delay properties Daniel Golle
2025-10-27 23:04 ` Vladimir Oltean
2025-10-27 23:41 ` Daniel Golle
2025-10-28 1:39 ` Vladimir Oltean
2025-10-28 2:30 ` Daniel Golle
2025-10-26 23:45 ` [PATCH net-next v3 07/12] net: dsa: lantiq_gswip: allow adjusting MII delays Daniel Golle
2025-10-26 23:47 ` [PATCH net-next v3 08/12] dt-bindings: net: dsa: lantiq,gswip: add MaxLinear RMII refclk output property Daniel Golle
2025-10-27 9:41 ` Sverdlin, Alexander
2025-10-26 23:47 ` [PATCH net-next v3 09/12] net: dsa: lantiq_gswip: add vendor property to setup MII refclk output Daniel Golle
2025-10-27 11:39 ` Sverdlin, Alexander
2025-10-27 23:36 ` Vladimir Oltean
2025-10-27 23:48 ` Daniel Golle
2025-10-28 1:44 ` Vladimir Oltean [this message]
2025-10-26 23:48 ` [PATCH net-next v3 10/12] dt-bindings: net: dsa: lantiq,gswip: add support for MaxLinear GSW1xx switches Daniel Golle
2025-10-28 0:09 ` Vladimir Oltean
2025-10-28 1:27 ` Daniel Golle
2025-10-26 23:48 ` [PATCH net-next v3 11/12] net: dsa: add tagging driver for MaxLinear GSW1xx switch family Daniel Golle
2025-10-27 11:48 ` Sverdlin, Alexander
2025-10-28 0:28 ` Vladimir Oltean
2025-10-28 17:24 ` Daniel Golle
2025-10-26 23:49 ` [PATCH net-next v3 12/12] net: dsa: add " Daniel Golle
2025-10-28 1:24 ` Vladimir Oltean
2025-10-28 2:14 ` Daniel Golle
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=20251028014407.x5jrwpw6f5rsfi5f@skbuf \
--to=olteanv@gmail.com \
--cc=ajayaraman@maxlinear.com \
--cc=alexander.sverdlin@siemens.com \
--cc=andreas.schirm@siemens.com \
--cc=andrew@lunn.ch \
--cc=bxu@maxlinear.com \
--cc=conor+dt@kernel.org \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=fchan@maxlinear.com \
--cc=hauke@hauke-m.de \
--cc=horms@kernel.org \
--cc=john@phrozen.org \
--cc=jpovazanec@maxlinear.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lrosu@maxlinear.com \
--cc=lukas.stockmann@siemens.com \
--cc=lxu@maxlinear.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peter.christen@siemens.com \
--cc=robh@kernel.org \
--cc=yweng@maxlinear.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