diff options
| author | Monk Liu <[email protected]> | 2017-10-17 06:39:23 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2017-12-04 21:33:11 +0000 |
| commit | 668ca1b44de16a8182419cc1a5913d33cc6263bd (patch) | |
| tree | 3f2068533efc7277604de16abc11727e39323233 /drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | |
| parent | drm/amdgpu: Remove job->s_entity to avoid keeping reference to stale pointer. (diff) | |
| download | kernel-668ca1b44de16a8182419cc1a5913d33cc6263bd.tar.gz kernel-668ca1b44de16a8182419cc1a5913d33cc6263bd.zip | |
drm/amdgpu:don't change ctx->reset_couner upon query
reset_counter marks the reset counter number once the context
is created, shouldn't be changed due to query.
To keep U/K interface on the ctx_query and keep ctx's reset_counter
logic compatible with GPU RESET feature, now use another var named
"reset_counter_query" to replace the original checked & updated in
amdgpu_ctx_query.
Signed-off-by: Monk Liu <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index 1bf4cdc597aa..c539fb6a597e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c @@ -75,6 +75,7 @@ static int amdgpu_ctx_init(struct amdgpu_device *adev, } ctx->reset_counter = atomic_read(&adev->gpu_reset_counter); + ctx->reset_counter_query = ctx->reset_counter; ctx->vram_lost_counter = atomic_read(&adev->vram_lost_counter); ctx->init_priority = priority; ctx->override_priority = AMD_SCHED_PRIORITY_UNSET; @@ -216,11 +217,11 @@ static int amdgpu_ctx_query(struct amdgpu_device *adev, /* determine if a GPU reset has occured since the last call */ reset_counter = atomic_read(&adev->gpu_reset_counter); /* TODO: this should ideally return NO, GUILTY, or INNOCENT. */ - if (ctx->reset_counter == reset_counter) + if (ctx->reset_counter_query == reset_counter) out->state.reset_status = AMDGPU_CTX_NO_RESET; else out->state.reset_status = AMDGPU_CTX_UNKNOWN_RESET; - ctx->reset_counter = reset_counter; + ctx->reset_counter_query = reset_counter; mutex_unlock(&mgr->lock); return 0; |
