All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/selftests: add basic selftests for rc6
@ 2020-02-05 10:57 Chris Wilson
  2020-02-05 14:31 ` Mika Kuoppala
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Chris Wilson @ 2020-02-05 10:57 UTC (permalink / raw)
  To: intel-gfx

From: Andi Shyti <andi.shyti@intel.com>

Add three basic tests for rc6 power status:

1. live_rc6_basic - simply checks if rc6 works when it's enabled
   or stops when it's disabled.

2. live_rc6_threshold - rc6 should not work when the evaluation
   interval is less than the threshold and should work otherwise.

3. live_rc6_busy - keeps the gpu busy and then goes in idle;
   checks that we don't fall in rc6 when busy and that we do fall
   in rc6 when idling.

The three tests are added as sutest of the bigger live_late_gt_pm
selftest.

The basic rc6 functionality is tested by checking the reference
counter within the evaluation interval.

Signed-off-by: Andi Shyti <andi.shyti@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/selftest_gt_pm.c |   2 +
 drivers/gpu/drm/i915/gt/selftest_rc6.c   | 173 +++++++++++++++++++++++
 drivers/gpu/drm/i915/gt/selftest_rc6.h   |   2 +
 3 files changed, 177 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/selftest_gt_pm.c b/drivers/gpu/drm/i915/gt/selftest_gt_pm.c
index 09ff8e4f88af..5c7b92301a14 100644
--- a/drivers/gpu/drm/i915/gt/selftest_gt_pm.c
+++ b/drivers/gpu/drm/i915/gt/selftest_gt_pm.c
@@ -52,6 +52,8 @@ int intel_gt_pm_live_selftests(struct drm_i915_private *i915)
 {
 	static const struct i915_subtest tests[] = {
 		SUBTEST(live_rc6_manual),
+		SUBTEST(live_rc6_threshold),
+		SUBTEST(live_rc6_busy),
 		SUBTEST(live_gt_resume),
 	};
 
diff --git a/drivers/gpu/drm/i915/gt/selftest_rc6.c b/drivers/gpu/drm/i915/gt/selftest_rc6.c
index 5f7e2dcf5686..92375f458845 100644
--- a/drivers/gpu/drm/i915/gt/selftest_rc6.c
+++ b/drivers/gpu/drm/i915/gt/selftest_rc6.c
@@ -11,6 +11,7 @@
 #include "selftest_rc6.h"
 
 #include "selftests/i915_random.h"
+#include "selftests/igt_spinner.h"
 
 int live_rc6_manual(void *arg)
 {
@@ -202,3 +203,175 @@ int live_rc6_ctx_wa(void *arg)
 	kfree(engines);
 	return err;
 }
+
+static bool test_rc6(struct intel_rc6 *rc6, bool enabled)
+{
+	struct intel_uncore *uncore = rc6_to_uncore(rc6);
+	intel_wakeref_t wakeref;
+	u32 ec1, ec2;
+	u32 interval;
+
+	wakeref = intel_runtime_pm_get(uncore->rpm);
+
+	interval = intel_uncore_read(uncore, GEN6_RC_EVALUATION_INTERVAL);
+
+	/*
+	 * the interval is stored in steps of 1.28us
+	 */
+	interval = div_u64(mul_u32_u32(interval, 128),
+			   100 * 1000); /* => miliseconds */
+
+	ec1 = intel_uncore_read(uncore, GEN6_GT_GFX_RC6);
+
+	/*
+	 * It's not important to precisely wait the interval time.
+	 * I'll wait at least twice the time in order to be sure
+	 * that the counting happens in the reference counter.
+	 */
+	msleep(2 * interval);
+
+	ec2 = intel_uncore_read(uncore, GEN6_GT_GFX_RC6);
+
+	pr_info("interval:%x [%dms], threshold:%x, rc6:%x, enabled?:%s\n",
+		intel_uncore_read(uncore, GEN6_RC_EVALUATION_INTERVAL),
+		interval,
+		intel_uncore_read(uncore, GEN6_RC6_THRESHOLD),
+	       	ec2 - ec1,
+	       	yesno(enabled));
+
+	intel_runtime_pm_put(uncore->rpm, wakeref);
+
+	return enabled != (ec1 >= ec2);
+}
+
+int live_rc6_threshold(void *arg)
+{
+	struct intel_gt *gt = arg;
+	struct intel_uncore *uncore = gt->uncore;
+	struct intel_rc6 *rc6 = &gt->rc6;
+	intel_wakeref_t wakeref;
+	u32 threshold, interval;
+	u32 t_orig, i_orig;
+	int err = 0;
+
+	if (!rc6->manual) /* No interferring PCU! */
+		return 0;
+
+	wakeref = intel_runtime_pm_get(uncore->rpm);
+
+	__intel_rc6_disable(rc6); /* stop before adjusting thresholds */
+
+	t_orig = intel_uncore_read(uncore, GEN6_RC6_THRESHOLD);
+	i_orig = intel_uncore_read(uncore, GEN6_RC_EVALUATION_INTERVAL);
+
+	/*
+	 * set the threshold to 50ms
+	 *
+	 * 50ms * 1000 = 50000us
+	 * 50000 / (1.28 * 100) / 100 (we don't have floating point)
+	 */
+	threshold = 50 * 1000 / 128 * 100;
+	intel_uncore_write(uncore, GEN6_RC6_THRESHOLD, threshold);
+
+	/* set interval indicatively to half the threshold */
+	interval = threshold / 2;
+	intel_uncore_write(uncore, GEN6_RC_EVALUATION_INTERVAL, interval);
+
+	intel_rc6_unpark(rc6);
+
+	/* interval < threshold */
+	if (!test_rc6(rc6, false)) {
+		pr_err("i915 mismatch: rc6 with interval < threshold\n");
+		err = -EINVAL;
+	}
+
+	__intel_rc6_disable(rc6);
+
+	/* set interval indicatively to twice the threshold */
+	interval = threshold * 2;
+	intel_uncore_write(uncore, GEN6_RC_EVALUATION_INTERVAL, interval);
+
+	intel_rc6_unpark(rc6);
+
+	/* interval > threshold */
+	if (!test_rc6(rc6, true)) {
+		pr_err("i915 mismatch: not in rc6 with interval > threshold\n");
+		err = -EINVAL;
+	}
+
+	__intel_rc6_disable(rc6);
+
+	intel_uncore_write(uncore, GEN6_RC6_THRESHOLD, t_orig);
+	intel_uncore_write(uncore, GEN6_RC_EVALUATION_INTERVAL, i_orig);
+
+	intel_rc6_park(rc6);
+
+	intel_runtime_pm_put(uncore->rpm, wakeref);
+
+	return err;
+}
+
+int live_rc6_busy(void *arg)
+{
+	struct intel_gt *gt = arg;
+	struct intel_rc6 *rc6 = &gt->rc6;
+	struct intel_engine_cs *engine;
+	struct igt_spinner spin;
+	intel_wakeref_t wakeref;
+	enum intel_engine_id id;
+	int err;
+
+	if (!rc6->supported)
+		return 0;
+
+	err = igt_spinner_init(&spin, gt);
+	if (err)
+		return err;
+
+	wakeref = intel_runtime_pm_get(gt->uncore->rpm);
+	for_each_engine(engine, gt, id) {
+		struct i915_request *rq;
+
+		rq = igt_spinner_create_request(&spin,
+						engine->kernel_context,
+						MI_NOOP);
+		if (IS_ERR(rq)) {
+			err = PTR_ERR(rq);
+			break;
+		}
+
+		i915_request_get(rq);
+		i915_request_add(rq);
+
+		igt_wait_for_spinner(&spin, rq); /* it's enough waiting */
+
+		/* gpu is busy, we shouldn't be in rc6 */
+		if (!test_rc6(rc6, false)) {
+			pr_err("%s: never busy enough for having a nap\n",
+			       engine->name);
+			err = -EINVAL;
+		}
+
+		igt_spinner_end(&spin);
+		if (i915_request_wait(rq, 0, HZ / 5) < 0)
+			err = -ETIME;
+		i915_request_put(rq);
+		if (err)
+			break;
+
+		intel_gt_wait_for_idle(gt, HZ / 5);
+		intel_gt_pm_wait_for_idle(gt);
+
+		/* gpu is idle, we should be in rc6 */
+		if (!test_rc6(rc6, true)) {
+			pr_err("%s is idle but doesn't go in rc6\n",
+			       engine->name);
+			err = -EINVAL;
+			break;
+		}
+	}
+	intel_runtime_pm_put(gt->uncore->rpm, wakeref);
+
+	igt_spinner_fini(&spin);
+	return err;
+}
diff --git a/drivers/gpu/drm/i915/gt/selftest_rc6.h b/drivers/gpu/drm/i915/gt/selftest_rc6.h
index 762fd442d7b2..312894423dc2 100644
--- a/drivers/gpu/drm/i915/gt/selftest_rc6.h
+++ b/drivers/gpu/drm/i915/gt/selftest_rc6.h
@@ -7,7 +7,9 @@
 #ifndef SELFTEST_RC6_H
 #define SELFTEST_RC6_H
 
+int live_rc6_busy(void *arg);
 int live_rc6_ctx_wa(void *arg);
 int live_rc6_manual(void *arg);
+int live_rc6_threshold(void *arg);
 
 #endif /* SELFTEST_RC6_H */
-- 
2.25.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915/selftests: add basic selftests for rc6
  2020-02-05 10:57 [Intel-gfx] [PATCH] drm/i915/selftests: add basic selftests for rc6 Chris Wilson
@ 2020-02-05 14:31 ` Mika Kuoppala
  2020-02-05 18:40   ` Andi Shyti
  2020-02-05 15:06 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/selftests: add basic selftests for rc6 (rev5) Patchwork
  2020-02-05 15:37 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
  2 siblings, 1 reply; 9+ messages in thread
From: Mika Kuoppala @ 2020-02-05 14:31 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

Chris Wilson <chris@chris-wilson.co.uk> writes:

> From: Andi Shyti <andi.shyti@intel.com>
>
> Add three basic tests for rc6 power status:
>
> 1. live_rc6_basic - simply checks if rc6 works when it's enabled
>    or stops when it's disabled.
>
> 2. live_rc6_threshold - rc6 should not work when the evaluation
>    interval is less than the threshold and should work otherwise.
>
> 3. live_rc6_busy - keeps the gpu busy and then goes in idle;
>    checks that we don't fall in rc6 when busy and that we do fall
>    in rc6 when idling.
>
> The three tests are added as sutest of the bigger live_late_gt_pm
> selftest.
>
> The basic rc6 functionality is tested by checking the reference
> counter within the evaluation interval.
>
> Signed-off-by: Andi Shyti <andi.shyti@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/gt/selftest_gt_pm.c |   2 +
>  drivers/gpu/drm/i915/gt/selftest_rc6.c   | 173 +++++++++++++++++++++++
>  drivers/gpu/drm/i915/gt/selftest_rc6.h   |   2 +
>  3 files changed, 177 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/gt/selftest_gt_pm.c b/drivers/gpu/drm/i915/gt/selftest_gt_pm.c
> index 09ff8e4f88af..5c7b92301a14 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_gt_pm.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_gt_pm.c
> @@ -52,6 +52,8 @@ int intel_gt_pm_live_selftests(struct drm_i915_private *i915)
>  {
>  	static const struct i915_subtest tests[] = {
>  		SUBTEST(live_rc6_manual),
> +		SUBTEST(live_rc6_threshold),
> +		SUBTEST(live_rc6_busy),
>  		SUBTEST(live_gt_resume),
>  	};
>  
> diff --git a/drivers/gpu/drm/i915/gt/selftest_rc6.c b/drivers/gpu/drm/i915/gt/selftest_rc6.c
> index 5f7e2dcf5686..92375f458845 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_rc6.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_rc6.c
> @@ -11,6 +11,7 @@
>  #include "selftest_rc6.h"
>  
>  #include "selftests/i915_random.h"
> +#include "selftests/igt_spinner.h"
>  
>  int live_rc6_manual(void *arg)
>  {
> @@ -202,3 +203,175 @@ int live_rc6_ctx_wa(void *arg)
>  	kfree(engines);
>  	return err;
>  }
> +
> +static bool test_rc6(struct intel_rc6 *rc6, bool enabled)
> +{
> +	struct intel_uncore *uncore = rc6_to_uncore(rc6);
> +	intel_wakeref_t wakeref;
> +	u32 ec1, ec2;
> +	u32 interval;
> +
> +	wakeref = intel_runtime_pm_get(uncore->rpm);
> +
> +	interval = intel_uncore_read(uncore, GEN6_RC_EVALUATION_INTERVAL);
> +
> +	/*
> +	 * the interval is stored in steps of 1.28us
> +	 */
> +	interval = div_u64(mul_u32_u32(interval, 128),
> +			   100 * 1000); /* => miliseconds */
> +

s/miliseconds/milliseconds.

I have a faint memory that the interval was not always 1.28us
but gen dependant.

> +	ec1 = intel_uncore_read(uncore, GEN6_GT_GFX_RC6);
> +
> +	/*
> +	 * It's not important to precisely wait the interval time.
> +	 * I'll wait at least twice the time in order to be sure
> +	 * that the counting happens in the reference counter.
> +	 */
> +	msleep(2 * interval);
> +
> +	ec2 = intel_uncore_read(uncore, GEN6_GT_GFX_RC6);
> +
> +	pr_info("interval:%x [%dms], threshold:%x, rc6:%x, enabled?:%s\n",
> +		intel_uncore_read(uncore, GEN6_RC_EVALUATION_INTERVAL),
> +		interval,
> +		intel_uncore_read(uncore, GEN6_RC6_THRESHOLD),
> +	       	ec2 - ec1,
> +	       	yesno(enabled));
> +
> +	intel_runtime_pm_put(uncore->rpm, wakeref);
> +
> +	return enabled != (ec1 >= ec2);

Wrap?

> +}
> +
> +int live_rc6_threshold(void *arg)
> +{
> +	struct intel_gt *gt = arg;
> +	struct intel_uncore *uncore = gt->uncore;
> +	struct intel_rc6 *rc6 = &gt->rc6;
> +	intel_wakeref_t wakeref;
> +	u32 threshold, interval;
> +	u32 t_orig, i_orig;
> +	int err = 0;
> +
> +	if (!rc6->manual) /* No interferring PCU! */
> +		return 0;
> +
> +	wakeref = intel_runtime_pm_get(uncore->rpm);
> +
> +	__intel_rc6_disable(rc6); /* stop before adjusting thresholds */
> +
> +	t_orig = intel_uncore_read(uncore, GEN6_RC6_THRESHOLD);
> +	i_orig = intel_uncore_read(uncore, GEN6_RC_EVALUATION_INTERVAL);
> +
> +	/*
> +	 * set the threshold to 50ms
> +	 *
> +	 * 50ms * 1000 = 50000us
> +	 * 50000 / (1.28 * 100) / 100 (we don't have floating point)
> +	 */
> +	threshold = 50 * 1000 / 128 * 100;
> +	intel_uncore_write(uncore, GEN6_RC6_THRESHOLD, threshold);
> +
> +	/* set interval indicatively to half the threshold */
> +	interval = threshold / 2;
> +	intel_uncore_write(uncore, GEN6_RC_EVALUATION_INTERVAL, interval);
> +
> +	intel_rc6_unpark(rc6);
> +
> +	/* interval < threshold */
> +	if (!test_rc6(rc6, false)) {

consider removing the assertion of 'activeness' in parameter
and just if (!rc6_active(rc6)). Or am I missing something in here?

-Mika

> +		pr_err("i915 mismatch: rc6 with interval < threshold\n");
> +		err = -EINVAL;
> +	}
> +
> +	__intel_rc6_disable(rc6);
> +
> +	/* set interval indicatively to twice the threshold */
> +	interval = threshold * 2;
> +	intel_uncore_write(uncore, GEN6_RC_EVALUATION_INTERVAL, interval);
> +
> +	intel_rc6_unpark(rc6);
> +
> +	/* interval > threshold */
> +	if (!test_rc6(rc6, true)) {
> +		pr_err("i915 mismatch: not in rc6 with interval > threshold\n");
> +		err = -EINVAL;
> +	}
> +
> +	__intel_rc6_disable(rc6);
> +
> +	intel_uncore_write(uncore, GEN6_RC6_THRESHOLD, t_orig);
> +	intel_uncore_write(uncore, GEN6_RC_EVALUATION_INTERVAL, i_orig);
> +
> +	intel_rc6_park(rc6);
> +
> +	intel_runtime_pm_put(uncore->rpm, wakeref);
> +
> +	return err;
> +}
> +
> +int live_rc6_busy(void *arg)
> +{
> +	struct intel_gt *gt = arg;
> +	struct intel_rc6 *rc6 = &gt->rc6;
> +	struct intel_engine_cs *engine;
> +	struct igt_spinner spin;
> +	intel_wakeref_t wakeref;
> +	enum intel_engine_id id;
> +	int err;
> +
> +	if (!rc6->supported)
> +		return 0;
> +
> +	err = igt_spinner_init(&spin, gt);
> +	if (err)
> +		return err;
> +
> +	wakeref = intel_runtime_pm_get(gt->uncore->rpm);
> +	for_each_engine(engine, gt, id) {
> +		struct i915_request *rq;
> +
> +		rq = igt_spinner_create_request(&spin,
> +						engine->kernel_context,
> +						MI_NOOP);
> +		if (IS_ERR(rq)) {
> +			err = PTR_ERR(rq);
> +			break;
> +		}
> +
> +		i915_request_get(rq);
> +		i915_request_add(rq);
> +
> +		igt_wait_for_spinner(&spin, rq); /* it's enough waiting */
> +
> +		/* gpu is busy, we shouldn't be in rc6 */
> +		if (!test_rc6(rc6, false)) {
> +			pr_err("%s: never busy enough for having a nap\n",
> +			       engine->name);
> +			err = -EINVAL;
> +		}
> +
> +		igt_spinner_end(&spin);
> +		if (i915_request_wait(rq, 0, HZ / 5) < 0)
> +			err = -ETIME;
> +		i915_request_put(rq);
> +		if (err)
> +			break;
> +
> +		intel_gt_wait_for_idle(gt, HZ / 5);
> +		intel_gt_pm_wait_for_idle(gt);
> +
> +		/* gpu is idle, we should be in rc6 */
> +		if (!test_rc6(rc6, true)) {
> +			pr_err("%s is idle but doesn't go in rc6\n",
> +			       engine->name);
> +			err = -EINVAL;
> +			break;
> +		}
> +	}
> +	intel_runtime_pm_put(gt->uncore->rpm, wakeref);
> +
> +	igt_spinner_fini(&spin);
> +	return err;
> +}
> diff --git a/drivers/gpu/drm/i915/gt/selftest_rc6.h b/drivers/gpu/drm/i915/gt/selftest_rc6.h
> index 762fd442d7b2..312894423dc2 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_rc6.h
> +++ b/drivers/gpu/drm/i915/gt/selftest_rc6.h
> @@ -7,7 +7,9 @@
>  #ifndef SELFTEST_RC6_H
>  #define SELFTEST_RC6_H
>  
> +int live_rc6_busy(void *arg);
>  int live_rc6_ctx_wa(void *arg);
>  int live_rc6_manual(void *arg);
> +int live_rc6_threshold(void *arg);
>  
>  #endif /* SELFTEST_RC6_H */
> -- 
> 2.25.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/selftests: add basic selftests for rc6 (rev5)
  2020-02-05 10:57 [Intel-gfx] [PATCH] drm/i915/selftests: add basic selftests for rc6 Chris Wilson
  2020-02-05 14:31 ` Mika Kuoppala
