Skip to content

Commit

Permalink
don't report an error if PowerClamp run on other CPU
Browse files Browse the repository at this point in the history
  • Loading branch information
ZVNexus authored and kakra committed Jan 18, 2021
1 parent 7cd4912 commit 98225d8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/thermal/intel/intel_powerclamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,11 @@ static struct thermal_cooling_device_ops powerclamp_cooling_ops = {
.set_cur_state = powerclamp_set_cur_state,
};

static const struct x86_cpu_id amd_cpu[] = {
{ X86_VENDOR_AMD },
{},
};

static const struct x86_cpu_id __initconst intel_powerclamp_ids[] = {
X86_MATCH_VENDOR_FEATURE(INTEL, X86_FEATURE_MWAIT, NULL),
{}
Expand All @@ -656,6 +661,11 @@ MODULE_DEVICE_TABLE(x86cpu, intel_powerclamp_ids);
static int __init powerclamp_probe(void)
{

if (x86_match_cpu(amd_cpu)){
pr_info("Intel PowerClamp does not support AMD CPUs\n");
return -ENODEV;
}

if (!x86_match_cpu(intel_powerclamp_ids)) {
pr_err("CPU does not support MWAIT\n");
return -ENODEV;
Expand Down

0 comments on commit 98225d8

Please sign in to comment.