Re: [PATCH 3/3] panic: add note that 'panic_print' parameter is deprecated

From: Petr Mladek
Date: Tue Aug 19 2025 - 05:48:52 EST


On Fri 2025-08-15 15:14:28, Feng Tang wrote:
> Just like for 'panic_print's systcl interface, add similar note for
> setup of kernel cmdline parameter and parameter under /sys/module/kernel/.
>
> Also add __core_param_cb() macro, which enables to add special get/set
> operation for a kernel parameter.



> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -937,12 +937,29 @@ EXPORT_SYMBOL(__stack_chk_fail);
> #endif
>
> core_param(panic, panic_timeout, int, 0644);
> -core_param(panic_print, panic_print, ulong, 0644);
> core_param(pause_on_oops, pause_on_oops, int, 0644);
> core_param(panic_on_warn, panic_on_warn, int, 0644);
> core_param(crash_kexec_post_notifiers, crash_kexec_post_notifiers, bool, 0644);
> core_param(panic_console_replay, panic_console_replay, bool, 0644);
>
> +static int panic_print_set(const char *val, const struct kernel_param *kp)
> +{
> + pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> + return param_set_ulong(val, kp);
> +}
> +
> +static int panic_print_get(char *val, const struct kernel_param *kp)
> +{
> + pr_info_once("Kernel: 'panic_print' parameter will be obsoleted by both 'panic_sys_info' and 'panic_console_replay'\n");
> + return param_get_ulong(val, kp);
> +}

It should be enough to print the message only once and avoid
duplication in the sources.

Also I would make the message more direct, something like:

pr_info_once("Kernel: The 'panic_print' parameter is now deprecated. Please use 'panic_sys_info' and 'panic_console_replay' instead.\n");

I am going to send a followup patch. Feel free to keep this one as is:

Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>

Best Regards,
Petr