summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_execlist.c
diff options
context:
space:
mode:
authorFrancois Dugast <francois.dugast@intel.com>2023-07-27 17:55:29 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 19:39:17 +0300
commit99fea6828879381405dba598627aea79fa6edd78 (patch)
tree1ae501df46eb3a5274eec4f4a5006eae1ddf08b9 /drivers/gpu/drm/xe/xe_execlist.c
parent3207a32163cdf7b3345a44e255aae614859ea0d6 (diff)
downloadlinux-99fea6828879381405dba598627aea79fa6edd78.tar.xz
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_execlist.c')
-rw-r--r--drivers/gpu/drm/xe/xe_execlist.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/drm/xe/xe_execlist.c b/drivers/gpu/drm/xe/xe_execlist.c
index b15d095b395b..a4d9531e3516 100644
--- a/drivers/gpu/drm/xe/xe_execlist.c
+++ b/drivers/gpu/drm/xe/xe_execlist.c
@@ -50,10 +50,10 @@ static void __start_lrc(struct xe_hw_engine *hwe, struct xe_lrc *lrc,
lrc_desc = xe_lrc_descriptor(lrc);
if (GRAPHICS_VERx100(xe) >= 1250) {
- XE_BUG_ON(!FIELD_FIT(XEHP_SW_CTX_ID, ctx_id));
+ XE_WARN_ON(!FIELD_FIT(XEHP_SW_CTX_ID, ctx_id));
lrc_desc |= FIELD_PREP(XEHP_SW_CTX_ID, ctx_id);
} else {
- XE_BUG_ON(!FIELD_FIT(GEN11_SW_CTX_ID, ctx_id));
+ XE_WARN_ON(!FIELD_FIT(GEN11_SW_CTX_ID, ctx_id));
lrc_desc |= FIELD_PREP(GEN11_SW_CTX_ID, ctx_id);
}
@@ -213,9 +213,9 @@ static void xe_execlist_make_active(struct xe_execlist_engine *exl)
struct xe_execlist_port *port = exl->port;
enum xe_engine_priority priority = exl->active_priority;
- XE_BUG_ON(priority == XE_ENGINE_PRIORITY_UNSET);
- XE_BUG_ON(priority < 0);
- XE_BUG_ON(priority >= ARRAY_SIZE(exl->port->active));
+ XE_WARN_ON(priority == XE_ENGINE_PRIORITY_UNSET);
+ XE_WARN_ON(priority < 0);
+ XE_WARN_ON(priority >= ARRAY_SIZE(exl->port->active));
spin_lock_irq(&port->lock);
@@ -321,7 +321,7 @@ static int execlist_engine_init(struct xe_engine *e)
struct xe_device *xe = gt_to_xe(e->gt);
int err;
- XE_BUG_ON(xe_device_guc_submission_enabled(xe));
+ XE_WARN_ON(xe_device_guc_submission_enabled(xe));
drm_info(&xe->drm, "Enabling execlist submission (GuC submission disabled)\n");
@@ -387,7 +387,7 @@ static void execlist_engine_fini_async(struct work_struct *w)
struct xe_execlist_engine *exl = e->execlist;
unsigned long flags;
- XE_BUG_ON(xe_device_guc_submission_enabled(gt_to_xe(e->gt)));
+ XE_WARN_ON(xe_device_guc_submission_enabled(gt_to_xe(e->gt)));
spin_lock_irqsave(&exl->port->lock, flags);
if (WARN_ON(exl->active_priority != XE_ENGINE_PRIORITY_UNSET))