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]
Date:   Fri, 27 Nov 2020 16:13:07 +0100
From:   Daniel Vetter <daniel@...ll.ch>
To:     Tian Tao <tiantao6@...ilicon.com>
Cc:     hdegoede@...hat.com, airlied@...ux.ie, daniel@...ll.ch,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/vboxvideo: Used the vram helper

On Fri, Nov 27, 2020 at 11:14:42AM +0800, Tian Tao wrote:
> if the driver uses drmm_vram_helper_init, there is no need to
> call drm_vram_helper_release_mm when the drm module get unloaded,
> as this will done automagically.
> 
> Signed-off-by: Tian Tao <tiantao6@...ilicon.com>
> ---
>  drivers/gpu/drm/vboxvideo/vbox_ttm.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vboxvideo/vbox_ttm.c b/drivers/gpu/drm/vboxvideo/vbox_ttm.c
> index f5a0667..e1909a8 100644
> --- a/drivers/gpu/drm/vboxvideo/vbox_ttm.c
> +++ b/drivers/gpu/drm/vboxvideo/vbox_ttm.c
> @@ -16,8 +16,8 @@ int vbox_mm_init(struct vbox_private *vbox)
>  	int ret;
>  	struct drm_device *dev = &vbox->ddev;
>  
> -	vmm = drm_vram_helper_alloc_mm(dev, pci_resource_start(dev->pdev, 0),
> -				       vbox->available_vram_size);
> +	vmm = drmm_vram_helper_init(dev, pci_resource_start(dev->pdev, 0),
> +				    vbox->available_vram_size);

Pretty sure this doesn't compile without warnings, since the return value
changes. With that fixed lgtm.

Btw if you're bored, a devm_ version of arch_phys_wc_add is very much on
the wishlist, and would allow us to complete remove vbox_mm_fini.

Cheers, Daniel

>  	if (IS_ERR(vmm)) {
>  		ret = PTR_ERR(vmm);
>  		DRM_ERROR("Error initializing VRAM MM; %d\n", ret);
> @@ -32,5 +32,4 @@ int vbox_mm_init(struct vbox_private *vbox)
>  void vbox_mm_fini(struct vbox_private *vbox)
>  {
>  	arch_phys_wc_del(vbox->fb_mtrr);
> -	drm_vram_helper_release_mm(&vbox->ddev);
>  }
> -- 
> 2.7.4
> 

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