aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJocelyn Falempe <[email protected]>2024-07-22 13:47:51 +0200
committerJocelyn Falempe <[email protected]>2024-07-22 17:51:29 +0200
commit1c1ed27ee117da726657c10d6614995eeae33b68 (patch)
tree1e5e80ccf50092f0ecdf1b52addcd8ca8bcfc052
parent7e33fc2ff6754b5ff39b11297f713cd0841d9962 (diff)
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 <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Jocelyn Falempe <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/video/fbdev/core/fbcon.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 498d9c07df80..2e093535884b 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -64,6 +64,8 @@
#include <linux/console.h>
#include <linux/string.h>
#include <linux/kd.h>
+#include <linux/panic.h>
+#include <linux/printk.h>
#include <linux/slab.h>
#include <linux/fb.h>
#include <linux/fbcon.h>
@@ -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)