lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260115012830.31182-1-yangtiezhu@loongson.cn>
Date: Thu, 15 Jan 2026 09:28:30 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Alex Deucher <alexander.deucher@....com>,
	Christian König <christian.koenig@....com>
Cc: Alan Liu <haoping.liu@....com>,
	amd-gfx@...ts.freedesktop.org,
	linux-kernel@...r.kernel.org
Subject: [RFC PATCH] drm/amdgpu: Avoid unnecessary Call Traces in amdgpu_irq_put()

Currently, there are many Call Traces when booting kernel on LoongArch,
here are the trimmed kernel log messages:

  amdgpu 0000:07:00.0: amdgpu: hw_init of IP block <gfx_v6_0> failed -110
  amdgpu 0000:07:00.0: amdgpu: amdgpu_device_ip_init failed
  amdgpu 0000:07:00.0: amdgpu: Fatal error during GPU init
  amdgpu 0000:07:00.0: amdgpu: amdgpu: finishing device.
  ------------[ cut here ]------------
  WARNING: drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:639 at amdgpu_irq_put+0xb0/0x140 [amdgpu], CPU#0: kworker/0:0/9
  ...
  Call Trace:
  [<90000000047a8524>] show_stack+0x64/0x190
  [<90000000047a0614>] dump_stack_lvl+0x6c/0x9c
  [<90000000047cef34>] __warn+0xa4/0x1b0
  [<90000000060a4884>] __report_bug+0xa4/0x1d0
  [<90000000060a4a88>] report_bug+0x38/0xd0
  [<90000000060df330>] do_bp+0x260/0x410
  [<90000000047a6bc0>] handle_bp+0x120/0x1c0
  [<ffff8000028bff40>] amdgpu_irq_put+0xb0/0x140 [amdgpu]
  [<ffff8000027b1a8c>] amdgpu_fence_driver_hw_fini+0x12c/0x180 [amdgpu]
  [<ffff800002f2c04c>] amdgpu_device_fini_hw+0xf0/0x3fc [amdgpu]
  [<ffff80000279e2ac>] amdgpu_driver_load_kms+0x7c/0xa0 [amdgpu]
  [<ffff800002791128>] amdgpu_pci_probe+0x298/0x810 [amdgpu]
  [<90000000054d04a4>] local_pci_probe+0x44/0xc0
  [<90000000047f4ab0>] work_for_cpu_fn+0x20/0x40
  [<90000000047f93e0>] process_one_work+0x170/0x4e0
  [<90000000047fa14c>] worker_thread+0x3ac/0x4e0
  [<9000000004806824>] kthread+0x154/0x170
  [<90000000060df5b4>] ret_from_kernel_thread+0x24/0xd0
  [<90000000047a62a4>] ret_from_kernel_thread_asm+0xc/0x88

  ---[ end trace 0000000000000000 ]---
  amdgpu 0000:07:00.0: probe with driver amdgpu failed with error -110
  amdgpu 0000:07:00.0: amdgpu: amdgpu: ttm finalized

This is because amdgpu_irq_enabled() is false in amdgpu_irq_put(), then
the condition of WARN_ON() is true.

In order to avoid the unnecessary Call Traces, it can remove the check of
amdgpu_irq_enabled() and only check atomic_read(&src->enabled_types[type]
for three reasons:

(1) The aim is to prevent refcount from being less than 0, it was added in
commit 1fa8d710573f ("drm/amdgpu: Fix desktop freezed after gpu-reset").
(2) There are already many useful failed log before the Call Trace, there
is no need to WARN_ON().
(3) The following checks in amdgpu_irq_put() are same with the checks in
amdgpu_irq_enabled(), there is no need to do the redundant operations.

	if (!adev->irq.installed)
		return -ENOENT;

	if (type >= src->num_types)
		return -EINVAL;

	if (!src->enabled_types || !src->funcs->set)
		return -EINVAL;

Cc: stable@...r.kernel.org
Fixes: 1fa8d710573f ("drm/amdgpu: Fix desktop freezed after gpu-reset")
Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
index 8112ffc85995..0d00a8d841b5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
@@ -636,7 +636,7 @@ int amdgpu_irq_put(struct amdgpu_device *adev, struct amdgpu_irq_src *src,
 	if (!src->enabled_types || !src->funcs->set)
 		return -EINVAL;
 
-	if (WARN_ON(!amdgpu_irq_enabled(adev, src, type)))
+	if (!atomic_read(&src->enabled_types[type]))
 		return -EINVAL;
 
 	if (atomic_dec_and_test(&src->enabled_types[type]))
-- 
2.42.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