Re: [PATCH v2 1/9] panic: Introduce helper functions for panic state

2025-09-17 Thread Jinchao Wang
On Tue, Sep 16, 2025 at 11:57:11AM +0200, Petr Mladek wrote: > On Mon 2025-08-25 10:29:29, Jinchao Wang wrote: > > This patch introduces four new helper functions to abstract the > > management of the panic_cpu variable. These functions will be used in > > subsequent patches

[PATCH v2 3/9] crash_core: use panic_try_start() in crash_kexec()

2025-08-30 Thread Jinchao Wang
crash_kexec() had its own code to exclude parallel execution by setting panic_cpu. This is already handled by panic_try_start(). Switch to panic_try_start() to remove the duplication and keep the logic consistent. Signed-off-by: Jinchao Wang --- kernel/crash_core.c | 15 +++ 1 file

[PATCH v2 1/9] panic: Introduce helper functions for panic state

2025-08-30 Thread Jinchao Wang
panic originator. panic_on_other_cpu(): Returns true if a panic is on another CPU. This change lays the groundwork for improved code readability and robustness in the panic handling subsystem. Signed-off-by: Jinchao Wang --- include/linux/panic.h | 6 + kernel/panic.c | 53

[PATCH v2 7/9] panic/printk: replace this_cpu_in_panic() with panic_on_this_cpu()

2025-08-30 Thread Jinchao Wang
The helper this_cpu_in_panic() duplicated logic already provided by panic_on_this_cpu(). Remove this_cpu_in_panic() and switch all users to panic_on_this_cpu(). This simplifies the code and avoids having two helpers for the same check. Signed-off-by: Jinchao Wang --- include/linux/printk.h

[PATCH v2 6/9] printk/nbcon: use panic_on_this_cpu() helper

2025-08-30 Thread Jinchao Wang
nbcon_context_try_acquire() compared panic_cpu directly with smp_processor_id(). This open-coded check is now provided by panic_on_this_cpu(). Switch to panic_on_this_cpu() to simplify the code and improve readability. Signed-off-by: Jinchao Wang --- kernel/printk/nbcon.c | 4 ++-- 1 file

[PATCH v2 2/9] fbdev: Use panic_in_progress() helper

2025-08-30 Thread Jinchao Wang
panic handling logic for better clarity and robustness. Signed-off-by: Jinchao Wang Acked-by Qianqiang Liu --- drivers/video/fbdev/core/fbcon.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c

Re: [PATCH v2 3/9] crash_core: use panic_try_start() in crash_kexec()

2025-08-30 Thread Jinchao Wang
On 8/29/25 10:30, Qianqiang Liu wrote: On Mon, Aug 25, 2025 at 10:29:31AM +0800, Jinchao Wang wrote: crash_kexec() had its own code to exclude parallel execution by setting panic_cpu. This is already handled by panic_try_start(). Switch to panic_try_start() to remove the duplication and keep

[PATCH v2 9/9] watchdog: skip checks when panic is in progress

2025-08-30 Thread Jinchao Wang
skipped once a panic has begun. This prevents recursive panic and keeps the panic path more reliable. Signed-off-by: Jinchao Wang Reviewed-by: Yury Norov (NVIDIA) --- kernel/watchdog.c | 6 ++ kernel/watchdog_perf.c | 4 2 files changed, 10 insertions(+) diff --git a/kernel

[PATCH v2 8/9] panic/printk: replace other_cpu_in_panic() with panic_on_other_cpu()

2025-08-30 Thread Jinchao Wang
The helper other_cpu_in_panic() duplicated logic already provided by panic_on_other_cpu(). Remove other_cpu_in_panic() and update all users to call panic_on_other_cpu() instead. This removes redundant code and makes panic handling consistent. Signed-off-by: Jinchao Wang --- kernel/printk

[PATCH v2 5/9] panic: use panic_try_start() in vpanic()

2025-08-30 Thread Jinchao Wang
: Jinchao Wang --- kernel/panic.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/kernel/panic.c b/kernel/panic.c index cd86d37d124c..5266e195f5ac 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -415,7 +415,6 @@ void vpanic(const char *fmt, va_list args

[PATCH v2 0/9] panic: introduce panic status function family

2025-08-30 Thread Jinchao Wang
Yury Norov. Link to v1: https://lore.kernel.org/all/20250820091702.512524-1-wangjinchao...@gmail.com/ Jinchao Wang (9): panic: Introduce helper functions for panic state fbdev: Use panic_in_progress() helper crash_core: use panic_try_start() in crash_kexec() panic: use panic_try_start

[PATCH v2 4/9] panic: use panic_try_start() in nmi_panic()

2025-08-30 Thread Jinchao Wang
. Signed-off-by: Jinchao Wang --- kernel/panic.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/kernel/panic.c b/kernel/panic.c index eacb0c972110..cd86d37d124c 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -355,15 +355,9 @@ EXPORT_SYMBOL(panic_on_other_cpu

Re: [PATCH 3/9] crash_core: use panic_try_start() in crash_kexec()

2025-08-20 Thread Jinchao Wang
On 8/21/25 10:43, Baoquan He wrote: On 08/20/25 at 05:14pm, Jinchao Wang wrote: crash_kexec() had its own code to exclude parallel execution by setting panic_cpu. This is already handled by panic_try_start(). Switch to panic_try_start() to remove the duplication and keep the logic consistent

[PATCH 3/9] crash_core: use panic_try_start() in crash_kexec()

2025-08-20 Thread Jinchao Wang
crash_kexec() had its own code to exclude parallel execution by setting panic_cpu. This is already handled by panic_try_start(). Switch to panic_try_start() to remove the duplication and keep the logic consistent. Signed-off-by: Jinchao Wang --- kernel/crash_core.c | 15 +++ 1 file