@@ -51,6 +51,7 @@ static int live_gt_resume(void *arg)
int intel_gt_pm_live_selftests(struct drm_i915_private *i915)
{
static const struct i915_subtest tests[] = {
+ SUBTEST(live_rc6_basic),
SUBTEST(live_rc6_busy),
SUBTEST(live_rc6_manual),
SUBTEST(live_rc6_threshold),
@@ -250,6 +250,43 @@ static bool is_rc6_active(struct intel_rc6 *rc6)
return !!measure_rc6(uncore, 2 * interval);
}
+int live_rc6_basic(void *arg)
+{
+ struct intel_gt *gt = arg;
+ struct intel_rc6 *rc6 = >->rc6;
+ intel_wakeref_t wakeref;
+ int i, err = 0;
+
+ if (!rc6->supported)
+ return 0;
+
+ wakeref = intel_runtime_pm_get(gt->uncore->rpm);
+
+ /*
+ * the two loops test rc6 both in case it's enabled
+ * and in the case it's disabled. It restores the prvious
+ * status
+ */
+ for (i = 0; i < 2; i++) {
+ if (rc6->enabled ^ is_rc6_active(rc6)) {
+ err = -EINVAL;
+
+ /* restore before leaving */
+ if (!i)
+ goto exit;
+ }
+
+ if (rc6->enabled)
+ intel_rc6_disable(>->rc6);
+ else
+ intel_rc6_enable(>->rc6);
+ }
+
+exit:
+ intel_runtime_pm_put(gt->uncore->rpm, wakeref);
+ return err;
+}
+
int live_rc6_threshold(void *arg)
{
struct intel_gt *gt = arg;
@@ -7,6 +7,7 @@
#ifndef SELFTEST_RC6_H
#define SELFTEST_RC6_H
+int live_rc6_basic(void *arg);
int live_rc6_busy(void *arg);
int live_rc6_ctx_wa(void *arg);
int live_rc6_manual(void *arg);