diff options
author | Francois Dugast <francois.dugast@intel.com> | 2023-07-27 14:55:29 +0000 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-21 11:39:17 -0500 |
commit | 99fea6828879381405dba598627aea79fa6edd78 (patch) | |
tree | 1ae501df46eb3a5274eec4f4a5006eae1ddf08b9 /drivers/gpu/drm/xe/xe_guc.c | |
parent | 3207a32163cdf7b3345a44e255aae614859ea0d6 (diff) |
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_guc.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_guc.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c index 2530b6243661..2493c5859948 100644 --- a/drivers/gpu/drm/xe/xe_guc.c +++ b/drivers/gpu/drm/xe/xe_guc.c @@ -43,9 +43,9 @@ static u32 guc_bo_ggtt_addr(struct xe_guc *guc, { u32 addr = xe_bo_ggtt_addr(bo); - XE_BUG_ON(addr < xe_wopcm_size(guc_to_xe(guc))); - XE_BUG_ON(addr >= GUC_GGTT_TOP); - XE_BUG_ON(bo->size > GUC_GGTT_TOP - addr); + XE_WARN_ON(addr < xe_wopcm_size(guc_to_xe(guc))); + XE_WARN_ON(addr >= GUC_GGTT_TOP); + XE_WARN_ON(bo->size > GUC_GGTT_TOP - addr); return addr; } @@ -612,13 +612,13 @@ int xe_guc_mmio_send_recv(struct xe_guc *guc, const u32 *request, BUILD_BUG_ON(VF_SW_FLAG_COUNT != MED_VF_SW_FLAG_COUNT); - XE_BUG_ON(guc->ct.enabled); - XE_BUG_ON(!len); - XE_BUG_ON(len > VF_SW_FLAG_COUNT); - XE_BUG_ON(len > MED_VF_SW_FLAG_COUNT); - XE_BUG_ON(FIELD_GET(GUC_HXG_MSG_0_ORIGIN, request[0]) != + XE_WARN_ON(guc->ct.enabled); + XE_WARN_ON(!len); + XE_WARN_ON(len > VF_SW_FLAG_COUNT); + XE_WARN_ON(len > MED_VF_SW_FLAG_COUNT); + XE_WARN_ON(FIELD_GET(GUC_HXG_MSG_0_ORIGIN, request[0]) != GUC_HXG_ORIGIN_HOST); - XE_BUG_ON(FIELD_GET(GUC_HXG_MSG_0_TYPE, request[0]) != + XE_WARN_ON(FIELD_GET(GUC_HXG_MSG_0_TYPE, request[0]) != GUC_HXG_TYPE_REQUEST); retry: @@ -724,8 +724,8 @@ static int guc_self_cfg(struct xe_guc *guc, u16 key, u16 len, u64 val) }; int ret; - XE_BUG_ON(len > 2); - XE_BUG_ON(len == 1 && upper_32_bits(val)); + XE_WARN_ON(len > 2); + XE_WARN_ON(len == 1 && upper_32_bits(val)); /* Self config must go over MMIO */ ret = xe_guc_mmio_send(guc, request, ARRAY_SIZE(request)); |