From nobody Mon Feb 9 08:42:31 2026 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D9637260A for ; Thu, 15 Jan 2026 01:28:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768440534; cv=none; b=u1pVbS43Q8YTnxAKSoRIlKp2rERkfUsTFhopKPSwm0jwOn0JJB+r6j0p8eNBWnJ4BKTmd5nRCI7lRHABqpzFc/nvr8VJe0QEwkRMpliHG0tbyzH/+z8Y5h8BrFpxCoaDQv+avsgL8UfC/EG6/cvynhTmAMP0f+yg0apfqzANxLE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768440534; c=relaxed/simple; bh=5cOBAuGx3R62gZgJKPO5Jav//F1NPRVGZ5YObTbp/VE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=d917CoO/mRBUWHfVWk1BwvX3N30OxpuKEOYlfO+sIz7MB/bgsd78+2SGAjR8T17zmzTbDwwcBtWYgK2MUblFU3sl4VwKak3JpqibyTwMyStOYyKhnAt2rKQMP+gNrQf2p6e3VJUk+ROjYCRKU1J0Q2uCFACGCUh9VnV6kmTcMzE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn; spf=pass smtp.mailfrom=loongson.cn; arc=none smtp.client-ip=114.242.206.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8CxacLNQmhp5wUJAA--.28797S3; Thu, 15 Jan 2026 09:28:45 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by front1 (Coremail) with SMTP id qMiowJCx2+DMQmhpNLEeAA--.63160S2; Thu, 15 Jan 2026 09:28:45 +0800 (CST) From: Tiezhu Yang To: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= Cc: Alan Liu , amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH] drm/amdgpu: Avoid unnecessary Call Traces in amdgpu_irq_put() Date: Thu, 15 Jan 2026 09:28:30 +0800 Message-ID: <20260115012830.31182-1-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.42.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: qMiowJCx2+DMQmhpNLEeAA--.63160S2 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBj93XoWxXr18Kr45Wr17JFWfuF1xZwc_yoW5KF48pr n5Jr429r48ZFy2vr1jya48ur90yw47ZF1xCr48Gr129w1rZw15J34xJF18GryUArW7Aay7 Jr97t3yFq3WqqagCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUk0b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Gr0_Gr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1l5I 8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AK xVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I 0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU24SoDUUUU Content-Type: text/plain; charset="utf-8" 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 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+0x= b0/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 [] amdgpu_irq_put+0xb0/0x140 [amdgpu] [] amdgpu_fence_driver_hw_fini+0x12c/0x180 [amdgpu] [] amdgpu_device_fini_hw+0xf0/0x3fc [amdgpu] [] amdgpu_driver_load_kms+0x7c/0xa0 [amdgpu] [] 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 >=3D src->num_types) return -EINVAL; if (!src->enabled_types || !src->funcs->set) return -EINVAL; Cc: stable@vger.kernel.org Fixes: 1fa8d710573f ("drm/amdgpu: Fix desktop freezed after gpu-reset") Signed-off-by: Tiezhu Yang --- 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 a= mdgpu_irq_src *src, if (!src->enabled_types || !src->funcs->set) return -EINVAL; =20 - if (WARN_ON(!amdgpu_irq_enabled(adev, src, type))) + if (!atomic_read(&src->enabled_types[type])) return -EINVAL; =20 if (atomic_dec_and_test(&src->enabled_types[type])) --=20 2.42.0