* [PATCH] fbcon: Use oops_in_progress instead of panic_cpu
[not found] <202407210203.2ISiIC9m-lkp@intel.com>
@ 2024-07-22 11:47 ` Jocelyn Falempe
2024-07-22 14:15 ` Daniel Vetter
0 siblings, 1 reply; 3+ messages in thread
From: Jocelyn Falempe @ 2024-07-22 11:47 UTC (permalink / raw)
To: lkp
Cc: Daniel Vetter, Helge Deller, linux-fbdev, dri-devel,
Javier Martinez Canillas, Thomas Zimmermann, oe-kbuild-all,
Jocelyn Falempe
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 <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202407210203.2ISiIC9m-lkp@intel.com/
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
---
drivers/video/fbdev/core/fbcon.c | 9 +++++++++
1 file changed, 9 insertions(+)
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)
base-commit: 7e33fc2ff6754b5ff39b11297f713cd0841d9962
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fbcon: Use oops_in_progress instead of panic_cpu
2024-07-22 11:47 ` [PATCH] fbcon: Use oops_in_progress instead of panic_cpu Jocelyn Falempe
@ 2024-07-22 14:15 ` Daniel Vetter
2024-07-22 16:34 ` Jocelyn Falempe
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2024-07-22 14:15 UTC (permalink / raw)
To: Jocelyn Falempe
Cc: lkp, Daniel Vetter, Helge Deller, linux-fbdev, dri-devel,
Javier Martinez Canillas, Thomas Zimmermann, oe-kbuild-all
On Mon, Jul 22, 2024 at 01:47:51PM +0200, Jocelyn Falempe wrote:
> 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 <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202407210203.2ISiIC9m-lkp@intel.com/
> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Yeah it's not great but gets the job done.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cheers, Sima
> ---
> drivers/video/fbdev/core/fbcon.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> 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)
>
> base-commit: 7e33fc2ff6754b5ff39b11297f713cd0841d9962
> --
> 2.45.2
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fbcon: Use oops_in_progress instead of panic_cpu
2024-07-22 14:15 ` Daniel Vetter
@ 2024-07-22 16:34 ` Jocelyn Falempe
0 siblings, 0 replies; 3+ messages in thread
From: Jocelyn Falempe @ 2024-07-22 16:34 UTC (permalink / raw)
To: Daniel Vetter
Cc: lkp, Daniel Vetter, Helge Deller, linux-fbdev, dri-devel,
Javier Martinez Canillas, Thomas Zimmermann, oe-kbuild-all
On 22/07/2024 16:15, Daniel Vetter wrote:
> On Mon, Jul 22, 2024 at 01:47:51PM +0200, Jocelyn Falempe wrote:
>> 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 <lkp@intel.com>
>> Closes: https://lore.kernel.org/oe-kbuild-all/202407210203.2ISiIC9m-lkp@intel.com/
>> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
>
> Yeah it's not great but gets the job done.
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
I pushed it to drm-misc-next.
Thanks a lot.
>
> Cheers, Sima
>
>> ---
>> drivers/video/fbdev/core/fbcon.c | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>>
>> 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)
>>
>> base-commit: 7e33fc2ff6754b5ff39b11297f713cd0841d9962
>> --
>> 2.45.2
>>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-07-22 16:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <202407210203.2ISiIC9m-lkp@intel.com>
2024-07-22 11:47 ` [PATCH] fbcon: Use oops_in_progress instead of panic_cpu Jocelyn Falempe
2024-07-22 14:15 ` Daniel Vetter
2024-07-22 16:34 ` Jocelyn Falempe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).