Merge branch 'experimental/android-3.10' of https://android.googlesource.com/kernel...
authorMark Brown <broonie@linaro.org>
Fri, 19 Jul 2013 09:42:11 +0000 (10:42 +0100)
committerMark Brown <broonie@linaro.org>
Fri, 19 Jul 2013 09:42:11 +0000 (10:42 +0100)
Conflicts:
arch/arm/include/asm/smp.h
arch/arm/kernel/smp.c
kernel/futex.c

15 files changed:
1  2 
arch/arm/Kconfig
arch/arm/boot/dts/Makefile
arch/arm/common/Makefile
arch/arm/include/asm/hardirq.h
arch/arm/include/asm/smp.h
arch/arm/kernel/smp.c
arch/arm/mm/fault.c
block/genhd.c
drivers/cpufreq/Makefile
drivers/cpufreq/cpufreq_stats.c
drivers/video/Kconfig
include/linux/sched.h
kernel/futex.c
kernel/power/Kconfig
kernel/sched/core.c

Simple merge
Simple merge
Simple merge
index 3d7351c844aac0ae2392d441796ce9904dcaf717,3d7351c844aac0ae2392d441796ce9904dcaf717..fe3ea776dc34267724f377465134e52b39434fed
@@@ -5,7 -5,7 +5,7 @@@
  #include <linux/threads.h>
  #include <asm/irq.h>
  
--#define NR_IPI        7
++#define NR_IPI        8
  
  typedef struct {
        unsigned int __softirq_pending;
index 610ccf33f5e760aece49be89a1052f6f64a05aef,c5aa088c0a8bf94079307f9708d8a009bd36d624..67a18a5ed9fa08e7cbdb7a49526862121e794edf
@@@ -81,7 -81,7 +81,8 @@@ extern void arch_send_call_function_sin
  extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
  extern void arch_send_wakeup_ipi_mask(const struct cpumask *mask);
  
 +extern int register_ipi_completion(struct completion *completion, int cpu);
+ extern void smp_send_all_cpu_backtrace(void);
  
  struct smp_operations {
  #ifdef CONFIG_SMP
index dc05ca77963b3249da89b36a20a09fcaa5355eca,0c96b2d343ed0719c6569c55a3ab12487c48bec8..84d55da02e6a2486d92b89ffccad22b6fbb634a0
@@@ -66,7 -66,7 +66,8 @@@ enum ipi_msg_type 
        IPI_CALL_FUNC,
        IPI_CALL_FUNC_SINGLE,
        IPI_CPU_STOP,
 +      IPI_COMPLETION,
+       IPI_CPU_BACKTRACE,
  };
  
  static DECLARE_COMPLETION(cpu_running);
@@@ -464,7 -464,7 +465,8 @@@ static const char *ipi_types[NR_IPI] = 
        S(IPI_CALL_FUNC, "Function call interrupts"),
        S(IPI_CALL_FUNC_SINGLE, "Single function call interrupts"),
        S(IPI_CPU_STOP, "CPU stop interrupts"),
 +      S(IPI_COMPLETION, "completion interrupts"),
+       S(IPI_CPU_BACKTRACE, "CPU backtrace"),
  };
  
  void show_ipi_list(struct seq_file *p, int prec)
@@@ -590,19 -590,58 +592,71 @@@ static void ipi_cpu_stop(unsigned int c
                cpu_relax();
  }
  
 +static DEFINE_PER_CPU(struct completion *, cpu_completion);
 +
 +int register_ipi_completion(struct completion *completion, int cpu)
 +{
 +      per_cpu(cpu_completion, cpu) = completion;
 +      return IPI_COMPLETION;
 +}
 +
 +static void ipi_complete(unsigned int cpu)
 +{
 +      complete(per_cpu(cpu_completion, cpu));
 +}
 +
+ static cpumask_t backtrace_mask;
+ static DEFINE_RAW_SPINLOCK(backtrace_lock);
+ /* "in progress" flag of arch_trigger_all_cpu_backtrace */
+ static unsigned long backtrace_flag;
+ void smp_send_all_cpu_backtrace(void)
+ {
+       unsigned int this_cpu = smp_processor_id();
+       int i;
+       if (test_and_set_bit(0, &backtrace_flag))
+               /*
+                * If there is already a trigger_all_cpu_backtrace() in progress
+                * (backtrace_flag == 1), don't output double cpu dump infos.
+                */
+               return;
+       cpumask_copy(&backtrace_mask, cpu_online_mask);
+       cpu_clear(this_cpu, backtrace_mask);
+       pr_info("Backtrace for cpu %d (current):\n", this_cpu);
+       dump_stack();
+       pr_info("\nsending IPI to all other CPUs:\n");
+       smp_cross_call(&backtrace_mask, IPI_CPU_BACKTRACE);
+       /* Wait for up to 10 seconds for all other CPUs to do the backtrace */
+       for (i = 0; i < 10 * 1000; i++) {
+               if (cpumask_empty(&backtrace_mask))
+                       break;
+               mdelay(1);
+       }
+       clear_bit(0, &backtrace_flag);
+       smp_mb__after_clear_bit();
+ }
+ /*
+  * ipi_cpu_backtrace - handle IPI from smp_send_all_cpu_backtrace()
+  */
+ static void ipi_cpu_backtrace(unsigned int cpu, struct pt_regs *regs)
+ {
+       if (cpu_isset(cpu, backtrace_mask)) {
+               raw_spin_lock(&backtrace_lock);
+               pr_warning("IPI backtrace for cpu %d\n", cpu);
+               show_regs(regs);
+               raw_spin_unlock(&backtrace_lock);
+               cpu_clear(cpu, backtrace_mask);
+       }
+ }
  /*
   * Main handler for inter-processor interrupts
   */
@@@ -653,12 -692,10 +707,16 @@@ void handle_IPI(int ipinr, struct pt_re
                irq_exit();
                break;
  
 +      case IPI_COMPLETION:
 +              irq_enter();
 +              ipi_complete(cpu);
 +              irq_exit();
 +              break;
 +
+       case IPI_CPU_BACKTRACE:
+               ipi_cpu_backtrace(cpu, regs);
+               break;
        default:
                printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%x\n",
                       cpu, ipinr);
Simple merge
diff --cc block/genhd.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc kernel/futex.c
index 49dacfb4574563b61551a436a21a2fc33053e47f,d710fae8abbe933b97267b69ff2e27864d1291a4..c3a1a55a52141851630b91f2bff2aa789b508ace
@@@ -61,7 -61,7 +61,8 @@@
  #include <linux/nsproxy.h>
  #include <linux/ptrace.h>
  #include <linux/sched/rt.h>
 +#include <linux/hugetlb.h>
+ #include <linux/freezer.h>
  
  #include <asm/futex.h>
  
Simple merge
Simple merge