summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/gt/selftest_gt_pm.c
diff options
context:
space:
mode:
authorAnshuman Gupta <anshuman.gupta@intel.com>2023-02-23 13:05:02 +0300
committerAnshuman Gupta <anshuman.gupta@intel.com>2023-03-03 17:06:33 +0300
commit29b41cf707b5ecc55cab12bfa04fbd9811f4fd04 (patch)
treeeae917be5969dbdea2578f739e0414ff800ae569 /drivers/gpu/drm/i915/gt/selftest_gt_pm.c
parent506006055769b10d1b2b4e22f636f3b45e0e9fc7 (diff)
downloadlinux-29b41cf707b5ecc55cab12bfa04fbd9811f4fd04.tar.xz
drm/i915/selftest: Fix engine timestamp and ktime disparity
While reading the engine timestamps there can be uncontrollable concurrent mmio access via other i915 child drivers and by GuC, which is not truly atomic context as expected by this selftest, which may cause mmio latency to read the engine timestamps, Account such latency to calculate time to read engine timestamp such that selftest can validate the timestamp and ktime pair. Cc: Chris Wilson <chris.p.wilson@intel.com> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230223100503.3323627-2-anshuman.gupta@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/gt/selftest_gt_pm.c')
-rw-r--r--drivers/gpu/drm/i915/gt/selftest_gt_pm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/gt/selftest_gt_pm.c b/drivers/gpu/drm/i915/gt/selftest_gt_pm.c
index b46425aeb2f0..0971241707ce 100644
--- a/drivers/gpu/drm/i915/gt/selftest_gt_pm.c
+++ b/drivers/gpu/drm/i915/gt/selftest_gt_pm.c
@@ -63,8 +63,8 @@ static void measure_clocks(struct intel_engine_cs *engine,
udelay(1000);
- dt[i] = ktime_sub(ktime_get(), dt[i]);
cycles[i] += read_timestamp(engine);
+ dt[i] = ktime_sub(ktime_get(), dt[i]);
local_irq_enable();
}