From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
To: "Rafael J . Wysocki" <rafael@kernel.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Zhang Rui <rui.zhang@intel.com>,
Lukasz Luba <lukasz.luba@arm.com>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v1 1/6] powercap: intel_rapl: Remove unused AVERAGE_POWER primitive
Date: Fri, 13 Mar 2026 11:53:27 -0700 [thread overview]
Message-ID: <20260313185333.2370733-2-sathyanarayanan.kuppuswamy@linux.intel.com> (raw)
In-Reply-To: <20260313185333.2370733-1-sathyanarayanan.kuppuswamy@linux.intel.com>
The AVERAGE_POWER primitive and RAPL_PRIMITIVE_DERIVED flag are not
used anywhere in the code. Remove them to simplify the primitive
handling logic.
No functional changes.
Co-developed-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
drivers/powercap/intel_rapl_common.c | 13 -------------
include/linux/intel_rapl.h | 1 -
2 files changed, 14 deletions(-)
diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c
index 2b5c587b222b..8c838e2e457d 100644
--- a/drivers/powercap/intel_rapl_common.c
+++ b/drivers/powercap/intel_rapl_common.c
@@ -89,7 +89,6 @@
#define TPMI_INFO_MAX_TIME_WIN_MASK GENMASK_ULL(60, 54)
/* Non HW constants */
-#define RAPL_PRIMITIVE_DERIVED BIT(1) /* not from raw data */
#define RAPL_PRIMITIVE_DUMMY BIT(2)
#define ENERGY_UNIT_SCALE 1000 /* scale from driver unit to powercap unit */
@@ -700,9 +699,6 @@ static struct rapl_primitive_info rpi_msr[NR_RAPL_PRIMITIVES] = {
19, RAPL_DOMAIN_REG_LIMIT, TIME_UNIT, 0),
[PSYS_TIME_WINDOW2] = PRIMITIVE_INFO_INIT(PSYS_TIME_WINDOW2, PSYS_TIME_WINDOW2_MASK,
51, RAPL_DOMAIN_REG_LIMIT, TIME_UNIT, 0),
- /* non-hardware */
- [AVERAGE_POWER] = PRIMITIVE_INFO_INIT(AVERAGE_POWER, 0, 0, 0, POWER_UNIT,
- RAPL_PRIMITIVE_DERIVED),
};
/* RAPL primitives for TPMI I/F */
@@ -742,9 +738,6 @@ static struct rapl_primitive_info rpi_tpmi[NR_RAPL_PRIMITIVES] = {
54, RAPL_DOMAIN_REG_INFO, TIME_UNIT, 0),
[THROTTLED_TIME] = PRIMITIVE_INFO_INIT(THROTTLED_TIME, PERF_STATUS_THROTTLE_TIME_MASK,
0, RAPL_DOMAIN_REG_PERF, TIME_UNIT, 0),
- /* non-hardware */
- [AVERAGE_POWER] = PRIMITIVE_INFO_INIT(AVERAGE_POWER, 0, 0, 0, POWER_UNIT,
- RAPL_PRIMITIVE_DERIVED),
};
static struct rapl_primitive_info *get_rpi(struct rapl_package *rp, int prim)
@@ -837,12 +830,6 @@ static int rapl_read_data_raw(struct rapl_domain *rd,
if (!ra.reg.val)
return -EINVAL;
- /* non-hardware data are collected by the polling thread */
- if (rpi->flag & RAPL_PRIMITIVE_DERIVED) {
- *data = rd->rdd.primitives[prim];
- return 0;
- }
-
ra.mask = rpi->mask;
if (rd->rp->priv->read_raw(get_rid(rd->rp), &ra, pmu_ctx)) {
diff --git a/include/linux/intel_rapl.h b/include/linux/intel_rapl.h
index 6d694099a3ad..9e6bd654be1f 100644
--- a/include/linux/intel_rapl.h
+++ b/include/linux/intel_rapl.h
@@ -77,7 +77,6 @@ enum rapl_primitives {
PSYS_TIME_WINDOW1,
PSYS_TIME_WINDOW2,
/* below are not raw primitive data */
- AVERAGE_POWER,
NR_RAPL_PRIMITIVES,
};
--
2.43.0
next prev parent reply other threads:[~2026-03-13 18:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-13 18:53 [PATCH v1 0/6] powercap: intel_rapl: Move primitives to interface drivers Kuppuswamy Sathyanarayanan
2026-03-13 18:53 ` Kuppuswamy Sathyanarayanan [this message]
2026-03-13 18:53 ` [PATCH v1 2/6] powercap: intel_rapl: Remove unused macro definitions Kuppuswamy Sathyanarayanan
2026-03-13 18:53 ` [PATCH v1 3/6] powercap: intel_rapl: Move primitive info to header for interface drivers Kuppuswamy Sathyanarayanan
2026-03-13 18:53 ` [PATCH v1 4/6] powercap: intel_rapl: Move TPMI primitives to TPMI driver Kuppuswamy Sathyanarayanan
2026-03-13 18:53 ` [PATCH v1 5/6] thermal: intel: int340x: processor: Move MMIO primitives to MMIO driver Kuppuswamy Sathyanarayanan
2026-03-13 18:53 ` [PATCH v1 6/6] powercap: intel_rapl: Move MSR primitives to MSR driver Kuppuswamy Sathyanarayanan
2026-03-20 17:02 ` [PATCH v1 0/6] powercap: intel_rapl: Move primitives to interface drivers srinivas pandruvada
2026-03-20 18:10 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260313185333.2370733-2-sathyanarayanan.kuppuswamy@linux.intel.com \
--to=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
--cc=srinivas.pandruvada@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox