]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Apr 2014 16:05:03 +0000 (09:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Apr 2014 16:05:03 +0000 (09:05 -0700)
added patches:
arc-change-.dts-to-use-generic-8250-uart.patch
arc-unbork-console.patch
cpufreq-fix-governor-start-stop-race-condition.patch
cpufreq-fix-timer-workqueue-corruption-due-to-double-queueing.patch
crypto-ghash-clmulni-intel-use-c-implementation-for-setkey.patch
futex-allow-architectures-to-skip-futex_atomic_cmpxchg_inatomic-test.patch
m68k-skip-futex_atomic_cmpxchg_inatomic-test.patch

queue-3.10/arc-change-.dts-to-use-generic-8250-uart.patch [new file with mode: 0644]
queue-3.10/arc-unbork-console.patch [new file with mode: 0644]
queue-3.10/cpufreq-fix-governor-start-stop-race-condition.patch [new file with mode: 0644]
queue-3.10/cpufreq-fix-timer-workqueue-corruption-due-to-double-queueing.patch [new file with mode: 0644]
queue-3.10/crypto-ghash-clmulni-intel-use-c-implementation-for-setkey.patch [new file with mode: 0644]
queue-3.10/futex-allow-architectures-to-skip-futex_atomic_cmpxchg_inatomic-test.patch [new file with mode: 0644]
queue-3.10/m68k-skip-futex_atomic_cmpxchg_inatomic-test.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/arc-change-.dts-to-use-generic-8250-uart.patch b/queue-3.10/arc-change-.dts-to-use-generic-8250-uart.patch
new file mode 100644 (file)
index 0000000..8206d91
--- /dev/null
@@ -0,0 +1,52 @@
+From 6eda477b3c54b8236868c8784e5e042ff14244f0 Mon Sep 17 00:00:00 2001
+From: Mischa Jonker <mjonker@synopsys.com>
+Date: Thu, 16 May 2013 19:36:08 +0200
+Subject: ARC: [nsimosci] Change .dts to use generic 8250 UART
+
+From: Mischa Jonker <mjonker@synopsys.com>
+
+commit 6eda477b3c54b8236868c8784e5e042ff14244f0 upstream.
+
+The Synopsys APB DW UART has a couple of special features that are not
+in the System C model. In 3.8, the 8250_dw driver didn't really use these
+features, but from 3.9 onwards, the 8250_dw driver has become incompatible
+with our model.
+
+Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+Cc: Francois Bedard <Francois.Bedard@synopsys.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arc/boot/dts/nsimosci.dts |    7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+--- a/arch/arc/boot/dts/nsimosci.dts
++++ b/arch/arc/boot/dts/nsimosci.dts
+@@ -11,7 +11,7 @@
+ / {
+       compatible = "snps,nsimosci";
+-      clock-frequency = <80000000>;   /* 80 MHZ */
++      clock-frequency = <20000000>;   /* 20 MHZ */
+       #address-cells = <1>;
+       #size-cells = <1>;
+       interrupt-parent = <&intc>;
+@@ -44,15 +44,14 @@
+               };
+               uart0: serial@c0000000 {
+-                      compatible = "snps,dw-apb-uart";
++                      compatible = "ns8250";
+                       reg = <0xc0000000 0x2000>;
+                       interrupts = <11>;
+-                      #clock-frequency = <80000000>;
+                       clock-frequency = <3686400>;
+                       baud = <115200>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+-                      status = "okay";
++                      no-loopback-test = <1>;
+               };
+               pgu0: pgu@c9000000 {
diff --git a/queue-3.10/arc-unbork-console.patch b/queue-3.10/arc-unbork-console.patch
new file mode 100644 (file)
index 0000000..7e8dbfd
--- /dev/null
@@ -0,0 +1,48 @@
+From 61fb4bfc010b0d2940f7fd87acbce6a0f03217cb Mon Sep 17 00:00:00 2001
+From: Vineet Gupta <vgupta@synopsys.com>
+Date: Sat, 5 Apr 2014 15:30:22 +0530
+Subject: ARC: [nsimosci] Unbork console
+
+From: Vineet Gupta <vgupta@synopsys.com>
+
+commit 61fb4bfc010b0d2940f7fd87acbce6a0f03217cb upstream.
+
+Despite the switch to right UART driver (prev patch), serial console
+still doesn't work due to missing CONFIG_SERIAL_OF_PLATFORM
+
+Also fix the default cmdline in DT to not refer to out-of-tree
+ARC framebuffer driver for console.
+
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+Cc: Francois Bedard <Francois.Bedard@synopsys.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arc/boot/dts/nsimosci.dts      |    5 ++++-
+ arch/arc/configs/nsimosci_defconfig |    1 +
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+--- a/arch/arc/boot/dts/nsimosci.dts
++++ b/arch/arc/boot/dts/nsimosci.dts
+@@ -17,7 +17,10 @@
+       interrupt-parent = <&intc>;
+       chosen {
+-              bootargs = "console=tty0 consoleblank=0";
++              /* this is for console on PGU */
++              /* bootargs = "console=tty0 consoleblank=0"; */
++              /* this is for console on serial */
++              bootargs = "earlycon=uart8250,mmio32,0xc0000000,115200n8 console=ttyS0,115200n8 consoleblank=0 debug";
+       };
+       aliases {
+--- a/arch/arc/configs/nsimosci_defconfig
++++ b/arch/arc/configs/nsimosci_defconfig
+@@ -54,6 +54,7 @@ CONFIG_SERIO_ARC_PS2=y
+ CONFIG_SERIAL_8250=y
+ CONFIG_SERIAL_8250_CONSOLE=y
+ CONFIG_SERIAL_8250_DW=y
++CONFIG_SERIAL_OF_PLATFORM=y
+ CONFIG_SERIAL_ARC=y
+ CONFIG_SERIAL_ARC_CONSOLE=y
+ # CONFIG_HW_RANDOM is not set
diff --git a/queue-3.10/cpufreq-fix-governor-start-stop-race-condition.patch b/queue-3.10/cpufreq-fix-governor-start-stop-race-condition.patch
new file mode 100644 (file)
index 0000000..590e950
--- /dev/null
@@ -0,0 +1,116 @@
+From 95731ebb114c5f0c028459388560fc2a72fe5049 Mon Sep 17 00:00:00 2001
+From: Xiaoguang Chen <chenxg@marvell.com>
+Date: Wed, 19 Jun 2013 15:00:07 +0800
+Subject: cpufreq: Fix governor start/stop race condition
+
+From: Xiaoguang Chen <chenxg@marvell.com>
+
+commit 95731ebb114c5f0c028459388560fc2a72fe5049 upstream.
+
+Cpufreq governors' stop and start operations should be carried out
+in sequence.  Otherwise, there will be unexpected behavior, like in
+the example below.
+
+Suppose there are 4 CPUs and policy->cpu=CPU0, CPU1/2/3 are linked
+to CPU0.  The normal sequence is:
+
+ 1) Current governor is userspace.  An application tries to set the
+    governor to ondemand.  It will call __cpufreq_set_policy() in
+    which it will stop the userspace governor and then start the
+    ondemand governor.
+
+ 2) Current governor is userspace.  The online of CPU3 runs on CPU0.
+    It will call cpufreq_add_policy_cpu() in which it will first
+    stop the userspace governor, and then start it again.
+
+If the sequence of the above two cases interleaves, it becomes:
+
+ 1) Application stops userspace governor
+ 2)                                  Hotplug stops userspace governor
+
+which is a problem, because the governor shouldn't be stopped twice
+in a row.  What happens next is:
+
+ 3) Application starts ondemand governor
+ 4)                                  Hotplug starts a governor
+
+In step 4, the hotplug is supposed to start the userspace governor,
+but now the governor has been changed by the application to ondemand,
+so the ondemand governor is started once again, which is incorrect.
+
+The solution is to prevent policy governors from being stopped
+multiple times in a row.  A governor should only be stopped once for
+one policy.  After it has been stopped, no more governor stop
+operations should be executed.
+
+Also add a mutex to serialize governor operations.
+
+[rjw: Changelog.  And you owe me a beverage of my choice.]
+Signed-off-by: Xiaoguang Chen <chenxg@marvell.com>
+Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpufreq/cpufreq.c |   24 ++++++++++++++++++++++++
+ include/linux/cpufreq.h   |    1 +
+ 2 files changed, 25 insertions(+)
+
+--- a/drivers/cpufreq/cpufreq.c
++++ b/drivers/cpufreq/cpufreq.c
+@@ -46,6 +46,7 @@ static DEFINE_PER_CPU(struct cpufreq_pol
+ static DEFINE_PER_CPU(char[CPUFREQ_NAME_LEN], cpufreq_cpu_governor);
+ #endif
+ static DEFINE_RWLOCK(cpufreq_driver_lock);
++static DEFINE_MUTEX(cpufreq_governor_lock);
+ /*
+  * cpu_policy_rwsem is a per CPU reader-writer semaphore designed to cure
+@@ -1563,6 +1564,21 @@ static int __cpufreq_governor(struct cpu
+       pr_debug("__cpufreq_governor for CPU %u, event %u\n",
+                                               policy->cpu, event);
++
++      mutex_lock(&cpufreq_governor_lock);
++      if ((!policy->governor_enabled && (event == CPUFREQ_GOV_STOP)) ||
++          (policy->governor_enabled && (event == CPUFREQ_GOV_START))) {
++              mutex_unlock(&cpufreq_governor_lock);
++              return -EBUSY;
++      }
++
++      if (event == CPUFREQ_GOV_STOP)
++              policy->governor_enabled = false;
++      else if (event == CPUFREQ_GOV_START)
++              policy->governor_enabled = true;
++
++      mutex_unlock(&cpufreq_governor_lock);
++
+       ret = policy->governor->governor(policy, event);
+       if (!ret) {
+@@ -1570,6 +1586,14 @@ static int __cpufreq_governor(struct cpu
+                       policy->governor->initialized++;
+               else if (event == CPUFREQ_GOV_POLICY_EXIT)
+                       policy->governor->initialized--;
++      } else {
++              /* Restore original values */
++              mutex_lock(&cpufreq_governor_lock);
++              if (event == CPUFREQ_GOV_STOP)
++                      policy->governor_enabled = true;
++              else if (event == CPUFREQ_GOV_START)
++                      policy->governor_enabled = false;
++              mutex_unlock(&cpufreq_governor_lock);
+       }
+       /* we keep one module reference alive for
+--- a/include/linux/cpufreq.h
++++ b/include/linux/cpufreq.h
+@@ -107,6 +107,7 @@ struct cpufreq_policy {
+       unsigned int            policy; /* see above */
+       struct cpufreq_governor *governor; /* see below */
+       void                    *governor_data;
++      bool                    governor_enabled; /* governor start/stop flag */
+       struct work_struct      update; /* if update_policy() needs to be
+                                        * called, but you're in IRQ context */
diff --git a/queue-3.10/cpufreq-fix-timer-workqueue-corruption-due-to-double-queueing.patch b/queue-3.10/cpufreq-fix-timer-workqueue-corruption-due-to-double-queueing.patch
new file mode 100644 (file)
index 0000000..be07325
--- /dev/null
@@ -0,0 +1,97 @@
+From 3617f2ca6d0eba48114308532945a7f1577816a4 Mon Sep 17 00:00:00 2001
+From: Stephen Boyd <sboyd@codeaurora.org>
+Date: Tue, 27 Aug 2013 11:47:29 -0700
+Subject: cpufreq: Fix timer/workqueue corruption due to double queueing
+
+From: Stephen Boyd <sboyd@codeaurora.org>
+
+commit 3617f2ca6d0eba48114308532945a7f1577816a4 upstream.
+
+When a CPU is hot removed we'll cancel all the delayed work items
+via gov_cancel_work(). Normally this will just cancels a delayed
+timer on each CPU that the policy is managing and the work won't
+run, but if the work is already running the workqueue code will
+wait for the work to finish before continuing to prevent the
+work items from re-queuing themselves like they normally do. This
+scheme will work most of the time, except for the case where the
+work function determines that it should adjust the delay for all
+other CPUs that the policy is managing. If this scenario occurs,
+the canceling CPU will cancel its own work but queue up the other
+CPUs works to run. For example:
+
+ CPU0                                        CPU1
+ ----                                        ----
+ cpu_down()
+  ...
+  __cpufreq_remove_dev()
+   cpufreq_governor_dbs()
+    case CPUFREQ_GOV_STOP:
+     gov_cancel_work(dbs_data, policy);
+      cpu0 work is canceled
+       timer is canceled
+       cpu1 work is canceled                    <work runs>
+       <waits for cpu1>                         od_dbs_timer()
+                                                 gov_queue_work(*, *, true);
+                                                 cpu0 work queued
+                                                 cpu1 work queued
+                                                 cpu2 work queued
+                                                 ...
+       cpu1 work is canceled
+       cpu2 work is canceled
+       ...
+
+At the end of the GOV_STOP case cpu0 still has a work queued to
+run although the code is expecting all of the works to be
+canceled. __cpufreq_remove_dev() will then proceed to
+re-initialize all the other CPUs works except for the CPU that is
+going down. The CPUFREQ_GOV_START case in cpufreq_governor_dbs()
+will trample over the queued work and debugobjects will spit out
+a warning:
+
+WARNING: at lib/debugobjects.c:260 debug_print_object+0x94/0xbc()
+ODEBUG: init active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x10
+Modules linked in:
+CPU: 0 PID: 1491 Comm: sh Tainted: G        W    3.10.0 #19
+[<c010c178>] (unwind_backtrace+0x0/0x11c) from [<c0109dec>] (show_stack+0x10/0x14)
+[<c0109dec>] (show_stack+0x10/0x14) from [<c01904cc>] (warn_slowpath_common+0x4c/0x6c)
+[<c01904cc>] (warn_slowpath_common+0x4c/0x6c) from [<c019056c>] (warn_slowpath_fmt+0x2c/0x3c)
+[<c019056c>] (warn_slowpath_fmt+0x2c/0x3c) from [<c0388a7c>] (debug_print_object+0x94/0xbc)
+[<c0388a7c>] (debug_print_object+0x94/0xbc) from [<c0388e34>] (__debug_object_init+0x2d0/0x340)
+[<c0388e34>] (__debug_object_init+0x2d0/0x340) from [<c019e3b0>] (init_timer_key+0x14/0xb0)
+[<c019e3b0>] (init_timer_key+0x14/0xb0) from [<c0635f78>] (cpufreq_governor_dbs+0x3e8/0x5f8)
+[<c0635f78>] (cpufreq_governor_dbs+0x3e8/0x5f8) from [<c06325a0>] (__cpufreq_governor+0xdc/0x1a4)
+[<c06325a0>] (__cpufreq_governor+0xdc/0x1a4) from [<c0633704>] (__cpufreq_remove_dev.isra.10+0x3b4/0x434)
+[<c0633704>] (__cpufreq_remove_dev.isra.10+0x3b4/0x434) from [<c08989f4>] (cpufreq_cpu_callback+0x60/0x80)
+[<c08989f4>] (cpufreq_cpu_callback+0x60/0x80) from [<c08a43c0>] (notifier_call_chain+0x38/0x68)
+[<c08a43c0>] (notifier_call_chain+0x38/0x68) from [<c01938e0>] (__cpu_notify+0x28/0x40)
+[<c01938e0>] (__cpu_notify+0x28/0x40) from [<c0892ad4>] (_cpu_down+0x7c/0x2c0)
+[<c0892ad4>] (_cpu_down+0x7c/0x2c0) from [<c0892d3c>] (cpu_down+0x24/0x40)
+[<c0892d3c>] (cpu_down+0x24/0x40) from [<c0893ea8>] (store_online+0x2c/0x74)
+[<c0893ea8>] (store_online+0x2c/0x74) from [<c04519d8>] (dev_attr_store+0x18/0x24)
+[<c04519d8>] (dev_attr_store+0x18/0x24) from [<c02a69d4>] (sysfs_write_file+0x100/0x148)
+[<c02a69d4>] (sysfs_write_file+0x100/0x148) from [<c0255c18>] (vfs_write+0xcc/0x174)
+[<c0255c18>] (vfs_write+0xcc/0x174) from [<c0255f70>] (SyS_write+0x38/0x64)
+[<c0255f70>] (SyS_write+0x38/0x64) from [<c0106120>] (ret_fast_syscall+0x0/0x30)
+
+Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
+Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpufreq/cpufreq_governor.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/cpufreq/cpufreq_governor.c
++++ b/drivers/cpufreq/cpufreq_governor.c
+@@ -177,6 +177,9 @@ void gov_queue_work(struct dbs_data *dbs
+ {
+       int i;
++      if (!policy->governor_enabled)
++              return;
++
+       if (!all_cpus) {
+               __gov_queue_work(smp_processor_id(), dbs_data, delay);
+       } else {
diff --git a/queue-3.10/crypto-ghash-clmulni-intel-use-c-implementation-for-setkey.patch b/queue-3.10/crypto-ghash-clmulni-intel-use-c-implementation-for-setkey.patch
new file mode 100644 (file)
index 0000000..ce4f8cd
--- /dev/null
@@ -0,0 +1,106 @@
+From 8ceee72808d1ae3fb191284afc2257a2be964725 Mon Sep 17 00:00:00 2001
+From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Date: Thu, 27 Mar 2014 18:14:40 +0100
+Subject: crypto: ghash-clmulni-intel - use C implementation for setkey()
+
+From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+
+commit 8ceee72808d1ae3fb191284afc2257a2be964725 upstream.
+
+The GHASH setkey() function uses SSE registers but fails to call
+kernel_fpu_begin()/kernel_fpu_end(). Instead of adding these calls, and
+then having to deal with the restriction that they cannot be called from
+interrupt context, move the setkey() implementation to the C domain.
+
+Note that setkey() does not use any particular SSE features and is not
+expected to become a performance bottleneck.
+
+Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Acked-by: H. Peter Anvin <hpa@linux.intel.com>
+Fixes: 0e1227d356e9b (crypto: ghash - Add PCLMULQDQ accelerated implementation)
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/crypto/ghash-clmulni-intel_asm.S  |   29 -----------------------------
+ arch/x86/crypto/ghash-clmulni-intel_glue.c |   14 +++++++++++---
+ 2 files changed, 11 insertions(+), 32 deletions(-)
+
+--- a/arch/x86/crypto/ghash-clmulni-intel_asm.S
++++ b/arch/x86/crypto/ghash-clmulni-intel_asm.S
+@@ -24,10 +24,6 @@
+ .align 16
+ .Lbswap_mask:
+       .octa 0x000102030405060708090a0b0c0d0e0f
+-.Lpoly:
+-      .octa 0xc2000000000000000000000000000001
+-.Ltwo_one:
+-      .octa 0x00000001000000000000000000000001
+ #define DATA  %xmm0
+ #define SHASH %xmm1
+@@ -134,28 +130,3 @@ ENTRY(clmul_ghash_update)
+ .Lupdate_just_ret:
+       ret
+ ENDPROC(clmul_ghash_update)
+-
+-/*
+- * void clmul_ghash_setkey(be128 *shash, const u8 *key);
+- *
+- * Calculate hash_key << 1 mod poly
+- */
+-ENTRY(clmul_ghash_setkey)
+-      movaps .Lbswap_mask, BSWAP
+-      movups (%rsi), %xmm0
+-      PSHUFB_XMM BSWAP %xmm0
+-      movaps %xmm0, %xmm1
+-      psllq $1, %xmm0
+-      psrlq $63, %xmm1
+-      movaps %xmm1, %xmm2
+-      pslldq $8, %xmm1
+-      psrldq $8, %xmm2
+-      por %xmm1, %xmm0
+-      # reduction
+-      pshufd $0b00100100, %xmm2, %xmm1
+-      pcmpeqd .Ltwo_one, %xmm1
+-      pand .Lpoly, %xmm1
+-      pxor %xmm1, %xmm0
+-      movups %xmm0, (%rdi)
+-      ret
+-ENDPROC(clmul_ghash_setkey)
+--- a/arch/x86/crypto/ghash-clmulni-intel_glue.c
++++ b/arch/x86/crypto/ghash-clmulni-intel_glue.c
+@@ -30,8 +30,6 @@ void clmul_ghash_mul(char *dst, const be
+ void clmul_ghash_update(char *dst, const char *src, unsigned int srclen,
+                       const be128 *shash);
+-void clmul_ghash_setkey(be128 *shash, const u8 *key);
+-
+ struct ghash_async_ctx {
+       struct cryptd_ahash *cryptd_tfm;
+ };
+@@ -58,13 +56,23 @@ static int ghash_setkey(struct crypto_sh
+                       const u8 *key, unsigned int keylen)
+ {
+       struct ghash_ctx *ctx = crypto_shash_ctx(tfm);
++      be128 *x = (be128 *)key;
++      u64 a, b;
+       if (keylen != GHASH_BLOCK_SIZE) {
+               crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
+               return -EINVAL;
+       }
+-      clmul_ghash_setkey(&ctx->shash, key);
++      /* perform multiplication by 'x' in GF(2^128) */
++      a = be64_to_cpu(x->a);
++      b = be64_to_cpu(x->b);
++
++      ctx->shash.a = (__be64)((b << 1) | (a >> 63));
++      ctx->shash.b = (__be64)((a << 1) | (b >> 63));
++
++      if (a >> 63)
++              ctx->shash.b ^= cpu_to_be64(0xc2);
+       return 0;
+ }
diff --git a/queue-3.10/futex-allow-architectures-to-skip-futex_atomic_cmpxchg_inatomic-test.patch b/queue-3.10/futex-allow-architectures-to-skip-futex_atomic_cmpxchg_inatomic-test.patch
new file mode 100644 (file)
index 0000000..76798b6
--- /dev/null
@@ -0,0 +1,110 @@
+From 03b8c7b623c80af264c4c8d6111e5c6289933666 Mon Sep 17 00:00:00 2001
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+Date: Sun, 2 Mar 2014 13:09:47 +0100
+Subject: futex: Allow architectures to skip futex_atomic_cmpxchg_inatomic() test
+
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+
+commit 03b8c7b623c80af264c4c8d6111e5c6289933666 upstream.
+
+If an architecture has futex_atomic_cmpxchg_inatomic() implemented and there
+is no runtime check necessary, allow to skip the test within futex_init().
+
+This allows to get rid of some code which would always give the same result,
+and also allows the compiler to optimize a couple of if statements away.
+
+Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
+Cc: Finn Thain <fthain@telegraphics.com.au>
+Cc: Geert Uytterhoeven <geert@linux-m68k.org>
+Link: http://lkml.kernel.org/r/20140302120947.GA3641@osiris
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+[geert: Backported to v3.10..v3.13]
+Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/s390/Kconfig     |    1 +
+ include/linux/futex.h |    4 ++++
+ init/Kconfig          |    7 +++++++
+ kernel/futex.c        |   14 ++++++++++++--
+ 4 files changed, 24 insertions(+), 2 deletions(-)
+
+--- a/arch/s390/Kconfig
++++ b/arch/s390/Kconfig
+@@ -116,6 +116,7 @@ config S390
+       select HAVE_FUNCTION_GRAPH_TRACER
+       select HAVE_FUNCTION_TRACER
+       select HAVE_FUNCTION_TRACE_MCOUNT_TEST
++      select HAVE_FUTEX_CMPXCHG if FUTEX
+       select HAVE_KERNEL_BZIP2
+       select HAVE_KERNEL_GZIP
+       select HAVE_KERNEL_LZMA
+--- a/include/linux/futex.h
++++ b/include/linux/futex.h
+@@ -55,7 +55,11 @@ union futex_key {
+ #ifdef CONFIG_FUTEX
+ extern void exit_robust_list(struct task_struct *curr);
+ extern void exit_pi_state_list(struct task_struct *curr);
++#ifdef CONFIG_HAVE_FUTEX_CMPXCHG
++#define futex_cmpxchg_enabled 1
++#else
+ extern int futex_cmpxchg_enabled;
++#endif
+ #else
+ static inline void exit_robust_list(struct task_struct *curr)
+ {
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -1365,6 +1365,13 @@ config FUTEX
+         support for "fast userspace mutexes".  The resulting kernel may not
+         run glibc-based applications correctly.
++config HAVE_FUTEX_CMPXCHG
++      bool
++      help
++        Architectures should select this if futex_atomic_cmpxchg_inatomic()
++        is implemented and always working. This removes a couple of runtime
++        checks.
++
+ config EPOLL
+       bool "Enable eventpoll support" if EXPERT
+       default y
+--- a/kernel/futex.c
++++ b/kernel/futex.c
+@@ -67,7 +67,9 @@
+ #include "rtmutex_common.h"
++#ifndef CONFIG_HAVE_FUTEX_CMPXCHG
+ int __read_mostly futex_cmpxchg_enabled;
++#endif
+ #define FUTEX_HASHBITS (CONFIG_BASE_SMALL ? 4 : 8)
+@@ -2729,10 +2731,10 @@ SYSCALL_DEFINE6(futex, u32 __user *, uad
+       return do_futex(uaddr, op, val, tp, uaddr2, val2, val3);
+ }
+-static int __init futex_init(void)
++static void __init futex_detect_cmpxchg(void)
+ {
++#ifndef CONFIG_HAVE_FUTEX_CMPXCHG
+       u32 curval;
+-      int i;
+       /*
+        * This will fail and we want it. Some arch implementations do
+@@ -2746,6 +2748,14 @@ static int __init futex_init(void)
+        */
+       if (cmpxchg_futex_value_locked(&curval, NULL, 0, 0) == -EFAULT)
+               futex_cmpxchg_enabled = 1;
++#endif
++}
++
++static int __init futex_init(void)
++{
++      int i;
++
++      futex_detect_cmpxchg();
+       for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
+               plist_head_init(&futex_queues[i].chain);
diff --git a/queue-3.10/m68k-skip-futex_atomic_cmpxchg_inatomic-test.patch b/queue-3.10/m68k-skip-futex_atomic_cmpxchg_inatomic-test.patch
new file mode 100644 (file)
index 0000000..0863701
--- /dev/null
@@ -0,0 +1,32 @@
+From e571c58f313d35c56e0018470e3375ddd1fd320e Mon Sep 17 00:00:00 2001
+From: Finn Thain <fthain@telegraphics.com.au>
+Date: Thu, 6 Mar 2014 10:29:27 +1100
+Subject: m68k: Skip futex_atomic_cmpxchg_inatomic() test
+
+From: Finn Thain <fthain@telegraphics.com.au>
+
+commit e571c58f313d35c56e0018470e3375ddd1fd320e upstream.
+
+Skip the futex_atomic_cmpxchg_inatomic() test in futex_init(). It causes a
+fatal exception on 68030 (and presumably 68020 also).
+
+Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Link: http://lkml.kernel.org/r/alpine.LNX.2.00.1403061006440.5525@nippy.intranet
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/m68k/Kconfig |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/m68k/Kconfig
++++ b/arch/m68k/Kconfig
+@@ -16,6 +16,7 @@ config M68K
+       select FPU if MMU
+       select ARCH_WANT_IPC_PARSE_VERSION
+       select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE
++      select HAVE_FUTEX_CMPXCHG if MMU && FUTEX
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_REL
+       select MODULES_USE_ELF_RELA
index d2c81ca277df79f8ba1582ff12e5513563aa65fe..f253e2375790613b2a052645c923a538bddff275 100644 (file)
@@ -32,3 +32,10 @@ netlink-don-t-compare-the-nul-termination-in-nla_strcmp.patch
 isdnloop-validate-nul-terminated-strings-from-user.patch
 isdnloop-several-buffer-overflows.patch
 rds-prevent-dereference-of-a-null-device-in-rds_iw_laddr_check.patch
+arc-change-.dts-to-use-generic-8250-uart.patch
+arc-unbork-console.patch
+futex-allow-architectures-to-skip-futex_atomic_cmpxchg_inatomic-test.patch
+m68k-skip-futex_atomic_cmpxchg_inatomic-test.patch
+crypto-ghash-clmulni-intel-use-c-implementation-for-setkey.patch
+cpufreq-fix-governor-start-stop-race-condition.patch
+cpufreq-fix-timer-workqueue-corruption-due-to-double-queueing.patch