From 721c81877d45bca7627e07030b01b22365e7055a Mon Sep 17 00:00:00 2001
From: Eric Naim <dnaim@cachyos.org>
Date: Mon, 9 Jun 2025 13:26:58 +0700
Subject: [PATCH 5/5] nvidia-uvm: Disable SVA support for 6.16+

6.16 removed IOMMU_DEV_FEAT_SVA because it is unused. Until there is a
proper fix from NVIDIA, disable this feature for now.

Signed-off-by: Eric Naim <dnaim@cachyos.org>
---
 kernel-open/nvidia-uvm/uvm_ats_sva.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel-open/nvidia-uvm/uvm_ats_sva.h b/kernel-open/nvidia-uvm/uvm_ats_sva.h
index 293c563b4bba..a30f4ff7186f 100644
--- a/kernel-open/nvidia-uvm/uvm_ats_sva.h
+++ b/kernel-open/nvidia-uvm/uvm_ats_sva.h
@@ -28,6 +28,7 @@
 #include "uvm_forward_decl.h"
 
 #include <linux/iommu.h>
+#include <linux/version.h>
 
 // For ATS support on aarch64, arm_smmu_sva_bind() is needed for
 // iommu_sva_bind_device() calls. Unfortunately, arm_smmu_sva_bind() is not
@@ -44,7 +45,7 @@
 // 701fac40384f07197b106136012804c3cae0b3de (02/15/2022) removed ioasid_get()
 // and added mm_pasid_drop().
     #if UVM_CAN_USE_MMU_NOTIFIERS() && (defined(NV_IOASID_GET_PRESENT) || defined(NV_MM_PASID_DROP_PRESENT))
-        #if defined(CONFIG_IOMMU_SVA)
+        #if defined(CONFIG_IOMMU_SVA) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0)
             #define UVM_ATS_SVA_SUPPORTED() 1
         #else
             #define UVM_ATS_SVA_SUPPORTED() 0
-- 
2.49.0

