[PATCH] drm/amdgpu: don't expose fan attributes on APUs
Quan, Evan
Evan.Quan at amd.com
Thu Nov 29 01:52:18 UTC 2018
Reviewed-by: Evan Quan <evan.quan at amd.com>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Alex
> Deucher
> Sent: 2018年11月29日 2:52
> To: amd-gfx at lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher at amd.com>;
> stable at vger.kernel.org
> Subject: [PATCH] drm/amdgpu: don't expose fan attributes on APUs
>
> They don't have a fan controller.
>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> Cc: stable at vger.kernel.org
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> index 0de8650c5d6e..1f61ed95727c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> @@ -1644,6 +1644,19 @@ static umode_t hwmon_attributes_visible(struct
> kobject *kobj,
> attr == &sensor_dev_attr_fan1_enable.dev_attr.attr))
> return 0;
>
> + /* Skip fan attributes on APU */
> + if ((adev->flags & AMD_IS_APU) &&
> + (attr == &sensor_dev_attr_pwm1.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_min.dev_attr.attr ||
> + attr == &sensor_dev_attr_fan1_input.dev_attr.attr ||
> + attr == &sensor_dev_attr_fan1_min.dev_attr.attr ||
> + attr == &sensor_dev_attr_fan1_max.dev_attr.attr ||
> + attr == &sensor_dev_attr_fan1_target.dev_attr.attr ||
> + attr == &sensor_dev_attr_fan1_enable.dev_attr.attr))
> + return 0;
> +
> /* Skip limit attributes if DPM is not enabled */
> if (!adev->pm.dpm_enabled &&
> (attr == &sensor_dev_attr_temp1_crit.dev_attr.attr ||
> --
> 2.13.6
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
More information about the amd-gfx
mailing list