Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: Add task barrier to XGMI hive.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Le Ma <Le.Ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Andrey Grodzovsky and committed by
Alex Deucher
f33a8770 368fd0aa

+6
+4
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
··· 261 261 INIT_LIST_HEAD(&tmp->device_list); 262 262 mutex_init(&tmp->hive_lock); 263 263 mutex_init(&tmp->reset_lock); 264 + task_barrier_init(&tmp->tb); 264 265 265 266 if (lock) 266 267 mutex_lock(&tmp->hive_lock); ··· 409 408 top_info->num_nodes = count; 410 409 hive->number_devices = count; 411 410 411 + task_barrier_add_task(&hive->tb); 412 + 412 413 if (amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_PSP)) { 413 414 list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) { 414 415 /* update node list for other device in the hive */ ··· 473 470 mutex_destroy(&hive->hive_lock); 474 471 mutex_destroy(&hive->reset_lock); 475 472 } else { 473 + task_barrier_rem_task(&hive->tb); 476 474 amdgpu_xgmi_sysfs_rem_dev_info(adev, hive); 477 475 mutex_unlock(&hive->hive_lock); 478 476 }
+2
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h
··· 22 22 #ifndef __AMDGPU_XGMI_H__ 23 23 #define __AMDGPU_XGMI_H__ 24 24 25 + #include <drm/task_barrier.h> 25 26 #include "amdgpu_psp.h" 26 27 27 28 struct amdgpu_hive_info { ··· 34 33 struct device_attribute dev_attr; 35 34 struct amdgpu_device *adev; 36 35 int pstate; /*0 -- low , 1 -- high , -1 unknown*/ 36 + struct task_barrier tb; 37 37 }; 38 38 39 39 struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev, int lock);