All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mete Durlu" <meted@linux.ibm.com>
Cc: "Alexander Gordeev" <agordeev@linux.ibm.com>,
	"Vasily Gorbik" <gor@linux.ibm.com>,
	linux-s390@vger.kernel.org, "Heiko Carstens" <hca@linux.ibm.com>
Subject: Re: [PATCH 3/3] sparc: Implement arch_do_panic
Date: Mon, 27 Jul 2026 09:11:34 +0000	[thread overview]
Message-ID: <20260727091135.742931F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260727-arch_do_panic-v1-3-ca1777547c38@linux.ibm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The newly introduced SPARC implementation of `arch_do_panic()` is never called because the overriding macro is not visible in `kernel/panic.c`, resulting in the empty fallback stub being used and the SPARC implementation becoming dead code.
- [Low] Redundant local `extern` declaration of `stop_a_enabled`.
--

--- Patch [3]: [PATCH 3/3] sparc: Implement arch_do_panic ---
commit 0468bb7524180e5a2aa478f794a79dc389197120
Author: Mete Durlu <meted@linux.ibm.com>

sparc: Implement arch_do_panic

This patch implements a sparc-specific arch_do_panic function to handle
the Stop-A hardware sequence. It removes the architecture-specific ifdef
blocks from the generic panic code.

> diff --git a/arch/sparc/include/asm/setup.h b/arch/sparc/include/asm/setup.h
> index 21bed55140288..557e8277a6407 100644
> --- a/arch/sparc/include/asm/setup.h
> +++ b/arch/sparc/include/asm/setup.h

[ ... ]

> @@ -67,4 +66,7 @@ void sun_do_break(void);
>  extern int stop_a_enabled;
>  extern int scons_pwroff;
>  
> +void arch_do_panic(void);
> +#define arch_do_panic arch_do_panic
> +
>  #endif /* _SPARC_SETUP_H */

> diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c
> index 4975867d9001b..87d3569c520f8 100644
> --- a/arch/sparc/kernel/setup.c
> +++ b/arch/sparc/kernel/setup.c

[ ... ]

> @@ -36,6 +36,14 @@ static const struct ctl_table sparc_sysctl_table[] = {
>  #endif
>  };
>  
> +void arch_do_panic(void)
> +{
> +	extern int stop_a_enabled;

[Severity: Low]
This isn't a bug, but is this local extern declaration necessary?
Since asm/setup.h is included at the top of this file, the global
declaration of stop_a_enabled should already be visible.

> +	/* Make sure the user can actually press Stop-A (L1-A) */
> +	stop_a_enabled = 1;
> +	pr_emerg("Press Stop-A (L1-A) from sun keyboard or send break\n"
> +		 "twice on console to return to the boot prom\n");
> +}

> diff --git a/kernel/panic.c b/kernel/panic.c
> index de0bda946cabb..593aa2c24d93f 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c

[ ... ]

> @@ -747,15 +747,6 @@ void vpanic(const char *fmt, va_list args)
>  			reboot_mode = panic_reboot_mode;
>  		emergency_restart();
>  	}
> -#ifdef __sparc__
> -	{
> -		extern int stop_a_enabled;
> -		/* Make sure the user can actually press Stop-A (L1-A) */
> -		stop_a_enabled = 1;
> -		pr_emerg("Press Stop-A (L1-A) from sun keyboard or send break\n"
> -			 "twice on console to return to the boot prom\n");
> -	}
> -#endif
>  	pr_emerg("---[ end Kernel panic - not syncing: %s ]---\n", buf);
>  
>  	arch_do_panic();

[Severity: High]
Will this actually call the sparc-specific implementation?

Looking at kernel/panic.c, it does not appear to include asm/setup.h where
the override macro for arch_do_panic is defined. Because the override macro
isn't visible in this translation unit, won't vpanic end up executing
the default empty inline fallback instead of the newly added sparc
implementation, effectively dropping the sparc panic behavior?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260727-arch_do_panic-v1-0-ca1777547c38@linux.ibm.com?part=3

      reply	other threads:[~2026-07-27  9:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27  8:58 [PATCH 0/3] Introduce arch_do_panic Mete Durlu
2026-07-27  8:58 ` [PATCH 1/3] panic: " Mete Durlu
2026-07-27  9:09   ` sashiko-bot
2026-07-27  8:58 ` [PATCH 2/3] s390: Implement arch_do_panic Mete Durlu
2026-07-27  9:10   ` sashiko-bot
2026-07-27  9:35     ` Mete Durlu
2026-07-27  8:58 ` [PATCH 3/3] sparc: " Mete Durlu
2026-07-27  9:11   ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260727091135.742931F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=agordeev@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=meted@linux.ibm.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.