From: Vasilij Strassheim <v.strassheim@linutronix.de>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
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>,
Simon Horman <horms@kernel.org>,
Russell King <linux@armlinux.org.uk>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org,
Martin Kaistra <martin.kaistra@linutronix.de>,
Benedikt Spranger <b.spranger@linutronix.de>
Subject: Re: [PATCH net-next v3 6/8] net: dsa: soce: Add basic support for SoC-e switch IP cores
Date: Wed, 30 Sep 2026 19:26:18 +0200 [thread overview]
Message-ID: <affd433db23905f57d48c25ad88707ba62c925a0.camel@linutronix.de> (raw)
In-Reply-To: <6c75787b-f06c-4d85-8fc4-5bd7b2a30716@lunn.ch>
On Sat, 2026-09-26 at 01:17 +0200, Andrew Lunn wrote:
> > +static void soce_sw_read_core_version(struct soce_dsa_local *local,
> > + u8 *version, u8 *subversion,
> > + u16 *revision)
> > +{
> > + u32 regval;
> > +
> > + regval = readl(local->base_addr + SOCE_CORE_VERSION_OFFSET);
> > + *version = (u8)(regval >> SOCE_CORE_VERSION_VERSION_SHIFT);
> > + *subversion = (u8)(regval >> SOCE_CORE_VERSION_SUBVERSION_SHIFT);
> > + *revision = (u16)regval;
>
> FIELD_GET() would make this more readable.
Yes, I will fix it.
> > +static int soce_sw_detect_features(struct soce_dsa_local *local,
> > + u32 *numports)
> > +{
> > + void __iomem *base = local->base_addr;
> > + u32 implemented_numports;
> > + u32 licensed_numports;
> > + u32 regval;
> > +
> > + regval = readl(base + SOCE_LIC_FEATURES_OFFSET);
> > + licensed_numports = FIELD_GET(SOCE_LIC_FEATURES_NUM_PORTS_MASK, regval);
> > + if (!licensed_numports || licensed_numports > SOCE_MAX_NUM_PORTS)
> > + return -EINVAL;
> > +
> > + regval = readl(base + SOCE_IMPL_FEATURES0_OFFSET);
> > + if (!(regval & SOCE_IMPL_FEATURES0_DSA))
> > + return -ENODEV;
> > +
> > + implemented_numports =
> > + FIELD_GET(SOCE_IMPL_FEATURES0_NUM_PORTS_MASK, regval);
> > + if (implemented_numports < SOCE_MIN_NUM_PORTS ||
> > + implemented_numports > licensed_numports)
> > + return -EINVAL;
>
> Maybe add dev_err() here for all these error cases. It will help
> somebody debug why there switch fails to probe.
Sure, I will add them.
>
> Andrew
Thanks,
Vasilij
next prev parent reply other threads:[~2026-09-30 17:26 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 10:39 [PATCH net-next v3 0/8] net: dsa: Add SoC-e DSA driver Vasilij Strassheim
2026-09-23 10:39 ` [PATCH net-next v3 1/8] dt-bindings: vendor-prefixes: Add soce Vasilij Strassheim
2026-09-23 10:39 ` [PATCH net-next v3 2/8] dt-bindings: net: Add SoC-e SWIP MDIO controller Vasilij Strassheim
2026-09-25 22:55 ` Andrew Lunn
2026-09-30 14:00 ` Vasilij Strassheim
2026-09-30 15:14 ` Andrew Lunn
2026-09-30 17:13 ` Vasilij Strassheim
2026-09-30 18:24 ` Andrew Lunn
2026-09-27 12:28 ` netdev-bot+sashiko
2026-09-23 10:39 ` [PATCH net-next v3 3/8] dt-bindings: net: dsa: Add SoC-e SWIP switch Vasilij Strassheim
2026-09-25 23:05 ` Andrew Lunn
2026-09-30 17:16 ` Vasilij Strassheim
2026-09-27 12:28 ` netdev-bot+sashiko
2026-09-23 10:39 ` [PATCH net-next v3 4/8] net: dsa: Add tag handling for SoC-e switches Vasilij Strassheim
[not found] ` <20260924104003.A49F31F000FF@smtp.kernel.org>
2026-09-25 12:46 ` Vasilij Strassheim
2026-09-27 12:28 ` netdev-bot+sashiko
2026-09-23 10:39 ` [PATCH net-next v3 5/8] net: mdio: Add SoC-e SWIP MDIO controller driver Vasilij Strassheim
2026-09-25 23:10 ` Andrew Lunn
2026-09-30 17:23 ` Vasilij Strassheim
2026-09-30 18:20 ` Andrew Lunn
2026-09-27 12:28 ` netdev-bot+sashiko
2026-09-23 10:39 ` [PATCH net-next v3 6/8] net: dsa: soce: Add basic support for SoC-e switch IP cores Vasilij Strassheim
2026-09-25 23:17 ` Andrew Lunn
2026-09-30 17:26 ` Vasilij Strassheim [this message]
2026-09-25 23:20 ` Andrew Lunn
2026-09-30 18:15 ` Vasilij Strassheim
2026-09-30 18:29 ` Andrew Lunn
2026-09-30 18:49 ` Vasilij Strassheim
2026-09-27 12:28 ` netdev-bot+sashiko
2026-09-23 10:39 ` [PATCH net-next v3 7/8] net: dsa: soce: Add VLAN offload support Vasilij Strassheim
2026-09-25 23:32 ` Andrew Lunn
2026-09-30 18:32 ` Vasilij Strassheim
2026-09-27 12:28 ` netdev-bot+sashiko
2026-09-23 10:39 ` [PATCH net-next v3 8/8] net: dsa: soce: Disable unsupported hardware STP Vasilij Strassheim
2026-09-25 23:24 ` Andrew Lunn
2026-09-30 18:29 ` Vasilij Strassheim
2026-09-30 18:41 ` Andrew Lunn
2026-09-27 12:28 ` netdev-bot+sashiko
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=affd433db23905f57d48c25ad88707ba62c925a0.camel@linutronix.de \
--to=v.strassheim@linutronix.de \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=b.spranger@linutronix.de \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=martin.kaistra@linutronix.de \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=robh@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
all inboxes | Powered by JetHome®