From: Daniel Golle <daniel@makrotopia.org>
To: Hauke Mehrtens <hauke@hauke-m.de>, Andrew Lunn <andrew@lunn.ch>,
Vladimir Oltean <olteanv@gmail.com>,
"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>,
Russell King <linux@armlinux.org.uk>,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Chen Minqiang <ptpt52@gmail.com>, Xinfa Deng <xinfa.deng@gl-inet.com>
Subject: Re: [PATCH net-next v2 3/6] net: dsa: lantiq: allow arbitrary MII registers
Date: Thu, 15 Jan 2026 01:40:50 +0000 [thread overview]
Message-ID: <aWhFohyjEnaIeHSS@makrotopia.org> (raw)
In-Reply-To: <572c7d91f8eb97bd72584018f9b5941dbfb2e46e.1768438019.git.daniel@makrotopia.org>
On Thu, Jan 15, 2026 at 12:57:07AM +0000, Daniel Golle wrote:
> The Lantiq GSWIP and MaxLinear GSW1xx drivers are currently relying on a
> hard-coded mapping of MII ports to their respective MII_CFG and MII_PCDU
> registers and only allow applying an offset to the port index.
>
> While this is sufficient for the currently supported hardware, the very
> similar Intel GSW150 (aka. Lantiq PEB7084) cannot be described using
> this arrangement.
>
> Introduce two arrays to specify the MII_CFG and MII_PCDU registers for
> each port, replacing the current bitmap used to safeguard MII ports as
> well as the port index offset.
>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
> v2:
> * introduce GSWIP_MAX_PORTS macro
>
> drivers/net/dsa/lantiq/lantiq_gswip.c | 30 ++++++++++++++++----
> drivers/net/dsa/lantiq/lantiq_gswip.h | 6 ++--
> drivers/net/dsa/lantiq/lantiq_gswip_common.c | 27 +++---------------
> drivers/net/dsa/lantiq/mxl-gsw1xx.c | 30 ++++++++++++++++----
> 4 files changed, 56 insertions(+), 37 deletions(-)
>
> diff --git a/drivers/net/dsa/lantiq/lantiq_gswip.c b/drivers/net/dsa/lantiq/lantiq_gswip.c
> index b094001a7c805..4a1be6a1df6fe 100644
> --- a/drivers/net/dsa/lantiq/lantiq_gswip.c
> +++ b/drivers/net/dsa/lantiq/lantiq_gswip.c
> @@ -463,10 +463,20 @@ static void gswip_shutdown(struct platform_device *pdev)
> }
>
> static const struct gswip_hw_info gswip_xrx200 = {
> - .max_ports = 7,
> + .max_ports = GSWIP_MAX_PORTS,
> .allowed_cpu_ports = BIT(6),
> - .mii_ports = BIT(0) | BIT(1) | BIT(5),
> - .mii_port_reg_offset = 0,
> + .mii_cfg = {
> + [0 ... GSWIP_MAX_PORTS - 1] = -1,
> + [0] = GSWIP_MII_CFGp(0),
> + [1] = GSWIP_MII_CFGp(1),
> + [5] = GSWIP_MII_CFGp(5),
> + },
Kernel CI trips with
warning: initialized field overwritten [-Woverride-init]
Would it be ok to enclose the gswip_hw_info initializers with
__diag_push();
__diag_ignore_all("-Woverride-init",
"logic to initialize all and then override some is OK");
like it is done in drivers/net/ethernet/renesas/sh_eth.c?
Or should I rather keep the .mii_ports bitmap in addition to the array
to indicate the indexes with valid values?
next prev parent reply other threads:[~2026-01-15 1:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-15 0:56 [PATCH net-next v2 0/6] net: dsa: lantiq: add support for Intel GSW150 Daniel Golle
2026-01-15 0:56 ` [PATCH net-next v2 1/6] dt-bindings: net: dsa: lantiq,gswip: use correct node name Daniel Golle
2026-01-15 19:59 ` Rob Herring (Arm)
2026-01-15 0:56 ` [PATCH net-next v2 2/6] dt-bindings: net: dsa: lantiq,gswip: add Intel GSW150 Daniel Golle
2026-01-15 20:00 ` Rob Herring (Arm)
2026-01-15 0:57 ` [PATCH net-next v2 3/6] net: dsa: lantiq: allow arbitrary MII registers Daniel Golle
2026-01-15 1:40 ` Daniel Golle [this message]
2026-01-15 10:06 ` Vladimir Oltean
2026-01-15 0:57 ` [PATCH net-next v2 4/6] net: dsa: lantiq: clean up phylink_get_caps switch statement Daniel Golle
2026-01-15 0:57 ` [PATCH net-next v2 5/6] net: dsa: mxl-gsw1xx: only setup SerDes PCS if it exists Daniel Golle
2026-01-15 0:58 ` [PATCH net-next v2 6/6] net: dsa: mxl-gsw1xx: add support for Intel GSW150 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=aWhFohyjEnaIeHSS@makrotopia.org \
--to=daniel@makrotopia.org \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=hauke@hauke-m.de \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=ptpt52@gmail.com \
--cc=robh@kernel.org \
--cc=xinfa.deng@gl-inet.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.