]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe/vm: Prefer xe_assert() over XE_WARN_ON()
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 29 Sep 2023 05:02:48 +0000 (22:02 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:42:46 +0000 (11:42 -0500)
When xelp_pte_encode_addr() was added in commit 23c8495efeed
("drm/xe/migrate: Do not hand-encode pte"), there was no xe pointer for
using xe_assert(). This is not the case anymore, so prefer it over
XE_WARN_ON().

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_vm.c

index b61ed51b503da2e96e7ad2e2bbe5efda65ff5d23..10ed72228946b535a2518780df2c1fdf59efb7d5 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/mm.h>
 #include <linux/swap.h>
 
+#include "xe_assert.h"
 #include "xe_bo.h"
 #include "xe_device.h"
 #include "xe_drm_client.h"
@@ -1312,7 +1313,7 @@ static u64 xelp_pte_encode_addr(struct xe_device *xe, u64 addr,
        u64 pte;
 
        /* Avoid passing random bits directly as flags */
-       XE_WARN_ON(flags & ~XE_PTE_PS64);
+       xe_assert(xe, !(flags & ~XE_PTE_PS64));
 
        pte = addr;
        pte |= XE_PAGE_PRESENT | XE_PAGE_RW;