diff options
author | Francois Dugast <francois.dugast@intel.com> | 2023-07-27 17:55:29 +0300 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-21 19:39:17 +0300 |
commit | 99fea6828879381405dba598627aea79fa6edd78 (patch) | |
tree | 1ae501df46eb3a5274eec4f4a5006eae1ddf08b9 /drivers/gpu/drm/xe/xe_uc_fw.c | |
parent | 3207a32163cdf7b3345a44e255aae614859ea0d6 (diff) | |
download | linux-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_uc_fw.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_uc_fw.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/drm/xe/xe_uc_fw.c b/drivers/gpu/drm/xe/xe_uc_fw.c index 5801c10f3ccc..4b04f6e5388d 100644 --- a/drivers/gpu/drm/xe/xe_uc_fw.c +++ b/drivers/gpu/drm/xe/xe_uc_fw.c @@ -158,7 +158,7 @@ __uc_fw_to_gt(struct xe_uc_fw *uc_fw, enum xe_uc_fw_type type) if (type == XE_UC_FW_TYPE_GUC) return container_of(uc_fw, struct xe_gt, uc.guc.fw); - XE_BUG_ON(type != XE_UC_FW_TYPE_HUC); + XE_WARN_ON(type != XE_UC_FW_TYPE_HUC); return container_of(uc_fw, struct xe_gt, uc.huc.fw); } @@ -194,7 +194,7 @@ uc_fw_auto_select(struct xe_device *xe, struct xe_uc_fw *uc_fw) u32 count; int i; - XE_BUG_ON(uc_fw->type >= ARRAY_SIZE(blobs_all)); + XE_WARN_ON(uc_fw->type >= ARRAY_SIZE(blobs_all)); entries = blobs_all[uc_fw->type].entries; count = blobs_all[uc_fw->type].count; @@ -223,8 +223,8 @@ size_t xe_uc_fw_copy_rsa(struct xe_uc_fw *uc_fw, void *dst, u32 max_len) struct xe_device *xe = uc_fw_to_xe(uc_fw); u32 size = min_t(u32, uc_fw->rsa_size, max_len); - XE_BUG_ON(size % 4); - XE_BUG_ON(!xe_uc_fw_is_available(uc_fw)); + XE_WARN_ON(size % 4); + XE_WARN_ON(!xe_uc_fw_is_available(uc_fw)); xe_map_memcpy_from(xe, dst, &uc_fw->bo->vmap, xe_uc_fw_rsa_offset(uc_fw), size); @@ -248,7 +248,7 @@ static void guc_read_css_info(struct xe_uc_fw *uc_fw, struct uc_css_header *css) struct xe_gt *gt = uc_fw_to_gt(uc_fw); struct xe_guc *guc = >->uc.guc; - XE_BUG_ON(uc_fw->type != XE_UC_FW_TYPE_GUC); + XE_WARN_ON(uc_fw->type != XE_UC_FW_TYPE_GUC); XE_WARN_ON(uc_fw->major_ver_found < 70); if (uc_fw->major_ver_found > 70 || uc_fw->minor_ver_found >= 6) { @@ -335,8 +335,8 @@ int xe_uc_fw_init(struct xe_uc_fw *uc_fw) * before we're looked at the HW caps to see if we have uc support */ BUILD_BUG_ON(XE_UC_FIRMWARE_UNINITIALIZED); - XE_BUG_ON(uc_fw->status); - XE_BUG_ON(uc_fw->path); + XE_WARN_ON(uc_fw->status); + XE_WARN_ON(uc_fw->path); uc_fw_auto_select(xe, uc_fw); xe_uc_fw_change_status(uc_fw, uc_fw->path ? *uc_fw->path ? @@ -502,7 +502,7 @@ int xe_uc_fw_upload(struct xe_uc_fw *uc_fw, u32 offset, u32 dma_flags) int err; /* make sure the status was cleared the last time we reset the uc */ - XE_BUG_ON(xe_uc_fw_is_loaded(uc_fw)); + XE_WARN_ON(xe_uc_fw_is_loaded(uc_fw)); if (!xe_uc_fw_is_loadable(uc_fw)) return -ENOEXEC; |