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 <Perry.Yuan@amd.com> [ rjw: Subject edits, new changelog ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
committed by
Rafael J. Wysocki
parent
1c23f9e627
commit
a2a9d18500
@@ -424,6 +424,9 @@ bool acpi_cpc_valid(void)
|
|||||||
struct cpc_desc *cpc_ptr;
|
struct cpc_desc *cpc_ptr;
|
||||||
int cpu;
|
int cpu;
|
||||||
|
|
||||||
|
if (acpi_disabled)
|
||||||
|
return false;
|
||||||
|
|
||||||
for_each_present_cpu(cpu) {
|
for_each_present_cpu(cpu) {
|
||||||
cpc_ptr = per_cpu(cpc_desc_ptr, cpu);
|
cpc_ptr = per_cpu(cpc_desc_ptr, cpu);
|
||||||
if (!cpc_ptr)
|
if (!cpc_ptr)
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ void topology_init_cpu_capacity_cppc(void)
|
|||||||
struct cppc_perf_caps perf_caps;
|
struct cppc_perf_caps perf_caps;
|
||||||
int cpu;
|
int cpu;
|
||||||
|
|
||||||
if (likely(acpi_disabled || !acpi_cpc_valid()))
|
if (likely(!acpi_cpc_valid()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
raw_capacity = kcalloc(num_possible_cpus(), sizeof(*raw_capacity),
|
raw_capacity = kcalloc(num_possible_cpus(), sizeof(*raw_capacity),
|
||||||
|
|||||||
@@ -673,7 +673,7 @@ static int __init amd_pstate_init(void)
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
if (!acpi_cpc_valid()) {
|
if (!acpi_cpc_valid()) {
|
||||||
pr_debug("the _CPC object is not present in SBIOS\n");
|
pr_warn_once("the _CPC object is not present in SBIOS or ACPI disabled\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -947,7 +947,7 @@ static int __init cppc_cpufreq_init(void)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ((acpi_disabled) || !acpi_cpc_valid())
|
if (!acpi_cpc_valid())
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
cppc_check_hisi_workaround();
|
cppc_check_hisi_workaround();
|
||||||
|
|||||||
Reference in New Issue
Block a user