From: sashiko-bot@kernel.org
To: "Long Zhao" <longzhao@ambarella.com>
Cc: linux-clk@vger.kernel.org, conor+dt@kernel.org,
devicetree@vger.kernel.org, mfd@lists.linux.dev, lee@kernel.org,
robh@kernel.org
Subject: Re: [PATCH v5 09/12] pinctrl: ambarella: add CV75 pin controller
Date: Tue, 18 Aug 2026 10:48:38 +0000 [thread overview]
Message-ID: <20260818104838.7BD6D1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260818-cv75-v5-v5-9-7bbb12f0360f@ambarella.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Race condition between PM suspend/resume callbacks and concurrent pinmux hardware accesses.
--
--- Patch [9]: [PATCH v5 09/12] pinctrl: ambarella: add CV75 pin controller ---
commit d6bbc0d8c89a402f676e8c68b67c6a6866af650a
Author: Long Zhao <longzhao@ambarella.com>
pinctrl: ambarella: add CV75 pin controller
Add an Ambarella pinmux-only pinctrl driver with CV75 function/group
tables. GPIO is handled by the PL061 driver.
> diff --git a/drivers/pinctrl/pinctrl-ambarella.c b/drivers/pinctrl/pinctrl-ambarella.c
> new file mode 100644
> index 0000000000000..f9146d365c3c5
> --- /dev/null
> +++ b/drivers/pinctrl/pinctrl-ambarella.c
[ ... ]
> +static int amb_pinctrl_suspend(struct device *dev)
> +{
> + struct amb_pinctrl_soc_data *soc = dev_get_drvdata(dev);
> + u32 bank, dedicated = soc->data->clk_au_dedicated_pin;
> +
> + for (bank = 0; bank < soc->data->nr_banks; bank++) {
[ ... ]
> + if (soc->data->have_ds2)
> + regmap_read(soc->ds_regmap, soc->data->ds2[bank],
> + &soc->pm[bank].ds[2]);
> +
> + amb_iomux_save_bank(soc, bank);
[Severity: High]
Does this read the IOMUX hardware state into PM structures without holding
soc->lock?
If another CPU is modifying the pins concurrently, could this result in a
torn read?
> + }
> +
> + if (dedicated >= soc->data->nr_banks * 32)
> + amb_iomux_save_bank(soc, PINID_TO_BANK(dedicated));
> +
> + return 0;
> +}
> +
> +static int amb_pinctrl_resume(struct device *dev)
> +{
> + struct amb_pinctrl_soc_data *soc = dev_get_drvdata(dev);
> + u32 bank, dedicated = soc->data->clk_au_dedicated_pin;
> +
> + for (bank = 0; bank < soc->data->nr_banks; bank++)
> + amb_iomux_restore_bank(soc, bank);
> +
> + if (dedicated >= soc->data->nr_banks * 32)
> + amb_iomux_restore_bank(soc, PINID_TO_BANK(dedicated));
> +
> + /* Ensure restored IOMUX writes land before the commit strobe. */
> + wmb();
> + amb_iomux_commit(soc);
[Severity: High]
Does this write directly to shared IOMUX hardware registers without holding
soc->lock?
If a concurrent pinmux or GPIO configuration request executes while the system
is resuming, the pinctrl core will invoke amb_pinmux_set_mux() and acquire
soc->lock.
However, since amb_pinctrl_resume() does not hold the lock here, could it
silently overwrite the concurrent pinmux updates with stale suspended state?
> +
> + for (bank = 0; bank < soc->data->nr_banks; bank++) {
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260818-cv75-v5-v5-0-7bbb12f0360f@ambarella.com?part=9
next prev parent reply other threads:[~2026-08-18 10:48 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 10:31 [PATCH v5 00/12] Ambarella CV75 SoC minimal bring-up Long Zhao via B4 Relay
2026-08-18 10:31 ` [PATCH v5 01/12] dt-bindings: arm: add Ambarella CV75 platforms Long Zhao via B4 Relay
2026-08-18 10:35 ` sashiko-bot
2026-08-18 10:31 ` [PATCH v5 02/12] dt-bindings: mfd: syscon: add Ambarella CV75 secure scratchpad Long Zhao via B4 Relay
2026-08-18 10:37 ` sashiko-bot
2026-08-18 10:31 ` [PATCH v5 03/12] dt-bindings: clock: add Ambarella CV75 RCT Long Zhao via B4 Relay
2026-08-18 10:36 ` sashiko-bot
2026-08-18 10:31 ` [PATCH v5 04/12] dt-bindings: pinctrl: add Ambarella CV75 pinctrl Long Zhao via B4 Relay
2026-08-18 10:39 ` sashiko-bot
2026-08-18 10:31 ` [PATCH v5 05/12] dt-bindings: gpio: pl061: add Ambarella CV75 variant Long Zhao via B4 Relay
2026-08-18 10:40 ` sashiko-bot
2026-08-18 10:31 ` [PATCH v5 06/12] dt-bindings: serial: add Ambarella CV75 UART Long Zhao via B4 Relay
2026-08-18 10:39 ` sashiko-bot
2026-08-18 10:31 ` [PATCH v5 07/12] clk: ambarella: add CV75 CCU driver Long Zhao via B4 Relay
2026-08-18 10:46 ` sashiko-bot
2026-08-18 10:31 ` [PATCH v5 08/12] gpio: pl061: add Ambarella CV75 register layout variant Long Zhao via B4 Relay
2026-08-18 10:45 ` sashiko-bot
2026-08-18 10:31 ` [PATCH v5 09/12] pinctrl: ambarella: add CV75 pin controller Long Zhao via B4 Relay
2026-08-18 10:48 ` sashiko-bot [this message]
2026-08-18 10:31 ` [PATCH v5 10/12] serial: 8250: add Ambarella UART driver Long Zhao via B4 Relay
2026-08-18 10:50 ` sashiko-bot
2026-08-18 10:31 ` [PATCH v5 11/12] arm64: ambarella: add ARCH_AMBARELLA and CV75 EVK DT Long Zhao via B4 Relay
2026-08-18 10:49 ` sashiko-bot
2026-08-18 10:31 ` [PATCH v5 12/12] MAINTAINERS: add ARM/AMBARELLA SoC support Long Zhao via B4 Relay
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=20260818104838.7BD6D1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lee@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=longzhao@ambarella.com \
--cc=mfd@lists.linux.dev \
--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