AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: extend halt_if_hws_hang to MES
@ 2022-10-25 13:42 Graham Sider
  2022-10-31 19:22 ` Felix Kuehling
  0 siblings, 1 reply; 2+ messages in thread
From: Graham Sider @ 2022-10-25 13:42 UTC (permalink / raw)
  To: amd-gfx; +Cc: Felix.Kuehling, Graham Sider, Hawking.Zhang

Hang on MES timeout if halt_if_hws_hang is set to 1.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h    | 2 ++
 drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 0e6ddf05c23c..9999c18e7d8e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -219,10 +219,12 @@ extern int amdgpu_use_xgmi_p2p;
 extern int sched_policy;
 extern bool debug_evictions;
 extern bool no_system_mem_limit;
+extern int halt_if_hws_hang;
 #else
 static const int __maybe_unused sched_policy = KFD_SCHED_POLICY_HWS;
 static const bool __maybe_unused debug_evictions; /* = false */
 static const bool __maybe_unused no_system_mem_limit;
+static const int __maybe_unused halt_if_hws_hang;
 #endif
 #ifdef CONFIG_HSA_AMD_P2P
 extern bool pcie_p2p;
diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
index e14f314902b1..d09f92d38ad1 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
@@ -129,6 +129,10 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,
 	if (r < 1) {
 		DRM_ERROR("MES failed to response msg=%d\n",
 			  x_pkt->header.opcode);
+
+		while (halt_if_hws_hang)
+			schedule();
+
 		return -ETIMEDOUT;
 	}
 
-- 
2.25.1


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

* Re: [PATCH] drm/amdgpu: extend halt_if_hws_hang to MES
  2022-10-25 13:42 [PATCH] drm/amdgpu: extend halt_if_hws_hang to MES Graham Sider
@ 2022-10-31 19:22 ` Felix Kuehling
  0 siblings, 0 replies; 2+ messages in thread
From: Felix Kuehling @ 2022-10-31 19:22 UTC (permalink / raw)
  To: Graham Sider, amd-gfx; +Cc: Hawking.Zhang

Am 2022-10-25 um 09:42 schrieb Graham Sider:
> Hang on MES timeout if halt_if_hws_hang is set to 1.
>
> Signed-off-by: Graham Sider <Graham.Sider@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h    | 2 ++
>   drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 4 ++++
>   2 files changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 0e6ddf05c23c..9999c18e7d8e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -219,10 +219,12 @@ extern int amdgpu_use_xgmi_p2p;
>   extern int sched_policy;
>   extern bool debug_evictions;
>   extern bool no_system_mem_limit;
> +extern int halt_if_hws_hang;
>   #else
>   static const int __maybe_unused sched_policy = KFD_SCHED_POLICY_HWS;
>   static const bool __maybe_unused debug_evictions; /* = false */
>   static const bool __maybe_unused no_system_mem_limit;
> +static const int __maybe_unused halt_if_hws_hang;
>   #endif
>   #ifdef CONFIG_HSA_AMD_P2P
>   extern bool pcie_p2p;
> diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
> index e14f314902b1..d09f92d38ad1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
> @@ -129,6 +129,10 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,
>   	if (r < 1) {
>   		DRM_ERROR("MES failed to response msg=%d\n",
>   			  x_pkt->header.opcode);
> +
> +		while (halt_if_hws_hang)
> +			schedule();
> +

I think we should add the same in mes_v10_1.c to keep it consistent.

Regards,
   Felix


>   		return -ETIMEDOUT;
>   	}
>   

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

end of thread, other threads:[~2022-10-31 19:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-25 13:42 [PATCH] drm/amdgpu: extend halt_if_hws_hang to MES Graham Sider
2022-10-31 19:22 ` Felix Kuehling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox