From patchwork Wed Jul 6 18:55:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 71485 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1018530qgy; Wed, 6 Jul 2016 11:55:10 -0700 (PDT) X-Received: by 10.66.157.8 with SMTP id wi8mr45015892pab.21.1467831310398; Wed, 06 Jul 2016 11:55:10 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8si5258719pfg.270.2016.07.06.11.55.10; Wed, 06 Jul 2016 11:55:10 -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 S932235AbcGFSzJ (ORCPT + 4 others); Wed, 6 Jul 2016 14:55:09 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:34634 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932088AbcGFSzI (ORCPT ); Wed, 6 Jul 2016 14:55:08 -0400 Received: by mail-pa0-f67.google.com with SMTP id us13so21677812pab.1 for ; Wed, 06 Jul 2016 11:55:07 -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=rwj0rGrAJ6wDRRq9WEHYG+sGgWVVn9wQyIyHaYTwOm8=; b=aAuvD2b3ThM4kXaXfJvUxxct43/nPn+NZk52vfbnPwILToTdhmBBsGOP/1ueCbySJI QefnBG1lNdya033Sv/+hGwc9SxWqv9Pv5efQapmj10DKedLBib68n3fvOWjqouEBzbez CwT/yUn7587PoaZKckkOgMFZR7eMHIITaZ0D31MaSeFzyyvaq3nDe5LvXMHfNG5MDi8K wCxJLI174+bFvN5qnw9dovEYCl/BqJ/MRsEKjxxepCm33Uj5nnI647vaqz7kg54jp/cp sb4KpKycGIjoSLhGdzYDOiauaM4ob2cxa5S8NEQhtq+2QWy2wJ1Ika4+TaGpc82uIt+6 sNTQ== 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=rwj0rGrAJ6wDRRq9WEHYG+sGgWVVn9wQyIyHaYTwOm8=; b=Wg3ScHBKb428U4+yOrNgVNFJ7TRS5zyRRP3iJQJSD+F8STv91r2X6ctd3QZKcQJSdt sxK7SW43UChkZci6aunktiy9Np30Jmn7rEefVOMNMGsloYCwW/LuU5C/lcprmiTXwpJu W/FOPR08wN3BoowgfmcyozMZgLriD1VHZkwxSRM5q4veiLgt73cc5pXD268r74c/Gk9g OOAcSRKpadweS2j4TUuqSvOh3zC2orKXTc0xyQ144HUU8MRX3wTwP8tOk9J0pGCzlWGq d6xUFGdP0mt+wKHUe8HSg3G2xunFsHZN638mpOz36qnxjBU1vkNRgfr05LH3qejKHddf X3dw== X-Gm-Message-State: ALyK8tLtiIloalUcY+I4AQUJidprpoYDD3348lDc2OzaUNIluKA+9cUKEMcaWYIZQ6jqpA== X-Received: by 10.66.52.11 with SMTP id p11mr45181043pao.155.1467831307091; Wed, 06 Jul 2016 11:55:07 -0700 (PDT) Received: from serve.minyard.net (serve.minyard.net. [2001:470:b8f6:1b::1]) by smtp.gmail.com with ESMTPSA id d65sm5977161pfa.45.2016.07.06.11.55.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jul 2016 11:55:05 -0700 (PDT) Received: from t430.minyard.net (unknown [IPv6:2001:470:b8f6:1b:a0bf:e25:5926:cd6b]) by serve.minyard.net (Postfix) with ESMTPA id 637736B7; Wed, 6 Jul 2016 13:55:04 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id 9E8673012B0; Wed, 6 Jul 2016 13:55:03 -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 v2] x86: Fix an RT MCE crash Date: Wed, 6 Jul 2016 13:55:01 -0500 Message-Id: <1467831301-17233-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. Signed-off-by: Corey Minyard --- arch/x86/kernel/cpu/mcheck/mce.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 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)