@ 2020-02-05 15:06 ` Patchwork
  2020-02-05 15:37 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
  2 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2020-02-05 15:06 UTC (permalink / raw)
  To: Andi Shyti; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: add basic selftests for rc6 (rev5)
URL   : https://patchwork.freedesktop.org/series/69825/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
342c89d084c1 drm/i915/selftests: add basic selftests for rc6
-:89: ERROR:CODE_INDENT: code indent should use tabs where possible
#89: FILE: drivers/gpu/drm/i915/gt/selftest_rc6.c:239:
+^I       ^Iec2 - ec1,$

-:89: WARNING:SPACE_BEFORE_TAB: please, no space before tabs
#89: FILE: drivers/gpu/drm/i915/gt/selftest_rc6.c:239:
+^I       ^Iec2 - ec1,$

-:90: ERROR:CODE_INDENT: code indent should use tabs where possible
#90: FILE: drivers/gpu/drm/i915/gt/selftest_rc6.c:240:
+^I       ^Iyesno(enabled));$

-:90: WARNING:SPACE_BEFORE_TAB: please, no space before tabs
#90: FILE: drivers/gpu/drm/i915/gt/selftest_rc6.c:240:
+^I       ^Iyesno(enabled));$

-:107: WARNING:TYPO_SPELLING: 'interferring' may be misspelled - perhaps 'interfering'?
#107: FILE: drivers/gpu/drm/i915/gt/selftest_rc6.c:257:
+	if (!rc6->manual) /* No interferring PCU! */

total: 2 errors, 3 warnings, 0 checks, 199 lines checked

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/selftests: add basic selftests for rc6 (rev5)
  2020-02-05 10:57 [Intel-gfx] [PATCH] drm/i915/selftests: add basic selftests for rc6 Chris Wilson
  2020-02-05 14:31 ` Mika Kuoppala
  2020-02-05 15:06 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/selftests: add basic selftests for rc6 (rev5) Patchwork
