nvmap: Remove dma_buf_ops flag cache_sgt_mapping

The dma_buf_ops flag 'cache_sgt_mapping' has been removed in Linux
v6.16. Although NVMAP has its own caching and so it should be possible
to simply drop this flag, some tests are failing. For now add a test to
conftest to detect if this flag is present and update the NVMAP driver
accordingly.

Bug 5215421

Change-Id: I382d5c62fd550254d387abd1a21e5a1c5cda3a6e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3384177
(cherry picked from commit 326b31912bf1da7de0a5340826ec1fdaf084c11e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461885
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2025-04-10 13:52:53 +01:00
committed by mobile promotions
parent e004561637
commit 50c387ecf9
3 changed files with 19 additions and 1 deletions

View File

@@ -7131,6 +7131,22 @@ compile_test() {
compile_check_conftest "$CODE" "NV_DISK_CHECK_MEDIA_CHANGE_PRESENT" "" "functions"
;;
dma_buf_ops_has_cache_sgt_mapping)
#
# Determine if the 'dma_buf_ops' structure has 'cache_sgt_mapping' member.
#
# In Linux v6.16, commit b72f66f22c0e ("dma-buf: drop caching of sg_tables")
# removed the 'cache_sgt_mapping' member from the 'dma_buf_ops' structure.
#
CODE="
#include <linux/dma-buf.h>
int conftest_dma_buf_ops_has_cache_sgt_mapping(void) {
return offsetof(struct dma_buf_ops, cache_sgt_mapping);
}"
compile_check_conftest "$CODE" "NV_DMA_BUF_OPS_HAS_CACHE_SGT_MAPPING" "" "types"
;;
dma_slave_config_struct_has_slave_id)
#
# Determine if 'struct dma_slave_config' has the 'slave_id' member.