Re: [PATCH 07/13] drm/exynos: drop struct_mutex from exynos_gem_map_sgt_with_dma

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 30 March 2016 at 10:40, Daniel Vetter <daniel.vetter@xxxxxxxx> wrote:
> The sg table isn't refcounted, there's no corresponding locking for
> unmapping and drm_map_sg is ok with being called concurrently.
>
> So drop the locking since it doesn't protect anything.
>
> Cc: Inki Dae <inki.dae@xxxxxxxxxxx>
> Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_gem.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
> index 3b7209335df0..60b9975bb0b1 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
> @@ -388,16 +388,12 @@ int exynos_gem_map_sgt_with_dma(struct drm_device *drm_dev,
>  {
>         int nents;
>
> -       mutex_lock(&drm_dev->struct_mutex);
> -
>         nents = dma_map_sg(to_dma_dev(drm_dev), sgt->sgl, sgt->nents, dir);
>         if (!nents) {
>                 DRM_ERROR("failed to map sgl with dma.\n");
> -               mutex_unlock(&drm_dev->struct_mutex);
>                 return nents;
>         }
>
> -       mutex_unlock(&drm_dev->struct_mutex);
>         return 0;
Either my coffee hasn't kicked in or we have a preexisting bug. Namely
- we are returning 0, regardless if we hit the above error ? If that's
intentional shouldn't there be a comment explaining why ?

-Emil
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux