public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] x86: export cpu_llc_id for edac drivers
@ 2009-09-15  8:17 Amerigo Wang
  2009-09-15  8:25 ` Tejun Heo
  0 siblings, 1 reply; 4+ messages in thread
From: Amerigo Wang @ 2009-09-15  8:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Rusty Russell, Tejun Heo, H. Peter Anvin, Mike Travis,
	Thomas Gleixner, Amerigo Wang, Yinghai Lu, akpm, Ingo Molnar


When I compiled today's Linus tree, I got a link error from
drivers/edac/edac_mce_amd.c:408, it complained about not finding
symbol 'per_cpu__cpu_llc_id'. This is due to we don't export
'cpu_llc_id'.

This patch fixes it.

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Tejun Heo <tj@kernel.org>
Cc: Mike Travis <travis@sgi.com>

---
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index c36cc14..3241773 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -99,6 +99,7 @@ EXPORT_SYMBOL(smp_num_siblings);
 
 /* Last level cache ID of each logical CPU */
 DEFINE_PER_CPU(u16, cpu_llc_id) = BAD_APICID;
+EXPORT_PER_CPU_SYMBOL(cpu_llc_id);
 
 /* representing HT siblings of each logical CPU */
 DEFINE_PER_CPU(cpumask_var_t, cpu_sibling_map);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Patch] x86: export cpu_llc_id for edac drivers
  2009-09-15  8:17 [Patch] x86: export cpu_llc_id for edac drivers Amerigo Wang
@ 2009-09-15  8:25 ` Tejun Heo
  2009-09-15 14:22   ` Andreas Herrmann
  0 siblings, 1 reply; 4+ messages in thread
From: Tejun Heo @ 2009-09-15  8:25 UTC (permalink / raw)
  To: Amerigo Wang
  Cc: linux-kernel, Rusty Russell, H. Peter Anvin, Mike Travis,
	Thomas Gleixner, Yinghai Lu, akpm, Ingo Molnar

Heh.. was about to send out the same patch.

Amerigo Wang wrote:
> When I compiled today's Linus tree, I got a link error from
> drivers/edac/edac_mce_amd.c:408, it complained about not finding
> symbol 'per_cpu__cpu_llc_id'. This is due to we don't export
> 'cpu_llc_id'.
> 
> This patch fixes it.
> 
> Signed-off-by: WANG Cong <amwang@redhat.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Yinghai Lu <yinghai@kernel.org>
> Cc: Rusty Russell <rusty@rustcorp.com.au>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Mike Travis <travis@sgi.com>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Patch] x86: export cpu_llc_id for edac drivers
  2009-09-15  8:25 ` Tejun Heo
@ 2009-09-15 14:22   ` Andreas Herrmann
  2009-09-16  9:43     ` Amerigo Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Herrmann @ 2009-09-15 14:22 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Amerigo Wang, linux-kernel, Rusty Russell, H. Peter Anvin,
	Mike Travis, Thomas Gleixner, Yinghai Lu, akpm, Ingo Molnar,
	Borislav Petkov

On Tue, Sep 15, 2009 at 05:25:14PM +0900, Tejun Heo wrote:
> Heh.. was about to send out the same patch.

Maybe a better fix would be to provide a wrapper for this.
See attached patch.

Regards,
Andreas

---
x86, edac: Provide function to return NodeId for CPU

Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index e08ea04..42a3f93 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -1020,4 +1020,6 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
 extern int get_tsc_mode(unsigned long adr);
 extern int set_tsc_mode(unsigned int val);
 
+extern int amd_get_nb_id(int cpu);
+
 #endif /* _ASM_X86_PROCESSOR_H */
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 22a47c8..f32fa71 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -333,6 +333,16 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c)
 #endif
 }
 
