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 .move_notify() callback to a clearer identifier

Rename the .move_notify() callback to .invalidate_mappings() to make its
purpose explicit and highlight that it is responsible for invalidating
existing mappings.

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

authored by

Leon Romanovsky and committed by
Christian König
ef246da8 68e28fac

+17 -17
+3 -3
drivers/dma-buf/dma-buf.c
··· 1017 1017 if (WARN_ON(!dmabuf || !dev)) 1018 1018 return ERR_PTR(-EINVAL); 1019 1019 1020 - if (WARN_ON(importer_ops && !importer_ops->move_notify)) 1020 + if (WARN_ON(importer_ops && !importer_ops->invalidate_mappings)) 1021 1021 return ERR_PTR(-EINVAL); 1022 1022 1023 1023 attach = kzalloc(sizeof(*attach), GFP_KERNEL); ··· 1130 1130 * 1131 1131 * This unpins a buffer pinned by dma_buf_pin() and allows the exporter to move 1132 1132 * any mapping of @attach again and inform the importer through 1133 - * &dma_buf_attach_ops.move_notify. 1133 + * &dma_buf_attach_ops.invalidate_mappings. 1134 1134 */ 1135 1135 void dma_buf_unpin(struct dma_buf_attachment *attach) 1136 1136 { ··· 1338 1338 1339 1339 list_for_each_entry(attach, &dmabuf->attachments, node) 1340 1340 if (attach->importer_ops) 1341 - attach->importer_ops->move_notify(attach); 1341 + attach->importer_ops->invalidate_mappings(attach); 1342 1342 } 1343 1343 EXPORT_SYMBOL_NS_GPL(dma_buf_move_notify, "DMA_BUF"); 1344 1344
+2 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
··· 450 450 } 451 451 452 452 /** 453 - * amdgpu_dma_buf_move_notify - &attach.move_notify implementation 453 + * amdgpu_dma_buf_move_notify - &attach.invalidate_mappings implementation 454 454 * 455 455 * @attach: the DMA-buf attachment 456 456 * ··· 521 521 522 522 static const struct dma_buf_attach_ops amdgpu_dma_buf_attach_ops = { 523 523 .allow_peer2peer = true, 524 - .move_notify = amdgpu_dma_buf_move_notify 524 + .invalidate_mappings = amdgpu_dma_buf_move_notify 525 525 }; 526 526 527 527 /**
+1 -1
drivers/gpu/drm/virtio/virtgpu_prime.c
··· 288 288 289 289 static const struct dma_buf_attach_ops virtgpu_dma_buf_attach_ops = { 290 290 .allow_peer2peer = true, 291 - .move_notify = virtgpu_dma_buf_move_notify 291 + .invalidate_mappings = virtgpu_dma_buf_move_notify 292 292 }; 293 293 294 294 struct drm_gem_object *virtgpu_gem_prime_import(struct drm_device *dev,
+3 -3
drivers/gpu/drm/xe/tests/xe_dma_buf.c
··· 23 23 static bool is_dynamic(struct dma_buf_test_params *params) 24 24 { 25 25 return IS_ENABLED(CONFIG_DMABUF_MOVE_NOTIFY) && params->attach_ops && 26 - params->attach_ops->move_notify; 26 + params->attach_ops->invalidate_mappings; 27 27 } 28 28 29 29 static void check_residency(struct kunit *test, struct xe_bo *exported, ··· 60 60 61 61 /* 62 62 * Evict exporter. Evicting the exported bo will 63 - * evict also the imported bo through the move_notify() functionality if 63 + * evict also the imported bo through the invalidate_mappings() functionality if 64 64 * importer is on a different device. If they're on the same device, 65 65 * the exporter and the importer should be the same bo. 66 66 */ ··· 198 198 199 199 static const struct dma_buf_attach_ops nop2p_attach_ops = { 200 200 .allow_peer2peer = false, 201 - .move_notify = xe_dma_buf_move_notify 201 + .invalidate_mappings = xe_dma_buf_move_notify 202 202 }; 203 203 204 204 /*
+1 -1
drivers/gpu/drm/xe/xe_dma_buf.c
··· 287 287 288 288 static const struct dma_buf_attach_ops xe_dma_buf_attach_ops = { 289 289 .allow_peer2peer = true, 290 - .move_notify = xe_dma_buf_move_notify 290 + .invalidate_mappings = xe_dma_buf_move_notify 291 291 }; 292 292 293 293 #if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST)
+2 -2
drivers/infiniband/core/umem_dmabuf.c
··· 129 129 if (check_add_overflow(offset, (unsigned long)size, &end)) 130 130 return ret; 131 131 132 - if (unlikely(!ops || !ops->move_notify)) 132 + if (unlikely(!ops || !ops->invalidate_mappings)) 133 133 return ret; 134 134 135 135 dmabuf = dma_buf_get(fd); ··· 195 195 196 196 static struct dma_buf_attach_ops ib_umem_dmabuf_attach_pinned_ops = { 197 197 .allow_peer2peer = true, 198 - .move_notify = ib_umem_dmabuf_unsupported_move_notify, 198 + .invalidate_mappings = ib_umem_dmabuf_unsupported_move_notify, 199 199 }; 200 200 201 201 struct ib_umem_dmabuf *
+1 -1
drivers/infiniband/hw/mlx5/mr.c
··· 1620 1620 1621 1621 static struct dma_buf_attach_ops mlx5_ib_dmabuf_attach_ops = { 1622 1622 .allow_peer2peer = 1, 1623 - .move_notify = mlx5_ib_dmabuf_invalidate_cb, 1623 + .invalidate_mappings = mlx5_ib_dmabuf_invalidate_cb, 1624 1624 }; 1625 1625 1626 1626 static struct ib_mr *
+1 -1
drivers/iommu/iommufd/pages.c
··· 1451 1451 1452 1452 static struct dma_buf_attach_ops iopt_dmabuf_attach_revoke_ops = { 1453 1453 .allow_peer2peer = true, 1454 - .move_notify = iopt_revoke_notify, 1454 + .invalidate_mappings = iopt_revoke_notify, 1455 1455 }; 1456 1456 1457 1457 /*
+3 -3
include/linux/dma-buf.h
··· 407 407 * through the device. 408 408 * 409 409 * - Dynamic importers should set fences for any access that they can't 410 - * disable immediately from their &dma_buf_attach_ops.move_notify 410 + * disable immediately from their &dma_buf_attach_ops.invalidate_mappings 411 411 * callback. 412 412 * 413 413 * IMPORTANT: ··· 446 446 bool allow_peer2peer; 447 447 448 448 /** 449 - * @move_notify: [optional] notification that the DMA-buf is moving 449 + * @invalidate_mappings: [optional] notification that the DMA-buf is moving 450 450 * 451 451 * If this callback is provided the framework can avoid pinning the 452 452 * backing store while mappings exists. ··· 463 463 * New mappings can be created after this callback returns, and will 464 464 * point to the new location of the DMA-buf. 465 465 */ 466 - void (*move_notify)(struct dma_buf_attachment *attach); 466 + void (*invalidate_mappings)(struct dma_buf_attachment *attach); 467 467 }; 468 468 469 469 /**