From: sashiko-bot@kernel.org
To: "Chi-Wen Weng" <cwweng.linux@gmail.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 3/3] spi: ma35d1-qspi: Add GPIO chip select support
Date: Thu, 01 Oct 2026 13:46:11 +0000 [thread overview]
Message-ID: <20261001134613.16C861F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261001131818.110028-4-cwweng.linux@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] spi: incorrect validation of total chip selects limits GPIO expansion
--
commit bf74299215867df971e01913ae533377b76db610
Author: Chi-Wen Weng <cwweng@nuvoton.com>
spi: ma35d1-qspi: Add GPIO chip select support
The generic SPI controller binding allows GPIO-based chip selects, but
the MA35D1 QSPI driver does not currently enable the SPI core's GPIO
descriptor handling. This patch enables GPIO chip-select support and
specifies that the controller provides two native chip selects.
> diff --git a/drivers/spi/spi-ma35d1-qspi.c b/drivers/spi/spi-ma35d1-qspi.c
> index 30e3239f777d6..0644bb2990b8c 100644
> --- a/drivers/spi/spi-ma35d1-qspi.c
> +++ b/drivers/spi/spi-ma35d1-qspi.c
[ ... ]
> @@ -638,18 +664,21 @@ static int nuvoton_qspi_probe(struct platform_device *pdev)
> goto err_assert;
> }
>
> - if (!num_cs || num_cs > NUVOTON_QSPI_MAX_NUM_CS) {
> + if (!num_cs || num_cs > NUVOTON_QSPI_MAX_NATIVE_CS) {
[Severity: Medium]
Does this validation check incorrectly apply the native chip select limit to the
total number of chip selects?
If the Devicetree specifies a num-cs greater than 2 to declare additional
GPIO-backed chip selects, it appears this check will cause nuvoton_qspi_probe()
to fail unconditionally, preventing the use of the new GPIO expansion feature.
> ret = dev_err_probe(dev, -EINVAL, "invalid num-cs %u\n",
> num_cs);
> goto err_assert;
> }
>
> ctlr->num_chipselect = num_cs;
> + ctlr->max_native_cs = NUVOTON_QSPI_MAX_NATIVE_CS;
> + ctlr->use_gpio_descriptors = true;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261001131818.110028-1-cwweng.linux@gmail.com?part=3
next prev parent reply other threads:[~2026-10-01 13:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-01 13:18 [PATCH v2 0/3] spi: Add Nuvoton MA35D1 SPI controller support Chi-Wen Weng
2026-10-01 13:18 ` [PATCH v2 1/3] spi: dt-bindings: nuvoton,ma35d1-qspi: Add MA35D1 SPI controller Chi-Wen Weng
2026-10-03 14:25 ` Krzysztof Kozlowski
2026-10-05 3:08 ` Chi-Wen Weng
2026-10-01 13:18 ` [PATCH v2 2/3] spi: ma35d1: Add Nuvoton MA35D1 SPI controller support Chi-Wen Weng
2026-10-01 13:37 ` sashiko-bot
2026-10-02 0:45 ` Chi-Wen Weng
2026-10-01 13:18 ` [PATCH v2 3/3] spi: ma35d1-qspi: Add GPIO chip select support Chi-Wen Weng
2026-10-01 13:46 ` sashiko-bot [this message]
2026-10-02 0:51 ` Chi-Wen Weng
2026-10-04 17:19 ` [PATCH v2 0/3] spi: Add Nuvoton MA35D1 SPI controller support Mark Brown
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=20261001134613.16C861F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=cwweng.linux@gmail.com \
--cc=devicetree@vger.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