From: sashiko-bot@kernel.org
To: "Maciej Andrzejewski ICEYE" <maciej.andrzejewski@m-works.net>
Cc: "Takahiro Kuwano" <takahiro.kuwano@infineon.com>,
robh@kernel.org, conor+dt@kernel.org,
"Vignesh Raghavendra" <vigneshr@ti.com>,
devicetree@vger.kernel.org,
"Pratyush Yadav" <pratyush@kernel.org>,
"Michael Walle" <mwalle@kernel.org>,
"Richard Weinberger" <richard@nod.at>,
"Miquel Raynal" <miquel.raynal@bootlin.com>
Subject: Re: [PATCH 1/2] gpiolib: of: Only apply the SPI CS quirk to SPI peripherals
Date: Mon, 10 Aug 2026 14:23:25 +0000 [thread overview]
Message-ID: <20260810142326.903C41F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260810141629.81650-2-maciej.andrzejewski@m-works.net>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Functional regression breaking SPI chip select polarity for minimal SPI peripherals, breaking git bisect.
--
--- Patch [1]: [PATCH 1/2] gpiolib: of: Only apply the SPI CS quirk to SPI peripherals ---
commit 119ec452c0cd58efb0a9c22023e3cbf0565c7c18
Author: Maciej Andrzejewski ICEYE <maciej.andrzejewski@m-works.net>
gpiolib: of: Only apply the SPI CS quirk to SPI peripherals
This commit restricts the legacy SPI chip-select polarity quirk to nodes
that actually represent SPI peripherals, identifying them by checking for
properties with an "spi-" prefix. It aims to prevent the quirk from
improperly applying to other subsystems like NAND controllers that also use
the "cs-gpios" property.
> This is a convention rather than a guarantee: compatible and reg are the
> only properties spi-controller.yaml makes mandatory for a peripheral, so
> a minimal one may carry no "spi-" property at all. The next patch covers
> those by looking at the controller instead.
[Severity: High]
Does deferring the fix for minimal SPI peripherals to the next patch
introduce a functional regression at this specific commit?
Since every individual commit must be self-contained and fully functional to
preserve git bisect, should the logic covering the controller be combined
into this patch to avoid breaking boards with minimal SPI peripherals during
a bisection?
> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
> index 940b566946ce3..bd9a623f2ae16 100644
> --- a/drivers/gpio/gpiolib-of.c
> +++ b/drivers/gpio/gpiolib-of.c
[ ... ]
> @@ -374,6 +393,11 @@ static void of_gpio_flags_quirks(const struct device_node *np,
> if (ret)
> continue;
> if (cs == index) {
> + bool active_high;
> +
> + if (!of_gpio_child_is_spi_peripheral(child))
> + break;
[Severity: High]
Will this break SPI chip select polarity for minimal SPI peripherals that
lack "spi-" prefixed properties?
If of_gpio_child_is_spi_peripheral() returns false for a node that only has
"compatible" and "reg", the early break skips the of_gpio_quirk_polarity()
fixup. Their chip selects would default to active-high, potentially leaving
the device permanently deselected and unusable.
> +
> /*
> * SPI children have active low chip selects
> * by default. This can be specified negatively
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260810141629.81650-1-maciej.andrzejewski@m-works.net?part=1
next prev parent reply other threads:[~2026-08-10 14:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 14:16 [PATCH 0/2] gpiolib: of: Scope the legacy SPI CS quirk to SPI Maciej Andrzejewski ICEYE
2026-08-10 14:16 ` Maciej Andrzejewski ICEYE
2026-08-10 14:16 ` [PATCH 1/2] gpiolib: of: Only apply the SPI CS quirk to SPI peripherals Maciej Andrzejewski ICEYE
2026-08-10 14:16 ` Maciej Andrzejewski ICEYE
2026-08-10 14:23 ` sashiko-bot [this message]
2026-08-10 14:16 ` [PATCH 2/2] gpiolib: of: Identify SPI controllers by nodename Maciej Andrzejewski ICEYE
2026-08-10 14:16 ` Maciej Andrzejewski ICEYE
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=20260810142326.903C41F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=maciej.andrzejewski@m-works.net \
--cc=miquel.raynal@bootlin.com \
--cc=mwalle@kernel.org \
--cc=pratyush@kernel.org \
--cc=richard@nod.at \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=takahiro.kuwano@infineon.com \
--cc=vigneshr@ti.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.