kernel_samsung_a53x/drivers/gpu/drm/exynos
Douglas Anderson 43d4657f9d drm/exynos: Call drm_atomic_helper_shutdown() at shutdown/unbind time
[ Upstream commit 16ac5b21b31b439f03cdf44c153c5f5af94fb3eb ]

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>
2024-11-18 12:13:18 +01:00
..
exynos7_drm_decon.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos5433_drm_decon.c drm/exynos: fix accidental on-stack copy of exynos_drm_plane 2024-11-18 12:13:07 +01:00
exynos_dp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_crtc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_crtc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_dma.c drm/exynos: fix a wrong error checking 2024-11-18 12:12:15 +01:00
exynos_drm_dpi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_drv.c drm/exynos: Call drm_atomic_helper_shutdown() at shutdown/unbind time 2024-11-18 12:13:18 +01:00
exynos_drm_drv.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_dsi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_fb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_fbdev.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_fbdev.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_fimc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_fimd.c drm/exynos: fix accidental on-stack copy of exynos_drm_plane 2024-11-18 12:13:07 +01:00
exynos_drm_g2d.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_g2d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_gem.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_gem.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_gsc.c drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume 2024-11-18 12:13:07 +01:00
exynos_drm_ipp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_ipp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_mic.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_plane.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_plane.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_rotator.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_scaler.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_vidi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_drm_vidi.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_hdmi.c drm/exynos: fix a potential error pointer dereference 2024-11-18 12:12:15 +01:00
exynos_mixer.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
regs-decon7.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
regs-decon5433.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
regs-fimc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
regs-gsc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
regs-hdmi.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
regs-mixer.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
regs-rotator.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
regs-scaler.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
regs-vp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00