Linux 4.19.0 Build Error when CONFIG_ACPI not set.
Subsystems (2)
When I compile the 4.19.0 Linux kernel, I get this build error:
[root@f28 linux]# fgrep -r CONFIG_ACPI .config
# CONFIG_ACPI is not set
[root@f28 linux]#
[root@f28 linux]# make
CALL scripts/checksyscalls.sh
DESCEND objtool
CHK include/generated/compile.h
CC drivers/cpufreq/intel_pstate.odrivers/cpufreq/intel_pstate.c: In function ‘show_base_frequency’:
drivers/cpufreq/intel_pstate.c:726:10: error: implicit declaration of
function ‘intel_pstate_get_cppc_guranteed’;
did you mean ‘intel_pstate_get_epp’?
[-Werror=implicit-function-declaration]
ratio = intel_pstate_get_cppc_guranteed(policy->cpu);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_pstate_get_eppcc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:306: drivers/cpufreq/intel_pstate.o]
Error 1
make[1]: *** [scripts/Makefile.build:546: drivers/cpufreq] Error 2
make: *** [Makefile:1052: drivers] Error 2
[root@f28 linux]#
I am building on a virtual machine.
This was introduced with
commit 86d333a8cc7f ("cpufreq: intel_pstate: Add base_frequency attribute")
The function intel_pstate_get_cppc_guranteed() is called but the function definition is within #ifdef CONFIG_ACPI/#endif conditional compile.
Any ideas how to fix this?
Thanks
Signature · 5 lines
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany -- Vorsitzende des Aufsichtsrats: Martina Koederitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
Quoted 28 lines · Thomas-Mich Richter
When I compile the 4.19.0 Linux kernel, I get this build error:
[root@f28 linux]# fgrep -r
CONFIG_ACPI.config
#CONFIG_ACPIis not set
[root@f28 linux]#[root@f28 linux]# make
CALLscripts/checksyscalls.sh
DESCEND objtool
CHKinclude/generated/compile.h
CCdrivers/cpufreq/intel_pstate.odrivers/cpufreq/intel_pstate.c: In function ‘show_base_frequency’:drivers/cpufreq/intel_pstate.c:726:10: error: implicit declaration of function ‘intel_pstate_get_cppc_guranteed’; did you mean ‘intel_pstate_get_epp’? [-Werror=implicit-function-declaration] ratio = intel_pstate_get_cppc_guranteed(policy->cpu); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ intel_pstate_get_eppcc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:306:drivers/cpufreq/intel_pstate.o]
Error 1
make[1]: *** [scripts/Makefile.build:546:drivers/cpufreq] Error 2
make: *** [Makefile:1052: drivers] Error 2
[root@f28 linux]#I am building on a virtual machine.
Quoted 7 lines
This was introduced with
commit86d333a8cc7f("cpufreq:intel_pstate: Addbase_frequencyattribute")The function
intel_pstate_get_cppc_guranteed()is called but the function definition is within #ifdef CONFIG_ACPI/#endif conditional compile.Any ideas how to fix this?
This isn't in 4.19.0, but in current mainline, and can be fixed by this patch which is already on its way upstream.
https://patchwork.kernel.org/patch/10653593/
Thanks,
Dominik
----
Date: Tue, 23 Oct 2018 21:54:03 +0200
From: Dominik Brodowski <[email protected]>
Subject: [PATCH v2] cpufreq: intel_pstate: Fix compilation for !CONFIG_ACPI
While at it, add a few comments which config options #ifdef and #else statements refer to.
drivers/cpufreq/intel_pstate.c +11 -9
@@ -386,16 +386,11 @@ static int intel_pstate_get_cppc_guranteed(int cpu) return cppc_perf.guaranteed_perf; } -#else +#else /* CONFIG_ACPI_CPPC_LIB */ static void intel_pstate_set_itmt_prio (int cpu) { } - -static int intel_pstate_get_cppc_guranteed (int cpu) -{ -return -ENOTSUPP ; -} -#endif +#endif /* CONFIG_ACPI_CPPC_LIB */ static void intel_pstate_init_acpi_perf_limits (struct cpufreq_policy *policy) {
@@ -477,7 +472,7 @@ static void intel_pstate_exit_perf_limits(struct cpufreq_policy *policy) acpi_processor_unregister_performance(policy->cpu); } -#else +#else /* CONFIG_ACPI */ static inline void intel_pstate_init_acpi_perf_limits (struct cpufreq_policy *policy) { }
@@ -490,7 +485,14 @@ static inline bool intel_pstate_acpi_pm_profile_server(void) {return false; } -#endif +#endif /* CONFIG_ACPI */ + +#ifndef CONFIG_ACPI_CPPC_LIB +static int intel_pstate_get_cppc_guranteed (int cpu) +{ +return -ENOTSUPP ; +} +#endif /* CONFIG_ACPI_CPPC_LIB */ static inline void update_turbo_state (void ) {