Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5560301ybh; Wed, 7 Aug 2019 07:58:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzHbPRKR6ACtGakGUF8bKfry9l284ZWebFrcSgsbhK6Vk0I77uxboCd1OtsUTjqltAKBYc X-Received: by 2002:a17:90a:3247:: with SMTP id k65mr323825pjb.49.1565189894760; Wed, 07 Aug 2019 07:58:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565189894; cv=none; d=google.com; s=arc-20160816; b=OdthxH+MLMRKFYh3DtbYZnvCZabl8tt1TquEzDhEtkT7KCRbdsek7C+ertyqEK/fU+ Hd8Y3hptKdM9IsNeC2D91dqke+qrCHNcn/ip06lDqBjOxjEBJYsiHcrItqemZCEniN+N jB3svG/ltESAmfvCK/J50gp2CgV2rzRiwie1ho24uRqmayuCrSEE5DosuFtTURyhW6Kh fvEs03k5kf2Gw1ltbYo/RPSmUUsdOv7FixjLzlYFBmOvFsQDhrC7ursdTu4TyIfIcM/M Yy+VzntKkhOLHID9hQV1erWTf9LgvnE+cD090qkbK2pH4LQ0feMMmX9gHQf9X9ir1Jt5 pJmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wCmmwD53XttWvxo3IyfDIXHfbZJtgpbW8gfsweTknQc=; b=0KSgCht+qjIycUGUAFlIiW1BAtQvekgwc26X3MAu9dwtFDJRTuMuHAhT1Q309tpuxu kj3iZXIC0a8JrohwiAUdxOCrN57LbhlHACNZC4aDdxRQwIZ34M8WuXuoBGABC97O3Xyw wuOthoWLoL9JW8FJLezskst7jINNF0+ST5ubwNg8hEqVjWLssHlSaGHQ8k2qZtaksB1e +uAQfGTmQoRmNMpC3PUmdeBwf9hxE/5lGPD9jOEzn1T6PP88BmAcgm0EyUkgt4fh65p4 ufQ0aRTO/4GCZeaDXQni3pEAvWPazoQZY+jwmUMD1CBTOYHYjAUeC0Lk6djs0IyFNfEg /dUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fossix-org.20150623.gappssmtp.com header.s=20150623 header.b="uyB8j/ts"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si47749351pgv.541.2019.08.07.07.57.59; Wed, 07 Aug 2019 07:58:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fossix-org.20150623.gappssmtp.com header.s=20150623 header.b="uyB8j/ts"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730164AbfHGO5U (ORCPT + 99 others); Wed, 7 Aug 2019 10:57:20 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:33515 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729278AbfHGO5T (ORCPT ); Wed, 7 Aug 2019 10:57:19 -0400 Received: by mail-pl1-f195.google.com with SMTP id c14so41133770plo.0 for ; Wed, 07 Aug 2019 07:57:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fossix-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wCmmwD53XttWvxo3IyfDIXHfbZJtgpbW8gfsweTknQc=; b=uyB8j/tsSzit3NKNl6frCAIzbjxLYgwq157qH/us4cCgDbniSP8u0YjsXYJFHLRLJe XfAArNBgUVQvE9F/L3yxnLhUs+jDBwJewdRgiRoq0KXQ1XKO4hBB8nQnx8Iusd95byWx h+s9Vpqka6JyUtLZ3LQakBnx4JPY3m8jvwZjGe7md+PhukFp79FHDGnwagpY2RxrmHgX KIL8oO2iQY/6ZH1YjBncEqczITFPz19Zo+7qYfFremFmmV34WFndOv3MVCXi2noADWhJ A80O0zkkDUdRc70fXZD+GJ+7Z8SxTklgF9EvLamXOEETQl+13uVd5UokuifJUcqqLtta u9qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wCmmwD53XttWvxo3IyfDIXHfbZJtgpbW8gfsweTknQc=; b=flrXhxNx3zgrKLUG9/u/pgTXshloIrem7cnboNK+Ma7dsKbPNR0BZeHyrfBIvr9lOa PechSijimLt3Oj7ggoOE0OnD5pHlsKrdc6qtjXw30H9/5+xKGgAU7h9Wpi5GZxGY5aYE EB5RDYMPT+8hwFhxxEuqEVaEKAPL8kDucwQZ4Rt2pM/AfATI2KRKf8EazZXyK/QpR7q4 3S/6pDLz3vb0gtsNpPaBSkfGVX5bpGqXxL/zJgd/iLlcL5dWUzlrVMd8HZ6TlpY6mNWv nk1f6nu6O8H/5rljzF2Sf69tyzmyMMCV6mmVDtjjeT2eZFDlnfcXh8xlEITdvi4eS3rA /HQg== X-Gm-Message-State: APjAAAU4LYrXromXcbRUaZfmpnDJUL11Z1WcidnX/Rj35+sV6p9PfVtH AFzdvVg8I0aHpGPM0cFreYe/8Q== X-Received: by 2002:a63:e306:: with SMTP id f6mr7928966pgh.39.1565189838910; Wed, 07 Aug 2019 07:57:18 -0700 (PDT) Received: from santosiv.in.ibm.com.com ([183.82.17.96]) by smtp.gmail.com with ESMTPSA id l4sm93617475pff.50.2019.08.07.07.57.15 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 07 Aug 2019 07:57:18 -0700 (PDT) From: Santosh Sivaraj To: linuxppc-dev , Linux Kernel Cc: "Aneesh Kumar K.V" , Mahesh Salgaonkar , Reza Arbab , Balbir Singh , Chandan Rajendra , Michael Ellerman , Nicholas Piggin , christophe leroy Subject: [PATCH v8 1/7] powerpc/mce: Schedule work from irq_work Date: Wed, 7 Aug 2019 20:26:54 +0530 Message-Id: <20190807145700.25599-2-santosh@fossix.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190807145700.25599-1-santosh@fossix.org> References: <20190807145700.25599-1-santosh@fossix.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org schedule_work() cannot be called from MCE exception context as MCE can interrupt even in interrupt disabled context. fixes: 733e4a4c ("powerpc/mce: hookup memory_failure for UE errors") Signed-off-by: Santosh Sivaraj --- arch/powerpc/kernel/mce.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/mce.c b/arch/powerpc/kernel/mce.c index b18df633eae9..0ab6fa7cbbbb 100644 --- a/arch/powerpc/kernel/mce.c +++ b/arch/powerpc/kernel/mce.c @@ -144,7 +144,6 @@ void save_mce_event(struct pt_regs *regs, long handled, if (phys_addr != ULONG_MAX) { mce->u.ue_error.physical_address_provided = true; mce->u.ue_error.physical_address = phys_addr; - machine_check_ue_event(mce); } } return; @@ -275,8 +274,7 @@ static void machine_process_ue_event(struct work_struct *work) } } /* - * process pending MCE event from the mce event queue. This function will be - * called during syscall exit. + * process pending MCE event from the mce event queue. */ static void machine_check_process_queued_event(struct irq_work *work) { @@ -292,6 +290,10 @@ static void machine_check_process_queued_event(struct irq_work *work) while (__this_cpu_read(mce_queue_count) > 0) { index = __this_cpu_read(mce_queue_count) - 1; evt = this_cpu_ptr(&mce_event_queue[index]); + + if (evt->error_type == MCE_ERROR_TYPE_UE) + machine_check_ue_event(evt); + machine_check_print_event_info(evt, false, false); __this_cpu_dec(mce_queue_count); } -- 2.20.1