From: sashiko-bot@kernel.org
To: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
Cc: conor+dt@kernel.org, dmitry.torokhov@gmail.com,
linux-input@vger.kernel.org, devicetree@vger.kernel.org,
robh@kernel.org
Subject: Re: [PATCH v2 09/11] regulator: wm831x: remove legacy DVS platform data
Date: Thu, 09 Jul 2026 05:10:24 +0000 [thread overview]
Message-ID: <20260709051025.5753E1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260708-samsung-kp-v2-9-3c6ed4c9b3b6@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing error cleanup on DVS initialization failure paths leaves dangling GPIO pointers or unconfigured hardware state, causing silent voltage scaling failures.
--
--- Patch [9]: [PATCH v2 09/11] regulator: wm831x: remove legacy DVS platform data ---
commit 314c31c6b7ec71e1f10af8307e95e6718e0fea28
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
regulator: wm831x: remove legacy DVS platform data
Now that the only board file in mainline using wm831x buckv DVS has been
converted to use software properties, we can remove the unused legacy
DVS fields from 'struct wm831x_buckv_pdata'. Also remove the fallback
logic from the regulator driver, making DVS support purely
property-based when software nodes are used.
> diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c
> index ce43c51c01704..05f49b2f5bade 100644
> --- a/drivers/regulator/wm831x-dcdc.c
> +++ b/drivers/regulator/wm831x-dcdc.c
[ ... ]
> @@ -352,7 +347,7 @@ static void wm831x_buckv_dvs_init(struct platform_device *pdev,
> if (device_property_read_u32(&pdev->dev, "wlf,dvs-init-state", &val) == 0)
> dcdc->dvs_gpio_state = val;
> else
> - dcdc->dvs_gpio_state = pdata->dvs_init_state;
> + dcdc->dvs_gpio_state = 0;
>
> dcdc->dvs_gpiod = devm_gpiod_get(&pdev->dev, "dvs",
> dcdc->dvs_gpio_state ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW);
> @@ -362,10 +357,13 @@ static void wm831x_buckv_dvs_init(struct platform_device *pdev,
> return;
> }
>
> - if (device_property_read_u32(&pdev->dev, "wlf,dvs-control-src", &val) == 0)
> - dvs_control_src = val;
> - else
> - dvs_control_src = pdata->dvs_control_src;
> + ret = device_property_read_u32(&pdev->dev, "wlf,dvs-control-src", &val);
> + if (ret) {
> + dev_err(wm831x->dev, "Failed to read DVS control source for %s: %d\n",
> + dcdc->name, ret);
> + return;
> + }
[Severity: High]
This is a pre-existing issue, but the new error return path here caught my
eye while reviewing.
If initialization fails here (or slightly above when devm_gpiod_get()
returns an error pointer), we return early but don't clear dcdc->dvs_gpiod.
If we fail to read "wlf,dvs-control-src", dcdc->dvs_gpiod is already
successfully populated, but the hardware DVS source is left unconfigured.
If devm_gpiod_get() failed earlier, dcdc->dvs_gpiod holds an error pointer.
In both scenarios, could this cause silent voltage scaling failures later on?
Looking at wm831x_buckv_set_voltage_sel(), there is this check:
wm831x_buckv_set_voltage_sel() {
...
if (dcdc->dvs_gpiod && dcdc->dvs_vsel == vsel)
return wm831x_buckv_set_dvs(rdev, 1);
...
}
Since dcdc->dvs_gpiod is either an error pointer or a valid GPIO (but without
configured hardware), this condition still evaluates to true. Does this skip
updating the hardware on_reg, causing the voltage change to silently fail
and leaving the system at a lower voltage?
Should dcdc->dvs_gpiod be explicitly set to NULL on these error paths so the
driver correctly falls back to standard voltage scaling?
> + dvs_control_src = val;
>
> switch (dvs_control_src) {
> case 1:
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260708-samsung-kp-v2-0-3c6ed4c9b3b6@gmail.com?part=9
next prev parent reply other threads:[~2026-07-09 5:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 4:52 [PATCH v2 00/11] Remove support for platform data from samsung keypad Dmitry Torokhov
2026-07-09 4:52 ` [PATCH v2 01/11] dt-bindings: input: samsung,s3c6410-keypad: introduce compact binding Dmitry Torokhov
2026-07-09 5:05 ` sashiko-bot
2026-07-09 17:56 ` Conor Dooley
2026-07-09 4:53 ` [PATCH v2 02/11] Input: samsung-keypad - handle " Dmitry Torokhov
2026-07-09 5:06 ` sashiko-bot
2026-07-09 4:53 ` [PATCH v2 03/11] ARM: s3c: register and attach software nodes for Samsung gpio_chips Dmitry Torokhov
2026-07-09 4:53 ` [PATCH v2 04/11] ARM: s3c: crag6410: switch keypad device to software properties Dmitry Torokhov
2026-07-09 5:09 ` sashiko-bot
2026-07-09 4:53 ` [PATCH v2 05/11] Input: samsung-keypad - remove support for platform data Dmitry Torokhov
2026-07-09 5:04 ` sashiko-bot
2026-07-09 4:53 ` [PATCH v2 06/11] ARM: s3c: crag6410: use software nodes/properties to set up GPIO keys Dmitry Torokhov
2026-07-09 4:53 ` [PATCH v2 07/11] regulator: wm831x: support software node in platform data Dmitry Torokhov
2026-07-09 5:03 ` sashiko-bot
2026-07-09 4:53 ` [PATCH v2 08/11] ARM: s3c: crag6410: convert PMIC to software properties Dmitry Torokhov
2026-07-09 4:53 ` [PATCH v2 09/11] regulator: wm831x: remove legacy DVS platform data Dmitry Torokhov
2026-07-09 5:10 ` sashiko-bot [this message]
2026-07-09 4:53 ` [PATCH v2 10/11] ARM: s3c: crag6410: convert remaining GPIO lookup tables to property entries Dmitry Torokhov
2026-07-09 4:53 ` [PATCH v2 11/11] ARM: s3c: crag6410: convert basic-mmio-gpio and LEDs to software properties Dmitry Torokhov
2026-07-09 8:10 ` [PATCH v2 00/11] Remove support for platform data from samsung keypad Bartosz Golaszewski
2026-07-10 19:41 ` Linus Walleij
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=20260709051025.5753E1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@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