Skip to content

Commit

Permalink
intel_rapl: abstract RAPL common code
Browse files Browse the repository at this point in the history
Split intel_rapl.c to intel_rapl_common.c and intel_rapl_msr.c, where
intel_rapl_common.c contains the common code that can be used by both MSR
and MMIO interface.
intel_rapl_msr.c contains the implementation of RAPL MSR interface.

Reviewed-by: Pandruvada, Srinivas <srinivas.pandruvada@intel.com>
Tested-by: Pandruvada, Srinivas <srinivas.pandruvada@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Zhang Rui authored and Rafael J. Wysocki committed Jul 11, 2019
1 parent 1193b16 commit 3382388
Show file tree
Hide file tree
Showing 5 changed files with 395 additions and 326 deletions.
11 changes: 7 additions & 4 deletions drivers/powercap/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ menuconfig POWERCAP

if POWERCAP
# Client driver configurations go here.
config INTEL_RAPL_CORE
tristate

config INTEL_RAPL
tristate "Intel RAPL Support"
tristate "Intel RAPL Support via MSR Interface"
depends on X86 && IOSF_MBI
default n
select INTEL_RAPL_CORE
---help---
This enables support for the Intel Running Average Power Limit (RAPL)
technology which allows power limits to be enforced and monitored on
modern Intel processors (Sandy Bridge and later).
technology via MSR interface, which allows power limits to be enforced
and monitored on modern Intel processors (Sandy Bridge and later).

In RAPL, the platform level settings are divided into domains for
fine grained control. These domains include processor package, DRAM
Expand Down
3 changes: 2 additions & 1 deletion drivers/powercap/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_POWERCAP) += powercap_sys.o
obj-$(CONFIG_INTEL_RAPL) += intel_rapl.o
obj-$(CONFIG_INTEL_RAPL_CORE) += intel_rapl_common.o
obj-$(CONFIG_INTEL_RAPL) += intel_rapl_msr.o
obj-$(CONFIG_IDLE_INJECT) += idle_inject.o
Loading

0 comments on commit 3382388

Please sign in to comment.