* [PATCH v1] panic: add panic_redirect_cpu declaration to header
@ 2026-01-18 12:01 Pnina Feder
2026-01-18 20:44 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Pnina Feder @ 2026-01-18 12:01 UTC (permalink / raw)
To: akpm
Cc: pmladek, bhe, linux-kernel, lkp, mgorman, mingo, peterz,
pnina.feder, rostedt, senozhatsky, tglx, vkondra
Add the extern declaration for panic_redirect_cpu to linux/panic.h
to fix the sparse warning:
kernel/panic.c:305:10: sparse: sparse: symbol 'panic_redirect_cpu'
was not declared. Should it be static?
The variable needs to be declared in the header alongside panic_cpu
since it is used for synchronization when redirecting panic to a
specific CPU via the panic_force_cpu= boot parameter.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202601161825.pUmb6FsK-lkp@intel.com/
Signed-off-by: Pnina Feder <pnina.feder@mobileye.com>
---
include/linux/panic.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/panic.h b/include/linux/panic.h
index a00bc0937698..f1dd417e54b2 100644
--- a/include/linux/panic.h
+++ b/include/linux/panic.h
@@ -41,6 +41,14 @@ void abort(void);
* PANIC_CPU_INVALID means no CPU has entered panic() or crash_kexec().
*/
extern atomic_t panic_cpu;
+
+/*
+ * panic_redirect_cpu is used when panic is redirected to a specific CPU via
+ * the panic_force_cpu= boot parameter. It holds the CPU number that originally
+ * triggered the panic before redirection. A value of PANIC_CPU_INVALID means
+ * no redirection has occurred.
+ */
+extern atomic_t panic_redirect_cpu;
#define PANIC_CPU_INVALID -1
bool panic_try_start(void);
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v1] panic: add panic_redirect_cpu declaration to header
2026-01-18 12:01 [PATCH v1] panic: add panic_redirect_cpu declaration to header Pnina Feder
@ 2026-01-18 20:44 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2026-01-18 20:44 UTC (permalink / raw)
To: Pnina Feder
Cc: pmladek, bhe, linux-kernel, lkp, mgorman, mingo, peterz, rostedt,
senozhatsky, tglx, vkondra
On Sun, 18 Jan 2026 14:01:49 +0200 Pnina Feder <pnina.feder@mobileye.com> wrote:
> Add the extern declaration for panic_redirect_cpu to linux/panic.h
> to fix the sparse warning:
>
> kernel/panic.c:305:10: sparse: sparse: symbol 'panic_redirect_cpu'
> was not declared. Should it be static?
>
> The variable needs to be declared in the header alongside panic_cpu
> since it is used for synchronization when redirecting panic to a
> specific CPU via the panic_force_cpu= boot parameter.
>
Thanks, I added this as a squashable fix against your earlier patch
"panic: add panic_force_cpu= parameter to redirect panic to a specific
CPU".
(It's nice to tell people when a patch fixes a pending patch in this
manner - otherwise everyone has to run around trying to figure out
which tree is being patched and why).
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-18 20:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-18 12:01 [PATCH v1] panic: add panic_redirect_cpu declaration to header Pnina Feder
2026-01-18 20:44 ` Andrew Morton
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®