drm/amdgpu: Rework amdgpu_device_lock_adev
This functions needs to be split into 2 parts where one is called only once for locking single instance of reset_domain's sem and reset flag and the other part which handles MP1 states should still be called for each device in XGMI hive. Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Link: https://www.spinics.net/lists/amd-gfx/msg74118.html
This commit is contained in:
@@ -137,5 +137,24 @@ struct amdgpu_reset_domain *amdgpu_reset_create_reset_domain(enum amdgpu_reset_d
|
||||
return reset_domain;
|
||||
}
|
||||
|
||||
void amdgpu_device_lock_reset_domain(struct amdgpu_reset_domain *reset_domain,
|
||||
struct amdgpu_hive_info *hive)
|
||||
{
|
||||
atomic_set(&reset_domain->in_gpu_reset, 1);
|
||||
|
||||
if (hive) {
|
||||
down_write_nest_lock(&reset_domain->sem, &hive->hive_lock);
|
||||
} else {
|
||||
down_write(&reset_domain->sem);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void amdgpu_device_unlock_reset_domain(struct amdgpu_reset_domain *reset_domain)
|
||||
{
|
||||
atomic_set(&reset_domain->in_gpu_reset, 0);
|
||||
up_write(&reset_domain->sem);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user