]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Jul 2014 17:41:48 +0000 (10:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Jul 2014 17:41:48 +0000 (10:41 -0700)
added patches:
hwmon-adm1029-ensure-the-fan_div-cache-is-updated-in-set_fan_div.patch
hwmon-amc6821-fix-permissions-for-temp2_input.patch
powerpc-perf-never-program-book3s-pmcs-with-values-0x80000000.patch

queue-3.4/hwmon-adm1029-ensure-the-fan_div-cache-is-updated-in-set_fan_div.patch [new file with mode: 0644]
queue-3.4/hwmon-amc6821-fix-permissions-for-temp2_input.patch [new file with mode: 0644]
queue-3.4/powerpc-perf-never-program-book3s-pmcs-with-values-0x80000000.patch [new file with mode: 0644]
queue-3.4/series

diff --git a/queue-3.4/hwmon-adm1029-ensure-the-fan_div-cache-is-updated-in-set_fan_div.patch b/queue-3.4/hwmon-adm1029-ensure-the-fan_div-cache-is-updated-in-set_fan_div.patch
new file mode 100644 (file)
index 0000000..947d918
--- /dev/null
@@ -0,0 +1,36 @@
+From 1035a9e3e9c76b64a860a774f5b867d28d34acc2 Mon Sep 17 00:00:00 2001
+From: Axel Lin <axel.lin@ingics.com>
+Date: Wed, 2 Jul 2014 08:29:55 +0800
+Subject: hwmon: (adm1029) Ensure the fan_div cache is updated in set_fan_div
+
+From: Axel Lin <axel.lin@ingics.com>
+
+commit 1035a9e3e9c76b64a860a774f5b867d28d34acc2 upstream.
+
+Writing to fanX_div does not clear the cache. As a result, reading
+from fanX_div may return the old value for up to two seconds
+after writing a new value.
+
+This patch ensures the fan_div cache is updated in set_fan_div().
+
+Reported-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Axel Lin <axel.lin@ingics.com>
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/hwmon/adm1029.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/hwmon/adm1029.c
++++ b/drivers/hwmon/adm1029.c
+@@ -231,6 +231,9 @@ static ssize_t set_fan_div(struct device
+       /* Update the value */
+       reg = (reg & 0x3F) | (val << 6);
++      /* Update the cache */
++      data->fan_div[attr->index] = reg;
++
+       /* Write value */
+       i2c_smbus_write_byte_data(client,
+                                 ADM1029_REG_FAN_DIV[attr->index], reg);
diff --git a/queue-3.4/hwmon-amc6821-fix-permissions-for-temp2_input.patch b/queue-3.4/hwmon-amc6821-fix-permissions-for-temp2_input.patch
new file mode 100644 (file)
index 0000000..e3b8e6e
--- /dev/null
@@ -0,0 +1,31 @@
+From df86754b746e9a0ff6f863f690b1c01d408e3cdc Mon Sep 17 00:00:00 2001
+From: Axel Lin <axel.lin@ingics.com>
+Date: Wed, 2 Jul 2014 07:44:44 +0800
+Subject: hwmon: (amc6821) Fix permissions for temp2_input
+
+From: Axel Lin <axel.lin@ingics.com>
+
+commit df86754b746e9a0ff6f863f690b1c01d408e3cdc upstream.
+
+temp2_input should not be writable, fix it.
+
+Reported-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Axel Lin <axel.lin@ingics.com>
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/hwmon/amc6821.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/hwmon/amc6821.c
++++ b/drivers/hwmon/amc6821.c
+@@ -715,7 +715,7 @@ static SENSOR_DEVICE_ATTR(temp1_max_alar
+       get_temp_alarm, NULL, IDX_TEMP1_MAX);
+ static SENSOR_DEVICE_ATTR(temp1_crit_alarm, S_IRUGO,
+       get_temp_alarm, NULL, IDX_TEMP1_CRIT);
+-static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO | S_IWUSR,
++static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO,
+       get_temp, NULL, IDX_TEMP2_INPUT);
+ static SENSOR_DEVICE_ATTR(temp2_min, S_IRUGO | S_IWUSR, get_temp,
+       set_temp, IDX_TEMP2_MIN);
diff --git a/queue-3.4/powerpc-perf-never-program-book3s-pmcs-with-values-0x80000000.patch b/queue-3.4/powerpc-perf-never-program-book3s-pmcs-with-values-0x80000000.patch
new file mode 100644 (file)
index 0000000..48b38ef
--- /dev/null
@@ -0,0 +1,57 @@
+From f56029410a13cae3652d1f34788045c40a13ffc7 Mon Sep 17 00:00:00 2001
+From: Anton Blanchard <anton@samba.org>
+Date: Thu, 29 May 2014 08:15:38 +1000
+Subject: powerpc/perf: Never program book3s PMCs with values >= 0x80000000
+
+From: Anton Blanchard <anton@samba.org>
+
+commit f56029410a13cae3652d1f34788045c40a13ffc7 upstream.
+
+We are seeing a lot of PMU warnings on POWER8:
+
+    Can't find PMC that caused IRQ
+
+Looking closer, the active PMC is 0 at this point and we took a PMU
+exception on the transition from negative to 0. Some versions of POWER8
+have an issue where they edge detect and not level detect PMC overflows.
+
+A number of places program the PMC with (0x80000000 - period_left),
+where period_left can be negative. We can either fix all of these or
+just ensure that period_left is always >= 1.
+
+This patch takes the second option.
+
+Signed-off-by: Anton Blanchard <anton@samba.org>
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/powerpc/perf/core-book3s.c |   17 ++++++++++++++++-
+ 1 file changed, 16 insertions(+), 1 deletion(-)
+
+--- a/arch/powerpc/perf/core-book3s.c
++++ b/arch/powerpc/perf/core-book3s.c
+@@ -472,7 +472,22 @@ static void power_pmu_read(struct perf_e
+       } while (local64_cmpxchg(&event->hw.prev_count, prev, val) != prev);
+       local64_add(delta, &event->count);
+-      local64_sub(delta, &event->hw.period_left);
++
++      /*
++       * A number of places program the PMC with (0x80000000 - period_left).
++       * We never want period_left to be less than 1 because we will program
++       * the PMC with a value >= 0x800000000 and an edge detected PMC will
++       * roll around to 0 before taking an exception. We have seen this
++       * on POWER8.
++       *
++       * To fix this, clamp the minimum value of period_left to 1.
++       */
++      do {
++              prev = local64_read(&event->hw.period_left);
++              val = prev - delta;
++              if (val < 1)
++                      val = 1;
++      } while (local64_cmpxchg(&event->hw.period_left, prev, val) != prev);
+ }
+ /*
index 343e24d7239ce33f128b3c1838eae82aad1c4aba..12e5c3f453b31b348c1107f7516c7f43a8996914 100644 (file)
@@ -2,3 +2,6 @@ usb-option-add-id-for-telewell-tw-lte-4g-v2.patch
 usb-cp210x-add-support-for-corsair-usb-dongle.patch
 usb-ftdi_sio-add-extra-pid.patch
 cpuset-mempolicy-fix-sleeping-function-called-from-invalid-context.patch
+hwmon-amc6821-fix-permissions-for-temp2_input.patch
+hwmon-adm1029-ensure-the-fan_div-cache-is-updated-in-set_fan_div.patch
+powerpc-perf-never-program-book3s-pmcs-with-values-0x80000000.patch