OSDN Git Service

drm/amdgpu: skip sysfs node not belong to one vf mode
authorMonk Liu <Monk.Liu@amd.com>
Wed, 22 Apr 2020 04:19:13 +0000 (12:19 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 24 Apr 2020 15:42:11 +0000 (11:42 -0400)
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Acked-by: Yintian Tao <yttao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c

index 49e2e43..c762deb 100644 (file)
@@ -3271,26 +3271,27 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
                return ret;
        }
 
-
-       ret = device_create_file(adev->dev, &dev_attr_pp_num_states);
-       if (ret) {
-               DRM_ERROR("failed to create device file pp_num_states\n");
-               return ret;
-       }
-       ret = device_create_file(adev->dev, &dev_attr_pp_cur_state);
-       if (ret) {
-               DRM_ERROR("failed to create device file pp_cur_state\n");
-               return ret;
-       }
-       ret = device_create_file(adev->dev, &dev_attr_pp_force_state);
-       if (ret) {
-               DRM_ERROR("failed to create device file pp_force_state\n");
-               return ret;
-       }
-       ret = device_create_file(adev->dev, &dev_attr_pp_table);
-       if (ret) {
-               DRM_ERROR("failed to create device file pp_table\n");
-               return ret;
+       if (!amdgpu_sriov_vf(adev)) {
+               ret = device_create_file(adev->dev, &dev_attr_pp_num_states);
+               if (ret) {
+                       DRM_ERROR("failed to create device file pp_num_states\n");
+                       return ret;
+               }
+               ret = device_create_file(adev->dev, &dev_attr_pp_cur_state);
+               if (ret) {
+                       DRM_ERROR("failed to create device file pp_cur_state\n");
+                       return ret;
+               }
+               ret = device_create_file(adev->dev, &dev_attr_pp_force_state);
+               if (ret) {
+                       DRM_ERROR("failed to create device file pp_force_state\n");
+                       return ret;
+               }
+               ret = device_create_file(adev->dev, &dev_attr_pp_table);
+               if (ret) {
+                       DRM_ERROR("failed to create device file pp_table\n");
+                       return ret;
+               }
        }
 
        ret = device_create_file(adev->dev, &dev_attr_pp_dpm_sclk);
@@ -3337,6 +3338,13 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
                        return ret;
                }
        }
+
+       /* the reset are not needed for SRIOV one vf mode */
+       if (amdgpu_sriov_vf(adev)) {
+               adev->pm.sysfs_initialized = true;
+               return ret;
+       }
+
        if (adev->asic_type != CHIP_ARCTURUS) {
                ret = device_create_file(adev->dev, &dev_attr_pp_dpm_pcie);
                if (ret) {