linux/drivers/gpu/drm/mgag200
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: Only select I2C_ALGOBIT for drivers that actually need it 2023-01-10 11:15:44 +01:00
Makefile drm/mgag200: Provide per-device callbacks for PIXPLLC 2022-07-29 16:01:47 +02:00
mgag200_bmc.c drm/mgag200: Provide per-device callbacks for BMC synchronization 2022-07-29 16:01:47 +02:00
mgag200_drv.c drm: Call drm_atomic_helper_shutdown() at shutdown/remove time for misc drivers 2023-09-21 10:51:55 -07:00
mgag200_drv.h drm/mgag200: Implement struct drm_plane_helper_funcs.atomic_enable 2023-02-20 15:20:41 +01:00
mgag200_g200.c drm/mgag200: Remove type field from struct mga_device 2022-07-29 16:01:47 +02:00
mgag200_g200eh3.c drm/mgag200: Remove type field from struct mga_device 2022-07-29 16:01:47 +02:00
mgag200_g200eh.c drm/mgag200: Remove type field from struct mga_device 2022-07-29 16:01:47 +02:00
mgag200_g200er.c drm/mgag200: Remove type field from struct mga_device 2022-07-29 16:01:47 +02:00
mgag200_g200ev.c drm/mgag200: Remove type field from struct mga_device 2022-07-29 16:01:47 +02:00
mgag200_g200ew3.c drm/mgag200: Remove type field from struct mga_device 2022-07-29 16:01:47 +02:00
mgag200_g200se.c drm/mgag200: Fix PLL setup for G200_SE_A rev >=4 2022-10-18 16:06:10 +02:00
mgag200_g200wb.c drm/mgag200: Remove type field from struct mga_device 2022-07-29 16:01:47 +02:00
mgag200_i2c.c drm/mgag200: Store positions of I2C data and clock bits in device info 2022-06-07 09:40:11 +02:00
mgag200_mode.c Merge drm/drm-fixes into drm-misc-fixes 2023-05-12 09:47:12 +02:00
mgag200_reg.h drm/mgag200:remove rebundant word "or" in comments 2022-07-18 18:44:01 +02:00