From: sashiko-bot@kernel.org
To: Xiaogang.Chen <xiaogang.chen@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 1/2] drm/amdkfd: Fix a race issue at svm_migrate_copy_to_ram() error path
Date: Wed, 18 Nov 2026 23:10:32 +0000 [thread overview]
Message-ID: <sashiko-outbox-222148@kernel.org> (raw)
In-Reply-To: <20261118225834.60743-1-xiaogang.chen@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] drm/amdkfd: missing Fixes trailer for svm_migrate_copy_to_ram()
fix
--
commit 36078b6a47909e79e845fa9d13dc4df2f88836b7
Author: Xiaogang Chen <xiaogang.chen@amd.com>
> drm/amdkfd: Fix a race issue at svm_migrate_copy_to_ram() error path
>
> The destination pages were freed while SDMA copies queued earlier
> could still be writing into them, and while they were still DMA
> mapped. The mappings were only removed later by the caller's
> svm_range_dma_unmap_dev().
>
> With swiotlb, the BIDIRECTIONAL unmap copies the bounce buffer back into
> a page that may already be reused.
>
> With an IOMM, the GPU still has a valid bus address that points at a page
> now maybe owned by another user. Any SDMA write still in flight, corrupts
> that page.
>
> So, wait on the fence first, then dma unmap before release buffer.
>
> Signed-off-by: Xiaogang Chen <xiaogang.chen@amd.com>
[Severity: Low]
This fixes a bug on the svm_migrate_copy_to_ram() error path where
destination pages were unmapped and freed before waiting on in-flight SDMA
copies. Should the commit message include Fixes tags for the introducing
commits?
Fixes: 960c4a8069bf ("drm/amdkfd: Fix error path at svm_migrate_copy_to_ram")
Fixes: 48ff079b28d8 ("drm/amdkfd: HMM migrate vram to ram")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261118225834.60743-1-xiaogang.chen@amd.com?part=1
prev parent reply other threads:[~2026-11-18 23:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 22:58 [PATCH v2 1/2] drm/amdkfd: Fix a race issue at svm_migrate_copy_to_ram() error path Xiaogang.Chen
2026-11-18 22:58 ` [PATCH v2 2/2] drm/amdkfd: Swap order of svm_range_dma_unmap_dev and migrate_vma_finalize Xiaogang.Chen
2026-11-18 23:29 ` Philip Yang
2026-11-18 23:10 ` sashiko-bot [this message]
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-222148@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=amd-gfx@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=xiaogang.chen@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox