#include "amdgpu_sync.h"
#include "amdgpu_vm.h"
#include "amdgpu_xcp.h"
-
+#include "kfd_topology.h"
extern uint64_t amdgpu_amdkfd_total_mem_size;
enum TLB_FLUSH_TYPE {
/* Don't init kfd if whole hive need to be reset during init */
if (adev->init_lvl->level != AMDGPU_INIT_LEVEL_MINIMAL_XGMI) {
- kgd2kfd_init_zone_device(adev);
amdgpu_amdkfd_device_init(adev);
}
if (adev->init_lvl->level == AMDGPU_INIT_LEVEL_MINIMAL_XGMI)
amdgpu_xgmi_reset_on_init(adev);
+
+ /* Don't init kfd if whole hive need to be reset during init */
+ if (adev->init_lvl->level != AMDGPU_INIT_LEVEL_MINIMAL_XGMI) {
+ kgd2kfd_init_zone_device(adev);
+ kfd_update_svm_support_properties(adev);
+ }
+
/*
* Place those sysfs registering after `late_init`. As some of those
* operations performed in `late_init` might affect the sysfs
}
#endif
+
+void kfd_update_svm_support_properties(struct amdgpu_device *adev)
+{
+ struct kfd_topology_device *dev;
+ int ret;
+
+ down_write(&topology_lock);
+ list_for_each_entry(dev, &topology_device_list, list) {
+ if (!dev->gpu || dev->gpu->adev != adev)
+ continue;
+
+ if (KFD_IS_SVM_API_SUPPORTED(adev)) {
+ dev->node_props.capability |= HSA_CAP_SVMAPI_SUPPORTED;
+ ret = kfd_topology_update_sysfs();
+ if (!ret)
+ sys_props.generation_count++;
+ else
+ dev_err(adev->dev, "Failed to update SVM support properties. ret=%d\n", ret);
+ } else
+ dev->node_props.capability &= ~HSA_CAP_SVMAPI_SUPPORTED;
+ }
+ up_write(&topology_lock);
+}
struct list_head *device_list);
void kfd_release_topology_device_list(struct list_head *device_list);
+#if IS_ENABLED(CONFIG_HSA_AMD)
+void kfd_update_svm_support_properties(struct amdgpu_device *adev);
+#else
+static inline void kfd_update_svm_support_properties(struct amdgpu_device *adev) {}
+#endif
+
#endif /* __KFD_TOPOLOGY_H__ */