summaryrefslogtreecommitdiff
path: root/target/linux/patches
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2016-03-27 11:58:30 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2016-04-01 18:10:21 +0200
commitfc550f0d7bafdd01eb8b4f8125c1cbbcd8525f55 (patch)
tree0369112d9665509bd79723a2dd380be711c87a11 /target/linux/patches
parent486234afd38eced4281f9d8f228feb24f7a9d54c (diff)
linux: update to 4.1.20, add solidrun patch for 4.4.6
Diffstat (limited to 'target/linux/patches')
-rw-r--r--target/linux/patches/4.1.20/aufs.patch (renamed from target/linux/patches/4.1.16/aufs.patch)0
-rw-r--r--target/linux/patches/4.1.20/cleankernel.patch (renamed from target/linux/patches/4.1.16/cleankernel.patch)0
-rw-r--r--target/linux/patches/4.1.20/cris-header.patch (renamed from target/linux/patches/4.1.16/cris-header.patch)0
-rw-r--r--target/linux/patches/4.1.20/initramfs-nosizelimit.patch (renamed from target/linux/patches/4.1.16/initramfs-nosizelimit.patch)0
-rw-r--r--target/linux/patches/4.1.20/j2-core.patch (renamed from target/linux/patches/4.1.16/j2-core.patch)0
-rw-r--r--target/linux/patches/4.1.20/mtd-rootfs.patch (renamed from target/linux/patches/4.1.16/mtd-rootfs.patch)0
-rw-r--r--target/linux/patches/4.1.20/realtime.patch (renamed from target/linux/patches/4.1.16/realtime.patch)6057
-rw-r--r--target/linux/patches/4.1.20/regmap-default-on.patch (renamed from target/linux/patches/4.1.16/regmap-default-on.patch)0
-rw-r--r--target/linux/patches/4.1.20/remove-warn.patch (renamed from target/linux/patches/4.1.16/remove-warn.patch)0
-rw-r--r--target/linux/patches/4.1.20/startup.patch (renamed from target/linux/patches/4.1.16/startup.patch)0
-rw-r--r--target/linux/patches/4.1.20/use-libgcc-for-sh.patch (renamed from target/linux/patches/4.1.16/use-libgcc-for-sh.patch)0
11 files changed, 3549 insertions, 2508 deletions
diff --git a/target/linux/patches/4.1.16/aufs.patch b/target/linux/patches/4.1.20/aufs.patch
index 749c90989..749c90989 100644
--- a/target/linux/patches/4.1.16/aufs.patch
+++ b/target/linux/patches/4.1.20/aufs.patch
diff --git a/target/linux/patches/4.1.16/cleankernel.patch b/target/linux/patches/4.1.20/cleankernel.patch
index 59693f426..59693f426 100644
--- a/target/linux/patches/4.1.16/cleankernel.patch
+++ b/target/linux/patches/4.1.20/cleankernel.patch
diff --git a/target/linux/patches/4.1.16/cris-header.patch b/target/linux/patches/4.1.20/cris-header.patch
index 2b5a88461..2b5a88461 100644
--- a/target/linux/patches/4.1.16/cris-header.patch
+++ b/target/linux/patches/4.1.20/cris-header.patch
diff --git a/target/linux/patches/4.1.16/initramfs-nosizelimit.patch b/target/linux/patches/4.1.20/initramfs-nosizelimit.patch
index 40d2f6bd8..40d2f6bd8 100644
--- a/target/linux/patches/4.1.16/initramfs-nosizelimit.patch
+++ b/target/linux/patches/4.1.20/initramfs-nosizelimit.patch
diff --git a/target/linux/patches/4.1.16/j2-core.patch b/target/linux/patches/4.1.20/j2-core.patch
index 38136df2c..38136df2c 100644
--- a/target/linux/patches/4.1.16/j2-core.patch
+++ b/target/linux/patches/4.1.20/j2-core.patch
diff --git a/target/linux/patches/4.1.16/mtd-rootfs.patch b/target/linux/patches/4.1.20/mtd-rootfs.patch
index 5f6d82b5c..5f6d82b5c 100644
--- a/target/linux/patches/4.1.16/mtd-rootfs.patch
+++ b/target/linux/patches/4.1.20/mtd-rootfs.patch
diff --git a/target/linux/patches/4.1.16/realtime.patch b/target/linux/patches/4.1.20/realtime.patch
index 3b65f6148..9ea8309aa 100644
--- a/target/linux/patches/4.1.16/realtime.patch
+++ b/target/linux/patches/4.1.20/realtime.patch
@@ -1,6 +1,306 @@
-diff -Nur linux-4.1.13.orig/arch/alpha/mm/fault.c linux-4.1.13/arch/alpha/mm/fault.c
---- linux-4.1.13.orig/arch/alpha/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/alpha/mm/fault.c 2015-11-29 09:23:09.477622951 +0100
+diff -Nur linux-4.1.20.orig/Documentation/hwlat_detector.txt linux-4.1.20/Documentation/hwlat_detector.txt
+--- linux-4.1.20.orig/Documentation/hwlat_detector.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/Documentation/hwlat_detector.txt 2016-03-21 20:18:28.000000000 +0100
+@@ -0,0 +1,64 @@
++Introduction:
++-------------
++
++The module hwlat_detector is a special purpose kernel module that is used to
++detect large system latencies induced by the behavior of certain underlying
++hardware or firmware, independent of Linux itself. The code was developed
++originally to detect SMIs (System Management Interrupts) on x86 systems,
++however there is nothing x86 specific about this patchset. It was
++originally written for use by the "RT" patch since the Real Time
++kernel is highly latency sensitive.
++
++SMIs are usually not serviced by the Linux kernel, which typically does not
++even know that they are occuring. SMIs are instead are set up by BIOS code
++and are serviced by BIOS code, usually for "critical" events such as
++management of thermal sensors and fans. Sometimes though, SMIs are used for
++other tasks and those tasks can spend an inordinate amount of time in the
++handler (sometimes measured in milliseconds). Obviously this is a problem if
++you are trying to keep event service latencies down in the microsecond range.
++
++The hardware latency detector works by hogging all of the cpus for configurable
++amounts of time (by calling stop_machine()), polling the CPU Time Stamp Counter
++for some period, then looking for gaps in the TSC data. Any gap indicates a
++time when the polling was interrupted and since the machine is stopped and
++interrupts turned off the only thing that could do that would be an SMI.
++
++Note that the SMI detector should *NEVER* be used in a production environment.
++It is intended to be run manually to determine if the hardware platform has a
++problem with long system firmware service routines.
++
++Usage:
++------
++
++Loading the module hwlat_detector passing the parameter "enabled=1" (or by
++setting the "enable" entry in "hwlat_detector" debugfs toggled on) is the only
++step required to start the hwlat_detector. It is possible to redefine the
++threshold in microseconds (us) above which latency spikes will be taken
++into account (parameter "threshold=").
++
++Example:
++
++ # modprobe hwlat_detector enabled=1 threshold=100
++
++After the module is loaded, it creates a directory named "hwlat_detector" under
++the debugfs mountpoint, "/debug/hwlat_detector" for this text. It is necessary
++to have debugfs mounted, which might be on /sys/debug on your system.
++
++The /debug/hwlat_detector interface contains the following files:
++
++count - number of latency spikes observed since last reset
++enable - a global enable/disable toggle (0/1), resets count
++max - maximum hardware latency actually observed (usecs)
++sample - a pipe from which to read current raw sample data
++ in the format <timestamp> <latency observed usecs>
++ (can be opened O_NONBLOCK for a single sample)
++threshold - minimum latency value to be considered (usecs)
++width - time period to sample with CPUs held (usecs)
++ must be less than the total window size (enforced)
++window - total period of sampling, width being inside (usecs)
++
++By default we will set width to 500,000 and window to 1,000,000, meaning that
++we will sample every 1,000,000 usecs (1s) for 500,000 usecs (0.5s). If we
++observe any latencies that exceed the threshold (initially 100 usecs),
++then we write to a global sample ring buffer of 8K samples, which is
++consumed by reading from the "sample" (pipe) debugfs file interface.
+diff -Nur linux-4.1.20.orig/Documentation/sysrq.txt linux-4.1.20/Documentation/sysrq.txt
+--- linux-4.1.20.orig/Documentation/sysrq.txt 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/Documentation/sysrq.txt 2016-03-21 20:18:28.000000000 +0100
+@@ -59,10 +59,17 @@
+ On other - If you know of the key combos for other architectures, please
+ let me know so I can add them to this section.
+
+-On all - write a character to /proc/sysrq-trigger. e.g.:
+-
++On all - write a character to /proc/sysrq-trigger, e.g.:
+ echo t > /proc/sysrq-trigger
+
++On all - Enable network SysRq by writing a cookie to icmp_echo_sysrq, e.g.
++ echo 0x01020304 >/proc/sys/net/ipv4/icmp_echo_sysrq
++ Send an ICMP echo request with this pattern plus the particular
++ SysRq command key. Example:
++ # ping -c1 -s57 -p0102030468
++ will trigger the SysRq-H (help) command.
++
++
+ * What are the 'command' keys?
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 'b' - Will immediately reboot the system without syncing or unmounting
+diff -Nur linux-4.1.20.orig/Documentation/trace/histograms.txt linux-4.1.20/Documentation/trace/histograms.txt
+--- linux-4.1.20.orig/Documentation/trace/histograms.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/Documentation/trace/histograms.txt 2016-03-21 20:18:28.000000000 +0100
+@@ -0,0 +1,186 @@
++ Using the Linux Kernel Latency Histograms
++
++
++This document gives a short explanation how to enable, configure and use
++latency histograms. Latency histograms are primarily relevant in the
++context of real-time enabled kernels (CONFIG_PREEMPT/CONFIG_PREEMPT_RT)
++and are used in the quality management of the Linux real-time
++capabilities.
++
++
++* Purpose of latency histograms
++
++A latency histogram continuously accumulates the frequencies of latency
++data. There are two types of histograms
++- potential sources of latencies
++- effective latencies
++
++
++* Potential sources of latencies
++
++Potential sources of latencies are code segments where interrupts,
++preemption or both are disabled (aka critical sections). To create
++histograms of potential sources of latency, the kernel stores the time
++stamp at the start of a critical section, determines the time elapsed
++when the end of the section is reached, and increments the frequency
++counter of that latency value - irrespective of whether any concurrently
++running process is affected by latency or not.
++- Configuration items (in the Kernel hacking/Tracers submenu)
++ CONFIG_INTERRUPT_OFF_LATENCY
++ CONFIG_PREEMPT_OFF_LATENCY
++
++
++* Effective latencies
++
++Effective latencies are actually occuring during wakeup of a process. To
++determine effective latencies, the kernel stores the time stamp when a
++process is scheduled to be woken up, and determines the duration of the
++wakeup time shortly before control is passed over to this process. Note
++that the apparent latency in user space may be somewhat longer, since the
++process may be interrupted after control is passed over to it but before
++the execution in user space takes place. Simply measuring the interval
++between enqueuing and wakeup may also not appropriate in cases when a
++process is scheduled as a result of a timer expiration. The timer may have
++missed its deadline, e.g. due to disabled interrupts, but this latency
++would not be registered. Therefore, the offsets of missed timers are
++recorded in a separate histogram. If both wakeup latency and missed timer
++offsets are configured and enabled, a third histogram may be enabled that
++records the overall latency as a sum of the timer latency, if any, and the
++wakeup latency. This histogram is called "timerandwakeup".
++- Configuration items (in the Kernel hacking/Tracers submenu)
++ CONFIG_WAKEUP_LATENCY
++ CONFIG_MISSED_TIMER_OFSETS
++
++
++* Usage
++
++The interface to the administration of the latency histograms is located
++in the debugfs file system. To mount it, either enter
++
++mount -t sysfs nodev /sys
++mount -t debugfs nodev /sys/kernel/debug
++
++from shell command line level, or add
++
++nodev /sys sysfs defaults 0 0
++nodev /sys/kernel/debug debugfs defaults 0 0
++
++to the file /etc/fstab. All latency histogram related files are then
++available in the directory /sys/kernel/debug/tracing/latency_hist. A
++particular histogram type is enabled by writing non-zero to the related
++variable in the /sys/kernel/debug/tracing/latency_hist/enable directory.
++Select "preemptirqsoff" for the histograms of potential sources of
++latencies and "wakeup" for histograms of effective latencies etc. The
++histogram data - one per CPU - are available in the files
++
++/sys/kernel/debug/tracing/latency_hist/preemptoff/CPUx
++/sys/kernel/debug/tracing/latency_hist/irqsoff/CPUx
++/sys/kernel/debug/tracing/latency_hist/preemptirqsoff/CPUx
++/sys/kernel/debug/tracing/latency_hist/wakeup/CPUx
++/sys/kernel/debug/tracing/latency_hist/wakeup/sharedprio/CPUx
++/sys/kernel/debug/tracing/latency_hist/missed_timer_offsets/CPUx
++/sys/kernel/debug/tracing/latency_hist/timerandwakeup/CPUx
++
++The histograms are reset by writing non-zero to the file "reset" in a
++particular latency directory. To reset all latency data, use
++
++#!/bin/sh
++
++TRACINGDIR=/sys/kernel/debug/tracing
++HISTDIR=$TRACINGDIR/latency_hist
++
++if test -d $HISTDIR
++then
++ cd $HISTDIR
++ for i in `find . | grep /reset$`
++ do
++ echo 1 >$i
++ done
++fi
++
++
++* Data format
++
++Latency data are stored with a resolution of one microsecond. The
++maximum latency is 10,240 microseconds. The data are only valid, if the
++overflow register is empty. Every output line contains the latency in
++microseconds in the first row and the number of samples in the second
++row. To display only lines with a positive latency count, use, for
++example,
++
++grep -v " 0$" /sys/kernel/debug/tracing/latency_hist/preemptoff/CPU0
++
++#Minimum latency: 0 microseconds.
++#Average latency: 0 microseconds.
++#Maximum latency: 25 microseconds.
++#Total samples: 3104770694
++#There are 0 samples greater or equal than 10240 microseconds
++#usecs samples
++ 0 2984486876
++ 1 49843506
++ 2 58219047
++ 3 5348126
++ 4 2187960
++ 5 3388262
++ 6 959289
++ 7 208294
++ 8 40420
++ 9 4485
++ 10 14918
++ 11 18340
++ 12 25052
++ 13 19455
++ 14 5602
++ 15 969
++ 16 47
++ 17 18
++ 18 14
++ 19 1
++ 20 3
++ 21 2
++ 22 5
++ 23 2
++ 25 1
++
++
++* Wakeup latency of a selected process
++
++To only collect wakeup latency data of a particular process, write the
++PID of the requested process to
++
++/sys/kernel/debug/tracing/latency_hist/wakeup/pid
++
++PIDs are not considered, if this variable is set to 0.
++
++
++* Details of the process with the highest wakeup latency so far
++
++Selected data of the process that suffered from the highest wakeup
++latency that occurred in a particular CPU are available in the file
++
++/sys/kernel/debug/tracing/latency_hist/wakeup/max_latency-CPUx.
++
++In addition, other relevant system data at the time when the
++latency occurred are given.
++
++The format of the data is (all in one line):
++<PID> <Priority> <Latency> (<Timeroffset>) <Command> \
++<- <PID> <Priority> <Command> <Timestamp>
++
++The value of <Timeroffset> is only relevant in the combined timer
++and wakeup latency recording. In the wakeup recording, it is
++always 0, in the missed_timer_offsets recording, it is the same
++as <Latency>.
++
++When retrospectively searching for the origin of a latency and
++tracing was not enabled, it may be helpful to know the name and
++some basic data of the task that (finally) was switching to the
++late real-tlme task. In addition to the victim's data, also the
++data of the possible culprit are therefore displayed after the
++"<-" symbol.
++
++Finally, the timestamp of the time when the latency occurred
++in <seconds>.<microseconds> after the most recent system boot
++is provided.
++
++These data are also reset when the wakeup histogram is reset.
+diff -Nur linux-4.1.20.orig/arch/Kconfig linux-4.1.20/arch/Kconfig
+--- linux-4.1.20.orig/arch/Kconfig 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/Kconfig 2016-03-21 20:18:28.000000000 +0100
+@@ -6,6 +6,7 @@
+ tristate "OProfile system profiling"
+ depends on PROFILING
+ depends on HAVE_OPROFILE
++ depends on !PREEMPT_RT_FULL
+ select RING_BUFFER
+ select RING_BUFFER_ALLOW_SWAP
+ help
+@@ -49,6 +50,7 @@
+ config JUMP_LABEL
+ bool "Optimize very unlikely/likely branches"
+ depends on HAVE_ARCH_JUMP_LABEL
++ depends on (!INTERRUPT_OFF_HIST && !PREEMPT_OFF_HIST && !WAKEUP_LATENCY_HIST && !MISSED_TIMER_OFFSETS_HIST)
+ help
+ This option enables a transparent branch optimization that
+ makes certain almost-always-true or almost-always-false branch
+diff -Nur linux-4.1.20.orig/arch/alpha/mm/fault.c linux-4.1.20/arch/alpha/mm/fault.c
+--- linux-4.1.20.orig/arch/alpha/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/alpha/mm/fault.c 2016-03-21 20:18:28.000000000 +0100
@@ -23,8 +23,7 @@
#include <linux/smp.h>
#include <linux/interrupt.h>
@@ -20,9 +320,9 @@ diff -Nur linux-4.1.13.orig/arch/alpha/mm/fault.c linux-4.1.13/arch/alpha/mm/fau
goto no_context;
#ifdef CONFIG_ALPHA_LARGE_VMALLOC
-diff -Nur linux-4.1.13.orig/arch/arc/include/asm/futex.h linux-4.1.13/arch/arc/include/asm/futex.h
---- linux-4.1.13.orig/arch/arc/include/asm/futex.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arc/include/asm/futex.h 2015-11-29 09:23:09.477622951 +0100
+diff -Nur linux-4.1.20.orig/arch/arc/include/asm/futex.h linux-4.1.20/arch/arc/include/asm/futex.h
+--- linux-4.1.20.orig/arch/arc/include/asm/futex.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arc/include/asm/futex.h 2016-03-21 20:18:28.000000000 +0100
@@ -53,7 +53,7 @@
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
return -EFAULT;
@@ -68,9 +368,9 @@ diff -Nur linux-4.1.13.orig/arch/arc/include/asm/futex.h linux-4.1.13/arch/arc/i
*uval = val;
return val;
-diff -Nur linux-4.1.13.orig/arch/arc/mm/fault.c linux-4.1.13/arch/arc/mm/fault.c
---- linux-4.1.13.orig/arch/arc/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arc/mm/fault.c 2015-11-29 09:23:09.477622951 +0100
+diff -Nur linux-4.1.20.orig/arch/arc/mm/fault.c linux-4.1.20/arch/arc/mm/fault.c
+--- linux-4.1.20.orig/arch/arc/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arc/mm/fault.c 2016-03-21 20:18:28.000000000 +0100
@@ -86,7 +86,7 @@
* If we're in an interrupt or have no user
* context, we must not take the fault..
@@ -80,9 +380,29 @@ diff -Nur linux-4.1.13.orig/arch/arc/mm/fault.c linux-4.1.13/arch/arc/mm/fault.c
goto no_context;
if (user_mode(regs))
-diff -Nur linux-4.1.13.orig/arch/arm/include/asm/cmpxchg.h linux-4.1.13/arch/arm/include/asm/cmpxchg.h
---- linux-4.1.13.orig/arch/arm/include/asm/cmpxchg.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/include/asm/cmpxchg.h 2015-11-29 09:23:09.477622951 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/Kconfig linux-4.1.20/arch/arm/Kconfig
+--- linux-4.1.20.orig/arch/arm/Kconfig 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/Kconfig 2016-03-21 20:18:28.000000000 +0100
+@@ -31,7 +31,7 @@
+ select HARDIRQS_SW_RESEND
+ select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
+ select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
+- select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
++ select HAVE_ARCH_JUMP_LABEL if (!XIP_KERNEL && !PREEMPT_RT_BASE)
+ select HAVE_ARCH_KGDB
+ select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT)
+ select HAVE_ARCH_TRACEHOOK
+@@ -66,6 +66,7 @@
+ select HAVE_PERF_EVENTS
+ select HAVE_PERF_REGS
+ select HAVE_PERF_USER_STACK_DUMP
++ select HAVE_PREEMPT_LAZY
+ select HAVE_RCU_TABLE_FREE if (SMP && ARM_LPAE)
+ select HAVE_REGS_AND_STACK_ACCESS_API
+ select HAVE_SYSCALL_TRACEPOINTS
+diff -Nur linux-4.1.20.orig/arch/arm/include/asm/cmpxchg.h linux-4.1.20/arch/arm/include/asm/cmpxchg.h
+--- linux-4.1.20.orig/arch/arm/include/asm/cmpxchg.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/include/asm/cmpxchg.h 2016-03-21 20:18:28.000000000 +0100
@@ -129,6 +129,8 @@
#else /* min ARCH >= ARMv6 */
@@ -92,9 +412,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/include/asm/cmpxchg.h linux-4.1.13/arch/arm
extern void __bad_cmpxchg(volatile void *ptr, int size);
/*
-diff -Nur linux-4.1.13.orig/arch/arm/include/asm/futex.h linux-4.1.13/arch/arm/include/asm/futex.h
---- linux-4.1.13.orig/arch/arm/include/asm/futex.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/include/asm/futex.h 2015-11-29 09:23:09.477622951 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/include/asm/futex.h linux-4.1.20/arch/arm/include/asm/futex.h
+--- linux-4.1.20.orig/arch/arm/include/asm/futex.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/include/asm/futex.h 2016-03-21 20:18:28.000000000 +0100
@@ -93,6 +93,7 @@
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
return -EFAULT;
@@ -136,9 +456,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/include/asm/futex.h linux-4.1.13/arch/arm/i
if (!ret) {
switch (cmp) {
-diff -Nur linux-4.1.13.orig/arch/arm/include/asm/switch_to.h linux-4.1.13/arch/arm/include/asm/switch_to.h
---- linux-4.1.13.orig/arch/arm/include/asm/switch_to.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/include/asm/switch_to.h 2015-11-29 09:23:09.477622951 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/include/asm/switch_to.h linux-4.1.20/arch/arm/include/asm/switch_to.h
+--- linux-4.1.20.orig/arch/arm/include/asm/switch_to.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/include/asm/switch_to.h 2016-03-21 20:18:28.000000000 +0100
@@ -3,6 +3,13 @@
#include <linux/thread_info.h>
@@ -161,9 +481,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/include/asm/switch_to.h linux-4.1.13/arch/a
last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \
} while (0)
-diff -Nur linux-4.1.13.orig/arch/arm/include/asm/thread_info.h linux-4.1.13/arch/arm/include/asm/thread_info.h
---- linux-4.1.13.orig/arch/arm/include/asm/thread_info.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/include/asm/thread_info.h 2015-11-29 09:23:09.477622951 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/include/asm/thread_info.h linux-4.1.20/arch/arm/include/asm/thread_info.h
+--- linux-4.1.20.orig/arch/arm/include/asm/thread_info.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/include/asm/thread_info.h 2016-03-21 20:18:28.000000000 +0100
@@ -50,6 +50,7 @@
struct thread_info {
unsigned long flags; /* low level flags */
@@ -188,29 +508,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/include/asm/thread_info.h linux-4.1.13/arch
#define _TIF_UPROBE (1 << TIF_UPROBE)
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
-diff -Nur linux-4.1.13.orig/arch/arm/Kconfig linux-4.1.13/arch/arm/Kconfig
---- linux-4.1.13.orig/arch/arm/Kconfig 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/Kconfig 2015-11-29 09:23:09.477622951 +0100
-@@ -31,7 +31,7 @@
- select HARDIRQS_SW_RESEND
- select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
- select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
-- select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
-+ select HAVE_ARCH_JUMP_LABEL if (!XIP_KERNEL && !PREEMPT_RT_BASE)
- select HAVE_ARCH_KGDB
- select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT)
- select HAVE_ARCH_TRACEHOOK
-@@ -66,6 +66,7 @@
- select HAVE_PERF_EVENTS
- select HAVE_PERF_REGS
- select HAVE_PERF_USER_STACK_DUMP
-+ select HAVE_PREEMPT_LAZY
- select HAVE_RCU_TABLE_FREE if (SMP && ARM_LPAE)
- select HAVE_REGS_AND_STACK_ACCESS_API
- select HAVE_SYSCALL_TRACEPOINTS
-diff -Nur linux-4.1.13.orig/arch/arm/kernel/asm-offsets.c linux-4.1.13/arch/arm/kernel/asm-offsets.c
---- linux-4.1.13.orig/arch/arm/kernel/asm-offsets.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/kernel/asm-offsets.c 2015-11-29 09:23:09.477622951 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/kernel/asm-offsets.c linux-4.1.20/arch/arm/kernel/asm-offsets.c
+--- linux-4.1.20.orig/arch/arm/kernel/asm-offsets.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/kernel/asm-offsets.c 2016-03-21 20:18:28.000000000 +0100
@@ -65,6 +65,7 @@
BLANK();
DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
@@ -219,9 +519,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/kernel/asm-offsets.c linux-4.1.13/arch/arm/
DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));
DEFINE(TI_TASK, offsetof(struct thread_info, task));
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
-diff -Nur linux-4.1.13.orig/arch/arm/kernel/entry-armv.S linux-4.1.13/arch/arm/kernel/entry-armv.S
---- linux-4.1.13.orig/arch/arm/kernel/entry-armv.S 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/kernel/entry-armv.S 2015-11-29 09:23:09.477622951 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/kernel/entry-armv.S linux-4.1.20/arch/arm/kernel/entry-armv.S
+--- linux-4.1.20.orig/arch/arm/kernel/entry-armv.S 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/kernel/entry-armv.S 2016-03-21 20:18:28.000000000 +0100
@@ -208,11 +208,18 @@
#ifdef CONFIG_PREEMPT
get_thread_info tsk
@@ -252,9 +552,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/kernel/entry-armv.S linux-4.1.13/arch/arm/k
reteq r8 @ go again
b 1b
#endif
-diff -Nur linux-4.1.13.orig/arch/arm/kernel/process.c linux-4.1.13/arch/arm/kernel/process.c
---- linux-4.1.13.orig/arch/arm/kernel/process.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/kernel/process.c 2015-11-29 09:23:09.477622951 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/kernel/process.c linux-4.1.20/arch/arm/kernel/process.c
+--- linux-4.1.20.orig/arch/arm/kernel/process.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/kernel/process.c 2016-03-21 20:18:28.000000000 +0100
@@ -290,6 +290,30 @@
}
@@ -286,9 +586,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/kernel/process.c linux-4.1.13/arch/arm/kern
#ifdef CONFIG_KUSER_HELPERS
/*
* The vectors page is always readable from user space for the
-diff -Nur linux-4.1.13.orig/arch/arm/kernel/signal.c linux-4.1.13/arch/arm/kernel/signal.c
---- linux-4.1.13.orig/arch/arm/kernel/signal.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/kernel/signal.c 2015-11-29 09:23:09.477622951 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/kernel/signal.c linux-4.1.20/arch/arm/kernel/signal.c
+--- linux-4.1.20.orig/arch/arm/kernel/signal.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/kernel/signal.c 2016-03-21 20:18:28.000000000 +0100
@@ -568,7 +568,8 @@
do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)
{
@@ -299,9 +599,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/kernel/signal.c linux-4.1.13/arch/arm/kerne
schedule();
} else {
if (unlikely(!user_mode(regs)))
-diff -Nur linux-4.1.13.orig/arch/arm/kernel/smp.c linux-4.1.13/arch/arm/kernel/smp.c
---- linux-4.1.13.orig/arch/arm/kernel/smp.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/kernel/smp.c 2015-11-29 09:23:09.481622687 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/kernel/smp.c linux-4.1.20/arch/arm/kernel/smp.c
+--- linux-4.1.20.orig/arch/arm/kernel/smp.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/kernel/smp.c 2016-03-21 20:18:28.000000000 +0100
@@ -213,8 +213,6 @@
flush_cache_louis();
local_flush_tlb_all();
@@ -321,9 +621,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/kernel/smp.c linux-4.1.13/arch/arm/kernel/s
pr_notice("CPU%u: shutdown\n", cpu);
/*
-diff -Nur linux-4.1.13.orig/arch/arm/kernel/unwind.c linux-4.1.13/arch/arm/kernel/unwind.c
---- linux-4.1.13.orig/arch/arm/kernel/unwind.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/kernel/unwind.c 2015-11-29 09:23:09.481622687 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/kernel/unwind.c linux-4.1.20/arch/arm/kernel/unwind.c
+--- linux-4.1.20.orig/arch/arm/kernel/unwind.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/kernel/unwind.c 2016-03-21 20:18:28.000000000 +0100
@@ -93,7 +93,7 @@
static const struct unwind_idx *__origin_unwind_idx;
extern const struct unwind_idx __stop_unwind_idx[];
@@ -375,9 +675,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/kernel/unwind.c linux-4.1.13/arch/arm/kerne
kfree(tab);
}
-diff -Nur linux-4.1.13.orig/arch/arm/kvm/arm.c linux-4.1.13/arch/arm/kvm/arm.c
---- linux-4.1.13.orig/arch/arm/kvm/arm.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/kvm/arm.c 2015-11-29 09:23:09.481622687 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/kvm/arm.c linux-4.1.20/arch/arm/kvm/arm.c
+--- linux-4.1.20.orig/arch/arm/kvm/arm.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/kvm/arm.c 2016-03-21 20:18:28.000000000 +0100
@@ -474,9 +474,9 @@
static void vcpu_pause(struct kvm_vcpu *vcpu)
@@ -390,9 +690,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/kvm/arm.c linux-4.1.13/arch/arm/kvm/arm.c
}
static int kvm_vcpu_initialized(struct kvm_vcpu *vcpu)
-diff -Nur linux-4.1.13.orig/arch/arm/kvm/psci.c linux-4.1.13/arch/arm/kvm/psci.c
---- linux-4.1.13.orig/arch/arm/kvm/psci.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/kvm/psci.c 2015-11-29 09:23:09.501621354 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/kvm/psci.c linux-4.1.20/arch/arm/kvm/psci.c
+--- linux-4.1.20.orig/arch/arm/kvm/psci.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/kvm/psci.c 2016-03-21 20:18:28.000000000 +0100
@@ -68,7 +68,7 @@
{
struct kvm *kvm = source_vcpu->kvm;
@@ -411,9 +711,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/kvm/psci.c linux-4.1.13/arch/arm/kvm/psci.c
return PSCI_RET_SUCCESS;
}
-diff -Nur linux-4.1.13.orig/arch/arm/mach-exynos/platsmp.c linux-4.1.13/arch/arm/mach-exynos/platsmp.c
---- linux-4.1.13.orig/arch/arm/mach-exynos/platsmp.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/mach-exynos/platsmp.c 2015-11-29 09:23:09.501621354 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/mach-exynos/platsmp.c linux-4.1.20/arch/arm/mach-exynos/platsmp.c
+--- linux-4.1.20.orig/arch/arm/mach-exynos/platsmp.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/mach-exynos/platsmp.c 2016-03-21 20:18:28.000000000 +0100
@@ -231,7 +231,7 @@
return (void __iomem *)(S5P_VA_SCU);
}
@@ -461,9 +761,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/mach-exynos/platsmp.c linux-4.1.13/arch/arm
return pen_release != -1 ? ret : 0;
}
-diff -Nur linux-4.1.13.orig/arch/arm/mach-hisi/platmcpm.c linux-4.1.13/arch/arm/mach-hisi/platmcpm.c
---- linux-4.1.13.orig/arch/arm/mach-hisi/platmcpm.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/mach-hisi/platmcpm.c 2015-11-29 09:23:09.501621354 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/mach-hisi/platmcpm.c linux-4.1.20/arch/arm/mach-hisi/platmcpm.c
+--- linux-4.1.20.orig/arch/arm/mach-hisi/platmcpm.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/mach-hisi/platmcpm.c 2016-03-21 20:18:28.000000000 +0100
@@ -57,7 +57,7 @@
static void __iomem *sysctrl, *fabric;
@@ -566,9 +866,20 @@ diff -Nur linux-4.1.13.orig/arch/arm/mach-hisi/platmcpm.c linux-4.1.13/arch/arm/
}
static void __naked hip04_mcpm_power_up_setup(unsigned int affinity_level)
-diff -Nur linux-4.1.13.orig/arch/arm/mach-omap2/omap-smp.c linux-4.1.13/arch/arm/mach-omap2/omap-smp.c
---- linux-4.1.13.orig/arch/arm/mach-omap2/omap-smp.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/mach-omap2/omap-smp.c 2015-11-29 09:23:09.501621354 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/mach-omap2/gpio.c linux-4.1.20/arch/arm/mach-omap2/gpio.c
+--- linux-4.1.20.orig/arch/arm/mach-omap2/gpio.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/mach-omap2/gpio.c 2016-03-21 20:18:28.000000000 +0100
+@@ -130,7 +130,6 @@
+ }
+
+ pwrdm = omap_hwmod_get_pwrdm(oh);
+- pdata->loses_context = pwrdm_can_ever_lose_context(pwrdm);
+
+ pdev = omap_device_build(name, id - 1, oh, pdata, sizeof(*pdata));
+ kfree(pdata);
+diff -Nur linux-4.1.20.orig/arch/arm/mach-omap2/omap-smp.c linux-4.1.20/arch/arm/mach-omap2/omap-smp.c
+--- linux-4.1.20.orig/arch/arm/mach-omap2/omap-smp.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/mach-omap2/omap-smp.c 2016-03-21 20:18:28.000000000 +0100
@@ -43,7 +43,7 @@
/* SCU base address */
static void __iomem *scu_base;
@@ -607,9 +918,67 @@ diff -Nur linux-4.1.13.orig/arch/arm/mach-omap2/omap-smp.c linux-4.1.13/arch/arm
return 0;
}
-diff -Nur linux-4.1.13.orig/arch/arm/mach-prima2/platsmp.c linux-4.1.13/arch/arm/mach-prima2/platsmp.c
---- linux-4.1.13.orig/arch/arm/mach-prima2/platsmp.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/mach-prima2/platsmp.c 2015-11-29 09:23:09.501621354 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/mach-omap2/powerdomain.c linux-4.1.20/arch/arm/mach-omap2/powerdomain.c
+--- linux-4.1.20.orig/arch/arm/mach-omap2/powerdomain.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/mach-omap2/powerdomain.c 2016-03-21 20:18:28.000000000 +0100
+@@ -1166,43 +1166,3 @@
+ return count;
+ }
+
+-/**
+- * pwrdm_can_ever_lose_context - can this powerdomain ever lose context?
+- * @pwrdm: struct powerdomain *
+- *
+- * Given a struct powerdomain * @pwrdm, returns 1 if the powerdomain
+- * can lose either memory or logic context or if @pwrdm is invalid, or
+- * returns 0 otherwise. This function is not concerned with how the
+- * powerdomain registers are programmed (i.e., to go off or not); it's
+- * concerned with whether it's ever possible for this powerdomain to
+- * go off while some other part of the chip is active. This function
+- * assumes that every powerdomain can go to either ON or INACTIVE.
+- */
+-bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm)
+-{
+- int i;
+-
+- if (!pwrdm) {
+- pr_debug("powerdomain: %s: invalid powerdomain pointer\n",
+- __func__);
+- return 1;
+- }
+-
+- if (pwrdm->pwrsts & PWRSTS_OFF)
+- return 1;
+-
+- if (pwrdm->pwrsts & PWRSTS_RET) {
+- if (pwrdm->pwrsts_logic_ret & PWRSTS_OFF)
+- return 1;
+-
+- for (i = 0; i < pwrdm->banks; i++)
+- if (pwrdm->pwrsts_mem_ret[i] & PWRSTS_OFF)
+- return 1;
+- }
+-
+- for (i = 0; i < pwrdm->banks; i++)
+- if (pwrdm->pwrsts_mem_on[i] & PWRSTS_OFF)
+- return 1;
+-
+- return 0;
+-}
+diff -Nur linux-4.1.20.orig/arch/arm/mach-omap2/powerdomain.h linux-4.1.20/arch/arm/mach-omap2/powerdomain.h
+--- linux-4.1.20.orig/arch/arm/mach-omap2/powerdomain.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/mach-omap2/powerdomain.h 2016-03-21 20:18:28.000000000 +0100
+@@ -244,7 +244,6 @@
+ int pwrdm_pre_transition(struct powerdomain *pwrdm);
+ int pwrdm_post_transition(struct powerdomain *pwrdm);
+ int pwrdm_get_context_loss_count(struct powerdomain *pwrdm);
+-bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm);
+
+ extern int omap_set_pwrdm_state(struct powerdomain *pwrdm, u8 state);
+
+diff -Nur linux-4.1.20.orig/arch/arm/mach-prima2/platsmp.c linux-4.1.20/arch/arm/mach-prima2/platsmp.c
+--- linux-4.1.20.orig/arch/arm/mach-prima2/platsmp.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/mach-prima2/platsmp.c 2016-03-21 20:18:28.000000000 +0100
@@ -22,7 +22,7 @@
static void __iomem *clk_base;
@@ -648,9 +1017,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/mach-prima2/platsmp.c linux-4.1.13/arch/arm
return pen_release != -1 ? -ENOSYS : 0;
}
-diff -Nur linux-4.1.13.orig/arch/arm/mach-qcom/platsmp.c linux-4.1.13/arch/arm/mach-qcom/platsmp.c
---- linux-4.1.13.orig/arch/arm/mach-qcom/platsmp.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/mach-qcom/platsmp.c 2015-11-29 09:23:09.501621354 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/mach-qcom/platsmp.c linux-4.1.20/arch/arm/mach-qcom/platsmp.c
+--- linux-4.1.20.orig/arch/arm/mach-qcom/platsmp.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/mach-qcom/platsmp.c 2016-03-21 20:18:28.000000000 +0100
@@ -46,7 +46,7 @@
extern void secondary_startup_arm(void);
@@ -689,9 +1058,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/mach-qcom/platsmp.c linux-4.1.13/arch/arm/m
return ret;
}
-diff -Nur linux-4.1.13.orig/arch/arm/mach-spear/platsmp.c linux-4.1.13/arch/arm/mach-spear/platsmp.c
---- linux-4.1.13.orig/arch/arm/mach-spear/platsmp.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/mach-spear/platsmp.c 2015-11-29 09:23:09.501621354 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/mach-spear/platsmp.c linux-4.1.20/arch/arm/mach-spear/platsmp.c
+--- linux-4.1.20.orig/arch/arm/mach-spear/platsmp.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/mach-spear/platsmp.c 2016-03-21 20:18:28.000000000 +0100
@@ -32,7 +32,7 @@
sync_cache_w(&pen_release);
}
@@ -730,9 +1099,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/mach-spear/platsmp.c linux-4.1.13/arch/arm/
return pen_release != -1 ? -ENOSYS : 0;
}
-diff -Nur linux-4.1.13.orig/arch/arm/mach-sti/platsmp.c linux-4.1.13/arch/arm/mach-sti/platsmp.c
---- linux-4.1.13.orig/arch/arm/mach-sti/platsmp.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/mach-sti/platsmp.c 2015-11-29 09:23:09.501621354 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/mach-sti/platsmp.c linux-4.1.20/arch/arm/mach-sti/platsmp.c
+--- linux-4.1.20.orig/arch/arm/mach-sti/platsmp.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/mach-sti/platsmp.c 2016-03-21 20:18:28.000000000 +0100
@@ -34,7 +34,7 @@
sync_cache_w(&pen_release);
}
@@ -771,9 +1140,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/mach-sti/platsmp.c linux-4.1.13/arch/arm/ma
return pen_release != -1 ? -ENOSYS : 0;
}
-diff -Nur linux-4.1.13.orig/arch/arm/mach-ux500/platsmp.c linux-4.1.13/arch/arm/mach-ux500/platsmp.c
---- linux-4.1.13.orig/arch/arm/mach-ux500/platsmp.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/mach-ux500/platsmp.c 2015-11-29 09:23:09.501621354 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/mach-ux500/platsmp.c linux-4.1.20/arch/arm/mach-ux500/platsmp.c
+--- linux-4.1.20.orig/arch/arm/mach-ux500/platsmp.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/mach-ux500/platsmp.c 2016-03-21 20:18:28.000000000 +0100
@@ -51,7 +51,7 @@
return NULL;
}
@@ -812,9 +1181,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/mach-ux500/platsmp.c linux-4.1.13/arch/arm/
return pen_release != -1 ? -ENOSYS : 0;
}
-diff -Nur linux-4.1.13.orig/arch/arm/mm/fault.c linux-4.1.13/arch/arm/mm/fault.c
---- linux-4.1.13.orig/arch/arm/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/mm/fault.c 2015-11-29 09:23:09.501621354 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/mm/fault.c linux-4.1.20/arch/arm/mm/fault.c
+--- linux-4.1.20.orig/arch/arm/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/mm/fault.c 2016-03-21 20:18:28.000000000 +0100
@@ -276,7 +276,7 @@
* If we're in an interrupt or have no user
* context, we must not take the fault..
@@ -844,9 +1213,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/mm/fault.c linux-4.1.13/arch/arm/mm/fault.c
do_bad_area(addr, fsr, regs);
return 0;
}
-diff -Nur linux-4.1.13.orig/arch/arm/mm/highmem.c linux-4.1.13/arch/arm/mm/highmem.c
---- linux-4.1.13.orig/arch/arm/mm/highmem.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/mm/highmem.c 2015-11-29 09:23:09.505621090 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/mm/highmem.c linux-4.1.20/arch/arm/mm/highmem.c
+--- linux-4.1.20.orig/arch/arm/mm/highmem.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/mm/highmem.c 2016-03-21 20:18:28.000000000 +0100
@@ -54,11 +54,13 @@
void *kmap_atomic(struct page *page)
@@ -949,9 +1318,9 @@ diff -Nur linux-4.1.13.orig/arch/arm/mm/highmem.c linux-4.1.13/arch/arm/mm/highm
+ }
+}
+#endif
-diff -Nur linux-4.1.13.orig/arch/arm/plat-versatile/platsmp.c linux-4.1.13/arch/arm/plat-versatile/platsmp.c
---- linux-4.1.13.orig/arch/arm/plat-versatile/platsmp.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm/plat-versatile/platsmp.c 2015-11-29 09:23:09.505621090 +0100
+diff -Nur linux-4.1.20.orig/arch/arm/plat-versatile/platsmp.c linux-4.1.20/arch/arm/plat-versatile/platsmp.c
+--- linux-4.1.20.orig/arch/arm/plat-versatile/platsmp.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm/plat-versatile/platsmp.c 2016-03-21 20:18:28.000000000 +0100
@@ -30,7 +30,7 @@
sync_cache_w(&pen_release);
}
@@ -990,9 +1359,32 @@ diff -Nur linux-4.1.13.orig/arch/arm/plat-versatile/platsmp.c linux-4.1.13/arch/
return pen_release != -1 ? -ENOSYS : 0;
}
-diff -Nur linux-4.1.13.orig/arch/arm64/include/asm/futex.h linux-4.1.13/arch/arm64/include/asm/futex.h
---- linux-4.1.13.orig/arch/arm64/include/asm/futex.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm64/include/asm/futex.h 2015-11-29 09:23:09.505621090 +0100
+diff -Nur linux-4.1.20.orig/arch/arm64/Kconfig linux-4.1.20/arch/arm64/Kconfig
+--- linux-4.1.20.orig/arch/arm64/Kconfig 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm64/Kconfig 2016-03-21 20:18:28.000000000 +0100
+@@ -69,8 +69,10 @@
+ select HAVE_PERF_REGS
+ select HAVE_PERF_USER_STACK_DUMP
+ select HAVE_RCU_TABLE_FREE
++ select HAVE_PREEMPT_LAZY
+ select HAVE_SYSCALL_TRACEPOINTS
+ select IRQ_DOMAIN
++ select IRQ_FORCED_THREADING
+ select MODULES_USE_ELF_RELA
+ select NO_BOOTMEM
+ select OF
+@@ -599,7 +601,7 @@
+
+ config XEN
+ bool "Xen guest support on ARM64"
+- depends on ARM64 && OF
++ depends on ARM64 && OF && !PREEMPT_RT_FULL
+ select SWIOTLB_XEN
+ help
+ Say Y if you want to run Linux in a Virtual Machine on Xen on ARM64.
+diff -Nur linux-4.1.20.orig/arch/arm64/include/asm/futex.h linux-4.1.20/arch/arm64/include/asm/futex.h
+--- linux-4.1.20.orig/arch/arm64/include/asm/futex.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm64/include/asm/futex.h 2016-03-21 20:18:28.000000000 +0100
@@ -58,7 +58,7 @@
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
return -EFAULT;
@@ -1011,9 +1403,9 @@ diff -Nur linux-4.1.13.orig/arch/arm64/include/asm/futex.h linux-4.1.13/arch/arm
if (!ret) {
switch (cmp) {
-diff -Nur linux-4.1.13.orig/arch/arm64/include/asm/thread_info.h linux-4.1.13/arch/arm64/include/asm/thread_info.h
---- linux-4.1.13.orig/arch/arm64/include/asm/thread_info.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm64/include/asm/thread_info.h 2015-11-29 09:23:09.505621090 +0100
+diff -Nur linux-4.1.20.orig/arch/arm64/include/asm/thread_info.h linux-4.1.20/arch/arm64/include/asm/thread_info.h
+--- linux-4.1.20.orig/arch/arm64/include/asm/thread_info.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm64/include/asm/thread_info.h 2016-03-21 20:18:28.000000000 +0100
@@ -47,6 +47,7 @@
mm_segment_t addr_limit; /* address limit */
struct task_struct *task; /* main task structure */
@@ -1038,32 +1430,9 @@ diff -Nur linux-4.1.13.orig/arch/arm64/include/asm/thread_info.h linux-4.1.13/ar
#define _TIF_NOHZ (1 << TIF_NOHZ)
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
-diff -Nur linux-4.1.13.orig/arch/arm64/Kconfig linux-4.1.13/arch/arm64/Kconfig
---- linux-4.1.13.orig/arch/arm64/Kconfig 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm64/Kconfig 2015-11-29 09:23:09.505621090 +0100
-@@ -69,8 +69,10 @@
- select HAVE_PERF_REGS
- select HAVE_PERF_USER_STACK_DUMP
- select HAVE_RCU_TABLE_FREE
-+ select HAVE_PREEMPT_LAZY
- select HAVE_SYSCALL_TRACEPOINTS
- select IRQ_DOMAIN
-+ select IRQ_FORCED_THREADING
- select MODULES_USE_ELF_RELA
- select NO_BOOTMEM
- select OF
-@@ -599,7 +601,7 @@
-
- config XEN
- bool "Xen guest support on ARM64"
-- depends on ARM64 && OF
-+ depends on ARM64 && OF && !PREEMPT_RT_FULL
- select SWIOTLB_XEN
- help
- Say Y if you want to run Linux in a Virtual Machine on Xen on ARM64.
-diff -Nur linux-4.1.13.orig/arch/arm64/kernel/asm-offsets.c linux-4.1.13/arch/arm64/kernel/asm-offsets.c
---- linux-4.1.13.orig/arch/arm64/kernel/asm-offsets.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm64/kernel/asm-offsets.c 2015-11-29 09:23:09.505621090 +0100
+diff -Nur linux-4.1.20.orig/arch/arm64/kernel/asm-offsets.c linux-4.1.20/arch/arm64/kernel/asm-offsets.c
+--- linux-4.1.20.orig/arch/arm64/kernel/asm-offsets.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm64/kernel/asm-offsets.c 2016-03-21 20:18:28.000000000 +0100
@@ -35,6 +35,7 @@
BLANK();
DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
@@ -1072,10 +1441,58 @@ diff -Nur linux-4.1.13.orig/arch/arm64/kernel/asm-offsets.c linux-4.1.13/arch/ar
DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));
DEFINE(TI_TASK, offsetof(struct thread_info, task));
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
-diff -Nur linux-4.1.13.orig/arch/arm64/kernel/debug-monitors.c linux-4.1.13/arch/arm64/kernel/debug-monitors.c
---- linux-4.1.13.orig/arch/arm64/kernel/debug-monitors.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm64/kernel/debug-monitors.c 2015-11-29 09:23:09.505621090 +0100
-@@ -271,20 +271,21 @@
+diff -Nur linux-4.1.20.orig/arch/arm64/kernel/debug-monitors.c linux-4.1.20/arch/arm64/kernel/debug-monitors.c
+--- linux-4.1.20.orig/arch/arm64/kernel/debug-monitors.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm64/kernel/debug-monitors.c 2016-03-21 20:18:28.000000000 +0100
+@@ -184,20 +184,21 @@
+
+ /* EL1 Single Step Handler hooks */
+ static LIST_HEAD(step_hook);
+-static DEFINE_RWLOCK(step_hook_lock);
++static DEFINE_SPINLOCK(step_hook_lock);
+
+ void register_step_hook(struct step_hook *hook)
+ {
+- write_lock(&step_hook_lock);
+- list_add(&hook->node, &step_hook);
+- write_unlock(&step_hook_lock);
++ spin_lock(&step_hook_lock);
++ list_add_rcu(&hook->node, &step_hook);
++ spin_unlock(&step_hook_lock);
+ }
+
+ void unregister_step_hook(struct step_hook *hook)
+ {
+- write_lock(&step_hook_lock);
+- list_del(&hook->node);
+- write_unlock(&step_hook_lock);
++ spin_lock(&step_hook_lock);
++ list_del_rcu(&hook->node);
++ spin_unlock(&step_hook_lock);
++ synchronize_rcu();
+ }
+
+ /*
+@@ -211,15 +212,15 @@
+ struct step_hook *hook;
+ int retval = DBG_HOOK_ERROR;
+
+- read_lock(&step_hook_lock);
++ rcu_read_lock();
+
+- list_for_each_entry(hook, &step_hook, node) {
++ list_for_each_entry_rcu(hook, &step_hook, node) {
+ retval = hook->fn(regs, esr);
+ if (retval == DBG_HOOK_HANDLED)
+ break;
+ }
+
+- read_unlock(&step_hook_lock);
++ rcu_read_unlock();
+
+ return retval;
+ }
+@@ -271,20 +272,21 @@
* Use reader/writer locks instead of plain spinlock.
*/
static LIST_HEAD(break_hook);
@@ -1104,7 +1521,7 @@ diff -Nur linux-4.1.13.orig/arch/arm64/kernel/debug-monitors.c linux-4.1.13/arch
}
static int call_break_hook(struct pt_regs *regs, unsigned int esr)
-@@ -292,11 +293,11 @@
+@@ -292,11 +294,11 @@
struct break_hook *hook;
int (*fn)(struct pt_regs *regs, unsigned int esr) = NULL;
@@ -1119,9 +1536,9 @@ diff -Nur linux-4.1.13.orig/arch/arm64/kernel/debug-monitors.c linux-4.1.13/arch
return fn ? fn(regs, esr) : DBG_HOOK_ERROR;
}
-diff -Nur linux-4.1.13.orig/arch/arm64/kernel/entry.S linux-4.1.13/arch/arm64/kernel/entry.S
---- linux-4.1.13.orig/arch/arm64/kernel/entry.S 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm64/kernel/entry.S 2015-11-29 09:23:09.505621090 +0100
+diff -Nur linux-4.1.20.orig/arch/arm64/kernel/entry.S linux-4.1.20/arch/arm64/kernel/entry.S
+--- linux-4.1.20.orig/arch/arm64/kernel/entry.S 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm64/kernel/entry.S 2016-03-21 20:18:28.000000000 +0100
@@ -367,11 +367,16 @@
#ifdef CONFIG_PREEMPT
get_thread_info tsk
@@ -1158,9 +1575,9 @@ diff -Nur linux-4.1.13.orig/arch/arm64/kernel/entry.S linux-4.1.13/arch/arm64/ke
/* TIF_SIGPENDING, TIF_NOTIFY_RESUME or TIF_FOREIGN_FPSTATE case */
ldr x2, [sp, #S_PSTATE]
mov x0, sp // 'regs'
-diff -Nur linux-4.1.13.orig/arch/arm64/kernel/insn.c linux-4.1.13/arch/arm64/kernel/insn.c
---- linux-4.1.13.orig/arch/arm64/kernel/insn.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm64/kernel/insn.c 2015-11-29 09:23:09.505621090 +0100
+diff -Nur linux-4.1.20.orig/arch/arm64/kernel/insn.c linux-4.1.20/arch/arm64/kernel/insn.c
+--- linux-4.1.20.orig/arch/arm64/kernel/insn.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm64/kernel/insn.c 2016-03-21 20:18:28.000000000 +0100
@@ -77,7 +77,7 @@
}
}
@@ -1186,9 +1603,9 @@ diff -Nur linux-4.1.13.orig/arch/arm64/kernel/insn.c linux-4.1.13/arch/arm64/ker
return ret;
}
-diff -Nur linux-4.1.13.orig/arch/arm64/kernel/perf_event.c linux-4.1.13/arch/arm64/kernel/perf_event.c
---- linux-4.1.13.orig/arch/arm64/kernel/perf_event.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm64/kernel/perf_event.c 2015-11-29 09:23:09.505621090 +0100
+diff -Nur linux-4.1.20.orig/arch/arm64/kernel/perf_event.c linux-4.1.20/arch/arm64/kernel/perf_event.c
+--- linux-4.1.20.orig/arch/arm64/kernel/perf_event.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm64/kernel/perf_event.c 2016-03-21 20:18:28.000000000 +0100
@@ -488,7 +488,7 @@
}
@@ -1198,9 +1615,9 @@ diff -Nur linux-4.1.13.orig/arch/arm64/kernel/perf_event.c linux-4.1.13/arch/arm
"arm-pmu", armpmu);
if (err) {
pr_err("unable to request IRQ%d for ARM PMU counters\n",
-diff -Nur linux-4.1.13.orig/arch/arm64/mm/fault.c linux-4.1.13/arch/arm64/mm/fault.c
---- linux-4.1.13.orig/arch/arm64/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/arm64/mm/fault.c 2015-11-29 09:23:09.505621090 +0100
+diff -Nur linux-4.1.20.orig/arch/arm64/mm/fault.c linux-4.1.20/arch/arm64/mm/fault.c
+--- linux-4.1.20.orig/arch/arm64/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/arm64/mm/fault.c 2016-03-21 20:18:28.000000000 +0100
@@ -211,7 +211,7 @@
* If we're in an interrupt or have no user context, we must not take
* the fault.
@@ -1210,9 +1627,9 @@ diff -Nur linux-4.1.13.orig/arch/arm64/mm/fault.c linux-4.1.13/arch/arm64/mm/fau
goto no_context;
if (user_mode(regs))
-diff -Nur linux-4.1.13.orig/arch/avr32/include/asm/uaccess.h linux-4.1.13/arch/avr32/include/asm/uaccess.h
---- linux-4.1.13.orig/arch/avr32/include/asm/uaccess.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/avr32/include/asm/uaccess.h 2015-11-29 09:23:09.505621090 +0100
+diff -Nur linux-4.1.20.orig/arch/avr32/include/asm/uaccess.h linux-4.1.20/arch/avr32/include/asm/uaccess.h
+--- linux-4.1.20.orig/arch/avr32/include/asm/uaccess.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/avr32/include/asm/uaccess.h 2016-03-21 20:18:28.000000000 +0100
@@ -97,7 +97,8 @@
* @x: Value to copy to user space.
* @ptr: Destination address, in user space.
@@ -1253,9 +1670,9 @@ diff -Nur linux-4.1.13.orig/arch/avr32/include/asm/uaccess.h linux-4.1.13/arch/a
*
* This macro copies a single simple variable from user space to kernel
* space. It supports simple types like char and int, but not larger
-diff -Nur linux-4.1.13.orig/arch/avr32/mm/fault.c linux-4.1.13/arch/avr32/mm/fault.c
---- linux-4.1.13.orig/arch/avr32/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/avr32/mm/fault.c 2015-11-29 09:23:09.505621090 +0100
+diff -Nur linux-4.1.20.orig/arch/avr32/mm/fault.c linux-4.1.20/arch/avr32/mm/fault.c
+--- linux-4.1.20.orig/arch/avr32/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/avr32/mm/fault.c 2016-03-21 20:18:28.000000000 +0100
@@ -14,11 +14,11 @@
#include <linux/pagemap.h>
#include <linux/kdebug.h>
@@ -1278,9 +1695,9 @@ diff -Nur linux-4.1.13.orig/arch/avr32/mm/fault.c linux-4.1.13/arch/avr32/mm/fau
goto no_context;
local_irq_enable();
-diff -Nur linux-4.1.13.orig/arch/cris/mm/fault.c linux-4.1.13/arch/cris/mm/fault.c
---- linux-4.1.13.orig/arch/cris/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/cris/mm/fault.c 2015-11-29 09:23:09.505621090 +0100
+diff -Nur linux-4.1.20.orig/arch/cris/mm/fault.c linux-4.1.20/arch/cris/mm/fault.c
+--- linux-4.1.20.orig/arch/cris/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/cris/mm/fault.c 2016-03-21 20:18:28.000000000 +0100
@@ -8,7 +8,7 @@
#include <linux/interrupt.h>
#include <linux/module.h>
@@ -1304,9 +1721,9 @@ diff -Nur linux-4.1.13.orig/arch/cris/mm/fault.c linux-4.1.13/arch/cris/mm/fault
goto no_context;
if (user_mode(regs))
-diff -Nur linux-4.1.13.orig/arch/frv/mm/fault.c linux-4.1.13/arch/frv/mm/fault.c
---- linux-4.1.13.orig/arch/frv/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/frv/mm/fault.c 2015-11-29 09:23:09.505621090 +0100
+diff -Nur linux-4.1.20.orig/arch/frv/mm/fault.c linux-4.1.20/arch/frv/mm/fault.c
+--- linux-4.1.20.orig/arch/frv/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/frv/mm/fault.c 2016-03-21 20:18:28.000000000 +0100
@@ -19,9 +19,9 @@
#include <linux/kernel.h>
#include <linux/ptrace.h>
@@ -1327,9 +1744,9 @@ diff -Nur linux-4.1.13.orig/arch/frv/mm/fault.c linux-4.1.13/arch/frv/mm/fault.c
goto no_context;
if (user_mode(__frame))
-diff -Nur linux-4.1.13.orig/arch/frv/mm/highmem.c linux-4.1.13/arch/frv/mm/highmem.c
---- linux-4.1.13.orig/arch/frv/mm/highmem.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/frv/mm/highmem.c 2015-11-29 09:23:09.505621090 +0100
+diff -Nur linux-4.1.20.orig/arch/frv/mm/highmem.c linux-4.1.20/arch/frv/mm/highmem.c
+--- linux-4.1.20.orig/arch/frv/mm/highmem.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/frv/mm/highmem.c 2016-03-21 20:18:28.000000000 +0100
@@ -42,6 +42,7 @@
unsigned long paddr;
int type;
@@ -1345,9 +1762,9 @@ diff -Nur linux-4.1.13.orig/arch/frv/mm/highmem.c linux-4.1.13/arch/frv/mm/highm
+ preempt_enable();
}
EXPORT_SYMBOL(__kunmap_atomic);
-diff -Nur linux-4.1.13.orig/arch/hexagon/include/asm/uaccess.h linux-4.1.13/arch/hexagon/include/asm/uaccess.h
---- linux-4.1.13.orig/arch/hexagon/include/asm/uaccess.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/hexagon/include/asm/uaccess.h 2015-11-29 09:23:09.505621090 +0100
+diff -Nur linux-4.1.20.orig/arch/hexagon/include/asm/uaccess.h linux-4.1.20/arch/hexagon/include/asm/uaccess.h
+--- linux-4.1.20.orig/arch/hexagon/include/asm/uaccess.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/hexagon/include/asm/uaccess.h 2016-03-21 20:18:28.000000000 +0100
@@ -36,7 +36,8 @@
* @addr: User space pointer to start of block to check
* @size: Size of block to check
@@ -1358,9 +1775,9 @@ diff -Nur linux-4.1.13.orig/arch/hexagon/include/asm/uaccess.h linux-4.1.13/arch
*
* Checks if a pointer to a block of memory in user space is valid.
*
-diff -Nur linux-4.1.13.orig/arch/ia64/mm/fault.c linux-4.1.13/arch/ia64/mm/fault.c
---- linux-4.1.13.orig/arch/ia64/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/ia64/mm/fault.c 2015-11-29 09:23:09.505621090 +0100
+diff -Nur linux-4.1.20.orig/arch/ia64/mm/fault.c linux-4.1.20/arch/ia64/mm/fault.c
+--- linux-4.1.20.orig/arch/ia64/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/ia64/mm/fault.c 2016-03-21 20:18:28.000000000 +0100
@@ -11,10 +11,10 @@
#include <linux/kprobes.h>
#include <linux/kdebug.h>
@@ -1382,20 +1799,9 @@ diff -Nur linux-4.1.13.orig/arch/ia64/mm/fault.c linux-4.1.13/arch/ia64/mm/fault
goto no_context;
#ifdef CONFIG_VIRTUAL_MEM_MAP
-diff -Nur linux-4.1.13.orig/arch/Kconfig linux-4.1.13/arch/Kconfig
---- linux-4.1.13.orig/arch/Kconfig 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/Kconfig 2015-11-29 09:23:09.477622951 +0100
-@@ -6,6 +6,7 @@
- tristate "OProfile system profiling"
- depends on PROFILING
- depends on HAVE_OPROFILE
-+ depends on !PREEMPT_RT_FULL
- select RING_BUFFER
- select RING_BUFFER_ALLOW_SWAP
- help
-diff -Nur linux-4.1.13.orig/arch/m32r/include/asm/uaccess.h linux-4.1.13/arch/m32r/include/asm/uaccess.h
---- linux-4.1.13.orig/arch/m32r/include/asm/uaccess.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/m32r/include/asm/uaccess.h 2015-11-29 09:23:09.509620826 +0100
+diff -Nur linux-4.1.20.orig/arch/m32r/include/asm/uaccess.h linux-4.1.20/arch/m32r/include/asm/uaccess.h
+--- linux-4.1.20.orig/arch/m32r/include/asm/uaccess.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/m32r/include/asm/uaccess.h 2016-03-21 20:18:29.000000000 +0100
@@ -91,7 +91,8 @@
* @addr: User space pointer to start of block to check
* @size: Size of block to check
@@ -1496,9 +1902,9 @@ diff -Nur linux-4.1.13.orig/arch/m32r/include/asm/uaccess.h linux-4.1.13/arch/m3
*
* Get the size of a NUL-terminated string in user space.
*
-diff -Nur linux-4.1.13.orig/arch/m32r/mm/fault.c linux-4.1.13/arch/m32r/mm/fault.c
---- linux-4.1.13.orig/arch/m32r/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/m32r/mm/fault.c 2015-11-29 09:23:09.509620826 +0100
+diff -Nur linux-4.1.20.orig/arch/m32r/mm/fault.c linux-4.1.20/arch/m32r/mm/fault.c
+--- linux-4.1.20.orig/arch/m32r/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/m32r/mm/fault.c 2016-03-21 20:18:29.000000000 +0100
@@ -24,9 +24,9 @@
#include <linux/vt_kern.h> /* For unblank_screen() */
#include <linux/highmem.h>
@@ -1524,9 +1930,9 @@ diff -Nur linux-4.1.13.orig/arch/m32r/mm/fault.c linux-4.1.13/arch/m32r/mm/fault
goto bad_area_nosemaphore;
if (error_code & ACE_USERMODE)
-diff -Nur linux-4.1.13.orig/arch/m68k/mm/fault.c linux-4.1.13/arch/m68k/mm/fault.c
---- linux-4.1.13.orig/arch/m68k/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/m68k/mm/fault.c 2015-11-29 09:23:09.509620826 +0100
+diff -Nur linux-4.1.20.orig/arch/m68k/mm/fault.c linux-4.1.20/arch/m68k/mm/fault.c
+--- linux-4.1.20.orig/arch/m68k/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/m68k/mm/fault.c 2016-03-21 20:18:29.000000000 +0100
@@ -10,10 +10,10 @@
#include <linux/ptrace.h>
#include <linux/interrupt.h>
@@ -1548,9 +1954,9 @@ diff -Nur linux-4.1.13.orig/arch/m68k/mm/fault.c linux-4.1.13/arch/m68k/mm/fault
goto no_context;
if (user_mode(regs))
-diff -Nur linux-4.1.13.orig/arch/metag/mm/fault.c linux-4.1.13/arch/metag/mm/fault.c
---- linux-4.1.13.orig/arch/metag/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/metag/mm/fault.c 2015-11-29 09:23:09.509620826 +0100
+diff -Nur linux-4.1.20.orig/arch/metag/mm/fault.c linux-4.1.20/arch/metag/mm/fault.c
+--- linux-4.1.20.orig/arch/metag/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/metag/mm/fault.c 2016-03-21 20:18:29.000000000 +0100
@@ -105,7 +105,7 @@
mm = tsk->mm;
@@ -1560,9 +1966,9 @@ diff -Nur linux-4.1.13.orig/arch/metag/mm/fault.c linux-4.1.13/arch/metag/mm/fau
goto no_context;
if (user_mode(regs))
-diff -Nur linux-4.1.13.orig/arch/metag/mm/highmem.c linux-4.1.13/arch/metag/mm/highmem.c
---- linux-4.1.13.orig/arch/metag/mm/highmem.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/metag/mm/highmem.c 2015-11-29 09:23:09.509620826 +0100
+diff -Nur linux-4.1.20.orig/arch/metag/mm/highmem.c linux-4.1.20/arch/metag/mm/highmem.c
+--- linux-4.1.20.orig/arch/metag/mm/highmem.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/metag/mm/highmem.c 2016-03-21 20:18:29.000000000 +0100
@@ -43,7 +43,7 @@
unsigned long vaddr;
int type;
@@ -1588,9 +1994,9 @@ diff -Nur linux-4.1.13.orig/arch/metag/mm/highmem.c linux-4.1.13/arch/metag/mm/h
pagefault_disable();
type = kmap_atomic_idx_push();
-diff -Nur linux-4.1.13.orig/arch/microblaze/include/asm/uaccess.h linux-4.1.13/arch/microblaze/include/asm/uaccess.h
---- linux-4.1.13.orig/arch/microblaze/include/asm/uaccess.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/microblaze/include/asm/uaccess.h 2015-11-29 09:23:09.509620826 +0100
+diff -Nur linux-4.1.20.orig/arch/microblaze/include/asm/uaccess.h linux-4.1.20/arch/microblaze/include/asm/uaccess.h
+--- linux-4.1.20.orig/arch/microblaze/include/asm/uaccess.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/microblaze/include/asm/uaccess.h 2016-03-21 20:18:29.000000000 +0100
@@ -178,7 +178,8 @@
* @x: Variable to store result.
* @ptr: Source address, in user space.
@@ -1611,9 +2017,9 @@ diff -Nur linux-4.1.13.orig/arch/microblaze/include/asm/uaccess.h linux-4.1.13/a
*
* This macro copies a single simple value from kernel space to user
* space. It supports simple types like char and int, but not larger
-diff -Nur linux-4.1.13.orig/arch/microblaze/mm/fault.c linux-4.1.13/arch/microblaze/mm/fault.c
---- linux-4.1.13.orig/arch/microblaze/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/microblaze/mm/fault.c 2015-11-29 09:23:09.509620826 +0100
+diff -Nur linux-4.1.20.orig/arch/microblaze/mm/fault.c linux-4.1.20/arch/microblaze/mm/fault.c
+--- linux-4.1.20.orig/arch/microblaze/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/microblaze/mm/fault.c 2016-03-21 20:18:29.000000000 +0100
@@ -107,14 +107,14 @@
if ((error_code & 0x13) == 0x13 || (error_code & 0x11) == 0x11)
is_write = 0;
@@ -1633,9 +2039,9 @@ diff -Nur linux-4.1.13.orig/arch/microblaze/mm/fault.c linux-4.1.13/arch/microbl
pr_emerg("r15 = %lx MSR = %lx\n",
regs->r15, regs->msr);
die("Weird page fault", regs, SIGSEGV);
-diff -Nur linux-4.1.13.orig/arch/microblaze/mm/highmem.c linux-4.1.13/arch/microblaze/mm/highmem.c
---- linux-4.1.13.orig/arch/microblaze/mm/highmem.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/microblaze/mm/highmem.c 2015-11-29 09:23:09.509620826 +0100
+diff -Nur linux-4.1.20.orig/arch/microblaze/mm/highmem.c linux-4.1.20/arch/microblaze/mm/highmem.c
+--- linux-4.1.20.orig/arch/microblaze/mm/highmem.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/microblaze/mm/highmem.c 2016-03-21 20:18:29.000000000 +0100
@@ -37,7 +37,7 @@
unsigned long vaddr;
int idx, type;
@@ -1660,9 +2066,21 @@ diff -Nur linux-4.1.13.orig/arch/microblaze/mm/highmem.c linux-4.1.13/arch/micro
+ preempt_enable();
}
EXPORT_SYMBOL(__kunmap_atomic);
-diff -Nur linux-4.1.13.orig/arch/mips/include/asm/uaccess.h linux-4.1.13/arch/mips/include/asm/uaccess.h
---- linux-4.1.13.orig/arch/mips/include/asm/uaccess.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/mips/include/asm/uaccess.h 2015-11-29 09:23:09.513620562 +0100
+diff -Nur linux-4.1.20.orig/arch/mips/Kconfig linux-4.1.20/arch/mips/Kconfig
+--- linux-4.1.20.orig/arch/mips/Kconfig 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/mips/Kconfig 2016-03-21 20:18:29.000000000 +0100
+@@ -2366,7 +2366,7 @@
+ #
+ config HIGHMEM
+ bool "High Memory Support"
+- depends on 32BIT && CPU_SUPPORTS_HIGHMEM && SYS_SUPPORTS_HIGHMEM && !CPU_MIPS32_3_5_EVA
++ depends on 32BIT && CPU_SUPPORTS_HIGHMEM && SYS_SUPPORTS_HIGHMEM && !CPU_MIPS32_3_5_EVA && !PREEMPT_RT_FULL
+
+ config CPU_SUPPORTS_HIGHMEM
+ bool
+diff -Nur linux-4.1.20.orig/arch/mips/include/asm/uaccess.h linux-4.1.20/arch/mips/include/asm/uaccess.h
+--- linux-4.1.20.orig/arch/mips/include/asm/uaccess.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/mips/include/asm/uaccess.h 2016-03-21 20:18:29.000000000 +0100
@@ -103,7 +103,8 @@
* @addr: User space pointer to start of block to check
* @size: Size of block to check
@@ -1813,21 +2231,9 @@ diff -Nur linux-4.1.13.orig/arch/mips/include/asm/uaccess.h linux-4.1.13/arch/mi
*
* Get the size of a NUL-terminated string in user space.
*
-diff -Nur linux-4.1.13.orig/arch/mips/Kconfig linux-4.1.13/arch/mips/Kconfig
---- linux-4.1.13.orig/arch/mips/Kconfig 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/mips/Kconfig 2015-11-29 09:23:09.513620562 +0100
-@@ -2366,7 +2366,7 @@
- #
- config HIGHMEM
- bool "High Memory Support"
-- depends on 32BIT && CPU_SUPPORTS_HIGHMEM && SYS_SUPPORTS_HIGHMEM && !CPU_MIPS32_3_5_EVA
-+ depends on 32BIT && CPU_SUPPORTS_HIGHMEM && SYS_SUPPORTS_HIGHMEM && !CPU_MIPS32_3_5_EVA && !PREEMPT_RT_FULL
-
- config CPU_SUPPORTS_HIGHMEM
- bool
-diff -Nur linux-4.1.13.orig/arch/mips/kernel/signal-common.h linux-4.1.13/arch/mips/kernel/signal-common.h
---- linux-4.1.13.orig/arch/mips/kernel/signal-common.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/mips/kernel/signal-common.h 2015-11-29 09:23:09.513620562 +0100
+diff -Nur linux-4.1.20.orig/arch/mips/kernel/signal-common.h linux-4.1.20/arch/mips/kernel/signal-common.h
+--- linux-4.1.20.orig/arch/mips/kernel/signal-common.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/mips/kernel/signal-common.h 2016-03-21 20:18:29.000000000 +0100
@@ -28,12 +28,7 @@
extern int fpcsr_pending(unsigned int __user *fpcsr);
@@ -1843,9 +2249,9 @@ diff -Nur linux-4.1.13.orig/arch/mips/kernel/signal-common.h linux-4.1.13/arch/m
+#define unlock_fpu_owner() ({ pagefault_enable(); preempt_enable(); })
#endif /* __SIGNAL_COMMON_H */
-diff -Nur linux-4.1.13.orig/arch/mips/mm/fault.c linux-4.1.13/arch/mips/mm/fault.c
---- linux-4.1.13.orig/arch/mips/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/mips/mm/fault.c 2015-11-29 09:23:09.513620562 +0100
+diff -Nur linux-4.1.20.orig/arch/mips/mm/fault.c linux-4.1.20/arch/mips/mm/fault.c
+--- linux-4.1.20.orig/arch/mips/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/mips/mm/fault.c 2016-03-21 20:18:29.000000000 +0100
@@ -21,10 +21,10 @@
#include <linux/module.h>
#include <linux/kprobes.h>
@@ -1867,9 +2273,9 @@ diff -Nur linux-4.1.13.orig/arch/mips/mm/fault.c linux-4.1.13/arch/mips/mm/fault
goto bad_area_nosemaphore;
if (user_mode(regs))
-diff -Nur linux-4.1.13.orig/arch/mips/mm/highmem.c linux-4.1.13/arch/mips/mm/highmem.c
---- linux-4.1.13.orig/arch/mips/mm/highmem.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/mips/mm/highmem.c 2015-11-29 09:23:09.513620562 +0100
+diff -Nur linux-4.1.20.orig/arch/mips/mm/highmem.c linux-4.1.20/arch/mips/mm/highmem.c
+--- linux-4.1.20.orig/arch/mips/mm/highmem.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/mips/mm/highmem.c 2016-03-21 20:18:29.000000000 +0100
@@ -47,7 +47,7 @@
unsigned long vaddr;
int idx, type;
@@ -1903,9 +2309,9 @@ diff -Nur linux-4.1.13.orig/arch/mips/mm/highmem.c linux-4.1.13/arch/mips/mm/hig
pagefault_disable();
type = kmap_atomic_idx_push();
-diff -Nur linux-4.1.13.orig/arch/mips/mm/init.c linux-4.1.13/arch/mips/mm/init.c
---- linux-4.1.13.orig/arch/mips/mm/init.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/mips/mm/init.c 2015-11-29 09:23:09.513620562 +0100
+diff -Nur linux-4.1.20.orig/arch/mips/mm/init.c linux-4.1.20/arch/mips/mm/init.c
+--- linux-4.1.20.orig/arch/mips/mm/init.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/mips/mm/init.c 2016-03-21 20:18:29.000000000 +0100
@@ -90,6 +90,7 @@
BUG_ON(Page_dcache_dirty(page));
@@ -1922,9 +2328,9 @@ diff -Nur linux-4.1.13.orig/arch/mips/mm/init.c linux-4.1.13/arch/mips/mm/init.c
}
void copy_user_highpage(struct page *to, struct page *from,
-diff -Nur linux-4.1.13.orig/arch/mn10300/include/asm/highmem.h linux-4.1.13/arch/mn10300/include/asm/highmem.h
---- linux-4.1.13.orig/arch/mn10300/include/asm/highmem.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/mn10300/include/asm/highmem.h 2015-11-29 09:23:09.513620562 +0100
+diff -Nur linux-4.1.20.orig/arch/mn10300/include/asm/highmem.h linux-4.1.20/arch/mn10300/include/asm/highmem.h
+--- linux-4.1.20.orig/arch/mn10300/include/asm/highmem.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/mn10300/include/asm/highmem.h 2016-03-21 20:18:29.000000000 +0100
@@ -75,6 +75,7 @@
unsigned long vaddr;
int idx, type;
@@ -1949,9 +2355,9 @@ diff -Nur linux-4.1.13.orig/arch/mn10300/include/asm/highmem.h linux-4.1.13/arch
}
#endif /* __KERNEL__ */
-diff -Nur linux-4.1.13.orig/arch/mn10300/mm/fault.c linux-4.1.13/arch/mn10300/mm/fault.c
---- linux-4.1.13.orig/arch/mn10300/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/mn10300/mm/fault.c 2015-11-29 09:23:09.513620562 +0100
+diff -Nur linux-4.1.20.orig/arch/mn10300/mm/fault.c linux-4.1.20/arch/mn10300/mm/fault.c
+--- linux-4.1.20.orig/arch/mn10300/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/mn10300/mm/fault.c 2016-03-21 20:18:29.000000000 +0100
@@ -23,8 +23,8 @@
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -1971,9 +2377,9 @@ diff -Nur linux-4.1.13.orig/arch/mn10300/mm/fault.c linux-4.1.13/arch/mn10300/mm
goto no_context;
if ((fault_code & MMUFCR_xFC_ACCESS) == MMUFCR_xFC_ACCESS_USR)
-diff -Nur linux-4.1.13.orig/arch/nios2/mm/fault.c linux-4.1.13/arch/nios2/mm/fault.c
---- linux-4.1.13.orig/arch/nios2/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/nios2/mm/fault.c 2015-11-29 09:23:09.513620562 +0100
+diff -Nur linux-4.1.20.orig/arch/nios2/mm/fault.c linux-4.1.20/arch/nios2/mm/fault.c
+--- linux-4.1.20.orig/arch/nios2/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/nios2/mm/fault.c 2016-03-21 20:18:29.000000000 +0100
@@ -77,7 +77,7 @@
* If we're in an interrupt or have no user
* context, we must not take the fault..
@@ -1983,9 +2389,9 @@ diff -Nur linux-4.1.13.orig/arch/nios2/mm/fault.c linux-4.1.13/arch/nios2/mm/fau
goto bad_area_nosemaphore;
if (user_mode(regs))
-diff -Nur linux-4.1.13.orig/arch/parisc/include/asm/cacheflush.h linux-4.1.13/arch/parisc/include/asm/cacheflush.h
---- linux-4.1.13.orig/arch/parisc/include/asm/cacheflush.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/parisc/include/asm/cacheflush.h 2015-11-29 09:23:09.513620562 +0100
+diff -Nur linux-4.1.20.orig/arch/parisc/include/asm/cacheflush.h linux-4.1.20/arch/parisc/include/asm/cacheflush.h
+--- linux-4.1.20.orig/arch/parisc/include/asm/cacheflush.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/parisc/include/asm/cacheflush.h 2016-03-21 20:18:29.000000000 +0100
@@ -142,6 +142,7 @@
static inline void *kmap_atomic(struct page *page)
@@ -2002,9 +2408,9 @@ diff -Nur linux-4.1.13.orig/arch/parisc/include/asm/cacheflush.h linux-4.1.13/ar
}
#define kmap_atomic_prot(page, prot) kmap_atomic(page)
-diff -Nur linux-4.1.13.orig/arch/parisc/kernel/traps.c linux-4.1.13/arch/parisc/kernel/traps.c
---- linux-4.1.13.orig/arch/parisc/kernel/traps.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/parisc/kernel/traps.c 2015-11-29 09:23:09.513620562 +0100
+diff -Nur linux-4.1.20.orig/arch/parisc/kernel/traps.c linux-4.1.20/arch/parisc/kernel/traps.c
+--- linux-4.1.20.orig/arch/parisc/kernel/traps.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/parisc/kernel/traps.c 2016-03-21 20:18:29.000000000 +0100
@@ -26,9 +26,9 @@
#include <linux/console.h>
#include <linux/bug.h>
@@ -2025,9 +2431,9 @@ diff -Nur linux-4.1.13.orig/arch/parisc/kernel/traps.c linux-4.1.13/arch/parisc/
{
pdc_chassis_send_status(PDC_CHASSIS_DIRECT_PANIC);
parisc_terminate("Kernel Fault", regs, code, fault_address);
-diff -Nur linux-4.1.13.orig/arch/parisc/mm/fault.c linux-4.1.13/arch/parisc/mm/fault.c
---- linux-4.1.13.orig/arch/parisc/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/parisc/mm/fault.c 2015-11-29 09:23:09.513620562 +0100
+diff -Nur linux-4.1.20.orig/arch/parisc/mm/fault.c linux-4.1.20/arch/parisc/mm/fault.c
+--- linux-4.1.20.orig/arch/parisc/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/parisc/mm/fault.c 2016-03-21 20:18:29.000000000 +0100
@@ -15,8 +15,8 @@
#include <linux/sched.h>
#include <linux/interrupt.h>
@@ -2047,9 +2453,42 @@ diff -Nur linux-4.1.13.orig/arch/parisc/mm/fault.c linux-4.1.13/arch/parisc/mm/f
goto no_context;
tsk = current;
-diff -Nur linux-4.1.13.orig/arch/powerpc/include/asm/kvm_host.h linux-4.1.13/arch/powerpc/include/asm/kvm_host.h
---- linux-4.1.13.orig/arch/powerpc/include/asm/kvm_host.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/powerpc/include/asm/kvm_host.h 2015-11-29 09:23:09.517620297 +0100
+diff -Nur linux-4.1.20.orig/arch/powerpc/Kconfig linux-4.1.20/arch/powerpc/Kconfig
+--- linux-4.1.20.orig/arch/powerpc/Kconfig 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/powerpc/Kconfig 2016-03-21 20:18:29.000000000 +0100
+@@ -60,10 +60,11 @@
+
+ config RWSEM_GENERIC_SPINLOCK
+ bool
++ default y if PREEMPT_RT_FULL
+
+ config RWSEM_XCHGADD_ALGORITHM
+ bool
+- default y
++ default y if !PREEMPT_RT_FULL
+
+ config GENERIC_LOCKBREAK
+ bool
+@@ -138,6 +139,7 @@
+ select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
+ select GENERIC_STRNCPY_FROM_USER
+ select GENERIC_STRNLEN_USER
++ select HAVE_PREEMPT_LAZY
+ select HAVE_MOD_ARCH_SPECIFIC
+ select MODULES_USE_ELF_RELA
+ select CLONE_BACKWARDS
+@@ -312,7 +314,7 @@
+
+ config HIGHMEM
+ bool "High memory support"
+- depends on PPC32
++ depends on PPC32 && !PREEMPT_RT_FULL
+
+ source kernel/Kconfig.hz
+ source kernel/Kconfig.preempt
+diff -Nur linux-4.1.20.orig/arch/powerpc/include/asm/kvm_host.h linux-4.1.20/arch/powerpc/include/asm/kvm_host.h
+--- linux-4.1.20.orig/arch/powerpc/include/asm/kvm_host.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/powerpc/include/asm/kvm_host.h 2016-03-21 20:18:29.000000000 +0100
@@ -280,7 +280,7 @@
u8 in_guest;
struct list_head runnable_threads;
@@ -2068,9 +2507,9 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/include/asm/kvm_host.h linux-4.1.13/arc
struct kvmppc_vcore *vcore;
int ret;
int trap;
-diff -Nur linux-4.1.13.orig/arch/powerpc/include/asm/thread_info.h linux-4.1.13/arch/powerpc/include/asm/thread_info.h
---- linux-4.1.13.orig/arch/powerpc/include/asm/thread_info.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/powerpc/include/asm/thread_info.h 2015-11-29 09:23:09.517620297 +0100
+diff -Nur linux-4.1.20.orig/arch/powerpc/include/asm/thread_info.h linux-4.1.20/arch/powerpc/include/asm/thread_info.h
+--- linux-4.1.20.orig/arch/powerpc/include/asm/thread_info.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/powerpc/include/asm/thread_info.h 2016-03-21 20:18:29.000000000 +0100
@@ -42,6 +42,8 @@
int cpu; /* cpu we're on */
int preempt_count; /* 0 => preemptable,
@@ -2117,42 +2556,9 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/include/asm/thread_info.h linux-4.1.13/
/* Bits in local_flags */
/* Don't move TLF_NAPPING without adjusting the code in entry_32.S */
-diff -Nur linux-4.1.13.orig/arch/powerpc/Kconfig linux-4.1.13/arch/powerpc/Kconfig
---- linux-4.1.13.orig/arch/powerpc/Kconfig 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/powerpc/Kconfig 2015-11-29 09:23:09.513620562 +0100
-@@ -60,10 +60,11 @@
-
- config RWSEM_GENERIC_SPINLOCK
- bool
-+ default y if PREEMPT_RT_FULL
-
- config RWSEM_XCHGADD_ALGORITHM
- bool
-- default y
-+ default y if !PREEMPT_RT_FULL
-
- config GENERIC_LOCKBREAK
- bool
-@@ -138,6 +139,7 @@
- select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
- select GENERIC_STRNCPY_FROM_USER
- select GENERIC_STRNLEN_USER
-+ select HAVE_PREEMPT_LAZY
- select HAVE_MOD_ARCH_SPECIFIC
- select MODULES_USE_ELF_RELA
- select CLONE_BACKWARDS
-@@ -312,7 +314,7 @@
-
- config HIGHMEM
- bool "High memory support"
-- depends on PPC32
-+ depends on PPC32 && !PREEMPT_RT_FULL
-
- source kernel/Kconfig.hz
- source kernel/Kconfig.preempt
-diff -Nur linux-4.1.13.orig/arch/powerpc/kernel/asm-offsets.c linux-4.1.13/arch/powerpc/kernel/asm-offsets.c
---- linux-4.1.13.orig/arch/powerpc/kernel/asm-offsets.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/powerpc/kernel/asm-offsets.c 2015-11-29 09:23:09.517620297 +0100
+diff -Nur linux-4.1.20.orig/arch/powerpc/kernel/asm-offsets.c linux-4.1.20/arch/powerpc/kernel/asm-offsets.c
+--- linux-4.1.20.orig/arch/powerpc/kernel/asm-offsets.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/powerpc/kernel/asm-offsets.c 2016-03-21 20:18:29.000000000 +0100
@@ -160,6 +160,7 @@
DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags));
@@ -2161,9 +2567,9 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/kernel/asm-offsets.c linux-4.1.13/arch/
DEFINE(TI_TASK, offsetof(struct thread_info, task));
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
-diff -Nur linux-4.1.13.orig/arch/powerpc/kernel/entry_32.S linux-4.1.13/arch/powerpc/kernel/entry_32.S
---- linux-4.1.13.orig/arch/powerpc/kernel/entry_32.S 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/powerpc/kernel/entry_32.S 2015-11-29 09:23:09.517620297 +0100
+diff -Nur linux-4.1.20.orig/arch/powerpc/kernel/entry_32.S linux-4.1.20/arch/powerpc/kernel/entry_32.S
+--- linux-4.1.20.orig/arch/powerpc/kernel/entry_32.S 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/powerpc/kernel/entry_32.S 2016-03-21 20:18:29.000000000 +0100
@@ -813,7 +813,14 @@
cmpwi 0,r0,0 /* if non-zero, just restore regs and return */
bne restore
@@ -2212,9 +2618,9 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/kernel/entry_32.S linux-4.1.13/arch/pow
bne- do_resched
andi. r0,r9,_TIF_USER_WORK_MASK
beq restore_user
-diff -Nur linux-4.1.13.orig/arch/powerpc/kernel/entry_64.S linux-4.1.13/arch/powerpc/kernel/entry_64.S
---- linux-4.1.13.orig/arch/powerpc/kernel/entry_64.S 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/powerpc/kernel/entry_64.S 2015-11-29 09:23:09.517620297 +0100
+diff -Nur linux-4.1.20.orig/arch/powerpc/kernel/entry_64.S linux-4.1.20/arch/powerpc/kernel/entry_64.S
+--- linux-4.1.20.orig/arch/powerpc/kernel/entry_64.S 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/powerpc/kernel/entry_64.S 2016-03-21 20:18:29.000000000 +0100
@@ -636,7 +636,7 @@
#else
beq restore
@@ -2253,9 +2659,9 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/kernel/entry_64.S linux-4.1.13/arch/pow
bne 1b
/*
-diff -Nur linux-4.1.13.orig/arch/powerpc/kernel/irq.c linux-4.1.13/arch/powerpc/kernel/irq.c
---- linux-4.1.13.orig/arch/powerpc/kernel/irq.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/powerpc/kernel/irq.c 2015-11-29 09:23:09.517620297 +0100
+diff -Nur linux-4.1.20.orig/arch/powerpc/kernel/irq.c linux-4.1.20/arch/powerpc/kernel/irq.c
+--- linux-4.1.20.orig/arch/powerpc/kernel/irq.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/powerpc/kernel/irq.c 2016-03-21 20:18:30.000000000 +0100
@@ -614,6 +614,7 @@
}
}
@@ -2272,9 +2678,9 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/kernel/irq.c linux-4.1.13/arch/powerpc/
irq_hw_number_t virq_to_hw(unsigned int virq)
{
-diff -Nur linux-4.1.13.orig/arch/powerpc/kernel/misc_32.S linux-4.1.13/arch/powerpc/kernel/misc_32.S
---- linux-4.1.13.orig/arch/powerpc/kernel/misc_32.S 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/powerpc/kernel/misc_32.S 2015-11-29 09:23:09.517620297 +0100
+diff -Nur linux-4.1.20.orig/arch/powerpc/kernel/misc_32.S linux-4.1.20/arch/powerpc/kernel/misc_32.S
+--- linux-4.1.20.orig/arch/powerpc/kernel/misc_32.S 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/powerpc/kernel/misc_32.S 2016-03-21 20:18:30.000000000 +0100
@@ -40,6 +40,7 @@
* We store the saved ksp_limit in the unused part
* of the STACK_FRAME_OVERHEAD
@@ -2291,9 +2697,9 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/kernel/misc_32.S linux-4.1.13/arch/powe
/*
* void call_do_irq(struct pt_regs *regs, struct thread_info *irqtp);
-diff -Nur linux-4.1.13.orig/arch/powerpc/kernel/misc_64.S linux-4.1.13/arch/powerpc/kernel/misc_64.S
---- linux-4.1.13.orig/arch/powerpc/kernel/misc_64.S 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/powerpc/kernel/misc_64.S 2015-11-29 09:23:09.517620297 +0100
+diff -Nur linux-4.1.20.orig/arch/powerpc/kernel/misc_64.S linux-4.1.20/arch/powerpc/kernel/misc_64.S
+--- linux-4.1.20.orig/arch/powerpc/kernel/misc_64.S 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/powerpc/kernel/misc_64.S 2016-03-21 20:18:30.000000000 +0100
@@ -29,6 +29,7 @@
.text
@@ -2310,9 +2716,20 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/kernel/misc_64.S linux-4.1.13/arch/powe
_GLOBAL(call_do_irq)
mflr r0
-diff -Nur linux-4.1.13.orig/arch/powerpc/kvm/book3s_hv.c linux-4.1.13/arch/powerpc/kvm/book3s_hv.c
---- linux-4.1.13.orig/arch/powerpc/kvm/book3s_hv.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/powerpc/kvm/book3s_hv.c 2015-11-29 09:23:09.517620297 +0100
+diff -Nur linux-4.1.20.orig/arch/powerpc/kvm/Kconfig linux-4.1.20/arch/powerpc/kvm/Kconfig
+--- linux-4.1.20.orig/arch/powerpc/kvm/Kconfig 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/powerpc/kvm/Kconfig 2016-03-21 20:18:30.000000000 +0100
+@@ -172,6 +172,7 @@
+ config KVM_MPIC
+ bool "KVM in-kernel MPIC emulation"
+ depends on KVM && E500
++ depends on !PREEMPT_RT_FULL
+ select HAVE_KVM_IRQCHIP
+ select HAVE_KVM_IRQFD
+ select HAVE_KVM_IRQ_ROUTING
+diff -Nur linux-4.1.20.orig/arch/powerpc/kvm/book3s_hv.c linux-4.1.20/arch/powerpc/kvm/book3s_hv.c
+--- linux-4.1.20.orig/arch/powerpc/kvm/book3s_hv.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/powerpc/kvm/book3s_hv.c 2016-03-21 20:18:30.000000000 +0100
@@ -115,11 +115,11 @@
static void kvmppc_fast_vcpu_kick_hv(struct kvm_vcpu *vcpu)
{
@@ -2328,7 +2745,7 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/kvm/book3s_hv.c linux-4.1.13/arch/power
++vcpu->stat.halt_wakeup;
}
-@@ -686,8 +686,8 @@
+@@ -692,8 +692,8 @@
tvcpu->arch.prodded = 1;
smp_mb();
if (vcpu->arch.ceded) {
@@ -2339,7 +2756,7 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/kvm/book3s_hv.c linux-4.1.13/arch/power
vcpu->stat.halt_wakeup++;
}
}
-@@ -1426,7 +1426,7 @@
+@@ -1432,7 +1432,7 @@
INIT_LIST_HEAD(&vcore->runnable_threads);
spin_lock_init(&vcore->lock);
spin_lock_init(&vcore->stoltb_lock);
@@ -2348,7 +2765,7 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/kvm/book3s_hv.c linux-4.1.13/arch/power
vcore->preempt_tb = TB_NIL;
vcore->lpcr = kvm->arch.lpcr;
vcore->first_vcpuid = core * threads_per_subcore;
-@@ -2073,10 +2073,9 @@
+@@ -2079,10 +2079,9 @@
{
struct kvm_vcpu *vcpu;
int do_sleep = 1;
@@ -2361,7 +2778,7 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/kvm/book3s_hv.c linux-4.1.13/arch/power
/*
* Check one last time for pending exceptions and ceded state after
-@@ -2090,7 +2089,7 @@
+@@ -2096,7 +2095,7 @@
}
if (!do_sleep) {
@@ -2370,7 +2787,7 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/kvm/book3s_hv.c linux-4.1.13/arch/power
return;
}
-@@ -2098,7 +2097,7 @@
+@@ -2104,7 +2103,7 @@
trace_kvmppc_vcore_blocked(vc, 0);
spin_unlock(&vc->lock);
schedule();
@@ -2379,7 +2796,7 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/kvm/book3s_hv.c linux-4.1.13/arch/power
spin_lock(&vc->lock);
vc->vcore_state = VCORE_INACTIVE;
trace_kvmppc_vcore_blocked(vc, 1);
-@@ -2142,7 +2141,7 @@
+@@ -2148,7 +2147,7 @@
kvmppc_start_thread(vcpu);
trace_kvm_guest_enter(vcpu);
} else if (vc->vcore_state == VCORE_SLEEPING) {
@@ -2388,20 +2805,9 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/kvm/book3s_hv.c linux-4.1.13/arch/power
}
}
-diff -Nur linux-4.1.13.orig/arch/powerpc/kvm/Kconfig linux-4.1.13/arch/powerpc/kvm/Kconfig
---- linux-4.1.13.orig/arch/powerpc/kvm/Kconfig 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/powerpc/kvm/Kconfig 2015-11-29 09:23:09.517620297 +0100
-@@ -172,6 +172,7 @@
- config KVM_MPIC
- bool "KVM in-kernel MPIC emulation"
- depends on KVM && E500
-+ depends on !PREEMPT_RT_FULL
- select HAVE_KVM_IRQCHIP
- select HAVE_KVM_IRQFD
- select HAVE_KVM_IRQ_ROUTING
-diff -Nur linux-4.1.13.orig/arch/powerpc/mm/fault.c linux-4.1.13/arch/powerpc/mm/fault.c
---- linux-4.1.13.orig/arch/powerpc/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/powerpc/mm/fault.c 2015-11-29 09:23:09.517620297 +0100
+diff -Nur linux-4.1.20.orig/arch/powerpc/mm/fault.c linux-4.1.20/arch/powerpc/mm/fault.c
+--- linux-4.1.20.orig/arch/powerpc/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/powerpc/mm/fault.c 2016-03-21 20:18:30.000000000 +0100
@@ -33,13 +33,13 @@
#include <linux/ratelimit.h>
#include <linux/context_tracking.h>
@@ -2437,9 +2843,9 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/mm/fault.c linux-4.1.13/arch/powerpc/mm
printk(KERN_EMERG "NIP = %lx MSR = %lx\n",
regs->nip, regs->msr);
die("Weird page fault", regs, SIGSEGV);
-diff -Nur linux-4.1.13.orig/arch/powerpc/mm/highmem.c linux-4.1.13/arch/powerpc/mm/highmem.c
---- linux-4.1.13.orig/arch/powerpc/mm/highmem.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/powerpc/mm/highmem.c 2015-11-29 09:23:09.517620297 +0100
+diff -Nur linux-4.1.20.orig/arch/powerpc/mm/highmem.c linux-4.1.20/arch/powerpc/mm/highmem.c
+--- linux-4.1.20.orig/arch/powerpc/mm/highmem.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/powerpc/mm/highmem.c 2016-03-21 20:18:30.000000000 +0100
@@ -34,7 +34,7 @@
unsigned long vaddr;
int idx, type;
@@ -2464,9 +2870,9 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/mm/highmem.c linux-4.1.13/arch/powerpc/
+ preempt_enable();
}
EXPORT_SYMBOL(__kunmap_atomic);
-diff -Nur linux-4.1.13.orig/arch/powerpc/platforms/ps3/device-init.c linux-4.1.13/arch/powerpc/platforms/ps3/device-init.c
---- linux-4.1.13.orig/arch/powerpc/platforms/ps3/device-init.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/powerpc/platforms/ps3/device-init.c 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/powerpc/platforms/ps3/device-init.c linux-4.1.20/arch/powerpc/platforms/ps3/device-init.c
+--- linux-4.1.20.orig/arch/powerpc/platforms/ps3/device-init.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/powerpc/platforms/ps3/device-init.c 2016-03-21 20:18:30.000000000 +0100
@@ -752,7 +752,7 @@
}
pr_debug("%s:%u: notification %s issued\n", __func__, __LINE__, op);
@@ -2476,9 +2882,9 @@ diff -Nur linux-4.1.13.orig/arch/powerpc/platforms/ps3/device-init.c linux-4.1.1
dev->done.done || kthread_should_stop());
if (kthread_should_stop())
res = -EINTR;
-diff -Nur linux-4.1.13.orig/arch/s390/include/asm/kvm_host.h linux-4.1.13/arch/s390/include/asm/kvm_host.h
---- linux-4.1.13.orig/arch/s390/include/asm/kvm_host.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/s390/include/asm/kvm_host.h 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/s390/include/asm/kvm_host.h linux-4.1.20/arch/s390/include/asm/kvm_host.h
+--- linux-4.1.20.orig/arch/s390/include/asm/kvm_host.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/s390/include/asm/kvm_host.h 2016-03-21 20:18:30.000000000 +0100
@@ -419,7 +419,7 @@
struct kvm_s390_local_interrupt {
spinlock_t lock;
@@ -2488,9 +2894,9 @@ diff -Nur linux-4.1.13.orig/arch/s390/include/asm/kvm_host.h linux-4.1.13/arch/s
atomic_t *cpuflags;
DECLARE_BITMAP(sigp_emerg_pending, KVM_MAX_VCPUS);
struct kvm_s390_irq_payload irq;
-diff -Nur linux-4.1.13.orig/arch/s390/include/asm/uaccess.h linux-4.1.13/arch/s390/include/asm/uaccess.h
---- linux-4.1.13.orig/arch/s390/include/asm/uaccess.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/s390/include/asm/uaccess.h 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/s390/include/asm/uaccess.h linux-4.1.20/arch/s390/include/asm/uaccess.h
+--- linux-4.1.20.orig/arch/s390/include/asm/uaccess.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/s390/include/asm/uaccess.h 2016-03-21 20:18:30.000000000 +0100
@@ -98,7 +98,8 @@
* @from: Source address, in user space.
* @n: Number of bytes to copy.
@@ -2541,9 +2947,9 @@ diff -Nur linux-4.1.13.orig/arch/s390/include/asm/uaccess.h linux-4.1.13/arch/s3
*
* Get the size of a NUL-terminated string in user space.
*
-diff -Nur linux-4.1.13.orig/arch/s390/kvm/interrupt.c linux-4.1.13/arch/s390/kvm/interrupt.c
---- linux-4.1.13.orig/arch/s390/kvm/interrupt.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/s390/kvm/interrupt.c 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/s390/kvm/interrupt.c linux-4.1.20/arch/s390/kvm/interrupt.c
+--- linux-4.1.20.orig/arch/s390/kvm/interrupt.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/s390/kvm/interrupt.c 2016-03-21 20:18:30.000000000 +0100
@@ -875,13 +875,13 @@
void kvm_s390_vcpu_wakeup(struct kvm_vcpu *vcpu)
@@ -2578,9 +2984,9 @@ diff -Nur linux-4.1.13.orig/arch/s390/kvm/interrupt.c linux-4.1.13/arch/s390/kvm
spin_unlock(&li->lock);
return rc;
}
-diff -Nur linux-4.1.13.orig/arch/s390/mm/fault.c linux-4.1.13/arch/s390/mm/fault.c
---- linux-4.1.13.orig/arch/s390/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/s390/mm/fault.c 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/s390/mm/fault.c linux-4.1.20/arch/s390/mm/fault.c
+--- linux-4.1.20.orig/arch/s390/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/s390/mm/fault.c 2016-03-21 20:18:30.000000000 +0100
@@ -399,7 +399,7 @@
* user context.
*/
@@ -2590,9 +2996,9 @@ diff -Nur linux-4.1.13.orig/arch/s390/mm/fault.c linux-4.1.13/arch/s390/mm/fault
goto out;
address = trans_exc_code & __FAIL_ADDR_MASK;
-diff -Nur linux-4.1.13.orig/arch/score/include/asm/uaccess.h linux-4.1.13/arch/score/include/asm/uaccess.h
---- linux-4.1.13.orig/arch/score/include/asm/uaccess.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/score/include/asm/uaccess.h 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/score/include/asm/uaccess.h linux-4.1.20/arch/score/include/asm/uaccess.h
+--- linux-4.1.20.orig/arch/score/include/asm/uaccess.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/score/include/asm/uaccess.h 2016-03-21 20:18:30.000000000 +0100
@@ -36,7 +36,8 @@
* @addr: User space pointer to start of block to check
* @size: Size of block to check
@@ -2643,9 +3049,9 @@ diff -Nur linux-4.1.13.orig/arch/score/include/asm/uaccess.h linux-4.1.13/arch/s
*
* This macro copies a single simple variable from user space to kernel
* space. It supports simple types like char and int, but not larger
-diff -Nur linux-4.1.13.orig/arch/score/mm/fault.c linux-4.1.13/arch/score/mm/fault.c
---- linux-4.1.13.orig/arch/score/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/score/mm/fault.c 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/score/mm/fault.c linux-4.1.20/arch/score/mm/fault.c
+--- linux-4.1.20.orig/arch/score/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/score/mm/fault.c 2016-03-21 20:18:30.000000000 +0100
@@ -34,6 +34,7 @@
#include <linux/string.h>
#include <linux/types.h>
@@ -2663,9 +3069,9 @@ diff -Nur linux-4.1.13.orig/arch/score/mm/fault.c linux-4.1.13/arch/score/mm/fau
goto bad_area_nosemaphore;
if (user_mode(regs))
-diff -Nur linux-4.1.13.orig/arch/sh/kernel/irq.c linux-4.1.13/arch/sh/kernel/irq.c
---- linux-4.1.13.orig/arch/sh/kernel/irq.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/sh/kernel/irq.c 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/sh/kernel/irq.c linux-4.1.20/arch/sh/kernel/irq.c
+--- linux-4.1.20.orig/arch/sh/kernel/irq.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/sh/kernel/irq.c 2016-03-21 20:18:30.000000000 +0100
@@ -147,6 +147,7 @@
hardirq_ctx[cpu] = NULL;
}
@@ -2682,9 +3088,9 @@ diff -Nur linux-4.1.13.orig/arch/sh/kernel/irq.c linux-4.1.13/arch/sh/kernel/irq
#else
static inline void handle_one_irq(unsigned int irq)
{
-diff -Nur linux-4.1.13.orig/arch/sh/mm/fault.c linux-4.1.13/arch/sh/mm/fault.c
---- linux-4.1.13.orig/arch/sh/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/sh/mm/fault.c 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/sh/mm/fault.c linux-4.1.20/arch/sh/mm/fault.c
+--- linux-4.1.20.orig/arch/sh/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/sh/mm/fault.c 2016-03-21 20:18:30.000000000 +0100
@@ -17,6 +17,7 @@
#include <linux/kprobes.h>
#include <linux/perf_event.h>
@@ -2705,9 +3111,9 @@ diff -Nur linux-4.1.13.orig/arch/sh/mm/fault.c linux-4.1.13/arch/sh/mm/fault.c
bad_area_nosemaphore(regs, error_code, address);
return;
}
-diff -Nur linux-4.1.13.orig/arch/sparc/Kconfig linux-4.1.13/arch/sparc/Kconfig
---- linux-4.1.13.orig/arch/sparc/Kconfig 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/sparc/Kconfig 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/sparc/Kconfig linux-4.1.20/arch/sparc/Kconfig
+--- linux-4.1.20.orig/arch/sparc/Kconfig 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/sparc/Kconfig 2016-03-21 20:18:30.000000000 +0100
@@ -189,12 +189,10 @@
source kernel/Kconfig.hz
@@ -2723,9 +3129,9 @@ diff -Nur linux-4.1.13.orig/arch/sparc/Kconfig linux-4.1.13/arch/sparc/Kconfig
config GENERIC_HWEIGHT
bool
-diff -Nur linux-4.1.13.orig/arch/sparc/kernel/irq_64.c linux-4.1.13/arch/sparc/kernel/irq_64.c
---- linux-4.1.13.orig/arch/sparc/kernel/irq_64.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/sparc/kernel/irq_64.c 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/sparc/kernel/irq_64.c linux-4.1.20/arch/sparc/kernel/irq_64.c
+--- linux-4.1.20.orig/arch/sparc/kernel/irq_64.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/sparc/kernel/irq_64.c 2016-03-21 20:18:30.000000000 +0100
@@ -849,6 +849,7 @@
set_irq_regs(old_regs);
}
@@ -2742,9 +3148,9 @@ diff -Nur linux-4.1.13.orig/arch/sparc/kernel/irq_64.c linux-4.1.13/arch/sparc/k
#ifdef CONFIG_HOTPLUG_CPU
void fixup_irqs(void)
-diff -Nur linux-4.1.13.orig/arch/sparc/mm/fault_32.c linux-4.1.13/arch/sparc/mm/fault_32.c
---- linux-4.1.13.orig/arch/sparc/mm/fault_32.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/sparc/mm/fault_32.c 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/sparc/mm/fault_32.c linux-4.1.20/arch/sparc/mm/fault_32.c
+--- linux-4.1.20.orig/arch/sparc/mm/fault_32.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/sparc/mm/fault_32.c 2016-03-21 20:18:30.000000000 +0100
@@ -21,6 +21,7 @@
#include <linux/perf_event.h>
#include <linux/interrupt.h>
@@ -2770,9 +3176,9 @@ diff -Nur linux-4.1.13.orig/arch/sparc/mm/fault_32.c linux-4.1.13/arch/sparc/mm/
goto no_context;
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
-diff -Nur linux-4.1.13.orig/arch/sparc/mm/fault_64.c linux-4.1.13/arch/sparc/mm/fault_64.c
---- linux-4.1.13.orig/arch/sparc/mm/fault_64.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/sparc/mm/fault_64.c 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/sparc/mm/fault_64.c linux-4.1.20/arch/sparc/mm/fault_64.c
+--- linux-4.1.20.orig/arch/sparc/mm/fault_64.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/sparc/mm/fault_64.c 2016-03-21 20:18:30.000000000 +0100
@@ -22,12 +22,12 @@
#include <linux/kdebug.h>
#include <linux/percpu.h>
@@ -2796,9 +3202,9 @@ diff -Nur linux-4.1.13.orig/arch/sparc/mm/fault_64.c linux-4.1.13/arch/sparc/mm/
goto intr_or_no_mm;
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
-diff -Nur linux-4.1.13.orig/arch/sparc/mm/highmem.c linux-4.1.13/arch/sparc/mm/highmem.c
---- linux-4.1.13.orig/arch/sparc/mm/highmem.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/sparc/mm/highmem.c 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/sparc/mm/highmem.c linux-4.1.20/arch/sparc/mm/highmem.c
+--- linux-4.1.20.orig/arch/sparc/mm/highmem.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/sparc/mm/highmem.c 2016-03-21 20:18:30.000000000 +0100
@@ -53,7 +53,7 @@
unsigned long vaddr;
long idx, type;
@@ -2823,9 +3229,9 @@ diff -Nur linux-4.1.13.orig/arch/sparc/mm/highmem.c linux-4.1.13/arch/sparc/mm/h
+ preempt_enable();
}
EXPORT_SYMBOL(__kunmap_atomic);
-diff -Nur linux-4.1.13.orig/arch/sparc/mm/init_64.c linux-4.1.13/arch/sparc/mm/init_64.c
---- linux-4.1.13.orig/arch/sparc/mm/init_64.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/sparc/mm/init_64.c 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/sparc/mm/init_64.c linux-4.1.20/arch/sparc/mm/init_64.c
+--- linux-4.1.20.orig/arch/sparc/mm/init_64.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/sparc/mm/init_64.c 2016-03-21 20:18:30.000000000 +0100
@@ -2738,7 +2738,7 @@
struct mm_struct *mm = current->mm;
struct tsb_config *tp;
@@ -2835,9 +3241,9 @@ diff -Nur linux-4.1.13.orig/arch/sparc/mm/init_64.c linux-4.1.13/arch/sparc/mm/i
const struct exception_table_entry *entry;
entry = search_exception_tables(regs->tpc);
-diff -Nur linux-4.1.13.orig/arch/tile/include/asm/uaccess.h linux-4.1.13/arch/tile/include/asm/uaccess.h
---- linux-4.1.13.orig/arch/tile/include/asm/uaccess.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/tile/include/asm/uaccess.h 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/tile/include/asm/uaccess.h linux-4.1.20/arch/tile/include/asm/uaccess.h
+--- linux-4.1.20.orig/arch/tile/include/asm/uaccess.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/tile/include/asm/uaccess.h 2016-03-21 20:18:30.000000000 +0100
@@ -78,7 +78,8 @@
* @addr: User space pointer to start of block to check
* @size: Size of block to check
@@ -2898,9 +3304,9 @@ diff -Nur linux-4.1.13.orig/arch/tile/include/asm/uaccess.h linux-4.1.13/arch/ti
*
* Copy data from user space to user space. Caller must check
* the specified blocks with access_ok() before calling this function.
-diff -Nur linux-4.1.13.orig/arch/tile/mm/fault.c linux-4.1.13/arch/tile/mm/fault.c
---- linux-4.1.13.orig/arch/tile/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/tile/mm/fault.c 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/tile/mm/fault.c linux-4.1.20/arch/tile/mm/fault.c
+--- linux-4.1.20.orig/arch/tile/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/tile/mm/fault.c 2016-03-21 20:18:30.000000000 +0100
@@ -354,9 +354,9 @@
/*
@@ -2913,9 +3319,9 @@ diff -Nur linux-4.1.13.orig/arch/tile/mm/fault.c linux-4.1.13/arch/tile/mm/fault
vma = NULL; /* happy compiler */
goto bad_area_nosemaphore;
}
-diff -Nur linux-4.1.13.orig/arch/tile/mm/highmem.c linux-4.1.13/arch/tile/mm/highmem.c
---- linux-4.1.13.orig/arch/tile/mm/highmem.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/tile/mm/highmem.c 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/tile/mm/highmem.c linux-4.1.20/arch/tile/mm/highmem.c
+--- linux-4.1.20.orig/arch/tile/mm/highmem.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/tile/mm/highmem.c 2016-03-21 20:18:30.000000000 +0100
@@ -201,7 +201,7 @@
int idx, type;
pte_t *pte;
@@ -2933,9 +3339,9 @@ diff -Nur linux-4.1.13.orig/arch/tile/mm/highmem.c linux-4.1.13/arch/tile/mm/hig
}
EXPORT_SYMBOL(__kunmap_atomic);
-diff -Nur linux-4.1.13.orig/arch/um/kernel/trap.c linux-4.1.13/arch/um/kernel/trap.c
---- linux-4.1.13.orig/arch/um/kernel/trap.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/um/kernel/trap.c 2015-11-29 09:23:09.521620031 +0100
+diff -Nur linux-4.1.20.orig/arch/um/kernel/trap.c linux-4.1.20/arch/um/kernel/trap.c
+--- linux-4.1.20.orig/arch/um/kernel/trap.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/um/kernel/trap.c 2016-03-21 20:18:30.000000000 +0100
@@ -35,10 +35,10 @@
*code_out = SEGV_MAPERR;
@@ -2949,9 +3355,9 @@ diff -Nur linux-4.1.13.orig/arch/um/kernel/trap.c linux-4.1.13/arch/um/kernel/tr
goto out_nosemaphore;
if (is_user)
-diff -Nur linux-4.1.13.orig/arch/unicore32/mm/fault.c linux-4.1.13/arch/unicore32/mm/fault.c
---- linux-4.1.13.orig/arch/unicore32/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/unicore32/mm/fault.c 2015-11-29 09:23:09.525619763 +0100
+diff -Nur linux-4.1.20.orig/arch/unicore32/mm/fault.c linux-4.1.20/arch/unicore32/mm/fault.c
+--- linux-4.1.20.orig/arch/unicore32/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/unicore32/mm/fault.c 2016-03-21 20:18:30.000000000 +0100
@@ -218,7 +218,7 @@
* If we're in an interrupt or have no user
* context, we must not take the fault..
@@ -2961,9 +3367,42 @@ diff -Nur linux-4.1.13.orig/arch/unicore32/mm/fault.c linux-4.1.13/arch/unicore3
goto no_context;
if (user_mode(regs))
-diff -Nur linux-4.1.13.orig/arch/x86/crypto/aesni-intel_glue.c linux-4.1.13/arch/x86/crypto/aesni-intel_glue.c
---- linux-4.1.13.orig/arch/x86/crypto/aesni-intel_glue.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/crypto/aesni-intel_glue.c 2015-11-29 09:23:09.525619763 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/Kconfig linux-4.1.20/arch/x86/Kconfig
+--- linux-4.1.20.orig/arch/x86/Kconfig 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/Kconfig 2016-03-21 20:18:30.000000000 +0100
+@@ -22,6 +22,7 @@
+ ### Arch settings
+ config X86
+ def_bool y
++ select HAVE_PREEMPT_LAZY
+ select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
+ select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
+ select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
+@@ -203,8 +204,11 @@
+ def_bool y
+ depends on ISA_DMA_API
+
++config RWSEM_GENERIC_SPINLOCK
++ def_bool PREEMPT_RT_FULL
++
+ config RWSEM_XCHGADD_ALGORITHM
+- def_bool y
++ def_bool !RWSEM_GENERIC_SPINLOCK && !PREEMPT_RT_FULL
+
+ config GENERIC_CALIBRATE_DELAY
+ def_bool y
+@@ -838,7 +842,7 @@
+ config MAXSMP
+ bool "Enable Maximum number of SMP Processors and NUMA Nodes"
+ depends on X86_64 && SMP && DEBUG_KERNEL
+- select CPUMASK_OFFSTACK
++ select CPUMASK_OFFSTACK if !PREEMPT_RT_FULL
+ ---help---
+ Enable maximum number of CPUS and NUMA Nodes for this architecture.
+ If unsure, say N.
+diff -Nur linux-4.1.20.orig/arch/x86/crypto/aesni-intel_glue.c linux-4.1.20/arch/x86/crypto/aesni-intel_glue.c
+--- linux-4.1.20.orig/arch/x86/crypto/aesni-intel_glue.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/crypto/aesni-intel_glue.c 2016-03-21 20:18:30.000000000 +0100
@@ -382,14 +382,14 @@
err = blkcipher_walk_virt(desc, &walk);
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
@@ -3056,9 +3495,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/crypto/aesni-intel_glue.c linux-4.1.13/arch
return err;
}
-diff -Nur linux-4.1.13.orig/arch/x86/crypto/cast5_avx_glue.c linux-4.1.13/arch/x86/crypto/cast5_avx_glue.c
---- linux-4.1.13.orig/arch/x86/crypto/cast5_avx_glue.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/crypto/cast5_avx_glue.c 2015-11-29 09:23:09.525619763 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/crypto/cast5_avx_glue.c linux-4.1.20/arch/x86/crypto/cast5_avx_glue.c
+--- linux-4.1.20.orig/arch/x86/crypto/cast5_avx_glue.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/crypto/cast5_avx_glue.c 2016-03-21 20:18:30.000000000 +0100
@@ -60,7 +60,7 @@
static int ecb_crypt(struct blkcipher_desc *desc, struct blkcipher_walk *walk,
bool enc)
@@ -3138,9 +3577,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/crypto/cast5_avx_glue.c linux-4.1.13/arch/x
if (walk.nbytes) {
ctr_crypt_final(desc, &walk);
err = blkcipher_walk_done(desc, &walk, 0);
-diff -Nur linux-4.1.13.orig/arch/x86/crypto/glue_helper.c linux-4.1.13/arch/x86/crypto/glue_helper.c
---- linux-4.1.13.orig/arch/x86/crypto/glue_helper.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/crypto/glue_helper.c 2015-11-29 09:23:09.525619763 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/crypto/glue_helper.c linux-4.1.20/arch/x86/crypto/glue_helper.c
+--- linux-4.1.20.orig/arch/x86/crypto/glue_helper.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/crypto/glue_helper.c 2016-03-21 20:18:30.000000000 +0100
@@ -39,7 +39,7 @@
void *ctx = crypto_blkcipher_ctx(desc->tfm);
const unsigned int bsize = 128 / 8;
@@ -3256,9 +3695,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/crypto/glue_helper.c linux-4.1.13/arch/x86/
return err;
}
EXPORT_SYMBOL_GPL(glue_xts_crypt_128bit);
-diff -Nur linux-4.1.13.orig/arch/x86/include/asm/preempt.h linux-4.1.13/arch/x86/include/asm/preempt.h
---- linux-4.1.13.orig/arch/x86/include/asm/preempt.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/include/asm/preempt.h 2015-11-29 09:23:09.525619763 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/include/asm/preempt.h linux-4.1.20/arch/x86/include/asm/preempt.h
+--- linux-4.1.20.orig/arch/x86/include/asm/preempt.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/include/asm/preempt.h 2016-03-21 20:18:30.000000000 +0100
@@ -82,17 +82,33 @@
* a decrement which hits zero means we have no preempt_count and should
* reschedule.
@@ -3294,9 +3733,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/include/asm/preempt.h linux-4.1.13/arch/x86
}
#ifdef CONFIG_PREEMPT
-diff -Nur linux-4.1.13.orig/arch/x86/include/asm/signal.h linux-4.1.13/arch/x86/include/asm/signal.h
---- linux-4.1.13.orig/arch/x86/include/asm/signal.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/include/asm/signal.h 2015-11-29 09:23:09.525619763 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/include/asm/signal.h linux-4.1.20/arch/x86/include/asm/signal.h
+--- linux-4.1.20.orig/arch/x86/include/asm/signal.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/include/asm/signal.h 2016-03-21 20:18:30.000000000 +0100
@@ -23,6 +23,19 @@
unsigned long sig[_NSIG_WORDS];
} sigset_t;
@@ -3310,16 +3749,16 @@ diff -Nur linux-4.1.13.orig/arch/x86/include/asm/signal.h linux-4.1.13/arch/x86/
+ * TIF_NOTIFY_RESUME and set up the signal to be sent on exit of the
+ * trap.
+ */
-+#if defined(CONFIG_PREEMPT_RT_FULL) && defined(CONFIG_X86_64)
++#if defined(CONFIG_PREEMPT_RT_FULL)
+#define ARCH_RT_DELAYS_SIGNAL_SEND
+#endif
+
#ifndef CONFIG_COMPAT
typedef sigset_t compat_sigset_t;
#endif
-diff -Nur linux-4.1.13.orig/arch/x86/include/asm/stackprotector.h linux-4.1.13/arch/x86/include/asm/stackprotector.h
---- linux-4.1.13.orig/arch/x86/include/asm/stackprotector.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/include/asm/stackprotector.h 2015-11-29 09:23:09.525619763 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/include/asm/stackprotector.h linux-4.1.20/arch/x86/include/asm/stackprotector.h
+--- linux-4.1.20.orig/arch/x86/include/asm/stackprotector.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/include/asm/stackprotector.h 2016-03-21 20:18:30.000000000 +0100
@@ -57,7 +57,7 @@
*/
static __always_inline void boot_init_stack_canary(void)
@@ -3346,9 +3785,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/include/asm/stackprotector.h linux-4.1.13/a
tsc = __native_read_tsc();
canary += tsc + (tsc << 32UL);
-diff -Nur linux-4.1.13.orig/arch/x86/include/asm/thread_info.h linux-4.1.13/arch/x86/include/asm/thread_info.h
---- linux-4.1.13.orig/arch/x86/include/asm/thread_info.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/include/asm/thread_info.h 2015-11-29 09:23:09.525619763 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/include/asm/thread_info.h linux-4.1.20/arch/x86/include/asm/thread_info.h
+--- linux-4.1.20.orig/arch/x86/include/asm/thread_info.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/include/asm/thread_info.h 2016-03-21 20:18:30.000000000 +0100
@@ -55,6 +55,8 @@
__u32 status; /* thread synchronous flags */
__u32 cpu; /* current CPU */
@@ -3383,32 +3822,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/include/asm/thread_info.h linux-4.1.13/arch
#define STACK_WARN (THREAD_SIZE/8)
/*
-diff -Nur linux-4.1.13.orig/arch/x86/include/asm/uaccess_32.h linux-4.1.13/arch/x86/include/asm/uaccess_32.h
---- linux-4.1.13.orig/arch/x86/include/asm/uaccess_32.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/include/asm/uaccess_32.h 2015-11-29 09:23:09.525619763 +0100
-@@ -70,7 +70,8 @@
- * @from: Source address, in kernel space.
- * @n: Number of bytes to copy.
- *
-- * Context: User context only. This function may sleep.
-+ * Context: User context only. This function may sleep if pagefaults are
-+ * enabled.
- *
- * Copy data from kernel space to user space. Caller must check
- * the specified block with access_ok() before calling this function.
-@@ -117,7 +118,8 @@
- * @from: Source address, in user space.
- * @n: Number of bytes to copy.
- *
-- * Context: User context only. This function may sleep.
-+ * Context: User context only. This function may sleep if pagefaults are
-+ * enabled.
- *
- * Copy data from user space to kernel space. Caller must check
- * the specified block with access_ok() before calling this function.
-diff -Nur linux-4.1.13.orig/arch/x86/include/asm/uaccess.h linux-4.1.13/arch/x86/include/asm/uaccess.h
---- linux-4.1.13.orig/arch/x86/include/asm/uaccess.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/include/asm/uaccess.h 2015-11-29 09:23:09.525619763 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/include/asm/uaccess.h linux-4.1.20/arch/x86/include/asm/uaccess.h
+--- linux-4.1.20.orig/arch/x86/include/asm/uaccess.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/include/asm/uaccess.h 2016-03-21 20:18:30.000000000 +0100
@@ -74,7 +74,8 @@
* @addr: User space pointer to start of block to check
* @size: Size of block to check
@@ -3459,9 +3875,32 @@ diff -Nur linux-4.1.13.orig/arch/x86/include/asm/uaccess.h linux-4.1.13/arch/x86
*
* This macro copies a single simple value from kernel space to user
* space. It supports simple types like char and int, but not larger
-diff -Nur linux-4.1.13.orig/arch/x86/include/asm/uv/uv_bau.h linux-4.1.13/arch/x86/include/asm/uv/uv_bau.h
---- linux-4.1.13.orig/arch/x86/include/asm/uv/uv_bau.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/include/asm/uv/uv_bau.h 2015-11-29 09:23:09.525619763 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/include/asm/uaccess_32.h linux-4.1.20/arch/x86/include/asm/uaccess_32.h
+--- linux-4.1.20.orig/arch/x86/include/asm/uaccess_32.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/include/asm/uaccess_32.h 2016-03-21 20:18:30.000000000 +0100
+@@ -70,7 +70,8 @@
+ * @from: Source address, in kernel space.
+ * @n: Number of bytes to copy.
+ *
+- * Context: User context only. This function may sleep.
++ * Context: User context only. This function may sleep if pagefaults are
++ * enabled.
+ *
+ * Copy data from kernel space to user space. Caller must check
+ * the specified block with access_ok() before calling this function.
+@@ -117,7 +118,8 @@
+ * @from: Source address, in user space.
+ * @n: Number of bytes to copy.
+ *
+- * Context: User context only. This function may sleep.
++ * Context: User context only. This function may sleep if pagefaults are
++ * enabled.
+ *
+ * Copy data from user space to kernel space. Caller must check
+ * the specified block with access_ok() before calling this function.
+diff -Nur linux-4.1.20.orig/arch/x86/include/asm/uv/uv_bau.h linux-4.1.20/arch/x86/include/asm/uv/uv_bau.h
+--- linux-4.1.20.orig/arch/x86/include/asm/uv/uv_bau.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/include/asm/uv/uv_bau.h 2016-03-21 20:18:30.000000000 +0100
@@ -615,9 +615,9 @@
cycles_t send_message;
cycles_t period_end;
@@ -3495,9 +3934,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/include/asm/uv/uv_bau.h linux-4.1.13/arch/x
return 1;
}
-diff -Nur linux-4.1.13.orig/arch/x86/include/asm/uv/uv_hub.h linux-4.1.13/arch/x86/include/asm/uv/uv_hub.h
---- linux-4.1.13.orig/arch/x86/include/asm/uv/uv_hub.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/include/asm/uv/uv_hub.h 2015-11-29 09:23:09.525619763 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/include/asm/uv/uv_hub.h linux-4.1.20/arch/x86/include/asm/uv/uv_hub.h
+--- linux-4.1.20.orig/arch/x86/include/asm/uv/uv_hub.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/include/asm/uv/uv_hub.h 2016-03-21 20:18:30.000000000 +0100
@@ -492,7 +492,7 @@
unsigned short nr_online_cpus;
unsigned short pnode;
@@ -3507,42 +3946,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/include/asm/uv/uv_hub.h linux-4.1.13/arch/x
unsigned long nmi_count; /* obsolete, see uv_hub_nmi */
};
extern struct uv_blade_info *uv_blade_info;
-diff -Nur linux-4.1.13.orig/arch/x86/Kconfig linux-4.1.13/arch/x86/Kconfig
---- linux-4.1.13.orig/arch/x86/Kconfig 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/Kconfig 2015-11-29 09:23:09.525619763 +0100
-@@ -22,6 +22,7 @@
- ### Arch settings
- config X86
- def_bool y
-+ select HAVE_PREEMPT_LAZY
- select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
- select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
- select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
-@@ -203,8 +204,11 @@
- def_bool y
- depends on ISA_DMA_API
-
-+config RWSEM_GENERIC_SPINLOCK
-+ def_bool PREEMPT_RT_FULL
-+
- config RWSEM_XCHGADD_ALGORITHM
-- def_bool y
-+ def_bool !RWSEM_GENERIC_SPINLOCK && !PREEMPT_RT_FULL
-
- config GENERIC_CALIBRATE_DELAY
- def_bool y
-@@ -838,7 +842,7 @@
- config MAXSMP
- bool "Enable Maximum number of SMP Processors and NUMA Nodes"
- depends on X86_64 && SMP && DEBUG_KERNEL
-- select CPUMASK_OFFSTACK
-+ select CPUMASK_OFFSTACK if !PREEMPT_RT_FULL
- ---help---
- Enable maximum number of CPUS and NUMA Nodes for this architecture.
- If unsure, say N.
-diff -Nur linux-4.1.13.orig/arch/x86/kernel/apic/io_apic.c linux-4.1.13/arch/x86/kernel/apic/io_apic.c
---- linux-4.1.13.orig/arch/x86/kernel/apic/io_apic.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/kernel/apic/io_apic.c 2015-11-29 09:23:09.525619763 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/kernel/apic/io_apic.c linux-4.1.20/arch/x86/kernel/apic/io_apic.c
+--- linux-4.1.20.orig/arch/x86/kernel/apic/io_apic.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/kernel/apic/io_apic.c 2016-03-21 20:18:30.000000000 +0100
@@ -1891,7 +1891,8 @@
static inline bool ioapic_irqd_mask(struct irq_data *data, struct irq_cfg *cfg)
{
@@ -3553,9 +3959,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/kernel/apic/io_apic.c linux-4.1.13/arch/x86
mask_ioapic(cfg);
return true;
}
-diff -Nur linux-4.1.13.orig/arch/x86/kernel/apic/x2apic_uv_x.c linux-4.1.13/arch/x86/kernel/apic/x2apic_uv_x.c
---- linux-4.1.13.orig/arch/x86/kernel/apic/x2apic_uv_x.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/kernel/apic/x2apic_uv_x.c 2015-11-29 09:23:09.525619763 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/kernel/apic/x2apic_uv_x.c linux-4.1.20/arch/x86/kernel/apic/x2apic_uv_x.c
+--- linux-4.1.20.orig/arch/x86/kernel/apic/x2apic_uv_x.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/kernel/apic/x2apic_uv_x.c 2016-03-21 20:18:30.000000000 +0100
@@ -949,7 +949,7 @@
uv_blade_info[blade].pnode = pnode;
uv_blade_info[blade].nr_possible_cpus = 0;
@@ -3565,9 +3971,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/kernel/apic/x2apic_uv_x.c linux-4.1.13/arch
min_pnode = min(pnode, min_pnode);
max_pnode = max(pnode, max_pnode);
blade++;
-diff -Nur linux-4.1.13.orig/arch/x86/kernel/asm-offsets.c linux-4.1.13/arch/x86/kernel/asm-offsets.c
---- linux-4.1.13.orig/arch/x86/kernel/asm-offsets.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/kernel/asm-offsets.c 2015-11-29 09:23:09.525619763 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/kernel/asm-offsets.c linux-4.1.20/arch/x86/kernel/asm-offsets.c
+--- linux-4.1.20.orig/arch/x86/kernel/asm-offsets.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/kernel/asm-offsets.c 2016-03-21 20:18:30.000000000 +0100
@@ -32,6 +32,7 @@
OFFSET(TI_flags, thread_info, flags);
OFFSET(TI_status, thread_info, status);
@@ -3582,9 +3988,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/kernel/asm-offsets.c linux-4.1.13/arch/x86/
DEFINE(PTREGS_SIZE, sizeof(struct pt_regs));
+ DEFINE(_PREEMPT_ENABLED, PREEMPT_ENABLED);
}
-diff -Nur linux-4.1.13.orig/arch/x86/kernel/cpu/mcheck/mce.c linux-4.1.13/arch/x86/kernel/cpu/mcheck/mce.c
---- linux-4.1.13.orig/arch/x86/kernel/cpu/mcheck/mce.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/kernel/cpu/mcheck/mce.c 2015-11-29 09:23:09.529619496 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/kernel/cpu/mcheck/mce.c linux-4.1.20/arch/x86/kernel/cpu/mcheck/mce.c
+--- linux-4.1.20.orig/arch/x86/kernel/cpu/mcheck/mce.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/kernel/cpu/mcheck/mce.c 2016-03-21 20:18:30.000000000 +0100
@@ -41,6 +41,8 @@
#include <linux/debugfs.h>
#include <linux/irq_work.h>
@@ -3826,9 +4232,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/kernel/cpu/mcheck/mce.c linux-4.1.13/arch/x
if (!zalloc_cpumask_var(&mce_device_initialized, GFP_KERNEL)) {
err = -ENOMEM;
goto err_out;
-diff -Nur linux-4.1.13.orig/arch/x86/kernel/dumpstack_32.c linux-4.1.13/arch/x86/kernel/dumpstack_32.c
---- linux-4.1.13.orig/arch/x86/kernel/dumpstack_32.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/kernel/dumpstack_32.c 2015-11-29 09:23:09.529619496 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/kernel/dumpstack_32.c linux-4.1.20/arch/x86/kernel/dumpstack_32.c
+--- linux-4.1.20.orig/arch/x86/kernel/dumpstack_32.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/kernel/dumpstack_32.c 2016-03-21 20:18:30.000000000 +0100
@@ -42,7 +42,7 @@
unsigned long *stack, unsigned long bp,
const struct stacktrace_ops *ops, void *data)
@@ -3847,9 +4253,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/kernel/dumpstack_32.c linux-4.1.13/arch/x86
}
EXPORT_SYMBOL(dump_trace);
-diff -Nur linux-4.1.13.orig/arch/x86/kernel/dumpstack_64.c linux-4.1.13/arch/x86/kernel/dumpstack_64.c
---- linux-4.1.13.orig/arch/x86/kernel/dumpstack_64.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/kernel/dumpstack_64.c 2015-11-29 09:23:09.529619496 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/kernel/dumpstack_64.c linux-4.1.20/arch/x86/kernel/dumpstack_64.c
+--- linux-4.1.20.orig/arch/x86/kernel/dumpstack_64.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/kernel/dumpstack_64.c 2016-03-21 20:18:30.000000000 +0100
@@ -152,7 +152,7 @@
unsigned long *stack, unsigned long bp,
const struct stacktrace_ops *ops, void *data)
@@ -3886,9 +4292,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/kernel/dumpstack_64.c linux-4.1.13/arch/x86
pr_cont("\n");
show_trace_log_lvl(task, regs, sp, bp, log_lvl);
-diff -Nur linux-4.1.13.orig/arch/x86/kernel/entry_32.S linux-4.1.13/arch/x86/kernel/entry_32.S
---- linux-4.1.13.orig/arch/x86/kernel/entry_32.S 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/kernel/entry_32.S 2015-11-29 09:23:09.529619496 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/kernel/entry_32.S linux-4.1.20/arch/x86/kernel/entry_32.S
+--- linux-4.1.20.orig/arch/x86/kernel/entry_32.S 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/kernel/entry_32.S 2016-03-21 20:18:30.000000000 +0100
@@ -359,8 +359,24 @@
ENTRY(resume_kernel)
DISABLE_INTERRUPTS(CLBR_ANY)
@@ -3932,9 +4338,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/kernel/entry_32.S linux-4.1.13/arch/x86/ker
jnz work_resched
work_notifysig: # deal with pending signals and
-diff -Nur linux-4.1.13.orig/arch/x86/kernel/entry_64.S linux-4.1.13/arch/x86/kernel/entry_64.S
---- linux-4.1.13.orig/arch/x86/kernel/entry_64.S 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/kernel/entry_64.S 2015-11-29 09:23:09.529619496 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/kernel/entry_64.S linux-4.1.20/arch/x86/kernel/entry_64.S
+--- linux-4.1.20.orig/arch/x86/kernel/entry_64.S 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/kernel/entry_64.S 2016-03-21 20:18:30.000000000 +0100
@@ -370,8 +370,8 @@
/* First do a reschedule test. */
/* edx: work, edi: workmask */
@@ -3997,9 +4403,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/kernel/entry_64.S linux-4.1.13/arch/x86/ker
#ifdef CONFIG_XEN
idtentry xen_hypervisor_callback xen_do_hypervisor_callback has_error_code=0
-diff -Nur linux-4.1.13.orig/arch/x86/kernel/irq_32.c linux-4.1.13/arch/x86/kernel/irq_32.c
---- linux-4.1.13.orig/arch/x86/kernel/irq_32.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/kernel/irq_32.c 2015-11-29 09:23:09.529619496 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/kernel/irq_32.c linux-4.1.20/arch/x86/kernel/irq_32.c
+--- linux-4.1.20.orig/arch/x86/kernel/irq_32.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/kernel/irq_32.c 2016-03-21 20:18:30.000000000 +0100
@@ -135,6 +135,7 @@
cpu, per_cpu(hardirq_stack, cpu), per_cpu(softirq_stack, cpu));
}
@@ -4016,9 +4422,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/kernel/irq_32.c linux-4.1.13/arch/x86/kerne
bool handle_irq(unsigned irq, struct pt_regs *regs)
{
-diff -Nur linux-4.1.13.orig/arch/x86/kernel/process_32.c linux-4.1.13/arch/x86/kernel/process_32.c
---- linux-4.1.13.orig/arch/x86/kernel/process_32.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/kernel/process_32.c 2015-11-29 09:23:09.529619496 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/kernel/process_32.c linux-4.1.20/arch/x86/kernel/process_32.c
+--- linux-4.1.20.orig/arch/x86/kernel/process_32.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/kernel/process_32.c 2016-03-21 20:18:30.000000000 +0100
@@ -35,6 +35,7 @@
#include <linux/uaccess.h>
#include <linux/io.h>
@@ -4072,10 +4478,10 @@ diff -Nur linux-4.1.13.orig/arch/x86/kernel/process_32.c linux-4.1.13/arch/x86/k
/*
* Leave lazy mode, flushing any hypercalls made here.
* This must be done before restoring TLS segments so
-diff -Nur linux-4.1.13.orig/arch/x86/kernel/signal.c linux-4.1.13/arch/x86/kernel/signal.c
---- linux-4.1.13.orig/arch/x86/kernel/signal.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/kernel/signal.c 2015-11-29 09:23:09.529619496 +0100
-@@ -723,6 +723,14 @@
+diff -Nur linux-4.1.20.orig/arch/x86/kernel/signal.c linux-4.1.20/arch/x86/kernel/signal.c
+--- linux-4.1.20.orig/arch/x86/kernel/signal.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/kernel/signal.c 2016-03-21 20:18:30.000000000 +0100
+@@ -726,6 +726,14 @@
{
user_exit();
@@ -4090,87 +4496,10 @@ diff -Nur linux-4.1.13.orig/arch/x86/kernel/signal.c linux-4.1.13/arch/x86/kerne
if (thread_info_flags & _TIF_UPROBE)
uprobe_notify_resume(regs);
-diff -Nur linux-4.1.13.orig/arch/x86/kernel/traps.c linux-4.1.13/arch/x86/kernel/traps.c
---- linux-4.1.13.orig/arch/x86/kernel/traps.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/kernel/traps.c 2015-11-29 09:23:09.529619496 +0100
-@@ -88,9 +88,21 @@
- local_irq_enable();
- }
-
--static inline void preempt_conditional_sti(struct pt_regs *regs)
-+static inline void conditional_sti_ist(struct pt_regs *regs)
- {
-+#ifdef CONFIG_X86_64
-+ /*
-+ * X86_64 uses a per CPU stack on the IST for certain traps
-+ * like int3. The task can not be preempted when using one
-+ * of these stacks, thus preemption must be disabled, otherwise
-+ * the stack can be corrupted if the task is scheduled out,
-+ * and another task comes in and uses this stack.
-+ *
-+ * On x86_32 the task keeps its own stack and it is OK if the
-+ * task schedules out.
-+ */
- preempt_count_inc();
-+#endif
- if (regs->flags & X86_EFLAGS_IF)
- local_irq_enable();
- }
-@@ -101,11 +113,13 @@
- local_irq_disable();
- }
-
--static inline void preempt_conditional_cli(struct pt_regs *regs)
-+static inline void conditional_cli_ist(struct pt_regs *regs)
- {
- if (regs->flags & X86_EFLAGS_IF)
- local_irq_disable();
-+#ifdef CONFIG_X86_64
- preempt_count_dec();
-+#endif
- }
-
- enum ctx_state ist_enter(struct pt_regs *regs)
-@@ -536,9 +550,9 @@
- * as we may switch to the interrupt stack.
- */
- debug_stack_usage_inc();
-- preempt_conditional_sti(regs);
-+ conditional_sti_ist(regs);
- do_trap(X86_TRAP_BP, SIGTRAP, "int3", regs, error_code, NULL);
-- preempt_conditional_cli(regs);
-+ conditional_cli_ist(regs);
- debug_stack_usage_dec();
- exit:
- ist_exit(regs, prev_state);
-@@ -668,12 +682,12 @@
- debug_stack_usage_inc();
-
- /* It's safe to allow irq's after DR6 has been saved */
-- preempt_conditional_sti(regs);
-+ conditional_sti_ist(regs);
-
- if (v8086_mode(regs)) {
- handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code,
- X86_TRAP_DB);
-- preempt_conditional_cli(regs);
-+ conditional_cli_ist(regs);
- debug_stack_usage_dec();
- goto exit;
- }
-@@ -693,7 +707,7 @@
- si_code = get_si_code(tsk->thread.debugreg6);
- if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS) || user_icebp)
- send_sigtrap(tsk, regs, error_code, si_code);
-- preempt_conditional_cli(regs);
-+ conditional_cli_ist(regs);
- debug_stack_usage_dec();
-
- exit:
-diff -Nur linux-4.1.13.orig/arch/x86/kvm/lapic.c linux-4.1.13/arch/x86/kvm/lapic.c
---- linux-4.1.13.orig/arch/x86/kvm/lapic.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/kvm/lapic.c 2015-11-29 09:23:09.529619496 +0100
-@@ -1104,7 +1104,7 @@
+diff -Nur linux-4.1.20.orig/arch/x86/kvm/lapic.c linux-4.1.20/arch/x86/kvm/lapic.c
+--- linux-4.1.20.orig/arch/x86/kvm/lapic.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/kvm/lapic.c 2016-03-21 20:18:30.000000000 +0100
+@@ -1106,7 +1106,7 @@
static void apic_timer_expired(struct kvm_lapic *apic)
{
struct kvm_vcpu *vcpu = apic->vcpu;
@@ -4179,7 +4508,7 @@ diff -Nur linux-4.1.13.orig/arch/x86/kvm/lapic.c linux-4.1.13/arch/x86/kvm/lapic
struct kvm_timer *ktimer = &apic->lapic_timer;
if (atomic_read(&apic->lapic_timer.pending))
-@@ -1113,8 +1113,8 @@
+@@ -1115,8 +1115,8 @@
atomic_inc(&apic->lapic_timer.pending);
kvm_set_pending_timer(vcpu);
@@ -4190,7 +4519,7 @@ diff -Nur linux-4.1.13.orig/arch/x86/kvm/lapic.c linux-4.1.13/arch/x86/kvm/lapic
if (apic_lvtt_tscdeadline(apic))
ktimer->expired_tscdeadline = ktimer->tscdeadline;
-@@ -1167,8 +1167,36 @@
+@@ -1169,8 +1169,36 @@
__delay(tsc_deadline - guest_tsc);
}
@@ -4227,7 +4556,7 @@ diff -Nur linux-4.1.13.orig/arch/x86/kvm/lapic.c linux-4.1.13/arch/x86/kvm/lapic
ktime_t now;
atomic_set(&apic->lapic_timer.pending, 0);
-@@ -1199,9 +1227,11 @@
+@@ -1201,9 +1229,11 @@
}
}
@@ -4240,7 +4569,7 @@ diff -Nur linux-4.1.13.orig/arch/x86/kvm/lapic.c linux-4.1.13/arch/x86/kvm/lapic
apic_debug("%s: bus cycle is %" PRId64 "ns, now 0x%016"
PRIx64 ", "
-@@ -1233,8 +1263,10 @@
+@@ -1235,8 +1265,10 @@
do_div(ns, this_tsc_khz);
expire = ktime_add_ns(now, ns);
expire = ktime_sub_ns(expire, lapic_timer_advance_ns);
@@ -4252,7 +4581,7 @@ diff -Nur linux-4.1.13.orig/arch/x86/kvm/lapic.c linux-4.1.13/arch/x86/kvm/lapic
} else
apic_timer_expired(apic);
-@@ -1707,6 +1739,7 @@
+@@ -1709,6 +1741,7 @@
hrtimer_init(&apic->lapic_timer.timer, CLOCK_MONOTONIC,
HRTIMER_MODE_ABS);
apic->lapic_timer.timer.function = apic_timer_fn;
@@ -4260,7 +4589,7 @@ diff -Nur linux-4.1.13.orig/arch/x86/kvm/lapic.c linux-4.1.13/arch/x86/kvm/lapic
/*
* APIC is created enabled. This will prevent kvm_lapic_set_base from
-@@ -1834,7 +1867,8 @@
+@@ -1836,7 +1869,8 @@
timer = &vcpu->arch.apic->lapic_timer.timer;
if (hrtimer_cancel(timer))
@@ -4270,10 +4599,10 @@ diff -Nur linux-4.1.13.orig/arch/x86/kvm/lapic.c linux-4.1.13/arch/x86/kvm/lapic
}
/*
-diff -Nur linux-4.1.13.orig/arch/x86/kvm/x86.c linux-4.1.13/arch/x86/kvm/x86.c
---- linux-4.1.13.orig/arch/x86/kvm/x86.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/kvm/x86.c 2015-11-29 09:23:09.529619496 +0100
-@@ -5813,6 +5813,13 @@
+diff -Nur linux-4.1.20.orig/arch/x86/kvm/x86.c linux-4.1.20/arch/x86/kvm/x86.c
+--- linux-4.1.20.orig/arch/x86/kvm/x86.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/kvm/x86.c 2016-03-21 20:18:30.000000000 +0100
+@@ -5809,6 +5809,13 @@
goto out;
}
@@ -4287,9 +4616,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/kvm/x86.c linux-4.1.13/arch/x86/kvm/x86.c
r = kvm_mmu_module_init();
if (r)
goto out_free_percpu;
-diff -Nur linux-4.1.13.orig/arch/x86/lib/usercopy_32.c linux-4.1.13/arch/x86/lib/usercopy_32.c
---- linux-4.1.13.orig/arch/x86/lib/usercopy_32.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/lib/usercopy_32.c 2015-11-29 09:23:09.533619230 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/lib/usercopy_32.c linux-4.1.20/arch/x86/lib/usercopy_32.c
+--- linux-4.1.20.orig/arch/x86/lib/usercopy_32.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/lib/usercopy_32.c 2016-03-21 20:18:30.000000000 +0100
@@ -647,7 +647,8 @@
* @from: Source address, in kernel space.
* @n: Number of bytes to copy.
@@ -4310,9 +4639,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/lib/usercopy_32.c linux-4.1.13/arch/x86/lib
*
* Copy data from user space to kernel space.
*
-diff -Nur linux-4.1.13.orig/arch/x86/mm/fault.c linux-4.1.13/arch/x86/mm/fault.c
---- linux-4.1.13.orig/arch/x86/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/mm/fault.c 2015-11-29 09:23:09.533619230 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/mm/fault.c linux-4.1.20/arch/x86/mm/fault.c
+--- linux-4.1.20.orig/arch/x86/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/mm/fault.c 2016-03-21 20:18:30.000000000 +0100
@@ -13,6 +13,7 @@
#include <linux/hugetlb.h> /* hstate_index_to_shift */
#include <linux/prefetch.h> /* prefetchw */
@@ -4321,7 +4650,7 @@ diff -Nur linux-4.1.13.orig/arch/x86/mm/fault.c linux-4.1.13/arch/x86/mm/fault.c
#include <asm/traps.h> /* dotraplinkage, ... */
#include <asm/pgalloc.h> /* pgd_*(), ... */
-@@ -1126,9 +1127,9 @@
+@@ -1133,9 +1134,9 @@
/*
* If we're in an interrupt, have no user context or are running
@@ -4333,9 +4662,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/mm/fault.c linux-4.1.13/arch/x86/mm/fault.c
bad_area_nosemaphore(regs, error_code, address);
return;
}
-diff -Nur linux-4.1.13.orig/arch/x86/mm/highmem_32.c linux-4.1.13/arch/x86/mm/highmem_32.c
---- linux-4.1.13.orig/arch/x86/mm/highmem_32.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/mm/highmem_32.c 2015-11-29 09:23:09.533619230 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/mm/highmem_32.c linux-4.1.20/arch/x86/mm/highmem_32.c
+--- linux-4.1.20.orig/arch/x86/mm/highmem_32.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/mm/highmem_32.c 2016-03-21 20:18:30.000000000 +0100
@@ -32,10 +32,11 @@
*/
void *kmap_atomic_prot(struct page *page, pgprot_t prot)
@@ -4379,9 +4708,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/mm/highmem_32.c linux-4.1.13/arch/x86/mm/hi
}
EXPORT_SYMBOL(__kunmap_atomic);
-diff -Nur linux-4.1.13.orig/arch/x86/mm/iomap_32.c linux-4.1.13/arch/x86/mm/iomap_32.c
---- linux-4.1.13.orig/arch/x86/mm/iomap_32.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/mm/iomap_32.c 2015-11-29 09:23:09.533619230 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/mm/iomap_32.c linux-4.1.20/arch/x86/mm/iomap_32.c
+--- linux-4.1.20.orig/arch/x86/mm/iomap_32.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/mm/iomap_32.c 2016-03-21 20:18:30.000000000 +0100
@@ -56,15 +56,22 @@
void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot)
@@ -4421,9 +4750,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/mm/iomap_32.c linux-4.1.13/arch/x86/mm/ioma
+ preempt_enable();
}
EXPORT_SYMBOL_GPL(iounmap_atomic);
-diff -Nur linux-4.1.13.orig/arch/x86/platform/uv/tlb_uv.c linux-4.1.13/arch/x86/platform/uv/tlb_uv.c
---- linux-4.1.13.orig/arch/x86/platform/uv/tlb_uv.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/platform/uv/tlb_uv.c 2015-11-29 09:23:09.533619230 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/platform/uv/tlb_uv.c linux-4.1.20/arch/x86/platform/uv/tlb_uv.c
+--- linux-4.1.20.orig/arch/x86/platform/uv/tlb_uv.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/platform/uv/tlb_uv.c 2016-03-21 20:18:30.000000000 +0100
@@ -714,9 +714,9 @@
quiesce_local_uvhub(hmaster);
@@ -4510,9 +4839,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/platform/uv/tlb_uv.c linux-4.1.13/arch/x86/
}
}
-diff -Nur linux-4.1.13.orig/arch/x86/platform/uv/uv_time.c linux-4.1.13/arch/x86/platform/uv/uv_time.c
---- linux-4.1.13.orig/arch/x86/platform/uv/uv_time.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/x86/platform/uv/uv_time.c 2015-11-29 09:23:09.533619230 +0100
+diff -Nur linux-4.1.20.orig/arch/x86/platform/uv/uv_time.c linux-4.1.20/arch/x86/platform/uv/uv_time.c
+--- linux-4.1.20.orig/arch/x86/platform/uv/uv_time.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/x86/platform/uv/uv_time.c 2016-03-21 20:18:30.000000000 +0100
@@ -58,7 +58,7 @@
/* There is one of these allocated per node */
@@ -4593,9 +4922,9 @@ diff -Nur linux-4.1.13.orig/arch/x86/platform/uv/uv_time.c linux-4.1.13/arch/x86
}
/*
-diff -Nur linux-4.1.13.orig/arch/xtensa/mm/fault.c linux-4.1.13/arch/xtensa/mm/fault.c
---- linux-4.1.13.orig/arch/xtensa/mm/fault.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/xtensa/mm/fault.c 2015-11-29 09:23:09.533619230 +0100
+diff -Nur linux-4.1.20.orig/arch/xtensa/mm/fault.c linux-4.1.20/arch/xtensa/mm/fault.c
+--- linux-4.1.20.orig/arch/xtensa/mm/fault.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/xtensa/mm/fault.c 2016-03-21 20:18:30.000000000 +0100
@@ -15,10 +15,10 @@
#include <linux/mm.h>
#include <linux/module.h>
@@ -4617,9 +4946,9 @@ diff -Nur linux-4.1.13.orig/arch/xtensa/mm/fault.c linux-4.1.13/arch/xtensa/mm/f
bad_page_fault(regs, address, SIGSEGV);
return;
}
-diff -Nur linux-4.1.13.orig/arch/xtensa/mm/highmem.c linux-4.1.13/arch/xtensa/mm/highmem.c
---- linux-4.1.13.orig/arch/xtensa/mm/highmem.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/arch/xtensa/mm/highmem.c 2015-11-29 09:23:09.533619230 +0100
+diff -Nur linux-4.1.20.orig/arch/xtensa/mm/highmem.c linux-4.1.20/arch/xtensa/mm/highmem.c
+--- linux-4.1.20.orig/arch/xtensa/mm/highmem.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/arch/xtensa/mm/highmem.c 2016-03-21 20:18:30.000000000 +0100
@@ -42,6 +42,7 @@
enum fixed_addresses idx;
unsigned long vaddr;
@@ -4636,9 +4965,9 @@ diff -Nur linux-4.1.13.orig/arch/xtensa/mm/highmem.c linux-4.1.13/arch/xtensa/mm
}
EXPORT_SYMBOL(__kunmap_atomic);
-diff -Nur linux-4.1.13.orig/block/blk-core.c linux-4.1.13/block/blk-core.c
---- linux-4.1.13.orig/block/blk-core.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/block/blk-core.c 2015-11-29 09:23:09.533619230 +0100
+diff -Nur linux-4.1.20.orig/block/blk-core.c linux-4.1.20/block/blk-core.c
+--- linux-4.1.20.orig/block/blk-core.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/block/blk-core.c 2016-03-21 20:18:30.000000000 +0100
@@ -100,6 +100,9 @@
INIT_LIST_HEAD(&rq->queuelist);
@@ -4714,9 +5043,9 @@ diff -Nur linux-4.1.13.orig/block/blk-core.c linux-4.1.13/block/blk-core.c
}
void blk_finish_plug(struct blk_plug *plug)
-diff -Nur linux-4.1.13.orig/block/blk-ioc.c linux-4.1.13/block/blk-ioc.c
---- linux-4.1.13.orig/block/blk-ioc.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/block/blk-ioc.c 2015-11-29 09:23:09.533619230 +0100
+diff -Nur linux-4.1.20.orig/block/blk-ioc.c linux-4.1.20/block/blk-ioc.c
+--- linux-4.1.20.orig/block/blk-ioc.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/block/blk-ioc.c 2016-03-21 20:18:31.000000000 +0100
@@ -7,6 +7,7 @@
#include <linux/bio.h>
#include <linux/blkdev.h>
@@ -4743,9 +5072,9 @@ diff -Nur linux-4.1.13.orig/block/blk-ioc.c linux-4.1.13/block/blk-ioc.c
goto retry;
}
}
-diff -Nur linux-4.1.13.orig/block/blk-iopoll.c linux-4.1.13/block/blk-iopoll.c
---- linux-4.1.13.orig/block/blk-iopoll.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/block/blk-iopoll.c 2015-11-29 09:23:09.533619230 +0100
+diff -Nur linux-4.1.20.orig/block/blk-iopoll.c linux-4.1.20/block/blk-iopoll.c
+--- linux-4.1.20.orig/block/blk-iopoll.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/block/blk-iopoll.c 2016-03-21 20:18:31.000000000 +0100
@@ -35,6 +35,7 @@
list_add_tail(&iop->list, this_cpu_ptr(&blk_cpu_iopoll));
__raise_softirq_irqoff(BLOCK_IOPOLL_SOFTIRQ);
@@ -4770,9 +5099,63 @@ diff -Nur linux-4.1.13.orig/block/blk-iopoll.c linux-4.1.13/block/blk-iopoll.c
}
return NOTIFY_OK;
-diff -Nur linux-4.1.13.orig/block/blk-mq.c linux-4.1.13/block/blk-mq.c
---- linux-4.1.13.orig/block/blk-mq.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/block/blk-mq.c 2015-11-29 09:23:09.533619230 +0100
+diff -Nur linux-4.1.20.orig/block/blk-mq-cpu.c linux-4.1.20/block/blk-mq-cpu.c
+--- linux-4.1.20.orig/block/blk-mq-cpu.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/block/blk-mq-cpu.c 2016-03-21 20:18:31.000000000 +0100
+@@ -16,7 +16,7 @@
+ #include "blk-mq.h"
+
+ static LIST_HEAD(blk_mq_cpu_notify_list);
+-static DEFINE_RAW_SPINLOCK(blk_mq_cpu_notify_lock);
++static DEFINE_SPINLOCK(blk_mq_cpu_notify_lock);
+
+ static int blk_mq_main_cpu_notify(struct notifier_block *self,
+ unsigned long action, void *hcpu)
+@@ -25,7 +25,10 @@
+ struct blk_mq_cpu_notifier *notify;
+ int ret = NOTIFY_OK;
+
+- raw_spin_lock(&blk_mq_cpu_notify_lock);
++ if (action != CPU_POST_DEAD)
++ return NOTIFY_OK;
++
++ spin_lock(&blk_mq_cpu_notify_lock);
+
+ list_for_each_entry(notify, &blk_mq_cpu_notify_list, list) {
+ ret = notify->notify(notify->data, action, cpu);
+@@ -33,7 +36,7 @@
+ break;
+ }
+
+- raw_spin_unlock(&blk_mq_cpu_notify_lock);
++ spin_unlock(&blk_mq_cpu_notify_lock);
+ return ret;
+ }
+
+@@ -41,16 +44,16 @@
+ {
+ BUG_ON(!notifier->notify);
+
+- raw_spin_lock(&blk_mq_cpu_notify_lock);
++ spin_lock(&blk_mq_cpu_notify_lock);
+ list_add_tail(&notifier->list, &blk_mq_cpu_notify_list);
+- raw_spin_unlock(&blk_mq_cpu_notify_lock);
++ spin_unlock(&blk_mq_cpu_notify_lock);
+ }
+
+ void blk_mq_unregister_cpu_notifier(struct blk_mq_cpu_notifier *notifier)
+ {
+- raw_spin_lock(&blk_mq_cpu_notify_lock);
++ spin_lock(&blk_mq_cpu_notify_lock);
+ list_del(&notifier->list);
+- raw_spin_unlock(&blk_mq_cpu_notify_lock);
++ spin_unlock(&blk_mq_cpu_notify_lock);
+ }
+
+ void blk_mq_init_cpu_notifier(struct blk_mq_cpu_notifier *notifier,
+diff -Nur linux-4.1.20.orig/block/blk-mq.c linux-4.1.20/block/blk-mq.c
+--- linux-4.1.20.orig/block/blk-mq.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/block/blk-mq.c 2016-03-21 20:18:31.000000000 +0100
@@ -88,7 +88,7 @@
if (!(gfp & __GFP_WAIT))
return -EBUSY;
@@ -4908,63 +5291,9 @@ diff -Nur linux-4.1.13.orig/block/blk-mq.c linux-4.1.13/block/blk-mq.c
return blk_mq_hctx_cpu_offline(hctx, cpu);
/*
-diff -Nur linux-4.1.13.orig/block/blk-mq-cpu.c linux-4.1.13/block/blk-mq-cpu.c
---- linux-4.1.13.orig/block/blk-mq-cpu.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/block/blk-mq-cpu.c 2015-11-29 09:23:09.533619230 +0100
-@@ -16,7 +16,7 @@
- #include "blk-mq.h"
-
- static LIST_HEAD(blk_mq_cpu_notify_list);
--static DEFINE_RAW_SPINLOCK(blk_mq_cpu_notify_lock);
-+static DEFINE_SPINLOCK(blk_mq_cpu_notify_lock);
-
- static int blk_mq_main_cpu_notify(struct notifier_block *self,
- unsigned long action, void *hcpu)
-@@ -25,7 +25,10 @@
- struct blk_mq_cpu_notifier *notify;
- int ret = NOTIFY_OK;
-
-- raw_spin_lock(&blk_mq_cpu_notify_lock);
-+ if (action != CPU_POST_DEAD)
-+ return NOTIFY_OK;
-+
-+ spin_lock(&blk_mq_cpu_notify_lock);
-
- list_for_each_entry(notify, &blk_mq_cpu_notify_list, list) {
- ret = notify->notify(notify->data, action, cpu);
-@@ -33,7 +36,7 @@
- break;
- }
-
-- raw_spin_unlock(&blk_mq_cpu_notify_lock);
-+ spin_unlock(&blk_mq_cpu_notify_lock);
- return ret;
- }
-
-@@ -41,16 +44,16 @@
- {
- BUG_ON(!notifier->notify);
-
-- raw_spin_lock(&blk_mq_cpu_notify_lock);
-+ spin_lock(&blk_mq_cpu_notify_lock);
- list_add_tail(&notifier->list, &blk_mq_cpu_notify_list);
-- raw_spin_unlock(&blk_mq_cpu_notify_lock);
-+ spin_unlock(&blk_mq_cpu_notify_lock);
- }
-
- void blk_mq_unregister_cpu_notifier(struct blk_mq_cpu_notifier *notifier)
- {
-- raw_spin_lock(&blk_mq_cpu_notify_lock);
-+ spin_lock(&blk_mq_cpu_notify_lock);
- list_del(&notifier->list);
-- raw_spin_unlock(&blk_mq_cpu_notify_lock);
-+ spin_unlock(&blk_mq_cpu_notify_lock);
- }
-
- void blk_mq_init_cpu_notifier(struct blk_mq_cpu_notifier *notifier,
-diff -Nur linux-4.1.13.orig/block/blk-mq.h linux-4.1.13/block/blk-mq.h
---- linux-4.1.13.orig/block/blk-mq.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/block/blk-mq.h 2015-11-29 09:23:09.533619230 +0100
+diff -Nur linux-4.1.20.orig/block/blk-mq.h linux-4.1.20/block/blk-mq.h
+--- linux-4.1.20.orig/block/blk-mq.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/block/blk-mq.h 2016-03-21 20:18:31.000000000 +0100
@@ -76,7 +76,10 @@
static inline struct blk_mq_ctx *__blk_mq_get_ctx(struct request_queue *q,
unsigned int cpu)
@@ -4992,9 +5321,9 @@ diff -Nur linux-4.1.13.orig/block/blk-mq.h linux-4.1.13/block/blk-mq.h
}
struct blk_mq_alloc_data {
-diff -Nur linux-4.1.13.orig/block/blk-softirq.c linux-4.1.13/block/blk-softirq.c
---- linux-4.1.13.orig/block/blk-softirq.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/block/blk-softirq.c 2015-11-29 09:23:09.533619230 +0100
+diff -Nur linux-4.1.20.orig/block/blk-softirq.c linux-4.1.20/block/blk-softirq.c
+--- linux-4.1.20.orig/block/blk-softirq.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/block/blk-softirq.c 2016-03-21 20:18:31.000000000 +0100
@@ -51,6 +51,7 @@
raise_softirq_irqoff(BLOCK_SOFTIRQ);
@@ -5019,9 +5348,9 @@ diff -Nur linux-4.1.13.orig/block/blk-softirq.c linux-4.1.13/block/blk-softirq.c
}
/**
-diff -Nur linux-4.1.13.orig/block/bounce.c linux-4.1.13/block/bounce.c
---- linux-4.1.13.orig/block/bounce.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/block/bounce.c 2015-11-29 09:23:09.537618965 +0100
+diff -Nur linux-4.1.20.orig/block/bounce.c linux-4.1.20/block/bounce.c
+--- linux-4.1.20.orig/block/bounce.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/block/bounce.c 2016-03-21 20:18:31.000000000 +0100
@@ -54,11 +54,11 @@
unsigned long flags;
unsigned char *vto;
@@ -5036,9 +5365,9 @@ diff -Nur linux-4.1.13.orig/block/bounce.c linux-4.1.13/block/bounce.c
}
#else /* CONFIG_HIGHMEM */
-diff -Nur linux-4.1.13.orig/crypto/algapi.c linux-4.1.13/crypto/algapi.c
---- linux-4.1.13.orig/crypto/algapi.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/crypto/algapi.c 2015-11-29 09:23:09.537618965 +0100
+diff -Nur linux-4.1.20.orig/crypto/algapi.c linux-4.1.20/crypto/algapi.c
+--- linux-4.1.20.orig/crypto/algapi.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/crypto/algapi.c 2016-03-21 20:18:31.000000000 +0100
@@ -695,13 +695,13 @@
int crypto_register_notifier(struct notifier_block *nb)
@@ -5055,9 +5384,9 @@ diff -Nur linux-4.1.13.orig/crypto/algapi.c linux-4.1.13/crypto/algapi.c
}
EXPORT_SYMBOL_GPL(crypto_unregister_notifier);
-diff -Nur linux-4.1.13.orig/crypto/api.c linux-4.1.13/crypto/api.c
---- linux-4.1.13.orig/crypto/api.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/crypto/api.c 2015-11-29 09:23:09.537618965 +0100
+diff -Nur linux-4.1.20.orig/crypto/api.c linux-4.1.20/crypto/api.c
+--- linux-4.1.20.orig/crypto/api.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/crypto/api.c 2016-03-21 20:18:31.000000000 +0100
@@ -31,7 +31,7 @@
DECLARE_RWSEM(crypto_alg_sem);
EXPORT_SYMBOL_GPL(crypto_alg_sem);
@@ -5080,9 +5409,9 @@ diff -Nur linux-4.1.13.orig/crypto/api.c linux-4.1.13/crypto/api.c
}
return ok;
-diff -Nur linux-4.1.13.orig/crypto/internal.h linux-4.1.13/crypto/internal.h
---- linux-4.1.13.orig/crypto/internal.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/crypto/internal.h 2015-11-29 09:23:09.537618965 +0100
+diff -Nur linux-4.1.20.orig/crypto/internal.h linux-4.1.20/crypto/internal.h
+--- linux-4.1.20.orig/crypto/internal.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/crypto/internal.h 2016-03-21 20:18:31.000000000 +0100
@@ -48,7 +48,7 @@
extern struct list_head crypto_alg_list;
@@ -5101,290 +5430,9 @@ diff -Nur linux-4.1.13.orig/crypto/internal.h linux-4.1.13/crypto/internal.h
}
#endif /* _CRYPTO_INTERNAL_H */
-diff -Nur linux-4.1.13.orig/Documentation/hwlat_detector.txt linux-4.1.13/Documentation/hwlat_detector.txt
---- linux-4.1.13.orig/Documentation/hwlat_detector.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/Documentation/hwlat_detector.txt 2015-11-29 09:23:09.477622951 +0100
-@@ -0,0 +1,64 @@
-+Introduction:
-+-------------
-+
-+The module hwlat_detector is a special purpose kernel module that is used to
-+detect large system latencies induced by the behavior of certain underlying
-+hardware or firmware, independent of Linux itself. The code was developed
-+originally to detect SMIs (System Management Interrupts) on x86 systems,
-+however there is nothing x86 specific about this patchset. It was
-+originally written for use by the "RT" patch since the Real Time
-+kernel is highly latency sensitive.
-+
-+SMIs are usually not serviced by the Linux kernel, which typically does not
-+even know that they are occuring. SMIs are instead are set up by BIOS code
-+and are serviced by BIOS code, usually for "critical" events such as
-+management of thermal sensors and fans. Sometimes though, SMIs are used for
-+other tasks and those tasks can spend an inordinate amount of time in the
-+handler (sometimes measured in milliseconds). Obviously this is a problem if
-+you are trying to keep event service latencies down in the microsecond range.
-+
-+The hardware latency detector works by hogging all of the cpus for configurable
-+amounts of time (by calling stop_machine()), polling the CPU Time Stamp Counter
-+for some period, then looking for gaps in the TSC data. Any gap indicates a
-+time when the polling was interrupted and since the machine is stopped and
-+interrupts turned off the only thing that could do that would be an SMI.
-+
-+Note that the SMI detector should *NEVER* be used in a production environment.
-+It is intended to be run manually to determine if the hardware platform has a
-+problem with long system firmware service routines.
-+
-+Usage:
-+------
-+
-+Loading the module hwlat_detector passing the parameter "enabled=1" (or by
-+setting the "enable" entry in "hwlat_detector" debugfs toggled on) is the only
-+step required to start the hwlat_detector. It is possible to redefine the
-+threshold in microseconds (us) above which latency spikes will be taken
-+into account (parameter "threshold=").
-+
-+Example:
-+
-+ # modprobe hwlat_detector enabled=1 threshold=100
-+
-+After the module is loaded, it creates a directory named "hwlat_detector" under
-+the debugfs mountpoint, "/debug/hwlat_detector" for this text. It is necessary
-+to have debugfs mounted, which might be on /sys/debug on your system.
-+
-+The /debug/hwlat_detector interface contains the following files:
-+
-+count - number of latency spikes observed since last reset
-+enable - a global enable/disable toggle (0/1), resets count
-+max - maximum hardware latency actually observed (usecs)
-+sample - a pipe from which to read current raw sample data
-+ in the format <timestamp> <latency observed usecs>
-+ (can be opened O_NONBLOCK for a single sample)
-+threshold - minimum latency value to be considered (usecs)
-+width - time period to sample with CPUs held (usecs)
-+ must be less than the total window size (enforced)
-+window - total period of sampling, width being inside (usecs)
-+
-+By default we will set width to 500,000 and window to 1,000,000, meaning that
-+we will sample every 1,000,000 usecs (1s) for 500,000 usecs (0.5s). If we
-+observe any latencies that exceed the threshold (initially 100 usecs),
-+then we write to a global sample ring buffer of 8K samples, which is
-+consumed by reading from the "sample" (pipe) debugfs file interface.
-diff -Nur linux-4.1.13.orig/Documentation/sysrq.txt linux-4.1.13/Documentation/sysrq.txt
---- linux-4.1.13.orig/Documentation/sysrq.txt 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/Documentation/sysrq.txt 2015-11-29 09:23:09.477622951 +0100
-@@ -59,10 +59,17 @@
- On other - If you know of the key combos for other architectures, please
- let me know so I can add them to this section.
-
--On all - write a character to /proc/sysrq-trigger. e.g.:
--
-+On all - write a character to /proc/sysrq-trigger, e.g.:
- echo t > /proc/sysrq-trigger
-
-+On all - Enable network SysRq by writing a cookie to icmp_echo_sysrq, e.g.
-+ echo 0x01020304 >/proc/sys/net/ipv4/icmp_echo_sysrq
-+ Send an ICMP echo request with this pattern plus the particular
-+ SysRq command key. Example:
-+ # ping -c1 -s57 -p0102030468
-+ will trigger the SysRq-H (help) command.
-+
-+
- * What are the 'command' keys?
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 'b' - Will immediately reboot the system without syncing or unmounting
-diff -Nur linux-4.1.13.orig/Documentation/trace/histograms.txt linux-4.1.13/Documentation/trace/histograms.txt
---- linux-4.1.13.orig/Documentation/trace/histograms.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/Documentation/trace/histograms.txt 2015-11-29 09:23:09.477622951 +0100
-@@ -0,0 +1,186 @@
-+ Using the Linux Kernel Latency Histograms
-+
-+
-+This document gives a short explanation how to enable, configure and use
-+latency histograms. Latency histograms are primarily relevant in the
-+context of real-time enabled kernels (CONFIG_PREEMPT/CONFIG_PREEMPT_RT)
-+and are used in the quality management of the Linux real-time
-+capabilities.
-+
-+
-+* Purpose of latency histograms
-+
-+A latency histogram continuously accumulates the frequencies of latency
-+data. There are two types of histograms
-+- potential sources of latencies
-+- effective latencies
-+
-+
-+* Potential sources of latencies
-+
-+Potential sources of latencies are code segments where interrupts,
-+preemption or both are disabled (aka critical sections). To create
-+histograms of potential sources of latency, the kernel stores the time
-+stamp at the start of a critical section, determines the time elapsed
-+when the end of the section is reached, and increments the frequency
-+counter of that latency value - irrespective of whether any concurrently
-+running process is affected by latency or not.
-+- Configuration items (in the Kernel hacking/Tracers submenu)
-+ CONFIG_INTERRUPT_OFF_LATENCY
-+ CONFIG_PREEMPT_OFF_LATENCY
-+
-+
-+* Effective latencies
-+
-+Effective latencies are actually occuring during wakeup of a process. To
-+determine effective latencies, the kernel stores the time stamp when a
-+process is scheduled to be woken up, and determines the duration of the
-+wakeup time shortly before control is passed over to this process. Note
-+that the apparent latency in user space may be somewhat longer, since the
-+process may be interrupted after control is passed over to it but before
-+the execution in user space takes place. Simply measuring the interval
-+between enqueuing and wakeup may also not appropriate in cases when a
-+process is scheduled as a result of a timer expiration. The timer may have
-+missed its deadline, e.g. due to disabled interrupts, but this latency
-+would not be registered. Therefore, the offsets of missed timers are
-+recorded in a separate histogram. If both wakeup latency and missed timer
-+offsets are configured and enabled, a third histogram may be enabled that
-+records the overall latency as a sum of the timer latency, if any, and the
-+wakeup latency. This histogram is called "timerandwakeup".
-+- Configuration items (in the Kernel hacking/Tracers submenu)
-+ CONFIG_WAKEUP_LATENCY
-+ CONFIG_MISSED_TIMER_OFSETS
-+
-+
-+* Usage
-+
-+The interface to the administration of the latency histograms is located
-+in the debugfs file system. To mount it, either enter
-+
-+mount -t sysfs nodev /sys
-+mount -t debugfs nodev /sys/kernel/debug
-+
-+from shell command line level, or add
-+
-+nodev /sys sysfs defaults 0 0
-+nodev /sys/kernel/debug debugfs defaults 0 0
-+
-+to the file /etc/fstab. All latency histogram related files are then
-+available in the directory /sys/kernel/debug/tracing/latency_hist. A
-+particular histogram type is enabled by writing non-zero to the related
-+variable in the /sys/kernel/debug/tracing/latency_hist/enable directory.
-+Select "preemptirqsoff" for the histograms of potential sources of
-+latencies and "wakeup" for histograms of effective latencies etc. The
-+histogram data - one per CPU - are available in the files
-+
-+/sys/kernel/debug/tracing/latency_hist/preemptoff/CPUx
-+/sys/kernel/debug/tracing/latency_hist/irqsoff/CPUx
-+/sys/kernel/debug/tracing/latency_hist/preemptirqsoff/CPUx
-+/sys/kernel/debug/tracing/latency_hist/wakeup/CPUx
-+/sys/kernel/debug/tracing/latency_hist/wakeup/sharedprio/CPUx
-+/sys/kernel/debug/tracing/latency_hist/missed_timer_offsets/CPUx
-+/sys/kernel/debug/tracing/latency_hist/timerandwakeup/CPUx
-+
-+The histograms are reset by writing non-zero to the file "reset" in a
-+particular latency directory. To reset all latency data, use
-+
-+#!/bin/sh
-+
-+TRACINGDIR=/sys/kernel/debug/tracing
-+HISTDIR=$TRACINGDIR/latency_hist
-+
-+if test -d $HISTDIR
-+then
-+ cd $HISTDIR
-+ for i in `find . | grep /reset$`
-+ do
-+ echo 1 >$i
-+ done
-+fi
-+
-+
-+* Data format
-+
-+Latency data are stored with a resolution of one microsecond. The
-+maximum latency is 10,240 microseconds. The data are only valid, if the
-+overflow register is empty. Every output line contains the latency in
-+microseconds in the first row and the number of samples in the second
-+row. To display only lines with a positive latency count, use, for
-+example,
-+
-+grep -v " 0$" /sys/kernel/debug/tracing/latency_hist/preemptoff/CPU0
-+
-+#Minimum latency: 0 microseconds.
-+#Average latency: 0 microseconds.
-+#Maximum latency: 25 microseconds.
-+#Total samples: 3104770694
-+#There are 0 samples greater or equal than 10240 microseconds
-+#usecs samples
-+ 0 2984486876
-+ 1 49843506
-+ 2 58219047
-+ 3 5348126
-+ 4 2187960
-+ 5 3388262
-+ 6 959289
-+ 7 208294
-+ 8 40420
-+ 9 4485
-+ 10 14918
-+ 11 18340
-+ 12 25052
-+ 13 19455
-+ 14 5602
-+ 15 969
-+ 16 47
-+ 17 18
-+ 18 14
-+ 19 1
-+ 20 3
-+ 21 2
-+ 22 5
-+ 23 2
-+ 25 1
-+
-+
-+* Wakeup latency of a selected process
-+
-+To only collect wakeup latency data of a particular process, write the
-+PID of the requested process to
-+
-+/sys/kernel/debug/tracing/latency_hist/wakeup/pid
-+
-+PIDs are not considered, if this variable is set to 0.
-+
-+
-+* Details of the process with the highest wakeup latency so far
-+
-+Selected data of the process that suffered from the highest wakeup
-+latency that occurred in a particular CPU are available in the file
-+
-+/sys/kernel/debug/tracing/latency_hist/wakeup/max_latency-CPUx.
-+
-+In addition, other relevant system data at the time when the
-+latency occurred are given.
-+
-+The format of the data is (all in one line):
-+<PID> <Priority> <Latency> (<Timeroffset>) <Command> \
-+<- <PID> <Priority> <Command> <Timestamp>
-+
-+The value of <Timeroffset> is only relevant in the combined timer
-+and wakeup latency recording. In the wakeup recording, it is
-+always 0, in the missed_timer_offsets recording, it is the same
-+as <Latency>.
-+
-+When retrospectively searching for the origin of a latency and
-+tracing was not enabled, it may be helpful to know the name and
-+some basic data of the task that (finally) was switching to the
-+late real-tlme task. In addition to the victim's data, also the
-+data of the possible culprit are therefore displayed after the
-+"<-" symbol.
-+
-+Finally, the timestamp of the time when the latency occurred
-+in <seconds>.<microseconds> after the most recent system boot
-+is provided.
-+
-+These data are also reset when the wakeup histogram is reset.
-diff -Nur linux-4.1.13.orig/drivers/acpi/acpica/acglobal.h linux-4.1.13/drivers/acpi/acpica/acglobal.h
---- linux-4.1.13.orig/drivers/acpi/acpica/acglobal.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/acpi/acpica/acglobal.h 2015-11-29 09:23:09.537618965 +0100
+diff -Nur linux-4.1.20.orig/drivers/acpi/acpica/acglobal.h linux-4.1.20/drivers/acpi/acpica/acglobal.h
+--- linux-4.1.20.orig/drivers/acpi/acpica/acglobal.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/acpi/acpica/acglobal.h 2016-03-21 20:18:31.000000000 +0100
@@ -112,7 +112,7 @@
* interrupt level
*/
@@ -5394,9 +5442,9 @@ diff -Nur linux-4.1.13.orig/drivers/acpi/acpica/acglobal.h linux-4.1.13/drivers/
ACPI_GLOBAL(acpi_spinlock, acpi_gbl_reference_count_lock);
/* Mutex for _OSI support */
-diff -Nur linux-4.1.13.orig/drivers/acpi/acpica/hwregs.c linux-4.1.13/drivers/acpi/acpica/hwregs.c
---- linux-4.1.13.orig/drivers/acpi/acpica/hwregs.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/acpi/acpica/hwregs.c 2015-11-29 09:23:09.537618965 +0100
+diff -Nur linux-4.1.20.orig/drivers/acpi/acpica/hwregs.c linux-4.1.20/drivers/acpi/acpica/hwregs.c
+--- linux-4.1.20.orig/drivers/acpi/acpica/hwregs.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/acpi/acpica/hwregs.c 2016-03-21 20:18:31.000000000 +0100
@@ -269,14 +269,14 @@
ACPI_BITMASK_ALL_FIXED_STATUS,
ACPI_FORMAT_UINT64(acpi_gbl_xpm1a_status.address)));
@@ -5414,9 +5462,9 @@ diff -Nur linux-4.1.13.orig/drivers/acpi/acpica/hwregs.c linux-4.1.13/drivers/ac
if (ACPI_FAILURE(status)) {
goto exit;
-diff -Nur linux-4.1.13.orig/drivers/acpi/acpica/hwxface.c linux-4.1.13/drivers/acpi/acpica/hwxface.c
---- linux-4.1.13.orig/drivers/acpi/acpica/hwxface.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/acpi/acpica/hwxface.c 2015-11-29 09:23:09.537618965 +0100
+diff -Nur linux-4.1.20.orig/drivers/acpi/acpica/hwxface.c linux-4.1.20/drivers/acpi/acpica/hwxface.c
+--- linux-4.1.20.orig/drivers/acpi/acpica/hwxface.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/acpi/acpica/hwxface.c 2016-03-21 20:18:31.000000000 +0100
@@ -374,7 +374,7 @@
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
@@ -5435,9 +5483,9 @@ diff -Nur linux-4.1.13.orig/drivers/acpi/acpica/hwxface.c linux-4.1.13/drivers/a
return_ACPI_STATUS(status);
}
-diff -Nur linux-4.1.13.orig/drivers/acpi/acpica/utmutex.c linux-4.1.13/drivers/acpi/acpica/utmutex.c
---- linux-4.1.13.orig/drivers/acpi/acpica/utmutex.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/acpi/acpica/utmutex.c 2015-11-29 09:23:09.537618965 +0100
+diff -Nur linux-4.1.20.orig/drivers/acpi/acpica/utmutex.c linux-4.1.20/drivers/acpi/acpica/utmutex.c
+--- linux-4.1.20.orig/drivers/acpi/acpica/utmutex.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/acpi/acpica/utmutex.c 2016-03-21 20:18:31.000000000 +0100
@@ -88,7 +88,7 @@
return_ACPI_STATUS (status);
}
@@ -5456,9 +5504,9 @@ diff -Nur linux-4.1.13.orig/drivers/acpi/acpica/utmutex.c linux-4.1.13/drivers/a
acpi_os_delete_lock(acpi_gbl_reference_count_lock);
/* Delete the reader/writer lock */
-diff -Nur linux-4.1.13.orig/drivers/ata/libata-sff.c linux-4.1.13/drivers/ata/libata-sff.c
---- linux-4.1.13.orig/drivers/ata/libata-sff.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/ata/libata-sff.c 2015-11-29 09:23:09.537618965 +0100
+diff -Nur linux-4.1.20.orig/drivers/ata/libata-sff.c linux-4.1.20/drivers/ata/libata-sff.c
+--- linux-4.1.20.orig/drivers/ata/libata-sff.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/ata/libata-sff.c 2016-03-21 20:18:31.000000000 +0100
@@ -678,9 +678,9 @@
unsigned long flags;
unsigned int consumed;
@@ -5507,9 +5555,9 @@ diff -Nur linux-4.1.13.orig/drivers/ata/libata-sff.c linux-4.1.13/drivers/ata/li
} else {
buf = page_address(page);
consumed = ap->ops->sff_data_xfer(dev, buf + offset,
-diff -Nur linux-4.1.13.orig/drivers/char/random.c linux-4.1.13/drivers/char/random.c
---- linux-4.1.13.orig/drivers/char/random.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/char/random.c 2015-11-29 09:23:09.537618965 +0100
+diff -Nur linux-4.1.20.orig/drivers/char/random.c linux-4.1.20/drivers/char/random.c
+--- linux-4.1.20.orig/drivers/char/random.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/char/random.c 2016-03-21 20:18:31.000000000 +0100
@@ -776,8 +776,6 @@
} sample;
long delta, delta2, delta3;
@@ -5561,9 +5609,9 @@ diff -Nur linux-4.1.13.orig/drivers/char/random.c linux-4.1.13/drivers/char/rand
fast_mix(fast_pool);
add_interrupt_bench(cycles);
-diff -Nur linux-4.1.13.orig/drivers/clocksource/tcb_clksrc.c linux-4.1.13/drivers/clocksource/tcb_clksrc.c
---- linux-4.1.13.orig/drivers/clocksource/tcb_clksrc.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/clocksource/tcb_clksrc.c 2015-11-29 09:23:09.537618965 +0100
+diff -Nur linux-4.1.20.orig/drivers/clocksource/tcb_clksrc.c linux-4.1.20/drivers/clocksource/tcb_clksrc.c
+--- linux-4.1.20.orig/drivers/clocksource/tcb_clksrc.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/clocksource/tcb_clksrc.c 2016-03-21 20:18:31.000000000 +0100
@@ -23,8 +23,7 @@
* this 32 bit free-running counter. the second channel is not used.
*
@@ -5678,9 +5726,9 @@ diff -Nur linux-4.1.13.orig/drivers/clocksource/tcb_clksrc.c linux-4.1.13/driver
if (ret)
goto err_unregister_clksrc;
-diff -Nur linux-4.1.13.orig/drivers/clocksource/timer-atmel-pit.c linux-4.1.13/drivers/clocksource/timer-atmel-pit.c
---- linux-4.1.13.orig/drivers/clocksource/timer-atmel-pit.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/clocksource/timer-atmel-pit.c 2015-11-29 09:23:09.537618965 +0100
+diff -Nur linux-4.1.20.orig/drivers/clocksource/timer-atmel-pit.c linux-4.1.20/drivers/clocksource/timer-atmel-pit.c
+--- linux-4.1.20.orig/drivers/clocksource/timer-atmel-pit.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/clocksource/timer-atmel-pit.c 2016-03-21 20:18:31.000000000 +0100
@@ -90,6 +90,7 @@
return elapsed;
}
@@ -5706,9 +5754,9 @@ diff -Nur linux-4.1.13.orig/drivers/clocksource/timer-atmel-pit.c linux-4.1.13/d
break;
case CLOCK_EVT_MODE_RESUME:
break;
-diff -Nur linux-4.1.13.orig/drivers/clocksource/timer-atmel-st.c linux-4.1.13/drivers/clocksource/timer-atmel-st.c
---- linux-4.1.13.orig/drivers/clocksource/timer-atmel-st.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/clocksource/timer-atmel-st.c 2015-11-29 09:23:09.537618965 +0100
+diff -Nur linux-4.1.20.orig/drivers/clocksource/timer-atmel-st.c linux-4.1.20/drivers/clocksource/timer-atmel-st.c
+--- linux-4.1.20.orig/drivers/clocksource/timer-atmel-st.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/clocksource/timer-atmel-st.c 2016-03-21 20:18:31.000000000 +0100
@@ -131,6 +131,7 @@
break;
case CLOCK_EVT_MODE_SHUTDOWN:
@@ -5717,9 +5765,21 @@ diff -Nur linux-4.1.13.orig/drivers/clocksource/timer-atmel-st.c linux-4.1.13/dr
case CLOCK_EVT_MODE_RESUME:
irqmask = 0;
break;
-diff -Nur linux-4.1.13.orig/drivers/cpufreq/cpufreq.c linux-4.1.13/drivers/cpufreq/cpufreq.c
---- linux-4.1.13.orig/drivers/cpufreq/cpufreq.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/cpufreq/cpufreq.c 2015-11-29 09:23:09.545618436 +0100
+diff -Nur linux-4.1.20.orig/drivers/cpufreq/Kconfig.x86 linux-4.1.20/drivers/cpufreq/Kconfig.x86
+--- linux-4.1.20.orig/drivers/cpufreq/Kconfig.x86 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/cpufreq/Kconfig.x86 2016-03-21 20:18:31.000000000 +0100
+@@ -123,7 +123,7 @@
+
+ config X86_POWERNOW_K8
+ tristate "AMD Opteron/Athlon64 PowerNow!"
+- depends on ACPI && ACPI_PROCESSOR && X86_ACPI_CPUFREQ
++ depends on ACPI && ACPI_PROCESSOR && X86_ACPI_CPUFREQ && !PREEMPT_RT_BASE
+ help
+ This adds the CPUFreq driver for K8/early Opteron/Athlon64 processors.
+ Support for K10 and newer processors is now in acpi-cpufreq.
+diff -Nur linux-4.1.20.orig/drivers/cpufreq/cpufreq.c linux-4.1.20/drivers/cpufreq/cpufreq.c
+--- linux-4.1.20.orig/drivers/cpufreq/cpufreq.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/cpufreq/cpufreq.c 2016-03-21 20:18:31.000000000 +0100
@@ -64,12 +64,6 @@
return cpufreq_driver->target_index || cpufreq_driver->target;
}
@@ -5856,49 +5916,182 @@ diff -Nur linux-4.1.13.orig/drivers/cpufreq/cpufreq.c linux-4.1.13/drivers/cpufr
return 0;
}
-diff -Nur linux-4.1.13.orig/drivers/cpufreq/Kconfig.x86 linux-4.1.13/drivers/cpufreq/Kconfig.x86
---- linux-4.1.13.orig/drivers/cpufreq/Kconfig.x86 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/cpufreq/Kconfig.x86 2015-11-29 09:23:09.545618436 +0100
-@@ -123,7 +123,7 @@
-
- config X86_POWERNOW_K8
- tristate "AMD Opteron/Athlon64 PowerNow!"
-- depends on ACPI && ACPI_PROCESSOR && X86_ACPI_CPUFREQ
-+ depends on ACPI && ACPI_PROCESSOR && X86_ACPI_CPUFREQ && !PREEMPT_RT_BASE
- help
- This adds the CPUFreq driver for K8/early Opteron/Athlon64 processors.
- Support for K10 and newer processors is now in acpi-cpufreq.
-diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/gpio-omap.c
---- linux-4.1.13.orig/drivers/gpio/gpio-omap.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/gpio/gpio-omap.c 2015-11-29 09:23:09.545618436 +0100
-@@ -57,7 +57,7 @@
+diff -Nur linux-4.1.20.orig/drivers/gpio/Kconfig linux-4.1.20/drivers/gpio/Kconfig
+--- linux-4.1.20.orig/drivers/gpio/Kconfig 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/gpio/Kconfig 2016-03-21 20:18:31.000000000 +0100
+@@ -308,7 +308,7 @@
+ family of SOCs.
+
+ config GPIO_OMAP
+- bool "TI OMAP GPIO support" if COMPILE_TEST && !ARCH_OMAP2PLUS
++ tristate "TI OMAP GPIO support" if ARCH_OMAP2PLUS || COMPILE_TEST
+ default y if ARCH_OMAP
+ depends on ARM
+ select GENERIC_IRQ_CHIP
+diff -Nur linux-4.1.20.orig/drivers/gpio/gpio-omap.c linux-4.1.20/drivers/gpio/gpio-omap.c
+--- linux-4.1.20.orig/drivers/gpio/gpio-omap.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/gpio/gpio-omap.c 2016-03-21 20:18:31.000000000 +0100
+@@ -29,6 +29,7 @@
+ #include <linux/platform_data/gpio-omap.h>
+
+ #define OFF_MODE 1
++#define OMAP4_GPIO_DEBOUNCINGTIME_MASK 0xFF
+
+ static LIST_HEAD(omap_gpio_list);
+
+@@ -50,14 +51,15 @@
+ struct gpio_bank {
+ struct list_head node;
+ void __iomem *base;
+- u16 irq;
++ int irq;
+ u32 non_wakeup_gpios;
+ u32 enabled_non_wakeup_gpios;
+ struct gpio_regs context;
u32 saved_datain;
u32 level_mask;
u32 toggle_mask;
- spinlock_t lock;
+ raw_spinlock_t lock;
++ raw_spinlock_t wa_lock;
struct gpio_chip chip;
struct clk *dbck;
u32 mod_usage;
-@@ -498,14 +498,14 @@
+@@ -67,7 +69,7 @@
+ struct device *dev;
+ bool is_mpuio;
+ bool dbck_flag;
+- bool loses_context;
++
+ bool context_valid;
+ int stride;
+ u32 width;
+@@ -175,7 +177,7 @@
+ static inline void omap_gpio_dbck_enable(struct gpio_bank *bank)
+ {
+ if (bank->dbck_enable_mask && !bank->dbck_enabled) {
+- clk_prepare_enable(bank->dbck);
++ clk_enable(bank->dbck);
+ bank->dbck_enabled = true;
+
+ writel_relaxed(bank->dbck_enable_mask,
+@@ -193,7 +195,7 @@
+ */
+ writel_relaxed(0, bank->base + bank->regs->debounce_en);
+
+- clk_disable_unprepare(bank->dbck);
++ clk_disable(bank->dbck);
+ bank->dbck_enabled = false;
+ }
+ }
+@@ -204,8 +206,9 @@
+ * @offset: the gpio number on this @bank
+ * @debounce: debounce time to use
+ *
+- * OMAP's debounce time is in 31us steps so we need
+- * to convert and round up to the closest unit.
++ * OMAP's debounce time is in 31us steps
++ * <debounce time> = (GPIO_DEBOUNCINGTIME[7:0].DEBOUNCETIME + 1) x 31
++ * so we need to convert and round up to the closest unit.
+ */
+ static void omap2_set_gpio_debounce(struct gpio_bank *bank, unsigned offset,
+ unsigned debounce)
+@@ -213,34 +216,33 @@
+ void __iomem *reg;
+ u32 val;
+ u32 l;
++ bool enable = !!debounce;
+
+ if (!bank->dbck_flag)
+ return;
+
+- if (debounce < 32)
+- debounce = 0x01;
+- else if (debounce > 7936)
+- debounce = 0xff;
+- else
+- debounce = (debounce / 0x1f) - 1;
++ if (enable) {
++ debounce = DIV_ROUND_UP(debounce, 31) - 1;
++ debounce &= OMAP4_GPIO_DEBOUNCINGTIME_MASK;
++ }
+
+ l = BIT(offset);
+
+- clk_prepare_enable(bank->dbck);
++ clk_enable(bank->dbck);
+ reg = bank->base + bank->regs->debounce;
+ writel_relaxed(debounce, reg);
+
+ reg = bank->base + bank->regs->debounce_en;
+ val = readl_relaxed(reg);
+
+- if (debounce)
++ if (enable)
+ val |= l;
+ else
+ val &= ~l;
+ bank->dbck_enable_mask = val;
+
+ writel_relaxed(val, reg);
+- clk_disable_unprepare(bank->dbck);
++ clk_disable(bank->dbck);
+ /*
+ * Enable debounce clock per module.
+ * This call is mandatory because in omap_gpio_request() when
+@@ -285,7 +287,7 @@
+ bank->context.debounce = 0;
+ writel_relaxed(bank->context.debounce, bank->base +
+ bank->regs->debounce);
+- clk_disable_unprepare(bank->dbck);
++ clk_disable(bank->dbck);
+ bank->dbck_enabled = false;
+ }
+ }
+@@ -488,9 +490,6 @@
+ unsigned long flags;
+ unsigned offset = d->hwirq;
+
+- if (!BANK_USED(bank))
+- pm_runtime_get_sync(bank->dev);
+-
+ if (type & ~IRQ_TYPE_SENSE_MASK)
+ return -EINVAL;
+
+@@ -498,20 +497,28 @@
(type & (IRQ_TYPE_LEVEL_LOW|IRQ_TYPE_LEVEL_HIGH)))
return -EINVAL;
- spin_lock_irqsave(&bank->lock, flags);
+ raw_spin_lock_irqsave(&bank->lock, flags);
retval = omap_set_gpio_triggering(bank, offset, type);
++ if (retval) {
++ raw_spin_unlock_irqrestore(&bank->lock, flags);
++ goto error;
++ }
omap_gpio_init_irq(bank, offset);
if (!omap_gpio_is_input(bank, offset)) {
- spin_unlock_irqrestore(&bank->lock, flags);
+- return -EINVAL;
+ raw_spin_unlock_irqrestore(&bank->lock, flags);
- return -EINVAL;
++ retval = -EINVAL;
++ goto error;
}
- spin_unlock_irqrestore(&bank->lock, flags);
+ raw_spin_unlock_irqrestore(&bank->lock, flags);
if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
__irq_set_handler_locked(d->irq, handle_level_irq);
-@@ -626,14 +626,14 @@
+ else if (type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING))
+ __irq_set_handler_locked(d->irq, handle_edge_irq);
+
++ return 0;
++
++error:
+ return retval;
+ }
+
+@@ -626,34 +633,30 @@
return -EINVAL;
}
@@ -5915,65 +6108,219 @@ diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/g
return 0;
}
-@@ -668,7 +668,7 @@
+
+-static void omap_reset_gpio(struct gpio_bank *bank, unsigned offset)
+-{
+- omap_set_gpio_direction(bank, offset, 1);
+- omap_set_gpio_irqenable(bank, offset, 0);
+- omap_clear_gpio_irqstatus(bank, offset);
+- omap_set_gpio_triggering(bank, offset, IRQ_TYPE_NONE);
+- omap_clear_gpio_debounce(bank, offset);
+-}
+-
+ /* Use disable_irq_wake() and enable_irq_wake() functions from drivers */
+ static int omap_gpio_wake_enable(struct irq_data *d, unsigned int enable)
+ {
+ struct gpio_bank *bank = omap_irq_data_get_bank(d);
+ unsigned offset = d->hwirq;
++ int ret;
++
++ ret = omap_set_gpio_wakeup(bank, offset, enable);
++ if (!ret)
++ ret = irq_set_irq_wake(bank->irq, enable);
+
+- return omap_set_gpio_wakeup(bank, offset, enable);
++ return ret;
+ }
+
+ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset)
+@@ -668,17 +671,10 @@
if (!BANK_USED(bank))
pm_runtime_get_sync(bank->dev);
- spin_lock_irqsave(&bank->lock, flags);
+- /* Set trigger to none. You need to enable the desired trigger with
+- * request_irq() or set_irq_type(). Only do this if the IRQ line has
+- * not already been requested.
+- */
+- if (!LINE_USED(bank->irq_usage, offset)) {
+- omap_set_gpio_triggering(bank, offset, IRQ_TYPE_NONE);
+- omap_enable_gpio_module(bank, offset);
+- }
+ raw_spin_lock_irqsave(&bank->lock, flags);
- /* Set trigger to none. You need to enable the desired trigger with
- * request_irq() or set_irq_type(). Only do this if the IRQ line has
- * not already been requested.
-@@ -678,7 +678,7 @@
- omap_enable_gpio_module(bank, offset);
- }
++ omap_enable_gpio_module(bank, offset);
bank->mod_usage |= BIT(offset);
- spin_unlock_irqrestore(&bank->lock, flags);
+ raw_spin_unlock_irqrestore(&bank->lock, flags);
return 0;
}
-@@ -688,11 +688,11 @@
+@@ -688,11 +684,14 @@
struct gpio_bank *bank = container_of(chip, struct gpio_bank, chip);
unsigned long flags;
- spin_lock_irqsave(&bank->lock, flags);
+ raw_spin_lock_irqsave(&bank->lock, flags);
bank->mod_usage &= ~(BIT(offset));
++ if (!LINE_USED(bank->irq_usage, offset)) {
++ omap_set_gpio_direction(bank, offset, 1);
++ omap_clear_gpio_debounce(bank, offset);
++ }
omap_disable_gpio_module(bank, offset);
- omap_reset_gpio(bank, offset);
+- omap_reset_gpio(bank, offset);
- spin_unlock_irqrestore(&bank->lock, flags);
+ raw_spin_unlock_irqrestore(&bank->lock, flags);
/*
* If this is the last gpio to be freed in the bank,
-@@ -794,9 +794,9 @@
- if (!BANK_USED(bank))
- pm_runtime_get_sync(bank->dev);
+@@ -711,29 +710,27 @@
+ * line's interrupt handler has been run, we may miss some nested
+ * interrupts.
+ */
+-static void omap_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
++static irqreturn_t omap_gpio_irq_handler(int irq, void *gpiobank)
+ {
+ void __iomem *isr_reg = NULL;
+ u32 isr;
+ unsigned int bit;
+- struct gpio_bank *bank;
+- int unmasked = 0;
+- struct irq_chip *irqchip = irq_desc_get_chip(desc);
+- struct gpio_chip *chip = irq_get_handler_data(irq);
++ struct gpio_bank *bank = gpiobank;
++ unsigned long wa_lock_flags;
++ unsigned long lock_flags;
+
+- chained_irq_enter(irqchip, desc);
+-
+- bank = container_of(chip, struct gpio_bank, chip);
+ isr_reg = bank->base + bank->regs->irqstatus;
+- pm_runtime_get_sync(bank->dev);
+-
+ if (WARN_ON(!isr_reg))
+ goto exit;
-- spin_lock_irqsave(&bank->lock, flags);
++ pm_runtime_get_sync(bank->dev);
++
+ while (1) {
+ u32 isr_saved, level_mask = 0;
+ u32 enabled;
+
++ raw_spin_lock_irqsave(&bank->lock, lock_flags);
++
+ enabled = omap_get_gpio_irqbank_mask(bank);
+ isr_saved = isr = readl_relaxed(isr_reg) & enabled;
+
+@@ -747,12 +744,7 @@
+ omap_clear_gpio_irqbank(bank, isr_saved & ~level_mask);
+ omap_enable_gpio_irqbank(bank, isr_saved & ~level_mask);
+
+- /* if there is only edge sensitive GPIO pin interrupts
+- configured, we could unmask GPIO bank interrupt immediately */
+- if (!level_mask && !unmasked) {
+- unmasked = 1;
+- chained_irq_exit(irqchip, desc);
+- }
++ raw_spin_unlock_irqrestore(&bank->lock, lock_flags);
+
+ if (!isr)
+ break;
+@@ -761,6 +753,7 @@
+ bit = __ffs(isr);
+ isr &= ~(BIT(bit));
+
++ raw_spin_lock_irqsave(&bank->lock, lock_flags);
+ /*
+ * Some chips can't respond to both rising and falling
+ * at the same time. If this irq was requested with
+@@ -771,18 +764,20 @@
+ if (bank->toggle_mask & (BIT(bit)))
+ omap_toggle_gpio_edge_triggering(bank, bit);
+
++ raw_spin_unlock_irqrestore(&bank->lock, lock_flags);
++
++ raw_spin_lock_irqsave(&bank->wa_lock, wa_lock_flags);
++
+ generic_handle_irq(irq_find_mapping(bank->chip.irqdomain,
+ bit));
++
++ raw_spin_unlock_irqrestore(&bank->wa_lock,
++ wa_lock_flags);
+ }
+ }
+- /* if bank has any level sensitive GPIO pin interrupt
+- configured, we must unmask the bank interrupt only after
+- handler(s) are executed in order to avoid spurious bank
+- interrupt */
+ exit:
+- if (!unmasked)
+- chained_irq_exit(irqchip, desc);
+ pm_runtime_put(bank->dev);
++ return IRQ_HANDLED;
+ }
+
+ static unsigned int omap_gpio_irq_startup(struct irq_data *d)
+@@ -791,15 +786,22 @@
+ unsigned long flags;
+ unsigned offset = d->hwirq;
+
+- if (!BANK_USED(bank))
+- pm_runtime_get_sync(bank->dev);
+ raw_spin_lock_irqsave(&bank->lock, flags);
- omap_gpio_init_irq(bank, offset);
+
+- spin_lock_irqsave(&bank->lock, flags);
+- omap_gpio_init_irq(bank, offset);
- spin_unlock_irqrestore(&bank->lock, flags);
++ if (!LINE_USED(bank->mod_usage, offset))
++ omap_set_gpio_direction(bank, offset, 1);
++ else if (!omap_gpio_is_input(bank, offset))
++ goto err;
++ omap_enable_gpio_module(bank, offset);
++ bank->irq_usage |= BIT(offset);
++
+ raw_spin_unlock_irqrestore(&bank->lock, flags);
omap_gpio_unmask_irq(d);
return 0;
-@@ -808,11 +808,11 @@
++err:
++ raw_spin_unlock_irqrestore(&bank->lock, flags);
++ return -EINVAL;
+ }
+
+ static void omap_gpio_irq_shutdown(struct irq_data *d)
+@@ -808,11 +810,28 @@
unsigned long flags;
unsigned offset = d->hwirq;
- spin_lock_irqsave(&bank->lock, flags);
+ raw_spin_lock_irqsave(&bank->lock, flags);
bank->irq_usage &= ~(BIT(offset));
++ omap_set_gpio_irqenable(bank, offset, 0);
++ omap_clear_gpio_irqstatus(bank, offset);
++ omap_set_gpio_triggering(bank, offset, IRQ_TYPE_NONE);
++ if (!LINE_USED(bank->mod_usage, offset))
++ omap_clear_gpio_debounce(bank, offset);
omap_disable_gpio_module(bank, offset);
- omap_reset_gpio(bank, offset);
+- omap_reset_gpio(bank, offset);
- spin_unlock_irqrestore(&bank->lock, flags);
+ raw_spin_unlock_irqrestore(&bank->lock, flags);
++}
++
++static void omap_gpio_irq_bus_lock(struct irq_data *data)
++{
++ struct gpio_bank *bank = omap_irq_data_get_bank(data);
++
++ if (!BANK_USED(bank))
++ pm_runtime_get_sync(bank->dev);
++}
++
++static void gpio_irq_bus_sync_unlock(struct irq_data *data)
++{
++ struct gpio_bank *bank = omap_irq_data_get_bank(data);
/*
* If this is the last IRQ to be freed in the bank,
-@@ -836,10 +836,10 @@
+@@ -836,10 +855,10 @@
unsigned offset = d->hwirq;
unsigned long flags;
@@ -5986,7 +6333,7 @@ diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/g
}
static void omap_gpio_unmask_irq(struct irq_data *d)
-@@ -849,7 +849,7 @@
+@@ -849,7 +868,7 @@
u32 trigger = irqd_get_trigger_type(d);
unsigned long flags;
@@ -5995,7 +6342,7 @@ diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/g
if (trigger)
omap_set_gpio_triggering(bank, offset, trigger);
-@@ -861,7 +861,7 @@
+@@ -861,7 +880,7 @@
}
omap_set_gpio_irqenable(bank, offset, 1);
@@ -6004,7 +6351,7 @@ diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/g
}
/*---------------------------------------------------------------------*/
-@@ -874,9 +874,9 @@
+@@ -874,9 +893,9 @@
OMAP_MPUIO_GPIO_MASKIT / bank->stride;
unsigned long flags;
@@ -6016,7 +6363,7 @@ diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/g
return 0;
}
-@@ -889,9 +889,9 @@
+@@ -889,9 +908,9 @@
OMAP_MPUIO_GPIO_MASKIT / bank->stride;
unsigned long flags;
@@ -6028,7 +6375,7 @@ diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/g
return 0;
}
-@@ -937,9 +937,9 @@
+@@ -937,9 +956,9 @@
bank = container_of(chip, struct gpio_bank, chip);
reg = bank->base + bank->regs->direction;
@@ -6040,7 +6387,7 @@ diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/g
return dir;
}
-@@ -949,9 +949,9 @@
+@@ -949,9 +968,9 @@
unsigned long flags;
bank = container_of(chip, struct gpio_bank, chip);
@@ -6052,7 +6399,7 @@ diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/g
return 0;
}
-@@ -973,10 +973,10 @@
+@@ -973,10 +992,10 @@
unsigned long flags;
bank = container_of(chip, struct gpio_bank, chip);
@@ -6065,7 +6412,7 @@ diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/g
return 0;
}
-@@ -988,9 +988,9 @@
+@@ -988,9 +1007,9 @@
bank = container_of(chip, struct gpio_bank, chip);
@@ -6077,7 +6424,7 @@ diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/g
return 0;
}
-@@ -1001,9 +1001,9 @@
+@@ -1001,9 +1020,9 @@
unsigned long flags;
bank = container_of(chip, struct gpio_bank, chip);
@@ -6089,16 +6436,174 @@ diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/g
}
/*---------------------------------------------------------------------*/
-@@ -1199,7 +1199,7 @@
+@@ -1048,10 +1067,6 @@
+ /* Initialize interface clk ungated, module enabled */
+ if (bank->regs->ctrl)
+ writel_relaxed(0, base + bank->regs->ctrl);
+-
+- bank->dbck = clk_get(bank->dev, "dbclk");
+- if (IS_ERR(bank->dbck))
+- dev_err(bank->dev, "Could not get gpio dbck\n");
+ }
+
+ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
+@@ -1080,7 +1095,6 @@
+ } else {
+ bank->chip.label = "gpio";
+ bank->chip.base = gpio;
+- gpio += bank->width;
+ }
+ bank->chip.ngpio = bank->width;
+
+@@ -1090,6 +1104,9 @@
+ return ret;
+ }
+
++ if (!bank->is_mpuio)
++ gpio += bank->width;
++
+ #ifdef CONFIG_ARCH_OMAP1
+ /*
+ * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop
+@@ -1112,7 +1129,7 @@
+ }
+
+ ret = gpiochip_irqchip_add(&bank->chip, irqc,
+- irq_base, omap_gpio_irq_handler,
++ irq_base, handle_bad_irq,
+ IRQ_TYPE_NONE);
+
+ if (ret) {
+@@ -1121,10 +1138,14 @@
+ return -ENODEV;
+ }
+
+- gpiochip_set_chained_irqchip(&bank->chip, irqc,
+- bank->irq, omap_gpio_irq_handler);
++ gpiochip_set_chained_irqchip(&bank->chip, irqc, bank->irq, NULL);
+
+- return 0;
++ ret = devm_request_irq(bank->dev, bank->irq, omap_gpio_irq_handler,
++ 0, dev_name(bank->dev), bank);
++ if (ret)
++ gpiochip_remove(&bank->chip);
++
++ return ret;
+ }
+
+ static const struct of_device_id omap_gpio_match[];
+@@ -1163,17 +1184,23 @@
+ irqc->irq_unmask = omap_gpio_unmask_irq,
+ irqc->irq_set_type = omap_gpio_irq_type,
+ irqc->irq_set_wake = omap_gpio_wake_enable,
++ irqc->irq_bus_lock = omap_gpio_irq_bus_lock,
++ irqc->irq_bus_sync_unlock = gpio_irq_bus_sync_unlock,
+ irqc->name = dev_name(&pdev->dev);
+
+- res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+- if (unlikely(!res)) {
+- dev_err(dev, "Invalid IRQ resource\n");
+- return -ENODEV;
++ bank->irq = platform_get_irq(pdev, 0);
++ if (bank->irq <= 0) {
++ if (!bank->irq)
++ bank->irq = -ENXIO;
++ if (bank->irq != -EPROBE_DEFER)
++ dev_err(dev,
++ "can't get irq resource ret=%d\n", bank->irq);
++ return bank->irq;
+ }
+
+- bank->irq = res->start;
+ bank->dev = dev;
+ bank->chip.dev = dev;
++ bank->chip.owner = THIS_MODULE;
+ bank->dbck_flag = pdata->dbck_flag;
+ bank->stride = pdata->bank_stride;
+ bank->width = pdata->bank_width;
+@@ -1183,15 +1210,9 @@
+ #ifdef CONFIG_OF_GPIO
+ bank->chip.of_node = of_node_get(node);
+ #endif
+- if (node) {
+- if (!of_property_read_bool(node, "ti,gpio-always-on"))
+- bank->loses_context = true;
+- } else {
+- bank->loses_context = pdata->loses_context;
+-
+- if (bank->loses_context)
+- bank->get_context_loss_count =
+- pdata->get_context_loss_count;
++ if (!node) {
++ bank->get_context_loss_count =
++ pdata->get_context_loss_count;
+ }
+
+ if (bank->regs->set_dataout && bank->regs->clr_dataout)
+@@ -1199,16 +1220,27 @@
else
bank->set_dataout = omap_set_gpio_dataout_mask;
- spin_lock_init(&bank->lock);
+ raw_spin_lock_init(&bank->lock);
++ raw_spin_lock_init(&bank->wa_lock);
/* Static mapping, never released */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-@@ -1246,7 +1246,7 @@
+ bank->base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(bank->base)) {
+- irq_domain_remove(bank->chip.irqdomain);
+ return PTR_ERR(bank->base);
+ }
+
++ if (bank->dbck_flag) {
++ bank->dbck = devm_clk_get(bank->dev, "dbclk");
++ if (IS_ERR(bank->dbck)) {
++ dev_err(bank->dev,
++ "Could not get gpio dbck. Disable debounce\n");
++ bank->dbck_flag = false;
++ } else {
++ clk_prepare(bank->dbck);
++ }
++ }
++
+ platform_set_drvdata(pdev, bank);
+
+ pm_runtime_enable(bank->dev);
+@@ -1221,8 +1253,11 @@
+ omap_gpio_mod_init(bank);
+
+ ret = omap_gpio_chip_init(bank, irqc);
+- if (ret)
++ if (ret) {
++ pm_runtime_put_sync(bank->dev);
++ pm_runtime_disable(bank->dev);
+ return ret;
++ }
+
+ omap_gpio_show_rev(bank);
+
+@@ -1233,6 +1268,19 @@
+ return 0;
+ }
+
++static int omap_gpio_remove(struct platform_device *pdev)
++{
++ struct gpio_bank *bank = platform_get_drvdata(pdev);
++
++ list_del(&bank->node);
++ gpiochip_remove(&bank->chip);
++ pm_runtime_disable(bank->dev);
++ if (bank->dbck_flag)
++ clk_unprepare(bank->dbck);
++
++ return 0;
++}
++
+ #ifdef CONFIG_ARCH_OMAP2PLUS
+
+ #if defined(CONFIG_PM)
+@@ -1246,7 +1294,7 @@
unsigned long flags;
u32 wake_low, wake_hi;
@@ -6107,7 +6612,7 @@ diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/g
/*
* Only edges can generate a wakeup event to the PRCM.
-@@ -1299,7 +1299,7 @@
+@@ -1299,7 +1347,7 @@
bank->get_context_loss_count(bank->dev);
omap_gpio_dbck_disable(bank);
@@ -6116,7 +6621,7 @@ diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/g
return 0;
}
-@@ -1314,7 +1314,7 @@
+@@ -1314,14 +1362,14 @@
unsigned long flags;
int c;
@@ -6125,14 +6630,36 @@ diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/g
/*
* On the first resume during the probe, the context has not
-@@ -1350,14 +1350,14 @@
- if (c != bank->context_loss_count) {
- omap_gpio_restore_context(bank);
- } else {
+ * been initialised and so initialise it now. Also initialise
+ * the context loss count.
+ */
+- if (bank->loses_context && !bank->context_valid) {
++ if (!bank->context_valid) {
+ omap_gpio_init_context(bank);
+
+ if (bank->get_context_loss_count)
+@@ -1342,22 +1390,20 @@
+ writel_relaxed(bank->context.risingdetect,
+ bank->base + bank->regs->risingdetect);
+
+- if (bank->loses_context) {
+- if (!bank->get_context_loss_count) {
++ if (!bank->get_context_loss_count) {
++ omap_gpio_restore_context(bank);
++ } else {
++ c = bank->get_context_loss_count(bank->dev);
++ if (c != bank->context_loss_count) {
+ omap_gpio_restore_context(bank);
+ } else {
+- c = bank->get_context_loss_count(bank->dev);
+- if (c != bank->context_loss_count) {
+- omap_gpio_restore_context(bank);
+- } else {
- spin_unlock_irqrestore(&bank->lock, flags);
-+ raw_spin_unlock_irqrestore(&bank->lock, flags);
- return 0;
- }
+- return 0;
+- }
++ raw_spin_unlock_irqrestore(&bank->lock, flags);
++ return 0;
}
}
@@ -6142,7 +6669,7 @@ diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/g
return 0;
}
-@@ -1412,7 +1412,7 @@
+@@ -1412,18 +1458,19 @@
}
bank->workaround_enabled = false;
@@ -6151,9 +6678,59 @@ diff -Nur linux-4.1.13.orig/drivers/gpio/gpio-omap.c linux-4.1.13/drivers/gpio/g
return 0;
}
-diff -Nur linux-4.1.13.orig/drivers/gpu/drm/i915/i915_gem_execbuffer.c linux-4.1.13/drivers/gpu/drm/i915/i915_gem_execbuffer.c
---- linux-4.1.13.orig/drivers/gpu/drm/i915/i915_gem_execbuffer.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/gpu/drm/i915/i915_gem_execbuffer.c 2015-11-29 09:23:09.545618436 +0100
+ #endif /* CONFIG_PM */
+
++#if IS_BUILTIN(CONFIG_GPIO_OMAP)
+ void omap2_gpio_prepare_for_idle(int pwr_mode)
+ {
+ struct gpio_bank *bank;
+
+ list_for_each_entry(bank, &omap_gpio_list, node) {
+- if (!BANK_USED(bank) || !bank->loses_context)
++ if (!BANK_USED(bank))
+ continue;
+
+ bank->power_mode = pwr_mode;
+@@ -1437,12 +1484,13 @@
+ struct gpio_bank *bank;
+
+ list_for_each_entry(bank, &omap_gpio_list, node) {
+- if (!BANK_USED(bank) || !bank->loses_context)
++ if (!BANK_USED(bank))
+ continue;
+
+ pm_runtime_get_sync(bank->dev);
+ }
+ }
++#endif
+
+ #if defined(CONFIG_PM)
+ static void omap_gpio_init_context(struct gpio_bank *p)
+@@ -1598,6 +1646,7 @@
+
+ static struct platform_driver omap_gpio_driver = {
+ .probe = omap_gpio_probe,
++ .remove = omap_gpio_remove,
+ .driver = {
+ .name = "omap_gpio",
+ .pm = &gpio_pm_ops,
+@@ -1615,3 +1664,13 @@
+ return platform_driver_register(&omap_gpio_driver);
+ }
+ postcore_initcall(omap_gpio_drv_reg);
++
++static void __exit omap_gpio_exit(void)
++{
++ platform_driver_unregister(&omap_gpio_driver);
++}
++module_exit(omap_gpio_exit);
++
++MODULE_DESCRIPTION("omap gpio driver");
++MODULE_ALIAS("platform:gpio-omap");
++MODULE_LICENSE("GPL v2");
+diff -Nur linux-4.1.20.orig/drivers/gpu/drm/i915/i915_gem_execbuffer.c linux-4.1.20/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+--- linux-4.1.20.orig/drivers/gpu/drm/i915/i915_gem_execbuffer.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/gpu/drm/i915/i915_gem_execbuffer.c 2016-03-21 20:18:31.000000000 +0100
@@ -32,6 +32,7 @@
#include "i915_trace.h"
#include "intel_drv.h"
@@ -6181,9 +6758,9 @@ diff -Nur linux-4.1.13.orig/drivers/gpu/drm/i915/i915_gem_execbuffer.c linux-4.1
i915_gem_execbuffer_move_to_active(vmas, ring);
i915_gem_execbuffer_retire_commands(dev, file, ring, batch_obj);
-diff -Nur linux-4.1.13.orig/drivers/gpu/drm/i915/i915_gem_shrinker.c linux-4.1.13/drivers/gpu/drm/i915/i915_gem_shrinker.c
---- linux-4.1.13.orig/drivers/gpu/drm/i915/i915_gem_shrinker.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/gpu/drm/i915/i915_gem_shrinker.c 2015-11-29 09:23:09.545618436 +0100
+diff -Nur linux-4.1.20.orig/drivers/gpu/drm/i915/i915_gem_shrinker.c linux-4.1.20/drivers/gpu/drm/i915/i915_gem_shrinker.c
+--- linux-4.1.20.orig/drivers/gpu/drm/i915/i915_gem_shrinker.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/gpu/drm/i915/i915_gem_shrinker.c 2016-03-21 20:18:31.000000000 +0100
@@ -39,7 +39,7 @@
if (!mutex_is_locked(mutex))
return false;
@@ -6193,9 +6770,28 @@ diff -Nur linux-4.1.13.orig/drivers/gpu/drm/i915/i915_gem_shrinker.c linux-4.1.1
return mutex->owner == task;
#else
/* Since UP may be pre-empted, we cannot assume that we own the lock */
-diff -Nur linux-4.1.13.orig/drivers/gpu/drm/i915/intel_display.c linux-4.1.13/drivers/gpu/drm/i915/intel_display.c
---- linux-4.1.13.orig/drivers/gpu/drm/i915/intel_display.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/gpu/drm/i915/intel_display.c 2015-11-29 09:23:09.549618170 +0100
+diff -Nur linux-4.1.20.orig/drivers/gpu/drm/i915/i915_irq.c linux-4.1.20/drivers/gpu/drm/i915/i915_irq.c
+--- linux-4.1.20.orig/drivers/gpu/drm/i915/i915_irq.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/gpu/drm/i915/i915_irq.c 2016-03-21 20:18:31.000000000 +0100
+@@ -676,6 +676,7 @@
+ spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
+
+ /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */
++ preempt_disable_rt();
+
+ /* Get optional system timestamp before query. */
+ if (stime)
+@@ -727,6 +728,7 @@
+ *etime = ktime_get();
+
+ /* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */
++ preempt_enable_rt();
+
+ spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
+
+diff -Nur linux-4.1.20.orig/drivers/gpu/drm/i915/intel_display.c linux-4.1.20/drivers/gpu/drm/i915/intel_display.c
+--- linux-4.1.20.orig/drivers/gpu/drm/i915/intel_display.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/gpu/drm/i915/intel_display.c 2016-03-21 20:18:31.000000000 +0100
@@ -10088,7 +10088,7 @@
struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
@@ -6205,9 +6801,80 @@ diff -Nur linux-4.1.13.orig/drivers/gpu/drm/i915/intel_display.c linux-4.1.13/dr
if (crtc == NULL)
return;
-diff -Nur linux-4.1.13.orig/drivers/i2c/busses/i2c-omap.c linux-4.1.13/drivers/i2c/busses/i2c-omap.c
---- linux-4.1.13.orig/drivers/i2c/busses/i2c-omap.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/i2c/busses/i2c-omap.c 2015-11-29 09:23:09.549618170 +0100
+diff -Nur linux-4.1.20.orig/drivers/gpu/drm/i915/intel_sprite.c linux-4.1.20/drivers/gpu/drm/i915/intel_sprite.c
+--- linux-4.1.20.orig/drivers/gpu/drm/i915/intel_sprite.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/gpu/drm/i915/intel_sprite.c 2016-03-21 20:18:31.000000000 +0100
+@@ -37,6 +37,7 @@
+ #include "intel_drv.h"
+ #include <drm/i915_drm.h>
+ #include "i915_drv.h"
++#include <linux/locallock.h>
+
+ static bool
+ format_is_yuv(uint32_t format)
+@@ -61,6 +62,8 @@
+ return DIV_ROUND_UP(usecs * mode->crtc_clock, 1000 * mode->crtc_htotal);
+ }
+
++static DEFINE_LOCAL_IRQ_LOCK(pipe_update_lock);
++
+ /**
+ * intel_pipe_update_start() - start update of a set of display registers
+ * @crtc: the crtc of which the registers are going to be updated
+@@ -101,7 +104,7 @@
+ if (WARN_ON(drm_crtc_vblank_get(&crtc->base)))
+ return false;
+
+- local_irq_disable();
++ local_lock_irq(pipe_update_lock);
+
+ trace_i915_pipe_update_start(crtc, min, max);
+
+@@ -123,11 +126,11 @@
+ break;
+ }
+
+- local_irq_enable();
++ local_unlock_irq(pipe_update_lock);
+
+ timeout = schedule_timeout(timeout);
+
+- local_irq_disable();
++ local_lock_irq(pipe_update_lock);
+ }
+
+ finish_wait(wq, &wait);
+@@ -158,7 +161,7 @@
+
+ trace_i915_pipe_update_end(crtc, end_vbl_count);
+
+- local_irq_enable();
++ local_unlock_irq(pipe_update_lock);
+
+ if (start_vbl_count != end_vbl_count)
+ DRM_ERROR("Atomic update failure on pipe %c (start=%u end=%u)\n",
+diff -Nur linux-4.1.20.orig/drivers/gpu/drm/radeon/radeon_display.c linux-4.1.20/drivers/gpu/drm/radeon/radeon_display.c
+--- linux-4.1.20.orig/drivers/gpu/drm/radeon/radeon_display.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/gpu/drm/radeon/radeon_display.c 2016-03-21 20:18:31.000000000 +0100
+@@ -1798,6 +1798,7 @@
+ struct radeon_device *rdev = dev->dev_private;
+
+ /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */
++ preempt_disable_rt();
+
+ /* Get optional system timestamp before query. */
+ if (stime)
+@@ -1890,6 +1891,7 @@
+ *etime = ktime_get();
+
+ /* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */
++ preempt_enable_rt();
+
+ /* Decode into vertical and horizontal scanout position. */
+ *vpos = position & 0x1fff;
+diff -Nur linux-4.1.20.orig/drivers/i2c/busses/i2c-omap.c linux-4.1.20/drivers/i2c/busses/i2c-omap.c
+--- linux-4.1.20.orig/drivers/i2c/busses/i2c-omap.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/i2c/busses/i2c-omap.c 2016-03-21 20:18:31.000000000 +0100
@@ -996,15 +996,12 @@
u16 mask;
u16 stat;
@@ -6225,9 +6892,9 @@ diff -Nur linux-4.1.13.orig/drivers/i2c/busses/i2c-omap.c linux-4.1.13/drivers/i
return ret;
}
-diff -Nur linux-4.1.13.orig/drivers/ide/alim15x3.c linux-4.1.13/drivers/ide/alim15x3.c
---- linux-4.1.13.orig/drivers/ide/alim15x3.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/ide/alim15x3.c 2015-11-29 09:23:09.549618170 +0100
+diff -Nur linux-4.1.20.orig/drivers/ide/alim15x3.c linux-4.1.20/drivers/ide/alim15x3.c
+--- linux-4.1.20.orig/drivers/ide/alim15x3.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/ide/alim15x3.c 2016-03-21 20:18:31.000000000 +0100
@@ -234,7 +234,7 @@
isa_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
@@ -6246,9 +6913,9 @@ diff -Nur linux-4.1.13.orig/drivers/ide/alim15x3.c linux-4.1.13/drivers/ide/alim
return 0;
}
-diff -Nur linux-4.1.13.orig/drivers/ide/hpt366.c linux-4.1.13/drivers/ide/hpt366.c
---- linux-4.1.13.orig/drivers/ide/hpt366.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/ide/hpt366.c 2015-11-29 09:23:09.557617634 +0100
+diff -Nur linux-4.1.20.orig/drivers/ide/hpt366.c linux-4.1.20/drivers/ide/hpt366.c
+--- linux-4.1.20.orig/drivers/ide/hpt366.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/ide/hpt366.c 2016-03-21 20:18:31.000000000 +0100
@@ -1241,7 +1241,7 @@
dma_old = inb(base + 2);
@@ -6267,39 +6934,9 @@ diff -Nur linux-4.1.13.orig/drivers/ide/hpt366.c linux-4.1.13/drivers/ide/hpt366
printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx\n",
hwif->name, base, base + 7);
-diff -Nur linux-4.1.13.orig/drivers/ide/ide-io.c linux-4.1.13/drivers/ide/ide-io.c
---- linux-4.1.13.orig/drivers/ide/ide-io.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/ide/ide-io.c 2015-11-29 09:23:09.557617634 +0100
-@@ -659,7 +659,7 @@
- /* disable_irq_nosync ?? */
- disable_irq(hwif->irq);
- /* local CPU only, as if we were handling an interrupt */
-- local_irq_disable();
-+ local_irq_disable_nort();
- if (hwif->polling) {
- startstop = handler(drive);
- } else if (drive_is_ready(drive)) {
-diff -Nur linux-4.1.13.orig/drivers/ide/ide-iops.c linux-4.1.13/drivers/ide/ide-iops.c
---- linux-4.1.13.orig/drivers/ide/ide-iops.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/ide/ide-iops.c 2015-11-29 09:23:09.557617634 +0100
-@@ -129,12 +129,12 @@
- if ((stat & ATA_BUSY) == 0)
- break;
-
-- local_irq_restore(flags);
-+ local_irq_restore_nort(flags);
- *rstat = stat;
- return -EBUSY;
- }
- }
-- local_irq_restore(flags);
-+ local_irq_restore_nort(flags);
- }
- /*
- * Allow status to settle, then read it again.
-diff -Nur linux-4.1.13.orig/drivers/ide/ide-io-std.c linux-4.1.13/drivers/ide/ide-io-std.c
---- linux-4.1.13.orig/drivers/ide/ide-io-std.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/ide/ide-io-std.c 2015-11-29 09:23:09.557617634 +0100
+diff -Nur linux-4.1.20.orig/drivers/ide/ide-io-std.c linux-4.1.20/drivers/ide/ide-io-std.c
+--- linux-4.1.20.orig/drivers/ide/ide-io-std.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/ide/ide-io-std.c 2016-03-21 20:18:31.000000000 +0100
@@ -175,7 +175,7 @@
unsigned long uninitialized_var(flags);
@@ -6336,9 +6973,39 @@ diff -Nur linux-4.1.13.orig/drivers/ide/ide-io-std.c linux-4.1.13/drivers/ide/id
if (((len + 1) & 3) < 2)
return;
-diff -Nur linux-4.1.13.orig/drivers/ide/ide-probe.c linux-4.1.13/drivers/ide/ide-probe.c
---- linux-4.1.13.orig/drivers/ide/ide-probe.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/ide/ide-probe.c 2015-11-29 09:23:09.557617634 +0100
+diff -Nur linux-4.1.20.orig/drivers/ide/ide-io.c linux-4.1.20/drivers/ide/ide-io.c
+--- linux-4.1.20.orig/drivers/ide/ide-io.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/ide/ide-io.c 2016-03-21 20:18:31.000000000 +0100
+@@ -659,7 +659,7 @@
+ /* disable_irq_nosync ?? */
+ disable_irq(hwif->irq);
+ /* local CPU only, as if we were handling an interrupt */
+- local_irq_disable();
++ local_irq_disable_nort();
+ if (hwif->polling) {
+ startstop = handler(drive);
+ } else if (drive_is_ready(drive)) {
+diff -Nur linux-4.1.20.orig/drivers/ide/ide-iops.c linux-4.1.20/drivers/ide/ide-iops.c
+--- linux-4.1.20.orig/drivers/ide/ide-iops.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/ide/ide-iops.c 2016-03-21 20:18:31.000000000 +0100
+@@ -129,12 +129,12 @@
+ if ((stat & ATA_BUSY) == 0)
+ break;
+
+- local_irq_restore(flags);
++ local_irq_restore_nort(flags);
+ *rstat = stat;
+ return -EBUSY;
+ }
+ }
+- local_irq_restore(flags);
++ local_irq_restore_nort(flags);
+ }
+ /*
+ * Allow status to settle, then read it again.
+diff -Nur linux-4.1.20.orig/drivers/ide/ide-probe.c linux-4.1.20/drivers/ide/ide-probe.c
+--- linux-4.1.20.orig/drivers/ide/ide-probe.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/ide/ide-probe.c 2016-03-21 20:18:31.000000000 +0100
@@ -196,10 +196,10 @@
int bswap = 1;
@@ -6352,9 +7019,9 @@ diff -Nur linux-4.1.13.orig/drivers/ide/ide-probe.c linux-4.1.13/drivers/ide/ide
drive->dev_flags |= IDE_DFLAG_ID_READ;
#ifdef DEBUG
-diff -Nur linux-4.1.13.orig/drivers/ide/ide-taskfile.c linux-4.1.13/drivers/ide/ide-taskfile.c
---- linux-4.1.13.orig/drivers/ide/ide-taskfile.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/ide/ide-taskfile.c 2015-11-29 09:23:09.557617634 +0100
+diff -Nur linux-4.1.20.orig/drivers/ide/ide-taskfile.c linux-4.1.20/drivers/ide/ide-taskfile.c
+--- linux-4.1.20.orig/drivers/ide/ide-taskfile.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/ide/ide-taskfile.c 2016-03-21 20:18:31.000000000 +0100
@@ -250,7 +250,7 @@
page_is_high = PageHighMem(page);
@@ -6382,9 +7049,9 @@ diff -Nur linux-4.1.13.orig/drivers/ide/ide-taskfile.c linux-4.1.13/drivers/ide/
ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE);
-diff -Nur linux-4.1.13.orig/drivers/infiniband/ulp/ipoib/ipoib_multicast.c linux-4.1.13/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
---- linux-4.1.13.orig/drivers/infiniband/ulp/ipoib/ipoib_multicast.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/infiniband/ulp/ipoib/ipoib_multicast.c 2015-11-29 09:23:09.557617634 +0100
+diff -Nur linux-4.1.20.orig/drivers/infiniband/ulp/ipoib/ipoib_multicast.c linux-4.1.20/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+--- linux-4.1.20.orig/drivers/infiniband/ulp/ipoib/ipoib_multicast.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/infiniband/ulp/ipoib/ipoib_multicast.c 2016-03-21 20:18:31.000000000 +0100
@@ -821,7 +821,7 @@
ipoib_dbg_mcast(priv, "restarting multicast task\n");
@@ -6403,9 +7070,9 @@ diff -Nur linux-4.1.13.orig/drivers/infiniband/ulp/ipoib/ipoib_multicast.c linux
/*
* make sure the in-flight joins have finished before we attempt
-diff -Nur linux-4.1.13.orig/drivers/input/gameport/gameport.c linux-4.1.13/drivers/input/gameport/gameport.c
---- linux-4.1.13.orig/drivers/input/gameport/gameport.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/input/gameport/gameport.c 2015-11-29 09:23:09.557617634 +0100
+diff -Nur linux-4.1.20.orig/drivers/input/gameport/gameport.c linux-4.1.20/drivers/input/gameport/gameport.c
+--- linux-4.1.20.orig/drivers/input/gameport/gameport.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/input/gameport/gameport.c 2016-03-21 20:18:31.000000000 +0100
@@ -124,12 +124,12 @@
tx = 1 << 30;
@@ -6435,9 +7102,9 @@ diff -Nur linux-4.1.13.orig/drivers/input/gameport/gameport.c linux-4.1.13/drive
udelay(i * 10);
if (t2 - t1 < tx) tx = t2 - t1;
}
-diff -Nur linux-4.1.13.orig/drivers/leds/trigger/Kconfig linux-4.1.13/drivers/leds/trigger/Kconfig
---- linux-4.1.13.orig/drivers/leds/trigger/Kconfig 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/leds/trigger/Kconfig 2015-11-29 09:23:09.557617634 +0100
+diff -Nur linux-4.1.20.orig/drivers/leds/trigger/Kconfig linux-4.1.20/drivers/leds/trigger/Kconfig
+--- linux-4.1.20.orig/drivers/leds/trigger/Kconfig 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/leds/trigger/Kconfig 2016-03-21 20:18:31.000000000 +0100
@@ -61,7 +61,7 @@
config LEDS_TRIGGER_CPU
@@ -6447,9 +7114,9 @@ diff -Nur linux-4.1.13.orig/drivers/leds/trigger/Kconfig linux-4.1.13/drivers/le
help
This allows LEDs to be controlled by active CPUs. This shows
the active CPUs across an array of LEDs so you can see which
-diff -Nur linux-4.1.13.orig/drivers/md/bcache/Kconfig linux-4.1.13/drivers/md/bcache/Kconfig
---- linux-4.1.13.orig/drivers/md/bcache/Kconfig 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/md/bcache/Kconfig 2015-11-29 09:23:09.557617634 +0100
+diff -Nur linux-4.1.20.orig/drivers/md/bcache/Kconfig linux-4.1.20/drivers/md/bcache/Kconfig
+--- linux-4.1.20.orig/drivers/md/bcache/Kconfig 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/md/bcache/Kconfig 2016-03-21 20:18:31.000000000 +0100
@@ -1,6 +1,7 @@
config BCACHE
@@ -6458,10 +7125,10 @@ diff -Nur linux-4.1.13.orig/drivers/md/bcache/Kconfig linux-4.1.13/drivers/md/bc
---help---
Allows a block device to be used as cache for other devices; uses
a btree for indexing and the layout is optimized for SSDs.
-diff -Nur linux-4.1.13.orig/drivers/md/dm.c linux-4.1.13/drivers/md/dm.c
---- linux-4.1.13.orig/drivers/md/dm.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/md/dm.c 2015-11-29 09:23:09.557617634 +0100
-@@ -2132,7 +2132,7 @@
+diff -Nur linux-4.1.20.orig/drivers/md/dm.c linux-4.1.20/drivers/md/dm.c
+--- linux-4.1.20.orig/drivers/md/dm.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/md/dm.c 2016-03-21 20:18:31.000000000 +0100
+@@ -2134,7 +2134,7 @@
/* Establish tio->ti before queuing work (map_tio_request) */
tio->ti = ti;
queue_kthread_work(&md->kworker, &tio->work);
@@ -6470,9 +7137,9 @@ diff -Nur linux-4.1.13.orig/drivers/md/dm.c linux-4.1.13/drivers/md/dm.c
}
goto out;
-diff -Nur linux-4.1.13.orig/drivers/md/raid5.c linux-4.1.13/drivers/md/raid5.c
---- linux-4.1.13.orig/drivers/md/raid5.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/md/raid5.c 2015-11-29 09:23:09.561617368 +0100
+diff -Nur linux-4.1.20.orig/drivers/md/raid5.c linux-4.1.20/drivers/md/raid5.c
+--- linux-4.1.20.orig/drivers/md/raid5.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/md/raid5.c 2016-03-21 20:18:31.000000000 +0100
@@ -1918,8 +1918,9 @@
struct raid5_percpu *percpu;
unsigned long cpu;
@@ -6502,9 +7169,9 @@ diff -Nur linux-4.1.13.orig/drivers/md/raid5.c linux-4.1.13/drivers/md/raid5.c
}
put_online_cpus();
-diff -Nur linux-4.1.13.orig/drivers/md/raid5.h linux-4.1.13/drivers/md/raid5.h
---- linux-4.1.13.orig/drivers/md/raid5.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/md/raid5.h 2015-11-29 09:23:09.561617368 +0100
+diff -Nur linux-4.1.20.orig/drivers/md/raid5.h linux-4.1.20/drivers/md/raid5.h
+--- linux-4.1.20.orig/drivers/md/raid5.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/md/raid5.h 2016-03-21 20:18:31.000000000 +0100
@@ -495,6 +495,7 @@
int recovery_disabled;
/* per cpu variables */
@@ -6513,9 +7180,93 @@ diff -Nur linux-4.1.13.orig/drivers/md/raid5.h linux-4.1.13/drivers/md/raid5.h
struct page *spare_page; /* Used when checking P/Q in raid6 */
struct flex_array *scribble; /* space for constructing buffer
* lists and performing address
-diff -Nur linux-4.1.13.orig/drivers/misc/hwlat_detector.c linux-4.1.13/drivers/misc/hwlat_detector.c
---- linux-4.1.13.orig/drivers/misc/hwlat_detector.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/drivers/misc/hwlat_detector.c 2015-11-29 09:23:09.561617368 +0100
+diff -Nur linux-4.1.20.orig/drivers/misc/Kconfig linux-4.1.20/drivers/misc/Kconfig
+--- linux-4.1.20.orig/drivers/misc/Kconfig 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/misc/Kconfig 2016-03-21 20:18:31.000000000 +0100
+@@ -54,6 +54,7 @@
+ config ATMEL_TCLIB
+ bool "Atmel AT32/AT91 Timer/Counter Library"
+ depends on (AVR32 || ARCH_AT91)
++ default y if PREEMPT_RT_FULL
+ help
+ Select this if you want a library to allocate the Timer/Counter
+ blocks found on many Atmel processors. This facilitates using
+@@ -69,8 +70,7 @@
+ are combined to make a single 32-bit timer.
+
+ When GENERIC_CLOCKEVENTS is defined, the third timer channel
+- may be used as a clock event device supporting oneshot mode
+- (delays of up to two seconds) based on the 32 KiHz clock.
++ may be used as a clock event device supporting oneshot mode.
+
+ config ATMEL_TCB_CLKSRC_BLOCK
+ int
+@@ -84,6 +84,15 @@
+ TC can be used for other purposes, such as PWM generation and
+ interval timing.
+
++config ATMEL_TCB_CLKSRC_USE_SLOW_CLOCK
++ bool "TC Block use 32 KiHz clock"
++ depends on ATMEL_TCB_CLKSRC
++ default y if !PREEMPT_RT_FULL
++ help
++ Select this to use 32 KiHz base clock rate as TC block clock
++ source for clock events.
++
++
+ config DUMMY_IRQ
+ tristate "Dummy IRQ handler"
+ default n
+@@ -113,6 +122,35 @@
+ for information on the specific driver level and support statement
+ for your IBM server.
+
++config HWLAT_DETECTOR
++ tristate "Testing module to detect hardware-induced latencies"
++ depends on DEBUG_FS
++ depends on RING_BUFFER
++ default m
++ ---help---
++ A simple hardware latency detector. Use this module to detect
++ large latencies introduced by the behavior of the underlying
++ system firmware external to Linux. We do this using periodic
++ use of stop_machine to grab all available CPUs and measure
++ for unexplainable gaps in the CPU timestamp counter(s). By
++ default, the module is not enabled until the "enable" file
++ within the "hwlat_detector" debugfs directory is toggled.
++
++ This module is often used to detect SMI (System Management
++ Interrupts) on x86 systems, though is not x86 specific. To
++ this end, we default to using a sample window of 1 second,
++ during which we will sample for 0.5 seconds. If an SMI or
++ similar event occurs during that time, it is recorded
++ into an 8K samples global ring buffer until retreived.
++
++ WARNING: This software should never be enabled (it can be built
++ but should not be turned on after it is loaded) in a production
++ environment where high latencies are a concern since the
++ sampling mechanism actually introduces latencies for
++ regular tasks while the CPU(s) are being held.
++
++ If unsure, say N
++
+ config PHANTOM
+ tristate "Sensable PHANToM (PCI)"
+ depends on PCI
+diff -Nur linux-4.1.20.orig/drivers/misc/Makefile linux-4.1.20/drivers/misc/Makefile
+--- linux-4.1.20.orig/drivers/misc/Makefile 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/misc/Makefile 2016-03-21 20:18:31.000000000 +0100
+@@ -38,6 +38,7 @@
+ obj-$(CONFIG_HMC6352) += hmc6352.o
+ obj-y += eeprom/
+ obj-y += cb710/
++obj-$(CONFIG_HWLAT_DETECTOR) += hwlat_detector.o
+ obj-$(CONFIG_SPEAR13XX_PCIE_GADGET) += spear13xx_pcie_gadget.o
+ obj-$(CONFIG_VMWARE_BALLOON) += vmw_balloon.o
+ obj-$(CONFIG_ARM_CHARLCD) += arm-charlcd.o
+diff -Nur linux-4.1.20.orig/drivers/misc/hwlat_detector.c linux-4.1.20/drivers/misc/hwlat_detector.c
+--- linux-4.1.20.orig/drivers/misc/hwlat_detector.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/drivers/misc/hwlat_detector.c 2016-03-21 20:18:31.000000000 +0100
@@ -0,0 +1,1240 @@
+/*
+ * hwlat_detector.c - A simple Hardware Latency detector.
@@ -7757,93 +8508,9 @@ diff -Nur linux-4.1.13.orig/drivers/misc/hwlat_detector.c linux-4.1.13/drivers/m
+
+module_init(detector_init);
+module_exit(detector_exit);
-diff -Nur linux-4.1.13.orig/drivers/misc/Kconfig linux-4.1.13/drivers/misc/Kconfig
---- linux-4.1.13.orig/drivers/misc/Kconfig 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/misc/Kconfig 2015-11-29 09:23:09.561617368 +0100
-@@ -54,6 +54,7 @@
- config ATMEL_TCLIB
- bool "Atmel AT32/AT91 Timer/Counter Library"
- depends on (AVR32 || ARCH_AT91)
-+ default y if PREEMPT_RT_FULL
- help
- Select this if you want a library to allocate the Timer/Counter
- blocks found on many Atmel processors. This facilitates using
-@@ -69,8 +70,7 @@
- are combined to make a single 32-bit timer.
-
- When GENERIC_CLOCKEVENTS is defined, the third timer channel
-- may be used as a clock event device supporting oneshot mode
-- (delays of up to two seconds) based on the 32 KiHz clock.
-+ may be used as a clock event device supporting oneshot mode.
-
- config ATMEL_TCB_CLKSRC_BLOCK
- int
-@@ -84,6 +84,15 @@
- TC can be used for other purposes, such as PWM generation and
- interval timing.
-
-+config ATMEL_TCB_CLKSRC_USE_SLOW_CLOCK
-+ bool "TC Block use 32 KiHz clock"
-+ depends on ATMEL_TCB_CLKSRC
-+ default y if !PREEMPT_RT_FULL
-+ help
-+ Select this to use 32 KiHz base clock rate as TC block clock
-+ source for clock events.
-+
-+
- config DUMMY_IRQ
- tristate "Dummy IRQ handler"
- default n
-@@ -113,6 +122,35 @@
- for information on the specific driver level and support statement
- for your IBM server.
-
-+config HWLAT_DETECTOR
-+ tristate "Testing module to detect hardware-induced latencies"
-+ depends on DEBUG_FS
-+ depends on RING_BUFFER
-+ default m
-+ ---help---
-+ A simple hardware latency detector. Use this module to detect
-+ large latencies introduced by the behavior of the underlying
-+ system firmware external to Linux. We do this using periodic
-+ use of stop_machine to grab all available CPUs and measure
-+ for unexplainable gaps in the CPU timestamp counter(s). By
-+ default, the module is not enabled until the "enable" file
-+ within the "hwlat_detector" debugfs directory is toggled.
-+
-+ This module is often used to detect SMI (System Management
-+ Interrupts) on x86 systems, though is not x86 specific. To
-+ this end, we default to using a sample window of 1 second,
-+ during which we will sample for 0.5 seconds. If an SMI or
-+ similar event occurs during that time, it is recorded
-+ into an 8K samples global ring buffer until retreived.
-+
-+ WARNING: This software should never be enabled (it can be built
-+ but should not be turned on after it is loaded) in a production
-+ environment where high latencies are a concern since the
-+ sampling mechanism actually introduces latencies for
-+ regular tasks while the CPU(s) are being held.
-+
-+ If unsure, say N
-+
- config PHANTOM
- tristate "Sensable PHANToM (PCI)"
- depends on PCI
-diff -Nur linux-4.1.13.orig/drivers/misc/Makefile linux-4.1.13/drivers/misc/Makefile
---- linux-4.1.13.orig/drivers/misc/Makefile 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/misc/Makefile 2015-11-29 09:23:09.561617368 +0100
-@@ -38,6 +38,7 @@
- obj-$(CONFIG_HMC6352) += hmc6352.o
- obj-y += eeprom/
- obj-y += cb710/
-+obj-$(CONFIG_HWLAT_DETECTOR) += hwlat_detector.o
- obj-$(CONFIG_SPEAR13XX_PCIE_GADGET) += spear13xx_pcie_gadget.o
- obj-$(CONFIG_VMWARE_BALLOON) += vmw_balloon.o
- obj-$(CONFIG_ARM_CHARLCD) += arm-charlcd.o
-diff -Nur linux-4.1.13.orig/drivers/mmc/host/mmci.c linux-4.1.13/drivers/mmc/host/mmci.c
---- linux-4.1.13.orig/drivers/mmc/host/mmci.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/mmc/host/mmci.c 2015-11-29 09:23:09.561617368 +0100
+diff -Nur linux-4.1.20.orig/drivers/mmc/host/mmci.c linux-4.1.20/drivers/mmc/host/mmci.c
+--- linux-4.1.20.orig/drivers/mmc/host/mmci.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/mmc/host/mmci.c 2016-03-21 20:18:31.000000000 +0100
@@ -1155,15 +1155,12 @@
struct sg_mapping_iter *sg_miter = &host->sg_miter;
struct variant_data *variant = host->variant;
@@ -7869,9 +8536,9 @@ diff -Nur linux-4.1.13.orig/drivers/mmc/host/mmci.c linux-4.1.13/drivers/mmc/hos
/*
* If we have less than the fifo 'half-full' threshold to transfer,
* trigger a PIO interrupt as soon as any data is available.
-diff -Nur linux-4.1.13.orig/drivers/net/ethernet/3com/3c59x.c linux-4.1.13/drivers/net/ethernet/3com/3c59x.c
---- linux-4.1.13.orig/drivers/net/ethernet/3com/3c59x.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/net/ethernet/3com/3c59x.c 2015-11-29 09:23:09.561617368 +0100
+diff -Nur linux-4.1.20.orig/drivers/net/ethernet/3com/3c59x.c linux-4.1.20/drivers/net/ethernet/3com/3c59x.c
+--- linux-4.1.20.orig/drivers/net/ethernet/3com/3c59x.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/net/ethernet/3com/3c59x.c 2016-03-21 20:18:31.000000000 +0100
@@ -842,9 +842,9 @@
{
struct vortex_private *vp = netdev_priv(dev);
@@ -7899,10 +8566,10 @@ diff -Nur linux-4.1.13.orig/drivers/net/ethernet/3com/3c59x.c linux-4.1.13/drive
}
}
-diff -Nur linux-4.1.13.orig/drivers/net/ethernet/atheros/atl1c/atl1c_main.c linux-4.1.13/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
---- linux-4.1.13.orig/drivers/net/ethernet/atheros/atl1c/atl1c_main.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/net/ethernet/atheros/atl1c/atl1c_main.c 2015-11-29 09:23:09.561617368 +0100
-@@ -2213,11 +2213,7 @@
+diff -Nur linux-4.1.20.orig/drivers/net/ethernet/atheros/atl1c/atl1c_main.c linux-4.1.20/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+--- linux-4.1.20.orig/drivers/net/ethernet/atheros/atl1c/atl1c_main.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/net/ethernet/atheros/atl1c/atl1c_main.c 2016-03-21 20:18:31.000000000 +0100
+@@ -2212,11 +2212,7 @@
}
tpd_req = atl1c_cal_tpd_req(skb);
@@ -7915,9 +8582,9 @@ diff -Nur linux-4.1.13.orig/drivers/net/ethernet/atheros/atl1c/atl1c_main.c linu
if (atl1c_tpd_avail(adapter, type) < tpd_req) {
/* no enough descriptor, just stop queue */
-diff -Nur linux-4.1.13.orig/drivers/net/ethernet/atheros/atl1e/atl1e_main.c linux-4.1.13/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
---- linux-4.1.13.orig/drivers/net/ethernet/atheros/atl1e/atl1e_main.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/net/ethernet/atheros/atl1e/atl1e_main.c 2015-11-29 09:23:09.561617368 +0100
+diff -Nur linux-4.1.20.orig/drivers/net/ethernet/atheros/atl1e/atl1e_main.c linux-4.1.20/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+--- linux-4.1.20.orig/drivers/net/ethernet/atheros/atl1e/atl1e_main.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/net/ethernet/atheros/atl1e/atl1e_main.c 2016-03-21 20:18:31.000000000 +0100
@@ -1880,8 +1880,7 @@
return NETDEV_TX_OK;
}
@@ -7928,9 +8595,9 @@ diff -Nur linux-4.1.13.orig/drivers/net/ethernet/atheros/atl1e/atl1e_main.c linu
if (atl1e_tpd_avail(adapter) < tpd_req) {
/* no enough descriptor, just stop queue */
-diff -Nur linux-4.1.13.orig/drivers/net/ethernet/chelsio/cxgb/sge.c linux-4.1.13/drivers/net/ethernet/chelsio/cxgb/sge.c
---- linux-4.1.13.orig/drivers/net/ethernet/chelsio/cxgb/sge.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/net/ethernet/chelsio/cxgb/sge.c 2015-11-29 09:23:09.569616840 +0100
+diff -Nur linux-4.1.20.orig/drivers/net/ethernet/chelsio/cxgb/sge.c linux-4.1.20/drivers/net/ethernet/chelsio/cxgb/sge.c
+--- linux-4.1.20.orig/drivers/net/ethernet/chelsio/cxgb/sge.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/net/ethernet/chelsio/cxgb/sge.c 2016-03-21 20:18:31.000000000 +0100
@@ -1664,8 +1664,7 @@
struct cmdQ *q = &sge->cmdQ[qid];
unsigned int credits, pidx, genbit, count, use_sched_skb = 0;
@@ -7941,9 +8608,9 @@ diff -Nur linux-4.1.13.orig/drivers/net/ethernet/chelsio/cxgb/sge.c linux-4.1.13
reclaim_completed_tx(sge, q);
-diff -Nur linux-4.1.13.orig/drivers/net/ethernet/freescale/gianfar.c linux-4.1.13/drivers/net/ethernet/freescale/gianfar.c
---- linux-4.1.13.orig/drivers/net/ethernet/freescale/gianfar.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/net/ethernet/freescale/gianfar.c 2015-11-29 09:23:09.569616840 +0100
+diff -Nur linux-4.1.20.orig/drivers/net/ethernet/freescale/gianfar.c linux-4.1.20/drivers/net/ethernet/freescale/gianfar.c
+--- linux-4.1.20.orig/drivers/net/ethernet/freescale/gianfar.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/net/ethernet/freescale/gianfar.c 2016-03-21 20:18:31.000000000 +0100
@@ -1540,7 +1540,7 @@
if (netif_running(ndev)) {
@@ -7997,9 +8664,9 @@ diff -Nur linux-4.1.13.orig/drivers/net/ethernet/freescale/gianfar.c linux-4.1.1
}
netif_dbg(priv, tx_err, dev, "Transmit Error\n");
}
-diff -Nur linux-4.1.13.orig/drivers/net/ethernet/neterion/s2io.c linux-4.1.13/drivers/net/ethernet/neterion/s2io.c
---- linux-4.1.13.orig/drivers/net/ethernet/neterion/s2io.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/net/ethernet/neterion/s2io.c 2015-11-29 09:23:09.569616840 +0100
+diff -Nur linux-4.1.20.orig/drivers/net/ethernet/neterion/s2io.c linux-4.1.20/drivers/net/ethernet/neterion/s2io.c
+--- linux-4.1.20.orig/drivers/net/ethernet/neterion/s2io.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/net/ethernet/neterion/s2io.c 2016-03-21 20:18:31.000000000 +0100
@@ -4084,12 +4084,7 @@
[skb->priority & (MAX_TX_FIFOS - 1)];
fifo = &mac_control->fifos[queue];
@@ -8014,9 +8681,9 @@ diff -Nur linux-4.1.13.orig/drivers/net/ethernet/neterion/s2io.c linux-4.1.13/dr
if (sp->config.multiq) {
if (__netif_subqueue_stopped(dev, fifo->fifo_no)) {
-diff -Nur linux-4.1.13.orig/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c linux-4.1.13/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
---- linux-4.1.13.orig/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c 2015-11-29 09:23:09.569616840 +0100
+diff -Nur linux-4.1.20.orig/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c linux-4.1.20/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+--- linux-4.1.20.orig/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c 2016-03-21 20:18:32.000000000 +0100
@@ -2137,10 +2137,8 @@
struct pch_gbe_tx_ring *tx_ring = adapter->tx_ring;
unsigned long flags;
@@ -8030,9 +8697,9 @@ diff -Nur linux-4.1.13.orig/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
if (unlikely(!PCH_GBE_DESC_UNUSED(tx_ring))) {
netif_stop_queue(netdev);
spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
-diff -Nur linux-4.1.13.orig/drivers/net/ethernet/realtek/8139too.c linux-4.1.13/drivers/net/ethernet/realtek/8139too.c
---- linux-4.1.13.orig/drivers/net/ethernet/realtek/8139too.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/net/ethernet/realtek/8139too.c 2015-11-29 09:23:09.569616840 +0100
+diff -Nur linux-4.1.20.orig/drivers/net/ethernet/realtek/8139too.c linux-4.1.20/drivers/net/ethernet/realtek/8139too.c
+--- linux-4.1.20.orig/drivers/net/ethernet/realtek/8139too.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/net/ethernet/realtek/8139too.c 2016-03-21 20:18:32.000000000 +0100
@@ -2229,7 +2229,7 @@
struct rtl8139_private *tp = netdev_priv(dev);
const int irq = tp->pci_dev->irq;
@@ -8042,9 +8709,9 @@ diff -Nur linux-4.1.13.orig/drivers/net/ethernet/realtek/8139too.c linux-4.1.13/
rtl8139_interrupt(irq, dev);
enable_irq(irq);
}
-diff -Nur linux-4.1.13.orig/drivers/net/ethernet/tehuti/tehuti.c linux-4.1.13/drivers/net/ethernet/tehuti/tehuti.c
---- linux-4.1.13.orig/drivers/net/ethernet/tehuti/tehuti.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/net/ethernet/tehuti/tehuti.c 2015-11-29 09:23:09.569616840 +0100
+diff -Nur linux-4.1.20.orig/drivers/net/ethernet/tehuti/tehuti.c linux-4.1.20/drivers/net/ethernet/tehuti/tehuti.c
+--- linux-4.1.20.orig/drivers/net/ethernet/tehuti/tehuti.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/net/ethernet/tehuti/tehuti.c 2016-03-21 20:18:32.000000000 +0100
@@ -1629,13 +1629,8 @@
unsigned long flags;
@@ -8061,9 +8728,9 @@ diff -Nur linux-4.1.13.orig/drivers/net/ethernet/tehuti/tehuti.c linux-4.1.13/dr
/* build tx descriptor */
BDX_ASSERT(f->m.wptr >= f->m.memsz); /* started with valid wptr */
-diff -Nur linux-4.1.13.orig/drivers/net/rionet.c linux-4.1.13/drivers/net/rionet.c
---- linux-4.1.13.orig/drivers/net/rionet.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/net/rionet.c 2015-11-29 09:23:09.581616045 +0100
+diff -Nur linux-4.1.20.orig/drivers/net/rionet.c linux-4.1.20/drivers/net/rionet.c
+--- linux-4.1.20.orig/drivers/net/rionet.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/net/rionet.c 2016-03-21 20:18:32.000000000 +0100
@@ -174,11 +174,7 @@
unsigned long flags;
int add_num = 1;
@@ -8077,9 +8744,9 @@ diff -Nur linux-4.1.13.orig/drivers/net/rionet.c linux-4.1.13/drivers/net/rionet
if (is_multicast_ether_addr(eth->h_dest))
add_num = nets[rnet->mport->id].nact;
-diff -Nur linux-4.1.13.orig/drivers/net/wireless/orinoco/orinoco_usb.c linux-4.1.13/drivers/net/wireless/orinoco/orinoco_usb.c
---- linux-4.1.13.orig/drivers/net/wireless/orinoco/orinoco_usb.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/net/wireless/orinoco/orinoco_usb.c 2015-11-29 09:23:09.581616045 +0100
+diff -Nur linux-4.1.20.orig/drivers/net/wireless/orinoco/orinoco_usb.c linux-4.1.20/drivers/net/wireless/orinoco/orinoco_usb.c
+--- linux-4.1.20.orig/drivers/net/wireless/orinoco/orinoco_usb.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/net/wireless/orinoco/orinoco_usb.c 2016-03-21 20:18:32.000000000 +0100
@@ -697,7 +697,7 @@
while (!ctx->done.done && msecs--)
udelay(1000);
@@ -8089,9 +8756,9 @@ diff -Nur linux-4.1.13.orig/drivers/net/wireless/orinoco/orinoco_usb.c linux-4.1
ctx->done.done);
}
break;
-diff -Nur linux-4.1.13.orig/drivers/pci/access.c linux-4.1.13/drivers/pci/access.c
---- linux-4.1.13.orig/drivers/pci/access.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/pci/access.c 2015-11-29 09:23:09.581616045 +0100
+diff -Nur linux-4.1.20.orig/drivers/pci/access.c linux-4.1.20/drivers/pci/access.c
+--- linux-4.1.20.orig/drivers/pci/access.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/pci/access.c 2016-03-21 20:18:32.000000000 +0100
@@ -561,7 +561,7 @@
WARN_ON(!dev->block_cfg_access);
@@ -8101,9 +8768,9 @@ diff -Nur linux-4.1.13.orig/drivers/pci/access.c linux-4.1.13/drivers/pci/access
raw_spin_unlock_irqrestore(&pci_lock, flags);
}
EXPORT_SYMBOL_GPL(pci_cfg_access_unlock);
-diff -Nur linux-4.1.13.orig/drivers/scsi/fcoe/fcoe.c linux-4.1.13/drivers/scsi/fcoe/fcoe.c
---- linux-4.1.13.orig/drivers/scsi/fcoe/fcoe.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/scsi/fcoe/fcoe.c 2015-11-29 09:23:09.581616045 +0100
+diff -Nur linux-4.1.20.orig/drivers/scsi/fcoe/fcoe.c linux-4.1.20/drivers/scsi/fcoe/fcoe.c
+--- linux-4.1.20.orig/drivers/scsi/fcoe/fcoe.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/scsi/fcoe/fcoe.c 2016-03-21 20:18:32.000000000 +0100
@@ -1287,7 +1287,7 @@
struct sk_buff *skb;
#ifdef CONFIG_SMP
@@ -8167,9 +8834,9 @@ diff -Nur linux-4.1.13.orig/drivers/scsi/fcoe/fcoe.c linux-4.1.13/drivers/scsi/f
kfree_skb(skb);
}
-diff -Nur linux-4.1.13.orig/drivers/scsi/fcoe/fcoe_ctlr.c linux-4.1.13/drivers/scsi/fcoe/fcoe_ctlr.c
---- linux-4.1.13.orig/drivers/scsi/fcoe/fcoe_ctlr.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/scsi/fcoe/fcoe_ctlr.c 2015-11-29 09:23:09.581616045 +0100
+diff -Nur linux-4.1.20.orig/drivers/scsi/fcoe/fcoe_ctlr.c linux-4.1.20/drivers/scsi/fcoe/fcoe_ctlr.c
+--- linux-4.1.20.orig/drivers/scsi/fcoe/fcoe_ctlr.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/scsi/fcoe/fcoe_ctlr.c 2016-03-21 20:18:32.000000000 +0100
@@ -831,7 +831,7 @@
INIT_LIST_HEAD(&del_list);
@@ -8188,9 +8855,9 @@ diff -Nur linux-4.1.13.orig/drivers/scsi/fcoe/fcoe_ctlr.c linux-4.1.13/drivers/s
list_for_each_entry_safe(fcf, next, &del_list, list) {
/* Removes fcf from current list */
-diff -Nur linux-4.1.13.orig/drivers/scsi/libfc/fc_exch.c linux-4.1.13/drivers/scsi/libfc/fc_exch.c
---- linux-4.1.13.orig/drivers/scsi/libfc/fc_exch.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/scsi/libfc/fc_exch.c 2015-11-29 09:23:09.581616045 +0100
+diff -Nur linux-4.1.20.orig/drivers/scsi/libfc/fc_exch.c linux-4.1.20/drivers/scsi/libfc/fc_exch.c
+--- linux-4.1.20.orig/drivers/scsi/libfc/fc_exch.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/scsi/libfc/fc_exch.c 2016-03-21 20:18:32.000000000 +0100
@@ -814,10 +814,10 @@
}
memset(ep, 0, sizeof(*ep));
@@ -8204,9 +8871,9 @@ diff -Nur linux-4.1.13.orig/drivers/scsi/libfc/fc_exch.c linux-4.1.13/drivers/sc
/* peek cache of free slot */
if (pool->left != FC_XID_UNKNOWN) {
-diff -Nur linux-4.1.13.orig/drivers/scsi/libsas/sas_ata.c linux-4.1.13/drivers/scsi/libsas/sas_ata.c
---- linux-4.1.13.orig/drivers/scsi/libsas/sas_ata.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/scsi/libsas/sas_ata.c 2015-11-29 09:23:09.581616045 +0100
+diff -Nur linux-4.1.20.orig/drivers/scsi/libsas/sas_ata.c linux-4.1.20/drivers/scsi/libsas/sas_ata.c
+--- linux-4.1.20.orig/drivers/scsi/libsas/sas_ata.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/scsi/libsas/sas_ata.c 2016-03-21 20:18:32.000000000 +0100
@@ -190,7 +190,7 @@
/* TODO: audit callers to ensure they are ready for qc_issue to
* unconditionally re-enable interrupts
@@ -8225,9 +8892,9 @@ diff -Nur linux-4.1.13.orig/drivers/scsi/libsas/sas_ata.c linux-4.1.13/drivers/s
return ret;
}
-diff -Nur linux-4.1.13.orig/drivers/scsi/qla2xxx/qla_inline.h linux-4.1.13/drivers/scsi/qla2xxx/qla_inline.h
---- linux-4.1.13.orig/drivers/scsi/qla2xxx/qla_inline.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/scsi/qla2xxx/qla_inline.h 2015-11-29 09:23:09.581616045 +0100
+diff -Nur linux-4.1.20.orig/drivers/scsi/qla2xxx/qla_inline.h linux-4.1.20/drivers/scsi/qla2xxx/qla_inline.h
+--- linux-4.1.20.orig/drivers/scsi/qla2xxx/qla_inline.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/scsi/qla2xxx/qla_inline.h 2016-03-21 20:18:32.000000000 +0100
@@ -59,12 +59,12 @@
{
unsigned long flags;
@@ -8243,9 +8910,9 @@ diff -Nur linux-4.1.13.orig/drivers/scsi/qla2xxx/qla_inline.h linux-4.1.13/drive
}
static inline uint8_t *
-diff -Nur linux-4.1.13.orig/drivers/thermal/x86_pkg_temp_thermal.c linux-4.1.13/drivers/thermal/x86_pkg_temp_thermal.c
---- linux-4.1.13.orig/drivers/thermal/x86_pkg_temp_thermal.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/thermal/x86_pkg_temp_thermal.c 2015-11-29 09:23:09.581616045 +0100
+diff -Nur linux-4.1.20.orig/drivers/thermal/x86_pkg_temp_thermal.c linux-4.1.20/drivers/thermal/x86_pkg_temp_thermal.c
+--- linux-4.1.20.orig/drivers/thermal/x86_pkg_temp_thermal.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/thermal/x86_pkg_temp_thermal.c 2016-03-21 20:18:32.000000000 +0100
@@ -29,6 +29,7 @@
#include <linux/pm.h>
#include <linux/thermal.h>
@@ -8348,9 +9015,9 @@ diff -Nur linux-4.1.13.orig/drivers/thermal/x86_pkg_temp_thermal.c linux-4.1.13/
for_each_online_cpu(i)
cancel_delayed_work_sync(
&per_cpu(pkg_temp_thermal_threshold_work, i));
-diff -Nur linux-4.1.13.orig/drivers/tty/serial/8250/8250_core.c linux-4.1.13/drivers/tty/serial/8250/8250_core.c
---- linux-4.1.13.orig/drivers/tty/serial/8250/8250_core.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/tty/serial/8250/8250_core.c 2015-11-29 09:23:09.581616045 +0100
+diff -Nur linux-4.1.20.orig/drivers/tty/serial/8250/8250_core.c linux-4.1.20/drivers/tty/serial/8250/8250_core.c
+--- linux-4.1.20.orig/drivers/tty/serial/8250/8250_core.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/tty/serial/8250/8250_core.c 2016-03-21 20:18:32.000000000 +0100
@@ -36,6 +36,7 @@
#include <linux/nmi.h>
#include <linux/mutex.h>
@@ -8386,9 +9053,9 @@ diff -Nur linux-4.1.13.orig/drivers/tty/serial/8250/8250_core.c linux-4.1.13/dri
locked = spin_trylock_irqsave(&port->lock, flags);
else
spin_lock_irqsave(&port->lock, flags);
-diff -Nur linux-4.1.13.orig/drivers/tty/serial/amba-pl011.c linux-4.1.13/drivers/tty/serial/amba-pl011.c
---- linux-4.1.13.orig/drivers/tty/serial/amba-pl011.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/tty/serial/amba-pl011.c 2015-11-29 09:23:09.585615778 +0100
+diff -Nur linux-4.1.20.orig/drivers/tty/serial/amba-pl011.c linux-4.1.20/drivers/tty/serial/amba-pl011.c
+--- linux-4.1.20.orig/drivers/tty/serial/amba-pl011.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/tty/serial/amba-pl011.c 2016-03-21 20:18:32.000000000 +0100
@@ -2000,13 +2000,19 @@
clk_enable(uap->clk);
@@ -8422,9 +9089,9 @@ diff -Nur linux-4.1.13.orig/drivers/tty/serial/amba-pl011.c linux-4.1.13/drivers
clk_disable(uap->clk);
}
-diff -Nur linux-4.1.13.orig/drivers/tty/serial/omap-serial.c linux-4.1.13/drivers/tty/serial/omap-serial.c
---- linux-4.1.13.orig/drivers/tty/serial/omap-serial.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/tty/serial/omap-serial.c 2015-11-29 09:23:09.585615778 +0100
+diff -Nur linux-4.1.20.orig/drivers/tty/serial/omap-serial.c linux-4.1.20/drivers/tty/serial/omap-serial.c
+--- linux-4.1.20.orig/drivers/tty/serial/omap-serial.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/tty/serial/omap-serial.c 2016-03-21 20:18:32.000000000 +0100
@@ -1282,13 +1282,10 @@
pm_runtime_get_sync(up->dev);
@@ -8452,9 +9119,9 @@ diff -Nur linux-4.1.13.orig/drivers/tty/serial/omap-serial.c linux-4.1.13/driver
}
static int __init
-diff -Nur linux-4.1.13.orig/drivers/usb/core/hcd.c linux-4.1.13/drivers/usb/core/hcd.c
---- linux-4.1.13.orig/drivers/usb/core/hcd.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/usb/core/hcd.c 2015-11-29 09:23:09.585615778 +0100
+diff -Nur linux-4.1.20.orig/drivers/usb/core/hcd.c linux-4.1.20/drivers/usb/core/hcd.c
+--- linux-4.1.20.orig/drivers/usb/core/hcd.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/usb/core/hcd.c 2016-03-21 20:18:32.000000000 +0100
@@ -1684,9 +1684,9 @@
* and no one may trigger the above deadlock situation when
* running complete() in tasklet.
@@ -8467,9 +9134,9 @@ diff -Nur linux-4.1.13.orig/drivers/usb/core/hcd.c linux-4.1.13/drivers/usb/core
usb_anchor_resume_wakeups(anchor);
atomic_dec(&urb->use_count);
-diff -Nur linux-4.1.13.orig/drivers/usb/gadget/function/f_fs.c linux-4.1.13/drivers/usb/gadget/function/f_fs.c
---- linux-4.1.13.orig/drivers/usb/gadget/function/f_fs.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/usb/gadget/function/f_fs.c 2015-11-29 09:23:09.585615778 +0100
+diff -Nur linux-4.1.20.orig/drivers/usb/gadget/function/f_fs.c linux-4.1.20/drivers/usb/gadget/function/f_fs.c
+--- linux-4.1.20.orig/drivers/usb/gadget/function/f_fs.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/usb/gadget/function/f_fs.c 2016-03-21 20:18:32.000000000 +0100
@@ -1405,7 +1405,7 @@
pr_info("%s(): freeing\n", __func__);
ffs_data_clear(ffs);
@@ -8479,9 +9146,9 @@ diff -Nur linux-4.1.13.orig/drivers/usb/gadget/function/f_fs.c linux-4.1.13/driv
kfree(ffs->dev_name);
kfree(ffs);
}
-diff -Nur linux-4.1.13.orig/drivers/usb/gadget/legacy/inode.c linux-4.1.13/drivers/usb/gadget/legacy/inode.c
---- linux-4.1.13.orig/drivers/usb/gadget/legacy/inode.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/drivers/usb/gadget/legacy/inode.c 2015-11-29 09:23:09.585615778 +0100
+diff -Nur linux-4.1.20.orig/drivers/usb/gadget/legacy/inode.c linux-4.1.20/drivers/usb/gadget/legacy/inode.c
+--- linux-4.1.20.orig/drivers/usb/gadget/legacy/inode.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/drivers/usb/gadget/legacy/inode.c 2016-03-21 20:18:32.000000000 +0100
@@ -345,7 +345,7 @@
spin_unlock_irq (&epdata->dev->lock);
@@ -8500,9 +9167,9 @@ diff -Nur linux-4.1.13.orig/drivers/usb/gadget/legacy/inode.c linux-4.1.13/drive
if (epdata->status == -ECONNRESET)
epdata->status = -EINTR;
} else {
-diff -Nur linux-4.1.13.orig/fs/aio.c linux-4.1.13/fs/aio.c
---- linux-4.1.13.orig/fs/aio.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/fs/aio.c 2015-11-29 09:23:09.585615778 +0100
+diff -Nur linux-4.1.20.orig/fs/aio.c linux-4.1.20/fs/aio.c
+--- linux-4.1.20.orig/fs/aio.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/fs/aio.c 2016-03-21 20:18:32.000000000 +0100
@@ -40,6 +40,7 @@
#include <linux/ramfs.h>
#include <linux/percpu-refcount.h>
@@ -8578,9 +9245,9 @@ diff -Nur linux-4.1.13.orig/fs/aio.c linux-4.1.13/fs/aio.c
static int ioctx_add_table(struct kioctx *ctx, struct mm_struct *mm)
{
unsigned i, new_nr;
-diff -Nur linux-4.1.13.orig/fs/autofs4/autofs_i.h linux-4.1.13/fs/autofs4/autofs_i.h
---- linux-4.1.13.orig/fs/autofs4/autofs_i.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/fs/autofs4/autofs_i.h 2015-11-29 09:23:09.585615778 +0100
+diff -Nur linux-4.1.20.orig/fs/autofs4/autofs_i.h linux-4.1.20/fs/autofs4/autofs_i.h
+--- linux-4.1.20.orig/fs/autofs4/autofs_i.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/fs/autofs4/autofs_i.h 2016-03-21 20:18:32.000000000 +0100
@@ -34,6 +34,7 @@
#include <linux/sched.h>
#include <linux/mount.h>
@@ -8589,9 +9256,9 @@ diff -Nur linux-4.1.13.orig/fs/autofs4/autofs_i.h linux-4.1.13/fs/autofs4/autofs
#include <asm/current.h>
#include <asm/uaccess.h>
-diff -Nur linux-4.1.13.orig/fs/autofs4/expire.c linux-4.1.13/fs/autofs4/expire.c
---- linux-4.1.13.orig/fs/autofs4/expire.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/fs/autofs4/expire.c 2015-11-29 09:23:09.585615778 +0100
+diff -Nur linux-4.1.20.orig/fs/autofs4/expire.c linux-4.1.20/fs/autofs4/expire.c
+--- linux-4.1.20.orig/fs/autofs4/expire.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/fs/autofs4/expire.c 2016-03-21 20:18:32.000000000 +0100
@@ -150,7 +150,7 @@
parent = p->d_parent;
if (!spin_trylock(&parent->d_lock)) {
@@ -8601,9 +9268,9 @@ diff -Nur linux-4.1.13.orig/fs/autofs4/expire.c linux-4.1.13/fs/autofs4/expire.c
goto relock;
}
spin_unlock(&p->d_lock);
-diff -Nur linux-4.1.13.orig/fs/buffer.c linux-4.1.13/fs/buffer.c
---- linux-4.1.13.orig/fs/buffer.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/fs/buffer.c 2015-11-29 09:23:09.585615778 +0100
+diff -Nur linux-4.1.20.orig/fs/buffer.c linux-4.1.20/fs/buffer.c
+--- linux-4.1.20.orig/fs/buffer.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/fs/buffer.c 2016-03-21 20:18:32.000000000 +0100
@@ -301,8 +301,7 @@
* decide that the page is now completely done.
*/
@@ -8671,9 +9338,9 @@ diff -Nur linux-4.1.13.orig/fs/buffer.c linux-4.1.13/fs/buffer.c
preempt_disable();
__this_cpu_inc(bh_accounting.nr);
recalc_bh_state();
-diff -Nur linux-4.1.13.orig/fs/dcache.c linux-4.1.13/fs/dcache.c
---- linux-4.1.13.orig/fs/dcache.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/fs/dcache.c 2015-11-29 09:23:09.585615778 +0100
+diff -Nur linux-4.1.20.orig/fs/dcache.c linux-4.1.20/fs/dcache.c
+--- linux-4.1.20.orig/fs/dcache.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/fs/dcache.c 2016-03-21 20:18:32.000000000 +0100
@@ -19,6 +19,7 @@
#include <linux/mm.h>
#include <linux/fs.h>
@@ -8682,7 +9349,7 @@ diff -Nur linux-4.1.13.orig/fs/dcache.c linux-4.1.13/fs/dcache.c
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/hash.h>
-@@ -589,7 +590,7 @@
+@@ -578,7 +579,7 @@
failed:
spin_unlock(&dentry->d_lock);
@@ -8691,7 +9358,7 @@ diff -Nur linux-4.1.13.orig/fs/dcache.c linux-4.1.13/fs/dcache.c
return dentry; /* try again with same dentry */
}
-@@ -2398,7 +2399,7 @@
+@@ -2388,7 +2389,7 @@
if (dentry->d_lockref.count == 1) {
if (!spin_trylock(&inode->i_lock)) {
spin_unlock(&dentry->d_lock);
@@ -8700,9 +9367,9 @@ diff -Nur linux-4.1.13.orig/fs/dcache.c linux-4.1.13/fs/dcache.c
goto again;
}
dentry->d_flags &= ~DCACHE_CANT_MOUNT;
-diff -Nur linux-4.1.13.orig/fs/eventpoll.c linux-4.1.13/fs/eventpoll.c
---- linux-4.1.13.orig/fs/eventpoll.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/fs/eventpoll.c 2015-11-29 09:23:09.585615778 +0100
+diff -Nur linux-4.1.20.orig/fs/eventpoll.c linux-4.1.20/fs/eventpoll.c
+--- linux-4.1.20.orig/fs/eventpoll.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/fs/eventpoll.c 2016-03-21 20:18:32.000000000 +0100
@@ -505,12 +505,12 @@
*/
static void ep_poll_safewake(wait_queue_head_t *wq)
@@ -8718,9 +9385,9 @@ diff -Nur linux-4.1.13.orig/fs/eventpoll.c linux-4.1.13/fs/eventpoll.c
}
static void ep_remove_wait_queue(struct eppoll_entry *pwq)
-diff -Nur linux-4.1.13.orig/fs/exec.c linux-4.1.13/fs/exec.c
---- linux-4.1.13.orig/fs/exec.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/fs/exec.c 2015-11-29 09:23:09.593615242 +0100
+diff -Nur linux-4.1.20.orig/fs/exec.c linux-4.1.20/fs/exec.c
+--- linux-4.1.20.orig/fs/exec.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/fs/exec.c 2016-03-21 20:18:32.000000000 +0100
@@ -859,12 +859,14 @@
}
}
@@ -8736,9 +9403,37 @@ diff -Nur linux-4.1.13.orig/fs/exec.c linux-4.1.13/fs/exec.c
task_unlock(tsk);
if (old_mm) {
up_read(&old_mm->mmap_sem);
-diff -Nur linux-4.1.13.orig/fs/jbd/checkpoint.c linux-4.1.13/fs/jbd/checkpoint.c
---- linux-4.1.13.orig/fs/jbd/checkpoint.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/fs/jbd/checkpoint.c 2015-11-29 09:23:09.593615242 +0100
+diff -Nur linux-4.1.20.orig/fs/f2fs/f2fs.h linux-4.1.20/fs/f2fs/f2fs.h
+--- linux-4.1.20.orig/fs/f2fs/f2fs.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/fs/f2fs/f2fs.h 2016-03-21 20:18:32.000000000 +0100
+@@ -22,7 +22,6 @@
+
+ #ifdef CONFIG_F2FS_CHECK_FS
+ #define f2fs_bug_on(sbi, condition) BUG_ON(condition)
+-#define f2fs_down_write(x, y) down_write_nest_lock(x, y)
+ #else
+ #define f2fs_bug_on(sbi, condition) \
+ do { \
+@@ -31,7 +30,6 @@
+ set_sbi_flag(sbi, SBI_NEED_FSCK); \
+ } \
+ } while (0)
+-#define f2fs_down_write(x, y) down_write(x)
+ #endif
+
+ /*
+@@ -838,7 +836,7 @@
+
+ static inline void f2fs_lock_all(struct f2fs_sb_info *sbi)
+ {
+- f2fs_down_write(&sbi->cp_rwsem, &sbi->cp_mutex);
++ down_write(&sbi->cp_rwsem);
+ }
+
+ static inline void f2fs_unlock_all(struct f2fs_sb_info *sbi)
+diff -Nur linux-4.1.20.orig/fs/jbd/checkpoint.c linux-4.1.20/fs/jbd/checkpoint.c
+--- linux-4.1.20.orig/fs/jbd/checkpoint.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/fs/jbd/checkpoint.c 2016-03-21 20:18:32.000000000 +0100
@@ -129,6 +129,8 @@
if (journal->j_flags & JFS_ABORT)
return;
@@ -8748,9 +9443,9 @@ diff -Nur linux-4.1.13.orig/fs/jbd/checkpoint.c linux-4.1.13/fs/jbd/checkpoint.c
mutex_lock(&journal->j_checkpoint_mutex);
/*
-diff -Nur linux-4.1.13.orig/fs/jbd2/checkpoint.c linux-4.1.13/fs/jbd2/checkpoint.c
---- linux-4.1.13.orig/fs/jbd2/checkpoint.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/fs/jbd2/checkpoint.c 2015-11-29 09:23:09.593615242 +0100
+diff -Nur linux-4.1.20.orig/fs/jbd2/checkpoint.c linux-4.1.20/fs/jbd2/checkpoint.c
+--- linux-4.1.20.orig/fs/jbd2/checkpoint.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/fs/jbd2/checkpoint.c 2016-03-21 20:18:32.000000000 +0100
@@ -116,6 +116,8 @@
nblocks = jbd2_space_needed(journal);
while (jbd2_log_space_left(journal) < nblocks) {
@@ -8760,9 +9455,9 @@ diff -Nur linux-4.1.13.orig/fs/jbd2/checkpoint.c linux-4.1.13/fs/jbd2/checkpoint
mutex_lock(&journal->j_checkpoint_mutex);
/*
-diff -Nur linux-4.1.13.orig/fs/namespace.c linux-4.1.13/fs/namespace.c
---- linux-4.1.13.orig/fs/namespace.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/fs/namespace.c 2015-11-29 09:23:09.593615242 +0100
+diff -Nur linux-4.1.20.orig/fs/namespace.c linux-4.1.20/fs/namespace.c
+--- linux-4.1.20.orig/fs/namespace.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/fs/namespace.c 2016-03-21 20:18:32.000000000 +0100
@@ -14,6 +14,7 @@
#include <linux/mnt_namespace.h>
#include <linux/user_namespace.h>
@@ -8785,9 +9480,9 @@ diff -Nur linux-4.1.13.orig/fs/namespace.c linux-4.1.13/fs/namespace.c
/*
* After the slowpath clears MNT_WRITE_HOLD, mnt_is_readonly will
* be set to match its requirements. So we must not load that until
-diff -Nur linux-4.1.13.orig/fs/ntfs/aops.c linux-4.1.13/fs/ntfs/aops.c
---- linux-4.1.13.orig/fs/ntfs/aops.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/fs/ntfs/aops.c 2015-11-29 09:23:09.593615242 +0100
+diff -Nur linux-4.1.20.orig/fs/ntfs/aops.c linux-4.1.20/fs/ntfs/aops.c
+--- linux-4.1.20.orig/fs/ntfs/aops.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/fs/ntfs/aops.c 2016-03-21 20:18:32.000000000 +0100
@@ -107,8 +107,7 @@
"0x%llx.", (unsigned long long)bh->b_blocknr);
}
@@ -8835,9 +9530,9 @@ diff -Nur linux-4.1.13.orig/fs/ntfs/aops.c linux-4.1.13/fs/ntfs/aops.c
}
/**
-diff -Nur linux-4.1.13.orig/fs/timerfd.c linux-4.1.13/fs/timerfd.c
---- linux-4.1.13.orig/fs/timerfd.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/fs/timerfd.c 2015-11-29 09:23:09.593615242 +0100
+diff -Nur linux-4.1.20.orig/fs/timerfd.c linux-4.1.20/fs/timerfd.c
+--- linux-4.1.20.orig/fs/timerfd.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/fs/timerfd.c 2016-03-21 20:18:32.000000000 +0100
@@ -450,7 +450,10 @@
break;
}
@@ -8850,9 +9545,9 @@ diff -Nur linux-4.1.13.orig/fs/timerfd.c linux-4.1.13/fs/timerfd.c
}
/*
-diff -Nur linux-4.1.13.orig/fs/xfs/xfs_inode.c linux-4.1.13/fs/xfs/xfs_inode.c
---- linux-4.1.13.orig/fs/xfs/xfs_inode.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/fs/xfs/xfs_inode.c 2015-11-29 09:23:09.593615242 +0100
+diff -Nur linux-4.1.20.orig/fs/xfs/xfs_inode.c linux-4.1.20/fs/xfs/xfs_inode.c
+--- linux-4.1.20.orig/fs/xfs/xfs_inode.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/fs/xfs/xfs_inode.c 2016-03-21 20:18:32.000000000 +0100
@@ -164,7 +164,7 @@
(XFS_MMAPLOCK_SHARED | XFS_MMAPLOCK_EXCL));
ASSERT((lock_flags & (XFS_ILOCK_SHARED | XFS_ILOCK_EXCL)) !=
@@ -8975,9 +9670,9 @@ diff -Nur linux-4.1.13.orig/fs/xfs/xfs_inode.c linux-4.1.13/fs/xfs/xfs_inode.c
try_lock = 0;
i = 0;
-diff -Nur linux-4.1.13.orig/fs/xfs/xfs_inode.h linux-4.1.13/fs/xfs/xfs_inode.h
---- linux-4.1.13.orig/fs/xfs/xfs_inode.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/fs/xfs/xfs_inode.h 2015-11-29 09:23:09.593615242 +0100
+diff -Nur linux-4.1.20.orig/fs/xfs/xfs_inode.h linux-4.1.20/fs/xfs/xfs_inode.h
+--- linux-4.1.20.orig/fs/xfs/xfs_inode.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/fs/xfs/xfs_inode.h 2016-03-21 20:18:32.000000000 +0100
@@ -284,9 +284,9 @@
* Flags for lockdep annotations.
*
@@ -9041,22 +9736,29 @@ diff -Nur linux-4.1.13.orig/fs/xfs/xfs_inode.h linux-4.1.13/fs/xfs/xfs_inode.h
-
-#define XFS_IOLOCK_SHIFT 16
-#define XFS_IOLOCK_PARENT (XFS_LOCK_PARENT << XFS_IOLOCK_SHIFT)
+-
+-#define XFS_MMAPLOCK_SHIFT 20
+-
+-#define XFS_ILOCK_SHIFT 24
+-#define XFS_ILOCK_PARENT (XFS_LOCK_PARENT << XFS_ILOCK_SHIFT)
+-#define XFS_ILOCK_RTBITMAP (XFS_LOCK_RTBITMAP << XFS_ILOCK_SHIFT)
+-#define XFS_ILOCK_RTSUM (XFS_LOCK_RTSUM << XFS_ILOCK_SHIFT)
+-
+-#define XFS_IOLOCK_DEP_MASK 0x000f0000
+-#define XFS_MMAPLOCK_DEP_MASK 0x00f00000
+-#define XFS_ILOCK_DEP_MASK 0xff000000
+-#define XFS_LOCK_DEP_MASK (XFS_IOLOCK_DEP_MASK | \
+#define XFS_IOLOCK_SHIFT 16
+#define XFS_IOLOCK_PARENT_VAL 4
+#define XFS_IOLOCK_MAX_SUBCLASS (XFS_IOLOCK_PARENT_VAL - 1)
+#define XFS_IOLOCK_DEP_MASK 0x000f0000
+#define XFS_IOLOCK_PARENT (XFS_IOLOCK_PARENT_VAL << XFS_IOLOCK_SHIFT)
-
--#define XFS_MMAPLOCK_SHIFT 20
++
+#define XFS_MMAPLOCK_SHIFT 20
+#define XFS_MMAPLOCK_NUMORDER 0
+#define XFS_MMAPLOCK_MAX_SUBCLASS 3
+#define XFS_MMAPLOCK_DEP_MASK 0x00f00000
-
--#define XFS_ILOCK_SHIFT 24
--#define XFS_ILOCK_PARENT (XFS_LOCK_PARENT << XFS_ILOCK_SHIFT)
--#define XFS_ILOCK_RTBITMAP (XFS_LOCK_RTBITMAP << XFS_ILOCK_SHIFT)
--#define XFS_ILOCK_RTSUM (XFS_LOCK_RTSUM << XFS_ILOCK_SHIFT)
++
+#define XFS_ILOCK_SHIFT 24
+#define XFS_ILOCK_PARENT_VAL 5
+#define XFS_ILOCK_MAX_SUBCLASS (XFS_ILOCK_PARENT_VAL - 1)
@@ -9066,18 +9768,14 @@ diff -Nur linux-4.1.13.orig/fs/xfs/xfs_inode.h linux-4.1.13/fs/xfs/xfs_inode.h
+#define XFS_ILOCK_PARENT (XFS_ILOCK_PARENT_VAL << XFS_ILOCK_SHIFT)
+#define XFS_ILOCK_RTBITMAP (XFS_ILOCK_RTBITMAP_VAL << XFS_ILOCK_SHIFT)
+#define XFS_ILOCK_RTSUM (XFS_ILOCK_RTSUM_VAL << XFS_ILOCK_SHIFT)
-
--#define XFS_IOLOCK_DEP_MASK 0x000f0000
--#define XFS_MMAPLOCK_DEP_MASK 0x00f00000
--#define XFS_ILOCK_DEP_MASK 0xff000000
--#define XFS_LOCK_DEP_MASK (XFS_IOLOCK_DEP_MASK | \
++
+#define XFS_LOCK_SUBCLASS_MASK (XFS_IOLOCK_DEP_MASK | \
XFS_MMAPLOCK_DEP_MASK | \
XFS_ILOCK_DEP_MASK)
-diff -Nur linux-4.1.13.orig/include/acpi/platform/aclinux.h linux-4.1.13/include/acpi/platform/aclinux.h
---- linux-4.1.13.orig/include/acpi/platform/aclinux.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/acpi/platform/aclinux.h 2015-11-29 09:23:09.593615242 +0100
+diff -Nur linux-4.1.20.orig/include/acpi/platform/aclinux.h linux-4.1.20/include/acpi/platform/aclinux.h
+--- linux-4.1.20.orig/include/acpi/platform/aclinux.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/acpi/platform/aclinux.h 2016-03-21 20:18:32.000000000 +0100
@@ -123,6 +123,7 @@
#define acpi_cache_t struct kmem_cache
@@ -9107,9 +9805,9 @@ diff -Nur linux-4.1.13.orig/include/acpi/platform/aclinux.h linux-4.1.13/include
/*
* OSL interfaces used by debugger/disassembler
*/
-diff -Nur linux-4.1.13.orig/include/asm-generic/bug.h linux-4.1.13/include/asm-generic/bug.h
---- linux-4.1.13.orig/include/asm-generic/bug.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/asm-generic/bug.h 2015-11-29 09:23:09.593615242 +0100
+diff -Nur linux-4.1.20.orig/include/asm-generic/bug.h linux-4.1.20/include/asm-generic/bug.h
+--- linux-4.1.20.orig/include/asm-generic/bug.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/asm-generic/bug.h 2016-03-21 20:18:33.000000000 +0100
@@ -206,6 +206,20 @@
# define WARN_ON_SMP(x) ({0;})
#endif
@@ -9131,9 +9829,9 @@ diff -Nur linux-4.1.13.orig/include/asm-generic/bug.h linux-4.1.13/include/asm-g
#endif /* __ASSEMBLY__ */
#endif
-diff -Nur linux-4.1.13.orig/include/asm-generic/futex.h linux-4.1.13/include/asm-generic/futex.h
---- linux-4.1.13.orig/include/asm-generic/futex.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/asm-generic/futex.h 2015-11-29 09:23:09.593615242 +0100
+diff -Nur linux-4.1.20.orig/include/asm-generic/futex.h linux-4.1.20/include/asm-generic/futex.h
+--- linux-4.1.20.orig/include/asm-generic/futex.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/asm-generic/futex.h 2016-03-21 20:18:33.000000000 +0100
@@ -8,8 +8,7 @@
#ifndef CONFIG_SMP
/*
@@ -9176,9 +9874,20 @@ diff -Nur linux-4.1.13.orig/include/asm-generic/futex.h linux-4.1.13/include/asm
return 0;
}
-diff -Nur linux-4.1.13.orig/include/linux/blkdev.h linux-4.1.13/include/linux/blkdev.h
---- linux-4.1.13.orig/include/linux/blkdev.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/blkdev.h 2015-11-29 09:23:09.593615242 +0100
+diff -Nur linux-4.1.20.orig/include/linux/blk-mq.h linux-4.1.20/include/linux/blk-mq.h
+--- linux-4.1.20.orig/include/linux/blk-mq.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/blk-mq.h 2016-03-21 20:18:33.000000000 +0100
+@@ -202,6 +202,7 @@
+
+ struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *, const int ctx_index);
+ struct blk_mq_hw_ctx *blk_mq_alloc_single_hw_queue(struct blk_mq_tag_set *, unsigned int, int);
++void __blk_mq_complete_request_remote_work(struct work_struct *work);
+
+ int blk_mq_request_started(struct request *rq);
+ void blk_mq_start_request(struct request *rq);
+diff -Nur linux-4.1.20.orig/include/linux/blkdev.h linux-4.1.20/include/linux/blkdev.h
+--- linux-4.1.20.orig/include/linux/blkdev.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/blkdev.h 2016-03-21 20:18:33.000000000 +0100
@@ -101,6 +101,7 @@
struct list_head queuelist;
union {
@@ -9196,20 +9905,9 @@ diff -Nur linux-4.1.13.orig/include/linux/blkdev.h linux-4.1.13/include/linux/bl
struct percpu_ref mq_usage_counter;
struct list_head all_q_node;
-diff -Nur linux-4.1.13.orig/include/linux/blk-mq.h linux-4.1.13/include/linux/blk-mq.h
---- linux-4.1.13.orig/include/linux/blk-mq.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/blk-mq.h 2015-11-29 09:23:09.593615242 +0100
-@@ -202,6 +202,7 @@
-
- struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *, const int ctx_index);
- struct blk_mq_hw_ctx *blk_mq_alloc_single_hw_queue(struct blk_mq_tag_set *, unsigned int, int);
-+void __blk_mq_complete_request_remote_work(struct work_struct *work);
-
- int blk_mq_request_started(struct request *rq);
- void blk_mq_start_request(struct request *rq);
-diff -Nur linux-4.1.13.orig/include/linux/bottom_half.h linux-4.1.13/include/linux/bottom_half.h
---- linux-4.1.13.orig/include/linux/bottom_half.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/bottom_half.h 2015-11-29 09:23:09.593615242 +0100
+diff -Nur linux-4.1.20.orig/include/linux/bottom_half.h linux-4.1.20/include/linux/bottom_half.h
+--- linux-4.1.20.orig/include/linux/bottom_half.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/bottom_half.h 2016-03-21 20:18:33.000000000 +0100
@@ -4,6 +4,39 @@
#include <linux/preempt.h>
#include <linux/preempt_mask.h>
@@ -9257,9 +9955,9 @@ diff -Nur linux-4.1.13.orig/include/linux/bottom_half.h linux-4.1.13/include/lin
+#endif
#endif /* _LINUX_BH_H */
-diff -Nur linux-4.1.13.orig/include/linux/buffer_head.h linux-4.1.13/include/linux/buffer_head.h
---- linux-4.1.13.orig/include/linux/buffer_head.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/buffer_head.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/buffer_head.h linux-4.1.20/include/linux/buffer_head.h
+--- linux-4.1.20.orig/include/linux/buffer_head.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/buffer_head.h 2016-03-21 20:18:33.000000000 +0100
@@ -75,8 +75,52 @@
struct address_space *b_assoc_map; /* mapping this buffer is
associated with */
@@ -9313,28 +10011,32 @@ diff -Nur linux-4.1.13.orig/include/linux/buffer_head.h linux-4.1.13/include/lin
/*
* macro tricks to expand the set_buffer_foo(), clear_buffer_foo()
* and buffer_foo() functions.
-diff -Nur linux-4.1.13.orig/include/linux/cgroup.h linux-4.1.13/include/linux/cgroup.h
---- linux-4.1.13.orig/include/linux/cgroup.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/cgroup.h 2015-11-29 09:23:09.601614714 +0100
-@@ -22,6 +22,7 @@
- #include <linux/seq_file.h>
- #include <linux/kernfs.h>
- #include <linux/wait.h>
-+#include <linux/work-simple.h>
-
- #ifdef CONFIG_CGROUPS
-
-@@ -91,6 +92,7 @@
+diff -Nur linux-4.1.20.orig/include/linux/cgroup-defs.h linux-4.1.20/include/linux/cgroup-defs.h
+--- linux-4.1.20.orig/include/linux/cgroup-defs.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/cgroup-defs.h 2016-03-21 20:18:33.000000000 +0100
+@@ -124,6 +124,7 @@
/* percpu_ref killing and RCU release */
struct rcu_head rcu_head;
struct work_struct destroy_work;
+ struct swork_event destroy_swork;
};
- /* bits in struct cgroup_subsys_state flags field */
-diff -Nur linux-4.1.13.orig/include/linux/completion.h linux-4.1.13/include/linux/completion.h
---- linux-4.1.13.orig/include/linux/completion.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/completion.h 2015-11-29 09:23:09.601614714 +0100
+ /*
+diff -Nur linux-4.1.20.orig/include/linux/cgroup.h linux-4.1.20/include/linux/cgroup.h
+--- linux-4.1.20.orig/include/linux/cgroup.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/cgroup.h 2016-03-21 20:18:33.000000000 +0100
+@@ -17,6 +17,8 @@
+ #include <linux/fs.h>
+ #include <linux/seq_file.h>
+ #include <linux/kernfs.h>
++#include <linux/wait.h>
++#include <linux/work-simple.h>
+
+ #include <linux/cgroup-defs.h>
+
+diff -Nur linux-4.1.20.orig/include/linux/completion.h linux-4.1.20/include/linux/completion.h
+--- linux-4.1.20.orig/include/linux/completion.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/completion.h 2016-03-21 20:18:33.000000000 +0100
@@ -7,8 +7,7 @@
* Atomic wait-for-completion handler data structures.
* See kernel/sched/completion.c for details.
@@ -9368,9 +10070,9 @@ diff -Nur linux-4.1.13.orig/include/linux/completion.h linux-4.1.13/include/linu
}
/**
-diff -Nur linux-4.1.13.orig/include/linux/cpu.h linux-4.1.13/include/linux/cpu.h
---- linux-4.1.13.orig/include/linux/cpu.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/cpu.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/cpu.h linux-4.1.20/include/linux/cpu.h
+--- linux-4.1.20.orig/include/linux/cpu.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/cpu.h 2016-03-21 20:18:33.000000000 +0100
@@ -231,6 +231,8 @@
extern void put_online_cpus(void);
extern void cpu_hotplug_disable(void);
@@ -9389,9 +10091,9 @@ diff -Nur linux-4.1.13.orig/include/linux/cpu.h linux-4.1.13/include/linux/cpu.h
#define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0)
#define __hotcpu_notifier(fn, pri) do { (void)(fn); } while (0)
/* These aren't inline functions due to a GCC bug. */
-diff -Nur linux-4.1.13.orig/include/linux/delay.h linux-4.1.13/include/linux/delay.h
---- linux-4.1.13.orig/include/linux/delay.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/delay.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/delay.h linux-4.1.20/include/linux/delay.h
+--- linux-4.1.20.orig/include/linux/delay.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/delay.h 2016-03-21 20:18:33.000000000 +0100
@@ -52,4 +52,10 @@
msleep(seconds * 1000);
}
@@ -9403,9 +10105,31 @@ diff -Nur linux-4.1.13.orig/include/linux/delay.h linux-4.1.13/include/linux/del
+#endif
+
#endif /* defined(_LINUX_DELAY_H) */
-diff -Nur linux-4.1.13.orig/include/linux/ftrace_event.h linux-4.1.13/include/linux/ftrace_event.h
---- linux-4.1.13.orig/include/linux/ftrace_event.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/ftrace_event.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/ftrace.h linux-4.1.20/include/linux/ftrace.h
+--- linux-4.1.20.orig/include/linux/ftrace.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/ftrace.h 2016-03-21 20:18:33.000000000 +0100
+@@ -682,6 +682,18 @@
+ #define CALLER_ADDR5 ((unsigned long)ftrace_return_address(5))
+ #define CALLER_ADDR6 ((unsigned long)ftrace_return_address(6))
+
++static inline unsigned long get_lock_parent_ip(void)
++{
++ unsigned long addr = CALLER_ADDR0;
++
++ if (!in_lock_functions(addr))
++ return addr;
++ addr = CALLER_ADDR1;
++ if (!in_lock_functions(addr))
++ return addr;
++ return CALLER_ADDR2;
++}
++
+ #ifdef CONFIG_IRQSOFF_TRACER
+ extern void time_hardirqs_on(unsigned long a0, unsigned long a1);
+ extern void time_hardirqs_off(unsigned long a0, unsigned long a1);
+diff -Nur linux-4.1.20.orig/include/linux/ftrace_event.h linux-4.1.20/include/linux/ftrace_event.h
+--- linux-4.1.20.orig/include/linux/ftrace_event.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/ftrace_event.h 2016-03-21 20:18:33.000000000 +0100
@@ -66,6 +66,9 @@
unsigned char flags;
unsigned char preempt_count;
@@ -9416,9 +10140,9 @@ diff -Nur linux-4.1.13.orig/include/linux/ftrace_event.h linux-4.1.13/include/li
};
#define FTRACE_MAX_EVENT \
-diff -Nur linux-4.1.13.orig/include/linux/highmem.h linux-4.1.13/include/linux/highmem.h
---- linux-4.1.13.orig/include/linux/highmem.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/highmem.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/highmem.h linux-4.1.20/include/linux/highmem.h
+--- linux-4.1.20.orig/include/linux/highmem.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/highmem.h 2016-03-21 20:18:33.000000000 +0100
@@ -7,6 +7,7 @@
#include <linux/mm.h>
#include <linux/uaccess.h>
@@ -9499,9 +10223,9 @@ diff -Nur linux-4.1.13.orig/include/linux/highmem.h linux-4.1.13/include/linux/h
#endif
}
-diff -Nur linux-4.1.13.orig/include/linux/hrtimer.h linux-4.1.13/include/linux/hrtimer.h
---- linux-4.1.13.orig/include/linux/hrtimer.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/hrtimer.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/hrtimer.h linux-4.1.20/include/linux/hrtimer.h
+--- linux-4.1.20.orig/include/linux/hrtimer.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/hrtimer.h 2016-03-21 20:18:33.000000000 +0100
@@ -111,6 +111,11 @@
enum hrtimer_restart (*function)(struct hrtimer *);
struct hrtimer_clock_base *base;
@@ -9546,9 +10270,9 @@ diff -Nur linux-4.1.13.orig/include/linux/hrtimer.h linux-4.1.13/include/linux/h
/* Query timers: */
extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer);
extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp);
-diff -Nur linux-4.1.13.orig/include/linux/idr.h linux-4.1.13/include/linux/idr.h
---- linux-4.1.13.orig/include/linux/idr.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/idr.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/idr.h linux-4.1.20/include/linux/idr.h
+--- linux-4.1.20.orig/include/linux/idr.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/idr.h 2016-03-21 20:18:33.000000000 +0100
@@ -95,10 +95,14 @@
* Each idr_preload() should be matched with an invocation of this
* function. See idr_preload() for details.
@@ -9564,9 +10288,9 @@ diff -Nur linux-4.1.13.orig/include/linux/idr.h linux-4.1.13/include/linux/idr.h
/**
* idr_find - return pointer for given id
-diff -Nur linux-4.1.13.orig/include/linux/init_task.h linux-4.1.13/include/linux/init_task.h
---- linux-4.1.13.orig/include/linux/init_task.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/init_task.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/init_task.h linux-4.1.20/include/linux/init_task.h
+--- linux-4.1.20.orig/include/linux/init_task.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/init_task.h 2016-03-21 20:18:33.000000000 +0100
@@ -147,9 +147,16 @@
# define INIT_PERF_EVENTS(tsk)
#endif
@@ -9593,9 +10317,9 @@ diff -Nur linux-4.1.13.orig/include/linux/init_task.h linux-4.1.13/include/linux
.pids = { \
[PIDTYPE_PID] = INIT_PID_LINK(PIDTYPE_PID), \
[PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \
-diff -Nur linux-4.1.13.orig/include/linux/interrupt.h linux-4.1.13/include/linux/interrupt.h
---- linux-4.1.13.orig/include/linux/interrupt.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/interrupt.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/interrupt.h linux-4.1.20/include/linux/interrupt.h
+--- linux-4.1.20.orig/include/linux/interrupt.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/interrupt.h 2016-03-21 20:18:33.000000000 +0100
@@ -61,6 +61,7 @@
* interrupt handler after suspending interrupts. For system
* wakeup devices users need to implement wakeup detection in
@@ -9672,7 +10396,7 @@ diff -Nur linux-4.1.13.orig/include/linux/interrupt.h linux-4.1.13/include/linux
#ifdef __ARCH_HAS_DO_SOFTIRQ
void do_softirq_own_stack(void);
#else
-@@ -446,6 +456,9 @@
+@@ -446,13 +456,25 @@
__do_softirq();
}
#endif
@@ -9682,7 +10406,15 @@ diff -Nur linux-4.1.13.orig/include/linux/interrupt.h linux-4.1.13/include/linux
extern void open_softirq(int nr, void (*action)(struct softirq_action *));
extern void softirq_init(void);
-@@ -453,6 +466,7 @@
+ extern void __raise_softirq_irqoff(unsigned int nr);
++#ifdef CONFIG_PREEMPT_RT_FULL
++extern void __raise_softirq_irqoff_ksoft(unsigned int nr);
++#else
++static inline void __raise_softirq_irqoff_ksoft(unsigned int nr)
++{
++ __raise_softirq_irqoff(nr);
++}
++#endif
extern void raise_softirq_irqoff(unsigned int nr);
extern void raise_softirq(unsigned int nr);
@@ -9690,7 +10422,7 @@ diff -Nur linux-4.1.13.orig/include/linux/interrupt.h linux-4.1.13/include/linux
DECLARE_PER_CPU(struct task_struct *, ksoftirqd);
-@@ -474,8 +488,9 @@
+@@ -474,8 +496,9 @@
to be executed on some cpu at least once after this.
* If the tasklet is already scheduled, but its execution is still not
started, it will be executed only once.
@@ -9702,7 +10434,7 @@ diff -Nur linux-4.1.13.orig/include/linux/interrupt.h linux-4.1.13/include/linux
* Tasklet is strictly serialized wrt itself, but not
wrt another tasklets. If client needs some intertask synchronization,
he makes it with spinlocks.
-@@ -500,27 +515,36 @@
+@@ -500,27 +523,36 @@
enum
{
TASKLET_STATE_SCHED, /* Tasklet is scheduled for execution */
@@ -9745,7 +10477,7 @@ diff -Nur linux-4.1.13.orig/include/linux/interrupt.h linux-4.1.13/include/linux
#define tasklet_unlock_wait(t) do { } while (0)
#define tasklet_unlock(t) do { } while (0)
#endif
-@@ -569,12 +593,7 @@
+@@ -569,12 +601,7 @@
smp_mb();
}
@@ -9759,7 +10491,7 @@ diff -Nur linux-4.1.13.orig/include/linux/interrupt.h linux-4.1.13/include/linux
extern void tasklet_kill(struct tasklet_struct *t);
extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu);
extern void tasklet_init(struct tasklet_struct *t,
-@@ -605,6 +624,12 @@
+@@ -605,6 +632,12 @@
tasklet_kill(&ttimer->tasklet);
}
@@ -9772,9 +10504,9 @@ diff -Nur linux-4.1.13.orig/include/linux/interrupt.h linux-4.1.13/include/linux
/*
* Autoprobing for irqs:
*
-diff -Nur linux-4.1.13.orig/include/linux/io-mapping.h linux-4.1.13/include/linux/io-mapping.h
---- linux-4.1.13.orig/include/linux/io-mapping.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/io-mapping.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/io-mapping.h linux-4.1.20/include/linux/io-mapping.h
+--- linux-4.1.20.orig/include/linux/io-mapping.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/io-mapping.h 2016-03-21 20:18:33.000000000 +0100
@@ -141,6 +141,7 @@
io_mapping_map_atomic_wc(struct io_mapping *mapping,
unsigned long offset)
@@ -9791,9 +10523,58 @@ diff -Nur linux-4.1.13.orig/include/linux/io-mapping.h linux-4.1.13/include/linu
}
/* Non-atomic map/unmap */
-diff -Nur linux-4.1.13.orig/include/linux/irqdesc.h linux-4.1.13/include/linux/irqdesc.h
---- linux-4.1.13.orig/include/linux/irqdesc.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/irqdesc.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/irq.h linux-4.1.20/include/linux/irq.h
+--- linux-4.1.20.orig/include/linux/irq.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/irq.h 2016-03-21 20:18:33.000000000 +0100
+@@ -72,6 +72,7 @@
+ * IRQ_IS_POLLED - Always polled by another interrupt. Exclude
+ * it from the spurious interrupt detection
+ * mechanism and from core side polling.
++ * IRQ_NO_SOFTIRQ_CALL - No softirq processing in the irq thread context (RT)
+ */
+ enum {
+ IRQ_TYPE_NONE = 0x00000000,
+@@ -97,13 +98,14 @@
+ IRQ_NOTHREAD = (1 << 16),
+ IRQ_PER_CPU_DEVID = (1 << 17),
+ IRQ_IS_POLLED = (1 << 18),
++ IRQ_NO_SOFTIRQ_CALL = (1 << 19),
+ };
+
+ #define IRQF_MODIFY_MASK \
+ (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \
+ IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \
+ IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID | \
+- IRQ_IS_POLLED)
++ IRQ_IS_POLLED | IRQ_NO_SOFTIRQ_CALL)
+
+ #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING)
+
+diff -Nur linux-4.1.20.orig/include/linux/irq_work.h linux-4.1.20/include/linux/irq_work.h
+--- linux-4.1.20.orig/include/linux/irq_work.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/irq_work.h 2016-03-21 20:18:33.000000000 +0100
+@@ -16,6 +16,7 @@
+ #define IRQ_WORK_BUSY 2UL
+ #define IRQ_WORK_FLAGS 3UL
+ #define IRQ_WORK_LAZY 4UL /* Doesn't want IPI, wait for tick */
++#define IRQ_WORK_HARD_IRQ 8UL /* Run hard IRQ context, even on RT */
+
+ struct irq_work {
+ unsigned long flags;
+@@ -51,4 +52,10 @@
+ static inline void irq_work_run(void) { }
+ #endif
+
++#if defined(CONFIG_IRQ_WORK) && defined(CONFIG_PREEMPT_RT_FULL)
++void irq_work_tick_soft(void);
++#else
++static inline void irq_work_tick_soft(void) { }
++#endif
++
+ #endif /* _LINUX_IRQ_WORK_H */
+diff -Nur linux-4.1.20.orig/include/linux/irqdesc.h linux-4.1.20/include/linux/irqdesc.h
+--- linux-4.1.20.orig/include/linux/irqdesc.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/irqdesc.h 2016-03-21 20:18:33.000000000 +0100
@@ -63,6 +63,7 @@
unsigned int irqs_unhandled;
atomic_t threads_handled;
@@ -9802,9 +10583,9 @@ diff -Nur linux-4.1.13.orig/include/linux/irqdesc.h linux-4.1.13/include/linux/i
raw_spinlock_t lock;
struct cpumask *percpu_enabled;
#ifdef CONFIG_SMP
-diff -Nur linux-4.1.13.orig/include/linux/irqflags.h linux-4.1.13/include/linux/irqflags.h
---- linux-4.1.13.orig/include/linux/irqflags.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/irqflags.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/irqflags.h linux-4.1.20/include/linux/irqflags.h
+--- linux-4.1.20.orig/include/linux/irqflags.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/irqflags.h 2016-03-21 20:18:33.000000000 +0100
@@ -25,8 +25,6 @@
# define trace_softirqs_enabled(p) ((p)->softirqs_enabled)
# define trace_hardirq_enter() do { current->hardirq_context++; } while (0)
@@ -9855,58 +10636,9 @@ diff -Nur linux-4.1.13.orig/include/linux/irqflags.h linux-4.1.13/include/linux/
+#endif
+
#endif
-diff -Nur linux-4.1.13.orig/include/linux/irq.h linux-4.1.13/include/linux/irq.h
---- linux-4.1.13.orig/include/linux/irq.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/irq.h 2015-11-29 09:23:09.601614714 +0100
-@@ -72,6 +72,7 @@
- * IRQ_IS_POLLED - Always polled by another interrupt. Exclude
- * it from the spurious interrupt detection
- * mechanism and from core side polling.
-+ * IRQ_NO_SOFTIRQ_CALL - No softirq processing in the irq thread context (RT)
- */
- enum {
- IRQ_TYPE_NONE = 0x00000000,
-@@ -97,13 +98,14 @@
- IRQ_NOTHREAD = (1 << 16),
- IRQ_PER_CPU_DEVID = (1 << 17),
- IRQ_IS_POLLED = (1 << 18),
-+ IRQ_NO_SOFTIRQ_CALL = (1 << 19),
- };
-
- #define IRQF_MODIFY_MASK \
- (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \
- IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \
- IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID | \
-- IRQ_IS_POLLED)
-+ IRQ_IS_POLLED | IRQ_NO_SOFTIRQ_CALL)
-
- #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING)
-
-diff -Nur linux-4.1.13.orig/include/linux/irq_work.h linux-4.1.13/include/linux/irq_work.h
---- linux-4.1.13.orig/include/linux/irq_work.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/irq_work.h 2015-11-29 09:23:09.601614714 +0100
-@@ -16,6 +16,7 @@
- #define IRQ_WORK_BUSY 2UL
- #define IRQ_WORK_FLAGS 3UL
- #define IRQ_WORK_LAZY 4UL /* Doesn't want IPI, wait for tick */
-+#define IRQ_WORK_HARD_IRQ 8UL /* Run hard IRQ context, even on RT */
-
- struct irq_work {
- unsigned long flags;
-@@ -51,4 +52,10 @@
- static inline void irq_work_run(void) { }
- #endif
-
-+#if defined(CONFIG_IRQ_WORK) && defined(CONFIG_PREEMPT_RT_FULL)
-+void irq_work_tick_soft(void);
-+#else
-+static inline void irq_work_tick_soft(void) { }
-+#endif
-+
- #endif /* _LINUX_IRQ_WORK_H */
-diff -Nur linux-4.1.13.orig/include/linux/jbd_common.h linux-4.1.13/include/linux/jbd_common.h
---- linux-4.1.13.orig/include/linux/jbd_common.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/jbd_common.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/jbd_common.h linux-4.1.20/include/linux/jbd_common.h
+--- linux-4.1.20.orig/include/linux/jbd_common.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/jbd_common.h 2016-03-21 20:18:33.000000000 +0100
@@ -15,32 +15,56 @@
static inline void jbd_lock_bh_state(struct buffer_head *bh)
@@ -9964,9 +10696,9 @@ diff -Nur linux-4.1.13.orig/include/linux/jbd_common.h linux-4.1.13/include/linu
}
#endif
-diff -Nur linux-4.1.13.orig/include/linux/kdb.h linux-4.1.13/include/linux/kdb.h
---- linux-4.1.13.orig/include/linux/kdb.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/kdb.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/kdb.h linux-4.1.20/include/linux/kdb.h
+--- linux-4.1.20.orig/include/linux/kdb.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/kdb.h 2016-03-21 20:18:33.000000000 +0100
@@ -167,6 +167,7 @@
extern __printf(1, 2) int kdb_printf(const char *, ...);
typedef __printf(1, 2) int (*kdb_printf_t)(const char *, ...);
@@ -9983,9 +10715,9 @@ diff -Nur linux-4.1.13.orig/include/linux/kdb.h linux-4.1.13/include/linux/kdb.h
static inline void kdb_init(int level) {}
static inline int kdb_register(char *cmd, kdb_func_t func, char *usage,
char *help, short minlen) { return 0; }
-diff -Nur linux-4.1.13.orig/include/linux/kernel.h linux-4.1.13/include/linux/kernel.h
---- linux-4.1.13.orig/include/linux/kernel.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/kernel.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/kernel.h linux-4.1.20/include/linux/kernel.h
+--- linux-4.1.20.orig/include/linux/kernel.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/kernel.h 2016-03-21 20:18:33.000000000 +0100
@@ -188,6 +188,9 @@
*/
# define might_sleep() \
@@ -10022,9 +10754,9 @@ diff -Nur linux-4.1.13.orig/include/linux/kernel.h linux-4.1.13/include/linux/ke
} system_state;
#define TAINT_PROPRIETARY_MODULE 0
-diff -Nur linux-4.1.13.orig/include/linux/kvm_host.h linux-4.1.13/include/linux/kvm_host.h
---- linux-4.1.13.orig/include/linux/kvm_host.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/kvm_host.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/kvm_host.h linux-4.1.20/include/linux/kvm_host.h
+--- linux-4.1.20.orig/include/linux/kvm_host.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/kvm_host.h 2016-03-21 20:18:33.000000000 +0100
@@ -230,7 +230,7 @@
int fpu_active;
@@ -10034,7 +10766,7 @@ diff -Nur linux-4.1.13.orig/include/linux/kvm_host.h linux-4.1.13/include/linux/
struct pid *pid;
int sigset_active;
sigset_t sigset;
-@@ -690,7 +690,7 @@
+@@ -701,7 +701,7 @@
}
#endif
@@ -10043,9 +10775,9 @@ diff -Nur linux-4.1.13.orig/include/linux/kvm_host.h linux-4.1.13/include/linux/
{
#ifdef __KVM_HAVE_ARCH_WQP
return vcpu->arch.wqp;
-diff -Nur linux-4.1.13.orig/include/linux/lglock.h linux-4.1.13/include/linux/lglock.h
---- linux-4.1.13.orig/include/linux/lglock.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/lglock.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/lglock.h linux-4.1.20/include/linux/lglock.h
+--- linux-4.1.20.orig/include/linux/lglock.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/lglock.h 2016-03-21 20:18:33.000000000 +0100
@@ -34,22 +34,39 @@
#endif
@@ -10101,9 +10833,9 @@ diff -Nur linux-4.1.13.orig/include/linux/lglock.h linux-4.1.13/include/linux/lg
#else
/* When !CONFIG_SMP, map lglock to spinlock */
#define lglock spinlock
-diff -Nur linux-4.1.13.orig/include/linux/list_bl.h linux-4.1.13/include/linux/list_bl.h
---- linux-4.1.13.orig/include/linux/list_bl.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/list_bl.h 2015-11-29 09:23:09.601614714 +0100
+diff -Nur linux-4.1.20.orig/include/linux/list_bl.h linux-4.1.20/include/linux/list_bl.h
+--- linux-4.1.20.orig/include/linux/list_bl.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/list_bl.h 2016-03-21 20:18:33.000000000 +0100
@@ -2,6 +2,7 @@
#define _LINUX_LIST_BL_H
@@ -10164,9 +10896,9 @@ diff -Nur linux-4.1.13.orig/include/linux/list_bl.h linux-4.1.13/include/linux/l
}
static inline bool hlist_bl_is_locked(struct hlist_bl_head *b)
-diff -Nur linux-4.1.13.orig/include/linux/locallock.h linux-4.1.13/include/linux/locallock.h
---- linux-4.1.13.orig/include/linux/locallock.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/include/linux/locallock.h 2015-11-29 09:23:09.605614450 +0100
+diff -Nur linux-4.1.20.orig/include/linux/locallock.h linux-4.1.20/include/linux/locallock.h
+--- linux-4.1.20.orig/include/linux/locallock.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/include/linux/locallock.h 2016-03-21 20:18:33.000000000 +0100
@@ -0,0 +1,270 @@
+#ifndef _LINUX_LOCALLOCK_H
+#define _LINUX_LOCALLOCK_H
@@ -10438,9 +11170,9 @@ diff -Nur linux-4.1.13.orig/include/linux/locallock.h linux-4.1.13/include/linux
+#endif
+
+#endif
-diff -Nur linux-4.1.13.orig/include/linux/mm_types.h linux-4.1.13/include/linux/mm_types.h
---- linux-4.1.13.orig/include/linux/mm_types.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/mm_types.h 2015-11-29 09:23:09.605614450 +0100
+diff -Nur linux-4.1.20.orig/include/linux/mm_types.h linux-4.1.20/include/linux/mm_types.h
+--- linux-4.1.20.orig/include/linux/mm_types.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/mm_types.h 2016-03-21 20:18:33.000000000 +0100
@@ -11,6 +11,7 @@
#include <linux/completion.h>
#include <linux/cpumask.h>
@@ -10459,9 +11191,9 @@ diff -Nur linux-4.1.13.orig/include/linux/mm_types.h linux-4.1.13/include/linux/
#ifdef CONFIG_X86_INTEL_MPX
/* address of the bounds directory */
void __user *bd_addr;
-diff -Nur linux-4.1.13.orig/include/linux/mutex.h linux-4.1.13/include/linux/mutex.h
---- linux-4.1.13.orig/include/linux/mutex.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/mutex.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/mutex.h linux-4.1.20/include/linux/mutex.h
+--- linux-4.1.20.orig/include/linux/mutex.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/mutex.h 2016-03-21 20:18:33.000000000 +0100
@@ -19,6 +19,17 @@
#include <asm/processor.h>
#include <linux/osq_lock.h>
@@ -10503,9 +11235,9 @@ diff -Nur linux-4.1.13.orig/include/linux/mutex.h linux-4.1.13/include/linux/mut
extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
#endif /* __LINUX_MUTEX_H */
-diff -Nur linux-4.1.13.orig/include/linux/mutex_rt.h linux-4.1.13/include/linux/mutex_rt.h
---- linux-4.1.13.orig/include/linux/mutex_rt.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/include/linux/mutex_rt.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/mutex_rt.h linux-4.1.20/include/linux/mutex_rt.h
+--- linux-4.1.20.orig/include/linux/mutex_rt.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/include/linux/mutex_rt.h 2016-03-21 20:18:33.000000000 +0100
@@ -0,0 +1,84 @@
+#ifndef __LINUX_MUTEX_RT_H
+#define __LINUX_MUTEX_RT_H
@@ -10591,10 +11323,31 @@ diff -Nur linux-4.1.13.orig/include/linux/mutex_rt.h linux-4.1.13/include/linux/
+} while (0)
+
+#endif
-diff -Nur linux-4.1.13.orig/include/linux/netdevice.h linux-4.1.13/include/linux/netdevice.h
---- linux-4.1.13.orig/include/linux/netdevice.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/netdevice.h 2015-11-29 09:23:09.609614185 +0100
-@@ -2469,6 +2469,7 @@
+diff -Nur linux-4.1.20.orig/include/linux/netdevice.h linux-4.1.20/include/linux/netdevice.h
+--- linux-4.1.20.orig/include/linux/netdevice.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/netdevice.h 2016-03-21 20:18:33.000000000 +0100
+@@ -2192,11 +2192,20 @@
+ void synchronize_net(void);
+ int init_dummy_netdev(struct net_device *dev);
+
++#ifdef CONFIG_PREEMPT_RT_FULL
++static inline int dev_recursion_level(void)
++{
++ return current->xmit_recursion;
++}
++
++#else
++
+ DECLARE_PER_CPU(int, xmit_recursion);
+ static inline int dev_recursion_level(void)
+ {
+ return this_cpu_read(xmit_recursion);
+ }
++#endif
+
+ struct net_device *dev_get_by_index(struct net *net, int ifindex);
+ struct net_device *__dev_get_by_index(struct net *net, int ifindex);
+@@ -2469,6 +2478,7 @@
unsigned int dropped;
struct sk_buff_head input_pkt_queue;
struct napi_struct backlog;
@@ -10602,9 +11355,9 @@ diff -Nur linux-4.1.13.orig/include/linux/netdevice.h linux-4.1.13/include/linux
};
-diff -Nur linux-4.1.13.orig/include/linux/netfilter/x_tables.h linux-4.1.13/include/linux/netfilter/x_tables.h
---- linux-4.1.13.orig/include/linux/netfilter/x_tables.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/netfilter/x_tables.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/netfilter/x_tables.h linux-4.1.20/include/linux/netfilter/x_tables.h
+--- linux-4.1.20.orig/include/linux/netfilter/x_tables.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/netfilter/x_tables.h 2016-03-21 20:18:33.000000000 +0100
@@ -3,6 +3,7 @@
@@ -10640,9 +11393,9 @@ diff -Nur linux-4.1.13.orig/include/linux/netfilter/x_tables.h linux-4.1.13/incl
}
/*
-diff -Nur linux-4.1.13.orig/include/linux/notifier.h linux-4.1.13/include/linux/notifier.h
---- linux-4.1.13.orig/include/linux/notifier.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/notifier.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/notifier.h linux-4.1.20/include/linux/notifier.h
+--- linux-4.1.20.orig/include/linux/notifier.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/notifier.h 2016-03-21 20:18:33.000000000 +0100
@@ -6,7 +6,7 @@
*
* Alan Cox <Alan.Cox@linux.org>
@@ -10722,9 +11475,9 @@ diff -Nur linux-4.1.13.orig/include/linux/notifier.h linux-4.1.13/include/linux/
/* CPU notfiers are defined in include/linux/cpu.h. */
/* netdevice notifiers are defined in include/linux/netdevice.h */
-diff -Nur linux-4.1.13.orig/include/linux/percpu.h linux-4.1.13/include/linux/percpu.h
---- linux-4.1.13.orig/include/linux/percpu.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/percpu.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/percpu.h linux-4.1.20/include/linux/percpu.h
+--- linux-4.1.20.orig/include/linux/percpu.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/percpu.h 2016-03-21 20:18:33.000000000 +0100
@@ -24,6 +24,35 @@
PERCPU_MODULE_RESERVE)
#endif
@@ -10761,9 +11514,9 @@ diff -Nur linux-4.1.13.orig/include/linux/percpu.h linux-4.1.13/include/linux/pe
/* minimum unit size, also is the maximum supported allocation size */
#define PCPU_MIN_UNIT_SIZE PFN_ALIGN(32 << 10)
-diff -Nur linux-4.1.13.orig/include/linux/pid.h linux-4.1.13/include/linux/pid.h
---- linux-4.1.13.orig/include/linux/pid.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/pid.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/pid.h linux-4.1.20/include/linux/pid.h
+--- linux-4.1.20.orig/include/linux/pid.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/pid.h 2016-03-21 20:18:33.000000000 +0100
@@ -2,6 +2,7 @@
#define _LINUX_PID_H
@@ -10772,9 +11525,40 @@ diff -Nur linux-4.1.13.orig/include/linux/pid.h linux-4.1.13/include/linux/pid.h
enum pid_type
{
-diff -Nur linux-4.1.13.orig/include/linux/preempt.h linux-4.1.13/include/linux/preempt.h
---- linux-4.1.13.orig/include/linux/preempt.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/preempt.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/platform_data/gpio-omap.h linux-4.1.20/include/linux/platform_data/gpio-omap.h
+--- linux-4.1.20.orig/include/linux/platform_data/gpio-omap.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/platform_data/gpio-omap.h 2016-03-21 20:18:33.000000000 +0100
+@@ -198,7 +198,6 @@
+ int bank_width; /* GPIO bank width */
+ int bank_stride; /* Only needed for omap1 MPUIO */
+ bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
+- bool loses_context; /* whether the bank would ever lose context */
+ bool is_mpuio; /* whether the bank is of type MPUIO */
+ u32 non_wakeup_gpios;
+
+@@ -208,9 +207,17 @@
+ int (*get_context_loss_count)(struct device *dev);
+ };
+
++#if IS_BUILTIN(CONFIG_GPIO_OMAP)
+ extern void omap2_gpio_prepare_for_idle(int off_mode);
+ extern void omap2_gpio_resume_after_idle(void);
+-extern void omap_set_gpio_debounce(int gpio, int enable);
+-extern void omap_set_gpio_debounce_time(int gpio, int enable);
++#else
++static inline void omap2_gpio_prepare_for_idle(int off_mode)
++{
++}
++
++static inline void omap2_gpio_resume_after_idle(void)
++{
++}
++#endif
+
+ #endif
+diff -Nur linux-4.1.20.orig/include/linux/preempt.h linux-4.1.20/include/linux/preempt.h
+--- linux-4.1.20.orig/include/linux/preempt.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/preempt.h 2016-03-21 20:18:33.000000000 +0100
@@ -34,6 +34,20 @@
#define preempt_count_inc() preempt_count_add(1)
#define preempt_count_dec() preempt_count_sub(1)
@@ -10878,9 +11662,9 @@ diff -Nur linux-4.1.13.orig/include/linux/preempt.h linux-4.1.13/include/linux/p
#ifdef CONFIG_PREEMPT_NOTIFIERS
struct preempt_notifier;
-diff -Nur linux-4.1.13.orig/include/linux/preempt_mask.h linux-4.1.13/include/linux/preempt_mask.h
---- linux-4.1.13.orig/include/linux/preempt_mask.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/preempt_mask.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/preempt_mask.h linux-4.1.20/include/linux/preempt_mask.h
+--- linux-4.1.20.orig/include/linux/preempt_mask.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/preempt_mask.h 2016-03-21 20:18:33.000000000 +0100
@@ -44,16 +44,26 @@
#define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT)
#define NMI_OFFSET (1UL << NMI_SHIFT)
@@ -10930,9 +11714,9 @@ diff -Nur linux-4.1.13.orig/include/linux/preempt_mask.h linux-4.1.13/include/li
/*
* The preempt_count offset needed for things like:
-diff -Nur linux-4.1.13.orig/include/linux/printk.h linux-4.1.13/include/linux/printk.h
---- linux-4.1.13.orig/include/linux/printk.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/printk.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/printk.h linux-4.1.20/include/linux/printk.h
+--- linux-4.1.20.orig/include/linux/printk.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/printk.h 2016-03-21 20:18:33.000000000 +0100
@@ -115,9 +115,11 @@
#ifdef CONFIG_EARLY_PRINTK
extern asmlinkage __printf(1, 2)
@@ -10945,9 +11729,9 @@ diff -Nur linux-4.1.13.orig/include/linux/printk.h linux-4.1.13/include/linux/pr
#endif
typedef int(*printk_func_t)(const char *fmt, va_list args);
-diff -Nur linux-4.1.13.orig/include/linux/radix-tree.h linux-4.1.13/include/linux/radix-tree.h
---- linux-4.1.13.orig/include/linux/radix-tree.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/radix-tree.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/radix-tree.h linux-4.1.20/include/linux/radix-tree.h
+--- linux-4.1.20.orig/include/linux/radix-tree.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/radix-tree.h 2016-03-21 20:18:33.000000000 +0100
@@ -277,8 +277,13 @@
unsigned int radix_tree_gang_lookup_slot(struct radix_tree_root *root,
void ***results, unsigned long *indices,
@@ -10971,9 +11755,9 @@ diff -Nur linux-4.1.13.orig/include/linux/radix-tree.h linux-4.1.13/include/linu
}
/**
-diff -Nur linux-4.1.13.orig/include/linux/random.h linux-4.1.13/include/linux/random.h
---- linux-4.1.13.orig/include/linux/random.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/random.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/random.h linux-4.1.20/include/linux/random.h
+--- linux-4.1.20.orig/include/linux/random.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/random.h 2016-03-21 20:18:33.000000000 +0100
@@ -11,7 +11,7 @@
extern void add_device_randomness(const void *, unsigned int);
extern void add_input_randomness(unsigned int type, unsigned int code,
@@ -10983,9 +11767,9 @@ diff -Nur linux-4.1.13.orig/include/linux/random.h linux-4.1.13/include/linux/ra
extern void get_random_bytes(void *buf, int nbytes);
extern void get_random_bytes_arch(void *buf, int nbytes);
-diff -Nur linux-4.1.13.orig/include/linux/rcupdate.h linux-4.1.13/include/linux/rcupdate.h
---- linux-4.1.13.orig/include/linux/rcupdate.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/rcupdate.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/rcupdate.h linux-4.1.20/include/linux/rcupdate.h
+--- linux-4.1.20.orig/include/linux/rcupdate.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/rcupdate.h 2016-03-21 20:18:33.000000000 +0100
@@ -167,6 +167,9 @@
#endif /* #else #ifdef CONFIG_PREEMPT_RCU */
@@ -11070,9 +11854,9 @@ diff -Nur linux-4.1.13.orig/include/linux/rcupdate.h linux-4.1.13/include/linux/
local_bh_enable();
}
-diff -Nur linux-4.1.13.orig/include/linux/rcutree.h linux-4.1.13/include/linux/rcutree.h
---- linux-4.1.13.orig/include/linux/rcutree.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/rcutree.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/rcutree.h linux-4.1.20/include/linux/rcutree.h
+--- linux-4.1.20.orig/include/linux/rcutree.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/rcutree.h 2016-03-21 20:18:33.000000000 +0100
@@ -46,7 +46,11 @@
rcu_note_context_switch();
}
@@ -11125,9 +11909,9 @@ diff -Nur linux-4.1.13.orig/include/linux/rcutree.h linux-4.1.13/include/linux/r
void rcu_all_qs(void);
#endif /* __LINUX_RCUTREE_H */
-diff -Nur linux-4.1.13.orig/include/linux/rtmutex.h linux-4.1.13/include/linux/rtmutex.h
---- linux-4.1.13.orig/include/linux/rtmutex.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/rtmutex.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/rtmutex.h linux-4.1.20/include/linux/rtmutex.h
+--- linux-4.1.20.orig/include/linux/rtmutex.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/rtmutex.h 2016-03-21 20:18:33.000000000 +0100
@@ -14,10 +14,14 @@
#include <linux/linkage.h>
@@ -11201,9 +11985,9 @@ diff -Nur linux-4.1.13.orig/include/linux/rtmutex.h linux-4.1.13/include/linux/r
extern int rt_mutex_timed_lock(struct rt_mutex *lock,
struct hrtimer_sleeper *timeout);
-diff -Nur linux-4.1.13.orig/include/linux/rwlock_rt.h linux-4.1.13/include/linux/rwlock_rt.h
---- linux-4.1.13.orig/include/linux/rwlock_rt.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/include/linux/rwlock_rt.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/rwlock_rt.h linux-4.1.20/include/linux/rwlock_rt.h
+--- linux-4.1.20.orig/include/linux/rwlock_rt.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/include/linux/rwlock_rt.h 2016-03-21 20:18:33.000000000 +0100
@@ -0,0 +1,99 @@
+#ifndef __LINUX_RWLOCK_RT_H
+#define __LINUX_RWLOCK_RT_H
@@ -11304,9 +12088,9 @@ diff -Nur linux-4.1.13.orig/include/linux/rwlock_rt.h linux-4.1.13/include/linux
+ } while (0)
+
+#endif
-diff -Nur linux-4.1.13.orig/include/linux/rwlock_types.h linux-4.1.13/include/linux/rwlock_types.h
---- linux-4.1.13.orig/include/linux/rwlock_types.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/rwlock_types.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/rwlock_types.h linux-4.1.20/include/linux/rwlock_types.h
+--- linux-4.1.20.orig/include/linux/rwlock_types.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/rwlock_types.h 2016-03-21 20:18:33.000000000 +0100
@@ -1,6 +1,10 @@
#ifndef __LINUX_RWLOCK_TYPES_H
#define __LINUX_RWLOCK_TYPES_H
@@ -11327,9 +12111,9 @@ diff -Nur linux-4.1.13.orig/include/linux/rwlock_types.h linux-4.1.13/include/li
+ rwlock_t name __cacheline_aligned_in_smp = __RW_LOCK_UNLOCKED(name)
#endif /* __LINUX_RWLOCK_TYPES_H */
-diff -Nur linux-4.1.13.orig/include/linux/rwlock_types_rt.h linux-4.1.13/include/linux/rwlock_types_rt.h
---- linux-4.1.13.orig/include/linux/rwlock_types_rt.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/include/linux/rwlock_types_rt.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/rwlock_types_rt.h linux-4.1.20/include/linux/rwlock_types_rt.h
+--- linux-4.1.20.orig/include/linux/rwlock_types_rt.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/include/linux/rwlock_types_rt.h 2016-03-21 20:18:33.000000000 +0100
@@ -0,0 +1,33 @@
+#ifndef __LINUX_RWLOCK_TYPES_RT_H
+#define __LINUX_RWLOCK_TYPES_RT_H
@@ -11364,9 +12148,9 @@ diff -Nur linux-4.1.13.orig/include/linux/rwlock_types_rt.h linux-4.1.13/include
+ rwlock_t name __cacheline_aligned_in_smp = __RW_LOCK_UNLOCKED(name)
+
+#endif
-diff -Nur linux-4.1.13.orig/include/linux/rwsem.h linux-4.1.13/include/linux/rwsem.h
---- linux-4.1.13.orig/include/linux/rwsem.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/rwsem.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/rwsem.h linux-4.1.20/include/linux/rwsem.h
+--- linux-4.1.20.orig/include/linux/rwsem.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/rwsem.h 2016-03-21 20:18:33.000000000 +0100
@@ -18,6 +18,10 @@
#include <linux/osq_lock.h>
#endif
@@ -11385,9 +12169,9 @@ diff -Nur linux-4.1.13.orig/include/linux/rwsem.h linux-4.1.13/include/linux/rws
+#endif /* !PREEMPT_RT_FULL */
+
#endif /* _LINUX_RWSEM_H */
-diff -Nur linux-4.1.13.orig/include/linux/rwsem_rt.h linux-4.1.13/include/linux/rwsem_rt.h
---- linux-4.1.13.orig/include/linux/rwsem_rt.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/include/linux/rwsem_rt.h 2015-11-29 09:23:09.609614185 +0100
+diff -Nur linux-4.1.20.orig/include/linux/rwsem_rt.h linux-4.1.20/include/linux/rwsem_rt.h
+--- linux-4.1.20.orig/include/linux/rwsem_rt.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/include/linux/rwsem_rt.h 2016-03-21 20:18:33.000000000 +0100
@@ -0,0 +1,140 @@
+#ifndef _LINUX_RWSEM_RT_H
+#define _LINUX_RWSEM_RT_H
@@ -11529,9 +12313,9 @@ diff -Nur linux-4.1.13.orig/include/linux/rwsem_rt.h linux-4.1.13/include/linux/
+}
+#endif
+#endif
-diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sched.h
---- linux-4.1.13.orig/include/linux/sched.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/sched.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/sched.h linux-4.1.20/include/linux/sched.h
+--- linux-4.1.20.orig/include/linux/sched.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/sched.h 2016-03-21 20:18:33.000000000 +0100
@@ -26,6 +26,7 @@
#include <linux/nodemask.h>
#include <linux/mm_types.h>
@@ -11540,7 +12324,16 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
#include <asm/page.h>
#include <asm/ptrace.h>
-@@ -234,10 +235,7 @@
+@@ -175,8 +176,6 @@
+ extern void calc_global_load(unsigned long ticks);
+ extern void update_cpu_load_nohz(void);
+
+-extern unsigned long get_parent_ip(unsigned long addr);
+-
+ extern void dump_cpu_task(int cpu);
+
+ struct seq_file;
+@@ -234,10 +233,7 @@
TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \
__TASK_TRACED | EXIT_ZOMBIE | EXIT_DEAD)
@@ -11551,7 +12344,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
#define task_contributes_to_load(task) \
((task->state & TASK_UNINTERRUPTIBLE) != 0 && \
(task->flags & PF_FROZEN) == 0)
-@@ -302,6 +300,11 @@
+@@ -302,6 +298,11 @@
#endif
@@ -11563,7 +12356,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
/* Task command name length */
#define TASK_COMM_LEN 16
-@@ -900,6 +903,50 @@
+@@ -901,6 +902,50 @@
#define SCHED_CAPACITY_SCALE (1L << SCHED_CAPACITY_SHIFT)
/*
@@ -11614,7 +12407,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
* sched-domains (multiprocessor balancing) declarations:
*/
#ifdef CONFIG_SMP
-@@ -1291,6 +1338,7 @@
+@@ -1292,6 +1337,7 @@
struct task_struct {
volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
@@ -11622,7 +12415,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
void *stack;
atomic_t usage;
unsigned int flags; /* per process flags, defined below */
-@@ -1327,6 +1375,12 @@
+@@ -1328,6 +1374,12 @@
#endif
unsigned int policy;
@@ -11635,7 +12428,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
int nr_cpus_allowed;
cpumask_t cpus_allowed;
-@@ -1434,7 +1488,8 @@
+@@ -1435,7 +1487,8 @@
struct cputime prev_cputime;
#endif
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
@@ -11645,7 +12438,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
unsigned long long vtime_snap;
enum {
VTIME_SLEEPING = 0,
-@@ -1450,6 +1505,9 @@
+@@ -1451,6 +1504,9 @@
struct task_cputime cputime_expires;
struct list_head cpu_timers[3];
@@ -11655,7 +12448,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
/* process credentials */
const struct cred __rcu *real_cred; /* objective and real subjective task
-@@ -1482,10 +1540,15 @@
+@@ -1483,10 +1539,15 @@
/* signal handlers */
struct signal_struct *signal;
struct sighand_struct *sighand;
@@ -11671,7 +12464,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
unsigned long sas_ss_sp;
size_t sas_ss_size;
-@@ -1511,6 +1574,8 @@
+@@ -1512,6 +1573,8 @@
/* Protection of the PI data structures: */
raw_spinlock_t pi_lock;
@@ -11680,7 +12473,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
#ifdef CONFIG_RT_MUTEXES
/* PI waiters blocked on a rt_mutex held by this task */
struct rb_root pi_waiters;
-@@ -1705,6 +1770,12 @@
+@@ -1706,6 +1769,12 @@
unsigned long trace;
/* bitmask and counter of trace recursion */
unsigned long trace_recursion;
@@ -11693,7 +12486,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
#endif /* CONFIG_TRACING */
#ifdef CONFIG_MEMCG
struct memcg_oom_info {
-@@ -1721,14 +1792,23 @@
+@@ -1722,14 +1791,26 @@
unsigned int sequential_io;
unsigned int sequential_io_avg;
#endif
@@ -11711,6 +12504,9 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
unsigned long task_state_change;
#endif
++#ifdef CONFIG_PREEMPT_RT_FULL
++ int xmit_recursion;
++#endif
+ int pagefault_disabled;
};
@@ -11720,7 +12516,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
#define TNF_MIGRATED 0x01
#define TNF_NO_GROUP 0x02
#define TNF_SHARED 0x04
-@@ -1917,6 +1997,15 @@
+@@ -1918,6 +1999,15 @@
extern void free_task(struct task_struct *tsk);
#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
@@ -11736,7 +12532,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
extern void __put_task_struct(struct task_struct *t);
static inline void put_task_struct(struct task_struct *t)
-@@ -1924,6 +2013,7 @@
+@@ -1925,6 +2015,7 @@
if (atomic_dec_and_test(&t->usage))
__put_task_struct(t);
}
@@ -11744,7 +12540,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
extern void task_cputime(struct task_struct *t,
-@@ -1962,6 +2052,7 @@
+@@ -1963,6 +2054,7 @@
/*
* Per process flags
*/
@@ -11752,7 +12548,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
#define PF_EXITING 0x00000004 /* getting shut down */
#define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */
#define PF_VCPU 0x00000010 /* I'm a virtual CPU */
-@@ -2126,6 +2217,10 @@
+@@ -2127,6 +2219,10 @@
extern int set_cpus_allowed_ptr(struct task_struct *p,
const struct cpumask *new_mask);
@@ -11763,7 +12559,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
#else
static inline void do_set_cpus_allowed(struct task_struct *p,
const struct cpumask *new_mask)
-@@ -2138,6 +2233,9 @@
+@@ -2139,6 +2235,9 @@
return -EINVAL;
return 0;
}
@@ -11773,7 +12569,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
#endif
#ifdef CONFIG_NO_HZ_COMMON
-@@ -2354,6 +2452,7 @@
+@@ -2355,6 +2454,7 @@
extern int wake_up_state(struct task_struct *tsk, unsigned int state);
extern int wake_up_process(struct task_struct *tsk);
@@ -11781,7 +12577,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
extern void wake_up_new_task(struct task_struct *tsk);
#ifdef CONFIG_SMP
extern void kick_process(struct task_struct *tsk);
-@@ -2470,12 +2569,24 @@
+@@ -2471,12 +2571,24 @@
/* mmdrop drops the mm and the page tables */
extern void __mmdrop(struct mm_struct *);
@@ -11806,7 +12602,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
/* mmput gets rid of the mappings and all user-space */
extern void mmput(struct mm_struct *);
/* Grab a reference to a task's mm, if it is not already going away */
-@@ -2787,6 +2898,43 @@
+@@ -2788,6 +2900,43 @@
return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED));
}
@@ -11850,7 +12646,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
static inline int restart_syscall(void)
{
set_tsk_thread_flag(current, TIF_SIGPENDING);
-@@ -2818,6 +2966,51 @@
+@@ -2819,6 +2968,51 @@
return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
}
@@ -11902,7 +12698,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
/*
* cond_resched() and cond_resched_lock(): latency reduction via
* explicit rescheduling in places that are safe. The return
-@@ -2839,12 +3032,16 @@
+@@ -2840,12 +3034,16 @@
__cond_resched_lock(lock); \
})
@@ -11919,7 +12715,7 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
static inline void cond_resched_rcu(void)
{
-@@ -3011,6 +3208,26 @@
+@@ -3012,6 +3210,26 @@
#endif /* CONFIG_SMP */
@@ -11946,9 +12742,9 @@ diff -Nur linux-4.1.13.orig/include/linux/sched.h linux-4.1.13/include/linux/sch
extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);
extern long sched_getaffinity(pid_t pid, struct cpumask *mask);
-diff -Nur linux-4.1.13.orig/include/linux/seqlock.h linux-4.1.13/include/linux/seqlock.h
---- linux-4.1.13.orig/include/linux/seqlock.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/seqlock.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/seqlock.h linux-4.1.20/include/linux/seqlock.h
+--- linux-4.1.20.orig/include/linux/seqlock.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/seqlock.h 2016-03-21 20:18:33.000000000 +0100
@@ -219,20 +219,30 @@
return __read_seqcount_retry(s, start);
}
@@ -12078,9 +12874,9 @@ diff -Nur linux-4.1.13.orig/include/linux/seqlock.h linux-4.1.13/include/linux/s
spin_unlock_irqrestore(&sl->lock, flags);
}
-diff -Nur linux-4.1.13.orig/include/linux/signal.h linux-4.1.13/include/linux/signal.h
---- linux-4.1.13.orig/include/linux/signal.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/signal.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/signal.h linux-4.1.20/include/linux/signal.h
+--- linux-4.1.20.orig/include/linux/signal.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/signal.h 2016-03-21 20:18:33.000000000 +0100
@@ -218,6 +218,7 @@
}
@@ -12089,9 +12885,9 @@ diff -Nur linux-4.1.13.orig/include/linux/signal.h linux-4.1.13/include/linux/si
/* Test if 'sig' is valid signal. Use this instead of testing _NSIG directly */
static inline int valid_signal(unsigned long sig)
-diff -Nur linux-4.1.13.orig/include/linux/skbuff.h linux-4.1.13/include/linux/skbuff.h
---- linux-4.1.13.orig/include/linux/skbuff.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/skbuff.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/skbuff.h linux-4.1.20/include/linux/skbuff.h
+--- linux-4.1.20.orig/include/linux/skbuff.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/skbuff.h 2016-03-21 20:18:33.000000000 +0100
@@ -187,6 +187,7 @@
__u32 qlen;
@@ -12100,7 +12896,7 @@ diff -Nur linux-4.1.13.orig/include/linux/skbuff.h linux-4.1.13/include/linux/sk
};
struct sk_buff;
-@@ -1336,6 +1337,12 @@
+@@ -1337,6 +1338,12 @@
__skb_queue_head_init(list);
}
@@ -12113,9 +12909,9 @@ diff -Nur linux-4.1.13.orig/include/linux/skbuff.h linux-4.1.13/include/linux/sk
static inline void skb_queue_head_init_class(struct sk_buff_head *list,
struct lock_class_key *class)
{
-diff -Nur linux-4.1.13.orig/include/linux/smp.h linux-4.1.13/include/linux/smp.h
---- linux-4.1.13.orig/include/linux/smp.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/smp.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/smp.h linux-4.1.20/include/linux/smp.h
+--- linux-4.1.20.orig/include/linux/smp.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/smp.h 2016-03-21 20:18:33.000000000 +0100
@@ -185,6 +185,9 @@
#define get_cpu() ({ preempt_disable(); smp_processor_id(); })
#define put_cpu() preempt_enable()
@@ -12126,22 +12922,9 @@ diff -Nur linux-4.1.13.orig/include/linux/smp.h linux-4.1.13/include/linux/smp.h
/*
* Callback to arch code if there's nosmp or maxcpus=0 on the
* boot command line:
-diff -Nur linux-4.1.13.orig/include/linux/spinlock_api_smp.h linux-4.1.13/include/linux/spinlock_api_smp.h
---- linux-4.1.13.orig/include/linux/spinlock_api_smp.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/spinlock_api_smp.h 2015-11-29 09:23:09.617613651 +0100
-@@ -189,6 +189,8 @@
- return 0;
- }
-
--#include <linux/rwlock_api_smp.h>
-+#ifndef CONFIG_PREEMPT_RT_FULL
-+# include <linux/rwlock_api_smp.h>
-+#endif
-
- #endif /* __LINUX_SPINLOCK_API_SMP_H */
-diff -Nur linux-4.1.13.orig/include/linux/spinlock.h linux-4.1.13/include/linux/spinlock.h
---- linux-4.1.13.orig/include/linux/spinlock.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/spinlock.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/spinlock.h linux-4.1.20/include/linux/spinlock.h
+--- linux-4.1.20.orig/include/linux/spinlock.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/spinlock.h 2016-03-21 20:18:33.000000000 +0100
@@ -281,7 +281,11 @@
#define raw_spin_can_lock(lock) (!raw_spin_is_locked(lock))
@@ -12173,9 +12956,22 @@ diff -Nur linux-4.1.13.orig/include/linux/spinlock.h linux-4.1.13/include/linux/
+#endif /* !PREEMPT_RT_FULL */
+
#endif /* __LINUX_SPINLOCK_H */
-diff -Nur linux-4.1.13.orig/include/linux/spinlock_rt.h linux-4.1.13/include/linux/spinlock_rt.h
---- linux-4.1.13.orig/include/linux/spinlock_rt.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/include/linux/spinlock_rt.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/spinlock_api_smp.h linux-4.1.20/include/linux/spinlock_api_smp.h
+--- linux-4.1.20.orig/include/linux/spinlock_api_smp.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/spinlock_api_smp.h 2016-03-21 20:18:33.000000000 +0100
+@@ -189,6 +189,8 @@
+ return 0;
+ }
+
+-#include <linux/rwlock_api_smp.h>
++#ifndef CONFIG_PREEMPT_RT_FULL
++# include <linux/rwlock_api_smp.h>
++#endif
+
+ #endif /* __LINUX_SPINLOCK_API_SMP_H */
+diff -Nur linux-4.1.20.orig/include/linux/spinlock_rt.h linux-4.1.20/include/linux/spinlock_rt.h
+--- linux-4.1.20.orig/include/linux/spinlock_rt.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/include/linux/spinlock_rt.h 2016-03-21 20:18:33.000000000 +0100
@@ -0,0 +1,174 @@
+#ifndef __LINUX_SPINLOCK_RT_H
+#define __LINUX_SPINLOCK_RT_H
@@ -12351,9 +13147,9 @@ diff -Nur linux-4.1.13.orig/include/linux/spinlock_rt.h linux-4.1.13/include/lin
+ atomic_dec_and_spin_lock(atomic, lock)
+
+#endif
-diff -Nur linux-4.1.13.orig/include/linux/spinlock_types.h linux-4.1.13/include/linux/spinlock_types.h
---- linux-4.1.13.orig/include/linux/spinlock_types.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/spinlock_types.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/spinlock_types.h linux-4.1.20/include/linux/spinlock_types.h
+--- linux-4.1.20.orig/include/linux/spinlock_types.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/spinlock_types.h 2016-03-21 20:18:33.000000000 +0100
@@ -9,80 +9,15 @@
* Released under the General Public License (GPL).
*/
@@ -12442,9 +13238,9 @@ diff -Nur linux-4.1.13.orig/include/linux/spinlock_types.h linux-4.1.13/include/
-#include <linux/rwlock_types.h>
-
#endif /* __LINUX_SPINLOCK_TYPES_H */
-diff -Nur linux-4.1.13.orig/include/linux/spinlock_types_nort.h linux-4.1.13/include/linux/spinlock_types_nort.h
---- linux-4.1.13.orig/include/linux/spinlock_types_nort.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/include/linux/spinlock_types_nort.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/spinlock_types_nort.h linux-4.1.20/include/linux/spinlock_types_nort.h
+--- linux-4.1.20.orig/include/linux/spinlock_types_nort.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/include/linux/spinlock_types_nort.h 2016-03-21 20:18:33.000000000 +0100
@@ -0,0 +1,33 @@
+#ifndef __LINUX_SPINLOCK_TYPES_NORT_H
+#define __LINUX_SPINLOCK_TYPES_NORT_H
@@ -12479,9 +13275,9 @@ diff -Nur linux-4.1.13.orig/include/linux/spinlock_types_nort.h linux-4.1.13/inc
+#define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x)
+
+#endif
-diff -Nur linux-4.1.13.orig/include/linux/spinlock_types_raw.h linux-4.1.13/include/linux/spinlock_types_raw.h
---- linux-4.1.13.orig/include/linux/spinlock_types_raw.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/include/linux/spinlock_types_raw.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/spinlock_types_raw.h linux-4.1.20/include/linux/spinlock_types_raw.h
+--- linux-4.1.20.orig/include/linux/spinlock_types_raw.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/include/linux/spinlock_types_raw.h 2016-03-21 20:18:33.000000000 +0100
@@ -0,0 +1,56 @@
+#ifndef __LINUX_SPINLOCK_TYPES_RAW_H
+#define __LINUX_SPINLOCK_TYPES_RAW_H
@@ -12539,9 +13335,9 @@ diff -Nur linux-4.1.13.orig/include/linux/spinlock_types_raw.h linux-4.1.13/incl
+#define DEFINE_RAW_SPINLOCK(x) raw_spinlock_t x = __RAW_SPIN_LOCK_UNLOCKED(x)
+
+#endif
-diff -Nur linux-4.1.13.orig/include/linux/spinlock_types_rt.h linux-4.1.13/include/linux/spinlock_types_rt.h
---- linux-4.1.13.orig/include/linux/spinlock_types_rt.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/include/linux/spinlock_types_rt.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/spinlock_types_rt.h linux-4.1.20/include/linux/spinlock_types_rt.h
+--- linux-4.1.20.orig/include/linux/spinlock_types_rt.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/include/linux/spinlock_types_rt.h 2016-03-21 20:18:33.000000000 +0100
@@ -0,0 +1,51 @@
+#ifndef __LINUX_SPINLOCK_TYPES_RT_H
+#define __LINUX_SPINLOCK_TYPES_RT_H
@@ -12594,9 +13390,9 @@ diff -Nur linux-4.1.13.orig/include/linux/spinlock_types_rt.h linux-4.1.13/inclu
+ spinlock_t name __cacheline_aligned_in_smp = __SPIN_LOCK_UNLOCKED(name)
+
+#endif
-diff -Nur linux-4.1.13.orig/include/linux/srcu.h linux-4.1.13/include/linux/srcu.h
---- linux-4.1.13.orig/include/linux/srcu.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/srcu.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/srcu.h linux-4.1.20/include/linux/srcu.h
+--- linux-4.1.20.orig/include/linux/srcu.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/srcu.h 2016-03-21 20:18:33.000000000 +0100
@@ -84,10 +84,10 @@
void process_srcu(struct work_struct *work);
@@ -12619,9 +13415,9 @@ diff -Nur linux-4.1.13.orig/include/linux/srcu.h linux-4.1.13/include/linux/srcu
#define DEFINE_SRCU(name) __DEFINE_SRCU(name, /* not static */)
#define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static)
-diff -Nur linux-4.1.13.orig/include/linux/swap.h linux-4.1.13/include/linux/swap.h
---- linux-4.1.13.orig/include/linux/swap.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/swap.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/swap.h linux-4.1.20/include/linux/swap.h
+--- linux-4.1.20.orig/include/linux/swap.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/swap.h 2016-03-21 20:18:33.000000000 +0100
@@ -11,6 +11,7 @@
#include <linux/fs.h>
#include <linux/atomic.h>
@@ -12648,9 +13444,9 @@ diff -Nur linux-4.1.13.orig/include/linux/swap.h linux-4.1.13/include/linux/swap
extern void lru_cache_add(struct page *);
extern void lru_cache_add_anon(struct page *page);
extern void lru_cache_add_file(struct page *page);
-diff -Nur linux-4.1.13.orig/include/linux/thread_info.h linux-4.1.13/include/linux/thread_info.h
---- linux-4.1.13.orig/include/linux/thread_info.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/thread_info.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/thread_info.h linux-4.1.20/include/linux/thread_info.h
+--- linux-4.1.20.orig/include/linux/thread_info.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/thread_info.h 2016-03-21 20:18:33.000000000 +0100
@@ -102,7 +102,17 @@
#define test_thread_flag(flag) \
test_ti_thread_flag(current_thread_info(), flag)
@@ -12670,9 +13466,9 @@ diff -Nur linux-4.1.13.orig/include/linux/thread_info.h linux-4.1.13/include/lin
#if defined TIF_RESTORE_SIGMASK && !defined HAVE_SET_RESTORE_SIGMASK
/*
-diff -Nur linux-4.1.13.orig/include/linux/timer.h linux-4.1.13/include/linux/timer.h
---- linux-4.1.13.orig/include/linux/timer.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/timer.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/timer.h linux-4.1.20/include/linux/timer.h
+--- linux-4.1.20.orig/include/linux/timer.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/timer.h 2016-03-21 20:18:33.000000000 +0100
@@ -241,7 +241,7 @@
extern int try_to_del_timer_sync(struct timer_list *timer);
@@ -12682,9 +13478,9 @@ diff -Nur linux-4.1.13.orig/include/linux/timer.h linux-4.1.13/include/linux/tim
extern int del_timer_sync(struct timer_list *timer);
#else
# define del_timer_sync(t) del_timer(t)
-diff -Nur linux-4.1.13.orig/include/linux/uaccess.h linux-4.1.13/include/linux/uaccess.h
---- linux-4.1.13.orig/include/linux/uaccess.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/uaccess.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/uaccess.h linux-4.1.20/include/linux/uaccess.h
+--- linux-4.1.20.orig/include/linux/uaccess.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/uaccess.h 2016-03-21 20:18:33.000000000 +0100
@@ -1,21 +1,31 @@
#ifndef __LINUX_UACCESS_H__
#define __LINUX_UACCESS_H__
@@ -12763,9 +13559,9 @@ diff -Nur linux-4.1.13.orig/include/linux/uaccess.h linux-4.1.13/include/linux/u
#ifndef ARCH_HAS_NOCACHE_UACCESS
static inline unsigned long __copy_from_user_inatomic_nocache(void *to,
-diff -Nur linux-4.1.13.orig/include/linux/uprobes.h linux-4.1.13/include/linux/uprobes.h
---- linux-4.1.13.orig/include/linux/uprobes.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/uprobes.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/uprobes.h linux-4.1.20/include/linux/uprobes.h
+--- linux-4.1.20.orig/include/linux/uprobes.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/uprobes.h 2016-03-21 20:18:33.000000000 +0100
@@ -27,6 +27,7 @@
#include <linux/errno.h>
#include <linux/rbtree.h>
@@ -12774,9 +13570,9 @@ diff -Nur linux-4.1.13.orig/include/linux/uprobes.h linux-4.1.13/include/linux/u
struct vm_area_struct;
struct mm_struct;
-diff -Nur linux-4.1.13.orig/include/linux/vmstat.h linux-4.1.13/include/linux/vmstat.h
---- linux-4.1.13.orig/include/linux/vmstat.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/vmstat.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/vmstat.h linux-4.1.20/include/linux/vmstat.h
+--- linux-4.1.20.orig/include/linux/vmstat.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/vmstat.h 2016-03-21 20:18:33.000000000 +0100
@@ -33,7 +33,9 @@
*/
static inline void __count_vm_event(enum vm_event_item item)
@@ -12797,20 +13593,9 @@ diff -Nur linux-4.1.13.orig/include/linux/vmstat.h linux-4.1.13/include/linux/vm
}
static inline void count_vm_events(enum vm_event_item item, long delta)
-diff -Nur linux-4.1.13.orig/include/linux/wait.h linux-4.1.13/include/linux/wait.h
---- linux-4.1.13.orig/include/linux/wait.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/linux/wait.h 2015-11-29 09:23:09.621613384 +0100
-@@ -8,6 +8,7 @@
- #include <linux/spinlock.h>
- #include <asm/current.h>
- #include <uapi/linux/wait.h>
-+#include <linux/atomic.h>
-
- typedef struct __wait_queue wait_queue_t;
- typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key);
-diff -Nur linux-4.1.13.orig/include/linux/wait-simple.h linux-4.1.13/include/linux/wait-simple.h
---- linux-4.1.13.orig/include/linux/wait-simple.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/include/linux/wait-simple.h 2015-11-29 09:23:09.617613651 +0100
+diff -Nur linux-4.1.20.orig/include/linux/wait-simple.h linux-4.1.20/include/linux/wait-simple.h
+--- linux-4.1.20.orig/include/linux/wait-simple.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/include/linux/wait-simple.h 2016-03-21 20:18:33.000000000 +0100
@@ -0,0 +1,207 @@
+#ifndef _LINUX_WAIT_SIMPLE_H
+#define _LINUX_WAIT_SIMPLE_H
@@ -13019,9 +13804,20 @@ diff -Nur linux-4.1.13.orig/include/linux/wait-simple.h linux-4.1.13/include/lin
+})
+
+#endif
-diff -Nur linux-4.1.13.orig/include/linux/work-simple.h linux-4.1.13/include/linux/work-simple.h
---- linux-4.1.13.orig/include/linux/work-simple.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/include/linux/work-simple.h 2015-11-29 09:23:09.621613384 +0100
+diff -Nur linux-4.1.20.orig/include/linux/wait.h linux-4.1.20/include/linux/wait.h
+--- linux-4.1.20.orig/include/linux/wait.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/linux/wait.h 2016-03-21 20:18:33.000000000 +0100
+@@ -8,6 +8,7 @@
+ #include <linux/spinlock.h>
+ #include <asm/current.h>
+ #include <uapi/linux/wait.h>
++#include <linux/atomic.h>
+
+ typedef struct __wait_queue wait_queue_t;
+ typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key);
+diff -Nur linux-4.1.20.orig/include/linux/work-simple.h linux-4.1.20/include/linux/work-simple.h
+--- linux-4.1.20.orig/include/linux/work-simple.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/include/linux/work-simple.h 2016-03-21 20:18:33.000000000 +0100
@@ -0,0 +1,24 @@
+#ifndef _LINUX_SWORK_H
+#define _LINUX_SWORK_H
@@ -13047,10 +13843,10 @@ diff -Nur linux-4.1.13.orig/include/linux/work-simple.h linux-4.1.13/include/lin
+void swork_put(void);
+
+#endif /* _LINUX_SWORK_H */
-diff -Nur linux-4.1.13.orig/include/net/dst.h linux-4.1.13/include/net/dst.h
---- linux-4.1.13.orig/include/net/dst.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/net/dst.h 2015-11-29 09:23:09.629612854 +0100
-@@ -403,7 +403,7 @@
+diff -Nur linux-4.1.20.orig/include/net/dst.h linux-4.1.20/include/net/dst.h
+--- linux-4.1.20.orig/include/net/dst.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/net/dst.h 2016-03-21 20:18:33.000000000 +0100
+@@ -436,7 +436,7 @@
static inline int dst_neigh_output(struct dst_entry *dst, struct neighbour *n,
struct sk_buff *skb)
{
@@ -13059,9 +13855,9 @@ diff -Nur linux-4.1.13.orig/include/net/dst.h linux-4.1.13/include/net/dst.h
if (dst->pending_confirm) {
unsigned long now = jiffies;
-diff -Nur linux-4.1.13.orig/include/net/neighbour.h linux-4.1.13/include/net/neighbour.h
---- linux-4.1.13.orig/include/net/neighbour.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/net/neighbour.h 2015-11-29 09:23:09.629612854 +0100
+diff -Nur linux-4.1.20.orig/include/net/neighbour.h linux-4.1.20/include/net/neighbour.h
+--- linux-4.1.20.orig/include/net/neighbour.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/net/neighbour.h 2016-03-21 20:18:33.000000000 +0100
@@ -445,7 +445,7 @@
}
#endif
@@ -13080,9 +13876,9 @@ diff -Nur linux-4.1.13.orig/include/net/neighbour.h linux-4.1.13/include/net/nei
const struct net_device *dev)
{
unsigned int seq;
-diff -Nur linux-4.1.13.orig/include/net/netns/ipv4.h linux-4.1.13/include/net/netns/ipv4.h
---- linux-4.1.13.orig/include/net/netns/ipv4.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/net/netns/ipv4.h 2015-11-29 09:23:09.629612854 +0100
+diff -Nur linux-4.1.20.orig/include/net/netns/ipv4.h linux-4.1.20/include/net/netns/ipv4.h
+--- linux-4.1.20.orig/include/net/netns/ipv4.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/net/netns/ipv4.h 2016-03-21 20:18:33.000000000 +0100
@@ -69,6 +69,7 @@
int sysctl_icmp_echo_ignore_all;
@@ -13091,9 +13887,9 @@ diff -Nur linux-4.1.13.orig/include/net/netns/ipv4.h linux-4.1.13/include/net/ne
int sysctl_icmp_ignore_bogus_error_responses;
int sysctl_icmp_ratelimit;
int sysctl_icmp_ratemask;
-diff -Nur linux-4.1.13.orig/include/trace/events/hist.h linux-4.1.13/include/trace/events/hist.h
---- linux-4.1.13.orig/include/trace/events/hist.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/include/trace/events/hist.h 2015-11-29 09:23:09.629612854 +0100
+diff -Nur linux-4.1.20.orig/include/trace/events/hist.h linux-4.1.20/include/trace/events/hist.h
+--- linux-4.1.20.orig/include/trace/events/hist.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/include/trace/events/hist.h 2016-03-21 20:18:33.000000000 +0100
@@ -0,0 +1,74 @@
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM hist
@@ -13169,9 +13965,9 @@ diff -Nur linux-4.1.13.orig/include/trace/events/hist.h linux-4.1.13/include/tra
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
-diff -Nur linux-4.1.13.orig/include/trace/events/latency_hist.h linux-4.1.13/include/trace/events/latency_hist.h
---- linux-4.1.13.orig/include/trace/events/latency_hist.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/include/trace/events/latency_hist.h 2015-11-29 09:23:09.629612854 +0100
+diff -Nur linux-4.1.20.orig/include/trace/events/latency_hist.h linux-4.1.20/include/trace/events/latency_hist.h
+--- linux-4.1.20.orig/include/trace/events/latency_hist.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/include/trace/events/latency_hist.h 2016-03-21 20:18:33.000000000 +0100
@@ -0,0 +1,29 @@
+#ifndef _LATENCY_HIST_H
+#define _LATENCY_HIST_H
@@ -13202,9 +13998,9 @@ diff -Nur linux-4.1.13.orig/include/trace/events/latency_hist.h linux-4.1.13/inc
+}
+
+#endif /* _LATENCY_HIST_H */
-diff -Nur linux-4.1.13.orig/include/trace/events/sched.h linux-4.1.13/include/trace/events/sched.h
---- linux-4.1.13.orig/include/trace/events/sched.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/include/trace/events/sched.h 2015-11-29 09:23:09.629612854 +0100
+diff -Nur linux-4.1.20.orig/include/trace/events/sched.h linux-4.1.20/include/trace/events/sched.h
+--- linux-4.1.20.orig/include/trace/events/sched.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/include/trace/events/sched.h 2016-03-21 20:18:33.000000000 +0100
@@ -55,9 +55,9 @@
*/
DECLARE_EVENT_CLASS(sched_wakeup_template,
@@ -13262,9 +14058,9 @@ diff -Nur linux-4.1.13.orig/include/trace/events/sched.h linux-4.1.13/include/tr
#ifdef CREATE_TRACE_POINTS
static inline long __trace_sched_switch_state(struct task_struct *p)
-diff -Nur linux-4.1.13.orig/init/Kconfig linux-4.1.13/init/Kconfig
---- linux-4.1.13.orig/init/Kconfig 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/init/Kconfig 2015-11-29 09:23:09.629612854 +0100
+diff -Nur linux-4.1.20.orig/init/Kconfig linux-4.1.20/init/Kconfig
+--- linux-4.1.20.orig/init/Kconfig 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/init/Kconfig 2016-03-21 20:18:33.000000000 +0100
@@ -637,7 +637,7 @@
config RCU_FAST_NO_HZ
@@ -13316,9 +14112,18 @@ diff -Nur linux-4.1.13.orig/init/Kconfig linux-4.1.13/init/Kconfig
bool "SLUB per cpu partial cache"
help
Per cpu partial caches accellerate objects allocation and freeing
-diff -Nur linux-4.1.13.orig/init/main.c linux-4.1.13/init/main.c
---- linux-4.1.13.orig/init/main.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/init/main.c 2015-11-29 09:23:09.629612854 +0100
+diff -Nur linux-4.1.20.orig/init/Makefile linux-4.1.20/init/Makefile
+--- linux-4.1.20.orig/init/Makefile 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/init/Makefile 2016-03-21 20:18:33.000000000 +0100
+@@ -33,4 +33,4 @@
+ include/generated/compile.h: FORCE
+ @$($(quiet)chk_compile.h)
+ $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
+- "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)"
++ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CONFIG_PREEMPT_RT_FULL)" "$(CC) $(KBUILD_CFLAGS)"
+diff -Nur linux-4.1.20.orig/init/main.c linux-4.1.20/init/main.c
+--- linux-4.1.20.orig/init/main.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/init/main.c 2016-03-21 20:18:33.000000000 +0100
@@ -525,6 +525,7 @@
setup_command_line(command_line);
setup_nr_cpu_ids();
@@ -13327,18 +14132,9 @@ diff -Nur linux-4.1.13.orig/init/main.c linux-4.1.13/init/main.c
smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
build_all_zonelists(NULL, NULL);
-diff -Nur linux-4.1.13.orig/init/Makefile linux-4.1.13/init/Makefile
---- linux-4.1.13.orig/init/Makefile 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/init/Makefile 2015-11-29 09:23:09.629612854 +0100
-@@ -33,4 +33,4 @@
- include/generated/compile.h: FORCE
- @$($(quiet)chk_compile.h)
- $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
-- "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)"
-+ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CONFIG_PREEMPT_RT_FULL)" "$(CC) $(KBUILD_CFLAGS)"
-diff -Nur linux-4.1.13.orig/ipc/mqueue.c linux-4.1.13/ipc/mqueue.c
---- linux-4.1.13.orig/ipc/mqueue.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/ipc/mqueue.c 2015-11-29 09:23:09.629612854 +0100
+diff -Nur linux-4.1.20.orig/ipc/mqueue.c linux-4.1.20/ipc/mqueue.c
+--- linux-4.1.20.orig/ipc/mqueue.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/ipc/mqueue.c 2016-03-21 20:18:33.000000000 +0100
@@ -47,8 +47,7 @@
#define RECV 1
@@ -13479,9 +14275,9 @@ diff -Nur linux-4.1.13.orig/ipc/mqueue.c linux-4.1.13/ipc/mqueue.c
ret = 0;
}
if (ret == 0) {
-diff -Nur linux-4.1.13.orig/ipc/msg.c linux-4.1.13/ipc/msg.c
---- linux-4.1.13.orig/ipc/msg.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/ipc/msg.c 2015-11-29 09:23:09.629612854 +0100
+diff -Nur linux-4.1.20.orig/ipc/msg.c linux-4.1.20/ipc/msg.c
+--- linux-4.1.20.orig/ipc/msg.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/ipc/msg.c 2016-03-21 20:18:33.000000000 +0100
@@ -188,6 +188,12 @@
struct msg_receiver *msr, *t;
@@ -13531,9 +14327,9 @@ diff -Nur linux-4.1.13.orig/ipc/msg.c linux-4.1.13/ipc/msg.c
return 0;
}
-diff -Nur linux-4.1.13.orig/ipc/sem.c linux-4.1.13/ipc/sem.c
---- linux-4.1.13.orig/ipc/sem.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/ipc/sem.c 2015-11-29 09:23:09.629612854 +0100
+diff -Nur linux-4.1.20.orig/ipc/sem.c linux-4.1.20/ipc/sem.c
+--- linux-4.1.20.orig/ipc/sem.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/ipc/sem.c 2016-03-21 20:18:33.000000000 +0100
@@ -690,6 +690,13 @@
static void wake_up_sem_queue_prepare(struct list_head *pt,
struct sem_queue *q, int error)
@@ -13572,9 +14368,81 @@ diff -Nur linux-4.1.13.orig/ipc/sem.c linux-4.1.13/ipc/sem.c
}
static void unlink_queue(struct sem_array *sma, struct sem_queue *q)
-diff -Nur linux-4.1.13.orig/kernel/bpf/hashtab.c linux-4.1.13/kernel/bpf/hashtab.c
---- linux-4.1.13.orig/kernel/bpf/hashtab.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/bpf/hashtab.c 2015-11-29 09:23:09.629612854 +0100
+diff -Nur linux-4.1.20.orig/kernel/Kconfig.locks linux-4.1.20/kernel/Kconfig.locks
+--- linux-4.1.20.orig/kernel/Kconfig.locks 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/Kconfig.locks 2016-03-21 20:18:33.000000000 +0100
+@@ -225,11 +225,11 @@
+
+ config MUTEX_SPIN_ON_OWNER
+ def_bool y
+- depends on SMP && !DEBUG_MUTEXES && ARCH_SUPPORTS_ATOMIC_RMW
++ depends on SMP && !DEBUG_MUTEXES && ARCH_SUPPORTS_ATOMIC_RMW && !PREEMPT_RT_FULL
+
+ config RWSEM_SPIN_ON_OWNER
+ def_bool y
+- depends on SMP && RWSEM_XCHGADD_ALGORITHM && ARCH_SUPPORTS_ATOMIC_RMW
++ depends on SMP && RWSEM_XCHGADD_ALGORITHM && ARCH_SUPPORTS_ATOMIC_RMW && !PREEMPT_RT_FULL
+
+ config LOCK_SPIN_ON_OWNER
+ def_bool y
+diff -Nur linux-4.1.20.orig/kernel/Kconfig.preempt linux-4.1.20/kernel/Kconfig.preempt
+--- linux-4.1.20.orig/kernel/Kconfig.preempt 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/Kconfig.preempt 2016-03-21 20:18:33.000000000 +0100
+@@ -1,3 +1,16 @@
++config PREEMPT
++ bool
++ select PREEMPT_COUNT
++
++config PREEMPT_RT_BASE
++ bool
++ select PREEMPT
++
++config HAVE_PREEMPT_LAZY
++ bool
++
++config PREEMPT_LAZY
++ def_bool y if HAVE_PREEMPT_LAZY && PREEMPT_RT_FULL
+
+ choice
+ prompt "Preemption Model"
+@@ -33,9 +46,9 @@
+
+ Select this if you are building a kernel for a desktop system.
+
+-config PREEMPT
++config PREEMPT__LL
+ bool "Preemptible Kernel (Low-Latency Desktop)"
+- select PREEMPT_COUNT
++ select PREEMPT
+ select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
+ help
+ This option reduces the latency of the kernel by making
+@@ -52,6 +65,22 @@
+ embedded system with latency requirements in the milliseconds
+ range.
+
++config PREEMPT_RTB
++ bool "Preemptible Kernel (Basic RT)"
++ select PREEMPT_RT_BASE
++ help
++ This option is basically the same as (Low-Latency Desktop) but
++ enables changes which are preliminary for the full preemptible
++ RT kernel.
++
++config PREEMPT_RT_FULL
++ bool "Fully Preemptible Kernel (RT)"
++ depends on IRQ_FORCED_THREADING
++ select PREEMPT_RT_BASE
++ select PREEMPT_RCU
++ help
++ All and everything
++
+ endchoice
+
+ config PREEMPT_COUNT
+diff -Nur linux-4.1.20.orig/kernel/bpf/hashtab.c linux-4.1.20/kernel/bpf/hashtab.c
+--- linux-4.1.20.orig/kernel/bpf/hashtab.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/bpf/hashtab.c 2016-03-21 20:18:33.000000000 +0100
@@ -17,7 +17,7 @@
struct bpf_htab {
struct bpf_map map;
@@ -13634,9 +14502,9 @@ diff -Nur linux-4.1.13.orig/kernel/bpf/hashtab.c linux-4.1.13/kernel/bpf/hashtab
return ret;
}
-diff -Nur linux-4.1.13.orig/kernel/cgroup.c linux-4.1.13/kernel/cgroup.c
---- linux-4.1.13.orig/kernel/cgroup.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/cgroup.c 2015-11-29 09:23:09.629612854 +0100
+diff -Nur linux-4.1.20.orig/kernel/cgroup.c linux-4.1.20/kernel/cgroup.c
+--- linux-4.1.20.orig/kernel/cgroup.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/cgroup.c 2016-03-21 20:18:33.000000000 +0100
@@ -4422,10 +4422,10 @@
queue_work(cgroup_destroy_wq, &css->destroy_work);
}
@@ -13661,7 +14529,7 @@ diff -Nur linux-4.1.13.orig/kernel/cgroup.c linux-4.1.13/kernel/cgroup.c
}
static void init_and_link_css(struct cgroup_subsys_state *css,
-@@ -5069,6 +5069,7 @@
+@@ -5081,6 +5081,7 @@
*/
cgroup_destroy_wq = alloc_workqueue("cgroup_destroy", 0, 1);
BUG_ON(!cgroup_destroy_wq);
@@ -13669,9 +14537,9 @@ diff -Nur linux-4.1.13.orig/kernel/cgroup.c linux-4.1.13/kernel/cgroup.c
/*
* Used to destroy pidlists and separate to serve as flush domain.
-diff -Nur linux-4.1.13.orig/kernel/cpu.c linux-4.1.13/kernel/cpu.c
---- linux-4.1.13.orig/kernel/cpu.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/cpu.c 2015-11-29 09:23:09.633612589 +0100
+diff -Nur linux-4.1.20.orig/kernel/cpu.c linux-4.1.20/kernel/cpu.c
+--- linux-4.1.20.orig/kernel/cpu.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/cpu.c 2016-03-21 20:18:33.000000000 +0100
@@ -74,8 +74,8 @@
#endif
} cpu_hotplug = {
@@ -14052,9 +14920,9 @@ diff -Nur linux-4.1.13.orig/kernel/cpu.c linux-4.1.13/kernel/cpu.c
return err;
}
-diff -Nur linux-4.1.13.orig/kernel/debug/kdb/kdb_io.c linux-4.1.13/kernel/debug/kdb/kdb_io.c
---- linux-4.1.13.orig/kernel/debug/kdb/kdb_io.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/debug/kdb/kdb_io.c 2015-11-29 09:23:09.633612589 +0100
+diff -Nur linux-4.1.20.orig/kernel/debug/kdb/kdb_io.c linux-4.1.20/kernel/debug/kdb/kdb_io.c
+--- linux-4.1.20.orig/kernel/debug/kdb/kdb_io.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/debug/kdb/kdb_io.c 2016-03-21 20:18:33.000000000 +0100
@@ -554,7 +554,6 @@
int linecount;
int colcount;
@@ -14092,9 +14960,9 @@ diff -Nur linux-4.1.13.orig/kernel/debug/kdb/kdb_io.c linux-4.1.13/kernel/debug/
return r;
}
-diff -Nur linux-4.1.13.orig/kernel/events/core.c linux-4.1.13/kernel/events/core.c
---- linux-4.1.13.orig/kernel/events/core.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/events/core.c 2015-11-29 09:23:09.633612589 +0100
+diff -Nur linux-4.1.20.orig/kernel/events/core.c linux-4.1.20/kernel/events/core.c
+--- linux-4.1.20.orig/kernel/events/core.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/events/core.c 2016-03-21 20:18:33.000000000 +0100
@@ -6925,6 +6925,7 @@
hrtimer_init(&hwc->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
@@ -14103,9 +14971,9 @@ diff -Nur linux-4.1.13.orig/kernel/events/core.c linux-4.1.13/kernel/events/core
/*
* Since hrtimers have a fixed rate, we can do a static freq->period
-diff -Nur linux-4.1.13.orig/kernel/exit.c linux-4.1.13/kernel/exit.c
---- linux-4.1.13.orig/kernel/exit.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/exit.c 2015-11-29 09:23:09.633612589 +0100
+diff -Nur linux-4.1.20.orig/kernel/exit.c linux-4.1.20/kernel/exit.c
+--- linux-4.1.20.orig/kernel/exit.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/exit.c 2016-03-21 20:18:33.000000000 +0100
@@ -144,7 +144,7 @@
* Do this under ->siglock, we can race with another thread
* doing sigqueue_free() if we have SIGQUEUE_PREALLOC signals.
@@ -14115,9 +14983,9 @@ diff -Nur linux-4.1.13.orig/kernel/exit.c linux-4.1.13/kernel/exit.c
tsk->sighand = NULL;
spin_unlock(&sighand->siglock);
-diff -Nur linux-4.1.13.orig/kernel/fork.c linux-4.1.13/kernel/fork.c
---- linux-4.1.13.orig/kernel/fork.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/fork.c 2015-11-29 09:23:09.633612589 +0100
+diff -Nur linux-4.1.20.orig/kernel/fork.c linux-4.1.20/kernel/fork.c
+--- linux-4.1.20.orig/kernel/fork.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/fork.c 2016-03-21 20:18:33.000000000 +0100
@@ -108,7 +108,7 @@
DEFINE_PER_CPU(unsigned long, process_counts) = 0;
@@ -14157,7 +15025,15 @@ diff -Nur linux-4.1.13.orig/kernel/fork.c linux-4.1.13/kernel/fork.c
void __init __weak arch_task_cache_init(void) { }
-@@ -680,6 +693,19 @@
+@@ -374,6 +387,7 @@
+ #endif
+ tsk->splice_pipe = NULL;
+ tsk->task_frag.page = NULL;
++ tsk->wake_q.next = NULL;
+
+ account_kernel_stack(ti, 1);
+
+@@ -680,6 +694,19 @@
}
EXPORT_SYMBOL_GPL(__mmdrop);
@@ -14177,7 +15053,7 @@ diff -Nur linux-4.1.13.orig/kernel/fork.c linux-4.1.13/kernel/fork.c
/*
* Decrement the use count and release all resources for an mm.
*/
-@@ -1214,6 +1240,9 @@
+@@ -1214,6 +1241,9 @@
*/
static void posix_cpu_timers_init(struct task_struct *tsk)
{
@@ -14187,7 +15063,7 @@ diff -Nur linux-4.1.13.orig/kernel/fork.c linux-4.1.13/kernel/fork.c
tsk->cputime_expires.prof_exp = 0;
tsk->cputime_expires.virt_exp = 0;
tsk->cputime_expires.sched_exp = 0;
-@@ -1338,6 +1367,7 @@
+@@ -1338,6 +1368,7 @@
spin_lock_init(&p->alloc_lock);
init_sigpending(&p->pending);
@@ -14195,7 +15071,7 @@ diff -Nur linux-4.1.13.orig/kernel/fork.c linux-4.1.13/kernel/fork.c
p->utime = p->stime = p->gtime = 0;
p->utimescaled = p->stimescaled = 0;
-@@ -1345,7 +1375,8 @@
+@@ -1345,7 +1376,8 @@
p->prev_cputime.utime = p->prev_cputime.stime = 0;
#endif
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
@@ -14205,7 +15081,7 @@ diff -Nur linux-4.1.13.orig/kernel/fork.c linux-4.1.13/kernel/fork.c
p->vtime_snap = 0;
p->vtime_snap_whence = VTIME_SLEEPING;
#endif
-@@ -1396,6 +1427,9 @@
+@@ -1396,6 +1428,9 @@
p->hardirq_context = 0;
p->softirq_context = 0;
#endif
@@ -14215,9 +15091,9 @@ diff -Nur linux-4.1.13.orig/kernel/fork.c linux-4.1.13/kernel/fork.c
#ifdef CONFIG_LOCKDEP
p->lockdep_depth = 0; /* no locks held yet */
p->curr_chain_key = 0;
-diff -Nur linux-4.1.13.orig/kernel/futex.c linux-4.1.13/kernel/futex.c
---- linux-4.1.13.orig/kernel/futex.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/futex.c 2015-11-29 09:23:09.633612589 +0100
+diff -Nur linux-4.1.20.orig/kernel/futex.c linux-4.1.20/kernel/futex.c
+--- linux-4.1.20.orig/kernel/futex.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/futex.c 2016-03-21 20:18:33.000000000 +0100
@@ -738,7 +738,9 @@
* task still owns the PI-state:
*/
@@ -14523,7 +15399,7 @@ diff -Nur linux-4.1.13.orig/kernel/futex.c linux-4.1.13/kernel/futex.c
/* Check if the requeue code acquired the second futex for us. */
if (!q.rt_waiter) {
-@@ -2630,9 +2701,10 @@
+@@ -2630,14 +2701,15 @@
* did a lock-steal - fix up the PI-state in that case.
*/
if (q.pi_state && (q.pi_state->owner != current)) {
@@ -14531,12 +15407,17 @@ diff -Nur linux-4.1.13.orig/kernel/futex.c linux-4.1.13/kernel/futex.c
+ spin_lock(&hb2->lock);
+ BUG_ON(&hb2->lock != q.lock_ptr);
ret = fixup_pi_state_owner(uaddr2, &q, current);
+ /*
+ * Drop the reference to the pi state which
+ * the requeue_pi() code acquired for us.
+ */
+ free_pi_state(q.pi_state);
- spin_unlock(q.lock_ptr);
+ spin_unlock(&hb2->lock);
}
} else {
/*
-@@ -2645,7 +2717,8 @@
+@@ -2650,7 +2722,8 @@
ret = rt_mutex_finish_proxy_lock(pi_mutex, to, &rt_waiter);
debug_rt_mutex_free_waiter(&rt_waiter);
@@ -14546,9 +15427,9 @@ diff -Nur linux-4.1.13.orig/kernel/futex.c linux-4.1.13/kernel/futex.c
/*
* Fixup the pi_state owner and possibly acquire the lock if we
* haven't already.
-diff -Nur linux-4.1.13.orig/kernel/irq/handle.c linux-4.1.13/kernel/irq/handle.c
---- linux-4.1.13.orig/kernel/irq/handle.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/irq/handle.c 2015-11-29 09:23:09.633612589 +0100
+diff -Nur linux-4.1.20.orig/kernel/irq/handle.c linux-4.1.20/kernel/irq/handle.c
+--- linux-4.1.20.orig/kernel/irq/handle.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/irq/handle.c 2016-03-21 20:18:33.000000000 +0100
@@ -133,6 +133,8 @@
irqreturn_t
handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action)
@@ -14571,9 +15452,9 @@ diff -Nur linux-4.1.13.orig/kernel/irq/handle.c linux-4.1.13/kernel/irq/handle.c
if (!noirqdebug)
note_interrupt(irq, desc, retval);
-diff -Nur linux-4.1.13.orig/kernel/irq/manage.c linux-4.1.13/kernel/irq/manage.c
---- linux-4.1.13.orig/kernel/irq/manage.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/irq/manage.c 2015-11-29 09:23:09.633612589 +0100
+diff -Nur linux-4.1.20.orig/kernel/irq/manage.c linux-4.1.20/kernel/irq/manage.c
+--- linux-4.1.20.orig/kernel/irq/manage.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/irq/manage.c 2016-03-21 20:18:33.000000000 +0100
@@ -22,6 +22,7 @@
#include "internals.h"
@@ -15010,9 +15891,9 @@ diff -Nur linux-4.1.13.orig/kernel/irq/manage.c linux-4.1.13/kernel/irq/manage.c
#ifdef CONFIG_DEBUG_SHIRQ_FIXME
if (!retval && (irqflags & IRQF_SHARED)) {
-diff -Nur linux-4.1.13.orig/kernel/irq/settings.h linux-4.1.13/kernel/irq/settings.h
---- linux-4.1.13.orig/kernel/irq/settings.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/irq/settings.h 2015-11-29 09:23:09.637612322 +0100
+diff -Nur linux-4.1.20.orig/kernel/irq/settings.h linux-4.1.20/kernel/irq/settings.h
+--- linux-4.1.20.orig/kernel/irq/settings.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/irq/settings.h 2016-03-21 20:18:33.000000000 +0100
@@ -15,6 +15,7 @@
_IRQ_NESTED_THREAD = IRQ_NESTED_THREAD,
_IRQ_PER_CPU_DEVID = IRQ_PER_CPU_DEVID,
@@ -15046,9 +15927,9 @@ diff -Nur linux-4.1.13.orig/kernel/irq/settings.h linux-4.1.13/kernel/irq/settin
static inline bool irq_settings_is_per_cpu(struct irq_desc *desc)
{
return desc->status_use_accessors & _IRQ_PER_CPU;
-diff -Nur linux-4.1.13.orig/kernel/irq/spurious.c linux-4.1.13/kernel/irq/spurious.c
---- linux-4.1.13.orig/kernel/irq/spurious.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/irq/spurious.c 2015-11-29 09:23:09.637612322 +0100
+diff -Nur linux-4.1.20.orig/kernel/irq/spurious.c linux-4.1.20/kernel/irq/spurious.c
+--- linux-4.1.20.orig/kernel/irq/spurious.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/irq/spurious.c 2016-03-21 20:18:33.000000000 +0100
@@ -444,6 +444,10 @@
static int __init irqfixup_setup(char *str)
@@ -15071,9 +15952,9 @@ diff -Nur linux-4.1.13.orig/kernel/irq/spurious.c linux-4.1.13/kernel/irq/spurio
irqfixup = 2;
printk(KERN_WARNING "Misrouted IRQ fixup and polling support "
"enabled\n");
-diff -Nur linux-4.1.13.orig/kernel/irq_work.c linux-4.1.13/kernel/irq_work.c
---- linux-4.1.13.orig/kernel/irq_work.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/irq_work.c 2015-11-29 09:23:09.637612322 +0100
+diff -Nur linux-4.1.20.orig/kernel/irq_work.c linux-4.1.20/kernel/irq_work.c
+--- linux-4.1.20.orig/kernel/irq_work.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/irq_work.c 2016-03-21 20:18:33.000000000 +0100
@@ -17,6 +17,7 @@
#include <linux/cpu.h>
#include <linux/notifier.h>
@@ -15195,81 +16076,9 @@ diff -Nur linux-4.1.13.orig/kernel/irq_work.c linux-4.1.13/kernel/irq_work.c
/*
* Synchronize against the irq_work @entry, ensures the entry is not
-diff -Nur linux-4.1.13.orig/kernel/Kconfig.locks linux-4.1.13/kernel/Kconfig.locks
---- linux-4.1.13.orig/kernel/Kconfig.locks 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/Kconfig.locks 2015-11-29 09:23:09.629612854 +0100
-@@ -225,11 +225,11 @@
-
- config MUTEX_SPIN_ON_OWNER
- def_bool y
-- depends on SMP && !DEBUG_MUTEXES && ARCH_SUPPORTS_ATOMIC_RMW
-+ depends on SMP && !DEBUG_MUTEXES && ARCH_SUPPORTS_ATOMIC_RMW && !PREEMPT_RT_FULL
-
- config RWSEM_SPIN_ON_OWNER
- def_bool y
-- depends on SMP && RWSEM_XCHGADD_ALGORITHM && ARCH_SUPPORTS_ATOMIC_RMW
-+ depends on SMP && RWSEM_XCHGADD_ALGORITHM && ARCH_SUPPORTS_ATOMIC_RMW && !PREEMPT_RT_FULL
-
- config LOCK_SPIN_ON_OWNER
- def_bool y
-diff -Nur linux-4.1.13.orig/kernel/Kconfig.preempt linux-4.1.13/kernel/Kconfig.preempt
---- linux-4.1.13.orig/kernel/Kconfig.preempt 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/Kconfig.preempt 2015-11-29 09:23:09.629612854 +0100
-@@ -1,3 +1,16 @@
-+config PREEMPT
-+ bool
-+ select PREEMPT_COUNT
-+
-+config PREEMPT_RT_BASE
-+ bool
-+ select PREEMPT
-+
-+config HAVE_PREEMPT_LAZY
-+ bool
-+
-+config PREEMPT_LAZY
-+ def_bool y if HAVE_PREEMPT_LAZY && PREEMPT_RT_FULL
-
- choice
- prompt "Preemption Model"
-@@ -33,9 +46,9 @@
-
- Select this if you are building a kernel for a desktop system.
-
--config PREEMPT
-+config PREEMPT__LL
- bool "Preemptible Kernel (Low-Latency Desktop)"
-- select PREEMPT_COUNT
-+ select PREEMPT
- select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
- help
- This option reduces the latency of the kernel by making
-@@ -52,6 +65,22 @@
- embedded system with latency requirements in the milliseconds
- range.
-
-+config PREEMPT_RTB
-+ bool "Preemptible Kernel (Basic RT)"
-+ select PREEMPT_RT_BASE
-+ help
-+ This option is basically the same as (Low-Latency Desktop) but
-+ enables changes which are preliminary for the full preemptible
-+ RT kernel.
-+
-+config PREEMPT_RT_FULL
-+ bool "Fully Preemptible Kernel (RT)"
-+ depends on IRQ_FORCED_THREADING
-+ select PREEMPT_RT_BASE
-+ select PREEMPT_RCU
-+ help
-+ All and everything
-+
- endchoice
-
- config PREEMPT_COUNT
-diff -Nur linux-4.1.13.orig/kernel/ksysfs.c linux-4.1.13/kernel/ksysfs.c
---- linux-4.1.13.orig/kernel/ksysfs.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/ksysfs.c 2015-11-29 09:23:09.637612322 +0100
+diff -Nur linux-4.1.20.orig/kernel/ksysfs.c linux-4.1.20/kernel/ksysfs.c
+--- linux-4.1.20.orig/kernel/ksysfs.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/ksysfs.c 2016-03-21 20:18:33.000000000 +0100
@@ -136,6 +136,15 @@
#endif /* CONFIG_KEXEC */
@@ -15296,9 +16105,43 @@ diff -Nur linux-4.1.13.orig/kernel/ksysfs.c linux-4.1.13/kernel/ksysfs.c
NULL
};
-diff -Nur linux-4.1.13.orig/kernel/locking/lglock.c linux-4.1.13/kernel/locking/lglock.c
---- linux-4.1.13.orig/kernel/locking/lglock.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/locking/lglock.c 2015-11-29 09:23:09.637612322 +0100
+diff -Nur linux-4.1.20.orig/kernel/locking/Makefile linux-4.1.20/kernel/locking/Makefile
+--- linux-4.1.20.orig/kernel/locking/Makefile 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/locking/Makefile 2016-03-21 20:18:33.000000000 +0100
+@@ -1,5 +1,5 @@
+
+-obj-y += mutex.o semaphore.o rwsem.o
++obj-y += semaphore.o
+
+ ifdef CONFIG_FUNCTION_TRACER
+ CFLAGS_REMOVE_lockdep.o = $(CC_FLAGS_FTRACE)
+@@ -8,7 +8,11 @@
+ CFLAGS_REMOVE_rtmutex-debug.o = $(CC_FLAGS_FTRACE)
+ endif
+
++ifneq ($(CONFIG_PREEMPT_RT_FULL),y)
++obj-y += mutex.o
+ obj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o
++obj-y += rwsem.o
++endif
+ obj-$(CONFIG_LOCKDEP) += lockdep.o
+ ifeq ($(CONFIG_PROC_FS),y)
+ obj-$(CONFIG_LOCKDEP) += lockdep_proc.o
+@@ -22,8 +26,11 @@
+ obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o
+ obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
+ obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o
++ifneq ($(CONFIG_PREEMPT_RT_FULL),y)
+ obj-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
+ obj-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem-xadd.o
++endif
+ obj-$(CONFIG_PERCPU_RWSEM) += percpu-rwsem.o
++obj-$(CONFIG_PREEMPT_RT_FULL) += rt.o
+ obj-$(CONFIG_QUEUE_RWLOCK) += qrwlock.o
+ obj-$(CONFIG_LOCK_TORTURE_TEST) += locktorture.o
+diff -Nur linux-4.1.20.orig/kernel/locking/lglock.c linux-4.1.20/kernel/locking/lglock.c
+--- linux-4.1.20.orig/kernel/locking/lglock.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/locking/lglock.c 2016-03-21 20:18:33.000000000 +0100
@@ -4,6 +4,15 @@
#include <linux/cpu.h>
#include <linux/string.h>
@@ -15443,9 +16286,9 @@ diff -Nur linux-4.1.13.orig/kernel/locking/lglock.c linux-4.1.13/kernel/locking/
+ }
+}
+#endif
-diff -Nur linux-4.1.13.orig/kernel/locking/lockdep.c linux-4.1.13/kernel/locking/lockdep.c
---- linux-4.1.13.orig/kernel/locking/lockdep.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/locking/lockdep.c 2015-11-29 09:23:09.637612322 +0100
+diff -Nur linux-4.1.20.orig/kernel/locking/lockdep.c linux-4.1.20/kernel/locking/lockdep.c
+--- linux-4.1.20.orig/kernel/locking/lockdep.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/locking/lockdep.c 2016-03-21 20:18:33.000000000 +0100
@@ -3563,6 +3563,7 @@
}
}
@@ -15462,9 +16305,9 @@ diff -Nur linux-4.1.13.orig/kernel/locking/lockdep.c linux-4.1.13/kernel/locking
if (!debug_locks)
print_irqtrace_events(current);
-diff -Nur linux-4.1.13.orig/kernel/locking/locktorture.c linux-4.1.13/kernel/locking/locktorture.c
---- linux-4.1.13.orig/kernel/locking/locktorture.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/locking/locktorture.c 2015-11-29 09:23:09.637612322 +0100
+diff -Nur linux-4.1.20.orig/kernel/locking/locktorture.c linux-4.1.20/kernel/locking/locktorture.c
+--- linux-4.1.20.orig/kernel/locking/locktorture.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/locking/locktorture.c 2016-03-21 20:18:33.000000000 +0100
@@ -24,7 +24,6 @@
#include <linux/module.h>
#include <linux/kthread.h>
@@ -15473,43 +16316,9 @@ diff -Nur linux-4.1.13.orig/kernel/locking/locktorture.c linux-4.1.13/kernel/loc
#include <linux/mutex.h>
#include <linux/rwsem.h>
#include <linux/smp.h>
-diff -Nur linux-4.1.13.orig/kernel/locking/Makefile linux-4.1.13/kernel/locking/Makefile
---- linux-4.1.13.orig/kernel/locking/Makefile 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/locking/Makefile 2015-11-29 09:23:09.637612322 +0100
-@@ -1,5 +1,5 @@
-
--obj-y += mutex.o semaphore.o rwsem.o
-+obj-y += semaphore.o
-
- ifdef CONFIG_FUNCTION_TRACER
- CFLAGS_REMOVE_lockdep.o = $(CC_FLAGS_FTRACE)
-@@ -8,7 +8,11 @@
- CFLAGS_REMOVE_rtmutex-debug.o = $(CC_FLAGS_FTRACE)
- endif
-
-+ifneq ($(CONFIG_PREEMPT_RT_FULL),y)
-+obj-y += mutex.o
- obj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o
-+obj-y += rwsem.o
-+endif
- obj-$(CONFIG_LOCKDEP) += lockdep.o
- ifeq ($(CONFIG_PROC_FS),y)
- obj-$(CONFIG_LOCKDEP) += lockdep_proc.o
-@@ -22,8 +26,11 @@
- obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o
- obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
- obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o
-+ifneq ($(CONFIG_PREEMPT_RT_FULL),y)
- obj-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
- obj-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem-xadd.o
-+endif
- obj-$(CONFIG_PERCPU_RWSEM) += percpu-rwsem.o
-+obj-$(CONFIG_PREEMPT_RT_FULL) += rt.o
- obj-$(CONFIG_QUEUE_RWLOCK) += qrwlock.o
- obj-$(CONFIG_LOCK_TORTURE_TEST) += locktorture.o
-diff -Nur linux-4.1.13.orig/kernel/locking/rt.c linux-4.1.13/kernel/locking/rt.c
---- linux-4.1.13.orig/kernel/locking/rt.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/kernel/locking/rt.c 2015-11-29 09:23:09.637612322 +0100
+diff -Nur linux-4.1.20.orig/kernel/locking/rt.c linux-4.1.20/kernel/locking/rt.c
+--- linux-4.1.20.orig/kernel/locking/rt.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/kernel/locking/rt.c 2016-03-21 20:18:33.000000000 +0100
@@ -0,0 +1,461 @@
+/*
+ * kernel/rt.c
@@ -15972,9 +16781,9 @@ diff -Nur linux-4.1.13.orig/kernel/locking/rt.c linux-4.1.13/kernel/locking/rt.c
+ return 1;
+}
+EXPORT_SYMBOL(atomic_dec_and_mutex_lock);
-diff -Nur linux-4.1.13.orig/kernel/locking/rtmutex.c linux-4.1.13/kernel/locking/rtmutex.c
---- linux-4.1.13.orig/kernel/locking/rtmutex.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/locking/rtmutex.c 2015-11-29 09:23:09.637612322 +0100
+diff -Nur linux-4.1.20.orig/kernel/locking/rtmutex.c linux-4.1.20/kernel/locking/rtmutex.c
+--- linux-4.1.20.orig/kernel/locking/rtmutex.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/locking/rtmutex.c 2016-03-21 20:18:33.000000000 +0100
@@ -7,6 +7,11 @@
* Copyright (C) 2005-2006 Timesys Corp., Thomas Gleixner <tglx@timesys.com>
* Copyright (C) 2005 Kihon Technologies Inc., Steven Rostedt
@@ -16243,7 +17052,7 @@ diff -Nur linux-4.1.13.orig/kernel/locking/rtmutex.c linux-4.1.13/kernel/locking
+ __set_current_state_no_track(TASK_UNINTERRUPTIBLE);
+ pi_unlock(&self->pi_lock);
+
-+ ret = task_blocks_on_rt_mutex(lock, &waiter, self, 0);
++ ret = task_blocks_on_rt_mutex(lock, &waiter, self, RT_MUTEX_MIN_CHAINWALK);
+ BUG_ON(ret);
+
+ for (;;) {
@@ -17072,9 +17881,9 @@ diff -Nur linux-4.1.13.orig/kernel/locking/rtmutex.c linux-4.1.13/kernel/locking
+}
+EXPORT_SYMBOL(ww_mutex_unlock);
+#endif
-diff -Nur linux-4.1.13.orig/kernel/locking/rtmutex_common.h linux-4.1.13/kernel/locking/rtmutex_common.h
---- linux-4.1.13.orig/kernel/locking/rtmutex_common.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/locking/rtmutex_common.h 2015-11-29 09:23:09.637612322 +0100
+diff -Nur linux-4.1.20.orig/kernel/locking/rtmutex_common.h linux-4.1.20/kernel/locking/rtmutex_common.h
+--- linux-4.1.20.orig/kernel/locking/rtmutex_common.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/locking/rtmutex_common.h 2016-03-21 20:18:33.000000000 +0100
@@ -49,6 +49,7 @@
struct rb_node pi_tree_entry;
struct task_struct *task;
@@ -17118,9 +17927,9 @@ diff -Nur linux-4.1.13.orig/kernel/locking/rtmutex_common.h linux-4.1.13/kernel/
+}
+
#endif
-diff -Nur linux-4.1.13.orig/kernel/locking/spinlock.c linux-4.1.13/kernel/locking/spinlock.c
---- linux-4.1.13.orig/kernel/locking/spinlock.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/locking/spinlock.c 2015-11-29 09:23:09.637612322 +0100
+diff -Nur linux-4.1.20.orig/kernel/locking/spinlock.c linux-4.1.20/kernel/locking/spinlock.c
+--- linux-4.1.20.orig/kernel/locking/spinlock.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/locking/spinlock.c 2016-03-21 20:18:33.000000000 +0100
@@ -124,8 +124,11 @@
* __[spin|read|write]_lock_bh()
*/
@@ -17151,9 +17960,9 @@ diff -Nur linux-4.1.13.orig/kernel/locking/spinlock.c linux-4.1.13/kernel/lockin
#ifdef CONFIG_DEBUG_LOCK_ALLOC
void __lockfunc _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass)
-diff -Nur linux-4.1.13.orig/kernel/locking/spinlock_debug.c linux-4.1.13/kernel/locking/spinlock_debug.c
---- linux-4.1.13.orig/kernel/locking/spinlock_debug.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/locking/spinlock_debug.c 2015-11-29 09:23:09.637612322 +0100
+diff -Nur linux-4.1.20.orig/kernel/locking/spinlock_debug.c linux-4.1.20/kernel/locking/spinlock_debug.c
+--- linux-4.1.20.orig/kernel/locking/spinlock_debug.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/locking/spinlock_debug.c 2016-03-21 20:18:33.000000000 +0100
@@ -31,6 +31,7 @@
EXPORT_SYMBOL(__raw_spin_lock_init);
@@ -17184,10 +17993,10 @@ diff -Nur linux-4.1.13.orig/kernel/locking/spinlock_debug.c linux-4.1.13/kernel/
}
+
+#endif
-diff -Nur linux-4.1.13.orig/kernel/panic.c linux-4.1.13/kernel/panic.c
---- linux-4.1.13.orig/kernel/panic.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/panic.c 2015-11-29 09:23:09.637612322 +0100
-@@ -387,9 +387,11 @@
+diff -Nur linux-4.1.20.orig/kernel/panic.c linux-4.1.20/kernel/panic.c
+--- linux-4.1.20.orig/kernel/panic.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/panic.c 2016-03-21 20:18:33.000000000 +0100
+@@ -399,9 +399,11 @@
static int init_oops_id(void)
{
@@ -17199,9 +18008,9 @@ diff -Nur linux-4.1.13.orig/kernel/panic.c linux-4.1.13/kernel/panic.c
oops_id++;
return 0;
-diff -Nur linux-4.1.13.orig/kernel/power/hibernate.c linux-4.1.13/kernel/power/hibernate.c
---- linux-4.1.13.orig/kernel/power/hibernate.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/power/hibernate.c 2015-11-29 09:23:09.637612322 +0100
+diff -Nur linux-4.1.20.orig/kernel/power/hibernate.c linux-4.1.20/kernel/power/hibernate.c
+--- linux-4.1.20.orig/kernel/power/hibernate.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/power/hibernate.c 2016-03-21 20:18:33.000000000 +0100
@@ -285,6 +285,8 @@
local_irq_disable();
@@ -17251,9 +18060,9 @@ diff -Nur linux-4.1.13.orig/kernel/power/hibernate.c linux-4.1.13/kernel/power/h
local_irq_enable();
enable_nonboot_cpus();
-diff -Nur linux-4.1.13.orig/kernel/power/suspend.c linux-4.1.13/kernel/power/suspend.c
---- linux-4.1.13.orig/kernel/power/suspend.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/power/suspend.c 2015-11-29 09:23:09.637612322 +0100
+diff -Nur linux-4.1.20.orig/kernel/power/suspend.c linux-4.1.20/kernel/power/suspend.c
+--- linux-4.1.20.orig/kernel/power/suspend.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/power/suspend.c 2016-03-21 20:18:33.000000000 +0100
@@ -356,6 +356,8 @@
arch_suspend_disable_irqs();
BUG_ON(!irqs_disabled());
@@ -17272,9 +18081,9 @@ diff -Nur linux-4.1.13.orig/kernel/power/suspend.c linux-4.1.13/kernel/power/sus
arch_suspend_enable_irqs();
BUG_ON(irqs_disabled());
-diff -Nur linux-4.1.13.orig/kernel/printk/printk.c linux-4.1.13/kernel/printk/printk.c
---- linux-4.1.13.orig/kernel/printk/printk.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/printk/printk.c 2015-11-29 09:23:09.641612055 +0100
+diff -Nur linux-4.1.20.orig/kernel/printk/printk.c linux-4.1.20/kernel/printk/printk.c
+--- linux-4.1.20.orig/kernel/printk/printk.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/printk/printk.c 2016-03-21 20:18:33.000000000 +0100
@@ -1163,6 +1163,7 @@
{
char *text;
@@ -17509,7 +18318,7 @@ diff -Nur linux-4.1.13.orig/kernel/printk/printk.c linux-4.1.13/kernel/printk/pr
return;
out:
raw_spin_unlock_irqrestore(&logbuf_lock, flags);
-@@ -2235,12 +2318,17 @@
+@@ -2246,12 +2329,17 @@
console_idx = log_next(console_idx);
console_seq++;
console_prev = msg->flags;
@@ -17524,29 +18333,55 @@ diff -Nur linux-4.1.13.orig/kernel/printk/printk.c linux-4.1.13/kernel/printk/pr
start_critical_timings();
local_irq_restore(flags);
+#endif
- }
- console_locked = 0;
-diff -Nur linux-4.1.13.orig/kernel/ptrace.c linux-4.1.13/kernel/ptrace.c
---- linux-4.1.13.orig/kernel/ptrace.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/ptrace.c 2015-11-29 09:23:09.641612055 +0100
-@@ -129,7 +129,12 @@
+ if (do_cond_resched)
+ cond_resched();
+diff -Nur linux-4.1.20.orig/kernel/ptrace.c linux-4.1.20/kernel/ptrace.c
+--- linux-4.1.20.orig/kernel/ptrace.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/ptrace.c 2016-03-21 20:18:33.000000000 +0100
+@@ -129,7 +129,14 @@
spin_lock_irq(&task->sighand->siglock);
if (task_is_traced(task) && !__fatal_signal_pending(task)) {
- task->state = __TASK_TRACED;
-+ raw_spin_lock_irq(&task->pi_lock);
++ unsigned long flags;
++
++ raw_spin_lock_irqsave(&task->pi_lock, flags);
+ if (task->state & __TASK_TRACED)
+ task->state = __TASK_TRACED;
+ else
+ task->saved_state = __TASK_TRACED;
-+ raw_spin_unlock_irq(&task->pi_lock);
++ raw_spin_unlock_irqrestore(&task->pi_lock, flags);
ret = true;
}
spin_unlock_irq(&task->sighand->siglock);
-diff -Nur linux-4.1.13.orig/kernel/rcu/tree.c linux-4.1.13/kernel/rcu/tree.c
---- linux-4.1.13.orig/kernel/rcu/tree.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/rcu/tree.c 2015-11-29 09:23:09.641612055 +0100
+diff -Nur linux-4.1.20.orig/kernel/rcu/rcutorture.c linux-4.1.20/kernel/rcu/rcutorture.c
+--- linux-4.1.20.orig/kernel/rcu/rcutorture.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/rcu/rcutorture.c 2016-03-21 20:18:33.000000000 +0100
+@@ -389,6 +389,7 @@
+ .name = "rcu"
+ };
+
++#ifndef CONFIG_PREEMPT_RT_FULL
+ /*
+ * Definitions for rcu_bh torture testing.
+ */
+@@ -428,6 +429,12 @@
+ .name = "rcu_bh"
+ };
+
++#else
++static struct rcu_torture_ops rcu_bh_ops = {
++ .ttype = INVALID_RCU_FLAVOR,
++};
++#endif
++
+ /*
+ * Don't even think about trying any of these in real life!!!
+ * The names includes "busted", and they really means it!
+diff -Nur linux-4.1.20.orig/kernel/rcu/tree.c linux-4.1.20/kernel/rcu/tree.c
+--- linux-4.1.20.orig/kernel/rcu/tree.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/rcu/tree.c 2016-03-21 20:18:33.000000000 +0100
@@ -56,6 +56,11 @@
#include <linux/random.h>
#include <linux/ftrace_event.h>
@@ -17834,9 +18669,9 @@ diff -Nur linux-4.1.13.orig/kernel/rcu/tree.c linux-4.1.13/kernel/rcu/tree.c
/*
* We don't need protection against CPU-hotplug here because
-diff -Nur linux-4.1.13.orig/kernel/rcu/tree.h linux-4.1.13/kernel/rcu/tree.h
---- linux-4.1.13.orig/kernel/rcu/tree.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/rcu/tree.h 2015-11-29 09:23:09.641612055 +0100
+diff -Nur linux-4.1.20.orig/kernel/rcu/tree.h linux-4.1.20/kernel/rcu/tree.h
+--- linux-4.1.20.orig/kernel/rcu/tree.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/rcu/tree.h 2016-03-21 20:18:33.000000000 +0100
@@ -27,6 +27,7 @@
#include <linux/threads.h>
#include <linux/cpumask.h>
@@ -17897,9 +18732,9 @@ diff -Nur linux-4.1.13.orig/kernel/rcu/tree.h linux-4.1.13/kernel/rcu/tree.h
static int rcu_spawn_one_boost_kthread(struct rcu_state *rsp,
struct rcu_node *rnp);
#endif /* #ifdef CONFIG_RCU_BOOST */
-diff -Nur linux-4.1.13.orig/kernel/rcu/tree_plugin.h linux-4.1.13/kernel/rcu/tree_plugin.h
---- linux-4.1.13.orig/kernel/rcu/tree_plugin.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/rcu/tree_plugin.h 2015-11-29 09:23:09.641612055 +0100
+diff -Nur linux-4.1.20.orig/kernel/rcu/tree_plugin.h linux-4.1.20/kernel/rcu/tree_plugin.h
+--- linux-4.1.20.orig/kernel/rcu/tree_plugin.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/rcu/tree_plugin.h 2016-03-21 20:18:33.000000000 +0100
@@ -24,27 +24,20 @@
* Paul E. McKenney <paulmck@linux.vnet.ibm.com>
*/
@@ -18234,9 +19069,9 @@ diff -Nur linux-4.1.13.orig/kernel/rcu/tree_plugin.h linux-4.1.13/kernel/rcu/tre
rdp->nocb_follower_tail = &rdp->nocb_follower_head;
}
-diff -Nur linux-4.1.13.orig/kernel/rcu/update.c linux-4.1.13/kernel/rcu/update.c
---- linux-4.1.13.orig/kernel/rcu/update.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/rcu/update.c 2015-11-29 09:23:09.641612055 +0100
+diff -Nur linux-4.1.20.orig/kernel/rcu/update.c linux-4.1.20/kernel/rcu/update.c
+--- linux-4.1.20.orig/kernel/rcu/update.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/rcu/update.c 2016-03-21 20:18:33.000000000 +0100
@@ -227,6 +227,7 @@
}
EXPORT_SYMBOL_GPL(rcu_read_lock_held);
@@ -18253,9 +19088,9 @@ diff -Nur linux-4.1.13.orig/kernel/rcu/update.c linux-4.1.13/kernel/rcu/update.c
#endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
-diff -Nur linux-4.1.13.orig/kernel/relay.c linux-4.1.13/kernel/relay.c
---- linux-4.1.13.orig/kernel/relay.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/relay.c 2015-11-29 09:23:09.641612055 +0100
+diff -Nur linux-4.1.20.orig/kernel/relay.c linux-4.1.20/kernel/relay.c
+--- linux-4.1.20.orig/kernel/relay.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/relay.c 2016-03-21 20:18:33.000000000 +0100
@@ -339,6 +339,10 @@
{
struct rchan_buf *buf = (struct rchan_buf *)data;
@@ -18291,9 +19126,21 @@ diff -Nur linux-4.1.13.orig/kernel/relay.c linux-4.1.13/kernel/relay.c
}
old = buf->data;
-diff -Nur linux-4.1.13.orig/kernel/sched/completion.c linux-4.1.13/kernel/sched/completion.c
---- linux-4.1.13.orig/kernel/sched/completion.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/sched/completion.c 2015-11-29 09:23:09.641612055 +0100
+diff -Nur linux-4.1.20.orig/kernel/sched/Makefile linux-4.1.20/kernel/sched/Makefile
+--- linux-4.1.20.orig/kernel/sched/Makefile 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/sched/Makefile 2016-03-21 20:18:33.000000000 +0100
+@@ -13,7 +13,7 @@
+
+ obj-y += core.o proc.o clock.o cputime.o
+ obj-y += idle_task.o fair.o rt.o deadline.o stop_task.o
+-obj-y += wait.o completion.o idle.o
++obj-y += wait.o wait-simple.o work-simple.o completion.o idle.o
+ obj-$(CONFIG_SMP) += cpupri.o cpudeadline.o
+ obj-$(CONFIG_SCHED_AUTOGROUP) += auto_group.o
+ obj-$(CONFIG_SCHEDSTATS) += stats.o
+diff -Nur linux-4.1.20.orig/kernel/sched/completion.c linux-4.1.20/kernel/sched/completion.c
+--- linux-4.1.20.orig/kernel/sched/completion.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/sched/completion.c 2016-03-21 20:18:33.000000000 +0100
@@ -30,10 +30,10 @@
{
unsigned long flags;
@@ -18384,9 +19231,9 @@ diff -Nur linux-4.1.13.orig/kernel/sched/completion.c linux-4.1.13/kernel/sched/
return true;
}
EXPORT_SYMBOL(completion_done);
-diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
---- linux-4.1.13.orig/kernel/sched/core.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/sched/core.c 2015-11-29 09:23:09.645611789 +0100
+diff -Nur linux-4.1.20.orig/kernel/sched/core.c linux-4.1.20/kernel/sched/core.c
+--- linux-4.1.20.orig/kernel/sched/core.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/sched/core.c 2016-03-21 20:18:33.000000000 +0100
@@ -282,7 +282,11 @@
* Number of tasks to iterate in a single balance run.
* Limited because this is done with IRQs disabled.
@@ -18718,7 +19565,42 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
if (unlikely(prev_state == TASK_DEAD)) {
if (prev->sched_class->task_dead)
prev->sched_class->task_dead(prev);
-@@ -2657,6 +2757,133 @@
+@@ -2543,16 +2643,6 @@
+ }
+ #endif
+
+-notrace unsigned long get_parent_ip(unsigned long addr)
+-{
+- if (in_lock_functions(addr)) {
+- addr = CALLER_ADDR2;
+- if (in_lock_functions(addr))
+- addr = CALLER_ADDR3;
+- }
+- return addr;
+-}
+-
+ #if defined(CONFIG_PREEMPT) && (defined(CONFIG_DEBUG_PREEMPT) || \
+ defined(CONFIG_PREEMPT_TRACER))
+
+@@ -2574,7 +2664,7 @@
+ PREEMPT_MASK - 10);
+ #endif
+ if (preempt_count() == val) {
+- unsigned long ip = get_parent_ip(CALLER_ADDR1);
++ unsigned long ip = get_lock_parent_ip();
+ #ifdef CONFIG_DEBUG_PREEMPT
+ current->preempt_disable_ip = ip;
+ #endif
+@@ -2601,7 +2691,7 @@
+ #endif
+
+ if (preempt_count() == val)
+- trace_preempt_on(CALLER_ADDR0, get_parent_ip(CALLER_ADDR1));
++ trace_preempt_on(CALLER_ADDR0, get_lock_parent_ip());
+ __preempt_count_sub(val);
+ }
+ EXPORT_SYMBOL(preempt_count_sub);
+@@ -2657,6 +2747,133 @@
schedstat_inc(this_rq(), sched_count);
}
@@ -18763,7 +19645,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
+{
+ struct task_struct *p = current;
+
-+ if (in_atomic()) {
++ if (in_atomic() || irqs_disabled()) {
+#ifdef CONFIG_SCHED_DEBUG
+ p->migrate_disable_atomic++;
+#endif
@@ -18797,7 +19679,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
+ unsigned long flags;
+ struct rq *rq;
+
-+ if (in_atomic()) {
++ if (in_atomic() || irqs_disabled()) {
+#ifdef CONFIG_SCHED_DEBUG
+ p->migrate_disable_atomic--;
+#endif
@@ -18852,7 +19734,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
/*
* Pick up the highest-prio task:
*/
-@@ -2763,6 +2990,8 @@
+@@ -2763,6 +2980,8 @@
smp_mb__before_spinlock();
raw_spin_lock_irq(&rq->lock);
@@ -18861,7 +19743,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
rq->clock_skip_update <<= 1; /* promote REQ to ACT */
switch_count = &prev->nivcsw;
-@@ -2772,19 +3001,6 @@
+@@ -2772,19 +2991,6 @@
} else {
deactivate_task(rq, prev, DEQUEUE_SLEEP);
prev->on_rq = 0;
@@ -18881,7 +19763,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
}
switch_count = &prev->nvcsw;
}
-@@ -2794,6 +3010,7 @@
+@@ -2794,6 +3000,7 @@
next = pick_next_task(rq, prev);
clear_tsk_need_resched(prev);
@@ -18889,7 +19771,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
clear_preempt_need_resched();
rq->clock_skip_update = 0;
-@@ -2814,8 +3031,19 @@
+@@ -2814,8 +3021,19 @@
static inline void sched_submit_work(struct task_struct *tsk)
{
@@ -18910,7 +19792,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
/*
* If we are going to sleep and we have plugged IO queued,
* make sure to submit it to avoid deadlocks.
-@@ -2824,6 +3052,12 @@
+@@ -2824,6 +3042,12 @@
blk_schedule_flush_plug(tsk);
}
@@ -18923,7 +19805,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
asmlinkage __visible void __sched schedule(void)
{
struct task_struct *tsk = current;
-@@ -2832,6 +3066,7 @@
+@@ -2832,6 +3056,7 @@
do {
__schedule();
} while (need_resched());
@@ -18931,22 +19813,56 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
}
EXPORT_SYMBOL(schedule);
-@@ -2923,6 +3158,14 @@
+@@ -2881,6 +3106,30 @@
+ } while (need_resched());
+ }
+
++#ifdef CONFIG_PREEMPT_LAZY
++/*
++ * If TIF_NEED_RESCHED is then we allow to be scheduled away since this is
++ * set by a RT task. Oterwise we try to avoid beeing scheduled out as long as
++ * preempt_lazy_count counter >0.
++ */
++static __always_inline int preemptible_lazy(void)
++{
++ if (test_thread_flag(TIF_NEED_RESCHED))
++ return 1;
++ if (current_thread_info()->preempt_lazy_count)
++ return 0;
++ return 1;
++}
++
++#else
++
++static int preemptible_lazy(void)
++{
++ return 1;
++}
++
++#endif
++
+ #ifdef CONFIG_PREEMPT
+ /*
+ * this is the entry point to schedule() from in-kernel preemption
+@@ -2895,6 +3144,8 @@
+ */
if (likely(!preemptible()))
return;
++ if (!preemptible_lazy())
++ return;
-+#ifdef CONFIG_PREEMPT_LAZY
-+ /*
-+ * Check for lazy preemption
-+ */
-+ if (current_thread_info()->preempt_lazy_count &&
-+ !test_thread_flag(TIF_NEED_RESCHED))
+ preempt_schedule_common();
+ }
+@@ -2922,6 +3173,8 @@
+
+ if (likely(!preemptible()))
+ return;
++ if (!preemptible_lazy())
+ return;
-+#endif
+
do {
__preempt_count_add(PREEMPT_ACTIVE);
- /*
-@@ -2931,7 +3174,16 @@
+@@ -2931,7 +3184,16 @@
* an infinite recursion.
*/
prev_ctx = exception_enter();
@@ -18963,7 +19879,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
exception_exit(prev_ctx);
__preempt_count_sub(PREEMPT_ACTIVE);
-@@ -4268,6 +4520,7 @@
+@@ -4268,6 +4530,7 @@
}
EXPORT_SYMBOL(__cond_resched_lock);
@@ -18971,7 +19887,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
int __sched __cond_resched_softirq(void)
{
BUG_ON(!in_softirq());
-@@ -4281,6 +4534,7 @@
+@@ -4281,6 +4544,7 @@
return 0;
}
EXPORT_SYMBOL(__cond_resched_softirq);
@@ -18979,7 +19895,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
/**
* yield - yield the current processor to other threads.
-@@ -4635,7 +4889,9 @@
+@@ -4635,7 +4899,9 @@
/* Set the preempt count _outside_ the spinlocks! */
init_idle_preempt_count(idle, cpu);
@@ -18990,7 +19906,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
/*
* The idle tasks have their own, simple scheduling class:
*/
-@@ -4755,11 +5011,91 @@
+@@ -4755,11 +5021,91 @@
void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask)
{
@@ -19085,7 +20001,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
}
/*
-@@ -4805,7 +5141,7 @@
+@@ -4805,7 +5151,7 @@
do_set_cpus_allowed(p, new_mask);
/* Can the task run on the task's current CPU? If so, we're done */
@@ -19094,7 +20010,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
goto out;
dest_cpu = cpumask_any_and(cpu_active_mask, new_mask);
-@@ -4945,6 +5281,8 @@
+@@ -4945,6 +5291,8 @@
#ifdef CONFIG_HOTPLUG_CPU
@@ -19103,7 +20019,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
/*
* Ensures that the idle task is using init_mm right before its cpu goes
* offline.
-@@ -4959,7 +5297,11 @@
+@@ -4959,7 +5307,11 @@
switch_mm(mm, &init_mm, current);
finish_arch_post_lock_switch();
}
@@ -19116,7 +20032,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
}
/*
-@@ -5302,6 +5644,10 @@
+@@ -5302,6 +5654,10 @@
case CPU_DEAD:
calc_load_migrate(rq);
@@ -19127,7 +20043,7 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
break;
#endif
}
-@@ -7281,7 +7627,8 @@
+@@ -7281,7 +7637,8 @@
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
static inline int preempt_count_equals(int preempt_offset)
{
@@ -19137,9 +20053,9 @@ diff -Nur linux-4.1.13.orig/kernel/sched/core.c linux-4.1.13/kernel/sched/core.c
return (nested == preempt_offset);
}
-diff -Nur linux-4.1.13.orig/kernel/sched/cputime.c linux-4.1.13/kernel/sched/cputime.c
---- linux-4.1.13.orig/kernel/sched/cputime.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/sched/cputime.c 2015-11-29 09:23:09.645611789 +0100
+diff -Nur linux-4.1.20.orig/kernel/sched/cputime.c linux-4.1.20/kernel/sched/cputime.c
+--- linux-4.1.20.orig/kernel/sched/cputime.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/sched/cputime.c 2016-03-21 20:18:33.000000000 +0100
@@ -675,37 +675,45 @@
void vtime_account_system(struct task_struct *tsk)
@@ -19293,9 +20209,9 @@ diff -Nur linux-4.1.13.orig/kernel/sched/cputime.c linux-4.1.13/kernel/sched/cpu
}
-diff -Nur linux-4.1.13.orig/kernel/sched/deadline.c linux-4.1.13/kernel/sched/deadline.c
---- linux-4.1.13.orig/kernel/sched/deadline.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/sched/deadline.c 2015-11-29 09:23:09.645611789 +0100
+diff -Nur linux-4.1.20.orig/kernel/sched/deadline.c linux-4.1.20/kernel/sched/deadline.c
+--- linux-4.1.20.orig/kernel/sched/deadline.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/sched/deadline.c 2016-03-21 20:18:33.000000000 +0100
@@ -637,6 +637,7 @@
hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
@@ -19304,9 +20220,9 @@ diff -Nur linux-4.1.13.orig/kernel/sched/deadline.c linux-4.1.13/kernel/sched/de
}
static
-diff -Nur linux-4.1.13.orig/kernel/sched/debug.c linux-4.1.13/kernel/sched/debug.c
---- linux-4.1.13.orig/kernel/sched/debug.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/sched/debug.c 2015-11-29 09:23:09.645611789 +0100
+diff -Nur linux-4.1.20.orig/kernel/sched/debug.c linux-4.1.20/kernel/sched/debug.c
+--- linux-4.1.20.orig/kernel/sched/debug.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/sched/debug.c 2016-03-21 20:18:33.000000000 +0100
@@ -260,6 +260,9 @@
P(rt_throttled);
PN(rt_time);
@@ -19328,9 +20244,9 @@ diff -Nur linux-4.1.13.orig/kernel/sched/debug.c linux-4.1.13/kernel/sched/debug
#undef PN
#undef __PN
#undef P
-diff -Nur linux-4.1.13.orig/kernel/sched/fair.c linux-4.1.13/kernel/sched/fair.c
---- linux-4.1.13.orig/kernel/sched/fair.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/sched/fair.c 2015-11-29 09:23:09.645611789 +0100
+diff -Nur linux-4.1.20.orig/kernel/sched/fair.c linux-4.1.20/kernel/sched/fair.c
+--- linux-4.1.20.orig/kernel/sched/fair.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/sched/fair.c 2016-03-21 20:18:33.000000000 +0100
@@ -3201,7 +3201,7 @@
ideal_runtime = sched_slice(cfs_rq, curr);
delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime;
@@ -19403,9 +20319,9 @@ diff -Nur linux-4.1.13.orig/kernel/sched/fair.c linux-4.1.13/kernel/sched/fair.c
} else
check_preempt_curr(rq, p, 0);
}
-diff -Nur linux-4.1.13.orig/kernel/sched/features.h linux-4.1.13/kernel/sched/features.h
---- linux-4.1.13.orig/kernel/sched/features.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/sched/features.h 2015-11-29 09:23:09.645611789 +0100
+diff -Nur linux-4.1.20.orig/kernel/sched/features.h linux-4.1.20/kernel/sched/features.h
+--- linux-4.1.20.orig/kernel/sched/features.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/sched/features.h 2016-03-21 20:18:33.000000000 +0100
@@ -50,11 +50,19 @@
*/
SCHED_FEAT(NONTASK_CAPACITY, true)
@@ -19426,21 +20342,9 @@ diff -Nur linux-4.1.13.orig/kernel/sched/features.h linux-4.1.13/kernel/sched/fe
#ifdef HAVE_RT_PUSH_IPI
/*
-diff -Nur linux-4.1.13.orig/kernel/sched/Makefile linux-4.1.13/kernel/sched/Makefile
---- linux-4.1.13.orig/kernel/sched/Makefile 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/sched/Makefile 2015-11-29 09:23:09.641612055 +0100
-@@ -13,7 +13,7 @@
-
- obj-y += core.o proc.o clock.o cputime.o
- obj-y += idle_task.o fair.o rt.o deadline.o stop_task.o
--obj-y += wait.o completion.o idle.o
-+obj-y += wait.o wait-simple.o work-simple.o completion.o idle.o
- obj-$(CONFIG_SMP) += cpupri.o cpudeadline.o
- obj-$(CONFIG_SCHED_AUTOGROUP) += auto_group.o
- obj-$(CONFIG_SCHEDSTATS) += stats.o
-diff -Nur linux-4.1.13.orig/kernel/sched/rt.c linux-4.1.13/kernel/sched/rt.c
---- linux-4.1.13.orig/kernel/sched/rt.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/sched/rt.c 2015-11-29 09:23:09.645611789 +0100
+diff -Nur linux-4.1.20.orig/kernel/sched/rt.c linux-4.1.20/kernel/sched/rt.c
+--- linux-4.1.20.orig/kernel/sched/rt.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/sched/rt.c 2016-03-21 20:18:33.000000000 +0100
@@ -44,6 +44,7 @@
hrtimer_init(&rt_b->rt_period_timer,
@@ -19457,9 +20361,9 @@ diff -Nur linux-4.1.13.orig/kernel/sched/rt.c linux-4.1.13/kernel/sched/rt.c
#endif
#endif /* CONFIG_SMP */
/* We start is dequeued state, because no RT tasks are queued */
-diff -Nur linux-4.1.13.orig/kernel/sched/sched.h linux-4.1.13/kernel/sched/sched.h
---- linux-4.1.13.orig/kernel/sched/sched.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/sched/sched.h 2015-11-29 09:23:09.645611789 +0100
+diff -Nur linux-4.1.20.orig/kernel/sched/sched.h linux-4.1.20/kernel/sched/sched.h
+--- linux-4.1.20.orig/kernel/sched/sched.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/sched/sched.h 2016-03-21 20:18:33.000000000 +0100
@@ -1093,6 +1093,7 @@
#define WF_SYNC 0x01 /* waker goes to sleep after wakeup */
#define WF_FORK 0x02 /* child wakeup after fork */
@@ -19484,9 +20388,9 @@ diff -Nur linux-4.1.13.orig/kernel/sched/sched.h linux-4.1.13/kernel/sched/sched
extern struct rt_bandwidth def_rt_bandwidth;
extern void init_rt_bandwidth(struct rt_bandwidth *rt_b, u64 period, u64 runtime);
-diff -Nur linux-4.1.13.orig/kernel/sched/wait-simple.c linux-4.1.13/kernel/sched/wait-simple.c
---- linux-4.1.13.orig/kernel/sched/wait-simple.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/kernel/sched/wait-simple.c 2015-11-29 09:23:09.645611789 +0100
+diff -Nur linux-4.1.20.orig/kernel/sched/wait-simple.c linux-4.1.20/kernel/sched/wait-simple.c
+--- linux-4.1.20.orig/kernel/sched/wait-simple.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/kernel/sched/wait-simple.c 2016-03-21 20:18:33.000000000 +0100
@@ -0,0 +1,115 @@
+/*
+ * Simple waitqueues without fancy flags and callbacks
@@ -19603,9 +20507,9 @@ diff -Nur linux-4.1.13.orig/kernel/sched/wait-simple.c linux-4.1.13/kernel/sched
+ return woken;
+}
+EXPORT_SYMBOL(__swait_wake);
-diff -Nur linux-4.1.13.orig/kernel/sched/work-simple.c linux-4.1.13/kernel/sched/work-simple.c
---- linux-4.1.13.orig/kernel/sched/work-simple.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/kernel/sched/work-simple.c 2015-11-29 09:23:09.645611789 +0100
+diff -Nur linux-4.1.20.orig/kernel/sched/work-simple.c linux-4.1.20/kernel/sched/work-simple.c
+--- linux-4.1.20.orig/kernel/sched/work-simple.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/kernel/sched/work-simple.c 2016-03-21 20:18:33.000000000 +0100
@@ -0,0 +1,173 @@
+/*
+ * Copyright (C) 2014 BMW Car IT GmbH, Daniel Wagner daniel.wagner@bmw-carit.de
@@ -19780,9 +20684,9 @@ diff -Nur linux-4.1.13.orig/kernel/sched/work-simple.c linux-4.1.13/kernel/sched
+ mutex_unlock(&worker_mutex);
+}
+EXPORT_SYMBOL_GPL(swork_put);
-diff -Nur linux-4.1.13.orig/kernel/signal.c linux-4.1.13/kernel/signal.c
---- linux-4.1.13.orig/kernel/signal.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/signal.c 2015-11-29 09:23:09.649611524 +0100
+diff -Nur linux-4.1.20.orig/kernel/signal.c linux-4.1.20/kernel/signal.c
+--- linux-4.1.20.orig/kernel/signal.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/signal.c 2016-03-21 20:18:33.000000000 +0100
@@ -14,6 +14,7 @@
#include <linux/export.h>
#include <linux/init.h>
@@ -20027,9 +20931,9 @@ diff -Nur linux-4.1.13.orig/kernel/signal.c linux-4.1.13/kernel/signal.c
freezable_schedule();
} else {
/*
-diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
---- linux-4.1.13.orig/kernel/softirq.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/softirq.c 2015-11-29 09:23:09.649611524 +0100
+diff -Nur linux-4.1.20.orig/kernel/softirq.c linux-4.1.20/kernel/softirq.c
+--- linux-4.1.20.orig/kernel/softirq.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/softirq.c 2016-03-21 20:18:33.000000000 +0100
@@ -21,10 +21,12 @@
#include <linux/freezer.h>
#include <linux/kthread.h>
@@ -20043,7 +20947,17 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
#include <linux/irq.h>
#define CREATE_TRACE_POINTS
-@@ -62,6 +64,98 @@
+@@ -56,12 +58,108 @@
+ static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp;
+
+ DEFINE_PER_CPU(struct task_struct *, ksoftirqd);
++#ifdef CONFIG_PREEMPT_RT_FULL
++#define TIMER_SOFTIRQS ((1 << TIMER_SOFTIRQ) | (1 << HRTIMER_SOFTIRQ))
++DEFINE_PER_CPU(struct task_struct *, ktimer_softirqd);
++#endif
+
+ const char * const softirq_to_name[NR_SOFTIRQS] = {
+ "HI", "TIMER", "NET_TX", "NET_RX", "BLOCK", "BLOCK_IOPOLL",
"TASKLET", "SCHED", "HRTIMER", "RCU"
};
@@ -20142,10 +21056,21 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
/*
* we cannot loop indefinitely here to avoid userspace starvation,
* but we also don't want to introduce a worst case 1/HZ latency
-@@ -77,6 +171,68 @@
+@@ -77,6 +175,79 @@
wake_up_process(tsk);
}
++#ifdef CONFIG_PREEMPT_RT_FULL
++static void wakeup_timer_softirqd(void)
++{
++ /* Interrupts are disabled: no need to stop preemption */
++ struct task_struct *tsk = __this_cpu_read(ktimer_softirqd);
++
++ if (tsk && tsk->state != TASK_RUNNING)
++ wake_up_process(tsk);
++}
++#endif
++
+static void handle_softirq(unsigned int vec_nr)
+{
+ struct softirq_action *h = softirq_vec + vec_nr;
@@ -20211,7 +21136,19 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
/*
* preempt_count and SOFTIRQ_OFFSET usage:
* - preempt_count is changed by SOFTIRQ_OFFSET on entering or leaving
-@@ -232,10 +388,8 @@
+@@ -116,9 +287,9 @@
+
+ if (preempt_count() == cnt) {
+ #ifdef CONFIG_DEBUG_PREEMPT
+- current->preempt_disable_ip = get_parent_ip(CALLER_ADDR1);
++ current->preempt_disable_ip = get_lock_parent_ip();
+ #endif
+- trace_preempt_off(CALLER_ADDR0, get_parent_ip(CALLER_ADDR1));
++ trace_preempt_off(CALLER_ADDR0, get_lock_parent_ip());
+ }
+ }
+ EXPORT_SYMBOL(__local_bh_disable_ip);
+@@ -232,10 +403,8 @@
unsigned long end = jiffies + MAX_SOFTIRQ_TIME;
unsigned long old_flags = current->flags;
int max_restart = MAX_SOFTIRQ_RESTART;
@@ -20222,7 +21159,7 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
/*
* Mask out PF_MEMALLOC s current task context is borrowed for the
-@@ -254,36 +408,7 @@
+@@ -254,36 +423,7 @@
/* Reset the pending bitmask before enabling irqs */
set_softirq_pending(0);
@@ -20260,7 +21197,7 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
pending = local_softirq_pending();
if (pending) {
-@@ -320,6 +445,255 @@
+@@ -320,6 +460,310 @@
}
/*
@@ -20292,7 +21229,6 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
+static inline void local_bh_disable_nort(void) { local_bh_disable(); }
+static inline void _local_bh_enable_nort(void) { _local_bh_enable(); }
+static void ksoftirqd_set_sched_params(unsigned int cpu) { }
-+static void ksoftirqd_clr_sched_params(unsigned int cpu, bool online) { }
+
+#else /* !PREEMPT_RT_FULL */
+
@@ -20368,8 +21304,10 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
+ do_single_softirq(i);
+ }
+ softirq_clr_runner(i);
-+ unlock_softirq(i);
+ WARN_ON(current->softirq_nestcnt != 1);
++ local_irq_enable();
++ unlock_softirq(i);
++ local_irq_disable();
+ }
+}
+
@@ -20418,8 +21356,8 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
+
+ do_current_softirqs();
+ current->softirq_nestcnt--;
-+ rcu_note_context_switch();
+ local_irq_enable();
++ cond_resched_rcu_qs();
+}
+
+/*
@@ -20437,8 +21375,12 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
+
+static void do_raise_softirq_irqoff(unsigned int nr)
+{
++ unsigned int mask;
++
++ mask = 1UL << nr;
++
+ trace_softirq_raise(nr);
-+ or_softirq_pending(1UL << nr);
++ or_softirq_pending(mask);
+
+ /*
+ * If we are not in a hard interrupt and inside a bh disabled
@@ -20447,16 +21389,51 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
+ * delegate it to ksoftirqd.
+ */
+ if (!in_irq() && current->softirq_nestcnt)
-+ current->softirqs_raised |= (1U << nr);
-+ else if (__this_cpu_read(ksoftirqd))
-+ __this_cpu_read(ksoftirqd)->softirqs_raised |= (1U << nr);
++ current->softirqs_raised |= mask;
++ else if (!__this_cpu_read(ksoftirqd) || !__this_cpu_read(ktimer_softirqd))
++ return;
++
++ if (mask & TIMER_SOFTIRQS)
++ __this_cpu_read(ktimer_softirqd)->softirqs_raised |= mask;
++ else
++ __this_cpu_read(ksoftirqd)->softirqs_raised |= mask;
+}
+
++static void wakeup_proper_softirq(unsigned int nr)
++{
++ if ((1UL << nr) & TIMER_SOFTIRQS)
++ wakeup_timer_softirqd();
++ else
++ wakeup_softirqd();
++}
++
++
+void __raise_softirq_irqoff(unsigned int nr)
+{
+ do_raise_softirq_irqoff(nr);
+ if (!in_irq() && !current->softirq_nestcnt)
-+ wakeup_softirqd();
++ wakeup_proper_softirq(nr);
++}
++
++/*
++ * Same as __raise_softirq_irqoff() but will process them in ksoftirqd
++ */
++void __raise_softirq_irqoff_ksoft(unsigned int nr)
++{
++ unsigned int mask;
++
++ if (WARN_ON_ONCE(!__this_cpu_read(ksoftirqd) ||
++ !__this_cpu_read(ktimer_softirqd)))
++ return;
++ mask = 1UL << nr;
++
++ trace_softirq_raise(nr);
++ or_softirq_pending(mask);
++ if (mask & TIMER_SOFTIRQS)
++ __this_cpu_read(ktimer_softirqd)->softirqs_raised |= mask;
++ else
++ __this_cpu_read(ksoftirqd)->softirqs_raised |= mask;
++ wakeup_proper_softirq(nr);
+}
+
+/*
@@ -20482,7 +21459,7 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
+ * raise a WARN() if the condition is met.
+ */
+ if (!current->softirq_nestcnt)
-+ wakeup_softirqd();
++ wakeup_proper_softirq(nr);
+}
+
+static inline int ksoftirqd_softirq_pending(void)
@@ -20495,28 +21472,43 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
+
+static inline void ksoftirqd_set_sched_params(unsigned int cpu)
+{
++ /* Take over all but timer pending softirqs when starting */
++ local_irq_disable();
++ current->softirqs_raised = local_softirq_pending() & ~TIMER_SOFTIRQS;
++ local_irq_enable();
++}
++
++static inline void ktimer_softirqd_set_sched_params(unsigned int cpu)
++{
+ struct sched_param param = { .sched_priority = 1 };
+
+ sched_setscheduler(current, SCHED_FIFO, &param);
-+ /* Take over all pending softirqs when starting */
++
++ /* Take over timer pending softirqs when starting */
+ local_irq_disable();
-+ current->softirqs_raised = local_softirq_pending();
++ current->softirqs_raised = local_softirq_pending() & TIMER_SOFTIRQS;
+ local_irq_enable();
+}
+
-+static inline void ksoftirqd_clr_sched_params(unsigned int cpu, bool online)
++static inline void ktimer_softirqd_clr_sched_params(unsigned int cpu,
++ bool online)
+{
+ struct sched_param param = { .sched_priority = 0 };
+
+ sched_setscheduler(current, SCHED_NORMAL, &param);
+}
+
++static int ktimer_softirqd_should_run(unsigned int cpu)
++{
++ return current->softirqs_raised;
++}
++
+#endif /* PREEMPT_RT_FULL */
+/*
* Enter an interrupt context.
*/
void irq_enter(void)
-@@ -330,9 +704,9 @@
+@@ -330,9 +774,9 @@
* Prevent raise_softirq from needlessly waking up ksoftirqd
* here, as softirq will be serviced on return from interrupt.
*/
@@ -20528,7 +21520,7 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
}
__irq_enter();
-@@ -340,6 +714,7 @@
+@@ -340,6 +784,7 @@
static inline void invoke_softirq(void)
{
@@ -20536,7 +21528,7 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
if (!force_irqthreads) {
#ifdef CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK
/*
-@@ -359,6 +734,15 @@
+@@ -359,6 +804,18 @@
} else {
wakeup_softirqd();
}
@@ -20547,12 +21539,15 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
+ if (__this_cpu_read(ksoftirqd) &&
+ __this_cpu_read(ksoftirqd)->softirqs_raised)
+ wakeup_softirqd();
++ if (__this_cpu_read(ktimer_softirqd) &&
++ __this_cpu_read(ktimer_softirqd)->softirqs_raised)
++ wakeup_timer_softirqd();
+ local_irq_restore(flags);
+#endif
}
static inline void tick_irq_exit(void)
-@@ -395,26 +779,6 @@
+@@ -395,26 +852,6 @@
trace_hardirq_exit(); /* must be last! */
}
@@ -20579,7 +21574,7 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
void raise_softirq(unsigned int nr)
{
unsigned long flags;
-@@ -424,12 +788,6 @@
+@@ -424,12 +861,6 @@
local_irq_restore(flags);
}
@@ -20592,7 +21587,7 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
void open_softirq(int nr, void (*action)(struct softirq_action *))
{
softirq_vec[nr].action = action;
-@@ -446,15 +804,45 @@
+@@ -446,15 +877,45 @@
static DEFINE_PER_CPU(struct tasklet_head, tasklet_vec);
static DEFINE_PER_CPU(struct tasklet_head, tasklet_hi_vec);
@@ -20642,7 +21637,7 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
local_irq_restore(flags);
}
EXPORT_SYMBOL(__tasklet_schedule);
-@@ -464,10 +852,7 @@
+@@ -464,10 +925,7 @@
unsigned long flags;
local_irq_save(flags);
@@ -20654,7 +21649,7 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
local_irq_restore(flags);
}
EXPORT_SYMBOL(__tasklet_hi_schedule);
-@@ -476,82 +861,122 @@
+@@ -476,82 +934,122 @@
{
BUG_ON(!irqs_disabled());
@@ -20826,7 +21821,7 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
}
void tasklet_init(struct tasklet_struct *t,
-@@ -572,7 +997,7 @@
+@@ -572,7 +1070,7 @@
while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) {
do {
@@ -20835,19 +21830,19 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
} while (test_bit(TASKLET_STATE_SCHED, &t->state));
}
tasklet_unlock_wait(t);
-@@ -646,25 +1071,26 @@
+@@ -646,25 +1144,26 @@
open_softirq(HI_SOFTIRQ, tasklet_hi_action);
}
-static int ksoftirqd_should_run(unsigned int cpu)
-+#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT_FULL)
-+void tasklet_unlock_wait(struct tasklet_struct *t)
- {
+-{
- return local_softirq_pending();
-}
-
-static void run_ksoftirqd(unsigned int cpu)
--{
++#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT_FULL)
++void tasklet_unlock_wait(struct tasklet_struct *t)
+ {
- local_irq_disable();
- if (local_softirq_pending()) {
+ while (test_bit(TASKLET_STATE_RUN, &(t)->state)) {
@@ -20877,26 +21872,43 @@ diff -Nur linux-4.1.13.orig/kernel/softirq.c linux-4.1.13/kernel/softirq.c
}
#ifdef CONFIG_HOTPLUG_CPU
-@@ -746,6 +1172,8 @@
+@@ -746,16 +1245,31 @@
static struct smp_hotplug_thread softirq_threads = {
.store = &ksoftirqd,
+ .setup = ksoftirqd_set_sched_params,
-+ .cleanup = ksoftirqd_clr_sched_params,
.thread_should_run = ksoftirqd_should_run,
.thread_fn = run_ksoftirqd,
.thread_comm = "ksoftirqd/%u",
-diff -Nur linux-4.1.13.orig/kernel/stop_machine.c linux-4.1.13/kernel/stop_machine.c
---- linux-4.1.13.orig/kernel/stop_machine.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/stop_machine.c 2015-11-29 09:23:09.649611524 +0100
-@@ -30,12 +30,12 @@
- atomic_t nr_todo; /* nr left to execute */
- bool executed; /* actually executed? */
- int ret; /* collected return value */
-- struct completion completion; /* fired if nr_todo reaches 0 */
-+ struct task_struct *waiter; /* woken when nr_todo reaches 0 */
};
++#ifdef CONFIG_PREEMPT_RT_FULL
++static struct smp_hotplug_thread softirq_timer_threads = {
++ .store = &ktimer_softirqd,
++ .setup = ktimer_softirqd_set_sched_params,
++ .cleanup = ktimer_softirqd_clr_sched_params,
++ .thread_should_run = ktimer_softirqd_should_run,
++ .thread_fn = run_ksoftirqd,
++ .thread_comm = "ktimersoftd/%u",
++};
++#endif
++
+ static __init int spawn_ksoftirqd(void)
+ {
+ register_cpu_notifier(&cpu_nfb);
+
+ BUG_ON(smpboot_register_percpu_thread(&softirq_threads));
++#ifdef CONFIG_PREEMPT_RT_FULL
++ BUG_ON(smpboot_register_percpu_thread(&softirq_timer_threads));
++#endif
+
+ return 0;
+ }
+diff -Nur linux-4.1.20.orig/kernel/stop_machine.c linux-4.1.20/kernel/stop_machine.c
+--- linux-4.1.20.orig/kernel/stop_machine.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/stop_machine.c 2016-03-21 20:18:33.000000000 +0100
+@@ -35,7 +35,7 @@
+
/* the actual stopper, one per every possible cpu, enabled on online cpus */
struct cpu_stopper {
- spinlock_t lock;
@@ -20904,29 +21916,7 @@ diff -Nur linux-4.1.13.orig/kernel/stop_machine.c linux-4.1.13/kernel/stop_machi
bool enabled; /* is this stopper enabled? */
struct list_head works; /* list of pending works */
};
-@@ -56,7 +56,7 @@
- {
- memset(done, 0, sizeof(*done));
- atomic_set(&done->nr_todo, nr_todo);
-- init_completion(&done->completion);
-+ done->waiter = current;
- }
-
- /* signal completion unless @done is NULL */
-@@ -65,8 +65,10 @@
- if (done) {
- if (executed)
- done->executed = true;
-- if (atomic_dec_and_test(&done->nr_todo))
-- complete(&done->completion);
-+ if (atomic_dec_and_test(&done->nr_todo)) {
-+ wake_up_process(done->waiter);
-+ done->waiter = NULL;
-+ }
- }
- }
-
-@@ -78,7 +80,7 @@
+@@ -78,7 +78,7 @@
unsigned long flags;
@@ -20935,41 +21925,16 @@ diff -Nur linux-4.1.13.orig/kernel/stop_machine.c linux-4.1.13/kernel/stop_machi
if (stopper->enabled) {
list_add_tail(&work->list, &stopper->works);
-@@ -86,7 +88,23 @@
+@@ -86,7 +86,7 @@
} else
cpu_stop_signal_done(work->done, false);
- spin_unlock_irqrestore(&stopper->lock, flags);
+ raw_spin_unlock_irqrestore(&stopper->lock, flags);
-+}
-+
-+static void wait_for_stop_done(struct cpu_stop_done *done)
-+{
-+ set_current_state(TASK_UNINTERRUPTIBLE);
-+ while (atomic_read(&done->nr_todo)) {
-+ schedule();
-+ set_current_state(TASK_UNINTERRUPTIBLE);
-+ }
-+ /*
-+ * We need to wait until cpu_stop_signal_done() has cleared
-+ * done->waiter.
-+ */
-+ while (done->waiter)
-+ cpu_relax();
-+ set_current_state(TASK_RUNNING);
}
/**
-@@ -120,7 +138,7 @@
-
- cpu_stop_init_done(&done, 1);
- cpu_stop_queue_work(cpu, &work);
-- wait_for_completion(&done.completion);
-+ wait_for_stop_done(&done);
- return done.executed ? done.ret : -ENOENT;
- }
-
-@@ -248,7 +266,7 @@
+@@ -248,7 +248,7 @@
struct irq_cpu_stop_queue_work_info call_args;
struct multi_stop_data msdata;
@@ -20978,7 +21943,7 @@ diff -Nur linux-4.1.13.orig/kernel/stop_machine.c linux-4.1.13/kernel/stop_machi
msdata = (struct multi_stop_data){
.fn = fn,
.data = arg,
-@@ -281,7 +299,7 @@
+@@ -281,7 +281,7 @@
* This relies on the stopper workqueues to be FIFO.
*/
if (!cpu_active(cpu1) || !cpu_active(cpu2)) {
@@ -20987,19 +21952,16 @@ diff -Nur linux-4.1.13.orig/kernel/stop_machine.c linux-4.1.13/kernel/stop_machi
return -ENOENT;
}
-@@ -295,9 +313,9 @@
+@@ -295,7 +295,7 @@
&irq_cpu_stop_queue_work,
&call_args, 1);
lg_local_unlock(&stop_cpus_lock);
- preempt_enable();
+ preempt_enable_nort();
-- wait_for_completion(&done.completion);
-+ wait_for_stop_done(&done);
+ wait_for_completion(&done.completion);
- return done.executed ? done.ret : -ENOENT;
- }
-@@ -329,7 +347,7 @@
+@@ -329,7 +329,7 @@
static void queue_stop_cpus_work(const struct cpumask *cpumask,
cpu_stop_fn_t fn, void *arg,
@@ -21008,7 +21970,7 @@ diff -Nur linux-4.1.13.orig/kernel/stop_machine.c linux-4.1.13/kernel/stop_machi
{
struct cpu_stop_work *work;
unsigned int cpu;
-@@ -343,11 +361,13 @@
+@@ -343,11 +343,13 @@
}
/*
@@ -21026,18 +21988,16 @@ diff -Nur linux-4.1.13.orig/kernel/stop_machine.c linux-4.1.13/kernel/stop_machi
for_each_cpu(cpu, cpumask)
cpu_stop_queue_work(cpu, &per_cpu(stop_cpus_work, cpu));
lg_global_unlock(&stop_cpus_lock);
-@@ -359,8 +379,8 @@
+@@ -359,7 +361,7 @@
struct cpu_stop_done done;
cpu_stop_init_done(&done, cpumask_weight(cpumask));
- queue_stop_cpus_work(cpumask, fn, arg, &done);
-- wait_for_completion(&done.completion);
+ queue_stop_cpus_work(cpumask, fn, arg, &done, false);
-+ wait_for_stop_done(&done);
+ wait_for_completion(&done.completion);
return done.executed ? done.ret : -ENOENT;
}
-
-@@ -439,9 +459,9 @@
+@@ -439,9 +441,9 @@
unsigned long flags;
int run;
@@ -21049,7 +22009,7 @@ diff -Nur linux-4.1.13.orig/kernel/stop_machine.c linux-4.1.13/kernel/stop_machi
return run;
}
-@@ -453,13 +473,13 @@
+@@ -453,13 +455,13 @@
repeat:
work = NULL;
@@ -21065,7 +22025,7 @@ diff -Nur linux-4.1.13.orig/kernel/stop_machine.c linux-4.1.13/kernel/stop_machi
if (work) {
cpu_stop_fn_t fn = work->fn;
-@@ -467,6 +487,16 @@
+@@ -467,6 +469,16 @@
struct cpu_stop_done *done = work->done;
char ksym_buf[KSYM_NAME_LEN] __maybe_unused;
@@ -21082,21 +22042,7 @@ diff -Nur linux-4.1.13.orig/kernel/stop_machine.c linux-4.1.13/kernel/stop_machi
/* cpu stop callbacks are not allowed to sleep */
preempt_disable();
-@@ -481,7 +511,13 @@
- kallsyms_lookup((unsigned long)fn, NULL, NULL, NULL,
- ksym_buf), arg);
-
-+ /*
-+ * Make sure that the wakeup and setting done->waiter
-+ * to NULL is atomic.
-+ */
-+ local_irq_disable();
- cpu_stop_signal_done(done, true);
-+ local_irq_enable();
- goto repeat;
- }
- }
-@@ -500,20 +536,20 @@
+@@ -500,20 +512,20 @@
unsigned long flags;
/* drain remaining works */
@@ -21121,7 +22067,7 @@ diff -Nur linux-4.1.13.orig/kernel/stop_machine.c linux-4.1.13/kernel/stop_machi
}
static struct smp_hotplug_thread cpu_stop_threads = {
-@@ -535,10 +571,12 @@
+@@ -535,10 +547,12 @@
for_each_possible_cpu(cpu) {
struct cpu_stopper *stopper = &per_cpu(cpu_stopper, cpu);
@@ -21135,7 +22081,7 @@ diff -Nur linux-4.1.13.orig/kernel/stop_machine.c linux-4.1.13/kernel/stop_machi
BUG_ON(smpboot_register_percpu_thread(&cpu_stop_threads));
stop_machine_initialized = true;
return 0;
-@@ -634,11 +672,11 @@
+@@ -634,7 +648,7 @@
set_state(&msdata, MULTI_STOP_PREPARE);
cpu_stop_init_done(&done, num_active_cpus());
queue_stop_cpus_work(cpu_active_mask, multi_cpu_stop, &msdata,
@@ -21144,14 +22090,9 @@ diff -Nur linux-4.1.13.orig/kernel/stop_machine.c linux-4.1.13/kernel/stop_machi
ret = multi_cpu_stop(&msdata);
/* Busy wait for completion. */
-- while (!completion_done(&done.completion))
-+ while (atomic_read(&done.nr_todo))
- cpu_relax();
-
- mutex_unlock(&stop_cpus_mutex);
-diff -Nur linux-4.1.13.orig/kernel/time/hrtimer.c linux-4.1.13/kernel/time/hrtimer.c
---- linux-4.1.13.orig/kernel/time/hrtimer.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/time/hrtimer.c 2015-11-29 09:23:09.649611524 +0100
+diff -Nur linux-4.1.20.orig/kernel/time/hrtimer.c linux-4.1.20/kernel/time/hrtimer.c
+--- linux-4.1.20.orig/kernel/time/hrtimer.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/time/hrtimer.c 2016-03-21 20:18:33.000000000 +0100
@@ -48,11 +48,13 @@
#include <linux/sched/rt.h>
#include <linux/sched/deadline.h>
@@ -21756,9 +22697,9 @@ diff -Nur linux-4.1.13.orig/kernel/time/hrtimer.c linux-4.1.13/kernel/time/hrtim
}
/**
-diff -Nur linux-4.1.13.orig/kernel/time/itimer.c linux-4.1.13/kernel/time/itimer.c
---- linux-4.1.13.orig/kernel/time/itimer.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/time/itimer.c 2015-11-29 09:23:09.649611524 +0100
+diff -Nur linux-4.1.20.orig/kernel/time/itimer.c linux-4.1.20/kernel/time/itimer.c
+--- linux-4.1.20.orig/kernel/time/itimer.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/time/itimer.c 2016-03-21 20:18:33.000000000 +0100
@@ -213,6 +213,7 @@
/* We are sharing ->siglock with it_real_fn() */
if (hrtimer_try_to_cancel(timer) < 0) {
@@ -21767,9 +22708,9 @@ diff -Nur linux-4.1.13.orig/kernel/time/itimer.c linux-4.1.13/kernel/time/itimer
goto again;
}
expires = timeval_to_ktime(value->it_value);
-diff -Nur linux-4.1.13.orig/kernel/time/jiffies.c linux-4.1.13/kernel/time/jiffies.c
---- linux-4.1.13.orig/kernel/time/jiffies.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/time/jiffies.c 2015-11-29 09:23:09.649611524 +0100
+diff -Nur linux-4.1.20.orig/kernel/time/jiffies.c linux-4.1.20/kernel/time/jiffies.c
+--- linux-4.1.20.orig/kernel/time/jiffies.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/time/jiffies.c 2016-03-21 20:18:33.000000000 +0100
@@ -74,7 +74,8 @@
.max_cycles = 10,
};
@@ -21792,9 +22733,9 @@ diff -Nur linux-4.1.13.orig/kernel/time/jiffies.c linux-4.1.13/kernel/time/jiffi
return ret;
}
EXPORT_SYMBOL(get_jiffies_64);
-diff -Nur linux-4.1.13.orig/kernel/time/ntp.c linux-4.1.13/kernel/time/ntp.c
---- linux-4.1.13.orig/kernel/time/ntp.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/time/ntp.c 2015-11-29 09:23:09.649611524 +0100
+diff -Nur linux-4.1.20.orig/kernel/time/ntp.c linux-4.1.20/kernel/time/ntp.c
+--- linux-4.1.20.orig/kernel/time/ntp.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/time/ntp.c 2016-03-21 20:18:33.000000000 +0100
@@ -10,6 +10,7 @@
#include <linux/workqueue.h>
#include <linux/hrtimer.h>
@@ -21856,9 +22797,9 @@ diff -Nur linux-4.1.13.orig/kernel/time/ntp.c linux-4.1.13/kernel/time/ntp.c
#else
void ntp_notify_cmos_timer(void) { }
-diff -Nur linux-4.1.13.orig/kernel/time/posix-cpu-timers.c linux-4.1.13/kernel/time/posix-cpu-timers.c
---- linux-4.1.13.orig/kernel/time/posix-cpu-timers.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/time/posix-cpu-timers.c 2015-11-29 09:23:09.649611524 +0100
+diff -Nur linux-4.1.20.orig/kernel/time/posix-cpu-timers.c linux-4.1.20/kernel/time/posix-cpu-timers.c
+--- linux-4.1.20.orig/kernel/time/posix-cpu-timers.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/time/posix-cpu-timers.c 2016-03-21 20:18:33.000000000 +0100
@@ -3,6 +3,7 @@
*/
@@ -22106,9 +23047,9 @@ diff -Nur linux-4.1.13.orig/kernel/time/posix-cpu-timers.c linux-4.1.13/kernel/t
/*
* Set one of the process-wide special case CPU timers or RLIMIT_CPU.
* The tsk->sighand->siglock must be held by the caller.
-diff -Nur linux-4.1.13.orig/kernel/time/posix-timers.c linux-4.1.13/kernel/time/posix-timers.c
---- linux-4.1.13.orig/kernel/time/posix-timers.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/time/posix-timers.c 2015-11-29 09:23:09.649611524 +0100
+diff -Nur linux-4.1.20.orig/kernel/time/posix-timers.c linux-4.1.20/kernel/time/posix-timers.c
+--- linux-4.1.20.orig/kernel/time/posix-timers.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/time/posix-timers.c 2016-03-21 20:18:34.000000000 +0100
@@ -499,6 +499,7 @@
static struct pid *good_sigevent(sigevent_t * event)
{
@@ -22204,9 +23145,19 @@ diff -Nur linux-4.1.13.orig/kernel/time/posix-timers.c linux-4.1.13/kernel/time/
goto retry_delete;
}
list_del(&timer->list);
-diff -Nur linux-4.1.13.orig/kernel/time/tick-common.c linux-4.1.13/kernel/time/tick-common.c
---- linux-4.1.13.orig/kernel/time/tick-common.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/time/tick-common.c 2015-11-29 09:23:09.649611524 +0100
+diff -Nur linux-4.1.20.orig/kernel/time/tick-broadcast-hrtimer.c linux-4.1.20/kernel/time/tick-broadcast-hrtimer.c
+--- linux-4.1.20.orig/kernel/time/tick-broadcast-hrtimer.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/time/tick-broadcast-hrtimer.c 2016-03-21 20:18:34.000000000 +0100
+@@ -109,5 +109,6 @@
+ {
+ hrtimer_init(&bctimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
+ bctimer.function = bc_handler;
++ bctimer.irqsafe = true;
+ clockevents_register_device(&ce_broadcast_hrtimer);
+ }
+diff -Nur linux-4.1.20.orig/kernel/time/tick-common.c linux-4.1.20/kernel/time/tick-common.c
+--- linux-4.1.20.orig/kernel/time/tick-common.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/time/tick-common.c 2016-03-21 20:18:34.000000000 +0100
@@ -78,13 +78,15 @@
static void tick_periodic(int cpu)
{
@@ -22237,9 +23188,9 @@ diff -Nur linux-4.1.13.orig/kernel/time/tick-common.c linux-4.1.13/kernel/time/t
clockevents_set_state(dev, CLOCK_EVT_STATE_ONESHOT);
-diff -Nur linux-4.1.13.orig/kernel/time/tick-sched.c linux-4.1.13/kernel/time/tick-sched.c
---- linux-4.1.13.orig/kernel/time/tick-sched.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/time/tick-sched.c 2015-11-29 09:23:09.649611524 +0100
+diff -Nur linux-4.1.20.orig/kernel/time/tick-sched.c linux-4.1.20/kernel/time/tick-sched.c
+--- linux-4.1.20.orig/kernel/time/tick-sched.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/time/tick-sched.c 2016-03-21 20:18:34.000000000 +0100
@@ -62,7 +62,8 @@
return;
@@ -22339,10 +23290,10 @@ diff -Nur linux-4.1.13.orig/kernel/time/tick-sched.c linux-4.1.13/kernel/time/ti
ts->sched_timer.function = tick_sched_timer;
/* Get the next period (per cpu) */
-diff -Nur linux-4.1.13.orig/kernel/time/timekeeping.c linux-4.1.13/kernel/time/timekeeping.c
---- linux-4.1.13.orig/kernel/time/timekeeping.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/time/timekeeping.c 2015-11-29 09:23:09.649611524 +0100
-@@ -2065,8 +2065,10 @@
+diff -Nur linux-4.1.20.orig/kernel/time/timekeeping.c linux-4.1.20/kernel/time/timekeeping.c
+--- linux-4.1.20.orig/kernel/time/timekeeping.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/time/timekeeping.c 2016-03-21 20:18:34.000000000 +0100
+@@ -2064,8 +2064,10 @@
*/
void xtime_update(unsigned long ticks)
{
@@ -22355,9 +23306,9 @@ diff -Nur linux-4.1.13.orig/kernel/time/timekeeping.c linux-4.1.13/kernel/time/t
+ raw_spin_unlock(&jiffies_lock);
update_wall_time();
}
-diff -Nur linux-4.1.13.orig/kernel/time/timekeeping.h linux-4.1.13/kernel/time/timekeeping.h
---- linux-4.1.13.orig/kernel/time/timekeeping.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/time/timekeeping.h 2015-11-29 09:23:09.653611260 +0100
+diff -Nur linux-4.1.20.orig/kernel/time/timekeeping.h linux-4.1.20/kernel/time/timekeeping.h
+--- linux-4.1.20.orig/kernel/time/timekeeping.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/time/timekeeping.h 2016-03-21 20:18:34.000000000 +0100
@@ -22,7 +22,8 @@
extern void do_timer(unsigned long ticks);
extern void update_wall_time(void);
@@ -22368,9 +23319,9 @@ diff -Nur linux-4.1.13.orig/kernel/time/timekeeping.h linux-4.1.13/kernel/time/t
#define CS_NAME_LEN 32
-diff -Nur linux-4.1.13.orig/kernel/time/timer.c linux-4.1.13/kernel/time/timer.c
---- linux-4.1.13.orig/kernel/time/timer.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/time/timer.c 2015-11-29 09:23:09.653611260 +0100
+diff -Nur linux-4.1.20.orig/kernel/time/timer.c linux-4.1.20/kernel/time/timer.c
+--- linux-4.1.20.orig/kernel/time/timer.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/time/timer.c 2016-03-21 20:18:34.000000000 +0100
@@ -78,6 +78,9 @@
struct tvec_base {
spinlock_t lock;
@@ -22570,9 +23521,9 @@ diff -Nur linux-4.1.13.orig/kernel/time/timer.c linux-4.1.13/kernel/time/timer.c
for (j = 0; j < TVN_SIZE; j++) {
INIT_LIST_HEAD(base->tv5.vec + j);
-diff -Nur linux-4.1.13.orig/kernel/trace/Kconfig linux-4.1.13/kernel/trace/Kconfig
---- linux-4.1.13.orig/kernel/trace/Kconfig 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/trace/Kconfig 2015-11-29 09:23:09.653611260 +0100
+diff -Nur linux-4.1.20.orig/kernel/trace/Kconfig linux-4.1.20/kernel/trace/Kconfig
+--- linux-4.1.20.orig/kernel/trace/Kconfig 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/trace/Kconfig 2016-03-21 20:18:34.000000000 +0100
@@ -187,6 +187,24 @@
enabled. This option and the preempt-off timing option can be
used together or separately.)
@@ -22698,9 +23649,23 @@ diff -Nur linux-4.1.13.orig/kernel/trace/Kconfig linux-4.1.13/kernel/trace/Kconf
config ENABLE_DEFAULT_TRACERS
bool "Trace process context switches and events"
depends on !GENERIC_TRACER
-diff -Nur linux-4.1.13.orig/kernel/trace/latency_hist.c linux-4.1.13/kernel/trace/latency_hist.c
---- linux-4.1.13.orig/kernel/trace/latency_hist.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-4.1.13/kernel/trace/latency_hist.c 2015-11-29 09:23:09.653611260 +0100
+diff -Nur linux-4.1.20.orig/kernel/trace/Makefile linux-4.1.20/kernel/trace/Makefile
+--- linux-4.1.20.orig/kernel/trace/Makefile 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/trace/Makefile 2016-03-21 20:18:34.000000000 +0100
+@@ -36,6 +36,10 @@
+ obj-$(CONFIG_IRQSOFF_TRACER) += trace_irqsoff.o
+ obj-$(CONFIG_PREEMPT_TRACER) += trace_irqsoff.o
+ obj-$(CONFIG_SCHED_TRACER) += trace_sched_wakeup.o
++obj-$(CONFIG_INTERRUPT_OFF_HIST) += latency_hist.o
++obj-$(CONFIG_PREEMPT_OFF_HIST) += latency_hist.o
++obj-$(CONFIG_WAKEUP_LATENCY_HIST) += latency_hist.o
++obj-$(CONFIG_MISSED_TIMER_OFFSETS_HIST) += latency_hist.o
+ obj-$(CONFIG_NOP_TRACER) += trace_nop.o
+ obj-$(CONFIG_STACK_TRACER) += trace_stack.o
+ obj-$(CONFIG_MMIOTRACE) += trace_mmiotrace.o
+diff -Nur linux-4.1.20.orig/kernel/trace/latency_hist.c linux-4.1.20/kernel/trace/latency_hist.c
+--- linux-4.1.20.orig/kernel/trace/latency_hist.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/kernel/trace/latency_hist.c 2016-03-21 20:18:34.000000000 +0100
@@ -0,0 +1,1178 @@
+/*
+ * kernel/trace/latency_hist.c
@@ -23880,23 +24845,9 @@ diff -Nur linux-4.1.13.orig/kernel/trace/latency_hist.c linux-4.1.13/kernel/trac
+}
+
+device_initcall(latency_hist_init);
-diff -Nur linux-4.1.13.orig/kernel/trace/Makefile linux-4.1.13/kernel/trace/Makefile
---- linux-4.1.13.orig/kernel/trace/Makefile 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/trace/Makefile 2015-11-29 09:23:09.653611260 +0100
-@@ -36,6 +36,10 @@
- obj-$(CONFIG_IRQSOFF_TRACER) += trace_irqsoff.o
- obj-$(CONFIG_PREEMPT_TRACER) += trace_irqsoff.o
- obj-$(CONFIG_SCHED_TRACER) += trace_sched_wakeup.o
-+obj-$(CONFIG_INTERRUPT_OFF_HIST) += latency_hist.o
-+obj-$(CONFIG_PREEMPT_OFF_HIST) += latency_hist.o
-+obj-$(CONFIG_WAKEUP_LATENCY_HIST) += latency_hist.o
-+obj-$(CONFIG_MISSED_TIMER_OFFSETS_HIST) += latency_hist.o
- obj-$(CONFIG_NOP_TRACER) += trace_nop.o
- obj-$(CONFIG_STACK_TRACER) += trace_stack.o
- obj-$(CONFIG_MMIOTRACE) += trace_mmiotrace.o
-diff -Nur linux-4.1.13.orig/kernel/trace/trace.c linux-4.1.13/kernel/trace/trace.c
---- linux-4.1.13.orig/kernel/trace/trace.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/trace/trace.c 2015-11-29 09:23:09.653611260 +0100
+diff -Nur linux-4.1.20.orig/kernel/trace/trace.c linux-4.1.20/kernel/trace/trace.c
+--- linux-4.1.20.orig/kernel/trace/trace.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/trace/trace.c 2016-03-21 20:18:34.000000000 +0100
@@ -1630,6 +1630,7 @@
struct task_struct *tsk = current;
@@ -23964,21 +24915,9 @@ diff -Nur linux-4.1.13.orig/kernel/trace/trace.c linux-4.1.13/kernel/trace/trace
}
void
-diff -Nur linux-4.1.13.orig/kernel/trace/trace_events.c linux-4.1.13/kernel/trace/trace_events.c
---- linux-4.1.13.orig/kernel/trace/trace_events.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/trace/trace_events.c 2015-11-29 09:23:09.653611260 +0100
-@@ -162,6 +162,8 @@
- __common_field(unsigned char, flags);
- __common_field(unsigned char, preempt_count);
- __common_field(int, pid);
-+ __common_field(unsigned short, migrate_disable);
-+ __common_field(unsigned short, padding);
-
- return ret;
- }
-diff -Nur linux-4.1.13.orig/kernel/trace/trace.h linux-4.1.13/kernel/trace/trace.h
---- linux-4.1.13.orig/kernel/trace/trace.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/trace/trace.h 2015-11-29 09:23:09.653611260 +0100
+diff -Nur linux-4.1.20.orig/kernel/trace/trace.h linux-4.1.20/kernel/trace/trace.h
+--- linux-4.1.20.orig/kernel/trace/trace.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/trace/trace.h 2016-03-21 20:18:34.000000000 +0100
@@ -120,6 +120,7 @@
* NEED_RESCHED - reschedule is requested
* HARDIRQ - inside an interrupt handler
@@ -23995,9 +24934,21 @@ diff -Nur linux-4.1.13.orig/kernel/trace/trace.h linux-4.1.13/kernel/trace/trace
};
#define TRACE_BUF_SIZE 1024
-diff -Nur linux-4.1.13.orig/kernel/trace/trace_irqsoff.c linux-4.1.13/kernel/trace/trace_irqsoff.c
---- linux-4.1.13.orig/kernel/trace/trace_irqsoff.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/trace/trace_irqsoff.c 2015-11-29 09:23:09.653611260 +0100
+diff -Nur linux-4.1.20.orig/kernel/trace/trace_events.c linux-4.1.20/kernel/trace/trace_events.c
+--- linux-4.1.20.orig/kernel/trace/trace_events.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/trace/trace_events.c 2016-03-21 20:18:34.000000000 +0100
+@@ -162,6 +162,8 @@
+ __common_field(unsigned char, flags);
+ __common_field(unsigned char, preempt_count);
+ __common_field(int, pid);
++ __common_field(unsigned short, migrate_disable);
++ __common_field(unsigned short, padding);
+
+ return ret;
+ }
+diff -Nur linux-4.1.20.orig/kernel/trace/trace_irqsoff.c linux-4.1.20/kernel/trace/trace_irqsoff.c
+--- linux-4.1.20.orig/kernel/trace/trace_irqsoff.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/trace/trace_irqsoff.c 2016-03-21 20:18:34.000000000 +0100
@@ -13,6 +13,7 @@
#include <linux/uaccess.h>
#include <linux/module.h>
@@ -24010,13 +24961,13 @@ diff -Nur linux-4.1.13.orig/kernel/trace/trace_irqsoff.c linux-4.1.13/kernel/tra
{
if (preempt_trace() || irq_trace())
start_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
-+ trace_preemptirqsoff_hist(TRACE_START, 1);
++ trace_preemptirqsoff_hist_rcuidle(TRACE_START, 1);
}
EXPORT_SYMBOL_GPL(start_critical_timings);
void stop_critical_timings(void)
{
-+ trace_preemptirqsoff_hist(TRACE_STOP, 0);
++ trace_preemptirqsoff_hist_rcuidle(TRACE_STOP, 0);
if (preempt_trace() || irq_trace())
stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
}
@@ -24040,7 +24991,7 @@ diff -Nur linux-4.1.13.orig/kernel/trace/trace_irqsoff.c linux-4.1.13/kernel/tra
*/
void trace_hardirqs_on(void)
{
-+ trace_preemptirqsoff_hist(IRQS_ON, 0);
++ trace_preemptirqsoff_hist_rcuidle(IRQS_ON, 0);
if (!preempt_trace() && irq_trace())
stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
}
@@ -24048,7 +24999,7 @@ diff -Nur linux-4.1.13.orig/kernel/trace/trace_irqsoff.c linux-4.1.13/kernel/tra
{
if (!preempt_trace() && irq_trace())
start_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
-+ trace_preemptirqsoff_hist(IRQS_OFF, 1);
++ trace_preemptirqsoff_hist_rcuidle(IRQS_OFF, 1);
}
EXPORT_SYMBOL(trace_hardirqs_off);
@@ -24081,9 +25032,9 @@ diff -Nur linux-4.1.13.orig/kernel/trace/trace_irqsoff.c linux-4.1.13/kernel/tra
if (preempt_trace() && !irq_trace())
start_critical_timing(a0, a1);
}
-diff -Nur linux-4.1.13.orig/kernel/trace/trace_output.c linux-4.1.13/kernel/trace/trace_output.c
---- linux-4.1.13.orig/kernel/trace/trace_output.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/trace/trace_output.c 2015-11-29 09:23:09.653611260 +0100
+diff -Nur linux-4.1.20.orig/kernel/trace/trace_output.c linux-4.1.20/kernel/trace/trace_output.c
+--- linux-4.1.20.orig/kernel/trace/trace_output.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/trace/trace_output.c 2016-03-21 20:18:34.000000000 +0100
@@ -430,6 +430,7 @@
{
char hardsoft_irq;
@@ -24129,9 +25080,9 @@ diff -Nur linux-4.1.13.orig/kernel/trace/trace_output.c linux-4.1.13/kernel/trac
return !trace_seq_has_overflowed(s);
}
-diff -Nur linux-4.1.13.orig/kernel/trace/trace_sched_switch.c linux-4.1.13/kernel/trace/trace_sched_switch.c
---- linux-4.1.13.orig/kernel/trace/trace_sched_switch.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/trace/trace_sched_switch.c 2015-11-29 09:23:09.653611260 +0100
+diff -Nur linux-4.1.20.orig/kernel/trace/trace_sched_switch.c linux-4.1.20/kernel/trace/trace_sched_switch.c
+--- linux-4.1.20.orig/kernel/trace/trace_sched_switch.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/trace/trace_sched_switch.c 2016-03-21 20:18:34.000000000 +0100
@@ -26,7 +26,7 @@
}
@@ -24141,9 +25092,9 @@ diff -Nur linux-4.1.13.orig/kernel/trace/trace_sched_switch.c linux-4.1.13/kerne
{
if (unlikely(!sched_ref))
return;
-diff -Nur linux-4.1.13.orig/kernel/trace/trace_sched_wakeup.c linux-4.1.13/kernel/trace/trace_sched_wakeup.c
---- linux-4.1.13.orig/kernel/trace/trace_sched_wakeup.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/trace/trace_sched_wakeup.c 2015-11-29 09:23:09.657610995 +0100
+diff -Nur linux-4.1.20.orig/kernel/trace/trace_sched_wakeup.c linux-4.1.20/kernel/trace/trace_sched_wakeup.c
+--- linux-4.1.20.orig/kernel/trace/trace_sched_wakeup.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/trace/trace_sched_wakeup.c 2016-03-21 20:18:34.000000000 +0100
@@ -514,7 +514,7 @@
}
@@ -24153,9 +25104,9 @@ diff -Nur linux-4.1.13.orig/kernel/trace/trace_sched_wakeup.c linux-4.1.13/kerne
{
struct trace_array_cpu *data;
int cpu = smp_processor_id();
-diff -Nur linux-4.1.13.orig/kernel/user.c linux-4.1.13/kernel/user.c
---- linux-4.1.13.orig/kernel/user.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/user.c 2015-11-29 09:23:09.657610995 +0100
+diff -Nur linux-4.1.20.orig/kernel/user.c linux-4.1.20/kernel/user.c
+--- linux-4.1.20.orig/kernel/user.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/user.c 2016-03-21 20:18:34.000000000 +0100
@@ -161,11 +161,11 @@
if (!up)
return;
@@ -24170,9 +25121,9 @@ diff -Nur linux-4.1.13.orig/kernel/user.c linux-4.1.13/kernel/user.c
}
struct user_struct *alloc_uid(kuid_t uid)
-diff -Nur linux-4.1.13.orig/kernel/watchdog.c linux-4.1.13/kernel/watchdog.c
---- linux-4.1.13.orig/kernel/watchdog.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/watchdog.c 2015-11-29 09:23:09.657610995 +0100
+diff -Nur linux-4.1.20.orig/kernel/watchdog.c linux-4.1.20/kernel/watchdog.c
+--- linux-4.1.20.orig/kernel/watchdog.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/watchdog.c 2016-03-21 20:18:34.000000000 +0100
@@ -262,6 +262,8 @@
#ifdef CONFIG_HARDLOCKUP_DETECTOR
@@ -24214,9 +25165,9 @@ diff -Nur linux-4.1.13.orig/kernel/watchdog.c linux-4.1.13/kernel/watchdog.c
/* Enable the perf event */
watchdog_nmi_enable(cpu);
-diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
---- linux-4.1.13.orig/kernel/workqueue.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/workqueue.c 2015-11-29 09:23:09.657610995 +0100
+diff -Nur linux-4.1.20.orig/kernel/workqueue.c linux-4.1.20/kernel/workqueue.c
+--- linux-4.1.20.orig/kernel/workqueue.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/workqueue.c 2016-03-21 20:18:34.000000000 +0100
@@ -48,6 +48,8 @@
#include <linux/nodemask.h>
#include <linux/moduleparam.h>
@@ -24226,7 +25177,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
#include "workqueue_internal.h"
-@@ -121,15 +123,20 @@
+@@ -121,11 +123,16 @@
* cpu or grabbing pool->lock is enough for read access. If
* POOL_DISASSOCIATED is set, it's identical to L.
*
@@ -24242,6 +25193,10 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
- * PR: wq_pool_mutex protected for writes. Sched-RCU protected for reads.
+ * PR: wq_pool_mutex protected for writes. RCU protected for reads.
*
+ * PW: wq_pool_mutex and wq->mutex protected for writes. Either for reads.
+ *
+@@ -134,7 +141,7 @@
+ *
* WQ: wq->mutex protected.
*
- * WR: wq->mutex protected for writes. Sched-RCU protected for reads.
@@ -24249,7 +25204,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
*
* MD: wq_mayday_lock protected.
*/
-@@ -178,7 +185,7 @@
+@@ -183,7 +190,7 @@
atomic_t nr_running ____cacheline_aligned_in_smp;
/*
@@ -24258,7 +25213,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
* from get_work_pool().
*/
struct rcu_head rcu;
-@@ -207,7 +214,7 @@
+@@ -212,7 +219,7 @@
/*
* Release of unbound pwq is punted to system_wq. See put_pwq()
* and pwq_unbound_release_workfn() for details. pool_workqueue
@@ -24267,7 +25222,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
* determined without grabbing wq->mutex.
*/
struct work_struct unbound_release_work;
-@@ -329,6 +336,8 @@
+@@ -334,6 +341,8 @@
struct workqueue_struct *system_freezable_power_efficient_wq __read_mostly;
EXPORT_SYMBOL_GPL(system_freezable_power_efficient_wq);
@@ -24276,7 +25231,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
static int worker_thread(void *__worker);
static void copy_workqueue_attrs(struct workqueue_attrs *to,
const struct workqueue_attrs *from);
-@@ -338,14 +347,14 @@
+@@ -343,14 +352,14 @@
#include <trace/events/workqueue.h>
#define assert_rcu_or_pool_mutex() \
@@ -24293,9 +25248,9 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
- "sched RCU or wq->mutex should be held")
+ "RCU or wq->mutex should be held")
- #define for_each_cpu_worker_pool(pool, cpu) \
- for ((pool) = &per_cpu(cpu_worker_pools, cpu)[0]; \
-@@ -357,7 +366,7 @@
+ #define assert_rcu_or_wq_mutex_or_pool_mutex(wq) \
+ rcu_lockdep_assert(rcu_read_lock_sched_held() || \
+@@ -368,7 +377,7 @@
* @pool: iteration cursor
* @pi: integer used for iteration
*
@@ -24304,7 +25259,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
* locked. If the pool needs to be used beyond the locking in effect, the
* caller is responsible for guaranteeing that the pool stays online.
*
-@@ -389,7 +398,7 @@
+@@ -400,7 +409,7 @@
* @pwq: iteration cursor
* @wq: the target workqueue
*
@@ -24313,7 +25268,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
* If the pwq needs to be used beyond the locking in effect, the caller is
* responsible for guaranteeing that the pwq stays online.
*
-@@ -401,6 +410,31 @@
+@@ -412,6 +421,31 @@
if (({ assert_rcu_or_wq_mutex(wq); false; })) { } \
else
@@ -24345,16 +25300,17 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
#ifdef CONFIG_DEBUG_OBJECTS_WORK
static struct debug_obj_descr work_debug_descr;
-@@ -551,7 +585,7 @@
+@@ -562,8 +596,7 @@
* @wq: the target workqueue
* @node: the node ID
*
-- * This must be called either with pwq_lock held or sched RCU read locked.
-+ * This must be called either with pwq_lock held or RCU read locked.
+- * This must be called with any of wq_pool_mutex, wq->mutex or sched RCU
+- * read locked.
++ * This must be called with any of wq_pool_mutex, wq->mutex or RCU read locked.
* If the pwq needs to be used beyond the locking in effect, the caller is
* responsible for guaranteeing that the pwq stays online.
*
-@@ -655,8 +689,8 @@
+@@ -677,8 +710,8 @@
* @work: the work item of interest
*
* Pools are created and destroyed under wq_pool_mutex, and allows read
@@ -24365,7 +25321,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
*
* All fields of the returned pool are accessible as long as the above
* mentioned locking is in effect. If the returned pool needs to be used
-@@ -793,51 +827,44 @@
+@@ -815,51 +848,44 @@
*/
static void wake_up_worker(struct worker_pool *pool)
{
@@ -24386,12 +25342,12 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
- * wq_worker_waking_up - a worker is waking up
- * @task: task waking up
- * @cpu: CPU @task is waking up to
+- *
+- * This function is called during try_to_wake_up() when a worker is
+- * being awoken.
+ * wq_worker_running - a worker is running again
+ * @task: task returning from sleep
*
-- * This function is called during try_to_wake_up() when a worker is
-- * being awoken.
-- *
- * CONTEXT:
- * spin_lock_irq(rq->lock)
+ * This function is called when a worker returns from schedule()
@@ -24436,7 +25392,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
struct worker_pool *pool;
/*
-@@ -846,29 +873,26 @@
+@@ -868,29 +894,26 @@
* checking NOT_RUNNING.
*/
if (worker->flags & WORKER_NOT_RUNNING)
@@ -24476,7 +25432,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
}
/**
-@@ -1062,12 +1086,12 @@
+@@ -1084,12 +1107,12 @@
{
if (pwq) {
/*
@@ -24492,7 +25448,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
}
}
-@@ -1169,7 +1193,7 @@
+@@ -1191,7 +1214,7 @@
struct worker_pool *pool;
struct pool_workqueue *pwq;
@@ -24501,7 +25457,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
/* try to steal the timer if it exists */
if (is_dwork) {
-@@ -1188,6 +1212,7 @@
+@@ -1210,6 +1233,7 @@
if (!test_and_set_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work)))
return 0;
@@ -24509,7 +25465,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
/*
* The queueing is in progress, or it is already queued. Try to
* steal it from ->worklist without clearing WORK_STRUCT_PENDING.
-@@ -1226,14 +1251,16 @@
+@@ -1248,14 +1272,16 @@
set_work_pool_and_keep_pending(work, pool->id);
spin_unlock(&pool->lock);
@@ -24528,7 +25484,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
return -EAGAIN;
}
-@@ -1302,7 +1329,7 @@
+@@ -1324,7 +1350,7 @@
* queued or lose PENDING. Grabbing PENDING and queueing should
* happen with IRQ disabled.
*/
@@ -24537,7 +25493,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
debug_work_activate(work);
-@@ -1310,6 +1337,8 @@
+@@ -1332,6 +1358,8 @@
if (unlikely(wq->flags & __WQ_DRAINING) &&
WARN_ON_ONCE(!is_chained_work(wq)))
return;
@@ -24546,7 +25502,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
retry:
if (req_cpu == WORK_CPU_UNBOUND)
cpu = raw_smp_processor_id();
-@@ -1366,10 +1395,8 @@
+@@ -1388,10 +1416,8 @@
/* pwq determined, queue */
trace_workqueue_queue_work(req_cpu, pwq, work);
@@ -24559,7 +25515,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
pwq->nr_in_flight[pwq->work_color]++;
work_flags = work_color_to_flags(pwq->work_color);
-@@ -1385,7 +1412,9 @@
+@@ -1407,7 +1433,9 @@
insert_work(pwq, work, worklist, work_flags);
@@ -24569,7 +25525,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
}
/**
-@@ -1405,14 +1434,14 @@
+@@ -1427,14 +1455,14 @@
bool ret = false;
unsigned long flags;
@@ -24586,7 +25542,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
return ret;
}
EXPORT_SYMBOL(queue_work_on);
-@@ -1479,14 +1508,14 @@
+@@ -1501,14 +1529,14 @@
unsigned long flags;
/* read the comment in __queue_work() */
@@ -24603,7 +25559,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
return ret;
}
EXPORT_SYMBOL(queue_delayed_work_on);
-@@ -1521,7 +1550,7 @@
+@@ -1543,7 +1571,7 @@
if (likely(ret >= 0)) {
__queue_delayed_work(cpu, wq, dwork, delay);
@@ -24612,7 +25568,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
}
/* -ENOENT from try_to_grab_pending() becomes %true */
-@@ -1554,7 +1583,9 @@
+@@ -1576,7 +1604,9 @@
worker->last_active = jiffies;
/* idle_list is LIFO */
@@ -24622,7 +25578,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
if (too_many_workers(pool) && !timer_pending(&pool->idle_timer))
mod_timer(&pool->idle_timer, jiffies + IDLE_WORKER_TIMEOUT);
-@@ -1587,7 +1618,9 @@
+@@ -1609,7 +1639,9 @@
return;
worker_clr_flags(worker, WORKER_IDLE);
pool->nr_idle--;
@@ -24632,7 +25588,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
}
static struct worker *alloc_worker(int node)
-@@ -1755,7 +1788,9 @@
+@@ -1777,7 +1809,9 @@
pool->nr_workers--;
pool->nr_idle--;
@@ -24642,7 +25598,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
worker->flags |= WORKER_DIE;
wake_up_process(worker->task);
}
-@@ -2672,14 +2707,14 @@
+@@ -2694,14 +2728,14 @@
might_sleep();
@@ -24660,7 +25616,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
/* see the comment in try_to_grab_pending() with the same code */
pwq = get_work_pwq(work);
if (pwq) {
-@@ -2706,10 +2741,11 @@
+@@ -2728,10 +2762,11 @@
else
lock_map_acquire_read(&pwq->wq->lockdep_map);
lock_map_release(&pwq->wq->lockdep_map);
@@ -24673,7 +25629,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
return false;
}
-@@ -2796,7 +2832,7 @@
+@@ -2818,7 +2853,7 @@
/* tell other tasks trying to grab @work to back off */
mark_work_canceling(work);
@@ -24682,7 +25638,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
flush_work(work);
clear_work_data(work);
-@@ -2851,10 +2887,10 @@
+@@ -2873,10 +2908,10 @@
*/
bool flush_delayed_work(struct delayed_work *dwork)
{
@@ -24695,7 +25651,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
return flush_work(&dwork->work);
}
EXPORT_SYMBOL(flush_delayed_work);
-@@ -2889,7 +2925,7 @@
+@@ -2911,7 +2946,7 @@
set_work_pool_and_clear_pending(&dwork->work,
get_work_pool_id(&dwork->work));
@@ -24704,7 +25660,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
return ret;
}
EXPORT_SYMBOL(cancel_delayed_work);
-@@ -3147,7 +3183,7 @@
+@@ -3169,7 +3204,7 @@
* put_unbound_pool - put a worker_pool
* @pool: worker_pool to put
*
@@ -24713,7 +25669,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
* safe manner. get_unbound_pool() calls this function on its failure path
* and this function should be able to release pools which went through,
* successfully or not, init_worker_pool().
-@@ -3201,8 +3237,8 @@
+@@ -3223,8 +3258,8 @@
del_timer_sync(&pool->idle_timer);
del_timer_sync(&pool->mayday_timer);
@@ -24724,7 +25680,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
}
/**
-@@ -3307,14 +3343,14 @@
+@@ -3329,14 +3364,14 @@
put_unbound_pool(pool);
mutex_unlock(&wq_pool_mutex);
@@ -24741,7 +25697,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
}
/**
-@@ -3920,7 +3956,7 @@
+@@ -3974,7 +4009,7 @@
* The base ref is never dropped on per-cpu pwqs. Directly
* schedule RCU free.
*/
@@ -24750,7 +25706,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
} else {
/*
* We're the sole accessor of @wq at this point. Directly
-@@ -4013,7 +4049,8 @@
+@@ -4067,7 +4102,8 @@
struct pool_workqueue *pwq;
bool ret;
@@ -24760,7 +25716,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
if (cpu == WORK_CPU_UNBOUND)
cpu = smp_processor_id();
-@@ -4024,7 +4061,8 @@
+@@ -4078,7 +4114,8 @@
pwq = unbound_pwq_by_node(wq, cpu_to_node(cpu));
ret = !list_empty(&pwq->delayed_works);
@@ -24770,7 +25726,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
return ret;
}
-@@ -4050,15 +4088,15 @@
+@@ -4104,15 +4141,15 @@
if (work_pending(work))
ret |= WORK_BUSY_PENDING;
@@ -24790,7 +25746,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
return ret;
}
-@@ -4247,7 +4285,7 @@
+@@ -4301,7 +4338,7 @@
unsigned long flags;
int pi;
@@ -24799,7 +25755,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
pr_info("Showing busy workqueues and worker pools:\n");
-@@ -4298,7 +4336,7 @@
+@@ -4352,7 +4389,7 @@
spin_unlock_irqrestore(&pool->lock, flags);
}
@@ -24808,7 +25764,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
}
/*
-@@ -4648,16 +4686,16 @@
+@@ -4702,16 +4739,16 @@
* nr_active is monotonically decreasing. It's safe
* to peek without lock.
*/
@@ -24828,7 +25784,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
}
out_unlock:
mutex_unlock(&wq_pool_mutex);
-@@ -4771,7 +4809,8 @@
+@@ -4825,7 +4862,8 @@
const char *delim = "";
int node, written = 0;
@@ -24838,7 +25794,7 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
for_each_node(node) {
written += scnprintf(buf + written, PAGE_SIZE - written,
"%s%d:%d", delim, node,
-@@ -4779,7 +4818,8 @@
+@@ -4833,7 +4871,8 @@
delim = " ";
}
written += scnprintf(buf + written, PAGE_SIZE - written, "\n");
@@ -24848,9 +25804,9 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue.c linux-4.1.13/kernel/workqueue.c
return written;
}
-diff -Nur linux-4.1.13.orig/kernel/workqueue_internal.h linux-4.1.13/kernel/workqueue_internal.h
---- linux-4.1.13.orig/kernel/workqueue_internal.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/kernel/workqueue_internal.h 2015-11-29 09:23:09.657610995 +0100
+diff -Nur linux-4.1.20.orig/kernel/workqueue_internal.h linux-4.1.20/kernel/workqueue_internal.h
+--- linux-4.1.20.orig/kernel/workqueue_internal.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/kernel/workqueue_internal.h 2016-03-21 20:18:34.000000000 +0100
@@ -43,6 +43,7 @@
unsigned long last_active; /* L: last active timestamp */
unsigned int flags; /* X: flags */
@@ -24869,9 +25825,20 @@ diff -Nur linux-4.1.13.orig/kernel/workqueue_internal.h linux-4.1.13/kernel/work
+void wq_worker_sleeping(struct task_struct *task);
#endif /* _KERNEL_WORKQUEUE_INTERNAL_H */
-diff -Nur linux-4.1.13.orig/lib/debugobjects.c linux-4.1.13/lib/debugobjects.c
---- linux-4.1.13.orig/lib/debugobjects.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/lib/debugobjects.c 2015-11-29 09:23:09.657610995 +0100
+diff -Nur linux-4.1.20.orig/lib/Kconfig linux-4.1.20/lib/Kconfig
+--- linux-4.1.20.orig/lib/Kconfig 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/lib/Kconfig 2016-03-21 20:18:34.000000000 +0100
+@@ -391,6 +391,7 @@
+
+ config CPUMASK_OFFSTACK
+ bool "Force CPU masks off stack" if DEBUG_PER_CPU_MAPS
++ depends on !PREEMPT_RT_FULL
+ help
+ Use dynamic allocation for cpumask_var_t, instead of putting
+ them on the stack. This is a bit more expensive, but avoids
+diff -Nur linux-4.1.20.orig/lib/debugobjects.c linux-4.1.20/lib/debugobjects.c
+--- linux-4.1.20.orig/lib/debugobjects.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/lib/debugobjects.c 2016-03-21 20:18:34.000000000 +0100
@@ -309,7 +309,10 @@
struct debug_obj *obj;
unsigned long flags;
@@ -24884,30 +25851,20 @@ diff -Nur linux-4.1.13.orig/lib/debugobjects.c linux-4.1.13/lib/debugobjects.c
db = get_bucket((unsigned long) addr);
-diff -Nur linux-4.1.13.orig/lib/dump_stack.c linux-4.1.13/lib/dump_stack.c
---- linux-4.1.13.orig/lib/dump_stack.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/lib/dump_stack.c 2015-11-29 09:23:09.657610995 +0100
-@@ -33,7 +33,7 @@
- * Permit this cpu to perform nested stack dumps while serialising
- * against other CPUs
- */
-- preempt_disable();
-+ migrate_disable();
-
- retry:
- cpu = smp_processor_id();
-@@ -52,7 +52,7 @@
- if (!was_locked)
- atomic_set(&dump_lock, -1);
+diff -Nur linux-4.1.20.orig/lib/dump_stack.c linux-4.1.20/lib/dump_stack.c
+--- linux-4.1.20.orig/lib/dump_stack.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/lib/dump_stack.c 2016-03-21 20:18:34.000000000 +0100
+@@ -8,6 +8,7 @@
+ #include <linux/sched.h>
+ #include <linux/smp.h>
+ #include <linux/atomic.h>
++#include <linux/locallock.h>
-- preempt_enable();
-+ migrate_enable();
- }
- #else
- asmlinkage __visible void dump_stack(void)
-diff -Nur linux-4.1.13.orig/lib/idr.c linux-4.1.13/lib/idr.c
---- linux-4.1.13.orig/lib/idr.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/lib/idr.c 2015-11-29 09:23:09.657610995 +0100
+ static void __dump_stack(void)
+ {
+diff -Nur linux-4.1.20.orig/lib/idr.c linux-4.1.20/lib/idr.c
+--- linux-4.1.20.orig/lib/idr.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/lib/idr.c 2016-03-21 20:18:34.000000000 +0100
@@ -30,6 +30,7 @@
#include <linux/idr.h>
#include <linux/spinlock.h>
@@ -24973,20 +25930,9 @@ diff -Nur linux-4.1.13.orig/lib/idr.c linux-4.1.13/lib/idr.c
if (!new)
break;
-diff -Nur linux-4.1.13.orig/lib/Kconfig linux-4.1.13/lib/Kconfig
---- linux-4.1.13.orig/lib/Kconfig 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/lib/Kconfig 2015-11-29 09:23:09.657610995 +0100
-@@ -391,6 +391,7 @@
-
- config CPUMASK_OFFSTACK
- bool "Force CPU masks off stack" if DEBUG_PER_CPU_MAPS
-+ depends on !PREEMPT_RT_FULL
- help
- Use dynamic allocation for cpumask_var_t, instead of putting
- them on the stack. This is a bit more expensive, but avoids
-diff -Nur linux-4.1.13.orig/lib/locking-selftest.c linux-4.1.13/lib/locking-selftest.c
---- linux-4.1.13.orig/lib/locking-selftest.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/lib/locking-selftest.c 2015-11-29 09:23:09.657610995 +0100
+diff -Nur linux-4.1.20.orig/lib/locking-selftest.c linux-4.1.20/lib/locking-selftest.c
+--- linux-4.1.20.orig/lib/locking-selftest.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/lib/locking-selftest.c 2016-03-21 20:18:34.000000000 +0100
@@ -590,6 +590,8 @@
#include "locking-selftest-spin-hardirq.h"
GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_hard_spin)
@@ -25135,9 +26081,9 @@ diff -Nur linux-4.1.13.orig/lib/locking-selftest.c linux-4.1.13/lib/locking-self
ww_tests();
-diff -Nur linux-4.1.13.orig/lib/percpu_ida.c linux-4.1.13/lib/percpu_ida.c
---- linux-4.1.13.orig/lib/percpu_ida.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/lib/percpu_ida.c 2015-11-29 09:23:09.657610995 +0100
+diff -Nur linux-4.1.20.orig/lib/percpu_ida.c linux-4.1.20/lib/percpu_ida.c
+--- linux-4.1.20.orig/lib/percpu_ida.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/lib/percpu_ida.c 2016-03-21 20:18:34.000000000 +0100
@@ -26,6 +26,9 @@
#include <linux/string.h>
#include <linux/spinlock.h>
@@ -25226,9 +26172,9 @@ diff -Nur linux-4.1.13.orig/lib/percpu_ida.c linux-4.1.13/lib/percpu_ida.c
return err;
}
EXPORT_SYMBOL_GPL(percpu_ida_for_each_free);
-diff -Nur linux-4.1.13.orig/lib/radix-tree.c linux-4.1.13/lib/radix-tree.c
---- linux-4.1.13.orig/lib/radix-tree.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/lib/radix-tree.c 2015-11-29 09:23:09.657610995 +0100
+diff -Nur linux-4.1.20.orig/lib/radix-tree.c linux-4.1.20/lib/radix-tree.c
+--- linux-4.1.20.orig/lib/radix-tree.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/lib/radix-tree.c 2016-03-21 20:18:34.000000000 +0100
@@ -195,12 +195,13 @@
* succeed in getting a node here (and never reach
* kmem_cache_alloc)
@@ -25260,9 +26206,9 @@ diff -Nur linux-4.1.13.orig/lib/radix-tree.c linux-4.1.13/lib/radix-tree.c
/*
* Return the maximum key which can be store into a
-diff -Nur linux-4.1.13.orig/lib/scatterlist.c linux-4.1.13/lib/scatterlist.c
---- linux-4.1.13.orig/lib/scatterlist.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/lib/scatterlist.c 2015-11-29 09:23:09.657610995 +0100
+diff -Nur linux-4.1.20.orig/lib/scatterlist.c linux-4.1.20/lib/scatterlist.c
+--- linux-4.1.20.orig/lib/scatterlist.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/lib/scatterlist.c 2016-03-21 20:18:34.000000000 +0100
@@ -592,7 +592,7 @@
flush_kernel_dcache_page(miter->page);
@@ -25290,9 +26236,9 @@ diff -Nur linux-4.1.13.orig/lib/scatterlist.c linux-4.1.13/lib/scatterlist.c
return offset;
}
-diff -Nur linux-4.1.13.orig/lib/smp_processor_id.c linux-4.1.13/lib/smp_processor_id.c
---- linux-4.1.13.orig/lib/smp_processor_id.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/lib/smp_processor_id.c 2015-11-29 09:23:09.657610995 +0100
+diff -Nur linux-4.1.20.orig/lib/smp_processor_id.c linux-4.1.20/lib/smp_processor_id.c
+--- linux-4.1.20.orig/lib/smp_processor_id.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/lib/smp_processor_id.c 2016-03-21 20:18:34.000000000 +0100
@@ -39,8 +39,9 @@
if (!printk_ratelimit())
goto out_enable;
@@ -25305,9 +26251,9 @@ diff -Nur linux-4.1.13.orig/lib/smp_processor_id.c linux-4.1.13/lib/smp_processo
print_symbol("caller is %s\n", (long)__builtin_return_address(0));
dump_stack();
-diff -Nur linux-4.1.13.orig/lib/strnlen_user.c linux-4.1.13/lib/strnlen_user.c
---- linux-4.1.13.orig/lib/strnlen_user.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/lib/strnlen_user.c 2015-11-29 09:23:09.657610995 +0100
+diff -Nur linux-4.1.20.orig/lib/strnlen_user.c linux-4.1.20/lib/strnlen_user.c
+--- linux-4.1.20.orig/lib/strnlen_user.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/lib/strnlen_user.c 2016-03-21 20:18:34.000000000 +0100
@@ -85,7 +85,8 @@
* @str: The string to measure.
* @count: Maximum count (including NUL character)
@@ -25328,9 +26274,26 @@ diff -Nur linux-4.1.13.orig/lib/strnlen_user.c linux-4.1.13/lib/strnlen_user.c
*
* Get the size of a NUL-terminated string in user space.
*
-diff -Nur linux-4.1.13.orig/mm/compaction.c linux-4.1.13/mm/compaction.c
---- linux-4.1.13.orig/mm/compaction.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/mm/compaction.c 2015-11-29 09:23:09.661610728 +0100
+diff -Nur linux-4.1.20.orig/localversion-rt linux-4.1.20/localversion-rt
+--- linux-4.1.20.orig/localversion-rt 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.1.20/localversion-rt 2016-03-21 20:18:34.000000000 +0100
+@@ -0,0 +1 @@
++-rt22
+diff -Nur linux-4.1.20.orig/mm/Kconfig linux-4.1.20/mm/Kconfig
+--- linux-4.1.20.orig/mm/Kconfig 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/mm/Kconfig 2016-03-21 20:18:34.000000000 +0100
+@@ -409,7 +409,7 @@
+
+ config TRANSPARENT_HUGEPAGE
+ bool "Transparent Hugepage Support"
+- depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE
++ depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE && !PREEMPT_RT_FULL
+ select COMPACTION
+ help
+ Transparent Hugepages allows the kernel to use huge pages and
+diff -Nur linux-4.1.20.orig/mm/compaction.c linux-4.1.20/mm/compaction.c
+--- linux-4.1.20.orig/mm/compaction.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/mm/compaction.c 2016-03-21 20:18:34.000000000 +0100
@@ -1406,10 +1406,12 @@
cc->migrate_pfn & ~((1UL << cc->order) - 1);
@@ -25346,9 +26309,9 @@ diff -Nur linux-4.1.13.orig/mm/compaction.c linux-4.1.13/mm/compaction.c
/* No more flushing until we migrate again */
last_migrated_pfn = 0;
}
-diff -Nur linux-4.1.13.orig/mm/filemap.c linux-4.1.13/mm/filemap.c
---- linux-4.1.13.orig/mm/filemap.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/mm/filemap.c 2015-11-29 09:23:09.661610728 +0100
+diff -Nur linux-4.1.20.orig/mm/filemap.c linux-4.1.20/mm/filemap.c
+--- linux-4.1.20.orig/mm/filemap.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/mm/filemap.c 2016-03-21 20:18:34.000000000 +0100
@@ -167,7 +167,9 @@
if (!workingset_node_pages(node) &&
list_empty(&node->private_list)) {
@@ -25375,9 +26338,9 @@ diff -Nur linux-4.1.13.orig/mm/filemap.c linux-4.1.13/mm/filemap.c
}
return 0;
}
-diff -Nur linux-4.1.13.orig/mm/highmem.c linux-4.1.13/mm/highmem.c
---- linux-4.1.13.orig/mm/highmem.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/mm/highmem.c 2015-11-29 09:23:09.661610728 +0100
+diff -Nur linux-4.1.20.orig/mm/highmem.c linux-4.1.20/mm/highmem.c
+--- linux-4.1.20.orig/mm/highmem.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/mm/highmem.c 2016-03-21 20:18:34.000000000 +0100
@@ -29,10 +29,11 @@
#include <linux/kgdb.h>
#include <asm/tlbflush.h>
@@ -25402,21 +26365,9 @@ diff -Nur linux-4.1.13.orig/mm/highmem.c linux-4.1.13/mm/highmem.c
unsigned int nr_free_highpages (void)
{
-diff -Nur linux-4.1.13.orig/mm/Kconfig linux-4.1.13/mm/Kconfig
---- linux-4.1.13.orig/mm/Kconfig 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/mm/Kconfig 2015-11-29 09:23:09.661610728 +0100
-@@ -409,7 +409,7 @@
-
- config TRANSPARENT_HUGEPAGE
- bool "Transparent Hugepage Support"
-- depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE
-+ depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE && !PREEMPT_RT_FULL
- select COMPACTION
- help
- Transparent Hugepages allows the kernel to use huge pages and
-diff -Nur linux-4.1.13.orig/mm/memcontrol.c linux-4.1.13/mm/memcontrol.c
---- linux-4.1.13.orig/mm/memcontrol.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/mm/memcontrol.c 2015-11-29 09:23:09.661610728 +0100
+diff -Nur linux-4.1.20.orig/mm/memcontrol.c linux-4.1.20/mm/memcontrol.c
+--- linux-4.1.20.orig/mm/memcontrol.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/mm/memcontrol.c 2016-03-21 20:18:34.000000000 +0100
@@ -66,6 +66,8 @@
#include <net/sock.h>
#include <net/ip.h>
@@ -25472,7 +26423,7 @@ diff -Nur linux-4.1.13.orig/mm/memcontrol.c linux-4.1.13/mm/memcontrol.c
put_online_cpus();
mutex_unlock(&percpu_charge_mutex);
}
-@@ -4802,12 +4808,12 @@
+@@ -4803,12 +4809,12 @@
ret = 0;
@@ -25487,7 +26438,7 @@ diff -Nur linux-4.1.13.orig/mm/memcontrol.c linux-4.1.13/mm/memcontrol.c
out_unlock:
unlock_page(page);
out:
-@@ -5544,10 +5550,10 @@
+@@ -5545,10 +5551,10 @@
VM_BUG_ON_PAGE(!PageTransHuge(page), page);
}
@@ -25500,7 +26451,7 @@ diff -Nur linux-4.1.13.orig/mm/memcontrol.c linux-4.1.13/mm/memcontrol.c
if (do_swap_account && PageSwapCache(page)) {
swp_entry_t entry = { .val = page_private(page) };
-@@ -5603,14 +5609,14 @@
+@@ -5604,14 +5610,14 @@
memcg_oom_recover(memcg);
}
@@ -25517,7 +26468,7 @@ diff -Nur linux-4.1.13.orig/mm/memcontrol.c linux-4.1.13/mm/memcontrol.c
if (!mem_cgroup_is_root(memcg))
css_put_many(&memcg->css, nr_pages);
-@@ -5814,6 +5820,7 @@
+@@ -5815,6 +5821,7 @@
{
struct mem_cgroup *memcg;
unsigned short oldid;
@@ -25525,7 +26476,7 @@ diff -Nur linux-4.1.13.orig/mm/memcontrol.c linux-4.1.13/mm/memcontrol.c
VM_BUG_ON_PAGE(PageLRU(page), page);
VM_BUG_ON_PAGE(page_count(page), page);
-@@ -5836,9 +5843,11 @@
+@@ -5837,9 +5844,11 @@
if (!mem_cgroup_is_root(memcg))
page_counter_uncharge(&memcg->memory, 1);
@@ -25537,10 +26488,10 @@ diff -Nur linux-4.1.13.orig/mm/memcontrol.c linux-4.1.13/mm/memcontrol.c
}
/**
-diff -Nur linux-4.1.13.orig/mm/memory.c linux-4.1.13/mm/memory.c
---- linux-4.1.13.orig/mm/memory.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/mm/memory.c 2015-11-29 09:23:09.661610728 +0100
-@@ -3743,7 +3743,7 @@
+diff -Nur linux-4.1.20.orig/mm/memory.c linux-4.1.20/mm/memory.c
+--- linux-4.1.20.orig/mm/memory.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/mm/memory.c 2016-03-21 20:18:34.000000000 +0100
+@@ -3753,7 +3753,7 @@
}
#if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP)
@@ -25549,7 +26500,7 @@ diff -Nur linux-4.1.13.orig/mm/memory.c linux-4.1.13/mm/memory.c
{
/*
* Some code (nfs/sunrpc) uses socket ops on kernel memory while
-@@ -3753,21 +3753,15 @@
+@@ -3763,21 +3763,15 @@
*/
if (segment_eq(get_fs(), KERNEL_DS))
return;
@@ -25576,9 +26527,9 @@ diff -Nur linux-4.1.13.orig/mm/memory.c linux-4.1.13/mm/memory.c
#endif
#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS)
-diff -Nur linux-4.1.13.orig/mm/mmu_context.c linux-4.1.13/mm/mmu_context.c
---- linux-4.1.13.orig/mm/mmu_context.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/mm/mmu_context.c 2015-11-29 09:23:09.661610728 +0100
+diff -Nur linux-4.1.20.orig/mm/mmu_context.c linux-4.1.20/mm/mmu_context.c
+--- linux-4.1.20.orig/mm/mmu_context.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/mm/mmu_context.c 2016-03-21 20:18:34.000000000 +0100
@@ -23,6 +23,7 @@
struct task_struct *tsk = current;
@@ -25595,9 +26546,9 @@ diff -Nur linux-4.1.13.orig/mm/mmu_context.c linux-4.1.13/mm/mmu_context.c
task_unlock(tsk);
#ifdef finish_arch_post_lock_switch
finish_arch_post_lock_switch();
-diff -Nur linux-4.1.13.orig/mm/page_alloc.c linux-4.1.13/mm/page_alloc.c
---- linux-4.1.13.orig/mm/page_alloc.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/mm/page_alloc.c 2015-11-29 09:23:09.661610728 +0100
+diff -Nur linux-4.1.20.orig/mm/page_alloc.c linux-4.1.20/mm/page_alloc.c
+--- linux-4.1.20.orig/mm/page_alloc.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/mm/page_alloc.c 2016-03-21 20:18:34.000000000 +0100
@@ -60,6 +60,7 @@
#include <linux/page_ext.h>
#include <linux/hugetlb.h>
@@ -25922,9 +26873,9 @@ diff -Nur linux-4.1.13.orig/mm/page_alloc.c linux-4.1.13/mm/page_alloc.c
}
#ifdef CONFIG_MEMORY_HOTREMOVE
-diff -Nur linux-4.1.13.orig/mm/slab.h linux-4.1.13/mm/slab.h
---- linux-4.1.13.orig/mm/slab.h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/mm/slab.h 2015-11-29 09:23:09.661610728 +0100
+diff -Nur linux-4.1.20.orig/mm/slab.h linux-4.1.20/mm/slab.h
+--- linux-4.1.20.orig/mm/slab.h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/mm/slab.h 2016-03-21 20:18:34.000000000 +0100
@@ -330,7 +330,11 @@
* The slab lists for all objects.
*/
@@ -25937,9 +26888,9 @@ diff -Nur linux-4.1.13.orig/mm/slab.h linux-4.1.13/mm/slab.h
#ifdef CONFIG_SLAB
struct list_head slabs_partial; /* partial list first, better asm code */
-diff -Nur linux-4.1.13.orig/mm/slub.c linux-4.1.13/mm/slub.c
---- linux-4.1.13.orig/mm/slub.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/mm/slub.c 2015-11-29 09:23:09.665610461 +0100
+diff -Nur linux-4.1.20.orig/mm/slub.c linux-4.1.20/mm/slub.c
+--- linux-4.1.20.orig/mm/slub.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/mm/slub.c 2016-03-21 20:18:34.000000000 +0100
@@ -1069,7 +1069,7 @@
{
struct kmem_cache_node *n = get_node(s, page_to_nid(page));
@@ -26424,9 +27375,9 @@ diff -Nur linux-4.1.13.orig/mm/slub.c linux-4.1.13/mm/slub.c
}
for (i = 0; i < t.count; i++) {
-diff -Nur linux-4.1.13.orig/mm/swap.c linux-4.1.13/mm/swap.c
---- linux-4.1.13.orig/mm/swap.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/mm/swap.c 2015-11-29 09:23:09.665610461 +0100
+diff -Nur linux-4.1.20.orig/mm/swap.c linux-4.1.20/mm/swap.c
+--- linux-4.1.20.orig/mm/swap.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/mm/swap.c 2016-03-21 20:18:34.000000000 +0100
@@ -32,6 +32,7 @@
#include <linux/gfp.h>
#include <linux/uio.h>
@@ -26545,9 +27496,9 @@ diff -Nur linux-4.1.13.orig/mm/swap.c linux-4.1.13/mm/swap.c
}
static void lru_add_drain_per_cpu(struct work_struct *dummy)
-diff -Nur linux-4.1.13.orig/mm/truncate.c linux-4.1.13/mm/truncate.c
---- linux-4.1.13.orig/mm/truncate.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/mm/truncate.c 2015-11-29 09:23:09.665610461 +0100
+diff -Nur linux-4.1.20.orig/mm/truncate.c linux-4.1.20/mm/truncate.c
+--- linux-4.1.20.orig/mm/truncate.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/mm/truncate.c 2016-03-21 20:18:34.000000000 +0100
@@ -56,8 +56,11 @@
* protected by mapping->tree_lock.
*/
@@ -26562,9 +27513,9 @@ diff -Nur linux-4.1.13.orig/mm/truncate.c linux-4.1.13/mm/truncate.c
__radix_tree_delete_node(&mapping->page_tree, node);
unlock:
spin_unlock_irq(&mapping->tree_lock);
-diff -Nur linux-4.1.13.orig/mm/vmalloc.c linux-4.1.13/mm/vmalloc.c
---- linux-4.1.13.orig/mm/vmalloc.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/mm/vmalloc.c 2015-11-29 09:23:09.665610461 +0100
+diff -Nur linux-4.1.20.orig/mm/vmalloc.c linux-4.1.20/mm/vmalloc.c
+--- linux-4.1.20.orig/mm/vmalloc.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/mm/vmalloc.c 2016-03-21 20:18:34.000000000 +0100
@@ -819,7 +819,7 @@
struct vmap_block *vb;
struct vmap_area *va;
@@ -26616,9 +27567,9 @@ diff -Nur linux-4.1.13.orig/mm/vmalloc.c linux-4.1.13/mm/vmalloc.c
rcu_read_unlock();
/* Allocate new block if nothing was found */
-diff -Nur linux-4.1.13.orig/mm/vmstat.c linux-4.1.13/mm/vmstat.c
---- linux-4.1.13.orig/mm/vmstat.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/mm/vmstat.c 2015-11-29 09:23:09.665610461 +0100
+diff -Nur linux-4.1.20.orig/mm/vmstat.c linux-4.1.20/mm/vmstat.c
+--- linux-4.1.20.orig/mm/vmstat.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/mm/vmstat.c 2016-03-21 20:18:34.000000000 +0100
@@ -226,6 +226,7 @@
long x;
long t;
@@ -26667,9 +27618,9 @@ diff -Nur linux-4.1.13.orig/mm/vmstat.c linux-4.1.13/mm/vmstat.c
}
void __dec_zone_page_state(struct page *page, enum zone_stat_item item)
-diff -Nur linux-4.1.13.orig/mm/workingset.c linux-4.1.13/mm/workingset.c
---- linux-4.1.13.orig/mm/workingset.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/mm/workingset.c 2015-11-29 09:23:09.665610461 +0100
+diff -Nur linux-4.1.20.orig/mm/workingset.c linux-4.1.20/mm/workingset.c
+--- linux-4.1.20.orig/mm/workingset.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/mm/workingset.c 2016-03-21 20:18:34.000000000 +0100
@@ -264,7 +264,8 @@
* point where they would still be useful.
*/
@@ -26737,9 +27688,9 @@ diff -Nur linux-4.1.13.orig/mm/workingset.c linux-4.1.13/mm/workingset.c
err:
return ret;
}
-diff -Nur linux-4.1.13.orig/net/core/dev.c linux-4.1.13/net/core/dev.c
---- linux-4.1.13.orig/net/core/dev.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/net/core/dev.c 2015-11-29 09:23:09.665610461 +0100
+diff -Nur linux-4.1.20.orig/net/core/dev.c linux-4.1.20/net/core/dev.c
+--- linux-4.1.20.orig/net/core/dev.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/net/core/dev.c 2016-03-21 20:18:34.000000000 +0100
@@ -184,6 +184,7 @@
static DEFINE_HASHTABLE(napi_hash, 8);
@@ -26856,7 +27807,73 @@ diff -Nur linux-4.1.13.orig/net/core/dev.c linux-4.1.13/net/core/dev.c
}
EXPORT_SYMBOL(__dev_kfree_skb_irq);
-@@ -3365,6 +3373,7 @@
+@@ -2880,9 +2888,44 @@
+ #define skb_update_prio(skb)
+ #endif
+
++#ifdef CONFIG_PREEMPT_RT_FULL
++
++static inline int xmit_rec_read(void)
++{
++ return current->xmit_recursion;
++}
++
++static inline void xmit_rec_inc(void)
++{
++ current->xmit_recursion++;
++}
++
++static inline void xmit_rec_dec(void)
++{
++ current->xmit_recursion--;
++}
++
++#else
++
+ DEFINE_PER_CPU(int, xmit_recursion);
+ EXPORT_SYMBOL(xmit_recursion);
+
++static inline int xmit_rec_read(void)
++{
++ return __this_cpu_read(xmit_recursion);
++}
++
++static inline void xmit_rec_inc(void)
++{
++ __this_cpu_inc(xmit_recursion);
++}
++
++static inline int xmit_rec_dec(void)
++{
++ __this_cpu_dec(xmit_recursion);
++}
++#endif
++
+ #define RECURSION_LIMIT 10
+
+ /**
+@@ -2984,7 +3027,7 @@
+
+ if (txq->xmit_lock_owner != cpu) {
+
+- if (__this_cpu_read(xmit_recursion) > RECURSION_LIMIT)
++ if (xmit_rec_read() > RECURSION_LIMIT)
+ goto recursion_alert;
+
+ skb = validate_xmit_skb(skb, dev);
+@@ -2994,9 +3037,9 @@
+ HARD_TX_LOCK(dev, txq, cpu);
+
+ if (!netif_xmit_stopped(txq)) {
+- __this_cpu_inc(xmit_recursion);
++ xmit_rec_inc();
+ skb = dev_hard_start_xmit(skb, dev, txq, &rc);
+- __this_cpu_dec(xmit_recursion);
++ xmit_rec_dec();
+ if (dev_xmit_complete(rc)) {
+ HARD_TX_UNLOCK(dev, txq);
+ goto out;
+@@ -3370,6 +3413,7 @@
rps_unlock(sd);
local_irq_restore(flags);
@@ -26864,7 +27881,7 @@ diff -Nur linux-4.1.13.orig/net/core/dev.c linux-4.1.13/net/core/dev.c
atomic_long_inc(&skb->dev->rx_dropped);
kfree_skb(skb);
-@@ -3383,7 +3392,7 @@
+@@ -3388,7 +3432,7 @@
struct rps_dev_flow voidflow, *rflow = &voidflow;
int cpu;
@@ -26873,7 +27890,7 @@ diff -Nur linux-4.1.13.orig/net/core/dev.c linux-4.1.13/net/core/dev.c
rcu_read_lock();
cpu = get_rps_cpu(skb->dev, skb, &rflow);
-@@ -3393,13 +3402,13 @@
+@@ -3398,13 +3442,13 @@
ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail);
rcu_read_unlock();
@@ -26890,7 +27907,7 @@ diff -Nur linux-4.1.13.orig/net/core/dev.c linux-4.1.13/net/core/dev.c
}
return ret;
}
-@@ -3433,16 +3442,44 @@
+@@ -3438,16 +3482,44 @@
trace_netif_rx_ni_entry(skb);
@@ -26939,7 +27956,7 @@ diff -Nur linux-4.1.13.orig/net/core/dev.c linux-4.1.13/net/core/dev.c
static void net_tx_action(struct softirq_action *h)
{
struct softnet_data *sd = this_cpu_ptr(&softnet_data);
-@@ -3484,7 +3521,7 @@
+@@ -3489,7 +3561,7 @@
head = head->next_sched;
root_lock = qdisc_lock(q);
@@ -26948,7 +27965,7 @@ diff -Nur linux-4.1.13.orig/net/core/dev.c linux-4.1.13/net/core/dev.c
smp_mb__before_atomic();
clear_bit(__QDISC_STATE_SCHED,
&q->state);
-@@ -3881,7 +3918,7 @@
+@@ -3886,7 +3958,7 @@
skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) {
if (skb->dev == dev) {
__skb_unlink(skb, &sd->input_pkt_queue);
@@ -26957,7 +27974,7 @@ diff -Nur linux-4.1.13.orig/net/core/dev.c linux-4.1.13/net/core/dev.c
input_queue_head_incr(sd);
}
}
-@@ -3890,10 +3927,13 @@
+@@ -3895,10 +3967,13 @@
skb_queue_walk_safe(&sd->process_queue, skb, tmp) {
if (skb->dev == dev) {
__skb_unlink(skb, &sd->process_queue);
@@ -26972,7 +27989,7 @@ diff -Nur linux-4.1.13.orig/net/core/dev.c linux-4.1.13/net/core/dev.c
}
static int napi_gro_complete(struct sk_buff *skb)
-@@ -4344,6 +4384,7 @@
+@@ -4349,6 +4424,7 @@
sd->rps_ipi_list = NULL;
local_irq_enable();
@@ -26980,7 +27997,7 @@ diff -Nur linux-4.1.13.orig/net/core/dev.c linux-4.1.13/net/core/dev.c
/* Send pending IPI's to kick RPS processing on remote cpus. */
while (remsd) {
-@@ -4357,6 +4398,7 @@
+@@ -4362,6 +4438,7 @@
} else
#endif
local_irq_enable();
@@ -26988,7 +28005,7 @@ diff -Nur linux-4.1.13.orig/net/core/dev.c linux-4.1.13/net/core/dev.c
}
static bool sd_has_rps_ipi_waiting(struct softnet_data *sd)
-@@ -4438,6 +4480,7 @@
+@@ -4443,6 +4520,7 @@
local_irq_save(flags);
____napi_schedule(this_cpu_ptr(&softnet_data), n);
local_irq_restore(flags);
@@ -26996,7 +28013,16 @@ diff -Nur linux-4.1.13.orig/net/core/dev.c linux-4.1.13/net/core/dev.c
}
EXPORT_SYMBOL(__napi_schedule);
-@@ -6926,7 +6969,7 @@
+@@ -4717,7 +4795,7 @@
+ list_splice_tail(&repoll, &list);
+ list_splice(&list, &sd->poll_list);
+ if (!list_empty(&sd->poll_list))
+- __raise_softirq_irqoff(NET_RX_SOFTIRQ);
++ __raise_softirq_irqoff_ksoft(NET_RX_SOFTIRQ);
+
+ net_rps_action_and_irq_enable(sd);
+ }
+@@ -6931,7 +7009,7 @@
void synchronize_net(void)
{
might_sleep();
@@ -27005,7 +28031,7 @@ diff -Nur linux-4.1.13.orig/net/core/dev.c linux-4.1.13/net/core/dev.c
synchronize_rcu_expedited();
else
synchronize_rcu();
-@@ -7167,16 +7210,20 @@
+@@ -7172,16 +7250,20 @@
raise_softirq_irqoff(NET_TX_SOFTIRQ);
local_irq_enable();
@@ -27027,7 +28053,7 @@ diff -Nur linux-4.1.13.orig/net/core/dev.c linux-4.1.13/net/core/dev.c
return NOTIFY_OK;
}
-@@ -7478,8 +7525,9 @@
+@@ -7483,8 +7565,9 @@
for_each_possible_cpu(i) {
struct softnet_data *sd = &per_cpu(softnet_data, i);
@@ -27039,9 +28065,9 @@ diff -Nur linux-4.1.13.orig/net/core/dev.c linux-4.1.13/net/core/dev.c
INIT_LIST_HEAD(&sd->poll_list);
sd->output_queue_tailp = &sd->output_queue;
#ifdef CONFIG_RPS
-diff -Nur linux-4.1.13.orig/net/core/skbuff.c linux-4.1.13/net/core/skbuff.c
---- linux-4.1.13.orig/net/core/skbuff.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/net/core/skbuff.c 2015-11-29 09:23:09.669610195 +0100
+diff -Nur linux-4.1.20.orig/net/core/skbuff.c linux-4.1.20/net/core/skbuff.c
+--- linux-4.1.20.orig/net/core/skbuff.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/net/core/skbuff.c 2016-03-21 20:18:34.000000000 +0100
@@ -63,6 +63,7 @@
#include <linux/errqueue.h>
#include <linux/prefetch.h>
@@ -27050,15 +28076,16 @@ diff -Nur linux-4.1.13.orig/net/core/skbuff.c linux-4.1.13/net/core/skbuff.c
#include <net/protocol.h>
#include <net/dst.h>
-@@ -356,6 +357,7 @@
+@@ -358,6 +359,8 @@
};
static DEFINE_PER_CPU(struct netdev_alloc_cache, netdev_alloc_cache);
static DEFINE_PER_CPU(struct netdev_alloc_cache, napi_alloc_cache);
+static DEFINE_LOCAL_IRQ_LOCK(netdev_alloc_lock);
++static DEFINE_LOCAL_IRQ_LOCK(napi_alloc_cache_lock);
static struct page *__page_frag_refill(struct netdev_alloc_cache *nc,
gfp_t gfp_mask)
-@@ -433,9 +435,9 @@
+@@ -435,9 +438,9 @@
unsigned long flags;
void *data;
@@ -27070,10 +28097,24 @@ diff -Nur linux-4.1.13.orig/net/core/skbuff.c linux-4.1.13/net/core/skbuff.c
return data;
}
-diff -Nur linux-4.1.13.orig/net/core/sock.c linux-4.1.13/net/core/sock.c
---- linux-4.1.13.orig/net/core/sock.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/net/core/sock.c 2015-11-29 09:23:09.669610195 +0100
-@@ -2370,12 +2370,11 @@
+@@ -456,7 +459,12 @@
+
+ static void *__napi_alloc_frag(unsigned int fragsz, gfp_t gfp_mask)
+ {
+- return __alloc_page_frag(&napi_alloc_cache, fragsz, gfp_mask);
++ void *data;
++
++ local_lock(napi_alloc_cache_lock);
++ data = __alloc_page_frag(&napi_alloc_cache, fragsz, gfp_mask);
++ local_unlock(napi_alloc_cache_lock);
++ return data;
+ }
+
+ void *napi_alloc_frag(unsigned int fragsz)
+diff -Nur linux-4.1.20.orig/net/core/sock.c linux-4.1.20/net/core/sock.c
+--- linux-4.1.20.orig/net/core/sock.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/net/core/sock.c 2016-03-21 20:18:34.000000000 +0100
+@@ -2369,12 +2369,11 @@
if (sk->sk_lock.owned)
__lock_sock(sk);
sk->sk_lock.owned = 1;
@@ -27087,9 +28128,9 @@ diff -Nur linux-4.1.13.orig/net/core/sock.c linux-4.1.13/net/core/sock.c
}
EXPORT_SYMBOL(lock_sock_nested);
-diff -Nur linux-4.1.13.orig/net/ipv4/icmp.c linux-4.1.13/net/ipv4/icmp.c
---- linux-4.1.13.orig/net/ipv4/icmp.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/net/ipv4/icmp.c 2015-11-29 09:23:09.669610195 +0100
+diff -Nur linux-4.1.20.orig/net/ipv4/icmp.c linux-4.1.20/net/ipv4/icmp.c
+--- linux-4.1.20.orig/net/ipv4/icmp.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/net/ipv4/icmp.c 2016-03-21 20:18:34.000000000 +0100
@@ -69,6 +69,7 @@
#include <linux/jiffies.h>
#include <linux/kernel.h>
@@ -27141,9 +28182,9 @@ diff -Nur linux-4.1.13.orig/net/ipv4/icmp.c linux-4.1.13/net/ipv4/icmp.c
}
/* should there be an ICMP stat for ignored echos? */
return true;
-diff -Nur linux-4.1.13.orig/net/ipv4/sysctl_net_ipv4.c linux-4.1.13/net/ipv4/sysctl_net_ipv4.c
---- linux-4.1.13.orig/net/ipv4/sysctl_net_ipv4.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/net/ipv4/sysctl_net_ipv4.c 2015-11-29 09:23:09.669610195 +0100
+diff -Nur linux-4.1.20.orig/net/ipv4/sysctl_net_ipv4.c linux-4.1.20/net/ipv4/sysctl_net_ipv4.c
+--- linux-4.1.20.orig/net/ipv4/sysctl_net_ipv4.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/net/ipv4/sysctl_net_ipv4.c 2016-03-21 20:18:34.000000000 +0100
@@ -779,6 +779,13 @@
.proc_handler = proc_dointvec
},
@@ -27158,9 +28199,9 @@ diff -Nur linux-4.1.13.orig/net/ipv4/sysctl_net_ipv4.c linux-4.1.13/net/ipv4/sys
.procname = "icmp_ignore_bogus_error_responses",
.data = &init_net.ipv4.sysctl_icmp_ignore_bogus_error_responses,
.maxlen = sizeof(int),
-diff -Nur linux-4.1.13.orig/net/mac80211/rx.c linux-4.1.13/net/mac80211/rx.c
---- linux-4.1.13.orig/net/mac80211/rx.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/net/mac80211/rx.c 2015-11-29 09:23:09.669610195 +0100
+diff -Nur linux-4.1.20.orig/net/mac80211/rx.c linux-4.1.20/net/mac80211/rx.c
+--- linux-4.1.20.orig/net/mac80211/rx.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/net/mac80211/rx.c 2016-03-21 20:18:34.000000000 +0100
@@ -3554,7 +3554,7 @@
struct ieee80211_supported_band *sband;
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
@@ -27170,9 +28211,9 @@ diff -Nur linux-4.1.13.orig/net/mac80211/rx.c linux-4.1.13/net/mac80211/rx.c
if (WARN_ON(status->band >= IEEE80211_NUM_BANDS))
goto drop;
-diff -Nur linux-4.1.13.orig/net/netfilter/core.c linux-4.1.13/net/netfilter/core.c
---- linux-4.1.13.orig/net/netfilter/core.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/net/netfilter/core.c 2015-11-29 09:23:09.669610195 +0100
+diff -Nur linux-4.1.20.orig/net/netfilter/core.c linux-4.1.20/net/netfilter/core.c
+--- linux-4.1.20.orig/net/netfilter/core.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/net/netfilter/core.c 2016-03-21 20:18:34.000000000 +0100
@@ -22,11 +22,17 @@
#include <linux/proc_fs.h>
#include <linux/mutex.h>
@@ -27191,9 +28232,9 @@ diff -Nur linux-4.1.13.orig/net/netfilter/core.c linux-4.1.13/net/netfilter/core
static DEFINE_MUTEX(afinfo_mutex);
const struct nf_afinfo __rcu *nf_afinfo[NFPROTO_NUMPROTO] __read_mostly;
-diff -Nur linux-4.1.13.orig/net/packet/af_packet.c linux-4.1.13/net/packet/af_packet.c
---- linux-4.1.13.orig/net/packet/af_packet.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/net/packet/af_packet.c 2015-11-29 09:23:09.669610195 +0100
+diff -Nur linux-4.1.20.orig/net/packet/af_packet.c linux-4.1.20/net/packet/af_packet.c
+--- linux-4.1.20.orig/net/packet/af_packet.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/net/packet/af_packet.c 2016-03-21 20:18:34.000000000 +0100
@@ -63,6 +63,7 @@
#include <linux/if_packet.h>
#include <linux/wireless.h>
@@ -27220,9 +28261,9 @@ diff -Nur linux-4.1.13.orig/net/packet/af_packet.c linux-4.1.13/net/packet/af_pa
}
}
prb_close_block(pkc, pbd, po, status);
-diff -Nur linux-4.1.13.orig/net/rds/ib_rdma.c linux-4.1.13/net/rds/ib_rdma.c
---- linux-4.1.13.orig/net/rds/ib_rdma.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/net/rds/ib_rdma.c 2015-11-29 09:23:09.669610195 +0100
+diff -Nur linux-4.1.20.orig/net/rds/ib_rdma.c linux-4.1.20/net/rds/ib_rdma.c
+--- linux-4.1.20.orig/net/rds/ib_rdma.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/net/rds/ib_rdma.c 2016-03-21 20:18:34.000000000 +0100
@@ -34,6 +34,7 @@
#include <linux/slab.h>
#include <linux/rculist.h>
@@ -27240,10 +28281,10 @@ diff -Nur linux-4.1.13.orig/net/rds/ib_rdma.c linux-4.1.13/net/rds/ib_rdma.c
}
}
-diff -Nur linux-4.1.13.orig/net/sched/sch_generic.c linux-4.1.13/net/sched/sch_generic.c
---- linux-4.1.13.orig/net/sched/sch_generic.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/net/sched/sch_generic.c 2015-11-29 09:23:09.669610195 +0100
-@@ -894,7 +894,7 @@
+diff -Nur linux-4.1.20.orig/net/sched/sch_generic.c linux-4.1.20/net/sched/sch_generic.c
+--- linux-4.1.20.orig/net/sched/sch_generic.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/net/sched/sch_generic.c 2016-03-21 20:18:34.000000000 +0100
+@@ -896,7 +896,7 @@
/* Wait for outstanding qdisc_run calls. */
list_for_each_entry(dev, head, close_list)
while (some_qdisc_is_busy(dev))
@@ -27252,9 +28293,9 @@ diff -Nur linux-4.1.13.orig/net/sched/sch_generic.c linux-4.1.13/net/sched/sch_g
}
void dev_deactivate(struct net_device *dev)
-diff -Nur linux-4.1.13.orig/net/sunrpc/svc_xprt.c linux-4.1.13/net/sunrpc/svc_xprt.c
---- linux-4.1.13.orig/net/sunrpc/svc_xprt.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/net/sunrpc/svc_xprt.c 2015-11-29 09:23:09.669610195 +0100
+diff -Nur linux-4.1.20.orig/net/sunrpc/svc_xprt.c linux-4.1.20/net/sunrpc/svc_xprt.c
+--- linux-4.1.20.orig/net/sunrpc/svc_xprt.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/net/sunrpc/svc_xprt.c 2016-03-21 20:18:34.000000000 +0100
@@ -341,7 +341,7 @@
goto out;
}
@@ -27282,9 +28323,9 @@ diff -Nur linux-4.1.13.orig/net/sunrpc/svc_xprt.c linux-4.1.13/net/sunrpc/svc_xp
out:
trace_svc_xprt_do_enqueue(xprt, rqstp);
}
-diff -Nur linux-4.1.13.orig/scripts/mkcompile_h linux-4.1.13/scripts/mkcompile_h
---- linux-4.1.13.orig/scripts/mkcompile_h 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/scripts/mkcompile_h 2015-11-29 09:23:09.669610195 +0100
+diff -Nur linux-4.1.20.orig/scripts/mkcompile_h linux-4.1.20/scripts/mkcompile_h
+--- linux-4.1.20.orig/scripts/mkcompile_h 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/scripts/mkcompile_h 2016-03-21 20:18:34.000000000 +0100
@@ -4,7 +4,8 @@
ARCH=$2
SMP=$3
@@ -27303,10 +28344,10 @@ diff -Nur linux-4.1.13.orig/scripts/mkcompile_h linux-4.1.13/scripts/mkcompile_h
UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
# Truncate to maximum length
-diff -Nur linux-4.1.13.orig/sound/core/pcm_native.c linux-4.1.13/sound/core/pcm_native.c
---- linux-4.1.13.orig/sound/core/pcm_native.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/sound/core/pcm_native.c 2015-11-29 09:23:09.669610195 +0100
-@@ -123,7 +123,7 @@
+diff -Nur linux-4.1.20.orig/sound/core/pcm_native.c linux-4.1.20/sound/core/pcm_native.c
+--- linux-4.1.20.orig/sound/core/pcm_native.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/sound/core/pcm_native.c 2016-03-21 20:18:34.000000000 +0100
+@@ -135,7 +135,7 @@
void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream)
{
if (!substream->pcm->nonatomic)
@@ -27315,7 +28356,7 @@ diff -Nur linux-4.1.13.orig/sound/core/pcm_native.c linux-4.1.13/sound/core/pcm_
snd_pcm_stream_lock(substream);
}
EXPORT_SYMBOL_GPL(snd_pcm_stream_lock_irq);
-@@ -138,7 +138,7 @@
+@@ -150,7 +150,7 @@
{
snd_pcm_stream_unlock(substream);
if (!substream->pcm->nonatomic)
@@ -27324,7 +28365,7 @@ diff -Nur linux-4.1.13.orig/sound/core/pcm_native.c linux-4.1.13/sound/core/pcm_
}
EXPORT_SYMBOL_GPL(snd_pcm_stream_unlock_irq);
-@@ -146,7 +146,7 @@
+@@ -158,7 +158,7 @@
{
unsigned long flags = 0;
if (!substream->pcm->nonatomic)
@@ -27333,7 +28374,7 @@ diff -Nur linux-4.1.13.orig/sound/core/pcm_native.c linux-4.1.13/sound/core/pcm_
snd_pcm_stream_lock(substream);
return flags;
}
-@@ -164,7 +164,7 @@
+@@ -176,7 +176,7 @@
{
snd_pcm_stream_unlock(substream);
if (!substream->pcm->nonatomic)
@@ -27342,9 +28383,9 @@ diff -Nur linux-4.1.13.orig/sound/core/pcm_native.c linux-4.1.13/sound/core/pcm_
}
EXPORT_SYMBOL_GPL(snd_pcm_stream_unlock_irqrestore);
-diff -Nur linux-4.1.13.orig/sound/soc/intel/atom/sst/sst.c linux-4.1.13/sound/soc/intel/atom/sst/sst.c
---- linux-4.1.13.orig/sound/soc/intel/atom/sst/sst.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/sound/soc/intel/atom/sst/sst.c 2015-11-29 09:23:09.673609931 +0100
+diff -Nur linux-4.1.20.orig/sound/soc/intel/atom/sst/sst.c linux-4.1.20/sound/soc/intel/atom/sst/sst.c
+--- linux-4.1.20.orig/sound/soc/intel/atom/sst/sst.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/sound/soc/intel/atom/sst/sst.c 2016-03-21 20:18:34.000000000 +0100
@@ -368,8 +368,8 @@
* initialize by FW or driver when firmware is loaded
*/
@@ -27356,9 +28397,9 @@ diff -Nur linux-4.1.13.orig/sound/soc/intel/atom/sst/sst.c linux-4.1.13/sound/so
spin_unlock_irqrestore(&ctx->ipc_spin_lock, irq_flags);
}
-diff -Nur linux-4.1.13.orig/virt/kvm/async_pf.c linux-4.1.13/virt/kvm/async_pf.c
---- linux-4.1.13.orig/virt/kvm/async_pf.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/virt/kvm/async_pf.c 2015-11-29 09:23:09.673609931 +0100
+diff -Nur linux-4.1.20.orig/virt/kvm/async_pf.c linux-4.1.20/virt/kvm/async_pf.c
+--- linux-4.1.20.orig/virt/kvm/async_pf.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/virt/kvm/async_pf.c 2016-03-21 20:18:34.000000000 +0100
@@ -94,8 +94,8 @@
trace_kvm_async_pf_completed(addr, gva);
@@ -27370,9 +28411,9 @@ diff -Nur linux-4.1.13.orig/virt/kvm/async_pf.c linux-4.1.13/virt/kvm/async_pf.c
mmput(mm);
kvm_put_kvm(vcpu->kvm);
-diff -Nur linux-4.1.13.orig/virt/kvm/kvm_main.c linux-4.1.13/virt/kvm/kvm_main.c
---- linux-4.1.13.orig/virt/kvm/kvm_main.c 2015-11-09 23:34:10.000000000 +0100
-+++ linux-4.1.13/virt/kvm/kvm_main.c 2015-11-29 09:23:09.701608072 +0100
+diff -Nur linux-4.1.20.orig/virt/kvm/kvm_main.c linux-4.1.20/virt/kvm/kvm_main.c
+--- linux-4.1.20.orig/virt/kvm/kvm_main.c 2016-03-17 19:11:03.000000000 +0100
++++ linux-4.1.20/virt/kvm/kvm_main.c 2016-03-21 20:18:34.000000000 +0100
@@ -218,7 +218,7 @@
vcpu->kvm = kvm;
vcpu->vcpu_id = id;
diff --git a/target/linux/patches/4.1.16/regmap-default-on.patch b/target/linux/patches/4.1.20/regmap-default-on.patch
index 8d72224bf..8d72224bf 100644
--- a/target/linux/patches/4.1.16/regmap-default-on.patch
+++ b/target/linux/patches/4.1.20/regmap-default-on.patch
diff --git a/target/linux/patches/4.1.16/remove-warn.patch b/target/linux/patches/4.1.20/remove-warn.patch
index 1f89c710d..1f89c710d 100644
--- a/target/linux/patches/4.1.16/remove-warn.patch
+++ b/target/linux/patches/4.1.20/remove-warn.patch
diff --git a/target/linux/patches/4.1.16/startup.patch b/target/linux/patches/4.1.20/startup.patch
index d396b75e4..d396b75e4 100644
--- a/target/linux/patches/4.1.16/startup.patch
+++ b/target/linux/patches/4.1.20/startup.patch
diff --git a/target/linux/patches/4.1.16/use-libgcc-for-sh.patch b/target/linux/patches/4.1.20/use-libgcc-for-sh.patch
index 6420219b0..6420219b0 100644
--- a/target/linux/patches/4.1.16/use-libgcc-for-sh.patch
+++ b/target/linux/patches/4.1.20/use-libgcc-for-sh.patch