]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Oct 2016 15:17:36 +0000 (17:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Oct 2016 15:17:36 +0000 (17:17 +0200)
added patches:
hwmon-adt7411-set-bit-3-in-cfg1-register.patch
ipvs-fix-bind-to-link-local-mcast-ipv6-address-in-backup.patch
mmc-pxamci-fix-potential-oops.patch
nvmem-declare-nvmem_cell_read-consistently.patch
spi-sh-msiof-avoid-invalid-clock-generator-parameters.patch
tools-vm-slabinfo-fix-an-unintentional-printf.patch

queue-4.4/hwmon-adt7411-set-bit-3-in-cfg1-register.patch [new file with mode: 0644]
queue-4.4/ipvs-fix-bind-to-link-local-mcast-ipv6-address-in-backup.patch [new file with mode: 0644]
queue-4.4/mmc-pxamci-fix-potential-oops.patch [new file with mode: 0644]
queue-4.4/nvmem-declare-nvmem_cell_read-consistently.patch [new file with mode: 0644]
queue-4.4/series
queue-4.4/spi-sh-msiof-avoid-invalid-clock-generator-parameters.patch [new file with mode: 0644]
queue-4.4/tools-vm-slabinfo-fix-an-unintentional-printf.patch [new file with mode: 0644]

diff --git a/queue-4.4/hwmon-adt7411-set-bit-3-in-cfg1-register.patch b/queue-4.4/hwmon-adt7411-set-bit-3-in-cfg1-register.patch
new file mode 100644 (file)
index 0000000..351a691
--- /dev/null
@@ -0,0 +1,43 @@
+From b53893aae441a034bf4dbbad42fe218561d7d81f Mon Sep 17 00:00:00 2001
+From: Michael Walle <michael@walle.cc>
+Date: Tue, 19 Jul 2016 16:43:26 +0200
+Subject: hwmon: (adt7411) set bit 3 in CFG1 register
+
+From: Michael Walle <michael@walle.cc>
+
+commit b53893aae441a034bf4dbbad42fe218561d7d81f upstream.
+
+According to the datasheet you should only write 1 to this bit. If it is
+not set, at least AIN3 will return bad values on newer silicon revisions.
+
+Fixes: d84ca5b345c2 ("hwmon: Add driver for ADT7411 voltage and temperature sensor")
+Signed-off-by: Michael Walle <michael@walle.cc>
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/hwmon/adt7411.c |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/drivers/hwmon/adt7411.c
++++ b/drivers/hwmon/adt7411.c
+@@ -30,6 +30,7 @@
+ #define ADT7411_REG_CFG1                      0x18
+ #define ADT7411_CFG1_START_MONITOR            (1 << 0)
++#define ADT7411_CFG1_RESERVED_BIT3            (1 << 3)
+ #define ADT7411_REG_CFG2                      0x19
+ #define ADT7411_CFG2_DISABLE_AVG              (1 << 5)
+@@ -296,8 +297,10 @@ static int adt7411_probe(struct i2c_clie
+       mutex_init(&data->device_lock);
+       mutex_init(&data->update_lock);
++      /* According to the datasheet, we must only write 1 to bit 3 */
+       ret = adt7411_modify_bit(client, ADT7411_REG_CFG1,
+-                               ADT7411_CFG1_START_MONITOR, 1);
++                               ADT7411_CFG1_RESERVED_BIT3
++                               | ADT7411_CFG1_START_MONITOR, 1);
+       if (ret < 0)
+               return ret;
diff --git a/queue-4.4/ipvs-fix-bind-to-link-local-mcast-ipv6-address-in-backup.patch b/queue-4.4/ipvs-fix-bind-to-link-local-mcast-ipv6-address-in-backup.patch
new file mode 100644 (file)
index 0000000..3183371
--- /dev/null
@@ -0,0 +1,75 @@
+From 3777ed688fba82d0bd43f9fc1ebbc6abe788576d Mon Sep 17 00:00:00 2001
+From: Quentin Armitage <quentin@armitage.org.uk>
+Date: Thu, 16 Jun 2016 08:00:14 +0100
+Subject: ipvs: fix bind to link-local mcast IPv6 address in backup
+
+From: Quentin Armitage <quentin@armitage.org.uk>
+
+commit 3777ed688fba82d0bd43f9fc1ebbc6abe788576d upstream.
+
+When using HEAD from
+https://git.kernel.org/cgit/utils/kernel/ipvsadm/ipvsadm.git/,
+the command:
+ipvsadm --start-daemon backup --mcast-interface eth0.60 \
+    --mcast-group ff02::1:81
+fails with the error message:
+Argument list too long
+
+whereas both:
+ipvsadm --start-daemon master --mcast-interface eth0.60 \
+    --mcast-group ff02::1:81
+and:
+ipvsadm --start-daemon backup --mcast-interface eth0.60 \
+    --mcast-group 224.0.0.81
+are successful.
+
+The error message "Argument list too long" isn't helpful. The error occurs
+because an IPv6 address is given in backup mode.
+
+The error is in make_receive_sock() in net/netfilter/ipvs/ip_vs_sync.c,
+since it fails to set the interface on the address or the socket before
+calling inet6_bind() (via sock->ops->bind), where the test
+'if (!sk->sk_bound_dev_if)' failed.
+
+Setting sock->sk->sk_bound_dev_if on the socket before calling
+inet6_bind() resolves the issue.
+
+Fixes: d33288172e72 ("ipvs: add more mcast parameters for the sync daemon")
+Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
+Acked-by: Julian Anastasov <ja@ssi.bg>
+Signed-off-by: Simon Horman <horms@verge.net.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/netfilter/ipvs/ip_vs_sync.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/net/netfilter/ipvs/ip_vs_sync.c
++++ b/net/netfilter/ipvs/ip_vs_sync.c
+@@ -1545,7 +1545,8 @@ error:
+ /*
+  *      Set up receiving multicast socket over UDP
+  */
+-static struct socket *make_receive_sock(struct netns_ipvs *ipvs, int id)
++static struct socket *make_receive_sock(struct netns_ipvs *ipvs, int id,
++                                      int ifindex)
+ {
+       /* multicast addr */
+       union ipvs_sockaddr mcast_addr;
+@@ -1566,6 +1567,7 @@ static struct socket *make_receive_sock(
+               set_sock_size(sock->sk, 0, result);
+       get_mcast_sockaddr(&mcast_addr, &salen, &ipvs->bcfg, id);
++      sock->sk->sk_bound_dev_if = ifindex;
+       result = sock->ops->bind(sock, (struct sockaddr *)&mcast_addr, salen);
+       if (result < 0) {
+               pr_err("Error binding to the multicast addr\n");
+@@ -1868,7 +1870,7 @@ int start_sync_thread(struct netns_ipvs
+               if (state == IP_VS_STATE_MASTER)
+                       sock = make_send_sock(ipvs, id);
+               else
+-                      sock = make_receive_sock(ipvs, id);
++                      sock = make_receive_sock(ipvs, id, dev->ifindex);
+               if (IS_ERR(sock)) {
+                       result = PTR_ERR(sock);
+                       goto outtinfo;
diff --git a/queue-4.4/mmc-pxamci-fix-potential-oops.patch b/queue-4.4/mmc-pxamci-fix-potential-oops.patch
new file mode 100644 (file)
index 0000000..4141533
--- /dev/null
@@ -0,0 +1,62 @@
+From b3802db5eb72d2a96f4aa4ff0abb937033df2acf Mon Sep 17 00:00:00 2001
+From: Robert Jarzmik <robert.jarzmik@free.fr>
+Date: Thu, 14 Jul 2016 17:05:50 +0200
+Subject: mmc: pxamci: fix potential oops
+
+From: Robert Jarzmik <robert.jarzmik@free.fr>
+
+commit b3802db5eb72d2a96f4aa4ff0abb937033df2acf upstream.
+
+As reported by Dan in his report in [1], there is a potential NULL
+pointer derefence if these conditions are met :
+ - there is no platform_data provided, ie. host->pdata = NULL
+
+Fix this by only using the platform data ro_invert when a gpio for
+read-only is provided by the platform data.
+
+This doesn't appear yet as every pxa board provides a platform_data, and
+calls pxa_set_mci_info() with a non NULL pointer.
+
+[1] [bug report] mmc: pxamci: fix card detect with slot-gpio API.
+The commit fd546ee6a7dc ("mmc: pxamci: fix card detect with slot-gpio
+API") from Sep 26, 2015, leads to the following static checker warning:
+
+       drivers/mmc/host/pxamci.c:809 pxamci_probe()
+       warn: variable dereferenced before check 'host->pdata' (see line 798)
+
+Fixes: fd546ee6a7dc ("mmc: pxamci: fix card detect with slot-gpio API")
+Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/host/pxamci.c |   16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+--- a/drivers/mmc/host/pxamci.c
++++ b/drivers/mmc/host/pxamci.c
+@@ -798,14 +798,16 @@ static int pxamci_probe(struct platform_
+               gpio_direction_output(gpio_power,
+                                     host->pdata->gpio_power_invert);
+       }
+-      if (gpio_is_valid(gpio_ro))
++      if (gpio_is_valid(gpio_ro)) {
+               ret = mmc_gpio_request_ro(mmc, gpio_ro);
+-      if (ret) {
+-              dev_err(&pdev->dev, "Failed requesting gpio_ro %d\n", gpio_ro);
+-              goto out;
+-      } else {
+-              mmc->caps2 |= host->pdata->gpio_card_ro_invert ?
+-                      0 : MMC_CAP2_RO_ACTIVE_HIGH;
++              if (ret) {
++                      dev_err(&pdev->dev, "Failed requesting gpio_ro %d\n",
++                              gpio_ro);
++                      goto out;
++              } else {
++                      mmc->caps2 |= host->pdata->gpio_card_ro_invert ?
++                              0 : MMC_CAP2_RO_ACTIVE_HIGH;
++              }
+       }
+       if (gpio_is_valid(gpio_cd))
diff --git a/queue-4.4/nvmem-declare-nvmem_cell_read-consistently.patch b/queue-4.4/nvmem-declare-nvmem_cell_read-consistently.patch
new file mode 100644 (file)
index 0000000..72b9be3
--- /dev/null
@@ -0,0 +1,36 @@
+From a6c50912508d80164a5e607993b617be85a46d73 Mon Sep 17 00:00:00 2001
+From: Guenter Roeck <linux@roeck-us.net>
+Date: Thu, 2 Jun 2016 12:05:12 +0100
+Subject: nvmem: Declare nvmem_cell_read() consistently
+
+From: Guenter Roeck <linux@roeck-us.net>
+
+commit a6c50912508d80164a5e607993b617be85a46d73 upstream.
+
+nvmem_cell_read() is declared as void * if CONFIG_NVMEM is enabled, and
+as char * otherwise. This can result in a build warning if CONFIG_NVMEM
+is not enabled and a caller asigns the result to a type other than char *
+without using a typecast. Use a consistent declaration to avoid the
+problem.
+
+Fixes: e2a5402ec7c6 ("nvmem: Add nvmem_device based consumer apis.")
+Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/nvmem-consumer.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/include/linux/nvmem-consumer.h
++++ b/include/linux/nvmem-consumer.h
+@@ -74,7 +74,7 @@ static inline void nvmem_cell_put(struct
+ {
+ }
+-static inline char *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)
++static inline void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)
+ {
+       return ERR_PTR(-ENOSYS);
+ }
index d8fec2fbcabdad6be04134ebc34ab3a81e1c5b49..e066c91b41445a147123974058587c9bfa8d2aac 100644 (file)
@@ -16,3 +16,9 @@ i40e-avoid-null-pointer-dereference.patch
 pinctrl-uniphier-fix-.pin_dbg_show-callback.patch
 pinctrl-flag-strict-is-a-field-in-struct-pinmux_ops.patch
 drivers-perf-arm_pmu-fix-leak-in-error-path.patch
+mmc-pxamci-fix-potential-oops.patch
+tools-vm-slabinfo-fix-an-unintentional-printf.patch
+ipvs-fix-bind-to-link-local-mcast-ipv6-address-in-backup.patch
+nvmem-declare-nvmem_cell_read-consistently.patch
+hwmon-adt7411-set-bit-3-in-cfg1-register.patch
+spi-sh-msiof-avoid-invalid-clock-generator-parameters.patch
diff --git a/queue-4.4/spi-sh-msiof-avoid-invalid-clock-generator-parameters.patch b/queue-4.4/spi-sh-msiof-avoid-invalid-clock-generator-parameters.patch
new file mode 100644 (file)
index 0000000..9d73b5d
--- /dev/null
@@ -0,0 +1,40 @@
+From c3ccf357c3d75bd2924e049b6a991f7c0c111068 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Fri, 5 Aug 2016 10:17:52 +0200
+Subject: spi: sh-msiof: Avoid invalid clock generator parameters
+
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+
+commit c3ccf357c3d75bd2924e049b6a991f7c0c111068 upstream.
+
+The conversion from a look-up table to a calculation for clock generator
+parameters forgot to take into account that BRDV x 1/1 is valid only if
+BRPS is x 1/1 or x 1/2, leading to undefined behavior (e.g. arbitrary
+clock rates).
+
+This limitation is documented for the MSIOF module in all supported
+SH/R-Mobile and R-Car Gen2/Gen3 ARM SoCs.
+
+Tested on r8a7791/koelsch and r8a7795/salvator-x.
+
+Fixes: 65d5665bb260b034 ("spi: sh-msiof: Update calculation of frequency dividing")
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/spi/spi-sh-msiof.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/spi/spi-sh-msiof.c
++++ b/drivers/spi/spi-sh-msiof.c
+@@ -263,6 +263,9 @@ static void sh_msiof_spi_set_clk_regs(st
+       for (k = 0; k < ARRAY_SIZE(sh_msiof_spi_div_table); k++) {
+               brps = DIV_ROUND_UP(div, sh_msiof_spi_div_table[k].div);
++              /* SCR_BRDV_DIV_1 is valid only if BRPS is x 1/1 or x 1/2 */
++              if (sh_msiof_spi_div_table[k].div == 1 && brps > 2)
++                      continue;
+               if (brps <= 32) /* max of brdv is 32 */
+                       break;
+       }
diff --git a/queue-4.4/tools-vm-slabinfo-fix-an-unintentional-printf.patch b/queue-4.4/tools-vm-slabinfo-fix-an-unintentional-printf.patch
new file mode 100644 (file)
index 0000000..60c084b
--- /dev/null
@@ -0,0 +1,41 @@
+From 2d6a4d64812bb12dda53704943b61a7496d02098 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Wed, 20 Jul 2016 15:45:05 -0700
+Subject: tools/vm/slabinfo: fix an unintentional printf
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+commit 2d6a4d64812bb12dda53704943b61a7496d02098 upstream.
+
+The curly braces are missing here so we print stuff unintentionally.
+
+Fixes: 9da4714a2d44 ('slub: slabinfo update for cmpxchg handling')
+Link: http://lkml.kernel.org/r/20160715211243.GE19522@mwanda
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Acked-by: Christoph Lameter <cl@linux.com>
+Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
+Cc: Colin Ian King <colin.king@canonical.com>
+Cc: Laura Abbott <labbott@fedoraproject.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ tools/vm/slabinfo.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/tools/vm/slabinfo.c
++++ b/tools/vm/slabinfo.c
+@@ -510,10 +510,11 @@ static void slab_stats(struct slabinfo *
+                       s->alloc_node_mismatch, (s->alloc_node_mismatch * 100) / total);
+       }
+-      if (s->cmpxchg_double_fail || s->cmpxchg_double_cpu_fail)
++      if (s->cmpxchg_double_fail || s->cmpxchg_double_cpu_fail) {
+               printf("\nCmpxchg_double Looping\n------------------------\n");
+               printf("Locked Cmpxchg Double redos   %lu\nUnlocked Cmpxchg Double redos %lu\n",
+                       s->cmpxchg_double_fail, s->cmpxchg_double_cpu_fail);
++      }
+ }
+ static void report(struct slabinfo *s)