]> git.baikalelectronics.ru Git - kernel.git/commit
fbdev: Disable sysfb device registration when removing conflicting FBs
authorJavier Martinez Canillas <javierm@redhat.com>
Tue, 7 Jun 2022 18:23:36 +0000 (20:23 +0200)
committerJavier Martinez Canillas <javierm@redhat.com>
Thu, 9 Jun 2022 14:20:12 +0000 (16:20 +0200)
commitacca6d2b34f7b5a037e6d3890e12a42fd0f74dbc
tree7e156101a538d0bdac520bec37709916eed95a9a
parent8a86fb546a8647e680f89d13772a492683942188
fbdev: Disable sysfb device registration when removing conflicting FBs

The platform devices registered by sysfb match with firmware-based DRM or
fbdev drivers, that are used to have early graphics using a framebuffer
provided by the system firmware.

DRM or fbdev drivers later are probed and remove conflicting framebuffers,
leading to these platform devices for generic drivers to be unregistered.

But the current solution has a race, since the sysfb_init() function could
be called after a DRM or fbdev driver is probed and request to unregister
the devices for drivers with conflicting framebuffes.

To prevent this, disable any future sysfb platform device registration by
calling sysfb_disable(), if a driver requests to remove the conflicting
framebuffers.

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20220607182338.344270-4-javierm@redhat.com
drivers/video/fbdev/core/fbmem.c