* [PATCH] drm/xe/hwmon: Enable energy attributes for CRI
@ 2026-03-10 12:20 Karthik Poosa
2026-03-10 15:06 ` ✗ CI.KUnit: failure for " Patchwork
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Karthik Poosa @ 2026-03-10 12:20 UTC (permalink / raw)
To: intel-xe
Cc: anshuman.gupta, badal.nilawar, rodrigo.vivi, raag.jadav,
riana.tauro, Karthik Poosa
Enable HWMON energy attributes for CRI which is available through
MMIO registers.
Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
---
drivers/gpu/drm/xe/regs/xe_pcode_regs.h | 3 +++
drivers/gpu/drm/xe/xe_hwmon.c | 7 ++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/regs/xe_pcode_regs.h b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h
index 4b3c46eb858f..c63b409d7a82 100644
--- a/drivers/gpu/drm/xe/regs/xe_pcode_regs.h
+++ b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h
@@ -27,4 +27,7 @@
#define TEMP_SIGN_MASK REG_BIT(31)
#define BMG_PACKAGE_TEMPERATURE XE_REG(0x138434)
+#define CRI_PACKAGE_ENERGY_STATUS XE_REG(0x138120)
+#define CRI_PLATFORM_ENERGY_STATUS XE_REG(0x138458)
+
#endif /* _XE_PCODE_REGS_H_ */
diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
index 0fd4d4f1014a..852681bdb84c 100644
--- a/drivers/gpu/drm/xe/xe_hwmon.c
+++ b/drivers/gpu/drm/xe/xe_hwmon.c
@@ -296,7 +296,12 @@ static struct xe_reg xe_hwmon_get_reg(struct xe_hwmon *hwmon, enum xe_hwmon_reg
return GT_PERF_STATUS;
break;
case REG_PKG_ENERGY_STATUS:
- if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG) {
+ if (xe->info.platform == XE_CRESCENTISLAND) {
+ if (channel == CHANNEL_CARD)
+ return CRI_PLATFORM_ENERGY_STATUS;
+ else if (channel == CHANNEL_PKG)
+ return CRI_PACKAGE_ENERGY_STATUS;
+ } else if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG) {
return PVC_GT0_PLATFORM_ENERGY_STATUS;
} else if ((xe->info.platform == XE_DG2) && (channel == CHANNEL_PKG)) {
return PCU_CR_PACKAGE_ENERGY_STATUS;
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* ✗ CI.KUnit: failure for drm/xe/hwmon: Enable energy attributes for CRI 2026-03-10 12:20 [PATCH] drm/xe/hwmon: Enable energy attributes for CRI Karthik Poosa @ 2026-03-10 15:06 ` Patchwork 2026-03-11 7:20 ` [PATCH] " Gupta, Anshuman 2026-03-17 4:32 ` Purkait, Soham 2 siblings, 0 replies; 6+ messages in thread From: Patchwork @ 2026-03-10 15:06 UTC (permalink / raw) To: Karthik Poosa; +Cc: intel-xe == Series Details == Series: drm/xe/hwmon: Enable energy attributes for CRI URL : https://patchwork.freedesktop.org/series/162951/ State : failure == Summary == + trap cleanup EXIT + /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig ERROR:root:../drivers/gpu/drm/xe/xe_lrc.c: In function ‘xe_lrc_ctx_init’: ../drivers/gpu/drm/xe/xe_lrc.c:1554:43: error: implicit declaration of function ‘_MASKED_BIT_ENABLE’; did you mean ‘REG_MASKED_FIELD_ENABLE’? [-Werror=implicit-function-declaration] 1554 | state_cache_perf_fix[2] = _MASKED_BIT_ENABLE(DISABLE_STATE_CACHE_PERF_FIX); | ^~~~~~~~~~~~~~~~~~ | REG_MASKED_FIELD_ENABLE cc1: some warnings being treated as errors make[7]: *** [../scripts/Makefile.build:289: drivers/gpu/drm/xe/xe_lrc.o] Error 1 make[7]: *** Waiting for unfinished jobs.... make[6]: *** [../scripts/Makefile.build:548: drivers/gpu/drm/xe] Error 2 make[5]: *** [../scripts/Makefile.build:548: drivers/gpu/drm] Error 2 make[4]: *** [../scripts/Makefile.build:548: drivers/gpu] Error 2 make[3]: *** [../scripts/Makefile.build:548: drivers] Error 2 make[2]: *** [/kernel/Makefile:2101: .] Error 2 make[1]: *** [/kernel/Makefile:248: __sub-make] Error 2 make: *** [Makefile:248: __sub-make] Error 2 [15:05:31] Configuring KUnit Kernel ... Generating .config ... Populating config with: $ make ARCH=um O=.kunit olddefconfig [15:05:35] Building KUnit Kernel ... Populating config with: $ make ARCH=um O=.kunit olddefconfig Building with: $ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=25 + cleanup ++ stat -c %u:%g /kernel + chown -R 1003:1003 /kernel ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] drm/xe/hwmon: Enable energy attributes for CRI 2026-03-10 12:20 [PATCH] drm/xe/hwmon: Enable energy attributes for CRI Karthik Poosa 2026-03-10 15:06 ` ✗ CI.KUnit: failure for " Patchwork @ 2026-03-11 7:20 ` Gupta, Anshuman 2026-03-17 4:32 ` Purkait, Soham 2 siblings, 0 replies; 6+ messages in thread From: Gupta, Anshuman @ 2026-03-11 7:20 UTC (permalink / raw) To: Poosa, Karthik, intel-xe@lists.freedesktop.org Cc: Nilawar, Badal, Vivi, Rodrigo, Jadav, Raag, Tauro, Riana > -----Original Message----- > From: Poosa, Karthik <karthik.poosa@intel.com> > Sent: Tuesday, March 10, 2026 5:50 PM > To: intel-xe@lists.freedesktop.org > Cc: Gupta, Anshuman <anshuman.gupta@intel.com>; Nilawar, Badal > <badal.nilawar@intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com>; Jadav, Raag > <raag.jadav@intel.com>; Tauro, Riana <riana.tauro@intel.com>; Poosa, Karthik > <karthik.poosa@intel.com> > Subject: [PATCH] drm/xe/hwmon: Enable energy attributes for CRI > > Enable HWMON energy attributes for CRI which is available through MMIO > registers. Can you explain why this change required in commit message ? BR, Anshuman > > Signed-off-by: Karthik Poosa <karthik.poosa@intel.com> > --- > drivers/gpu/drm/xe/regs/xe_pcode_regs.h | 3 +++ > drivers/gpu/drm/xe/xe_hwmon.c | 7 ++++++- > 2 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/xe/regs/xe_pcode_regs.h > b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h > index 4b3c46eb858f..c63b409d7a82 100644 > --- a/drivers/gpu/drm/xe/regs/xe_pcode_regs.h > +++ b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h > @@ -27,4 +27,7 @@ > #define TEMP_SIGN_MASK REG_BIT(31) > #define BMG_PACKAGE_TEMPERATURE XE_REG(0x138434) > > +#define CRI_PACKAGE_ENERGY_STATUS XE_REG(0x138120) > +#define CRI_PLATFORM_ENERGY_STATUS XE_REG(0x138458) > + > #endif /* _XE_PCODE_REGS_H_ */ > diff --git a/drivers/gpu/drm/xe/xe_hwmon.c > b/drivers/gpu/drm/xe/xe_hwmon.c index 0fd4d4f1014a..852681bdb84c > 100644 > --- a/drivers/gpu/drm/xe/xe_hwmon.c > +++ b/drivers/gpu/drm/xe/xe_hwmon.c > @@ -296,7 +296,12 @@ static struct xe_reg xe_hwmon_get_reg(struct > xe_hwmon *hwmon, enum xe_hwmon_reg > return GT_PERF_STATUS; > break; > case REG_PKG_ENERGY_STATUS: > - if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG) > { > + if (xe->info.platform == XE_CRESCENTISLAND) { > + if (channel == CHANNEL_CARD) > + return CRI_PLATFORM_ENERGY_STATUS; > + else if (channel == CHANNEL_PKG) > + return CRI_PACKAGE_ENERGY_STATUS; > + } else if (xe->info.platform == XE_PVC && channel == > CHANNEL_PKG) { > return PVC_GT0_PLATFORM_ENERGY_STATUS; > } else if ((xe->info.platform == XE_DG2) && (channel == > CHANNEL_PKG)) { > return PCU_CR_PACKAGE_ENERGY_STATUS; > -- > 2.25.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: drm/xe/hwmon: Enable energy attributes for CRI 2026-03-10 12:20 [PATCH] drm/xe/hwmon: Enable energy attributes for CRI Karthik Poosa 2026-03-10 15:06 ` ✗ CI.KUnit: failure for " Patchwork 2026-03-11 7:20 ` [PATCH] " Gupta, Anshuman @ 2026-03-17 4:32 ` Purkait, Soham 2026-03-20 12:46 ` Poosa, Karthik 2 siblings, 1 reply; 6+ messages in thread From: Purkait, Soham @ 2026-03-17 4:32 UTC (permalink / raw) To: Karthik Poosa, intel-xe Cc: anshuman.gupta, badal.nilawar, rodrigo.vivi, raag.jadav, riana.tauro Hi Karthik, On 10-03-2026 17:50, Karthik Poosa wrote: > Enable HWMON energy attributes for CRI which is available through > MMIO registers. > > Signed-off-by: Karthik Poosa <karthik.poosa@intel.com> > --- > drivers/gpu/drm/xe/regs/xe_pcode_regs.h | 3 +++ > drivers/gpu/drm/xe/xe_hwmon.c | 7 ++++++- > 2 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/xe/regs/xe_pcode_regs.h b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h > index 4b3c46eb858f..c63b409d7a82 100644 > --- a/drivers/gpu/drm/xe/regs/xe_pcode_regs.h > +++ b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h > @@ -27,4 +27,7 @@ > #define TEMP_SIGN_MASK REG_BIT(31) > #define BMG_PACKAGE_TEMPERATURE XE_REG(0x138434) > > +#define CRI_PACKAGE_ENERGY_STATUS XE_REG(0x138120) > +#define CRI_PLATFORM_ENERGY_STATUS XE_REG(0x138458) > + > #endif /* _XE_PCODE_REGS_H_ */ > diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c > index 0fd4d4f1014a..852681bdb84c 100644 > --- a/drivers/gpu/drm/xe/xe_hwmon.c > +++ b/drivers/gpu/drm/xe/xe_hwmon.c > @@ -296,7 +296,12 @@ static struct xe_reg xe_hwmon_get_reg(struct xe_hwmon *hwmon, enum xe_hwmon_reg > return GT_PERF_STATUS; > break; > case REG_PKG_ENERGY_STATUS: > - if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG) { > + if (xe->info.platform == XE_CRESCENTISLAND) { > + if (channel == CHANNEL_CARD) Instead of using if-else better to use switch-case here. Thanks, Soham > + return CRI_PLATFORM_ENERGY_STATUS; > + else if (channel == CHANNEL_PKG) > + return CRI_PACKAGE_ENERGY_STATUS; > + } else if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG) { > return PVC_GT0_PLATFORM_ENERGY_STATUS; > } else if ((xe->info.platform == XE_DG2) && (channel == CHANNEL_PKG)) { > return PCU_CR_PACKAGE_ENERGY_STATUS; ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: drm/xe/hwmon: Enable energy attributes for CRI 2026-03-17 4:32 ` Purkait, Soham @ 2026-03-20 12:46 ` Poosa, Karthik 2026-03-26 14:08 ` Poosa, Karthik 0 siblings, 1 reply; 6+ messages in thread From: Poosa, Karthik @ 2026-03-20 12:46 UTC (permalink / raw) To: Purkait, Soham, intel-xe Cc: anshuman.gupta, badal.nilawar, rodrigo.vivi, raag.jadav, riana.tauro On 17-03-2026 10:02, Purkait, Soham wrote: > Hi Karthik, > > On 10-03-2026 17:50, Karthik Poosa wrote: >> Enable HWMON energy attributes for CRI which is available through >> MMIO registers. >> >> Signed-off-by: Karthik Poosa <karthik.poosa@intel.com> >> --- >> drivers/gpu/drm/xe/regs/xe_pcode_regs.h | 3 +++ >> drivers/gpu/drm/xe/xe_hwmon.c | 7 ++++++- >> 2 files changed, 9 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/xe/regs/xe_pcode_regs.h >> b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h >> index 4b3c46eb858f..c63b409d7a82 100644 >> --- a/drivers/gpu/drm/xe/regs/xe_pcode_regs.h >> +++ b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h >> @@ -27,4 +27,7 @@ >> #define TEMP_SIGN_MASK REG_BIT(31) >> #define BMG_PACKAGE_TEMPERATURE XE_REG(0x138434) >> +#define CRI_PACKAGE_ENERGY_STATUS XE_REG(0x138120) >> +#define CRI_PLATFORM_ENERGY_STATUS XE_REG(0x138458) >> + >> #endif /* _XE_PCODE_REGS_H_ */ >> diff --git a/drivers/gpu/drm/xe/xe_hwmon.c >> b/drivers/gpu/drm/xe/xe_hwmon.c >> index 0fd4d4f1014a..852681bdb84c 100644 >> --- a/drivers/gpu/drm/xe/xe_hwmon.c >> +++ b/drivers/gpu/drm/xe/xe_hwmon.c >> @@ -296,7 +296,12 @@ static struct xe_reg xe_hwmon_get_reg(struct >> xe_hwmon *hwmon, enum xe_hwmon_reg >> return GT_PERF_STATUS; >> break; >> case REG_PKG_ENERGY_STATUS: >> - if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG) { >> + if (xe->info.platform == XE_CRESCENTISLAND) { >> + if (channel == CHANNEL_CARD) > > Instead of using if-else better to use switch-case here. > > Thanks, > Soham That will need refactor of this entire function. Those shall be handled in a separate patch series. > >> + return CRI_PLATFORM_ENERGY_STATUS; >> + else if (channel == CHANNEL_PKG) >> + return CRI_PACKAGE_ENERGY_STATUS; >> + } else if (xe->info.platform == XE_PVC && channel == >> CHANNEL_PKG) { >> return PVC_GT0_PLATFORM_ENERGY_STATUS; >> } else if ((xe->info.platform == XE_DG2) && (channel == >> CHANNEL_PKG)) { >> return PCU_CR_PACKAGE_ENERGY_STATUS; ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: drm/xe/hwmon: Enable energy attributes for CRI 2026-03-20 12:46 ` Poosa, Karthik @ 2026-03-26 14:08 ` Poosa, Karthik 0 siblings, 0 replies; 6+ messages in thread From: Poosa, Karthik @ 2026-03-26 14:08 UTC (permalink / raw) To: Purkait, Soham, intel-xe@lists.freedesktop.org Cc: Gupta, Anshuman, Nilawar, Badal, Vivi, Rodrigo, Jadav, Raag, Tauro, Riana [-- Attachment #1: Type: text/plain, Size: 2910 bytes --] ________________________________ From: Poosa, Karthik <karthik.poosa@intel.com> Sent: Friday, March 20, 2026 6:16 PM To: Purkait, Soham <soham.purkait@intel.com>; intel-xe@lists.freedesktop.org <intel-xe@lists.freedesktop.org> Cc: Gupta, Anshuman <anshuman.gupta@intel.com>; Nilawar, Badal <badal.nilawar@intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com>; Jadav, Raag <raag.jadav@intel.com>; Tauro, Riana <riana.tauro@intel.com> Subject: Re: drm/xe/hwmon: Enable energy attributes for CRI On 17-03-2026 10:02, Purkait, Soham wrote: > Hi Karthik, > > On 10-03-2026 17:50, Karthik Poosa wrote: >> Enable HWMON energy attributes for CRI which is available through >> MMIO registers. >> >> Signed-off-by: Karthik Poosa <karthik.poosa@intel.com> >> --- >> drivers/gpu/drm/xe/regs/xe_pcode_regs.h | 3 +++ >> drivers/gpu/drm/xe/xe_hwmon.c | 7 ++++++- >> 2 files changed, 9 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/xe/regs/xe_pcode_regs.h >> b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h >> index 4b3c46eb858f..c63b409d7a82 100644 >> --- a/drivers/gpu/drm/xe/regs/xe_pcode_regs.h >> +++ b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h >> @@ -27,4 +27,7 @@ >> #define TEMP_SIGN_MASK REG_BIT(31) >> #define BMG_PACKAGE_TEMPERATURE XE_REG(0x138434) >> +#define CRI_PACKAGE_ENERGY_STATUS XE_REG(0x138120) >> +#define CRI_PLATFORM_ENERGY_STATUS XE_REG(0x138458) >> + >> #endif /* _XE_PCODE_REGS_H_ */ >> diff --git a/drivers/gpu/drm/xe/xe_hwmon.c >> b/drivers/gpu/drm/xe/xe_hwmon.c >> index 0fd4d4f1014a..852681bdb84c 100644 >> --- a/drivers/gpu/drm/xe/xe_hwmon.c >> +++ b/drivers/gpu/drm/xe/xe_hwmon.c >> @@ -296,7 +296,12 @@ static struct xe_reg xe_hwmon_get_reg(struct >> xe_hwmon *hwmon, enum xe_hwmon_reg >> return GT_PERF_STATUS; >> break; >> case REG_PKG_ENERGY_STATUS: >> - if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG) { >> + if (xe->info.platform == XE_CRESCENTISLAND) { >> + if (channel == CHANNEL_CARD) > > Instead of using if-else better to use switch-case here. > > Thanks, > Soham That will need refactor of this entire function. Those shall be handled in a separate patch series. As per offline discussion, switch case was suggested for channels under energy. As energy is supported only for card and package channels, switch case is not needed here. > >> + return CRI_PLATFORM_ENERGY_STATUS; >> + else if (channel == CHANNEL_PKG) >> + return CRI_PACKAGE_ENERGY_STATUS; >> + } else if (xe->info.platform == XE_PVC && channel == >> CHANNEL_PKG) { >> return PVC_GT0_PLATFORM_ENERGY_STATUS; >> } else if ((xe->info.platform == XE_DG2) && (channel == >> CHANNEL_PKG)) { >> return PCU_CR_PACKAGE_ENERGY_STATUS; [-- Attachment #2: Type: text/html, Size: 5593 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-03-26 14:08 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-03-10 12:20 [PATCH] drm/xe/hwmon: Enable energy attributes for CRI Karthik Poosa 2026-03-10 15:06 ` ✗ CI.KUnit: failure for " Patchwork 2026-03-11 7:20 ` [PATCH] " Gupta, Anshuman 2026-03-17 4:32 ` Purkait, Soham 2026-03-20 12:46 ` Poosa, Karthik 2026-03-26 14:08 ` Poosa, Karthik
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox