linux/drivers/gpu/drm/exynos
Douglas Anderson c53dd64daa drm/exynos: Call drm_atomic_helper_shutdown() at shutdown/unbind time
[ Upstream commit 16ac5b21b3 ]

Based on grepping through the source code this driver appears to be
missing a call to drm_atomic_helper_shutdown() at system shutdown time
and at driver unbind time. Among other things, this means that if a
panel is in use that it won't be cleanly powered off at system
shutdown time.

The fact that we should call drm_atomic_helper_shutdown() in the case
of OS shutdown/restart and at driver remove (or unbind) time comes
straight out of the kernel doc "driver instance overview" in
drm_drv.c.

A few notes about this fix:
- When adding drm_atomic_helper_shutdown() to the unbind path, I added
  it after drm_kms_helper_poll_fini() since that's when other drivers
  seemed to have it.
- Technically with a previous patch, ("drm/atomic-helper:
  drm_atomic_helper_shutdown(NULL) should be a noop"), we don't
  actually need to check to see if our "drm" pointer is NULL before
  calling drm_atomic_helper_shutdown(). We'll leave the "if" test in,
  though, so that this patch can land without any dependencies. It
  could potentially be removed later.
- This patch also makes sure to set the drvdata to NULL in the case of
  bind errors to make sure that shutdown can't access freed data.

Suggested-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-02-05 20:16:59 +00:00
..
exynos7_drm_decon.c drm: Explicitly include correct DT includes 2023-07-21 09:12:43 +02:00
exynos5433_drm_decon.c drm/exynos: fix accidental on-stack copy of exynos_drm_plane 2024-01-31 16:21:18 -08:00
exynos_dp.c drm: exynos: Remove #ifdef guards for PM related functions 2022-12-12 13:12:01 +00:00
exynos_drm_crtc.c drm/exynos: fix a possible null-pointer dereference due to data race in exynos_drm_crtc_atomic_disable() 2023-08-08 09:35:11 +09:00
exynos_drm_crtc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
exynos_drm_dma.c drm/exynos: fix a wrong error checking 2023-12-07 11:51:43 +09:00
exynos_drm_dpi.c drm: Remove linux/fb.h from drm_crtc.h 2022-07-05 21:14:02 +03:00
exynos_drm_drv.c drm/exynos: Call drm_atomic_helper_shutdown() at shutdown/unbind time 2024-02-05 20:16:59 +00:00
exynos_drm_drv.h drm/exynos: Remove fb_helper from struct exynos_drm_private 2023-04-17 16:47:55 +09:00
exynos_drm_dsi.c drm: exynos: dsi: Convert to platform remove callback returning void 2023-10-06 08:58:44 +02:00
exynos_drm_fb.c drm/exynos: Implement fbdev emulation as in-kernel client 2023-04-17 16:47:55 +09:00
exynos_drm_fb.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
exynos_drm_fbdev.c fbdev: Use _DMAMEM_ infix for DMA-memory helpers 2023-07-31 20:07:18 +02:00
exynos_drm_fbdev.h drm/exynos: Implement fbdev emulation as in-kernel client 2023-04-17 16:47:55 +09:00
exynos_drm_fimc.c drm: exynos: Remove #ifdef guards for PM related functions 2022-12-12 13:12:01 +00:00
exynos_drm_fimd.c drm/exynos: fix accidental on-stack copy of exynos_drm_plane 2024-01-31 16:21:18 -08:00
exynos_drm_g2d.c drm/exynos: fix race condition UAF in exynos_g2d_exec_ioctl 2023-06-07 13:03:16 +09:00
exynos_drm_g2d.h drm/exynos: fix g2d_open/close helper function definitions 2023-05-15 14:10:34 +09:00
exynos_drm_gem.c mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
exynos_drm_gem.h drm/exynos: Implement mmap as GEM object function 2021-12-22 11:39:39 +09:00
exynos_drm_gsc.c drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume 2024-01-31 16:21:19 -08:00
exynos_drm_ipp.c drm: Drop drm_blend.h from drm_crtc.h 2022-06-20 23:53:55 +03:00
exynos_drm_ipp.h drm/exynos: drop use of drmP.h 2019-09-01 20:55:12 +09:00
exynos_drm_mic.c drm: exynos: Remove #ifdef guards for PM related functions 2022-12-12 13:12:01 +00:00
exynos_drm_plane.c drm: Remove unnecessary include statements of drm_plane_helper.h 2022-07-26 18:42:04 +02:00
exynos_drm_plane.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
exynos_drm_rotator.c drm: Explicitly include correct DT includes 2023-07-21 09:12:43 +02:00
exynos_drm_scaler.c drm: Explicitly include correct DT includes 2023-07-21 09:12:43 +02:00
exynos_drm_vidi.c drm/exynos: vidi: fix a wrong error return 2023-06-07 13:03:17 +09:00
exynos_drm_vidi.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
exynos_hdmi.c drm/exynos: fix a potential error pointer dereference 2023-12-07 11:51:42 +09:00
exynos_mixer.c drm: Explicitly include correct DT includes 2023-07-21 09:12:43 +02:00
Kconfig fbdev: Use _DMAMEM_ infix for DMA-memory helpers 2023-07-31 20:07:18 +02:00
Makefile drm/exynos/iommu: merge IOMMU and DMA code 2018-12-04 13:23:17 +09:00
regs-decon7.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
regs-decon5433.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 423 2019-06-05 17:37:15 +02:00
regs-fimc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
regs-gsc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
regs-hdmi.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
regs-mixer.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
regs-rotator.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
regs-scaler.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
regs-vp.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00