aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeiichi Ikarashi <s.ikarashi@jp.fujitsu.com>2015-08-19 01:26:03 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-08-28 19:46:40 -0400
commit5021282cc483d4126c1704942adb74806f7d15d6 (patch)
treeff1238b0000d8acefbe0a4ccca6efd1ef174e5d7
parent4e0bec9e833a6884dc2e242e45e0ebd99f46624e (diff)
powercap / RAPL: disable the 2nd power limit properly
Let rapl_unregister_powercap() disable the second power limit only if it exists. Intel64 SDM Vol.3 14.9 says that the package domain has it but neither the power plane domain nor the DRAM domain has it. Signed-off-by: Seiichi Ikarashi <s.ikarashi@jp.fujitsu.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/powercap/intel_rapl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/powercap/intel_rapl.c b/drivers/powercap/intel_rapl.c
index a5eddfbb0230..5efacd050c7d 100644
--- a/drivers/powercap/intel_rapl.c
+++ b/drivers/powercap/intel_rapl.c
@@ -1147,9 +1147,11 @@ static int rapl_unregister_powercap(void)
1147 pr_debug("remove package, undo power limit on %d: %s\n", 1147 pr_debug("remove package, undo power limit on %d: %s\n",
1148 rp->id, rd->name); 1148 rp->id, rd->name);
1149 rapl_write_data_raw(rd, PL1_ENABLE, 0); 1149 rapl_write_data_raw(rd, PL1_ENABLE, 0);
1150 rapl_write_data_raw(rd, PL2_ENABLE, 0);
1151 rapl_write_data_raw(rd, PL1_CLAMP, 0); 1150 rapl_write_data_raw(rd, PL1_CLAMP, 0);
1152 rapl_write_data_raw(rd, PL2_CLAMP, 0); 1151 if (find_nr_power_limit(rd) > 1) {
1152 rapl_write_data_raw(rd, PL2_ENABLE, 0);
1153 rapl_write_data_raw(rd, PL2_CLAMP, 0);
1154 }
1153 if (rd->id == RAPL_DOMAIN_PACKAGE) { 1155 if (rd->id == RAPL_DOMAIN_PACKAGE) {
1154 rd_package = rd; 1156 rd_package = rd;
1155 continue; 1157 continue;