From: sashiko-bot@kernel.org
To: "Victor Krawiec" <victor.krawiec@arturia.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 4/4] regulator: fan53555: Add support for mode operations on Silergy devices
Date: Thu, 23 Jul 2026 09:51:26 +0000 [thread overview]
Message-ID: <20260723095126.EA6EE1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260723094001.120264-5-victor.krawiec@arturia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The function `fan53555_set_mode` unconditionally returns 0 and ignores the error return value from `regmap_update_bits`, falsely informing the regulator core that mode changes were successful even when underlying I2C transfers fail.
--
--- Patch [4]: [PATCH v3 4/4] regulator: fan53555: Add support for mode operations on Silergy devices ---
commit 0810cb3eb74c80e6af381ca179af7f69456b49a8
Author: Victor Krawiec <victor.krawiec@arturia.com>
regulator: fan53555: Add support for mode operations on Silergy devices
Make the PWM mode configurable from devicetree. Some boards require forced
PWM mode to keep the supply ripple within acceptable limits under light
load conditions
Support is restricted to Silergy manufacturer as it is the only one
currently tested.
> diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
> index c282236959b18..85f46874eb49d 100644
> --- a/drivers/regulator/fan53555.c
> +++ b/drivers/regulator/fan53555.c
[ ... ]
> @@ -389,6 +390,18 @@ static int rk8602_voltages_setup_rockchip(struct fan53555_device_info *di)
> return 0;
> }
>
> +static inline unsigned int fan53555_map_mode(unsigned int mode)
> +{
> + switch (mode) {
> + case FAN53555_REGULATOR_MODE_FORCE_PWM:
> + return REGULATOR_MODE_FAST;
> + case FAN53555_REGULATOR_MODE_AUTO:
> + return REGULATOR_MODE_NORMAL;
> + default:
> + return REGULATOR_MODE_INVALID;
> + }
> +}
> +
[Severity: High]
This is a pre-existing issue, but since this patch enables setting the
mode from the device tree via fan53555_map_mode(), should fan53555_set_mode()
check the return value of regmap_update_bits()?
Looking at fan53555_set_mode() in drivers/regulator/fan53555.c, it
unconditionally returns 0 and ignores the error return value from
regmap_update_bits():
drivers/regulator/fan53555.c:fan53555_set_mode() {
...
switch (mode) {
case REGULATOR_MODE_FAST:
regmap_update_bits(rdev->regmap, di->mode_reg,
di->mode_mask, di->mode_mask);
break;
case REGULATOR_MODE_NORMAL:
regmap_update_bits(rdev->regmap, di->vol_reg, di->mode_mask, 0);
break;
default:
return -EINVAL;
}
return 0;
}
If an I2C transfer fails here, the regulator hardware could remain in
auto mode while the kernel core falsely believes it was successfully set to
forced PWM mode. Could this lead to the unacceptable voltage ripple under
light load conditions mentioned in the commit message?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260723094001.120264-1-victor.krawiec@arturia.com?part=4
prev parent reply other threads:[~2026-07-23 9:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 9:39 [PATCH v3 0/4] Configure SYR82X regulator modes via device tree Victor Krawiec
2026-07-23 9:39 ` [PATCH v3 1/4] regulator: dt-bindings: Add fan53555 allowed modes Victor Krawiec
2026-07-23 9:53 ` sashiko-bot
2026-07-23 9:39 ` [PATCH v3 2/4] arm64: dts: rk3399-rock-4c-plus: Use device tree bindings constants for SYR828 regulator initial mode Victor Krawiec
2026-07-23 9:40 ` [PATCH v3 3/4] arm64: dts: rockchip: rk3399-hugsun-x99: Update SYR828 regulator initial mode to use device tree bindings constants Victor Krawiec
2026-07-23 9:40 ` [PATCH v3 4/4] regulator: fan53555: Add support for mode operations on Silergy devices Victor Krawiec
2026-07-23 9:51 ` sashiko-bot [this message]
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=20260723095126.EA6EE1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=victor.krawiec@arturia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox