From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC5A7C32771 for ; Fri, 19 Aug 2022 22:21:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241349AbiHSWVR (ORCPT ); Fri, 19 Aug 2022 18:21:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241023AbiHSWVN (ORCPT ); Fri, 19 Aug 2022 18:21:13 -0400 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDE99108975; Fri, 19 Aug 2022 15:21:10 -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=w+V+d2Ou90II75S8tjeZPRXSUk1hOHxUHRxe/lCKYf8=; b=GcJDyWLUFBDhdhZRicD7s2hGOp JNq9aL5jXzUOnIeWtwVFCPgVcltgOhopGclsa1YufcOPLbtTcP52b96sRcg4Rr5NnLWUnqDdbBLRf NB6idHbm9fRY0m1Lf4ADFrv9tOw+wBEwSzawjHvCBKjAeiOSlrtuZFD2tfR6s3JAfm+lJDZx5WGTE B2t21P0zsAbg8Snpm8jCtem3l7gcR/0NlgfLESKnD/RfPAXhKLHmOYrtiI7YWJkYYWt0U30EqV8yO v9sbxOm+eq6ThJinbMItFxXhaYH3/0in9o9u5UM61ccxHNnKo/j827E6OHmdh6SjAp28YRHON5w1m ZCXcatNg==; Received: from [179.232.144.59] (helo=localhost) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1oPAMH-00Cazj-Pv; Sat, 20 Aug 2022 00:21:01 +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, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, x86@kernel.org, kernel-dev@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, xuqiang36@huawei.com, "Guilherme G. Piccoli" , linux-alpha@vger.kernel.org, Ivan Kokshaysky , Matt Turner , Richard Henderson Subject: [PATCH V3 03/11] alpha: Clean-up the panic notifier code Date: Fri, 19 Aug 2022 19:17:23 -0300 Message-Id: <20220819221731.480795-4-gpiccoli@igalia.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819221731.480795-1-gpiccoli@igalia.com> References: <20220819221731.480795-1-gpiccoli@igalia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The alpha panic notifier has some code issues, not following the conventions of other notifiers. Also, it might halt the machine but still it is set to run as early as possible, which doesn't seem to be a good idea. So, let's clean the code and set the notifier to run as the latest, following the same approach other architectures are doing - also, remove the unnecessary include of a header already included indirectly. Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Richard Henderson Reviewed-by: Petr Mladek Signed-off-by: Guilherme G. Piccoli --- V3: - No changes. V2: - Fixed rth email address; - Added Petr's review tag - thanks! arch/alpha/kernel/setup.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index b4fbbba30aa2..d88bdf852753 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c @@ -41,19 +41,11 @@ #include #include #endif -#include #include #include #include #include -static int alpha_panic_event(struct notifier_block *, unsigned long, void *); -static struct notifier_block alpha_panic_block = { - alpha_panic_event, - NULL, - INT_MAX /* try to do it first */ -}; - #include #include #include @@ -435,6 +427,21 @@ static const struct sysrq_key_op srm_sysrq_reboot_op = { }; #endif +static int alpha_panic_event(struct notifier_block *this, + unsigned long event, void *ptr) +{ + /* If we are using SRM and serial console, just hard halt here. */ + if (alpha_using_srm && srmcons_output) + __halt(); + + return NOTIFY_DONE; +} + +static struct notifier_block alpha_panic_block = { + .notifier_call = alpha_panic_event, + .priority = INT_MIN, /* may not return, do it last */ +}; + void __init setup_arch(char **cmdline_p) { @@ -1427,19 +1434,6 @@ const struct seq_operations cpuinfo_op = { .show = show_cpuinfo, }; - -static int -alpha_panic_event(struct notifier_block *this, unsigned long event, void *ptr) -{ -#if 1 - /* FIXME FIXME FIXME */ - /* If we are using SRM and serial console, just hard halt here. */ - if (alpha_using_srm && srmcons_output) - __halt(); -#endif - return NOTIFY_DONE; -} - static __init int add_pcspkr(void) { struct platform_device *pd; -- 2.37.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2E1A9C00140 for ; Wed, 24 Aug 2022 13:06:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gEVLX37HuXdRzhOZ80R+kmx+xhMDohwgXl46WK+SUdw=; b=ad5f+T1ilfG61J E0sakGFwXxcM100qtDgt7ZZNLb0RoHU+SsUOzvIarc285nqhyF9VUJpvuGwV33dx7+463JLsd9zpW bgfAtIvAl4pGYcNljwp71OcR2kTCuohKzkgFt1bEzCxQoYQyRO0LnrH3YCQAtfMJb8k/RBPnz81Cr QWwS2DRikzOrbKA1Fqldn1VgTfUiso3559fwywLWAx6eMT9wtHZpcuSvj1/5lJ227t84x8xJSFsN6 1jYiEOxFdLG3PCNiaXCBHTvYXZ3/ifb1oBhLtAHQ/wHMwHg8565BEDbPPQS8RE9i2osHoFFZKkptC JBZwKGzXQXQvfewdBBJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQq5B-00D5sS-A8; Wed, 24 Aug 2022 13:06:09 +0000 Received: from fanzine.igalia.com ([178.60.130.6] helo=fanzine2.igalia.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oPAMX-00CoAA-CA for kexec@lists.infradead.org; Fri, 19 Aug 2022 22:21:10 +0000 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=w+V+d2Ou90II75S8tjeZPRXSUk1hOHxUHRxe/lCKYf8=; b=GcJDyWLUFBDhdhZRicD7s2hGOp JNq9aL5jXzUOnIeWtwVFCPgVcltgOhopGclsa1YufcOPLbtTcP52b96sRcg4Rr5NnLWUnqDdbBLRf NB6idHbm9fRY0m1Lf4ADFrv9tOw+wBEwSzawjHvCBKjAeiOSlrtuZFD2tfR6s3JAfm+lJDZx5WGTE B2t21P0zsAbg8Snpm8jCtem3l7gcR/0NlgfLESKnD/RfPAXhKLHmOYrtiI7YWJkYYWt0U30EqV8yO v9sbxOm+eq6ThJinbMItFxXhaYH3/0in9o9u5UM61ccxHNnKo/j827E6OHmdh6SjAp28YRHON5w1m ZCXcatNg==; Received: from [179.232.144.59] (helo=localhost) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1oPAMH-00Cazj-Pv; Sat, 20 Aug 2022 00:21:01 +0200 From: "Guilherme G. Piccoli" To: akpm@linux-foundation.org, bhe@redhat.com, pmladek@suse.com, kexec@lists.infradead.org Subject: [PATCH V3 03/11] alpha: Clean-up the panic notifier code Date: Fri, 19 Aug 2022 19:17:23 -0300 Message-Id: <20220819221731.480795-4-gpiccoli@igalia.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819221731.480795-1-gpiccoli@igalia.com> References: <20220819221731.480795-1-gpiccoli@igalia.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220819_152109_437955_D2E131E3 X-CRM114-Status: GOOD ( 14.04 ) X-Mailman-Approved-At: Wed, 24 Aug 2022 06:05:59 -0700 X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-hyperv@vger.kernel.org, halves@canonical.com, peterz@infradead.org, dave.hansen@linux.intel.com, feng.tang@intel.com, mikelley@microsoft.com, will@kernel.org, Richard Henderson , arnd@arndb.de, corbet@lwn.net, paulmck@kernel.org, fabiomirmar@gmail.com, x86@kernel.org, mingo@redhat.com, stern@rowland.harvard.edu, Matt Turner , dyoung@redhat.com, vgoyal@redhat.com, alejandro.j.jimenez@oracle.com, keescook@chromium.org, john.ogness@linutronix.de, linux-alpha@vger.kernel.org, rostedt@goodmis.org, bp@alien8.de, luto@kernel.org, hidehiro.kawai.ez@hitachi.com, tglx@linutronix.de, andriy.shevchenko@linux.intel.com, jgross@suse.com, gregkh@linuxfoundation.org, kernel@gpiccoli.net, linux-kernel@vger.kernel.org, xuqiang36@huawei.com, senozhatsky@chromium.org, d.hatayama@jp.fujitsu.com, mhiramat@kernel.org, kernel-dev@igalia.com, netdev@vger.kernel.org, Ivan Kokshaysky , vkuznets@redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+kexec=archiver.kernel.org@lists.infradead.org The alpha panic notifier has some code issues, not following the conventions of other notifiers. Also, it might halt the machine but still it is set to run as early as possible, which doesn't seem to be a good idea. So, let's clean the code and set the notifier to run as the latest, following the same approach other architectures are doing - also, remove the unnecessary include of a header already included indirectly. Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Richard Henderson Reviewed-by: Petr Mladek Signed-off-by: Guilherme G. Piccoli --- V3: - No changes. V2: - Fixed rth email address; - Added Petr's review tag - thanks! arch/alpha/kernel/setup.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index b4fbbba30aa2..d88bdf852753 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c @@ -41,19 +41,11 @@ #include #include #endif -#include #include #include #include #include -static int alpha_panic_event(struct notifier_block *, unsigned long, void *); -static struct notifier_block alpha_panic_block = { - alpha_panic_event, - NULL, - INT_MAX /* try to do it first */ -}; - #include #include #include @@ -435,6 +427,21 @@ static const struct sysrq_key_op srm_sysrq_reboot_op = { }; #endif +static int alpha_panic_event(struct notifier_block *this, + unsigned long event, void *ptr) +{ + /* If we are using SRM and serial console, just hard halt here. */ + if (alpha_using_srm && srmcons_output) + __halt(); + + return NOTIFY_DONE; +} + +static struct notifier_block alpha_panic_block = { + .notifier_call = alpha_panic_event, + .priority = INT_MIN, /* may not return, do it last */ +}; + void __init setup_arch(char **cmdline_p) { @@ -1427,19 +1434,6 @@ const struct seq_operations cpuinfo_op = { .show = show_cpuinfo, }; - -static int -alpha_panic_event(struct notifier_block *this, unsigned long event, void *ptr) -{ -#if 1 - /* FIXME FIXME FIXME */ - /* If we are using SRM and serial console, just hard halt here. */ - if (alpha_using_srm && srmcons_output) - __halt(); -#endif - return NOTIFY_DONE; -} - static __init int add_pcspkr(void) { struct platform_device *pd; -- 2.37.2 _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Guilherme G. Piccoli" Subject: [PATCH V3 03/11] alpha: Clean-up the panic notifier code Date: Fri, 19 Aug 2022 19:17:23 -0300 Message-ID: <20220819221731.480795-4-gpiccoli@igalia.com> References: <20220819221731.480795-1-gpiccoli@igalia.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: 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=w+V+d2Ou90II75S8tjeZPRXSUk1hOHxUHRxe/lCKYf8=; b=GcJDyWLUFBDhdhZRicD7s2hGOp JNq9aL5jXzUOnIeWtwVFCPgVcltgOhopGclsa1YufcOPLbtTcP52b96sRcg4Rr5NnLWUnqDdbBLRf NB6idHbm9fRY0m1Lf4ADFrv9tOw+wBEwSzawjHvCBKjAeiOSlrtuZFD2tfR6s3JAfm+lJDZx5WGTE B2t21P0zsAbg8Snpm8jCtem3l7gcR/0NlgfLESKnD/RfPAXhKLHmOYrtiI7YWJkYYWt0U30EqV8yO v9sbxOm+eq6ThJinbMItFxXhaYH3/0in9o9u5UM61ccxHNnKo/j827E6OHmdh6SjAp28YRHON5w1m ZCXcatN In-Reply-To: <20220819221731.480795-1-gpiccoli@igalia.com> List-ID: Content-Type: text/plain; charset="us-ascii" To: akpm@linux-foundation.org, bhe@redhat.com, pmladek@suse.com, kexec@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, x86@kernel.org, kernel-dev@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.o The alpha panic notifier has some code issues, not following the conventions of other notifiers. Also, it might halt the machine but still it is set to run as early as possible, which doesn't seem to be a good idea. So, let's clean the code and set the notifier to run as the latest, following the same approach other architectures are doing - also, remove the unnecessary include of a header already included indirectly. Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Richard Henderson Reviewed-by: Petr Mladek Signed-off-by: Guilherme G. Piccoli --- V3: - No changes. V2: - Fixed rth email address; - Added Petr's review tag - thanks! arch/alpha/kernel/setup.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index b4fbbba30aa2..d88bdf852753 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c @@ -41,19 +41,11 @@ #include #include #endif -#include #include #include #include #include -static int alpha_panic_event(struct notifier_block *, unsigned long, void *); -static struct notifier_block alpha_panic_block = { - alpha_panic_event, - NULL, - INT_MAX /* try to do it first */ -}; - #include #include #include @@ -435,6 +427,21 @@ static const struct sysrq_key_op srm_sysrq_reboot_op = { }; #endif +static int alpha_panic_event(struct notifier_block *this, + unsigned long event, void *ptr) +{ + /* If we are using SRM and serial console, just hard halt here. */ + if (alpha_using_srm && srmcons_output) + __halt(); + + return NOTIFY_DONE; +} + +static struct notifier_block alpha_panic_block = { + .notifier_call = alpha_panic_event, + .priority = INT_MIN, /* may not return, do it last */ +}; + void __init setup_arch(char **cmdline_p) { @@ -1427,19 +1434,6 @@ const struct seq_operations cpuinfo_op = { .show = show_cpuinfo, }; - -static int -alpha_panic_event(struct notifier_block *this, unsigned long event, void *ptr) -{ -#if 1 - /* FIXME FIXME FIXME */ - /* If we are using SRM and serial console, just hard halt here. */ - if (alpha_using_srm && srmcons_output) - __halt(); -#endif - return NOTIFY_DONE; -} - static __init int add_pcspkr(void) { struct platform_device *pd; -- 2.37.2