Commit ab9a0b1f authored by Andrey Grodzovsky's avatar Andrey Grodzovsky Committed by Alex Deucher

drm/amdgpu: Cache result of last reset at reset domain level.

Will be read by executors of async reset like debugfs.
Signed-off-by: default avatarAndrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 73b4b532
...@@ -5318,6 +5318,8 @@ int amdgpu_device_gpu_recover_imp(struct amdgpu_device *adev, ...@@ -5318,6 +5318,8 @@ int amdgpu_device_gpu_recover_imp(struct amdgpu_device *adev,
if (r) if (r)
dev_info(adev->dev, "GPU reset end with ret = %d\n", r); dev_info(adev->dev, "GPU reset end with ret = %d\n", r);
atomic_set(&adev->reset_domain->reset_res, r);
return r; return r;
} }
...@@ -5332,7 +5334,7 @@ static void amdgpu_device_queue_gpu_recover_work(struct work_struct *work) ...@@ -5332,7 +5334,7 @@ static void amdgpu_device_queue_gpu_recover_work(struct work_struct *work)
{ {
struct amdgpu_recover_work_struct *recover_work = container_of(work, struct amdgpu_recover_work_struct, base); struct amdgpu_recover_work_struct *recover_work = container_of(work, struct amdgpu_recover_work_struct, base);
recover_work->ret = amdgpu_device_gpu_recover_imp(recover_work->adev, recover_work->job); amdgpu_device_gpu_recover_imp(recover_work->adev, recover_work->job);
} }
/* /*
* Serialize gpu recover into reset domain single threaded wq * Serialize gpu recover into reset domain single threaded wq
...@@ -5349,7 +5351,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, ...@@ -5349,7 +5351,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
flush_work(&work.base); flush_work(&work.base);
return work.ret; return atomic_read(&adev->reset_domain->reset_res);
} }
/** /**
......
...@@ -132,6 +132,7 @@ struct amdgpu_reset_domain *amdgpu_reset_create_reset_domain(enum amdgpu_reset_d ...@@ -132,6 +132,7 @@ struct amdgpu_reset_domain *amdgpu_reset_create_reset_domain(enum amdgpu_reset_d
} }
atomic_set(&reset_domain->in_gpu_reset, 0); atomic_set(&reset_domain->in_gpu_reset, 0);
atomic_set(&reset_domain->reset_res, 0);
init_rwsem(&reset_domain->sem); init_rwsem(&reset_domain->sem);
return reset_domain; return reset_domain;
......
...@@ -82,6 +82,7 @@ struct amdgpu_reset_domain { ...@@ -82,6 +82,7 @@ struct amdgpu_reset_domain {
enum amdgpu_reset_domain_type type; enum amdgpu_reset_domain_type type;
struct rw_semaphore sem; struct rw_semaphore sem;
atomic_t in_gpu_reset; atomic_t in_gpu_reset;
atomic_t reset_res;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment