All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt 1/2] igt/perf_pmu: Clear errno in between invalid atrr tests
@ 2017-11-22 19:00 Chris Wilson
  2017-11-22 19:00 ` [PATCH igt 2/2] igt/perf_pmu: Explicitly reset min_freq before max_freq Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chris Wilson @ 2017-11-22 19:00 UTC (permalink / raw)
  To: intel-gfx

Reset the errno after testing each invalid attr so that it is carried
over on a false positive.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/perf_pmu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index e2d2caba..bcb90c84 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -689,6 +689,7 @@ do { \
 	attr.config = I915_PMU_ENGINE_BUSY(I915_ENGINE_CLASS_RENDER, 0); \
 	attr.type = i915_type_id(); \
 	igt_assert(attr.type != 0); \
+	errno = 0; \
 } while(0)
 
 	ATTR_INIT();
-- 
2.15.0

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

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

* [PATCH igt 2/2] igt/perf_pmu: Explicitly reset min_freq before max_freq
  2017-11-22 19:00 [PATCH igt 1/2] igt/perf_pmu: Clear errno in between invalid atrr tests Chris Wilson
@ 2017-11-22 19:00 ` Chris Wilson
  2017-11-22 21:07   ` Tvrtko Ursulin
  2017-11-22 20:48 ` [PATCH igt 1/2] igt/perf_pmu: Clear errno in between invalid atrr tests Tvrtko Ursulin
  2017-11-23 17:01 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] " Patchwork
  2 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2017-11-22 19:00 UTC (permalink / raw)
  To: intel-gfx

The kernel doesn't like it when you set max_freq < min_freq and
complains bitterly. So before setting max_freq = min_freq, first set
min_freq to min_freq!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/perf_pmu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index bcb90c84..b8422211 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -946,6 +946,8 @@ test_frequency(int gem_fd)
 	min_freq = igt_sysfs_get_u32(sysfs, "gt_RPn_freq_mhz");
 	max_freq = igt_sysfs_get_u32(sysfs, "gt_RP0_freq_mhz");
 	boost_freq = igt_sysfs_get_u32(sysfs, "gt_boost_freq_mhz");
+	igt_info("Frequency: min=%u, max=%u, boost=%u MHz\n",
+		 min_freq, max_freq, boost_freq);
 	igt_require(min_freq > 0 && max_freq > 0 && boost_freq > 0);
 	igt_require(max_freq > min_freq);
 	igt_require(boost_freq > min_freq);
@@ -956,6 +958,8 @@ test_frequency(int gem_fd)
 	/*
 	 * Set GPU to min frequency and read PMU counters.
 	 */
+	igt_require(igt_sysfs_set_u32(sysfs, "gt_min_freq_mhz", min_freq));
+	igt_require(igt_sysfs_get_u32(sysfs, "gt_min_freq_mhz") == min_freq);
 	igt_require(igt_sysfs_set_u32(sysfs, "gt_max_freq_mhz", min_freq));
 	igt_require(igt_sysfs_get_u32(sysfs, "gt_max_freq_mhz") == min_freq);
 	igt_require(igt_sysfs_set_u32(sysfs, "gt_boost_freq_mhz", min_freq));
-- 
2.15.0

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

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

* Re: [PATCH igt 1/2] igt/perf_pmu: Clear errno in between invalid atrr tests
  2017-11-22 19:00 [PATCH igt 1/2] igt/perf_pmu: Clear errno in between invalid atrr tests Chris Wilson
  2017-11-22 19:00 ` [PATCH igt 2/2] igt/perf_pmu: Explicitly reset min_freq before max_freq Chris Wilson
@ 2017-11-22 20:48 ` Tvrtko Ursulin
  2017-11-23 17:01 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] " Patchwork
  2 siblings, 0 replies; 6+ messages in thread
From: Tvrtko Ursulin @ 2017-11-22 20:48 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 22/11/2017 19:00, Chris Wilson wrote:
> Reset the errno after testing each invalid attr so that it is carried
> over on a false positive.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   tests/perf_pmu.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> index e2d2caba..bcb90c84 100644
> --- a/tests/perf_pmu.c
> +++ b/tests/perf_pmu.c
> @@ -689,6 +689,7 @@ do { \
>   	attr.config = I915_PMU_ENGINE_BUSY(I915_ENGINE_CLASS_RENDER, 0); \
>   	attr.type = i915_type_id(); \
>   	igt_assert(attr.type != 0); \
> +	errno = 0; \
>   } while(0)
>   
>   	ATTR_INIT();
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

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

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

