Skip to content

Commit

Permalink
powercap / intel_rapl: relax sanity check on energy counters
Browse files Browse the repository at this point in the history
Some RAPL domains may not be active at the time driver is being
loaded. Checking energy counter increment may be too strict and
time consuming. So relax the sanity check on energy counters of
these domains.

Otherwise, they may be ignored and become unavailable to the
powercap framework.

Signed-off-by: Jacob Pan <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
Jacob Pan authored and rafaeljw committed Feb 13, 2014
1 parent b28a960 commit 7b87477
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/powercap/intel_rapl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,11 @@ static int rapl_check_domain(int cpu, int domain)
if (rdmsrl_safe_on_cpu(cpu, msr, &val1))
return -ENODEV;

/* PP1/uncore/graphics domain may not be active at the time of
* driver loading. So skip further checks.
*/
if (domain == RAPL_DOMAIN_PP1)
return 0;
/* energy counters roll slowly on some domains */
while (++retry < 10) {
usleep_range(10000, 15000);
Expand Down

0 comments on commit 7b87477

Please sign in to comment.