Move all drivers to a common dma-buf locking convention
Subsystems (22)
v7 cover Move all drivers to a common dma-buf locking convention
Hello,
This series moves all drivers to a dynamic dma-buf locking specification. From now on all dma-buf importers are made responsible for holding dma-buf's reservation lock around all operations performed over dma-bufs in accordance to the locking specification. This allows us to utilize reservation lock more broadly around kernel without fearing of a potential deadlocks.
This patchset passes all i915 selftests. It was also tested using VirtIO, Panfrost, Lima, Tegra, udmabuf, AMDGPU and Nouveau drivers. I tested cases of display+GPU, display+V4L and GPU+V4L dma-buf sharing (where appropriate), which covers majority of kernel drivers since rest of the drivers share same or similar code paths.
Changelog:
v7: - Rebased on top of recent drm-misc-next.
- Added ack from Jason Gunthorpe to the RDMA patch.
- Added iosys_map_clear() to dma_buf_vmap_unlocked(), making it fully consistent with dma_buf_vmap().
v6: - Added r-b from Michael Ruhl to the i915 patch.
- Added acks from Sumit Semwal and updated commit message of the "Move dma_buf_vmap() to dynamic locking specification" patch like was suggested by Sumit.
- Added "!dmabuf" check to dma_buf_vmap_unlocked() to match the locked variant of the function, for consistency.
v5: - Added acks and r-bs that were given to v4.
- Changed i915 preparation patch like was suggested by Michael Ruhl. The scope of reservation locking is smaller now.
v4: - Added dma_buf_mmap() to the "locking convention" documentation,
which was missed by accident in v3.
- Added acks from Christian König, Tomasz Figa and Hans Verkuil that they gave to couple v3 patches.
- Dropped the "_unlocked" postfix from function names that don't have the locked variant, as was requested by Christian König.
- Factored out the per-driver preparations into separate patches to ease reviewing of the changes, which is now doable without the global dma-buf functions renaming.
- Factored out the dynamic locking convention enforcements into separate patches which add the final dma_resv_assert_held(dmabuf->resv) to the dma-buf API functions.
v3: - Factored out dma_buf_mmap_unlocked() and attachment functions
into aseparate patches, like was suggested by Christian König.
- Corrected and factored out dma-buf locking documentation into a separate patch, like was suggested by Christian König.
- Intel driver dropped the reservation locking fews days ago from its BO-release code path, but we need that locking for the imported GEMs because in the end that code path unmaps the imported GEM. So I added back the locking needed by the imported GEMs, updating the "dma-buf attachment locking specification" patch appropriately.
- Tested Nouveau+Intel dma-buf import/export combo.
- Tested udmabuf import to i915/Nouveau/AMDGPU.
- Fixed few places in Etnaviv, Panfrost and Lima drivers that I missed to switch to locked dma-buf vmapping in the drm/gem: Take reservation lock for vmap/vunmap operations" patch. In a result invalidated the Christian's r-b that he gave to v2.
- Added locked dma-buf vmap/vunmap functions that are needed for fixing vmappping of Etnaviv, Panfrost and Lima drivers mentioned above. I actually had this change stashed for the drm-shmem shrinker patchset, but then realized that it's already needed by the dma-buf patches. Also improved my tests to better cover these code paths.
v2: - Changed locking specification to avoid problems with a cross-driver
ww locking, like was suggested by Christian König. Now the attach/detach callbacks are invoked without the held lock and exporter should take the lock.
- Added "locking convention" documentation that explains which dma-buf functions and callbacks are locked/unlocked for importers and exporters, which was requested by Christian König.
- Added ack from Tomasz Figa to the V4L patches that he gave to v1.
Dmitry Osipenko (21):
dma-buf: Add unlocked variant of vmapping functions
dma-buf: Add unlocked variant of attachment-mapping functions drm/gem: Take reservation lock for vmap/vunmap operations drm/prime: Prepare to dynamic dma-buf locking specification drm/armada: Prepare to dynamic dma-buf locking specification drm/i915: Prepare to dynamic dma-buf locking specification drm/omapdrm: Prepare to dynamic dma-buf locking specification drm/tegra: Prepare to dynamic dma-buf locking specification drm/etnaviv: Prepare to dynamic dma-buf locking specification RDMA/umem: Prepare to dynamic dma-buf locking specification
misc: fastrpc: Prepare to dynamic dma-buf locking specification xen/gntdev: Prepare to dynamic dma-buf locking specification
media: videobuf2: Prepare to dynamic dma-buf locking specification
media: tegra-vde: Prepare to dynamic dma-buf locking specification
dma-buf: Move dma_buf_vmap() to dynamic locking specification
dma-buf: Move dma_buf_attach() to dynamic locking specification
dma-buf: Move dma_buf_map_attachment() to dynamic locking
specification
dma-buf: Move dma_buf_mmap() to dynamic locking specification
dma-buf: Document dynamic locking convention
media: videobuf2: Stop using internal dma-buf lock
dma-buf: Remove obsoleted internal lock
Documentation/driver-api/dma-buf.rst | 6 + drivers/dma-buf/dma-buf.c | 216 +++++++++++++++--- drivers/gpu/drm/armada/armada_gem.c | 8 +- drivers/gpu/drm/drm_client.c | 4 +- drivers/gpu/drm/drm_gem.c | 24 ++ drivers/gpu/drm/drm_gem_dma_helper.c | 6 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 6 +- drivers/gpu/drm/drm_gem_ttm_helper.c | 9 +- drivers/gpu/drm/drm_prime.c | 6 +- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.c | 14 ++ .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 16 +- drivers/gpu/drm/lima/lima_sched.c | 4 +- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 4 +- drivers/gpu/drm/panfrost/panfrost_dump.c | 4 +- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 6 +- drivers/gpu/drm/qxl/qxl_object.c | 17 +- drivers/gpu/drm/qxl/qxl_prime.c | 4 +- drivers/gpu/drm/tegra/gem.c | 17 +- drivers/infiniband/core/umem_dmabuf.c | 7 +- .../common/videobuf2/videobuf2-dma-contig.c | 22 +- .../media/common/videobuf2/videobuf2-dma-sg.c | 19 +- .../common/videobuf2/videobuf2-vmalloc.c | 17 +- .../platform/nvidia/tegra-vde/dmabuf-cache.c | 6 +- drivers/misc/fastrpc.c | 6 +- drivers/xen/gntdev-dmabuf.c | 8 +- include/drm/drm_gem.h | 3 + include/linux/dma-buf.h | 17 +- 29 files changed, 325 insertions(+), 155 deletions(-)
Signature · 1 line
2.37.3
PATCH v7 1/21 dma-buf: Add unlocked variant of vmapping functions
Add unlocked variant of dma_buf_vmap/vunmap() that will be utilized by drivers that don't take the reservation lock explicitly.
--- drivers/dma-buf/dma-buf.c | 43 +++++++++++++++++++++++++++++++++++++++ include/linux/dma-buf.h | 2 ++ 2 files changed, 45 insertions(+)
drivers/dma-buf/dma-buf.c +43 -0
@@ -1425,6 +1425,33 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct iosys_map *map) }EXPORT_SYMBOL_NS_GPL (dma_buf_vmap,DMA_BUF ); +/** +* dma_buf_vmap_unlocked - Create virtual mapping for the buffer object into kernel +* address space. Same restrictions as for vmap and friends apply. +* @dmabuf: [in] buffer to vmap +* @map: [out] returns the vmap pointer +* +* Unlocked version of dma_buf_vmap() +* +* Returns 0 on success, or a negative errno code otherwise. +*/ +int dma_buf_vmap_unlocked (struct dma_buf *dmabuf,struct iosys_map *map) +{ +int ret; + +iosys_map_clear (map); + +if (WARN_ON (!dmabuf)) +return -EINVAL ; + +dma_resv_lock (dmabuf->resv,NULL ); + ret =dma_buf_vmap (dmabuf, map); +dma_resv_unlock (dmabuf->resv); + +return ret; +} +EXPORT_SYMBOL_NS_GPL (dma_buf_vmap_unlocked,DMA_BUF ); +/** * dma_buf_vunmap - Unmap a vmap obtained by dma_buf_vmap. * @dmabuf: [in] buffer to vunmap
@@ -1449,6 +1476,22 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, struct iosys_map *map) }EXPORT_SYMBOL_NS_GPL (dma_buf_vunmap,DMA_BUF ); +/** +* dma_buf_vunmap_unlocked - Unmap a vmap obtained by dma_buf_vmap. +* @dmabuf: [in] buffer to vunmap +* @map: [in] vmap pointer to vunmap +*/ +void dma_buf_vunmap_unlocked (struct dma_buf *dmabuf,struct iosys_map *map) +{ +if (WARN_ON (!dmabuf)) +return ; + +dma_resv_lock (dmabuf->resv,NULL ); +dma_buf_vunmap (dmabuf, map); +dma_resv_unlock (dmabuf->resv); +} +EXPORT_SYMBOL_NS_GPL (dma_buf_vunmap_unlocked,DMA_BUF ); +#ifdef CONFIG_DEBUG_FS static int dma_buf_debug_show (struct seq_file *s,void *unused) {
include/linux/dma-buf.h +2 -0
@@ -632,4 +632,6 @@ int dma_buf_mmap(struct dma_buf *, struct vm_area_struct *, unsigned long);int dma_buf_vmap (struct dma_buf *dmabuf,struct iosys_map *map);void dma_buf_vunmap (struct dma_buf *dmabuf,struct iosys_map *map); +int dma_buf_vmap_unlocked (struct dma_buf *dmabuf,struct iosys_map *map); +void dma_buf_vunmap_unlocked (struct dma_buf *dmabuf,struct iosys_map *map);#endif /* __DMA_BUF_H__ */
Signature · 1 line
2.37.3
PATCH v7 2/21 dma-buf: Add unlocked variant of attachment-mapping functions
In reply to Dmitry OsipenkoAdd unlocked variant of dma_buf_map/unmap_attachment() that will be used by drivers that don't take the reservation lock explicitly.
--- drivers/dma-buf/dma-buf.c | 53 +++++++++++++++++++++++++++++++++++++++ include/linux/dma-buf.h | 6 +++++ 2 files changed, 59 insertions(+)
drivers/dma-buf/dma-buf.c +53 -0
@@ -1100,6 +1100,34 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach, }EXPORT_SYMBOL_NS_GPL (dma_buf_map_attachment,DMA_BUF ); +/** +* dma_buf_map_attachment_unlocked - Returns the scatterlist table of the attachment; +* mapped into _device_ address space. Is a wrapper for map_dma_buf() of the +* dma_buf_ops. +* @attach: [in] attachment whose scatterlist is to be returned +* @direction: [in] direction of DMA transfer +* +* Unlocked variant of dma_buf_map_attachment(). +*/ +struct sg_table * +dma_buf_map_attachment_unlocked (struct dma_buf_attachment *attach, +enum dma_data_direction direction) +{ +struct sg_table *sg_table; + +might_sleep (); + +if (WARN_ON (!attach || !attach->dmabuf)) +return ERR_PTR (-EINVAL ); + +dma_resv_lock (attach->dmabuf->resv,NULL ); + sg_table =dma_buf_map_attachment (attach, direction); +dma_resv_unlock (attach->dmabuf->resv); + +return sg_table; +} +EXPORT_SYMBOL_NS_GPL (dma_buf_map_attachment_unlocked,DMA_BUF ); +/** * dma_buf_unmap_attachment - unmaps and decreases usecount of the buffer;might * deallocate the scatterlist associated. Is a wrapper for unmap_dma_buf() of
@@ -1136,6 +1164,31 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach, }EXPORT_SYMBOL_NS_GPL (dma_buf_unmap_attachment,DMA_BUF ); +/** +* dma_buf_unmap_attachment_unlocked - unmaps and decreases usecount of the buffer;might +* deallocate the scatterlist associated. Is a wrapper for unmap_dma_buf() of +* dma_buf_ops. +* @attach: [in] attachment to unmap buffer from +* @sg_table: [in] scatterlist info of the buffer to unmap +* @direction: [in] direction of DMA transfer +* +* Unlocked variant of dma_buf_unmap_attachment(). +*/ +void dma_buf_unmap_attachment_unlocked (struct dma_buf_attachment *attach, +struct sg_table *sg_table, +enum dma_data_direction direction) +{ +might_sleep (); + +if (WARN_ON (!attach || !attach->dmabuf || !sg_table)) +return ; + +dma_resv_lock (attach->dmabuf->resv,NULL ); +dma_buf_unmap_attachment (attach, sg_table, direction); +dma_resv_unlock (attach->dmabuf->resv); +} +EXPORT_SYMBOL_NS_GPL (dma_buf_unmap_attachment_unlocked,DMA_BUF ); +/** * dma_buf_move_notify - notify attachments that DMA-buf is moving *
include/linux/dma-buf.h +6 -0
@@ -627,6 +627,12 @@ int dma_buf_begin_cpu_access(struct dma_buf *dma_buf, enum dma_data_direction dir);int dma_buf_end_cpu_access (struct dma_buf *dma_buf,enum dma_data_direction dir); +struct sg_table * +dma_buf_map_attachment_unlocked (struct dma_buf_attachment *attach, +enum dma_data_direction direction); +void dma_buf_unmap_attachment_unlocked (struct dma_buf_attachment *attach, +struct sg_table *sg_table, +enum dma_data_direction direction);int dma_buf_mmap (struct dma_buf *,struct vm_area_struct *,unsigned long );
Signature · 1 line
2.37.3
PATCH v7 3/21 drm/gem: Take reservation lock for vmap/vunmap operations
In reply to Dmitry OsipenkoThe new common dma-buf locking convention will require buffer importers to hold the reservation lock around mapping operations. Make DRM GEM core to take the lock around the vmapping operations and update DRM drivers to use the locked functions for the case where DRM core now holds the lock. This patch prepares DRM core and drivers to the common dynamic dma-buf locking convention.
--- drivers/gpu/drm/drm_client.c | 4 ++-- drivers/gpu/drm/drm_gem.c | 24 ++++++++++++++++++++ drivers/gpu/drm/drm_gem_dma_helper.c | 6 ++--- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 6 ++--- drivers/gpu/drm/drm_gem_ttm_helper.c | 9 +------- drivers/gpu/drm/lima/lima_sched.c | 4 ++-- drivers/gpu/drm/panfrost/panfrost_dump.c | 4 ++-- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 6 ++--- drivers/gpu/drm/qxl/qxl_object.c | 17 +++++++------- drivers/gpu/drm/qxl/qxl_prime.c | 4 ++-- include/drm/drm_gem.h | 3 +++ 11 files changed, 54 insertions(+), 33 deletions(-)
drivers/gpu/drm/drm_client.c +2 -2
@@ -323,7 +323,7 @@ drm_client_buffer_vmap(struct drm_client_buffer *buffer,* fd_install step out of the driver backend hooks, to make that * final step optional for internal users. */ - ret =drm_gem_vmap (buffer->gem, map); + ret =drm_gem_vmap_unlocked (buffer->gem, map);if (ret)return ret;
@@ -345,7 +345,7 @@ void drm_client_buffer_vunmap(struct drm_client_buffer *buffer) {struct iosys_map *map = &buffer->map; -drm_gem_vunmap (buffer->gem, map); +drm_gem_vunmap_unlocked (buffer->gem, map); }EXPORT_SYMBOL (drm_client_buffer_vunmap);
drivers/gpu/drm/drm_gem.c +24 -0
@@ -1171,6 +1171,8 @@ int drm_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map) {int ret; +dma_resv_assert_held (obj->resv); +if (!obj->funcs->vmap)return -EOPNOTSUPP ;
@@ -1186,6 +1188,8 @@ EXPORT_SYMBOL(drm_gem_vmap);void drm_gem_vunmap (struct drm_gem_object *obj,struct iosys_map *map) { +dma_resv_assert_held (obj->resv); +if (iosys_map_is_null (map))return ;
@@ -1197,6 +1201,26 @@ void drm_gem_vunmap(struct drm_gem_object *obj, struct iosys_map *map) }EXPORT_SYMBOL (drm_gem_vunmap); +int drm_gem_vmap_unlocked (struct drm_gem_object *obj,struct iosys_map *map) +{ +int ret; + +dma_resv_lock (obj->resv,NULL ); + ret =drm_gem_vmap (obj, map); +dma_resv_unlock (obj->resv); + +return ret; +} +EXPORT_SYMBOL (drm_gem_vmap_unlocked); + +void drm_gem_vunmap_unlocked (struct drm_gem_object *obj,struct iosys_map *map) +{ +dma_resv_lock (obj->resv,NULL ); +drm_gem_vunmap (obj, map); +dma_resv_unlock (obj->resv); +} +EXPORT_SYMBOL (drm_gem_vunmap_unlocked); +/** * drm_gem_lock_reservations - Sets up the ww context and acquires * the lock on an array of GEM objects.
drivers/gpu/drm/drm_gem_dma_helper.c +3 -3
@@ -230,7 +230,7 @@ void drm_gem_dma_free(struct drm_gem_dma_object *dma_obj)if (gem_obj->import_attach) {if (dma_obj->vaddr) -dma_buf_vunmap (gem_obj->import_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (gem_obj->import_attach->dmabuf, &map);drm_prime_gem_destroy (gem_obj, dma_obj->sgt); }else if (dma_obj->vaddr) {if (dma_obj->map_noncoherent)
@@ -581,7 +581,7 @@ drm_gem_dma_prime_import_sg_table_vmap(struct drm_device *dev,struct iosys_map map;int ret; - ret =dma_buf_vmap (attach->dmabuf, &map); + ret =dma_buf_vmap_unlocked (attach->dmabuf, &map);if (ret) {DRM_ERROR ("Failed to vmap PRIME buffer\n" );return ERR_PTR (ret);
@@ -589,7 +589,7 @@ drm_gem_dma_prime_import_sg_table_vmap(struct drm_device *dev, obj =drm_gem_dma_prime_import_sg_table (dev, attach, sgt);if (IS_ERR (obj)) { -dma_buf_vunmap (attach->dmabuf, &map); +dma_buf_vunmap_unlocked (attach->dmabuf, &map);return obj; }
drivers/gpu/drm/drm_gem_framebuffer_helper.c +3 -3
@@ -354,7 +354,7 @@ int drm_gem_fb_vmap(struct drm_framebuffer *fb, struct iosys_map *map, ret = -EINVAL ; goto err_drm_gem_vunmap; } - ret =drm_gem_vmap (obj, &map[i]); + ret =drm_gem_vmap_unlocked (obj, &map[i]);if (ret) goto err_drm_gem_vunmap; }
@@ -376,7 +376,7 @@ int drm_gem_fb_vmap(struct drm_framebuffer *fb, struct iosys_map *map, obj =drm_gem_fb_get_obj (fb, i);if (!obj)continue ; -drm_gem_vunmap (obj, &map[i]); +drm_gem_vunmap_unlocked (obj, &map[i]); }return ret; }
@@ -403,7 +403,7 @@ void drm_gem_fb_vunmap(struct drm_framebuffer *fb, struct iosys_map *map)continue ;if (iosys_map_is_null (&map[i]))continue ; -drm_gem_vunmap (obj, &map[i]); +drm_gem_vunmap_unlocked (obj, &map[i]); } }EXPORT_SYMBOL (drm_gem_fb_vunmap);
drivers/gpu/drm/drm_gem_ttm_helper.c +1 -8
@@ -64,13 +64,8 @@ int drm_gem_ttm_vmap(struct drm_gem_object *gem, struct iosys_map *map) {struct ttm_buffer_object *bo =drm_gem_ttm_of_gem (gem); -int ret; - -dma_resv_lock (gem->resv,NULL ); - ret =ttm_bo_vmap (bo, map); -dma_resv_unlock (gem->resv); -return ret; +return ttm_bo_vmap (bo, map); }EXPORT_SYMBOL (drm_gem_ttm_vmap);
@@ -87,9 +82,7 @@ void drm_gem_ttm_vunmap(struct drm_gem_object *gem, {struct ttm_buffer_object *bo =drm_gem_ttm_of_gem (gem); -dma_resv_lock (gem->resv,NULL );ttm_bo_vunmap (bo, map); -dma_resv_unlock (gem->resv); }EXPORT_SYMBOL (drm_gem_ttm_vunmap);
drivers/gpu/drm/lima/lima_sched.c +2 -2
@@ -371,7 +371,7 @@ static void lima_sched_build_error_task_list(struct lima_sched_task *task) }else { buffer_chunk->size =lima_bo_size (bo); - ret =drm_gem_shmem_vmap (&bo->base, &map); + ret =drm_gem_vmap_unlocked (&bo->base.base, &map);if (ret) {kvfree (et); goto out;
@@ -379,7 +379,7 @@ static void lima_sched_build_error_task_list(struct lima_sched_task *task)memcpy (buffer_chunk +1 , map.vaddr, buffer_chunk->size); -drm_gem_shmem_vunmap (&bo->base, &map); +drm_gem_vunmap_unlocked (&bo->base.base, &map); } buffer_chunk = (void *)(buffer_chunk +1 ) + buffer_chunk->size;
drivers/gpu/drm/panfrost/panfrost_dump.c +2 -2
@@ -209,7 +209,7 @@ void panfrost_core_dump(struct panfrost_job *job) goto dump_header; } - ret =drm_gem_shmem_vmap (&bo->base, &map); + ret =drm_gem_vmap_unlocked (&bo->base.base, &map);if (ret) {dev_err (pfdev->dev,"Panfrost Dump: couldn't map Buffer Object\n" ); iter.hdr->bomap.valid =0 ;
@@ -236,7 +236,7 @@ void panfrost_core_dump(struct panfrost_job *job) vaddr = map.vaddr;memcpy (iter.data, vaddr, bo->base.base.size); -drm_gem_shmem_vunmap (&bo->base, &map); +drm_gem_vunmap_unlocked (&bo->base.base, &map); iter.hdr->bomap.valid =cpu_to_le32 (1 );
drivers/gpu/drm/panfrost/panfrost_perfcnt.c +3 -3
@@ -106,7 +106,7 @@ static int panfrost_perfcnt_enable_locked(struct panfrost_device *pfdev, goto err_close_bo; } - ret =drm_gem_shmem_vmap (bo, &map); + ret =drm_gem_vmap_unlocked (&bo->base, &map);if (ret) goto err_put_mapping; perfcnt->buf = map.vaddr;
@@ -165,7 +165,7 @@ static int panfrost_perfcnt_enable_locked(struct panfrost_device *pfdev,return 0 ; err_vunmap: -drm_gem_shmem_vunmap (bo, &map); +drm_gem_vunmap_unlocked (&bo->base, &map); err_put_mapping:panfrost_gem_mapping_put (perfcnt->mapping); err_close_bo:
@@ -195,7 +195,7 @@ static int panfrost_perfcnt_disable_locked(struct panfrost_device *pfdev, GPU_PERFCNT_CFG_MODE(GPU_PERFCNT_CFG_MODE_OFF)); perfcnt->user =NULL ; -drm_gem_shmem_vunmap (&perfcnt->mapping->obj->base, &map); +drm_gem_vunmap_unlocked (&perfcnt->mapping->obj->base.base, &map); perfcnt->buf =NULL ;panfrost_gem_close (&perfcnt->mapping->obj->base.base, file_priv);panfrost_mmu_as_put (pfdev, perfcnt->mapping->mmu);
drivers/gpu/drm/qxl/qxl_object.c +9 -8
@@ -168,9 +168,16 @@ int qxl_bo_vmap_locked(struct qxl_bo *bo, struct iosys_map *map) bo->map_count++; goto out; } - r =ttm_bo_vmap (&bo->tbo, &bo->map); + + r =__qxl_bo_pin (bo);if (r)return r; + + r =ttm_bo_vmap (&bo->tbo, &bo->map); +if (r) { +__qxl_bo_unpin (bo); +return r; + } bo->map_count =1 ;/* TODO: Remove kptr in favor of map everywhere. */
@@ -192,12 +199,6 @@ int qxl_bo_vmap(struct qxl_bo *bo, struct iosys_map *map)if (r)return r; - r =__qxl_bo_pin (bo); -if (r) { -qxl_bo_unreserve (bo); -return r; - } - r =qxl_bo_vmap_locked (bo, map);qxl_bo_unreserve (bo);return r;
@@ -247,6 +248,7 @@ void qxl_bo_vunmap_locked(struct qxl_bo *bo)return ; bo->kptr =NULL ;ttm_bo_vunmap (&bo->tbo, &bo->map); +__qxl_bo_unpin (bo); }int qxl_bo_vunmap (struct qxl_bo *bo)
@@ -258,7 +260,6 @@ int qxl_bo_vunmap(struct qxl_bo *bo)return r;qxl_bo_vunmap_locked (bo); -__qxl_bo_unpin (bo);qxl_bo_unreserve (bo);return 0 ; }
drivers/gpu/drm/qxl/qxl_prime.c +2 -2
@@ -59,7 +59,7 @@ int qxl_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)struct qxl_bo *bo =gem_to_qxl_bo (obj);int ret; - ret =qxl_bo_vmap (bo, map); + ret =qxl_bo_vmap_locked (bo, map);if (ret <0 )return ret;
@@ -71,5 +71,5 @@ void qxl_gem_prime_vunmap(struct drm_gem_object *obj, {struct qxl_bo *bo =gem_to_qxl_bo (obj); -qxl_bo_vunmap (bo); +qxl_bo_vunmap_locked (bo); }
include/drm/drm_gem.h +3 -0
@@ -408,6 +408,9 @@ struct page **drm_gem_get_pages(struct drm_gem_object *obj);void drm_gem_put_pages (struct drm_gem_object *obj,struct page **pages,bool dirty,bool accessed); +int drm_gem_vmap_unlocked (struct drm_gem_object *obj,struct iosys_map *map); +void drm_gem_vunmap_unlocked (struct drm_gem_object *obj,struct iosys_map *map); +int drm_gem_objects_lookup (struct drm_file *filp,void __user *bo_handles,int count,struct drm_gem_object ***objs_out);struct drm_gem_object *drm_gem_object_lookup (struct drm_file *filp,u32 handle);
Signature · 1 line
2.37.3
PATCH v7 4/21 drm/prime: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare DRM prime core to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/gpu/drm/drm_prime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_prime.c +3 -3
@@ -936,7 +936,7 @@ struct drm_gem_object *drm_gem_prime_import_dev(struct drm_device *dev,get_dma_buf (dma_buf); - sgt =dma_buf_map_attachment (attach,DMA_BIDIRECTIONAL ); + sgt =dma_buf_map_attachment_unlocked (attach,DMA_BIDIRECTIONAL );if (IS_ERR (sgt)) { ret =PTR_ERR (sgt); goto fail_detach;
@@ -954,7 +954,7 @@ struct drm_gem_object *drm_gem_prime_import_dev(struct drm_device *dev,return obj; fail_unmap: -dma_buf_unmap_attachment (attach, sgt,DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (attach, sgt,DMA_BIDIRECTIONAL ); fail_detach:dma_buf_detach (dma_buf, attach);dma_buf_put (dma_buf);
@@ -1052,7 +1052,7 @@ void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg) attach = obj->import_attach;if (sg) -dma_buf_unmap_attachment (attach, sg,DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (attach, sg,DMA_BIDIRECTIONAL ); dma_buf = attach->dmabuf;dma_buf_detach (attach->dmabuf, attach);/* remove the reference */
Signature · 1 line
2.37.3
PATCH v7 5/21 drm/armada: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare Armada driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/gpu/drm/armada/armada_gem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/armada/armada_gem.c +4 -4
@@ -66,8 +66,8 @@ void armada_gem_free_object(struct drm_gem_object *obj)if (dobj->obj.import_attach) {/* We only ever display imported data */ if (dobj->sgt) -dma_buf_unmap_attachment (dobj->obj.import_attach, - dobj->sgt,DMA_TO_DEVICE ); +dma_buf_unmap_attachment_unlocked (dobj->obj.import_attach, + dobj->sgt,DMA_TO_DEVICE );drm_prime_gem_destroy (&dobj->obj,NULL ); }
@@ -539,8 +539,8 @@ int armada_gem_map_import(struct armada_gem_object *dobj) {int ret; - dobj->sgt =dma_buf_map_attachment (dobj->obj.import_attach, -DMA_TO_DEVICE ); + dobj->sgt =dma_buf_map_attachment_unlocked (dobj->obj.import_attach, +DMA_TO_DEVICE );if (IS_ERR (dobj->sgt)) { ret =PTR_ERR (dobj->sgt); dobj->sgt =NULL ;
Signature · 1 line
2.37.3
PATCH v7 6/21 drm/i915: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare i915 driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions and handling cases where importer now holds the reservation lock.
--- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.c | 14 ++++++++++++++ .../gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c | 16 ++++++++-------- 3 files changed, 23 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +1 -1
@@ -72,7 +72,7 @@ static int i915_gem_dmabuf_vmap(struct dma_buf *dma_buf,struct drm_i915_gem_object *obj =dma_buf_to_obj (dma_buf);void *vaddr; - vaddr =i915_gem_object_pin_map_unlocked (obj,I915_MAP_WB ); + vaddr =i915_gem_object_pin_map (obj,I915_MAP_WB );if (IS_ERR (vaddr))return PTR_ERR (vaddr);
drivers/gpu/drm/i915/gem/i915_gem_object.c +14 -0
@@ -290,7 +290,21 @@ void __i915_gem_object_pages_fini(struct drm_i915_gem_object *obj)__i915_gem_object_free_mmaps (obj);atomic_set (&obj->mm.pages_pin_count,0 ); + +/* +* dma_buf_unmap_attachment() requires reservation to be +* locked. The imported GEM shouldn't share reservation lock +* and ttm_bo_cleanup_memtype_use() shouldn't be invoked for +* dma-buf, so it's safe to take the lock. +*/ +if (obj->base.import_attach) +i915_gem_object_lock (obj,NULL ); +__i915_gem_object_put_pages (obj); + +if (obj->base.import_attach) +i915_gem_object_unlock (obj); +GEM_BUG_ON (i915_gem_object_has_pages (obj)); }
drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +8 -8
@@ -213,7 +213,7 @@ static int igt_dmabuf_import_same_driver(struct drm_i915_private *i915, goto out_import; } - st =dma_buf_map_attachment (import_attach,DMA_BIDIRECTIONAL ); + st =dma_buf_map_attachment_unlocked (import_attach,DMA_BIDIRECTIONAL );if (IS_ERR (st)) { err =PTR_ERR (st); goto out_detach;
@@ -226,7 +226,7 @@ static int igt_dmabuf_import_same_driver(struct drm_i915_private *i915, timeout = -ETIME ; } err = timeout >0 ?0 : timeout; -dma_buf_unmap_attachment (import_attach, st,DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (import_attach, st,DMA_BIDIRECTIONAL ); out_detach:dma_buf_detach (dmabuf, import_attach); out_import:
@@ -296,7 +296,7 @@ static int igt_dmabuf_import(void *arg) goto out_obj; } - err =dma_buf_vmap (dmabuf, &map); + err =dma_buf_vmap_unlocked (dmabuf, &map); dma_map = err ?NULL : map.vaddr;if (!dma_map) {pr_err ("dma_buf_vmap failed\n" );
@@ -337,7 +337,7 @@ static int igt_dmabuf_import(void *arg) err =0 ; out_dma_map: -dma_buf_vunmap (dmabuf, &map); +dma_buf_vunmap_unlocked (dmabuf, &map); out_obj:i915_gem_object_put (obj); out_dmabuf:
@@ -358,7 +358,7 @@ static int igt_dmabuf_import_ownership(void *arg)if (IS_ERR (dmabuf))return PTR_ERR (dmabuf); - err =dma_buf_vmap (dmabuf, &map); + err =dma_buf_vmap_unlocked (dmabuf, &map); ptr = err ?NULL : map.vaddr;if (!ptr) {pr_err ("dma_buf_vmap failed\n" );
@@ -367,7 +367,7 @@ static int igt_dmabuf_import_ownership(void *arg) }memset (ptr,0xc5 ,PAGE_SIZE ); -dma_buf_vunmap (dmabuf, &map); +dma_buf_vunmap_unlocked (dmabuf, &map); obj =to_intel_bo (i915_gem_prime_import (&i915->drm, dmabuf));if (IS_ERR (obj)) {
@@ -418,7 +418,7 @@ static int igt_dmabuf_export_vmap(void *arg) }i915_gem_object_put (obj); - err =dma_buf_vmap (dmabuf, &map); + err =dma_buf_vmap_unlocked (dmabuf, &map); ptr = err ?NULL : map.vaddr;if (!ptr) {pr_err ("dma_buf_vmap failed\n" );
@@ -435,7 +435,7 @@ static int igt_dmabuf_export_vmap(void *arg)memset (ptr,0xc5 , dmabuf->size); err =0 ; -dma_buf_vunmap (dmabuf, &map); +dma_buf_vunmap_unlocked (dmabuf, &map); out:dma_buf_put (dmabuf);return err;
Signature · 1 line
2.37.3
PATCH v7 7/21 drm/omapdrm: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare OMAP DRM driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c +2 -2
@@ -125,7 +125,7 @@ struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,get_dma_buf (dma_buf); - sgt =dma_buf_map_attachment (attach,DMA_TO_DEVICE ); + sgt =dma_buf_map_attachment_unlocked (attach,DMA_TO_DEVICE );if (IS_ERR (sgt)) { ret =PTR_ERR (sgt); goto fail_detach;
@@ -142,7 +142,7 @@ struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,return obj; fail_unmap: -dma_buf_unmap_attachment (attach, sgt,DMA_TO_DEVICE ); +dma_buf_unmap_attachment_unlocked (attach, sgt,DMA_TO_DEVICE ); fail_detach:dma_buf_detach (dma_buf, attach);dma_buf_put (dma_buf);
Signature · 1 line
2.37.3
PATCH v7 8/21 drm/tegra: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare Tegra DRM driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/gpu/drm/tegra/gem.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/tegra/gem.c +9 -8
@@ -84,7 +84,7 @@ static struct host1x_bo_mapping *tegra_bo_pin(struct device *dev, struct host1x_ goto free; } - map->sgt =dma_buf_map_attachment (map->attach, direction); + map->sgt =dma_buf_map_attachment_unlocked (map->attach, direction);if (IS_ERR (map->sgt)) {dma_buf_detach (buf, map->attach); err =PTR_ERR (map->sgt);
@@ -160,7 +160,8 @@ static struct host1x_bo_mapping *tegra_bo_pin(struct device *dev, struct host1x_static void tegra_bo_unpin (struct host1x_bo_mapping *map) {if (map->attach) { -dma_buf_unmap_attachment (map->attach, map->sgt, map->direction); +dma_buf_unmap_attachment_unlocked (map->attach, map->sgt, + map->direction);dma_buf_detach (map->attach->dmabuf, map->attach); }else {dma_unmap_sgtable (map->dev, map->sgt, map->direction,0 );
@@ -181,7 +182,7 @@ static void *tegra_bo_mmap(struct host1x_bo *bo)if (obj->vaddr) {return obj->vaddr; }else if (obj->gem.import_attach) { - ret =dma_buf_vmap (obj->gem.import_attach->dmabuf, &map); + ret =dma_buf_vmap_unlocked (obj->gem.import_attach->dmabuf, &map);return ret ?NULL : map.vaddr; }else { return vmap(obj->pages, obj->num_pages, VM_MAP,
@@ -197,7 +198,7 @@ static void tegra_bo_munmap(struct host1x_bo *bo, void *addr)if (obj->vaddr)return ;else if (obj->gem.import_attach) -dma_buf_vunmap (obj->gem.import_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (obj->gem.import_attach->dmabuf, &map);else vunmap (addr); }
@@ -461,7 +462,7 @@ static struct tegra_bo *tegra_bo_import(struct drm_device *drm,get_dma_buf (buf); - bo->sgt =dma_buf_map_attachment (attach,DMA_TO_DEVICE ); + bo->sgt =dma_buf_map_attachment_unlocked (attach,DMA_TO_DEVICE );if (IS_ERR (bo->sgt)) { err =PTR_ERR (bo->sgt); goto detach;
@@ -479,7 +480,7 @@ static struct tegra_bo *tegra_bo_import(struct drm_device *drm, detach:if (!IS_ERR_OR_NULL (bo->sgt)) -dma_buf_unmap_attachment (attach, bo->sgt,DMA_TO_DEVICE ); +dma_buf_unmap_attachment_unlocked (attach, bo->sgt,DMA_TO_DEVICE );dma_buf_detach (buf, attach);dma_buf_put (buf);
@@ -508,8 +509,8 @@ void tegra_bo_free_object(struct drm_gem_object *gem)tegra_bo_iommu_unmap (tegra, bo);if (gem->import_attach) { -dma_buf_unmap_attachment (gem->import_attach, bo->sgt, -DMA_TO_DEVICE ); +dma_buf_unmap_attachment_unlocked (gem->import_attach, bo->sgt, +DMA_TO_DEVICE );drm_prime_gem_destroy (gem,NULL ); }else {tegra_bo_free (gem->dev, bo);
Signature · 1 line
2.37.3
PATCH v7 9/21 drm/etnaviv: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare Etnaviv driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +1 -1
@@ -65,7 +65,7 @@ static void etnaviv_gem_prime_release(struct etnaviv_gem_object *etnaviv_obj)struct iosys_map map =IOSYS_MAP_INIT_VADDR (etnaviv_obj->vaddr);if (etnaviv_obj->vaddr) -dma_buf_vunmap (etnaviv_obj->base.import_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (etnaviv_obj->base.import_attach->dmabuf, &map);/* Don't drop the pages for imported dmabuf, as they are not * ours, just free the array we allocated:
Signature · 1 line
2.37.3
PATCH v7 10/21 RDMA/umem: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare InfiniBand drivers to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/infiniband/core/umem_dmabuf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/infiniband/core/umem_dmabuf.c +4 -3
@@ -26,7 +26,8 @@ int ib_umem_dmabuf_map_pages(struct ib_umem_dmabuf *umem_dmabuf)if (umem_dmabuf->sgt) goto wait_fence; - sgt =dma_buf_map_attachment (umem_dmabuf->attach,DMA_BIDIRECTIONAL ); + sgt =dma_buf_map_attachment_unlocked (umem_dmabuf->attach, +DMA_BIDIRECTIONAL );if (IS_ERR (sgt))return PTR_ERR (sgt);
@@ -102,8 +103,8 @@ void ib_umem_dmabuf_unmap_pages(struct ib_umem_dmabuf *umem_dmabuf) umem_dmabuf->last_sg_trim =0 ; } -dma_buf_unmap_attachment (umem_dmabuf->attach, umem_dmabuf->sgt, -DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (umem_dmabuf->attach, umem_dmabuf->sgt, +DMA_BIDIRECTIONAL ); umem_dmabuf->sgt =NULL ; }
Signature · 1 line
2.37.3
PATCH v7 11/21 misc: fastrpc: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare fastrpc to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/misc/fastrpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/misc/fastrpc.c +3 -3
@@ -310,8 +310,8 @@ static void fastrpc_free_map(struct kref *ref)return ; } } -dma_buf_unmap_attachment (map->attach, map->table, -DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (map->attach, map->table, +DMA_BIDIRECTIONAL );dma_buf_detach (map->buf, map->attach);dma_buf_put (map->buf); }
@@ -726,7 +726,7 @@ static int fastrpc_map_create(struct fastrpc_user *fl, int fd, goto attach_err; } - map->table =dma_buf_map_attachment (map->attach,DMA_BIDIRECTIONAL ); + map->table =dma_buf_map_attachment_unlocked (map->attach,DMA_BIDIRECTIONAL );if (IS_ERR (map->table)) { err =PTR_ERR (map->table); goto map_err;
Signature · 1 line
2.37.3
PATCH v7 12/21 xen/gntdev: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare gntdev driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/xen/gntdev-dmabuf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/xen/gntdev-dmabuf.c +4 -4
@@ -600,7 +600,7 @@ dmabuf_imp_to_refs(struct gntdev_dmabuf_priv *priv, struct device *dev, gntdev_dmabuf->u.imp.attach = attach; - sgt =dma_buf_map_attachment (attach,DMA_BIDIRECTIONAL ); + sgt =dma_buf_map_attachment_unlocked (attach,DMA_BIDIRECTIONAL );if (IS_ERR (sgt)) { ret =ERR_CAST (sgt); goto fail_detach;
@@ -658,7 +658,7 @@ dmabuf_imp_to_refs(struct gntdev_dmabuf_priv *priv, struct device *dev, fail_end_access:dmabuf_imp_end_foreign_access (gntdev_dmabuf->u.imp.refs, count); fail_unmap: -dma_buf_unmap_attachment (attach, sgt,DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (attach, sgt,DMA_BIDIRECTIONAL ); fail_detach:dma_buf_detach (dma_buf, attach); fail_free_obj:
@@ -708,8 +708,8 @@ static int dmabuf_imp_release(struct gntdev_dmabuf_priv *priv, u32 fd) attach = gntdev_dmabuf->u.imp.attach;if (gntdev_dmabuf->u.imp.sgt) -dma_buf_unmap_attachment (attach, gntdev_dmabuf->u.imp.sgt, -DMA_BIDIRECTIONAL ); +dma_buf_unmap_attachment_unlocked (attach, gntdev_dmabuf->u.imp.sgt, +DMA_BIDIRECTIONAL ); dma_buf = attach->dmabuf;dma_buf_detach (attach->dmabuf, attach);dma_buf_put (dma_buf);
Signature · 1 line
2.37.3
PATCH v7 13/21 media: videobuf2: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare V4L2 memory allocators to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 11 ++++++----- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 8 ++++---- drivers/media/common/videobuf2/videobuf2-vmalloc.c | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-)
drivers/media/common/videobuf2/videobuf2-dma-contig.c +6 -5
@@ -101,7 +101,7 @@ static void *vb2_dc_vaddr(struct vb2_buffer *vb, void *buf_priv)if (buf->db_attach) {struct iosys_map map; -if (!dma_buf_vmap (buf->db_attach->dmabuf, &map)) +if (!dma_buf_vmap_unlocked (buf->db_attach->dmabuf, &map)) buf->vaddr = map.vaddr;return buf->vaddr;
@@ -711,7 +711,7 @@ static int vb2_dc_map_dmabuf(void *mem_priv) }/* get the associated scatterlist for this buffer */ - sgt =dma_buf_map_attachment (buf->db_attach, buf->dma_dir); + sgt =dma_buf_map_attachment_unlocked (buf->db_attach, buf->dma_dir);if (IS_ERR (sgt)) {pr_err ("Error getting dmabuf scatterlist\n" );return -EINVAL ;
@@ -722,7 +722,8 @@ static int vb2_dc_map_dmabuf(void *mem_priv)if (contig_size < buf->size) {pr_err ("contiguous chunk is too small %lu/%lu\n" , contig_size, buf->size); -dma_buf_unmap_attachment (buf->db_attach, sgt, buf->dma_dir); +dma_buf_unmap_attachment_unlocked (buf->db_attach, sgt, + buf->dma_dir);return -EFAULT ; }
@@ -750,10 +751,10 @@ static void vb2_dc_unmap_dmabuf(void *mem_priv) }if (buf->vaddr) { -dma_buf_vunmap (buf->db_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (buf->db_attach->dmabuf, &map); buf->vaddr =NULL ; } -dma_buf_unmap_attachment (buf->db_attach, sgt, buf->dma_dir); +dma_buf_unmap_attachment_unlocked (buf->db_attach, sgt, buf->dma_dir); buf->dma_addr =0 ; buf->dma_sgt =NULL ;
drivers/media/common/videobuf2/videobuf2-dma-sg.c +4 -4
@@ -309,7 +309,7 @@ static void *vb2_dma_sg_vaddr(struct vb2_buffer *vb, void *buf_priv)if (!buf->vaddr) {if (buf->db_attach) { - ret =dma_buf_vmap (buf->db_attach->dmabuf, &map); + ret =dma_buf_vmap_unlocked (buf->db_attach->dmabuf, &map); buf->vaddr = ret ?NULL : map.vaddr; }else { buf->vaddr =vm_map_ram (buf->pages, buf->num_pages,-1 );
@@ -565,7 +565,7 @@ static int vb2_dma_sg_map_dmabuf(void *mem_priv) }/* get the associated scatterlist for this buffer */ - sgt =dma_buf_map_attachment (buf->db_attach, buf->dma_dir); + sgt =dma_buf_map_attachment_unlocked (buf->db_attach, buf->dma_dir);if (IS_ERR (sgt)) {pr_err ("Error getting dmabuf scatterlist\n" );return -EINVAL ;
@@ -594,10 +594,10 @@ static void vb2_dma_sg_unmap_dmabuf(void *mem_priv) }if (buf->vaddr) { -dma_buf_vunmap (buf->db_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (buf->db_attach->dmabuf, &map); buf->vaddr =NULL ; } -dma_buf_unmap_attachment (buf->db_attach, sgt, buf->dma_dir); +dma_buf_unmap_attachment_unlocked (buf->db_attach, sgt, buf->dma_dir); buf->dma_sgt =NULL ; }
drivers/media/common/videobuf2/videobuf2-vmalloc.c +3 -3
@@ -376,7 +376,7 @@ static int vb2_vmalloc_map_dmabuf(void *mem_priv)struct iosys_map map;int ret; - ret =dma_buf_vmap (buf->dbuf, &map); + ret =dma_buf_vmap_unlocked (buf->dbuf, &map);if (ret)return -EFAULT ; buf->vaddr = map.vaddr;
@@ -389,7 +389,7 @@ static void vb2_vmalloc_unmap_dmabuf(void *mem_priv)struct vb2_vmalloc_buf *buf = mem_priv;struct iosys_map map =IOSYS_MAP_INIT_VADDR (buf->vaddr); -dma_buf_vunmap (buf->dbuf, &map); +dma_buf_vunmap_unlocked (buf->dbuf, &map); buf->vaddr =NULL ; }
@@ -399,7 +399,7 @@ static void vb2_vmalloc_detach_dmabuf(void *mem_priv)struct iosys_map map =IOSYS_MAP_INIT_VADDR (buf->vaddr);if (buf->vaddr) -dma_buf_vunmap (buf->dbuf, &map); +dma_buf_vunmap_unlocked (buf->dbuf, &map);kfree (buf); }
Signature · 1 line
2.37.3
Re: [PATCH v7 13/21] media: videobuf2: Prepare to dynamic dma-buf locking specification
Quoted 5 lines · Dmitry Osipenko
Prepare V4L2 memory allocators to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
Acked-by Tomasz Figa <[email protected]>
Thanks!
Hans
Quoted 119 lines
Acked-by Christian König <[email protected]>Signed-off-by Dmitry Osipenko <[email protected]>--- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 11 ++++++----- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 8 ++++---- drivers/media/common/videobuf2/videobuf2-vmalloc.c | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-)drivers/media/common/videobuf2/videobuf2-dma-contig.c +6
-5@@ -101,7 +101,7 @@ static void *vb2_dc_vaddr(struct vb2_buffer *vb, void *buf_priv)if (buf->db_attach) {struct iosys_map map; -if (!dma_buf_vmap (buf->db_attach->dmabuf, &map)) +if (!dma_buf_vmap_unlocked (buf->db_attach->dmabuf, &map)) buf->vaddr = map.vaddr;return buf->vaddr;@@ -711,7 +711,7 @@ static int vb2_dc_map_dmabuf(void *mem_priv) }/* get the associated scatterlist for this buffer */ - sgt =dma_buf_map_attachment (buf->db_attach, buf->dma_dir); + sgt =dma_buf_map_attachment_unlocked (buf->db_attach, buf->dma_dir);if (IS_ERR (sgt)) {pr_err ("Error getting dmabuf scatterlist\n" );return -EINVAL ;@@ -722,7 +722,8 @@ static int vb2_dc_map_dmabuf(void *mem_priv)if (contig_size < buf->size) {pr_err ("contiguous chunk is too small %lu/%lu\n" , contig_size, buf->size); -dma_buf_unmap_attachment (buf->db_attach, sgt, buf->dma_dir); +dma_buf_unmap_attachment_unlocked (buf->db_attach, sgt, + buf->dma_dir);return -EFAULT ; }@@ -750,10 +751,10 @@ static void vb2_dc_unmap_dmabuf(void *mem_priv) }if (buf->vaddr) { -dma_buf_vunmap (buf->db_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (buf->db_attach->dmabuf, &map); buf->vaddr =NULL ; } -dma_buf_unmap_attachment (buf->db_attach, sgt, buf->dma_dir); +dma_buf_unmap_attachment_unlocked (buf->db_attach, sgt, buf->dma_dir); buf->dma_addr =0 ; buf->dma_sgt =NULL ;drivers/media/common/videobuf2/videobuf2-dma-sg.c +4
-4@@ -309,7 +309,7 @@ static void *vb2_dma_sg_vaddr(struct vb2_buffer *vb, void *buf_priv)if (!buf->vaddr) {if (buf->db_attach) { - ret =dma_buf_vmap (buf->db_attach->dmabuf, &map); + ret =dma_buf_vmap_unlocked (buf->db_attach->dmabuf, &map); buf->vaddr = ret ?NULL : map.vaddr; }else { buf->vaddr =vm_map_ram (buf->pages, buf->num_pages,-1 );@@ -565,7 +565,7 @@ static int vb2_dma_sg_map_dmabuf(void *mem_priv) }/* get the associated scatterlist for this buffer */ - sgt =dma_buf_map_attachment (buf->db_attach, buf->dma_dir); + sgt =dma_buf_map_attachment_unlocked (buf->db_attach, buf->dma_dir);if (IS_ERR (sgt)) {pr_err ("Error getting dmabuf scatterlist\n" );return -EINVAL ;@@ -594,10 +594,10 @@ static void vb2_dma_sg_unmap_dmabuf(void *mem_priv) }if (buf->vaddr) { -dma_buf_vunmap (buf->db_attach->dmabuf, &map); +dma_buf_vunmap_unlocked (buf->db_attach->dmabuf, &map); buf->vaddr =NULL ; } -dma_buf_unmap_attachment (buf->db_attach, sgt, buf->dma_dir); +dma_buf_unmap_attachment_unlocked (buf->db_attach, sgt, buf->dma_dir); buf->dma_sgt =NULL ; }drivers/media/common/videobuf2/videobuf2-vmalloc.c +3
-3@@ -376,7 +376,7 @@ static int vb2_vmalloc_map_dmabuf(void *mem_priv)struct iosys_map map;int ret; - ret =dma_buf_vmap (buf->dbuf, &map); + ret =dma_buf_vmap_unlocked (buf->dbuf, &map);if (ret)return -EFAULT ; buf->vaddr = map.vaddr;@@ -389,7 +389,7 @@ static void vb2_vmalloc_unmap_dmabuf(void *mem_priv)struct vb2_vmalloc_buf *buf = mem_priv;struct iosys_map map =IOSYS_MAP_INIT_VADDR (buf->vaddr); -dma_buf_vunmap (buf->dbuf, &map); +dma_buf_vunmap_unlocked (buf->dbuf, &map); buf->vaddr =NULL ; }@@ -399,7 +399,7 @@ static void vb2_vmalloc_detach_dmabuf(void *mem_priv)struct iosys_map map =IOSYS_MAP_INIT_VADDR (buf->vaddr);if (buf->vaddr) -dma_buf_vunmap (buf->dbuf, &map); +dma_buf_vunmap_unlocked (buf->dbuf, &map);kfree (buf); }
PATCH v7 14/21 media: tegra-vde: Prepare to dynamic dma-buf locking specification
In reply to Dmitry OsipenkoPrepare Tegra video decoder driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
--- drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c +3 -3
@@ -38,7 +38,7 @@ static void tegra_vde_release_entry(struct tegra_vde_cache_entry *entry)if (entry->vde->domain)tegra_vde_iommu_unmap (entry->vde, entry->iova); -dma_buf_unmap_attachment (entry->a, entry->sgt, entry->dma_dir); +dma_buf_unmap_attachment_unlocked (entry->a, entry->sgt, entry->dma_dir);dma_buf_detach (dmabuf, entry->a);dma_buf_put (dmabuf);
@@ -102,7 +102,7 @@ int tegra_vde_dmabuf_cache_map(struct tegra_vde *vde, goto err_unlock; } - sgt =dma_buf_map_attachment (attachment, dma_dir); + sgt =dma_buf_map_attachment_unlocked (attachment, dma_dir);if (IS_ERR (sgt)) {dev_err (dev,"Failed to get dmabufs sg_table\n" ); err =PTR_ERR (sgt);
@@ -152,7 +152,7 @@ int tegra_vde_dmabuf_cache_map(struct tegra_vde *vde, err_free:kfree (entry); err_unmap: -dma_buf_unmap_attachment (attachment, sgt, dma_dir); +dma_buf_unmap_attachment_unlocked (attachment, sgt, dma_dir); err_detach:dma_buf_detach (dmabuf, attachment); err_unlock:
Signature · 1 line
2.37.3
Re: [PATCH v7 14/21] media: tegra-vde: Prepare to dynamic dma-buf locking specification
Quoted 5 lines · Dmitry Osipenko
Prepare Tegra video decoder driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions.
Acked-by Christian König <[email protected]>
Thanks!
Hans
Quoted 36 lines
Signed-off-by Dmitry Osipenko <[email protected]>--- drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c +3
-3@@ -38,7 +38,7 @@ static void tegra_vde_release_entry(struct tegra_vde_cache_entry *entry)if (entry->vde->domain)tegra_vde_iommu_unmap (entry->vde, entry->iova); -dma_buf_unmap_attachment (entry->a, entry->sgt, entry->dma_dir); +dma_buf_unmap_attachment_unlocked (entry->a, entry->sgt, entry->dma_dir);dma_buf_detach (dmabuf, entry->a);dma_buf_put (dmabuf);@@ -102,7 +102,7 @@ int tegra_vde_dmabuf_cache_map(struct tegra_vde *vde, goto err_unlock; } - sgt =dma_buf_map_attachment (attachment, dma_dir); + sgt =dma_buf_map_attachment_unlocked (attachment, dma_dir);if (IS_ERR (sgt)) {dev_err (dev,"Failed to get dmabufs sg_table\n" ); err =PTR_ERR (sgt);@@ -152,7 +152,7 @@ int tegra_vde_dmabuf_cache_map(struct tegra_vde *vde, err_free:kfree (entry); err_unmap: -dma_buf_unmap_attachment (attachment, sgt, dma_dir); +dma_buf_unmap_attachment_unlocked (attachment, sgt, dma_dir); err_detach:dma_buf_detach (dmabuf, attachment); err_unlock:
PATCH v7 15/21 dma-buf: Move dma_buf_vmap() to dynamic locking specification
In reply to Dmitry OsipenkoMove dma_buf_vmap/vunmap() functions to the dynamic locking specification by asserting that the reservation lock is held.
--- drivers/dma-buf/dma-buf.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/dma-buf/dma-buf.c +4 -0
@@ -1450,6 +1450,8 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct iosys_map *map)if (WARN_ON (!dmabuf))return -EINVAL ; +dma_resv_assert_held (dmabuf->resv); +if (!dmabuf->ops->vmap)return -EINVAL ;
@@ -1515,6 +1517,8 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, struct iosys_map *map)if (WARN_ON (!dmabuf))return ; +dma_resv_assert_held (dmabuf->resv); +BUG_ON (iosys_map_is_null (&dmabuf->vmap_ptr));BUG_ON (dmabuf->vmapping_counter ==0 );BUG_ON (!iosys_map_is_equal (&dmabuf->vmap_ptr, map));
Signature · 1 line
2.37.3
PATCH v7 16/21 dma-buf: Move dma_buf_attach() to dynamic locking specification
In reply to Dmitry OsipenkoMove dma-buf attachment API functions to the dynamic locking specification by taking the reservation lock around the mapping operations. The strict locking convention prevents deadlock situations for dma-buf importers and exporters.
--- drivers/dma-buf/dma-buf.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)
drivers/dma-buf/dma-buf.c +8 -12
@@ -859,8 +859,8 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev, dma_buf_is_dynamic(dmabuf)) {struct sg_table *sgt; +dma_resv_lock (attach->dmabuf->resv,NULL );if (dma_buf_is_dynamic (attach->dmabuf)) { -dma_resv_lock (attach->dmabuf->resv,NULL ); ret = dmabuf->ops->pin (attach);if (ret) goto err_unlock;
@@ -873,8 +873,7 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev, ret =PTR_ERR (sgt); goto err_unpin; } -if (dma_buf_is_dynamic (attach->dmabuf)) -dma_resv_unlock (attach->dmabuf->resv); +dma_resv_unlock (attach->dmabuf->resv); attach->sgt = sgt; attach->dir =DMA_BIDIRECTIONAL ; }
@@ -890,8 +889,7 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev, dmabuf->ops->unpin (attach); err_unlock: -if (dma_buf_is_dynamic (attach->dmabuf)) -dma_resv_unlock (attach->dmabuf->resv); +dma_resv_unlock (attach->dmabuf->resv);dma_buf_detach (dmabuf, attach);return ERR_PTR (ret);
@@ -937,21 +935,19 @@ void dma_buf_detach(struct dma_buf *dmabuf, struct dma_buf_attachment *attach)if (WARN_ON (!dmabuf || !attach))return ; +dma_resv_lock (attach->dmabuf->resv,NULL ); +if (attach->sgt) { -if (dma_buf_is_dynamic (attach->dmabuf)) -dma_resv_lock (attach->dmabuf->resv,NULL );__unmap_dma_buf (attach, attach->sgt, attach->dir); -if (dma_buf_is_dynamic (attach->dmabuf)) { +if (dma_buf_is_dynamic (attach->dmabuf)) dmabuf->ops->unpin (attach); -dma_resv_unlock (attach->dmabuf->resv); - } } - -dma_resv_lock (dmabuf->resv,NULL );list_del (&attach->node); +dma_resv_unlock (dmabuf->resv); +if (dmabuf->ops->detach) dmabuf->ops->detach (dmabuf, attach);
Signature · 1 line
2.37.3
PATCH v7 17/21 dma-buf: Move dma_buf_map_attachment() to dynamic locking specification
In reply to Dmitry OsipenkoMove dma-buf attachment mapping functions to the dynamic locking specification by asserting that the reservation lock is held.
--- drivers/dma-buf/dma-buf.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/dma-buf/dma-buf.c +2 -8
@@ -1038,8 +1038,7 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,if (WARN_ON (!attach || !attach->dmabuf))return ERR_PTR (-EINVAL ); -if (dma_buf_attachment_is_dynamic (attach)) -dma_resv_assert_held (attach->dmabuf->resv); +dma_resv_assert_held (attach->dmabuf->resv);if (attach->sgt) {/*
@@ -1054,7 +1053,6 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach, }if (dma_buf_is_dynamic (attach->dmabuf)) { -dma_resv_assert_held (attach->dmabuf->resv);if (!IS_ENABLED (CONFIG_DMABUF_MOVE_NOTIFY )) { r = attach->dmabuf->ops->pin (attach);if (r)
@@ -1143,15 +1141,11 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach,if (WARN_ON (!attach || !attach->dmabuf || !sg_table))return ; -if (dma_buf_attachment_is_dynamic (attach)) -dma_resv_assert_held (attach->dmabuf->resv); +dma_resv_assert_held (attach->dmabuf->resv);if (attach->sgt == sg_table)return ; -if (dma_buf_is_dynamic (attach->dmabuf)) -dma_resv_assert_held (attach->dmabuf->resv); -__unmap_dma_buf (attach, sg_table, direction); if (dma_buf_is_dynamic(attach->dmabuf) &&
Signature · 1 line
2.37.3
PATCH v7 18/21 dma-buf: Move dma_buf_mmap() to dynamic locking specification
In reply to Dmitry OsipenkoMove dma_buf_mmap() function to the dynamic locking specification by taking the reservation lock. Neither of the today's drivers take the reservation lock within the mmap() callback, hence it's safe to enforce the locking.
--- drivers/dma-buf/dma-buf.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/dma-buf/dma-buf.c +7 -1
@@ -1390,6 +1390,8 @@ EXPORT_SYMBOL_NS_GPL(dma_buf_end_cpu_access, DMA_BUF);int dma_buf_mmap (struct dma_buf *dmabuf,struct vm_area_struct *vma,unsigned long pgoff) { +int ret; +if (WARN_ON (!dmabuf || !vma))return -EINVAL ;
@@ -1410,7 +1412,11 @@ int dma_buf_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma,vma_set_file (vma, dmabuf->file); vma->vm_pgoff = pgoff; -return dmabuf->ops->mmap (dmabuf, vma); +dma_resv_lock (dmabuf->resv,NULL ); + ret = dmabuf->ops->mmap (dmabuf, vma); +dma_resv_unlock (dmabuf->resv); + +return ret; }EXPORT_SYMBOL_NS_GPL (dma_buf_mmap,DMA_BUF );
Signature · 1 line
2.37.3
Re: [PATCH v7 18/21] dma-buf: Move dma_buf_mmap() to dynamic locking specification
Quoted 9 lines · Dmitry Osipenko
Move
dma_buf_mmap()function to the dynamic locking specification by taking the reservation lock. Neither of the today's drivers take the reservation lock within themmap()callback, hence it's safe to enforce the locking.Acked-by Sumit Semwal <[email protected]>Acked-by Christian König <[email protected]>Signed-off-by Dmitry Osipenko <[email protected]>
Just noticed this while reading code ... this patch seems to have missed dma_buf_mmap_internal()?
Might be good if at least some drivers gain a dma_resv_assert_held in that path to make sure we're not quite this bad, together with fixing this issue.
-Daniel
Quoted 33 lines
--- drivers/dma-buf/dma-buf.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)drivers/dma-buf/dma-buf.c +7
-2@@ -1390,6 +1390,8 @@ EXPORT_SYMBOL_NS_GPL(dma_buf_end_cpu_access, DMA_BUF);int dma_buf_mmap (struct dma_buf *dmabuf,struct vm_area_struct *vma,unsigned long pgoff) { +int ret; +if (WARN_ON (!dmabuf || !vma))return -EINVAL ;@@ -1410,7 +1412,11 @@ int dma_buf_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma,vma_set_file (vma, dmabuf->file); vma->vm_pgoff = pgoff; -return dmabuf->ops->mmap (dmabuf, vma); +dma_resv_lock (dmabuf->resv,NULL ); + ret = dmabuf->ops->mmap (dmabuf, vma); +dma_resv_unlock (dmabuf->resv); + +return ret; }EXPORT_SYMBOL_NS_GPL (dma_buf_mmap,DMA_BUF ); --2.37.3
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Re: [PATCH v7 18/21] dma-buf: Move dma_buf_mmap() to dynamic locking specification
Quoted 8 lines · Daniel Vetter
Quoted 8 lines
Move
dma_buf_mmap()function to the dynamic locking specification by taking the reservation lock. Neither of the today's drivers take the reservation lock within themmap()callback, hence it's safe to enforce the locking.Acked-by Sumit Semwal <[email protected]>Acked-by Christian König <[email protected]>Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 6 lines
Just noticed this while reading code ... this patch seems to have missed
dma_buf_mmap_internal()?Might be good if at least some drivers gain a
dma_resv_assert_heldin that path to make sure we're not quite this bad, together with fixing this issue.
Good catch! I'll prepare the patches.
Signature · 2 lines
Best regards, Dmitry
PATCH v7 19/21 dma-buf: Document dynamic locking convention
In reply to Dmitry OsipenkoAdd documentation for the dynamic locking convention. The documentation tells dma-buf API users when they should take the reservation lock and when not.
--- Documentation/driver-api/dma-buf.rst | 6 +++ drivers/dma-buf/dma-buf.c | 64 ++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+)
Documentation/driver-api/dma-buf.rst +6 -0
@@ -119,6 +119,12 @@ DMA Buffer ioctls .. kernel-doc:: include/uapi/linux/dma-buf.h +DMA-BUF locking convention +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. kernel-doc:: drivers/dma-buf/dma-buf.c + :doc: locking convention + Kernel Functions and Structures Reference ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma-buf/dma-buf.c +64 -0
70 lines not on this page · raw message
Signature · 1 line
2.37.3
PATCH v7 20/21 media: videobuf2: Stop using internal dma-buf lock
In reply to Dmitry OsipenkoAll drivers that use dma-bufs have been moved to the updated locking specification and now dma-buf reservation is guaranteed to be locked by importers during the mapping operations. There is no need to take the internal dma-buf lock anymore. Remove locking from the videobuf2 memory allocators.
--- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 11 +---------- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 11 +---------- drivers/media/common/videobuf2/videobuf2-vmalloc.c | 11 +---------- 3 files changed, 3 insertions(+), 30 deletions(-)
drivers/media/common/videobuf2/videobuf2-dma-contig.c +1 -10
@@ -382,18 +382,12 @@ static struct sg_table *vb2_dc_dmabuf_ops_map( struct dma_buf_attachment *db_attach, enum dma_data_direction dma_dir) { struct vb2_dc_attachment *attach = db_attach->priv; -/* stealing dmabuf mutex to serialize map/unmap operations */ -struct mutex *lock = &db_attach->dmabuf->lock;struct sg_table *sgt; -mutex_lock (lock); - sgt = &attach->sgt;/* return previously mapped sg table */ -if (attach->dma_dir == dma_dir) { -mutex_unlock (lock); +if (attach->dma_dir == dma_dir)return sgt; - }/* release any previous cache */ if (attach->dma_dir !=DMA_NONE ) {
@@ -409,14 +403,11 @@ static struct sg_table *vb2_dc_dmabuf_ops_map(if (dma_map_sgtable (db_attach->dev, sgt, dma_dir,DMA_ATTR_SKIP_CPU_SYNC )) {pr_err ("failed to map scatterlist\n" ); -mutex_unlock (lock);return ERR_PTR (-EIO ); } attach->dma_dir = dma_dir; -mutex_unlock (lock); -return sgt; }
drivers/media/common/videobuf2/videobuf2-dma-sg.c +1 -10
@@ -424,18 +424,12 @@ static struct sg_table *vb2_dma_sg_dmabuf_ops_map( struct dma_buf_attachment *db_attach, enum dma_data_direction dma_dir) { struct vb2_dma_sg_attachment *attach = db_attach->priv; -/* stealing dmabuf mutex to serialize map/unmap operations */ -struct mutex *lock = &db_attach->dmabuf->lock;struct sg_table *sgt; -mutex_lock (lock); - sgt = &attach->sgt;/* return previously mapped sg table */ -if (attach->dma_dir == dma_dir) { -mutex_unlock (lock); +if (attach->dma_dir == dma_dir)return sgt; - }/* release any previous cache */ if (attach->dma_dir !=DMA_NONE ) {
@@ -446,14 +440,11 @@ static struct sg_table *vb2_dma_sg_dmabuf_ops_map(/* mapping to the client with new direction */ if (dma_map_sgtable (db_attach->dev, sgt, dma_dir,0 )) {pr_err ("failed to map scatterlist\n" ); -mutex_unlock (lock);return ERR_PTR (-EIO ); } attach->dma_dir = dma_dir; -mutex_unlock (lock); -return sgt; }
drivers/media/common/videobuf2/videobuf2-vmalloc.c +1 -10
@@ -267,18 +267,12 @@ static struct sg_table *vb2_vmalloc_dmabuf_ops_map( struct dma_buf_attachment *db_attach, enum dma_data_direction dma_dir) { struct vb2_vmalloc_attachment *attach = db_attach->priv; -/* stealing dmabuf mutex to serialize map/unmap operations */ -struct mutex *lock = &db_attach->dmabuf->lock;struct sg_table *sgt; -mutex_lock (lock); - sgt = &attach->sgt;/* return previously mapped sg table */ -if (attach->dma_dir == dma_dir) { -mutex_unlock (lock); +if (attach->dma_dir == dma_dir)return sgt; - }/* release any previous cache */ if (attach->dma_dir !=DMA_NONE ) {
@@ -289,14 +283,11 @@ static struct sg_table *vb2_vmalloc_dmabuf_ops_map(/* mapping to the client with new direction */ if (dma_map_sgtable (db_attach->dev, sgt, dma_dir,0 )) {pr_err ("failed to map scatterlist\n" ); -mutex_unlock (lock);return ERR_PTR (-EIO ); } attach->dma_dir = dma_dir; -mutex_unlock (lock); -return sgt; }
Signature · 1 line
2.37.3
PATCH v7 21/21 dma-buf: Remove obsoleted internal lock
In reply to Dmitry OsipenkoThe internal dma-buf lock isn't needed anymore because the updated locking specification claims that dma-buf reservation must be locked by importers, and thus, the internal data is already protected by the reservation lock. Remove the obsoleted internal lock.
--- drivers/dma-buf/dma-buf.c | 14 ++++---------- include/linux/dma-buf.h | 9 --------- 2 files changed, 4 insertions(+), 19 deletions(-)
drivers/dma-buf/dma-buf.c +4 -10
@@ -657,7 +657,6 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info) dmabuf->file = file; -mutex_init (&dmabuf->lock);INIT_LIST_HEAD (&dmabuf->attachments);mutex_lock (&db_list.lock);
@@ -1503,7 +1502,7 @@ EXPORT_SYMBOL_NS_GPL(dma_buf_mmap, DMA_BUF);int dma_buf_vmap (struct dma_buf *dmabuf,struct iosys_map *map) {struct iosys_map ptr; -int ret =0 ; +int ret;iosys_map_clear (map);
@@ -1515,28 +1514,25 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct iosys_map *map)if (!dmabuf->ops->vmap)return -EINVAL ; -mutex_lock (&dmabuf->lock);if (dmabuf->vmapping_counter) { dmabuf->vmapping_counter++;BUG_ON (iosys_map_is_null (&dmabuf->vmap_ptr)); *map = dmabuf->vmap_ptr; - goto out_unlock; +return 0 ; }BUG_ON (iosys_map_is_set (&dmabuf->vmap_ptr)); ret = dmabuf->ops->vmap (dmabuf, &ptr);if (WARN_ON_ONCE (ret)) - goto out_unlock; +return ret; dmabuf->vmap_ptr = ptr; dmabuf->vmapping_counter =1 ; *map = dmabuf->vmap_ptr; -out_unlock: -mutex_unlock (&dmabuf->lock); -return ret; +return 0 ; }EXPORT_SYMBOL_NS_GPL (dma_buf_vmap,DMA_BUF );
@@ -1583,13 +1579,11 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, struct iosys_map *map)BUG_ON (dmabuf->vmapping_counter ==0 );BUG_ON (!iosys_map_is_equal (&dmabuf->vmap_ptr, map)); -mutex_lock (&dmabuf->lock);if (--dmabuf->vmapping_counter ==0 ) {if (dmabuf->ops->vunmap) dmabuf->ops->vunmap (dmabuf, map);iosys_map_clear (&dmabuf->vmap_ptr); } -mutex_unlock (&dmabuf->lock); }EXPORT_SYMBOL_NS_GPL (dma_buf_vunmap,DMA_BUF );
include/linux/dma-buf.h +0 -9
@@ -326,15 +326,6 @@ struct dma_buf {/** @ops: dma_buf_ops associated with this buffer object. */ const struct dma_buf_ops *ops; -/** -* @lock: -* -* Used internally to serialize list manipulation, attach/detach and -* vmap/unmap. Note that in many cases this is superseeded by -* dma_resv_lock() on @resv. -*/ -struct mutex lock; -/** * @vmapping_counter: *
Signature · 1 line
2.37.3
Patchwork
CI[Intel-gfx] ✗ Fi.CI.SPARSE: warning for Move all drivers to a common dma-buf locking convention
In reply to Dmitry Osipenko== Series Details ==
== Series Details ==
Series: Move all drivers to a common dma-buf locking convention
URL : https://patchwork.freedesktop.org/series/109786/
State : warning
== Summary ==
Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
Patchwork
CI[Intel-gfx] ✓ Fi.CI.BAT: success for Move all drivers to a common dma-buf locking convention
In reply to Dmitry Osipenko== Series Details ==
== Series Details ==
Series: Move all drivers to a common dma-buf locking convention
URL : https://patchwork.freedesktop.org/series/109786/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_12251 -> Patchwork_109786v1
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/index.html
Participating hosts (44 -> 45)
------------------------------
Additional (3): fi-hsw-4770 fi-rkl-11600 bat-atsm-1
Missing (2): fi-glk-j4005 fi-bdw-samus
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_109786v1:
### IGT changes ###
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* igt@runner@aborted:
- {bat-atsm-1}: NOTRUN -> [FAIL][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/bat-atsm-1/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_109786v1 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_softpin@allocator-basic-reserve:
- fi-hsw-4770: NOTRUN -> [SKIP][2] ([fdo#109271]) +9 similar issues
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/fi-hsw-4770/igt@[email protected]
* igt@i915_pm_backlight@basic-brightness:
- fi-hsw-4770: NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#3012])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/fi-hsw-4770/igt@[email protected]
* igt@i915_pm_rpm@module-reload:
- fi-hsw-4770: NOTRUN -> [INCOMPLETE][4] ([i915#7221])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/fi-hsw-4770/igt@[email protected]
* igt@kms_chamelium@dp-crc-fast:
- fi-hsw-4770: NOTRUN -> [SKIP][5] ([fdo#109271] / [fdo#111827]) +7 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/fi-hsw-4770/igt@[email protected]
* igt@kms_psr@sprite_plane_onoff:
- fi-hsw-4770: NOTRUN -> [SKIP][6] ([fdo#109271] / [i915#1072]) +3 similar issues
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/fi-hsw-4770/igt@kms_psr@sprite_plane_onoff.html
* igt@runner@aborted:
- fi-hsw-4770: NOTRUN -> [FAIL][7] ([fdo#109271] / [i915#4312] / [i915#5594])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/fi-hsw-4770/igt@[email protected]
- fi-rkl-11600: NOTRUN -> [FAIL][8] ([i915#7220])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/fi-rkl-11600/igt@[email protected]
#### Possible fixes ####
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size:
- fi-bsw-kefka: [FAIL][9] ([i915#6298]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html
#### Warnings ####
* igt@i915_suspend@basic-s3-without-i915:
- fi-bdw-gvtdvm: [FAIL][11] ([fdo#103375]) -> [INCOMPLETE][12] ([i915#146])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/fi-bdw-gvtdvm/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/fi-bdw-gvtdvm/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#146]: https://gitlab.freedesktop.org/drm/intel/issues/146
[i915#3012]: https://gitlab.freedesktop.org/drm/intel/issues/3012
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#5594]: https://gitlab.freedesktop.org/drm/intel/issues/5594
[i915#6298]: https://gitlab.freedesktop.org/drm/intel/issues/6298
[i915#7220]: https://gitlab.freedesktop.org/drm/intel/issues/7220
[i915#7221]: https://gitlab.freedesktop.org/drm/intel/issues/7221
Build changes
-------------
* Linux: CI_DRM_12251 -> Patchwork_109786v1
CI-20190529: 20190529
CI_DRM_12251: ff61e79b01712f5d31a4c4f23c6971bbaa71cecb @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7016: 642f4bf44e2b42791b4d1684936a1bfbe2d099ee @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_109786v1: ff61e79b01712f5d31a4c4f23c6971bbaa71cecb @ git://anongit.freedesktop.org/gfx-ci/linux
### Linux commits
90439219037f dma-buf: Remove obsoleted internal lock92b9f4fc64f6 media: videobuf2: Stop using internal dma-buf lock cadec1dd4852 dma-buf: Document dynamic locking convention387381d70d48 dma-buf: Move dma_buf_mmap() to dynamic locking specification 0c26569fff4b dma-buf: Move dma_buf_map_attachment() to dynamic locking specification 502fab6dc886 dma-buf: Move dma_buf_attach() to dynamic locking specification de336404aff1 dma-buf: Move dma_buf_vmap() to dynamic locking specification 7aa48f9b1e50 media: tegra-vde: Prepare to dynamic dma-buf locking specification b7edd76c5b55 media: videobuf2: Prepare to dynamic dma-buf locking specification 72834d9ae115 xen/gntdev: Prepare to dynamic dma-buf locking specification 7d938b2523eb misc: fastrpc: Prepare to dynamic dma-buf locking specification e0fc5d899f04 RDMA/umem: Prepare to dynamic dma-buf locking specification 7e5934d86acd drm/etnaviv: Prepare to dynamic dma-buf locking specification cd58d4b8bf3b drm/tegra: Prepare to dynamic dma-buf locking specification f1b579909ecd drm/omapdrm: Prepare to dynamic dma-buf locking specification 79087e4aecb4 drm/i915: Prepare to dynamic dma-buf locking specification b85e435fc4e5 drm/armada: Prepare to dynamic dma-buf locking specification 4b4bf0858e18 drm/prime: Prepare to dynamic dma-buf locking specification d09b239bb5b0 drm/gem: Take reservation lock for vmap/vunmap operations 9a538c534c80 dma-buf: Add unlocked variant of attachment-mapping functions e230b24fc66d dma-buf: Add unlocked variant of vmapping functions
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/index.html
Dmitry Osipenko
AppliedQuoted 139 lines · Dmitry Osipenko
Hello,
This series moves all drivers to a dynamic dma-buf locking specification. From now on all dma-buf importers are made responsible for holding dma-buf's reservation lock around all operations performed over dma-bufs in accordance to the locking specification. This allows us to utilize reservation lock more broadly around kernel without fearing of a potential deadlocks.
This patchset passes all i915 selftests. It was also tested using VirtIO, Panfrost, Lima, Tegra, udmabuf, AMDGPU and Nouveau drivers. I tested cases of display+GPU, display+V4L and GPU+V4L dma-buf sharing (where appropriate), which covers majority of kernel drivers since rest of the drivers share same or similar code paths.
Changelog:
v7: - Rebased on top of recent drm-misc-next.
- Added ack from Jason Gunthorpe to the RDMA patch.
- Added
iosys_map_clear()todma_buf_vmap_unlocked(), making it fully consistent withdma_buf_vmap().v6: - Added r-b from Michael Ruhl to the i915 patch.
- Added acks from Sumit Semwal and updated commit message of the "Move
dma_buf_vmap()to dynamic locking specification" patch like was suggested by Sumit.- Added "!dmabuf" check to
dma_buf_vmap_unlocked()to match the locked variant of the function, for consistency.v5: - Added acks and r-bs that were given to v4.
- Changed i915 preparation patch like was suggested by Michael Ruhl. The scope of reservation locking is smaller now.
v4: - Added
dma_buf_mmap()to the "locking convention" documentation,
which was missed by accident in v3.- Added acks from Christian König, Tomasz Figa and Hans Verkuil that they gave to couple v3 patches.
- Dropped the "
_unlocked" postfix from function names that don't have the locked variant, as was requested by Christian König.- Factored out the per-driver preparations into separate patches to ease reviewing of the changes, which is now doable without the global dma-buf functions renaming.
- Factored out the dynamic locking convention enforcements into separate patches which add the final
dma_resv_assert_held(dmabuf->resv)to the dma-buf API functions.v3: - Factored out
dma_buf_mmap_unlocked()and attachment functions
into aseparate patches, like was suggested by Christian König.- Corrected and factored out dma-buf locking documentation into a separate patch, like was suggested by Christian König.
- Intel driver dropped the reservation locking fews days ago from its BO-release code path, but we need that locking for the imported GEMs because in the end that code path unmaps the imported GEM. So I added back the locking needed by the imported GEMs, updating the "dma-buf attachment locking specification" patch appropriately.
- Tested Nouveau+Intel dma-buf import/export combo.
- Tested udmabuf import to i915/Nouveau/AMDGPU.
- Fixed few places in Etnaviv, Panfrost and Lima drivers that I missed to switch to locked dma-buf vmapping in the drm/gem: Take reservation lock for vmap/vunmap operations" patch. In a result invalidated the Christian's r-b that he gave to v2.
- Added locked dma-buf vmap/vunmap functions that are needed for fixing vmappping of Etnaviv, Panfrost and Lima drivers mentioned above. I actually had this change stashed for the drm-shmem shrinker patchset, but then realized that it's already needed by the dma-buf patches. Also improved my tests to better cover these code paths.
v2: - Changed locking specification to avoid problems with a cross-driver
ww locking, like was suggested by Christian König. Now the attach/detach callbacks are invoked without the held lock and exporter should take the lock.- Added "locking convention" documentation that explains which dma-buf functions and callbacks are locked/unlocked for importers and exporters, which was requested by Christian König.
- Added ack from Tomasz Figa to the V4L patches that he gave to v1.
Dmitry Osipenko (21):
dma-buf: Add unlocked variant of vmapping functions
dma-buf: Add unlocked variant of attachment-mapping functions drm/gem: Take reservation lock for vmap/vunmap operations drm/prime: Prepare to dynamic dma-buf locking specification drm/armada: Prepare to dynamic dma-buf locking specification drm/i915: Prepare to dynamic dma-buf locking specification drm/omapdrm: Prepare to dynamic dma-buf locking specification drm/tegra: Prepare to dynamic dma-buf locking specification drm/etnaviv: Prepare to dynamic dma-buf locking specification RDMA/umem: Prepare to dynamic dma-buf locking specification
misc: fastrpc: Prepare to dynamic dma-buf locking specification xen/gntdev: Prepare to dynamic dma-buf locking specification
media: videobuf2: Prepare to dynamic dma-buf locking specification
media: tegra-vde: Prepare to dynamic dma-buf locking specification
dma-buf: Movedma_buf_vmap()to dynamic locking specification
dma-buf: Movedma_buf_attach()to dynamic locking specification
dma-buf: Movedma_buf_map_attachment()to dynamic locking
specification
dma-buf: Movedma_buf_mmap()to dynamic locking specification
dma-buf: Document dynamic locking convention
media: videobuf2: Stop using internal dma-buf lock
dma-buf: Remove obsoleted internal lockDocumentation/driver-api/dma-buf.rst | 6 + drivers/dma-buf/dma-buf.c | 216 +++++++++++++++--- drivers/gpu/drm/armada/armada_gem.c | 8 +- drivers/gpu/drm/drm_client.c | 4 +- drivers/gpu/drm/drm_gem.c | 24 ++ drivers/gpu/drm/drm_gem_dma_helper.c | 6 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 6 +- drivers/gpu/drm/drm_gem_ttm_helper.c | 9 +- drivers/gpu/drm/drm_prime.c | 6 +- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.c | 14 ++ .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 16 +- drivers/gpu/drm/lima/lima_sched.c | 4 +- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 4 +- drivers/gpu/drm/panfrost/panfrost_dump.c | 4 +- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 6 +- drivers/gpu/drm/qxl/qxl_object.c | 17 +- drivers/gpu/drm/qxl/qxl_prime.c | 4 +- drivers/gpu/drm/tegra/gem.c | 17 +- drivers/infiniband/core/umem_dmabuf.c | 7 +- .../common/videobuf2/videobuf2-dma-contig.c | 22 +-
Quoted 9 lines
.../media/common/videobuf2/videobuf2-dma-sg.c | 19 +- .../common/videobuf2/videobuf2-vmalloc.c | 17 +- .../platform/nvidia/tegra-vde/dmabuf-cache.c | 6 +- drivers/misc/fastrpc.c | 6 +- drivers/xen/gntdev-dmabuf.c | 8 +- include/drm/drm_gem.h | 3 + include/linux/dma-buf.h | 17 +- 29 files changed, 325 insertions(+), 155 deletions(-)
Applied to drm-misc-next
Signature · 2 lines
Best regards, Dmitry
Christian König
maintainerAm 18.10.22 um 01:07 schrieb Dmitry Osipenko:
Quoted 149 lines · Dmitry Osipenko
Quoted 139 lines
Hello,
This series moves all drivers to a dynamic dma-buf locking specification.
From now on all dma-buf importers are made responsible for holding
dma-buf's reservation lock around all operations performed over dma-bufs in accordance to the locking specification. This allows us to utilize reservation lock more broadly around kernel without fearing of a potential deadlocks.This patchset passes all i915 selftests. It was also tested using VirtIO, Panfrost, Lima, Tegra, udmabuf, AMDGPU and Nouveau drivers. I tested cases of display+GPU, display+V4L and GPU+V4L dma-buf sharing (where appropriate), which covers majority of kernel drivers since rest of the drivers share same or similar code paths.
Changelog:
v7: - Rebased on top of recent drm-misc-next.
- Added ack from Jason Gunthorpe to the RDMA patch.
- Added
iosys_map_clear()todma_buf_vmap_unlocked(), making it fully consistent withdma_buf_vmap().v6: - Added r-b from Michael Ruhl to the i915 patch.
- Added acks from Sumit Semwal and updated commit message of the "Move
dma_buf_vmap()to dynamic locking specification" patch like was suggested by Sumit.- Added "!dmabuf" check to
dma_buf_vmap_unlocked()to match the locked variant of the function, for consistency.v5: - Added acks and r-bs that were given to v4.
- Changed i915 preparation patch like was suggested by Michael Ruhl. The scope of reservation locking is smaller now.
v4: - Added
dma_buf_mmap()to the "locking convention" documentation,
which was missed by accident in v3.- Added acks from Christian König, Tomasz Figa and Hans Verkuil that they gave to couple v3 patches.
- Dropped the "
_unlocked" postfix from function names that don't have the locked variant, as was requested by Christian König.- Factored out the per-driver preparations into separate patches to ease reviewing of the changes, which is now doable without the global dma-buf functions renaming.
- Factored out the dynamic locking convention enforcements into separate patches which add the final
dma_resv_assert_held(dmabuf->resv)to the dma-buf API functions.v3: - Factored out
dma_buf_mmap_unlocked()and attachment functions
into aseparate patches, like was suggested by Christian König.- Corrected and factored out dma-buf locking documentation into a separate patch, like was suggested by Christian König.
- Intel driver dropped the reservation locking fews days ago from its BO-release code path, but we need that locking for the imported GEMs because in the end that code path unmaps the imported GEM. So I added back the locking needed by the imported GEMs, updating the "dma-buf attachment locking specification" patch appropriately.
- Tested Nouveau+Intel dma-buf import/export combo.
- Tested udmabuf import to i915/Nouveau/AMDGPU.
- Fixed few places in Etnaviv, Panfrost and Lima drivers that I missed to switch to locked dma-buf vmapping in the drm/gem: Take reservation lock for vmap/vunmap operations" patch. In a result invalidated the Christian's r-b that he gave to v2.
- Added locked dma-buf vmap/vunmap functions that are needed for fixing vmappping of Etnaviv, Panfrost and Lima drivers mentioned above. I actually had this change stashed for the drm-shmem shrinker patchset, but then realized that it's already needed by the dma-buf patches. Also improved my tests to better cover these code paths.
v2: - Changed locking specification to avoid problems with a cross-driver
ww locking, like was suggested by Christian König. Now the attach/detach callbacks are invoked without the held lock and exporter should take the lock.- Added "locking convention" documentation that explains which dma-buf functions and callbacks are locked/unlocked for importers and exporters, which was requested by Christian König.
- Added ack from Tomasz Figa to the V4L patches that he gave to v1.
Dmitry Osipenko (21):
dma-buf: Add unlocked variant of vmapping functions
dma-buf: Add unlocked variant of attachment-mapping functions drm/gem: Take reservation lock for vmap/vunmap operations drm/prime: Prepare to dynamic dma-buf locking specification drm/armada: Prepare to dynamic dma-buf locking specification drm/i915: Prepare to dynamic dma-buf locking specification drm/omapdrm: Prepare to dynamic dma-buf locking specification drm/tegra: Prepare to dynamic dma-buf locking specification drm/etnaviv: Prepare to dynamic dma-buf locking specification RDMA/umem: Prepare to dynamic dma-buf locking specification
misc: fastrpc: Prepare to dynamic dma-buf locking specification xen/gntdev: Prepare to dynamic dma-buf locking specification
media: videobuf2: Prepare to dynamic dma-buf locking specification
media: tegra-vde: Prepare to dynamic dma-buf locking specification
dma-buf: Movedma_buf_vmap()to dynamic locking specification
dma-buf: Movedma_buf_attach()to dynamic locking specification
dma-buf: Movedma_buf_map_attachment()to dynamic locking
specification
dma-buf: Movedma_buf_mmap()to dynamic locking specification
dma-buf: Document dynamic locking convention
media: videobuf2: Stop using internal dma-buf lock
dma-buf: Remove obsoleted internal lockDocumentation/driver-api/dma-buf.rst | 6 + drivers/dma-buf/dma-buf.c | 216 +++++++++++++++--- drivers/gpu/drm/armada/armada_gem.c | 8 +- drivers/gpu/drm/drm_client.c | 4 +- drivers/gpu/drm/drm_gem.c | 24 ++ drivers/gpu/drm/drm_gem_dma_helper.c | 6 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 6 +- drivers/gpu/drm/drm_gem_ttm_helper.c | 9 +- drivers/gpu/drm/drm_prime.c | 6 +- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.c | 14 ++ .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 16 +- drivers/gpu/drm/lima/lima_sched.c | 4 +- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 4 +- drivers/gpu/drm/panfrost/panfrost_dump.c | 4 +- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 6 +- drivers/gpu/drm/qxl/qxl_object.c | 17 +- drivers/gpu/drm/qxl/qxl_prime.c | 4 +- drivers/gpu/drm/tegra/gem.c | 17 +- drivers/infiniband/core/umem_dmabuf.c | 7 +- .../common/videobuf2/videobuf2-dma-contig.c | 22 +-Quoted 9 lines
.../media/common/videobuf2/videobuf2-dma-sg.c | 19 +- .../common/videobuf2/videobuf2-vmalloc.c | 17 +- .../platform/nvidia/tegra-vde/dmabuf-cache.c | 6 +- drivers/misc/fastrpc.c | 6 +- drivers/xen/gntdev-dmabuf.c | 8 +- include/drm/drm_gem.h | 3 + include/linux/dma-buf.h | 17 +- 29 files changed, 325 insertions(+), 155 deletions(-)
Quoted 1 line
Applied to drm-misc-next
Finally! Fingers crossed that all corner cases where fixed during the review.
But if anything shows up feel free to loop me in to help fixing things.
Thanks a lot for doing this,
Christian.
Quoted 177 lines · Christian König
Am 18.10.22 um 01:07 schrieb Dmitry Osipenko:
Quoted 174 lines · Dmitry Osipenko
Quoted 171 lines
Hello,
This series moves all drivers to a dynamic dma-buf locking specification.
From now on all dma-buf importers are made responsible for holding dma-buf's reservation lock around all operations performed over dma-bufs in accordance to the locking specification. This allows us to utilize reservation lock more broadly around kernel without fearing of a potential
deadlocks.This patchset passes all i915 selftests. It was also tested using VirtIO,
Panfrost, Lima, Tegra, udmabuf, AMDGPU and Nouveau drivers. I tested cases
of display+GPU, display+V4L and GPU+V4L dma-buf sharing (where appropriate),
which covers majority of kernel drivers since rest of the drivers share same or similar code paths.Changelog:
v7: - Rebased on top of recent drm-misc-next.
- Added ack from Jason Gunthorpe to the RDMA patch.
- Added
iosys_map_clear()todma_buf_vmap_unlocked(), making it fully
consistent withdma_buf_vmap().v6: - Added r-b from Michael Ruhl to the i915 patch.
- Added acks from Sumit Semwal and updated commit message of the "Move
dma_buf_vmap()to dynamic locking specification" patch like was suggested by Sumit.- Added "!dmabuf" check to
dma_buf_vmap_unlocked()to match the locked
variant of the function, for consistency.v5: - Added acks and r-bs that were given to v4.
- Changed i915 preparation patch like was suggested by Michael Ruhl.
The scope of reservation locking is smaller now.v4: - Added
dma_buf_mmap()to the "locking convention" documentation, which was missed by accident in v3.- Added acks from Christian König, Tomasz Figa and Hans Verkuil that
they gave to couple v3 patches.- Dropped the "
_unlocked" postfix from function names that don't have
the locked variant, as was requested by Christian König.- Factored out the per-driver preparations into separate patches to ease reviewing of the changes, which is now doable without the global dma-buf functions renaming.
- Factored out the dynamic locking convention enforcements into separate
patches which add the finaldma_resv_assert_held(dmabuf->resv)to the
dma-buf API functions.v3: - Factored out
dma_buf_mmap_unlocked()and attachment functions into aseparate patches, like was suggested by Christian König.- Corrected and factored out dma-buf locking documentation into a separate patch, like was suggested by Christian König.
- Intel driver dropped the reservation locking fews days ago from its BO-release code path, but we need that locking for the imported
GEMs because in the end that code path unmaps the imported GEM. So I added back the locking needed by the imported GEMs, updating the "dma-buf attachment locking specification" patch appropriately.- Tested Nouveau+Intel dma-buf import/export combo.
- Tested udmabuf import to i915/Nouveau/AMDGPU.
- Fixed few places in Etnaviv, Panfrost and Lima drivers that I missed
to switch to locked dma-buf vmapping in the drm/gem: Take reservation
lock for vmap/vunmap operations" patch. In a result invalidated the
Christian's r-b that he gave to v2.- Added locked dma-buf vmap/vunmap functions that are needed for fixing
vmappping of Etnaviv, Panfrost and Lima drivers mentioned above. I actually had this change stashed for the drm-shmem shrinker patchset,
but then realized that it's already needed by the dma-buf patches.
Also improved my tests to better cover these code paths.v2: - Changed locking specification to avoid problems with a cross-driver
ww locking, like was suggested by Christian König. Now the attach/detach
callbacks are invoked without the held lock and exporter should take the
lock.- Added "locking convention" documentation that explains which dma-buf
functions and callbacks are locked/unlocked for importers and exporters,
which was requested by Christian König.- Added ack from Tomasz Figa to the V4L patches that he gave to v1.
Dmitry Osipenko (21):
dma-buf: Add unlocked variant of vmapping functions
dma-buf: Add unlocked variant of attachment-mapping functions drm/gem: Take reservation lock for vmap/vunmap operations drm/prime: Prepare to dynamic dma-buf locking specification drm/armada: Prepare to dynamic dma-buf locking specification drm/i915: Prepare to dynamic dma-buf locking specification drm/omapdrm: Prepare to dynamic dma-buf locking specification drm/tegra: Prepare to dynamic dma-buf locking specification drm/etnaviv: Prepare to dynamic dma-buf locking specification RDMA/umem: Prepare to dynamic dma-buf locking specification
misc: fastrpc: Prepare to dynamic dma-buf locking specification xen/gntdev: Prepare to dynamic dma-buf locking specification
media: videobuf2: Prepare to dynamic dma-buf locking specification
media: tegra-vde: Prepare to dynamic dma-buf locking specification
dma-buf: Movedma_buf_vmap()to dynamic locking specification
dma-buf: Movedma_buf_attach()to dynamic locking specification
dma-buf: Movedma_buf_map_attachment()to dynamic locking specification
dma-buf: Movedma_buf_mmap()to dynamic locking specification
dma-buf: Document dynamic locking convention
media: videobuf2: Stop using internal dma-buf lock
dma-buf: Remove obsoleted internal lockDocumentation/driver-api/dma-buf.rst | 6 + drivers/dma-buf/dma-buf.c | 216 +++++++++++++++--- drivers/gpu/drm/armada/armada_gem.c | 8 +- drivers/gpu/drm/drm_client.c | 4 +- drivers/gpu/drm/drm_gem.c | 24 ++ drivers/gpu/drm/drm_gem_dma_helper.c | 6 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 6 +- drivers/gpu/drm/drm_gem_ttm_helper.c | 9 +- drivers/gpu/drm/drm_prime.c | 6 +- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.c | 14 ++ .../drm/i915/gem/selftests/i915_gem_dmabuf.c | 16 +- drivers/gpu/drm/lima/lima_sched.c | 4 +- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 4 +- drivers/gpu/drm/panfrost/panfrost_dump.c | 4 +- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 6 +- drivers/gpu/drm/qxl/qxl_object.c | 17 +- drivers/gpu/drm/qxl/qxl_prime.c | 4 +- drivers/gpu/drm/tegra/gem.c | 17 +- drivers/infiniband/core/umem_dmabuf.c | 7 +- .../common/videobuf2/videobuf2-dma-contig.c | 22 +-
.../media/common/videobuf2/videobuf2-dma-sg.c| 19 +- .../common/videobuf2/videobuf2-vmalloc.c | 17 +- .../platform/nvidia/tegra-vde/dmabuf-cache.c | 6 +- drivers/misc/fastrpc.c | 6 +- drivers/xen/gntdev-dmabuf.c | 8 +- include/drm/drm_gem.h | 3 + include/linux/dma-buf.h | 17 +-Quoted 2 lines
29 files changed, 325 insertions(+), 155 deletions(-)Quoted 1 line
Applied to drm-misc-next
Quoted 7 lines
Finally! Fingers crossed that all corner cases where fixed during the review.
But if anything shows up feel free to loop me in to help fixing things.
Thanks a lot for doing this,
Christian.
I'll ping you if anything will show up. Thank you!
Signature · 2 lines
Best regards, Dmitry
Patchwork
CI[Intel-gfx] ✗ Fi.CI.IGT: failure for Move all drivers to a common dma-buf locking convention
In reply to Dmitry Osipenko== Series Details ==
== Series Details ==
Series: Move all drivers to a common dma-buf locking convention
URL : https://patchwork.freedesktop.org/series/109786/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_12251_full -> Patchwork_109786v1_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_109786v1_full absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_109786v1_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
Participating hosts (12 -> 10)
------------------------------
Missing (2): pig-skl-6260u shard-tglu
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_109786v1_full:
### IGT changes ###
#### Possible regressions ####
* igt@i915_suspend@debugfs-reader:
- shard-apl: NOTRUN -> [INCOMPLETE][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-apl8/igt@[email protected]
#### Warnings ####
* igt@gem_pwrite@basic-exhaustion:
- shard-apl: [INCOMPLETE][2] ([i915#7234]) -> [INCOMPLETE][3]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-apl7/igt@[email protected]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-apl3/igt@[email protected]
* igt@gem_softpin@noreloc-s3:
- shard-apl: [INCOMPLETE][4] ([i915#7236]) -> [INCOMPLETE][5]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-apl8/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-apl7/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_109786v1_full that come from known issues:
### CI changes ###
#### Possible fixes ####
* boot:
- shard-snb: ([PASS][6], [PASS][7], [PASS][8], [PASS][9], [PASS][10], [PASS][11], [PASS][12], [PASS][13], [FAIL][14], [PASS][15], [PASS][16], [PASS][17], [PASS][18], [PASS][19], [PASS][20], [PASS][21], [PASS][22], [PASS][23], [PASS][24], [PASS][25], [PASS][26], [PASS][27], [PASS][28], [PASS][29], [PASS][30]) ([i915#4338]) -> ([PASS][31], [PASS][32], [PASS][33], [PASS][34], [PASS][35], [PASS][36], [PASS][37], [PASS][38], [PASS][39], [PASS][40], [PASS][41], [PASS][42], [PASS][43], [PASS][44], [PASS][45], [PASS][46], [PASS][47], [PASS][48], [PASS][49], [PASS][50], [PASS][51], [PASS][52], [PASS][53], [PASS][54], [PASS][55])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb7/boot.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb7/boot.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb7/boot.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb7/boot.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb6/boot.html
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb6/boot.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb6/boot.html
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb6/boot.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb6/boot.html
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb5/boot.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb5/boot.html
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb5/boot.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb5/boot.html
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb5/boot.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb5/boot.html
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb4/boot.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb4/boot.html
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb4/boot.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb4/boot.html
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb4/boot.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb2/boot.html
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb2/boot.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb2/boot.html
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb2/boot.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb2/boot.html
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb7/boot.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb7/boot.html
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb7/boot.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb7/boot.html
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb7/boot.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb6/boot.html
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb6/boot.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb6/boot.html
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb6/boot.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb6/boot.html
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb5/boot.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb5/boot.html
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb5/boot.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb5/boot.html
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb4/boot.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb4/boot.html
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb4/boot.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb4/boot.html
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb4/boot.html
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb4/boot.html
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb2/boot.html
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb2/boot.html
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb2/boot.html
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb2/boot.html
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb2/boot.html
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-tglb: [PASS][56] -> [FAIL][57] ([i915#2842])
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-tglb1/igt@gem_exec_fair@[email protected]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-tglb1/igt@gem_exec_fair@[email protected]
* igt@i915_module_load@reload-with-fault-injection:
- shard-tglb: [PASS][58] -> [INCOMPLETE][59] ([i915#7243])
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-tglb7/igt@[email protected]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-tglb2/igt@[email protected]
* igt@kms_big_fb@4-tiled-8bpp-rotate-180:
- shard-apl: NOTRUN -> [SKIP][60] ([fdo#109271]) +2 similar issues
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-apl8/igt@[email protected]
* igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip:
- shard-tglb: [PASS][61] -> [FAIL][62] ([i915#3743])
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-tglb1/igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip.html
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-tglb1/igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip.html
* igt@kms_chamelium@hdmi-aspect-ratio:
- shard-snb: NOTRUN -> [SKIP][63] ([fdo#109271] / [fdo#111827]) +1 similar issue
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb5/igt@[email protected]
* igt@kms_rotation_crc@bad-pixel-format:
- shard-snb: NOTRUN -> [SKIP][64] ([fdo#109271]) +75 similar issues
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb5/igt@[email protected]
* igt@kms_vblank@pipe-a-ts-continuation-dpms-suspend:
- shard-snb: NOTRUN -> [FAIL][65] ([fdo#103375]) +1 similar issue
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb5/igt@[email protected]
#### Possible fixes ####
* igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip:
- shard-tglb: [FAIL][66] ([i915#3743]) -> [PASS][67]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-tglb1/igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip.html
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-tglb7/igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip.html
* igt@kms_frontbuffer_tracking@fbc-rgb101010-draw-pwrite:
- shard-snb: [SKIP][68] ([fdo#109271]) -> [PASS][69]
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb2/igt@[email protected]
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb6/igt@[email protected]
#### Warnings ####
* igt@gem_pwrite@basic-exhaustion:
- shard-tglb: [INCOMPLETE][70] ([i915#7237]) -> [WARN][71] ([i915#2658])
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-tglb7/igt@[email protected]
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-tglb2/igt@[email protected]
* igt@i915_selftest@mock@requests:
- shard-snb: [DMESG-FAIL][72] ([i915#7226]) -> [INCOMPLETE][73] ([i915#7226])
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb4/igt@i915_selftest@[email protected]
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/shard-snb5/igt@i915_selftest@[email protected]
[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#2658]: https://gitlab.freedesktop.org/drm/intel/issues/2658
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#3743]: https://gitlab.freedesktop.org/drm/intel/issues/3743
[i915#4338]: https://gitlab.freedesktop.org/drm/intel/issues/4338
[i915#7226]: https://gitlab.freedesktop.org/drm/intel/issues/7226
[i915#7234]: https://gitlab.freedesktop.org/drm/intel/issues/7234
[i915#7236]: https://gitlab.freedesktop.org/drm/intel/issues/7236
[i915#7237]: https://gitlab.freedesktop.org/drm/intel/issues/7237
[i915#7243]: https://gitlab.freedesktop.org/drm/intel/issues/7243
Build changes
-------------
* Linux: CI_DRM_12251 -> Patchwork_109786v1
CI-20190529: 20190529
CI_DRM_12251: ff61e79b01712f5d31a4c4f23c6971bbaa71cecb @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7016: 642f4bf44e2b42791b4d1684936a1bfbe2d099ee @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_109786v1: ff61e79b01712f5d31a4c4f23c6971bbaa71cecb @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109786v1/index.html