powercap / intel_rapl: relax sanity check on energy counters
authorJacob Pan <jacob.jun.pan@linux.intel.com>
Mon, 10 Feb 2014 14:11:51 +0000 (06:11 -0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 13 Feb 2014 23:49:33 +0000 (00:49 +0100)
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 <jacob.jun.pan@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/powercap/intel_rapl.c

index 3c6768378a94600bc487c61bc9d3fffcbf581750..0e37fe106eb28cfb0f385f2acde0deeab8e8a9ee 100644 (file)
@@ -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);