Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dma-buf: Rename dma_buf_move_notify() to dma_buf_invalidate_mappings()

Along with renaming the .move_notify() callback, rename the corresponding
dma-buf core function. This makes the expected behavior clear to exporters
calling this function.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20260124-dmabuf-revoke-v5-2-f98fca917e96@nvidia.com
Signed-off-by: Christian König <christian.koenig@amd.com>

authored by

Leon Romanovsky and committed by
Christian König
95308225 ef246da8

+10 -10
+4 -4
drivers/dma-buf/dma-buf.c
··· 981 981 * 3. Exporters must hold the dma-buf reservation lock when calling these 982 982 * functions: 983 983 * 984 - * - dma_buf_move_notify() 984 + * - dma_buf_invalidate_mappings() 985 985 */ 986 986 987 987 /** ··· 1323 1323 EXPORT_SYMBOL_NS_GPL(dma_buf_unmap_attachment_unlocked, "DMA_BUF"); 1324 1324 1325 1325 /** 1326 - * dma_buf_move_notify - notify attachments that DMA-buf is moving 1326 + * dma_buf_invalidate_mappings - notify attachments that DMA-buf is moving 1327 1327 * 1328 1328 * @dmabuf: [in] buffer which is moving 1329 1329 * 1330 1330 * Informs all attachments that they need to destroy and recreate all their 1331 1331 * mappings. 1332 1332 */ 1333 - void dma_buf_move_notify(struct dma_buf *dmabuf) 1333 + void dma_buf_invalidate_mappings(struct dma_buf *dmabuf) 1334 1334 { 1335 1335 struct dma_buf_attachment *attach; 1336 1336 ··· 1340 1340 if (attach->importer_ops) 1341 1341 attach->importer_ops->invalidate_mappings(attach); 1342 1342 } 1343 - EXPORT_SYMBOL_NS_GPL(dma_buf_move_notify, "DMA_BUF"); 1343 + EXPORT_SYMBOL_NS_GPL(dma_buf_invalidate_mappings, "DMA_BUF"); 1344 1344 1345 1345 /** 1346 1346 * DOC: cpu access
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
··· 1270 1270 1271 1271 if (abo->tbo.base.dma_buf && !drm_gem_is_imported(&abo->tbo.base) && 1272 1272 old_mem && old_mem->mem_type != TTM_PL_SYSTEM) 1273 - dma_buf_move_notify(abo->tbo.base.dma_buf); 1273 + dma_buf_invalidate_mappings(abo->tbo.base.dma_buf); 1274 1274 1275 1275 /* move_notify is called before move happens */ 1276 1276 trace_amdgpu_bo_move(abo, new_mem ? new_mem->mem_type : -1,
+1 -1
drivers/gpu/drm/xe/xe_bo.c
··· 819 819 820 820 /* Don't call move_notify() for imported dma-bufs. */ 821 821 if (ttm_bo->base.dma_buf && !ttm_bo->base.import_attach) 822 - dma_buf_move_notify(ttm_bo->base.dma_buf); 822 + dma_buf_invalidate_mappings(ttm_bo->base.dma_buf); 823 823 824 824 /* 825 825 * TTM has already nuked the mmap for us (see ttm_bo_unmap_virtual),
+1 -1
drivers/iommu/iommufd/selftest.c
··· 2073 2073 priv = dmabuf->priv; 2074 2074 dma_resv_lock(dmabuf->resv, NULL); 2075 2075 priv->revoked = revoked; 2076 - dma_buf_move_notify(dmabuf); 2076 + dma_buf_invalidate_mappings(dmabuf); 2077 2077 dma_resv_unlock(dmabuf->resv); 2078 2078 2079 2079 err_put:
+2 -2
drivers/vfio/pci/vfio_pci_dmabuf.c
··· 320 320 if (priv->revoked != revoked) { 321 321 dma_resv_lock(priv->dmabuf->resv, NULL); 322 322 priv->revoked = revoked; 323 - dma_buf_move_notify(priv->dmabuf); 323 + dma_buf_invalidate_mappings(priv->dmabuf); 324 324 dma_resv_unlock(priv->dmabuf->resv); 325 325 } 326 326 fput(priv->dmabuf->file); ··· 341 341 list_del_init(&priv->dmabufs_elm); 342 342 priv->vdev = NULL; 343 343 priv->revoked = true; 344 - dma_buf_move_notify(priv->dmabuf); 344 + dma_buf_invalidate_mappings(priv->dmabuf); 345 345 dma_resv_unlock(priv->dmabuf->resv); 346 346 vfio_device_put_registration(&vdev->vdev); 347 347 fput(priv->dmabuf->file);
+1 -1
include/linux/dma-buf.h
··· 588 588 enum dma_data_direction); 589 589 void dma_buf_unmap_attachment(struct dma_buf_attachment *, struct sg_table *, 590 590 enum dma_data_direction); 591 - void dma_buf_move_notify(struct dma_buf *dma_buf); 591 + void dma_buf_invalidate_mappings(struct dma_buf *dma_buf); 592 592 int dma_buf_begin_cpu_access(struct dma_buf *dma_buf, 593 593 enum dma_data_direction dir); 594 594 int dma_buf_end_cpu_access(struct dma_buf *dma_buf,