AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: Perry Yuan <perry.yuan@amd.com>,
	alexander.deucher@amd.com, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: ensure no_hw_access is visible before MMIO
Date: Wed, 28 Jan 2026 19:27:27 +0530	[thread overview]
Message-ID: <5cbdede5-2f37-4960-b8b9-261e7e2e3152@amd.com> (raw)
In-Reply-To: <20260128062315.2848821-1-perry.yuan@amd.com>



On 28-Jan-26 11:53 AM, Perry Yuan wrote:
> Add a full memory barrier after clearing no_hw_access in
> amdgpu_device_mode1_reset() so subsequent PCI state restore
> access cannot observe stale state on other CPUs.
> 

Just want to reiterate that this approach masks the original logical 
errors within amdgpu.

For ex: this is one such which would not have been caught in the first 
place with shortcuts like these.

12caf3b76150 drm/amdkfd: Handle GPU reset and drain retry fault race

Thanks,
Lijo

> Fixes: 91ae0045130b ("drm/amd/pm: Disable MMIO access during SMU Mode 1 reset")
> Signed-off-by: Perry Yuan <perry.yuan@amd.com>
> Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index b2deb6a74eb2..e69ab8a923e3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -5735,6 +5735,9 @@ int amdgpu_device_mode1_reset(struct amdgpu_device *adev)
>   	/* enable mmio access after mode 1 reset completed */
>   	adev->no_hw_access = false;
>   
> +	/* ensure no_hw_access is updated before we access hw */
> +	smp_mb();
> +
>   	amdgpu_device_load_pci_state(adev->pdev);
>   	ret = amdgpu_psp_wait_for_bootloader(adev);
>   	if (ret)


  reply	other threads:[~2026-01-28 13:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-28  6:23 [PATCH] drm/amdgpu: ensure no_hw_access is visible before MMIO Perry Yuan
2026-01-28 13:57 ` Lazar, Lijo [this message]
2026-01-28 14:40   ` Christian König

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=5cbdede5-2f37-4960-b8b9-261e7e2e3152@amd.com \
    --to=lijo.lazar@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=perry.yuan@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