Skip to content

Commit df67699

Browse files
Thomas Zimmermannhdeller
authored andcommitted
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 <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 0aa0838 commit df67699

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

drivers/firmware/sysfb.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ EXPORT_SYMBOL_GPL(sysfb_disable);
7171

7272
static __init int sysfb_init(void)
7373
{
74-
struct screen_info *si = &screen_info;
74+
const struct screen_info *si = &screen_info;
7575
struct simplefb_platform_data mode;
7676
const char *name;
7777
bool compatible;
@@ -119,6 +119,18 @@ static __init int sysfb_init(void)
119119
if (ret)
120120
goto err;
121121

122+
/*
123+
* The firmware framebuffer is now maintained by the created
124+
* device. Disable screen_info after we've consumed it. Prevents
125+
* invalid access during kexec reboots.
126+
*
127+
* TODO: Vgacon still relies on the global screen_info. Make
128+
* vgacon work with the platform device, so we can clear
129+
* the screen_info unconditionally.
130+
*/
131+
if (strcmp(name, "platform-framebuffer"))
132+
screen_info.orig_video_isVGA = 0;
133+
122134
goto unlock_mutex;
123135
err:
124136
platform_device_put(pd);

0 commit comments

Comments
 (0)