summaryrefslogtreecommitdiff
path: root/drivers/firmware
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2024-01-03 11:15:11 +0100
committerHelge Deller <deller@gmx.de>2024-01-12 12:38:37 +0100
commitdf67699c9cb0ceb70f6cc60630ca938c06773eda (patch)
tree712eaf1cef72e8b70060b99105e299971919ca01 /drivers/firmware
parent0aa0838c84da22cd50d8a92fac26637c630a3235 (diff)
firmware/sysfb: Clear screen_info state after consuming it
After consuming the global screen_info_state in sysfb_init(), the created platform device maintains the firmware framebuffer. Clear screen_info to avoid conflicting access. Subsequent kexec reboots now ignore the firmware framebuffer. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/sysfb.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/firmware/sysfb.c b/drivers/firmware/sysfb.c
index 82fcfd29bc4d..19706bd2642a 100644
--- a/drivers/firmware/sysfb.c
+++ b/drivers/firmware/sysfb.c
@@ -71,7 +71,7 @@ EXPORT_SYMBOL_GPL(sysfb_disable);
static __init int sysfb_init(void)
{
- struct screen_info *si = &screen_info;
+ const struct screen_info *si = &screen_info;
struct simplefb_platform_data mode;
const char *name;
bool compatible;
@@ -119,6 +119,18 @@ static __init int sysfb_init(void)
if (ret)
goto err;
+ /*
+ * The firmware framebuffer is now maintained by the created
+ * device. Disable screen_info after we've consumed it. Prevents
+ * invalid access during kexec reboots.
+ *
+ * TODO: Vgacon still relies on the global screen_info. Make
+ * vgacon work with the platform device, so we can clear
+ * the screen_info unconditionally.
+ */
+ if (strcmp(name, "platform-framebuffer"))
+ screen_info.orig_video_isVGA = 0;
+
goto unlock_mutex;
err:
platform_device_put(pd);