All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/debugfs: Fix perf_limit_reasons debugfs
@ 2022-09-17  3:15 Ashutosh Dixit
  2022-09-17  3:54 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ashutosh Dixit @ 2022-09-17  3:15 UTC (permalink / raw)
  To: intel-gfx; +Cc: Rodrigo Vivi

Register GT0_PERF_LIMIT_REASONS (0x1381a8) is available only for Gen11+.

On Gen < 5 igt@debugfs_test@read_all_entries results in the following oops:

<1> [88.829420] BUG: unable to handle page fault for address: ffffc90000bb81a8
<1> [88.829438] #PF: supervisor read access in kernel mode
<1> [88.829447] #PF: error_code(0x0000) - not-present page

Bspec: 20008
Fixes: fe5979665f64 ("drm/i915/debugfs: Add perf_limit_reasons in debugfs")
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c b/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c
index 68310881a793..e7f057821cd0 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c
@@ -660,6 +660,9 @@ static int perf_limit_reasons_get(void *data, u64 *val)
 	struct intel_gt *gt = data;
 	intel_wakeref_t wakeref;
 
+	if (GRAPHICS_VER(gt->i915) < 11)
+		return 0;
+
 	with_intel_runtime_pm(gt->uncore->rpm, wakeref)
 		*val = intel_uncore_read(gt->uncore, intel_gt_perf_limit_reasons_reg(gt));
 
@@ -671,6 +674,9 @@ static int perf_limit_reasons_clear(void *data, u64 val)
 	struct intel_gt *gt = data;
 	intel_wakeref_t wakeref;
 
+	if (GRAPHICS_VER(gt->i915) < 11)
+		return 0;
+
 	/*
 	 * Clear the upper 16 "log" bits, the lower 16 "status" bits are
 	 * read-only. The upper 16 "log" bits are identical to the lower 16
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-19  3:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-17  3:15 [Intel-gfx] [PATCH] drm/i915/debugfs: Fix perf_limit_reasons debugfs Ashutosh Dixit
2022-09-17  3:54 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2022-09-17  4:10 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-09-17  5:16 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-09-19  3:14 ` [Intel-gfx] [PATCH] " Dixit, Ashutosh

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.