3 * SPDX-License-Identifier: MIT
5 * Copyright © 2019 Intel Corporation
8 #include "selftest_llc.h"
9 #include "selftest_rc6.h"
11 static int live_gt_resume(void *arg
)
13 struct intel_gt
*gt
= arg
;
14 IGT_TIMEOUT(end_time
);
17 /* Do several suspend/resume cycles to check we don't explode! */
19 intel_gt_suspend_prepare(gt
);
20 intel_gt_suspend_late(gt
);
22 if (gt
->rc6
.enabled
) {
23 pr_err("rc6 still enabled after suspend!\n");
24 intel_gt_set_wedged_on_init(gt
);
29 err
= intel_gt_resume(gt
);
33 if (gt
->rc6
.supported
&& !gt
->rc6
.enabled
) {
34 pr_err("rc6 not enabled upon resume!\n");
35 intel_gt_set_wedged_on_init(gt
);
40 err
= st_llc_verify(>
->llc
);
42 pr_err("llc state not restored upon resume!\n");
43 intel_gt_set_wedged_on_init(gt
);
46 } while (!__igt_timeout(end_time
, NULL
));
51 int intel_gt_pm_live_selftests(struct drm_i915_private
*i915
)
53 static const struct i915_subtest tests
[] = {
54 SUBTEST(live_rc6_manual
),
55 SUBTEST(live_gt_resume
),
58 if (intel_gt_is_wedged(&i915
->gt
))
61 return intel_gt_live_subtests(tests
, &i915
->gt
);
64 int intel_gt_pm_late_selftests(struct drm_i915_private
*i915
)
66 static const struct i915_subtest tests
[] = {
68 * These tests may leave the system in an undesirable state.
69 * They are intended to be run last in CI and the system
70 * rebooted afterwards.
72 SUBTEST(live_rc6_ctx_wa
),
75 if (intel_gt_is_wedged(&i915
->gt
))
78 return intel_gt_live_subtests(tests
, &i915
->gt
);