mirror-linux/drivers/gpu/drm/tegra
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
..
Kconfig drm/display: Move SCDC helpers into display-helper library 2022-04-25 11:19:37 +02:00
Makefile drm/tegra: Add code for booting RISC-V based engines 2022-11-25 16:14:58 +01:00
dc.c drm/tegra: Add missing clk_disable_unprepare() in tegra_dc_probe() 2022-11-25 16:14:58 +01:00
dc.h drm/tegra: Support YVYU, VYUY and YU24 formats 2022-03-01 11:13:09 +01:00
dp.c drm: Rename dp/ to display/ 2022-04-25 11:17:45 +02:00
dp.h
dpaux.c drm/tegra: Remove #ifdef guards for PM related functions 2023-01-26 15:55:39 +01:00
dpaux.h
drm.c drm/tegra: Add Tegra234 support to NVDEC driver 2022-11-25 16:14:58 +01:00
drm.h drm/tegra: Implement stream ID related callbacks on engines 2022-07-08 16:27:52 +02:00
dsi.c drm/tegra: Fix reference leak in tegra_dsi_ganged_probe 2022-02-25 14:16:55 +01:00
dsi.h
falcon.c drm/tegra: falcon: Set DMACTX field on DMA transactions 2022-07-08 16:27:52 +02:00
falcon.h drm/tegra: falcon: Set DMACTX field on DMA transactions 2022-07-08 16:27:52 +02:00
fb.c drm/fb-helper: Remove drm_fb_helper_unprepare() from drm_fb_helper_fini() 2023-02-21 13:26:18 +01:00
firewall.c drm/tegra: firewall: Check for is_addr_reg existence in IMM check 2023-01-26 15:55:38 +01:00
gem.c drm: Assert held reservation lock for dma-buf mmapping 2022-11-11 23:49:47 +03:00
gem.h
gr2d.c
gr2d.h
gr3d.c
gr3d.h
hda.c
hda.h
hdmi.c drm/tegra: Convert to using is_hdmi from display info 2022-11-25 16:14:58 +01:00
hdmi.h
hub.c drm/tegra: Changes for v5.20-rc1 2022-07-12 16:50:05 +10:00
hub.h
mipi-phy.c
mipi-phy.h
nvdec.c drm/tegra: nvdec: Use tegra_dev_iommu_get_stream_id() 2023-01-27 17:49:44 +01:00
output.c drm/tegra: Switch to using devm_fwnode_gpiod_get() 2022-11-25 16:14:58 +01:00
plane.c drm: Remove unnecessary include statements of drm_plane_helper.h 2022-07-26 18:42:04 +02:00
plane.h drm/tegra: Support semi-planar formats on Tegra114+ 2022-03-01 11:13:09 +01:00
rgb.c
riscv.c drm/tegra: Add code for booting RISC-V based engines 2022-11-25 16:14:58 +01:00
riscv.h drm/tegra: Add code for booting RISC-V based engines 2022-11-25 16:14:58 +01:00
sor.c drm/display: Move SCDC helpers into display-helper library 2022-04-25 11:19:37 +02:00
sor.h
submit.c drm/tegra: Use tegra_dev_iommu_get_stream_id() 2023-01-27 17:49:43 +01:00
submit.h
trace.c
trace.h
uapi.c gpu: host1x: Select context device based on attached IOMMU 2022-11-25 16:14:19 +01:00
uapi.h
vic.c drm/tegra: vic: Use tegra_dev_iommu_get_stream_id() 2023-01-27 17:49:44 +01:00
vic.h