Merge tag 'drm-next-2021-05-10' of git://anongit.freedesktop.org/drm/drm
[sfrench/cifs-2.6.git] / drivers / gpu / drm / amd / pm / amdgpu_pm.c
index 8128603ef495fb76cd8328cc626e1e055ffec9bf..9a54066ec0af706ea1315e0cafb677574791d9a2 100644 (file)
@@ -451,7 +451,7 @@ static ssize_t amdgpu_get_pp_cur_state(struct device *dev,
        struct drm_device *ddev = dev_get_drvdata(dev);
        struct amdgpu_device *adev = drm_to_adev(ddev);
        const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
-       struct pp_states_info data;
+       struct pp_states_info data = {0};
        enum amd_pm_state_type pm = 0;
        int i = 0, ret = 0;
 
@@ -1893,6 +1893,14 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
                }
        }
 
+       if (DEVICE_ATTR_IS(pp_dpm_dcefclk)) {
+               /* SMU MP1 does not support dcefclk level setting */
+               if (asic_type >= CHIP_NAVI10) {
+                       dev_attr->attr.mode &= ~S_IWUGO;
+                       dev_attr->store = NULL;
+               }
+       }
+
 #undef DEVICE_ATTR_IS
 
        return 0;