From: sashiko-bot@kernel.org
To: "Vincent Jardin" <vjardin@free.fr>
Cc: linux-hwmon@vger.kernel.org, robh@kernel.org,
devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 1/3] hwmon: pmbus: event notification with alarms
Date: Thu, 23 Jul 2026 13:13:22 +0000 [thread overview]
Message-ID: <20260723131352.182B61F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260723-mpq8646_v0-v1-1-14363c75916f@free.fr>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] PMBus core's pmbus_notify() calls sysfs_notify() on the wrong kobject, silently breaking sysfs poll() and udev events for hardware alarms.
--
--- Patch [1]: [PATCH 1/3] hwmon: pmbus: event notification with alarms ---
commit 2d27260577dbfaf59cc5dfe956f36d8429cbffb8
Author: Vincent Jardin <vjardin@free.fr>
hwmon: pmbus: event notification with alarms
This commit introduces pmbus_get_hwmon_device() to allow PMBus chip drivers
to retrieve the hwmon class device for an i2c_client. This enables drivers
to call hwmon_notify_event() on per-sensor alarm attributes during work-item
polling when SMBALERT# is unavailable.
> diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
> index 3143b9e0316c4..6ba00ad732973 100644
> --- a/drivers/hwmon/pmbus/pmbus_core.c
> +++ b/drivers/hwmon/pmbus/pmbus_core.c
[ ... ]
> @@ -695,6 +695,14 @@ const struct pmbus_driver_info *pmbus_get_driver_info(struct i2c_client *client)
> }
> EXPORT_SYMBOL_NS_GPL(pmbus_get_driver_info, "PMBUS");
>
> +struct device *pmbus_get_hwmon_device(struct i2c_client *client)
> +{
> + struct pmbus_data *data = i2c_get_clientdata(client);
> +
> + return data->hwmon_dev;
> +}
> +EXPORT_SYMBOL_NS_GPL(pmbus_get_hwmon_device, "PMBUS");
> +
[Severity: High]
This is a pre-existing issue, but while looking at how hwmon devices are
exposed for alarm notification, I noticed that pmbus_notify() might be
sending notifications to the wrong kobject:
drivers/hwmon/pmbus/pmbus_core.c:pmbus_notify() {
...
sysfs_notify(&data->dev->kobj, NULL, da->attr.name);
kobject_uevent(&data->dev->kobj, KOBJ_CHANGE);
...
}
Since the hwmon attributes are attached to the hwmon device rather than the
parent I2C device, does sysfs_notify() fail to find the attribute and return
silently?
If so, this could prevent userspace processes polling on hardware alarm sysfs
attributes from being awakened when a hardware fault occurs, leaving alarms
unhandled.
Would it make sense to update pmbus_notify() to use data->hwmon_dev->kobj
instead to ensure poll() and udev events work correctly?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260723-mpq8646_v0-v1-0-14363c75916f@free.fr?part=1
next prev parent reply other threads:[~2026-07-23 13:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 13:02 [PATCH 0/3] hwmon: pmbus: add MPS MPQ8646 support Vincent Jardin via B4 Relay
2026-07-23 13:02 ` [PATCH 1/3] hwmon: pmbus: event notification with alarms Vincent Jardin via B4 Relay
2026-07-23 13:13 ` sashiko-bot [this message]
2026-07-23 14:28 ` Vincent Jardin
2026-07-23 15:15 ` Vincent Jardin
2026-07-23 13:02 ` [PATCH 2/3] dt-bindings: hwmon: pmbus: add MPS MPQ8646 binding Vincent Jardin via B4 Relay
2026-07-23 13:10 ` sashiko-bot
2026-07-23 14:30 ` Vincent Jardin
2026-07-23 13:02 ` [PATCH 3/3] hwmon: pmbus: add MPQ8646 driver Vincent Jardin via B4 Relay
2026-07-23 13:19 ` sashiko-bot
2026-07-23 14:42 ` Vincent Jardin
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=20260723131352.182B61F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--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 \
--cc=vjardin@free.fr \
/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