From patchwork Mon Jul 11 18:16:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 71752 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp82114qga; Mon, 11 Jul 2016 11:16:39 -0700 (PDT) X-Received: by 10.98.113.74 with SMTP id m71mr37454589pfc.6.1468260999874; Mon, 11 Jul 2016 11:16:39 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3si5001398pfu.158.2016.07.11.11.16.39; Mon, 11 Jul 2016 11:16:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-rt-users-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: best guess record for domain of linux-rt-users-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-rt-users-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751766AbcGKSQe (ORCPT + 4 others); Mon, 11 Jul 2016 14:16:34 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:35324 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751737AbcGKSQd (ORCPT ); Mon, 11 Jul 2016 14:16:33 -0400 Received: by mail-oi0-f65.google.com with SMTP id w143so4165187oiw.2 for ; Mon, 11 Jul 2016 11:16:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=KxFtVk98uBW2lf2LHZMxx67X3fnfq1/JSKw0mEMq694=; b=KqS4lPm9V0la3ldlhj5W29lypbAi6AYlQnvm6Q1heMWLT5QUkwV0tCRIeIvwawn9OC DkWxYavsIpUYbuIRFC4zD7Dnwu2HIVR2QezKLJMNKr0BMwQF7MhKqMnZQkrSCQ2OCbFw blgJgXdnGZ0X6+oQDmLZFvktbwxo06qCsA3dsmW5mGPk0wWANH05X96sjdHoNyQVYZhJ D9jI8q1gWhGGImIHM6kWuzIvj+UczFGpo2156Wb1m3ffI02K3cuflR7Z6vnLvO2ny/zC OHFHN16esIX8KyBIoLotxqbALVvj4gKVOv7/ZQ8Yc2diOEmcLFx4BlRZGriq2t08j2oR k4kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=KxFtVk98uBW2lf2LHZMxx67X3fnfq1/JSKw0mEMq694=; b=DSqBjowb6Ybw5gQlxSpgW4CWef4YXMSg20QqqvKeXLanmbgIAQ1REFziuRusmHh7M+ +/vMMEbbeTXqheJZZ3q3YbETVnoo0u+wQwNOb8MsIFAx1/78Of21roYJPLB+RJCKG0/a SGWP5eoF6h2VsItKFLqdmH8GMNho8s3r35vpY5A5M1jcB/2tg01XdFgu5dcvl22xDY1n yKTNFwKXCfWTnWlQiheZVfP3KYKgKfqcxNkxHDKf42O5sIzdZR111qqV5VhIhl6Tzzvc D1WiP39+oeQk2QlViuxrTmL0sJTv1J+bH2qkRjiOjMryQ/R6EVmUg0HSEYtNgMHqPC+2 SzEw== X-Gm-Message-State: ALyK8tLHLR8nGT2BuFO9t4IKLriZzK5YE8QBxqZo1/ZGl0uWhIRsNaeQrS8b23tA8cArZw== X-Received: by 10.202.50.139 with SMTP id y133mr8757540oiy.46.1468260992547; Mon, 11 Jul 2016 11:16:32 -0700 (PDT) Received: from serve.minyard.net ([173.64.235.97]) by smtp.gmail.com with ESMTPSA id 9sm5635389oth.15.2016.07.11.11.16.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jul 2016 11:16:31 -0700 (PDT) Received: from t430.minyard.net (unknown [IPv6:2001:470:b8f6:1b:d10f:2311:69b:dca]) by serve.minyard.net (Postfix) with ESMTPA id E91C96CF; Mon, 11 Jul 2016 13:16:30 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id 1113E3012B3; Mon, 11 Jul 2016 13:16:29 -0500 (CDT) From: minyard@acm.org To: minyard@acm.org, Borislav Petkov , Luck@minyard.net, Tony , linux-rt-users@vger.kernel.org, Steven Rostedt , Sebastian Andrzej Siewior Cc: Corey Minyard Subject: [PATCH v3] x86: Fix an RT MCE crash Date: Mon, 11 Jul 2016 13:16:27 -0500 Message-Id: <1468260987-28303-1-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 Sender: linux-rt-users-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org From: Corey Minyard On some x86 systems an MCE interrupt would come in before the kernel was ready for it. Looking at the latest RT code, it has similar (but not quite the same) code, except it adds a bool that tells if MCE handling is initialized. That was required because they had switched to use swork instead of a kernel thread. Here, just checking to see if the thread is NULL is good enough to see if MCE handling is initialized. Suggested-by: Borislav Petkov Signed-off-by: Corey Minyard --- arch/x86/kernel/cpu/mcheck/mce.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Added Suggested-by: for Boris. -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index aaf4b9b..cc70d98 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -1391,7 +1391,8 @@ static int mce_notify_work_init(void) static void mce_notify_work(void) { - wake_up_process(mce_notify_helper); + if (mce_notify_helper) + wake_up_process(mce_notify_helper); } #else static void mce_notify_work(void)