]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 May 2016 23:56:24 +0000 (16:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 May 2016 23:56:24 +0000 (16:56 -0700)
added patches:
megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch
sunrpc-cache-drop-reference-when-sunrpc_cache_pipe_upcall-detects-a-race.patch
thermal-rockchip-fix-a-impossible-condition-caused-by-the-warning.patch
unbreak-allmodconfig-kconfig_allconfig.patch

queue-4.4/megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch [new file with mode: 0644]
queue-4.4/series
queue-4.4/sunrpc-cache-drop-reference-when-sunrpc_cache_pipe_upcall-detects-a-race.patch [new file with mode: 0644]
queue-4.4/thermal-rockchip-fix-a-impossible-condition-caused-by-the-warning.patch [new file with mode: 0644]
queue-4.4/unbreak-allmodconfig-kconfig_allconfig.patch [new file with mode: 0644]

diff --git a/queue-4.4/megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch b/queue-4.4/megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch
new file mode 100644 (file)
index 0000000..0d6f80d
--- /dev/null
@@ -0,0 +1,54 @@
+From 3deb9438d34a09f6796639b652a01d110aca9f75 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Mon, 14 Mar 2016 15:29:45 +0100
+Subject: megaraid_sas: add missing curly braces in ioctl handler
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 3deb9438d34a09f6796639b652a01d110aca9f75 upstream.
+
+gcc-6 found a dubious indentation in the megasas_mgmt_fw_ioctl
+function:
+
+drivers/scsi/megaraid/megaraid_sas_base.c: In function 'megasas_mgmt_fw_ioctl':
+drivers/scsi/megaraid/megaraid_sas_base.c:6658:4: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
+    kbuff_arr[i] = NULL;
+    ^~~~~~~~~
+drivers/scsi/megaraid/megaraid_sas_base.c:6653:3: note: ...this 'if' clause, but it is not
+   if (kbuff_arr[i])
+   ^~
+
+The code is actually correct, as there is no downside in clearing a NULL
+pointer again.
+
+This clarifies the code and avoids the warning by adding extra curly
+braces.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Fixes: 90dc9d98f01b ("megaraid_sas : MFI MPT linked list corruption fix")
+Reviewed-by: Hannes Reinecke <hare@suse.com>
+Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/scsi/megaraid/megaraid_sas_base.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/scsi/megaraid/megaraid_sas_base.c
++++ b/drivers/scsi/megaraid/megaraid_sas_base.c
+@@ -6282,12 +6282,13 @@ out:
+       }
+       for (i = 0; i < ioc->sge_count; i++) {
+-              if (kbuff_arr[i])
++              if (kbuff_arr[i]) {
+                       dma_free_coherent(&instance->pdev->dev,
+                                         le32_to_cpu(kern_sge32[i].length),
+                                         kbuff_arr[i],
+                                         le32_to_cpu(kern_sge32[i].phys_addr));
+                       kbuff_arr[i] = NULL;
++              }
+       }
+       megasas_return_cmd(instance, cmd);
index f451388355a9899a0e5c121c426e123255244827..7fc08332da90d6d799e23694e7a335f580185666 100644 (file)
@@ -155,3 +155,7 @@ arm-dts-pxa-fix-dma-engine-node-to-pxa3xx-nand.patch
 bus-imx-weim-take-the-status-property-value-into-account.patch
 jme-do-not-enable-nic-wol-functions-on-s0.patch
 jme-fix-device-pm-wakeup-api-usage.patch