@ 2020-02-05 15:37 ` Patchwork
  2 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2020-02-05 15:37 UTC (permalink / raw)
  To: Andi Shyti; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: add basic selftests for rc6 (rev5)
URL   : https://patchwork.freedesktop.org/series/69825/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_7869 -> Patchwork_16431
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with Patchwork_16431 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_16431, 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_16431/index.html

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_16431:

### IGT changes ###

#### Possible regressions ####

  * igt@i915_selftest@live_gt_pm:
    - fi-cfl-8700k:       [PASS][1] -> [DMESG-FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-cfl-8700k/igt@i915_selftest@live_gt_pm.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-cfl-8700k/igt@i915_selftest@live_gt_pm.html
    - fi-kbl-r:           [PASS][3] -> [DMESG-FAIL][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-kbl-r/igt@i915_selftest@live_gt_pm.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-kbl-r/igt@i915_selftest@live_gt_pm.html
    - fi-byt-j1900:       [PASS][5] -> [DMESG-FAIL][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-byt-j1900/igt@i915_selftest@live_gt_pm.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-byt-j1900/igt@i915_selftest@live_gt_pm.html
    - fi-cfl-8109u:       [PASS][7] -> [DMESG-FAIL][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-cfl-8109u/igt@i915_selftest@live_gt_pm.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-cfl-8109u/igt@i915_selftest@live_gt_pm.html
    - fi-bsw-nick:        [PASS][9] -> [DMESG-FAIL][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-bsw-nick/igt@i915_selftest@live_gt_pm.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-bsw-nick/igt@i915_selftest@live_gt_pm.html
    - fi-kbl-7500u:       [PASS][11] -> [DMESG-FAIL][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-kbl-7500u/igt@i915_selftest@live_gt_pm.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-kbl-7500u/igt@i915_selftest@live_gt_pm.html
    - fi-kbl-x1275:       [PASS][13] -> [DMESG-FAIL][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-kbl-x1275/igt@i915_selftest@live_gt_pm.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-kbl-x1275/igt@i915_selftest@live_gt_pm.html
    - fi-kbl-guc:         [PASS][15] -> [DMESG-FAIL][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-kbl-guc/igt@i915_selftest@live_gt_pm.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-kbl-guc/igt@i915_selftest@live_gt_pm.html
    - fi-skl-guc:         [PASS][17] -> [DMESG-FAIL][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-skl-guc/igt@i915_selftest@live_gt_pm.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-skl-guc/igt@i915_selftest@live_gt_pm.html
    - fi-icl-u3:          NOTRUN -> [DMESG-FAIL][19]
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-icl-u3/igt@i915_selftest@live_gt_pm.html
    - fi-snb-2600:        [PASS][20] -> [DMESG-FAIL][21]
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-snb-2600/igt@i915_selftest@live_gt_pm.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-snb-2600/igt@i915_selftest@live_gt_pm.html
    - fi-glk-dsi:         [PASS][22] -> [DMESG-FAIL][23]
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-glk-dsi/igt@i915_selftest@live_gt_pm.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-glk-dsi/igt@i915_selftest@live_gt_pm.html
    - fi-bsw-kefka:       [PASS][24] -> [DMESG-FAIL][25]
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-bsw-kefka/igt@i915_selftest@live_gt_pm.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-bsw-kefka/igt@i915_selftest@live_gt_pm.html
    - fi-byt-n2820:       NOTRUN -> [DMESG-FAIL][26]
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-byt-n2820/igt@i915_selftest@live_gt_pm.html
    - fi-skl-6700k2:      [PASS][27] -> [DMESG-FAIL][28]
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-skl-6700k2/igt@i915_selftest@live_gt_pm.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-skl-6700k2/igt@i915_selftest@live_gt_pm.html
    - fi-whl-u:           [PASS][29] -> [DMESG-FAIL][30]
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-whl-u/igt@i915_selftest@live_gt_pm.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-whl-u/igt@i915_selftest@live_gt_pm.html
    - fi-skl-6770hq:      [PASS][31] -> [DMESG-FAIL][32]
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-skl-6770hq/igt@i915_selftest@live_gt_pm.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-skl-6770hq/igt@i915_selftest@live_gt_pm.html
    - fi-cfl-guc:         [PASS][33] -> [DMESG-FAIL][34]
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-cfl-guc/igt@i915_selftest@live_gt_pm.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-cfl-guc/igt@i915_selftest@live_gt_pm.html
    - fi-bxt-dsi:         [PASS][35] -> [DMESG-FAIL][36]
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-bxt-dsi/igt@i915_selftest@live_gt_pm.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-bxt-dsi/igt@i915_selftest@live_gt_pm.html
    - fi-skl-6600u:       [PASS][37] -> [DMESG-FAIL][38]
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-skl-6600u/igt@i915_selftest@live_gt_pm.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-skl-6600u/igt@i915_selftest@live_gt_pm.html
    - fi-cml-u2:          [PASS][39] -> [DMESG-FAIL][40]
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-cml-u2/igt@i915_selftest@live_gt_pm.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-cml-u2/igt@i915_selftest@live_gt_pm.html
    - fi-apl-guc:         [PASS][41] -> [DMESG-FAIL][42]
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-apl-guc/igt@i915_selftest@live_gt_pm.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-apl-guc/igt@i915_selftest@live_gt_pm.html
    - fi-kbl-8809g:       [PASS][43] -> [DMESG-FAIL][44]
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-kbl-8809g/igt@i915_selftest@live_gt_pm.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-kbl-8809g/igt@i915_selftest@live_gt_pm.html
    - fi-snb-2520m:       NOTRUN -> [DMESG-FAIL][45]
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-snb-2520m/igt@i915_selftest@live_gt_pm.html

  
Known issues
------------

  Here are the changes found in Patchwork_16431 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_close_race@basic-threads:
    - fi-hsw-peppy:       [PASS][46] -> [TIMEOUT][47] ([fdo#112271] / [i915#1084])
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-hsw-peppy/igt@gem_close_race@basic-threads.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-hsw-peppy/igt@gem_close_race@basic-threads.html

  * igt@gem_mmap_gtt@basic:
    - fi-tgl-y:           [PASS][48] -> [DMESG-WARN][49] ([CI#94] / [i915#402]) +1 similar issue
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-tgl-y/igt@gem_mmap_gtt@basic.html
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-tgl-y/igt@gem_mmap_gtt@basic.html

  * igt@i915_selftest@live_blt:
    - fi-hsw-4770r:       [PASS][50] -> [DMESG-FAIL][51] ([i915#553] / [i915#725])
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-hsw-4770r/igt@i915_selftest@live_blt.html
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-hsw-4770r/igt@i915_selftest@live_blt.html

  * igt@i915_selftest@live_execlists:
    - fi-icl-y:           [PASS][52] -> [DMESG-FAIL][53] ([fdo#108569])
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-icl-y/igt@i915_selftest@live_execlists.html
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-icl-y/igt@i915_selftest@live_execlists.html

  * igt@i915_selftest@live_gem_contexts:
    - fi-byt-j1900:       [PASS][54] -> [DMESG-FAIL][55] ([i915#722])
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-byt-j1900/igt@i915_selftest@live_gem_contexts.html
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-byt-j1900/igt@i915_selftest@live_gem_contexts.html

  * igt@i915_selftest@live_gtt:
    - fi-kbl-7500u:       [PASS][56] -> [TIMEOUT][57] ([fdo#112271])
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-kbl-7500u/igt@i915_selftest@live_gtt.html
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-kbl-7500u/igt@i915_selftest@live_gtt.html

  
#### Possible fixes ####

  * igt@gem_close_race@basic-threads:
    - fi-byt-n2820:       [INCOMPLETE][58] ([i915#45]) -> [PASS][59]
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-byt-n2820/igt@gem_close_race@basic-threads.html
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-byt-n2820/igt@gem_close_race@basic-threads.html

  * igt@gem_exec_parallel@fds:
    - fi-icl-u3:          [INCOMPLETE][60] -> [PASS][61]
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-icl-u3/igt@gem_exec_parallel@fds.html
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-icl-u3/igt@gem_exec_parallel@fds.html

  * igt@i915_getparams_basic@basic-subslice-total:
    - fi-tgl-y:           [DMESG-WARN][62] ([CI#94] / [i915#402]) -> [PASS][63] +1 similar issue
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-tgl-y/igt@i915_getparams_basic@basic-subslice-total.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-tgl-y/igt@i915_getparams_basic@basic-subslice-total.html

  * igt@i915_module_load@reload:
    - fi-skl-6770hq:      [DMESG-WARN][64] ([i915#92]) -> [PASS][65] +2 similar issues
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-skl-6770hq/igt@i915_module_load@reload.html
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-skl-6770hq/igt@i915_module_load@reload.html

  * igt@i915_selftest@live_blt:
    - fi-bsw-nick:        [INCOMPLETE][66] ([i915#392]) -> [PASS][67]
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-bsw-nick/igt@i915_selftest@live_blt.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-bsw-nick/igt@i915_selftest@live_blt.html
    - fi-hsw-4770:        [DMESG-FAIL][68] ([i915#553]) -> [PASS][69]
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-hsw-4770/igt@i915_selftest@live_blt.html
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-hsw-4770/igt@i915_selftest@live_blt.html

  * igt@kms_chamelium@hdmi-crc-fast:
    - fi-kbl-7500u:       [FAIL][70] ([fdo#109635] / [i915#217]) -> [PASS][71]
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-kbl-7500u/igt@kms_chamelium@hdmi-crc-fast.html
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-kbl-7500u/igt@kms_chamelium@hdmi-crc-fast.html

  * igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
    - fi-skl-6770hq:      [SKIP][72] ([fdo#109271]) -> [PASS][73] +4 similar issues
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-skl-6770hq/igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence.html
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-skl-6770hq/igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence.html

  * igt@kms_pipe_crc_basic@read-crc-pipe-c:
    - fi-skl-6770hq:      [DMESG-WARN][74] ([i915#106] / [i915#188]) -> [PASS][75]
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-skl-6770hq/igt@kms_pipe_crc_basic@read-crc-pipe-c.html
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-skl-6770hq/igt@kms_pipe_crc_basic@read-crc-pipe-c.html

  
#### Warnings ####

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       [FAIL][76] ([fdo#111096] / [i915#323]) -> [FAIL][77] ([fdo#111407])
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html

  
  [CI#94]: https://gitlab.freedesktop.org/gfx-ci/i915-infra/issues/94
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109635]: https://bugs.freedesktop.org/show_bug.cgi?id=109635
  [fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096
  [fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407
  [fdo#112271]: https://bugs.freedesktop.org/show_bug.cgi?id=112271
  [i915#106]: https://gitlab.freedesktop.org/drm/intel/issues/106
  [i915#1084]: https://gitlab.freedesktop.org/drm/intel/issues/1084
  [i915#188]: https://gitlab.freedesktop.org/drm/intel/issues/188
  [i915#217]: https://gitlab.freedesktop.org/drm/intel/issues/217
  [i915#323]: https://gitlab.freedesktop.org/drm/intel/issues/323
  [i915#392]: https://gitlab.freedesktop.org/drm/intel/issues/392
  [i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
  [i915#45]: https://gitlab.freedesktop.org/drm/intel/issues/45
  [i915#553]: https://gitlab.freedesktop.org/drm/intel/issues/553
  [i915#722]: https://gitlab.freedesktop.org/drm/intel/issues/722
  [i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725
  [i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92


Participating hosts (49 -> 42)
------------------------------

  Additional (1): fi-snb-2520m 
  Missing    (8): fi-bdw-5557u fi-hsw-4200u fi-bsw-n3050 fi-bsw-cyan fi-bwr-2160 fi-ctg-p8600 fi-byt-clapper fi-bdw-samus 


Build changes
-------------

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_7869 -> Patchwork_16431

  CI-20190529: 20190529
  CI_DRM_7869: db0579be255412f38a450c3c577f8d10f1195034 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5419: 44913a91e77434b03001bb9ea53216cd03c476e6 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_16431: 342c89d084c1ce19884b1b7c5141f91ccd1ca9d4 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

342c89d084c1 drm/i915/selftests: add basic selftests for rc6

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16431/index.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915/selftests: add basic selftests for rc6
  2020-02-05 14:31 ` Mika Kuoppala
