diff mbox series

[2/2] drm: rcar-du: Shutdown the display on remove

Message ID 20210323005616.20110-2-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State Mainlined
Commit 5e7ef0b85c7718c10f6122caf7af9b2e70d53830
Delegated to: Kieran Bingham
Headers show
Series [1/2] drm: rcar-du: Don't put reference to drm_device in rcar_du_remove() | expand

Commit Message

Laurent Pinchart March 23, 2021, 12:56 a.m. UTC
When the device is unbound from the driver (the DU being a platform
device, this occurs either when removing the DU module, or when
unbinding the device manually through sysfs), the display may be active.
Make sure it gets shut down.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/gpu/drm/rcar-du/rcar_du_drv.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Kieran Bingham June 21, 2021, 8:22 p.m. UTC | #1
Hi Laurent,

On 23/03/2021 00:56, Laurent Pinchart wrote:
> When the device is unbound from the driver (the DU being a platform
> device, this occurs either when removing the DU module, or when
> unbinding the device manually through sysfs), the display may be active.
> Make sure it gets shut down.

I bet this may be particularly true if there's a console on it.


> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>  drivers/gpu/drm/rcar-du/rcar_du_drv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> index 2a06ec1cbefb..9f1a3aad4dd7 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> @@ -553,6 +553,7 @@ static int rcar_du_remove(struct platform_device *pdev)
>  	struct drm_device *ddev = &rcdu->ddev;
>  
>  	drm_dev_unregister(ddev);
> +	drm_atomic_helper_shutdown(ddev);
>  
>  	drm_kms_helper_poll_fini(ddev);

There's a real mix of other drivers either calling
drm_kms_helper_poll_fini() before drm_atomic_helper_shutdown() or after,
so I'll assume that the sequencing here isn't terribly important (I hope).

So,

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
index 2a06ec1cbefb..9f1a3aad4dd7 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
@@ -553,6 +553,7 @@  static int rcar_du_remove(struct platform_device *pdev)
 	struct drm_device *ddev = &rcdu->ddev;
 
 	drm_dev_unregister(ddev);
+	drm_atomic_helper_shutdown(ddev);
 
 	drm_kms_helper_poll_fini(ddev);