Re: [PATCH V3 03/11] alpha: Clean-up the panic notifier code

2022-11-22 Thread Guilherme G. Piccoli
On 19/08/2022 19:17, Guilherme G. Piccoli wrote:
> 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!
> 

Hi Alpha maintainers, is there anything else to be done here? I'd really
appreciate any advice on how to get this merged.

I'm also adding here Richard's linaro email (and trimming huge CC list).

Thanks in advance!
Cheers,


Guilherme

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


[PATCH V3 03/11] alpha: Clean-up the panic notifier code

2022-08-24 Thread Guilherme G. Piccoli
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