mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Ruoyu Wang <ruoyuw560@gmail.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, "Zhang,
	Hawking" <Hawking.Zhang@amd.com>,
	"Lazar, Lijo" <lijo.lazar@amd.com>
Subject: Re: [PATCH v2] drm/amdgpu: initialize ret before UMC error record loop
Date: Thu, 18 Jun 2026 09:37:16 +0200	[thread overview]
Message-ID: <cee10e27-1bf9-47de-9d72-4f2c7ac606ef@amd.com> (raw)
In-Reply-To: <20260617193335.1662613-1-ruoyuw560@gmail.com>

On 6/17/26 21:33, Ruoyu Wang wrote:
> umc_v12_0_fill_error_record() returns ret after walking the pages
> reported by amdgpu_umc_lookup_bad_pages_in_a_row(). That helper can
> return zero entries, leaving the loop skipped and ret uninitialized.
> 
> Set ret to 0 immediately before the loop so the zero-page path reports a
> deterministic status instead of returning stack data.
> 
> Suggested-by: Christian König <christian.koenig@amd.com>
> Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>

Acked-by: Christian König <christian.koenig@amd.com>

Someone more familiar with ras should take a look as well, could be that returning -ENOENT is more appropriate here.

> ---
> v2:
> - Set ret immediately before the loop instead of initializing it in the
>   declaration, as suggested by Christian.
> - Avoid describing the zero-entry case as an allocation-failure fix.
> 
>  drivers/gpu/drm/amd/amdgpu/umc_v12_0.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/umc_v12_0.c b/drivers/gpu/drm/amd/amdgpu/umc_v12_0.c
> index 14092150336a5..4842340d9d65f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/umc_v12_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/umc_v12_0.c
> @@ -690,6 +690,7 @@ static int umc_v12_0_fill_error_record(struct amdgpu_device *adev,
>         count = amdgpu_umc_lookup_bad_pages_in_a_row(adev,
>                                 ecc_err->pa_pfn << AMDGPU_GPU_PAGE_SHIFT,
>                                 page_pfn, ARRAY_SIZE(page_pfn));
> +       ret = 0;
> 
>         for (i = 0; i < count; i++) {
>                 ret = amdgpu_umc_fill_error_record(err_data,
> --
> 2.51.0


  reply	other threads:[~2026-06-18  7:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-17 19:33 Ruoyu Wang
2026-06-18  7:37 ` Christian König [this message]
2026-06-18 11:02   ` Zhou1, Tao

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=cee10e27-1bf9-47de-9d72-4f2c7ac606ef@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lijo.lazar@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ruoyuw560@gmail.com \
    --cc=simona@ffwll.ch \
    /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

all inboxes | Powered by JetHome®