* [PATCH v4] alpha: Clean-up the panic notifier code
@ 2023-02-20 21:22 Guilherme G. Piccoli
2023-03-13 20:18 ` Guilherme G. Piccoli
0 siblings, 1 reply; 4+ messages in thread
From: Guilherme G. Piccoli @ 2023-02-20 21:22 UTC (permalink / raw)
To: linux-alpha
Cc: linux-kernel, kernel-dev, kernel, Guilherme G. Piccoli,
Ivan Kokshaysky, Matt Turner, Richard Henderson, Petr Mladek
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 <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
---
V4:
- Rebased (and build-tested) against v6.2.
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 33bf3a627002..1eb67a67823f 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -41,19 +41,11 @@
#include <linux/sysrq.h>
#include <linux/reboot.h>
#endif
-#include <linux/notifier.h>
#include <asm/setup.h>
#include <asm/io.h>
#include <linux/log2.h>
#include <linux/export.h>
-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 <linux/uaccess.h>
#include <asm/hwrpb.h>
#include <asm/dma.h>
@@ -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.39.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v4] alpha: Clean-up the panic notifier code
2023-02-20 21:22 [PATCH v4] alpha: Clean-up the panic notifier code Guilherme G. Piccoli
@ 2023-03-13 20:18 ` Guilherme G. Piccoli
2023-03-13 20:39 ` Matt Turner
0 siblings, 1 reply; 4+ messages in thread
From: Guilherme G. Piccoli @ 2023-03-13 20:18 UTC (permalink / raw)
To: linux-alpha, Matt Turner, Richard Henderson, Ivan Kokshaysky
Cc: linux-kernel, kernel-dev, kernel, Petr Mladek
On 20/02/2023 18:22, 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 <ink@jurassic.park.msu.ru>
> Cc: Matt Turner <mattst88@gmail.com>
> Cc: Richard Henderson <richard.henderson@linaro.org>
> Reviewed-by: Petr Mladek <pmladek@suse.com>
> Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
>
> ---
>
>
> V4:
> - Rebased (and build-tested) against v6.2.
>
> V3:
> - No changes.
>
> V2:
> - Fixed rth email address;
> - Added Petr's review tag - thanks!
>
Hi folks, just a gentle ping.
Lemme know if there's anything I could do in order to get this move forward.
Thanks in advance,
Guilherme
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v4] alpha: Clean-up the panic notifier code
2023-03-13 20:18 ` Guilherme G. Piccoli
@ 2023-03-13 20:39 ` Matt Turner
2023-03-13 20:57 ` Guilherme G. Piccoli
0 siblings, 1 reply; 4+ messages in thread
From: Matt Turner @ 2023-03-13 20:39 UTC (permalink / raw)
To: Guilherme G. Piccoli
Cc: linux-alpha, Richard Henderson, Ivan Kokshaysky, linux-kernel,
kernel-dev, kernel, Petr Mladek
On Mon, Mar 13, 2023 at 4:18 PM Guilherme G. Piccoli
<gpiccoli@igalia.com> wrote:
>
> On 20/02/2023 18:22, 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 <ink@jurassic.park.msu.ru>
> > Cc: Matt Turner <mattst88@gmail.com>
> > Cc: Richard Henderson <richard.henderson@linaro.org>
> > Reviewed-by: Petr Mladek <pmladek@suse.com>
> > Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
> >
> > ---
> >
> >
> > V4:
> > - Rebased (and build-tested) against v6.2.
> >
> > V3:
> > - No changes.
> >
> > V2:
> > - Fixed rth email address;
> > - Added Petr's review tag - thanks!
> >
>
> Hi folks, just a gentle ping.
> Lemme know if there's anything I could do in order to get this move forward.
>
> Thanks in advance,
>
>
> Guilherme
My apologies. I meant to include this in my last pull request.
I'll take it through my tree.
Thanks,
Matt
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v4] alpha: Clean-up the panic notifier code
2023-03-13 20:39 ` Matt Turner
@ 2023-03-13 20:57 ` Guilherme G. Piccoli
0 siblings, 0 replies; 4+ messages in thread
From: Guilherme G. Piccoli @ 2023-03-13 20:57 UTC (permalink / raw)
To: Matt Turner
Cc: linux-alpha, Richard Henderson, Ivan Kokshaysky, linux-kernel,
kernel-dev, kernel, Petr Mladek
On 13/03/2023 17:39, Matt Turner wrote:
> [...]
> My apologies. I meant to include this in my last pull request.
>
> I'll take it through my tree.
>
> Thanks,
> Matt
Hi Matt, no need for apologies - thanks for including!
Cheers,
Guilherme
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-03-13 21:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-20 21:22 [PATCH v4] alpha: Clean-up the panic notifier code Guilherme G. Piccoli
2023-03-13 20:18 ` Guilherme G. Piccoli
2023-03-13 20:39 ` Matt Turner
2023-03-13 20:57 ` Guilherme G. Piccoli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®