Skip to content

Commit a2a9d18

Browse files
Perry Yuanrafaeljw
authored andcommitted
ACPI: CPPC: Add ACPI disabled check to acpi_cpc_valid()
Make acpi_cpc_valid() check if ACPI is disabled, so that its callers don't need to check that separately. This will also cause the AMD pstate driver to refuse to load right away when ACPI is disabled. Also update the warning message in amd_pstate_init() to mention the ACPI disabled case for completeness. Signed-off-by: Perry Yuan <[email protected]> [ rjw: Subject edits, new changelog ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 1c23f9e commit a2a9d18

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

drivers/acpi/cppc_acpi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,9 @@ bool acpi_cpc_valid(void)
424424
struct cpc_desc *cpc_ptr;
425425
int cpu;
426426

427+
if (acpi_disabled)
428+
return false;
429+
427430
for_each_present_cpu(cpu) {
428431
cpc_ptr = per_cpu(cpc_desc_ptr, cpu);
429432
if (!cpc_ptr)

drivers/base/arch_topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ void topology_init_cpu_capacity_cppc(void)
353353
struct cppc_perf_caps perf_caps;
354354
int cpu;
355355

356-
if (likely(acpi_disabled || !acpi_cpc_valid()))
356+
if (likely(!acpi_cpc_valid()))
357357
return;
358358

359359
raw_capacity = kcalloc(num_possible_cpus(), sizeof(*raw_capacity),

drivers/cpufreq/amd-pstate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ static int __init amd_pstate_init(void)
673673
return -ENODEV;
674674

675675
if (!acpi_cpc_valid()) {
676-
pr_debug("the _CPC object is not present in SBIOS\n");
676+
pr_warn_once("the _CPC object is not present in SBIOS or ACPI disabled\n");
677677
return -ENODEV;
678678
}
679679

drivers/cpufreq/cppc_cpufreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ static int __init cppc_cpufreq_init(void)
947947
{
948948
int ret;
949949

950-
if ((acpi_disabled) || !acpi_cpc_valid())
950+
if (!acpi_cpc_valid())
951951
return -ENODEV;
952952

953953
cppc_check_hisi_workaround();

0 commit comments

Comments
 (0)