summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/pl111
diff options
context:
space:
mode:
authorDouglas Anderson <dianders@chromium.org>2023-09-02 02:39:56 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-11-20 13:59:10 +0300
commit69f03be1fa08a66735d53d92d3429c052540e3bf (patch)
tree7b33b270d6a36bcca1a3178b211cbfeca85455e2 /drivers/gpu/drm/pl111
parent2755e3757585e8cf1b0a33267eab7519f1c307d8 (diff)
downloadlinux-69f03be1fa08a66735d53d92d3429c052540e3bf.tar.xz
drm: Call drm_atomic_helper_shutdown() at shutdown/remove time for misc drivers
[ Upstream commit 3c4babae3c4a1ae05f8f3f5f3d50c440ead7ca6a ] 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 Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/pl111')
-rw-r--r--drivers/gpu/drm/pl111/pl111_drv.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index ba3b5b5f0cdf..02e6b74d5016 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -323,12 +323,18 @@ static void pl111_amba_remove(struct amba_device *amba_dev)
struct pl111_drm_dev_private *priv = drm->dev_private;
drm_dev_unregister(drm);
+ drm_atomic_helper_shutdown(drm);
if (priv->panel)
drm_panel_bridge_remove(priv->bridge);
drm_dev_put(drm);
of_reserved_mem_device_release(dev);
}
+static void pl111_amba_shutdown(struct amba_device *amba_dev)
+{
+ drm_atomic_helper_shutdown(amba_get_drvdata(amba_dev));
+}
+
/*
* This early variant lacks the 565 and 444 pixel formats.
*/
@@ -431,6 +437,7 @@ static struct amba_driver pl111_amba_driver __maybe_unused = {
},
.probe = pl111_amba_probe,
.remove = pl111_amba_remove,
+ .shutdown = pl111_amba_shutdown,
.id_table = pl111_id_table,
};