@ 2020-02-05 18:40   ` Andi Shyti
  2020-02-05 21:21     ` Chris Wilson
  2020-02-06 12:15     ` Mika Kuoppala
  0 siblings, 2 replies; 9+ messages in thread
From: Andi Shyti @ 2020-02-05 18:40 UTC (permalink / raw)
  To: Mika Kuoppala; +Cc: intel-gfx

Hi Mika,

> > +static bool test_rc6(struct intel_rc6 *rc6, bool enabled)
> > +{
> > +	struct intel_uncore *uncore = rc6_to_uncore(rc6);
> > +	intel_wakeref_t wakeref;
> > +	u32 ec1, ec2;
> > +	u32 interval;
> > +
> > +	wakeref = intel_runtime_pm_get(uncore->rpm);
> > +
> > +	interval = intel_uncore_read(uncore, GEN6_RC_EVALUATION_INTERVAL);
> > +
> > +	/*
> > +	 * the interval is stored in steps of 1.28us
> > +	 */
> > +	interval = div_u64(mul_u32_u32(interval, 128),
> > +			   100 * 1000); /* => miliseconds */
> > +
> 
> s/miliseconds/milliseconds.

thanks!

> I have a faint memory that the interval was not always 1.28us
> but gen dependant.

1.28 is the incremental step and I haven't seen any different
value in the docs. Have you?

> > +	pr_info("interval:%x [%dms], threshold:%x, rc6:%x, enabled?:%s\n",
> > +		intel_uncore_read(uncore, GEN6_RC_EVALUATION_INTERVAL),
> > +		interval,
> > +		intel_uncore_read(uncore, GEN6_RC6_THRESHOLD),
> > +	       	ec2 - ec1,
> > +	       	yesno(enabled));
> > +
> > +	intel_runtime_pm_put(uncore->rpm, wakeref);
> > +
> > +	return enabled != (ec1 >= ec2);
> 
> Wrap?

actually here I forgot a couple of things that went forgotten in
my git repo.

Anyway, do you mean with "wrap" to add parenthesis?

> > +	intel_rc6_unpark(rc6);
> > +
> > +	/* interval < threshold */
> > +	if (!test_rc6(rc6, false)) {
> 
> consider removing the assertion of 'activeness' in parameter
> and just if (!rc6_active(rc6)). Or am I missing something in here?

yes, you are right, it's misleading. I will make it more clear.

The basic idea is:

 1. disable rc6
 2. check whether it's disabled test_rc6(rc6, false)

or

 1. enable rc6
 2. check if it's enabled test_rc6(rc6, true)

Chris was skeptical about the naming as well.

Thanks!

Andi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915/selftests: add basic selftests for rc6
  2020-02-05 18:40   ` Andi Shyti