+int amd_get_nb_id(int cpu)
+{
+	int id = 0;
+#ifdef CONFIG_SMP
+	id = per_cpu(cpu_llc_id, cpu);
+#endif
+	return id;
+}
+EXPORT_SYMBOL_GPL(amd_get_nb_id);
+
 static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c)
 {
 #if defined(CONFIG_NUMA) && defined(CONFIG_X86_64)
diff --git a/drivers/edac/edac_mce_amd.c b/drivers/edac/edac_mce_amd.c
index c8ca713..0c21c37 100644
--- a/drivers/edac/edac_mce_amd.c
+++ b/drivers/edac/edac_mce_amd.c
@@ -405,7 +405,7 @@ void decode_mce(struct mce *m)
 		regs.nbsh  = (u32)(m->status >> 32);
 		regs.nbeal = (u32) m->addr;
 		regs.nbeah = (u32)(m->addr >> 32);
-		node       = per_cpu(cpu_llc_id, m->extcpu);
+		node       = amd_get_nb_id(m->extcpu);
 
 		amd_decode_nb_mce(node, &regs, 1);
 		break;



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Patch] x86: export cpu_llc_id for edac drivers
  2009-09-15 14:22   ` Andreas Herrmann
@ 2009-09-16  9:43     ` Amerigo Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Amerigo Wang @ 2009-09-16  9:43 UTC (permalink / raw)
  To: Andreas Herrmann
  Cc: Tejun Heo, linux-kernel, Rusty Russell, H. Peter Anvin,
	Mike Travis, Thomas Gleixner, Yinghai Lu, akpm, Ingo Molnar,
	Borislav Petkov

Andreas Herrmann wrote:
> On Tue, Sep 15, 2009 at 05:25:14PM +0900, Tejun Heo wrote:
>> Heh.. was about to send out the same patch.
> 
> Maybe a better fix would be to provide a wrapper for this.
> See attached patch.
> 

Agreed.


> Regards,
> Andreas
> 
> ---
> x86, edac: Provide function to return NodeId for CPU
> 
> Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
> 


Reviewed-by: WANG Cong <amwang@redhat.com>

Thanks.


> diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
> index e08ea04..42a3f93 100644
> --- a/arch/x86/include/asm/processor.h
> +++ b/arch/x86/include/asm/processor.h
> @@ -1020,4 +1020,6 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
>  extern int get_tsc_mode(unsigned long adr);
>  extern int set_tsc_mode(unsigned int val);
>  
> +extern int amd_get_nb_id(int cpu);
> +
>  #endif /* _ASM_X86_PROCESSOR_H */
> diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
> index 22a47c8..f32fa71 100644
> --- a/arch/x86/kernel/cpu/amd.c
> +++ b/arch/x86/kernel/cpu/amd.c
> @@ -333,6 +333,16 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c)
>  #endif
>  }
>  
> +int amd_get_nb_id(int cpu)
> +{
> +	int id = 0;
> +#ifdef CONFIG_SMP
> +	id = per_cpu(cpu_llc_id, cpu);
> +#endif
> +	return id;
> +}
> +EXPORT_SYMBOL_GPL(amd_get_nb_id);
> +
>  static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c)
>  {
>  #if defined(CONFIG_NUMA) && defined(CONFIG_X86_64)
> diff --git a/drivers/edac/edac_mce_amd.c b/drivers/edac/edac_mce_amd.c
> index c8ca713..0c21c37 100644
> --- a/drivers/edac/edac_mce_amd.c
> +++ b/drivers/edac/edac_mce_amd.c
> @@ -405,7 +405,7 @@ void decode_mce(struct mce *m)
>  		regs.nbsh  = (u32)(m->status >> 32);
>  		regs.nbeal = (u32) m->addr;
>  		regs.nbeah = (u32)(m->addr >> 32);
> -		node       = per_cpu(cpu_llc_id, m->extcpu);
> +		node       = amd_get_nb_id(m->extcpu);
>  
>  		amd_decode_nb_mce(node, &regs, 1);
>  		break;
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-09-16  9:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-15  8:17 [Patch] x86: export cpu_llc_id for edac drivers Amerigo Wang
2009-09-15  8:25 ` Tejun Heo
2009-09-15 14:22   ` Andreas Herrmann
2009-09-16  9:43     ` Amerigo Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox