* ✓ CI.Patch_applied: success for drm/xe/hwmon: Refactor xe hwmon
2024-01-26 7:48 [PATCH] drm/xe/hwmon: Refactor xe hwmon Karthik Poosa
@ 2024-01-26 7:43 ` Patchwork
2024-01-26 7:43 ` ✗ CI.checkpatch: warning " Patchwork
` (4 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2024-01-26 7:43 UTC (permalink / raw)
To: Karthik Poosa; +Cc: intel-xe
== Series Details ==
Series: drm/xe/hwmon: Refactor xe hwmon
URL : https://patchwork.freedesktop.org/series/129187/
State : success
== Summary ==
=== Applying kernel patches on branch 'drm-tip' with base: ===
Base commit: 246d92693 drm-tip: 2024y-01m-26d-02h-57m-45s UTC integration manifest
=== git am output follows ===
Applying: drm/xe/hwmon: Refactor xe hwmon
^ permalink raw reply [flat|nested] 11+ messages in thread
* ✗ CI.checkpatch: warning for drm/xe/hwmon: Refactor xe hwmon
2024-01-26 7:48 [PATCH] drm/xe/hwmon: Refactor xe hwmon Karthik Poosa
2024-01-26 7:43 ` ✓ CI.Patch_applied: success for " Patchwork
@ 2024-01-26 7:43 ` Patchwork
2024-01-26 7:44 ` ✗ CI.KUnit: failure " Patchwork
` (3 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2024-01-26 7:43 UTC (permalink / raw)
To: Karthik Poosa; +Cc: intel-xe
== Series Details ==
Series: drm/xe/hwmon: Refactor xe hwmon
URL : https://patchwork.freedesktop.org/series/129187/
State : warning
== Summary ==
+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt
Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master
b2ca823f819193c33ab811dfac08c614138d6d46
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 20d9878923627aa14c233b7fc4035fec0695980a
Author: Karthik Poosa <karthik.poosa@intel.com>
Date: Fri Jan 26 13:18:19 2024 +0530
drm/xe/hwmon: Refactor xe hwmon
Check latest platform first in xe_hwmon_get_reg.
Move PVC registers to xe_mchbar_regs.h.
Fixes: fb1b70607f73 ("drm/xe/hwmon: Expose power attributes")
Suggested-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
+ /mt/dim checkpatch 246d92693aa04ab89430fc3b028ed9b0b7e8a0c8 drm-intel
20d987892 drm/xe/hwmon: Refactor xe hwmon
-:9: WARNING:UNKNOWN_COMMIT_ID: Unknown commit id 'fb1b70607f73', maybe rebased or not pulled?
#9:
Fixes: fb1b70607f73 ("drm/xe/hwmon: Expose power attributes")
total: 0 errors, 1 warnings, 0 checks, 64 lines checked
^ permalink raw reply [flat|nested] 11+ messages in thread
* ✗ CI.KUnit: failure for drm/xe/hwmon: Refactor xe hwmon
2024-01-26 7:48 [PATCH] drm/xe/hwmon: Refactor xe hwmon Karthik Poosa
2024-01-26 7:43 ` ✓ CI.Patch_applied: success for " Patchwork
2024-01-26 7:43 ` ✗ CI.checkpatch: warning " Patchwork
@ 2024-01-26 7:44 ` Patchwork
2024-01-26 13:11 ` [PATCH] " Gupta, Anshuman
` (2 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2024-01-26 7:44 UTC (permalink / raw)
To: Karthik Poosa; +Cc: intel-xe
== Series Details ==
Series: drm/xe/hwmon: Refactor xe hwmon
URL : https://patchwork.freedesktop.org/series/129187/
State : failure
== Summary ==
+ trap cleanup EXIT
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig
[07:43:36] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[07:43:40] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make ARCH=um O=.kunit --jobs=48
ERROR:root:../arch/x86/um/user-offsets.c:17:6: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes]
17 | void foo(void)
| ^~~
In file included from ../arch/um/kernel/asm-offsets.c:1:
../arch/x86/um/shared/sysdep/kernel-offsets.h:9:6: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes]
9 | void foo(void)
| ^~~
../arch/x86/um/bugs_64.c:9:6: warning: no previous prototype for ‘arch_check_bugs’ [-Wmissing-prototypes]
9 | void arch_check_bugs(void)
| ^~~~~~~~~~~~~~~
../arch/x86/um/bugs_64.c:13:6: warning: no previous prototype for ‘arch_examine_signal’ [-Wmissing-prototypes]
13 | void arch_examine_signal(int sig, struct uml_pt_regs *regs)
| ^~~~~~~~~~~~~~~~~~~
../arch/x86/um/fault.c:18:5: warning: no previous prototype for ‘arch_fixup’ [-Wmissing-prototypes]
18 | int arch_fixup(unsigned long address, struct uml_pt_regs *regs)
| ^~~~~~~~~~
../arch/x86/um/os-Linux/registers.c:146:15: warning: no previous prototype for ‘get_thread_reg’ [-Wmissing-prototypes]
146 | unsigned long get_thread_reg(int reg, jmp_buf *buf)
| ^~~~~~~~~~~~~~
../arch/x86/um/vdso/um_vdso.c:16:5: warning: no previous prototype for ‘__vdso_clock_gettime’ [-Wmissing-prototypes]
16 | int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
| ^~~~~~~~~~~~~~~~~~~~
../arch/x86/um/vdso/um_vdso.c:30:5: warning: no previous prototype for ‘__vdso_gettimeofday’ [-Wmissing-prototypes]
30 | int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
| ^~~~~~~~~~~~~~~~~~~
../arch/x86/um/vdso/um_vdso.c:44:21: warning: no previous prototype for ‘__vdso_time’ [-Wmissing-prototypes]
44 | __kernel_old_time_t __vdso_time(__kernel_old_time_t *t)
| ^~~~~~~~~~~
../arch/x86/um/vdso/um_vdso.c:57:1: warning: no previous prototype for ‘__vdso_getcpu’ [-Wmissing-prototypes]
57 | __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
| ^~~~~~~~~~~~~
../arch/x86/um/os-Linux/mcontext.c:7:6: warning: no previous prototype for ‘get_regs_from_mc’ [-Wmissing-prototypes]
7 | void get_regs_from_mc(struct uml_pt_regs *regs, mcontext_t *mc)
| ^~~~~~~~~~~~~~~~
../arch/um/os-Linux/skas/process.c:107:6: warning: no previous prototype for ‘wait_stub_done’ [-Wmissing-prototypes]
107 | void wait_stub_done(int pid)
| ^~~~~~~~~~~~~~
../arch/um/os-Linux/skas/process.c:683:6: warning: no previous prototype for ‘__switch_mm’ [-Wmissing-prototypes]
683 | void __switch_mm(struct mm_id *mm_idp)
| ^~~~~~~~~~~
../arch/um/kernel/skas/process.c:36:12: warning: no previous prototype for ‘start_uml’ [-Wmissing-prototypes]
36 | int __init start_uml(void)
| ^~~~~~~~~
../arch/um/kernel/skas/mmu.c:17:5: warning: no previous prototype for ‘init_new_context’ [-Wmissing-prototypes]
17 | int init_new_context(struct task_struct *task, struct mm_struct *mm)
| ^~~~~~~~~~~~~~~~
../arch/um/kernel/skas/mmu.c:60:6: warning: no previous prototype for ‘destroy_context’ [-Wmissing-prototypes]
60 | void destroy_context(struct mm_struct *mm)
| ^~~~~~~~~~~~~~~
../arch/x86/um/ptrace_64.c:111:5: warning: no previous prototype for ‘poke_user’ [-Wmissing-prototypes]
111 | int poke_user(struct task_struct *child, long addr, long data)
| ^~~~~~~~~
../arch/x86/um/ptrace_64.c:171:5: warning: no previous prototype for ‘peek_user’ [-Wmissing-prototypes]
171 | int peek_user(struct task_struct *child, long addr, long data)
| ^~~~~~~~~
../arch/x86/um/signal.c:560:6: warning: no previous prototype for ‘sys_rt_sigreturn’ [-Wmissing-prototypes]
560 | long sys_rt_sigreturn(void)
| ^~~~~~~~~~~~~~~~
../arch/um/os-Linux/main.c:187:7: warning: no previous prototype for ‘__wrap_malloc’ [-Wmissing-prototypes]
187 | void *__wrap_malloc(int size)
| ^~~~~~~~~~~~~
../arch/um/os-Linux/main.c:208:7: warning: no previous prototype for ‘__wrap_calloc’ [-Wmissing-prototypes]
208 | void *__wrap_calloc(int n, int size)
| ^~~~~~~~~~~~~
../arch/um/os-Linux/main.c:222:6: warning: no previous prototype for ‘__wrap_free’ [-Wmissing-prototypes]
222 | void __wrap_free(void *ptr)
| ^~~~~~~~~~~
../arch/um/os-Linux/mem.c:28:6: warning: no previous prototype for ‘kasan_map_memory’ [-Wmissing-prototypes]
28 | void kasan_map_memory(void *start, size_t len)
| ^~~~~~~~~~~~~~~~
../arch/um/os-Linux/mem.c:212:13: warning: no previous prototype for ‘check_tmpexec’ [-Wmissing-prototypes]
212 | void __init check_tmpexec(void)
| ^~~~~~~~~~~~~
../arch/um/os-Linux/signal.c:75:6: warning: no previous prototype for ‘sig_handler’ [-Wmissing-prototypes]
75 | void sig_handler(int sig, struct siginfo *si, mcontext_t *mc)
| ^~~~~~~~~~~
../arch/um/os-Linux/signal.c:111:6: warning: no previous prototype for ‘timer_alarm_handler’ [-Wmissing-prototypes]
111 | void timer_alarm_handler(int sig, struct siginfo *unused_si, mcontext_t *mc)
| ^~~~~~~~~~~~~~~~~~~
../arch/um/os-Linux/start_up.c:301:12: warning: no previous prototype for ‘parse_iomem’ [-Wmissing-prototypes]
301 | int __init parse_iomem(char *str, int *add)
| ^~~~~~~~~~~
../arch/um/kernel/mem.c:202:8: warning: no previous prototype for ‘pgd_alloc’ [-Wmissing-prototypes]
202 | pgd_t *pgd_alloc(struct mm_struct *mm)
| ^~~~~~~~~
../arch/um/kernel/mem.c:215:7: warning: no previous prototype for ‘uml_kmalloc’ [-Wmissing-prototypes]
215 | void *uml_kmalloc(int size, int flags)
| ^~~~~~~~~~~
../arch/um/kernel/process.c:51:5: warning: no previous prototype for ‘pid_to_processor_id’ [-Wmissing-prototypes]
51 | int pid_to_processor_id(int pid)
| ^~~~~~~~~~~~~~~~~~~
../arch/um/kernel/process.c:87:7: warning: no previous prototype for ‘__switch_to’ [-Wmissing-prototypes]
87 | void *__switch_to(struct task_struct *from, struct task_struct *to)
| ^~~~~~~~~~~
../arch/um/kernel/process.c:140:6: warning: no previous prototype for ‘fork_handler’ [-Wmissing-prototypes]
140 | void fork_handler(void)
| ^~~~~~~~~~~~
../arch/um/kernel/process.c:217:6: warning: no previous prototype for ‘arch_cpu_idle’ [-Wmissing-prototypes]
217 | void arch_cpu_idle(void)
| ^~~~~~~~~~~~~
../arch/um/kernel/process.c:253:5: warning: no previous prototype for ‘copy_to_user_proc’ [-Wmissing-prototypes]
253 | int copy_to_user_proc(void __user *to, void *from, int size)
| ^~~~~~~~~~~~~~~~~
../arch/um/kernel/process.c:263:5: warning: no previous prototype for ‘clear_user_proc’ [-Wmissing-prototypes]
263 | int clear_user_proc(void __user *buf, int size)
| ^~~~~~~~~~~~~~~
../arch/um/kernel/process.c:271:6: warning: no previous prototype for ‘set_using_sysemu’ [-Wmissing-prototypes]
271 | void set_using_sysemu(int value)
| ^~~~~~~~~~~~~~~~
../arch/um/kernel/process.c:278:5: warning: no previous prototype for ‘get_using_sysemu’ [-Wmissing-prototypes]
278 | int get_using_sysemu(void)
| ^~~~~~~~~~~~~~~~
../arch/um/kernel/process.c:316:12: warning: no previous prototype for ‘make_proc_sysemu’ [-Wmissing-prototypes]
316 | int __init make_proc_sysemu(void)
| ^~~~~~~~~~~~~~~~
../arch/um/kernel/process.c:348:15: warning: no previous prototype for ‘arch_align_stack’ [-Wmissing-prototypes]
348 | unsigned long arch_align_stack(unsigned long sp)
| ^~~~~~~~~~~~~~~~
../arch/x86/um/syscalls_64.c:48:6: warning: no previous prototype for ‘arch_switch_to’ [-Wmissing-prototypes]
48 | void arch_switch_to(struct task_struct *to)
| ^~~~~~~~~~~~~~
../arch/um/kernel/reboot.c:45:6: warning: no previous prototype for ‘machine_restart’ [-Wmissing-prototypes]
45 | void machine_restart(char * __unused)
| ^~~~~~~~~~~~~~~
../arch/um/kernel/reboot.c:51:6: warning: no previous prototype for ‘machine_power_off’ [-Wmissing-prototypes]
51 | void machine_power_off(void)
| ^~~~~~~~~~~~~~~~~
../arch/um/kernel/reboot.c:57:6: warning: no previous prototype for ‘machine_halt’ [-Wmissing-prototypes]
57 | void machine_halt(void)
| ^~~~~~~~~~~~
../arch/um/kernel/tlb.c:579:6: warning: no previous prototype for ‘flush_tlb_mm_range’ [-Wmissing-prototypes]
579 | void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
| ^~~~~~~~~~~~~~~~~~
../arch/um/kernel/tlb.c:594:6: warning: no previous prototype for ‘force_flush_all’ [-Wmissing-prototypes]
594 | void force_flush_all(void)
| ^~~~~~~~~~~~~~~
../arch/um/kernel/um_arch.c:408:19: warning: no previous prototype for ‘read_initrd’ [-Wmissing-prototypes]
408 | int __init __weak read_initrd(void)
| ^~~~~~~~~~~
../arch/um/kernel/um_arch.c:461:7: warning: no previous prototype for ‘text_poke’ [-Wmissing-prototypes]
461 | void *text_poke(void *addr, const void *opcode, size_t len)
| ^~~~~~~~~
../arch/um/kernel/um_arch.c:473:6: warning: no previous prototype for ‘text_poke_sync’ [-Wmissing-prototypes]
473 | void text_poke_sync(void)
| ^~~~~~~~~~~~~~
../arch/um/kernel/kmsg_dump.c:60:12: warning: no previous prototype for ‘kmsg_dumper_stdout_init’ [-Wmissing-prototypes]
60 | int __init kmsg_dumper_stdout_init(void)
| ^~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_bo.c:41:3: error: ‘struct ttm_placement’ has no member named ‘num_busy_placement’; did you mean ‘num_placement’?
41 | .num_busy_placement = 1,
| ^~~~~~~~~~~~~~~~~~
| num_placement
../drivers/gpu/drm/xe/xe_bo.c:41:24: warning: excess elements in struct initializer
41 | .num_busy_placement = 1,
| ^
../drivers/gpu/drm/xe/xe_bo.c:41:24: note: (near initialization for ‘sys_placement’)
../drivers/gpu/drm/xe/xe_bo.c:42:3: error: ‘struct ttm_placement’ has no member named ‘busy_placement’; did you mean ‘num_placement’?
42 | .busy_placement = &sys_placement_flags,
| ^~~~~~~~~~~~~~
| num_placement
../drivers/gpu/drm/xe/xe_bo.c:42:20: warning: excess elements in struct initializer
42 | .busy_placement = &sys_placement_flags,
| ^
../drivers/gpu/drm/xe/xe_bo.c:42:20: note: (near initialization for ‘sys_placement’)
../drivers/gpu/drm/xe/xe_bo.c:55:3: error: ‘struct ttm_placement’ has no member named ‘num_busy_placement’; did you mean ‘num_placement’?
55 | .num_busy_placement = 1,
| ^~~~~~~~~~~~~~~~~~
| num_placement
../drivers/gpu/drm/xe/xe_bo.c:55:24: warning: excess elements in struct initializer
55 | .num_busy_placement = 1,
| ^
../drivers/gpu/drm/xe/xe_bo.c:55:24: note: (near initialization for ‘tt_placement’)
../drivers/gpu/drm/xe/xe_bo.c:56:3: error: ‘struct ttm_placement’ has no member named ‘busy_placement’; did you mean ‘num_placement’?
56 | .busy_placement = &sys_placement_flags,
| ^~~~~~~~~~~~~~
| num_placement
../drivers/gpu/drm/xe/xe_bo.c:56:20: warning: excess elements in struct initializer
56 | .busy_placement = &sys_placement_flags,
| ^
../drivers/gpu/drm/xe/xe_bo.c:56:20: note: (near initialization for ‘tt_placement’)
../drivers/gpu/drm/xe/xe_bo.c: In function ‘__xe_bo_placement_for_flags’:
../drivers/gpu/drm/xe/xe_bo.c:233:4: error: ‘struct ttm_placement’ has no member named ‘num_busy_placement’; did you mean ‘num_placement’?
233 | .num_busy_placement = c,
| ^~~~~~~~~~~~~~~~~~
| num_placement
../drivers/gpu/drm/xe/xe_bo.c:233:25: warning: excess elements in struct initializer
233 | .num_busy_placement = c,
| ^
../drivers/gpu/drm/xe/xe_bo.c:233:25: note: (near initialization for ‘(anonymous)’)
../drivers/gpu/drm/xe/xe_bo.c:234:4: error: ‘struct ttm_placement’ has no member named ‘busy_placement’; did you mean ‘num_placement’?
234 | .busy_placement = bo->placements,
| ^~~~~~~~~~~~~~
| num_placement
../drivers/gpu/drm/xe/xe_bo.c:234:21: warning: excess elements in struct initializer
234 | .busy_placement = bo->placements,
| ^~
../drivers/gpu/drm/xe/xe_bo.c:234:21: note: (near initialization for ‘(anonymous)’)
../drivers/gpu/drm/xe/xe_bo.c: In function ‘xe_evict_flags’:
../drivers/gpu/drm/xe/xe_bo.c:254:15: error: ‘struct ttm_placement’ has no member named ‘num_busy_placement’; did you mean ‘num_placement’?
254 | placement->num_busy_placement = 0;
| ^~~~~~~~~~~~~~~~~~
| num_placement
../drivers/gpu/drm/xe/xe_bo.c: In function ‘__xe_bo_fixed_placement’:
../drivers/gpu/drm/xe/xe_bo.c:1394:4: error: ‘struct ttm_placement’ has no member named ‘num_busy_placement’; did you mean ‘num_placement’?
1394 | .num_busy_placement = 1,
| ^~~~~~~~~~~~~~~~~~
| num_placement
../drivers/gpu/drm/xe/xe_bo.c:1394:25: warning: excess elements in struct initializer
1394 | .num_busy_placement = 1,
| ^
../drivers/gpu/drm/xe/xe_bo.c:1394:25: note: (near initialization for ‘(anonymous)’)
../drivers/gpu/drm/xe/xe_bo.c:1395:4: error: ‘struct ttm_placement’ has no member named ‘busy_placement’; did you mean ‘num_placement’?
1395 | .busy_placement = place,
| ^~~~~~~~~~~~~~
| num_placement
../drivers/gpu/drm/xe/xe_bo.c:1395:21: warning: excess elements in struct initializer
1395 | .busy_placement = place,
| ^~~~~
../drivers/gpu/drm/xe/xe_bo.c:1395:21: note: (near initialization for ‘(anonymous)’)
../drivers/gpu/drm/xe/xe_bo.c: In function ‘xe_bo_migrate’:
../drivers/gpu/drm/xe/xe_bo.c:2153:12: error: ‘struct ttm_placement’ has no member named ‘num_busy_placement’; did you mean ‘num_placement’?
2153 | placement.num_busy_placement = 1;
| ^~~~~~~~~~~~~~~~~~
| num_placement
../drivers/gpu/drm/xe/xe_bo.c:2155:12: error: ‘struct ttm_placement’ has no member named ‘busy_placement’; did you mean ‘num_placement’?
2155 | placement.busy_placement = &requested;
| ^~~~~~~~~~~~~~
| num_placement
make[7]: *** [../scripts/Makefile.build:243: drivers/gpu/drm/xe/xe_bo.o] Error 1
make[7]: *** Waiting for unfinished jobs....
make[6]: *** [../scripts/Makefile.build:481: drivers/gpu/drm/xe] Error 2
make[6]: *** Waiting for unfinished jobs....
make[5]: *** [../scripts/Makefile.build:481: drivers/gpu/drm] Error 2
make[4]: *** [../scripts/Makefile.build:481: drivers/gpu] Error 2
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [../scripts/Makefile.build:481: drivers] Error 2
make[3]: *** Waiting for unfinished jobs....
../lib/iomap.c:156:5: warning: no previous prototype for ‘ioread64_lo_hi’ [-Wmissing-prototypes]
156 | u64 ioread64_lo_hi(const void __iomem *addr)
| ^~~~~~~~~~~~~~
../lib/iomap.c:163:5: warning: no previous prototype for ‘ioread64_hi_lo’ [-Wmissing-prototypes]
163 | u64 ioread64_hi_lo(const void __iomem *addr)
| ^~~~~~~~~~~~~~
../lib/iomap.c:170:5: warning: no previous prototype for ‘ioread64be_lo_hi’ [-Wmissing-prototypes]
170 | u64 ioread64be_lo_hi(const void __iomem *addr)
| ^~~~~~~~~~~~~~~~
../lib/iomap.c:178:5: warning: no previous prototype for ‘ioread64be_hi_lo’ [-Wmissing-prototypes]
178 | u64 ioread64be_hi_lo(const void __iomem *addr)
| ^~~~~~~~~~~~~~~~
../lib/iomap.c:264:6: warning: no previous prototype for ‘iowrite64_lo_hi’ [-Wmissing-prototypes]
264 | void iowrite64_lo_hi(u64 val, void __iomem *addr)
| ^~~~~~~~~~~~~~~
../lib/iomap.c:272:6: warning: no previous prototype for ‘iowrite64_hi_lo’ [-Wmissing-prototypes]
272 | void iowrite64_hi_lo(u64 val, void __iomem *addr)
| ^~~~~~~~~~~~~~~
../lib/iomap.c:280:6: warning: no previous prototype for ‘iowrite64be_lo_hi’ [-Wmissing-prototypes]
280 | void iowrite64be_lo_hi(u64 val, void __iomem *addr)
| ^~~~~~~~~~~~~~~~~
../lib/iomap.c:288:6: warning: no previous prototype for ‘iowrite64be_hi_lo’ [-Wmissing-prototypes]
288 | void iowrite64be_hi_lo(u64 val, void __iomem *addr)
| ^~~~~~~~~~~~~~~~~
make[2]: *** [/kernel/Makefile:1917: .] Error 2
make[1]: *** [/kernel/Makefile:240: __sub-make] Error 2
make: *** [Makefile:240: __sub-make] Error 2
+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] drm/xe/hwmon: Refactor xe hwmon
@ 2024-01-26 7:48 Karthik Poosa
2024-01-26 7:43 ` ✓ CI.Patch_applied: success for " Patchwork
` (5 more replies)
0 siblings, 6 replies; 11+ messages in thread
From: Karthik Poosa @ 2024-01-26 7:48 UTC (permalink / raw)
To: intel-xe; +Cc: Karthik Poosa, matthew.d.roper
Check latest platform first in xe_hwmon_get_reg.
Move PVC registers to xe_mchbar_regs.h.
Fixes: fb1b70607f73 ("drm/xe/hwmon: Expose power attributes")
Suggested-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
---
drivers/gpu/drm/xe/regs/xe_gt_regs.h | 6 ------
drivers/gpu/drm/xe/regs/xe_mchbar_regs.h | 6 ++++++
drivers/gpu/drm/xe/xe_hwmon.c | 24 ++++++++++++------------
3 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/xe/regs/xe_gt_regs.h b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
index cd27480f6486..15ac2d284d48 100644
--- a/drivers/gpu/drm/xe/regs/xe_gt_regs.h
+++ b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
@@ -490,10 +490,4 @@
#define GT_CS_MASTER_ERROR_INTERRUPT REG_BIT(3)
#define GT_RENDER_USER_INTERRUPT REG_BIT(0)
-#define PVC_GT0_PACKAGE_ENERGY_STATUS XE_REG(0x281004)
-#define PVC_GT0_PACKAGE_RAPL_LIMIT XE_REG(0x281008)
-#define PVC_GT0_PACKAGE_POWER_SKU_UNIT XE_REG(0x281068)
-#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
-#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
-
#endif
diff --git a/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h b/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
index 519dd1067a19..97652b4297ff 100644
--- a/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
+++ b/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
@@ -41,4 +41,10 @@
#define PKG_PWR_LIM_1_TIME_X REG_GENMASK(23, 22)
#define PKG_PWR_LIM_1_TIME_Y REG_GENMASK(21, 17)
+#define PVC_GT0_PACKAGE_ENERGY_STATUS XE_REG(0x281004)
+#define PVC_GT0_PACKAGE_RAPL_LIMIT XE_REG(0x281008)
+#define PVC_GT0_PACKAGE_POWER_SKU_UNIT XE_REG(0x281068)
+#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
+#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
+
#endif /* _XE_MCHBAR_REGS_H_ */
diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
index 89c6f7f84b5a..c19a0daf7fd7 100644
--- a/drivers/gpu/drm/xe/xe_hwmon.c
+++ b/drivers/gpu/drm/xe/xe_hwmon.c
@@ -77,32 +77,32 @@ static u32 xe_hwmon_get_reg(struct xe_hwmon *hwmon, enum xe_hwmon_reg hwmon_reg)
switch (hwmon_reg) {
case REG_PKG_RAPL_LIMIT:
- if (xe->info.platform == XE_DG2)
- reg = PCU_CR_PACKAGE_RAPL_LIMIT;
- else if (xe->info.platform == XE_PVC)
+ if (xe->info.platform == XE_PVC)
reg = PVC_GT0_PACKAGE_RAPL_LIMIT;
+ else if (xe->info.platform == XE_DG2)
+ reg = PCU_CR_PACKAGE_RAPL_LIMIT;
break;
case REG_PKG_POWER_SKU:
- if (xe->info.platform == XE_DG2)
- reg = PCU_CR_PACKAGE_POWER_SKU;
- else if (xe->info.platform == XE_PVC)
+ if (xe->info.platform == XE_PVC)
reg = PVC_GT0_PACKAGE_POWER_SKU;
+ else if (xe->info.platform == XE_DG2)
+ reg = PCU_CR_PACKAGE_POWER_SKU;
break;
case REG_PKG_POWER_SKU_UNIT:
- if (xe->info.platform == XE_DG2)
- reg = PCU_CR_PACKAGE_POWER_SKU_UNIT;
- else if (xe->info.platform == XE_PVC)
+ if (xe->info.platform == XE_PVC)
reg = PVC_GT0_PACKAGE_POWER_SKU_UNIT;
+ else if (xe->info.platform == XE_DG2)
+ reg = PCU_CR_PACKAGE_POWER_SKU_UNIT;
break;
case REG_GT_PERF_STATUS:
if (xe->info.platform == XE_DG2)
reg = GT_PERF_STATUS;
break;
case REG_PKG_ENERGY_STATUS:
- if (xe->info.platform == XE_DG2)
- reg = PCU_CR_PACKAGE_ENERGY_STATUS;
- else if (xe->info.platform == XE_PVC)
+ if (xe->info.platform == XE_PVC)
reg = PVC_GT0_PLATFORM_ENERGY_STATUS;
+ else if (xe->info.platform == XE_DG2)
+ reg = PCU_CR_PACKAGE_ENERGY_STATUS;
break;
default:
drm_warn(&xe->drm, "Unknown xe hwmon reg id: %d\n", hwmon_reg);
--
2.25.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* RE: [PATCH] drm/xe/hwmon: Refactor xe hwmon
2024-01-26 7:48 [PATCH] drm/xe/hwmon: Refactor xe hwmon Karthik Poosa
` (2 preceding siblings ...)
2024-01-26 7:44 ` ✗ CI.KUnit: failure " Patchwork
@ 2024-01-26 13:11 ` Gupta, Anshuman
2024-01-26 18:14 ` Matt Roper
2024-01-26 15:04 ` Dong, Zhanjun
2024-02-01 4:58 ` Nilawar, Badal
5 siblings, 1 reply; 11+ messages in thread
From: Gupta, Anshuman @ 2024-01-26 13:11 UTC (permalink / raw)
To: Poosa, Karthik, intel-xe@lists.freedesktop.org, Roper, Matthew D
> -----Original Message-----
> From: Poosa, Karthik <karthik.poosa@intel.com>
> Sent: Friday, January 26, 2024 1:18 PM
> To: intel-xe@lists.freedesktop.org
> Cc: Gupta, Anshuman <anshuman.gupta@intel.com>; Nilawar, Badal
> <badal.nilawar@intel.com>; Roper, Matthew D
> <matthew.d.roper@intel.com>; Poosa, Karthik <karthik.poosa@intel.com>
> Subject: [PATCH] drm/xe/hwmon: Refactor xe hwmon
>
> Check latest platform first in xe_hwmon_get_reg.
> Move PVC registers to xe_mchbar_regs.h.
>
> Fixes: fb1b70607f73 ("drm/xe/hwmon: Expose power attributes")
> Suggested-by: Matt Roper <matthew.d.roper@intel.com>
> Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
> ---
> drivers/gpu/drm/xe/regs/xe_gt_regs.h | 6 ------
> drivers/gpu/drm/xe/regs/xe_mchbar_regs.h | 6 ++++++
> drivers/gpu/drm/xe/xe_hwmon.c | 24 ++++++++++++------------
> 3 files changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> index cd27480f6486..15ac2d284d48 100644
> --- a/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> +++ b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> @@ -490,10 +490,4 @@
> #define GT_CS_MASTER_ERROR_INTERRUPT REG_BIT(3)
> #define GT_RENDER_USER_INTERRUPT REG_BIT(0)
>
> -#define PVC_GT0_PACKAGE_ENERGY_STATUS XE_REG(0x281004)
> -#define PVC_GT0_PACKAGE_RAPL_LIMIT XE_REG(0x281008)
> -#define PVC_GT0_PACKAGE_POWER_SKU_UNIT
> XE_REG(0x281068)
> -#define PVC_GT0_PLATFORM_ENERGY_STATUS
> XE_REG(0x28106c)
> -#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
> -
> #endif
> diff --git a/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> b/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> index 519dd1067a19..97652b4297ff 100644
> --- a/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> +++ b/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> @@ -41,4 +41,10 @@
> #define PKG_PWR_LIM_1_TIME_X REG_GENMASK(23,
> 22)
> #define PKG_PWR_LIM_1_TIME_Y REG_GENMASK(21,
> 17)
>
> +#define PVC_GT0_PACKAGE_ENERGY_STATUS XE_REG(0x281004)
> +#define PVC_GT0_PACKAGE_RAPL_LIMIT XE_REG(0x281008)
> +#define PVC_GT0_PACKAGE_POWER_SKU_UNIT XE_REG(0x281068)
> +#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
> +#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
Above are pcode specific register, IMO it is better to create a
regs/xe_pcode.h header.
@Roper, Matthew D what is your opinion here ?
Thanks,
Anshuman Gupta.
> +
> #endif /* _XE_MCHBAR_REGS_H_ */
> diff --git a/drivers/gpu/drm/xe/xe_hwmon.c
> b/drivers/gpu/drm/xe/xe_hwmon.c index 89c6f7f84b5a..c19a0daf7fd7
> 100644
> --- a/drivers/gpu/drm/xe/xe_hwmon.c
> +++ b/drivers/gpu/drm/xe/xe_hwmon.c
> @@ -77,32 +77,32 @@ static u32 xe_hwmon_get_reg(struct xe_hwmon
> *hwmon, enum xe_hwmon_reg hwmon_reg)
>
> switch (hwmon_reg) {
> case REG_PKG_RAPL_LIMIT:
> - if (xe->info.platform == XE_DG2)
> - reg = PCU_CR_PACKAGE_RAPL_LIMIT;
> - else if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_PVC)
> reg = PVC_GT0_PACKAGE_RAPL_LIMIT;
> + else if (xe->info.platform == XE_DG2)
> + reg = PCU_CR_PACKAGE_RAPL_LIMIT;
> break;
> case REG_PKG_POWER_SKU:
> - if (xe->info.platform == XE_DG2)
> - reg = PCU_CR_PACKAGE_POWER_SKU;
> - else if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_PVC)
> reg = PVC_GT0_PACKAGE_POWER_SKU;
> + else if (xe->info.platform == XE_DG2)
> + reg = PCU_CR_PACKAGE_POWER_SKU;
> break;
> case REG_PKG_POWER_SKU_UNIT:
> - if (xe->info.platform == XE_DG2)
> - reg = PCU_CR_PACKAGE_POWER_SKU_UNIT;
> - else if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_PVC)
> reg = PVC_GT0_PACKAGE_POWER_SKU_UNIT;
> + else if (xe->info.platform == XE_DG2)
> + reg = PCU_CR_PACKAGE_POWER_SKU_UNIT;
> break;
> case REG_GT_PERF_STATUS:
> if (xe->info.platform == XE_DG2)
> reg = GT_PERF_STATUS;
> break;
> case REG_PKG_ENERGY_STATUS:
> - if (xe->info.platform == XE_DG2)
> - reg = PCU_CR_PACKAGE_ENERGY_STATUS;
> - else if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_PVC)
> reg = PVC_GT0_PLATFORM_ENERGY_STATUS;
> + else if (xe->info.platform == XE_DG2)
> + reg = PCU_CR_PACKAGE_ENERGY_STATUS;
> break;
> default:
> drm_warn(&xe->drm, "Unknown xe hwmon reg id: %d\n",
> hwmon_reg);
> --
> 2.25.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm/xe/hwmon: Refactor xe hwmon
2024-01-26 7:48 [PATCH] drm/xe/hwmon: Refactor xe hwmon Karthik Poosa
` (3 preceding siblings ...)
2024-01-26 13:11 ` [PATCH] " Gupta, Anshuman
@ 2024-01-26 15:04 ` Dong, Zhanjun
2024-01-29 19:55 ` Matt Roper
2024-02-01 4:58 ` Nilawar, Badal
5 siblings, 1 reply; 11+ messages in thread
From: Dong, Zhanjun @ 2024-01-26 15:04 UTC (permalink / raw)
To: Karthik Poosa, intel-xe; +Cc: matthew.d.roper
On 2024-01-26 2:48 a.m., Karthik Poosa wrote:
> Check latest platform first in xe_hwmon_get_reg.
> Move PVC registers to xe_mchbar_regs.h.
>
> Fixes: fb1b70607f73 ("drm/xe/hwmon: Expose power attributes")
> Suggested-by: Matt Roper <matthew.d.roper@intel.com>
> Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
> ---
> drivers/gpu/drm/xe/regs/xe_gt_regs.h | 6 ------
> drivers/gpu/drm/xe/regs/xe_mchbar_regs.h | 6 ++++++
> drivers/gpu/drm/xe/xe_hwmon.c | 24 ++++++++++++------------
> 3 files changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/regs/xe_gt_regs.h b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> index cd27480f6486..15ac2d284d48 100644
> --- a/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> +++ b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> @@ -490,10 +490,4 @@
> #define GT_CS_MASTER_ERROR_INTERRUPT REG_BIT(3)
> #define GT_RENDER_USER_INTERRUPT REG_BIT(0)
>
> -#define PVC_GT0_PACKAGE_ENERGY_STATUS XE_REG(0x281004)
> -#define PVC_GT0_PACKAGE_RAPL_LIMIT XE_REG(0x281008)
> -#define PVC_GT0_PACKAGE_POWER_SKU_UNIT XE_REG(0x281068)
> -#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
> -#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
> -
> #endif
> diff --git a/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h b/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> index 519dd1067a19..97652b4297ff 100644
> --- a/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> +++ b/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> @@ -41,4 +41,10 @@
> #define PKG_PWR_LIM_1_TIME_X REG_GENMASK(23, 22)
> #define PKG_PWR_LIM_1_TIME_Y REG_GENMASK(21, 17)
>
> +#define PVC_GT0_PACKAGE_ENERGY_STATUS XE_REG(0x281004)
> +#define PVC_GT0_PACKAGE_RAPL_LIMIT XE_REG(0x281008)
> +#define PVC_GT0_PACKAGE_POWER_SKU_UNIT XE_REG(0x281068)
> +#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
> +#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
> +
> #endif /* _XE_MCHBAR_REGS_H_ */
> diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
> index 89c6f7f84b5a..c19a0daf7fd7 100644
> --- a/drivers/gpu/drm/xe/xe_hwmon.c
> +++ b/drivers/gpu/drm/xe/xe_hwmon.c
> @@ -77,32 +77,32 @@ static u32 xe_hwmon_get_reg(struct xe_hwmon *hwmon, enum xe_hwmon_reg hwmon_reg)
>
> switch (hwmon_reg) {
> case REG_PKG_RAPL_LIMIT:
> - if (xe->info.platform == XE_DG2)
> - reg = PCU_CR_PACKAGE_RAPL_LIMIT;
> - else if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_PVC)
> reg = PVC_GT0_PACKAGE_RAPL_LIMIT;
> + else if (xe->info.platform == XE_DG2)
> + reg = PCU_CR_PACKAGE_RAPL_LIMIT;
> break;
> case REG_PKG_POWER_SKU:
> - if (xe->info.platform == XE_DG2)
> - reg = PCU_CR_PACKAGE_POWER_SKU;
> - else if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_PVC)
> reg = PVC_GT0_PACKAGE_POWER_SKU;
> + else if (xe->info.platform == XE_DG2)
> + reg = PCU_CR_PACKAGE_POWER_SKU;
> break;
> case REG_PKG_POWER_SKU_UNIT:
> - if (xe->info.platform == XE_DG2)
> - reg = PCU_CR_PACKAGE_POWER_SKU_UNIT;
> - else if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_PVC)
> reg = PVC_GT0_PACKAGE_POWER_SKU_UNIT;
> + else if (xe->info.platform == XE_DG2)
> + reg = PCU_CR_PACKAGE_POWER_SKU_UNIT;
> break;
> case REG_GT_PERF_STATUS:
> if (xe->info.platform == XE_DG2)
> reg = GT_PERF_STATUS;
> break;
> case REG_PKG_ENERGY_STATUS:
> - if (xe->info.platform == XE_DG2)
> - reg = PCU_CR_PACKAGE_ENERGY_STATUS;
> - else if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_PVC)
> reg = PVC_GT0_PLATFORM_ENERGY_STATUS;
> + else if (xe->info.platform == XE_DG2)
> + reg = PCU_CR_PACKAGE_ENERGY_STATUS;
I see concerns about check latest platform first, while for PVC vs DG2,
I guess the sales for DG2 should be much more than PVC, should we
consider that factor?
And, above is equal to a read from 5x2 table, reference by array index
might be more easy to read and expand in the future, and no more if/else
needed.
Regards,
Zhanjun Dong
> break;
> default:
> drm_warn(&xe->drm, "Unknown xe hwmon reg id: %d\n", hwmon_reg);
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm/xe/hwmon: Refactor xe hwmon
2024-01-26 13:11 ` [PATCH] " Gupta, Anshuman
@ 2024-01-26 18:14 ` Matt Roper
0 siblings, 0 replies; 11+ messages in thread
From: Matt Roper @ 2024-01-26 18:14 UTC (permalink / raw)
To: Gupta, Anshuman; +Cc: Poosa, Karthik, intel-xe@lists.freedesktop.org
On Fri, Jan 26, 2024 at 05:11:37AM -0800, Gupta, Anshuman wrote:
>
>
> > -----Original Message-----
> > From: Poosa, Karthik <karthik.poosa@intel.com>
> > Sent: Friday, January 26, 2024 1:18 PM
> > To: intel-xe@lists.freedesktop.org
> > Cc: Gupta, Anshuman <anshuman.gupta@intel.com>; Nilawar, Badal
> > <badal.nilawar@intel.com>; Roper, Matthew D
> > <matthew.d.roper@intel.com>; Poosa, Karthik <karthik.poosa@intel.com>
> > Subject: [PATCH] drm/xe/hwmon: Refactor xe hwmon
> >
> > Check latest platform first in xe_hwmon_get_reg.
> > Move PVC registers to xe_mchbar_regs.h.
> >
> > Fixes: fb1b70607f73 ("drm/xe/hwmon: Expose power attributes")
> > Suggested-by: Matt Roper <matthew.d.roper@intel.com>
> > Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
> > ---
> > drivers/gpu/drm/xe/regs/xe_gt_regs.h | 6 ------
> > drivers/gpu/drm/xe/regs/xe_mchbar_regs.h | 6 ++++++
> > drivers/gpu/drm/xe/xe_hwmon.c | 24 ++++++++++++------------
> > 3 files changed, 18 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> > b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> > index cd27480f6486..15ac2d284d48 100644
> > --- a/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> > +++ b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> > @@ -490,10 +490,4 @@
> > #define GT_CS_MASTER_ERROR_INTERRUPT REG_BIT(3)
> > #define GT_RENDER_USER_INTERRUPT REG_BIT(0)
> >
> > -#define PVC_GT0_PACKAGE_ENERGY_STATUS XE_REG(0x281004)
> > -#define PVC_GT0_PACKAGE_RAPL_LIMIT XE_REG(0x281008)
> > -#define PVC_GT0_PACKAGE_POWER_SKU_UNIT
> > XE_REG(0x281068)
> > -#define PVC_GT0_PLATFORM_ENERGY_STATUS
> > XE_REG(0x28106c)
> > -#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
> > -
> > #endif
> > diff --git a/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> > b/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> > index 519dd1067a19..97652b4297ff 100644
> > --- a/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> > +++ b/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> > @@ -41,4 +41,10 @@
> > #define PKG_PWR_LIM_1_TIME_X REG_GENMASK(23,
> > 22)
> > #define PKG_PWR_LIM_1_TIME_Y REG_GENMASK(21,
> > 17)
> >
> > +#define PVC_GT0_PACKAGE_ENERGY_STATUS XE_REG(0x281004)
> > +#define PVC_GT0_PACKAGE_RAPL_LIMIT XE_REG(0x281008)
> > +#define PVC_GT0_PACKAGE_POWER_SKU_UNIT XE_REG(0x281068)
> > +#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
> > +#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
> Above are pcode specific register, IMO it is better to create a
> regs/xe_pcode.h header.
> @Roper, Matthew D what is your opinion here ?
Agreed; modern platforms don't mirror the MCH BAR into our gttmmadr
register space anymore, so this header isn't the right place to put it
either. A new pcode-specific register header sounds good to me.
Matt
> Thanks,
> Anshuman Gupta.
> > +
> > #endif /* _XE_MCHBAR_REGS_H_ */
> > diff --git a/drivers/gpu/drm/xe/xe_hwmon.c
> > b/drivers/gpu/drm/xe/xe_hwmon.c index 89c6f7f84b5a..c19a0daf7fd7
> > 100644
> > --- a/drivers/gpu/drm/xe/xe_hwmon.c
> > +++ b/drivers/gpu/drm/xe/xe_hwmon.c
> > @@ -77,32 +77,32 @@ static u32 xe_hwmon_get_reg(struct xe_hwmon
> > *hwmon, enum xe_hwmon_reg hwmon_reg)
> >
> > switch (hwmon_reg) {
> > case REG_PKG_RAPL_LIMIT:
> > - if (xe->info.platform == XE_DG2)
> > - reg = PCU_CR_PACKAGE_RAPL_LIMIT;
> > - else if (xe->info.platform == XE_PVC)
> > + if (xe->info.platform == XE_PVC)
> > reg = PVC_GT0_PACKAGE_RAPL_LIMIT;
> > + else if (xe->info.platform == XE_DG2)
> > + reg = PCU_CR_PACKAGE_RAPL_LIMIT;
> > break;
> > case REG_PKG_POWER_SKU:
> > - if (xe->info.platform == XE_DG2)
> > - reg = PCU_CR_PACKAGE_POWER_SKU;
> > - else if (xe->info.platform == XE_PVC)
> > + if (xe->info.platform == XE_PVC)
> > reg = PVC_GT0_PACKAGE_POWER_SKU;
> > + else if (xe->info.platform == XE_DG2)
> > + reg = PCU_CR_PACKAGE_POWER_SKU;
> > break;
> > case REG_PKG_POWER_SKU_UNIT:
> > - if (xe->info.platform == XE_DG2)
> > - reg = PCU_CR_PACKAGE_POWER_SKU_UNIT;
> > - else if (xe->info.platform == XE_PVC)
> > + if (xe->info.platform == XE_PVC)
> > reg = PVC_GT0_PACKAGE_POWER_SKU_UNIT;
> > + else if (xe->info.platform == XE_DG2)
> > + reg = PCU_CR_PACKAGE_POWER_SKU_UNIT;
> > break;
> > case REG_GT_PERF_STATUS:
> > if (xe->info.platform == XE_DG2)
> > reg = GT_PERF_STATUS;
> > break;
> > case REG_PKG_ENERGY_STATUS:
> > - if (xe->info.platform == XE_DG2)
> > - reg = PCU_CR_PACKAGE_ENERGY_STATUS;
> > - else if (xe->info.platform == XE_PVC)
> > + if (xe->info.platform == XE_PVC)
> > reg = PVC_GT0_PLATFORM_ENERGY_STATUS;
> > + else if (xe->info.platform == XE_DG2)
> > + reg = PCU_CR_PACKAGE_ENERGY_STATUS;
> > break;
> > default:
> > drm_warn(&xe->drm, "Unknown xe hwmon reg id: %d\n",
> > hwmon_reg);
> > --
> > 2.25.1
>
--
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm/xe/hwmon: Refactor xe hwmon
2024-01-26 15:04 ` Dong, Zhanjun
@ 2024-01-29 19:55 ` Matt Roper
0 siblings, 0 replies; 11+ messages in thread
From: Matt Roper @ 2024-01-29 19:55 UTC (permalink / raw)
To: Dong, Zhanjun; +Cc: Karthik Poosa, intel-xe
On Fri, Jan 26, 2024 at 10:04:01AM -0500, Dong, Zhanjun wrote:
>
>
> On 2024-01-26 2:48 a.m., Karthik Poosa wrote:
> > Check latest platform first in xe_hwmon_get_reg.
> > Move PVC registers to xe_mchbar_regs.h.
> >
> > Fixes: fb1b70607f73 ("drm/xe/hwmon: Expose power attributes")
> > Suggested-by: Matt Roper <matthew.d.roper@intel.com>
> > Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
> > ---
> > drivers/gpu/drm/xe/regs/xe_gt_regs.h | 6 ------
> > drivers/gpu/drm/xe/regs/xe_mchbar_regs.h | 6 ++++++
> > drivers/gpu/drm/xe/xe_hwmon.c | 24 ++++++++++++------------
> > 3 files changed, 18 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/xe/regs/xe_gt_regs.h b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> > index cd27480f6486..15ac2d284d48 100644
> > --- a/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> > +++ b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> > @@ -490,10 +490,4 @@
> > #define GT_CS_MASTER_ERROR_INTERRUPT REG_BIT(3)
> > #define GT_RENDER_USER_INTERRUPT REG_BIT(0)
> > -#define PVC_GT0_PACKAGE_ENERGY_STATUS XE_REG(0x281004)
> > -#define PVC_GT0_PACKAGE_RAPL_LIMIT XE_REG(0x281008)
> > -#define PVC_GT0_PACKAGE_POWER_SKU_UNIT XE_REG(0x281068)
> > -#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
> > -#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
> > -
> > #endif
> > diff --git a/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h b/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> > index 519dd1067a19..97652b4297ff 100644
> > --- a/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> > +++ b/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> > @@ -41,4 +41,10 @@
> > #define PKG_PWR_LIM_1_TIME_X REG_GENMASK(23, 22)
> > #define PKG_PWR_LIM_1_TIME_Y REG_GENMASK(21, 17)
> > +#define PVC_GT0_PACKAGE_ENERGY_STATUS XE_REG(0x281004)
> > +#define PVC_GT0_PACKAGE_RAPL_LIMIT XE_REG(0x281008)
> > +#define PVC_GT0_PACKAGE_POWER_SKU_UNIT XE_REG(0x281068)
> > +#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
> > +#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
> > +
> > #endif /* _XE_MCHBAR_REGS_H_ */
> > diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
> > index 89c6f7f84b5a..c19a0daf7fd7 100644
> > --- a/drivers/gpu/drm/xe/xe_hwmon.c
> > +++ b/drivers/gpu/drm/xe/xe_hwmon.c
> > @@ -77,32 +77,32 @@ static u32 xe_hwmon_get_reg(struct xe_hwmon *hwmon, enum xe_hwmon_reg hwmon_reg)
> > switch (hwmon_reg) {
> > case REG_PKG_RAPL_LIMIT:
> > - if (xe->info.platform == XE_DG2)
> > - reg = PCU_CR_PACKAGE_RAPL_LIMIT;
> > - else if (xe->info.platform == XE_PVC)
> > + if (xe->info.platform == XE_PVC)
> > reg = PVC_GT0_PACKAGE_RAPL_LIMIT;
> > + else if (xe->info.platform == XE_DG2)
> > + reg = PCU_CR_PACKAGE_RAPL_LIMIT;
> > break;
> > case REG_PKG_POWER_SKU:
> > - if (xe->info.platform == XE_DG2)
> > - reg = PCU_CR_PACKAGE_POWER_SKU;
> > - else if (xe->info.platform == XE_PVC)
> > + if (xe->info.platform == XE_PVC)
> > reg = PVC_GT0_PACKAGE_POWER_SKU;
> > + else if (xe->info.platform == XE_DG2)
> > + reg = PCU_CR_PACKAGE_POWER_SKU;
> > break;
> > case REG_PKG_POWER_SKU_UNIT:
> > - if (xe->info.platform == XE_DG2)
> > - reg = PCU_CR_PACKAGE_POWER_SKU_UNIT;
> > - else if (xe->info.platform == XE_PVC)
> > + if (xe->info.platform == XE_PVC)
> > reg = PVC_GT0_PACKAGE_POWER_SKU_UNIT;
> > + else if (xe->info.platform == XE_DG2)
> > + reg = PCU_CR_PACKAGE_POWER_SKU_UNIT;
> > break;
> > case REG_GT_PERF_STATUS:
> > if (xe->info.platform == XE_DG2)
> > reg = GT_PERF_STATUS;
> > break;
> > case REG_PKG_ENERGY_STATUS:
> > - if (xe->info.platform == XE_DG2)
> > - reg = PCU_CR_PACKAGE_ENERGY_STATUS;
> > - else if (xe->info.platform == XE_PVC)
> > + if (xe->info.platform == XE_PVC)
> > reg = PVC_GT0_PLATFORM_ENERGY_STATUS;
> > + else if (xe->info.platform == XE_DG2)
> > + reg = PCU_CR_PACKAGE_ENERGY_STATUS;
> I see concerns about check latest platform first, while for PVC vs DG2, I
> guess the sales for DG2 should be much more than PVC, should we consider
> that factor?
The convention in Xe (and in i915) is that the newest platform should
always come first in if/else ladders and case statements. That's purely
for code consistency and to help avoid mistakes when new platforms are
added in the future. We don't try to do micro-optimizations based on
which platform is more widely sold or anything like that.
Matt
>
> And, above is equal to a read from 5x2 table, reference by array index might
> be more easy to read and expand in the future, and no more if/else needed.
>
> Regards,
> Zhanjun Dong
> > break;
> > default:
> > drm_warn(&xe->drm, "Unknown xe hwmon reg id: %d\n", hwmon_reg);
--
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm/xe/hwmon: Refactor xe hwmon
2024-01-26 7:48 [PATCH] drm/xe/hwmon: Refactor xe hwmon Karthik Poosa
` (4 preceding siblings ...)
2024-01-26 15:04 ` Dong, Zhanjun
@ 2024-02-01 4:58 ` Nilawar, Badal
5 siblings, 0 replies; 11+ messages in thread
From: Nilawar, Badal @ 2024-02-01 4:58 UTC (permalink / raw)
To: Karthik Poosa, intel-xe; +Cc: matthew.d.roper
On 26-01-2024 13:18, Karthik Poosa wrote:
> Check latest platform first in xe_hwmon_get_reg.
> Move PVC registers to xe_mchbar_regs.h.
>
> Fixes: fb1b70607f73 ("drm/xe/hwmon: Expose power attributes")
Why Fixes: tag here. This is just refactoring and not fixing any bug.
Please remove Fixes: tag from here.
Regards,
Badal
> Suggested-by: Matt Roper <matthew.d.roper@intel.com>
> Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
> ---
> drivers/gpu/drm/xe/regs/xe_gt_regs.h | 6 ------
> drivers/gpu/drm/xe/regs/xe_mchbar_regs.h | 6 ++++++
> drivers/gpu/drm/xe/xe_hwmon.c | 24 ++++++++++++------------
> 3 files changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/regs/xe_gt_regs.h b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> index cd27480f6486..15ac2d284d48 100644
> --- a/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> +++ b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> @@ -490,10 +490,4 @@
> #define GT_CS_MASTER_ERROR_INTERRUPT REG_BIT(3)
> #define GT_RENDER_USER_INTERRUPT REG_BIT(0)
>
> -#define PVC_GT0_PACKAGE_ENERGY_STATUS XE_REG(0x281004)
> -#define PVC_GT0_PACKAGE_RAPL_LIMIT XE_REG(0x281008)
> -#define PVC_GT0_PACKAGE_POWER_SKU_UNIT XE_REG(0x281068)
> -#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
> -#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
> -
> #endif
> diff --git a/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h b/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> index 519dd1067a19..97652b4297ff 100644
> --- a/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> +++ b/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h
> @@ -41,4 +41,10 @@
> #define PKG_PWR_LIM_1_TIME_X REG_GENMASK(23, 22)
> #define PKG_PWR_LIM_1_TIME_Y REG_GENMASK(21, 17)
>
> +#define PVC_GT0_PACKAGE_ENERGY_STATUS XE_REG(0x281004)
> +#define PVC_GT0_PACKAGE_RAPL_LIMIT XE_REG(0x281008)
> +#define PVC_GT0_PACKAGE_POWER_SKU_UNIT XE_REG(0x281068)
> +#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
> +#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
> +
> #endif /* _XE_MCHBAR_REGS_H_ */
> diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
> index 89c6f7f84b5a..c19a0daf7fd7 100644
> --- a/drivers/gpu/drm/xe/xe_hwmon.c
> +++ b/drivers/gpu/drm/xe/xe_hwmon.c
> @@ -77,32 +77,32 @@ static u32 xe_hwmon_get_reg(struct xe_hwmon *hwmon, enum xe_hwmon_reg hwmon_reg)
>
> switch (hwmon_reg) {
> case REG_PKG_RAPL_LIMIT:
> - if (xe->info.platform == XE_DG2)
> - reg = PCU_CR_PACKAGE_RAPL_LIMIT;
> - else if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_PVC)
> reg = PVC_GT0_PACKAGE_RAPL_LIMIT;
> + else if (xe->info.platform == XE_DG2)
> + reg = PCU_CR_PACKAGE_RAPL_LIMIT;
> break;
> case REG_PKG_POWER_SKU:
> - if (xe->info.platform == XE_DG2)
> - reg = PCU_CR_PACKAGE_POWER_SKU;
> - else if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_PVC)
> reg = PVC_GT0_PACKAGE_POWER_SKU;
> + else if (xe->info.platform == XE_DG2)
> + reg = PCU_CR_PACKAGE_POWER_SKU;
> break;
> case REG_PKG_POWER_SKU_UNIT:
> - if (xe->info.platform == XE_DG2)
> - reg = PCU_CR_PACKAGE_POWER_SKU_UNIT;
> - else if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_PVC)
> reg = PVC_GT0_PACKAGE_POWER_SKU_UNIT;
> + else if (xe->info.platform == XE_DG2)
> + reg = PCU_CR_PACKAGE_POWER_SKU_UNIT;
> break;
> case REG_GT_PERF_STATUS:
> if (xe->info.platform == XE_DG2)
> reg = GT_PERF_STATUS;
> break;
> case REG_PKG_ENERGY_STATUS:
> - if (xe->info.platform == XE_DG2)
> - reg = PCU_CR_PACKAGE_ENERGY_STATUS;
> - else if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_PVC)
> reg = PVC_GT0_PLATFORM_ENERGY_STATUS;
> + else if (xe->info.platform == XE_DG2)
> + reg = PCU_CR_PACKAGE_ENERGY_STATUS;
> break;
> default:
> drm_warn(&xe->drm, "Unknown xe hwmon reg id: %d\n", hwmon_reg);
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] drm/xe/hwmon: Refactor xe hwmon
@ 2024-02-01 18:06 Karthik Poosa
2024-02-06 9:17 ` Nilawar, Badal
0 siblings, 1 reply; 11+ messages in thread
From: Karthik Poosa @ 2024-02-01 18:06 UTC (permalink / raw)
To: intel-xe; +Cc: anshuman.gupta, badal.nilawar, matthew.d.roper, Karthik Poosa
Check latest platform first in xe_hwmon_get_reg.
Move PVC HWMON registers to regs/xe_pcode.h.
Suggested-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
---
drivers/gpu/drm/xe/regs/xe_gt_regs.h | 6 ------
drivers/gpu/drm/xe/regs/xe_pcode_regs.h | 21 +++++++++++++++++++++
drivers/gpu/drm/xe/xe_hwmon.c | 25 +++++++++++++------------
3 files changed, 34 insertions(+), 18 deletions(-)
create mode 100644 drivers/gpu/drm/xe/regs/xe_pcode_regs.h
diff --git a/drivers/gpu/drm/xe/regs/xe_gt_regs.h b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
index cd27480f6486..15ac2d284d48 100644
--- a/drivers/gpu/drm/xe/regs/xe_gt_regs.h
+++ b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
@@ -490,10 +490,4 @@
#define GT_CS_MASTER_ERROR_INTERRUPT REG_BIT(3)
#define GT_RENDER_USER_INTERRUPT REG_BIT(0)
-#define PVC_GT0_PACKAGE_ENERGY_STATUS XE_REG(0x281004)
-#define PVC_GT0_PACKAGE_RAPL_LIMIT XE_REG(0x281008)
-#define PVC_GT0_PACKAGE_POWER_SKU_UNIT XE_REG(0x281068)
-#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
-#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
-
#endif
diff --git a/drivers/gpu/drm/xe/regs/xe_pcode_regs.h b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h
new file mode 100644
index 000000000000..3dae858508c8
--- /dev/null
+++ b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2024 Intel Corporation
+ */
+
+#ifndef _XE_PCODE_REGS_H_
+#define _XE_PCODE_REGS_H_
+
+#include "regs/xe_reg_defs.h"
+
+/*
+ * This file contains addresses of PCODE registers visible through GT MMIO space.
+ */
+
+#define PVC_GT0_PACKAGE_ENERGY_STATUS XE_REG(0x281004)
+#define PVC_GT0_PACKAGE_RAPL_LIMIT XE_REG(0x281008)
+#define PVC_GT0_PACKAGE_POWER_SKU_UNIT XE_REG(0x281068)
+#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
+#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
+
+#endif /* _XE_PCODE_REGS_H_ */
diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
index 89c6f7f84b5a..f0194d5121a5 100644
--- a/drivers/gpu/drm/xe/xe_hwmon.c
+++ b/drivers/gpu/drm/xe/xe_hwmon.c
@@ -10,6 +10,7 @@
#include <drm/drm_managed.h>
#include "regs/xe_gt_regs.h"
#include "regs/xe_mchbar_regs.h"
+#include "regs/xe_pcode_regs.h"
#include "xe_device.h"
#include "xe_gt.h"
#include "xe_hwmon.h"
@@ -77,32 +78,32 @@ static u32 xe_hwmon_get_reg(struct xe_hwmon *hwmon, enum xe_hwmon_reg hwmon_reg)
switch (hwmon_reg) {
case REG_PKG_RAPL_LIMIT:
- if (xe->info.platform == XE_DG2)
- reg = PCU_CR_PACKAGE_RAPL_LIMIT;
- else if (xe->info.platform == XE_PVC)
+ if (xe->info.platform == XE_PVC)
reg = PVC_GT0_PACKAGE_RAPL_LIMIT;
+ else if (xe->info.platform == XE_DG2)
+ reg = PCU_CR_PACKAGE_RAPL_LIMIT;
break;
case REG_PKG_POWER_SKU:
- if (xe->info.platform == XE_DG2)
- reg = PCU_CR_PACKAGE_POWER_SKU;
- else if (xe->info.platform == XE_PVC)
+ if (xe->info.platform == XE_PVC)
reg = PVC_GT0_PACKAGE_POWER_SKU;
+ else if (xe->info.platform == XE_DG2)
+ reg = PCU_CR_PACKAGE_POWER_SKU;
break;
case REG_PKG_POWER_SKU_UNIT:
- if (xe->info.platform == XE_DG2)
- reg = PCU_CR_PACKAGE_POWER_SKU_UNIT;
- else if (xe->info.platform == XE_PVC)
+ if (xe->info.platform == XE_PVC)
reg = PVC_GT0_PACKAGE_POWER_SKU_UNIT;
+ else if (xe->info.platform == XE_DG2)
+ reg = PCU_CR_PACKAGE_POWER_SKU_UNIT;
break;
case REG_GT_PERF_STATUS:
if (xe->info.platform == XE_DG2)
reg = GT_PERF_STATUS;
break;
case REG_PKG_ENERGY_STATUS:
- if (xe->info.platform == XE_DG2)
- reg = PCU_CR_PACKAGE_ENERGY_STATUS;
- else if (xe->info.platform == XE_PVC)
+ if (xe->info.platform == XE_PVC)
reg = PVC_GT0_PLATFORM_ENERGY_STATUS;
+ else if (xe->info.platform == XE_DG2)
+ reg = PCU_CR_PACKAGE_ENERGY_STATUS;
break;
default:
drm_warn(&xe->drm, "Unknown xe hwmon reg id: %d\n", hwmon_reg);
--
2.25.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] drm/xe/hwmon: Refactor xe hwmon
2024-02-01 18:06 Karthik Poosa
@ 2024-02-06 9:17 ` Nilawar, Badal
0 siblings, 0 replies; 11+ messages in thread
From: Nilawar, Badal @ 2024-02-06 9:17 UTC (permalink / raw)
To: Karthik Poosa, intel-xe; +Cc: anshuman.gupta, matthew.d.roper
On 01-02-2024 23:36, Karthik Poosa wrote:
> Check latest platform first in xe_hwmon_get_reg.
> Move PVC HWMON registers to regs/xe_pcode.h.
>
> Suggested-by: Matt Roper <matthew.d.roper@intel.com>
> Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
Reviewed-by: Badal Nilawar <badal.nilawar@intel.com>
> ---
> drivers/gpu/drm/xe/regs/xe_gt_regs.h | 6 ------
> drivers/gpu/drm/xe/regs/xe_pcode_regs.h | 21 +++++++++++++++++++++
> drivers/gpu/drm/xe/xe_hwmon.c | 25 +++++++++++++------------
> 3 files changed, 34 insertions(+), 18 deletions(-)
> create mode 100644 drivers/gpu/drm/xe/regs/xe_pcode_regs.h
>
> diff --git a/drivers/gpu/drm/xe/regs/xe_gt_regs.h b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> index cd27480f6486..15ac2d284d48 100644
> --- a/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> +++ b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> @@ -490,10 +490,4 @@
> #define GT_CS_MASTER_ERROR_INTERRUPT REG_BIT(3)
> #define GT_RENDER_USER_INTERRUPT REG_BIT(0)
>
> -#define PVC_GT0_PACKAGE_ENERGY_STATUS XE_REG(0x281004)
> -#define PVC_GT0_PACKAGE_RAPL_LIMIT XE_REG(0x281008)
> -#define PVC_GT0_PACKAGE_POWER_SKU_UNIT XE_REG(0x281068)
> -#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
> -#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
> -
> #endif
> diff --git a/drivers/gpu/drm/xe/regs/xe_pcode_regs.h b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h
> new file mode 100644
> index 000000000000..3dae858508c8
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h
> @@ -0,0 +1,21 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2024 Intel Corporation
> + */
> +
> +#ifndef _XE_PCODE_REGS_H_
> +#define _XE_PCODE_REGS_H_
> +
> +#include "regs/xe_reg_defs.h"
> +
> +/*
> + * This file contains addresses of PCODE registers visible through GT MMIO space.
> + */
> +
> +#define PVC_GT0_PACKAGE_ENERGY_STATUS XE_REG(0x281004)
> +#define PVC_GT0_PACKAGE_RAPL_LIMIT XE_REG(0x281008)
> +#define PVC_GT0_PACKAGE_POWER_SKU_UNIT XE_REG(0x281068)
> +#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
> +#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
> +
> +#endif /* _XE_PCODE_REGS_H_ */
> diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
> index 89c6f7f84b5a..f0194d5121a5 100644
> --- a/drivers/gpu/drm/xe/xe_hwmon.c
> +++ b/drivers/gpu/drm/xe/xe_hwmon.c
> @@ -10,6 +10,7 @@
> #include <drm/drm_managed.h>
> #include "regs/xe_gt_regs.h"
> #include "regs/xe_mchbar_regs.h"
> +#include "regs/xe_pcode_regs.h"
> #include "xe_device.h"
> #include "xe_gt.h"
> #include "xe_hwmon.h"
> @@ -77,32 +78,32 @@ static u32 xe_hwmon_get_reg(struct xe_hwmon *hwmon, enum xe_hwmon_reg hwmon_reg)
>
> switch (hwmon_reg) {
> case REG_PKG_RAPL_LIMIT:
> - if (xe->info.platform == XE_DG2)
> - reg = PCU_CR_PACKAGE_RAPL_LIMIT;
> - else if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_PVC)
> reg = PVC_GT0_PACKAGE_RAPL_LIMIT;
> + else if (xe->info.platform == XE_DG2)
> + reg = PCU_CR_PACKAGE_RAPL_LIMIT;
> break;
> case REG_PKG_POWER_SKU:
> - if (xe->info.platform == XE_DG2)
> - reg = PCU_CR_PACKAGE_POWER_SKU;
> - else if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_PVC)
> reg = PVC_GT0_PACKAGE_POWER_SKU;
> + else if (xe->info.platform == XE_DG2)
> + reg = PCU_CR_PACKAGE_POWER_SKU;
> break;
> case REG_PKG_POWER_SKU_UNIT:
> - if (xe->info.platform == XE_DG2)
> - reg = PCU_CR_PACKAGE_POWER_SKU_UNIT;
> - else if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_PVC)
> reg = PVC_GT0_PACKAGE_POWER_SKU_UNIT;
> + else if (xe->info.platform == XE_DG2)
> + reg = PCU_CR_PACKAGE_POWER_SKU_UNIT;
> break;
> case REG_GT_PERF_STATUS:
> if (xe->info.platform == XE_DG2)
> reg = GT_PERF_STATUS;
> break;
> case REG_PKG_ENERGY_STATUS:
> - if (xe->info.platform == XE_DG2)
> - reg = PCU_CR_PACKAGE_ENERGY_STATUS;
> - else if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_PVC)
> reg = PVC_GT0_PLATFORM_ENERGY_STATUS;
> + else if (xe->info.platform == XE_DG2)
> + reg = PCU_CR_PACKAGE_ENERGY_STATUS;
> break;
> default:
> drm_warn(&xe->drm, "Unknown xe hwmon reg id: %d\n", hwmon_reg);
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-02-06 9:18 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-26 7:48 [PATCH] drm/xe/hwmon: Refactor xe hwmon Karthik Poosa
2024-01-26 7:43 ` ✓ CI.Patch_applied: success for " Patchwork
2024-01-26 7:43 ` ✗ CI.checkpatch: warning " Patchwork
2024-01-26 7:44 ` ✗ CI.KUnit: failure " Patchwork
2024-01-26 13:11 ` [PATCH] " Gupta, Anshuman
2024-01-26 18:14 ` Matt Roper
2024-01-26 15:04 ` Dong, Zhanjun
2024-01-29 19:55 ` Matt Roper
2024-02-01 4:58 ` Nilawar, Badal
-- strict thread matches above, loose matches on Subject: below --
2024-02-01 18:06 Karthik Poosa
2024-02-06 9:17 ` Nilawar, Badal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox