The timer delta in the driver is calculated using hardware
written value to PPHWSP/LRC image and previously stored value.
As seen in [1] this difference may become negative for graphics
version 12 as a cause of quirk in updating mechanism explained
in [2]. This, in turn, causes -EOVERFLOW to be thrown inside
live_pphwsp_runtime test.

Similar problem with gen 12 has been observed [3] and addressed
in [4], so follow suit and disable the test here as well.

[1] https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/16521
[2] HSD #16010904313
[3] https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/13697
[4] "73782fc64793 (i915/gt/selftests: Disable lrc_timestamp test)"

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/16521
Signed-off-by: Krzysztof Karas <[email protected]>
---
 drivers/gpu/drm/i915/gt/selftest_lrc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c 
b/drivers/gpu/drm/i915/gt/selftest_lrc.c
index 23f04f6f8fba..3be59324fdc1 100644
--- a/drivers/gpu/drm/i915/gt/selftest_lrc.c
+++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
@@ -1955,6 +1955,15 @@ static int live_pphwsp_runtime(void *arg)
        enum intel_engine_id id;
        int err = 0;
 
+       /*
+        * On Gen12 (TGL/DG2) a hardware timestamp updating mechanism
+        * could write a smaller than previously value to the register,
+        * so CTX_TIMESTAMP would appear to go backwards, causing
+        * sporadic underflow detections.
+        */
+       if (GRAPHICS_VER(gt->i915) == 12)
+               return 0;
+
        /*
         * Check that cumulative context runtime as stored in the pphwsp[16]
         * is monotonic.
-- 
2.34.1

Reply via email to