drm/amdgpu: refine create and release logic of hive info
[linux-2.6-microblaze.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_xgmi.h
index 6999eab..148560d 100644 (file)
 
 
 struct amdgpu_hive_info {
-       uint64_t                hive_id;
-       struct list_head        device_list;
-       int number_devices;
-       struct mutex hive_lock, reset_lock;
-       struct kobject *kobj;
-       struct device_attribute dev_attr;
-       struct amdgpu_device *adev;
+       struct kobject kobj;
+       uint64_t hive_id;
+       struct list_head device_list;
+       struct list_head node;
+       atomic_t number_devices;
+       struct mutex hive_lock;
+       atomic_t in_reset;
        int hi_req_count;
        struct amdgpu_device *hi_req_gpu;
        struct task_barrier tb;
@@ -50,7 +50,8 @@ struct amdgpu_pcs_ras_field {
        uint32_t pcs_err_shift;
 };
 
-struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev, int lock);
+struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev);
+void amdgpu_put_xgmi_hive(struct amdgpu_hive_info *hive);
 int amdgpu_xgmi_update_topology(struct amdgpu_hive_info *hive, struct amdgpu_device *adev);
 int amdgpu_xgmi_add_device(struct amdgpu_device *adev);
 int amdgpu_xgmi_remove_device(struct amdgpu_device *adev);