Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Guenter Roeck" <linux@roeck-us.net>,
	"Hardware Monitoring" <linux-hwmon@vger.kernel.org>
Subject: Re: [PATCH] hwmon: Use per-device lockdep keys
Date: Mon, 16 Nov 2026 00:50:52 +0000	[thread overview]
Message-ID: <sashiko-outbox-215972@kernel.org> (raw)
In-Reply-To: <20261116004209.2570779-1-linux@roeck-us.net>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] hwmon: missing Fixes: trailer for lockdep false-positive fix
--

commit 4d05c24302d1083670a8cf3177a400690315c5c3
Author: Guenter Roeck <linux@roeck-us.net>

> hwmon: Use per-device lockdep keys
>
> Currently, mutex_init(&hwdev->lock) in __hwmon_device_register() assigns
> a single static lockdep key to all hardware monitoring device locks. If
> one hardware monitoring device accesses another hardware monitoring
> device (for example, pwm-fan controlling a PWM output provided by
> adt7470), lockdep sees two instances of the same lock class acquired in
> sequence and reports a false-positive recursive locking warning.
>
> Give each struct hwmon_device its own dynamic struct lock_class_key,
> registered via lockdep_register_key() and initialized with
> mutex_init_with_key() before any error path that calls
> hwmon_dev_release(), and cleaned up with mutex_destroy() and
> lockdep_unregister_key() in hwmon_dev_release(). This allows nested
> locking across distinct hwmon devices while preserving full lockdep
> deadlock and self-recursion detection.
>
> Cc: Davíð Steinn Geirsson <david@dsg.is>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

[Severity: Low]
Since this fixes the false-positive lockdep warning introduced with
hwdev->lock, should it include a Fixes tag?

  Fixes: 3ad2a7b9b15d ("hwmon: Serialize accesses in hwmon core")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261116004209.2570779-1-linux@roeck-us.net?part=1

      reply	other threads:[~2026-11-16  0:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  0:42 [PATCH] hwmon: Use per-device lockdep keys Guenter Roeck
2026-11-16  0:50 ` 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=sashiko-outbox-215972@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --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