Re: [PATCH 1/2] v4 x86/mrst: add cpu type detection

From: Thomas Gleixner
Date: Tue May 18 2010 - 16:55:11 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/