summaryrefslogtreecommitdiff
path: root/drivers/powercap/intel_rapl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/powercap/intel_rapl.c')
-rw-r--r--drivers/powercap/intel_rapl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/powercap/intel_rapl.c b/drivers/powercap/intel_rapl.c
index 9ddad0815ba9..d1694f1def72 100644
--- a/drivers/powercap/intel_rapl.c
+++ b/drivers/powercap/intel_rapl.c
@@ -874,7 +874,9 @@ static int rapl_write_data_raw(struct rapl_domain *rd,
cpu = rd->rp->lead_cpu;
bits = rapl_unit_xlate(rd, rp->unit, value, 1);
- bits |= bits << rp->shift;
+ bits <<= rp->shift;
+ bits &= rp->mask;
+
memset(&ma, 0, sizeof(ma));
ma.msr_no = rd->msrs[rp->id];