* [PATCH] cpufreq: intel_pstate: remove incorrect __initconst annotation
@ 2018-06-08 15:14 Arnd Bergmann
2018-06-08 15:21 ` Srinivas Pandruvada
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-06-08 15:14 UTC (permalink / raw)
To: Srinivas Pandruvada, Len Brown, Rafael J. Wysocki, Viresh Kumar
Cc: Arnd Bergmann, Doug Smythies, Toshi Kani, linux-pm, linux-kernel
We get a build warning about the newly introduced code in
intel_pstate_init_cpu() that references an __initconst variable after
it has been freed:
WARNING: vmlinux.o(.text+0xf9eca2): Section mismatch in reference from the function intel_pstate_init_cpu() to the variable .init.rodata:intel_pstate_hwp_boost_ids
The function intel_pstate_init_cpu() references
the variable __initconst intel_pstate_hwp_boost_ids.
This is often because intel_pstate_init_cpu lacks a __initconst
annotation or the annotation of intel_pstate_hwp_boost_ids is wrong.
This removes the annotation to keep the variable around at
runtime.
Fixes: f50f70793d78 ("cpufreq: intel_pstate: enable boost for Skylake Xeon")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/cpufreq/intel_pstate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 2065724dbffc..380936700165 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1794,7 +1794,7 @@ static const struct x86_cpu_id intel_pstate_cpu_ee_disable_ids[] = {
{}
};
-static const struct x86_cpu_id intel_pstate_hwp_boost_ids[] __initconst = {
+static const struct x86_cpu_id intel_pstate_hwp_boost_ids[] = {
ICPU(INTEL_FAM6_SKYLAKE_X, core_funcs),
ICPU(INTEL_FAM6_SKYLAKE_DESKTOP, core_funcs),
{}
--
2.9.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cpufreq: intel_pstate: remove incorrect __initconst annotation
2018-06-08 15:14 [PATCH] cpufreq: intel_pstate: remove incorrect __initconst annotation Arnd Bergmann
@ 2018-06-08 15:21 ` Srinivas Pandruvada
0 siblings, 0 replies; 2+ messages in thread
From: Srinivas Pandruvada @ 2018-06-08 15:21 UTC (permalink / raw)
To: Arnd Bergmann, Len Brown, Rafael J. Wysocki, Viresh Kumar
Cc: Doug Smythies, Toshi Kani, linux-pm, linux-kernel
On Fri, 2018-06-08 at 17:14 +0200, Arnd Bergmann wrote:
> We get a build warning about the newly introduced code in
> intel_pstate_init_cpu() that references an __initconst variable after
> it has been freed:
>
I see Rafael already addressed this.
https://kernel.googlesource.com/pub/scm/linux/kernel/git/rafael/linux-p
m/+/41ab43c9c89e06ff08a4750d1b09e227ea97894f%5E%21/#F0
Thanks,
Srinivas
> WARNING: vmlinux.o(.text+0xf9eca2): Section mismatch in reference
> from the function intel_pstate_init_cpu() to the variable
> .init.rodata:intel_pstate_hwp_boost_ids
> The function intel_pstate_init_cpu() references
> the variable __initconst intel_pstate_hwp_boost_ids.
> This is often because intel_pstate_init_cpu lacks a __initconst
> annotation or the annotation of intel_pstate_hwp_boost_ids is wrong.
>
> This removes the annotation to keep the variable around at
> runtime.
>
> Fixes: f50f70793d78 ("cpufreq: intel_pstate: enable boost for Skylake
> Xeon")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/cpufreq/intel_pstate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/intel_pstate.c
> b/drivers/cpufreq/intel_pstate.c
> index 2065724dbffc..380936700165 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -1794,7 +1794,7 @@ static const struct x86_cpu_id
> intel_pstate_cpu_ee_disable_ids[] = {
> {}
> };
>
> -static const struct x86_cpu_id intel_pstate_hwp_boost_ids[]
> __initconst = {
> +static const struct x86_cpu_id intel_pstate_hwp_boost_ids[] = {
> ICPU(INTEL_FAM6_SKYLAKE_X, core_funcs),
> ICPU(INTEL_FAM6_SKYLAKE_DESKTOP, core_funcs),
> {}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-08 15:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-08 15:14 [PATCH] cpufreq: intel_pstate: remove incorrect __initconst annotation Arnd Bergmann
2018-06-08 15:21 ` Srinivas Pandruvada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).