drm/i915/selftests: Common live setup/teardown
Subsystems (2)
PATCH 1/1 drm/i915/selftests: Common live setup/teardown
We frequently, and not frequently enough, remember to flush residual openations and objects at the end of a live subtest. The purpose is to cleanup after every subtest, leaving a clean slate for the next subtest, and perform early detection of leaky state.
--- .../i915/gem/selftests/i915_gem_client_blt.c | 11 ++--- .../drm/i915/gem/selftests/i915_gem_context.c | 2 +- .../i915/gem/selftests/i915_gem_object_blt.c | 11 ++--- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 2 +- drivers/gpu/drm/i915/gt/selftest_lrc.c | 16 +------ drivers/gpu/drm/i915/gt/selftest_timeline.c | 4 +- drivers/gpu/drm/i915/i915_selftest.h | 18 +++++++- drivers/gpu/drm/i915/selftests/i915_gem.c | 6 +-- .../gpu/drm/i915/selftests/i915_selftest.c | 44 ++++++++++++++++++- 9 files changed, 71 insertions(+), 43 deletions(-)
drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c +3 -8
@@ -11,8 +11,8 @@static int igt_client_fill (void *arg) { -struct intel_context *ce = arg; -struct drm_i915_private *i915 = ce->gem_context->i915; +struct drm_i915_private *i915 = arg; +struct intel_context *ce = i915->engine[BCS0 ]->kernel_context;struct drm_i915_gem_object *obj;struct rnd_state prng;IGT_TIMEOUT (end);
@@ -89,11 +89,6 @@ static int igt_client_fill(void *arg) err_put:i915_gem_object_put (obj); err_flush: -mutex_lock (&i915->drm.struct_mutex); -if (igt_flush_test (i915,I915_WAIT_LOCKED )) - err = -EIO ; -mutex_unlock (&i915->drm.struct_mutex); -if (err == -ENOMEM ) err =0 ;
@@ -112,5 +107,5 @@ int i915_gem_client_blt_live_selftests(struct drm_i915_private *i915)if (!HAS_ENGINE (i915,BCS0 ))return 0 ; -return i915_subtests (tests, i915->engine[BCS0 ]->kernel_context); +return i915_live_subtests (tests, i915); }
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c +1 -1
@@ -1731,5 +1731,5 @@ int i915_gem_context_live_selftests(struct drm_i915_private *dev_priv)if (i915_terminally_wedged (dev_priv))return 0 ; -return i915_subtests (tests, dev_priv); +return i915_live_subtests (tests, dev_priv); }
drivers/gpu/drm/i915/gem/selftests/i915_gem_object_blt.c +3 -8
@@ -11,8 +11,8 @@static int igt_fill_blt (void *arg) { -struct intel_context *ce = arg; -struct drm_i915_private *i915 = ce->gem_context->i915; +struct drm_i915_private *i915 = arg; +struct intel_context *ce = i915->engine[BCS0 ]->kernel_context;struct drm_i915_gem_object *obj;struct rnd_state prng;IGT_TIMEOUT (end);
@@ -83,11 +83,6 @@ static int igt_fill_blt(void *arg) err_put:i915_gem_object_put (obj); err_flush: -mutex_lock (&i915->drm.struct_mutex); -if (igt_flush_test (i915,I915_WAIT_LOCKED )) - err = -EIO ; -mutex_unlock (&i915->drm.struct_mutex); -if (err == -ENOMEM ) err =0 ;
@@ -106,5 +101,5 @@ int i915_gem_object_blt_live_selftests(struct drm_i915_private *i915)if (!HAS_ENGINE (i915,BCS0 ))return 0 ; -return i915_subtests (tests, i915->engine[BCS0 ]->kernel_context); +return i915_live_subtests (tests, i915); }
drivers/gpu/drm/i915/gt/selftest_hangcheck.c +1 -1
@@ -1744,7 +1744,7 @@ int intel_hangcheck_live_selftests(struct drm_i915_private *i915) saved_hangcheck =fetch_and_zero (&i915_modparams.enable_hangcheck);drain_delayed_work (&i915->gpu_error.hangcheck_work);/* flush param */ - err =i915_subtests (tests, i915); + err =i915_live_subtests (tests, i915);mutex_lock (&i915->drm.struct_mutex);igt_flush_test (i915,I915_WAIT_LOCKED );
drivers/gpu/drm/i915/gt/selftest_lrc.c +1 -15
@@ -73,7 +73,6 @@ static int live_sanitycheck(void *arg) err_spin:igt_spinner_fini (&spin); err_unlock: -igt_flush_test (i915,I915_WAIT_LOCKED );intel_runtime_pm_put (&i915->runtime_pm, wakeref);mutex_unlock (&i915->drm.struct_mutex);return err;
@@ -290,8 +289,6 @@ static int live_timeslice_preempt(void *arg) err_obj:i915_gem_object_put (obj); err_unlock: -if (igt_flush_test (i915,I915_WAIT_LOCKED )) - err = -EIO ;intel_runtime_pm_put (&i915->runtime_pm, wakeref);mutex_unlock (&i915->drm.struct_mutex);
@@ -472,8 +469,6 @@ static int live_busywait_preempt(void *arg) err_ctx_hi:kernel_context_close (ctx_hi); err_unlock: -if (igt_flush_test (i915,I915_WAIT_LOCKED )) - err = -EIO ;intel_runtime_pm_put (&i915->runtime_pm, wakeref);mutex_unlock (&i915->drm.struct_mutex);return err;
@@ -580,7 +575,6 @@ static int live_preempt(void *arg) err_spin_hi:igt_spinner_fini (&spin_hi); err_unlock: -igt_flush_test (i915,I915_WAIT_LOCKED );intel_runtime_pm_put (&i915->runtime_pm, wakeref);mutex_unlock (&i915->drm.struct_mutex);return err;
@@ -687,7 +681,6 @@ static int live_late_preempt(void *arg) err_spin_hi:igt_spinner_fini (&spin_hi); err_unlock: -igt_flush_test (i915,I915_WAIT_LOCKED );intel_runtime_pm_put (&i915->runtime_pm, wakeref);mutex_unlock (&i915->drm.struct_mutex);return err;
@@ -826,8 +819,6 @@ static int live_suppress_self_preempt(void *arg) err_client_a:preempt_client_fini (&a); err_unlock: -if (igt_flush_test (i915,I915_WAIT_LOCKED )) - err = -EIO ;intel_runtime_pm_put (&i915->runtime_pm, wakeref);mutex_unlock (&i915->drm.struct_mutex);return err;
@@ -995,8 +986,6 @@ static int live_suppress_wait_preempt(void *arg) err_client_0:preempt_client_fini (&client[0 ]); err_unlock: -if (igt_flush_test (i915,I915_WAIT_LOCKED )) - err = -EIO ;intel_runtime_pm_put (&i915->runtime_pm, wakeref);mutex_unlock (&i915->drm.struct_mutex);return err;
@@ -1143,8 +1132,6 @@ static int live_chain_preempt(void *arg) err_client_hi:preempt_client_fini (&hi); err_unlock: -if (igt_flush_test (i915,I915_WAIT_LOCKED )) - err = -EIO ;intel_runtime_pm_put (&i915->runtime_pm, wakeref);mutex_unlock (&i915->drm.struct_mutex);return err;
@@ -1270,7 +1257,6 @@ static int live_preempt_hang(void *arg) err_spin_hi:igt_spinner_fini (&spin_hi); err_unlock: -igt_flush_test (i915,I915_WAIT_LOCKED );intel_runtime_pm_put (&i915->runtime_pm, wakeref);mutex_unlock (&i915->drm.struct_mutex);return err;
@@ -2054,5 +2040,5 @@ int intel_execlists_live_selftests(struct drm_i915_private *i915)if (i915_terminally_wedged (i915))return 0 ; -return i915_subtests (tests, i915); +return i915_live_subtests (tests, i915); }
drivers/gpu/drm/i915/gt/selftest_timeline.c +1 -3
@@ -821,8 +821,6 @@ static int live_hwsp_recycle(void *arg) } out: -if (igt_flush_test (i915,I915_WAIT_LOCKED )) - err = -EIO ;intel_runtime_pm_put (&i915->runtime_pm, wakeref);mutex_unlock (&i915->drm.struct_mutex);
@@ -841,5 +839,5 @@ int intel_timeline_live_selftests(struct drm_i915_private *i915)if (i915_terminally_wedged (i915))return 0 ; -return i915_subtests (tests, i915); +return i915_live_subtests (tests, i915); }
drivers/gpu/drm/i915/i915_selftest.h +17 -1
@@ -66,12 +66,28 @@ struct i915_subtest {const char *name; }; +int __i915_nop_setup (void *data); +int __i915_nop_teardown (int err,void *data); + +int __i915_live_setup (void *data); +int __i915_live_teardown (int err,void *data); +int __i915_subtests (const char *caller, +int (*setup)(void *data), +int (*teardown)(int err,void *data),const struct i915_subtest *st,unsigned int count,void *data);#define i915_subtests (T , data) \ - __i915_subtests(__func__, T, ARRAY_SIZE(T), data) + __i915_subtests(__func__, \ + __i915_nop_setup, __i915_nop_teardown, \ + T, ARRAY_SIZE(T), data) +#define i915_live_subtests (T , data) ({ \ + typecheck(struct drm_i915_private *, data); \ + __i915_subtests(__func__, \ + __i915_live_setup, __i915_live_teardown, \ + T, ARRAY_SIZE(T), data); \ +})#define SUBTEST (x) { x, #x }
drivers/gpu/drm/i915/selftests/i915_gem.c +1 -5
@@ -154,8 +154,6 @@ static int igt_gem_suspend(void *arg)mutex_lock (&i915->drm.struct_mutex); err =switch_to_context (i915, ctx); -if (igt_flush_test (i915,I915_WAIT_LOCKED )) - err = -EIO ;mutex_unlock (&i915->drm.struct_mutex); out:mock_file_free (i915, file);
@@ -195,8 +193,6 @@ static int igt_gem_hibernate(void *arg)mutex_lock (&i915->drm.struct_mutex); err =switch_to_context (i915, ctx); -if (igt_flush_test (i915,I915_WAIT_LOCKED )) - err = -EIO ;mutex_unlock (&i915->drm.struct_mutex); out:mock_file_free (i915, file);
@@ -213,5 +209,5 @@ int i915_gem_live_selftests(struct drm_i915_private *i915)if (i915_terminally_wedged (i915))return 0 ; -return i915_subtests (tests, i915); +return i915_live_subtests (tests, i915); }
drivers/gpu/drm/i915/selftests/i915_selftest.c +43 -1
66 lines not on this page · raw message
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for drm/i915/selftests: Common live setup/teardown
== Series Details ==
== Series Details ==
Series: drm/i915/selftests: Common live setup/teardown
URL : https://patchwork.freedesktop.org/series/63099/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
5f846dba1d19 drm/i915/selftests: Common live setup/teardown
-:239: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'T' - possible side-effects?
#239: FILE: drivers/gpu/drm/i915/i915_selftest.h:85:
+#define i915_live_subtests(T, data) ({ \
+ typecheck(struct drm_i915_private *, data); \
+ __i915_subtests(__func__, \
+ __i915_live_setup, __i915_live_teardown, \
+ T, ARRAY_SIZE(T), data); \
+})total: 0 errors, 0 warnings, 1 checks, 273 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/i915/selftests: Common live setup/teardown
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: drm/i915/selftests: Common live setup/teardown
URL : https://patchwork.freedesktop.org/series/63099/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_6398 -> Patchwork_13498
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_13498 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_13498, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_13498:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live_contexts:
- fi-skl-iommu: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6398/fi-skl-iommu/igt@i915_selftest@live_contexts.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/fi-skl-iommu/igt@i915_selftest@live_contexts.html
* igt@runner@aborted:
- fi-bdw-gvtdvm: NOTRUN -> [FAIL][3]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/fi-bdw-gvtdvm/igt@[email protected]
- fi-cml-u: NOTRUN -> [FAIL][4]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/fi-cml-u/igt@[email protected]
#### Warnings ####
* igt@i915_selftest@live_contexts:
- fi-bdw-gvtdvm: [INCOMPLETE][5] ([fdo#110976]) -> [TIMEOUT][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6398/fi-bdw-gvtdvm/igt@i915_selftest@live_contexts.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/fi-bdw-gvtdvm/igt@i915_selftest@live_contexts.html
Known issues
------------
Here are the changes found in Patchwork_13498 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_module_load@reload:
- fi-blb-e6850: [PASS][7] -> [INCOMPLETE][8] ([fdo#107718])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6398/fi-blb-e6850/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/fi-blb-e6850/igt@[email protected]
* igt@i915_pm_rpm@module-reload:
- fi-cml-u: [PASS][9] -> [DMESG-WARN][10] ([fdo#111012])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6398/fi-cml-u/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/fi-cml-u/igt@[email protected]
* igt@kms_frontbuffer_tracking@basic:
- fi-hsw-peppy: [PASS][11] -> [DMESG-WARN][12] ([fdo#102614])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6398/fi-hsw-peppy/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/fi-hsw-peppy/igt@[email protected]
- fi-icl-u2: [PASS][13] -> [FAIL][14] ([fdo#103167])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6398/fi-icl-u2/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/fi-icl-u2/igt@[email protected]
* igt@vgem_basic@unload:
- fi-icl-u3: [PASS][15] -> [DMESG-WARN][16] ([fdo#107724])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6398/fi-icl-u3/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/fi-icl-u3/igt@[email protected]
#### Possible fixes ####
* igt@gem_ctx_create@basic-files:
- fi-icl-dsi: [INCOMPLETE][17] ([fdo#107713] / [fdo#109100]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6398/fi-icl-dsi/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/fi-icl-dsi/igt@[email protected]
* igt@i915_pm_rpm@module-reload:
- fi-kbl-r: [DMESG-WARN][19] ([fdo#111012]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6398/fi-kbl-r/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/fi-kbl-r/igt@[email protected]
- fi-hsw-peppy: [DMESG-WARN][21] ([fdo#111012]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6398/fi-hsw-peppy/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/fi-hsw-peppy/igt@[email protected]
* igt@i915_selftest@live_contexts:
- fi-skl-gvtdvm: [INCOMPLETE][23] ([fdo#110976]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6398/fi-skl-gvtdvm/igt@i915_selftest@live_contexts.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/fi-skl-gvtdvm/igt@i915_selftest@live_contexts.html
* igt@prime_vgem@basic-read:
- fi-icl-u3: [DMESG-WARN][25] ([fdo#107724]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6398/fi-icl-u3/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/fi-icl-u3/igt@[email protected]
[fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#109100]: https://bugs.freedesktop.org/show_bug.cgi?id=109100
[fdo#110976]: https://bugs.freedesktop.org/show_bug.cgi?id=110976
[fdo#111012]: https://bugs.freedesktop.org/show_bug.cgi?id=111012
Participating hosts (55 -> 46)
------------------------------
Missing (9): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-icl-guc fi-byt-clapper fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_6398 -> Patchwork_13498
CI_DRM_6398: 9b9df28dc0ec04a7fb1a020d869ef0ea14be4d14 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5079: 873df2fa9e8f5fd02d4532b30ef2579f4fe4f27f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13498: 5f846dba1d19aa22b01c72b38b03cd6f7ed0e8a9 @ git://anongit.freedesktop.org/gfx-ci/linux
== Kernel 32bit build ==
Warning: Kernel 32bit buildtest failed:
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/build_32bit.log
CALL scripts/checksyscalls.sh CALL scripts/atomic/check-atomics.sh CHK include/generated/compile.h
Kernel: arch/x86/boot/bzImage is ready (#1)
Building modules, stage 2.
MODPOST 112 modules
ERROR: "__udivdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: "__divdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! scripts/Makefile.modpost:91: recipe for target '__modpost' failed make[1]: *** [__modpost] Error 1
Makefile:1287: recipe for target 'modules' failed
make: *** [modules] Error 2
== Linux commits ==
5f846dba1d19 drm/i915/selftests: Common live setup/teardown
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13498/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx