From: Jonathan Kim Date: Thu, 14 Dec 2023 03:08:03 +0000 (-0500) Subject: drm/amdkfd: only flush mes process context if mes support is there X-Git-Tag: v6.6.17~192 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3c0a7eac9e7883317e2010bc525a3f1c4847587c;p=platform%2Fkernel%2Flinux-starfive.git drm/amdkfd: only flush mes process context if mes support is there [ Upstream commit 24149412dfc71f7f4a54868702e9145e396263d3 ] Fix up on mes process context flush to prevent non-mes devices from spamming error messages or running into undefined behaviour during process termination. Fixes: bd33bb1409b4 ("drm/amdkfd: fix mes set shader debugger process management") Signed-off-by: Jonathan Kim Reviewed-by: Eric Huang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c index 8e55e78..43eff22 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c @@ -87,7 +87,8 @@ void kfd_process_dequeue_from_device(struct kfd_process_device *pdd) return; dev->dqm->ops.process_termination(dev->dqm, &pdd->qpd); - amdgpu_mes_flush_shader_debugger(dev->adev, pdd->proc_ctx_gpu_addr); + if (dev->kfd->shared_resources.enable_mes) + amdgpu_mes_flush_shader_debugger(dev->adev, pdd->proc_ctx_gpu_addr); pdd->already_dequeued = true; }