All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: skip uniras block ECC query in GPU reset path
@ 2026-11-13  3:28 Ce Sun
  2026-11-13 15:45 ` Zhang, Hawking
  0 siblings, 1 reply; 6+ messages in thread
From: Ce Sun @ 2026-11-13  3:28 UTC (permalink / raw)
  To: amd-gfx; +Cc: Hawking.Zhang, tao.zhou1, Ce Sun, YiPeng Chai

amdgpu_uniras_query_block_ecc doesn't support being called during GPU reset.

Signed-off-by: Ce Sun <cesun102@amd.com>
Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 08c6e55a7927..7be33d5559ab 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -3770,6 +3770,10 @@ static int amdgpu_persistent_edc_harvesting(struct amdgpu_device *adev,
 	if (!amdgpu_persistent_edc_harvesting_supported(adev))
 		return 0;
 
+	if ((amdgpu_in_reset(adev) || amdgpu_ras_in_recovery(adev)) &&
+	     amdgpu_uniras_enabled(adev))
+		return 0;
+
 	if (amdgpu_ras_query_error_status(adev, &info) != 0)
 		drm_warn(adev_to_drm(adev), "RAS init query failure");
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] drm/amdgpu: skip uniras block ECC query in GPU reset path
@ 2026-11-13  9:54 Ce Sun
  2026-11-13 10:49 ` sashiko-bot
  0 siblings, 1 reply; 6+ messages in thread
From: Ce Sun @ 2026-11-13  9:54 UTC (permalink / raw)
  To: amd-gfx; +Cc: Hawking.Zhang, tao.zhou1, Ce Sun, YiPeng Chai

amdgpu_uniras_query_block_ecc doesn't support being called during GPU reset.

