Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Karthik Poosa <karthik.poosa@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: rodrigo.vivi@intel.com, anshuman.gupta@intel.com,
	badal.nilawar@intel.com, raag.jadav@intel.com,
	riana.tauro@intel.com, sk.anirban@intel.com,
	mallesh.koujalagi@intel.com, soham.purkait@intel.com,
	Karthik Poosa <karthik.poosa@intel.com>
Subject: [PATCH v2 3/5] drm/xe/hwmon: Correct group selection for memory controller temperature
Date: Wed,  2 Sep 2026 23:25:05 +0530	[thread overview]
Message-ID: <20260902175507.3910573-4-karthik.poosa@intel.com> (raw)
In-Reply-To: <20260902175507.3910573-1-karthik.poosa@intel.com>

Read all the necessary groups when reading memory controller
temperature in get_mc_temp().

Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
Fixes: 3a0cb885e111 ("drm/xe/hwmon: Expose memory controller temperature")
---

v2:
 - Address review comment from sashiko.
 - Change the hwmon->temp.value[] size from U8_MAX to U8_MAX+1.

 drivers/gpu/drm/xe/xe_hwmon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
index a7c04c25e1c2..2a5d91fa3afa 100644
--- a/drivers/gpu/drm/xe/xe_hwmon.c
+++ b/drivers/gpu/drm/xe/xe_hwmon.c
@@ -149,7 +149,7 @@ struct xe_hwmon_thermal_info {
 	/** @vram_count: number of VRAM temperature sensors available for the platform */
 	u8 vram_count;
 	/** @value: signed value from each sensor */
-	s8 value[U8_MAX];
+	s8 value[U8_MAX + 1];
 	/** @vram_label: vram label names, dynamically allocated based on vram_count */
 	char (*vram_label)[MAX_LABEL_SIZE];
 };
@@ -907,7 +907,7 @@ static int get_mc_temp(struct xe_hwmon *hwmon, long *val)
 	int ret, i, count = 0;
 	s32 average = 0;
 
-	for (i = 0; i < DIV_ROUND_UP(TEMP_LIMIT_MAX, sizeof(u32)); i++) {
+	for (i = 0; i < DIV_ROUND_UP(hwmon->temp.count, sizeof(u32)); i++) {
 		ret = xe_pcode_read(root_tile, PCODE_MBOX(PCODE_THERMAL_INFO, READ_THERMAL_DATA, i),
 				    (dword + i), NULL);
 		if (ret)
-- 
2.25.1


  parent reply	other threads:[~2026-09-02 17:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 17:55 [PATCH v2 0/5] drm/xe/hwmon: Update hwmon thermal mailbox handling Karthik Poosa
2026-09-02 17:55 ` [PATCH v2 1/5] drm/xe/hwmon: Detect unavailable temperature sensors Karthik Poosa
2026-09-02 17:55 ` [PATCH v2 2/5] drm/xe/hwmon: Use VRAM temperature sensor count from thermal config on CRI Karthik Poosa
2026-09-02 18:10   ` sashiko-bot
2026-09-02 18:43   ` Rodrigo Vivi
2026-09-02 17:55 ` Karthik Poosa [this message]
2026-09-02 18:17   ` [PATCH v2 3/5] drm/xe/hwmon: Correct group selection for memory controller temperature sashiko-bot
2026-09-02 17:55 ` [PATCH v2 4/5] drm/xe/hwmon: Decode CRI temperature registers as IEEE-754 Karthik Poosa
2026-09-02 18:08   ` sashiko-bot
2026-09-02 17:55 ` [PATCH v2 5/5] drm/xe/hwmon: Disable memory controller and PCIe temperatures on CRI Karthik Poosa
2026-09-02 18:07   ` sashiko-bot
2026-09-03  6:11     ` Poosa, Karthik
2026-09-02 18:28 ` ✓ CI.KUnit: success for drm/xe/hwmon: Update hwmon thermal mailbox handling (rev2) Patchwork
2026-09-02 19:22 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-09-03  9:37 ` ✗ 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=20260902175507.3910573-4-karthik.poosa@intel.com \
    --to=karthik.poosa@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=mallesh.koujalagi@intel.com \
    --cc=raag.jadav@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=sk.anirban@intel.com \
    --cc=soham.purkait@intel.com \
    /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