Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Linus Walleij" <linusw@kernel.org>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH net-next v4 1/5] net: dsa: microchip: Add fallback Micrel compatibles
Date: Wed, 03 Jun 2026 23:11:22 +0000	[thread overview]
Message-ID: <20260603231122.905771F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260603-ks8995-to-ksz8-v4-1-e15149ef21e7@kernel.org>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The Kconfig dependency `depends on !NET_DSA_MICROCHIP_KSZ_SPI` fails to prevent both drivers from being compiled as modules simultaneously, leaving the probe race unresolved.
- [High] Enforcing blanket mutual exclusion entirely disables the KS8995 driver when KSZ_SPI is enabled, breaking support for legacy `micrel,ks8995` (KS8995MA) hardware.
--

commit 5818edfd41b48a4993fc7bbca349bb17e8aeaa95
Author: Linus Walleij <linusw@kernel.org>

net: dsa: microchip: Add fallback Micrel compatibles

Because of forking paths when Micrel was acquired by Microchip,
two devices also exist with the micrel,* prefix bindings.
Add these to the KSZ SPI driver so users can use the more capable
driver.

Make the KS8995 driver mutually exclusive with this driver
to avoid probe races.

> diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig
> index 4ab567c5bbafc..e704ab702c189 100644
> --- a/drivers/net/dsa/Kconfig
> +++ b/drivers/net/dsa/Kconfig
> @@ -100,6 +100,7 @@ config NET_DSA_RZN1_A5PSW
>  config NET_DSA_KS8995
>  	tristate "Micrel KS8995 family 5-ports 10/100 Ethernet switches"
>  	depends on SPI
> +	depends on !NET_DSA_MICROCHIP_KSZ_SPI

[Severity: High]
Does this correctly prevent both drivers from being built as modules?

In Kconfig, the logical NOT of a module (!m) evaluates to m. Since both
NET_DSA_KS8995 and NET_DSA_MICROCHIP_KSZ_SPI are tristate symbols, if
NET_DSA_MICROCHIP_KSZ_SPI is configured as a module (=m), the dependency
evaluates to m. This allows NET_DSA_KS8995 to also be built as a module.

Since both modules register identical device tree compatible strings, udev
will load both drivers concurrently, triggering the exact probe race this
was intended to fix. To correctly enforce strict mutual exclusivity, the
dependency should use the equality operator, such as:
depends on NET_DSA_MICROCHIP_KSZ_SPI = n

While this may be resolved in a later patch that deletes the old driver, this
patch introduces a race condition for modular builds.

[Severity: High]
Does making these mutually exclusive break support for legacy hardware that
the newer driver doesn't handle?

The legacy ks8995.c driver natively supports the original micrel,ks8995
switch chip (the KS8995MA). The newer ksz_spi.c driver does not support
the KS8995MA chip. By forcing NET_DSA_KS8995 to be mutually exclusive with
NET_DSA_MICROCHIP_KSZ_SPI, this patch unconditionally breaks network switch
support on boards relying on the legacy KS8995MA hardware when the new driver
is enabled.

Should the drivers be allowed to coexist to support their respective legacy
hardware, or should the new driver fully implement KS8995MA support before
the legacy driver is disabled?

>  	select NET_DSA_TAG_NONE
>  	help
>  	  This driver supports the Micrel KS8995 family of 10/100 Mbit ethernet

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260603-ks8995-to-ksz8-v4-0-e15149ef21e7@kernel.org?part=1

  reply	other threads:[~2026-06-03 23:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02 23:10 [PATCH net-next v4 0/5] net: dsa: microchip: Add support for KSZ8995XA/KS8995XA Linus Walleij
2026-06-02 23:10 ` [PATCH net-next v4 1/5] net: dsa: microchip: Add fallback Micrel compatibles Linus Walleij
2026-06-03 23:11   ` sashiko-bot [this message]
2026-06-02 23:10 ` [PATCH net-next v4 2/5] dt-bindings: net: dsa: microchip: Add KSZ8995XA Linus Walleij
2026-06-02 23:10 ` [PATCH net-next v4 3/5] net: dsa: tag_ks8995: Add the KS8995 tag handling Linus Walleij
2026-06-03 23:11   ` sashiko-bot
2026-06-02 23:10 ` [PATCH net-next v4 4/5] net: dsa: microchip: Support Microchip KSZ8995XA / KS8995XA Linus Walleij
2026-06-03 23:11   ` sashiko-bot
2026-06-02 23:10 ` [PATCH net-next v4 5/5] net: dsa: ks8995: Delete surplus driver Linus Walleij
2026-06-03 23:11   ` sashiko-bot

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=20260603231122.905771F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linusw@kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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