Skip to content

Commit 9a1662f

Browse files
Graham Sideralexdeucher
authored andcommitted
drm/amdgpu: extend halt_if_hws_hang to MES
Hang on MES timeout if halt_if_hws_hang is set to 1. Signed-off-by: Graham Sider <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 403cea4 commit 9a1662f

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,12 @@ extern int amdgpu_use_xgmi_p2p;
219219
extern int sched_policy;
220220
extern bool debug_evictions;
221221
extern bool no_system_mem_limit;
222+
extern int halt_if_hws_hang;
222223
#else
223224
static const int __maybe_unused sched_policy = KFD_SCHED_POLICY_HWS;
224225
static const bool __maybe_unused debug_evictions; /* = false */
225226
static const bool __maybe_unused no_system_mem_limit;
227+
static const int __maybe_unused halt_if_hws_hang;
226228
#endif
227229
#ifdef CONFIG_HSA_AMD_P2P
228230
extern bool pcie_p2p;

drivers/gpu/drm/amd/amdgpu/mes_v10_1.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ static int mes_v10_1_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,
121121
if (r < 1) {
122122
DRM_ERROR("MES failed to response msg=%d\n",
123123
x_pkt->header.opcode);
124+
125+
while (halt_if_hws_hang)
126+
schedule();
127+
124128
return -ETIMEDOUT;
125129
}
126130

drivers/gpu/drm/amd/amdgpu/mes_v11_0.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ static int mes_v11_0_submit_pkt_and_poll_completion(struct amdgpu_mes *mes,
129129
if (r < 1) {
130130
DRM_ERROR("MES failed to response msg=%d\n",
131131
x_pkt->header.opcode);
132+
133+
while (halt_if_hws_hang)
134+
schedule();
135+
132136
return -ETIMEDOUT;
133137
}
134138

0 commit comments

Comments
 (0)