Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH] pm_rpm: Skip PC8 tests when set limit doesn't allow entry
@ 2018-05-11 11:31 Arkadiusz Hiler
  2018-05-11 12:05 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Arkadiusz Hiler @ 2018-05-11 11:31 UTC (permalink / raw)
  To: igt-dev; +Cc: Martin Peres

On some devices BIOS limits possible Package C-states via setting one of
the MSRs. The test now skips if the limit is set to a shallower PC-state
than PC8.

The timeout for PC8+ residency change is lowered to 30s. During testing
the entry always happened in ~10s, so thrice that should be a safe bet.
(active USB keyboard, network and screen, no powertop --auto-tune)

Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Martin Peres <martin.peres@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 tests/pm_rpm.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c
index d2b837fe..51d8f366 100644
--- a/tests/pm_rpm.c
+++ b/tests/pm_rpm.c
@@ -50,6 +50,11 @@
 #include "igt_sysfs.h"
 #include "igt_debugfs.h"
 
+#define MSR_PKG_CST_CONFIG_CONTROL	0xE2
+/* HSW/BDW: */
+#define  PKG_CST_LIMIT_MASK		0xF
+#define  PKG_CST_LIMIT_C8		0x6
+
 #define MSR_PC8_RES	0x630
 #define MSR_PC9_RES	0x631
 #define MSR_PC10_RES	0x632
@@ -139,6 +144,14 @@ static bool supports_pc8_plus_residencies(void)
 	if (rc != sizeof(val))
 		return false;
 
+	rc = pread(msr_fd, &val, sizeof(uint64_t), MSR_PKG_CST_CONFIG_CONTROL);
+	if (rc != sizeof(val))
+		return false;
+	if ((val & PKG_CST_LIMIT_MASK) < PKG_CST_LIMIT_C8) {
+		igt_info("PKG C-states limited below PC8 by the BIOS\n");
+		return false;
+	}
+
 	return true;
 }
 
@@ -728,7 +741,7 @@ static void pc8_residency_subtest(void)
 
 	/* Make sure PC8+ residencies move! */
 	disable_all_screens(&ms_data);
-	igt_assert_f(pc8_plus_residency_changed(120),
+	igt_assert_f(pc8_plus_residency_changed(30),
 		     "Machine is not reaching PC8+ states, please check its "
 		     "configuration.\n");
 
@@ -757,7 +770,7 @@ static void modeset_subtest(enum screen_type type, int rounds, int wait_flags)
 		if (wait_flags & WAIT_STATUS)
 			igt_assert(wait_for_suspended());
 		if (wait_flags & WAIT_PC8_RES)
-			igt_assert(pc8_plus_residency_changed(120));
+			igt_assert(pc8_plus_residency_changed(30));
 		if (wait_flags & WAIT_EXTRA)
 			sleep(5);
 
@@ -1262,7 +1275,7 @@ static void gem_execbuf_stress_subtest(int rounds, int wait_flags)
 		if (wait_flags & WAIT_STATUS)
 			igt_assert(wait_for_suspended());
 		if (wait_flags & WAIT_PC8_RES)
-			igt_assert(pc8_plus_residency_changed(120));
+			igt_assert(pc8_plus_residency_changed(30));
 		if (wait_flags & WAIT_EXTRA)
 			sleep(5);
 	}
-- 
2.14.3

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2018-05-14  6:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-11 11:31 [igt-dev] [PATCH] pm_rpm: Skip PC8 tests when set limit doesn't allow entry Arkadiusz Hiler
2018-05-11 12:05 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-05-11 12:56 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-05-11 13:12 ` [igt-dev] [PATCH] " Chris Wilson
2018-05-14  6:39   ` Arkadiusz Hiler
2018-05-11 19:25 ` Paulo Zanoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox