| From fcf91c8cb3174c84c7576f53205b3c78056336b5 Mon Sep 17 00:00:00 2001 |
| From: Felix Kuehling <Felix.Kuehling@amd.com> |
| Date: Thu, 5 Sep 2019 19:22:02 -0400 |
| Subject: [PATCH] drm/amdgpu: Fix KFD-related kernel oops on Hawaii |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| commit dcafbd50f2e4d5cc964aae409fb5691b743fba23 upstream. |
| |
| Hawaii needs to flush caches explicitly, submitting an IB in a user |
| VMID from kernel mode. There is no s_fence in this case. |
| |
| Fixes: eb3961a57424 ("drm/amdgpu: remove fence context from the job") |
| Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> |
| Reviewed-by: Christian Kรถnig <christian.koenig@amd.com> |
| Signed-off-by: Alex Deucher <alexander.deucher@amd.com> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c |
| index fe393a46f881..5eed2423dbb5 100644 |
| --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c |
| +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c |
| @@ -141,7 +141,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, |
| /* ring tests don't use a job */ |
| if (job) { |
| vm = job->vm; |
| - fence_ctx = job->base.s_fence->scheduled.context; |
| + fence_ctx = job->base.s_fence ? |
| + job->base.s_fence->scheduled.context : 0; |
| } else { |
| vm = NULL; |
| fence_ctx = 0; |
| -- |
| 2.7.4 |
| |