+unbreak-allmodconfig-kconfig_allconfig.patch
+thermal-rockchip-fix-a-impossible-condition-caused-by-the-warning.patch
+sunrpc-cache-drop-reference-when-sunrpc_cache_pipe_upcall-detects-a-race.patch
+megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch
diff --git a/queue-4.4/sunrpc-cache-drop-reference-when-sunrpc_cache_pipe_upcall-detects-a-race.patch b/queue-4.4/sunrpc-cache-drop-reference-when-sunrpc_cache_pipe_upcall-detects-a-race.patch
new file mode 100644 (file)
index 0000000..6ad75e2
--- /dev/null
@@ -0,0 +1,45 @@
+From a6ab1e8126d205238defbb55d23661a3a5c6a0d8 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.com>
+Date: Fri, 4 Mar 2016 17:20:13 +1100
+Subject: sunrpc/cache: drop reference when sunrpc_cache_pipe_upcall() detects a race
+
+From: NeilBrown <neilb@suse.com>
+
+commit a6ab1e8126d205238defbb55d23661a3a5c6a0d8 upstream.
+
+sunrpc_cache_pipe_upcall() can detect a race if CACHE_PENDING is no longer
+set.  In this case it aborts the queuing of the upcall.
+However it has already taken a new counted reference on "h" and
+doesn't "put" it, even though it frees the data structure holding the reference.
+
+So let's delay the "cache_get" until we know we need it.
+
+Fixes: f9e1aedc6c79 ("sunrpc/cache: remove races with queuing an upcall.")
+Signed-off-by: NeilBrown <neilb@suse.com>
+Signed-off-by: J. Bruce Fields <bfields@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/sunrpc/cache.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/net/sunrpc/cache.c
++++ b/net/sunrpc/cache.c
+@@ -1182,14 +1182,14 @@ int sunrpc_cache_pipe_upcall(struct cach
+       }
+       crq->q.reader = 0;
+-      crq->item = cache_get(h);
+       crq->buf = buf;
+       crq->len = 0;
+       crq->readers = 0;
+       spin_lock(&queue_lock);
+-      if (test_bit(CACHE_PENDING, &h->flags))
++      if (test_bit(CACHE_PENDING, &h->flags)) {
++              crq->item = cache_get(h);
+               list_add_tail(&crq->q.list, &detail->queue);
+-      else
++      } else
+               /* Lost a race, no longer PENDING, so don't enqueue */
+               ret = -EAGAIN;
+       spin_unlock(&queue_lock);
diff --git a/queue-4.4/thermal-rockchip-fix-a-impossible-condition-caused-by-the-warning.patch b/queue-4.4/thermal-rockchip-fix-a-impossible-condition-caused-by-the-warning.patch
new file mode 100644 (file)
index 0000000..4b1813e
--- /dev/null
@@ -0,0 +1,54 @@
+From 43b4eb9fe719b107c8e5d49d1edbff0c135a42cb Mon Sep 17 00:00:00 2001
+From: Caesar Wang <wxt@rock-chips.com>
+Date: Mon, 15 Feb 2016 15:33:28 +0800
+Subject: thermal: rockchip: fix a impossible condition caused by the warning
+
+From: Caesar Wang <wxt@rock-chips.com>
+
+commit 43b4eb9fe719b107c8e5d49d1edbff0c135a42cb upstream.
+
+As the Dan report the smatch check the thermal driver warning:
+drivers/thermal/rockchip_thermal.c:551 rockchip_configure_from_dt()
+warn: impossible condition '(thermal->tshut_temp > ((~0 >> 1))) =>
+(s32min-s32max > s32max)'
+
+Although The shut_temp read from DT is u32,the temperature is currently
+represented as int not long in the thermal driver.
+Let's change to make shut_temp instead of the thermal->tshut_temp for
+the condition.
+
+Fixes: commit 437df2172e8d
+("thermal: rockchip: consistently use int for temperatures")
+
+Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Caesar Wang <wxt@rock-chips.com>
+Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/thermal/rockchip_thermal.c |   11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+--- a/drivers/thermal/rockchip_thermal.c
++++ b/drivers/thermal/rockchip_thermal.c
+@@ -545,15 +545,14 @@ static int rockchip_configure_from_dt(st
+                        thermal->chip->tshut_temp);
+               thermal->tshut_temp = thermal->chip->tshut_temp;
+       } else {
++              if (shut_temp > INT_MAX) {
++                      dev_err(dev, "Invalid tshut temperature specified: %d\n",
++                              shut_temp);
++                      return -ERANGE;
++              }
+               thermal->tshut_temp = shut_temp;
+       }
+-      if (thermal->tshut_temp > INT_MAX) {
+-              dev_err(dev, "Invalid tshut temperature specified: %d\n",
+-                      thermal->tshut_temp);
+-              return -ERANGE;
+-      }
+-
+       if (of_property_read_u32(np, "rockchip,hw-tshut-mode", &tshut_mode)) {
+               dev_warn(dev,
+                        "Missing tshut mode property, using default (%s)\n",
diff --git a/queue-4.4/unbreak-allmodconfig-kconfig_allconfig.patch b/queue-4.4/unbreak-allmodconfig-kconfig_allconfig.patch
new file mode 100644 (file)
index 0000000..e303b61
--- /dev/null
@@ -0,0 +1,76 @@
+From 6b87b70c5339f30e3c5b32085e69625906513dc2 Mon Sep 17 00:00:00 2001
+From: Al Viro <viro@ZenIV.linux.org.uk>
+Date: Thu, 14 Jan 2016 18:13:49 +0000
+Subject: unbreak allmodconfig KCONFIG_ALLCONFIG=...
+
+From: Al Viro <viro@ZenIV.linux.org.uk>
+
+commit 6b87b70c5339f30e3c5b32085e69625906513dc2 upstream.
+
+       Prior to 3.13 make allmodconfig KCONFIG_ALLCONFIG=/dev/null used
+to be equivalent to make allmodconfig; these days it hardwires MODULES to n.
+In fact, any KCONFIG_ALLCONFIG that doesn't set MODULES explicitly is
+treated as if it set it to n.
+
+       Regression had been introduced by commit cfa98f ("kconfig: do not
+override symbols already set"); what happens is that conf_read_simple()
+does sym_calc_value(modules_sym) on exit, which leaves SYMBOL_VALID set and
+has conf_set_all_new_symbols() skip modules_sym.
+
+       It's pretty easy to fix - simply move that call of sym_calc_value()
+into the callers, except for the ones in KCONFIG_ALLCONFIG handling.
+Objections?
+
+Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+Fixes: cfa98f2e0ae9 ("kconfig: do not override symbols already set")
+Signed-off-by: Michal Marek <mmarek@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ scripts/kconfig/confdata.c |   12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+--- a/scripts/kconfig/confdata.c
++++ b/scripts/kconfig/confdata.c
+@@ -267,10 +267,8 @@ int conf_read_simple(const char *name, i
+               if (in)
+                       goto load;
+               sym_add_change_count(1);
+-              if (!sym_defconfig_list) {
+-                      sym_calc_value(modules_sym);
++              if (!sym_defconfig_list)
+                       return 1;
+-              }
+               for_all_defaults(sym_defconfig_list, prop) {
+                       if (expr_calc_value(prop->visible.expr) == no ||
+@@ -403,7 +401,6 @@ setsym:
+       }
+       free(line);
+       fclose(in);
+-      sym_calc_value(modules_sym);
+       return 0;
+ }
+@@ -414,8 +411,12 @@ int conf_read(const char *name)
+       sym_set_change_count(0);
+-      if (conf_read_simple(name, S_DEF_USER))
++      if (conf_read_simple(name, S_DEF_USER)) {
++              sym_calc_value(modules_sym);
+               return 1;
++      }
++
++      sym_calc_value(modules_sym);
+       for_all_symbols(i, sym) {
+               sym_calc_value(sym);
+@@ -846,6 +847,7 @@ static int conf_split_config(void)
+       name = conf_get_autoconfig_name();
+       conf_read_simple(name, S_DEF_AUTO);
++      sym_calc_value(modules_sym);
+       if (chdir("include/config"))
+               return 1;