From: Jocelyn Falempe Date: Mon, 22 Jul 2024 11:47:51 +0000 (+0200) Subject: fbcon: Use oops_in_progress instead of panic_cpu X-Git-Tag: v6.12-rc1~126^2~24^2~77 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c1ed27ee117da726657c10d6614995eeae33b68;p=thirdparty%2Fkernel%2Flinux.git fbcon: Use oops_in_progress instead of panic_cpu Panic_cpu is not exported, so it can't be used if fbcon is used as a module. Use oops_in_progress in this case, but non-fatal oops won't be printed. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202407210203.2ISiIC9m-lkp@intel.com/ Signed-off-by: Jocelyn Falempe Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20240722114800.174558-1-jfalempe@redhat.com --- diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 498d9c07df803..2e093535884b4 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -64,6 +64,8 @@ #include #include #include +#include +#include #include #include #include @@ -272,7 +274,14 @@ static int fbcon_get_rotate(struct fb_info *info) static bool fbcon_skip_panic(struct fb_info *info) { +/* panic_cpu is not exported, and can't be used if built as module. Use + * oops_in_progress instead, but non-fatal oops won't be printed. + */ +#if defined(MODULE) + return (info->skip_panic && unlikely(oops_in_progress)); +#else return (info->skip_panic && unlikely(atomic_read(&panic_cpu) != PANIC_CPU_INVALID)); +#endif } static inline int fbcon_is_inactive(struct vc_data *vc, struct fb_info *info)