aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/4083-drm-amd-pp-Skip-fan-attributes-if-fan-not-present.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/4083-drm-amd-pp-Skip-fan-attributes-if-fan-not-present.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/4083-drm-amd-pp-Skip-fan-attributes-if-fan-not-present.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/4083-drm-amd-pp-Skip-fan-attributes-if-fan-not-present.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/4083-drm-amd-pp-Skip-fan-attributes-if-fan-not-present.patch
new file mode 100644
index 00000000..e243f315
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/4083-drm-amd-pp-Skip-fan-attributes-if-fan-not-present.patch
@@ -0,0 +1,65 @@
+From c2ca941471049670f5076a6309be55911e191008 Mon Sep 17 00:00:00 2001
+From: Rex Zhu <Rex.Zhu@amd.com>
+Date: Fri, 27 Apr 2018 13:46:08 +0800
+Subject: [PATCH 4083/4131] drm/amd/pp: Skip fan attributes if fan not present
+
+With powerplay enabled, also need to skip fan attributes
+if no fan present.
+
+Change-Id: I9957b9b3cd9b29b8a60f6f0cbc24d6f391383888
+Reviewed-by: Huang Rui <ray.huang@amd.com>
+Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 21 ++++++++-------------
+ drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 3 +++
+ 2 files changed, 11 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+index 16fac65..44a8bb2 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+@@ -1194,19 +1194,14 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
+ struct amdgpu_device *adev = dev_get_drvdata(dev);
+ umode_t effective_mode = attr->mode;
+
+- /* handle non-powerplay limitations */
+- if (!adev->powerplay.pp_handle) {
+- /* Skip fan attributes if fan is not present */
+- if (adev->pm.no_fan &&
+- (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))
+- return 0;
+- /* requires powerplay */
+- if (attr == &sensor_dev_attr_fan1_input.dev_attr.attr)
+- return 0;
+- }
++
++ /* Skip fan attributes if fan is not present */
++ if (adev->pm.no_fan && (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))
++ return 0;
+
+ /* Skip limit attributes if DPM is not enabled */
+ if (!adev->pm.dpm_enabled &&
+diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
+index d1052b5..43f0ea8 100644
+--- a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
++++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
+@@ -223,6 +223,9 @@ int hwmgr_hw_init(struct pp_hwmgr *hwmgr)
+ if (ret)
+ goto err;
+
++ ((struct amdgpu_device *)hwmgr->adev)->pm.no_fan =
++ hwmgr->thermal_controller.fanInfo.bNoFan;
++
+ ret = hwmgr->hwmgr_func->backend_init(hwmgr);
+ if (ret)
+ goto err1;
+--
+2.7.4
+