diff mbox

drm/vkms: Fix connector leak at the module removal

Message ID 20180719004045.hzepp565x5lfco3c@smtp.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rodrigo Siqueira July 19, 2018, 12:40 a.m. UTC
Currently, vkms shows an error message if the following steps occur: (1)
load vkms, (2) perform any specific operation in the vkms (e.g., run an
IGT test), and (3) unload the module. The following error message
emerges:

[drm:drm_mode_config_cleanup [drm]] *ERROR* connector Virtual-1 leaked!

This commit fixes this error by calling drm_atomic_helper_shutdown()
before drm_mode_config_cleanup, which turns off the whole display
pipeline and remove a reference related to any connector.

Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
---
 drivers/gpu/drm/vkms/vkms_drv.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Gustavo Padovan July 28, 2018, 7:14 p.m. UTC | #1
Hi Rodrigo,

On Wed, Jul 18, 2018 at 09:40:45PM -0300, Rodrigo Siqueira wrote:
> Currently, vkms shows an error message if the following steps occur: (1)
> load vkms, (2) perform any specific operation in the vkms (e.g., run an
> IGT test), and (3) unload the module. The following error message
> emerges:
> 
> [drm:drm_mode_config_cleanup [drm]] *ERROR* connector Virtual-1 leaked!
> 
> This commit fixes this error by calling drm_atomic_helper_shutdown()
> before drm_mode_config_cleanup, which turns off the whole display
> pipeline and remove a reference related to any connector.
> 
> Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> ---
>  drivers/gpu/drm/vkms/vkms_drv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
> index 37aa2ef33b21..6e728b825259 100644
> --- a/drivers/gpu/drm/vkms/vkms_drv.c
> +++ b/drivers/gpu/drm/vkms/vkms_drv.c
> @@ -44,6 +44,7 @@ static void vkms_release(struct drm_device *dev)
>  	struct vkms_device *vkms = container_of(dev, struct vkms_device, drm);
>  
>  	platform_device_unregister(vkms->platform);
> +	drm_atomic_helper_shutdown(&vkms->drm);
>  	drm_mode_config_cleanup(&vkms->drm);
>  	dri_dev_fini(&vkms->drm);

Patch pushed to drm-misc-next-fixes.

Gustavo
diff mbox

Patch

diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
index 37aa2ef33b21..6e728b825259 100644
--- a/drivers/gpu/drm/vkms/vkms_drv.c
+++ b/drivers/gpu/drm/vkms/vkms_drv.c
@@ -44,6 +44,7 @@  static void vkms_release(struct drm_device *dev)
 	struct vkms_device *vkms = container_of(dev, struct vkms_device, drm);
 
 	platform_device_unregister(vkms->platform);
+	drm_atomic_helper_shutdown(&vkms->drm);
 	drm_mode_config_cleanup(&vkms->drm);
 	drm_dev_fini(&vkms->drm);
 }