@ 2020-02-05 21:21     ` Chris Wilson
  2020-02-06 12:15     ` Mika Kuoppala
  1 sibling, 0 replies; 9+ messages in thread
From: Chris Wilson @ 2020-02-05 21:21 UTC (permalink / raw)
  To: Andi Shyti, Mika Kuoppala; +Cc: intel-gfx

Quoting Andi Shyti (2020-02-05 18:40:55)
> Hi Mika,
>
> > I have a faint memory that the interval was not always 1.28us
> > but gen dependant.
> 
> 1.28 is the incremental step and I haven't seen any different
> value in the docs. Have you?

The rc6 residency counter does flip over to a different clock on
vlv/bsw. But the lack of information abounds, and I haven't seen
anything that suggests these registers are anything but units of
1280ns. If we get to the point where we can differentiate between 833ns
or 1280ns that will be very impressive.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915/selftests: add basic selftests for rc6
  2020-02-05 18:40   ` Andi Shyti
  2020-02-05 21:21     ` Chris Wilson
@ 2020-02-06 12:15     ` Mika Kuoppala
  1 sibling, 0 replies; 9+ messages in thread
From: Mika Kuoppala @ 2020-02-06 12:15 UTC (permalink / raw)
  To: Andi Shyti; +Cc: intel-gfx

Andi Shyti <andi@etezian.org> writes:

> Hi Mika,
>
>> > +static bool test_rc6(struct intel_rc6 *rc6, bool enabled)
>> > +{
>> > +	struct intel_uncore *uncore = rc6_to_uncore(rc6);
>> > +	intel_wakeref_t wakeref;
>> > +	u32 ec1, ec2;
>> > +	u32 interval;
>> > +
>> > +	wakeref = intel_runtime_pm_get(uncore->rpm);
>> > +
>> > +	interval = intel_uncore_read(uncore, GEN6_RC_EVALUATION_INTERVAL);
>> > +
>> > +	/*
>> > +	 * the interval is stored in steps of 1.28us
>> > +	 */
>> > +	interval = div_u64(mul_u32_u32(interval, 128),
>> > +			   100 * 1000); /* => miliseconds */
>> > +
>> 
>> s/miliseconds/milliseconds.
>
> thanks!
>
>> I have a faint memory that the interval was not always 1.28us
>> but gen dependant.
>
> 1.28 is the incremental step and I haven't seen any different
> value in the docs. Have you?

I must have been mixing this with freq bins. Sorry.
And in this level as Chris said, we dont need to care.

>
>> > +	pr_info("interval:%x [%dms], threshold:%x, rc6:%x, enabled?:%s\n",
>> > +		intel_uncore_read(uncore, GEN6_RC_EVALUATION_INTERVAL),
>> > +		interval,
>> > +		intel_uncore_read(uncore, GEN6_RC6_THRESHOLD),
>> > +	       	ec2 - ec1,
>> > +	       	yesno(enabled));
>> > +
>> > +	intel_runtime_pm_put(uncore->rpm, wakeref);
>> > +
>> > +	return enabled != (ec1 >= ec2);
>> 
>> Wrap?
>
> actually here I forgot a couple of things that went forgotten in
> my git repo.
>
> Anyway, do you mean with "wrap" to add parenthesis?
>

I meant that if you take samples between wrap
period.
-Mika

>> > +	intel_rc6_unpark(rc6);
>> > +
>> > +	/* interval < threshold */
>> > +	if (!test_rc6(rc6, false)) {
>> 
>> consider removing the assertion of 'activeness' in parameter
>> and just if (!rc6_active(rc6)). Or am I missing something in here?
>
> yes, you are right, it's misleading. I will make it more clear.
>
> The basic idea is:
>
>  1. disable rc6
>  2. check whether it's disabled test_rc6(rc6, false)
>
> or
>
>  1. enable rc6
>  2. check if it's enabled test_rc6(rc6, true)
>
> Chris was skeptical about the naming as well.
>
> Thanks!
>
> Andi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915/selftests: add basic selftests for rc6
@ 2019-11-22  0:19     ` Chris Wilson
  0 siblings, 0 replies; 9+ messages in thread
