Commit fc5a136d authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher

drm/amd/pp: Skip fan attributes if fan not present

With powerplay enabled, also need to skip fan attributes
if no fan present.
Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 719a39a1
...@@ -1364,19 +1364,14 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj, ...@@ -1364,19 +1364,14 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
struct amdgpu_device *adev = dev_get_drvdata(dev); struct amdgpu_device *adev = dev_get_drvdata(dev);
umode_t effective_mode = attr->mode; umode_t effective_mode = attr->mode;
/* handle non-powerplay limitations */
if (!adev->powerplay.pp_handle) {
/* Skip fan attributes if fan is not present */ /* Skip fan attributes if fan is not present */
if (adev->pm.no_fan && if (adev->pm.no_fan && (attr == &sensor_dev_attr_pwm1.dev_attr.attr ||
(attr == &sensor_dev_attr_pwm1.dev_attr.attr ||
attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr || attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr ||
attr == &sensor_dev_attr_pwm1_max.dev_attr.attr || attr == &sensor_dev_attr_pwm1_max.dev_attr.attr ||
attr == &sensor_dev_attr_pwm1_min.dev_attr.attr)) attr == &sensor_dev_attr_pwm1_min.dev_attr.attr ||
attr == &sensor_dev_attr_fan1_input.dev_attr.attr))
return 0; return 0;
/* requires powerplay */
if (attr == &sensor_dev_attr_fan1_input.dev_attr.attr)
return 0;
}
/* Skip limit attributes if DPM is not enabled */ /* Skip limit attributes if DPM is not enabled */
if (!adev->pm.dpm_enabled && if (!adev->pm.dpm_enabled &&
......
...@@ -229,6 +229,9 @@ int hwmgr_hw_init(struct pp_hwmgr *hwmgr) ...@@ -229,6 +229,9 @@ int hwmgr_hw_init(struct pp_hwmgr *hwmgr)
if (ret) if (ret)
goto err; goto err;
((struct amdgpu_device *)hwmgr->adev)->pm.no_fan =
hwmgr->thermal_controller.fanInfo.bNoFan;
ret = hwmgr->hwmgr_func->backend_init(hwmgr); ret = hwmgr->hwmgr_func->backend_init(hwmgr);
if (ret) if (ret)
goto err1; goto err1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment