--- /dev/null
+From a4b6cb735b25aa84a462a1985e3e43bebaf5beb4 Mon Sep 17 00:00:00 2001
+From: Anton Kolesov <Anton.Kolesov@synopsys.com>
+Date: Fri, 20 Jun 2014 20:28:39 +0400
+Subject: ARC: Implement ptrace(PTRACE_GET_THREAD_AREA)
+
+From: Anton Kolesov <Anton.Kolesov@synopsys.com>
+
+commit a4b6cb735b25aa84a462a1985e3e43bebaf5beb4 upstream.
+
+This patch adds implementation of GET_THREAD_AREA ptrace request type. This
+is required by GDB to debug NPTL applications.
+
+Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arc/include/uapi/asm/ptrace.h | 1 +
+ arch/arc/kernel/ptrace.c | 4 ++++
+ 2 files changed, 5 insertions(+)
+
+--- a/arch/arc/include/uapi/asm/ptrace.h
++++ b/arch/arc/include/uapi/asm/ptrace.h
+@@ -11,6 +11,7 @@
+ #ifndef _UAPI__ASM_ARC_PTRACE_H
+ #define _UAPI__ASM_ARC_PTRACE_H
+
++#define PTRACE_GET_THREAD_AREA 25
+
+ #ifndef __ASSEMBLY__
+ /*
+--- a/arch/arc/kernel/ptrace.c
++++ b/arch/arc/kernel/ptrace.c
+@@ -136,6 +136,10 @@ long arch_ptrace(struct task_struct *chi
+ pr_debug("REQ=%ld: ADDR =0x%lx, DATA=0x%lx)\n", request, addr, data);
+
+ switch (request) {
++ case PTRACE_GET_THREAD_AREA:
++ ret = put_user(task_thread_info(child)->thr_ptr,
++ (unsigned long __user *)data);
++ break;
+ default:
+ ret = ptrace_request(child, request, addr, data);
+ break;
--- /dev/null
+From b0ab99e7736af88b8ac1b7ae50ea287fffa2badc Mon Sep 17 00:00:00 2001
+From: Mateusz Guzik <mguzik@redhat.com>
+Date: Sat, 14 Jun 2014 15:00:09 +0200
+Subject: sched: Fix possible divide by zero in avg_atom() calculation
+
+From: Mateusz Guzik <mguzik@redhat.com>
+
+commit b0ab99e7736af88b8ac1b7ae50ea287fffa2badc upstream.
+
+proc_sched_show_task() does:
+
+ if (nr_switches)
+ do_div(avg_atom, nr_switches);
+
+nr_switches is unsigned long and do_div truncates it to 32 bits, which
+means it can test non-zero on e.g. x86-64 and be truncated to zero for
+division.
+
+Fix the problem by using div64_ul() instead.
+
+As a side effect calculations of avg_atom for big nr_switches are now correct.
+
+Signed-off-by: Mateusz Guzik <mguzik@redhat.com>
+Signed-off-by: Peter Zijlstra <peterz@infradead.org>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Link: http://lkml.kernel.org/r/1402750809-31991-1-git-send-email-mguzik@redhat.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/sched/debug.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/kernel/sched/debug.c
++++ b/kernel/sched/debug.c
+@@ -551,7 +551,7 @@ void proc_sched_show_task(struct task_st
+
+ avg_atom = p->se.sum_exec_runtime;
+ if (nr_switches)
+- do_div(avg_atom, nr_switches);
++ avg_atom = div64_ul(avg_atom, nr_switches);
+ else
+ avg_atom = -1LL;
+
dm-cache-metadata-do-not-allow-the-data-block-size-to-change.patch
pm-sleep-fix-request_firmware-error-at-resume.patch
locking-mutex-disable-optimistic-spinning-on-some-architectures.patch
+sched-fix-possible-divide-by-zero-in-avg_atom-calculation.patch
+arc-implement-ptrace-ptrace_get_thread_area.patch