From: Chris Wilson @ 2019-11-22  0:19 UTC (permalink / raw)
  To: intel-gfx

Quoting Chris Wilson (2019-11-22 00:16:27)
> From: Andi Shyti <andi.shyti@intel.com>
> 
> Add three basic tests for rc6 power status:
> 
> 1. live_rc6_basic - simply checks if rc6 works when it's enabled
>    or stops when it's disabled.
> 
> 2. live_rc6_threshold - rc6 should not work when the evaluation
>    interval is less than the threshold and should work otherwise.
> 
> 3. live_rc6_busy - keeps the gpu busy and then goes in idle;
>    checks that we don't fall in rc6 when busy and that we do fall
>    in rc6 when idling.

One test worth extending is checking that live_rc6_busy works after a
reset, both per-engine and device.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Intel-gfx] [PATCH] drm/i915/selftests: add basic selftests for rc6
@ 2019-11-22  0:16 ` Chris Wilson
  2019-11-22  0:19     ` Chris Wilson
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Wilson @ 2019-11-22  0:16 UTC (permalink / raw)
  To: intel-gfx

From: Andi Shyti <andi.shyti@intel.com>

Add three basic tests for rc6 power status:

1. live_rc6_basic - simply checks if rc6 works when it's enabled
   or stops when it's disabled.

