summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
diff options
context:
space:
mode:
authorFrancois Dugast <francois.dugast@intel.com>2023-07-27 16:55:29 +0200
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 17:39:17 +0100
commit99fea6828879381405dba598627aea79fa6edd78 (patch)
tree1ae501df46eb3a5274eec4f4a5006eae1ddf08b9 /drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
parentdrm/xe/macro: Remove unused constant (diff)
downloadlinux-99fea6828879381405dba598627aea79fa6edd78.tar.xz
linux-99fea6828879381405dba598627aea79fa6edd78.zip
drm/xe: Prefer WARN() over BUG() to avoid crashing the kernel
Replace calls to XE_BUG_ON() with calls XE_WARN_ON() which in turn calls WARN() instead of BUG(). BUG() crashes the kernel and should only be used when it is absolutely unavoidable in case of catastrophic and unrecoverable failures, which is not the case here. Signed-off-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c')
-rw-r--r--drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
index cad0ade595ec..bcbeea62d510 100644
--- a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
+++ b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
@@ -250,7 +250,7 @@ int xe_gt_tlb_invalidation_vma(struct xe_gt *gt,
u32 action[MAX_TLB_INVALIDATION_LEN];
int len = 0;
- XE_BUG_ON(!vma);
+ XE_WARN_ON(!vma);
action[len++] = XE_GUC_ACTION_TLB_INVALIDATION;
action[len++] = 0; /* seqno, replaced in send_tlb_invalidation */
@@ -288,10 +288,10 @@ int xe_gt_tlb_invalidation_vma(struct xe_gt *gt,
start = ALIGN_DOWN(xe_vma_start(vma), length);
}
- XE_BUG_ON(length < SZ_4K);
- XE_BUG_ON(!is_power_of_2(length));
- XE_BUG_ON(length & GENMASK(ilog2(SZ_16M) - 1, ilog2(SZ_2M) + 1));
- XE_BUG_ON(!IS_ALIGNED(start, length));
+ XE_WARN_ON(length < SZ_4K);
+ XE_WARN_ON(!is_power_of_2(length));
+ XE_WARN_ON(length & GENMASK(ilog2(SZ_16M) - 1, ilog2(SZ_2M) + 1));
+ XE_WARN_ON(!IS_ALIGNED(start, length));
action[len++] = MAKE_INVAL_OP(XE_GUC_TLB_INVAL_PAGE_SELECTIVE);
action[len++] = xe_vma_vm(vma)->usm.asid;
@@ -300,7 +300,7 @@ int xe_gt_tlb_invalidation_vma(struct xe_gt *gt,
action[len++] = ilog2(length) - ilog2(SZ_4K);
}
- XE_BUG_ON(len > MAX_TLB_INVALIDATION_LEN);
+ XE_WARN_ON(len > MAX_TLB_INVALIDATION_LEN);
return send_tlb_invalidation(&gt->uc.guc, fence, action, len);
}