linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/sun4i: Unbind components before releasing DRM and mem at master unbind
@ 2019-04-19  8:02 Paul Kocialkowski
  2019-04-19 16:02 ` [linux-sunxi] " Chen-Yu Tsai
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Kocialkowski @ 2019-04-19  8:02 UTC (permalink / raw)
  To: dri-devel, linux-arm-kernel, linux-kernel, linux-sunxi
  Cc: Daniel Vetter, Maxime Ripard, Paul Kocialkowski, David Airlie,
	Chen-Yu Tsai, Thomas Petazzoni

Our components may still be using the DRM device driver (if only to
access our driver's private data), so make sure to unbind them before
the final drm_dev_put.

Also release our resserved memory adter unbind to match reverse
creation order.

Fixes: f5a9ed867c83 ("drm/sun4i: Fix component unbinding and component master deletion")
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
---
 drivers/gpu/drm/sun4i/sun4i_drv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
index 843b86661833..29258b404e54 100644
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
@@ -149,10 +149,11 @@ static void sun4i_drv_unbind(struct device *dev)
 	drm_kms_helper_poll_fini(drm);
 	drm_atomic_helper_shutdown(drm);
 	drm_mode_config_cleanup(drm);
-	of_reserved_mem_device_release(dev);
-	drm_dev_put(drm);
 
 	component_unbind_all(dev, NULL);
+	of_reserved_mem_device_release(dev);
+
+	drm_dev_put(drm);
 }
 
 static const struct component_master_ops sun4i_drv_master_ops = {
-- 
2.21.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-04-23 17:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-19  8:02 [PATCH] drm/sun4i: Unbind components before releasing DRM and mem at master unbind Paul Kocialkowski
2019-04-19 16:02 ` [linux-sunxi] " Chen-Yu Tsai
2019-04-19 17:10   ` Paul Kocialkowski
2019-04-23 17:06     ` Paul Kocialkowski
2019-04-23 17:14       ` Chen-Yu Tsai
2019-04-23 17:16         ` Paul Kocialkowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).