2. live_rc6_threshold - rc6 should not work when the evaluation
   interval is less than the threshold and should work otherwise.

3. live_rc6_busy - keeps the gpu busy and then goes in idle;
   checks that we don't fall in rc6 when busy and that we do fall
   in rc6 when idling.

The three tests are added as sutest of the bigger live_late_gt_pm
selftest.

The basic rc6 functionality is tested by checking the reference
counter within the evaluation interval.

Signed-off-by: Andi Shyti <andi.shyti@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/selftest_gt_pm.c |   3 +
 drivers/gpu/drm/i915/gt/selftest_rc6.c   | 189 +++++++++++++++++++++++
 drivers/gpu/drm/i915/gt/selftest_rc6.h   |   3 +
 3 files changed, 195 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/selftest_gt_pm.c b/drivers/gpu/drm/i915/gt/selftest_gt_pm.c
index 5e563b877368..7833ef3b252f 100644
--- a/drivers/gpu/drm/i915/gt/selftest_gt_pm.c
+++ b/drivers/gpu/drm/i915/gt/selftest_gt_pm.c
@@ -51,6 +51,9 @@ 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_threshold),
+		SUBTEST(live_rc6_busy),
 		SUBTEST(live_gt_resume),
 	};
 
diff --git a/drivers/gpu/drm/i915/gt/selftest_rc6.c b/drivers/gpu/drm/i915/gt/selftest_rc6.c
index 67b7a6bc64f5..9d0862272665 100644
--- a/drivers/gpu/drm/i915/gt/selftest_rc6.c
+++ b/drivers/gpu/drm/i915/gt/selftest_rc6.c
@@ -11,6 +11,7 @@
 #include "selftest_rc6.h"
 
 #include "selftests/i915_random.h"
+#include "selftests/igt_spinner.h"
 
 static const u32 *__live_rc6_ctx(struct intel_context *ce)
 {
@@ -144,3 +145,191 @@ int live_rc6_ctx_wa(void *arg)
 	kfree(engines);
 	return err;
 }
