From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756536Ab0ERUzG (ORCPT ); Tue, 18 May 2010 16:55:06 -0400 Received: from www.tglx.de ([62.245.132.106]:40252 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753225Ab0ERUzE (ORCPT ); Tue, 18 May 2010 16:55:04 -0400 Date: Tue, 18 May 2010 22:54:47 +0200 (CEST) From: Thomas Gleixner To: Jacob Pan cc: LKML , "H. Peter Anvin" , Ingo Molnar , Alek Du , Alan Cox , Feng Tang Subject: Re: [PATCH 1/2] v4 x86/mrst: add cpu type detection In-Reply-To: <1274184166-17242-2-git-send-email-jacob.jun.pan@linux.intel.com> Message-ID: References: <1274184166-17242-1-git-send-email-jacob.jun.pan@linux.intel.com> <1274184166-17242-2-git-send-email-jacob.jun.pan@linux.intel.com> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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