drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:2730 amdgpu_gfx_ring_preempt_ib() warn: inconsistent indenting
kernel test robot
build bottree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 17c7841d09ee7d33557fd075562d9289b6018c90 commit: dc0d6fdfa5b6ab36ddaa774265261336c3e7dbae [3349/4176] drm/amdgpu: deduplicate ring preempt ib function config: mips-randconfig-r071-20260506 (https://download.01.org/0day-ci/archive/20260508/[email protected]/config) compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 5bac06718f502014fade905512f1d26d578a18f3) smatch: v0.5.0-9065-ge9cc34fd
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
New smatch warnings:drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:2730 amdgpu_gfx_ring_preempt_ib() warn: inconsistent indenting
Old smatch warnings:drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:451 amdgpu_gfx_mqd_sw_init() error: buffer overflow 'adev->gfx.compute_ring' 64 <= s32max drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:463 amdgpu_gfx_mqd_sw_init() error: buffer overflow 'adev->gfx.mec.mqd_backup' 64 <= s32max drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:464 amdgpu_gfx_mqd_sw_init() error: buffer overflow 'adev->gfx.mec.mqd_backup' 64 <= s32max drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:492 amdgpu_gfx_mqd_sw_fini() error: buffer overflow 'adev->gfx.compute_ring' 64 <= s32max drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:493 amdgpu_gfx_mqd_sw_fini() error: buffer overflow 'adev->gfx.mec.mqd_backup' 64 <= s32max drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:566 amdgpu_gfx_disable_kcq() error: buffer overflow 'adev->gfx.compute_ring' 64 <= s32max drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:588 amdgpu_gfx_disable_kcq() error: buffer overflow 'adev->gfx.compute_ring' 64 <= s32max drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:617 amdgpu_gfx_disable_kgq() error: buffer overflow 'adev->gfx.gfx_ring' 2 <= s32max drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:641 amdgpu_gfx_disable_kgq() error: buffer overflow 'adev->gfx.gfx_ring' 2 <= s32max drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:700 amdgpu_gfx_mes_enable_kcq() error: buffer overflow 'adev->gfx.compute_ring' 64 <= s32max drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:758 amdgpu_gfx_enable_kcq() error: buffer overflow 'adev->gfx.compute_ring' 64 <= s32max drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:790 amdgpu_gfx_enable_kgq() error: buffer overflow 'adev->gfx.gfx_ring' 2 <= s32max drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:815 amdgpu_gfx_enable_kgq() error: buffer overflow 'adev->gfx.gfx_ring' 2 <= s32max drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:1716 amdgpu_gfx_run_cleaner_shader() error: buffer overflow 'adev->gfx.compute_ring' 64 <= u32max
vim +2730 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
2688
2689 int amdgpu_gfx_ring_preempt_ib(struct amdgpu_ring *ring)
2690 {
2691 struct amdgpu_device *adev = ring->adev;
2692 struct amdgpu_kiq *kiq = &adev->gfx.kiq[0];
2693 struct amdgpu_ring *kiq_ring = &kiq->ring;
2694 unsigned long flags;
2695 int i;
2696
2697 if (adev->enable_mes)
2698 return -EINVAL;
2699
2700 if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)
2701 return -EINVAL;
2702
2703 spin_lock_irqsave(&kiq->ring_lock, flags);
2704
2705 if (amdgpu_ring_alloc(kiq_ring, kiq->pmf->unmap_queues_size)) {
2706 spin_unlock_irqrestore(&kiq->ring_lock, flags);
2707 return -ENOMEM;
2708 }
2709
2710 /* assert preemption condition */
2711 amdgpu_ring_set_preempt_cond_exec(ring, false);
2712
2713 /* assert IB preemption, emit the trailing fence */
2714 kiq->pmf->kiq_unmap_queues(kiq_ring, ring, PREEMPT_QUEUES_NO_UNMAP,
2715 ring->trail_fence_gpu_addr,
2716 ++ring->trail_seq);
2717 amdgpu_ring_commit(kiq_ring);
2718
2719 spin_unlock_irqrestore(&kiq->ring_lock, flags);
2720
2721 /* poll the trailing fence */
2722 for (i = 0; i < adev->usec_timeout; i++) {
2723 if (ring->trail_seq ==
2724 le32_to_cpu(*(ring->trail_fence_cpu_addr)))
2725 break;
2726 udelay(1);
2727 }
2728
2729 /* deassert preemption condition */
> 2730 amdgpu_ring_set_preempt_cond_exec(ring, true);
2731
2732 if (i >= adev->usec_timeout) {
2733 DRM_ERROR("ring %d failed to preempt ib\n", ring->idx);
2734 return -EINVAL;
2735 }
2736
2737 return 0;
2738 }
2739
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki