linux-stable/drivers/gpu/drm/tilcdc
Douglas Anderson 3c4babae3c drm: Call drm_atomic_helper_shutdown() at shutdown/remove time for misc drivers
Based on grepping through the source code these drivers appear to be
missing a call to drm_atomic_helper_shutdown() at system shutdown time
and at driver remove (or 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 these fixes:
- I confirmed that these drivers were all DRIVER_MODESET type drivers,
  which I believe makes this relevant.
- I confirmed that these drivers were all DRIVER_ATOMIC.
- When adding drm_atomic_helper_shutdown() to the remove/unbind path,
  I added it after drm_kms_helper_poll_fini() when the driver had
  it. This seemed to be what other drivers did. If
  drm_kms_helper_poll_fini() wasn't there I added it straight after
  drm_dev_unregister().
- This patch deals with drivers using the component model in similar
  ways as the patch ("drm: Call drm_atomic_helper_shutdown() at
  shutdown time for misc drivers")
- These fixes rely on the patch ("drm/atomic-helper:
  drm_atomic_helper_shutdown(NULL) should be a noop") to simplify
  shutdown.

Suggested-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> # tilcdc
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230901163944.RFT.5.I771eb4bd03d8772b19e7dcfaef3e2c167bce5846@changeid
2023-09-21 10:51:55 -07:00
..
Kconfig drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00
Makefile
tilcdc_crtc.c drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
tilcdc_drv.c drm: Call drm_atomic_helper_shutdown() at shutdown/remove time for misc drivers 2023-09-21 10:51:55 -07:00
tilcdc_drv.h drm/tilcdc: Convert to Linux IRQ interfaces 2021-08-10 20:13:53 +02:00
tilcdc_external.c tilcdc: tilcdc_external: fix an incorrect NULL check on list iterator 2022-03-29 13:58:58 +03:00
tilcdc_external.h
tilcdc_panel.c drm/tilcdc: Convert to platform remove callback returning void 2023-06-08 10:34:57 -07:00
tilcdc_panel.h
tilcdc_plane.c drm/plane: Remove drm_plane_init() 2022-09-20 09:37:12 +02:00
tilcdc_regs.h