From: Zhang Rui Date: Tue, 13 Oct 2020 07:42:40 +0000 (+0800) Subject: powercap/intel_rapl: Fix domain detection X-Git-Tag: microblaze-v5.11~37^2~1^5~2 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=7a57e9f112adebc9e5dc787c2a59dbc06ae5060d;p=linux-2.6-microblaze.git powercap/intel_rapl: Fix domain detection As only the low 32 bits of the RAPL_DOMAIN_REG_STATUS register represents the energy counter, and the high 32 bits are reserved, detect the existence of a RAPL domain by checking the low 32 bits only. Signed-off-by: Zhang Rui Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c index 983d75bd5bd1..2651ea6cd6d3 100644 --- a/drivers/powercap/intel_rapl_common.c +++ b/drivers/powercap/intel_rapl_common.c @@ -1228,7 +1228,7 @@ static int rapl_check_domain(int cpu, int domain, struct rapl_package *rp) * values, otherwise skip it. */ - ra.mask = ~0; + ra.mask = ENERGY_STATUS_MASK; if (rp->priv->read_raw(cpu, &ra) || !ra.value) return -ENODEV;