From: jeff.mcgee@intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 3/4] pm_rps: Fix test to target original min and max
Date: Fri, 10 Jan 2014 15:12:32 -0600 [thread overview]
Message-ID: <1389388353-29980-4-git-send-email-jeff.mcgee@intel.com> (raw)
In-Reply-To: <1389388353-29980-1-git-send-email-jeff.mcgee@intel.com>
From: Jeff McGee <jeff.mcgee@intel.com>
The goal of the test is to confirm that gt_cur_freq_mhz can be forced
to the boundaries of the frequency range by collapsing gt_min_freq_mhz
and gt_max_freq_mhz to the target value. But we miss testing the upper
end of the range by targetting the current value of max after it has
been set equal to min. So fix by targetting orginal max instead of
current max.
This correction exposes a problem in setfreq where min is always set
to target before max, which should fail if the target value is greater
than max. So fix that too.
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
---
tests/pm_rps.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/tests/pm_rps.c b/tests/pm_rps.c
index 69eeb81..c968ecb 100644
--- a/tests/pm_rps.c
+++ b/tests/pm_rps.c
@@ -101,8 +101,13 @@ static int do_writeval(FILE *filp, int val, int lerrno)
static void setfreq(int val)
{
- writeval(stuff[MIN].filp, val);
- writeval(stuff[MAX].filp, val);
+ if (val > fmax) {
+ writeval(stuff[MAX].filp, val);
+ writeval(stuff[MIN].filp, val);
+ } else {
+ writeval(stuff[MIN].filp, val);
+ writeval(stuff[MAX].filp, val);
+ }
}
static void checkit(void)
@@ -166,11 +171,11 @@ igt_simple_main
dumpit();
checkit();
- setfreq(fmin);
+ setfreq(origmin);
if (verbose)
dumpit();
restore_assert(fcur == fmin);
- setfreq(fmax);
+ setfreq(origmax);
if (verbose)
dumpit();
restore_assert(fcur == fmax);
--
1.8.5.2
next prev parent reply other threads:[~2014-01-10 21:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-10 21:12 Various fixes and updates to igt/pm_rps jeff.mcgee
2014-01-10 21:12 ` [PATCH 1/4] pm_rps: Use unbuffered I/O on sysfs files jeff.mcgee
2014-01-10 21:12 ` [PATCH 2/4] pm_rps: Assert that valid sysfs writes return success jeff.mcgee
2014-01-10 21:12 ` jeff.mcgee [this message]
2014-01-10 21:12 ` [PATCH 4/4] pm_rps: Use igt exit handler for restore jeff.mcgee
2014-01-10 21:33 ` Various fixes and updates to igt/pm_rps Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1389388353-29980-4-git-send-email-jeff.mcgee@intel.com \
--to=jeff.mcgee@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox