From: sashiko-bot@kernel.org
To: "David Zhang" <yidong.zhang@amd.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH V3 18/19] accel/amdxdna: Implement AIE4 suspend and resume
Date: Thu, 08 Oct 2026 04:10:19 +0000 [thread overview]
Message-ID: <sashiko-outbox-163604@kernel.org> (raw)
In-Reply-To: <20261008032348.2044667-19-yidong.zhang@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] accel/amdxdna: missing job abort on pci_enable_device failure in resume
--
commit dc42481bff99333322ed758d78317abfcf760ec5
Author: David Zhang <yidong.zhang@amd.com>
accel/amdxdna: Implement AIE4 suspend and resume
This commit implements suspend and resume callbacks for AIE4 Physical Function
(PF), Virtual Function (VF), and Classic device types. It introduces functions
to manage hardware contexts and pending jobs across suspend boundaries, and
establishes stateless links between VFs and PFs for SR-IOV coordination.
diff --git a/drivers/accel/amdxdna/aie4_pci.c b/drivers/accel/amdxdna/aie4_pci.c
--- a/drivers/accel/amdxdna/aie4_pci.c
+++ b/drivers/accel/amdxdna/aie4_pci.c
[ ... ]
@@ -1277,11 +1277,10 @@ static int aie4_vf_resume(struct amdxdna_dev *xdna)
> static int aie4_vf_resume(struct amdxdna_dev *xdna)
> {
> struct amdxdna_dev_hdl *ndev = xdna->dev_handle;
> struct pci_dev *pdev = to_pci_dev(xdna->ddev.dev);
> int ret;
>
> drm_WARN_ON(&xdna->ddev, !mutex_is_locked(&xdna->dev_lock));
>
> ret = pci_enable_device(pdev);
> if (ret) {
> XDNA_ERR(xdna, "enable pci device failed %d", ret);
> return ret;
[Severity: High]
If pci_enable_device fails here, does this return leave pending software jobs
hanging indefinitely?
During suspend, aie4_hwctx_suspend_all is called with clean_jobs set to false,
which destroys the hardware context but intentionally leaves software jobs
pending. If resume fails early, shouldn't those pending jobs be explicitly
aborted and their fences signaled with an error?
The later failure path for aie4_vf_hw_start calls aie4_hwctx_suspend_all with
clean_jobs set to true to properly handle this cleanup.
> }
> pci_set_master(pdev);
>
> ret = aie4_vf_hw_start(ndev);
> if (ret) {
> XDNA_ERR(xdna, "hw_start failed %d", ret);
> /* Contexts cannot reconnect; fail waiters and abort running jobs. */
> aie4_hwctx_suspend_all(ndev, true);
> goto pci_disable;
> }
[ ... ]
@@ -1331,11 +1331,10 @@ static int aie4_classic_resume(struct amdxdna_dev *xdna)
> static int aie4_classic_resume(struct amdxdna_dev *xdna)
> {
> struct amdxdna_dev_hdl *ndev = xdna->dev_handle;
> struct pci_dev *pdev = to_pci_dev(xdna->ddev.dev);
> int ret;
>
> drm_WARN_ON(&xdna->ddev, !mutex_is_locked(&xdna->dev_lock));
>
> ret = pci_enable_device(pdev);
> if (ret) {
> XDNA_ERR(xdna, "enable pci device failed %d", ret);
> return ret;
[Severity: High]
Does this error path share the same issue as aie4_vf_resume where failing to
call aie4_hwctx_suspend_all with clean_jobs set to true might deadlock waiting
userspace tasks?
> }
> pci_set_master(pdev);
>
> ret = aie4_classic_hw_start(ndev);
> if (ret) {
> XDNA_ERR(xdna, "hw_start failed %d", ret);
> /* Contexts cannot reconnect; fail waiters and abort running jobs. */
> aie4_hwctx_suspend_all(ndev, true);
> goto pci_disable;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261008032348.2044667-1-yidong.zhang@amd.com?part=18
next prev parent reply other threads:[~2026-10-08 4:10 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 3:23 [PATCH V3 00/19] accel/amdxdna: Kernel submission and PM for AIE4 David Zhang
2026-10-08 3:23 ` [PATCH V3 01/19] accel/amdxdna: Rename NPU3 firmware files David Zhang
2026-10-08 16:23 ` Lizhi Hou
2026-10-08 3:23 ` [PATCH V3 02/19] accel/amdxdna: Remove mmap for doorbell David Zhang
2026-10-08 3:23 ` [PATCH V3 03/19] accel/amdxdna: Add CERT firmware version support David Zhang
2026-10-08 17:12 ` Lizhi Hou
2026-10-08 17:26 ` Zhang, Yidong (David)
2026-10-08 3:23 ` [PATCH V3 04/19] accel/amdxdna: Upgrade firmware version to 6.0 David Zhang
2026-10-08 17:15 ` Lizhi Hou
2026-10-08 3:23 ` [PATCH V3 05/19] accel/amdxdna: Add NPU3 classic device support David Zhang
2026-10-08 3:44 ` sashiko-bot
2026-10-08 17:25 ` Zhang, Yidong (David)
2026-10-08 3:23 ` [PATCH V3 06/19] accel/amdxdna: Add AIE version query to aie4_get_info David Zhang
2026-10-08 3:23 ` [PATCH V3 07/19] accel/amdxdna: Add get and set power_mode for AIE4 David Zhang
2026-10-08 3:23 ` [PATCH V3 08/19] accel/amdxdna: Add clock, DPM frequency, and resource info queries " David Zhang
2026-10-08 3:48 ` sashiko-bot
2026-10-08 3:23 ` [PATCH V3 09/19] accel/amdxdna: Add context switch hysteresis with debugfs control David Zhang
2026-10-08 3:23 ` [PATCH V3 10/19] accel/amdxdna: Refactor AIE4 hardware initialization sequence David Zhang
2026-10-08 3:23 ` [PATCH V3 11/19] accel/amdxdna: Decouple AIE4 doorbell and MSI-X notify transport hooks David Zhang
2026-10-08 3:51 ` sashiko-bot
2026-10-08 3:23 ` [PATCH V3 12/19] accel/amdxdna: Implement AIE4 kernel queue lifecycle and memory layout David Zhang
2026-10-08 3:59 ` sashiko-bot
2026-10-08 3:23 ` [PATCH V3 13/19] accel/amdxdna: Prepare for AIE4 command submission David Zhang
2026-10-08 4:04 ` sashiko-bot
2026-10-08 3:23 ` [PATCH V3 14/19] accel/amdxdna: Move HMM invalidate wait into common GEM code David Zhang
2026-10-08 3:56 ` sashiko-bot
2026-10-08 3:23 ` [PATCH V3 15/19] accel/amdxdna: Make populate_range common for AIE2 and AIE4 David Zhang
2026-10-08 3:23 ` [PATCH V3 16/19] accel/amdxdna: Implement AIE4 command packet building and submission David Zhang
2026-10-08 4:10 ` sashiko-bot
2026-10-08 3:23 ` [PATCH V3 17/19] accel/amdxdna: Enable AIE4 firmware logging to DRAM David Zhang
2026-10-08 3:23 ` [PATCH V3 18/19] accel/amdxdna: Implement AIE4 suspend and resume David Zhang
2026-10-08 4:10 ` sashiko-bot [this message]
2026-10-08 3:23 ` [PATCH V3 19/19] accel/amdxdna: Implement runtime suspend and resume support David Zhang
2026-10-08 4:22 ` sashiko-bot
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=sashiko-outbox-163604@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=yidong.zhang@amd.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.