linux/drivers/gpu/drm/armada
Thomas Zimmermann 3fb1f62f80 drm/fb-helper: Remove drm_fb_helper_unprepare() from drm_fb_helper_fini()
Move drm_fb_helper_unprepare() from drm_fb_helper_fini() into the
calling fbdev implementation. Avoids a possible stale mutex with
generic fbdev code.

As indicated by its name, drm_fb_helper_prepare() prepares struct
drm_fb_helper before setting up the fbdev support with a call to
drm_fb_helper_init(). In legacy fbdev emulation, this happens next
to each other. If successful, drm_fb_helper_fini() later tear down
the fbdev device and also unprepare via drm_fb_helper_unprepare().

Generic fbdev emulation prepares struct drm_fb_helper immediately
after allocating the instance. It only calls drm_fb_helper_init()
as part of processing a hotplug event. If the hotplug-handling fails,
it runs drm_fb_helper_fini(). This unprepares the fb-helper instance
and the next hotplug event runs on stale data.

Solve this by moving drm_fb_helper_unprepare() from drm_fb_helper_fini()
into the fbdev implementations. Call it right before freeing the
fb-helper instance.

Fixes: 643231b283 ("drm/fbdev-generic: Minimize hotplug error handling")
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: David Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230216140620.17699-1-tzimmermann@suse.de
2023-02-21 13:26:18 +01:00
..
armada_510.c drm: Remove linux/fb.h from drm_crtc.h 2022-07-05 21:14:02 +03:00
armada_crtc.c drm: Remove unnecessary include statements of drm_plane_helper.h 2022-07-26 18:42:04 +02:00
armada_crtc.h drm main pull request for v5.3-rc1 (sans mm changes) 2019-07-15 19:04:27 -07:00
armada_debugfs.c drm/armada: Don't use drm_device->dev_private 2020-09-11 10:47:19 +02:00
armada_drm.h drm/armada: Don't use drm_device->dev_private 2020-09-11 10:47:19 +02:00
armada_drv.c Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
armada_fb.c drm/armada: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:32 +01:00
armada_fb.h drm: Drop drm_framebuffer.h from drm_crtc.h 2022-06-20 23:53:55 +03:00
armada_fbdev.c drm/fb-helper: Remove drm_fb_helper_unprepare() from drm_fb_helper_fini() 2023-02-21 13:26:18 +01:00
armada_gem.c drm/armada: Prepare to dynamic dma-buf locking specification 2022-10-18 01:21:41 +03:00
armada_gem.h drm/armada: Introduce GEM object functions 2020-09-25 09:20:13 +02:00
armada_hw.h drm main pull request for v5.3-rc1 (sans mm changes) 2019-07-15 19:04:27 -07:00
armada_ioctlP.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
armada_overlay.c drm/armada: Use drm_plane_helper_destroy() 2022-07-26 18:42:10 +02:00
armada_plane.c drm/plane-helper: Export individual helpers 2022-07-26 18:42:07 +02:00
armada_plane.h drm/armada: Remove prepare/cleanup_fb hooks 2021-06-24 15:35:50 +02:00
armada_trace.c
armada_trace.h drm/armada: drop use of drmP.h 2019-08-14 18:31:10 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile drm/armada: move primary plane to separate file 2018-07-30 11:52:34 +01:00