[PATCH i-g-t 1/3] tests/intel/xe_pm: Fix runtime_pm tests
Rodrigo Vivi
rodrigo.vivi at intel.com
Wed Apr 3 15:14:07 UTC 2024
After the introduction of kernel commit
23cf006beac3 ("drm/xe: Runtime PM wake on every IOCTL")
the many ioctl called during dpms_on_off might be forcing
rpm to transition back and forth active to suspend.
Then, when setting the d3cold_allowed during a transitional
runtime_state, we got some situation where the runtime pm
might decide to keep the device awake for a very long time
even with runtime_usage == 0.
Then our tests would start to break like crazy:
(xe_pm:29453) igt_pm-WARNING: timeout: pm_status expected:suspended, got:active
(xe_pm:29453) CRITICAL: Test assertion failure function __igt_unique____real_main473, file ../tests/intel/xe_pm.c:556:
(xe_pm:29453) CRITICAL: Failed assertion: in_d3(device, d->state)
Stack trace:
#0 ../lib/igt_core.c:1989 __igt_fail_assert()
#1 ../tests/intel/xe_pm.c:432 __igt_unique____real_main473()
#2 ../tests/intel/xe_pm.c:473 main()
#3 [__libc_start_call_main+0x7a]
#4 [__libc_start_main+0x8b]
#5 [_start+0x25]
Subtest d3hot-basic failed.
**** DEBUG ****
(xe_pm:29453) igt_pm-WARNING: timeout: pm_status expected:suspended, got:active
By simply waiting the suspended state before we touch d3cold_allowed,
we get our tests back to a sane state.
Cc: Anshuman Gupta <anshuman.gupta at intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
Reviewed-by: Anshuman Gupta <anshuman.gupta at intel.com>
---
tests/intel/xe_pm.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tests/intel/xe_pm.c b/tests/intel/xe_pm.c
index a0045da0b..fcbed6249 100644
--- a/tests/intel/xe_pm.c
+++ b/tests/intel/xe_pm.c
@@ -121,6 +121,16 @@ static bool setup_d3(device_t device, enum igt_acpi_d_state state)
{
dpms_on_off(device, DRM_MODE_DPMS_OFF);
+ /*
+ * The drm calls used for dpms status above will result in IOCTLs
+ * that might wake up the device. Let's ensure the device is back
+ * to a stable suspended state before we can proceed with the
+ * configuration below, since some strange failures were seen
+ * when d3cold_allowed is toggle while runtime is in a transition
+ * state.
+ */
+ igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED);
+
switch (state) {
case IGT_ACPI_D3Cold:
igt_require(igt_pm_acpi_d3cold_supported(device.pci_root));
--
2.44.0
More information about the igt-dev
mailing list