Signed-off-by: Ce Sun <cesun102@amd.com>
Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 08c6e55a7927..7be33d5559ab 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -3770,6 +3770,10 @@ static int amdgpu_persistent_edc_harvesting(struct amdgpu_device *adev,
 	if (!amdgpu_persistent_edc_harvesting_supported(adev))
 		return 0;
 
+	if ((amdgpu_in_reset(adev) || amdgpu_ras_in_recovery(adev)) &&
+	     amdgpu_uniras_enabled(adev))
+		return 0;
+
 	if (amdgpu_ras_query_error_status(adev, &info) != 0)
 		drm_warn(adev_to_drm(adev), "RAS init query failure");
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/amdgpu: skip uniras block ECC query in GPU reset path
  2026-11-13  9:54 Ce Sun
@ 2026-11-13 10:49 ` sashiko-bot
  0 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-11-13 10:49 UTC (permalink / raw)
  To: Ce Sun, amd-gfx

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/amdgpu: incomplete reset check in
  amdgpu_persistent_edc_harvesting()
- [Low] drm/amdgpu: missing Fixes trailer for GPU reset ECC query
  regression
--

commit a877bda7a103d3656c06f840d5177c8e2b166cc8
Author: Ce Sun <cesun102@amd.com>

> drm/amdgpu: skip uniras block ECC query in GPU reset path
>
> amdgpu_uniras_query_block_ecc doesn't support being called during GPU reset.
>
> Signed-off-by: Ce Sun <cesun102@amd.com>
> Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>

[Severity: Low]
This fixes a GPU reset regression introduced when
amdgpu_ras_query_error_status() was wired to amdgpu_uniras_query_block_ecc().
Should this include:

  Fixes: fe2ccc7b7b23 ("drm/amdgpu: query block error count of ras module")

> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index 312566337ab14..6d8b2e24880f6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -3758,6 +3758,10 @@ static int amdgpu_persistent_edc_harvesting(struct amdgpu_device *adev,
>  	if (!amdgpu_persistent_edc_harvesting_supported(adev))
>  		return 0;
>  
> +	if ((amdgpu_in_reset(adev) || amdgpu_ras_in_recovery(adev)) &&
> +	     amdgpu_uniras_enabled(adev))
> +		return 0;
> +
>  	if (amdgpu_ras_query_error_status(adev, &info) != 0)
>  		drm_warn(adev_to_drm(adev), "RAS init query failure");
>  

[Severity: Medium]
Should this check skip the query during GPU reset regardless of
amdgpu_uniras_enabled(adev), matching amdgpu_ras_reset_error_count()?

During GPU reset (including amdgpu_xgmi_reset_on_init_work(), where the
RAS IP block has not yet run hw_init so amdgpu_uniras_enabled(adev)
returns false even on uniras devices), the reset thread holds
down_write(&adev->reset_domain->sem).  When amdgpu_uniras_enabled(adev) is
false, execution falls through to amdgpu_ras_query_error_status() ->
amdgpu_ras_query_error_status_with_event(), which fails
down_read_trylock(&adev->reset_domain->sem) with -EIO and logs a false
"RAS init query failure" warning for each RAS block.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] drm/amdgpu: skip uniras block ECC query in GPU reset path
@ 2026-11-13 13:11 Ce Sun
  2026-11-13 13:35 ` sashiko-bot
  0 siblings, 1 reply; 6+ messages in thread
From: Ce Sun @ 2026-11-13 13:11 UTC (permalink / raw)
  To: amd-gfx; +Cc: Hawking.Zhang, tao.zhou1, Ce Sun, YiPeng Chai

amdgpu_uniras_query_block_ecc doesn't support being called during GPU reset.

Signed-off-by: Ce Sun <cesun102@amd.com>
Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 08c6e55a7927..7be33d5559ab 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -3770,6 +3770,10 @@ static int amdgpu_persistent_edc_harvesting(struct amdgpu_device *adev,
 	if (!amdgpu_persistent_edc_harvesting_supported(adev))
 		return 0;
 
+	if ((amdgpu_in_reset(adev) || amdgpu_ras_in_recovery(adev)) &&
+	     amdgpu_uniras_enabled(adev))
+		return 0;
+
 	if (amdgpu_ras_query_error_status(adev, &info) != 0)
 		drm_warn(adev_to_drm(adev), "RAS init query failure");
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/amdgpu: skip uniras block ECC query in GPU reset path
  2026-11-13 13:11 [PATCH] drm/amdgpu: skip uniras block ECC query in GPU reset path Ce Sun
@ 2026-11-13 13:35 ` sashiko-bot
  0 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-11-13 13:35 UTC (permalink / raw)
  To: Ce Sun, amd-gfx

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/amdgpu: incomplete reset check in
  amdgpu_persistent_edc_harvesting()
- [Low] drm/amdgpu: missing Fixes trailer for GPU reset ECC query
  regression
--

commit 6d9c0ce1b3d7514e06ab9efacbe9d580a60d6b1c
Author: Ce Sun <cesun102@amd.com>

> drm/amdgpu: skip uniras block ECC query in GPU reset path
>
> amdgpu_uniras_query_block_ecc doesn't support being called during GPU reset.
>
> Signed-off-by: Ce Sun <cesun102@amd.com>
> Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>

[Severity: Low]
This fixes the GPU reset timeout introduced when
amdgpu_ras_query_error_status() was wired to
amdgpu_uniras_query_block_ecc().  Should it carry:

  Fixes: fe2ccc7b7b23 ("drm/amdgpu: query block error count of ras module")

> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index 312566337ab14..6d8b2e24880f6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -3758,6 +3758,10 @@ static int amdgpu_persistent_edc_harvesting(struct amdgpu_device *adev,
>  	if (!amdgpu_persistent_edc_harvesting_supported(adev))
>  		return 0;
>  
> +	if ((amdgpu_in_reset(adev) || amdgpu_ras_in_recovery(adev)) &&
> +	     amdgpu_uniras_enabled(adev))
> +		return 0;
> +
>  	if (amdgpu_ras_query_error_status(adev, &info) != 0)
>  		drm_warn(adev_to_drm(adev), "RAS init query failure");

[Severity: Medium]
Should this skip GPU reset unconditionally instead of gating on
amdgpu_uniras_enabled(adev), matching amdgpu_ras_reset_error_count()?

During XGMI reset-on-init (amdgpu_xgmi_reset_on_init_work()), the reset
thread holds down_write(&adev->reset_domain->sem), while UniRAS is not
enabled until amdgpu_ras_resume_after_reset() runs after the reset domain
is unlocked.  amdgpu_uniras_enabled(adev) also returns false during reset
on SR-IOV VFs (via amdgpu_virt_ras_remote_uniras_enabled()) and on
non-UniRAS devices.  When amdgpu_uniras_enabled(adev) is false here,
amdgpu_ras_query_error_status() falls through to
amdgpu_ras_query_error_status_with_event(), where
down_read_trylock(&adev->reset_domain->sem) fails against the reset
thread's own write lock and logs a false "RAS init query failure" warning
for every RAS block.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] drm/amdgpu: skip uniras block ECC query in GPU reset path
  2026-11-13  3:28 Ce Sun
@ 2026-11-13 15:45 ` Zhang, Hawking
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Hawking @ 2026-11-13 15:45 UTC (permalink / raw)
  To: Sun, Ce(Overlord), amd-gfx@lists.freedesktop.org,
	Sun, Ce(Overlord)
  Cc: Zhou1, Tao, Chai, Thomas

[-- Attachment #1: Type: text/plain, Size: 2165 bytes --]

AMD General


Hi @Sun, Ce(Overlord)<mailto:Ce.Sun@amd.com>

I'm concerned about the current amdgpu_uniras_query_block_ecc implementation. RAS_CMD__GET_BLOCK_ECC_STATUS is an SR-IOV VF-specific RAS command and should not be invoked in the current UniRAS code path. Using it in a bare-metal environment would trigger an unsupported RAS command error and could cause GPU reset to fail.

Could we evaluate updating amdgpu_persistent_edc_harvesting_supported to prevent inappropriate calls to amdgpu_uniras_query_block_ecc? We should also consider adding an explicit check to ensure that amdgpu_uniras_query_block_ecc is called only for SR-IOV VFs, or retiring the function if it is no longer needed.

Regards,
Hawking

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Ce Sun
Sent: Friday, November 13, 2026 11:28 AM
To: amd-gfx@lists.freedesktop.org
Cc: Zhang, Hawking <Hawking.Zhang@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Sun, Ce(Overlord) <Ce.Sun@amd.com>; Chai, Thomas <YiPeng.Chai@amd.com>
Subject: [PATCH] drm/amdgpu: skip uniras block ECC query in GPU reset path

amdgpu_uniras_query_block_ecc doesn't support being called during GPU reset.

Signed-off-by: Ce Sun <cesun102@amd.com<mailto:cesun102@amd.com>>
Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com<mailto:YiPeng.Chai@amd.com>>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 08c6e55a7927..7be33d5559ab 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -3770,6 +3770,10 @@ static int amdgpu_persistent_edc_harvesting(struct amdgpu_device *adev,
        if (!amdgpu_persistent_edc_harvesting_supported(adev))
                return 0;

+       if ((amdgpu_in_reset(adev) || amdgpu_ras_in_recovery(adev)) &&
+            amdgpu_uniras_enabled(adev))
+               return 0;
+
        if (amdgpu_ras_query_error_status(adev, &info) != 0)
                drm_warn(adev_to_drm(adev), "RAS init query failure");

--
2.34.1


[-- Attachment #2: Type: text/html, Size: 6553 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-13 15:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13 13:11 [PATCH] drm/amdgpu: skip uniras block ECC query in GPU reset path Ce Sun
2026-11-13 13:35 ` sashiko-bot
  -- strict thread matches above, loose matches on Subject: below --
2026-11-13  9:54 Ce Sun
2026-11-13 10:49 ` sashiko-bot
2026-11-13  3:28 Ce Sun
2026-11-13 15:45 ` Zhang, Hawking

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.