Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3552883ybl; Mon, 12 Aug 2019 02:23:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9IwOpNxc6QI/OGq9uXYvSzKpLM6NUyoU+BurbtRKeTGp1iq+oGQOecApXR2VBxLhFd6Sf X-Received: by 2002:a17:902:e282:: with SMTP id cf2mr32360295plb.301.1565601833156; Mon, 12 Aug 2019 02:23:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565601833; cv=none; d=google.com; s=arc-20160816; b=qVf6GPUfbDiSQOqETSWXq79OuQUQT5xyvlB3BgGu3j6MZP7ZqqzrcraB+w2WeBXOrw FemX3yl3lFo/wll9AragTsQ6eZX7hQPFgblTdkMfmCmQZjlo/m5+8y6zUFaKPH7QqlPE B/YSQUyY8CG7v+fz2hAFqodyAtq8uExVlNpkdpJAywjnT58JtEbGR9O8t9FcUfMiVltJ lQMiCgd1R26/v4istt10/lN0GVSlw91wYs2fZFiO35kYfZ6bnncnpUWJErZapnTjloh3 zJLATM1bJgvHu6apSTe0NNXnwSko6gPPNfnu1eCIjQGh7tQ5zLOoxM7GBkWOeI5dlmKK 98bw== 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=Xo5GxV2VUz5oUEAom/90QFb/1qeb/Ep256qNvcX0mNY=; b=hhBCAszKbYKAFz3Ru6m5xN25YviTtVkcJHKgYTCDi2koANIfzUR3eCm/KUHySLteZp bLcwushTXEX32aP96gswBV7I7wpm7YgBGo3dI34a5KX9pBpcAEWM/Oz6GLl/rA4WmeWA JEavvfIG/vyi8b7m/c9FXreUfRWsgdGHDXM+LboXRpwCMJayJLOBasYA8DP9oKZ3eAt4 UCC6QL9Ozf6MjisQR0S7/u7QrY6/I1RXLMAm8kaTut+msw7XlzZEVRUejsNspz6GiTYS ObF/SL9VRYbxEBNxTKOl7+RC4jKsncUOV9ZPJ23eDIKOVb4cS0ZeH3MGXV1X0c1THPbU BueA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fossix-org.20150623.gappssmtp.com header.s=20150623 header.b=qYKPu7dQ; 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 j14si69058001pgk.107.2019.08.12.02.23.37; Mon, 12 Aug 2019 02:23:53 -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=qYKPu7dQ; 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 S1727451AbfHLJW5 (ORCPT + 99 others); Mon, 12 Aug 2019 05:22:57 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:34395 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727371AbfHLJW4 (ORCPT ); Mon, 12 Aug 2019 05:22:56 -0400 Received: by mail-pl1-f196.google.com with SMTP id i2so47676895plt.1 for ; Mon, 12 Aug 2019 02:22:56 -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=Xo5GxV2VUz5oUEAom/90QFb/1qeb/Ep256qNvcX0mNY=; b=qYKPu7dQnJ+efxNuKAgOhhGHbAtOXZiq6e8QCQ68gncmUnNmf7V9YNSsDwdaNeQBPE xJmNTmwZKEylqy/Ylcwjisr3ExW+75yriMU6j0SKUI30CDpDMfXvTU4qt7TR3cu//PiM K6CZg2/N7KBO7pr4kvvBdYbVgRldlXRmV3gu6BcETBXEu7crWdPdZoYoXEnLP/4w19TM oCXBVrbx+xktP79mC8nCIBoOwhvxzSAvNmcOjQP0BJm0ZwoPT/qCNb2dtN5+BGfGvyzi vgEzaXHDCNKV1eajtKIwM1yUdNMUemKkeGsqIj9djgeTOWYPPi5bc0e0fb10VWJXq6Fs 1jKg== 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=Xo5GxV2VUz5oUEAom/90QFb/1qeb/Ep256qNvcX0mNY=; b=DOUnP5zs3niL/+ZRT+d+ql4Z9SJpNeO9uyVQFgaUAU5GWljtU8a5+TpDmGqxNqkWPL W8I+HjZj7j/uaxnH6TusZMPxxbkBFffNUSVjXmEBvUgsRtkFM7CwzlUSbxDLspjPbYUm 9RFOllUD68GYZ3PWsZ+lijLxhBE5eVSyvwG6zvSVuavawtu5Vs5MqqvRsI3WwM3KJVTy 8j09C15Ds1/N1s+xrIntBNtPPLaV1QvHaEsA5+5sqy9Oyv4+o/cdq05B+YmJsmiDUP1m O2Vhbo3ZXp60OSlj1wRpun/54Bcl5zUC/SPGzm8zwFUOw7cCYylFKjslmeaMATmcZlw2 HoPA== X-Gm-Message-State: APjAAAWDDqkFz73oC6jqdzzgpqrjAywkmW2pgyhdA69ZOUtxo+YbCh8H sCOPJ2gUNX3rvM3DzzSar2YLYw== X-Received: by 2002:a17:902:f81:: with SMTP id 1mr31777188plz.191.1565601775904; Mon, 12 Aug 2019 02:22:55 -0700 (PDT) Received: from santosiv.in.ibm.com ([129.41.84.75]) by smtp.gmail.com with ESMTPSA id y188sm10543517pfb.115.2019.08.12.02.22.52 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 02:22:55 -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 , Mahesh Salgaonkar , stable@vger.kernel.org Subject: [PATCH v9 1/7] powerpc/mce: Schedule work from irq_work Date: Mon, 12 Aug 2019 14:52:30 +0530 Message-Id: <20190812092236.16648-2-santosh@fossix.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190812092236.16648-1-santosh@fossix.org> References: <20190812092236.16648-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") Suggested-by: Mahesh Salgaonkar Signed-off-by: Santosh Sivaraj Cc: stable@vger.kernel.org # v4.15+ --- arch/powerpc/kernel/mce.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/mce.c b/arch/powerpc/kernel/mce.c index b18df633eae9..cff31d4a501f 100644 --- a/arch/powerpc/kernel/mce.c +++ b/arch/powerpc/kernel/mce.c @@ -33,6 +33,7 @@ static DEFINE_PER_CPU(struct machine_check_event[MAX_MC_EVT], mce_ue_event_queue); static void machine_check_process_queued_event(struct irq_work *work); +static void machine_check_ue_irq_work(struct irq_work *work); void machine_check_ue_event(struct machine_check_event *evt); static void machine_process_ue_event(struct work_struct *work); @@ -40,6 +41,10 @@ static struct irq_work mce_event_process_work = { .func = machine_check_process_queued_event, }; +static struct irq_work mce_ue_event_irq_work = { + .func = machine_check_ue_irq_work, +}; + DECLARE_WORK(mce_ue_event_work, machine_process_ue_event); static void mce_set_error_info(struct machine_check_event *mce, @@ -199,6 +204,10 @@ void release_mce_event(void) get_mce_event(NULL, true); } +static void machine_check_ue_irq_work(struct irq_work *work) +{ + schedule_work(&mce_ue_event_work); +} /* * Queue up the MCE event which then can be handled later. @@ -216,7 +225,7 @@ void machine_check_ue_event(struct machine_check_event *evt) memcpy(this_cpu_ptr(&mce_ue_event_queue[index]), evt, sizeof(*evt)); /* Queue work to process this event later. */ - schedule_work(&mce_ue_event_work); + irq_work_queue(&mce_ue_event_irq_work); } /* -- 2.21.0