All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] drm/nouveau: move io_reserve_lru handling into the driver v5
@ 2020-09-09 11:49 Dan Carpenter
  2020-09-09 11:59 ` Christian König
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-09-09 11:49 UTC (permalink / raw)
  To: christian.koenig-5C7GfCeVMHo; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Hello Christian König,

The patch 141b15e59175: "drm/nouveau: move io_reserve_lru handling
into the driver v5" from Aug 21, 2020, leads to the following static
checker warning:

	drivers/gpu/drm/nouveau/nouveau_ttm.c:148 nouveau_ttm_fault()
	warn: inconsistent returns '*bo->base.resv'.

drivers/gpu/drm/nouveau/nouveau_ttm.c
   126  static vm_fault_t nouveau_ttm_fault(struct vm_fault *vmf)
   127  {
   128          struct vm_area_struct *vma = vmf->vma;
   129          struct ttm_buffer_object *bo = vma->vm_private_data;
   130          pgprot_t prot;
   131          vm_fault_t ret;
   132  
   133          ret = ttm_bo_vm_reserve(bo, vmf);
   134          if (ret)
   135                  return ret;
   136  
   137          nouveau_bo_del_io_reserve_lru(bo);
   138  
   139          prot = vm_get_page_prot(vma->vm_flags);
   140          ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT, 1);
   141          if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT))
   142                  return ret;
                        ^^^^^^^^^^
Call dma_resv_unlock() before returning?

   143  
   144          nouveau_bo_add_io_reserve_lru(bo);
   145  
   146          dma_resv_unlock(bo->base.resv);
   147  
   148          return ret;
   149  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] drm/nouveau: move io_reserve_lru handling into the driver v5
  2020-09-09 11:49 [bug report] drm/nouveau: move io_reserve_lru handling into the driver v5 Dan Carpenter
@ 2020-09-09 11:59 ` Christian König
  0 siblings, 0 replies; 2+ messages in thread
From: Christian König @ 2020-09-09 11:59 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Hi Dan,

Am 09.09.20 um 13:49 schrieb Dan Carpenter:
> Hello Christian König,
>
> The patch 141b15e59175: "drm/nouveau: move io_reserve_lru handling
> into the driver v5" from Aug 21, 2020, leads to the following static
> checker warning:
>
> 	drivers/gpu/drm/nouveau/nouveau_ttm.c:148 nouveau_ttm_fault()
> 	warn: inconsistent returns '*bo->base.resv'.
>
> drivers/gpu/drm/nouveau/nouveau_ttm.c
>     126  static vm_fault_t nouveau_ttm_fault(struct vm_fault *vmf)
>     127  {
>     128          struct vm_area_struct *vma = vmf->vma;
>     129          struct ttm_buffer_object *bo = vma->vm_private_data;
>     130          pgprot_t prot;
>     131          vm_fault_t ret;
>     132
>     133          ret = ttm_bo_vm_reserve(bo, vmf);
>     134          if (ret)
>     135                  return ret;
>     136
>     137          nouveau_bo_del_io_reserve_lru(bo);
>     138
>     139          prot = vm_get_page_prot(vma->vm_flags);
>     140          ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT, 1);
>     141          if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT))
>     142                  return ret;
>                          ^^^^^^^^^^
> Call dma_resv_unlock() before returning?

No, this is correct. In the case of returning VM_FAULT_RETRY the 
function ttm_bo_vm_fault_reserved() has already dropped the lock for us.

Regards,
Christian.

>
>     143
>     144          nouveau_bo_add_io_reserve_lru(bo);
>     145
>     146          dma_resv_unlock(bo->base.resv);
>     147
>     148          return ret;
>     149  }
>
> regards,
> dan carpenter

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-09 11:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-09 11:49 [bug report] drm/nouveau: move io_reserve_lru handling into the driver v5 Dan Carpenter
2020-09-09 11:59 ` Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.