drm/xe/guc: Fix wrong assert about full_len
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Thu, 16 Nov 2023 15:12:39 +0000 (16:12 +0100)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:44:38 +0000 (11:44 -0500)
This variable holds full length of the message, including header
length so it should be checked against GUC_CTB_MSG_MAX_LEN.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_guc_ct.c

index a84e111..c44e750 100644 (file)
@@ -419,7 +419,7 @@ static int h2g_write(struct xe_guc_ct *ct, const u32 *action, u32 len,
        full_len = len + GUC_CTB_HDR_LEN;
 
        lockdep_assert_held(&ct->lock);
-       xe_assert(xe, full_len <= (GUC_CTB_MSG_MAX_LEN - GUC_CTB_HDR_LEN));
+       xe_assert(xe, full_len <= GUC_CTB_MSG_MAX_LEN);
        xe_assert(xe, tail <= h2g->info.size);
 
        /* Command will wrap, zero fill (NOPs), return and check credits again */