public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Amerigo Wang <amwang@redhat.com>
To: Andreas Herrmann <andreas.herrmann3@amd.com>
Cc: Tejun Heo <tj@kernel.org>,
	linux-kernel@vger.kernel.org,
	Rusty Russell <rusty@rustcorp.com.au>,
	"H. Peter Anvin" <hpa@zytor.com>, Mike Travis <travis@sgi.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Yinghai Lu <yinghai@kernel.org>,
	akpm@linux-foundation.org, Ingo Molnar <mingo@elte.hu>,
	Borislav Petkov <borislav.petkov@amd.com>
Subject: Re: [Patch] x86: export cpu_llc_id for edac drivers
Date: Wed, 16 Sep 2009 17:43:41 +0800	[thread overview]
Message-ID: <4AB0B34D.6040402@redhat.com> (raw)
In-Reply-To: <20090915142233.GA21670@alberich.amd.com>

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;
> 
> 


      reply	other threads:[~2009-09-16  9:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AB0B34D.6040402@redhat.com \
    --to=amwang@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreas.herrmann3@amd.com \
    --cc=borislav.petkov@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=travis@sgi.com \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox