Remove use of BUG_ON
v3 cover Remove use of BUG_ON
After offline discussions and feedback on the first series, taking a step back here and only address the issue of misusing BUG_ON() in situations where it is not needed.
Proper error handling with recovery code and switching to drm_err* require case by case analysis and fix, so this will be done in another series.
v2: Use regular WARN_ON() (Rodrigo Vivi)
Francois Dugast (3):
drm/xe/macro: Remove unused constant
drm/xe: Prefer WARN() over BUG() to avoid crashing the kernel drm/xe: Use regular WARN_ON() instead of driver-specific XE_WARN_ON()
drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_fbdev.c | 2 +- drivers/gpu/drm/xe/display/xe_fb_pin.c | 2 +- drivers/gpu/drm/xe/xe_bb.c | 8 +- drivers/gpu/drm/xe/xe_bo.c | 66 +++++++-------- drivers/gpu/drm/xe/xe_bo.h | 14 ++-- drivers/gpu/drm/xe/xe_bo_evict.c | 4 +- drivers/gpu/drm/xe/xe_debugfs.c | 4 +- drivers/gpu/drm/xe/xe_device.c | 8 +- drivers/gpu/drm/xe/xe_dma_buf.c | 2 +- drivers/gpu/drm/xe/xe_engine.c | 2 +- drivers/gpu/drm/xe/xe_exec.c | 2 +- drivers/gpu/drm/xe/xe_execlist.c | 16 ++-- drivers/gpu/drm/xe/xe_force_wake.c | 4 +- drivers/gpu/drm/xe/xe_force_wake.h | 4 +- drivers/gpu/drm/xe/xe_ggtt.c | 18 ++--- drivers/gpu/drm/xe/xe_gt.c | 22 ++--- drivers/gpu/drm/xe/xe_gt_clock.c | 4 +- drivers/gpu/drm/xe/xe_gt_debugfs.c | 4 +- drivers/gpu/drm/xe/xe_gt_pagefault.c | 2 +- drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 12 +-- drivers/gpu/drm/xe/xe_guc.c | 26 +++--- drivers/gpu/drm/xe/xe_guc.h | 2 +- drivers/gpu/drm/xe/xe_guc_ads.c | 16 ++-- drivers/gpu/drm/xe/xe_guc_ct.c | 28 +++---- drivers/gpu/drm/xe/xe_guc_hwconfig.c | 2 +- drivers/gpu/drm/xe/xe_guc_log.c | 4 +- drivers/gpu/drm/xe/xe_guc_pc.c | 16 ++-- drivers/gpu/drm/xe/xe_guc_submit.c | 62 +++++++-------- drivers/gpu/drm/xe/xe_huc.c | 2 +- drivers/gpu/drm/xe/xe_hw_engine.c | 10 +-- drivers/gpu/drm/xe/xe_hw_fence.c | 8 +- drivers/gpu/drm/xe/xe_lrc.c | 8 +- drivers/gpu/drm/xe/xe_macros.h | 4 - drivers/gpu/drm/xe/xe_migrate.c | 40 +++++----- drivers/gpu/drm/xe/xe_mocs.c | 4 +- drivers/gpu/drm/xe/xe_pt.c | 32 ++++---- drivers/gpu/drm/xe/xe_range_fence.c | 2 +- drivers/gpu/drm/xe/xe_reg_sr.c | 4 +- drivers/gpu/drm/xe/xe_res_cursor.h | 14 ++-- drivers/gpu/drm/xe/xe_ring_ops.c | 8 +- drivers/gpu/drm/xe/xe_sched_job.c | 2 +- drivers/gpu/drm/xe/xe_sync.c | 4 +- drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c | 4 +- drivers/gpu/drm/xe/xe_uc.c | 4 +- drivers/gpu/drm/xe/xe_uc_debugfs.c | 2 +- drivers/gpu/drm/xe/xe_uc_fw.c | 18 ++--- drivers/gpu/drm/xe/xe_uc_fw.h | 2 +- drivers/gpu/drm/xe/xe_vm.c | 84 ++++++++++---------- drivers/gpu/drm/xe/xe_vm.h | 2 +- drivers/gpu/drm/xe/xe_vm_madvise.c | 2 +- drivers/gpu/drm/xe/xe_wait_user_fence.c | 2 +- drivers/gpu/drm/xe/xe_wopcm.c | 18 ++--- 53 files changed, 317 insertions(+), 321 deletions(-)
Signature · 1 line
2.34.1
PATCH v3 1/3 drm/xe/macro: Remove unused constant
Remove XE_EXTRA_DEBUG for cleanup as it is not used.
--- drivers/gpu/drm/xe/xe_macros.h | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/xe/xe_macros.h +0 -1
@@ -8,7 +8,6 @@#include <linux/bug.h> -#define XE_EXTRA_DEBUG 1#define XE_WARN_ON WARN_ON#define XE_BUG_ON BUG_ON
Signature · 1 line
2.34.1
PATCH v3 2/3 drm/xe: Prefer WARN() over BUG() to avoid crashing the kernel
In reply to Francois DugastReplace 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.
--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/xe/xe_bb.c | 8 +-- drivers/gpu/drm/xe/xe_bo.c | 52 +++++++++--------- drivers/gpu/drm/xe/xe_bo.h | 14 ++--- drivers/gpu/drm/xe/xe_bo_evict.c | 4 +- drivers/gpu/drm/xe/xe_execlist.c | 14 ++--- drivers/gpu/drm/xe/xe_force_wake.c | 4 +- drivers/gpu/drm/xe/xe_force_wake.h | 4 +- drivers/gpu/drm/xe/xe_ggtt.c | 12 ++--- drivers/gpu/drm/xe/xe_gt_clock.c | 4 +- drivers/gpu/drm/xe/xe_gt_debugfs.c | 2 +- drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 12 ++--- drivers/gpu/drm/xe/xe_guc.c | 22 ++++---- drivers/gpu/drm/xe/xe_guc_ads.c | 14 ++--- drivers/gpu/drm/xe/xe_guc_ct.c | 22 ++++---- drivers/gpu/drm/xe/xe_guc_hwconfig.c | 2 +- drivers/gpu/drm/xe/xe_guc_log.c | 4 +- drivers/gpu/drm/xe/xe_guc_submit.c | 48 ++++++++--------- drivers/gpu/drm/xe/xe_huc.c | 2 +- drivers/gpu/drm/xe/xe_hw_engine.c | 10 ++-- drivers/gpu/drm/xe/xe_hw_fence.c | 2 +- drivers/gpu/drm/xe/xe_lrc.c | 8 +-- drivers/gpu/drm/xe/xe_macros.h | 1 - drivers/gpu/drm/xe/xe_migrate.c | 34 ++++++------ drivers/gpu/drm/xe/xe_pt.c | 22 ++++---- drivers/gpu/drm/xe/xe_res_cursor.h | 12 ++--- drivers/gpu/drm/xe/xe_ring_ops.c | 8 +-- drivers/gpu/drm/xe/xe_sched_job.c | 2 +- drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c | 4 +- drivers/gpu/drm/xe/xe_uc_fw.c | 16 +++--- drivers/gpu/drm/xe/xe_uc_fw.h | 2 +- drivers/gpu/drm/xe/xe_vm.c | 56 ++++++++++---------- drivers/gpu/drm/xe/xe_wait_user_fence.c | 2 +- drivers/gpu/drm/xe/xe_wopcm.c | 18 +++---- 34 files changed, 221 insertions(+), 222 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +1 -1
@@ -6941,7 +6941,7 @@ static int i915_gem_object_read_from_page(struct xe_bo *bo,int ret;struct ww_acquire_ctx ww; -XE_BUG_ON (size !=8 ); +XE_WARN_ON (size !=8 ); ret =xe_bo_lock (bo, &ww,0 , true);if (ret)
drivers/gpu/drm/xe/xe_bb.c +4 -4
@@ -78,7 +78,7 @@ struct xe_sched_job *xe_bb_create_wa_job(struct xe_engine *wa_eng, {u64 addr = batch_base_ofs +drm_suballoc_soffset (bb->bo); -XE_BUG_ON (!(wa_eng->vm->flags &XE_VM_FLAG_MIGRATION )); +XE_WARN_ON (!(wa_eng->vm->flags &XE_VM_FLAG_MIGRATION ));return __xe_bb_create_job (wa_eng, bb, &addr); }
@@ -94,8 +94,8 @@ struct xe_sched_job *xe_bb_create_migration_job(struct xe_engine *kernel_eng, 4 * second_idx, }; -BUG_ON (second_idx > bb->len); -BUG_ON (!(kernel_eng->vm->flags &XE_VM_FLAG_MIGRATION )); +XE_WARN_ON (second_idx > bb->len); +XE_WARN_ON (!(kernel_eng->vm->flags &XE_VM_FLAG_MIGRATION ));return __xe_bb_create_job (kernel_eng, bb, addr); }
@@ -105,7 +105,7 @@ struct xe_sched_job *xe_bb_create_job(struct xe_engine *kernel_eng, {u64 addr =xe_sa_bo_gpu_addr (bb->bo); -BUG_ON (kernel_eng->vm && kernel_eng->vm->flags &XE_VM_FLAG_MIGRATION ); +XE_WARN_ON (kernel_eng->vm && kernel_eng->vm->flags &XE_VM_FLAG_MIGRATION );return __xe_bb_create_job (kernel_eng, bb, &addr); }
drivers/gpu/drm/xe/xe_bo.c +26 -26
164 lines not on this page · raw message
drivers/gpu/drm/xe/xe_bo.h +7 -7
@@ -157,7 +157,7 @@ void xe_bo_unlock(struct xe_bo *bo, struct ww_acquire_ctx *ww);static inline void xe_bo_unlock_vm_held (struct xe_bo *bo) {if (bo) { -XE_BUG_ON (bo->vm && bo->ttm.base.resv != &bo->vm->resv); +XE_WARN_ON (bo->vm && bo->ttm.base.resv != &bo->vm->resv);if (bo->vm)xe_vm_assert_held (bo->vm);else
@@ -169,8 +169,8 @@ static inline void xe_bo_lock_no_vm(struct xe_bo *bo, struct ww_acquire_ctx *ctx) {if (bo) { -XE_BUG_ON (bo->vm || (bo->ttm.type != ttm_bo_type_sg && - bo->ttm.base.resv != &bo->ttm.base._resv)); +XE_WARN_ON (bo->vm || (bo->ttm.type != ttm_bo_type_sg && + bo->ttm.base.resv != &bo->ttm.base._resv));dma_resv_lock (bo->ttm.base.resv, ctx); } }
@@ -178,8 +178,8 @@ static inline void xe_bo_lock_no_vm(struct xe_bo *bo,static inline void xe_bo_unlock_no_vm (struct xe_bo *bo) {if (bo) { -XE_BUG_ON (bo->vm || (bo->ttm.type != ttm_bo_type_sg && - bo->ttm.base.resv != &bo->ttm.base._resv)); +XE_WARN_ON (bo->vm || (bo->ttm.type != ttm_bo_type_sg && + bo->ttm.base.resv != &bo->ttm.base._resv));dma_resv_unlock (bo->ttm.base.resv); } }
@@ -223,8 +223,8 @@ xe_bo_main_addr(struct xe_bo *bo, size_t page_size)static inline u32 xe_bo_ggtt_addr (struct xe_bo *bo) { -XE_BUG_ON (bo->ggtt_node.size > bo->size); -XE_BUG_ON (bo->ggtt_node.start + bo->ggtt_node.size > (1ull <<32 )); +XE_WARN_ON (bo->ggtt_node.size > bo->size); +XE_WARN_ON (bo->ggtt_node.start + bo->ggtt_node.size > (1ull <<32 ));return bo->ggtt_node.start; }
drivers/gpu/drm/xe/xe_bo_evict.c +2 -2
@@ -160,8 +160,8 @@ int xe_bo_restore_kernel(struct xe_device *xe)* We expect validate to trigger a move VRAM and our move code * should setup the iosys map. */ -XE_BUG_ON (iosys_map_is_null (&bo->vmap)); -XE_BUG_ON (!xe_bo_is_vram (bo)); +XE_WARN_ON (iosys_map_is_null (&bo->vmap)); +XE_WARN_ON (!xe_bo_is_vram (bo));xe_bo_put (bo);
drivers/gpu/drm/xe/xe_execlist.c +7 -7
@@ -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 drm_sched_priority priority = exl->entity.priority; -XE_BUG_ON (priority ==DRM_SCHED_PRIORITY_UNSET ); -XE_BUG_ON (priority <0 ); -XE_BUG_ON (priority >=ARRAY_SIZE (exl->port->active)); +XE_WARN_ON (priority ==DRM_SCHED_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" );
@@ -389,7 +389,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 !=DRM_SCHED_PRIORITY_UNSET ))
drivers/gpu/drm/xe/xe_force_wake.c +2 -2
@@ -45,7 +45,7 @@ void xe_force_wake_init_gt(struct xe_gt *gt, struct xe_force_wake *fw)mutex_init (&fw->lock);/* Assuming gen11+ so assert this assumption is correct */ -XE_BUG_ON (GRAPHICS_VER (gt_to_xe (gt)) <11 ); +XE_WARN_ON (GRAPHICS_VER (gt_to_xe (gt)) <11 );if (xe->info.graphics_verx100 >=1270 ) { domain_init(&fw->domains[XE_FW_DOMAIN_ID_GT],
@@ -67,7 +67,7 @@ void xe_force_wake_init_engines(struct xe_gt *gt, struct xe_force_wake *fw)int i, j;/* Assuming gen11+ so assert this assumption is correct */ -XE_BUG_ON (GRAPHICS_VER (gt_to_xe (gt)) <11 ); +XE_WARN_ON (GRAPHICS_VER (gt_to_xe (gt)) <11 );if (!xe_gt_is_media_type (gt)) domain_init(&fw->domains[XE_FW_DOMAIN_ID_RENDER],
drivers/gpu/drm/xe/xe_force_wake.h +2 -2
@@ -24,7 +24,7 @@ static inline int xe_force_wake_ref(struct xe_force_wake *fw, enum xe_force_wake_domains domain) { - XE_BUG_ON(!domain); + XE_WARN_ON(!domain);return fw->domains[ffs (domain) -1 ].ref; }
@@ -32,7 +32,7 @@ static inline void xe_force_wake_assert_held(struct xe_force_wake *fw, enum xe_force_wake_domains domain) { - XE_BUG_ON(!(fw->awake_domains & domain)); + XE_WARN_ON(!(fw->awake_domains & domain)); }#endif
drivers/gpu/drm/xe/xe_ggtt.c +6 -6
@@ -59,8 +59,8 @@ static unsigned int probe_gsm_size(struct pci_dev *pdev)void xe_ggtt_set_pte (struct xe_ggtt *ggtt,u64 addr,u64 pte) { -XE_BUG_ON (addr &XE_PTE_MASK ); -XE_BUG_ON (addr >= ggtt->size); +XE_WARN_ON (addr &XE_PTE_MASK ); +XE_WARN_ON (addr >= ggtt->size);writeq (pte, &ggtt->gsm[addr >>XE_PTE_SHIFT ]); }
@@ -70,7 +70,7 @@ static void xe_ggtt_clear(struct xe_ggtt *ggtt, u64 start, u64 size)u64 end = start + size -1 ;u64 scratch_pte; -XE_BUG_ON (start >= end); +XE_WARN_ON (start >= end);if (ggtt->scratch) scratch_pte =xe_ggtt_pte_encode (ggtt->scratch,0 );
@@ -267,7 +267,7 @@ void xe_ggtt_printk(struct xe_ggtt *ggtt, const char *prefix)for (addr =0 ; addr < ggtt->size; addr +=XE_PAGE_SIZE ) {unsigned int i = addr /XE_PAGE_SIZE ; -XE_BUG_ON (addr >U32_MAX ); +XE_WARN_ON (addr >U32_MAX );if (ggtt->gsm[i] == scratch_pte)continue ;
@@ -320,7 +320,7 @@ static int __xe_ggtt_insert_bo_at(struct xe_ggtt *ggtt, struct xe_bo *bo,if (XE_WARN_ON (bo->ggtt_node.size)) {/* Someone's already inserted this BO in the GGTT */ -XE_BUG_ON (bo->ggtt_node.size != bo->size); +XE_WARN_ON (bo->ggtt_node.size != bo->size);return 0 ; }
@@ -372,7 +372,7 @@ void xe_ggtt_remove_bo(struct xe_ggtt *ggtt, struct xe_bo *bo)return ;/* This BO is not currently in the GGTT */ -XE_BUG_ON (bo->ggtt_node.size != bo->size); +XE_WARN_ON (bo->ggtt_node.size != bo->size);xe_ggtt_remove_node (ggtt, &bo->ggtt_node); }
drivers/gpu/drm/xe/xe_gt_clock.c +2 -2
@@ -47,7 +47,7 @@ static u32 get_crystal_clock_freq(u32 rpm_config_reg)case RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_25_MHZ :return f25_mhz;default : -XE_BUG_ON ("NOT_POSSIBLE" ); +XE_WARN_ON ("NOT_POSSIBLE" );return 0 ; } }
@@ -58,7 +58,7 @@ int xe_gt_clock_init(struct xe_gt *gt)u32 freq =0 ;/* Assuming gen11+ so assert this assumption is correct */ -XE_BUG_ON (GRAPHICS_VER (gt_to_xe (gt)) <11 ); +XE_WARN_ON (GRAPHICS_VER (gt_to_xe (gt)) <11 );if (ctc_reg &CTC_SOURCE_DIVIDE_LOGIC ) { freq =read_reference_ts_freq (gt);
drivers/gpu/drm/xe/xe_gt_debugfs.c +1 -1
@@ -157,7 +157,7 @@ void xe_gt_debugfs_register(struct xe_gt *gt)char name[8 ];int i; -XE_BUG_ON (!minor->debugfs_root); +XE_WARN_ON (!minor->debugfs_root);sprintf (name,"gt%d" , gt->info.id); root =debugfs_create_dir (name, minor->debugfs_root);
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +6 -6
@@ -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 (>->uc.guc, fence, action, len); }
drivers/gpu/drm/xe/xe_guc.c +11 -11
@@ -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; }
@@ -614,13 +614,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:
@@ -729,8 +729,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));
drivers/gpu/drm/xe/xe_guc_ads.c +7 -7
@@ -118,7 +118,7 @@ struct __guc_ads_blob {static size_t guc_ads_regset_size (struct xe_guc_ads *ads) { -XE_BUG_ON (!ads->regset_size); +XE_WARN_ON (!ads->regset_size);return ads->regset_size; }
@@ -312,7 +312,7 @@ int xe_guc_ads_init_post_hwconfig(struct xe_guc_ads *ads)struct xe_gt *gt =ads_to_gt (ads);u32 prev_regset_size = ads->regset_size; -XE_BUG_ON (!ads->bo); +XE_WARN_ON (!ads->bo); ads->golden_lrc_size =calculate_golden_lrc_size (ads); ads->regset_size =calculate_regset_size (gt);
@@ -518,7 +518,7 @@ static void guc_mmio_reg_state_init(struct xe_guc_ads *ads) regset_used += count *sizeof (struct guc_mmio_reg ); } -XE_BUG_ON (regset_used > ads->regset_size); +XE_WARN_ON (regset_used > ads->regset_size); }static void guc_um_init_params (struct xe_guc_ads *ads)
@@ -573,7 +573,7 @@ void xe_guc_ads_populate_minimal(struct xe_guc_ads *ads) offsetof(struct __guc_ads_blob, system_info));u32 base =xe_bo_ggtt_addr (ads->bo); -XE_BUG_ON (!ads->bo); +XE_WARN_ON (!ads->bo);xe_map_memset (ads_to_xe (ads),ads_to_map (ads),0 ,0 , ads->bo->size);guc_policies_init (ads);
@@ -597,7 +597,7 @@ void xe_guc_ads_populate(struct xe_guc_ads *ads) offsetof(struct __guc_ads_blob, system_info));u32 base =xe_bo_ggtt_addr (ads->bo); -XE_BUG_ON (!ads->bo); +XE_WARN_ON (!ads->bo);xe_map_memset (ads_to_xe (ads),ads_to_map (ads),0 ,0 , ads->bo->size);guc_policies_init (ads);
@@ -647,7 +647,7 @@ static void guc_populate_golden_lrc(struct xe_guc_ads *ads) engine_enabled_masks[guc_class]))continue ; -XE_BUG_ON (!gt->default_lrc[class]); +XE_WARN_ON (!gt->default_lrc[class]); real_size =xe_lrc_size (xe, class); alloc_size =PAGE_ALIGN (real_size);
@@ -676,7 +676,7 @@ static void guc_populate_golden_lrc(struct xe_guc_ads *ads) offset += alloc_size; } -XE_BUG_ON (total_size != ads->golden_lrc_size); +XE_WARN_ON (total_size != ads->golden_lrc_size); }void xe_guc_ads_populate_post_load (struct xe_guc_ads *ads)
drivers/gpu/drm/xe/xe_guc_ct.c +11 -11
@@ -135,7 +135,7 @@ int xe_guc_ct_init(struct xe_guc_ct *ct)struct xe_bo *bo;int err; -XE_BUG_ON (guc_ct_size () %PAGE_SIZE ); +XE_WARN_ON (guc_ct_size () %PAGE_SIZE );mutex_init (&ct->lock);spin_lock_init (&ct->fast_lock);
@@ -284,7 +284,7 @@ int xe_guc_ct_enable(struct xe_guc_ct *ct)struct xe_device *xe =ct_to_xe (ct);int err; -XE_BUG_ON (ct->enabled); +XE_WARN_ON (ct->enabled);guc_ct_ctb_h2g_init (xe, &ct->ctbs.h2g, &ct->bo->vmap);guc_ct_ctb_g2h_init (xe, &ct->ctbs.g2h, &ct->bo->vmap);
@@ -377,7 +377,7 @@ static void h2g_reserve_space(struct xe_guc_ct *ct, u32 cmd_len)static void __g2h_reserve_space (struct xe_guc_ct *ct,u32 g2h_len,u32 num_g2h) { -XE_BUG_ON (g2h_len > ct->ctbs.g2h.info.space); +XE_WARN_ON (g2h_len > ct->ctbs.g2h.info.space);if (g2h_len) {lockdep_assert_held (&ct->fast_lock);
@@ -420,8 +420,8 @@ 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_BUG_ON (full_len > (GUC_CTB_MSG_MAX_LEN -GUC_CTB_HDR_LEN )); -XE_BUG_ON (tail > h2g->info.size); +XE_WARN_ON (full_len > (GUC_CTB_MSG_MAX_LEN -GUC_CTB_HDR_LEN )); +XE_WARN_ON (tail > h2g->info.size);/* Command will wrap, zero fill (NOPs), return and check credits again */ if (tail + full_len > h2g->info.size) {
@@ -479,10 +479,10 @@ static int __guc_ct_send_locked(struct xe_guc_ct *ct, const u32 *action, {int ret; -XE_BUG_ON (g2h_len && g2h_fence); -XE_BUG_ON (num_g2h && g2h_fence); -XE_BUG_ON (g2h_len && !num_g2h); -XE_BUG_ON (!g2h_len && num_g2h); +XE_WARN_ON (g2h_len && g2h_fence); +XE_WARN_ON (num_g2h && g2h_fence); +XE_WARN_ON (g2h_len && !num_g2h); +XE_WARN_ON (!g2h_len && num_g2h);lockdep_assert_held (&ct->lock);if (unlikely (ct->ctbs.h2g.info.broken)) {
@@ -553,7 +553,7 @@ static int guc_ct_send_locked(struct xe_guc_ct *ct, const u32 *action, u32 len,unsigned int sleep_period_ms =1 ;int ret; -XE_BUG_ON (g2h_len && g2h_fence); +XE_WARN_ON (g2h_len && g2h_fence);lockdep_assert_held (&ct->lock);xe_device_assert_mem_access (ct_to_xe (ct));
@@ -623,7 +623,7 @@ static int guc_ct_send(struct xe_guc_ct *ct, const u32 *action, u32 len, {int ret; -XE_BUG_ON (g2h_len && g2h_fence); +XE_WARN_ON (g2h_len && g2h_fence);mutex_lock (&ct->lock); ret =guc_ct_send_locked (ct, action, len, g2h_len, num_g2h, g2h_fence);
drivers/gpu/drm/xe/xe_guc_hwconfig.c +1 -1
@@ -120,7 +120,7 @@ void xe_guc_hwconfig_copy(struct xe_guc *guc, void *dst) {struct xe_device *xe =guc_to_xe (guc); -XE_BUG_ON (!guc->hwconfig.bo); +XE_WARN_ON (!guc->hwconfig.bo);xe_map_memcpy_from (xe, dst, &guc->hwconfig.bo->vmap,0 , guc->hwconfig.size);
drivers/gpu/drm/xe/xe_guc_log.c +2 -2
@@ -55,12 +55,12 @@ void xe_guc_log_print(struct xe_guc_log *log, struct drm_printer *p)size_t size;int i, j; -XE_BUG_ON (!log->bo); +XE_WARN_ON (!log->bo); size = log->bo->size;#define DW_PER_READ 128 -XE_BUG_ON (size % (DW_PER_READ *sizeof (u32))); +XE_WARN_ON (size % (DW_PER_READ *sizeof (u32)));for (i =0 ; i < size /sizeof (u32); i +=DW_PER_READ ) {u32 read[DW_PER_READ ];
drivers/gpu/drm/xe/xe_guc_submit.c +24 -24
161 lines not on this page · raw message
drivers/gpu/drm/xe/xe_huc.c +1 -1
@@ -72,7 +72,7 @@ int xe_huc_auth(struct xe_huc *huc)if (xe_uc_fw_is_disabled (&huc->fw))return 0 ; -XE_BUG_ON (xe_uc_fw_is_running (&huc->fw)); +XE_WARN_ON (xe_uc_fw_is_running (&huc->fw));if (!xe_uc_fw_is_loaded (&huc->fw))return -ENOEXEC ;
drivers/gpu/drm/xe/xe_hw_engine.c +5 -5
@@ -237,7 +237,7 @@ static void hw_engine_fini(struct drm_device *drm, void *arg)static void hw_engine_mmio_write32 (struct xe_hw_engine *hwe,struct xe_reg reg,u32 val) { -XE_BUG_ON (reg.addr & hwe->mmio_base); +XE_WARN_ON (reg.addr & hwe->mmio_base);xe_force_wake_assert_held (gt_to_fw (hwe->gt), hwe->domain); reg.addr += hwe->mmio_base;
@@ -247,7 +247,7 @@ static void hw_engine_mmio_write32(struct xe_hw_engine *hwe, struct xe_reg reg,static u32 hw_engine_mmio_read32 (struct xe_hw_engine *hwe,struct xe_reg reg) { -XE_BUG_ON (reg.addr & hwe->mmio_base); +XE_WARN_ON (reg.addr & hwe->mmio_base);xe_force_wake_assert_held (gt_to_fw (hwe->gt), hwe->domain); reg.addr += hwe->mmio_base;
@@ -351,7 +351,7 @@ static void hw_engine_init_early(struct xe_gt *gt, struct xe_hw_engine *hwe, info = &engine_infos[id]; -XE_BUG_ON (hwe->gt); +XE_WARN_ON (hwe->gt); hwe->gt = gt; hwe->class = info->class;
@@ -377,8 +377,8 @@ static int hw_engine_init(struct xe_gt *gt, struct xe_hw_engine *hwe,struct xe_tile *tile =gt_to_tile (gt);int err; -XE_BUG_ON (id >=ARRAY_SIZE (engine_infos) || !engine_infos[id].name); -XE_BUG_ON (!(gt->info.engine_mask &BIT (id))); +XE_WARN_ON (id >=ARRAY_SIZE (engine_infos) || !engine_infos[id].name); +XE_WARN_ON (!(gt->info.engine_mask &BIT (id)));xe_reg_sr_apply_mmio (&hwe->reg_sr, gt);xe_reg_sr_apply_whitelist (hwe);
drivers/gpu/drm/xe/xe_hw_fence.c +1 -1
@@ -188,7 +188,7 @@ static void xe_hw_fence_release(struct dma_fence *dma_fence)struct xe_hw_fence *fence =to_xe_hw_fence (dma_fence);trace_xe_hw_fence_free (fence); -XE_BUG_ON (!list_empty (&fence->irq_link)); +XE_WARN_ON (!list_empty (&fence->irq_link));call_rcu (&dma_fence->rcu, fence_free); }
drivers/gpu/drm/xe/xe_lrc.c +4 -4
@@ -108,7 +108,7 @@ static void set_offsets(u32 *regs, *regs |=MI_LRI_LRM_CS_MMIO ; regs++; -XE_BUG_ON (!count); +XE_WARN_ON (!count); do { u32 offset = 0; u8 v;
@@ -528,7 +528,7 @@ static inline struct iosys_map __xe_lrc_##elem##_map(struct xe_lrc *lrc) \ { \struct iosys_map map = lrc->bo->vmap; \ \ -XE_BUG_ON (iosys_map_is_null (&map)); \ +XE_WARN_ON (iosys_map_is_null (&map)); \ iosys_map_incr(&map, __xe_lrc_##elem##_offset(lrc)); \return map; \ } \
@@ -759,12 +759,12 @@ void xe_lrc_write_ring(struct xe_lrc *lrc, const void *data, size_t size)u32 rhs;size_t aligned_size; -XE_BUG_ON (!IS_ALIGNED (size,4 )); +XE_WARN_ON (!IS_ALIGNED (size,4 )); aligned_size =ALIGN (size,8 ); ring =__xe_lrc_ring_map (lrc); -XE_BUG_ON (lrc->ring.tail >= lrc->ring.size); +XE_WARN_ON (lrc->ring.tail >= lrc->ring.size); rhs = lrc->ring.size - lrc->ring.tail;if (size > rhs) {__xe_lrc_write_ring (lrc, ring, data, rhs);
drivers/gpu/drm/xe/xe_macros.h +0 -1
@@ -9,7 +9,6 @@#include <linux/bug.h> #define XE_WARN_ON WARN_ON -#define XE_BUG_ON BUG_ON#define XE_IOCTL_DBG (xe, cond) \ ((cond) && (drm_dbg(&(xe)->drm, \
drivers/gpu/drm/xe/xe_migrate.c +17 -17
@@ -106,7 +106,7 @@ static void xe_migrate_fini(struct drm_device *dev, void *arg)static u64 xe_migrate_vm_addr (u64 slot,u32 level) { -XE_BUG_ON (slot >=NUM_PT_SLOTS ); +XE_WARN_ON (slot >=NUM_PT_SLOTS );/* First slot is reserved for mapping of PT bo and bb, start from 1 */ return (slot +1ULL ) <<xe_pt_shift (level +1 );
@@ -148,7 +148,7 @@ static int xe_migrate_create_cleared_bo(struct xe_migrate *m, struct xe_vm *vm)xe_map_memset (xe, &m->cleared_bo->vmap,0 ,0x00 , cleared_size); vram_addr =xe_bo_addr (m->cleared_bo,0 ,XE_PAGE_SIZE , &is_vram); -XE_BUG_ON (!is_vram); +XE_WARN_ON (!is_vram); m->cleared_vram_ofs =xe_migrate_vram_ofs (vram_addr);return 0 ;
@@ -173,7 +173,7 @@ static int xe_migrate_prepare_vm(struct xe_tile *tile, struct xe_migrate *m,BUILD_BUG_ON (!(NUM_KERNEL_PDE &1 ));/* Need to be sure everything fits in the first PT, or create more */ -XE_BUG_ON (m->batch_base_ofs + batch->size >=SZ_2M ); +XE_WARN_ON (m->batch_base_ofs + batch->size >=SZ_2M ); bo = xe_bo_create_pin_map(vm->xe, tile, vm, num_entries * XE_PAGE_SIZE,
@@ -208,7 +208,7 @@ static int xe_migrate_prepare_vm(struct xe_tile *tile, struct xe_migrate *m, }if (!IS_DGFX (xe)) { -XE_BUG_ON (xe->info.supports_usm); +XE_WARN_ON (xe->info.supports_usm);/* Write out batch too */ m->batch_base_ofs =NUM_PT_SLOTS *XE_PAGE_SIZE ;
@@ -493,7 +493,7 @@ static void emit_copy_ccs(struct xe_gt *gt, struct xe_bb *bb, num_ccs_blks =DIV_ROUND_UP (xe_device_ccs_bytes (gt_to_xe (gt), size),NUM_CCS_BYTES_PER_BLOCK ); -XE_BUG_ON (num_ccs_blks >NUM_CCS_BLKS_PER_XFER ); +XE_WARN_ON (num_ccs_blks >NUM_CCS_BLKS_PER_XFER ); *cs++ =XY_CTRL_SURF_COPY_BLT | (src_is_indirect ?0x0 :0x1 ) <<SRC_ACCESS_TYPE_SHIFT | (dst_is_indirect ? 0x0 : 0x1) << DST_ACCESS_TYPE_SHIFT |
@@ -513,9 +513,9 @@ static void emit_copy(struct xe_gt *gt, struct xe_bb *bb, u64 src_ofs, u64 dst_ofs, unsigned int size, unsigned int pitch) { - XE_BUG_ON(size / pitch > S16_MAX); -XE_BUG_ON (pitch /4 >S16_MAX ); -XE_BUG_ON (pitch >U16_MAX ); + XE_WARN_ON(size / pitch > S16_MAX); +XE_WARN_ON (pitch /4 >S16_MAX ); +XE_WARN_ON (pitch >U16_MAX ); bb->cs[bb->len++] =XY_FAST_COPY_BLT_CMD | (10 -2 ); bb->cs[bb->len++] =XY_FAST_COPY_BLT_DEPTH_32 | pitch;
@@ -575,7 +575,7 @@ static u32 xe_migrate_ccs_copy(struct xe_migrate *m,* At the moment, we don't support copying CCS metadata from * system to system. */ -XE_BUG_ON (!src_is_vram && !dst_is_vram); +XE_WARN_ON (!src_is_vram && !dst_is_vram);emit_copy_ccs (gt, bb, dst_ofs, dst_is_vram, src_ofs, src_is_vram, dst_size);
@@ -787,7 +787,7 @@ static void emit_clear_link_copy(struct xe_gt *gt, struct xe_bb *bb, u64 src_ofs *cs++ =upper_32_bits (src_ofs); *cs++ =FIELD_PREP (PVC_MS_MOCS_INDEX_MASK , mocs); -XE_BUG_ON (cs - bb->cs != len + bb->len); +XE_WARN_ON (cs - bb->cs != len + bb->len); bb->len += len; }
@@ -825,7 +825,7 @@ static void emit_clear_main_copy(struct xe_gt *gt, struct xe_bb *bb, *cs++ =0 ; } -XE_BUG_ON (cs - bb->cs != len + bb->len); +XE_WARN_ON (cs - bb->cs != len + bb->len); bb->len += len; }
@@ -998,16 +998,16 @@ static void write_pgtable(struct xe_tile *tile, struct xe_bb *bb, u64 ppgtt_ofs,* PDE. This requires a BO that is almost vm->size big. * * This shouldn't be possible in practice.. might change when 16K -* pages are used. Hence the BUG_ON. +* pages are used. Hence the XE_WARN_ON. */ -XE_BUG_ON (update->qwords >0x1ff ); +XE_WARN_ON (update->qwords >0x1ff );if (!ppgtt_ofs) {bool is_vram; ppgtt_ofs =xe_migrate_vram_ofs (xe_bo_addr (update->pt_bo,0 ,XE_PAGE_SIZE , &is_vram)); -XE_BUG_ON (!is_vram); +XE_WARN_ON (!is_vram); } do {
@@ -1194,7 +1194,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m,* Worst case: Sum(2 * (each lower level page size) + (top level page size)) * Should be reasonably bound.. */ -XE_BUG_ON (batch_size >=SZ_128K ); +XE_WARN_ON (batch_size >=SZ_128K ); bb =xe_bb_new (gt, batch_size, !eng && xe->info.supports_usm);if (IS_ERR (bb))
@@ -1204,7 +1204,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m,if (!IS_DGFX (xe)) { ppgtt_ofs =NUM_KERNEL_PDE -1 ;if (eng) { -XE_BUG_ON (num_updates >NUM_VMUSA_WRITES_PER_UNIT ); +XE_WARN_ON (num_updates >NUM_VMUSA_WRITES_PER_UNIT ); sa_bo =drm_suballoc_new (&m->vm_update_sa,1 ,GFP_KERNEL , true,0 );
@@ -1233,7 +1233,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m,for (i =0 ; i < num_updates; i++) {struct xe_bo *pt_bo = updates[i].pt_bo; -BUG_ON (pt_bo->size !=SZ_4K ); +XE_WARN_ON (pt_bo->size !=SZ_4K ); addr =xe_pte_encode (NULL , pt_bo,0 ,XE_CACHE_WB ,0 ); bb->cs[bb->len++] =lower_32_bits (addr);
drivers/gpu/drm/xe/xe_pt.c +11 -11
@@ -133,7 +133,7 @@ static u64 __pte_encode(u64 pte, enum xe_cache_level cache, pte |=XE_PDPE_PS_1G ;/* XXX: Does hw support 1 GiB pages? */ -XE_BUG_ON (pt_level >2 ); +XE_WARN_ON (pt_level >2 );return pte; }
@@ -233,7 +233,7 @@ struct xe_pt *xe_pt_create(struct xe_vm *vm, struct xe_tile *tile, pt->level = level; pt->base.dir = level ? &as_xe_pt_dir (pt)->dir :NULL ; -XE_BUG_ON (level >XE_VM_MAX_LEVEL ); +XE_WARN_ON (level >XE_VM_MAX_LEVEL );return pt;
@@ -302,7 +302,7 @@ void xe_pt_destroy(struct xe_pt *pt, u32 flags, struct llist_head *deferred)if (!pt)return ; -XE_BUG_ON (!list_empty (&pt->bo->vmas)); +XE_WARN_ON (!list_empty (&pt->bo->vmas));xe_bo_unpin (pt->bo);xe_bo_put_deferred (pt->bo, deferred);
@@ -885,8 +885,8 @@ static int xe_pt_zap_ptes_entry(struct xe_ptw *parent, pgoff_t offset,struct xe_pt *xe_child =container_of (*child,typeof (*xe_child), base);pgoff_t end_offset; -XE_BUG_ON (!*child); -XE_BUG_ON (!level && xe_child->is_compact); +XE_WARN_ON (!*child); +XE_WARN_ON (!level && xe_child->is_compact);/* * Note that we're called from an entry callback, and we're dealing
@@ -1040,7 +1040,7 @@ xe_pt_prepare_bind(struct xe_tile *tile, struct xe_vma *vma, *num_entries =0 ; err =xe_pt_stage_bind (tile, vma, entries, num_entries);if (!err) -BUG_ON (!*num_entries); +XE_WARN_ON (!*num_entries);else /* abort! */ xe_pt_abort_bind (vma, entries, *num_entries);
@@ -1062,7 +1062,7 @@ static void xe_vm_dbg_print_entries(struct xe_device *xe,u64 end;u64 start; -XE_BUG_ON (entry->pt->is_compact); +XE_WARN_ON (entry->pt->is_compact); start = entry->ofs * page_size; end = start + page_size * entry->qwords; vm_dbg(&xe->drm,
@@ -1392,7 +1392,7 @@ __xe_pt_bind_vma(struct xe_tile *tile, struct xe_vma *vma, struct xe_engine *e, err =xe_pt_prepare_bind (tile, vma, entries, &num_entries, rebind);if (err) goto err; -XE_BUG_ON (num_entries >ARRAY_SIZE (entries)); +XE_WARN_ON (num_entries >ARRAY_SIZE (entries));xe_vm_dbg_print_entries (tile_to_xe (tile), entries, num_entries); xe_pt_calc_rfence_interval(vma, &bind_pt_update, entries,
@@ -1551,8 +1551,8 @@ static int xe_pt_stage_unbind_entry(struct xe_ptw *parent, pgoff_t offset, {struct xe_pt *xe_child =container_of (*child,typeof (*xe_child), base); -XE_BUG_ON (!*child); -XE_BUG_ON (!level && xe_child->is_compact); +XE_WARN_ON (!*child); +XE_WARN_ON (!level && xe_child->is_compact);xe_pt_check_kill (addr, next, level -1 , xe_child, action, walk);
@@ -1743,7 +1743,7 @@ __xe_pt_unbind_vma(struct xe_tile *tile, struct xe_vma *vma, struct xe_engine *e xe_vma_start(vma), xe_vma_end(vma) - 1, e); num_entries =xe_pt_stage_unbind (tile, vma, entries); -XE_BUG_ON (num_entries >ARRAY_SIZE (entries)); +XE_WARN_ON (num_entries >ARRAY_SIZE (entries));xe_vm_dbg_print_entries (tile_to_xe (tile), entries, num_entries); xe_pt_calc_rfence_interval(vma, &unbind_pt_update, entries,
drivers/gpu/drm/xe/xe_res_cursor.h +6 -6
@@ -79,7 +79,7 @@ static inline void xe_res_first(struct ttm_resource *res,if (!res) goto fallback; -XE_BUG_ON (start + size > res->size); +XE_WARN_ON (start + size > res->size); cur->mem_type = res->mem_type;
@@ -139,7 +139,7 @@ static inline void __xe_res_sg_next(struct xe_res_cursor *cur)while (start >=sg_dma_len (sgl)) { start -=sg_dma_len (sgl); sgl =sg_next (sgl); -XE_BUG_ON (!sgl); +XE_WARN_ON (!sgl); } cur->start = start;
@@ -161,9 +161,9 @@ static inline void xe_res_first_sg(const struct sg_table *sg, u64 start, u64 size, struct xe_res_cursor *cur) { - XE_BUG_ON(!sg); -XE_BUG_ON (!IS_ALIGNED (start,PAGE_SIZE ) || - !IS_ALIGNED (size,PAGE_SIZE )); + XE_WARN_ON(!sg); +XE_WARN_ON (!IS_ALIGNED (start,PAGE_SIZE ) || + !IS_ALIGNED (size,PAGE_SIZE )); cur->node =NULL ; cur->start = start; cur->remaining = size;
@@ -187,7 +187,7 @@ static inline void xe_res_next(struct xe_res_cursor *cur, u64 size)struct list_head *next;u64 start; -XE_BUG_ON (size > cur->remaining); +XE_WARN_ON (size > cur->remaining); cur->remaining -= size;if (!cur->remaining)
drivers/gpu/drm/xe/xe_ring_ops.c +4 -4
@@ -233,7 +233,7 @@ static void __emit_job_gen12_copy(struct xe_sched_job *job, struct xe_lrc *lrc, i =emit_user_interrupt (dw, i); -XE_BUG_ON (i >MAX_JOB_SIZE_DW ); +XE_WARN_ON (i >MAX_JOB_SIZE_DW );xe_lrc_write_ring (lrc, dw, i *sizeof (*dw)); }
@@ -291,7 +291,7 @@ static void __emit_job_gen12_video(struct xe_sched_job *job, struct xe_lrc *lrc, i =emit_user_interrupt (dw, i); -XE_BUG_ON (i >MAX_JOB_SIZE_DW ); +XE_WARN_ON (i >MAX_JOB_SIZE_DW );xe_lrc_write_ring (lrc, dw, i *sizeof (*dw)); }
@@ -339,7 +339,7 @@ static void __emit_job_gen12_render_compute(struct xe_sched_job *job, i =emit_user_interrupt (dw, i); -XE_BUG_ON (i >MAX_JOB_SIZE_DW ); +XE_WARN_ON (i >MAX_JOB_SIZE_DW );xe_lrc_write_ring (lrc, dw, i *sizeof (*dw)); }
@@ -369,7 +369,7 @@ static void emit_migration_job_gen12(struct xe_sched_job *job, i =emit_user_interrupt (dw, i); -XE_BUG_ON (i >MAX_JOB_SIZE_DW ); +XE_WARN_ON (i >MAX_JOB_SIZE_DW );xe_lrc_write_ring (lrc, dw, i *sizeof (*dw)); }
drivers/gpu/drm/xe/xe_sched_job.c +1 -1
@@ -142,7 +142,7 @@ struct xe_sched_job *xe_sched_job_create(struct xe_engine *e,/* Sanity check */ for (j =0 ; j < e->width; ++j) -XE_BUG_ON (cf->base.seqno != fences[j]->seqno); +XE_WARN_ON (cf->base.seqno != fences[j]->seqno); job->fence = &cf->base; }
drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c +2 -2
@@ -188,7 +188,7 @@ u64 xe_ttm_stolen_io_offset(struct xe_bo *bo, u32 offset)struct xe_ttm_stolen_mgr *mgr =to_stolen_mgr (ttm_mgr);struct xe_res_cursor cur; -XE_BUG_ON (!mgr->io_base); +XE_WARN_ON (!mgr->io_base);if (xe_ttm_stolen_cpu_access_needs_ggtt (xe))return mgr->io_base +xe_bo_ggtt_addr (bo) + offset;
@@ -228,7 +228,7 @@ static int __xe_ttm_stolen_io_mem_reserve_stolen(struct xe_device *xe,#ifdef CONFIG_X86 struct xe_bo *bo =ttm_to_xe_bo (mem->bo); -XE_BUG_ON (IS_DGFX (xe)); +XE_WARN_ON (IS_DGFX (xe));/* XXX: Require BO to be mapped to GGTT? */ if (drm_WARN_ON (&xe->drm, !(bo->flags &XE_BO_CREATE_GGTT_BIT )))
drivers/gpu/drm/xe/xe_uc_fw.c +8 -8
@@ -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->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 ;
drivers/gpu/drm/xe/xe_uc_fw.h +1 -1
@@ -104,7 +104,7 @@ static inline enum xe_uc_fw_status __xe_uc_fw_status(struct xe_uc_fw *uc_fw) {/* shouldn't call this before checking hw/blob availability */ -XE_BUG_ON (uc_fw->status ==XE_UC_FIRMWARE_UNINITIALIZED ); +XE_WARN_ON (uc_fw->status ==XE_UC_FIRMWARE_UNINITIALIZED );return uc_fw->status; }
drivers/gpu/drm/xe/xe_vm.c +28 -28
218 lines not on this page · raw message
drivers/gpu/drm/xe/xe_wait_user_fence.c +1 -1
@@ -45,7 +45,7 @@ static int do_compare(u64 addr, u64 value, u64 mask, u16 op) passed = (rvalue & mask) <= (value & mask);break ;default : -XE_BUG_ON ("Not possible" ); +XE_WARN_ON ("Not possible" ); }return passed ?0 :1 ;
drivers/gpu/drm/xe/xe_wopcm.c +9 -9
@@ -144,10 +144,10 @@ static int __wopcm_init_regs(struct xe_device *xe, struct xe_gt *gt,u32 mask;int err; -XE_BUG_ON (!(base &GUC_WOPCM_OFFSET_MASK )); -XE_BUG_ON (base & ~GUC_WOPCM_OFFSET_MASK ); -XE_BUG_ON (!(size &GUC_WOPCM_SIZE_MASK )); -XE_BUG_ON (size & ~GUC_WOPCM_SIZE_MASK ); +XE_WARN_ON (!(base &GUC_WOPCM_OFFSET_MASK )); +XE_WARN_ON (base & ~GUC_WOPCM_OFFSET_MASK ); +XE_WARN_ON (!(size &GUC_WOPCM_SIZE_MASK )); +XE_WARN_ON (size & ~GUC_WOPCM_SIZE_MASK ); mask =GUC_WOPCM_SIZE_MASK |GUC_WOPCM_SIZE_LOCKED ; err = xe_mmio_write32_and_verify(gt, GUC_WOPCM_SIZE, size, mask,
@@ -213,9 +213,9 @@ int xe_wopcm_init(struct xe_wopcm *wopcm)drm_dbg (&xe->drm,"WOPCM: %uK\n" , wopcm->size /SZ_1K );xe_force_wake_assert_held (gt_to_fw (gt),XE_FW_GT ); -XE_BUG_ON (guc_fw_size >= wopcm->size); -XE_BUG_ON (huc_fw_size >= wopcm->size); -XE_BUG_ON (ctx_rsvd +WOPCM_RESERVED_SIZE >= wopcm->size); +XE_WARN_ON (guc_fw_size >= wopcm->size); +XE_WARN_ON (huc_fw_size >= wopcm->size); +XE_WARN_ON (ctx_rsvd +WOPCM_RESERVED_SIZE >= wopcm->size); locked =__wopcm_regs_locked (gt, &guc_wopcm_base, &guc_wopcm_size);if (locked) {
@@ -256,8 +256,8 @@ int xe_wopcm_init(struct xe_wopcm *wopcm) guc_fw_size, huc_fw_size)) { wopcm->guc.base = guc_wopcm_base; wopcm->guc.size = guc_wopcm_size; -XE_BUG_ON (!wopcm->guc.base); -XE_BUG_ON (!wopcm->guc.size); +XE_WARN_ON (!wopcm->guc.base); +XE_WARN_ON (!wopcm->guc.size); } else {drm_notice (&xe->drm,"Unsuccessful WOPCM partitioning\n" );return -E2BIG ;
Signature · 1 line
2.34.1
Jani Nikula
maintainerRe: [Intel-xe] [PATCH v3 2/3] drm/xe: Prefer WARN() over BUG() to avoid crashing the kernel
Quoted 9 lines · Francois Dugast
Replace calls to
XE_BUG_ON()with callsXE_WARN_ON()which in turn callsWARN()instead ofBUG().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 <[email protected]>Reviewed-by Rodrigo Vivi <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 2 +-
This seems to have been merged already, but it's really not helping us to touch i915 and xe in the same commits unless it's absolutely necessary. The i915 display part especially should've been a fixup patch to something else.
BR,
Jani.
Quoted 35 lines
drivers/gpu/drm/xe/xe_bb.c | 8 +-- drivers/gpu/drm/xe/xe_bo.c | 52 +++++++++--------- drivers/gpu/drm/xe/xe_bo.h | 14 ++--- drivers/gpu/drm/xe/xe_bo_evict.c | 4 +- drivers/gpu/drm/xe/xe_execlist.c | 14 ++--- drivers/gpu/drm/xe/xe_force_wake.c | 4 +- drivers/gpu/drm/xe/xe_force_wake.h | 4 +- drivers/gpu/drm/xe/xe_ggtt.c | 12 ++--- drivers/gpu/drm/xe/xe_gt_clock.c | 4 +- drivers/gpu/drm/xe/xe_gt_debugfs.c | 2 +- drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 12 ++--- drivers/gpu/drm/xe/xe_guc.c | 22 ++++---- drivers/gpu/drm/xe/xe_guc_ads.c | 14 ++--- drivers/gpu/drm/xe/xe_guc_ct.c | 22 ++++---- drivers/gpu/drm/xe/xe_guc_hwconfig.c | 2 +- drivers/gpu/drm/xe/xe_guc_log.c | 4 +- drivers/gpu/drm/xe/xe_guc_submit.c | 48 ++++++++--------- drivers/gpu/drm/xe/xe_huc.c | 2 +- drivers/gpu/drm/xe/xe_hw_engine.c | 10 ++-- drivers/gpu/drm/xe/xe_hw_fence.c | 2 +- drivers/gpu/drm/xe/xe_lrc.c | 8 +-- drivers/gpu/drm/xe/xe_macros.h | 1 - drivers/gpu/drm/xe/xe_migrate.c | 34 ++++++------ drivers/gpu/drm/xe/xe_pt.c | 22 ++++---- drivers/gpu/drm/xe/xe_res_cursor.h | 12 ++--- drivers/gpu/drm/xe/xe_ring_ops.c | 8 +-- drivers/gpu/drm/xe/xe_sched_job.c | 2 +- drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c | 4 +- drivers/gpu/drm/xe/xe_uc_fw.c | 16 +++--- drivers/gpu/drm/xe/xe_uc_fw.h | 2 +- drivers/gpu/drm/xe/xe_vm.c | 56 ++++++++++---------- drivers/gpu/drm/xe/xe_wait_user_fence.c | 2 +- drivers/gpu/drm/xe/xe_wopcm.c | 18 +++---- 34 files changed, 221 insertions(+), 222 deletions(-)
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Vivi, Rodrigo
maintainerRe: [Intel-xe] [PATCH v3 2/3] drm/xe: Prefer WARN() over BUG() to avoid crashing the kernel
Quoted 14 lines · Jani Nikula
Quoted 11 lines · Francois Dugast
Replace calls to
XE_BUG_ON()with callsXE_WARN_ON()which in turn callsWARN()instead ofBUG().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 <[email protected]>Reviewed-by Rodrigo Vivi <[email protected]>---
drivers/gpu/drm/i915/display/intel_display.c | 2 +-
Quoted 6 lines
This seems to have been merged already, but it's really not helping us
to touch i915 and xe in the same commits unless it's absolutely necessary. The i915 display part especially should've been a fixup patch
to something else.
my bad sorry.
I totally forgot to pay attention to these cases...
Quoted 44 lines
BR,
Jani.Quoted 38 lines
drivers/gpu/drm/xe/xe_bb.c | 8 +-- drivers/gpu/drm/xe/xe_bo.c | 52 +++++++++------- --
drivers/gpu/drm/xe/xe_bo.h | 14 ++--- drivers/gpu/drm/xe/xe_bo_evict.c | 4 +- drivers/gpu/drm/xe/xe_execlist.c | 14 ++--- drivers/gpu/drm/xe/xe_force_wake.c | 4 +- drivers/gpu/drm/xe/xe_force_wake.h | 4 +- drivers/gpu/drm/xe/xe_ggtt.c | 12 ++--- drivers/gpu/drm/xe/xe_gt_clock.c | 4 +- drivers/gpu/drm/xe/xe_gt_debugfs.c | 2 +- drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 12 ++--- drivers/gpu/drm/xe/xe_guc.c | 22 ++++---- drivers/gpu/drm/xe/xe_guc_ads.c | 14 ++--- drivers/gpu/drm/xe/xe_guc_ct.c | 22 ++++---- drivers/gpu/drm/xe/xe_guc_hwconfig.c | 2 +- drivers/gpu/drm/xe/xe_guc_log.c | 4 +- drivers/gpu/drm/xe/xe_guc_submit.c | 48 ++++++++-------- -
drivers/gpu/drm/xe/xe_huc.c | 2 +- drivers/gpu/drm/xe/xe_hw_engine.c | 10 ++-- drivers/gpu/drm/xe/xe_hw_fence.c | 2 +- drivers/gpu/drm/xe/xe_lrc.c | 8 +-- drivers/gpu/drm/xe/xe_macros.h | 1 - drivers/gpu/drm/xe/xe_migrate.c | 34 ++++++------ drivers/gpu/drm/xe/xe_pt.c | 22 ++++---- drivers/gpu/drm/xe/xe_res_cursor.h | 12 ++--- drivers/gpu/drm/xe/xe_ring_ops.c | 8 +-- drivers/gpu/drm/xe/xe_sched_job.c | 2 +- drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c | 4 +- drivers/gpu/drm/xe/xe_uc_fw.c | 16 +++--- drivers/gpu/drm/xe/xe_uc_fw.h | 2 +- drivers/gpu/drm/xe/xe_vm.c | 56 ++++++++++------
----
drivers/gpu/drm/xe/xe_wait_user_fence.c | 2 +- drivers/gpu/drm/xe/xe_wopcm.c | 18 +++----34 files changed, 221 insertions(+), 222 deletions(-)
PATCH v3 3/3 drm/xe: Use regular WARN_ON() instead of driver-specific XE_WARN_ON()
In reply to Francois DugastRemove XE_WARN_ON() alias to WARN_ON() and use WARN_ON() directly in order to align with other drivers and avoid using a Xe-specific version.
--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_fbdev.c | 2 +- drivers/gpu/drm/xe/display/xe_fb_pin.c | 2 +- drivers/gpu/drm/xe/xe_bb.c | 8 +- drivers/gpu/drm/xe/xe_bo.c | 66 +++++++-------- drivers/gpu/drm/xe/xe_bo.h | 14 ++-- drivers/gpu/drm/xe/xe_bo_evict.c | 4 +- drivers/gpu/drm/xe/xe_debugfs.c | 4 +- drivers/gpu/drm/xe/xe_device.c | 8 +- drivers/gpu/drm/xe/xe_dma_buf.c | 2 +- drivers/gpu/drm/xe/xe_engine.c | 2 +- drivers/gpu/drm/xe/xe_exec.c | 2 +- drivers/gpu/drm/xe/xe_execlist.c | 16 ++-- drivers/gpu/drm/xe/xe_force_wake.c | 4 +- drivers/gpu/drm/xe/xe_force_wake.h | 4 +- drivers/gpu/drm/xe/xe_ggtt.c | 18 ++--- drivers/gpu/drm/xe/xe_gt.c | 22 ++--- drivers/gpu/drm/xe/xe_gt_clock.c | 4 +- drivers/gpu/drm/xe/xe_gt_debugfs.c | 4 +- drivers/gpu/drm/xe/xe_gt_pagefault.c | 2 +- drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 12 +-- drivers/gpu/drm/xe/xe_guc.c | 26 +++--- drivers/gpu/drm/xe/xe_guc.h | 2 +- drivers/gpu/drm/xe/xe_guc_ads.c | 16 ++-- drivers/gpu/drm/xe/xe_guc_ct.c | 28 +++---- drivers/gpu/drm/xe/xe_guc_hwconfig.c | 2 +- drivers/gpu/drm/xe/xe_guc_log.c | 4 +- drivers/gpu/drm/xe/xe_guc_pc.c | 16 ++-- drivers/gpu/drm/xe/xe_guc_submit.c | 62 +++++++-------- drivers/gpu/drm/xe/xe_huc.c | 2 +- drivers/gpu/drm/xe/xe_hw_engine.c | 10 +-- drivers/gpu/drm/xe/xe_hw_fence.c | 8 +- drivers/gpu/drm/xe/xe_lrc.c | 8 +- drivers/gpu/drm/xe/xe_macros.h | 2 - drivers/gpu/drm/xe/xe_migrate.c | 40 +++++----- drivers/gpu/drm/xe/xe_mocs.c | 4 +- drivers/gpu/drm/xe/xe_pt.c | 32 ++++---- drivers/gpu/drm/xe/xe_range_fence.c | 2 +- drivers/gpu/drm/xe/xe_reg_sr.c | 4 +- drivers/gpu/drm/xe/xe_res_cursor.h | 14 ++-- drivers/gpu/drm/xe/xe_ring_ops.c | 8 +- drivers/gpu/drm/xe/xe_sched_job.c | 2 +- drivers/gpu/drm/xe/xe_sync.c | 4 +- drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c | 4 +- drivers/gpu/drm/xe/xe_uc.c | 4 +- drivers/gpu/drm/xe/xe_uc_debugfs.c | 2 +- drivers/gpu/drm/xe/xe_uc_fw.c | 18 ++--- drivers/gpu/drm/xe/xe_uc_fw.h | 2 +- drivers/gpu/drm/xe/xe_vm.c | 84 ++++++++++---------- drivers/gpu/drm/xe/xe_vm.h | 2 +- drivers/gpu/drm/xe/xe_vm_madvise.c | 2 +- drivers/gpu/drm/xe/xe_wait_user_fence.c | 2 +- drivers/gpu/drm/xe/xe_wopcm.c | 18 ++--- 53 files changed, 317 insertions(+), 319 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +1 -1
@@ -6941,7 +6941,7 @@ static int i915_gem_object_read_from_page(struct xe_bo *bo,int ret;struct ww_acquire_ctx ww; -XE_WARN_ON (size !=8 ); +WARN_ON (size !=8 ); ret =xe_bo_lock (bo, &ww,0 , true);if (ret)
drivers/gpu/drm/i915/display/intel_fbdev.c +1 -1
@@ -385,7 +385,7 @@ static int intelfb_create(struct drm_fb_helper *helper, info->fix.smem_len = obj->ttm.base.size; } -XE_WARN_ON (iosys_map_is_null (&obj->vmap)); +WARN_ON (iosys_map_is_null (&obj->vmap)); vaddr = obj->vmap.vaddr_iomem;#endif if (IS_ERR (vaddr)) {
drivers/gpu/drm/xe/display/xe_fb_pin.c +1 -1
@@ -196,7 +196,7 @@ static struct i915_vma *__xe_pin_fb_vma(struct intel_framebuffer *fb,return ERR_PTR (-ENODEV );/* Remapped view is only required on ADL-P, which xe doesn't support. */ -if (XE_WARN_ON (view->type ==I915_GTT_VIEW_REMAPPED )) { +if (WARN_ON (view->type ==I915_GTT_VIEW_REMAPPED )) { ret = -ENODEV ; goto err; }
drivers/gpu/drm/xe/xe_bb.c +4 -4
@@ -78,7 +78,7 @@ struct xe_sched_job *xe_bb_create_wa_job(struct xe_engine *wa_eng, {u64 addr = batch_base_ofs +drm_suballoc_soffset (bb->bo); -XE_WARN_ON (!(wa_eng->vm->flags &XE_VM_FLAG_MIGRATION )); +WARN_ON (!(wa_eng->vm->flags &XE_VM_FLAG_MIGRATION ));return __xe_bb_create_job (wa_eng, bb, &addr); }
@@ -94,8 +94,8 @@ struct xe_sched_job *xe_bb_create_migration_job(struct xe_engine *kernel_eng, 4 * second_idx, }; -XE_WARN_ON (second_idx > bb->len); -XE_WARN_ON (!(kernel_eng->vm->flags &XE_VM_FLAG_MIGRATION )); +WARN_ON (second_idx > bb->len); +WARN_ON (!(kernel_eng->vm->flags &XE_VM_FLAG_MIGRATION ));return __xe_bb_create_job (kernel_eng, bb, addr); }
@@ -105,7 +105,7 @@ struct xe_sched_job *xe_bb_create_job(struct xe_engine *kernel_eng, {u64 addr =xe_sa_bo_gpu_addr (bb->bo); -XE_WARN_ON (kernel_eng->vm && kernel_eng->vm->flags &XE_VM_FLAG_MIGRATION ); +WARN_ON (kernel_eng->vm && kernel_eng->vm->flags &XE_VM_FLAG_MIGRATION );return __xe_bb_create_job (kernel_eng, bb, &addr); }
drivers/gpu/drm/xe/xe_bo.c +33 -33
214 lines not on this page · raw message
drivers/gpu/drm/xe/xe_bo.h +7 -7
@@ -157,7 +157,7 @@ void xe_bo_unlock(struct xe_bo *bo, struct ww_acquire_ctx *ww);static inline void xe_bo_unlock_vm_held (struct xe_bo *bo) {if (bo) { -XE_WARN_ON (bo->vm && bo->ttm.base.resv != &bo->vm->resv); +WARN_ON (bo->vm && bo->ttm.base.resv != &bo->vm->resv);if (bo->vm)xe_vm_assert_held (bo->vm);else
@@ -169,8 +169,8 @@ static inline void xe_bo_lock_no_vm(struct xe_bo *bo, struct ww_acquire_ctx *ctx) {if (bo) { -XE_WARN_ON (bo->vm || (bo->ttm.type != ttm_bo_type_sg && - bo->ttm.base.resv != &bo->ttm.base._resv)); +WARN_ON (bo->vm || (bo->ttm.type != ttm_bo_type_sg && + bo->ttm.base.resv != &bo->ttm.base._resv));dma_resv_lock (bo->ttm.base.resv, ctx); } }
@@ -178,8 +178,8 @@ static inline void xe_bo_lock_no_vm(struct xe_bo *bo,static inline void xe_bo_unlock_no_vm (struct xe_bo *bo) {if (bo) { -XE_WARN_ON (bo->vm || (bo->ttm.type != ttm_bo_type_sg && - bo->ttm.base.resv != &bo->ttm.base._resv)); +WARN_ON (bo->vm || (bo->ttm.type != ttm_bo_type_sg && + bo->ttm.base.resv != &bo->ttm.base._resv));dma_resv_unlock (bo->ttm.base.resv); } }
@@ -223,8 +223,8 @@ xe_bo_main_addr(struct xe_bo *bo, size_t page_size)static inline u32 xe_bo_ggtt_addr (struct xe_bo *bo) { -XE_WARN_ON (bo->ggtt_node.size > bo->size); -XE_WARN_ON (bo->ggtt_node.start + bo->ggtt_node.size > (1ull <<32 )); +WARN_ON (bo->ggtt_node.size > bo->size); +WARN_ON (bo->ggtt_node.start + bo->ggtt_node.size > (1ull <<32 ));return bo->ggtt_node.start; }
drivers/gpu/drm/xe/xe_bo_evict.c +2 -2
@@ -160,8 +160,8 @@ int xe_bo_restore_kernel(struct xe_device *xe)* We expect validate to trigger a move VRAM and our move code * should setup the iosys map. */ -XE_WARN_ON (iosys_map_is_null (&bo->vmap)); -XE_WARN_ON (!xe_bo_is_vram (bo)); +WARN_ON (iosys_map_is_null (&bo->vmap)); +WARN_ON (!xe_bo_is_vram (bo));xe_bo_put (bo);
drivers/gpu/drm/xe/xe_debugfs.c +2 -2
@@ -73,7 +73,7 @@ static int forcewake_open(struct inode *inode, struct file *file)xe_device_mem_access_get (xe);for_each_gt (gt, xe, id) -XE_WARN_ON (xe_force_wake_get (gt_to_fw (gt),XE_FORCEWAKE_ALL )); +WARN_ON (xe_force_wake_get (gt_to_fw (gt),XE_FORCEWAKE_ALL ));return 0 ; }
@@ -85,7 +85,7 @@ static int forcewake_release(struct inode *inode, struct file *file)u8 id;for_each_gt (gt, xe, id) -XE_WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL )); +WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL ));xe_device_mem_access_put (xe);
drivers/gpu/drm/xe/xe_device.c +4 -4
@@ -428,7 +428,7 @@ bool xe_device_mem_access_ongoing(struct xe_device *xe)void xe_device_assert_mem_access (struct xe_device *xe) { -XE_WARN_ON (!xe_device_mem_access_ongoing (xe)); +WARN_ON (!xe_device_mem_access_ongoing (xe)); }bool xe_device_mem_access_get_if_ongoing (struct xe_device *xe)
@@ -442,7 +442,7 @@ bool xe_device_mem_access_get_if_ongoing(struct xe_device *xe)if (active) {int ref =atomic_inc_return (&xe->mem_access.ref); -XE_WARN_ON (ref ==S32_MAX ); +WARN_ON (ref ==S32_MAX ); }return active;
@@ -484,7 +484,7 @@ void xe_device_mem_access_get(struct xe_device *xe)xe_pm_runtime_get (xe); ref =atomic_inc_return (&xe->mem_access.ref); -XE_WARN_ON (ref ==S32_MAX ); +WARN_ON (ref ==S32_MAX ); }
@@ -498,5 +498,5 @@ void xe_device_mem_access_put(struct xe_device *xe) ref =atomic_dec_return (&xe->mem_access.ref);xe_pm_runtime_put (xe); -XE_WARN_ON (ref <0 ); +WARN_ON (ref <0 ); }
drivers/gpu/drm/xe/xe_dma_buf.c +1 -1
@@ -219,7 +219,7 @@ static void xe_dma_buf_move_notify(struct dma_buf_attachment *attach)struct drm_gem_object *obj = attach->importer_priv;struct xe_bo *bo =gem_to_xe_bo (obj); -XE_WARN_ON (xe_bo_evict (bo, false)); +WARN_ON (xe_bo_evict (bo, false)); }static const struct dma_buf_attach_ops xe_dma_buf_attach_ops = {
drivers/gpu/drm/xe/xe_engine.c +1 -1
@@ -761,7 +761,7 @@ bool xe_engine_ring_full(struct xe_engine *e)*/ bool xe_engine_is_idle (struct xe_engine *engine) { -if (XE_WARN_ON (xe_engine_is_parallel (engine))) +if (WARN_ON (xe_engine_is_parallel (engine)))return false; return xe_lrc_seqno(&engine->lrc[0]) ==
drivers/gpu/drm/xe/xe_exec.c +1 -1
@@ -121,7 +121,7 @@ static int xe_exec_begin(struct xe_engine *e, struct ww_acquire_ctx *ww,* to a location where the GPU can access it). */ list_for_each_entry (vma, &vm->rebind_list, combined_links.rebind) { -XE_WARN_ON (xe_vma_is_null (vma)); +WARN_ON (xe_vma_is_null (vma));if (xe_vma_is_userptr (vma))continue ;
drivers/gpu/drm/xe/xe_execlist.c +8 -8
@@ -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_WARN_ON (!FIELD_FIT (XEHP_SW_CTX_ID , ctx_id)); +WARN_ON (!FIELD_FIT (XEHP_SW_CTX_ID , ctx_id)); lrc_desc |=FIELD_PREP (XEHP_SW_CTX_ID , ctx_id); }else { -XE_WARN_ON (!FIELD_FIT (GEN11_SW_CTX_ID , ctx_id)); +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 drm_sched_priority priority = exl->entity.priority; -XE_WARN_ON (priority ==DRM_SCHED_PRIORITY_UNSET ); -XE_WARN_ON (priority <0 ); -XE_WARN_ON (priority >=ARRAY_SIZE (exl->port->active)); +WARN_ON (priority ==DRM_SCHED_PRIORITY_UNSET ); +WARN_ON (priority <0 ); +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_WARN_ON (xe_device_guc_submission_enabled (xe)); +WARN_ON (xe_device_guc_submission_enabled (xe));drm_info (&xe->drm,"Enabling execlist submission (GuC submission disabled)\n" );
@@ -369,7 +369,7 @@ static int execlist_engine_init(struct xe_engine *e)sprintf (e->name,"ccs%d" ,ffs (e->logical_mask) -1 );break ;default : -XE_WARN_ON (e->class); +WARN_ON (e->class); }return 0 ;
@@ -389,7 +389,7 @@ static void execlist_engine_fini_async(struct work_struct *w)struct xe_execlist_engine *exl = e->execlist;unsigned long flags; -XE_WARN_ON (xe_device_guc_submission_enabled (gt_to_xe (e->gt))); +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 !=DRM_SCHED_PRIORITY_UNSET ))
drivers/gpu/drm/xe/xe_force_wake.c +2 -2
@@ -45,7 +45,7 @@ void xe_force_wake_init_gt(struct xe_gt *gt, struct xe_force_wake *fw)mutex_init (&fw->lock);/* Assuming gen11+ so assert this assumption is correct */ -XE_WARN_ON (GRAPHICS_VER (gt_to_xe (gt)) <11 ); +WARN_ON (GRAPHICS_VER (gt_to_xe (gt)) <11 );if (xe->info.graphics_verx100 >=1270 ) { domain_init(&fw->domains[XE_FW_DOMAIN_ID_GT],
@@ -67,7 +67,7 @@ void xe_force_wake_init_engines(struct xe_gt *gt, struct xe_force_wake *fw)int i, j;/* Assuming gen11+ so assert this assumption is correct */ -XE_WARN_ON (GRAPHICS_VER (gt_to_xe (gt)) <11 ); +WARN_ON (GRAPHICS_VER (gt_to_xe (gt)) <11 );if (!xe_gt_is_media_type (gt)) domain_init(&fw->domains[XE_FW_DOMAIN_ID_RENDER],
drivers/gpu/drm/xe/xe_force_wake.h +2 -2
@@ -24,7 +24,7 @@ static inline int xe_force_wake_ref(struct xe_force_wake *fw, enum xe_force_wake_domains domain) { - XE_WARN_ON(!domain); + WARN_ON(!domain);return fw->domains[ffs (domain) -1 ].ref; }
@@ -32,7 +32,7 @@ static inline void xe_force_wake_assert_held(struct xe_force_wake *fw, enum xe_force_wake_domains domain) { - XE_WARN_ON(!(fw->awake_domains & domain)); + WARN_ON(!(fw->awake_domains & domain)); }#endif
drivers/gpu/drm/xe/xe_ggtt.c +9 -9
@@ -59,8 +59,8 @@ static unsigned int probe_gsm_size(struct pci_dev *pdev)void xe_ggtt_set_pte (struct xe_ggtt *ggtt,u64 addr,u64 pte) { -XE_WARN_ON (addr &XE_PTE_MASK ); -XE_WARN_ON (addr >= ggtt->size); +WARN_ON (addr &XE_PTE_MASK ); +WARN_ON (addr >= ggtt->size);writeq (pte, &ggtt->gsm[addr >>XE_PTE_SHIFT ]); }
@@ -70,7 +70,7 @@ static void xe_ggtt_clear(struct xe_ggtt *ggtt, u64 start, u64 size)u64 end = start + size -1 ;u64 scratch_pte; -XE_WARN_ON (start >= end); +WARN_ON (start >= end);if (ggtt->scratch) scratch_pte =xe_ggtt_pte_encode (ggtt->scratch,0 );
@@ -231,7 +231,7 @@ static void ggtt_invalidate_gt_tlb(struct xe_gt *gt)int seqno; seqno =xe_gt_tlb_invalidation_guc (gt); -XE_WARN_ON (seqno <=0 ); +WARN_ON (seqno <=0 );if (seqno >0 )xe_gt_tlb_invalidation_wait (gt, seqno); }else if (xe_device_guc_submission_enabled (gt_to_xe (gt))) {
@@ -267,7 +267,7 @@ void xe_ggtt_printk(struct xe_ggtt *ggtt, const char *prefix)for (addr =0 ; addr < ggtt->size; addr +=XE_PAGE_SIZE ) {unsigned int i = addr /XE_PAGE_SIZE ; -XE_WARN_ON (addr >U32_MAX ); +WARN_ON (addr >U32_MAX );if (ggtt->gsm[i] == scratch_pte)continue ;
@@ -318,9 +318,9 @@ static int __xe_ggtt_insert_bo_at(struct xe_ggtt *ggtt, struct xe_bo *bo,if (xe_bo_is_vram (bo) && ggtt->flags &XE_GGTT_FLAGS_64K ) alignment =SZ_64K ; -if (XE_WARN_ON (bo->ggtt_node.size)) { +if (WARN_ON (bo->ggtt_node.size)) {/* Someone's already inserted this BO in the GGTT */ -XE_WARN_ON (bo->ggtt_node.size != bo->size); +WARN_ON (bo->ggtt_node.size != bo->size);return 0 ; }
@@ -368,11 +368,11 @@ void xe_ggtt_remove_node(struct xe_ggtt *ggtt, struct drm_mm_node *node)void xe_ggtt_remove_bo (struct xe_ggtt *ggtt,struct xe_bo *bo) { -if (XE_WARN_ON (!bo->ggtt_node.size)) +if (WARN_ON (!bo->ggtt_node.size))return ;/* This BO is not currently in the GGTT */ -XE_WARN_ON (bo->ggtt_node.size != bo->size); +WARN_ON (bo->ggtt_node.size != bo->size);xe_ggtt_remove_node (ggtt, &bo->ggtt_node); }
drivers/gpu/drm/xe/xe_gt.c +11 -11
@@ -323,7 +323,7 @@ static int gt_fw_domain_init(struct xe_gt *gt) goto err_force_wake; err =xe_force_wake_put (gt_to_fw (gt),XE_FW_GT ); -XE_WARN_ON (err); +WARN_ON (err);xe_device_mem_access_put (gt_to_xe (gt));return 0 ;
@@ -395,7 +395,7 @@ static int all_fw_domain_init(struct xe_gt *gt) goto err_force_wake; err =xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL ); -XE_WARN_ON (err); +WARN_ON (err);xe_device_mem_access_put (gt_to_xe (gt));return 0 ;
@@ -537,16 +537,16 @@ static int gt_reset(struct xe_gt *gt) err =xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL );xe_device_mem_access_put (gt_to_xe (gt)); -XE_WARN_ON (err); +WARN_ON (err);xe_gt_info (gt,"reset done\n" );return 0 ; err_out: -XE_WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL )); +WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL )); err_msg: -XE_WARN_ON (xe_uc_start (>->uc)); +WARN_ON (xe_uc_start (>->uc));xe_device_mem_access_put (gt_to_xe (gt));xe_gt_err (gt,"reset failed (%pe)\n" ,ERR_PTR (err));
@@ -575,11 +575,11 @@ void xe_gt_reset_async(struct xe_gt *gt)void xe_gt_suspend_prepare (struct xe_gt *gt) {xe_device_mem_access_get (gt_to_xe (gt)); -XE_WARN_ON (xe_force_wake_get (gt_to_fw (gt),XE_FORCEWAKE_ALL )); +WARN_ON (xe_force_wake_get (gt_to_fw (gt),XE_FORCEWAKE_ALL ));xe_uc_stop_prepare (>->uc); -XE_WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL )); +WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL ));xe_device_mem_access_put (gt_to_xe (gt)); }
@@ -602,14 +602,14 @@ int xe_gt_suspend(struct xe_gt *gt)if (err) goto err_force_wake; -XE_WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL )); +WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL ));xe_device_mem_access_put (gt_to_xe (gt));xe_gt_info (gt,"suspended\n" );return 0 ; err_force_wake: -XE_WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL )); +WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL )); err_msg:xe_device_mem_access_put (gt_to_xe (gt));xe_gt_err (gt,"suspend failed (%pe)\n" ,ERR_PTR (err));
@@ -630,14 +630,14 @@ int xe_gt_resume(struct xe_gt *gt)if (err) goto err_force_wake; -XE_WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL )); +WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL ));xe_device_mem_access_put (gt_to_xe (gt));xe_gt_info (gt,"resumed\n" );return 0 ; err_force_wake: -XE_WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL )); +WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL )); err_msg:xe_device_mem_access_put (gt_to_xe (gt));xe_gt_err (gt,"resume failed (%pe)\n" ,ERR_PTR (err));
drivers/gpu/drm/xe/xe_gt_clock.c +2 -2
@@ -47,7 +47,7 @@ static u32 get_crystal_clock_freq(u32 rpm_config_reg)case RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_25_MHZ :return f25_mhz;default : -XE_WARN_ON ("NOT_POSSIBLE" ); +WARN_ON ("NOT_POSSIBLE" );return 0 ; } }
@@ -58,7 +58,7 @@ int xe_gt_clock_init(struct xe_gt *gt)u32 freq =0 ;/* Assuming gen11+ so assert this assumption is correct */ -XE_WARN_ON (GRAPHICS_VER (gt_to_xe (gt)) <11 ); +WARN_ON (GRAPHICS_VER (gt_to_xe (gt)) <11 );if (ctc_reg &CTC_SOURCE_DIVIDE_LOGIC ) { freq =read_reference_ts_freq (gt);
drivers/gpu/drm/xe/xe_gt_debugfs.c +2 -2
@@ -157,12 +157,12 @@ void xe_gt_debugfs_register(struct xe_gt *gt)char name[8 ];int i; -XE_WARN_ON (!minor->debugfs_root); +WARN_ON (!minor->debugfs_root);sprintf (name,"gt%d" , gt->info.id); root =debugfs_create_dir (name, minor->debugfs_root);if (IS_ERR (root)) { -XE_WARN_ON ("Create GT directory failed" ); +WARN_ON ("Create GT directory failed" );return ; }
drivers/gpu/drm/xe/xe_gt_pagefault.c +1 -1
@@ -346,7 +346,7 @@ int xe_guc_pagefault_handler(struct xe_guc *guc, u32 *msg, u32 len) pf_queue->tail = (pf_queue->tail + len) %PF_QUEUE_NUM_DW ;queue_work (gt->usm.pf_wq, &pf_queue->worker); }else { -XE_WARN_ON ("PF Queue full, shouldn't be possible" ); +WARN_ON ("PF Queue full, shouldn't be possible" ); }spin_unlock_irqrestore (&pf_queue->lock, flags);
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +6 -6
@@ -250,7 +250,7 @@ int xe_gt_tlb_invalidation_vma(struct xe_gt *gt,u32 action[MAX_TLB_INVALIDATION_LEN ];int len =0 ; -XE_WARN_ON (!vma); +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_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)); +WARN_ON (length <SZ_4K ); +WARN_ON (!is_power_of_2 (length)); +WARN_ON (length &GENMASK (ilog2 (SZ_16M ) -1 ,ilog2 (SZ_2M ) +1 )); +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_WARN_ON (len >MAX_TLB_INVALIDATION_LEN ); +WARN_ON (len >MAX_TLB_INVALIDATION_LEN );return send_tlb_invalidation (>->uc.guc, fence, action, len); }
drivers/gpu/drm/xe/xe_guc.c +13 -13
@@ -43,9 +43,9 @@ static u32 guc_bo_ggtt_addr(struct xe_guc *guc, {u32 addr =xe_bo_ggtt_addr (bo); -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); +WARN_ON (addr <xe_wopcm_size (guc_to_xe (guc))); +WARN_ON (addr >=GUC_GGTT_TOP ); +WARN_ON (bo->size >GUC_GGTT_TOP - addr);return addr; }
@@ -614,13 +614,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_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 ]) != +WARN_ON (guc->ct.enabled); +WARN_ON (!len); +WARN_ON (len >VF_SW_FLAG_COUNT ); +WARN_ON (len >MED_VF_SW_FLAG_COUNT ); +WARN_ON (FIELD_GET (GUC_HXG_MSG_0_ORIGIN , request[0 ]) !=GUC_HXG_ORIGIN_HOST ); -XE_WARN_ON (FIELD_GET (GUC_HXG_MSG_0_TYPE , request[0 ]) != +WARN_ON (FIELD_GET (GUC_HXG_MSG_0_TYPE , request[0 ]) !=GUC_HXG_TYPE_REQUEST ); retry:
@@ -729,8 +729,8 @@ static int guc_self_cfg(struct xe_guc *guc, u16 key, u16 len, u64 val) };int ret; -XE_WARN_ON (len >2 ); -XE_WARN_ON (len ==1 &&upper_32_bits (val)); +WARN_ON (len >2 ); +WARN_ON (len ==1 &&upper_32_bits (val));/* Self config must go over MMIO */ ret =xe_guc_mmio_send (guc, request,ARRAY_SIZE (request));
@@ -780,7 +780,7 @@ void xe_guc_reset_wait(struct xe_guc *guc)void xe_guc_stop_prepare (struct xe_guc *guc) { -XE_WARN_ON (xe_guc_pc_stop (&guc->pc)); +WARN_ON (xe_guc_pc_stop (&guc->pc)); }int xe_guc_stop (struct xe_guc *guc)
@@ -801,7 +801,7 @@ int xe_guc_start(struct xe_guc *guc)int ret; ret =xe_guc_pc_start (&guc->pc); -XE_WARN_ON (ret); +WARN_ON (ret);return xe_guc_submit_start (guc); }
drivers/gpu/drm/xe/xe_guc.h +1 -1
@@ -52,7 +52,7 @@ static inline u16 xe_engine_class_to_guc_class(enum xe_engine_class class)return GUC_COMPUTE_CLASS ;case XE_ENGINE_CLASS_OTHER :default : -XE_WARN_ON (class); +WARN_ON (class);return -1 ; } }
drivers/gpu/drm/xe/xe_guc_ads.c +8 -8
@@ -118,7 +118,7 @@ struct __guc_ads_blob {static size_t guc_ads_regset_size (struct xe_guc_ads *ads) { -XE_WARN_ON (!ads->regset_size); +WARN_ON (!ads->regset_size);return ads->regset_size; }
@@ -312,12 +312,12 @@ int xe_guc_ads_init_post_hwconfig(struct xe_guc_ads *ads)struct xe_gt *gt =ads_to_gt (ads);u32 prev_regset_size = ads->regset_size; -XE_WARN_ON (!ads->bo); +WARN_ON (!ads->bo); ads->golden_lrc_size =calculate_golden_lrc_size (ads); ads->regset_size =calculate_regset_size (gt); -XE_WARN_ON (ads->golden_lrc_size + +WARN_ON (ads->golden_lrc_size + (ads->regset_size - prev_regset_size) >MAX_GOLDEN_LRC_SIZE );
@@ -518,7 +518,7 @@ static void guc_mmio_reg_state_init(struct xe_guc_ads *ads) regset_used += count *sizeof (struct guc_mmio_reg ); } -XE_WARN_ON (regset_used > ads->regset_size); +WARN_ON (regset_used > ads->regset_size); }static void guc_um_init_params (struct xe_guc_ads *ads)
@@ -573,7 +573,7 @@ void xe_guc_ads_populate_minimal(struct xe_guc_ads *ads) offsetof(struct __guc_ads_blob, system_info));u32 base =xe_bo_ggtt_addr (ads->bo); -XE_WARN_ON (!ads->bo); +WARN_ON (!ads->bo);xe_map_memset (ads_to_xe (ads),ads_to_map (ads),0 ,0 , ads->bo->size);guc_policies_init (ads);
@@ -597,7 +597,7 @@ void xe_guc_ads_populate(struct xe_guc_ads *ads) offsetof(struct __guc_ads_blob, system_info));u32 base =xe_bo_ggtt_addr (ads->bo); -XE_WARN_ON (!ads->bo); +WARN_ON (!ads->bo);xe_map_memset (ads_to_xe (ads),ads_to_map (ads),0 ,0 , ads->bo->size);guc_policies_init (ads);
@@ -647,7 +647,7 @@ static void guc_populate_golden_lrc(struct xe_guc_ads *ads) engine_enabled_masks[guc_class]))continue ; -XE_WARN_ON (!gt->default_lrc[class]); +WARN_ON (!gt->default_lrc[class]); real_size =xe_lrc_size (xe, class); alloc_size =PAGE_ALIGN (real_size);
@@ -676,7 +676,7 @@ static void guc_populate_golden_lrc(struct xe_guc_ads *ads) offset += alloc_size; } -XE_WARN_ON (total_size != ads->golden_lrc_size); +WARN_ON (total_size != ads->golden_lrc_size); }void xe_guc_ads_populate_post_load (struct xe_guc_ads *ads)
drivers/gpu/drm/xe/xe_guc_ct.c +14 -14
@@ -135,7 +135,7 @@ int xe_guc_ct_init(struct xe_guc_ct *ct)struct xe_bo *bo;int err; -XE_WARN_ON (guc_ct_size () %PAGE_SIZE ); +WARN_ON (guc_ct_size () %PAGE_SIZE );mutex_init (&ct->lock);spin_lock_init (&ct->fast_lock);
@@ -284,7 +284,7 @@ int xe_guc_ct_enable(struct xe_guc_ct *ct)struct xe_device *xe =ct_to_xe (ct);int err; -XE_WARN_ON (ct->enabled); +WARN_ON (ct->enabled);guc_ct_ctb_h2g_init (xe, &ct->ctbs.h2g, &ct->bo->vmap);guc_ct_ctb_g2h_init (xe, &ct->ctbs.g2h, &ct->bo->vmap);
@@ -377,7 +377,7 @@ static void h2g_reserve_space(struct xe_guc_ct *ct, u32 cmd_len)static void __g2h_reserve_space (struct xe_guc_ct *ct,u32 g2h_len,u32 num_g2h) { -XE_WARN_ON (g2h_len > ct->ctbs.g2h.info.space); +WARN_ON (g2h_len > ct->ctbs.g2h.info.space);if (g2h_len) {lockdep_assert_held (&ct->fast_lock);
@@ -390,7 +390,7 @@ static void __g2h_reserve_space(struct xe_guc_ct *ct, u32 g2h_len, u32 num_g2h)static void __g2h_release_space (struct xe_guc_ct *ct,u32 g2h_len) {lockdep_assert_held (&ct->fast_lock); -XE_WARN_ON (ct->ctbs.g2h.info.space + g2h_len > +WARN_ON (ct->ctbs.g2h.info.space + g2h_len > ct->ctbs.g2h.info.size - ct->ctbs.g2h.info.resv_space); ct->ctbs.g2h.info.space += g2h_len;
@@ -420,8 +420,8 @@ 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_WARN_ON (full_len > (GUC_CTB_MSG_MAX_LEN -GUC_CTB_HDR_LEN )); -XE_WARN_ON (tail > h2g->info.size); +WARN_ON (full_len > (GUC_CTB_MSG_MAX_LEN -GUC_CTB_HDR_LEN )); +WARN_ON (tail > h2g->info.size);/* Command will wrap, zero fill (NOPs), return and check credits again */ if (tail + full_len > h2g->info.size) {
@@ -479,10 +479,10 @@ static int __guc_ct_send_locked(struct xe_guc_ct *ct, const u32 *action, {int ret; -XE_WARN_ON (g2h_len && g2h_fence); -XE_WARN_ON (num_g2h && g2h_fence); -XE_WARN_ON (g2h_len && !num_g2h); -XE_WARN_ON (!g2h_len && num_g2h); +WARN_ON (g2h_len && g2h_fence); +WARN_ON (num_g2h && g2h_fence); +WARN_ON (g2h_len && !num_g2h); +WARN_ON (!g2h_len && num_g2h);lockdep_assert_held (&ct->lock);if (unlikely (ct->ctbs.h2g.info.broken)) {
@@ -553,7 +553,7 @@ static int guc_ct_send_locked(struct xe_guc_ct *ct, const u32 *action, u32 len,unsigned int sleep_period_ms =1 ;int ret; -XE_WARN_ON (g2h_len && g2h_fence); +WARN_ON (g2h_len && g2h_fence);lockdep_assert_held (&ct->lock);xe_device_assert_mem_access (ct_to_xe (ct));
@@ -623,7 +623,7 @@ static int guc_ct_send(struct xe_guc_ct *ct, const u32 *action, u32 len, {int ret; -XE_WARN_ON (g2h_len && g2h_fence); +WARN_ON (g2h_len && g2h_fence);mutex_lock (&ct->lock); ret =guc_ct_send_locked (ct, action, len, g2h_len, num_g2h, g2h_fence);
@@ -799,7 +799,7 @@ static int parse_g2h_response(struct xe_guc_ct *ct, u32 *msg, u32 len)return 0 ; } -XE_WARN_ON (fence != g2h_fence->seqno); +WARN_ON (fence != g2h_fence->seqno);if (type ==GUC_HXG_TYPE_RESPONSE_FAILURE ) { g2h_fence->fail = true;
@@ -1024,7 +1024,7 @@ static void g2h_fast_path(struct xe_guc_ct *ct, u32 *msg, u32 len) adj_len);break ;default : -XE_WARN_ON ("NOT_POSSIBLE" ); +WARN_ON ("NOT_POSSIBLE" ); }if (ret)
drivers/gpu/drm/xe/xe_guc_hwconfig.c +1 -1
@@ -120,7 +120,7 @@ void xe_guc_hwconfig_copy(struct xe_guc *guc, void *dst) {struct xe_device *xe =guc_to_xe (guc); -XE_WARN_ON (!guc->hwconfig.bo); +WARN_ON (!guc->hwconfig.bo);xe_map_memcpy_from (xe, dst, &guc->hwconfig.bo->vmap,0 , guc->hwconfig.size);
drivers/gpu/drm/xe/xe_guc_log.c +2 -2
@@ -55,12 +55,12 @@ void xe_guc_log_print(struct xe_guc_log *log, struct drm_printer *p)size_t size;int i, j; -XE_WARN_ON (!log->bo); +WARN_ON (!log->bo); size = log->bo->size;#define DW_PER_READ 128 -XE_WARN_ON (size % (DW_PER_READ *sizeof (u32))); +WARN_ON (size % (DW_PER_READ *sizeof (u32)));for (i =0 ; i < size /sizeof (u32); i +=DW_PER_READ ) {u32 read[DW_PER_READ ];
drivers/gpu/drm/xe/xe_guc_pc.c +8 -8
@@ -402,7 +402,7 @@ static ssize_t freq_cur_show(struct device *dev, freq =REG_FIELD_GET (REQ_RATIO_MASK , freq); ret =sysfs_emit (buf,"%d\n" ,decode_freq (freq)); -XE_WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL )); +WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL )); out:xe_device_mem_access_put (gt_to_xe (gt));return ret;
@@ -471,7 +471,7 @@ static ssize_t freq_min_show(struct device *dev, ret =sysfs_emit (buf,"%d\n" ,pc_get_min_freq (pc)); fw: -XE_WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL )); +WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL )); out:mutex_unlock (&pc->freq_lock);xe_device_mem_access_put (pc_to_xe (pc));
@@ -761,7 +761,7 @@ int xe_guc_pc_gucrc_disable(struct xe_guc_pc *pc)xe_mmio_write32 (gt,RC_CONTROL ,0 );xe_mmio_write32 (gt,RC_STATE ,0 ); -XE_WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL )); +WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL ));xe_device_mem_access_put (pc_to_xe (pc));return 0 ; }
@@ -771,7 +771,7 @@ static void pc_init_pcode_freq(struct xe_guc_pc *pc)u32 min =DIV_ROUND_CLOSEST (pc->rpn_freq,GT_FREQUENCY_MULTIPLIER );u32 max =DIV_ROUND_CLOSEST (pc->rp0_freq,GT_FREQUENCY_MULTIPLIER ); -XE_WARN_ON (xe_pcode_init_min_freq_table (pc_to_gt (pc), min, max)); +WARN_ON (xe_pcode_init_min_freq_table (pc_to_gt (pc), min, max)); }static int pc_init_freqs (struct xe_guc_pc *pc)
@@ -814,7 +814,7 @@ int xe_guc_pc_start(struct xe_guc_pc *pc)u32 size =PAGE_ALIGN (sizeof (struct slpc_shared_data ));int ret; -XE_WARN_ON (!xe_device_guc_submission_enabled (xe)); +WARN_ON (!xe_device_guc_submission_enabled (xe));xe_device_mem_access_get (pc_to_xe (pc));
@@ -848,7 +848,7 @@ int xe_guc_pc_start(struct xe_guc_pc *pc) ret =pc_action_setup_gucrc (pc,XE_GUCRC_FIRMWARE_CONTROL ); out: -XE_WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL )); +WARN_ON (xe_force_wake_put (gt_to_fw (gt),XE_FORCEWAKE_ALL ));xe_device_mem_access_put (pc_to_xe (pc));return ret; }
@@ -885,8 +885,8 @@ static void pc_fini(struct drm_device *drm, void *arg) {struct xe_guc_pc *pc = arg; -XE_WARN_ON (xe_guc_pc_gucrc_disable (pc)); -XE_WARN_ON (xe_guc_pc_stop (pc)); +WARN_ON (xe_guc_pc_gucrc_disable (pc)); +WARN_ON (xe_guc_pc_stop (pc));sysfs_remove_files (pc_to_gt (pc)->sysfs, pc_attrs);xe_bo_unpin_map_no_vm (pc->bo); }
drivers/gpu/drm/xe/xe_guc_submit.c +31 -31
211 lines not on this page · raw message
drivers/gpu/drm/xe/xe_huc.c +1 -1
@@ -72,7 +72,7 @@ int xe_huc_auth(struct xe_huc *huc)if (xe_uc_fw_is_disabled (&huc->fw))return 0 ; -XE_WARN_ON (xe_uc_fw_is_running (&huc->fw)); +WARN_ON (xe_uc_fw_is_running (&huc->fw));if (!xe_uc_fw_is_loaded (&huc->fw))return -ENOEXEC ;
drivers/gpu/drm/xe/xe_hw_engine.c +5 -5
@@ -237,7 +237,7 @@ static void hw_engine_fini(struct drm_device *drm, void *arg)static void hw_engine_mmio_write32 (struct xe_hw_engine *hwe,struct xe_reg reg,u32 val) { -XE_WARN_ON (reg.addr & hwe->mmio_base); +WARN_ON (reg.addr & hwe->mmio_base);xe_force_wake_assert_held (gt_to_fw (hwe->gt), hwe->domain); reg.addr += hwe->mmio_base;
@@ -247,7 +247,7 @@ static void hw_engine_mmio_write32(struct xe_hw_engine *hwe, struct xe_reg reg,static u32 hw_engine_mmio_read32 (struct xe_hw_engine *hwe,struct xe_reg reg) { -XE_WARN_ON (reg.addr & hwe->mmio_base); +WARN_ON (reg.addr & hwe->mmio_base);xe_force_wake_assert_held (gt_to_fw (hwe->gt), hwe->domain); reg.addr += hwe->mmio_base;
@@ -351,7 +351,7 @@ static void hw_engine_init_early(struct xe_gt *gt, struct xe_hw_engine *hwe, info = &engine_infos[id]; -XE_WARN_ON (hwe->gt); +WARN_ON (hwe->gt); hwe->gt = gt; hwe->class = info->class;
@@ -377,8 +377,8 @@ static int hw_engine_init(struct xe_gt *gt, struct xe_hw_engine *hwe,struct xe_tile *tile =gt_to_tile (gt);int err; -XE_WARN_ON (id >=ARRAY_SIZE (engine_infos) || !engine_infos[id].name); -XE_WARN_ON (!(gt->info.engine_mask &BIT (id))); +WARN_ON (id >=ARRAY_SIZE (engine_infos) || !engine_infos[id].name); +WARN_ON (!(gt->info.engine_mask &BIT (id)));xe_reg_sr_apply_mmio (&hwe->reg_sr, gt);xe_reg_sr_apply_whitelist (hwe);
drivers/gpu/drm/xe/xe_hw_fence.c +4 -4
@@ -88,14 +88,14 @@ void xe_hw_fence_irq_finish(struct xe_hw_fence_irq *irq)int err;bool tmp; -if (XE_WARN_ON (!list_empty (&irq->pending))) { +if (WARN_ON (!list_empty (&irq->pending))) { tmp =dma_fence_begin_signalling ();spin_lock_irqsave (&irq->lock, flags);list_for_each_entry_safe (fence, next, &irq->pending, irq_link) {list_del_init (&fence->irq_link); err =dma_fence_signal_locked (&fence->dma);dma_fence_put (&fence->dma); -XE_WARN_ON (err); +WARN_ON (err); }spin_unlock_irqrestore (&irq->lock, flags);dma_fence_end_signalling (tmp);
@@ -188,7 +188,7 @@ static void xe_hw_fence_release(struct dma_fence *dma_fence)struct xe_hw_fence *fence =to_xe_hw_fence (dma_fence);trace_xe_hw_fence_free (fence); -XE_WARN_ON (!list_empty (&fence->irq_link)); +WARN_ON (!list_empty (&fence->irq_link));call_rcu (&dma_fence->rcu, fence_free); }
@@ -202,7 +202,7 @@ static const struct dma_fence_ops xe_hw_fence_ops = {static struct xe_hw_fence *to_xe_hw_fence (struct dma_fence *fence) { -if (XE_WARN_ON (fence->ops != &xe_hw_fence_ops)) +if (WARN_ON (fence->ops != &xe_hw_fence_ops))return NULL ; return container_of(fence, struct xe_hw_fence, dma);
drivers/gpu/drm/xe/xe_lrc.c +4 -4
@@ -108,7 +108,7 @@ static void set_offsets(u32 *regs, *regs |=MI_LRI_LRM_CS_MMIO ; regs++; -XE_WARN_ON (!count); +WARN_ON (!count); do { u32 offset = 0; u8 v;
@@ -528,7 +528,7 @@ static inline struct iosys_map __xe_lrc_##elem##_map(struct xe_lrc *lrc) \ { \struct iosys_map map = lrc->bo->vmap; \ \ -XE_WARN_ON (iosys_map_is_null (&map)); \ +WARN_ON (iosys_map_is_null (&map)); \ iosys_map_incr(&map, __xe_lrc_##elem##_offset(lrc)); \return map; \ } \
@@ -759,12 +759,12 @@ void xe_lrc_write_ring(struct xe_lrc *lrc, const void *data, size_t size)u32 rhs;size_t aligned_size; -XE_WARN_ON (!IS_ALIGNED (size,4 )); +WARN_ON (!IS_ALIGNED (size,4 )); aligned_size =ALIGN (size,8 ); ring =__xe_lrc_ring_map (lrc); -XE_WARN_ON (lrc->ring.tail >= lrc->ring.size); +WARN_ON (lrc->ring.tail >= lrc->ring.size); rhs = lrc->ring.size - lrc->ring.tail;if (size > rhs) {__xe_lrc_write_ring (lrc, ring, data, rhs);
drivers/gpu/drm/xe/xe_macros.h +0 -2
@@ -8,8 +8,6 @@#include <linux/bug.h> -#define XE_WARN_ON WARN_ON -#define XE_IOCTL_DBG (xe, cond) \ ((cond) && (drm_dbg(&(xe)->drm, \ "Ioctl argument check failed at %s:%d: %s", \
drivers/gpu/drm/xe/xe_migrate.c +20 -20
@@ -106,7 +106,7 @@ static void xe_migrate_fini(struct drm_device *dev, void *arg)static u64 xe_migrate_vm_addr (u64 slot,u32 level) { -XE_WARN_ON (slot >=NUM_PT_SLOTS ); +WARN_ON (slot >=NUM_PT_SLOTS );/* First slot is reserved for mapping of PT bo and bb, start from 1 */ return (slot +1ULL ) <<xe_pt_shift (level +1 );
@@ -148,7 +148,7 @@ static int xe_migrate_create_cleared_bo(struct xe_migrate *m, struct xe_vm *vm)xe_map_memset (xe, &m->cleared_bo->vmap,0 ,0x00 , cleared_size); vram_addr =xe_bo_addr (m->cleared_bo,0 ,XE_PAGE_SIZE , &is_vram); -XE_WARN_ON (!is_vram); +WARN_ON (!is_vram); m->cleared_vram_ofs =xe_migrate_vram_ofs (vram_addr);return 0 ;
@@ -173,7 +173,7 @@ static int xe_migrate_prepare_vm(struct xe_tile *tile, struct xe_migrate *m,BUILD_BUG_ON (!(NUM_KERNEL_PDE &1 ));/* Need to be sure everything fits in the first PT, or create more */ -XE_WARN_ON (m->batch_base_ofs + batch->size >=SZ_2M ); +WARN_ON (m->batch_base_ofs + batch->size >=SZ_2M ); bo = xe_bo_create_pin_map(vm->xe, tile, vm, num_entries * XE_PAGE_SIZE,
@@ -208,7 +208,7 @@ static int xe_migrate_prepare_vm(struct xe_tile *tile, struct xe_migrate *m, }if (!IS_DGFX (xe)) { -XE_WARN_ON (xe->info.supports_usm); +WARN_ON (xe->info.supports_usm);/* Write out batch too */ m->batch_base_ofs =NUM_PT_SLOTS *XE_PAGE_SIZE ;
@@ -464,7 +464,7 @@ static void emit_pte(struct xe_migrate *m,/* Is this a 64K PTE entry? */ if ((m->eng->vm->flags &XE_VM_FLAG_64K ) && !(cur_ofs & (16 *8 -1 ))) { -XE_WARN_ON (!IS_ALIGNED (addr,SZ_64K )); +WARN_ON (!IS_ALIGNED (addr,SZ_64K )); addr |=XE_PTE_PS64 ; }
@@ -493,7 +493,7 @@ static void emit_copy_ccs(struct xe_gt *gt, struct xe_bb *bb, num_ccs_blks =DIV_ROUND_UP (xe_device_ccs_bytes (gt_to_xe (gt), size),NUM_CCS_BYTES_PER_BLOCK ); -XE_WARN_ON (num_ccs_blks >NUM_CCS_BLKS_PER_XFER ); +WARN_ON (num_ccs_blks >NUM_CCS_BLKS_PER_XFER ); *cs++ =XY_CTRL_SURF_COPY_BLT | (src_is_indirect ?0x0 :0x1 ) <<SRC_ACCESS_TYPE_SHIFT | (dst_is_indirect ? 0x0 : 0x1) << DST_ACCESS_TYPE_SHIFT |
@@ -513,9 +513,9 @@ static void emit_copy(struct xe_gt *gt, struct xe_bb *bb, u64 src_ofs, u64 dst_ofs, unsigned int size, unsigned int pitch) { - XE_WARN_ON(size / pitch > S16_MAX); -XE_WARN_ON (pitch /4 >S16_MAX ); -XE_WARN_ON (pitch >U16_MAX ); + WARN_ON(size / pitch > S16_MAX); +WARN_ON (pitch /4 >S16_MAX ); +WARN_ON (pitch >U16_MAX ); bb->cs[bb->len++] =XY_FAST_COPY_BLT_CMD | (10 -2 ); bb->cs[bb->len++] =XY_FAST_COPY_BLT_DEPTH_32 | pitch;
@@ -575,7 +575,7 @@ static u32 xe_migrate_ccs_copy(struct xe_migrate *m,* At the moment, we don't support copying CCS metadata from * system to system. */ -XE_WARN_ON (!src_is_vram && !dst_is_vram); +WARN_ON (!src_is_vram && !dst_is_vram);emit_copy_ccs (gt, bb, dst_ofs, dst_is_vram, src_ofs, src_is_vram, dst_size);
@@ -627,10 +627,10 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,bool copy_system_ccs = copy_ccs && (!src_is_vram || !dst_is_vram);/* Copying CCS between two different BOs is not supported yet. */ -if (XE_WARN_ON (copy_ccs && src_bo != dst_bo)) +if (WARN_ON (copy_ccs && src_bo != dst_bo))return ERR_PTR (-EINVAL ); -if (src_bo != dst_bo &&XE_WARN_ON (src_bo->size != dst_bo->size)) +if (src_bo != dst_bo &&WARN_ON (src_bo->size != dst_bo->size))return ERR_PTR (-EINVAL );if (!src_is_vram)
@@ -787,7 +787,7 @@ static void emit_clear_link_copy(struct xe_gt *gt, struct xe_bb *bb, u64 src_ofs *cs++ =upper_32_bits (src_ofs); *cs++ =FIELD_PREP (PVC_MS_MOCS_INDEX_MASK , mocs); -XE_WARN_ON (cs - bb->cs != len + bb->len); +WARN_ON (cs - bb->cs != len + bb->len); bb->len += len; }
@@ -825,7 +825,7 @@ static void emit_clear_main_copy(struct xe_gt *gt, struct xe_bb *bb, *cs++ =0 ; } -XE_WARN_ON (cs - bb->cs != len + bb->len); +WARN_ON (cs - bb->cs != len + bb->len); bb->len += len; }
@@ -998,16 +998,16 @@ static void write_pgtable(struct xe_tile *tile, struct xe_bb *bb, u64 ppgtt_ofs,* PDE. This requires a BO that is almost vm->size big. * * This shouldn't be possible in practice.. might change when 16K -* pages are used. Hence the XE_WARN_ON. +* pages are used. Hence the WARN_ON. */ -XE_WARN_ON (update->qwords >0x1ff ); +WARN_ON (update->qwords >0x1ff );if (!ppgtt_ofs) {bool is_vram; ppgtt_ofs =xe_migrate_vram_ofs (xe_bo_addr (update->pt_bo,0 ,XE_PAGE_SIZE , &is_vram)); -XE_WARN_ON (!is_vram); +WARN_ON (!is_vram); } do {
@@ -1194,7 +1194,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m,* Worst case: Sum(2 * (each lower level page size) + (top level page size)) * Should be reasonably bound.. */ -XE_WARN_ON (batch_size >=SZ_128K ); +WARN_ON (batch_size >=SZ_128K ); bb =xe_bb_new (gt, batch_size, !eng && xe->info.supports_usm);if (IS_ERR (bb))
@@ -1204,7 +1204,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m,if (!IS_DGFX (xe)) { ppgtt_ofs =NUM_KERNEL_PDE -1 ;if (eng) { -XE_WARN_ON (num_updates >NUM_VMUSA_WRITES_PER_UNIT ); +WARN_ON (num_updates >NUM_VMUSA_WRITES_PER_UNIT ); sa_bo =drm_suballoc_new (&m->vm_update_sa,1 ,GFP_KERNEL , true,0 );
@@ -1233,7 +1233,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m,for (i =0 ; i < num_updates; i++) {struct xe_bo *pt_bo = updates[i].pt_bo; -XE_WARN_ON (pt_bo->size !=SZ_4K ); +WARN_ON (pt_bo->size !=SZ_4K ); addr =xe_pte_encode (NULL , pt_bo,0 ,XE_CACHE_WB ,0 ); bb->cs[bb->len++] =lower_32_bits (addr);
drivers/gpu/drm/xe/xe_mocs.c +2 -2
@@ -438,9 +438,9 @@ static unsigned int get_mocs_settings(struct xe_device *xe,* is still 0 at this point, we'll assume that it was omitted by * mistake in the switch statement above. */ -XE_WARN_ON (info->unused_entries_index ==0 ); +WARN_ON (info->unused_entries_index ==0 ); -if (XE_WARN_ON (info->size > info->n_entries)) { +if (WARN_ON (info->size > info->n_entries)) { info->table =NULL ;return 0 ; }
drivers/gpu/drm/xe/xe_pt.c +16 -16
@@ -66,7 +66,7 @@ u64 xe_pde_encode(struct xe_bo *bo, u64 bo_offset, pde =xe_bo_addr (bo, bo_offset,XE_PAGE_SIZE , &is_vram); pde |=XE_PAGE_PRESENT |XE_PAGE_RW ; -XE_WARN_ON (IS_DGFX (xe_bo_device (bo)) && !is_vram); +WARN_ON (IS_DGFX (xe_bo_device (bo)) && !is_vram);/* FIXME: I don't think the PPAT handling is correct for MTL */
@@ -133,7 +133,7 @@ static u64 __pte_encode(u64 pte, enum xe_cache_level cache, pte |=XE_PDPE_PS_1G ;/* XXX: Does hw support 1 GiB pages? */ -XE_WARN_ON (pt_level >2 ); +WARN_ON (pt_level >2 );return pte; }
@@ -233,7 +233,7 @@ struct xe_pt *xe_pt_create(struct xe_vm *vm, struct xe_tile *tile, pt->level = level; pt->base.dir = level ? &as_xe_pt_dir (pt)->dir :NULL ; -XE_WARN_ON (level >XE_VM_MAX_LEVEL ); +WARN_ON (level >XE_VM_MAX_LEVEL );return pt;
@@ -302,7 +302,7 @@ void xe_pt_destroy(struct xe_pt *pt, u32 flags, struct llist_head *deferred)if (!pt)return ; -XE_WARN_ON (!list_empty (&pt->bo->vmas)); +WARN_ON (!list_empty (&pt->bo->vmas));xe_bo_unpin (pt->bo);xe_bo_put_deferred (pt->bo, deferred);
@@ -646,7 +646,7 @@ xe_pt_stage_bind_entry(struct xe_ptw *parent, pgoff_t offset,struct xe_res_cursor *curs = xe_walk->curs;bool is_null =xe_vma_is_null (xe_walk->vma); -XE_WARN_ON (xe_walk->va_curs_start != addr); +WARN_ON (xe_walk->va_curs_start != addr); pte = __pte_encode(is_null ? 0 : xe_res_dma(curs) + xe_walk->dma_offset,
@@ -660,7 +660,7 @@ xe_pt_stage_bind_entry(struct xe_ptw *parent, pgoff_t offset,if (level ==0 && !xe_parent->is_compact) {if (xe_pt_is_pte_ps64K (addr, next, xe_walk)) pte |=XE_PTE_PS64 ; -else if (XE_WARN_ON (xe_walk->needs_64K)) +else if (WARN_ON (xe_walk->needs_64K))return -EINVAL ; }
@@ -885,8 +885,8 @@ static int xe_pt_zap_ptes_entry(struct xe_ptw *parent, pgoff_t offset,struct xe_pt *xe_child =container_of (*child,typeof (*xe_child), base);pgoff_t end_offset; -XE_WARN_ON (!*child); -XE_WARN_ON (!level && xe_child->is_compact); +WARN_ON (!*child); +WARN_ON (!level && xe_child->is_compact);/* * Note that we're called from an entry callback, and we're dealing
@@ -1040,7 +1040,7 @@ xe_pt_prepare_bind(struct xe_tile *tile, struct xe_vma *vma, *num_entries =0 ; err =xe_pt_stage_bind (tile, vma, entries, num_entries);if (!err) -XE_WARN_ON (!*num_entries); +WARN_ON (!*num_entries);else /* abort! */ xe_pt_abort_bind (vma, entries, *num_entries);
@@ -1062,7 +1062,7 @@ static void xe_vm_dbg_print_entries(struct xe_device *xe,u64 end;u64 start; -XE_WARN_ON (entry->pt->is_compact); +WARN_ON (entry->pt->is_compact); start = entry->ofs * page_size; end = start + page_size * entry->qwords; vm_dbg(&xe->drm,
@@ -1312,7 +1312,7 @@ static int invalidation_fence_init(struct xe_gt *gt,dma_fence_put (&ifence->base.base);/* Creation ref */ } -XE_WARN_ON (ret && ret != -ENOENT ); +WARN_ON (ret && ret != -ENOENT );return ret && ret != -ENOENT ? ret :0 ; }
@@ -1392,7 +1392,7 @@ __xe_pt_bind_vma(struct xe_tile *tile, struct xe_vma *vma, struct xe_engine *e, err =xe_pt_prepare_bind (tile, vma, entries, &num_entries, rebind);if (err) goto err; -XE_WARN_ON (num_entries >ARRAY_SIZE (entries)); +WARN_ON (num_entries >ARRAY_SIZE (entries));xe_vm_dbg_print_entries (tile_to_xe (tile), entries, num_entries); xe_pt_calc_rfence_interval(vma, &bind_pt_update, entries,
@@ -1551,8 +1551,8 @@ static int xe_pt_stage_unbind_entry(struct xe_ptw *parent, pgoff_t offset, {struct xe_pt *xe_child =container_of (*child,typeof (*xe_child), base); -XE_WARN_ON (!*child); -XE_WARN_ON (!level && xe_child->is_compact); +WARN_ON (!*child); +WARN_ON (!level && xe_child->is_compact);xe_pt_check_kill (addr, next, level -1 , xe_child, action, walk);
@@ -1743,7 +1743,7 @@ __xe_pt_unbind_vma(struct xe_tile *tile, struct xe_vma *vma, struct xe_engine *e xe_vma_start(vma), xe_vma_end(vma) - 1, e); num_entries =xe_pt_stage_unbind (tile, vma, entries); -XE_WARN_ON (num_entries >ARRAY_SIZE (entries)); +WARN_ON (num_entries >ARRAY_SIZE (entries));xe_vm_dbg_print_entries (tile_to_xe (tile), entries, num_entries); xe_pt_calc_rfence_interval(vma, &unbind_pt_update, entries,
@@ -1809,7 +1809,7 @@ __xe_pt_unbind_vma(struct xe_tile *tile, struct xe_vma *vma, struct xe_engine *elist_del_init (&vma->combined_links.rebind);if (unbind_pt_update.locked) { -XE_WARN_ON (!xe_vma_is_userptr (vma)); +WARN_ON (!xe_vma_is_userptr (vma));if (!vma->tile_present) {spin_lock (&vm->userptr.invalidated_lock);
drivers/gpu/drm/xe/xe_range_fence.c +1 -1
@@ -119,7 +119,7 @@ void xe_range_fence_tree_init(struct xe_range_fence_tree *tree)void xe_range_fence_tree_fini (struct xe_range_fence_tree *tree) {xe_range_fence_tree_remove_all (tree); -XE_WARN_ON (!RB_EMPTY_ROOT (&tree->root.rb_root)); +WARN_ON (!RB_EMPTY_ROOT (&tree->root.rb_root)); }/**
drivers/gpu/drm/xe/xe_reg_sr.c +2 -2
@@ -204,7 +204,7 @@ void xe_reg_sr_apply_mmio(struct xe_reg_sr *sr, struct xe_gt *gt)apply_one_mmio (gt, entry); err =xe_force_wake_put (>->mmio.fw,XE_FORCEWAKE_ALL ); -XE_WARN_ON (err); +WARN_ON (err);return ;
@@ -256,7 +256,7 @@ void xe_reg_sr_apply_whitelist(struct xe_hw_engine *hwe) } err =xe_force_wake_put (>->mmio.fw,XE_FORCEWAKE_ALL ); -XE_WARN_ON (err); +WARN_ON (err);return ;
drivers/gpu/drm/xe/xe_res_cursor.h +7 -7
@@ -79,7 +79,7 @@ static inline void xe_res_first(struct ttm_resource *res,if (!res) goto fallback; -XE_WARN_ON (start + size > res->size); +WARN_ON (start + size > res->size); cur->mem_type = res->mem_type;
@@ -128,7 +128,7 @@ static inline void xe_res_first(struct ttm_resource *res, cur->remaining = size; cur->node =NULL ; cur->mem_type =XE_PL_TT ; -XE_WARN_ON (res && start + size > res->size); +WARN_ON (res && start + size > res->size); }static inline void __xe_res_sg_next (struct xe_res_cursor *cur)
@@ -139,7 +139,7 @@ static inline void __xe_res_sg_next(struct xe_res_cursor *cur)while (start >=sg_dma_len (sgl)) { start -=sg_dma_len (sgl); sgl =sg_next (sgl); -XE_WARN_ON (!sgl); +WARN_ON (!sgl); } cur->start = start;
@@ -161,9 +161,9 @@ static inline void xe_res_first_sg(const struct sg_table *sg, u64 start, u64 size, struct xe_res_cursor *cur) { - XE_WARN_ON(!sg); -XE_WARN_ON (!IS_ALIGNED (start,PAGE_SIZE ) || - !IS_ALIGNED (size,PAGE_SIZE )); + WARN_ON(!sg); +WARN_ON (!IS_ALIGNED (start,PAGE_SIZE ) || + !IS_ALIGNED (size,PAGE_SIZE )); cur->node =NULL ; cur->start = start; cur->remaining = size;
@@ -187,7 +187,7 @@ static inline void xe_res_next(struct xe_res_cursor *cur, u64 size)struct list_head *next;u64 start; -XE_WARN_ON (size > cur->remaining); +WARN_ON (size > cur->remaining); cur->remaining -= size;if (!cur->remaining)
drivers/gpu/drm/xe/xe_ring_ops.c +4 -4
@@ -233,7 +233,7 @@ static void __emit_job_gen12_copy(struct xe_sched_job *job, struct xe_lrc *lrc, i =emit_user_interrupt (dw, i); -XE_WARN_ON (i >MAX_JOB_SIZE_DW ); +WARN_ON (i >MAX_JOB_SIZE_DW );xe_lrc_write_ring (lrc, dw, i *sizeof (*dw)); }
@@ -291,7 +291,7 @@ static void __emit_job_gen12_video(struct xe_sched_job *job, struct xe_lrc *lrc, i =emit_user_interrupt (dw, i); -XE_WARN_ON (i >MAX_JOB_SIZE_DW ); +WARN_ON (i >MAX_JOB_SIZE_DW );xe_lrc_write_ring (lrc, dw, i *sizeof (*dw)); }
@@ -339,7 +339,7 @@ static void __emit_job_gen12_render_compute(struct xe_sched_job *job, i =emit_user_interrupt (dw, i); -XE_WARN_ON (i >MAX_JOB_SIZE_DW ); +WARN_ON (i >MAX_JOB_SIZE_DW );xe_lrc_write_ring (lrc, dw, i *sizeof (*dw)); }
@@ -369,7 +369,7 @@ static void emit_migration_job_gen12(struct xe_sched_job *job, i =emit_user_interrupt (dw, i); -XE_WARN_ON (i >MAX_JOB_SIZE_DW ); +WARN_ON (i >MAX_JOB_SIZE_DW );xe_lrc_write_ring (lrc, dw, i *sizeof (*dw)); }
drivers/gpu/drm/xe/xe_sched_job.c +1 -1
@@ -142,7 +142,7 @@ struct xe_sched_job *xe_sched_job_create(struct xe_engine *e,/* Sanity check */ for (j =0 ; j < e->width; ++j) -XE_WARN_ON (cf->base.seqno != fences[j]->seqno); +WARN_ON (cf->base.seqno != fences[j]->seqno); job->fence = &cf->base; }
drivers/gpu/drm/xe/xe_sync.c +2 -2
@@ -75,7 +75,7 @@ static void user_fence_worker(struct work_struct *w)if (mmget_not_zero (ufence->mm)) {kthread_use_mm (ufence->mm);if (copy_to_user (ufence->addr, &ufence->value,sizeof (ufence->value))) -XE_WARN_ON ("Copy to user failed" ); +WARN_ON ("Copy to user failed" );kthread_unuse_mm (ufence->mm);mmput (ufence->mm); }
@@ -250,7 +250,7 @@ bool xe_sync_entry_signal(struct xe_sync_entry *sync, struct xe_sched_job *job,if (err == -ENOENT ) {kick_ufence (sync->ufence, fence); }else if (err) { -XE_WARN_ON ("failed to add user fence" ); +WARN_ON ("failed to add user fence" );user_fence_put (sync->ufence);dma_fence_put (fence); }
drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c +2 -2
@@ -188,7 +188,7 @@ u64 xe_ttm_stolen_io_offset(struct xe_bo *bo, u32 offset)struct xe_ttm_stolen_mgr *mgr =to_stolen_mgr (ttm_mgr);struct xe_res_cursor cur; -XE_WARN_ON (!mgr->io_base); +WARN_ON (!mgr->io_base);if (xe_ttm_stolen_cpu_access_needs_ggtt (xe))return mgr->io_base +xe_bo_ggtt_addr (bo) + offset;
@@ -228,7 +228,7 @@ static int __xe_ttm_stolen_io_mem_reserve_stolen(struct xe_device *xe,#ifdef CONFIG_X86 struct xe_bo *bo =ttm_to_xe_bo (mem->bo); -XE_WARN_ON (IS_DGFX (xe)); +WARN_ON (IS_DGFX (xe));/* XXX: Require BO to be mapped to GGTT? */ if (drm_WARN_ON (&xe->drm, !(bo->flags &XE_BO_CREATE_GGTT_BIT )))
drivers/gpu/drm/xe/xe_uc.c +2 -2
@@ -162,7 +162,7 @@ int xe_uc_init_hw(struct xe_uc *uc)/* We don't fail the driver load if HuC fails to auth, but let's warn */ ret =xe_huc_auth (&uc->huc); -XE_WARN_ON (ret); +WARN_ON (ret);return 0 ; }
@@ -178,7 +178,7 @@ int xe_uc_reset_prepare(struct xe_uc *uc)void xe_uc_gucrc_disable (struct xe_uc *uc) { -XE_WARN_ON (xe_guc_pc_gucrc_disable (&uc->guc.pc)); +WARN_ON (xe_guc_pc_gucrc_disable (&uc->guc.pc)); }void xe_uc_stop_prepare (struct xe_uc *uc)
drivers/gpu/drm/xe/xe_uc_debugfs.c +1 -1
@@ -17,7 +17,7 @@ void xe_uc_debugfs_register(struct xe_uc *uc, struct dentry *parent) root =debugfs_create_dir ("uc" , parent);if (IS_ERR (root)) { -XE_WARN_ON ("Create UC directory failed" ); +WARN_ON ("Create UC directory failed" );return ; }
drivers/gpu/drm/xe/xe_uc_fw.c +9 -9
@@ -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_WARN_ON (type !=XE_UC_FW_TYPE_HUC ); +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_WARN_ON (uc_fw->type >=ARRAY_SIZE (blobs_all)); +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_WARN_ON (size %4 ); -XE_WARN_ON (!xe_uc_fw_is_available (uc_fw)); +WARN_ON (size %4 ); +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,8 +248,8 @@ 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_WARN_ON (uc_fw->type !=XE_UC_FW_TYPE_GUC ); -XE_WARN_ON (uc_fw->major_ver_found <70 ); +WARN_ON (uc_fw->type !=XE_UC_FW_TYPE_GUC ); +WARN_ON (uc_fw->major_ver_found <70 );if (uc_fw->minor_ver_found >=6 ) {/* v70.6.0 adds CSS header support */
@@ -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_WARN_ON (uc_fw->status); -XE_WARN_ON (uc_fw->path); +WARN_ON (uc_fw->status); +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_WARN_ON (xe_uc_fw_is_loaded (uc_fw)); +WARN_ON (xe_uc_fw_is_loaded (uc_fw));if (!xe_uc_fw_is_loadable (uc_fw))return -ENOEXEC ;
drivers/gpu/drm/xe/xe_uc_fw.h +1 -1
@@ -104,7 +104,7 @@ static inline enum xe_uc_fw_status __xe_uc_fw_status(struct xe_uc_fw *uc_fw) {/* shouldn't call this before checking hw/blob availability */ -XE_WARN_ON (uc_fw->status ==XE_UC_FIRMWARE_UNINITIALIZED ); +WARN_ON (uc_fw->status ==XE_UC_FIRMWARE_UNINITIALIZED );return uc_fw->status; }
drivers/gpu/drm/xe/xe_vm.c +42 -42
314 lines not on this page · raw message
drivers/gpu/drm/xe/xe_vm.h +1 -1
@@ -187,7 +187,7 @@ struct ttm_buffer_object *xe_vm_ttm_bo(struct xe_vm *vm);static inline void xe_vm_queue_rebind_worker (struct xe_vm *vm) { -XE_WARN_ON (!xe_vm_in_compute_mode (vm)); +WARN_ON (!xe_vm_in_compute_mode (vm));queue_work (vm->xe->ordered_wq, &vm->preempt.rebind_work); }
drivers/gpu/drm/xe/xe_vm_madvise.c +1 -1
@@ -192,7 +192,7 @@ static int madvise_priority(struct xe_device *xe, struct xe_vm *vm,static int madvise_pin (struct xe_device *xe,struct xe_vm *vm,struct xe_vma **vmas,int num_vmas,u64 value) { -XE_WARN_ON ("NIY" ); +WARN_ON ("NIY" );return 0 ; }
drivers/gpu/drm/xe/xe_wait_user_fence.c +1 -1
@@ -45,7 +45,7 @@ static int do_compare(u64 addr, u64 value, u64 mask, u16 op) passed = (rvalue & mask) <= (value & mask);break ;default : -XE_WARN_ON ("Not possible" ); +WARN_ON ("Not possible" ); }return passed ?0 :1 ;
drivers/gpu/drm/xe/xe_wopcm.c +9 -9
@@ -144,10 +144,10 @@ static int __wopcm_init_regs(struct xe_device *xe, struct xe_gt *gt,u32 mask;int err; -XE_WARN_ON (!(base &GUC_WOPCM_OFFSET_MASK )); -XE_WARN_ON (base & ~GUC_WOPCM_OFFSET_MASK ); -XE_WARN_ON (!(size &GUC_WOPCM_SIZE_MASK )); -XE_WARN_ON (size & ~GUC_WOPCM_SIZE_MASK ); +WARN_ON (!(base &GUC_WOPCM_OFFSET_MASK )); +WARN_ON (base & ~GUC_WOPCM_OFFSET_MASK ); +WARN_ON (!(size &GUC_WOPCM_SIZE_MASK )); +WARN_ON (size & ~GUC_WOPCM_SIZE_MASK ); mask =GUC_WOPCM_SIZE_MASK |GUC_WOPCM_SIZE_LOCKED ; err = xe_mmio_write32_and_verify(gt, GUC_WOPCM_SIZE, size, mask,
@@ -213,9 +213,9 @@ int xe_wopcm_init(struct xe_wopcm *wopcm)drm_dbg (&xe->drm,"WOPCM: %uK\n" , wopcm->size /SZ_1K );xe_force_wake_assert_held (gt_to_fw (gt),XE_FW_GT ); -XE_WARN_ON (guc_fw_size >= wopcm->size); -XE_WARN_ON (huc_fw_size >= wopcm->size); -XE_WARN_ON (ctx_rsvd +WOPCM_RESERVED_SIZE >= wopcm->size); +WARN_ON (guc_fw_size >= wopcm->size); +WARN_ON (huc_fw_size >= wopcm->size); +WARN_ON (ctx_rsvd +WOPCM_RESERVED_SIZE >= wopcm->size); locked =__wopcm_regs_locked (gt, &guc_wopcm_base, &guc_wopcm_size);if (locked) {
@@ -256,8 +256,8 @@ int xe_wopcm_init(struct xe_wopcm *wopcm) guc_fw_size, huc_fw_size)) { wopcm->guc.base = guc_wopcm_base; wopcm->guc.size = guc_wopcm_size; -XE_WARN_ON (!wopcm->guc.base); -XE_WARN_ON (!wopcm->guc.size); +WARN_ON (!wopcm->guc.base); +WARN_ON (!wopcm->guc.size); } else {drm_notice (&xe->drm,"Unsuccessful WOPCM partitioning\n" );return -E2BIG ;
Signature · 1 line
2.34.1
Jani Nikula
maintainerRe: [Intel-xe] [PATCH v3 3/3] drm/xe: Use regular WARN_ON() instead of driver-specific XE_WARN_ON()
Quoted 2 lines · Francois Dugast
Remove
XE_WARN_ON()alias toWARN_ON()and useWARN_ON()directly in order to align with other drivers and avoid using a Xe-specific version.
drm_WARN_ON() is preferred over plain WARN_ON() in drm code.
It'll debug log the device, which will be helpful in a multi-device setting, as well as the condition.
BR,
Jani.
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center