* Re: [PATCH igt 2/2] igt/perf_pmu: Explicitly reset min_freq before max_freq
  2017-11-22 19:00 ` [PATCH igt 2/2] igt/perf_pmu: Explicitly reset min_freq before max_freq Chris Wilson
@ 2017-11-22 21:07   ` Tvrtko Ursulin
  2017-11-22 21:16     ` Chris Wilson
  0 siblings, 1 reply; 6+ messages in thread
From: Tvrtko Ursulin @ 2017-11-22 21:07 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 22/11/2017 19:00, Chris Wilson wrote:
> The kernel doesn't like it when you set max_freq < min_freq and
> complains bitterly. So before setting max_freq = min_freq, first set
> min_freq to min_freq!
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   tests/perf_pmu.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> index bcb90c84..b8422211 100644
> --- a/tests/perf_pmu.c
> +++ b/tests/perf_pmu.c
> @@ -946,6 +946,8 @@ test_frequency(int gem_fd)
>   	min_freq = igt_sysfs_get_u32(sysfs, "gt_RPn_freq_mhz");
>   	max_freq = igt_sysfs_get_u32(sysfs, "gt_RP0_freq_mhz");
>   	boost_freq = igt_sysfs_get_u32(sysfs, "gt_boost_freq_mhz");
> +	igt_info("Frequency: min=%u, max=%u, boost=%u MHz\n",
> +		 min_freq, max_freq, boost_freq);
>   	igt_require(min_freq > 0 && max_freq > 0 && boost_freq > 0);
>   	igt_require(max_freq > min_freq);
>   	igt_require(boost_freq > min_freq);
> @@ -956,6 +958,8 @@ test_frequency(int gem_fd)
>   	/*
>   	 * Set GPU to min frequency and read PMU counters.
>   	 */
> +	igt_require(igt_sysfs_set_u32(sysfs, "gt_min_freq_mhz", min_freq));
> +	igt_require(igt_sysfs_get_u32(sysfs, "gt_min_freq_mhz") == min_freq);
>   	igt_require(igt_sysfs_set_u32(sysfs, "gt_max_freq_mhz", min_freq));
>   	igt_require(igt_sysfs_get_u32(sysfs, "gt_max_freq_mhz") == min_freq);
>   	igt_require(igt_sysfs_set_u32(sysfs, "gt_boost_freq_mhz", min_freq));
> 

I don't see any harm, but also don't see how min freq is not min freq at 
this point. Dealing with random state on the system or some lack of 
cleanup from the test itself?

Anyway,

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

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

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

* Re: [PATCH igt 2/2] igt/perf_pmu: Explicitly reset min_freq before max_freq
  2017-11-22 21:07   ` Tvrtko Ursulin
@ 2017-11-22 21:16     ` Chris Wilson
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2017-11-22 21:16 UTC (permalink / raw)
  To: Tvrtko Ursulin, intel-gfx

Quoting Tvrtko Ursulin (2017-11-22 21:07:47)
> 
> On 22/11/2017 19:00, Chris Wilson wrote:
> > The kernel doesn't like it when you set max_freq < min_freq and
> > complains bitterly. So before setting max_freq = min_freq, first set
> > min_freq to min_freq!
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > ---
> >   tests/perf_pmu.c | 4 ++++
> >   1 file changed, 4 insertions(+)
> > 
> > diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> > index bcb90c84..b8422211 100644
> > --- a/tests/perf_pmu.c
> > +++ b/tests/perf_pmu.c
> > @@ -946,6 +946,8 @@ test_frequency(int gem_fd)
> >       min_freq = igt_sysfs_get_u32(sysfs, "gt_RPn_freq_mhz");
> >       max_freq = igt_sysfs_get_u32(sysfs, "gt_RP0_freq_mhz");
> >       boost_freq = igt_sysfs_get_u32(sysfs, "gt_boost_freq_mhz");
> > +     igt_info("Frequency: min=%u, max=%u, boost=%u MHz\n",
> > +              min_freq, max_freq, boost_freq);
> >       igt_require(min_freq > 0 && max_freq > 0 && boost_freq > 0);
> >       igt_require(max_freq > min_freq);
> >       igt_require(boost_freq > min_freq);
> > @@ -956,6 +958,8 @@ test_frequency(int gem_fd)
> >       /*
> >        * Set GPU to min frequency and read PMU counters.
> >        */
> > +     igt_require(igt_sysfs_set_u32(sysfs, "gt_min_freq_mhz", min_freq));
> > +     igt_require(igt_sysfs_get_u32(sysfs, "gt_min_freq_mhz") == min_freq);
> >       igt_require(igt_sysfs_set_u32(sysfs, "gt_max_freq_mhz", min_freq));
> >       igt_require(igt_sysfs_get_u32(sysfs, "gt_max_freq_mhz") == min_freq);
> >       igt_require(igt_sysfs_set_u32(sysfs, "gt_boost_freq_mhz", min_freq));
> > 
> 
> I don't see any harm, but also don't see how min freq is not min freq at 
> this point. Dealing with random state on the system or some lack of 
> cleanup from the test itself?

In this case, dealing with itself failing at in opportune moments, so
random system state.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.BAT: failure for series starting with [1/2] igt/perf_pmu: Clear errno in between invalid atrr tests
  2017-11-22 19:00 [PATCH igt 1/2] igt/perf_pmu: Clear errno in between invalid atrr tests Chris Wilson
  2017-11-22 19:00 ` [PATCH igt 2/2] igt/perf_pmu: Explicitly reset min_freq before max_freq Chris Wilson
  2017-11-22 20:48 ` [PATCH igt 1/2] igt/perf_pmu: Clear errno in between invalid atrr tests Tvrtko Ursulin
@ 2017-11-23 17:01 ` Patchwork
  2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2017-11-23 17:01 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] igt/perf_pmu: Clear errno in between invalid atrr tests
URL   : https://patchwork.freedesktop.org/series/34249/
State : failure

== Summary ==

Series 34249 revision 1 was fully merged or fully failed: no git log

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

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

end of thread, other threads:[~2017-11-23 17:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-22 19:00 [PATCH igt 1/2] igt/perf_pmu: Clear errno in between invalid atrr tests Chris Wilson
2017-11-22 19:00 ` [PATCH igt 2/2] igt/perf_pmu: Explicitly reset min_freq before max_freq Chris Wilson
2017-11-22 21:07   ` Tvrtko Ursulin
2017-11-22 21:16     ` Chris Wilson
2017-11-22 20:48 ` [PATCH igt 1/2] igt/perf_pmu: Clear errno in between invalid atrr tests Tvrtko Ursulin
2017-11-23 17:01 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] " Patchwork

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.