From: kernel test robot <lkp@intel.com>
To: Leonardo Cesar <leonardocesar@usp.br>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König " <christian.koenig@amd.com>
Subject: drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:2730 amdgpu_gfx_ring_preempt_ib() warn: inconsistent indenting
Date: Thu, 20 Aug 2026 17:50:31 +0800 [thread overview]
Message-ID: <202608201722.iyZwpR07-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: cb8a75eec0877810b50aa1c5a833f929525cd2ee
commit: dc0d6fdfa5b6ab36ddaa774265261336c3e7dbae drm/amdgpu: deduplicate ring preempt ib function
date: 4 months ago
config: i386-randconfig-141-20260820 (https://download.01.org/0day-ci/archive/20260820/202608201722.iyZwpR07-lkp@intel.com/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
smatch: v0.5.0-9187-g5189e3fb
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
| Fixes: dc0d6fdfa5b6 ("drm/amdgpu: deduplicate ring preempt ib function")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608201722.iyZwpR07-lkp@intel.com/
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
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-08-20 9:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202608201722.iyZwpR07-lkp@intel.com \
--to=lkp@intel.com \
--cc=alexander.deucher@amd.com \
--cc=christian.koenig@amd.com \
--cc=leonardocesar@usp.br \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox