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 406BBC4167D for ; Mon, 16 May 2022 14:33:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244569AbiEPOdp (ORCPT ); Mon, 16 May 2022 10:33:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231847AbiEPOdo (ORCPT ); Mon, 16 May 2022 10:33:44 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B2482AF8; Mon, 16 May 2022 07:33:43 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id C33171F9F3; Mon, 16 May 2022 14:33:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1652711621; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fVjlG4/dfH2RJ8QOIc+qrGCmgCcjOpZB+KPjtLQbhUo=; b=g7zXCdiW66+ZORh6/+b42qlwXs71YIm78eBo2DkB+6yci0VblhfjN32vYqq5tvyFP+a35V 4IQbZk+eZ8m4N7dIzfRZvRcjGflhdk2pzgpwxTPHHTNBIE+W9GZV3Zj3ggNIRkQibkb0ZX yDFspItfCnZ03JfIlqNkkDR8LZU/GbA= Received: from suse.cz (unknown [10.100.201.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 5E6F32C141; Mon, 16 May 2022 14:33:41 +0000 (UTC) Date: Mon, 16 May 2022 16:33:41 +0200 From: Petr Mladek To: "Guilherme G. Piccoli" Cc: akpm@linux-foundation.org, bhe@redhat.com, kexec@lists.infradead.org, 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, 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, Alex Elder , Alexander Gordeev , Anton Ivanov , Benjamin Herrenschmidt , Bjorn Andersson , Boris Ostrovsky , Chris Zankel , Christian Borntraeger , Corey Minyard , Dexuan Cui , "H. Peter Anvin" , Haiyang Zhang , Heiko Carstens , Helge Deller , Ivan Kokshaysky , "James E.J. Bottomley" , James Morse , Johannes Berg , "K. Y. Srinivasan" , Mathieu Poirier , Matt Turner , Mauro Carvalho Chehab , Max Filippov , Michael Ellerman , Paul Mackerras , Pavel Machek , Richard Weinberger , Robert Richter , Stefano Stabellini , Stephen Hemminger , Sven Schnelle , Tony Luck , Vasily Gorbik , Wei Liu Subject: Re: [PATCH 21/30] panic: Introduce the panic pre-reboot notifier list Message-ID: References: <20220427224924.592546-1-gpiccoli@igalia.com> <20220427224924.592546-22-gpiccoli@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220427224924.592546-22-gpiccoli@igalia.com> Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org On Wed 2022-04-27 19:49:15, Guilherme G. Piccoli wrote: > This patch renames the panic_notifier_list to panic_pre_reboot_list; > the idea is that a subsequent patch will refactor the panic path > in order to better split the notifiers, running some of them very > early, some of them not so early [but still before kmsg_dump()] and > finally, the rest should execute late, after kdump. The latter ones > are now in the panic pre-reboot list - the name comes from the idea > that these notifiers execute before panic() attempts rebooting the > machine (if that option is set). > > We also took the opportunity to clean-up useless header inclusions, > improve some notifier block declarations (e.g. in ibmasm/heartbeat.c) > and more important, change some priorities - we hereby set 2 notifiers > to run late in the list [iss_panic_event() and the IPMI panic_event()] > due to the risks they offer (may not return, for example). > Proper documentation is going to be provided in a subsequent patch, > that effectively refactors the panic path. > > --- a/drivers/edac/altera_edac.c > +++ b/drivers/edac/altera_edac.c > @@ -2163,7 +2162,7 @@ static int altr_edac_a10_probe(struct platform_device *pdev) > int dberror, err_addr; > > edac->panic_notifier.notifier_call = s10_edac_dberr_handler; > - atomic_notifier_chain_register(&panic_notifier_list, > + atomic_notifier_chain_register(&panic_pre_reboot_list, My understanding is that this notifier first prints info about ECC errors and then triggers reboot. It might make sense to split it into two notifiers. > &edac->panic_notifier); > > /* Printout a message if uncorrectable error previously. */ > --- a/drivers/leds/trigger/ledtrig-panic.c > +++ b/drivers/leds/trigger/ledtrig-panic.c > @@ -64,7 +63,7 @@ static long led_panic_blink(int state) > > static int __init ledtrig_panic_init(void) > { > - atomic_notifier_chain_register(&panic_notifier_list, > + atomic_notifier_chain_register(&panic_pre_reboot_list, > &led_trigger_panic_nb); Blinking => should go to the last "post_reboot/loop" list. > > led_trigger_register_simple("panic", &trigger); > --- a/drivers/misc/ibmasm/heartbeat.c > +++ b/drivers/misc/ibmasm/heartbeat.c > @@ -32,20 +31,23 @@ static int suspend_heartbeats = 0; > static int panic_happened(struct notifier_block *n, unsigned long val, void *v) > { > suspend_heartbeats = 1; > - return 0; > + return NOTIFY_DONE; > } > > -static struct notifier_block panic_notifier = { panic_happened, NULL, 1 }; > +static struct notifier_block panic_notifier = { > + .notifier_call = panic_happened, > +}; > > void ibmasm_register_panic_notifier(void) > { > - atomic_notifier_chain_register(&panic_notifier_list, &panic_notifier); > + atomic_notifier_chain_register(&panic_pre_reboot_list, > + &panic_notifier); Same here. Blinking => should go to the last "post_reboot/loop" list. > } > > void ibmasm_unregister_panic_notifier(void) > { > - atomic_notifier_chain_unregister(&panic_notifier_list, > - &panic_notifier); > + atomic_notifier_chain_unregister(&panic_pre_reboot_list, > + &panic_notifier); > } The rest of the moved notifiers seem to fit well this "pre_reboot" list. Best Regards, Petr 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 299A0C433F5 for ; Mon, 16 May 2022 21:42:58 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4L2CR44zq3z3dPm for ; Tue, 17 May 2022 07:42:56 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=g7zXCdiW; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=suse.com (client-ip=195.135.220.29; helo=smtp-out2.suse.de; envelope-from=pmladek@suse.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=g7zXCdiW; dkim-atps=neutral Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4L21vs6v1Jz3bw6 for ; Tue, 17 May 2022 00:33:44 +1000 (AEST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id C33171F9F3; Mon, 16 May 2022 14:33:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1652711621; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fVjlG4/dfH2RJ8QOIc+qrGCmgCcjOpZB+KPjtLQbhUo=; b=g7zXCdiW66+ZORh6/+b42qlwXs71YIm78eBo2DkB+6yci0VblhfjN32vYqq5tvyFP+a35V 4IQbZk+eZ8m4N7dIzfRZvRcjGflhdk2pzgpwxTPHHTNBIE+W9GZV3Zj3ggNIRkQibkb0ZX yDFspItfCnZ03JfIlqNkkDR8LZU/GbA= Received: from suse.cz (unknown [10.100.201.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 5E6F32C141; Mon, 16 May 2022 14:33:41 +0000 (UTC) Date: Mon, 16 May 2022 16:33:41 +0200 From: Petr Mladek To: "Guilherme G. Piccoli" Subject: Re: [PATCH 21/30] panic: Introduce the panic pre-reboot notifier list Message-ID: References: <20220427224924.592546-1-gpiccoli@igalia.com> <20220427224924.592546-22-gpiccoli@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220427224924.592546-22-gpiccoli@igalia.com> X-Mailman-Approved-At: Tue, 17 May 2022 07:40:39 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Mackerras , Pavel Machek , Alexander Gordeev , "K. Y. Srinivasan" , Wei Liu , stern@rowland.harvard.edu, xen-devel@lists.xenproject.org, Matt Turner , Christian Borntraeger , linux-pm@vger.kernel.org, linux-um@lists.infradead.org, luto@kernel.org, tglx@linutronix.de, Alex Elder , gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, senozhatsky@chromium.org, d.hatayama@jp.fujitsu.com, Bjorn Andersson , mhiramat@kernel.org, akpm@linux-foundation.org, linux-hyperv@vger.kernel.org, dave.hansen@linux.intel.com, "James E.J. Bottomley" , Max Filippov , linux-s390@vger.kernel.org, Stefano Stabellini , Stephen Hemminger , Corey Minyard , Helge Deller , vgoyal@redhat.com, Sven Schnelle , Vasily Gorbik , linux-xtensa@linux-xtensa.org, john.ogness@linutronix.de, coresight@lists.linaro.org, hidehiro.kawai.ez@hitachi.com, Boris Ostrovsky , linux-arm-kernel@lists.infradead.org, Chris Zankel , Tony Luck , Mathieu Poirier , James Morse , kernel-dev@igalia.com, fabiomirmar@gmail.com, halves@canonical.com, alejandro.j.jimenez@oracle.com, feng.tang@intel.com, will@kernel.org, bhe@redhat.com, corbet@lwn.net, Dexuan Cui , bcm-kernel-feedback-list@broadcom.com, Robert Richter , keescook@chromium.org, arnd@arndb.de, Haiyang Zhang , rostedt@goodmis.org, rcu@vger.kernel.org, bp@alien8.de, openipmi-developer@lists.sourceforge.net, Mauro Carvalho Chehab , linux-parisc@vger.kernel.org, linux-alpha@vger.kernel.org, peterz@infradead.org, linux-remoteproc@vger.kernel.org, mikelley@microsoft.com, "H. Peter Anvin" , sparclinux@vger.kernel.org, linux-leds@vger.kernel.org, Anton Ivanov , Richard Weinberger , x86@kernel.org, mingo@redhat.com, dyoung@redhat.com, paulmck@kernel.org, Heiko Carstens , linux-tegra@vger.kernel.org, andriy.shevchenko@linux.intel.com, Johannes Berg , linux-edac@vger.kernel.org, jgross@suse.com, netdev@vger.kernel.org, kernel@gpiccoli.net, kexec@lists.infradead.org, linux-mips@vger.kernel.org, Ivan Kokshaysky , vkuznets@redhat.com, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed 2022-04-27 19:49:15, Guilherme G. Piccoli wrote: > This patch renames the panic_notifier_list to panic_pre_reboot_list; > the idea is that a subsequent patch will refactor the panic path > in order to better split the notifiers, running some of them very > early, some of them not so early [but still before kmsg_dump()] and > finally, the rest should execute late, after kdump. The latter ones > are now in the panic pre-reboot list - the name comes from the idea > that these notifiers execute before panic() attempts rebooting the > machine (if that option is set). > > We also took the opportunity to clean-up useless header inclusions, > improve some notifier block declarations (e.g. in ibmasm/heartbeat.c) > and more important, change some priorities - we hereby set 2 notifiers > to run late in the list [iss_panic_event() and the IPMI panic_event()] > due to the risks they offer (may not return, for example). > Proper documentation is going to be provided in a subsequent patch, > that effectively refactors the panic path. > > --- a/drivers/edac/altera_edac.c > +++ b/drivers/edac/altera_edac.c > @@ -2163,7 +2162,7 @@ static int altr_edac_a10_probe(struct platform_device *pdev) > int dberror, err_addr; > > edac->panic_notifier.notifier_call = s10_edac_dberr_handler; > - atomic_notifier_chain_register(&panic_notifier_list, > + atomic_notifier_chain_register(&panic_pre_reboot_list, My understanding is that this notifier first prints info about ECC errors and then triggers reboot. It might make sense to split it into two notifiers. > &edac->panic_notifier); > > /* Printout a message if uncorrectable error previously. */ > --- a/drivers/leds/trigger/ledtrig-panic.c > +++ b/drivers/leds/trigger/ledtrig-panic.c > @@ -64,7 +63,7 @@ static long led_panic_blink(int state) > > static int __init ledtrig_panic_init(void) > { > - atomic_notifier_chain_register(&panic_notifier_list, > + atomic_notifier_chain_register(&panic_pre_reboot_list, > &led_trigger_panic_nb); Blinking => should go to the last "post_reboot/loop" list. > > led_trigger_register_simple("panic", &trigger); > --- a/drivers/misc/ibmasm/heartbeat.c > +++ b/drivers/misc/ibmasm/heartbeat.c > @@ -32,20 +31,23 @@ static int suspend_heartbeats = 0; > static int panic_happened(struct notifier_block *n, unsigned long val, void *v) > { > suspend_heartbeats = 1; > - return 0; > + return NOTIFY_DONE; > } > > -static struct notifier_block panic_notifier = { panic_happened, NULL, 1 }; > +static struct notifier_block panic_notifier = { > + .notifier_call = panic_happened, > +}; > > void ibmasm_register_panic_notifier(void) > { > - atomic_notifier_chain_register(&panic_notifier_list, &panic_notifier); > + atomic_notifier_chain_register(&panic_pre_reboot_list, > + &panic_notifier); Same here. Blinking => should go to the last "post_reboot/loop" list. > } > > void ibmasm_unregister_panic_notifier(void) > { > - atomic_notifier_chain_unregister(&panic_notifier_list, > - &panic_notifier); > + atomic_notifier_chain_unregister(&panic_pre_reboot_list, > + &panic_notifier); > } The rest of the moved notifiers seem to fit well this "pre_reboot" list. Best Regards, Petr From mboxrd@z Thu Jan 1 00:00:00 1970 From: Petr Mladek Date: Mon, 16 May 2022 16:33:41 +0200 Subject: [PATCH 21/30] panic: Introduce the panic pre-reboot notifier list In-Reply-To: <20220427224924.592546-22-gpiccoli@igalia.com> References: <20220427224924.592546-1-gpiccoli@igalia.com> <20220427224924.592546-22-gpiccoli@igalia.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kexec@lists.infradead.org On Wed 2022-04-27 19:49:15, Guilherme G. Piccoli wrote: > This patch renames the panic_notifier_list to panic_pre_reboot_list; > the idea is that a subsequent patch will refactor the panic path > in order to better split the notifiers, running some of them very > early, some of them not so early [but still before kmsg_dump()] and > finally, the rest should execute late, after kdump. The latter ones > are now in the panic pre-reboot list - the name comes from the idea > that these notifiers execute before panic() attempts rebooting the > machine (if that option is set). > > We also took the opportunity to clean-up useless header inclusions, > improve some notifier block declarations (e.g. in ibmasm/heartbeat.c) > and more important, change some priorities - we hereby set 2 notifiers > to run late in the list [iss_panic_event() and the IPMI panic_event()] > due to the risks they offer (may not return, for example). > Proper documentation is going to be provided in a subsequent patch, > that effectively refactors the panic path. > > --- a/drivers/edac/altera_edac.c > +++ b/drivers/edac/altera_edac.c > @@ -2163,7 +2162,7 @@ static int altr_edac_a10_probe(struct platform_device *pdev) > int dberror, err_addr; > > edac->panic_notifier.notifier_call = s10_edac_dberr_handler; > - atomic_notifier_chain_register(&panic_notifier_list, > + atomic_notifier_chain_register(&panic_pre_reboot_list, My understanding is that this notifier first prints info about ECC errors and then triggers reboot. It might make sense to split it into two notifiers. > &edac->panic_notifier); > > /* Printout a message if uncorrectable error previously. */ > --- a/drivers/leds/trigger/ledtrig-panic.c > +++ b/drivers/leds/trigger/ledtrig-panic.c > @@ -64,7 +63,7 @@ static long led_panic_blink(int state) > > static int __init ledtrig_panic_init(void) > { > - atomic_notifier_chain_register(&panic_notifier_list, > + atomic_notifier_chain_register(&panic_pre_reboot_list, > &led_trigger_panic_nb); Blinking => should go to the last "post_reboot/loop" list. > > led_trigger_register_simple("panic", &trigger); > --- a/drivers/misc/ibmasm/heartbeat.c > +++ b/drivers/misc/ibmasm/heartbeat.c > @@ -32,20 +31,23 @@ static int suspend_heartbeats = 0; > static int panic_happened(struct notifier_block *n, unsigned long val, void *v) > { > suspend_heartbeats = 1; > - return 0; > + return NOTIFY_DONE; > } > > -static struct notifier_block panic_notifier = { panic_happened, NULL, 1 }; > +static struct notifier_block panic_notifier = { > + .notifier_call = panic_happened, > +}; > > void ibmasm_register_panic_notifier(void) > { > - atomic_notifier_chain_register(&panic_notifier_list, &panic_notifier); > + atomic_notifier_chain_register(&panic_pre_reboot_list, > + &panic_notifier); Same here. Blinking => should go to the last "post_reboot/loop" list. > } > > void ibmasm_unregister_panic_notifier(void) > { > - atomic_notifier_chain_unregister(&panic_notifier_list, > - &panic_notifier); > + atomic_notifier_chain_unregister(&panic_pre_reboot_list, > + &panic_notifier); > } The rest of the moved notifiers seem to fit well this "pre_reboot" list. Best Regards, Petr From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 16 May 2022 16:33:41 +0200 From: Petr Mladek Subject: Re: [PATCH 21/30] panic: Introduce the panic pre-reboot notifier list Message-ID: References: <20220427224924.592546-1-gpiccoli@igalia.com> <20220427224924.592546-22-gpiccoli@igalia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220427224924.592546-22-gpiccoli@igalia.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: "Guilherme G. Piccoli" Cc: akpm@linux-foundation.org, bhe@redhat.com, kexec@lists.infradead.org, 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, 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, Alex Elder , Alexander Gordeev , Anton Ivanov , Benjamin Herrenschmidt , Bjorn Andersson , Boris Ostrovsky , Chris Zankel , Christian Borntraeger , Corey Minyard , Dexuan Cui , "H. Peter Anvin" , Haiyang Zhang , Heiko Carstens , Helge Deller , Ivan Kokshaysky , "James E.J. Bottomley" , James Morse , Johannes Berg , "K. Y. Srinivasan" , Mathieu Poirier , Matt Turner , Mauro Carvalho Chehab , Max Filippov , Michael Ellerman , Paul Mackerras , Pavel Machek , Richard Weinberger , Robert Richter , Stefano Stabellini , Stephen Hemminger , Sven Schnelle , Tony Luck , Vasily Gorbik , Wei Liu On Wed 2022-04-27 19:49:15, Guilherme G. Piccoli wrote: > This patch renames the panic_notifier_list to panic_pre_reboot_list; > the idea is that a subsequent patch will refactor the panic path > in order to better split the notifiers, running some of them very > early, some of them not so early [but still before kmsg_dump()] and > finally, the rest should execute late, after kdump. The latter ones > are now in the panic pre-reboot list - the name comes from the idea > that these notifiers execute before panic() attempts rebooting the > machine (if that option is set). > > We also took the opportunity to clean-up useless header inclusions, > improve some notifier block declarations (e.g. in ibmasm/heartbeat.c) > and more important, change some priorities - we hereby set 2 notifiers > to run late in the list [iss_panic_event() and the IPMI panic_event()] > due to the risks they offer (may not return, for example). > Proper documentation is going to be provided in a subsequent patch, > that effectively refactors the panic path. > > --- a/drivers/edac/altera_edac.c > +++ b/drivers/edac/altera_edac.c > @@ -2163,7 +2162,7 @@ static int altr_edac_a10_probe(struct platform_device *pdev) > int dberror, err_addr; > > edac->panic_notifier.notifier_call = s10_edac_dberr_handler; > - atomic_notifier_chain_register(&panic_notifier_list, > + atomic_notifier_chain_register(&panic_pre_reboot_list, My understanding is that this notifier first prints info about ECC errors and then triggers reboot. It might make sense to split it into two notifiers. > &edac->panic_notifier); > > /* Printout a message if uncorrectable error previously. */ > --- a/drivers/leds/trigger/ledtrig-panic.c > +++ b/drivers/leds/trigger/ledtrig-panic.c > @@ -64,7 +63,7 @@ static long led_panic_blink(int state) > > static int __init ledtrig_panic_init(void) > { > - atomic_notifier_chain_register(&panic_notifier_list, > + atomic_notifier_chain_register(&panic_pre_reboot_list, > &led_trigger_panic_nb); Blinking => should go to the last "post_reboot/loop" list. > > led_trigger_register_simple("panic", &trigger); > --- a/drivers/misc/ibmasm/heartbeat.c > +++ b/drivers/misc/ibmasm/heartbeat.c > @@ -32,20 +31,23 @@ static int suspend_heartbeats = 0; > static int panic_happened(struct notifier_block *n, unsigned long val, void *v) > { > suspend_heartbeats = 1; > - return 0; > + return NOTIFY_DONE; > } > > -static struct notifier_block panic_notifier = { panic_happened, NULL, 1 }; > +static struct notifier_block panic_notifier = { > + .notifier_call = panic_happened, > +}; > > void ibmasm_register_panic_notifier(void) > { > - atomic_notifier_chain_register(&panic_notifier_list, &panic_notifier); > + atomic_notifier_chain_register(&panic_pre_reboot_list, > + &panic_notifier); Same here. Blinking => should go to the last "post_reboot/loop" list. > } > > void ibmasm_unregister_panic_notifier(void) > { > - atomic_notifier_chain_unregister(&panic_notifier_list, > - &panic_notifier); > + atomic_notifier_chain_unregister(&panic_pre_reboot_list, > + &panic_notifier); > } The rest of the moved notifiers seem to fit well this "pre_reboot" list. Best Regards, Petr _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um From mboxrd@z Thu Jan 1 00:00:00 1970 From: Petr Mladek Subject: Re: [PATCH 21/30] panic: Introduce the panic pre-reboot notifier list Date: Mon, 16 May 2022 16:33:41 +0200 Message-ID: References: <20220427224924.592546-1-gpiccoli@igalia.com> <20220427224924.592546-22-gpiccoli@igalia.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1652711621; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fVjlG4/dfH2RJ8QOIc+qrGCmgCcjOpZB+KPjtLQbhUo=; b=g7zXCdiW66+ZORh6/+b42qlwXs71YIm78eBo2DkB+6yci0VblhfjN32vYqq5tvyFP+a35V 4IQbZk+eZ8m4N7dIzfRZvRcjGflhdk2pzgpwxTPHHTNBIE+W9GZV3Zj3ggNIRkQibkb0ZX yDFspItfCnZ03JfIlqNkkDR8LZU/GbA= Content-Disposition: inline In-Reply-To: <20220427224924.592546-22-gpiccoli-wEGTBA9jqPzQT0dZR+AlfA@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "Guilherme G. Piccoli" Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org, coresight-cunTk1MwBs8s++Sfvej+rw@public.gmane.org, linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-alpha-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-edac-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-hyperv-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mips-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-parisc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-remoteproc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-s390-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-um-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-xtensa-PjhNF2WwrV/0Sa2dR60CXw@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, openipmi-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, rcu-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, sparclinux-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, xen-devel-GuqFBffKawtpuQazS67q72D2FQJk+8+b@public.gmane.org, x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, kernel-dev-wEGTBA9jqPzQT0dZR+AlfA@public.gmane.org, kernel-WeLdAqEWwDvk1uMJSBkQmQ@public.gmane.org On Wed 2022-04-27 19:49:15, Guilherme G. Piccoli wrote: > This patch renames the panic_notifier_list to panic_pre_reboot_list; > the idea is that a subsequent patch will refactor the panic path > in order to better split the notifiers, running some of them very > early, some of them not so early [but still before kmsg_dump()] and > finally, the rest should execute late, after kdump. The latter ones > are now in the panic pre-reboot list - the name comes from the idea > that these notifiers execute before panic() attempts rebooting the > machine (if that option is set). > > We also took the opportunity to clean-up useless header inclusions, > improve some notifier block declarations (e.g. in ibmasm/heartbeat.c) > and more important, change some priorities - we hereby set 2 notifiers > to run late in the list [iss_panic_event() and the IPMI panic_event()] > due to the risks they offer (may not return, for example). > Proper documentation is going to be provided in a subsequent patch, > that effectively refactors the panic path. > > --- a/drivers/edac/altera_edac.c > +++ b/drivers/edac/altera_edac.c > @@ -2163,7 +2162,7 @@ static int altr_edac_a10_probe(struct platform_device *pdev) > int dberror, err_addr; > > edac->panic_notifier.notifier_call = s10_edac_dberr_handler; > - atomic_notifier_chain_register(&panic_notifier_list, > + atomic_notifier_chain_register(&panic_pre_reboot_list, My understanding is that this notifier first prints info about ECC errors and then triggers reboot. It might make sense to split it into two notifiers. > &edac->panic_notifier); > > /* Printout a message if uncorrectable error previously. */ > --- a/drivers/leds/trigger/ledtrig-panic.c > +++ b/drivers/leds/trigger/ledtrig-panic.c > @@ -64,7 +63,7 @@ static long led_panic_blink(int state) > > static int __init ledtrig_panic_init(void) > { > - atomic_notifier_chain_register(&panic_notifier_list, > + atomic_notifier_chain_register(&panic_pre_reboot_list, > &led_trigger_panic_nb); Blinking => should go to the last "post_reboot/loop" list. > > led_trigger_register_simple("panic", &trigger); > --- a/drivers/misc/ibmasm/heartbeat.c > +++ b/drivers/misc/ibmasm/heartbeat.c > @@ -32,20 +31,23 @@ static int suspend_heartbeats = 0; > static int panic_happened(struct notifier_block *n, unsigned long val, void *v) > { > suspend_heartbeats = 1; > - return 0; > + return NOTIFY_DONE; > } > > -static struct notifier_block panic_notifier = { panic_happened, NULL, 1 }; > +static struct notifier_block panic_notifier = { > + .notifier_call = panic_happened, > +}; > > void ibmasm_register_panic_notifier(void) > { > - atomic_notifier_chain_register(&panic_notifier_list, &panic_notifier); > + atomic_notifier_chain_register(&panic_pre_reboot_list, > + &panic_notifier); Same here. Blinking => should go to the last "post_reboot/loop" list. > } > > void ibmasm_unregister_panic_notifier(void) > { > - atomic_notifier_chain_unregister(&panic_notifier_list, > - &panic_notifier); > + atomic_notifier_chain_unregister(&panic_pre_reboot_list, > + &panic_notifier); > } The rest of the moved notifiers seem to fit well this "pre_reboot" list. Best Regards, Petr