From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Poosa, Karthik" <karthik.poosa@intel.com>
Cc: <sashiko-reviews@lists.linux.dev>, <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v13 03/16] drm/xe/hwmon: Fix thermal sensor data handling
Date: Wed, 14 Oct 2026 13:49:03 -0400 [thread overview]
Message-ID: <as_AjwYamf1whGCy@intel.com> (raw)
In-Reply-To: <bcaceb82-a306-482b-875d-237e43e24644@intel.com>
On Wed, Oct 14, 2026 at 07:12:07PM +0530, Poosa, Karthik wrote:
>
> On 14-10-2026 17:46, sashiko-bot@kernel.org wrote:
> > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> > - [Low] hwmon: Subsystem API Violation - Driver uses private custom mutex instead of hwmon_lock()
> > --
> >
> > commit 5b607ffd1e7d970e08aa24f25b6f029c27e76b6d
> > Author: Karthik Poosa <karthik.poosa@intel.com>
> >
> > drm/xe/hwmon: Fix thermal sensor data handling
> >
> > This commit reads required thermal groups in get_mc_temp() and stores them
> > in a dword-aligned buffer, avoiding unaligned pcode accesses. It also stores
> > the pcode thermal data and thermal limit words as little-endian.
> >
> > > diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
> > > index 382bf9625a8bd..1b4efbf4ac999 100644
> > > --- a/drivers/gpu/drm/xe/xe_hwmon.c
> > > +++ b/drivers/gpu/drm/xe/xe_hwmon.c
> > [ ... ]
> > > @@ -840,16 +845,20 @@ static int mbx_temp_decode(u8 value)
> > > static int get_mc_temp(struct xe_hwmon *hwmon, long *val)
> > > {
> > > struct xe_tile *root_tile = xe_device_get_root_tile(hwmon->xe);
> > > - u32 *dword = (u32 *)hwmon->temp.value;
> > > s32 average = 0;
> > > int ret, i;
> > > - for (i = 0; i < DIV_ROUND_UP(TEMP_LIMIT_MAX, sizeof(u32)); i++) {
> > > + guard(mutex)(&hwmon->hwmon_lock);
> > [Severity: Low]
> > Does this violate the hardware monitoring subsystem locking requirements?
> >
> > The hwmon subsystem documentation states that drivers implementing locking
> > required for interrupt handling or for attributes registered by any other
> > means must use the hwmon_lock() and hwmon_unlock() APIs.
> >
> > Can we use the hwmon subsystem's locking API here instead of the
> > driver-specific hwmon_lock mutex?
>
> The mutex here protects driver-internal concurrent accesses and does not
> provide synchronization required by the hwmon core callbacks.
>
> Therefore, I don't believe this falls under the case requiring hwmon_lock()
> / hwmon_unlock().
>
> @rodrigo, can you share your comment on this.
that's right. we need to protect our data, nor take care of any synchronization...
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
> > > +
> > > + for (i = 0; i < DIV_ROUND_UP(hwmon->temp.count, sizeof(u32)); i++) {
next prev parent reply other threads:[~2026-10-14 17:49 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 11:57 [PATCH v13 00/16] drm/xe/hwmon: Update hwmon thermal mailbox Karthik Poosa
2026-10-14 11:57 ` [PATCH v13 01/16] drm/xe/hwmon: Fix pcode power limit handling Karthik Poosa
2026-10-14 17:46 ` Rodrigo Vivi
2026-10-14 11:57 ` [PATCH v13 02/16] drm/xe/hwmon: Decode mailbox temperature as sign-magnitude Karthik Poosa
2026-10-14 11:57 ` [PATCH v13 03/16] drm/xe/hwmon: Fix thermal sensor data handling Karthik Poosa
2026-10-14 12:16 ` sashiko-bot
2026-10-14 13:42 ` Poosa, Karthik
2026-10-14 17:49 ` Rodrigo Vivi [this message]
2026-10-14 11:57 ` [PATCH v13 04/16] drm/xe/hwmon: Add helpers to validate thermal sensor readings Karthik Poosa
2026-10-14 12:11 ` sashiko-bot
2026-10-14 13:17 ` Poosa, Karthik
2026-10-14 17:51 ` Rodrigo Vivi
2026-10-14 11:57 ` [PATCH v13 05/16] drm/xe/hwmon: Handle unavailable memory controller sensors Karthik Poosa
2026-10-14 11:57 ` [PATCH v13 06/16] drm/xe/hwmon: Detect unavailable PCIe thermal sensors Karthik Poosa
2026-10-14 11:57 ` [PATCH v13 07/16] drm/xe/hwmon: Consolidate temperature sensor availability checks Karthik Poosa
2026-10-14 11:57 ` [PATCH v13 08/16] drm/xe/hwmon: Cache temperature availability to reduce probe time Karthik Poosa
2026-10-14 11:57 ` [PATCH v13 09/16] drm/xe/hwmon: use CRI-specific package and VRAM temperature registers Karthik Poosa
2026-10-14 11:58 ` [PATCH v13 10/16] drm/xe/hwmon: Add platform-aware VRAM thermal channel support Karthik Poosa
2026-10-14 11:58 ` [PATCH v13 11/16] drm/xe/hwmon: Decode CRI temperature registers as IEEE-754 Karthik Poosa
2026-10-14 17:53 ` Rodrigo Vivi
2026-10-14 11:58 ` [PATCH v13 12/16] drm/xe/hwmon: Update memory controller temperature offset for CRI Karthik Poosa
2026-10-14 17:52 ` Rodrigo Vivi
2026-10-14 19:33 ` Poosa, Karthik
2026-10-14 20:01 ` Rodrigo Vivi
2026-10-14 11:58 ` [PATCH v13 13/16] drm/xe/hwmon: add PCIe temperature support " Karthik Poosa
2026-10-14 11:58 ` [PATCH v13 14/16] drm/xe/hwmon: Simplify temperature channels config Karthik Poosa
2026-10-14 11:58 ` [PATCH v13 15/16] drm/xe: Validate thermal sensor count before reads Karthik Poosa
2026-10-14 17:53 ` Rodrigo Vivi
2026-10-14 11:58 ` [PATCH v13 16/16] drm/xe/hwmon: Propagate all hardware read errors Karthik Poosa
2026-10-14 12:12 ` ✓ CI.KUnit: success for drm/xe/hwmon: Update hwmon thermal mailbox Patchwork
2026-10-14 18:40 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-15 5:28 ` ✓ Xe.CI.FULL: " Patchwork
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=as_AjwYamf1whGCy@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=karthik.poosa@intel.com \
--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.