+
+static bool test_rc6(struct intel_rc6 *rc6, bool enabled)
+{
+	struct intel_uncore *uncore = rc6_to_uncore(rc6);
+	intel_wakeref_t wakeref;
+	u32 ec1, ec2;
+	u32 interval;
+
+	wakeref = intel_runtime_pm_get(uncore->rpm);
+
+	interval = intel_uncore_read(uncore, GEN6_RC_EVALUATION_INTERVAL);
+
+	/*
+	 * the interval is stored in steps of 1.28us
+	 */
+	interval = div_u64(mul_u32_u32(interval, 128),
+			   100 * 1000); /* => miliseconds */
+
+	ec1 = intel_uncore_read(uncore, GEN6_GT_GFX_RC6);
+
+	/*
+	 * It's not important to precisely wait the interval time.
+	 * I'll wait at least twice the time in order to be sure
+	 * that the counting happens in the reference counter.
+	 */
+	msleep(2 * interval);
+
+	ec2 = intel_uncore_read(uncore, GEN6_GT_GFX_RC6);
+
+	intel_runtime_pm_put(uncore->rpm, wakeref);
+
+	return enabled != (ec1 >= ec2);
+}
+
+int live_rc6_basic(void *arg)
+{
+	struct intel_gt *gt = arg;
+	struct intel_rc6 *rc6 = &gt->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 (!test_rc6(rc6, rc6->enabled)) {
+			if (!i)
+				return -EINVAL;
+
+			/* restore before leaving */
+			err = -EINVAL;
+		}
+
+		if (rc6->enabled)
+			intel_rc6_disable(&gt->rc6);
+		else
+			intel_rc6_enable(&gt->rc6);
+	}
+
+	intel_runtime_pm_put(gt->uncore->rpm, wakeref);
+	return err;
+}
+
+int live_rc6_threshold(void *arg)
+{
+	struct intel_gt *gt = arg;
+	struct intel_uncore *uncore = gt->uncore;
+	struct intel_rc6 *rc6 = &gt->rc6;
+	intel_wakeref_t wakeref;
+	u32 threshold, interval;
+	u32 t_orig, i_orig;
+	int err = 0;
+
+	if (!rc6->supported)
+		return 0;
+
+	wakeref = intel_runtime_pm_get(uncore->rpm);
+
+	t_orig = intel_uncore_read(uncore, GEN6_RC6_THRESHOLD);
+	i_orig = intel_uncore_read(uncore, GEN6_RC_EVALUATION_INTERVAL);
+
+	/*
+	 * set the threshold to 50ms
+	 *
+	 * 50ms * 1000 = 50000us
+	 * 50000 / (1.28 * 100) / 100 (we don't have floating point)
+	 */
+	threshold = 50 * 1000 / 128 * 100;
+	intel_uncore_write(uncore, GEN6_RC6_THRESHOLD, threshold);
+
+	/* set interval indicatively to half the threshold */
+	interval = threshold / 2;
+	intel_uncore_write(uncore, GEN6_RC_EVALUATION_INTERVAL, interval);
+
+	/* interval < threshold */
+	if (!test_rc6(rc6, true)) {
+		pr_err("i915 mismatch: rc6 with interval < threshold\n");
+		err = -EINVAL;
+	}
+
+	/* set interval indicatively to twice the threshold */
+	interval = threshold * 2;
+	intel_uncore_write(uncore, GEN6_RC_EVALUATION_INTERVAL, interval);
+
+	/* interval > threshold */
+	if (!test_rc6(rc6, false)) {
+		pr_err("i915 mismatch: not in rc6 with interval > threshold\n");
+		err = -EINVAL;
+	}
+
+	intel_uncore_write(uncore, GEN6_RC6_THRESHOLD, t_orig);
+	intel_uncore_write(uncore, GEN6_RC_EVALUATION_INTERVAL, i_orig);
+	intel_runtime_pm_put(uncore->rpm, wakeref);
+
+	return err;
+}
+
+int live_rc6_busy(void *arg)
+{
+	struct intel_gt *gt = arg;
+	struct intel_rc6 *rc6 = &gt->rc6;
+	struct intel_engine_cs *engine;
+	struct igt_spinner spin;
+	intel_wakeref_t wakeref;
+	enum intel_engine_id id;
+	int err;
+
+	if (!rc6->supported)
+		return 0;
+
+	err = igt_spinner_init(&spin, gt);
+	if (err)
+		return err;
+
+	wakeref = intel_runtime_pm_get(gt->uncore->rpm);
+	for_each_engine(engine, gt, id) {
+		struct i915_request *rq;
+
+		rq = igt_spinner_create_request(&spin,
+						engine->kernel_context,
+						MI_NOOP);
+		if (IS_ERR(rq)) {
+			err = PTR_ERR(rq);
+			break;
+		}
+
+		i915_request_get(rq);
+		i915_request_add(rq);
+
+		igt_wait_for_spinner(&spin, rq); /* it's enough waiting */
+
+		/* gpu is busy, we shouldn't be in rc6 */
+		if (!test_rc6(rc6, false)) {
+			pr_err("%s: never busy enough for having a nap\n",
+			       engine->name);
+			err = -EINVAL;
+		}
+
+		igt_spinner_end(&spin);
+		if (i915_request_wait(rq, 0, HZ / 5) < 0)
+			err = -ETIME;
+		i915_request_put(rq);
+		if (err)
+			break;
+
+		intel_gt_wait_for_idle(gt, HZ / 5);
+		intel_gt_pm_wait_for_idle(gt);
+
+		/* gpu is busy, we should be in rc6 */
+		if (!test_rc6(rc6, true)) {
+			pr_err("%s is idle but doesn't go in rc6\n",
+			       engine->name);
+			err = -EINVAL;
+			break;
+		}
+	}
+	intel_runtime_pm_put(gt->uncore->rpm, wakeref);
+
+	igt_spinner_fini(&spin);
+	return err;
+}
diff --git a/drivers/gpu/drm/i915/gt/selftest_rc6.h b/drivers/gpu/drm/i915/gt/selftest_rc6.h
index f907e7b035ab..23e7945e9eed 100644
--- a/drivers/gpu/drm/i915/gt/selftest_rc6.h
+++ b/drivers/gpu/drm/i915/gt/selftest_rc6.h
@@ -7,6 +7,9 @@
 #ifndef SELFTEST_RC6_H
 #define SELFTEST_RC6_H
 
+int live_rc6_basic(void *arg);
+int live_rc6_threshold(void *arg);
+int live_rc6_busy(void *arg);
 int live_rc6_ctx_wa(void *arg);
 
 #endif /* SELFTEST_RC6_H */
-- 
2.24.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-02-06 12:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 10:57 [Intel-gfx] [PATCH] drm/i915/selftests: add basic selftests for rc6 Chris Wilson
2020-02-05 14:31 ` Mika Kuoppala
2020-02-05 18:40   ` Andi Shyti
2020-02-05 21:21     ` Chris Wilson
2020-02-06 12:15     ` Mika Kuoppala
2020-02-05 15:06 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/selftests: add basic selftests for rc6 (rev5) Patchwork
2020-02-05 15:37 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2019-11-22  0:16 [Intel-gfx] [PATCH] drm/i915/selftests: add basic selftests for rc6 Chris Wilson
2019-11-22  0:16 ` Chris Wilson
2019-11-22  0:19   ` Chris Wilson
2019-11-22  0:19     ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.