Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-05-17 06:38:43 +0200
committerJiri Slaby <jslaby@suse.cz>2019-05-17 06:38:45 +0200
commit7d77ba3c9bb4cd17cce7379bb8082ac87b62169f (patch)
treed8030b0eb523d82840eccedd27865e0ba3f9e7af
parentffe2fc4b1191766ce0ab4c65054dbc205c66a248 (diff)
hwmon: (occ) Fix extended status bits (bnc#1012628).
-rw-r--r--patches.kernel.org/5.1.3-005-hwmon-occ-Fix-extended-status-bits.patch52
-rw-r--r--series.conf1
2 files changed, 53 insertions, 0 deletions
diff --git a/patches.kernel.org/5.1.3-005-hwmon-occ-Fix-extended-status-bits.patch b/patches.kernel.org/5.1.3-005-hwmon-occ-Fix-extended-status-bits.patch
new file mode 100644
index 0000000000..60e8d85d0d
--- /dev/null
+++ b/patches.kernel.org/5.1.3-005-hwmon-occ-Fix-extended-status-bits.patch
@@ -0,0 +1,52 @@
+From: Lei YU <mine260309@gmail.com>
+Date: Mon, 15 Apr 2019 18:37:20 +0800
+Subject: [PATCH] hwmon: (occ) Fix extended status bits
+References: bnc#1012628
+Patch-mainline: 5.1.3
+Git-commit: b88c5049219a7f322bb1fd65fc30d17472a23563
+
+commit b88c5049219a7f322bb1fd65fc30d17472a23563 upstream.
+
+The occ's extended status is checked and shown as sysfs attributes. But
+the code was incorrectly checking the "status" bits.
+Fix it by checking the "ext_status" bits.
+
+Cc: stable@vger.kernel.org
+Fixes: df04ced684d4 ("hwmon (occ): Add sysfs attributes for additional OCC data")
+Signed-off-by: Lei YU <mine260309@gmail.com>
+Reviewed-by: Eddie James <eajames@linux.ibm.com>
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/hwmon/occ/sysfs.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/hwmon/occ/sysfs.c b/drivers/hwmon/occ/sysfs.c
+index fe3d15e416e7..a71ca94c789f 100644
+--- a/drivers/hwmon/occ/sysfs.c
++++ b/drivers/hwmon/occ/sysfs.c
+@@ -42,16 +42,16 @@ static ssize_t occ_sysfs_show(struct device *dev,
+ val = !!(header->status & OCC_STAT_ACTIVE);
+ break;
+ case 2:
+- val = !!(header->status & OCC_EXT_STAT_DVFS_OT);
++ val = !!(header->ext_status & OCC_EXT_STAT_DVFS_OT);
+ break;
+ case 3:
+- val = !!(header->status & OCC_EXT_STAT_DVFS_POWER);
++ val = !!(header->ext_status & OCC_EXT_STAT_DVFS_POWER);
+ break;
+ case 4:
+- val = !!(header->status & OCC_EXT_STAT_MEM_THROTTLE);
++ val = !!(header->ext_status & OCC_EXT_STAT_MEM_THROTTLE);
+ break;
+ case 5:
+- val = !!(header->status & OCC_EXT_STAT_QUICK_DROP);
++ val = !!(header->ext_status & OCC_EXT_STAT_QUICK_DROP);
+ break;
+ case 6:
+ val = header->occ_state;
+--
+2.21.0
+
diff --git a/series.conf b/series.conf
index 230fd3c7db..ff3e4f2ac9 100644
--- a/series.conf
+++ b/series.conf
@@ -90,6 +90,7 @@
patches.kernel.org/5.1.3-002-platform-x86-thinkpad_acpi-Disable-Bluetooth-fo.patch
patches.kernel.org/5.1.3-003-platform-x86-dell-laptop-fix-rfkill-functionali.patch
patches.kernel.org/5.1.3-004-hwmon-pwm-fan-Disable-PWM-if-fetching-cooling-d.patch
+ patches.kernel.org/5.1.3-005-hwmon-occ-Fix-extended-status-bits.patch
########################################################
# Build fixes that apply to the vanilla kernel too.