aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3623-drm-amd-amdgpu-hide-voltage-and-power-sensors-on-SI-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3623-drm-amd-amdgpu-hide-voltage-and-power-sensors-on-SI-.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3623-drm-amd-amdgpu-hide-voltage-and-power-sensors-on-SI-.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3623-drm-amd-amdgpu-hide-voltage-and-power-sensors-on-SI-.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3623-drm-amd-amdgpu-hide-voltage-and-power-sensors-on-SI-.patch
new file mode 100644
index 00000000..799a97af
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3623-drm-amd-amdgpu-hide-voltage-and-power-sensors-on-SI-.patch
@@ -0,0 +1,52 @@
+From 18c72104e07959de36dbaae585d45f0adbfac9b5 Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare@suse.de>
+Date: Wed, 28 Aug 2019 10:27:29 +0200
+Subject: [PATCH 3623/4256] drm/amd/amdgpu: hide voltage and power sensors on
+ SI and KV parts
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The driver does not support these sensors yet and there is no point in
+creating sysfs attributes which will always return an error.
+
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+Cc: Alex Deucher <alexander.deucher@amd.com>
+Cc: "Christian König" <christian.koenig@amd.com>
+Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+index 6a651b0480c0..7842beea7d91 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+@@ -2346,7 +2346,9 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
+ effective_mode &= ~S_IWUSR;
+ }
+
+- if ((adev->flags & AMD_IS_APU) &&
++ if (((adev->flags & AMD_IS_APU) ||
++ adev->family == AMDGPU_FAMILY_SI || /* not implemented yet */
++ adev->family == AMDGPU_FAMILY_KV) && /* not implemented yet */
+ (attr == &sensor_dev_attr_power1_average.dev_attr.attr ||
+ attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
+ attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr||
+@@ -2370,6 +2372,12 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
+ return 0;
+ }
+
++ if ((adev->family == AMDGPU_FAMILY_SI || /* not implemented yet */
++ adev->family == AMDGPU_FAMILY_KV) && /* not implemented yet */
++ (attr == &sensor_dev_attr_in0_input.dev_attr.attr ||
++ attr == &sensor_dev_attr_in0_label.dev_attr.attr))
++ return 0;
++
+ /* only APUs have vddnb */
+ if (!(adev->flags & AMD_IS_APU) &&
+ (attr == &sensor_dev_attr_in1_input.dev_attr.attr ||
+--
+2.17.1
+