Linux clock framework development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jisheng Zhang" <jszhang@kernel.org>
Cc: devicetree@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-gpio@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 07/13] reset: add Synaptics SL2610 reset controller support
Date: Sun, 15 Nov 2026 11:12:21 +0000	[thread overview]
Message-ID: <sashiko-outbox-215444@kernel.org> (raw)
In-Reply-To: <20261115102401.3520-8-jszhang@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] reset: sl2610: wrong errno in sl2610_reset_assert() and
  deassert()
--

commit fd9868407ed20a422bf28d62579da17aa23dc9fc
Author: Jisheng Zhang <jszhang@kernel.org>

reset: add Synaptics SL2610 reset controller support

This commit adds a reset controller driver for the SoC and MCU system
control blocks on Synaptics SL2610 SoCs, supporting both pulse and sticky
reset lines.

> diff --git a/drivers/reset/reset-sl2610.c b/drivers/reset/reset-sl2610.c
> new file mode 100644
> index 0000000000000..1ca58d5a3e713
> --- /dev/null
> +++ b/drivers/reset/reset-sl2610.c
[ ... ]
> +static int sl2610_reset_assert(struct reset_controller_dev *rcdev,
> +			       unsigned long id)
> +{
> +	struct sl2610_reset_priv *priv = to_sl2610_reset_priv(rcdev);
> +	const struct sl2610_reset_cfg *cfg = &priv->cfgs[id];
> +
> +	if (!cfg->sticky)
> +		return -EINVAL;
> +
> +	return regmap_clear_bits(priv->regmap, cfg->reg, cfg->bit);
> +}
> +
> +static int sl2610_reset_deassert(struct reset_controller_dev *rcdev,
> +				 unsigned long id)
> +{
> +	struct sl2610_reset_priv *priv = to_sl2610_reset_priv(rcdev);
> +	const struct sl2610_reset_cfg *cfg = &priv->cfgs[id];
> +
> +	if (!cfg->sticky)
> +		return -EINVAL;
> +
> +	return regmap_set_bits(priv->regmap, cfg->reg, cfg->bit);
> +}

[Severity: Medium]
Should sl2610_reset_assert() and sl2610_reset_deassert() return -ENOTSUPP
(or 0 in sl2610_reset_deassert()) instead of -EINVAL when !cfg->sticky?

In drivers/reset/core.c, reset_control_deassert() treats self-deasserting
pulse reset lines as deasserted by default when .deassert() is not
implemented, and documents that .deassert() should return -ENOTSUPP when
deassertion cannot be guaranteed:

drivers/reset/core.c:reset_control_deassert() {
	...
	/*
	 * If the reset controller does not implement .deassert(), we assume
	 * that it handles self-deasserting reset lines via .reset(). In that
	 * case, the reset lines are deasserted by default. If that is not the
	 * case, the reset controller driver should implement .deassert() and
	 * return -ENOTSUPP.
	 */
	if (!rcdev->ops->deassert)
		return 0;
	...
}

Because this controller implements .assert() and .deassert() for its
sticky lines, returning -EINVAL for the 22 pulse reset lines in
sl2610_reset_cfgs[] causes consumer drivers that call
reset_control_deassert() during probe (such as 8250_dw) to fail probe, and
prevents consumers such as stmmac_dvr_probe() from checking for -ENOTSUPP
on reset_control_assert() and falling back to reset_control_reset().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261115102401.3520-1-jszhang@kernel.org?part=7

  reply	other threads:[~2026-11-15 11:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15 10:23 [PATCH v2 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
2026-11-15 10:23 ` [PATCH v2 01/13] arm64: kconfig: let ARCH_BERLIN cover Synaptics arm64 SoCs Jisheng Zhang
2026-11-15 10:23 ` [PATCH v2 02/13] pinctrl: berlin: use u16 instead of u8 for the offset Jisheng Zhang
2026-11-15 10:23 ` [PATCH v2 03/13] pinctrl: berlin: enable module build support Jisheng Zhang
2026-11-15 10:58   ` sashiko-bot
2026-11-15 10:23 ` [PATCH v2 04/13] pinctrl: berlin: add optional pinconf support Jisheng Zhang
2026-11-15 11:01   ` sashiko-bot
2026-11-15 10:23 ` [PATCH v2 05/13] dt-bindings: soc: synaptics: add SL2610 system controllers Jisheng Zhang
2026-11-15 10:58   ` sashiko-bot
2026-11-15 10:23 ` [PATCH v2 06/13] soc: synaptics: add SL2610 system controller support Jisheng Zhang
2026-11-15 10:56   ` sashiko-bot
2026-11-15 10:23 ` [PATCH v2 07/13] reset: add Synaptics SL2610 reset " Jisheng Zhang
2026-11-15 11:12   ` sashiko-bot [this message]
2026-11-15 10:23 ` [PATCH v2 08/13] pinctrl: berlin: add Synaptics SL2610 pin " Jisheng Zhang
2026-11-15 10:57   ` sashiko-bot
2026-11-15 10:23 ` [PATCH v2 09/13] clk: berlin: add Synaptics clock controller helpers Jisheng Zhang
2026-11-15 11:05   ` sashiko-bot
2026-11-15 10:23 ` [PATCH v2 10/13] clk: berlin: add Synaptics SL2610 clocks and PLLs Jisheng Zhang
2026-11-15 11:04   ` sashiko-bot
2026-11-15 10:23 ` [PATCH v2 11/13] dt-bindings: arm: berlin: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
2026-11-15 10:23 ` [PATCH v2 12/13] arm64: dts: synaptics: add SL2610 family SoCs Jisheng Zhang
2026-11-15 11:13   ` sashiko-bot
2026-11-15 10:23 ` [PATCH v2 13/13] arm64: dts: synaptics: add SL2610 family RDK boards Jisheng Zhang
2026-11-15 11:05   ` 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=sashiko-outbox-215444@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jszhang@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@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