From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752460Ab2H0PNT (ORCPT ); Mon, 27 Aug 2012 11:13:19 -0400 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:57393 "EHLO e28smtp07.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751653Ab2H0PNQ (ORCPT ); Mon, 27 Aug 2012 11:13:16 -0400 Message-ID: <503B8E26.2050604@linux.vnet.ibm.com> Date: Mon, 27 Aug 2012 20:41:34 +0530 From: "Naveen N. Rao" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Borislav Petkov CC: tony.luck@intel.com, andi@firstfloor.org, gong.chen@linux.intel.com, ananth@in.ibm.com, masbock@linux.vnet.ibm.com, x86@kernel.org, linux-kernel@vger.kernel.org, lcm@us.ibm.com, mingo@redhat.com, tglx@linutronix.de, linux-edac@vger.kernel.org Subject: Re: [PATCH 2/2] x86/mce: Honour bios-set CMCI threshold References: <20120827112503.10313.62594.stgit@localhost.localdomain> <20120827112512.10313.49176.stgit@localhost.localdomain> <20120827144829.GF27979@aftab.osrc.amd.com> In-Reply-To: <20120827144829.GF27979@aftab.osrc.amd.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit x-cbid: 12082715-8878-0000-0000-000003C292A1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/27/2012 08:18 PM, Borislav Petkov wrote: > On Mon, Aug 27, 2012 at 04:55:12PM +0530, Naveen N. Rao wrote: >> The ACPI spec doesn't provide for a way for the bios to pass down >> recommended thresholds to the OS on a _per-bank_ basis. This patch adds >> a new boot option, which if passed, allows bios to initialize the CMCI >> threshold. In such a case, we simply skip programming any threshold >> value. >> >> As fail-safe, we initialize threshold to 1 if some banks have not been >> initialized by the bios and warn the user. >> >> Changes: >> - Use the mce_boot_flags structure. >> - Expose bios_cmci_threshold via sysfs. >> >> Signed-off-by: Naveen N. Rao >> --- > > ... > >> @@ -119,6 +146,12 @@ static void cmci_discover(int banks, int boot) >> raw_spin_unlock_irqrestore(&cmci_discover_lock, flags); >> if (hdr) >> printk(KERN_CONT "\n"); >> + if (boot && mce_boot_flags.bios_cmci_threshold && bios_wrong_thresh) { >> + printk_once(KERN_INFO >> + "bios_cmci_threshold: Some banks do not have valid thresholds set"); >> + printk_once(KERN_INFO >> + "bios_cmci_threshold: Make sure your BIOS supports this boot option"); >> + } > > All functional changes aside, why do you want to print this at all? Does > it bring anything to the user? > > Because if BIOS is systematically b0rked and we keep issuing this every > time do do cmci_discover, then we have a lotsa users to explain to what > happens. > > Why not do a printk_once saying something along the lines of "BIOS > hasn't setup thresholds properly, correcting..." and that's it? Yes, that's the intent here. I am using printk_once() and if I'm not mistaken, we print the above only once during boot. I am open to changing the message if the above two lines aren't good. Thanks! - Naveen > > Tony? >