lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZsNVTtigz4F4-npb@phenom.ffwll.local>
Date: Mon, 19 Aug 2024 16:23:10 +0200
From: Daniel Vetter <daniel.vetter@...ll.ch>
To: Louis Chauvet <louis.chauvet@...tlin.com>
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@...il.com>,
	Melissa Wen <melissa.srw@...il.com>,
	MaĆ­ra Canal <mairacanal@...eup.net>,
	Haneen Mohammed <hamohammed.sa@...il.com>,
	Daniel Vetter <daniel@...ll.ch>,
	Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
	Maxime Ripard <mripard@...nel.org>,
	Thomas Zimmermann <tzimmermann@...e.de>,
	David Airlie <airlied@...il.com>, dri-devel@...ts.freedesktop.org,
	arthurgrillo@...eup.net, linux-kernel@...r.kernel.org,
	jeremie.dautheribes@...tlin.com, miquel.raynal@...tlin.com,
	thomas.petazzoni@...tlin.com, seanpaul@...gle.com,
	nicolejadeyee@...gle.com
Subject: Re: [PATCH RFC 01/15] drm/vkms: Remove useles devres group

On Wed, Aug 14, 2024 at 04:36:23PM +0200, Louis Chauvet wrote:
> As the driver now uses drm managed allocation, the devres group is not
> needed anymore, so remove it.

drmm isn't devres, and you still have a devres managed resource here,
namely devm_drm_dev_alloc. The reason I suggest in the review on google's
series for configfs to nuke this is that they switched over to making vkms
a proper platform driver, in which case you get a devres group
automatically for your driver binding.

But neither the explicit one or the driver binding is one devres too few
:-)

Cheers, Sima
> 
> Signed-off-by: Louis Chauvet <louis.chauvet@...tlin.com>
> ---
>  drivers/gpu/drm/vkms/vkms_drv.c | 18 +++++-------------
>  1 file changed, 5 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
> index e79832e10f3c..7ac3ab7e16e5 100644
> --- a/drivers/gpu/drm/vkms/vkms_drv.c
> +++ b/drivers/gpu/drm/vkms/vkms_drv.c
> @@ -297,16 +297,11 @@ static int vkms_create(struct vkms_config *config)
>  	if (IS_ERR(pdev))
>  		return PTR_ERR(pdev);
>  
> -	if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL)) {
> -		ret = -ENOMEM;
> -		goto out_unregister;
> -	}
> -
>  	vkms_device = devm_drm_dev_alloc(&pdev->dev, &vkms_driver,
>  					 struct vkms_device, drm);
>  	if (IS_ERR(vkms_device)) {
>  		ret = PTR_ERR(vkms_device);
> -		goto out_devres;
> +		goto out_unregister;
>  	}
>  	vkms_device->platform = pdev;
>  	vkms_device->config = config;
> @@ -317,32 +312,30 @@ static int vkms_create(struct vkms_config *config)
>  
>  	if (ret) {
>  		DRM_ERROR("Could not initialize DMA support\n");
> -		goto out_devres;
> +		goto out_unregister;
>  	}
>  
>  	ret = drm_vblank_init(&vkms_device->drm, 1);
>  	if (ret) {
>  		DRM_ERROR("Failed to vblank\n");
> -		goto out_devres;
> +		goto out_unregister;
>  	}
>  
>  	ret = vkms_modeset_init(vkms_device);
>  	if (ret)
> -		goto out_devres;
> +		goto out_unregister;
>  
>  	drm_debugfs_add_files(&vkms_device->drm, vkms_config_debugfs_list,
>  			      ARRAY_SIZE(vkms_config_debugfs_list));
>  
>  	ret = drm_dev_register(&vkms_device->drm, 0);
>  	if (ret)
> -		goto out_devres;
> +		goto out_unregister;
>  
>  	drm_fbdev_shmem_setup(&vkms_device->drm, 0);
>  
>  	return 0;
>  
> -out_devres:
> -	devres_release_group(&pdev->dev, NULL);
>  out_unregister:
>  	platform_device_unregister(pdev);
>  	return ret;
> @@ -383,7 +376,6 @@ static void vkms_destroy(struct vkms_config *config)
>  
>  	drm_dev_unregister(&config->dev->drm);
>  	drm_atomic_helper_shutdown(&config->dev->drm);
> -	devres_release_group(&pdev->dev, NULL);
>  	platform_device_unregister(pdev);
>  
>  	config->dev = NULL;
> 
> -- 
> 2.44.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