[Intel-gfx] [PATCH igt 2/2] igt/perf_pmu: Explicitly reset min_freq before max_freq
Chris Wilson
chris at chris-wilson.co.uk
Wed Nov 22 21:16:38 UTC 2017
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 at chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin at 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
More information about the Intel-gfx
mailing list