intel_rapl: Fix module autoloading issue
authorZhang Rui <rui.zhang@intel.com>
Wed, 10 Jul 2019 13:44:34 +0000 (21:44 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 11 Jul 2019 13:08:58 +0000 (15:08 +0200)
commitabcfaeb3f5dc8bded4ba446eb2fb017a7a41d9bc
treee4bfec49a6ac1e2c66bda969d8fe940c8362b0a1
parent555c45fe0d04bd817e245a125d242b6a86af4593
intel_rapl: Fix module autoloading issue

intel_rapl driver used to have a list of cpuids, which is used to
1. check if the processor support RAPL MSRs
2. do some cpu model specific setting
3. module autoloading

Now, the cpu model specific setting are moved to intel_rapl_common.c as
part of the common code, because the setup is also needed by RAPL MMIO
interface on those platforms.
But removing the cpuid list from intel_rapl MSR interface driver results
in that the driver can not be loaded automatically.

Maintaining another copy of the cpuid list in intel_rapl_msr.c does not make
sense because it increases the complexity when enabling RAPL support on a
new cpu model.

Fix the problem by creating an "intel_rapl_msr" platform device in the
common code, and make RAPL MSR interface driver (intel_rapl_msr.c) probe the
platform device directly.

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>
drivers/powercap/intel_rapl_common.c
drivers/powercap/intel_rapl_msr.c