Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp874094iob; Thu, 28 Apr 2022 12:44:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsiNdR5d9UZCjqtXRLFfUZEmJ1iSVkfNLQM/aGMPT4k8LEE/A8A703QelF6fadxyHgT6FQ X-Received: by 2002:a2e:5407:0:b0:24f:64c:980c with SMTP id i7-20020a2e5407000000b0024f064c980cmr18393053ljb.163.1651175048065; Thu, 28 Apr 2022 12:44:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651175048; cv=none; d=google.com; s=arc-20160816; b=0VPIR0blcTSIetQHy1T67t5DnPm6rDxQ+tGikXdRF4TPFJP6R3FzUDrT2DgM974Q0o 1LCvLKHUS6fBAZCoBhjVes0o/mXBFtiYfNsZgSehacVdtlIbRAVzeNpwbtH0dYP6jH7N pgUPfe0NHigvjKieFB0i8IM+7T0ViOcdm+M4r1g3zt2jnz89/oaw2kbgJ7MnxNr73q4t hgzWpE88EfJhdAB50Ms7ZnnjgY5qpvGepU1xFgkIKFj/skDky8MHOqDR4sBixxowm3G9 p1PQl7MZ1o+wGbUIkSGE8IvYcpn3HHHtBxF/m+MYjddHHBRF+gQ2Qz/ytxkhdXqvXP3c 3RVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mOzFWStqo1l1SFAwioSEW9cov+DtDc5WSMbZaYL5OFk=; b=AKTAS+BNfmOiG179SF2tzIRUy9IVI8Hkly9f3J/I1ch6lv/q4smqDeylPagjaTKURw iho+De22g6LRTZDzIeHwjfTkQviueMW7qBrPqDM/D3dR0U4ToOmnXWwdz1tgCmuTx15l E5vVhcAqrkVPuiBZDCxuokkk9v9Q63iEt+Q/i7TmNzBb9N/HD+sTo6ktyTZuxqIw0xUg kXP3Hon9Qh+PDfyxiyqhMdvpHDa2yjwoLh5z128KZ3GcT8d5WI3hC5DAGnFxDUDqLO9u XXK2XkViQIW9C5+ikALNb85p09Pse/JmlpakTfa8JU+l7+9WGpEM5Tv/L7n8AFjgm5NW BMSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=jORyziNh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a2e8315000000b0024db3a872b5si4973836ljh.634.2022.04.28.12.43.40; Thu, 28 Apr 2022 12:44:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=jORyziNh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239048AbiD0W6Y (ORCPT + 99 others); Wed, 27 Apr 2022 18:58:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239159AbiD0W5t (ORCPT ); Wed, 27 Apr 2022 18:57:49 -0400 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B6558CCFB; Wed, 27 Apr 2022 15:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=mOzFWStqo1l1SFAwioSEW9cov+DtDc5WSMbZaYL5OFk=; b=jORyziNh7Mp7CJnb2ldBvIVUYT miqK/KwxTCDE0PrnGOVoO5V4xtjW+TEXZOKHxzyxZAzEuCslLE//gxMpeQbei+ydr8zg3pnWZUWxE L40pn68w+NUbAHLuqvLt2UI0hgcbpQZODu83KlzMI8qRKWoyX30oYob/b9pQLrf+6HFREi99ePbwb zW4TblodvYrIgJCYkkWUlwk3Cl/V3uSBOUWLD/GIZmkaB62kyu6wuslAaH0LxO2Qqyrw8rvwJQSXp vohmbyikfHUVSRBgOx4Bv9HUeJbAvmB/X4rw1kDURxjWp8eCgUztnLBZm1GN+7lilt+TPvGD7Gymp FQwd7uqA==; Received: from [179.113.53.197] (helo=localhost) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1njqXD-0002EK-E5; Thu, 28 Apr 2022 00:53:24 +0200 From: "Guilherme G. Piccoli" To: akpm@linux-foundation.org, bhe@redhat.com, pmladek@suse.com, kexec@lists.infradead.org Cc: linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, coresight@lists.linaro.org, linuxppc-dev@lists.ozlabs.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-leds@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-pm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-s390@vger.kernel.org, linux-tegra@vger.kernel.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, netdev@vger.kernel.org, openipmi-developer@lists.sourceforge.net, rcu@vger.kernel.org, sparclinux@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org, kernel-dev@igalia.com, gpiccoli@igalia.com, kernel@gpiccoli.net, halves@canonical.com, fabiomirmar@gmail.com, alejandro.j.jimenez@oracle.com, andriy.shevchenko@linux.intel.com, arnd@arndb.de, bp@alien8.de, corbet@lwn.net, d.hatayama@jp.fujitsu.com, dave.hansen@linux.intel.com, dyoung@redhat.com, feng.tang@intel.com, gregkh@linuxfoundation.org, mikelley@microsoft.com, hidehiro.kawai.ez@hitachi.com, jgross@suse.com, john.ogness@linutronix.de, keescook@chromium.org, luto@kernel.org, mhiramat@kernel.org, mingo@redhat.com, paulmck@kernel.org, peterz@infradead.org, rostedt@goodmis.org, senozhatsky@chromium.org, stern@rowland.harvard.edu, tglx@linutronix.de, vgoyal@redhat.com, vkuznets@redhat.com, will@kernel.org Subject: [PATCH 14/30] panic: Properly identify the panic event to the notifiers' callbacks Date: Wed, 27 Apr 2022 19:49:08 -0300 Message-Id: <20220427224924.592546-15-gpiccoli@igalia.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220427224924.592546-1-gpiccoli@igalia.com> References: <20220427224924.592546-1-gpiccoli@igalia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The notifiers infrastructure provides a way to pass an "id" to the callbacks to determine what kind of event happened, i.e., what is the reason behind they getting called. The panic notifier currently pass 0, but this is soon to be used in a multi-targeted notifier, so let's pass a meaningful "id" over there. Signed-off-by: Guilherme G. Piccoli --- include/linux/panic_notifier.h | 5 +++++ kernel/panic.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/panic_notifier.h b/include/linux/panic_notifier.h index 41e32483d7a7..07dced83a783 100644 --- a/include/linux/panic_notifier.h +++ b/include/linux/panic_notifier.h @@ -9,4 +9,9 @@ extern struct atomic_notifier_head panic_notifier_list; extern bool crash_kexec_post_notifiers; +enum panic_notifier_val { + PANIC_UNUSED, + PANIC_NOTIFIER = 0xDEAD, +}; + #endif /* _LINUX_PANIC_NOTIFIERS_H */ diff --git a/kernel/panic.c b/kernel/panic.c index eb4dfb932c85..523bc9ccd0e9 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -287,7 +287,7 @@ void panic(const char *fmt, ...) * Run any panic handlers, including those that might need to * add information to the kmsg dump output. */ - atomic_notifier_call_chain(&panic_notifier_list, 0, buf); + atomic_notifier_call_chain(&panic_notifier_list, PANIC_NOTIFIER, buf); panic_print_sys_info(false); -- 2.36.0