All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alexis Czezar Torreno" <alexisczezar.torreno@analog.com>
Cc: linux-hwmon@vger.kernel.org, conor+dt@kernel.org,
	devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v5 2/4] hwmon: (pmbus/max20830): add VOUT feedback resistor scaling support
Date: Thu, 30 Jul 2026 01:14:57 +0000	[thread overview]
Message-ID: <20260730011458.525861F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260730-dev-max20830c-v5-2-a7553f84ee74@analog.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Returning -ENODATA does not mask unsupported PMBus limit registers, incorrectly exposing unscaled limit attributes if the hardware responds.
--

--- Patch [2]: [PATCH v5 2/4] hwmon: (pmbus/max20830): add VOUT feedback resistor scaling support ---
commit 852e7cf36da1bb5ec1c29eff09bb747755762b5b
Author: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>

hwmon: (pmbus/max20830): add VOUT feedback resistor scaling support

This commit adds support for external voltage divider scaling in the max20830 
driver. It reads resistor values from device tree properties and applies a 
scaling formula to VOUT readings to report the actual output voltage.

> diff --git a/drivers/hwmon/pmbus/max20830.c b/drivers/hwmon/pmbus/max20830.c
> --- a/drivers/hwmon/pmbus/max20830.c
> +++ b/drivers/hwmon/pmbus/max20830.c
[ ... ]
> @@ -14,6 +15,56 @@
[ ... ]
> +static int max20830_read_word_data(struct i2c_client *client, int page,
> +				   int phase, int reg)
> +{
> +	const struct pmbus_driver_info *info = pmbus_get_driver_info(client);
> +	const struct max20830_data *data = container_of(info, struct max20830_data, info);
> +	int ret;
> +	u64 temp;
> +
> +	switch (reg) {
> +	case PMBUS_READ_VOUT:
[ ... ]
> +		return ret;
> +	default:
> +		return -ENODATA;

[Severity: Medium]
Does returning -ENODATA here actually mask the unsupported limit registers as
intended?

In the PMBus core framework, returning -ENODATA from the driver's read
callback is treated as a signal to fall back to a standard I2C read. It
does not block the attribute.

If the hardware responds to the limit register reads over standard I2C, the
PMBus core will still create the sysfs attributes. Because scaling is only
applied to PMBUS_READ_VOUT in this patch, these exposed limit attributes
(e.g., in1_max) would report raw, unscaled feedback voltages, while in1_input
reports scaled actual voltages, creating an inconsistent interface.

Should this return -ENXIO instead, which explicitly tells the PMBus core that
the register is unsupported and prevents the sysfs attributes from being
created?

> +	}
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260730-dev-max20830c-v5-0-a7553f84ee74@analog.com?part=2

  reply	other threads:[~2026-07-30  1:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30  1:03 [PATCH v5 0/4] Add support for MAX20830C and MAX20840C step-down DC-DC switching regulator Alexis Czezar Torreno
2026-07-30  1:03 ` [PATCH v5 1/4] dt-bindings: hwmon: (pmbus/max20830): add VOUT feedback resistor properties and complete examples Alexis Czezar Torreno
2026-07-30  1:10   ` sashiko-bot
2026-07-30  2:36   ` Guenter Roeck
2026-07-30  1:03 ` [PATCH v5 2/4] hwmon: (pmbus/max20830): add VOUT feedback resistor scaling support Alexis Czezar Torreno
2026-07-30  1:14   ` sashiko-bot [this message]
2026-07-30  2:33     ` Guenter Roeck
2026-07-30  2:40   ` Guenter Roeck
2026-07-30  1:03 ` [PATCH v5 3/4] dt-bindings: hwmon: (pmbus/max20830): add max20830c and max20840c support Alexis Czezar Torreno
2026-07-30  1:11   ` sashiko-bot
2026-07-30  2:41   ` Guenter Roeck
2026-07-30  1:03 ` [PATCH v5 4/4] hwmon: (pmbus/max20830): add support for max20830c and max20840c Alexis Czezar Torreno
2026-07-30  1:14   ` sashiko-bot
2026-07-30  2:35     ` Guenter Roeck
2026-07-30  2:42   ` Guenter Roeck

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=20260730011458.525861F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alexisczezar.torreno@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-hwmon@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.