diff options
author | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2018-05-14 09:28:50 +0300 |
---|---|---|
committer | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2018-05-14 09:28:50 +0300 |
commit | c0b5c02ff04cca24ce593f381352d00b5f322bd4 (patch) | |
tree | d848e546d54b941c48da9896cdf6c1b1282e1736 /tests | |
parent | 35f08c12aa216d5b62a5b9984b575cee6905098f (diff) |
pm_rpm: Skip PC8 tests when set limit doesn't allow entry
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.
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Martin Peres <martin.peres@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pm_rpm.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c index d2b837fe..ffc14fa8 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; } |