lkml.org 
[lkml]   [2010]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] v4 x86/mrst: add cpu type detection
On Tue, 18 May 2010, Jacob Pan wrote:
>
> +int mrst_identify_cpu(void)
> +{
> + u32 mrst_cpu_chip;
> +
> + if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x27)
> + mrst_cpu_chip = MRST_CPU_CHIP_PENWELL;
> + else if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x26)
> + mrst_cpu_chip = MRST_CPU_CHIP_LINCROFT;
> + else {
> + pr_err("Unknown Moorestown CPU (%d:%d), default to Lincroft\n",
> + boot_cpu_data.x86, boot_cpu_data.x86_model);
> + mrst_cpu_chip = MRST_CPU_CHIP_LINCROFT;
> + }
> + pr_debug("Moorestown CPU %s identified\n",
> + (mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT) ?
> + "Lincroft" : "Penwell");

Do you really want a printk for each call ?

Aside of that wouldn't it make more sense to do the chip
identification only once from mrst_init() and cache the result and
change mrst_identify_cpu()

int mrst_indetify_cpu(void)
{
return mrst_cpu_chip;
}
EXPORT_SYMBOL_GPL(mrst_identify_cpu);

I think one of your earlier versions did that, but was not consistent
in it's behaviour.

Thanks,

tglx


\
 
 \ /
  Last update: 2010-05-18 22:57    [W:0.073 / U:31.828 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site