All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Arunpravin Paneer Selvam" <Arunpravin.PaneerSelvam@amd.com>,
	amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 1/2] drm/amdgpu: Don't let kernel jobs inherit entity errors
Date: Wed, 02 Dec 2026 13:36:13 +0000	[thread overview]
Message-ID: <sashiko-outbox-245888@kernel.org> (raw)
In-Reply-To: <20261202132224.217180-1-Arunpravin.PaneerSelvam@amd.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/amdgpu: GART mapping jobs skipped on reset entity before
  copy or fill
--

commit 8e8b892180ec2dcc253bf2cd1dc6c2ab470bab03
Author: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>

drm/amdgpu: Don't let kernel jobs inherit entity errors

This commit adds a kernel_job flag to struct amdgpu_job and sets it in
amdgpu_copy_buffer() and amdgpu_ttm_fill_mem() so that TTM copy and fill
jobs ignore prior errors on their scheduler entity in
amdgpu_job_prepare_job().

> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 4d0b9897a5233..9d8f7008c6f64 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -2595,6 +2595,8 @@ int amdgpu_copy_buffer(struct amdgpu_device *adev,
>  	if (r)
>  		goto error_free;
>  
> +	job->kernel_job = true;
> +
>  	for (i = 0; i < num_loops; i++) {
>  		uint32_t cur_size_in_bytes = min(byte_count, max_bytes);
>  
> @@ -2639,6 +2641,8 @@ static int amdgpu_ttm_fill_mem(struct amdgpu_device *adev,
>  	if (r)
>  		return r;
>  
> +	job->kernel_job = true;
> +
>  	for (i = 0; i < num_loops; i++) {
>  		uint32_t cur_size = min(byte_count, max_bytes);

[Severity: High]
Can this cause amdgpu_copy_buffer() and amdgpu_ttm_fill_mem() to DMA
through stale GART window PTEs after a GPU reset?

When a move, clear, or KFD SVM migration needs a GART window (for example
in amdgpu_ttm_copy_mem_to_mem(), amdgpu_ttm_clear_buffer(), or
svm_migrate_copy_memory_gart()), it first queues a GART PTE update job on
the same entity via amdgpu_ttm_map_buffer() or svm_migrate_gart_map().
Those functions do not set job->kernel_job = true.

If a prior GPU reset left an error on that entity, amdgpu_job_prepare_job()
fails the GART mapping job and skips the PTE update, but the paired
amdgpu_copy_buffer() or amdgpu_ttm_fill_mem() job now ignores the entity
error and runs SDMA against the unupdated GART window address, reading or
writing physical memory mapped by a previous transfer.

Kernel jobs submitted on adev->mman.default_entity by
amdgpu_ttm_access_memory_sdma() and amdgpu_gmc_flush_gpu_tlb() also leave
job->kernel_job unset and will still be skipped after an error on that
entity.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202132224.217180-1-Arunpravin.PaneerSelvam@amd.com?part=1

      parent reply	other threads:[~2026-12-02 13:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 13:22 [PATCH v3 1/2] drm/amdgpu: Don't let kernel jobs inherit entity errors Arunpravin Paneer Selvam
2026-12-02 13:22 ` [PATCH v3 2/2] drm/amdgpu: Reset cleared state of free VRAM after GPU reset Arunpravin Paneer Selvam
2026-12-02 13:39   ` sashiko-bot
2026-12-02 13:36 ` 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-245888@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Arunpravin.PaneerSelvam@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=sashiko-reviews@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 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.