[Meego-kernel] [PATCH 2/2] SFI P state driver
Mansoor, Illyas
illyas.mansoor at intel.com
Tue Nov 23 08:15:37 PST 2010
> > On 11/22/2010 8:16 AM, Mansoor, Illyas wrote:
> > > Hi Arjan,
> > >
> > > Please find the patch that fixes this, thanks.
> > >
> > >
> > > From 0fa3f051da35f148605a29ca5cc15eac33c08697 Mon Sep 17 00:00:00
> > 2001
> > > From: Illyas Mansoor<illyas.mansoor at intel.com>
> > > Date: Tue, 23 Nov 2010 00:43:01 +0530
> > > Subject: [PATCH] fix for section mismatch warnings
> > >
> > > sfi_processor_register_performance() was not
> > > annotated with __init fixed this.
> >
> > it's customary to put the actual compiler warning in the description
> if
> > you're fixing one...
> >
>
> Okay, will take care of this, Thanks.
Arjan, resubmitting patch after adding compiler warnings in the description that have fixed.
>From 98d3d353287abc0ef0fd01c58bebaf506d6de5d6 Mon Sep 17 00:00:00 2001
From: Illyas Mansoor <illyas.mansoor at intel.com>
Date: Wed, 24 Nov 2010 09:13:24 +0530
Subject: [PATCH] Fix for section mismatch warnings
sfi_processor_register_performance(), sfi_cpufreq_cpu_init was not
annotated with __init fixed this.
Also because of the above changes sfi_cpufreq_driver variable also
had to be changed to sfi_cpufreq_driver_ops since it was being
refrenced in sfi_processor_register_performance, that was annotated
with __init.
Fixed the following compiler warnings:
WARNING: vmlinux.o(.text+0x12d4e): Section mismatch in reference from the function sfi_processor_register_performance() to the function .init.text:parse_freq()
The function sfi_processor_register_performance() references
the function __init parse_freq().
This is often because sfi_processor_register_performance lacks a __init
annotation or the annotation of parse_freq is wrong.
WARNING: arch/x86/kernel/cpu/built-in.o(.text+0x9356): Section mismatch in reference from the function sfi_cpufreq_cpu_init() to the function .init.text:sfi_processor_register_performance()
The function sfi_cpufreq_cpu_init() references
the function __init sfi_processor_register_performance().
This is often because sfi_cpufreq_cpu_init lacks a __init
annotation or the annotation of sfi_processor_register_performance is wrong.
WARNING: arch/x86/kernel/cpu/built-in.o(.data+0x1f24): Section mismatch in reference from the variable sfi_cpufreq_driver to the function .init.text:sfi_cpufreq_cpu_init()
The variable sfi_cpufreq_driver references
the function __init sfi_cpufreq_cpu_init()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one,
Signed-off-by: Illyas Mansoor <illyas.mansoor at intel.com>
---
arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.c | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.c
index 11d1438..aa0d935 100644
--- a/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/sfi-cpufreq.c
@@ -96,7 +96,7 @@ static struct sfi_cpu_table_entry sfi_cpu_array[SFI_CPU_MAX];
/* sfi_perf_data is a pointer to percpu data. */
static struct sfi_processor_performance *sfi_perf_data;
-static struct cpufreq_driver sfi_cpufreq_driver;
+static struct cpufreq_driver sfi_cpufreq_driver_ops;
static unsigned int sfi_pstate_strict;
@@ -179,7 +179,7 @@ void set_cpu_to_gfm(void)
wrmsr(MSR_IA32_PERF_CTL, l, h);
}
-int
+int __init
sfi_processor_register_performance(struct sfi_processor_performance
*performance, unsigned int cpu)
{
@@ -557,8 +557,7 @@ static int __init sfi_cpufreq_early_init(void)
return 0;
}
-
-static int sfi_cpufreq_cpu_init(struct cpufreq_policy *policy)
+static int __init sfi_cpufreq_cpu_init(struct cpufreq_policy *policy)
{
unsigned int i;
unsigned int valid_states = 0;
@@ -578,7 +577,7 @@ static int sfi_cpufreq_cpu_init(struct cpufreq_policy *policy)
per_cpu(drv_data, cpu) = data;
if (cpu_has(c, X86_FEATURE_CONSTANT_TSC))
- sfi_cpufreq_driver.flags |= CPUFREQ_CONST_LOOPS;
+ sfi_cpufreq_driver_ops.flags |= CPUFREQ_CONST_LOOPS;
result = sfi_processor_register_performance(data->sfi_data, cpu);
@@ -647,7 +646,7 @@ static int sfi_cpufreq_cpu_init(struct cpufreq_policy *policy)
if (result)
goto err_freqfree;
- sfi_cpufreq_driver.get = get_cur_freq_on_cpu;
+ sfi_cpufreq_driver_ops.get = get_cur_freq_on_cpu;
policy->cur = get_cur_freq_on_cpu(cpu);
/* Check for APERF/MPERF support in hardware */
@@ -655,7 +654,7 @@ static int sfi_cpufreq_cpu_init(struct cpufreq_policy *policy)
unsigned int ecx;
ecx = cpuid_ecx(6);
if (ecx & CPUID_6_ECX_APERFMPERF_CAPABILITY)
- sfi_cpufreq_driver.getavg = get_measured_perf;
+ sfi_cpufreq_driver_ops.getavg = get_measured_perf;
}
dprintk("CPU%u - SFI performance management activated.\n", cpu);
@@ -719,7 +718,7 @@ static struct freq_attr *sfi_cpufreq_attr[] = {
NULL,
};
-static struct cpufreq_driver sfi_cpufreq_driver = {
+static struct cpufreq_driver sfi_cpufreq_driver_ops = {
.verify = sfi_cpufreq_verify,
.target = sfi_cpufreq_target,
.init = sfi_cpufreq_cpu_init,
@@ -790,7 +789,7 @@ static int __init sfi_cpufreq_init(void)
if (ret)
return ret;
- return cpufreq_register_driver(&sfi_cpufreq_driver);
+ return cpufreq_register_driver(&sfi_cpufreq_driver_ops);
}
static void __exit sfi_cpufreq_exit(void)
@@ -803,7 +802,7 @@ static void __exit sfi_cpufreq_exit(void)
pr = per_cpu(sfi_processors, 0);
kfree(pr);
- cpufreq_unregister_driver(&sfi_cpufreq_driver);
+ cpufreq_unregister_driver(&sfi_cpufreq_driver_ops);
free_percpu(sfi_perf_data);
--
1.7.2.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-for-section-mismatch-warnings.patch
Type: application/octet-stream
Size: 4987 bytes
Desc: 0001-fix-for-section-mismatch-warnings.patch
URL: <http://lists.meego.com/pipermail/meego-kernel/attachments/20101123/23e0e9a1/attachment-0001.obj>
More information about the MeeGo-kernel
mailing list