From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752195AbbEZIaF (ORCPT ); Tue, 26 May 2015 04:30:05 -0400 Received: from mail.skyhub.de ([78.46.96.112]:44776 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751556AbbEZI2a (ORCPT ); Tue, 26 May 2015 04:28:30 -0400 From: Borislav Petkov To: Ingo Molnar Cc: X86-ML , LKML Subject: [PATCH 18/18] x86/mce: Fix monarch timeout setting through the mce= cmdline option Date: Tue, 26 May 2015 10:28:21 +0200 Message-Id: <1432628901-18044-19-git-send-email-bp@alien8.de> X-Mailer: git-send-email 1.9.0.258.g00eda23 In-Reply-To: <1432628901-18044-1-git-send-email-bp@alien8.de> References: <1432628901-18044-1-git-send-email-bp@alien8.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xie XiuQi Using "mce=1,10000000" on the kernel cmdline to change the monarch timeout does not work. The cause is that get_option() does parse a subsequent comma in the option string and signals that with a return value. So we don't need to check for a second comma ourselves. Signed-off-by: Xie XiuQi Cc: Tony Luck Cc: Thomas Gleixner Cc: Ingo Molnar Cc: H. Peter Anvin Link: http://lkml.kernel.org/r/1432120943-25028-1-git-send-email-xiexiuqi@huawei.com Signed-off-by: Borislav Petkov --- arch/x86/kernel/cpu/mcheck/mce.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index e535533d5ab8..e6580b9255de 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -2008,11 +2008,8 @@ static int __init mcheck_enable(char *str) else if (!strcmp(str, "bios_cmci_threshold")) cfg->bios_cmci_threshold = true; else if (isdigit(str[0])) { - get_option(&str, &(cfg->tolerant)); - if (*str == ',') { - ++str; + if (get_option(&str, &(cfg->tolerant)) == 2) get_option(&str, &(cfg->monarch_timeout)); - } } else { pr_info("mce argument %s ignored. Please use /sys\n", str); return 0; -- 1.9.0.258.g00eda23