All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vincent Jardin" <vjardin@free.fr>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org,
	linux-hwmon@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v5 1/3] hwmon: pmbus: event notification with alarms
Date: Fri, 24 Jul 2026 00:10:41 +0000	[thread overview]
Message-ID: <20260724001042.5C7F61F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260724-mpq8646_v0-v5-1-5915b5ae9aa2@free.fr>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [High] Using hwmon_notify_event() for PMBus temperature alarms silently fails to notify the thermal subsystem due to an architectural mismatch.

Pre-existing issues:
- [High] pmbus_notify() calls sysfs_notify() on the parent I2C device's kobject instead of the hwmon device, breaking userspace poll() on alarm attributes.
--

--- Patch [1]: [PATCH v5 1/3] hwmon: pmbus: event notification with alarms ---
commit 3c1ad67c1176e741304b7aff4d177996b81ebe1a
Author: Vincent Jardin <vjardin@free.fr>

hwmon: pmbus: event notification with alarms

This patch adds an accessor for the hwmon class device registered by the
pmbus core. It is exported so chip drivers can use it to call
hwmon_notify_event() for alarm attributes in polling fallback routines.

> 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]
Does using hwmon_notify_event() with this device successfully notify the
thermal subsystem?

Looking at how hwmon_notify_event() works, it relies on iterating over the
hwdev->tzdata list:

drivers/hwmon/hwmon.c:hwmon_thermal_notify() {
    ...
    list_for_each_entry(tzdata, &hwdev->tzdata, node) {
        if (tzdata->index == index) {
            thermal_zone_device_update(tzdata->tzd, THERMAL_EVENT_UNSPECIFIED);
        }
    }
    ...
}

Because pmbus_core.c registers the hwmon device using
devm_hwmon_device_register_with_groups() rather than
devm_hwmon_device_register_with_info(), and manually registers thermal zones
via devm_thermal_of_zone_register(), will hwdev->tzdata be empty?

If hwdev->tzdata is unpopulated, will thermal alarms signaled via this new
polling fallback silently fail to trigger the thermal subsystem?


[Severity: High]
This is a pre-existing issue, but does pmbus_notify() currently notify the wrong
kobject when SMBALERT# interrupts do fire?

Looking at pmbus_notify() in drivers/hwmon/pmbus/pmbus_core.c:

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 devm_hwmon_device_register_with_groups() registers the attribute
groups on the newly created hwmon child device (data->hwmon_dev) and not the
parent I2C device (data->dev), and sysfs_notify() does not recurse into
child directories, will userspace applications relying on poll(POLLPRI) for
these alarm attributes fail to wake up?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260724-mpq8646_v0-v5-0-5915b5ae9aa2@free.fr?part=1

  reply	other threads:[~2026-07-24  0:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23 23:55 [PATCH v5 0/3] hwmon: pmbus: add MPS MPQ8646 support Vincent Jardin via B4 Relay
2026-07-23 23:55 ` Vincent Jardin
2026-07-23 23:55 ` [PATCH v5 1/3] hwmon: pmbus: event notification with alarms Vincent Jardin via B4 Relay
2026-07-23 23:55   ` Vincent Jardin
2026-07-24  0:10   ` sashiko-bot [this message]
2026-07-23 23:55 ` [PATCH v5 2/3] dt-bindings: hwmon: pmbus: add MPS MPQ8646 binding Vincent Jardin via B4 Relay
2026-07-23 23:55   ` Vincent Jardin
2026-07-24  0:02   ` sashiko-bot
2026-07-23 23:55 ` [PATCH v5 3/3] hwmon: pmbus: add MPQ8646 driver Vincent Jardin via B4 Relay
2026-07-23 23:55   ` Vincent Jardin
2026-07-24  0:06   ` sashiko-bot
2026-07-24  2:07     ` Guenter Roeck
2026-07-24  2:15   ` 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=20260724001042.5C7F61F000E9@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 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.