Skip to content

Commit 9292a8d

Browse files
AKoskovichxdevs23
authored andcommitted
Don't report an error if PowerClamp run on other CPU
Signed-off-by: Simao Gomes Viana <[email protected]>
1 parent e40de1f commit 9292a8d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

drivers/thermal/intel/intel_powerclamp.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,11 @@ static struct thermal_cooling_device_ops powerclamp_cooling_ops = {
650650
.set_cur_state = powerclamp_set_cur_state,
651651
};
652652

653+
static const struct x86_cpu_id amd_cpu[] = {
654+
{ X86_VENDOR_AMD },
655+
{},
656+
};
657+
653658
static const struct x86_cpu_id __initconst intel_powerclamp_ids[] = {
654659
X86_MATCH_VENDOR_FEATURE(INTEL, X86_FEATURE_MWAIT, NULL),
655660
{}
@@ -659,6 +664,11 @@ MODULE_DEVICE_TABLE(x86cpu, intel_powerclamp_ids);
659664
static int __init powerclamp_probe(void)
660665
{
661666

667+
if (x86_match_cpu(amd_cpu)){
668+
pr_info("Intel PowerClamp does not support AMD CPUs\n");
669+
return -ENODEV;
670+
}
671+
662672
if (!x86_match_cpu(intel_powerclamp_ids)) {
663673
pr_err("CPU does not support MWAIT\n");
664674
return -ENODEV;

0 commit comments

Comments
 (0)