Skip to content

Commit

Permalink
firmware/sysfb: Clear screen_info state after consuming it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Zimmermann authored and Helge Deller committed Jan 12, 2024
1 parent 0aa0838 commit df67699
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion drivers/firmware/sysfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit df67699

Please sign in to comment.