diff --git a/Documentation/accounting/psi.txt b/Documentation/accounting/psi.txt
index b8ca28b60215..4fb40fe94828 100644
--- a/Documentation/accounting/psi.txt
+++ b/Documentation/accounting/psi.txt
@@ -63,6 +63,110 @@ tracked and exported as well, to allow detection of latency spikes
 which wouldn't necessarily make a dent in the time averages, or to
 average trends over custom time frames.
 
+Monitoring for pressure thresholds
+==================================
+
+Users can register triggers and use poll() to be woken up when resource
+pressure exceeds certain thresholds.
+
+A trigger describes the maximum cumulative stall time over a specific
+time window, e.g. 100ms of total stall time within any 500ms window to
+generate a wakeup event.
+
+To register a trigger user has to open psi interface file under
+/proc/pressure/ representing the resource to be monitored and write the
+desired threshold and time window. The open file descriptor should be
+used to wait for trigger events using select(), poll() or epoll().
+The following format is used:
+
+<some|full> <stall amount in us> <time window in us>
+
+For example writing "some 150000 1000000" into /proc/pressure/memory
+would add 150ms threshold for partial memory stall measured within
+1sec time window. Writing "full 50000 1000000" into /proc/pressure/io
+would add 50ms threshold for full io stall measured within 1sec time window.
+
+Triggers can be set on more than one psi metric and more than one trigger
+for the same psi metric can be specified. However for each trigger a separate
+file descriptor is required to be able to poll it separately from others,
+therefore for each trigger a separate open() syscall should be made even
+when opening the same psi interface file.
+
+Monitors activate only when system enters stall state for the monitored
+psi metric and deactivates upon exit from the stall state. While system is
+in the stall state psi signal growth is monitored at a rate of 10 times per
+tracking window.
+
+The kernel accepts window sizes ranging from 500ms to 10s, therefore min
+monitoring update interval is 50ms and max is 1s. Min limit is set to
+prevent overly frequent polling. Max limit is chosen as a high enough number
+after which monitors are most likely not needed and psi averages can be used
+instead.
+
+When activated, psi monitor stays active for at least the duration of one
+tracking window to avoid repeated activations/deactivations when system is
+bouncing in and out of the stall state.
+
+Notifications to the userspace are rate-limited to one per tracking window.
+
+The trigger will de-register when the file descriptor used to define the
+trigger  is closed.
+
+Userspace monitor usage example
+===============================
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <poll.h>
+#include <string.h>
+#include <unistd.h>
+
+/*
+ * Monitor memory partial stall with 1s tracking window size
+ * and 150ms threshold.
+ */
+int main() {
+	const char trig[] = "some 150000 1000000";
+	struct pollfd fds;
+	int n;
+
+	fds.fd = open("/proc/pressure/memory", O_RDWR | O_NONBLOCK);
+	if (fds.fd < 0) {
+		printf("/proc/pressure/memory open error: %s\n",
+			strerror(errno));
+		return 1;
+	}
+	fds.events = POLLPRI;
+
+	if (write(fds.fd, trig, strlen(trig) + 1) < 0) {
+		printf("/proc/pressure/memory write error: %s\n",
+			strerror(errno));
+		return 1;
+	}
+
+	printf("waiting for events...\n");
+	while (1) {
+		n = poll(&fds, 1, -1);
+		if (n < 0) {
+			printf("poll error: %s\n", strerror(errno));
+			return 1;
+		}
+		if (fds.revents & POLLERR) {
+			printf("got POLLERR, event source is gone\n");
+			return 0;
+		}
+		if (fds.revents & POLLPRI) {
+			printf("event triggered!\n");
+		} else {
+			printf("unknown event received: 0x%x\n", fds.revents);
+			return 1;
+		}
+	}
+
+	return 0;
+}
+
 Cgroup2 interface
 =================
 
@@ -71,3 +175,6 @@ mounted, pressure stall information is also tracked for tasks grouped
 into cgroups. Each subdirectory in the cgroupfs mountpoint contains
 cpu.pressure, memory.pressure, and io.pressure files; the format is
 the same as the /proc/pressure/ files.
+
+Per-cgroup psi monitors can be specified and used the same way as
+system-wide ones.
diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index 20f92c16ffbf..19c4e78666ff 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -177,6 +177,15 @@ cgroup v2 currently supports the following mount options.
 	ignored on non-init namespace mounts.  Please refer to the
 	Delegation section for details.
 
+  memory_localevents
+
+        Only populate memory.events with data for the current cgroup,
+        and not any subtrees. This is legacy behaviour, the default
+        behaviour without this option is to include subtree counts.
+        This option is system wide and can only be set on mount or
+        modified through remount from the init namespace. The mount
+        option is ignored on non-init namespace mounts.
+
 
 Organizing Processes and Threads
 --------------------------------
@@ -606,8 +615,8 @@ on an IO device and is an example of this type.
 Protections
 -----------
 
-A cgroup is protected to be allocated upto the configured amount of
-the resource if the usages of all its ancestors are under their
+A cgroup is protected upto the configured amount of the resource
+as long as the usages of all its ancestors are under their
 protected levels.  Protections can be hard guarantees or best effort
 soft boundaries.  Protections can also be over-committed in which case
 only upto the amount available to the parent is protected among
@@ -1020,7 +1029,10 @@ PAGE_SIZE multiple when read back.
 	is within its effective min boundary, the cgroup's memory
 	won't be reclaimed under any conditions. If there is no
 	unprotected reclaimable memory available, OOM killer
-	is invoked.
+	is invoked. Above the effective min boundary (or
+	effective low boundary if it is higher), pages are reclaimed
+	proportionally to the overage, reducing reclaim pressure for
+	smaller overages.
 
        Effective min boundary is limited by memory.min values of
 	all ancestor cgroups. If there is memory.min overcommitment
@@ -1042,7 +1054,10 @@ PAGE_SIZE multiple when read back.
 	Best-effort memory protection.  If the memory usage of a
 	cgroup is within its effective low boundary, the cgroup's
 	memory won't be reclaimed unless memory can be reclaimed
-	from unprotected cgroups.
+	from unprotected cgroups.  Above the effective low boundary (or
+	effective min boundary if it is higher), pages are reclaimed
+	proportionally to the overage, reducing reclaim pressure for
+	smaller overages.
 
 	Effective low boundary is limited by memory.low values of
 	all ancestor cgroups. If there is memory.low overcommitment
@@ -2299,8 +2314,10 @@ system performance due to overreclaim, to the point where the feature
 becomes self-defeating.
 
 The memory.low boundary on the other hand is a top-down allocated
-reserve.  A cgroup enjoys reclaim protection when it's within its low,
-which makes delegation of subtrees possible.
+reserve.  A cgroup enjoys reclaim protection when it's within its
+effective low, which makes delegation of subtrees possible. It also
+enjoys having reclaim pressure proportional to its overage when
+above its effective low.
 
 The original high boundary, the hard limit, is defined as a strict
 limit that can not budge, even if the OOM killer has to be called.
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 2b8ee90bb644..27a5f8c496b5 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1828,6 +1828,12 @@
 	ip=		[IP_PNP]
 			See Documentation/filesystems/nfs/nfsroot.txt.
 
+	ipcmni_extend	[KNL] Extend the maximum number of unique System V
+			IPC identifiers from 32,768 to 16,777,216. Also do
+			cyclical identifier allocation through the entire
+			24-bit identifier space to reduce the chance of
+			identifier reuse.
+
 	irqaffinity=	[SMP] Set the default irq affinity mask
 			The argument is a cpu list, as described above.
 
@@ -3110,6 +3116,16 @@
 			This will also cause panics on machine check exceptions.
 			Useful together with panic=30 to trigger a reboot.
 
+	page_alloc.shuffle=
+			[KNL] Boolean flag to control whether the page allocator
+			should randomize its free lists. The randomization may
+			be automatically enabled if the kernel detects it is
+			running on a platform with a direct-mapped memory-side
+			cache, and this parameter can be used to
+			override/disable that behavior. The state of the flag
+			can be read from sysfs at:
+			/sys/module/page_alloc/parameters/shuffle.
+
 	page_owner=	[KNL] Boot-time page_owner enabling option.
 			Storage of the information about who allocated
 			each page is disabled in default. With this switch,
diff --git a/Documentation/core-api/genalloc.rst b/Documentation/core-api/genalloc.rst
index 6b38a39fab24..a534cc7ebd05 100644
--- a/Documentation/core-api/genalloc.rst
+++ b/Documentation/core-api/genalloc.rst
@@ -129,7 +129,7 @@ writing of special-purpose memory allocators in the future.
    :functions: gen_pool_for_each_chunk
 
 .. kernel-doc:: lib/genalloc.c
-   :functions: addr_in_gen_pool
+   :functions: gen_pool_has_addr
 
 .. kernel-doc:: lib/genalloc.c
    :functions: gen_pool_avail
diff --git a/Documentation/devicetree/bindings/arm/amlogic.txt b/Documentation/devicetree/bindings/arm/amlogic.txt
index 7f40cb5f490b..061f7b98a07f 100644
--- a/Documentation/devicetree/bindings/arm/amlogic.txt
+++ b/Documentation/devicetree/bindings/arm/amlogic.txt
@@ -110,6 +110,7 @@ Board compatible values (alphabetically, grouped by SoC):
 
   - "amlogic,u200" (Meson g12a s905d2)
   - "amediatech,x96-max" (Meson g12a s905x2)
+  - "seirobotics,sei510" (Meson g12a s905x2)
 
 Amlogic Meson Firmware registers Interface
 ------------------------------------------
diff --git a/Documentation/devicetree/bindings/arm/atmel-at91.txt b/Documentation/devicetree/bindings/arm/atmel-at91.txt
index 4bf1b4da7659..99dee23c74a4 100644
--- a/Documentation/devicetree/bindings/arm/atmel-at91.txt
+++ b/Documentation/devicetree/bindings/arm/atmel-at91.txt
@@ -25,6 +25,7 @@ compatible: must be one of:
     o "atmel,at91sam9n12"
     o "atmel,at91sam9rl"
     o "atmel,at91sam9xe"
+    o "microchip,sam9x60"
  * "atmel,sama5" for SoCs using a Cortex-A5, shall be extended with the specific
    SoC family:
     o "atmel,sama5d2" shall be extended with the specific SoC compatible:
diff --git a/Documentation/devicetree/bindings/arm/rockchip.yaml b/Documentation/devicetree/bindings/arm/rockchip.yaml
index 061a03edf9c8..0161b4a66586 100644
--- a/Documentation/devicetree/bindings/arm/rockchip.yaml
+++ b/Documentation/devicetree/bindings/arm/rockchip.yaml
@@ -97,6 +97,7 @@ properties:
           - enum:
               - friendlyarm,nanopc-t4
               - friendlyarm,nanopi-m4
+              - friendlyarm,nanopi-neo4
           - const: rockchip,rk3399
 
       - description: GeekBuying GeekBox
@@ -308,6 +309,11 @@ properties:
           - const: netxeon,r89
           - const: rockchip,rk3288
 
+      - description: Orange Pi RK3399 board
+        items:
+          - const: rockchip,rk3399-orangepi
+          - const: rockchip,rk3399
+
       - description: Phytec phyCORE-RK3288 Rapid Development Kit
         items:
           - const: phytec,rk3288-pcm-947
diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
index cf759e5f9b10..1214192847ac 100644
--- a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
+++ b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
@@ -21,6 +21,11 @@ edge.
 	Definition: should specify the IRQ used by the remote processor to
 		    signal this processor about communication related events
 
+- qcom,remote-pid:
+	Usage: required for glink-smem
+	Value type: <u32>
+	Definition: specifies the identifier of the remote endpoint of this edge
+
 - qcom,rpm-msg-ram:
 	Usage: required for glink-rpm
 	Value type: <prop-encoded-array>
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 8162b0eb4b50..bb6f6e8a2eee 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -353,6 +353,7 @@ sandisk	Sandisk Corporation
 sbs	Smart Battery System
 schindler	Schindler
 seagate	Seagate Technology PLC
+seirobotics	Shenzhen SEI Robotics Co., Ltd
 semtech	Semtech Corporation
 sensirion	Sensirion AG
 sff	Small Form Factor Committee
diff --git a/Documentation/devicetree/bindings/virtio/iommu.txt b/Documentation/devicetree/bindings/virtio/iommu.txt
new file mode 100644
index 000000000000..2407fea0651c
--- /dev/null
+++ b/Documentation/devicetree/bindings/virtio/iommu.txt
@@ -0,0 +1,66 @@
+* virtio IOMMU PCI device
+
+When virtio-iommu uses the PCI transport, its programming interface is
+discovered dynamically by the PCI probing infrastructure. However the
+device tree statically describes the relation between IOMMU and DMA
+masters. Therefore, the PCI root complex that hosts the virtio-iommu
+contains a child node representing the IOMMU device explicitly.
+
+Required properties:
+
+- compatible:	Should be "virtio,pci-iommu"
+- reg:		PCI address of the IOMMU. As defined in the PCI Bus
+		Binding reference [1], the reg property is a five-cell
+		address encoded as (phys.hi phys.mid phys.lo size.hi
+		size.lo). phys.hi should contain the device's BDF as
+		0b00000000 bbbbbbbb dddddfff 00000000. The other cells
+		should be zero.
+- #iommu-cells:	Each platform DMA master managed by the IOMMU is assigned
+		an endpoint ID, described by the "iommus" property [2].
+		For virtio-iommu, #iommu-cells must be 1.
+
+Notes:
+
+- DMA from the IOMMU device isn't managed by another IOMMU. Therefore the
+  virtio-iommu node doesn't have an "iommus" property, and is omitted from
+  the iommu-map property of the root complex.
+
+Example:
+
+pcie@10000000 {
+	compatible = "pci-host-ecam-generic";
+	...
+
+	/* The IOMMU programming interface uses slot 00:01.0 */
+	iommu0: iommu@0008 {
+		compatible = "virtio,pci-iommu";
+		reg = <0x00000800 0 0 0 0>;
+		#iommu-cells = <1>;
+	};
+
+	/*
+	 * The IOMMU manages all functions in this PCI domain except
+	 * itself. Omit BDF 00:01.0.
+	 */
+	iommu-map = <0x0 &iommu0 0x0 0x8>
+		    <0x9 &iommu0 0x9 0xfff7>;
+};
+
+pcie@20000000 {
+	compatible = "pci-host-ecam-generic";
+	...
+	/*
+	 * The IOMMU also manages all functions from this domain,
+	 * with endpoint IDs 0x10000 - 0x1ffff
+	 */
+	iommu-map = <0x0 &iommu0 0x10000 0x10000>;
+};
+
+ethernet@fe001000 {
+	...
+	/* The IOMMU manages this platform device with endpoint ID 0x20000 */
+	iommus = <&iommu0 0x20000>;
+};
+
+[1] Documentation/devicetree/bindings/pci/pci.txt
+[2] Documentation/devicetree/bindings/iommu/iommu.txt
diff --git a/Documentation/devicetree/bindings/virtio/mmio.txt b/Documentation/devicetree/bindings/virtio/mmio.txt
index 5069c1b8e193..21af30fbb81f 100644
--- a/Documentation/devicetree/bindings/virtio/mmio.txt
+++ b/Documentation/devicetree/bindings/virtio/mmio.txt
@@ -8,10 +8,40 @@ Required properties:
 - reg:		control registers base address and size including configuration space
 - interrupts:	interrupt generated by the device
 
+Required properties for virtio-iommu:
+
+- #iommu-cells:	When the node corresponds to a virtio-iommu device, it is
+		linked to DMA masters using the "iommus" or "iommu-map"
+		properties [1][2]. #iommu-cells specifies the size of the
+		"iommus" property. For virtio-iommu #iommu-cells must be
+		1, each cell describing a single endpoint ID.
+
+Optional properties:
+
+- iommus:	If the device accesses memory through an IOMMU, it should
+		have an "iommus" property [1]. Since virtio-iommu itself
+		does not access memory through an IOMMU, the "virtio,mmio"
+		node cannot have both an "#iommu-cells" and an "iommus"
+		property.
+
 Example:
 
 	virtio_block@3000 {
 		compatible = "virtio,mmio";
 		reg = <0x3000 0x100>;
 		interrupts = <41>;
+
+		/* Device has endpoint ID 23 */
+		iommus = <&viommu 23>
 	}
+
+	viommu: iommu@3100 {
+		compatible = "virtio,mmio";
+		reg = <0x3100 0x100>;
+		interrupts = <42>;
+
+		#iommu-cells = <1>
+	}
+
+[1] Documentation/devicetree/bindings/iommu/iommu.txt
+[2] Documentation/devicetree/bindings/pci/pci-iommu.txt
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
index 1c22b21ae922..432d277a0e63 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -691,6 +691,18 @@ case what's actually required is:
 		p = READ_ONCE(b);
 	}
 
+Alternatively, a control dependency can be converted to a data dependency,
+e.g.:
+
+	q = READ_ONCE(a);
+	if (q) {
+		b = dependent_ptr_mb(b, q);
+		p = READ_ONCE(b);
+	}
+
+Note how the result of dependent_ptr_mb must be used with the following
+accesses in order to have an effect.
+
 However, stores are not speculated.  This means that ordering -is- provided
 for load-store control dependencies, as in the following example:
 
@@ -836,6 +848,12 @@ out-guess your code.  More generally, although READ_ONCE() does force
 the compiler to actually emit code for a given load, it does not force
 the compiler to use the results.
 
+Converting to a data dependency helps with this too:
+
+	q = READ_ONCE(a);
+	b = dependent_ptr_mb(b, q);
+	WRITE_ONCE(b, 1);
+
 In addition, control dependencies apply only to the then-clause and
 else-clause of the if-statement in question.  In particular, it does
 not necessarily apply to code following the if-statement:
@@ -875,6 +893,8 @@ to the CPU containing it.  See the section on "Multicopy atomicity"
 for more information.
 
 
+
+
 In summary:
 
   (*) Control dependencies can order prior loads against later stores.
diff --git a/MAINTAINERS b/MAINTAINERS
index e17ebf70b548..70e8fcd67f63 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -16559,6 +16559,13 @@ S:	Maintained
 F:	drivers/virtio/virtio_input.c
 F:	include/uapi/linux/virtio_input.h
 
+VIRTIO IOMMU DRIVER
+M:	Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
+L:	virtualization@lists.linux-foundation.org
+S:	Maintained
+F:	drivers/iommu/virtio-iommu.c
+F:	include/uapi/linux/virtio_iommu.h
+
 VIRTUAL BOX GUEST DEVICE DRIVER
 M:	Hans de Goede <hdegoede@redhat.com>
 M:	Arnd Bergmann <arnd@arndb.de>
diff --git a/Next/SHA1s b/Next/SHA1s
new file mode 100644
index 000000000000..95adce4cafe0
--- /dev/null
+++ b/Next/SHA1s
@@ -0,0 +1,298 @@
+Name		SHA1
+----		----
+origin		9e98c678c2d6ae3a17cb2de55d17f69dddaa231b
+fixes		2648624cfe7f34ad494280b83749956527689c9f
+kspp-gustavo	1f7ae812f87e656f535146fcd33af6b151c3607a
+kbuild-current	5453a3df2a5eb49bc24615d4cf0d66b2aae05e5f
+arc-current	9a18b5a412baf23137c8fddb4ea7f0c14087f31c
+arm-current	d410a8a49e3e00e07d43037e90f776d522b25a6a
+arm64-fixes	74698f6971f25d045301139413578865fc2bd8f9
+m68k-current	28713169d879b67be2ef2f84dcf54905de238294
+powerpc-fixes	8f5b27347e88b171c755562f0090ce40e514fc00
+sparc		7d762d69145a54d169f58e56d6dac57a5508debc
+fscrypt-current	ae64f9bd1d3621b5e60d7363bc20afb46aede215
+net		517ccc2aa50dbd7767a9eb8e1d9987a3ed7ced3e
+bpf		86be36f6502c52ddb4b85938145324fd07332da1
+ipsec		6ee02a54ef990a71bf542b6f0a4e3321de9d9c66
+netfilter	b8b27498659c65034032af79842913844a6cc79a
+ipvs		b2e3d68d1251a051a620f9086e18f7ffa6833b5b
+wireless-drivers	688cd8bd2c0fa9dc88e5ced55a73ddc79edf875d
+mac80211	d235c48b40d399328585a68f3f9bf7cc3062d586
+rdma-fixes	f09ef134a7ca3f0d2ce485a757f5b79809ebb803
+sound-current	2d012c65a9ca26a0ef87ea0a42f1653dd37155f5
+sound-asoc-fixes	5b4e1c6a68b00cc58fc3c5fe82e2896e9cf877d4
+regmap-fixes	f17b5f06cb92ef2250513a1e154c47b78df07d40
+regulator-fixes	078d354f8d7fec0003848e7315bae3298fa39bc3
+spi-fixes	8d0e51ac6f8c0f405fa820eda6fc78ba955e60e0
+pci-current	f57a98e1b71357713e44c57268a53d9c803f0626
+driver-core.current	a9dce6679d736cb3d612af39bab9f31f8db66f9b
+tty.current	a9dce6679d736cb3d612af39bab9f31f8db66f9b
+usb.current	a9dce6679d736cb3d612af39bab9f31f8db66f9b
+usb-gadget-fixes	a53469a68eb886e84dd8b69a1458a623d3591793
+usb-serial-fixes	8d7fa3d4ea3f0ca69554215e87411494e6346fdc
+usb-chipidea-fixes	d6d768a0ec3c088a88635c64620e1fb34e298aef
+phy		827cb0323928952c0db9515aba9d534fb1285b3f
+staging.current	a9dce6679d736cb3d612af39bab9f31f8db66f9b
+char-misc.current	a9dce6679d736cb3d612af39bab9f31f8db66f9b
+soundwire-fixes	bfeffd155283772bbe78c6a05dec7c0128ee500c
+thunderbolt-fixes	1c163f4c7b3f621efff9b28a47abb36f7378d783
+input-current	44fc95e218a09d7966a9d448941fdb003f6bb69f
+crypto-current	00e87449430dc130b43d84bdee71ef94524d9c39
+ide		dc5c37736d16ec90559888fb4c974977fc8ed1ca
+vfio-fixes	9a71ac7e15a723e90fc40388b4b92eefaabf747c
+kselftest-fixes	7d4e591bc051d3382c45caaa2530969fb42ed23d
+modules-fixes	be71eda5383faa663efdba9ef54a6b8255e3c7f0
+slave-dma-fixes	d13937116f1e82bf508a6325111b322c30c85eb9
+backlight-fixes	651022382c7f8da46cb4872a545ee1da6d097d2a
+mtd-fixes	3e35730dd7540bad2d4e002703996391d9be49a0
+spi-nor-fixes	7928b2cbe55b2a410a0f5c1f154610059c57b1b2
+mfd-fixes	48a2ca0ee3994df53da230c7079a18a70ec914f9
+v4l-dvb-fixes	7bdf2c8fee51d79ec6e487b392e2046de02ddf7f
+reset-fixes	26fce0557fa639fb7bbc33e31a57cff7df25c3a0
+mips-fixes	f6cab793d4a70808e4946baa8f5df4ea9adacc82
+at91-fixes	bfeffd155283772bbe78c6a05dec7c0128ee500c
+omap-fixes	dc30e70391376ba3987aeb856ae6d9c0706534f1
+kvm-fixes	de3ccd26fafc707b09792d9b633c8b5b48865315
+kvms390-fixes	b10bd9a256aec504c14a7c9b6fccb6301ecf290a
+hwmon-fixes	8d0139ae597340b8a0396d15dc3d634258245726
+nvdimm-fixes	11189c1089da413aa4b5fd6be4c4d47c78968819
+btrfs-fixes	8c297773d54c7d23ad6b857fbb2fc9b67e27717b
+vfs-fixes	d3d6a18d7d351cbcc9b33dbedf710e65f8ce1595
+dma-mapping-fixes	60d8cd572f655aac6107a2330dced004ad1fe3d7
+i3c-fixes	f36c1f9a8dfd6a78e6c3fe7aff5e722b84307597
+drivers-x86-fixes	6a730fcb9cb472ba2d42b26a50ac65dacdd68882
+samsung-krzk-fixes	bfeffd155283772bbe78c6a05dec7c0128ee500c
+pinctrl-samsung-fixes	651022382c7f8da46cb4872a545ee1da6d097d2a
+devicetree-fixes	5fa98c2eda35fcd1a1d91a9785c390f54688240c
+scsi-fixes	388b4e6a00bb3097278ed1648ac5a1cb48c894e6
+drm-fixes	1c163f4c7b3f621efff9b28a47abb36f7378d783
+drm-intel-fixes	1c163f4c7b3f621efff9b28a47abb36f7378d783
+mmc-fixes	e30be063d6dbcc0f18b1eb25fa709fdef89201fb
+rtc-fixes	bfeffd155283772bbe78c6a05dec7c0128ee500c
+gnss-fixes	bfeffd155283772bbe78c6a05dec7c0128ee500c
+hyperv-fixes	bfeffd155283772bbe78c6a05dec7c0128ee500c
+drm-misc-fixes	3fc6bb043dac1e5e638cf3294a68c7466488aa0f
+kbuild		6fb7ef5a343dea78e71600314cbb5e5b7466243b
+compiler-attributes	a3b22b9f11d9fbc48b0291ea92259a5a810e9438
+leaks		9ac060a708e054233265f8febfcef009ac3da826
+dma-mapping	9eb9e96e97b3381e94cba81d93f4a390c26ca6cb
+asm-generic	d724444ab97d2cdf1c4dbfc1ff65d0b18a9631e0
+arc		5908e6b738e3357af42c10e1183753c70a0117a9
+arm		4c2741ac5e103ef2a63a1d4be2c762f52cb3593e
+arm64		b855b58ac1b7891b219e1d9ef60c45c774cadefe
+arm-perf	cf2d65ec1d21f986bc128697aff5f52fef1ff12a
+arm-soc		48d1dbf3918f75dc4f3d3b01534fccd39e52bea4
+actions		fb9c1c1deb5ece57810afdbd743358d02e632d2c
+alpine		7928b2cbe55b2a410a0f5c1f154610059c57b1b2
+amlogic		b32ed5ad1eb86f6bdb9413b463bfd0ad47f21c30
+aspeed		e1542521499070f88b18846f676b4cd2a166aee5
+at91		69dd6b9f7d5826118532f1301b06306a6be6f821
+bcm2835		1ee128f4fff29c1938f25160b0dafbe9feb57d1f
+imx-mxs		fe0b295f61aff476da854e7200122686a7b89e0c
+keystone	3c3a43c81bdaaec61aef208f94e8273b0309635c
+mediatek	d542127adb0cc087c8aa93418a18a9648a4e6316
+mvebu		c51f7f86355238c3baf230444484c5d61846eb4d
+omap		af3b69ea03a28ec3382673ce8342639a7dd63dd0
+reset		dbfc54534dfcaee004d54137d9b34d000f847e41
+qcom		75920dd0498d445273ce7ca634a4cb61f30f7bf2
+renesas		f4435b0d605e15347b8c0edc96b6fc6887d150ec
+rockchip	fa178db056d09340fd5268f7802725e36c8f9f3c
+samsung		bebc6082da0a9f5d47a1ea2edc099bf671058bd4
+samsung-krzk	8ecb112edde9bf7e345eff4468dccedd41b7a067
+sunxi		1fc3dc28913476d552ad4f0f0c9ca8a91a248ac7
+tegra		d92dde4f12f1b48e3a1d330ad25e3780c99e8f60
+clk		010d5166bbe95523e8584f3caca9f1bbeac9ea6e
+clk-samsung	81faa30df9b6e9088ea5ca488860616192e7b763
+c6x		8adcc59974b8a65b7eac7d503364837c297139bc
+csky		88d5f20a813960499a82151846754d7843412030
+h8300		21c7acc439b55d0569d7c2fc2eea5194b3910406
+ia64		c51836246f9772dfab8ca7bb945f4a566fe502d5
+m68k		28713169d879b67be2ef2f84dcf54905de238294
+m68knommu	d7e9d01ac2920959b474c6363dba269a868f4db9
+microblaze	226a893bbb1f4495d7139fd57143475ada0de61d
+mips		aeb669d41ffabb91b1542f1f802cb12a989fced0
+nds32		4e8fa54d3d99026b95c3bccd9cf98308ce11d5af
+nios2		21e6bff5e0ef0033d776e64c40e6873d7c75e74b
+openrisc	57ce8ba0fd3a95bf29ed741df1c52bd591bf43ff
+parisc-hd	1c163f4c7b3f621efff9b28a47abb36f7378d783
+powerpc		de3c83c2fd2b87cf68214eda76dfa66989d78cb6
+fsl		63d86876f32440a45b6f9d42ab2fb7f68b3a8bf7
+risc-v-pjw	467e050e9760fc31dcf854ec88401e18419f5f78
+risc-v		13fd5de06514458eb320188b7a815d65696efd99
+sifive		467e050e9760fc31dcf854ec88401e18419f5f78
+s390		152e9b8676c6e788c6bff095c1eaae7b86df5003
+sparc-next	b71acb0e372160167bf6d5500b88b30b52ccef6e
+sh		ac21fc2dcb405cf250ad3f1228f64f64930d9211
+uml		aea05eb56e47046de1e5b508d40931dca969f1e5
+xtensa		036ef74b3ecb3804fd5c024a764d793c34b72644
+fscrypt		129ca2d2a83f44551e73a408fa5e75a7b5169abb
+befs		55d945e2e4aa148ef38bdfabb9569af78183a539
+btrfs		29dcea88779c856c7dc92040a0c01233263101d4
+btrfs-kdave	836b12f8c30d74dafa241d239dad6bdcf1af596a
+ceph		d11ae8e0a76afc506071831854348f2ea1f3290e
+cifs		e84b8372f0418516dfe7169749eff8c59f2e7b5b
+configfs	cc57c07343bd071cdf1915a91a24ab7d40c9b590
+ecryptfs	d43388dea04b18f516bd7c837d9222fe7309b12d
+ext3		2337494f7c0f067b02f683021101d7f160120100
+ext4		6c7328400e0488f7d49e19e02290ba343b6811b2
+f2fs		aff7b628ac2d58616b74789389ebb1e987081f49
+fuse		fabf7e0262d0bd57739d29aeac94c44b0542ff1f
+jfs		2e3bc6125154c691e987e2554f2c99ec10f83b73
+nfs		5e3863fd597eba8c6679de805681631b1aad9bdb
+nfs-anna	a3b22b9f11d9fbc48b0291ea92259a5a810e9438
+nfsd		f875a792abe933d0b4553ab6e29c624b58932e41
+orangefs	6e356d45950e2d26b63531a2fd112c987da7a933
+overlayfs	993a0b2aec52754f0897b1dab4c453be8217cae5
+ubifs		5578e48e5c0bf4684e68ae08caa2293bfb3f5307
+v9fs		bb06c388fa20ae24cfe80c52488de718a7e3a53f
+xfs		6ef50fe9afae63d11220f3f66b5f4c75d09c8bf0
+file-locks	bf77ae4c98d721a9aae3840970d46669a78e034a
+vfs		c0abe5af73411c10e82f130cdd748f00c5182d65
+printk		943ca6ad81e5b37bd5d22cbab5ad06dc97fc001c
+pci		dd92b6677e3d0d78e261a7f00f28e753bab41d24
+pstore		93ee4b7d9f0632690713aee604c49e298e634094
+hid		54f97b456ef4d131b0d677b6d12f013f4c1c2cdc
+i2c		560c09843e4fb7e48d495ac165de2e7213ce62db
+i3c		988bb4a1937bd083267444dda21b901dc6a959b3
+dmi		57361846b52bc686112da6ca5368d11210796804
+hwmon-staging	985e225142cf0cb826401f5448763f13ee712b3a
+jc_docs		4064174becc09a5a2385a27c8a6fd40888b0e13c
+v4l-dvb		15d90a6ae98e6d2c68497b44a491cb9efbb98ab1
+v4l-dvb-next	9fabe1d108ca4755a880de43f751f1c054f8894d
+fbdev		9a9f1d1a81a972513636c333e26c542f8aebae55
+pm		fa59d1e0bc51ecdd5a246d5c933f9927b0639155
+cpufreq-arm	0334906c06967142c8805fbe88acf787f65d3d26
+cpupower	ae2917093fb60bdc1ed3e5757b74801420569a9a
+opp		a9a744dd5b82843a9c99d9f97794fb51bc2ed8dd
+thermal		b537f89a9e4b9f10bf108c7871f3bfa5c2d8d2c9
+thermal-soc	8834f5600cf3c8db365e18a3d5cac2c2780c81e5
+ieee1394	c820518f6ca150d099aaeb7b71ad9e96c61113c0
+dlm		8526e331c56f35bb52e88e8c0d3cba2195bc348f
+swiotlb		22cb45d7692ab502dd47dc5a607b3af240ee1e37
+rdma		fca22e7e595f1799cfbfdfa13e16d48ece0d136c
+net-next	3b319ee220a8795406852a897299dbdfc1b09911
+bpf-next	d9862cfbe2099deb83f0e9c1932c91f2d9c50464
+ipsec-next	590ce401c207fd944827eb5aa5e87d834eddb149
+mlx5-next	37b6bb77c6fdad36f0d7bd425c005a014d5dffe4
+netfilter-next	8c4238df4d0cc3420c5ee14b54d200d74267cfe5
+nfc-next	1f008cfec5d529b30ca8da1a1f5fbbd457c10382
+ipvs-next	e2f7cc72cbf42e037229d8bd998966569662442f
+wireless-drivers-next	501faf710230b67e470b314868110357cf3a554d
+bluetooth	e057ab715f1ee3ff3e29b2df3593e47dd28a3265
+mac80211-next	be9cefe796f3abfbef02e66fbe3bff766b93b867
+gfs2		12ad143e1b803e541e48b8ba40f550250259ecdd
+mtd		9220d7befc9c28bf714701e6e26163644750d871
+nand		53bcbb839438df54024d97e8e698d21329d2c9a0
+spi-nor		225c0eda36bdb5327dc0125f4cf222c4cfd802aa
+crypto		0918f18c7179e8cdf718d01531a81b28130b4217
+drm		0f1d37e65a59e9db33ab85f6e2c9784768ef80f4
+drm-intel	ca22f32a6296cbfa29de56328c8505560a18cfa8
+drm-tegra	ca52507efc03f6e81bd1b845882b049ed96bd192
+drm-misc	c34674a23d1e8674ac532bf3397333f24a41e7b2
+drm-msm		745b19d74716be488f91cd7737e7046242ec376b
+hdlcd		d664b851eb2bcdf84a3c063cf59457bb15bc6120
+mali-dp		b4a650fb0d727d75682cb406acb92fd01e91f030
+imx-drm		a0ea4ffff2662c10ca69d5e246adf5543fd945b9
+etnaviv		9e05352340d3a3e68c144136db9810b26ebb88c3
+kconfig		bebc6082da0a9f5d47a1ea2edc099bf671058bd4
+regmap		66fb181d6f824f7695417e8c19560c5b57dc8c2d
+sound		2d012c65a9ca26a0ef87ea0a42f1653dd37155f5
+sound-asoc	6e37e89c3d0f3c865397ac31a23a3beb8f7f8844
+modules		1c163f4c7b3f621efff9b28a47abb36f7378d783
+input		6d3a41ab0c37320068e28e1f9b45e4304bb30db0
+block		602d674ce90f64ac135452fb9b2b058acb53b226
+device-mapper	225557446856448039a9e495da37b72c20071ef2
+pcmcia		95691e3eddc41da2d1cd3cca51fecdfb46bd85bc
+mmc		d4721339dcca7def04909a8e60da43c19a24d8bf
+kgdb		3bd67b37e35069b43cc5de8d138727360c503e8f
+md		e820d55cb99dd93ac2dc949cf486bb187e5cd70d
+mfd		d2d833e0bf2bad221a955626b942b38312630894
+backlight	cec2b18832e26bc866bef2be22eff4e25bbc4034
+battery		655ab0bc462d1ae2aa344b1ecf35ca1a3ed726dc
+regulator	93f8d88098bcb929495b955a05f0bd504a12d53a
+security	3963bdb87e66e670548d6d8252aa1f0f3be6fa1d
+apparmor	6c07c1c743947c2e2613115c07a6fc5ad12e08ff
+integrity	e7fde070f39bc058c356cf366cb17ac2d643abb0
+selinux		45189a1998e00f6375ebd49d1e18161acddd73de
+tpmdd		5812f97c0a225958a34b5af3888f55bdd8cdaf29
+watchdog	458c8961c194f2d2cb6ffed3dd9b6692d74ad65e
+iommu		d05e4c8600c36084ce9de6249bb972c9bdd75b7e
+dwmw2-iommu	d8a5b80568a9cb66810e75b182018e9edb68e8ff
+vfio		0cfd027be1d6def4a462cdc180c055143af24069
+trivial		75a24b822d383489badd343cab4cb171d09f93ef
+audit		131d34cb07957151c369366b158690057d2bce5e
+devicetree	935665c1a117f34662549f01e1c9bc5ea7132556
+mailbox		17b860bbfc844a3d8e38135ef430d4af8e436b9e
+spi		8cb790a1f4f196341635bcf5bac0c6c06d2cc2e1
+tip		2d8fdbb66245d0baf7650214373d7443eee0d904
+clockevents	dbfc6db7ba46e73b97dc32b9013f01d9b91d630e
+edac-amd	580b5cf50ca8f4781961382d54959683341b3126
+irqchip		b41fdc4a7bf9045e4871c5b15905ea732ffd044f
+ftrace		85f726a35e504418607b77c5e7da165dc1ea63ce
+rcu		e880edadc14970cad557e65849ba6d1457d18589
+kvm		4a605bc08e98381d8df61c30a4acb2eac15eb7da
+kvm-arm		c88b093693ccbe41991ef2e9b1d251945e6e54ed
+kvm-ppc		2b57ecd0208f7ac0b20b1b171698f027481a39f6
+kvms390		11ba5961a2156a4f210627ed8421387e2531b100
+xen-tip		0266def913771e718fd0c998eecb072e0685e2c9
+percpu		d33d9f3dd96ba290bad3929f82990a0a7467ae90
+workqueues	a2775bbc1d58ce630517dfe86090c166f27d719f
+drivers-x86	9c22cc020db637850ba47a14a598d09f706f19ad
+chrome-platform	86777c37f05b1ced19a2895396a485f45af36329
+hsi		1ff85bfa1614df6cacec780cd5922dc0b1c340c7
+leds		5ddb0869bfc1bca6cfc592c74c64a026f936638c
+ipmi		487ecb21fa6623e16d90754ac73fc38a6eb8c7bb
+driver-core	a9dce6679d736cb3d612af39bab9f31f8db66f9b
+usb		a9dce6679d736cb3d612af39bab9f31f8db66f9b
+usb-gadget	5895d311d28f2605e2f71c1a3e043ed38f3ac9d2
+usb-serial	6431866b6707d27151be381252d6eef13025cfce
+usb-chipidea-next	bc65fae4b1f01e269dad0cf62d721107d6bc93e2
+phy-next	203d9b11928cf68907344c24bd78726fa69de6cb
+tty		a9dce6679d736cb3d612af39bab9f31f8db66f9b
+char-misc	a9dce6679d736cb3d612af39bab9f31f8db66f9b
+extcon		69266982d2ed29cfd084a9efb2b7a3bbf0dcd874
+soundwire	bfeffd155283772bbe78c6a05dec7c0128ee500c
+thunderbolt	2a6d2af3ec9677b10919f6df6e037f94d9c5ed03
+staging		a9dce6679d736cb3d612af39bab9f31f8db66f9b
+mux		a1ad5ff63944ea4c3666d9a454fb3203930829a0
+icc		fcf9d0b7d2f50003efe0ba280be458f27671010d
+slave-dma	58810c58b9e763a82c3df3bfaaf2ed5104dfa555
+cgroup		6a613d24effcb875271b8a1c510172e2d6eaaee8
+scsi		c589c80ade7ca58ec9993d1dd55bb39cdb995303
+scsi-mkp	2ee60cf005d87150acc7a981ef2d0f706d86074e
+target-updates	1c130ae00b769a2e2df41bad3d6051ee8234b636
+target-bva	60cc43fc888428bb2f18f08997432d426a243338
+vhost		3fbdb54c7d5adb935b67939264653612c52dcce6
+rpmsg		6a4ac1cc9997a505cb462bd698f2dbf1a543b35e
+gpio		9e98c678c2d6ae3a17cb2de55d17f69dddaa231b
+gpio-brgl	2aa9cd1cb702d76490a7b6950a1b59b57fbfbb86
+pinctrl		9bc8fee96e9a4b8f17ba1544bf323f1ae6ded81d
+pinctrl-samsung	651022382c7f8da46cb4872a545ee1da6d097d2a
+pwm		d7d96312fe108d0df50898d212770b0a5b2d491e
+userns		cf43a757fd49442bc38f76088b70c2299eed2c2f
+ktest		6cd110a91f52197e3392809cd43466bfe2c524d0
+random		05cbbb6f9ed50c9a64a25c1903712681d4480edb
+kselftest	0e27ded1159f62ab1a4e723796246bd5b1793b93
+y2038		a2318b6a16a8a62fcacd454514cbe1227f2c0afc
+livepatching	b420648f103d74bd6c96da4ecf09d78356e6a700
+coresight	9127ceeca5ebcc9e6df1c36ce9df97b9f4aadc13
+rtc		e91b94fd2bc411b5926031496bbc3de9a96bb1c6
+nvdimm		1ffc664f9b8ca7346f2af0fb4f62b923193bf65c
+at24		950bcbbe31548636d24e49b3abaf3780204f7fe8
+ntb		8af642c76ef5e19f5750838b3863a1d93ba2f7a7
+kspp		50ceaa95ea09703722b30b4afa617c972071cd7f
+init_task	e1e871aff3ded26348c631b1370e257d401cd22d
+cisco		84a401a2750628747120a1ff6a54e846bbb9c5f1
+gnss		d4584bbfcf2a8f5b6605be9eba465bba59ce68c8
+fsi		d20810530b7109a95abef5130e6dcec09c5180d7
+siox		1e4b044d22517cae7047c99038abb444423243ca
+slimbus		81648d8bc2224278494dd7d7bcbdc428457832ed
+nvmem		c86d78c459db1e468410538e2143eb5d37416d69
+xarray		4a5c8d898948d1ac876522cdd62f07a78104bfe9
+hyperv		396ae57ef1ef978d1d21cdb7586ba184a3f22453
+auxdisplay	cc5d04d840d62d7c75e268c51da7cd0be2ee03c0
+kgdb-dt		97498c96a1869f6e8563a042e490f187a39f68e7
+pidfd		f67dcc84eb36917d554ab3ce5a6bf7295c31228a
+devfreq		ca740a8f3e7f769a5a8d4eb94e147b3f6ca985d5
+akpm-current	097770be40cabafaf21aa59e982705c4c51280cf
+akpm		a8bf82af9f12beba56871282e6c5f32e985904b1
diff --git a/Next/Trees b/Next/Trees
new file mode 100644
index 000000000000..989dd8664348
--- /dev/null
+++ b/Next/Trees
@@ -0,0 +1,300 @@
+Trees included into this release:
+
+Name		Type	URL
+----		----	---
+origin		git	git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git#master
+fixes		git	git://git.kernel.org/pub/scm/linux/kernel/git/sfr/next-fixes.git#master
+kspp-gustavo	git	git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git#for-next/kspp
+kbuild-current	git	git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git#fixes
+arc-current	git	git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git#for-curr
+arm-current	git	git://git.armlinux.org.uk/~rmk/linux-arm.git#fixes
+arm64-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux#for-next/fixes
+m68k-current	git	git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git#for-linus
+powerpc-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git#fixes
+sparc		git	git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc.git#master
+fscrypt-current	git	git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt.git#for-stable
+net		git	git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git#master
+bpf		git	git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git#master
+ipsec		git	git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec.git#master
+netfilter	git	git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git#master
+ipvs		git	git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs.git#master
+wireless-drivers	git	git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git#master
+mac80211		git	git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git#master
+rdma-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git#for-rc
+sound-current	git	git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git#for-linus
+sound-asoc-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git#for-linus
+regmap-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git#for-linus
+regulator-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git#for-linus
+spi-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git#for-linus
+pci-current	git	git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git#for-linus
+driver-core.current	git	git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git#driver-core-linus
+tty.current	git	git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git#tty-linus
+usb.current	git	git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git#usb-linus
+usb-gadget-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git#fixes
+usb-serial-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git#usb-linus
+usb-chipidea-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb.git#ci-for-usb-stable
+phy		git	git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git#fixes
+staging.current	git	git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git#staging-linus
+char-misc.current	git	git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git#char-misc-linus
+soundwire-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git#fixes
+thunderbolt-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git#fixes
+input-current	git	git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git#for-linus
+crypto-current	git	git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git#master
+ide		git	git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide.git#master
+vfio-fixes	git	git://github.com/awilliam/linux-vfio.git#for-linus
+kselftest-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git#fixes
+modules-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux.git#modules-linus
+slave-dma-fixes	git	git://git.infradead.org/users/vkoul/slave-dma.git#fixes
+backlight-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git#for-backlight-fixes
+mtd-fixes	git	git://git.infradead.org/linux-mtd.git#master
+spi-nor-fixes	git	git://git.infradead.org/linux-mtd.git#spi-nor/fixes
+mfd-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git#for-mfd-fixes
+v4l-dvb-fixes	git	git://linuxtv.org/mchehab/media-next.git#fixes
+reset-fixes	git	https://git.pengutronix.de/git/pza/linux#reset/fixes
+mips-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git#mips-fixes
+at91-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux.git#at91-fixes
+omap-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git#fixes
+kvm-fixes	git	git://git.kernel.org/pub/scm/virt/kvm/kvm.git#master
+kvms390-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git#master
+hwmon-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git#hwmon
+nvdimm-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git#libnvdimm-fixes
+btrfs-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git#next-fixes
+vfs-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git#fixes
+dma-mapping-fixes	git	git://git.infradead.org/users/hch/dma-mapping.git#for-linus
+i3c-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux.git#master
+drivers-x86-fixes	git	git://git.infradead.org/linux-platform-drivers-x86.git#fixes
+samsung-krzk-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux.git#fixes
+pinctrl-samsung-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung.git#pinctrl-fixes
+devicetree-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git#dt/linus
+scsi-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git#fixes
+drm-fixes	git	git://git.freedesktop.org/git/drm/drm.git#drm-fixes
+drm-intel-fixes	git	git://anongit.freedesktop.org/drm-intel#for-linux-next-fixes
+mmc-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git#fixes
+rtc-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git#rtc-fixes
+gnss-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss.git#gnss-linus
+hyperv-fixes	git	git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git#hyperv-fixes
+drm-misc-fixes	git	git://anongit.freedesktop.org/drm/drm-misc#for-linux-next-fixes
+kbuild		git	git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git#for-next
+compiler-attributes	git	https://github.com/ojeda/linux.git#compiler-attributes
+leaks		git	https://git.kernel.org/pub/scm/linux/kernel/git/tobin/leaks.git#leaks-next
+dma-mapping	git	git://git.infradead.org/users/hch/dma-mapping.git#for-next
+asm-generic	git	git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git#master
+arc		git	git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git#for-next
+arm		git	git://git.armlinux.org.uk/~rmk/linux-arm.git#for-next
+arm64		git	git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux#for-next/core
+arm-perf		git	git://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git#for-next/perf
+arm-soc		git	git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git#for-next
+actions		git	git://git.kernel.org/pub/scm/linux/kernel/git/afaerber/linux-actions.git#for-next
+alpine		git	git://git.kernel.org/pub/scm/linux/kernel/git/atenart/linux.git#alpine/for-next
+amlogic		git	git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic.git#for-next
+aspeed		git	git://git.kernel.org/pub/scm/linux/kernel/git/joel/aspeed.git#for-next
+at91		git	git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux-at91.git#at91-next
+bcm2835		git	git://github.com/anholt/linux.git#for-next
+imx-mxs		git	git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git#for-next
+keystone		git	git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone.git#next
+mediatek		git	git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux.git#for-next
+mvebu		git	git://git.infradead.org/linux-mvebu.git#for-next
+omap		git	git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git#for-next
+reset		git	https://git.pengutronix.de/git/pza/linux#reset/next
+qcom		git	git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux.git#for-next
+renesas		git	git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git#next
+rockchip		git	git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git#for-next
+samsung		git	git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git#for-next
+samsung-krzk	git	git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux.git#for-next
+sunxi		git	git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git#sunxi/for-next
+tegra		git	git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git#for-next
+clk		git	git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git#clk-next
+clk-samsung	git	git://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk.git#for-next
+c6x		git	git://linux-c6x.org/git/projects/linux-c6x-upstreaming.git#for-linux-next
+csky		git	git://github.com/c-sky/csky-linux.git#linux-next
+h8300		git	git://git.sourceforge.jp/gitroot/uclinux-h8/linux.git#h8300-next
+ia64		git	git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git#next
+m68k		git	git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git#for-next
+m68knommu	git	git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu.git#for-next
+microblaze	git	git://git.monstr.eu/linux-2.6-microblaze.git#next
+mips		git	git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git#mips-next
+nds32		git	git://git.kernel.org/pub/scm/linux/kernel/git/greentime/linux.git#next
+nios2		git	git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2.git#for-next
+openrisc		git	git://github.com/openrisc/linux.git#for-next
+parisc-hd	git	git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git#for-next
+powerpc		git	git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git#next
+fsl		git	git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git#next
+risc-v-pjw	git	git://git.kernel.org/pub/scm/linux/kernel/git/pjw/riscv.git#for-next
+risc-v		git	git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux.git#for-next
+sifive		git	git://git.kernel.org/pub/scm/linux/kernel/git/pjw/sifive.git#for-next
+s390		git	git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git#features
+sparc-next	git	git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next.git#master
+sh		git	git://git.libc.org/linux-sh#for-next
+uml		git	git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git#linux-next
+xtensa		git	git://github.com/jcmvbkbc/linux-xtensa.git#xtensa-for-next
+fscrypt		git	git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt.git#master
+befs		git	git://git.kernel.org/pub/scm/linux/kernel/git/luisbg/linux-befs.git#for-next
+btrfs		git	git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git#next
+btrfs-kdave	git	git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git#for-next
+ceph		git	git://github.com/ceph/ceph-client.git#master
+cifs		git	git://git.samba.org/sfrench/cifs-2.6.git#for-next
+configfs		git	git://git.infradead.org/users/hch/configfs.git#for-next
+ecryptfs		git	git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs.git#next
+ext3		git	git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git#for_next
+ext4		git	git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git#dev
+f2fs		git	git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git#dev
+fuse		git	git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git#for-next
+jfs		git	git://github.com/kleikamp/linux-shaggy.git#jfs-next
+nfs		git	git://git.linux-nfs.org/projects/trondmy/nfs-2.6.git#linux-next
+nfs-anna		git	git://git.linux-nfs.org/projects/anna/linux-nfs.git#linux-next
+nfsd		git	git://git.linux-nfs.org/~bfields/linux.git#nfsd-next
+orangefs		git	git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux#for-next
+overlayfs	git	git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git#overlayfs-next
+ubifs		git	git://git.infradead.org/ubifs-2.6.git#linux-next
+v9fs		git	git://github.com/martinetd/linux#9p-next
+xfs		git	git://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git#for-next
+file-locks	git	git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git#locks-next
+vfs		git	git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git#for-next
+printk		git	git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk.git#for-next
+pci		git	git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git#next
+pstore		git	git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git#for-next/pstore
+hid		git	git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git#for-next
+i2c		git	git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git#i2c/for-next
+i3c		git	git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux.git#i3c/next
+dmi		quilt	http://jdelvare.nerim.net/devel/linux/jdelvare-dmi/
+hwmon-staging	git	git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git#hwmon-next
+jc_docs		git	git://git.lwn.net/linux.git#docs-next
+v4l-dvb		git	git://linuxtv.org/media_tree.git#master
+v4l-dvb-next	git	git://linuxtv.org/mchehab/media-next.git#master
+fbdev		git	git://github.com/bzolnier/linux.git#fbdev-for-next
+pm		git	git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git#linux-next
+cpufreq-arm	git	git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git#cpufreq/arm/linux-next
+cpupower		git	git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux.git#cpupower
+opp		git	git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git#opp/linux-next
+thermal		git	git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git#next
+thermal-soc	git	git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal.git#next
+ieee1394		git	git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394.git#for-next
+dlm		git	git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm.git#next
+swiotlb		git	git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git#linux-next
+rdma		git	git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git#for-next
+net-next		git	git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git#master
+bpf-next		git	git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git#master
+ipsec-next	git	git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git#master
+mlx5-next	git	git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git#mlx5-next
+netfilter-next	git	git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git#master
+nfc-next		git	git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next.git#master
+ipvs-next	git	git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-next.git#master
+wireless-drivers-next	git	git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git#master
+bluetooth	git	git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git#master
+mac80211-next	git	git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git#master
+gfs2		git	git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git#for-next
+mtd		git	git://git.infradead.org/linux-mtd.git#mtd/next
+nand		git	git://git.infradead.org/linux-mtd.git#nand/next
+spi-nor		git	git://git.infradead.org/linux-mtd.git#spi-nor/next
+crypto		git	git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git#master
+drm		git	git://git.freedesktop.org/git/drm/drm.git#drm-next
+drm-intel	git	git://anongit.freedesktop.org/drm-intel#for-linux-next
+drm-tegra	git	git://anongit.freedesktop.org/tegra/linux.git#drm/tegra/for-next
+drm-misc		git	git://anongit.freedesktop.org/drm/drm-misc#for-linux-next
+drm-msm		git	https://gitlab.freedesktop.org/drm/msm.git#msm-next
+hdlcd		git	git://linux-arm.org/linux-ld#for-upstream/hdlcd
+mali-dp		git	git://linux-arm.org/linux-ld#for-upstream/mali-dp
+imx-drm		git	https://git.pengutronix.de/git/pza/linux#imx-drm/next
+etnaviv		git	https://git.pengutronix.de/git/lst/linux#etnaviv/next
+kconfig		git	git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-kconfig.git#for-next
+regmap		git	git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git#for-next
+sound		git	git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git#for-next
+sound-asoc	git	git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git#for-next
+modules		git	git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux.git#modules-next
+input		git	git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git#next
+block		git	git://git.kernel.dk/linux-block.git#for-next
+device-mapper	git	git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git#for-next
+pcmcia		git	git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux.git#pcmcia-next
+mmc		git	git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git#next
+kgdb		git	git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/kgdb.git#kgdb-next
+md		git	git://git.kernel.org/pub/scm/linux/kernel/git/shli/md.git#for-next
+mfd		git	git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git#for-mfd-next
+backlight	git	git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git#for-backlight-next
+battery		git	git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git#for-next
+regulator	git	git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git#for-next
+security		git	git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git#next-testing
+apparmor		git	git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor#apparmor-next
+integrity	git	git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity#next-integrity
+selinux		git	git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git#next
+tpmdd		git	git://git.infradead.org/users/jjs/linux-tpmdd.git#next
+watchdog		git	git://www.linux-watchdog.org/linux-watchdog-next.git#master
+iommu		git	git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git#next
+dwmw2-iommu	git	git://git.infradead.org/iommu-2.6.git#master
+vfio		git	git://github.com/awilliam/linux-vfio.git#next
+trivial		git	git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial.git#for-next
+audit		git	git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit.git#next
+devicetree	git	git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git#for-next
+mailbox		git	git://git.linaro.org/landing-teams/working/fujitsu/integration.git#mailbox-for-next
+spi		git	git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git#for-next
+tip		git	git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git#auto-latest
+clockevents	git	git://git.linaro.org/people/daniel.lezcano/linux.git#clockevents/next
+edac-amd		git	git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git#for-next
+irqchip		git	git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git#irq/irqchip-next
+ftrace		git	git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git#for-next
+rcu		git	git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git#rcu/next
+kvm		git	git://git.kernel.org/pub/scm/virt/kvm/kvm.git#linux-next
+kvm-arm		git	git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git#next
+kvm-ppc		git	git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git#kvm-ppc-next
+kvms390		git	git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git#next
+xen-tip		git	git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git#linux-next
+percpu		git	git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu.git#for-next
+workqueues	git	git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git#for-next
+drivers-x86	git	git://git.infradead.org/linux-platform-drivers-x86.git#for-next
+chrome-platform	git	git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git#for-next
+hsi		git	git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi.git#for-next
+leds		git	git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git#for-next
+ipmi		git	git://github.com/cminyard/linux-ipmi.git#for-next
+driver-core	git	git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git#driver-core-next
+usb		git	git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git#usb-next
+usb-gadget	git	git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git#next
+usb-serial	git	git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git#usb-next
+usb-chipidea-next	git	git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb.git#ci-for-usb-next
+phy-next		git	git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git#next
+tty		git	git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git#tty-next
+char-misc	git	git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git#char-misc-next
+extcon		git	git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git#extcon-next
+soundwire	git	git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git#next
+thunderbolt	git	git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git#next
+staging		git	git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git#staging-next
+mux		git	https://gitlab.com/peda-linux/mux.git#for-next
+icc		git	git://git.linaro.org/people/georgi.djakov/linux.git#icc-next
+slave-dma	git	git://git.infradead.org/users/vkoul/slave-dma.git#next
+cgroup		git	git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git#for-next
+scsi		git	git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git#for-next
+scsi-mkp		git	git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git#for-next
+target-updates	git	git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git#for-next
+target-bva	git	git://git.kernel.org/pub/scm/linux/kernel/git/bvanassche/linux.git#for-next
+vhost		git	git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git#linux-next
+rpmsg		git	git://github.com/andersson/remoteproc.git#for-next
+gpio		git	git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git#for-next
+gpio-brgl	git	git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git#gpio/for-next
+pinctrl		git	git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git#for-next
+pinctrl-samsung	git	git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung.git#for-next
+pwm		git	git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm.git#for-next
+userns		git	git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git#for-next
+ktest		git	git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git#for-next
+random		git	git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random.git#dev
+kselftest	git	git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git#next
+y2038		git	git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git#y2038
+livepatching	git	git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching#for-next
+coresight	git	git://git.linaro.org/kernel/coresight.git#next
+rtc		git	git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git#rtc-next
+nvdimm		git	git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git#libnvdimm-for-next
+at24		git	git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git#at24/for-next
+ntb		git	https://github.com/jonmason/ntb.git#ntb-next
+kspp		git	git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git#for-next/kspp
+init_task	git	git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git#init_task
+cisco		git	https://github.com/daniel-walker/cisco-linux.git#for-next
+gnss		git	git://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss.git#gnss-next
+fsi		git	git://git.kernel.org/pub/scm/linux/kernel/git/benh/linux-fsi.git#master
+siox		git	https://git.pengutronix.de/git/ukl/linux#siox/next
+slimbus		git	git://git.kernel.org/pub/scm/linux/kernel/git/srini/slimbus.git#for-next
+nvmem		git	git://git.kernel.org/pub/scm/linux/kernel/git/srini/nvmem.git#for-next
+xarray		git	git://git.infradead.org/users/willy/linux-dax.git#xarray
+hyperv		git	git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git#hyperv-next
+auxdisplay	git	https://github.com/ojeda/linux.git#auxdisplay
+kgdb-dt		git	git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux.git#kgdb/for-next
+pidfd		git	git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git#for-next
+devfreq		git	git://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq.git#for-next
+akpm-current	mmotm	https://www.ozlabs.org/~akpm/mmotm/
+akpm		mmotm	https://www.ozlabs.org/~akpm/mmotm/
diff --git a/Next/merge.log b/Next/merge.log
new file mode 100644
index 000000000000..1b3ee9e72d07
--- /dev/null
+++ b/Next/merge.log
@@ -0,0 +1,10914 @@
+$ date -R
+Mon, 18 Mar 2019 09:16:07 +1100
+$ git checkout master
+Already on 'master'
+$ git reset --hard stable
+HEAD is now at d9862cfbe209 Merge tag 'mips_5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
+Merging origin/master (9e98c678c2d6 Linux 5.1-rc1)
+$ git merge origin/master
+Updating d9862cfbe209..9e98c678c2d6
+Fast-forward
+ .clang-format                                      |    3 +-
+ CREDITS                                            |    2 +-
+ Documentation/ABI/obsolete/sysfs-class-dax         |   22 +
+ Documentation/ABI/stable/sysfs-bus-vmbus           |   33 +
+ Documentation/ABI/stable/sysfs-driver-mlxreg-io    |   14 +-
+ .../ABI/testing/debugfs-driver-habanalabs          |  126 +
+ Documentation/ABI/testing/debugfs-wilco-ec         |   23 +
+ Documentation/ABI/testing/sysfs-bus-iio            |   21 +-
+ Documentation/ABI/testing/sysfs-bus-iio-sps30      |   28 +
+ .../ABI/testing/sysfs-bus-intel_th-output-devices  |    6 +-
+ Documentation/ABI/testing/sysfs-bus-usb            |    2 +-
+ Documentation/ABI/testing/sysfs-class-chromeos     |   32 +
+ .../sysfs-class-chromeos-driver-cros-ec-lightbar   |   74 +
+ .../sysfs-class-chromeos-driver-cros-ec-vbc        |    6 +
+ Documentation/ABI/testing/sysfs-class-watchdog     |   23 +
+ Documentation/ABI/testing/sysfs-driver-habanalabs  |  190 +
+ Documentation/ABI/testing/sysfs-fs-ext4            |    7 +
+ Documentation/ABI/testing/sysfs-fs-f2fs            |    7 +
+ Documentation/ABI/testing/sysfs-kernel-livepatch   |   12 -
+ Documentation/DMA-API-HOWTO.txt                    |  121 +-
+ Documentation/DMA-API.txt                          |   43 +-
+ Documentation/DMA-ISA-LPC.txt                      |    4 +-
+ .../Expedited-Grace-Periods/ExpSchedFlow.svg       |   18 +-
+ .../Expedited-Grace-Periods.html                   |   26 +-
+ .../Memory-Ordering/Tree-RCU-Memory-Ordering.html  |    6 +-
+ .../TreeRCU-callback-invocation.svg                |    2 +-
+ .../RCU/Design/Memory-Ordering/TreeRCU-gp.svg      |    8 +-
+ .../RCU/Design/Memory-Ordering/TreeRCU-qs.svg      |    6 +-
+ .../RCU/Design/Requirements/Requirements.html      |   20 +-
+ Documentation/RCU/lockdep-splat.txt                |   12 +-
+ Documentation/RCU/stallwarn.txt                    |   15 +-
+ Documentation/RCU/torture.txt                      |  169 +-
+ Documentation/RCU/whatisRCU.txt                    |    4 +-
+ Documentation/acpi/aml-debugger.txt                |    4 +-
+ Documentation/acpi/initrd_table_override.txt       |    4 +
+ Documentation/admin-guide/LSM/SafeSetID.rst        |  107 +
+ Documentation/admin-guide/LSM/index.rst            |   14 +-
+ Documentation/admin-guide/README.rst               |    2 +-
+ Documentation/admin-guide/cgroup-v2.rst            |   18 +-
+ Documentation/admin-guide/kernel-parameters.txt    |   85 +-
+ Documentation/admin-guide/md.rst                   |    3 +
+ Documentation/admin-guide/mm/pagemap.rst           |    9 +-
+ Documentation/admin-guide/perf-security.rst        |  253 +-
+ Documentation/admin-guide/pm/cpuidle.rst           |  104 +-
+ Documentation/admin-guide/tainted-kernels.rst      |  159 +-
+ Documentation/arm/kernel_mode_neon.txt             |    4 +-
+ Documentation/arm64/booting.txt                    |    5 +
+ Documentation/arm64/pointer-authentication.txt     |    5 +
+ Documentation/arm64/silicon-errata.txt             |    3 +
+ Documentation/block/biovecs.txt                    |   25 +
+ Documentation/cgroup-v1/memcg_test.txt             |    4 +-
+ Documentation/cgroup-v1/memory.txt                 |   11 +-
+ Documentation/cgroup-v1/pids.txt                   |    3 +
+ Documentation/core-api/flexible-arrays.rst         |  130 -
+ Documentation/core-api/generic-radix-tree.rst      |   12 +
+ Documentation/core-api/index.rst                   |    1 +
+ Documentation/core-api/kernel-api.rst              |    4 -
+ Documentation/core-api/memory-allocation.rst       |   10 +-
+ Documentation/core-api/mm-api.rst                  |    2 +-
+ Documentation/core-api/printk-formats.rst          |    8 +
+ Documentation/core-api/refcount-vs-atomic.rst      |   24 +-
+ Documentation/core-api/xarray.rst                  |   15 +-
+ Documentation/cpuidle/driver.txt                   |   37 -
+ Documentation/cpuidle/governor.txt                 |   28 -
+ Documentation/dev-tools/kcov.rst                   |    2 +-
+ Documentation/device-mapper/cache.txt              |    3 +
+ Documentation/device-mapper/dm-init.txt            |  114 +
+ Documentation/devicetree/bindings/Makefile         |    2 +-
+ Documentation/devicetree/bindings/arm/amlogic.txt  |    1 +
+ Documentation/devicetree/bindings/arm/armadeus.txt |    6 -
+ .../devicetree/bindings/arm/atmel-sysregs.txt      |    4 +-
+ .../devicetree/bindings/arm/bcm/brcm,bcm2835.txt   |    4 +
+ Documentation/devicetree/bindings/arm/bhf.txt      |    6 -
+ Documentation/devicetree/bindings/arm/bitmain.yaml |   18 +
+ .../devicetree/bindings/arm/compulab-boards.txt    |   25 -
+ Documentation/devicetree/bindings/arm/cpus.yaml    |    1 +
+ .../bindings/arm/freescale/fsl,imx7ulp-sim.txt     |   16 +
+ .../devicetree/bindings/arm/freescale/fsl,scu.txt  |   15 +-
+ Documentation/devicetree/bindings/arm/fsl.txt      |  237 -
+ Documentation/devicetree/bindings/arm/fsl.yaml     |  232 +
+ Documentation/devicetree/bindings/arm/i2se.txt     |   22 -
+ Documentation/devicetree/bindings/arm/l2c2x0.txt   |  114 -
+ Documentation/devicetree/bindings/arm/l2c2x0.yaml  |  248 +
+ Documentation/devicetree/bindings/arm/mediatek.txt |   14 +-
+ Documentation/devicetree/bindings/arm/olimex.txt   |   10 -
+ Documentation/devicetree/bindings/arm/pmu.txt      |   70 -
+ Documentation/devicetree/bindings/arm/pmu.yaml     |   87 +
+ Documentation/devicetree/bindings/arm/renesas.yaml |  238 +
+ .../devicetree/bindings/arm/rockchip.yaml          |   17 +
+ Documentation/devicetree/bindings/arm/shmobile.txt |  155 -
+ .../bindings/arm/socionext/milbeaut.yaml           |   22 +
+ .../devicetree/bindings/arm/technologic.txt        |   23 -
+ Documentation/devicetree/bindings/arm/tegra.yaml   |    2 +
+ Documentation/devicetree/bindings/bus/imx-weim.txt |   32 +-
+ .../devicetree/bindings/clock/actions,owl-cmu.txt  |    7 +-
+ .../bindings/clock/amlogic,gxbb-aoclkc.txt         |    1 +
+ .../bindings/clock/amlogic,gxbb-clkc.txt           |    1 +
+ .../devicetree/bindings/clock/exynos5433-clock.txt |   23 +
+ .../devicetree/bindings/clock/fixed-clock.txt      |   23 -
+ .../devicetree/bindings/clock/fixed-clock.yaml     |   44 +
+ .../bindings/clock/fixed-factor-clock.txt          |   28 -
+ .../bindings/clock/fixed-factor-clock.yaml         |   56 +
+ .../devicetree/bindings/clock/fixed-mmio-clock.txt |   24 +
+ .../devicetree/bindings/clock/imx8mm-clock.txt     |   29 +
+ .../bindings/clock/nvidia,tegra124-dfll.txt        |   83 +-
+ .../devicetree/bindings/clock/qcom,rpmcc.txt       |    1 +
+ .../bindings/cpufreq/nvidia,tegra124-cpufreq.txt   |    6 +-
+ .../display/amlogic,simple-framebuffer.txt         |   33 +
+ .../devicetree/bindings/display/arm,komeda.txt     |   73 +
+ .../bindings/display/bridge/cdns,dsi.txt           |   21 -
+ .../bindings/display/bridge/lvds-transmitter.txt   |   12 +-
+ .../bindings/display/bridge/renesas,lvds.txt       |    4 +-
+ .../bindings/display/bridge/thine,thc63lvdm83d.txt |    2 +-
+ .../bindings/display/bridge/ti,ds90c185.txt        |   55 +
+ .../devicetree/bindings/display/msm/gmu.txt        |   59 +
+ .../devicetree/bindings/display/msm/gpu.txt        |   42 +-
+ .../panel/{auo,g101evn010 => auo,g101evn010.txt}   |    0
+ .../bindings/display/panel/innolux,ee101ia-01d.txt |    7 +
+ .../display/panel/lemaker,bl035-rgb-002.txt        |   12 +
+ .../bindings/display/panel/pda,91-00156-a0.txt     |   14 +
+ .../bindings/display/panel/sitronix,st7701.txt     |   30 +
+ .../devicetree/bindings/display/renesas,du.txt     |    2 +
+ .../bindings/display/rockchip/rockchip-vop.txt     |    1 +
+ .../bindings/display/sitronix,st7735r.txt          |    2 +-
+ .../devicetree/bindings/display/ssd1307fb.txt      |    2 -
+ .../bindings/display/sunxi/sun4i-drm.txt           |    5 +
+ .../display/tegra/nvidia,tegra20-host1x.txt        |    3 +
+ Documentation/devicetree/bindings/dma/dma.txt      |    4 +
+ Documentation/devicetree/bindings/dma/fsl-qdma.txt |   57 +
+ Documentation/devicetree/bindings/dma/k3dma.txt    |    4 +-
+ Documentation/devicetree/bindings/dma/snps-dma.txt |    2 -
+ Documentation/devicetree/bindings/dma/sprd-dma.txt |    2 +-
+ .../devicetree/bindings/dma/xilinx/xilinx_dma.txt  |    7 +-
+ .../devicetree/bindings/edac/aspeed-sdram-edac.txt |   25 +
+ Documentation/devicetree/bindings/eeprom/at24.txt  |    3 +
+ .../devicetree/bindings/extcon/extcon-ptn5150.txt  |   27 +
+ .../bindings/firmware/nvidia,tegra186-bpmp.txt     |    1 -
+ .../bindings/firmware/nvidia,tegra210-bpmp.txt     |   35 +
+ Documentation/devicetree/bindings/gnss/gnss.txt    |    1 +
+ .../devicetree/bindings/gnss/mediatek.txt          |   35 +
+ .../devicetree/bindings/gnss/sirfstar.txt          |    1 +
+ .../bindings/gpio/gateworks,pld-gpio.txt           |   20 +
+ .../devicetree/bindings/gpio/gpio-eic-sprd.txt     |    4 +-
+ .../devicetree/bindings/gpio/gpio-pca953x.txt      |    1 +
+ Documentation/devicetree/bindings/gpio/gpio.txt    |   12 +
+ .../devicetree/bindings/gpio/intel,ixp4xx-gpio.txt |   38 +
+ .../devicetree/bindings/gpu/arm,mali-utgard.txt    |    6 +
+ .../devicetree/bindings/gpu/samsung-rotator.txt    |    7 +-
+ Documentation/devicetree/bindings/i2c/i2c-mtk.txt  |    1 +
+ .../devicetree/bindings/i2c/i2c-xscale.txt         |   20 +
+ .../devicetree/bindings/iio/accel/mma8452.txt      |    4 +
+ .../devicetree/bindings/iio/adc/adi,ad7606.txt     |   65 +
+ .../devicetree/bindings/iio/adc/adi,ad7768-1.txt   |   41 +
+ .../bindings/iio/adc/amlogic,meson-saradc.txt      |    4 +
+ .../devicetree/bindings/iio/adc/ingenic,adc.txt    |   48 +
+ .../bindings/{staging => }/iio/adc/lpc32xx-adc.txt |    0
+ .../bindings/iio/adc/nuvoton,npcm-adc.txt          |   24 +
+ .../bindings/iio/adc/samsung,exynos-adc.txt        |    4 +-
+ .../devicetree/bindings/iio/adc/stmpe-adc.txt      |   21 +
+ .../devicetree/bindings/iio/adc/ti-ads124s08.txt   |   25 +
+ .../devicetree/bindings/iio/chemical/bme680.txt    |   11 +
+ .../bindings/iio/chemical/plantower,pms7003.txt    |   20 +
+ .../bindings/iio/chemical/sensirion,sgp30.txt      |   15 +
+ .../bindings/iio/chemical/sensirion,sps30.txt      |   12 +
+ .../devicetree/bindings/iio/dac/ti,dac7612.txt     |   28 +
+ .../bindings/iio/impedance-analyzer/ad5933.txt     |   26 +
+ .../devicetree/bindings/iio/imu/bmi160.txt         |    6 +-
+ .../devicetree/bindings/iio/imu/inv_mpu6050.txt    |    1 +
+ .../devicetree/bindings/iio/light/max44009.txt     |   24 +
+ .../devicetree/bindings/iio/st-sensors.txt         |    1 +
+ .../bindings/input/cypress,tm2-touchkey.txt        |    9 +-
+ .../devicetree/bindings/input/ilitek,ili2xxx.txt   |   25 +
+ .../devicetree/bindings/input/msm-vibrator.txt     |   36 +
+ .../devicetree/bindings/input/st,stpmic1-onkey.txt |   28 +
+ .../bindings/input/touchscreen/edt-ft5x06.txt      |   13 +-
+ .../bindings/input/touchscreen/goodix.txt          |   14 +-
+ .../bindings/input/touchscreen/sitronix-st1232.txt |    8 +-
+ .../bindings/input/touchscreen/stmpe.txt           |  116 +-
+ .../bindings/input/touchscreen/sx8654.txt          |   10 +-
+ .../bindings/input/touchscreen/ti-tsc-adc.txt      |    8 +
+ .../bindings/interconnect/interconnect.txt         |   60 +
+ .../bindings/interconnect/qcom,sdm845.txt          |   24 +
+ .../bindings/interrupt-controller/arm,gic-v3.txt   |  175 -
+ .../bindings/interrupt-controller/arm,gic-v3.yaml  |  279 +
+ .../bindings/interrupt-controller/arm,gic.txt      |  171 -
+ .../bindings/interrupt-controller/arm,gic.yaml     |  223 +
+ .../bindings/interrupt-controller/fsl,irqsteer.txt |   11 +-
+ .../interrupt-controller/loongson,ls1x-intc.txt    |   24 +
+ .../interrupt-controller/mediatek,sysirq.txt       |    1 +
+ .../bindings/iommu/nvidia,tegra20-gart.txt         |   14 -
+ .../bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt   |  127 +
+ .../devicetree/bindings/media/i2c/adv748x.txt      |   11 +-
+ .../bindings/media/i2c/melexis,mlx90640.txt        |   20 +
+ .../devicetree/bindings/media/i2c/mt9m001.txt      |   38 +
+ .../devicetree/bindings/media/i2c/ov5645.txt       |    6 +-
+ .../devicetree/bindings/media/imx7-csi.txt         |   45 +
+ .../devicetree/bindings/media/imx7-mipi-csi2.txt   |   90 +
+ .../devicetree/bindings/media/mediatek-vcodec.txt  |   13 +
+ .../devicetree/bindings/media/rcar_vin.txt         |    9 +-
+ .../devicetree/bindings/media/renesas,fcp.txt      |    5 +-
+ .../bindings/media/renesas,rcar-csi2.txt           |    3 +-
+ .../devicetree/bindings/media/renesas,vsp1.txt     |    6 +-
+ Documentation/devicetree/bindings/media/si470x.txt |   26 +
+ .../devicetree/bindings/media/sun6i-csi.txt        |    3 +-
+ .../memory-controllers/nvidia,tegra20-mc.txt       |   27 +-
+ .../devicetree/bindings/mfd/aspeed-lpc.txt         |    2 +
+ .../devicetree/bindings/mfd/cirrus,lochnagar.txt   |   68 +
+ .../devicetree/bindings/mfd/st,stpmic1.txt         |   61 +
+ Documentation/devicetree/bindings/mfd/stmpe.txt    |   28 +-
+ .../devicetree/bindings/misc/qcom,fastrpc.txt      |   78 +
+ .../devicetree/bindings/net/cpsw-phy-sel.txt       |    2 +-
+ Documentation/devicetree/bindings/net/dsa/dsa.txt  |    5 +
+ .../devicetree/bindings/net/stm32-dwmac.txt        |    9 +-
+ .../devicetree/bindings/nvmem/imx-ocotp.txt        |    4 +-
+ .../bindings/nvmem/xlnx,zynqmp-nvmem.txt           |   46 +
+ Documentation/devicetree/bindings/opp/opp.txt      |    3 +
+ .../devicetree/bindings/pci/altera-pcie.txt        |    4 +-
+ .../devicetree/bindings/pci/fsl,imx6q-pcie.txt     |   18 +-
+ .../devicetree/bindings/pci/layerscape-pci.txt     |    3 +
+ Documentation/devicetree/bindings/pci/rcar-pci.txt |    4 +-
+ Documentation/devicetree/bindings/pci/ti-pci.txt   |   11 +-
+ .../devicetree/bindings/phy/cdns,dphy.txt          |   20 +
+ .../devicetree/bindings/phy/phy-mvebu-comphy.txt   |   65 +-
+ .../devicetree/bindings/phy/phy-mvebu-utmi.txt     |   38 +
+ .../bindings/phy/phy-rockchip-inno-usb2.txt        |    2 +
+ .../devicetree/bindings/phy/qcom-qmp-phy.txt       |    9 +
+ .../devicetree/bindings/phy/qcom-qusb2-phy.txt     |    1 +
+ .../devicetree/bindings/phy/rcar-gen3-phy-usb2.txt |    2 +
+ Documentation/devicetree/bindings/phy/ti-phy.txt   |    1 +
+ .../bindings/pinctrl/atmel,at91-pinctrl.txt        |   27 +-
+ .../bindings/pinctrl/fsl,imx50-pinctrl.txt         |   32 +
+ .../bindings/pinctrl/fsl,imx8mm-pinctrl.txt        |   36 +
+ .../pinctrl/marvell,armada-37xx-pinctrl.txt        |   24 +-
+ .../devicetree/bindings/pinctrl/meson,pinctrl.txt  |   10 +-
+ .../devicetree/bindings/pinctrl/qcom,pmic-gpio.txt |    1 +
+ .../devicetree/bindings/power/fsl,imx-gpcv2.txt    |    3 +
+ .../devicetree/bindings/power/qcom,rpmpd.txt       |  145 +
+ .../bindings/power/reset/xlnx,zynqmp-power.txt     |   25 +
+ .../devicetree/bindings/power/supply/battery.txt   |    2 +
+ .../devicetree/bindings/power/supply/sc27xx-fg.txt |    8 +-
+ .../bindings/power/xlnx,zynqmp-genpd.txt           |   34 +
+ .../devicetree/bindings/property-units.txt         |    1 +
+ .../devicetree/bindings/pwm/atmel-pwm.txt          |    1 +
+ .../devicetree/bindings/pwm/pwm-hibvt.txt          |    2 +
+ .../bindings/remoteproc/qcom,adsp-pil.txt          |    5 +-
+ .../devicetree/bindings/remoteproc/qcom,adsp.txt   |   23 +-
+ .../devicetree/bindings/remoteproc/qcom,q6v5.txt   |   79 +-
+ .../bindings/reset/brcm,brcmstb-reset.txt          |   27 +
+ .../devicetree/bindings/reset/fsl,imx7-src.txt     |    7 +-
+ .../bindings/reset/xlnx,zynqmp-reset.txt           |   52 +
+ .../devicetree/bindings/rtc/abracon,abx80x.txt     |    1 +
+ Documentation/devicetree/bindings/rtc/cdns,rtc.txt |   25 +
+ .../devicetree/bindings/rtc/isil,isl1208.txt       |   38 +
+ .../devicetree/bindings/rtc/isil,isl1219.txt       |   29 -
+ .../devicetree/bindings/rtc/nxp,pcf85063.txt       |   18 +
+ .../devicetree/bindings/rtc/nxp,pcf8523.txt        |   18 +
+ .../devicetree/bindings/rtc/rtc-meson.txt          |   35 +
+ Documentation/devicetree/bindings/rtc/rtc.txt      |   23 +-
+ Documentation/devicetree/bindings/serial/8250.txt  |    1 +
+ .../devicetree/bindings/serial/ingenic,uart.txt    |    3 +-
+ .../devicetree/bindings/serial/milbeaut-uart.txt   |   21 +
+ .../bindings/serial/nvidia,tegra194-tcu.txt        |   35 +
+ .../devicetree/bindings/serial/omap_serial.txt     |    2 +
+ Documentation/devicetree/bindings/serial/pl011.txt |   51 -
+ .../devicetree/bindings/serial/pl011.yaml          |  126 +
+ .../bindings/serial/renesas,rzn1-uart.txt          |   10 -
+ .../bindings/serial/renesas,sci-serial.txt         |    2 +
+ .../bindings/serial/snps-dw-apb-uart.txt           |   76 -
+ .../bindings/serial/snps-dw-apb-uart.yaml          |  140 +
+ .../bindings/soc/amlogic/clk-measure.txt           |    2 +
+ .../bindings/soc/bcm/brcm,bcm2835-pm.txt           |   46 +
+ .../devicetree/bindings/soc/qcom/qcom,smd-rpm.txt  |    1 +
+ .../devicetree/bindings/sound/adi,adau1977.txt     |   13 +-
+ Documentation/devicetree/bindings/sound/ak4458.txt |    2 +-
+ .../bindings/sound/audio-graph-scu-card.txt        |  123 -
+ .../devicetree/bindings/sound/cs35l36.txt          |  168 +
+ Documentation/devicetree/bindings/sound/cs4341.txt |   22 +
+ .../bindings/sound/davinci-mcasp-audio.txt         |   17 +
+ .../devicetree/bindings/sound/fsl,micfil.txt       |   32 +
+ .../bindings/sound/google,cros-ec-codec.txt        |   26 +
+ .../bindings/sound/ingenic,jz4725b-codec.txt       |   20 +
+ .../bindings/sound/ingenic,jz4740-codec.txt        |   20 +
+ Documentation/devicetree/bindings/sound/mt6358.txt |   18 +
+ .../devicetree/bindings/sound/mt8183-afe-pcm.txt   |   36 +
+ .../devicetree/bindings/sound/mtk-btcvsd-snd.txt   |   24 +
+ .../bindings/sound/nvidia,tegra30-hda.txt          |    5 +
+ .../bindings/sound/qcom,msm8916-wcd-analog.txt     |    7 +-
+ .../devicetree/bindings/sound/qcom,wcd9335.txt     |   10 +-
+ .../bindings/sound/rockchip,rk3328-codec.txt       |   23 +
+ .../devicetree/bindings/sound/sgtl5000.txt         |    9 +
+ .../devicetree/bindings/sound/simple-scu-card.txt  |   94 -
+ .../devicetree/bindings/sound/sprd-pcm.txt         |   23 +
+ .../bindings/sound/xlnx,audio-formatter.txt        |   29 +
+ .../devicetree/bindings/sound/xlnx,spdif.txt       |   28 +
+ .../devicetree/bindings/sram/milbeaut-smp-sram.txt |   24 +
+ .../devicetree/bindings/sram/sunxi-sram.txt        |    1 +
+ .../bindings/thermal/brcm,sr-thermal.txt           |  105 +
+ .../bindings/thermal/mediatek-thermal.txt          |    1 +
+ .../devicetree/bindings/timer/fsl,imxgpt.txt       |   39 +-
+ .../bindings/timer/mediatek,mtk-timer.txt          |   11 +-
+ .../bindings/timer/nvidia,tegra210-timer.txt       |   36 +
+ .../devicetree/bindings/timer/renesas,cmt.txt      |    2 +
+ .../devicetree/bindings/timer/renesas,tmu.txt      |    1 +
+ .../bindings/timer/socionext,milbeaut-timer.txt    |   17 +
+ Documentation/devicetree/bindings/ufs/ufs-hisi.txt |    5 +-
+ .../devicetree/bindings/ufs/ufshcd-pltfrm.txt      |   13 +-
+ .../devicetree/bindings/usb/ci-hdrc-usb2.txt       |    1 +
+ .../bindings/usb/ingenic,jz4740-musb.txt           |   24 +
+ .../devicetree/bindings/usb/keystone-usb.txt       |    6 +-
+ .../devicetree/bindings/usb/qcom,dwc3.txt          |    1 +
+ .../devicetree/bindings/usb/renesas_usb3.txt       |    1 +
+ .../devicetree/bindings/usb/renesas_usbhs.txt      |    1 +
+ Documentation/devicetree/bindings/usb/usb251xb.txt |    4 +
+ .../devicetree/bindings/vendor-prefixes.txt        |   13 +
+ .../devicetree/bindings/watchdog/renesas-wdt.txt   |    1 +
+ .../bindings/watchdog/st,stpmic1-wdt.txt           |   11 +
+ Documentation/doc-guide/kernel-doc.rst             |   17 +-
+ Documentation/doc-guide/sphinx.rst                 |   12 +-
+ Documentation/dontdiff                             |    1 -
+ Documentation/driver-api/component.rst             |   17 +
+ Documentation/driver-api/device_link.rst           |   87 +-
+ Documentation/driver-api/dmaengine/client.rst      |    7 +
+ Documentation/driver-api/dmaengine/dmatest.rst     |    1 +
+ Documentation/driver-api/gpio/board.rst            |    1 +
+ Documentation/driver-api/gpio/driver.rst           |    2 +-
+ Documentation/driver-api/gpio/legacy.rst           |    9 +-
+ Documentation/driver-api/iio/buffers.rst           |    2 +-
+ Documentation/driver-api/iio/core.rst              |    6 +-
+ Documentation/driver-api/iio/hw-consumer.rst       |    2 +-
+ Documentation/driver-api/iio/triggers.rst          |    2 +-
+ Documentation/driver-api/index.rst                 |    1 +
+ Documentation/driver-api/pinctl.rst                |    9 -
+ Documentation/driver-api/pm/cpuidle.rst            |  282 +
+ Documentation/driver-api/pm/index.rst              |    7 +-
+ Documentation/driver-model/devres.txt              |    2 +
+ Documentation/fault-injection/fault-injection.txt  |    2 +-
+ Documentation/filesystems/api-summary.rst          |  150 +
+ Documentation/filesystems/binderfs.rst             |   68 +
+ Documentation/filesystems/ceph.txt                 |   14 +-
+ Documentation/filesystems/cifs/TODO                |    3 +-
+ Documentation/filesystems/cifs/cifs.txt            |   34 +-
+ Documentation/filesystems/exofs.txt                |  185 -
+ Documentation/filesystems/f2fs.txt                 |    2 +
+ Documentation/filesystems/fscrypt.rst              |   16 +-
+ Documentation/filesystems/index.rst                |  389 +-
+ Documentation/filesystems/journalling.rst          |  184 +
+ Documentation/filesystems/mount_api.txt            |  709 ++
+ Documentation/filesystems/path-lookup.rst          |   39 +-
+ Documentation/filesystems/splice.rst               |   22 +
+ Documentation/filesystems/sysfs.txt                |   21 +
+ Documentation/filesystems/vfs.txt                  |    3 +
+ Documentation/filesystems/xfs.txt                  |    3 +-
+ Documentation/flexible-arrays.txt                  |  123 -
+ Documentation/gpu/afbc.rst                         |  235 +
+ Documentation/gpu/dp-mst/topology-figure-1.dot     |   52 +
+ Documentation/gpu/dp-mst/topology-figure-2.dot     |   56 +
+ Documentation/gpu/dp-mst/topology-figure-3.dot     |   59 +
+ Documentation/gpu/drivers.rst                      |    2 +
+ Documentation/gpu/drm-internals.rst                |   74 +-
+ Documentation/gpu/drm-kms-helpers.rst              |   54 +-
+ Documentation/gpu/drm-kms.rst                      |   96 -
+ Documentation/gpu/drm-uapi.rst                     |    8 +
+ Documentation/gpu/komeda-kms.rst                   |  488 ++
+ Documentation/gpu/todo.rst                         |  110 +-
+ Documentation/gpu/vkms.rst                         |   11 -
+ Documentation/hwmon/f71882fg                       |    2 +-
+ Documentation/i2c/fault-codes                      |    4 +
+ Documentation/i2c/gpio-fault-injection             |   61 +-
+ Documentation/index.rst                            |    1 +
+ Documentation/infiniband/user_verbs.txt            |    4 +-
+ Documentation/input/devices/xpad.rst               |    2 +-
+ Documentation/interconnect/interconnect.rst        |   94 +
+ Documentation/kbuild/kbuild.txt                    |   15 +-
+ Documentation/kbuild/makefiles.txt                 |   28 +-
+ Documentation/kbuild/modules.txt                   |    2 +-
+ Documentation/kdump/vmcoreinfo.txt                 |  495 ++
+ Documentation/laptops/lg-laptop.rst                |    4 +-
+ Documentation/livepatch/callbacks.txt              |  489 +-
+ Documentation/livepatch/cumulative-patches.txt     |  102 +
+ Documentation/livepatch/livepatch.txt              |  182 +-
+ Documentation/locking/lockdep-design.txt           |    4 +-
+ Documentation/lzo.txt                              |   39 +-
+ Documentation/media/dvb-drivers/dvb-usb.rst        |    2 +-
+ Documentation/media/kapi/dtv-core.rst              |    2 +-
+ Documentation/media/kapi/dtv-frontend.rst          |    2 +-
+ Documentation/media/kapi/mc-core.rst               |    2 +-
+ Documentation/media/kapi/v4l2-device.rst           |    2 +-
+ Documentation/media/kapi/v4l2-intro.rst            |    2 +-
+ Documentation/media/kapi/v4l2-subdev.rst           |    4 +-
+ Documentation/media/lirc.h.rst.exceptions          |    3 +
+ .../media/uapi/dvb/audio-set-bypass-mode.rst       |    2 +-
+ Documentation/media/uapi/dvb/ca-set-descr.rst      |    2 +-
+ Documentation/media/uapi/dvb/dmx-qbuf.rst          |    2 +-
+ Documentation/media/uapi/dvb/dvbproperty.rst       |    2 +-
+ Documentation/media/uapi/dvb/video_types.rst       |    2 +-
+ Documentation/media/uapi/fdl-appendix.rst          |    2 +-
+ Documentation/media/uapi/mediactl/media-types.rst  |    2 +-
+ Documentation/media/uapi/mediactl/request-api.rst  |    4 +-
+ Documentation/media/uapi/rc/rc-tables.rst          |    4 +-
+ Documentation/media/uapi/v4l/buffer.rst            |   11 +-
+ Documentation/media/uapi/v4l/common.rst            |   11 +
+ Documentation/media/uapi/v4l/control.rst           |    2 +-
+ Documentation/media/uapi/v4l/dev-effect.rst        |   28 -
+ .../uapi/v4l/{dev-codec.rst => dev-mem2mem.rst}    |   41 +-
+ Documentation/media/uapi/v4l/dev-teletext.rst      |   41 -
+ Documentation/media/uapi/v4l/devices.rst           |    4 +-
+ Documentation/media/uapi/v4l/ext-ctrls-camera.rst  |  508 ++
+ Documentation/media/uapi/v4l/ext-ctrls-codec.rst   | 2451 +++++++
+ Documentation/media/uapi/v4l/ext-ctrls-detect.rst  |   71 +
+ Documentation/media/uapi/v4l/ext-ctrls-dv.rst      |  166 +
+ Documentation/media/uapi/v4l/ext-ctrls-flash.rst   |  192 +
+ Documentation/media/uapi/v4l/ext-ctrls-fm-rx.rst   |   95 +
+ Documentation/media/uapi/v4l/ext-ctrls-fm-tx.rst   |  188 +
+ .../media/uapi/v4l/ext-ctrls-image-process.rst     |   63 +
+ .../media/uapi/v4l/ext-ctrls-image-source.rst      |   57 +
+ Documentation/media/uapi/v4l/ext-ctrls-jpeg.rst    |  113 +
+ .../media/uapi/v4l/ext-ctrls-rf-tuner.rst          |   96 +
+ Documentation/media/uapi/v4l/extended-controls.rst | 3905 +----------
+ Documentation/media/uapi/v4l/meta-formats.rst      |    2 +-
+ Documentation/media/uapi/v4l/pixfmt-compressed.rst |    2 +-
+ .../media/uapi/v4l/pixfmt-meta-intel-ipu3.rst      |  144 +-
+ Documentation/media/uapi/v4l/pixfmt-packed-yuv.rst |  170 +-
+ Documentation/media/uapi/v4l/subdev-formats.rst    |    6 +-
+ Documentation/media/uapi/v4l/vidioc-g-parm.rst     |    2 +-
+ .../media/uapi/v4l/vidioc-prepare-buf.rst          |    5 +-
+ Documentation/media/uapi/v4l/vidioc-qbuf.rst       |    2 +-
+ Documentation/media/v4l-drivers/bttv.rst           |    4 +-
+ Documentation/media/v4l-drivers/imx.rst            |  107 +-
+ Documentation/media/v4l-drivers/imx7.rst           |  162 +
+ Documentation/media/v4l-drivers/index.rst          |    1 +
+ Documentation/media/v4l-drivers/ipu3.rst           |  151 +-
+ Documentation/media/v4l-drivers/pxa_camera.rst     |    2 +-
+ Documentation/media/v4l-drivers/qcom_camss.rst     |    2 +-
+ Documentation/misc-devices/ibmvmc.rst              |    1 +
+ Documentation/misc-devices/index.rst               |   17 +
+ Documentation/networking/checksum-offloads.rst     |  143 +
+ Documentation/networking/checksum-offloads.txt     |  122 -
+ Documentation/networking/index.rst                 |    3 +
+ .../networking/{scaling.txt => scaling.rst}        |  131 +-
+ ...tion-offloads.txt => segmentation-offloads.rst} |   48 +-
+ Documentation/power/energy-model.txt               |  144 +
+ Documentation/process/4.Coding.rst                 |    2 +-
+ Documentation/process/coding-style.rst             |   97 +-
+ Documentation/process/howto.rst                    |   59 +-
+ Documentation/process/kernel-docs.rst              |    2 +-
+ Documentation/process/license-rules.rst            |   66 +-
+ Documentation/process/stable-api-nonsense.rst      |   15 +-
+ Documentation/process/stable-kernel-rules.rst      |    9 +-
+ Documentation/process/submitting-patches.rst       |    6 +-
+ Documentation/scheduler/sched-energy.txt           |  425 ++
+ Documentation/scsi/osd.txt                         |  197 -
+ Documentation/scsi/ufs.txt                         |   11 +
+ Documentation/security/LSM.rst                     |    5 +-
+ Documentation/security/{LSM-sctp.rst => SCTP.rst}  |  180 +-
+ Documentation/security/SELinux-sctp.rst            |  158 -
+ Documentation/security/index.rst                   |    3 +-
+ Documentation/sound/hd-audio/models.rst            |    4 +-
+ .../sound/kernel-api/writing-an-alsa-driver.rst    |   35 +-
+ Documentation/sound/soc/dpcm.rst                   |   10 +-
+ Documentation/static-keys.txt                      |    2 +-
+ Documentation/sysctl/kernel.txt                    |   62 +-
+ Documentation/sysctl/vm.txt                        |    2 +-
+ Documentation/target/tcm_mod_builder.py            |    8 -
+ Documentation/timers/highres.txt                   |    2 +-
+ Documentation/trace/ftrace.rst                     |   89 +
+ Documentation/trace/histogram.rst                  |  316 +-
+ Documentation/trace/uprobetracer.rst               |    7 +-
+ .../translations/it_IT/doc-guide/sphinx.rst        |    2 +
+ .../translations/it_IT/process/4.Coding.rst        |    2 +-
+ .../it_IT/process/applying-patches.rst             |   12 +-
+ .../translations/it_IT/process/changes.rst         |  487 +-
+ .../translations/it_IT/process/coding-style.rst    |  103 +-
+ Documentation/translations/it_IT/process/howto.rst |   13 +-
+ .../it_IT/process/stable-api-nonsense.rst          |  202 +-
+ .../it_IT/process/submit-checklist.rst             |  127 +-
+ .../it_IT/process/submitting-drivers.rst           |    8 +-
+ .../it_IT/process/submitting-patches.rst           |  862 ++-
+ Documentation/translations/ja_JP/howto.rst         |   12 +-
+ Documentation/translations/ko_KR/howto.rst         |   56 +-
+ Documentation/translations/zh_CN/HOWTO             |    9 -
+ Documentation/translations/zh_CN/coding-style.rst  |   57 +-
+ Documentation/usb/authorization.txt                |    4 +-
+ Documentation/userspace-api/spec_ctrl.rst          |   27 +-
+ Documentation/virtual/kvm/api.txt                  |   17 +
+ Documentation/virtual/kvm/halt-polling.txt         |   37 +-
+ Documentation/virtual/kvm/mmu.txt                  |   41 +-
+ Documentation/virtual/kvm/s390-diag.txt            |    3 +-
+ Documentation/vm/index.rst                         |    2 +-
+ Documentation/vm/slub.rst                          |    4 +-
+ Documentation/watchdog/mlx-wdt.txt                 |   52 +
+ Documentation/xtensa/booting.txt                   |   19 +
+ Kbuild                                             |   29 +-
+ LICENSES/exceptions/GCC-exception-2.0              |   18 +
+ MAINTAINERS                                        |  452 +-
+ Makefile                                           |  243 +-
+ arch/Kconfig                                       |   18 +-
+ arch/alpha/include/asm/topology.h                  |    3 +-
+ arch/alpha/include/asm/unistd.h                    |   21 -
+ arch/alpha/include/uapi/asm/Kbuild                 |    2 -
+ arch/alpha/include/uapi/asm/mman.h                 |    4 +-
+ arch/alpha/include/uapi/asm/socket.h               |    2 +-
+ arch/alpha/include/uapi/asm/unistd.h               |   10 +
+ arch/alpha/kernel/core_cia.c                       |    5 +-
+ arch/alpha/kernel/core_marvel.c                    |    6 +
+ arch/alpha/kernel/osf_sys.c                        |    5 +-
+ arch/alpha/kernel/pci-noop.c                       |   13 +-
+ arch/alpha/kernel/pci.c                            |   11 +-
+ arch/alpha/kernel/pci_iommu.c                      |   16 +-
+ arch/alpha/kernel/perf_event.c                     |    7 +-
+ arch/alpha/kernel/setup.c                          |    2 +-
+ arch/alpha/kernel/syscalls/syscall.tbl             |   22 +-
+ arch/arc/Kconfig                                   |    4 +-
+ arch/arc/configs/axs101_defconfig                  |    1 -
+ arch/arc/configs/axs103_defconfig                  |    1 -
+ arch/arc/configs/axs103_smp_defconfig              |    1 -
+ arch/arc/configs/haps_hs_defconfig                 |    1 -
+ arch/arc/configs/haps_hs_smp_defconfig             |    1 -
+ arch/arc/configs/hsdk_defconfig                    |    1 -
+ arch/arc/configs/nps_defconfig                     |    1 -
+ arch/arc/configs/nsim_700_defconfig                |    1 -
+ arch/arc/configs/nsim_hs_defconfig                 |    1 -
+ arch/arc/configs/nsim_hs_smp_defconfig             |    1 -
+ arch/arc/configs/nsimosci_defconfig                |    1 -
+ arch/arc/configs/nsimosci_hs_defconfig             |    1 -
+ arch/arc/configs/nsimosci_hs_smp_defconfig         |    1 -
+ arch/arc/configs/tb10x_defconfig                   |    1 -
+ arch/arc/configs/vdk_hs38_defconfig                |    1 -
+ arch/arc/configs/vdk_hs38_smp_defconfig            |    1 -
+ arch/arc/include/asm/Kbuild                        |    1 +
+ arch/arc/include/asm/dma-mapping.h                 |   13 -
+ arch/arc/include/uapi/asm/Kbuild                   |    2 -
+ arch/arc/include/uapi/asm/unistd.h                 |    2 +
+ arch/arc/kernel/unwind.c                           |    3 +-
+ arch/arc/mm/highmem.c                              |    4 +
+ arch/arm/Kconfig                                   |   13 +-
+ arch/arm/Kconfig-nommu                             |    2 +
+ arch/arm/Makefile                                  |    3 +-
+ arch/arm/boot/bootp/Makefile                       |    2 +-
+ arch/arm/boot/bootp/init.S                         |    2 +-
+ arch/arm/boot/compressed/Makefile                  |    2 -
+ arch/arm/boot/compressed/ll_char_wr.S              |    4 +-
+ arch/arm/boot/dts/Makefile                         |   16 +-
+ arch/arm/boot/dts/alphascale-asm9260.dtsi          |    3 +-
+ arch/arm/boot/dts/alpine.dtsi                      |    8 +-
+ arch/arm/boot/dts/am335x-baltos-ir2110.dts         |    4 -
+ arch/arm/boot/dts/am335x-baltos-ir3220.dts         |    4 -
+ arch/arm/boot/dts/am335x-baltos-ir5221.dts         |    4 -
+ arch/arm/boot/dts/am335x-chiliboard.dts            |    8 +-
+ arch/arm/boot/dts/am335x-guardian.dts              |  511 ++
+ arch/arm/boot/dts/am335x-icev2.dts                 |    4 -
+ arch/arm/boot/dts/am335x-igep0033.dtsi             |    4 -
+ arch/arm/boot/dts/am335x-lxm.dts                   |    4 -
+ arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi  |    5 -
+ arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts     |    5 -
+ arch/arm/boot/dts/am335x-phycore-som.dtsi          |    4 -
+ arch/arm/boot/dts/am335x-shc.dts                   |    4 +-
+ arch/arm/boot/dts/am33xx-l4.dtsi                   |   17 +-
+ arch/arm/boot/dts/am3874-iceboard.dts              |  496 ++
+ arch/arm/boot/dts/am437x-gp-evm.dts                |    2 +-
+ arch/arm/boot/dts/am437x-l4.dtsi                   |   17 +-
+ arch/arm/boot/dts/am43x-epos-evm.dts               |    5 +-
+ arch/arm/boot/dts/arm-realview-eb.dtsi             |    4 +-
+ arch/arm/boot/dts/arm-realview-pb1176.dts          |    4 +-
+ arch/arm/boot/dts/arm-realview-pb11mp.dts          |    4 +-
+ arch/arm/boot/dts/arm-realview-pbx.dtsi            |    4 +-
+ arch/arm/boot/dts/armada-370-rd.dts                |   42 -
+ arch/arm/boot/dts/armada-388-clearfog.dts          |   58 -
+ arch/arm/boot/dts/armada-38x.dtsi                  |    4 +-
+ arch/arm/boot/dts/armada-39x.dtsi                  |    3 +-
+ arch/arm/boot/dts/armada-xp-linksys-mamba.dts      |   47 -
+ arch/arm/boot/dts/artpec6.dtsi                     |    3 +-
+ .../dts/aspeed-bmc-arm-stardragon4800-rep2.dts     |   10 +
+ .../arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts |   55 +-
+ arch/arm/boot/dts/aspeed-bmc-inspur-on5263m5.dts   |  145 +
+ arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts      |    5 +
+ arch/arm/boot/dts/aspeed-bmc-quanta-q71l.dts       |    8 +
+ arch/arm/boot/dts/aspeed-g4.dtsi                   |    1 +
+ arch/arm/boot/dts/aspeed-g5.dtsi                   |   41 +-
+ arch/arm/boot/dts/at91-nattis-2-natte-2.dts        |    2 +-
+ arch/arm/boot/dts/at91-sama5d27_som1.dtsi          |   30 +
+ arch/arm/boot/dts/at91-sama5d27_som1_ek.dts        |    4 +
+ arch/arm/boot/dts/at91-wb45n.dts                   |    2 +-
+ arch/arm/boot/dts/at91-wb50n.dts                   |    4 +-
+ arch/arm/boot/dts/at91rm9200.dtsi                  |    4 +-
+ arch/arm/boot/dts/at91sam9260.dtsi                 |    4 +-
+ arch/arm/boot/dts/at91sam9261.dtsi                 |    4 +-
+ arch/arm/boot/dts/at91sam9263.dtsi                 |    4 +-
+ arch/arm/boot/dts/at91sam9g45.dtsi                 |    4 +-
+ arch/arm/boot/dts/at91sam9n12.dtsi                 |    4 +-
+ arch/arm/boot/dts/at91sam9rl.dtsi                  |    4 +-
+ arch/arm/boot/dts/at91sam9x5.dtsi                  |    4 +-
+ arch/arm/boot/dts/atlas6-evb.dts                   |    1 +
+ arch/arm/boot/dts/atlas6.dtsi                      |    1 -
+ arch/arm/boot/dts/atlas7.dtsi                      |    1 -
+ arch/arm/boot/dts/axm55xx.dtsi                     |    4 +-
+ arch/arm/boot/dts/bcm-cygnus.dtsi                  |    9 +-
+ arch/arm/boot/dts/bcm-nsp.dtsi                     |    4 +-
+ arch/arm/boot/dts/bcm11351.dtsi                    |    4 +-
+ arch/arm/boot/dts/bcm21664-garnet.dts              |    1 +
+ arch/arm/boot/dts/bcm21664.dtsi                    |    4 +-
+ arch/arm/boot/dts/bcm23550-sparrow.dts             |    1 +
+ arch/arm/boot/dts/bcm23550.dtsi                    |    4 +-
+ arch/arm/boot/dts/bcm28155-ap.dts                  |    1 +
+ arch/arm/boot/dts/bcm2835-rpi-a-plus.dts           |    4 +-
+ arch/arm/boot/dts/bcm2835-rpi-b-plus.dts           |    4 +-
+ arch/arm/boot/dts/bcm2835-rpi-zero-w.dts           |   11 +-
+ arch/arm/boot/dts/bcm2835-rpi-zero.dts             |    4 +-
+ arch/arm/boot/dts/bcm2835-rpi.dtsi                 |    8 +-
+ arch/arm/boot/dts/bcm2836-rpi-2-b.dts              |   68 +-
+ arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts         |  175 +
+ arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts         |   74 +-
+ arch/arm/boot/dts/bcm2837-rpi-3-b.dts              |   74 +-
+ arch/arm/boot/dts/bcm2837-rpi-cm3.dtsi             |    2 +-
+ arch/arm/boot/dts/bcm283x.dtsi                     |   17 +-
+ arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts        |    1 +
+ arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts |    1 +
+ arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts  |    1 +
+ arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts      |    1 +
+ arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts      |    1 +
+ arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts |    1 +
+ arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts      |    1 +
+ arch/arm/boot/dts/bcm47094-linksys-panamera.dts    |    1 +
+ arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts      |    1 +
+ arch/arm/boot/dts/bcm47094-luxul-xap-1610.dts      |    1 +
+ arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts      |    1 +
+ arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts      |    1 +
+ arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts   |    1 +
+ arch/arm/boot/dts/bcm47094-netgear-r8500.dts       |    1 +
+ arch/arm/boot/dts/bcm47094-phicomm-k3.dts          |   71 +
+ arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts      |    4 +-
+ arch/arm/boot/dts/bcm47189-luxul-xap-810.dts       |    4 +-
+ arch/arm/boot/dts/bcm47189-tenda-ac9.dts           |    1 +
+ arch/arm/boot/dts/bcm5301x.dtsi                    |    3 +-
+ arch/arm/boot/dts/bcm53340-ubnt-unifi-switch8.dts  |    1 +
+ arch/arm/boot/dts/bcm53573.dtsi                    |    3 +-
+ arch/arm/boot/dts/bcm63138.dtsi                    |    4 +-
+ arch/arm/boot/dts/bcm7445.dtsi                     |    2 -
+ arch/arm/boot/dts/bcm947189acdbmr.dts              |    1 +
+ arch/arm/boot/dts/bcm953012er.dts                  |    1 +
+ arch/arm/boot/dts/bcm953012hr.dts                  |    1 +
+ arch/arm/boot/dts/bcm953012k.dts                   |    1 +
+ arch/arm/boot/dts/cx92755.dtsi                     |    4 +-
+ arch/arm/boot/dts/da850-lcdk.dts                   |   10 +-
+ arch/arm/boot/dts/dm814x.dtsi                      |   79 +-
+ arch/arm/boot/dts/dove.dtsi                        |    4 +-
+ arch/arm/boot/dts/dra7-l4.dtsi                     |   15 +-
+ arch/arm/boot/dts/ep7209.dtsi                      |    4 +-
+ arch/arm/boot/dts/ep7211-edb7211.dts               |    1 +
+ arch/arm/boot/dts/exynos3250.dtsi                  |    3 +
+ arch/arm/boot/dts/exynos4412-odroid-common.dtsi    |   14 +-
+ arch/arm/boot/dts/exynos4412-odroidx.dts           |    2 +-
+ arch/arm/boot/dts/exynos5250-arndale.dts           |    4 +-
+ arch/arm/boot/dts/exynos5422-odroid-core.dtsi      |    7 +-
+ arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi  |    6 +-
+ arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi |    5 -
+ arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts    |    8 +
+ arch/arm/boot/dts/exynos5422-odroidxu4.dts         |    4 +-
+ arch/arm/boot/dts/imx27.dtsi                       |    2 +-
+ arch/arm/boot/dts/imx28-cfa10036.dts               |    3 +-
+ arch/arm/boot/dts/imx51-digi-connectcore-jsk.dts   |   16 +
+ arch/arm/boot/dts/imx51-digi-connectcore-som.dtsi  |   34 +-
+ arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi      |  555 ++
+ arch/arm/boot/dts/imx6-logicpd-som.dtsi            |  365 ++
+ arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts       |    5 +-
+ arch/arm/boot/dts/imx6dl-yapp4-common.dtsi         |  595 ++
+ arch/arm/boot/dts/imx6dl-yapp4-draco.dts           |   58 +
+ arch/arm/boot/dts/imx6dl-yapp4-hydra.dts           |   50 +
+ arch/arm/boot/dts/imx6dl-yapp4-ursa.dts            |   54 +
+ arch/arm/boot/dts/imx6q-logicpd.dts                |  120 +
+ arch/arm/boot/dts/imx6q-tbs2910.dts                |   49 +-
+ arch/arm/boot/dts/imx6qdl-apalis.dtsi              |   26 +-
+ arch/arm/boot/dts/imx6qdl-colibri.dtsi             |   26 +-
+ arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi       |   14 +
+ arch/arm/boot/dts/imx6qdl-sabresd.dtsi             |    6 +-
+ arch/arm/boot/dts/imx6sl.dtsi                      |    8 +-
+ arch/arm/boot/dts/imx6sx.dtsi                      |   19 +-
+ arch/arm/boot/dts/imx6ul-phytec-pcl063.dtsi        |  148 +
+ arch/arm/boot/dts/imx6ul-phytec-peb-eval-01.dtsi   |   55 +
+ .../boot/dts/imx6ul-phytec-phyboard-segin-full.dts |   89 +
+ .../arm/boot/dts/imx6ul-phytec-phyboard-segin.dtsi |  329 +
+ arch/arm/boot/dts/imx6ull-colibri.dtsi             |    8 +-
+ arch/arm/boot/dts/imx6ull.dtsi                     |   12 +
+ arch/arm/boot/dts/imx7d.dtsi                       |    9 +
+ arch/arm/boot/dts/imx7ulp.dtsi                     |   19 +-
+ arch/arm/boot/dts/integrator.dtsi                  |   10 +-
+ arch/arm/boot/dts/integratorcp.dts                 |   89 +-
+ arch/arm/boot/dts/kirkwood-dir665.dts              |   47 -
+ arch/arm/boot/dts/kirkwood-linksys-viper.dts       |   47 -
+ arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts     |   47 -
+ arch/arm/boot/dts/kirkwood-rd88f6281-z0.dts        |    9 -
+ arch/arm/boot/dts/kirkwood-rd88f6281.dtsi          |   41 -
+ arch/arm/boot/dts/kirkwood.dtsi                    |    3 +-
+ arch/arm/boot/dts/lpc3250-ea3250.dts               |   20 +-
+ arch/arm/boot/dts/lpc3250-phy3250.dts              |   87 +-
+ arch/arm/boot/dts/lpc32xx.dtsi                     |   32 +-
+ arch/arm/boot/dts/lpc4350-hitex-eval.dts           |    2 -
+ arch/arm/boot/dts/lpc4357-ea4357-devkit.dts        |    2 -
+ arch/arm/boot/dts/lpc4357-myd-lpc4357.dts          |  619 ++
+ arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts        |    1 +
+ arch/arm/boot/dts/ls1021a-qds.dts                  |    1 +
+ arch/arm/boot/dts/ls1021a-twr.dts                  |    1 +
+ arch/arm/boot/dts/ls1021a.dtsi                     |   18 +-
+ arch/arm/boot/dts/meson.dtsi                       |   10 +-
+ arch/arm/boot/dts/meson6-atv1200.dts               |    1 +
+ arch/arm/boot/dts/meson6.dtsi                      |    8 +
+ arch/arm/boot/dts/meson8-minix-neo-x8.dts          |    1 +
+ arch/arm/boot/dts/meson8.dtsi                      |   89 +-
+ arch/arm/boot/dts/meson8b-ec100.dts                |  128 +
+ arch/arm/boot/dts/meson8b-mxq.dts                  |    1 +
+ arch/arm/boot/dts/meson8b-odroidc1.dts             |    6 +
+ arch/arm/boot/dts/meson8b.dtsi                     |   83 +-
+ arch/arm/boot/dts/meson8m2-mxiii-plus.dts          |    6 +
+ arch/arm/boot/dts/meson8m2.dtsi                    |    4 +
+ arch/arm/boot/dts/milbeaut-m10v-evb.dts            |   32 +
+ arch/arm/boot/dts/milbeaut-m10v.dtsi               |   95 +
+ arch/arm/boot/dts/mmp2-brownstone.dts              |    1 +
+ arch/arm/boot/dts/mmp2.dtsi                        |    4 +-
+ arch/arm/boot/dts/moxart.dtsi                      |    3 +-
+ arch/arm/boot/dts/mps2.dtsi                        |    6 +-
+ arch/arm/boot/dts/mt2701-evb.dts                   |    1 +
+ arch/arm/boot/dts/mt2701.dtsi                      |    3 +-
+ arch/arm/boot/dts/mt6580-evbp1.dts                 |    1 +
+ arch/arm/boot/dts/mt6580.dtsi                      |    1 -
+ arch/arm/boot/dts/mt6589-aquaris5.dts              |    1 +
+ arch/arm/boot/dts/mt6589.dtsi                      |    3 +-
+ arch/arm/boot/dts/mt6592-evb.dts                   |    2 +-
+ arch/arm/boot/dts/mt6592.dtsi                      |    3 +-
+ arch/arm/boot/dts/mt7623.dtsi                      |   15 +-
+ arch/arm/boot/dts/mt8127-moose.dts                 |    1 +
+ arch/arm/boot/dts/mt8127.dtsi                      |    3 +-
+ arch/arm/boot/dts/mt8135-evbp1.dts                 |    1 +
+ arch/arm/boot/dts/mt8135.dtsi                      |    3 +-
+ arch/arm/boot/dts/nspire.dtsi                      |    4 +-
+ arch/arm/boot/dts/omap3-evm-common.dtsi            |    7 +-
+ arch/arm/boot/dts/omap3-evm-processor-common.dtsi  |   10 +-
+ arch/arm/boot/dts/omap3-gta04.dtsi                 |   39 +-
+ arch/arm/boot/dts/omap3-gta04a5.dts                |    2 +-
+ arch/arm/boot/dts/omap4-droid4-xt894.dts           |   10 +-
+ arch/arm/boot/dts/omap4-panda-common.dtsi          |    6 +-
+ arch/arm/boot/dts/omap4-sdp.dts                    |   30 +
+ arch/arm/boot/dts/orion5x-lacie-d2-network.dts     |    1 +
+ .../dts/orion5x-lacie-ethernet-disk-mini-v2.dts    |    1 +
+ arch/arm/boot/dts/orion5x-lswsgl.dts               |    1 +
+ .../boot/dts/orion5x-maxtor-shared-storage-2.dts   |    1 +
+ arch/arm/boot/dts/orion5x-netgear-wnr854t.dts      |    1 +
+ arch/arm/boot/dts/orion5x-rd88f5182-nas.dts        |    1 +
+ arch/arm/boot/dts/orion5x.dtsi                     |    4 +-
+ arch/arm/boot/dts/ox810se.dtsi                     |    4 +-
+ arch/arm/boot/dts/ox820.dtsi                       |    4 +-
+ arch/arm/boot/dts/picoxcell-pc3x2.dtsi             |    1 -
+ arch/arm/boot/dts/picoxcell-pc3x3.dtsi             |    1 -
+ arch/arm/boot/dts/prima2-evb.dts                   |    1 +
+ arch/arm/boot/dts/prima2.dtsi                      |    1 -
+ arch/arm/boot/dts/pxa168.dtsi                      |    4 +-
+ arch/arm/boot/dts/pxa2xx.dtsi                      |    3 +-
+ arch/arm/boot/dts/pxa910.dtsi                      |    4 +-
+ arch/arm/boot/dts/qcom-apq8060-dragonboard.dts     |   21 +-
+ arch/arm/boot/dts/qcom-apq8064.dtsi                |   54 +-
+ arch/arm/boot/dts/qcom-apq8084.dtsi                |    9 +-
+ arch/arm/boot/dts/qcom-ipq4019.dtsi                |   11 +-
+ arch/arm/boot/dts/qcom-ipq8064.dtsi                |    8 +-
+ arch/arm/boot/dts/qcom-mdm9615-wp8548.dtsi         |    1 +
+ arch/arm/boot/dts/qcom-mdm9615.dtsi                |   13 +-
+ arch/arm/boot/dts/qcom-msm8660.dtsi                |   72 +-
+ arch/arm/boot/dts/qcom-msm8960.dtsi                |    9 +-
+ .../dts/qcom-msm8974-lge-nexus5-hammerhead.dts     |  130 +
+ arch/arm/boot/dts/qcom-msm8974.dtsi                |   19 +-
+ arch/arm/boot/dts/qcom-pm8941.dtsi                 |   39 +-
+ arch/arm/boot/dts/qcom-pma8084.dtsi                |   24 +-
+ arch/arm/boot/dts/r7s9210-rza2mevb.dts             |   82 +
+ arch/arm/boot/dts/r7s9210.dtsi                     |  218 +
+ arch/arm/boot/dts/r8a7743.dtsi                     |   43 +-
+ arch/arm/boot/dts/r8a7744.dtsi                     |  188 +-
+ arch/arm/boot/dts/r8a77470-iwg23s-sbc.dts          |   18 +
+ arch/arm/boot/dts/r8a7778.dtsi                     |   28 +
+ arch/arm/boot/dts/r8a7779.dtsi                     |   26 +
+ arch/arm/boot/dts/r8a7790-stout.dts                |   15 +-
+ arch/arm/boot/dts/rk3036-kylin.dts                 |    1 -
+ arch/arm/boot/dts/rk3036.dtsi                      |    1 +
+ arch/arm/boot/dts/rk3066a-bqcurie2.dts             |    1 -
+ arch/arm/boot/dts/rk3066a-mk808.dts                |    1 -
+ arch/arm/boot/dts/rk3066a-rayeager.dts             |    2 -
+ arch/arm/boot/dts/rk3066a.dtsi                     |   48 +
+ arch/arm/boot/dts/rk3188-bqedison2qc.dts           |   19 +-
+ arch/arm/boot/dts/rk3188-px3-evb.dts               |    1 -
+ arch/arm/boot/dts/rk3229-evb.dts                   |    1 -
+ arch/arm/boot/dts/rk3288-fennec.dts                |    1 -
+ arch/arm/boot/dts/rk3288-firefly-reload.dts        |    1 -
+ arch/arm/boot/dts/rk3288-miqi.dts                  |    1 -
+ arch/arm/boot/dts/rk3288-popmetal.dts              |    1 -
+ arch/arm/boot/dts/rk3288-rock2-square.dts          |    1 -
+ arch/arm/boot/dts/rk3288-tinker-s.dts              |    1 -
+ arch/arm/boot/dts/rk3288-veyron.dtsi               |    4 +
+ arch/arm/boot/dts/rk3288-vyasa.dts                 |    1 -
+ arch/arm/boot/dts/rv1108-elgin-r1.dts              |  208 +
+ arch/arm/boot/dts/rv1108-evb.dts                   |   20 +-
+ arch/arm/boot/dts/rv1108.dtsi                      |   37 +
+ arch/arm/boot/dts/s3c2416-smdk2416.dts             |    5 +-
+ arch/arm/boot/dts/s5pv210-aries.dtsi               |   90 +
+ arch/arm/boot/dts/s5pv210-fascinate4g.dts          |    7 -
+ arch/arm/boot/dts/s5pv210-galaxys.dts              |    7 -
+ arch/arm/boot/dts/s5pv210.dtsi                     |   25 +-
+ arch/arm/boot/dts/sama5d2.dtsi                     |    4 +-
+ arch/arm/boot/dts/sama5d3.dtsi                     |    4 +-
+ arch/arm/boot/dts/sama5d4.dtsi                     |    4 +-
+ arch/arm/boot/dts/skeleton.dtsi                    |   18 -
+ arch/arm/boot/dts/skeleton64.dtsi                  |   14 -
+ arch/arm/boot/dts/socfpga.dtsi                     |   16 +
+ arch/arm/boot/dts/socfpga_arria10.dtsi             |   18 +
+ arch/arm/boot/dts/socfpga_cyclone5_chameleon96.dts |  130 +
+ arch/arm/boot/dts/spear13xx.dtsi                   |    4 +-
+ arch/arm/boot/dts/spear3xx.dtsi                    |    4 +-
+ arch/arm/boot/dts/spear600.dtsi                    |    4 +-
+ arch/arm/boot/dts/ste-nomadik-nhk15.dts            |   85 +-
+ arch/arm/boot/dts/ste-nomadik-stn8815.dtsi         |    2 +-
+ arch/arm/boot/dts/ste-u300.dts                     |    2 +-
+ arch/arm/boot/dts/stm32429i-eval.dts               |    1 +
+ arch/arm/boot/dts/stm32746g-eval.dts               |    1 +
+ arch/arm/boot/dts/stm32f429-disco.dts              |    1 +
+ arch/arm/boot/dts/stm32f429.dtsi                   |   64 +-
+ arch/arm/boot/dts/stm32f469-disco.dts              |    1 +
+ arch/arm/boot/dts/stm32f746-disco.dts              |    1 +
+ arch/arm/boot/dts/stm32f746.dtsi                   |    4 +-
+ arch/arm/boot/dts/stm32f769-disco.dts              |    1 +
+ arch/arm/boot/dts/stm32h743-pinctrl.dtsi           |   15 +
+ arch/arm/boot/dts/stm32h743.dtsi                   |   17 +-
+ arch/arm/boot/dts/stm32h743i-disco.dts             |   18 +
+ arch/arm/boot/dts/stm32h743i-eval.dts              |   18 +
+ arch/arm/boot/dts/stm32mp157-pinctrl.dtsi          |    7 +
+ arch/arm/boot/dts/stm32mp157c-ed1.dts              |    8 +
+ arch/arm/boot/dts/stm32mp157c-ev1.dts              |   10 +-
+ arch/arm/boot/dts/stm32mp157c.dtsi                 |   97 +-
+ arch/arm/boot/dts/sun4i-a10.dtsi                   |   44 +
+ arch/arm/boot/dts/sun5i-a13-q8-tablet.dts          |    7 +-
+ .../boot/dts/sun5i-reference-design-tablet.dtsi    |    2 +-
+ arch/arm/boot/dts/sun7i-a20-bananapi.dts           |    5 +
+ arch/arm/boot/dts/sun8i-a23-a33.dtsi               |  175 +-
+ arch/arm/boot/dts/sun8i-a23-q8-tablet.dts          |    4 +
+ arch/arm/boot/dts/sun8i-a23.dtsi                   |   20 +
+ arch/arm/boot/dts/sun8i-a33.dtsi                   |  194 +-
+ .../boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts  |    4 +
+ arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts       |    8 +
+ arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts   |    8 +
+ arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts      |   25 +
+ arch/arm/boot/dts/sun8i-q8-common.dtsi             |   37 +
+ arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts  |   41 +
+ arch/arm/boot/dts/sun8i-r40.dtsi                   |   15 +
+ arch/arm/boot/dts/sun9i-a80-cubieboard4.dts        |   44 +-
+ arch/arm/boot/dts/sun9i-a80-optimus.dts            |   44 +-
+ arch/arm/boot/dts/sun9i-a80.dtsi                   |   65 +
+ arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi      |   16 +-
+ arch/arm/boot/dts/sunxi-h3-h5.dtsi                 |    3 +-
+ arch/arm/boot/dts/tegra114-dalmore.dts             |    2 +-
+ arch/arm/boot/dts/tegra124-jetson-tk1.dts          |    2 +-
+ arch/arm/boot/dts/tegra124-nyan.dtsi               |    2 +-
+ arch/arm/boot/dts/tegra124-venice2.dts             |    2 +-
+ arch/arm/boot/dts/tegra20-trimslice.dts            |    2 +-
+ arch/arm/boot/dts/tegra20.dtsi                     |   15 +-
+ arch/arm/boot/dts/tegra30-beaver.dts               |    2 +-
+ arch/arm/boot/dts/tegra30-cardhu.dtsi              |    2 +-
+ arch/arm/boot/dts/versatile-ab.dts                 |    2 +-
+ arch/arm/boot/dts/vexpress-v2m-rs1.dtsi            |    2 +-
+ arch/arm/boot/dts/vexpress-v2m.dtsi                |    2 +-
+ arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts         |    5 +
+ arch/arm/boot/dts/vf610-bk4.dts                    |   31 +
+ arch/arm/boot/dts/vf610-zii-cfu1.dts               |    2 +-
+ arch/arm/boot/dts/vf610-zii-ssmb-dtu.dts           |  311 +
+ arch/arm/boot/dts/vf610-zii-ssmb-spu3.dts          |    3 +
+ arch/arm/boot/dts/vt8500.dtsi                      |    9 +-
+ arch/arm/boot/dts/wm8505.dtsi                      |    9 +-
+ arch/arm/boot/dts/wm8650.dtsi                      |    9 +-
+ arch/arm/boot/dts/wm8750.dtsi                      |    9 +-
+ arch/arm/boot/dts/wm8850.dtsi                      |    9 +-
+ arch/arm/boot/dts/zx296702-ad1.dts                 |    1 +
+ arch/arm/boot/dts/zx296702.dtsi                    |    4 +-
+ arch/arm/boot/dts/zynq-zturn.dts                   |    2 +-
+ arch/arm/common/mcpm_entry.c                       |    2 +-
+ arch/arm/configs/axm55xx_defconfig                 |    4 -
+ arch/arm/configs/bcm2835_defconfig                 |    4 +-
+ arch/arm/configs/cns3420vb_defconfig               |    1 -
+ arch/arm/configs/efm32_defconfig                   |    1 -
+ arch/arm/configs/eseries_pxa_defconfig             |    1 -
+ arch/arm/configs/gemini_defconfig                  |    1 -
+ arch/arm/configs/integrator_defconfig              |    9 +-
+ arch/arm/configs/lpc18xx_defconfig                 |   31 +-
+ arch/arm/configs/lpc32xx_defconfig                 |   65 +-
+ arch/arm/configs/milbeaut_m10v_defconfig           |  119 +
+ arch/arm/configs/mini2440_defconfig                |    1 -
+ arch/arm/configs/moxart_defconfig                  |    1 -
+ arch/arm/configs/mps2_defconfig                    |    1 -
+ arch/arm/configs/multi_v7_defconfig                |   10 +-
+ arch/arm/configs/nhk8815_defconfig                 |   41 +-
+ arch/arm/configs/nuc910_defconfig                  |    1 -
+ arch/arm/configs/nuc950_defconfig                  |    1 -
+ arch/arm/configs/nuc960_defconfig                  |    1 -
+ arch/arm/configs/omap2plus_defconfig               |   83 +-
+ arch/arm/configs/pxa_defconfig                     |    5 -
+ arch/arm/configs/raumfeld_defconfig                |  197 -
+ arch/arm/configs/s5pv210_defconfig                 |   47 +-
+ arch/arm/configs/shmobile_defconfig                |   48 +-
+ arch/arm/configs/socfpga_defconfig                 |   25 +-
+ arch/arm/configs/spear3xx_defconfig                |    6 +-
+ arch/arm/configs/stm32_defconfig                   |    1 -
+ arch/arm/include/asm/Kbuild                        |    1 -
+ arch/arm/include/asm/arch_gicv3.h                  |   37 +-
+ arch/arm/include/asm/assembler.h                   |   12 +-
+ arch/arm/include/asm/barrier.h                     |    2 +
+ arch/arm/include/asm/dma-mapping.h                 |    9 -
+ arch/arm/include/asm/hardware/entry-macro-iomd.S   |   10 +-
+ arch/arm/include/asm/kvm_emulate.h                 |    8 +
+ arch/arm/include/asm/kvm_host.h                    |   53 +-
+ arch/arm/include/asm/kvm_hyp.h                     |    4 +
+ arch/arm/include/asm/kvm_mmu.h                     |    9 +-
+ arch/arm/include/asm/kvm_ras.h                     |   14 +
+ arch/arm/include/asm/pgtable.h                     |    3 +
+ arch/arm/include/asm/processor.h                   |    6 +-
+ arch/arm/include/asm/smp.h                         |    1 -
+ arch/arm/include/asm/smp_twd.h                     |   16 -
+ arch/arm/include/asm/spinlock.h                    |    3 +-
+ arch/arm/include/asm/suspend.h                     |    1 +
+ arch/arm/include/asm/system_misc.h                 |    5 -
+ arch/arm/include/asm/uaccess.h                     |    3 +-
+ arch/arm/include/asm/unistd.h                      |    5 +-
+ arch/arm/include/asm/v7m.h                         |    2 +-
+ arch/arm/include/asm/vfpmacros.h                   |    8 +-
+ arch/arm/include/debug/tegra.S                     |    2 +-
+ arch/arm/include/uapi/asm/Kbuild                   |    1 -
+ arch/arm/kernel/debug.S                            |    2 +-
+ arch/arm/kernel/entry-armv.S                       |   12 +-
+ arch/arm/kernel/entry-common.S                     |    2 +-
+ arch/arm/kernel/entry-header.S                     |   11 +-
+ arch/arm/kernel/entry-v7m.S                        |    4 +
+ arch/arm/kernel/head-nommu.S                       |    4 +-
+ arch/arm/kernel/hyp-stub.S                         |    4 +-
+ arch/arm/kernel/machine_kexec.c                    |    5 +-
+ arch/arm/kernel/patch.c                            |    6 +-
+ arch/arm/kernel/setup.c                            |    6 +
+ arch/arm/kernel/sleep.S                            |   12 +
+ arch/arm/kernel/smp.c                              |   10 +-
+ arch/arm/kernel/smp_twd.c                          |   66 -
+ arch/arm/kernel/sys_oabi-compat.c                  |    8 +-
+ arch/arm/kernel/unwind.c                           |   14 +-
+ arch/arm/kvm/Makefile                              |    5 +-
+ arch/arm/kvm/coproc.c                              |   23 +-
+ arch/arm/kvm/hyp/cp15-sr.c                         |    1 -
+ arch/arm/kvm/hyp/hyp-entry.S                       |    2 +-
+ arch/arm/kvm/hyp/switch.c                          |    2 +-
+ arch/arm/kvm/hyp/tlb.c                             |    4 +-
+ arch/arm/kvm/interrupts.S                          |    4 +-
+ arch/arm/lib/Makefile                              |    2 +-
+ arch/arm/lib/bitops.h                              |    8 +-
+ arch/arm/lib/clear_user.S                          |    2 +-
+ arch/arm/lib/copy_from_user.S                      |    2 +-
+ arch/arm/lib/copy_page.S                           |    4 +-
+ arch/arm/lib/copy_template.S                       |    6 +-
+ arch/arm/lib/copy_to_user.S                        |    2 +-
+ arch/arm/lib/csumpartial.S                         |   20 +-
+ arch/arm/lib/csumpartialcopygeneric.S              |    4 +-
+ arch/arm/lib/csumpartialcopyuser.S                 |    2 +-
+ arch/arm/lib/div64.S                               |    4 +-
+ arch/arm/lib/floppydma.S                           |   10 +-
+ arch/arm/lib/io-readsb.S                           |   20 +-
+ arch/arm/lib/io-readsl.S                           |    2 +-
+ arch/arm/lib/io-readsw-armv3.S                     |    6 +-
+ arch/arm/lib/io-readsw-armv4.S                     |   12 +-
+ arch/arm/lib/io-writesb.S                          |   20 +-
+ arch/arm/lib/io-writesl.S                          |    2 +-
+ arch/arm/lib/io-writesw-armv3.S                    |    2 +-
+ arch/arm/lib/io-writesw-armv4.S                    |    6 +-
+ arch/arm/lib/lib1funcs.S                           |    4 +-
+ arch/arm/lib/memcpy.S                              |    4 +-
+ arch/arm/lib/memmove.S                             |   24 +-
+ arch/arm/lib/memset.S                              |   42 +-
+ arch/arm/lib/xor-neon.c                            |    2 +-
+ arch/arm/mach-actions/platsmp.c                    |   15 -
+ arch/arm/mach-bcm/Kconfig                          |    1 +
+ arch/arm/mach-davinci/Kconfig                      |   19 +-
+ arch/arm/mach-davinci/Makefile                     |    3 -
+ arch/arm/mach-davinci/asp.h                        |    8 +-
+ arch/arm/mach-davinci/board-da830-evm.c            |   91 +-
+ arch/arm/mach-davinci/board-da850-evm.c            |   55 +-
+ arch/arm/mach-davinci/board-dm355-evm.c            |    2 +-
+ arch/arm/mach-davinci/board-dm355-leopard.c        |    2 +-
+ arch/arm/mach-davinci/board-dm365-evm.c            |   15 +-
+ arch/arm/mach-davinci/board-dm644x-evm.c           |   21 +-
+ arch/arm/mach-davinci/board-dm646x-evm.c           |   19 +-
+ arch/arm/mach-davinci/board-mityomapl138.c         |   41 +-
+ arch/arm/mach-davinci/board-neuros-osd2.c          |    2 +-
+ arch/arm/mach-davinci/board-omapl138-hawk.c        |   84 +-
+ arch/arm/mach-davinci/board-sffsdr.c               |   15 +-
+ arch/arm/mach-davinci/common.c                     |   18 -
+ arch/arm/mach-davinci/cp_intc.c                    |  215 -
+ arch/arm/mach-davinci/cp_intc.h                    |   57 -
+ arch/arm/mach-davinci/da830.c                      |  128 +-
+ arch/arm/mach-davinci/da850.c                      |  156 +-
+ arch/arm/mach-davinci/davinci.h                    |    4 +
+ arch/arm/mach-davinci/devices-da8xx.c              |  147 +-
+ arch/arm/mach-davinci/devices.c                    |   40 +-
+ arch/arm/mach-davinci/dm355.c                      |   78 +-
+ arch/arm/mach-davinci/dm365.c                      |  102 +-
+ arch/arm/mach-davinci/dm644x.c                     |   68 +-
+ arch/arm/mach-davinci/dm646x.c                     |   82 +-
+ arch/arm/mach-davinci/include/mach/common.h        |   14 +-
+ arch/arm/mach-davinci/include/mach/cpufreq.h       |   26 -
+ arch/arm/mach-davinci/include/mach/da8xx.h         |    2 +
+ arch/arm/mach-davinci/include/mach/entry-macro.S   |   39 -
+ arch/arm/mach-davinci/irq.c                        |  117 -
+ arch/arm/mach-davinci/{include/mach => }/irqs.h    |    4 -
+ arch/arm/mach-davinci/usb-da8xx.c                  |    9 +-
+ arch/arm/mach-davinci/usb.c                        |   15 +-
+ arch/arm/mach-ep93xx/ts72xx.c                      |    1 -
+ arch/arm/mach-exynos/headsmp.S                     |    2 +-
+ arch/arm/mach-exynos/platsmp.c                     |   35 +-
+ arch/arm/mach-imx/Makefile                         |    3 +-
+ arch/arm/mach-imx/common.h                         |   10 +
+ arch/arm/mach-imx/cpuidle-imx7ulp.c                |   60 +
+ arch/arm/mach-imx/cpuidle.h                        |    5 +
+ arch/arm/mach-imx/mach-imx27_visstrim_m10.c        |   12 +-
+ arch/arm/mach-imx/mach-imx7ulp.c                   |   46 +
+ arch/arm/mach-imx/mach-mx31moboard.c               |    3 +-
+ arch/arm/mach-imx/mmdc.c                           |    9 +-
+ arch/arm/mach-imx/pm-imx7ulp.c                     |   49 +-
+ arch/arm/mach-ks8695/include/mach/entry-macro.S    |    2 +-
+ arch/arm/mach-lpc32xx/phy3250.c                    |   84 -
+ arch/arm/mach-lpc32xx/pm.c                         |   13 +-
+ arch/arm/mach-mediatek/Kconfig                     |    4 +
+ arch/arm/mach-mediatek/mediatek.c                  |    3 +-
+ arch/arm/mach-mediatek/platsmp.c                   |    2 +-
+ arch/arm/mach-meson/Kconfig                        |    1 -
+ arch/arm/mach-milbeaut/Kconfig                     |   20 +
+ arch/arm/mach-milbeaut/Makefile                    |    1 +
+ arch/arm/mach-milbeaut/platsmp.c                   |  143 +
+ arch/arm/mach-omap1/board-nokia770.c               |   18 +-
+ arch/arm/mach-omap2/omap_hwmod.c                   |   16 +-
+ arch/arm/mach-omap2/omap_hwmod_81xx_data.c         |  131 +-
+ arch/arm/mach-omap2/prm_common.c                   |    4 +-
+ arch/arm/mach-oxnas/Makefile                       |    1 -
+ arch/arm/mach-oxnas/hotplug.c                      |  109 -
+ arch/arm/mach-oxnas/platsmp.c                      |    4 -
+ arch/arm/mach-prima2/common.h                      |    2 +
+ arch/arm/mach-prima2/headsmp.S                     |    2 +-
+ arch/arm/mach-prima2/hotplug.c                     |    3 +-
+ arch/arm/mach-prima2/platsmp.c                     |   17 +-
+ arch/arm/mach-pxa/Kconfig                          |   18 -
+ arch/arm/mach-pxa/Makefile                         |    3 -
+ arch/arm/mach-pxa/include/mach/pxa25x-udc.h        |    0
+ arch/arm/mach-pxa/raumfeld.c                       | 1186 ----
+ arch/arm/mach-qcom/platsmp.c                       |   26 -
+ arch/arm/mach-s3c24xx/mach-osiris-dvs.c            |    8 +-
+ arch/arm/mach-sa1100/simpad.c                      |    1 -
+ arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c |    5 +
+ arch/arm/mach-socfpga/socfpga.c                    |    3 +-
+ arch/arm/mach-spear/generic.h                      |    2 +
+ arch/arm/mach-spear/headsmp.S                      |    2 +-
+ arch/arm/mach-spear/hotplug.c                      |    4 +-
+ arch/arm/mach-spear/platsmp.c                      |   27 +-
+ arch/arm/mach-sunxi/sunxi.c                        |    2 +-
+ arch/arm/mach-tegra/iomap.h                        |    9 +
+ arch/arm/mach-tegra/reset-handler.S                |    2 +-
+ arch/arm/mach-tegra/sleep-tegra20.S                |    2 -
+ arch/arm/mach-tegra/sleep-tegra30.S                |   25 +-
+ arch/arm/mm/cache-l2x0-pmu.c                       |    9 +-
+ arch/arm/mm/cache-v6.S                             |    8 +-
+ arch/arm/mm/copypage-v4mc.c                        |    3 +-
+ arch/arm/mm/copypage-v4wb.c                        |    3 +-
+ arch/arm/mm/copypage-v4wt.c                        |    3 +-
+ arch/arm/mm/dma-mapping.c                          |    4 +-
+ arch/arm/mm/idmap.c                                |    4 +-
+ arch/arm/mm/init.c                                 |   75 +-
+ arch/arm/mm/mmu.c                                  |   25 +-
+ arch/arm/mm/pmsa-v8.c                              |    4 +-
+ arch/arm/mm/proc-v7m.S                             |    7 +-
+ arch/arm/tools/syscall.tbl                         |   85 +-
+ arch/arm64/Kconfig                                 |   44 +-
+ arch/arm64/Kconfig.platforms                       |   16 +-
+ arch/arm64/boot/dts/Makefile                       |    1 +
+ arch/arm64/boot/dts/actions/s700-cubieboard7.dts   |   53 +
+ arch/arm64/boot/dts/actions/s700.dtsi              |   66 +-
+ arch/arm64/boot/dts/actions/s900.dtsi              |   18 +-
+ arch/arm64/boot/dts/al/alpine-v2.dtsi              |    8 +-
+ .../boot/dts/allwinner/sun50i-a64-bananapi-m64.dts |    8 +
+ .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts   |    4 +
+ .../boot/dts/allwinner/sun50i-a64-olinuxino.dts    |    8 +
+ .../boot/dts/allwinner/sun50i-a64-orangepi-win.dts |    8 +
+ .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts |    8 +
+ .../boot/dts/allwinner/sun50i-a64-teres-i.dts      |   10 +-
+ arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi      |   38 +-
+ .../allwinner/sun50i-h5-libretech-all-h3-cc.dts    |    4 +
+ arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi       |    8 +-
+ arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi       |   44 +-
+ arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi  |   37 +-
+ arch/arm64/boot/dts/amlogic/Makefile               |    1 +
+ arch/arm64/boot/dts/amlogic/meson-axg-s400.dts     |   30 +-
+ arch/arm64/boot/dts/amlogic/meson-axg.dtsi         |   33 +-
+ arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts |   28 +
+ arch/arm64/boot/dts/amlogic/meson-g12a.dtsi        |   70 +-
+ arch/arm64/boot/dts/amlogic/meson-gx.dtsi          |   31 +-
+ arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi        |    6 +
+ arch/arm64/boot/dts/amlogic/meson-gxl.dtsi         |    6 +
+ arch/arm64/boot/dts/amlogic/meson-gxm.dtsi         |    8 +-
+ arch/arm64/boot/dts/apm/apm-shadowcat.dtsi         |   16 +-
+ arch/arm64/boot/dts/apm/apm-storm.dtsi             |   16 +-
+ arch/arm64/boot/dts/arm/Makefile                   |    1 +
+ arch/arm64/boot/dts/arm/foundation-v8-gicv2.dtsi   |    2 +-
+ arch/arm64/boot/dts/arm/foundation-v8-gicv3.dtsi   |    2 +-
+ arch/arm64/boot/dts/arm/foundation-v8.dtsi         |  106 +-
+ arch/arm64/boot/dts/arm/fvp-base-revc.dts          |  277 +
+ arch/arm64/boot/dts/arm/juno-base.dtsi             |  108 +-
+ arch/arm64/boot/dts/arm/juno-r1.dts                |   12 +-
+ arch/arm64/boot/dts/arm/juno-r2.dts                |   18 +-
+ arch/arm64/boot/dts/arm/juno.dts                   |   18 +-
+ arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dts         |  106 +-
+ .../boot/dts/arm/rtsm_ve-motherboard-rs2.dtsi      |   27 +
+ arch/arm64/boot/dts/arm/rtsm_ve-motherboard.dtsi   |   14 +-
+ .../boot/dts/arm/vexpress-v2f-1xv7-ca53x2.dts      |    4 +-
+ arch/arm64/boot/dts/bitmain/Makefile               |    3 +
+ arch/arm64/boot/dts/bitmain/bm1880-sophon-edge.dts |   50 +
+ arch/arm64/boot/dts/bitmain/bm1880.dtsi            |  119 +
+ arch/arm64/boot/dts/broadcom/Makefile              |    3 +-
+ .../boot/dts/broadcom/bcm2837-rpi-3-a-plus.dts     |    2 +
+ arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi   |    8 +-
+ .../arm64/boot/dts/broadcom/stingray/stingray.dtsi |   16 +-
+ arch/arm64/boot/dts/cavium/thunder-88xx.dtsi       |   96 +-
+ arch/arm64/boot/dts/cavium/thunder2-99xx.dtsi      |    8 +-
+ arch/arm64/boot/dts/exynos/exynos5433.dtsi         |   16 +-
+ arch/arm64/boot/dts/exynos/exynos7.dtsi            |    8 +-
+ arch/arm64/boot/dts/freescale/Makefile             |    2 +
+ .../boot/dts/freescale/fsl-ls1012a-oxalis.dts      |   96 +
+ arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi     |    2 +
+ arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts  |    2 +-
+ arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi     |    6 +
+ arch/arm64/boot/dts/freescale/fsl-ls1046a-qds.dts  |    2 +-
+ arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts  |    4 +-
+ arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi     |   45 +-
+ arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi     |   97 +-
+ arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi     |    6 +
+ arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts  |   26 +
+ arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi     |  133 +
+ arch/arm64/boot/dts/freescale/imx8mm-pinfunc.h     |  629 ++
+ arch/arm64/boot/dts/freescale/imx8mq-evk.dts       |   47 +
+ arch/arm64/boot/dts/freescale/imx8mq.dtsi          |  304 +-
+ arch/arm64/boot/dts/freescale/imx8qxp-mek.dts      |  137 +
+ arch/arm64/boot/dts/freescale/imx8qxp.dtsi         |  446 ++
+ arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts  |    3 +-
+ arch/arm64/boot/dts/hisilicon/hi3660.dtsi          |   16 +-
+ arch/arm64/boot/dts/hisilicon/hi3670.dtsi          |   16 +-
+ .../boot/dts/hisilicon/hi3798cv200-poplar.dts      |    4 +-
+ arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi     |    4 +-
+ arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts     |    2 +-
+ arch/arm64/boot/dts/hisilicon/hi6220.dtsi          |   18 +-
+ arch/arm64/boot/dts/hisilicon/hip05.dtsi           |   32 +-
+ arch/arm64/boot/dts/hisilicon/hip06.dtsi           |   32 +-
+ arch/arm64/boot/dts/hisilicon/hip07.dtsi           |  128 +-
+ arch/arm64/boot/dts/lg/lg1312.dtsi                 |    8 +-
+ arch/arm64/boot/dts/lg/lg1313.dtsi                 |    8 +-
+ arch/arm64/boot/dts/marvell/Makefile               |    1 +
+ .../boot/dts/marvell/armada-3720-espressobin.dts   |   12 +
+ arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts   |  162 +
+ arch/arm64/boot/dts/marvell/armada-372x.dtsi       |    2 +-
+ arch/arm64/boot/dts/marvell/armada-37xx.dtsi       |   82 +-
+ arch/arm64/boot/dts/marvell/armada-7040-db.dts     |    4 -
+ arch/arm64/boot/dts/marvell/armada-8040-db.dts     |    4 -
+ arch/arm64/boot/dts/marvell/armada-ap806-dual.dtsi |    4 +-
+ arch/arm64/boot/dts/marvell/armada-ap806-quad.dtsi |    8 +-
+ arch/arm64/boot/dts/marvell/armada-ap806.dtsi      |   18 +-
+ .../dts/marvell/armada-ap810-ap0-octa-core.dtsi    |   16 +-
+ arch/arm64/boot/dts/marvell/armada-cp110.dtsi      |   15 +-
+ arch/arm64/boot/dts/mediatek/mt2712-evb.dts        |   98 +
+ arch/arm64/boot/dts/mediatek/mt2712e.dtsi          |  555 ++
+ arch/arm64/boot/dts/mediatek/mt6797-evb.dts        |    2 +
+ arch/arm64/boot/dts/mediatek/mt6797-x20-dev.dts    |    2 +
+ arch/arm64/boot/dts/mediatek/mt6797.dtsi           |   28 +
+ arch/arm64/boot/dts/mediatek/mt7622.dtsi           |   13 +-
+ arch/arm64/boot/dts/mediatek/mt8173.dtsi           |    6 +-
+ arch/arm64/boot/dts/nvidia/Makefile                |    1 +
+ arch/arm64/boot/dts/nvidia/tegra132.dtsi           |    4 +-
+ arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts |   19 +-
+ arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi     |   10 +-
+ arch/arm64/boot/dts/nvidia/tegra186.dtsi           |   33 +-
+ arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi     |    2 +-
+ arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts |   11 +-
+ arch/arm64/boot/dts/nvidia/tegra194.dtsi           |   93 +-
+ arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts |   21 +
+ arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi     |   33 +-
+ .../boot/dts/nvidia/tegra210-p2894-0050-a08.dts    |    9 +
+ arch/arm64/boot/dts/nvidia/tegra210-p2894.dtsi     | 1858 ++++++
+ arch/arm64/boot/dts/nvidia/tegra210-smaug.dts      |   34 +-
+ arch/arm64/boot/dts/nvidia/tegra210.dtsi           |   96 +-
+ arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi          |    2 +
+ arch/arm64/boot/dts/qcom/ipq8074.dtsi              |    8 +-
+ arch/arm64/boot/dts/qcom/msm8916.dtsi              |   16 +-
+ arch/arm64/boot/dts/qcom/msm8992.dtsi              |    2 +-
+ arch/arm64/boot/dts/qcom/msm8994.dtsi              |    2 +-
+ arch/arm64/boot/dts/qcom/msm8996-pins.dtsi         |    2 +-
+ arch/arm64/boot/dts/qcom/msm8996.dtsi              |   36 +-
+ arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi          |   24 +
+ arch/arm64/boot/dts/qcom/msm8998.dtsi              |  278 +
+ arch/arm64/boot/dts/qcom/pm8005.dtsi               |    6 +-
+ arch/arm64/boot/dts/qcom/pm8916.dtsi               |    6 +
+ arch/arm64/boot/dts/qcom/pm8998.dtsi               |   28 +-
+ arch/arm64/boot/dts/qcom/pmi8994.dtsi              |   12 +-
+ arch/arm64/boot/dts/qcom/pmi8998.dtsi              |   16 +-
+ arch/arm64/boot/dts/qcom/pms405.dtsi               |   79 +
+ arch/arm64/boot/dts/qcom/qcs404-evb.dtsi           |   19 +
+ arch/arm64/boot/dts/qcom/qcs404.dtsi               |  359 +
+ arch/arm64/boot/dts/qcom/sdm845-mtp.dts            |   84 +-
+ arch/arm64/boot/dts/qcom/sdm845.dtsi               | 1046 ++-
+ arch/arm64/boot/dts/realtek/rtd1295.dtsi           |    8 +-
+ arch/arm64/boot/dts/renesas/Makefile               |    1 +
+ arch/arm64/boot/dts/renesas/cat875.dtsi            |   44 +
+ arch/arm64/boot/dts/renesas/r8a774a1.dtsi          |   14 +-
+ arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts    |  106 +
+ arch/arm64/boot/dts/renesas/r8a774c0-ek874.dts     |   14 +
+ arch/arm64/boot/dts/renesas/r8a774c0.dtsi          | 1911 ++++++
+ arch/arm64/boot/dts/renesas/r8a7795.dtsi           |   56 +-
+ .../arm64/boot/dts/renesas/r8a7796-salvator-xs.dts |    3 +-
+ arch/arm64/boot/dts/renesas/r8a7796.dtsi           |   52 +-
+ arch/arm64/boot/dts/renesas/r8a77965.dtsi          |    4 +-
+ arch/arm64/boot/dts/renesas/r8a77970-v3msk.dts     |    2 +
+ arch/arm64/boot/dts/renesas/r8a77970.dtsi          |    4 +-
+ arch/arm64/boot/dts/renesas/r8a77980.dtsi          |    8 +-
+ arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts     |   26 +-
+ arch/arm64/boot/dts/renesas/r8a77990.dtsi          |  223 +-
+ arch/arm64/boot/dts/renesas/r8a77995-draak.dts     |    4 +-
+ arch/arm64/boot/dts/renesas/r8a77995.dtsi          |    2 +-
+ arch/arm64/boot/dts/renesas/salvator-common.dtsi   |    1 +
+ arch/arm64/boot/dts/renesas/ulcb-kf.dtsi           |  138 +
+ arch/arm64/boot/dts/renesas/ulcb.dtsi              |   71 +-
+ arch/arm64/boot/dts/rockchip/Makefile              |    3 +
+ arch/arm64/boot/dts/rockchip/px30.dtsi             |    8 +-
+ arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts     |    1 +
+ arch/arm64/boot/dts/rockchip/rk3328-rock64.dts     |   26 +-
+ arch/arm64/boot/dts/rockchip/rk3328.dtsi           |   22 +-
+ arch/arm64/boot/dts/rockchip/rk3368-evb.dtsi       |    1 -
+ arch/arm64/boot/dts/rockchip/rk3368-geekbox.dts    |    1 -
+ arch/arm64/boot/dts/rockchip/rk3368-lion.dtsi      |    1 -
+ .../boot/dts/rockchip/rk3368-orion-r68-meta.dts    |    1 -
+ arch/arm64/boot/dts/rockchip/rk3368-px5-evb.dts    |    1 -
+ arch/arm64/boot/dts/rockchip/rk3368-r88.dts        |    1 -
+ arch/arm64/boot/dts/rockchip/rk3368.dtsi           |   16 +-
+ arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dts  |   91 +
+ arch/arm64/boot/dts/rockchip/rk3399-nanopi-m4.dts  |   66 +
+ arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi   |  703 ++
+ arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts  |  606 ++
+ arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi   |  110 +-
+ arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts  |   83 +-
+ .../dts/rockchip/rk3399-sapphire-excavator.dts     |    1 -
+ arch/arm64/boot/dts/rockchip/rk3399.dtsi           |   12 +-
+ arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi   |    4 +-
+ .../boot/dts/socionext/uniphier-ld20-global.dts    |    4 +-
+ arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi   |   55 +-
+ .../arm64/boot/dts/socionext/uniphier-pxs3-ref.dts |   10 +-
+ arch/arm64/boot/dts/socionext/uniphier-pxs3.dtsi   |   55 +-
+ arch/arm64/boot/dts/sprd/sc2731.dtsi               |   56 +-
+ arch/arm64/boot/dts/sprd/sc9836.dtsi               |    8 +-
+ arch/arm64/boot/dts/sprd/sc9860.dtsi               |   16 +-
+ arch/arm64/boot/dts/sprd/sp9860g-1h10.dts          |   16 +
+ arch/arm64/boot/dts/synaptics/as370.dtsi           |    8 +-
+ arch/arm64/boot/dts/synaptics/berlin4ct.dtsi       |    8 +-
+ arch/arm64/boot/dts/ti/k3-am65-main.dtsi           |  118 +
+ arch/arm64/boot/dts/ti/k3-am65-mcu.dtsi            |   30 +
+ arch/arm64/boot/dts/ti/k3-am654-base-board.dts     |   65 +
+ arch/arm64/boot/dts/ti/k3-am654.dtsi               |    8 +-
+ arch/arm64/boot/dts/xilinx/zynqmp-zcu100-revC.dts  |    1 +
+ arch/arm64/boot/dts/xilinx/zynqmp.dtsi             |    8 +-
+ arch/arm64/boot/dts/zte/zx296718.dtsi              |    8 +-
+ arch/arm64/configs/defconfig                       |   32 +-
+ arch/arm64/include/asm/acpi.h                      |    4 +-
+ arch/arm64/include/asm/alternative.h               |    4 +-
+ arch/arm64/include/asm/arch_gicv3.h                |   32 +
+ arch/arm64/include/asm/asm-uaccess.h               |    2 +-
+ arch/arm64/include/asm/assembler.h                 |   36 +-
+ arch/arm64/include/asm/atomic.h                    |  237 +-
+ arch/arm64/include/asm/atomic_ll_sc.h              |   28 +-
+ arch/arm64/include/asm/atomic_lse.h                |   38 +-
+ arch/arm64/include/asm/cmpxchg.h                   |   60 +-
+ arch/arm64/include/asm/cpucaps.h                   |    3 +-
+ arch/arm64/include/asm/cpufeature.h                |   10 +
+ arch/arm64/include/asm/cputype.h                   |    9 +
+ arch/arm64/include/asm/daifflags.h                 |   61 +-
+ arch/arm64/include/asm/dma-mapping.h               |    9 -
+ arch/arm64/include/asm/efi.h                       |   11 +
+ arch/arm64/include/asm/fixmap.h                    |    6 +-
+ arch/arm64/include/asm/hardirq.h                   |   31 +
+ arch/arm64/include/asm/hugetlb.h                   |    5 +
+ arch/arm64/include/asm/io.h                        |    1 +
+ arch/arm64/include/asm/irqflags.h                  |  100 +-
+ arch/arm64/include/asm/kvm_emulate.h               |   12 +
+ arch/arm64/include/asm/kvm_host.h                  |   64 +-
+ arch/arm64/include/asm/kvm_hyp.h                   |    3 +-
+ arch/arm64/include/asm/kvm_mmu.h                   |   13 +-
+ arch/arm64/include/asm/kvm_ras.h                   |   25 +
+ arch/arm64/include/asm/memblock.h                  |   21 -
+ arch/arm64/include/asm/memory.h                    |    9 +-
+ arch/arm64/include/asm/mmu.h                       |    1 +
+ arch/arm64/include/asm/pgtable-hwdef.h             |    1 +
+ arch/arm64/include/asm/processor.h                 |    3 +
+ arch/arm64/include/asm/ptdump.h                    |    9 +-
+ arch/arm64/include/asm/ptrace.h                    |   26 +-
+ arch/arm64/include/asm/sync_bitops.h               |   16 +-
+ arch/arm64/include/asm/sysreg.h                    |    7 +-
+ arch/arm64/include/asm/system_misc.h               |    2 -
+ arch/arm64/include/asm/thread_info.h               |    1 -
+ arch/arm64/include/asm/uaccess.h                   |   36 +-
+ arch/arm64/include/asm/unistd.h                    |    2 +-
+ arch/arm64/include/asm/unistd32.h                  |   99 +-
+ arch/arm64/include/uapi/asm/Kbuild                 |    1 -
+ arch/arm64/include/uapi/asm/ptrace.h               |   13 +
+ arch/arm64/include/uapi/asm/unistd.h               |    2 +
+ arch/arm64/kernel/acpi.c                           |   31 +
+ arch/arm64/kernel/alternative.c                    |   60 +-
+ arch/arm64/kernel/asm-offsets.c                    |   21 +-
+ arch/arm64/kernel/cpufeature.c                     |   41 +-
+ arch/arm64/kernel/entry.S                          |   60 +-
+ arch/arm64/kernel/irq.c                            |    3 +
+ arch/arm64/kernel/kgdb.c                           |   14 +-
+ arch/arm64/kernel/machine_kexec.c                  |    3 +-
+ arch/arm64/kernel/perf_event.c                     |    2 +-
+ arch/arm64/kernel/probes/kprobes.c                 |    6 +
+ arch/arm64/kernel/process.c                        |   51 +
+ arch/arm64/kernel/ptrace.c                         |  147 +
+ arch/arm64/kernel/setup.c                          |    9 +-
+ arch/arm64/kernel/smp.c                            |   33 +
+ arch/arm64/kernel/traps.c                          |    8 +-
+ arch/arm64/kvm/Makefile                            |    4 +-
+ arch/arm64/kvm/debug.c                             |    2 +-
+ arch/arm64/kvm/hyp.S                               |    3 -
+ arch/arm64/kvm/hyp/hyp-entry.S                     |   12 -
+ arch/arm64/kvm/hyp/switch.c                        |   16 +
+ arch/arm64/kvm/hyp/sysreg-sr.c                     |    1 -
+ arch/arm64/kvm/sys_regs.c                          |  168 +-
+ arch/arm64/mm/dump.c                               |    4 +-
+ arch/arm64/mm/fault.c                              |   33 +-
+ arch/arm64/mm/hugetlbpage.c                        |   20 +
+ arch/arm64/mm/init.c                               |   47 +-
+ arch/arm64/mm/kasan_init.c                         |   10 +
+ arch/arm64/mm/mmu.c                                |    7 +-
+ arch/arm64/mm/numa.c                               |    6 +-
+ arch/arm64/mm/proc.S                               |   12 +-
+ arch/arm64/mm/ptdump_debugfs.c                     |    7 +-
+ arch/c6x/Kconfig                                   |    1 +
+ arch/c6x/include/uapi/asm/Kbuild                   |    2 -
+ arch/c6x/include/uapi/asm/unistd.h                 |    2 +
+ arch/c6x/mm/dma-coherent.c                         |   13 +-
+ arch/c6x/mm/init.c                                 |    4 +-
+ arch/csky/Kconfig                                  |    3 +-
+ arch/csky/include/uapi/asm/Kbuild                  |    2 -
+ arch/csky/include/uapi/asm/unistd.h                |    2 +
+ arch/csky/mm/highmem.c                             |    5 +
+ arch/h8300/Kconfig                                 |    1 +
+ arch/h8300/Makefile                                |    2 +-
+ arch/h8300/configs/edosk2674_defconfig             |    1 -
+ arch/h8300/configs/h8300h-sim_defconfig            |    1 -
+ arch/h8300/configs/h8s-sim_defconfig               |    1 -
+ arch/h8300/include/asm/Kbuild                      |    1 -
+ arch/h8300/include/uapi/asm/Kbuild                 |    2 -
+ arch/h8300/include/uapi/asm/unistd.h               |    2 +
+ arch/h8300/mm/init.c                               |    4 +-
+ arch/hexagon/Kconfig                               |    1 +
+ arch/hexagon/include/uapi/asm/Kbuild               |    2 -
+ arch/hexagon/include/uapi/asm/unistd.h             |    2 +
+ arch/ia64/hp/sim/simscsi.c                         |    7 +-
+ arch/ia64/include/asm/unistd.h                     |   14 -
+ arch/ia64/include/uapi/asm/Kbuild                  |    3 -
+ arch/ia64/include/uapi/asm/unistd.h                |    2 +
+ arch/ia64/kernel/mca.c                             |   25 +-
+ arch/ia64/kernel/numa.c                            |    2 +-
+ arch/ia64/kernel/perfmon.c                         |   59 +-
+ arch/ia64/kernel/syscalls/syscall.tbl              |   11 +-
+ arch/ia64/mm/contig.c                              |    8 +-
+ arch/ia64/mm/discontig.c                           |   10 +-
+ arch/ia64/mm/init.c                                |   38 +-
+ arch/ia64/mm/tlb.c                                 |    6 +
+ arch/ia64/sn/kernel/Makefile                       |    2 +-
+ arch/ia64/sn/kernel/io_common.c                    |    3 +
+ arch/ia64/sn/kernel/setup.c                        |   12 +-
+ arch/ia64/sn/kernel/sn2/Makefile                   |    2 -
+ arch/ia64/sn/pci/Makefile                          |    2 -
+ arch/ia64/sn/pci/pcibr/Makefile                    |    2 +-
+ arch/m68k/Kconfig                                  |    1 +
+ arch/m68k/Kconfig.machine                          |    2 +
+ arch/m68k/atari/Makefile                           |    2 +
+ arch/m68k/atari/nvram.c                            |  272 +
+ arch/m68k/atari/stram.c                            |    4 +
+ arch/m68k/coldfire/device.c                        |   81 +
+ arch/m68k/coldfire/m5441x.c                        |    4 +-
+ arch/m68k/configs/amcore_defconfig                 |    1 -
+ arch/m68k/configs/stmark2_defconfig                |    1 -
+ arch/m68k/include/asm/atarihw.h                    |    6 +
+ arch/m68k/include/asm/m5441xsim.h                  |   15 +
+ arch/m68k/include/asm/macintosh.h                  |    4 +
+ arch/m68k/include/asm/unistd.h                     |    4 +-
+ arch/m68k/include/uapi/asm/Kbuild                  |    2 -
+ arch/m68k/kernel/setup_mm.c                        |   82 +-
+ arch/m68k/kernel/syscalls/syscall.tbl              |   88 +-
+ arch/m68k/mac/misc.c                               |  174 +-
+ arch/m68k/mm/init.c                                |    3 +
+ arch/m68k/mm/mcfmmu.c                              |    7 +-
+ arch/m68k/mm/memory.c                              |    2 +-
+ arch/m68k/mm/motorola.c                            |    9 +
+ arch/m68k/mm/sun3mmu.c                             |    6 +
+ arch/m68k/sun3/sun3dvma.c                          |    3 +
+ arch/microblaze/Kconfig                            |    1 +
+ arch/microblaze/include/asm/unistd.h               |    4 +-
+ arch/microblaze/include/uapi/asm/Kbuild            |    2 -
+ arch/microblaze/kernel/setup.c                     |   13 +-
+ arch/microblaze/kernel/syscalls/syscall.tbl        |   83 +-
+ arch/microblaze/mm/init.c                          |   15 +-
+ arch/mips/Kconfig                                  |    3 +-
+ arch/mips/boot/Makefile                            |    2 +-
+ arch/mips/cavium-octeon/dma-octeon.c               |    3 +
+ arch/mips/configs/generic_defconfig                |    2 +-
+ arch/mips/include/asm/dma-mapping.h                |   10 -
+ arch/mips/include/asm/kvm_host.h                   |    2 +-
+ arch/mips/include/asm/unistd.h                     |   17 +-
+ arch/mips/include/uapi/asm/Kbuild                  |    2 -
+ arch/mips/include/uapi/asm/mman.h                  |    4 +-
+ arch/mips/include/uapi/asm/socket.h                |    2 +-
+ arch/mips/kernel/setup.c                           |    3 +
+ arch/mips/kernel/syscalls/syscall_n32.tbl          |   77 +-
+ arch/mips/kernel/syscalls/syscall_n64.tbl          |    7 +-
+ arch/mips/kernel/syscalls/syscall_o32.tbl          |   85 +-
+ arch/mips/kernel/traps.c                           |    5 +-
+ arch/mips/mm/dma-noncoherent.c                     |    8 +
+ arch/mips/mm/init.c                                |    5 +
+ arch/nds32/Kconfig                                 |    1 +
+ arch/nds32/configs/defconfig                       |    2 +-
+ arch/nds32/include/uapi/asm/Kbuild                 |    2 -
+ arch/nds32/include/uapi/asm/unistd.h               |    2 +
+ arch/nds32/mm/init.c                               |   24 +-
+ arch/nios2/Kconfig                                 |    2 +-
+ arch/nios2/configs/10m50_defconfig                 |    1 -
+ arch/nios2/configs/3c120_defconfig                 |    1 -
+ arch/nios2/include/asm/pgtable.h                   |    1 -
+ arch/nios2/include/asm/tlbflush.h                  |   19 +-
+ arch/nios2/include/uapi/asm/Kbuild                 |    2 -
+ arch/nios2/include/uapi/asm/unistd.h               |    2 +
+ arch/nios2/kernel/nios2_ksyms.c                    |   12 +
+ arch/nios2/mm/cacheflush.c                         |    7 +-
+ arch/nios2/mm/fault.c                              |    3 +-
+ arch/nios2/mm/tlb.c                                |  192 +-
+ arch/nios2/platform/Kconfig.platform               |    9 -
+ arch/openrisc/Kconfig                              |    1 +
+ arch/openrisc/configs/or1ksim_defconfig            |    1 -
+ arch/openrisc/configs/simple_smp_defconfig         |    1 -
+ arch/openrisc/include/asm/Kbuild                   |    2 -
+ arch/openrisc/include/uapi/asm/Kbuild              |    2 -
+ arch/openrisc/include/uapi/asm/unistd.h            |    2 +
+ arch/openrisc/mm/init.c                            |    5 +-
+ arch/openrisc/mm/ioremap.c                         |    9 +-
+ arch/parisc/Kconfig                                |    1 +
+ arch/parisc/include/asm/Kbuild                     |    2 -
+ arch/parisc/include/asm/io.h                       |    9 +
+ arch/parisc/include/asm/unistd.h                   |   13 +-
+ arch/parisc/include/uapi/asm/Kbuild                |    2 -
+ arch/parisc/include/uapi/asm/mman.h                |    4 +-
+ arch/parisc/include/uapi/asm/socket.h              |    2 +-
+ arch/parisc/kernel/syscalls/syscall.tbl            |  109 +-
+ arch/parisc/lib/iomap.c                            |   64 +
+ arch/powerpc/Kconfig                               |   87 +-
+ arch/powerpc/Kconfig.debug                         |    4 -
+ arch/powerpc/Makefile                              |   11 +-
+ arch/powerpc/boot/Makefile                         |    2 +-
+ arch/powerpc/boot/dts/Makefile                     |    1 +
+ arch/powerpc/boot/dts/akebono.dts                  |    2 +-
+ arch/powerpc/boot/dts/bluestone.dts                |    2 +-
+ arch/powerpc/boot/dts/currituck.dts                |    2 +-
+ arch/powerpc/boot/dts/iss4xx-mpic.dts              |    2 +-
+ arch/powerpc/boot/dts/wii.dts                      |   22 +
+ arch/powerpc/configs/mpc512x_defconfig             |    1 -
+ arch/powerpc/configs/ppc6xx_defconfig              |    1 -
+ arch/powerpc/configs/skiroot_defconfig             |   12 +-
+ arch/powerpc/include/asm/Kbuild                    |    1 -
+ arch/powerpc/include/asm/asm-prototypes.h          |   14 +-
+ arch/powerpc/include/asm/book3s/32/mmu-hash.h      |    2 +
+ arch/powerpc/include/asm/book3s/32/pgtable.h       |   11 +
+ arch/powerpc/include/asm/book3s/64/hash.h          |   32 +-
+ arch/powerpc/include/asm/book3s/64/hugetlb.h       |   20 +
+ arch/powerpc/include/asm/book3s/64/mmu-hash.h      |    2 +-
+ arch/powerpc/include/asm/book3s/64/pgalloc.h       |    8 +-
+ arch/powerpc/include/asm/book3s/64/pgtable.h       |   34 +-
+ arch/powerpc/include/asm/book3s/64/radix.h         |    4 +
+ .../powerpc/include/asm/book3s/64/tlbflush-radix.h |   30 +-
+ arch/powerpc/include/asm/checksum.h                |    4 -
+ arch/powerpc/include/asm/device.h                  |   10 +-
+ arch/powerpc/include/asm/dma-direct.h              |   18 +-
+ arch/powerpc/include/asm/dma-mapping.h             |   92 -
+ arch/powerpc/include/asm/eeh.h                     |   10 +-
+ arch/powerpc/include/asm/eeh_event.h               |    1 +
+ arch/powerpc/include/asm/exception-64s.h           |    4 +-
+ arch/powerpc/include/asm/hvsi.h                    |    2 +-
+ arch/powerpc/include/asm/io.h                      |    2 +
+ arch/powerpc/include/asm/iommu.h                   |   17 +
+ arch/powerpc/include/asm/ipic.h                    |    3 -
+ arch/powerpc/include/asm/irq.h                     |   18 +-
+ arch/powerpc/include/asm/kvm_host.h                |    5 +-
+ arch/powerpc/include/asm/kvm_ppc.h                 |   17 +-
+ arch/powerpc/include/asm/livepatch.h               |    7 +-
+ arch/powerpc/include/asm/machdep.h                 |    4 +-
+ arch/powerpc/include/asm/mce.h                     |    2 +-
+ arch/powerpc/include/asm/mmu.h                     |   13 +
+ arch/powerpc/include/asm/nmi.h                     |    2 +
+ arch/powerpc/include/asm/nohash/32/mmu-8xx.h       |    3 +-
+ arch/powerpc/include/asm/nvram.h                   |    9 -
+ arch/powerpc/include/asm/page.h                    |   14 +-
+ arch/powerpc/include/asm/pci-bridge.h              |   10 +-
+ arch/powerpc/include/asm/pci.h                     |    2 -
+ arch/powerpc/include/asm/pgtable.h                 |    1 -
+ arch/powerpc/include/asm/powernv.h                 |    3 +-
+ arch/powerpc/include/asm/ppc-opcode.h              |   16 +-
+ arch/powerpc/include/asm/ppc-pci.h                 |    4 +-
+ arch/powerpc/include/asm/processor.h               |  108 +-
+ arch/powerpc/include/asm/ptrace.h                  |    2 +-
+ arch/powerpc/include/asm/reg.h                     |    9 +-
+ arch/powerpc/include/asm/sections.h                |    7 +
+ arch/powerpc/include/asm/smp.h                     |   17 +-
+ arch/powerpc/include/asm/swiotlb.h                 |    5 -
+ arch/powerpc/include/asm/task_size_32.h            |   21 +
+ arch/powerpc/include/asm/task_size_64.h            |   79 +
+ arch/powerpc/include/asm/thread_info.h             |   19 -
+ arch/powerpc/include/asm/topology.h                |    2 +
+ arch/powerpc/include/asm/unistd.h                  |    8 +-
+ arch/powerpc/include/uapi/asm/Kbuild               |    2 -
+ arch/powerpc/include/uapi/asm/kvm.h                |    2 +
+ arch/powerpc/kernel/Makefile                       |   15 +-
+ arch/powerpc/kernel/asm-offsets.c                  |   15 +-
+ arch/powerpc/kernel/cpu_setup_6xx.S                |    4 +
+ arch/powerpc/kernel/dma-iommu.c                    |   75 +-
+ arch/powerpc/kernel/dma-mask.c                     |   12 +
+ arch/powerpc/kernel/dma-swiotlb.c                  |   89 -
+ arch/powerpc/kernel/dma.c                          |  362 --
+ arch/powerpc/kernel/dt_cpu_ftrs.c                  |   25 +-
+ arch/powerpc/kernel/eeh.c                          |  190 +-
+ arch/powerpc/kernel/eeh_cache.c                    |   36 +-
+ arch/powerpc/kernel/eeh_driver.c                   |   86 +-
+ arch/powerpc/kernel/eeh_event.c                    |   16 +-
+ arch/powerpc/kernel/eeh_pe.c                       |   68 +-
+ arch/powerpc/kernel/eeh_sysfs.c                    |    3 +-
+ arch/powerpc/kernel/entry_32.S                     |   97 +-
+ arch/powerpc/kernel/entry_64.S                     |   53 +-
+ arch/powerpc/kernel/epapr_hcalls.S                 |    5 +-
+ arch/powerpc/kernel/exceptions-64e.S               |   14 +-
+ arch/powerpc/kernel/exceptions-64s.S               |   94 +-
+ arch/powerpc/kernel/head_32.S                      |  160 +-
+ arch/powerpc/kernel/head_40x.S                     |    9 +-
+ arch/powerpc/kernel/head_44x.S                     |    8 +-
+ arch/powerpc/kernel/head_64.S                      |   20 +-
+ arch/powerpc/kernel/head_8xx.S                     |  124 +-
+ arch/powerpc/kernel/head_booke.h                   |   12 +-
+ arch/powerpc/kernel/head_fsl_booke.S               |   23 +-
+ arch/powerpc/kernel/idle_6xx.S                     |    8 +-
+ arch/powerpc/kernel/idle_book3e.S                  |    2 +-
+ arch/powerpc/kernel/idle_e500.S                    |    8 +-
+ arch/powerpc/kernel/idle_power4.S                  |    2 +-
+ arch/powerpc/kernel/irq.c                          |  119 +-
+ arch/powerpc/kernel/kgdb.c                         |   28 -
+ arch/powerpc/kernel/machine_kexec_64.c             |    6 +-
+ arch/powerpc/kernel/mce.c                          |   11 +-
+ arch/powerpc/kernel/misc_32.S                      |   17 +-
+ arch/powerpc/kernel/nvram_64.c                     |  158 +-
+ arch/powerpc/kernel/paca.c                         |   25 +-
+ arch/powerpc/kernel/pci-common.c                   |   24 +-
+ arch/powerpc/kernel/pci_32.c                       |    3 +
+ arch/powerpc/kernel/process.c                      |   68 +-
+ arch/powerpc/kernel/prom.c                         |    5 +-
+ arch/powerpc/kernel/ptrace.c                       |   18 +-
+ arch/powerpc/kernel/rtas.c                         |    6 +-
+ arch/powerpc/kernel/setup-common.c                 |   12 +-
+ arch/powerpc/kernel/setup_32.c                     |   62 +-
+ arch/powerpc/kernel/setup_64.c                     |   60 +-
+ arch/powerpc/kernel/smp.c                          |  109 +-
+ arch/powerpc/kernel/stacktrace.c                   |  102 +-
+ arch/powerpc/kernel/syscalls.c                     |    2 +-
+ arch/powerpc/kernel/syscalls/syscall.tbl           |  134 +-
+ arch/powerpc/kernel/syscalls/syscalltbl.sh         |    4 +-
+ arch/powerpc/kernel/systbl.S                       |    6 +-
+ arch/powerpc/kernel/time.c                         |    1 -
+ arch/powerpc/kernel/trace/Makefile                 |    3 +-
+ arch/powerpc/kernel/trace/ftrace_64_mprofile.S     |    6 +-
+ arch/powerpc/kernel/traps.c                        |  134 +-
+ arch/powerpc/kernel/udbg.c                         |    2 +-
+ arch/powerpc/kernel/vdso.c                         |    2 -
+ arch/powerpc/kernel/vdso32/Makefile                |    1 +
+ arch/powerpc/kernel/vdso64/Makefile                |    1 +
+ arch/powerpc/kernel/vmlinux.lds.S                  |   14 +-
+ arch/powerpc/kvm/Makefile                          |    5 -
+ arch/powerpc/kvm/book3s.c                          |   20 +-
+ arch/powerpc/kvm/book3s_32_mmu.c                   |    1 +
+ arch/powerpc/kvm/book3s_64_mmu.c                   |   14 +
+ arch/powerpc/kvm/book3s_64_mmu_hv.c                |   18 +
+ arch/powerpc/kvm/book3s_64_mmu_radix.c             |   15 +-
+ arch/powerpc/kvm/book3s_64_vio.c                   |    8 +-
+ arch/powerpc/kvm/book3s_emulate.c                  |   18 +
+ arch/powerpc/kvm/book3s_hv.c                       |   58 +-
+ arch/powerpc/kvm/book3s_hv_builtin.c               |   14 +-
+ arch/powerpc/kvm/book3s_hv_hmi.c                   |    1 +
+ arch/powerpc/kvm/book3s_hv_ras.c                   |   58 +-
+ arch/powerpc/kvm/book3s_hv_rm_xics.c               |    7 +
+ arch/powerpc/kvm/book3s_hv_rmhandlers.S            |   76 +-
+ arch/powerpc/kvm/book3s_rtas.c                     |    8 +-
+ arch/powerpc/kvm/powerpc.c                         |   22 +-
+ arch/powerpc/lib/Makefile                          |    3 +-
+ arch/powerpc/lib/alloc.c                           |    3 +
+ arch/powerpc/lib/sstep.c                           |  114 +-
+ arch/powerpc/lib/test_emulate_step.c               |  535 +-
+ arch/powerpc/lib/test_emulate_step_exec_instr.S    |  150 +
+ arch/powerpc/math-emu/Makefile                     |    2 +-
+ arch/powerpc/mm/40x_mmu.c                          |    2 +-
+ arch/powerpc/mm/44x_mmu.c                          |    2 +-
+ arch/powerpc/mm/8xx_mmu.c                          |   91 +-
+ arch/powerpc/mm/Makefile                           |   18 +-
+ arch/powerpc/mm/dma-noncoherent.c                  |   40 +-
+ arch/powerpc/mm/fsl_booke_mmu.c                    |    2 +-
+ arch/powerpc/mm/hash_low_32.S                      |   76 +-
+ arch/powerpc/mm/hash_utils_64.c                    |   23 +-
+ arch/powerpc/mm/hugetlbpage-hash64.c               |   28 +-
+ arch/powerpc/mm/hugetlbpage-radix.c                |   22 +-
+ arch/powerpc/mm/init_32.c                          |    6 +-
+ arch/powerpc/mm/init_64.c                          |    2 -
+ arch/powerpc/mm/mem.c                              |   61 +-
+ arch/powerpc/mm/mmu_context_iommu.c                |  145 +-
+ arch/powerpc/mm/mmu_context_nohash.c               |    9 +
+ arch/powerpc/mm/mmu_decl.h                         |   10 +-
+ arch/powerpc/mm/numa.c                             |   29 +-
+ arch/powerpc/mm/pgtable-book3e.c                   |   12 +-
+ arch/powerpc/mm/pgtable-book3s64.c                 |   33 +-
+ arch/powerpc/mm/pgtable-radix.c                    |   46 +-
+ arch/powerpc/mm/pgtable_32.c                       |   42 +-
+ arch/powerpc/mm/ppc_mmu_32.c                       |  192 +-
+ .../{dump_linuxpagetables-8xx.c => ptdump/8xx.c}   |    2 +-
+ arch/powerpc/mm/ptdump/Makefile                    |    9 +
+ arch/powerpc/mm/{dump_bats.c => ptdump/bats.c}     |    0
+ .../book3s64.c}                                    |    2 +-
+ .../hashpagetable.c}                               |    2 +-
+ .../mm/{dump_linuxpagetables.c => ptdump/ptdump.c} |   20 +-
+ .../mm/{dump_linuxpagetables.h => ptdump/ptdump.h} |    0
+ .../mm/{dump_sr.c => ptdump/segment_regs.c}        |    0
+ .../shared.c}                                      |    2 +-
+ arch/powerpc/mm/slb.c                              |    5 +
+ arch/powerpc/mm/slice.c                            |   10 +-
+ arch/powerpc/mm/tlb_nohash.c                       |    2 +-
+ arch/powerpc/net/bpf_jit32.h                       |    5 +-
+ arch/powerpc/perf/hv-24x7.c                        |   10 +-
+ arch/powerpc/perf/hv-gpci.c                        |   10 +-
+ arch/powerpc/perf/imc-pmu.c                        |   19 +-
+ arch/powerpc/perf/power9-events-list.h             |   24 +
+ arch/powerpc/perf/power9-pmu.c                     |    4 +
+ arch/powerpc/platforms/44x/Kconfig                 |    1 +
+ arch/powerpc/platforms/44x/ppc476.c                |    1 +
+ arch/powerpc/platforms/44x/warp.c                  |    2 +-
+ arch/powerpc/platforms/83xx/suspend-asm.S          |   34 +-
+ arch/powerpc/platforms/85xx/corenet_generic.c      |    5 +-
+ arch/powerpc/platforms/85xx/ge_imp3a.c             |    2 -
+ arch/powerpc/platforms/85xx/mpc8536_ds.c           |    2 -
+ arch/powerpc/platforms/85xx/mpc85xx_ds.c           |    4 -
+ arch/powerpc/platforms/85xx/mpc85xx_mds.c          |    4 -
+ arch/powerpc/platforms/85xx/p1010rdb.c             |    1 -
+ arch/powerpc/platforms/85xx/p1022_ds.c             |    2 -
+ arch/powerpc/platforms/85xx/p1022_rdk.c            |    2 -
+ arch/powerpc/platforms/85xx/qemu_e500.c            |    1 +
+ arch/powerpc/platforms/86xx/mpc86xx_hpcn.c         |    1 -
+ arch/powerpc/platforms/Kconfig.cputype             |    9 +
+ arch/powerpc/platforms/cell/iommu.c                |  172 +-
+ arch/powerpc/platforms/cell/spu_callbacks.c        |    2 +-
+ arch/powerpc/platforms/cell/spu_syscalls.c         |    1 -
+ arch/powerpc/platforms/cell/spufs/file.c           |    5 +-
+ arch/powerpc/platforms/chrp/Makefile               |    2 +-
+ arch/powerpc/platforms/chrp/nvram.c                |   14 +-
+ arch/powerpc/platforms/chrp/setup.c                |    2 +-
+ arch/powerpc/platforms/embedded6xx/wii.c           |   24 -
+ arch/powerpc/platforms/pasemi/iommu.c              |   10 +-
+ arch/powerpc/platforms/pasemi/setup.c              |   51 -
+ arch/powerpc/platforms/powermac/Makefile           |    2 -
+ arch/powerpc/platforms/powermac/nvram.c            |   12 +
+ arch/powerpc/platforms/powermac/setup.c            |    3 +-
+ arch/powerpc/platforms/powermac/time.c             |    2 +-
+ arch/powerpc/platforms/powernv/Makefile            |    5 +-
+ arch/powerpc/platforms/powernv/idle.c              |   27 +-
+ arch/powerpc/platforms/powernv/memtrace.c          |    5 +-
+ arch/powerpc/platforms/powernv/npu-dma.c           |   16 +-
+ arch/powerpc/platforms/powernv/opal-call.c         |  284 +
+ arch/powerpc/platforms/powernv/opal-msglog.c       |    2 +-
+ arch/powerpc/platforms/powernv/opal-wrappers.S     |  344 +-
+ arch/powerpc/platforms/powernv/opal.c              |    9 +-
+ arch/powerpc/platforms/powernv/pci-ioda-tce.c      |    1 -
+ arch/powerpc/platforms/powernv/pci-ioda.c          |  154 +-
+ arch/powerpc/platforms/powernv/smp.c               |   25 +
+ arch/powerpc/platforms/ps3/device-init.c           |    4 +-
+ arch/powerpc/platforms/ps3/os-area.c               |    4 +-
+ arch/powerpc/platforms/ps3/setup.c                 |    3 +
+ arch/powerpc/platforms/ps3/system-bus.c            |    4 +-
+ arch/powerpc/platforms/pseries/hotplug-cpu.c       |   19 +
+ arch/powerpc/platforms/pseries/ibmebus.c           |   10 +-
+ arch/powerpc/platforms/pseries/iommu.c             |   99 +-
+ arch/powerpc/platforms/pseries/lparcfg.c           |    1 +
+ arch/powerpc/platforms/pseries/nvram.c             |    2 -
+ arch/powerpc/platforms/pseries/papr_scm.c          |    1 +
+ arch/powerpc/platforms/pseries/setup.c             |   18 +-
+ arch/powerpc/platforms/pseries/vio.c               |   95 +-
+ arch/powerpc/sysdev/6xx-suspend.S                  |    5 +-
+ arch/powerpc/sysdev/dart_iommu.c                   |   68 +-
+ arch/powerpc/sysdev/fsl_pci.c                      |   25 +-
+ arch/powerpc/sysdev/ipic.c                         |   35 -
+ arch/powerpc/sysdev/msi_bitmap.c                   |    3 +
+ arch/powerpc/sysdev/tsi108_dev.c                   |    2 +-
+ arch/powerpc/sysdev/xive/common.c                  |    2 +-
+ arch/powerpc/xmon/Makefile                         |    1 +
+ arch/powerpc/xmon/ppc-dis.c                        |    2 +-
+ arch/powerpc/xmon/xmon.c                           |    2 +-
+ arch/riscv/Kconfig                                 |    7 +-
+ arch/riscv/include/asm/fixmap.h                    |   44 +
+ arch/riscv/include/asm/io.h                        |   36 +-
+ arch/riscv/include/asm/pgtable.h                   |    1 +
+ arch/riscv/include/asm/smp.h                       |   18 +-
+ arch/riscv/include/uapi/asm/Kbuild                 |    1 -
+ arch/riscv/include/uapi/asm/unistd.h               |    1 +
+ arch/riscv/kernel/cpu.c                            |   30 +-
+ arch/riscv/kernel/cpufeature.c                     |   48 +-
+ arch/riscv/kernel/ftrace.c                         |    2 +-
+ arch/riscv/kernel/setup.c                          |  141 +-
+ arch/riscv/kernel/smp.c                            |   10 +-
+ arch/riscv/kernel/smpboot.c                        |   24 +-
+ arch/riscv/kernel/vdso.c                           |    1 -
+ arch/riscv/kernel/vdso/Makefile                    |    2 +
+ arch/riscv/mm/init.c                               |  156 +-
+ arch/s390/boot/Makefile                            |    7 +-
+ arch/s390/boot/compressed/Makefile                 |    4 +-
+ arch/s390/configs/debug_defconfig                  |    2 +-
+ arch/s390/configs/performance_defconfig            |    2 +-
+ arch/s390/include/asm/Kbuild                       |    1 -
+ arch/s390/include/asm/cio.h                        |    1 +
+ arch/s390/include/asm/irq.h                        |    1 +
+ arch/s390/include/asm/isc.h                        |    1 +
+ arch/s390/include/asm/kvm_host.h                   |   39 +-
+ arch/s390/include/asm/pgtable.h                    |    5 +-
+ arch/s390/include/asm/unistd.h                     |    7 +-
+ arch/s390/include/uapi/asm/Kbuild                  |    2 -
+ arch/s390/kernel/crash_dump.c                      |    3 +
+ arch/s390/kernel/irq.c                             |    1 +
+ arch/s390/kernel/perf_cpum_sf.c                    |    6 +-
+ arch/s390/kernel/setup.c                           |   16 +
+ arch/s390/kernel/smp.c                             |    9 +-
+ arch/s390/kernel/syscalls/syscall.tbl              |   87 +-
+ arch/s390/kernel/topology.c                        |    6 +
+ arch/s390/kernel/vdso.c                            |    2 -
+ arch/s390/kvm/interrupt.c                          |  431 +-
+ arch/s390/kvm/kvm-s390.c                           |  190 +-
+ arch/s390/kvm/kvm-s390.h                           |    4 +-
+ arch/s390/mm/pgtable.c                             |    8 +-
+ arch/s390/numa/mode_emu.c                          |    3 +
+ arch/s390/numa/numa.c                              |   20 +-
+ arch/s390/scripts/Makefile.chkbss                  |   25 +-
+ arch/sh/Kconfig                                    |    3 +-
+ arch/sh/boards/mach-ap325rxa/setup.c               |   10 +-
+ arch/sh/boards/mach-ecovec24/setup.c               |   16 +-
+ arch/sh/boards/mach-kfr2r09/setup.c                |   10 +-
+ arch/sh/boards/mach-migor/setup.c                  |   11 +-
+ arch/sh/boards/mach-se/7724/setup.c                |   16 +-
+ arch/sh/configs/apsh4a3a_defconfig                 |    1 -
+ arch/sh/configs/edosk7705_defconfig                |    1 -
+ arch/sh/configs/espt_defconfig                     |    1 -
+ arch/sh/configs/sdk7786_defconfig                  |    1 -
+ arch/sh/configs/sh2007_defconfig                   |    1 -
+ arch/sh/configs/sh7724_generic_defconfig           |    1 -
+ arch/sh/configs/sh7763rdp_defconfig                |    1 -
+ arch/sh/configs/sh7770_generic_defconfig           |    1 -
+ arch/sh/configs/sh7785lcr_defconfig                |    1 -
+ arch/sh/configs/ul2_defconfig                      |    1 -
+ arch/sh/configs/urquell_defconfig                  |    1 -
+ arch/sh/drivers/pci/fixups-dreamcast.c             |    3 +-
+ arch/sh/include/asm/unistd.h                       |    4 +-
+ arch/sh/include/uapi/asm/Kbuild                    |    1 -
+ arch/sh/include/uapi/asm/unistd_32.h               |  403 --
+ arch/sh/kernel/machine_kexec.c                     |    3 +-
+ arch/sh/kernel/syscalls/syscall.tbl                |   88 +-
+ arch/sh/kernel/syscalls/syscalltbl.sh              |    4 +-
+ arch/sh/kernel/syscalls_32.S                       |    2 +-
+ arch/sh/mm/init.c                                  |   24 +-
+ arch/sh/mm/numa.c                                  |    9 +-
+ arch/sparc/Kconfig                                 |    1 +
+ arch/sparc/configs/sparc32_defconfig               |    1 -
+ arch/sparc/configs/sparc64_defconfig               |    1 -
+ arch/sparc/include/asm/unistd.h                    |   13 +-
+ arch/sparc/include/uapi/asm/Kbuild                 |    2 -
+ arch/sparc/include/uapi/asm/socket.h               |    2 +-
+ arch/sparc/kernel/iommu.c                          |   13 +-
+ arch/sparc/kernel/kernel.h                         |    6 +-
+ arch/sparc/kernel/pci.c                            |   46 +-
+ arch/sparc/kernel/pci_fire.c                       |    3 +-
+ arch/sparc/kernel/pci_schizo.c                     |    3 +-
+ arch/sparc/kernel/pci_sun4v.c                      |   18 +-
+ arch/sparc/kernel/prom_32.c                        |    6 +-
+ arch/sparc/kernel/prom_64.c                        |    7 +-
+ arch/sparc/kernel/psycho_common.c                  |    3 +-
+ arch/sparc/kernel/sbus.c                           |    3 +-
+ arch/sparc/kernel/setup_64.c                       |    6 +
+ arch/sparc/kernel/smp_64.c                         |   12 +
+ arch/sparc/kernel/sys_sparc_64.c                   |   61 +-
+ arch/sparc/kernel/syscalls/syscall.tbl             |  116 +-
+ arch/sparc/mm/init_32.c                            |    2 +-
+ arch/sparc/mm/init_64.c                            |   26 +-
+ arch/sparc/mm/srmmu.c                              |   18 +-
+ arch/um/drivers/net_kern.c                         |    3 +
+ arch/um/drivers/ubd_kern.c                         |    6 +-
+ arch/um/drivers/vector_kern.c                      |    3 +
+ arch/um/drivers/vector_user.c                      |    3 -
+ arch/um/kernel/initrd.c                            |    2 +
+ arch/um/kernel/mem.c                               |   16 +
+ arch/unicore32/Kconfig                             |    2 +-
+ arch/unicore32/boot/compressed/Makefile            |    5 +-
+ .../compressed/{vmlinux.lds.in => vmlinux.lds.S}   |    0
+ arch/unicore32/include/uapi/asm/Kbuild             |    2 -
+ arch/unicore32/include/uapi/asm/unistd.h           |    4 +-
+ arch/unicore32/kernel/setup.c                      |    4 +
+ arch/unicore32/mm/init.c                           |   24 -
+ arch/unicore32/mm/mmu.c                            |   25 +-
+ arch/x86/Kconfig                                   |    7 +-
+ arch/x86/Kconfig.debug                             |   10 -
+ arch/x86/Makefile                                  |    6 +-
+ arch/x86/boot/Makefile                             |    2 +-
+ arch/x86/boot/compressed/Makefile                  |    2 +
+ arch/x86/boot/compressed/acpi.c                    |  338 +
+ arch/x86/boot/compressed/cmdline.c                 |    4 -
+ arch/x86/boot/compressed/head_64.S                 |   11 +-
+ arch/x86/boot/compressed/kaslr.c                   |   75 +-
+ arch/x86/boot/compressed/misc.c                    |    3 +
+ arch/x86/boot/compressed/misc.h                    |   23 +-
+ arch/x86/boot/compressed/pgtable_64.c              |   19 +-
+ arch/x86/boot/compressed/vmlinux.lds.S             |    2 +-
+ arch/x86/boot/setup.ld                             |    2 +-
+ arch/x86/boot/string.c                             |  141 +
+ arch/x86/boot/string.h                             |    1 +
+ arch/x86/configs/i386_defconfig                    |    3 +-
+ arch/x86/configs/x86_64_defconfig                  |    4 +-
+ arch/x86/entry/syscalls/syscall_32.tbl             |   89 +-
+ arch/x86/entry/syscalls/syscall_64.tbl             |   10 +-
+ arch/x86/events/amd/ibs.c                          |   13 +-
+ arch/x86/events/amd/iommu.c                        |    6 +-
+ arch/x86/events/amd/power.c                        |   10 +-
+ arch/x86/events/amd/uncore.c                       |    7 +-
+ arch/x86/events/core.c                             |   13 +-
+ arch/x86/events/intel/bts.c                        |    4 +-
+ arch/x86/events/intel/core.c                       |  291 +-
+ arch/x86/events/intel/cstate.c                     |   12 +-
+ arch/x86/events/intel/ds.c                         |    2 +
+ arch/x86/events/intel/lbr.c                        |    1 +
+ arch/x86/events/intel/pt.c                         |   14 +-
+ arch/x86/events/intel/rapl.c                       |    9 +-
+ arch/x86/events/intel/uncore.c                     |   10 +-
+ arch/x86/events/intel/uncore.h                     |   12 +-
+ arch/x86/events/intel/uncore_snb.c                 |   13 +-
+ arch/x86/events/msr.c                              |   10 +-
+ arch/x86/events/perf_event.h                       |   32 +-
+ arch/x86/hyperv/hv_init.c                          |    8 +
+ arch/x86/include/asm/alternative.h                 |   39 +-
+ arch/x86/include/asm/asm-prototypes.h              |    1 -
+ arch/x86/include/asm/bitops.h                      |    6 -
+ arch/x86/include/asm/cpu_device_id.h               |   28 +
+ arch/x86/include/asm/cpufeatures.h                 |    1 +
+ arch/x86/include/asm/efi.h                         |    1 -
+ arch/x86/include/asm/fpu/internal.h                |   57 +-
+ arch/x86/include/asm/fpu/types.h                   |    7 +
+ arch/x86/include/asm/kvm_host.h                    |   42 +-
+ arch/x86/include/asm/kvm_vcpu_regs.h               |   25 +
+ arch/x86/include/asm/mce.h                         |    7 +
+ arch/x86/include/asm/msr-index.h                   |    6 +
+ arch/x86/include/asm/msr.h                         |   16 +-
+ arch/x86/include/asm/page_64_types.h               |    4 -
+ arch/x86/include/asm/paravirt.h                    |   13 +-
+ arch/x86/include/asm/paravirt_types.h              |    5 +-
+ arch/x86/include/asm/pci.h                         |    3 +-
+ arch/x86/include/asm/pgtable_64.h                  |    3 +-
+ arch/x86/include/asm/processor.h                   |    1 -
+ arch/x86/include/asm/refcount.h                    |   22 +-
+ arch/x86/include/asm/string_32.h                   |  104 -
+ arch/x86/include/asm/string_64.h                   |   15 -
+ arch/x86/include/asm/uaccess.h                     |   27 +-
+ arch/x86/include/asm/unistd.h                      |    8 +-
+ arch/x86/include/asm/unwind.h                      |    6 +
+ arch/x86/include/asm/uv/bios.h                     |    5 -
+ arch/x86/include/asm/xen/hypercall.h               |   13 +-
+ arch/x86/include/uapi/asm/Kbuild                   |    3 -
+ arch/x86/kernel/acpi/boot.c                        |    3 +
+ arch/x86/kernel/acpi/wakeup_32.S                   |    2 +-
+ arch/x86/kernel/acpi/wakeup_64.S                   |   12 +-
+ arch/x86/kernel/alternative.c                      |    7 +-
+ arch/x86/kernel/apic/io_apic.c                     |    7 +
+ arch/x86/kernel/apic/x2apic_uv_x.c                 |    7 +-
+ arch/x86/kernel/cpu/amd.c                          |    8 +-
+ arch/x86/kernel/cpu/bugs.c                         |   12 +
+ arch/x86/kernel/cpu/cacheinfo.c                    |    1 +
+ arch/x86/kernel/cpu/match.c                        |   31 +
+ arch/x86/kernel/cpu/mce/amd.c                      |   62 +-
+ arch/x86/kernel/cpu/mce/apei.c                     |   10 +-
+ arch/x86/kernel/cpu/mce/core.c                     |   30 -
+ arch/x86/kernel/cpu/mce/severity.c                 |    5 +
+ arch/x86/kernel/cpu/mshyperv.c                     |   12 +
+ arch/x86/kernel/cpu/mtrr/cleanup.c                 |    3 +-
+ arch/x86/kernel/cpu/resctrl/internal.h             |   16 +
+ arch/x86/kernel/cpu/resctrl/pseudo_lock.c          |    7 -
+ arch/x86/kernel/cpu/resctrl/rdtgroup.c             |  185 +-
+ arch/x86/kernel/e820.c                             |   19 +-
+ arch/x86/kernel/early_printk.c                     |    4 -
+ arch/x86/kernel/fpu/xstate.c                       |    2 +-
+ arch/x86/kernel/ftrace.c                           |   45 +-
+ arch/x86/kernel/hw_breakpoint.c                    |    5 +-
+ arch/x86/kernel/kexec-bzimage64.c                  |   18 +-
+ arch/x86/kernel/kgdb.c                             |    1 +
+ arch/x86/kernel/kprobes/core.c                     |    7 +
+ arch/x86/kernel/kprobes/opt.c                      |    4 +-
+ arch/x86/kernel/kvmclock.c                         |   20 +-
+ arch/x86/kernel/machine_kexec_64.c                 |    3 +
+ arch/x86/kernel/process.c                          |   12 +
+ arch/x86/kernel/setup_percpu.c                     |   12 +-
+ arch/x86/kernel/smpboot.c                          |   10 +-
+ arch/x86/kernel/traps.c                            |    6 +-
+ arch/x86/kernel/unwind_frame.c                     |   25 +-
+ arch/x86/kernel/unwind_orc.c                       |   17 +
+ arch/x86/kernel/uprobes.c                          |    1 +
+ arch/x86/kernel/vmlinux.lds.S                      |    4 +-
+ arch/x86/kvm/cpuid.c                               |    2 +-
+ arch/x86/kvm/hyperv.c                              |    2 +-
+ arch/x86/kvm/i8254.c                               |    2 +-
+ arch/x86/kvm/i8259.c                               |    2 +-
+ arch/x86/kvm/ioapic.c                              |    2 +-
+ arch/x86/kvm/lapic.c                               |    7 +-
+ arch/x86/kvm/mmu.c                                 |  466 +-
+ arch/x86/kvm/mmu.h                                 |    1 -
+ arch/x86/kvm/mmutrace.h                            |   42 +-
+ arch/x86/kvm/page_track.c                          |    2 +-
+ arch/x86/kvm/svm.c                                 |  120 +-
+ arch/x86/kvm/vmx/nested.c                          |  129 +-
+ arch/x86/kvm/vmx/vmcs.h                            |    1 +
+ arch/x86/kvm/vmx/vmenter.S                         |  167 +
+ arch/x86/kvm/vmx/vmx.c                             |  188 +-
+ arch/x86/kvm/vmx/vmx.h                             |   20 +-
+ arch/x86/kvm/x86.c                                 |   32 +-
+ arch/x86/kvm/x86.h                                 |    7 +-
+ arch/x86/lib/insn-eval.c                           |    2 +
+ arch/x86/lib/usercopy_32.c                         |    8 +-
+ arch/x86/mm/cpu_entry_area.c                       |    2 +-
+ arch/x86/mm/dump_pagetables.c                      |    2 -
+ arch/x86/mm/fault.c                                |    2 +-
+ arch/x86/mm/ioremap.c                              |    4 +-
+ arch/x86/mm/kasan_init_64.c                        |   14 +-
+ arch/x86/mm/mpx.c                                  |    2 +-
+ arch/x86/mm/numa.c                                 |   16 +-
+ arch/x86/mm/pageattr.c                             |    4 +-
+ arch/x86/mm/tlb.c                                  |    3 -
+ arch/x86/pci/fixup.c                               |   16 +
+ arch/x86/platform/efi/Makefile                     |    1 -
+ arch/x86/platform/efi/early_printk.c               |  240 -
+ arch/x86/platform/efi/quirks.c                     |    6 +-
+ arch/x86/platform/olpc/olpc_dt.c                   |    3 +
+ arch/x86/platform/uv/bios_uv.c                     |   16 +-
+ arch/x86/platform/uv/tlb_uv.c                      |    8 +-
+ arch/x86/realmode/rm/Makefile                      |    5 +-
+ arch/x86/realmode/rm/realmode.lds.S                |    2 +-
+ arch/x86/um/Kconfig                                |    1 +
+ arch/x86/xen/mmu.h                                 |    4 +-
+ arch/x86/xen/mmu_pv.c                              |   21 +-
+ arch/x86/xen/p2m.c                                 |   11 +-
+ arch/x86/xen/setup.c                               |   13 +
+ arch/xtensa/Kconfig                                |    4 +-
+ arch/xtensa/include/asm/Kbuild                     |    3 +-
+ arch/xtensa/include/asm/cmpxchg.h                  |   36 +-
+ arch/xtensa/include/asm/spinlock.h                 |  185 +-
+ arch/xtensa/include/asm/spinlock_types.h           |   15 +-
+ arch/xtensa/include/asm/thread_info.h              |    9 -
+ arch/xtensa/include/asm/unistd.h                   |   14 +-
+ arch/xtensa/include/uapi/asm/Kbuild                |    3 -
+ arch/xtensa/include/uapi/asm/mman.h                |    4 +-
+ arch/xtensa/kernel/process.c                       |    6 +-
+ arch/xtensa/kernel/smp.c                           |   38 +-
+ arch/xtensa/kernel/syscalls/syscall.tbl            |   78 +-
+ arch/xtensa/kernel/time.c                          |   53 +-
+ arch/xtensa/kernel/traps.c                         |    5 +-
+ arch/xtensa/mm/kasan_init.c                        |   10 +-
+ arch/xtensa/mm/mmu.c                               |    3 +
+ block/bfq-iosched.c                                |  705 +-
+ block/bfq-iosched.h                                |   11 +-
+ block/bfq-wf2q.c                                   |   18 +-
+ block/bio.c                                        |  111 +-
+ block/blk-cgroup.c                                 |    2 +-
+ block/blk-core.c                                   |    3 +-
+ block/blk-merge.c                                  |  236 +-
+ block/blk-mq-debugfs.c                             |    4 -
+ block/blk-mq-sched.c                               |    2 +-
+ block/blk-mq-tag.c                                 |    2 +-
+ block/blk-mq.c                                     |   37 +-
+ block/blk-mq.h                                     |   20 +-
+ block/blk-settings.c                               |    9 -
+ block/blk-sysfs.c                                  |   22 +-
+ block/blk.h                                        |    2 +-
+ block/bounce.c                                     |   10 +-
+ block/bsg-lib.c                                    |   44 +-
+ block/bsg.c                                        |  190 +-
+ block/elevator.c                                   |    5 +-
+ block/genhd.c                                      |   18 +-
+ certs/system_keyring.c                             |   23 +-
+ crypto/Makefile                                    |    2 +-
+ crypto/lzo-rle.c                                   |  175 +
+ crypto/tcrypt.c                                    |    4 +-
+ drivers/Kconfig                                    |    2 +
+ drivers/Makefile                                   |    3 +-
+ drivers/acpi/Kconfig                               |   10 +
+ drivers/acpi/acpi_configfs.c                       |   25 +-
+ drivers/acpi/acpi_dbg.c                            |   30 +-
+ drivers/acpi/acpi_lpss.c                           |    2 +-
+ drivers/acpi/acpi_video.c                          |   20 +-
+ drivers/acpi/acpica/acapps.h                       |    4 +-
+ drivers/acpi/acpica/accommon.h                     |    2 +-
+ drivers/acpi/acpica/acconvert.h                    |    2 +-
+ drivers/acpi/acpica/acdebug.h                      |    5 +-
+ drivers/acpi/acpica/acdispat.h                     |    2 +-
+ drivers/acpi/acpica/acevents.h                     |    2 +-
+ drivers/acpi/acpica/acglobal.h                     |    3 +-
+ drivers/acpi/acpica/achware.h                      |    2 +-
+ drivers/acpi/acpica/acinterp.h                     |    2 +-
+ drivers/acpi/acpica/aclocal.h                      |    4 +-
+ drivers/acpi/acpica/acmacros.h                     |    4 +-
+ drivers/acpi/acpica/acnamesp.h                     |    2 +-
+ drivers/acpi/acpica/acobject.h                     |    3 +-
+ drivers/acpi/acpica/acopcode.h                     |    2 +-
+ drivers/acpi/acpica/acparser.h                     |    2 +-
+ drivers/acpi/acpica/acpredef.h                     |   17 +-
+ drivers/acpi/acpica/acresrc.h                      |    2 +-
+ drivers/acpi/acpica/acstruct.h                     |    2 +-
+ drivers/acpi/acpica/actables.h                     |    2 +-
+ drivers/acpi/acpica/acutils.h                      |    2 +-
+ drivers/acpi/acpica/amlcode.h                      |    2 +-
+ drivers/acpi/acpica/amlresrc.h                     |    2 +-
+ drivers/acpi/acpica/dbdisply.c                     |    4 +-
+ drivers/acpi/acpica/dbexec.c                       |    4 +-
+ drivers/acpi/acpica/dbhistry.c                     |    2 +-
+ drivers/acpi/acpica/dbnames.c                      |    2 +-
+ drivers/acpi/acpica/dbobject.c                     |    2 +-
+ drivers/acpi/acpica/dbtest.c                       |  164 +-
+ drivers/acpi/acpica/dsargs.c                       |    2 +-
+ drivers/acpi/acpica/dscontrol.c                    |    2 +-
+ drivers/acpi/acpica/dsdebug.c                      |    2 +-
+ drivers/acpi/acpica/dsfield.c                      |    9 +-
+ drivers/acpi/acpica/dsinit.c                       |    2 +-
+ drivers/acpi/acpica/dsmethod.c                     |    2 +-
+ drivers/acpi/acpica/dsobject.c                     |    2 +-
+ drivers/acpi/acpica/dsopcode.c                     |   28 +-
+ drivers/acpi/acpica/dspkginit.c                    |    2 +-
+ drivers/acpi/acpica/dswexec.c                      |    2 +-
+ drivers/acpi/acpica/dswload.c                      |    2 +-
+ drivers/acpi/acpica/dswload2.c                     |    4 +-
+ drivers/acpi/acpica/dswscope.c                     |    2 +-
+ drivers/acpi/acpica/dswstate.c                     |    2 +-
+ drivers/acpi/acpica/evevent.c                      |    2 +-
+ drivers/acpi/acpica/evglock.c                      |    2 +-
+ drivers/acpi/acpica/evgpe.c                        |    4 +-
+ drivers/acpi/acpica/evgpeblk.c                     |    2 +-
+ drivers/acpi/acpica/evgpeinit.c                    |    2 +-
+ drivers/acpi/acpica/evgpeutil.c                    |    2 +-
+ drivers/acpi/acpica/evhandler.c                    |    2 +-
+ drivers/acpi/acpica/evmisc.c                       |    2 +-
+ drivers/acpi/acpica/evregion.c                     |    4 +-
+ drivers/acpi/acpica/evrgnini.c                     |   21 +-
+ drivers/acpi/acpica/evxface.c                      |    2 +-
+ drivers/acpi/acpica/evxfevnt.c                     |    2 +-
+ drivers/acpi/acpica/evxfgpe.c                      |    6 +-
+ drivers/acpi/acpica/evxfregn.c                     |    2 +-
+ drivers/acpi/acpica/exconcat.c                     |    2 +-
+ drivers/acpi/acpica/exconfig.c                     |    2 +-
+ drivers/acpi/acpica/exconvrt.c                     |    4 +-
+ drivers/acpi/acpica/excreate.c                     |    2 +-
+ drivers/acpi/acpica/exdebug.c                      |    2 +-
+ drivers/acpi/acpica/exdump.c                       |    2 +-
+ drivers/acpi/acpica/exfield.c                      |   71 +-
+ drivers/acpi/acpica/exfldio.c                      |    2 +-
+ drivers/acpi/acpica/exmisc.c                       |    2 +-
+ drivers/acpi/acpica/exmutex.c                      |    2 +-
+ drivers/acpi/acpica/exnames.c                      |    2 +-
+ drivers/acpi/acpica/exoparg1.c                     |    2 +-
+ drivers/acpi/acpica/exoparg2.c                     |   10 +-
+ drivers/acpi/acpica/exoparg3.c                     |    2 +-
+ drivers/acpi/acpica/exoparg6.c                     |    2 +-
+ drivers/acpi/acpica/exprep.c                       |    2 +-
+ drivers/acpi/acpica/exregion.c                     |    2 +-
+ drivers/acpi/acpica/exresnte.c                     |    2 +-
+ drivers/acpi/acpica/exresolv.c                     |    2 +-
+ drivers/acpi/acpica/exresop.c                      |    2 +-
+ drivers/acpi/acpica/exserial.c                     |    4 +-
+ drivers/acpi/acpica/exstore.c                      |    2 +-
+ drivers/acpi/acpica/exstoren.c                     |    2 +-
+ drivers/acpi/acpica/exstorob.c                     |    2 +-
+ drivers/acpi/acpica/exsystem.c                     |    2 +-
+ drivers/acpi/acpica/extrace.c                      |    2 +-
+ drivers/acpi/acpica/exutils.c                      |    4 +-
+ drivers/acpi/acpica/hwacpi.c                       |    2 +-
+ drivers/acpi/acpica/hwesleep.c                     |    2 +-
+ drivers/acpi/acpica/hwgpe.c                        |    2 +-
+ drivers/acpi/acpica/hwsleep.c                      |    2 +-
+ drivers/acpi/acpica/hwtimer.c                      |    2 +-
+ drivers/acpi/acpica/hwvalid.c                      |    2 +-
+ drivers/acpi/acpica/hwxface.c                      |    2 +-
+ drivers/acpi/acpica/hwxfsleep.c                    |   98 +-
+ drivers/acpi/acpica/nsarguments.c                  |    2 +-
+ drivers/acpi/acpica/nsconvert.c                    |    2 +-
+ drivers/acpi/acpica/nsdump.c                       |    2 +-
+ drivers/acpi/acpica/nsdumpdv.c                     |    2 +-
+ drivers/acpi/acpica/nsinit.c                       |    2 +-
+ drivers/acpi/acpica/nsload.c                       |    4 +-
+ drivers/acpi/acpica/nsparse.c                      |   68 +-
+ drivers/acpi/acpica/nspredef.c                     |    2 +-
+ drivers/acpi/acpica/nsprepkg.c                     |    2 +-
+ drivers/acpi/acpica/nsrepair.c                     |    2 +-
+ drivers/acpi/acpica/nsrepair2.c                    |    2 +-
+ drivers/acpi/acpica/nsutils.c                      |    4 +-
+ drivers/acpi/acpica/nswalk.c                       |    2 +-
+ drivers/acpi/acpica/nsxfname.c                     |    2 +-
+ drivers/acpi/acpica/psargs.c                       |    2 +-
+ drivers/acpi/acpica/psloop.c                       |  195 +-
+ drivers/acpi/acpica/psobject.c                     |    2 +-
+ drivers/acpi/acpica/psopcode.c                     |    2 +-
+ drivers/acpi/acpica/psopinfo.c                     |    2 +-
+ drivers/acpi/acpica/psparse.c                      |   10 +-
+ drivers/acpi/acpica/psscope.c                      |    2 +-
+ drivers/acpi/acpica/pstree.c                       |    2 +-
+ drivers/acpi/acpica/psutils.c                      |    2 +-
+ drivers/acpi/acpica/pswalk.c                       |    2 +-
+ drivers/acpi/acpica/psxface.c                      |    2 +-
+ drivers/acpi/acpica/rsdumpinfo.c                   |   14 +-
+ drivers/acpi/acpica/rsirq.c                        |    8 +-
+ drivers/acpi/acpica/rsserial.c                     |   10 +-
+ drivers/acpi/acpica/tbdata.c                       |    2 +-
+ drivers/acpi/acpica/tbfadt.c                       |    4 +-
+ drivers/acpi/acpica/tbfind.c                       |    2 +-
+ drivers/acpi/acpica/tbinstal.c                     |    2 +-
+ drivers/acpi/acpica/tbprint.c                      |    2 +-
+ drivers/acpi/acpica/tbutils.c                      |    2 +-
+ drivers/acpi/acpica/tbxface.c                      |    6 +-
+ drivers/acpi/acpica/tbxfload.c                     |   27 +-
+ drivers/acpi/acpica/tbxfroot.c                     |    2 +-
+ drivers/acpi/acpica/utaddress.c                    |    2 +-
+ drivers/acpi/acpica/utalloc.c                      |    2 +-
+ drivers/acpi/acpica/utascii.c                      |    2 +-
+ drivers/acpi/acpica/utbuffer.c                     |    2 +-
+ drivers/acpi/acpica/utcache.c                      |    2 +-
+ drivers/acpi/acpica/utcopy.c                       |    2 +-
+ drivers/acpi/acpica/utdebug.c                      |    2 +-
+ drivers/acpi/acpica/utdecode.c                     |   20 +-
+ drivers/acpi/acpica/utdelete.c                     |    4 +
+ drivers/acpi/acpica/uterror.c                      |    9 +-
+ drivers/acpi/acpica/uteval.c                       |    2 +-
+ drivers/acpi/acpica/utglobal.c                     |    2 +-
+ drivers/acpi/acpica/uthex.c                        |    2 +-
+ drivers/acpi/acpica/utids.c                        |    2 +-
+ drivers/acpi/acpica/utinit.c                       |    2 +-
+ drivers/acpi/acpica/utlock.c                       |    2 +-
+ drivers/acpi/acpica/utobject.c                     |    2 +-
+ drivers/acpi/acpica/utosi.c                        |    2 +-
+ drivers/acpi/acpica/utpredef.c                     |    2 +-
+ drivers/acpi/acpica/utprint.c                      |    2 +-
+ drivers/acpi/acpica/uttrack.c                      |   14 +-
+ drivers/acpi/acpica/utuuid.c                       |    2 +-
+ drivers/acpi/acpica/utxface.c                      |    2 +-
+ drivers/acpi/acpica/utxferror.c                    |   44 +
+ drivers/acpi/acpica/utxfinit.c                     |    2 +-
+ drivers/acpi/apei/Kconfig                          |   12 +-
+ drivers/acpi/apei/bert.c                           |   23 +-
+ drivers/acpi/apei/einj.c                           |   93 +-
+ drivers/acpi/apei/erst.c                           |   27 +-
+ drivers/acpi/apei/ghes.c                           |  655 +-
+ drivers/acpi/apei/hest.c                           |   16 +-
+ drivers/acpi/bus.c                                 |   14 +
+ drivers/acpi/cppc_acpi.c                           |   42 +
+ drivers/acpi/custom_method.c                       |    6 -
+ drivers/acpi/device_sysfs.c                        |    6 +-
+ drivers/acpi/dptf/Makefile                         |    2 -
+ drivers/acpi/dptf/int340x_thermal.c                |    2 +-
+ drivers/acpi/ec.c                                  |  208 +-
+ drivers/acpi/ec_sys.c                              |   36 +-
+ drivers/acpi/internal.h                            |    4 +-
+ drivers/acpi/irq.c                                 |    4 +-
+ drivers/acpi/nfit/core.c                           |  193 +-
+ drivers/acpi/nfit/nfit.h                           |   17 +-
+ drivers/acpi/numa.c                                |    1 +
+ drivers/acpi/pci_link.c                            |    8 +-
+ drivers/acpi/pmic/intel_pmic.c                     |   61 +
+ drivers/acpi/pmic/intel_pmic.h                     |    4 +
+ drivers/acpi/pmic/intel_pmic_chtwc.c               |   19 +
+ drivers/acpi/pmic/intel_pmic_xpower.c              |    1 +
+ drivers/acpi/pptt.c                                |   16 +-
+ drivers/acpi/processor_idle.c                      |    7 +
+ drivers/acpi/resource.c                            |    4 +-
+ drivers/acpi/scan.c                                |    1 +
+ drivers/acpi/sysfs.c                               |   21 +-
+ drivers/acpi/tables.c                              |   12 +-
+ drivers/acpi/x86/utils.c                           |    5 +
+ drivers/amba/bus.c                                 |   45 +-
+ drivers/android/Kconfig                            |    2 +-
+ drivers/android/binder.c                           |  556 +-
+ drivers/android/binder_alloc.c                     |  303 +-
+ drivers/android/binder_alloc.h                     |   47 +-
+ drivers/android/binder_alloc_selftest.c            |    7 +-
+ drivers/android/binder_trace.h                     |    2 +-
+ drivers/ata/Kconfig                                |   12 +
+ drivers/ata/Makefile                               |    1 +
+ drivers/ata/libahci.c                              |    3 +-
+ drivers/ata/libata-scsi.c                          |    9 +-
+ drivers/ata/pata_buddha.c                          |  257 +
+ drivers/ata/pata_macio.c                           |    2 +-
+ drivers/ata/pata_of_platform.c                     |    6 +-
+ drivers/ata/pata_platform.c                        |   24 +-
+ drivers/ata/pata_samsung_cf.c                      |    8 +-
+ drivers/base/Kconfig                               |   77 -
+ drivers/base/base.h                                |   12 +
+ drivers/base/bus.c                                 |   66 +-
+ drivers/base/class.c                               |   14 +-
+ drivers/base/component.c                           |  206 +-
+ drivers/base/core.c                                |  246 +-
+ drivers/base/cpu.c                                 |    2 +
+ drivers/base/dd.c                                  |  188 +-
+ drivers/base/devcon.c                              |   62 +-
+ drivers/base/firmware_loader/Makefile              |    4 +-
+ .../base/firmware_loader/builtin}/.gitignore       |    0
+ .../base/firmware_loader/builtin}/Makefile         |    0
+ drivers/base/firmware_loader/fallback_table.c      |    5 -
+ drivers/base/firmware_loader/main.c                |    8 +-
+ drivers/base/memory.c                              |    1 +
+ drivers/base/platform.c                            |   41 +-
+ drivers/base/power/clock_ops.c                     |   13 +-
+ drivers/base/power/common.c                        |    2 +-
+ drivers/base/power/domain.c                        |   33 +-
+ drivers/base/power/domain_governor.c               |    1 -
+ drivers/base/power/main.c                          |   44 +-
+ drivers/base/power/power.h                         |    1 +
+ drivers/base/power/qos.c                           |    2 +-
+ drivers/base/power/runtime.c                       |  183 +-
+ drivers/base/power/sysfs.c                         |   21 +-
+ drivers/base/power/trace.c                         |    2 +
+ drivers/base/power/wakeup.c                        |   32 +-
+ drivers/base/swnode.c                              |   23 +
+ drivers/base/test/test_async_driver_probe.c        |  261 +-
+ drivers/block/floppy.c                             |    3 -
+ drivers/block/loop.c                               |   48 +-
+ drivers/block/mtip32xx/mtip32xx.c                  |   42 +-
+ drivers/block/nbd.c                                |    5 +-
+ drivers/block/null_blk_main.c                      |    3 +-
+ drivers/block/rbd.c                                |  447 +-
+ drivers/block/skd_main.c                           |    1 -
+ drivers/block/virtio_blk.c                         |   10 +-
+ drivers/block/xen-blkback/xenbus.c                 |   99 +-
+ drivers/block/xen-blkfront.c                       |    2 +-
+ drivers/block/zram/zcomp.c                         |    1 +
+ drivers/block/zram/zram_drv.c                      |    2 +-
+ drivers/bus/hisi_lpc.c                             |    5 +-
+ drivers/bus/imx-weim.c                             |   70 +-
+ drivers/cdrom/cdrom.c                              |    7 +-
+ drivers/char/Kconfig                               |   19 +-
+ drivers/char/Makefile                              |    6 +-
+ drivers/char/agp/efficeon-agp.c                    |    2 -
+ drivers/char/applicom.c                            |   35 +-
+ drivers/char/efirtc.c                              |   23 -
+ drivers/char/generic_nvram.c                       |  159 -
+ drivers/char/hpet.c                                |    9 +-
+ drivers/char/hw_random/Kconfig                     |   15 +
+ drivers/char/hw_random/Makefile                    |    1 +
+ drivers/char/hw_random/optee-rng.c                 |  306 +
+ drivers/char/ipmi/Kconfig                          |    5 +
+ drivers/char/ipmi/Makefile                         |    1 +
+ drivers/char/ipmi/ipmi_devintf.c                   |    6 +-
+ drivers/char/ipmi/ipmi_dmi.c                       |  139 +-
+ drivers/char/ipmi/ipmi_dmi.h                       |    2 +-
+ drivers/char/ipmi/ipmi_msghandler.c                |  159 +-
+ drivers/char/ipmi/ipmi_plat_data.c                 |  121 +
+ drivers/char/ipmi/ipmi_plat_data.h                 |   22 +
+ drivers/char/ipmi/ipmi_si.h                        |   14 +-
+ drivers/char/ipmi/ipmi_si_hardcode.c               |  149 +-
+ drivers/char/ipmi/ipmi_si_hotmod.c                 |  222 +-
+ drivers/char/ipmi/ipmi_si_intf.c                   |  102 +-
+ drivers/char/ipmi/ipmi_si_mem_io.c                 |    5 +-
+ drivers/char/ipmi/ipmi_si_parisc.c                 |    2 +-
+ drivers/char/ipmi/ipmi_si_pci.c                    |    4 +-
+ drivers/char/ipmi/ipmi_si_platform.c               |   73 +-
+ drivers/char/ipmi/ipmi_si_port_io.c                |    5 +-
+ drivers/char/ipmi/ipmi_si_sm.h                     |   14 +-
+ drivers/char/ipmi/ipmi_ssif.c                      |  188 +-
+ drivers/char/ipmi/kcs_bmc.c                        |    5 +-
+ drivers/char/lp.c                                  |    4 +-
+ drivers/char/mbcs.c                                |    1 +
+ drivers/char/nvram.c                               |  673 +-
+ drivers/char/tpm/eventlog/tpm1.c                   |   41 +-
+ drivers/char/tpm/eventlog/tpm2.c                   |   12 +-
+ drivers/char/tpm/st33zp24/i2c.c                    |    2 +-
+ drivers/char/tpm/st33zp24/spi.c                    |    2 +-
+ drivers/char/tpm/st33zp24/st33zp24.c               |    2 +-
+ drivers/char/tpm/st33zp24/st33zp24.h               |    4 +-
+ drivers/char/tpm/tpm-chip.c                        |  124 +-
+ drivers/char/tpm/tpm-dev-common.c                  |   44 +-
+ drivers/char/tpm/tpm-interface.c                   |  327 +-
+ drivers/char/tpm/tpm-sysfs.c                       |  138 +-
+ drivers/char/tpm/tpm.h                             |  180 +-
+ drivers/char/tpm/tpm1-cmd.c                        |   43 +-
+ drivers/char/tpm/tpm2-cmd.c                        |  208 +-
+ drivers/char/tpm/tpm2-space.c                      |   90 +-
+ drivers/char/tpm/tpm_atmel.c                       |    2 +-
+ drivers/char/tpm/tpm_crb.c                         |   22 +-
+ drivers/char/tpm/tpm_i2c_atmel.c                   |   15 +-
+ drivers/char/tpm/tpm_i2c_infineon.c                |   17 +-
+ drivers/char/tpm/tpm_i2c_nuvoton.c                 |   18 +-
+ drivers/char/tpm/tpm_ibmvtpm.c                     |    8 +-
+ drivers/char/tpm/tpm_infineon.c                    |    2 +-
+ drivers/char/tpm/tpm_nsc.c                         |    2 +-
+ drivers/char/tpm/tpm_ppi.c                         |   78 +-
+ drivers/char/tpm/tpm_tis_core.c                    |   21 +-
+ drivers/char/tpm/tpm_vtpm_proxy.c                  |   15 +-
+ drivers/char/tpm/xen-tpmfront.c                    |    4 +-
+ drivers/clk/Kconfig                                |    6 +
+ drivers/clk/Makefile                               |    3 +-
+ drivers/clk/actions/Kconfig                        |    5 +
+ drivers/clk/actions/Makefile                       |    1 +
+ drivers/clk/actions/owl-pll.c                      |    2 +-
+ drivers/clk/actions/owl-pll.h                      |   30 +-
+ drivers/clk/actions/owl-s500.c                     |  525 ++
+ drivers/clk/at91/clk-audio-pll.c                   |    9 +-
+ drivers/clk/at91/clk-programmable.c                |    3 -
+ drivers/clk/at91/sama5d2.c                         |    3 +-
+ drivers/clk/clk-clps711x.c                         |   61 +-
+ drivers/clk/clk-devres.c                           |   11 +
+ drivers/clk/clk-fixed-mmio.c                       |  101 +
+ drivers/clk/clk-fractional-divider.c               |    2 +-
+ drivers/clk/clk-gpio.c                             |   39 +-
+ drivers/clk/clk-highbank.c                         |    1 +
+ drivers/clk/clk-max77686.c                         |   28 +-
+ drivers/clk/clk-qoriq.c                            |    5 +-
+ drivers/clk/clk-stm32mp1.c                         |   37 +-
+ drivers/clk/clk-twl6040.c                          |   53 +-
+ drivers/clk/clk.c                                  |  262 +-
+ drivers/clk/clk.h                                  |   23 +-
+ drivers/clk/clkdev.c                               |  231 +-
+ drivers/clk/imx/Kconfig                            |    6 +
+ drivers/clk/imx/Makefile                           |    4 +-
+ drivers/clk/imx/clk-composite-8m.c                 |    2 +-
+ drivers/clk/imx/clk-imx51-imx53.c                  |    1 +
+ drivers/clk/imx/clk-imx6q.c                        |    1 +
+ drivers/clk/imx/clk-imx6sx.c                       |    1 +
+ drivers/clk/imx/clk-imx7d.c                        |    1 +
+ drivers/clk/imx/clk-imx7ulp.c                      |   16 +-
+ drivers/clk/imx/clk-imx8mm.c                       |  675 ++
+ drivers/clk/imx/clk-imx8mq.c                       |  254 +-
+ drivers/clk/imx/clk-imx8qxp.c                      |    1 +
+ drivers/clk/imx/clk-pll14xx.c                      |  392 ++
+ drivers/clk/imx/clk-sccg-pll.c                     |  514 +-
+ drivers/clk/imx/clk-scu.c                          |  123 +-
+ drivers/clk/imx/clk-scu.h                          |   16 +-
+ drivers/clk/imx/clk-vf610.c                        |    1 +
+ drivers/clk/imx/clk.h                              |   38 +-
+ drivers/clk/ingenic/cgu.c                          |   13 +-
+ drivers/clk/ingenic/cgu.h                          |    2 +-
+ drivers/clk/ingenic/jz4740-cgu.c                   |    2 +-
+ drivers/clk/mediatek/clk-gate.c                    |    4 +-
+ drivers/clk/mediatek/clk-gate.h                    |    3 +-
+ drivers/clk/mediatek/clk-mt2701.c                  |    4 +-
+ drivers/clk/mediatek/clk-mt2712.c                  |    9 +-
+ drivers/clk/mediatek/clk-mt6797.c                  |   68 +-
+ drivers/clk/mediatek/clk-mt8173.c                  |    4 +-
+ drivers/clk/mediatek/clk-mtk.c                     |    4 +-
+ drivers/clk/mediatek/clk-mtk.h                     |   29 +-
+ drivers/clk/meson/Kconfig                          |  101 +-
+ drivers/clk/meson/Makefile                         |   29 +-
+ drivers/clk/meson/axg-aoclk.c                      |  193 +-
+ drivers/clk/meson/axg-aoclk.h                      |   13 +-
+ drivers/clk/meson/axg-audio.c                      |    5 +-
+ drivers/clk/meson/axg.c                            |   69 +-
+ drivers/clk/meson/clk-dualdiv.c                    |  138 +
+ drivers/clk/meson/clk-dualdiv.h                    |   33 +
+ drivers/clk/meson/clk-input.c                      |    7 +-
+ drivers/clk/meson/clk-input.h                      |   19 +
+ drivers/clk/meson/clk-mpll.c                       |   12 +-
+ drivers/clk/meson/clk-mpll.h                       |   30 +
+ drivers/clk/meson/clk-phase.c                      |   75 +-
+ drivers/clk/meson/clk-phase.h                      |   26 +
+ drivers/clk/meson/clk-pll.c                        |  216 +-
+ drivers/clk/meson/clk-pll.h                        |   49 +
+ drivers/clk/meson/clk-regmap.c                     |    5 +
+ drivers/clk/meson/clk-regmap.h                     |   20 +
+ drivers/clk/meson/clk-triphase.c                   |   68 -
+ drivers/clk/meson/clkc.h                           |  127 -
+ drivers/clk/meson/g12a-aoclk.c                     |  454 ++
+ drivers/clk/meson/g12a-aoclk.h                     |   34 +
+ drivers/clk/meson/g12a.c                           | 2359 +++++++
+ drivers/clk/meson/g12a.h                           |  175 +
+ drivers/clk/meson/gxbb-aoclk-32k.c                 |  193 -
+ drivers/clk/meson/gxbb-aoclk.c                     |  268 +-
+ drivers/clk/meson/gxbb-aoclk.h                     |   20 +-
+ drivers/clk/meson/gxbb.c                           |  296 +-
+ drivers/clk/meson/meson-aoclk.c                    |   54 +-
+ drivers/clk/meson/meson-aoclk.h                    |   13 +-
+ drivers/clk/meson/meson-eeclk.c                    |   63 +
+ drivers/clk/meson/meson-eeclk.h                    |   25 +
+ drivers/clk/meson/meson8b.c                        |  374 +-
+ drivers/clk/meson/meson8b.h                        |   11 +-
+ drivers/clk/meson/parm.h                           |   46 +
+ drivers/clk/meson/sclk-div.c                       |   10 +-
+ drivers/clk/meson/{clkc-audio.h => sclk-div.h}     |   16 +-
+ drivers/clk/meson/vid-pll-div.c                    |   10 +-
+ drivers/clk/meson/vid-pll-div.h                    |   20 +
+ drivers/clk/mmp/clk-of-mmp2.c                      |    5 +-
+ drivers/clk/mvebu/armada-370.c                     |    4 +-
+ drivers/clk/mvebu/armada-xp.c                      |    4 +-
+ drivers/clk/mvebu/dove.c                           |    8 +-
+ drivers/clk/mvebu/kirkwood.c                       |    2 +
+ drivers/clk/mvebu/mv98dx3236.c                     |    4 +-
+ drivers/clk/qcom/clk-rcg.h                         |    5 +-
+ drivers/clk/qcom/clk-rcg2.c                        |   24 +-
+ drivers/clk/qcom/clk-rpmh.c                        |  146 +
+ drivers/clk/qcom/clk-smd-rpm.c                     |   63 +
+ drivers/clk/qcom/common.c                          |    8 +
+ drivers/clk/qcom/common.h                          |    2 +
+ drivers/clk/qcom/gcc-ipq8074.c                     |   10 +-
+ drivers/clk/qcom/gcc-mdm9615.c                     |   11 +-
+ drivers/clk/qcom/gcc-msm8996.c                     |   10 +-
+ drivers/clk/qcom/gcc-msm8998.c                     |   61 +-
+ drivers/clk/qcom/gcc-qcs404.c                      |   10 +-
+ drivers/clk/qcom/gcc-sdm660.c                      |   11 +-
+ drivers/clk/qcom/gcc-sdm845.c                      |    5 +
+ drivers/clk/qcom/mmcc-msm8996.c                    |   10 +-
+ drivers/clk/renesas/r8a774a1-cpg-mssr.c            |    4 +-
+ drivers/clk/renesas/r8a774c0-cpg-mssr.c            |   15 +-
+ drivers/clk/renesas/r8a77980-cpg-mssr.c            |    8 +
+ drivers/clk/renesas/rcar-gen3-cpg.c                |  147 +-
+ drivers/clk/renesas/rcar-gen3-cpg.h                |    4 +
+ drivers/clk/rockchip/clk-rk3188.c                  |    4 +-
+ drivers/clk/rockchip/clk-rk3328.c                  |   12 +-
+ drivers/clk/samsung/clk-exynos4.c                  |    1 +
+ drivers/clk/samsung/clk-exynos5-subcmu.c           |   13 +-
+ drivers/clk/samsung/clk-exynos5433.c               |   38 +-
+ drivers/clk/samsung/clk-s3c2443.c                  |    2 +-
+ drivers/clk/samsung/clk.h                          |    2 +-
+ drivers/clk/socfpga/clk-gate.c                     |   22 +-
+ drivers/clk/socfpga/clk-pll-a10.c                  |    1 +
+ drivers/clk/socfpga/clk-pll.c                      |    1 +
+ drivers/clk/sunxi-ng/ccu-sun8i-a23.c               |    2 +-
+ drivers/clk/tegra/Kconfig                          |    5 +
+ drivers/clk/tegra/Makefile                         |    2 +-
+ drivers/clk/tegra/clk-dfll.c                       |  477 +-
+ drivers/clk/tegra/clk-dfll.h                       |    6 +-
+ drivers/clk/tegra/clk-tegra124-dfll-fcpu.c         |  520 +-
+ drivers/clk/tegra/cvb.c                            |   12 +-
+ drivers/clk/tegra/cvb.h                            |    7 +-
+ drivers/clk/ti/adpll.c                             |    2 +-
+ drivers/clk/ti/apll.c                              |    4 +-
+ drivers/clk/ti/autoidle.c                          |  101 +-
+ drivers/clk/ti/clk.c                               |   83 +-
+ drivers/clk/ti/clkctrl.c                           |    4 +-
+ drivers/clk/ti/clock.h                             |    5 +-
+ drivers/clk/ti/clockdomain.c                       |    2 +-
+ drivers/clk/ti/divider.c                           |    2 +-
+ drivers/clk/ti/dpll.c                              |   11 +-
+ drivers/clk/ti/dpll3xxx.c                          |    2 +-
+ drivers/clk/ti/gate.c                              |    2 +-
+ drivers/clk/ti/interface.c                         |    4 +-
+ drivers/clk/ti/mux.c                               |    2 +-
+ drivers/clk/uniphier/clk-uniphier-cpugear.c        |    2 +-
+ drivers/clk/x86/clk-lpt.c                          |    2 +-
+ drivers/clk/x86/clk-st.c                           |    3 +-
+ drivers/clocksource/Kconfig                        |   22 +-
+ drivers/clocksource/Makefile                       |    7 +-
+ drivers/clocksource/arm_arch_timer.c               |   66 +-
+ drivers/clocksource/exynos_mct.c                   |   48 +-
+ .../{cs5535-clockevt.c => timer-cs5535.c}          |    0
+ drivers/clocksource/timer-milbeaut.c               |  161 +
+ drivers/clocksource/{pxa_timer.c => timer-pxa.c}   |    0
+ drivers/clocksource/timer-riscv.c                  |   23 +-
+ drivers/clocksource/timer-sun5i.c                  |   10 +
+ .../{tango_xtal.c => timer-tango-xtal.c}           |    0
+ drivers/clocksource/timer-tegra20.c                |  370 +-
+ drivers/connector/cn_proc.c                        |   22 +-
+ drivers/cpufreq/Kconfig                            |    3 -
+ drivers/cpufreq/Kconfig.arm                        |   20 +-
+ drivers/cpufreq/Makefile                           |    1 +
+ drivers/cpufreq/acpi-cpufreq.c                     |    4 +-
+ drivers/cpufreq/arm_big_little.c                   |    2 +
+ drivers/cpufreq/armada-8k-cpufreq.c                |  206 +
+ drivers/cpufreq/cppc_cpufreq.c                     |   65 +
+ drivers/cpufreq/cpufreq-dt-platdev.c               |    1 +
+ drivers/cpufreq/cpufreq-dt.c                       |   33 +-
+ drivers/cpufreq/cpufreq.c                          |  158 +-
+ drivers/cpufreq/cpufreq_stats.c                    |   16 +-
+ drivers/cpufreq/davinci-cpufreq.c                  |    5 +-
+ drivers/cpufreq/e_powersaver.c                     |    5 +-
+ drivers/cpufreq/imx6q-cpufreq.c                    |   25 +-
+ drivers/cpufreq/intel_pstate.c                     |  105 +-
+ drivers/cpufreq/longhaul.c                         |    2 +-
+ drivers/cpufreq/mediatek-cpufreq.c                 |   16 +-
+ drivers/cpufreq/omap-cpufreq.c                     |    4 +-
+ drivers/cpufreq/pcc-cpufreq.c                      |    2 +-
+ drivers/cpufreq/powernv-cpufreq.c                  |   10 +-
+ drivers/cpufreq/pxa2xx-cpufreq.c                   |    4 +-
+ drivers/cpufreq/qcom-cpufreq-hw.c                  |   53 +-
+ drivers/cpufreq/qcom-cpufreq-kryo.c                |   22 +-
+ drivers/cpufreq/qoriq-cpufreq.c                    |   15 +-
+ drivers/cpufreq/s5pv210-cpufreq.c                  |   67 +-
+ drivers/cpufreq/scmi-cpufreq.c                     |   53 +-
+ drivers/cpufreq/scpi-cpufreq.c                     |   17 +-
+ drivers/cpufreq/speedstep-ich.c                    |    3 +-
+ drivers/cpufreq/tegra124-cpufreq.c                 |   46 +-
+ drivers/cpuidle/Kconfig                            |   11 +-
+ drivers/cpuidle/dt_idle_states.c                   |   15 +-
+ drivers/cpuidle/governor.c                         |    1 +
+ drivers/cpuidle/governors/Makefile                 |    1 +
+ drivers/cpuidle/governors/menu.c                   |    2 +-
+ drivers/cpuidle/governors/teo.c                    |  444 ++
+ drivers/crypto/caam/caamalg.c                      |   12 +-
+ drivers/crypto/caam/caamalg_qi.c                   |   11 +-
+ drivers/crypto/caam/caamhash.c                     |   18 +-
+ drivers/crypto/caam/caampkc.c                      |   14 +-
+ drivers/crypto/caam/caamrng.c                      |   22 +-
+ drivers/crypto/s5p-sss.c                           |    2 +-
+ drivers/dax/Kconfig                                |   28 +-
+ drivers/dax/Makefile                               |    6 +-
+ drivers/dax/bus.c                                  |  503 ++
+ drivers/dax/bus.h                                  |   61 +
+ drivers/dax/dax-private.h                          |   34 +-
+ drivers/dax/dax.h                                  |   18 -
+ drivers/dax/device-dax.h                           |   25 -
+ drivers/dax/device.c                               |  363 +-
+ drivers/dax/kmem.c                                 |  108 +
+ drivers/dax/pmem.c                                 |  153 -
+ drivers/dax/pmem/Makefile                          |    7 +
+ drivers/dax/pmem/compat.c                          |   73 +
+ drivers/dax/pmem/core.c                            |   71 +
+ drivers/dax/pmem/pmem.c                            |   40 +
+ drivers/dax/super.c                                |   79 +-
+ drivers/dma-buf/dma-buf.c                          |   12 +-
+ drivers/dma-buf/dma-fence.c                        |    2 +-
+ drivers/dma-buf/sw_sync.c                          |    2 +-
+ drivers/dma-buf/sync_debug.c                       |   16 +-
+ drivers/dma-buf/sync_file.c                        |    4 +-
+ drivers/dma/Kconfig                                |   14 +
+ drivers/dma/Makefile                               |    1 +
+ drivers/dma/at_hdmac.c                             |    5 -
+ drivers/dma/bcm2835-dma.c                          |   27 +-
+ drivers/dma/dma-axi-dmac.c                         |    3 +-
+ drivers/dma/dma-jz4780.c                           |    5 +-
+ drivers/dma/dmaengine.c                            |    4 +-
+ drivers/dma/dmatest.c                              |  269 +-
+ drivers/dma/dw-axi-dmac/dw-axi-dmac.h              |    2 +-
+ drivers/dma/dw/Kconfig                             |    2 +
+ drivers/dma/dw/Makefile                            |    2 +-
+ drivers/dma/dw/core.c                              |  245 +-
+ drivers/dma/dw/dw.c                                |  138 +
+ drivers/dma/dw/idma32.c                            |  160 +
+ drivers/dma/dw/internal.h                          |   15 +-
+ drivers/dma/dw/pci.c                               |   53 +-
+ drivers/dma/dw/platform.c                          |   22 +-
+ drivers/dma/dw/regs.h                              |   30 +-
+ drivers/dma/fsl-edma-common.c                      |   70 +-
+ drivers/dma/fsl-edma-common.h                      |    4 +
+ drivers/dma/fsl-edma.c                             |    1 +
+ drivers/dma/fsl-qdma.c                             | 1259 ++++
+ drivers/dma/fsldma.c                               |   16 +-
+ drivers/dma/fsldma.h                               |   68 +-
+ drivers/dma/imx-dma.c                              |    8 +-
+ drivers/dma/imx-sdma.c                             |   49 +-
+ drivers/dma/ioat/dma.c                             |   12 +
+ drivers/dma/ioat/dma.h                             |    2 +-
+ drivers/dma/ioat/hw.h                              |    3 +
+ drivers/dma/ioat/init.c                            |   40 +-
+ drivers/dma/ioat/registers.h                       |   24 +
+ drivers/dma/k3dma.c                                |   61 +-
+ drivers/dma/mcf-edma.c                             |    1 +
+ drivers/dma/mv_xor.c                               |    7 +-
+ drivers/dma/pch_dma.c                              |    1 -
+ drivers/dma/pl330.c                                |    1 -
+ drivers/dma/qcom/bam_dma.c                         |    4 +-
+ drivers/dma/qcom/hidma.c                           |   19 +-
+ drivers/dma/qcom/hidma_mgmt.c                      |    3 +-
+ drivers/dma/sa11x0-dma.c                           |    2 -
+ drivers/dma/sh/usb-dmac.c                          |    2 +
+ drivers/dma/sprd-dma.c                             |   19 +-
+ drivers/dma/st_fdma.c                              |    6 +-
+ drivers/dma/stm32-dma.c                            |   71 +-
+ drivers/dma/stm32-dmamux.c                         |   58 +-
+ drivers/dma/stm32-mdma.c                           |   56 +-
+ drivers/dma/tegra20-apb-dma.c                      |   45 +-
+ drivers/dma/tegra210-adma.c                        |    5 +-
+ drivers/dma/timb_dma.c                             |    4 +-
+ drivers/dma/xilinx/xilinx_dma.c                    |  170 +-
+ drivers/edac/Kconfig                               |   35 +-
+ drivers/edac/Makefile                              |    8 +-
+ drivers/edac/altera_edac.c                         |   72 +-
+ drivers/edac/aspeed_edac.c                         |  421 ++
+ drivers/edac/debugfs.c                             |   48 +-
+ drivers/edac/edac_module.h                         |    8 +-
+ drivers/edac/i10nm_base.c                          |  275 +
+ drivers/edac/mce_amd.c                             |  291 +-
+ drivers/edac/skx_base.c                            |  650 ++
+ drivers/edac/skx_common.c                          |  691 ++
+ drivers/edac/skx_common.h                          |  152 +
+ drivers/edac/skx_edac.c                            | 1358 ----
+ drivers/extcon/Kconfig                             |    8 +
+ drivers/extcon/Makefile                            |    1 +
+ drivers/extcon/extcon-ptn5150.c                    |  339 +
+ drivers/firmware/Kconfig                           |    2 +-
+ drivers/firmware/arm_sdei.c                        |   68 +
+ drivers/firmware/efi/Kconfig                       |    6 +
+ drivers/firmware/efi/Makefile                      |    1 +
+ drivers/firmware/efi/apple-properties.c            |   13 +-
+ drivers/firmware/efi/arm-init.c                    |    6 +-
+ drivers/firmware/efi/arm-runtime.c                 |   12 +-
+ drivers/firmware/efi/capsule-loader.c              |    4 +-
+ drivers/firmware/efi/capsule.c                     |    4 +-
+ drivers/firmware/efi/cper-arm.c                    |   14 +-
+ drivers/firmware/efi/cper.c                        |   27 +-
+ drivers/firmware/efi/dev-path-parser.c             |    9 +-
+ drivers/firmware/efi/earlycon.c                    |  206 +
+ drivers/firmware/efi/efi-bgrt.c                    |    5 +-
+ drivers/firmware/efi/efi-pstore.c                  |    2 +
+ drivers/firmware/efi/efibc.c                       |   10 +-
+ drivers/firmware/efi/efivars.c                     |   58 +-
+ drivers/firmware/efi/esrt.c                        |    1 +
+ drivers/firmware/efi/fake_mem.c                    |   16 +-
+ drivers/firmware/efi/libstub/Makefile              |    4 +-
+ drivers/firmware/efi/libstub/arm-stub.c            |    5 +
+ drivers/firmware/efi/libstub/arm32-stub.c          |    6 +-
+ drivers/firmware/efi/libstub/arm64-stub.c          |    6 +-
+ drivers/firmware/efi/libstub/efi-stub-helper.c     |   15 +-
+ drivers/firmware/efi/libstub/efistub.h             |   12 +
+ drivers/firmware/efi/libstub/fdt.c                 |  115 +-
+ drivers/firmware/efi/libstub/gop.c                 |    4 +-
+ drivers/firmware/efi/libstub/random.c              |    6 +-
+ drivers/firmware/efi/libstub/secureboot.c          |    4 +-
+ drivers/firmware/efi/libstub/tpm.c                 |    4 +-
+ drivers/firmware/efi/memattr.c                     |    7 +-
+ drivers/firmware/efi/runtime-map.c                 |    3 +-
+ drivers/firmware/efi/runtime-wrappers.c            |   65 +-
+ drivers/firmware/efi/test/efi_test.c               |    1 +
+ drivers/firmware/efi/test/efi_test.h               |    2 +-
+ drivers/firmware/efi/tpm.c                         |    5 +-
+ drivers/firmware/efi/vars.c                        |   15 +-
+ drivers/firmware/imx/misc.c                        |   38 +
+ drivers/firmware/imx/scu-pd.c                      |    1 +
+ drivers/firmware/iscsi_ibft.c                      |    1 +
+ drivers/firmware/iscsi_ibft_find.c                 |    2 +-
+ drivers/firmware/memmap.c                          |    2 +-
+ drivers/firmware/raspberrypi.c                     |   11 +
+ drivers/firmware/tegra/Makefile                    |    3 +
+ drivers/firmware/tegra/bpmp-private.h              |   34 +
+ drivers/firmware/tegra/bpmp-tegra186.c             |  305 +
+ drivers/firmware/tegra/bpmp-tegra210.c             |  243 +
+ drivers/firmware/tegra/bpmp.c                      |  376 +-
+ drivers/firmware/ti_sci.c                          |   21 +-
+ drivers/firmware/xilinx/Kconfig                    |    1 +
+ drivers/firmware/xilinx/zynqmp.c                   |  166 +
+ drivers/fpga/Kconfig                               |    2 +-
+ drivers/fpga/altera-ps-spi.c                       |    2 +-
+ drivers/gnss/Kconfig                               |   13 +
+ drivers/gnss/Makefile                              |    3 +
+ drivers/gnss/core.c                                |    1 +
+ drivers/gnss/mtk.c                                 |  152 +
+ drivers/gnss/sirf.c                                |  256 +-
+ drivers/gpio/Kconfig                               |   24 +
+ drivers/gpio/Makefile                              |    3 +
+ drivers/gpio/gpio-adp5588.c                        |  234 +-
+ drivers/gpio/gpio-altera-a10sr.c                   |   17 +-
+ drivers/gpio/gpio-altera.c                         |    4 +-
+ drivers/gpio/gpio-amd-fch.c                        |  194 +
+ drivers/gpio/gpio-crystalcove.c                    |   30 +-
+ drivers/gpio/gpio-davinci.c                        |    4 +-
+ drivers/gpio/gpio-eic-sprd.c                       |    1 +
+ drivers/gpio/gpio-f7188x.c                         |   24 +-
+ drivers/gpio/gpio-ftgpio010.c                      |   20 +-
+ drivers/gpio/gpio-gw-pld.c                         |  137 +
+ drivers/gpio/gpio-hlwd.c                           |  192 +-
+ drivers/gpio/gpio-madera.c                         |    2 +-
+ drivers/gpio/gpio-ml-ioh.c                         |    2 -
+ drivers/gpio/gpio-mockup.c                         |  189 +-
+ drivers/gpio/gpio-msic.c                           |   34 +-
+ drivers/gpio/gpio-mvebu.c                          |   11 +
+ drivers/gpio/gpio-mxc.c                            |    5 +-
+ drivers/gpio/gpio-omap.c                           |   14 +-
+ drivers/gpio/gpio-pca953x.c                        |  190 +-
+ drivers/gpio/gpio-pcf857x.c                        |   15 +-
+ drivers/gpio/gpio-pch.c                            |    1 -
+ drivers/gpio/gpio-pmic-eic-sprd.c                  |    3 +-
+ drivers/gpio/gpio-rcar.c                           |   12 +-
+ drivers/gpio/gpio-sama5d2-piobu.c                  |   20 +-
+ drivers/gpio/gpio-tegra.c                          |   25 +-
+ drivers/gpio/gpio-tegra186.c                       |   70 +-
+ drivers/gpio/gpio-tqmx86.c                         |  332 +
+ drivers/gpio/gpio-wcove.c                          |   29 +-
+ drivers/gpio/gpio-zynq.c                           |   24 +
+ drivers/gpio/gpiolib-acpi.c                        |   24 +-
+ drivers/gpio/gpiolib-of.c                          |    9 +-
+ drivers/gpio/gpiolib.c                             |   87 +-
+ drivers/gpio/gpiolib.h                             |    2 +
+ drivers/gpu/drm/Kconfig                            |    4 -
+ drivers/gpu/drm/Makefile                           |    4 +-
+ drivers/gpu/drm/amd/amdgpu/Makefile                |    2 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu.h                |   11 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c         |  121 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h         |   19 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c   |    2 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c   |  142 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c     |    2 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c             |   13 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c            |   11 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c        |    3 -
+ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c         |  129 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h       |   20 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c            |   88 -
+ drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h            |   17 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c            |   25 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_gds.h            |    2 +
+ drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c            |    7 -
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c             |   10 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c             |   46 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h             |   40 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c            |   75 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h            |   10 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c            |    2 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h           |    1 +
+ drivers/gpu/drm/amd/amdgpu/amdgpu_object.c         |   40 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_object.h         |    1 +
+ drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c             |  354 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c            |  141 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h            |    3 -
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h           |    4 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c             |    2 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c          |   51 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h          |   11 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c            |    9 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c            |    2 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h            |    2 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c             |  144 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h             |    2 +
+ drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c           |   54 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h           |    5 +-
+ drivers/gpu/drm/amd/amdgpu/atom.c                  |    2 +
+ drivers/gpu/drm/amd/amdgpu/ci_dpm.c                | 6844 --------------------
+ drivers/gpu/drm/amd/amdgpu/ci_dpm.h                |  349 -
+ drivers/gpu/drm/amd/amdgpu/ci_smc.c                |  279 -
+ drivers/gpu/drm/amd/amdgpu/cik.c                   |   75 +-
+ drivers/gpu/drm/amd/amdgpu/cik_dpm.h               |    1 -
+ drivers/gpu/drm/amd/amdgpu/cik_ih.c                |   36 +-
+ drivers/gpu/drm/amd/amdgpu/cik_sdma.c              |    2 +-
+ drivers/gpu/drm/amd/amdgpu/cz_ih.c                 |   40 +-
+ drivers/gpu/drm/amd/amdgpu/dce_v10_0.c             |    2 +-
+ drivers/gpu/drm/amd/amdgpu/dce_v11_0.c             |    2 +-
+ drivers/gpu/drm/amd/amdgpu/dce_v6_0.c              |    5 +-
+ drivers/gpu/drm/amd/amdgpu/dce_v8_0.c              |    2 +-
+ drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c              |    4 +-
+ drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c              |   25 +-
+ drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c              |   25 +-
+ drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c              |   45 +-
+ drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c              |    3 +-
+ drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c              |   14 +-
+ drivers/gpu/drm/amd/amdgpu/iceland_ih.c            |   36 +-
+ drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c              |    3 +-
+ drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c             |   10 +-
+ drivers/gpu/drm/amd/amdgpu/nbio_v7_0.c             |    8 +-
+ drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c             |   11 +-
+ drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h            |    2 +-
+ drivers/gpu/drm/amd/amdgpu/psp_v10_0.c             |   90 -
+ drivers/gpu/drm/amd/amdgpu/psp_v11_0.c             |   75 -
+ drivers/gpu/drm/amd/amdgpu/psp_v3_1.c              |   76 +-
+ drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c             |    2 +-
+ drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c             |    5 +-
+ drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c             |   12 +-
+ drivers/gpu/drm/amd/amdgpu/si.c                    |   56 +-
+ drivers/gpu/drm/amd/amdgpu/si_dma.c                |    2 +-
+ drivers/gpu/drm/amd/amdgpu/si_dpm.c                |    2 +
+ drivers/gpu/drm/amd/amdgpu/si_ih.c                 |   38 +-
+ drivers/gpu/drm/amd/amdgpu/soc15.c                 |  166 +-
+ drivers/gpu/drm/amd/amdgpu/tonga_ih.c              |   60 +-
+ drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c              |    2 +-
+ drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c              |    2 +-
+ drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c              |    4 +-
+ drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c              |    4 +-
+ drivers/gpu/drm/amd/amdgpu/vce_v3_0.c              |    2 +-
+ drivers/gpu/drm/amd/amdgpu/vce_v4_0.c              |    2 +-
+ drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c              |    6 +-
+ drivers/gpu/drm/amd/amdgpu/vega10_ih.c             |  324 +-
+ drivers/gpu/drm/amd/amdgpu/vega10_reg_init.c       |    9 +-
+ drivers/gpu/drm/amd/amdgpu/vega20_reg_init.c       |   21 +-
+ drivers/gpu/drm/amd/amdgpu/vi.c                    |   69 +-
+ .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  |   16 +-
+ drivers/gpu/drm/amd/amdkfd/kfd_module.c            |   31 +-
+ drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c   |   52 +-
+ drivers/gpu/drm/amd/amdkfd/kfd_priv.h              |   44 +-
+ drivers/gpu/drm/amd/amdkfd/kfd_process.c           |   14 +-
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  | 1562 ++---
+ .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c  |   48 +-
+ .../drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c  |   49 +-
+ .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c  |   17 +-
+ .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c    |  110 +-
+ .../drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c   |   59 +-
+ .../drm/amd/display/amdgpu_dm/amdgpu_dm_services.c |    2 +-
+ drivers/gpu/drm/amd/display/dc/Makefile            |    5 +-
+ drivers/gpu/drm/amd/display/dc/bios/bios_parser.c  |   14 -
+ drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c |   18 +-
+ .../drm/amd/display/dc/bios/bios_parser_helper.c   |   96 +-
+ .../drm/amd/display/dc/bios/bios_parser_helper.h   |    4 -
+ .../gpu/drm/amd/display/dc/bios/command_table.c    |  135 +-
+ .../gpu/drm/amd/display/dc/bios/command_table.h    |    3 -
+ .../gpu/drm/amd/display/dc/bios/command_table2.c   |   82 +-
+ .../gpu/drm/amd/display/dc/bios/command_table2.h   |    3 -
+ drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c   |   10 +-
+ .../gpu/drm/amd/display/dc/calcs/dcn_calc_auto.c   |   45 +-
+ drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c   |   27 +-
+ drivers/gpu/drm/amd/display/dc/core/dc.c           |  261 +-
+ drivers/gpu/drm/amd/display/dc/core/dc_link.c      |  155 +-
+ drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c  |  162 +-
+ drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c   |   90 +-
+ drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c |   17 +-
+ drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |   82 +-
+ drivers/gpu/drm/amd/display/dc/core/dc_stream.c    |   69 +-
+ drivers/gpu/drm/amd/display/dc/core/dc_surface.c   |    9 +-
+ drivers/gpu/drm/amd/display/dc/core/dc_vm_helper.c |  123 +
+ drivers/gpu/drm/amd/display/dc/dc.h                |   21 +-
+ drivers/gpu/drm/amd/display/dc/dc_bios_types.h     |    9 -
+ drivers/gpu/drm/amd/display/dc/dc_dp_types.h       |   13 +-
+ drivers/gpu/drm/amd/display/dc/dc_helper.c         |   36 +-
+ drivers/gpu/drm/amd/display/dc/dc_hw_types.h       |    4 +-
+ drivers/gpu/drm/amd/display/dc/dc_link.h           |    3 +
+ drivers/gpu/drm/amd/display/dc/dc_stream.h         |   69 +-
+ drivers/gpu/drm/amd/display/dc/dc_types.h          |    3 +-
+ drivers/gpu/drm/amd/display/dc/dce/dce_abm.c       |   45 +-
+ drivers/gpu/drm/amd/display/dc/dce/dce_aux.c       |  647 +-
+ drivers/gpu/drm/amd/display/dc/dce/dce_aux.h       |   30 +-
+ drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c   |  123 +-
+ drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.h   |   35 +-
+ .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |  224 +-
+ drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c      |  129 +-
+ drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h     |   12 +
+ .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c  |    8 +-
+ drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c |    2 +-
+ .../drm/amd/display/dc/dce/dce_stream_encoder.c    |   79 +-
+ .../drm/amd/display/dc/dce/dce_stream_encoder.h    |    8 +-
+ .../drm/amd/display/dc/dce100/dce100_resource.c    |    4 +-
+ .../drm/amd/display/dc/dce110/dce110_compressor.c  |    2 -
+ .../amd/display/dc/dce110/dce110_hw_sequencer.c    |  212 +-
+ .../drm/amd/display/dc/dce110/dce110_resource.c    |   16 +-
+ .../drm/amd/display/dc/dce112/dce112_resource.c    |    6 +-
+ .../amd/display/dc/dce120/dce120_hw_sequencer.c    |   15 +
+ .../amd/display/dc/dce120/dce120_hw_sequencer.h    |    1 +
+ .../drm/amd/display/dc/dce120/dce120_resource.c    |   84 +-
+ .../gpu/drm/amd/display/dc/dce80/dce80_resource.c  |    4 +-
+ .../amd/display/dc/dce80/dce80_timing_generator.c  |    8 +-
+ .../gpu/drm/amd/display/dc/dcn10/dcn10_clk_mgr.c   |  107 +-
+ .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c    |   12 +-
+ .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c  |   42 +-
+ .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c    |  203 +-
+ .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h    |   37 +-
+ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c  |   28 +-
+ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h  |    7 +-
+ .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  |  397 +-
+ .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h  |    2 +
+ .../display/dc/dcn10/dcn10_hw_sequencer_debug.c    |   15 +-
+ .../drm/amd/display/dc/dcn10/dcn10_link_encoder.c  |   36 +-
+ .../drm/amd/display/dc/dcn10/dcn10_link_encoder.h  |    4 +-
+ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c  |  184 +-
+ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h  |   23 +-
+ .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c  |   74 +-
+ .../amd/display/dc/dcn10/dcn10_stream_encoder.c    |   79 +-
+ .../amd/display/dc/dcn10/dcn10_stream_encoder.h    |   10 +-
+ drivers/gpu/drm/amd/display/dc/dm_helpers.h        |    7 +
+ drivers/gpu/drm/amd/display/dc/dm_pp_smu.h         |    3 +-
+ drivers/gpu/drm/amd/display/dc/dm_services_types.h |   14 +-
+ .../drm/amd/display/dc/dml/display_mode_enums.h    |   26 +
+ .../gpu/drm/amd/display/dc/dml/display_mode_lib.c  |   28 +
+ .../gpu/drm/amd/display/dc/dml/display_mode_lib.h  |    2 +
+ .../drm/amd/display/dc/dml/display_mode_structs.h  |  107 +-
+ .../amd/display/dc/dml/dml1_display_rq_dlg_calc.c  |    6 +-
+ drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c    |   12 +
+ drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c |   28 +
+ drivers/gpu/drm/amd/display/dc/gpio/gpio_service.h |   10 +
+ drivers/gpu/drm/amd/display/dc/i2caux/Makefile     |   99 -
+ drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.c |  606 --
+ drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.h |   86 -
+ .../amd/display/dc/i2caux/dce100/i2caux_dce100.c   |  106 -
+ .../display/dc/i2caux/dce110/aux_engine_dce110.c   |  505 --
+ .../display/dc/i2caux/dce110/aux_engine_dce110.h   |   78 -
+ .../dc/i2caux/dce110/i2c_hw_engine_dce110.c        |  574 --
+ .../dc/i2caux/dce110/i2c_hw_engine_dce110.h        |  218 -
+ .../dc/i2caux/dce110/i2c_sw_engine_dce110.c        |  160 -
+ .../amd/display/dc/i2caux/dce110/i2caux_dce110.c   |  329 -
+ .../amd/display/dc/i2caux/dce110/i2caux_dce110.h   |   54 -
+ .../amd/display/dc/i2caux/dce112/i2caux_dce112.c   |  129 -
+ .../amd/display/dc/i2caux/dce112/i2caux_dce112.h   |   32 -
+ .../amd/display/dc/i2caux/dce120/i2caux_dce120.c   |  120 -
+ .../display/dc/i2caux/dce80/i2c_hw_engine_dce80.c  |  875 ---
+ .../display/dc/i2caux/dce80/i2c_hw_engine_dce80.h  |   54 -
+ .../display/dc/i2caux/dce80/i2c_sw_engine_dce80.c  |  173 -
+ .../drm/amd/display/dc/i2caux/dce80/i2caux_dce80.c |  284 -
+ .../drm/amd/display/dc/i2caux/dcn10/i2caux_dcn10.c |  120 -
+ .../drm/amd/display/dc/i2caux/dcn10/i2caux_dcn10.h |   32 -
+ .../display/dc/i2caux/diagnostics/i2caux_diag.c    |   97 -
+ .../display/dc/i2caux/diagnostics/i2caux_diag.h    |   32 -
+ drivers/gpu/drm/amd/display/dc/i2caux/engine.h     |  111 -
+ drivers/gpu/drm/amd/display/dc/i2caux/i2c_engine.c |  118 -
+ drivers/gpu/drm/amd/display/dc/i2caux/i2c_engine.h |  115 -
+ .../amd/display/dc/i2caux/i2c_generic_hw_engine.c  |  284 -
+ .../amd/display/dc/i2caux/i2c_generic_hw_engine.h  |   77 -
+ .../gpu/drm/amd/display/dc/i2caux/i2c_hw_engine.c  |  251 -
+ .../gpu/drm/amd/display/dc/i2caux/i2c_hw_engine.h  |   80 -
+ .../gpu/drm/amd/display/dc/i2caux/i2c_sw_engine.c  |  601 --
+ .../gpu/drm/amd/display/dc/i2caux/i2c_sw_engine.h  |   81 -
+ drivers/gpu/drm/amd/display/dc/i2caux/i2caux.c     |  491 --
+ drivers/gpu/drm/amd/display/dc/i2caux/i2caux.h     |  122 -
+ drivers/gpu/drm/amd/display/dc/inc/clock_source.h  |   12 +-
+ drivers/gpu/drm/amd/display/dc/inc/core_status.h   |    2 +-
+ drivers/gpu/drm/amd/display/dc/inc/core_types.h    |    9 +-
+ drivers/gpu/drm/amd/display/dc/inc/dc_link_ddc.h   |   17 +-
+ drivers/gpu/drm/amd/display/dc/inc/hw/abm.h        |    1 +
+ drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h   |   19 +
+ drivers/gpu/drm/amd/display/dc/inc/hw/dmcu.h       |   16 +-
+ drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h        |    5 +
+ drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h       |    3 +-
+ .../gpu/drm/amd/display/dc/inc/hw/link_encoder.h   |    1 +
+ drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h  |    4 +-
+ .../gpu/drm/amd/display/dc/inc/hw/stream_encoder.h |    4 +
+ .../drm/amd/display/dc/inc/hw/timing_generator.h   |   17 +-
+ .../dc/{i2caux/engine_base.c => inc/hw/vmid.h}     |   45 +-
+ drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h  |   14 +
+ .../i2c_sw_engine_dce110.h => inc/vm_helper.h}     |   39 +-
+ drivers/gpu/drm/amd/display/dc/irq_types.h         |    8 +
+ .../drm/amd/display/include/bios_parser_types.h    |    4 +-
+ drivers/gpu/drm/amd/display/include/dal_asic_id.h  |    3 +
+ .../gpu/drm/amd/display/include/gpio_interface.h   |    8 +
+ .../gpu/drm/amd/display/include/i2caux_interface.h |   33 +-
+ .../drm/amd/display/modules/color/color_gamma.c    |  165 +-
+ .../drm/amd/display/modules/freesync/freesync.c    |  113 +-
+ .../gpu/drm/amd/display/modules/inc/mod_freesync.h |    4 +-
+ .../gpu/drm/amd/display/modules/inc/mod_shared.h   |    3 +-
+ .../drm/amd/display/modules/power/power_helpers.c  |  612 +-
+ .../amd/include/asic_reg/nbio/nbio_6_1_offset.h    |    2 +
+ .../amd/include/asic_reg/nbio/nbio_6_1_sh_mask.h   |    4 +
+ .../drm/amd/include/asic_reg/nbio/nbio_6_1_smn.h   |   58 +
+ .../drm/amd/include/asic_reg/nbio/nbio_7_0_smn.h   |   54 +
+ .../drm/amd/include/asic_reg/nbio/nbio_7_4_0_smn.h |   53 +
+ .../amd/include/asic_reg/nbio/nbio_7_4_offset.h    |    2 +
+ .../amd/include/asic_reg/nbio/nbio_7_4_sh_mask.h   |    3 +
+ .../amd/include/asic_reg/thm/thm_11_0_2_offset.h   |    3 +
+ drivers/gpu/drm/amd/include/atombios.h             |    2 +-
+ drivers/gpu/drm/amd/include/kgd_kfd_interface.h    |   72 +-
+ drivers/gpu/drm/amd/include/kgd_pp_interface.h     |    8 +
+ drivers/gpu/drm/amd/powerplay/amd_powerplay.c      |   96 +
+ drivers/gpu/drm/amd/powerplay/hwmgr/Makefile       |    2 +-
+ drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c  |  101 +
+ .../hwmgr/common_baco.h}                           |   39 +-
+ .../gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c  |    9 -
+ drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c        |   10 +-
+ drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.c       |   11 +-
+ drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.h       |    2 +-
+ drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c |   30 +-
+ drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h |    4 +-
+ drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c  |    8 +-
+ drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c   |    8 +-
+ .../gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c   |    2 +-
+ drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c   |    8 +-
+ drivers/gpu/drm/amd/powerplay/hwmgr/vega10_baco.c  |  158 +
+ .../hwmgr/vega10_baco.h}                           |   22 +-
+ drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c |  200 +-
+ drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h |    1 +
+ .../gpu/drm/amd/powerplay/hwmgr/vega10_pptable.h   |   24 +
+ .../amd/powerplay/hwmgr/vega10_processpptables.c   |   50 +-
+ .../gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c   |   37 +
+ .../gpu/drm/amd/powerplay/hwmgr/vega10_thermal.h   |    1 +
+ drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c |  198 +-
+ drivers/gpu/drm/amd/powerplay/hwmgr/vega20_baco.c  |  103 +
+ .../hwmgr/vega20_baco.h}                           |   18 +-
+ drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c |  569 +-
+ drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.h |   10 +
+ drivers/gpu/drm/amd/powerplay/hwmgr/vega20_inc.h   |    1 +
+ .../amd/powerplay/hwmgr/vega20_processpptables.c   |   17 +
+ .../gpu/drm/amd/powerplay/inc/hardwaremanager.h    |    1 -
+ drivers/gpu/drm/amd/powerplay/inc/hwmgr.h          |   12 +-
+ .../drm/amd/powerplay/smumgr/polaris10_smumgr.c    |    2 +
+ drivers/gpu/drm/amd/powerplay/smumgr/smu9_smumgr.c |    6 +-
+ drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c      |    4 +
+ .../gpu/drm/amd/powerplay/smumgr/vega20_smumgr.c   |    6 +-
+ drivers/gpu/drm/arc/arcpgu_crtc.c                  |    4 +-
+ drivers/gpu/drm/arc/arcpgu_drv.c                   |   10 +-
+ drivers/gpu/drm/arc/arcpgu_sim.c                   |    4 +-
+ drivers/gpu/drm/arm/Kconfig                        |   12 +-
+ drivers/gpu/drm/arm/Makefile                       |    1 +
+ drivers/gpu/drm/arm/display/Kbuild                 |    3 +
+ drivers/gpu/drm/arm/display/Kconfig                |   14 +
+ drivers/gpu/drm/arm/display/include/malidp_io.h    |   42 +
+ .../gpu/drm/arm/display/include/malidp_product.h   |   23 +
+ drivers/gpu/drm/arm/display/include/malidp_utils.h |   16 +
+ drivers/gpu/drm/arm/display/komeda/Makefile        |   21 +
+ drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c   |  111 +
+ drivers/gpu/drm/arm/display/komeda/komeda_crtc.c   |  110 +
+ drivers/gpu/drm/arm/display/komeda/komeda_dev.c    |  190 +
+ drivers/gpu/drm/arm/display/komeda/komeda_dev.h    |  110 +
+ drivers/gpu/drm/arm/display/komeda/komeda_drv.c    |  144 +
+ .../drm/arm/display/komeda/komeda_format_caps.c    |   75 +
+ .../drm/arm/display/komeda/komeda_format_caps.h    |   89 +
+ .../drm/arm/display/komeda/komeda_framebuffer.c    |  167 +
+ .../drm/arm/display/komeda/komeda_framebuffer.h    |   34 +
+ drivers/gpu/drm/arm/display/komeda/komeda_kms.c    |  171 +
+ drivers/gpu/drm/arm/display/komeda/komeda_kms.h    |  114 +
+ .../gpu/drm/arm/display/komeda/komeda_pipeline.c   |  202 +
+ .../gpu/drm/arm/display/komeda/komeda_pipeline.h   |  359 +
+ drivers/gpu/drm/arm/display/komeda/komeda_plane.c  |  109 +
+ .../drm/arm/display/komeda/komeda_private_obj.c    |   88 +
+ drivers/gpu/drm/arm/hdlcd_crtc.c                   |    4 +-
+ drivers/gpu/drm/arm/hdlcd_drv.c                    |    6 +-
+ drivers/gpu/drm/arm/malidp_crtc.c                  |    2 +-
+ drivers/gpu/drm/arm/malidp_drv.c                   |    2 +-
+ drivers/gpu/drm/arm/malidp_mw.c                    |    2 +-
+ drivers/gpu/drm/armada/armada_510.c                |    2 +-
+ drivers/gpu/drm/armada/armada_crtc.c               |   10 +-
+ drivers/gpu/drm/armada/armada_crtc.h               |    2 +
+ drivers/gpu/drm/armada/armada_drv.c                |    2 +-
+ drivers/gpu/drm/armada/armada_fb.c                 |    2 +-
+ drivers/gpu/drm/ast/ast_drv.c                      |    1 +
+ drivers/gpu/drm/ast/ast_fb.c                       |    6 +-
+ drivers/gpu/drm/ast/ast_main.c                     |    6 +-
+ drivers/gpu/drm/ast/ast_mode.c                     |    1 +
+ drivers/gpu/drm/ati_pcigart.c                      |    7 +-
+ drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c     |    2 +-
+ drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c       |    2 +-
+ drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h       |    2 +-
+ drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c    |  181 +-
+ drivers/gpu/drm/bochs/Makefile                     |    2 +-
+ drivers/gpu/drm/bochs/bochs.h                      |   23 +-
+ drivers/gpu/drm/bochs/bochs_drv.c                  |   36 +-
+ drivers/gpu/drm/bochs/bochs_fbdev.c                |  163 -
+ drivers/gpu/drm/bochs/bochs_hw.c                   |   26 +-
+ drivers/gpu/drm/bochs/bochs_kms.c                  |  219 +-
+ drivers/gpu/drm/bochs/bochs_mm.c                   |   69 +-
+ drivers/gpu/drm/bridge/Kconfig                     |    1 +
+ drivers/gpu/drm/bridge/adv7511/adv7511.h           |    8 +-
+ drivers/gpu/drm/bridge/adv7511/adv7511_drv.c       |    9 +-
+ drivers/gpu/drm/bridge/adv7511/adv7533.c           |    2 +-
+ drivers/gpu/drm/bridge/analogix-anx78xx.c          |   11 +-
+ drivers/gpu/drm/bridge/analogix/analogix_dp_core.c |    6 +-
+ drivers/gpu/drm/bridge/cdns-dsi.c                  |  542 +-
+ drivers/gpu/drm/bridge/dumb-vga-dac.c              |    2 +-
+ drivers/gpu/drm/bridge/lvds-encoder.c              |   53 +-
+ .../drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c   |    2 +-
+ drivers/gpu/drm/bridge/nxp-ptn3460.c               |    2 +-
+ drivers/gpu/drm/bridge/panel.c                     |   24 +-
+ drivers/gpu/drm/bridge/parade-ps8622.c             |    2 +-
+ drivers/gpu/drm/bridge/sii902x.c                   |    9 +-
+ drivers/gpu/drm/bridge/sil-sii8620.c               |    3 +-
+ .../gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c    |    1 -
+ .../gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c    |    9 +-
+ drivers/gpu/drm/bridge/synopsys/dw-hdmi.c          |  151 +-
+ drivers/gpu/drm/bridge/synopsys/dw-hdmi.h          |    1 +
+ drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c      |   20 +-
+ drivers/gpu/drm/bridge/tc358764.c                  |    2 +-
+ drivers/gpu/drm/bridge/tc358767.c                  |   11 +-
+ drivers/gpu/drm/bridge/ti-sn65dsi86.c              |    2 +-
+ drivers/gpu/drm/bridge/ti-tfp410.c                 |    2 +-
+ drivers/gpu/drm/cirrus/cirrus_drv.c                |    1 +
+ drivers/gpu/drm/cirrus/cirrus_fbdev.c              |    3 +
+ drivers/gpu/drm/cirrus/cirrus_mode.c               |   71 +-
+ drivers/gpu/drm/drm_agpsupport.c                   |    2 +-
+ drivers/gpu/drm/drm_atomic.c                       |   19 +-
+ drivers/gpu/drm/drm_atomic_helper.c                |   78 +-
+ drivers/gpu/drm/drm_atomic_uapi.c                  |    4 +-
+ drivers/gpu/drm/drm_bridge.c                       |    4 +-
+ drivers/gpu/drm/drm_bufs.c                         |   15 +-
+ drivers/gpu/drm/drm_color_mgmt.c                   |   43 +
+ drivers/gpu/drm/drm_connector.c                    |   95 +-
+ drivers/gpu/drm/drm_context.c                      |   15 +-
+ drivers/gpu/drm/drm_crtc.c                         |   41 -
+ drivers/gpu/drm/drm_crtc_helper.c                  |   58 +-
+ drivers/gpu/drm/drm_crtc_internal.h                |    1 +
+ drivers/gpu/drm/drm_damage_helper.c                |   42 +
+ drivers/gpu/drm/drm_dp_helper.c                    |   61 +-
+ drivers/gpu/drm/drm_dp_mst_topology.c              | 1153 +++-
+ drivers/gpu/drm/drm_drv.c                          |   24 +-
+ drivers/gpu/drm/drm_dsc.c                          |   30 +-
+ drivers/gpu/drm/drm_edid.c                         |  101 +-
+ drivers/gpu/drm/drm_fb_cma_helper.c                |  137 +-
+ drivers/gpu/drm/drm_fb_helper.c                    |  171 +-
+ drivers/gpu/drm/drm_file.c                         |   24 +-
+ drivers/gpu/drm/drm_flip_work.c                    |    1 +
+ drivers/gpu/drm/drm_fourcc.c                       |    9 +
+ drivers/gpu/drm/drm_framebuffer.c                  |    3 +-
+ drivers/gpu/drm/drm_gem.c                          |   38 +-
+ drivers/gpu/drm/drm_gem_framebuffer_helper.c       |   50 +-
+ drivers/gpu/drm/drm_internal.h                     |    2 +
+ drivers/gpu/drm/drm_ioc32.c                        |    6 +-
+ drivers/gpu/drm/drm_ioctl.c                        |   22 +-
+ drivers/gpu/drm/drm_irq.c                          |   10 +-
+ drivers/gpu/drm/drm_lease.c                        |    6 +-
+ drivers/gpu/drm/drm_mm.c                           |    2 +-
+ drivers/gpu/drm/drm_mode_config.c                  |    5 +-
+ drivers/gpu/drm/drm_mode_object.c                  |    9 +-
+ drivers/gpu/drm/drm_modes.c                        |   11 +-
+ drivers/gpu/drm/drm_modeset_helper.c               |    4 +-
+ drivers/gpu/drm/drm_modeset_lock.c                 |    8 +
+ drivers/gpu/drm/drm_of.c                           |    4 +-
+ drivers/gpu/drm/drm_panel.c                        |    3 +
+ drivers/gpu/drm/drm_plane.c                        |    3 +
+ drivers/gpu/drm/drm_probe_helper.c                 |    2 +-
+ drivers/gpu/drm/drm_property.c                     |    2 +-
+ drivers/gpu/drm/drm_rect.c                         |  108 -
+ drivers/gpu/drm/drm_simple_kms_helper.c            |    2 +-
+ drivers/gpu/drm/drm_syncobj.c                      |   91 +-
+ drivers/gpu/drm/drm_vblank.c                       |   47 +-
+ drivers/gpu/drm/etnaviv/Kconfig                    |    1 -
+ drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h           |    2 -
+ drivers/gpu/drm/etnaviv/etnaviv_drv.h              |    1 -
+ drivers/gpu/drm/etnaviv/etnaviv_dump.c             |    2 +-
+ drivers/gpu/drm/etnaviv/etnaviv_gem.c              |    2 +-
+ drivers/gpu/drm/etnaviv/etnaviv_gem.h              |    1 +
+ drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c        |    2 +-
+ drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c       |    2 +-
+ drivers/gpu/drm/etnaviv/etnaviv_iommu_v2.c         |    4 +-
+ drivers/gpu/drm/etnaviv/etnaviv_perfmon.c          |    6 +-
+ drivers/gpu/drm/etnaviv/etnaviv_sched.c            |   13 +-
+ drivers/gpu/drm/exynos/exynos_dp.c                 |    3 +-
+ drivers/gpu/drm/exynos/exynos_drm_crtc.c           |    2 +-
+ drivers/gpu/drm/exynos/exynos_drm_dpi.c            |    4 +-
+ drivers/gpu/drm/exynos/exynos_drm_drv.c            |    2 +-
+ drivers/gpu/drm/exynos/exynos_drm_dsi.c            |    4 +-
+ drivers/gpu/drm/exynos/exynos_drm_fb.c             |    6 +-
+ drivers/gpu/drm/exynos/exynos_drm_fbdev.c          |    3 +-
+ drivers/gpu/drm/exynos/exynos_drm_mic.c            |    4 +-
+ drivers/gpu/drm/exynos/exynos_drm_rotator.c        |   23 +
+ drivers/gpu/drm/exynos/exynos_drm_scaler.c         |    2 +-
+ drivers/gpu/drm/exynos/exynos_drm_vidi.c           |    4 +-
+ drivers/gpu/drm/exynos/exynos_hdmi.c               |    7 +-
+ drivers/gpu/drm/exynos/regs-scaler.h               |    2 +-
+ drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c         |    2 +-
+ drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c          |    4 +-
+ drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c          |    2 +-
+ drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c        |    2 +-
+ drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c          |    2 +-
+ drivers/gpu/drm/gma500/framebuffer.c               |    1 -
+ drivers/gpu/drm/gma500/psb_drv.c                   |    3 +-
+ drivers/gpu/drm/gma500/psb_intel_drv.h             |    1 +
+ drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c     |    2 +-
+ drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c    |    5 +-
+ drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c  |    2 +-
+ drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c   |    2 +-
+ drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c       |   13 +-
+ drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c    |    8 +-
+ drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c    |   44 +-
+ drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h    |    4 -
+ drivers/gpu/drm/i2c/ch7006_drv.c                   |    6 +-
+ drivers/gpu/drm/i2c/ch7006_priv.h                  |    1 +
+ drivers/gpu/drm/i2c/sil164_drv.c                   |    2 +-
+ drivers/gpu/drm/i2c/tda998x_drv.c                  |   12 +-
+ drivers/gpu/drm/i915/Kconfig.debug                 |    3 +-
+ drivers/gpu/drm/i915/Makefile                      |   12 +-
+ drivers/gpu/drm/i915/dvo.h                         |    1 -
+ drivers/gpu/drm/i915/gvt/Makefile                  |    1 -
+ drivers/gpu/drm/i915/gvt/aperture_gm.c             |    8 +-
+ drivers/gpu/drm/i915/gvt/cmd_parser.c              |   83 +-
+ drivers/gpu/drm/i915/gvt/display.c                 |   43 +-
+ drivers/gpu/drm/i915/gvt/display.h                 |   37 +-
+ drivers/gpu/drm/i915/gvt/dmabuf.c                  |    5 +-
+ drivers/gpu/drm/i915/gvt/edid.c                    |   32 +-
+ drivers/gpu/drm/i915/gvt/fb_decoder.c              |   12 +-
+ drivers/gpu/drm/i915/gvt/gvt.c                     |  109 +-
+ drivers/gpu/drm/i915/gvt/gvt.h                     |   11 +-
+ drivers/gpu/drm/i915/gvt/handlers.c                |   29 +-
+ drivers/gpu/drm/i915/gvt/hypercall.h               |   10 +-
+ drivers/gpu/drm/i915/gvt/interrupt.c               |    4 +-
+ drivers/gpu/drm/i915/gvt/kvmgt.c                   |  185 +-
+ drivers/gpu/drm/i915/gvt/mmio.c                    |    6 +-
+ drivers/gpu/drm/i915/gvt/mmio.h                    |   11 +-
+ drivers/gpu/drm/i915/gvt/mmio_context.c            |   18 +-
+ drivers/gpu/drm/i915/gvt/mpt.h                     |   30 +-
+ drivers/gpu/drm/i915/gvt/sched_policy.c            |    4 +-
+ drivers/gpu/drm/i915/gvt/scheduler.c               |   11 +-
+ drivers/gpu/drm/i915/gvt/scheduler.h               |    2 +-
+ drivers/gpu/drm/i915/gvt/trace.h                   |    2 +-
+ drivers/gpu/drm/i915/gvt/vgpu.c                    |   10 +-
+ drivers/gpu/drm/i915/i915_active.c                 |  300 +
+ drivers/gpu/drm/i915/i915_active.h                 |  425 ++
+ drivers/gpu/drm/i915/i915_active_types.h           |   36 +
+ drivers/gpu/drm/i915/i915_cmd_parser.c             |    2 +-
+ drivers/gpu/drm/i915/i915_debugfs.c                | 1064 ++-
+ drivers/gpu/drm/i915/i915_drv.c                    |  318 +-
+ drivers/gpu/drm/i915/i915_drv.h                    |  519 +-
+ drivers/gpu/drm/i915/i915_gem.c                    |  964 +--
+ drivers/gpu/drm/i915/i915_gem_context.c            |  388 +-
+ drivers/gpu/drm/i915/i915_gem_context.h            |   26 +
+ drivers/gpu/drm/i915/i915_gem_dmabuf.c             |    1 -
+ drivers/gpu/drm/i915/i915_gem_evict.c              |   90 +-
+ drivers/gpu/drm/i915/i915_gem_execbuffer.c         |   89 +-
+ drivers/gpu/drm/i915/i915_gem_fence_reg.c          |   29 +-
+ drivers/gpu/drm/i915/i915_gem_fence_reg.h          |    1 -
+ drivers/gpu/drm/i915/i915_gem_gtt.c                |  229 +-
+ drivers/gpu/drm/i915/i915_gem_gtt.h                |   57 +-
+ drivers/gpu/drm/i915/i915_gem_internal.c           |    1 -
+ drivers/gpu/drm/i915/i915_gem_object.h             |   57 +-
+ drivers/gpu/drm/i915/i915_gem_shrinker.c           |  175 +-
+ drivers/gpu/drm/i915/i915_gem_stolen.c             |   13 +-
+ drivers/gpu/drm/i915/i915_gem_tiling.c             |    5 +-
+ drivers/gpu/drm/i915/i915_gem_userptr.c            |  225 +-
+ drivers/gpu/drm/i915/i915_gpu_error.c              |  296 +-
+ drivers/gpu/drm/i915/i915_gpu_error.h              |   41 +-
+ drivers/gpu/drm/i915/i915_ioc32.c                  |    2 +-
+ drivers/gpu/drm/i915/i915_irq.c                    |  475 +-
+ drivers/gpu/drm/i915/i915_params.c                 |   38 +-
+ drivers/gpu/drm/i915/i915_params.h                 |   13 +-
+ drivers/gpu/drm/i915/i915_pci.c                    |   33 +-
+ drivers/gpu/drm/i915/i915_perf.c                   |   33 +-
+ drivers/gpu/drm/i915/i915_pmu.c                    |   39 +-
+ drivers/gpu/drm/i915/i915_pmu.h                    |    4 +-
+ drivers/gpu/drm/i915/i915_query.c                  |    2 +-
+ drivers/gpu/drm/i915/i915_reg.h                    |  300 +-
+ drivers/gpu/drm/i915/i915_request.c                |  452 +-
+ drivers/gpu/drm/i915/i915_request.h                |  497 +-
+ drivers/gpu/drm/i915/i915_reset.c                  | 1349 ++++
+ drivers/gpu/drm/i915/i915_reset.h                  |   59 +
+ drivers/gpu/drm/i915/i915_scheduler.c              |   56 +-
+ drivers/gpu/drm/i915/i915_selftest.h               |    1 +
+ drivers/gpu/drm/i915/i915_suspend.c                |   17 +-
+ drivers/gpu/drm/i915/i915_sw_fence.c               |    2 +-
+ drivers/gpu/drm/i915/i915_sysfs.c                  |   27 +-
+ drivers/gpu/drm/i915/i915_timeline.c               |  257 +-
+ drivers/gpu/drm/i915/i915_timeline.h               |   61 +-
+ drivers/gpu/drm/i915/i915_trace.h                  |   57 +-
+ drivers/gpu/drm/i915/i915_utils.h                  |    6 -
+ drivers/gpu/drm/i915/i915_vma.c                    |  261 +-
+ drivers/gpu/drm/i915/i915_vma.h                    |   58 +-
+ drivers/gpu/drm/i915/icl_dsi.c                     |   45 +-
+ drivers/gpu/drm/i915/intel_acpi.c                  |    1 -
+ drivers/gpu/drm/i915/intel_atomic.c                |    9 +-
+ drivers/gpu/drm/i915/intel_atomic_plane.c          |   43 +-
+ drivers/gpu/drm/i915/intel_audio.c                 |   10 +-
+ drivers/gpu/drm/i915/intel_bios.c                  |   30 +-
+ drivers/gpu/drm/i915/intel_breadcrumbs.c           |  909 +--
+ drivers/gpu/drm/i915/intel_cdclk.c                 |   60 +-
+ drivers/gpu/drm/i915/intel_color.c                 |  411 +-
+ drivers/gpu/drm/i915/intel_connector.c             |    5 +-
+ drivers/gpu/drm/i915/intel_crt.c                   |   91 +-
+ drivers/gpu/drm/i915/intel_csr.c                   |   93 +-
+ drivers/gpu/drm/i915/intel_ddi.c                   |  216 +-
+ drivers/gpu/drm/i915/intel_device_info.c           |  107 +-
+ drivers/gpu/drm/i915/intel_device_info.h           |   35 +-
+ drivers/gpu/drm/i915/intel_display.c               |  876 ++-
+ drivers/gpu/drm/i915/intel_display.h               |   22 +-
+ drivers/gpu/drm/i915/intel_dp.c                    |  643 +-
+ drivers/gpu/drm/i915/intel_dp_link_training.c      |   32 +-
+ drivers/gpu/drm/i915/intel_dp_mst.c                |   97 +-
+ drivers/gpu/drm/i915/intel_dpio_phy.c              |   18 +-
+ drivers/gpu/drm/i915/intel_dpll_mgr.c              |  302 +-
+ drivers/gpu/drm/i915/intel_dpll_mgr.h              |   55 +-
+ drivers/gpu/drm/i915/intel_drv.h                   |  231 +-
+ drivers/gpu/drm/i915/intel_dsi.h                   |    6 +-
+ drivers/gpu/drm/i915/intel_dsi_vbt.c               |   24 +-
+ drivers/gpu/drm/i915/intel_dvo.c                   |   12 +-
+ drivers/gpu/drm/i915/intel_engine_cs.c             |  430 +-
+ drivers/gpu/drm/i915/intel_fbc.c                   |   35 +-
+ drivers/gpu/drm/i915/intel_fbdev.c                 |   12 +-
+ drivers/gpu/drm/i915/intel_fifo_underrun.c         |   24 +-
+ drivers/gpu/drm/i915/intel_frontbuffer.c           |    1 -
+ drivers/gpu/drm/i915/intel_gpu_commands.h          |    1 -
+ drivers/gpu/drm/i915/intel_guc.h                   |    3 +
+ drivers/gpu/drm/i915/intel_guc_fw.c                |    6 +-
+ drivers/gpu/drm/i915/intel_guc_log.c               |   32 +-
+ drivers/gpu/drm/i915/intel_guc_submission.c        |   25 +-
+ drivers/gpu/drm/i915/intel_gvt.c                   |   12 +-
+ drivers/gpu/drm/i915/intel_hangcheck.c             |  207 +-
+ drivers/gpu/drm/i915/intel_hdcp.c                  |   21 +-
+ drivers/gpu/drm/i915/intel_hdmi.c                  |   59 +-
+ drivers/gpu/drm/i915/intel_hotplug.c               |    8 +-
+ drivers/gpu/drm/i915/intel_huc.c                   |    8 +-
+ drivers/gpu/drm/i915/intel_huc_fw.c                |    7 +-
+ drivers/gpu/drm/i915/intel_i2c.c                   |   23 +-
+ drivers/gpu/drm/i915/intel_lpe_audio.c             |    1 +
+ drivers/gpu/drm/i915/intel_lrc.c                   |  703 +-
+ drivers/gpu/drm/i915/intel_lrc.h                   |   12 +-
+ drivers/gpu/drm/i915/intel_lspcon.c                |   36 +-
+ drivers/gpu/drm/i915/intel_lvds.c                  |   49 +-
+ drivers/gpu/drm/i915/intel_mocs.c                  |  408 +-
+ drivers/gpu/drm/i915/intel_mocs.h                  |    1 -
+ drivers/gpu/drm/i915/intel_opregion.c              |    1 -
+ drivers/gpu/drm/i915/intel_overlay.c               |   48 +-
+ drivers/gpu/drm/i915/intel_panel.c                 |  102 +-
+ drivers/gpu/drm/i915/intel_pipe_crc.c              |   32 +-
+ drivers/gpu/drm/i915/intel_pm.c                    | 1229 ++--
+ drivers/gpu/drm/i915/intel_psr.c                   |   83 +-
+ drivers/gpu/drm/i915/intel_ringbuffer.c            |  699 +-
+ drivers/gpu/drm/i915/intel_ringbuffer.h            |  289 +-
+ drivers/gpu/drm/i915/intel_runtime_pm.c            |  594 +-
+ drivers/gpu/drm/i915/intel_sdvo.c                  |  123 +-
+ drivers/gpu/drm/i915/intel_sprite.c                |  145 +-
+ drivers/gpu/drm/i915/intel_tv.c                    |  727 ++-
+ drivers/gpu/drm/i915/intel_uc.c                    |   15 +-
+ drivers/gpu/drm/i915/intel_uc.h                    |    6 +-
+ drivers/gpu/drm/i915/intel_uc_fw.c                 |   11 +-
+ drivers/gpu/drm/i915/intel_uncore.c                |  511 +-
+ drivers/gpu/drm/i915/intel_vdsc.c                  |    5 +-
+ drivers/gpu/drm/i915/intel_wopcm.c                 |    6 +-
+ drivers/gpu/drm/i915/intel_workarounds.c           |  199 +-
+ drivers/gpu/drm/i915/selftests/huge_pages.c        |   42 +-
+ drivers/gpu/drm/i915/selftests/i915_active.c       |  157 +
+ drivers/gpu/drm/i915/selftests/i915_gem.c          |   47 +-
+ .../gpu/drm/i915/selftests/i915_gem_coherency.c    |    5 +-
+ drivers/gpu/drm/i915/selftests/i915_gem_context.c  |  606 +-
+ drivers/gpu/drm/i915/selftests/i915_gem_evict.c    |  105 +-
+ drivers/gpu/drm/i915/selftests/i915_gem_gtt.c      |  123 +-
+ drivers/gpu/drm/i915/selftests/i915_gem_object.c   |   22 +-
+ .../gpu/drm/i915/selftests/i915_live_selftests.h   |    2 +
+ .../gpu/drm/i915/selftests/i915_mock_selftests.h   |    3 +-
+ drivers/gpu/drm/i915/selftests/i915_random.c       |   33 +-
+ drivers/gpu/drm/i915/selftests/i915_random.h       |    3 +
+ drivers/gpu/drm/i915/selftests/i915_request.c      |  524 +-
+ drivers/gpu/drm/i915/selftests/i915_selftest.c     |   47 +
+ drivers/gpu/drm/i915/selftests/i915_timeline.c     |  464 +-
+ drivers/gpu/drm/i915/selftests/i915_vma.c          |   81 +-
+ drivers/gpu/drm/i915/selftests/igt_live_test.c     |   78 +
+ drivers/gpu/drm/i915/selftests/igt_live_test.h     |   35 +
+ drivers/gpu/drm/i915/selftests/igt_spinner.c       |   91 +-
+ drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c |  470 --
+ drivers/gpu/drm/i915/selftests/intel_guc.c         |   10 +-
+ drivers/gpu/drm/i915/selftests/intel_hangcheck.c   |  417 +-
+ drivers/gpu/drm/i915/selftests/intel_lrc.c         |  272 +-
+ drivers/gpu/drm/i915/selftests/intel_workarounds.c |  123 +-
+ drivers/gpu/drm/i915/selftests/lib_sw_fence.c      |   54 +
+ drivers/gpu/drm/i915/selftests/lib_sw_fence.h      |    3 +
+ drivers/gpu/drm/i915/selftests/mock_context.c      |    7 +-
+ drivers/gpu/drm/i915/selftests/mock_engine.c       |  162 +-
+ drivers/gpu/drm/i915/selftests/mock_engine.h       |    6 -
+ drivers/gpu/drm/i915/selftests/mock_gem_device.c   |   26 +-
+ drivers/gpu/drm/i915/selftests/mock_gtt.c          |   15 +-
+ drivers/gpu/drm/i915/selftests/mock_gtt.h          |    4 +-
+ drivers/gpu/drm/i915/selftests/mock_timeline.c     |    6 +-
+ drivers/gpu/drm/i915/vlv_dsi.c                     |   55 +-
+ drivers/gpu/drm/i915/vlv_dsi_pll.c                 |   31 +-
+ drivers/gpu/drm/imx/Kconfig                        |    3 +-
+ drivers/gpu/drm/imx/dw_hdmi-imx.c                  |    2 +-
+ drivers/gpu/drm/imx/imx-drm-core.c                 |   13 +-
+ drivers/gpu/drm/imx/imx-ldb.c                      |    2 +-
+ drivers/gpu/drm/imx/imx-tve.c                      |    2 +-
+ drivers/gpu/drm/imx/ipuv3-crtc.c                   |   42 +-
+ drivers/gpu/drm/imx/ipuv3-plane.c                  |   76 +-
+ drivers/gpu/drm/imx/ipuv3-plane.h                  |    2 +
+ drivers/gpu/drm/imx/parallel-display.c             |    2 +-
+ drivers/gpu/drm/mediatek/mtk_dpi.c                 |    2 +-
+ drivers/gpu/drm/mediatek/mtk_drm_crtc.c            |    2 +-
+ drivers/gpu/drm/mediatek/mtk_drm_drv.c             |    2 +-
+ drivers/gpu/drm/mediatek/mtk_drm_fb.c              |    2 +-
+ drivers/gpu/drm/mediatek/mtk_dsi.c                 |    2 +-
+ drivers/gpu/drm/mediatek/mtk_hdmi.c                |    9 +-
+ drivers/gpu/drm/meson/meson_crtc.c                 |    2 +-
+ drivers/gpu/drm/meson/meson_drv.c                  |   30 +-
+ drivers/gpu/drm/meson/meson_dw_hdmi.c              |   37 +-
+ drivers/gpu/drm/meson/meson_venc.c                 |    2 +
+ drivers/gpu/drm/meson/meson_venc_cvbs.c            |    4 +-
+ drivers/gpu/drm/mga/mga_drv.c                      |    2 +-
+ drivers/gpu/drm/mgag200/mgag200_fb.c               |    1 +
+ drivers/gpu/drm/mgag200/mgag200_main.c             |    8 +-
+ drivers/gpu/drm/mgag200/mgag200_mode.c             |    1 +
+ drivers/gpu/drm/msm/Kconfig                        |    1 +
+ drivers/gpu/drm/msm/adreno/a6xx_gmu.c              |   20 +
+ drivers/gpu/drm/msm/adreno/adreno_gpu.c            |    9 +
+ drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c           |   13 +-
+ drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h           |    2 -
+ drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c        |   34 +-
+ drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h        |   13 +-
+ drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h   |    3 +-
+ .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c   |    5 +-
+ .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c   |    5 +-
+ drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c        |   37 +-
+ drivers/gpu/drm/msm/disp/dpu1/dpu_formats.h        |   14 -
+ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c     |    4 +
+ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h     |   19 +-
+ .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog_format.h  |  220 +-
+ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c  |   44 -
+ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.h  |   44 -
+ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h        |    7 -
+ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h        |    1 -
+ drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c            |   65 +-
+ drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c           |   36 +-
+ drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c          |   51 +-
+ drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h          |   27 -
+ drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c             |  325 +-
+ drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h             |   28 +-
+ drivers/gpu/drm/msm/disp/dpu1/dpu_trace.h          |   28 +-
+ drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c          |   12 +-
+ drivers/gpu/drm/msm/disp/mdp4/mdp4_dsi_encoder.c   |   11 +-
+ drivers/gpu/drm/msm/disp/mdp4/mdp4_dtv_encoder.c   |   11 +-
+ drivers/gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c  |   11 +-
+ drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c   |   11 +-
+ drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c          |   11 +-
+ drivers/gpu/drm/msm/disp/mdp5/mdp5_encoder.c       |   11 +-
+ drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c           |    2 +-
+ drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c           |    1 +
+ drivers/gpu/drm/msm/dsi/dsi.h                      |    2 +-
+ drivers/gpu/drm/msm/dsi/dsi_host.c                 |    2 +-
+ drivers/gpu/drm/msm/dsi/dsi_manager.c              |   13 +-
+ drivers/gpu/drm/msm/edp/edp_bridge.c               |   13 +-
+ drivers/gpu/drm/msm/hdmi/hdmi_bridge.c             |    7 +-
+ drivers/gpu/drm/msm/msm_drv.c                      |  129 +-
+ drivers/gpu/drm/msm/msm_drv.h                      |   12 +-
+ drivers/gpu/drm/msm/msm_fb.c                       |    2 +-
+ drivers/gpu/drm/msm/msm_gem.c                      |    2 +-
+ drivers/gpu/drm/msm/msm_gpu.h                      |    3 +
+ drivers/gpu/drm/mxsfb/mxsfb_crtc.c                 |    2 +-
+ drivers/gpu/drm/mxsfb/mxsfb_drv.c                  |   31 +-
+ drivers/gpu/drm/mxsfb/mxsfb_drv.h                  |    1 -
+ drivers/gpu/drm/mxsfb/mxsfb_out.c                  |    2 +-
+ drivers/gpu/drm/nouveau/Kbuild                     |    2 +
+ drivers/gpu/drm/nouveau/Kconfig                    |   12 +
+ drivers/gpu/drm/nouveau/dispnv04/crtc.c            |  214 +-
+ drivers/gpu/drm/nouveau/dispnv04/disp.c            |  216 +-
+ drivers/gpu/drm/nouveau/dispnv04/disp.h            |    5 +-
+ drivers/gpu/drm/nouveau/dispnv04/tvnv17.c          |    5 +-
+ drivers/gpu/drm/nouveau/dispnv50/atom.h            |    6 +
+ drivers/gpu/drm/nouveau/dispnv50/core.c            |    2 +-
+ drivers/gpu/drm/nouveau/dispnv50/curs.c            |    2 +-
+ drivers/gpu/drm/nouveau/dispnv50/disp.c            |  145 +-
+ drivers/gpu/drm/nouveau/dispnv50/head.c            |    1 +
+ drivers/gpu/drm/nouveau/dispnv50/wimm.c            |    2 +-
+ drivers/gpu/drm/nouveau/dispnv50/wndw.c            |    2 +-
+ drivers/gpu/drm/nouveau/include/nvif/class.h       |   13 +-
+ drivers/gpu/drm/nouveau/include/nvif/clb069.h      |   12 +
+ drivers/gpu/drm/nouveau/include/nvif/if000c.h      |   30 +-
+ drivers/gpu/drm/nouveau/include/nvif/ifc00d.h      |   21 +
+ drivers/gpu/drm/nouveau/include/nvif/vmm.h         |    4 +-
+ drivers/gpu/drm/nouveau/include/nvkm/core/device.h |    3 +
+ drivers/gpu/drm/nouveau/include/nvkm/engine/ce.h   |    2 +-
+ drivers/gpu/drm/nouveau/include/nvkm/engine/disp.h |    2 +-
+ drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h |    2 +-
+ drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h   |    3 +
+ .../gpu/drm/nouveau/include/nvkm/engine/nvdec.h    |    2 +
+ drivers/gpu/drm/nouveau/include/nvkm/engine/sec2.h |    3 +
+ drivers/gpu/drm/nouveau/include/nvkm/subdev/bar.h  |    2 +-
+ .../gpu/drm/nouveau/include/nvkm/subdev/devinit.h  |    2 +-
+ .../gpu/drm/nouveau/include/nvkm/subdev/fault.h    |    4 +-
+ drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h  |   14 +
+ drivers/gpu/drm/nouveau/include/nvkm/subdev/mc.h   |    2 +-
+ drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h  |    6 +-
+ drivers/gpu/drm/nouveau/include/nvkm/subdev/top.h  |    1 +
+ drivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h |    1 +
+ drivers/gpu/drm/nouveau/nouveau_abi16.c            |    4 +-
+ drivers/gpu/drm/nouveau/nouveau_bo.c               |    4 +-
+ drivers/gpu/drm/nouveau/nouveau_bo.h               |   12 +-
+ drivers/gpu/drm/nouveau/nouveau_chan.c             |   32 +-
+ drivers/gpu/drm/nouveau/nouveau_chan.h             |    1 +
+ drivers/gpu/drm/nouveau/nouveau_connector.c        |    1 +
+ drivers/gpu/drm/nouveau/nouveau_display.c          |  309 +-
+ drivers/gpu/drm/nouveau/nouveau_display.h          |   21 +-
+ drivers/gpu/drm/nouveau/nouveau_dmem.c             |  887 +++
+ drivers/gpu/drm/nouveau/nouveau_dmem.h             |   60 +
+ drivers/gpu/drm/nouveau/nouveau_drm.c              |  248 +-
+ drivers/gpu/drm/nouveau/nouveau_drv.h              |    6 +-
+ drivers/gpu/drm/nouveau/nouveau_fbcon.c            |    6 +-
+ drivers/gpu/drm/nouveau/nouveau_fence.h            |    2 -
+ drivers/gpu/drm/nouveau/nouveau_gem.c              |   46 +-
+ drivers/gpu/drm/nouveau/nouveau_svm.c              |  835 +++
+ drivers/gpu/drm/nouveau/nouveau_svm.h              |   48 +
+ drivers/gpu/drm/nouveau/nouveau_vmm.c              |    4 +-
+ drivers/gpu/drm/nouveau/nouveau_vmm.h              |    1 +
+ drivers/gpu/drm/nouveau/nv84_fence.c               |    3 +-
+ drivers/gpu/drm/nouveau/nvif/disp.c                |    2 +-
+ drivers/gpu/drm/nouveau/nvif/vmm.c                 |    5 +-
+ drivers/gpu/drm/nouveau/nvkm/core/subdev.c         |    1 +
+ drivers/gpu/drm/nouveau/nvkm/engine/ce/Kbuild      |    2 +-
+ .../nouveau/nvkm/engine/ce/{tu104.c => tu102.c}    |    6 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/device/base.c  |   86 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/device/priv.h  |    1 +
+ drivers/gpu/drm/nouveau/nvkm/engine/device/user.c  |   15 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild    |    6 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c   |   16 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c   |    7 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h     |    2 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c    |   12 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h    |    3 +
+ .../gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h    |    2 +-
+ .../nvkm/engine/disp/{roottu104.c => roottu102.c}  |   20 +-
+ .../nvkm/engine/disp/{sortu104.c => sortu102.c}    |   14 +-
+ .../nouveau/nvkm/engine/disp/{tu104.c => tu102.c}  |   14 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/fifo/Kbuild    |    6 +-
+ .../gpu/drm/nouveau/nvkm/engine/fifo/changk104.h   |    2 +-
+ .../engine/fifo/{gpfifotu104.c => gpfifotu102.c}   |   10 +-
+ .../nouveau/nvkm/engine/fifo/{tu104.c => tu102.c}  |   30 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/fifo/user.h    |    2 +-
+ .../nvkm/engine/fifo/{usertu104.c => usertu102.c}  |   10 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/gr/base.c      |   27 +
+ drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.c  |   10 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c     |  331 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h     |   16 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/gr/priv.h      |    5 +
+ drivers/gpu/drm/nouveau/nvkm/engine/nvdec/base.c   |   10 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/sec2/Kbuild    |    1 +
+ drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c    |   23 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/sec2/gp102.c   |    2 +-
+ drivers/gpu/drm/nouveau/nvkm/engine/sec2/priv.h    |    3 +-
+ .../nvkm/engine/sec2/tu102.c}                      |   21 +-
+ drivers/gpu/drm/nouveau/nvkm/falcon/base.c         |    3 +
+ drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue.c     |    6 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/Kbuild         |    1 +
+ drivers/gpu/drm/nouveau/nvkm/subdev/bar/Kbuild     |    2 +-
+ .../nouveau/nvkm/subdev/bar/{tu104.c => tu102.c}   |   30 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/bios/dp.c      |    2 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c    |   11 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/devinit/Kbuild |    2 +-
+ .../nvkm/subdev/devinit/{tu104.c => tu102.c}       |   14 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/fault/Kbuild   |    3 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c   |    2 +
+ drivers/gpu/drm/nouveau/nvkm/subdev/fault/gp100.c  |    3 +
+ drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c  |   16 +
+ drivers/gpu/drm/nouveau/nvkm/subdev/fault/priv.h   |    7 +
+ .../nouveau/nvkm/subdev/fault/{tu104.c => tu102.c} |   39 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/fault/user.c   |  106 +
+ drivers/gpu/drm/nouveau/nvkm/subdev/fb/gddr3.c     |    2 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/gsp/Kbuild     |    1 +
+ drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gv100.c    |   62 +
+ drivers/gpu/drm/nouveau/nvkm/subdev/mc/Kbuild      |    2 +-
+ .../nouveau/nvkm/subdev/mc/{tu104.c => tu102.c}    |   10 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/Kbuild     |    4 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp100.c    |    2 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp10b.c    |    2 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gv100.c    |    2 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/priv.h     |    2 +-
+ .../nouveau/nvkm/subdev/mmu/{tu104.c => tu102.c}   |    8 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c     |   83 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c      |  382 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h      |   82 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgf100.c |   56 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgk104.c |   10 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgk20a.c |   10 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgm200.c |   22 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgm20b.c |   14 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgp100.c |  210 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgp10b.c |   12 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgv100.c |   12 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmmcp77.c |    8 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv04.c  |   15 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv41.c  |    6 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv44.c  |    6 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv50.c  |    6 +-
+ .../nvkm/subdev/mmu/{vmmtu104.c => vmmtu102.c}     |   13 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c     |    4 +-
+ .../gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c |    4 +-
+ drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c     |   16 +
+ drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c    |    2 +
+ drivers/gpu/drm/nouveau/nvkm/subdev/volt/Kbuild    |    1 +
+ drivers/gpu/drm/nouveau/nvkm/subdev/volt/gf117.c   |   60 +
+ drivers/gpu/drm/omapdrm/omap_connector.c           |   11 +-
+ drivers/gpu/drm/omapdrm/omap_crtc.c                |    9 +-
+ drivers/gpu/drm/omapdrm/omap_drv.c                 |    2 +-
+ drivers/gpu/drm/omapdrm/omap_drv.h                 |    1 -
+ drivers/gpu/drm/omapdrm/omap_encoder.c             |    6 +-
+ drivers/gpu/drm/omapdrm/omap_fb.c                  |    2 +-
+ drivers/gpu/drm/omapdrm/omap_fbdev.c               |    1 +
+ drivers/gpu/drm/panel/Kconfig                      |   30 +
+ drivers/gpu/drm/panel/Makefile                     |    3 +
+ drivers/gpu/drm/panel/panel-innolux-p079zca.c      |   11 +-
+ drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c |  473 ++
+ drivers/gpu/drm/panel/panel-simple.c               |   54 +
+ drivers/gpu/drm/panel/panel-sitronix-st7701.c      |  426 ++
+ drivers/gpu/drm/panel/panel-tpo-tpg110.c           |  496 ++
+ drivers/gpu/drm/pl111/pl111_drv.c                  |    8 +-
+ drivers/gpu/drm/qxl/Makefile                       |    2 +-
+ drivers/gpu/drm/qxl/qxl_cmd.c                      |   36 +-
+ drivers/gpu/drm/qxl/qxl_display.c                  |  340 +-
+ drivers/gpu/drm/qxl/qxl_draw.c                     |  241 +-
+ drivers/gpu/drm/qxl/qxl_drv.c                      |    9 +-
+ drivers/gpu/drm/qxl/qxl_drv.h                      |   64 +-
+ drivers/gpu/drm/qxl/qxl_dumb.c                     |    2 +-
+ drivers/gpu/drm/qxl/qxl_fb.c                       |  300 -
+ drivers/gpu/drm/qxl/qxl_kms.c                      |   83 +-
+ drivers/gpu/drm/qxl/qxl_object.c                   |   12 +-
+ drivers/gpu/drm/qxl/qxl_prime.c                    |   25 +-
+ drivers/gpu/drm/qxl/qxl_ttm.c                      |   20 +-
+ drivers/gpu/drm/r128/r128_cce.c                    |    5 +-
+ drivers/gpu/drm/r128/r128_drv.c                    |    2 +-
+ drivers/gpu/drm/radeon/atom.c                      |    2 +
+ drivers/gpu/drm/radeon/ci_dpm.c                    |    2 +
+ drivers/gpu/drm/radeon/evergreen_cs.c              |    1 +
+ drivers/gpu/drm/radeon/radeon_acpi.c               |    1 +
+ drivers/gpu/drm/radeon/radeon_audio.c              |   14 +-
+ drivers/gpu/drm/radeon/radeon_connectors.c         |    1 +
+ drivers/gpu/drm/radeon/radeon_device.c             |    1 +
+ drivers/gpu/drm/radeon/radeon_display.c            |    3 +-
+ drivers/gpu/drm/radeon/radeon_dp_mst.c             |   10 +-
+ drivers/gpu/drm/radeon/radeon_drv.c                |    5 +-
+ drivers/gpu/drm/radeon/radeon_irq_kms.c            |    1 +
+ drivers/gpu/drm/radeon/radeon_legacy_encoders.c    |    1 +
+ drivers/gpu/drm/radeon/si_dpm.c                    |    2 +
+ drivers/gpu/drm/rcar-du/Kconfig                    |    1 +
+ drivers/gpu/drm/rcar-du/rcar_du_crtc.c             |   81 +-
+ drivers/gpu/drm/rcar-du/rcar_du_crtc.h             |    8 +-
+ drivers/gpu/drm/rcar-du/rcar_du_drv.c              |   45 +-
+ drivers/gpu/drm/rcar-du/rcar_du_drv.h              |   12 +-
+ drivers/gpu/drm/rcar-du/rcar_du_encoder.c          |   17 +-
+ drivers/gpu/drm/rcar-du/rcar_du_encoder.h          |    5 +-
+ drivers/gpu/drm/rcar-du/rcar_du_group.c            |   51 +-
+ drivers/gpu/drm/rcar-du/rcar_du_kms.c              |   79 +-
+ .../gpu/drm/rcar-du/rcar_du_of_lvds_r8a7790.dts    |   93 +-
+ .../gpu/drm/rcar-du/rcar_du_of_lvds_r8a7791.dts    |   53 +-
+ .../gpu/drm/rcar-du/rcar_du_of_lvds_r8a7793.dts    |   53 +-
+ .../gpu/drm/rcar-du/rcar_du_of_lvds_r8a7795.dts    |   53 +-
+ .../gpu/drm/rcar-du/rcar_du_of_lvds_r8a7796.dts    |   53 +-
+ drivers/gpu/drm/rcar-du/rcar_du_plane.c            |    4 +-
+ drivers/gpu/drm/rcar-du/rcar_du_plane.h            |    3 +-
+ drivers/gpu/drm/rcar-du/rcar_du_vsp.c              |    3 +-
+ drivers/gpu/drm/rcar-du/rcar_du_vsp.h              |    3 +-
+ drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c             |   17 +
+ drivers/gpu/drm/rcar-du/rcar_lvds.c                |  103 +-
+ drivers/gpu/drm/rcar-du/rcar_lvds.h                |   27 +
+ drivers/gpu/drm/rockchip/analogix_dp-rockchip.c    |    2 +-
+ drivers/gpu/drm/rockchip/cdn-dp-core.c             |    2 +-
+ drivers/gpu/drm/rockchip/cdn-dp-core.h             |    2 +-
+ drivers/gpu/drm/rockchip/cdn-dp-reg.c              |    2 +-
+ drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c    |    2 +-
+ drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c        |    2 +-
+ drivers/gpu/drm/rockchip/inno_hdmi.c               |    6 +-
+ drivers/gpu/drm/rockchip/rockchip_drm_drv.c        |    2 +-
+ drivers/gpu/drm/rockchip/rockchip_drm_fb.c         |   38 +-
+ drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c      |    3 +-
+ drivers/gpu/drm/rockchip/rockchip_drm_psr.c        |   39 +-
+ drivers/gpu/drm/rockchip/rockchip_drm_psr.h        |    3 +
+ drivers/gpu/drm/rockchip/rockchip_drm_vop.c        |  163 +-
+ drivers/gpu/drm/rockchip/rockchip_drm_vop.h        |   15 +
+ drivers/gpu/drm/rockchip/rockchip_lvds.c           |    2 +-
+ drivers/gpu/drm/rockchip/rockchip_rgb.c            |    2 +-
+ drivers/gpu/drm/rockchip/rockchip_vop_reg.c        |  180 +-
+ drivers/gpu/drm/rockchip/rockchip_vop_reg.h        |   53 +
+ drivers/gpu/drm/savage/savage_state.c              |    4 +
+ drivers/gpu/drm/scheduler/sched_entity.c           |   39 +-
+ drivers/gpu/drm/scheduler/sched_main.c             |  219 +-
+ drivers/gpu/drm/shmobile/shmob_drm_crtc.c          |    1 +
+ drivers/gpu/drm/shmobile/shmob_drm_drv.c           |    7 +-
+ drivers/gpu/drm/shmobile/shmob_drm_kms.c           |    1 +
+ drivers/gpu/drm/sti/sti_crtc.c                     |   18 +-
+ drivers/gpu/drm/sti/sti_drv.c                      |    2 +-
+ drivers/gpu/drm/sti/sti_dvo.c                      |    6 +-
+ drivers/gpu/drm/sti/sti_hda.c                      |    6 +-
+ drivers/gpu/drm/sti/sti_hdmi.c                     |    9 +-
+ drivers/gpu/drm/sti/sti_tvout.c                    |    2 +-
+ drivers/gpu/drm/stm/drv.c                          |    8 +-
+ drivers/gpu/drm/stm/dw_mipi_dsi-stm.c              |    2 +-
+ drivers/gpu/drm/stm/ltdc.c                         |   15 +-
+ drivers/gpu/drm/sun4i/Kconfig                      |    3 +-
+ drivers/gpu/drm/sun4i/Makefile                     |    5 +-
+ drivers/gpu/drm/sun4i/sun4i_backend.c              |   32 +-
+ drivers/gpu/drm/sun4i/sun4i_crtc.c                 |    2 +-
+ drivers/gpu/drm/sun4i/sun4i_drv.c                  |    7 +-
+ drivers/gpu/drm/sun4i/sun4i_frontend.c             |  354 +-
+ drivers/gpu/drm/sun4i/sun4i_frontend.h             |   52 +
+ drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c             |    5 +-
+ drivers/gpu/drm/sun4i/sun4i_layer.c                |   63 +-
+ drivers/gpu/drm/sun4i/sun4i_lvds.c                 |    2 +-
+ drivers/gpu/drm/sun4i/sun4i_rgb.c                  |    2 +-
+ drivers/gpu/drm/sun4i/sun4i_tcon.c                 |    3 +-
+ drivers/gpu/drm/sun4i/sun4i_tv.c                   |    2 +-
+ drivers/gpu/drm/sun4i/sun6i_drc.c                  |    1 +
+ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c             |   34 +-
+ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h             |   17 +-
+ drivers/gpu/drm/sun4i/sun8i_mixer.c                |    2 +-
+ drivers/gpu/drm/sun4i/sun8i_ui_layer.c             |    2 +-
+ drivers/gpu/drm/sun4i/sun8i_vi_layer.c             |    2 +-
+ drivers/gpu/drm/tegra/Makefile                     |    1 +
+ drivers/gpu/drm/tegra/drm.c                        |   57 +-
+ drivers/gpu/drm/tegra/drm.h                        |    5 +-
+ drivers/gpu/drm/tegra/fb.c                         |    2 +-
+ drivers/gpu/drm/tegra/hda.c                        |   63 +
+ drivers/gpu/drm/tegra/hda.h                        |   20 +
+ drivers/gpu/drm/tegra/hdmi.c                       |  222 +-
+ drivers/gpu/drm/tegra/hub.c                        |    4 +-
+ drivers/gpu/drm/tegra/output.c                     |   11 +-
+ drivers/gpu/drm/tegra/sor.c                        |   67 +-
+ drivers/gpu/drm/tegra/vic.c                        |   75 +-
+ drivers/gpu/drm/tegra/vic.h                        |    9 +
+ drivers/gpu/drm/tilcdc/tilcdc_drv.c                |   37 +-
+ drivers/gpu/drm/tilcdc/tilcdc_drv.h                |    5 +-
+ drivers/gpu/drm/tilcdc/tilcdc_external.c           |    1 +
+ drivers/gpu/drm/tilcdc/tilcdc_panel.c              |    1 +
+ drivers/gpu/drm/tilcdc/tilcdc_tfp410.c             |    1 +
+ drivers/gpu/drm/tinydrm/core/tinydrm-core.c        |   26 +-
+ drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c     |  100 +-
+ drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c        |   34 +-
+ drivers/gpu/drm/tinydrm/hx8357d.c                  |    3 +-
+ drivers/gpu/drm/tinydrm/ili9225.c                  |  151 +-
+ drivers/gpu/drm/tinydrm/ili9341.c                  |    3 +-
+ drivers/gpu/drm/tinydrm/mi0283qt.c                 |    3 +-
+ drivers/gpu/drm/tinydrm/mipi-dbi.c                 |   97 +-
+ drivers/gpu/drm/tinydrm/repaper.c                  |   44 +-
+ drivers/gpu/drm/tinydrm/st7586.c                   |   87 +-
+ drivers/gpu/drm/tinydrm/st7735r.c                  |    3 +-
+ drivers/gpu/drm/ttm/ttm_bo.c                       |   20 +-
+ drivers/gpu/drm/ttm/ttm_bo_vm.c                    |   19 +-
+ drivers/gpu/drm/tve200/tve200_drv.c                |   10 +-
+ drivers/gpu/drm/udl/udl_connector.c                |    1 +
+ drivers/gpu/drm/udl/udl_drv.c                      |    1 +
+ drivers/gpu/drm/udl/udl_main.c                     |    1 +
+ drivers/gpu/drm/v3d/v3d_drv.h                      |    1 -
+ drivers/gpu/drm/v3d/v3d_gem.c                      |   60 +-
+ drivers/gpu/drm/v3d/v3d_sched.c                    |   13 +-
+ drivers/gpu/drm/vc4/vc4_crtc.c                     |   45 +-
+ drivers/gpu/drm/vc4/vc4_dpi.c                      |    2 +-
+ drivers/gpu/drm/vc4/vc4_drv.c                      |    1 -
+ drivers/gpu/drm/vc4/vc4_drv.h                      |    4 +
+ drivers/gpu/drm/vc4/vc4_dsi.c                      |    2 +-
+ drivers/gpu/drm/vc4/vc4_hdmi.c                     |   34 +-
+ drivers/gpu/drm/vc4/vc4_kms.c                      |    7 +-
+ drivers/gpu/drm/vc4/vc4_perfmon.c                  |    2 +-
+ drivers/gpu/drm/vc4/vc4_plane.c                    |  145 +-
+ drivers/gpu/drm/vc4/vc4_txp.c                      |    2 +-
+ drivers/gpu/drm/vc4/vc4_vec.c                      |    2 +-
+ drivers/gpu/drm/vgem/vgem_fence.c                  |    4 +-
+ drivers/gpu/drm/via/via_dmablit.c                  |    4 +
+ drivers/gpu/drm/via/via_drv.c                      |    3 +-
+ drivers/gpu/drm/virtio/Makefile                    |    2 +-
+ drivers/gpu/drm/virtio/virtgpu_display.c           |   10 +-
+ drivers/gpu/drm/virtio/virtgpu_drm_bus.c           |  103 -
+ drivers/gpu/drm/virtio/virtgpu_drv.c               |   84 +-
+ drivers/gpu/drm/virtio/virtgpu_drv.h               |   26 +-
+ drivers/gpu/drm/virtio/virtgpu_fb.c                |  191 -
+ drivers/gpu/drm/virtio/virtgpu_fence.c             |    8 -
+ drivers/gpu/drm/virtio/virtgpu_ioctl.c             |    2 +-
+ drivers/gpu/drm/virtio/virtgpu_kms.c               |   18 +-
+ drivers/gpu/drm/virtio/virtgpu_object.c            |   13 +
+ drivers/gpu/drm/virtio/virtgpu_plane.c             |   17 +-
+ drivers/gpu/drm/virtio/virtgpu_vq.c                |   12 +-
+ drivers/gpu/drm/vkms/vkms_crtc.c                   |   26 +-
+ drivers/gpu/drm/vkms/vkms_drv.c                    |    3 +-
+ drivers/gpu/drm/vkms/vkms_output.c                 |    2 +-
+ drivers/gpu/drm/vmwgfx/vmwgfx_bo.c                 |   11 +-
+ drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c             |   11 +-
+ drivers/gpu/drm/vmwgfx/vmwgfx_drv.c                |    2 +-
+ drivers/gpu/drm/vmwgfx/vmwgfx_drv.h                |    9 +-
+ drivers/gpu/drm/vmwgfx/vmwgfx_kms.h                |    2 +-
+ drivers/gpu/drm/vmwgfx/vmwgfx_mob.c                |   21 +-
+ drivers/gpu/drm/vmwgfx/vmwgfx_resource.c           |    9 +-
+ drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c         |    8 +-
+ drivers/gpu/drm/vmwgfx/vmwgfx_validation.c         |    6 +-
+ drivers/gpu/drm/xen/xen_drm_front.c                |    2 +-
+ drivers/gpu/drm/xen/xen_drm_front_conn.c           |    3 +-
+ drivers/gpu/drm/xen/xen_drm_front_gem.c            |   15 +-
+ drivers/gpu/drm/xen/xen_drm_front_kms.c            |    4 +-
+ drivers/gpu/drm/zte/zx_drm_drv.c                   |    2 +-
+ drivers/gpu/drm/zte/zx_hdmi.c                      |    6 +-
+ drivers/gpu/drm/zte/zx_tvenc.c                     |    2 +-
+ drivers/gpu/drm/zte/zx_vga.c                       |    2 +-
+ drivers/gpu/drm/zte/zx_vou.c                       |    2 +-
+ drivers/gpu/host1x/bus.c                           |   35 +
+ drivers/gpu/host1x/cdma.c                          |  189 +-
+ drivers/gpu/host1x/cdma.h                          |    8 +-
+ drivers/gpu/host1x/dev.c                           |   49 +-
+ drivers/gpu/host1x/dev.h                           |    8 +
+ drivers/gpu/host1x/hw/cdma_hw.c                    |   46 +-
+ drivers/gpu/host1x/hw/channel_hw.c                 |   43 +-
+ drivers/gpu/host1x/hw/host1x06_hardware.h          |    6 +
+ drivers/gpu/host1x/hw/host1x07_hardware.h          |    6 +
+ drivers/gpu/host1x/hw/hw_host1x06_channel.h        |   11 +
+ drivers/gpu/host1x/hw/hw_host1x07_channel.h        |   11 +
+ drivers/gpu/ipu-v3/ipu-cpmem.c                     |   26 +-
+ drivers/gpu/ipu-v3/ipu-csi.c                       |  126 +-
+ drivers/gpu/ipu-v3/ipu-pre.c                       |    6 +
+ drivers/gpu/ipu-v3/ipu-prg.c                       |   16 +
+ drivers/gpu/ipu-v3/ipu-prv.h                       |    1 +
+ drivers/gpu/vga/vgaarb.c                           |   49 +
+ drivers/hid/Kconfig                                |   13 +
+ drivers/hid/Makefile                               |    5 +
+ drivers/hid/hid-asus.c                             |  247 +-
+ drivers/hid/hid-elan.c                             |    2 +-
+ drivers/hid/hid-ids.h                              |   20 +-
+ drivers/hid/hid-input.c                            |    3 +
+ drivers/hid/hid-kye.c                              |   83 +
+ drivers/hid/hid-lg.c                               |   60 +
+ drivers/hid/hid-lg4ff.c                            |    6 +
+ drivers/hid/hid-maltron.c                          |  165 +
+ drivers/hid/hid-multitouch.c                       |    6 +
+ drivers/hid/hid-quirks.c                           |   33 +-
+ drivers/hid/hid-roccat-kone.c                      |    1 +
+ drivers/hid/hid-sony.c                             |   31 +-
+ drivers/hid/hid-steam.c                            |   34 +-
+ drivers/hid/hid-topseed.c                          |    3 +
+ drivers/hid/hid-uclogic-core.c                     |  418 ++
+ drivers/hid/hid-uclogic-params.c                   | 1122 ++++
+ drivers/hid/hid-uclogic-params.h                   |  207 +
+ drivers/hid/{hid-uclogic.c => hid-uclogic-rdesc.c} |  822 +--
+ drivers/hid/hid-uclogic-rdesc.h                    |  155 +
+ drivers/hid/hid-viewsonic.c                        |  105 +
+ drivers/hid/i2c-hid/i2c-hid-core.c                 |    9 +
+ drivers/hid/intel-ish-hid/ipc/ipc.c                |   32 +-
+ drivers/hid/intel-ish-hid/ishtp-hid-client.c       |    4 +-
+ drivers/hid/intel-ish-hid/ishtp-hid.c              |    4 +-
+ drivers/hid/intel-ish-hid/ishtp-hid.h              |    6 +-
+ drivers/hid/intel-ish-hid/ishtp/bus.c              |   27 +-
+ drivers/hid/intel-ish-hid/ishtp/bus.h              |    6 +-
+ drivers/hid/intel-ish-hid/ishtp/client.h           |    2 +-
+ drivers/hid/intel-ish-hid/ishtp/hbm.c              |   97 +-
+ drivers/hid/intel-ish-hid/ishtp/hbm.h              |    2 +-
+ drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h        |    2 -
+ drivers/hid/wacom_sys.c                            |   32 +
+ drivers/hid/wacom_wac.c                            |   24 +-
+ drivers/hsi/controllers/omap_ssi_port.c            |    6 +-
+ drivers/hv/channel.c                               |    4 +-
+ drivers/hv/channel_mgmt.c                          |   18 +-
+ drivers/hv/hv_balloon.c                            |   21 +-
+ drivers/hv/hyperv_vmbus.h                          |    4 +-
+ drivers/hv/ring_buffer.c                           |   14 +-
+ drivers/hv/vmbus_drv.c                             |   86 +-
+ drivers/hwtracing/coresight/coresight-cpu-debug.c  |    4 +
+ drivers/hwtracing/coresight/coresight-etm-perf.c   |  119 +-
+ drivers/hwtracing/coresight/coresight-etm-perf.h   |    6 +-
+ drivers/hwtracing/coresight/coresight-etm3x.c      |   44 +-
+ drivers/hwtracing/coresight/coresight-etm4x.c      |   24 +-
+ drivers/hwtracing/coresight/coresight-priv.h       |   41 +
+ drivers/hwtracing/coresight/coresight-stm.c        |   26 +-
+ drivers/hwtracing/coresight/coresight-tmc.c        |   30 +-
+ drivers/hwtracing/coresight/coresight.c            |   60 +
+ drivers/hwtracing/coresight/of_coresight.c         |    4 +-
+ drivers/hwtracing/intel_th/core.c                  |    6 +-
+ drivers/hwtracing/intel_th/gth.c                   |    4 +
+ drivers/hwtracing/intel_th/pti.c                   |   16 +-
+ drivers/hwtracing/intel_th/sth.c                   |    4 +
+ drivers/hwtracing/stm/core.c                       |   11 +-
+ drivers/i2c/algos/i2c-algo-bit.c                   |   25 +-
+ drivers/i2c/busses/i2c-aspeed.c                    |  120 +-
+ drivers/i2c/busses/i2c-brcmstb.c                   |   13 +-
+ drivers/i2c/busses/i2c-cbus-gpio.c                 |   80 +-
+ drivers/i2c/busses/i2c-designware-core.h           |    2 +
+ drivers/i2c/busses/i2c-designware-master.c         |    6 +
+ drivers/i2c/busses/i2c-designware-pcidrv.c         |    7 +-
+ drivers/i2c/busses/i2c-designware-platdrv.c        |   10 +-
+ drivers/i2c/busses/i2c-eg20t.c                     |    1 -
+ drivers/i2c/busses/i2c-exynos5.c                   |   11 +-
+ drivers/i2c/busses/i2c-gpio.c                      |  134 +-
+ drivers/i2c/busses/i2c-imx.c                       |   37 +-
+ drivers/i2c/busses/i2c-iop3xx.c                    |    8 +
+ drivers/i2c/busses/i2c-mt65xx.c                    |   14 +-
+ drivers/i2c/busses/i2c-ocores.c                    |  308 +-
+ drivers/i2c/busses/i2c-rcar.c                      |   64 +-
+ drivers/i2c/busses/i2c-s3c2410.c                   |    8 +-
+ drivers/i2c/busses/i2c-sh_mobile.c                 |  121 +-
+ drivers/i2c/busses/i2c-sis630.c                    |    4 +-
+ drivers/i2c/busses/i2c-sprd.c                      |   34 +-
+ drivers/i2c/busses/i2c-stm32f7.c                   |    2 +-
+ drivers/i2c/busses/i2c-synquacer.c                 |    5 -
+ drivers/i2c/busses/i2c-tegra.c                     |  740 ++-
+ drivers/i2c/busses/i2c-zx2967.c                    |    8 +-
+ drivers/i2c/i2c-core-base.c                        |   21 +-
+ drivers/i2c/i2c-core-of.c                          |   14 +-
+ drivers/i2c/i2c-core-smbus.c                       |    2 +-
+ drivers/i2c/i2c-dev.c                              |    2 +-
+ drivers/ide/Kconfig                                |   26 +-
+ drivers/ide/hpt366.c                               |    4 +-
+ drivers/ide/ide-floppy.c                           |    2 +-
+ drivers/idle/intel_idle.c                          |    1 +
+ drivers/iio/accel/adxl345_core.c                   |    4 +-
+ drivers/iio/accel/mma8452.c                        |  105 +-
+ drivers/iio/accel/st_accel_core.c                  |  171 +-
+ drivers/iio/adc/Kconfig                            |   87 +-
+ drivers/iio/adc/Makefile                           |    8 +
+ drivers/iio/adc/ad7476.c                           |   20 +
+ drivers/{staging => }/iio/adc/ad7606.c             |  272 +-
+ drivers/{staging => }/iio/adc/ad7606.h             |   17 +-
+ drivers/{staging => }/iio/adc/ad7606_par.c         |   46 +-
+ drivers/{staging => }/iio/adc/ad7606_spi.c         |   35 +-
+ drivers/iio/adc/ad7768-1.c                         |  655 ++
+ drivers/iio/adc/exynos_adc.c                       |   19 +-
+ drivers/iio/adc/ingenic-adc.c                      |  364 ++
+ drivers/iio/adc/lpc32xx_adc.c                      |   15 +-
+ drivers/iio/adc/meson_saradc.c                     |   33 +
+ drivers/iio/adc/npcm_adc.c                         |  335 +
+ drivers/iio/adc/qcom-pm8xxx-xoadc.c                |   10 +-
+ drivers/iio/adc/stmpe-adc.c                        |  363 ++
+ drivers/iio/adc/ti-ads124s08.c                     |  376 ++
+ drivers/iio/adc/xilinx-xadc-core.c                 |    4 +-
+ drivers/iio/chemical/Kconfig                       |   21 +
+ drivers/iio/chemical/Makefile                      |    3 +
+ drivers/iio/chemical/bme680_i2c.c                  |    7 +
+ drivers/iio/chemical/bme680_spi.c                  |    8 +
+ drivers/iio/chemical/pms7003.c                     |  340 +
+ drivers/iio/chemical/sgp30.c                       |  591 ++
+ drivers/iio/chemical/sps30.c                       |  548 ++
+ drivers/iio/dac/Kconfig                            |   16 +-
+ drivers/iio/dac/Makefile                           |    1 +
+ drivers/iio/dac/ad5686-spi.c                       |    9 +-
+ drivers/iio/dac/ad5686.c                           |   44 +-
+ drivers/iio/dac/ad5686.h                           |    4 +-
+ drivers/iio/dac/ad5696-i2c.c                       |    2 +-
+ drivers/iio/dac/ad5758.c                           |    2 +-
+ drivers/iio/dac/ti-dac7612.c                       |  184 +
+ drivers/iio/frequency/ad9523.c                     |    7 +-
+ drivers/iio/imu/bmi160/bmi160.h                    |   11 +
+ drivers/iio/imu/bmi160/bmi160_core.c               |  317 +-
+ drivers/iio/imu/bmi160/bmi160_i2c.c                |    5 +-
+ drivers/iio/imu/bmi160/bmi160_spi.c                |    4 +-
+ drivers/iio/imu/inv_mpu6050/Kconfig                |    8 +-
+ drivers/iio/imu/inv_mpu6050/inv_mpu_core.c         |   31 +
+ drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c          |    6 +
+ drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h          |    8 +
+ drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c          |   12 +-
+ drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c       |    2 -
+ drivers/iio/industrialio-core.c                    |    5 +
+ drivers/iio/light/Kconfig                          |   10 +
+ drivers/iio/light/Makefile                         |    1 +
+ drivers/iio/light/isl29018.c                       |   46 +-
+ drivers/iio/light/max44009.c                       |  555 ++
+ drivers/iio/magnetometer/mag3110.c                 |   94 +-
+ drivers/iio/pressure/Kconfig                       |    2 +-
+ drivers/iio/pressure/st_pressure.h                 |    2 +
+ drivers/iio/pressure/st_pressure_core.c            |   69 +
+ drivers/iio/pressure/st_pressure_i2c.c             |    5 +
+ drivers/iio/pressure/st_pressure_spi.c             |    5 +
+ drivers/infiniband/Kconfig                         |   15 +-
+ drivers/infiniband/core/Makefile                   |    4 +-
+ drivers/infiniband/core/cache.c                    |  118 +-
+ drivers/infiniband/core/cgroup.c                   |    5 +-
+ drivers/infiniband/core/cm.c                       |    3 +-
+ drivers/infiniband/core/cma.c                      |  139 +-
+ drivers/infiniband/core/cma_priv.h                 |    4 +-
+ drivers/infiniband/core/core_priv.h                |   35 +-
+ drivers/infiniband/core/device.c                   | 1313 ++--
+ drivers/infiniband/core/iwcm.c                     |   13 +-
+ drivers/infiniband/core/iwpm_msg.c                 |  232 +-
+ drivers/infiniband/core/iwpm_util.c                |   86 +-
+ drivers/infiniband/core/iwpm_util.h                |   12 +
+ drivers/infiniband/core/mad.c                      |    4 +-
+ drivers/infiniband/core/netlink.c                  |    4 +-
+ drivers/infiniband/core/nldev.c                    |  492 +-
+ drivers/infiniband/core/rdma_core.c                |   42 +-
+ drivers/infiniband/core/restrack.c                 |  193 +-
+ drivers/infiniband/core/restrack.h                 |   28 +
+ drivers/infiniband/core/rw.c                       |   12 +-
+ drivers/infiniband/core/sa_query.c                 |    4 +-
+ drivers/infiniband/core/security.c                 |   96 +-
+ drivers/infiniband/core/sysfs.c                    |   93 +-
+ drivers/infiniband/core/ucma.c                     |    7 +
+ drivers/infiniband/core/umem.c                     |   60 +-
+ drivers/infiniband/core/umem_odp.c                 |   21 +-
+ drivers/infiniband/core/user_mad.c                 |   52 +-
+ drivers/infiniband/core/uverbs_cmd.c               |   69 +-
+ drivers/infiniband/core/uverbs_ioctl.c             |    3 +
+ drivers/infiniband/core/uverbs_main.c              |    2 +
+ drivers/infiniband/core/uverbs_std_types.c         |    2 +-
+ drivers/infiniband/core/uverbs_uapi.c              |   15 +-
+ drivers/infiniband/core/verbs.c                    |   73 +-
+ drivers/infiniband/hw/bnxt_re/Kconfig              |    1 +
+ drivers/infiniband/hw/bnxt_re/Makefile             |    2 +-
+ drivers/infiniband/hw/bnxt_re/bnxt_re.h            |    1 +
+ drivers/infiniband/hw/bnxt_re/ib_verbs.c           |  268 +-
+ drivers/infiniband/hw/bnxt_re/ib_verbs.h           |   16 +-
+ drivers/infiniband/hw/bnxt_re/main.c               |  134 +-
+ drivers/infiniband/hw/bnxt_re/qplib_fp.c           |  193 +-
+ drivers/infiniband/hw/bnxt_re/qplib_fp.h           |   47 +-
+ drivers/infiniband/hw/bnxt_re/qplib_rcfw.c         |   40 +-
+ drivers/infiniband/hw/bnxt_re/qplib_rcfw.h         |   45 +-
+ drivers/infiniband/hw/bnxt_re/qplib_res.c          |   22 +-
+ drivers/infiniband/hw/bnxt_re/qplib_res.h          |   30 +-
+ drivers/infiniband/hw/bnxt_re/qplib_sp.c           |    3 +-
+ drivers/infiniband/hw/bnxt_re/roce_hsi.h           |  160 +-
+ drivers/infiniband/hw/cxgb3/Makefile               |    2 +-
+ drivers/infiniband/hw/cxgb3/iwch.c                 |    2 +-
+ drivers/infiniband/hw/cxgb3/iwch_provider.c        |   95 +-
+ drivers/infiniband/hw/cxgb4/Makefile               |    4 +-
+ drivers/infiniband/hw/cxgb4/cm.c                   |  199 +-
+ drivers/infiniband/hw/cxgb4/device.c               |   10 +-
+ drivers/infiniband/hw/cxgb4/iw_cxgb4.h             |   16 +-
+ drivers/infiniband/hw/cxgb4/mem.c                  |   36 +-
+ drivers/infiniband/hw/cxgb4/provider.c             |   85 +-
+ drivers/infiniband/hw/cxgb4/qp.c                   |   33 +-
+ drivers/infiniband/hw/cxgb4/t4.h                   |    1 +
+ drivers/infiniband/hw/hfi1/Makefile                |    1 +
+ drivers/infiniband/hw/hfi1/affinity.c              |    3 +-
+ drivers/infiniband/hw/hfi1/chip.c                  |   13 +
+ drivers/infiniband/hw/hfi1/chip.h                  |    4 +-
+ drivers/infiniband/hw/hfi1/common.h                |    4 +
+ drivers/infiniband/hw/hfi1/debugfs.c               |   58 +-
+ drivers/infiniband/hw/hfi1/debugfs.h               |   12 -
+ drivers/infiniband/hw/hfi1/driver.c                |   58 +-
+ drivers/infiniband/hw/hfi1/fault.c                 |   53 +-
+ drivers/infiniband/hw/hfi1/hfi.h                   |   24 +-
+ drivers/infiniband/hw/hfi1/init.c                  |   38 +-
+ drivers/infiniband/hw/hfi1/iowait.c                |   34 +-
+ drivers/infiniband/hw/hfi1/iowait.h                |   99 +-
+ drivers/infiniband/hw/hfi1/opfn.c                  |  323 +
+ drivers/infiniband/hw/hfi1/opfn.h                  |   85 +
+ drivers/infiniband/hw/hfi1/pio.c                   |   18 +-
+ drivers/infiniband/hw/hfi1/qp.c                    |   76 +-
+ drivers/infiniband/hw/hfi1/qp.h                    |    7 +
+ drivers/infiniband/hw/hfi1/rc.c                    | 1141 +++-
+ drivers/infiniband/hw/hfi1/rc.h                    |   51 +
+ drivers/infiniband/hw/hfi1/ruc.c                   |   48 +-
+ drivers/infiniband/hw/hfi1/sdma.c                  |   24 +-
+ drivers/infiniband/hw/hfi1/sdma_txreq.h            |    1 +
+ drivers/infiniband/hw/hfi1/sysfs.c                 |   16 +-
+ drivers/infiniband/hw/hfi1/tid_rdma.c              | 5418 ++++++++++++++++
+ drivers/infiniband/hw/hfi1/tid_rdma.h              |  311 +-
+ drivers/infiniband/hw/hfi1/trace.c                 |  118 +
+ drivers/infiniband/hw/hfi1/trace.h                 |    1 +
+ drivers/infiniband/hw/hfi1/trace_ibhdrs.h          |    8 +
+ drivers/infiniband/hw/hfi1/trace_rc.h              |   48 +
+ drivers/infiniband/hw/hfi1/trace_rx.h              |  107 +-
+ drivers/infiniband/hw/hfi1/trace_tid.h             | 1610 +++++
+ drivers/infiniband/hw/hfi1/trace_tx.h              |   18 +-
+ drivers/infiniband/hw/hfi1/uc.c                    |    3 +-
+ drivers/infiniband/hw/hfi1/ud.c                    |   24 +-
+ drivers/infiniband/hw/hfi1/user_exp_rcv.h          |    1 -
+ drivers/infiniband/hw/hfi1/user_pages.c            |   12 +-
+ drivers/infiniband/hw/hfi1/user_sdma.c             |    9 +-
+ drivers/infiniband/hw/hfi1/verbs.c                 |  210 +-
+ drivers/infiniband/hw/hfi1/verbs.h                 |  104 +-
+ drivers/infiniband/hw/hfi1/verbs_txreq.h           |    1 +
+ drivers/infiniband/hw/hfi1/vnic_sdma.c             |    6 +-
+ drivers/infiniband/hw/hns/Kconfig                  |    1 -
+ drivers/infiniband/hw/hns/Makefile                 |    2 +-
+ drivers/infiniband/hw/hns/hns_roce_cmd.c           |   32 +-
+ drivers/infiniband/hw/hns/hns_roce_cmd.h           |   12 +
+ drivers/infiniband/hw/hns/hns_roce_cq.c            |    9 +-
+ drivers/infiniband/hw/hns/hns_roce_db.c            |    6 +-
+ drivers/infiniband/hw/hns/hns_roce_device.h        |   63 +-
+ drivers/infiniband/hw/hns/hns_roce_hem.c           |   68 +-
+ drivers/infiniband/hw/hns/hns_roce_hem.h           |    3 +
+ drivers/infiniband/hw/hns/hns_roce_hw_v1.c         |   36 +-
+ drivers/infiniband/hw/hns/hns_roce_hw_v2.c         |  596 +-
+ drivers/infiniband/hw/hns/hns_roce_hw_v2.h         |   92 +-
+ drivers/infiniband/hw/hns/hns_roce_main.c          |   88 +-
+ drivers/infiniband/hw/hns/hns_roce_mr.c            |   95 +-
+ drivers/infiniband/hw/hns/hns_roce_pd.c            |   25 +-
+ drivers/infiniband/hw/hns/hns_roce_qp.c            |   92 +-
+ drivers/infiniband/hw/hns/hns_roce_srq.c           |   16 +-
+ drivers/infiniband/hw/i40iw/Makefile               |    2 +-
+ drivers/infiniband/hw/i40iw/i40iw_utils.c          |    1 -
+ drivers/infiniband/hw/i40iw/i40iw_verbs.c          |  137 +-
+ drivers/infiniband/hw/mlx4/Kconfig                 |    1 -
+ drivers/infiniband/hw/mlx4/cm.c                    |    2 +-
+ drivers/infiniband/hw/mlx4/cq.c                    |   19 +-
+ drivers/infiniband/hw/mlx4/doorbell.c              |    6 +-
+ drivers/infiniband/hw/mlx4/main.c                  |   77 +-
+ drivers/infiniband/hw/mlx4/mlx4_ib.h               |    3 +-
+ drivers/infiniband/hw/mlx4/mr.c                    |   13 +-
+ drivers/infiniband/hw/mlx4/qp.c                    |   84 +-
+ drivers/infiniband/hw/mlx4/srq.c                   |   12 +-
+ drivers/infiniband/hw/mlx5/Kconfig                 |    1 -
+ drivers/infiniband/hw/mlx5/cong.c                  |   15 +-
+ drivers/infiniband/hw/mlx5/cq.c                    |   15 +-
+ drivers/infiniband/hw/mlx5/devx.c                  |  463 +-
+ drivers/infiniband/hw/mlx5/doorbell.c              |    6 +-
+ drivers/infiniband/hw/mlx5/ib_rep.c                |    6 +-
+ drivers/infiniband/hw/mlx5/main.c                  |  249 +-
+ drivers/infiniband/hw/mlx5/mem.c                   |    5 +-
+ drivers/infiniband/hw/mlx5/mlx5_ib.h               |   41 +-
+ drivers/infiniband/hw/mlx5/mr.c                    |  126 +-
+ drivers/infiniband/hw/mlx5/odp.c                   |  316 +-
+ drivers/infiniband/hw/mlx5/qp.c                    |  308 +-
+ drivers/infiniband/hw/mlx5/srq.c                   |   11 +-
+ drivers/infiniband/hw/mlx5/srq.h                   |    2 -
+ drivers/infiniband/hw/mlx5/srq_cmd.c               |   16 +-
+ drivers/infiniband/hw/mthca/mthca_main.c           |    2 +-
+ drivers/infiniband/hw/mthca/mthca_provider.c       |  139 +-
+ drivers/infiniband/hw/mthca/mthca_qp.c             |   13 +-
+ drivers/infiniband/hw/mthca/mthca_srq.c            |   21 +-
+ drivers/infiniband/hw/nes/Kconfig                  |    2 +-
+ drivers/infiniband/hw/nes/nes_verbs.c              |  313 +-
+ drivers/infiniband/hw/nes/nes_verbs.h              |    1 -
+ drivers/infiniband/hw/ocrdma/Makefile              |    2 +-
+ drivers/infiniband/hw/ocrdma/ocrdma_main.c         |   12 +-
+ drivers/infiniband/hw/ocrdma/ocrdma_stats.c        |   67 +-
+ drivers/infiniband/hw/ocrdma/ocrdma_verbs.c        |  189 +-
+ drivers/infiniband/hw/ocrdma/ocrdma_verbs.h        |   11 +-
+ drivers/infiniband/hw/qedr/main.c                  |    9 +-
+ drivers/infiniband/hw/qedr/qedr_iw_cm.c            |    2 +-
+ drivers/infiniband/hw/qedr/verbs.c                 |  192 +-
+ drivers/infiniband/hw/qedr/verbs.h                 |   10 +-
+ drivers/infiniband/hw/qib/qib_debugfs.c            |   27 +-
+ drivers/infiniband/hw/qib/qib_rc.c                 |    7 +-
+ drivers/infiniband/hw/qib/qib_sdma.c               |   26 +-
+ drivers/infiniband/hw/qib/qib_sysfs.c              |   18 +-
+ drivers/infiniband/hw/qib/qib_ud.c                 |    6 +-
+ drivers/infiniband/hw/qib/qib_user_pages.c         |   75 +-
+ drivers/infiniband/hw/qib/qib_verbs.c              |   20 +-
+ drivers/infiniband/hw/usnic/Makefile               |    2 +-
+ drivers/infiniband/hw/usnic/usnic_debugfs.c        |   26 -
+ drivers/infiniband/hw/usnic/usnic_ib_main.c        |   57 +-
+ drivers/infiniband/hw/usnic/usnic_ib_sysfs.c       |   26 +-
+ drivers/infiniband/hw/usnic/usnic_ib_verbs.c       |  114 +-
+ drivers/infiniband/hw/usnic/usnic_ib_verbs.h       |   28 +-
+ drivers/infiniband/hw/usnic/usnic_uiom.c           |   65 +-
+ drivers/infiniband/hw/usnic/usnic_uiom.h           |    1 -
+ drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c       |    2 +-
+ drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h  |   15 +-
+ drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c     |   12 +-
+ drivers/infiniband/hw/vmw_pvrdma/pvrdma_misc.c     |   21 +-
+ drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c       |    3 +-
+ drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c       |    6 +-
+ drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c      |    4 +-
+ drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c    |   98 +-
+ drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.h    |   12 +-
+ drivers/infiniband/sw/rdmavt/mr.c                  |   21 +-
+ drivers/infiniband/sw/rdmavt/pd.c                  |   29 +-
+ drivers/infiniband/sw/rdmavt/pd.h                  |    7 +-
+ drivers/infiniband/sw/rdmavt/qp.c                  |  104 +-
+ drivers/infiniband/sw/rdmavt/rc.c                  |   13 +
+ drivers/infiniband/sw/rdmavt/srq.c                 |    5 +-
+ drivers/infiniband/sw/rdmavt/trace_cq.h            |   10 +-
+ drivers/infiniband/sw/rdmavt/vt.c                  |   34 +-
+ drivers/infiniband/sw/rxe/rxe.c                    |   67 +-
+ drivers/infiniband/sw/rxe/rxe.h                    |   16 +-
+ drivers/infiniband/sw/rxe/rxe_av.c                 |    7 +
+ drivers/infiniband/sw/rxe/rxe_comp.c               |    6 +-
+ drivers/infiniband/sw/rxe/rxe_loc.h                |    9 +-
+ drivers/infiniband/sw/rxe/rxe_mr.c                 |   15 +-
+ drivers/infiniband/sw/rxe/rxe_net.c                |   97 +-
+ drivers/infiniband/sw/rxe/rxe_net.h                |    2 +-
+ drivers/infiniband/sw/rxe/rxe_param.h              |    3 +-
+ drivers/infiniband/sw/rxe/rxe_pool.c               |   77 +-
+ drivers/infiniband/sw/rxe/rxe_pool.h               |    4 +
+ drivers/infiniband/sw/rxe/rxe_qp.c                 |   15 +-
+ drivers/infiniband/sw/rxe/rxe_recv.c               |   12 +-
+ drivers/infiniband/sw/rxe/rxe_resp.c               |    3 +-
+ drivers/infiniband/sw/rxe/rxe_sysfs.c              |   40 +-
+ drivers/infiniband/sw/rxe/rxe_verbs.c              |  103 +-
+ drivers/infiniband/sw/rxe/rxe_verbs.h              |    9 +-
+ drivers/infiniband/ulp/ipoib/ipoib.h               |    4 +-
+ drivers/infiniband/ulp/ipoib/ipoib_fs.c            |    7 +-
+ drivers/infiniband/ulp/ipoib/ipoib_main.c          |   14 +-
+ drivers/infiniband/ulp/iser/iscsi_iser.h           |    2 +-
+ drivers/infiniband/ulp/iser/iser_memory.c          |   19 +-
+ drivers/infiniband/ulp/isert/Makefile              |    1 -
+ drivers/infiniband/ulp/isert/ib_isert.c            |    2 +-
+ drivers/infiniband/ulp/srp/ib_srp.c                |   26 +-
+ drivers/infiniband/ulp/srpt/Makefile               |    1 -
+ drivers/infiniband/ulp/srpt/ib_srpt.c              |   80 +-
+ drivers/infiniband/ulp/srpt/ib_srpt.h              |    4 -
+ drivers/input/joystick/db9.c                       |    2 +-
+ drivers/input/keyboard/davinci_keyscan.c           |    4 -
+ drivers/input/keyboard/gpio_keys.c                 |   10 +
+ drivers/input/keyboard/mcs_touchkey.c              |    5 +-
+ drivers/input/keyboard/mtk-pmic-keys.c             |   13 +-
+ drivers/input/keyboard/qt2160.c                    |    9 -
+ drivers/input/keyboard/tca6416-keypad.c            |    4 +-
+ drivers/input/keyboard/tm2-touchkey.c              |  136 +-
+ drivers/input/misc/Kconfig                         |   21 +
+ drivers/input/misc/Makefile                        |    3 +
+ drivers/input/misc/ims-pcu.c                       |   27 +-
+ drivers/input/misc/msm-vibrator.c                  |  281 +
+ drivers/input/misc/soc_button_array.c              |    6 +-
+ drivers/input/misc/stpmic1_onkey.c                 |  198 +
+ drivers/input/mouse/elan_i2c_core.c                |    1 +
+ drivers/input/mouse/synaptics_i2c.c                |   22 +-
+ drivers/input/serio/i8042-sparcio.h                |   21 +-
+ drivers/input/tablet/wacom_serial4.c               |    2 +
+ drivers/input/touchscreen/Kconfig                  |    7 +-
+ drivers/input/touchscreen/ad7879.c                 |   11 +-
+ drivers/input/touchscreen/edt-ft5x06.c             |  110 +-
+ drivers/input/touchscreen/goodix.c                 |    6 +-
+ drivers/input/touchscreen/ili210x.c                |  321 +-
+ drivers/input/touchscreen/st1232.c                 |  154 +-
+ drivers/input/touchscreen/stmfts.c                 |   30 +-
+ drivers/input/touchscreen/stmpe-ts.c               |   66 +-
+ drivers/input/touchscreen/sx8654.c                 |  255 +-
+ drivers/input/touchscreen/ti_am335x_tsc.c          |    4 -
+ drivers/interconnect/Kconfig                       |   15 +
+ drivers/interconnect/Makefile                      |    6 +
+ drivers/interconnect/core.c                        |  799 +++
+ drivers/interconnect/qcom/Kconfig                  |   13 +
+ drivers/interconnect/qcom/Makefile                 |    5 +
+ drivers/interconnect/qcom/sdm845.c                 |  838 +++
+ drivers/iommu/Kconfig                              |   17 +-
+ drivers/iommu/Makefile                             |    1 +
+ drivers/iommu/amd_iommu.c                          |   36 +-
+ drivers/iommu/amd_iommu_init.c                     |   20 +-
+ drivers/iommu/amd_iommu_v2.c                       |   24 -
+ drivers/iommu/arm-smmu-v3.c                        |    3 +-
+ drivers/iommu/arm-smmu.c                           |    2 +-
+ drivers/iommu/dma-iommu.c                          |    3 +-
+ drivers/iommu/dmar.c                               |    5 +-
+ drivers/iommu/exynos-iommu.c                       |    1 +
+ drivers/iommu/hyperv-iommu.c                       |  196 +
+ drivers/iommu/intel-iommu.c                        |  161 +-
+ drivers/iommu/intel-pasid.c                        |    2 +-
+ drivers/iommu/intel-svm.c                          |   88 +-
+ drivers/iommu/intel_irq_remapping.c                |   32 +-
+ drivers/iommu/io-pgtable-arm-v7s.c                 |    6 +-
+ drivers/iommu/io-pgtable-arm.c                     |    3 +-
+ drivers/iommu/io-pgtable.c                         |    5 +-
+ drivers/iommu/iommu-debugfs.c                      |   23 +-
+ drivers/iommu/iommu.c                              |   16 +-
+ drivers/iommu/ipmmu-vmsa.c                         |    3 +-
+ drivers/iommu/irq_remapping.c                      |    3 +
+ drivers/iommu/irq_remapping.h                      |    1 +
+ drivers/iommu/msm_iommu.c                          |   10 +-
+ drivers/iommu/mtk_iommu.h                          |    3 +-
+ drivers/iommu/mtk_iommu_v1.c                       |    2 +-
+ drivers/iommu/qcom_iommu.c                         |    2 +-
+ drivers/iommu/rockchip-iommu.c                     |    3 +-
+ drivers/iommu/tegra-gart.c                         |  473 +-
+ drivers/iommu/tegra-smmu.c                         |    4 -
+ drivers/irqchip/Kconfig                            |   19 +
+ drivers/irqchip/Makefile                           |    3 +
+ drivers/irqchip/irq-brcmstb-l2.c                   |   10 +-
+ drivers/irqchip/irq-davinci-aintc.c                |  163 +
+ drivers/irqchip/irq-davinci-cp-intc.c              |  260 +
+ drivers/irqchip/irq-gic-v3-its.c                   |   28 +-
+ drivers/irqchip/irq-gic-v3.c                       |  265 +-
+ drivers/irqchip/irq-i8259.c                        |    9 +-
+ drivers/irqchip/irq-imx-irqsteer.c                 |  115 +-
+ drivers/irqchip/irq-ls1x.c                         |  192 +
+ drivers/irqchip/irq-sifive-plic.c                  |  116 +-
+ drivers/isdn/hardware/mISDN/hfcpci.c               |    9 +
+ drivers/isdn/hardware/mISDN/mISDNinfineon.c        |    5 +-
+ drivers/isdn/isdnloop/isdnloop.c                   |    2 +-
+ drivers/leds/leds-mlxreg.c                         |   19 +
+ drivers/lightnvm/pblk-core.c                       |    8 +-
+ drivers/lightnvm/pblk-gc.c                         |   20 +-
+ drivers/lightnvm/pblk-init.c                       |    4 +-
+ drivers/lightnvm/pblk-map.c                        |    1 +
+ drivers/lightnvm/pblk-rb.c                         |   26 +-
+ drivers/lightnvm/pblk-recovery.c                   |   64 +-
+ drivers/lightnvm/pblk-rl.c                         |   10 +-
+ drivers/lightnvm/pblk-trace.h                      |    2 +-
+ drivers/lightnvm/pblk-write.c                      |    1 +
+ drivers/lightnvm/pblk.h                            |   17 +-
+ drivers/macintosh/smu.c                            |    5 +-
+ drivers/macintosh/via-cuda.c                       |    8 +-
+ drivers/mailbox/Kconfig                            |   11 +
+ drivers/mailbox/Makefile                           |    2 +
+ drivers/mailbox/imx-mailbox.c                      |    4 +-
+ drivers/mailbox/mailbox-test.c                     |   26 +-
+ drivers/mailbox/stm32-ipcc.c                       |    4 +-
+ drivers/mailbox/tegra-hsp.c                        |    2 +-
+ drivers/mailbox/zynqmp-ipi-mailbox.c               |  725 +++
+ drivers/md/Kconfig                                 |   12 +
+ drivers/md/Makefile                                |    4 +
+ drivers/md/bcache/btree.c                          |    3 +-
+ drivers/md/bcache/extents.c                        |   13 +-
+ drivers/md/bcache/request.c                        |    7 +-
+ drivers/md/bcache/stats.c                          |    2 +-
+ drivers/md/bcache/super.c                          |   30 +-
+ drivers/md/bcache/sysfs.c                          |   81 +-
+ drivers/md/bcache/sysfs.h                          |   23 +-
+ drivers/md/bcache/util.c                           |    6 +-
+ drivers/md/bcache/writeback.h                      |    3 +
+ drivers/md/dm-cache-target.c                       |  127 +-
+ drivers/md/dm-crypt.c                              |    3 +-
+ drivers/md/dm-init.c                               |  303 +
+ drivers/md/dm-integrity.c                          |   10 +-
+ drivers/md/dm-ioctl.c                              |  103 +
+ drivers/md/dm-raid.c                               |   14 +-
+ drivers/md/dm-rq.c                                 |   18 +-
+ drivers/md/dm-rq.h                                 |   16 -
+ drivers/md/dm-snap.c                               |    8 -
+ drivers/md/dm-switch.c                             |    3 +-
+ drivers/md/dm-table.c                              |   13 -
+ drivers/md/dm-thin.c                               |   14 +-
+ drivers/md/dm-verity-fec.c                         |    6 +-
+ drivers/md/dm-writecache.c                         |    2 +-
+ drivers/md/dm-zoned-target.c                       |    1 -
+ drivers/md/dm.c                                    |  139 +-
+ drivers/md/md-linear.c                             |    3 +-
+ drivers/md/persistent-data/dm-block-manager.c      |    8 +-
+ drivers/md/raid1.c                                 |    9 +-
+ drivers/md/raid10.c                                |    3 +-
+ drivers/md/raid5-log.h                             |    1 +
+ drivers/md/raid5-ppl.c                             |   69 +-
+ drivers/md/raid5.c                                 |   90 +-
+ drivers/md/raid5.h                                 |    9 +-
+ drivers/media/cec/cec-api.c                        |    2 +-
+ drivers/media/common/saa7146/saa7146_fops.c        |    2 +-
+ drivers/media/common/saa7146/saa7146_i2c.c         |    5 +-
+ drivers/media/common/saa7146/saa7146_video.c       |    2 +-
+ drivers/media/common/siano/sms-cards.c             |    2 +-
+ drivers/media/common/siano/smscoreapi.h            |    2 +-
+ drivers/media/common/v4l2-tpg/v4l2-tpg-core.c      |   12 +
+ drivers/media/common/videobuf2/videobuf2-core.c    |   53 +-
+ .../media/common/videobuf2/videobuf2-dma-contig.c  |   41 +-
+ drivers/media/common/videobuf2/videobuf2-dma-sg.c  |    4 +-
+ drivers/media/common/videobuf2/videobuf2-memops.c  |    2 +-
+ drivers/media/common/videobuf2/videobuf2-v4l2.c    |   30 +-
+ drivers/media/dvb-core/dmxdev.c                    |    8 +-
+ drivers/media/dvb-core/dvb_ca_en50221.c            |    5 +-
+ drivers/media/dvb-core/dvb_frontend.c              |    2 +-
+ drivers/media/dvb-core/dvbdev.c                    |    2 +-
+ drivers/media/dvb-frontends/cxd2841er.c            |    2 +-
+ drivers/media/dvb-frontends/dib0090.c              |    2 +-
+ drivers/media/dvb-frontends/dib7000m.c             |    4 +-
+ drivers/media/dvb-frontends/dib7000p.c             |    8 +-
+ drivers/media/dvb-frontends/dib8000.c              |   12 +-
+ drivers/media/dvb-frontends/dib9000.c              |    4 +-
+ .../media/dvb-frontends/drx39xyj/drx_dap_fasi.h    |    8 +-
+ drivers/media/dvb-frontends/drx39xyj/drx_driver.h  |    8 +-
+ drivers/media/dvb-frontends/drx39xyj/drxj.c        |   48 +-
+ drivers/media/dvb-frontends/drx39xyj/drxj.h        |   12 +-
+ drivers/media/dvb-frontends/drxd_firm.c            |    2 +-
+ drivers/media/dvb-frontends/drxd_hard.c            |   30 +-
+ drivers/media/dvb-frontends/drxk.h                 |    2 +-
+ drivers/media/dvb-frontends/drxk_hard.c            |    8 +-
+ drivers/media/dvb-frontends/ds3000.c               |    4 +-
+ drivers/media/dvb-frontends/isl6421.c              |    2 +-
+ drivers/media/dvb-frontends/lgdt3306a.c            |    5 +-
+ drivers/media/dvb-frontends/lgdt330x.c             |    2 +-
+ drivers/media/dvb-frontends/m88rs2000.c            |    2 +-
+ drivers/media/dvb-frontends/mt312.c                |    4 +-
+ drivers/media/dvb-frontends/nxt200x.c              |    4 +-
+ drivers/media/dvb-frontends/or51211.c              |    2 +-
+ drivers/media/dvb-frontends/rtl2832_sdr.c          |    2 +-
+ drivers/media/dvb-frontends/s5h1409.c              |    2 +-
+ drivers/media/dvb-frontends/sp8870.c               |    4 +-
+ drivers/media/dvb-frontends/stb0899_algo.c         |    6 +-
+ drivers/media/dvb-frontends/stv0367_defs.h         |    2 +-
+ drivers/media/dvb-frontends/stv0900_core.c         |    4 +-
+ drivers/media/dvb-frontends/stv0910.c              |    4 +-
+ drivers/media/dvb-frontends/stv6110.c              |    2 +-
+ drivers/media/dvb-frontends/tda1004x.h             |    2 +-
+ drivers/media/dvb-frontends/tda10086.c             |    2 +-
+ drivers/media/dvb-frontends/tda18271c2dd.c         |    6 +-
+ drivers/media/i2c/Kconfig                          |   36 +-
+ drivers/media/i2c/Makefile                         |    4 +-
+ drivers/media/i2c/adv7175.c                        |    2 +-
+ drivers/media/i2c/adv748x/adv748x-afe.c            |    2 +-
+ drivers/media/i2c/adv748x/adv748x-core.c           |  335 +-
+ drivers/media/i2c/adv748x/adv748x-csi2.c           |   64 +-
+ drivers/media/i2c/adv748x/adv748x-hdmi.c           |    2 +-
+ drivers/media/i2c/adv748x/adv748x.h                |   28 +-
+ drivers/media/i2c/adv7842.c                        |   10 +-
+ drivers/media/i2c/bt819.c                          |    4 +-
+ drivers/media/i2c/cx25840/cx25840-core.c           |    3 +-
+ drivers/media/i2c/cx25840/cx25840-core.h           |    3 +-
+ drivers/media/i2c/cx25840/cx25840-ir.c             |    4 +-
+ drivers/media/i2c/dw9714.c                         |    2 +-
+ drivers/media/i2c/et8ek8/et8ek8_mode.c             |    2 +-
+ drivers/media/i2c/imx214.c                         |    2 +-
+ drivers/media/i2c/imx274.c                         |   24 +-
+ drivers/media/i2c/lm3560.c                         |    2 +-
+ drivers/media/i2c/lm3646.c                         |    2 +-
+ drivers/media/i2c/m5mols/m5mols.h                  |    2 +-
+ drivers/media/i2c/m5mols/m5mols_core.c             |    2 +-
+ drivers/media/i2c/msp3400-driver.c                 |    2 +-
+ .../i2c/{soc_camera/soc_mt9m001.c => mt9m001.c}    |  457 +-
+ drivers/media/i2c/mt9m111.c                        |   39 +
+ drivers/media/i2c/mt9t112.c                        |    2 +-
+ drivers/media/i2c/ov2640.c                         |   45 +-
+ drivers/media/i2c/ov5640.c                         |  159 +-
+ drivers/media/i2c/ov6650.c                         |    4 +-
+ drivers/media/i2c/ov7670.c                         |  201 +-
+ drivers/media/i2c/ov7740.c                         |    9 +-
+ drivers/media/i2c/ov8856.c                         | 1268 ++++
+ .../i2c/{soc_camera/soc_ov9640.c => ov9640.c}      |  123 +-
+ drivers/media/i2c/{soc_camera => }/ov9640.h        |    7 +-
+ drivers/media/i2c/ov9650.c                         |    4 +-
+ drivers/media/i2c/s5c73m3/s5c73m3-core.c           |    2 +-
+ drivers/media/i2c/s5k4ecgx.c                       |    2 -
+ drivers/media/i2c/s5k6aa.c                         |    2 +-
+ drivers/media/i2c/saa7115.c                        |    2 +-
+ drivers/media/i2c/saa717x.c                        |    2 +-
+ drivers/media/i2c/soc_camera/Makefile              |   10 -
+ drivers/media/i2c/soc_camera/soc_mt9t112.c         | 1157 ----
+ drivers/media/i2c/soc_camera/soc_ov772x.c          | 1123 ----
+ drivers/media/i2c/soc_camera/soc_rj54n1cb0c.c      | 1415 ----
+ drivers/media/i2c/soc_camera/soc_tw9910.c          |  999 ---
+ drivers/media/i2c/tda1997x.c                       |    4 +
+ drivers/media/i2c/tda1997x_regs.h                  |    2 +-
+ drivers/media/i2c/tda9840.c                        |    2 +-
+ drivers/media/i2c/tea6415c.c                       |    2 +-
+ drivers/media/i2c/tea6420.c                        |    2 +-
+ drivers/media/i2c/tvaudio.c                        |    4 +-
+ drivers/media/i2c/tvp514x.c                        |    2 +-
+ drivers/media/i2c/tw9910.c                         |   29 +-
+ drivers/media/i2c/video-i2c.c                      |  110 +-
+ drivers/media/media-request.c                      |    3 +-
+ drivers/media/pci/bt8xx/bttv-audio-hook.c          |    2 +-
+ drivers/media/pci/bt8xx/bttv-audio-hook.h          |    2 +-
+ drivers/media/pci/bt8xx/bttv-cards.c               |   12 +-
+ drivers/media/pci/bt8xx/bttv-driver.c              |   12 +-
+ drivers/media/pci/bt8xx/bttv-risc.c                |    2 +-
+ drivers/media/pci/bt8xx/bttv.h                     |    2 +-
+ drivers/media/pci/bt8xx/dst.c                      |   22 +-
+ drivers/media/pci/cobalt/cobalt-v4l2.c             |    2 +-
+ drivers/media/pci/cx18/cx18-cards.h                |    2 +-
+ drivers/media/pci/cx18/cx18-dvb.c                  |    6 +-
+ drivers/media/pci/cx18/cx18-fileops.c              |    2 +-
+ drivers/media/pci/cx18/cx18-io.h                   |    2 +-
+ drivers/media/pci/cx18/cx18-mailbox.c              |    2 +-
+ drivers/media/pci/cx18/cx18-vbi.c                  |    2 +-
+ drivers/media/pci/cx18/cx23418.h                   |    2 +-
+ drivers/media/pci/cx23885/cx23885-417.c            |    2 +-
+ drivers/media/pci/cx23885/cx23885-alsa.c           |    2 +-
+ drivers/media/pci/cx23885/cx23885-core.c           |    6 +-
+ drivers/media/pci/cx23885/cx23885.h                |    2 +-
+ drivers/media/pci/cx23885/cx23888-ir.c             |    4 +-
+ drivers/media/pci/cx25821/cx25821-alsa.c           |    2 +-
+ drivers/media/pci/cx25821/cx25821-sram.h           |    2 +-
+ drivers/media/pci/cx25821/cx25821.h                |    2 +-
+ drivers/media/pci/dm1105/dm1105.c                  |    2 +-
+ drivers/media/pci/intel/ipu3/ipu3-cio2.c           |   11 +-
+ drivers/media/pci/ivtv/Kconfig                     |   23 +-
+ drivers/media/pci/ivtv/ivtv-yuv.c                  |    2 +-
+ drivers/media/pci/ivtv/ivtvfb.c                    |   16 +-
+ drivers/media/pci/meye/meye.c                      |    8 +-
+ drivers/media/pci/meye/meye.h                      |    4 +-
+ drivers/media/pci/ngene/ngene-core.c               |    2 +-
+ drivers/media/pci/pt1/pt1.c                        |   54 +-
+ drivers/media/pci/pt3/pt3.h                        |    2 +-
+ drivers/media/pci/saa7134/saa7134-cards.c          |    2 +-
+ drivers/media/pci/saa7146/mxb.c                    |    4 +-
+ drivers/media/pci/saa7164/saa7164-api.c            |    2 +-
+ drivers/media/pci/saa7164/saa7164-cards.c          |    4 +-
+ drivers/media/pci/saa7164/saa7164-core.c           |    4 +-
+ drivers/media/pci/saa7164/saa7164-dvb.c            |    2 +-
+ drivers/media/pci/saa7164/saa7164-fw.c             |    2 +-
+ drivers/media/pci/smipcie/smipcie-ir.c             |  132 +-
+ drivers/media/pci/smipcie/smipcie.h                |    1 -
+ drivers/media/pci/solo6x10/solo6x10-disp.c         |    4 +-
+ drivers/media/pci/solo6x10/solo6x10-g723.c         |    4 +-
+ drivers/media/pci/sta2x11/sta2x11_vip.c            |    2 +-
+ drivers/media/pci/ttpci/av7110.c                   |    6 +-
+ drivers/media/pci/tw68/tw68-video.c                |    2 +-
+ drivers/media/pci/tw686x/tw686x-audio.c            |    3 +-
+ drivers/media/platform/Kconfig                     |    5 +-
+ drivers/media/platform/Makefile                    |    2 -
+ drivers/media/platform/aspeed-video.c              |    1 +
+ drivers/media/platform/atmel/atmel-isi.c           |    4 +-
+ drivers/media/platform/coda/coda-bit.c             |   24 +-
+ drivers/media/platform/coda/coda-common.c          |   13 +-
+ drivers/media/platform/coda/coda-jpeg.c            |    2 +-
+ drivers/media/platform/coda/coda.h                 |    2 +
+ drivers/media/platform/davinci/isif.c              |    4 +-
+ drivers/media/platform/davinci/vpbe.c              |    2 +-
+ drivers/media/platform/davinci/vpfe_capture.c      |    2 +-
+ drivers/media/platform/davinci/vpif.c              |    2 +-
+ drivers/media/platform/davinci/vpif_display.c      |    4 +-
+ .../media/platform/exynos4-is/fimc-is-command.h    |    2 +-
+ drivers/media/platform/exynos4-is/fimc-is-param.h  |    2 +-
+ drivers/media/platform/exynos4-is/fimc-is.c        |   16 +-
+ drivers/media/platform/exynos4-is/fimc-isp-video.c |    4 +-
+ drivers/media/platform/exynos4-is/media-dev.h      |    2 +-
+ drivers/media/platform/exynos4-is/mipi-csis.c      |    4 +-
+ drivers/media/platform/fsl-viu.c                   |    2 +-
+ drivers/media/platform/imx-pxp.c                   |   16 +-
+ drivers/media/platform/marvell-ccic/mmp-driver.c   |    4 +-
+ drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c    |   40 +-
+ drivers/media/platform/mtk-mdp/mtk_mdp_core.h      |    6 +-
+ drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c       |   20 +-
+ drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c |   64 +-
+ .../media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c  |  163 +-
+ drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h |   35 +-
+ drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c |   74 +-
+ .../media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c  |  104 +-
+ .../media/platform/mtk-vcodec/vdec/vdec_h264_if.c  |    4 +-
+ .../media/platform/mtk-vcodec/vdec/vdec_vp8_if.c   |    2 +-
+ drivers/media/platform/mtk-vcodec/vdec_drv_if.h    |    2 +-
+ drivers/media/platform/mtk-vcodec/vdec_vpu_if.h    |    2 +-
+ drivers/media/platform/mx2_emmaprp.c               |    6 +-
+ drivers/media/platform/omap/omap_vout.c            |   16 +-
+ drivers/media/platform/omap/omap_voutdef.h         |    4 +-
+ drivers/media/platform/omap3isp/isp.c              |    2 +-
+ drivers/media/platform/omap3isp/ispccdc.c          |    4 +-
+ drivers/media/platform/omap3isp/ispcsi2.c          |    2 +-
+ drivers/media/platform/pxa_camera.c                |   10 +-
+ drivers/media/platform/qcom/venus/core.c           |   12 +-
+ drivers/media/platform/qcom/venus/core.h           |    3 +-
+ drivers/media/platform/qcom/venus/firmware.c       |   53 +-
+ drivers/media/platform/qcom/venus/helpers.c        |    3 -
+ drivers/media/platform/rcar-vin/rcar-core.c        |   26 +-
+ drivers/media/platform/rcar-vin/rcar-csi2.c        |   66 +-
+ drivers/media/platform/rcar-vin/rcar-dma.c         |    4 +-
+ drivers/media/platform/rcar-vin/rcar-v4l2.c        |    4 +-
+ drivers/media/platform/rockchip/rga/rga-hw.c       |    6 +-
+ drivers/media/platform/rockchip/rga/rga.c          |    6 +-
+ drivers/media/platform/s3c-camif/camif-core.h      |    2 +-
+ drivers/media/platform/s5p-g2d/g2d.c               |    6 +-
+ drivers/media/platform/s5p-jpeg/jpeg-core.c        |   63 +-
+ drivers/media/platform/s5p-jpeg/jpeg-core.h        |    6 +-
+ drivers/media/platform/s5p-jpeg/jpeg-hw-s5p.c      |    2 +-
+ drivers/media/platform/s5p-jpeg/jpeg-hw-s5p.h      |    2 +-
+ drivers/media/platform/s5p-jpeg/jpeg-regs.h        |    2 +-
+ drivers/media/platform/s5p-mfc/s5p_mfc.c           |    8 +-
+ drivers/media/platform/s5p-mfc/s5p_mfc_common.h    |    2 +-
+ drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c      |    2 +-
+ drivers/media/platform/s5p-mfc/s5p_mfc_dec.c       |    2 +-
+ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c    |    2 +-
+ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c    |    4 +-
+ drivers/media/platform/seco-cec/seco-cec.h         |    2 +-
+ drivers/media/platform/sh_veu.c                    |    4 +-
+ drivers/media/platform/soc_camera/Kconfig          |   26 -
+ drivers/media/platform/soc_camera/Makefile         |    9 -
+ .../platform/soc_camera/sh_mobile_ceu_camera.c     | 1810 ------
+ .../platform/soc_camera/soc_camera_platform.c      |  188 -
+ drivers/media/platform/soc_camera/soc_scale_crop.c |  426 --
+ drivers/media/platform/soc_camera/soc_scale_crop.h |   47 -
+ drivers/media/platform/sti/bdisp/bdisp-debug.c     |   34 +-
+ .../media/platform/sti/c8sectpfe/c8sectpfe-core.h  |    2 +-
+ drivers/media/platform/sti/delta/delta.h           |    2 +-
+ drivers/media/platform/sti/hva/hva-debugfs.c       |   36 +-
+ drivers/media/platform/sti/hva/hva-h264.c          |    2 +-
+ drivers/media/platform/stm32/stm32-dcmi.c          |    2 +-
+ drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c |   39 +-
+ drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h |    5 +-
+ .../media/platform/sunxi/sun6i-csi/sun6i_video.c   |    3 +
+ drivers/media/platform/ti-vpe/vpdma.c              |   14 +-
+ drivers/media/platform/ti-vpe/vpe.c                |    2 +-
+ drivers/media/platform/vicodec/codec-fwht.c        |  148 +-
+ drivers/media/platform/vicodec/codec-fwht.h        |   30 +-
+ drivers/media/platform/vicodec/codec-v4l2-fwht.c   |  394 +-
+ drivers/media/platform/vicodec/codec-v4l2-fwht.h   |   15 +-
+ drivers/media/platform/vicodec/vicodec-core.c      |  658 +-
+ drivers/media/platform/video-mux.c                 |   20 +
+ drivers/media/platform/vim2m.c                     |  675 +-
+ drivers/media/platform/vimc/Makefile               |    3 +-
+ drivers/media/platform/vimc/vimc-capture.c         |   26 +-
+ drivers/media/platform/vimc/vimc-common.c          |   35 -
+ drivers/media/platform/vimc/vimc-common.h          |   17 +-
+ drivers/media/platform/vimc/vimc-core.c            |    5 +-
+ drivers/media/platform/vimc/vimc-debayer.c         |   26 +-
+ drivers/media/platform/vimc/vimc-scaler.c          |   28 +-
+ drivers/media/platform/vimc/vimc-sensor.c          |   51 +-
+ drivers/media/platform/vimc/vimc-streamer.c        |  188 +
+ drivers/media/platform/vimc/vimc-streamer.h        |   38 +
+ drivers/media/platform/vivid/vivid-core.c          |   26 +-
+ drivers/media/platform/vivid/vivid-vid-cap.c       |   10 +-
+ drivers/media/platform/vivid/vivid-vid-common.c    |   30 +
+ drivers/media/platform/vivid/vivid-vid-out.c       |   57 +-
+ drivers/media/platform/vsp1/vsp1_brx.c             |    4 +-
+ drivers/media/platform/vsp1/vsp1_drm.c             |    6 +-
+ drivers/media/platform/vsp1/vsp1_video.c           |    2 +-
+ drivers/media/platform/xilinx/xilinx-vip.c         |    2 +-
+ drivers/media/radio/radio-si476x.c                 |    2 +-
+ drivers/media/radio/si470x/radio-si470x-i2c.c      |   52 +-
+ drivers/media/radio/si470x/radio-si470x.h          |    1 +
+ drivers/media/radio/wl128x/fmdrv.h                 |    4 +-
+ drivers/media/radio/wl128x/fmdrv_common.c          |    4 +-
+ drivers/media/rc/Kconfig                           |   17 +-
+ drivers/media/rc/Makefile                          |    1 +
+ drivers/media/rc/ati_remote.c                      |    2 +-
+ drivers/media/rc/ene_ir.c                          |    2 +-
+ drivers/media/rc/ene_ir.h                          |    2 +-
+ drivers/media/rc/fintek-cir.h                      |    2 +-
+ drivers/media/rc/ir-rc6-decoder.c                  |    2 +
+ drivers/media/rc/ir-rcmm-decoder.c                 |  254 +
+ drivers/media/rc/ir-xmp-decoder.c                  |    2 +-
+ drivers/media/rc/ite-cir.c                         |    2 +-
+ drivers/media/rc/keymaps/rc-behold-columbus.c      |    4 +-
+ drivers/media/rc/keymaps/rc-behold.c               |    2 +-
+ drivers/media/rc/keymaps/rc-manli.c                |    2 +-
+ .../media/rc/keymaps/rc-powercolor-real-angel.c    |    2 +-
+ drivers/media/rc/mceusb.c                          |    2 +-
+ drivers/media/rc/rc-core-priv.h                    |    5 +
+ drivers/media/rc/rc-ir-raw.c                       |    2 +-
+ drivers/media/rc/rc-main.c                         |   34 +-
+ drivers/media/rc/redrat3.c                         |    2 +-
+ drivers/media/spi/cxd2880-spi.c                    |    8 +-
+ drivers/media/tuners/mxl5005s.c                    |    2 +-
+ drivers/media/tuners/qm1d1b0004.h                  |    2 +-
+ drivers/media/tuners/r820t.c                       |    4 +-
+ drivers/media/tuners/tda18271-common.c             |   10 +-
+ drivers/media/tuners/tda18271-fe.c                 |    2 +-
+ drivers/media/tuners/tda18271.h                    |    4 +-
+ drivers/media/tuners/xc4000.c                      |    4 +-
+ drivers/media/usb/au0828/au0828-core.c             |    2 +-
+ drivers/media/usb/au0828/au0828-dvb.c              |    2 +-
+ drivers/media/usb/au0828/au0828.h                  |    2 +-
+ drivers/media/usb/cpia2/cpia2.h                    |    2 +-
+ drivers/media/usb/cpia2/cpia2_usb.c                |    2 +-
+ drivers/media/usb/cpia2/cpia2_v4l.c                |   11 +-
+ drivers/media/usb/cx231xx/cx231xx-417.c            |    4 +-
+ drivers/media/usb/cx231xx/cx231xx-avcore.c         |    2 +-
+ drivers/media/usb/cx231xx/cx231xx-pcb-cfg.h        |    2 +-
+ drivers/media/usb/cx231xx/cx231xx-vbi.c            |    2 +-
+ drivers/media/usb/cx231xx/cx231xx-video.c          |    2 +-
+ drivers/media/usb/cx231xx/cx231xx.h                |    2 +-
+ drivers/media/usb/dvb-usb-v2/dvb_usb.h             |    2 +-
+ drivers/media/usb/dvb-usb-v2/lmedm04.c             |    8 +-
+ drivers/media/usb/dvb-usb-v2/mxl111sf.c            |    4 +-
+ drivers/media/usb/dvb-usb/af9005.c                 |    2 +-
+ drivers/media/usb/dvb-usb/cinergyT2-fe.c           |    2 +-
+ drivers/media/usb/dvb-usb/cxusb.c                  |    2 +-
+ drivers/media/usb/dvb-usb/dvb-usb-init.c           |    2 +-
+ drivers/media/usb/dvb-usb/dvb-usb.h                |    2 +-
+ drivers/media/usb/dvb-usb/pctv452e.c               |    4 +-
+ drivers/media/usb/em28xx/em28xx-i2c.c              |    4 +-
+ drivers/media/usb/em28xx/em28xx-reg.h              |    2 +-
+ drivers/media/usb/gspca/Kconfig                    |    2 +-
+ drivers/media/usb/gspca/autogain_functions.c       |    2 +-
+ drivers/media/usb/gspca/benq.c                     |    4 +-
+ drivers/media/usb/gspca/cpia1.c                    |   14 +-
+ drivers/media/usb/gspca/gspca.c                    |   18 +-
+ drivers/media/usb/gspca/m5602/m5602_mt9m111.c      |    8 +-
+ drivers/media/usb/gspca/m5602/m5602_po1030.c       |    8 +-
+ drivers/media/usb/gspca/mr97310a.c                 |   10 +-
+ drivers/media/usb/gspca/ov519.c                    |    4 +-
+ drivers/media/usb/gspca/ov534.c                    |  153 +-
+ drivers/media/usb/gspca/pac_common.h               |    2 +-
+ drivers/media/usb/gspca/sn9c20x.c                  |    2 +-
+ drivers/media/usb/gspca/sonixb.c                   |    4 +-
+ drivers/media/usb/gspca/sonixj.c                   |    2 +-
+ drivers/media/usb/gspca/spca501.c                  |    2 +-
+ drivers/media/usb/gspca/sq905.c                    |    2 +-
+ drivers/media/usb/gspca/sunplus.c                  |    4 +-
+ drivers/media/usb/gspca/t613.c                     |    2 +-
+ drivers/media/usb/gspca/touptek.c                  |    4 +-
+ drivers/media/usb/gspca/w996Xcf.c                  |    2 +-
+ drivers/media/usb/gspca/zc3xx-reg.h                |    2 +-
+ drivers/media/usb/gspca/zc3xx.c                    |    8 +-
+ drivers/media/usb/hdpvr/hdpvr-i2c.c                |   14 +-
+ drivers/media/usb/hdpvr/hdpvr.h                    |    2 +-
+ drivers/media/usb/pwc/pwc-dec23.c                  |    4 +-
+ drivers/media/usb/pwc/pwc-if.c                     |   71 +-
+ drivers/media/usb/pwc/pwc-misc.c                   |    2 +-
+ drivers/media/usb/siano/smsusb.c                   |    2 +-
+ drivers/media/usb/stk1160/stk1160-core.c           |    4 +-
+ drivers/media/usb/stk1160/stk1160-reg.h            |    4 +-
+ drivers/media/usb/stkwebcam/stk-webcam.c           |    4 +-
+ drivers/media/usb/tm6000/tm6000-alsa.c             |    2 +-
+ drivers/media/usb/tm6000/tm6000-core.c             |    4 +-
+ drivers/media/usb/tm6000/tm6000-dvb.c              |    2 +-
+ drivers/media/usb/tm6000/tm6000-i2c.c              |    2 +-
+ drivers/media/usb/tm6000/tm6000-stds.c             |    2 +-
+ drivers/media/usb/tm6000/tm6000-video.c            |    4 +-
+ drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c  |    2 +-
+ drivers/media/usb/ttusb-dec/ttusb_dec.c            |    2 +-
+ drivers/media/usb/usbvision/usbvision-core.c       |   10 +-
+ drivers/media/usb/usbvision/usbvision-video.c      |    4 +-
+ drivers/media/usb/usbvision/usbvision.h            |   10 +-
+ drivers/media/usb/uvc/uvc_ctrl.c                   |    2 +-
+ drivers/media/usb/uvc/uvc_driver.c                 |   16 +-
+ drivers/media/usb/uvc/uvc_video.c                  |   10 +-
+ drivers/media/usb/uvc/uvcvideo.h                   |    6 +-
+ drivers/media/usb/zr364xx/zr364xx.c                |    6 +-
+ drivers/media/v4l2-core/v4l2-common.c              |   10 -
+ drivers/media/v4l2-core/v4l2-ctrls.c               |   16 +-
+ drivers/media/v4l2-core/v4l2-event.c               |   19 +-
+ drivers/media/v4l2-core/v4l2-fwnode.c              |   16 +-
+ drivers/media/v4l2-core/v4l2-ioctl.c               |   20 +-
+ drivers/media/v4l2-core/v4l2-mem2mem.c             |   52 +-
+ drivers/media/v4l2-core/videobuf-core.c            |   12 +-
+ drivers/media/v4l2-core/videobuf-dma-contig.c      |    2 +-
+ drivers/media/v4l2-core/videobuf-vmalloc.c         |   22 +-
+ drivers/memory/tegra/mc.c                          |  118 +-
+ drivers/memory/tegra/mc.h                          |   10 +-
+ drivers/mfd/Kconfig                                |   47 +-
+ drivers/mfd/Makefile                               |    5 +
+ drivers/mfd/aat2870-core.c                         |   40 +-
+ drivers/mfd/adp5520.c                              |   30 +-
+ drivers/mfd/as3711.c                               |   14 -
+ drivers/mfd/at91-usart.c                           |   24 +-
+ drivers/mfd/bcm2835-pm.c                           |   92 +
+ drivers/mfd/cros_ec.c                              |   14 +-
+ drivers/mfd/cros_ec_dev.c                          |   91 +-
+ drivers/mfd/cros_ec_dev.h                          |    6 -
+ drivers/mfd/db8500-prcmu.c                         |   10 +-
+ drivers/mfd/htc-i2cpld.c                           |   18 +-
+ drivers/mfd/intel-lpss-acpi.c                      |    1 -
+ drivers/mfd/intel-lpss-pci.c                       |    1 -
+ drivers/mfd/intel-lpss.h                           |    2 +
+ drivers/mfd/lochnagar-i2c.c                        |  398 ++
+ drivers/mfd/max8925-core.c                         |    7 +-
+ drivers/mfd/mxs-lradc.c                            |    2 +-
+ drivers/mfd/qcom-pm8xxx.c                          |   75 +-
+ drivers/mfd/rc5t583.c                              |   14 -
+ drivers/mfd/sec-core.c                             |   16 +-
+ drivers/mfd/sm501.c                                |    6 +-
+ drivers/mfd/sta2x11-mfd.c                          |   10 +-
+ drivers/mfd/stmpe.c                                |   68 +
+ drivers/mfd/stpmic1.c                              |  213 +
+ drivers/mfd/syscon.c                               |   12 +-
+ drivers/mfd/tps65090.c                             |   30 +-
+ drivers/mfd/tps65218.c                             |   89 +
+ drivers/mfd/tps65910.c                             |   18 +-
+ drivers/mfd/tps68470.c                             |    1 -
+ drivers/mfd/tps80031.c                             |   37 +-
+ drivers/mfd/tqmx86.c                               |  281 +
+ drivers/mfd/wm831x-core.c                          |   15 +-
+ drivers/mfd/wm831x-i2c.c                           |   20 +-
+ drivers/mfd/wm831x-spi.c                           |   24 +-
+ drivers/mfd/wm8350-core.c                          |   30 +-
+ drivers/mfd/wm8350-i2c.c                           |   24 +-
+ drivers/mfd/wm8400-core.c                          |   18 +-
+ drivers/misc/Kconfig                               |   12 +
+ drivers/misc/Makefile                              |    2 +
+ drivers/misc/ad525x_dpot.c                         |   24 +-
+ drivers/misc/cardreader/rts5227.c                  |   64 +-
+ drivers/misc/cardreader/rts5249.c                  |   32 +-
+ drivers/misc/cardreader/rts5260.c                  |  136 +-
+ drivers/misc/cardreader/rtsx_pcr.c                 |   40 +-
+ drivers/misc/cardreader/rtsx_pcr.h                 |    5 +
+ drivers/misc/cxl/guest.c                           |    2 +
+ drivers/misc/cxl/pci.c                             |   39 +-
+ drivers/misc/cxl/vphb.c                            |    3 +-
+ drivers/misc/eeprom/at24.c                         |  169 +-
+ drivers/misc/enclosure.c                           |    4 +-
+ drivers/misc/fastrpc.c                             | 1401 ++++
+ drivers/misc/habanalabs/Kconfig                    |   25 +
+ drivers/misc/habanalabs/Makefile                   |   14 +
+ drivers/misc/habanalabs/asid.c                     |   57 +
+ drivers/misc/habanalabs/command_buffer.c           |  445 ++
+ drivers/misc/habanalabs/command_submission.c       |  780 +++
+ drivers/misc/habanalabs/context.c                  |  215 +
+ drivers/misc/habanalabs/debugfs.c                  | 1077 +++
+ drivers/misc/habanalabs/device.c                   | 1140 ++++
+ drivers/misc/habanalabs/goya/Makefile              |    3 +
+ drivers/misc/habanalabs/goya/goya.c                | 5391 +++++++++++++++
+ drivers/misc/habanalabs/goya/goyaP.h               |  211 +
+ drivers/misc/habanalabs/goya/goya_hwmgr.c          |  254 +
+ drivers/misc/habanalabs/goya/goya_security.c       | 2999 +++++++++
+ drivers/misc/habanalabs/habanalabs.h               | 1464 +++++
+ drivers/misc/habanalabs/habanalabs_drv.c           |  461 ++
+ drivers/misc/habanalabs/habanalabs_ioctl.c         |  234 +
+ drivers/misc/habanalabs/hw_queue.c                 |  635 ++
+ drivers/misc/habanalabs/hwmon.c                    |  458 ++
+ drivers/misc/habanalabs/include/armcp_if.h         |  335 +
+ .../include/goya/asic_reg/cpu_ca53_cfg_masks.h     |  191 +
+ .../include/goya/asic_reg/cpu_ca53_cfg_regs.h      |   61 +
+ .../habanalabs/include/goya/asic_reg/cpu_if_regs.h |   49 +
+ .../include/goya/asic_reg/cpu_pll_regs.h           |  105 +
+ .../include/goya/asic_reg/dma_ch_0_regs.h          |  209 +
+ .../include/goya/asic_reg/dma_ch_1_regs.h          |  209 +
+ .../include/goya/asic_reg/dma_ch_2_regs.h          |  209 +
+ .../include/goya/asic_reg/dma_ch_3_regs.h          |  209 +
+ .../include/goya/asic_reg/dma_ch_4_regs.h          |  209 +
+ .../include/goya/asic_reg/dma_macro_masks.h        |  105 +
+ .../include/goya/asic_reg/dma_macro_regs.h         |  181 +
+ .../include/goya/asic_reg/dma_nrtr_masks.h         |  209 +
+ .../include/goya/asic_reg/dma_nrtr_regs.h          |  227 +
+ .../include/goya/asic_reg/dma_qm_0_masks.h         |  465 ++
+ .../include/goya/asic_reg/dma_qm_0_regs.h          |  179 +
+ .../include/goya/asic_reg/dma_qm_1_regs.h          |  179 +
+ .../include/goya/asic_reg/dma_qm_2_regs.h          |  179 +
+ .../include/goya/asic_reg/dma_qm_3_regs.h          |  179 +
+ .../include/goya/asic_reg/dma_qm_4_regs.h          |  179 +
+ .../habanalabs/include/goya/asic_reg/goya_blocks.h | 1372 ++++
+ .../habanalabs/include/goya/asic_reg/goya_masks.h  |  275 +
+ .../habanalabs/include/goya/asic_reg/goya_regs.h   |  118 +
+ .../habanalabs/include/goya/asic_reg/ic_pll_regs.h |  105 +
+ .../habanalabs/include/goya/asic_reg/mc_pll_regs.h |  105 +
+ .../include/goya/asic_reg/mme1_rtr_masks.h         |  653 ++
+ .../include/goya/asic_reg/mme1_rtr_regs.h          |  331 +
+ .../include/goya/asic_reg/mme2_rtr_regs.h          |  331 +
+ .../include/goya/asic_reg/mme3_rtr_regs.h          |  331 +
+ .../include/goya/asic_reg/mme4_rtr_regs.h          |  331 +
+ .../include/goya/asic_reg/mme5_rtr_regs.h          |  331 +
+ .../include/goya/asic_reg/mme6_rtr_regs.h          |  331 +
+ .../include/goya/asic_reg/mme_cmdq_masks.h         |  373 ++
+ .../include/goya/asic_reg/mme_cmdq_regs.h          |  139 +
+ .../habanalabs/include/goya/asic_reg/mme_masks.h   | 1537 +++++
+ .../include/goya/asic_reg/mme_qm_masks.h           |  465 ++
+ .../habanalabs/include/goya/asic_reg/mme_qm_regs.h |  179 +
+ .../habanalabs/include/goya/asic_reg/mme_regs.h    | 1153 ++++
+ .../habanalabs/include/goya/asic_reg/mmu_masks.h   |  143 +
+ .../habanalabs/include/goya/asic_reg/mmu_regs.h    |   53 +
+ .../include/goya/asic_reg/pci_nrtr_masks.h         |  209 +
+ .../include/goya/asic_reg/pci_nrtr_regs.h          |  227 +
+ .../include/goya/asic_reg/pcie_aux_regs.h          |  243 +
+ .../include/goya/asic_reg/psoc_emmc_pll_regs.h     |  105 +
+ .../include/goya/asic_reg/psoc_global_conf_masks.h |  447 ++
+ .../include/goya/asic_reg/psoc_global_conf_regs.h  |  745 +++
+ .../include/goya/asic_reg/psoc_mme_pll_regs.h      |  105 +
+ .../include/goya/asic_reg/psoc_pci_pll_regs.h      |  105 +
+ .../include/goya/asic_reg/psoc_spi_regs.h          |  143 +
+ .../include/goya/asic_reg/sram_y0_x0_rtr_regs.h    |   83 +
+ .../include/goya/asic_reg/sram_y0_x1_rtr_regs.h    |   83 +
+ .../include/goya/asic_reg/sram_y0_x2_rtr_regs.h    |   83 +
+ .../include/goya/asic_reg/sram_y0_x3_rtr_regs.h    |   83 +
+ .../include/goya/asic_reg/sram_y0_x4_rtr_regs.h    |   83 +
+ .../habanalabs/include/goya/asic_reg/stlb_masks.h  |  117 +
+ .../habanalabs/include/goya/asic_reg/stlb_regs.h   |   55 +
+ .../include/goya/asic_reg/tpc0_cfg_masks.h         | 1607 +++++
+ .../include/goya/asic_reg/tpc0_cfg_regs.h          |  887 +++
+ .../include/goya/asic_reg/tpc0_cmdq_masks.h        |  373 ++
+ .../include/goya/asic_reg/tpc0_cmdq_regs.h         |  139 +
+ .../include/goya/asic_reg/tpc0_eml_cfg_masks.h     |  347 +
+ .../include/goya/asic_reg/tpc0_eml_cfg_regs.h      |  313 +
+ .../include/goya/asic_reg/tpc0_nrtr_masks.h        |  209 +
+ .../include/goya/asic_reg/tpc0_nrtr_regs.h         |  227 +
+ .../include/goya/asic_reg/tpc0_qm_masks.h          |  465 ++
+ .../include/goya/asic_reg/tpc0_qm_regs.h           |  179 +
+ .../include/goya/asic_reg/tpc1_cfg_regs.h          |  887 +++
+ .../include/goya/asic_reg/tpc1_cmdq_regs.h         |  139 +
+ .../include/goya/asic_reg/tpc1_qm_regs.h           |  179 +
+ .../include/goya/asic_reg/tpc1_rtr_regs.h          |  323 +
+ .../include/goya/asic_reg/tpc2_cfg_regs.h          |  887 +++
+ .../include/goya/asic_reg/tpc2_cmdq_regs.h         |  139 +
+ .../include/goya/asic_reg/tpc2_qm_regs.h           |  179 +
+ .../include/goya/asic_reg/tpc2_rtr_regs.h          |  323 +
+ .../include/goya/asic_reg/tpc3_cfg_regs.h          |  887 +++
+ .../include/goya/asic_reg/tpc3_cmdq_regs.h         |  139 +
+ .../include/goya/asic_reg/tpc3_qm_regs.h           |  179 +
+ .../include/goya/asic_reg/tpc3_rtr_regs.h          |  323 +
+ .../include/goya/asic_reg/tpc4_cfg_regs.h          |  887 +++
+ .../include/goya/asic_reg/tpc4_cmdq_regs.h         |  139 +
+ .../include/goya/asic_reg/tpc4_qm_regs.h           |  179 +
+ .../include/goya/asic_reg/tpc4_rtr_regs.h          |  323 +
+ .../include/goya/asic_reg/tpc5_cfg_regs.h          |  887 +++
+ .../include/goya/asic_reg/tpc5_cmdq_regs.h         |  139 +
+ .../include/goya/asic_reg/tpc5_qm_regs.h           |  179 +
+ .../include/goya/asic_reg/tpc5_rtr_regs.h          |  323 +
+ .../include/goya/asic_reg/tpc6_cfg_regs.h          |  887 +++
+ .../include/goya/asic_reg/tpc6_cmdq_regs.h         |  139 +
+ .../include/goya/asic_reg/tpc6_qm_regs.h           |  179 +
+ .../include/goya/asic_reg/tpc6_rtr_regs.h          |  323 +
+ .../include/goya/asic_reg/tpc7_cfg_regs.h          |  887 +++
+ .../include/goya/asic_reg/tpc7_cmdq_regs.h         |  139 +
+ .../include/goya/asic_reg/tpc7_nrtr_regs.h         |  227 +
+ .../include/goya/asic_reg/tpc7_qm_regs.h           |  179 +
+ .../include/goya/asic_reg/tpc_pll_regs.h           |  105 +
+ drivers/misc/habanalabs/include/goya/goya.h        |   45 +
+ .../habanalabs/include/goya/goya_async_events.h    |  186 +
+ drivers/misc/habanalabs/include/goya/goya_fw_if.h  |   28 +
+ .../misc/habanalabs/include/goya/goya_packets.h    |  129 +
+ drivers/misc/habanalabs/include/hl_boot_if.h       |   30 +
+ .../habanalabs/include/hw_ip/mmu/mmu_general.h     |   47 +
+ .../misc/habanalabs/include/hw_ip/mmu/mmu_v1_0.h   |   15 +
+ drivers/misc/habanalabs/include/qman_if.h          |   56 +
+ drivers/misc/habanalabs/irq.c                      |  327 +
+ drivers/misc/habanalabs/memory.c                   | 1723 +++++
+ drivers/misc/habanalabs/mmu.c                      |  906 +++
+ drivers/misc/habanalabs/sysfs.c                    |  539 ++
+ drivers/misc/hpilo.c                               |   14 +-
+ drivers/misc/ics932s401.c                          |    2 +
+ drivers/misc/lkdtm/core.c                          |   15 +-
+ drivers/misc/lkdtm/lkdtm.h                         |    2 +
+ drivers/misc/lkdtm/perms.c                         |   36 +-
+ drivers/misc/mei/Kconfig                           |   10 +
+ drivers/misc/mei/Makefile                          |    2 +
+ drivers/misc/mei/bus-fixup.c                       |   16 +
+ drivers/misc/mei/bus.c                             |   22 +-
+ drivers/misc/mei/hbm.c                             |    7 +
+ drivers/misc/mei/hdcp/Makefile                     |    7 +
+ drivers/misc/mei/hdcp/mei_hdcp.c                   |  849 +++
+ drivers/misc/mei/hdcp/mei_hdcp.h                   |  377 ++
+ drivers/misc/mei/hw.h                              |    3 +-
+ drivers/misc/mic/Kconfig                           |    3 +-
+ drivers/misc/mic/bus/scif_bus.h                    |    8 +-
+ drivers/misc/mic/bus/vop_bus.h                     |    8 +-
+ drivers/misc/mic/card/mic_device.c                 |    8 +-
+ drivers/misc/mic/host/mic_boot.c                   |    8 +-
+ drivers/misc/mic/scif/scif_map.h                   |    4 +-
+ drivers/misc/mic/scif/scif_rma.c                   |   40 +-
+ drivers/misc/mic/vop/vop_main.c                    |   29 +-
+ drivers/misc/mic/vop/vop_vringh.c                  |   51 +-
+ drivers/misc/pch_phub.c                            |    1 -
+ drivers/misc/pci_endpoint_test.c                   |    1 +
+ drivers/misc/sgi-gru/grufault.c                    |    4 +-
+ drivers/misc/sgi-xp/xpc_uv.c                       |    3 +-
+ drivers/misc/vmw_balloon.c                         |   56 +-
+ drivers/misc/vmw_vmci/vmci_doorbell.c              |    9 +-
+ drivers/misc/vmw_vmci/vmci_doorbell.h              |    2 +-
+ drivers/misc/vmw_vmci/vmci_driver.h                |    2 +
+ drivers/misc/vmw_vmci/vmci_guest.c                 |   39 +-
+ drivers/misc/vmw_vmci/vmci_queue_pair.c            |   63 +-
+ drivers/misc/vmw_vmci/vmci_queue_pair.h            |    4 +-
+ drivers/mmc/core/queue.c                           |    3 +-
+ drivers/mtd/ubi/cdev.c                             |   30 +
+ drivers/mtd/ubi/ubi.h                              |    1 +
+ drivers/mtd/ubi/wl.c                               |  174 +-
+ drivers/net/can/usb/peak_usb/pcan_usb_pro.c        |    2 +-
+ drivers/net/dsa/mv88e6xxx/chip.c                   |   11 +
+ drivers/net/dsa/mv88e6xxx/chip.h                   |    3 +
+ drivers/net/dsa/mv88e6xxx/port.c                   |   24 +
+ drivers/net/dsa/mv88e6xxx/port.h                   |    4 +
+ drivers/net/ethernet/8390/pcnet_cs.c               |   10 +
+ drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c      |    3 -
+ drivers/net/ethernet/cavium/liquidio/lio_core.c    |   10 +
+ drivers/net/ethernet/cavium/liquidio/lio_main.c    |    5 +
+ drivers/net/ethernet/cavium/thunder/nicvf_main.c   |    6 +
+ drivers/net/ethernet/chelsio/cxgb4/t4_msg.h        |    8 +
+ drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h        |   12 +
+ drivers/net/ethernet/cisco/enic/enic_main.c        |    6 +-
+ drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c   |    7 +-
+ drivers/net/ethernet/fujitsu/fmvj18x_cs.c          |    5 +
+ drivers/net/ethernet/hisilicon/hns3/hnae3.h        |    1 +
+ drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    |   10 +-
+ .../net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c |    9 +-
+ drivers/net/ethernet/intel/ixgbe/ixgbe_main.c      |    5 +-
+ drivers/net/ethernet/mellanox/mlx4/cmd.c           |    9 +
+ .../net/ethernet/mellanox/mlx4/resource_tracker.c  |    6 +-
+ .../net/ethernet/mellanox/mlx5/core/en_ethtool.c   |    3 +
+ drivers/net/ethernet/mellanox/mlx5/core/en_rep.c   |   13 +-
+ drivers/net/ethernet/mellanox/mlx5/core/en_rx.c    |   11 +-
+ drivers/net/ethernet/mellanox/mlx5/core/eswitch.c  |   17 +-
+ drivers/net/ethernet/mellanox/mlx5/core/fs_core.c  |  161 +-
+ drivers/net/ethernet/mellanox/mlx5/core/fs_core.h  |    1 +
+ drivers/net/ethernet/mellanox/mlx5/core/lag.c      |   21 -
+ drivers/net/ethernet/mellanox/mlx5/core/main.c     |   85 +-
+ .../net/ethernet/mellanox/mlx5/core/mlx5_core.h    |    2 -
+ drivers/net/ethernet/mellanox/mlxsw/core_thermal.c |   21 +-
+ drivers/net/ethernet/mellanox/mlxsw/minimal.c      |   18 +
+ drivers/net/ethernet/microchip/lan743x_main.c      |   55 +-
+ drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h  |    2 +-
+ .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c   |    7 +-
+ drivers/net/ethernet/pasemi/pasemi_mac.c           |    1 +
+ drivers/net/ethernet/qlogic/qede/qede_ethtool.c    |    7 +-
+ drivers/net/ethernet/qlogic/qla3xxx.c              |    6 +
+ drivers/net/ethernet/qlogic/qlge/qlge_main.c       |    5 +
+ drivers/net/ethernet/realtek/8139too.c             |    1 +
+ drivers/net/ethernet/renesas/ravb_main.c           |    2 +-
+ drivers/net/ethernet/renesas/sh_eth.c              |    6 +-
+ drivers/net/ethernet/rocker/rocker_main.c          |    5 +
+ drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c  |  135 +-
+ drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c  |    5 +-
+ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |    6 +-
+ .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |    3 +
+ drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c   |    2 +-
+ drivers/net/ethernet/sun/niu.c                     |    1 +
+ drivers/net/ethernet/ti/Kconfig                    |    6 +-
+ drivers/net/ethernet/ti/cpsw.h                     |    6 +
+ drivers/net/ethernet/ti/davinci_emac.c             |    4 +-
+ drivers/net/ppp/pptp.c                             |    1 +
+ drivers/net/vxlan.c                                |   18 +-
+ drivers/ntb/hw/intel/ntb_hw_gen1.c                 |   25 +-
+ drivers/ntb/hw/intel/ntb_hw_gen1.h                 |    5 +-
+ drivers/ntb/hw/intel/ntb_hw_gen3.c                 |   33 +-
+ drivers/ntb/hw/intel/ntb_hw_intel.h                |   30 +-
+ drivers/ntb/hw/mscc/ntb_hw_switchtec.c             |   56 +-
+ drivers/ntb/ntb_transport.c                        |   31 +-
+ drivers/nvdimm/btt.c                               |   33 +-
+ drivers/nvdimm/btt.h                               |    2 +
+ drivers/nvdimm/btt_devs.c                          |    8 +
+ drivers/nvdimm/bus.c                               |   11 +-
+ drivers/nvdimm/dimm_devs.c                         |    7 +
+ drivers/nvdimm/e820.c                              |    1 +
+ drivers/nvdimm/label.c                             |   26 +-
+ drivers/nvdimm/namespace_devs.c                    |   18 +-
+ drivers/nvdimm/nd.h                                |    2 +-
+ drivers/nvdimm/of_pmem.c                           |    2 +-
+ drivers/nvdimm/pfn_devs.c                          |   24 +-
+ drivers/nvdimm/region_devs.c                       |    8 +
+ drivers/nvme/host/core.c                           |  130 +-
+ drivers/nvme/host/fabrics.c                        |   11 +-
+ drivers/nvme/host/fabrics.h                        |   10 +-
+ drivers/nvme/host/fault_inject.c                   |    2 +-
+ drivers/nvme/host/fc.c                             |   50 +-
+ drivers/nvme/host/lightnvm.c                       |   16 +-
+ drivers/nvme/host/multipath.c                      |   96 +-
+ drivers/nvme/host/nvme.h                           |   26 +-
+ drivers/nvme/host/pci.c                            |  132 +-
+ drivers/nvme/host/rdma.c                           |   26 +-
+ drivers/nvme/host/tcp.c                            |   42 +-
+ drivers/nvme/host/trace.c                          |   24 +-
+ drivers/nvme/host/trace.h                          |   12 +-
+ drivers/nvme/target/admin-cmd.c                    |   10 +-
+ drivers/nvme/target/configfs.c                     |   10 +-
+ drivers/nvme/target/core.c                         |   30 +-
+ drivers/nvme/target/discovery.c                    |   12 +-
+ drivers/nvme/target/fabrics-cmd.c                  |   10 +-
+ drivers/nvme/target/fc.c                           |   56 +-
+ drivers/nvme/target/fcloop.c                       |   13 +-
+ drivers/nvme/target/io-cmd-bdev.c                  |   18 +-
+ drivers/nvme/target/io-cmd-file.c                  |    2 +-
+ drivers/nvme/target/loop.c                         |   10 +-
+ drivers/nvme/target/nvmet.h                        |   10 +-
+ drivers/nvme/target/rdma.c                         |   10 +-
+ drivers/nvmem/Kconfig                              |   12 +-
+ drivers/nvmem/Makefile                             |    2 +
+ drivers/nvmem/bcm-ocotp.c                          |   37 +-
+ drivers/nvmem/core.c                               |   42 +-
+ drivers/nvmem/imx-ocotp.c                          |   13 +
+ drivers/nvmem/sc27xx-efuse.c                       |   12 +-
+ drivers/nvmem/zynqmp_nvmem.c                       |   86 +
+ drivers/of/Kconfig                                 |    6 +-
+ drivers/of/fdt.c                                   |    8 +-
+ drivers/of/of_reserved_mem.c                       |   24 +-
+ drivers/of/unittest.c                              |   23 +-
+ drivers/opp/core.c                                 |   42 +-
+ drivers/opp/debugfs.c                              |  110 +-
+ drivers/opp/of.c                                   |  117 +-
+ drivers/opp/opp.h                                  |   17 +-
+ drivers/parisc/ccio-dma.c                          |    4 +-
+ drivers/parport/daisy.c                            |   32 +-
+ drivers/parport/parport_pc.c                       |    2 +-
+ drivers/parport/probe.c                            |    2 +-
+ drivers/parport/share.c                            |   10 +-
+ drivers/pci/ats.c                                  |   57 +
+ drivers/pci/controller/Kconfig                     |    2 +-
+ drivers/pci/controller/dwc/Kconfig                 |    4 +-
+ drivers/pci/controller/dwc/Makefile                |    2 +-
+ drivers/pci/controller/dwc/pci-dra7xx.c            |   94 +
+ drivers/pci/controller/dwc/pci-imx6.c              |  224 +-
+ drivers/pci/controller/dwc/pci-layerscape-ep.c     |  156 +
+ drivers/pci/controller/dwc/pcie-designware-ep.c    |   16 +-
+ drivers/pci/controller/dwc/pcie-designware-host.c  |  115 +-
+ drivers/pci/controller/dwc/pcie-designware-plat.c  |   19 +-
+ drivers/pci/controller/dwc/pcie-designware.c       |    6 +-
+ drivers/pci/controller/dwc/pcie-designware.h       |   60 +-
+ drivers/pci/controller/dwc/pcie-qcom.c             |    2 +-
+ drivers/pci/controller/pci-aardvark.c              |    4 +-
+ drivers/pci/controller/pci-hyperv.c                |   61 +-
+ drivers/pci/controller/pci-mvebu.c                 |    2 +-
+ drivers/pci/controller/pcie-altera.c               |  270 +-
+ drivers/pci/controller/pcie-cadence-ep.c           |   25 +-
+ drivers/pci/controller/pcie-mediatek.c             |   13 +-
+ drivers/pci/controller/pcie-rockchip-ep.c          |   16 +-
+ drivers/pci/controller/vmd.c                       |   15 +-
+ drivers/pci/endpoint/functions/pci-epf-test.c      |   97 +-
+ drivers/pci/endpoint/pci-epc-core.c                |   53 +
+ drivers/pci/endpoint/pci-epf-core.c                |    4 +-
+ drivers/pci/hotplug/ibmphp.h                       |    1 -
+ drivers/pci/hotplug/ibmphp_core.c                  |    2 -
+ drivers/pci/hotplug/ibmphp_hpc.c                   |   47 +-
+ drivers/pci/hotplug/pciehp_hpc.c                   |   21 +-
+ drivers/pci/msi.c                                  |   39 +-
+ drivers/pci/of.c                                   |    2 +-
+ drivers/pci/pci-bridge-emul.c                      |   86 +-
+ drivers/pci/pci-bridge-emul.h                      |   13 +-
+ drivers/pci/pci-driver.c                           |    4 +-
+ drivers/pci/pci-sysfs.c                            |    5 +-
+ drivers/pci/pci.c                                  |  143 +-
+ drivers/pci/pcie/Kconfig                           |    7 +-
+ drivers/pci/pcie/Makefile                          |    1 +
+ drivers/pci/pcie/aer.c                             |    9 +-
+ drivers/pci/pcie/bw_notification.c                 |  110 +
+ drivers/pci/pcie/dpc.c                             |   27 +-
+ drivers/pci/pcie/pme.c                             |   48 +-
+ drivers/pci/pcie/portdrv.h                         |    6 +-
+ drivers/pci/pcie/portdrv_core.c                    |   17 +-
+ drivers/pci/pcie/portdrv_pci.c                     |    9 +-
+ drivers/pci/probe.c                                |  120 +-
+ drivers/pci/quirks.c                               |    4 +-
+ drivers/pci/setup-bus.c                            |   63 +-
+ drivers/perf/arm-cci.c                             |   10 +-
+ drivers/perf/arm-ccn.c                             |    6 +-
+ drivers/perf/arm_dsu_pmu.c                         |    9 +-
+ drivers/perf/arm_pmu.c                             |   15 +-
+ drivers/perf/arm_spe_pmu.c                         |    6 +-
+ drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c      |    1 +
+ drivers/perf/hisilicon/hisi_uncore_hha_pmu.c       |    1 +
+ drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c       |    1 +
+ drivers/perf/hisilicon/hisi_uncore_pmu.c           |    9 -
+ drivers/perf/qcom_l2_pmu.c                         |    9 +-
+ drivers/perf/qcom_l3_pmu.c                         |    8 +-
+ drivers/perf/thunderx2_pmu.c                       |   10 +-
+ drivers/perf/xgene_pmu.c                           |    8 +-
+ drivers/phy/allwinner/Kconfig                      |   12 +
+ drivers/phy/allwinner/Makefile                     |    1 +
+ .../allwinner/phy-sun6i-mipi-dphy.c}               |  164 +-
+ drivers/phy/broadcom/phy-bcm-sr-pcie.c             |    4 +-
+ drivers/phy/cadence/Kconfig                        |   13 +-
+ drivers/phy/cadence/Makefile                       |    1 +
+ drivers/phy/cadence/cdns-dphy.c                    |  391 ++
+ drivers/phy/freescale/Kconfig                      |    2 +-
+ drivers/phy/marvell/Kconfig                        |   21 +
+ drivers/phy/marvell/Makefile                       |    2 +
+ drivers/phy/marvell/phy-armada375-usb2.c           |   13 +-
+ drivers/phy/marvell/phy-mvebu-a3700-comphy.c       |  318 +
+ drivers/phy/marvell/phy-mvebu-a3700-utmi.c         |  278 +
+ drivers/phy/marvell/phy-mvebu-cp110-comphy.c       |    2 -
+ drivers/phy/marvell/phy-mvebu-sata.c               |    9 +-
+ drivers/phy/phy-core-mipi-dphy.c                   |    8 +-
+ drivers/phy/phy-core.c                             |   12 +-
+ drivers/phy/qualcomm/phy-qcom-qmp.c                |  143 +
+ drivers/phy/qualcomm/phy-qcom-qmp.h                |    4 +
+ drivers/phy/qualcomm/phy-qcom-qusb2.c              |   40 +
+ drivers/phy/qualcomm/phy-qcom-ufs-i.h              |   19 +-
+ drivers/phy/rockchip/phy-rockchip-inno-usb2.c      |   48 +-
+ drivers/phy/ti/Kconfig                             |    6 +-
+ drivers/phy/ti/phy-omap-usb2.c                     |  105 +-
+ drivers/pinctrl/bcm/pinctrl-bcm2835.c              |    4 +-
+ drivers/pinctrl/berlin/pinctrl-as370.c             |   58 +-
+ drivers/pinctrl/cirrus/pinctrl-madera-core.c       |    1 +
+ drivers/pinctrl/freescale/Kconfig                  |   16 +-
+ drivers/pinctrl/freescale/Makefile                 |    2 +
+ drivers/pinctrl/freescale/pinctrl-imx8mm.c         |  348 +
+ drivers/pinctrl/freescale/pinctrl-imx8qm.c         |  326 +
+ drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c   |    8 +-
+ drivers/pinctrl/meson/pinctrl-meson.c              |   24 +-
+ drivers/pinctrl/meson/pinctrl-meson.h              |    1 +
+ drivers/pinctrl/meson/pinctrl-meson8b.c            |    6 +-
+ drivers/pinctrl/mvebu/pinctrl-armada-37xx.c        |   15 +-
+ drivers/pinctrl/nomadik/pinctrl-nomadik.c          |   17 +-
+ drivers/pinctrl/pinconf.c                          |  222 -
+ drivers/pinctrl/pinctrl-amd.c                      |    2 +-
+ drivers/pinctrl/pinctrl-at91.c                     |  134 +-
+ drivers/pinctrl/pinctrl-at91.h                     |    3 +
+ drivers/pinctrl/pinctrl-ingenic.c                  |  367 +-
+ drivers/pinctrl/pinctrl-mcp23s08.c                 |   31 +-
+ drivers/pinctrl/qcom/Kconfig                       |    2 +
+ drivers/pinctrl/qcom/pinctrl-qcs404.c              |   25 -
+ drivers/pinctrl/qcom/pinctrl-spmi-gpio.c           |  143 +-
+ drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c           |  157 +-
+ drivers/pinctrl/samsung/pinctrl-exynos.c           |   12 +-
+ drivers/pinctrl/sh-pfc/pfc-emev2.c                 |   20 +
+ drivers/pinctrl/sh-pfc/pfc-r8a7778.c               |    6 +-
+ drivers/pinctrl/sh-pfc/pfc-r8a7790.c               |   17 +
+ drivers/pinctrl/sh-pfc/pfc-r8a7791.c               |   70 +-
+ drivers/pinctrl/sh-pfc/pfc-r8a7792.c               |    1 +
+ drivers/pinctrl/sh-pfc/pfc-r8a7794.c               |   16 +
+ drivers/pinctrl/sh-pfc/pfc-r8a7795.c               |   90 +-
+ drivers/pinctrl/sh-pfc/pfc-r8a7796.c               |   90 +-
+ drivers/pinctrl/sh-pfc/pfc-r8a77965.c              |  404 +-
+ drivers/pinctrl/sh-pfc/pfc-r8a77970.c              |  128 +-
+ drivers/pinctrl/sh-pfc/pfc-r8a77980.c              |   64 +-
+ drivers/pinctrl/sh-pfc/pfc-r8a77990.c              |  388 +-
+ drivers/pinctrl/sh-pfc/pfc-r8a77995.c              |   11 +-
+ drivers/pinctrl/sh-pfc/pfc-sh73a0.c                |    3 +-
+ drivers/pinctrl/sh-pfc/pinctrl.c                   |    2 +
+ drivers/pinctrl/sh-pfc/sh_pfc.h                    |    3 +-
+ drivers/pinctrl/sirf/pinctrl-atlas7.c              |    4 +-
+ drivers/pinctrl/sirf/pinctrl-sirf.c                |    2 +-
+ drivers/pinctrl/stm32/pinctrl-stm32.c              |   70 +-
+ drivers/pinctrl/sunxi/pinctrl-sun9i-a80-r.c        |    1 +
+ drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c          |    1 +
+ drivers/pinctrl/sunxi/pinctrl-sunxi.c              |   41 +
+ drivers/pinctrl/sunxi/pinctrl-sunxi.h              |   12 +
+ drivers/pinctrl/ti/pinctrl-ti-iodelay.c            |    7 +-
+ drivers/platform/chrome/Kconfig                    |   49 +-
+ drivers/platform/chrome/Makefile                   |    9 +-
+ drivers/platform/chrome/chromeos_pstore.c          |   17 +-
+ drivers/platform/chrome/cros_ec_debugfs.c          |   84 +-
+ drivers/platform/chrome/cros_ec_i2c.c              |   32 +-
+ drivers/platform/chrome/cros_ec_lightbar.c         |  150 +-
+ drivers/platform/chrome/cros_ec_lpc.c              |   38 +-
+ drivers/platform/chrome/cros_ec_lpc_mec.c          |   78 +-
+ drivers/platform/chrome/cros_ec_lpc_mec.h          |   63 +-
+ drivers/platform/chrome/cros_ec_lpc_reg.c          |   73 +-
+ drivers/platform/chrome/cros_ec_lpc_reg.h          |   20 +-
+ drivers/platform/chrome/cros_ec_proto.c            |   19 +-
+ drivers/platform/chrome/cros_ec_spi.c              |   31 +-
+ drivers/platform/chrome/cros_ec_sysfs.c            |   62 +-
+ drivers/platform/chrome/cros_ec_vbc.c              |   83 +-
+ drivers/platform/chrome/cros_kbd_led_backlight.c   |   19 +-
+ drivers/platform/chrome/wilco_ec/Kconfig           |   20 +
+ drivers/platform/chrome/wilco_ec/Makefile          |    6 +
+ drivers/platform/chrome/wilco_ec/core.c            |  136 +
+ drivers/platform/chrome/wilco_ec/debugfs.c         |  238 +
+ drivers/platform/chrome/wilco_ec/mailbox.c         |  237 +
+ drivers/platform/goldfish/Kconfig                  |    4 +-
+ drivers/platform/mellanox/mlxreg-hotplug.c         |   28 +-
+ drivers/platform/x86/Kconfig                       |   14 +
+ drivers/platform/x86/Makefile                      |    1 +
+ drivers/platform/x86/asus-wmi.c                    |    9 +-
+ drivers/platform/x86/dell-smbios-wmi.c             |    2 +-
+ drivers/platform/x86/dell-wmi-descriptor.c         |    2 +-
+ drivers/platform/x86/dell-wmi.c                    |    7 +-
+ drivers/platform/x86/dell_rbu.c                    |   50 +-
+ drivers/platform/x86/huawei-wmi.c                  |    3 +-
+ drivers/platform/x86/i2c-multi-instantiate.c       |    9 +
+ drivers/platform/x86/ideapad-laptop.c              |   37 +-
+ drivers/platform/x86/intel-hid.c                   |    7 +-
+ drivers/platform/x86/intel-wmi-thunderbolt.c       |    2 +-
+ drivers/platform/x86/intel_cht_int33fe.c           |   15 +-
+ drivers/platform/x86/intel_int0002_vgpio.c         |   32 +-
+ drivers/platform/x86/intel_pmc_core.c              |  159 +-
+ drivers/platform/x86/intel_pmc_core.h              |   14 +-
+ drivers/platform/x86/mlx-platform.c                |  105 +
+ drivers/platform/x86/pcengines-apuv2.c             |  260 +
+ drivers/platform/x86/sony-laptop.c                 |    8 +-
+ drivers/platform/x86/touchscreen_dmi.c             |   79 +
+ drivers/platform/x86/wmi-bmof.c                    |    2 +-
+ drivers/platform/x86/wmi.c                         |    5 +-
+ drivers/pnp/pnpacpi/rsparser.c                     |   14 +-
+ drivers/power/reset/at91-reset.c                   |   13 +
+ drivers/power/supply/axp288_fuel_gauge.c           |   14 +-
+ drivers/power/supply/bq25890_charger.c             |    4 +-
+ drivers/power/supply/bq27xxx_battery.c             |   20 +-
+ drivers/power/supply/charger-manager.c             |   18 +-
+ drivers/power/supply/cpcap-charger.c               |    1 +
+ drivers/power/supply/ds2782_battery.c              |    8 +-
+ drivers/power/supply/goldfish_battery.c            |   88 +-
+ drivers/power/supply/isp1704_charger.c             |   60 +-
+ drivers/power/supply/max17042_battery.c            |   10 +
+ drivers/power/supply/power_supply_core.c           |    5 +-
+ drivers/power/supply/sc27xx_fuel_gauge.c           |   95 +-
+ drivers/power/supply/twl4030_charger.c             |    4 +-
+ drivers/powercap/intel_rapl.c                      |    2 +
+ drivers/ptp/ptp_clock.c                            |    2 +-
+ drivers/pwm/Kconfig                                |   17 +-
+ drivers/pwm/Makefile                               |    3 +-
+ drivers/pwm/core.c                                 |   10 +-
+ drivers/pwm/pwm-atmel.c                            |  111 +-
+ drivers/pwm/pwm-bcm-kona.c                         |   16 +-
+ drivers/pwm/pwm-hibvt.c                            |   44 +-
+ drivers/pwm/pwm-imx1.c                             |  199 +
+ drivers/pwm/{pwm-imx.c => pwm-imx27.c}             |  224 +-
+ drivers/pwm/pwm-mtk-disp.c                         |   11 +
+ drivers/pwm/pwm-rcar.c                             |   99 +-
+ drivers/rapidio/devices/rio_mport_cdev.c           |    1 +
+ drivers/rapidio/rio-sysfs.c                        |    5 +-
+ drivers/rapidio/rio_cm.c                           |    4 +-
+ drivers/ras/ras.c                                  |    2 +-
+ drivers/remoteproc/qcom_q6v5_adsp.c                |    6 +-
+ drivers/remoteproc/qcom_q6v5_mss.c                 |  209 +-
+ drivers/remoteproc/qcom_q6v5_pas.c                 |   13 +-
+ drivers/remoteproc/qcom_sysmon.c                   |   82 +-
+ drivers/remoteproc/qcom_wcnss.c                    |    6 +-
+ drivers/remoteproc/remoteproc_core.c               |  160 +-
+ drivers/remoteproc/remoteproc_debugfs.c            |   47 +-
+ drivers/remoteproc/remoteproc_internal.h           |   12 +-
+ drivers/remoteproc/remoteproc_virtio.c             |   61 +-
+ drivers/remoteproc/st_remoteproc.c                 |   91 +-
+ drivers/reset/Kconfig                              |   12 +-
+ drivers/reset/Makefile                             |    2 +
+ drivers/reset/reset-brcmstb.c                      |  132 +
+ drivers/reset/reset-imx7.c                         |  172 +-
+ drivers/reset/reset-socfpga.c                      |    2 +-
+ drivers/reset/reset-sunxi.c                        |    1 +
+ drivers/reset/reset-zynqmp.c                       |  114 +
+ drivers/rpmsg/virtio_rpmsg_bus.c                   |   24 +-
+ drivers/rtc/Kconfig                                |   69 +-
+ drivers/rtc/Makefile                               |    6 +
+ drivers/rtc/dev.c                                  |    5 -
+ drivers/rtc/lib.c                                  |    6 +-
+ drivers/rtc/rtc-88pm80x.c                          |   21 +-
+ drivers/rtc/rtc-88pm860x.c                         |   21 +-
+ drivers/rtc/rtc-ab-eoz9.c                          |  465 ++
+ drivers/rtc/rtc-abx80x.c                           |   71 +-
+ drivers/rtc/rtc-cadence.c                          |  423 ++
+ drivers/rtc/rtc-coh901331.c                        |    6 +-
+ drivers/rtc/rtc-ds1307.c                           | 1095 ++--
+ drivers/rtc/rtc-ds1672.c                           |    3 +-
+ drivers/rtc/rtc-hym8563.c                          |    2 +
+ drivers/rtc/rtc-imx-sc.c                           |   21 +-
+ drivers/rtc/rtc-isl1208.c                          |  167 +-
+ drivers/rtc/rtc-mc146818-lib.c                     |    2 +-
+ drivers/rtc/rtc-meson.c                            |  407 ++
+ drivers/rtc/rtc-pcf85063.c                         |   46 +-
+ drivers/rtc/rtc-pcf8523.c                          |   29 +-
+ drivers/rtc/rtc-pic32.c                            |   34 +-
+ drivers/rtc/rtc-pm8xxx.c                           |    6 +-
+ drivers/rtc/rtc-rs5c372.c                          |   76 +-
+ drivers/rtc/rtc-rv3028.c                           |  732 +++
+ drivers/rtc/rtc-rv8803.c                           |   15 +-
+ drivers/rtc/rtc-rx8581.c                           |  114 +-
+ drivers/rtc/rtc-s3c.c                              |   87 +-
+ drivers/rtc/rtc-sd3078.c                           |  231 +
+ drivers/rtc/rtc-snvs.c                             |    6 +
+ drivers/rtc/rtc-tx4939.c                           |   26 +-
+ drivers/rtc/rtc-wilco-ec.c                         |  177 +
+ drivers/rtc/rtc-zynqmp.c                           |   18 +-
+ drivers/s390/cio/chsc.c                            |   37 +
+ drivers/s390/cio/chsc.h                            |    1 +
+ drivers/s390/virtio/virtio_ccw.c                   |   12 +-
+ drivers/scsi/Kconfig                               |   12 +-
+ drivers/scsi/Makefile                              |    1 -
+ drivers/scsi/aacraid/Makefile                      |    2 -
+ drivers/scsi/aacraid/aachba.c                      |    2 +-
+ drivers/scsi/aacraid/aacraid.h                     |    4 +-
+ drivers/scsi/aacraid/commctrl.c                    |    2 +-
+ drivers/scsi/aacraid/commsup.c                     |   30 +-
+ drivers/scsi/aacraid/linit.c                       |   22 +-
+ drivers/scsi/aacraid/src.c                         |    2 +-
+ drivers/scsi/aic7xxx/Makefile                      |    1 -
+ drivers/scsi/aic7xxx/aic79xx_core.c                |   14 +-
+ drivers/scsi/arcmsr/arcmsr.h                       |   13 +-
+ drivers/scsi/arcmsr/arcmsr_hba.c                   |  348 +-
+ drivers/scsi/atari_scsi.c                          |   10 +-
+ drivers/scsi/be2iscsi/be_main.c                    |    2 +-
+ drivers/scsi/bfa/bfa_fcs_lport.c                   |    8 +-
+ drivers/scsi/bfa/bfa_fcs_rport.c                   |   19 +-
+ drivers/scsi/bfa/bfa_ioc.c                         |    9 +-
+ drivers/scsi/bfa/bfad_debugfs.c                    |   18 -
+ drivers/scsi/bnx2fc/bnx2fc_fcoe.c                  |    2 +-
+ drivers/scsi/bnx2i/bnx2i_iscsi.c                   |    2 +-
+ drivers/scsi/csiostor/csio_attr.c                  |    3 -
+ drivers/scsi/csiostor/csio_init.c                  |    6 +-
+ drivers/scsi/csiostor/csio_scsi.c                  |    8 +-
+ drivers/scsi/cxgbi/Makefile                        |    2 +-
+ drivers/scsi/cxgbi/cxgb4i/cxgb4i.c                 |    6 +-
+ drivers/scsi/cxgbi/libcxgbi.c                      |   13 +-
+ drivers/scsi/cxlflash/common.h                     |    3 +-
+ drivers/scsi/cxlflash/main.c                       |    2 +-
+ drivers/scsi/cxlflash/superpipe.c                  |   12 +-
+ drivers/scsi/dpt_i2o.c                             |   73 +-
+ drivers/scsi/esas2r/esas2r.h                       |    4 +-
+ drivers/scsi/esas2r/esas2r_init.c                  |    3 +-
+ drivers/scsi/esas2r/esas2r_ioctl.c                 |   16 +-
+ drivers/scsi/esas2r/esas2r_main.c                  |    2 +-
+ drivers/scsi/fcoe/fcoe.c                           |    2 +-
+ drivers/scsi/fcoe/fcoe_ctlr.c                      |    7 +-
+ drivers/scsi/fcoe/fcoe_sysfs.c                     |   15 +-
+ drivers/scsi/fcoe/fcoe_transport.c                 |    3 +-
+ drivers/scsi/fnic/fnic.h                           |    6 +-
+ drivers/scsi/fnic/fnic_debugfs.c                   |   88 +-
+ drivers/scsi/fnic/fnic_fcs.c                       |   10 +
+ drivers/scsi/fnic/fnic_io.h                        |    3 +-
+ drivers/scsi/fnic/fnic_isr.c                       |    6 +-
+ drivers/scsi/fnic/fnic_main.c                      |   37 +-
+ drivers/scsi/fnic/fnic_scsi.c                      |   40 +-
+ drivers/scsi/fnic/fnic_stats.h                     |    6 +-
+ drivers/scsi/fnic/fnic_trace.c                     |   28 +-
+ drivers/scsi/fnic/fnic_trace.h                     |    4 +-
+ drivers/scsi/fnic/vnic_dev.c                       |  270 +-
+ drivers/scsi/fnic/vnic_dev.h                       |    2 +
+ drivers/scsi/fnic/vnic_devcmd.h                    |  160 +-
+ drivers/scsi/fnic/vnic_resource.h                  |    7 +
+ drivers/scsi/fnic/vnic_rq.c                        |    5 +-
+ drivers/scsi/fnic/vnic_wq.c                        |   69 +-
+ drivers/scsi/fnic/vnic_wq.h                        |    8 +
+ drivers/scsi/gdth.c                                | 1286 +---
+ drivers/scsi/gdth.h                                |   30 -
+ drivers/scsi/gdth_ioctl.h                          |   89 -
+ drivers/scsi/gdth_proc.c                           |  113 +-
+ drivers/scsi/gdth_proc.h                           |    3 -
+ drivers/scsi/hisi_sas/hisi_sas.h                   |  110 +-
+ drivers/scsi/hisi_sas/hisi_sas_main.c              |  895 ++-
+ drivers/scsi/hisi_sas/hisi_sas_v1_hw.c             |    6 +-
+ drivers/scsi/hisi_sas/hisi_sas_v2_hw.c             |   26 +-
+ drivers/scsi/hisi_sas/hisi_sas_v3_hw.c             |  468 +-
+ drivers/scsi/hpsa.c                                |   19 +-
+ drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c           |    6 -
+ drivers/scsi/ipr.c                                 |    3 +-
+ drivers/scsi/iscsi_tcp.c                           |    9 +-
+ drivers/scsi/libiscsi.c                            |   86 +-
+ drivers/scsi/libiscsi_tcp.c                        |   19 +-
+ drivers/scsi/libsas/sas_expander.c                 |   38 +-
+ drivers/scsi/libsas/sas_scsi_host.c                |    2 +-
+ drivers/scsi/lpfc/lpfc.h                           |   97 +-
+ drivers/scsi/lpfc/lpfc_attr.c                      |  469 +-
+ drivers/scsi/lpfc/lpfc_bsg.c                       |    4 +-
+ drivers/scsi/lpfc/lpfc_crtn.h                      |   36 +-
+ drivers/scsi/lpfc/lpfc_ct.c                        |   18 +-
+ drivers/scsi/lpfc/lpfc_debugfs.c                   | 1227 ++--
+ drivers/scsi/lpfc/lpfc_debugfs.h                   |   73 +-
+ drivers/scsi/lpfc/lpfc_els.c                       |    6 +-
+ drivers/scsi/lpfc/lpfc_hbadisc.c                   |   40 +-
+ drivers/scsi/lpfc/lpfc_hw4.h                       |   16 +-
+ drivers/scsi/lpfc/lpfc_init.c                      | 2291 ++++---
+ drivers/scsi/lpfc/lpfc_mbox.c                      |    4 +-
+ drivers/scsi/lpfc/lpfc_nportdisc.c                 |   10 +-
+ drivers/scsi/lpfc/lpfc_nvme.c                      |  745 +--
+ drivers/scsi/lpfc/lpfc_nvme.h                      |   66 +-
+ drivers/scsi/lpfc/lpfc_nvmet.c                     |  448 +-
+ drivers/scsi/lpfc/lpfc_nvmet.h                     |    4 +-
+ drivers/scsi/lpfc/lpfc_scsi.c                      |  894 +--
+ drivers/scsi/lpfc/lpfc_scsi.h                      |   63 +-
+ drivers/scsi/lpfc/lpfc_sli.c                       | 2377 ++++---
+ drivers/scsi/lpfc/lpfc_sli.h                       |   89 +-
+ drivers/scsi/lpfc/lpfc_sli4.h                      |  304 +-
+ drivers/scsi/lpfc/lpfc_version.h                   |    4 +-
+ drivers/scsi/lpfc/lpfc_vport.c                     |   27 +-
+ drivers/scsi/megaraid/megaraid_sas.h               |   54 +-
+ drivers/scsi/megaraid/megaraid_sas_base.c          |  408 +-
+ drivers/scsi/megaraid/megaraid_sas_fusion.c        |   27 +-
+ drivers/scsi/megaraid/megaraid_sas_fusion.h        |    1 +
+ drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h               |    3 +-
+ drivers/scsi/mpt3sas/mpt3sas_base.c                |    4 +
+ drivers/scsi/mpt3sas/mpt3sas_base.h                |    7 +-
+ drivers/scsi/mpt3sas/mpt3sas_scsih.c               |   16 +-
+ drivers/scsi/mvumi.c                               |    5 +-
+ drivers/scsi/nsp32.c                               |    1 -
+ drivers/scsi/osd/Kbuild                            |   20 -
+ drivers/scsi/osd/Kconfig                           |   49 -
+ drivers/scsi/osd/osd_debug.h                       |   30 -
+ drivers/scsi/osd/osd_initiator.c                   | 2076 ------
+ drivers/scsi/osd/osd_uld.c                         |  571 --
+ drivers/scsi/osst.c                                |    2 +-
+ drivers/scsi/pcmcia/Makefile                       |    2 +-
+ drivers/scsi/pcmcia/nsp_cs.c                       |    3 +-
+ drivers/scsi/qedf/qedf_debugfs.c                   |   18 +-
+ drivers/scsi/qedf/qedf_io.c                        |    6 -
+ drivers/scsi/qedf/qedf_main.c                      |    2 +-
+ drivers/scsi/qedi/qedi_debugfs.c                   |   17 +-
+ drivers/scsi/qedi/qedi_fw.c                        |    7 -
+ drivers/scsi/qla2xxx/qla_attr.c                    |  115 +-
+ drivers/scsi/qla2xxx/qla_def.h                     |   43 +-
+ drivers/scsi/qla2xxx/qla_dfs.c                     |   45 +-
+ drivers/scsi/qla2xxx/qla_gbl.h                     |    8 +-
+ drivers/scsi/qla2xxx/qla_gs.c                      |   77 +-
+ drivers/scsi/qla2xxx/qla_init.c                    |  198 +-
+ drivers/scsi/qla2xxx/qla_iocb.c                    |  395 +-
+ drivers/scsi/qla2xxx/qla_isr.c                     |   25 +-
+ drivers/scsi/qla2xxx/qla_mbx.c                     |   96 +-
+ drivers/scsi/qla2xxx/qla_nvme.c                    |   47 +-
+ drivers/scsi/qla2xxx/qla_nvme.h                    |    2 +-
+ drivers/scsi/qla2xxx/qla_os.c                      |  277 +-
+ drivers/scsi/qla2xxx/qla_target.c                  |   28 +-
+ drivers/scsi/qla2xxx/qla_target.h                  |    2 +
+ drivers/scsi/qla2xxx/qla_tmpl.c                    |  237 +-
+ drivers/scsi/qla2xxx/qla_tmpl.h                    |   26 +-
+ drivers/scsi/qla2xxx/qla_version.h                 |    2 +-
+ drivers/scsi/qla2xxx/tcm_qla2xxx.c                 |   31 -
+ drivers/scsi/qla4xxx/ql4_os.c                      |    2 +-
+ drivers/scsi/qlogicpti.c                           |    3 +-
+ drivers/scsi/qlogicpti.h                           |    3 +-
+ drivers/scsi/scsi.c                                |   16 -
+ drivers/scsi/scsi_debug.c                          |  186 +-
+ drivers/scsi/scsi_error.c                          |    3 -
+ drivers/scsi/scsi_lib.c                            |   69 +-
+ drivers/scsi/scsi_scan.c                           |    6 +-
+ drivers/scsi/scsi_transport_sas.c                  |    1 -
+ drivers/scsi/sd.c                                  |  526 +-
+ drivers/scsi/sd.h                                  |   64 +-
+ drivers/scsi/smartpqi/Makefile                     |    1 -
+ drivers/scsi/smartpqi/smartpqi_init.c              |    9 +-
+ drivers/scsi/snic/snic_debugfs.c                   |  133 +-
+ drivers/scsi/snic/snic_main.c                      |   14 +-
+ drivers/scsi/snic/snic_stats.h                     |    2 +-
+ drivers/scsi/snic/snic_trc.c                       |   12 +-
+ drivers/scsi/snic/snic_trc.h                       |    4 +-
+ drivers/scsi/sr.c                                  |    1 -
+ drivers/scsi/st.c                                  |    6 +-
+ drivers/scsi/ufs/Kconfig                           |    1 -
+ drivers/scsi/ufs/ufs-hisi.c                        |  124 +-
+ drivers/scsi/ufs/ufs-hisi.h                        |    4 +
+ drivers/scsi/ufs/ufs.h                             |    1 -
+ drivers/scsi/ufs/ufs_bsg.c                         |   63 +-
+ drivers/scsi/ufs/ufs_quirks.h                      |   29 -
+ drivers/scsi/ufs/ufshcd-dwc.c                      |    4 +-
+ drivers/scsi/ufs/ufshcd-pltfrm.c                   |    2 +-
+ drivers/scsi/ufs/ufshcd-pltfrm.h                   |    2 +-
+ drivers/scsi/ufs/ufshcd.c                          |   90 +-
+ drivers/scsi/ufs/ufshcd.h                          |    2 +-
+ drivers/scsi/virtio_scsi.c                         |   16 +-
+ drivers/slimbus/core.c                             |   45 +-
+ drivers/soc/amlogic/meson-canvas.c                 |   18 +-
+ drivers/soc/amlogic/meson-clk-measure.c            |  196 +
+ drivers/soc/bcm/Kconfig                            |   12 +
+ drivers/soc/bcm/Makefile                           |    1 +
+ drivers/soc/bcm/bcm2835-power.c                    |  661 ++
+ drivers/soc/fsl/Kconfig                            |    1 +
+ drivers/soc/fsl/dpio/dpio-cmd.h                    |    5 +
+ drivers/soc/fsl/dpio/dpio-driver.c                 |   54 +-
+ drivers/soc/fsl/dpio/dpio-service.c                |    5 +-
+ drivers/soc/fsl/dpio/dpio.c                        |   16 +
+ drivers/soc/fsl/dpio/dpio.h                        |    5 +
+ drivers/soc/fsl/dpio/qbman-portal.c                |    5 +-
+ drivers/soc/fsl/guts.c                             |   10 +-
+ drivers/soc/imx/Kconfig                            |    2 +-
+ drivers/soc/imx/gpcv2.c                            |   76 +-
+ drivers/soc/qcom/Kconfig                           |   18 +
+ drivers/soc/qcom/Makefile                          |    2 +
+ drivers/soc/qcom/llcc-sdm845.c                     |    6 +
+ drivers/soc/qcom/llcc-slice.c                      |  101 +-
+ drivers/soc/qcom/qcom_gsbi.c                       |    7 +-
+ drivers/soc/qcom/rmtfs_mem.c                       |   32 +-
+ drivers/soc/qcom/rpmh.c                            |   37 +-
+ drivers/soc/qcom/rpmhpd.c                          |  406 ++
+ drivers/soc/qcom/rpmpd.c                           |  315 +
+ drivers/soc/qcom/smd-rpm.c                         |    1 +
+ drivers/soc/tegra/Kconfig                          |    1 +
+ drivers/soc/tegra/fuse/fuse-tegra.c                |   12 +-
+ drivers/soc/tegra/fuse/speedo-tegra210.c           |    2 +-
+ drivers/soc/tegra/pmc.c                            |  424 +-
+ drivers/soc/ti/knav_dma.c                          |    2 +-
+ drivers/soc/xilinx/Kconfig                         |   20 +
+ drivers/soc/xilinx/Makefile                        |    2 +
+ drivers/soc/xilinx/zynqmp_pm_domains.c             |  321 +
+ drivers/soc/xilinx/zynqmp_power.c                  |  178 +
+ drivers/spi/spi-topcliff-pch.c                     |    1 -
+ drivers/spmi/Kconfig                               |    2 +-
+ drivers/spmi/spmi-pmic-arb.c                       |   67 +-
+ drivers/staging/Kconfig                            |    6 +-
+ drivers/staging/Makefile                           |   13 +-
+ drivers/staging/android/ashmem.c                   |   70 +-
+ drivers/staging/android/ion/Makefile               |    2 +-
+ drivers/staging/android/ion/ion-ioctl.c            |   98 -
+ drivers/staging/android/ion/ion.c                  |   84 +-
+ drivers/staging/android/ion/ion.h                  |   42 +-
+ drivers/staging/android/ion/ion_carveout_heap.c    |   19 +-
+ drivers/staging/android/ion/ion_chunk_heap.c       |   25 +-
+ drivers/staging/android/ion/ion_cma_heap.c         |    6 +-
+ drivers/staging/android/ion/ion_heap.c             |    8 +-
+ drivers/staging/android/ion/ion_page_pool.c        |    2 +-
+ drivers/staging/android/ion/ion_system_heap.c      |   10 +-
+ drivers/staging/android/uapi/ion.h                 |    2 +-
+ drivers/staging/android/vsoc.c                     |    1 -
+ drivers/staging/comedi/comedi_fops.c               |    3 +-
+ drivers/staging/comedi/drivers/cb_pcimdas.c        |    6 +-
+ drivers/staging/comedi/drivers/ni_660x.c           |    1 +
+ drivers/staging/comedi/drivers/ni_pcidio.c         |  444 +-
+ drivers/staging/comedi/drivers/ni_tio.c            |   71 +-
+ drivers/staging/comedi/drivers/ni_tio.h            |    4 +-
+ drivers/staging/comedi/drivers/usbduxfast.c        |    2 +-
+ drivers/staging/emxx_udc/emxx_udc.c                |   31 +-
+ drivers/staging/emxx_udc/emxx_udc.h                |    2 +
+ .../erofs/Documentation/filesystems/erofs.txt      |  208 +
+ drivers/staging/erofs/Makefile                     |    2 +-
+ drivers/staging/erofs/data.c                       |   40 +-
+ drivers/staging/erofs/dir.c                        |   12 +-
+ drivers/staging/erofs/inode.c                      |   41 +-
+ drivers/staging/erofs/internal.h                   |  147 +-
+ drivers/staging/erofs/namei.c                      |  194 +-
+ drivers/staging/erofs/super.c                      |   29 +-
+ drivers/staging/erofs/unzip_vle.c                  |  168 +-
+ drivers/staging/erofs/unzip_vle.h                  |   23 +-
+ drivers/staging/erofs/unzip_vle_lz4.c              |   21 +-
+ drivers/staging/erofs/utils.c                      |   58 +-
+ drivers/staging/erofs/xattr.c                      |  115 +-
+ drivers/staging/erofs/xattr.h                      |   10 +-
+ drivers/staging/fbtft/fb_agm1264k-fl.c             |   52 +-
+ drivers/staging/fbtft/fb_bd663474.c                |    6 +-
+ drivers/staging/fbtft/fb_ili9163.c                 |    6 +-
+ drivers/staging/fbtft/fb_ili9320.c                 |    2 +-
+ drivers/staging/fbtft/fb_ili9325.c                 |    6 +-
+ drivers/staging/fbtft/fb_ili9340.c                 |    2 +-
+ drivers/staging/fbtft/fb_pcd8544.c                 |    4 +-
+ drivers/staging/fbtft/fb_ra8875.c                  |    4 +-
+ drivers/staging/fbtft/fb_s6d1121.c                 |    6 +-
+ drivers/staging/fbtft/fb_sh1106.c                  |    2 +-
+ drivers/staging/fbtft/fb_ssd1289.c                 |    6 +-
+ drivers/staging/fbtft/fb_ssd1305.c                 |    4 +-
+ drivers/staging/fbtft/fb_ssd1306.c                 |    4 +-
+ drivers/staging/fbtft/fb_ssd1325.c                 |    6 +-
+ drivers/staging/fbtft/fb_ssd1331.c                 |   10 +-
+ drivers/staging/fbtft/fb_ssd1351.c                 |    4 +-
+ drivers/staging/fbtft/fb_tinylcd.c                 |    2 +-
+ drivers/staging/fbtft/fb_tls8204.c                 |    6 +-
+ drivers/staging/fbtft/fb_uc1611.c                  |    4 +-
+ drivers/staging/fbtft/fb_uc1701.c                  |    6 +-
+ drivers/staging/fbtft/fb_upd161704.c               |    6 +-
+ drivers/staging/fbtft/fb_watterott.c               |    4 +-
+ drivers/staging/fbtft/fbtft-bus.c                  |    6 +-
+ drivers/staging/fbtft/fbtft-core.c                 |  178 +-
+ drivers/staging/fbtft/fbtft-io.c                   |   26 +-
+ drivers/staging/fbtft/fbtft.h                      |   21 +-
+ drivers/staging/fbtft/fbtft_device.c               |  344 +-
+ drivers/staging/fbtft/flexfb.c                     |   12 +-
+ drivers/staging/fsl-dpaa2/ethsw/dpsw-cmd.h         |    2 +-
+ drivers/staging/fsl-dpaa2/ethsw/dpsw.h             |    2 +-
+ drivers/staging/fsl-dpaa2/ethsw/ethsw.h            |    2 +-
+ drivers/staging/fwserial/fwserial.c                |    1 +
+ drivers/staging/gasket/gasket_interrupt.c          |    1 -
+ drivers/staging/goldfish/goldfish_audio.c          |   10 -
+ drivers/staging/greybus/Kconfig                    |    1 +
+ drivers/staging/greybus/TODO                       |    2 -
+ drivers/staging/greybus/arche-apb-ctrl.c           |  152 +-
+ drivers/staging/greybus/arche-platform.c           |  124 +-
+ drivers/staging/greybus/audio_topology.c           |    1 -
+ drivers/staging/greybus/bundle.c                   |    2 +-
+ drivers/staging/greybus/connection.h               |    2 +-
+ drivers/staging/greybus/control.c                  |    1 -
+ drivers/staging/greybus/core.c                     |    2 +-
+ drivers/staging/greybus/gpio.c                     |  156 +-
+ drivers/staging/gs_fpgaboot/gs_fpgaboot.c          |   12 +-
+ drivers/staging/gs_fpgaboot/gs_fpgaboot.h          |   12 +-
+ drivers/staging/gs_fpgaboot/io.c                   |   16 +-
+ drivers/staging/gs_fpgaboot/io.h                   |   12 +-
+ drivers/staging/iio/adc/Kconfig                    |   34 -
+ drivers/staging/iio/adc/Makefile                   |    4 -
+ drivers/staging/iio/adc/ad7280a.c                  |  243 +-
+ drivers/staging/iio/adc/ad7816.c                   |    7 +-
+ drivers/staging/iio/addac/adt7316-i2c.c            |    6 +-
+ drivers/staging/iio/addac/adt7316-spi.c            |    4 +-
+ drivers/staging/iio/addac/adt7316.c                |  143 +-
+ drivers/staging/iio/cdc/Kconfig                    |   10 -
+ drivers/staging/iio/cdc/Makefile                   |    1 -
+ drivers/staging/iio/cdc/ad7152.c                   |  552 --
+ drivers/staging/iio/frequency/ad9834.c             |   54 +-
+ drivers/staging/iio/frequency/ad9834.h             |   28 -
+ drivers/staging/iio/impedance-analyzer/ad5933.c    |   57 +-
+ drivers/staging/ks7010/Makefile                    |    2 +-
+ drivers/staging/ks7010/TODO                        |    2 -
+ drivers/staging/ks7010/ks_hostif.c                 |  119 +-
+ drivers/staging/ks7010/ks_wlan_net.c               |    2 +-
+ drivers/staging/ks7010/michael_mic.c               |  127 -
+ drivers/staging/ks7010/michael_mic.h               |   21 -
+ drivers/staging/media/Kconfig                      |    6 +-
+ drivers/staging/media/Makefile                     |    3 +-
+ drivers/staging/media/davinci_vpfe/Makefile        |    2 +-
+ .../staging/media/davinci_vpfe/dm365_ipipe_hw.c    |    2 +-
+ drivers/staging/media/davinci_vpfe/dm365_isif.c    |    4 +-
+ drivers/staging/media/davinci_vpfe/dm365_resizer.c |    4 +-
+ .../staging/media/davinci_vpfe/vpfe_mc_capture.c   |    2 +-
+ drivers/staging/media/imx/Kconfig                  |    9 +-
+ drivers/staging/media/imx/Makefile                 |    4 +
+ drivers/staging/media/imx/TODO                     |    9 +
+ drivers/staging/media/imx/imx-ic-common.c          |    6 +-
+ drivers/staging/media/imx/imx-ic-prp.c             |   25 +-
+ drivers/staging/media/imx/imx-ic-prpencvf.c        |   91 +-
+ drivers/staging/media/imx/imx-media-capture.c      |  119 +-
+ drivers/staging/media/imx/imx-media-csi.c          |  230 +-
+ drivers/staging/media/imx/imx-media-dev-common.c   |   90 +
+ drivers/staging/media/imx/imx-media-dev.c          |  122 +-
+ drivers/staging/media/imx/imx-media-internal-sd.c  |   20 +-
+ drivers/staging/media/imx/imx-media-of.c           |    6 +-
+ drivers/staging/media/imx/imx-media-utils.c        |   47 +-
+ drivers/staging/media/imx/imx-media-vdic.c         |   21 +-
+ drivers/staging/media/imx/imx-media.h              |   45 +-
+ drivers/staging/media/imx/imx7-media-csi.c         | 1369 ++++
+ drivers/staging/media/imx/imx7-mipi-csis.c         | 1160 ++++
+ drivers/staging/media/imx074/Kconfig               |    5 -
+ drivers/staging/media/imx074/Makefile              |    1 -
+ drivers/staging/media/imx074/TODO                  |    5 -
+ drivers/staging/media/ipu3/Makefile                |    6 +
+ drivers/staging/media/ipu3/TODO                    |    7 +-
+ drivers/staging/media/ipu3/include/intel-ipu3.h    |   10 +-
+ drivers/staging/media/ipu3/ipu3-abi.h              |    2 +-
+ drivers/staging/media/ipu3/ipu3-css-fw.c           |   18 +-
+ drivers/staging/media/ipu3/ipu3-css-fw.h           |    8 +-
+ drivers/staging/media/ipu3/ipu3-css-params.c       |  271 +-
+ drivers/staging/media/ipu3/ipu3-css-params.h       |    8 +-
+ drivers/staging/media/ipu3/ipu3-css-pool.c         |   32 +-
+ drivers/staging/media/ipu3/ipu3-css-pool.h         |   30 +-
+ drivers/staging/media/ipu3/ipu3-css.c              |  460 +-
+ drivers/staging/media/ipu3/ipu3-css.h              |   92 +-
+ drivers/staging/media/ipu3/ipu3-dmamap.c           |   43 +-
+ drivers/staging/media/ipu3/ipu3-dmamap.h           |   14 +-
+ drivers/staging/media/ipu3/ipu3-mmu.c              |  125 +-
+ drivers/staging/media/ipu3/ipu3-mmu.h              |   18 +-
+ drivers/staging/media/ipu3/ipu3-tables.c           |   50 +-
+ drivers/staging/media/ipu3/ipu3-tables.h           |   54 +-
+ drivers/staging/media/ipu3/ipu3-v4l2.c             |  299 +-
+ drivers/staging/media/ipu3/ipu3.c                  |   97 +-
+ drivers/staging/media/ipu3/ipu3.h                  |   20 +-
+ drivers/staging/media/omap4iss/iss_csi2.c          |    2 +-
+ .../media/rockchip/vpu/rk3288_vpu_hw_jpeg_enc.c    |    6 +-
+ .../media/rockchip/vpu/rk3399_vpu_hw_jpeg_enc.c    |    6 +-
+ .../i2c => staging/media}/soc_camera/Kconfig       |   46 +-
+ drivers/staging/media/soc_camera/Makefile          |    7 +
+ .../staging/media/{imx074 => soc_camera}/imx074.c  |    0
+ .../media/{mt9t031 => soc_camera}/mt9t031.c        |    0
+ .../media}/soc_camera/soc_camera.c                 |    4 +-
+ .../media}/soc_camera/soc_mediabus.c               |    0
+ .../i2c => staging/media}/soc_camera/soc_mt9v022.c |    0
+ .../i2c => staging/media}/soc_camera/soc_ov5642.c  |    0
+ .../i2c => staging/media}/soc_camera/soc_ov9740.c  |    0
+ drivers/staging/media/sunxi/cedrus/TODO            |    5 -
+ drivers/staging/media/sunxi/cedrus/cedrus.h        |    9 +-
+ drivers/staging/media/sunxi/cedrus/cedrus_dec.c    |    2 +
+ drivers/staging/media/sunxi/cedrus/cedrus_dec.h    |    6 -
+ drivers/staging/media/sunxi/cedrus/cedrus_hw.c     |   28 +-
+ drivers/staging/media/sunxi/cedrus/cedrus_mpeg2.c  |   23 +-
+ drivers/staging/media/sunxi/cedrus/cedrus_video.c  |   19 +
+ drivers/staging/media/zoran/zoran.h                |    2 +-
+ drivers/staging/media/zoran/zoran_card.c           |    2 +-
+ drivers/staging/media/zoran/zoran_device.c         |    6 +-
+ drivers/staging/media/zoran/zoran_driver.c         |    4 +-
+ drivers/staging/most/Makefile                      |    2 +-
+ drivers/staging/most/cdev/Makefile                 |    2 +-
+ drivers/staging/most/cdev/cdev.c                   |    5 +-
+ drivers/staging/most/dim2/Makefile                 |    2 +-
+ drivers/staging/most/i2c/Makefile                  |    2 +-
+ drivers/staging/most/net/Makefile                  |    2 +-
+ drivers/staging/most/sound/Makefile                |    2 +-
+ drivers/staging/most/usb/Makefile                  |    2 +-
+ drivers/staging/most/video/Makefile                |    2 +-
+ drivers/staging/mt7621-dma/Kconfig                 |    6 -
+ drivers/staging/mt7621-dma/Makefile                |    1 -
+ drivers/staging/mt7621-dma/mtk-hsdma.c             |   11 +-
+ drivers/staging/mt7621-dts/gbpc1.dts               |    4 +-
+ drivers/staging/mt7621-dts/mt7621.dtsi             |   59 +-
+ drivers/staging/mt7621-eth/ethtool.c               |    1 +
+ drivers/staging/mt7621-eth/ethtool.h               |   11 +-
+ drivers/staging/mt7621-mmc/Kconfig                 |    2 +-
+ drivers/staging/mt7621-mmc/dbg.c                   |    1 -
+ drivers/staging/mt7621-mmc/mt6575_sd.h             |    2 +-
+ drivers/staging/mt7621-pci-phy/Kconfig             |    7 +
+ drivers/staging/mt7621-pci-phy/Makefile            |    1 +
+ drivers/staging/mt7621-pci-phy/TODO                |    4 +
+ .../mt7621-pci-phy/mediatek,mt7621-pci-phy.txt     |   54 +
+ drivers/staging/mt7621-pci-phy/pci-mt7621-phy.c    |  387 ++
+ drivers/staging/mt7621-pci/Makefile                |    2 +-
+ drivers/staging/mt7621-pci/TODO                    |    8 -
+ drivers/staging/mt7621-pci/pci-mt7621.c            |  300 +-
+ drivers/staging/mt7621-pinctrl/Kconfig             |    1 +
+ drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c    |   49 +-
+ drivers/staging/mt7621-spi/spi-mt7621.c            |   72 +-
+ drivers/staging/netlogic/Kconfig                   |    2 +-
+ drivers/staging/netlogic/platform_net.c            |   51 +-
+ drivers/staging/netlogic/platform_net.h            |   32 +-
+ drivers/staging/netlogic/xlr_net.c                 |   31 +-
+ drivers/staging/netlogic/xlr_net.h                 |   33 +-
+ drivers/staging/octeon-usb/octeon-hcd.h            |    2 +-
+ drivers/staging/ralink-gdma/Kconfig                |    6 +
+ drivers/staging/ralink-gdma/Makefile               |    3 +
+ .../{mt7621-dma => ralink-gdma}/ralink-gdma.c      |    6 +-
+ drivers/staging/rtl8188eu/core/rtw_ap.c            |    8 +-
+ drivers/staging/rtl8188eu/core/rtw_cmd.c           |   12 +-
+ drivers/staging/rtl8188eu/core/rtw_efuse.c         |    4 +-
+ drivers/staging/rtl8188eu/core/rtw_ieee80211.c     |   10 +-
+ drivers/staging/rtl8188eu/core/rtw_ioctl_set.c     |   12 +-
+ drivers/staging/rtl8188eu/core/rtw_mlme.c          |   44 +-
+ drivers/staging/rtl8188eu/core/rtw_mlme_ext.c      |   38 +-
+ drivers/staging/rtl8188eu/core/rtw_wlan_util.c     |   18 +-
+ drivers/staging/rtl8188eu/core/rtw_xmit.c          |    2 +-
+ drivers/staging/rtl8188eu/hal/odm.c                |   11 +-
+ drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c       |   67 +-
+ drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c     |    4 +-
+ drivers/staging/rtl8188eu/include/odm.h            |    1 -
+ drivers/staging/rtl8188eu/include/odm_hwconfig.h   |    9 -
+ drivers/staging/rtl8188eu/include/wifi.h           |   12 -
+ drivers/staging/rtl8188eu/include/wlan_bssdef.h    |    6 +-
+ drivers/staging/rtl8188eu/os_dep/ioctl_linux.c     |   34 +-
+ drivers/staging/rtl8188eu/os_dep/mlme_linux.c      |   72 +-
+ drivers/staging/rtl8188eu/os_dep/os_intfs.c        |   26 +-
+ drivers/staging/rtl8188eu/os_dep/rtw_android.c     |    2 +-
+ drivers/staging/rtl8188eu/os_dep/usb_intf.c        |    6 +-
+ drivers/staging/rtl8192e/dot11d.c                  |  120 +-
+ drivers/staging/rtl8192e/dot11d.h                  |   77 +-
+ drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c     |    8 +-
+ drivers/staging/rtl8192e/rtl8192e/rtl_core.c       |   23 +-
+ drivers/staging/rtl8192e/rtl8192e/rtl_dm.c         |    2 +-
+ drivers/staging/rtl8192e/rtl8192e/rtl_wx.c         |    8 +-
+ drivers/staging/rtl8192e/rtl819x_BAProc.c          |    6 +-
+ drivers/staging/rtl8192e/rtllib.h                  |    6 +-
+ drivers/staging/rtl8192e/rtllib_crypt_tkip.c       |    2 +-
+ drivers/staging/rtl8192e/rtllib_rx.c               |    4 +-
+ drivers/staging/rtl8192e/rtllib_softmac.c          |   22 +-
+ drivers/staging/rtl8192e/rtllib_wx.c               |    4 +-
+ drivers/staging/rtl8192u/Makefile                  |    2 +-
+ drivers/staging/rtl8192u/r8192U_core.c             |   24 +-
+ drivers/staging/rtl8712/ieee80211.c                |    2 +-
+ drivers/staging/rtl8712/rtl8712_efuse.c            |    2 +-
+ drivers/staging/rtl8712/rtl8712_led.c              |    6 +-
+ drivers/staging/rtl8712/rtl871x_mlme.c             |    2 +-
+ drivers/staging/rtl8712/rtl871x_recv.c             |    6 +-
+ drivers/staging/rtl8712/rtl871x_sta_mgt.c          |    2 +-
+ drivers/staging/rtl8712/rtl871x_xmit.c             |    8 +-
+ drivers/staging/rtl8712/usb_intf.c                 |   16 -
+ drivers/staging/rtl8723bs/core/rtw_cmd.c           |    8 -
+ drivers/staging/rtl8723bs/core/rtw_xmit.c          |    2 +-
+ drivers/staging/rtl8723bs/include/drv_types.h      |    1 -
+ drivers/staging/rtlwifi/Kconfig                    |    2 +-
+ drivers/staging/rtlwifi/efuse.c                    |    6 +-
+ .../rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c  |    5 +-
+ drivers/staging/rtlwifi/pci.h                      |    3 +-
+ drivers/staging/rtlwifi/phydm/phydm_rainfo.c       |    2 +-
+ drivers/staging/rtlwifi/rtl8822be/fw.c             |    2 +
+ drivers/staging/rts5208/ms.c                       |    5 +-
+ drivers/staging/rts5208/sd.c                       |    7 +-
+ drivers/staging/sm750fb/ddk750_display.c           |    6 +-
+ drivers/staging/speakup/Kconfig                    |   32 +-
+ drivers/staging/speakup/kobjects.c                 |    2 +
+ drivers/staging/speakup/main.c                     |   14 +-
+ drivers/staging/speakup/speakup_decext.c           |    3 +-
+ drivers/staging/speakup/speakup_dectlk.c           |    3 +-
+ drivers/staging/speakup/speakup_soft.c             |    4 +-
+ drivers/staging/speakup/spk_priv_keyinfo.h         |    9 +-
+ drivers/staging/speakup/spk_ttyio.c                |   20 +-
+ drivers/staging/speakup/varhandlers.c              |    4 +-
+ drivers/staging/unisys/visorhba/Makefile           |    3 +-
+ drivers/staging/unisys/visornic/Makefile           |    3 +-
+ drivers/staging/unisys/visornic/visornic_main.c    |    4 +-
+ drivers/staging/vboxvideo/TODO                     |    3 +
+ drivers/staging/vboxvideo/vbox_drv.c               |   10 +-
+ drivers/staging/vboxvideo/vbox_fb.c                |   23 +-
+ drivers/staging/vboxvideo/vbox_irq.c               |    4 +-
+ drivers/staging/vboxvideo/vbox_mode.c              |    9 +-
+ .../staging/vc04_services/bcm2835-audio/Makefile   |    3 +-
+ .../staging/vc04_services/bcm2835-camera/Makefile  |    2 +-
+ .../vc04_services/bcm2835-camera/bcm2835-camera.c  |    8 +-
+ drivers/staging/vt6655/baseband.c                  |   10 +-
+ drivers/staging/vt6655/baseband.h                  |    2 +-
+ drivers/staging/vt6655/card.c                      |   16 +-
+ drivers/staging/vt6655/card.h                      |    2 +-
+ drivers/staging/vt6655/device_main.c               |    4 +-
+ drivers/staging/vt6656/key.c                       |    4 +-
+ drivers/staging/vt6656/mac.h                       |    2 +-
+ drivers/staging/wilc1000/Makefile                  |    2 +-
+ drivers/staging/wilc1000/host_interface.c          | 1164 +---
+ drivers/staging/wilc1000/host_interface.h          |  165 +-
+ .../staging/wilc1000/{linux_mon.c => wilc_mon.c}   |   77 +-
+ .../wilc1000/{linux_wlan.c => wilc_netdev.c}       |  430 +-
+ drivers/staging/wilc1000/wilc_sdio.c               |  187 +-
+ drivers/staging/wilc1000/wilc_spi.c                |    4 +-
+ drivers/staging/wilc1000/wilc_wfi_cfgoperations.c  |  644 +-
+ drivers/staging/wilc1000/wilc_wfi_cfgoperations.h  |    7 +-
+ drivers/staging/wilc1000/wilc_wfi_netdevice.h      |   14 +-
+ drivers/staging/wilc1000/wilc_wlan.c               |   52 +-
+ drivers/staging/wilc1000/wilc_wlan.h               |   38 +-
+ drivers/staging/wilc1000/wilc_wlan_cfg.c           |   39 +-
+ drivers/staging/wilc1000/wilc_wlan_if.h            |   40 -
+ drivers/staging/wlan-ng/Kconfig                    |    2 +-
+ drivers/staging/wlan-ng/cfg80211.c                 |    3 +-
+ drivers/staging/wlan-ng/prism2fw.c                 |    5 +-
+ drivers/staging/xgifb/Kconfig                      |   11 -
+ drivers/staging/xgifb/Makefile                     |    4 -
+ drivers/staging/xgifb/TODO                         |   13 -
+ drivers/staging/xgifb/XGI_main.h                   |  365 --
+ drivers/staging/xgifb/XGI_main_26.c                | 2084 ------
+ drivers/staging/xgifb/XGIfb.h                      |  109 -
+ drivers/staging/xgifb/vb_def.h                     |  257 -
+ drivers/staging/xgifb/vb_init.c                    | 1367 ----
+ drivers/staging/xgifb/vb_init.h                    |    6 -
+ drivers/staging/xgifb/vb_setmode.c                 | 5528 ----------------
+ drivers/staging/xgifb/vb_setmode.h                 |   24 -
+ drivers/staging/xgifb/vb_struct.h                  |  165 -
+ drivers/staging/xgifb/vb_table.h                   | 2513 -------
+ drivers/staging/xgifb/vb_util.h                    |   46 -
+ drivers/staging/xgifb/vgatypes.h                   |   51 -
+ drivers/target/iscsi/cxgbit/cxgbit.h               |    2 +-
+ drivers/target/iscsi/cxgbit/cxgbit_ddp.c           |    2 +-
+ drivers/target/iscsi/cxgbit/cxgbit_main.c          |    2 +-
+ drivers/target/iscsi/cxgbit/cxgbit_target.c        |    2 +-
+ drivers/target/iscsi/iscsi_target.c                |   47 +-
+ drivers/target/iscsi/iscsi_target.h                |    2 +-
+ drivers/target/iscsi/iscsi_target_configfs.c       |   13 -
+ drivers/target/iscsi/iscsi_target_erl0.c           |    5 +-
+ drivers/target/iscsi/iscsi_target_erl1.c           |   59 +-
+ drivers/target/iscsi/iscsi_target_util.c           |   23 +-
+ drivers/target/loopback/tcm_loop.c                 |   21 -
+ drivers/target/sbp/sbp_target.c                    |    6 -
+ drivers/target/target_core_alua.c                  |    5 +-
+ drivers/target/target_core_configfs.c              |    4 -
+ drivers/target/target_core_device.c                |    6 +-
+ drivers/target/target_core_pr.c                    |   15 +-
+ drivers/target/target_core_tmr.c                   |   39 +-
+ drivers/target/target_core_transport.c             |   49 +-
+ drivers/target/target_core_user.c                  |   19 +-
+ drivers/target/target_core_xcopy.c                 |    6 -
+ drivers/target/tcm_fc/tcm_fc.h                     |    1 -
+ drivers/target/tcm_fc/tfc_cmd.c                    |    7 -
+ drivers/target/tcm_fc/tfc_conf.c                   |    1 -
+ drivers/tee/optee/Makefile                         |    1 +
+ drivers/tee/optee/core.c                           |    4 +
+ drivers/tee/optee/device.c                         |  160 +
+ drivers/tee/optee/optee_msg.h                      |   26 +-
+ drivers/tee/optee/optee_private.h                  |    3 +
+ drivers/tee/optee/optee_smc.h                      |   26 +-
+ drivers/tee/optee/supp.c                           |   10 +-
+ drivers/tee/tee_core.c                             |   78 +-
+ drivers/thermal/Kconfig                            |    4 +-
+ drivers/thermal/broadcom/Kconfig                   |    9 +
+ drivers/thermal/broadcom/Makefile                  |    1 +
+ drivers/thermal/broadcom/sr-thermal.c              |  121 +
+ drivers/thermal/mtk_thermal.c                      |  316 +-
+ drivers/thermal/qcom/tsens-common.c                |   33 +-
+ drivers/thermal/qoriq_thermal.c                    |  104 +-
+ drivers/thermal/rcar_gen3_thermal.c                |   19 +
+ drivers/thermal/tegra/soctherm.c                   |   38 +-
+ drivers/tty/Kconfig                                |   24 +
+ drivers/tty/hvc/hvc_xen.c                          |    2 +-
+ drivers/tty/ipwireless/hardware.c                  |    2 +
+ drivers/tty/n_gsm.c                                |  246 +-
+ drivers/tty/n_hdlc.c                               |    2 +-
+ drivers/tty/n_tty.c                                |    6 +-
+ drivers/tty/nozomi.c                               |   10 +-
+ drivers/tty/serdev/serdev-ttyport.c                |    4 +-
+ drivers/tty/serial/8250/8250_ingenic.c             |   13 +-
+ drivers/tty/serial/8250/8250_lpss.c                |    1 -
+ drivers/tty/serial/8250/8250_of.c                  |    5 +
+ drivers/tty/serial/8250/8250_omap.c                |   75 +-
+ drivers/tty/serial/8250/8250_pci.c                 |  170 +-
+ drivers/tty/serial/8250/8250_pxa.c                 |    4 +
+ drivers/tty/serial/Kconfig                         |   22 +
+ drivers/tty/serial/Makefile                        |    1 +
+ drivers/tty/serial/clps711x.c                      |   23 +-
+ drivers/tty/serial/fsl_lpuart.c                    |  208 +-
+ drivers/tty/serial/lpc32xx_hs.c                    |    4 +
+ drivers/tty/serial/max310x.c                       |   21 +-
+ drivers/tty/serial/meson_uart.c                    |   13 +-
+ drivers/tty/serial/mps2-uart.c                     |  138 +-
+ drivers/tty/serial/msm_serial.c                    |    2 +-
+ drivers/tty/serial/pch_uart.c                      |    2 -
+ drivers/tty/serial/qcom_geni_serial.c              |  279 +-
+ drivers/tty/serial/samsung.c                       |   42 +
+ drivers/tty/serial/sc16is7xx.c                     |    4 +-
+ drivers/tty/serial/serial_core.c                   |    2 +-
+ drivers/tty/serial/sh-sci.c                        |   71 +-
+ drivers/tty/serial/sprd_serial.c                   |    2 +-
+ drivers/tty/serial/tegra-tcu.c                     |  298 +
+ drivers/tty/serial/xilinx_uartps.c                 |   40 +-
+ drivers/tty/synclink.c                             |   54 -
+ drivers/tty/sysrq.c                                |    8 +-
+ drivers/tty/tty_audit.c                            |    2 +-
+ drivers/tty/tty_buffer.c                           |    2 +-
+ drivers/tty/tty_io.c                               |    3 +
+ drivers/tty/tty_ldisc.c                            |   47 +
+ drivers/tty/vt/vc_screen.c                         |   48 +-
+ drivers/tty/vt/vt.c                                |   77 +-
+ drivers/uio/uio.c                                  |   16 +-
+ drivers/uio/uio_pci_generic.c                      |   17 +
+ drivers/usb/Kconfig                                |    1 +
+ drivers/usb/README                                 |   54 -
+ drivers/usb/atm/Kconfig                            |    1 +
+ drivers/usb/chipidea/Kconfig                       |    2 +
+ drivers/usb/chipidea/ci_hdrc_imx.c                 |    6 +-
+ drivers/usb/chipidea/ci_hdrc_imx.h                 |    1 +
+ drivers/usb/chipidea/ci_hdrc_tegra.c               |    1 +
+ drivers/usb/chipidea/core.c                        |   46 +-
+ drivers/usb/chipidea/usbmisc_imx.c                 |    7 +
+ drivers/usb/class/Kconfig                          |    1 +
+ drivers/usb/class/cdc-wdm.c                        |    2 +-
+ drivers/usb/core/Kconfig                           |   13 +
+ drivers/usb/core/config.c                          |   14 +-
+ drivers/usb/core/devio.c                           |   10 +-
+ drivers/usb/core/driver.c                          |   23 +-
+ drivers/usb/core/generic.c                         |   44 +-
+ drivers/usb/core/hcd.c                             |   56 +-
+ drivers/usb/core/hub.c                             |   66 +-
+ drivers/usb/core/hub.h                             |    2 +
+ drivers/usb/core/message.c                         |   10 +-
+ drivers/usb/core/phy.c                             |   28 +
+ drivers/usb/core/phy.h                             |    2 +
+ drivers/usb/core/sysfs.c                           |    5 +-
+ drivers/usb/core/urb.c                             |    5 +-
+ drivers/usb/core/usb.c                             |   37 +-
+ drivers/usb/core/usb.h                             |   10 +-
+ drivers/usb/dwc2/Kconfig                           |    2 +
+ drivers/usb/dwc2/gadget.c                          |  114 +-
+ drivers/usb/dwc2/hcd.c                             |    4 +-
+ drivers/usb/dwc3/Kconfig                           |    8 +-
+ drivers/usb/dwc3/core.h                            |   12 +-
+ drivers/usb/dwc3/debug.h                           |  156 +-
+ drivers/usb/dwc3/drd.c                             |    9 +-
+ drivers/usb/dwc3/dwc3-haps.c                       |    9 +
+ drivers/usb/dwc3/dwc3-keystone.c                   |   11 +-
+ drivers/usb/dwc3/dwc3-qcom.c                       |    1 +
+ drivers/usb/dwc3/gadget.c                          |   65 +-
+ drivers/usb/dwc3/gadget.h                          |    4 +-
+ drivers/usb/dwc3/trace.h                           |   10 +-
+ drivers/usb/early/xhci-dbc.c                       |    2 +-
+ drivers/usb/gadget/Kconfig                         |    1 +
+ drivers/usb/gadget/epautoconf.c                    |   41 +-
+ drivers/usb/gadget/function/f_fs.c                 |   12 +
+ drivers/usb/gadget/function/f_tcm.c                |    9 -
+ drivers/usb/gadget/function/f_uac1.c               |   10 +-
+ drivers/usb/gadget/function/u_ecm.h                |    2 +-
+ drivers/usb/gadget/function/u_eem.h                |    2 +-
+ drivers/usb/gadget/function/u_ether_configfs.h     |    2 +-
+ drivers/usb/gadget/function/u_fs.h                 |    2 +-
+ drivers/usb/gadget/function/u_gether.h             |    2 +-
+ drivers/usb/gadget/function/u_hid.h                |    2 +-
+ drivers/usb/gadget/function/u_midi.h               |    2 +-
+ drivers/usb/gadget/function/u_ncm.h                |    2 +-
+ drivers/usb/gadget/function/u_printer.h            |    2 +-
+ drivers/usb/gadget/function/u_rndis.h              |    2 +-
+ drivers/usb/gadget/function/u_serial.c             |   35 +-
+ drivers/usb/gadget/function/u_uac2.h               |    2 +-
+ drivers/usb/gadget/function/u_uvc.h                |    2 +-
+ drivers/usb/gadget/function/uvc.h                  |    2 +
+ drivers/usb/gadget/function/uvc_configfs.c         |   10 +-
+ drivers/usb/gadget/function/uvc_configfs.h         |    2 +-
+ drivers/usb/gadget/function/uvc_v4l2.h             |    2 +-
+ drivers/usb/gadget/function/uvc_video.h            |    2 +-
+ drivers/usb/gadget/legacy/Kconfig                  |    1 +
+ drivers/usb/gadget/legacy/inode.c                  |   40 +-
+ drivers/usb/gadget/u_f.c                           |    2 +-
+ drivers/usb/gadget/u_f.h                           |    2 +-
+ drivers/usb/gadget/u_os_desc.h                     |    2 +-
+ drivers/usb/gadget/udc/Kconfig                     |    1 +
+ drivers/usb/gadget/udc/aspeed-vhub/epn.c           |    2 +-
+ drivers/usb/gadget/udc/aspeed-vhub/hub.c           |    2 +-
+ drivers/usb/gadget/udc/bdc/Kconfig                 |    2 +
+ drivers/usb/gadget/udc/bdc/bdc_cmd.c               |    4 +-
+ drivers/usb/gadget/udc/core.c                      |    8 +-
+ drivers/usb/gadget/udc/fotg210-udc.c               |   11 +-
+ drivers/usb/gadget/udc/net2280.c                   |    6 +-
+ drivers/usb/gadget/udc/pch_udc.c                   |    1 -
+ drivers/usb/gadget/udc/renesas_usb3.c              |    4 +
+ drivers/usb/gadget/udc/snps_udc_core.c             |   17 +-
+ drivers/usb/host/Kconfig                           |    8 +-
+ drivers/usb/host/ehci-fsl.c                        |   69 +-
+ drivers/usb/host/ehci-orion.c                      |   44 +-
+ drivers/usb/host/fsl-mph-dr-of.c                   |    6 +
+ drivers/usb/host/ohci-at91.c                       |    7 +-
+ drivers/usb/host/ohci-da8xx.c                      |  118 +-
+ drivers/usb/host/ohci-sm501.c                      |    3 +-
+ drivers/usb/host/ohci-tmio.c                       |    2 +-
+ drivers/usb/host/oxu210hp-hcd.c                    |   10 +-
+ drivers/usb/host/u132-hcd.c                        |    6 +-
+ drivers/usb/host/whci/{Kbuild => Makefile}         |    2 +
+ drivers/usb/host/xhci-dbgcap.c                     |    6 +-
+ drivers/usb/host/xhci-debugfs.h                    |    1 -
+ drivers/usb/host/xhci-mem.c                        |    2 +-
+ drivers/usb/host/xhci-mvebu.c                      |   11 +
+ drivers/usb/host/xhci-mvebu.h                      |    6 +
+ drivers/usb/host/xhci-pci.c                        |    1 +
+ drivers/usb/host/xhci-plat.c                       |    7 +
+ drivers/usb/host/xhci-tegra.c                      |    4 +-
+ drivers/usb/host/xhci.c                            |    3 +-
+ drivers/usb/image/Kconfig                          |    1 +
+ drivers/usb/isp1760/Kconfig                        |    2 +
+ drivers/usb/misc/Kconfig                           |    1 +
+ drivers/usb/misc/ftdi-elan.c                       |   26 -
+ drivers/usb/misc/sisusbvga/Kconfig                 |    1 +
+ drivers/usb/misc/sisusbvga/Makefile                |    3 +-
+ drivers/usb/misc/sisusbvga/sisusb.c                |   32 +-
+ drivers/usb/misc/sisusbvga/sisusb.h                |   15 +-
+ drivers/usb/misc/sisusbvga/sisusb_con.c            |  127 +-
+ drivers/usb/misc/sisusbvga/sisusb_init.c           |    5 -
+ drivers/usb/misc/usb251xb.c                        |   15 +-
+ drivers/usb/misc/usb3503.c                         |   38 +-
+ drivers/usb/misc/usbtest.c                         |   28 +-
+ drivers/usb/mon/Kconfig                            |    1 +
+ drivers/usb/mtu3/Kconfig                           |    2 +
+ drivers/usb/musb/Kconfig                           |    5 +-
+ drivers/usb/musb/jz4740.c                          |   10 +
+ drivers/usb/musb/musb_host.c                       |    4 +-
+ drivers/usb/phy/Kconfig                            |    1 +
+ drivers/usb/phy/phy-twl6030-usb.c                  |    2 +-
+ drivers/usb/renesas_usbhs/mod_host.c               |    2 +-
+ drivers/usb/renesas_usbhs/rcar3.c                  |    2 +-
+ drivers/usb/renesas_usbhs/rza.c                    |    2 +-
+ drivers/usb/roles/Kconfig                          |    2 +
+ drivers/usb/roles/Makefile                         |    2 +
+ drivers/usb/roles/class.c                          |   21 +-
+ drivers/usb/serial/Kconfig                         |    1 +
+ drivers/usb/serial/cp210x.c                        |  130 +-
+ drivers/usb/serial/ftdi_sio.c                      |    2 +
+ drivers/usb/serial/ftdi_sio_ids.h                  |    6 +
+ drivers/usb/serial/option.c                        |    2 +
+ drivers/usb/storage/Kconfig                        |    1 +
+ drivers/usb/storage/karma.c                        |    2 +
+ drivers/usb/storage/uas.c                          |   15 +-
+ drivers/usb/typec/Kconfig                          |    1 +
+ drivers/usb/typec/altmodes/Kconfig                 |    1 +
+ drivers/usb/typec/altmodes/Makefile                |    2 +
+ drivers/usb/typec/altmodes/displayport.c           |    4 -
+ drivers/usb/typec/class.c                          |   33 +-
+ drivers/usb/typec/mux.c                            |   94 +-
+ drivers/usb/typec/mux/Kconfig                      |    2 +
+ drivers/usb/typec/tcpm/Kconfig                     |    2 +
+ drivers/usb/typec/tcpm/tcpm.c                      |   68 +-
+ drivers/usb/typec/tps6598x.c                       |   79 +-
+ drivers/usb/typec/ucsi/Kconfig                     |    2 +
+ drivers/usb/typec/ucsi/debug.h                     |   65 -
+ drivers/usb/typec/ucsi/trace.c                     |   59 +
+ drivers/usb/typec/ucsi/trace.h                     |    7 +-
+ drivers/usb/usbip/Kconfig                          |    2 +
+ drivers/usb/usbip/vhci_hcd.c                       |    6 +-
+ drivers/usb/usbip/vudc_dev.c                       |    3 +-
+ drivers/usb/wusbcore/Kconfig                       |    1 +
+ drivers/usb/wusbcore/cbaf.c                        |   15 +-
+ drivers/usb/wusbcore/dev-sysfs.c                   |    5 +-
+ drivers/usb/wusbcore/devconnect.c                  |    2 +-
+ drivers/usb/wusbcore/wa-xfer.c                     |   15 +-
+ drivers/usb/wusbcore/wusbhc.c                      |    6 +-
+ drivers/uwb/drp-ie.c                               |    5 +-
+ drivers/vfio/vfio_spapr_eeh.c                      |    6 +-
+ drivers/vhost/scsi.c                               |    6 -
+ drivers/vhost/vhost.c                              |    2 +-
+ drivers/video/backlight/pwm_bl.c                   |    2 +-
+ drivers/video/fbdev/Kconfig                        |    2 +-
+ drivers/video/fbdev/aty/radeon_pm.c                |    6 +-
+ drivers/video/fbdev/cg14.c                         |    4 +-
+ drivers/video/fbdev/cg3.c                          |    2 +-
+ drivers/video/fbdev/chipsfb.c                      |    3 +-
+ drivers/video/fbdev/controlfb.c                    |   42 +-
+ drivers/video/fbdev/core/fb_cmdline.c              |   23 +-
+ drivers/video/fbdev/core/fbcon.c                   |   14 +-
+ drivers/video/fbdev/core/fbmem.c                   |    3 +
+ drivers/video/fbdev/core/fbmon.c                   |    2 +
+ drivers/video/fbdev/ffb.c                          |    2 +-
+ drivers/video/fbdev/geode/gxfb_core.c              |   13 +-
+ drivers/video/fbdev/geode/lxfb_core.c              |   13 +-
+ drivers/video/fbdev/imsttfb.c                      |   27 +-
+ drivers/video/fbdev/matrox/matroxfb_base.c         |    7 +-
+ drivers/video/fbdev/mbx/mbxdebugfs.c               |   40 +-
+ drivers/video/fbdev/mbx/mbxfb.c                    |    2 +-
+ drivers/video/fbdev/offb.c                         |    4 +-
+ drivers/video/fbdev/omap2/omapfb/dss/core.c        |   34 +-
+ drivers/video/fbdev/omap2/omapfb/dss/dss-of.c      |    4 +-
+ drivers/video/fbdev/omap2/omapfb/dss/dss.h         |    2 +-
+ drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c  |    2 +-
+ drivers/video/fbdev/platinumfb.c                   |   21 +-
+ drivers/video/fbdev/ssd1307fb.c                    |    4 +-
+ drivers/video/fbdev/valkyriefb.c                   |   30 +-
+ drivers/video/fbdev/via/viafbdev.c                 |    2 +-
+ drivers/virt/vboxguest/vboxguest_core.c            |    2 +-
+ drivers/virtio/virtio.c                            |    2 +
+ drivers/virtio/virtio_balloon.c                    |    6 +-
+ drivers/virtio/virtio_ring.c                       |   11 +
+ drivers/watchdog/Kconfig                           |   37 +-
+ drivers/watchdog/Makefile                          |    2 +
+ drivers/watchdog/bcm2835_wdt.c                     |   26 +-
+ drivers/watchdog/dw_wdt.c                          |    2 -
+ drivers/watchdog/mlx_wdt.c                         |  290 +
+ drivers/watchdog/pc87413_wdt.c                     |    2 +-
+ drivers/watchdog/pika_wdt.c                        |    2 +-
+ drivers/watchdog/qcom-wdt.c                        |   23 +
+ drivers/watchdog/sbc60xxwdt.c                      |    2 +-
+ drivers/watchdog/sc1200wdt.c                       |    2 +-
+ drivers/watchdog/sc520_wdt.c                       |    2 +-
+ drivers/watchdog/smsc37b787_wdt.c                  |    2 +-
+ drivers/watchdog/stpmic1_wdt.c                     |  139 +
+ drivers/watchdog/w83877f_wdt.c                     |    2 +-
+ drivers/xen/Makefile                               |    1 -
+ drivers/xen/balloon.c                              |   23 +-
+ drivers/xen/cpu_hotplug.c                          |    2 +-
+ drivers/xen/fallback.c                             |   81 -
+ drivers/xen/gntdev-dmabuf.c                        |   21 +-
+ drivers/xen/gntdev-dmabuf.h                        |    2 +-
+ drivers/xen/gntdev.c                               |    2 +-
+ drivers/xen/swiotlb-xen.c                          |    7 +-
+ drivers/xen/xen-acpi-processor.c                   |   22 +-
+ drivers/xen/xen-balloon.c                          |   11 +
+ drivers/xen/xen-pciback/pciback_ops.c              |    2 -
+ drivers/xen/xen-pciback/xenbus.c                   |    2 +-
+ drivers/xen/xen-scsiback.c                         |    8 +-
+ fs/9p/v9fs_vfs.h                                   |   23 +-
+ fs/9p/vfs_file.c                                   |    6 +-
+ fs/9p/vfs_inode.c                                  |   23 +-
+ fs/9p/vfs_inode_dotl.c                             |   27 +-
+ fs/9p/vfs_super.c                                  |    6 +-
+ fs/Kconfig                                         |   10 +-
+ fs/Makefile                                        |    5 +-
+ fs/afs/internal.h                                  |    9 +-
+ fs/afs/mntpt.c                                     |  149 +-
+ fs/afs/super.c                                     |  432 +-
+ fs/afs/volume.c                                    |    4 +-
+ fs/aio.c                                           |   10 +-
+ fs/autofs/autofs_i.h                               |    3 +
+ fs/autofs/inode.c                                  |   19 +-
+ fs/binfmt_elf.c                                    |   32 +-
+ fs/block_dev.c                                     |   28 +-
+ fs/btrfs/acl.c                                     |    9 +
+ fs/btrfs/async-thread.c                            |   10 +-
+ fs/btrfs/backref.c                                 |   22 +-
+ fs/btrfs/compression.c                             |  256 +-
+ fs/btrfs/compression.h                             |   52 +-
+ fs/btrfs/ctree.c                                   |   74 +-
+ fs/btrfs/ctree.h                                   |   97 +-
+ fs/btrfs/delayed-ref.c                             |   15 +-
+ fs/btrfs/delayed-ref.h                             |   11 -
+ fs/btrfs/dev-replace.c                             |    9 +-
+ fs/btrfs/disk-io.c                                 |   44 +-
+ fs/btrfs/extent-tree.c                             |  364 +-
+ fs/btrfs/extent_io.c                               |  103 +-
+ fs/btrfs/extent_io.h                               |   15 +-
+ fs/btrfs/extent_map.c                              |    5 +-
+ fs/btrfs/extent_map.h                              |    1 +
+ fs/btrfs/file.c                                    |    3 +-
+ fs/btrfs/inode.c                                   |  213 +-
+ fs/btrfs/ioctl.c                                   |   81 +-
+ fs/btrfs/locking.c                                 |  108 +-
+ fs/btrfs/locking.h                                 |   15 +-
+ fs/btrfs/lzo.c                                     |   31 +-
+ fs/btrfs/qgroup.c                                  |  385 +-
+ fs/btrfs/qgroup.h                                  |  120 +-
+ fs/btrfs/raid56.c                                  |    3 +-
+ fs/btrfs/ref-verify.c                              |    4 +-
+ fs/btrfs/relocation.c                              |  119 +-
+ fs/btrfs/root-tree.c                               |   12 +-
+ fs/btrfs/scrub.c                                   |   49 +-
+ fs/btrfs/super.c                                   |   13 +-
+ fs/btrfs/transaction.c                             |    9 +-
+ fs/btrfs/tree-defrag.c                             |    2 +-
+ fs/btrfs/tree-log.c                                |  282 +-
+ fs/btrfs/volumes.c                                 |  202 +-
+ fs/btrfs/volumes.h                                 |    5 +-
+ fs/btrfs/zlib.c                                    |   45 +-
+ fs/btrfs/zstd.c                                    |  318 +-
+ fs/buffer.c                                        |   12 +-
+ fs/ceph/caps.c                                     |   72 +-
+ fs/ceph/debugfs.c                                  |   27 -
+ fs/ceph/dir.c                                      |  455 +-
+ fs/ceph/file.c                                     |   13 +-
+ fs/ceph/inode.c                                    |   52 +-
+ fs/ceph/mds_client.c                               |  698 +-
+ fs/ceph/mds_client.h                               |   43 +-
+ fs/ceph/snap.c                                     |  159 +-
+ fs/ceph/super.c                                    |   21 +-
+ fs/ceph/super.h                                    |   43 +-
+ fs/ceph/xattr.c                                    |   20 +-
+ fs/cifs/Kconfig                                    |  120 +-
+ fs/cifs/cifs_debug.c                               |   11 +-
+ fs/cifs/cifs_dfs_ref.c                             |    4 +-
+ fs/cifs/cifs_fs_sb.h                               |    1 +
+ fs/cifs/cifs_ioctl.h                               |    3 +
+ fs/cifs/cifsfs.c                                   |    3 +-
+ fs/cifs/cifsfs.h                                   |    2 +-
+ fs/cifs/cifsglob.h                                 |   81 +-
+ fs/cifs/cifsproto.h                                |    8 +-
+ fs/cifs/cifssmb.c                                  |   54 +-
+ fs/cifs/connect.c                                  |   70 +-
+ fs/cifs/dir.c                                      |  107 +-
+ fs/cifs/file.c                                     |  283 +-
+ fs/cifs/inode.c                                    |    2 +-
+ fs/cifs/link.c                                     |   14 +-
+ fs/cifs/smb1ops.c                                  |  134 +-
+ fs/cifs/smb2inode.c                                |   87 +-
+ fs/cifs/smb2misc.c                                 |   24 +-
+ fs/cifs/smb2ops.c                                  |  536 +-
+ fs/cifs/smb2pdu.c                                  |  324 +-
+ fs/cifs/smb2pdu.h                                  |   11 +-
+ fs/cifs/smb2proto.h                                |    7 +
+ fs/cifs/smb2status.h                               |    6 +-
+ fs/cifs/smb2transport.c                            |   25 +-
+ fs/cifs/smbdirect.c                                |    6 +-
+ fs/cifs/trace.h                                    |  213 +-
+ fs/cifs/transport.c                                |  302 +-
+ fs/crypto/Kconfig                                  |    6 +-
+ fs/crypto/bio.c                                    |    3 +-
+ fs/crypto/fscrypt_private.h                        |    1 -
+ fs/crypto/hooks.c                                  |    6 +-
+ fs/crypto/policy.c                                 |    3 +-
+ fs/dax.c                                           |   25 +-
+ fs/debugfs/inode.c                                 |    4 +-
+ fs/devpts/inode.c                                  |    1 +
+ fs/direct-io.c                                     |    4 +-
+ fs/eventpoll.c                                     |  173 +-
+ fs/exec.c                                          |   13 +-
+ fs/exofs/BUGS                                      |    3 -
+ fs/exofs/Kbuild                                    |   20 -
+ fs/exofs/Kconfig                                   |   13 -
+ fs/exofs/Kconfig.ore                               |   14 -
+ fs/exofs/common.h                                  |  262 -
+ fs/exofs/dir.c                                     |  661 --
+ fs/exofs/exofs.h                                   |  240 -
+ fs/exofs/file.c                                    |   83 -
+ fs/exofs/inode.c                                   | 1514 -----
+ fs/exofs/namei.c                                   |  323 -
+ fs/exofs/ore.c                                     | 1178 ----
+ fs/exofs/ore_raid.c                                |  756 ---
+ fs/exofs/ore_raid.h                                |   62 -
+ fs/exofs/super.c                                   | 1071 ---
+ fs/exofs/sys.c                                     |  205 -
+ fs/ext2/dir.c                                      |   35 +-
+ fs/ext2/ext2.h                                     |   17 +-
+ fs/ext2/file.c                                     |    1 +
+ fs/ext2/ialloc.c                                   |    2 -
+ fs/ext2/inode.c                                    |   30 +-
+ fs/ext2/namei.c                                    |    2 +
+ fs/ext2/super.c                                    |   44 +-
+ fs/ext2/symlink.c                                  |    2 +
+ fs/ext2/xattr.c                                    |    1 +
+ fs/ext4/Kconfig                                    |   17 +-
+ fs/ext4/dir.c                                      |   10 +-
+ fs/ext4/ext4.h                                     |   21 +-
+ fs/ext4/ext4_jbd2.h                                |    2 +-
+ fs/ext4/extents.c                                  |   33 +-
+ fs/ext4/hash.c                                     |    2 +
+ fs/ext4/ialloc.c                                   |    2 +-
+ fs/ext4/indirect.c                                 |    6 +
+ fs/ext4/inode.c                                    |   45 +-
+ fs/ext4/ioctl.c                                    |  105 +-
+ fs/ext4/mballoc.c                                  |    7 +-
+ fs/ext4/move_extent.c                              |    3 +-
+ fs/ext4/namei.c                                    |   18 +-
+ fs/ext4/page-io.c                                  |   16 +-
+ fs/ext4/readpage.c                                 |    8 +-
+ fs/ext4/resize.c                                   |    3 +-
+ fs/ext4/super.c                                    |    7 +-
+ fs/ext4/sysfs.c                                    |   17 +-
+ fs/ext4/xattr.c                                    |    3 +
+ fs/f2fs/Kconfig                                    |   12 +-
+ fs/f2fs/checkpoint.c                               |   20 +-
+ fs/f2fs/data.c                                     |   72 +-
+ fs/f2fs/debug.c                                    |   39 +-
+ fs/f2fs/dir.c                                      |   25 +-
+ fs/f2fs/extent_cache.c                             |    2 +-
+ fs/f2fs/f2fs.h                                     |   95 +-
+ fs/f2fs/file.c                                     |   56 +-
+ fs/f2fs/inline.c                                   |   12 +-
+ fs/f2fs/inode.c                                    |   19 +-
+ fs/f2fs/namei.c                                    |    9 +-
+ fs/f2fs/node.c                                     |    6 +-
+ fs/f2fs/segment.c                                  |   80 +-
+ fs/f2fs/segment.h                                  |    2 +-
+ fs/f2fs/super.c                                    |  122 +-
+ fs/f2fs/sysfs.c                                    |   21 +-
+ fs/f2fs/trace.c                                    |   20 +-
+ fs/f2fs/xattr.c                                    |   25 +-
+ fs/f2fs/xattr.h                                    |    6 +
+ fs/fat/file.c                                      |    1 +
+ fs/file.c                                          |   16 +-
+ fs/file_table.c                                    |    9 +-
+ fs/filesystems.c                                   |    4 +
+ fs/fs_context.c                                    |  642 ++
+ fs/fs_parser.c                                     |  447 ++
+ fs/fs_types.c                                      |  105 +
+ fs/fuse/control.c                                  |    4 +-
+ fs/fuse/cuse.c                                     |    7 +-
+ fs/fuse/dev.c                                      |  115 +-
+ fs/fuse/dir.c                                      |   54 +-
+ fs/fuse/file.c                                     |  342 +-
+ fs/fuse/fuse_i.h                                   |   28 +-
+ fs/fuse/inode.c                                    |   28 +-
+ fs/fuse/readdir.c                                  |    4 +-
+ fs/gfs2/file.c                                     |    2 +
+ fs/gfs2/glock.c                                    |   72 +-
+ fs/gfs2/glock.h                                    |    4 +-
+ fs/gfs2/incore.h                                   |    3 -
+ fs/gfs2/inode.h                                    |    4 +-
+ fs/gfs2/lops.c                                     |    6 +-
+ fs/gfs2/main.c                                     |    6 +-
+ fs/gfs2/meta_io.c                                  |    3 +-
+ fs/hpfs/hpfs.h                                     |    8 +-
+ fs/hugetlbfs/inode.c                               |  360 +-
+ fs/inode.c                                         |    8 +-
+ fs/internal.h                                      |   13 +-
+ fs/io_uring.c                                      | 2971 +++++++++
+ fs/iomap.c                                         |   53 +-
+ fs/jbd2/checkpoint.c                               |   17 +-
+ fs/jbd2/commit.c                                   |    6 +-
+ fs/jbd2/journal.c                                  |   90 +-
+ fs/jbd2/transaction.c                              |   83 +-
+ fs/kernfs/dir.c                                    |    2 +-
+ fs/kernfs/file.c                                   |   31 +-
+ fs/kernfs/inode.c                                  |    2 +-
+ fs/kernfs/kernfs-internal.h                        |    3 +-
+ fs/kernfs/mount.c                                  |  126 +-
+ fs/lockd/clnt4xdr.c                                |   14 -
+ fs/lockd/clntxdr.c                                 |   14 -
+ fs/locks.c                                         |   32 +-
+ fs/mount.h                                         |    5 +
+ fs/mpage.c                                         |    3 +-
+ fs/namei.c                                         |    9 +-
+ fs/namespace.c                                     |  397 +-
+ fs/nfs/callback_xdr.c                              |   64 +-
+ fs/nfs/delegation.c                                |   22 +-
+ fs/nfs/delegation.h                                |    1 +
+ fs/nfs/dir.c                                       |   98 +-
+ fs/nfs/direct.c                                    |    7 +-
+ fs/nfs/file.c                                      |   44 +-
+ fs/nfs/flexfilelayout/flexfilelayout.c             |  225 +-
+ fs/nfs/flexfilelayout/flexfilelayout.h             |   75 +-
+ fs/nfs/flexfilelayout/flexfilelayoutdev.c          |  161 +-
+ fs/nfs/inode.c                                     |   33 +-
+ fs/nfs/internal.h                                  |    5 +-
+ fs/nfs/io.c                                        |   12 +-
+ fs/nfs/namespace.c                                 |    8 +-
+ fs/nfs/nfs2xdr.c                                   |  124 +-
+ fs/nfs/nfs3acl.c                                   |    2 -
+ fs/nfs/nfs3xdr.c                                   |  209 +-
+ fs/nfs/nfs42.h                                     |    3 +
+ fs/nfs/nfs42proc.c                                 |  164 +
+ fs/nfs/nfs42xdr.c                                  |  130 +-
+ fs/nfs/nfs4client.c                                |   33 +-
+ fs/nfs/nfs4namespace.c                             |    5 +-
+ fs/nfs/nfs4proc.c                                  |  138 +-
+ fs/nfs/nfs4session.c                               |    7 +-
+ fs/nfs/nfs4session.h                               |    7 +-
+ fs/nfs/nfs4state.c                                 |    1 +
+ fs/nfs/nfs4trace.h                                 |   25 +
+ fs/nfs/nfs4xdr.c                                   |  530 +-
+ fs/nfs/nfstrace.c                                  |    1 +
+ fs/nfs/nfstrace.h                                  |   85 +
+ fs/nfs/pagelist.c                                  |   47 +-
+ fs/nfs/pnfs.c                                      |   35 +-
+ fs/nfs/pnfs.h                                      |    2 +
+ fs/nfs/pnfs_dev.c                                  |   13 +
+ fs/nfs/read.c                                      |    2 +-
+ fs/nfs/super.c                                     |    2 +-
+ fs/nfs/unlink.c                                    |    8 +-
+ fs/nfs/write.c                                     |   19 +-
+ fs/nfsd/nfs3proc.c                                 |   18 +-
+ fs/nfsd/nfs3xdr.c                                  |    5 +-
+ fs/nfsd/nfs4callback.c                             |   17 +-
+ fs/nfsd/nfs4state.c                                |    8 +-
+ fs/nfsd/nfsctl.c                                   |    2 +-
+ fs/nilfs2/btnode.c                                 |    2 +-
+ fs/notify/fanotify/Kconfig                         |    1 +
+ fs/notify/fanotify/fanotify.c                      |  267 +-
+ fs/notify/fanotify/fanotify.h                      |  116 +-
+ fs/notify/fanotify/fanotify_user.c                 |  373 +-
+ fs/notify/fsnotify.c                               |   15 +-
+ fs/notify/inotify/inotify.h                        |    1 +
+ fs/notify/inotify/inotify_fsnotify.c               |   18 +-
+ fs/notify/inotify/inotify_user.c                   |    5 +-
+ fs/notify/mark.c                                   |   42 +-
+ fs/notify/notification.c                           |   42 +-
+ fs/ocfs2/alloc.c                                   |  159 +-
+ fs/ocfs2/cluster/nodemanager.c                     |   14 +-
+ fs/ocfs2/dlmglue.c                                 |    5 +
+ fs/ocfs2/ocfs2.h                                   |    1 +
+ fs/ocfs2/ocfs2_trace.h                             |    2 +
+ fs/ocfs2/slot_map.c                                |    8 +-
+ fs/ocfs2/super.c                                   |    2 +
+ fs/orangefs/inode.c                                |    7 +-
+ fs/overlayfs/copy_up.c                             |   59 +-
+ fs/overlayfs/overlayfs.h                           |    2 +
+ fs/overlayfs/util.c                                |   55 +-
+ fs/pipe.c                                          |   35 +-
+ fs/pnode.c                                         |    5 -
+ fs/pnode.h                                         |    3 +-
+ fs/proc/array.c                                    |   16 +-
+ fs/proc/base.c                                     |  143 +-
+ fs/proc/inode.c                                    |   52 +-
+ fs/proc/internal.h                                 |    8 +-
+ fs/proc/page.c                                     |    4 +-
+ fs/proc/root.c                                     |  238 +-
+ fs/proc/self.c                                     |   16 +-
+ fs/proc/stat.c                                     |   89 +-
+ fs/proc/task_mmu.c                                 |   10 +-
+ fs/proc/task_nommu.c                               |    4 +-
+ fs/proc/thread_self.c                              |   16 +-
+ fs/pstore/platform.c                               |    3 +
+ fs/pstore/ram.c                                    |   64 +-
+ fs/read_write.c                                    |   10 +-
+ fs/select.c                                        |    4 +-
+ fs/splice.c                                        |    8 +-
+ fs/stat.c                                          |   12 +-
+ fs/statfs.c                                        |   14 +
+ fs/super.c                                         |  344 +-
+ fs/sysfs/file.c                                    |    2 +-
+ fs/sysfs/mount.c                                   |   75 +-
+ fs/timerfd.c                                       |    4 +-
+ fs/ubifs/Kconfig                                   |   12 +-
+ fs/ubifs/Makefile                                  |    2 +-
+ fs/ubifs/ioctl.c                                   |   12 +-
+ fs/ubifs/sb.c                                      |    2 +-
+ fs/ubifs/super.c                                   |    2 +-
+ fs/ubifs/ubifs.h                                   |    5 +-
+ fs/udf/super.c                                     |   51 +-
+ fs/utimes.c                                        |   10 +-
+ fs/xfs/libxfs/xfs_ag.c                             |    6 +-
+ fs/xfs/libxfs/xfs_ag_resv.c                        |    2 +-
+ fs/xfs/libxfs/xfs_alloc.c                          |   12 +-
+ fs/xfs/libxfs/xfs_alloc_btree.c                    |   74 +-
+ fs/xfs/libxfs/xfs_attr.c                           |   17 +
+ fs/xfs/libxfs/xfs_attr.h                           |    2 +-
+ fs/xfs/libxfs/xfs_attr_leaf.c                      |   21 +-
+ fs/xfs/libxfs/xfs_attr_remote.c                    |    8 +-
+ fs/xfs/libxfs/xfs_bmap.c                           |  302 +-
+ fs/xfs/libxfs/xfs_bmap.h                           |   16 +-
+ fs/xfs/libxfs/xfs_bmap_btree.c                     |   13 +-
+ fs/xfs/libxfs/xfs_da_btree.c                       |   49 +-
+ fs/xfs/libxfs/xfs_da_format.h                      |    3 +
+ fs/xfs/libxfs/xfs_dir2.c                           |   17 +
+ fs/xfs/libxfs/xfs_dir2.h                           |    1 +
+ fs/xfs/libxfs/xfs_dir2_block.c                     |   10 +-
+ fs/xfs/libxfs/xfs_dir2_data.c                      |   12 +-
+ fs/xfs/libxfs/xfs_dir2_leaf.c                      |  137 +-
+ fs/xfs/libxfs/xfs_dir2_node.c                      |   28 +-
+ fs/xfs/libxfs/xfs_dquot_buf.c                      |    4 +
+ fs/xfs/libxfs/xfs_errortag.h                       |    4 +-
+ fs/xfs/libxfs/xfs_ialloc.c                         |    3 +-
+ fs/xfs/libxfs/xfs_ialloc_btree.c                   |   29 +-
+ fs/xfs/libxfs/xfs_iext_tree.c                      |   13 +-
+ fs/xfs/libxfs/xfs_inode_buf.c                      |   11 +-
+ fs/xfs/libxfs/xfs_inode_fork.h                     |    2 +-
+ fs/xfs/libxfs/xfs_refcount_btree.c                 |    3 +-
+ fs/xfs/libxfs/xfs_rmap_btree.c                     |    3 +-
+ fs/xfs/libxfs/xfs_sb.c                             |    7 +-
+ fs/xfs/libxfs/xfs_shared.h                         |    4 +-
+ fs/xfs/libxfs/xfs_symlink_remote.c                 |    3 +-
+ fs/xfs/libxfs/xfs_types.c                          |   24 +
+ fs/xfs/libxfs/xfs_types.h                          |    3 +
+ fs/xfs/scrub/agheader.c                            |   10 +-
+ fs/xfs/scrub/agheader_repair.c                     |   12 +-
+ fs/xfs/scrub/attr.c                                |   11 +
+ fs/xfs/scrub/bmap.c                                |   27 +
+ fs/xfs/scrub/dir.c                                 |    6 +
+ fs/xfs/scrub/ialloc.c                              |  330 +-
+ fs/xfs/scrub/repair.c                              |    3 +-
+ fs/xfs/scrub/repair.h                              |    3 -
+ fs/xfs/scrub/rtbitmap.c                            |    5 +-
+ fs/xfs/scrub/trace.h                               |   45 +
+ fs/xfs/xfs_aops.c                                  |  275 +-
+ fs/xfs/xfs_aops.h                                  |   24 +-
+ fs/xfs/xfs_attr_list.c                             |    1 +
+ fs/xfs/xfs_bmap_util.c                             |    9 +-
+ fs/xfs/xfs_buf.c                                   |   72 +-
+ fs/xfs/xfs_buf.h                                   |    8 +-
+ fs/xfs/xfs_error.c                                 |    6 +-
+ fs/xfs/xfs_error.h                                 |    1 +
+ fs/xfs/xfs_file.c                                  |   32 +-
+ fs/xfs/xfs_fsops.c                                 |    1 +
+ fs/xfs/xfs_globals.c                               |    2 +-
+ fs/xfs/xfs_inode.c                                 |  769 ++-
+ fs/xfs/xfs_inode.h                                 |    3 +
+ fs/xfs/xfs_iomap.c                                 |  518 +-
+ fs/xfs/xfs_iomap.h                                 |    7 +-
+ fs/xfs/xfs_iops.c                                  |   21 +-
+ fs/xfs/xfs_log_recover.c                           |   14 +-
+ fs/xfs/xfs_mount.c                                 |    5 +
+ fs/xfs/xfs_mount.h                                 |   10 +-
+ fs/xfs/xfs_ondisk.h                                |   21 +
+ fs/xfs/xfs_pnfs.c                                  |    2 +-
+ fs/xfs/xfs_reflink.c                               |  150 +-
+ fs/xfs/xfs_reflink.h                               |   18 +-
+ fs/xfs/xfs_super.c                                 |   22 +-
+ fs/xfs/xfs_sysctl.h                                |    1 +
+ fs/xfs/xfs_sysfs.c                                 |   24 +
+ fs/xfs/xfs_trace.h                                 |  115 +-
+ fs/xfs/xfs_trans_bmap.c                            |    1 -
+ fs/xfs/xfs_trans_buf.c                             |    2 +-
+ fs/xfs/xfs_trans_extfree.c                         |    1 -
+ fs/xfs/xfs_trans_refcount.c                        |    1 -
+ fs/xfs/xfs_trans_rmap.c                            |    1 -
+ fs/xfs/xfs_xattr.c                                 |    3 +
+ include/acpi/acbuffer.h                            |    2 +-
+ include/acpi/acconfig.h                            |    4 +-
+ include/acpi/acexcep.h                             |    5 +-
+ include/acpi/acnames.h                             |    2 +-
+ include/acpi/acoutput.h                            |    4 +-
+ include/acpi/acpi.h                                |    2 +-
+ include/acpi/acpiosxf.h                            |    2 +-
+ include/acpi/acpixf.h                              |   18 +-
+ include/acpi/acrestyp.h                            |   16 +-
+ include/acpi/actbl.h                               |    2 +-
+ include/acpi/actbl1.h                              |   19 +-
+ include/acpi/actbl2.h                              |   17 +-
+ include/acpi/actbl3.h                              |   21 +-
+ include/acpi/actypes.h                             |   14 +-
+ include/acpi/acuuid.h                              |    2 +-
+ include/acpi/cppc_acpi.h                           |    1 +
+ include/acpi/ghes.h                                |    4 +-
+ include/acpi/platform/acenv.h                      |    2 +-
+ include/acpi/platform/acenvex.h                    |    2 +-
+ include/acpi/platform/acgcc.h                      |    2 +-
+ include/acpi/platform/acgccex.h                    |    2 +-
+ include/acpi/platform/acintel.h                    |    2 +-
+ include/acpi/platform/aclinux.h                    |    2 +-
+ include/acpi/platform/aclinuxex.h                  |    2 +-
+ include/asm-generic/Kbuild                         |    5 +
+ include/asm-generic/atomic-instrumented.h          | 1689 ++++-
+ include/asm-generic/atomic-long.h                  | 1174 +++-
+ include/asm-generic/bug.h                          |    3 -
+ include/asm-generic/io.h                           |   20 +-
+ include/asm-generic/iomap.h                        |   22 +
+ include/asm-generic/page.h                         |    2 +-
+ include/asm-generic/pgtable.h                      |   18 +-
+ include/asm-generic/vmlinux.lds.h                  |    2 +-
+ include/clocksource/arm_arch_timer.h               |    1 +
+ include/drm/bridge/dw_hdmi.h                       |    7 +-
+ include/drm/bridge/dw_mipi_dsi.h                   |    3 +-
+ include/drm/drmP.h                                 |   29 +-
+ include/drm/drm_atomic.h                           |   54 +-
+ include/drm/drm_audio_component.h                  |    1 +
+ include/drm/drm_bridge.h                           |    8 +-
+ include/drm/drm_cache.h                            |   18 +
+ include/drm/drm_client.h                           |    2 +-
+ include/drm/drm_color_mgmt.h                       |   28 +
+ include/drm/drm_connector.h                        |   12 +-
+ include/drm/drm_crtc.h                             |    3 -
+ include/drm/drm_crtc_helper.h                      |   17 +-
+ include/drm/drm_damage_helper.h                    |    3 +
+ include/drm/drm_device.h                           |  288 +-
+ include/drm/drm_dp_helper.h                        |   37 +-
+ include/drm/drm_dp_mst_helper.h                    |  153 +-
+ include/drm/drm_drv.h                              |  137 +-
+ include/drm/drm_dsc.h                              |  233 +-
+ include/drm/drm_edid.h                             |   10 +-
+ include/drm/drm_encoder_slave.h                    |    1 -
+ include/drm/drm_fb_cma_helper.h                    |   22 -
+ include/drm/drm_fb_helper.h                        |   14 +-
+ include/drm/drm_file.h                             |    1 +
+ include/drm/drm_fourcc.h                           |  117 +
+ include/drm/drm_framebuffer.h                      |   10 +-
+ include/drm/drm_gem_cma_helper.h                   |    5 +-
+ include/drm/drm_gem_framebuffer_helper.h           |    3 +
+ include/drm/drm_hdcp.h                             |   20 +
+ include/drm/drm_legacy.h                           |   14 +-
+ include/drm/drm_mode_config.h                      |   25 +-
+ include/drm/drm_modes.h                            |   21 +-
+ include/drm/drm_modeset_helper.h                   |    6 +-
+ include/drm/drm_modeset_helper_vtables.h           |    2 +-
+ include/drm/drm_modeset_lock.h                     |    2 +-
+ include/drm/drm_probe_helper.h                     |   27 +
+ include/drm/drm_rect.h                             |    6 -
+ include/drm/drm_syncobj.h                          |   23 +-
+ include/drm/drm_util.h                             |   53 +-
+ include/drm/drm_vblank.h                           |   22 +
+ include/drm/gpu_scheduler.h                        |   13 +-
+ include/drm/i915_component.h                       |    5 +
+ include/drm/i915_drm.h                             |   15 +
+ include/drm/i915_mei_hdcp_interface.h              |  149 +
+ include/drm/i915_pciids.h                          |    8 +
+ include/drm/intel-gtt.h                            |    3 +
+ include/drm/tinydrm/mipi-dbi.h                     |    5 +-
+ include/drm/tinydrm/tinydrm-helpers.h              |   20 +-
+ include/drm/tinydrm/tinydrm.h                      |   26 -
+ include/drm/ttm/ttm_bo_api.h                       |   28 -
+ include/drm/ttm/ttm_bo_driver.h                    |   11 +-
+ include/dt-bindings/clk/lochnagar.h                |   26 +
+ include/dt-bindings/clock/actions,s500-cmu.h       |   78 +
+ include/dt-bindings/clock/axg-aoclkc.h             |    7 +-
+ include/dt-bindings/clock/exynos5433.h             |    8 +-
+ include/dt-bindings/clock/g12a-aoclkc.h            |   34 +
+ include/dt-bindings/clock/g12a-clkc.h              |  135 +
+ include/dt-bindings/clock/gxbb-aoclkc.h            |    7 +
+ include/dt-bindings/clock/imx5-clock.h             |    3 +-
+ include/dt-bindings/clock/imx8mm-clock.h           |  244 +
+ include/dt-bindings/clock/imx8mq-clock.h           |  215 +-
+ include/dt-bindings/clock/marvell,mmp2.h           |    1 +
+ include/dt-bindings/clock/meson8b-clkc.h           |    1 +
+ include/dt-bindings/clock/mt2712-clk.h             |    3 +-
+ include/dt-bindings/clock/mt8173-clk.h             |    3 +-
+ include/dt-bindings/clock/qcom,rpmcc.h             |   10 +
+ include/dt-bindings/clock/qcom,rpmh.h              |    1 +
+ include/dt-bindings/clock/r8a774a1-cpg-mssr.h      |    1 +
+ include/dt-bindings/clock/r8a774c0-cpg-mssr.h      |    1 +
+ include/dt-bindings/clock/r8a7778-clock.h          |    2 +
+ include/dt-bindings/clock/stm32mp1-clks.h          |    3 -
+ include/dt-bindings/gpio/gpio.h                    |    6 +
+ include/dt-bindings/iio/adc/ingenic,adc.h          |   10 +
+ include/dt-bindings/interconnect/qcom,sdm845.h     |  143 +
+ include/dt-bindings/mfd/st,stpmic1.h               |   50 +
+ include/dt-bindings/pinctrl/at91.h                 |    4 +
+ include/dt-bindings/pinctrl/lochnagar.h            |  132 +
+ include/dt-bindings/power/mt8173-power.h           |    6 +-
+ include/dt-bindings/power/qcom-rpmpd.h             |   39 +
+ include/dt-bindings/power/xlnx-zynqmp-power.h      |   39 +
+ .../dt-bindings/reset/amlogic,meson-g12a-reset.h   |  134 +
+ include/dt-bindings/reset/g12a-aoclkc.h            |   18 +
+ include/dt-bindings/reset/imx8mq-reset.h           |   64 +
+ include/dt-bindings/reset/xlnx-zynqmp-resets.h     |  130 +
+ include/dt-bindings/soc/bcm2835-pm.h               |   28 +
+ include/keys/system_keyring.h                      |    8 +
+ include/kvm/arm_arch_timer.h                       |   68 +-
+ include/linux/acpi.h                               |   34 +-
+ include/linux/amba/bus.h                           |   39 +
+ include/linux/arm_sdei.h                           |    9 +
+ include/linux/async.h                              |   82 +-
+ include/linux/ata_platform.h                       |    3 +-
+ include/linux/atalk.h                              |   18 +-
+ include/linux/atomic-fallback.h                    | 2295 +++++++
+ include/linux/atomic.h                             | 1241 +---
+ include/linux/audit.h                              |   66 +-
+ include/linux/backing-dev.h                        |    2 +-
+ include/linux/balloon_compaction.h                 |   34 +-
+ include/linux/bio.h                                |   51 +-
+ include/linux/bitops.h                             |    2 +-
+ include/linux/blk-mq.h                             |    1 -
+ include/linux/blkdev.h                             |   74 +-
+ include/linux/bpf-cgroup.h                         |    2 +-
+ include/linux/bsg-lib.h                            |    4 +
+ include/linux/build_bug.h                          |   19 +
+ include/linux/bvec.h                               |  123 +-
+ include/linux/capability.h                         |   10 +-
+ include/linux/ceph/types.h                         |    1 +
+ include/linux/cgroup-defs.h                        |    6 +-
+ include/linux/cgroup.h                             |    2 +
+ include/linux/cgroup_rdma.h                        |    2 +-
+ include/linux/clk-provider.h                       |    3 +
+ include/linux/clk.h                                |   36 +
+ include/linux/clk/ti.h                             |    1 +
+ include/linux/clkdev.h                             |    4 +
+ include/linux/compaction.h                         |    7 +-
+ include/linux/compat.h                             |  104 +-
+ include/linux/component.h                          |   76 +
+ include/linux/console_struct.h                     |    2 +-
+ include/linux/coresight.h                          |    7 +-
+ include/linux/cpufreq.h                            |   48 +-
+ include/linux/cpuhotplug.h                         |    1 +
+ include/linux/cpuidle.h                            |    8 +-
+ include/linux/cred.h                               |    1 -
+ include/linux/davinci_emac.h                       |    1 -
+ include/linux/delay.h                              |    1 +
+ include/linux/device-mapper.h                      |   17 +-
+ include/linux/device.h                             |   52 +-
+ include/linux/dma-fence-array.h                    |    1 +
+ include/linux/dma-fence.h                          |   22 +-
+ include/linux/dma-mapping.h                        |   69 +-
+ include/linux/dma/dw.h                             |    9 +-
+ include/linux/dynamic_debug.h                      |  102 +-
+ include/linux/efi.h                                |   46 +-
+ include/linux/errno.h                              |    1 +
+ include/linux/f2fs_fs.h                            |   20 +-
+ include/linux/fanotify.h                           |   26 +-
+ include/linux/fcntl.h                              |    2 +-
+ include/linux/file.h                               |    2 +
+ include/linux/filter.h                             |    7 +
+ include/linux/firmware/imx/svc/misc.h              |    3 +
+ include/linux/firmware/xlnx-zynqmp.h               |  184 +
+ include/linux/flex_array.h                         |  149 -
+ include/linux/frontswap.h                          |    7 +
+ include/linux/fs.h                                 |   55 +-
+ include/linux/fs_context.h                         |  188 +
+ include/linux/fs_parser.h                          |  151 +
+ include/linux/fs_types.h                           |   75 +
+ include/linux/fscrypt.h                            |  420 +-
+ include/linux/fscrypt_notsupp.h                    |  231 -
+ include/linux/fscrypt_supp.h                       |  204 -
+ include/linux/fsl/guts.h                           |    2 -
+ include/linux/fsl_devices.h                        |    7 +-
+ include/linux/fsnotify.h                           |   73 +-
+ include/linux/fsnotify_backend.h                   |   67 +-
+ include/linux/generic-radix-tree.h                 |  231 +
+ include/linux/gfp.h                                |   30 +-
+ include/linux/gnss.h                               |    1 +
+ include/linux/gpio/driver.h                        |    5 +
+ include/linux/gpio/machine.h                       |    2 +
+ include/linux/hardirq.h                            |    7 +
+ include/linux/hdmi.h                               |   15 +
+ include/linux/hmm.h                                |    4 +-
+ include/linux/hugetlb.h                            |   70 +-
+ include/linux/hyperv.h                             |  144 +-
+ include/linux/i2c-algo-bit.h                       |   33 +-
+ include/linux/i2c.h                                |   45 +
+ include/linux/igmp.h                               |    2 +-
+ include/linux/ihex.h                               |   29 +-
+ include/linux/iio/common/st_sensors.h              |    1 +
+ include/linux/ima.h                                |    5 +
+ include/linux/init_task.h                          |    1 +
+ include/linux/initrd.h                             |    3 +
+ include/linux/input/ili210x.h                      |   11 -
+ include/linux/intel-iommu.h                        |   21 +-
+ include/linux/intel-svm.h                          |    2 +-
+ include/linux/interconnect-provider.h              |  142 +
+ include/linux/interconnect.h                       |   59 +
+ include/linux/interrupt.h                          |   51 +-
+ include/linux/io-64-nonatomic-hi-lo.h              |   64 +
+ include/linux/io-64-nonatomic-lo-hi.h              |   64 +
+ {drivers/iommu => include/linux}/io-pgtable.h      |    0
+ include/linux/iomap.h                              |    1 +
+ include/linux/iommu.h                              |    6 +-
+ include/linux/ipmi_smi.h                           |   27 +-
+ include/linux/irq.h                                |   11 +
+ include/linux/irqchip/irq-davinci-aintc.h          |   27 +
+ include/linux/irqchip/irq-davinci-cp-intc.h        |   25 +
+ include/linux/irqdesc.h                            |    7 +
+ include/linux/irqdomain.h                          |    6 +
+ include/linux/kasan-checks.h                       |    2 +-
+ include/linux/kern_levels.h                        |    2 +-
+ include/linux/kernel.h                             |   35 +-
+ include/linux/kernfs.h                             |   45 +-
+ include/linux/kprobes.h                            |    5 +
+ include/linux/ksm.h                                |    7 +
+ include/linux/kthread.h                            |   10 +-
+ include/linux/kvm_host.h                           |   24 +-
+ include/linux/libata.h                             |    5 +-
+ include/linux/libnvdimm.h                          |    3 +
+ include/linux/limits.h                             |   36 +
+ include/linux/list.h                               |   11 +
+ include/linux/livepatch.h                          |   50 +-
+ include/linux/lockdep.h                            |   54 +-
+ include/linux/lsm_hooks.h                          |   70 +-
+ include/linux/lzo.h                                |    6 +-
+ include/linux/mailbox/zynqmp-ipi-message.h         |   20 +
+ include/linux/mei_cl_bus.h                         |    2 +
+ include/linux/memblock.h                           |   71 +-
+ include/linux/memcontrol.h                         |   47 +-
+ include/linux/memory_hotplug.h                     |    4 +-
+ include/linux/mfd/bcm2835-pm.h                     |   14 +
+ include/linux/mfd/cros_ec.h                        |   21 -
+ include/linux/mfd/intel_soc_pmic.h                 |    3 +
+ include/linux/mfd/lochnagar.h                      |   55 +
+ include/linux/mfd/lochnagar1_regs.h                |  157 +
+ include/linux/mfd/lochnagar2_regs.h                |  291 +
+ include/linux/mfd/stmpe.h                          |   21 +
+ include/linux/mfd/stpmic1.h                        |  212 +
+ include/linux/mfd/tps65218.h                       |    4 +
+ include/linux/mfd/wm831x/core.h                    |    1 -
+ include/linux/mfd/wm8350/core.h                    |    1 -
+ include/linux/mlx5/driver.h                        |    5 +-
+ include/linux/mm.h                                 |   53 +-
+ include/linux/mm_types.h                           |   77 +-
+ include/linux/mmzone.h                             |    8 +-
+ include/linux/mod_devicetable.h                    |   21 +
+ include/linux/module.h                             |   18 +-
+ include/linux/mount.h                              |    3 +
+ include/linux/msi.h                                |   12 +-
+ include/linux/namei.h                              |    3 +
+ include/linux/net.h                                |    2 +-
+ include/linux/nfs4.h                               |    1 +
+ include/linux/nfs_fs_sb.h                          |    1 +
+ include/linux/nfs_page.h                           |   10 +
+ include/linux/nfs_xdr.h                            |   37 +-
+ include/linux/nodemask.h                           |    8 +-
+ include/linux/ntb.h                                |   10 +-
+ include/linux/nvme-fc-driver.h                     |   10 +-
+ include/linux/nvme-fc.h                            |   14 +-
+ include/linux/nvme-rdma.h                          |   10 +-
+ include/linux/nvme-tcp.h                           |    2 +-
+ include/linux/nvme.h                               |   10 +-
+ include/linux/nvram.h                              |  133 +-
+ include/linux/of_gpio.h                            |    2 +
+ include/linux/of_reserved_mem.h                    |    7 -
+ include/linux/page-flags.h                         |   44 +-
+ include/linux/pagemap.h                            |   32 +-
+ include/linux/parport.h                            |   13 +
+ include/linux/pci-ats.h                            |    5 +
+ include/linux/pci-epc.h                            |   31 +-
+ include/linux/pci.h                                |    9 +-
+ include/linux/pci_ids.h                            |    4 +
+ include/linux/percpu-rwsem.h                       |   24 +-
+ include/linux/perf_event.h                         |   43 +-
+ include/linux/phy/phy-mipi-dphy.h                  |   13 +-
+ include/linux/pid.h                                |    1 -
+ include/linux/pinctrl/pinconf.h                    |    6 -
+ include/linux/pipe_fs_i.h                          |    8 +-
+ include/linux/platform_data/at24.h                 |   60 -
+ include/linux/platform_data/davinci-cpufreq.h      |   19 +
+ include/linux/platform_data/dma-dw.h               |   12 +-
+ include/linux/platform_data/dma-imx.h              |    1 +
+ include/linux/platform_data/gpio/gpio-amd-fch.h    |   46 +
+ include/linux/platform_data/i2c-cbus-gpio.h        |   27 -
+ include/linux/platform_data/i2c-ocores.h           |    6 +-
+ include/linux/platform_data/media/si4713.h         |    4 +-
+ .../platform_data/media/soc_camera_platform.h      |   83 -
+ include/linux/platform_data/mlxreg.h               |   25 +-
+ include/linux/platform_data/usb-davinci.h          |   14 -
+ include/linux/platform_data/wilco-ec.h             |  144 +
+ include/linux/platform_data/{ => x86}/clk-lpss.h   |    0
+ include/linux/platform_device.h                    |    4 +
+ include/linux/pm.h                                 |    8 +-
+ include/linux/pm_domain.h                          |    8 +-
+ include/linux/pm_opp.h                             |   13 +
+ include/linux/pm_runtime.h                         |    2 +
+ include/linux/pm_wakeup.h                          |    9 -
+ include/linux/poison.h                             |    5 +-
+ include/linux/posix-clock.h                        |    2 +-
+ include/linux/posix-timers.h                       |    2 +-
+ include/linux/power/isp1704_charger.h              |   30 -
+ include/linux/power_supply.h                       |    1 +
+ include/linux/printk.h                             |    3 +-
+ include/linux/proc_fs.h                            |    6 +
+ include/linux/property.h                           |    2 +-
+ include/linux/pwm.h                                |   37 +-
+ include/linux/rcu_node_tree.h                      |   17 +-
+ include/linux/rcu_segcblist.h                      |   17 +-
+ include/linux/rcu_sync.h                           |   15 +-
+ include/linux/rcupdate.h                           |   91 +-
+ include/linux/rcutiny.h                            |   17 +-
+ include/linux/rcutree.h                            |   19 +-
+ include/linux/relay.h                              |    2 +-
+ include/linux/remoteproc.h                         |    8 +-
+ include/linux/reset/socfpga.h                      |    7 +
+ include/linux/reset/sunxi.h                        |    7 +
+ include/linux/ring_buffer.h                        |    4 +-
+ include/linux/rtc.h                                |    3 +-
+ include/linux/scatterlist.h                        |   49 +-
+ include/linux/sched.h                              |   47 +-
+ include/linux/sched/mm.h                           |   48 +-
+ include/linux/sched/signal.h                       |    5 +-
+ include/linux/sched/sysctl.h                       |    7 +
+ include/linux/sched/task.h                         |    4 +-
+ include/linux/sched/task_stack.h                   |    2 +-
+ include/linux/sched/topology.h                     |    8 +-
+ include/linux/sched/user.h                         |    2 +-
+ include/linux/sched/wake_q.h                       |    4 +-
+ include/linux/security.h                           |   66 +-
+ include/linux/selinux.h                            |   35 -
+ include/linux/shmem_fs.h                           |    3 +-
+ include/linux/skbuff.h                             |   70 +-
+ include/linux/slub_def.h                           |   12 +-
+ include/linux/soc/qcom/llcc-qcom.h                 |    6 +
+ include/linux/srcu.h                               |   18 +-
+ include/linux/srcutiny.h                           |   17 +-
+ include/linux/srcutree.h                           |   20 +-
+ include/linux/statfs.h                             |    3 +
+ include/linux/sunrpc/auth.h                        |   44 +-
+ include/linux/sunrpc/clnt.h                        |    3 +
+ include/linux/sunrpc/gss_krb5_enctypes.h           |   42 +-
+ include/linux/sunrpc/sched.h                       |    9 +
+ include/linux/sunrpc/xdr.h                         |   23 +-
+ include/linux/sunrpc/xprt.h                        |    7 -
+ include/linux/sunrpc/xprtsock.h                    |    1 +
+ include/linux/swap.h                               |    8 +-
+ include/linux/swiotlb.h                            |   14 +-
+ include/linux/switchtec.h                          |   10 +-
+ include/linux/syscalls.h                           |   79 +-
+ include/linux/tee_drv.h                            |   50 +-
+ include/linux/time32.h                             |   32 +-
+ include/linux/time64.h                             |    8 -
+ include/linux/timex.h                              |    4 +-
+ include/linux/torture.h                            |   20 +-
+ include/linux/tpm.h                                |  129 +-
+ include/linux/tpm_eventlog.h                       |   19 +-
+ include/linux/types.h                              |    6 +-
+ include/linux/uio.h                                |    8 -
+ include/linux/usb/hcd.h                            |   10 +-
+ include/linux/usb/role.h                           |    2 +
+ include/linux/usb/tcpm.h                           |    6 -
+ include/linux/usb/typec_dp.h                       |    4 +
+ include/linux/usb/typec_mux.h                      |    3 +-
+ include/linux/usb/wusb.h                           |   16 -
+ include/linux/verification.h                       |    1 +
+ include/linux/vgaarb.h                             |    2 +
+ include/linux/virtio.h                             |    2 +
+ include/linux/virtio_config.h                      |   13 +
+ include/linux/vmw_vmci_defs.h                      |    7 +-
+ include/linux/wait.h                               |    6 +-
+ include/linux/wmi.h                                |    5 +-
+ include/linux/workqueue.h                          |   30 +-
+ include/linux/xarray.h                             |  296 +-
+ include/media/davinci/dm355_ccdc.h                 |    4 +-
+ include/media/davinci/dm644x_ccdc.h                |    2 +-
+ include/media/drv-intf/exynos-fimc.h               |    2 +-
+ include/media/drv-intf/saa7146.h                   |    2 +-
+ include/media/drv-intf/saa7146_vv.h                |    4 +-
+ include/media/drv-intf/sh_mobile_ceu.h             |   29 -
+ include/media/dvb_frontend.h                       |    8 +-
+ include/media/i2c/tw9910.h                         |    2 -
+ include/media/mpeg2-ctrls.h                        |   14 +-
+ include/media/rc-map.h                             |   18 +-
+ include/media/v4l2-common.h                        |    9 -
+ include/media/v4l2-ctrls.h                         |    2 +-
+ include/media/v4l2-event.h                         |    2 +
+ include/media/v4l2-fwnode.h                        |    4 +-
+ include/media/v4l2-mem2mem.h                       |   44 +-
+ include/media/v4l2-subdev.h                        |    9 +-
+ include/media/videobuf-core.h                      |    4 +-
+ include/media/videobuf2-core.h                     |   15 +-
+ include/media/videobuf2-dma-sg.h                   |    2 +-
+ include/media/videobuf2-v4l2.h                     |   16 +
+ include/net/af_unix.h                              |    1 +
+ include/net/netfilter/nf_tables.h                  |   12 +-
+ include/net/request_sock.h                         |    1 -
+ include/net/sctp/structs.h                         |   15 +-
+ include/ras/ras_event.h                            |    8 +-
+ include/rdma/ib_hdrs.h                             |   14 +-
+ include/rdma/ib_mad.h                              |    5 +-
+ include/rdma/ib_umem.h                             |    8 +-
+ include/rdma/ib_umem_odp.h                         |   34 +-
+ include/rdma/ib_verbs.h                            |  274 +-
+ include/rdma/iw_cm.h                               |   16 +-
+ include/rdma/iw_portmap.h                          |  144 +-
+ include/rdma/rdma_cm.h                             |    1 +
+ include/rdma/rdma_netlink.h                        |   11 +
+ include/rdma/rdma_vt.h                             |   30 +-
+ include/rdma/rdmavt_qp.h                           |   20 +-
+ include/rdma/restrack.h                            |   58 +-
+ include/rdma/tid_rdma_defs.h                       |  108 +
+ include/rdma/uverbs_ioctl.h                        |   18 +
+ include/rdma/uverbs_std_types.h                    |   18 +-
+ include/rdma/uverbs_types.h                        |    1 +
+ include/scsi/libfcoe.h                             |    4 +-
+ include/scsi/libsas.h                              |   59 +-
+ include/scsi/osd_initiator.h                       |  511 --
+ include/scsi/osd_ore.h                             |  201 -
+ include/scsi/scsi.h                                |    6 -
+ include/scsi/scsi_cmnd.h                           |   34 +-
+ include/scsi/scsi_eh.h                             |    1 -
+ include/scsi/scsi_host.h                           |   20 +-
+ include/soc/bcm2835/raspberrypi-firmware.h         |    4 +
+ include/soc/fsl/dpaa2-io.h                         |    4 +-
+ include/soc/tegra/bpmp.h                           |   13 +-
+ include/soc/tegra/mc.h                             |   27 +-
+ include/soc/tegra/pmc.h                            |    6 -
+ include/sound/core.h                               |    1 -
+ include/sound/cs35l36.h                            |   43 +
+ include/sound/dmaengine_pcm.h                      |    4 -
+ include/sound/hda_component.h                      |    5 +-
+ include/sound/hda_register.h                       |    2 +
+ include/sound/hda_verbs.h                          |    2 +
+ include/sound/hdaudio.h                            |    3 +
+ include/sound/info.h                               |   36 +-
+ include/sound/memalloc.h                           |    1 -
+ include/sound/pcm.h                                |   31 +-
+ include/sound/simple_card_utils.h                  |    4 +-
+ include/sound/soc-acpi.h                           |   33 +-
+ include/sound/soc-dapm.h                           |   27 +-
+ include/sound/soc-topology.h                       |    8 +-
+ include/sound/soc.h                                |   73 +-
+ include/target/iscsi/iscsi_transport.h             |    4 +-
+ include/target/target_core_base.h                  |    1 -
+ include/target/target_core_fabric.h                |    2 +-
+ include/trace/events/btrfs.h                       |   30 +-
+ include/trace/events/f2fs.h                        |   47 +-
+ include/trace/events/host1x.h                      |   26 +
+ include/trace/events/pwc.h                         |   65 +
+ include/trace/events/rpcgss.h                      |  361 ++
+ include/trace/events/rpcrdma.h                     |   12 +-
+ include/trace/events/rxrpc.h                       |    2 +
+ include/trace/events/smbus.h                       |    6 +-
+ include/trace/events/sunrpc.h                      |  363 +-
+ include/trace/events/tegra_apb_dma.h               |   61 +
+ include/uapi/asm-generic/{Kbuild.asm => Kbuild}    |    4 +-
+ include/uapi/asm-generic/mman-common.h             |    4 +-
+ include/uapi/asm-generic/socket.h                  |    2 +-
+ include/uapi/asm-generic/unistd.h                  |  158 +-
+ include/uapi/drm/amdgpu_drm.h                      |    9 +-
+ include/uapi/drm/drm_fourcc.h                      |   63 +
+ include/uapi/drm/i915_drm.h                        |   64 +
+ include/uapi/drm/nouveau_drm.h                     |   51 +
+ include/uapi/drm/v3d_drm.h                         |    8 +
+ include/uapi/linux/android/binder.h                |   19 +
+ include/uapi/linux/auto_fs.h                       |    2 +-
+ include/uapi/linux/binfmts.h                       |    2 +-
+ include/uapi/linux/btrfs.h                         |    2 +
+ include/uapi/linux/dm-ioctl.h                      |    4 +-
+ include/uapi/linux/elf.h                           |    2 +
+ include/uapi/linux/fanotify.h                      |   29 +
+ include/uapi/linux/fcntl.h                         |    1 +
+ include/uapi/linux/fuse.h                          |    7 +-
+ include/uapi/linux/iio/types.h                     |    7 +
+ include/uapi/linux/io_uring.h                      |  137 +
+ include/uapi/linux/kernel-page-flags.h             |    2 +-
+ include/uapi/linux/limits.h                        |    4 +-
+ include/uapi/linux/lirc.h                          |    6 +
+ include/uapi/linux/mman.h                          |    4 +
+ include/uapi/linux/ndctl.h                         |    1 +
+ include/uapi/linux/nvme_ioctl.h                    |    9 -
+ include/uapi/linux/pci_regs.h                      |    2 +
+ include/uapi/linux/perf_event.h                    |   55 +-
+ include/uapi/linux/pmu.h                           |    2 +
+ include/uapi/linux/prctl.h                         |    1 +
+ include/uapi/linux/serial_core.h                   |    3 +
+ include/uapi/linux/time_types.h                    |    4 -
+ include/uapi/linux/timex.h                         |   39 +
+ include/uapi/linux/v4l2-controls.h                 |    2 +
+ include/uapi/linux/videodev2.h                     |   26 +-
+ include/uapi/misc/fastrpc.h                        |   41 +
+ include/uapi/misc/habanalabs.h                     |  450 ++
+ include/uapi/mtd/ubi-user.h                        |    5 +
+ include/uapi/rdma/bnxt_re-abi.h                    |   11 +
+ include/uapi/rdma/ib_user_verbs.h                  |    2 +
+ include/uapi/rdma/mlx5_user_ioctl_cmds.h           |   18 +
+ include/uapi/rdma/mlx5_user_ioctl_verbs.h          |    5 +
+ include/uapi/rdma/rdma_netlink.h                   |   74 +-
+ include/uapi/rdma/rdma_user_cm.h                   |    4 +
+ include/uapi/rdma/rdma_user_rxe.h                  |    3 +-
+ include/video/imx-ipu-v3.h                         |    9 +-
+ include/xen/xen.h                                  |    4 +
+ init/Kconfig                                       |   29 +-
+ init/init_task.c                                   |   11 +-
+ init/initramfs.c                                   |    6 +-
+ init/main.c                                        |   26 +-
+ ipc/mqueue.c                                       |  110 +-
+ ipc/msg.c                                          |   39 +-
+ ipc/namespace.c                                    |    2 +-
+ ipc/sem.c                                          |   48 +-
+ ipc/shm.c                                          |   40 +-
+ ipc/syscall.c                                      |   12 +-
+ ipc/util.h                                         |   21 +-
+ kernel/.gitignore                                  |    2 -
+ kernel/Makefile                                    |   11 +-
+ kernel/async.c                                     |   53 +-
+ kernel/audit.c                                     |  267 +-
+ kernel/audit.h                                     |   81 +-
+ kernel/audit_fsnotify.c                            |    2 +-
+ kernel/audit_tree.c                                |   19 +-
+ kernel/audit_watch.c                               |    2 +-
+ kernel/auditfilter.c                               |    6 +-
+ kernel/auditsc.c                                   |  320 +-
+ kernel/bpf/core.c                                  |    2 +-
+ kernel/bpf/syscall.c                               |    2 +
+ kernel/bpf/verifier.c                              |   10 +-
+ kernel/capability.c                                |   45 +-
+ kernel/cgroup/cgroup-internal.h                    |   49 +-
+ kernel/cgroup/cgroup-v1.c                          |  394 +-
+ kernel/cgroup/cgroup.c                             |  250 +-
+ kernel/cgroup/cpuset.c                             |   69 +-
+ kernel/cgroup/pids.c                               |    4 +-
+ kernel/cgroup/rdma.c                               |    5 +-
+ kernel/cgroup/rstat.c                              |   10 +-
+ kernel/compat.c                                    |   64 -
+ kernel/configs.c                                   |   42 +-
+ kernel/cpu.c                                       |    9 +
+ kernel/crash_core.c                                |    2 +
+ kernel/cred.c                                      |   13 -
+ kernel/dma/Kconfig                                 |  124 +-
+ kernel/dma/Makefile                                |    2 +-
+ kernel/dma/coherent.c                              |   50 +-
+ kernel/dma/debug.c                                 |  108 +-
+ kernel/dma/direct.c                                |   28 +-
+ kernel/dma/mapping.c                               |   25 +-
+ kernel/dma/swiotlb.c                               |   91 +-
+ kernel/events/callchain.c                          |    3 +-
+ kernel/events/core.c                               |  356 +-
+ kernel/events/hw_breakpoint.c                      |   15 +-
+ kernel/events/internal.h                           |    5 +-
+ kernel/events/ring_buffer.c                        |   45 +-
+ kernel/events/uprobes.c                            |   23 +-
+ kernel/exit.c                                      |    1 +
+ kernel/fork.c                                      |   27 +-
+ kernel/futex.c                                     |   28 +-
+ kernel/gcov/gcc_3_4.c                              |    6 +-
+ kernel/hung_task.c                                 |    3 +-
+ kernel/irq/affinity.c                              |  121 +-
+ kernel/irq/chip.c                                  |   78 +-
+ kernel/irq/debugfs.c                               |    8 +-
+ kernel/irq/handle.c                                |    2 +-
+ kernel/irq/internals.h                             |   10 +-
+ kernel/irq/irq_sim.c                               |   12 +
+ kernel/irq/irqdesc.c                               |   42 +-
+ kernel/irq/irqdomain.c                             |   61 +-
+ kernel/irq/manage.c                                |  406 +-
+ kernel/kallsyms.c                                  |    2 +-
+ kernel/kcov.c                                      |   15 +-
+ kernel/kprobes.c                                   |   21 +-
+ kernel/kthread.c                                   |   54 +-
+ kernel/livepatch/core.c                            |  854 ++-
+ kernel/livepatch/core.h                            |   11 +
+ kernel/livepatch/patch.c                           |   57 +-
+ kernel/livepatch/patch.h                           |    5 +-
+ kernel/livepatch/transition.c                      |  124 +-
+ kernel/livepatch/transition.h                      |    1 -
+ kernel/locking/lockdep.c                           |  982 ++-
+ kernel/locking/lockdep_internals.h                 |    7 +-
+ kernel/locking/lockdep_proc.c                      |   12 +-
+ kernel/locking/locktorture.c                       |   21 +-
+ kernel/locking/qspinlock.c                         |   21 +-
+ kernel/locking/qspinlock_stat.h                    |   21 +-
+ kernel/locking/rwsem-xadd.c                        |    4 +-
+ kernel/module.c                                    |    6 +-
+ kernel/panic.c                                     |   10 +-
+ kernel/power/energy_model.c                        |   57 +
+ kernel/power/qos.c                                 |    8 +-
+ kernel/power/snapshot.c                            |   20 +-
+ kernel/printk/printk.c                             |  100 +-
+ kernel/rcu/Kconfig                                 |   30 -
+ kernel/rcu/rcu.h                                   |   21 +-
+ kernel/rcu/rcu_segcblist.c                         |   17 +-
+ kernel/rcu/rcu_segcblist.h                         |   17 +-
+ kernel/rcu/rcuperf.c                               |   27 +-
+ kernel/rcu/rcutorture.c                            |   59 +-
+ kernel/rcu/srcutiny.c                              |   17 +-
+ kernel/rcu/srcutree.c                              |   72 +-
+ kernel/rcu/sync.c                                  |   15 +-
+ kernel/rcu/tiny.c                                  |   19 +-
+ kernel/rcu/tree.c                                  |  269 +-
+ kernel/rcu/tree.h                                  |   53 +-
+ kernel/rcu/tree_exp.h                              |  201 +-
+ kernel/rcu/tree_plugin.h                           |  238 +-
+ kernel/rcu/update.c                                |   19 +-
+ kernel/relay.c                                     |    1 -
+ kernel/resource.c                                  |   22 +-
+ kernel/sched/core.c                                |   87 +-
+ kernel/sched/cpufreq.c                             |    4 +-
+ kernel/sched/cpufreq_schedutil.c                   |    2 +-
+ kernel/sched/deadline.c                            |    6 +-
+ kernel/sched/debug.c                               |    4 +
+ kernel/sched/fair.c                                |  473 +-
+ kernel/sched/isolation.c                           |    2 +-
+ kernel/sched/pelt.c                                |   45 +-
+ kernel/sched/pelt.h                                |  114 +-
+ kernel/sched/rt.c                                  |    6 +-
+ kernel/sched/sched.h                               |   56 +-
+ kernel/sched/topology.c                            |   37 +-
+ kernel/seccomp.c                                   |    4 +-
+ kernel/signal.c                                    |  135 +-
+ kernel/softirq.c                                   |    3 +-
+ kernel/sys.c                                       |   11 +-
+ kernel/sys_ni.c                                    |   28 +-
+ kernel/sysctl.c                                    |  108 +-
+ kernel/time/Kconfig                                |   29 +
+ kernel/time/hrtimer.c                              |    4 +-
+ kernel/time/ntp.c                                  |   18 +-
+ kernel/time/ntp_internal.h                         |    2 +-
+ kernel/time/posix-clock.c                          |    2 +-
+ kernel/time/posix-cpu-timers.c                     |   13 +-
+ kernel/time/posix-stubs.c                          |   25 +-
+ kernel/time/posix-timers.c                         |   72 +-
+ kernel/time/posix-timers.h                         |    2 +-
+ kernel/time/tick-broadcast.c                       |    1 +
+ kernel/time/time.c                                 |   92 +-
+ kernel/time/timekeeping.c                          |    4 +-
+ kernel/time/timekeeping_debug.c                    |   11 +-
+ kernel/time/timer.c                                |    4 +-
+ kernel/torture.c                                   |   25 +-
+ kernel/trace/Kconfig                               |    1 +
+ kernel/trace/blktrace.c                            |    1 +
+ kernel/trace/bpf_trace.c                           |    3 +-
+ kernel/trace/ftrace.c                              |   30 +
+ kernel/trace/ring_buffer.c                         |   19 +-
+ kernel/trace/trace.c                               |  231 +-
+ kernel/trace/trace.h                               |   66 +-
+ kernel/trace/trace_entries.h                       |   41 +-
+ kernel/trace/trace_event_perf.c                    |   16 +-
+ kernel/trace/trace_events_filter.c                 |   12 +-
+ kernel/trace/trace_events_hist.c                   | 1059 ++-
+ kernel/trace/trace_functions_graph.c               |   30 +-
+ kernel/trace/trace_irqsoff.c                       |   11 +-
+ kernel/trace/trace_kdb.c                           |    6 +-
+ kernel/trace/trace_kprobe.c                        |   25 +-
+ kernel/trace/trace_preemptirq.c                    |    5 +
+ kernel/trace/trace_probe.c                         |   21 +-
+ kernel/trace/trace_probe.h                         |    1 +
+ kernel/trace/trace_sched_wakeup.c                  |   11 +-
+ kernel/trace/trace_uprobe.c                        |    8 +-
+ kernel/watchdog.c                                  |    7 +
+ kernel/workqueue.c                                 |  166 +-
+ lib/Kconfig.debug                                  |  118 +-
+ lib/Kconfig.kasan                                  |   10 -
+ lib/Kconfig.ubsan                                  |   14 +-
+ lib/Makefile                                       |   11 +-
+ lib/assoc_array.c                                  |    1 +
+ lib/bsearch.c                                      |    2 +
+ lib/cpumask.c                                      |    6 +-
+ lib/devres.c                                       |    4 +-
+ lib/div64.c                                        |    4 +-
+ lib/dynamic_debug.c                                |   22 +-
+ lib/flex_array.c                                   |  398 --
+ lib/generic-radix-tree.c                           |  217 +
+ lib/iomap.c                                        |  140 +-
+ lib/iov_iter.c                                     |   17 +-
+ lib/irq_poll.c                                     |    2 +-
+ lib/kobject.c                                      |    2 +-
+ lib/kobject_uevent.c                               |    9 +-
+ lib/livepatch/Makefile                             |   15 +
+ lib/livepatch/test_klp_atomic_replace.c            |   57 +
+ lib/livepatch/test_klp_callbacks_busy.c            |   43 +
+ lib/livepatch/test_klp_callbacks_demo.c            |  121 +
+ lib/livepatch/test_klp_callbacks_demo2.c           |   93 +
+ lib/livepatch/test_klp_callbacks_mod.c             |   24 +
+ lib/livepatch/test_klp_livepatch.c                 |   51 +
+ lib/livepatch/test_klp_shadow_vars.c               |  258 +
+ lib/locking-selftest.c                             |    2 +
+ lib/lzo/lzo1x_compress.c                           |  130 +-
+ lib/lzo/lzo1x_decompress_safe.c                    |   75 +-
+ lib/lzo/lzodefs.h                                  |   21 +-
+ lib/raid6/Makefile                                 |    2 +-
+ lib/raid6/neon.uc                                  |    5 +-
+ lib/raid6/recov_neon_inner.c                       |   19 +-
+ lib/refcount.c                                     |   18 +-
+ lib/scatterlist.c                                  |   26 +
+ lib/smp_processor_id.c                             |    7 +-
+ lib/test_firmware.c                                |    9 -
+ lib/test_kasan.c                                   |   24 -
+ lib/test_stackinit.c                               |  378 ++
+ lib/test_ubsan.c                                   |   11 +-
+ lib/test_vmalloc.c                                 |  551 ++
+ lib/test_xarray.c                                  |  288 +-
+ lib/vsprintf.c                                     |    6 +-
+ lib/xarray.c                                       |  163 +-
+ mm/Kconfig.debug                                   |   17 +
+ mm/cma.c                                           |   14 +-
+ mm/cma_debug.c                                     |   11 +-
+ mm/compaction.c                                    | 1039 ++-
+ mm/debug.c                                         |    5 +-
+ mm/dmapool.c                                       |   13 +-
+ mm/failslab.c                                      |   14 +-
+ mm/filemap.c                                       |  309 +-
+ mm/gup.c                                           |  206 +-
+ mm/gup_benchmark.c                                 |    8 +-
+ mm/hmm.c                                           |    2 +-
+ mm/huge_memory.c                                   |   37 +-
+ mm/hugetlb.c                                       |   17 +-
+ mm/internal.h                                      |   24 +-
+ mm/kasan/common.c                                  |    2 +
+ mm/kasan/generic.c                                 |   19 -
+ mm/kasan/generic_report.c                          |    3 -
+ mm/kasan/init.c                                    |   16 +-
+ mm/kasan/kasan.h                                   |    3 -
+ mm/khugepaged.c                                    |    2 +
+ mm/ksm.c                                           |   77 +-
+ mm/list_lru.c                                      |    3 +-
+ mm/memblock.c                                      |  374 +-
+ mm/memcontrol.c                                    |  150 +-
+ mm/memfd.c                                         |    3 +-
+ mm/memory-failure.c                                |   14 +-
+ mm/memory.c                                        |   72 +-
+ mm/memory_hotplug.c                                |   93 +-
+ mm/mempolicy.c                                     |    4 +-
+ mm/mempool.c                                       |    8 +
+ mm/migrate.c                                       |   14 +-
+ mm/mlock.c                                         |   14 +-
+ mm/mmap.c                                          |   15 +-
+ mm/mprotect.c                                      |    6 +-
+ mm/mremap.c                                        |   17 +
+ mm/oom_kill.c                                      |   81 +-
+ mm/page-writeback.c                                |   24 +-
+ mm/page_alloc.c                                    |  170 +-
+ mm/page_ext.c                                      |    5 +-
+ mm/page_idle.c                                     |    8 +-
+ mm/page_owner.c                                    |    8 +-
+ mm/page_poison.c                                   |    4 +
+ mm/percpu-km.c                                     |    2 +-
+ mm/percpu.c                                        |   86 +-
+ mm/readahead.c                                     |    2 +
+ mm/rmap.c                                          |    2 +-
+ mm/shmem.c                                         |  741 ++-
+ mm/slab.c                                          |   34 +-
+ mm/slab.h                                          |    4 -
+ mm/slab_common.c                                   |   12 +-
+ mm/slub.c                                          |   16 +-
+ mm/sparse.c                                        |   29 +-
+ mm/swap.c                                          |   16 +-
+ mm/swap_state.c                                    |   23 +-
+ mm/swapfile.c                                      |  487 +-
+ mm/truncate.c                                      |    6 +-
+ mm/util.c                                          |   37 +-
+ mm/vmalloc.c                                       |  459 +-
+ mm/vmscan.c                                        |   88 +-
+ mm/vmstat.c                                        |   15 +-
+ mm/workingset.c                                    |    5 +-
+ net/9p/client.c                                    |    2 +-
+ net/9p/trans_xen.c                                 |    2 +-
+ net/Makefile                                       |    2 +-
+ net/atm/resources.c                                |   10 +-
+ net/bpf/test_run.c                                 |    2 +-
+ net/ceph/osdmap.c                                  |    5 +-
+ net/compat.c                                       |    2 +-
+ net/core/ethtool.c                                 |   16 +-
+ net/core/filter.c                                  |    8 +-
+ net/core/gro_cells.c                               |   22 +-
+ net/core/lwt_bpf.c                                 |    2 +
+ net/core/pktgen.c                                  |    3 +-
+ net/core/skmsg.c                                   |    1 +
+ net/hsr/hsr_device.c                               |   18 +-
+ net/hsr/hsr_framereg.c                             |   12 +
+ net/hsr/hsr_framereg.h                             |    1 +
+ net/ipv4/fou.c                                     |    4 +-
+ net/ipv4/ip_tunnel.c                               |    9 +-
+ net/ipv4/route.c                                   |   13 +-
+ net/ipv4/syncookies.c                              |    7 +-
+ net/ipv4/tcp.c                                     |    9 +
+ net/ipv4/tcp_input.c                               |    8 +-
+ net/ipv4/tcp_ipv4.c                                |    9 +-
+ net/ipv6/fou6.c                                    |    4 +-
+ net/ipv6/sit.c                                     |    5 +-
+ net/l2tp/l2tp_ip6.c                                |    4 +-
+ net/netfilter/nf_nat_masquerade.c                  |   35 +-
+ net/netfilter/nf_tables_api.c                      |   54 +-
+ net/netfilter/nft_dynset.c                         |   13 +-
+ net/netfilter/nft_lookup.c                         |   13 +-
+ net/netfilter/nft_objref.c                         |   13 +-
+ net/openvswitch/flow.h                             |    1 -
+ net/openvswitch/flow_netlink.h                     |    1 -
+ net/openvswitch/flow_table.c                       |   51 +-
+ net/openvswitch/flow_table.h                       |    3 +-
+ net/qrtr/qrtr.c                                    |    3 +-
+ net/rds/ib.h                                       |   12 +-
+ net/rds/ib_fmr.c                                   |    8 +-
+ net/rds/ib_frmr.c                                  |    4 +-
+ net/rds/ib_recv.c                                  |    8 +-
+ net/rds/ib_send.c                                  |   15 +-
+ net/rxrpc/conn_client.c                            |   24 +-
+ net/sched/act_tunnel_key.c                         |   22 +-
+ net/sched/cls_api.c                                |   49 +-
+ net/sched/cls_flower.c                             |   43 +-
+ net/sched/sch_api.c                                |   15 +-
+ net/sctp/auth.c                                    |    6 -
+ net/sctp/endpointola.c                             |   18 +-
+ net/sctp/socket.c                                  |   44 +-
+ net/sctp/stream.c                                  |  127 +-
+ net/sctp/stream_interleave.c                       |    2 +-
+ net/smc/smc_rx.c                                   |    1 -
+ net/sunrpc/Kconfig                                 |   16 +
+ net/sunrpc/auth.c                                  |  136 +-
+ net/sunrpc/auth_gss/Makefile                       |    2 +-
+ net/sunrpc/auth_gss/auth_gss.c                     |  553 +-
+ net/sunrpc/auth_gss/gss_krb5_mech.c                |   29 +-
+ net/sunrpc/auth_gss/gss_krb5_wrap.c                |    8 +-
+ net/sunrpc/auth_gss/gss_mech_switch.c              |   27 +-
+ net/sunrpc/auth_gss/gss_rpc_upcall.c               |   15 +-
+ net/sunrpc/auth_gss/gss_rpc_upcall.h               |   16 +-
+ net/sunrpc/auth_gss/gss_rpc_xdr.c                  |   15 +-
+ net/sunrpc/auth_gss/gss_rpc_xdr.h                  |   17 +-
+ net/sunrpc/auth_gss/svcauth_gss.c                  |    3 +-
+ net/sunrpc/auth_gss/trace.c                        |   11 +
+ net/sunrpc/auth_null.c                             |   56 +-
+ net/sunrpc/auth_unix.c                             |  122 +-
+ net/sunrpc/backchannel_rqst.c                      |   42 +-
+ net/sunrpc/clnt.c                                  |  664 +-
+ net/sunrpc/sched.c                                 |   17 +-
+ net/sunrpc/svc.c                                   |   19 +-
+ net/sunrpc/svc_xprt.c                              |   24 +-
+ net/sunrpc/svcsock.c                               |   20 +-
+ net/sunrpc/xdr.c                                   |  121 +-
+ net/sunrpc/xprt.c                                  |   25 +-
+ net/sunrpc/xprtrdma/backchannel.c                  |    3 +-
+ net/sunrpc/xprtrdma/frwr_ops.c                     |    4 +-
+ net/sunrpc/xprtrdma/rpc_rdma.c                     |   22 +-
+ net/sunrpc/xprtrdma/svc_rdma_backchannel.c         |    1 -
+ net/sunrpc/xprtrdma/svc_rdma_recvfrom.c            |   12 +-
+ net/sunrpc/xprtrdma/svc_rdma_rw.c                  |   17 +-
+ net/sunrpc/xprtrdma/svc_rdma_sendto.c              |    4 -
+ net/sunrpc/xprtrdma/svc_rdma_transport.c           |    9 +-
+ net/sunrpc/xprtrdma/transport.c                    |    2 -
+ net/sunrpc/xprtrdma/verbs.c                        |    2 +
+ net/sunrpc/xprtrdma/xprt_rdma.h                    |   12 +-
+ net/sunrpc/xprtsock.c                              |  319 +-
+ net/tipc/socket.c                                  |    2 +-
+ net/tls/tls_device.c                               |    3 -
+ net/tls/tls_main.c                                 |    3 +-
+ net/unix/Kconfig                                   |    5 +
+ net/unix/Makefile                                  |    2 +
+ net/unix/af_unix.c                                 |   63 +-
+ net/unix/garbage.c                                 |   68 +-
+ net/unix/scm.c                                     |  151 +
+ net/unix/scm.h                                     |   10 +
+ net/vmw_vsock/virtio_transport_common.c            |   22 +-
+ net/x25/af_x25.c                                   |    7 +-
+ net/xdp/xsk.c                                      |    5 +-
+ net/xdp/xsk_diag.c                                 |    4 +-
+ net/xdp/xsk_queue.h                                |    4 +-
+ samples/Kconfig                                    |    7 +
+ samples/Makefile                                   |    2 +-
+ samples/binderfs/Makefile                          |    1 +
+ samples/binderfs/binderfs_example.c                |   83 +
+ samples/bpf/hbm.c                                  |    4 +-
+ samples/livepatch/livepatch-callbacks-demo.c       |   13 +-
+ samples/livepatch/livepatch-sample.c               |   13 +-
+ samples/livepatch/livepatch-shadow-fix1.c          |   18 +-
+ samples/livepatch/livepatch-shadow-fix2.c          |   18 +-
+ samples/livepatch/livepatch-shadow-mod.c           |   11 +-
+ samples/mic/mpssd/mpssd.h                          |    3 -
+ samples/v4l/v4l2-pci-skeleton.c                    |    8 +-
+ scripts/Kbuild.include                             |   21 +-
+ scripts/Kconfig.include                            |    2 +-
+ scripts/Makefile                                   |    3 +-
+ scripts/Makefile.asm-generic                       |   11 +
+ scripts/Makefile.build                             |   33 +-
+ scripts/Makefile.gcc-plugins                       |    2 +
+ scripts/Makefile.host                              |    6 +-
+ scripts/Makefile.kasan                             |    5 -
+ scripts/Makefile.lib                               |   48 +-
+ scripts/Makefile.modinst                           |    2 +-
+ scripts/Makefile.modpost                           |    3 +-
+ scripts/adjust_autoksyms.sh                        |    9 +-
+ scripts/atomic/atomic-tbl.sh                       |  186 +
+ scripts/atomic/atomics.tbl                         |   41 +
+ scripts/atomic/check-atomics.sh                    |   33 +
+ scripts/atomic/fallbacks/acquire                   |    9 +
+ scripts/atomic/fallbacks/add_negative              |   16 +
+ scripts/atomic/fallbacks/add_unless                |   16 +
+ scripts/atomic/fallbacks/andnot                    |    7 +
+ scripts/atomic/fallbacks/dec                       |    7 +
+ scripts/atomic/fallbacks/dec_and_test              |   15 +
+ scripts/atomic/fallbacks/dec_if_positive           |   15 +
+ scripts/atomic/fallbacks/dec_unless_positive       |   14 +
+ scripts/atomic/fallbacks/fence                     |   11 +
+ scripts/atomic/fallbacks/fetch_add_unless          |   23 +
+ scripts/atomic/fallbacks/inc                       |    7 +
+ scripts/atomic/fallbacks/inc_and_test              |   15 +
+ scripts/atomic/fallbacks/inc_not_zero              |   14 +
+ scripts/atomic/fallbacks/inc_unless_negative       |   14 +
+ scripts/atomic/fallbacks/read_acquire              |    7 +
+ scripts/atomic/fallbacks/release                   |    8 +
+ scripts/atomic/fallbacks/set_release               |    7 +
+ scripts/atomic/fallbacks/sub_and_test              |   16 +
+ scripts/atomic/fallbacks/try_cmpxchg               |   11 +
+ scripts/atomic/gen-atomic-fallback.sh              |  181 +
+ scripts/atomic/gen-atomic-instrumented.sh          |  182 +
+ scripts/atomic/gen-atomic-long.sh                  |  101 +
+ scripts/atomic/gen-atomics.sh                      |   20 +
+ scripts/checkpatch.pl                              |   51 +-
+ scripts/checksyscalls.sh                           |   53 +-
+ scripts/clang-version.sh                           |   10 +-
+ scripts/coccinelle/free/put_device.cocci           |   56 +
+ scripts/decode_stacktrace.sh                       |    9 +-
+ scripts/dtc/dtx_diff                               |   13 +-
+ scripts/gcc-plugins/Kconfig                        |   62 +-
+ scripts/gcc-plugins/structleak_plugin.c            |   36 +-
+ scripts/gcc-version.sh                             |   27 +-
+ scripts/gdb/linux/Makefile                         |   25 +-
+ scripts/gdb/linux/constants.py.in                  |   12 +-
+ scripts/gdb/linux/proc.py                          |   12 +-
+ scripts/kallsyms.c                                 |   13 +-
+ scripts/kconfig/Makefile                           |    9 +-
+ scripts/kconfig/conf.c                             |   13 -
+ scripts/kconfig/expr.h                             |    2 +-
+ scripts/kconfig/{zconf.l => lexer.l}               |    2 +-
+ scripts/kconfig/lkc.h                              |    2 +-
+ scripts/kconfig/lxdialog/.gitignore                |    4 -
+ scripts/kconfig/{zconf.y => parser.y}              |    0
+ scripts/kconfig/qconf.cc                           |   42 +-
+ scripts/kconfig/qconf.h                            |    1 +
+ scripts/kernel-doc                                 |    2 +-
+ scripts/leaking_addresses.pl                       |    9 +-
+ scripts/link-vmlinux.sh                            |   55 +-
+ scripts/mkcompile_h                                |    4 +-
+ scripts/mod/devicetable-offsets.c                  |    6 +
+ scripts/mod/file2alias.c                           |   47 +-
+ scripts/mod/modpost.c                              |   27 +-
+ scripts/package/Makefile                           |    8 +-
+ scripts/package/builddeb                           |   42 +-
+ scripts/package/buildtar                           |    4 +-
+ scripts/package/mkdebian                           |   45 +-
+ scripts/spdxcheck.py                               |    8 +-
+ scripts/spelling.txt                               |   69 +
+ scripts/ver_linux                                  |    6 +-
+ security/Kconfig                                   |   45 +-
+ security/Makefile                                  |    2 +
+ security/apparmor/Kconfig                          |   16 -
+ security/apparmor/apparmorfs.c                     |    1 +
+ security/apparmor/audit.c                          |    3 +-
+ security/apparmor/capability.c                     |   14 +-
+ security/apparmor/domain.c                         |    4 +-
+ security/apparmor/include/audit.h                  |    3 +-
+ security/apparmor/include/capability.h             |    2 +-
+ security/apparmor/include/cred.h                   |   16 +-
+ security/apparmor/include/file.h                   |    5 +-
+ security/apparmor/include/lib.h                    |    4 +
+ security/apparmor/include/task.h                   |   18 +-
+ security/apparmor/ipc.c                            |    3 +-
+ security/apparmor/lsm.c                            |   67 +-
+ security/apparmor/policy_unpack.c                  |    1 +
+ security/apparmor/resource.c                       |    2 +-
+ security/apparmor/task.c                           |    6 +-
+ security/commoncap.c                               |   30 +-
+ security/integrity/digsig.c                        |    3 +
+ security/integrity/evm/evm_crypto.c                |    3 +-
+ security/integrity/evm/evm_main.c                  |    6 +-
+ security/integrity/ima/ima.h                       |    4 +-
+ security/integrity/ima/ima_appraise.c              |    1 +
+ security/integrity/ima/ima_crypto.c                |   10 +-
+ security/integrity/ima/ima_init.c                  |    4 +
+ security/integrity/ima/ima_main.c                  |   35 +-
+ security/integrity/ima/ima_policy.c                |   10 +-
+ security/integrity/ima/ima_queue.c                 |   27 +-
+ security/integrity/ima/ima_template_lib.c          |    1 +
+ security/keys/encrypted-keys/encrypted.c           |    4 +-
+ security/keys/keyctl.c                             |    2 +-
+ security/keys/keyring.c                            |    1 +
+ security/keys/process_keys.c                       |    3 +
+ security/keys/request_key.c                        |    4 +
+ security/keys/trusted.c                            |   73 +-
+ security/loadpin/loadpin.c                         |    8 +-
+ security/safesetid/Kconfig                         |   14 +
+ security/safesetid/Makefile                        |    7 +
+ security/safesetid/lsm.c                           |  277 +
+ security/safesetid/lsm.h                           |   33 +
+ security/safesetid/securityfs.c                    |  193 +
+ security/security.c                                |  664 +-
+ security/selinux/Kconfig                           |   15 -
+ security/selinux/Makefile                          |    2 +-
+ security/selinux/avc.c                             |  199 +-
+ security/selinux/exports.c                         |   23 -
+ security/selinux/hooks.c                           |  518 +-
+ security/selinux/include/audit.h                   |    7 +-
+ security/selinux/include/avc.h                     |    6 +-
+ security/selinux/include/objsec.h                  |   38 +-
+ security/selinux/include/security.h                |   13 +-
+ security/selinux/selinuxfs.c                       |    4 +-
+ security/selinux/ss/avtab.c                        |   40 +-
+ security/selinux/ss/avtab.h                        |    4 +-
+ security/selinux/ss/conditional.c                  |    6 +-
+ security/selinux/ss/policydb.c                     |  122 +-
+ security/selinux/ss/policydb.h                     |   12 +-
+ security/selinux/ss/services.c                     |   63 +-
+ security/selinux/xfrm.c                            |    4 +-
+ security/smack/smack.h                             |   63 +-
+ security/smack/smack_access.c                      |    6 +-
+ security/smack/smack_lsm.c                         |  413 +-
+ security/smack/smackfs.c                           |   18 +-
+ security/tomoyo/audit.c                            |   31 +-
+ security/tomoyo/common.c                           |  199 +-
+ security/tomoyo/common.h                           |   51 +-
+ security/tomoyo/condition.c                        |   59 +-
+ security/tomoyo/domain.c                           |   76 +-
+ security/tomoyo/file.c                             |   20 +
+ security/tomoyo/gc.c                               |   19 +
+ security/tomoyo/group.c                            |    5 +
+ security/tomoyo/load_policy.c                      |    8 +-
+ security/tomoyo/memory.c                           |    9 +-
+ security/tomoyo/mount.c                            |    2 +
+ security/tomoyo/realpath.c                         |   18 +-
+ security/tomoyo/securityfs_if.c                    |   30 +-
+ security/tomoyo/tomoyo.c                           |  160 +-
+ security/tomoyo/util.c                             |   23 +-
+ security/yama/yama_lsm.c                           |    8 +-
+ sound/ac97/bus.c                                   |    2 +-
+ sound/aoa/core/gpio-feature.c                      |    1 +
+ sound/aoa/soundbus/i2sbus/core.c                   |    4 -
+ sound/arm/aaci.c                                   |    4 +-
+ sound/arm/pxa2xx-ac97.c                            |    1 -
+ sound/atmel/ac97c.c                                |    4 +-
+ sound/core/compress_offload.c                      |   11 +-
+ sound/core/info.c                                  |  131 +-
+ sound/core/init.c                                  |   31 +-
+ sound/core/memalloc.c                              |    2 +
+ sound/core/oss/pcm_oss.c                           |    1 -
+ sound/core/pcm.c                                   |  163 +-
+ sound/core/pcm_lib.c                               |    9 +-
+ sound/core/pcm_local.h                             |    1 +
+ sound/core/pcm_memory.c                            |   62 +-
+ sound/core/pcm_native.c                            |  315 +-
+ sound/drivers/aloop.c                              |   14 +-
+ sound/drivers/dummy.c                              |   12 +-
+ sound/drivers/opl4/opl4_proc.c                     |    4 -
+ sound/drivers/pcsp/pcsp.c                          |    1 -
+ sound/drivers/vx/vx_core.c                         |    9 +-
+ sound/firewire/Kconfig                             |    1 +
+ sound/firewire/bebob/bebob.c                       |   14 +-
+ sound/firewire/bebob/bebob_proc.c                  |   12 +-
+ sound/firewire/dice/dice-proc.c                    |   12 +-
+ sound/firewire/dice/dice.c                         |   12 +-
+ sound/firewire/digi00x/digi00x-proc.c              |   16 +-
+ sound/firewire/fireface/Makefile                   |    4 +-
+ sound/firewire/fireface/ff-midi.c                  |    2 +-
+ sound/firewire/fireface/ff-pcm.c                   |    2 +-
+ sound/firewire/fireface/ff-proc.c                  |  229 +-
+ sound/firewire/fireface/ff-protocol-ff400.c        |  161 -
+ sound/firewire/fireface/ff-protocol-ff800.c        |  143 -
+ sound/firewire/fireface/ff-protocol-former.c       |  597 ++
+ sound/firewire/fireface/ff-protocol-latter.c       |  430 ++
+ sound/firewire/fireface/ff-stream.c                |   40 +-
+ sound/firewire/fireface/ff-transaction.c           |  143 +-
+ sound/firewire/fireface/ff.c                       |   28 +
+ sound/firewire/fireface/ff.h                       |   23 +-
+ sound/firewire/fireworks/fireworks_proc.c          |   12 +-
+ sound/firewire/motu/amdtp-motu.c                   |    4 +-
+ sound/firewire/motu/motu-proc.c                    |   12 +-
+ sound/firewire/oxfw/oxfw-proc.c                    |   12 +-
+ sound/firewire/tascam/tascam-proc.c                |   12 +-
+ sound/hda/hdac_component.c                         |    4 +-
+ sound/hda/hdac_controller.c                        |    8 +-
+ sound/hda/hdac_i915.c                              |   10 +-
+ sound/hda/hdac_stream.c                            |   47 +-
+ sound/i2c/other/ak4113.c                           |    5 +-
+ sound/i2c/other/ak4114.c                           |    5 +-
+ sound/i2c/other/ak4xxx-adda.c                      |    8 +-
+ sound/isa/ad1816a/ad1816a_lib.c                    |    3 +-
+ sound/isa/als100.c                                 |    1 -
+ sound/isa/cmi8328.c                                |    1 -
+ sound/isa/cmi8330.c                                |    3 +-
+ sound/isa/es1688/es1688.c                          |    2 -
+ sound/isa/es1688/es1688_lib.c                      |    6 +-
+ sound/isa/es18xx.c                                 |    4 +-
+ sound/isa/gus/gus_irq.c                            |    5 +-
+ sound/isa/gus/gus_main.c                           |   13 +-
+ sound/isa/gus/gus_mem.c                            |    6 +-
+ sound/isa/gus/gus_pcm.c                            |    4 +-
+ sound/isa/opti9xx/miro.c                           |    5 +-
+ sound/isa/sb/jazz16.c                              |    1 -
+ sound/isa/sb/sb16.c                                |    1 -
+ sound/isa/sb/sb16_csp.c                            |    5 +-
+ sound/isa/sb/sb16_main.c                           |   12 +-
+ sound/isa/sb/sb8.c                                 |    1 -
+ sound/isa/sb/sb8_main.c                            |    2 +-
+ sound/isa/sscape.c                                 |    7 +-
+ sound/isa/wss/wss_lib.c                            |    3 +-
+ sound/mips/hal2.c                                  |   31 +-
+ sound/mips/sgio2audio.c                            |    7 +-
+ sound/parisc/harmony.c                             |   10 +-
+ sound/pci/ac97/ac97_proc.c                         |   26 +-
+ sound/pci/ad1889.c                                 |   13 +-
+ sound/pci/ak4531_codec.c                           |    5 +-
+ sound/pci/ali5451/ali5451.c                        |    8 +-
+ sound/pci/als300.c                                 |    1 -
+ sound/pci/als4000.c                                |    1 -
+ sound/pci/asihpi/asihpi.c                          |    6 +-
+ sound/pci/atiixp.c                                 |   24 +-
+ sound/pci/atiixp_modem.c                           |    8 +-
+ sound/pci/aw2/aw2-alsa.c                           |   40 +-
+ sound/pci/azt3328.c                                |    4 -
+ sound/pci/bt87x.c                                  |   10 +-
+ sound/pci/ca0106/ca0106_main.c                     |   19 +-
+ sound/pci/ca0106/ca0106_proc.c                     |   40 +-
+ sound/pci/cmipci.c                                 |    9 +-
+ sound/pci/cs4281.c                                 |    5 +-
+ sound/pci/cs46xx/cs46xx_dsp_spos.h                 |    6 -
+ sound/pci/cs46xx/cs46xx_lib.c                      |    6 -
+ sound/pci/cs46xx/dsp_spos.c                        |  133 +-
+ sound/pci/cs46xx/dsp_spos_scb_lib.c                |   19 +-
+ sound/pci/cs5535audio/cs5535audio_pm.c             |    1 -
+ sound/pci/ctxfi/ctatc.c                            |    8 -
+ sound/pci/echoaudio/echoaudio.c                    |   19 +-
+ sound/pci/emu10k1/emu10k1.c                        |    6 -
+ sound/pci/emu10k1/emu10k1x.c                       |   12 +-
+ sound/pci/emu10k1/emupcm.c                         |   22 +-
+ sound/pci/emu10k1/emuproc.c                        |   81 +-
+ sound/pci/emu10k1/p16v.c                           |   17 +-
+ sound/pci/ens1370.c                                |    9 +-
+ sound/pci/es1938.c                                 |    1 -
+ sound/pci/es1968.c                                 |    1 -
+ sound/pci/fm801.c                                  |    1 -
+ sound/pci/hda/hda_beep.c                           |  151 +-
+ sound/pci/hda/hda_beep.h                           |    5 -
+ sound/pci/hda/hda_codec.c                          |   56 +-
+ sound/pci/hda/hda_proc.c                           |    9 +-
+ sound/pci/hda/hda_tegra.c                          |  132 +-
+ sound/pci/hda/patch_conexant.c                     |    3 +
+ sound/pci/hda/patch_hdmi.c                         |   77 +-
+ sound/pci/hda/patch_realtek.c                      |  131 +-
+ sound/pci/ice1712/ews.c                            |    7 +-
+ sound/pci/ice1712/ice1712.c                        |    8 +-
+ sound/pci/ice1712/ice1724.c                        |    8 +-
+ sound/pci/ice1712/pontis.c                         |   12 +-
+ sound/pci/ice1712/prodigy192.c                     |    5 +-
+ sound/pci/ice1712/prodigy_hifi.c                   |    8 +-
+ sound/pci/ice1712/quartet.c                        |    4 +-
+ sound/pci/intel8x0.c                               |    8 +-
+ sound/pci/intel8x0m.c                              |    9 +-
+ sound/pci/korg1212/korg1212.c                      |    6 +-
+ sound/pci/lola/lola_proc.c                         |   16 +-
+ sound/pci/lx6464es/lx6464es.c                      |   16 +-
+ sound/pci/maestro3.c                               |    1 -
+ sound/pci/mixart/mixart.c                          |    6 +-
+ sound/pci/nm256/nm256.c                            |    1 -
+ sound/pci/oxygen/oxygen_lib.c                      |   12 +-
+ sound/pci/oxygen/pcm1796.h                         |    1 -
+ sound/pci/oxygen/xonar_pcm179x.c                   |   71 +-
+ sound/pci/pcxhr/pcxhr.c                            |   21 +-
+ sound/pci/riptide/riptide.c                        |    7 +-
+ sound/pci/rme32.c                                  |    5 +-
+ sound/pci/rme96.c                                  |    7 +-
+ sound/pci/rme9652/hdsp.c                           |    5 +-
+ sound/pci/rme9652/hdspm.c                          |   75 +-
+ sound/pci/rme9652/rme9652.c                        |    6 +-
+ sound/pci/sis7019.c                                |    1 -
+ sound/pci/sonicvibes.c                             |    6 +-
+ sound/pci/trident/trident_main.c                   |    8 +-
+ sound/pci/via82xx.c                                |    8 +-
+ sound/pci/via82xx_modem.c                          |   16 +-
+ sound/pci/ymfpci/ymfpci_main.c                     |   10 +-
+ sound/pcmcia/pdaudiocf/pdaudiocf_core.c            |    6 +-
+ sound/ppc/pmac.c                                   |    1 -
+ sound/ppc/snd_ps3.c                                |    6 +-
+ sound/ppc/tumbler.c                                |    1 +
+ sound/sh/aica.c                                    |   14 +-
+ sound/soc/Kconfig                                  |    1 +
+ sound/soc/Makefile                                 |    1 +
+ sound/soc/amd/acp-pcm-dma.c                        |   26 +-
+ sound/soc/amd/raven/acp3x-pcm-dma.c                |    8 +-
+ sound/soc/codecs/Kconfig                           |   67 +-
+ sound/soc/codecs/Makefile                          |   14 +
+ sound/soc/codecs/ad193x.c                          |   76 +-
+ sound/soc/codecs/ad193x.h                          |    8 +
+ sound/soc/codecs/adau1977.c                        |   12 +-
+ sound/soc/codecs/adau7002.c                        |   45 +
+ sound/soc/codecs/ak4118.c                          |    1 +
+ sound/soc/codecs/ak4458.c                          |   79 +-
+ sound/soc/codecs/cros_ec_codec.c                   |  441 ++
+ sound/soc/codecs/cs35l36.c                         | 1957 ++++++
+ sound/soc/codecs/cs35l36.h                         |  446 ++
+ sound/soc/codecs/cs4271.c                          |    4 +-
+ sound/soc/codecs/cs4341.c                          |  346 +
+ sound/soc/codecs/cs47l24.c                         |   52 +-
+ sound/soc/codecs/da7219-aad.c                      |    2 +-
+ sound/soc/codecs/da7219.c                          |  197 +-
+ sound/soc/codecs/da7219.h                          |    2 +
+ sound/soc/codecs/dmic.c                            |    4 +-
+ sound/soc/codecs/es8316.c                          |  200 +-
+ sound/soc/codecs/es8316.h                          |    7 +
+ sound/soc/codecs/hdac_hdmi.c                       |   87 +-
+ sound/soc/codecs/jz4725b.c                         |  598 ++
+ sound/soc/codecs/jz4740.c                          |   26 +-
+ sound/soc/codecs/max98090.c                        |   15 -
+ sound/soc/codecs/max98373.c                        |    6 +-
+ sound/soc/codecs/max9860.c                         |    3 +-
+ sound/soc/codecs/max98927.c                        |    8 +-
+ sound/soc/codecs/msm8916-wcd-analog.c              |    3 +
+ sound/soc/codecs/msm8916-wcd-digital.c             |   23 +-
+ sound/soc/codecs/mt6351.c                          |    4 +-
+ sound/soc/codecs/mt6358.c                          | 2336 +++++++
+ sound/soc/codecs/mt6358.h                          | 2314 +++++++
+ sound/soc/codecs/nau8824.c                         |    2 +-
+ sound/soc/codecs/nau8825.c                         |    1 +
+ sound/soc/codecs/pcm186x.c                         |    8 +-
+ sound/soc/codecs/pcm3060.c                         |   35 +
+ sound/soc/codecs/pcm3060.h                         |    5 +
+ sound/soc/codecs/pcm512x.c                         |   37 +-
+ sound/soc/codecs/rk3328_codec.c                    |  519 ++
+ sound/soc/codecs/rk3328_codec.h                    |  210 +
+ sound/soc/codecs/rl6347a.c                         |    4 +-
+ sound/soc/codecs/rt274.c                           |   19 +-
+ sound/soc/codecs/rt286.c                           |    8 +-
+ sound/soc/codecs/rt298.c                           |   12 +-
+ sound/soc/codecs/rt5514.c                          |    1 +
+ sound/soc/codecs/rt5640.c                          |    6 +-
+ sound/soc/codecs/rt5645.c                          |   66 +-
+ sound/soc/codecs/rt5651.c                          |   67 +-
+ sound/soc/codecs/rt5651.h                          |    1 +
+ sound/soc/codecs/rt5670.c                          |   54 -
+ sound/soc/codecs/rt5677.c                          |    8 +-
+ sound/soc/codecs/rt5682.c                          |    8 +
+ sound/soc/codecs/sgtl5000.c                        |   19 +-
+ sound/soc/codecs/ssm2602.c                         |   71 +-
+ sound/soc/codecs/tlv320aic31xx.c                   |   16 +-
+ sound/soc/codecs/tlv320aic32x4.c                   |   31 +-
+ sound/soc/codecs/tlv320aic32x4.h                   |    1 +
+ sound/soc/codecs/tlv320aic3x.c                     |   25 +-
+ sound/soc/codecs/tscs42xx.c                        |    2 +-
+ sound/soc/codecs/wcd-clsh-v2.c                     |  576 ++
+ sound/soc/codecs/wcd-clsh-v2.h                     |   49 +
+ sound/soc/codecs/wcd9335.c                         | 5244 +++++++++++++++
+ sound/soc/codecs/wcd9335.h                         |  640 ++
+ sound/soc/codecs/wm5102.c                          |   64 +-
+ sound/soc/codecs/wm5110.c                          |   80 +-
+ sound/soc/codecs/wm8741.c                          |   22 +-
+ sound/soc/codecs/wm8770.c                          |   18 +-
+ sound/soc/codecs/wm8904.c                          |   21 +-
+ sound/soc/codecs/wm8962.c                          |    9 +-
+ sound/soc/codecs/wm8995.c                          |   29 +-
+ sound/soc/codecs/wm8996.c                          |    9 +-
+ sound/soc/codecs/wm8997.c                          |   60 +-
+ sound/soc/codecs/wm8998.c                          |   60 +-
+ sound/soc/codecs/wm_adsp.c                         |  498 +-
+ sound/soc/codecs/wm_adsp.h                         |    4 +-
+ sound/soc/dwc/dwc-pcm.c                            |    3 +-
+ sound/soc/fsl/Kconfig                              |    9 +
+ sound/soc/fsl/Makefile                             |    2 +
+ sound/soc/fsl/fsl-asoc-card.c                      |    1 +
+ sound/soc/fsl/fsl_esai.c                           |    7 +-
+ sound/soc/fsl/fsl_micfil.c                         |  826 +++
+ sound/soc/fsl/fsl_micfil.h                         |  283 +
+ sound/soc/fsl/fsl_sai.c                            |    8 +-
+ sound/soc/fsl/fsl_spdif.c                          |   12 +-
+ sound/soc/fsl/fsl_spdif.h                          |    2 +-
+ sound/soc/fsl/fsl_ssi.c                            |    6 +-
+ sound/soc/fsl/imx-sgtl5000.c                       |   12 +-
+ sound/soc/fsl/imx-spdif.c                          |    4 +-
+ sound/soc/generic/Kconfig                          |   17 -
+ sound/soc/generic/Makefile                         |    4 -
+ sound/soc/generic/audio-graph-card.c               |  481 +-
+ sound/soc/generic/audio-graph-scu-card.c           |  501 --
+ sound/soc/generic/simple-card-utils.c              |   25 +-
+ sound/soc/generic/simple-card.c                    |  479 +-
+ sound/soc/generic/simple-scu-card.c                |  474 --
+ sound/soc/intel/atom/sst-atom-controls.c           |    2 +-
+ sound/soc/intel/atom/sst-mfld-platform-pcm.c       |   11 +-
+ sound/soc/intel/atom/sst/sst_acpi.c                |   45 +-
+ sound/soc/intel/atom/sst/sst_drv_interface.c       |    2 +-
+ sound/soc/intel/atom/sst/sst_loader.c              |    2 +-
+ sound/soc/intel/baytrail/sst-baytrail-ipc.c        |    3 +-
+ sound/soc/intel/baytrail/sst-baytrail-pcm.c        |   17 +-
+ sound/soc/intel/boards/Kconfig                     |    1 +
+ sound/soc/intel/boards/bdw-rt5677.c                |   14 +
+ sound/soc/intel/boards/broadwell.c                 |   16 +
+ sound/soc/intel/boards/bxt_da7219_max98357a.c      |  114 +-
+ sound/soc/intel/boards/bxt_rt298.c                 |   13 +
+ sound/soc/intel/boards/bytcht_da7213.c             |    8 +
+ sound/soc/intel/boards/bytcht_es8316.c             |  336 +-
+ sound/soc/intel/boards/bytcr_rt5640.c              |   23 +-
+ sound/soc/intel/boards/bytcr_rt5651.c              |  180 +-
+ sound/soc/intel/boards/cht_bsw_max98090_ti.c       |   12 +
+ sound/soc/intel/boards/cht_bsw_nau8824.c           |   12 +
+ sound/soc/intel/boards/cht_bsw_rt5645.c            |    9 +
+ sound/soc/intel/boards/cht_bsw_rt5672.c            |   30 +-
+ sound/soc/intel/boards/glk_rt5682_max98357a.c      |   23 +-
+ sound/soc/intel/boards/haswell.c                   |   15 +
+ sound/soc/intel/boards/kbl_da7219_max98927.c       |  207 +-
+ sound/soc/intel/common/soc-acpi-intel-bxt-match.c  |   25 +-
+ sound/soc/intel/common/soc-acpi-intel-byt-match.c  |   92 +-
+ sound/soc/intel/common/soc-acpi-intel-cht-match.c  |   70 +-
+ sound/soc/intel/common/soc-acpi-intel-cnl-match.c  |    5 +-
+ sound/soc/intel/common/soc-acpi-intel-glk-match.c  |   10 +-
+ sound/soc/intel/common/soc-acpi-intel-hda-match.c  |    2 +-
+ .../intel/common/soc-acpi-intel-hsw-bdw-match.c    |   20 +-
+ sound/soc/intel/common/soc-acpi-intel-icl-match.c  |    5 +-
+ sound/soc/intel/common/soc-acpi-intel-kbl-match.c  |   19 +
+ sound/soc/intel/haswell/sst-haswell-ipc.c          |    2 +-
+ sound/soc/intel/haswell/sst-haswell-pcm.c          |   14 +-
+ sound/soc/intel/skylake/skl-messages.c             |    2 +-
+ sound/soc/intel/skylake/skl-pcm.c                  |   12 +-
+ sound/soc/intel/skylake/skl-topology.c             |    2 +-
+ sound/soc/mediatek/Kconfig                         |   19 +
+ sound/soc/mediatek/Makefile                        |    1 +
+ sound/soc/mediatek/common/Makefile                 |    2 +
+ .../soc/mediatek/common/mtk-afe-platform-driver.c  |    6 +-
+ sound/soc/mediatek/common/mtk-btcvsd.c             | 1364 ++++
+ sound/soc/mediatek/mt8183/Makefile                 |   13 +
+ sound/soc/mediatek/mt8183/mt8183-afe-clk.c         |  611 ++
+ sound/soc/mediatek/mt8183/mt8183-afe-clk.h         |   38 +
+ sound/soc/mediatek/mt8183/mt8183-afe-common.h      |  108 +
+ sound/soc/mediatek/mt8183/mt8183-afe-pcm.c         | 1237 ++++
+ sound/soc/mediatek/mt8183/mt8183-dai-adda.c        |  501 ++
+ sound/soc/mediatek/mt8183/mt8183-dai-hostless.c    |  118 +
+ sound/soc/mediatek/mt8183/mt8183-dai-i2s.c         | 1040 +++
+ sound/soc/mediatek/mt8183/mt8183-dai-pcm.c         |  318 +
+ sound/soc/mediatek/mt8183/mt8183-dai-tdm.c         |  639 ++
+ sound/soc/mediatek/mt8183/mt8183-interconnection.h |   33 +
+ sound/soc/mediatek/mt8183/mt8183-reg.h             | 1666 +++++
+ sound/soc/meson/axg-fifo.c                         |    7 +-
+ sound/soc/pxa/Makefile                             |    1 -
+ sound/soc/qcom/Kconfig                             |    4 +-
+ sound/soc/qcom/apq8016_sbc.c                       |   21 +-
+ sound/soc/qcom/apq8096.c                           |   71 +-
+ sound/soc/qcom/common.c                            |   10 +-
+ sound/soc/qcom/sdm845.c                            |    2 +
+ sound/soc/samsung/dma.h                            |    3 +-
+ sound/soc/samsung/dmaengine.c                      |   16 +-
+ sound/soc/samsung/i2s.c                            |  731 ++-
+ sound/soc/samsung/odroid.c                         |  206 +-
+ sound/soc/samsung/pcm.c                            |    2 +-
+ sound/soc/samsung/s3c2412-i2s.c                    |    2 +-
+ sound/soc/samsung/s3c24xx-i2s.c                    |    2 +-
+ sound/soc/samsung/spdif.c                          |    2 +-
+ sound/soc/sh/fsi.c                                 |    5 +-
+ sound/soc/sh/rcar/core.c                           |   45 +-
+ sound/soc/sh/rcar/gen.c                            |   24 +
+ sound/soc/sh/rcar/rsnd.h                           |   27 +
+ sound/soc/sh/rcar/src.c                            |  125 +-
+ sound/soc/sh/rcar/ssiu.c                           |   24 +-
+ sound/soc/sh/siu_pcm.c                             |   15 +-
+ sound/soc/soc-compress.c                           |  177 +-
+ sound/soc/soc-core.c                               |  262 +-
+ sound/soc/soc-dapm.c                               |  271 +-
+ sound/soc/soc-generic-dmaengine-pcm.c              |   18 +-
+ sound/soc/soc-pcm.c                                |    5 +
+ sound/soc/soc-topology.c                           |  166 +-
+ sound/soc/sprd/Kconfig                             |    6 +
+ sound/soc/sprd/Makefile                            |    4 +
+ sound/soc/sprd/sprd-pcm-dma.c                      |  562 ++
+ sound/soc/sprd/sprd-pcm-dma.h                      |   15 +
+ sound/soc/stm/stm32_adfsdm.c                       |    5 +-
+ sound/soc/stm/stm32_i2s.c                          |  136 +-
+ sound/soc/stm/stm32_sai.c                          |   11 +-
+ sound/soc/stm/stm32_sai_sub.c                      |    8 +-
+ sound/soc/sunxi/sun4i-codec.c                      |  149 +-
+ sound/soc/sunxi/sun50i-codec-analog.c              |    4 +-
+ sound/soc/ti/davinci-mcasp.c                       |  175 +-
+ sound/soc/txx9/txx9aclc.c                          |    4 +-
+ sound/soc/uniphier/aio-dma.c                       |    3 +-
+ sound/soc/xilinx/Kconfig                           |   14 +
+ sound/soc/xilinx/Makefile                          |    4 +
+ sound/soc/xilinx/xlnx_formatter_pcm.c              |  709 ++
+ sound/soc/xilinx/xlnx_spdif.c                      |  339 +
+ sound/soc/xtensa/xtfpga-i2s.c                      |    6 +-
+ sound/sparc/dbri.c                                 |   19 +-
+ sound/spi/at73c213.c                               |    2 +-
+ sound/synth/emux/emux_proc.c                       |    4 -
+ sound/usb/card.c                                   |    1 -
+ sound/usb/card.h                                   |    1 +
+ sound/usb/format.c                                 |    2 +
+ sound/usb/line6/driver.c                           |    4 +-
+ sound/usb/line6/pod.c                              |    3 +-
+ sound/usb/mixer.c                                  |   13 +-
+ sound/usb/mixer_quirks.c                           |    6 +-
+ sound/usb/pcm.c                                    |    4 +
+ sound/usb/proc.c                                   |   14 +-
+ sound/usb/quirks-table.h                           |   65 +
+ sound/usb/quirks.c                                 |  119 +-
+ sound/usb/usx2y/usb_stream.c                       |    5 +
+ sound/usb/usx2y/usbusx2yaudio.c                    |   21 +-
+ sound/usb/usx2y/usx2yhwdeppcm.c                    |   19 +-
+ sound/x86/intel_hdmi_audio.c                       |   15 +-
+ tools/Makefile                                     |   14 +-
+ tools/build/Makefile.feature                       |   10 +-
+ tools/build/feature/test-all.c                     |   10 +-
+ tools/build/feature/test-get_current_dir_name.c    |    1 +
+ tools/build/feature/test-libpython.c               |    1 +
+ tools/build/feature/test-reallocarray.c            |    2 +
+ tools/build/feature/test-sched_getcpu.c            |    2 +
+ tools/build/feature/test-setns.c                   |    1 +
+ tools/debugging/Makefile                           |   16 +
+ tools/debugging/kernel-chktaint                    |  202 +
+ tools/firmware/ihex2fw.c                           |   17 +-
+ tools/iio/iio_event_monitor.c                      |   14 +
+ tools/include/linux/numa.h                         |   16 +
+ tools/include/linux/poison.h                       |    3 -
+ tools/include/linux/rbtree.h                       |   52 +-
+ tools/include/linux/rbtree_augmented.h             |   60 +-
+ .../rcutorture/bin => include/nolibc}/nolibc.h     |  118 +-
+ tools/include/uapi/linux/lirc.h                    |   12 +
+ tools/include/uapi/linux/perf_event.h              |   55 +-
+ tools/include/uapi/linux/prctl.h                   |    1 +
+ tools/io_uring/Makefile                            |   18 +
+ tools/io_uring/README                              |   29 +
+ tools/io_uring/barrier.h                           |   16 +
+ tools/io_uring/io_uring-bench.c                    |  616 ++
+ tools/io_uring/io_uring-cp.c                       |  251 +
+ tools/io_uring/liburing.h                          |  143 +
+ tools/io_uring/queue.c                             |  164 +
+ tools/io_uring/setup.c                             |  103 +
+ tools/io_uring/syscall.c                           |   40 +
+ tools/lib/bpf/Makefile                             |    3 +-
+ tools/lib/bpf/libbpf.c                             |    2 +
+ tools/lib/lockdep/include/liblockdep/common.h      |    2 +
+ tools/lib/lockdep/include/liblockdep/mutex.h       |   11 +-
+ tools/lib/lockdep/run_tests.sh                     |    6 +-
+ tools/lib/lockdep/tests/ABBA.c                     |    9 +
+ tools/lib/rbtree.c                                 |  178 +-
+ tools/lib/traceevent/event-parse.c                 |    2 +-
+ tools/memory-model/.gitignore                      |    1 +
+ tools/memory-model/README                          |    2 +
+ tools/memory-model/linux-kernel.bell               |    3 +-
+ tools/memory-model/linux-kernel.cat                |    4 +-
+ tools/memory-model/linux-kernel.def                |    1 +
+ tools/memory-model/scripts/README                  |   70 +
+ tools/memory-model/scripts/checkalllitmus.sh       |   53 +-
+ tools/memory-model/scripts/checkghlitmus.sh        |   65 +
+ tools/memory-model/scripts/checklitmus.sh          |   74 +-
+ tools/memory-model/scripts/checklitmushist.sh      |   60 +
+ tools/memory-model/scripts/cmplitmushist.sh        |   87 +
+ tools/memory-model/scripts/initlitmushist.sh       |   68 +
+ tools/memory-model/scripts/judgelitmus.sh          |   78 +
+ tools/memory-model/scripts/newlitmushist.sh        |   61 +
+ tools/memory-model/scripts/parseargs.sh            |  136 +
+ tools/memory-model/scripts/runlitmushist.sh        |   87 +
+ tools/perf/Build                                   |   10 +-
+ tools/perf/Documentation/perf-config.txt           |   31 +
+ tools/perf/Documentation/perf-diff.txt             |   56 +
+ tools/perf/Documentation/perf-record.txt           |   19 +
+ tools/perf/Documentation/perf-script.txt           |    6 +
+ tools/perf/Documentation/perf-trace.txt            |    8 +
+ tools/perf/Documentation/perf.data-file-format.txt |   11 +-
+ tools/perf/Makefile.config                         |   14 +-
+ tools/perf/Makefile.perf                           |   28 +-
+ tools/perf/arch/Build                              |    4 +-
+ tools/perf/arch/arm/Build                          |    4 +-
+ tools/perf/arch/arm/tests/Build                    |    8 +-
+ tools/perf/arch/arm/tests/dwarf-unwind.c           |    1 +
+ tools/perf/arch/arm/util/Build                     |    8 +-
+ tools/perf/arch/arm/util/cs-etm.c                  |   98 +-
+ tools/perf/arch/arm/util/cs-etm.h                  |    3 -
+ tools/perf/arch/arm/util/pmu.c                     |    3 +-
+ tools/perf/arch/arm64/Build                        |    4 +-
+ tools/perf/arch/arm64/annotate/instructions.c      |    2 +-
+ tools/perf/arch/arm64/tests/Build                  |    6 +-
+ tools/perf/arch/arm64/tests/dwarf-unwind.c         |    1 +
+ tools/perf/arch/arm64/util/Build                   |   12 +-
+ tools/perf/arch/nds32/Build                        |    2 +-
+ tools/perf/arch/nds32/util/Build                   |    2 +-
+ tools/perf/arch/powerpc/Build                      |    4 +-
+ tools/perf/arch/powerpc/tests/Build                |    6 +-
+ tools/perf/arch/powerpc/tests/dwarf-unwind.c       |    1 +
+ tools/perf/arch/powerpc/util/Build                 |   18 +-
+ tools/perf/arch/powerpc/util/kvm-stat.c            |    2 +
+ tools/perf/arch/powerpc/util/skip-callchain-idx.c  |    3 +
+ tools/perf/arch/s390/Build                         |    2 +-
+ tools/perf/arch/s390/annotate/instructions.c       |    2 +-
+ tools/perf/arch/s390/util/Build                    |   12 +-
+ tools/perf/arch/s390/util/kvm-stat.c               |    1 +
+ tools/perf/arch/sh/Build                           |    2 +-
+ tools/perf/arch/sh/util/Build                      |    2 +-
+ tools/perf/arch/sparc/Build                        |    2 +-
+ tools/perf/arch/sparc/util/Build                   |    2 +-
+ tools/perf/arch/x86/Build                          |    4 +-
+ tools/perf/arch/x86/tests/Build                    |   14 +-
+ tools/perf/arch/x86/tests/dwarf-unwind.c           |    1 +
+ tools/perf/arch/x86/util/Build                     |   30 +-
+ tools/perf/arch/x86/util/kvm-stat.c                |    1 +
+ tools/perf/arch/xtensa/Build                       |    2 +-
+ tools/perf/arch/xtensa/util/Build                  |    2 +-
+ tools/perf/bench/numa.c                            |    7 +-
+ tools/perf/builtin-annotate.c                      |    9 +-
+ tools/perf/builtin-buildid-cache.c                 |    4 +-
+ tools/perf/builtin-buildid-list.c                  |    8 +-
+ tools/perf/builtin-c2c.c                           |   31 +-
+ tools/perf/builtin-diff.c                          |  190 +-
+ tools/perf/builtin-evlist.c                        |    4 +-
+ tools/perf/builtin-inject.c                        |   12 +-
+ tools/perf/builtin-kallsyms.c                      |    1 +
+ tools/perf/builtin-kmem.c                          |    7 +-
+ tools/perf/builtin-kvm.c                           |    8 +-
+ tools/perf/builtin-list.c                          |    8 +-
+ tools/perf/builtin-lock.c                          |    8 +-
+ tools/perf/builtin-mem.c                           |    9 +-
+ tools/perf/builtin-probe.c                         |    1 +
+ tools/perf/builtin-record.c                        |   74 +-
+ tools/perf/builtin-report.c                        |   75 +-
+ tools/perf/builtin-sched.c                         |   63 +-
+ tools/perf/builtin-script.c                        |   70 +-
+ tools/perf/builtin-stat.c                          |   16 +-
+ tools/perf/builtin-timechart.c                     |    8 +-
+ tools/perf/builtin-top.c                           |   23 +-
+ tools/perf/builtin-trace.c                         |   38 +-
+ tools/perf/design.txt                              |    4 +
+ tools/perf/examples/bpf/augmented_raw_syscalls.c   |   18 +-
+ tools/perf/examples/bpf/augmented_syscalls.c       |   22 +-
+ tools/perf/examples/bpf/etcsnoop.c                 |   18 +-
+ tools/perf/include/bpf/bpf.h                       |   22 +-
+ tools/perf/perf.h                                  |    9 +
+ .../pmu-events/arch/powerpc/power8/metrics.json    | 2245 +++++++
+ .../pmu-events/arch/powerpc/power9/metrics.json    | 1982 ++++++
+ .../arch/x86/cascadelakex/clx-metrics.json         |    2 +-
+ tools/perf/scripts/Build                           |    4 +-
+ tools/perf/scripts/perl/Perf-Trace-Util/Build      |    2 +-
+ tools/perf/scripts/python/Perf-Trace-Util/Build    |    2 +-
+ tools/perf/scripts/python/check-perf-trace.py      |   76 +-
+ tools/perf/scripts/python/compaction-times.py      |    8 +-
+ .../perf/scripts/python/event_analyzing_sample.py  |   48 +-
+ tools/perf/scripts/python/export-to-postgresql.py  |   16 +-
+ tools/perf/scripts/python/export-to-sqlite.py      |   14 +-
+ tools/perf/scripts/python/exported-sql-viewer.py   |  857 ++-
+ .../perf/scripts/python/failed-syscalls-by-pid.py  |   43 +-
+ tools/perf/scripts/python/futex-contention.py      |   10 +-
+ tools/perf/scripts/python/intel-pt-events.py       |   60 +-
+ tools/perf/scripts/python/mem-phys-addr.py         |   25 +-
+ tools/perf/scripts/python/net_dropmonitor.py       |   12 +-
+ tools/perf/scripts/python/netdev-times.py          |   92 +-
+ tools/perf/scripts/python/powerpc-hcalls.py        |   18 +-
+ tools/perf/scripts/python/sched-migration.py       |    8 +-
+ tools/perf/scripts/python/sctop.py                 |   27 +-
+ tools/perf/scripts/python/stackcollapse.py         |    9 +-
+ tools/perf/scripts/python/stat-cpi.py              |   11 +-
+ tools/perf/scripts/python/syscall-counts-by-pid.py |   51 +-
+ tools/perf/scripts/python/syscall-counts.py        |   35 +-
+ tools/perf/tests/attr.py                           |    1 -
+ tools/perf/tests/bp_account.c                      |    1 -
+ tools/perf/tests/code-reading.c                    |    2 +
+ tools/perf/tests/dwarf-unwind.c                    |    1 +
+ tools/perf/tests/evsel-tp-sched.c                  |    6 +-
+ tools/perf/tests/hists_common.c                    |    9 +-
+ tools/perf/tests/hists_cumulate.c                  |   15 +-
+ tools/perf/tests/hists_filter.c                    |    1 +
+ tools/perf/tests/hists_link.c                      |    8 +-
+ tools/perf/tests/hists_output.c                    |   33 +-
+ tools/perf/tests/mmap-thread-lookup.c              |    1 +
+ tools/perf/tests/parse-events.c                    |   30 +
+ tools/perf/tests/pmu.c                             |    2 +
+ tools/perf/tests/sample-parsing.c                  |    2 +
+ tools/perf/tests/sdt.c                             |    1 +
+ tools/perf/tests/shell/lib/probe.sh                |    5 +
+ tools/perf/tests/shell/trace+probe_vfs_getname.sh  |    1 +
+ tools/perf/trace/beauty/Build                      |   26 +-
+ tools/perf/trace/beauty/ioctl.c                    |    2 +-
+ tools/perf/trace/beauty/msg_flags.c                |    2 +-
+ tools/perf/trace/beauty/waitid_options.c           |    2 +-
+ tools/perf/ui/Build                                |   18 +-
+ tools/perf/ui/browsers/Build                       |   10 +-
+ tools/perf/ui/browsers/annotate.c                  |    1 +
+ tools/perf/ui/browsers/header.c                    |    2 +-
+ tools/perf/ui/browsers/hists.c                     |   23 +-
+ tools/perf/ui/browsers/map.c                       |    1 +
+ tools/perf/ui/gtk/annotate.c                       |    3 +
+ tools/perf/ui/gtk/hists.c                          |    7 +-
+ tools/perf/ui/hist.c                               |    1 +
+ tools/perf/ui/stdio/hist.c                         |    7 +-
+ tools/perf/ui/tui/Build                            |    8 +-
+ tools/perf/util/Build                              |  276 +-
+ tools/perf/util/annotate.c                         |   80 +-
+ tools/perf/util/annotate.h                         |   21 +-
+ tools/perf/util/auxtrace.c                         |   30 +-
+ tools/perf/util/auxtrace.h                         |    5 +-
+ tools/perf/util/block-range.c                      |    2 +
+ tools/perf/util/block-range.h                      |    6 +-
+ tools/perf/util/bpf-event.c                        |  263 +
+ tools/perf/util/bpf-event.h                        |   38 +
+ tools/perf/util/bpf-loader.c                       |    1 +
+ tools/perf/util/bpf-loader.h                       |    7 +-
+ tools/perf/util/bpf_map.c                          |   72 +
+ tools/perf/util/bpf_map.h                          |   22 +
+ tools/perf/util/branch.h                           |   27 +-
+ tools/perf/util/build-id.c                         |   14 +-
+ tools/perf/util/build-id.h                         |    3 +-
+ tools/perf/util/c++/Build                          |    4 +-
+ tools/perf/util/c++/clang.cpp                      |    2 +-
+ tools/perf/util/callchain.c                        |   17 +
+ tools/perf/util/callchain.h                        |   21 +-
+ tools/perf/util/color.c                            |   39 -
+ tools/perf/util/color.h                            |    1 +
+ tools/perf/util/color_config.c                     |   47 +
+ tools/perf/util/comm.c                             |    1 +
+ tools/perf/util/comm.h                             |    4 +-
+ tools/perf/util/config.c                           |    1 +
+ tools/perf/util/cpu-set-sched.h                    |   50 +
+ tools/perf/util/cpumap.c                           |   12 +-
+ tools/perf/util/cpumap.h                           |    1 +
+ tools/perf/util/cputopo.c                          |  277 +
+ tools/perf/util/cputopo.h                          |   33 +
+ tools/perf/util/cs-etm-decoder/Build               |    2 +-
+ tools/perf/util/cs-etm-decoder/cs-etm-decoder.c    |   41 +-
+ tools/perf/util/cs-etm-decoder/cs-etm-decoder.h    |   16 +-
+ tools/perf/util/cs-etm.c                           |  832 ++-
+ tools/perf/util/cs-etm.h                           |   57 +-
+ tools/perf/util/data-convert-bt.c                  |    4 +-
+ tools/perf/util/data.c                             |  175 +-
+ tools/perf/util/data.h                             |   16 +-
+ tools/perf/util/db-export.c                        |   16 +-
+ tools/perf/util/db-export.h                        |    3 +-
+ tools/perf/util/drv_configs.c                      |   78 -
+ tools/perf/util/drv_configs.h                      |   26 -
+ tools/perf/util/dso.c                              |   11 +-
+ tools/perf/util/dso.h                              |   17 +-
+ tools/perf/util/event.c                            |   43 +
+ tools/perf/util/event.h                            |   60 +-
+ tools/perf/util/evlist.c                           |   31 +-
+ tools/perf/util/evlist.h                           |    6 +-
+ tools/perf/util/evsel.c                            |   35 +-
+ tools/perf/util/evsel.h                            |    4 +-
+ tools/perf/util/header.c                           |  289 +-
+ tools/perf/util/hist.c                             |  271 +-
+ tools/perf/util/hist.h                             |   19 +-
+ tools/perf/util/intel-bts.c                        |   26 +-
+ tools/perf/util/intel-pt-decoder/Build             |    2 +-
+ .../perf/util/intel-pt-decoder/intel-pt-decoder.c  |   39 +-
+ tools/perf/util/intel-pt.c                         |   25 +-
+ tools/perf/util/intlist.h                          |    2 +-
+ tools/perf/util/jitdump.c                          |    1 +
+ tools/perf/util/kvm-stat.h                         |    7 +-
+ tools/perf/util/machine.c                          |  112 +-
+ tools/perf/util/machine.h                          |   17 +-
+ tools/perf/util/map.c                              |   14 +-
+ tools/perf/util/map.h                              |  100 +-
+ tools/perf/util/map_groups.h                       |   91 +
+ tools/perf/util/map_symbol.h                       |   22 +
+ tools/perf/util/metricgroup.c                      |   10 +-
+ tools/perf/util/metricgroup.h                      |    3 +-
+ tools/perf/util/mmap.c                             |  105 +-
+ tools/perf/util/mmap.h                             |    3 +-
+ tools/perf/util/parse-events.c                     |    2 +-
+ tools/perf/util/parse-events.y                     |    4 +-
+ tools/perf/util/pmu.c                              |   16 +-
+ tools/perf/util/pmu.h                              |    6 +-
+ tools/perf/util/probe-event.c                      |   15 +-
+ tools/perf/util/probe-event.h                      |    5 +-
+ tools/perf/util/probe-file.c                       |    1 +
+ tools/perf/util/rb_resort.h                        |    8 +-
+ tools/perf/util/rblist.c                           |   28 +-
+ tools/perf/util/rblist.h                           |    2 +-
+ tools/perf/util/s390-cpumcf-kernel.h               |   62 +
+ tools/perf/util/s390-cpumsf.c                      |   89 +-
+ tools/perf/util/s390-sample-raw.c                  |  222 +
+ tools/perf/util/sample-raw.c                       |   18 +
+ tools/perf/util/sample-raw.h                       |   14 +
+ tools/perf/util/scripting-engines/Build            |    4 +-
+ .../perf/util/scripting-engines/trace-event-perl.c |    2 +
+ .../util/scripting-engines/trace-event-python.c    |   25 +-
+ tools/perf/util/session.c                          |  114 +-
+ tools/perf/util/setup.py                           |    7 +-
+ tools/perf/util/sort.c                             |   18 +-
+ tools/perf/util/sort.h                             |    7 +-
+ tools/perf/util/srccode.h                          |   13 +
+ tools/perf/util/srcline.c                          |   45 +-
+ tools/perf/util/srcline.h                          |   13 +-
+ tools/perf/util/stat-display.c                     |    1 +
+ tools/perf/util/stat-shadow.c                      |    2 +-
+ tools/perf/util/strlist.h                          |    2 +-
+ tools/perf/util/symbol-elf.c                       |    2 +
+ tools/perf/util/symbol-minimal.c                   |    1 +
+ tools/perf/util/symbol.c                           |   90 +-
+ tools/perf/util/symbol.h                           |  102 +-
+ tools/perf/util/symbol_conf.h                      |   73 +
+ tools/perf/util/symbol_fprintf.c                   |    3 +-
+ tools/perf/util/thread-stack.c                     |  251 +-
+ tools/perf/util/thread-stack.h                     |    9 +-
+ tools/perf/util/thread.c                           |   24 +
+ tools/perf/util/thread.h                           |   11 +-
+ tools/perf/util/time-utils.c                       |   51 +-
+ tools/perf/util/time-utils.h                       |    6 +
+ tools/perf/util/tool.h                             |    5 +-
+ tools/perf/util/unwind-libdw.c                     |    2 +
+ tools/perf/util/unwind-libunwind-local.c           |    1 +
+ tools/perf/util/unwind-libunwind.c                 |    1 +
+ tools/perf/util/util.c                             |   82 +-
+ tools/perf/util/util.h                             |    3 +
+ tools/perf/util/vdso.c                             |    1 +
+ tools/perf/util/zlib.c                             |    1 -
+ tools/power/acpi/common/cmfsize.c                  |    2 +-
+ tools/power/acpi/common/getopt.c                   |    2 +-
+ .../acpi/os_specific/service_layers/oslinuxtbl.c   |    2 +-
+ .../acpi/os_specific/service_layers/osunixdir.c    |    2 +-
+ .../acpi/os_specific/service_layers/osunixmap.c    |    2 +-
+ .../acpi/os_specific/service_layers/osunixxf.c     |    2 +-
+ tools/power/acpi/tools/acpidump/acpidump.h         |    2 +-
+ tools/power/acpi/tools/acpidump/apdump.c           |    2 +-
+ tools/power/acpi/tools/acpidump/apfiles.c          |    2 +-
+ tools/power/acpi/tools/acpidump/apmain.c           |    2 +-
+ tools/power/cpupower/lib/cpufreq.c                 |   19 +-
+ tools/power/cpupower/lib/cpufreq.h                 |   16 +-
+ tools/power/cpupower/utils/cpufreq-info.c          |   42 +-
+ tools/testing/nvdimm/Kbuild                        |    7 +-
+ tools/testing/nvdimm/dax-dev.c                     |   16 +-
+ tools/testing/selftests/Makefile                   |    4 +
+ tools/testing/selftests/bpf/Makefile               |   33 +-
+ .../selftests/bpf/prog_tests/signal_pending.c      |    2 +-
+ tools/testing/selftests/bpf/test_lwt_ip_encap.sh   |   54 +-
+ tools/testing/selftests/bpf/verifier/ld_imm64.c    |   15 +-
+ tools/testing/selftests/firmware/config            |    1 -
+ tools/testing/selftests/firmware/fw_filesystem.sh  |    9 +-
+ tools/testing/selftests/firmware/fw_lib.sh         |    2 +-
+ tools/testing/selftests/ftrace/ftracetest          |   21 +-
+ .../inter-event/trigger-action-hist-xfail.tc       |   30 +
+ .../inter-event/trigger-extended-error-support.tc  |    1 +
+ .../inter-event/trigger-field-variable-support.tc  |    1 +
+ .../trigger-inter-event-combined-hist.tc           |    1 +
+ .../inter-event/trigger-multi-actions-accept.tc    |    1 +
+ .../inter-event/trigger-onchange-action-hist.tc    |   28 +
+ .../inter-event/trigger-onmatch-action-hist.tc     |    1 +
+ .../trigger-onmatch-onmax-action-hist.tc           |    1 +
+ .../inter-event/trigger-onmax-action-hist.tc       |    1 +
+ .../inter-event/trigger-snapshot-action-hist.tc    |   43 +
+ .../trigger-synthetic-event-createremove.tc        |    1 +
+ .../inter-event/trigger-trace-action-hist.tc       |   42 +
+ tools/testing/selftests/ir/ir_loopback.c           |   15 +-
+ tools/testing/selftests/ir/ir_loopback.sh          |    5 +
+ tools/testing/selftests/kselftest.h                |    1 +
+ tools/testing/selftests/kselftest_harness.h        |   10 +-
+ tools/testing/selftests/kvm/.gitignore             |    1 +
+ tools/testing/selftests/kvm/Makefile               |    1 +
+ .../kvm/x86_64/vmx_close_while_nested_test.c       |   95 +
+ tools/testing/selftests/livepatch/Makefile         |    8 +
+ tools/testing/selftests/livepatch/README           |   43 +
+ tools/testing/selftests/livepatch/config           |    1 +
+ tools/testing/selftests/livepatch/functions.sh     |  198 +
+ .../testing/selftests/livepatch/test-callbacks.sh  |  587 ++
+ .../testing/selftests/livepatch/test-livepatch.sh  |  168 +
+ .../selftests/livepatch/test-shadow-vars.sh        |   60 +
+ tools/testing/selftests/memfd/memfd_test.c         |   74 +
+ tools/testing/selftests/pidfd/Makefile             |    6 +
+ tools/testing/selftests/pidfd/pidfd_test.c         |  381 ++
+ .../selftests/powerpc/benchmarks/null_syscall.c    |    2 +-
+ tools/testing/selftests/powerpc/include/reg.h      |    8 +
+ tools/testing/selftests/powerpc/include/utils.h    |    2 +
+ .../selftests/powerpc/pmu/ebb/fork_cleanup_test.c  |    1 -
+ tools/testing/selftests/powerpc/tm/.gitignore      |    1 +
+ tools/testing/selftests/powerpc/tm/Makefile        |    4 +-
+ .../powerpc/tm/tm-signal-context-force-tm.c        |  184 +
+ tools/testing/selftests/proc/.gitignore            |    1 +
+ tools/testing/selftests/proc/Makefile              |    1 +
+ tools/testing/selftests/proc/proc-loadavg-001.c    |    2 +-
+ tools/testing/selftests/proc/proc-pid-vm.c         |  449 ++
+ .../selftests/proc/proc-self-map-files-002.c       |    2 +-
+ tools/testing/selftests/proc/proc-self-syscall.c   |    3 +-
+ tools/testing/selftests/proc/proc-self-wchan.c     |    2 +-
+ tools/testing/selftests/proc/read.c                |   14 +
+ tools/testing/selftests/rcutorture/bin/mkinitrd.sh |   27 +-
+ tools/testing/selftests/safesetid/.gitignore       |    1 +
+ tools/testing/selftests/safesetid/Makefile         |    8 +
+ tools/testing/selftests/safesetid/config           |    2 +
+ tools/testing/selftests/safesetid/safesetid-test.c |  334 +
+ .../testing/selftests/safesetid/safesetid-test.sh  |   26 +
+ tools/testing/selftests/seccomp/seccomp_bpf.c      |   47 +-
+ tools/testing/selftests/sysctl/sysctl.sh           |   55 +
+ tools/testing/selftests/tmpfs/.gitignore           |    1 +
+ tools/testing/selftests/tmpfs/Makefile             |    7 +
+ tools/testing/selftests/tmpfs/bug-link-o-tmpfile.c |   67 +
+ tools/testing/selftests/tpm2/Makefile              |    4 +
+ tools/testing/selftests/tpm2/test_smoke.sh         |    4 +
+ tools/testing/selftests/tpm2/test_space.sh         |    4 +
+ tools/testing/selftests/tpm2/tpm2.py               |  696 ++
+ tools/testing/selftests/tpm2/tpm2_tests.py         |  227 +
+ tools/testing/selftests/vm/map_hugetlb.c           |   29 +-
+ tools/testing/selftests/vm/run_vmtests             |   16 +
+ tools/testing/selftests/vm/test_vmalloc.sh         |  176 +
+ tools/vm/page-types.c                              |    2 +-
+ tools/vm/slabinfo.c                                |   35 +-
+ virt/kvm/arm/arch_timer.c                          |  608 +-
+ virt/kvm/arm/arm.c                                 |   64 +-
+ virt/kvm/arm/hyp/vgic-v3-sr.c                      |    2 +-
+ virt/kvm/arm/mmu.c                                 |   24 +-
+ virt/kvm/arm/trace.h                               |  107 +-
+ virt/kvm/arm/vgic/vgic-v3.c                        |    4 +-
+ virt/kvm/coalesced_mmio.c                          |    3 +-
+ virt/kvm/eventfd.c                                 |    7 +-
+ virt/kvm/irqchip.c                                 |    4 +-
+ virt/kvm/kvm_main.c                                |  105 +-
+ virt/kvm/vfio.c                                    |    4 +-
+ 8256 files changed, 356967 insertions(+), 164628 deletions(-)
+ create mode 100644 Documentation/ABI/obsolete/sysfs-class-dax
+ create mode 100644 Documentation/ABI/testing/debugfs-driver-habanalabs
+ create mode 100644 Documentation/ABI/testing/debugfs-wilco-ec
+ create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-sps30
+ create mode 100644 Documentation/ABI/testing/sysfs-class-chromeos
+ create mode 100644 Documentation/ABI/testing/sysfs-class-chromeos-driver-cros-ec-lightbar
+ create mode 100644 Documentation/ABI/testing/sysfs-class-chromeos-driver-cros-ec-vbc
+ create mode 100644 Documentation/ABI/testing/sysfs-driver-habanalabs
+ create mode 100644 Documentation/admin-guide/LSM/SafeSetID.rst
+ delete mode 100644 Documentation/core-api/flexible-arrays.rst
+ create mode 100644 Documentation/core-api/generic-radix-tree.rst
+ delete mode 100644 Documentation/cpuidle/driver.txt
+ delete mode 100644 Documentation/cpuidle/governor.txt
+ create mode 100644 Documentation/device-mapper/dm-init.txt
+ delete mode 100644 Documentation/devicetree/bindings/arm/armadeus.txt
+ delete mode 100644 Documentation/devicetree/bindings/arm/bhf.txt
+ create mode 100644 Documentation/devicetree/bindings/arm/bitmain.yaml
+ delete mode 100644 Documentation/devicetree/bindings/arm/compulab-boards.txt
+ create mode 100644 Documentation/devicetree/bindings/arm/freescale/fsl,imx7ulp-sim.txt
+ delete mode 100644 Documentation/devicetree/bindings/arm/fsl.txt
+ create mode 100644 Documentation/devicetree/bindings/arm/fsl.yaml
+ delete mode 100644 Documentation/devicetree/bindings/arm/i2se.txt
+ delete mode 100644 Documentation/devicetree/bindings/arm/l2c2x0.txt
+ create mode 100644 Documentation/devicetree/bindings/arm/l2c2x0.yaml
+ delete mode 100644 Documentation/devicetree/bindings/arm/olimex.txt
+ delete mode 100644 Documentation/devicetree/bindings/arm/pmu.txt
+ create mode 100644 Documentation/devicetree/bindings/arm/pmu.yaml
+ create mode 100644 Documentation/devicetree/bindings/arm/renesas.yaml
+ delete mode 100644 Documentation/devicetree/bindings/arm/shmobile.txt
+ create mode 100644 Documentation/devicetree/bindings/arm/socionext/milbeaut.yaml
+ delete mode 100644 Documentation/devicetree/bindings/arm/technologic.txt
+ delete mode 100644 Documentation/devicetree/bindings/clock/fixed-clock.txt
+ create mode 100644 Documentation/devicetree/bindings/clock/fixed-clock.yaml
+ delete mode 100644 Documentation/devicetree/bindings/clock/fixed-factor-clock.txt
+ create mode 100644 Documentation/devicetree/bindings/clock/fixed-factor-clock.yaml
+ create mode 100644 Documentation/devicetree/bindings/clock/fixed-mmio-clock.txt
+ create mode 100644 Documentation/devicetree/bindings/clock/imx8mm-clock.txt
+ create mode 100644 Documentation/devicetree/bindings/display/amlogic,simple-framebuffer.txt
+ create mode 100644 Documentation/devicetree/bindings/display/arm,komeda.txt
+ create mode 100644 Documentation/devicetree/bindings/display/bridge/ti,ds90c185.txt
+ create mode 100644 Documentation/devicetree/bindings/display/msm/gmu.txt
+ rename Documentation/devicetree/bindings/display/panel/{auo,g101evn010 => auo,g101evn010.txt} (100%)
+ create mode 100644 Documentation/devicetree/bindings/display/panel/innolux,ee101ia-01d.txt
+ create mode 100644 Documentation/devicetree/bindings/display/panel/lemaker,bl035-rgb-002.txt
+ create mode 100644 Documentation/devicetree/bindings/display/panel/pda,91-00156-a0.txt
+ create mode 100644 Documentation/devicetree/bindings/display/panel/sitronix,st7701.txt
+ create mode 100644 Documentation/devicetree/bindings/dma/fsl-qdma.txt
+ create mode 100644 Documentation/devicetree/bindings/edac/aspeed-sdram-edac.txt
+ create mode 100644 Documentation/devicetree/bindings/extcon/extcon-ptn5150.txt
+ create mode 100644 Documentation/devicetree/bindings/firmware/nvidia,tegra210-bpmp.txt
+ create mode 100644 Documentation/devicetree/bindings/gnss/mediatek.txt
+ create mode 100644 Documentation/devicetree/bindings/gpio/gateworks,pld-gpio.txt
+ create mode 100644 Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.txt
+ create mode 100644 Documentation/devicetree/bindings/i2c/i2c-xscale.txt
+ create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad7606.txt
+ create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.txt
+ create mode 100644 Documentation/devicetree/bindings/iio/adc/ingenic,adc.txt
+ rename Documentation/devicetree/bindings/{staging => }/iio/adc/lpc32xx-adc.txt (100%)
+ create mode 100644 Documentation/devicetree/bindings/iio/adc/nuvoton,npcm-adc.txt
+ create mode 100644 Documentation/devicetree/bindings/iio/adc/stmpe-adc.txt
+ create mode 100644 Documentation/devicetree/bindings/iio/adc/ti-ads124s08.txt
+ create mode 100644 Documentation/devicetree/bindings/iio/chemical/bme680.txt
+ create mode 100644 Documentation/devicetree/bindings/iio/chemical/plantower,pms7003.txt
+ create mode 100644 Documentation/devicetree/bindings/iio/chemical/sensirion,sgp30.txt
+ create mode 100644 Documentation/devicetree/bindings/iio/chemical/sensirion,sps30.txt
+ create mode 100644 Documentation/devicetree/bindings/iio/dac/ti,dac7612.txt
+ create mode 100644 Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt
+ create mode 100644 Documentation/devicetree/bindings/iio/light/max44009.txt
+ create mode 100644 Documentation/devicetree/bindings/input/ilitek,ili2xxx.txt
+ create mode 100644 Documentation/devicetree/bindings/input/msm-vibrator.txt
+ create mode 100644 Documentation/devicetree/bindings/input/st,stpmic1-onkey.txt
+ create mode 100644 Documentation/devicetree/bindings/interconnect/interconnect.txt
+ create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sdm845.txt
+ delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.txt
+ create mode 100644 Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml
+ delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/arm,gic.txt
+ create mode 100644 Documentation/devicetree/bindings/interrupt-controller/arm,gic.yaml
+ create mode 100644 Documentation/devicetree/bindings/interrupt-controller/loongson,ls1x-intc.txt
+ delete mode 100644 Documentation/devicetree/bindings/iommu/nvidia,tegra20-gart.txt
+ create mode 100644 Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt
+ create mode 100644 Documentation/devicetree/bindings/media/i2c/melexis,mlx90640.txt
+ create mode 100644 Documentation/devicetree/bindings/media/i2c/mt9m001.txt
+ create mode 100644 Documentation/devicetree/bindings/media/imx7-csi.txt
+ create mode 100644 Documentation/devicetree/bindings/media/imx7-mipi-csi2.txt
+ create mode 100644 Documentation/devicetree/bindings/media/si470x.txt
+ create mode 100644 Documentation/devicetree/bindings/mfd/cirrus,lochnagar.txt
+ create mode 100644 Documentation/devicetree/bindings/mfd/st,stpmic1.txt
+ create mode 100644 Documentation/devicetree/bindings/misc/qcom,fastrpc.txt
+ create mode 100644 Documentation/devicetree/bindings/nvmem/xlnx,zynqmp-nvmem.txt
+ create mode 100644 Documentation/devicetree/bindings/phy/cdns,dphy.txt
+ create mode 100644 Documentation/devicetree/bindings/phy/phy-mvebu-utmi.txt
+ create mode 100644 Documentation/devicetree/bindings/pinctrl/fsl,imx50-pinctrl.txt
+ create mode 100644 Documentation/devicetree/bindings/pinctrl/fsl,imx8mm-pinctrl.txt
+ create mode 100644 Documentation/devicetree/bindings/power/qcom,rpmpd.txt
+ create mode 100644 Documentation/devicetree/bindings/power/reset/xlnx,zynqmp-power.txt
+ create mode 100644 Documentation/devicetree/bindings/power/xlnx,zynqmp-genpd.txt
+ create mode 100644 Documentation/devicetree/bindings/reset/brcm,brcmstb-reset.txt
+ create mode 100644 Documentation/devicetree/bindings/reset/xlnx,zynqmp-reset.txt
+ create mode 100644 Documentation/devicetree/bindings/rtc/cdns,rtc.txt
+ create mode 100644 Documentation/devicetree/bindings/rtc/isil,isl1208.txt
+ delete mode 100644 Documentation/devicetree/bindings/rtc/isil,isl1219.txt
+ create mode 100644 Documentation/devicetree/bindings/rtc/nxp,pcf85063.txt
+ create mode 100644 Documentation/devicetree/bindings/rtc/nxp,pcf8523.txt
+ create mode 100644 Documentation/devicetree/bindings/rtc/rtc-meson.txt
+ create mode 100644 Documentation/devicetree/bindings/serial/milbeaut-uart.txt
+ create mode 100644 Documentation/devicetree/bindings/serial/nvidia,tegra194-tcu.txt
+ delete mode 100644 Documentation/devicetree/bindings/serial/pl011.txt
+ create mode 100644 Documentation/devicetree/bindings/serial/pl011.yaml
+ delete mode 100644 Documentation/devicetree/bindings/serial/renesas,rzn1-uart.txt
+ delete mode 100644 Documentation/devicetree/bindings/serial/snps-dw-apb-uart.txt
+ create mode 100644 Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml
+ create mode 100644 Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.txt
+ delete mode 100644 Documentation/devicetree/bindings/sound/audio-graph-scu-card.txt
+ create mode 100644 Documentation/devicetree/bindings/sound/cs35l36.txt
+ create mode 100644 Documentation/devicetree/bindings/sound/cs4341.txt
+ create mode 100644 Documentation/devicetree/bindings/sound/fsl,micfil.txt
+ create mode 100644 Documentation/devicetree/bindings/sound/google,cros-ec-codec.txt
+ create mode 100644 Documentation/devicetree/bindings/sound/ingenic,jz4725b-codec.txt
+ create mode 100644 Documentation/devicetree/bindings/sound/ingenic,jz4740-codec.txt
+ create mode 100644 Documentation/devicetree/bindings/sound/mt6358.txt
+ create mode 100644 Documentation/devicetree/bindings/sound/mt8183-afe-pcm.txt
+ create mode 100644 Documentation/devicetree/bindings/sound/mtk-btcvsd-snd.txt
+ create mode 100644 Documentation/devicetree/bindings/sound/rockchip,rk3328-codec.txt
+ delete mode 100644 Documentation/devicetree/bindings/sound/simple-scu-card.txt
+ create mode 100644 Documentation/devicetree/bindings/sound/sprd-pcm.txt
+ create mode 100644 Documentation/devicetree/bindings/sound/xlnx,audio-formatter.txt
+ create mode 100644 Documentation/devicetree/bindings/sound/xlnx,spdif.txt
+ create mode 100644 Documentation/devicetree/bindings/sram/milbeaut-smp-sram.txt
+ create mode 100644 Documentation/devicetree/bindings/thermal/brcm,sr-thermal.txt
+ create mode 100644 Documentation/devicetree/bindings/timer/nvidia,tegra210-timer.txt
+ create mode 100644 Documentation/devicetree/bindings/timer/socionext,milbeaut-timer.txt
+ create mode 100644 Documentation/devicetree/bindings/usb/ingenic,jz4740-musb.txt
+ create mode 100644 Documentation/devicetree/bindings/watchdog/st,stpmic1-wdt.txt
+ create mode 100644 Documentation/driver-api/component.rst
+ create mode 100644 Documentation/driver-api/pm/cpuidle.rst
+ create mode 100644 Documentation/filesystems/api-summary.rst
+ create mode 100644 Documentation/filesystems/binderfs.rst
+ delete mode 100644 Documentation/filesystems/exofs.txt
+ create mode 100644 Documentation/filesystems/journalling.rst
+ create mode 100644 Documentation/filesystems/mount_api.txt
+ create mode 100644 Documentation/filesystems/splice.rst
+ delete mode 100644 Documentation/flexible-arrays.txt
+ create mode 100644 Documentation/gpu/afbc.rst
+ create mode 100644 Documentation/gpu/dp-mst/topology-figure-1.dot
+ create mode 100644 Documentation/gpu/dp-mst/topology-figure-2.dot
+ create mode 100644 Documentation/gpu/dp-mst/topology-figure-3.dot
+ create mode 100644 Documentation/gpu/komeda-kms.rst
+ create mode 100644 Documentation/interconnect/interconnect.rst
+ create mode 100644 Documentation/kdump/vmcoreinfo.txt
+ create mode 100644 Documentation/livepatch/cumulative-patches.txt
+ delete mode 100644 Documentation/media/uapi/v4l/dev-effect.rst
+ rename Documentation/media/uapi/v4l/{dev-codec.rst => dev-mem2mem.rst} (50%)
+ delete mode 100644 Documentation/media/uapi/v4l/dev-teletext.rst
+ create mode 100644 Documentation/media/uapi/v4l/ext-ctrls-camera.rst
+ create mode 100644 Documentation/media/uapi/v4l/ext-ctrls-codec.rst
+ create mode 100644 Documentation/media/uapi/v4l/ext-ctrls-detect.rst
+ create mode 100644 Documentation/media/uapi/v4l/ext-ctrls-dv.rst
+ create mode 100644 Documentation/media/uapi/v4l/ext-ctrls-flash.rst
+ create mode 100644 Documentation/media/uapi/v4l/ext-ctrls-fm-rx.rst
+ create mode 100644 Documentation/media/uapi/v4l/ext-ctrls-fm-tx.rst
+ create mode 100644 Documentation/media/uapi/v4l/ext-ctrls-image-process.rst
+ create mode 100644 Documentation/media/uapi/v4l/ext-ctrls-image-source.rst
+ create mode 100644 Documentation/media/uapi/v4l/ext-ctrls-jpeg.rst
+ create mode 100644 Documentation/media/uapi/v4l/ext-ctrls-rf-tuner.rst
+ create mode 100644 Documentation/media/v4l-drivers/imx7.rst
+ create mode 100644 Documentation/misc-devices/index.rst
+ create mode 100644 Documentation/networking/checksum-offloads.rst
+ delete mode 100644 Documentation/networking/checksum-offloads.txt
+ rename Documentation/networking/{scaling.txt => scaling.rst} (92%)
+ rename Documentation/networking/{segmentation-offloads.txt => segmentation-offloads.rst} (88%)
+ create mode 100644 Documentation/power/energy-model.txt
+ create mode 100644 Documentation/scheduler/sched-energy.txt
+ delete mode 100644 Documentation/scsi/osd.txt
+ rename Documentation/security/{LSM-sctp.rst => SCTP.rst} (52%)
+ delete mode 100644 Documentation/security/SELinux-sctp.rst
+ create mode 100644 Documentation/watchdog/mlx-wdt.txt
+ create mode 100644 Documentation/xtensa/booting.txt
+ create mode 100644 LICENSES/exceptions/GCC-exception-2.0
+ delete mode 100644 arch/arc/include/asm/dma-mapping.h
+ create mode 100644 arch/arm/boot/dts/am335x-guardian.dts
+ create mode 100644 arch/arm/boot/dts/am3874-iceboard.dts
+ create mode 100644 arch/arm/boot/dts/aspeed-bmc-inspur-on5263m5.dts
+ create mode 100644 arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts
+ create mode 100644 arch/arm/boot/dts/bcm47094-phicomm-k3.dts
+ create mode 100644 arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi
+ create mode 100644 arch/arm/boot/dts/imx6-logicpd-som.dtsi
+ create mode 100644 arch/arm/boot/dts/imx6dl-yapp4-common.dtsi
+ create mode 100644 arch/arm/boot/dts/imx6dl-yapp4-draco.dts
+ create mode 100644 arch/arm/boot/dts/imx6dl-yapp4-hydra.dts
+ create mode 100644 arch/arm/boot/dts/imx6dl-yapp4-ursa.dts
+ create mode 100644 arch/arm/boot/dts/imx6q-logicpd.dts
+ create mode 100644 arch/arm/boot/dts/imx6ul-phytec-pcl063.dtsi
+ create mode 100644 arch/arm/boot/dts/imx6ul-phytec-peb-eval-01.dtsi
+ create mode 100644 arch/arm/boot/dts/imx6ul-phytec-phyboard-segin-full.dts
+ create mode 100644 arch/arm/boot/dts/imx6ul-phytec-phyboard-segin.dtsi
+ create mode 100644 arch/arm/boot/dts/lpc4357-myd-lpc4357.dts
+ create mode 100644 arch/arm/boot/dts/milbeaut-m10v-evb.dts
+ create mode 100644 arch/arm/boot/dts/milbeaut-m10v.dtsi
+ create mode 100644 arch/arm/boot/dts/r7s9210-rza2mevb.dts
+ create mode 100644 arch/arm/boot/dts/r7s9210.dtsi
+ create mode 100644 arch/arm/boot/dts/rv1108-elgin-r1.dts
+ delete mode 100644 arch/arm/boot/dts/skeleton.dtsi
+ delete mode 100644 arch/arm/boot/dts/skeleton64.dtsi
+ create mode 100644 arch/arm/boot/dts/socfpga_cyclone5_chameleon96.dts
+ create mode 100644 arch/arm/boot/dts/vf610-zii-ssmb-dtu.dts
+ create mode 100644 arch/arm/configs/milbeaut_m10v_defconfig
+ delete mode 100644 arch/arm/configs/raumfeld_defconfig
+ create mode 100644 arch/arm/include/asm/kvm_ras.h
+ delete mode 100644 arch/arm/mach-davinci/cp_intc.c
+ delete mode 100644 arch/arm/mach-davinci/cp_intc.h
+ delete mode 100644 arch/arm/mach-davinci/include/mach/cpufreq.h
+ delete mode 100644 arch/arm/mach-davinci/include/mach/entry-macro.S
+ delete mode 100644 arch/arm/mach-davinci/irq.c
+ rename arch/arm/mach-davinci/{include/mach => }/irqs.h (98%)
+ create mode 100644 arch/arm/mach-imx/cpuidle-imx7ulp.c
+ create mode 100644 arch/arm/mach-milbeaut/Kconfig
+ create mode 100644 arch/arm/mach-milbeaut/Makefile
+ create mode 100644 arch/arm/mach-milbeaut/platsmp.c
+ delete mode 100644 arch/arm/mach-oxnas/hotplug.c
+ delete mode 100644 arch/arm/mach-pxa/include/mach/pxa25x-udc.h
+ delete mode 100644 arch/arm/mach-pxa/raumfeld.c
+ create mode 100644 arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts
+ create mode 100644 arch/arm64/boot/dts/arm/fvp-base-revc.dts
+ create mode 100644 arch/arm64/boot/dts/arm/rtsm_ve-motherboard-rs2.dtsi
+ create mode 100644 arch/arm64/boot/dts/bitmain/Makefile
+ create mode 100644 arch/arm64/boot/dts/bitmain/bm1880-sophon-edge.dts
+ create mode 100644 arch/arm64/boot/dts/bitmain/bm1880.dtsi
+ create mode 100644 arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-a-plus.dts
+ create mode 100644 arch/arm64/boot/dts/freescale/fsl-ls1012a-oxalis.dts
+ create mode 100644 arch/arm64/boot/dts/freescale/imx8mm-pinfunc.h
+ create mode 100644 arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
+ create mode 100644 arch/arm64/boot/dts/freescale/imx8qxp.dtsi
+ create mode 100644 arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts
+ create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-p2894-0050-a08.dts
+ create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-p2894.dtsi
+ create mode 100644 arch/arm64/boot/dts/renesas/cat875.dtsi
+ create mode 100644 arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts
+ create mode 100644 arch/arm64/boot/dts/renesas/r8a774c0-ek874.dts
+ create mode 100644 arch/arm64/boot/dts/renesas/r8a774c0.dtsi
+ create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dts
+ create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-nanopi-m4.dts
+ create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi
+ create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts
+ create mode 100644 arch/arm64/include/asm/kvm_ras.h
+ delete mode 100644 arch/arm64/include/asm/memblock.h
+ create mode 100644 arch/m68k/atari/nvram.c
+ create mode 100644 arch/powerpc/include/asm/task_size_32.h
+ create mode 100644 arch/powerpc/include/asm/task_size_64.h
+ create mode 100644 arch/powerpc/kernel/dma-mask.c
+ delete mode 100644 arch/powerpc/kernel/dma.c
+ create mode 100644 arch/powerpc/lib/test_emulate_step_exec_instr.S
+ rename arch/powerpc/mm/{dump_linuxpagetables-8xx.c => ptdump/8xx.c} (97%)
+ create mode 100644 arch/powerpc/mm/ptdump/Makefile
+ rename arch/powerpc/mm/{dump_bats.c => ptdump/bats.c} (100%)
+ rename arch/powerpc/mm/{dump_linuxpagetables-book3s64.c => ptdump/book3s64.c} (98%)
+ rename arch/powerpc/mm/{dump_hashpagetable.c => ptdump/hashpagetable.c} (99%)
+ rename arch/powerpc/mm/{dump_linuxpagetables.c => ptdump/ptdump.c} (94%)
+ rename arch/powerpc/mm/{dump_linuxpagetables.h => ptdump/ptdump.h} (100%)
+ rename arch/powerpc/mm/{dump_sr.c => ptdump/segment_regs.c} (100%)
+ rename arch/powerpc/mm/{dump_linuxpagetables-generic.c => ptdump/shared.c} (97%)
+ create mode 100644 arch/powerpc/platforms/powernv/opal-call.c
+ create mode 100644 arch/riscv/include/asm/fixmap.h
+ delete mode 100644 arch/sh/include/uapi/asm/unistd_32.h
+ rename arch/unicore32/boot/compressed/{vmlinux.lds.in => vmlinux.lds.S} (100%)
+ create mode 100644 arch/x86/boot/compressed/acpi.c
+ create mode 100644 arch/x86/include/asm/kvm_vcpu_regs.h
+ delete mode 100644 arch/x86/platform/efi/early_printk.c
+ create mode 100644 crypto/lzo-rle.c
+ create mode 100644 drivers/ata/pata_buddha.c
+ rename {firmware => drivers/base/firmware_loader/builtin}/.gitignore (100%)
+ rename {firmware => drivers/base/firmware_loader/builtin}/Makefile (100%)
+ delete mode 100644 drivers/char/generic_nvram.c
+ create mode 100644 drivers/char/hw_random/optee-rng.c
+ create mode 100644 drivers/char/ipmi/ipmi_plat_data.c
+ create mode 100644 drivers/char/ipmi/ipmi_plat_data.h
+ create mode 100644 drivers/clk/actions/owl-s500.c
+ create mode 100644 drivers/clk/clk-fixed-mmio.c
+ create mode 100644 drivers/clk/imx/clk-imx8mm.c
+ create mode 100644 drivers/clk/imx/clk-pll14xx.c
+ create mode 100644 drivers/clk/meson/clk-dualdiv.c
+ create mode 100644 drivers/clk/meson/clk-dualdiv.h
+ create mode 100644 drivers/clk/meson/clk-input.h
+ create mode 100644 drivers/clk/meson/clk-mpll.h
+ create mode 100644 drivers/clk/meson/clk-phase.h
+ create mode 100644 drivers/clk/meson/clk-pll.h
+ delete mode 100644 drivers/clk/meson/clk-triphase.c
+ delete mode 100644 drivers/clk/meson/clkc.h
+ create mode 100644 drivers/clk/meson/g12a-aoclk.c
+ create mode 100644 drivers/clk/meson/g12a-aoclk.h
+ create mode 100644 drivers/clk/meson/g12a.c
+ create mode 100644 drivers/clk/meson/g12a.h
+ delete mode 100644 drivers/clk/meson/gxbb-aoclk-32k.c
+ create mode 100644 drivers/clk/meson/meson-eeclk.c
+ create mode 100644 drivers/clk/meson/meson-eeclk.h
+ create mode 100644 drivers/clk/meson/parm.h
+ rename drivers/clk/meson/{clkc-audio.h => sclk-div.h} (54%)
+ create mode 100644 drivers/clk/meson/vid-pll-div.h
+ rename drivers/clocksource/{cs5535-clockevt.c => timer-cs5535.c} (100%)
+ create mode 100644 drivers/clocksource/timer-milbeaut.c
+ rename drivers/clocksource/{pxa_timer.c => timer-pxa.c} (100%)
+ rename drivers/clocksource/{tango_xtal.c => timer-tango-xtal.c} (100%)
+ create mode 100644 drivers/cpufreq/armada-8k-cpufreq.c
+ create mode 100644 drivers/cpuidle/governors/teo.c
+ create mode 100644 drivers/dax/bus.c
+ create mode 100644 drivers/dax/bus.h
+ delete mode 100644 drivers/dax/dax.h
+ delete mode 100644 drivers/dax/device-dax.h
+ create mode 100644 drivers/dax/kmem.c
+ delete mode 100644 drivers/dax/pmem.c
+ create mode 100644 drivers/dax/pmem/Makefile
+ create mode 100644 drivers/dax/pmem/compat.c
+ create mode 100644 drivers/dax/pmem/core.c
+ create mode 100644 drivers/dax/pmem/pmem.c
+ create mode 100644 drivers/dma/dw/dw.c
+ create mode 100644 drivers/dma/dw/idma32.c
+ create mode 100644 drivers/dma/fsl-qdma.c
+ create mode 100644 drivers/edac/aspeed_edac.c
+ create mode 100644 drivers/edac/i10nm_base.c
+ create mode 100644 drivers/edac/skx_base.c
+ create mode 100644 drivers/edac/skx_common.c
+ create mode 100644 drivers/edac/skx_common.h
+ delete mode 100644 drivers/edac/skx_edac.c
+ create mode 100644 drivers/extcon/extcon-ptn5150.c
+ create mode 100644 drivers/firmware/efi/earlycon.c
+ create mode 100644 drivers/firmware/tegra/bpmp-private.h
+ create mode 100644 drivers/firmware/tegra/bpmp-tegra186.c
+ create mode 100644 drivers/firmware/tegra/bpmp-tegra210.c
+ create mode 100644 drivers/gnss/mtk.c
+ create mode 100644 drivers/gpio/gpio-amd-fch.c
+ create mode 100644 drivers/gpio/gpio-gw-pld.c
+ create mode 100644 drivers/gpio/gpio-tqmx86.c
+ delete mode 100644 drivers/gpu/drm/amd/amdgpu/ci_dpm.c
+ delete mode 100644 drivers/gpu/drm/amd/amdgpu/ci_dpm.h
+ delete mode 100644 drivers/gpu/drm/amd/amdgpu/ci_smc.c
+ create mode 100644 drivers/gpu/drm/amd/display/dc/core/dc_vm_helper.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/Makefile
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.h
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dce100/i2caux_dce100.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.h
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2c_hw_engine_dce110.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2c_hw_engine_dce110.h
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2c_sw_engine_dce110.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2caux_dce110.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2caux_dce110.h
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dce112/i2caux_dce112.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dce112/i2caux_dce112.h
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dce120/i2caux_dce120.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dce80/i2c_hw_engine_dce80.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dce80/i2c_hw_engine_dce80.h
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dce80/i2c_sw_engine_dce80.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dce80/i2caux_dce80.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dcn10/i2caux_dcn10.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/dcn10/i2caux_dcn10.h
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/diagnostics/i2caux_diag.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/diagnostics/i2caux_diag.h
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/engine.h
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/i2c_engine.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/i2c_engine.h
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/i2c_generic_hw_engine.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/i2c_generic_hw_engine.h
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/i2c_hw_engine.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/i2c_hw_engine.h
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/i2c_sw_engine.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/i2c_sw_engine.h
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/i2caux.c
+ delete mode 100644 drivers/gpu/drm/amd/display/dc/i2caux/i2caux.h
+ rename drivers/gpu/drm/amd/display/dc/{i2caux/engine_base.c => inc/hw/vmid.h} (63%)
+ rename drivers/gpu/drm/amd/display/dc/{i2caux/dce110/i2c_sw_engine_dce110.h => inc/vm_helper.h} (64%)
+ create mode 100644 drivers/gpu/drm/amd/include/asic_reg/nbio/nbio_6_1_smn.h
+ create mode 100644 drivers/gpu/drm/amd/include/asic_reg/nbio/nbio_7_0_smn.h
+ create mode 100644 drivers/gpu/drm/amd/include/asic_reg/nbio/nbio_7_4_0_smn.h
+ create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c
+ rename drivers/gpu/drm/amd/{display/dc/i2caux/dce80/i2c_sw_engine_dce80.h => powerplay/hwmgr/common_baco.h} (65%)
+ create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_baco.c
+ rename drivers/gpu/drm/amd/{display/dc/i2caux/dce80/i2caux_dce80.h => powerplay/hwmgr/vega10_baco.h} (74%)
+ create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/vega20_baco.c
+ rename drivers/gpu/drm/amd/{display/dc/i2caux/dce100/i2caux_dce100.h => powerplay/hwmgr/vega20_baco.h} (73%)
+ create mode 100644 drivers/gpu/drm/arm/display/Kbuild
+ create mode 100644 drivers/gpu/drm/arm/display/Kconfig
+ create mode 100644 drivers/gpu/drm/arm/display/include/malidp_io.h
+ create mode 100644 drivers/gpu/drm/arm/display/include/malidp_product.h
+ create mode 100644 drivers/gpu/drm/arm/display/include/malidp_utils.h
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/Makefile
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_dev.c
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_dev.h
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_drv.c
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_format_caps.c
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_format_caps.h
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.h
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_kms.c
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_kms.h
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_plane.c
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_private_obj.c
+ delete mode 100644 drivers/gpu/drm/bochs/bochs_fbdev.c
+ create mode 100644 drivers/gpu/drm/i915/i915_active.c
+ create mode 100644 drivers/gpu/drm/i915/i915_active.h
+ create mode 100644 drivers/gpu/drm/i915/i915_active_types.h
+ create mode 100644 drivers/gpu/drm/i915/i915_reset.c
+ create mode 100644 drivers/gpu/drm/i915/i915_reset.h
+ create mode 100644 drivers/gpu/drm/i915/selftests/i915_active.c
+ create mode 100644 drivers/gpu/drm/i915/selftests/igt_live_test.c
+ create mode 100644 drivers/gpu/drm/i915/selftests/igt_live_test.h
+ delete mode 100644 drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
+ create mode 100644 drivers/gpu/drm/nouveau/include/nvif/clb069.h
+ create mode 100644 drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h
+ create mode 100644 drivers/gpu/drm/nouveau/nouveau_dmem.c
+ create mode 100644 drivers/gpu/drm/nouveau/nouveau_dmem.h
+ create mode 100644 drivers/gpu/drm/nouveau/nouveau_svm.c
+ create mode 100644 drivers/gpu/drm/nouveau/nouveau_svm.h
+ rename drivers/gpu/drm/nouveau/nvkm/engine/ce/{tu104.c => tu102.c} (91%)
+ rename drivers/gpu/drm/nouveau/nvkm/engine/disp/{roottu104.c => roottu102.c} (74%)
+ rename drivers/gpu/drm/nouveau/nvkm/engine/disp/{sortu104.c => sortu102.c} (90%)
+ rename drivers/gpu/drm/nouveau/nvkm/engine/disp/{tu104.c => tu102.c} (93%)
+ rename drivers/gpu/drm/nouveau/nvkm/engine/fifo/{gpfifotu104.c => gpfifotu102.c} (91%)
+ rename drivers/gpu/drm/nouveau/nvkm/engine/fifo/{tu104.c => tu102.c} (82%)
+ rename drivers/gpu/drm/nouveau/nvkm/engine/fifo/{usertu104.c => usertu102.c} (86%)
+ rename drivers/gpu/drm/{amd/display/dc/i2caux/dce120/i2caux_dce120.h => nouveau/nvkm/engine/sec2/tu102.c} (77%)
+ rename drivers/gpu/drm/nouveau/nvkm/subdev/bar/{tu104.c => tu102.c} (84%)
+ rename drivers/gpu/drm/nouveau/nvkm/subdev/devinit/{tu104.c => tu102.c} (87%)
+ rename drivers/gpu/drm/nouveau/nvkm/subdev/fault/{tu104.c => tu102.c} (82%)
+ create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/fault/user.c
+ create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/gsp/Kbuild
+ create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gv100.c
+ rename drivers/gpu/drm/nouveau/nvkm/subdev/mc/{tu104.c => tu102.c} (88%)
+ rename drivers/gpu/drm/nouveau/nvkm/subdev/mmu/{tu104.c => tu102.c} (88%)
+ rename drivers/gpu/drm/nouveau/nvkm/subdev/mmu/{vmmtu104.c => vmmtu102.c} (89%)
+ create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gf117.c
+ create mode 100644 drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
+ create mode 100644 drivers/gpu/drm/panel/panel-sitronix-st7701.c
+ create mode 100644 drivers/gpu/drm/panel/panel-tpo-tpg110.c
+ delete mode 100644 drivers/gpu/drm/qxl/qxl_fb.c
+ create mode 100644 drivers/gpu/drm/rcar-du/rcar_lvds.h
+ create mode 100644 drivers/gpu/drm/tegra/hda.c
+ create mode 100644 drivers/gpu/drm/tegra/hda.h
+ delete mode 100644 drivers/gpu/drm/virtio/virtgpu_drm_bus.c
+ create mode 100644 drivers/gpu/host1x/hw/hw_host1x06_channel.h
+ create mode 100644 drivers/gpu/host1x/hw/hw_host1x07_channel.h
+ create mode 100644 drivers/hid/hid-maltron.c
+ create mode 100644 drivers/hid/hid-uclogic-core.c
+ create mode 100644 drivers/hid/hid-uclogic-params.c
+ create mode 100644 drivers/hid/hid-uclogic-params.h
+ rename drivers/hid/{hid-uclogic.c => hid-uclogic-rdesc.c} (67%)
+ create mode 100644 drivers/hid/hid-uclogic-rdesc.h
+ create mode 100644 drivers/hid/hid-viewsonic.c
+ rename drivers/{staging => }/iio/adc/ad7606.c (73%)
+ rename drivers/{staging => }/iio/adc/ad7606.h (88%)
+ rename drivers/{staging => }/iio/adc/ad7606_par.c (75%)
+ rename drivers/{staging => }/iio/adc/ad7606_spi.c (67%)
+ create mode 100644 drivers/iio/adc/ad7768-1.c
+ create mode 100644 drivers/iio/adc/ingenic-adc.c
+ create mode 100644 drivers/iio/adc/npcm_adc.c
+ create mode 100644 drivers/iio/adc/stmpe-adc.c
+ create mode 100644 drivers/iio/adc/ti-ads124s08.c
+ create mode 100644 drivers/iio/chemical/pms7003.c
+ create mode 100644 drivers/iio/chemical/sgp30.c
+ create mode 100644 drivers/iio/chemical/sps30.c
+ create mode 100644 drivers/iio/dac/ti-dac7612.c
+ create mode 100644 drivers/iio/light/max44009.c
+ create mode 100644 drivers/infiniband/core/restrack.h
+ create mode 100644 drivers/infiniband/hw/hfi1/opfn.c
+ create mode 100644 drivers/infiniband/hw/hfi1/opfn.h
+ create mode 100644 drivers/infiniband/hw/hfi1/rc.h
+ create mode 100644 drivers/infiniband/hw/hfi1/trace_tid.h
+ create mode 100644 drivers/input/misc/msm-vibrator.c
+ create mode 100644 drivers/input/misc/stpmic1_onkey.c
+ create mode 100644 drivers/interconnect/Kconfig
+ create mode 100644 drivers/interconnect/Makefile
+ create mode 100644 drivers/interconnect/core.c
+ create mode 100644 drivers/interconnect/qcom/Kconfig
+ create mode 100644 drivers/interconnect/qcom/Makefile
+ create mode 100644 drivers/interconnect/qcom/sdm845.c
+ create mode 100644 drivers/iommu/hyperv-iommu.c
+ create mode 100644 drivers/irqchip/irq-davinci-aintc.c
+ create mode 100644 drivers/irqchip/irq-davinci-cp-intc.c
+ create mode 100644 drivers/irqchip/irq-ls1x.c
+ create mode 100644 drivers/mailbox/zynqmp-ipi-mailbox.c
+ create mode 100644 drivers/md/dm-init.c
+ rename drivers/media/i2c/{soc_camera/soc_mt9m001.c => mt9m001.c} (66%)
+ create mode 100644 drivers/media/i2c/ov8856.c
+ rename drivers/media/i2c/{soc_camera/soc_ov9640.c => ov9640.c} (90%)
+ rename drivers/media/i2c/{soc_camera => }/ov9640.h (96%)
+ delete mode 100644 drivers/media/i2c/soc_camera/Makefile
+ delete mode 100644 drivers/media/i2c/soc_camera/soc_mt9t112.c
+ delete mode 100644 drivers/media/i2c/soc_camera/soc_ov772x.c
+ delete mode 100644 drivers/media/i2c/soc_camera/soc_rj54n1cb0c.c
+ delete mode 100644 drivers/media/i2c/soc_camera/soc_tw9910.c
+ delete mode 100644 drivers/media/platform/soc_camera/Kconfig
+ delete mode 100644 drivers/media/platform/soc_camera/Makefile
+ delete mode 100644 drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
+ delete mode 100644 drivers/media/platform/soc_camera/soc_camera_platform.c
+ delete mode 100644 drivers/media/platform/soc_camera/soc_scale_crop.c
+ delete mode 100644 drivers/media/platform/soc_camera/soc_scale_crop.h
+ create mode 100644 drivers/media/platform/vimc/vimc-streamer.c
+ create mode 100644 drivers/media/platform/vimc/vimc-streamer.h
+ create mode 100644 drivers/media/rc/ir-rcmm-decoder.c
+ create mode 100644 drivers/mfd/bcm2835-pm.c
+ create mode 100644 drivers/mfd/lochnagar-i2c.c
+ create mode 100644 drivers/mfd/stpmic1.c
+ create mode 100644 drivers/mfd/tqmx86.c
+ create mode 100644 drivers/misc/fastrpc.c
+ create mode 100644 drivers/misc/habanalabs/Kconfig
+ create mode 100644 drivers/misc/habanalabs/Makefile
+ create mode 100644 drivers/misc/habanalabs/asid.c
+ create mode 100644 drivers/misc/habanalabs/command_buffer.c
+ create mode 100644 drivers/misc/habanalabs/command_submission.c
+ create mode 100644 drivers/misc/habanalabs/context.c
+ create mode 100644 drivers/misc/habanalabs/debugfs.c
+ create mode 100644 drivers/misc/habanalabs/device.c
+ create mode 100644 drivers/misc/habanalabs/goya/Makefile
+ create mode 100644 drivers/misc/habanalabs/goya/goya.c
+ create mode 100644 drivers/misc/habanalabs/goya/goyaP.h
+ create mode 100644 drivers/misc/habanalabs/goya/goya_hwmgr.c
+ create mode 100644 drivers/misc/habanalabs/goya/goya_security.c
+ create mode 100644 drivers/misc/habanalabs/habanalabs.h
+ create mode 100644 drivers/misc/habanalabs/habanalabs_drv.c
+ create mode 100644 drivers/misc/habanalabs/habanalabs_ioctl.c
+ create mode 100644 drivers/misc/habanalabs/hw_queue.c
+ create mode 100644 drivers/misc/habanalabs/hwmon.c
+ create mode 100644 drivers/misc/habanalabs/include/armcp_if.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/cpu_ca53_cfg_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/cpu_ca53_cfg_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/cpu_if_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/cpu_pll_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/dma_ch_0_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/dma_ch_1_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/dma_ch_2_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/dma_ch_3_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/dma_ch_4_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/dma_macro_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/dma_macro_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/dma_nrtr_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/dma_nrtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/dma_qm_0_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/dma_qm_0_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/dma_qm_1_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/dma_qm_2_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/dma_qm_3_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/dma_qm_4_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/goya_blocks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/goya_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/goya_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/ic_pll_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/mc_pll_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/mme1_rtr_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/mme1_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/mme2_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/mme3_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/mme4_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/mme5_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/mme6_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/mme_cmdq_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/mme_cmdq_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/mme_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/mme_qm_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/mme_qm_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/mme_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/mmu_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/mmu_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/pci_nrtr_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/pci_nrtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/pcie_aux_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/psoc_emmc_pll_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/psoc_global_conf_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/psoc_global_conf_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/psoc_mme_pll_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/psoc_pci_pll_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/psoc_spi_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/sram_y0_x0_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/sram_y0_x1_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/sram_y0_x2_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/sram_y0_x3_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/sram_y0_x4_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/stlb_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/stlb_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc0_cfg_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc0_cfg_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc0_cmdq_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc0_cmdq_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc0_eml_cfg_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc0_eml_cfg_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc0_nrtr_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc0_nrtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc0_qm_masks.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc0_qm_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc1_cfg_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc1_cmdq_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc1_qm_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc1_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc2_cfg_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc2_cmdq_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc2_qm_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc2_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc3_cfg_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc3_cmdq_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc3_qm_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc3_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc4_cfg_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc4_cmdq_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc4_qm_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc4_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc5_cfg_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc5_cmdq_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc5_qm_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc5_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc6_cfg_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc6_cmdq_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc6_qm_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc6_rtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc7_cfg_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc7_cmdq_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc7_nrtr_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc7_qm_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/asic_reg/tpc_pll_regs.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/goya.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/goya_async_events.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/goya_fw_if.h
+ create mode 100644 drivers/misc/habanalabs/include/goya/goya_packets.h
+ create mode 100644 drivers/misc/habanalabs/include/hl_boot_if.h
+ create mode 100644 drivers/misc/habanalabs/include/hw_ip/mmu/mmu_general.h
+ create mode 100644 drivers/misc/habanalabs/include/hw_ip/mmu/mmu_v1_0.h
+ create mode 100644 drivers/misc/habanalabs/include/qman_if.h
+ create mode 100644 drivers/misc/habanalabs/irq.c
+ create mode 100644 drivers/misc/habanalabs/memory.c
+ create mode 100644 drivers/misc/habanalabs/mmu.c
+ create mode 100644 drivers/misc/habanalabs/sysfs.c
+ create mode 100644 drivers/misc/mei/hdcp/Makefile
+ create mode 100644 drivers/misc/mei/hdcp/mei_hdcp.c
+ create mode 100644 drivers/misc/mei/hdcp/mei_hdcp.h
+ create mode 100644 drivers/nvmem/zynqmp_nvmem.c
+ create mode 100644 drivers/pci/controller/dwc/pci-layerscape-ep.c
+ create mode 100644 drivers/pci/pcie/bw_notification.c
+ rename drivers/{gpu/drm/sun4i/sun6i_mipi_dphy.c => phy/allwinner/phy-sun6i-mipi-dphy.c} (70%)
+ create mode 100644 drivers/phy/cadence/cdns-dphy.c
+ create mode 100644 drivers/phy/marvell/phy-mvebu-a3700-comphy.c
+ create mode 100644 drivers/phy/marvell/phy-mvebu-a3700-utmi.c
+ create mode 100644 drivers/pinctrl/freescale/pinctrl-imx8mm.c
+ create mode 100644 drivers/pinctrl/freescale/pinctrl-imx8qm.c
+ create mode 100644 drivers/platform/chrome/wilco_ec/Kconfig
+ create mode 100644 drivers/platform/chrome/wilco_ec/Makefile
+ create mode 100644 drivers/platform/chrome/wilco_ec/core.c
+ create mode 100644 drivers/platform/chrome/wilco_ec/debugfs.c
+ create mode 100644 drivers/platform/chrome/wilco_ec/mailbox.c
+ create mode 100644 drivers/platform/x86/pcengines-apuv2.c
+ create mode 100644 drivers/pwm/pwm-imx1.c
+ rename drivers/pwm/{pwm-imx.c => pwm-imx27.c} (59%)
+ create mode 100644 drivers/reset/reset-brcmstb.c
+ create mode 100644 drivers/reset/reset-zynqmp.c
+ create mode 100644 drivers/rtc/rtc-ab-eoz9.c
+ create mode 100644 drivers/rtc/rtc-cadence.c
+ create mode 100644 drivers/rtc/rtc-meson.c
+ create mode 100644 drivers/rtc/rtc-rv3028.c
+ create mode 100644 drivers/rtc/rtc-sd3078.c
+ create mode 100644 drivers/rtc/rtc-wilco-ec.c
+ delete mode 100644 drivers/scsi/osd/Kbuild
+ delete mode 100644 drivers/scsi/osd/Kconfig
+ delete mode 100644 drivers/scsi/osd/osd_debug.h
+ delete mode 100644 drivers/scsi/osd/osd_initiator.c
+ delete mode 100644 drivers/scsi/osd/osd_uld.c
+ create mode 100644 drivers/soc/bcm/bcm2835-power.c
+ create mode 100644 drivers/soc/qcom/rpmhpd.c
+ create mode 100644 drivers/soc/qcom/rpmpd.c
+ create mode 100644 drivers/soc/xilinx/zynqmp_pm_domains.c
+ create mode 100644 drivers/soc/xilinx/zynqmp_power.c
+ delete mode 100644 drivers/staging/android/ion/ion-ioctl.c
+ create mode 100644 drivers/staging/erofs/Documentation/filesystems/erofs.txt
+ delete mode 100644 drivers/staging/iio/cdc/ad7152.c
+ delete mode 100644 drivers/staging/ks7010/michael_mic.c
+ delete mode 100644 drivers/staging/ks7010/michael_mic.h
+ create mode 100644 drivers/staging/media/imx/imx-media-dev-common.c
+ create mode 100644 drivers/staging/media/imx/imx7-media-csi.c
+ create mode 100644 drivers/staging/media/imx/imx7-mipi-csis.c
+ delete mode 100644 drivers/staging/media/imx074/Kconfig
+ delete mode 100644 drivers/staging/media/imx074/Makefile
+ delete mode 100644 drivers/staging/media/imx074/TODO
+ rename drivers/{media/i2c => staging/media}/soc_camera/Kconfig (54%)
+ create mode 100644 drivers/staging/media/soc_camera/Makefile
+ rename drivers/staging/media/{imx074 => soc_camera}/imx074.c (100%)
+ rename drivers/staging/media/{mt9t031 => soc_camera}/mt9t031.c (100%)
+ rename drivers/{media/platform => staging/media}/soc_camera/soc_camera.c (99%)
+ rename drivers/{media/platform => staging/media}/soc_camera/soc_mediabus.c (100%)
+ rename drivers/{media/i2c => staging/media}/soc_camera/soc_mt9v022.c (100%)
+ rename drivers/{media/i2c => staging/media}/soc_camera/soc_ov5642.c (100%)
+ rename drivers/{media/i2c => staging/media}/soc_camera/soc_ov9740.c (100%)
+ create mode 100644 drivers/staging/mt7621-pci-phy/Kconfig
+ create mode 100644 drivers/staging/mt7621-pci-phy/Makefile
+ create mode 100644 drivers/staging/mt7621-pci-phy/TODO
+ create mode 100644 drivers/staging/mt7621-pci-phy/mediatek,mt7621-pci-phy.txt
+ create mode 100644 drivers/staging/mt7621-pci-phy/pci-mt7621-phy.c
+ create mode 100644 drivers/staging/ralink-gdma/Kconfig
+ create mode 100644 drivers/staging/ralink-gdma/Makefile
+ rename drivers/staging/{mt7621-dma => ralink-gdma}/ralink-gdma.c (99%)
+ rename drivers/staging/wilc1000/{linux_mon.c => wilc_mon.c} (78%)
+ rename drivers/staging/wilc1000/{linux_wlan.c => wilc_netdev.c} (74%)
+ delete mode 100644 drivers/staging/xgifb/Kconfig
+ delete mode 100644 drivers/staging/xgifb/Makefile
+ delete mode 100644 drivers/staging/xgifb/TODO
+ delete mode 100644 drivers/staging/xgifb/XGI_main.h
+ delete mode 100644 drivers/staging/xgifb/XGI_main_26.c
+ delete mode 100644 drivers/staging/xgifb/XGIfb.h
+ delete mode 100644 drivers/staging/xgifb/vb_def.h
+ delete mode 100644 drivers/staging/xgifb/vb_init.c
+ delete mode 100644 drivers/staging/xgifb/vb_init.h
+ delete mode 100644 drivers/staging/xgifb/vb_setmode.c
+ delete mode 100644 drivers/staging/xgifb/vb_setmode.h
+ delete mode 100644 drivers/staging/xgifb/vb_struct.h
+ delete mode 100644 drivers/staging/xgifb/vb_table.h
+ delete mode 100644 drivers/staging/xgifb/vb_util.h
+ delete mode 100644 drivers/staging/xgifb/vgatypes.h
+ create mode 100644 drivers/tee/optee/device.c
+ create mode 100644 drivers/thermal/broadcom/sr-thermal.c
+ create mode 100644 drivers/tty/serial/tegra-tcu.c
+ delete mode 100644 drivers/usb/README
+ rename drivers/usb/host/whci/{Kbuild => Makefile} (79%)
+ delete mode 100644 drivers/usb/typec/ucsi/debug.h
+ create mode 100644 drivers/watchdog/mlx_wdt.c
+ create mode 100644 drivers/watchdog/stpmic1_wdt.c
+ delete mode 100644 drivers/xen/fallback.c
+ delete mode 100644 fs/exofs/BUGS
+ delete mode 100644 fs/exofs/Kbuild
+ delete mode 100644 fs/exofs/Kconfig
+ delete mode 100644 fs/exofs/Kconfig.ore
+ delete mode 100644 fs/exofs/common.h
+ delete mode 100644 fs/exofs/dir.c
+ delete mode 100644 fs/exofs/exofs.h
+ delete mode 100644 fs/exofs/file.c
+ delete mode 100644 fs/exofs/inode.c
+ delete mode 100644 fs/exofs/namei.c
+ delete mode 100644 fs/exofs/ore.c
+ delete mode 100644 fs/exofs/ore_raid.c
+ delete mode 100644 fs/exofs/ore_raid.h
+ delete mode 100644 fs/exofs/super.c
+ delete mode 100644 fs/exofs/sys.c
+ create mode 100644 fs/fs_context.c
+ create mode 100644 fs/fs_parser.c
+ create mode 100644 fs/fs_types.c
+ create mode 100644 fs/io_uring.c
+ create mode 100644 include/asm-generic/Kbuild
+ create mode 100644 include/drm/drm_probe_helper.h
+ create mode 100644 include/drm/i915_mei_hdcp_interface.h
+ create mode 100644 include/dt-bindings/clk/lochnagar.h
+ create mode 100644 include/dt-bindings/clock/actions,s500-cmu.h
+ create mode 100644 include/dt-bindings/clock/g12a-aoclkc.h
+ create mode 100644 include/dt-bindings/clock/g12a-clkc.h
+ create mode 100644 include/dt-bindings/clock/imx8mm-clock.h
+ create mode 100644 include/dt-bindings/iio/adc/ingenic,adc.h
+ create mode 100644 include/dt-bindings/interconnect/qcom,sdm845.h
+ create mode 100644 include/dt-bindings/mfd/st,stpmic1.h
+ create mode 100644 include/dt-bindings/pinctrl/lochnagar.h
+ create mode 100644 include/dt-bindings/power/qcom-rpmpd.h
+ create mode 100644 include/dt-bindings/power/xlnx-zynqmp-power.h
+ create mode 100644 include/dt-bindings/reset/amlogic,meson-g12a-reset.h
+ create mode 100644 include/dt-bindings/reset/g12a-aoclkc.h
+ create mode 100644 include/dt-bindings/reset/imx8mq-reset.h
+ create mode 100644 include/dt-bindings/reset/xlnx-zynqmp-resets.h
+ create mode 100644 include/dt-bindings/soc/bcm2835-pm.h
+ create mode 100644 include/linux/atomic-fallback.h
+ delete mode 100644 include/linux/flex_array.h
+ create mode 100644 include/linux/fs_context.h
+ create mode 100644 include/linux/fs_parser.h
+ create mode 100644 include/linux/fs_types.h
+ delete mode 100644 include/linux/fscrypt_notsupp.h
+ delete mode 100644 include/linux/fscrypt_supp.h
+ create mode 100644 include/linux/generic-radix-tree.h
+ delete mode 100644 include/linux/input/ili210x.h
+ create mode 100644 include/linux/interconnect-provider.h
+ create mode 100644 include/linux/interconnect.h
+ rename {drivers/iommu => include/linux}/io-pgtable.h (100%)
+ create mode 100644 include/linux/irqchip/irq-davinci-aintc.h
+ create mode 100644 include/linux/irqchip/irq-davinci-cp-intc.h
+ create mode 100644 include/linux/limits.h
+ create mode 100644 include/linux/mailbox/zynqmp-ipi-message.h
+ create mode 100644 include/linux/mfd/bcm2835-pm.h
+ create mode 100644 include/linux/mfd/lochnagar.h
+ create mode 100644 include/linux/mfd/lochnagar1_regs.h
+ create mode 100644 include/linux/mfd/lochnagar2_regs.h
+ create mode 100644 include/linux/mfd/stpmic1.h
+ delete mode 100644 include/linux/platform_data/at24.h
+ create mode 100644 include/linux/platform_data/davinci-cpufreq.h
+ create mode 100644 include/linux/platform_data/gpio/gpio-amd-fch.h
+ delete mode 100644 include/linux/platform_data/i2c-cbus-gpio.h
+ delete mode 100644 include/linux/platform_data/media/soc_camera_platform.h
+ create mode 100644 include/linux/platform_data/wilco-ec.h
+ rename include/linux/platform_data/{ => x86}/clk-lpss.h (100%)
+ delete mode 100644 include/linux/power/isp1704_charger.h
+ create mode 100644 include/linux/reset/socfpga.h
+ create mode 100644 include/linux/reset/sunxi.h
+ delete mode 100644 include/linux/selinux.h
+ delete mode 100644 include/media/drv-intf/sh_mobile_ceu.h
+ create mode 100644 include/rdma/tid_rdma_defs.h
+ delete mode 100644 include/scsi/osd_initiator.h
+ delete mode 100644 include/scsi/osd_ore.h
+ create mode 100644 include/sound/cs35l36.h
+ create mode 100644 include/trace/events/pwc.h
+ create mode 100644 include/trace/events/rpcgss.h
+ create mode 100644 include/trace/events/tegra_apb_dma.h
+ rename include/uapi/asm-generic/{Kbuild.asm => Kbuild} (87%)
+ create mode 100644 include/uapi/linux/io_uring.h
+ create mode 100644 include/uapi/misc/fastrpc.h
+ create mode 100644 include/uapi/misc/habanalabs.h
+ delete mode 100644 lib/flex_array.c
+ create mode 100644 lib/generic-radix-tree.c
+ create mode 100644 lib/livepatch/Makefile
+ create mode 100644 lib/livepatch/test_klp_atomic_replace.c
+ create mode 100644 lib/livepatch/test_klp_callbacks_busy.c
+ create mode 100644 lib/livepatch/test_klp_callbacks_demo.c
+ create mode 100644 lib/livepatch/test_klp_callbacks_demo2.c
+ create mode 100644 lib/livepatch/test_klp_callbacks_mod.c
+ create mode 100644 lib/livepatch/test_klp_livepatch.c
+ create mode 100644 lib/livepatch/test_klp_shadow_vars.c
+ create mode 100644 lib/test_stackinit.c
+ create mode 100644 lib/test_vmalloc.c
+ create mode 100644 net/sunrpc/auth_gss/trace.c
+ create mode 100644 net/unix/scm.c
+ create mode 100644 net/unix/scm.h
+ create mode 100644 samples/binderfs/Makefile
+ create mode 100644 samples/binderfs/binderfs_example.c
+ create mode 100755 scripts/atomic/atomic-tbl.sh
+ create mode 100755 scripts/atomic/atomics.tbl
+ create mode 100755 scripts/atomic/check-atomics.sh
+ create mode 100755 scripts/atomic/fallbacks/acquire
+ create mode 100755 scripts/atomic/fallbacks/add_negative
+ create mode 100755 scripts/atomic/fallbacks/add_unless
+ create mode 100755 scripts/atomic/fallbacks/andnot
+ create mode 100755 scripts/atomic/fallbacks/dec
+ create mode 100755 scripts/atomic/fallbacks/dec_and_test
+ create mode 100755 scripts/atomic/fallbacks/dec_if_positive
+ create mode 100755 scripts/atomic/fallbacks/dec_unless_positive
+ create mode 100755 scripts/atomic/fallbacks/fence
+ create mode 100755 scripts/atomic/fallbacks/fetch_add_unless
+ create mode 100755 scripts/atomic/fallbacks/inc
+ create mode 100755 scripts/atomic/fallbacks/inc_and_test
+ create mode 100755 scripts/atomic/fallbacks/inc_not_zero
+ create mode 100755 scripts/atomic/fallbacks/inc_unless_negative
+ create mode 100755 scripts/atomic/fallbacks/read_acquire
+ create mode 100755 scripts/atomic/fallbacks/release
+ create mode 100755 scripts/atomic/fallbacks/set_release
+ create mode 100755 scripts/atomic/fallbacks/sub_and_test
+ create mode 100755 scripts/atomic/fallbacks/try_cmpxchg
+ create mode 100755 scripts/atomic/gen-atomic-fallback.sh
+ create mode 100755 scripts/atomic/gen-atomic-instrumented.sh
+ create mode 100755 scripts/atomic/gen-atomic-long.sh
+ create mode 100644 scripts/atomic/gen-atomics.sh
+ create mode 100644 scripts/coccinelle/free/put_device.cocci
+ rename scripts/kconfig/{zconf.l => lexer.l} (99%)
+ delete mode 100644 scripts/kconfig/lxdialog/.gitignore
+ rename scripts/kconfig/{zconf.y => parser.y} (100%)
+ create mode 100644 security/safesetid/Kconfig
+ create mode 100644 security/safesetid/Makefile
+ create mode 100644 security/safesetid/lsm.c
+ create mode 100644 security/safesetid/lsm.h
+ create mode 100644 security/safesetid/securityfs.c
+ delete mode 100644 security/selinux/exports.c
+ delete mode 100644 sound/firewire/fireface/ff-protocol-ff400.c
+ delete mode 100644 sound/firewire/fireface/ff-protocol-ff800.c
+ create mode 100644 sound/firewire/fireface/ff-protocol-former.c
+ create mode 100644 sound/firewire/fireface/ff-protocol-latter.c
+ create mode 100644 sound/soc/codecs/cros_ec_codec.c
+ create mode 100644 sound/soc/codecs/cs35l36.c
+ create mode 100644 sound/soc/codecs/cs35l36.h
+ create mode 100644 sound/soc/codecs/cs4341.c
+ create mode 100644 sound/soc/codecs/jz4725b.c
+ create mode 100644 sound/soc/codecs/mt6358.c
+ create mode 100644 sound/soc/codecs/mt6358.h
+ create mode 100644 sound/soc/codecs/rk3328_codec.c
+ create mode 100644 sound/soc/codecs/rk3328_codec.h
+ create mode 100644 sound/soc/codecs/wcd-clsh-v2.c
+ create mode 100644 sound/soc/codecs/wcd-clsh-v2.h
+ create mode 100644 sound/soc/codecs/wcd9335.c
+ create mode 100644 sound/soc/codecs/wcd9335.h
+ create mode 100644 sound/soc/fsl/fsl_micfil.c
+ create mode 100644 sound/soc/fsl/fsl_micfil.h
+ delete mode 100644 sound/soc/generic/audio-graph-scu-card.c
+ delete mode 100644 sound/soc/generic/simple-scu-card.c
+ create mode 100644 sound/soc/mediatek/common/mtk-btcvsd.c
+ create mode 100644 sound/soc/mediatek/mt8183/Makefile
+ create mode 100644 sound/soc/mediatek/mt8183/mt8183-afe-clk.c
+ create mode 100644 sound/soc/mediatek/mt8183/mt8183-afe-clk.h
+ create mode 100644 sound/soc/mediatek/mt8183/mt8183-afe-common.h
+ create mode 100644 sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
+ create mode 100644 sound/soc/mediatek/mt8183/mt8183-dai-adda.c
+ create mode 100644 sound/soc/mediatek/mt8183/mt8183-dai-hostless.c
+ create mode 100644 sound/soc/mediatek/mt8183/mt8183-dai-i2s.c
+ create mode 100644 sound/soc/mediatek/mt8183/mt8183-dai-pcm.c
+ create mode 100644 sound/soc/mediatek/mt8183/mt8183-dai-tdm.c
+ create mode 100644 sound/soc/mediatek/mt8183/mt8183-interconnection.h
+ create mode 100644 sound/soc/mediatek/mt8183/mt8183-reg.h
+ create mode 100644 sound/soc/sprd/Kconfig
+ create mode 100644 sound/soc/sprd/Makefile
+ create mode 100644 sound/soc/sprd/sprd-pcm-dma.c
+ create mode 100644 sound/soc/sprd/sprd-pcm-dma.h
+ create mode 100644 sound/soc/xilinx/xlnx_formatter_pcm.c
+ create mode 100644 sound/soc/xilinx/xlnx_spdif.c
+ create mode 100644 tools/debugging/Makefile
+ create mode 100755 tools/debugging/kernel-chktaint
+ create mode 100644 tools/include/linux/numa.h
+ rename tools/{testing/selftests/rcutorture/bin => include/nolibc}/nolibc.h (94%)
+ create mode 100644 tools/io_uring/Makefile
+ create mode 100644 tools/io_uring/README
+ create mode 100644 tools/io_uring/barrier.h
+ create mode 100644 tools/io_uring/io_uring-bench.c
+ create mode 100644 tools/io_uring/io_uring-cp.c
+ create mode 100644 tools/io_uring/liburing.h
+ create mode 100644 tools/io_uring/queue.c
+ create mode 100644 tools/io_uring/setup.c
+ create mode 100644 tools/io_uring/syscall.c
+ create mode 100644 tools/memory-model/.gitignore
+ create mode 100644 tools/memory-model/scripts/README
+ create mode 100644 tools/memory-model/scripts/checkghlitmus.sh
+ create mode 100644 tools/memory-model/scripts/checklitmushist.sh
+ create mode 100644 tools/memory-model/scripts/cmplitmushist.sh
+ create mode 100644 tools/memory-model/scripts/initlitmushist.sh
+ create mode 100644 tools/memory-model/scripts/judgelitmus.sh
+ create mode 100644 tools/memory-model/scripts/newlitmushist.sh
+ create mode 100644 tools/memory-model/scripts/parseargs.sh
+ create mode 100644 tools/memory-model/scripts/runlitmushist.sh
+ create mode 100644 tools/perf/pmu-events/arch/powerpc/power8/metrics.json
+ create mode 100644 tools/perf/pmu-events/arch/powerpc/power9/metrics.json
+ create mode 100644 tools/perf/util/bpf-event.c
+ create mode 100644 tools/perf/util/bpf-event.h
+ create mode 100644 tools/perf/util/bpf_map.c
+ create mode 100644 tools/perf/util/bpf_map.h
+ create mode 100644 tools/perf/util/color_config.c
+ create mode 100644 tools/perf/util/cpu-set-sched.h
+ create mode 100644 tools/perf/util/cputopo.c
+ create mode 100644 tools/perf/util/cputopo.h
+ delete mode 100644 tools/perf/util/drv_configs.c
+ delete mode 100644 tools/perf/util/drv_configs.h
+ create mode 100644 tools/perf/util/map_groups.h
+ create mode 100644 tools/perf/util/map_symbol.h
+ create mode 100644 tools/perf/util/s390-cpumcf-kernel.h
+ create mode 100644 tools/perf/util/s390-sample-raw.c
+ create mode 100644 tools/perf/util/sample-raw.c
+ create mode 100644 tools/perf/util/sample-raw.h
+ create mode 100644 tools/perf/util/symbol_conf.h
+ create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-action-hist-xfail.tc
+ create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onchange-action-hist.tc
+ create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc
+ create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc
+ create mode 100644 tools/testing/selftests/kvm/x86_64/vmx_close_while_nested_test.c
+ create mode 100644 tools/testing/selftests/livepatch/Makefile
+ create mode 100644 tools/testing/selftests/livepatch/README
+ create mode 100644 tools/testing/selftests/livepatch/config
+ create mode 100644 tools/testing/selftests/livepatch/functions.sh
+ create mode 100755 tools/testing/selftests/livepatch/test-callbacks.sh
+ create mode 100755 tools/testing/selftests/livepatch/test-livepatch.sh
+ create mode 100755 tools/testing/selftests/livepatch/test-shadow-vars.sh
+ create mode 100644 tools/testing/selftests/pidfd/Makefile
+ create mode 100644 tools/testing/selftests/pidfd/pidfd_test.c
+ create mode 100644 tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c
+ create mode 100644 tools/testing/selftests/proc/proc-pid-vm.c
+ create mode 100644 tools/testing/selftests/safesetid/.gitignore
+ create mode 100644 tools/testing/selftests/safesetid/Makefile
+ create mode 100644 tools/testing/selftests/safesetid/config
+ create mode 100644 tools/testing/selftests/safesetid/safesetid-test.c
+ create mode 100755 tools/testing/selftests/safesetid/safesetid-test.sh
+ create mode 100644 tools/testing/selftests/tmpfs/.gitignore
+ create mode 100644 tools/testing/selftests/tmpfs/Makefile
+ create mode 100644 tools/testing/selftests/tmpfs/bug-link-o-tmpfile.c
+ create mode 100644 tools/testing/selftests/tpm2/Makefile
+ create mode 100755 tools/testing/selftests/tpm2/test_smoke.sh
+ create mode 100755 tools/testing/selftests/tpm2/test_space.sh
+ create mode 100644 tools/testing/selftests/tpm2/tpm2.py
+ create mode 100644 tools/testing/selftests/tpm2/tpm2_tests.py
+ create mode 100755 tools/testing/selftests/vm/test_vmalloc.sh
+Merging fixes/master (2648624cfe7f adfs: mark expected switch fall-throughs)
+$ git merge fixes/master
+Auto-merging drivers/scsi/st.c
+Merge made by the 'recursive' strategy.
+ fs/adfs/dir_f.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+Merging kspp-gustavo/for-next/kspp (1f7ae812f87e x86/syscalls: Mark expected switch fall-throughs)
+$ git merge kspp-gustavo/for-next/kspp
+Auto-merging fs/nfsd/nfs4state.c
+Auto-merging fs/locks.c
+Auto-merging fs/f2fs/node.c
+Auto-merging fs/ext4/indirect.c
+Auto-merging fs/ext2/inode.c
+Auto-merging fs/ceph/file.c
+Auto-merging fs/btrfs/volumes.h
+Auto-merging fs/btrfs/ref-verify.c
+Auto-merging fs/afs/yfsclient.c
+Auto-merging fs/afs/rxrpc.c
+Auto-merging fs/afs/flock.c
+Auto-merging drivers/scsi/osst.c
+Auto-merging drivers/scsi/lpfc/lpfc_scsi.c
+Auto-merging drivers/scsi/lpfc/lpfc_nvme.c
+Auto-merging drivers/scsi/lpfc/lpfc_nportdisc.c
+Auto-merging drivers/scsi/lpfc/lpfc_hbadisc.c
+Auto-merging drivers/scsi/lpfc/lpfc_els.c
+Auto-merging drivers/scsi/lpfc/lpfc_ct.c
+Auto-merging drivers/scsi/be2iscsi/be_main.c
+Merge made by the 'recursive' strategy.
+ arch/x86/include/asm/syscall.h                     | 28 ++++++++++++++++++
+ drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.c    | 17 +++++++++++
+ drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c |  1 +
+ drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c    |  2 ++
+ drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv40.c    |  1 +
+ drivers/gpu/drm/nouveau/nvkm/subdev/bios/perf.c    |  1 +
+ drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c     |  1 +
+ drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c     |  1 +
+ drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c    |  1 +
+ drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c   |  2 ++
+ drivers/gpu/drm/nouveau/nvkm/subdev/mxm/nv50.c     |  1 +
+ drivers/scsi/aic7xxx/aic7xxx_core.c                | 12 ++++++--
+ drivers/scsi/be2iscsi/be_iscsi.c                   |  1 +
+ drivers/scsi/be2iscsi/be_main.c                    |  1 +
+ drivers/scsi/bfa/bfa_fcpim.c                       |  6 ++--
+ drivers/scsi/csiostor/csio_wr.c                    |  1 +
+ drivers/scsi/imm.c                                 | 33 +++++++++++-----------
+ drivers/scsi/lpfc/lpfc_ct.c                        |  2 ++
+ drivers/scsi/lpfc/lpfc_els.c                       |  1 +
+ drivers/scsi/lpfc/lpfc_hbadisc.c                   |  4 ++-
+ drivers/scsi/lpfc/lpfc_nportdisc.c                 |  1 +
+ drivers/scsi/lpfc/lpfc_nvme.c                      |  1 +
+ drivers/scsi/lpfc/lpfc_scsi.c                      |  8 +++---
+ drivers/scsi/osst.c                                |  6 ++++
+ drivers/scsi/ppa.c                                 |  1 +
+ drivers/scsi/sym53c8xx_2/sym_hipd.c                |  2 ++
+ drivers/scsi/sym53c8xx_2/sym_nvram.c               |  1 +
+ fs/affs/super.c                                    |  3 +-
+ fs/afs/cmservice.c                                 |  8 ++++++
+ fs/afs/file.c                                      |  2 ++
+ fs/afs/flock.c                                     |  1 +
+ fs/afs/fsclient.c                                  | 31 ++++++++++++--------
+ fs/afs/misc.c                                      |  9 ++++++
+ fs/afs/rxrpc.c                                     |  1 +
+ fs/afs/vlclient.c                                  | 18 +++++++-----
+ fs/afs/yfsclient.c                                 | 30 +++++++++++++-------
+ fs/btrfs/ref-verify.c                              |  1 +
+ fs/btrfs/volumes.h                                 |  1 +
+ fs/ceph/file.c                                     |  1 +
+ fs/configfs/dir.c                                  |  2 ++
+ fs/f2fs/node.c                                     |  2 ++
+ fs/fcntl.c                                         |  2 +-
+ fs/gfs2/bmap.c                                     |  4 +--
+ fs/jffs2/fs.c                                      |  1 +
+ fs/libfs.c                                         |  2 ++
+ fs/locks.c                                         |  2 +-
+ fs/nfsd/nfs4proc.c                                 |  1 +
+ fs/nfsd/nfs4state.c                                |  1 +
+ fs/ocfs2/cluster/quorum.c                          |  1 +
+ fs/seq_file.c                                      |  1 +
+ fs/signalfd.c                                      |  1 +
+ fs/ufs/util.h                                      |  4 +--
+ lib/asn1_decoder.c                                 |  4 +++
+ lib/cmdline.c                                      |  5 ++++
+ lib/zstd/bitstream.h                               |  5 ++++
+ lib/zstd/compress.c                                |  1 +
+ lib/zstd/decompress.c                              |  5 +++-
+ lib/zstd/huf_compress.c                            |  2 ++
+ 58 files changed, 225 insertions(+), 64 deletions(-)
+Merging kbuild-current/fixes (5453a3df2a5e Merge tag 'kconfig-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild)
+$ git merge kbuild-current/fixes
+Already up to date.
+Merging arc-current/for-curr (9a18b5a412ba arch: arc: Kconfig: pedantic formatting)
+$ git merge arc-current/for-curr
+Auto-merging arch/arc/configs/hsdk_defconfig
+Auto-merging arch/arc/Kconfig
+Merge made by the 'recursive' strategy.
+ arch/arc/Kconfig                       |  21 +++-
+ arch/arc/Makefile                      |   6 +
+ arch/arc/boot/dts/abilis_tb100.dtsi    |  58 ++++-----
+ arch/arc/boot/dts/abilis_tb100_dvk.dts |  14 +--
+ arch/arc/boot/dts/abilis_tb101.dtsi    |  58 ++++-----
+ arch/arc/boot/dts/abilis_tb101_dvk.dts |  14 +--
+ arch/arc/boot/dts/abilis_tb10x.dtsi    |  60 +++++-----
+ arch/arc/boot/dts/axc001.dtsi          |   6 +-
+ arch/arc/boot/dts/axc003.dtsi          |  16 +--
+ arch/arc/boot/dts/axc003_idu.dtsi      |  16 +--
+ arch/arc/boot/dts/axs10x_mb.dtsi       |  22 ++--
+ arch/arc/boot/dts/hsdk.dts             |  33 +++++-
+ arch/arc/boot/dts/vdk_axc003.dtsi      |   4 +-
+ arch/arc/boot/dts/vdk_axc003_idu.dtsi  |   4 +-
+ arch/arc/boot/dts/vdk_axs10x_mb.dtsi   |  18 +--
+ arch/arc/configs/hsdk_defconfig        |   1 +
+ arch/arc/include/asm/arcregs.h         |  12 +-
+ arch/arc/include/asm/irqflags-arcv2.h  |   8 +-
+ arch/arc/include/asm/perf_event.h      |   2 +-
+ arch/arc/include/asm/spinlock.h        |  49 +++-----
+ arch/arc/kernel/head.S                 |   6 +
+ arch/arc/kernel/intc-arcv2.c           |   2 +-
+ arch/arc/kernel/setup.c                | 211 +++++++++++++++++----------------
+ arch/arc/kernel/troubleshoot.c         |   5 +-
+ arch/arc/lib/Makefile                  |   8 +-
+ arch/arc/lib/memcpy-archs-unaligned.S  |  47 ++++++++
+ arch/arc/plat-eznps/Kconfig            |  12 +-
+ 27 files changed, 399 insertions(+), 314 deletions(-)
+ create mode 100644 arch/arc/lib/memcpy-archs-unaligned.S
+Merging arm-current/fixes (d410a8a49e3e ARM: 8849/1: NOMMU: Fix encodings for PMSAv8's PRBAR4/PRLAR4)
+$ git merge arm-current/fixes
+Already up to date.
+Merging arm64-fixes/for-next/fixes (74698f6971f2 arm64: Relax GIC version check during early boot)
+$ git merge arm64-fixes/for-next/fixes
+Already up to date.
+Merging m68k-current/for-linus (28713169d879 m68k: Add -ffreestanding to CFLAGS)
+$ git merge m68k-current/for-linus
+Already up to date.
+Merging powerpc-fixes/fixes (8f5b27347e88 powerpc/powernv/sriov: Register IOMMU groups for VFs)
+$ git merge powerpc-fixes/fixes
+Already up to date.
+Merging sparc/master (7d762d69145a afs: Fix manually set volume location server list)
+$ git merge sparc/master
+Already up to date.
+Merging fscrypt-current/for-stable (ae64f9bd1d36 Linux 4.15-rc2)
+$ git merge fscrypt-current/for-stable
+Already up to date.
+Merging net/master (517ccc2aa50d net: tipc: fix a missing check for nla_nest_start)
+$ git merge net/master
+Merge made by the 'recursive' strategy.
+ arch/powerpc/include/asm/ppc-opcode.h              |   2 +
+ arch/powerpc/net/bpf_jit.h                         |  17 +-
+ arch/powerpc/net/bpf_jit32.h                       |   4 +
+ arch/powerpc/net/bpf_jit64.h                       |  20 ++
+ arch/powerpc/net/bpf_jit_comp64.c                  |  12 +-
+ .../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c    |   2 +
+ drivers/net/ethernet/realtek/atp.c                 |   2 +-
+ drivers/net/ethernet/sis/sis900.c                  |  10 +-
+ drivers/net/ethernet/stmicro/stmmac/ring_mode.c    |   8 +-
+ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |  14 +-
+ drivers/net/phy/meson-gxl.c                        |   6 +
+ drivers/net/tun.c                                  |  16 +-
+ include/linux/atalk.h                              |   2 +-
+ include/linux/bpf.h                                |   1 -
+ include/linux/bpf_verifier.h                       |  40 +++
+ include/linux/net.h                                |   6 +
+ include/linux/socket.h                             |  12 +-
+ include/net/xdp_sock.h                             |   1 -
+ include/uapi/linux/bpf.h                           | 188 +++++++++-----
+ kernel/bpf/verifier.c                              | 131 +++++-----
+ net/appletalk/aarp.c                               |  15 +-
+ net/appletalk/ddp.c                                |  20 +-
+ net/core/filter.c                                  |  27 +-
+ net/ncsi/ncsi-netlink.c                            |   4 +
+ net/openvswitch/datapath.c                         |  12 +
+ net/sched/sch_cake.c                               |  25 +-
+ net/socket.c                                       | 277 +++++++++++++++++++--
+ net/strparser/strparser.c                          |   2 +
+ net/tipc/group.c                                   |   3 +
+ net/tipc/socket.c                                  |   2 +
+ net/xdp/xdp_umem.c                                 |  19 +-
+ tools/include/uapi/linux/bpf.h                     | 188 +++++++++-----
+ tools/lib/bpf/btf.c                                |  51 +++-
+ tools/lib/bpf/libbpf.c                             |  13 +-
+ tools/lib/bpf/xsk.c                                |  15 +-
+ tools/testing/selftests/bpf/bpf_helpers.h          |   2 +
+ tools/testing/selftests/bpf/prog_tests/map_lock.c  |   2 +-
+ tools/testing/selftests/bpf/prog_tests/spinlock.c  |   2 +-
+ .../selftests/bpf/progs/test_sock_fields_kern.c    |  88 +++++--
+ tools/testing/selftests/bpf/test_btf.c             |  44 ++++
+ tools/testing/selftests/bpf/test_sock_fields.c     | 134 +++++++---
+ .../testing/selftests/bpf/verifier/ref_tracking.c  | 168 +++++++++++++
+ tools/testing/selftests/bpf/verifier/sock.c        |   4 +-
+ 43 files changed, 1253 insertions(+), 358 deletions(-)
+Merging bpf/master (86be36f6502c powerpc: bpf: Fix generation of load/store DW instructions)
+$ git merge bpf/master
+Already up to date.
+Merging ipsec/master (6ee02a54ef99 xfrm6_tunnel: Fix potential panic when unloading xfrm6_tunnel module)
+$ git merge ipsec/master
+Merge made by the 'recursive' strategy.
+ include/net/netns/xfrm.h |  2 +-
+ net/ipv4/esp4_offload.c  |  8 +++++---
+ net/ipv6/esp6_offload.c  |  8 +++++---
+ net/ipv6/xfrm6_tunnel.c  |  4 ++++
+ net/xfrm/xfrm_user.c     | 32 ++++++++++++++++++++++++--------
+ 5 files changed, 39 insertions(+), 15 deletions(-)
+Merging netfilter/master (b8b27498659c netfilter: nf_tables: return immediately on empty commit)
+$ git merge netfilter/master
+Already up to date.
+Merging ipvs/master (b2e3d68d1251 netfilter: nft_compat: destroy function must not have side effects)
+$ git merge ipvs/master
+Already up to date.
+Merging wireless-drivers/master (688cd8bd2c0f iwlwifi: fix 64-bit division)
+$ git merge wireless-drivers/master
+Merge made by the 'recursive' strategy.
+ .../net/wireless/intel/iwlwifi/mvm/ftm-initiator.c |  4 +-
+ drivers/net/wireless/mediatek/mt76/dma.c           |  7 +-
+ drivers/net/wireless/mediatek/mt76/mt76.h          |  2 +
+ drivers/net/wireless/mediatek/mt76/mt7603/dma.c    | 17 ++++-
+ drivers/net/wireless/mediatek/mt76/mt7603/mac.c    |  2 +-
+ drivers/net/wireless/mediatek/mt76/mt7603/main.c   | 16 +++++
+ drivers/net/wireless/mediatek/mt76/mt7603/soc.c    |  4 +-
+ drivers/net/wireless/mediatek/mt76/mt76x02.h       |  4 ++
+ .../net/wireless/mediatek/mt76/mt76x02_debugfs.c   | 27 ++++++++
+ drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c   |  3 +-
+ drivers/net/wireless/mediatek/mt76/mt76x02_mac.c   | 67 ++++++++++++++++--
+ drivers/net/wireless/mediatek/mt76/mt76x02_mac.h   |  2 +
+ drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c  | 81 +++++++++++++++++++---
+ drivers/net/wireless/mediatek/mt76/mt76x02_phy.c   |  2 +
+ .../net/wireless/mediatek/mt76/mt76x02_usb_core.c  |  3 +-
+ drivers/net/wireless/mediatek/mt76/mt76x02_util.c  | 14 ++--
+ drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2.h |  1 +
+ .../net/wireless/mediatek/mt76/mt76x2/pci_init.c   |  2 +-
+ .../net/wireless/mediatek/mt76/mt76x2/pci_mcu.c    | 21 ++++++
+ drivers/net/wireless/mediatek/mt76/mt76x2/phy.c    | 30 +++++---
+ drivers/net/wireless/mediatek/mt76/mt76x2/usb.c    |  3 +-
+ drivers/net/wireless/mediatek/mt76/tx.c            | 11 ++-
+ drivers/net/wireless/mediatek/mt76/usb.c           |  6 +-
+ 23 files changed, 288 insertions(+), 41 deletions(-)
+Merging mac80211/master (d235c48b40d3 net: dsa: mv88e6xxx: power serdes on/off for 10G interfaces on 6390X)
+$ git merge mac80211/master
+Already up to date.
+Merging rdma-fixes/for-rc (f09ef134a7ca iw_cxgb4: cq/qp mask depends on bar2 pages in a host page)
+$ git merge rdma-fixes/for-rc
+Already up to date.
+Merging sound-current/for-linus (2d012c65a9ca ALSA: firewire-motu: use 'version' field of unit directory to identify model)
+$ git merge sound-current/for-linus
+Merge made by the 'recursive' strategy.
+ sound/firewire/motu/motu.c      | 20 ++++++++++----------
+ sound/isa/sb/sb8.c              |  4 ++++
+ sound/pci/echoaudio/echoaudio.c |  5 +++++
+ 3 files changed, 19 insertions(+), 10 deletions(-)
+Merging sound-asoc-fixes/for-linus (5b4e1c6a68b0 Merge branch 'asoc-5.0' into asoc-linus)
+$ git merge sound-asoc-fixes/for-linus
+Auto-merging sound/soc/codecs/tlv320aic3x.c
+CONFLICT (content): Merge conflict in sound/soc/codecs/tlv320aic3x.c
+Resolved 'sound/soc/codecs/tlv320aic3x.c' using previous resolution.
+Automatic merge failed; fix conflicts and then commit the result.
+$ git commit -v -a
+[master 0c33456b5dda] Merge remote-tracking branch 'sound-asoc-fixes/for-linus'
+$ git diff -M --stat --summary HEAD^..
+ sound/soc/codecs/tlv320aic3x.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+Merging regmap-fixes/for-linus (f17b5f06cb92 Linux 5.0-rc4)
+$ git merge regmap-fixes/for-linus
+Already up to date.
+Merging regulator-fixes/for-linus (078d354f8d7f Merge branch 'regulator-5.0' into regulator-linus)
+$ git merge regulator-fixes/for-linus
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging spi-fixes/for-linus (8d0e51ac6f8c Merge branch 'spi-5.0' into spi-linus)
+$ git merge spi-fixes/for-linus
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging pci-current/for-linus (f57a98e1b713 PCI: Work around Synopsys duplicate Device ID (HAPS USB3, NXP i.MX))
+$ git merge pci-current/for-linus
+Already up to date.
+Merging driver-core.current/driver-core-linus (a9dce6679d73 Merge tag 'pidfd-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux)
+$ git merge driver-core.current/driver-core-linus
+Already up to date.
+Merging tty.current/tty-linus (a9dce6679d73 Merge tag 'pidfd-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux)
+$ git merge tty.current/tty-linus
+Already up to date.
+Merging usb.current/usb-linus (a9dce6679d73 Merge tag 'pidfd-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux)
+$ git merge usb.current/usb-linus
+Already up to date.
+Merging usb-gadget-fixes/fixes (a53469a68eb8 usb: phy: am335x: fix race condition in _probe)
+$ git merge usb-gadget-fixes/fixes
+Already up to date.
+Merging usb-serial-fixes/usb-linus (8d7fa3d4ea3f USB: serial: ftdi_sio: add ID for Hjelmslund Electronics USB485)
+$ git merge usb-serial-fixes/usb-linus
+Already up to date.
+Merging usb-chipidea-fixes/ci-for-usb-stable (d6d768a0ec3c usb: chipidea: fix static checker warning for NULL pointer)
+$ git merge usb-chipidea-fixes/ci-for-usb-stable
+Auto-merging drivers/usb/chipidea/ci_hdrc_imx.c
+Merge made by the 'recursive' strategy.
+Merging phy/fixes (827cb0323928 phy: ath79-usb: Fix the main reset name to match the DT binding)
+$ git merge phy/fixes
+Already up to date.
+Merging staging.current/staging-linus (a9dce6679d73 Merge tag 'pidfd-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux)
+$ git merge staging.current/staging-linus
+Already up to date.
+Merging char-misc.current/char-misc-linus (a9dce6679d73 Merge tag 'pidfd-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux)
+$ git merge char-misc.current/char-misc-linus
+Already up to date.
+Merging soundwire-fixes/fixes (bfeffd155283 Linux 5.0-rc1)
+$ git merge soundwire-fixes/fixes
+Already up to date.
+Merging thunderbolt-fixes/fixes (1c163f4c7b3f Linux 5.0)
+$ git merge thunderbolt-fixes/fixes
+Already up to date.
+Merging input-current/for-linus (44fc95e218a0 Input: wacom_serial4 - add support for Wacom ArtPad II tablet)
+$ git merge input-current/for-linus
+Already up to date.
+Merging crypto-current/master (00e87449430d crypto: caam - add missing put_device() call)
+$ git merge crypto-current/master
+Already up to date.
+Merging ide/master (dc5c37736d16 drivers: ide: Kconfig: pedantic formatting)
+$ git merge ide/master
+Already up to date.
+Merging vfio-fixes/for-linus (9a71ac7e15a7 vfio-pci/nvlink2: Fix ancient gcc warnings)
+$ git merge vfio-fixes/for-linus
+Already up to date.
+Merging kselftest-fixes/fixes (7d4e591bc051 selftests: timers: use LDLIBS instead of LDFLAGS)
+$ git merge kselftest-fixes/fixes
+Already up to date.
+Merging modules-fixes/modules-linus (be71eda5383f module: Fix display of wrong module .text address)
+$ git merge modules-fixes/modules-linus
+Already up to date.
+Merging slave-dma-fixes/fixes (d13937116f1e Linux 5.0-rc6)
+$ git merge slave-dma-fixes/fixes
+Already up to date.
+Merging backlight-fixes/for-backlight-fixes (651022382c7f Linux 4.20-rc1)
+$ git merge backlight-fixes/for-backlight-fixes
+Already up to date.
+Merging mtd-fixes/master (3e35730dd754 mtd: powernv_flash: Fix device registration error)
+$ git merge mtd-fixes/master
+Already up to date.
+Merging spi-nor-fixes/spi-nor/fixes (7928b2cbe55b Linux 4.16-rc1)
+$ git merge spi-nor-fixes/spi-nor/fixes
+Already up to date.
+Merging mfd-fixes/for-mfd-fixes (48a2ca0ee399 Revert "mfd: cros_ec: Use devm_kzalloc for private data")
+$ git merge mfd-fixes/for-mfd-fixes
+Already up to date.
+Merging v4l-dvb-fixes/fixes (7bdf2c8fee51 media: v4l: ioctl: Sanitize num_planes before using it)
+$ git merge v4l-dvb-fixes/fixes
+Auto-merging drivers/media/v4l2-core/v4l2-ioctl.c
+Merge made by the 'recursive' strategy.
+Merging reset-fixes/reset/fixes (26fce0557fa6 reset: imx7: Fix always writing bits as 0)
+$ git merge reset-fixes/reset/fixes
+Already up to date.
+Merging mips-fixes/mips-fixes (f6cab793d4a7 MIPS: Remove custom MIPS32 __kernel_fsid_t type)
+$ git merge mips-fixes/mips-fixes
+Merge made by the 'recursive' strategy.
+ arch/mips/bcm47xx/workarounds.c          |  1 +
+ arch/mips/include/asm/jump_label.h       |  8 ++++----
+ arch/mips/include/uapi/asm/posix_types.h |  7 -------
+ arch/mips/kernel/vmlinux.lds.S           | 12 +++++++-----
+ arch/mips/loongson64/lemote-2f/irq.c     |  2 +-
+ 5 files changed, 13 insertions(+), 17 deletions(-)
+Merging at91-fixes/at91-fixes (bfeffd155283 Linux 5.0-rc1)
+$ git merge at91-fixes/at91-fixes
+Already up to date.
+Merging omap-fixes/fixes (dc30e7039137 ARM: OMAP2+: Variable "reg" in function omap4_dsi_mux_pads() could be uninitialized)
+$ git merge omap-fixes/fixes
+Already up to date.
+Merging kvm-fixes/master (de3ccd26fafc KVM: MMU: record maximum physical address width in kvm_mmu_extended_role)
+$ git merge kvm-fixes/master
+Already up to date.
+Merging kvms390-fixes/master (b10bd9a256ae s390: vsie: Use effective CRYCBD.31 to check CRYCBD validity)
+$ git merge kvms390-fixes/master
+Already up to date.
+Merging hwmon-fixes/hwmon (8d0139ae5973 hwmon: (w83773g) Select REGMAP_I2C to fix build error)
+$ git merge hwmon-fixes/hwmon
+Merge made by the 'recursive' strategy.
+ drivers/hwmon/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+Merging nvdimm-fixes/libnvdimm-fixes (11189c1089da acpi/nfit: Fix command-supported detection)
+$ git merge nvdimm-fixes/libnvdimm-fixes
+Already up to date.
+Merging btrfs-fixes/next-fixes (8c297773d54c Merge branch 'misc-5.1' into next-fixes)
+$ git merge btrfs-fixes/next-fixes
+Merge made by the 'recursive' strategy.
+ fs/btrfs/transaction.c | 49 +++++++++++++++++++++++++++++++++++++++++++------
+ fs/btrfs/tree-log.c    | 24 ++++++++++++++++++++++--
+ fs/btrfs/volumes.c     |  2 +-
+ 3 files changed, 66 insertions(+), 9 deletions(-)
+Merging vfs-fixes/fixes (d3d6a18d7d35 aio: Fix locking in aio_poll())
+$ git merge vfs-fixes/fixes
+Already up to date.
+Merging dma-mapping-fixes/for-linus (60d8cd572f65 arm64/xen: fix xen-swiotlb cache flushing)
+$ git merge dma-mapping-fixes/for-linus
+Already up to date.
+Merging i3c-fixes/master (f36c1f9a8dfd i3c: master: dw: fix deadlock)
+$ git merge i3c-fixes/master
+Already up to date.
+Merging drivers-x86-fixes/fixes (6a730fcb9cb4 Documentation/ABI: Correct mlxreg-io KernelVersion for 5.0)
+$ git merge drivers-x86-fixes/fixes
+Already up to date.
+Merging samsung-krzk-fixes/fixes (bfeffd155283 Linux 5.0-rc1)
+$ git merge samsung-krzk-fixes/fixes
+Already up to date.
+Merging pinctrl-samsung-fixes/pinctrl-fixes (651022382c7f Linux 4.20-rc1)
+$ git merge pinctrl-samsung-fixes/pinctrl-fixes
+Already up to date.
+Merging devicetree-fixes/dt/linus (5fa98c2eda35 dt-bindings: Fix dt_binding_check target for in tree builds)
+$ git merge devicetree-fixes/dt/linus
+Already up to date.
+Merging scsi-fixes/fixes (388b4e6a00bb scsi: core: Avoid that system resume triggers a kernel warning)
+$ git merge scsi-fixes/fixes
+Already up to date.
+Merging drm-fixes/drm-fixes (1c163f4c7b3f Linux 5.0)
+$ git merge drm-fixes/drm-fixes
+Already up to date.
+Merging drm-intel-fixes/for-linux-next-fixes (1c163f4c7b3f Linux 5.0)
+$ git merge drm-intel-fixes/for-linux-next-fixes
+Already up to date.
+Merging mmc-fixes/fixes (e30be063d6db mmc: sdhci-esdhc-imx: correct the fix of ERR004536)
+$ git merge mmc-fixes/fixes
+Already up to date.
+Merging rtc-fixes/rtc-fixes (bfeffd155283 Linux 5.0-rc1)
+$ git merge rtc-fixes/rtc-fixes
+Already up to date.
+Merging gnss-fixes/gnss-linus (bfeffd155283 Linux 5.0-rc1)
+$ git merge gnss-fixes/gnss-linus
+Already up to date.
+Merging hyperv-fixes/hyperv-fixes (bfeffd155283 Linux 5.0-rc1)
+$ git merge hyperv-fixes/hyperv-fixes
+Already up to date.
+Merging drm-misc-fixes/for-linux-next-fixes (3fc6bb043dac drm/vkms: fix use-after-free when drm_gem_handle_create() fails)
+$ git merge drm-misc-fixes/for-linux-next-fixes
+Merge made by the 'recursive' strategy.
+ drivers/gpu/drm/vgem/vgem_drv.c | 6 +-----
+ drivers/gpu/drm/vkms/vkms_gem.c | 5 +----
+ 2 files changed, 2 insertions(+), 9 deletions(-)
+Merging kbuild/for-next (6fb7ef5a343d kbuild: pkg: grep include/config/auto.conf instead of $KCONFIG_CONFIG)
+$ git merge kbuild/for-next
+Already up to date.
+Merging compiler-attributes/compiler-attributes (a3b22b9f11d9 Linux 5.0-rc7)
+$ git merge compiler-attributes/compiler-attributes
+Already up to date.
+Merging leaks/leaks-next (9ac060a708e0 leaking_addresses: Completely remove --version flag)
+$ git merge leaks/leaks-next
+Already up to date.
+Merging dma-mapping/for-next (9eb9e96e97b3 Documentation/DMA-API-HOWTO: update dma_mask sections)
+$ git merge dma-mapping/for-next
+Already up to date.
+Merging asm-generic/master (d724444ab97d asm-generic/page.h: fix typo in #error text requiring a real asm/page.h)
+$ git merge asm-generic/master
+Already up to date.
+Merging arc/for-next (5908e6b738e3 Linux 5.0-rc8)
+$ git merge arc/for-next
+Already up to date.
+Merging arm/for-next (4c2741ac5e10 Merge branches 'fixes', 'misc' and 'smp-hotplug' into for-next)
+$ git merge arm/for-next
+Already up to date.
+Merging arm64/for-next/core (b855b58ac1b7 arm64: mmu: drop paging_init comments)
+$ git merge arm64/for-next/core
+Already up to date.
+Merging arm-perf/for-next/perf (cf2d65ec1d21 perf: xgene: Remove set but not used variable 'config')
+$ git merge arm-perf/for-next/perf
+Already up to date.
+Merging arm-soc/for-next (48d1dbf3918f arm-soc: document merges)
+$ git merge arm-soc/for-next
+Merge made by the 'recursive' strategy.
+ arch/arm/arm-soc-for-next-contents.txt | 259 +++++++++++++++++++++++++++++++++
+ 1 file changed, 259 insertions(+)
+ create mode 100644 arch/arm/arm-soc-for-next-contents.txt
+Merging actions/for-next (fb9c1c1deb5e Merge branch 'v4.20/drivers+s900-sps' into next)
+$ git merge actions/for-next
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging alpine/alpine/for-next (7928b2cbe55b Linux 4.16-rc1)
+$ git merge alpine/alpine/for-next
+Already up to date.
+Merging amlogic/for-next (b32ed5ad1eb8 Merge branch 'v5.2/drivers' into tmp/aml-rebuild)
+$ git merge amlogic/for-next
+Auto-merging arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
+Auto-merging Documentation/devicetree/bindings/vendor-prefixes.txt
+Merge made by the 'recursive' strategy.
+ Documentation/devicetree/bindings/arm/amlogic.txt  |  1 +
+ .../devicetree/bindings/vendor-prefixes.txt        |  1 +
+ arch/arm64/boot/dts/amlogic/Makefile               |  1 +
+ arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts  | 38 +++++++++++++++++++
+ arch/arm64/boot/dts/amlogic/meson-g12a.dtsi        | 19 ++++++++++
+ .../dts/amlogic/meson-gxl-s905d-phicomm-n1.dts     | 10 +++++
+ .../arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts |  4 ++
+ drivers/soc/amlogic/meson-gx-socinfo.c             | 43 ++++++++++++++--------
+ 8 files changed, 101 insertions(+), 16 deletions(-)
+ create mode 100644 arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts
+Merging aspeed/for-next (e15425214990 ARM: dts: aspeed: quanta-q71l: enable uart1)
+$ git merge aspeed/for-next
+Already up to date.
+Merging at91/at91-next (69dd6b9f7d58 Merge branches 'at91-soc' and 'at91-dt' into at91-next)
+$ git merge at91/at91-next
+Auto-merging arch/arm/boot/dts/sama5d2.dtsi
+Merge made by the 'recursive' strategy.
+ .../devicetree/bindings/arm/atmel-at91.txt         |   1 +
+ arch/arm/boot/dts/at91-sama5d2_xplained.dts        |  54 ++++++
+ arch/arm/boot/dts/sama5d2.dtsi                     |   6 +-
+ arch/arm/mach-at91/at91sam9.c                      |  18 ++
+ arch/arm/mach-at91/generic.h                       |   2 +
+ arch/arm/mach-at91/pm.c                            | 193 ++++++++++++++-------
+ arch/arm/mach-at91/pm_suspend.S                    | 111 ++++++++----
+ include/linux/clk/at91_pmc.h                       |   1 +
+ 8 files changed, 289 insertions(+), 97 deletions(-)
+Merging bcm2835/for-next (1ee128f4fff2 Merge branch 'bcm2835-drivers-next' into for-next)
+$ git merge bcm2835/for-next
+Auto-merging arch/arm/boot/dts/Makefile
+Merge made by the 'recursive' strategy.
+Merging imx-mxs/for-next (fe0b295f61af Merge branch 'imx/maintainers' into for-next)
+$ git merge imx-mxs/for-next
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging keystone/next (3c3a43c81bda Merge branch 'for_5.1/soc-drivers' into next)
+$ git merge keystone/next
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging mediatek/for-next (d542127adb0c Merge branch 'v5.0-next/soc' into for-next)
+$ git merge mediatek/for-next
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging mvebu/for-next (c51f7f863552 Merge branch 'mvebu/dt64' into mvebu/for-next)
+$ git merge mvebu/for-next
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging omap/for-next (af3b69ea03a2 Merge branch 'omap-for-v5.1/cpsw' into for-next)
+$ git merge omap/for-next
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging reset/reset/next (dbfc54534dfc dt-bindings: reset: meson: add g12a bindings)
+$ git merge reset/reset/next
+Already up to date.
+Merging qcom/for-next (75920dd0498d Merge tag 'qcom-fixes-for-5.0-rc8' into doof)
+$ git merge qcom/for-next
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging renesas/next (f4435b0d605e Merge branch 'fixes-for-v5.1' into next)
+$ git merge renesas/next
+Auto-merging arch/arm64/boot/dts/renesas/r8a77990.dtsi
+Merge made by the 'recursive' strategy.
+ arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 7 +++----
+ arch/arm64/boot/dts/renesas/r8a77990.dtsi | 7 +++----
+ 2 files changed, 6 insertions(+), 8 deletions(-)
+Merging rockchip/for-next (fa178db056d0 Merge branch 'v5.1-armsoc/dts-fixes' into for-next)
+$ git merge rockchip/for-next
+Merge made by the 'recursive' strategy.
+ .../devicetree/bindings/arm/rockchip.yaml          |   6 +
+ arch/arm/boot/dts/rk3288-tinker-s.dts              |   5 +
+ arch/arm/boot/dts/rk3288-tinker.dtsi               |  40 +-
+ arch/arm/boot/dts/rk3288.dtsi                      |   7 +-
+ arch/arm/boot/dts/rv1108-elgin-r1.dts              |   1 -
+ arch/arm64/boot/dts/rockchip/Makefile              |   2 +
+ arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts     |  36 +-
+ arch/arm64/boot/dts/rockchip/rk3328-rock64.dts     |  36 +-
+ arch/arm64/boot/dts/rockchip/rk3328.dtsi           |  65 +-
+ arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dts  |  67 ++
+ .../arm64/boot/dts/rockchip/rk3399-nanopi-neo4.dts |  50 ++
+ arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi   |  27 +-
+ arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts   | 790 +++++++++++++++++++++
+ arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts  |   6 +
+ arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi   |  45 +-
+ arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts  |   4 +
+ arch/arm64/boot/dts/rockchip/rk3399.dtsi           |   6 +
+ drivers/clk/rockchip/clk-rk3328.c                  |  18 +-
+ 18 files changed, 1143 insertions(+), 68 deletions(-)
+ create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-nanopi-neo4.dts
+ create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
+Merging samsung/for-next (bebc6082da0a Linux 4.14)
+$ git merge samsung/for-next
+Already up to date.
+Merging samsung-krzk/for-next (8ecb112edde9 Merge branch 'fixes-late-dt' into for-next)
+$ git merge samsung-krzk/for-next
+Merge made by the 'recursive' strategy.
+Merging sunxi/sunxi/for-next (1fc3dc289134 Merge remote-tracking branches 'korg/sunxi/sunxi/dt-for-5.1', 'korg/sunxi/sunxi/dt64-for-5.1' and 'korg/sunxi/sunxi/h3-h5-for-5.1' into sunxi/for-next)
+$ git merge sunxi/sunxi/for-next
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging tegra/for-next (d92dde4f12f1 Merge branch for-5.1/fixes into for-next)
+$ git merge tegra/for-next
+Auto-merging arch/arm64/boot/dts/nvidia/tegra186.dtsi
+Merge made by the 'recursive' strategy.
+ arch/arm64/boot/dts/nvidia/tegra186.dtsi | 1 -
+ 1 file changed, 1 deletion(-)
+Merging clk/clk-next (010d5166bbe9 dt-bindings: clock: imx8mq: Fix numbering overlaps and gaps)
+$ git merge clk/clk-next
+Already up to date.
+Merging clk-samsung/for-next (81faa30df9b6 clk: samsung: exynos5433: Add selected IMEM clocks)
+$ git merge clk-samsung/for-next
+Already up to date.
+Merging c6x/for-linux-next (8adcc59974b8 Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs)
+$ git merge c6x/for-linux-next
+Already up to date.
+Merging csky/linux-next (88d5f20a8139 csky: Fixup vdsp&fpu issues in kernel)
+$ git merge csky/linux-next
+Merge made by the 'recursive' strategy.
+ arch/csky/Makefile        | 2 +-
+ arch/csky/abiv2/memmove.S | 6 +-----
+ 2 files changed, 2 insertions(+), 6 deletions(-)
+Merging h8300/h8300-next (21c7acc439b5 h8300: pci: Remove local declaration of pcibios_penalize_isa_irq)
+$ git merge h8300/h8300-next
+Already up to date.
+Merging ia64/next (c51836246f97 ia64: generate uapi header and system call table files)
+$ git merge ia64/next
+Already up to date.
+Merging m68k/for-next (28713169d879 m68k: Add -ffreestanding to CFLAGS)
+$ git merge m68k/for-next
+Already up to date.
+Merging m68knommu/for-next (d7e9d01ac292 m68k: add ColdFire mcf5441x eDMA platform support)
+$ git merge m68knommu/for-next
+Already up to date.
+Merging microblaze/next (226a893bbb1f microblaze: no need to check return value of debugfs_create functions)
+$ git merge microblaze/next
+Already up to date.
+Merging mips/mips-next (aeb669d41ffa MIPS: lantiq: Remove separate GPHY Firmware loader)
+$ git merge mips/mips-next
+Already up to date.
+Merging nds32/next (4e8fa54d3d99 nds32: fix semicolon code style issue)
+$ git merge nds32/next
+Auto-merging arch/nds32/mm/init.c
+Merge made by the 'recursive' strategy.
+ arch/nds32/kernel/cacheinfo.c | 2 +-
+ arch/nds32/mm/init.c          | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+Merging nios2/for-next (21e6bff5e0ef nios2: Fix update_mmu_cache preload the TLB with the new PTE)
+$ git merge nios2/for-next
+Already up to date.
+Merging openrisc/for-next (57ce8ba0fd3a openrisc: Fix broken paths to arch/or32)
+$ git merge openrisc/for-next
+Already up to date.
+Merging parisc-hd/for-next (1c163f4c7b3f Linux 5.0)
+$ git merge parisc-hd/for-next
+Already up to date.
+Merging powerpc/next (de3c83c2fd2b powerpc/64s: Include <asm/nmi.h> header file to fix a warning)
+$ git merge powerpc/next
+Already up to date.
+Merging fsl/next (63d86876f324 Revert "powerpc/fsl_pci: simplify fsl_pci_dma_set_mask")
+$ git merge fsl/next
+Already up to date.
+Merging risc-v-pjw/for-next (467e050e9760 Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux)
+$ git merge risc-v-pjw/for-next
+Already up to date.
+Merging risc-v/for-next (13fd5de06514 RISC-V: Fixmap support and MM cleanups)
+$ git merge risc-v/for-next
+Already up to date.
+Merging sifive/for-next (467e050e9760 Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux)
+$ git merge sifive/for-next
+Already up to date.
+Merging s390/features (152e9b8676c6 s390/vtime: steal time exponential moving average)
+$ git merge s390/features
+Auto-merging arch/s390/kernel/smp.c
+Merge made by the 'recursive' strategy.
+ arch/s390/include/asm/elf.h      | 11 +++++---
+ arch/s390/include/asm/lowcore.h  | 61 ++++++++++++++++++++--------------------
+ arch/s390/kernel/smp.c           |  3 +-
+ arch/s390/kernel/vtime.c         | 19 ++++++++-----
+ drivers/s390/crypto/ap_bus.c     |  9 +++++-
+ drivers/s390/crypto/ap_bus.h     |  2 ++
+ drivers/s390/crypto/ap_queue.c   | 26 +++++++++++++----
+ drivers/s390/crypto/zcrypt_api.c | 30 ++++++++++++--------
+ 8 files changed, 101 insertions(+), 60 deletions(-)
+Merging sparc-next/master (b71acb0e3721 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6)
+$ git merge sparc-next/master
+Already up to date.
+Merging sh/for-next (ac21fc2dcb40 sh: switch to NO_BOOTMEM)
+$ git merge sh/for-next
+Already up to date.
+Merging uml/linux-next (aea05eb56e47 um: Fix for a possible OOPS in ubd initialization)
+$ git merge uml/linux-next
+Already up to date.
+Merging xtensa/xtensa-for-next (036ef74b3ecb Merge branch 'xtensa-5.1' into xtensa-for-next)
+$ git merge xtensa/xtensa-for-next
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging fscrypt/master (129ca2d2a83f MAINTAINERS: add Eric Biggers as an fscrypt maintainer)
+$ git merge fscrypt/master
+Already up to date.
+Merging befs/for-next (55d945e2e4aa fs: befs: btree: Fixed some coding standard issues)
+$ git merge befs/for-next
+Merge made by the 'recursive' strategy.
+ fs/befs/btree.c | 97 ++++++++++++++++++++++++++++++---------------------------
+ 1 file changed, 51 insertions(+), 46 deletions(-)
+Merging btrfs/next (29dcea88779c Linux 4.17)
+$ git merge btrfs/next
+Already up to date.
+Merging btrfs-kdave/for-next (836b12f8c30d Merge branch 'for-next-next-v5.0-20190228' into for-next-20190228)
+$ git merge btrfs-kdave/for-next
+Auto-merging fs/btrfs/volumes.c
+Auto-merging fs/btrfs/transaction.c
+CONFLICT (content): Merge conflict in fs/btrfs/transaction.c
+Auto-merging fs/btrfs/inode.c
+Auto-merging fs/btrfs/extent_io.c
+Auto-merging fs/btrfs/disk-io.c
+Recorded preimage for 'fs/btrfs/transaction.c'
+Automatic merge failed; fix conflicts and then commit the result.
+$ git commit -v -a
+Recorded resolution for 'fs/btrfs/transaction.c'.
+[master 6f8e5b5578a5] Merge remote-tracking branch 'btrfs-kdave/for-next'
+$ git diff -M --stat --summary HEAD^..
+ fs/btrfs/disk-io.c      |  82 ++++++++++++++++-----------
+ fs/btrfs/extent_io.c    | 108 ++++++++++++++++++++++++++++-------
+ fs/btrfs/file.c         |   2 +-
+ fs/btrfs/inode.c        | 146 ++++++++++++++++++++++++++----------------------
+ fs/btrfs/ioctl.c        |  27 +++++----
+ fs/btrfs/props.c        |  32 ++++++++---
+ fs/btrfs/root-tree.c    |  13 +++--
+ fs/btrfs/scrub.c        |   2 +-
+ fs/btrfs/transaction.c  |   6 +-
+ fs/btrfs/tree-checker.c |  24 +++++++-
+ fs/btrfs/tree-checker.h |   8 +++
+ fs/btrfs/volumes.c      |   6 +-
+ fs/btrfs/zstd.c         |  11 ++--
+ 13 files changed, 310 insertions(+), 157 deletions(-)
+Merging ceph/master (d11ae8e0a76a Documentation: modern versions of ceph are not backed by btrfs)
+$ git merge ceph/master
+Already up to date.
+Merging cifs/for-next (e84b8372f041 [SMB3] fix incorrect error code mapping for OBJECTID_NOT_FOUND)
+$ git merge cifs/for-next
+Merge made by the 'recursive' strategy.
+ fs/cifs/cifsfs.c       |   2 +-
+ fs/cifs/file.c         | 148 ++++++++++++++++++++++++++++---------------------
+ fs/cifs/smb2maperror.c |   3 +-
+ 3 files changed, 89 insertions(+), 64 deletions(-)
+Merging configfs/for-next (cc57c07343bd configfs: fix registered group removal)
+$ git merge configfs/for-next
+Already up to date.
+Merging ecryptfs/next (d43388dea04b eCryptfs: fix permission denied with ecryptfs_xattr mount option when create readonly file)
+$ git merge ecryptfs/next
+Auto-merging fs/ecryptfs/crypto.c
+Merge made by the 'recursive' strategy.
+ fs/ecryptfs/crypto.c   | 29 +++++++++++++++++++++++------
+ fs/ecryptfs/keystore.c |  5 +++--
+ 2 files changed, 26 insertions(+), 8 deletions(-)
+Merging ext3/for_next (2337494f7c0f Merge udf cleanup.)
+$ git merge ext3/for_next
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging ext4/dev (6c7328400e04 ext4: report real fs size after failed resize)
+$ git merge ext4/dev
+Auto-merging fs/ext4/super.c
+Auto-merging fs/ext4/inode.c
+Auto-merging fs/ext4/ext4_jbd2.h
+Merge made by the 'recursive' strategy.
+ fs/ext4/ext4_jbd2.h |  2 +-
+ fs/ext4/file.c      |  2 +-
+ fs/ext4/inode.c     | 30 ------------------------------
+ fs/ext4/resize.c    | 17 ++++++++++++++---
+ fs/ext4/super.c     | 16 +++++++++++++---
+ 5 files changed, 29 insertions(+), 38 deletions(-)
+Merging f2fs/dev (aff7b628ac2d f2fs: set pin_file under CAP_SYS_ADMIN)
+$ git merge f2fs/dev
+Already up to date.
+Merging fuse/for-next (fabf7e0262d0 fuse: cache readdir calls if filesystem opts out of opendir)
+$ git merge fuse/for-next
+Already up to date.
+Merging jfs/jfs-next (2e3bc6125154 fs/jfs: Switch to use new generic UUID API)
+$ git merge jfs/jfs-next
+Merge made by the 'recursive' strategy.
+ fs/jfs/acl.c            |  3 ++-
+ fs/jfs/jfs_incore.h     |  6 ++++--
+ fs/jfs/jfs_logmgr.c     | 18 +++++++++---------
+ fs/jfs/jfs_logmgr.h     | 10 +++++-----
+ fs/jfs/jfs_mount.c      |  4 ++--
+ fs/jfs/jfs_superblock.h |  8 ++++----
+ fs/jfs/namei.c          |  2 +-
+ fs/jfs/super.c          |  8 +++++---
+ 8 files changed, 32 insertions(+), 27 deletions(-)
+Merging nfs/linux-next (5e3863fd597e SUNRPC: Remove redundant check for the reply length in call_decode())
+$ git merge nfs/linux-next
+Already up to date.
+Merging nfs-anna/linux-next (a3b22b9f11d9 Linux 5.0-rc7)
+$ git merge nfs-anna/linux-next
+Already up to date.
+Merging nfsd/nfsd-next (f875a792abe9 nfsd: allow nfsv3 readdir request to be larger.)
+$ git merge nfsd/nfsd-next
+Already up to date.
+Merging orangefs/for-next (6e356d45950e orangefs: remove two un-needed BUG_ONs...)
+$ git merge orangefs/for-next
+Already up to date.
+Merging overlayfs/overlayfs-next (993a0b2aec52 ovl: Do not lose security.capability xattr over metadata file copy-up)
+$ git merge overlayfs/overlayfs-next
+Already up to date.
+Merging ubifs/linux-next (5578e48e5c0b ubi: wl: Silence uninitialized variable warning)
+$ git merge ubifs/linux-next
+Already up to date.
+Merging v9fs/9p-next (bb06c388fa20 9p/net: fix memory leak in p9_client_create)
+$ git merge v9fs/9p-next
+Already up to date.
+Merging xfs/for-next (6ef50fe9afae xfs: clean up xfs_dir2_leaf_addname)
+$ git merge xfs/for-next
+Already up to date.
+Merging file-locks/locks-next (bf77ae4c98d7 locks: fix error in locks_move_blocks())
+$ git merge file-locks/locks-next
+Already up to date.
+Merging vfs/for-next (c0abe5af7341 Merge branches 'work.mount', 'work.misc' and 'work.iov_iter' into for-next)
+$ git merge vfs/for-next
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging printk/for-next (943ca6ad81e5 printk/docs: Add extra integer types to printk-formats)
+$ git merge printk/for-next
+Already up to date.
+Merging pci/next (dd92b6677e3d Merge branch 'remotes/lorenzo/pci/vmd')
+$ git merge pci/next
+Already up to date.
+Merging pstore/for-next/pstore (93ee4b7d9f06 pstore/ram: Avoid needless alloc during header write)
+$ git merge pstore/for-next/pstore
+Already up to date.
+Merging hid/for-next (54f97b456ef4 Merge branch 'for-5.1/upstream-fixes' into for-next)
+$ git merge hid/for-next
+Merge made by the 'recursive' strategy.
+ drivers/hid/Kconfig              | 1 +
+ drivers/hid/hid-quirks.c         | 6 +++---
+ drivers/hid/hid-uclogic-params.c | 4 ----
+ 3 files changed, 4 insertions(+), 7 deletions(-)
+Merging i2c/i2c/for-next (560c09843e4f Merge branch 'i2c/for-current-fixed' into i2c/for-next)
+$ git merge i2c/i2c/for-next
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging i3c/i3c/next (988bb4a1937b i3c: master: dw-i3c-master: mark expected switch fall-through)
+$ git merge i3c/i3c/next
+Already up to date.
+Merging dmi/master (57361846b52b Linux 4.19-rc2)
+$ git merge dmi/master
+Already up to date.
+Merging hwmon-staging/hwmon-next (985e225142cf dt-bindings: hwmon: Add missing documentation for lm75)
+$ git merge hwmon-staging/hwmon-next
+Already up to date.
+Merging jc_docs/docs-next (4064174becc0 docs: Bring some order to filesystem documentation)
+$ git merge jc_docs/docs-next
+Already up to date.
+Merging v4l-dvb/master (15d90a6ae98e media: dvb/earth-pt1: fix wrong initialization for demod blocks)
+$ git merge v4l-dvb/master
+Already up to date.
+Merging v4l-dvb-next/master (9fabe1d108ca media: ipu3-mmu: fix some kernel-doc macros)
+$ git merge v4l-dvb-next/master
+Already up to date.
+Merging fbdev/fbdev-for-next (9a9f1d1a81a9 fbdev: mbx: fix a misspelled variable name)
+$ git merge fbdev/fbdev-for-next
+Already up to date.
+Merging pm/linux-next (fa59d1e0bc51 Merge branches 'acpi-scan', 'acpi-misc' and 'acpi-debug' into linux-next)
+$ git merge pm/linux-next
+Merge made by the 'recursive' strategy.
+Merging cpufreq-arm/cpufreq/arm/linux-next (0334906c0696 cpufreq: kryo: Release OPP tables on module removal)
+$ git merge cpufreq-arm/cpufreq/arm/linux-next
+Already up to date.
+Merging cpupower/cpupower (ae2917093fb6 tools/power/cpupower: Display boost frequency separately)
+$ git merge cpupower/cpupower
+Already up to date.
+Merging opp/opp/linux-next (a9a744dd5b82 cpufreq: OMAP: Register an Energy Model)
+$ git merge opp/opp/linux-next
+Already up to date.
+Merging thermal/next (b537f89a9e4b Merge branches 'fixes' and 'thermal-intel' into next)
+$ git merge thermal/next
+Auto-merging drivers/thermal/tegra/soctherm.c
+CONFLICT (content): Merge conflict in drivers/thermal/tegra/soctherm.c
+Auto-merging drivers/thermal/mtk_thermal.c
+CONFLICT (content): Merge conflict in drivers/thermal/mtk_thermal.c
+Recorded preimage for 'drivers/thermal/mtk_thermal.c'
+Recorded preimage for 'drivers/thermal/tegra/soctherm.c'
+Automatic merge failed; fix conflicts and then commit the result.
+$ git commit -v -a
+Recorded resolution for 'drivers/thermal/mtk_thermal.c'.
+Recorded resolution for 'drivers/thermal/tegra/soctherm.c'.
+[master 9eac2f58c420] Merge remote-tracking branch 'thermal/next'
+$ git diff -M --stat --summary HEAD^..
+ drivers/thermal/broadcom/bcm2835_thermal.c          |  9 ++++-----
+ drivers/thermal/cpu_cooling.c                       |  3 +--
+ .../thermal/intel/int340x_thermal/int3400_thermal.c | 21 +++++++++++++++++----
+ drivers/thermal/intel/intel_powerclamp.c            |  2 +-
+ drivers/thermal/mtk_thermal.c                       |  7 +++++--
+ drivers/thermal/samsung/exynos_tmu.c                |  2 +-
+ 6 files changed, 29 insertions(+), 15 deletions(-)
+Merging thermal-soc/next (8834f5600cf3 Linux 5.0-rc5)
+$ git merge thermal-soc/next
+Already up to date.
+Merging ieee1394/for-next (c820518f6ca1 firewire: Remove depends on HAS_DMA in case of platform dependency)
+$ git merge ieee1394/for-next
+Already up to date.
+Merging dlm/next (8526e331c56f dlm: Fix test for -ERESTARTSYS)
+$ git merge dlm/next
+Merge made by the 'recursive' strategy.
+ fs/dlm/lockspace.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+Merging swiotlb/linux-next (22cb45d7692a swiotlb: drop pointless static qualifier in swiotlb_create_debugfs())
+$ git merge swiotlb/linux-next
+Already up to date.
+Merging rdma/for-next (fca22e7e595f net/mlx5: ODP support for XRC transport is not enabled by default in FW)
+$ git merge rdma/for-next
+Already up to date.
+Merging net-next/master (3b319ee220a8 Merge tag 'acpi-5.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm)
+$ git merge net-next/master
+Already up to date.
+Merging bpf-next/master (d9862cfbe209 Merge tag 'mips_5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux)
+$ git merge bpf-next/master
+Already up to date.
+Merging ipsec-next/master (590ce401c207 dt-bindings: net: dsa: ksz9477: fix indentation for switch spi bindings)
+$ git merge ipsec-next/master
+Already up to date.
+Merging mlx5-next/mlx5-next (37b6bb77c6fd net/mlx5: Factor out HCA capabilities functions)
+$ git merge mlx5-next/mlx5-next
+Already up to date.
+Merging netfilter-next/master (8c4238df4d0c Merge branch 'mlxsw-minimal-Add-ethtool-and-resource-query-support')
+$ git merge netfilter-next/master
+Already up to date.
+Merging nfc-next/master (1f008cfec5d5 NFC: fdp: Fix unused variable warnings)
+$ git merge nfc-next/master
+Auto-merging drivers/nfc/fdp/i2c.c
+Merge made by the 'recursive' strategy.
+ drivers/nfc/fdp/fdp.c      | 35 +++++------------------------------
+ drivers/nfc/fdp/i2c.c      | 26 +++++++++++++-------------
+ drivers/nfc/st21nfca/dep.c |  3 ++-
+ drivers/nfc/st21nfca/se.c  |  5 +++--
+ drivers/nfc/st95hf/core.c  |  7 ++-----
+ net/nfc/netlink.c          |  6 ++++--
+ 6 files changed, 29 insertions(+), 53 deletions(-)
+Merging ipvs-next/master (e2f7cc72cbf4 netfilter: conntrack: fix bogus port values for other l4 protocols)
+$ git merge ipvs-next/master
+Already up to date.
+Merging wireless-drivers-next/master (501faf710230 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git)
+$ git merge wireless-drivers-next/master
+Already up to date.
+Merging bluetooth/master (e057ab715f1e Bluetooth: Add return check for L2CAP security level set)
+$ git merge bluetooth/master
+Merge made by the 'recursive' strategy.
+ drivers/bluetooth/Kconfig     |  11 +
+ drivers/bluetooth/Makefile    |   1 +
+ drivers/bluetooth/btmtksdio.c | 979 ++++++++++++++++++++++++++++++++++++++++++
+ drivers/bluetooth/btqca.h     |   2 +-
+ drivers/bluetooth/hci_qca.c   |  45 +-
+ include/linux/mmc/sdio_ids.h  |   2 +
+ net/bluetooth/l2cap_core.c    |   9 +-
+ net/bluetooth/l2cap_sock.c    |   7 +-
+ 8 files changed, 1029 insertions(+), 27 deletions(-)
+ create mode 100644 drivers/bluetooth/btmtksdio.c
+Merging mac80211-next/master (be9cefe796f3 selftests: rtnetlink: use internal netns switch for ip commands)
+$ git merge mac80211-next/master
+Already up to date.
+Merging gfs2/for-next (12ad143e1b80 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip)
+$ git merge gfs2/for-next
+Already up to date.
+Merging mtd/mtd/next (9220d7befc9c Merge tag 'nand/for-5.1' of git://git.infradead.org/linux-mtd into mtd/next)
+$ git merge mtd/mtd/next
+Already up to date.
+Merging nand/nand/next (53bcbb839438 mtd: rawnand: denali_dt: remove single anonymous clock support)
+$ git merge nand/nand/next
+Already up to date.
+Merging spi-nor/spi-nor/next (225c0eda36bd mtd: spi-nor: Fix wrong abbreviation HWCPAS)
+$ git merge spi-nor/spi-nor/next
+Already up to date.
+Merging crypto/master (0918f18c7179 crypto: s5p - add AES support for Exynos5433)
+$ git merge crypto/master
+Already up to date.
+Merging drm/drm-next (0f1d37e65a59 Merge branch 'drm-next-5.1' of git://people.freedesktop.org/~agd5f/linux into drm-next)
+$ git merge drm/drm-next
+Already up to date.
+Merging drm-intel/for-linux-next (ca22f32a6296 drm/i915: Relax mmap VMA check)
+$ git merge drm-intel/for-linux-next
+Already up to date.
+Merging drm-tegra/drm/tegra/for-next (ca52507efc03 drm/tegra: vic: Fix implicit function declaration warning)
+$ git merge drm-tegra/drm/tegra/for-next
+Auto-merging drivers/gpu/drm/tegra/hub.c
+Merge made by the 'recursive' strategy.
+ drivers/gpu/drm/tegra/hub.c | 4 +++-
+ drivers/gpu/drm/tegra/vic.c | 2 ++
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+Merging drm-misc/for-linux-next (c34674a23d1e drm/qxl: remove conflicting framebuffers earlier)
+$ git merge drm-misc/for-linux-next
+Already up to date.
+Merging drm-msm/msm-next (745b19d74716 drm/msm/dpu: check split role for single flush)
+$ git merge drm-msm/msm-next
+Auto-merging drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c
+Auto-merging drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+Auto-merging drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+Merge made by the 'recursive' strategy.
+ drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c           |  69 +-------
+ drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c        | 119 +++++++++++---
+ drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h   |  15 +-
+ .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c   |   5 +-
+ .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c   | 177 ++++++---------------
+ drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h            |   3 -
+ drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c          |   2 +-
+ drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c   |   4 +-
+ drivers/gpu/drm/msm/msm_gem.c                      |   7 +
+ drivers/gpu/drm/msm/msm_gem_vma.c                  |   2 +-
+ drivers/gpu/drm/msm/msm_iommu.c                    |  13 +-
+ 11 files changed, 169 insertions(+), 247 deletions(-)
+Merging hdlcd/for-upstream/hdlcd (d664b851eb2b drm/arm/hdlcd: Reject atomic commits that disable only the plane)
+$ git merge hdlcd/for-upstream/hdlcd
+Already up to date.
+Merging mali-dp/for-upstream/mali-dp (b4a650fb0d72 drm/komeda: Add debugfs node "register" for register dump)
+$ git merge mali-dp/for-upstream/mali-dp
+Merge made by the 'recursive' strategy.
+ drivers/gpu/drm/arm/display/include/malidp_utils.h |  31 +
+ drivers/gpu/drm/arm/display/komeda/Makefile        |   3 +-
+ .../gpu/drm/arm/display/komeda/d71/d71_component.c | 684 +++++++++++++++++++++
+ drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c   | 377 +++++++++++-
+ drivers/gpu/drm/arm/display/komeda/d71/d71_dev.h   |  50 ++
+ drivers/gpu/drm/arm/display/komeda/d71/d71_regs.h  | 530 ++++++++++++++++
+ drivers/gpu/drm/arm/display/komeda/komeda_crtc.c   |  18 +
+ drivers/gpu/drm/arm/display/komeda/komeda_dev.c    |  64 ++
+ drivers/gpu/drm/arm/display/komeda/komeda_dev.h    |  51 ++
+ drivers/gpu/drm/arm/display/komeda/komeda_kms.c    |  38 +-
+ drivers/gpu/drm/arm/display/komeda/komeda_kms.h    |   5 +
+ .../gpu/drm/arm/display/komeda/komeda_pipeline.c   | 111 +++-
+ .../gpu/drm/arm/display/komeda/komeda_pipeline.h   |  48 +-
+ 13 files changed, 1980 insertions(+), 30 deletions(-)
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/d71/d71_component.c
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/d71/d71_dev.h
+ create mode 100644 drivers/gpu/drm/arm/display/komeda/d71/d71_regs.h
+Merging imx-drm/imx-drm/next (a0ea4ffff266 drm/imx: only send commit done event when all state has been applied)
+$ git merge imx-drm/imx-drm/next
+Already up to date.
+Merging etnaviv/etnaviv/next (9e05352340d3 drm/etnaviv: potential NULL dereference)
+$ git merge etnaviv/etnaviv/next
+Already up to date.
+Merging kconfig/for-next (bebc6082da0a Linux 4.14)
+$ git merge kconfig/for-next
+Already up to date.
+Merging regmap/for-next (66fb181d6f82 Merge remote-tracking branch 'regmap/topic/irq' into regmap-next)
+$ git merge regmap/for-next
+Already up to date.
+Merging sound/for-next (2d012c65a9ca ALSA: firewire-motu: use 'version' field of unit directory to identify model)
+$ git merge sound/for-next
+Already up to date.
+Merging sound-asoc/for-next (6e37e89c3d0f Merge branch 'asoc-5.1' into asoc-next)
+$ git merge sound-asoc/for-next
+Auto-merging sound/soc/soc-pcm.c
+Auto-merging sound/soc/sh/rcar/core.c
+Auto-merging sound/soc/intel/skylake/skl-pcm.c
+Merge made by the 'recursive' strategy.
+ include/sound/soc.h                    |   2 +
+ sound/soc/codecs/ab8500-codec.c        |   1 +
+ sound/soc/codecs/hdac_hda.c            |  53 +++++++++++----
+ sound/soc/codecs/hdac_hda.h            |   1 +
+ sound/soc/codecs/hdmi-codec.c          | 121 ++++++++++++++++-----------------
+ sound/soc/codecs/nau8810.c             |   4 +-
+ sound/soc/codecs/nau8824.c             |  46 ++++++++++---
+ sound/soc/intel/skylake/skl-pcm.c      |  19 ++++--
+ sound/soc/mediatek/common/mtk-btcvsd.c |  69 ++++++++++++++++++-
+ sound/soc/samsung/i2s.c                |  10 +--
+ sound/soc/samsung/odroid.c             |   4 +-
+ sound/soc/sh/rcar/core.c               |   2 +
+ sound/soc/sh/rcar/rsnd.h               |   5 ++
+ sound/soc/sh/rcar/src.c                |  21 ++----
+ sound/soc/soc-core.c                   |   2 +
+ sound/soc/soc-pcm.c                    |  47 ++++++++++---
+ sound/soc/stm/stm32_i2s.c              |   3 +-
+ sound/soc/stm/stm32_sai.c              |   8 ++-
+ sound/soc/stm/stm32_sai_sub.c          |  48 ++++++++++---
+ 19 files changed, 330 insertions(+), 136 deletions(-)
+Merging modules/modules-next (1c163f4c7b3f Linux 5.0)
+$ git merge modules/modules-next
+Already up to date.
+Merging input/next (6d3a41ab0c37 Input: edt-ft5x06 - convert to use SPDX identifier)
+$ git merge input/next
+Merge made by the 'recursive' strategy.
+ drivers/input/touchscreen/edt-ft5x06.c | 23 ++++-------------------
+ 1 file changed, 4 insertions(+), 19 deletions(-)
+Merging block/for-next (602d674ce90f nvme-tcp: support C2HData with SUCCESS flag)
+$ git merge block/for-next
+Already up to date.
+Merging device-mapper/for-next (225557446856 dm integrity: limit the rate of error messages)
+$ git merge device-mapper/for-next
+Already up to date.
+Merging pcmcia/pcmcia-next (95691e3eddc4 pcmcia: Implement CLKRUN protocol disabling for Ricoh bridges)
+$ git merge pcmcia/pcmcia-next
+Already up to date.
+Merging mmc/next (d4721339dcca mmc:fix a bug when max_discard is 0)
+$ git merge mmc/next
+Already up to date.
+Merging kgdb/kgdb-next (3bd67b37e350 kdb: print real address of pointers instead of hashed addresses)
+$ git merge kgdb/kgdb-next
+Auto-merging kernel/debug/kdb/kdb_support.c
+Auto-merging kernel/debug/kdb/kdb_main.c
+Auto-merging kernel/debug/kdb/kdb_bt.c
+CONFLICT (content): Merge conflict in kernel/debug/kdb/kdb_bt.c
+Resolved 'kernel/debug/kdb/kdb_bt.c' using previous resolution.
+Automatic merge failed; fix conflicts and then commit the result.
+$ git commit -v -a
+[master d9648882faab] Merge remote-tracking branch 'kgdb/kgdb-next'
+$ git diff -M --stat --summary HEAD^..
+Merging md/for-next (e820d55cb99d md: fix raid10 hang issue caused by barrier)
+$ git merge md/for-next
+Already up to date.
+Merging mfd/for-mfd-next (d2d833e0bf2b mfd: mxs-lradc: Mark expected switch fall-through)
+$ git merge mfd/for-mfd-next
+Already up to date.
+Merging backlight/for-backlight-next (cec2b18832e2 backlight: pwm_bl: Use gpiod_get_value_cansleep() to get initial state)
+$ git merge backlight/for-backlight-next
+Already up to date.
+Merging battery/for-next (655ab0bc462d power: reset: at91-reset: add support for sam9x60 SoC)
+$ git merge battery/for-next
+Already up to date.
+Merging regulator/for-next (93f8d88098bc Merge branch 'regulator-5.1' into regulator-next)
+$ git merge regulator/for-next
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging security/next-testing (3963bdb87e66 Merge branch 'next-general' into next-testing)
+$ git merge security/next-testing
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging apparmor/apparmor-next (6c07c1c74394 apparmor: fix blob compression when ns is forced on a policy load)
+$ git merge apparmor/apparmor-next
+Auto-merging security/apparmor/policy_unpack.c
+Auto-merging security/apparmor/lsm.c
+Auto-merging security/apparmor/apparmorfs.c
+Auto-merging security/apparmor/Kconfig
+Merge made by the 'recursive' strategy.
+ security/apparmor/Kconfig                 |   2 +
+ security/apparmor/apparmorfs.c            | 130 ++++++++++++++++++++++++++++--
+ security/apparmor/include/apparmor.h      |   1 +
+ security/apparmor/include/policy_unpack.h |   8 +-
+ security/apparmor/lsm.c                   |  47 +++++++++++
+ security/apparmor/policy.c                |   3 +-
+ security/apparmor/policy_unpack.c         | 112 ++++++++++++++++++++++++-
+ 7 files changed, 291 insertions(+), 12 deletions(-)
+Merging integrity/next-integrity (e7fde070f39b evm: Use defined constant for UUID representation)
+$ git merge integrity/next-integrity
+Already up to date.
+Merging selinux/next (45189a1998e0 selinux: fix avc audit messages)
+$ git merge selinux/next
+Already up to date.
+Merging tpmdd/next (5812f97c0a22 tpm: Fix the type of the return value in calc_tpm2_event_size())
+$ git merge tpmdd/next
+Merge made by the 'recursive' strategy.
+ drivers/char/tpm/eventlog/tpm2.c           |  4 +-
+ include/keys/trusted.h                     |  2 +-
+ security/keys/trusted.c                    |  4 +-
+ tools/testing/selftests/tpm2/tpm2.py       |  5 ++-
+ tools/testing/selftests/tpm2/tpm2_tests.py | 63 ++++++++++++++++++++++++++++++
+ 5 files changed, 71 insertions(+), 7 deletions(-)
+Merging watchdog/master (458c8961c194 watchdog: w83877f_wdt: Mark expected switch fall-through)
+$ git merge watchdog/master
+Already up to date.
+Merging iommu/next (d05e4c8600c3 Merge branches 'iommu/fixes', 'arm/msm', 'arm/tegra', 'arm/mediatek', 'x86/vt-d', 'x86/amd', 'hyper-v' and 'core' into next)
+$ git merge iommu/next
+Already up to date.
+Merging dwmw2-iommu/master (d8a5b80568a9 Linux 4.15)
+$ git merge dwmw2-iommu/master
+Already up to date.
+Merging vfio/next (0cfd027be1d6 vfio_pci: Enable memory accesses before calling pci_map_rom)
+$ git merge vfio/next
+Already up to date.
+Merging trivial/for-next (75a24b822d38 kfifo: fix inaccurate comment)
+$ git merge trivial/for-next
+Already up to date.
+Merging audit/next (131d34cb0795 audit: mark expected switch fall-through)
+$ git merge audit/next
+Already up to date.
+Merging devicetree/for-next (935665c1a117 of: unittest: unflatten device tree on UML when testing)
+$ git merge devicetree/for-next
+Already up to date.
+Merging mailbox/mailbox-for-next (17b860bbfc84 mailbox: imx: keep MU irq working during suspend/resume)
+$ git merge mailbox/mailbox-for-next
+Already up to date.
+Merging spi/for-next (8cb790a1f4f1 Merge branch 'spi-5.1' into spi-next)
+$ git merge spi/for-next
+Merge made by the 'recursive' strategy.
+ drivers/spi/spi-imx.c        |  2 +-
+ drivers/spi/spi-rspi.c       | 48 ++++++++++++++++++++------------------------
+ drivers/spi/spi-stm32-qspi.c |  4 +---
+ drivers/spi/spi.c            |  2 ++
+ 4 files changed, 26 insertions(+), 30 deletions(-)
+Merging tip/auto-latest (2d8fdbb66245 Merge branch 'x86/uv')
+$ git merge tip/auto-latest
+Auto-merging kernel/sched/fair.c
+Auto-merging kernel/sched/core.c
+Auto-merging drivers/misc/lkdtm/lkdtm.h
+Auto-merging drivers/misc/lkdtm/core.c
+Merge made by the 'recursive' strategy.
+ arch/x86/include/asm/cpu_device_id.h | 31 +++++++------
+ arch/x86/include/asm/special_insns.h | 43 +++++++++++++++++-
+ arch/x86/kernel/cpu/common.c         | 12 +++++-
+ drivers/misc/lkdtm/bugs.c            | 61 ++++++++++++++++++++++++++
+ drivers/misc/lkdtm/core.c            |  1 +
+ drivers/misc/lkdtm/lkdtm.h           |  1 +
+ kernel/sched/core.c                  |  2 +-
+ kernel/sched/cpufreq_schedutil.c     | 58 +++++++++++--------------
+ kernel/sched/fair.c                  | 84 +++++++++++++++++++++++++++---------
+ 9 files changed, 219 insertions(+), 74 deletions(-)
+Merging clockevents/clockevents/next (dbfc6db7ba46 soc/tegra: default select TEGRA_TIMER for Tegra210)
+$ git merge clockevents/clockevents/next
+Auto-merging drivers/clocksource/arm_arch_timer.c
+Auto-merging drivers/clocksource/Makefile
+Auto-merging drivers/clocksource/Kconfig
+Auto-merging Documentation/arm64/silicon-errata.txt
+Merge made by the 'recursive' strategy.
+Merging edac-amd/for-next (580b5cf50ca8 EDAC/altera: Add separate SDRAM EDAC config)
+$ git merge edac-amd/for-next
+Already up to date.
+Merging irqchip/irq/irqchip-next (b41fdc4a7bf9 irqchip/gic: Drop support for secondary GIC in non-DT systems)
+$ git merge irqchip/irq/irqchip-next
+Merge made by the 'recursive' strategy.
+ arch/arm/mach-cns3xxx/core.c       |  2 +-
+ drivers/irqchip/irq-gic.c          | 45 ++++++++++++++------------------------
+ drivers/irqchip/irq-imx-irqsteer.c |  8 +++++--
+ include/linux/irqchip/arm-gic.h    |  3 +--
+ 4 files changed, 24 insertions(+), 34 deletions(-)
+Merging ftrace/for-next (85f726a35e50 tracing: Use strncpy instead of memcpy when copying comm in trace.c)
+$ git merge ftrace/for-next
+Already up to date.
+Merging rcu/rcu/next (e880edadc149 Merge LKMM and RCU)
+$ git merge rcu/rcu/next
+Merge made by the 'recursive' strategy.
+ tools/memory-model/Documentation/explanation.txt | 289 ++++++++++++-----------
+ tools/memory-model/README                        |  33 ++-
+ tools/memory-model/linux-kernel.bell             |  35 ++-
+ tools/memory-model/linux-kernel.cat              |  39 ++-
+ tools/memory-model/linux-kernel.def              |   5 +
+ tools/memory-model/lock.cat                      |   3 -
+ 6 files changed, 243 insertions(+), 161 deletions(-)
+Merging kvm/linux-next (4a605bc08e98 kvm: vmx: fix formatting of a comment)
+$ git merge kvm/linux-next
+Already up to date.
+Merging kvm-arm/next (c88b093693cc arm64: KVM: Fix architecturally invalid reset value for FPEXC32_EL2)
+$ git merge kvm-arm/next
+Already up to date.
+Merging kvm-ppc/kvm-ppc-next (2b57ecd0208f KVM: PPC: Book3S: Add count cache flush parameters to kvmppc_get_cpu_char())
+$ git merge kvm-ppc/kvm-ppc-next
+Already up to date.
+Merging kvms390/next (11ba5961a215 KVM: s390: add debug logging for cpu model subfunctions)
+$ git merge kvms390/next
+Already up to date.
+Merging xen-tip/linux-next (0266def91377 xen/balloon: Fix mapping PG_offline pages to user space)
+$ git merge xen-tip/linux-next
+Already up to date.
+Merging percpu/for-next (d33d9f3dd96b percpu: use chunk scan_hint to skip some scanning)
+$ git merge percpu/for-next
+Merge made by the 'recursive' strategy.
+ include/linux/percpu.h |  12 +-
+ mm/percpu-internal.h   |  15 +-
+ mm/percpu-km.c         |   2 +-
+ mm/percpu-stats.c      |   5 +-
+ mm/percpu.c            | 543 ++++++++++++++++++++++++++++++++++---------------
+ 5 files changed, 400 insertions(+), 177 deletions(-)
+Merging workqueues/for-next (a2775bbc1d58 kernel/workqueue: Use __printf markup to silence compiler in function 'alloc_workqueue')
+$ git merge workqueues/for-next
+Merge made by the 'recursive' strategy.
+ kernel/workqueue.c | 1 +
+ 1 file changed, 1 insertion(+)
+Merging drivers-x86/for-next (9c22cc020db6 MAINTAINERS: Include mlxreg.h in Mellanox Platform Driver files)
+$ git merge drivers-x86/for-next
+Already up to date.
+Merging chrome-platform/for-next (86777c37f05b platform/chrome: Fix locking pattern in wilco_ec_mailbox())
+$ git merge chrome-platform/for-next
+Merge made by the 'recursive' strategy.
+ drivers/platform/chrome/wilco_ec/mailbox.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+Merging hsi/for-next (1ff85bfa1614 HSI: omap_ssi_port: fix debugfs_simple_attr.cocci warnings)
+$ git merge hsi/for-next
+Already up to date.
+Merging leds/for-next (5ddb0869bfc1 leds: lp55xx: fix null deref on firmware load failure)
+$ git merge leds/for-next
+Already up to date.
+Merging ipmi/for-next (487ecb21fa66 ipmi: fix sleep-in-atomic in free_user at cleanup SRCU user->release_barrier)
+$ git merge ipmi/for-next
+Merge made by the 'recursive' strategy.
+ drivers/char/ipmi/ipmi_msghandler.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+Merging driver-core/driver-core-next (a9dce6679d73 Merge tag 'pidfd-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux)
+$ git merge driver-core/driver-core-next
+Already up to date.
+Merging usb/usb-next (a9dce6679d73 Merge tag 'pidfd-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux)
+$ git merge usb/usb-next
+Already up to date.
+Merging usb-gadget/next (5895d311d28f usb: phy: twl6030-usb: fix possible use-after-free on remove)
+$ git merge usb-gadget/next
+Already up to date.
+Merging usb-serial/usb-next (6431866b6707 USB: serial: option: add Telit ME910 ECM composition)
+$ git merge usb-serial/usb-next
+Already up to date.
+Merging usb-chipidea-next/ci-for-usb-next (bc65fae4b1f0 usb: chipidea: imx: set power polarity)
+$ git merge usb-chipidea-next/ci-for-usb-next
+Auto-merging drivers/usb/chipidea/ci_hdrc_imx.c
+Merge made by the 'recursive' strategy.
+Merging phy-next/next (203d9b11928c phy: qcom-qmp: Add QMP UFS PHY support for msm8998)
+$ git merge phy-next/next
+Already up to date.
+Merging tty/tty-next (a9dce6679d73 Merge tag 'pidfd-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux)
+$ git merge tty/tty-next
+Already up to date.
+Merging char-misc/char-misc-next (a9dce6679d73 Merge tag 'pidfd-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux)
+$ git merge char-misc/char-misc-next
+Already up to date.
+Merging extcon/extcon-next (69266982d2ed extcon: Fix build warning for extcon_unregister_notifier comment)
+$ git merge extcon/extcon-next
+Merge made by the 'recursive' strategy.
+ drivers/extcon/Kconfig               |  2 +-
+ drivers/extcon/devres.c              |  2 +-
+ drivers/extcon/extcon-intel-cht-wc.c | 60 ++++++++++++++++++++++++++++++++++--
+ 3 files changed, 60 insertions(+), 4 deletions(-)
+Merging soundwire/next (bfeffd155283 Linux 5.0-rc1)
+$ git merge soundwire/next
+Already up to date.
+Merging thunderbolt/next (2a6d2af3ec96 thunderbolt: Fix a missing check of kmemdup)
+$ git merge thunderbolt/next
+Merge made by the 'recursive' strategy.
+ drivers/thunderbolt/property.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+Merging staging/staging-next (a9dce6679d73 Merge tag 'pidfd-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux)
+$ git merge staging/staging-next
+Already up to date.
+Merging mux/for-next (a1ad5ff63944 Merge branch 'i2c-mux/for-next' into for-next)
+$ git merge mux/for-next
+Auto-merging MAINTAINERS
+Merge made by the 'recursive' strategy.
+Merging icc/icc-next (fcf9d0b7d2f5 drm/msm/a6xx: Add support for an interconnect path)
+$ git merge icc/icc-next
+Already up to date.
+Merging slave-dma/next (58810c58b9e7 Merge branch 'for-linus' into next)
+$ git merge slave-dma/next
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging cgroup/for-next (6a613d24effc cpuset: remove unused task_has_mempolicy())
+$ git merge cgroup/for-next
+Already up to date.
+Merging scsi/for-next (c589c80ade7c Merge branch 'misc' into for-next)
+$ git merge scsi/for-next
+Auto-merging drivers/scsi/qla2xxx/qla_init.c
+Auto-merging drivers/scsi/lpfc/lpfc_nvme.c
+Merge made by the 'recursive' strategy.
+Merging scsi-mkp/for-next (2ee60cf005d8 scsi: ia64: simscsi: use request tag instead of serial_number)
+$ git merge scsi-mkp/for-next
+Merge made by the 'recursive' strategy.
+Merging target-updates/for-next (1c130ae00b76 iscsi-target: make sure to wake up sleeping login worker)
+$ git merge target-updates/for-next
+Already up to date.
+Merging target-bva/for-next (60cc43fc8884 Linux 4.17-rc1)
+$ git merge target-bva/for-next
+Already up to date.
+Merging vhost/linux-next (3fbdb54c7d5a arch: move common mmap flags to linux/mman.h)
+$ git merge vhost/linux-next
+Auto-merging include/drm/drmP.h
+Auto-merging drivers/pci/of.c
+Auto-merging drivers/net/virtio_net.c
+Auto-merging drivers/iommu/Makefile
+CONFLICT (content): Merge conflict in drivers/iommu/Makefile
+Auto-merging drivers/iommu/Kconfig
+CONFLICT (content): Merge conflict in drivers/iommu/Kconfig
+Auto-merging MAINTAINERS
+Resolved 'drivers/iommu/Kconfig' using previous resolution.
+Resolved 'drivers/iommu/Makefile' using previous resolution.
+Automatic merge failed; fix conflicts and then commit the result.
+$ git commit -v -a
+[master e640b9eda00d] Merge remote-tracking branch 'vhost/linux-next'
+$ git diff -M --stat --summary HEAD^..
+ Documentation/devicetree/bindings/virtio/iommu.txt |   66 ++
+ Documentation/devicetree/bindings/virtio/mmio.txt  |   30 +
+ Documentation/memory-barriers.txt                  |   20 +
+ MAINTAINERS                                        |    7 +
+ arch/alpha/include/asm/barrier.h                   |    1 +
+ drivers/iommu/Kconfig                              |   11 +
+ drivers/iommu/Makefile                             |    1 +
+ drivers/iommu/virtio-iommu.c                       | 1158 ++++++++++++++++++++
+ drivers/net/virtio_net.c                           |   27 +-
+ drivers/of/base.c                                  |   10 +-
+ drivers/pci/of.c                                   |    7 +
+ drivers/virtio/virtio_ring.c                       |   13 +-
+ include/asm-generic/barrier.h                      |   18 +
+ include/linux/compiler.h                           |    6 +-
+ include/uapi/linux/virtio_ids.h                    |    1 +
+ include/uapi/linux/virtio_iommu.h                  |  161 +++
+ 16 files changed, 1521 insertions(+), 16 deletions(-)
+ create mode 100644 Documentation/devicetree/bindings/virtio/iommu.txt
+ create mode 100644 drivers/iommu/virtio-iommu.c
+ create mode 100644 include/uapi/linux/virtio_iommu.h
+Merging rpmsg/for-next (6a4ac1cc9997 Merge branches 'hwspinlock-next', 'rpmsg-next' and 'rproc-next' into for-next)
+$ git merge rpmsg/for-next
+Auto-merging Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
+Merge made by the 'recursive' strategy.
+ Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt | 5 +++++
+ drivers/rpmsg/rpmsg_core.c                                | 3 ++-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+Merging gpio/for-next (9e98c678c2d6 Linux 5.1-rc1)
+$ git merge gpio/for-next
+Already up to date.
+Merging gpio-brgl/gpio/for-next (2aa9cd1cb702 gpio: vf610: Don't use explicit &pdev->dev in vf610_gpio_probe())
+$ git merge gpio-brgl/gpio/for-next
+Merge made by the 'recursive' strategy.
+ drivers/gpio/gpio-vf610.c | 85 ++++++++++++++++++++---------------------------
+ 1 file changed, 36 insertions(+), 49 deletions(-)
+Merging pinctrl/for-next (9bc8fee96e9a pinctrl: imx: fix scu link errors)
+$ git merge pinctrl/for-next
+Already up to date.
+Merging pinctrl-samsung/for-next (651022382c7f Linux 4.20-rc1)
+$ git merge pinctrl-samsung/for-next
+Already up to date.
+Merging pwm/for-next (d7d96312fe10 pwm: atmel: Remove useless symbolic definitions)
+$ git merge pwm/for-next
+Already up to date.
+Merging userns/for-next (cf43a757fd49 signal: Restore the stop PTRACE_EVENT_EXIT)
+$ git merge userns/for-next
+Already up to date.
+Merging ktest/for-next (6cd110a91f52 ktest: Take submenu into account for grub2 menus)
+$ git merge ktest/for-next
+Already up to date.
+Merging random/dev (05cbbb6f9ed5 drivers/char/random.c: make primary_crng static)
+$ git merge random/dev
+Auto-merging drivers/char/random.c
+Merge made by the 'recursive' strategy.
+ drivers/char/random.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+Merging kselftest/next (0e27ded1159f selftests/ftrace: Handle the absence of tput)
+$ git merge kselftest/next
+Already up to date.
+Merging y2038/y2038 (a2318b6a16a8 riscv: Use latest system call ABI)
+$ git merge y2038/y2038
+Auto-merging arch/riscv/Kconfig
+Merge made by the 'recursive' strategy.
+Merging livepatching/for-next (b420648f103d Merge branch 'for-5.1-atomic-replace' into for-next)
+$ git merge livepatching/for-next
+Already up to date!
+Merge made by the 'recursive' strategy.
+Merging coresight/next (9127ceeca5eb coresight: catu: fix clang build warning)
+$ git merge coresight/next
+Auto-merging tools/perf/builtin-record.c
+Merge made by the 'recursive' strategy.
+ drivers/hwtracing/coresight/coresight-catu.h    | 5 -----
+ drivers/hwtracing/coresight/coresight-tmc-etr.c | 5 +++--
+ 2 files changed, 3 insertions(+), 7 deletions(-)
+Merging rtc/rtc-next (e91b94fd2bc4 rtc: pic32: convert to SPDX identifier)
+$ git merge rtc/rtc-next
+Already up to date.
+Merging nvdimm/libnvdimm-for-next (1ffc664f9b8c Merge branch 'for-5.1/dax' into libnvdimm-for-next)
+$ git merge nvdimm/libnvdimm-for-next
+Auto-merging fs/dax.c
+CONFLICT (content): Merge conflict in fs/dax.c
+Recorded preimage for 'fs/dax.c'
+Automatic merge failed; fix conflicts and then commit the result.
+$ git commit -v -a
+Recorded resolution for 'fs/dax.c'.
+[master 55a9a2a51d70] Merge remote-tracking branch 'nvdimm/libnvdimm-for-next'
+$ git diff -M --stat --summary HEAD^..
+Merging at24/at24/for-next (950bcbbe3154 eeprom: at24: implement support for 'num-addresses' property)
+$ git merge at24/at24/for-next
+Already up to date.
+Merging ntb/ntb-next (8af642c76ef5 NTB: ntb_test: Fix bug when counting remote files)
+$ git merge ntb/ntb-next
+Auto-merging drivers/ntb/hw/intel/ntb_hw_gen1.c
+Merge made by the 'recursive' strategy.
+ drivers/ntb/hw/amd/ntb_hw_amd.c         |  4 ----
+ drivers/ntb/hw/idt/ntb_hw_idt.c         |  6 ------
+ drivers/ntb/hw/intel/ntb_hw_gen1.c      |  4 ----
+ drivers/ntb/ntb.c                       |  9 ++-------
+ drivers/ntb/test/ntb_perf.c             | 29 ++++++++++++++++++++++-------
+ drivers/ntb/test/ntb_pingpong.c         | 14 ++++++--------
+ drivers/ntb/test/ntb_tool.c             |  9 ++++-----
+ tools/testing/selftests/ntb/ntb_test.sh |  2 +-
+ 8 files changed, 35 insertions(+), 42 deletions(-)
+Merging kspp/for-next/kspp (50ceaa95ea09 lib: Introduce test_stackinit module)
+$ git merge kspp/for-next/kspp
+Already up to date.
+Merging init_task/init_task (e1e871aff3de Expand INIT_STRUCT_PID and remove)
+$ git merge init_task/init_task
+Already up to date.
+Merging cisco/for-next (84a401a27506 Merge branch 'for-x86' into for-next)
+$ git merge cisco/for-next
+Auto-merging init/Kconfig
+Auto-merging arch/x86/kernel/setup.c
+CONFLICT (content): Merge conflict in arch/x86/kernel/setup.c
+Auto-merging arch/x86/Kconfig
+Auto-merging arch/powerpc/kernel/prom.c
+Auto-merging arch/powerpc/configs/skiroot_defconfig
+CONFLICT (content): Merge conflict in arch/powerpc/configs/skiroot_defconfig
+Auto-merging arch/powerpc/Kconfig
+Recorded preimage for 'arch/powerpc/configs/skiroot_defconfig'
+Resolved 'arch/x86/kernel/setup.c' using previous resolution.
+Automatic merge failed; fix conflicts and then commit the result.
+$ git commit -v -a
+Recorded resolution for 'arch/powerpc/configs/skiroot_defconfig'.
+[master fd59dbf1bb48] Merge remote-tracking branch 'cisco/for-next'
+$ git diff -M --stat --summary HEAD^..
+ arch/powerpc/Kconfig                          | 23 +--------
+ arch/powerpc/configs/44x/fsp2_defconfig       | 29 ++++++-----
+ arch/powerpc/configs/44x/iss476-smp_defconfig | 24 ++++-----
+ arch/powerpc/configs/44x/warp_defconfig       | 12 ++---
+ arch/powerpc/configs/holly_defconfig          | 12 ++---
+ arch/powerpc/configs/mvme5100_defconfig       | 25 +++++-----
+ arch/powerpc/configs/skiroot_defconfig        | 27 ++++++----
+ arch/powerpc/configs/storcenter_defconfig     | 15 +++---
+ arch/powerpc/kernel/prom.c                    |  4 ++
+ arch/powerpc/kernel/prom_init.c               |  8 +--
+ arch/powerpc/kernel/prom_init_check.sh        |  2 +-
+ arch/x86/Kconfig                              | 44 +---------------
+ arch/x86/kernel/setup.c                       | 19 ++-----
+ include/linux/cmdline.h                       | 72 +++++++++++++++++++++++++++
+ init/Kconfig                                  | 69 +++++++++++++++++++++++++
+ 15 files changed, 229 insertions(+), 156 deletions(-)
+ create mode 100644 include/linux/cmdline.h
+Merging gnss/gnss-next (d4584bbfcf2a gnss: add driver for mediatek receivers)
+$ git merge gnss/gnss-next
+Already up to date.
+Merging fsi/master (d20810530b71 fsi: fsi-scom.c: Remove duplicate header)
+$ git merge fsi/master
+Already up to date.
+Merging siox/siox/next (1e4b044d2251 Linux 4.18-rc4)
+$ git merge siox/siox/next
+Already up to date.
+Merging slimbus/for-next (81648d8bc222 slimbus: core: add missing spin_lock_init on txn_lock)
+$ git merge slimbus/for-next
+Merge made by the 'recursive' strategy.
+Merging nvmem/for-next (c86d78c459db nvmem: allow to select i.MX nvmem driver for i.MX 7D)
+$ git merge nvmem/for-next
+Auto-merging drivers/nvmem/core.c
+Auto-merging drivers/nvmem/Kconfig
+Merge made by the 'recursive' strategy.
+Merging xarray/xarray (4a5c8d898948 XArray: Fix xa_reserve for 2-byte aligned entries)
+$ git merge xarray/xarray
+Already up to date.
+Merging hyperv/hyperv-next (396ae57ef1ef Drivers: hv: vmbus: Expose counters for interrupts and full conditions)
+$ git merge hyperv/hyperv-next
+Already up to date.
+Merging auxdisplay/auxdisplay (cc5d04d840d6 auxdisplay: charlcd: make backlight initial state configurable)
+$ git merge auxdisplay/auxdisplay
+Merge made by the 'recursive' strategy.
+ drivers/auxdisplay/Kconfig   | 38 ++++++++++++++++++++++++++----
+ drivers/auxdisplay/Makefile  |  2 +-
+ drivers/auxdisplay/charlcd.c | 55 ++++++++++++++++++++++++++++----------------
+ drivers/auxdisplay/hd44780.c |  4 +++-
+ drivers/auxdisplay/panel.c   |  4 ++--
+ include/misc/charlcd.h       |  1 +
+ 6 files changed, 75 insertions(+), 29 deletions(-)
+Merging kgdb-dt/kgdb/for-next (97498c96a186 kgdb/treewide: constify struct kgdb_arch arch_kgdb_ops)
+$ git merge kgdb-dt/kgdb/for-next
+Auto-merging arch/x86/kernel/kgdb.c
+Auto-merging arch/sparc/kernel/smp_64.c
+Auto-merging arch/sh/kernel/kgdb.c
+Auto-merging arch/powerpc/kernel/kgdb.c
+Auto-merging arch/mips/kernel/kgdb.c
+Auto-merging arch/arm64/kernel/kgdb.c
+Merge made by the 'recursive' strategy.
+Merging pidfd/for-next (f67dcc84eb36 selftests: add tests for pidfd_send_signal())
+$ git merge pidfd/for-next
+Auto-merging tools/testing/selftests/Makefile
+Auto-merging kernel/sys_ni.c
+Auto-merging kernel/signal.c
+Auto-merging include/uapi/asm-generic/unistd.h
+CONFLICT (content): Merge conflict in include/uapi/asm-generic/unistd.h
+Auto-merging include/linux/syscalls.h
+Auto-merging fs/proc/base.c
+Auto-merging arch/x86/entry/syscalls/syscall_64.tbl
+CONFLICT (content): Merge conflict in arch/x86/entry/syscalls/syscall_64.tbl
+Auto-merging arch/x86/entry/syscalls/syscall_32.tbl
+CONFLICT (content): Merge conflict in arch/x86/entry/syscalls/syscall_32.tbl
+Recorded preimage for 'arch/x86/entry/syscalls/syscall_32.tbl'
+Recorded preimage for 'arch/x86/entry/syscalls/syscall_64.tbl'
+Recorded preimage for 'include/uapi/asm-generic/unistd.h'
+Automatic merge failed; fix conflicts and then commit the result.
+$ git commit -v -a
+Recorded resolution for 'arch/x86/entry/syscalls/syscall_32.tbl'.
+Recorded resolution for 'arch/x86/entry/syscalls/syscall_64.tbl'.
+Recorded resolution for 'include/uapi/asm-generic/unistd.h'.
+[master 2c1360c60be2] Merge remote-tracking branch 'pidfd/for-next'
+$ git diff -M --stat --summary HEAD^..
+Merging devfreq/for-next (ca740a8f3e7f PM / devfreq: Fix static checker warning in try_then_request_governor)
+$ git merge devfreq/for-next
+Merge made by the 'recursive' strategy.
+ drivers/devfreq/devfreq-event.c      |  2 +-
+ drivers/devfreq/devfreq.c            | 85 +++++++++++++++++++++++-------------
+ drivers/devfreq/event/exynos-ppmu.c  |  2 +-
+ drivers/devfreq/event/rockchip-dfi.c |  2 +-
+ drivers/devfreq/rk3399_dmc.c         |  2 +-
+ drivers/devfreq/tegra-devfreq.c      |  7 +--
+ 6 files changed, 60 insertions(+), 40 deletions(-)
+Merging akpm-current/current (097770be40ca ipc: do cyclic id allocation with ipcmni_extend mode)
+$ git merge --no-ff akpm-current/current
+Auto-merging mm/memory_hotplug.c
+Auto-merging kernel/signal.c
+Auto-merging init/Kconfig
+Auto-merging arch/x86/Kconfig
+Auto-merging arch/powerpc/include/asm/book3s/64/hugetlb.h
+Auto-merging arch/arm/mm/dma-mapping.c
+Merge made by the 'recursive' strategy.
+ Documentation/accounting/psi.txt                |  107 +++
+ Documentation/admin-guide/cgroup-v2.rst         |   20 +-
+ Documentation/admin-guide/kernel-parameters.txt |   16 +
+ Documentation/core-api/genalloc.rst             |    2 +-
+ arch/arm/mm/dma-mapping.c                       |    2 +-
+ arch/arm64/Kconfig                              |    2 +-
+ arch/arm64/include/asm/hugetlb.h                |    7 +-
+ arch/powerpc/include/asm/book3s/64/hugetlb.h    |    4 +-
+ arch/powerpc/kernel/process.c                   |   12 +-
+ arch/powerpc/mm/fault.c                         |    6 +-
+ arch/powerpc/perf/callchain.c                   |   20 +-
+ arch/powerpc/perf/core-book3s.c                 |    8 +-
+ arch/powerpc/platforms/Kconfig.cputype          |    2 +-
+ arch/powerpc/sysdev/fsl_pci.c                   |   10 +-
+ arch/s390/Kconfig                               |    2 +-
+ arch/s390/include/asm/hugetlb.h                 |    7 +-
+ arch/sparc/include/asm/pgtable_64.h             |   30 -
+ arch/x86/Kconfig                                |    2 +-
+ arch/x86/include/asm/hugetlb.h                  |    7 +-
+ drivers/misc/sram-exec.c                        |    2 +-
+ fs/Kconfig                                      |    2 +-
+ fs/buffer.c                                     |   56 +-
+ fs/ocfs2/alloc.c                                |   15 +
+ fs/ocfs2/aops.c                                 |   22 +-
+ fs/ocfs2/dlm/dlmunlock.c                        |   23 +-
+ fs/ramfs/inode.c                                |   12 +
+ include/linux/genalloc.h                        |    2 +-
+ include/linux/gfp.h                             |    2 +-
+ include/linux/hmm.h                             |  290 ++++++-
+ include/linux/ipc_namespace.h                   |    1 +
+ include/linux/list.h                            |   17 +
+ include/linux/memblock.h                        |   41 +
+ include/linux/memcontrol.h                      |   27 +
+ include/linux/mm.h                              |   53 +-
+ include/linux/mm_types.h                        |    3 +
+ include/linux/mmzone.h                          |   59 ++
+ include/linux/psi.h                             |    8 +
+ include/linux/psi_types.h                       |   83 +-
+ include/linux/sched.h                           |   10 +
+ include/linux/sched/signal.h                    |   18 +
+ include/linux/uaccess.h                         |   34 +
+ init/Kconfig                                    |   23 +
+ ipc/ipc_sysctl.c                                |   14 +-
+ ipc/util.c                                      |   27 +-
+ ipc/util.h                                      |   46 +-
+ kernel/cgroup/cgroup.c                          |   95 +-
+ kernel/dma/remap.c                              |    2 +-
+ kernel/fork.c                                   |    1 +
+ kernel/ptrace.c                                 |   15 +-
+ kernel/sched/psi.c                              |  607 +++++++++++--
+ kernel/signal.c                                 |    2 +-
+ kernel/sysctl.c                                 |    6 +-
+ lib/Kconfig.debug                               |    6 +
+ lib/debugobjects.c                              |   66 +-
+ lib/genalloc.c                                  |    5 +-
+ mm/Kconfig                                      |    1 +
+ mm/Makefile                                     |    7 +-
+ mm/compaction.c                                 |    4 +-
+ mm/hmm.c                                        | 1058 +++++++++++++++--------
+ mm/hugetlb.c                                    |   81 +-
+ mm/kasan/kasan.h                                |    5 +-
+ mm/memblock.c                                   |   64 ++
+ mm/memcontrol.c                                 |   27 +-
+ mm/memory.c                                     |    2 +-
+ mm/memory_hotplug.c                             |    3 +
+ mm/mincore.c                                    |   17 +-
+ mm/page_alloc.c                                 |  708 ++++++++-------
+ mm/shuffle.c                                    |  207 +++++
+ mm/shuffle.h                                    |   64 ++
+ mm/swapfile.c                                   |    4 +-
+ mm/vmalloc.c                                    |   32 +-
+ mm/vmscan.c                                     |  108 ++-
+ scripts/checkpatch.pl                           |   24 +-
+ 73 files changed, 3404 insertions(+), 973 deletions(-)
+ create mode 100644 mm/shuffle.c
+ create mode 100644 mm/shuffle.h
+$ git clone -s -l -n -q . ../rebase-tmp
+$ cd ../rebase-tmp
+$ git checkout -b akpm remotes/origin/akpm/master
+Switched to a new branch 'akpm'
+$ git rebase --onto master remotes/origin/akpm/master-base
+First, rewinding head to replay your work on top of it...
+Applying: pinctrl: fix pxa2xx.c build warnings
+Applying: scripts/atomic/gen-atomics.sh: don't assume that scripts are executable
+Applying: fs: fs_parser: fix printk format warning
+Applying: include/linux/sched/signal.h: replace `tsk' with `task'
+Applying: mm, memcg: rename ambiguously named memory.stat counters and functions
+Applying: mm, memcg: consider subtrees in memory.events
+Applying: drivers/media/platform/sti/delta/delta-ipc.c: fix read buffer overflow
+$ cd ../next
+$ git fetch -f ../rebase-tmp akpm:akpm/master
+From ../rebase-tmp
+ + fd1eba6ed08b...a8bf82af9f12 akpm       -> akpm/master  (forced update)
+$ rm -rf ../rebase-tmp
+Merging akpm/master (a8bf82af9f12 drivers/media/platform/sti/delta/delta-ipc.c: fix read buffer overflow)
+$ git merge --no-ff akpm/master
+Merge made by the 'recursive' strategy.
+ Documentation/admin-guide/cgroup-v2.rst      |   9 ++
+ drivers/media/platform/sti/delta/delta-ipc.c |   4 +-
+ drivers/pinctrl/pxa/pinctrl-pxa2xx.c         |   1 +
+ fs/fs_parser.c                               |   2 +-
+ include/linux/cgroup-defs.h                  |   5 +
+ include/linux/memcontrol.h                   |  34 ++++---
+ include/linux/sched/signal.h                 |  51 +++++-----
+ kernel/cgroup/cgroup.c                       |  16 ++-
+ mm/memcontrol.c                              | 144 ++++++++++++++-------------
+ scripts/atomic/gen-atomics.sh                |   2 +-
+ 10 files changed, 153 insertions(+), 115 deletions(-)
diff --git a/Next/quilt-import.log b/Next/quilt-import.log
new file mode 100644
index 000000000000..ebc034a1a1b4
--- /dev/null
+++ b/Next/quilt-import.log
@@ -0,0 +1,2 @@
+Importing dmi based on 4.19-rc2
+Unchanged quilt series dmi
diff --git a/arch/alpha/include/asm/barrier.h b/arch/alpha/include/asm/barrier.h
index 92ec486a4f9e..b4934e8c551b 100644
--- a/arch/alpha/include/asm/barrier.h
+++ b/arch/alpha/include/asm/barrier.h
@@ -59,6 +59,7 @@
  * as Alpha, "y" could be set to 3 and "x" to 0.  Use rmb()
  * in cases like this where there are no data dependencies.
  */
+#define ARCH_NEEDS_READ_BARRIER_DEPENDS 1
 #define read_barrier_depends() __asm__ __volatile__("mb": : :"memory")
 
 #ifdef CONFIG_SMP
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index df55672c59e6..c781e45d1d99 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -144,11 +144,11 @@ config ARC_CPU_770
 	  Support for ARC770 core introduced with Rel 4.10 (Summer 2011)
 	  This core has a bunch of cool new features:
 	  -MMU-v3: Variable Page Sz (4k, 8k, 16k), bigger J-TLB (128x4)
-                   Shared Address Spaces (for sharing TLB entries in MMU)
+	           Shared Address Spaces (for sharing TLB entries in MMU)
 	  -Caches: New Prog Model, Region Flush
 	  -Insns: endian swap, load-locked/store-conditional, time-stamp-ctr
 
-endif	#ISA_ARCOMPACT
+endif #ISA_ARCOMPACT
 
 config ARC_CPU_HS
 	bool "ARC-HS"
@@ -198,7 +198,7 @@ config ARC_SMP_HALT_ON_RESET
 	  at designated entry point. For other case, all jump to common
 	  entry point and spin wait for Master's signal.
 
-endif	#SMP
+endif #SMP
 
 config ARC_MCIP
 	bool "ARConnect Multicore IP (MCIP) Support "
@@ -249,7 +249,7 @@ config ARC_CACHE_VIPT_ALIASING
 	bool "Support VIPT Aliasing D$"
 	depends on ARC_HAS_DCACHE && ISA_ARCOMPACT
 
-endif	#ARC_CACHE
+endif #ARC_CACHE
 
 config ARC_HAS_ICCM
 	bool "Use ICCM"
@@ -370,7 +370,7 @@ config ARC_FPU_SAVE_RESTORE
 	  based on actual usage of FPU by a task. Thus our implemn does
 	  this for all tasks in system.
 
-endif	#ISA_ARCOMPACT
+endif #ISA_ARCOMPACT
 
 config ARC_CANT_LLSC
 	def_bool n
@@ -386,6 +386,15 @@ config ARC_HAS_SWAPE
 
 if ISA_ARCV2
 
+config ARC_USE_UNALIGNED_MEM_ACCESS
+	bool "Enable unaligned access in HW"
+	default y
+	select HAVE_EFFICIENT_UNALIGNED_ACCESS
+	help
+	  The ARC HS architecture supports unaligned memory access
+	  which is disabled by default. Enable unaligned access in
+	  hardware and use software to use it
+
 config ARC_HAS_LL64
 	bool "Insn: 64bit LDD/STD"
 	help
@@ -414,7 +423,7 @@ config ARC_IRQ_NO_AUTOSAVE
 	  This is programmable and can be optionally disabled in which case
 	  software INTERRUPT_PROLOGUE/EPILGUE do the needed work
 
-endif	# ISA_ARCV2
+endif # ISA_ARCV2
 
 endmenu   # "ARC CPU Configuration"
 
diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index df00578c279d..e2b991f75bc5 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -28,6 +28,12 @@ cflags-$(CONFIG_ARC_HAS_SWAPE)		+= -mswape
 
 ifdef CONFIG_ISA_ARCV2
 
+ifdef CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS
+cflags-y				+= -munaligned-access
+else
+cflags-y				+= -mno-unaligned-access
+endif
+
 ifndef CONFIG_ARC_HAS_LL64
 cflags-y				+= -mno-ll64
 endif
diff --git a/arch/arc/boot/dts/abilis_tb100.dtsi b/arch/arc/boot/dts/abilis_tb100.dtsi
index 02410b211433..c0bcd97522bb 100644
--- a/arch/arc/boot/dts/abilis_tb100.dtsi
+++ b/arch/arc/boot/dts/abilis_tb100.dtsi
@@ -38,7 +38,7 @@
 			clock-div = <6>;
 		};
 
-		iomux: iomux@FF10601c {
+		iomux: iomux@ff10601c {
 			/* Port 1 */
 			pctl_tsin_s0: pctl-tsin-s0 {   /* Serial TS-in 0 */
 				abilis,function = "mis0";
@@ -162,182 +162,182 @@
 			};
 		};
 
-		gpioa: gpio@FF140000 {
+		gpioa: gpio@ff140000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF140000 0x1000>;
+			reg = <0xff140000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <3>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpioa";
 		};
-		gpiob: gpio@FF141000 {
+		gpiob: gpio@ff141000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF141000 0x1000>;
+			reg = <0xff141000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <2>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpiob";
 		};
-		gpioc: gpio@FF142000 {
+		gpioc: gpio@ff142000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF142000 0x1000>;
+			reg = <0xff142000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <3>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpioc";
 		};
-		gpiod: gpio@FF143000 {
+		gpiod: gpio@ff143000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF143000 0x1000>;
+			reg = <0xff143000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <2>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpiod";
 		};
-		gpioe: gpio@FF144000 {
+		gpioe: gpio@ff144000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF144000 0x1000>;
+			reg = <0xff144000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <3>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpioe";
 		};
-		gpiof: gpio@FF145000 {
+		gpiof: gpio@ff145000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF145000 0x1000>;
+			reg = <0xff145000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <2>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpiof";
 		};
-		gpiog: gpio@FF146000 {
+		gpiog: gpio@ff146000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF146000 0x1000>;
+			reg = <0xff146000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <3>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpiog";
 		};
-		gpioh: gpio@FF147000 {
+		gpioh: gpio@ff147000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF147000 0x1000>;
+			reg = <0xff147000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <2>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpioh";
 		};
-		gpioi: gpio@FF148000 {
+		gpioi: gpio@ff148000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF148000 0x1000>;
+			reg = <0xff148000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <12>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpioi";
 		};
-		gpioj: gpio@FF149000 {
+		gpioj: gpio@ff149000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF149000 0x1000>;
+			reg = <0xff149000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <32>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpioj";
 		};
-		gpiok: gpio@FF14a000 {
+		gpiok: gpio@ff14a000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF14A000 0x1000>;
+			reg = <0xff14a000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <22>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpiok";
 		};
-		gpiol: gpio@FF14b000 {
+		gpiol: gpio@ff14b000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF14B000 0x1000>;
+			reg = <0xff14b000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <4>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpiol";
 		};
-		gpiom: gpio@FF14c000 {
+		gpiom: gpio@ff14c000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF14C000 0x1000>;
+			reg = <0xff14c000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <4>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpiom";
 		};
-		gpion: gpio@FF14d000 {
+		gpion: gpio@ff14d000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF14D000 0x1000>;
+			reg = <0xff14d000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <5>;
diff --git a/arch/arc/boot/dts/abilis_tb100_dvk.dts b/arch/arc/boot/dts/abilis_tb100_dvk.dts
index 3acf04db8030..c968e677db46 100644
--- a/arch/arc/boot/dts/abilis_tb100_dvk.dts
+++ b/arch/arc/boot/dts/abilis_tb100_dvk.dts
@@ -37,27 +37,27 @@
 	};
 
 	soc100 {
-		uart@FF100000 {
+		uart@ff100000 {
 			pinctrl-names = "default";
 			pinctrl-0 = <&pctl_uart0>;
 		};
-		ethernet@FE100000 {
+		ethernet@fe100000 {
 			phy-mode = "rgmii";
 		};
 
-		i2c0: i2c@FF120000 {
+		i2c0: i2c@ff120000 {
 			i2c-sda-hold-time-ns = <432>;
 		};
-		i2c1: i2c@FF121000 {
+		i2c1: i2c@ff121000 {
 			i2c-sda-hold-time-ns = <432>;
 		};
-		i2c2: i2c@FF122000 {
+		i2c2: i2c@ff122000 {
 			i2c-sda-hold-time-ns = <432>;
 		};
-		i2c3: i2c@FF123000 {
+		i2c3: i2c@ff123000 {
 			i2c-sda-hold-time-ns = <432>;
 		};
-		i2c4: i2c@FF124000 {
+		i2c4: i2c@ff124000 {
 			i2c-sda-hold-time-ns = <432>;
 		};
 
diff --git a/arch/arc/boot/dts/abilis_tb101.dtsi b/arch/arc/boot/dts/abilis_tb101.dtsi
index f9e7686044eb..6a1615f58f05 100644
--- a/arch/arc/boot/dts/abilis_tb101.dtsi
+++ b/arch/arc/boot/dts/abilis_tb101.dtsi
@@ -38,7 +38,7 @@
 			clock-div = <6>;
 		};
 
-		iomux: iomux@FF10601c {
+		iomux: iomux@ff10601c {
 			/* Port 1 */
 			pctl_tsin_s0: pctl-tsin-s0 {   /* Serial TS-in 0 */
 				abilis,function = "mis0";
@@ -171,182 +171,182 @@
 			};
 		};
 
-		gpioa: gpio@FF140000 {
+		gpioa: gpio@ff140000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF140000 0x1000>;
+			reg = <0xff140000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <3>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpioa";
 		};
-		gpiob: gpio@FF141000 {
+		gpiob: gpio@ff141000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF141000 0x1000>;
+			reg = <0xff141000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <2>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpiob";
 		};
-		gpioc: gpio@FF142000 {
+		gpioc: gpio@ff142000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF142000 0x1000>;
+			reg = <0xff142000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <3>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpioc";
 		};
-		gpiod: gpio@FF143000 {
+		gpiod: gpio@ff143000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF143000 0x1000>;
+			reg = <0xff143000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <2>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpiod";
 		};
-		gpioe: gpio@FF144000 {
+		gpioe: gpio@ff144000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF144000 0x1000>;
+			reg = <0xff144000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <3>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpioe";
 		};
-		gpiof: gpio@FF145000 {
+		gpiof: gpio@ff145000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF145000 0x1000>;
+			reg = <0xff145000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <2>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpiof";
 		};
-		gpiog: gpio@FF146000 {
+		gpiog: gpio@ff146000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF146000 0x1000>;
+			reg = <0xff146000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <3>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpiog";
 		};
-		gpioh: gpio@FF147000 {
+		gpioh: gpio@ff147000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF147000 0x1000>;
+			reg = <0xff147000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <2>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpioh";
 		};
-		gpioi: gpio@FF148000 {
+		gpioi: gpio@ff148000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF148000 0x1000>;
+			reg = <0xff148000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <12>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpioi";
 		};
-		gpioj: gpio@FF149000 {
+		gpioj: gpio@ff149000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF149000 0x1000>;
+			reg = <0xff149000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <32>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpioj";
 		};
-		gpiok: gpio@FF14a000 {
+		gpiok: gpio@ff14a000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF14A000 0x1000>;
+			reg = <0xff14a000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <22>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpiok";
 		};
-		gpiol: gpio@FF14b000 {
+		gpiol: gpio@ff14b000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF14B000 0x1000>;
+			reg = <0xff14b000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <4>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpiol";
 		};
-		gpiom: gpio@FF14c000 {
+		gpiom: gpio@ff14c000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF14C000 0x1000>;
+			reg = <0xff14c000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <4>;
 			gpio-ranges = <&iomux 0 0 0>;
 			gpio-ranges-group-names = "gpiom";
 		};
-		gpion: gpio@FF14d000 {
+		gpion: gpio@ff14d000 {
 			compatible = "abilis,tb10x-gpio";
 			interrupt-controller;
 			#interrupt-cells = <1>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <27 2>;
-			reg = <0xFF14D000 0x1000>;
+			reg = <0xff14d000 0x1000>;
 			gpio-controller;
 			#gpio-cells = <2>;
 			abilis,ngpio = <5>;
diff --git a/arch/arc/boot/dts/abilis_tb101_dvk.dts b/arch/arc/boot/dts/abilis_tb101_dvk.dts
index 37d88c5dd181..05143ce9c120 100644
--- a/arch/arc/boot/dts/abilis_tb101_dvk.dts
+++ b/arch/arc/boot/dts/abilis_tb101_dvk.dts
@@ -37,27 +37,27 @@
 	};
 
 	soc100 {
-		uart@FF100000 {
+		uart@ff100000 {
 			pinctrl-names = "default";
 			pinctrl-0 = <&pctl_uart0>;
 		};
-		ethernet@FE100000 {
+		ethernet@fe100000 {
 			phy-mode = "rgmii";
 		};
 
-		i2c0: i2c@FF120000 {
+		i2c0: i2c@ff120000 {
 			i2c-sda-hold-time-ns = <432>;
 		};
-		i2c1: i2c@FF121000 {
+		i2c1: i2c@ff121000 {
 			i2c-sda-hold-time-ns = <432>;
 		};
-		i2c2: i2c@FF122000 {
+		i2c2: i2c@ff122000 {
 			i2c-sda-hold-time-ns = <432>;
 		};
-		i2c3: i2c@FF123000 {
+		i2c3: i2c@ff123000 {
 			i2c-sda-hold-time-ns = <432>;
 		};
-		i2c4: i2c@FF124000 {
+		i2c4: i2c@ff124000 {
 			i2c-sda-hold-time-ns = <432>;
 		};
 
diff --git a/arch/arc/boot/dts/abilis_tb10x.dtsi b/arch/arc/boot/dts/abilis_tb10x.dtsi
index 3121536b25a3..2fbf1bdfe6de 100644
--- a/arch/arc/boot/dts/abilis_tb10x.dtsi
+++ b/arch/arc/boot/dts/abilis_tb10x.dtsi
@@ -54,7 +54,7 @@
 		#size-cells	= <1>;
 		device_type	= "soc";
 		ranges		= <0xfe000000 0xfe000000 0x02000000
-				0x000F0000 0x000F0000 0x00010000>;
+				0x000f0000 0x000f0000 0x00010000>;
 		compatible	= "abilis,tb10x", "simple-bus";
 
 		pll0: oscillator {
@@ -75,10 +75,10 @@
 			clock-output-names = "ahb_clk";
 		};
 
-		iomux: iomux@FF10601c {
+		iomux: iomux@ff10601c {
 			compatible = "abilis,tb10x-iomux";
 			#gpio-range-cells = <3>;
-			reg = <0xFF10601c 0x4>;
+			reg = <0xff10601c 0x4>;
 		};
 
 		intc: interrupt-controller {
@@ -88,7 +88,7 @@
 		};
 		tb10x_ictl: pic@fe002000 {
 			compatible = "abilis,tb10x-ictl";
-			reg = <0xFE002000 0x20>;
+			reg = <0xfe002000 0x20>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
 			interrupt-parent = <&intc>;
@@ -96,27 +96,27 @@
 					20 21 22 23 24 25 26 27 28 29 30 31>;
 		};
 
-		uart@FF100000 {
+		uart@ff100000 {
 			compatible = "snps,dw-apb-uart";
-			reg = <0xFF100000 0x100>;
+			reg = <0xff100000 0x100>;
 			clock-frequency = <166666666>;
 			interrupts = <25 8>;
 			reg-shift = <2>;
 			reg-io-width = <4>;
 			interrupt-parent = <&tb10x_ictl>;
 		};
-		ethernet@FE100000 {
+		ethernet@fe100000 {
 			compatible = "snps,dwmac-3.70a","snps,dwmac";
-			reg = <0xFE100000 0x1058>;
+			reg = <0xfe100000 0x1058>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <6 8>;
 			interrupt-names = "macirq";
 			clocks = <&ahb_clk>;
 			clock-names = "stmmaceth";
 		};
-		dma@FE000000 {
+		dma@fe000000 {
 			compatible = "snps,dma-spear1340";
-			reg = <0xFE000000 0x400>;
+			reg = <0xfe000000 0x400>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <14 8>;
 			dma-channels = <6>;
@@ -132,70 +132,70 @@
 			multi-block = <1 1 1 1 1 1>;
 		};
 
-		i2c0: i2c@FF120000 {
+		i2c0: i2c@ff120000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
 			compatible = "snps,designware-i2c";
-			reg = <0xFF120000 0x1000>;
+			reg = <0xff120000 0x1000>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <12 8>;
 			clocks = <&ahb_clk>;
 		};
-		i2c1: i2c@FF121000 {
+		i2c1: i2c@ff121000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
 			compatible = "snps,designware-i2c";
-			reg = <0xFF121000 0x1000>;
+			reg = <0xff121000 0x1000>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <12 8>;
 			clocks = <&ahb_clk>;
 		};
-		i2c2: i2c@FF122000 {
+		i2c2: i2c@ff122000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
 			compatible = "snps,designware-i2c";
-			reg = <0xFF122000 0x1000>;
+			reg = <0xff122000 0x1000>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <12 8>;
 			clocks = <&ahb_clk>;
 		};
-		i2c3: i2c@FF123000 {
+		i2c3: i2c@ff123000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
 			compatible = "snps,designware-i2c";
-			reg = <0xFF123000 0x1000>;
+			reg = <0xff123000 0x1000>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <12 8>;
 			clocks = <&ahb_clk>;
 		};
-		i2c4: i2c@FF124000 {
+		i2c4: i2c@ff124000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
 			compatible = "snps,designware-i2c";
-			reg = <0xFF124000 0x1000>;
+			reg = <0xff124000 0x1000>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <12 8>;
 			clocks = <&ahb_clk>;
 		};
 
-		spi0: spi@0xFE010000 {
+		spi0: spi@fe010000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
 			cell-index = <0>;
 			compatible = "abilis,tb100-spi";
 			num-cs = <1>;
-			reg = <0xFE010000 0x20>;
+			reg = <0xfe010000 0x20>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <26 8>;
 			clocks = <&ahb_clk>;
 		};
-		spi1: spi@0xFE011000 {
+		spi1: spi@fe011000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
 			cell-index = <1>;
 			compatible = "abilis,tb100-spi";
 			num-cs = <2>;
-			reg = <0xFE011000 0x20>;
+			reg = <0xfe011000 0x20>;
 			interrupt-parent = <&tb10x_ictl>;
 			interrupts = <10 8>;
 			clocks = <&ahb_clk>;
@@ -226,23 +226,23 @@
 			interrupts = <20 2>, <19 2>;
 			interrupt-names = "cmd_irq", "event_irq";
 		};
-		tb10x_mdsc0: tb10x-mdscr@FF300000 {
+		tb10x_mdsc0: tb10x-mdscr@ff300000 {
 			compatible = "abilis,tb100-mdscr";
-			reg = <0xFF300000 0x7000>;
+			reg = <0xff300000 0x7000>;
 			tb100-mdscr-manage-tsin;
 		};
-		tb10x_mscr0: tb10x-mdscr@FF307000 {
+		tb10x_mscr0: tb10x-mdscr@ff307000 {
 			compatible = "abilis,tb100-mdscr";
-			reg = <0xFF307000 0x7000>;
+			reg = <0xff307000 0x7000>;
 		};
 		tb10x_scr0: tb10x-mdscr@ff30e000 {
 			compatible = "abilis,tb100-mdscr";
-			reg = <0xFF30e000 0x4000>;
+			reg = <0xff30e000 0x4000>;
 			tb100-mdscr-manage-tsin;
 		};
 		tb10x_scr1: tb10x-mdscr@ff312000 {
 			compatible = "abilis,tb100-mdscr";
-			reg = <0xFF312000 0x4000>;
+			reg = <0xff312000 0x4000>;
 			tb100-mdscr-manage-tsin;
 		};
 		tb10x_wfb: tb10x-wfb@ff319000 {
diff --git a/arch/arc/boot/dts/axc001.dtsi b/arch/arc/boot/dts/axc001.dtsi
index fdc266504ada..37be3bf03ad6 100644
--- a/arch/arc/boot/dts/axc001.dtsi
+++ b/arch/arc/boot/dts/axc001.dtsi
@@ -41,7 +41,7 @@
 		 * this GPIO block ORs all interrupts on CPU card (creg,..)
 		 * to uplink only 1 IRQ to ARC core intc
 		 */
-		dw-apb-gpio@0x2000 {
+		dw-apb-gpio@2000 {
 			compatible = "snps,dw-apb-gpio";
 			reg = < 0x2000 0x80 >;
 			#address-cells = <1>;
@@ -60,7 +60,7 @@
 			};
 		};
 
-		debug_uart: dw-apb-uart@0x5000 {
+		debug_uart: dw-apb-uart@5000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x5000 0x100>;
 			clock-frequency = <33333000>;
@@ -88,7 +88,7 @@
 	 * avoid duplicating the MB dtsi file given that IRQ from
 	 * this intc to cpu intc are different for axs101 and axs103
 	 */
-	mb_intc: dw-apb-ictl@0xe0012000 {
+	mb_intc: dw-apb-ictl@e0012000 {
 		#interrupt-cells = <1>;
 		compatible = "snps,dw-apb-ictl";
 		reg = < 0x0 0xe0012000 0x0 0x200 >;
diff --git a/arch/arc/boot/dts/axc003.dtsi b/arch/arc/boot/dts/axc003.dtsi
index d75d65ddf8e3..effa37536d7a 100644
--- a/arch/arc/boot/dts/axc003.dtsi
+++ b/arch/arc/boot/dts/axc003.dtsi
@@ -55,7 +55,7 @@
 		 * this GPIO block ORs all interrupts on CPU card (creg,..)
 		 * to uplink only 1 IRQ to ARC core intc
 		 */
-		dw-apb-gpio@0x2000 {
+		dw-apb-gpio@2000 {
 			compatible = "snps,dw-apb-gpio";
 			reg = < 0x2000 0x80 >;
 			#address-cells = <1>;
@@ -74,7 +74,7 @@
 			};
 		};
 
-		debug_uart: dw-apb-uart@0x5000 {
+		debug_uart: dw-apb-uart@5000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x5000 0x100>;
 			clock-frequency = <33333000>;
@@ -102,19 +102,19 @@
 	 * external DMA buffer located outside of IOC aperture.
 	 */
 	axs10x_mb {
-		ethernet@0x18000 {
+		ethernet@18000 {
 			dma-coherent;
 		};
 
-		ehci@0x40000 {
+		ehci@40000 {
 			dma-coherent;
 		};
 
-		ohci@0x60000 {
+		ohci@60000 {
 			dma-coherent;
 		};
 
-		mmc@0x15000 {
+		mmc@15000 {
 			dma-coherent;
 		};
 	};
@@ -132,7 +132,7 @@
 	 * avoid duplicating the MB dtsi file given that IRQ from
 	 * this intc to cpu intc are different for axs101 and axs103
 	 */
-	mb_intc: dw-apb-ictl@0xe0012000 {
+	mb_intc: dw-apb-ictl@e0012000 {
 		#interrupt-cells = <1>;
 		compatible = "snps,dw-apb-ictl";
 		reg = < 0x0 0xe0012000 0x0 0x200 >;
@@ -153,7 +153,7 @@
 		#size-cells = <2>;
 		ranges;
 		/*
-		 * Move frame buffer out of IOC aperture (0x8z-0xAz).
+		 * Move frame buffer out of IOC aperture (0x8z-0xaz).
 		 */
 		frame_buffer: frame_buffer@be000000 {
 			compatible = "shared-dma-pool";
diff --git a/arch/arc/boot/dts/axc003_idu.dtsi b/arch/arc/boot/dts/axc003_idu.dtsi
index a05bb737ea63..e401e59f6180 100644
--- a/arch/arc/boot/dts/axc003_idu.dtsi
+++ b/arch/arc/boot/dts/axc003_idu.dtsi
@@ -62,7 +62,7 @@
 		 * this GPIO block ORs all interrupts on CPU card (creg,..)
 		 * to uplink only 1 IRQ to ARC core intc
 		 */
-		dw-apb-gpio@0x2000 {
+		dw-apb-gpio@2000 {
 			compatible = "snps,dw-apb-gpio";
 			reg = < 0x2000 0x80 >;
 			#address-cells = <1>;
@@ -81,7 +81,7 @@
 			};
 		};
 
-		debug_uart: dw-apb-uart@0x5000 {
+		debug_uart: dw-apb-uart@5000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x5000 0x100>;
 			clock-frequency = <33333000>;
@@ -109,19 +109,19 @@
 	 * external DMA buffer located outside of IOC aperture.
 	 */
 	axs10x_mb {
-		ethernet@0x18000 {
+		ethernet@18000 {
 			dma-coherent;
 		};
 
-		ehci@0x40000 {
+		ehci@40000 {
 			dma-coherent;
 		};
 
-		ohci@0x60000 {
+		ohci@60000 {
 			dma-coherent;
 		};
 
-		mmc@0x15000 {
+		mmc@15000 {
 			dma-coherent;
 		};
 	};
@@ -138,7 +138,7 @@
 	 * avoid duplicating the MB dtsi file given that IRQ from
 	 * this intc to cpu intc are different for axs101 and axs103
 	 */
-	mb_intc: dw-apb-ictl@0xe0012000 {
+	mb_intc: dw-apb-ictl@e0012000 {
 		#interrupt-cells = <1>;
 		compatible = "snps,dw-apb-ictl";
 		reg = < 0x0 0xe0012000 0x0 0x200 >;
@@ -159,7 +159,7 @@
 		#size-cells = <2>;
 		ranges;
 		/*
-		 * Move frame buffer out of IOC aperture (0x8z-0xAz).
+		 * Move frame buffer out of IOC aperture (0x8z-0xaz).
 		 */
 		frame_buffer: frame_buffer@be000000 {
 			compatible = "shared-dma-pool";
diff --git a/arch/arc/boot/dts/axs10x_mb.dtsi b/arch/arc/boot/dts/axs10x_mb.dtsi
index 37bafd44e36d..4ead6dc9af2f 100644
--- a/arch/arc/boot/dts/axs10x_mb.dtsi
+++ b/arch/arc/boot/dts/axs10x_mb.dtsi
@@ -72,7 +72,7 @@
 			};
 		};
 
-		gmac: ethernet@0x18000 {
+		gmac: ethernet@18000 {
 			#interrupt-cells = <1>;
 			compatible = "snps,dwmac";
 			reg = < 0x18000 0x2000 >;
@@ -88,13 +88,13 @@
 			mac-address = [00 00 00 00 00 00]; /* Filled in by U-Boot */
 		};
 
-		ehci@0x40000 {
+		ehci@40000 {
 			compatible = "generic-ehci";
 			reg = < 0x40000 0x100 >;
 			interrupts = < 8 >;
 		};
 
-		ohci@0x60000 {
+		ohci@60000 {
 			compatible = "generic-ohci";
 			reg = < 0x60000 0x100 >;
 			interrupts = < 8 >;
@@ -118,7 +118,7 @@
 		 * dw_mci_pltfm_prepare_command() is used in generic platform
 		 * code.
 		 */
-		mmc@0x15000 {
+		mmc@15000 {
 			compatible = "altr,socfpga-dw-mshc";
 			reg = < 0x15000 0x400 >;
 			fifo-depth = < 16 >;
@@ -129,7 +129,7 @@
 			bus-width = < 4 >;
 		};
 
-		uart@0x20000 {
+		uart@20000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x20000 0x100>;
 			clock-frequency = <33333333>;
@@ -139,7 +139,7 @@
 			reg-io-width = <4>;
 		};
 
-		uart@0x21000 {
+		uart@21000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x21000 0x100>;
 			clock-frequency = <33333333>;
@@ -150,7 +150,7 @@
 		};
 
 		/* UART muxed with USB data port (ttyS3) */
-		uart@0x22000 {
+		uart@22000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x22000 0x100>;
 			clock-frequency = <33333333>;
@@ -160,7 +160,7 @@
 			reg-io-width = <4>;
 		};
 
-		i2c@0x1d000 {
+		i2c@1d000 {
 			compatible = "snps,designware-i2c";
 			reg = <0x1d000 0x100>;
 			clock-frequency = <400000>;
@@ -177,7 +177,7 @@
 			#sound-dai-cells = <0>;
 		};
 
-		i2c@0x1f000 {
+		i2c@1f000 {
 			compatible = "snps,designware-i2c";
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -218,13 +218,13 @@
 				};
 			};
 
-			eeprom@0x54{
+			eeprom@54{
 				compatible = "atmel,24c01";
 				reg = <0x54>;
 				pagesize = <0x8>;
 			};
 
-			eeprom@0x57{
+			eeprom@57{
 				compatible = "atmel,24c04";
 				reg = <0x57>;
 				pagesize = <0x8>;
diff --git a/arch/arc/boot/dts/hsdk.dts b/arch/arc/boot/dts/hsdk.dts
index 43f17b51ee89..69bc1c9e8e50 100644
--- a/arch/arc/boot/dts/hsdk.dts
+++ b/arch/arc/boot/dts/hsdk.dts
@@ -110,12 +110,12 @@
 		cgu_rst: reset-controller@8a0 {
 			compatible = "snps,hsdk-reset";
 			#reset-cells = <1>;
-			reg = <0x8A0 0x4>, <0xFF0 0x4>;
+			reg = <0x8a0 0x4>, <0xff0 0x4>;
 		};
 
 		core_clk: core-clk@0 {
 			compatible = "snps,hsdk-core-pll-clock";
-			reg = <0x00 0x10>, <0x14B8 0x4>;
+			reg = <0x00 0x10>, <0x14b8 0x4>;
 			#clock-cells = <0>;
 			clocks = <&input_clk>;
 
@@ -167,6 +167,18 @@
 			#clock-cells = <0>;
 		};
 
+		dmac_core_clk: dmac-core-clk {
+			compatible = "fixed-clock";
+			clock-frequency = <400000000>;
+			#clock-cells = <0>;
+		};
+
+		dmac_cfg_clk: dmac-gpu-cfg-clk {
+			compatible = "fixed-clock";
+			clock-frequency = <200000000>;
+			#clock-cells = <0>;
+		};
+
 		gmac: ethernet@8000 {
 			#interrupt-cells = <1>;
 			compatible = "snps,dwmac";
@@ -200,6 +212,7 @@
 			compatible = "snps,hsdk-v1.0-ohci", "generic-ohci";
 			reg = <0x60000 0x100>;
 			interrupts = <15>;
+			resets = <&cgu_rst HSDK_USB_RESET>;
 			dma-coherent;
 		};
 
@@ -207,6 +220,7 @@
 			compatible = "snps,hsdk-v1.0-ehci", "generic-ehci";
 			reg = <0x40000 0x100>;
 			interrupts = <15>;
+			resets = <&cgu_rst HSDK_USB_RESET>;
 			dma-coherent;
 		};
 
@@ -237,6 +251,21 @@
 				reg = <0>;
 			};
 		};
+
+		dmac: dmac@80000 {
+			compatible = "snps,axi-dma-1.01a";
+			reg = <0x80000 0x400>;
+			interrupts = <27>;
+			clocks = <&dmac_core_clk>, <&dmac_cfg_clk>;
+			clock-names = "core-clk", "cfgr-clk";
+
+			dma-channels = <4>;
+			snps,dma-masters = <2>;
+			snps,data-width = <3>;
+			snps,block-size = <4096 4096 4096 4096>;
+			snps,priority = <0 1 2 3>;
+			snps,axi-max-burst-len = <16>;
+		};
 	};
 
 	memory@80000000 {
diff --git a/arch/arc/boot/dts/vdk_axc003.dtsi b/arch/arc/boot/dts/vdk_axc003.dtsi
index 0fd6ba985b16..84e8766c8ca2 100644
--- a/arch/arc/boot/dts/vdk_axc003.dtsi
+++ b/arch/arc/boot/dts/vdk_axc003.dtsi
@@ -36,7 +36,7 @@
 			#interrupt-cells = <1>;
 		};
 
-		debug_uart: dw-apb-uart@0x5000 {
+		debug_uart: dw-apb-uart@5000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x5000 0x100>;
 			clock-frequency = <2403200>;
@@ -49,7 +49,7 @@
 
 	};
 
-	mb_intc: dw-apb-ictl@0xe0012000 {
+	mb_intc: dw-apb-ictl@e0012000 {
 		#interrupt-cells = <1>;
 		compatible = "snps,dw-apb-ictl";
 		reg = < 0xe0012000 0x200 >;
diff --git a/arch/arc/boot/dts/vdk_axc003_idu.dtsi b/arch/arc/boot/dts/vdk_axc003_idu.dtsi
index 28956f9a9f3d..eb7e705e8a27 100644
--- a/arch/arc/boot/dts/vdk_axc003_idu.dtsi
+++ b/arch/arc/boot/dts/vdk_axc003_idu.dtsi
@@ -44,7 +44,7 @@
 			#interrupt-cells = <1>;
 		};
 
-		debug_uart: dw-apb-uart@0x5000 {
+		debug_uart: dw-apb-uart@5000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x5000 0x100>;
 			clock-frequency = <2403200>;
@@ -57,7 +57,7 @@
 
 	};
 
-	mb_intc: dw-apb-ictl@0xe0012000 {
+	mb_intc: dw-apb-ictl@e0012000 {
 		#interrupt-cells = <1>;
 		compatible = "snps,dw-apb-ictl";
 		reg = < 0xe0012000 0x200 >;
diff --git a/arch/arc/boot/dts/vdk_axs10x_mb.dtsi b/arch/arc/boot/dts/vdk_axs10x_mb.dtsi
index 48bb4b4cd234..925d5cc95dbb 100644
--- a/arch/arc/boot/dts/vdk_axs10x_mb.dtsi
+++ b/arch/arc/boot/dts/vdk_axs10x_mb.dtsi
@@ -36,7 +36,7 @@
 			};
 		};
 
-		ethernet@0x18000 {
+		ethernet@18000 {
 			#interrupt-cells = <1>;
 			compatible = "snps,dwmac";
 			reg = < 0x18000 0x2000 >;
@@ -49,13 +49,13 @@
 			clock-names = "stmmaceth";
 		};
 
-		ehci@0x40000 {
+		ehci@40000 {
 			compatible = "generic-ehci";
 			reg = < 0x40000 0x100 >;
 			interrupts = < 8 >;
 		};
 
-		uart@0x20000 {
+		uart@20000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x20000 0x100>;
 			clock-frequency = <2403200>;
@@ -65,7 +65,7 @@
 			reg-io-width = <4>;
 		};
 
-		uart@0x21000 {
+		uart@21000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x21000 0x100>;
 			clock-frequency = <2403200>;
@@ -75,7 +75,7 @@
 			reg-io-width = <4>;
 		};
 
-		uart@0x22000 {
+		uart@22000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x22000 0x100>;
 			clock-frequency = <2403200>;
@@ -101,7 +101,7 @@
 			interrupt-names = "arc_ps2_irq";
 		};
 
-		mmc@0x15000 {
+		mmc@15000 {
 			compatible = "snps,dw-mshc";
 			reg = <0x15000 0x400>;
 			fifo-depth = <1024>;
@@ -117,11 +117,11 @@
 	 * Embedded Vision subsystem UIO mappings; only relevant for EV VDK
 	 *
 	 * This node is intentionally put outside of MB above becase
-	 * it maps areas outside of MB's 0xEz-0xFz.
+	 * it maps areas outside of MB's 0xez-0xfz.
 	 */
-	uio_ev: uio@0xD0000000 {
+	uio_ev: uio@d0000000 {
 		compatible = "generic-uio";
-		reg = <0xD0000000 0x2000 0xD1000000 0x2000 0x90000000 0x10000000 0xC0000000 0x10000000>;
+		reg = <0xd0000000 0x2000 0xd1000000 0x2000 0x90000000 0x10000000 0xc0000000 0x10000000>;
 		reg-names = "ev_gsa", "ev_ctrl", "ev_shared_mem", "ev_code_mem";
 		interrupt-parent = <&mb_intc>;
 		interrupts = <23>;
diff --git a/arch/arc/configs/hsdk_defconfig b/arch/arc/configs/hsdk_defconfig
index 6fd3d29546af..0e5fd29ed238 100644
--- a/arch/arc/configs/hsdk_defconfig
+++ b/arch/arc/configs/hsdk_defconfig
@@ -8,6 +8,7 @@ CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
 # CONFIG_PID_NS is not set
 CONFIG_BLK_DEV_INITRD=y
+CONFIG_BLK_DEV_RAM=y
 CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
 # CONFIG_VM_EVENT_COUNTERS is not set
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index a27eafdc8260..a7d4be87b2f0 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -82,6 +82,7 @@
 #define ECR_V_DTLB_MISS			0x05
 #define ECR_V_PROTV			0x06
 #define ECR_V_TRAP			0x09
+#define ECR_V_MISALIGN			0x0d
 #endif
 
 /* DTLB Miss and Protection Violation Cause Codes */
@@ -167,14 +168,6 @@ struct bcr_mpy {
 #endif
 };
 
-struct bcr_extn_xymem {
-#ifdef CONFIG_CPU_BIG_ENDIAN
-	unsigned int ram_org:2, num_banks:4, bank_sz:4, ver:8;
-#else
-	unsigned int ver:8, bank_sz:4, num_banks:4, ram_org:2;
-#endif
-};
-
 struct bcr_iccm_arcompact {
 #ifdef CONFIG_CPU_BIG_ENDIAN
 	unsigned int base:16, pad:5, sz:3, ver:8;
@@ -312,7 +305,7 @@ struct cpuinfo_arc {
 	struct cpuinfo_arc_bpu bpu;
 	struct bcr_identity core;
 	struct bcr_isa_arcv2 isa;
-	const char *details, *name;
+	const char *release, *name;
 	unsigned int vec_base;
 	struct cpuinfo_arc_ccm iccm, dccm;
 	struct {
@@ -322,7 +315,6 @@ struct cpuinfo_arc {
 			     timer0:1, timer1:1, rtc:1, gfrc:1, pad4:4;
 	} extn;
 	struct bcr_mpy extn_mpy;
-	struct bcr_extn_xymem extn_xymem;
 };
 
 extern struct cpuinfo_arc cpuinfo_arc700[];
diff --git a/arch/arc/include/asm/irqflags-arcv2.h b/arch/arc/include/asm/irqflags-arcv2.h
index 8a4f77ea3238..e66d0339e1d8 100644
--- a/arch/arc/include/asm/irqflags-arcv2.h
+++ b/arch/arc/include/asm/irqflags-arcv2.h
@@ -44,7 +44,13 @@
 #define ARCV2_IRQ_DEF_PRIO	1
 
 /* seed value for status register */
-#define ISA_INIT_STATUS_BITS	(STATUS_IE_MASK | STATUS_AD_MASK | \
+#ifdef CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS
+#define __AD_ENB	STATUS_AD_MASK
+#else
+#define __AD_ENB	0
+#endif
+
+#define ISA_INIT_STATUS_BITS	(STATUS_IE_MASK | __AD_ENB | \
 					(ARCV2_IRQ_DEF_PRIO << 1))
 
 #ifndef __ASSEMBLY__
diff --git a/arch/arc/include/asm/perf_event.h b/arch/arc/include/asm/perf_event.h
index 6958545390f0..9cd7ee4fad39 100644
--- a/arch/arc/include/asm/perf_event.h
+++ b/arch/arc/include/asm/perf_event.h
@@ -105,10 +105,10 @@ static const char * const arc_pmu_ev_hw_map[] = {
 	[PERF_COUNT_HW_INSTRUCTIONS] = "iall",
 	/* All jump instructions that are taken */
 	[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = "ijmptak",
-	[PERF_COUNT_ARC_BPOK]         = "bpok",	  /* NP-NT, PT-T, PNT-NT */
 #ifdef CONFIG_ISA_ARCV2
 	[PERF_COUNT_HW_BRANCH_MISSES] = "bpmp",
 #else
+	[PERF_COUNT_ARC_BPOK]         = "bpok",	  /* NP-NT, PT-T, PNT-NT */
 	[PERF_COUNT_HW_BRANCH_MISSES] = "bpfail", /* NP-T, PT-NT, PNT-T */
 #endif
 	[PERF_COUNT_ARC_LDC] = "imemrdc",	/* Instr: mem read cached */
diff --git a/arch/arc/include/asm/spinlock.h b/arch/arc/include/asm/spinlock.h
index 2ba04a7db621..daa914da7968 100644
--- a/arch/arc/include/asm/spinlock.h
+++ b/arch/arc/include/asm/spinlock.h
@@ -21,8 +21,6 @@ static inline void arch_spin_lock(arch_spinlock_t *lock)
 {
 	unsigned int val;
 
-	smp_mb();
-
 	__asm__ __volatile__(
 	"1:	llock	%[val], [%[slock]]	\n"
 	"	breq	%[val], %[LOCKED], 1b	\n"	/* spin while LOCKED */
@@ -34,6 +32,14 @@ static inline void arch_spin_lock(arch_spinlock_t *lock)
 	  [LOCKED]	"r"	(__ARCH_SPIN_LOCK_LOCKED__)
 	: "memory", "cc");
 
+	/*
+	 * ACQUIRE barrier to ensure load/store after taking the lock
+	 * don't "bleed-up" out of the critical section (leak-in is allowed)
+	 * http://www.spinics.net/lists/kernel/msg2010409.html
+	 *
+	 * ARCv2 only has load-load, store-store and all-all barrier
+	 * thus need the full all-all barrier
+	 */
 	smp_mb();
 }
 
@@ -42,8 +48,6 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock)
 {
 	unsigned int val, got_it = 0;
 
-	smp_mb();
-
 	__asm__ __volatile__(
 	"1:	llock	%[val], [%[slock]]	\n"
 	"	breq	%[val], %[LOCKED], 4f	\n"	/* already LOCKED, just bail */
@@ -67,9 +71,7 @@ static inline void arch_spin_unlock(arch_spinlock_t *lock)
 {
 	smp_mb();
 
-	lock->slock = __ARCH_SPIN_LOCK_UNLOCKED__;
-
-	smp_mb();
+	WRITE_ONCE(lock->slock, __ARCH_SPIN_LOCK_UNLOCKED__);
 }
 
 /*
@@ -81,8 +83,6 @@ static inline void arch_read_lock(arch_rwlock_t *rw)
 {
 	unsigned int val;
 
-	smp_mb();
-
 	/*
 	 * zero means writer holds the lock exclusively, deny Reader.
 	 * Otherwise grant lock to first/subseq reader
@@ -113,8 +113,6 @@ static inline int arch_read_trylock(arch_rwlock_t *rw)
 {
 	unsigned int val, got_it = 0;
 
-	smp_mb();
-
 	__asm__ __volatile__(
 	"1:	llock	%[val], [%[rwlock]]	\n"
 	"	brls	%[val], %[WR_LOCKED], 4f\n"	/* <= 0: already write locked, bail */
@@ -140,8 +138,6 @@ static inline void arch_write_lock(arch_rwlock_t *rw)
 {
 	unsigned int val;
 
-	smp_mb();
-
 	/*
 	 * If reader(s) hold lock (lock < __ARCH_RW_LOCK_UNLOCKED__),
 	 * deny writer. Otherwise if unlocked grant to writer
@@ -175,8 +171,6 @@ static inline int arch_write_trylock(arch_rwlock_t *rw)
 {
 	unsigned int val, got_it = 0;
 
-	smp_mb();
-
 	__asm__ __volatile__(
 	"1:	llock	%[val], [%[rwlock]]	\n"
 	"	brne	%[val], %[UNLOCKED], 4f	\n"	/* !UNLOCKED, bail */
@@ -217,17 +211,13 @@ static inline void arch_read_unlock(arch_rwlock_t *rw)
 	: [val]		"=&r"	(val)
 	: [rwlock]	"r"	(&(rw->counter))
 	: "memory", "cc");
-
-	smp_mb();
 }
 
 static inline void arch_write_unlock(arch_rwlock_t *rw)
 {
 	smp_mb();
 
-	rw->counter = __ARCH_RW_LOCK_UNLOCKED__;
-
-	smp_mb();
+	WRITE_ONCE(rw->counter, __ARCH_RW_LOCK_UNLOCKED__);
 }
 
 #else	/* !CONFIG_ARC_HAS_LLSC */
@@ -237,10 +227,9 @@ static inline void arch_spin_lock(arch_spinlock_t *lock)
 	unsigned int val = __ARCH_SPIN_LOCK_LOCKED__;
 
 	/*
-	 * This smp_mb() is technically superfluous, we only need the one
-	 * after the lock for providing the ACQUIRE semantics.
-	 * However doing the "right" thing was regressing hackbench
-	 * so keeping this, pending further investigation
+	 * Per lkmm, smp_mb() is only required after _lock (and before_unlock)
+	 * for ACQ and REL semantics respectively. However EX based spinlocks
+	 * need the extra smp_mb to workaround a hardware quirk.
 	 */
 	smp_mb();
 
@@ -257,14 +246,6 @@ static inline void arch_spin_lock(arch_spinlock_t *lock)
 #endif
 	: "memory");
 
-	/*
-	 * ACQUIRE barrier to ensure load/store after taking the lock
-	 * don't "bleed-up" out of the critical section (leak-in is allowed)
-	 * http://www.spinics.net/lists/kernel/msg2010409.html
-	 *
-	 * ARCv2 only has load-load, store-store and all-all barrier
-	 * thus need the full all-all barrier
-	 */
 	smp_mb();
 }
 
@@ -309,8 +290,7 @@ static inline void arch_spin_unlock(arch_spinlock_t *lock)
 	: "memory");
 
 	/*
-	 * superfluous, but keeping for now - see pairing version in
-	 * arch_spin_lock above
+	 * see pairing version/comment in arch_spin_lock above
 	 */
 	smp_mb();
 }
@@ -344,7 +324,6 @@ static inline int arch_read_trylock(arch_rwlock_t *rw)
 	arch_spin_unlock(&(rw->lock_mutex));
 	local_irq_restore(flags);
 
-	smp_mb();
 	return ret;
 }
 
diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S
index 30e090625916..8f6e0447dd17 100644
--- a/arch/arc/kernel/head.S
+++ b/arch/arc/kernel/head.S
@@ -54,7 +54,12 @@
 	; gcc 7.3.1 (ARC GNU 2018.03) onwards generates unaligned access
 	; by default
 	lr	r5, [status32]
+#ifdef CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS
 	bset	r5, r5, STATUS_AD_BIT
+#else
+	; Although disabled at reset, bootloader might have enabled it
+	bclr	r5, r5, STATUS_AD_BIT
+#endif
 	kflag	r5
 #endif
 .endm
@@ -106,6 +111,7 @@ ENTRY(stext)
 	;    r2 = pointer to uboot provided cmdline or external DTB in mem
 	; These are handled later in handle_uboot_args()
 	st	r0, [@uboot_tag]
+	st      r1, [@uboot_magic]
 	st	r2, [@uboot_arg]
 
 	; setup "current" tsk and optionally cache it in dedicated r25
diff --git a/arch/arc/kernel/intc-arcv2.c b/arch/arc/kernel/intc-arcv2.c
index cf18b3e5a934..c0d0124de089 100644
--- a/arch/arc/kernel/intc-arcv2.c
+++ b/arch/arc/kernel/intc-arcv2.c
@@ -95,7 +95,7 @@ void arc_init_IRQ(void)
 
 	/* setup status32, don't enable intr yet as kernel doesn't want */
 	tmp = read_aux_reg(ARC_REG_STATUS32);
-	tmp |= STATUS_AD_MASK | (ARCV2_IRQ_DEF_PRIO << 1);
+	tmp |= ARCV2_IRQ_DEF_PRIO << 1;
 	tmp &= ~STATUS_IE_MASK;
 	asm volatile("kflag %0	\n"::"r"(tmp));
 }
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index 7b2340996cf8..a9c88b7e9182 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -36,6 +36,7 @@ unsigned int intr_to_DE_cnt;
 
 /* Part of U-boot ABI: see head.S */
 int __initdata uboot_tag;
+int __initdata uboot_magic;
 char __initdata *uboot_arg;
 
 const struct machine_desc *machine_desc;
@@ -44,29 +45,24 @@ struct task_struct *_current_task[NR_CPUS];	/* For stack switching */
 
 struct cpuinfo_arc cpuinfo_arc700[NR_CPUS];
 
-static const struct id_to_str arc_cpu_rel[] = {
+static const struct id_to_str arc_legacy_rel[] = {
+	/* ID.ARCVER,	Release */
 #ifdef CONFIG_ISA_ARCOMPACT
-	{ 0x34, "R4.10"},
-	{ 0x35, "R4.11"},
+	{ 0x34, 	"R4.10"},
+	{ 0x35, 	"R4.11"},
 #else
-	{ 0x51, "R2.0" },
-	{ 0x52, "R2.1" },
-	{ 0x53, "R3.0" },
-	{ 0x54, "R3.10a" },
+	{ 0x51, 	"R2.0" },
+	{ 0x52, 	"R2.1" },
+	{ 0x53,		"R3.0" },
 #endif
-	{ 0x00, NULL   }
+	{ 0x00,		NULL   }
 };
 
-static const struct id_to_str arc_cpu_nm[] = {
-#ifdef CONFIG_ISA_ARCOMPACT
-	{ 0x20, "ARC 600"   },
-	{ 0x30, "ARC 770"   },  /* 750 identified seperately */
-#else
-	{ 0x40, "ARC EM"  },
-	{ 0x50, "ARC HS38"  },
-	{ 0x54, "ARC HS48"  },
-#endif
-	{ 0x00, "Unknown"   }
+static const struct id_to_str arc_cpu_rel[] = {
+	/* UARCH.MAJOR,	Release */
+	{  0,		"R3.10a"},
+	{  1,		"R3.50a"},
+	{  0xFF,	NULL   }
 };
 
 static void read_decode_ccm_bcr(struct cpuinfo_arc *cpu)
@@ -116,31 +112,72 @@ static void read_decode_ccm_bcr(struct cpuinfo_arc *cpu)
 	}
 }
 
+static void decode_arc_core(struct cpuinfo_arc *cpu)
+{
+	struct bcr_uarch_build_arcv2 uarch;
+	const struct id_to_str *tbl;
+
+	/*
+	 * Up until (including) the first core4 release (0x54) things were
+	 * simple: AUX IDENTITY.ARCVER was sufficient to identify arc family
+	 * and release: 0x50 to 0x53 was HS38, 0x54 was HS48 (dual issue)
+	 */
+
+	if (cpu->core.family < 0x54) { /* includes arc700 */
+
+		for (tbl = &arc_legacy_rel[0]; tbl->id != 0; tbl++) {
+			if (cpu->core.family == tbl->id) {
+				cpu->release = tbl->str;
+				break;
+			}
+		}
+
+		if (is_isa_arcompact())
+			cpu->name = "ARC700";
+		else if (tbl->str)
+			cpu->name = "HS38";
+		else
+			cpu->name = cpu->release = "Unknown";
+
+		return;
+	}
+
+	/*
+	 * However the subsequent HS release (same 0x54) allow HS38 or HS48
+	 * configurations and encode this info in a different BCR.
+	 * The BCR was introduced in 0x54 so can't be read unconditionally.
+	 */
+
+	READ_BCR(ARC_REG_MICRO_ARCH_BCR, uarch);
+
+	if (uarch.prod == 4) {
+		cpu->name = "HS48";
+		cpu->extn.dual = 1;
+
+	} else {
+		cpu->name = "HS38";
+	}
+
+	for (tbl = &arc_cpu_rel[0]; tbl->id != 0xFF; tbl++) {
+		if (uarch.maj == tbl->id) {
+			cpu->release = tbl->str;
+			break;
+		}
+	}
+}
+
 static void read_arc_build_cfg_regs(void)
 {
 	struct bcr_timer timer;
 	struct bcr_generic bcr;
 	struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()];
-	const struct id_to_str *tbl;
 	struct bcr_isa_arcv2 isa;
 	struct bcr_actionpoint ap;
 
 	FIX_PTR(cpu);
 
 	READ_BCR(AUX_IDENTITY, cpu->core);
-
-	for (tbl = &arc_cpu_rel[0]; tbl->id != 0; tbl++) {
-		if (cpu->core.family == tbl->id) {
-			cpu->details = tbl->str;
-			break;
-		}
-	}
-
-	for (tbl = &arc_cpu_nm[0]; tbl->id != 0; tbl++) {
-		if ((cpu->core.family & 0xF4) == tbl->id)
-			break;
-	}
-	cpu->name = tbl->str;
+	decode_arc_core(cpu);
 
 	READ_BCR(ARC_REG_TIMERS_BCR, timer);
 	cpu->extn.timer0 = timer.t0;
@@ -151,16 +188,6 @@ static void read_arc_build_cfg_regs(void)
 
 	READ_BCR(ARC_REG_MUL_BCR, cpu->extn_mpy);
 
-	cpu->extn.norm = read_aux_reg(ARC_REG_NORM_BCR) > 1 ? 1 : 0; /* 2,3 */
-	cpu->extn.barrel = read_aux_reg(ARC_REG_BARREL_BCR) > 1 ? 1 : 0; /* 2,3 */
-	cpu->extn.swap = read_aux_reg(ARC_REG_SWAP_BCR) ? 1 : 0;        /* 1,3 */
-	cpu->extn.crc = read_aux_reg(ARC_REG_CRC_BCR) ? 1 : 0;
-	cpu->extn.minmax = read_aux_reg(ARC_REG_MIXMAX_BCR) > 1 ? 1 : 0; /* 2 */
-	cpu->extn.swape = (cpu->core.family >= 0x34) ? 1 :
-				IS_ENABLED(CONFIG_ARC_HAS_SWAPE);
-
-	READ_BCR(ARC_REG_XY_MEM_BCR, cpu->extn_xymem);
-
 	/* Read CCM BCRs for boot reporting even if not enabled in Kconfig */
 	read_decode_ccm_bcr(cpu);
 
@@ -198,30 +225,12 @@ static void read_arc_build_cfg_regs(void)
 		cpu->bpu.num_pred = 2048 << bpu.pte;
 		cpu->bpu.ret_stk = 4 << bpu.rse;
 
-		if (cpu->core.family >= 0x54) {
-
-			struct bcr_uarch_build_arcv2 uarch;
-
-			/*
-			 * The first 0x54 core (uarch maj:min 0:1 or 0:2) was
-			 * dual issue only (HS4x). But next uarch rev (1:0)
-			 * allows it be configured for single issue (HS3x)
-			 * Ensure we fiddle with dual issue only on HS4x
-			 */
-			READ_BCR(ARC_REG_MICRO_ARCH_BCR, uarch);
-
-			if (uarch.prod == 4) {
-				unsigned int exec_ctrl;
-
-				/* dual issue hardware always present */
-				cpu->extn.dual = 1;
-
-				READ_BCR(AUX_EXEC_CTRL, exec_ctrl);
+		/* if dual issue hardware, is it enabled ? */
+		if (cpu->extn.dual) {
+			unsigned int exec_ctrl;
 
-				/* dual issue hardware enabled ? */
-				cpu->extn.dual_enb = !(exec_ctrl & 1);
-
-			}
+			READ_BCR(AUX_EXEC_CTRL, exec_ctrl);
+			cpu->extn.dual_enb = !(exec_ctrl & 1);
 		}
 	}
 
@@ -263,7 +272,8 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len)
 {
 	struct cpuinfo_arc *cpu = &cpuinfo_arc700[cpu_id];
 	struct bcr_identity *core = &cpu->core;
-	int i, n = 0, ua = 0;
+	char mpy_opt[16];
+	int n = 0;
 
 	FIX_PTR(cpu);
 
@@ -272,7 +282,7 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len)
 		       core->family, core->cpu_id, core->chip_id);
 
 	n += scnprintf(buf + n, len - n, "processor [%d]\t: %s %s (%s ISA) %s%s%s\n",
-		       cpu_id, cpu->name, cpu->details,
+		       cpu_id, cpu->name, cpu->release,
 		       is_isa_arcompact() ? "ARCompact" : "ARCv2",
 		       IS_AVAIL1(cpu->isa.be, "[Big-Endian]"),
 		       IS_AVAIL3(cpu->extn.dual, cpu->extn.dual_enb, " Dual-Issue "));
@@ -283,61 +293,50 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len)
 		       IS_AVAIL2(cpu->extn.rtc, "RTC [UP 64-bit] ", CONFIG_ARC_TIMERS_64BIT),
 		       IS_AVAIL2(cpu->extn.gfrc, "GFRC [SMP 64-bit] ", CONFIG_ARC_TIMERS_64BIT));
 
-#ifdef __ARC_UNALIGNED__
-	ua = 1;
-#endif
-	n += i = scnprintf(buf + n, len - n, "%s%s%s%s%s%s",
-			   IS_AVAIL2(cpu->isa.atomic, "atomic ", CONFIG_ARC_HAS_LLSC),
-			   IS_AVAIL2(cpu->isa.ldd, "ll64 ", CONFIG_ARC_HAS_LL64),
-			   IS_AVAIL1(cpu->isa.unalign, "unalign "), IS_USED_RUN(ua));
-
-	if (i)
-		n += scnprintf(buf + n, len - n, "\n\t\t: ");
-
 	if (cpu->extn_mpy.ver) {
-		if (cpu->extn_mpy.ver <= 0x2) {	/* ARCompact */
-			n += scnprintf(buf + n, len - n, "mpy ");
+		if (is_isa_arcompact()) {
+			scnprintf(mpy_opt, 16, "mpy");
 		} else {
+
 			int opt = 2;	/* stock MPY/MPYH */
 
 			if (cpu->extn_mpy.dsp)	/* OPT 7-9 */
 				opt = cpu->extn_mpy.dsp + 6;
 
-			n += scnprintf(buf + n, len - n, "mpy[opt %d] ", opt);
+			scnprintf(mpy_opt, 16, "mpy[opt %d] ", opt);
 		}
 	}
 
 	n += scnprintf(buf + n, len - n, "%s%s%s%s%s%s%s%s\n",
-		       IS_AVAIL1(cpu->isa.div_rem, "div_rem "),
-		       IS_AVAIL1(cpu->extn.norm, "norm "),
-		       IS_AVAIL1(cpu->extn.barrel, "barrel-shift "),
-		       IS_AVAIL1(cpu->extn.swap, "swap "),
-		       IS_AVAIL1(cpu->extn.minmax, "minmax "),
-		       IS_AVAIL1(cpu->extn.crc, "crc "),
-		       IS_AVAIL2(cpu->extn.swape, "swape", CONFIG_ARC_HAS_SWAPE));
-
-	if (cpu->bpu.ver)
+		       IS_AVAIL2(cpu->isa.atomic, "atomic ", CONFIG_ARC_HAS_LLSC),
+		       IS_AVAIL2(cpu->isa.ldd, "ll64 ", CONFIG_ARC_HAS_LL64),
+		       IS_AVAIL2(cpu->isa.unalign, "unalign ", CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS),
+		       IS_AVAIL1(cpu->extn_mpy.ver, mpy_opt),
+		       IS_AVAIL1(cpu->isa.div_rem, "div_rem "));
+
+	if (cpu->bpu.ver) {
 		n += scnprintf(buf + n, len - n,
 			      "BPU\t\t: %s%s match, cache:%d, Predict Table:%d Return stk: %d",
 			      IS_AVAIL1(cpu->bpu.full, "full"),
 			      IS_AVAIL1(!cpu->bpu.full, "partial"),
 			      cpu->bpu.num_cache, cpu->bpu.num_pred, cpu->bpu.ret_stk);
 
-	if (is_isa_arcv2()) {
-		struct bcr_lpb lpb;
+		if (is_isa_arcv2()) {
+			struct bcr_lpb lpb;
 
-		READ_BCR(ARC_REG_LPB_BUILD, lpb);
-		if (lpb.ver) {
-			unsigned int ctl;
-			ctl = read_aux_reg(ARC_REG_LPB_CTRL);
+			READ_BCR(ARC_REG_LPB_BUILD, lpb);
+			if (lpb.ver) {
+				unsigned int ctl;
+				ctl = read_aux_reg(ARC_REG_LPB_CTRL);
 
-			n += scnprintf(buf + n, len - n, " Loop Buffer:%d %s",
-				lpb.entries,
-				IS_DISABLED_RUN(!ctl));
+				n += scnprintf(buf + n, len - n, " Loop Buffer:%d %s",
+					       lpb.entries,
+					       IS_DISABLED_RUN(!ctl));
+			}
 		}
+		n += scnprintf(buf + n, len - n, "\n");
 	}
 
-	n += scnprintf(buf + n, len - n, "\n");
 	return buf;
 }
 
@@ -390,11 +389,6 @@ static char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len)
 		}
 	}
 
-	n += scnprintf(buf + n, len - n, "OS ABI [v%d]\t: %s\n",
-			EF_ARC_OSABI_CURRENT >> 8,
-			EF_ARC_OSABI_CURRENT == EF_ARC_OSABI_V3 ?
-			"no-legacy-syscalls" : "64-bit data any register aligned");
-
 	return buf;
 }
 
@@ -497,6 +491,8 @@ static inline bool uboot_arg_invalid(unsigned long addr)
 #define UBOOT_TAG_NONE		0
 #define UBOOT_TAG_CMDLINE	1
 #define UBOOT_TAG_DTB		2
+/* We always pass 0 as magic from U-boot */
+#define UBOOT_MAGIC_VALUE	0
 
 void __init handle_uboot_args(void)
 {
@@ -511,6 +507,11 @@ void __init handle_uboot_args(void)
 		goto ignore_uboot_args;
 	}
 
+	if (uboot_magic != UBOOT_MAGIC_VALUE) {
+		pr_warn(IGNORE_ARGS "non zero uboot magic\n");
+		goto ignore_uboot_args;
+	}
+
 	if (uboot_tag != UBOOT_TAG_NONE &&
             uboot_arg_invalid((unsigned long)uboot_arg)) {
 		pr_warn(IGNORE_ARGS "invalid uboot arg: '%px'\n", uboot_arg);
diff --git a/arch/arc/kernel/troubleshoot.c b/arch/arc/kernel/troubleshoot.c
index 215f515442e0..b0aa8c028331 100644
--- a/arch/arc/kernel/troubleshoot.c
+++ b/arch/arc/kernel/troubleshoot.c
@@ -145,7 +145,8 @@ static void show_ecr_verbose(struct pt_regs *regs)
 	} else if (vec == ECR_V_PROTV) {
 		if (cause_code == ECR_C_PROTV_INST_FETCH)
 			pr_cont("Execute from Non-exec Page\n");
-		else if (cause_code == ECR_C_PROTV_MISALIG_DATA)
+		else if (cause_code == ECR_C_PROTV_MISALIG_DATA &&
+		         IS_ENABLED(CONFIG_ISA_ARCOMPACT))
 			pr_cont("Misaligned r/w from 0x%08lx\n", address);
 		else
 			pr_cont("%s access not allowed on page\n",
@@ -161,6 +162,8 @@ static void show_ecr_verbose(struct pt_regs *regs)
 			pr_cont("Bus Error from Data Mem\n");
 		else
 			pr_cont("Bus Error, check PRM\n");
+	} else if (vec == ECR_V_MISALIGN) {
+		pr_cont("Misaligned r/w from 0x%08lx\n", address);
 #endif
 	} else if (vec == ECR_V_TRAP) {
 		if (regs->ecr_param == 5)
diff --git a/arch/arc/lib/Makefile b/arch/arc/lib/Makefile
index b1656d156097..f7537b466b23 100644
--- a/arch/arc/lib/Makefile
+++ b/arch/arc/lib/Makefile
@@ -8,4 +8,10 @@
 lib-y	:= strchr-700.o strcpy-700.o strlen.o memcmp.o
 
 lib-$(CONFIG_ISA_ARCOMPACT)	+= memcpy-700.o memset.o strcmp.o
-lib-$(CONFIG_ISA_ARCV2)		+= memcpy-archs.o memset-archs.o strcmp-archs.o
+lib-$(CONFIG_ISA_ARCV2)		+= memset-archs.o strcmp-archs.o
+
+ifdef CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS
+lib-$(CONFIG_ISA_ARCV2)		+=memcpy-archs-unaligned.o
+else
+lib-$(CONFIG_ISA_ARCV2)		+=memcpy-archs.o
+endif
diff --git a/arch/arc/lib/memcpy-archs-unaligned.S b/arch/arc/lib/memcpy-archs-unaligned.S
new file mode 100644
index 000000000000..28993a73fdde
--- /dev/null
+++ b/arch/arc/lib/memcpy-archs-unaligned.S
@@ -0,0 +1,47 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * ARCv2 memcpy implementation optimized for unaligned memory access using.
+ *
+ * Copyright (C) 2019 Synopsys
+ * Author: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
+ */
+
+#include <linux/linkage.h>
+
+#ifdef CONFIG_ARC_HAS_LL64
+# define LOADX(DST,RX)		ldd.ab	DST, [RX, 8]
+# define STOREX(SRC,RX)		std.ab	SRC, [RX, 8]
+# define ZOLSHFT		5
+# define ZOLAND			0x1F
+#else
+# define LOADX(DST,RX)		ld.ab	DST, [RX, 4]
+# define STOREX(SRC,RX)		st.ab	SRC, [RX, 4]
+# define ZOLSHFT		4
+# define ZOLAND			0xF
+#endif
+
+ENTRY_CFI(memcpy)
+	mov	r3, r0		; don;t clobber ret val
+
+	lsr.f	lp_count, r2, ZOLSHFT
+	lpnz	@.Lcopy32_64bytes
+	;; LOOP START
+	LOADX	(r6, r1)
+	LOADX	(r8, r1)
+	LOADX	(r10, r1)
+	LOADX	(r4, r1)
+	STOREX	(r6, r3)
+	STOREX	(r8, r3)
+	STOREX	(r10, r3)
+	STOREX	(r4, r3)
+.Lcopy32_64bytes:
+
+	and.f	lp_count, r2, ZOLAND ;Last remaining 31 bytes
+	lpnz	@.Lcopyremainingbytes
+	;; LOOP START
+	ldb.ab	r5, [r1, 1]
+	stb.ab	r5, [r3, 1]
+.Lcopyremainingbytes:
+
+	j	[blink]
+END_CFI(memcpy)
diff --git a/arch/arc/plat-eznps/Kconfig b/arch/arc/plat-eznps/Kconfig
index 8eff057efcae..2eaecfb063a7 100644
--- a/arch/arc/plat-eznps/Kconfig
+++ b/arch/arc/plat-eznps/Kconfig
@@ -26,8 +26,8 @@ config EZNPS_MTM_EXT
 	help
 	  Here we add new hierarchy for CPUs topology.
 	  We got:
-		Core
-		Thread
+	    Core
+	    Thread
 	  At the new thread level each CPU represent one HW thread.
 	  At highest hierarchy each core contain 16 threads,
 	  any of them seem like CPU from Linux point of view.
@@ -35,10 +35,10 @@ config EZNPS_MTM_EXT
 	  core and HW scheduler round robin between them.
 
 config EZNPS_MEM_ERROR_ALIGN
-       bool "ARC-EZchip Memory error as an exception"
-       depends on EZNPS_MTM_EXT
-       default n
-       help
+	bool "ARC-EZchip Memory error as an exception"
+	depends on EZNPS_MTM_EXT
+	default n
+	help
 	  On the real chip of the NPS, user memory errors are handled
 	  as a machine check exception, which is fatal, whereas on
 	  simulator platform for NPS, is handled as a Level 2 interrupt
diff --git a/arch/arm/arm-soc-for-next-contents.txt b/arch/arm/arm-soc-for-next-contents.txt
new file mode 100644
index 000000000000..3c08e1ccd653
--- /dev/null
+++ b/arch/arm/arm-soc-for-next-contents.txt
@@ -0,0 +1,259 @@
+arm/soc
+	patch
+		arch/arm/mach-ep93xx: Remove duplicate header
+	arm/pxa/soc
+		https://github.com/rjarzmik/linux tags/pxa-for-5.1
+	<no branch> (17ffc1193a4b5610400c43623a43115f3d2e15a6)
+		git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux tags/imx-maintainers-5.1
+	arm/imx/soc
+		git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux tags/imx-soc-5.1
+	arm/davinci/soc
+		git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci tags/davinci-for-v5.1/soc-part2
+	arm/amlogic/soc
+		git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic tags/amlogic-soc
+	arm/samsung/soc
+		git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux tags/samsung-soc-5.1
+	arm/mvebu/arm64
+		git://git.infradead.org/linux-mvebu tags/mvebu-arm64-5.1-1
+	arm/mediatek/soc
+		git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux tags/v5.0-next-soc
+	arm/tegra/soc-resume
+		git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux tags/tegra-for-5.1-arm-core
+	arm/renesas/soc
+		git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-arm-soc-for-v5.1
+	arm/lpc32xx/soc
+		https://github.com/vzapolskiy/linux-lpc32xx tags/lpc32xx-soc-for-5.1
+	patch
+		MAINTAINERS: Update Ampere email address
+
+arm/dt
+	arm/stm32/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32 tags/stm32-dt-for-v4.21-1
+	patch
+		ARM: dts: Kill off skeleton{64}.dtsi
+		arm64: dts: Remove inconsistent use of 'arm,armv8' compatible string
+	arm/nomadik/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik tags/nomadik-dts-v5.1
+	arm/integrator/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator tags/integrator-dts-v5.1
+	arm/renesas/64
+		git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-arm64-dt-for-v5.1
+	arm/sunxi/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux tags/sunxi-dt-for-5.1
+	arm/sunxi/dt64
+		git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux tags/sunxi-dt64-for-5.1
+	arm/aspeed/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/joel/aspeed tags/aspeed-5.1-devicetree
+	arm/vexpress/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux tags/vexpress-updates-5.1
+	arm/juno/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux tags/juno-updates-5.1
+	arm/omap/dt-soc-81xx
+		git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap tags/omap-for-v5.1/soc-ti-81xx-signed
+	arm/omap/dt-81xx
+		git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap tags/omap-for-v5.1/dt-ti-81xx-signed
+	arm/omap/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap tags/omap-for-v5.1/dt-signed
+	arm/davinci/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci tags/davinci-for-v5.1/dt
+	arm/am654/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/kristo/linux tags/am654-for-v5.1
+	arm/rockchip/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip tags/v5.1-rockchip-dts32-1
+	arm/rockchip/dt64
+		git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip tags/v5.1-rockchip-dts64-1
+	arm/stm32/dt2
+		git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32 tags/stm32-dt-for-v5.1-1
+	arm/samsung/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux tags/samsung-dt-5.1
+	arm/broadcom/dt
+		https://github.com/Broadcom/stblinux tags/arm-soc/for-5.1/devicetree
+	arm/broadcom/dt-arm64
+		https://github.com/Broadcom/stblinux tags/arm-soc/for-5.1/devicetree-arm64
+	arm/lpc32xx/dt
+		https://github.com/vzapolskiy/linux-lpc32xx tags/lpc32xx-dt-for-5.1
+	arm/qcom/dt64
+		git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux tags/qcom-arm64-for-5.1
+	arm/qcom/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux tags/qcom-dts-for-5.1
+	arm/hisi/dt
+		git://github.com/hisilicon/linux-hisi tags/hisi-arm64-dt-for-5.1v2
+	arm/socfpga/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux tags/socfpga_dts_for_v5.1
+	arm/sunxi/dt-h3-h5
+		git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux tags/sunxi-h3-h5-for-5.1
+	arm/sunxi/dt64-2
+		git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux tags/sunxi-dt64-for-5.1-2
+	arm/sunxi/dt-2
+		git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux tags/sunxi-dt-for-5.1-2
+	arm/renesas/dt64-2
+		git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-arm64-dt2-for-v5.1
+	arm/renesas/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-arm-dt-for-v5.1
+	arm/tegra/dt-bindings
+		git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux tags/tegra-for-5.1-dt-bindings
+	arm/tegra/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux tags/tegra-for-5.1-arm-dt
+	arm/tegra/dt64
+		git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux tags/tegra-for-5.1-arm64-dt
+	arm/mediatek/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux tags/v5.0-next-dts32
+	arm/mediatek/dt64
+		git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux tags/v5.0-next-dts64
+	arm/mvebu/dt64
+		git://git.infradead.org/linux-mvebu tags/mvebu-dt64-5.1-1
+	arm/mvebu/dt
+		git://git.infradead.org/linux-mvebu tags/mvebu-dt-5.1-1
+	arm/amlogic/dt64
+		git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic tags/amlogic-dt64
+	arm/amlogic/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic tags/amlogic-dt
+	arm/imx/dt-bindings
+		git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux tags/imx-bindings-5.1
+	arm/imx/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux tags/imx-dt-5.1
+	arm/imx/dt64
+		git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux tags/imx-dt64-5.1
+	arm/zynqmp/dt
+		https://github.com/Xilinx/linux-xlnx tags/zynqmp-dt-for-v5.1
+	arm/zynq/dt
+		https://github.com/Xilinx/linux-xlnx tags/zynq-dt-for-v5.1
+	arm/at91/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux tags/at91-5.1-dt
+	arm/uniphier/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier tags/uniphier-dt64-v5.1
+	arm/omap/dt-2
+		git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap tags/omap-for-v5.1/dt-pt2-signed
+	arm/ti/dt64-2
+		git://git.kernel.org/pub/scm/linux/kernel/git/kristo/linux tags/am654-for-v5.1-part2
+	arm/qcom/dt64-2
+		git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux tags/qcom-arm64-for-5.1
+	arm/qcom/dt-2
+		git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux tags/qcom-dts-for-5.1-2
+	arm/rockchip/dt-2
+		git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip tags/v5.1-rockchip-dts32-2
+	arm/rockchip/dt64-2
+		git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip tags/v5.1-rockchip-dts64-2
+	patch
+		arm64: dts: sprd: Remove PMIC INTC irq trigger type
+		arm64: dts: sprd: Add ADC calibration support
+		arm64: dts: sprd: Add SC2731 charger device
+		arm64: dts: sprd: Add SC27XX fuel gauge device
+		arm64: dts: sprd: Remove wildcard compatible string
+	arm/renesas/dt-bindings
+		git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-dt-bindings-for-v5.1
+	arm/samsung/dt-2
+		git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux tags/samsung-dt-5.1-2
+	arm/actions/dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/mani/linux-actions tags/actions-arm64-dt-for-v5.1
+	arm/omap/cpsw-dt
+		git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap tags/omap-for-v5.1/dt-cpsw-phy
+	arm/mvebu/dt-2
+		git://git.infradead.org/linux-mvebu tags/mvebu-dt-5.1-2
+	patch
+		ARM: dts: exynos: Fix max voltage for buck8 regulator on Odroid XU3/XU4
+
+arm/drivers
+	arm/fsl/drivers
+		git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux tags/soc-fsl-next-v5.1-2
+	arm/xilinx/zynqmp-soc
+		https://github.com/Xilinx/linux-xlnx tags/zynqmp-soc-for-v5.1
+	arm/imx/drivers
+		git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux tags/imx-drivers-5.1
+	arm/amlogic/drivers
+		git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic tags/amlogic-drivers
+	drivers/reset
+		git://git.pengutronix.de/git/pza/linux tags/reset-for-5.1
+	arm/tegra/firmware
+		git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux tags/tegra-for-5.1-firmware
+	arm/tegra/soc
+		git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux tags/tegra-for-5.1-soc
+	arm/tegra/cpufreq
+		git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux tags/tegra-for-5.1-cpufreq
+	arm/tegra/clk
+		git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux tags/tegra-for-5.1-clk
+	arm/hisi/driver
+		git://github.com/hisilicon/linux-hisi tags/hisi-drivers-for-5.1
+	drivers/tee
+		https://git.linaro.org/people/jens.wiklander/linux-tee tags/tee-bus-for-5.1
+	arm/qualcomm/drivers
+		git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux tags/qcom-drivers-for-5.1
+	arm/broadcom/drivers
+		https://github.com/Broadcom/stblinux tags/arm-soc/for-5.1/drivers
+	arm/keystone/drivers
+		git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone tags/drivers_soc_for_5.1
+	arm/qcom/drivers-2
+		git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux tags/qcom-drivers-for-5.1-2
+	arm/qcom/drivers-3
+		git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux tags/qcom-drivers-for-5.1-3
+	patch
+		clk: tegra: dfll: Make symbol 'tegra210_cpu_cvb_tables' static
+	arm/freescale/drivers-4
+		git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux tags/soc-fsl-next-v5.1-3
+	patch
+		tee: optee: Initialize some structs using memset instead of braces
+		hwrng: optee: Initialize some structs using memset instead of braces
+		tee: fix possible error pointer ctx dereferencing
+		hwrng: Fix unsigned comparison with less than zero
+		tee: optee: Fix unsigned comparison with less than zero
+		hwrng: make symbol 'optee_rng_id_table' static
+	drivers/tee-2
+		https://git.linaro.org/people/jens.wiklander/linux-tee tags/tee-misc-for-v5.1
+	fsl/drivers-4
+		git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux tags/soc-fsl-next-v5.1-4
+
+arm/defconfig
+	patch
+		ARM: defconfig: axm55xx: Drop PL11x graphics driver
+		ARM: defconfig: Enable PL11x DRM driver on multi_v7
+		arm64: defconfig: Switch to PL11x DRM driver
+		ARM: multi_v7_defconfig: enable GCC plugin support and structleak plugin
+	arm/omap/defconfig
+		git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap tags/omap-for-v5.1/defconfig-signed
+	arm/imx/defconfig
+		git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux tags/imx-defconfig-5.1
+	arm/tegra/defconfig
+		git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux tags/tegra-for-5.1-arm64-defconfig
+	arm/renesas/defconfig
+		git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-arm-defconfig-for-v5.1
+	arm/renesas/defconfig-arm64
+		git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-arm64-defconfig-for-v5.1
+	arm/sunxi/defconfig
+		git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux tags/sunxi-config64-for-5.1
+	arm/socfpga/defconfig
+		git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux socfpga_for_next_v5.1_defconfig
+	arm/lpc32xx/defconfig
+		https://github.com/vzapolskiy/linux-lpc32xx tags/lpc32xx-defconfig-for-5.1
+	arm/broadcom/defconfig
+		https://github.com/Broadcom/stblinux tags/arm-soc/for-5.1/defconfig
+	arm/samsung/defconfig
+		git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux tags/samsung-defconfig-5.1
+	patch
+		ARM: defconfig: integrator: Switch to DRM
+		ARM: pxa: remove CONFIG_SND_PXA2XX_AC97 in pxa_defconfig
+		ARM: nhk8815_defconfig: Update defconfig
+		ARM: nhk8815_defconfig: Add new options
+		ARM: spear3xx_defconfig: Activate PL111 DRM driver
+
+arm/newsoc
+	arm/bitmain
+		git://git.kernel.org/pub/scm/linux/kernel/git/mani/linux-bitmain tags/bitmain-initial-soc-v5.1
+	milbeaut/newsoc
+		Merge branch 'milbeaut/newsoc' into arm/newsoc
+
+arm/late
+	arm/davinci/soc-3
+		git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci tags/davinci-for-v5.1/soc-part3
+		contains arm/davinci/soc
+	arm/omap/cpsw
+		git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap tags/omap-for-v5.1/cpsw-signed
+		contains arm/omap/dt
+		contains arm/omap/dt-2
+
+arm/fixes
+	patch
+		ARM: dts: gemini: Re-enable display controller
+	<no branch> (c7c0d8df0b94a67377555a550b8d66ee2ad2f4ed)
+		https://git.linaro.org/people/jens.wiklander/linux-tee tags/tee-fix-for-v5.0
+	<no branch> (6e53330909672bd9a8c9f826e989a5945d9d9fdf)
+		git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux tags/qcom-fixes-for-5.0-rc8
diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
index fa54e8866f1e..e62c3b6cde4c 100644
--- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
@@ -47,6 +47,7 @@
 #include "sama5d2-pinfunc.h"
 #include <dt-bindings/mfd/atmel-flexcom.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/regulator/active-semi,8945a-regulator.h>
 
 / {
 	model = "Atmel SAMA5D2 Xplained";
@@ -181,49 +182,102 @@
 							regulator-name = "VDD_1V35";
 							regulator-min-microvolt = <1350000>;
 							regulator-max-microvolt = <1350000>;
+							regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_FIXED>,
+										  <ACT8945A_REGULATOR_MODE_LOWPOWER>;
+							regulator-initial-mode = <ACT8945A_REGULATOR_MODE_FIXED>;
 							regulator-always-on;
+
+							regulator-state-mem {
+								regulator-on-in-suspend;
+								regulator-suspend-min-microvolt=<1400000>;
+								regulator-suspend-max-microvolt=<1400000>;
+								regulator-changeable-in-suspend;
+								regulator-mode=<ACT8945A_REGULATOR_MODE_LOWPOWER>;
+							};
 						};
 
 						vdd_1v2_reg: REG_DCDC2 {
 							regulator-name = "VDD_1V2";
 							regulator-min-microvolt = <1100000>;
 							regulator-max-microvolt = <1300000>;
+							regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_FIXED>,
+										  <ACT8945A_REGULATOR_MODE_LOWPOWER>;
+							regulator-initial-mode = <ACT8945A_REGULATOR_MODE_FIXED>;
 							regulator-always-on;
+
+							regulator-state-mem {
+								regulator-off-in-suspend;
+							};
 						};
 
 						vdd_3v3_reg: REG_DCDC3 {
 							regulator-name = "VDD_3V3";
 							regulator-min-microvolt = <3300000>;
 							regulator-max-microvolt = <3300000>;
+							regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_FIXED>,
+										  <ACT8945A_REGULATOR_MODE_LOWPOWER>;
+							regulator-initial-mode = <ACT8945A_REGULATOR_MODE_FIXED>;
 							regulator-always-on;
+
+							regulator-state-mem {
+								regulator-off-in-suspend;
+							};
 						};
 
 						vdd_fuse_reg: REG_LDO1 {
 							regulator-name = "VDD_FUSE";
 							regulator-min-microvolt = <2500000>;
 							regulator-max-microvolt = <2500000>;
+							regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_NORMAL>,
+										  <ACT8945A_REGULATOR_MODE_LOWPOWER>;
+							regulator-initial-mode = <ACT8945A_REGULATOR_MODE_NORMAL>;
 							regulator-always-on;
+
+							regulator-state-mem {
+								regulator-off-in-suspend;
+							};
 						};
 
 						vdd_3v3_lp_reg: REG_LDO2 {
 							regulator-name = "VDD_3V3_LP";
 							regulator-min-microvolt = <3300000>;
 							regulator-max-microvolt = <3300000>;
+							regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_NORMAL>,
+										  <ACT8945A_REGULATOR_MODE_LOWPOWER>;
+							regulator-initial-mode = <ACT8945A_REGULATOR_MODE_NORMAL>;
 							regulator-always-on;
+
+							regulator-state-mem {
+								regulator-off-in-suspend;
+							};
 						};
 
 						vdd_led_reg: REG_LDO3 {
 							regulator-name = "VDD_LED";
 							regulator-min-microvolt = <3300000>;
 							regulator-max-microvolt = <3300000>;
+							regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_NORMAL>,
+										  <ACT8945A_REGULATOR_MODE_LOWPOWER>;
+							regulator-initial-mode = <ACT8945A_REGULATOR_MODE_NORMAL>;
 							regulator-always-on;
+
+							regulator-state-mem {
+								regulator-off-in-suspend;
+							};
 						};
 
 						vdd_sdhc_1v8_reg: REG_LDO4 {
 							regulator-name = "VDD_SDHC_1V8";
 							regulator-min-microvolt = <1800000>;
 							regulator-max-microvolt = <1800000>;
+							regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_NORMAL>,
+										  <ACT8945A_REGULATOR_MODE_LOWPOWER>;
+							regulator-initial-mode = <ACT8945A_REGULATOR_MODE_NORMAL>;
 							regulator-always-on;
+
+							regulator-state-mem {
+								regulator-off-in-suspend;
+							};
 						};
 					};
 
diff --git a/arch/arm/boot/dts/rk3288-tinker-s.dts b/arch/arm/boot/dts/rk3288-tinker-s.dts
index d97da89bcd51..970e13859198 100644
--- a/arch/arm/boot/dts/rk3288-tinker-s.dts
+++ b/arch/arm/boot/dts/rk3288-tinker-s.dts
@@ -23,3 +23,8 @@
 	mmc-ddr-1_8v;
 	status = "okay";
 };
+
+&hdmi {
+	pinctrl-names = "default";
+	pinctrl-0 = <&hdmi_cec_c0>;
+};
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
index aa107ee41b8b..d93a48cfc966 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
@@ -5,6 +5,7 @@
 
 #include "rk3288.dtsi"
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/clock/rockchip,rk808.h>
 
 / {
 	chosen {
@@ -61,6 +62,16 @@
 		};
 	};
 
+	sdio_pwrseq: sdio-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		clocks = <&rk808 RK808_CLKOUT1>;
+		clock-names = "ext_clock";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wifi_enable>;
+		reset-gpios = <&gpio4 RK_PD3 GPIO_ACTIVE_LOW>,
+			<&gpio4 RK_PD4 GPIO_ACTIVE_LOW>;
+	};
+
 	sound {
 		compatible = "simple-audio-card";
 		simple-audio-card,format = "i2s";
@@ -254,6 +265,7 @@
 			};
 
 			vccio_sd: LDO_REG5 {
+				regulator-boot-on;
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <3300000>;
 				regulator-name = "vccio_sd";
@@ -337,6 +349,7 @@
 	status = "okay";
 
 	sdcard-supply = <&vccio_sd>;
+	wifi-supply = <&vcc_18>;
 };
 
 &pinctrl {
@@ -415,6 +428,13 @@
 			rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 	};
+
+	sdio {
+		wifi_enable: wifi-enable {
+			rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>,
+				<4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
 };
 
 &pwm0 {
@@ -430,7 +450,7 @@
 	bus-width = <4>;
 	cap-mmc-highspeed;
 	cap-sd-highspeed;
-	card-detect-delay = <200>;
+	broken-cd;
 	disable-wp;			/* wp not hooked up */
 	pinctrl-names = "default";
 	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
@@ -439,6 +459,24 @@
 	vqmmc-supply = <&vccio_sd>;
 };
 
+&sdio0 {
+	bus-width = <4>;
+	cap-sd-highspeed;
+	cap-sdio-irq;
+	keep-power-in-suspend;
+	max-frequency = <50000000>;
+	mmc-pwrseq = <&sdio_pwrseq>;
+	non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>, <&sdio0_int>;
+	sd-uhs-sdr12;
+	sd-uhs-sdr25;
+	sd-uhs-sdr50;
+	vmmc-supply = <&vcc_io>;
+	vqmmc-supply = <&vcc_18>;
+	status = "okay";
+};
+
 &tsadc {
 	rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
 	rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index ca7d52daa8fb..dfc291170d6b 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -70,7 +70,7 @@
 			compatible = "arm,cortex-a12";
 			reg = <0x501>;
 			resets = <&cru SRST_CORE1>;
-			operating-points = <&cpu_opp_table>;
+			operating-points-v2 = <&cpu_opp_table>;
 			#cooling-cells = <2>; /* min followed by max */
 			clock-latency = <40000>;
 			clocks = <&cru ARMCLK>;
@@ -80,7 +80,7 @@
 			compatible = "arm,cortex-a12";
 			reg = <0x502>;
 			resets = <&cru SRST_CORE2>;
-			operating-points = <&cpu_opp_table>;
+			operating-points-v2 = <&cpu_opp_table>;
 			#cooling-cells = <2>; /* min followed by max */
 			clock-latency = <40000>;
 			clocks = <&cru ARMCLK>;
@@ -90,7 +90,7 @@
 			compatible = "arm,cortex-a12";
 			reg = <0x503>;
 			resets = <&cru SRST_CORE3>;
-			operating-points = <&cpu_opp_table>;
+			operating-points-v2 = <&cpu_opp_table>;
 			#cooling-cells = <2>; /* min followed by max */
 			clock-latency = <40000>;
 			clocks = <&cru ARMCLK>;
@@ -569,6 +569,7 @@
 		pinctrl-1 = <&otp_out>;
 		pinctrl-2 = <&otp_gpio>;
 		#thermal-sensor-cells = <1>;
+		rockchip,grf = <&grf>;
 		rockchip,hw-tshut-temp = <95000>;
 		status = "disabled";
 	};
diff --git a/arch/arm/boot/dts/rv1108-elgin-r1.dts b/arch/arm/boot/dts/rv1108-elgin-r1.dts
index 1c4507b66fdd..b1db924710c8 100644
--- a/arch/arm/boot/dts/rv1108-elgin-r1.dts
+++ b/arch/arm/boot/dts/rv1108-elgin-r1.dts
@@ -37,7 +37,6 @@
 &emmc {
 	bus-width = <8>;
 	cap-mmc-highspeed;
-	disable-wp;
 	no-sd;
 	no-sdio;
 	non-removable;
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index d159ee42ef29..9519b9d5abca 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -688,13 +688,13 @@
 				ranges = <0 0xf8044000 0x1420>;
 			};
 
-			rstc@f8048000 {
+			reset_controller: rstc@f8048000 {
 				compatible = "atmel,sama5d3-rstc";
 				reg = <0xf8048000 0x10>;
 				clocks = <&clk32k>;
 			};
 
-			shdwc@f8048010 {
+			shutdown_controller: shdwc@f8048010 {
 				compatible = "atmel,sama5d2-shdwc";
 				reg = <0xf8048010 0x10>;
 				clocks = <&clk32k>;
@@ -710,7 +710,7 @@
 				clocks = <&pmc PMC_TYPE_CORE PMC_MCK2>;
 			};
 
-			watchdog@f8048040 {
+			watchdog: watchdog@f8048040 {
 				compatible = "atmel,sama5d4-wdt";
 				reg = <0xf8048040 0x10>;
 				interrupts = <4 IRQ_TYPE_LEVEL_HIGH 7>;
diff --git a/arch/arm/mach-at91/at91sam9.c b/arch/arm/mach-at91/at91sam9.c
index 3dbdef4d3cbf..c12563b09656 100644
--- a/arch/arm/mach-at91/at91sam9.c
+++ b/arch/arm/mach-at91/at91sam9.c
@@ -32,3 +32,21 @@ DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM9")
 	.init_machine	= at91sam9_init,
 	.dt_compat	= at91_dt_board_compat,
 MACHINE_END
+
+static void __init sam9x60_init(void)
+{
+	of_platform_default_populate(NULL, NULL, NULL);
+
+	sam9x60_pm_init();
+}
+
+static const char *const sam9x60_dt_board_compat[] __initconst = {
+	"microchip,sam9x60",
+	NULL
+};
+
+DT_MACHINE_START(sam9x60_dt, "Microchip SAM9X60")
+	/* Maintainer: Microchip */
+	.init_machine	= sam9x60_init,
+	.dt_compat	= sam9x60_dt_board_compat,
+MACHINE_END
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index e2bd17237964..72b45accfa0f 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -14,11 +14,13 @@
 #ifdef CONFIG_PM
 extern void __init at91rm9200_pm_init(void);
 extern void __init at91sam9_pm_init(void);
+extern void __init sam9x60_pm_init(void);
 extern void __init sama5_pm_init(void);
 extern void __init sama5d2_pm_init(void);
 #else
 static inline void __init at91rm9200_pm_init(void) { }
 static inline void __init at91sam9_pm_init(void) { }
+static inline void __init sam9x60_pm_init(void) { }
 static inline void __init sama5_pm_init(void) { }
 static inline void __init sama5d2_pm_init(void) { }
 #endif
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 51e808adb00c..5571658b3c46 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -39,6 +39,20 @@ extern void at91_pinctrl_gpio_suspend(void);
 extern void at91_pinctrl_gpio_resume(void);
 #endif
 
+struct at91_soc_pm {
+	int (*config_shdwc_ws)(void __iomem *shdwc, u32 *mode, u32 *polarity);
+	int (*config_pmc_ws)(void __iomem *pmc, u32 mode, u32 polarity);
+	const struct of_device_id *ws_ids;
+	struct at91_pm_data data;
+};
+
+static struct at91_soc_pm soc_pm = {
+	.data = {
+		.standby_mode = AT91_PM_STANDBY,
+		.suspend_mode = AT91_PM_ULP0,
+	},
+};
+
 static const match_table_t pm_modes __initconst = {
 	{ AT91_PM_STANDBY, "standby" },
 	{ AT91_PM_ULP0, "ulp0" },
@@ -47,16 +61,11 @@ static const match_table_t pm_modes __initconst = {
 	{ -1, NULL },
 };
 
-static struct at91_pm_data pm_data = {
-	.standby_mode = AT91_PM_STANDBY,
-	.suspend_mode = AT91_PM_ULP0,
-};
-
 #define at91_ramc_read(id, field) \
-	__raw_readl(pm_data.ramc[id] + field)
+	__raw_readl(soc_pm.data.ramc[id] + field)
 
 #define at91_ramc_write(id, field, value) \
-	__raw_writel(value, pm_data.ramc[id] + field)
+	__raw_writel(value, soc_pm.data.ramc[id] + field)
 
 static int at91_pm_valid_state(suspend_state_t state)
 {
@@ -91,6 +100,8 @@ static const struct wakeup_source_info ws_info[] = {
 	{ .pmc_fsmr_bit = AT91_PMC_RTCAL,	.shdwc_mr_bit = BIT(17) },
 	{ .pmc_fsmr_bit = AT91_PMC_USBAL },
 	{ .pmc_fsmr_bit = AT91_PMC_SDMMC_CD },
+	{ .pmc_fsmr_bit = AT91_PMC_RTTAL },
+	{ .pmc_fsmr_bit = AT91_PMC_RXLP_MCE },
 };
 
 static const struct of_device_id sama5d2_ws_ids[] = {
@@ -105,6 +116,17 @@ static const struct of_device_id sama5d2_ws_ids[] = {
 	{ /* sentinel */ }
 };
 
+static const struct of_device_id sam9x60_ws_ids[] = {
+	{ .compatible = "atmel,at91sam9x5-rtc",		.data = &ws_info[1] },
+	{ .compatible = "atmel,at91rm9200-ohci",	.data = &ws_info[2] },
+	{ .compatible = "usb-ohci",			.data = &ws_info[2] },
+	{ .compatible = "atmel,at91sam9g45-ehci",	.data = &ws_info[2] },
+	{ .compatible = "usb-ehci",			.data = &ws_info[2] },
+	{ .compatible = "atmel,at91sam9260-rtt",	.data = &ws_info[4] },
+	{ .compatible = "cdns,sam9x60-macb",		.data = &ws_info[5] },
+	{ /* sentinel */ }
+};
+
 static int at91_pm_config_ws(unsigned int pm_mode, bool set)
 {
 	const struct wakeup_source_info *wsi;
@@ -116,24 +138,22 @@ static int at91_pm_config_ws(unsigned int pm_mode, bool set)
 	if (pm_mode != AT91_PM_ULP1)
 		return 0;
 
-	if (!pm_data.pmc || !pm_data.shdwc)
+	if (!soc_pm.data.pmc || !soc_pm.data.shdwc || !soc_pm.ws_ids)
 		return -EPERM;
 
 	if (!set) {
-		writel(mode, pm_data.pmc + AT91_PMC_FSMR);
+		writel(mode, soc_pm.data.pmc + AT91_PMC_FSMR);
 		return 0;
 	}
 
-	/* SHDWC.WUIR */
-	val = readl(pm_data.shdwc + 0x0c);
-	mode |= (val & 0x3ff);
-	polarity |= ((val >> 16) & 0x3ff);
+	if (soc_pm.config_shdwc_ws)
+		soc_pm.config_shdwc_ws(soc_pm.data.shdwc, &mode, &polarity);
 
 	/* SHDWC.MR */
-	val = readl(pm_data.shdwc + 0x04);
+	val = readl(soc_pm.data.shdwc + 0x04);
 
 	/* Loop through defined wakeup sources. */
-	for_each_matching_node_and_match(np, sama5d2_ws_ids, &match) {
+	for_each_matching_node_and_match(np, soc_pm.ws_ids, &match) {
 		pdev = of_find_device_by_node(np);
 		if (!pdev)
 			continue;
@@ -155,8 +175,8 @@ static int at91_pm_config_ws(unsigned int pm_mode, bool set)
 	}
 
 	if (mode) {
-		writel(mode, pm_data.pmc + AT91_PMC_FSMR);
-		writel(polarity, pm_data.pmc + AT91_PMC_FSPR);
+		if (soc_pm.config_pmc_ws)
+			soc_pm.config_pmc_ws(soc_pm.data.pmc, mode, polarity);
 	} else {
 		pr_err("AT91: PM: no ULP1 wakeup sources found!");
 	}
@@ -164,6 +184,34 @@ static int at91_pm_config_ws(unsigned int pm_mode, bool set)
 	return mode ? 0 : -EPERM;
 }
 
+static int at91_sama5d2_config_shdwc_ws(void __iomem *shdwc, u32 *mode,
+					u32 *polarity)
+{
+	u32 val;
+
+	/* SHDWC.WUIR */
+	val = readl(shdwc + 0x0c);
+	*mode |= (val & 0x3ff);
+	*polarity |= ((val >> 16) & 0x3ff);
+
+	return 0;
+}
+
+static int at91_sama5d2_config_pmc_ws(void __iomem *pmc, u32 mode, u32 polarity)
+{
+	writel(mode, pmc + AT91_PMC_FSMR);
+	writel(polarity, pmc + AT91_PMC_FSPR);
+
+	return 0;
+}
+
+static int at91_sam9x60_config_pmc_ws(void __iomem *pmc, u32 mode, u32 polarity)
+{
+	writel(mode, pmc + AT91_PMC_FSMR);
+
+	return 0;
+}
+
 /*
  * Called after processes are frozen, but before we shutdown devices.
  */
@@ -171,18 +219,18 @@ static int at91_pm_begin(suspend_state_t state)
 {
 	switch (state) {
 	case PM_SUSPEND_MEM:
-		pm_data.mode = pm_data.suspend_mode;
+		soc_pm.data.mode = soc_pm.data.suspend_mode;
 		break;
 
 	case PM_SUSPEND_STANDBY:
-		pm_data.mode = pm_data.standby_mode;
+		soc_pm.data.mode = soc_pm.data.standby_mode;
 		break;
 
 	default:
-		pm_data.mode = -1;
+		soc_pm.data.mode = -1;
 	}
 
-	return at91_pm_config_ws(pm_data.mode, true);
+	return at91_pm_config_ws(soc_pm.data.mode, true);
 }
 
 /*
@@ -194,10 +242,10 @@ static int at91_pm_verify_clocks(void)
 	unsigned long scsr;
 	int i;
 
-	scsr = readl(pm_data.pmc + AT91_PMC_SCSR);
+	scsr = readl(soc_pm.data.pmc + AT91_PMC_SCSR);
 
 	/* USB must not be using PLLB */
-	if ((scsr & pm_data.uhp_udp_mask) != 0) {
+	if ((scsr & soc_pm.data.uhp_udp_mask) != 0) {
 		pr_err("AT91: PM - Suspend-to-RAM with USB still active\n");
 		return 0;
 	}
@@ -208,7 +256,7 @@ static int at91_pm_verify_clocks(void)
 
 		if ((scsr & (AT91_PMC_PCK0 << i)) == 0)
 			continue;
-		css = readl(pm_data.pmc + AT91_PMC_PCKR(i)) & AT91_PMC_CSS;
+		css = readl(soc_pm.data.pmc + AT91_PMC_PCKR(i)) & AT91_PMC_CSS;
 		if (css != AT91_PMC_CSS_SLOW) {
 			pr_err("AT91: PM - Suspend-to-RAM with PCK%d src %d\n", i, css);
 			return 0;
@@ -230,7 +278,7 @@ static int at91_pm_verify_clocks(void)
  */
 int at91_suspend_entering_slow_clock(void)
 {
-	return (pm_data.mode >= AT91_PM_ULP0);
+	return (soc_pm.data.mode >= AT91_PM_ULP0);
 }
 EXPORT_SYMBOL(at91_suspend_entering_slow_clock);
 
@@ -243,14 +291,14 @@ static int at91_suspend_finish(unsigned long val)
 	flush_cache_all();
 	outer_disable();
 
-	at91_suspend_sram_fn(&pm_data);
+	at91_suspend_sram_fn(&soc_pm.data);
 
 	return 0;
 }
 
 static void at91_pm_suspend(suspend_state_t state)
 {
-	if (pm_data.mode == AT91_PM_BACKUP) {
+	if (soc_pm.data.mode == AT91_PM_BACKUP) {
 		pm_bu->suspended = 1;
 
 		cpu_suspend(0, at91_suspend_finish);
@@ -289,7 +337,7 @@ static int at91_pm_enter(suspend_state_t state)
 		/*
 		 * Ensure that clocks are in a valid state.
 		 */
-		if (pm_data.mode >= AT91_PM_ULP0 &&
+		if (soc_pm.data.mode >= AT91_PM_ULP0 &&
 		    !at91_pm_verify_clocks())
 			goto error;
 
@@ -318,7 +366,7 @@ static int at91_pm_enter(suspend_state_t state)
  */
 static void at91_pm_end(void)
 {
-	at91_pm_config_ws(pm_data.mode, false);
+	at91_pm_config_ws(soc_pm.data.mode, false);
 }
 
 
@@ -351,7 +399,7 @@ static void at91rm9200_standby(void)
 		"    str    %2, [%1, %3]\n\t"
 		"    mcr    p15, 0, %0, c7, c0, 4\n\t"
 		:
-		: "r" (0), "r" (pm_data.ramc[0]),
+		: "r" (0), "r" (soc_pm.data.ramc[0]),
 		  "r" (1), "r" (AT91_MC_SDRAMC_SRR));
 }
 
@@ -374,7 +422,7 @@ static void at91_ddr_standby(void)
 		at91_ramc_write(0, AT91_DDRSDRC_MDR, mdr);
 	}
 
-	if (pm_data.ramc[1]) {
+	if (soc_pm.data.ramc[1]) {
 		saved_lpr1 = at91_ramc_read(1, AT91_DDRSDRC_LPR);
 		lpr1 = saved_lpr1 & ~AT91_DDRSDRC_LPCB;
 		lpr1 |= AT91_DDRSDRC_LPCB_SELF_REFRESH;
@@ -392,14 +440,14 @@ static void at91_ddr_standby(void)
 
 	/* self-refresh mode now */
 	at91_ramc_write(0, AT91_DDRSDRC_LPR, lpr0);
-	if (pm_data.ramc[1])
+	if (soc_pm.data.ramc[1])
 		at91_ramc_write(1, AT91_DDRSDRC_LPR, lpr1);
 
 	cpu_do_idle();
 
 	at91_ramc_write(0, AT91_DDRSDRC_MDR, saved_mdr0);
 	at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr0);
-	if (pm_data.ramc[1]) {
+	if (soc_pm.data.ramc[1]) {
 		at91_ramc_write(0, AT91_DDRSDRC_MDR, saved_mdr1);
 		at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1);
 	}
@@ -429,7 +477,7 @@ static void at91sam9_sdram_standby(void)
 	u32 lpr0, lpr1 = 0;
 	u32 saved_lpr0, saved_lpr1 = 0;
 
-	if (pm_data.ramc[1]) {
+	if (soc_pm.data.ramc[1]) {
 		saved_lpr1 = at91_ramc_read(1, AT91_SDRAMC_LPR);
 		lpr1 = saved_lpr1 & ~AT91_SDRAMC_LPCB;
 		lpr1 |= AT91_SDRAMC_LPCB_SELF_REFRESH;
@@ -441,13 +489,13 @@ static void at91sam9_sdram_standby(void)
 
 	/* self-refresh mode now */
 	at91_ramc_write(0, AT91_SDRAMC_LPR, lpr0);
-	if (pm_data.ramc[1])
+	if (soc_pm.data.ramc[1])
 		at91_ramc_write(1, AT91_SDRAMC_LPR, lpr1);
 
 	cpu_do_idle();
 
 	at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr0);
-	if (pm_data.ramc[1])
+	if (soc_pm.data.ramc[1])
 		at91_ramc_write(1, AT91_SDRAMC_LPR, saved_lpr1);
 }
 
@@ -480,14 +528,14 @@ static __init void at91_dt_ramc(void)
 	const struct ramc_info *ramc;
 
 	for_each_matching_node_and_match(np, ramc_ids, &of_id) {
-		pm_data.ramc[idx] = of_iomap(np, 0);
-		if (!pm_data.ramc[idx])
+		soc_pm.data.ramc[idx] = of_iomap(np, 0);
+		if (!soc_pm.data.ramc[idx])
 			panic(pr_fmt("unable to map ramc[%d] cpu registers\n"), idx);
 
 		ramc = of_id->data;
 		if (!standby)
 			standby = ramc->idle;
-		pm_data.memctrl = ramc->memctrl;
+		soc_pm.data.memctrl = ramc->memctrl;
 
 		idx++;
 	}
@@ -509,12 +557,17 @@ static void at91rm9200_idle(void)
 	 * Disable the processor clock.  The processor will be automatically
 	 * re-enabled by an interrupt or by a reset.
 	 */
-	writel(AT91_PMC_PCK, pm_data.pmc + AT91_PMC_SCDR);
+	writel(AT91_PMC_PCK, soc_pm.data.pmc + AT91_PMC_SCDR);
+}
+
+static void at91sam9x60_idle(void)
+{
+	cpu_do_idle();
 }
 
 static void at91sam9_idle(void)
 {
-	writel(AT91_PMC_PCK, pm_data.pmc + AT91_PMC_SCDR);
+	writel(AT91_PMC_PCK, soc_pm.data.pmc + AT91_PMC_SCDR);
 	cpu_do_idle();
 }
 
@@ -566,8 +619,8 @@ static void __init at91_pm_sram_init(void)
 
 static bool __init at91_is_pm_mode_active(int pm_mode)
 {
-	return (pm_data.standby_mode == pm_mode ||
-		pm_data.suspend_mode == pm_mode);
+	return (soc_pm.data.standby_mode == pm_mode ||
+		soc_pm.data.suspend_mode == pm_mode);
 }
 
 static int __init at91_pm_backup_init(void)
@@ -577,6 +630,9 @@ static int __init at91_pm_backup_init(void)
 	struct platform_device *pdev = NULL;
 	int ret = -ENODEV;
 
+	if (!IS_ENABLED(CONFIG_SOC_SAMA5D2))
+		return -EPERM;
+
 	if (!at91_is_pm_mode_active(AT91_PM_BACKUP))
 		return 0;
 
@@ -586,7 +642,7 @@ static int __init at91_pm_backup_init(void)
 		return ret;
 	}
 
-	pm_data.sfrbu = of_iomap(np, 0);
+	soc_pm.data.sfrbu = of_iomap(np, 0);
 	of_node_put(np);
 
 	np = of_find_compatible_node(NULL, NULL, "atmel,sama5d2-securam");
@@ -620,8 +676,8 @@ static int __init at91_pm_backup_init(void)
 	return 0;
 
 securam_fail:
-	iounmap(pm_data.sfrbu);
-	pm_data.sfrbu = NULL;
+	iounmap(soc_pm.data.sfrbu);
+	soc_pm.data.sfrbu = NULL;
 	return ret;
 }
 
@@ -630,10 +686,10 @@ static void __init at91_pm_use_default_mode(int pm_mode)
 	if (pm_mode != AT91_PM_ULP1 && pm_mode != AT91_PM_BACKUP)
 		return;
 
-	if (pm_data.standby_mode == pm_mode)
-		pm_data.standby_mode = AT91_PM_ULP0;
-	if (pm_data.suspend_mode == pm_mode)
-		pm_data.suspend_mode = AT91_PM_ULP0;
+	if (soc_pm.data.standby_mode == pm_mode)
+		soc_pm.data.standby_mode = AT91_PM_ULP0;
+	if (soc_pm.data.suspend_mode == pm_mode)
+		soc_pm.data.suspend_mode = AT91_PM_ULP0;
 }
 
 static void __init at91_pm_modes_init(void)
@@ -651,7 +707,7 @@ static void __init at91_pm_modes_init(void)
 		goto ulp1_default;
 	}
 
-	pm_data.shdwc = of_iomap(np, 0);
+	soc_pm.data.shdwc = of_iomap(np, 0);
 	of_node_put(np);
 
 	ret = at91_pm_backup_init();
@@ -665,8 +721,8 @@ static void __init at91_pm_modes_init(void)
 	return;
 
 unmap:
-	iounmap(pm_data.shdwc);
-	pm_data.shdwc = NULL;
+	iounmap(soc_pm.data.shdwc);
+	soc_pm.data.shdwc = NULL;
 ulp1_default:
 	at91_pm_use_default_mode(AT91_PM_ULP1);
 backup_default:
@@ -709,14 +765,14 @@ static void __init at91_pm_init(void (*pm_idle)(void))
 		platform_device_register(&at91_cpuidle_device);
 
 	pmc_np = of_find_matching_node_and_match(NULL, atmel_pmc_ids, &of_id);
-	pm_data.pmc = of_iomap(pmc_np, 0);
-	if (!pm_data.pmc) {
+	soc_pm.data.pmc = of_iomap(pmc_np, 0);
+	if (!soc_pm.data.pmc) {
 		pr_err("AT91: PM not supported, PMC not found\n");
 		return;
 	}
 
 	pmc = of_id->data;
-	pm_data.uhp_udp_mask = pmc->uhp_udp_mask;
+	soc_pm.data.uhp_udp_mask = pmc->uhp_udp_mask;
 
 	if (pm_idle)
 		arm_pm_idle = pm_idle;
@@ -726,8 +782,8 @@ static void __init at91_pm_init(void (*pm_idle)(void))
 	if (at91_suspend_sram_fn) {
 		suspend_set_ops(&at91_pm_ops);
 		pr_info("AT91: PM: standby: %s, suspend: %s\n",
-			pm_modes[pm_data.standby_mode].pattern,
-			pm_modes[pm_data.suspend_mode].pattern);
+			pm_modes[soc_pm.data.standby_mode].pattern,
+			pm_modes[soc_pm.data.suspend_mode].pattern);
 	} else {
 		pr_info("AT91: PM not supported, due to no SRAM allocated\n");
 	}
@@ -748,6 +804,19 @@ void __init at91rm9200_pm_init(void)
 	at91_pm_init(at91rm9200_idle);
 }
 
+void __init sam9x60_pm_init(void)
+{
+	if (!IS_ENABLED(CONFIG_SOC_AT91SAM9))
+		return;
+
+	at91_pm_modes_init();
+	at91_dt_ramc();
+	at91_pm_init(at91sam9x60_idle);
+
+	soc_pm.ws_ids = sam9x60_ws_ids;
+	soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws;
+}
+
 void __init at91sam9_pm_init(void)
 {
 	if (!IS_ENABLED(CONFIG_SOC_AT91SAM9))
@@ -773,6 +842,10 @@ void __init sama5d2_pm_init(void)
 
 	at91_pm_modes_init();
 	sama5_pm_init();
+
+	soc_pm.ws_ids = sama5d2_ws_ids;
+	soc_pm.config_shdwc_ws = at91_sama5d2_config_shdwc_ws;
+	soc_pm.config_pmc_ws = at91_sama5d2_config_pmc_ws;
 }
 
 static int __init at91_pm_modes_select(char *str)
@@ -793,8 +866,8 @@ static int __init at91_pm_modes_select(char *str)
 	if (suspend < 0)
 		return 0;
 
-	pm_data.standby_mode = standby;
-	pm_data.suspend_mode = suspend;
+	soc_pm.data.standby_mode = standby;
+	soc_pm.data.suspend_mode = suspend;
 
 	return 0;
 }
diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S
index bfe1c4d06901..77e29309cc6e 100644
--- a/arch/arm/mach-at91/pm_suspend.S
+++ b/arch/arm/mach-at91/pm_suspend.S
@@ -50,15 +50,6 @@ tmp2	.req	r5
 	beq	1b
 	.endm
 
-/*
- * Wait until PLLA has locked.
- */
-	.macro wait_pllalock
-1:	ldr	tmp1, [pmc, #AT91_PMC_SR]
-	tst	tmp1, #AT91_PMC_LOCKA
-	beq	1b
-	.endm
-
 /*
  * Put the processor to enter the idle state
  */
@@ -178,11 +169,46 @@ ENDPROC(at91_backup_mode)
 	orr	tmp1, tmp1, #AT91_PMC_KEY
 	str	tmp1, [pmc, #AT91_CKGR_MOR]
 
+	/* Save RC oscillator state */
+	ldr	tmp1, [pmc, #AT91_PMC_SR]
+	str	tmp1, .saved_osc_status
+	tst	tmp1, #AT91_PMC_MOSCRCS
+	bne	1f
+
+	/* Turn off RC oscillator */
+	ldr	tmp1, [pmc, #AT91_CKGR_MOR]
+	bic	tmp1, tmp1, #AT91_PMC_MOSCRCEN
+	bic	tmp1, tmp1, #AT91_PMC_KEY_MASK
+	orr	tmp1, tmp1, #AT91_PMC_KEY
+	str	tmp1, [pmc, #AT91_CKGR_MOR]
+
+	/* Wait main RC disabled done */
+2:	ldr	tmp1, [pmc, #AT91_PMC_SR]
+	tst	tmp1, #AT91_PMC_MOSCRCS
+	bne	2b
+
 	/* Wait for interrupt */
-	at91_cpu_idle
+1:	at91_cpu_idle
 
-	/* Turn on the crystal oscillator */
+	/* Restore RC oscillator state */
+	ldr	tmp1, .saved_osc_status
+	tst	tmp1, #AT91_PMC_MOSCRCS
+	beq	4f
+
+	/* Turn on RC oscillator */
 	ldr	tmp1, [pmc, #AT91_CKGR_MOR]
+	orr	tmp1, tmp1, #AT91_PMC_MOSCRCEN
+	bic	tmp1, tmp1, #AT91_PMC_KEY_MASK
+	orr	tmp1, tmp1, #AT91_PMC_KEY
+	str	tmp1, [pmc, #AT91_CKGR_MOR]
+
+	/* Wait main RC stabilization */
+3:	ldr	tmp1, [pmc, #AT91_PMC_SR]
+	tst	tmp1, #AT91_PMC_MOSCRCS
+	beq	3b
+
+	/* Turn on the crystal oscillator */
+4:	ldr	tmp1, [pmc, #AT91_CKGR_MOR]
 	orr	tmp1, tmp1, #AT91_PMC_MOSCEN
 	orr	tmp1, tmp1, #AT91_PMC_KEY
 	str	tmp1, [pmc, #AT91_CKGR_MOR]
@@ -197,8 +223,26 @@ ENDPROC(at91_backup_mode)
 .macro at91_pm_ulp1_mode
 	ldr	pmc, .pmc_base
 
-	/* Switch the main clock source to 12-MHz RC oscillator */
+	/* Save RC oscillator state and check if it is enabled. */
+	ldr	tmp1, [pmc, #AT91_PMC_SR]
+	str	tmp1, .saved_osc_status
+	tst	tmp1, #AT91_PMC_MOSCRCS
+	bne	2f
+
+	/* Enable RC oscillator */
 	ldr	tmp1, [pmc, #AT91_CKGR_MOR]
+	orr	tmp1, tmp1, #AT91_PMC_MOSCRCEN
+	bic	tmp1, tmp1, #AT91_PMC_KEY_MASK
+	orr	tmp1, tmp1, #AT91_PMC_KEY
+	str	tmp1, [pmc, #AT91_CKGR_MOR]
+
+	/* Wait main RC stabilization */
+1:	ldr	tmp1, [pmc, #AT91_PMC_SR]
+	tst	tmp1, #AT91_PMC_MOSCRCS
+	beq	1b
+
+	/* Switch the main clock source to 12-MHz RC oscillator */
+2:	ldr	tmp1, [pmc, #AT91_CKGR_MOR]
 	bic	tmp1, tmp1, #AT91_PMC_MOSCSEL
 	bic	tmp1, tmp1, #AT91_PMC_KEY_MASK
 	orr	tmp1, tmp1, #AT91_PMC_KEY
@@ -262,6 +306,25 @@ ENDPROC(at91_backup_mode)
 	str	tmp1, [pmc, #AT91_PMC_MCKR]
 
 	wait_mckrdy
+
+	/* Restore RC oscillator state */
+	ldr	tmp1, .saved_osc_status
+	tst	tmp1, #AT91_PMC_MOSCRCS
+	bne	3f
+
+	/* Disable RC oscillator */
+	ldr	tmp1, [pmc, #AT91_CKGR_MOR]
+	bic	tmp1, tmp1, #AT91_PMC_MOSCRCEN
+	bic	tmp1, tmp1, #AT91_PMC_KEY_MASK
+	orr	tmp1, tmp1, #AT91_PMC_KEY
+	str	tmp1, [pmc, #AT91_CKGR_MOR]
+
+	/* Wait RC oscillator disable done */
+4:	ldr	tmp1, [pmc, #AT91_PMC_SR]
+	tst	tmp1, #AT91_PMC_MOSCRCS
+	bne	4b
+
+3:
 .endm
 
 ENTRY(at91_ulp_mode)
@@ -279,14 +342,6 @@ ENTRY(at91_ulp_mode)
 
 	wait_mckrdy
 
-	/* Save PLLA setting and disable it */
-	ldr	tmp1, [pmc, #AT91_CKGR_PLLAR]
-	str	tmp1, .saved_pllar
-
-	mov	tmp1, #AT91_PMC_PLLCOUNT
-	orr	tmp1, tmp1, #(1 << 29)		/* bit 29 always set */
-	str	tmp1, [pmc, #AT91_CKGR_PLLAR]
-
 	ldr	r0, .pm_mode
 	cmp	r0, #AT91_PM_ULP1
 	beq	ulp1_mode
@@ -301,18 +356,6 @@ ulp1_mode:
 ulp_exit:
 	ldr	pmc, .pmc_base
 
-	/* Restore PLLA setting */
-	ldr	tmp1, .saved_pllar
-	str	tmp1, [pmc, #AT91_CKGR_PLLAR]
-
-	tst	tmp1, #(AT91_PMC_MUL &  0xff0000)
-	bne	3f
-	tst	tmp1, #(AT91_PMC_MUL & ~0xff0000)
-	beq	4f
-3:
-	wait_pllalock
-4:
-
 	/*
 	 * Restore master clock setting
 	 */
@@ -465,8 +508,6 @@ ENDPROC(at91_sramc_self_refresh)
 	.word 0
 .saved_mckr:
 	.word 0
-.saved_pllar:
-	.word 0
 .saved_sam9_lpr:
 	.word 0
 .saved_sam9_lpr1:
@@ -475,6 +516,8 @@ ENDPROC(at91_sramc_self_refresh)
 	.word 0
 .saved_sam9_mdr1:
 	.word 0
+.saved_osc_status:
+	.word 0
 
 ENTRY(at91_pm_suspend_in_sram_sz)
 	.word .-at91_pm_suspend_in_sram
diff --git a/arch/arm/mach-cns3xxx/core.c b/arch/arm/mach-cns3xxx/core.c
index 7d5a44a06648..f676592d8402 100644
--- a/arch/arm/mach-cns3xxx/core.c
+++ b/arch/arm/mach-cns3xxx/core.c
@@ -90,7 +90,7 @@ void __init cns3xxx_map_io(void)
 /* used by entry-macro.S */
 void __init cns3xxx_init_irq(void)
 {
-	gic_init(0, 29, IOMEM(CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT),
+	gic_init(IOMEM(CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT),
 		 IOMEM(CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT));
 }
 
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 43f46aa7ef33..8a90f298af96 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -565,7 +565,7 @@ static void *__alloc_from_pool(size_t size, struct page **ret_page)
 
 static bool __in_atomic_pool(void *start, size_t size)
 {
-	return addr_in_gen_pool(atomic_pool, (unsigned long)start, size);
+	return gen_pool_has_addr(atomic_pool, (unsigned long)start, size);
 }
 
 static int __free_from_pool(void *start, size_t size)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 117b2541ef3d..7ae8187a2425 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -18,7 +18,7 @@ config ARM64
 	select ARCH_HAS_FAST_MULTIPLIER
 	select ARCH_HAS_FORTIFY_SOURCE
 	select ARCH_HAS_GCOV_PROFILE_ALL
-	select ARCH_HAS_GIGANTIC_PAGE if (MEMORY_ISOLATION && COMPACTION) || CMA
+	select ARCH_HAS_GIGANTIC_PAGE_RUNTIME_ALLOCATION if (MEMORY_ISOLATION && COMPACTION) || CMA
 	select ARCH_HAS_KCOV
 	select ARCH_HAS_MEMBARRIER_SYNC_CORE
 	select ARCH_HAS_PTE_SPECIAL
diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile
index 0821fed4c074..e129c03ced14 100644
--- a/arch/arm64/boot/dts/amlogic/Makefile
+++ b/arch/arm64/boot/dts/amlogic/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 dtb-$(CONFIG_ARCH_MESON) += meson-axg-s400.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-g12a-sei510.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-g12a-u200.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-g12a-x96-max.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-nanopi-k2.dtb
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts
new file mode 100644
index 000000000000..6a7c3241862a
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts
@@ -0,0 +1,38 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre SAS. All rights reserved.
+ */
+
+/dts-v1/;
+
+#include "meson-g12a.dtsi"
+
+/ {
+	compatible = "seirobotics,sei510", "amlogic,g12a";
+	model = "SEI Robotics SEI510";
+
+	aliases {
+		serial0 = &uart_AO;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory@0 {
+		device_type = "memory";
+		reg = <0x0 0x0 0x0 0x40000000>;
+	};
+
+	reserved-memory {
+		/* TEE Reserved Memory */
+		bl32_reserved: bl32@5000000 {
+			reg = <0x0 0x05300000 0x0 0x2000000>;
+			no-map;
+		};
+	};
+};
+
+&uart_AO {
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
index 17c6217f8a84..dcc821cf35bb 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
@@ -4,6 +4,7 @@
  */
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/g12a-clkc.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 
@@ -55,6 +56,14 @@
 		};
 	};
 
+	efuse: efuse {
+		compatible = "amlogic,meson-gxbb-efuse";
+		clocks = <&clkc CLKID_EFUSE>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		read-only;
+	};
+
 	psci {
 		compatible = "arm,psci-1.0";
 		method = "smc";
@@ -72,6 +81,10 @@
 		};
 	};
 
+	sm: secure-monitor {
+		compatible = "amlogic,meson-gxbb-sm";
+	};
+
 	soc {
 		compatible = "simple-bus";
 		#address-cells = <2>;
@@ -122,6 +135,12 @@
 			#size-cells = <2>;
 			ranges = <0x0 0x0 0x0 0xff800000 0x0 0x100000>;
 
+			sec_AO: ao-secure@140 {
+				compatible = "amlogic,meson-gx-ao-secure", "syscon";
+				reg = <0x0 0x140 0x0 0x140>;
+				amlogic,has-chip-id;
+			};
+
 			uart_AO: serial@3000 {
 				compatible = "amlogic,meson-gx-uart",
 					     "amlogic,meson-ao-uart";
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-phicomm-n1.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-phicomm-n1.dts
index 9a8a8a7e4b53..b5667f1fb2c8 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-phicomm-n1.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-phicomm-n1.dts
@@ -14,6 +14,16 @@
 	cvbs-connector {
 		status = "disabled";
 	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		status {
+			label = "n1:white:status";
+			gpios = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+	};
 };
 
 &cvbs_vdac_port {
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts
index 8acfd40090d2..25f3b6b14043 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts
@@ -178,3 +178,7 @@
 	pinctrl-0 = <&uart_ao_a_pins>;
 	pinctrl-names = "default";
 };
+
+&usb0 {
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/nvidia/tegra186.dtsi b/arch/arm64/boot/dts/nvidia/tegra186.dtsi
index bb2045be8814..97aeb946ed5e 100644
--- a/arch/arm64/boot/dts/nvidia/tegra186.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra186.dtsi
@@ -321,7 +321,6 @@
 		nvidia,default-trim = <0x9>;
 		nvidia,dqs-trim = <63>;
 		mmc-hs400-1_8v;
-		supports-cqe;
 		status = "disabled";
 	};
 
diff --git a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
index 61a0afb74e63..1ea684af99c4 100644
--- a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
@@ -2,7 +2,7 @@
 /*
  * Device Tree Source for the RZ/G2E (R8A774C0) SoC
  *
- * Copyright (C) 2018 Renesas Electronics Corp.
+ * Copyright (C) 2018-2019 Renesas Electronics Corp.
  */
 
 #include <dt-bindings/clock/r8a774c0-cpg-mssr.h>
@@ -1150,9 +1150,8 @@
 				 <&cpg CPG_CORE R8A774C0_CLK_S3D1C>,
 				 <&scif_clk>;
 			clock-names = "fck", "brg_int", "scif_clk";
-			dmas = <&dmac1 0x5b>, <&dmac1 0x5a>,
-			       <&dmac2 0x5b>, <&dmac2 0x5a>;
-			dma-names = "tx", "rx", "tx", "rx";
+			dmas = <&dmac0 0x5b>, <&dmac0 0x5a>;
+			dma-names = "tx", "rx";
 			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
 			resets = <&cpg 202>;
 			status = "disabled";
diff --git a/arch/arm64/boot/dts/renesas/r8a77990.dtsi b/arch/arm64/boot/dts/renesas/r8a77990.dtsi
index a69faa60ea4d..d2ad665fe2d9 100644
--- a/arch/arm64/boot/dts/renesas/r8a77990.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77990.dtsi
@@ -2,7 +2,7 @@
 /*
  * Device Tree Source for the R-Car E3 (R8A77990) SoC
  *
- * Copyright (C) 2018 Renesas Electronics Corp.
+ * Copyright (C) 2018-2019 Renesas Electronics Corp.
  */
 
 #include <dt-bindings/clock/r8a77990-cpg-mssr.h>
@@ -1067,9 +1067,8 @@
 				 <&cpg CPG_CORE R8A77990_CLK_S3D1C>,
 				 <&scif_clk>;
 			clock-names = "fck", "brg_int", "scif_clk";
-			dmas = <&dmac1 0x5b>, <&dmac1 0x5a>,
-			       <&dmac2 0x5b>, <&dmac2 0x5a>;
-			dma-names = "tx", "rx", "tx", "rx";
+			dmas = <&dmac0 0x5b>, <&dmac0 0x5a>;
+			dma-names = "tx", "rx";
 			power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
 			resets = <&cpg 202>;
 			status = "disabled";
diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
index 1b28fa72ea0b..5f2687acbf94 100644
--- a/arch/arm64/boot/dts/rockchip/Makefile
+++ b/arch/arm64/boot/dts/rockchip/Makefile
@@ -18,6 +18,8 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-gru-scarlet-inx.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-gru-scarlet-kd.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopc-t4.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-m4.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-neo4.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4.dtb
diff --git a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts
index 33c44e857247..c213ad74d51d 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts
@@ -81,12 +81,44 @@
 		regulator-always-on;
 		regulator-boot-on;
 	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		power {
+			label = "firefly:blue:power";
+			linux,default-trigger = "heartbeat";
+			gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+			mode = <0x23>;
+		};
+
+		user {
+			label = "firefly:yellow:user";
+			linux,default-trigger = "mmc1";
+			gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+			mode = <0x05>;
+		};
+	};
 };
 
 &cpu0 {
 	cpu-supply = <&vdd_arm>;
 };
 
+&cpu1 {
+	cpu-supply = <&vdd_arm>;
+};
+
+&cpu2 {
+	cpu-supply = <&vdd_arm>;
+};
+
+&cpu3 {
+	cpu-supply = <&vdd_arm>;
+};
+
 &emmc {
 	bus-width = <8>;
 	cap-mmc-highspeed;
@@ -108,8 +140,8 @@
 	snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
 	snps,reset-active-low;
 	snps,reset-delays-us = <0 10000 50000>;
-	tx_delay = <0x25>;
-	rx_delay = <0x11>;
+	tx_delay = <0x24>;
+	rx_delay = <0x18>;
 	status = "okay";
 };
 
diff --git a/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts b/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
index 2157a528276b..7cfd5ca6cc85 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
@@ -46,8 +46,7 @@
 
 	vcc_host1_5v: vcc_otg_5v: vcc-host1-5v-regulator {
 		compatible = "regulator-fixed";
-		enable-active-high;
-		gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
+		gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&usb20_host_drv>;
 		regulator-name = "vcc_host1_5v";
@@ -65,6 +64,27 @@
 		regulator-max-microvolt = <5000000>;
 	};
 
+	ir-receiver {
+		compatible = "gpio-ir-receiver";
+		gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_LOW>;
+		pinctrl-0 = <&ir_int>;
+		pinctrl-names = "default";
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		power {
+			gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "mmc0";
+		};
+
+		standby {
+			gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
 	sound {
 		compatible = "audio-graph-card";
 		label = "rockchip,rk3328";
@@ -157,6 +177,8 @@
 		interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
 		#clock-cells = <1>;
 		clock-output-names = "xin32k", "rk805-clkout2";
+		gpio-controller;
+		#gpio-cells = <2>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pmic_int_l>;
 		rockchip,system-power-controller;
@@ -218,7 +240,7 @@
 			};
 
 			vcc_18: LDO_REG1 {
-				regulator-name = "vdd_18";
+				regulator-name = "vcc_18";
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <1800000>;
 				regulator-always-on;
@@ -230,7 +252,7 @@
 			};
 
 			vcc18_emmc: LDO_REG2 {
-				regulator-name = "vcc_18emmc";
+				regulator-name = "vcc18_emmc";
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <1800000>;
 				regulator-always-on;
@@ -281,6 +303,12 @@
 };
 
 &pinctrl {
+	ir {
+		ir_int: ir-int {
+			rockchip,pins = <2 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
 	pmic {
 		pmic_int_l: pmic-int-l {
 			rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
index 84f14b132e8f..994468671b19 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
@@ -657,14 +657,17 @@
 		interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>,
 			     <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&cru PCLK_HDMI>,
-			 <&cru SCLK_HDMI_SFC>;
+			 <&cru SCLK_HDMI_SFC>,
+			 <&cru SCLK_RTC32K>;
 		clock-names = "iahb",
-			      "isfr";
+			      "isfr",
+			      "cec";
 		phys = <&hdmiphy>;
 		phy-names = "hdmi";
 		pinctrl-names = "default";
 		pinctrl-0 = <&hdmi_cec &hdmii2c_xfer &hdmi_hpd>;
 		rockchip,grf = <&grf>;
+		#sound-dai-cells = <0>;
 		status = "disabled";
 
 		ports {
@@ -1445,11 +1448,11 @@
 
 		sdmmc0 {
 			sdmmc0_clk: sdmmc0-clk {
-				rockchip,pins = <1 RK_PA6 1 &pcfg_pull_none_4ma>;
+				rockchip,pins = <1 RK_PA6 1 &pcfg_pull_none_8ma>;
 			};
 
 			sdmmc0_cmd: sdmmc0-cmd {
-				rockchip,pins = <1 RK_PA4 1 &pcfg_pull_up_4ma>;
+				rockchip,pins = <1 RK_PA4 1 &pcfg_pull_up_8ma>;
 			};
 
 			sdmmc0_dectn: sdmmc0-dectn {
@@ -1461,14 +1464,14 @@
 			};
 
 			sdmmc0_bus1: sdmmc0-bus1 {
-				rockchip,pins = <1 RK_PA0 1 &pcfg_pull_up_4ma>;
+				rockchip,pins = <1 RK_PA0 1 &pcfg_pull_up_8ma>;
 			};
 
 			sdmmc0_bus4: sdmmc0-bus4 {
-				rockchip,pins = <1 RK_PA0 1 &pcfg_pull_up_4ma>,
-						<1 RK_PA1 1 &pcfg_pull_up_4ma>,
-						<1 RK_PA2 1 &pcfg_pull_up_4ma>,
-						<1 RK_PA3 1 &pcfg_pull_up_4ma>;
+				rockchip,pins = <1 RK_PA0 1 &pcfg_pull_up_8ma>,
+						<1 RK_PA1 1 &pcfg_pull_up_8ma>,
+						<1 RK_PA2 1 &pcfg_pull_up_8ma>,
+						<1 RK_PA3 1 &pcfg_pull_up_8ma>;
 			};
 
 			sdmmc0_gpio: sdmmc0-gpio {
@@ -1642,50 +1645,50 @@
 			rgmiim1_pins: rgmiim1-pins {
 				rockchip,pins =
 					/* mac_txclk */
-					<1 RK_PB4 2 &pcfg_pull_none_12ma>,
+					<1 RK_PB4 2 &pcfg_pull_none_8ma>,
 					/* mac_rxclk */
-					<1 RK_PB5 2 &pcfg_pull_none_2ma>,
+					<1 RK_PB5 2 &pcfg_pull_none_4ma>,
 					/* mac_mdio */
-					<1 RK_PC3 2 &pcfg_pull_none_2ma>,
+					<1 RK_PC3 2 &pcfg_pull_none_4ma>,
 					/* mac_txen */
-					<1 RK_PD1 2 &pcfg_pull_none_12ma>,
+					<1 RK_PD1 2 &pcfg_pull_none_8ma>,
 					/* mac_clk */
-					<1 RK_PC5 2 &pcfg_pull_none_2ma>,
+					<1 RK_PC5 2 &pcfg_pull_none_4ma>,
 					/* mac_rxdv */
-					<1 RK_PC6 2 &pcfg_pull_none_2ma>,
+					<1 RK_PC6 2 &pcfg_pull_none_4ma>,
 					/* mac_mdc */
-					<1 RK_PC7 2 &pcfg_pull_none_2ma>,
+					<1 RK_PC7 2 &pcfg_pull_none_4ma>,
 					/* mac_rxd1 */
-					<1 RK_PB2 2 &pcfg_pull_none_2ma>,
+					<1 RK_PB2 2 &pcfg_pull_none_4ma>,
 					/* mac_rxd0 */
-					<1 RK_PB3 2 &pcfg_pull_none_2ma>,
+					<1 RK_PB3 2 &pcfg_pull_none_4ma>,
 					/* mac_txd1 */
-					<1 RK_PB0 2 &pcfg_pull_none_12ma>,
+					<1 RK_PB0 2 &pcfg_pull_none_8ma>,
 					/* mac_txd0 */
-					<1 RK_PB1 2 &pcfg_pull_none_12ma>,
+					<1 RK_PB1 2 &pcfg_pull_none_8ma>,
 					/* mac_rxd3 */
-					<1 RK_PB6 2 &pcfg_pull_none_2ma>,
+					<1 RK_PB6 2 &pcfg_pull_none_4ma>,
 					/* mac_rxd2 */
-					<1 RK_PB7 2 &pcfg_pull_none_2ma>,
+					<1 RK_PB7 2 &pcfg_pull_none_4ma>,
 					/* mac_txd3 */
-					<1 RK_PC0 2 &pcfg_pull_none_12ma>,
+					<1 RK_PC0 2 &pcfg_pull_none_8ma>,
 					/* mac_txd2 */
-					<1 RK_PC1 2 &pcfg_pull_none_12ma>,
+					<1 RK_PC1 2 &pcfg_pull_none_8ma>,
 
 					/* mac_txclk */
-					<0 RK_PB0 1 &pcfg_pull_none>,
+					<0 RK_PB0 1 &pcfg_pull_none_8ma>,
 					/* mac_txen */
-					<0 RK_PB4 1 &pcfg_pull_none>,
+					<0 RK_PB4 1 &pcfg_pull_none_8ma>,
 					/* mac_clk */
-					<0 RK_PD0 1 &pcfg_pull_none>,
+					<0 RK_PD0 1 &pcfg_pull_none_4ma>,
 					/* mac_txd1 */
-					<0 RK_PC0 1 &pcfg_pull_none>,
+					<0 RK_PC0 1 &pcfg_pull_none_8ma>,
 					/* mac_txd0 */
-					<0 RK_PC1 1 &pcfg_pull_none>,
+					<0 RK_PC1 1 &pcfg_pull_none_8ma>,
 					/* mac_txd3 */
-					<0 RK_PC7 1 &pcfg_pull_none>,
+					<0 RK_PC7 1 &pcfg_pull_none_8ma>,
 					/* mac_txd2 */
-					<0 RK_PC6 1 &pcfg_pull_none>;
+					<0 RK_PC6 1 &pcfg_pull_none_8ma>;
 			};
 
 			rmiim1_pins: rmiim1-pins {
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dts b/arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dts
index 84433cf02be9..931c3dbf1b7d 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dts
@@ -52,6 +52,73 @@
 		pinctrl-names = "default";
 		pinctrl-0 = <&ir_rx>;
 	};
+
+	fan: pwm-fan {
+		compatible = "pwm-fan";
+		/*
+		 * With 20KHz PWM and an EVERCOOL EC4007H12SA fan, these levels
+		 * work out to 0, ~1200, ~3000, and 5000RPM respectively.
+		 */
+		cooling-levels = <0 12 18 255>;
+		#cooling-cells = <2>;
+		fan-supply = <&vcc12v0_sys>;
+		pwms = <&pwm1 0 50000 0>;
+	};
+};
+
+&cpu_thermal {
+	trips {
+		cpu_warm: cpu_warm {
+			temperature = <55000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+
+		cpu_hot: cpu_hot {
+			temperature = <65000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu_warm>;
+			cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+		};
+
+		map3 {
+			trip = <&cpu_hot>;
+			cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
+		};
+	};
+};
+
+&gpu_thermal {
+	trips {
+		gpu_warm: gpu_warm {
+			temperature = <55000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+
+		gpu_hot: gpu_hot {
+			temperature = <65000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+	cooling-maps {
+		map1 {
+			trip = <&gpu_warm>;
+			cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+		};
+
+		map2 {
+			trip = <&gpu_hot>;
+			cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
+		};
+	};
 };
 
 &pinctrl {
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-neo4.dts b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-neo4.dts
new file mode 100644
index 000000000000..195410b089b9
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-neo4.dts
@@ -0,0 +1,50 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2019 Amarula Solutions B.V.
+ * Author: Jagan Teki <jagan@amarulasolutions.com>
+ */
+
+/dts-v1/;
+
+#include "rk3399-nanopi4.dtsi"
+
+/ {
+	model = "FriendlyARM NanoPi NEO4";
+	compatible = "friendlyarm,nanopi-neo4", "rockchip,rk3399";
+
+	vdd_5v: vdd-5v {
+		compatible = "regulator-fixed";
+		regulator-name = "vdd_5v";
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
+	vcc5v0_core: vcc5v0-core {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc5v0_core";
+		regulator-always-on;
+		regulator-boot-on;
+		vin-supply = <&vdd_5v>;
+	};
+
+	vcc5v0_usb1: vcc5v0-usb1 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc5v0_usb1";
+		regulator-always-on;
+		regulator-boot-on;
+		vin-supply = <&vcc5v0_sys>;
+	};
+};
+
+&vcc3v3_sys {
+	vin-supply = <&vcc5v0_core>;
+};
+
+&u2phy0_host {
+	phy-supply = <&vcc5v0_usb1>;
+};
+
+&vbus_typec {
+	regulator-always-on;
+	vin-supply = <&vdd_5v>;
+};
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi
index d325e117287b..dd16c80d923e 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi
@@ -148,15 +148,28 @@
 	assigned-clocks = <&cru SCLK_RMII_SRC>;
 	clock_in_out = "input";
 	pinctrl-names = "default";
-	pinctrl-0 = <&rgmii_pins>;
+	pinctrl-0 = <&rgmii_pins>, <&phy_intb>, <&phy_rstb>;
+	phy-handle = <&rtl8211e>;
 	phy-mode = "rgmii";
 	phy-supply = <&vcc3v3_s3>;
 	snps,reset-active-low;
-	snps,reset-delays-us = <0 10000 50000>;
+	snps,reset-delays-us = <0 10000 30000>;
 	snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
 	tx_delay = <0x28>;
 	rx_delay = <0x11>;
 	status = "okay";
+
+	mdio {
+		compatible = "snps,dwmac-mdio";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		rtl8211e: phy@1 {
+			reg = <1>;
+			interrupt-parent = <&gpio3>;
+			interrupts = <RK_PB2 IRQ_TYPE_LEVEL_LOW>;
+		};
+	};
 };
 
 &gpu {
@@ -481,6 +494,16 @@
 		};
 	};
 
+	phy {
+		phy_intb: phy-intb {
+			rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+
+		phy_rstb: phy-rstb {
+			rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
 	pmic {
 		cpu_b_sleep: cpu-b-sleep {
 			rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts b/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
new file mode 100644
index 000000000000..2166be171df8
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
@@ -0,0 +1,790 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
+ */
+
+/dts-v1/;
+
+#include "dt-bindings/pwm/pwm.h"
+#include "dt-bindings/input/input.h"
+#include "rk3399.dtsi"
+#include "rk3399-opp.dtsi"
+
+/ {
+	model = "Orange Pi RK3399 Board";
+	compatible = "rockchip,rk3399-orangepi", "rockchip,rk3399";
+
+	chosen {
+		stdout-path = "serial2:1500000n8";
+	};
+
+	clkin_gmac: external-gmac-clock {
+		compatible = "fixed-clock";
+		clock-frequency = <125000000>;
+		clock-output-names = "clkin_gmac";
+		#clock-cells = <0>;
+	};
+
+	adc-keys {
+		compatible = "adc-keys";
+		io-channels = <&saradc 1>;
+		io-channel-names = "buttons";
+		keyup-threshold-microvolt = <1800000>;
+		poll-interval = <100>;
+
+		button-up {
+			label = "Volume Up";
+			linux,code = <KEY_VOLUMEUP>;
+			press-threshold-microvolt = <100000>;
+		};
+
+		button-down {
+			label = "Volume Down";
+			linux,code = <KEY_VOLUMEDOWN>;
+			press-threshold-microvolt = <300000>;
+		};
+
+		back {
+			label = "Back";
+			linux,code = <KEY_BACK>;
+			press-threshold-microvolt = <985000>;
+		};
+
+		menu {
+			label = "Menu";
+			linux,code = <KEY_MENU>;
+			press-threshold-microvolt = <1314000>;
+		};
+	};
+
+	dc_12v: dc-12v {
+		compatible = "regulator-fixed";
+		regulator-name = "dc_12v";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <12000000>;
+		regulator-max-microvolt = <12000000>;
+	};
+
+	keys: gpio-keys {
+		compatible = "gpio-keys";
+		autorepeat;
+
+		power {
+			debounce-interval = <100>;
+			gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
+			label = "GPIO Power";
+			linux,code = <KEY_POWER>;
+			linux,input-type = <1>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pwr_btn>;
+			wakeup-source;
+		};
+	};
+
+	sdio_pwrseq: sdio-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		clocks = <&rk808 1>;
+		clock-names = "ext_clock";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wifi_reg_on_h>;
+		reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
+	};
+
+	/* switched by pmic_sleep */
+	vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc1v8_s3";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc_1v8>;
+	};
+
+	vcc3v0_sd: vcc3v0-sd {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&sdmmc0_pwr_h>;
+		regulator-boot-on;
+		regulator-max-microvolt = <3000000>;
+		regulator-min-microvolt = <3000000>;
+		regulator-name = "vcc3v0_sd";
+		vin-supply = <&vcc3v3_sys>;
+	};
+
+	vcc3v3_sys: vcc3v3-sys {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc3v3_sys";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vcc_sys>;
+	};
+
+	vcc5v0_host: vcc5v0-host-regulator {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&vcc5v0_host_en>;
+		regulator-name = "vcc5v0_host";
+		regulator-always-on;
+		vin-supply = <&vcc_sys>;
+	};
+
+	vbus_typec: vbus-typec-regulator {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&vcc5v0_typec_en>;
+		regulator-name = "vbus_typec";
+		vin-supply = <&vcc_sys>;
+	};
+
+	vcc_sys: vcc-sys {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_sys";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		vin-supply = <&dc_12v>;
+	};
+
+	vdd_log: vdd-log {
+		compatible = "pwm-regulator";
+		pwms = <&pwm2 0 25000 1>;
+		regulator-name = "vdd_log";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <800000>;
+		regulator-max-microvolt = <1400000>;
+		vin-supply = <&vcc_sys>;
+	};
+};
+
+&cpu_l0 {
+	cpu-supply = <&vdd_cpu_l>;
+};
+
+&cpu_l1 {
+	cpu-supply = <&vdd_cpu_l>;
+};
+
+&cpu_l2 {
+	cpu-supply = <&vdd_cpu_l>;
+};
+
+&cpu_l3 {
+	cpu-supply = <&vdd_cpu_l>;
+};
+
+&cpu_b0 {
+	cpu-supply = <&vdd_cpu_b>;
+};
+
+&cpu_b1 {
+	cpu-supply = <&vdd_cpu_b>;
+};
+
+&emmc_phy {
+	status = "okay";
+};
+
+&gmac {
+	assigned-clocks = <&cru SCLK_RMII_SRC>;
+	assigned-clock-parents = <&clkin_gmac>;
+	clock_in_out = "input";
+	phy-supply = <&vcc3v3_s3>;
+	phy-mode = "rgmii";
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii_pins>;
+	snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
+	snps,reset-active-low;
+	snps,reset-delays-us = <0 10000 50000>;
+	tx_delay = <0x28>;
+	rx_delay = <0x11>;
+	status = "okay";
+};
+
+&gpu {
+	mali-supply = <&vdd_gpu>;
+	status = "okay";
+};
+
+&hdmi {
+	ddc-i2c-bus = <&i2c3>;
+	status = "okay";
+};
+
+&hdmi_sound {
+	status = "okay";
+};
+
+&i2c0 {
+	clock-frequency = <400000>;
+	i2c-scl-rising-time-ns = <168>;
+	i2c-scl-falling-time-ns = <4>;
+	status = "okay";
+
+	rk808: pmic@1b {
+		compatible = "rockchip,rk808";
+		reg = <0x1b>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
+		#clock-cells = <1>;
+		clock-output-names = "rtc_clko_soc", "rtc_clko_wifi";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pmic_int_l>;
+		rockchip,system-power-controller;
+		wakeup-source;
+
+		vcc1-supply = <&vcc3v3_sys>;
+		vcc2-supply = <&vcc3v3_sys>;
+		vcc3-supply = <&vcc3v3_sys>;
+		vcc4-supply = <&vcc3v3_sys>;
+		vcc6-supply = <&vcc3v3_sys>;
+		vcc7-supply = <&vcc3v3_sys>;
+		vcc8-supply = <&vcc3v3_sys>;
+		vcc9-supply = <&vcc3v3_sys>;
+		vcc10-supply = <&vcc3v3_sys>;
+		vcc11-supply = <&vcc3v3_sys>;
+		vcc12-supply = <&vcc3v3_sys>;
+		vddio-supply = <&vcc_3v0>;
+
+		regulators {
+			vdd_center: DCDC_REG1 {
+				regulator-name = "vdd_center";
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <700000>;
+				regulator-max-microvolt = <1500000>;
+				regulator-ramp-delay = <6001>;
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			vdd_cpu_l: DCDC_REG2 {
+				regulator-name = "vdd_cpu_l";
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <700000>;
+				regulator-max-microvolt = <1500000>;
+				regulator-ramp-delay = <6001>;
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			vcc_ddr: DCDC_REG3 {
+				regulator-name = "vcc_ddr";
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-state-mem {
+					regulator-on-in-suspend;
+				};
+			};
+
+			vcc_1v8: DCDC_REG4 {
+				regulator-name = "vcc_1v8";
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-state-mem {
+					regulator-on-in-suspend;
+					regulator-suspend-microvolt = <1800000>;
+				};
+			};
+
+			vcc1v8_dvp: LDO_REG1 {
+				regulator-name = "vcc1v8_dvp";
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3400000>;
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			vcc3v0_tp: LDO_REG2 {
+				regulator-name = "vcc3v0_tp";
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3400000>;
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			vcc1v8_pmupll: LDO_REG3 {
+				regulator-name = "vcc1v8_pmupll";
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <2500000>;
+				regulator-state-mem {
+					regulator-on-in-suspend;
+					regulator-suspend-microvolt = <1800000>;
+				};
+			};
+
+			vcc_sdio: LDO_REG4 {
+				regulator-name = "vcc_sdio";
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3400000>;
+				regulator-state-mem {
+					regulator-on-in-suspend;
+					regulator-suspend-microvolt = <3000000>;
+				};
+			};
+
+			vcca3v0_codec: LDO_REG5 {
+				regulator-name = "vcca3v0_codec";
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3400000>;
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			vcc_1v5: LDO_REG6 {
+				regulator-name = "vcc_1v5";
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <2500000>;
+				regulator-state-mem {
+					regulator-on-in-suspend;
+					regulator-suspend-microvolt = <1500000>;
+				};
+			};
+
+			vcca1v8_codec: LDO_REG7 {
+				regulator-name = "vcca1v8_codec";
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <2500000>;
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			vcc_3v0: LDO_REG8 {
+				regulator-name = "vcc_3v0";
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3400000>;
+				regulator-state-mem {
+					regulator-on-in-suspend;
+					regulator-suspend-microvolt = <3000000>;
+				};
+			};
+
+			vcc3v3_s3: SWITCH_REG1 {
+				regulator-name = "vcc3v3_s3";
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			vcc3v3_s0: SWITCH_REG2 {
+				regulator-name = "vcc3v3_s0";
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+		};
+	};
+
+	vdd_cpu_b: regulator@40 {
+		compatible = "silergy,syr827";
+		reg = <0x40>;
+		fcs,suspend-voltage-selector = <1>;
+		regulator-name = "vdd_cpu_b";
+		regulator-min-microvolt = <712500>;
+		regulator-max-microvolt = <1500000>;
+		regulator-ramp-delay = <1000>;
+		regulator-always-on;
+		regulator-boot-on;
+		vin-supply = <&vcc3v3_sys>;
+
+		regulator-state-mem {
+			regulator-off-in-suspend;
+		};
+	};
+
+	vdd_gpu: regulator@41 {
+		compatible = "silergy,syr828";
+		reg = <0x41>;
+		fcs,suspend-voltage-selector = <1>;
+		regulator-name = "vdd_gpu";
+		regulator-min-microvolt = <712500>;
+		regulator-max-microvolt = <1500000>;
+		regulator-ramp-delay = <1000>;
+		regulator-always-on;
+		regulator-boot-on;
+		vin-supply = <&vcc3v3_sys>;
+
+		regulator-state-mem {
+			regulator-off-in-suspend;
+		};
+	};
+};
+
+&i2c1 {
+	i2c-scl-rising-time-ns = <450>;
+	i2c-scl-falling-time-ns = <15>;
+	status = "okay";
+};
+
+&i2c3 {
+	i2c-scl-rising-time-ns = <450>;
+	i2c-scl-falling-time-ns = <15>;
+	status = "okay";
+};
+
+&i2c4 {
+	clock-frequency = <400000>;
+	i2c-scl-rising-time-ns = <450>;
+	i2c-scl-falling-time-ns = <15>;
+	status = "okay";
+
+	ak09911@c {
+		compatible = "asahi-kasei,ak09911";
+		reg = <0x0c>;
+		vdd-supply = <&vcc3v3_s3>;
+		vid-supply = <&vcc3v3_s3>;
+	};
+
+	mpu6500@68 {
+		compatible = "invensense,mpu6500";
+		reg = <0x68>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <RK_PC6 IRQ_TYPE_EDGE_RISING>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&gsensor_int_l>;
+		vddio-supply = <&vcc3v3_s3>;
+	};
+
+	lsm6ds3@6a {
+		compatible = "st,lsm6ds3";
+		reg = <0x6a>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <RK_PD0 IRQ_TYPE_EDGE_RISING>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&gyr_int_l>;
+		vdd-supply = <&vcc3v3_s3>;
+		vddio-supply = <&vcc3v3_s3>;
+	};
+
+	cm32181@10 {
+		compatible = "capella,cm32181";
+		reg = <0x10>;
+		interrupt-parent = <&gpio4>;
+		interrupts = <RK_PD0 IRQ_TYPE_EDGE_RISING>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&light_int_l>;
+		vdd-supply = <&vcc3v3_s3>;
+	};
+
+	fusb302@22 {
+		compatible = "fcs,fusb302";
+		reg = <0x22>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&chg_cc_int_l>;
+		vbus-supply = <&vbus_typec>;
+	};
+};
+
+&io_domains {
+	status = "okay";
+	bt656-supply = <&vcc_3v0>;
+	audio-supply = <&vcca1v8_codec>;
+	sdmmc-supply = <&vcc_sdio>;
+	gpio1830-supply = <&vcc_3v0>;
+};
+
+&pmu_io_domains {
+	status = "okay";
+	pmu1830-supply = <&vcc_3v0>;
+};
+
+&pinctrl {
+	buttons {
+		pwr_btn: pwr-btn {
+			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
+
+	pmic {
+		pmic_int_l: pmic-int-l {
+			rockchip,pins =
+				<1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
+
+	sd {
+		sdmmc0_pwr_h: sdmmc0-pwr-h {
+			rockchip,pins =
+				<RK_GPIO0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	usb2 {
+		vcc5v0_host_en: vcc5v0-host-en {
+			rockchip,pins =
+				<4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		vcc5v0_typec_en: vcc5v0-typec-en {
+			rockchip,pins =
+				<1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	sdio-pwrseq {
+		wifi_reg_on_h: wifi-reg-on-h {
+			rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	wifi {
+		wifi_host_wake_l: wifi-host-wake-l {
+			rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	bluetooth {
+		bt_reg_on_h: bt-enable-h {
+			rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		bt_host_wake_l: bt-host-wake-l {
+			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		bt_wake_l: bt-wake-l {
+			rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	mpu6500 {
+		gsensor_int_l: gsensor-int-l {
+			rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	lsm6ds3 {
+		gyr_int_l: gyr-int-l {
+			rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	cm32181 {
+		light_int_l: light-int-l {
+			rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	fusb302 {
+		chg_cc_int_l: chg-cc-int-l {
+			rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
+};
+
+&pwm0 {
+	status = "okay";
+};
+
+&pwm2 {
+	status = "okay";
+};
+
+&saradc {
+	vref-supply = <&vcca1v8_s3>;
+	status = "okay";
+};
+
+&sdhci {
+	bus-width = <8>;
+	mmc-hs400-1_8v;
+	mmc-hs400-enhanced-strobe;
+	non-removable;
+	status = "okay";
+};
+
+&sdio0 {
+	bus-width = <4>;
+	cap-sd-highspeed;
+	cap-sdio-irq;
+	clock-frequency = <50000000>;
+	disable-wp;
+	keep-power-in-suspend;
+	max-frequency = <50000000>;
+	mmc-pwrseq = <&sdio_pwrseq>;
+	non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
+	sd-uhs-sdr104;
+	status = "okay";
+
+	brcmf: wifi@1 {
+		compatible = "brcm,bcm4329-fmac";
+		interrupt-parent = <&gpio0>;
+		interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
+		interrupt-names = "host-wake";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wifi_host_wake_l>;
+	};
+};
+
+&sdmmc {
+	bus-width = <4>;
+	cap-mmc-highspeed;
+	cap-sd-highspeed;
+	cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
+	clock-frequency = <150000000>;
+	disable-wp;
+	max-frequency = <150000000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
+	vmmc-supply = <&vcc3v0_sd>;
+	vqmmc-supply = <&vcc_sdio>;
+	status = "okay";
+};
+
+&tcphy0 {
+	status = "okay";
+};
+
+&tcphy1 {
+	status = "okay";
+};
+
+&tsadc {
+	rockchip,hw-tshut-mode = <1>;
+	rockchip,hw-tshut-polarity = <1>;
+	status = "okay";
+};
+
+&u2phy0 {
+	status = "okay";
+
+	u2phy0_otg: otg-port {
+		phy-supply = <&vbus_typec>;
+		status = "okay";
+	};
+
+	u2phy0_host: host-port {
+		phy-supply = <&vcc5v0_host>;
+		status = "okay";
+	};
+};
+
+&u2phy1 {
+	status = "okay";
+
+	u2phy1_otg: otg-port {
+		status = "okay";
+	};
+
+	u2phy1_host: host-port {
+		phy-supply = <&vcc5v0_host>;
+		status = "okay";
+	};
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
+	status = "okay";
+
+	bluetooth {
+		compatible = "brcm,bcm43438-bt";
+		clocks = <&rk808 1>;
+		clock-names = "lpo";
+		device-wakeup-gpios = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>;
+		host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
+		shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_reg_on_h>;
+		vbat-supply = <&vcc3v3_sys>;
+		vddio-supply = <&vcc_1v8>;
+	};
+};
+
+&uart2 {
+	status = "okay";
+};
+
+&usb_host0_ehci {
+	status = "okay";
+};
+
+&usb_host0_ohci {
+	status = "okay";
+};
+
+&usb_host1_ehci {
+	status = "okay";
+};
+
+&usb_host1_ohci {
+	status = "okay";
+};
+
+&usbdrd3_0 {
+	status = "okay";
+};
+
+&usbdrd_dwc3_0 {
+	status = "okay";
+	dr_mode = "otg";
+};
+
+&usbdrd3_1 {
+	status = "okay";
+};
+
+&usbdrd_dwc3_1 {
+	status = "okay";
+	dr_mode = "host";
+};
+
+&vopb {
+	status = "okay";
+};
+
+&vopb_mmu {
+	status = "okay";
+};
+
+&vopl {
+	status = "okay";
+};
+
+&vopl_mmu {
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts
index 4a543f2117d4..e030627159c6 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts
@@ -157,7 +157,13 @@
 	status = "okay";
 };
 
+&gpu {
+	mali-supply = <&vdd_gpu>;
+	status = "okay";
+};
+
 &hdmi {
+	ddc-i2c-bus = <&i2c3>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&hdmi_cec>;
 	status = "okay";
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi
index 2927db4dda9d..5ba2aeca0fa8 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi
@@ -18,6 +18,15 @@
 		reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
 	};
 
+	vcc12v_dcin: vcc12v-dcin {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc12v_dcin";
+		regulator-min-microvolt = <12000000>;
+		regulator-max-microvolt = <12000000>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
 	vcc1v8_s0: vcc1v8-s0 {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc1v8_s0";
@@ -26,12 +35,13 @@
 		regulator-always-on;
 	};
 
-	vcc_sys: vcc-sys {
+	vcc5v0_sys: vcc5v0-sys {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc_sys";
+		regulator-name = "vcc5v0_sys";
 		regulator-min-microvolt = <5000000>;
 		regulator-max-microvolt = <5000000>;
 		regulator-always-on;
+		vin-supply = <&vcc12v_dcin>;
 	};
 
 	vcc3v3_sys: vcc3v3-sys {
@@ -40,7 +50,7 @@
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
 		regulator-always-on;
-		vin-supply = <&vcc_sys>;
+		vin-supply = <&vcc5v0_sys>;
 	};
 
 	vcc3v3_pcie: vcc3v3-pcie-regulator {
@@ -64,7 +74,7 @@
 		regulator-min-microvolt = <5000000>;
 		regulator-max-microvolt = <5000000>;
 		regulator-always-on;
-		vin-supply = <&vcc_sys>;
+		vin-supply = <&vcc5v0_sys>;
 	};
 };
 
@@ -96,6 +106,11 @@
 	status = "okay";
 };
 
+&gpu {
+	mali-supply = <&vdd_gpu>;
+	status = "okay";
+};
+
 &hdmi {
 	ddc-i2c-bus = <&i2c3>;
 	pinctrl-names = "default";
@@ -123,7 +138,7 @@
 		regulator-ramp-delay = <1000>;
 		regulator-always-on;
 		regulator-boot-on;
-		vin-supply = <&vcc_sys>;
+		vin-supply = <&vcc5v0_sys>;
 		status = "okay";
 
 		regulator-state-mem {
@@ -141,7 +156,7 @@
 		regulator-ramp-delay = <1000>;
 		regulator-always-on;
 		regulator-boot-on;
-		vin-supply = <&vcc_sys>;
+		vin-supply = <&vcc5v0_sys>;
 		regulator-state-mem {
 			regulator-off-in-suspend;
 		};
@@ -159,16 +174,16 @@
 		#clock-cells = <1>;
 		clock-output-names = "xin32k", "rk808-clkout2";
 
-		vcc1-supply = <&vcc_sys>;
-		vcc2-supply = <&vcc_sys>;
-		vcc3-supply = <&vcc_sys>;
-		vcc4-supply = <&vcc_sys>;
-		vcc6-supply = <&vcc_sys>;
-		vcc7-supply = <&vcc_sys>;
+		vcc1-supply = <&vcc5v0_sys>;
+		vcc2-supply = <&vcc5v0_sys>;
+		vcc3-supply = <&vcc5v0_sys>;
+		vcc4-supply = <&vcc5v0_sys>;
+		vcc6-supply = <&vcc5v0_sys>;
+		vcc7-supply = <&vcc5v0_sys>;
 		vcc8-supply = <&vcc3v3_sys>;
-		vcc9-supply = <&vcc_sys>;
-		vcc10-supply = <&vcc_sys>;
-		vcc11-supply = <&vcc_sys>;
+		vcc9-supply = <&vcc5v0_sys>;
+		vcc10-supply = <&vcc5v0_sys>;
+		vcc11-supply = <&vcc5v0_sys>;
 		vcc12-supply = <&vcc3v3_sys>;
 		vddio-supply = <&vcc_1v8>;
 
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
index 1f2394e0587d..791fb0ee9722 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
@@ -222,6 +222,10 @@
 	status = "okay";
 };
 
+&hdmi_sound {
+	status = "okay";
+};
+
 &gpu {
 	mali-supply = <&vdd_gpu>;
 	status = "okay";
diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index db9d948c0b03..0301e3e01b38 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -71,6 +71,7 @@
 			compatible = "arm,cortex-a53";
 			reg = <0x0 0x0>;
 			enable-method = "psci";
+			capacity-dmips-mhz = <485>;
 			clocks = <&cru ARMCLKL>;
 			#cooling-cells = <2>; /* min followed by max */
 			dynamic-power-coefficient = <100>;
@@ -82,6 +83,7 @@
 			compatible = "arm,cortex-a53";
 			reg = <0x0 0x1>;
 			enable-method = "psci";
+			capacity-dmips-mhz = <485>;
 			clocks = <&cru ARMCLKL>;
 			#cooling-cells = <2>; /* min followed by max */
 			dynamic-power-coefficient = <100>;
@@ -93,6 +95,7 @@
 			compatible = "arm,cortex-a53";
 			reg = <0x0 0x2>;
 			enable-method = "psci";
+			capacity-dmips-mhz = <485>;
 			clocks = <&cru ARMCLKL>;
 			#cooling-cells = <2>; /* min followed by max */
 			dynamic-power-coefficient = <100>;
@@ -104,6 +107,7 @@
 			compatible = "arm,cortex-a53";
 			reg = <0x0 0x3>;
 			enable-method = "psci";
+			capacity-dmips-mhz = <485>;
 			clocks = <&cru ARMCLKL>;
 			#cooling-cells = <2>; /* min followed by max */
 			dynamic-power-coefficient = <100>;
@@ -115,6 +119,7 @@
 			compatible = "arm,cortex-a72";
 			reg = <0x0 0x100>;
 			enable-method = "psci";
+			capacity-dmips-mhz = <1024>;
 			clocks = <&cru ARMCLKB>;
 			#cooling-cells = <2>; /* min followed by max */
 			dynamic-power-coefficient = <436>;
@@ -126,6 +131,7 @@
 			compatible = "arm,cortex-a72";
 			reg = <0x0 0x101>;
 			enable-method = "psci";
+			capacity-dmips-mhz = <1024>;
 			clocks = <&cru ARMCLKB>;
 			#cooling-cells = <2>; /* min followed by max */
 			dynamic-power-coefficient = <436>;
diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
index c6a07a3b433e..939a0a484252 100644
--- a/arch/arm64/include/asm/hugetlb.h
+++ b/arch/arm64/include/asm/hugetlb.h
@@ -70,8 +70,11 @@ extern void set_huge_swap_pte_at(struct mm_struct *mm, unsigned long addr,
 
 #include <asm-generic/hugetlb.h>
 
-#ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE
-static inline bool gigantic_page_supported(void) { return true; }
+#ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE_RUNTIME_ALLOCATION
+static inline bool gigantic_page_runtime_allocation_supported(void)
+{
+	return true;
+}
 #endif
 
 #endif /* __ASM_HUGETLB_H */
diff --git a/arch/csky/Makefile b/arch/csky/Makefile
index 3607a6e8f66c..6b87f6c22ad6 100644
--- a/arch/csky/Makefile
+++ b/arch/csky/Makefile
@@ -36,7 +36,7 @@ endif
 
 ifneq ($(CSKYABI),)
 MCPU_STR = $(CPUTYPE)$(FPUEXT)$(VDSPEXT)$(TEEEXT)
-KBUILD_CFLAGS += -mcpu=$(MCPU_STR)
+KBUILD_CFLAGS += -mcpu=$(CPUTYPE) -Wa,-mcpu=$(MCPU_STR)
 KBUILD_CFLAGS += -DCSKYCPU_DEF_NAME=\"$(MCPU_STR)\"
 KBUILD_CFLAGS += -msoft-float -mdiv
 KBUILD_CFLAGS += -fno-tree-vectorize
diff --git a/arch/csky/abiv2/memmove.S b/arch/csky/abiv2/memmove.S
index b0c42ecf1889..5721e73ad3d8 100644
--- a/arch/csky/abiv2/memmove.S
+++ b/arch/csky/abiv2/memmove.S
@@ -35,11 +35,7 @@ ENTRY(memmove)
 .L_len_larger_16bytes:
 	subi	r1, 16
 	subi	r0, 16
-#if defined(__CSKY_VDSPV2__)
-	vldx.8	vr0, (r1), r19
-	PRE_BNEZAD (r18)
-	vstx.8	vr0, (r0), r19
-#elif defined(__CK860__)
+#if defined(__CK860__)
 	ldw	r3, (r1, 12)
 	stw	r3, (r0, 12)
 	ldw	r3, (r1, 8)
diff --git a/arch/mips/bcm47xx/workarounds.c b/arch/mips/bcm47xx/workarounds.c
index 46eddbec8d9f..0ab95dd431b3 100644
--- a/arch/mips/bcm47xx/workarounds.c
+++ b/arch/mips/bcm47xx/workarounds.c
@@ -24,6 +24,7 @@ void __init bcm47xx_workarounds(void)
 	case BCM47XX_BOARD_NETGEAR_WNR3500L:
 		bcm47xx_workarounds_enable_usb_power(12);
 		break;
+	case BCM47XX_BOARD_NETGEAR_WNDR3400V2:
 	case BCM47XX_BOARD_NETGEAR_WNDR3400_V3:
 		bcm47xx_workarounds_enable_usb_power(21);
 		break;
diff --git a/arch/mips/include/asm/jump_label.h b/arch/mips/include/asm/jump_label.h
index e77672539e8e..e4456e450f94 100644
--- a/arch/mips/include/asm/jump_label.h
+++ b/arch/mips/include/asm/jump_label.h
@@ -21,15 +21,15 @@
 #endif
 
 #ifdef CONFIG_CPU_MICROMIPS
-#define NOP_INSN "nop32"
+#define B_INSN "b32"
 #else
-#define NOP_INSN "nop"
+#define B_INSN "b"
 #endif
 
 static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
 {
-	asm_volatile_goto("1:\t" NOP_INSN "\n\t"
-		"nop\n\t"
+	asm_volatile_goto("1:\t" B_INSN " 2f\n\t"
+		"2:\tnop\n\t"
 		".pushsection __jump_table,  \"aw\"\n\t"
 		WORD_INSN " 1b, %l[l_yes], %0\n\t"
 		".popsection\n\t"
diff --git a/arch/mips/include/uapi/asm/posix_types.h b/arch/mips/include/uapi/asm/posix_types.h
index 6aa49c10f88f..f0ccb5b90ce9 100644
--- a/arch/mips/include/uapi/asm/posix_types.h
+++ b/arch/mips/include/uapi/asm/posix_types.h
@@ -21,13 +21,6 @@
 typedef long		__kernel_daddr_t;
 #define __kernel_daddr_t __kernel_daddr_t
 
-#if (_MIPS_SZLONG == 32)
-typedef struct {
-	long	val[2];
-} __kernel_fsid_t;
-#define __kernel_fsid_t __kernel_fsid_t
-#endif
-
 #include <asm-generic/posix_types.h>
 
 #endif /* _ASM_POSIX_TYPES_H */
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index cb7e9ed7a453..33ee0d18fb0a 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -140,6 +140,13 @@ SECTIONS
 	PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
 #endif
 
+#ifdef CONFIG_MIPS_ELF_APPENDED_DTB
+	.appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) {
+		*(.appended_dtb)
+		KEEP(*(.appended_dtb))
+	}
+#endif
+
 #ifdef CONFIG_RELOCATABLE
 	. = ALIGN(4);
 
@@ -164,11 +171,6 @@ SECTIONS
 	__appended_dtb = .;
 	/* leave space for appended DTB */
 	. += 0x100000;
-#elif defined(CONFIG_MIPS_ELF_APPENDED_DTB)
-	.appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) {
-		*(.appended_dtb)
-		KEEP(*(.appended_dtb))
-	}
 #endif
 	/*
 	 * Align to 64K in attempt to eliminate holes before the
diff --git a/arch/mips/loongson64/lemote-2f/irq.c b/arch/mips/loongson64/lemote-2f/irq.c
index 9e33e45aa17c..b213cecb8e3a 100644
--- a/arch/mips/loongson64/lemote-2f/irq.c
+++ b/arch/mips/loongson64/lemote-2f/irq.c
@@ -103,7 +103,7 @@ static struct irqaction ip6_irqaction = {
 static struct irqaction cascade_irqaction = {
 	.handler = no_action,
 	.name = "cascade",
-	.flags = IRQF_NO_THREAD,
+	.flags = IRQF_NO_THREAD | IRQF_NO_SUSPEND,
 };
 
 void __init mach_init_irq(void)
diff --git a/arch/nds32/kernel/cacheinfo.c b/arch/nds32/kernel/cacheinfo.c
index 0a7bc696dd55..aab98e447feb 100644
--- a/arch/nds32/kernel/cacheinfo.c
+++ b/arch/nds32/kernel/cacheinfo.c
@@ -13,7 +13,7 @@ static void ci_leaf_init(struct cacheinfo *this_leaf,
 	this_leaf->level = level;
 	this_leaf->type = type;
 	this_leaf->coherency_line_size = CACHE_LINE_SIZE(cache_type);
-	this_leaf->number_of_sets = CACHE_SET(cache_type);;
+	this_leaf->number_of_sets = CACHE_SET(cache_type);
 	this_leaf->ways_of_associativity = CACHE_WAY(cache_type);
 	this_leaf->size = this_leaf->number_of_sets *
 	    this_leaf->coherency_line_size * this_leaf->ways_of_associativity;
diff --git a/arch/nds32/mm/init.c b/arch/nds32/mm/init.c
index 1d03633f89a9..f32e40e36fe1 100644
--- a/arch/nds32/mm/init.c
+++ b/arch/nds32/mm/init.c
@@ -272,7 +272,7 @@ void __set_fixmap(enum fixed_addresses idx,
 
 	BUG_ON(idx <= FIX_HOLE || idx >= __end_of_fixed_addresses);
 
-	pte = (pte_t *)&fixmap_pmd_p[pte_index(addr)];;
+	pte = (pte_t *)&fixmap_pmd_p[pte_index(addr)];
 
 	if (pgprot_val(flags)) {
 		set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, flags));
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 2d0be82c3061..b3b8593f0329 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -171,6 +171,7 @@ config PPC
 	select GENERIC_STRNCPY_FROM_USER
 	select GENERIC_STRNLEN_USER
 	select GENERIC_TIME_VSYSCALL
+	select GENERIC_CMDLINE
 	select HAVE_ARCH_AUDITSYSCALL
 	select HAVE_ARCH_JUMP_LABEL
 	select HAVE_ARCH_KGDB
@@ -828,28 +829,6 @@ config PPC_DENORMALISATION
 	  Add support for handling denormalisation of single precision
 	  values.  Useful for bare metal only.  If unsure say Y here.
 
-config CMDLINE_BOOL
-	bool "Default bootloader kernel arguments"
-
-config CMDLINE
-	string "Initial kernel command string"
-	depends on CMDLINE_BOOL
-	default "console=ttyS0,9600 console=tty0 root=/dev/sda2"
-	help
-	  On some platforms, there is currently no way for the boot loader to
-	  pass arguments to the kernel. For these platforms, you can supply
-	  some command-line options at build time by entering them here.  In
-	  most cases you will need to specify the root device here.
-
-config CMDLINE_FORCE
-	bool "Always use the default kernel command string"
-	depends on CMDLINE_BOOL
-	help
-	  Always use the default kernel command string, even if the boot
-	  loader passes other arguments to the kernel.
-	  This is useful if you cannot or don't want to change the
-	  command-line options your boot loader passes to the kernel.
-
 config EXTRA_TARGETS
 	string "Additional default image types"
 	help
diff --git a/arch/powerpc/configs/44x/fsp2_defconfig b/arch/powerpc/configs/44x/fsp2_defconfig
index bae6b26bcfba..bafea495c9b8 100644
--- a/arch/powerpc/configs/44x/fsp2_defconfig
+++ b/arch/powerpc/configs/44x/fsp2_defconfig
@@ -1,8 +1,6 @@
-CONFIG_44x=y
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 # CONFIG_CROSS_MEMORY_ATTACH is not set
-# CONFIG_FHANDLE is not set
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_IKCONFIG=y
@@ -13,25 +11,26 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_RD_XZ is not set
 # CONFIG_RD_LZO is not set
 # CONFIG_RD_LZ4 is not set
+# CONFIG_FHANDLE is not set
 CONFIG_KALLSYMS_ALL=y
 CONFIG_BPF_SYSCALL=y
 CONFIG_EMBEDDED=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE_PREPEND="ip=on rw"
+CONFIG_44x=y
 CONFIG_PPC_47x=y
 # CONFIG_EBONY is not set
 CONFIG_FSP2=y
 CONFIG_476FPE_ERR46=y
-CONFIG_SWIOTLB=y
 CONFIG_KEXEC=y
 CONFIG_CRASH_DUMP=y
-CONFIG_CMDLINE_BOOL=y
-CONFIG_CMDLINE="ip=on rw"
 # CONFIG_SUSPEND is not set
 # CONFIG_PCI is not set
+CONFIG_OPROFILE=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -112,6 +111,12 @@ CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_DEFAULT="n"
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_PCBC=y
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_HW is not set
 CONFIG_XZ_DEC=y
 CONFIG_PRINTK_TIME=y
 CONFIG_MESSAGE_LOGLEVEL_DEFAULT=3
@@ -119,9 +124,3 @@ CONFIG_DYNAMIC_DEBUG=y
 CONFIG_DEBUG_INFO=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DETECT_HUNG_TASK=y
-CONFIG_CRYPTO_CBC=y
-CONFIG_CRYPTO_ECB=y
-CONFIG_CRYPTO_PCBC=y
-CONFIG_CRYPTO_MD5=y
-CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_HW is not set
diff --git a/arch/powerpc/configs/44x/iss476-smp_defconfig b/arch/powerpc/configs/44x/iss476-smp_defconfig
index d24bfa6ecd62..775b25178714 100644
--- a/arch/powerpc/configs/44x/iss476-smp_defconfig
+++ b/arch/powerpc/configs/44x/iss476-smp_defconfig
@@ -1,5 +1,3 @@
-CONFIG_44x=y
-CONFIG_SMP=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
@@ -7,21 +5,23 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE_PREPEND="root=/dev/issblk0"
+CONFIG_44x=y
+CONFIG_SMP=y
 CONFIG_PPC_47x=y
 # CONFIG_EBONY is not set
 CONFIG_ISS4xx=y
 CONFIG_HZ_100=y
 CONFIG_MATH_EMULATION=y
 CONFIG_IRQ_ALL_CPUS=y
-CONFIG_CMDLINE_BOOL=y
-CONFIG_CMDLINE="root=/dev/issblk0"
 # CONFIG_PCI is not set
 CONFIG_ADVANCED_OPTIONS=y
 CONFIG_DYNAMIC_MEMSTART=y
+CONFIG_OPROFILE=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -62,13 +62,13 @@ CONFIG_PROC_KCORE=y
 CONFIG_TMPFS=y
 CONFIG_CRAMFS=y
 # CONFIG_NETWORK_FILESYSTEMS is not set
-CONFIG_DEBUG_INFO=y
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_DETECT_HUNG_TASK=y
-CONFIG_PPC_EARLY_DEBUG=y
 CONFIG_CRYPTO_CBC=y
 CONFIG_CRYPTO_ECB=y
 CONFIG_CRYPTO_PCBC=y
 CONFIG_CRYPTO_MD5=y
 CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_HW is not set
+CONFIG_DEBUG_INFO=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DETECT_HUNG_TASK=y
+CONFIG_PPC_EARLY_DEBUG=y
diff --git a/arch/powerpc/configs/44x/warp_defconfig b/arch/powerpc/configs/44x/warp_defconfig
index 6c02f53271cd..4b76897e323f 100644
--- a/arch/powerpc/configs/44x/warp_defconfig
+++ b/arch/powerpc/configs/44x/warp_defconfig
@@ -1,4 +1,3 @@
-CONFIG_44x=y
 CONFIG_LOCALVERSION="-pika"
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SYSVIPC=y
@@ -7,16 +6,17 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE_PREPEND="ip=on"
+CONFIG_44x=y
 # CONFIG_EBONY is not set
 CONFIG_WARP=y
 CONFIG_PPC4xx_GPIO=y
 CONFIG_HZ_1000=y
-CONFIG_CMDLINE_BOOL=y
-CONFIG_CMDLINE="ip=on"
 # CONFIG_PCI is not set
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
diff --git a/arch/powerpc/configs/holly_defconfig b/arch/powerpc/configs/holly_defconfig
index 71d8d2430b6c..0f233b4f78eb 100644
--- a/arch/powerpc/configs/holly_defconfig
+++ b/arch/powerpc/configs/holly_defconfig
@@ -4,18 +4,18 @@ CONFIG_HIGH_RES_TIMERS=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
-CONFIG_MODULES=y
-# CONFIG_BLK_DEV_BSG is not set
-CONFIG_PARTITION_ADVANCED=y
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE_PREPEND="console=ttyS0,115200"
 # CONFIG_PPC_CHRP is not set
 # CONFIG_PPC_PMAC is not set
 CONFIG_EMBEDDED6xx=y
 CONFIG_PPC_HOLLY=y
 CONFIG_GEN_RTC=y
-CONFIG_BINFMT_MISC=y
-CONFIG_CMDLINE_BOOL=y
-CONFIG_CMDLINE="console=ttyS0,115200"
 # CONFIG_SECCOMP is not set
+CONFIG_MODULES=y
+# CONFIG_BLK_DEV_BSG is not set
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_BINFMT_MISC=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
diff --git a/arch/powerpc/configs/mvme5100_defconfig b/arch/powerpc/configs/mvme5100_defconfig
index 63e38c7220f1..29913bf3fb6e 100644
--- a/arch/powerpc/configs/mvme5100_defconfig
+++ b/arch/powerpc/configs/mvme5100_defconfig
@@ -11,19 +11,19 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_NET_NS is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 # CONFIG_COMPAT_BRK is not set
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE_PREPEND="console=ttyS0,9600 ip=dhcp root=/dev/nfs"
 # CONFIG_PPC_CHRP is not set
 # CONFIG_PPC_PMAC is not set
 CONFIG_EMBEDDED6xx=y
 CONFIG_MVME5100=y
 CONFIG_KVM_GUEST=y
 CONFIG_HZ_100=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 # CONFIG_COMPACTION is not set
-CONFIG_CMDLINE_BOOL=y
-CONFIG_CMDLINE="console=ttyS0,9600 ip=dhcp root=/dev/nfs"
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -46,7 +46,6 @@ CONFIG_NF_CONNTRACK_TFTP=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
-CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_IP_NF_IPTABLES=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
@@ -111,13 +110,6 @@ CONFIG_NLS_CODEPAGE_437=m
 CONFIG_NLS_CODEPAGE_932=m
 CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_UTF8=m
-CONFIG_CRC_CCITT=m
-CONFIG_CRC_T10DIF=y
-CONFIG_XZ_DEC=y
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_DEBUG_KERNEL=y
-CONFIG_DETECT_HUNG_TASK=y
-CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=20
 CONFIG_CRYPTO_CBC=y
 CONFIG_CRYPTO_PCBC=m
 CONFIG_CRYPTO_MD5=y
@@ -128,3 +120,10 @@ CONFIG_CRYPTO_DES=y
 CONFIG_CRYPTO_SERPENT=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRC_CCITT=m
+CONFIG_CRC_T10DIF=y
+CONFIG_XZ_DEC=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DETECT_HUNG_TASK=y
+CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=20
diff --git a/arch/powerpc/configs/skiroot_defconfig b/arch/powerpc/configs/skiroot_defconfig
index 5ba131c30f6b..692a542b4d99 100644
--- a/arch/powerpc/configs/skiroot_defconfig
+++ b/arch/powerpc/configs/skiroot_defconfig
@@ -1,8 +1,3 @@
-CONFIG_PPC64=y
-CONFIG_ALTIVEC=y
-CONFIG_VSX=y
-CONFIG_NR_CPUS=2048
-CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_KERNEL_XZ=y
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
@@ -53,9 +48,21 @@ CONFIG_NUMA=y
 CONFIG_PPC_64K_PAGES=y
 CONFIG_SCHED_SMT=y
 CONFIG_CMDLINE_BOOL=y
-CONFIG_CMDLINE="console=tty0 console=hvc0 ipr.fast_reboot=1 quiet"
+CONFIG_CMDLINE_PREPEND="console=tty0 console=hvc0 ipr.fast_reboot=1 quiet"
 # CONFIG_SECCOMP is not set
 # CONFIG_PPC_MEM_KEYS is not set
+CONFIG_JUMP_LABEL=y
+CONFIG_STRICT_KERNEL_RWX=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_SIG=y
+CONFIG_MODULE_SIG_FORCE=y
+CONFIG_MODULE_SIG_SHA512=y
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_COMPACTION is not set
+# CONFIG_MIGRATION is not set
+# CONFIG_BOUNCE is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -158,7 +165,6 @@ CONFIG_IGB=m
 CONFIG_IXGB=m
 CONFIG_IXGBE=m
 CONFIG_I40E=m
-CONFIG_S2IO=m
 # CONFIG_NET_VENDOR_MARVELL is not set
 CONFIG_MLX4_EN=m
 # CONFIG_MLX4_CORE_GEN2 is not set
@@ -167,6 +173,7 @@ CONFIG_MLX5_CORE=m
 # CONFIG_NET_VENDOR_MICROSEMI is not set
 CONFIG_MYRI10GE=m
 # CONFIG_NET_VENDOR_NATSEMI is not set
+CONFIG_S2IO=m
 # CONFIG_NET_VENDOR_NETRONOME is not set
 # CONFIG_NET_VENDOR_NI is not set
 # CONFIG_NET_VENDOR_NVIDIA is not set
@@ -274,6 +281,9 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
+CONFIG_ENCRYPTED_KEYS=y
+# CONFIG_CRYPTO_ECHAINIV is not set
+# CONFIG_CRYPTO_HW is not set
 CONFIG_CRC16=y
 CONFIG_CRC_ITU_T=y
 CONFIG_LIBCRC32C=y
@@ -295,6 +305,3 @@ CONFIG_WQ_WATCHDOG=y
 # CONFIG_RUNTIME_TESTING_MENU is not set
 CONFIG_XMON=y
 CONFIG_XMON_DEFAULT=y
-CONFIG_ENCRYPTED_KEYS=y
-# CONFIG_CRYPTO_ECHAINIV is not set
-# CONFIG_CRYPTO_HW is not set
diff --git a/arch/powerpc/configs/storcenter_defconfig b/arch/powerpc/configs/storcenter_defconfig
index 74bca2eccd0f..8c849339bfe5 100644
--- a/arch/powerpc/configs/storcenter_defconfig
+++ b/arch/powerpc/configs/storcenter_defconfig
@@ -2,19 +2,19 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
-CONFIG_PARTITION_ADVANCED=y
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE_PREPEND="console=ttyS0,115200"
 # CONFIG_PPC_CHRP is not set
 # CONFIG_PPC_PMAC is not set
 CONFIG_EMBEDDED6xx=y
 CONFIG_STORCENTER=y
 CONFIG_HZ_100=y
-CONFIG_BINFMT_MISC=y
-CONFIG_CMDLINE_BOOL=y
-CONFIG_CMDLINE="console=ttyS0,115200"
 # CONFIG_SECCOMP is not set
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_BLK_DEV_BSG is not set
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_BINFMT_MISC=y
 CONFIG_NET=y
 CONFIG_PACKET=m
 CONFIG_UNIX=y
@@ -81,5 +81,4 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
 CONFIG_CRC_T10DIF=y
-# CONFIG_ENABLE_WARN_DEPRECATED is not set
 # CONFIG_ENABLE_MUST_CHECK is not set
diff --git a/arch/powerpc/include/asm/book3s/64/hugetlb.h b/arch/powerpc/include/asm/book3s/64/hugetlb.h
index ec2a55a553c7..2e57538d65c2 100644
--- a/arch/powerpc/include/asm/book3s/64/hugetlb.h
+++ b/arch/powerpc/include/asm/book3s/64/hugetlb.h
@@ -36,8 +36,8 @@ static inline int hstate_get_psize(struct hstate *hstate)
 	}
 }
 
-#ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE
-static inline bool gigantic_page_supported(void)
+#ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE_RUNTIME_ALLOCATION
+static inline bool gigantic_page_runtime_allocation_supported(void)
 {
 	/*
 	 * We used gigantic page reservation with hypervisor assist in some case.
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index c5698a523bb1..23f7ed796f38 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -302,6 +302,7 @@
 /* Misc instructions for BPF compiler */
 #define PPC_INST_LBZ			0x88000000
 #define PPC_INST_LD			0xe8000000
+#define PPC_INST_LDX			0x7c00002a
 #define PPC_INST_LHZ			0xa0000000
 #define PPC_INST_LWZ			0x80000000
 #define PPC_INST_LHBRX			0x7c00062c
@@ -309,6 +310,7 @@
 #define PPC_INST_STB			0x98000000
 #define PPC_INST_STH			0xb0000000
 #define PPC_INST_STD			0xf8000000
+#define PPC_INST_STDX			0x7c00012a
 #define PPC_INST_STDU			0xf8000001
 #define PPC_INST_STW			0x90000000
 #define PPC_INST_STWU			0x94000000
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index dd9e0d5386ee..e85e99a64678 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1298,16 +1298,6 @@ void show_user_instructions(struct pt_regs *regs)
 
 	pc = regs->nip - (NR_INSN_TO_PRINT * 3 / 4 * sizeof(int));
 
-	/*
-	 * Make sure the NIP points at userspace, not kernel text/data or
-	 * elsewhere.
-	 */
-	if (!__access_ok(pc, NR_INSN_TO_PRINT * sizeof(int), USER_DS)) {
-		pr_info("%s[%d]: Bad NIP, not dumping instructions.\n",
-			current->comm, current->pid);
-		return;
-	}
-
 	seq_buf_init(&s, buf, sizeof(buf));
 
 	while (n) {
@@ -1318,7 +1308,7 @@ void show_user_instructions(struct pt_regs *regs)
 		for (i = 0; i < 8 && n; i++, n--, pc += sizeof(int)) {
 			int instr;
 
-			if (probe_kernel_address((const void *)pc, instr)) {
+			if (probe_user_read(&instr, (void __user *)pc, sizeof(instr))) {
 				seq_buf_printf(&s, "XXXXXXXX ");
 				continue;
 			}
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 4221527b082f..c0ed4fa0b9d3 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -34,6 +34,7 @@
 #include <linux/of_fdt.h>
 #include <linux/libfdt.h>
 #include <linux/cpu.h>
+#include <linux/cmdline.h>
 
 #include <asm/prom.h>
 #include <asm/rtas.h>
@@ -719,6 +720,9 @@ void __init early_init_devtree(void *params)
 	 */
 	of_scan_flat_dt(early_init_dt_scan_chosen_ppc, boot_command_line);
 
+	/* append and prepend any arguments built into the kernel. */
+	cmdline_add_builtin(boot_command_line, NULL, COMMAND_LINE_SIZE);
+
 	/* Scan memory nodes and rebuild MEMBLOCKs */
 	of_scan_flat_dt(early_init_dt_scan_root, NULL);
 	of_scan_flat_dt(early_init_dt_scan_memory_ppc, NULL);
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index f33ff4163a51..e8e9fca22470 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -30,6 +30,7 @@
 #include <linux/delay.h>
 #include <linux/initrd.h>
 #include <linux/bitops.h>
+#include <linux/cmdline.h>
 #include <asm/prom.h>
 #include <asm/rtas.h>
 #include <asm/page.h>
@@ -637,11 +638,10 @@ static void __init early_cmdline_parse(void)
 	p = prom_cmd_line;
 	if ((long)prom.chosen > 0)
 		l = prom_getprop(prom.chosen, "bootargs", p, COMMAND_LINE_SIZE-1);
-#ifdef CONFIG_CMDLINE
+
 	if (l <= 0 || p[0] == '\0') /* dbl check */
-		strlcpy(prom_cmd_line,
-			CONFIG_CMDLINE, sizeof(prom_cmd_line));
-#endif /* CONFIG_CMDLINE */
+		cmdline_add_builtin_section(prom_cmd_line, NULL, sizeof(prom_cmd_line), __prombss);
+
 	prom_printf("command line: %s\n", prom_cmd_line);
 
 #ifdef CONFIG_PPC64
diff --git a/arch/powerpc/kernel/prom_init_check.sh b/arch/powerpc/kernel/prom_init_check.sh
index 667df97d2595..ab2acc8d8b5a 100644
--- a/arch/powerpc/kernel/prom_init_check.sh
+++ b/arch/powerpc/kernel/prom_init_check.sh
@@ -18,7 +18,7 @@
 
 WHITELIST="add_reloc_offset __bss_start __bss_stop copy_and_flush
 _end enter_prom memcpy memset reloc_offset __secondary_hold
-__secondary_hold_acknowledge __secondary_hold_spinloop __start
+__secondary_hold_acknowledge __secondary_hold_spinloop __start strlcat
 strcmp strcpy strlcpy strlen strncmp strstr kstrtobool logo_linux_clut224
 reloc_got2 kernstart_addr memstart_addr linux_banner _stext
 __prom_init_toc_start __prom_init_toc_end btext_setup_display TOC."
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 887f11bcf330..ec74305fa330 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -276,12 +276,8 @@ static bool bad_stack_expansion(struct pt_regs *regs, unsigned long address,
 		if ((flags & FAULT_FLAG_WRITE) && (flags & FAULT_FLAG_USER) &&
 		    access_ok(nip, sizeof(*nip))) {
 			unsigned int inst;
-			int res;
 
-			pagefault_disable();
-			res = __get_user_inatomic(inst, nip);
-			pagefault_enable();
-			if (!res)
+			if (!probe_user_read(&inst, nip, sizeof(inst)))
 				return !store_updates_sp(inst);
 			*must_retry = true;
 		}
diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h
index 549e9490ff2a..dcac37745b05 100644
--- a/arch/powerpc/net/bpf_jit.h
+++ b/arch/powerpc/net/bpf_jit.h
@@ -51,6 +51,8 @@
 #define PPC_LIS(r, i)		PPC_ADDIS(r, 0, i)
 #define PPC_STD(r, base, i)	EMIT(PPC_INST_STD | ___PPC_RS(r) |	      \
 				     ___PPC_RA(base) | ((i) & 0xfffc))
+#define PPC_STDX(r, base, b)	EMIT(PPC_INST_STDX | ___PPC_RS(r) |	      \
+				     ___PPC_RA(base) | ___PPC_RB(b))
 #define PPC_STDU(r, base, i)	EMIT(PPC_INST_STDU | ___PPC_RS(r) |	      \
 				     ___PPC_RA(base) | ((i) & 0xfffc))
 #define PPC_STW(r, base, i)	EMIT(PPC_INST_STW | ___PPC_RS(r) |	      \
@@ -65,7 +67,9 @@
 #define PPC_LBZ(r, base, i)	EMIT(PPC_INST_LBZ | ___PPC_RT(r) |	      \
 				     ___PPC_RA(base) | IMM_L(i))
 #define PPC_LD(r, base, i)	EMIT(PPC_INST_LD | ___PPC_RT(r) |	      \
-				     ___PPC_RA(base) | IMM_L(i))
+				     ___PPC_RA(base) | ((i) & 0xfffc))
+#define PPC_LDX(r, base, b)	EMIT(PPC_INST_LDX | ___PPC_RT(r) |	      \
+				     ___PPC_RA(base) | ___PPC_RB(b))
 #define PPC_LWZ(r, base, i)	EMIT(PPC_INST_LWZ | ___PPC_RT(r) |	      \
 				     ___PPC_RA(base) | IMM_L(i))
 #define PPC_LHZ(r, base, i)	EMIT(PPC_INST_LHZ | ___PPC_RT(r) |	      \
@@ -85,17 +89,6 @@
 					___PPC_RA(a) | ___PPC_RB(b))
 #define PPC_BPF_STDCX(s, a, b)	EMIT(PPC_INST_STDCX | ___PPC_RS(s) |	      \
 					___PPC_RA(a) | ___PPC_RB(b))
-
-#ifdef CONFIG_PPC64
-#define PPC_BPF_LL(r, base, i) do { PPC_LD(r, base, i); } while(0)
-#define PPC_BPF_STL(r, base, i) do { PPC_STD(r, base, i); } while(0)
-#define PPC_BPF_STLU(r, base, i) do { PPC_STDU(r, base, i); } while(0)
-#else
-#define PPC_BPF_LL(r, base, i) do { PPC_LWZ(r, base, i); } while(0)
-#define PPC_BPF_STL(r, base, i) do { PPC_STW(r, base, i); } while(0)
-#define PPC_BPF_STLU(r, base, i) do { PPC_STWU(r, base, i); } while(0)
-#endif
-
 #define PPC_CMPWI(a, i)		EMIT(PPC_INST_CMPWI | ___PPC_RA(a) | IMM_L(i))
 #define PPC_CMPDI(a, i)		EMIT(PPC_INST_CMPDI | ___PPC_RA(a) | IMM_L(i))
 #define PPC_CMPW(a, b)		EMIT(PPC_INST_CMPW | ___PPC_RA(a) |	      \
diff --git a/arch/powerpc/net/bpf_jit32.h b/arch/powerpc/net/bpf_jit32.h
index dc50a8d4b3b9..21744d8aa053 100644
--- a/arch/powerpc/net/bpf_jit32.h
+++ b/arch/powerpc/net/bpf_jit32.h
@@ -122,6 +122,10 @@ DECLARE_LOAD_FUNC(sk_load_byte_msh);
 #define PPC_NTOHS_OFFS(r, base, i)	PPC_LHZ_OFFS(r, base, i)
 #endif
 
+#define PPC_BPF_LL(r, base, i) do { PPC_LWZ(r, base, i); } while(0)
+#define PPC_BPF_STL(r, base, i) do { PPC_STW(r, base, i); } while(0)
+#define PPC_BPF_STLU(r, base, i) do { PPC_STWU(r, base, i); } while(0)
+
 #define SEEN_DATAREF 0x10000 /* might call external helpers */
 #define SEEN_XREG    0x20000 /* X reg is used */
 #define SEEN_MEM     0x40000 /* SEEN_MEM+(1<<n) = use mem[n] for temporary
diff --git a/arch/powerpc/net/bpf_jit64.h b/arch/powerpc/net/bpf_jit64.h
index 3609be4692b3..47f441f351a6 100644
--- a/arch/powerpc/net/bpf_jit64.h
+++ b/arch/powerpc/net/bpf_jit64.h
@@ -68,6 +68,26 @@ static const int b2p[] = {
 /* PPC NVR range -- update this if we ever use NVRs below r27 */
 #define BPF_PPC_NVR_MIN		27
 
+/*
+ * WARNING: These can use TMP_REG_2 if the offset is not at word boundary,
+ * so ensure that it isn't in use already.
+ */
+#define PPC_BPF_LL(r, base, i) do {					      \
+				if ((i) % 4) {				      \
+					PPC_LI(b2p[TMP_REG_2], (i));	      \
+					PPC_LDX(r, base, b2p[TMP_REG_2]);     \
+				} else					      \
+					PPC_LD(r, base, i);		      \
+				} while(0)
+#define PPC_BPF_STL(r, base, i) do {					      \
+				if ((i) % 4) {				      \
+					PPC_LI(b2p[TMP_REG_2], (i));	      \
+					PPC_STDX(r, base, b2p[TMP_REG_2]);    \
+				} else					      \
+					PPC_STD(r, base, i);		      \
+				} while(0)
+#define PPC_BPF_STLU(r, base, i) do { PPC_STDU(r, base, i); } while(0)
+
 #define SEEN_FUNC	0x1000 /* might call external helpers */
 #define SEEN_STACK	0x2000 /* uses BPF stack */
 #define SEEN_TAILCALL	0x4000 /* uses tail calls */
diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c
index 4194d3cfb60c..21a1dcd4b156 100644
--- a/arch/powerpc/net/bpf_jit_comp64.c
+++ b/arch/powerpc/net/bpf_jit_comp64.c
@@ -252,7 +252,7 @@ static void bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32
 	 * if (tail_call_cnt > MAX_TAIL_CALL_CNT)
 	 *   goto out;
 	 */
-	PPC_LD(b2p[TMP_REG_1], 1, bpf_jit_stack_tailcallcnt(ctx));
+	PPC_BPF_LL(b2p[TMP_REG_1], 1, bpf_jit_stack_tailcallcnt(ctx));
 	PPC_CMPLWI(b2p[TMP_REG_1], MAX_TAIL_CALL_CNT);
 	PPC_BCC(COND_GT, out);
 
@@ -265,7 +265,7 @@ static void bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32
 	/* prog = array->ptrs[index]; */
 	PPC_MULI(b2p[TMP_REG_1], b2p_index, 8);
 	PPC_ADD(b2p[TMP_REG_1], b2p[TMP_REG_1], b2p_bpf_array);
-	PPC_LD(b2p[TMP_REG_1], b2p[TMP_REG_1], offsetof(struct bpf_array, ptrs));
+	PPC_BPF_LL(b2p[TMP_REG_1], b2p[TMP_REG_1], offsetof(struct bpf_array, ptrs));
 
 	/*
 	 * if (prog == NULL)
@@ -275,7 +275,7 @@ static void bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32
 	PPC_BCC(COND_EQ, out);
 
 	/* goto *(prog->bpf_func + prologue_size); */
-	PPC_LD(b2p[TMP_REG_1], b2p[TMP_REG_1], offsetof(struct bpf_prog, bpf_func));
+	PPC_BPF_LL(b2p[TMP_REG_1], b2p[TMP_REG_1], offsetof(struct bpf_prog, bpf_func));
 #ifdef PPC64_ELF_ABI_v1
 	/* skip past the function descriptor */
 	PPC_ADDI(b2p[TMP_REG_1], b2p[TMP_REG_1],
@@ -606,7 +606,7 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
 				 * the instructions generated will remain the
 				 * same across all passes
 				 */
-				PPC_STD(dst_reg, 1, bpf_jit_stack_local(ctx));
+				PPC_BPF_STL(dst_reg, 1, bpf_jit_stack_local(ctx));
 				PPC_ADDI(b2p[TMP_REG_1], 1, bpf_jit_stack_local(ctx));
 				PPC_LDBRX(dst_reg, 0, b2p[TMP_REG_1]);
 				break;
@@ -662,7 +662,7 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
 				PPC_LI32(b2p[TMP_REG_1], imm);
 				src_reg = b2p[TMP_REG_1];
 			}
-			PPC_STD(src_reg, dst_reg, off);
+			PPC_BPF_STL(src_reg, dst_reg, off);
 			break;
 
 		/*
@@ -709,7 +709,7 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
 			break;
 		/* dst = *(u64 *)(ul) (src + off) */
 		case BPF_LDX | BPF_MEM | BPF_DW:
-			PPC_LD(dst_reg, src_reg, off);
+			PPC_BPF_LL(dst_reg, src_reg, off);
 			break;
 
 		/*
diff --git a/arch/powerpc/perf/callchain.c b/arch/powerpc/perf/callchain.c
index 0af051a1974e..0680efb2237b 100644
--- a/arch/powerpc/perf/callchain.c
+++ b/arch/powerpc/perf/callchain.c
@@ -159,12 +159,8 @@ static int read_user_stack_64(unsigned long __user *ptr, unsigned long *ret)
 	    ((unsigned long)ptr & 7))
 		return -EFAULT;
 
-	pagefault_disable();
-	if (!__get_user_inatomic(*ret, ptr)) {
-		pagefault_enable();
+	if (!probe_user_read(ret, ptr, sizeof(*ret)))
 		return 0;
-	}
-	pagefault_enable();
 
 	return read_user_stack_slow(ptr, ret, 8);
 }
@@ -175,12 +171,8 @@ static int read_user_stack_32(unsigned int __user *ptr, unsigned int *ret)
 	    ((unsigned long)ptr & 3))
 		return -EFAULT;
 
-	pagefault_disable();
-	if (!__get_user_inatomic(*ret, ptr)) {
-		pagefault_enable();
+	if (!probe_user_read(ret, ptr, sizeof(*ret)))
 		return 0;
-	}
-	pagefault_enable();
 
 	return read_user_stack_slow(ptr, ret, 4);
 }
@@ -307,17 +299,11 @@ static inline int current_is_64bit(void)
  */
 static int read_user_stack_32(unsigned int __user *ptr, unsigned int *ret)
 {
-	int rc;
-
 	if ((unsigned long)ptr > TASK_SIZE - sizeof(unsigned int) ||
 	    ((unsigned long)ptr & 3))
 		return -EFAULT;
 
-	pagefault_disable();
-	rc = __get_user_inatomic(*ret, ptr);
-	pagefault_enable();
-
-	return rc;
+	return probe_user_read(ret, ptr, sizeof(*ret));
 }
 
 static inline void perf_callchain_user_64(struct perf_callchain_entry_ctx *entry,
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index b0723002a396..4b64ddf0db68 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -416,7 +416,6 @@ static void power_pmu_sched_task(struct perf_event_context *ctx, bool sched_in)
 static __u64 power_pmu_bhrb_to(u64 addr)
 {
 	unsigned int instr;
-	int ret;
 	__u64 target;
 
 	if (is_kernel_addr(addr)) {
@@ -427,13 +426,8 @@ static __u64 power_pmu_bhrb_to(u64 addr)
 	}
 
 	/* Userspace: need copy instruction here then translate it */
-	pagefault_disable();
-	ret = __get_user_inatomic(instr, (unsigned int __user *)addr);
-	if (ret) {
-		pagefault_enable();
+	if (probe_user_read(&instr, (unsigned int __user *)addr, sizeof(instr)))
 		return 0;
-	}
-	pagefault_enable();
 
 	target = branch_target(&instr);
 	if ((!target) || (instr & BRANCH_ABSOLUTE))
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index 842b2c7e156a..e68938a52f68 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -325,7 +325,7 @@ config ARCH_ENABLE_SPLIT_PMD_PTLOCK
 config PPC_RADIX_MMU
 	bool "Radix MMU Support"
 	depends on PPC_BOOK3S_64
-	select ARCH_HAS_GIGANTIC_PAGE if (MEMORY_ISOLATION && COMPACTION) || CMA
+	select ARCH_HAS_GIGANTIC_PAGE_RUNTIME_ALLOCATION if (MEMORY_ISOLATION && COMPACTION) || CMA
 	default y
 	help
 	  Enable support for the Power ISA 3.0 Radix style MMU. Currently this
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index f49aec251a5a..37b0ba5f4ff9 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -1069,13 +1069,11 @@ int fsl_pci_mcheck_exception(struct pt_regs *regs)
 	addr += mfspr(SPRN_MCAR);
 
 	if (is_in_pci_mem_space(addr)) {
-		if (user_mode(regs)) {
-			pagefault_disable();
-			ret = get_user(inst, (__u32 __user *)regs->nip);
-			pagefault_enable();
-		} else {
+		if (user_mode(regs))
+			ret = probe_user_read(&inst, (void __user *)regs->nip,
+					      sizeof(inst));
+		else
 			ret = probe_kernel_address((void *)regs->nip, inst);
-		}
 
 		if (!ret && mcheck_handle_load(regs, inst)) {
 			regs->nip += 4;
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index b6e3d0653002..d6af92470a9a 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -69,7 +69,7 @@ config S390
 	select ARCH_HAS_ELF_RANDOMIZE
 	select ARCH_HAS_FORTIFY_SOURCE
 	select ARCH_HAS_GCOV_PROFILE_ALL
-	select ARCH_HAS_GIGANTIC_PAGE if (MEMORY_ISOLATION && COMPACTION) || CMA
+	select ARCH_HAS_GIGANTIC_PAGE_RUNTIME_ALLOCATION if (MEMORY_ISOLATION && COMPACTION) || CMA
 	select ARCH_HAS_KCOV
 	select ARCH_HAS_PTE_SPECIAL
 	select ARCH_HAS_SET_MEMORY
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
index 7d22a474a040..f74639a05f0f 100644
--- a/arch/s390/include/asm/elf.h
+++ b/arch/s390/include/asm/elf.h
@@ -252,11 +252,14 @@ do {								\
 
 /*
  * Cache aliasing on the latest machines calls for a mapping granularity
- * of 512KB. For 64-bit processes use a 512KB alignment and a randomization
- * of up to 1GB. For 31-bit processes the virtual address space is limited,
- * use no alignment and limit the randomization to 8MB.
+ * of 512KB for the anonymous mapping base. For 64-bit processes use a
+ * 512KB alignment and a randomization of up to 1GB. For 31-bit processes
+ * the virtual address space is limited, use no alignment and limit the
+ * randomization to 8MB.
+ * For the additional randomization of the program break use 32MB for
+ * 64-bit and 8MB for 31-bit.
  */
-#define BRK_RND_MASK	(is_compat_task() ? 0x7ffUL : 0x3ffffUL)
+#define BRK_RND_MASK	(is_compat_task() ? 0x7ffUL : 0x1fffUL)
 #define MMAP_RND_MASK	(is_compat_task() ? 0x7ffUL : 0x3ff80UL)
 #define MMAP_ALIGN_MASK	(is_compat_task() ? 0 : 0x7fUL)
 #define STACK_RND_MASK	MMAP_RND_MASK
diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h
index 2d1afa58a4b6..57c952f5388e 100644
--- a/arch/s390/include/asm/hugetlb.h
+++ b/arch/s390/include/asm/hugetlb.h
@@ -116,7 +116,10 @@ static inline pte_t huge_pte_modify(pte_t pte, pgprot_t newprot)
 	return pte_modify(pte, newprot);
 }
 
-#ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE
-static inline bool gigantic_page_supported(void) { return true; }
+#ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE_RUNTIME_ALLOCATION
+static inline bool gigantic_page_runtime_allocation_supported(void)
+{
+	return true;
+}
 #endif
 #endif /* _ASM_S390_HUGETLB_H */
diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h
index cc0947e08b6f..5b9f10b1e55d 100644
--- a/arch/s390/include/asm/lowcore.h
+++ b/arch/s390/include/asm/lowcore.h
@@ -91,52 +91,53 @@ struct lowcore {
 	__u64	hardirq_timer;			/* 0x02e8 */
 	__u64	softirq_timer;			/* 0x02f0 */
 	__u64	steal_timer;			/* 0x02f8 */
-	__u64	last_update_timer;		/* 0x0300 */
-	__u64	last_update_clock;		/* 0x0308 */
-	__u64	int_clock;			/* 0x0310 */
-	__u64	mcck_clock;			/* 0x0318 */
-	__u64	clock_comparator;		/* 0x0320 */
-	__u64	boot_clock[2];			/* 0x0328 */
+	__u64	avg_steal_timer;		/* 0x0300 */
+	__u64	last_update_timer;		/* 0x0308 */
+	__u64	last_update_clock;		/* 0x0310 */
+	__u64	int_clock;			/* 0x0318*/
+	__u64	mcck_clock;			/* 0x0320 */
+	__u64	clock_comparator;		/* 0x0328 */
+	__u64	boot_clock[2];			/* 0x0330 */
 
 	/* Current process. */
-	__u64	current_task;			/* 0x0338 */
-	__u64	kernel_stack;			/* 0x0340 */
+	__u64	current_task;			/* 0x0340 */
+	__u64	kernel_stack;			/* 0x0348 */
 
 	/* Interrupt, DAT-off and restartstack. */
-	__u64	async_stack;			/* 0x0348 */
-	__u64	nodat_stack;			/* 0x0350 */
-	__u64	restart_stack;			/* 0x0358 */
+	__u64	async_stack;			/* 0x0350 */
+	__u64	nodat_stack;			/* 0x0358 */
+	__u64	restart_stack;			/* 0x0360 */
 
 	/* Restart function and parameter. */
-	__u64	restart_fn;			/* 0x0360 */
-	__u64	restart_data;			/* 0x0368 */
-	__u64	restart_source;			/* 0x0370 */
+	__u64	restart_fn;			/* 0x0368 */
+	__u64	restart_data;			/* 0x0370 */
+	__u64	restart_source;			/* 0x0378 */
 
 	/* Address space pointer. */
-	__u64	kernel_asce;			/* 0x0378 */
-	__u64	user_asce;			/* 0x0380 */
-	__u64	vdso_asce;			/* 0x0388 */
+	__u64	kernel_asce;			/* 0x0380 */
+	__u64	user_asce;			/* 0x0388 */
+	__u64	vdso_asce;			/* 0x0390 */
 
 	/*
 	 * The lpp and current_pid fields form a
 	 * 64-bit value that is set as program
 	 * parameter with the LPP instruction.
 	 */
-	__u32	lpp;				/* 0x0390 */
-	__u32	current_pid;			/* 0x0394 */
+	__u32	lpp;				/* 0x0398 */
+	__u32	current_pid;			/* 0x039c */
 
 	/* SMP info area */
-	__u32	cpu_nr;				/* 0x0398 */
-	__u32	softirq_pending;		/* 0x039c */
-	__u32	preempt_count;			/* 0x03a0 */
-	__u32	spinlock_lockval;		/* 0x03a4 */
-	__u32	spinlock_index;			/* 0x03a8 */
-	__u32	fpu_flags;			/* 0x03ac */
-	__u64	percpu_offset;			/* 0x03b0 */
-	__u64	vdso_per_cpu_data;		/* 0x03b8 */
-	__u64	machine_flags;			/* 0x03c0 */
-	__u64	gmap;				/* 0x03c8 */
-	__u8	pad_0x03d0[0x0400-0x03d0];	/* 0x03d0 */
+	__u32	cpu_nr;				/* 0x03a0 */
+	__u32	softirq_pending;		/* 0x03a4 */
+	__u32	preempt_count;			/* 0x03a8 */
+	__u32	spinlock_lockval;		/* 0x03ac */
+	__u32	spinlock_index;			/* 0x03b0 */
+	__u32	fpu_flags;			/* 0x03b4 */
+	__u64	percpu_offset;			/* 0x03b8 */
+	__u64	vdso_per_cpu_data;		/* 0x03c0 */
+	__u64	machine_flags;			/* 0x03c8 */
+	__u64	gmap;				/* 0x03d0 */
+	__u8	pad_0x03d8[0x0400-0x03d8];	/* 0x03d8 */
 
 	/* br %r1 trampoline */
 	__u16	br_r1_trampoline;		/* 0x0400 */
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 3fe1c77c361b..bd197baf1dc3 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -266,7 +266,8 @@ static void pcpu_prepare_secondary(struct pcpu *pcpu, int cpu)
 	lc->percpu_offset = __per_cpu_offset[cpu];
 	lc->kernel_asce = S390_lowcore.kernel_asce;
 	lc->machine_flags = S390_lowcore.machine_flags;
-	lc->user_timer = lc->system_timer = lc->steal_timer = 0;
+	lc->user_timer = lc->system_timer =
+		lc->steal_timer = lc->avg_steal_timer = 0;
 	__ctl_store(lc->cregs_save_area, 0, 15);
 	save_access_regs((unsigned int *) lc->access_regs_save_area);
 	memcpy(lc->stfle_fac_list, S390_lowcore.stfle_fac_list,
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c
index 98f850e00008..a69a0911ed0e 100644
--- a/arch/s390/kernel/vtime.c
+++ b/arch/s390/kernel/vtime.c
@@ -124,7 +124,7 @@ static void account_system_index_scaled(struct task_struct *p, u64 cputime,
  */
 static int do_account_vtime(struct task_struct *tsk)
 {
-	u64 timer, clock, user, guest, system, hardirq, softirq, steal;
+	u64 timer, clock, user, guest, system, hardirq, softirq;
 
 	timer = S390_lowcore.last_update_timer;
 	clock = S390_lowcore.last_update_clock;
@@ -182,12 +182,6 @@ static int do_account_vtime(struct task_struct *tsk)
 	if (softirq)
 		account_system_index_scaled(tsk, softirq, CPUTIME_SOFTIRQ);
 
-	steal = S390_lowcore.steal_timer;
-	if ((s64) steal > 0) {
-		S390_lowcore.steal_timer = 0;
-		account_steal_time(cputime_to_nsecs(steal));
-	}
-
 	return virt_timer_forward(user + guest + system + hardirq + softirq);
 }
 
@@ -213,8 +207,19 @@ void vtime_task_switch(struct task_struct *prev)
  */
 void vtime_flush(struct task_struct *tsk)
 {
+	u64 steal, avg_steal;
+
 	if (do_account_vtime(tsk))
 		virt_timer_expire();
+
+	steal = S390_lowcore.steal_timer;
+	avg_steal = S390_lowcore.avg_steal_timer / 2;
+	if ((s64) steal > 0) {
+		S390_lowcore.steal_timer = 0;
+		account_steal_time(steal);
+		avg_steal += steal;
+	}
+	S390_lowcore.avg_steal_timer = avg_steal;
 }
 
 /*
diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h
index 1393a8ac596b..22500c3be7a9 100644
--- a/arch/sparc/include/asm/pgtable_64.h
+++ b/arch/sparc/include/asm/pgtable_64.h
@@ -231,36 +231,6 @@ extern unsigned long _PAGE_ALL_SZ_BITS;
 extern struct page *mem_map_zero;
 #define ZERO_PAGE(vaddr)	(mem_map_zero)
 
-/* This macro must be updated when the size of struct page grows above 80
- * or reduces below 64.
- * The idea that compiler optimizes out switch() statement, and only
- * leaves clrx instructions
- */
-#define	mm_zero_struct_page(pp) do {					\
-	unsigned long *_pp = (void *)(pp);				\
-									\
-	 /* Check that struct page is either 64, 72, or 80 bytes */	\
-	BUILD_BUG_ON(sizeof(struct page) & 7);				\
-	BUILD_BUG_ON(sizeof(struct page) < 64);				\
-	BUILD_BUG_ON(sizeof(struct page) > 80);				\
-									\
-	switch (sizeof(struct page)) {					\
-	case 80:							\
-		_pp[9] = 0;	/* fallthrough */			\
-	case 72:							\
-		_pp[8] = 0;	/* fallthrough */			\
-	default:							\
-		_pp[7] = 0;						\
-		_pp[6] = 0;						\
-		_pp[5] = 0;						\
-		_pp[4] = 0;						\
-		_pp[3] = 0;						\
-		_pp[2] = 0;						\
-		_pp[1] = 0;						\
-		_pp[0] = 0;						\
-	}								\
-} while (0)
-
 /* PFNs are real physical page numbers.  However, mem_map only begins to record
  * per-page information starting at pfn_base.  This is to handle systems where
  * the first physical page in the machine is at some huge physical address,
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c1f9b3cf437c..c4232938563c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -21,7 +21,7 @@ config X86_64
 	def_bool y
 	depends on 64BIT
 	# Options that are inherently 64-bit kernel only:
-	select ARCH_HAS_GIGANTIC_PAGE if (MEMORY_ISOLATION && COMPACTION) || CMA
+	select ARCH_HAS_GIGANTIC_PAGE_RUNTIME_ALLOCATION if (MEMORY_ISOLATION && COMPACTION) || CMA
 	select ARCH_SUPPORTS_INT128
 	select ARCH_USE_CMPXCHG_LOCKREF
 	select HAVE_ARCH_SOFT_DIRTY
@@ -94,6 +94,7 @@ config X86
 	select GENERIC_CLOCKEVENTS_BROADCAST	if X86_64 || (X86_32 && X86_LOCAL_APIC)
 	select GENERIC_CLOCKEVENTS_MIN_ADJUST
 	select GENERIC_CMOS_UPDATE
+	select GENERIC_CMDLINE
 	select GENERIC_CPU_AUTOPROBE
 	select GENERIC_CPU_VULNERABILITIES
 	select GENERIC_EARLY_IOREMAP
@@ -2334,49 +2335,6 @@ choice
 
 endchoice
 
-config CMDLINE_BOOL
-	bool "Built-in kernel command line"
-	---help---
-	  Allow for specifying boot arguments to the kernel at
-	  build time.  On some systems (e.g. embedded ones), it is
-	  necessary or convenient to provide some or all of the
-	  kernel boot arguments with the kernel itself (that is,
-	  to not rely on the boot loader to provide them.)
-
-	  To compile command line arguments into the kernel,
-	  set this option to 'Y', then fill in the
-	  boot arguments in CONFIG_CMDLINE.
-
-	  Systems with fully functional boot loaders (i.e. non-embedded)
-	  should leave this option set to 'N'.
-
-config CMDLINE
-	string "Built-in kernel command string"
-	depends on CMDLINE_BOOL
-	default ""
-	---help---
-	  Enter arguments here that should be compiled into the kernel
-	  image and used at boot time.  If the boot loader provides a
-	  command line at boot time, it is appended to this string to
-	  form the full kernel command line, when the system boots.
-
-	  However, you can use the CONFIG_CMDLINE_OVERRIDE option to
-	  change this behavior.
-
-	  In most cases, the command line (whether built-in or provided
-	  by the boot loader) should specify the device for the root
-	  file system.
-
-config CMDLINE_OVERRIDE
-	bool "Built-in command line overrides boot loader arguments"
-	depends on CMDLINE_BOOL
-	---help---
-	  Set this option to 'Y' to have the kernel ignore the boot loader
-	  command line, and use ONLY the built-in command line.
-
-	  This is used to work around broken boot loaders.  This should
-	  be set to 'N' under normal conditions.
-
 config MODIFY_LDT_SYSCALL
 	bool "Enable the LDT (local descriptor table)" if EXPERT
 	default y
diff --git a/arch/x86/include/asm/cpu_device_id.h b/arch/x86/include/asm/cpu_device_id.h
index 3417110574c1..31c379c1da41 100644
--- a/arch/x86/include/asm/cpu_device_id.h
+++ b/arch/x86/include/asm/cpu_device_id.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _CPU_DEVICE_ID
-#define _CPU_DEVICE_ID 1
+#ifndef _ASM_X86_CPU_DEVICE_ID
+#define _ASM_X86_CPU_DEVICE_ID
 
 /*
  * Declare drivers belonging to specific x86 CPUs
@@ -9,8 +9,6 @@
 
 #include <linux/mod_devicetable.h>
 
-extern const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match);
-
 /*
  * Match specific microcode revisions.
  *
@@ -22,21 +20,22 @@ extern const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match);
  */
 
 struct x86_cpu_desc {
-	__u8	x86_family;
-	__u8	x86_vendor;
-	__u8	x86_model;
-	__u8	x86_stepping;
-	__u32	x86_microcode_rev;
+	u8	x86_family;
+	u8	x86_vendor;
+	u8	x86_model;
+	u8	x86_stepping;
+	u32	x86_microcode_rev;
 };
 
-#define INTEL_CPU_DESC(mod, step, rev) {			\
-	.x86_family = 6,					\
-	.x86_vendor = X86_VENDOR_INTEL,				\
-	.x86_model = mod,					\
-	.x86_stepping = step,					\
-	.x86_microcode_rev = rev,				\
+#define INTEL_CPU_DESC(model, stepping, revision) {		\
+	.x86_family		= 6,				\
+	.x86_vendor		= X86_VENDOR_INTEL,		\
+	.x86_model		= (model),			\
+	.x86_stepping		= (stepping),			\
+	.x86_microcode_rev	= (revision),			\
 }
 
+extern const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match);
 extern bool x86_cpu_has_min_microcode_rev(const struct x86_cpu_desc *table);
 
-#endif
+#endif /* _ASM_X86_CPU_DEVICE_ID */
diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
index 7469d321f072..5a5e7119ced4 100644
--- a/arch/x86/include/asm/hugetlb.h
+++ b/arch/x86/include/asm/hugetlb.h
@@ -17,8 +17,11 @@ static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
 
-#ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE
-static inline bool gigantic_page_supported(void) { return true; }
+#ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE_RUNTIME_ALLOCATION
+static inline bool gigantic_page_runtime_allocation_supported(void)
+{
+	return true;
+}
 #endif
 
 #endif /* _ASM_X86_HUGETLB_H */
diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h
index 43c029cdc3fe..7fa4fe880395 100644
--- a/arch/x86/include/asm/special_insns.h
+++ b/arch/x86/include/asm/special_insns.h
@@ -5,6 +5,7 @@
 
 #ifdef __KERNEL__
 
+#include <asm/processor-flags.h>
 #include <asm/nops.h>
 
 /*
@@ -25,7 +26,28 @@ static inline unsigned long native_read_cr0(void)
 
 static inline void native_write_cr0(unsigned long val)
 {
-	asm volatile("mov %0,%%cr0": : "r" (val), "m" (__force_order));
+	bool warn = false;
+
+again:
+	val |= X86_CR0_WP;
+	/*
+	 * In order to have the compiler not optimize away the check
+	 * after the cr4 write, mark "val" as being also an output ("+r")
+	 * by this asm() block so it will perform an explicit check, as
+	 * if it were "volatile".
+	 */
+	asm volatile("mov %0,%%cr0" : "+r" (val) : "m" (__force_order) : );
+	/*
+	 * If the MOV above was used directly as a ROP gadget we can
+	 * notice the lack of pinned bits in "val" and start the function
+	 * from the beginning to gain the WP bit for sure. And do it
+	 * without first taking the exception for a WARN().
+	 */
+	if ((val & X86_CR0_WP) != X86_CR0_WP) {
+		warn = true;
+		goto again;
+	}
+	WARN_ONCE(warn, "Attempt to unpin X86_CR0_WP, cr0 bypass attack?!\n");
 }
 
 static inline unsigned long native_read_cr2(void)
@@ -72,9 +94,28 @@ static inline unsigned long native_read_cr4(void)
 	return val;
 }
 
+extern volatile unsigned long cr4_pin;
+
 static inline void native_write_cr4(unsigned long val)
 {
+	unsigned long warn = 0;
+
+again:
+	val |= cr4_pin;
 	asm volatile("mov %0,%%cr4": : "r" (val), "m" (__force_order));
+	/*
+	 * If the MOV above was used directly as a ROP gadget we can
+	 * notice the lack of pinned bits in "val" and start the function
+	 * from the beginning to gain the cr4_pin bits for sure. Note
+	 * that "val" must be volatile to keep the compiler from
+	 * optimizing away this check.
+	 */
+	if ((val & cr4_pin) != cr4_pin) {
+		warn = ~val & cr4_pin;
+		goto again;
+	}
+	WARN_ONCE(warn, "Attempt to unpin cr4 bits: %lx; bypass attack?!\n",
+		  warn);
 }
 
 #ifdef CONFIG_X86_64
diff --git a/arch/x86/include/asm/syscall.h b/arch/x86/include/asm/syscall.h
index d653139857af..04fc5c120558 100644
--- a/arch/x86/include/asm/syscall.h
+++ b/arch/x86/include/asm/syscall.h
@@ -125,23 +125,30 @@ static inline void syscall_get_arguments(struct task_struct *task,
 		case 0:
 			if (!n--) break;
 			*args++ = regs->bx;
+			/* fall through */
 		case 1:
 			if (!n--) break;
 			*args++ = regs->cx;
+			/* fall through */
 		case 2:
 			if (!n--) break;
 			*args++ = regs->dx;
+			/* fall through */
 		case 3:
 			if (!n--) break;
 			*args++ = regs->si;
+			/* fall through */
 		case 4:
 			if (!n--) break;
 			*args++ = regs->di;
+			/* fall through */
 		case 5:
 			if (!n--) break;
 			*args++ = regs->bp;
+			/* fall through */
 		case 6:
 			if (!n--) break;
+			/* fall through */
 		default:
 			BUG();
 			break;
@@ -152,23 +159,30 @@ static inline void syscall_get_arguments(struct task_struct *task,
 		case 0:
 			if (!n--) break;
 			*args++ = regs->di;
+			/* fall through */
 		case 1:
 			if (!n--) break;
 			*args++ = regs->si;
+			/* fall through */
 		case 2:
 			if (!n--) break;
 			*args++ = regs->dx;
+			/* fall through */
 		case 3:
 			if (!n--) break;
 			*args++ = regs->r10;
+			/* fall through */
 		case 4:
 			if (!n--) break;
 			*args++ = regs->r8;
+			/* fall through */
 		case 5:
 			if (!n--) break;
 			*args++ = regs->r9;
+			/* fall through */
 		case 6:
 			if (!n--) break;
+			/* fall through */
 		default:
 			BUG();
 			break;
@@ -186,23 +200,30 @@ static inline void syscall_set_arguments(struct task_struct *task,
 		case 0:
 			if (!n--) break;
 			regs->bx = *args++;
+			/* fall through */
 		case 1:
 			if (!n--) break;
 			regs->cx = *args++;
+			/* fall through */
 		case 2:
 			if (!n--) break;
 			regs->dx = *args++;
+			/* fall through */
 		case 3:
 			if (!n--) break;
 			regs->si = *args++;
+			/* fall through */
 		case 4:
 			if (!n--) break;
 			regs->di = *args++;
+			/* fall through */
 		case 5:
 			if (!n--) break;
 			regs->bp = *args++;
+			/* fall through */
 		case 6:
 			if (!n--) break;
+			/* fall through */
 		default:
 			BUG();
 			break;
@@ -213,23 +234,30 @@ static inline void syscall_set_arguments(struct task_struct *task,
 		case 0:
 			if (!n--) break;
 			regs->di = *args++;
+			/* fall through */
 		case 1:
 			if (!n--) break;
 			regs->si = *args++;
+			/* fall through */
 		case 2:
 			if (!n--) break;
 			regs->dx = *args++;
+			/* fall through */
 		case 3:
 			if (!n--) break;
 			regs->r10 = *args++;
+			/* fall through */
 		case 4:
 			if (!n--) break;
 			regs->r8 = *args++;
+			/* fall through */
 		case 5:
 			if (!n--) break;
 			regs->r9 = *args++;
+			/* fall through */
 		case 6:
 			if (!n--) break;
+			/* fall through */
 		default:
 			BUG();
 			break;
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index cb28e98a0659..7e0ea4470f8e 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -312,10 +312,16 @@ static __init int setup_disable_smep(char *arg)
 }
 __setup("nosmep", setup_disable_smep);
 
+volatile unsigned long cr4_pin __ro_after_init;
+EXPORT_SYMBOL_GPL(cr4_pin);
+
 static __always_inline void setup_smep(struct cpuinfo_x86 *c)
 {
-	if (cpu_has(c, X86_FEATURE_SMEP))
+	if (cpu_has(c, X86_FEATURE_SMEP)) {
+		if (!(cr4_pin & X86_CR4_SMEP))
+			cr4_pin |= X86_CR4_SMEP;
 		cr4_set_bits(X86_CR4_SMEP);
+	}
 }
 
 static __init int setup_disable_smap(char *arg)
@@ -334,6 +340,8 @@ static __always_inline void setup_smap(struct cpuinfo_x86 *c)
 
 	if (cpu_has(c, X86_FEATURE_SMAP)) {
 #ifdef CONFIG_X86_SMAP
+		if (!(cr4_pin & X86_CR4_SMAP))
+			cr4_pin |= X86_CR4_SMAP;
 		cr4_set_bits(X86_CR4_SMAP);
 #else
 		cr4_clear_bits(X86_CR4_SMAP);
@@ -351,6 +359,8 @@ static __always_inline void setup_umip(struct cpuinfo_x86 *c)
 	if (!cpu_has(c, X86_FEATURE_UMIP))
 		goto out;
 
+	if (!(cr4_pin & X86_CR4_UMIP))
+		cr4_pin |= X86_CR4_UMIP;
 	cr4_set_bits(X86_CR4_UMIP);
 
 	pr_info_once("x86/cpu: User Mode Instruction Prevention (UMIP) activated\n");
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 3d872a527cd9..fa57de34776d 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -51,6 +51,7 @@
 #include <linux/dma-contiguous.h>
 #include <xen/xen.h>
 #include <uapi/linux/mount.h>
+#include <linux/cmdline.h>
 
 #include <linux/errno.h>
 #include <linux/kernel.h>
@@ -221,9 +222,6 @@ unsigned long saved_video_mode;
 #define RAMDISK_LOAD_FLAG		0x4000
 
 static char __initdata command_line[COMMAND_LINE_SIZE];
-#ifdef CONFIG_CMDLINE_BOOL
-static char __initdata builtin_cmdline[COMMAND_LINE_SIZE] = CONFIG_CMDLINE;
-#endif
 
 #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
 struct edd edd;
@@ -934,20 +932,9 @@ void __init setup_arch(char **cmdline_p)
 	bss_resource.start = __pa_symbol(__bss_start);
 	bss_resource.end = __pa_symbol(__bss_stop)-1;
 
-#ifdef CONFIG_CMDLINE_BOOL
-#ifdef CONFIG_CMDLINE_OVERRIDE
-	strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
-#else
-	if (builtin_cmdline[0]) {
-		/* append boot loader cmdline to builtin */
-		strlcat(builtin_cmdline, " ", COMMAND_LINE_SIZE);
-		strlcat(builtin_cmdline, boot_command_line, COMMAND_LINE_SIZE);
-		strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
-	}
-#endif
-#endif
-
+	cmdline_add_builtin(boot_command_line, NULL, COMMAND_LINE_SIZE);
 	strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
+
 	*cmdline_p = command_line;
 
 	/*
diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig
index 57410f9c5d44..c52c738e554a 100644
--- a/drivers/auxdisplay/Kconfig
+++ b/drivers/auxdisplay/Kconfig
@@ -164,9 +164,7 @@ config ARM_CHARLCD
 	  line and the Linux version on the second line, but that's
 	  still useful.
 
-endif # AUXDISPLAY
-
-menuconfig PANEL
+menuconfig PARPORT_PANEL
 	tristate "Parallel port LCD/Keypad Panel support"
 	depends on PARPORT
 	select CHARLCD
@@ -178,7 +176,7 @@ menuconfig PANEL
 	  compiled as a module, or linked into the kernel and started at boot.
 	  If you don't understand what all this is about, say N.
 
-if PANEL
+if PARPORT_PANEL
 
 config PANEL_PARPORT
 	int "Default parallel port number (0=LPT1)"
@@ -419,8 +417,11 @@ config PANEL_LCD_PIN_BL
 
 	  Default for the 'BL' pin in custom profile is '0' (uncontrolled).
 
+endif # PARPORT_PANEL
+
 config PANEL_CHANGE_MESSAGE
 	bool "Change LCD initialization message ?"
+	depends on CHARLCD
 	default "n"
 	---help---
 	  This allows you to replace the boot message indicating the kernel version
@@ -444,7 +445,34 @@ config PANEL_BOOT_MESSAGE
 	  An empty message will only clear the display at driver init time. Any other
 	  printf()-formatted message is valid with newline and escape codes.
 
-endif # PANEL
+choice
+	prompt "Backlight initial state"
+	default CHARLCD_BL_FLASH
+
+	config CHARLCD_BL_OFF
+		bool "Off"
+		help
+		  Backlight is initially turned off
+
+	config CHARLCD_BL_ON
+		bool "On"
+		help
+		  Backlight is initially turned on
+
+	config CHARLCD_BL_FLASH
+		bool "Flash"
+		help
+		  Backlight is flashed briefly on init
+
+endchoice
+
+endif # AUXDISPLAY
+
+config PANEL
+	tristate "Parallel port LCD/Keypad Panel support (OLD OPTION)"
+	depends on PARPORT
+	select AUXDISPLAY
+	select PARPORT_PANEL
 
 config CHARLCD
 	tristate "Character LCD core support" if COMPILE_TEST
diff --git a/drivers/auxdisplay/Makefile b/drivers/auxdisplay/Makefile
index 7ac6776ca3f6..cf54b5efb07e 100644
--- a/drivers/auxdisplay/Makefile
+++ b/drivers/auxdisplay/Makefile
@@ -10,4 +10,4 @@ obj-$(CONFIG_CFAG12864B)	+= cfag12864b.o cfag12864bfb.o
 obj-$(CONFIG_IMG_ASCII_LCD)	+= img-ascii-lcd.o
 obj-$(CONFIG_HD44780)		+= hd44780.o
 obj-$(CONFIG_HT16K33)		+= ht16k33.o
-obj-$(CONFIG_PANEL)             += panel.o
+obj-$(CONFIG_PARPORT_PANEL)	+= panel.o
diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c
index 60e0b772673f..92745efefb54 100644
--- a/drivers/auxdisplay/charlcd.c
+++ b/drivers/auxdisplay/charlcd.c
@@ -91,7 +91,7 @@ struct charlcd_priv {
 	unsigned long long drvdata[0];
 };
 
-#define to_priv(p)	container_of(p, struct charlcd_priv, lcd)
+#define charlcd_to_priv(p)	container_of(p, struct charlcd_priv, lcd)
 
 /* Device single-open policy control */
 static atomic_t charlcd_available = ATOMIC_INIT(1);
@@ -105,7 +105,7 @@ static void long_sleep(int ms)
 /* turn the backlight on or off */
 static void charlcd_backlight(struct charlcd *lcd, int on)
 {
-	struct charlcd_priv *priv = to_priv(lcd);
+	struct charlcd_priv *priv = charlcd_to_priv(lcd);
 
 	if (!lcd->ops->backlight)
 		return;
@@ -134,7 +134,7 @@ static void charlcd_bl_off(struct work_struct *work)
 /* turn the backlight on for a little while */
 void charlcd_poke(struct charlcd *lcd)
 {
-	struct charlcd_priv *priv = to_priv(lcd);
+	struct charlcd_priv *priv = charlcd_to_priv(lcd);
 
 	if (!lcd->ops->backlight)
 		return;
@@ -152,7 +152,7 @@ EXPORT_SYMBOL_GPL(charlcd_poke);
 
 static void charlcd_gotoxy(struct charlcd *lcd)
 {
-	struct charlcd_priv *priv = to_priv(lcd);
+	struct charlcd_priv *priv = charlcd_to_priv(lcd);
 	unsigned int addr;
 
 	/*
@@ -170,7 +170,7 @@ static void charlcd_gotoxy(struct charlcd *lcd)
 
 static void charlcd_home(struct charlcd *lcd)
 {
-	struct charlcd_priv *priv = to_priv(lcd);
+	struct charlcd_priv *priv = charlcd_to_priv(lcd);
 
 	priv->addr.x = 0;
 	priv->addr.y = 0;
@@ -179,7 +179,7 @@ static void charlcd_home(struct charlcd *lcd)
 
 static void charlcd_print(struct charlcd *lcd, char c)
 {
-	struct charlcd_priv *priv = to_priv(lcd);
+	struct charlcd_priv *priv = charlcd_to_priv(lcd);
 
 	if (priv->addr.x < lcd->bwidth) {
 		if (lcd->char_conv)
@@ -211,7 +211,7 @@ static void charlcd_clear_fast(struct charlcd *lcd)
 /* clears the display and resets X/Y */
 static void charlcd_clear_display(struct charlcd *lcd)
 {
-	struct charlcd_priv *priv = to_priv(lcd);
+	struct charlcd_priv *priv = charlcd_to_priv(lcd);
 
 	lcd->ops->write_cmd(lcd, LCD_CMD_DISPLAY_CLEAR);
 	priv->addr.x = 0;
@@ -223,7 +223,7 @@ static void charlcd_clear_display(struct charlcd *lcd)
 static int charlcd_init_display(struct charlcd *lcd)
 {
 	void (*write_cmd_raw)(struct charlcd *lcd, int cmd);
-	struct charlcd_priv *priv = to_priv(lcd);
+	struct charlcd_priv *priv = charlcd_to_priv(lcd);
 	u8 init;
 
 	if (lcd->ifwidth != 4 && lcd->ifwidth != 8)
@@ -369,7 +369,7 @@ static bool parse_xy(const char *s, unsigned long *x, unsigned long *y)
 
 static inline int handle_lcd_special_code(struct charlcd *lcd)
 {
-	struct charlcd_priv *priv = to_priv(lcd);
+	struct charlcd_priv *priv = charlcd_to_priv(lcd);
 
 	/* LCD special codes */
 
@@ -580,7 +580,7 @@ static inline int handle_lcd_special_code(struct charlcd *lcd)
 
 static void charlcd_write_char(struct charlcd *lcd, char c)
 {
-	struct charlcd_priv *priv = to_priv(lcd);
+	struct charlcd_priv *priv = charlcd_to_priv(lcd);
 
 	/* first, we'll test if we're in escape mode */
 	if ((c != '\n') && priv->esc_seq.len >= 0) {
@@ -705,7 +705,7 @@ static ssize_t charlcd_write(struct file *file, const char __user *buf,
 
 static int charlcd_open(struct inode *inode, struct file *file)
 {
-	struct charlcd_priv *priv = to_priv(the_charlcd);
+	struct charlcd_priv *priv = charlcd_to_priv(the_charlcd);
 	int ret;
 
 	ret = -EBUSY;
@@ -763,10 +763,24 @@ static void charlcd_puts(struct charlcd *lcd, const char *s)
 	}
 }
 
+#ifdef CONFIG_PANEL_BOOT_MESSAGE
+#define LCD_INIT_TEXT CONFIG_PANEL_BOOT_MESSAGE
+#else
+#define LCD_INIT_TEXT "Linux-" UTS_RELEASE "\n"
+#endif
+
+#ifdef CONFIG_CHARLCD_BL_ON
+#define LCD_INIT_BL "\x1b[L+"
+#elif defined(CONFIG_CHARLCD_BL_FLASH)
+#define LCD_INIT_BL "\x1b[L*"
+#else
+#define LCD_INIT_BL "\x1b[L-"
+#endif
+
 /* initialize the LCD driver */
 static int charlcd_init(struct charlcd *lcd)
 {
-	struct charlcd_priv *priv = to_priv(lcd);
+	struct charlcd_priv *priv = charlcd_to_priv(lcd);
 	int ret;
 
 	if (lcd->ops->backlight) {
@@ -784,13 +798,8 @@ static int charlcd_init(struct charlcd *lcd)
 		return ret;
 
 	/* display a short message */
-#ifdef CONFIG_PANEL_CHANGE_MESSAGE
-#ifdef CONFIG_PANEL_BOOT_MESSAGE
-	charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*" CONFIG_PANEL_BOOT_MESSAGE);
-#endif
-#else
-	charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*Linux-" UTS_RELEASE "\n");
-#endif
+	charlcd_puts(lcd, "\x1b[Lc\x1b[Lb" LCD_INIT_BL LCD_INIT_TEXT);
+
 	/* clear the display on the next device opening */
 	priv->must_clear = true;
 	charlcd_home(lcd);
@@ -818,6 +827,12 @@ struct charlcd *charlcd_alloc(unsigned int drvdata_size)
 }
 EXPORT_SYMBOL_GPL(charlcd_alloc);
 
+void charlcd_free(struct charlcd *lcd)
+{
+	kfree(charlcd_to_priv(lcd));
+}
+EXPORT_SYMBOL_GPL(charlcd_free);
+
 static int panel_notify_sys(struct notifier_block *this, unsigned long code,
 			    void *unused)
 {
@@ -866,7 +881,7 @@ EXPORT_SYMBOL_GPL(charlcd_register);
 
 int charlcd_unregister(struct charlcd *lcd)
 {
-	struct charlcd_priv *priv = to_priv(lcd);
+	struct charlcd_priv *priv = charlcd_to_priv(lcd);
 
 	unregister_reboot_notifier(&panel_notifier);
 	charlcd_puts(lcd, "\x0cLCD driver unloaded.\x1b[Lc\x1b[Lb\x1b[L-");
diff --git a/drivers/auxdisplay/hd44780.c b/drivers/auxdisplay/hd44780.c
index 9ad93ea42fdc..ab15b64707ad 100644
--- a/drivers/auxdisplay/hd44780.c
+++ b/drivers/auxdisplay/hd44780.c
@@ -271,7 +271,7 @@ static int hd44780_probe(struct platform_device *pdev)
 	return 0;
 
 fail:
-	kfree(lcd);
+	charlcd_free(lcd);
 	return ret;
 }
 
@@ -280,6 +280,8 @@ static int hd44780_remove(struct platform_device *pdev)
 	struct charlcd *lcd = platform_get_drvdata(pdev);
 
 	charlcd_unregister(lcd);
+
+	charlcd_free(lcd);
 	return 0;
 }
 
diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c
index 21b9b2f2470a..e06de63497cf 100644
--- a/drivers/auxdisplay/panel.c
+++ b/drivers/auxdisplay/panel.c
@@ -1620,7 +1620,7 @@ static void panel_attach(struct parport *port)
 	if (lcd.enabled)
 		charlcd_unregister(lcd.charlcd);
 err_unreg_device:
-	kfree(lcd.charlcd);
+	charlcd_free(lcd.charlcd);
 	lcd.charlcd = NULL;
 	parport_unregister_device(pprt);
 	pprt = NULL;
@@ -1647,7 +1647,7 @@ static void panel_detach(struct parport *port)
 	if (lcd.enabled) {
 		charlcd_unregister(lcd.charlcd);
 		lcd.initialized = false;
-		kfree(lcd.charlcd);
+		charlcd_free(lcd.charlcd);
 		lcd.charlcd = NULL;
 	}
 
diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig
index 7b2e76e7f22f..b0f9a20401d6 100644
--- a/drivers/bluetooth/Kconfig
+++ b/drivers/bluetooth/Kconfig
@@ -379,6 +379,17 @@ config BT_WILINK
 	  Say Y here to compile support for Texas Instrument's WiLink7 driver
 	  into the kernel or say M to compile it as module (btwilink).
 
+config BT_MTKSDIO
+	tristate "MediaTek HCI SDIO driver"
+	depends on MMC
+	help
+	  MediaTek Bluetooth HCI SDIO driver.
+	  This driver is required if you want to use MediaTek Bluetooth
+	  with SDIO interface.
+
+	  Say Y here to compile support for MediaTek Bluetooth SDIO devices
+	  into the kernel or say M to compile it as module (btmtksdio).
+
 config BT_MTKUART
 	tristate "MediaTek HCI UART driver"
 	depends on SERIAL_DEV_BUS
diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile
index b7e393cfc1e3..34887b9b3a85 100644
--- a/drivers/bluetooth/Makefile
+++ b/drivers/bluetooth/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_BT_ATH3K)		+= ath3k.o
 obj-$(CONFIG_BT_MRVL)		+= btmrvl.o
 obj-$(CONFIG_BT_MRVL_SDIO)	+= btmrvl_sdio.o
 obj-$(CONFIG_BT_WILINK)		+= btwilink.o
+obj-$(CONFIG_BT_MTKSDIO)	+= btmtksdio.o
 obj-$(CONFIG_BT_MTKUART)	+= btmtkuart.o
 obj-$(CONFIG_BT_QCOMSMD)	+= btqcomsmd.o
 obj-$(CONFIG_BT_BCM)		+= btbcm.o
diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
new file mode 100644
index 000000000000..b4b8320f279e
--- /dev/null
+++ b/drivers/bluetooth/btmtksdio.c
@@ -0,0 +1,979 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (c) 2019 MediaTek Inc.
+
+/*
+ * Bluetooth support for MediaTek SDIO devices
+ *
+ * This file is written based on btsdio.c and btmtkuart.c.
+ *
+ * Author: Sean Wang <sean.wang@mediatek.com>
+ *
+ */
+
+#include <asm/unaligned.h>
+#include <linux/atomic.h>
+#include <linux/firmware.h>
+#include <linux/init.h>
+#include <linux/iopoll.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/skbuff.h>
+
+#include <linux/mmc/host.h>
+#include <linux/mmc/sdio_ids.h>
+#include <linux/mmc/sdio_func.h>
+
+#include <net/bluetooth/bluetooth.h>
+#include <net/bluetooth/hci_core.h>
+
+#include "h4_recv.h"
+
+#define VERSION "0.1"
+
+#define FIRMWARE_MT7663		"mediatek/mt7663pr2h.bin"
+#define FIRMWARE_MT7668		"mediatek/mt7668pr2h.bin"
+
+struct btmtksdio_data {
+	const char *fwname;
+};
+
+static const struct btmtksdio_data mt7663_data = {
+	.fwname = FIRMWARE_MT7663,
+};
+
+static const struct btmtksdio_data mt7668_data = {
+	.fwname = FIRMWARE_MT7668,
+};
+
+static const struct sdio_device_id btmtksdio_table[] = {
+	{SDIO_DEVICE(SDIO_VENDOR_ID_MEDIATEK, 0x7663),
+	 .driver_data = (kernel_ulong_t)&mt7663_data },
+	{SDIO_DEVICE(SDIO_VENDOR_ID_MEDIATEK, 0x7668),
+	 .driver_data = (kernel_ulong_t)&mt7668_data },
+	{ }	/* Terminating entry */
+};
+
+#define MTK_REG_CHLPCR		0x4	/* W1S */
+#define C_INT_EN_SET		BIT(0)
+#define C_INT_EN_CLR		BIT(1)
+#define C_FW_OWN_REQ_SET	BIT(8)
+#define C_FW_OWN_REQ_CLR	BIT(9)
+
+#define MTK_REG_CSDIOCSR	0x8
+#define SDIO_RE_INIT_EN		BIT(0)
+#define SDIO_INT_CTL		BIT(2)
+
+#define MTK_REG_CHCR		0xc
+#define C_INT_CLR_CTRL		BIT(1)
+
+/* CHISR have the same bits field definition with CHIER */
+#define MTK_REG_CHISR		0x10
+#define MTK_REG_CHIER		0x14
+#define FW_OWN_BACK_INT		BIT(0)
+#define RX_DONE_INT		BIT(1)
+#define TX_EMPTY		BIT(2)
+#define TX_FIFO_OVERFLOW	BIT(8)
+#define RX_PKT_LEN		GENMASK(31, 16)
+
+#define MTK_REG_CTDR		0x18
+
+#define MTK_REG_CRDR		0x1c
+
+#define MTK_SDIO_BLOCK_SIZE	256
+
+#define BTMTKSDIO_TX_WAIT_VND_EVT	1
+
+enum {
+	MTK_WMT_PATCH_DWNLD = 0x1,
+	MTK_WMT_TEST = 0x2,
+	MTK_WMT_WAKEUP = 0x3,
+	MTK_WMT_HIF = 0x4,
+	MTK_WMT_FUNC_CTRL = 0x6,
+	MTK_WMT_RST = 0x7,
+	MTK_WMT_SEMAPHORE = 0x17,
+};
+
+enum {
+	BTMTK_WMT_INVALID,
+	BTMTK_WMT_PATCH_UNDONE,
+	BTMTK_WMT_PATCH_DONE,
+	BTMTK_WMT_ON_UNDONE,
+	BTMTK_WMT_ON_DONE,
+	BTMTK_WMT_ON_PROGRESS,
+};
+
+struct mtkbtsdio_hdr {
+	__le16	len;
+	__le16	reserved;
+	u8	bt_type;
+} __packed;
+
+struct mtk_wmt_hdr {
+	u8	dir;
+	u8	op;
+	__le16	dlen;
+	u8	flag;
+} __packed;
+
+struct mtk_hci_wmt_cmd {
+	struct mtk_wmt_hdr hdr;
+	u8 data[256];
+} __packed;
+
+struct btmtk_hci_wmt_evt {
+	struct hci_event_hdr hhdr;
+	struct mtk_wmt_hdr whdr;
+} __packed;
+
+struct btmtk_hci_wmt_evt_funcc {
+	struct btmtk_hci_wmt_evt hwhdr;
+	__be16 status;
+} __packed;
+
+struct btmtk_tci_sleep {
+	u8 mode;
+	__le16 duration;
+	__le16 host_duration;
+	u8 host_wakeup_pin;
+	u8 time_compensation;
+} __packed;
+
+struct btmtk_hci_wmt_params {
+	u8 op;
+	u8 flag;
+	u16 dlen;
+	const void *data;
+	u32 *status;
+};
+
+struct btmtksdio_dev {
+	struct hci_dev *hdev;
+	struct sdio_func *func;
+
+	struct work_struct tx_work;
+	unsigned long tx_state;
+	struct sk_buff_head txq;
+
+	struct sk_buff *evt_skb;
+
+	const struct btmtksdio_data *data;
+};
+
+static int mtk_hci_wmt_sync(struct hci_dev *hdev,
+			    struct btmtk_hci_wmt_params *wmt_params)
+{
+	struct btmtksdio_dev *bdev = hci_get_drvdata(hdev);
+	struct btmtk_hci_wmt_evt_funcc *wmt_evt_funcc;
+	u32 hlen, status = BTMTK_WMT_INVALID;
+	struct btmtk_hci_wmt_evt *wmt_evt;
+	struct mtk_hci_wmt_cmd wc;
+	struct mtk_wmt_hdr *hdr;
+	int err;
+
+	hlen = sizeof(*hdr) + wmt_params->dlen;
+	if (hlen > 255)
+		return -EINVAL;
+
+	hdr = (struct mtk_wmt_hdr *)&wc;
+	hdr->dir = 1;
+	hdr->op = wmt_params->op;
+	hdr->dlen = cpu_to_le16(wmt_params->dlen + 1);
+	hdr->flag = wmt_params->flag;
+	memcpy(wc.data, wmt_params->data, wmt_params->dlen);
+
+	set_bit(BTMTKSDIO_TX_WAIT_VND_EVT, &bdev->tx_state);
+
+	err = __hci_cmd_send(hdev, 0xfc6f, hlen, &wc);
+	if (err < 0) {
+		clear_bit(BTMTKSDIO_TX_WAIT_VND_EVT, &bdev->tx_state);
+		return err;
+	}
+
+	/* The vendor specific WMT commands are all answered by a vendor
+	 * specific event and will not have the Command Status or Command
+	 * Complete as with usual HCI command flow control.
+	 *
+	 * After sending the command, wait for BTMTKSDIO_TX_WAIT_VND_EVT
+	 * state to be cleared. The driver specific event receive routine
+	 * will clear that state and with that indicate completion of the
+	 * WMT command.
+	 */
+	err = wait_on_bit_timeout(&bdev->tx_state, BTMTKSDIO_TX_WAIT_VND_EVT,
+				  TASK_INTERRUPTIBLE, HCI_INIT_TIMEOUT);
+	if (err == -EINTR) {
+		bt_dev_err(hdev, "Execution of wmt command interrupted");
+		clear_bit(BTMTKSDIO_TX_WAIT_VND_EVT, &bdev->tx_state);
+		return err;
+	}
+
+	if (err) {
+		bt_dev_err(hdev, "Execution of wmt command timed out");
+		clear_bit(BTMTKSDIO_TX_WAIT_VND_EVT, &bdev->tx_state);
+		return -ETIMEDOUT;
+	}
+
+	/* Parse and handle the return WMT event */
+	wmt_evt = (struct btmtk_hci_wmt_evt *)bdev->evt_skb->data;
+	if (wmt_evt->whdr.op != hdr->op) {
+		bt_dev_err(hdev, "Wrong op received %d expected %d",
+			   wmt_evt->whdr.op, hdr->op);
+		err = -EIO;
+		goto err_free_skb;
+	}
+
+	switch (wmt_evt->whdr.op) {
+	case MTK_WMT_SEMAPHORE:
+		if (wmt_evt->whdr.flag == 2)
+			status = BTMTK_WMT_PATCH_UNDONE;
+		else
+			status = BTMTK_WMT_PATCH_DONE;
+		break;
+	case MTK_WMT_FUNC_CTRL:
+		wmt_evt_funcc = (struct btmtk_hci_wmt_evt_funcc *)wmt_evt;
+		if (be16_to_cpu(wmt_evt_funcc->status) == 0x404)
+			status = BTMTK_WMT_ON_DONE;
+		else if (be16_to_cpu(wmt_evt_funcc->status) == 0x420)
+			status = BTMTK_WMT_ON_PROGRESS;
+		else
+			status = BTMTK_WMT_ON_UNDONE;
+		break;
+	}
+
+	if (wmt_params->status)
+		*wmt_params->status = status;
+
+err_free_skb:
+	kfree_skb(bdev->evt_skb);
+	bdev->evt_skb = NULL;
+
+	return err;
+}
+
+static int btmtksdio_tx_packet(struct btmtksdio_dev *bdev,
+			       struct sk_buff *skb)
+{
+	struct mtkbtsdio_hdr *sdio_hdr;
+	int err;
+
+	/* Make sure that there are enough rooms for SDIO header */
+	if (unlikely(skb_headroom(skb) < sizeof(*sdio_hdr))) {
+		err = pskb_expand_head(skb, sizeof(*sdio_hdr), 0,
+				       GFP_ATOMIC);
+		if (err < 0)
+			return err;
+	}
+
+	/* Prepend MediaTek SDIO Specific Header */
+	skb_push(skb, sizeof(*sdio_hdr));
+
+	sdio_hdr = (void *)skb->data;
+	sdio_hdr->len = cpu_to_le16(skb->len);
+	sdio_hdr->reserved = cpu_to_le16(0);
+	sdio_hdr->bt_type = hci_skb_pkt_type(skb);
+
+	err = sdio_writesb(bdev->func, MTK_REG_CTDR, skb->data,
+			   round_up(skb->len, MTK_SDIO_BLOCK_SIZE));
+	if (err < 0)
+		goto err_skb_pull;
+
+	bdev->hdev->stat.byte_tx += skb->len;
+
+	kfree_skb(skb);
+
+	return 0;
+
+err_skb_pull:
+	skb_pull(skb, sizeof(*sdio_hdr));
+
+	return err;
+}
+
+static u32 btmtksdio_drv_own_query(struct btmtksdio_dev *bdev)
+{
+	return sdio_readl(bdev->func, MTK_REG_CHLPCR, NULL);
+}
+
+static void btmtksdio_tx_work(struct work_struct *work)
+{
+	struct btmtksdio_dev *bdev = container_of(work, struct btmtksdio_dev,
+						  tx_work);
+	struct sk_buff *skb;
+	int err;
+
+	sdio_claim_host(bdev->func);
+
+	while ((skb = skb_dequeue(&bdev->txq))) {
+		err = btmtksdio_tx_packet(bdev, skb);
+		if (err < 0) {
+			bdev->hdev->stat.err_tx++;
+			skb_queue_head(&bdev->txq, skb);
+			break;
+		}
+	}
+
+	sdio_release_host(bdev->func);
+}
+
+static int btmtksdio_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
+{
+	struct btmtksdio_dev *bdev = hci_get_drvdata(hdev);
+	struct hci_event_hdr *hdr = (void *)skb->data;
+	int err;
+
+	/* Fix up the vendor event id with 0xff for vendor specific instead
+	 * of 0xe4 so that event send via monitoring socket can be parsed
+	 * properly.
+	 */
+	if (hdr->evt == 0xe4)
+		hdr->evt = HCI_EV_VENDOR;
+
+	/* When someone waits for the WMT event, the skb is being cloned
+	 * and being processed the events from there then.
+	 */
+	if (test_bit(BTMTKSDIO_TX_WAIT_VND_EVT, &bdev->tx_state)) {
+		bdev->evt_skb = skb_clone(skb, GFP_KERNEL);
+		if (!bdev->evt_skb) {
+			err = -ENOMEM;
+			goto err_out;
+		}
+	}
+
+	err = hci_recv_frame(hdev, skb);
+	if (err < 0)
+		goto err_free_skb;
+
+	if (hdr->evt == HCI_EV_VENDOR) {
+		if (test_and_clear_bit(BTMTKSDIO_TX_WAIT_VND_EVT,
+				       &bdev->tx_state)) {
+			/* Barrier to sync with other CPUs */
+			smp_mb__after_atomic();
+			wake_up_bit(&bdev->tx_state, BTMTKSDIO_TX_WAIT_VND_EVT);
+		}
+	}
+
+	return 0;
+
+err_free_skb:
+	kfree_skb(bdev->evt_skb);
+	bdev->evt_skb = NULL;
+
+err_out:
+	return err;
+}
+
+static const struct h4_recv_pkt mtk_recv_pkts[] = {
+	{ H4_RECV_ACL,      .recv = hci_recv_frame },
+	{ H4_RECV_SCO,      .recv = hci_recv_frame },
+	{ H4_RECV_EVENT,    .recv = btmtksdio_recv_event },
+};
+
+static int btmtksdio_rx_packet(struct btmtksdio_dev *bdev, u16 rx_size)
+{
+	const struct h4_recv_pkt *pkts = mtk_recv_pkts;
+	int pkts_count = ARRAY_SIZE(mtk_recv_pkts);
+	struct mtkbtsdio_hdr *sdio_hdr;
+	unsigned char *old_data;
+	unsigned int old_len;
+	int err, i, pad_size;
+	struct sk_buff *skb;
+	u16 dlen;
+
+	if (rx_size < sizeof(*sdio_hdr))
+		return -EILSEQ;
+
+	/* A SDIO packet is exactly containing a Bluetooth packet */
+	skb = bt_skb_alloc(rx_size, GFP_KERNEL);
+	if (!skb)
+		return -ENOMEM;
+
+	skb_put(skb, rx_size);
+
+	err = sdio_readsb(bdev->func, skb->data, MTK_REG_CRDR, rx_size);
+	if (err < 0)
+		goto err_kfree_skb;
+
+	/* Keep old data for dump the content in case of some error is
+	 * caught in the following packet parsing.
+	 */
+	old_data = skb->data;
+	old_len = skb->len;
+
+	bdev->hdev->stat.byte_rx += rx_size;
+
+	sdio_hdr = (void *)skb->data;
+
+	/* We assume the default error as -EILSEQ simply to make the error path
+	 * be cleaner.
+	 */
+	err = -EILSEQ;
+
+	if (rx_size != le16_to_cpu(sdio_hdr->len)) {
+		bt_dev_err(bdev->hdev, "Rx size in sdio header is mismatched ");
+		goto err_kfree_skb;
+	}
+
+	hci_skb_pkt_type(skb) = sdio_hdr->bt_type;
+
+	/* Remove MediaTek SDIO header */
+	skb_pull(skb, sizeof(*sdio_hdr));
+
+	/* We have to dig into the packet to get payload size and then know how
+	 * many padding bytes at the tail, these padding bytes should be removed
+	 * before the packet is indicated to the core layer.
+	 */
+	for (i = 0; i < pkts_count; i++) {
+		if (sdio_hdr->bt_type == (&pkts[i])->type)
+			break;
+	}
+
+	if (i >= pkts_count) {
+		bt_dev_err(bdev->hdev, "Invalid bt type 0x%02x",
+			   sdio_hdr->bt_type);
+		goto err_kfree_skb;
+	}
+
+	/* Remaining bytes cannot hold a header*/
+	if (skb->len < (&pkts[i])->hlen) {
+		bt_dev_err(bdev->hdev, "The size of bt header is mismatched");
+		goto err_kfree_skb;
+	}
+
+	switch ((&pkts[i])->lsize) {
+		case 1:
+			dlen = skb->data[(&pkts[i])->loff];
+			break;
+		case 2:
+			dlen = get_unaligned_le16(skb->data +
+						  (&pkts[i])->loff);
+			break;
+		default:
+			goto err_kfree_skb;
+	}
+
+	pad_size = skb->len - (&pkts[i])->hlen -  dlen;
+
+	/* Remaining bytes cannot hold a payload */
+	if (pad_size < 0) {
+		bt_dev_err(bdev->hdev, "The size of bt payload is mismatched");
+		goto err_kfree_skb;
+	}
+
+	/* Remove padding bytes */
+	skb_trim(skb, skb->len - pad_size);
+
+	/* Complete frame */
+	(&pkts[i])->recv(bdev->hdev, skb);
+
+	return 0;
+
+err_kfree_skb:
+	print_hex_dump(KERN_ERR, "err sdio rx: ", DUMP_PREFIX_NONE, 4, 1,
+		       old_data, old_len, true);
+	kfree_skb(skb);
+
+	return err;
+}
+
+static void btmtksdio_interrupt(struct sdio_func *func)
+{
+	struct btmtksdio_dev *bdev = sdio_get_drvdata(func);
+	u32 int_status;
+	u16 rx_size;
+
+	/* Disable interrupt */
+	sdio_writel(func, C_INT_EN_CLR, MTK_REG_CHLPCR, 0);
+
+	int_status = sdio_readl(func, MTK_REG_CHISR, NULL);
+
+	/* Ack an interrupt as soon as possible before any operation on
+	 * hardware.
+	 *
+	 * Note that we don't ack any status during operations to avoid race
+	 * condition between the host and the device such as it's possible to
+	 * mistakenly ack RX_DONE for the next packet and then cause interrupts
+	 * not be raised again but there is still pending data in the hardware
+	 * FIFO.
+	 */
+	sdio_writel(func, int_status, MTK_REG_CHISR, NULL);
+
+	if (unlikely(!int_status))
+		bt_dev_err(bdev->hdev, "CHISR is 0\n");
+
+	if (int_status & FW_OWN_BACK_INT)
+		bt_dev_dbg(bdev->hdev, "Get fw own back\n");
+
+	if (int_status & TX_EMPTY)
+		schedule_work(&bdev->tx_work);
+	else if (unlikely(int_status & TX_FIFO_OVERFLOW))
+		bt_dev_warn(bdev->hdev, "Tx fifo overflow\n");
+
+	if (int_status & RX_DONE_INT) {
+		rx_size = (int_status & RX_PKT_LEN) >> 16;
+
+		if (btmtksdio_rx_packet(bdev, rx_size) < 0)
+			bdev->hdev->stat.err_rx++;
+	}
+
+	/* Enable interrupt */
+	sdio_writel(func, C_INT_EN_SET, MTK_REG_CHLPCR, 0);
+}
+
+static int btmtksdio_open(struct hci_dev *hdev)
+{
+	struct btmtksdio_dev *bdev = hci_get_drvdata(hdev);
+	int err;
+	u32 status;
+
+	sdio_claim_host(bdev->func);
+
+	err = sdio_enable_func(bdev->func);
+	if (err < 0)
+		goto err_release_host;
+
+	/* Get ownership from the device */
+	sdio_writel(bdev->func, C_FW_OWN_REQ_CLR, MTK_REG_CHLPCR, &err);
+	if (err < 0)
+		goto err_disable_func;
+
+	err = readx_poll_timeout(btmtksdio_drv_own_query, bdev, status,
+				 status & C_FW_OWN_REQ_SET, 2000, 1000000);
+	if (err < 0) {
+		bt_dev_err(bdev->hdev, "Cannot get ownership from device");
+		goto err_disable_func;
+	}
+
+	/* Disable interrupt & mask out all interrupt sources */
+	sdio_writel(bdev->func, C_INT_EN_CLR, MTK_REG_CHLPCR, &err);
+	if (err < 0)
+		goto err_disable_func;
+
+	sdio_writel(bdev->func, 0, MTK_REG_CHIER, &err);
+	if (err < 0)
+		goto err_disable_func;
+
+	err = sdio_claim_irq(bdev->func, btmtksdio_interrupt);
+	if (err < 0)
+		goto err_disable_func;
+
+	err = sdio_set_block_size(bdev->func, MTK_SDIO_BLOCK_SIZE);
+	if (err < 0)
+		goto err_release_irq;
+
+	/* SDIO CMD 5 allows the SDIO device back to idle state an
+	 * synchronous interrupt is supported in SDIO 4-bit mode
+	 */
+	sdio_writel(bdev->func, SDIO_INT_CTL | SDIO_RE_INIT_EN,
+		    MTK_REG_CSDIOCSR, &err);
+	if (err < 0)
+		goto err_release_irq;
+
+	/* Setup write-1-clear for CHISR register */
+	sdio_writel(bdev->func, C_INT_CLR_CTRL, MTK_REG_CHCR, &err);
+	if (err < 0)
+		goto err_release_irq;
+
+	/* Setup interrupt sources */
+	sdio_writel(bdev->func, RX_DONE_INT | TX_EMPTY | TX_FIFO_OVERFLOW,
+		    MTK_REG_CHIER, &err);
+	if (err < 0)
+		goto err_release_irq;
+
+	/* Enable interrupt */
+	sdio_writel(bdev->func, C_INT_EN_SET, MTK_REG_CHLPCR, &err);
+	if (err < 0)
+		goto err_release_irq;
+
+	sdio_release_host(bdev->func);
+
+	return 0;
+
+err_release_irq:
+	sdio_release_irq(bdev->func);
+
+err_disable_func:
+	sdio_disable_func(bdev->func);
+
+err_release_host:
+	sdio_release_host(bdev->func);
+
+	return err;
+}
+
+static int btmtksdio_close(struct hci_dev *hdev)
+{
+	struct btmtksdio_dev *bdev = hci_get_drvdata(hdev);
+	u32 status;
+	int err;
+
+	sdio_claim_host(bdev->func);
+
+	/* Disable interrupt */
+	sdio_writel(bdev->func, C_INT_EN_CLR, MTK_REG_CHLPCR, NULL);
+
+	sdio_release_irq(bdev->func);
+
+	/* Return ownership to the device */
+	sdio_writel(bdev->func, C_FW_OWN_REQ_SET, MTK_REG_CHLPCR, NULL);
+
+	err = readx_poll_timeout(btmtksdio_drv_own_query, bdev, status,
+				 !(status & C_FW_OWN_REQ_SET), 2000, 1000000);
+	if (err < 0)
+		bt_dev_err(bdev->hdev, "Cannot return ownership to device");
+
+	sdio_disable_func(bdev->func);
+
+	sdio_release_host(bdev->func);
+
+	return 0;
+}
+
+static int btmtksdio_flush(struct hci_dev *hdev)
+{
+	struct btmtksdio_dev *bdev = hci_get_drvdata(hdev);
+
+	skb_queue_purge(&bdev->txq);
+
+	cancel_work_sync(&bdev->tx_work);
+
+	return 0;
+}
+
+static int btmtksdio_func_query(struct hci_dev *hdev)
+{
+	struct btmtk_hci_wmt_params wmt_params;
+	int status, err;
+	u8 param = 0;
+
+	/* Query whether the function is enabled */
+	wmt_params.op = MTK_WMT_FUNC_CTRL;
+	wmt_params.flag = 4;
+	wmt_params.dlen = sizeof(param);
+	wmt_params.data = &param;
+	wmt_params.status = &status;
+
+	err = mtk_hci_wmt_sync(hdev, &wmt_params);
+	if (err < 0) {
+		bt_dev_err(hdev, "Failed to query function status (%d)", err);
+		return err;
+	}
+
+	return status;
+}
+
+static int mtk_setup_firmware(struct hci_dev *hdev, const char *fwname)
+{
+	struct btmtk_hci_wmt_params wmt_params;
+	const struct firmware *fw;
+	const u8 *fw_ptr;
+	size_t fw_size;
+	int err, dlen;
+	u8 flag;
+
+	err = request_firmware(&fw, fwname, &hdev->dev);
+	if (err < 0) {
+		bt_dev_err(hdev, "Failed to load firmware file (%d)", err);
+		return err;
+	}
+
+	fw_ptr = fw->data;
+	fw_size = fw->size;
+
+	/* The size of patch header is 30 bytes, should be skip */
+	if (fw_size < 30) {
+		err = -EINVAL;
+		goto free_fw;
+	}
+
+	fw_size -= 30;
+	fw_ptr += 30;
+	flag = 1;
+
+	wmt_params.op = MTK_WMT_PATCH_DWNLD;
+	wmt_params.status = NULL;
+
+	while (fw_size > 0) {
+		dlen = min_t(int, 250, fw_size);
+
+		/* Tell device the position in sequence */
+		if (fw_size - dlen <= 0)
+			flag = 3;
+		else if (fw_size < fw->size - 30)
+			flag = 2;
+
+		wmt_params.flag = flag;
+		wmt_params.dlen = dlen;
+		wmt_params.data = fw_ptr;
+
+		err = mtk_hci_wmt_sync(hdev, &wmt_params);
+		if (err < 0) {
+			bt_dev_err(hdev, "Failed to send wmt patch dwnld (%d)",
+				   err);
+			goto free_fw;
+		}
+
+		fw_size -= dlen;
+		fw_ptr += dlen;
+	}
+
+	wmt_params.op = MTK_WMT_RST;
+	wmt_params.flag = 4;
+	wmt_params.dlen = 0;
+	wmt_params.data = NULL;
+	wmt_params.status = NULL;
+
+	/* Activate funciton the firmware providing to */
+	err = mtk_hci_wmt_sync(hdev, &wmt_params);
+	if (err < 0) {
+		bt_dev_err(hdev, "Failed to send wmt rst (%d)", err);
+		goto free_fw;
+	}
+
+	/* Wait a few moments for firmware activation done */
+	usleep_range(10000, 12000);
+
+free_fw:
+	release_firmware(fw);
+	return err;
+}
+
+static int btmtksdio_setup(struct hci_dev *hdev)
+{
+	struct btmtksdio_dev *bdev = hci_get_drvdata(hdev);
+	struct btmtk_hci_wmt_params wmt_params;
+	ktime_t calltime, delta, rettime;
+	struct btmtk_tci_sleep tci_sleep;
+	unsigned long long duration;
+	struct sk_buff *skb;
+	int err, status;
+	u8 param = 0x1;
+
+	calltime = ktime_get();
+
+	/* Query whether the firmware is already download */
+	wmt_params.op = MTK_WMT_SEMAPHORE;
+	wmt_params.flag = 1;
+	wmt_params.dlen = 0;
+	wmt_params.data = NULL;
+	wmt_params.status = &status;
+
+	err = mtk_hci_wmt_sync(hdev, &wmt_params);
+	if (err < 0) {
+		bt_dev_err(hdev, "Failed to query firmware status (%d)", err);
+		return err;
+	}
+
+	if (status == BTMTK_WMT_PATCH_DONE) {
+		bt_dev_info(hdev, "Firmware already downloaded");
+		goto ignore_setup_fw;
+	}
+
+	/* Setup a firmware which the device definitely requires */
+	err = mtk_setup_firmware(hdev, bdev->data->fwname);
+	if (err < 0)
+		return err;
+
+ignore_setup_fw:
+	/* Query whether the device is already enabled */
+	err = readx_poll_timeout(btmtksdio_func_query, hdev, status,
+				 status < 0 || status != BTMTK_WMT_ON_PROGRESS,
+				 2000, 5000000);
+	/* -ETIMEDOUT happens */
+	if (err < 0)
+		return err;
+
+	/* The other errors happen in btusb_mtk_func_query */
+	if (status < 0)
+		return status;
+
+	if (status == BTMTK_WMT_ON_DONE) {
+		bt_dev_info(hdev, "function already on");
+		goto ignore_func_on;
+	}
+
+	/* Enable Bluetooth protocol */
+	wmt_params.op = MTK_WMT_FUNC_CTRL;
+	wmt_params.flag = 0;
+	wmt_params.dlen = sizeof(param);
+	wmt_params.data = &param;
+	wmt_params.status = NULL;
+
+	err = mtk_hci_wmt_sync(hdev, &wmt_params);
+	if (err < 0) {
+		bt_dev_err(hdev, "Failed to send wmt func ctrl (%d)", err);
+		return err;
+	}
+
+ignore_func_on:
+	/* Apply the low power environment setup */
+	tci_sleep.mode = 0x5;
+	tci_sleep.duration = cpu_to_le16(0x640);
+	tci_sleep.host_duration = cpu_to_le16(0x640);
+	tci_sleep.host_wakeup_pin = 0;
+	tci_sleep.time_compensation = 0;
+
+	skb = __hci_cmd_sync(hdev, 0xfc7a, sizeof(tci_sleep), &tci_sleep,
+			     HCI_INIT_TIMEOUT);
+	if (IS_ERR(skb)) {
+		err = PTR_ERR(skb);
+		bt_dev_err(hdev, "Failed to apply low power setting (%d)", err);
+		return err;
+	}
+	kfree_skb(skb);
+
+	rettime = ktime_get();
+	delta = ktime_sub(rettime, calltime);
+	duration = (unsigned long long)ktime_to_ns(delta) >> 10;
+
+	bt_dev_info(hdev, "Device setup in %llu usecs", duration);
+
+	return 0;
+}
+
+static int btmtksdio_shutdown(struct hci_dev *hdev)
+{
+	struct btmtk_hci_wmt_params wmt_params;
+	u8 param = 0x0;
+	int err;
+
+	/* Disable the device */
+	wmt_params.op = MTK_WMT_FUNC_CTRL;
+	wmt_params.flag = 0;
+	wmt_params.dlen = sizeof(param);
+	wmt_params.data = &param;
+	wmt_params.status = NULL;
+
+	err = mtk_hci_wmt_sync(hdev, &wmt_params);
+	if (err < 0) {
+		bt_dev_err(hdev, "Failed to send wmt func ctrl (%d)", err);
+		return err;
+	}
+
+	return 0;
+}
+
+static int btmtksdio_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
+{
+	struct btmtksdio_dev *bdev = hci_get_drvdata(hdev);
+
+	switch (hci_skb_pkt_type(skb)) {
+	case HCI_COMMAND_PKT:
+		hdev->stat.cmd_tx++;
+		break;
+
+	case HCI_ACLDATA_PKT:
+		hdev->stat.acl_tx++;
+		break;
+
+	case HCI_SCODATA_PKT:
+		hdev->stat.sco_tx++;
+		break;
+
+	default:
+		return -EILSEQ;
+	}
+
+	skb_queue_tail(&bdev->txq, skb);
+
+	schedule_work(&bdev->tx_work);
+
+	return 0;
+}
+
+static int btmtksdio_probe(struct sdio_func *func,
+			   const struct sdio_device_id *id)
+{
+	struct btmtksdio_dev *bdev;
+	struct hci_dev *hdev;
+	int err;
+
+	bdev = devm_kzalloc(&func->dev, sizeof(*bdev), GFP_KERNEL);
+	if (!bdev)
+		return -ENOMEM;
+
+	bdev->data = (void *)id->driver_data;
+	if (!bdev->data)
+		return -ENODEV;
+
+	bdev->func = func;
+
+	INIT_WORK(&bdev->tx_work, btmtksdio_tx_work);
+	skb_queue_head_init(&bdev->txq);
+
+	/* Initialize and register HCI device */
+	hdev = hci_alloc_dev();
+	if (!hdev) {
+		dev_err(&func->dev, "Can't allocate HCI device\n");
+		return -ENOMEM;
+	}
+
+	bdev->hdev = hdev;
+
+	hdev->bus = HCI_SDIO;
+	hci_set_drvdata(hdev, bdev);
+
+	hdev->open     = btmtksdio_open;
+	hdev->close    = btmtksdio_close;
+	hdev->flush    = btmtksdio_flush;
+	hdev->setup    = btmtksdio_setup;
+	hdev->shutdown = btmtksdio_shutdown;
+	hdev->send     = btmtksdio_send_frame;
+	SET_HCIDEV_DEV(hdev, &func->dev);
+
+	hdev->manufacturer = 70;
+	set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks);
+
+	err = hci_register_dev(hdev);
+	if (err < 0) {
+		dev_err(&func->dev, "Can't register HCI device\n");
+		hci_free_dev(hdev);
+		return err;
+	}
+
+	sdio_set_drvdata(func, bdev);
+
+	return 0;
+}
+
+static void btmtksdio_remove(struct sdio_func *func)
+{
+	struct btmtksdio_dev *bdev = sdio_get_drvdata(func);
+	struct hci_dev *hdev;
+
+	if (!bdev)
+		return;
+
+	hdev = bdev->hdev;
+
+	sdio_set_drvdata(func, NULL);
+	hci_unregister_dev(hdev);
+	hci_free_dev(hdev);
+}
+
+static struct sdio_driver btmtksdio_driver = {
+	.name		= "btmtksdio",
+	.probe		= btmtksdio_probe,
+	.remove		= btmtksdio_remove,
+	.id_table	= btmtksdio_table,
+};
+
+static int __init btmtksdio_init(void)
+{
+	BT_INFO("MediaTek Bluetooth SDIO driver ver %s", VERSION);
+
+	return sdio_register_driver(&btmtksdio_driver);
+}
+
+static void __exit btmtksdio_exit(void)
+{
+	sdio_unregister_driver(&btmtksdio_driver);
+}
+
+module_init(btmtksdio_init);
+module_exit(btmtksdio_exit);
+
+MODULE_AUTHOR("Sean Wang <sean.wang@mediatek.com>");
+MODULE_DESCRIPTION("MediaTek Bluetooth SDIO driver ver " VERSION);
+MODULE_VERSION(VERSION);
+MODULE_LICENSE("GPL");
+MODULE_FIRMWARE(FIRMWARE_MT7663);
+MODULE_FIRMWARE(FIRMWARE_MT7668);
diff --git a/drivers/bluetooth/btqca.h b/drivers/bluetooth/btqca.h
index c72c56ea7480..6fdc25d7bba7 100644
--- a/drivers/bluetooth/btqca.h
+++ b/drivers/bluetooth/btqca.h
@@ -41,7 +41,7 @@
 #define QCA_WCN3990_POWERON_PULSE	0xFC
 #define QCA_WCN3990_POWEROFF_PULSE	0xC0
 
-enum qca_bardrate {
+enum qca_baudrate {
 	QCA_BAUDRATE_115200 	= 0,
 	QCA_BAUDRATE_57600,
 	QCA_BAUDRATE_38400,
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 237aea34b69f..4ea995d610d2 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -174,6 +174,21 @@ static int qca_power_setup(struct hci_uart *hu, bool on);
 static void qca_power_shutdown(struct hci_uart *hu);
 static int qca_power_off(struct hci_dev *hdev);
 
+static enum qca_btsoc_type qca_soc_type(struct hci_uart *hu)
+{
+	enum qca_btsoc_type soc_type;
+
+	if (hu->serdev) {
+		struct qca_serdev *qsd = serdev_device_get_drvdata(hu->serdev);
+
+		soc_type = qsd->btsoc_type;
+	} else {
+		soc_type = QCA_ROME;
+	}
+
+	return soc_type;
+}
+
 static void __serial_clock_on(struct tty_struct *tty)
 {
 	/* TODO: Some chipset requires to enable UART clock on client
@@ -963,7 +978,6 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate)
 {
 	struct hci_uart *hu = hci_get_drvdata(hdev);
 	struct qca_data *qca = hu->priv;
-	struct qca_serdev *qcadev;
 	struct sk_buff *skb;
 	u8 cmd[] = { 0x01, 0x48, 0xFC, 0x01, 0x00 };
 
@@ -985,8 +999,6 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate)
 	skb_queue_tail(&qca->txq, skb);
 	hci_uart_tx_wakeup(hu);
 
-	qcadev = serdev_device_get_drvdata(hu->serdev);
-
 	/* Wait for the baudrate change request to be sent */
 
 	while (!skb_queue_empty(&qca->txq))
@@ -996,7 +1008,7 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate)
 		      msecs_to_jiffies(CMD_TRANS_TIMEOUT_MS));
 
 	/* Give the controller time to process the request */
-	if (qcadev->btsoc_type == QCA_WCN3990)
+	if (qca_soc_type(hu) == QCA_WCN3990)
 		msleep(10);
 	else
 		msleep(300);
@@ -1072,10 +1084,7 @@ static unsigned int qca_get_speed(struct hci_uart *hu,
 
 static int qca_check_speeds(struct hci_uart *hu)
 {
-	struct qca_serdev *qcadev;
-
-	qcadev = serdev_device_get_drvdata(hu->serdev);
-	if (qcadev->btsoc_type == QCA_WCN3990) {
+	if (qca_soc_type(hu) == QCA_WCN3990) {
 		if (!qca_get_speed(hu, QCA_INIT_SPEED) &&
 		    !qca_get_speed(hu, QCA_OPER_SPEED))
 			return -EINVAL;
@@ -1091,7 +1100,6 @@ static int qca_check_speeds(struct hci_uart *hu)
 static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)
 {
 	unsigned int speed, qca_baudrate;
-	struct qca_serdev *qcadev;
 	int ret = 0;
 
 	if (speed_type == QCA_INIT_SPEED) {
@@ -1099,6 +1107,8 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)
 		if (speed)
 			host_set_baudrate(hu, speed);
 	} else {
+		enum qca_btsoc_type soc_type = qca_soc_type(hu);
+
 		speed = qca_get_speed(hu, QCA_OPER_SPEED);
 		if (!speed)
 			return 0;
@@ -1106,8 +1116,7 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)
 		/* Disable flow control for wcn3990 to deassert RTS while
 		 * changing the baudrate of chip and host.
 		 */
-		qcadev = serdev_device_get_drvdata(hu->serdev);
-		if (qcadev->btsoc_type == QCA_WCN3990)
+		if (soc_type == QCA_WCN3990)
 			hci_uart_set_flow_control(hu, true);
 
 		qca_baudrate = qca_get_baudrate_value(speed);
@@ -1119,7 +1128,7 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)
 		host_set_baudrate(hu, speed);
 
 error:
-		if (qcadev->btsoc_type == QCA_WCN3990)
+		if (soc_type == QCA_WCN3990)
 			hci_uart_set_flow_control(hu, false);
 	}
 
@@ -1181,12 +1190,10 @@ static int qca_setup(struct hci_uart *hu)
 	struct hci_dev *hdev = hu->hdev;
 	struct qca_data *qca = hu->priv;
 	unsigned int speed, qca_baudrate = QCA_BAUDRATE_115200;
-	struct qca_serdev *qcadev;
+	enum qca_btsoc_type soc_type = qca_soc_type(hu);
 	int ret;
 	int soc_ver = 0;
 
-	qcadev = serdev_device_get_drvdata(hu->serdev);
-
 	ret = qca_check_speeds(hu);
 	if (ret)
 		return ret;
@@ -1194,7 +1201,7 @@ static int qca_setup(struct hci_uart *hu)
 	/* Patch downloading has to be done without IBS mode */
 	clear_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags);
 
-	if (qcadev->btsoc_type == QCA_WCN3990) {
+	if (soc_type == QCA_WCN3990) {
 		bt_dev_info(hdev, "setting up wcn3990");
 
 		/* Enable NON_PERSISTENT_SETUP QUIRK to ensure to execute
@@ -1225,7 +1232,7 @@ static int qca_setup(struct hci_uart *hu)
 		qca_baudrate = qca_get_baudrate_value(speed);
 	}
 
-	if (qcadev->btsoc_type != QCA_WCN3990) {
+	if (soc_type != QCA_WCN3990) {
 		/* Get QCA version information */
 		ret = qca_read_soc_version(hdev, &soc_ver);
 		if (ret)
@@ -1234,7 +1241,7 @@ static int qca_setup(struct hci_uart *hu)
 
 	bt_dev_info(hdev, "QCA controller version 0x%08x", soc_ver);
 	/* Setup patch / NVM configurations */
-	ret = qca_uart_setup(hdev, qca_baudrate, qcadev->btsoc_type, soc_ver);
+	ret = qca_uart_setup(hdev, qca_baudrate, soc_type, soc_ver);
 	if (!ret) {
 		set_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags);
 		qca_debugfs_init(hdev);
@@ -1250,7 +1257,7 @@ static int qca_setup(struct hci_uart *hu)
 	}
 
 	/* Setup bdaddr */
-	if (qcadev->btsoc_type == QCA_WCN3990)
+	if (soc_type == QCA_WCN3990)
 		hu->hdev->set_bdaddr = qca_set_bdaddr;
 	else
 		hu->hdev->set_bdaddr = qca_set_bdaddr_rome;
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index e8ba67834746..c35f2bcbaa23 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -1260,7 +1260,12 @@ EXPORT_SYMBOL(ipmi_get_smi_info);
 static void free_user(struct kref *ref)
 {
 	struct ipmi_user *user = container_of(ref, struct ipmi_user, refcount);
-	cleanup_srcu_struct(&user->release_barrier);
+
+	/*
+	 * Cleanup without waiting. This could be called in atomic context.
+	 * Refcount is zero: all read-sections should have been ended.
+	 */
+	cleanup_srcu_struct_quiesced(&user->release_barrier);
 	kfree(user);
 }
 
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 38c6d1af6d1c..47ac7cd20fb1 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -295,7 +295,7 @@
  * To allow fractional bits to be tracked, the entropy_count field is
  * denominated in units of 1/8th bits.
  *
- * 2*(ENTROPY_SHIFT + log2(poolbits)) must <= 31, or the multiply in
+ * 2*(ENTROPY_SHIFT + poolbitshift) must <= 31, or the multiply in
  * credit_entropy_bits() needs to be 64 bits wide.
  */
 #define ENTROPY_SHIFT 3
@@ -359,9 +359,9 @@ static int random_write_wakeup_bits = 28 * OUTPUT_POOL_WORDS;
  * polynomial which improves the resulting TGFSR polynomial to be
  * irreducible, which we have made here.
  */
-static struct poolinfo {
-	int poolbitshift, poolwords, poolbytes, poolbits, poolfracbits;
-#define S(x) ilog2(x)+5, (x), (x)*4, (x)*32, (x) << (ENTROPY_SHIFT+5)
+static const struct poolinfo {
+	int poolbitshift, poolwords, poolbytes, poolfracbits;
+#define S(x) ilog2(x)+5, (x), (x)*4, (x) << (ENTROPY_SHIFT+5)
 	int tap1, tap2, tap3, tap4, tap5;
 } poolinfo_table[] = {
 	/* was: x^128 + x^103 + x^76 + x^51 +x^25 + x + 1 */
@@ -415,7 +415,7 @@ struct crng_state {
 	spinlock_t	lock;
 };
 
-struct crng_state primary_crng = {
+static struct crng_state primary_crng = {
 	.lock = __SPIN_LOCK_UNLOCKED(primary_crng.lock),
 };
 
diff --git a/drivers/char/tpm/eventlog/tpm2.c b/drivers/char/tpm/eventlog/tpm2.c
index d8b77133a83a..f824563fc28d 100644
--- a/drivers/char/tpm/eventlog/tpm2.c
+++ b/drivers/char/tpm/eventlog/tpm2.c
@@ -37,8 +37,8 @@
  *
  * Returns size of the event. If it is an invalid event, returns 0.
  */
-static int calc_tpm2_event_size(struct tcg_pcr_event2_head *event,
-				struct tcg_pcr_event *event_header)
+static size_t calc_tpm2_event_size(struct tcg_pcr_event2_head *event,
+				   struct tcg_pcr_event *event_header)
 {
 	struct tcg_efi_specid_event_head *efispecid;
 	struct tcg_event_field *event_field;
diff --git a/drivers/clk/rockchip/clk-rk3328.c b/drivers/clk/rockchip/clk-rk3328.c
index 65ab5c2f48b0..f12142d9cea2 100644
--- a/drivers/clk/rockchip/clk-rk3328.c
+++ b/drivers/clk/rockchip/clk-rk3328.c
@@ -458,7 +458,7 @@ static struct rockchip_clk_branch rk3328_clk_branches[] __initdata = {
 			RK3328_CLKSEL_CON(35), 15, 1, MFLAGS, 8, 7, DFLAGS,
 			RK3328_CLKGATE_CON(2), 12, GFLAGS),
 	COMPOSITE(SCLK_CRYPTO, "clk_crypto", mux_2plls_p, 0,
-			RK3328_CLKSEL_CON(20), 7, 1, MFLAGS, 0, 7, DFLAGS,
+			RK3328_CLKSEL_CON(20), 7, 1, MFLAGS, 0, 5, DFLAGS,
 			RK3328_CLKGATE_CON(2), 4, GFLAGS),
 	COMPOSITE_NOMUX(SCLK_TSADC, "clk_tsadc", "clk_24m", 0,
 			RK3328_CLKSEL_CON(22), 0, 10, DFLAGS,
@@ -550,15 +550,15 @@ static struct rockchip_clk_branch rk3328_clk_branches[] __initdata = {
 	GATE(0, "hclk_rkvenc_niu", "hclk_rkvenc", 0,
 			RK3328_CLKGATE_CON(25), 1, GFLAGS),
 	GATE(ACLK_H265, "aclk_h265", "aclk_rkvenc", 0,
-			RK3328_CLKGATE_CON(25), 0, GFLAGS),
+			RK3328_CLKGATE_CON(25), 2, GFLAGS),
 	GATE(PCLK_H265, "pclk_h265", "hclk_rkvenc", 0,
-			RK3328_CLKGATE_CON(25), 1, GFLAGS),
+			RK3328_CLKGATE_CON(25), 3, GFLAGS),
 	GATE(ACLK_H264, "aclk_h264", "aclk_rkvenc", 0,
-			RK3328_CLKGATE_CON(25), 0, GFLAGS),
+			RK3328_CLKGATE_CON(25), 4, GFLAGS),
 	GATE(HCLK_H264, "hclk_h264", "hclk_rkvenc", 0,
-			RK3328_CLKGATE_CON(25), 1, GFLAGS),
+			RK3328_CLKGATE_CON(25), 5, GFLAGS),
 	GATE(ACLK_AXISRAM, "aclk_axisram", "aclk_rkvenc", CLK_IGNORE_UNUSED,
-			RK3328_CLKGATE_CON(25), 0, GFLAGS),
+			RK3328_CLKGATE_CON(25), 6, GFLAGS),
 
 	COMPOSITE(SCLK_VENC_CORE, "sclk_venc_core", mux_4plls_p, 0,
 			RK3328_CLKSEL_CON(51), 14, 2, MFLAGS, 8, 5, DFLAGS,
@@ -663,7 +663,7 @@ static struct rockchip_clk_branch rk3328_clk_branches[] __initdata = {
 
 	/* PD_GMAC */
 	COMPOSITE(ACLK_GMAC, "aclk_gmac", mux_2plls_hdmiphy_p, 0,
-			RK3328_CLKSEL_CON(35), 6, 2, MFLAGS, 0, 5, DFLAGS,
+			RK3328_CLKSEL_CON(25), 6, 2, MFLAGS, 0, 5, DFLAGS,
 			RK3328_CLKGATE_CON(3), 2, GFLAGS),
 	COMPOSITE_NOMUX(PCLK_GMAC, "pclk_gmac", "aclk_gmac", 0,
 			RK3328_CLKSEL_CON(25), 8, 3, DFLAGS,
@@ -733,7 +733,7 @@ static struct rockchip_clk_branch rk3328_clk_branches[] __initdata = {
 
 	/* PD_PERI */
 	GATE(0, "aclk_peri_noc", "aclk_peri", CLK_IGNORE_UNUSED, RK3328_CLKGATE_CON(19), 11, GFLAGS),
-	GATE(ACLK_USB3OTG, "aclk_usb3otg", "aclk_peri", 0, RK3328_CLKGATE_CON(19), 4, GFLAGS),
+	GATE(ACLK_USB3OTG, "aclk_usb3otg", "aclk_peri", 0, RK3328_CLKGATE_CON(19), 14, GFLAGS),
 
 	GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_peri", 0, RK3328_CLKGATE_CON(19), 0, GFLAGS),
 	GATE(HCLK_SDIO, "hclk_sdio", "hclk_peri", 0, RK3328_CLKGATE_CON(19), 1, GFLAGS),
@@ -913,7 +913,7 @@ static void __init rk3328_clk_init(struct device_node *np)
 				     &rk3328_cpuclk_data, rk3328_cpuclk_rates,
 				     ARRAY_SIZE(rk3328_cpuclk_rates));
 
-	rockchip_register_softrst(np, 11, reg_base + RK3328_SOFTRST_CON(0),
+	rockchip_register_softrst(np, 12, reg_base + RK3328_SOFTRST_CON(0),
 				  ROCKCHIP_SOFTRST_HIWORD_MASK);
 
 	rockchip_register_restart_notifier(ctx, RK3328_GLB_SRST_FST, NULL);
diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
index d67242d87744..87e93406d7cd 100644
--- a/drivers/devfreq/devfreq-event.c
+++ b/drivers/devfreq/devfreq-event.c
@@ -240,7 +240,7 @@ struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(struct device *dev,
 	}
 
 	list_for_each_entry(edev, &devfreq_event_list, node) {
-		if (!strcmp(edev->desc->name, node->name))
+		if (of_node_name_eq(node, edev->desc->name))
 			goto out;
 	}
 	edev = NULL;
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 0ae3de76833b..8928383a1fa1 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -228,7 +228,7 @@ static struct devfreq_governor *find_devfreq_governor(const char *name)
  * if is not found. This can happen when both drivers (the governor driver
  * and the driver that call devfreq_add_device) are built as modules.
  * devfreq_list_lock should be held by the caller. Returns the matched
- * governor's pointer.
+ * governor's pointer or an error pointer.
  */
 static struct devfreq_governor *try_then_request_governor(const char *name)
 {
@@ -254,7 +254,7 @@ static struct devfreq_governor *try_then_request_governor(const char *name)
 		/* Restore previous state before return */
 		mutex_lock(&devfreq_list_lock);
 		if (err)
-			return NULL;
+			return ERR_PTR(err);
 
 		governor = find_devfreq_governor(name);
 	}
@@ -528,7 +528,7 @@ void devfreq_interval_update(struct devfreq *devfreq, unsigned int *delay)
 		mutex_lock(&devfreq->lock);
 		if (!devfreq->stop_polling)
 			queue_delayed_work(devfreq_wq, &devfreq->work,
-			      msecs_to_jiffies(devfreq->profile->polling_ms));
+				msecs_to_jiffies(devfreq->profile->polling_ms));
 	}
 out:
 	mutex_unlock(&devfreq->lock);
@@ -537,7 +537,7 @@ EXPORT_SYMBOL(devfreq_interval_update);
 
 /**
  * devfreq_notifier_call() - Notify that the device frequency requirements
- *			   has been changed out of devfreq framework.
+ *			     has been changed out of devfreq framework.
  * @nb:		the notifier_block (supposed to be devfreq->nb)
  * @type:	not used
  * @devp:	not used
@@ -651,7 +651,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
 		mutex_unlock(&devfreq->lock);
 		err = set_freq_table(devfreq);
 		if (err < 0)
-			goto err_out;
+			goto err_dev;
 		mutex_lock(&devfreq->lock);
 	}
 
@@ -683,16 +683,27 @@ struct devfreq *devfreq_add_device(struct device *dev,
 		goto err_out;
 	}
 
-	devfreq->trans_table =
-		devm_kzalloc(&devfreq->dev,
-			     array3_size(sizeof(unsigned int),
-					 devfreq->profile->max_state,
-					 devfreq->profile->max_state),
-			     GFP_KERNEL);
+	devfreq->trans_table = devm_kzalloc(&devfreq->dev,
+			array3_size(sizeof(unsigned int),
+				    devfreq->profile->max_state,
+				    devfreq->profile->max_state),
+			GFP_KERNEL);
+	if (!devfreq->trans_table) {
+		mutex_unlock(&devfreq->lock);
+		err = -ENOMEM;
+		goto err_devfreq;
+	}
+
 	devfreq->time_in_state = devm_kcalloc(&devfreq->dev,
-						devfreq->profile->max_state,
-						sizeof(unsigned long),
-						GFP_KERNEL);
+			devfreq->profile->max_state,
+			sizeof(unsigned long),
+			GFP_KERNEL);
+	if (!devfreq->time_in_state) {
+		mutex_unlock(&devfreq->lock);
+		err = -ENOMEM;
+		goto err_devfreq;
+	}
+
 	devfreq->last_stat_updated = jiffies;
 
 	srcu_init_notifier_head(&devfreq->transition_notifier_list);
@@ -726,7 +737,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
 
 err_init:
 	mutex_unlock(&devfreq_list_lock);
-
+err_devfreq:
 	devfreq_remove_device(devfreq);
 	devfreq = NULL;
 err_dev:
@@ -1113,7 +1124,7 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr,
 	struct devfreq *df = to_devfreq(dev);
 	int ret;
 	char str_governor[DEVFREQ_NAME_LEN + 1];
-	struct devfreq_governor *governor;
+	const struct devfreq_governor *governor, *prev_governor;
 
 	ret = sscanf(buf, "%" __stringify(DEVFREQ_NAME_LEN) "s", str_governor);
 	if (ret != 1)
@@ -1142,12 +1153,24 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr,
 			goto out;
 		}
 	}
+	prev_governor = df->governor;
 	df->governor = governor;
 	strncpy(df->governor_name, governor->name, DEVFREQ_NAME_LEN);
 	ret = df->governor->event_handler(df, DEVFREQ_GOV_START, NULL);
-	if (ret)
+	if (ret) {
 		dev_warn(dev, "%s: Governor %s not started(%d)\n",
 			 __func__, df->governor->name, ret);
+		df->governor = prev_governor;
+		strncpy(df->governor_name, prev_governor->name,
+			DEVFREQ_NAME_LEN);
+		ret = df->governor->event_handler(df, DEVFREQ_GOV_START, NULL);
+		if (ret) {
+			dev_err(dev,
+				"%s: reverting to Governor %s failed (%d)\n",
+				__func__, df->governor_name, ret);
+			df->governor = NULL;
+		}
+	}
 out:
 	mutex_unlock(&devfreq_list_lock);
 
@@ -1172,7 +1195,7 @@ static ssize_t available_governors_show(struct device *d,
 	 */
 	if (df->governor->immutable) {
 		count = scnprintf(&buf[count], DEVFREQ_NAME_LEN,
-				   "%s ", df->governor_name);
+				  "%s ", df->governor_name);
 	/*
 	 * The devfreq device shows the registered governor except for
 	 * immutable governors such as passive governor .
@@ -1485,8 +1508,8 @@ EXPORT_SYMBOL(devfreq_recommended_opp);
 
 /**
  * devfreq_register_opp_notifier() - Helper function to get devfreq notified
- *				   for any changes in the OPP availability
- *				   changes
+ *				     for any changes in the OPP availability
+ *				     changes
  * @dev:	The devfreq user device. (parent of devfreq)
  * @devfreq:	The devfreq object.
  */
@@ -1498,8 +1521,8 @@ EXPORT_SYMBOL(devfreq_register_opp_notifier);
 
 /**
  * devfreq_unregister_opp_notifier() - Helper function to stop getting devfreq
- *				     notified for any changes in the OPP
- *				     availability changes anymore.
+ *				       notified for any changes in the OPP
+ *				       availability changes anymore.
  * @dev:	The devfreq user device. (parent of devfreq)
  * @devfreq:	The devfreq object.
  *
@@ -1518,8 +1541,8 @@ static void devm_devfreq_opp_release(struct device *dev, void *res)
 }
 
 /**
- * devm_ devfreq_register_opp_notifier()
- *		- Resource-managed devfreq_register_opp_notifier()
+ * devm_devfreq_register_opp_notifier() - Resource-managed
+ *					  devfreq_register_opp_notifier()
  * @dev:	The devfreq user device. (parent of devfreq)
  * @devfreq:	The devfreq object.
  */
@@ -1547,8 +1570,8 @@ int devm_devfreq_register_opp_notifier(struct device *dev,
 EXPORT_SYMBOL(devm_devfreq_register_opp_notifier);
 
 /**
- * devm_devfreq_unregister_opp_notifier()
- *		- Resource-managed devfreq_unregister_opp_notifier()
+ * devm_devfreq_unregister_opp_notifier() - Resource-managed
+ *					    devfreq_unregister_opp_notifier()
  * @dev:	The devfreq user device. (parent of devfreq)
  * @devfreq:	The devfreq object.
  */
@@ -1567,8 +1590,8 @@ EXPORT_SYMBOL(devm_devfreq_unregister_opp_notifier);
  * @list:	DEVFREQ_TRANSITION_NOTIFIER.
  */
 int devfreq_register_notifier(struct devfreq *devfreq,
-				struct notifier_block *nb,
-				unsigned int list)
+			      struct notifier_block *nb,
+			      unsigned int list)
 {
 	int ret = 0;
 
@@ -1674,9 +1697,9 @@ EXPORT_SYMBOL(devm_devfreq_register_notifier);
  * @list:	DEVFREQ_TRANSITION_NOTIFIER.
  */
 void devm_devfreq_unregister_notifier(struct device *dev,
-				struct devfreq *devfreq,
-				struct notifier_block *nb,
-				unsigned int list)
+				      struct devfreq *devfreq,
+				      struct notifier_block *nb,
+				      unsigned int list)
 {
 	WARN_ON(devres_release(dev, devm_devfreq_notifier_release,
 			       devm_devfreq_dev_match, devfreq));
diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
index c61de0bdf053..c2ea94957501 100644
--- a/drivers/devfreq/event/exynos-ppmu.c
+++ b/drivers/devfreq/event/exynos-ppmu.c
@@ -529,7 +529,7 @@ static int of_get_devfreq_events(struct device_node *np,
 			if (!ppmu_events[i].name)
 				continue;
 
-			if (!of_node_cmp(node->name, ppmu_events[i].name))
+			if (of_node_name_eq(node, ppmu_events[i].name))
 				break;
 		}
 
diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/rockchip-dfi.c
index 22b113363ffc..fcbf76ebf55d 100644
--- a/drivers/devfreq/event/rockchip-dfi.c
+++ b/drivers/devfreq/event/rockchip-dfi.c
@@ -211,7 +211,7 @@ static int rockchip_dfi_probe(struct platform_device *pdev)
 	if (IS_ERR(data->clk)) {
 		dev_err(dev, "Cannot get the clk dmc_clk\n");
 		return PTR_ERR(data->clk);
-	};
+	}
 
 	/* try to find the optional reference to the pmu syscon */
 	node = of_parse_phandle(np, "rockchip,pmu", 0);
diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c
index e795ad2b3f6b..a228dad2bee4 100644
--- a/drivers/devfreq/rk3399_dmc.c
+++ b/drivers/devfreq/rk3399_dmc.c
@@ -322,7 +322,7 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
 
 		dev_err(dev, "Cannot get the clk dmc_clk\n");
 		return PTR_ERR(data->dmc_clk);
-	};
+	}
 
 	data->edev = devfreq_event_get_edev_by_phandle(dev, 0);
 	if (IS_ERR(data->edev))
diff --git a/drivers/devfreq/tegra-devfreq.c b/drivers/devfreq/tegra-devfreq.c
index c59d2eee5d30..c89ba7b834ff 100644
--- a/drivers/devfreq/tegra-devfreq.c
+++ b/drivers/devfreq/tegra-devfreq.c
@@ -573,10 +573,7 @@ static int tegra_governor_get_target(struct devfreq *devfreq,
 static int tegra_governor_event_handler(struct devfreq *devfreq,
 					unsigned int event, void *data)
 {
-	struct tegra_devfreq *tegra;
-	int ret = 0;
-
-	tegra = dev_get_drvdata(devfreq->dev.parent);
+	struct tegra_devfreq *tegra = dev_get_drvdata(devfreq->dev.parent);
 
 	switch (event) {
 	case DEVFREQ_GOV_START:
@@ -600,7 +597,7 @@ static int tegra_governor_event_handler(struct devfreq *devfreq,
 		break;
 	}
 
-	return ret;
+	return 0;
 }
 
 static struct devfreq_governor tegra_devfreq_governor = {
diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig
index 8e17149655f0..540e8cd16ee6 100644
--- a/drivers/extcon/Kconfig
+++ b/drivers/extcon/Kconfig
@@ -116,7 +116,7 @@ config EXTCON_PALMAS
 
 config EXTCON_PTN5150
 	tristate "NXP PTN5150 CC LOGIC USB EXTCON support"
-	depends on I2C && GPIOLIB || COMPILE_TEST
+	depends on I2C && (GPIOLIB || COMPILE_TEST)
 	select REGMAP_I2C
 	help
 	  Say Y here to enable support for USB peripheral and USB host
diff --git a/drivers/extcon/devres.c b/drivers/extcon/devres.c
index f599aeddf8e5..f487d877ab5d 100644
--- a/drivers/extcon/devres.c
+++ b/drivers/extcon/devres.c
@@ -205,7 +205,7 @@ EXPORT_SYMBOL(devm_extcon_register_notifier);
 
 /**
  * devm_extcon_unregister_notifier()
-			- Resource-managed extcon_unregister_notifier()
+ *			- Resource-managed extcon_unregister_notifier()
  * @dev:	the device owning the extcon device being created
  * @edev:	the extcon device
  * @id:		the unique id among the extcon enumeration
diff --git a/drivers/extcon/extcon-intel-cht-wc.c b/drivers/extcon/extcon-intel-cht-wc.c
index 5ef215297101..53b28ecc4ad1 100644
--- a/drivers/extcon/extcon-intel-cht-wc.c
+++ b/drivers/extcon/extcon-intel-cht-wc.c
@@ -29,7 +29,15 @@
 #define CHT_WC_CHGRCTRL0_DBPOFF		BIT(6)
 #define CHT_WC_CHGRCTRL0_CHR_WDT_NOKICK	BIT(7)
 
-#define CHT_WC_CHGRCTRL1		0x5e17
+#define CHT_WC_CHGRCTRL1			0x5e17
+#define CHT_WC_CHGRCTRL1_FUSB_INLMT_100		BIT(0)
+#define CHT_WC_CHGRCTRL1_FUSB_INLMT_150		BIT(1)
+#define CHT_WC_CHGRCTRL1_FUSB_INLMT_500		BIT(2)
+#define CHT_WC_CHGRCTRL1_FUSB_INLMT_900		BIT(3)
+#define CHT_WC_CHGRCTRL1_FUSB_INLMT_1500	BIT(4)
+#define CHT_WC_CHGRCTRL1_FTEMP_EVENT		BIT(5)
+#define CHT_WC_CHGRCTRL1_OTGMODE		BIT(6)
+#define CHT_WC_CHGRCTRL1_DBPEN			BIT(7)
 
 #define CHT_WC_USBSRC			0x5e29
 #define CHT_WC_USBSRC_STS_MASK		GENMASK(1, 0)
@@ -48,6 +56,13 @@
 #define CHT_WC_USBSRC_TYPE_OTHER	8
 #define CHT_WC_USBSRC_TYPE_DCP_EXTPHY	9
 
+#define CHT_WC_CHGDISCTRL		0x5e2f
+#define CHT_WC_CHGDISCTRL_OUT		BIT(0)
+/* 0 - open drain, 1 - regular push-pull output */
+#define CHT_WC_CHGDISCTRL_DRV		BIT(4)
+/* 0 - pin is controlled by SW, 1 - by HW */
+#define CHT_WC_CHGDISCTRL_FN		BIT(6)
+
 #define CHT_WC_PWRSRC_IRQ		0x6e03
 #define CHT_WC_PWRSRC_IRQ_MASK		0x6e0f
 #define CHT_WC_PWRSRC_STS		0x6e1e
@@ -198,6 +213,30 @@ static void cht_wc_extcon_set_5v_boost(struct cht_wc_extcon_data *ext,
 		dev_err(ext->dev, "Error writing Vbus GPIO CTLO: %d\n", ret);
 }
 
+static void cht_wc_extcon_set_otgmode(struct cht_wc_extcon_data *ext,
+				      bool enable)
+{
+	unsigned int val = enable ? CHT_WC_CHGRCTRL1_OTGMODE : 0;
+	int ret;
+
+	ret = regmap_update_bits(ext->regmap, CHT_WC_CHGRCTRL1,
+				 CHT_WC_CHGRCTRL1_OTGMODE, val);
+	if (ret)
+		dev_err(ext->dev, "Error updating CHGRCTRL1 reg: %d\n", ret);
+}
+
+static void cht_wc_extcon_enable_charging(struct cht_wc_extcon_data *ext,
+					  bool enable)
+{
+	unsigned int val = enable ? 0 : CHT_WC_CHGDISCTRL_OUT;
+	int ret;
+
+	ret = regmap_update_bits(ext->regmap, CHT_WC_CHGDISCTRL,
+				 CHT_WC_CHGDISCTRL_OUT, val);
+	if (ret)
+		dev_err(ext->dev, "Error updating CHGDISCTRL reg: %d\n", ret);
+}
+
 /* Small helper to sync EXTCON_CHG_USB_SDP and EXTCON_USB state */
 static void cht_wc_extcon_set_state(struct cht_wc_extcon_data *ext,
 				    unsigned int cable, bool state)
@@ -222,10 +261,16 @@ static void cht_wc_extcon_pwrsrc_event(struct cht_wc_extcon_data *ext)
 
 	id = cht_wc_extcon_get_id(ext, pwrsrc_sts);
 	if (id == USB_ID_GND) {
+		cht_wc_extcon_enable_charging(ext, false);
+		cht_wc_extcon_set_otgmode(ext, true);
+
 		/* The 5v boost causes a false VBUS / SDP detect, skip */
 		goto charger_det_done;
 	}
 
+	cht_wc_extcon_set_otgmode(ext, false);
+	cht_wc_extcon_enable_charging(ext, true);
+
 	/* Plugged into a host/charger or not connected? */
 	if (!(pwrsrc_sts & CHT_WC_PWRSRC_VBUS)) {
 		/* Route D+ and D- to PMIC for future charger detection */
@@ -278,6 +323,14 @@ static int cht_wc_extcon_sw_control(struct cht_wc_extcon_data *ext, bool enable)
 {
 	int ret, mask, val;
 
+	val = enable ? 0 : CHT_WC_CHGDISCTRL_FN;
+	ret = regmap_update_bits(ext->regmap, CHT_WC_CHGDISCTRL,
+				 CHT_WC_CHGDISCTRL_FN, val);
+	if (ret)
+		dev_err(ext->dev,
+			"Error setting sw control for CHGDIS pin: %d\n",
+			ret);
+
 	mask = CHT_WC_CHGRCTRL0_SWCONTROL | CHT_WC_CHGRCTRL0_CCSM_OFF;
 	val = enable ? mask : 0;
 	ret = regmap_update_bits(ext->regmap, CHT_WC_CHGRCTRL0, mask, val);
@@ -329,7 +382,10 @@ static int cht_wc_extcon_probe(struct platform_device *pdev)
 	/* Enable sw control */
 	ret = cht_wc_extcon_sw_control(ext, true);
 	if (ret)
-		return ret;
+		goto disable_sw_control;
+
+	/* Disable charging by external battery charger */
+	cht_wc_extcon_enable_charging(ext, false);
 
 	/* Register extcon device */
 	ret = devm_extcon_dev_register(ext->dev, ext->edev);
diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
index 541fa6ac399d..6f6558715b88 100644
--- a/drivers/gpio/gpio-vf610.c
+++ b/drivers/gpio/gpio-vf610.c
@@ -29,6 +29,7 @@ struct fsl_gpio_soc_data {
 
 struct vf610_gpio_port {
 	struct gpio_chip gc;
+	struct irq_chip ic;
 	void __iomem *base;
 	void __iomem *gpio_base;
 	const struct fsl_gpio_soc_data *sdata;
@@ -60,8 +61,6 @@ struct vf610_gpio_port {
 #define PORT_INT_EITHER_EDGE	0xb
 #define PORT_INT_LOGIC_ONE	0xc
 
-static struct irq_chip vf610_gpio_irq_chip;
-
 static const struct fsl_gpio_soc_data imx_data = {
 	.have_paddr = true,
 };
@@ -86,28 +85,24 @@ static int vf610_gpio_get(struct gpio_chip *gc, unsigned int gpio)
 {
 	struct vf610_gpio_port *port = gpiochip_get_data(gc);
 	unsigned long mask = BIT(gpio);
-	void __iomem *addr;
+	unsigned long offset = GPIO_PDIR;
 
 	if (port->sdata && port->sdata->have_paddr) {
 		mask &= vf610_gpio_readl(port->gpio_base + GPIO_PDDR);
-		addr = mask ? port->gpio_base + GPIO_PDOR :
-			      port->gpio_base + GPIO_PDIR;
-		return !!(vf610_gpio_readl(addr) & BIT(gpio));
-	} else {
-		return !!(vf610_gpio_readl(port->gpio_base + GPIO_PDIR)
-					   & BIT(gpio));
+		if (mask)
+			offset = GPIO_PDOR;
 	}
+
+	return !!(vf610_gpio_readl(port->gpio_base + offset) & BIT(gpio));
 }
 
 static void vf610_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
 {
 	struct vf610_gpio_port *port = gpiochip_get_data(gc);
 	unsigned long mask = BIT(gpio);
+	unsigned long offset = val ? GPIO_PSOR : GPIO_PCOR;
 
-	if (val)
-		vf610_gpio_writel(mask, port->gpio_base + GPIO_PSOR);
-	else
-		vf610_gpio_writel(mask, port->gpio_base + GPIO_PCOR);
+	vf610_gpio_writel(mask, port->gpio_base + offset);
 }
 
 static int vf610_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
@@ -237,14 +232,10 @@ static int vf610_gpio_irq_set_wake(struct irq_data *d, u32 enable)
 	return 0;
 }
 
-static struct irq_chip vf610_gpio_irq_chip = {
-	.name		= "gpio-vf610",
-	.irq_ack	= vf610_gpio_irq_ack,
-	.irq_mask	= vf610_gpio_irq_mask,
-	.irq_unmask	= vf610_gpio_irq_unmask,
-	.irq_set_type	= vf610_gpio_irq_set_type,
-	.irq_set_wake	= vf610_gpio_irq_set_wake,
-};
+static void vf610_gpio_disable_clk(void *data)
+{
+	clk_disable_unprepare(data);
+}
 
 static int vf610_gpio_probe(struct platform_device *pdev)
 {
@@ -253,10 +244,11 @@ static int vf610_gpio_probe(struct platform_device *pdev)
 	struct vf610_gpio_port *port;
 	struct resource *iores;
 	struct gpio_chip *gc;
+	struct irq_chip *ic;
 	int i;
 	int ret;
 
-	port = devm_kzalloc(&pdev->dev, sizeof(*port), GFP_KERNEL);
+	port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);
 	if (!port)
 		return -ENOMEM;
 
@@ -275,11 +267,15 @@ static int vf610_gpio_probe(struct platform_device *pdev)
 	if (port->irq < 0)
 		return port->irq;
 
-	port->clk_port = devm_clk_get(&pdev->dev, "port");
+	port->clk_port = devm_clk_get(dev, "port");
 	if (!IS_ERR(port->clk_port)) {
 		ret = clk_prepare_enable(port->clk_port);
 		if (ret)
 			return ret;
+		ret = devm_add_action_or_reset(dev, vf610_gpio_disable_clk,
+					       port->clk_port);
+		if (ret)
+			return ret;
 	} else if (port->clk_port == ERR_PTR(-EPROBE_DEFER)) {
 		/*
 		 * Percolate deferrals, for anything else,
@@ -288,20 +284,19 @@ static int vf610_gpio_probe(struct platform_device *pdev)
 		return PTR_ERR(port->clk_port);
 	}
 
-	port->clk_gpio = devm_clk_get(&pdev->dev, "gpio");
+	port->clk_gpio = devm_clk_get(dev, "gpio");
 	if (!IS_ERR(port->clk_gpio)) {
 		ret = clk_prepare_enable(port->clk_gpio);
-		if (ret) {
-			clk_disable_unprepare(port->clk_port);
+		if (ret)
+			return ret;
+		ret = devm_add_action_or_reset(dev, vf610_gpio_disable_clk,
+					       port->clk_gpio);
+		if (ret)
 			return ret;
-		}
 	} else if (port->clk_gpio == ERR_PTR(-EPROBE_DEFER)) {
-		clk_disable_unprepare(port->clk_port);
 		return PTR_ERR(port->clk_gpio);
 	}
 
-	platform_set_drvdata(pdev, port);
-
 	gc = &port->gc;
 	gc->of_node = np;
 	gc->parent = dev;
@@ -316,7 +311,15 @@ static int vf610_gpio_probe(struct platform_device *pdev)
 	gc->direction_output = vf610_gpio_direction_output;
 	gc->set = vf610_gpio_set;
 
-	ret = gpiochip_add_data(gc, port);
+	ic = &port->ic;
+	ic->name = "gpio-vf610";
+	ic->irq_ack = vf610_gpio_irq_ack;
+	ic->irq_mask = vf610_gpio_irq_mask;
+	ic->irq_unmask = vf610_gpio_irq_unmask;
+	ic->irq_set_type = vf610_gpio_irq_set_type;
+	ic->irq_set_wake = vf610_gpio_irq_set_wake;
+
+	ret = devm_gpiochip_add_data(dev, gc, port);
 	if (ret < 0)
 		return ret;
 
@@ -327,39 +330,23 @@ static int vf610_gpio_probe(struct platform_device *pdev)
 	/* Clear the interrupt status register for all GPIO's */
 	vf610_gpio_writel(~0, port->base + PORT_ISFR);
 
-	ret = gpiochip_irqchip_add(gc, &vf610_gpio_irq_chip, 0,
-				   handle_edge_irq, IRQ_TYPE_NONE);
+	ret = gpiochip_irqchip_add(gc, ic, 0, handle_edge_irq, IRQ_TYPE_NONE);
 	if (ret) {
 		dev_err(dev, "failed to add irqchip\n");
-		gpiochip_remove(gc);
 		return ret;
 	}
-	gpiochip_set_chained_irqchip(gc, &vf610_gpio_irq_chip, port->irq,
+	gpiochip_set_chained_irqchip(gc, ic, port->irq,
 				     vf610_gpio_irq_handler);
 
 	return 0;
 }
 
-static int vf610_gpio_remove(struct platform_device *pdev)
-{
-	struct vf610_gpio_port *port = platform_get_drvdata(pdev);
-
-	gpiochip_remove(&port->gc);
-	if (!IS_ERR(port->clk_port))
-		clk_disable_unprepare(port->clk_port);
-	if (!IS_ERR(port->clk_gpio))
-		clk_disable_unprepare(port->clk_gpio);
-
-	return 0;
-}
-
 static struct platform_driver vf610_gpio_driver = {
 	.driver		= {
 		.name	= "gpio-vf610",
 		.of_match_table = vf610_gpio_dt_ids,
 	},
 	.probe		= vf610_gpio_probe,
-	.remove		= vf610_gpio_remove,
 };
 
 builtin_platform_driver(vf610_gpio_driver);
diff --git a/drivers/gpu/drm/arm/display/include/malidp_utils.h b/drivers/gpu/drm/arm/display/include/malidp_utils.h
index 63cc47cefcf8..8cfd91196e15 100644
--- a/drivers/gpu/drm/arm/display/include/malidp_utils.h
+++ b/drivers/gpu/drm/arm/display/include/malidp_utils.h
@@ -7,10 +7,41 @@
 #ifndef _MALIDP_UTILS_
 #define _MALIDP_UTILS_
 
+#include <linux/delay.h>
+
 #define has_bit(nr, mask)	(BIT(nr) & (mask))
 #define has_bits(bits, mask)	(((bits) & (mask)) == (bits))
 
 #define dp_for_each_set_bit(bit, mask) \
 	for_each_set_bit((bit), ((unsigned long *)&(mask)), sizeof(mask) * 8)
 
+#define dp_wait_cond(__cond, __tries, __min_range, __max_range)	\
+({							\
+	int num_tries = __tries;			\
+	while (!__cond && (num_tries > 0)) {		\
+		usleep_range(__min_range, __max_range);	\
+		if (__cond)				\
+			break;				\
+		num_tries--;				\
+	}						\
+	num_tries;					\
+})
+
+/* the restriction of range is [start, end] */
+struct malidp_range {
+	u32 start;
+	u32 end;
+};
+
+static inline void set_range(struct malidp_range *rg, u32 start, u32 end)
+{
+	rg->start = start;
+	rg->end   = end;
+}
+
+static inline bool in_range(struct malidp_range *rg, u32 v)
+{
+	return (v >= rg->start) && (v <= rg->end);
+}
+
 #endif /* _MALIDP_UTILS_ */
diff --git a/drivers/gpu/drm/arm/display/komeda/Makefile b/drivers/gpu/drm/arm/display/komeda/Makefile
index 1b875e5dc0f6..d593125236ae 100644
--- a/drivers/gpu/drm/arm/display/komeda/Makefile
+++ b/drivers/gpu/drm/arm/display/komeda/Makefile
@@ -16,6 +16,7 @@ komeda-y := \
 	komeda_private_obj.o
 
 komeda-y += \
-	d71/d71_dev.o
+	d71/d71_dev.o \
+	d71/d71_component.o
 
 obj-$(CONFIG_DRM_KOMEDA) += komeda.o
diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c
new file mode 100644
index 000000000000..c56cfc2de147
--- /dev/null
+++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c
@@ -0,0 +1,684 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * (C) COPYRIGHT 2018 ARM Limited. All rights reserved.
+ * Author: James.Qian.Wang <james.qian.wang@arm.com>
+ *
+ */
+
+#include <drm/drm_print.h>
+#include "d71_dev.h"
+#include "komeda_kms.h"
+#include "malidp_io.h"
+#include "komeda_framebuffer.h"
+
+static void get_resources_id(u32 hw_id, u32 *pipe_id, u32 *comp_id)
+{
+	u32 id = BLOCK_INFO_BLK_ID(hw_id);
+	u32 pipe = id;
+
+	switch (BLOCK_INFO_BLK_TYPE(hw_id)) {
+	case D71_BLK_TYPE_LPU_WB_LAYER:
+		id = KOMEDA_COMPONENT_WB_LAYER;
+		break;
+	case D71_BLK_TYPE_CU_SPLITTER:
+		id = KOMEDA_COMPONENT_SPLITTER;
+		break;
+	case D71_BLK_TYPE_CU_SCALER:
+		pipe = id / D71_PIPELINE_MAX_SCALERS;
+		id %= D71_PIPELINE_MAX_SCALERS;
+		id += KOMEDA_COMPONENT_SCALER0;
+		break;
+	case D71_BLK_TYPE_CU:
+		id += KOMEDA_COMPONENT_COMPIZ0;
+		break;
+	case D71_BLK_TYPE_LPU_LAYER:
+		pipe = id / D71_PIPELINE_MAX_LAYERS;
+		id %= D71_PIPELINE_MAX_LAYERS;
+		id += KOMEDA_COMPONENT_LAYER0;
+		break;
+	case D71_BLK_TYPE_DOU_IPS:
+		id += KOMEDA_COMPONENT_IPS0;
+		break;
+	case D71_BLK_TYPE_CU_MERGER:
+		id = KOMEDA_COMPONENT_MERGER;
+		break;
+	case D71_BLK_TYPE_DOU:
+		id = KOMEDA_COMPONENT_TIMING_CTRLR;
+		break;
+	default:
+		id = 0xFFFFFFFF;
+	}
+
+	if (comp_id)
+		*comp_id = id;
+
+	if (pipe_id)
+		*pipe_id = pipe;
+}
+
+static u32 get_valid_inputs(struct block_header *blk)
+{
+	u32 valid_inputs = 0, comp_id;
+	int i;
+
+	for (i = 0; i < PIPELINE_INFO_N_VALID_INPUTS(blk->pipeline_info); i++) {
+		get_resources_id(blk->input_ids[i], NULL, &comp_id);
+		if (comp_id == 0xFFFFFFFF)
+			continue;
+		valid_inputs |= BIT(comp_id);
+	}
+
+	return valid_inputs;
+}
+
+static void get_values_from_reg(void __iomem *reg, u32 offset,
+				u32 count, u32 *val)
+{
+	u32 i, addr;
+
+	for (i = 0; i < count; i++) {
+		addr = offset + (i << 2);
+		/* 0xA4 is WO register */
+		if (addr != 0xA4)
+			val[i] = malidp_read32(reg, addr);
+		else
+			val[i] = 0xDEADDEAD;
+	}
+}
+
+static void dump_block_header(struct seq_file *sf, void __iomem *reg)
+{
+	struct block_header hdr;
+	u32 i, n_input, n_output;
+
+	d71_read_block_header(reg, &hdr);
+	seq_printf(sf, "BLOCK_INFO:\t\t0x%X\n", hdr.block_info);
+	seq_printf(sf, "PIPELINE_INFO:\t\t0x%X\n", hdr.pipeline_info);
+
+	n_output = PIPELINE_INFO_N_OUTPUTS(hdr.pipeline_info);
+	n_input  = PIPELINE_INFO_N_VALID_INPUTS(hdr.pipeline_info);
+
+	for (i = 0; i < n_input; i++)
+		seq_printf(sf, "VALID_INPUT_ID%u:\t0x%X\n",
+			   i, hdr.input_ids[i]);
+
+	for (i = 0; i < n_output; i++)
+		seq_printf(sf, "OUTPUT_ID%u:\t\t0x%X\n",
+			   i, hdr.output_ids[i]);
+}
+
+static u32 to_rot_ctrl(u32 rot)
+{
+	u32 lr_ctrl = 0;
+
+	switch (rot & DRM_MODE_ROTATE_MASK) {
+	case DRM_MODE_ROTATE_0:
+		lr_ctrl |= L_ROT(L_ROT_R0);
+		break;
+	case DRM_MODE_ROTATE_90:
+		lr_ctrl |= L_ROT(L_ROT_R90);
+		break;
+	case DRM_MODE_ROTATE_180:
+		lr_ctrl |= L_ROT(L_ROT_R180);
+		break;
+	case DRM_MODE_ROTATE_270:
+		lr_ctrl |= L_ROT(L_ROT_R270);
+		break;
+	}
+
+	if (rot & DRM_MODE_REFLECT_X)
+		lr_ctrl |= L_HFLIP;
+	if (rot & DRM_MODE_REFLECT_Y)
+		lr_ctrl |= L_VFLIP;
+
+	return lr_ctrl;
+}
+
+static inline u32 to_d71_input_id(struct komeda_component_output *output)
+{
+	struct komeda_component *comp = output->component;
+
+	return comp ? (comp->hw_id + output->output_port) : 0;
+}
+
+static void d71_layer_disable(struct komeda_component *c)
+{
+	malidp_write32_mask(c->reg, BLK_CONTROL, L_EN, 0);
+}
+
+static void d71_layer_update(struct komeda_component *c,
+			     struct komeda_component_state *state)
+{
+	struct komeda_layer_state *st = to_layer_st(state);
+	struct drm_plane_state *plane_st = state->plane->state;
+	struct drm_framebuffer *fb = plane_st->fb;
+	struct komeda_fb *kfb = to_kfb(fb);
+	u32 __iomem *reg = c->reg;
+	u32 ctrl_mask = L_EN | L_ROT(L_ROT_R270) | L_HFLIP | L_VFLIP | L_TBU_EN;
+	u32 ctrl = L_EN | to_rot_ctrl(st->rot);
+	int i;
+
+	for (i = 0; i < fb->format->num_planes; i++) {
+		malidp_write32(reg,
+			       BLK_P0_PTR_LOW + i * LAYER_PER_PLANE_REGS * 4,
+			       lower_32_bits(st->addr[i]));
+		malidp_write32(reg,
+			       BLK_P0_PTR_HIGH + i * LAYER_PER_PLANE_REGS * 4,
+			       upper_32_bits(st->addr[i]));
+		if (i >= 2)
+			break;
+
+		malidp_write32(reg,
+			       BLK_P0_STRIDE + i * LAYER_PER_PLANE_REGS * 4,
+			       fb->pitches[i] & 0xFFFF);
+	}
+
+	malidp_write32(reg, LAYER_FMT, kfb->format_caps->hw_id);
+	malidp_write32(reg, BLK_IN_SIZE, HV_SIZE(st->hsize, st->vsize));
+
+	malidp_write32_mask(reg, BLK_CONTROL, ctrl_mask, ctrl);
+}
+
+static void d71_layer_dump(struct komeda_component *c, struct seq_file *sf)
+{
+	u32 v[15], i;
+	bool rich, rgb2rgb;
+	char *prefix;
+
+	get_values_from_reg(c->reg, LAYER_INFO, 1, &v[14]);
+	if (v[14] & 0x1) {
+		rich = true;
+		prefix = "LR_";
+	} else {
+		rich = false;
+		prefix = "LS_";
+	}
+
+	rgb2rgb = !!(v[14] & L_INFO_CM);
+
+	dump_block_header(sf, c->reg);
+
+	seq_printf(sf, "%sLAYER_INFO:\t\t0x%X\n", prefix, v[14]);
+
+	get_values_from_reg(c->reg, 0xD0, 1, v);
+	seq_printf(sf, "%sCONTROL:\t\t0x%X\n", prefix, v[0]);
+	if (rich) {
+		get_values_from_reg(c->reg, 0xD4, 1, v);
+		seq_printf(sf, "LR_RICH_CONTROL:\t0x%X\n", v[0]);
+	}
+	get_values_from_reg(c->reg, 0xD8, 4, v);
+	seq_printf(sf, "%sFORMAT:\t\t0x%X\n", prefix, v[0]);
+	seq_printf(sf, "%sIT_COEFFTAB:\t\t0x%X\n", prefix, v[1]);
+	seq_printf(sf, "%sIN_SIZE:\t\t0x%X\n", prefix, v[2]);
+	seq_printf(sf, "%sPALPHA:\t\t0x%X\n", prefix, v[3]);
+
+	get_values_from_reg(c->reg, 0x100, 3, v);
+	seq_printf(sf, "%sP0_PTR_LOW:\t\t0x%X\n", prefix, v[0]);
+	seq_printf(sf, "%sP0_PTR_HIGH:\t\t0x%X\n", prefix, v[1]);
+	seq_printf(sf, "%sP0_STRIDE:\t\t0x%X\n", prefix, v[2]);
+
+	get_values_from_reg(c->reg, 0x110, 2, v);
+	seq_printf(sf, "%sP1_PTR_LOW:\t\t0x%X\n", prefix, v[0]);
+	seq_printf(sf, "%sP1_PTR_HIGH:\t\t0x%X\n", prefix, v[1]);
+	if (rich) {
+		get_values_from_reg(c->reg, 0x118, 1, v);
+		seq_printf(sf, "LR_P1_STRIDE:\t\t0x%X\n", v[0]);
+
+		get_values_from_reg(c->reg, 0x120, 2, v);
+		seq_printf(sf, "LR_P2_PTR_LOW:\t\t0x%X\n", v[0]);
+		seq_printf(sf, "LR_P2_PTR_HIGH:\t\t0x%X\n", v[1]);
+
+		get_values_from_reg(c->reg, 0x130, 12, v);
+		for (i = 0; i < 12; i++)
+			seq_printf(sf, "LR_YUV_RGB_COEFF%u:\t0x%X\n", i, v[i]);
+	}
+
+	if (rgb2rgb) {
+		get_values_from_reg(c->reg, LAYER_RGB_RGB_COEFF0, 12, v);
+		for (i = 0; i < 12; i++)
+			seq_printf(sf, "LS_RGB_RGB_COEFF%u:\t0x%X\n", i, v[i]);
+	}
+
+	get_values_from_reg(c->reg, 0x160, 3, v);
+	seq_printf(sf, "%sAD_CONTROL:\t\t0x%X\n", prefix, v[0]);
+	seq_printf(sf, "%sAD_H_CROP:\t\t0x%X\n", prefix, v[1]);
+	seq_printf(sf, "%sAD_V_CROP:\t\t0x%X\n", prefix, v[2]);
+}
+
+static struct komeda_component_funcs d71_layer_funcs = {
+	.update		= d71_layer_update,
+	.disable	= d71_layer_disable,
+	.dump_register	= d71_layer_dump,
+};
+
+static int d71_layer_init(struct d71_dev *d71,
+			  struct block_header *blk, u32 __iomem *reg)
+{
+	struct komeda_component *c;
+	struct komeda_layer *layer;
+	u32 pipe_id, layer_id, layer_info;
+
+	get_resources_id(blk->block_info, &pipe_id, &layer_id);
+	c = komeda_component_add(&d71->pipes[pipe_id]->base, sizeof(*layer),
+				 layer_id,
+				 BLOCK_INFO_INPUT_ID(blk->block_info),
+				 &d71_layer_funcs, 0,
+				 get_valid_inputs(blk),
+				 1, reg, "LPU%d_LAYER%d", pipe_id, layer_id);
+	if (IS_ERR(c)) {
+		DRM_ERROR("Failed to add layer component\n");
+		return PTR_ERR(c);
+	}
+
+	layer = to_layer(c);
+	layer_info = malidp_read32(reg, LAYER_INFO);
+
+	if (layer_info & L_INFO_RF)
+		layer->layer_type = KOMEDA_FMT_RICH_LAYER;
+	else
+		layer->layer_type = KOMEDA_FMT_SIMPLE_LAYER;
+
+	set_range(&layer->hsize_in, 4, d71->max_line_size);
+	set_range(&layer->vsize_in, 4, d71->max_vsize);
+
+	malidp_write32(reg, LAYER_PALPHA, D71_PALPHA_DEF_MAP);
+
+	layer->supported_rots = DRM_MODE_ROTATE_MASK | DRM_MODE_REFLECT_MASK;
+
+	return 0;
+}
+
+static int d71_wb_layer_init(struct d71_dev *d71,
+			     struct block_header *blk, u32 __iomem *reg)
+{
+	DRM_DEBUG("Detect D71_Wb_Layer.\n");
+
+	return 0;
+}
+
+static void d71_component_disable(struct komeda_component *c)
+{
+	u32 __iomem *reg = c->reg;
+	u32 i;
+
+	malidp_write32(reg, BLK_CONTROL, 0);
+
+	for (i = 0; i < c->max_active_inputs; i++)
+		malidp_write32(reg, BLK_INPUT_ID0 + (i << 2), 0);
+}
+
+static void compiz_enable_input(u32 __iomem *id_reg,
+				u32 __iomem *cfg_reg,
+				u32 input_hw_id,
+				struct komeda_compiz_input_cfg *cin)
+{
+	u32 ctrl = CU_INPUT_CTRL_EN;
+	u8 blend = cin->pixel_blend_mode;
+
+	if (blend == DRM_MODE_BLEND_PIXEL_NONE)
+		ctrl |= CU_INPUT_CTRL_PAD;
+	else if (blend == DRM_MODE_BLEND_PREMULTI)
+		ctrl |= CU_INPUT_CTRL_PMUL;
+
+	ctrl |= CU_INPUT_CTRL_ALPHA(cin->layer_alpha);
+
+	malidp_write32(id_reg, BLK_INPUT_ID0, input_hw_id);
+
+	malidp_write32(cfg_reg, CU_INPUT0_SIZE,
+		       HV_SIZE(cin->hsize, cin->vsize));
+	malidp_write32(cfg_reg, CU_INPUT0_OFFSET,
+		       HV_OFFSET(cin->hoffset, cin->voffset));
+	malidp_write32(cfg_reg, CU_INPUT0_CONTROL, ctrl);
+}
+
+static void d71_compiz_update(struct komeda_component *c,
+			      struct komeda_component_state *state)
+{
+	struct komeda_compiz_state *st = to_compiz_st(state);
+	u32 __iomem *reg = c->reg;
+	u32 __iomem *id_reg, *cfg_reg;
+	u32 index, input_hw_id;
+
+	for_each_changed_input(state, index) {
+		id_reg = reg + index;
+		cfg_reg = reg + index * CU_PER_INPUT_REGS;
+		input_hw_id = to_d71_input_id(&state->inputs[index]);
+		if (state->active_inputs & BIT(index)) {
+			compiz_enable_input(id_reg, cfg_reg,
+					    input_hw_id, &st->cins[index]);
+		} else {
+			malidp_write32(id_reg, BLK_INPUT_ID0, 0);
+			malidp_write32(cfg_reg, CU_INPUT0_CONTROL, 0);
+		}
+	}
+
+	malidp_write32(reg, BLK_SIZE, HV_SIZE(st->hsize, st->vsize));
+}
+
+static void d71_compiz_dump(struct komeda_component *c, struct seq_file *sf)
+{
+	u32 v[8], i;
+
+	dump_block_header(sf, c->reg);
+
+	get_values_from_reg(c->reg, 0x80, 5, v);
+	for (i = 0; i < 5; i++)
+		seq_printf(sf, "CU_INPUT_ID%u:\t\t0x%X\n", i, v[i]);
+
+	get_values_from_reg(c->reg, 0xA0, 5, v);
+	seq_printf(sf, "CU_IRQ_RAW_STATUS:\t0x%X\n", v[0]);
+	seq_printf(sf, "CU_IRQ_CLEAR:\t\t0x%X\n", v[1]);
+	seq_printf(sf, "CU_IRQ_MASK:\t\t0x%X\n", v[2]);
+	seq_printf(sf, "CU_IRQ_STATUS:\t\t0x%X\n", v[3]);
+	seq_printf(sf, "CU_STATUS:\t\t0x%X\n", v[4]);
+
+	get_values_from_reg(c->reg, 0xD0, 2, v);
+	seq_printf(sf, "CU_CONTROL:\t\t0x%X\n", v[0]);
+	seq_printf(sf, "CU_SIZE:\t\t0x%X\n", v[1]);
+
+	get_values_from_reg(c->reg, 0xDC, 1, v);
+	seq_printf(sf, "CU_BG_COLOR:\t\t0x%X\n", v[0]);
+
+	for (i = 0, v[4] = 0xE0; i < 5; i++, v[4] += 0x10) {
+		get_values_from_reg(c->reg, v[4], 3, v);
+		seq_printf(sf, "CU_INPUT%u_SIZE:\t\t0x%X\n", i, v[0]);
+		seq_printf(sf, "CU_INPUT%u_OFFSET:\t0x%X\n", i, v[1]);
+		seq_printf(sf, "CU_INPUT%u_CONTROL:\t0x%X\n", i, v[2]);
+	}
+
+	get_values_from_reg(c->reg, 0x130, 2, v);
+	seq_printf(sf, "CU_USER_LOW:\t\t0x%X\n", v[0]);
+	seq_printf(sf, "CU_USER_HIGH:\t\t0x%X\n", v[1]);
+}
+
+struct komeda_component_funcs d71_compiz_funcs = {
+	.update		= d71_compiz_update,
+	.disable	= d71_component_disable,
+	.dump_register	= d71_compiz_dump,
+};
+
+static int d71_compiz_init(struct d71_dev *d71,
+			   struct block_header *blk, u32 __iomem *reg)
+{
+	struct komeda_component *c;
+	struct komeda_compiz *compiz;
+	u32 pipe_id, comp_id;
+
+	get_resources_id(blk->block_info, &pipe_id, &comp_id);
+
+	c = komeda_component_add(&d71->pipes[pipe_id]->base, sizeof(*compiz),
+				 comp_id,
+				 BLOCK_INFO_INPUT_ID(blk->block_info),
+				 &d71_compiz_funcs,
+				 CU_NUM_INPUT_IDS, get_valid_inputs(blk),
+				 CU_NUM_OUTPUT_IDS, reg,
+				 "CU%d", pipe_id);
+	if (IS_ERR(c))
+		return PTR_ERR(c);
+
+	compiz = to_compiz(c);
+
+	set_range(&compiz->hsize, D71_MIN_LINE_SIZE, d71->max_line_size);
+	set_range(&compiz->vsize, D71_MIN_VERTICAL_SIZE, d71->max_vsize);
+
+	return 0;
+}
+
+static void d71_improc_update(struct komeda_component *c,
+			      struct komeda_component_state *state)
+{
+	struct komeda_improc_state *st = to_improc_st(state);
+	u32 __iomem *reg = c->reg;
+	u32 index, input_hw_id;
+
+	for_each_changed_input(state, index) {
+		input_hw_id = state->active_inputs & BIT(index) ?
+			      to_d71_input_id(&state->inputs[index]) : 0;
+		malidp_write32(reg, BLK_INPUT_ID0 + index * 4, input_hw_id);
+	}
+
+	malidp_write32(reg, BLK_SIZE, HV_SIZE(st->hsize, st->vsize));
+}
+
+static void d71_improc_dump(struct komeda_component *c, struct seq_file *sf)
+{
+	u32 v[12], i;
+
+	dump_block_header(sf, c->reg);
+
+	get_values_from_reg(c->reg, 0x80, 2, v);
+	seq_printf(sf, "IPS_INPUT_ID0:\t\t0x%X\n", v[0]);
+	seq_printf(sf, "IPS_INPUT_ID1:\t\t0x%X\n", v[1]);
+
+	get_values_from_reg(c->reg, 0xC0, 1, v);
+	seq_printf(sf, "IPS_INFO:\t\t0x%X\n", v[0]);
+
+	get_values_from_reg(c->reg, 0xD0, 3, v);
+	seq_printf(sf, "IPS_CONTROL:\t\t0x%X\n", v[0]);
+	seq_printf(sf, "IPS_SIZE:\t\t0x%X\n", v[1]);
+	seq_printf(sf, "IPS_DEPTH:\t\t0x%X\n", v[2]);
+
+	get_values_from_reg(c->reg, 0x130, 12, v);
+	for (i = 0; i < 12; i++)
+		seq_printf(sf, "IPS_RGB_RGB_COEFF%u:\t0x%X\n", i, v[i]);
+
+	get_values_from_reg(c->reg, 0x170, 12, v);
+	for (i = 0; i < 12; i++)
+		seq_printf(sf, "IPS_RGB_YUV_COEFF%u:\t0x%X\n", i, v[i]);
+}
+
+struct komeda_component_funcs d71_improc_funcs = {
+	.update		= d71_improc_update,
+	.disable	= d71_component_disable,
+	.dump_register	= d71_improc_dump,
+};
+
+static int d71_improc_init(struct d71_dev *d71,
+			   struct block_header *blk, u32 __iomem *reg)
+{
+	struct komeda_component *c;
+	struct komeda_improc *improc;
+	u32 pipe_id, comp_id, value;
+
+	get_resources_id(blk->block_info, &pipe_id, &comp_id);
+
+	c = komeda_component_add(&d71->pipes[pipe_id]->base, sizeof(*improc),
+				 comp_id,
+				 BLOCK_INFO_INPUT_ID(blk->block_info),
+				 &d71_improc_funcs, IPS_NUM_INPUT_IDS,
+				 get_valid_inputs(blk),
+				 IPS_NUM_OUTPUT_IDS, reg, "DOU%d_IPS", pipe_id);
+	if (IS_ERR(c)) {
+		DRM_ERROR("Failed to add improc component\n");
+		return PTR_ERR(c);
+	}
+
+	improc = to_improc(c);
+	improc->supported_color_depths = BIT(8) | BIT(10);
+	improc->supported_color_formats = DRM_COLOR_FORMAT_RGB444 |
+					  DRM_COLOR_FORMAT_YCRCB444 |
+					  DRM_COLOR_FORMAT_YCRCB422;
+	value = malidp_read32(reg, BLK_INFO);
+	if (value & IPS_INFO_CHD420)
+		improc->supported_color_formats |= DRM_COLOR_FORMAT_YCRCB420;
+
+	improc->supports_csc = true;
+	improc->supports_gamma = true;
+
+	return 0;
+}
+
+static void d71_timing_ctrlr_disable(struct komeda_component *c)
+{
+	malidp_write32_mask(c->reg, BLK_CONTROL, BS_CTRL_EN, 0);
+}
+
+static void d71_timing_ctrlr_update(struct komeda_component *c,
+				    struct komeda_component_state *state)
+{
+	struct drm_crtc_state *crtc_st = state->crtc->state;
+	u32 __iomem *reg = c->reg;
+	struct videomode vm;
+	u32 value;
+
+	drm_display_mode_to_videomode(&crtc_st->adjusted_mode, &vm);
+
+	malidp_write32(reg, BS_ACTIVESIZE, HV_SIZE(vm.hactive, vm.vactive));
+	malidp_write32(reg, BS_HINTERVALS, BS_H_INTVALS(vm.hfront_porch,
+							vm.hback_porch));
+	malidp_write32(reg, BS_VINTERVALS, BS_V_INTVALS(vm.vfront_porch,
+							vm.vback_porch));
+
+	value = BS_SYNC_VSW(vm.vsync_len) | BS_SYNC_HSW(vm.hsync_len);
+	value |= vm.flags & DISPLAY_FLAGS_VSYNC_HIGH ? BS_SYNC_VSP : 0;
+	value |= vm.flags & DISPLAY_FLAGS_HSYNC_HIGH ? BS_SYNC_HSP : 0;
+	malidp_write32(reg, BS_SYNC, value);
+
+	malidp_write32(reg, BS_PROG_LINE, D71_DEFAULT_PREPRETCH_LINE - 1);
+	malidp_write32(reg, BS_PREFETCH_LINE, D71_DEFAULT_PREPRETCH_LINE);
+
+	/* configure bs control register */
+	value = BS_CTRL_EN | BS_CTRL_VM;
+
+	malidp_write32(reg, BLK_CONTROL, value);
+}
+
+void d71_timing_ctrlr_dump(struct komeda_component *c, struct seq_file *sf)
+{
+	u32 v[8], i;
+
+	dump_block_header(sf, c->reg);
+
+	get_values_from_reg(c->reg, 0xC0, 1, v);
+	seq_printf(sf, "BS_INFO:\t\t0x%X\n", v[0]);
+
+	get_values_from_reg(c->reg, 0xD0, 8, v);
+	seq_printf(sf, "BS_CONTROL:\t\t0x%X\n", v[0]);
+	seq_printf(sf, "BS_PROG_LINE:\t\t0x%X\n", v[1]);
+	seq_printf(sf, "BS_PREFETCH_LINE:\t0x%X\n", v[2]);
+	seq_printf(sf, "BS_BG_COLOR:\t\t0x%X\n", v[3]);
+	seq_printf(sf, "BS_ACTIVESIZE:\t\t0x%X\n", v[4]);
+	seq_printf(sf, "BS_HINTERVALS:\t\t0x%X\n", v[5]);
+	seq_printf(sf, "BS_VINTERVALS:\t\t0x%X\n", v[6]);
+	seq_printf(sf, "BS_SYNC:\t\t0x%X\n", v[7]);
+
+	get_values_from_reg(c->reg, 0x100, 3, v);
+	seq_printf(sf, "BS_DRIFT_TO:\t\t0x%X\n", v[0]);
+	seq_printf(sf, "BS_FRAME_TO:\t\t0x%X\n", v[1]);
+	seq_printf(sf, "BS_TE_TO:\t\t0x%X\n", v[2]);
+
+	get_values_from_reg(c->reg, 0x110, 3, v);
+	for (i = 0; i < 3; i++)
+		seq_printf(sf, "BS_T%u_INTERVAL:\t\t0x%X\n", i, v[i]);
+
+	get_values_from_reg(c->reg, 0x120, 5, v);
+	for (i = 0; i < 2; i++) {
+		seq_printf(sf, "BS_CRC%u_LOW:\t\t0x%X\n", i, v[i << 1]);
+		seq_printf(sf, "BS_CRC%u_HIGH:\t\t0x%X\n", i, v[(i << 1) + 1]);
+	}
+	seq_printf(sf, "BS_USER:\t\t0x%X\n", v[4]);
+}
+
+struct komeda_component_funcs d71_timing_ctrlr_funcs = {
+	.update		= d71_timing_ctrlr_update,
+	.disable	= d71_timing_ctrlr_disable,
+	.dump_register	= d71_timing_ctrlr_dump,
+};
+
+static int d71_timing_ctrlr_init(struct d71_dev *d71,
+				 struct block_header *blk, u32 __iomem *reg)
+{
+	struct komeda_component *c;
+	struct komeda_timing_ctrlr *ctrlr;
+	u32 pipe_id, comp_id;
+
+	get_resources_id(blk->block_info, &pipe_id, &comp_id);
+
+	c = komeda_component_add(&d71->pipes[pipe_id]->base, sizeof(*ctrlr),
+				 KOMEDA_COMPONENT_TIMING_CTRLR,
+				 BLOCK_INFO_INPUT_ID(blk->block_info),
+				 &d71_timing_ctrlr_funcs,
+				 1, BIT(KOMEDA_COMPONENT_IPS0 + pipe_id),
+				 BS_NUM_OUTPUT_IDS, reg, "DOU%d_BS", pipe_id);
+	if (IS_ERR(c)) {
+		DRM_ERROR("Failed to add display_ctrl component\n");
+		return PTR_ERR(c);
+	}
+
+	ctrlr = to_ctrlr(c);
+
+	ctrlr->supports_dual_link = true;
+
+	return 0;
+}
+
+int d71_probe_block(struct d71_dev *d71,
+		    struct block_header *blk, u32 __iomem *reg)
+{
+	struct d71_pipeline *pipe;
+	int blk_id = BLOCK_INFO_BLK_ID(blk->block_info);
+
+	int err = 0;
+
+	switch (BLOCK_INFO_BLK_TYPE(blk->block_info)) {
+	case D71_BLK_TYPE_GCU:
+		break;
+
+	case D71_BLK_TYPE_LPU:
+		pipe = d71->pipes[blk_id];
+		pipe->lpu_addr = reg;
+		break;
+
+	case D71_BLK_TYPE_LPU_LAYER:
+		err = d71_layer_init(d71, blk, reg);
+		break;
+
+	case D71_BLK_TYPE_LPU_WB_LAYER:
+		err = d71_wb_layer_init(d71, blk, reg);
+		break;
+
+	case D71_BLK_TYPE_CU:
+		pipe = d71->pipes[blk_id];
+		pipe->cu_addr = reg;
+		err = d71_compiz_init(d71, blk, reg);
+		break;
+
+	case D71_BLK_TYPE_CU_SPLITTER:
+	case D71_BLK_TYPE_CU_SCALER:
+	case D71_BLK_TYPE_CU_MERGER:
+		break;
+
+	case D71_BLK_TYPE_DOU:
+		pipe = d71->pipes[blk_id];
+		pipe->dou_addr = reg;
+		break;
+
+	case D71_BLK_TYPE_DOU_IPS:
+		err = d71_improc_init(d71, blk, reg);
+		break;
+
+	case D71_BLK_TYPE_DOU_FT_COEFF:
+		pipe = d71->pipes[blk_id];
+		pipe->dou_ft_coeff_addr = reg;
+		break;
+
+	case D71_BLK_TYPE_DOU_BS:
+		err = d71_timing_ctrlr_init(d71, blk, reg);
+		break;
+
+	case D71_BLK_TYPE_GLB_LT_COEFF:
+		break;
+
+	case D71_BLK_TYPE_GLB_SCL_COEFF:
+		d71->glb_scl_coeff_addr[blk_id] = reg;
+		break;
+
+	default:
+		DRM_ERROR("Unknown block (block_info: 0x%x) is found\n",
+			  blk->block_info);
+		err = -EINVAL;
+		break;
+	}
+
+	return err;
+}
diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c
index edbf9daa1545..72631d673f85 100644
--- a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c
+++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c
@@ -4,13 +4,375 @@
  * Author: James.Qian.Wang <james.qian.wang@arm.com>
  *
  */
+
+#include <drm/drm_print.h>
+#include "d71_dev.h"
 #include "malidp_io.h"
-#include "komeda_dev.h"
+
+static u64 get_lpu_event(struct d71_pipeline *d71_pipeline)
+{
+	u32 __iomem *reg = d71_pipeline->lpu_addr;
+	u32 status, raw_status;
+	u64 evts = 0ULL;
+
+	raw_status = malidp_read32(reg, BLK_IRQ_RAW_STATUS);
+	if (raw_status & LPU_IRQ_IBSY)
+		evts |= KOMEDA_EVENT_IBSY;
+	if (raw_status & LPU_IRQ_EOW)
+		evts |= KOMEDA_EVENT_EOW;
+
+	if (raw_status & (LPU_IRQ_ERR | LPU_IRQ_IBSY)) {
+		u32 restore = 0, tbu_status;
+		/* Check error of LPU status */
+		status = malidp_read32(reg, BLK_STATUS);
+		if (status & LPU_STATUS_AXIE) {
+			restore |= LPU_STATUS_AXIE;
+			evts |= KOMEDA_ERR_AXIE;
+		}
+		if (status & LPU_STATUS_ACE0) {
+			restore |= LPU_STATUS_ACE0;
+			evts |= KOMEDA_ERR_ACE0;
+		}
+		if (status & LPU_STATUS_ACE1) {
+			restore |= LPU_STATUS_ACE1;
+			evts |= KOMEDA_ERR_ACE1;
+		}
+		if (status & LPU_STATUS_ACE2) {
+			restore |= LPU_STATUS_ACE2;
+			evts |= KOMEDA_ERR_ACE2;
+		}
+		if (status & LPU_STATUS_ACE3) {
+			restore |= LPU_STATUS_ACE3;
+			evts |= KOMEDA_ERR_ACE3;
+		}
+		if (restore != 0)
+			malidp_write32_mask(reg, BLK_STATUS, restore, 0);
+
+		restore = 0;
+		/* Check errors of TBU status */
+		tbu_status = malidp_read32(reg, LPU_TBU_STATUS);
+		if (tbu_status & LPU_TBU_STATUS_TCF) {
+			restore |= LPU_TBU_STATUS_TCF;
+			evts |= KOMEDA_ERR_TCF;
+		}
+		if (tbu_status & LPU_TBU_STATUS_TTNG) {
+			restore |= LPU_TBU_STATUS_TTNG;
+			evts |= KOMEDA_ERR_TTNG;
+		}
+		if (tbu_status & LPU_TBU_STATUS_TITR) {
+			restore |= LPU_TBU_STATUS_TITR;
+			evts |= KOMEDA_ERR_TITR;
+		}
+		if (tbu_status & LPU_TBU_STATUS_TEMR) {
+			restore |= LPU_TBU_STATUS_TEMR;
+			evts |= KOMEDA_ERR_TEMR;
+		}
+		if (tbu_status & LPU_TBU_STATUS_TTF) {
+			restore |= LPU_TBU_STATUS_TTF;
+			evts |= KOMEDA_ERR_TTF;
+		}
+		if (restore != 0)
+			malidp_write32_mask(reg, LPU_TBU_STATUS, restore, 0);
+	}
+
+	malidp_write32(reg, BLK_IRQ_CLEAR, raw_status);
+	return evts;
+}
+
+static u64 get_cu_event(struct d71_pipeline *d71_pipeline)
+{
+	u32 __iomem *reg = d71_pipeline->cu_addr;
+	u32 status, raw_status;
+	u64 evts = 0ULL;
+
+	raw_status = malidp_read32(reg, BLK_IRQ_RAW_STATUS);
+	if (raw_status & CU_IRQ_OVR)
+		evts |= KOMEDA_EVENT_OVR;
+
+	if (raw_status & (CU_IRQ_ERR | CU_IRQ_OVR)) {
+		status = malidp_read32(reg, BLK_STATUS) & 0x7FFFFFFF;
+		if (status & CU_STATUS_CPE)
+			evts |= KOMEDA_ERR_CPE;
+		if (status & CU_STATUS_ZME)
+			evts |= KOMEDA_ERR_ZME;
+		if (status & CU_STATUS_CFGE)
+			evts |= KOMEDA_ERR_CFGE;
+		if (status)
+			malidp_write32_mask(reg, BLK_STATUS, status, 0);
+	}
+
+	malidp_write32(reg, BLK_IRQ_CLEAR, raw_status);
+
+	return evts;
+}
+
+static u64 get_dou_event(struct d71_pipeline *d71_pipeline)
+{
+	u32 __iomem *reg = d71_pipeline->dou_addr;
+	u32 status, raw_status;
+	u64 evts = 0ULL;
+
+	raw_status = malidp_read32(reg, BLK_IRQ_RAW_STATUS);
+	if (raw_status & DOU_IRQ_PL0)
+		evts |= KOMEDA_EVENT_VSYNC;
+	if (raw_status & DOU_IRQ_UND)
+		evts |= KOMEDA_EVENT_URUN;
+
+	if (raw_status & (DOU_IRQ_ERR | DOU_IRQ_UND)) {
+		u32 restore  = 0;
+
+		status = malidp_read32(reg, BLK_STATUS);
+		if (status & DOU_STATUS_DRIFTTO) {
+			restore |= DOU_STATUS_DRIFTTO;
+			evts |= KOMEDA_ERR_DRIFTTO;
+		}
+		if (status & DOU_STATUS_FRAMETO) {
+			restore |= DOU_STATUS_FRAMETO;
+			evts |= KOMEDA_ERR_FRAMETO;
+		}
+		if (status & DOU_STATUS_TETO) {
+			restore |= DOU_STATUS_TETO;
+			evts |= KOMEDA_ERR_TETO;
+		}
+		if (status & DOU_STATUS_CSCE) {
+			restore |= DOU_STATUS_CSCE;
+			evts |= KOMEDA_ERR_CSCE;
+		}
+
+		if (restore != 0)
+			malidp_write32_mask(reg, BLK_STATUS, restore, 0);
+	}
+
+	malidp_write32(reg, BLK_IRQ_CLEAR, raw_status);
+	return evts;
+}
+
+static u64 get_pipeline_event(struct d71_pipeline *d71_pipeline, u32 gcu_status)
+{
+	u32 evts = 0ULL;
+
+	if (gcu_status & (GLB_IRQ_STATUS_LPU0 | GLB_IRQ_STATUS_LPU1))
+		evts |= get_lpu_event(d71_pipeline);
+
+	if (gcu_status & (GLB_IRQ_STATUS_CU0 | GLB_IRQ_STATUS_CU1))
+		evts |= get_cu_event(d71_pipeline);
+
+	if (gcu_status & (GLB_IRQ_STATUS_DOU0 | GLB_IRQ_STATUS_DOU1))
+		evts |= get_dou_event(d71_pipeline);
+
+	return evts;
+}
+
+static irqreturn_t
+d71_irq_handler(struct komeda_dev *mdev, struct komeda_events *evts)
+{
+	struct d71_dev *d71 = mdev->chip_data;
+	u32 status, gcu_status, raw_status;
+
+	gcu_status = malidp_read32(d71->gcu_addr, GLB_IRQ_STATUS);
+
+	if (gcu_status & GLB_IRQ_STATUS_GCU) {
+		raw_status = malidp_read32(d71->gcu_addr, BLK_IRQ_RAW_STATUS);
+		if (raw_status & GCU_IRQ_CVAL0)
+			evts->pipes[0] |= KOMEDA_EVENT_FLIP;
+		if (raw_status & GCU_IRQ_CVAL1)
+			evts->pipes[1] |= KOMEDA_EVENT_FLIP;
+		if (raw_status & GCU_IRQ_ERR) {
+			status = malidp_read32(d71->gcu_addr, BLK_STATUS);
+			if (status & GCU_STATUS_MERR) {
+				evts->global |= KOMEDA_ERR_MERR;
+				malidp_write32_mask(d71->gcu_addr, BLK_STATUS,
+						    GCU_STATUS_MERR, 0);
+			}
+		}
+
+		malidp_write32(d71->gcu_addr, BLK_IRQ_CLEAR, raw_status);
+	}
+
+	if (gcu_status & GLB_IRQ_STATUS_PIPE0)
+		evts->pipes[0] |= get_pipeline_event(d71->pipes[0], gcu_status);
+
+	if (gcu_status & GLB_IRQ_STATUS_PIPE1)
+		evts->pipes[1] |= get_pipeline_event(d71->pipes[1], gcu_status);
+
+	return gcu_status ? IRQ_HANDLED : IRQ_NONE;
+}
+
+#define ENABLED_GCU_IRQS	(GCU_IRQ_CVAL0 | GCU_IRQ_CVAL1 | \
+				 GCU_IRQ_MODE | GCU_IRQ_ERR)
+#define ENABLED_LPU_IRQS	(LPU_IRQ_IBSY | LPU_IRQ_ERR | LPU_IRQ_EOW)
+#define ENABLED_CU_IRQS		(CU_IRQ_OVR | CU_IRQ_ERR)
+#define ENABLED_DOU_IRQS	(DOU_IRQ_UND | DOU_IRQ_ERR)
+
+static int d71_enable_irq(struct komeda_dev *mdev)
+{
+	struct d71_dev *d71 = mdev->chip_data;
+	struct d71_pipeline *pipe;
+	u32 i;
+
+	malidp_write32_mask(d71->gcu_addr, BLK_IRQ_MASK,
+			    ENABLED_GCU_IRQS, ENABLED_GCU_IRQS);
+	for (i = 0; i < d71->num_pipelines; i++) {
+		pipe = d71->pipes[i];
+		malidp_write32_mask(pipe->cu_addr,  BLK_IRQ_MASK,
+				    ENABLED_CU_IRQS, ENABLED_CU_IRQS);
+		malidp_write32_mask(pipe->lpu_addr, BLK_IRQ_MASK,
+				    ENABLED_LPU_IRQS, ENABLED_LPU_IRQS);
+		malidp_write32_mask(pipe->dou_addr, BLK_IRQ_MASK,
+				    ENABLED_DOU_IRQS, ENABLED_DOU_IRQS);
+	}
+	return 0;
+}
+
+static int d71_disable_irq(struct komeda_dev *mdev)
+{
+	struct d71_dev *d71 = mdev->chip_data;
+	struct d71_pipeline *pipe;
+	u32 i;
+
+	malidp_write32_mask(d71->gcu_addr, BLK_IRQ_MASK, ENABLED_GCU_IRQS, 0);
+	for (i = 0; i < d71->num_pipelines; i++) {
+		pipe = d71->pipes[i];
+		malidp_write32_mask(pipe->cu_addr,  BLK_IRQ_MASK,
+				    ENABLED_CU_IRQS, 0);
+		malidp_write32_mask(pipe->lpu_addr, BLK_IRQ_MASK,
+				    ENABLED_LPU_IRQS, 0);
+		malidp_write32_mask(pipe->dou_addr, BLK_IRQ_MASK,
+				    ENABLED_DOU_IRQS, 0);
+	}
+	return 0;
+}
+
+static int d71_reset(struct d71_dev *d71)
+{
+	u32 __iomem *gcu = d71->gcu_addr;
+	int ret;
+
+	malidp_write32_mask(gcu, BLK_CONTROL,
+			    GCU_CONTROL_SRST, GCU_CONTROL_SRST);
+
+	ret = dp_wait_cond(!(malidp_read32(gcu, BLK_CONTROL) & GCU_CONTROL_SRST),
+			   100, 1000, 10000);
+
+	return ret > 0 ? 0 : -ETIMEDOUT;
+}
+
+void d71_read_block_header(u32 __iomem *reg, struct block_header *blk)
+{
+	int i;
+
+	blk->block_info = malidp_read32(reg, BLK_BLOCK_INFO);
+	if (BLOCK_INFO_BLK_TYPE(blk->block_info) == D71_BLK_TYPE_RESERVED)
+		return;
+
+	blk->pipeline_info = malidp_read32(reg, BLK_PIPELINE_INFO);
+
+	/* get valid input and output ids */
+	for (i = 0; i < PIPELINE_INFO_N_VALID_INPUTS(blk->pipeline_info); i++)
+		blk->input_ids[i] = malidp_read32(reg + i, BLK_VALID_INPUT_ID0);
+	for (i = 0; i < PIPELINE_INFO_N_OUTPUTS(blk->pipeline_info); i++)
+		blk->output_ids[i] = malidp_read32(reg + i, BLK_OUTPUT_ID0);
+}
+
+static void d71_cleanup(struct komeda_dev *mdev)
+{
+	struct d71_dev *d71 = mdev->chip_data;
+
+	if (!d71)
+		return;
+
+	devm_kfree(mdev->dev, d71);
+	mdev->chip_data = NULL;
+}
 
 static int d71_enum_resources(struct komeda_dev *mdev)
 {
-	/* TODO add enum resources */
-	return -1;
+	struct d71_dev *d71;
+	struct komeda_pipeline *pipe;
+	struct block_header blk;
+	u32 __iomem *blk_base;
+	u32 i, value, offset;
+	int err;
+
+	d71 = devm_kzalloc(mdev->dev, sizeof(*d71), GFP_KERNEL);
+	if (!d71)
+		return -ENOMEM;
+
+	mdev->chip_data = d71;
+	d71->mdev = mdev;
+	d71->gcu_addr = mdev->reg_base;
+	d71->periph_addr = mdev->reg_base + (D71_BLOCK_OFFSET_PERIPH >> 2);
+
+	err = d71_reset(d71);
+	if (err) {
+		DRM_ERROR("Fail to reset d71 device.\n");
+		goto err_cleanup;
+	}
+
+	/* probe GCU */
+	value = malidp_read32(d71->gcu_addr, GLB_CORE_INFO);
+	d71->num_blocks = value & 0xFF;
+	d71->num_pipelines = (value >> 8) & 0x7;
+
+	if (d71->num_pipelines > D71_MAX_PIPELINE) {
+		DRM_ERROR("d71 supports %d pipelines, but got: %d.\n",
+			  D71_MAX_PIPELINE, d71->num_pipelines);
+		err = -EINVAL;
+		goto err_cleanup;
+	}
+
+	/* probe PERIPH */
+	value = malidp_read32(d71->periph_addr, BLK_BLOCK_INFO);
+	if (BLOCK_INFO_BLK_TYPE(value) != D71_BLK_TYPE_PERIPH) {
+		DRM_ERROR("access blk periph but got blk: %d.\n",
+			  BLOCK_INFO_BLK_TYPE(value));
+		err = -EINVAL;
+		goto err_cleanup;
+	}
+
+	value = malidp_read32(d71->periph_addr, PERIPH_CONFIGURATION_ID);
+
+	d71->max_line_size	= value & PERIPH_MAX_LINE_SIZE ? 4096 : 2048;
+	d71->max_vsize		= 4096;
+	d71->num_rich_layers	= value & PERIPH_NUM_RICH_LAYERS ? 2 : 1;
+	d71->supports_dual_link	= value & PERIPH_SPLIT_EN ? true : false;
+	d71->integrates_tbu	= value & PERIPH_TBU_EN ? true : false;
+
+	for (i = 0; i < d71->num_pipelines; i++) {
+		pipe = komeda_pipeline_add(mdev, sizeof(struct d71_pipeline),
+					   NULL);
+		if (IS_ERR(pipe)) {
+			err = PTR_ERR(pipe);
+			goto err_cleanup;
+		}
+		d71->pipes[i] = to_d71_pipeline(pipe);
+	}
+
+	/* loop the register blks and probe */
+	i = 2; /* exclude GCU and PERIPH */
+	offset = D71_BLOCK_SIZE; /* skip GCU */
+	while (i < d71->num_blocks) {
+		blk_base = mdev->reg_base + (offset >> 2);
+
+		d71_read_block_header(blk_base, &blk);
+		if (BLOCK_INFO_BLK_TYPE(blk.block_info) != D71_BLK_TYPE_RESERVED) {
+			err = d71_probe_block(d71, &blk, blk_base);
+			if (err)
+				goto err_cleanup;
+			i++;
+		}
+
+		offset += D71_BLOCK_SIZE;
+	}
+
+	DRM_DEBUG("total %d (out of %d) blocks are found.\n",
+		  i, d71->num_blocks);
+
+	return 0;
+
+err_cleanup:
+	d71_cleanup(mdev);
+	return err;
 }
 
 #define __HW_ID(__group, __format) \
@@ -93,13 +455,12 @@ static void d71_init_fmt_tbl(struct komeda_dev *mdev)
 static struct komeda_dev_funcs d71_chip_funcs = {
 	.init_format_table = d71_init_fmt_tbl,
 	.enum_resources	= d71_enum_resources,
-	.cleanup	= NULL,
+	.cleanup	= d71_cleanup,
+	.irq_handler	= d71_irq_handler,
+	.enable_irq	= d71_enable_irq,
+	.disable_irq	= d71_disable_irq,
 };
 
-#define GLB_ARCH_ID		0x000
-#define GLB_CORE_ID		0x004
-#define GLB_CORE_INFO		0x008
-
 struct komeda_dev_funcs *
 d71_identify(u32 __iomem *reg_base, struct komeda_chip_info *chip)
 {
diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.h b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.h
new file mode 100644
index 000000000000..7465c57d9774
--- /dev/null
+++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.h
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * (C) COPYRIGHT 2018 ARM Limited. All rights reserved.
+ * Author: James.Qian.Wang <james.qian.wang@arm.com>
+ *
+ */
+#ifndef _D71_DEV_H_
+#define _D71_DEV_H_
+
+#include "komeda_dev.h"
+#include "komeda_pipeline.h"
+#include "d71_regs.h"
+
+struct d71_pipeline {
+	struct komeda_pipeline base;
+
+	/* d71 private pipeline blocks */
+	u32 __iomem	*lpu_addr;
+	u32 __iomem	*cu_addr;
+	u32 __iomem	*dou_addr;
+	u32 __iomem	*dou_ft_coeff_addr; /* forward transform coeffs table */
+};
+
+struct d71_dev {
+	struct komeda_dev *mdev;
+
+	int	num_blocks;
+	int	num_pipelines;
+	int	num_rich_layers;
+	u32	max_line_size;
+	u32	max_vsize;
+	u32	supports_dual_link : 1;
+	u32	integrates_tbu : 1;
+
+	/* global register blocks */
+	u32 __iomem	*gcu_addr;
+	/* scaling coeffs table */
+	u32 __iomem	*glb_scl_coeff_addr[D71_MAX_GLB_SCL_COEFF];
+	u32 __iomem	*periph_addr;
+
+	struct d71_pipeline *pipes[D71_MAX_PIPELINE];
+};
+
+#define to_d71_pipeline(x)	container_of(x, struct d71_pipeline, base)
+
+int d71_probe_block(struct d71_dev *d71,
+		    struct block_header *blk, u32 __iomem *reg);
+void d71_read_block_header(u32 __iomem *reg, struct block_header *blk);
+
+#endif /* !_D71_DEV_H_ */
diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_regs.h b/drivers/gpu/drm/arm/display/komeda/d71/d71_regs.h
new file mode 100644
index 000000000000..2d5e6d00b42c
--- /dev/null
+++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_regs.h
@@ -0,0 +1,530 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * (C) COPYRIGHT 2018 ARM Limited. All rights reserved.
+ * Author: James.Qian.Wang <james.qian.wang@arm.com>
+ *
+ */
+#ifndef _D71_REG_H_
+#define _D71_REG_H_
+
+/* Common block registers offset */
+#define BLK_BLOCK_INFO		0x000
+#define BLK_PIPELINE_INFO	0x004
+#define BLK_VALID_INPUT_ID0	0x020
+#define BLK_OUTPUT_ID0		0x060
+#define BLK_INPUT_ID0		0x080
+#define BLK_IRQ_RAW_STATUS	0x0A0
+#define BLK_IRQ_CLEAR		0x0A4
+#define BLK_IRQ_MASK		0x0A8
+#define BLK_IRQ_STATUS		0x0AC
+#define BLK_STATUS		0x0B0
+#define BLK_INFO		0x0C0
+#define BLK_CONTROL		0x0D0
+#define BLK_SIZE		0x0D4
+#define BLK_IN_SIZE		0x0E0
+
+#define BLK_P0_PTR_LOW		0x100
+#define BLK_P0_PTR_HIGH		0x104
+#define BLK_P0_STRIDE		0x108
+#define BLK_P1_PTR_LOW		0x110
+#define BLK_P1_PTR_HIGH		0x114
+#define BLK_P1_STRIDE		0x118
+#define BLK_P2_PTR_LOW		0x120
+#define BLK_P2_PTR_HIGH		0x124
+
+#define BLOCK_INFO_N_SUBBLKS(x)	((x) & 0x000F)
+#define BLOCK_INFO_BLK_ID(x)	(((x) & 0x00F0) >> 4)
+#define BLOCK_INFO_BLK_TYPE(x)	(((x) & 0xFF00) >> 8)
+#define BLOCK_INFO_INPUT_ID(x)	((x) & 0xFFF0)
+#define BLOCK_INFO_TYPE_ID(x)	(((x) & 0x0FF0) >> 4)
+
+#define PIPELINE_INFO_N_OUTPUTS(x)	((x) & 0x000F)
+#define PIPELINE_INFO_N_VALID_INPUTS(x)	(((x) & 0x0F00) >> 8)
+
+/* Common block control register bits */
+#define BLK_CTRL_EN		BIT(0)
+/* Common size macro */
+#define HV_SIZE(h, v)		(((h) & 0x1FFF) + (((v) & 0x1FFF) << 16))
+#define HV_OFFSET(h, v)		(((h) & 0xFFF) + (((v) & 0xFFF) << 16))
+#define HV_CROP(h, v)		(((h) & 0xFFF) + (((v) & 0xFFF) << 16))
+
+/* AD_CONTROL register */
+#define AD_CONTROL		0x160
+
+/* AD_CONTROL register bits */
+#define AD_AEN			BIT(0)
+#define AD_YT			BIT(1)
+#define AD_BS			BIT(2)
+#define AD_WB			BIT(3)
+#define AD_TH			BIT(4)
+
+/* Global Control Unit */
+#define GLB_ARCH_ID		0x000
+#define GLB_CORE_ID		0x004
+#define GLB_CORE_INFO		0x008
+#define GLB_IRQ_STATUS		0x010
+
+#define GCU_CONFIG_VALID0	0x0D4
+#define GCU_CONFIG_VALID1	0x0D8
+
+/* GCU_CONTROL_BITS */
+#define GCU_CONTROL_MODE(x)	((x) & 0x7)
+#define GCU_CONTROL_SRST	BIT(16)
+
+/* GCU opmode */
+#define INACTIVE_MODE		0
+#define TBU_CONNECT_MODE	1
+#define TBU_DISCONNECT_MODE	2
+#define DO0_ACTIVE_MODE		3
+#define DO1_ACTIVE_MODE		4
+#define DO01_ACTIVE_MODE	5
+
+/* GLB_IRQ_STATUS bits */
+#define GLB_IRQ_STATUS_GCU	BIT(0)
+#define GLB_IRQ_STATUS_LPU0	BIT(8)
+#define GLB_IRQ_STATUS_LPU1	BIT(9)
+#define GLB_IRQ_STATUS_ATU0	BIT(10)
+#define GLB_IRQ_STATUS_ATU1	BIT(11)
+#define GLB_IRQ_STATUS_ATU2	BIT(12)
+#define GLB_IRQ_STATUS_ATU3	BIT(13)
+#define GLB_IRQ_STATUS_CU0	BIT(16)
+#define GLB_IRQ_STATUS_CU1	BIT(17)
+#define GLB_IRQ_STATUS_DOU0	BIT(24)
+#define GLB_IRQ_STATUS_DOU1	BIT(25)
+
+#define GLB_IRQ_STATUS_PIPE0	(GLB_IRQ_STATUS_LPU0 |\
+				 GLB_IRQ_STATUS_ATU0 |\
+				 GLB_IRQ_STATUS_ATU1 |\
+				 GLB_IRQ_STATUS_CU0 |\
+				 GLB_IRQ_STATUS_DOU0)
+
+#define GLB_IRQ_STATUS_PIPE1	(GLB_IRQ_STATUS_LPU1 |\
+				 GLB_IRQ_STATUS_ATU2 |\
+				 GLB_IRQ_STATUS_ATU3 |\
+				 GLB_IRQ_STATUS_CU1 |\
+				 GLB_IRQ_STATUS_DOU1)
+
+#define GLB_IRQ_STATUS_ATU	(GLB_IRQ_STATUS_ATU0 |\
+				 GLB_IRQ_STATUS_ATU1 |\
+				 GLB_IRQ_STATUS_ATU2 |\
+				 GLB_IRQ_STATUS_ATU3)
+
+/* GCU_IRQ_BITS */
+#define GCU_IRQ_CVAL0		BIT(0)
+#define GCU_IRQ_CVAL1		BIT(1)
+#define GCU_IRQ_MODE		BIT(4)
+#define GCU_IRQ_ERR		BIT(11)
+
+/* GCU_STATUS_BITS */
+#define GCU_STATUS_MODE(x)	((x) & 0x7)
+#define GCU_STATUS_MERR		BIT(4)
+#define GCU_STATUS_TCS0		BIT(8)
+#define GCU_STATUS_TCS1		BIT(9)
+#define GCU_STATUS_ACTIVE	BIT(31)
+
+/* GCU_CONFIG_VALIDx BITS */
+#define GCU_CONFIG_CVAL		BIT(0)
+
+/* PERIPHERAL registers */
+#define PERIPH_MAX_LINE_SIZE	BIT(0)
+#define PERIPH_NUM_RICH_LAYERS	BIT(4)
+#define PERIPH_SPLIT_EN		BIT(8)
+#define PERIPH_TBU_EN		BIT(12)
+#define PERIPH_AFBC_DMA_EN	BIT(16)
+#define PERIPH_CONFIGURATION_ID	0x1D4
+
+/* LPU register */
+#define LPU_TBU_STATUS		0x0B4
+#define LPU_RAXI_CONTROL	0x0D0
+#define LPU_WAXI_CONTROL	0x0D4
+#define LPU_TBU_CONTROL		0x0D8
+
+/* LPU_xAXI_CONTROL_BITS */
+#define TO_RAXI_AOUTSTDCAPB(x)	(x)
+#define TO_RAXI_BOUTSTDCAPB(x)	((x) << 8)
+#define TO_RAXI_BEN(x)		((x) << 15)
+#define TO_xAXI_BURSTLEN(x)	((x) << 16)
+#define TO_xAXI_AxQOS(x)	((x) << 24)
+#define TO_xAXI_ORD(x)		((x) << 31)
+#define TO_WAXI_OUTSTDCAPB(x)	(x)
+
+#define RAXI_AOUTSTDCAPB_MASK	0x7F
+#define RAXI_BOUTSTDCAPB_MASK	0x7F00
+#define RAXI_BEN_MASK		BIT(15)
+#define xAXI_BURSTLEN_MASK	0x3F0000
+#define xAXI_AxQOS_MASK		0xF000000
+#define xAXI_ORD_MASK		BIT(31)
+#define WAXI_OUTSTDCAPB_MASK	0x3F
+
+/* LPU_TBU_CONTROL BITS */
+#define TO_TBU_DOUTSTDCAPB(x)	(x)
+#define TBU_DOUTSTDCAPB_MASK	0x3F
+
+/* LPU_IRQ_BITS */
+#define LPU_IRQ_IBSY		BIT(10)
+#define LPU_IRQ_ERR		BIT(11)
+#define LPU_IRQ_EOW		BIT(12)
+#define LPU_IRQ_PL0		BIT(13)
+
+/* LPU_STATUS_BITS */
+#define LPU_STATUS_AXIED(x)	((x) & 0xF)
+#define LPU_STATUS_AXIE		BIT(4)
+#define LPU_STATUS_AXIRP	BIT(5)
+#define LPU_STATUS_AXIWP	BIT(6)
+#define LPU_STATUS_ACE0		BIT(16)
+#define LPU_STATUS_ACE1		BIT(17)
+#define LPU_STATUS_ACE2		BIT(18)
+#define LPU_STATUS_ACE3		BIT(19)
+#define LPU_STATUS_ACTIVE	BIT(31)
+
+#define AXIEID_MASK		0xF
+#define AXIE_MASK		LPU_STATUS_AXIE
+#define AXIRP_MASK		LPU_STATUS_AXIRP
+#define AXIWP_MASK		LPU_STATUS_AXIWP
+
+#define FROM_AXIEID(reg)	((reg) & AXIEID_MASK)
+#define TO_AXIE(x)		((x) << 4)
+#define FROM_AXIRP(reg)		(((reg) & AXIRP_MASK) >> 5)
+#define FROM_AXIWP(reg)		(((reg) & AXIWP_MASK) >> 6)
+
+/* LPU_TBU_STATUS_BITS */
+#define LPU_TBU_STATUS_TCF	BIT(1)
+#define LPU_TBU_STATUS_TTNG	BIT(2)
+#define LPU_TBU_STATUS_TITR	BIT(8)
+#define LPU_TBU_STATUS_TEMR	BIT(16)
+#define LPU_TBU_STATUS_TTF	BIT(31)
+
+/* LPU_TBU_CONTROL BITS */
+#define LPU_TBU_CTRL_TLBPEN	BIT(16)
+
+/* CROSSBAR CONTROL BITS */
+#define CBU_INPUT_CTRL_EN	BIT(0)
+#define CBU_NUM_INPUT_IDS	5
+#define CBU_NUM_OUTPUT_IDS	5
+
+/* CU register */
+#define CU_BG_COLOR		0x0DC
+#define CU_INPUT0_SIZE		0x0E0
+#define CU_INPUT0_OFFSET	0x0E4
+#define CU_INPUT0_CONTROL	0x0E8
+#define CU_INPUT1_SIZE		0x0F0
+#define CU_INPUT1_OFFSET	0x0F4
+#define CU_INPUT1_CONTROL	0x0F8
+#define CU_INPUT2_SIZE		0x100
+#define CU_INPUT2_OFFSET	0x104
+#define CU_INPUT2_CONTROL	0x108
+#define CU_INPUT3_SIZE		0x110
+#define CU_INPUT3_OFFSET	0x114
+#define CU_INPUT3_CONTROL	0x118
+#define CU_INPUT4_SIZE		0x120
+#define CU_INPUT4_OFFSET	0x124
+#define CU_INPUT4_CONTROL	0x128
+
+#define CU_PER_INPUT_REGS	4
+
+#define CU_NUM_INPUT_IDS	5
+#define CU_NUM_OUTPUT_IDS	1
+
+/* CU control register bits */
+#define CU_CTRL_COPROC		BIT(0)
+
+/* CU_IRQ_BITS */
+#define CU_IRQ_OVR		BIT(9)
+#define CU_IRQ_ERR		BIT(11)
+
+/* CU_STATUS_BITS */
+#define CU_STATUS_CPE		BIT(0)
+#define CU_STATUS_ZME		BIT(1)
+#define CU_STATUS_CFGE		BIT(2)
+#define CU_STATUS_ACTIVE	BIT(31)
+
+/* CU input control register bits */
+#define CU_INPUT_CTRL_EN	BIT(0)
+#define CU_INPUT_CTRL_PAD	BIT(1)
+#define CU_INPUT_CTRL_PMUL	BIT(2)
+#define CU_INPUT_CTRL_ALPHA(x)	(((x) & 0xFF) << 8)
+
+/* DOU register */
+
+/* DOU_IRQ_BITS */
+#define DOU_IRQ_UND		BIT(8)
+#define DOU_IRQ_ERR		BIT(11)
+#define DOU_IRQ_PL0		BIT(13)
+#define DOU_IRQ_PL1		BIT(14)
+
+/* DOU_STATUS_BITS */
+#define DOU_STATUS_DRIFTTO	BIT(0)
+#define DOU_STATUS_FRAMETO	BIT(1)
+#define DOU_STATUS_TETO		BIT(2)
+#define DOU_STATUS_CSCE		BIT(8)
+#define DOU_STATUS_ACTIVE	BIT(31)
+
+/* Layer registers */
+#define LAYER_INFO		0x0C0
+#define LAYER_R_CONTROL		0x0D4
+#define LAYER_FMT		0x0D8
+#define LAYER_LT_COEFFTAB	0x0DC
+#define LAYER_PALPHA		0x0E4
+
+#define LAYER_YUV_RGB_COEFF0	0x130
+
+#define LAYER_AD_H_CROP		0x164
+#define LAYER_AD_V_CROP		0x168
+
+#define LAYER_RGB_RGB_COEFF0	0x170
+
+/* L_CONTROL_BITS */
+#define L_EN			BIT(0)
+#define L_IT			BIT(4)
+#define L_R2R			BIT(5)
+#define L_FT			BIT(6)
+#define L_ROT(x)		(((x) & 3) << 8)
+#define L_HFLIP			BIT(10)
+#define L_VFLIP			BIT(11)
+#define L_TBU_EN		BIT(16)
+#define L_A_RCACHE(x)		(((x) & 0xF) << 28)
+#define L_ROT_R0		0
+#define L_ROT_R90		1
+#define L_ROT_R180		2
+#define L_ROT_R270		3
+
+/* LAYER_R_CONTROL BITS */
+#define LR_CHI422_BILINEAR	0
+#define LR_CHI422_REPLICATION	1
+#define LR_CHI420_JPEG		(0 << 2)
+#define LR_CHI420_MPEG		(1 << 2)
+
+#define L_ITSEL(x)		((x) & 0xFFF)
+#define L_FTSEL(x)		(((x) & 0xFFF) << 16)
+
+#define LAYER_PER_PLANE_REGS	4
+
+/* Layer_WR registers */
+#define LAYER_WR_PROG_LINE	0x0D4
+#define LAYER_WR_FORMAT		0x0D8
+
+/* Layer_WR control bits */
+#define LW_OFM			BIT(4)
+#define LW_LALPHA(x)		(((x) & 0xFF) << 8)
+#define LW_A_WCACHE(x)		(((x) & 0xF) << 28)
+#define LW_TBU_EN		BIT(16)
+
+#define AxCACHE_MASK		0xF0000000
+
+/* Layer AXI R/W cache setting */
+#define AxCACHE_B		BIT(0)	/* Bufferable */
+#define AxCACHE_M		BIT(1)	/* Modifiable */
+#define AxCACHE_RA		BIT(2)	/* Read-Allocate */
+#define AxCACHE_WA		BIT(3)	/* Write-Allocate */
+
+/* Layer info bits */
+#define L_INFO_RF		BIT(0)
+#define L_INFO_CM		BIT(1)
+#define L_INFO_ABUF_SIZE(x)	(((x) >> 4) & 0x7)
+
+/* Scaler registers */
+#define SC_COEFFTAB		0x0DC
+#define SC_OUT_SIZE		0x0E4
+#define SC_H_CROP		0x0E8
+#define SC_V_CROP		0x0EC
+#define SC_H_INIT_PH		0x0F0
+#define SC_H_DELTA_PH		0x0F4
+#define SC_V_INIT_PH		0x0F8
+#define SC_V_DELTA_PH		0x0FC
+#define SC_ENH_LIMITS		0x130
+#define SC_ENH_COEFF0		0x134
+
+#define SC_MAX_ENH_COEFF	9
+
+/* SC_CTRL_BITS */
+#define SC_CTRL_SCL		BIT(0)
+#define SC_CTRL_LS		BIT(1)
+#define SC_CTRL_AP		BIT(4)
+#define SC_CTRL_IENH		BIT(8)
+#define SC_CTRL_RGBSM		BIT(16)
+#define SC_CTRL_ASM		BIT(17)
+
+#define SC_VTSEL(vtal)		((vtal) << 16)
+
+#define SC_NUM_INPUTS_IDS	1
+#define SC_NUM_OUTPUTS_IDS	1
+
+#define MG_NUM_INPUTS_IDS	2
+#define MG_NUM_OUTPUTS_IDS	1
+
+/* Merger registers */
+#define MG_INPUT_ID0		BLK_INPUT_ID0
+#define MG_INPUT_ID1		(MG_INPUT_ID0 + 4)
+#define MG_SIZE			BLK_SIZE
+
+/* Splitter registers */
+#define SP_OVERLAP_SIZE		0xD8
+
+/* Backend registers */
+#define BS_INFO			0x0C0
+#define BS_PROG_LINE		0x0D4
+#define BS_PREFETCH_LINE	0x0D8
+#define BS_BG_COLOR		0x0DC
+#define BS_ACTIVESIZE		0x0E0
+#define BS_HINTERVALS		0x0E4
+#define BS_VINTERVALS		0x0E8
+#define BS_SYNC			0x0EC
+#define BS_DRIFT_TO		0x100
+#define BS_FRAME_TO		0x104
+#define BS_TE_TO		0x108
+#define BS_T0_INTERVAL		0x110
+#define BS_T1_INTERVAL		0x114
+#define BS_T2_INTERVAL		0x118
+#define BS_CRC0_LOW		0x120
+#define BS_CRC0_HIGH		0x124
+#define BS_CRC1_LOW		0x128
+#define BS_CRC1_HIGH		0x12C
+#define BS_USER			0x130
+
+/* BS control register bits */
+#define BS_CTRL_EN		BIT(0)
+#define BS_CTRL_VM		BIT(1)
+#define BS_CTRL_BM		BIT(2)
+#define BS_CTRL_HMASK		BIT(4)
+#define BS_CTRL_VD		BIT(5)
+#define BS_CTRL_TE		BIT(8)
+#define BS_CTRL_TS		BIT(9)
+#define BS_CTRL_TM		BIT(12)
+#define BS_CTRL_DL		BIT(16)
+#define BS_CTRL_SBS		BIT(17)
+#define BS_CTRL_CRC		BIT(18)
+#define BS_CTRL_PM		BIT(20)
+
+/* BS active size/intervals */
+#define BS_H_INTVALS(hfp, hbp)	(((hfp) & 0xFFF) + (((hbp) & 0x3FF) << 16))
+#define BS_V_INTVALS(vfp, vbp)  (((vfp) & 0x3FFF) + (((vbp) & 0xFF) << 16))
+
+/* BS_SYNC bits */
+#define BS_SYNC_HSW(x)		((x) & 0x3FF)
+#define BS_SYNC_HSP		BIT(12)
+#define BS_SYNC_VSW(x)		(((x) & 0xFF) << 16)
+#define BS_SYNC_VSP		BIT(28)
+
+#define BS_NUM_INPUT_IDS	0
+#define BS_NUM_OUTPUT_IDS	0
+
+/* Image process registers */
+#define IPS_DEPTH		0x0D8
+#define IPS_RGB_RGB_COEFF0	0x130
+#define IPS_RGB_YUV_COEFF0	0x170
+
+#define IPS_DEPTH_MARK		0xF
+
+/* IPS control register bits */
+#define IPS_CTRL_RGB		BIT(0)
+#define IPS_CTRL_FT		BIT(4)
+#define IPS_CTRL_YUV		BIT(8)
+#define IPS_CTRL_CHD422		BIT(9)
+#define IPS_CTRL_CHD420		BIT(10)
+#define IPS_CTRL_LPF		BIT(11)
+#define IPS_CTRL_DITH		BIT(12)
+#define IPS_CTRL_CLAMP		BIT(16)
+#define IPS_CTRL_SBS		BIT(17)
+
+/* IPS info register bits */
+#define IPS_INFO_CHD420		BIT(10)
+
+#define IPS_NUM_INPUT_IDS	2
+#define IPS_NUM_OUTPUT_IDS	1
+
+/* FT_COEFF block registers */
+#define FT_COEFF0		0x80
+#define GLB_IT_COEFF		0x80
+
+/* GLB_SC_COEFF registers */
+#define GLB_SC_COEFF_ADDR	0x0080
+#define GLB_SC_COEFF_DATA	0x0084
+#define GLB_LT_COEFF_DATA	0x0080
+
+#define GLB_SC_COEFF_MAX_NUM	1024
+#define GLB_LT_COEFF_NUM	65
+/* GLB_SC_ADDR */
+#define SC_COEFF_R_ADDR		BIT(18)
+#define SC_COEFF_G_ADDR		BIT(17)
+#define SC_COEFF_B_ADDR		BIT(16)
+
+#define SC_COEFF_DATA(x, y)	(((y) & 0xFFFF) | (((x) & 0xFFFF) << 16))
+
+enum d71_blk_type {
+	D71_BLK_TYPE_GCU		= 0x00,
+	D71_BLK_TYPE_LPU		= 0x01,
+	D71_BLK_TYPE_CU			= 0x02,
+	D71_BLK_TYPE_DOU		= 0x03,
+	D71_BLK_TYPE_AEU		= 0x04,
+	D71_BLK_TYPE_GLB_LT_COEFF	= 0x05,
+	D71_BLK_TYPE_GLB_SCL_COEFF	= 0x06, /* SH/SV scaler coeff */
+	D71_BLK_TYPE_GLB_SC_COEFF	= 0x07,
+	D71_BLK_TYPE_PERIPH		= 0x08,
+	D71_BLK_TYPE_LPU_TRUSTED	= 0x09,
+	D71_BLK_TYPE_AEU_TRUSTED	= 0x0A,
+	D71_BLK_TYPE_LPU_LAYER		= 0x10,
+	D71_BLK_TYPE_LPU_WB_LAYER	= 0x11,
+	D71_BLK_TYPE_CU_SPLITTER	= 0x20,
+	D71_BLK_TYPE_CU_SCALER		= 0x21,
+	D71_BLK_TYPE_CU_MERGER		= 0x22,
+	D71_BLK_TYPE_DOU_IPS		= 0x30,
+	D71_BLK_TYPE_DOU_BS		= 0x31,
+	D71_BLK_TYPE_DOU_FT_COEFF	= 0x32,
+	D71_BLK_TYPE_AEU_DS		= 0x40,
+	D71_BLK_TYPE_AEU_AES		= 0x41,
+	D71_BLK_TYPE_RESERVED		= 0xFF
+};
+
+/* Constant of components */
+#define D71_MAX_PIPELINE		2
+#define D71_PIPELINE_MAX_SCALERS	2
+#define D71_PIPELINE_MAX_LAYERS		4
+
+#define D71_MAX_GLB_IT_COEFF		3
+#define D71_MAX_GLB_SCL_COEFF		4
+
+#define D71_MAX_LAYERS_PER_LPU		4
+#define D71_BLOCK_MAX_INPUT		9
+#define D71_BLOCK_MAX_OUTPUT		5
+#define D71_MAX_SC_PER_CU		2
+
+#define D71_BLOCK_OFFSET_PERIPH		0xFE00
+#define D71_BLOCK_SIZE			0x0200
+
+#define D71_DEFAULT_PREPRETCH_LINE	5
+#define D71_BUS_WIDTH_16_BYTES		16
+
+#define D71_MIN_LINE_SIZE		64
+#define D71_MIN_VERTICAL_SIZE		64
+#define D71_SC_MIN_LIN_SIZE		4
+#define D71_SC_MIN_VERTICAL_SIZE	4
+#define D71_SC_MAX_LIN_SIZE		2048
+#define D71_SC_MAX_VERTICAL_SIZE	4096
+
+#define D71_SC_MAX_UPSCALING		64
+#define D71_SC_MAX_DOWNSCALING		6
+#define D71_SC_SPLIT_OVERLAP		8
+#define D71_SC_ENH_SPLIT_OVERLAP	1
+
+#define D71_MG_MIN_MERGED_SIZE		4
+#define D71_MG_MAX_MERGED_HSIZE		4032
+#define D71_MG_MAX_MERGED_VSIZE		4096
+
+#define D71_PALPHA_DEF_MAP		0xFFAA5500
+#define D71_LAYER_CONTROL_DEFAULT	0x30000000
+#define D71_WB_LAYER_CONTROL_DEFAULT	0x3000FF00
+#define D71_BS_CONTROL_DEFAULT		0x00000002
+
+struct block_header {
+	u32 block_info;
+	u32 pipeline_info;
+	u32 input_ids[D71_BLOCK_MAX_INPUT];
+	u32 output_ids[D71_BLOCK_MAX_OUTPUT];
+};
+
+static inline u32 get_block_type(struct block_header *blk)
+{
+	return BLOCK_INFO_BLK_TYPE(blk->block_info);
+}
+
+#endif /* !_D71_REG_H_ */
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
index 3ca5718aa0c2..f88a14927be9 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
@@ -18,6 +18,24 @@
 #include "komeda_dev.h"
 #include "komeda_kms.h"
 
+void komeda_crtc_handle_event(struct komeda_crtc   *kcrtc,
+			      struct komeda_events *evts)
+{
+	struct drm_crtc *crtc = &kcrtc->base;
+	u32 events = evts->pipes[kcrtc->master->id];
+
+	if (events & KOMEDA_EVENT_VSYNC)
+		drm_crtc_handle_vblank(crtc);
+
+	/* will handle it together with the write back support */
+	if (events & KOMEDA_EVENT_EOW)
+		DRM_DEBUG("EOW.\n");
+
+	/* will handle it with crtc->flush */
+	if (events & KOMEDA_EVENT_FLIP)
+		DRM_DEBUG("FLIP Done.\n");
+}
+
 struct drm_crtc_helper_funcs komeda_crtc_helper_funcs = {
 };
 
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
index 70e9bb7fa30c..b420c6205d6b 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
@@ -8,11 +8,55 @@
 #include <linux/of_device.h>
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
+#ifdef CONFIG_DEBUG_FS
+#include <linux/debugfs.h>
+#include <linux/seq_file.h>
+#endif
 
 #include <drm/drm_print.h>
 
 #include "komeda_dev.h"
 
+static int komeda_register_show(struct seq_file *sf, void *x)
+{
+	struct komeda_dev *mdev = sf->private;
+	int i;
+
+	if (mdev->funcs->dump_register)
+		mdev->funcs->dump_register(mdev, sf);
+
+	for (i = 0; i < mdev->n_pipelines; i++)
+		komeda_pipeline_dump_register(mdev->pipelines[i], sf);
+
+	return 0;
+}
+
+static int komeda_register_open(struct inode *inode, struct file *filp)
+{
+	return single_open(filp, komeda_register_show, inode->i_private);
+}
+
+static const struct file_operations komeda_register_fops = {
+	.owner		= THIS_MODULE,
+	.open		= komeda_register_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};
+
+static void komeda_debugfs_init(struct komeda_dev *mdev)
+{
+	if (!debugfs_initialized())
+		return;
+
+	mdev->debugfs_root = debugfs_create_dir("komeda", NULL);
+	if (IS_ERR_OR_NULL(mdev->debugfs_root))
+		return;
+
+	debugfs_create_file("register", 0444, mdev->debugfs_root,
+			    mdev, &komeda_register_fops);
+}
+
 static int komeda_parse_pipe_dt(struct komeda_dev *mdev, struct device_node *np)
 {
 	struct komeda_pipeline *pipe;
@@ -53,6 +97,7 @@ static int komeda_parse_pipe_dt(struct komeda_dev *mdev, struct device_node *np)
 
 static int komeda_parse_dt(struct device *dev, struct komeda_dev *mdev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct device_node *child, *np = dev->of_node;
 	struct clk *clk;
 	int ret;
@@ -62,6 +107,11 @@ static int komeda_parse_dt(struct device *dev, struct komeda_dev *mdev)
 		return PTR_ERR(clk);
 
 	mdev->mclk = clk;
+	mdev->irq  = platform_get_irq(pdev, 0);
+	if (mdev->irq < 0) {
+		DRM_ERROR("could not get IRQ number.\n");
+		return mdev->irq;
+	}
 
 	for_each_available_child_of_node(np, child) {
 		if (of_node_cmp(child->name, "pipeline") == 0) {
@@ -147,6 +197,16 @@ struct komeda_dev *komeda_dev_create(struct device *dev)
 		goto err_cleanup;
 	}
 
+	err = komeda_assemble_pipelines(mdev);
+	if (err) {
+		DRM_ERROR("assemble display pipelines failed.\n");
+		goto err_cleanup;
+	}
+
+#ifdef CONFIG_DEBUG_FS
+	komeda_debugfs_init(mdev);
+#endif
+
 	return mdev;
 
 err_cleanup:
@@ -160,6 +220,10 @@ void komeda_dev_destroy(struct komeda_dev *mdev)
 	struct komeda_dev_funcs *funcs = mdev->funcs;
 	int i;
 
+#ifdef CONFIG_DEBUG_FS
+	debugfs_remove_recursive(mdev->debugfs_root);
+#endif
+
 	for (i = 0; i < mdev->n_pipelines; i++) {
 		komeda_pipeline_destroy(mdev, mdev->pipelines[i]);
 		mdev->pipelines[i] = NULL;
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
index 0f77dead6a23..8eae2620ce77 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
@@ -13,6 +13,33 @@
 #include "malidp_product.h"
 #include "komeda_format_caps.h"
 
+#define KOMEDA_EVENT_VSYNC		BIT_ULL(0)
+#define KOMEDA_EVENT_FLIP		BIT_ULL(1)
+#define KOMEDA_EVENT_URUN		BIT_ULL(2)
+#define KOMEDA_EVENT_IBSY		BIT_ULL(3)
+#define KOMEDA_EVENT_OVR		BIT_ULL(4)
+#define KOMEDA_EVENT_EOW		BIT_ULL(5)
+#define KOMEDA_EVENT_MODE		BIT_ULL(6)
+
+#define KOMEDA_ERR_TETO			BIT_ULL(14)
+#define KOMEDA_ERR_TEMR			BIT_ULL(15)
+#define KOMEDA_ERR_TITR			BIT_ULL(16)
+#define KOMEDA_ERR_CPE			BIT_ULL(17)
+#define KOMEDA_ERR_CFGE			BIT_ULL(18)
+#define KOMEDA_ERR_AXIE			BIT_ULL(19)
+#define KOMEDA_ERR_ACE0			BIT_ULL(20)
+#define KOMEDA_ERR_ACE1			BIT_ULL(21)
+#define KOMEDA_ERR_ACE2			BIT_ULL(22)
+#define KOMEDA_ERR_ACE3			BIT_ULL(23)
+#define KOMEDA_ERR_DRIFTTO		BIT_ULL(24)
+#define KOMEDA_ERR_FRAMETO		BIT_ULL(25)
+#define KOMEDA_ERR_CSCE			BIT_ULL(26)
+#define KOMEDA_ERR_ZME			BIT_ULL(27)
+#define KOMEDA_ERR_MERR			BIT_ULL(28)
+#define KOMEDA_ERR_TCF			BIT_ULL(29)
+#define KOMEDA_ERR_TTNG			BIT_ULL(30)
+#define KOMEDA_ERR_TTF			BIT_ULL(31)
+
 /* malidp device id */
 enum {
 	MALI_D71 = 0,
@@ -39,6 +66,11 @@ struct komeda_product_data {
 
 struct komeda_dev;
 
+struct komeda_events {
+	u64 global;
+	u64 pipes[KOMEDA_MAX_PIPELINES];
+};
+
 /**
  * struct komeda_dev_funcs
  *
@@ -60,6 +92,20 @@ struct komeda_dev_funcs {
 	int (*enum_resources)(struct komeda_dev *mdev);
 	/** @cleanup: call to chip to cleanup komeda_dev->chip data */
 	void (*cleanup)(struct komeda_dev *mdev);
+	/**
+	 * @irq_handler:
+	 *
+	 * for CORE to get the HW event from the CHIP when interrupt happened.
+	 */
+	irqreturn_t (*irq_handler)(struct komeda_dev *mdev,
+				   struct komeda_events *events);
+	/** @enable_irq: enable irq */
+	int (*enable_irq)(struct komeda_dev *mdev);
+	/** @disable_irq: disable irq */
+	int (*disable_irq)(struct komeda_dev *mdev);
+
+	/** @dump_register: Optional, dump registers to seq_file */
+	void (*dump_register)(struct komeda_dev *mdev, struct seq_file *seq);
 };
 
 /**
@@ -81,6 +127,9 @@ struct komeda_dev {
 	/** @mck: HW main engine clk */
 	struct clk *mclk;
 
+	/** @irq: irq number */
+	int irq;
+
 	int n_pipelines;
 	struct komeda_pipeline *pipelines[KOMEDA_MAX_PIPELINES];
 
@@ -93,6 +142,8 @@ struct komeda_dev {
 	 * destroyed by &komeda_dev_funcs.cleanup()
 	 */
 	void *chip_data;
+
+	struct dentry *debugfs_root;
 };
 
 static inline bool
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
index 47a58ab20434..b214edbfbbc6 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
@@ -13,6 +13,7 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
+#include <drm/drm_irq.h>
 #include <drm/drm_vblank.h>
 
 #include "komeda_dev.h"
@@ -33,10 +34,31 @@ static int komeda_gem_cma_dumb_create(struct drm_file *file,
 	return drm_gem_cma_dumb_create_internal(file, dev, args);
 }
 
+static irqreturn_t komeda_kms_irq_handler(int irq, void *data)
+{
+	struct drm_device *drm = data;
+	struct komeda_dev *mdev = drm->dev_private;
+	struct komeda_kms_dev *kms = to_kdev(drm);
+	struct komeda_events evts;
+	irqreturn_t status;
+	u32 i;
+
+	/* Call into the CHIP to recognize events */
+	memset(&evts, 0, sizeof(evts));
+	status = mdev->funcs->irq_handler(mdev, &evts);
+
+	/* Notify the crtc to handle the events */
+	for (i = 0; i < kms->n_crtcs; i++)
+		komeda_crtc_handle_event(&kms->crtcs[i], &evts);
+
+	return status;
+}
+
 static struct drm_driver komeda_kms_driver = {
 	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC |
-			   DRIVER_PRIME,
+			   DRIVER_PRIME | DRIVER_HAVE_IRQ,
 	.lastclose			= drm_fb_helper_lastclose,
+	.irq_handler			= komeda_kms_irq_handler,
 	.gem_free_object_unlocked	= drm_gem_cma_free_object,
 	.gem_vm_ops			= &drm_gem_cma_vm_ops,
 	.dumb_create			= komeda_gem_cma_dumb_create,
@@ -144,12 +166,22 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
 
 	drm_mode_config_reset(drm);
 
-	err = drm_dev_register(drm, 0);
+	err = drm_irq_install(drm, mdev->irq);
 	if (err)
 		goto cleanup_mode_config;
 
+	err = mdev->funcs->enable_irq(mdev);
+	if (err)
+		goto uninstall_irq;
+
+	err = drm_dev_register(drm, 0);
+	if (err)
+		goto uninstall_irq;
+
 	return kms;
 
+uninstall_irq:
+	drm_irq_uninstall(drm);
 cleanup_mode_config:
 	drm_mode_config_cleanup(drm);
 free_kms:
@@ -162,7 +194,9 @@ void komeda_kms_detach(struct komeda_kms_dev *kms)
 	struct drm_device *drm = &kms->base;
 	struct komeda_dev *mdev = drm->dev_private;
 
+	mdev->funcs->disable_irq(mdev);
 	drm_dev_unregister(drm);
+	drm_irq_uninstall(drm);
 	component_unbind_all(mdev->dev, drm);
 	komeda_kms_cleanup_private_objs(mdev);
 	drm_mode_config_cleanup(drm);
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.h b/drivers/gpu/drm/arm/display/komeda/komeda_kms.h
index 874e9c9f0749..15ac8b85506c 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.h
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.h
@@ -12,6 +12,8 @@
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_device.h>
 #include <drm/drm_writeback.h>
+#include <video/videomode.h>
+#include <video/display_timing.h>
 
 /** struct komeda_plane - komeda instance of drm_plane */
 struct komeda_plane {
@@ -108,6 +110,9 @@ int komeda_kms_add_private_objs(struct komeda_kms_dev *kms,
 				struct komeda_dev *mdev);
 void komeda_kms_cleanup_private_objs(struct komeda_dev *mdev);
 
+void komeda_crtc_handle_event(struct komeda_crtc   *kcrtc,
+			      struct komeda_events *evts);
+
 struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev);
 void komeda_kms_detach(struct komeda_kms_dev *kms);
 
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c
index f1908e9ef128..07398efc40f5 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c
@@ -19,17 +19,17 @@ komeda_pipeline_add(struct komeda_dev *mdev, size_t size,
 	if (mdev->n_pipelines + 1 > KOMEDA_MAX_PIPELINES) {
 		DRM_ERROR("Exceed max support %d pipelines.\n",
 			  KOMEDA_MAX_PIPELINES);
-		return NULL;
+		return ERR_PTR(-ENOSPC);
 	}
 
 	if (size < sizeof(*pipe)) {
 		DRM_ERROR("Request pipeline size too small.\n");
-		return NULL;
+		return ERR_PTR(-EINVAL);
 	}
 
 	pipe = devm_kzalloc(mdev->dev, size, GFP_KERNEL);
 	if (!pipe)
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 
 	pipe->mdev = mdev;
 	pipe->id   = mdev->n_pipelines;
@@ -142,32 +142,32 @@ komeda_component_add(struct komeda_pipeline *pipe,
 	if (max_active_inputs > KOMEDA_COMPONENT_N_INPUTS) {
 		WARN(1, "please large KOMEDA_COMPONENT_N_INPUTS to %d.\n",
 		     max_active_inputs);
-		return NULL;
+		return ERR_PTR(-ENOSPC);
 	}
 
 	pos = komeda_pipeline_get_component_pos(pipe, id);
 	if (!pos || (*pos))
-		return NULL;
+		return ERR_PTR(-EINVAL);
 
 	if (has_bit(id, KOMEDA_PIPELINE_LAYERS)) {
 		idx = id - KOMEDA_COMPONENT_LAYER0;
 		num = &pipe->n_layers;
 		if (idx != pipe->n_layers) {
 			DRM_ERROR("please add Layer by id sequence.\n");
-			return NULL;
+			return ERR_PTR(-EINVAL);
 		}
 	} else if (has_bit(id,  KOMEDA_PIPELINE_SCALERS)) {
 		idx = id - KOMEDA_COMPONENT_SCALER0;
 		num = &pipe->n_scalers;
 		if (idx != pipe->n_scalers) {
 			DRM_ERROR("please add Scaler by id sequence.\n");
-			return NULL;
+			return ERR_PTR(-EINVAL);
 		}
 	}
 
 	c = devm_kzalloc(pipe->mdev->dev, comp_sz, GFP_KERNEL);
 	if (!c)
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 
 	c->id = id;
 	c->hw_id = hw_id;
@@ -200,3 +200,98 @@ void komeda_component_destroy(struct komeda_dev *mdev,
 {
 	devm_kfree(mdev->dev, c);
 }
+
+static void komeda_component_dump(struct komeda_component *c)
+{
+	if (!c)
+		return;
+
+	DRM_DEBUG("	%s: ID %d-0x%08lx.\n",
+		  c->name, c->id, BIT(c->id));
+	DRM_DEBUG("		max_active_inputs:%d, supported_inputs: 0x%08x.\n",
+		  c->max_active_inputs, c->supported_inputs);
+	DRM_DEBUG("		max_active_outputs:%d, supported_outputs: 0x%08x.\n",
+		  c->max_active_outputs, c->supported_outputs);
+}
+
+static void komeda_pipeline_dump(struct komeda_pipeline *pipe)
+{
+	struct komeda_component *c;
+	int id;
+
+	DRM_INFO("Pipeline-%d: n_layers: %d, n_scalers: %d, output: %s\n",
+		 pipe->id, pipe->n_layers, pipe->n_scalers,
+		 pipe->of_output_dev ? pipe->of_output_dev->full_name : "none");
+
+	dp_for_each_set_bit(id, pipe->avail_comps) {
+		c = komeda_pipeline_get_component(pipe, id);
+
+		komeda_component_dump(c);
+	}
+}
+
+static void komeda_component_verify_inputs(struct komeda_component *c)
+{
+	struct komeda_pipeline *pipe = c->pipeline;
+	struct komeda_component *input;
+	int id;
+
+	dp_for_each_set_bit(id, c->supported_inputs) {
+		input = komeda_pipeline_get_component(pipe, id);
+		if (!input) {
+			c->supported_inputs &= ~(BIT(id));
+			DRM_WARN("Can not find input(ID-%d) for component: %s.\n",
+				 id, c->name);
+			continue;
+		}
+
+		input->supported_outputs |= BIT(c->id);
+	}
+}
+
+static void komeda_pipeline_assemble(struct komeda_pipeline *pipe)
+{
+	struct komeda_component *c;
+	int id;
+
+	dp_for_each_set_bit(id, pipe->avail_comps) {
+		c = komeda_pipeline_get_component(pipe, id);
+
+		komeda_component_verify_inputs(c);
+	}
+}
+
+int komeda_assemble_pipelines(struct komeda_dev *mdev)
+{
+	struct komeda_pipeline *pipe;
+	int i;
+
+	for (i = 0; i < mdev->n_pipelines; i++) {
+		pipe = mdev->pipelines[i];
+
+		komeda_pipeline_assemble(pipe);
+		komeda_pipeline_dump(pipe);
+	}
+
+	return 0;
+}
+
+void komeda_pipeline_dump_register(struct komeda_pipeline *pipe,
+				   struct seq_file *sf)
+{
+	struct komeda_component *c;
+	u32 id;
+
+	seq_printf(sf, "\n======== Pipeline-%d ==========\n", pipe->id);
+
+	if (pipe->funcs && pipe->funcs->dump_register)
+		pipe->funcs->dump_register(pipe, sf);
+
+	dp_for_each_set_bit(id, pipe->avail_comps) {
+		c = komeda_pipeline_get_component(pipe, id);
+
+		seq_printf(sf, "\n------%s------\n", c->name);
+		if (c->funcs->dump_register)
+			c->funcs->dump_register(c, sf);
+	}
+}
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
index 8c950bc8ae96..c30a790d0712 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
@@ -204,51 +204,74 @@ static inline u16 component_changed_inputs(struct komeda_component_state *st)
 	return component_disabling_inputs(st) | st->changed_active_inputs;
 }
 
+#define for_each_changed_input(st, i)	\
+	for ((i) = 0; (i) < (st)->component->max_active_inputs; (i)++)	\
+		if (has_bit((i), component_changed_inputs(st)))
+
 #define to_comp(__c)	(((__c) == NULL) ? NULL : &((__c)->base))
 #define to_cpos(__c)	((struct komeda_component **)&(__c))
 
-/* these structures are going to be filled in in uture patches */
 struct komeda_layer {
 	struct komeda_component base;
-	/* layer specific features and caps */
-	int layer_type; /* RICH, SIMPLE or WB */
+	/* accepted h/v input range before rotation */
+	struct malidp_range hsize_in, vsize_in;
+	u32 layer_type; /* RICH, SIMPLE or WB */
+	u32 supported_rots;
 };
 
 struct komeda_layer_state {
 	struct komeda_component_state base;
 	/* layer specific configuration state */
+	u16 hsize, vsize;
+	u32 rot;
+	dma_addr_t addr[3];
 };
 
-struct komeda_compiz {
+struct komeda_scaler {
 	struct komeda_component base;
-	/* compiz specific features and caps */
+	/* scaler features and caps */
 };
 
-struct komeda_compiz_state {
+struct komeda_scaler_state {
 	struct komeda_component_state base;
-	/* compiz specific configuration state */
 };
 
-struct komeda_scaler {
+struct komeda_compiz {
 	struct komeda_component base;
-	/* scaler features and caps */
+	struct malidp_range hsize, vsize;
 };
 
-struct komeda_scaler_state {
+struct komeda_compiz_input_cfg {
+	u16 hsize, vsize;
+	u16 hoffset, voffset;
+	u8 pixel_blend_mode, layer_alpha;
+};
+
+struct komeda_compiz_state {
 	struct komeda_component_state base;
+	/* composition size */
+	u16 hsize, vsize;
+	struct komeda_compiz_input_cfg cins[KOMEDA_COMPONENT_N_INPUTS];
 };
 
 struct komeda_improc {
 	struct komeda_component base;
+	u32 supported_color_formats;  /* DRM_RGB/YUV444/YUV420*/
+	u32 supported_color_depths; /* BIT(8) | BIT(10)*/
+	u8 supports_degamma : 1;
+	u8 supports_csc : 1;
+	u8 supports_gamma : 1;
 };
 
 struct komeda_improc_state {
 	struct komeda_component_state base;
+	u16 hsize, vsize;
 };
 
 /* display timing controller */
 struct komeda_timing_ctrlr {
 	struct komeda_component base;
+	u8 supports_dual_link : 1;
 };
 
 struct komeda_timing_ctrlr_state {
@@ -340,10 +363,13 @@ komeda_pipeline_add(struct komeda_dev *mdev, size_t size,
 		    struct komeda_pipeline_funcs *funcs);
 void komeda_pipeline_destroy(struct komeda_dev *mdev,
 			     struct komeda_pipeline *pipe);
-
+int komeda_assemble_pipelines(struct komeda_dev *mdev);
 struct komeda_component *
 komeda_pipeline_get_component(struct komeda_pipeline *pipe, int id);
 
+void komeda_pipeline_dump_register(struct komeda_pipeline *pipe,
+				   struct seq_file *sf);
+
 /* component APIs */
 struct komeda_component *
 komeda_component_add(struct komeda_pipeline *pipe,
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index b776fca571f3..dfdfa766da8f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -46,6 +46,9 @@
 #define LEFT_MIXER 0
 #define RIGHT_MIXER 1
 
+/* timeout in ms waiting for frame done */
+#define DPU_CRTC_FRAME_DONE_TIMEOUT_MS	60
+
 static struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
 {
 	struct msm_drm_private *priv = crtc->dev->dev_private;
@@ -425,65 +428,6 @@ void dpu_crtc_complete_commit(struct drm_crtc *crtc,
 	trace_dpu_crtc_complete_commit(DRMID(crtc));
 }
 
-static void _dpu_crtc_setup_mixer_for_encoder(
-		struct drm_crtc *crtc,
-		struct drm_encoder *enc)
-{
-	struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state);
-	struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(crtc);
-	struct dpu_rm *rm = &dpu_kms->rm;
-	struct dpu_crtc_mixer *mixer;
-	struct dpu_hw_ctl *last_valid_ctl = NULL;
-	int i;
-	struct dpu_rm_hw_iter lm_iter, ctl_iter;
-
-	dpu_rm_init_hw_iter(&lm_iter, enc->base.id, DPU_HW_BLK_LM);
-	dpu_rm_init_hw_iter(&ctl_iter, enc->base.id, DPU_HW_BLK_CTL);
-
-	/* Set up all the mixers and ctls reserved by this encoder */
-	for (i = cstate->num_mixers; i < ARRAY_SIZE(cstate->mixers); i++) {
-		mixer = &cstate->mixers[i];
-
-		if (!dpu_rm_get_hw(rm, &lm_iter))
-			break;
-		mixer->hw_lm = (struct dpu_hw_mixer *)lm_iter.hw;
-
-		/* CTL may be <= LMs, if <, multiple LMs controlled by 1 CTL */
-		if (!dpu_rm_get_hw(rm, &ctl_iter)) {
-			DPU_DEBUG("no ctl assigned to lm %d, using previous\n",
-					mixer->hw_lm->idx - LM_0);
-			mixer->lm_ctl = last_valid_ctl;
-		} else {
-			mixer->lm_ctl = (struct dpu_hw_ctl *)ctl_iter.hw;
-			last_valid_ctl = mixer->lm_ctl;
-		}
-
-		/* Shouldn't happen, mixers are always >= ctls */
-		if (!mixer->lm_ctl) {
-			DPU_ERROR("no valid ctls found for lm %d\n",
-					mixer->hw_lm->idx - LM_0);
-			return;
-		}
-
-		cstate->num_mixers++;
-		DPU_DEBUG("setup mixer %d: lm %d\n",
-				i, mixer->hw_lm->idx - LM_0);
-		DPU_DEBUG("setup mixer %d: ctl %d\n",
-				i, mixer->lm_ctl->idx - CTL_0);
-	}
-}
-
-static void _dpu_crtc_setup_mixers(struct drm_crtc *crtc)
-{
-	struct drm_encoder *enc;
-
-	WARN_ON(!drm_modeset_is_locked(&crtc->mutex));
-
-	/* Check for mixers on all encoders attached to this crtc */
-	drm_for_each_encoder_mask(enc, crtc->dev, crtc->state->encoder_mask)
-		_dpu_crtc_setup_mixer_for_encoder(crtc, enc);
-}
-
 static void _dpu_crtc_setup_lm_bounds(struct drm_crtc *crtc,
 		struct drm_crtc_state *state)
 {
@@ -533,10 +477,7 @@ static void dpu_crtc_atomic_begin(struct drm_crtc *crtc,
 	dev = crtc->dev;
 	smmu_state = &dpu_crtc->smmu_state;
 
-	if (!cstate->num_mixers) {
-		_dpu_crtc_setup_mixers(crtc);
-		_dpu_crtc_setup_lm_bounds(crtc, crtc->state);
-	}
+	_dpu_crtc_setup_lm_bounds(crtc, crtc->state);
 
 	if (dpu_crtc->event) {
 		WARN_ON(dpu_crtc->event);
@@ -683,7 +624,7 @@ static int _dpu_crtc_wait_for_frame_done(struct drm_crtc *crtc)
 
 	DPU_ATRACE_BEGIN("frame done completion wait");
 	ret = wait_for_completion_timeout(&dpu_crtc->frame_done_comp,
-			msecs_to_jiffies(DPU_FRAME_DONE_TIMEOUT));
+			msecs_to_jiffies(DPU_CRTC_FRAME_DONE_TIMEOUT_MS));
 	if (!ret) {
 		DRM_ERROR("frame done wait timed out, ret:%d\n", ret);
 		rc = -ETIMEDOUT;
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 5aa3307f3f0c..82bf16d61a45 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -69,6 +69,9 @@
 
 #define MAX_VDISPLAY_SPLIT 1080
 
+/* timeout in frames waiting for frame done */
+#define DPU_ENCODER_FRAME_DONE_TIMEOUT_FRAMES 5
+
 /**
  * enum dpu_enc_rc_events - events for resource control state machine
  * @DPU_ENC_RC_EVENT_KICKOFF:
@@ -158,7 +161,7 @@ enum dpu_enc_rc_states {
  *				Bit0 = phys_encs[0] etc.
  * @crtc_frame_event_cb:	callback handler for frame event
  * @crtc_frame_event_cb_data:	callback handler private data
- * @frame_done_timeout:		frame done timeout in Hz
+ * @frame_done_timeout_ms:	frame done timeout in ms
  * @frame_done_timer:		watchdog timer for frame done event
  * @vsync_event_timer:		vsync timer
  * @disp_info:			local copy of msm_display_info struct
@@ -196,7 +199,7 @@ struct dpu_encoder_virt {
 	void (*crtc_frame_event_cb)(void *, u32 event);
 	void *crtc_frame_event_cb_data;
 
-	atomic_t frame_done_timeout;
+	atomic_t frame_done_timeout_ms;
 	struct timer_list frame_done_timer;
 	struct timer_list vsync_event_timer;
 
@@ -520,8 +523,8 @@ static void _dpu_encoder_adjust_mode(struct drm_connector *connector,
 
 	list_for_each_entry(cur_mode, &connector->modes, head) {
 		if (cur_mode->vdisplay == adj_mode->vdisplay &&
-			cur_mode->hdisplay == adj_mode->hdisplay &&
-			cur_mode->vrefresh == adj_mode->vrefresh) {
+		    cur_mode->hdisplay == adj_mode->hdisplay &&
+		    drm_mode_vrefresh(cur_mode) == drm_mode_vrefresh(adj_mode)) {
 			adj_mode->private = cur_mode->private;
 			adj_mode->private_flags |= cur_mode->private_flags;
 		}
@@ -959,10 +962,14 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
 	struct dpu_kms *dpu_kms;
 	struct list_head *connector_list;
 	struct drm_connector *conn = NULL, *conn_iter;
-	struct dpu_rm_hw_iter pp_iter, ctl_iter;
+	struct drm_crtc *drm_crtc;
+	struct dpu_crtc_state *cstate;
+	struct dpu_rm_hw_iter hw_iter;
 	struct msm_display_topology topology;
 	struct dpu_hw_ctl *hw_ctl[MAX_CHANNELS_PER_ENC] = { NULL };
-	int i = 0, ret;
+	struct dpu_hw_mixer *hw_lm[MAX_CHANNELS_PER_ENC] = { NULL };
+	int num_lm = 0, num_ctl = 0;
+	int i, j, ret;
 
 	if (!drm_enc) {
 		DPU_ERROR("invalid encoder\n");
@@ -990,10 +997,14 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
 		return;
 	}
 
+	drm_for_each_crtc(drm_crtc, drm_enc->dev)
+		if (drm_crtc->state->encoder_mask & drm_encoder_mask(drm_enc))
+			break;
+
 	topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode);
 
 	/* Reserve dynamic resources now. Indicating non-AtomicTest phase */
-	ret = dpu_rm_reserve(&dpu_kms->rm, drm_enc, drm_enc->crtc->state,
+	ret = dpu_rm_reserve(&dpu_kms->rm, drm_enc, drm_crtc->state,
 			     topology, false);
 	if (ret) {
 		DPU_ERROR_ENC(dpu_enc,
@@ -1001,21 +1012,41 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
 		return;
 	}
 
-	dpu_rm_init_hw_iter(&pp_iter, drm_enc->base.id, DPU_HW_BLK_PINGPONG);
+	dpu_rm_init_hw_iter(&hw_iter, drm_enc->base.id, DPU_HW_BLK_PINGPONG);
 	for (i = 0; i < MAX_CHANNELS_PER_ENC; i++) {
 		dpu_enc->hw_pp[i] = NULL;
-		if (!dpu_rm_get_hw(&dpu_kms->rm, &pp_iter))
+		if (!dpu_rm_get_hw(&dpu_kms->rm, &hw_iter))
+			break;
+		dpu_enc->hw_pp[i] = (struct dpu_hw_pingpong *) hw_iter.hw;
+	}
+
+	dpu_rm_init_hw_iter(&hw_iter, drm_enc->base.id, DPU_HW_BLK_CTL);
+	for (i = 0; i < MAX_CHANNELS_PER_ENC; i++) {
+		if (!dpu_rm_get_hw(&dpu_kms->rm, &hw_iter))
 			break;
-		dpu_enc->hw_pp[i] = (struct dpu_hw_pingpong *) pp_iter.hw;
+		hw_ctl[i] = (struct dpu_hw_ctl *)hw_iter.hw;
+		num_ctl++;
 	}
 
-	dpu_rm_init_hw_iter(&ctl_iter, drm_enc->base.id, DPU_HW_BLK_CTL);
+	dpu_rm_init_hw_iter(&hw_iter, drm_enc->base.id, DPU_HW_BLK_LM);
 	for (i = 0; i < MAX_CHANNELS_PER_ENC; i++) {
-		if (!dpu_rm_get_hw(&dpu_kms->rm, &ctl_iter))
+		if (!dpu_rm_get_hw(&dpu_kms->rm, &hw_iter))
 			break;
-		hw_ctl[i] = (struct dpu_hw_ctl *)ctl_iter.hw;
+		hw_lm[i] = (struct dpu_hw_mixer *)hw_iter.hw;
+		num_lm++;
 	}
 
+	cstate = to_dpu_crtc_state(drm_crtc->state);
+
+	for (i = 0; i < num_lm; i++) {
+		int ctl_idx = (i < num_ctl) ? i : (num_ctl-1);
+
+		cstate->mixers[i].hw_lm = hw_lm[i];
+		cstate->mixers[i].lm_ctl = hw_ctl[ctl_idx];
+	}
+
+	cstate->num_mixers = num_lm;
+
 	for (i = 0; i < dpu_enc->num_phys_encs; i++) {
 		struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];
 
@@ -1023,18 +1054,38 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
 			if (!dpu_enc->hw_pp[i]) {
 				DPU_ERROR_ENC(dpu_enc, "no pp block assigned"
 					     "at idx: %d\n", i);
-				return;
+				goto error;
 			}
 
 			if (!hw_ctl[i]) {
 				DPU_ERROR_ENC(dpu_enc, "no ctl block assigned"
 					     "at idx: %d\n", i);
-				return;
+				goto error;
 			}
 
 			phys->hw_pp = dpu_enc->hw_pp[i];
 			phys->hw_ctl = hw_ctl[i];
 
+			dpu_rm_init_hw_iter(&hw_iter, drm_enc->base.id,
+					    DPU_HW_BLK_INTF);
+			for (j = 0; j < MAX_CHANNELS_PER_ENC; j++) {
+				struct dpu_hw_intf *hw_intf;
+
+				if (!dpu_rm_get_hw(&dpu_kms->rm, &hw_iter))
+					break;
+
+				hw_intf = (struct dpu_hw_intf *)hw_iter.hw;
+				if (hw_intf->idx == phys->intf_idx)
+					phys->hw_intf = hw_intf;
+			}
+
+			if (!phys->hw_intf) {
+				DPU_ERROR_ENC(dpu_enc,
+					      "no intf block assigned at idx: %d\n",
+					      i);
+				goto error;
+			}
+
 			phys->connector = conn->state->connector;
 			if (phys->ops.mode_set)
 				phys->ops.mode_set(phys, mode, adj_mode);
@@ -1042,6 +1093,9 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
 	}
 
 	dpu_enc->mode_set_complete = true;
+
+error:
+	dpu_rm_release(&dpu_kms->rm, drm_enc);
 }
 
 static void _dpu_encoder_virt_enable_helper(struct drm_encoder *drm_enc)
@@ -1182,7 +1236,7 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc)
 	}
 
 	/* after phys waits for frame-done, should be no more frames pending */
-	if (atomic_xchg(&dpu_enc->frame_done_timeout, 0)) {
+	if (atomic_xchg(&dpu_enc->frame_done_timeout_ms, 0)) {
 		DPU_ERROR("enc%d timeout pending\n", drm_enc->base.id);
 		del_timer_sync(&dpu_enc->frame_done_timer);
 	}
@@ -1339,7 +1393,7 @@ static void dpu_encoder_frame_done_callback(
 		}
 
 		if (!dpu_enc->frame_busy_mask[0]) {
-			atomic_set(&dpu_enc->frame_done_timeout, 0);
+			atomic_set(&dpu_enc->frame_done_timeout_ms, 0);
 			del_timer(&dpu_enc->frame_done_timer);
 
 			dpu_encoder_resource_control(drm_enc,
@@ -1547,8 +1601,14 @@ static void _dpu_encoder_kickoff_phys(struct dpu_encoder_virt *dpu_enc,
 		if (!ctl)
 			continue;
 
-		if (phys->split_role != ENC_ROLE_SLAVE)
+		/*
+		 * This is cleared in frame_done worker, which isn't invoked
+		 * for async commits. So don't set this for async, since it'll
+		 * roll over to the next commit.
+		 */
+		if (!async && phys->split_role != ENC_ROLE_SLAVE)
 			set_bit(i, dpu_enc->frame_busy_mask);
+
 		if (!phys->ops.needs_single_flush ||
 				!phys->ops.needs_single_flush(phys))
 			_dpu_encoder_trigger_flush(&dpu_enc->base, phys, 0x0,
@@ -1800,11 +1860,20 @@ void dpu_encoder_kickoff(struct drm_encoder *drm_enc, bool async)
 
 	trace_dpu_enc_kickoff(DRMID(drm_enc));
 
-	atomic_set(&dpu_enc->frame_done_timeout,
-			DPU_FRAME_DONE_TIMEOUT * 1000 /
-			drm_enc->crtc->state->adjusted_mode.vrefresh);
-	mod_timer(&dpu_enc->frame_done_timer, jiffies +
-		((atomic_read(&dpu_enc->frame_done_timeout) * HZ) / 1000));
+	/*
+	 * Asynchronous frames don't handle FRAME_DONE events. As such, they
+	 * shouldn't enable the frame_done watchdog since it will always time
+	 * out.
+	 */
+	if (!async) {
+		unsigned long timeout_ms;
+		timeout_ms = DPU_ENCODER_FRAME_DONE_TIMEOUT_FRAMES * 1000 /
+			drm_mode_vrefresh(&drm_enc->crtc->state->adjusted_mode);
+
+		atomic_set(&dpu_enc->frame_done_timeout_ms, timeout_ms);
+		mod_timer(&dpu_enc->frame_done_timer,
+			  jiffies + msecs_to_jiffies(timeout_ms));
+	}
 
 	/* All phys encs are ready to go, trigger the kickoff */
 	_dpu_encoder_kickoff_phys(dpu_enc, async);
@@ -2124,7 +2193,7 @@ static void dpu_encoder_frame_done_timeout(struct timer_list *t)
 		DRM_DEBUG_KMS("id:%u invalid timeout frame_busy_mask=%lu\n",
 			      DRMID(drm_enc), dpu_enc->frame_busy_mask[0]);
 		return;
-	} else if (!atomic_xchg(&dpu_enc->frame_done_timeout, 0)) {
+	} else if (!atomic_xchg(&dpu_enc->frame_done_timeout_ms, 0)) {
 		DRM_DEBUG_KMS("id:%u invalid timeout\n", DRMID(drm_enc));
 		return;
 	}
@@ -2170,7 +2239,7 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc,
 
 	spin_lock_init(&dpu_enc->enc_spinlock);
 
-	atomic_set(&dpu_enc->frame_done_timeout, 0);
+	atomic_set(&dpu_enc->frame_done_timeout_ms, 0);
 	timer_setup(&dpu_enc->frame_done_timer,
 			dpu_encoder_frame_done_timeout, 0);
 
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h
index db94f3d3bea3..97fb868a4ef6 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h
@@ -200,6 +200,7 @@ struct dpu_encoder_irq {
  * @hw_mdptop:		Hardware interface to the top registers
  * @hw_ctl:		Hardware interface to the ctl registers
  * @hw_pp:		Hardware interface to the ping pong registers
+ * @hw_intf:		Hardware interface to the intf registers
  * @dpu_kms:		Pointer to the dpu_kms top level
  * @cached_mode:	DRM mode cached at mode_set time, acted on in enable
  * @enabled:		Whether the encoder has enabled and running a mode
@@ -228,6 +229,7 @@ struct dpu_encoder_phys {
 	struct dpu_hw_mdp *hw_mdptop;
 	struct dpu_hw_ctl *hw_ctl;
 	struct dpu_hw_pingpong *hw_pp;
+	struct dpu_hw_intf *hw_intf;
 	struct dpu_kms *dpu_kms;
 	struct drm_display_mode cached_mode;
 	enum dpu_enc_split_role split_role;
@@ -250,19 +252,6 @@ static inline int dpu_encoder_phys_inc_pending(struct dpu_encoder_phys *phys)
 	return atomic_inc_return(&phys->pending_kickoff_cnt);
 }
 
-/**
- * struct dpu_encoder_phys_vid - sub-class of dpu_encoder_phys to handle video
- *	mode specific operations
- * @base:	Baseclass physical encoder structure
- * @hw_intf:	Hardware interface to the intf registers
- * @timing_params: Current timing parameter
- */
-struct dpu_encoder_phys_vid {
-	struct dpu_encoder_phys base;
-	struct dpu_hw_intf *hw_intf;
-	struct intf_timing_params timing_params;
-};
-
 /**
  * struct dpu_encoder_phys_cmd - sub-class of dpu_encoder_phys to handle command
  *	mode specific operations
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
index a399e1edd313..973737fb5c9f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
@@ -404,7 +404,8 @@ static void dpu_encoder_phys_cmd_tearcheck_config(
 		return;
 	}
 
-	tc_cfg.vsync_count = vsync_hz / (mode->vtotal * mode->vrefresh);
+	tc_cfg.vsync_count = vsync_hz /
+				(mode->vtotal * drm_mode_vrefresh(mode));
 
 	/* enable external TE after kickoff to avoid premature autorefresh */
 	tc_cfg.hw_vsync_mode = 0;
@@ -424,7 +425,7 @@ static void dpu_encoder_phys_cmd_tearcheck_config(
 	DPU_DEBUG_CMDENC(cmd_enc,
 		"tc %d vsync_clk_speed_hz %u vtotal %u vrefresh %u\n",
 		phys_enc->hw_pp->idx - PINGPONG_0, vsync_hz,
-		mode->vtotal, mode->vrefresh);
+		mode->vtotal, drm_mode_vrefresh(mode));
 	DPU_DEBUG_CMDENC(cmd_enc,
 		"tc %d enable %u start_pos %u rd_ptr_irq %u\n",
 		phys_enc->hw_pp->idx - PINGPONG_0, tc_enable, tc_cfg.start_pos,
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
index 3c4eb470a82c..1b7a335a6140 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
@@ -18,14 +18,14 @@
 #include "dpu_trace.h"
 
 #define DPU_DEBUG_VIDENC(e, fmt, ...) DPU_DEBUG("enc%d intf%d " fmt, \
-		(e) && (e)->base.parent ? \
-		(e)->base.parent->base.id : -1, \
+		(e) && (e)->parent ? \
+		(e)->parent->base.id : -1, \
 		(e) && (e)->hw_intf ? \
 		(e)->hw_intf->idx - INTF_0 : -1, ##__VA_ARGS__)
 
 #define DPU_ERROR_VIDENC(e, fmt, ...) DPU_ERROR("enc%d intf%d " fmt, \
-		(e) && (e)->base.parent ? \
-		(e)->base.parent->base.id : -1, \
+		(e) && (e)->parent ? \
+		(e)->parent->base.id : -1, \
 		(e) && (e)->hw_intf ? \
 		(e)->hw_intf->idx - INTF_0 : -1, ##__VA_ARGS__)
 
@@ -44,7 +44,7 @@ static bool dpu_encoder_phys_vid_is_master(
 }
 
 static void drm_mode_to_intf_timing_params(
-		const struct dpu_encoder_phys_vid *vid_enc,
+		const struct dpu_encoder_phys *phys_enc,
 		const struct drm_display_mode *mode,
 		struct intf_timing_params *timing)
 {
@@ -92,7 +92,7 @@ static void drm_mode_to_intf_timing_params(
 	timing->hsync_skew = mode->hskew;
 
 	/* DSI controller cannot handle active-low sync signals. */
-	if (vid_enc->hw_intf->cap->type == INTF_DSI) {
+	if (phys_enc->hw_intf->cap->type == INTF_DSI) {
 		timing->hsync_polarity = 0;
 		timing->vsync_polarity = 0;
 	}
@@ -143,11 +143,11 @@ static u32 get_vertical_total(const struct intf_timing_params *timing)
  * lines based on the chip worst case latencies.
  */
 static u32 programmable_fetch_get_num_lines(
-		struct dpu_encoder_phys_vid *vid_enc,
+		struct dpu_encoder_phys *phys_enc,
 		const struct intf_timing_params *timing)
 {
 	u32 worst_case_needed_lines =
-	    vid_enc->hw_intf->cap->prog_fetch_lines_worst_case;
+	    phys_enc->hw_intf->cap->prog_fetch_lines_worst_case;
 	u32 start_of_frame_lines =
 	    timing->v_back_porch + timing->vsync_pulse_width;
 	u32 needed_vfp_lines = worst_case_needed_lines - start_of_frame_lines;
@@ -155,26 +155,26 @@ static u32 programmable_fetch_get_num_lines(
 
 	/* Fetch must be outside active lines, otherwise undefined. */
 	if (start_of_frame_lines >= worst_case_needed_lines) {
-		DPU_DEBUG_VIDENC(vid_enc,
+		DPU_DEBUG_VIDENC(phys_enc,
 				"prog fetch is not needed, large vbp+vsw\n");
 		actual_vfp_lines = 0;
 	} else if (timing->v_front_porch < needed_vfp_lines) {
 		/* Warn fetch needed, but not enough porch in panel config */
 		pr_warn_once
 			("low vbp+vfp may lead to perf issues in some cases\n");
-		DPU_DEBUG_VIDENC(vid_enc,
+		DPU_DEBUG_VIDENC(phys_enc,
 				"less vfp than fetch req, using entire vfp\n");
 		actual_vfp_lines = timing->v_front_porch;
 	} else {
-		DPU_DEBUG_VIDENC(vid_enc, "room in vfp for needed prefetch\n");
+		DPU_DEBUG_VIDENC(phys_enc, "room in vfp for needed prefetch\n");
 		actual_vfp_lines = needed_vfp_lines;
 	}
 
-	DPU_DEBUG_VIDENC(vid_enc,
+	DPU_DEBUG_VIDENC(phys_enc,
 		"v_front_porch %u v_back_porch %u vsync_pulse_width %u\n",
 		timing->v_front_porch, timing->v_back_porch,
 		timing->vsync_pulse_width);
-	DPU_DEBUG_VIDENC(vid_enc,
+	DPU_DEBUG_VIDENC(phys_enc,
 		"wc_lines %u needed_vfp_lines %u actual_vfp_lines %u\n",
 		worst_case_needed_lines, needed_vfp_lines, actual_vfp_lines);
 
@@ -194,8 +194,6 @@ static u32 programmable_fetch_get_num_lines(
 static void programmable_fetch_config(struct dpu_encoder_phys *phys_enc,
 				      const struct intf_timing_params *timing)
 {
-	struct dpu_encoder_phys_vid *vid_enc =
-		to_dpu_encoder_phys_vid(phys_enc);
 	struct intf_prog_fetch f = { 0 };
 	u32 vfp_fetch_lines = 0;
 	u32 horiz_total = 0;
@@ -203,10 +201,10 @@ static void programmable_fetch_config(struct dpu_encoder_phys *phys_enc,
 	u32 vfp_fetch_start_vsync_counter = 0;
 	unsigned long lock_flags;
 
-	if (WARN_ON_ONCE(!vid_enc->hw_intf->ops.setup_prg_fetch))
+	if (WARN_ON_ONCE(!phys_enc->hw_intf->ops.setup_prg_fetch))
 		return;
 
-	vfp_fetch_lines = programmable_fetch_get_num_lines(vid_enc, timing);
+	vfp_fetch_lines = programmable_fetch_get_num_lines(phys_enc, timing);
 	if (vfp_fetch_lines) {
 		vert_total = get_vertical_total(timing);
 		horiz_total = get_horizontal_total(timing);
@@ -216,12 +214,12 @@ static void programmable_fetch_config(struct dpu_encoder_phys *phys_enc,
 		f.fetch_start = vfp_fetch_start_vsync_counter;
 	}
 
-	DPU_DEBUG_VIDENC(vid_enc,
+	DPU_DEBUG_VIDENC(phys_enc,
 		"vfp_fetch_lines %u vfp_fetch_start_vsync_counter %u\n",
 		vfp_fetch_lines, vfp_fetch_start_vsync_counter);
 
 	spin_lock_irqsave(phys_enc->enc_spinlock, lock_flags);
-	vid_enc->hw_intf->ops.setup_prg_fetch(vid_enc->hw_intf, &f);
+	phys_enc->hw_intf->ops.setup_prg_fetch(phys_enc->hw_intf, &f);
 	spin_unlock_irqrestore(phys_enc->enc_spinlock, lock_flags);
 }
 
@@ -231,7 +229,7 @@ static bool dpu_encoder_phys_vid_mode_fixup(
 		struct drm_display_mode *adj_mode)
 {
 	if (phys_enc)
-		DPU_DEBUG_VIDENC(to_dpu_encoder_phys_vid(phys_enc), "\n");
+		DPU_DEBUG_VIDENC(phys_enc, "\n");
 
 	/*
 	 * Modifying mode has consequences when the mode comes back to us
@@ -242,7 +240,6 @@ static bool dpu_encoder_phys_vid_mode_fixup(
 static void dpu_encoder_phys_vid_setup_timing_engine(
 		struct dpu_encoder_phys *phys_enc)
 {
-	struct dpu_encoder_phys_vid *vid_enc;
 	struct drm_display_mode mode;
 	struct intf_timing_params timing_params = { 0 };
 	const struct dpu_format *fmt = NULL;
@@ -256,13 +253,12 @@ static void dpu_encoder_phys_vid_setup_timing_engine(
 	}
 
 	mode = phys_enc->cached_mode;
-	vid_enc = to_dpu_encoder_phys_vid(phys_enc);
-	if (!vid_enc->hw_intf->ops.setup_timing_gen) {
+	if (!phys_enc->hw_intf->ops.setup_timing_gen) {
 		DPU_ERROR("timing engine setup is not supported\n");
 		return;
 	}
 
-	DPU_DEBUG_VIDENC(vid_enc, "enabling mode:\n");
+	DPU_DEBUG_VIDENC(phys_enc, "enabling mode:\n");
 	drm_mode_debug_printmodeline(&mode);
 
 	if (phys_enc->split_role != ENC_ROLE_SOLO) {
@@ -271,32 +267,30 @@ static void dpu_encoder_phys_vid_setup_timing_engine(
 		mode.hsync_start >>= 1;
 		mode.hsync_end >>= 1;
 
-		DPU_DEBUG_VIDENC(vid_enc,
+		DPU_DEBUG_VIDENC(phys_enc,
 			"split_role %d, halve horizontal %d %d %d %d\n",
 			phys_enc->split_role,
 			mode.hdisplay, mode.htotal,
 			mode.hsync_start, mode.hsync_end);
 	}
 
-	drm_mode_to_intf_timing_params(vid_enc, &mode, &timing_params);
+	drm_mode_to_intf_timing_params(phys_enc, &mode, &timing_params);
 
 	fmt = dpu_get_dpu_format(fmt_fourcc);
-	DPU_DEBUG_VIDENC(vid_enc, "fmt_fourcc 0x%X\n", fmt_fourcc);
+	DPU_DEBUG_VIDENC(phys_enc, "fmt_fourcc 0x%X\n", fmt_fourcc);
 
-	intf_cfg.intf = vid_enc->hw_intf->idx;
+	intf_cfg.intf = phys_enc->hw_intf->idx;
 	intf_cfg.intf_mode_sel = DPU_CTL_MODE_SEL_VID;
 	intf_cfg.stream_sel = 0; /* Don't care value for video mode */
 	intf_cfg.mode_3d = dpu_encoder_helper_get_3d_blend_mode(phys_enc);
 
 	spin_lock_irqsave(phys_enc->enc_spinlock, lock_flags);
-	vid_enc->hw_intf->ops.setup_timing_gen(vid_enc->hw_intf,
+	phys_enc->hw_intf->ops.setup_timing_gen(phys_enc->hw_intf,
 			&timing_params, fmt);
 	phys_enc->hw_ctl->ops.setup_intf_cfg(phys_enc->hw_ctl, &intf_cfg);
 	spin_unlock_irqrestore(phys_enc->enc_spinlock, lock_flags);
 
 	programmable_fetch_config(phys_enc, &timing_params);
-
-	vid_enc->timing_params = timing_params;
 }
 
 static void dpu_encoder_phys_vid_vblank_irq(void *arg, int irq_idx)
@@ -353,22 +347,10 @@ static void dpu_encoder_phys_vid_underrun_irq(void *arg, int irq_idx)
 			phys_enc);
 }
 
-static bool _dpu_encoder_phys_is_dual_ctl(struct dpu_encoder_phys *phys_enc)
-{
-	struct dpu_crtc_state *dpu_cstate;
-
-	if (!phys_enc)
-		return false;
-
-	dpu_cstate = to_dpu_crtc_state(phys_enc->parent->crtc->state);
-
-	return dpu_cstate->num_ctls > 1;
-}
-
 static bool dpu_encoder_phys_vid_needs_single_flush(
 		struct dpu_encoder_phys *phys_enc)
 {
-	return (phys_enc && _dpu_encoder_phys_is_dual_ctl(phys_enc));
+	return phys_enc->split_role != ENC_ROLE_SOLO;
 }
 
 static void _dpu_encoder_phys_vid_setup_irq_hw_idx(
@@ -396,19 +378,15 @@ static void dpu_encoder_phys_vid_mode_set(
 		struct drm_display_mode *mode,
 		struct drm_display_mode *adj_mode)
 {
-	struct dpu_encoder_phys_vid *vid_enc;
-
 	if (!phys_enc || !phys_enc->dpu_kms) {
 		DPU_ERROR("invalid encoder/kms\n");
 		return;
 	}
 
-	vid_enc = to_dpu_encoder_phys_vid(phys_enc);
-
 	if (adj_mode) {
 		phys_enc->cached_mode = *adj_mode;
 		drm_mode_debug_printmodeline(adj_mode);
-		DPU_DEBUG_VIDENC(vid_enc, "caching mode:\n");
+		DPU_DEBUG_VIDENC(phys_enc, "caching mode:\n");
 	}
 
 	_dpu_encoder_phys_vid_setup_irq_hw_idx(phys_enc);
@@ -419,7 +397,6 @@ static int dpu_encoder_phys_vid_control_vblank_irq(
 		bool enable)
 {
 	int ret = 0;
-	struct dpu_encoder_phys_vid *vid_enc;
 	int refcount;
 
 	if (!phys_enc) {
@@ -428,7 +405,6 @@ static int dpu_encoder_phys_vid_control_vblank_irq(
 	}
 
 	refcount = atomic_read(&phys_enc->vblank_refcount);
-	vid_enc = to_dpu_encoder_phys_vid(phys_enc);
 
 	/* Slave encoders don't report vblank */
 	if (!dpu_encoder_phys_vid_is_master(phys_enc))
@@ -453,7 +429,7 @@ static int dpu_encoder_phys_vid_control_vblank_irq(
 	if (ret) {
 		DRM_ERROR("failed: id:%u intf:%d ret:%d enable:%d refcnt:%d\n",
 			  DRMID(phys_enc->parent),
-			  vid_enc->hw_intf->idx - INTF_0, ret, enable,
+			  phys_enc->hw_intf->idx - INTF_0, ret, enable,
 			  refcount);
 	}
 	return ret;
@@ -461,43 +437,17 @@ static int dpu_encoder_phys_vid_control_vblank_irq(
 
 static void dpu_encoder_phys_vid_enable(struct dpu_encoder_phys *phys_enc)
 {
-	struct msm_drm_private *priv;
-	struct dpu_encoder_phys_vid *vid_enc;
-	struct dpu_rm_hw_iter iter;
 	struct dpu_hw_ctl *ctl;
 	u32 flush_mask = 0;
 
-	if (!phys_enc || !phys_enc->parent || !phys_enc->parent->dev ||
-			!phys_enc->parent->dev->dev_private) {
-		DPU_ERROR("invalid encoder/device\n");
-		return;
-	}
-	priv = phys_enc->parent->dev->dev_private;
-
-	vid_enc = to_dpu_encoder_phys_vid(phys_enc);
 	ctl = phys_enc->hw_ctl;
 
-	dpu_rm_init_hw_iter(&iter, phys_enc->parent->base.id, DPU_HW_BLK_INTF);
-	while (dpu_rm_get_hw(&phys_enc->dpu_kms->rm, &iter)) {
-		struct dpu_hw_intf *hw_intf = (struct dpu_hw_intf *)iter.hw;
-
-		if (hw_intf->idx == phys_enc->intf_idx) {
-			vid_enc->hw_intf = hw_intf;
-			break;
-		}
-	}
-
-	if (!vid_enc->hw_intf) {
-		DPU_ERROR("hw_intf not assigned\n");
-		return;
-	}
-
-	DPU_DEBUG_VIDENC(vid_enc, "\n");
+	DPU_DEBUG_VIDENC(phys_enc, "\n");
 
-	if (WARN_ON(!vid_enc->hw_intf->ops.enable_timing))
+	if (WARN_ON(!phys_enc->hw_intf->ops.enable_timing))
 		return;
 
-	dpu_encoder_helper_split_config(phys_enc, vid_enc->hw_intf->idx);
+	dpu_encoder_helper_split_config(phys_enc, phys_enc->hw_intf->idx);
 
 	dpu_encoder_phys_vid_setup_timing_engine(phys_enc);
 
@@ -510,12 +460,13 @@ static void dpu_encoder_phys_vid_enable(struct dpu_encoder_phys *phys_enc)
 		!dpu_encoder_phys_vid_is_master(phys_enc))
 		goto skip_flush;
 
-	ctl->ops.get_bitmask_intf(ctl, &flush_mask, vid_enc->hw_intf->idx);
+	ctl->ops.get_bitmask_intf(ctl, &flush_mask, phys_enc->hw_intf->idx);
 	ctl->ops.update_pending_flush(ctl, flush_mask);
 
 skip_flush:
-	DPU_DEBUG_VIDENC(vid_enc, "update pending flush ctl %d flush_mask %x\n",
-		ctl->idx - CTL_0, flush_mask);
+	DPU_DEBUG_VIDENC(phys_enc,
+			 "update pending flush ctl %d flush_mask %x\n",
+			 ctl->idx - CTL_0, flush_mask);
 
 	/* ctl_flush & timing engine enable will be triggered by framework */
 	if (phys_enc->enable_state == DPU_ENC_DISABLED)
@@ -524,16 +475,13 @@ static void dpu_encoder_phys_vid_enable(struct dpu_encoder_phys *phys_enc)
 
 static void dpu_encoder_phys_vid_destroy(struct dpu_encoder_phys *phys_enc)
 {
-	struct dpu_encoder_phys_vid *vid_enc;
-
 	if (!phys_enc) {
 		DPU_ERROR("invalid encoder\n");
 		return;
 	}
 
-	vid_enc = to_dpu_encoder_phys_vid(phys_enc);
-	DPU_DEBUG_VIDENC(vid_enc, "\n");
-	kfree(vid_enc);
+	DPU_DEBUG_VIDENC(phys_enc, "\n");
+	kfree(phys_enc);
 }
 
 static void dpu_encoder_phys_vid_get_hw_resources(
@@ -589,7 +537,6 @@ static int dpu_encoder_phys_vid_wait_for_vblank(
 static void dpu_encoder_phys_vid_prepare_for_kickoff(
 		struct dpu_encoder_phys *phys_enc)
 {
-	struct dpu_encoder_phys_vid *vid_enc;
 	struct dpu_hw_ctl *ctl;
 	int rc;
 
@@ -597,7 +544,6 @@ static void dpu_encoder_phys_vid_prepare_for_kickoff(
 		DPU_ERROR("invalid encoder/parameters\n");
 		return;
 	}
-	vid_enc = to_dpu_encoder_phys_vid(phys_enc);
 
 	ctl = phys_enc->hw_ctl;
 	if (!ctl || !ctl->ops.wait_reset_status)
@@ -609,7 +555,7 @@ static void dpu_encoder_phys_vid_prepare_for_kickoff(
 	 */
 	rc = ctl->ops.wait_reset_status(ctl);
 	if (rc) {
-		DPU_ERROR_VIDENC(vid_enc, "ctl %d reset failure: %d\n",
+		DPU_ERROR_VIDENC(phys_enc, "ctl %d reset failure: %d\n",
 				ctl->idx, rc);
 		dpu_encoder_helper_unregister_irq(phys_enc, INTR_IDX_VSYNC);
 	}
@@ -618,7 +564,6 @@ static void dpu_encoder_phys_vid_prepare_for_kickoff(
 static void dpu_encoder_phys_vid_disable(struct dpu_encoder_phys *phys_enc)
 {
 	struct msm_drm_private *priv;
-	struct dpu_encoder_phys_vid *vid_enc;
 	unsigned long lock_flags;
 	int ret;
 
@@ -629,16 +574,13 @@ static void dpu_encoder_phys_vid_disable(struct dpu_encoder_phys *phys_enc)
 	}
 	priv = phys_enc->parent->dev->dev_private;
 
-	vid_enc = to_dpu_encoder_phys_vid(phys_enc);
-	if (!vid_enc->hw_intf || !phys_enc->hw_ctl) {
+	if (!phys_enc->hw_intf || !phys_enc->hw_ctl) {
 		DPU_ERROR("invalid hw_intf %d hw_ctl %d\n",
-				vid_enc->hw_intf != 0, phys_enc->hw_ctl != 0);
+				phys_enc->hw_intf != 0, phys_enc->hw_ctl != 0);
 		return;
 	}
 
-	DPU_DEBUG_VIDENC(vid_enc, "\n");
-
-	if (WARN_ON(!vid_enc->hw_intf->ops.enable_timing))
+	if (WARN_ON(!phys_enc->hw_intf->ops.enable_timing))
 		return;
 
 	if (phys_enc->enable_state == DPU_ENC_DISABLED) {
@@ -647,7 +589,7 @@ static void dpu_encoder_phys_vid_disable(struct dpu_encoder_phys *phys_enc)
 	}
 
 	spin_lock_irqsave(phys_enc->enc_spinlock, lock_flags);
-	vid_enc->hw_intf->ops.enable_timing(vid_enc->hw_intf, 0);
+	phys_enc->hw_intf->ops.enable_timing(phys_enc->hw_intf, 0);
 	if (dpu_encoder_phys_vid_is_master(phys_enc))
 		dpu_encoder_phys_inc_pending(phys_enc);
 	spin_unlock_irqrestore(phys_enc->enc_spinlock, lock_flags);
@@ -666,7 +608,7 @@ static void dpu_encoder_phys_vid_disable(struct dpu_encoder_phys *phys_enc)
 			atomic_set(&phys_enc->pending_kickoff_cnt, 0);
 			DRM_ERROR("wait disable failed: id:%u intf:%d ret:%d\n",
 				  DRMID(phys_enc->parent),
-				  vid_enc->hw_intf->idx - INTF_0, ret);
+				  phys_enc->hw_intf->idx - INTF_0, ret);
 		}
 	}
 
@@ -677,25 +619,21 @@ static void dpu_encoder_phys_vid_handle_post_kickoff(
 		struct dpu_encoder_phys *phys_enc)
 {
 	unsigned long lock_flags;
-	struct dpu_encoder_phys_vid *vid_enc;
 
 	if (!phys_enc) {
 		DPU_ERROR("invalid encoder\n");
 		return;
 	}
 
-	vid_enc = to_dpu_encoder_phys_vid(phys_enc);
-	DPU_DEBUG_VIDENC(vid_enc, "enable_state %d\n", phys_enc->enable_state);
-
 	/*
 	 * Video mode must flush CTL before enabling timing engine
 	 * Video encoders need to turn on their interfaces now
 	 */
 	if (phys_enc->enable_state == DPU_ENC_ENABLING) {
 		trace_dpu_enc_phys_vid_post_kickoff(DRMID(phys_enc->parent),
-				    vid_enc->hw_intf->idx - INTF_0);
+				    phys_enc->hw_intf->idx - INTF_0);
 		spin_lock_irqsave(phys_enc->enc_spinlock, lock_flags);
-		vid_enc->hw_intf->ops.enable_timing(vid_enc->hw_intf, 1);
+		phys_enc->hw_intf->ops.enable_timing(phys_enc->hw_intf, 1);
 		spin_unlock_irqrestore(phys_enc->enc_spinlock, lock_flags);
 		phys_enc->enable_state = DPU_ENC_ENABLED;
 	}
@@ -704,16 +642,13 @@ static void dpu_encoder_phys_vid_handle_post_kickoff(
 static void dpu_encoder_phys_vid_irq_control(struct dpu_encoder_phys *phys_enc,
 		bool enable)
 {
-	struct dpu_encoder_phys_vid *vid_enc;
 	int ret;
 
 	if (!phys_enc)
 		return;
 
-	vid_enc = to_dpu_encoder_phys_vid(phys_enc);
-
 	trace_dpu_enc_phys_vid_irq_ctrl(DRMID(phys_enc->parent),
-			    vid_enc->hw_intf->idx - INTF_0,
+			    phys_enc->hw_intf->idx - INTF_0,
 			    enable,
 			    atomic_read(&phys_enc->vblank_refcount));
 
@@ -732,19 +667,16 @@ static void dpu_encoder_phys_vid_irq_control(struct dpu_encoder_phys *phys_enc,
 static int dpu_encoder_phys_vid_get_line_count(
 		struct dpu_encoder_phys *phys_enc)
 {
-	struct dpu_encoder_phys_vid *vid_enc;
-
 	if (!phys_enc)
 		return -EINVAL;
 
 	if (!dpu_encoder_phys_vid_is_master(phys_enc))
 		return -EINVAL;
 
-	vid_enc = to_dpu_encoder_phys_vid(phys_enc);
-	if (!vid_enc->hw_intf || !vid_enc->hw_intf->ops.get_line_count)
+	if (!phys_enc->hw_intf || !phys_enc->hw_intf->ops.get_line_count)
 		return -EINVAL;
 
-	return vid_enc->hw_intf->ops.get_line_count(vid_enc->hw_intf);
+	return phys_enc->hw_intf->ops.get_line_count(phys_enc->hw_intf);
 }
 
 static void dpu_encoder_phys_vid_init_ops(struct dpu_encoder_phys_ops *ops)
@@ -771,7 +703,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init(
 		struct dpu_enc_phys_init_params *p)
 {
 	struct dpu_encoder_phys *phys_enc = NULL;
-	struct dpu_encoder_phys_vid *vid_enc = NULL;
 	struct dpu_encoder_irq *irq;
 	int i, ret = 0;
 
@@ -780,18 +711,16 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init(
 		goto fail;
 	}
 
-	vid_enc = kzalloc(sizeof(*vid_enc), GFP_KERNEL);
-	if (!vid_enc) {
+	phys_enc = kzalloc(sizeof(*phys_enc), GFP_KERNEL);
+	if (!phys_enc) {
 		ret = -ENOMEM;
 		goto fail;
 	}
 
-	phys_enc = &vid_enc->base;
-
 	phys_enc->hw_mdptop = p->dpu_kms->hw_mdp;
 	phys_enc->intf_idx = p->intf_idx;
 
-	DPU_DEBUG_VIDENC(vid_enc, "\n");
+	DPU_DEBUG_VIDENC(phys_enc, "\n");
 
 	dpu_encoder_phys_vid_init_ops(&phys_enc->ops);
 	phys_enc->parent = p->parent;
@@ -825,13 +754,13 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init(
 	init_waitqueue_head(&phys_enc->pending_kickoff_wq);
 	phys_enc->enable_state = DPU_ENC_DISABLED;
 
-	DPU_DEBUG_VIDENC(vid_enc, "created intf idx:%d\n", p->intf_idx);
+	DPU_DEBUG_VIDENC(phys_enc, "created intf idx:%d\n", p->intf_idx);
 
 	return phys_enc;
 
 fail:
 	DPU_ERROR("failed to create encoder\n");
-	if (vid_enc)
+	if (phys_enc)
 		dpu_encoder_phys_vid_destroy(phys_enc);
 
 	return ERR_PTR(ret);
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
index ac75cfc267f4..31e9ef96ca5d 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
@@ -73,9 +73,6 @@
 
 #define DPU_NAME_SIZE  12
 
-/* timeout in frames waiting for frame done */
-#define DPU_FRAME_DONE_TIMEOUT	60
-
 /*
  * struct dpu_irq_callback - IRQ callback handlers
  * @list: list to callback
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index b01183b309b9..da1f727d7495 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -387,7 +387,7 @@ static void _dpu_plane_set_ot_limit(struct drm_plane *plane,
 	ot_params.width = drm_rect_width(&pdpu->pipe_cfg.src_rect);
 	ot_params.height = drm_rect_height(&pdpu->pipe_cfg.src_rect);
 	ot_params.is_wfd = !pdpu->is_rt_pipe;
-	ot_params.frame_rate = crtc->mode.vrefresh;
+	ot_params.frame_rate = drm_mode_vrefresh(&crtc->mode);
 	ot_params.vbif_idx = VBIF_RT;
 	ot_params.clk_ctrl = pdpu->pipe_hw->cap->clk_ctrl;
 	ot_params.rd = true;
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c
index 9bf9d6065c55..7b9edc21bc2c 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c
@@ -59,10 +59,10 @@ static int pingpong_tearcheck_setup(struct drm_encoder *encoder,
 		return -EINVAL;
 	}
 
-	total_lines_x100 = mode->vtotal * mode->vrefresh;
+	total_lines_x100 = mode->vtotal * drm_mode_vrefresh(mode);
 	if (!total_lines_x100) {
 		DRM_DEV_ERROR(dev, "%s: vtotal(%d) or vrefresh(%d) is 0\n",
-				__func__, mode->vtotal, mode->vrefresh);
+			      __func__, mode->vtotal, drm_mode_vrefresh(mode));
 		return -EINVAL;
 	}
 
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index 18ca651ab942..76940a9da980 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -1026,6 +1026,13 @@ static struct drm_gem_object *_msm_gem_new(struct drm_device *dev,
 		ret = drm_gem_object_init(dev, obj, size);
 		if (ret)
 			goto fail;
+		/*
+		 * Our buffers are kept pinned, so allocating them from the
+		 * MOVABLE zone is a really bad idea, and conflicts with CMA.
+		 * See comments above new_inode() why this is required _and_
+		 * expected if you're going to pin these pages.
+		 */
+		mapping_set_gfp_mask(obj->filp->f_mapping, GFP_HIGHUSER);
 	}
 
 	return obj;
diff --git a/drivers/gpu/drm/msm/msm_gem_vma.c b/drivers/gpu/drm/msm/msm_gem_vma.c
index 49c04829cf34..fcf7a83f0e6f 100644
--- a/drivers/gpu/drm/msm/msm_gem_vma.c
+++ b/drivers/gpu/drm/msm/msm_gem_vma.c
@@ -85,7 +85,7 @@ msm_gem_map_vma(struct msm_gem_address_space *aspace,
 
 	vma->mapped = true;
 
-	if (aspace->mmu)
+	if (aspace && aspace->mmu)
 		ret = aspace->mmu->funcs->map(aspace->mmu, vma->iova, sgt,
 				size, prot);
 
diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iommu.c
index 4d62790cd425..12bb54cefd46 100644
--- a/drivers/gpu/drm/msm/msm_iommu.c
+++ b/drivers/gpu/drm/msm/msm_iommu.c
@@ -38,13 +38,8 @@ static int msm_iommu_attach(struct msm_mmu *mmu, const char * const *names,
 			    int cnt)
 {
 	struct msm_iommu *iommu = to_msm_iommu(mmu);
-	int ret;
 
-	pm_runtime_get_sync(mmu->dev);
-	ret = iommu_attach_device(iommu->domain, mmu->dev);
-	pm_runtime_put_sync(mmu->dev);
-
-	return ret;
+	return iommu_attach_device(iommu->domain, mmu->dev);
 }
 
 static void msm_iommu_detach(struct msm_mmu *mmu, const char * const *names,
@@ -52,9 +47,7 @@ static void msm_iommu_detach(struct msm_mmu *mmu, const char * const *names,
 {
 	struct msm_iommu *iommu = to_msm_iommu(mmu);
 
-	pm_runtime_get_sync(mmu->dev);
 	iommu_detach_device(iommu->domain, mmu->dev);
-	pm_runtime_put_sync(mmu->dev);
 }
 
 static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova,
@@ -63,9 +56,7 @@ static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova,
 	struct msm_iommu *iommu = to_msm_iommu(mmu);
 	size_t ret;
 
-//	pm_runtime_get_sync(mmu->dev);
 	ret = iommu_map_sg(iommu->domain, iova, sgt->sgl, sgt->nents, prot);
-//	pm_runtime_put_sync(mmu->dev);
 	WARN_ON(!ret);
 
 	return (ret == len) ? 0 : -EINVAL;
@@ -75,9 +66,7 @@ static int msm_iommu_unmap(struct msm_mmu *mmu, uint64_t iova, unsigned len)
 {
 	struct msm_iommu *iommu = to_msm_iommu(mmu);
 
-	pm_runtime_get_sync(mmu->dev);
 	iommu_unmap(iommu->domain, iova, len);
-	pm_runtime_put_sync(mmu->dev);
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.c
index d131cca999dd..10f2aa9f29a4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.c
@@ -23,38 +23,55 @@ void pack_hdmi_infoframe(struct packed_hdmi_infoframe *packed_frame,
 		 */
 	case 17:
 		subpack1_high = (raw_frame[16] << 16);
+		/* fall through */
 	case 16:
 		subpack1_high |= (raw_frame[15] << 8);
+		/* fall through */
 	case 15:
 		subpack1_high |= raw_frame[14];
+		/* fall through */
 	case 14:
 		subpack1_low = (raw_frame[13] << 24);
+		/* fall through */
 	case 13:
 		subpack1_low |= (raw_frame[12] << 16);
+		/* fall through */
 	case 12:
 		subpack1_low |= (raw_frame[11] << 8);
+		/* fall through */
 	case 11:
 		subpack1_low |= raw_frame[10];
+		/* fall through */
 	case 10:
 		subpack0_high = (raw_frame[9] << 16);
+		/* fall through */
 	case 9:
 		subpack0_high |= (raw_frame[8] << 8);
+		/* fall through */
 	case 8:
 		subpack0_high |= raw_frame[7];
+		/* fall through */
 	case 7:
 		subpack0_low = (raw_frame[6] << 24);
+		/* fall through */
 	case 6:
 		subpack0_low |= (raw_frame[5] << 16);
+		/* fall through */
 	case 5:
 		subpack0_low |= (raw_frame[4] << 8);
+		/* fall through */
 	case 4:
 		subpack0_low |= raw_frame[3];
+		/* fall through */
 	case 3:
 		header = (raw_frame[2] << 16);
+		/* fall through */
 	case 2:
 		header |= (raw_frame[1] << 8);
+		/* fall through */
 	case 1:
 		header |= raw_frame[0];
+		/* fall through */
 	case 0:
 		break;
 	}
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c
index 49ef7e57aad4..7f1adab21a5f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c
@@ -122,6 +122,7 @@ nv04_dmaobj_new(struct nvkm_dma *dma, const struct nvkm_oclass *oclass,
 		break;
 	case NV_MEM_ACCESS_WO:
 		dmaobj->flags0 |= 0x00008000;
+		/* fall through */
 	case NV_MEM_ACCESS_RW:
 		dmaobj->flags2 |= 0x00000002;
 		break;
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c
index ad707ff176cc..93493b335d76 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c
@@ -117,8 +117,10 @@ nv04_fifo_swmthd(struct nvkm_device *device, u32 chid, u32 addr, u32 data)
 	switch (mthd) {
 	case 0x0000 ... 0x0000: /* subchannel's engine -> software */
 		nvkm_wr32(device, 0x003280, (engine &= ~mask));
+		/* fall through */
 	case 0x0180 ... 0x01fc: /* handle -> instance */
 		data = nvkm_rd32(device, 0x003258) & 0x0000ffff;
+		/* fall through */
 	case 0x0100 ... 0x017c:
 	case 0x0200 ... 0x1ffc: /* pass method down to sw */
 		if (!(engine & mask) && sw)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv40.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv40.c
index 8c7ba32763c4..47c16821c37f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv40.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv40.c
@@ -81,6 +81,7 @@ nv40_fifo_init(struct nvkm_fifo *base)
 	case 0x49:
 	case 0x4b:
 		nvkm_wr32(device, 0x002230, 0x00000001);
+		/* fall through */
 	case 0x40:
 	case 0x41:
 	case 0x42:
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/perf.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/perf.c
index c3068358f695..7112992e0e38 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/perf.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/perf.c
@@ -135,6 +135,7 @@ nvbios_perfEp(struct nvkm_bios *bios, int idx,
 		break;
 	case 0x30:
 		info->script   = nvbios_rd16(bios, perf + 0x02);
+		/* fall through */
 	case 0x35:
 		info->fanspeed = nvbios_rd08(bios, perf + 0x06);
 		info->voltage  = nvbios_rd08(bios, perf + 0x07);
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c
index e6e804cee2bc..bda6cc9a7aaf 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c
@@ -134,6 +134,7 @@ pll_map(struct nvkm_bios *bios)
 		    device->chipset == 0xaa ||
 		    device->chipset == 0xac)
 			return g84_pll_mapping;
+		/* fall through */
 	default:
 		return NULL;
 	}
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
index ba6a868d4c95..40e564524b7a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
@@ -90,6 +90,7 @@ nvkm_cstate_valid(struct nvkm_clk *clk, struct nvkm_cstate *cstate,
 			case NVKM_CLK_BOOST_NONE:
 				if (clk->base_khz && freq > clk->base_khz)
 					return false;
+				/* fall through */
 			case NVKM_CLK_BOOST_BIOS:
 				if (clk->boost_khz && freq > clk->boost_khz)
 					return false;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c
index 1c21b8b53b78..4f000237796f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c
@@ -363,6 +363,7 @@ mcp77_clk_prog(struct nvkm_clk *base)
 	switch (clk->vsrc) {
 	case nv_clk_src_cclk:
 		mast |= 0x00400000;
+		/* fall through */
 	default:
 		nvkm_wr32(device, 0x4600, clk->vdiv);
 	}
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c
index 2b12e388f47a..5f4c287d7943 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c
@@ -131,11 +131,13 @@ nv40_ram_prog(struct nvkm_ram *base)
 		nvkm_mask(device, 0x00402c, 0xc0771100, ram->ctrl);
 		nvkm_wr32(device, 0x004048, ram->coef);
 		nvkm_wr32(device, 0x004030, ram->coef);
+		/* fall through */
 	case 0x43:
 	case 0x49:
 	case 0x4b:
 		nvkm_mask(device, 0x004038, 0xc0771100, ram->ctrl);
 		nvkm_wr32(device, 0x00403c, ram->coef);
+		/* fall through */
 	default:
 		nvkm_mask(device, 0x004020, 0xc0771100, ram->ctrl);
 		nvkm_wr32(device, 0x004024, ram->coef);
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/nv50.c
index 844971e5e874..2a6150ab5611 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/nv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/nv50.c
@@ -159,6 +159,7 @@ mxm_dcb_sanitise_entry(struct nvkm_bios *bios, void *data, int idx, u16 pdcb)
 		break;
 	case 0x0e: /* eDP, falls through to DPint */
 		ctx.outp[1] |= 0x00010000;
+		/* fall through */
 	case 0x07: /* DP internal, wtf is this?? HP8670w */
 		ctx.outp[1] |= 0x00000004; /* use_power_scripts? */
 		type = DCB_CONNECTOR_eDP;
diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c
index ba9b3cfb8c3d..b3436c2aed68 100644
--- a/drivers/gpu/drm/tegra/hub.c
+++ b/drivers/gpu/drm/tegra/hub.c
@@ -378,14 +378,16 @@ static int tegra_shared_plane_atomic_check(struct drm_plane *plane,
 static void tegra_shared_plane_atomic_disable(struct drm_plane *plane,
 					      struct drm_plane_state *old_state)
 {
-	struct tegra_dc *dc = to_tegra_dc(old_state->crtc);
 	struct tegra_plane *p = to_tegra_plane(plane);
+	struct tegra_dc *dc;
 	u32 value;
 
 	/* rien ne va plus */
 	if (!old_state || !old_state->crtc)
 		return;
 
+	dc = to_tegra_dc(old_state->crtc);
+
 	/*
 	 * XXX Legacy helpers seem to sometimes call ->atomic_disable() even
 	 * on planes that are already disabled. Make sure we fallback to the
diff --git a/drivers/gpu/drm/tegra/vic.c b/drivers/gpu/drm/tegra/vic.c
index 39bfed9623de..982ce37ecde1 100644
--- a/drivers/gpu/drm/tegra/vic.c
+++ b/drivers/gpu/drm/tegra/vic.c
@@ -106,6 +106,7 @@ static int vic_boot(struct vic *vic)
 	if (vic->booted)
 		return 0;
 
+#ifdef CONFIG_IOMMU_API
 	if (vic->config->supports_sid) {
 		struct iommu_fwspec *spec = dev_iommu_fwspec_get(vic->dev);
 		u32 value;
@@ -121,6 +122,7 @@ static int vic_boot(struct vic *vic)
 			vic_writel(vic, value, VIC_THI_STREAMID1);
 		}
 	}
+#endif
 
 	/* setup clockgating registers */
 	vic_writel(vic, CG_IDLE_CG_DLY_CNT(4) |
diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index 5930facd6d2d..11a8f99ba18c 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -191,13 +191,9 @@ static struct drm_gem_object *vgem_gem_create(struct drm_device *dev,
 	ret = drm_gem_handle_create(file, &obj->base, handle);
 	drm_gem_object_put_unlocked(&obj->base);
 	if (ret)
-		goto err;
+		return ERR_PTR(ret);
 
 	return &obj->base;
-
-err:
-	__vgem_gem_destroy(obj);
-	return ERR_PTR(ret);
 }
 
 static int vgem_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
diff --git a/drivers/gpu/drm/vkms/vkms_gem.c b/drivers/gpu/drm/vkms/vkms_gem.c
index 138b0bb325cf..69048e73377d 100644
--- a/drivers/gpu/drm/vkms/vkms_gem.c
+++ b/drivers/gpu/drm/vkms/vkms_gem.c
@@ -111,11 +111,8 @@ struct drm_gem_object *vkms_gem_create(struct drm_device *dev,
 
 	ret = drm_gem_handle_create(file, &obj->gem, handle);
 	drm_gem_object_put_unlocked(&obj->gem);
-	if (ret) {
-		drm_gem_object_release(&obj->gem);
-		kfree(obj);
+	if (ret)
 		return ERR_PTR(ret);
-	}
 
 	return &obj->gem;
 }
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 6ca8d322b487..4ca0cdfa6b33 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -150,6 +150,7 @@ config HID_ASUS
 	tristate "Asus"
 	depends on LEDS_CLASS
 	depends on ASUS_WMI || ASUS_WMI=n
+	select POWER_SUPPLY
 	---help---
 	Support for Asus notebook built-in keyboard and touchpad via i2c, and
 	the Asus Republic of Gamers laptop keyboard special keys.
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index 953908f2267c..1148d8c0816a 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -855,7 +855,7 @@ static const struct hid_device_id hid_ignore_list[] = {
 	{ }
 };
 
-/**
+/*
  * hid_mouse_ignore_list - mouse devices which should not be handled by the hid layer
  *
  * There are composite devices for which we want to ignore only a certain
@@ -1042,7 +1042,7 @@ static struct hid_device_id *hid_exists_dquirk(const struct hid_device *hdev)
 	}
 
 	if (bl_entry != NULL)
-		dbg_hid("Found dynamic quirk 0x%lx for HID device 0x%hx:0x%hx\n",
+		dbg_hid("Found dynamic quirk 0x%lx for HID device 0x%04x:0x%04x\n",
 			bl_entry->driver_data, bl_entry->vendor,
 			bl_entry->product);
 
@@ -1209,7 +1209,7 @@ static unsigned long hid_gets_squirk(const struct hid_device *hdev)
 		quirks |= bl_entry->driver_data;
 
 	if (quirks)
-		dbg_hid("Found squirk 0x%lx for HID device 0x%hx:0x%hx\n",
+		dbg_hid("Found squirk 0x%lx for HID device 0x%04x:0x%04x\n",
 			quirks, hdev->vendor, hdev->product);
 	return quirks;
 }
diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c
index 7710d9f957da..0187c9f8fc22 100644
--- a/drivers/hid/hid-uclogic-params.c
+++ b/drivers/hid/hid-uclogic-params.c
@@ -735,10 +735,6 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
 		goto cleanup;
 	}
 	rc = usb_string(udev, 201, ver_ptr, ver_len);
-	if (ver_ptr == NULL) {
-		rc = -ENOMEM;
-		goto cleanup;
-	}
 	if (rc == -EPIPE) {
 		*ver_ptr = '\0';
 	} else if (rc < 0) {
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 6f929bfa9fcd..d0f1dfe2bcbb 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -1759,6 +1759,7 @@ config SENSORS_VT8231
 config SENSORS_W83773G
 	tristate "Nuvoton W83773G"
 	depends on I2C
+	select REGMAP_I2C
 	help
 	  If you say yes here you get support for the Nuvoton W83773G hardware
 	  monitoring chip.
diff --git a/drivers/hwtracing/coresight/coresight-catu.h b/drivers/hwtracing/coresight/coresight-catu.h
index 1b281f0dcccc..1d2ad183fd92 100644
--- a/drivers/hwtracing/coresight/coresight-catu.h
+++ b/drivers/hwtracing/coresight/coresight-catu.h
@@ -109,11 +109,6 @@ static inline bool coresight_is_catu_device(struct coresight_device *csdev)
 	return true;
 }
 
-#ifdef CONFIG_CORESIGHT_CATU
 extern const struct etr_buf_operations etr_catu_buf_ops;
-#else
-/* Dummy declaration for the CATU ops */
-static const struct etr_buf_operations etr_catu_buf_ops;
-#endif
 
 #endif
diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c
index f684283890d3..cf7a32ce209d 100644
--- a/drivers/hwtracing/coresight/coresight-tmc-etr.c
+++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c
@@ -772,7 +772,8 @@ static inline void tmc_etr_disable_catu(struct tmc_drvdata *drvdata)
 static const struct etr_buf_operations *etr_buf_ops[] = {
 	[ETR_MODE_FLAT] = &etr_flat_buf_ops,
 	[ETR_MODE_ETR_SG] = &etr_sg_buf_ops,
-	[ETR_MODE_CATU] = &etr_catu_buf_ops,
+	[ETR_MODE_CATU] = IS_ENABLED(CONFIG_CORESIGHT_CATU)
+						? &etr_catu_buf_ops : NULL,
 };
 
 static inline int tmc_etr_mode_alloc_buf(int mode,
@@ -786,7 +787,7 @@ static inline int tmc_etr_mode_alloc_buf(int mode,
 	case ETR_MODE_FLAT:
 	case ETR_MODE_ETR_SG:
 	case ETR_MODE_CATU:
-		if (etr_buf_ops[mode]->alloc)
+		if (etr_buf_ops[mode] && etr_buf_ops[mode]->alloc)
 			rc = etr_buf_ops[mode]->alloc(drvdata, etr_buf,
 						      node, pages);
 		if (!rc)
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 702bfda7ee77..c639ebce914c 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -1,20 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (C) 2012 Simon Budig, <simon.budig@kernelconcepts.de>
  * Daniel Wagener <daniel.wagener@kernelconcepts.de> (M09 firmware support)
  * Lothar Waßmann <LW@KARO-electronics.de> (DT support)
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /*
@@ -39,7 +27,6 @@
 #include <linux/gpio/consumer.h>
 #include <linux/input/mt.h>
 #include <linux/input/touchscreen.h>
-#include <linux/of_device.h>
 
 #define WORK_REGISTER_THRESHOLD		0x00
 #define WORK_REGISTER_REPORT_RATE	0x08
@@ -1073,7 +1060,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
 		return -ENOMEM;
 	}
 
-	chip_data = of_device_get_match_data(&client->dev);
+	chip_data = device_get_match_data(&client->dev);
 	if (!chip_data)
 		chip_data = (const struct edt_i2c_chip_data *)id->driver_data;
 	if (!chip_data || !chip_data->max_support_points) {
@@ -1254,7 +1241,6 @@ static const struct i2c_device_id edt_ft5x06_ts_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, edt_ft5x06_ts_id);
 
-#ifdef CONFIG_OF
 static const struct of_device_id edt_ft5x06_of_match[] = {
 	{ .compatible = "edt,edt-ft5206", .data = &edt_ft5x06_data },
 	{ .compatible = "edt,edt-ft5306", .data = &edt_ft5x06_data },
@@ -1266,12 +1252,11 @@ static const struct of_device_id edt_ft5x06_of_match[] = {
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, edt_ft5x06_of_match);
-#endif
 
 static struct i2c_driver edt_ft5x06_ts_driver = {
 	.driver = {
 		.name = "edt_ft5x06",
-		.of_match_table = of_match_ptr(edt_ft5x06_of_match),
+		.of_match_table = edt_ft5x06_of_match,
 		.pm = &edt_ft5x06_ts_pm_ops,
 	},
 	.id_table = edt_ft5x06_ts_id,
@@ -1283,4 +1268,4 @@ module_i2c_driver(edt_ft5x06_ts_driver);
 
 MODULE_AUTHOR("Simon Budig <simon.budig@kernelconcepts.de>");
 MODULE_DESCRIPTION("EDT FT5x06 I2C Touchscreen Driver");
-MODULE_LICENSE("GPL");
+MODULE_LICENSE("GPL v2");
diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index 6f07f3b21816..1ca1fa107b21 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -446,4 +446,15 @@ config HYPERV_IOMMU
 	  Stub IOMMU driver to handle IRQs as to allow Hyper-V Linux
 	  guests to run with x2APIC mode enabled.
 
+config VIRTIO_IOMMU
+	bool "Virtio IOMMU driver"
+	depends on VIRTIO=y
+	depends on ARM64
+	select IOMMU_API
+	select INTERVAL_TREE
+	help
+	  Para-virtualised IOMMU driver with virtio.
+
+	  Say Y here if you intend to run this kernel as a guest.
+
 endif # IOMMU_SUPPORT
diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile
index 8c71a15e986b..f13f36ae1af6 100644
--- a/drivers/iommu/Makefile
+++ b/drivers/iommu/Makefile
@@ -33,3 +33,4 @@ obj-$(CONFIG_FSL_PAMU) += fsl_pamu.o fsl_pamu_domain.o
 obj-$(CONFIG_S390_IOMMU) += s390-iommu.o
 obj-$(CONFIG_QCOM_IOMMU) += qcom_iommu.o
 obj-$(CONFIG_HYPERV_IOMMU) += hyperv-iommu.o
+obj-$(CONFIG_VIRTIO_IOMMU) += virtio-iommu.o
diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c
new file mode 100644
index 000000000000..4620dd221ffd
--- /dev/null
+++ b/drivers/iommu/virtio-iommu.c
@@ -0,0 +1,1158 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Virtio driver for the paravirtualized IOMMU
+ *
+ * Copyright (C) 2018 Arm Limited
+ */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/amba/bus.h>
+#include <linux/delay.h>
+#include <linux/dma-iommu.h>
+#include <linux/freezer.h>
+#include <linux/interval_tree.h>
+#include <linux/iommu.h>
+#include <linux/module.h>
+#include <linux/of_iommu.h>
+#include <linux/of_platform.h>
+#include <linux/pci.h>
+#include <linux/platform_device.h>
+#include <linux/virtio.h>
+#include <linux/virtio_config.h>
+#include <linux/virtio_ids.h>
+#include <linux/wait.h>
+
+#include <uapi/linux/virtio_iommu.h>
+
+#define MSI_IOVA_BASE			0x8000000
+#define MSI_IOVA_LENGTH			0x100000
+
+#define VIOMMU_REQUEST_VQ		0
+#define VIOMMU_EVENT_VQ			1
+#define VIOMMU_NR_VQS			2
+
+struct viommu_dev {
+	struct iommu_device		iommu;
+	struct device			*dev;
+	struct virtio_device		*vdev;
+
+	struct ida			domain_ids;
+
+	struct virtqueue		*vqs[VIOMMU_NR_VQS];
+	spinlock_t			request_lock;
+	struct list_head		requests;
+	void				*evts;
+
+	/* Device configuration */
+	struct iommu_domain_geometry	geometry;
+	u64				pgsize_bitmap;
+	u8				domain_bits;
+	u32				probe_size;
+};
+
+struct viommu_mapping {
+	phys_addr_t			paddr;
+	struct interval_tree_node	iova;
+	u32				flags;
+};
+
+struct viommu_domain {
+	struct iommu_domain		domain;
+	struct viommu_dev		*viommu;
+	struct mutex			mutex; /* protects viommu pointer */
+	unsigned int			id;
+
+	spinlock_t			mappings_lock;
+	struct rb_root_cached		mappings;
+
+	unsigned long			nr_endpoints;
+};
+
+struct viommu_endpoint {
+	struct device			*dev;
+	struct viommu_dev		*viommu;
+	struct viommu_domain		*vdomain;
+	struct list_head		resv_regions;
+};
+
+struct viommu_request {
+	struct list_head		list;
+	void				*writeback;
+	unsigned int			write_offset;
+	unsigned int			len;
+	char				buf[];
+};
+
+#define VIOMMU_FAULT_RESV_MASK		0xffffff00
+
+struct viommu_event {
+	union {
+		u32			head;
+		struct virtio_iommu_fault fault;
+	};
+};
+
+#define to_viommu_domain(domain)	\
+	container_of(domain, struct viommu_domain, domain)
+
+static int viommu_get_req_errno(void *buf, size_t len)
+{
+	struct virtio_iommu_req_tail *tail = buf + len - sizeof(*tail);
+
+	switch (tail->status) {
+	case VIRTIO_IOMMU_S_OK:
+		return 0;
+	case VIRTIO_IOMMU_S_UNSUPP:
+		return -ENOSYS;
+	case VIRTIO_IOMMU_S_INVAL:
+		return -EINVAL;
+	case VIRTIO_IOMMU_S_RANGE:
+		return -ERANGE;
+	case VIRTIO_IOMMU_S_NOENT:
+		return -ENOENT;
+	case VIRTIO_IOMMU_S_FAULT:
+		return -EFAULT;
+	case VIRTIO_IOMMU_S_IOERR:
+	case VIRTIO_IOMMU_S_DEVERR:
+	default:
+		return -EIO;
+	}
+}
+
+static void viommu_set_req_status(void *buf, size_t len, int status)
+{
+	struct virtio_iommu_req_tail *tail = buf + len - sizeof(*tail);
+
+	tail->status = status;
+}
+
+static off_t viommu_get_write_desc_offset(struct viommu_dev *viommu,
+					  struct virtio_iommu_req_head *req,
+					  size_t len)
+{
+	size_t tail_size = sizeof(struct virtio_iommu_req_tail);
+
+	if (req->type == VIRTIO_IOMMU_T_PROBE)
+		return len - viommu->probe_size - tail_size;
+
+	return len - tail_size;
+}
+
+/*
+ * __viommu_sync_req - Complete all in-flight requests
+ *
+ * Wait for all added requests to complete. When this function returns, all
+ * requests that were in-flight at the time of the call have completed.
+ */
+static int __viommu_sync_req(struct viommu_dev *viommu)
+{
+	int ret = 0;
+	unsigned int len;
+	size_t write_len;
+	struct viommu_request *req;
+	struct virtqueue *vq = viommu->vqs[VIOMMU_REQUEST_VQ];
+
+	assert_spin_locked(&viommu->request_lock);
+
+	virtqueue_kick(vq);
+
+	while (!list_empty(&viommu->requests)) {
+		len = 0;
+		req = virtqueue_get_buf(vq, &len);
+		if (!req)
+			continue;
+
+		if (!len)
+			viommu_set_req_status(req->buf, req->len,
+					      VIRTIO_IOMMU_S_IOERR);
+
+		write_len = req->len - req->write_offset;
+		if (req->writeback && len == write_len)
+			memcpy(req->writeback, req->buf + req->write_offset,
+			       write_len);
+
+		list_del(&req->list);
+		kfree(req);
+	}
+
+	return ret;
+}
+
+static int viommu_sync_req(struct viommu_dev *viommu)
+{
+	int ret;
+	unsigned long flags;
+
+	spin_lock_irqsave(&viommu->request_lock, flags);
+	ret = __viommu_sync_req(viommu);
+	if (ret)
+		dev_dbg(viommu->dev, "could not sync requests (%d)\n", ret);
+	spin_unlock_irqrestore(&viommu->request_lock, flags);
+
+	return ret;
+}
+
+/*
+ * __viommu_add_request - Add one request to the queue
+ * @buf: pointer to the request buffer
+ * @len: length of the request buffer
+ * @writeback: copy data back to the buffer when the request completes.
+ *
+ * Add a request to the queue. Only synchronize the queue if it's already full.
+ * Otherwise don't kick the queue nor wait for requests to complete.
+ *
+ * When @writeback is true, data written by the device, including the request
+ * status, is copied into @buf after the request completes. This is unsafe if
+ * the caller allocates @buf on stack and drops the lock between add_req() and
+ * sync_req().
+ *
+ * Return 0 if the request was successfully added to the queue.
+ */
+static int __viommu_add_req(struct viommu_dev *viommu, void *buf, size_t len,
+			    bool writeback)
+{
+	int ret;
+	off_t write_offset;
+	struct viommu_request *req;
+	struct scatterlist top_sg, bottom_sg;
+	struct scatterlist *sg[2] = { &top_sg, &bottom_sg };
+	struct virtqueue *vq = viommu->vqs[VIOMMU_REQUEST_VQ];
+
+	assert_spin_locked(&viommu->request_lock);
+
+	write_offset = viommu_get_write_desc_offset(viommu, buf, len);
+	if (write_offset <= 0)
+		return -EINVAL;
+
+	req = kzalloc(sizeof(*req) + len, GFP_ATOMIC);
+	if (!req)
+		return -ENOMEM;
+
+	req->len = len;
+	if (writeback) {
+		req->writeback = buf + write_offset;
+		req->write_offset = write_offset;
+	}
+	memcpy(&req->buf, buf, write_offset);
+
+	sg_init_one(&top_sg, req->buf, write_offset);
+	sg_init_one(&bottom_sg, req->buf + write_offset, len - write_offset);
+
+	ret = virtqueue_add_sgs(vq, sg, 1, 1, req, GFP_ATOMIC);
+	if (ret == -ENOSPC) {
+		/* If the queue is full, sync and retry */
+		if (!__viommu_sync_req(viommu))
+			ret = virtqueue_add_sgs(vq, sg, 1, 1, req, GFP_ATOMIC);
+	}
+	if (ret)
+		goto err_free;
+
+	list_add_tail(&req->list, &viommu->requests);
+	return 0;
+
+err_free:
+	kfree(req);
+	return ret;
+}
+
+static int viommu_add_req(struct viommu_dev *viommu, void *buf, size_t len)
+{
+	int ret;
+	unsigned long flags;
+
+	spin_lock_irqsave(&viommu->request_lock, flags);
+	ret = __viommu_add_req(viommu, buf, len, false);
+	if (ret)
+		dev_dbg(viommu->dev, "could not add request: %d\n", ret);
+	spin_unlock_irqrestore(&viommu->request_lock, flags);
+
+	return ret;
+}
+
+/*
+ * Send a request and wait for it to complete. Return the request status (as an
+ * errno)
+ */
+static int viommu_send_req_sync(struct viommu_dev *viommu, void *buf,
+				size_t len)
+{
+	int ret;
+	unsigned long flags;
+
+	spin_lock_irqsave(&viommu->request_lock, flags);
+
+	ret = __viommu_add_req(viommu, buf, len, true);
+	if (ret) {
+		dev_dbg(viommu->dev, "could not add request (%d)\n", ret);
+		goto out_unlock;
+	}
+
+	ret = __viommu_sync_req(viommu);
+	if (ret) {
+		dev_dbg(viommu->dev, "could not sync requests (%d)\n", ret);
+		/* Fall-through (get the actual request status) */
+	}
+
+	ret = viommu_get_req_errno(buf, len);
+out_unlock:
+	spin_unlock_irqrestore(&viommu->request_lock, flags);
+	return ret;
+}
+
+/*
+ * viommu_add_mapping - add a mapping to the internal tree
+ *
+ * On success, return the new mapping. Otherwise return NULL.
+ */
+static int viommu_add_mapping(struct viommu_domain *vdomain, unsigned long iova,
+			      phys_addr_t paddr, size_t size, u32 flags)
+{
+	unsigned long irqflags;
+	struct viommu_mapping *mapping;
+
+	mapping = kzalloc(sizeof(*mapping), GFP_ATOMIC);
+	if (!mapping)
+		return -ENOMEM;
+
+	mapping->paddr		= paddr;
+	mapping->iova.start	= iova;
+	mapping->iova.last	= iova + size - 1;
+	mapping->flags		= flags;
+
+	spin_lock_irqsave(&vdomain->mappings_lock, irqflags);
+	interval_tree_insert(&mapping->iova, &vdomain->mappings);
+	spin_unlock_irqrestore(&vdomain->mappings_lock, irqflags);
+
+	return 0;
+}
+
+/*
+ * viommu_del_mappings - remove mappings from the internal tree
+ *
+ * @vdomain: the domain
+ * @iova: start of the range
+ * @size: size of the range. A size of 0 corresponds to the entire address
+ *	space.
+ *
+ * On success, returns the number of unmapped bytes (>= size)
+ */
+static size_t viommu_del_mappings(struct viommu_domain *vdomain,
+				  unsigned long iova, size_t size)
+{
+	size_t unmapped = 0;
+	unsigned long flags;
+	unsigned long last = iova + size - 1;
+	struct viommu_mapping *mapping = NULL;
+	struct interval_tree_node *node, *next;
+
+	spin_lock_irqsave(&vdomain->mappings_lock, flags);
+	next = interval_tree_iter_first(&vdomain->mappings, iova, last);
+	while (next) {
+		node = next;
+		mapping = container_of(node, struct viommu_mapping, iova);
+		next = interval_tree_iter_next(node, iova, last);
+
+		/* Trying to split a mapping? */
+		if (mapping->iova.start < iova)
+			break;
+
+		/*
+		 * Virtio-iommu doesn't allow UNMAP to split a mapping created
+		 * with a single MAP request, so remove the full mapping.
+		 */
+		unmapped += mapping->iova.last - mapping->iova.start + 1;
+
+		interval_tree_remove(node, &vdomain->mappings);
+		kfree(mapping);
+	}
+	spin_unlock_irqrestore(&vdomain->mappings_lock, flags);
+
+	return unmapped;
+}
+
+/*
+ * viommu_replay_mappings - re-send MAP requests
+ *
+ * When reattaching a domain that was previously detached from all endpoints,
+ * mappings were deleted from the device. Re-create the mappings available in
+ * the internal tree.
+ */
+static int viommu_replay_mappings(struct viommu_domain *vdomain)
+{
+	int ret = 0;
+	unsigned long flags;
+	struct viommu_mapping *mapping;
+	struct interval_tree_node *node;
+	struct virtio_iommu_req_map map;
+
+	spin_lock_irqsave(&vdomain->mappings_lock, flags);
+	node = interval_tree_iter_first(&vdomain->mappings, 0, -1UL);
+	while (node) {
+		mapping = container_of(node, struct viommu_mapping, iova);
+		map = (struct virtio_iommu_req_map) {
+			.head.type	= VIRTIO_IOMMU_T_MAP,
+			.domain		= cpu_to_le32(vdomain->id),
+			.virt_start	= cpu_to_le64(mapping->iova.start),
+			.virt_end	= cpu_to_le64(mapping->iova.last),
+			.phys_start	= cpu_to_le64(mapping->paddr),
+			.flags		= cpu_to_le32(mapping->flags),
+		};
+
+		ret = viommu_send_req_sync(vdomain->viommu, &map, sizeof(map));
+		if (ret)
+			break;
+
+		node = interval_tree_iter_next(node, 0, -1UL);
+	}
+	spin_unlock_irqrestore(&vdomain->mappings_lock, flags);
+
+	return ret;
+}
+
+static int viommu_add_resv_mem(struct viommu_endpoint *vdev,
+			       struct virtio_iommu_probe_resv_mem *mem,
+			       size_t len)
+{
+	size_t size;
+	u64 start64, end64;
+	phys_addr_t start, end;
+	struct iommu_resv_region *region = NULL;
+	unsigned long prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO;
+
+	start = start64 = le64_to_cpu(mem->start);
+	end = end64 = le64_to_cpu(mem->end);
+	size = end64 - start64 + 1;
+
+	/* Catch any overflow, including the unlikely end64 - start64 + 1 = 0 */
+	if (start != start64 || end != end64 || size < end64 - start64)
+		return -EOVERFLOW;
+
+	if (len < sizeof(*mem))
+		return -EINVAL;
+
+	switch (mem->subtype) {
+	default:
+		dev_warn(vdev->dev, "unknown resv mem subtype 0x%x\n",
+			 mem->subtype);
+		/* Fall-through */
+	case VIRTIO_IOMMU_RESV_MEM_T_RESERVED:
+		region = iommu_alloc_resv_region(start, size, 0,
+						 IOMMU_RESV_RESERVED);
+		break;
+	case VIRTIO_IOMMU_RESV_MEM_T_MSI:
+		region = iommu_alloc_resv_region(start, size, prot,
+						 IOMMU_RESV_MSI);
+		break;
+	}
+	if (!region)
+		return -ENOMEM;
+
+	list_add(&vdev->resv_regions, &region->list);
+	return 0;
+}
+
+static int viommu_probe_endpoint(struct viommu_dev *viommu, struct device *dev)
+{
+	int ret;
+	u16 type, len;
+	size_t cur = 0;
+	size_t probe_len;
+	struct virtio_iommu_req_probe *probe;
+	struct virtio_iommu_probe_property *prop;
+	struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
+	struct viommu_endpoint *vdev = fwspec->iommu_priv;
+
+	if (!fwspec->num_ids)
+		return -EINVAL;
+
+	probe_len = sizeof(*probe) + viommu->probe_size +
+		    sizeof(struct virtio_iommu_req_tail);
+	probe = kzalloc(probe_len, GFP_KERNEL);
+	if (!probe)
+		return -ENOMEM;
+
+	probe->head.type = VIRTIO_IOMMU_T_PROBE;
+	/*
+	 * For now, assume that properties of an endpoint that outputs multiple
+	 * IDs are consistent. Only probe the first one.
+	 */
+	probe->endpoint = cpu_to_le32(fwspec->ids[0]);
+
+	ret = viommu_send_req_sync(viommu, probe, probe_len);
+	if (ret)
+		goto out_free;
+
+	prop = (void *)probe->properties;
+	type = le16_to_cpu(prop->type) & VIRTIO_IOMMU_PROBE_T_MASK;
+
+	while (type != VIRTIO_IOMMU_PROBE_T_NONE &&
+	       cur < viommu->probe_size) {
+		len = le16_to_cpu(prop->length) + sizeof(*prop);
+
+		switch (type) {
+		case VIRTIO_IOMMU_PROBE_T_RESV_MEM:
+			ret = viommu_add_resv_mem(vdev, (void *)prop, len);
+			break;
+		default:
+			dev_err(dev, "unknown viommu prop 0x%x\n", type);
+		}
+
+		if (ret)
+			dev_err(dev, "failed to parse viommu prop 0x%x\n", type);
+
+		cur += len;
+		if (cur >= viommu->probe_size)
+			break;
+
+		prop = (void *)probe->properties + cur;
+		type = le16_to_cpu(prop->type) & VIRTIO_IOMMU_PROBE_T_MASK;
+	}
+
+out_free:
+	kfree(probe);
+	return ret;
+}
+
+static int viommu_fault_handler(struct viommu_dev *viommu,
+				struct virtio_iommu_fault *fault)
+{
+	char *reason_str;
+
+	u8 reason	= fault->reason;
+	u32 flags	= le32_to_cpu(fault->flags);
+	u32 endpoint	= le32_to_cpu(fault->endpoint);
+	u64 address	= le64_to_cpu(fault->address);
+
+	switch (reason) {
+	case VIRTIO_IOMMU_FAULT_R_DOMAIN:
+		reason_str = "domain";
+		break;
+	case VIRTIO_IOMMU_FAULT_R_MAPPING:
+		reason_str = "page";
+		break;
+	case VIRTIO_IOMMU_FAULT_R_UNKNOWN:
+	default:
+		reason_str = "unknown";
+		break;
+	}
+
+	/* TODO: find EP by ID and report_iommu_fault */
+	if (flags & VIRTIO_IOMMU_FAULT_F_ADDRESS)
+		dev_err_ratelimited(viommu->dev, "%s fault from EP %u at %#llx [%s%s%s]\n",
+				    reason_str, endpoint, address,
+				    flags & VIRTIO_IOMMU_FAULT_F_READ ? "R" : "",
+				    flags & VIRTIO_IOMMU_FAULT_F_WRITE ? "W" : "",
+				    flags & VIRTIO_IOMMU_FAULT_F_EXEC ? "X" : "");
+	else
+		dev_err_ratelimited(viommu->dev, "%s fault from EP %u\n",
+				    reason_str, endpoint);
+	return 0;
+}
+
+static void viommu_event_handler(struct virtqueue *vq)
+{
+	int ret;
+	unsigned int len;
+	struct scatterlist sg[1];
+	struct viommu_event *evt;
+	struct viommu_dev *viommu = vq->vdev->priv;
+
+	while ((evt = virtqueue_get_buf(vq, &len)) != NULL) {
+		if (len > sizeof(*evt)) {
+			dev_err(viommu->dev,
+				"invalid event buffer (len %u != %zu)\n",
+				len, sizeof(*evt));
+		} else if (!(evt->head & VIOMMU_FAULT_RESV_MASK)) {
+			viommu_fault_handler(viommu, &evt->fault);
+		}
+
+		sg_init_one(sg, evt, sizeof(*evt));
+		ret = virtqueue_add_inbuf(vq, sg, 1, evt, GFP_ATOMIC);
+		if (ret)
+			dev_err(viommu->dev, "could not add event buffer\n");
+	}
+
+	virtqueue_kick(vq);
+}
+
+/* IOMMU API */
+
+static struct iommu_domain *viommu_domain_alloc(unsigned type)
+{
+	struct viommu_domain *vdomain;
+
+	if (type != IOMMU_DOMAIN_UNMANAGED && type != IOMMU_DOMAIN_DMA)
+		return NULL;
+
+	vdomain = kzalloc(sizeof(*vdomain), GFP_KERNEL);
+	if (!vdomain)
+		return NULL;
+
+	mutex_init(&vdomain->mutex);
+	spin_lock_init(&vdomain->mappings_lock);
+	vdomain->mappings = RB_ROOT_CACHED;
+
+	if (type == IOMMU_DOMAIN_DMA &&
+	    iommu_get_dma_cookie(&vdomain->domain)) {
+		kfree(vdomain);
+		return NULL;
+	}
+
+	return &vdomain->domain;
+}
+
+static int viommu_domain_finalise(struct viommu_dev *viommu,
+				  struct iommu_domain *domain)
+{
+	int ret;
+	struct viommu_domain *vdomain = to_viommu_domain(domain);
+	unsigned int max_domain = viommu->domain_bits > 31 ? ~0 :
+				  (1U << viommu->domain_bits) - 1;
+
+	vdomain->viommu		= viommu;
+
+	domain->pgsize_bitmap	= viommu->pgsize_bitmap;
+	domain->geometry	= viommu->geometry;
+
+	ret = ida_alloc_max(&viommu->domain_ids, max_domain, GFP_KERNEL);
+	if (ret >= 0)
+		vdomain->id = (unsigned int)ret;
+
+	return ret > 0 ? 0 : ret;
+}
+
+static void viommu_domain_free(struct iommu_domain *domain)
+{
+	struct viommu_domain *vdomain = to_viommu_domain(domain);
+
+	iommu_put_dma_cookie(domain);
+
+	/* Free all remaining mappings (size 2^64) */
+	viommu_del_mappings(vdomain, 0, 0);
+
+	if (vdomain->viommu)
+		ida_free(&vdomain->viommu->domain_ids, vdomain->id);
+
+	kfree(vdomain);
+}
+
+static int viommu_attach_dev(struct iommu_domain *domain, struct device *dev)
+{
+	int i;
+	int ret = 0;
+	struct virtio_iommu_req_attach req;
+	struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
+	struct viommu_endpoint *vdev = fwspec->iommu_priv;
+	struct viommu_domain *vdomain = to_viommu_domain(domain);
+
+	mutex_lock(&vdomain->mutex);
+	if (!vdomain->viommu) {
+		/*
+		 * Properly initialize the domain now that we know which viommu
+		 * owns it.
+		 */
+		ret = viommu_domain_finalise(vdev->viommu, domain);
+	} else if (vdomain->viommu != vdev->viommu) {
+		dev_err(dev, "cannot attach to foreign vIOMMU\n");
+		ret = -EXDEV;
+	}
+	mutex_unlock(&vdomain->mutex);
+
+	if (ret)
+		return ret;
+
+	/*
+	 * In the virtio-iommu device, when attaching the endpoint to a new
+	 * domain, it is detached from the old one and, if as as a result the
+	 * old domain isn't attached to any endpoint, all mappings are removed
+	 * from the old domain and it is freed.
+	 *
+	 * In the driver the old domain still exists, and its mappings will be
+	 * recreated if it gets reattached to an endpoint. Otherwise it will be
+	 * freed explicitly.
+	 *
+	 * vdev->vdomain is protected by group->mutex
+	 */
+	if (vdev->vdomain)
+		vdev->vdomain->nr_endpoints--;
+
+	req = (struct virtio_iommu_req_attach) {
+		.head.type	= VIRTIO_IOMMU_T_ATTACH,
+		.domain		= cpu_to_le32(vdomain->id),
+	};
+
+	for (i = 0; i < fwspec->num_ids; i++) {
+		req.endpoint = cpu_to_le32(fwspec->ids[i]);
+
+		ret = viommu_send_req_sync(vdomain->viommu, &req, sizeof(req));
+		if (ret)
+			return ret;
+	}
+
+	if (!vdomain->nr_endpoints) {
+		/*
+		 * This endpoint is the first to be attached to the domain.
+		 * Replay existing mappings (e.g. SW MSI).
+		 */
+		ret = viommu_replay_mappings(vdomain);
+		if (ret)
+			return ret;
+	}
+
+	vdomain->nr_endpoints++;
+	vdev->vdomain = vdomain;
+
+	return 0;
+}
+
+static int viommu_map(struct iommu_domain *domain, unsigned long iova,
+		      phys_addr_t paddr, size_t size, int prot)
+{
+	int ret;
+	int flags;
+	struct virtio_iommu_req_map map;
+	struct viommu_domain *vdomain = to_viommu_domain(domain);
+
+	flags = (prot & IOMMU_READ ? VIRTIO_IOMMU_MAP_F_READ : 0) |
+		(prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) |
+		(prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0);
+
+	ret = viommu_add_mapping(vdomain, iova, paddr, size, flags);
+	if (ret)
+		return ret;
+
+	map = (struct virtio_iommu_req_map) {
+		.head.type	= VIRTIO_IOMMU_T_MAP,
+		.domain		= cpu_to_le32(vdomain->id),
+		.virt_start	= cpu_to_le64(iova),
+		.phys_start	= cpu_to_le64(paddr),
+		.virt_end	= cpu_to_le64(iova + size - 1),
+		.flags		= cpu_to_le32(flags),
+	};
+
+	if (!vdomain->nr_endpoints)
+		return 0;
+
+	ret = viommu_send_req_sync(vdomain->viommu, &map, sizeof(map));
+	if (ret)
+		viommu_del_mappings(vdomain, iova, size);
+
+	return ret;
+}
+
+static size_t viommu_unmap(struct iommu_domain *domain, unsigned long iova,
+			   size_t size)
+{
+	int ret = 0;
+	size_t unmapped;
+	struct virtio_iommu_req_unmap unmap;
+	struct viommu_domain *vdomain = to_viommu_domain(domain);
+
+	unmapped = viommu_del_mappings(vdomain, iova, size);
+	if (unmapped < size)
+		return 0;
+
+	/* Device already removed all mappings after detach. */
+	if (!vdomain->nr_endpoints)
+		return unmapped;
+
+	unmap = (struct virtio_iommu_req_unmap) {
+		.head.type	= VIRTIO_IOMMU_T_UNMAP,
+		.domain		= cpu_to_le32(vdomain->id),
+		.virt_start	= cpu_to_le64(iova),
+		.virt_end	= cpu_to_le64(iova + unmapped - 1),
+	};
+
+	ret = viommu_add_req(vdomain->viommu, &unmap, sizeof(unmap));
+	return ret ? 0 : unmapped;
+}
+
+static phys_addr_t viommu_iova_to_phys(struct iommu_domain *domain,
+				       dma_addr_t iova)
+{
+	u64 paddr = 0;
+	unsigned long flags;
+	struct viommu_mapping *mapping;
+	struct interval_tree_node *node;
+	struct viommu_domain *vdomain = to_viommu_domain(domain);
+
+	spin_lock_irqsave(&vdomain->mappings_lock, flags);
+	node = interval_tree_iter_first(&vdomain->mappings, iova, iova);
+	if (node) {
+		mapping = container_of(node, struct viommu_mapping, iova);
+		paddr = mapping->paddr + (iova - mapping->iova.start);
+	}
+	spin_unlock_irqrestore(&vdomain->mappings_lock, flags);
+
+	return paddr;
+}
+
+static void viommu_iotlb_sync(struct iommu_domain *domain)
+{
+	struct viommu_domain *vdomain = to_viommu_domain(domain);
+
+	viommu_sync_req(vdomain->viommu);
+}
+
+static void viommu_get_resv_regions(struct device *dev, struct list_head *head)
+{
+	struct iommu_resv_region *entry, *new_entry, *msi = NULL;
+	struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
+	struct viommu_endpoint *vdev = fwspec->iommu_priv;
+	int prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO;
+
+	list_for_each_entry(entry, &vdev->resv_regions, list) {
+		if (entry->type == IOMMU_RESV_MSI)
+			msi = entry;
+
+		new_entry = kmemdup(entry, sizeof(*entry), GFP_KERNEL);
+		if (!new_entry)
+			return;
+		list_add_tail(&new_entry->list, head);
+	}
+
+	/*
+	 * If the device didn't register any bypass MSI window, add a
+	 * software-mapped region.
+	 */
+	if (!msi) {
+		msi = iommu_alloc_resv_region(MSI_IOVA_BASE, MSI_IOVA_LENGTH,
+					      prot, IOMMU_RESV_SW_MSI);
+		if (!msi)
+			return;
+
+		list_add_tail(&msi->list, head);
+	}
+
+	iommu_dma_get_resv_regions(dev, head);
+}
+
+static void viommu_put_resv_regions(struct device *dev, struct list_head *head)
+{
+	struct iommu_resv_region *entry, *next;
+
+	list_for_each_entry_safe(entry, next, head, list)
+		kfree(entry);
+}
+
+static struct iommu_ops viommu_ops;
+static struct virtio_driver virtio_iommu_drv;
+
+static int viommu_match_node(struct device *dev, void *data)
+{
+	return dev->parent->fwnode == data;
+}
+
+static struct viommu_dev *viommu_get_by_fwnode(struct fwnode_handle *fwnode)
+{
+	struct device *dev = driver_find_device(&virtio_iommu_drv.driver, NULL,
+						fwnode, viommu_match_node);
+	put_device(dev);
+
+	return dev ? dev_to_virtio(dev)->priv : NULL;
+}
+
+static int viommu_add_device(struct device *dev)
+{
+	int ret;
+	struct iommu_group *group;
+	struct viommu_endpoint *vdev;
+	struct viommu_dev *viommu = NULL;
+	struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
+
+	if (!fwspec || fwspec->ops != &viommu_ops)
+		return -ENODEV;
+
+	viommu = viommu_get_by_fwnode(fwspec->iommu_fwnode);
+	if (!viommu)
+		return -ENODEV;
+
+	vdev = kzalloc(sizeof(*vdev), GFP_KERNEL);
+	if (!vdev)
+		return -ENOMEM;
+
+	vdev->dev = dev;
+	vdev->viommu = viommu;
+	INIT_LIST_HEAD(&vdev->resv_regions);
+	fwspec->iommu_priv = vdev;
+
+	if (viommu->probe_size) {
+		/* Get additional information for this endpoint */
+		ret = viommu_probe_endpoint(viommu, dev);
+		if (ret)
+			goto err_free_dev;
+	}
+
+	ret = iommu_device_link(&viommu->iommu, dev);
+	if (ret)
+		goto err_free_dev;
+
+	/*
+	 * Last step creates a default domain and attaches to it. Everything
+	 * must be ready.
+	 */
+	group = iommu_group_get_for_dev(dev);
+	if (IS_ERR(group)) {
+		ret = PTR_ERR(group);
+		goto err_unlink_dev;
+	}
+
+	iommu_group_put(group);
+
+	return PTR_ERR_OR_ZERO(group);
+
+err_unlink_dev:
+	iommu_device_unlink(&viommu->iommu, dev);
+err_free_dev:
+	viommu_put_resv_regions(dev, &vdev->resv_regions);
+	kfree(vdev);
+
+	return ret;
+}
+
+static void viommu_remove_device(struct device *dev)
+{
+	struct viommu_endpoint *vdev;
+	struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
+
+	if (!fwspec || fwspec->ops != &viommu_ops)
+		return;
+
+	vdev = fwspec->iommu_priv;
+
+	iommu_group_remove_device(dev);
+	iommu_device_unlink(&vdev->viommu->iommu, dev);
+	viommu_put_resv_regions(dev, &vdev->resv_regions);
+	kfree(vdev);
+}
+
+static struct iommu_group *viommu_device_group(struct device *dev)
+{
+	if (dev_is_pci(dev))
+		return pci_device_group(dev);
+	else
+		return generic_device_group(dev);
+}
+
+static int viommu_of_xlate(struct device *dev, struct of_phandle_args *args)
+{
+	return iommu_fwspec_add_ids(dev, args->args, 1);
+}
+
+static struct iommu_ops viommu_ops = {
+	.domain_alloc		= viommu_domain_alloc,
+	.domain_free		= viommu_domain_free,
+	.attach_dev		= viommu_attach_dev,
+	.map			= viommu_map,
+	.unmap			= viommu_unmap,
+	.iova_to_phys		= viommu_iova_to_phys,
+	.iotlb_sync		= viommu_iotlb_sync,
+	.add_device		= viommu_add_device,
+	.remove_device		= viommu_remove_device,
+	.device_group		= viommu_device_group,
+	.get_resv_regions	= viommu_get_resv_regions,
+	.put_resv_regions	= viommu_put_resv_regions,
+	.of_xlate		= viommu_of_xlate,
+};
+
+static int viommu_init_vqs(struct viommu_dev *viommu)
+{
+	struct virtio_device *vdev = dev_to_virtio(viommu->dev);
+	const char *names[] = { "request", "event" };
+	vq_callback_t *callbacks[] = {
+		NULL, /* No async requests */
+		viommu_event_handler,
+	};
+
+	return virtio_find_vqs(vdev, VIOMMU_NR_VQS, viommu->vqs, callbacks,
+			       names, NULL);
+}
+
+static int viommu_fill_evtq(struct viommu_dev *viommu)
+{
+	int i, ret;
+	struct scatterlist sg[1];
+	struct viommu_event *evts;
+	struct virtqueue *vq = viommu->vqs[VIOMMU_EVENT_VQ];
+	size_t nr_evts = vq->num_free;
+
+	viommu->evts = evts = devm_kmalloc_array(viommu->dev, nr_evts,
+						 sizeof(*evts), GFP_KERNEL);
+	if (!evts)
+		return -ENOMEM;
+
+	for (i = 0; i < nr_evts; i++) {
+		sg_init_one(sg, &evts[i], sizeof(*evts));
+		ret = virtqueue_add_inbuf(vq, sg, 1, &evts[i], GFP_KERNEL);
+		if (ret)
+			return ret;
+	}
+
+	return 0;
+}
+
+static int viommu_probe(struct virtio_device *vdev)
+{
+	struct device *parent_dev = vdev->dev.parent;
+	struct viommu_dev *viommu = NULL;
+	struct device *dev = &vdev->dev;
+	u64 input_start = 0;
+	u64 input_end = -1UL;
+	int ret;
+
+	if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1) ||
+	    !virtio_has_feature(vdev, VIRTIO_IOMMU_F_MAP_UNMAP))
+		return -ENODEV;
+
+	viommu = devm_kzalloc(dev, sizeof(*viommu), GFP_KERNEL);
+	if (!viommu)
+		return -ENOMEM;
+
+	spin_lock_init(&viommu->request_lock);
+	ida_init(&viommu->domain_ids);
+	viommu->dev = dev;
+	viommu->vdev = vdev;
+	INIT_LIST_HEAD(&viommu->requests);
+
+	ret = viommu_init_vqs(viommu);
+	if (ret)
+		return ret;
+
+	virtio_cread(vdev, struct virtio_iommu_config, page_size_mask,
+		     &viommu->pgsize_bitmap);
+
+	if (!viommu->pgsize_bitmap) {
+		ret = -EINVAL;
+		goto err_free_vqs;
+	}
+
+	viommu->domain_bits = 32;
+
+	/* Optional features */
+	virtio_cread_feature(vdev, VIRTIO_IOMMU_F_INPUT_RANGE,
+			     struct virtio_iommu_config, input_range.start,
+			     &input_start);
+
+	virtio_cread_feature(vdev, VIRTIO_IOMMU_F_INPUT_RANGE,
+			     struct virtio_iommu_config, input_range.end,
+			     &input_end);
+
+	virtio_cread_feature(vdev, VIRTIO_IOMMU_F_DOMAIN_BITS,
+			     struct virtio_iommu_config, domain_bits,
+			     &viommu->domain_bits);
+
+	virtio_cread_feature(vdev, VIRTIO_IOMMU_F_PROBE,
+			     struct virtio_iommu_config, probe_size,
+			     &viommu->probe_size);
+
+	viommu->geometry = (struct iommu_domain_geometry) {
+		.aperture_start	= input_start,
+		.aperture_end	= input_end,
+		.force_aperture	= true,
+	};
+
+	viommu_ops.pgsize_bitmap = viommu->pgsize_bitmap;
+
+	virtio_device_ready(vdev);
+
+	/* Populate the event queue with buffers */
+	ret = viommu_fill_evtq(viommu);
+	if (ret)
+		goto err_free_vqs;
+
+	ret = iommu_device_sysfs_add(&viommu->iommu, dev, NULL, "%s",
+				     virtio_bus_name(vdev));
+	if (ret)
+		goto err_free_vqs;
+
+	iommu_device_set_ops(&viommu->iommu, &viommu_ops);
+	iommu_device_set_fwnode(&viommu->iommu, parent_dev->fwnode);
+
+	iommu_device_register(&viommu->iommu);
+
+#ifdef CONFIG_PCI
+	if (pci_bus_type.iommu_ops != &viommu_ops) {
+		pci_request_acs();
+		ret = bus_set_iommu(&pci_bus_type, &viommu_ops);
+		if (ret)
+			goto err_unregister;
+	}
+#endif
+#ifdef CONFIG_ARM_AMBA
+	if (amba_bustype.iommu_ops != &viommu_ops) {
+		ret = bus_set_iommu(&amba_bustype, &viommu_ops);
+		if (ret)
+			goto err_unregister;
+	}
+#endif
+	if (platform_bus_type.iommu_ops != &viommu_ops) {
+		ret = bus_set_iommu(&platform_bus_type, &viommu_ops);
+		if (ret)
+			goto err_unregister;
+	}
+
+	vdev->priv = viommu;
+
+	dev_info(dev, "input address: %u bits\n",
+		 order_base_2(viommu->geometry.aperture_end));
+	dev_info(dev, "page mask: %#llx\n", viommu->pgsize_bitmap);
+
+	return 0;
+
+err_unregister:
+	iommu_device_sysfs_remove(&viommu->iommu);
+	iommu_device_unregister(&viommu->iommu);
+err_free_vqs:
+	vdev->config->del_vqs(vdev);
+
+	return ret;
+}
+
+static void viommu_remove(struct virtio_device *vdev)
+{
+	struct viommu_dev *viommu = vdev->priv;
+
+	iommu_device_sysfs_remove(&viommu->iommu);
+	iommu_device_unregister(&viommu->iommu);
+
+	/* Stop all virtqueues */
+	vdev->config->reset(vdev);
+	vdev->config->del_vqs(vdev);
+
+	dev_info(&vdev->dev, "device removed\n");
+}
+
+static void viommu_config_changed(struct virtio_device *vdev)
+{
+	dev_warn(&vdev->dev, "config changed\n");
+}
+
+static unsigned int features[] = {
+	VIRTIO_IOMMU_F_MAP_UNMAP,
+	VIRTIO_IOMMU_F_DOMAIN_BITS,
+	VIRTIO_IOMMU_F_INPUT_RANGE,
+	VIRTIO_IOMMU_F_PROBE,
+};
+
+static struct virtio_device_id id_table[] = {
+	{ VIRTIO_ID_IOMMU, VIRTIO_DEV_ANY_ID },
+	{ 0 },
+};
+
+static struct virtio_driver virtio_iommu_drv = {
+	.driver.name		= KBUILD_MODNAME,
+	.driver.owner		= THIS_MODULE,
+	.id_table		= id_table,
+	.feature_table		= features,
+	.feature_table_size	= ARRAY_SIZE(features),
+	.probe			= viommu_probe,
+	.remove			= viommu_remove,
+	.config_changed		= viommu_config_changed,
+};
+
+module_virtio_driver(virtio_iommu_drv);
+
+MODULE_DESCRIPTION("Virtio IOMMU driver");
+MODULE_AUTHOR("Jean-Philippe Brucker <jean-philippe.brucker@arm.com>");
+MODULE_LICENSE("GPL v2");
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index ba2a37a27a54..fd3110c171ba 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -1089,11 +1089,10 @@ static void gic_init_chip(struct gic_chip_data *gic, struct device *dev,
 #endif
 }
 
-static int gic_init_bases(struct gic_chip_data *gic, int irq_start,
+static int gic_init_bases(struct gic_chip_data *gic,
 			  struct fwnode_handle *handle)
 {
-	irq_hw_number_t hwirq_base;
-	int gic_irqs, irq_base, ret;
+	int gic_irqs, ret;
 
 	if (IS_ENABLED(CONFIG_GIC_NON_BANKED) && gic->percpu_offset) {
 		/* Frankein-GIC without banked registers... */
@@ -1145,28 +1144,21 @@ static int gic_init_bases(struct gic_chip_data *gic, int irq_start,
 	} else {		/* Legacy support */
 		/*
 		 * For primary GICs, skip over SGIs.
-		 * For secondary GICs, skip over PPIs, too.
+		 * No secondary GIC support whatsoever.
 		 */
-		if (gic == &gic_data[0] && (irq_start & 31) > 0) {
-			hwirq_base = 16;
-			if (irq_start != -1)
-				irq_start = (irq_start & ~31) + 16;
-		} else {
-			hwirq_base = 32;
-		}
+		int irq_base;
 
-		gic_irqs -= hwirq_base; /* calculate # of irqs to allocate */
+		gic_irqs -= 16; /* calculate # of irqs to allocate */
 
-		irq_base = irq_alloc_descs(irq_start, 16, gic_irqs,
+		irq_base = irq_alloc_descs(16, 16, gic_irqs,
 					   numa_node_id());
 		if (irq_base < 0) {
-			WARN(1, "Cannot allocate irq_descs @ IRQ%d, assuming pre-allocated\n",
-			     irq_start);
-			irq_base = irq_start;
+			WARN(1, "Cannot allocate irq_descs @ IRQ16, assuming pre-allocated\n");
+			irq_base = 16;
 		}
 
 		gic->domain = irq_domain_add_legacy(NULL, gic_irqs, irq_base,
-					hwirq_base, &gic_irq_domain_ops, gic);
+						    16, &gic_irq_domain_ops, gic);
 	}
 
 	if (WARN_ON(!gic->domain)) {
@@ -1195,7 +1187,6 @@ static int gic_init_bases(struct gic_chip_data *gic, int irq_start,
 }
 
 static int __init __gic_init_bases(struct gic_chip_data *gic,
-				   int irq_start,
 				   struct fwnode_handle *handle)
 {
 	char *name;
@@ -1231,32 +1222,28 @@ static int __init __gic_init_bases(struct gic_chip_data *gic,
 		gic_init_chip(gic, NULL, name, false);
 	}
 
-	ret = gic_init_bases(gic, irq_start, handle);
+	ret = gic_init_bases(gic, handle);
 	if (ret)
 		kfree(name);
 
 	return ret;
 }
 
-void __init gic_init(unsigned int gic_nr, int irq_start,
-		     void __iomem *dist_base, void __iomem *cpu_base)
+void __init gic_init(void __iomem *dist_base, void __iomem *cpu_base)
 {
 	struct gic_chip_data *gic;
 
-	if (WARN_ON(gic_nr >= CONFIG_ARM_GIC_MAX_NR))
-		return;
-
 	/*
 	 * Non-DT/ACPI systems won't run a hypervisor, so let's not
 	 * bother with these...
 	 */
 	static_branch_disable(&supports_deactivate_key);
 
-	gic = &gic_data[gic_nr];
+	gic = &gic_data[0];
 	gic->raw_dist_base = dist_base;
 	gic->raw_cpu_base = cpu_base;
 
-	__gic_init_bases(gic, irq_start, NULL);
+	__gic_init_bases(gic, NULL);
 }
 
 static void gic_teardown(struct gic_chip_data *gic)
@@ -1399,7 +1386,7 @@ int gic_of_init_child(struct device *dev, struct gic_chip_data **gic, int irq)
 	if (ret)
 		return ret;
 
-	ret = gic_init_bases(*gic, -1, &dev->of_node->fwnode);
+	ret = gic_init_bases(*gic, &dev->of_node->fwnode);
 	if (ret) {
 		gic_teardown(*gic);
 		return ret;
@@ -1459,7 +1446,7 @@ gic_of_init(struct device_node *node, struct device_node *parent)
 	if (gic_cnt == 0 && !gic_check_eoimode(node, &gic->raw_cpu_base))
 		static_branch_disable(&supports_deactivate_key);
 
-	ret = __gic_init_bases(gic, -1, &node->fwnode);
+	ret = __gic_init_bases(gic, &node->fwnode);
 	if (ret) {
 		gic_teardown(gic);
 		return ret;
@@ -1650,7 +1637,7 @@ static int __init gic_v2_acpi_init(struct acpi_subtable_header *header,
 		return -ENOMEM;
 	}
 
-	ret = __gic_init_bases(gic, -1, domain_handle);
+	ret = __gic_init_bases(gic, domain_handle);
 	if (ret) {
 		pr_err("Failed to initialise GIC\n");
 		irq_domain_free_fwnode(domain_handle);
diff --git a/drivers/irqchip/irq-imx-irqsteer.c b/drivers/irqchip/irq-imx-irqsteer.c
index d1098f4da6a4..88df3d00052c 100644
--- a/drivers/irqchip/irq-imx-irqsteer.c
+++ b/drivers/irqchip/irq-imx-irqsteer.c
@@ -169,8 +169,12 @@ static int imx_irqsteer_probe(struct platform_device *pdev)
 
 	raw_spin_lock_init(&data->lock);
 
-	of_property_read_u32(np, "fsl,num-irqs", &irqs_num);
-	of_property_read_u32(np, "fsl,channel", &data->channel);
+	ret = of_property_read_u32(np, "fsl,num-irqs", &irqs_num);
+	if (ret)
+		return ret;
+	ret = of_property_read_u32(np, "fsl,channel", &data->channel);
+	if (ret)
+		return ret;
 
 	/*
 	 * There is one output irq for each group of 64 inputs.
diff --git a/drivers/media/platform/sti/delta/delta-ipc.c b/drivers/media/platform/sti/delta/delta-ipc.c
index a4603d573c34..bd1bbbeedec3 100644
--- a/drivers/media/platform/sti/delta/delta-ipc.c
+++ b/drivers/media/platform/sti/delta/delta-ipc.c
@@ -175,8 +175,8 @@ int delta_ipc_open(struct delta_ctx *pctx, const char *name,
 	msg.ipc_buf_size = ipc_buf_size;
 	msg.ipc_buf_paddr = ctx->ipc_buf->paddr;
 
-	memcpy(msg.name, name, sizeof(msg.name));
-	msg.name[sizeof(msg.name) - 1] = 0;
+	memset(msg.name, 0, sizeof(msg.name));
+	strcpy(msg.name, name);
 
 	msg.param_size = param->size;
 	memcpy(ctx->ipc_buf->vaddr, param->data, msg.param_size);
diff --git a/drivers/misc/lkdtm/bugs.c b/drivers/misc/lkdtm/bugs.c
index 7eebbdfbcacd..6176384b4f85 100644
--- a/drivers/misc/lkdtm/bugs.c
+++ b/drivers/misc/lkdtm/bugs.c
@@ -255,3 +255,64 @@ void lkdtm_STACK_GUARD_PAGE_TRAILING(void)
 
 	pr_err("FAIL: accessed page after stack!\n");
 }
+
+void lkdtm_UNSET_SMEP(void)
+{
+#ifdef CONFIG_X86_64
+#define MOV_CR4_DEPTH	64
+	void (*direct_write_cr4)(unsigned long val);
+	unsigned char *insn;
+	unsigned long cr4;
+	int i;
+
+	cr4 = native_read_cr4();
+
+	if ((cr4 & X86_CR4_SMEP) != X86_CR4_SMEP) {
+		pr_err("FAIL: SMEP not in use\n");
+		return;
+	}
+	cr4 &= ~(X86_CR4_SMEP);
+
+	pr_info("trying to clear SMEP normally\n");
+	native_write_cr4(cr4);
+	if (cr4 == native_read_cr4()) {
+		pr_err("FAIL: pinning SMEP failed!\n");
+		cr4 |= X86_CR4_SMEP;
+		pr_info("restoring SMEP\n");
+		native_write_cr4(cr4);
+		return;
+	}
+	pr_info("ok: SMEP did not get cleared\n");
+
+	/*
+	 * To test the post-write pinning verification we need to call
+	 * directly into the the middle of native_write_cr4() where the
+	 * cr4 write happens, skipping the pinning. This searches for
+	 * the cr4 writing instruction.
+	 */
+	insn = (unsigned char *)native_write_cr4;
+	for (i = 0; i < MOV_CR4_DEPTH; i++) {
+		/* mov %rdi, %cr4 */
+		if (insn[i] == 0x0f && insn[i+1] == 0x22 && insn[i+2] == 0xe7)
+			break;
+	}
+	if (i >= MOV_CR4_DEPTH) {
+		pr_info("ok: cannot locate cr4 writing call gadget\n");
+		return;
+	}
+	direct_write_cr4 = (void *)(insn + i);
+
+	pr_info("trying to clear SMEP with call gadget\n");
+	direct_write_cr4(cr4);
+	if (native_read_cr4() & X86_CR4_SMEP) {
+		pr_info("ok: SMEP removal was reverted\n");
+	} else {
+		pr_err("FAIL: cleared SMEP not detected!\n");
+		cr4 |= X86_CR4_SMEP;
+		pr_info("restoring SMEP\n");
+		native_write_cr4(cr4);
+	}
+#else
+	pr_err("FAIL: this test is x86_64-only\n");
+#endif
+}
diff --git a/drivers/misc/lkdtm/core.c b/drivers/misc/lkdtm/core.c
index b51cf182b031..58cfd713f8dc 100644
--- a/drivers/misc/lkdtm/core.c
+++ b/drivers/misc/lkdtm/core.c
@@ -123,6 +123,7 @@ static const struct crashtype crashtypes[] = {
 	CRASHTYPE(CORRUPT_LIST_ADD),
 	CRASHTYPE(CORRUPT_LIST_DEL),
 	CRASHTYPE(CORRUPT_USER_DS),
+	CRASHTYPE(UNSET_SMEP),
 	CRASHTYPE(CORRUPT_STACK),
 	CRASHTYPE(CORRUPT_STACK_STRONG),
 	CRASHTYPE(STACK_GUARD_PAGE_LEADING),
diff --git a/drivers/misc/lkdtm/lkdtm.h b/drivers/misc/lkdtm/lkdtm.h
index b69ee004a3f7..d7eb5a8f1da4 100644
--- a/drivers/misc/lkdtm/lkdtm.h
+++ b/drivers/misc/lkdtm/lkdtm.h
@@ -26,6 +26,7 @@ void lkdtm_CORRUPT_LIST_DEL(void);
 void lkdtm_CORRUPT_USER_DS(void);
 void lkdtm_STACK_GUARD_PAGE_LEADING(void);
 void lkdtm_STACK_GUARD_PAGE_TRAILING(void);
+void lkdtm_UNSET_SMEP(void);
 
 /* lkdtm_heap.c */
 void lkdtm_OVERWRITE_ALLOCATION(void);
diff --git a/drivers/misc/sram-exec.c b/drivers/misc/sram-exec.c
index 426ad912b441..d054e2842a5f 100644
--- a/drivers/misc/sram-exec.c
+++ b/drivers/misc/sram-exec.c
@@ -96,7 +96,7 @@ void *sram_exec_copy(struct gen_pool *pool, void *dst, void *src,
 	if (!part)
 		return NULL;
 
-	if (!addr_in_gen_pool(pool, (unsigned long)dst, size))
+	if (!gen_pool_has_addr(pool, (unsigned long)dst, size))
 		return NULL;
 
 	base = (unsigned long)part->base;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
index 3b0adda7cc9c..a4cd6f2cfb86 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
@@ -1048,6 +1048,8 @@ int qlcnic_do_lb_test(struct qlcnic_adapter *adapter, u8 mode)
 
 	for (i = 0; i < QLCNIC_NUM_ILB_PKT; i++) {
 		skb = netdev_alloc_skb(adapter->netdev, QLCNIC_ILB_PKT_SIZE);
+		if (!skb)
+			break;
 		qlcnic_create_loopback_buff(skb->data, adapter->mac_addr);
 		skb_put(skb, QLCNIC_ILB_PKT_SIZE);
 		adapter->ahw->diag_cnt = 0;
diff --git a/drivers/net/ethernet/realtek/atp.c b/drivers/net/ethernet/realtek/atp.c
index cfb67b746595..58e0ca9093d3 100644
--- a/drivers/net/ethernet/realtek/atp.c
+++ b/drivers/net/ethernet/realtek/atp.c
@@ -482,7 +482,7 @@ static void hardware_init(struct net_device *dev)
 	write_reg_high(ioaddr, IMR, ISRh_RxErr);
 
 	lp->tx_unit_busy = 0;
-    lp->pac_cnt_in_tx_buf = 0;
+	lp->pac_cnt_in_tx_buf = 0;
 	lp->saved_tx_size = 0;
 }
 
diff --git a/drivers/net/ethernet/sis/sis900.c b/drivers/net/ethernet/sis/sis900.c
index 6073387511f8..67f9bb6e941b 100644
--- a/drivers/net/ethernet/sis/sis900.c
+++ b/drivers/net/ethernet/sis/sis900.c
@@ -730,10 +730,10 @@ static u16 sis900_default_phy(struct net_device * net_dev)
 		status = mdio_read(net_dev, phy->phy_addr, MII_STATUS);
 
 		/* Link ON & Not select default PHY & not ghost PHY */
-		 if ((status & MII_STAT_LINK) && !default_phy &&
-					(phy->phy_types != UNKNOWN))
-		 	default_phy = phy;
-		 else {
+		if ((status & MII_STAT_LINK) && !default_phy &&
+		    (phy->phy_types != UNKNOWN)) {
+			default_phy = phy;
+		} else {
 			status = mdio_read(net_dev, phy->phy_addr, MII_CONTROL);
 			mdio_write(net_dev, phy->phy_addr, MII_CONTROL,
 				status | MII_CNTL_AUTO | MII_CNTL_ISOLATE);
@@ -741,7 +741,7 @@ static u16 sis900_default_phy(struct net_device * net_dev)
 				phy_home = phy;
 			else if(phy->phy_types == LAN)
 				phy_lan = phy;
-		 }
+		}
 	}
 
 	if (!default_phy && phy_home)
diff --git a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
index d8c5bc412219..f936166d8910 100644
--- a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
+++ b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
@@ -59,7 +59,7 @@ static int jumbo_frm(void *p, struct sk_buff *skb, int csum)
 
 		desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB);
 		stmmac_prepare_tx_desc(priv, desc, 1, bmax, csum,
-				STMMAC_RING_MODE, 1, false, skb->len);
+				STMMAC_RING_MODE, 0, false, skb->len);
 		tx_q->tx_skbuff[entry] = NULL;
 		entry = STMMAC_GET_ENTRY(entry, DMA_TX_SIZE);
 
@@ -79,7 +79,8 @@ static int jumbo_frm(void *p, struct sk_buff *skb, int csum)
 
 		desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB);
 		stmmac_prepare_tx_desc(priv, desc, 0, len, csum,
-				STMMAC_RING_MODE, 1, true, skb->len);
+				STMMAC_RING_MODE, 1, !skb_is_nonlinear(skb),
+				skb->len);
 	} else {
 		des2 = dma_map_single(priv->device, skb->data,
 				      nopaged_len, DMA_TO_DEVICE);
@@ -91,7 +92,8 @@ static int jumbo_frm(void *p, struct sk_buff *skb, int csum)
 		tx_q->tx_skbuff_dma[entry].is_jumbo = true;
 		desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB);
 		stmmac_prepare_tx_desc(priv, desc, 1, nopaged_len, csum,
-				STMMAC_RING_MODE, 1, true, skb->len);
+				STMMAC_RING_MODE, 0, !skb_is_nonlinear(skb),
+				skb->len);
 	}
 
 	tx_q->cur_tx = entry;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 97c5e1aad88f..6a2e1031a62a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3216,14 +3216,16 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
 		stmmac_prepare_tx_desc(priv, first, 1, nopaged_len,
 				csum_insertion, priv->mode, 1, last_segment,
 				skb->len);
-
-		/* The own bit must be the latest setting done when prepare the
-		 * descriptor and then barrier is needed to make sure that
-		 * all is coherent before granting the DMA engine.
-		 */
-		wmb();
+	} else {
+		stmmac_set_tx_owner(priv, first);
 	}
 
+	/* The own bit must be the latest setting done when prepare the
+	 * descriptor and then barrier is needed to make sure that
+	 * all is coherent before granting the DMA engine.
+	 */
+	wmb();
+
 	netdev_tx_sent_queue(netdev_get_tx_queue(dev, queue), skb->len);
 
 	stmmac_enable_dma_transmission(priv, priv->ioaddr);
diff --git a/drivers/net/phy/meson-gxl.c b/drivers/net/phy/meson-gxl.c
index a238388eb1a5..0eec2913c289 100644
--- a/drivers/net/phy/meson-gxl.c
+++ b/drivers/net/phy/meson-gxl.c
@@ -201,6 +201,7 @@ static int meson_gxl_ack_interrupt(struct phy_device *phydev)
 static int meson_gxl_config_intr(struct phy_device *phydev)
 {
 	u16 val;
+	int ret;
 
 	if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
 		val = INTSRC_ANEG_PR
@@ -213,6 +214,11 @@ static int meson_gxl_config_intr(struct phy_device *phydev)
 		val = 0;
 	}
 
+	/* Ack any pending IRQ */
+	ret = meson_gxl_ack_interrupt(phydev);
+	if (ret)
+		return ret;
+
 	return phy_write(phydev, INTSRC_MASK, val);
 }
 
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 1d68921723dc..e9ca1c088d0b 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1763,9 +1763,6 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
 	int skb_xdp = 1;
 	bool frags = tun_napi_frags_enabled(tfile);
 
-	if (!(tun->dev->flags & IFF_UP))
-		return -EIO;
-
 	if (!(tun->flags & IFF_NO_PI)) {
 		if (len < sizeof(pi))
 			return -EINVAL;
@@ -1867,6 +1864,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
 			err = skb_copy_datagram_from_iter(skb, 0, from, len);
 
 		if (err) {
+			err = -EFAULT;
+drop:
 			this_cpu_inc(tun->pcpu_stats->rx_dropped);
 			kfree_skb(skb);
 			if (frags) {
@@ -1874,7 +1873,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
 				mutex_unlock(&tfile->napi_mutex);
 			}
 
-			return -EFAULT;
+			return err;
 		}
 	}
 
@@ -1958,6 +1957,13 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
 	    !tfile->detached)
 		rxhash = __skb_get_hash_symmetric(skb);
 
+	rcu_read_lock();
+	if (unlikely(!(tun->dev->flags & IFF_UP))) {
+		err = -EIO;
+		rcu_read_unlock();
+		goto drop;
+	}
+
 	if (frags) {
 		/* Exercise flow dissector code path. */
 		u32 headlen = eth_get_headlen(skb->data, skb_headlen(skb));
@@ -1965,6 +1971,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
 		if (unlikely(headlen > skb_headlen(skb))) {
 			this_cpu_inc(tun->pcpu_stats->rx_dropped);
 			napi_free_frags(&tfile->napi);
+			rcu_read_unlock();
 			mutex_unlock(&tfile->napi_mutex);
 			WARN_ON(1);
 			return -ENOMEM;
@@ -1992,6 +1999,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
 	} else {
 		netif_rx_ni(skb);
 	}
+	rcu_read_unlock();
 
 	stats = get_cpu_ptr(tun->pcpu_stats);
 	u64_stats_update_begin(&stats->syncp);
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 7eb38ea9ba56..9010938e2d71 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1362,7 +1362,8 @@ static int virtnet_receive(struct receive_queue *rq, int budget,
 	return stats.packets;
 }
 
-static void free_old_xmit_skbs(struct send_queue *sq, bool in_napi)
+static void free_old_xmit_skbs(struct send_queue *sq, struct netdev_queue *txq,
+			       bool in_napi)
 {
 	unsigned int len;
 	unsigned int packets = 0;
@@ -1392,6 +1393,9 @@ static void free_old_xmit_skbs(struct send_queue *sq, bool in_napi)
 	if (!packets)
 		return;
 
+	if (napi_tx) /* TODO: questionable */
+		netdev_tx_completed_queue(txq, packets, bytes);
+
 	u64_stats_update_begin(&sq->stats.syncp);
 	sq->stats.bytes += bytes;
 	sq->stats.packets += packets;
@@ -1419,7 +1423,7 @@ static void virtnet_poll_cleantx(struct receive_queue *rq)
 		return;
 
 	if (__netif_tx_trylock(txq)) {
-		free_old_xmit_skbs(sq, true);
+		free_old_xmit_skbs(sq, txq, true);
 		__netif_tx_unlock(txq);
 	}
 
@@ -1503,7 +1507,7 @@ static int virtnet_poll_tx(struct napi_struct *napi, int budget)
 
 	txq = netdev_get_tx_queue(vi->dev, index);
 	__netif_tx_lock(txq, raw_smp_processor_id());
-	free_old_xmit_skbs(sq, true);
+	free_old_xmit_skbs(sq, txq, true);
 	__netif_tx_unlock(txq);
 
 	virtqueue_napi_complete(napi, sq->vq, 0);
@@ -1568,13 +1572,15 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
 	struct send_queue *sq = &vi->sq[qnum];
 	int err;
 	struct netdev_queue *txq = netdev_get_tx_queue(dev, qnum);
-	bool kick = !skb->xmit_more;
+	bool more = skb->xmit_more;
 	bool use_napi = sq->napi.weight;
+	unsigned int bytes = skb->len;
+	bool kick;
 
 	/* Free up any pending old buffers before queueing new ones. */
-	free_old_xmit_skbs(sq, false);
+	free_old_xmit_skbs(sq, txq, false);
 
-	if (use_napi && kick)
+	if (use_napi && !more)
 		virtqueue_enable_cb_delayed(sq->vq);
 
 	/* timestamp packet in software */
@@ -1615,7 +1621,7 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
 		if (!use_napi &&
 		    unlikely(!virtqueue_enable_cb_delayed(sq->vq))) {
 			/* More just got used, free them then recheck. */
-			free_old_xmit_skbs(sq, false);
+			free_old_xmit_skbs(sq, txq, false);
 			if (sq->vq->num_free >= 2+MAX_SKB_FRAGS) {
 				netif_start_subqueue(dev, qnum);
 				virtqueue_disable_cb(sq->vq);
@@ -1623,7 +1629,12 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
 		}
 	}
 
-	if (kick || netif_xmit_stopped(txq)) {
+	if (use_napi)
+		kick = __netdev_tx_sent_queue(txq, bytes, more);
+	else
+		kick = !more || netif_xmit_stopped(txq);
+
+	if (kick) {
 		if (virtqueue_kick_prepare(sq->vq) && virtqueue_notify(sq->vq)) {
 			u64_stats_update_begin(&sq->stats.syncp);
 			sq->stats.kicks++;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
index e9822a3ec373..94132cfd1f56 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
@@ -460,9 +460,7 @@ static int iwl_mvm_ftm_range_resp_valid(struct iwl_mvm *mvm, u8 request_id,
 static void iwl_mvm_debug_range_resp(struct iwl_mvm *mvm, u8 index,
 				     struct cfg80211_pmsr_result *res)
 {
-	s64 rtt_avg = res->ftm.rtt_avg * 100;
-
-	do_div(rtt_avg, 6666);
+	s64 rtt_avg = div_s64(res->ftm.rtt_avg * 100, 6666);
 
 	IWL_DEBUG_INFO(mvm, "entry %d\n", index);
 	IWL_DEBUG_INFO(mvm, "\tstatus: %d\n", res->status);
diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c
index 6eedc0ec7661..76629b98c78d 100644
--- a/drivers/net/wireless/mediatek/mt76/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/dma.c
@@ -130,6 +130,8 @@ mt76_dma_tx_cleanup_idx(struct mt76_dev *dev, struct mt76_queue *q, int idx,
 static void
 mt76_dma_sync_idx(struct mt76_dev *dev, struct mt76_queue *q)
 {
+	iowrite32(q->desc_dma, &q->regs->desc_base);
+	iowrite32(q->ndesc, &q->regs->ring_size);
 	q->head = ioread32(&q->regs->dma_idx);
 	q->tail = q->head;
 	iowrite32(q->head, &q->regs->cpu_idx);
@@ -180,7 +182,10 @@ mt76_dma_tx_cleanup(struct mt76_dev *dev, enum mt76_txq_id qid, bool flush)
 	else
 		mt76_dma_sync_idx(dev, q);
 
-	wake = wake && qid < IEEE80211_NUM_ACS && q->queued < q->ndesc - 8;
+	wake = wake && q->stopped &&
+	       qid < IEEE80211_NUM_ACS && q->queued < q->ndesc - 8;
+	if (wake)
+		q->stopped = false;
 
 	if (!q->queued)
 		wake_up(&dev->tx_wait);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index 5dfb0601f101..cb50e96e736b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -126,6 +126,7 @@ struct mt76_queue {
 	int ndesc;
 	int queued;
 	int buf_size;
+	bool stopped;
 
 	u8 buf_offset;
 	u8 hw_idx;
@@ -143,6 +144,7 @@ struct mt76_mcu_ops {
 			 const struct mt76_reg_pair *rp, int len);
 	int (*mcu_rd_rp)(struct mt76_dev *dev, u32 base,
 			 struct mt76_reg_pair *rp, int len);
+	int (*mcu_restart)(struct mt76_dev *dev);
 };
 
 struct mt76_queue_ops {
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/dma.c b/drivers/net/wireless/mediatek/mt76/mt7603/dma.c
index d69e82c66ab2..b3ae0aaea62a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/dma.c
@@ -27,12 +27,16 @@ static void
 mt7603_rx_loopback_skb(struct mt7603_dev *dev, struct sk_buff *skb)
 {
 	__le32 *txd = (__le32 *)skb->data;
+	struct ieee80211_hdr *hdr;
+	struct ieee80211_sta *sta;
 	struct mt7603_sta *msta;
 	struct mt76_wcid *wcid;
+	void *priv;
 	int idx;
 	u32 val;
+	u8 tid;
 
-	if (skb->len < sizeof(MT_TXD_SIZE) + sizeof(struct ieee80211_hdr))
+	if (skb->len < MT_TXD_SIZE + sizeof(struct ieee80211_hdr))
 		goto free;
 
 	val = le32_to_cpu(txd[1]);
@@ -46,10 +50,19 @@ mt7603_rx_loopback_skb(struct mt7603_dev *dev, struct sk_buff *skb)
 	if (!wcid)
 		goto free;
 
-	msta = container_of(wcid, struct mt7603_sta, wcid);
+	priv = msta = container_of(wcid, struct mt7603_sta, wcid);
 	val = le32_to_cpu(txd[0]);
 	skb_set_queue_mapping(skb, FIELD_GET(MT_TXD0_Q_IDX, val));
 
+	val &= ~(MT_TXD0_P_IDX | MT_TXD0_Q_IDX);
+	val |= FIELD_PREP(MT_TXD0_Q_IDX, MT_TX_HW_QUEUE_MGMT);
+	txd[0] = cpu_to_le32(val);
+
+	sta = container_of(priv, struct ieee80211_sta, drv_priv);
+	hdr = (struct ieee80211_hdr *) &skb->data[MT_TXD_SIZE];
+	tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK;
+	ieee80211_sta_set_buffered(sta, tid, true);
+
 	spin_lock_bh(&dev->ps_lock);
 	__skb_queue_tail(&msta->psq, skb);
 	if (skb_queue_len(&msta->psq) >= 64) {
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
index 0a0115861b51..5e31d7da96fc 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
@@ -1072,7 +1072,7 @@ mt7603_fill_txs(struct mt7603_dev *dev, struct mt7603_sta *sta,
 	case MT_PHY_TYPE_HT:
 		final_rate_flags |= IEEE80211_TX_RC_MCS;
 		final_rate &= GENMASK(5, 0);
-		if (i > 15)
+		if (final_rate > 15)
 			return false;
 		break;
 	default:
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/main.c b/drivers/net/wireless/mediatek/mt76/mt7603/main.c
index b10775ed92e6..cc0fe0933b2d 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/main.c
@@ -5,6 +5,7 @@
 #include <linux/pci.h>
 #include <linux/module.h>
 #include "mt7603.h"
+#include "mac.h"
 #include "eeprom.h"
 
 static int
@@ -385,6 +386,15 @@ mt7603_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta, bool ps)
 	mt7603_ps_tx_list(dev, &list);
 }
 
+static void
+mt7603_ps_set_more_data(struct sk_buff *skb)
+{
+	struct ieee80211_hdr *hdr;
+
+	hdr = (struct ieee80211_hdr *) &skb->data[MT_TXD_SIZE];
+	hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_MOREDATA);
+}
+
 static void
 mt7603_release_buffered_frames(struct ieee80211_hw *hw,
 			       struct ieee80211_sta *sta,
@@ -399,6 +409,8 @@ mt7603_release_buffered_frames(struct ieee80211_hw *hw,
 
 	__skb_queue_head_init(&list);
 
+	mt7603_wtbl_set_ps(dev, msta, false);
+
 	spin_lock_bh(&dev->ps_lock);
 	skb_queue_walk_safe(&msta->psq, skb, tmp) {
 		if (!nframes)
@@ -409,11 +421,15 @@ mt7603_release_buffered_frames(struct ieee80211_hw *hw,
 
 		skb_set_queue_mapping(skb, MT_TXQ_PSD);
 		__skb_unlink(skb, &msta->psq);
+		mt7603_ps_set_more_data(skb);
 		__skb_queue_tail(&list, skb);
 		nframes--;
 	}
 	spin_unlock_bh(&dev->ps_lock);
 
+	if (!skb_queue_empty(&list))
+		ieee80211_sta_eosp(sta);
+
 	mt7603_ps_tx_list(dev, &list);
 
 	if (nframes)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/soc.c b/drivers/net/wireless/mediatek/mt76/mt7603/soc.c
index e13fea80d970..b920be1f5718 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/soc.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/soc.c
@@ -23,9 +23,9 @@ mt76_wmac_probe(struct platform_device *pdev)
 	}
 
 	mem_base = devm_ioremap_resource(&pdev->dev, res);
-	if (!mem_base) {
+	if (IS_ERR(mem_base)) {
 		dev_err(&pdev->dev, "Failed to get memory resource\n");
-		return -EINVAL;
+		return PTR_ERR(mem_base);
 	}
 
 	mdev = mt76_alloc_device(&pdev->dev, sizeof(*dev), &mt7603_ops,
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02.h b/drivers/net/wireless/mediatek/mt76/mt76x02.h
index 6915cce5def9..b5a36d9fb2bd 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02.h
@@ -51,6 +51,7 @@ struct mt76x02_calibration {
 	u16 false_cca;
 	s8 avg_rssi_all;
 	s8 agc_gain_adjust;
+	s8 agc_lowest_gain;
 	s8 low_gain;
 
 	s8 temp_vco;
@@ -114,8 +115,11 @@ struct mt76x02_dev {
 	struct mt76x02_dfs_pattern_detector dfs_pd;
 
 	/* edcca monitor */
+	unsigned long ed_trigger_timeout;
 	bool ed_tx_blocked;
 	bool ed_monitor;
+	u8 ed_monitor_enabled;
+	u8 ed_monitor_learning;
 	u8 ed_trigger;
 	u8 ed_silent;
 	ktime_t ed_time;
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_debugfs.c b/drivers/net/wireless/mediatek/mt76/mt76x02_debugfs.c
index 7580c5c986ff..b1d6fd4861e3 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_debugfs.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_debugfs.c
@@ -116,6 +116,32 @@ static int read_agc(struct seq_file *file, void *data)
 	return 0;
 }
 
+static int
+mt76_edcca_set(void *data, u64 val)
+{
+	struct mt76x02_dev *dev = data;
+	enum nl80211_dfs_regions region = dev->dfs_pd.region;
+
+	dev->ed_monitor_enabled = !!val;
+	dev->ed_monitor = dev->ed_monitor_enabled &&
+			  region == NL80211_DFS_ETSI;
+	mt76x02_edcca_init(dev, true);
+
+	return 0;
+}
+
+static int
+mt76_edcca_get(void *data, u64 *val)
+{
+	struct mt76x02_dev *dev = data;
+
+	*val = dev->ed_monitor_enabled;
+	return 0;
+}
+
+DEFINE_DEBUGFS_ATTRIBUTE(fops_edcca, mt76_edcca_get, mt76_edcca_set,
+			 "%lld\n");
+
 void mt76x02_init_debugfs(struct mt76x02_dev *dev)
 {
 	struct dentry *dir;
@@ -127,6 +153,7 @@ void mt76x02_init_debugfs(struct mt76x02_dev *dev)
 	debugfs_create_u8("temperature", 0400, dir, &dev->cal.temp);
 	debugfs_create_bool("tpc", 0600, dir, &dev->enable_tpc);
 
+	debugfs_create_file("edcca", 0400, dir, dev, &fops_edcca);
 	debugfs_create_file("ampdu_stat", 0400, dir, dev, &fops_ampdu_stat);
 	debugfs_create_file("dfs_stats", 0400, dir, dev, &fops_dfs_stat);
 	debugfs_create_devm_seqfile(dev->mt76.dev, "txpower", dir,
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c b/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c
index e4649103efd4..17d12d212d1b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c
@@ -885,7 +885,8 @@ mt76x02_dfs_set_domain(struct mt76x02_dev *dev,
 	if (dfs_pd->region != region) {
 		tasklet_disable(&dfs_pd->dfs_tasklet);
 
-		dev->ed_monitor = region == NL80211_DFS_ETSI;
+		dev->ed_monitor = dev->ed_monitor_enabled &&
+				  region == NL80211_DFS_ETSI;
 		mt76x02_edcca_init(dev, true);
 
 		dfs_pd->region = region;
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
index 91ff6598eccf..9ed231abe916 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
@@ -67,12 +67,39 @@ int mt76x02_mac_shared_key_setup(struct mt76x02_dev *dev, u8 vif_idx,
 }
 EXPORT_SYMBOL_GPL(mt76x02_mac_shared_key_setup);
 
+void mt76x02_mac_wcid_sync_pn(struct mt76x02_dev *dev, u8 idx,
+			      struct ieee80211_key_conf *key)
+{
+	enum mt76x02_cipher_type cipher;
+	u8 key_data[32];
+	u32 iv, eiv;
+	u64 pn;
+
+	cipher = mt76x02_mac_get_key_info(key, key_data);
+	iv = mt76_rr(dev, MT_WCID_IV(idx));
+	eiv = mt76_rr(dev, MT_WCID_IV(idx) + 4);
+
+	pn = (u64)eiv << 16;
+	if (cipher == MT_CIPHER_TKIP) {
+		pn |= (iv >> 16) & 0xff;
+		pn |= (iv & 0xff) << 8;
+	} else if (cipher >= MT_CIPHER_AES_CCMP) {
+		pn |= iv & 0xffff;
+	} else {
+		return;
+	}
+
+	atomic64_set(&key->tx_pn, pn);
+}
+
+
 int mt76x02_mac_wcid_set_key(struct mt76x02_dev *dev, u8 idx,
 			     struct ieee80211_key_conf *key)
 {
 	enum mt76x02_cipher_type cipher;
 	u8 key_data[32];
 	u8 iv_data[8];
+	u64 pn;
 
 	cipher = mt76x02_mac_get_key_info(key, key_data);
 	if (cipher == MT_CIPHER_NONE && key)
@@ -85,9 +112,22 @@ int mt76x02_mac_wcid_set_key(struct mt76x02_dev *dev, u8 idx,
 	if (key) {
 		mt76_rmw_field(dev, MT_WCID_ATTR(idx), MT_WCID_ATTR_PAIRWISE,
 			       !!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE));
+
+		pn = atomic64_read(&key->tx_pn);
+
 		iv_data[3] = key->keyidx << 6;
-		if (cipher >= MT_CIPHER_TKIP)
+		if (cipher >= MT_CIPHER_TKIP) {
 			iv_data[3] |= 0x20;
+			put_unaligned_le32(pn >> 16, &iv_data[4]);
+		}
+
+		if (cipher == MT_CIPHER_TKIP) {
+			iv_data[0] = (pn >> 8) & 0xff;
+			iv_data[1] = (iv_data[0] | 0x20) & 0x7f;
+			iv_data[2] = pn & 0xff;
+		} else if (cipher >= MT_CIPHER_AES_CCMP) {
+			put_unaligned_le16((pn & 0xffff), &iv_data[0]);
+		}
 	}
 
 	mt76_wr_copy(dev, MT_WCID_IV(idx), iv_data, sizeof(iv_data));
@@ -920,6 +960,7 @@ void mt76x02_edcca_init(struct mt76x02_dev *dev, bool enable)
 		}
 	}
 	mt76x02_edcca_tx_enable(dev, true);
+	dev->ed_monitor_learning = true;
 
 	/* clear previous CCA timer value */
 	mt76_rr(dev, MT_ED_CCA_TIMER);
@@ -929,6 +970,10 @@ EXPORT_SYMBOL_GPL(mt76x02_edcca_init);
 
 #define MT_EDCCA_TH		92
 #define MT_EDCCA_BLOCK_TH	2
+#define MT_EDCCA_LEARN_TH	50
+#define MT_EDCCA_LEARN_CCA	180
+#define MT_EDCCA_LEARN_TIMEOUT	(20 * HZ)
+
 static void mt76x02_edcca_check(struct mt76x02_dev *dev)
 {
 	ktime_t cur_time;
@@ -951,11 +996,23 @@ static void mt76x02_edcca_check(struct mt76x02_dev *dev)
 		dev->ed_trigger = 0;
 	}
 
-	if (dev->ed_trigger > MT_EDCCA_BLOCK_TH &&
-	    !dev->ed_tx_blocked)
+	if (dev->cal.agc_lowest_gain &&
+	    dev->cal.false_cca > MT_EDCCA_LEARN_CCA &&
+	    dev->ed_trigger > MT_EDCCA_LEARN_TH) {
+		dev->ed_monitor_learning = false;
+		dev->ed_trigger_timeout = jiffies + 20 * HZ;
+	} else if (!dev->ed_monitor_learning &&
+		   time_is_after_jiffies(dev->ed_trigger_timeout)) {
+		dev->ed_monitor_learning = true;
+		mt76x02_edcca_tx_enable(dev, true);
+	}
+
+	if (dev->ed_monitor_learning)
+		return;
+
+	if (dev->ed_trigger > MT_EDCCA_BLOCK_TH && !dev->ed_tx_blocked)
 		mt76x02_edcca_tx_enable(dev, false);
-	else if (dev->ed_silent > MT_EDCCA_BLOCK_TH &&
-		 dev->ed_tx_blocked)
+	else if (dev->ed_silent > MT_EDCCA_BLOCK_TH && dev->ed_tx_blocked)
 		mt76x02_edcca_tx_enable(dev, true);
 }
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.h b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.h
index 6b1f25d2f64c..caeeef96c42f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.h
@@ -177,6 +177,8 @@ int mt76x02_mac_shared_key_setup(struct mt76x02_dev *dev, u8 vif_idx,
 				 u8 key_idx, struct ieee80211_key_conf *key);
 int mt76x02_mac_wcid_set_key(struct mt76x02_dev *dev, u8 idx,
 			     struct ieee80211_key_conf *key);
+void mt76x02_mac_wcid_sync_pn(struct mt76x02_dev *dev, u8 idx,
+			      struct ieee80211_key_conf *key);
 void mt76x02_mac_wcid_setup(struct mt76x02_dev *dev, u8 idx, u8 vif_idx,
 			    u8 *mac);
 void mt76x02_mac_wcid_set_drop(struct mt76x02_dev *dev, u8 idx, bool drop);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
index 1229f19f2b02..9de015bcd4f9 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
@@ -19,6 +19,7 @@
 #include <linux/irq.h>
 
 #include "mt76x02.h"
+#include "mt76x02_mcu.h"
 #include "mt76x02_trace.h"
 
 struct beacon_bc_data {
@@ -418,9 +419,65 @@ static bool mt76x02_tx_hang(struct mt76x02_dev *dev)
 	return i < 4;
 }
 
+static void mt76x02_key_sync(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+			     struct ieee80211_sta *sta,
+			     struct ieee80211_key_conf *key, void *data)
+{
+	struct mt76x02_dev *dev = hw->priv;
+	struct mt76_wcid *wcid;
+
+	if (!sta)
+	    return;
+
+	wcid = (struct mt76_wcid *) sta->drv_priv;
+
+	if (wcid->hw_key_idx != key->keyidx || wcid->sw_iv)
+	    return;
+
+	mt76x02_mac_wcid_sync_pn(dev, wcid->idx, key);
+}
+
+static void mt76x02_reset_state(struct mt76x02_dev *dev)
+{
+	int i;
+
+	clear_bit(MT76_STATE_RUNNING, &dev->mt76.state);
+
+	rcu_read_lock();
+
+	ieee80211_iter_keys_rcu(dev->mt76.hw, NULL, mt76x02_key_sync, NULL);
+
+	for (i = 0; i < ARRAY_SIZE(dev->mt76.wcid); i++) {
+		struct mt76_wcid *wcid = rcu_dereference(dev->mt76.wcid[i]);
+		struct mt76x02_sta *msta;
+		struct ieee80211_sta *sta;
+		struct ieee80211_vif *vif;
+		void *priv;
+
+		if (!wcid)
+			continue;
+
+		priv = msta = container_of(wcid, struct mt76x02_sta, wcid);
+		sta = container_of(priv, struct ieee80211_sta, drv_priv);
+
+		priv = msta->vif;
+		vif = container_of(priv, struct ieee80211_vif, drv_priv);
+
+		mt76_sta_state(dev->mt76.hw, vif, sta,
+			       IEEE80211_STA_NONE, IEEE80211_STA_NOTEXIST);
+		memset(msta, 0, sizeof(*msta));
+	}
+
+	rcu_read_unlock();
+
+	dev->vif_mask = 0;
+	dev->beacon_mask = 0;
+}
+
 static void mt76x02_watchdog_reset(struct mt76x02_dev *dev)
 {
 	u32 mask = dev->mt76.mmio.irqmask;
+	bool restart = dev->mt76.mcu_ops->mcu_restart;
 	int i;
 
 	ieee80211_stop_queues(dev->mt76.hw);
@@ -432,6 +489,9 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev)
 	for (i = 0; i < ARRAY_SIZE(dev->mt76.napi); i++)
 		napi_disable(&dev->mt76.napi[i]);
 
+	if (restart)
+		mt76x02_reset_state(dev);
+
 	mutex_lock(&dev->mt76.mutex);
 
 	if (dev->beacon_mask)
@@ -452,20 +512,21 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev)
 	/* let fw reset DMA */
 	mt76_set(dev, 0x734, 0x3);
 
+	if (restart)
+		dev->mt76.mcu_ops->mcu_restart(&dev->mt76);
+
 	for (i = 0; i < ARRAY_SIZE(dev->mt76.q_tx); i++)
 		mt76_queue_tx_cleanup(dev, i, true);
 
 	for (i = 0; i < ARRAY_SIZE(dev->mt76.q_rx); i++)
 		mt76_queue_rx_reset(dev, i);
 
-	mt76_wr(dev, MT_MAC_SYS_CTRL,
-		MT_MAC_SYS_CTRL_ENABLE_TX | MT_MAC_SYS_CTRL_ENABLE_RX);
-	mt76_set(dev, MT_WPDMA_GLO_CFG,
-		 MT_WPDMA_GLO_CFG_TX_DMA_EN | MT_WPDMA_GLO_CFG_RX_DMA_EN);
+	mt76x02_mac_start(dev);
+
 	if (dev->ed_monitor)
 		mt76_set(dev, MT_TXOP_CTRL_CFG, MT_TXOP_ED_CCA_EN);
 
-	if (dev->beacon_mask)
+	if (dev->beacon_mask && !restart)
 		mt76_set(dev, MT_BEACON_TIME_CFG,
 			 MT_BEACON_TIME_CFG_BEACON_TX |
 			 MT_BEACON_TIME_CFG_TBTT_EN);
@@ -486,9 +547,13 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev)
 		napi_schedule(&dev->mt76.napi[i]);
 	}
 
-	ieee80211_wake_queues(dev->mt76.hw);
-
-	mt76_txq_schedule_all(&dev->mt76);
+	if (restart) {
+		mt76x02_mcu_function_select(dev, Q_SELECT, 1);
+		ieee80211_restart_hw(dev->mt76.hw);
+	} else {
+		ieee80211_wake_queues(dev->mt76.hw);
+		mt76_txq_schedule_all(&dev->mt76);
+	}
 }
 
 static void mt76x02_check_tx_hang(struct mt76x02_dev *dev)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_phy.c b/drivers/net/wireless/mediatek/mt76/mt76x02_phy.c
index a020c757ba5c..a54b63a96eae 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_phy.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_phy.c
@@ -194,6 +194,8 @@ bool mt76x02_phy_adjust_vga_gain(struct mt76x02_dev *dev)
 		ret = true;
 	}
 
+	dev->cal.agc_lowest_gain = dev->cal.agc_gain_adjust >= limit;
+
 	return ret;
 }
 EXPORT_SYMBOL_GPL(mt76x02_phy_adjust_vga_gain);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c b/drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c
index 43f07461c8d3..6fb52b596d42 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c
@@ -85,8 +85,9 @@ int mt76x02u_tx_prepare_skb(struct mt76_dev *mdev, void *data,
 
 	mt76x02_insert_hdr_pad(skb);
 
-	txwi = skb_push(skb, sizeof(struct mt76x02_txwi));
+	txwi = (struct mt76x02_txwi *)(skb->data - sizeof(struct mt76x02_txwi));
 	mt76x02_mac_write_txwi(dev, txwi, skb, wcid, sta, len);
+	skb_push(skb, sizeof(struct mt76x02_txwi));
 
 	pid = mt76_tx_status_skb_add(mdev, wcid, skb);
 	txwi->pktid = pid;
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
index a48c261b0c63..cd072ac614f7 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
@@ -237,6 +237,8 @@ int mt76x02_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
 	struct mt76x02_vif *mvif = (struct mt76x02_vif *)vif->drv_priv;
 	int idx = 0;
 
+	memset(msta, 0, sizeof(*msta));
+
 	idx = mt76_wcid_alloc(dev->mt76.wcid_mask, ARRAY_SIZE(dev->mt76.wcid));
 	if (idx < 0)
 		return -ENOSPC;
@@ -274,6 +276,8 @@ mt76x02_vif_init(struct mt76x02_dev *dev, struct ieee80211_vif *vif,
 	struct mt76x02_vif *mvif = (struct mt76x02_vif *)vif->drv_priv;
 	struct mt76_txq *mtxq;
 
+	memset(mvif, 0, sizeof(*mvif));
+
 	mvif->idx = idx;
 	mvif->group_wcid.idx = MT_VIF_WCID(idx);
 	mvif->group_wcid.hw_key_idx = -1;
@@ -289,6 +293,12 @@ mt76x02_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 	struct mt76x02_dev *dev = hw->priv;
 	unsigned int idx = 0;
 
+	/* Allow to change address in HW if we create first interface. */
+	if (!dev->vif_mask &&
+	    (((vif->addr[0] ^ dev->mt76.macaddr[0]) & ~GENMASK(4, 1)) ||
+	     memcmp(vif->addr + 1, dev->mt76.macaddr + 1, ETH_ALEN - 1)))
+		mt76x02_mac_setaddr(dev, vif->addr);
+
 	if (vif->addr[0] & BIT(1))
 		idx = 1 + (((dev->mt76.macaddr[0] ^ vif->addr[0]) >> 2) & 7);
 
@@ -311,10 +321,6 @@ mt76x02_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 	if (dev->vif_mask & BIT(idx))
 		return -EBUSY;
 
-	/* Allow to change address in HW if we create first interface. */
-	if (!dev->vif_mask && !ether_addr_equal(dev->mt76.macaddr, vif->addr))
-                mt76x02_mac_setaddr(dev, vif->addr);
-
 	dev->vif_mask |= BIT(idx);
 
 	mt76x02_vif_init(dev, vif, idx);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2.h b/drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2.h
index 6c619f1c65c9..d7abe3d73bad 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2.h
@@ -71,6 +71,7 @@ int mt76x2_mcu_load_cr(struct mt76x02_dev *dev, u8 type, u8 temp_level,
 
 void mt76x2_cleanup(struct mt76x02_dev *dev);
 
+int mt76x2_mac_reset(struct mt76x02_dev *dev, bool hard);
 void mt76x2_reset_wlan(struct mt76x02_dev *dev, bool enable);
 void mt76x2_init_txpower(struct mt76x02_dev *dev,
 			 struct ieee80211_supported_band *sband);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c
index 984d9c4c2e1a..d3927a13e92e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c
@@ -77,7 +77,7 @@ mt76x2_fixup_xtal(struct mt76x02_dev *dev)
 	}
 }
 
-static int mt76x2_mac_reset(struct mt76x02_dev *dev, bool hard)
+int mt76x2_mac_reset(struct mt76x02_dev *dev, bool hard)
 {
 	const u8 *macaddr = dev->mt76.macaddr;
 	u32 val;
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mcu.c
index 03e24ae7f66c..605dc66ae83b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mcu.c
@@ -165,9 +165,30 @@ mt76pci_load_firmware(struct mt76x02_dev *dev)
 	return -ENOENT;
 }
 
+static int
+mt76pci_mcu_restart(struct mt76_dev *mdev)
+{
+	struct mt76x02_dev *dev;
+	int ret;
+
+	dev = container_of(mdev, struct mt76x02_dev, mt76);
+
+	mt76x02_mcu_cleanup(dev);
+	mt76x2_mac_reset(dev, true);
+
+	ret = mt76pci_load_firmware(dev);
+	if (ret)
+		return ret;
+
+	mt76_wr(dev, MT_WPDMA_RST_IDX, ~0);
+
+	return 0;
+}
+
 int mt76x2_mcu_init(struct mt76x02_dev *dev)
 {
 	static const struct mt76_mcu_ops mt76x2_mcu_ops = {
+		.mcu_restart = mt76pci_mcu_restart,
 		.mcu_send_msg = mt76x02_mcu_msg_send,
 	};
 	int ret;
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/phy.c b/drivers/net/wireless/mediatek/mt76/mt76x2/phy.c
index 1848e8ab2e21..769a9b972044 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/phy.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/phy.c
@@ -260,10 +260,15 @@ mt76x2_phy_set_gain_val(struct mt76x02_dev *dev)
 	gain_val[0] = dev->cal.agc_gain_cur[0] - dev->cal.agc_gain_adjust;
 	gain_val[1] = dev->cal.agc_gain_cur[1] - dev->cal.agc_gain_adjust;
 
-	if (dev->mt76.chandef.width >= NL80211_CHAN_WIDTH_40)
+	val = 0x1836 << 16;
+	if (!mt76x2_has_ext_lna(dev) &&
+	    dev->mt76.chandef.width >= NL80211_CHAN_WIDTH_40)
 		val = 0x1e42 << 16;
-	else
-		val = 0x1836 << 16;
+
+	if (mt76x2_has_ext_lna(dev) &&
+	    dev->mt76.chandef.chan->band == NL80211_BAND_2GHZ &&
+	    dev->mt76.chandef.width < NL80211_CHAN_WIDTH_40)
+		val = 0x0f36 << 16;
 
 	val |= 0xf8;
 
@@ -280,6 +285,7 @@ void mt76x2_phy_update_channel_gain(struct mt76x02_dev *dev)
 {
 	u8 *gain = dev->cal.agc_gain_init;
 	u8 low_gain_delta, gain_delta;
+	u32 agc_35, agc_37;
 	bool gain_change;
 	int low_gain;
 	u32 val;
@@ -318,6 +324,16 @@ void mt76x2_phy_update_channel_gain(struct mt76x02_dev *dev)
 	else
 		low_gain_delta = 14;
 
+	agc_37 = 0x2121262c;
+	if (dev->mt76.chandef.chan->band == NL80211_BAND_2GHZ)
+		agc_35 = 0x11111516;
+	else if (low_gain == 2)
+		agc_35 = agc_37 = 0x08080808;
+	else if (dev->mt76.chandef.width == NL80211_CHAN_WIDTH_80)
+		agc_35 = 0x10101014;
+	else
+		agc_35 = 0x11111116;
+
 	if (low_gain == 2) {
 		mt76_wr(dev, MT_BBP(RXO, 18), 0xf000a990);
 		mt76_wr(dev, MT_BBP(AGC, 35), 0x08080808);
@@ -326,15 +342,13 @@ void mt76x2_phy_update_channel_gain(struct mt76x02_dev *dev)
 		dev->cal.agc_gain_adjust = 0;
 	} else {
 		mt76_wr(dev, MT_BBP(RXO, 18), 0xf000a991);
-		if (dev->mt76.chandef.width == NL80211_CHAN_WIDTH_80)
-			mt76_wr(dev, MT_BBP(AGC, 35), 0x10101014);
-		else
-			mt76_wr(dev, MT_BBP(AGC, 35), 0x11111116);
-		mt76_wr(dev, MT_BBP(AGC, 37), 0x2121262C);
 		gain_delta = 0;
 		dev->cal.agc_gain_adjust = low_gain_delta;
 	}
 
+	mt76_wr(dev, MT_BBP(AGC, 35), agc_35);
+	mt76_wr(dev, MT_BBP(AGC, 37), agc_37);
+
 	dev->cal.agc_gain_cur[0] = gain[0] - gain_delta;
 	dev->cal.agc_gain_cur[1] = gain[1] - gain_delta;
 	mt76x2_phy_set_gain_val(dev);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
index ddb6b2c48e01..7a5d539873ca 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
@@ -21,11 +21,10 @@
 #include "mt76x2u.h"
 
 static const struct usb_device_id mt76x2u_device_table[] = {
-	{ USB_DEVICE(0x0e8d, 0x7612) }, /* Alfa AWUS036ACM */
 	{ USB_DEVICE(0x0b05, 0x1833) },	/* Asus USB-AC54 */
 	{ USB_DEVICE(0x0b05, 0x17eb) },	/* Asus USB-AC55 */
 	{ USB_DEVICE(0x0b05, 0x180b) },	/* Asus USB-N53 B1 */
-	{ USB_DEVICE(0x0e8d, 0x7612) },	/* Aukey USB-AC1200 */
+	{ USB_DEVICE(0x0e8d, 0x7612) },	/* Aukey USBAC1200 - Alfa AWUS036ACM */
 	{ USB_DEVICE(0x057c, 0x8503) },	/* Avm FRITZ!WLAN AC860 */
 	{ USB_DEVICE(0x7392, 0xb711) },	/* Edimax EW 7722 UAC */
 	{ USB_DEVICE(0x0846, 0x9053) },	/* Netgear A6210 */
diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c
index 5a349fe3e576..2585df512335 100644
--- a/drivers/net/wireless/mediatek/mt76/tx.c
+++ b/drivers/net/wireless/mediatek/mt76/tx.c
@@ -289,8 +289,11 @@ mt76_tx(struct mt76_dev *dev, struct ieee80211_sta *sta,
 	dev->queue_ops->tx_queue_skb(dev, q, skb, wcid, sta);
 	dev->queue_ops->kick(dev, q);
 
-	if (q->queued > q->ndesc - 8)
+	if (q->queued > q->ndesc - 8 && !q->stopped) {
 		ieee80211_stop_queue(dev->hw, skb_get_queue_mapping(skb));
+		q->stopped = true;
+	}
+
 	spin_unlock_bh(&q->lock);
 }
 EXPORT_SYMBOL_GPL(mt76_tx);
@@ -374,7 +377,10 @@ mt76_release_buffered_frames(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
 	if (last_skb) {
 		mt76_queue_ps_skb(dev, sta, last_skb, true);
 		dev->queue_ops->kick(dev, hwq);
+	} else {
+		ieee80211_sta_eosp(sta);
 	}
+
 	spin_unlock_bh(&hwq->lock);
 }
 EXPORT_SYMBOL_GPL(mt76_release_buffered_frames);
@@ -577,6 +583,9 @@ void mt76_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
 	struct mt76_txq *mtxq = (struct mt76_txq *) txq->drv_priv;
 	struct mt76_queue *hwq = mtxq->hwq;
 
+	if (!test_bit(MT76_STATE_RUNNING, &dev->state))
+		return;
+
 	spin_lock_bh(&hwq->lock);
 	if (list_empty(&mtxq->list))
 		list_add_tail(&mtxq->list, &hwq->swq);
diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c
index ae6ada370597..4c1abd492405 100644
--- a/drivers/net/wireless/mediatek/mt76/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/usb.c
@@ -655,7 +655,11 @@ static void mt76u_tx_tasklet(unsigned long data)
 			spin_lock_bh(&q->lock);
 		}
 		mt76_txq_schedule(dev, q);
-		wake = i < IEEE80211_NUM_ACS && q->queued < q->ndesc - 8;
+
+		wake = q->stopped && q->queued < q->ndesc - 8;
+		if (wake)
+			q->stopped = false;
+
 		if (!q->queued)
 			wake_up(&dev->tx_wait);
 
diff --git a/drivers/nfc/fdp/fdp.c b/drivers/nfc/fdp/fdp.c
index d5784a47fc13..6b5aba8c8937 100644
--- a/drivers/nfc/fdp/fdp.c
+++ b/drivers/nfc/fdp/fdp.c
@@ -192,8 +192,8 @@ static int fdp_nci_send_patch(struct nci_dev *ndev, u8 conn_id, u8 type)
 	const struct firmware *fw;
 	struct sk_buff *skb;
 	unsigned long len;
-	u8 max_size, payload_size;
-	int rc = 0;
+	u8 payload_size;
+	int max_size, rc = 0;
 
 	if ((type == NCI_PATCH_TYPE_OTP && !info->otp_patch) ||
 	    (type == NCI_PATCH_TYPE_RAM && !info->ram_patch))
@@ -247,9 +247,6 @@ static int fdp_nci_open(struct nci_dev *ndev)
 {
 	int r;
 	struct fdp_nci_info *info = nci_get_drvdata(ndev);
-	struct device *dev = &info->phy->i2c_dev->dev;
-
-	dev_dbg(dev, "%s\n", __func__);
 
 	r = info->phy_ops->enable(info->phy);
 
@@ -258,19 +255,12 @@ static int fdp_nci_open(struct nci_dev *ndev)
 
 static int fdp_nci_close(struct nci_dev *ndev)
 {
-	struct fdp_nci_info *info = nci_get_drvdata(ndev);
-	struct device *dev = &info->phy->i2c_dev->dev;
-
-	dev_dbg(dev, "%s\n", __func__);
 	return 0;
 }
 
 static int fdp_nci_send(struct nci_dev *ndev, struct sk_buff *skb)
 {
 	struct fdp_nci_info *info = nci_get_drvdata(ndev);
-	struct device *dev = &info->phy->i2c_dev->dev;
-
-	dev_dbg(dev, "%s\n", __func__);
 
 	if (atomic_dec_and_test(&info->data_pkt_counter))
 		info->data_pkt_counter_cb(ndev);
@@ -280,10 +270,6 @@ static int fdp_nci_send(struct nci_dev *ndev, struct sk_buff *skb)
 
 int fdp_nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb)
 {
-	struct fdp_nci_info *info = nci_get_drvdata(ndev);
-	struct device *dev = &info->phy->i2c_dev->dev;
-
-	dev_dbg(dev, "%s\n", __func__);
 	return nci_recv_frame(ndev, skb);
 }
 EXPORT_SYMBOL(fdp_nci_recv_frame);
@@ -498,8 +484,6 @@ static int fdp_nci_setup(struct nci_dev *ndev)
 	int r;
 	u8 patched = 0;
 
-	dev_dbg(dev, "%s\n", __func__);
-
 	r = nci_core_init(ndev);
 	if (r)
 		goto error;
@@ -607,9 +591,7 @@ static int fdp_nci_core_reset_ntf_packet(struct nci_dev *ndev,
 					  struct sk_buff *skb)
 {
 	struct fdp_nci_info *info = nci_get_drvdata(ndev);
-	struct device *dev = &info->phy->i2c_dev->dev;
 
-	dev_dbg(dev, "%s\n", __func__);
 	info->setup_reset_ntf = 1;
 	wake_up(&info->setup_wq);
 
@@ -620,9 +602,7 @@ static int fdp_nci_prop_patch_ntf_packet(struct nci_dev *ndev,
 					  struct sk_buff *skb)
 {
 	struct fdp_nci_info *info = nci_get_drvdata(ndev);
-	struct device *dev = &info->phy->i2c_dev->dev;
 
-	dev_dbg(dev, "%s\n", __func__);
 	info->setup_patch_ntf = 1;
 	info->setup_patch_status = skb->data[0];
 	wake_up(&info->setup_wq);
@@ -637,7 +617,7 @@ static int fdp_nci_prop_patch_rsp_packet(struct nci_dev *ndev,
 	struct device *dev = &info->phy->i2c_dev->dev;
 	u8 status = skb->data[0];
 
-	dev_dbg(dev, "%s: status 0x%x\n", __func__, status);
+	dev_dbg(dev, "status 0x%x\n", status);
 	nci_req_complete(ndev, status);
 
 	return 0;
@@ -650,7 +630,7 @@ static int fdp_nci_prop_set_production_data_rsp_packet(struct nci_dev *ndev,
 	struct device *dev = &info->phy->i2c_dev->dev;
 	u8 status = skb->data[0];
 
-	dev_dbg(dev, "%s: status 0x%x\n", __func__, status);
+	dev_dbg(dev, "status 0x%x\n", status);
 	nci_req_complete(ndev, status);
 
 	return 0;
@@ -695,7 +675,7 @@ static int fdp_nci_core_get_config_rsp_packet(struct nci_dev *ndev,
 	dev_dbg(dev, "OTP version %d\n", info->otp_version);
 	dev_dbg(dev, "RAM version %d\n", info->ram_version);
 	dev_dbg(dev, "key index %d\n", info->key_index);
-	dev_dbg(dev, "%s: status 0x%x\n", __func__, rsp->status);
+	dev_dbg(dev, "status 0x%x\n", rsp->status);
 
 	nci_req_complete(ndev, rsp->status);
 
@@ -795,11 +775,6 @@ EXPORT_SYMBOL(fdp_nci_probe);
 
 void fdp_nci_remove(struct nci_dev *ndev)
 {
-	struct fdp_nci_info *info = nci_get_drvdata(ndev);
-	struct device *dev = &info->phy->i2c_dev->dev;
-
-	dev_dbg(dev, "%s\n", __func__);
-
 	nci_unregister_device(ndev);
 	nci_free_device(ndev);
 }
diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c
index d8d70dd830b0..70a970c7375c 100644
--- a/drivers/nfc/fdp/i2c.c
+++ b/drivers/nfc/fdp/i2c.c
@@ -57,7 +57,6 @@ static int fdp_nci_i2c_enable(void *phy_id)
 {
 	struct fdp_i2c_phy *phy = phy_id;
 
-	dev_dbg(&phy->i2c_dev->dev, "%s\n", __func__);
 	fdp_nci_i2c_reset(phy);
 
 	return 0;
@@ -67,7 +66,6 @@ static void fdp_nci_i2c_disable(void *phy_id)
 {
 	struct fdp_i2c_phy *phy = phy_id;
 
-	dev_dbg(&phy->i2c_dev->dev, "%s\n", __func__);
 	fdp_nci_i2c_reset(phy);
 }
 
@@ -113,8 +111,8 @@ static int fdp_nci_i2c_write(void *phy_id, struct sk_buff *skb)
 	}
 
 	if (r < 0 || r != skb->len)
-		dev_dbg(&client->dev, "%s: error err=%d len=%d\n",
-			__func__, r, skb->len);
+		dev_dbg(&client->dev, "error err=%d len=%d\n",
+			r, skb->len);
 
 	if (r >= 0) {
 		if (r != skb->len) {
@@ -152,8 +150,7 @@ static int fdp_nci_i2c_read(struct fdp_i2c_phy *phy, struct sk_buff **skb)
 
 		r = i2c_master_recv(client, tmp, len);
 		if (r != len) {
-			dev_dbg(&client->dev, "%s: i2c recv err: %d\n",
-				__func__, r);
+			dev_dbg(&client->dev, "i2c recv err: %d\n", r);
 			goto flush;
 		}
 
@@ -167,8 +164,7 @@ static int fdp_nci_i2c_read(struct fdp_i2c_phy *phy, struct sk_buff **skb)
 		 * and force resynchronization
 		 */
 		if (lrc) {
-			dev_dbg(&client->dev, "%s: corrupted packet\n",
-				__func__);
+			dev_dbg(&client->dev, "corrupted packet\n");
 			phy->next_read_size = 5;
 			goto flush;
 		}
@@ -176,6 +172,15 @@ static int fdp_nci_i2c_read(struct fdp_i2c_phy *phy, struct sk_buff **skb)
 		/* Packet that contains a length */
 		if (tmp[0] == 0 && tmp[1] == 0) {
 			phy->next_read_size = (tmp[2] << 8) + tmp[3] + 3;
+			/*
+			 * Ensure next_read_size does not exceed sizeof(tmp)
+			 * for reading that many bytes during next iteration
+			 */
+			if (phy->next_read_size > FDP_NCI_I2C_MAX_PAYLOAD) {
+				dev_dbg(&client->dev, "corrupted packet\n");
+				phy->next_read_size = FDP_NCI_I2C_MIN_PAYLOAD;
+				goto flush;
+			}
 		} else {
 			phy->next_read_size = FDP_NCI_I2C_MIN_PAYLOAD;
 
@@ -215,7 +220,6 @@ static irqreturn_t fdp_nci_i2c_irq_thread_fn(int irq, void *phy_id)
 	}
 
 	client = phy->i2c_dev;
-	dev_dbg(&client->dev, "%s\n", __func__);
 
 	r = fdp_nci_i2c_read(phy, &skb);
 
@@ -296,8 +300,6 @@ static int fdp_nci_i2c_probe(struct i2c_client *client)
 	u32 clock_freq;
 	int r = 0;
 
-	dev_dbg(dev, "%s\n", __func__);
-
 	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
 		nfc_err(dev, "No I2C_FUNC_I2C support\n");
 		return -ENODEV;
@@ -359,8 +361,6 @@ static int fdp_nci_i2c_remove(struct i2c_client *client)
 {
 	struct fdp_i2c_phy *phy = i2c_get_clientdata(client);
 
-	dev_dbg(&client->dev, "%s\n", __func__);
-
 	fdp_nci_remove(phy->ndev);
 	fdp_nci_i2c_disable(phy);
 
diff --git a/drivers/nfc/st21nfca/dep.c b/drivers/nfc/st21nfca/dep.c
index fd08be2917e6..3420c5104c94 100644
--- a/drivers/nfc/st21nfca/dep.c
+++ b/drivers/nfc/st21nfca/dep.c
@@ -217,7 +217,8 @@ static int st21nfca_tm_recv_atr_req(struct nfc_hci_dev *hdev,
 
 	atr_req = (struct st21nfca_atr_req *)skb->data;
 
-	if (atr_req->length < sizeof(struct st21nfca_atr_req)) {
+	if (atr_req->length < sizeof(struct st21nfca_atr_req) ||
+	    atr_req->length > skb->len) {
 		r = -EPROTO;
 		goto exit;
 	}
diff --git a/drivers/nfc/st21nfca/se.c b/drivers/nfc/st21nfca/se.c
index 4bed9e842db3..5b63549bf76a 100644
--- a/drivers/nfc/st21nfca/se.c
+++ b/drivers/nfc/st21nfca/se.c
@@ -326,8 +326,9 @@ int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host,
 		    skb->data[0] != NFC_EVT_TRANSACTION_AID_TAG)
 			return -EPROTO;
 
-		transaction = (struct nfc_evt_transaction *)devm_kzalloc(dev,
-						   skb->len - 2, GFP_KERNEL);
+		transaction = devm_kzalloc(dev, skb->len - 2, GFP_KERNEL);
+		if (!transaction)
+			return -ENOMEM;
 
 		transaction->aid_len = skb->data[1];
 		memcpy(transaction->aid, &skb->data[2],
diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
index 2b26f762fbc3..a50a95cfcfd8 100644
--- a/drivers/nfc/st95hf/core.c
+++ b/drivers/nfc/st95hf/core.c
@@ -995,8 +995,6 @@ static int st95hf_in_send_cmd(struct nfc_digital_dev *ddev,
 		goto free_skb_resp;
 	}
 
-	kfree_skb(skb);
-
 	return rc;
 
 free_skb_resp:
@@ -1112,8 +1110,10 @@ static int st95hf_probe(struct spi_device *nfc_spi_dev)
 		}
 	}
 
+	sema_init(&st95context->exchange_lock, 1);
 	init_completion(&spicontext->done);
 	mutex_init(&spicontext->spi_lock);
+	mutex_init(&st95context->rm_lock);
 
 	/*
 	 * Store spicontext in spi device object for using it in
@@ -1197,9 +1197,6 @@ static int st95hf_probe(struct spi_device *nfc_spi_dev)
 	/* store st95context in nfc device object */
 	nfc_digital_set_drvdata(st95context->ddev, st95context);
 
-	sema_init(&st95context->exchange_lock, 1);
-	mutex_init(&st95context->rm_lock);
-
 	return ret;
 
 err_free_digital_device:
diff --git a/drivers/ntb/hw/amd/ntb_hw_amd.c b/drivers/ntb/hw/amd/ntb_hw_amd.c
index efb214fc545a..16c10dfe0919 100644
--- a/drivers/ntb/hw/amd/ntb_hw_amd.c
+++ b/drivers/ntb/hw/amd/ntb_hw_amd.c
@@ -1020,10 +1020,6 @@ static int amd_ntb_init_pci(struct amd_ntb_dev *ndev,
 			goto err_dma_mask;
 		dev_warn(&pdev->dev, "Cannot DMA consistent highmem\n");
 	}
-	rc = dma_coerce_mask_and_coherent(&ndev->ntb.dev,
-					  dma_get_mask(&pdev->dev));
-	if (rc)
-		goto err_dma_mask;
 
 	ndev->self_mmio = pci_iomap(pdev, 0, 0);
 	if (!ndev->self_mmio) {
diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c b/drivers/ntb/hw/idt/ntb_hw_idt.c
index 1dede87dd54f..30c29183f515 100644
--- a/drivers/ntb/hw/idt/ntb_hw_idt.c
+++ b/drivers/ntb/hw/idt/ntb_hw_idt.c
@@ -2667,12 +2667,6 @@ static int idt_init_pci(struct idt_ntb_dev *ndev)
 		dev_warn(&pdev->dev,
 			"Cannot set consistent DMA highmem bit mask\n");
 	}
-	ret = dma_coerce_mask_and_coherent(&ndev->ntb.dev,
-					   dma_get_mask(&pdev->dev));
-	if (ret != 0) {
-		dev_err(&pdev->dev, "Failed to set NTB device DMA bit mask\n");
-		return ret;
-	}
 
 	/*
 	 * Enable the device advanced error reporting. It's not critical to
diff --git a/drivers/ntb/hw/intel/ntb_hw_gen1.c b/drivers/ntb/hw/intel/ntb_hw_gen1.c
index bb57ec239029..e0530129bbba 100644
--- a/drivers/ntb/hw/intel/ntb_hw_gen1.c
+++ b/drivers/ntb/hw/intel/ntb_hw_gen1.c
@@ -1783,10 +1783,6 @@ static int intel_ntb_init_pci(struct intel_ntb_dev *ndev, struct pci_dev *pdev)
 			goto err_dma_mask;
 		dev_warn(&pdev->dev, "Cannot DMA consistent highmem\n");
 	}
-	rc = dma_coerce_mask_and_coherent(&ndev->ntb.dev,
-					  dma_get_mask(&pdev->dev));
-	if (rc)
-		goto err_dma_mask;
 
 	ndev->self_mmio = pci_iomap(pdev, 0, 0);
 	if (!ndev->self_mmio) {
diff --git a/drivers/ntb/ntb.c b/drivers/ntb/ntb.c
index 2581ab724c34..f8f75a504a58 100644
--- a/drivers/ntb/ntb.c
+++ b/drivers/ntb/ntb.c
@@ -214,10 +214,8 @@ int ntb_default_port_number(struct ntb_dev *ntb)
 	case NTB_TOPO_B2B_DSD:
 		return NTB_PORT_SEC_DSD;
 	default:
-		break;
+		return 0;
 	}
-
-	return -EINVAL;
 }
 EXPORT_SYMBOL(ntb_default_port_number);
 
@@ -240,10 +238,8 @@ int ntb_default_peer_port_number(struct ntb_dev *ntb, int pidx)
 	case NTB_TOPO_B2B_DSD:
 		return NTB_PORT_PRI_USD;
 	default:
-		break;
+		return 0;
 	}
-
-	return -EINVAL;
 }
 EXPORT_SYMBOL(ntb_default_peer_port_number);
 
@@ -315,4 +311,3 @@ static void __exit ntb_driver_exit(void)
 	bus_unregister(&ntb_bus);
 }
 module_exit(ntb_driver_exit);
-
diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
index 2a9d6b0d1f19..2c11e513cf78 100644
--- a/drivers/ntb/test/ntb_perf.c
+++ b/drivers/ntb/test/ntb_perf.c
@@ -158,6 +158,8 @@ struct perf_peer {
 	/* NTB connection setup service */
 	struct work_struct	service;
 	unsigned long		sts;
+
+	struct completion init_comp;
 };
 #define to_peer_service(__work) \
 	container_of(__work, struct perf_peer, service)
@@ -549,6 +551,7 @@ static int perf_setup_outbuf(struct perf_peer *peer)
 
 	/* Initialization is finally done */
 	set_bit(PERF_STS_DONE, &peer->sts);
+	complete_all(&peer->init_comp);
 
 	return 0;
 }
@@ -559,7 +562,7 @@ static void perf_free_inbuf(struct perf_peer *peer)
 		return;
 
 	(void)ntb_mw_clear_trans(peer->perf->ntb, peer->pidx, peer->gidx);
-	dma_free_coherent(&peer->perf->ntb->dev, peer->inbuf_size,
+	dma_free_coherent(&peer->perf->ntb->pdev->dev, peer->inbuf_size,
 			  peer->inbuf, peer->inbuf_xlat);
 	peer->inbuf = NULL;
 }
@@ -588,8 +591,8 @@ static int perf_setup_inbuf(struct perf_peer *peer)
 
 	perf_free_inbuf(peer);
 
-	peer->inbuf = dma_alloc_coherent(&perf->ntb->dev, peer->inbuf_size,
-					 &peer->inbuf_xlat, GFP_KERNEL);
+	peer->inbuf = dma_alloc_coherent(&perf->ntb->pdev->dev,
+			peer->inbuf_size, &peer->inbuf_xlat, GFP_KERNEL);
 	if (!peer->inbuf) {
 		dev_err(&perf->ntb->dev, "Failed to alloc inbuf of %pa\n",
 			&peer->inbuf_size);
@@ -639,6 +642,7 @@ static void perf_service_work(struct work_struct *work)
 		perf_setup_outbuf(peer);
 
 	if (test_and_clear_bit(PERF_CMD_CLEAR, &peer->sts)) {
+		init_completion(&peer->init_comp);
 		clear_bit(PERF_STS_DONE, &peer->sts);
 		if (test_bit(0, &peer->perf->busy_flag) &&
 		    peer == peer->perf->test_peer) {
@@ -655,7 +659,7 @@ static int perf_init_service(struct perf_ctx *perf)
 {
 	u64 mask;
 
-	if (ntb_peer_mw_count(perf->ntb) < perf->pcnt + 1) {
+	if (ntb_peer_mw_count(perf->ntb) < perf->pcnt) {
 		dev_err(&perf->ntb->dev, "Not enough memory windows\n");
 		return -EINVAL;
 	}
@@ -1046,8 +1050,9 @@ static int perf_submit_test(struct perf_peer *peer)
 	struct perf_thread *pthr;
 	int tidx, ret;
 
-	if (!test_bit(PERF_STS_DONE, &peer->sts))
-		return -ENOLINK;
+	ret = wait_for_completion_interruptible(&peer->init_comp);
+	if (ret < 0)
+		return ret;
 
 	if (test_and_set_bit_lock(0, &perf->busy_flag))
 		return -EBUSY;
@@ -1413,10 +1418,21 @@ static int perf_init_peers(struct perf_ctx *perf)
 			peer->gidx = pidx;
 		}
 		INIT_WORK(&peer->service, perf_service_work);
+		init_completion(&peer->init_comp);
 	}
 	if (perf->gidx == -1)
 		perf->gidx = pidx;
 
+	/*
+	 * Hardware with only two ports may not have unique port
+	 * numbers. In this case, the gidxs should all be zero.
+	 */
+	if (perf->pcnt == 1 &&  ntb_port_number(perf->ntb) == 0 &&
+	    ntb_peer_port_number(perf->ntb, 0) == 0) {
+		perf->gidx = 0;
+		perf->peers[0].gidx = 0;
+	}
+
 	for (pidx = 0; pidx < perf->pcnt; pidx++) {
 		ret = perf_setup_peer_mw(&perf->peers[pidx]);
 		if (ret)
@@ -1512,4 +1528,3 @@ static void __exit perf_exit(void)
 	destroy_workqueue(perf_wq);
 }
 module_exit(perf_exit);
-
diff --git a/drivers/ntb/test/ntb_pingpong.c b/drivers/ntb/test/ntb_pingpong.c
index 65865e460ab8..18d00eec7b02 100644
--- a/drivers/ntb/test/ntb_pingpong.c
+++ b/drivers/ntb/test/ntb_pingpong.c
@@ -121,15 +121,14 @@ static int pp_find_next_peer(struct pp_ctx *pp)
 	link = ntb_link_is_up(pp->ntb, NULL, NULL);
 
 	/* Find next available peer */
-	if (link & pp->nmask) {
+	if (link & pp->nmask)
 		pidx = __ffs64(link & pp->nmask);
-		out_db = BIT_ULL(pidx + 1);
-	} else if (link & pp->pmask) {
+	else if (link & pp->pmask)
 		pidx = __ffs64(link & pp->pmask);
-		out_db = BIT_ULL(pidx);
-	} else {
+	else
 		return -ENODEV;
-	}
+
+	out_db = BIT_ULL(ntb_peer_port_number(pp->ntb, pidx));
 
 	spin_lock(&pp->lock);
 	pp->out_pidx = pidx;
@@ -303,7 +302,7 @@ static void pp_init_flds(struct pp_ctx *pp)
 			break;
 	}
 
-	pp->in_db = BIT_ULL(pidx);
+	pp->in_db = BIT_ULL(lport);
 	pp->pmask = GENMASK_ULL(pidx, 0) >> 1;
 	pp->nmask = GENMASK_ULL(pcnt - 1, pidx);
 
@@ -435,4 +434,3 @@ static void __exit pp_exit(void)
 	debugfs_remove_recursive(pp_dbgfs_topdir);
 }
 module_exit(pp_exit);
-
diff --git a/drivers/ntb/test/ntb_tool.c b/drivers/ntb/test/ntb_tool.c
index d592c0ffbd19..311d6ab8d016 100644
--- a/drivers/ntb/test/ntb_tool.c
+++ b/drivers/ntb/test/ntb_tool.c
@@ -504,7 +504,7 @@ static ssize_t tool_peer_link_read(struct file *filep, char __user *ubuf,
 	buf[1] = '\n';
 	buf[2] = '\0';
 
-	return simple_read_from_buffer(ubuf, size, offp, buf, 3);
+	return simple_read_from_buffer(ubuf, size, offp, buf, 2);
 }
 
 static TOOL_FOPS_RDWR(tool_peer_link_fops,
@@ -590,7 +590,7 @@ static int tool_setup_mw(struct tool_ctx *tc, int pidx, int widx,
 	inmw->size = min_t(resource_size_t, req_size, size);
 	inmw->size = round_up(inmw->size, addr_align);
 	inmw->size = round_up(inmw->size, size_align);
-	inmw->mm_base = dma_alloc_coherent(&tc->ntb->dev, inmw->size,
+	inmw->mm_base = dma_alloc_coherent(&tc->ntb->pdev->dev, inmw->size,
 					   &inmw->dma_base, GFP_KERNEL);
 	if (!inmw->mm_base)
 		return -ENOMEM;
@@ -612,7 +612,7 @@ static int tool_setup_mw(struct tool_ctx *tc, int pidx, int widx,
 	return 0;
 
 err_free_dma:
-	dma_free_coherent(&tc->ntb->dev, inmw->size, inmw->mm_base,
+	dma_free_coherent(&tc->ntb->pdev->dev, inmw->size, inmw->mm_base,
 			  inmw->dma_base);
 	inmw->mm_base = NULL;
 	inmw->dma_base = 0;
@@ -629,7 +629,7 @@ static void tool_free_mw(struct tool_ctx *tc, int pidx, int widx)
 
 	if (inmw->mm_base != NULL) {
 		ntb_mw_clear_trans(tc->ntb, pidx, widx);
-		dma_free_coherent(&tc->ntb->dev, inmw->size,
+		dma_free_coherent(&tc->ntb->pdev->dev, inmw->size,
 				  inmw->mm_base, inmw->dma_base);
 	}
 
@@ -1690,4 +1690,3 @@ static void __exit tool_exit(void)
 	debugfs_remove_recursive(tool_dbgfs_topdir);
 }
 module_exit(tool_exit);
-
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 5226e898476e..4d12b1cab55f 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2293,8 +2293,12 @@ int of_map_rid(struct device_node *np, u32 rid,
 		return 0;
 	}
 
-	pr_err("%pOF: Invalid %s translation - no match for rid 0x%x on %pOF\n",
-		np, map_name, rid, target && *target ? *target : NULL);
-	return -EFAULT;
+	pr_info("%pOF: no %s translation for rid 0x%x on %pOF\n", np, map_name,
+		rid, target && *target ? *target : NULL);
+
+	/* Bypasses translation */
+	if (id_out)
+		*id_out = rid;
+	return 0;
 }
 EXPORT_SYMBOL_GPL(of_map_rid);
diff --git a/drivers/pci/of.c b/drivers/pci/of.c
index 3d32da15c215..9454c90980c9 100644
--- a/drivers/pci/of.c
+++ b/drivers/pci/of.c
@@ -21,12 +21,15 @@ void pci_set_of_node(struct pci_dev *dev)
 		return;
 	dev->dev.of_node = of_pci_find_child_device(dev->bus->dev.of_node,
 						    dev->devfn);
+	if (dev->dev.of_node)
+		dev->dev.fwnode = &dev->dev.of_node->fwnode;
 }
 
 void pci_release_of_node(struct pci_dev *dev)
 {
 	of_node_put(dev->dev.of_node);
 	dev->dev.of_node = NULL;
+	dev->dev.fwnode = NULL;
 }
 
 void pci_set_bus_of_node(struct pci_bus *bus)
@@ -35,12 +38,16 @@ void pci_set_bus_of_node(struct pci_bus *bus)
 		bus->dev.of_node = pcibios_get_phb_of_node(bus);
 	else
 		bus->dev.of_node = of_node_get(bus->self->dev.of_node);
+
+	if (bus->dev.of_node)
+		bus->dev.fwnode = &bus->dev.of_node->fwnode;
 }
 
 void pci_release_bus_of_node(struct pci_bus *bus)
 {
 	of_node_put(bus->dev.of_node);
 	bus->dev.of_node = NULL;
+	bus->dev.fwnode = NULL;
 }
 
 struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus)
diff --git a/drivers/pinctrl/pxa/pinctrl-pxa2xx.c b/drivers/pinctrl/pxa/pinctrl-pxa2xx.c
index 6cf0006d4c8d..1da64a99e4f7 100644
--- a/drivers/pinctrl/pxa/pinctrl-pxa2xx.c
+++ b/drivers/pinctrl/pxa/pinctrl-pxa2xx.c
@@ -14,6 +14,7 @@
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/module.h>
+#include <linux/pinctrl/machine.h>
 #include <linux/pinctrl/pinconf.h>
 #include <linux/pinctrl/pinconf-generic.h>
 #include <linux/pinctrl/pinmux.h>
diff --git a/drivers/platform/chrome/wilco_ec/mailbox.c b/drivers/platform/chrome/wilco_ec/mailbox.c
index f6ff29a11f1a..14355668ddfa 100644
--- a/drivers/platform/chrome/wilco_ec/mailbox.c
+++ b/drivers/platform/chrome/wilco_ec/mailbox.c
@@ -223,11 +223,11 @@ int wilco_ec_mailbox(struct wilco_ec_device *ec, struct wilco_ec_message *msg)
 		msg->command, msg->type, msg->flags, msg->response_size,
 		msg->request_size);
 
+	mutex_lock(&ec->mailbox_lock);
 	/* Prepare request packet */
 	rq = ec->data_buffer;
 	wilco_ec_prepare(msg, rq);
 
-	mutex_lock(&ec->mailbox_lock);
 	ret = wilco_ec_transfer(ec, msg, rq);
 	mutex_unlock(&ec->mailbox_lock);
 
diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index 8122807db380..ea88fd4e2a6e 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -493,7 +493,8 @@ static int rpmsg_dev_remove(struct device *dev)
 	if (rpdev->ops->announce_destroy)
 		err = rpdev->ops->announce_destroy(rpdev);
 
-	rpdrv->remove(rpdev);
+	if (rpdrv->remove)
+		rpdrv->remove(rpdev);
 
 	dev_pm_domain_detach(dev, true);
 
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index e15816ff1265..033a1acabf48 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -810,11 +810,18 @@ static int ap_device_remove(struct device *dev)
 	struct ap_device *ap_dev = to_ap_dev(dev);
 	struct ap_driver *ap_drv = ap_dev->drv;
 
+	/* prepare ap queue device removal */
 	if (is_queue_dev(dev))
-		ap_queue_remove(to_ap_queue(dev));
+		ap_queue_prepare_remove(to_ap_queue(dev));
+
+	/* driver's chance to clean up gracefully */
 	if (ap_drv->remove)
 		ap_drv->remove(ap_dev);
 
+	/* now do the ap queue device remove */
+	if (is_queue_dev(dev))
+		ap_queue_remove(to_ap_queue(dev));
+
 	/* Remove queue/card from list of active queues/cards */
 	spin_lock_bh(&ap_list_lock);
 	if (is_card_dev(dev))
diff --git a/drivers/s390/crypto/ap_bus.h b/drivers/s390/crypto/ap_bus.h
index d0059eae5d94..15a98a673c5c 100644
--- a/drivers/s390/crypto/ap_bus.h
+++ b/drivers/s390/crypto/ap_bus.h
@@ -91,6 +91,7 @@ enum ap_state {
 	AP_STATE_WORKING,
 	AP_STATE_QUEUE_FULL,
 	AP_STATE_SUSPEND_WAIT,
+	AP_STATE_REMOVE,	/* about to be removed from driver */
 	AP_STATE_UNBOUND,	/* momentary not bound to a driver */
 	AP_STATE_BORKED,	/* broken */
 	NR_AP_STATES
@@ -252,6 +253,7 @@ void ap_bus_force_rescan(void);
 
 void ap_queue_init_reply(struct ap_queue *aq, struct ap_message *ap_msg);
 struct ap_queue *ap_queue_create(ap_qid_t qid, int device_type);
+void ap_queue_prepare_remove(struct ap_queue *aq);
 void ap_queue_remove(struct ap_queue *aq);
 void ap_queue_suspend(struct ap_device *ap_dev);
 void ap_queue_resume(struct ap_device *ap_dev);
diff --git a/drivers/s390/crypto/ap_queue.c b/drivers/s390/crypto/ap_queue.c
index ba261210c6da..6a340f2c3556 100644
--- a/drivers/s390/crypto/ap_queue.c
+++ b/drivers/s390/crypto/ap_queue.c
@@ -420,6 +420,10 @@ static ap_func_t *ap_jumptable[NR_AP_STATES][NR_AP_EVENTS] = {
 		[AP_EVENT_POLL] = ap_sm_suspend_read,
 		[AP_EVENT_TIMEOUT] = ap_sm_nop,
 	},
+	[AP_STATE_REMOVE] = {
+		[AP_EVENT_POLL] = ap_sm_nop,
+		[AP_EVENT_TIMEOUT] = ap_sm_nop,
+	},
 	[AP_STATE_UNBOUND] = {
 		[AP_EVENT_POLL] = ap_sm_nop,
 		[AP_EVENT_TIMEOUT] = ap_sm_nop,
@@ -740,18 +744,31 @@ void ap_flush_queue(struct ap_queue *aq)
 }
 EXPORT_SYMBOL(ap_flush_queue);
 
-void ap_queue_remove(struct ap_queue *aq)
+void ap_queue_prepare_remove(struct ap_queue *aq)
 {
-	ap_flush_queue(aq);
+	spin_lock_bh(&aq->lock);
+	/* flush queue */
+	__ap_flush_queue(aq);
+	/* set REMOVE state to prevent new messages are queued in */
+	aq->state = AP_STATE_REMOVE;
 	del_timer_sync(&aq->timeout);
+	spin_unlock_bh(&aq->lock);
+}
 
-	/* reset with zero, also clears irq registration */
+void ap_queue_remove(struct ap_queue *aq)
+{
+	/*
+	 * all messages have been flushed and the state is
+	 * AP_STATE_REMOVE. Now reset with zero which also
+	 * clears the irq registration and move the state
+	 * to AP_STATE_UNBOUND to signal that this queue
+	 * is not used by any driver currently.
+	 */
 	spin_lock_bh(&aq->lock);
 	ap_zapq(aq->qid);
 	aq->state = AP_STATE_UNBOUND;
 	spin_unlock_bh(&aq->lock);
 }
-EXPORT_SYMBOL(ap_queue_remove);
 
 void ap_queue_reinit_state(struct ap_queue *aq)
 {
@@ -760,4 +777,3 @@ void ap_queue_reinit_state(struct ap_queue *aq)
 	ap_wait(ap_sm_event(aq, AP_EVENT_POLL));
 	spin_unlock_bh(&aq->lock);
 }
-EXPORT_SYMBOL(ap_queue_reinit_state);
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c
index eb93c2d27d0a..689c2af7026a 100644
--- a/drivers/s390/crypto/zcrypt_api.c
+++ b/drivers/s390/crypto/zcrypt_api.c
@@ -586,6 +586,7 @@ static inline bool zcrypt_check_queue(struct ap_perms *perms, int queue)
 
 static inline struct zcrypt_queue *zcrypt_pick_queue(struct zcrypt_card *zc,
 						     struct zcrypt_queue *zq,
+						     struct module **pmod,
 						     unsigned int weight)
 {
 	if (!zq || !try_module_get(zq->queue->ap_dev.drv->driver.owner))
@@ -595,15 +596,15 @@ static inline struct zcrypt_queue *zcrypt_pick_queue(struct zcrypt_card *zc,
 	atomic_add(weight, &zc->load);
 	atomic_add(weight, &zq->load);
 	zq->request_count++;
+	*pmod = zq->queue->ap_dev.drv->driver.owner;
 	return zq;
 }
 
 static inline void zcrypt_drop_queue(struct zcrypt_card *zc,
 				     struct zcrypt_queue *zq,
+				     struct module *mod,
 				     unsigned int weight)
 {
-	struct module *mod = zq->queue->ap_dev.drv->driver.owner;
-
 	zq->request_count--;
 	atomic_sub(weight, &zc->load);
 	atomic_sub(weight, &zq->load);
@@ -653,6 +654,7 @@ static long zcrypt_rsa_modexpo(struct ap_perms *perms,
 	unsigned int weight, pref_weight;
 	unsigned int func_code;
 	int qid = 0, rc = -ENODEV;
+	struct module *mod;
 
 	trace_s390_zcrypt_req(mex, TP_ICARSAMODEXPO);
 
@@ -706,7 +708,7 @@ static long zcrypt_rsa_modexpo(struct ap_perms *perms,
 			pref_weight = weight;
 		}
 	}
-	pref_zq = zcrypt_pick_queue(pref_zc, pref_zq, weight);
+	pref_zq = zcrypt_pick_queue(pref_zc, pref_zq, &mod, weight);
 	spin_unlock(&zcrypt_list_lock);
 
 	if (!pref_zq) {
@@ -718,7 +720,7 @@ static long zcrypt_rsa_modexpo(struct ap_perms *perms,
 	rc = pref_zq->ops->rsa_modexpo(pref_zq, mex);
 
 	spin_lock(&zcrypt_list_lock);
-	zcrypt_drop_queue(pref_zc, pref_zq, weight);
+	zcrypt_drop_queue(pref_zc, pref_zq, mod, weight);
 	spin_unlock(&zcrypt_list_lock);
 
 out:
@@ -735,6 +737,7 @@ static long zcrypt_rsa_crt(struct ap_perms *perms,
 	unsigned int weight, pref_weight;
 	unsigned int func_code;
 	int qid = 0, rc = -ENODEV;
+	struct module *mod;
 
 	trace_s390_zcrypt_req(crt, TP_ICARSACRT);
 
@@ -788,7 +791,7 @@ static long zcrypt_rsa_crt(struct ap_perms *perms,
 			pref_weight = weight;
 		}
 	}
-	pref_zq = zcrypt_pick_queue(pref_zc, pref_zq, weight);
+	pref_zq = zcrypt_pick_queue(pref_zc, pref_zq, &mod, weight);
 	spin_unlock(&zcrypt_list_lock);
 
 	if (!pref_zq) {
@@ -800,7 +803,7 @@ static long zcrypt_rsa_crt(struct ap_perms *perms,
 	rc = pref_zq->ops->rsa_modexpo_crt(pref_zq, crt);
 
 	spin_lock(&zcrypt_list_lock);
-	zcrypt_drop_queue(pref_zc, pref_zq, weight);
+	zcrypt_drop_queue(pref_zc, pref_zq, mod, weight);
 	spin_unlock(&zcrypt_list_lock);
 
 out:
@@ -819,6 +822,7 @@ static long _zcrypt_send_cprb(struct ap_perms *perms,
 	unsigned int func_code;
 	unsigned short *domain;
 	int qid = 0, rc = -ENODEV;
+	struct module *mod;
 
 	trace_s390_zcrypt_req(xcRB, TB_ZSECSENDCPRB);
 
@@ -865,7 +869,7 @@ static long _zcrypt_send_cprb(struct ap_perms *perms,
 			pref_weight = weight;
 		}
 	}
-	pref_zq = zcrypt_pick_queue(pref_zc, pref_zq, weight);
+	pref_zq = zcrypt_pick_queue(pref_zc, pref_zq, &mod, weight);
 	spin_unlock(&zcrypt_list_lock);
 
 	if (!pref_zq) {
@@ -881,7 +885,7 @@ static long _zcrypt_send_cprb(struct ap_perms *perms,
 	rc = pref_zq->ops->send_cprb(pref_zq, xcRB, &ap_msg);
 
 	spin_lock(&zcrypt_list_lock);
-	zcrypt_drop_queue(pref_zc, pref_zq, weight);
+	zcrypt_drop_queue(pref_zc, pref_zq, mod, weight);
 	spin_unlock(&zcrypt_list_lock);
 
 out:
@@ -932,6 +936,7 @@ static long zcrypt_send_ep11_cprb(struct ap_perms *perms,
 	unsigned int func_code;
 	struct ap_message ap_msg;
 	int qid = 0, rc = -ENODEV;
+	struct module *mod;
 
 	trace_s390_zcrypt_req(xcrb, TP_ZSENDEP11CPRB);
 
@@ -1000,7 +1005,7 @@ static long zcrypt_send_ep11_cprb(struct ap_perms *perms,
 			pref_weight = weight;
 		}
 	}
-	pref_zq = zcrypt_pick_queue(pref_zc, pref_zq, weight);
+	pref_zq = zcrypt_pick_queue(pref_zc, pref_zq, &mod, weight);
 	spin_unlock(&zcrypt_list_lock);
 
 	if (!pref_zq) {
@@ -1012,7 +1017,7 @@ static long zcrypt_send_ep11_cprb(struct ap_perms *perms,
 	rc = pref_zq->ops->send_ep11_cprb(pref_zq, xcrb, &ap_msg);
 
 	spin_lock(&zcrypt_list_lock);
-	zcrypt_drop_queue(pref_zc, pref_zq, weight);
+	zcrypt_drop_queue(pref_zc, pref_zq, mod, weight);
 	spin_unlock(&zcrypt_list_lock);
 
 out_free:
@@ -1033,6 +1038,7 @@ static long zcrypt_rng(char *buffer)
 	struct ap_message ap_msg;
 	unsigned int domain;
 	int qid = 0, rc = -ENODEV;
+	struct module *mod;
 
 	trace_s390_zcrypt_req(buffer, TP_HWRNGCPRB);
 
@@ -1064,7 +1070,7 @@ static long zcrypt_rng(char *buffer)
 			pref_weight = weight;
 		}
 	}
-	pref_zq = zcrypt_pick_queue(pref_zc, pref_zq, weight);
+	pref_zq = zcrypt_pick_queue(pref_zc, pref_zq, &mod, weight);
 	spin_unlock(&zcrypt_list_lock);
 
 	if (!pref_zq) {
@@ -1076,7 +1082,7 @@ static long zcrypt_rng(char *buffer)
 	rc = pref_zq->ops->rng(pref_zq, buffer, &ap_msg);
 
 	spin_lock(&zcrypt_list_lock);
-	zcrypt_drop_queue(pref_zc, pref_zq, weight);
+	zcrypt_drop_queue(pref_zc, pref_zq, mod, weight);
 	spin_unlock(&zcrypt_list_lock);
 
 out:
diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
index f3362f4ab16e..d4a7263e4b8f 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -4920,24 +4920,30 @@ ahc_fini_scbdata(struct ahc_softc *ahc)
 		}
 		ahc_dma_tag_destroy(ahc, scb_data->sg_dmat);
 	}
+		/* fall through */
 	case 6:
 		ahc_dmamap_unload(ahc, scb_data->sense_dmat,
 				  scb_data->sense_dmamap);
+		/* fall through */
 	case 5:
 		ahc_dmamem_free(ahc, scb_data->sense_dmat, scb_data->sense,
 				scb_data->sense_dmamap);
 		ahc_dmamap_destroy(ahc, scb_data->sense_dmat,
 				   scb_data->sense_dmamap);
+		/* fall through */
 	case 4:
 		ahc_dma_tag_destroy(ahc, scb_data->sense_dmat);
+		/* fall through */
 	case 3:
 		ahc_dmamap_unload(ahc, scb_data->hscb_dmat,
 				  scb_data->hscb_dmamap);
+		/* fall through */
 	case 2:
 		ahc_dmamem_free(ahc, scb_data->hscb_dmat, scb_data->hscbs,
 				scb_data->hscb_dmamap);
 		ahc_dmamap_destroy(ahc, scb_data->hscb_dmat,
 				   scb_data->hscb_dmamap);
+		/* fall through */
 	case 1:
 		ahc_dma_tag_destroy(ahc, scb_data->hscb_dmat);
 		break;
@@ -6002,8 +6008,8 @@ ahc_search_qinfifo(struct ahc_softc *ahc, int target, char channel,
 				if ((scb->flags & SCB_ACTIVE) == 0)
 					printk("Inactive SCB in Waiting List\n");
 				ahc_done(ahc, scb);
-				/* FALLTHROUGH */
 			}
+				/* fall through */
 			case SEARCH_REMOVE:
 				next = ahc_rem_wscb(ahc, next, prev);
 				break;
@@ -7008,8 +7014,8 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, uint8_t *dconsts)
 		}
 		address -= address_offset;
 		fmt3_ins->address = address;
-		/* FALLTHROUGH */
 	}
+		/* fall through */
 	case AIC_OP_OR:
 	case AIC_OP_AND:
 	case AIC_OP_XOR:
@@ -7035,7 +7041,7 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, uint8_t *dconsts)
 			fmt1_ins->opcode = AIC_OP_AND;
 			fmt1_ins->immediate = 0xff;
 		}
-		/* FALLTHROUGH */
+		/* fall through */
 	case AIC_OP_ROL:
 		if ((ahc->features & AHC_ULTRA2) != 0) {
 			int i, count;
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index 96b96e2ab91a..ed1bd369baa0 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -679,6 +679,7 @@ int beiscsi_set_param(struct iscsi_cls_conn *cls_conn,
 	case ISCSI_PARAM_MAX_XMIT_DLENGTH:
 		if (conn->max_xmit_dlength > 65536)
 			conn->max_xmit_dlength = 65536;
+		/* fall through */
 	default:
 		return 0;
 	}
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 76e49d902609..0760d0bd8a10 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -1532,6 +1532,7 @@ beiscsi_hdl_get_handle(struct beiscsi_conn *beiscsi_conn,
 		break;
 	case UNSOL_DATA_DIGEST_ERROR_NOTIFY:
 		error = 1;
+		/* fall through */
 	case UNSOL_DATA_NOTIFY:
 		pasync_handle = pasync_ctx->async_entry[ci].data;
 		break;
diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c
index 2c85f5b1f9c1..7e996bcf026c 100644
--- a/drivers/scsi/bfa/bfa_fcpim.c
+++ b/drivers/scsi/bfa/bfa_fcpim.c
@@ -2586,6 +2586,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
 	case FCP_IODIR_RW:
 		bfa_stats(itnim, input_reqs);
 		bfa_stats(itnim, output_reqs);
+		/* fall through */
 	default:
 		bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_fn_lpu(ioim->bfa));
 	}
@@ -2820,6 +2821,7 @@ bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
 
 	case BFI_IOIM_STS_TIMEDOUT:
 		bfa_stats(ioim->itnim, iocomp_timedout);
+		/* fall through */
 	case BFI_IOIM_STS_ABORTED:
 		rsp->io_status = BFI_IOIM_STS_ABORTED;
 		bfa_stats(ioim->itnim, iocomp_aborted);
@@ -3215,9 +3217,7 @@ bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim,
 	switch (event) {
 	case BFA_TSKIM_SM_DONE:
 		bfa_reqq_wcancel(&tskim->reqq_wait);
-		/*
-		 * Fall through !!!
-		 */
+		/* fall through */
 	case BFA_TSKIM_SM_QRESUME:
 		bfa_sm_set_state(tskim, bfa_tskim_sm_cleanup);
 		bfa_tskim_send_abort(tskim);
diff --git a/drivers/scsi/csiostor/csio_wr.c b/drivers/scsi/csiostor/csio_wr.c
index 66bbd21819ae..03bd896cdbb9 100644
--- a/drivers/scsi/csiostor/csio_wr.c
+++ b/drivers/scsi/csiostor/csio_wr.c
@@ -808,6 +808,7 @@ csio_wr_destroy_queues(struct csio_hw *hw, bool cmd)
 
 				csio_q_eqid(hw, i) = CSIO_MAX_QID;
 			}
+			/* fall through */
 		case CSIO_INGRESS:
 			if (csio_q_iqid(hw, i) != CSIO_MAX_QID) {
 				csio_wr_cleanup_iq_ftr(hw, i);
diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c
index cea7f502e8ca..64ae418d29f3 100644
--- a/drivers/scsi/imm.c
+++ b/drivers/scsi/imm.c
@@ -796,21 +796,21 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd)
 			return 0;
 		}
 		return 1;	/* wait until imm_wakeup claims parport */
-		/* Phase 1 - Connected */
-	case 1:
+
+	case 1:		/* Phase 1 - Connected */
 		imm_connect(dev, CONNECT_EPP_MAYBE);
 		cmd->SCp.phase++;
+		/* fall through */
 
-		/* Phase 2 - We are now talking to the scsi bus */
-	case 2:
+	case 2:		/* Phase 2 - We are now talking to the scsi bus */
 		if (!imm_select(dev, scmd_id(cmd))) {
 			imm_fail(dev, DID_NO_CONNECT);
 			return 0;
 		}
 		cmd->SCp.phase++;
+		/* fall through */
 
-		/* Phase 3 - Ready to accept a command */
-	case 3:
+	case 3:		/* Phase 3 - Ready to accept a command */
 		w_ctr(ppb, 0x0c);
 		if (!(r_str(ppb) & 0x80))
 			return 1;
@@ -818,9 +818,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd)
 		if (!imm_send_command(cmd))
 			return 0;
 		cmd->SCp.phase++;
+		/* fall through */
 
-		/* Phase 4 - Setup scatter/gather buffers */
-	case 4:
+	case 4:		/* Phase 4 - Setup scatter/gather buffers */
 		if (scsi_bufflen(cmd)) {
 			cmd->SCp.buffer = scsi_sglist(cmd);
 			cmd->SCp.this_residual = cmd->SCp.buffer->length;
@@ -834,8 +834,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd)
 		cmd->SCp.phase++;
 		if (cmd->SCp.this_residual & 0x01)
 			cmd->SCp.this_residual++;
-		/* Phase 5 - Pre-Data transfer stage */
-	case 5:
+		/* fall through */
+
+	case 5:		/* Phase 5 - Pre-Data transfer stage */
 		/* Spin lock for BUSY */
 		w_ctr(ppb, 0x0c);
 		if (!(r_str(ppb) & 0x80))
@@ -850,9 +851,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd)
 			if (imm_negotiate(dev))
 				return 0;
 		cmd->SCp.phase++;
+		/* fall through */
 
-		/* Phase 6 - Data transfer stage */
-	case 6:
+	case 6:		/* Phase 6 - Data transfer stage */
 		/* Spin lock for BUSY */
 		w_ctr(ppb, 0x0c);
 		if (!(r_str(ppb) & 0x80))
@@ -866,9 +867,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd)
 				return 1;
 		}
 		cmd->SCp.phase++;
+		/* fall through */
 
-		/* Phase 7 - Post data transfer stage */
-	case 7:
+	case 7:		/* Phase 7 - Post data transfer stage */
 		if ((dev->dp) && (dev->rd)) {
 			if ((dev->mode == IMM_NIBBLE) || (dev->mode == IMM_PS2)) {
 				w_ctr(ppb, 0x4);
@@ -878,9 +879,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd)
 			}
 		}
 		cmd->SCp.phase++;
+		/* fall through */
 
-		/* Phase 8 - Read status/message */
-	case 8:
+	case 8:		/* Phase 8 - Read status/message */
 		/* Check for data overrun */
 		if (imm_wait(dev) != (unsigned char) 0xb8) {
 			imm_fail(dev, DID_ERROR);
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index 7290573110fe..44f426347d4f 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -3092,6 +3092,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
 	case SLI_MGMT_GHAT:
 	case SLI_MGMT_GRPL:
 		rsp_size = FC_MAX_NS_RSP;
+		/* fall through */
 	case SLI_MGMT_DHBA:
 	case SLI_MGMT_DHAT:
 		pe = (struct lpfc_fdmi_port_entry *)&CtReq->un.PortID;
@@ -3104,6 +3105,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
 	case SLI_MGMT_GPAT:
 	case SLI_MGMT_GPAS:
 		rsp_size = FC_MAX_NS_RSP;
+		/* fall through */
 	case SLI_MGMT_DPRT:
 	case SLI_MGMT_DPA:
 		pe = (struct lpfc_fdmi_port_entry *)&CtReq->un.PortID;
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index fc077cb87900..7b0755e3527d 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -8775,6 +8775,7 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 				lpfc_nlp_put(ndlp);
 				return;
 			}
+			/* fall through */
 
 		default:
 			/* Try to recover from this error */
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index aa4961a2caf8..14fffbebbbb5 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -4667,9 +4667,11 @@ lpfc_check_sli_ndlp(struct lpfc_hba *phba,
 		case CMD_GEN_REQUEST64_CR:
 			if (iocb->context_un.ndlp == ndlp)
 				return 1;
+			/* fall through */
 		case CMD_ELS_REQUEST64_CR:
 			if (icmd->un.elsreq64.remoteID == ndlp->nlp_DID)
 				return 1;
+			/* fall through */
 		case CMD_XMIT_ELS_RSP64_CX:
 			if (iocb->context1 == (uint8_t *) ndlp)
 				return 1;
@@ -5856,7 +5858,7 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
 
 	case LPFC_LINK_UP:
 		lpfc_issue_clear_la(phba, vport);
-		/* Drop thru */
+		/* fall through */
 	case LPFC_LINK_UNKNOWN:
 	case LPFC_WARM_START:
 	case LPFC_INIT_START:
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c
index 6172682a24ba..11d284c5486e 100644
--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
@@ -360,6 +360,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
 	case  NLP_STE_NPR_NODE:
 		if (!(ndlp->nlp_flag & NLP_NPR_ADISC))
 			break;
+		/* fall through */
 	case  NLP_STE_REG_LOGIN_ISSUE:
 	case  NLP_STE_PRLI_ISSUE:
 	case  NLP_STE_UNMAPPED_NODE:
diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
index 1aa00d2c3f74..d16ca413110d 100644
--- a/drivers/scsi/lpfc/lpfc_nvme.c
+++ b/drivers/scsi/lpfc/lpfc_nvme.c
@@ -1106,6 +1106,7 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
 					 lpfc_ncmd, nCmd,
 					 lpfc_ncmd->cur_iocbq.sli4_xritag,
 					 bf_get(lpfc_wcqe_c_xb, wcqe));
+			/* fall through */
 		default:
 out_err:
 			lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_IOERR,
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index c98f264f1d83..1e3adc3aafb3 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -1137,7 +1137,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc,
 
 					break;
 				}
-				/* Drop thru */
+				/* fall through */
 			case SCSI_PROT_WRITE_INSERT:
 				/*
 				 * For WRITE_INSERT, force the error
@@ -1256,7 +1256,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc,
 					rc = BG_ERR_TGT | BG_ERR_CHECK;
 					break;
 				}
-				/* Drop thru */
+				/* fall through */
 			case SCSI_PROT_WRITE_INSERT:
 				/*
 				 * For WRITE_INSERT, force the
@@ -1338,7 +1338,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc,
 			switch (op) {
 			case SCSI_PROT_WRITE_PASS:
 				rc = BG_ERR_CHECK;
-				/* Drop thru */
+				/* fall through */
 
 			case SCSI_PROT_WRITE_INSERT:
 				/*
@@ -3822,7 +3822,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
 					lpfc_cmd->cur_iocbq.sli4_lxritag,
 					0, 0);
 			}
-		/* else: fall through */
+			/* fall through */
 		default:
 			cmd->result = DID_ERROR << 16;
 			break;
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index be3c73ebbfde..4bad54463eb2 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -216,12 +216,14 @@ static void osst_analyze_sense(struct osst_request *SRpnt, struct st_cmdstatus *
 		switch (sense[0] & 0x7f) {
 		case 0x71:
 			s->deferred = 1;
+			/* fall through */
 		case 0x70:
 			s->fixed_format = 1;
 			s->flags = sense[2] & 0xe0;
 			break;
 		case 0x73:
 			s->deferred = 1;
+			/* fall through */
 		case 0x72:
 			s->fixed_format = 0;
 			ucp = scsi_sense_desc_find(sense, SCSI_SENSE_BUFFERSIZE, 4);
@@ -591,6 +593,7 @@ static void osst_init_aux(struct osst_tape * STp, int frame_type, int frame_seq_
 		dat->dat_list[0].flags    = frame_type==OS_FRAME_TYPE_MARKER?
 							OS_DAT_FLAGS_MARK:OS_DAT_FLAGS_DATA;
 		dat->dat_list[0].reserved = 0;
+		/* fall through */
 	  case	OS_FRAME_TYPE_EOD:
 		aux->update_frame_cntr    = htonl(0);
 		par->partition_num        = OS_DATA_PARTITION;
@@ -4086,6 +4089,7 @@ static int osst_int_ioctl(struct osst_tape * STp, struct osst_request ** aSRpnt,
 	switch (cmd_in) {
 	 case MTFSFM:
 		chg_eof = 0; /* Changed from the FSF after this */
+		/* fall through */
 	 case MTFSF:
 		if (STp->raw)
 		   return (-EIO);
@@ -4101,6 +4105,7 @@ static int osst_int_ioctl(struct osst_tape * STp, struct osst_request ** aSRpnt,
 
 	 case MTBSF:
 		chg_eof = 0; /* Changed from the FSF after this */
+		/* fall through */
 	 case MTBSFM:
 		if (STp->raw)
 		   return (-EIO);
@@ -4312,6 +4317,7 @@ static int osst_int_ioctl(struct osst_tape * STp, struct osst_request ** aSRpnt,
 					   name, STp->block_size);
 			 return 0;
 		 }
+		/* fall through */
 	 case MTSETDENSITY:       /* Set tape density */
 	 case MTSETDRVBUFFER:     /* Set drive buffering */
 	 case SET_DENS_AND_BLK:   /* Set density and block size */
diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c
index c182b5458f98..35213082e933 100644
--- a/drivers/scsi/ppa.c
+++ b/drivers/scsi/ppa.c
@@ -717,6 +717,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)
 			}
 			cmd->SCp.phase++;
 		}
+		/* fall through */
 
 	case 2:		/* Phase 2 - We are now talking to the scsi bus */
 		if (!ppa_select(dev, scmd_id(cmd))) {
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c
index 0a2a54517b15..054fb0599263 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c
@@ -3072,6 +3072,7 @@ static void sym_sir_bad_scsi_status(struct sym_hcb *np, int num, struct sym_ccb
 			sym_print_addr(cp->cmd, "%s\n",
 			        s_status == S_BUSY ? "BUSY" : "QUEUE FULL\n");
 		}
+		/* fall through */
 	default:	/* S_INT, S_INT_COND_MET, S_CONFLICT */
 		sym_complete_error (np, cp);
 		break;
@@ -4632,6 +4633,7 @@ static void sym_int_sir(struct sym_hcb *np)
 	 *  Negotiation failed.
 	 *  Target does not want answer message.
 	 */
+	/* fall through */
 	case SIR_NEGO_PROTO:
 		sym_nego_default(np, tp, cp);
 		goto out;
diff --git a/drivers/scsi/sym53c8xx_2/sym_nvram.c b/drivers/scsi/sym53c8xx_2/sym_nvram.c
index 5662fbb3ff60..0d37b4f07b5e 100644
--- a/drivers/scsi/sym53c8xx_2/sym_nvram.c
+++ b/drivers/scsi/sym53c8xx_2/sym_nvram.c
@@ -708,6 +708,7 @@ static int sym_read_Tekram_nvram (struct sym_device *np, Tekram_nvram *nvram)
 					  data, len);
 		if (!x)
 			break;
+		/* fall through */
 	default:
 		x = sym_read_T93C46_nvram(np, nvram);
 		break;
diff --git a/drivers/soc/amlogic/meson-gx-socinfo.c b/drivers/soc/amlogic/meson-gx-socinfo.c
index 37ea0a1c24c8..bca34954518e 100644
--- a/drivers/soc/amlogic/meson-gx-socinfo.c
+++ b/drivers/soc/amlogic/meson-gx-socinfo.c
@@ -37,26 +37,34 @@ static const struct meson_gx_soc_id {
 	{ "AXG", 0x25 },
 	{ "GXLX", 0x26 },
 	{ "TXHD", 0x27 },
+	{ "G12A", 0x28 },
+	{ "G12B", 0x29 },
 };
 
 static const struct meson_gx_package_id {
 	const char *name;
 	unsigned int major_id;
 	unsigned int pack_id;
+	unsigned int pack_mask;
 } soc_packages[] = {
-	{ "S905", 0x1f, 0 },
-	{ "S905H", 0x1f, 0x13 },
-	{ "S905M", 0x1f, 0x20 },
-	{ "S905D", 0x21, 0 },
-	{ "S905X", 0x21, 0x80 },
-	{ "S905W", 0x21, 0xa0 },
-	{ "S905L", 0x21, 0xc0 },
-	{ "S905M2", 0x21, 0xe0 },
-	{ "S912", 0x22, 0 },
-	{ "962X", 0x24, 0x10 },
-	{ "962E", 0x24, 0x20 },
-	{ "A113X", 0x25, 0x37 },
-	{ "A113D", 0x25, 0x22 },
+	{ "S905", 0x1f, 0, 0x20 }, /* pack_id != 0x20 */
+	{ "S905H", 0x1f, 0x3, 0xf }, /* pack_id & 0xf == 0x3 */
+	{ "S905M", 0x1f, 0x20, 0xf0 }, /* pack_id == 0x20 */
+	{ "S905D", 0x21, 0, 0xf0 },
+	{ "S905X", 0x21, 0x80, 0xf0 },
+	{ "S905W", 0x21, 0xa0, 0xf0 },
+	{ "S905L", 0x21, 0xc0, 0xf0 },
+	{ "S905M2", 0x21, 0xe0, 0xf0 },
+	{ "S805X", 0x21, 0x30, 0xf0 },
+	{ "S805Y", 0x21, 0xb0, 0xf0 },
+	{ "S912", 0x22, 0, 0x0 }, /* Only S912 is known for GXM */
+	{ "962X", 0x24, 0x10, 0xf0 },
+	{ "962E", 0x24, 0x20, 0xf0 },
+	{ "A113X", 0x25, 0x37, 0xff },
+	{ "A113D", 0x25, 0x22, 0xff },
+	{ "S905D2", 0x28, 0x10, 0xf0 },
+	{ "S905X2", 0x28, 0x40, 0xf0 },
+	{ "S922X", 0x29, 0x40, 0xf0 },
 };
 
 static inline unsigned int socinfo_to_major(u32 socinfo)
@@ -81,13 +89,14 @@ static inline unsigned int socinfo_to_misc(u32 socinfo)
 
 static const char *socinfo_to_package_id(u32 socinfo)
 {
-	unsigned int pack = socinfo_to_pack(socinfo) & 0xf0;
+	unsigned int pack = socinfo_to_pack(socinfo);
 	unsigned int major = socinfo_to_major(socinfo);
 	int i;
 
 	for (i = 0 ; i < ARRAY_SIZE(soc_packages) ; ++i) {
 		if (soc_packages[i].major_id == major &&
-		    soc_packages[i].pack_id == pack)
+		    soc_packages[i].pack_id ==
+				(pack & soc_packages[i].pack_mask))
 			return soc_packages[i].name;
 	}
 
@@ -123,8 +132,10 @@ static int __init meson_gx_socinfo_init(void)
 		return -ENODEV;
 
 	/* check if interface is enabled */
-	if (!of_device_is_available(np))
+	if (!of_device_is_available(np)) {
+		of_node_put(np);
 		return -ENODEV;
+	}
 
 	/* check if chip-id is available */
 	if (!of_property_read_bool(np, "amlogic,has-chip-id"))
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 6ec647bbba77..a81ae29aa68a 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -1494,7 +1494,7 @@ static int spi_imx_transfer(struct spi_device *spi,
 
 	/* flush rxfifo before transfer */
 	while (spi_imx->devtype_data->rx_available(spi_imx))
-		spi_imx->rx(spi_imx);
+		readl(spi_imx->base + MXC_CSPIRXDATA);
 
 	if (spi_imx->slave_mode)
 		return spi_imx_pio_transfer_slave(spi, transfer);
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index 556870dcdf79..3be8fbe80b08 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -271,7 +271,8 @@ static int rspi_set_config_register(struct rspi_data *rspi, int access_size)
 	/* Sets parity, interrupt mask */
 	rspi_write8(rspi, 0x00, RSPI_SPCR2);
 
-	/* Sets SPCMD */
+	/* Resets sequencer */
+	rspi_write8(rspi, 0, RSPI_SPSCR);
 	rspi->spcmd |= SPCMD_SPB_8_TO_16(access_size);
 	rspi_write16(rspi, rspi->spcmd, RSPI_SPCMD0);
 
@@ -315,7 +316,8 @@ static int rspi_rz_set_config_register(struct rspi_data *rspi, int access_size)
 	rspi_write8(rspi, 0x00, RSPI_SSLND);
 	rspi_write8(rspi, 0x00, RSPI_SPND);
 
-	/* Sets SPCMD */
+	/* Resets sequencer */
+	rspi_write8(rspi, 0, RSPI_SPSCR);
 	rspi->spcmd |= SPCMD_SPB_8_TO_16(access_size);
 	rspi_write16(rspi, rspi->spcmd, RSPI_SPCMD0);
 
@@ -366,7 +368,8 @@ static int qspi_set_config_register(struct rspi_data *rspi, int access_size)
 	/* Sets buffer to allow normal operation */
 	rspi_write8(rspi, 0x00, QSPI_SPBFCR);
 
-	/* Sets SPCMD */
+	/* Resets sequencer */
+	rspi_write8(rspi, 0, RSPI_SPSCR);
 	rspi_write16(rspi, rspi->spcmd, RSPI_SPCMD0);
 
 	/* Sets RSPI mode */
@@ -868,28 +871,6 @@ static int qspi_transfer_one(struct spi_controller *ctlr,
 	}
 }
 
-static int rspi_setup(struct spi_device *spi)
-{
-	struct rspi_data *rspi = spi_controller_get_devdata(spi->controller);
-
-	rspi->max_speed_hz = spi->max_speed_hz;
-
-	rspi->spcmd = SPCMD_SSLKP;
-	if (spi->mode & SPI_CPOL)
-		rspi->spcmd |= SPCMD_CPOL;
-	if (spi->mode & SPI_CPHA)
-		rspi->spcmd |= SPCMD_CPHA;
-
-	/* CMOS output mode and MOSI signal from previous transfer */
-	rspi->sppcr = 0;
-	if (spi->mode & SPI_LOOP)
-		rspi->sppcr |= SPPCR_SPLP;
-
-	set_config_register(rspi, 8);
-
-	return 0;
-}
-
 static u16 qspi_transfer_mode(const struct spi_transfer *xfer)
 {
 	if (xfer->tx_buf)
@@ -959,8 +940,24 @@ static int rspi_prepare_message(struct spi_controller *ctlr,
 				struct spi_message *msg)
 {
 	struct rspi_data *rspi = spi_controller_get_devdata(ctlr);
+	struct spi_device *spi = msg->spi;
 	int ret;
 
+	rspi->max_speed_hz = spi->max_speed_hz;
+
+	rspi->spcmd = SPCMD_SSLKP;
+	if (spi->mode & SPI_CPOL)
+		rspi->spcmd |= SPCMD_CPOL;
+	if (spi->mode & SPI_CPHA)
+		rspi->spcmd |= SPCMD_CPHA;
+
+	/* CMOS output mode and MOSI signal from previous transfer */
+	rspi->sppcr = 0;
+	if (spi->mode & SPI_LOOP)
+		rspi->sppcr |= SPPCR_SPLP;
+
+	set_config_register(rspi, 8);
+
 	if (msg->spi->mode &
 	    (SPI_TX_DUAL | SPI_TX_QUAD | SPI_RX_DUAL | SPI_RX_QUAD)) {
 		/* Setup sequencer for messages with multiple transfer modes */
@@ -1267,7 +1264,6 @@ static int rspi_probe(struct platform_device *pdev)
 	init_waitqueue_head(&rspi->wait);
 
 	ctlr->bus_num = pdev->id;
-	ctlr->setup = rspi_setup;
 	ctlr->auto_runtime_pm = true;
 	ctlr->transfer_one = ops->transfer_one;
 	ctlr->prepare_message = rspi_prepare_message;
diff --git a/drivers/spi/spi-stm32-qspi.c b/drivers/spi/spi-stm32-qspi.c
index 3b2a9a6b990d..7354f9d68dba 100644
--- a/drivers/spi/spi-stm32-qspi.c
+++ b/drivers/spi/spi-stm32-qspi.c
@@ -76,7 +76,6 @@
 #define QSPI_PSMAR		0x28
 #define QSPI_PIR		0x2c
 #define QSPI_LPTR		0x30
-#define LPTR_DFT_TIMEOUT	0x10
 
 #define STM32_QSPI_MAX_MMAP_SZ	SZ_256M
 #define STM32_QSPI_MAX_NORCHIP	2
@@ -372,8 +371,7 @@ static int stm32_qspi_setup(struct spi_device *spi)
 	flash->presc = presc;
 
 	mutex_lock(&qspi->lock);
-	writel_relaxed(LPTR_DFT_TIMEOUT, qspi->io_base + QSPI_LPTR);
-	cr = FIELD_PREP(CR_FTHRES_MASK, 3) | CR_TCEN | CR_SSHIFT | CR_EN;
+	cr = FIELD_PREP(CR_FTHRES_MASK, 3) | CR_SSHIFT | CR_EN;
 	writel_relaxed(cr, qspi->io_base + QSPI_CR);
 
 	/* set dcr fsize to max address */
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 93986f879b09..2be394d3bc59 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1039,6 +1039,8 @@ static int spi_map_msg(struct spi_controller *ctlr, struct spi_message *msg)
 		if (max_tx || max_rx) {
 			list_for_each_entry(xfer, &msg->transfers,
 					    transfer_list) {
+				if (!xfer->len)
+					continue;
 				if (!xfer->tx_buf)
 					xfer->tx_buf = ctlr->dummy_tx;
 				if (!xfer->rx_buf)
diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c
index 720760cd493f..ba39647a690c 100644
--- a/drivers/thermal/broadcom/bcm2835_thermal.c
+++ b/drivers/thermal/broadcom/bcm2835_thermal.c
@@ -119,8 +119,7 @@ static const struct debugfs_reg32 bcm2835_thermal_regs[] = {
 
 static void bcm2835_thermal_debugfs(struct platform_device *pdev)
 {
-	struct thermal_zone_device *tz = platform_get_drvdata(pdev);
-	struct bcm2835_thermal_data *data = tz->devdata;
+	struct bcm2835_thermal_data *data = platform_get_drvdata(pdev);
 	struct debugfs_regset32 *regset;
 
 	data->debugfsdir = debugfs_create_dir("bcm2835_thermal", NULL);
@@ -266,7 +265,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
 
 	data->tz = tz;
 
-	platform_set_drvdata(pdev, tz);
+	platform_set_drvdata(pdev, data);
 
 	/*
 	 * Thermal_zone doesn't enable hwmon as default,
@@ -290,8 +289,8 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
 
 static int bcm2835_thermal_remove(struct platform_device *pdev)
 {
-	struct thermal_zone_device *tz = platform_get_drvdata(pdev);
-	struct bcm2835_thermal_data *data = tz->devdata;
+	struct bcm2835_thermal_data *data = platform_get_drvdata(pdev);
+	struct thermal_zone_device *tz = data->tz;
 
 	debugfs_remove_recursive(data->debugfsdir);
 	thermal_zone_of_sensor_unregister(&pdev->dev, tz);
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index 6fff16113628..f7c1f49ec87f 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -536,12 +536,11 @@ static int cpufreq_power2state(struct thermal_cooling_device *cdev,
 			       struct thermal_zone_device *tz, u32 power,
 			       unsigned long *state)
 {
-	unsigned int cur_freq, target_freq;
+	unsigned int target_freq;
 	u32 last_load, normalised_power;
 	struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata;
 	struct cpufreq_policy *policy = cpufreq_cdev->policy;
 
-	cur_freq = cpufreq_quick_get(policy->cpu);
 	power = power > 0 ? power : 0;
 	last_load = cpufreq_cdev->last_load ?: 1;
 	normalised_power = (power * 100) / last_load;
diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
index 61ca7ce3624e..5f3ed24e26ec 100644
--- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
@@ -22,6 +22,13 @@ enum int3400_thermal_uuid {
 	INT3400_THERMAL_PASSIVE_1,
 	INT3400_THERMAL_ACTIVE,
 	INT3400_THERMAL_CRITICAL,
+	INT3400_THERMAL_ADAPTIVE_PERFORMANCE,
+	INT3400_THERMAL_EMERGENCY_CALL_MODE,
+	INT3400_THERMAL_PASSIVE_2,
+	INT3400_THERMAL_POWER_BOSS,
+	INT3400_THERMAL_VIRTUAL_SENSOR,
+	INT3400_THERMAL_COOLING_MODE,
+	INT3400_THERMAL_HARDWARE_DUTY_CYCLING,
 	INT3400_THERMAL_MAXIMUM_UUID,
 };
 
@@ -29,6 +36,13 @@ static char *int3400_thermal_uuids[INT3400_THERMAL_MAXIMUM_UUID] = {
 	"42A441D6-AE6A-462b-A84B-4A8CE79027D3",
 	"3A95C389-E4B8-4629-A526-C52C88626BAE",
 	"97C68AE7-15FA-499c-B8C9-5DA81D606E0A",
+	"63BE270F-1C11-48FD-A6F7-3AF253FF3E2D",
+	"5349962F-71E6-431D-9AE8-0A635B710AEE",
+	"9E04115A-AE87-4D1C-9500-0F3E340BFE75",
+	"F5A35014-C209-46A4-993A-EB56DE7530A1",
+	"6ED722A7-9240-48A5-B479-31EEF723D7CF",
+	"16CAF1B7-DD38-40ED-B1C1-1B8A1913D531",
+	"BE84BABF-C4D4-403D-B495-3128FD44dAC1",
 };
 
 struct int3400_thermal_priv {
@@ -299,10 +313,9 @@ static int int3400_thermal_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, priv);
 
-	if (priv->uuid_bitmap & 1 << INT3400_THERMAL_PASSIVE_1) {
-		int3400_thermal_ops.get_mode = int3400_thermal_get_mode;
-		int3400_thermal_ops.set_mode = int3400_thermal_set_mode;
-	}
+	int3400_thermal_ops.get_mode = int3400_thermal_get_mode;
+	int3400_thermal_ops.set_mode = int3400_thermal_set_mode;
+
 	priv->thermal = thermal_zone_device_register("INT3400 Thermal", 0, 0,
 						priv, &int3400_thermal_ops,
 						&int3400_thermal_params, 0, 0);
diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c
index 7571f7c2e7c9..b12ecd436e23 100644
--- a/drivers/thermal/intel/intel_powerclamp.c
+++ b/drivers/thermal/intel/intel_powerclamp.c
@@ -101,7 +101,7 @@ struct powerclamp_worker_data {
 	bool clamping;
 };
 
-static struct powerclamp_worker_data * __percpu worker_data;
+static struct powerclamp_worker_data __percpu *worker_data;
 static struct thermal_cooling_device *cooling_dev;
 static unsigned long *cpu_clamping_mask;  /* bit map for tracking per cpu
 					   * clamping kthread worker
diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c
index 5c07a61447d3..fa035579e560 100644
--- a/drivers/thermal/mtk_thermal.c
+++ b/drivers/thermal/mtk_thermal.c
@@ -225,6 +225,9 @@ enum {
 /* The calibration coefficient of sensor  */
 #define MT8183_CALIBRATION	153
 
+/* The maximum number of banks */
+#define MAX_NUM_ZONES		8
+
 struct mtk_thermal;
 
 struct thermal_bank_cfg {
@@ -249,7 +252,7 @@ struct mtk_thermal_data {
 	const int num_controller;
 	const int *controller_offset;
 	bool need_switch_bank;
-	struct thermal_bank_cfg bank_data[];
+	struct thermal_bank_cfg bank_data[MAX_NUM_ZONES];
 };
 
 struct mtk_thermal {
@@ -268,7 +271,7 @@ struct mtk_thermal {
 	s32 vts[MAX_NUM_VTS];
 
 	const struct mtk_thermal_data *conf;
-	struct mtk_thermal_bank banks[];
+	struct mtk_thermal_bank banks[MAX_NUM_ZONES];
 };
 
 /* MT8183 thermal sensor data */
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 48eef552cba4..fc9399d9c082 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -666,7 +666,7 @@ static int exynos_get_temp(void *p, int *temp)
 	struct exynos_tmu_data *data = p;
 	int value, ret = 0;
 
-	if (!data || !data->tmu_read || !data->enabled)
+	if (!data || !data->tmu_read)
 		return -EINVAL;
 	else if (!data->enabled)
 		/*
diff --git a/drivers/thunderbolt/property.c b/drivers/thunderbolt/property.c
index b2f0d6386cee..841314deb446 100644
--- a/drivers/thunderbolt/property.c
+++ b/drivers/thunderbolt/property.c
@@ -176,6 +176,10 @@ static struct tb_property_dir *__tb_property_parse_dir(const u32 *block,
 	} else {
 		dir->uuid = kmemdup(&block[dir_offset], sizeof(*dir->uuid),
 				    GFP_KERNEL);
+		if (!dir->uuid) {
+			tb_property_free_dir(dir);
+			return NULL;
+		}
 		content_offset = dir_offset + 4;
 		content_len = dir_len - 4; /* Length includes UUID */
 	}
@@ -548,6 +552,11 @@ int tb_property_add_data(struct tb_property_dir *parent, const char *key,
 
 	property->length = size / 4;
 	property->value.data = kzalloc(size, GFP_KERNEL);
+	if (!property->value.data) {
+		kfree(property);
+		return -ENOMEM;
+	}
+
 	memcpy(property->value.data, buf, buflen);
 
 	list_add_tail(&property->list, &parent->properties);
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 18846afb39da..89906a64dec1 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -692,6 +692,7 @@ static void *virtqueue_get_buf_ctx_split(struct virtqueue *_vq,
 	void *ret;
 	unsigned int i;
 	u16 last_used;
+	bool nomore;
 
 	START_USE(vq);
 
@@ -700,14 +701,15 @@ static void *virtqueue_get_buf_ctx_split(struct virtqueue *_vq,
 		return NULL;
 	}
 
-	if (!more_used_split(vq)) {
+	nomore = !more_used_split(vq);
+	if (nomore) {
 		pr_debug("No more buffers in queue\n");
 		END_USE(vq);
 		return NULL;
 	}
 
 	/* Only get used array entries after they have been exposed by host. */
-	virtio_rmb(vq->weak_barriers);
+	vq = dependent_ptr_mb(vq, nomore);
 
 	last_used = (vq->last_used_idx & (vq->split.vring.num - 1));
 	i = virtio32_to_cpu(_vq->vdev,
@@ -1355,8 +1357,10 @@ static void *virtqueue_get_buf_ctx_packed(struct virtqueue *_vq,
 {
 	struct vring_virtqueue *vq = to_vvq(_vq);
 	u16 last_used, id;
+	bool nomore;
 	void *ret;
 
+
 	START_USE(vq);
 
 	if (unlikely(vq->broken)) {
@@ -1364,14 +1368,15 @@ static void *virtqueue_get_buf_ctx_packed(struct virtqueue *_vq,
 		return NULL;
 	}
 
-	if (!more_used_packed(vq)) {
+	nomore = !more_used_packed(vq);
+	if (nomore) {
 		pr_debug("No more buffers in queue\n");
 		END_USE(vq);
 		return NULL;
 	}
 
 	/* Only get used elements after they have been exposed by host. */
-	virtio_rmb(vq->weak_barriers);
+	vq = dependent_ptr_mb(vq, nomore);
 
 	last_used = vq->last_used_idx;
 	id = le16_to_cpu(vq->packed.vring.desc[last_used].id);
diff --git a/fs/Kconfig b/fs/Kconfig
index 3e6d3101f3ff..55c87a726a23 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -214,7 +214,7 @@ config HUGETLB_PAGE
 config MEMFD_CREATE
 	def_bool TMPFS || HUGETLBFS
 
-config ARCH_HAS_GIGANTIC_PAGE
+config ARCH_HAS_GIGANTIC_PAGE_RUNTIME_ALLOCATION
 	bool
 
 source "fs/configfs/Kconfig"
diff --git a/fs/adfs/dir_f.c b/fs/adfs/dir_f.c
index 0fbfd0b04ae0..382c9d7ad375 100644
--- a/fs/adfs/dir_f.c
+++ b/fs/adfs/dir_f.c
@@ -24,8 +24,11 @@ static inline unsigned int adfs_readval(unsigned char *p, int len)
 
 	switch (len) {
 	case 4:		val |= p[3] << 24;
+			/* fall through */
 	case 3:		val |= p[2] << 16;
+			/* fall through */
 	case 2:		val |= p[1] << 8;
+			/* fall through */
 	default:	val |= p[0];
 	}
 	return val;
@@ -35,8 +38,11 @@ static inline void adfs_writeval(unsigned char *p, int len, unsigned int val)
 {
 	switch (len) {
 	case 4:		p[3] = val >> 24;
+			/* fall through */
 	case 3:		p[2] = val >> 16;
+			/* fall through */
 	case 2:		p[1] = val >> 8;
+			/* fall through */
 	default:	p[0] = val;
 	}
 }
diff --git a/fs/affs/super.c b/fs/affs/super.c
index d1ad11a8a4a5..3accc6daec68 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -487,7 +487,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
 		break;
 	case MUFS_OFS:
 		affs_set_opt(sbi->s_flags, SF_MUFS);
-		/* fall thru */
+		/* fall through */
 	case FS_OFS:
 		affs_set_opt(sbi->s_flags, SF_OFS);
 		sb->s_flags |= SB_NOEXEC;
@@ -495,6 +495,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
 	case MUFS_DCOFS:
 	case MUFS_INTLOFS:
 		affs_set_opt(sbi->s_flags, SF_MUFS);
+		/* fall through */
 	case FS_DCOFS:
 	case FS_INTLOFS:
 		affs_set_opt(sbi->s_flags, SF_INTL);
diff --git a/fs/afs/cmservice.c b/fs/afs/cmservice.c
index 8ee5972893ed..40e09bf547e3 100644
--- a/fs/afs/cmservice.c
+++ b/fs/afs/cmservice.c
@@ -285,6 +285,7 @@ static int afs_deliver_cb_callback(struct afs_call *call)
 		call->unmarshall++;
 
 		/* extract the FID array and its count in two steps */
+		/* fall through */
 	case 1:
 		_debug("extract FID count");
 		ret = afs_extract_data(call, true);
@@ -304,6 +305,7 @@ static int afs_deliver_cb_callback(struct afs_call *call)
 		afs_extract_to_buf(call, call->count * 3 * 4);
 		call->unmarshall++;
 
+		/* Fall through */
 	case 2:
 		_debug("extract FID array");
 		ret = afs_extract_data(call, true);
@@ -329,6 +331,7 @@ static int afs_deliver_cb_callback(struct afs_call *call)
 		call->unmarshall++;
 
 		/* extract the callback array and its count in two steps */
+		/* fall through */
 	case 3:
 		_debug("extract CB count");
 		ret = afs_extract_data(call, true);
@@ -344,6 +347,7 @@ static int afs_deliver_cb_callback(struct afs_call *call)
 		iov_iter_discard(&call->iter, READ, call->count2 * 3 * 4);
 		call->unmarshall++;
 
+		/* Fall through */
 	case 4:
 		_debug("extract discard %zu/%u",
 		       iov_iter_count(&call->iter), call->count2 * 3 * 4);
@@ -422,6 +426,7 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call)
 		afs_extract_to_buf(call, 11 * sizeof(__be32));
 		call->unmarshall++;
 
+		/* Fall through */
 	case 1:
 		_debug("extract UUID");
 		ret = afs_extract_data(call, false);
@@ -537,6 +542,7 @@ static int afs_deliver_cb_probe_uuid(struct afs_call *call)
 		afs_extract_to_buf(call, 11 * sizeof(__be32));
 		call->unmarshall++;
 
+		/* Fall through */
 	case 1:
 		_debug("extract UUID");
 		ret = afs_extract_data(call, false);
@@ -673,6 +679,7 @@ static int afs_deliver_yfs_cb_callback(struct afs_call *call)
 		call->unmarshall++;
 
 		/* extract the FID array and its count in two steps */
+		/* Fall through */
 	case 1:
 		_debug("extract FID count");
 		ret = afs_extract_data(call, true);
@@ -692,6 +699,7 @@ static int afs_deliver_yfs_cb_callback(struct afs_call *call)
 		afs_extract_to_buf(call, size);
 		call->unmarshall++;
 
+		/* Fall through */
 	case 2:
 		_debug("extract FID array");
 		ret = afs_extract_data(call, false);
diff --git a/fs/afs/file.c b/fs/afs/file.c
index 323ae9912203..e8d6619890a9 100644
--- a/fs/afs/file.c
+++ b/fs/afs/file.c
@@ -300,6 +300,8 @@ int afs_page_filler(void *data, struct page *page)
 		/* page will not be cached */
 	case -ENOBUFS:
 		_debug("cache said ENOBUFS");
+
+		/* fall through */
 	default:
 	go_on:
 		req = kzalloc(sizeof(struct afs_read) + sizeof(struct page *),
diff --git a/fs/afs/flock.c b/fs/afs/flock.c
index e432bd27a2e7..6a0174258382 100644
--- a/fs/afs/flock.c
+++ b/fs/afs/flock.c
@@ -303,6 +303,7 @@ void afs_lock_work(struct work_struct *work)
 			return;
 		}
 
+		/* Fall through */
 	default:
 		/* Looks like a lock request was withdrawn. */
 		spin_unlock(&vnode->lock);
diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c
index ca08c83168f5..06277408477b 100644
--- a/fs/afs/fsclient.c
+++ b/fs/afs/fsclient.c
@@ -498,7 +498,7 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)
 			afs_extract_to_tmp(call);
 		}
 
-		/* extract the returned data length */
+		/* Fall through - and extract the returned data length */
 	case 1:
 		_debug("extract data length");
 		ret = afs_extract_data(call, true);
@@ -525,7 +525,7 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)
 		iov_iter_bvec(&call->iter, READ, call->bvec, 1, size);
 		ASSERTCMP(size, <=, PAGE_SIZE);
 
-		/* extract the returned data */
+		/* Fall through - and extract the returned data */
 	case 2:
 		_debug("extract data %zu/%llu",
 		       iov_iter_count(&call->iter), req->remain);
@@ -552,6 +552,8 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)
 		/* Discard any excess data the server gave us */
 		iov_iter_discard(&call->iter, READ, req->actual_len - req->len);
 		call->unmarshall = 3;
+
+		/* Fall through */
 	case 3:
 		_debug("extract discard %zu/%llu",
 		       iov_iter_count(&call->iter), req->actual_len - req->len);
@@ -564,7 +566,7 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)
 		call->unmarshall = 4;
 		afs_extract_to_buf(call, (21 + 3 + 6) * 4);
 
-		/* extract the metadata */
+		/* Fall through - and extract the metadata */
 	case 4:
 		ret = afs_extract_data(call, false);
 		if (ret < 0)
@@ -1634,7 +1636,7 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call)
 		call->unmarshall++;
 		afs_extract_to_buf(call, 12 * 4);
 
-		/* extract the returned status record */
+		/* Fall through - and extract the returned status record */
 	case 1:
 		_debug("extract status");
 		ret = afs_extract_data(call, true);
@@ -1646,7 +1648,7 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call)
 		call->unmarshall++;
 		afs_extract_to_tmp(call);
 
-		/* extract the volume name length */
+		/* Fall through - and extract the volume name length */
 	case 2:
 		ret = afs_extract_data(call, true);
 		if (ret < 0)
@@ -1661,7 +1663,7 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call)
 		afs_extract_begin(call, call->reply[2], size);
 		call->unmarshall++;
 
-		/* extract the volume name */
+		/* Fall through - and extract the volume name */
 	case 3:
 		_debug("extract volname");
 		ret = afs_extract_data(call, true);
@@ -1674,7 +1676,7 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call)
 		afs_extract_to_tmp(call);
 		call->unmarshall++;
 
-		/* extract the offline message length */
+		/* Fall through - and extract the offline message length */
 	case 4:
 		ret = afs_extract_data(call, true);
 		if (ret < 0)
@@ -1689,7 +1691,7 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call)
 		afs_extract_begin(call, call->reply[2], size);
 		call->unmarshall++;
 
-		/* extract the offline message */
+		/* Fall through - and extract the offline message */
 	case 5:
 		_debug("extract offline");
 		ret = afs_extract_data(call, true);
@@ -1703,7 +1705,7 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call)
 		afs_extract_to_tmp(call);
 		call->unmarshall++;
 
-		/* extract the message of the day length */
+		/* Fall through - and extract the message of the day length */
 	case 6:
 		ret = afs_extract_data(call, true);
 		if (ret < 0)
@@ -1718,7 +1720,7 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call)
 		afs_extract_begin(call, call->reply[2], size);
 		call->unmarshall++;
 
-		/* extract the message of the day */
+		/* Fall through - and extract the message of the day */
 	case 7:
 		_debug("extract motd");
 		ret = afs_extract_data(call, false);
@@ -2016,7 +2018,7 @@ static int afs_deliver_fs_get_capabilities(struct afs_call *call)
 		afs_extract_to_tmp(call);
 		call->unmarshall++;
 
-		/* Extract the capabilities word count */
+		/* Fall through - and extract the capabilities word count */
 	case 1:
 		ret = afs_extract_data(call, true);
 		if (ret < 0)
@@ -2029,7 +2031,7 @@ static int afs_deliver_fs_get_capabilities(struct afs_call *call)
 		iov_iter_discard(&call->iter, READ, count * sizeof(__be32));
 		call->unmarshall++;
 
-		/* Extract capabilities words */
+		/* Fall through - and extract capabilities words */
 	case 2:
 		ret = afs_extract_data(call, false);
 		if (ret < 0)
@@ -2206,6 +2208,7 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call)
 		call->unmarshall++;
 
 		/* Extract the file status count and array in two steps */
+		/* Fall through */
 	case 1:
 		_debug("extract status count");
 		ret = afs_extract_data(call, true);
@@ -2223,6 +2226,7 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call)
 	more_counts:
 		afs_extract_to_buf(call, 21 * sizeof(__be32));
 
+		/* Fall through */
 	case 2:
 		_debug("extract status array %u", call->count);
 		ret = afs_extract_data(call, true);
@@ -2246,6 +2250,7 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call)
 		afs_extract_to_tmp(call);
 
 		/* Extract the callback count and array in two steps */
+		/* Fall through */
 	case 3:
 		_debug("extract CB count");
 		ret = afs_extract_data(call, true);
@@ -2262,6 +2267,7 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call)
 	more_cbs:
 		afs_extract_to_buf(call, 3 * sizeof(__be32));
 
+		/* Fall through */
 	case 4:
 		_debug("extract CB array");
 		ret = afs_extract_data(call, true);
@@ -2284,6 +2290,7 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call)
 		afs_extract_to_buf(call, 6 * sizeof(__be32));
 		call->unmarshall++;
 
+		/* Fall through */
 	case 5:
 		ret = afs_extract_data(call, false);
 		if (ret < 0)
diff --git a/fs/afs/misc.c b/fs/afs/misc.c
index bbb1fd51b019..7f2af061ea06 100644
--- a/fs/afs/misc.c
+++ b/fs/afs/misc.c
@@ -131,33 +131,42 @@ void afs_prioritise_error(struct afs_error *e, int error, u32 abort_code)
 		if (e->error == -ETIMEDOUT ||
 		    e->error == -ETIME)
 			return;
+		/* Fall through */
 	case -ETIMEDOUT:
 	case -ETIME:
 		if (e->error == -ENOMEM ||
 		    e->error == -ENONET)
 			return;
+		/* Fall through */
 	case -ENOMEM:
 	case -ENONET:
 		if (e->error == -ERFKILL)
 			return;
+		/* Fall through */
 	case -ERFKILL:
 		if (e->error == -EADDRNOTAVAIL)
 			return;
+		/* Fall through */
 	case -EADDRNOTAVAIL:
 		if (e->error == -ENETUNREACH)
 			return;
+		/* Fall through */
 	case -ENETUNREACH:
 		if (e->error == -EHOSTUNREACH)
 			return;
+		/* Fall through */
 	case -EHOSTUNREACH:
 		if (e->error == -EHOSTDOWN)
 			return;
+		/* Fall through */
 	case -EHOSTDOWN:
 		if (e->error == -ECONNREFUSED)
 			return;
+		/* Fall through */
 	case -ECONNREFUSED:
 		if (e->error == -ECONNRESET)
 			return;
+		/* Fall through */
 	case -ECONNRESET: /* Responded, but call expired. */
 		if (e->responded)
 			return;
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
index 2c588f9bbbda..b3a8dfa784c4 100644
--- a/fs/afs/rxrpc.c
+++ b/fs/afs/rxrpc.c
@@ -909,6 +909,7 @@ void afs_send_empty_reply(struct afs_call *call)
 		_debug("oom");
 		rxrpc_kernel_abort_call(net->socket, call->rxcall,
 					RX_USER_ABORT, -ENOMEM, "KOO");
+		/* Fall through */
 	default:
 		_leave(" [error]");
 		return;
diff --git a/fs/afs/vlclient.c b/fs/afs/vlclient.c
index c3d9e5a5f67e..b0175b3ef0e8 100644
--- a/fs/afs/vlclient.c
+++ b/fs/afs/vlclient.c
@@ -195,7 +195,9 @@ static int afs_deliver_vl_get_addrs_u(struct afs_call *call)
 				   sizeof(struct afs_uuid__xdr) + 3 * sizeof(__be32));
 		call->unmarshall++;
 
-		/* Extract the returned uuid, uniquifier, nentries and blkaddrs size */
+		/* Extract the returned uuid, uniquifier, nentries and
+		 * blkaddrs size */
+		/* Fall through */
 	case 1:
 		ret = afs_extract_data(call, true);
 		if (ret < 0)
@@ -220,7 +222,7 @@ static int afs_deliver_vl_get_addrs_u(struct afs_call *call)
 		count = min(call->count, 4U);
 		afs_extract_to_buf(call, count * sizeof(__be32));
 
-		/* Extract entries */
+		/* Fall through - and extract entries */
 	case 2:
 		ret = afs_extract_data(call, call->count > 4);
 		if (ret < 0)
@@ -323,7 +325,7 @@ static int afs_deliver_vl_get_capabilities(struct afs_call *call)
 		afs_extract_to_tmp(call);
 		call->unmarshall++;
 
-		/* Extract the capabilities word count */
+		/* Fall through - and extract the capabilities word count */
 	case 1:
 		ret = afs_extract_data(call, true);
 		if (ret < 0)
@@ -336,7 +338,7 @@ static int afs_deliver_vl_get_capabilities(struct afs_call *call)
 		call->unmarshall++;
 		afs_extract_discard(call, count * sizeof(__be32));
 
-		/* Extract capabilities words */
+		/* Fall through - and extract capabilities words */
 	case 2:
 		ret = afs_extract_data(call, false);
 		if (ret < 0)
@@ -436,6 +438,7 @@ static int afs_deliver_yfsvl_get_endpoints(struct afs_call *call)
 		/* Extract the returned uuid, uniquifier, fsEndpoints count and
 		 * either the first fsEndpoint type or the volEndpoints
 		 * count if there are no fsEndpoints. */
+		/* Fall through */
 	case 1:
 		ret = afs_extract_data(call, true);
 		if (ret < 0)
@@ -476,7 +479,7 @@ static int afs_deliver_yfsvl_get_endpoints(struct afs_call *call)
 		afs_extract_to_buf(call, size);
 		call->unmarshall = 2;
 
-		/* Extract fsEndpoints[] entries */
+		/* Fall through - and extract fsEndpoints[] entries */
 	case 2:
 		ret = afs_extract_data(call, true);
 		if (ret < 0)
@@ -529,6 +532,7 @@ static int afs_deliver_yfsvl_get_endpoints(struct afs_call *call)
 		 * extract the type of the next endpoint when we extract the
 		 * data of the current one, but this is the first...
 		 */
+		/* Fall through */
 	case 3:
 		ret = afs_extract_data(call, true);
 		if (ret < 0)
@@ -555,7 +559,7 @@ static int afs_deliver_yfsvl_get_endpoints(struct afs_call *call)
 		afs_extract_to_buf(call, size);
 		call->unmarshall = 4;
 
-		/* Extract volEndpoints[] entries */
+		/* Fall through - and extract volEndpoints[] entries */
 	case 4:
 		ret = afs_extract_data(call, true);
 		if (ret < 0)
@@ -591,7 +595,7 @@ static int afs_deliver_yfsvl_get_endpoints(struct afs_call *call)
 		afs_extract_discard(call, 0);
 		call->unmarshall = 5;
 
-		/* Done */
+		/* Fall through - Done */
 	case 5:
 		ret = afs_extract_data(call, false);
 		if (ret < 0)
diff --git a/fs/afs/yfsclient.c b/fs/afs/yfsclient.c
index 5aa57929e8c2..4c6096d23a5a 100644
--- a/fs/afs/yfsclient.c
+++ b/fs/afs/yfsclient.c
@@ -544,7 +544,7 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
 		afs_extract_to_tmp64(call);
 		call->unmarshall++;
 
-		/* extract the returned data length */
+		/* Fall through - and extract the returned data length */
 	case 1:
 		_debug("extract data length");
 		ret = afs_extract_data(call, true);
@@ -571,7 +571,7 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
 		iov_iter_bvec(&call->iter, READ, call->bvec, 1, size);
 		ASSERTCMP(size, <=, PAGE_SIZE);
 
-		/* extract the returned data */
+		/* Fall through - and extract the returned data */
 	case 2:
 		_debug("extract data %zu/%llu",
 		       iov_iter_count(&call->iter), req->remain);
@@ -598,6 +598,8 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
 		/* Discard any excess data the server gave us */
 		iov_iter_discard(&call->iter, READ, req->actual_len - req->len);
 		call->unmarshall = 3;
+
+		/* Fall through */
 	case 3:
 		_debug("extract discard %zu/%llu",
 		       iov_iter_count(&call->iter), req->actual_len - req->len);
@@ -613,7 +615,7 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
 				   sizeof(struct yfs_xdr_YFSCallBack) +
 				   sizeof(struct yfs_xdr_YFSVolSync));
 
-		/* extract the metadata */
+		/* Fall through - and extract the metadata */
 	case 4:
 		ret = afs_extract_data(call, false);
 		if (ret < 0)
@@ -629,6 +631,7 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
 
 		call->unmarshall++;
 
+		/* Fall through */
 	case 5:
 		break;
 	}
@@ -1584,7 +1587,7 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
 		call->unmarshall++;
 		afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSFetchVolumeStatus));
 
-		/* extract the returned status record */
+		/* Fall through - and extract the returned status record */
 	case 1:
 		_debug("extract status");
 		ret = afs_extract_data(call, true);
@@ -1596,7 +1599,7 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
 		call->unmarshall++;
 		afs_extract_to_tmp(call);
 
-		/* extract the volume name length */
+		/* Fall through - and extract the volume name length */
 	case 2:
 		ret = afs_extract_data(call, true);
 		if (ret < 0)
@@ -1611,7 +1614,7 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
 		afs_extract_begin(call, call->reply[2], size);
 		call->unmarshall++;
 
-		/* extract the volume name */
+		/* Fall through - and extract the volume name */
 	case 3:
 		_debug("extract volname");
 		ret = afs_extract_data(call, true);
@@ -1624,7 +1627,7 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
 		afs_extract_to_tmp(call);
 		call->unmarshall++;
 
-		/* extract the offline message length */
+		/* Fall through - and extract the offline message length */
 	case 4:
 		ret = afs_extract_data(call, true);
 		if (ret < 0)
@@ -1639,7 +1642,7 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
 		afs_extract_begin(call, call->reply[2], size);
 		call->unmarshall++;
 
-		/* extract the offline message */
+		/* Fall through - and extract the offline message */
 	case 5:
 		_debug("extract offline");
 		ret = afs_extract_data(call, true);
@@ -1653,7 +1656,7 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
 		afs_extract_to_tmp(call);
 		call->unmarshall++;
 
-		/* extract the message of the day length */
+		/* Fall through - and extract the message of the day length */
 	case 6:
 		ret = afs_extract_data(call, true);
 		if (ret < 0)
@@ -1668,7 +1671,7 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
 		afs_extract_begin(call, call->reply[2], size);
 		call->unmarshall++;
 
-		/* extract the message of the day */
+		/* Fall through - and extract the message of the day */
 	case 7:
 		_debug("extract motd");
 		ret = afs_extract_data(call, false);
@@ -1681,6 +1684,7 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
 
 		call->unmarshall++;
 
+		/* Fall through */
 	case 8:
 		break;
 	}
@@ -2026,6 +2030,7 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
 		call->unmarshall++;
 
 		/* Extract the file status count and array in two steps */
+		/* Fall through */
 	case 1:
 		_debug("extract status count");
 		ret = afs_extract_data(call, true);
@@ -2043,6 +2048,7 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
 	more_counts:
 		afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSFetchStatus));
 
+		/* Fall through */
 	case 2:
 		_debug("extract status array %u", call->count);
 		ret = afs_extract_data(call, true);
@@ -2066,6 +2072,7 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
 		afs_extract_to_tmp(call);
 
 		/* Extract the callback count and array in two steps */
+		/* Fall through */
 	case 3:
 		_debug("extract CB count");
 		ret = afs_extract_data(call, true);
@@ -2082,6 +2089,7 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
 	more_cbs:
 		afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSCallBack));
 
+		/* Fall through */
 	case 4:
 		_debug("extract CB array");
 		ret = afs_extract_data(call, true);
@@ -2104,6 +2112,7 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
 		afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSVolSync));
 		call->unmarshall++;
 
+		/* Fall through */
 	case 5:
 		ret = afs_extract_data(call, false);
 		if (ret < 0)
@@ -2114,6 +2123,7 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
 
 		call->unmarshall++;
 
+		/* Fall through */
 	case 6:
 		break;
 	}
diff --git a/fs/befs/btree.c b/fs/befs/btree.c
index 1b7e0f7128d6..76a401c48bae 100644
--- a/fs/befs/btree.c
+++ b/fs/befs/btree.c
@@ -6,7 +6,7 @@
  * Licensed under the GNU GPL. See the file COPYING for details.
  *
  * 2002-02-05: Sergey S. Kostyliov added binary search within
- * 		btree nodes.
+ *	btree nodes.
  *
  * Many thanks to:
  *
@@ -88,13 +88,15 @@ struct befs_btree_node {
 static const befs_off_t BEFS_BT_INVAL = 0xffffffffffffffffULL;
 
 /* local functions */
-static int befs_btree_seekleaf(struct super_block *sb, const befs_data_stream *ds,
-			       befs_btree_super * bt_super,
+static int befs_btree_seekleaf(struct super_block *sb,
+			       const befs_data_stream *ds,
+			       befs_btree_super *bt_super,
 			       struct befs_btree_node *this_node,
-			       befs_off_t * node_off);
+			       befs_off_t *node_off);
 
-static int befs_bt_read_super(struct super_block *sb, const befs_data_stream *ds,
-			      befs_btree_super * sup);
+static int befs_bt_read_super(struct super_block *sb,
+			      const befs_data_stream *ds,
+			      befs_btree_super *sup);
 
 static int befs_bt_read_node(struct super_block *sb, const befs_data_stream *ds,
 			     struct befs_btree_node *node,
@@ -110,11 +112,11 @@ static char *befs_bt_keydata(struct befs_btree_node *node);
 
 static int befs_find_key(struct super_block *sb,
 			 struct befs_btree_node *node,
-			 const char *findkey, befs_off_t * value);
+			 const char *findkey, befs_off_t *value);
 
 static char *befs_bt_get_key(struct super_block *sb,
 			     struct befs_btree_node *node,
-			     int index, u16 * keylen);
+			     int index, u16 *keylen);
 
 static int befs_compare_strings(const void *key1, int keylen1,
 				const void *key2, int keylen2);
@@ -132,7 +134,7 @@ static int befs_compare_strings(const void *key1, int keylen1,
  */
 static int
 befs_bt_read_super(struct super_block *sb, const befs_data_stream *ds,
-		   befs_btree_super * sup)
+		   befs_btree_super *sup)
 {
 	struct buffer_head *bh;
 	befs_disk_btree_super *od_sup;
@@ -163,7 +165,7 @@ befs_bt_read_super(struct super_block *sb, const befs_data_stream *ds,
 	befs_debug(sb, "<--- %s", __func__);
 	return BEFS_OK;
 
-      error:
+error:
 	befs_debug(sb, "<--- %s ERROR", __func__);
 	return BEFS_ERR;
 }
@@ -200,8 +202,8 @@ befs_bt_read_node(struct super_block *sb, const befs_data_stream *ds,
 
 	node->bh = befs_read_datastream(sb, ds, node_off, &off);
 	if (!node->bh) {
-		befs_error(sb, "%s failed to read "
-			   "node at %llu", __func__, node_off);
+		befs_error(sb, "%s failed to read node at %llu",
+			__func__, node_off);
 		befs_debug(sb, "<--- %s ERROR", __func__);
 
 		return BEFS_ERR;
@@ -243,7 +245,7 @@ befs_bt_read_node(struct super_block *sb, const befs_data_stream *ds,
  */
 int
 befs_btree_find(struct super_block *sb, const befs_data_stream *ds,
-		const char *key, befs_off_t * value)
+		const char *key, befs_off_t *value)
 {
 	struct befs_btree_node *this_node;
 	befs_btree_super bt_super;
@@ -253,16 +255,16 @@ befs_btree_find(struct super_block *sb, const befs_data_stream *ds,
 	befs_debug(sb, "---> %s Key: %s", __func__, key);
 
 	if (befs_bt_read_super(sb, ds, &bt_super) != BEFS_OK) {
-		befs_error(sb,
-			   "befs_btree_find() failed to read index superblock");
+		befs_error(sb, "%s() failed to read index superblock",
+			__func__);
 		goto error;
 	}
 
 	this_node = kmalloc(sizeof(struct befs_btree_node),
 						GFP_NOFS);
 	if (!this_node) {
-		befs_error(sb, "befs_btree_find() failed to allocate %zu "
-			   "bytes of memory", sizeof(struct befs_btree_node));
+		befs_error(sb, "%s() failed to allocate %zu bytes of memory",
+			__func__, sizeof(struct befs_btree_node));
 		goto error;
 	}
 
@@ -271,8 +273,8 @@ befs_btree_find(struct super_block *sb, const befs_data_stream *ds,
 	/* read in root node */
 	node_off = bt_super.root_node_ptr;
 	if (befs_bt_read_node(sb, ds, this_node, node_off) != BEFS_OK) {
-		befs_error(sb, "befs_btree_find() failed to read "
-			   "node at %llu", node_off);
+		befs_error(sb, "%s() failed to read node at %llu",
+			__func__, node_off);
 		goto error_alloc;
 	}
 
@@ -282,8 +284,8 @@ befs_btree_find(struct super_block *sb, const befs_data_stream *ds,
 		if (res == BEFS_BT_OVERFLOW)
 			node_off = this_node->head.overflow;
 		if (befs_bt_read_node(sb, ds, this_node, node_off) != BEFS_OK) {
-			befs_error(sb, "befs_btree_find() failed to read "
-				   "node at %llu", node_off);
+			befs_error(sb, "%s() failed to read node at %llu",
+				__func__, node_off);
 			goto error_alloc;
 		}
 	}
@@ -304,9 +306,9 @@ befs_btree_find(struct super_block *sb, const befs_data_stream *ds,
 		   key, *value);
 	return BEFS_OK;
 
-      error_alloc:
+error_alloc:
 	kfree(this_node);
-      error:
+error:
 	*value = 0;
 	befs_debug(sb, "<--- %s ERROR", __func__);
 	return BEFS_ERR;
@@ -328,7 +330,7 @@ befs_btree_find(struct super_block *sb, const befs_data_stream *ds,
  */
 static int
 befs_find_key(struct super_block *sb, struct befs_btree_node *node,
-	      const char *findkey, befs_off_t * value)
+	      const char *findkey, befs_off_t *value)
 {
 	int first, last, mid;
 	int eq;
@@ -409,8 +411,8 @@ befs_find_key(struct super_block *sb, struct befs_btree_node *node,
  */
 int
 befs_btree_read(struct super_block *sb, const befs_data_stream *ds,
-		loff_t key_no, size_t bufsize, char *keybuf, size_t * keysize,
-		befs_off_t * value)
+		loff_t key_no, size_t bufsize, char *keybuf, size_t *keysize,
+		befs_off_t *value)
 {
 	struct befs_btree_node *this_node;
 	befs_btree_super bt_super;
@@ -426,15 +428,15 @@ befs_btree_read(struct super_block *sb, const befs_data_stream *ds,
 	befs_debug(sb, "---> %s", __func__);
 
 	if (befs_bt_read_super(sb, ds, &bt_super) != BEFS_OK) {
-		befs_error(sb,
-			   "befs_btree_read() failed to read index superblock");
+		befs_error(sb, "%s() failed to read index superblock",
+			__func__);
 		goto error;
 	}
 
 	this_node = kmalloc(sizeof(struct befs_btree_node), GFP_NOFS);
 	if (this_node == NULL) {
-		befs_error(sb, "befs_btree_read() failed to allocate %zu "
-			   "bytes of memory", sizeof(struct befs_btree_node));
+		befs_error(sb, "%s() failed to allocate %zu bytes of memory",
+			__func__, sizeof(struct befs_btree_node));
 		goto error;
 	}
 
@@ -490,12 +492,12 @@ befs_btree_read(struct super_block *sb, const befs_data_stream *ds,
 	keystart = befs_bt_get_key(sb, this_node, cur_key, &keylen);
 
 	befs_debug(sb, "Read [%llu,%d]: keysize %d",
-		   (long long unsigned int)node_off, (int)cur_key,
+		   (unsigned long long int)node_off, (int)cur_key,
 		   (int)keylen);
 
 	if (bufsize < keylen + 1) {
-		befs_error(sb, "%s keybuf too small (%zu) "
-			   "for key of size %d", __func__, bufsize, keylen);
+		befs_error(sb, "%s keybuf too small (%zu) for key of size %d",
+			__func__, bufsize, keylen);
 		brelse(this_node->bh);
 		goto error_alloc;
 	}
@@ -514,10 +516,10 @@ befs_btree_read(struct super_block *sb, const befs_data_stream *ds,
 
 	return BEFS_OK;
 
-      error_alloc:
+error_alloc:
 	kfree(this_node);
 
-      error:
+error:
 	*keysize = 0;
 	*value = 0;
 	befs_debug(sb, "<--- %s ERROR", __func__);
@@ -531,7 +533,7 @@ befs_btree_read(struct super_block *sb, const befs_data_stream *ds,
  * @bt_super: Pointer to the superblock of the btree
  * @this_node: Buffer to return the leafnode in
  * @node_off: Pointer to offset of current node within datastream. Modified
- * 		by the function.
+ *	by the function.
  *
  * Helper function for btree traverse. Moves the current position to the
  * start of the first leaf node.
@@ -542,14 +544,14 @@ static int
 befs_btree_seekleaf(struct super_block *sb, const befs_data_stream *ds,
 		    befs_btree_super *bt_super,
 		    struct befs_btree_node *this_node,
-		    befs_off_t * node_off)
+		    befs_off_t *node_off)
 {
 
 	befs_debug(sb, "---> %s", __func__);
 
 	if (befs_bt_read_node(sb, ds, this_node, *node_off) != BEFS_OK) {
-		befs_error(sb, "%s failed to read "
-			   "node at %llu", __func__, *node_off);
+		befs_error(sb, "%s failed to read node at %llu",
+			   __func__, *node_off);
 		goto error;
 	}
 	befs_debug(sb, "Seekleaf to root node %llu", *node_off);
@@ -572,8 +574,8 @@ befs_btree_seekleaf(struct super_block *sb, const befs_data_stream *ds,
 			*node_off = fs64_to_cpu(sb, valarray[0]);
 		}
 		if (befs_bt_read_node(sb, ds, this_node, *node_off) != BEFS_OK) {
-			befs_error(sb, "%s failed to read "
-				   "node at %llu", __func__, *node_off);
+			befs_error(sb, "%s failed to read node at %llu",
+				__func__, *node_off);
 			goto error;
 		}
 
@@ -583,7 +585,7 @@ befs_btree_seekleaf(struct super_block *sb, const befs_data_stream *ds,
 
 	return BEFS_OK;
 
-      error:
+error:
 	befs_debug(sb, "<--- %s ERROR", __func__);
 	return BEFS_ERR;
 }
@@ -623,7 +625,7 @@ befs_bt_keylen_index(struct befs_btree_node *node)
 {
 	const int keylen_align = 8;
 	unsigned long int off =
-	    (sizeof (befs_btree_nodehead) + node->head.all_key_length);
+	    (sizeof(befs_btree_nodehead) + node->head.all_key_length);
 	ulong tmp = off % keylen_align;
 
 	if (tmp)
@@ -643,7 +645,7 @@ static fs64 *
 befs_bt_valarray(struct befs_btree_node *node)
 {
 	void *keylen_index_start = (void *) befs_bt_keylen_index(node);
-	size_t keylen_index_size = node->head.all_key_count * sizeof (fs16);
+	size_t keylen_index_size = node->head.all_key_count * sizeof(fs16);
 
 	return (fs64 *) (keylen_index_start + keylen_index_size);
 }
@@ -658,7 +660,7 @@ befs_bt_valarray(struct befs_btree_node *node)
 static char *
 befs_bt_keydata(struct befs_btree_node *node)
 {
-	return (char *) ((void *) node->od_node + sizeof (befs_btree_nodehead));
+	return (char *) ((void *) node->od_node + sizeof(befs_btree_nodehead));
 }
 
 /**
@@ -673,7 +675,7 @@ befs_bt_keydata(struct befs_btree_node *node)
  */
 static char *
 befs_bt_get_key(struct super_block *sb, struct befs_btree_node *node,
-		int index, u16 * keylen)
+		int index, u16 *keylen)
 {
 	int prev_key_end;
 	char *keystart;
@@ -714,6 +716,7 @@ befs_compare_strings(const void *key1, int keylen1,
 {
 	int len = min_t(int, keylen1, keylen2);
 	int result = strncmp(key1, key2, len);
+
 	if (result == 0)
 		result = keylen1 - keylen2;
 	return result;
@@ -765,6 +768,7 @@ static int
 btree_compare_float(cont void *key1, int keylen1, const void *key2, int keylen2)
 {
 	float result = *(float *) key1 - *(float *) key2;
+
 	if (result == 0.0f)
 		return 0;
 
@@ -776,6 +780,7 @@ btree_compare_double(cont void *key1, int keylen1,
 		     const void *key2, int keylen2)
 {
 	double result = *(double *) key1 - *(double *) key2;
+
 	if (result == 0.0)
 		return 0;
 
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 6fe9197f6ee4..45c0704e5b1d 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -260,15 +260,12 @@ void btrfs_csum_final(u32 crc, u8 *result)
 }
 
 /*
- * compute the csum for a btree block, and either verify it or write it
- * into the csum field of the block.
+ * Compute the csum of a btree block and store the result to provided buffer.
+ *
+ * Returns error if the extent buffer cannot be mapped.
  */
-static int csum_tree_block(struct btrfs_fs_info *fs_info,
-			   struct extent_buffer *buf,
-			   int verify)
+static int csum_tree_block(struct extent_buffer *buf, u8 *result)
 {
-	u16 csum_size = btrfs_super_csum_size(fs_info->super_copy);
-	char result[BTRFS_CSUM_SIZE];
 	unsigned long len;
 	unsigned long cur_len;
 	unsigned long offset = BTRFS_CSUM_SIZE;
@@ -288,7 +285,7 @@ static int csum_tree_block(struct btrfs_fs_info *fs_info,
 		 */
 		err = map_private_extent_buffer(buf, offset, 32,
 					&kaddr, &map_start, &map_len);
-		if (err)
+		if (WARN_ON(err))
 			return err;
 		cur_len = min(len, map_len - (offset - map_start));
 		crc = btrfs_csum_data(kaddr + offset - map_start,
@@ -300,23 +297,6 @@ static int csum_tree_block(struct btrfs_fs_info *fs_info,
 
 	btrfs_csum_final(crc, result);
 
-	if (verify) {
-		if (memcmp_extent_buffer(buf, result, 0, csum_size)) {
-			u32 val;
-			u32 found = 0;
-			memcpy(&found, result, csum_size);
-
-			read_extent_buffer(buf, &val, 0, csum_size);
-			btrfs_warn_rl(fs_info,
-				"%s checksum verify failed on %llu wanted %X found %X level %d",
-				fs_info->sb->s_id, buf->start,
-				val, found, btrfs_header_level(buf));
-			return -EUCLEAN;
-		}
-	} else {
-		write_extent_buffer(buf, result, 0, csum_size);
-	}
-
 	return 0;
 }
 
@@ -424,12 +404,11 @@ static int verify_level_key(struct btrfs_fs_info *fs_info,
 
 	found_level = btrfs_header_level(eb);
 	if (found_level != level) {
-#ifdef CONFIG_BTRFS_DEBUG
-		WARN_ON(1);
+		WARN(IS_ENABLED(CONFIG_BTRFS_DEBUG),
+		     KERN_ERR "BTRFS: tree level check failed\n");
 		btrfs_err(fs_info,
 "tree level mismatch detected, bytenr=%llu level expected=%u has=%u",
 			  eb->start, level, found_level);
-#endif
 		return -EIO;
 	}
 
@@ -450,9 +429,9 @@ static int verify_level_key(struct btrfs_fs_info *fs_info,
 		btrfs_item_key_to_cpu(eb, &found_key, 0);
 	ret = btrfs_comp_cpu_keys(first_key, &found_key);
 
-#ifdef CONFIG_BTRFS_DEBUG
 	if (ret) {
-		WARN_ON(1);
+		WARN(IS_ENABLED(CONFIG_BTRFS_DEBUG),
+		     KERN_ERR "BTRFS: tree first key check failed\n");
 		btrfs_err(fs_info,
 "tree first key mismatch detected, bytenr=%llu parent_transid=%llu key expected=(%llu,%u,%llu) has=(%llu,%u,%llu)",
 			  eb->start, parent_transid, first_key->objectid,
@@ -460,7 +439,6 @@ static int verify_level_key(struct btrfs_fs_info *fs_info,
 			  found_key.objectid, found_key.type,
 			  found_key.offset);
 	}
-#endif
 	return ret;
 }
 
@@ -533,7 +511,10 @@ static int csum_dirty_buffer(struct btrfs_fs_info *fs_info, struct page *page)
 {
 	u64 start = page_offset(page);
 	u64 found_start;
+	u8 result[BTRFS_CSUM_SIZE];
+	u16 csum_size = btrfs_super_csum_size(fs_info->super_copy);
 	struct extent_buffer *eb;
+	int err;
 
 	eb = (struct extent_buffer *)page->private;
 	if (page != eb->pages[0])
@@ -552,7 +533,22 @@ static int csum_dirty_buffer(struct btrfs_fs_info *fs_info, struct page *page)
 	ASSERT(memcmp_extent_buffer(eb, fs_info->fs_devices->metadata_uuid,
 			btrfs_header_fsid(), BTRFS_FSID_SIZE) == 0);
 
-	return csum_tree_block(fs_info, eb, 0);
+	if (csum_tree_block(eb, result))
+		return -EINVAL;
+
+	if (btrfs_header_level(eb))
+		err = btrfs_check_node(fs_info, eb);
+	else
+		err = btrfs_check_leaf_write(fs_info, eb);
+	if (err < 0) {
+		btrfs_err(fs_info,
+		"block=%llu write time tree block corruption detected",
+			  eb->start);
+		return err;
+	}
+	write_extent_buffer(eb, result, 0, csum_size);
+
+	return 0;
 }
 
 static int check_tree_block_fsid(struct btrfs_fs_info *fs_info,
@@ -595,7 +591,9 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
 	struct extent_buffer *eb;
 	struct btrfs_root *root = BTRFS_I(page->mapping->host)->root;
 	struct btrfs_fs_info *fs_info = root->fs_info;
+	u16 csum_size = btrfs_super_csum_size(fs_info->super_copy);
 	int ret = 0;
+	u8 result[BTRFS_CSUM_SIZE];
 	int reads_done;
 
 	if (!page->private)
@@ -642,10 +640,25 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
 	btrfs_set_buffer_lockdep_class(btrfs_header_owner(eb),
 				       eb, found_level);
 
-	ret = csum_tree_block(fs_info, eb, 1);
+	ret = csum_tree_block(eb, result);
 	if (ret)
 		goto err;
 
+	if (memcmp_extent_buffer(eb, result, 0, csum_size)) {
+		u32 val;
+		u32 found = 0;
+
+		memcpy(&found, result, csum_size);
+
+		read_extent_buffer(eb, &val, 0, csum_size);
+		btrfs_warn_rl(fs_info,
+		"%s checksum verify failed on %llu wanted %x found %x level %d",
+			      fs_info->sb->s_id, eb->start,
+			      val, found, btrfs_header_level(eb));
+		ret = -EUCLEAN;
+		goto err;
+	}
+
 	/*
 	 * If this is a leaf block and it is corrupt, set the corrupt bit so
 	 * that we don't try and read the other copies of this block, just
@@ -674,6 +687,9 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
 		 */
 		atomic_inc(&eb->io_pages);
 		clear_extent_buffer_uptodate(eb);
+		btrfs_err(fs_info,
+			  "block=%llu read time tree block corruption detected",
+			  eb->start);
 	}
 	free_extent_buffer(eb);
 out:
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index ca8b8e785cf3..3affaf9907b3 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -170,15 +170,38 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num,
 	return blk_status_to_errno(ret);
 }
 
-static void flush_write_bio(struct extent_page_data *epd)
+/* A wrapper for bio_endio() to cleanup unsubmitted bios */
+static void end_write_bio(struct extent_page_data *epd, int ret)
 {
 	if (epd->bio) {
-		int ret;
+		epd->bio->bi_status = errno_to_blk_status(ret);
+		bio_endio(epd->bio);
+		epd->bio = NULL;
+	}
+}
 
+/*
+ * A wrapper for submit_one_bio().
+ *
+ * Return 0 if everything is OK.
+ * Return <0 for error.
+ */
+static int __must_check flush_write_bio(struct extent_page_data *epd)
+{
+	int ret = 0;
+
+	if (epd->bio) {
 		ret = submit_one_bio(epd->bio, 0, 0);
-		BUG_ON(ret < 0); /* -ENOMEM */
+		/*
+		 * Clean up of epd->bio is handled by its endio function.
+		 * And endio is either triggered by successful bio execution
+		 * or the error handler of submit bio hook.
+		 * So at this point, no matter what happened, we don't need
+		 * to clean up epd->bio.
+		 */
 		epd->bio = NULL;
 	}
+	return ret;
 }
 
 int __init extent_io_init(void)
@@ -3419,6 +3442,9 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode,
  * records are inserted to lock ranges in the tree, and as dirty areas
  * are found, they are marked writeback.  Then the lock bits are removed
  * and the end_io handler clears the writeback ranges
+ *
+ * Return 0 if everything goes well.
+ * Return <0 for error.
  */
 static int __extent_writepage(struct page *page, struct writeback_control *wbc,
 			      struct extent_page_data *epd)
@@ -3488,6 +3514,7 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
 		end_extent_writepage(page, ret, start, page_end);
 	}
 	unlock_page(page);
+	ASSERT(ret <= 0);
 	return ret;
 
 done_unlocked:
@@ -3500,18 +3527,25 @@ void wait_on_extent_buffer_writeback(struct extent_buffer *eb)
 		       TASK_UNINTERRUPTIBLE);
 }
 
+/*
+ * Return 0 if nothing went wrong, its pages get locked and submitted.
+ * Return >0 is mostly the same as 0, except bio is not submitted.
+ * Return <0 if something went wrong, no page get locked.
+ */
 static noinline_for_stack int
 lock_extent_buffer_for_io(struct extent_buffer *eb,
 			  struct btrfs_fs_info *fs_info,
 			  struct extent_page_data *epd)
 {
-	int i, num_pages;
+	int i, num_pages, failed_page_nr;
 	int flush = 0;
 	int ret = 0;
 
 	if (!btrfs_try_tree_write_lock(eb)) {
+		ret = flush_write_bio(epd);
+		if (ret < 0)
+			return ret;
 		flush = 1;
-		flush_write_bio(epd);
 		btrfs_tree_lock(eb);
 	}
 
@@ -3520,7 +3554,9 @@ lock_extent_buffer_for_io(struct extent_buffer *eb,
 		if (!epd->sync_io)
 			return 0;
 		if (!flush) {
-			flush_write_bio(epd);
+			ret = flush_write_bio(epd);
+			if (ret < 0)
+				return ret;
 			flush = 1;
 		}
 		while (1) {
@@ -3561,7 +3597,11 @@ lock_extent_buffer_for_io(struct extent_buffer *eb,
 
 		if (!trylock_page(p)) {
 			if (!flush) {
-				flush_write_bio(epd);
+				ret = flush_write_bio(epd);
+				if (ret < 0) {
+					failed_page_nr = i;
+					goto err_unlock;
+				}
 				flush = 1;
 			}
 			lock_page(p);
@@ -3569,6 +3609,11 @@ lock_extent_buffer_for_io(struct extent_buffer *eb,
 	}
 
 	return ret;
+err_unlock:
+	/* Unlock these already locked pages */
+	for (i = 0; i < failed_page_nr; i++)
+		unlock_page(eb->pages[i]);
+	return ret;
 }
 
 static void end_extent_buffer_writeback(struct extent_buffer *eb)
@@ -3852,7 +3897,12 @@ int btree_write_cache_pages(struct address_space *mapping,
 		index = 0;
 		goto retry;
 	}
-	flush_write_bio(&epd);
+	ASSERT(ret <= 0);
+	if (ret < 0) {
+		end_write_bio(&epd, ret);
+		return ret;
+	}
+	ret = flush_write_bio(&epd);
 	return ret;
 }
 
@@ -3949,7 +3999,11 @@ static int extent_write_cache_pages(struct address_space *mapping,
 			 * tmpfs file mapping
 			 */
 			if (!trylock_page(page)) {
-				flush_write_bio(epd);
+				ret = flush_write_bio(epd);
+				if (ret < 0) {
+					done = 1;
+					break;
+				}
 				lock_page(page);
 			}
 
@@ -3959,8 +4013,13 @@ static int extent_write_cache_pages(struct address_space *mapping,
 			}
 
 			if (wbc->sync_mode != WB_SYNC_NONE) {
-				if (PageWriteback(page))
-					flush_write_bio(epd);
+				if (PageWriteback(page)) {
+					ret = flush_write_bio(epd);
+					if (ret < 0) {
+						done = 1;
+						break;
+					}
+				}
 				wait_on_page_writeback(page);
 			}
 
@@ -3971,11 +4030,6 @@ static int extent_write_cache_pages(struct address_space *mapping,
 			}
 
 			ret = __extent_writepage(page, wbc, epd);
-
-			if (unlikely(ret == AOP_WRITEPAGE_ACTIVATE)) {
-				unlock_page(page);
-				ret = 0;
-			}
 			if (ret < 0) {
 				/*
 				 * done_index is set past this page,
@@ -4029,8 +4083,14 @@ int extent_write_full_page(struct page *page, struct writeback_control *wbc)
 	};
 
 	ret = __extent_writepage(page, wbc, &epd);
+	ASSERT(ret <= 0);
+	if (ret < 0) {
+		end_write_bio(&epd, ret);
+		return ret;
+	}
 
-	flush_write_bio(&epd);
+	ret = flush_write_bio(&epd);
+	ASSERT(ret <= 0);
 	return ret;
 }
 
@@ -4070,7 +4130,12 @@ int extent_write_locked_range(struct inode *inode, u64 start, u64 end,
 		start += PAGE_SIZE;
 	}
 
-	flush_write_bio(&epd);
+	ASSERT(ret <= 0);
+	if (ret < 0) {
+		end_write_bio(&epd, ret);
+		return ret;
+	}
+	ret = flush_write_bio(&epd);
 	return ret;
 }
 
@@ -4086,7 +4151,12 @@ int extent_writepages(struct address_space *mapping,
 	};
 
 	ret = extent_write_cache_pages(mapping, wbc, &epd);
-	flush_write_bio(&epd);
+	ASSERT(ret <= 0);
+	if (ret < 0) {
+		end_write_bio(&epd, ret);
+		return ret;
+	}
+	ret = flush_write_bio(&epd);
 	return ret;
 }
 
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 34fe8a58b0e9..a6e03f02b3d6 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1374,7 +1374,7 @@ int btrfs_mark_extent_written(struct btrfs_trans_handle *trans,
 	}
 out:
 	btrfs_free_path(path);
-	return 0;
+	return ret;
 }
 
 /*
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 82fdda8ff5ab..4bc70bad66e0 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -59,6 +59,14 @@ struct btrfs_dio_data {
 	int overwrite;
 };
 
+/*
+ * 2 for inode item and ref
+ * 2 for dir items
+ * 1 for xattr if selinux is on
+ * 1 for inherited properties
+ */
+#define BTRFS_NEW_INODE_ITEMS 6
+
 static const struct inode_operations btrfs_dir_inode_operations;
 static const struct inode_operations btrfs_symlink_inode_operations;
 static const struct inode_operations btrfs_dir_ro_inode_operations;
@@ -2075,11 +2083,21 @@ static void btrfs_writepage_fixup_worker(struct btrfs_work *work)
 	page = fixup->page;
 again:
 	lock_page(page);
-	if (!page->mapping || !PageDirty(page) || !PageChecked(page)) {
-		ClearPageChecked(page);
+
+	/*
+	 * before we queued this fixup, we took a reference on the page.
+	 * page->mapping may go NULL, but it shouldn't be moved to a
+	 * different address space.
+	 */
+	if (!page->mapping || !PageDirty(page) || !PageChecked(page))
 		goto out_page;
-	}
 
+	/*
+	 * we keep the PageChecked() bit set until we're done with the
+	 * btrfs_start_ordered_extent() dance that we do below.  That
+	 * drops and retakes the page lock, so we don't want new
+	 * fixup workers queued for this page during the churn.
+	 */
 	inode = page->mapping->host;
 	page_start = page_offset(page);
 	page_end = page_offset(page) + PAGE_SIZE - 1;
@@ -2104,33 +2122,46 @@ static void btrfs_writepage_fixup_worker(struct btrfs_work *work)
 
 	ret = btrfs_delalloc_reserve_space(inode, &data_reserved, page_start,
 					   PAGE_SIZE);
-	if (ret) {
-		mapping_set_error(page->mapping, ret);
-		end_extent_writepage(page, ret, page_start, page_end);
-		ClearPageChecked(page);
-		goto out;
-	 }
+	if (ret)
+		goto out_error;
 
 	ret = btrfs_set_extent_delalloc(inode, page_start, page_end, 0,
 					&cached_state, 0);
-	if (ret) {
-		mapping_set_error(page->mapping, ret);
-		end_extent_writepage(page, ret, page_start, page_end);
-		ClearPageChecked(page);
-		goto out;
-	}
+	if (ret)
+		goto out_error;
 
-	ClearPageChecked(page);
-	set_page_dirty(page);
 	btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, false);
+
+	/*
+	 * everything went as planned, we're now the proud owners of a
+	 * Dirty page with delayed allocation bits set and space reserved
+	 * for our COW destination.
+	 *
+	 * The page was dirty when we started, nothing should have cleaned it.
+	 */
+	BUG_ON(!PageDirty(page));
+
 out:
 	unlock_extent_cached(&BTRFS_I(inode)->io_tree, page_start, page_end,
 			     &cached_state);
 out_page:
+	ClearPageChecked(page);
 	unlock_page(page);
 	put_page(page);
 	kfree(fixup);
 	extent_changeset_free(data_reserved);
+	return;
+
+out_error:
+	/*
+	 * We hit ENOSPC or other errors.  Update the mapping and page to
+	 * reflect the errors and clean the page.
+	 */
+	mapping_set_error(page->mapping, ret);
+	end_extent_writepage(page, ret, page_start, page_end);
+	clear_page_dirty_for_io(page);
+	SetPageError(page);
+	goto out;
 }
 
 /*
@@ -2154,6 +2185,13 @@ int btrfs_writepage_cow_fixup(struct page *page, u64 start, u64 end)
 	if (TestClearPagePrivate2(page))
 		return 0;
 
+	/*
+	 * PageChecked is set below when we create a fixup worker for this page,
+	 * don't try to create another one if we're already PageChecked()
+	 *
+	 * The extent_io writepage code will redirty the page if we send
+	 * back EAGAIN.
+	 */
 	if (PageChecked(page))
 		return -EAGAIN;
 
@@ -2167,7 +2205,8 @@ int btrfs_writepage_cow_fixup(struct page *page, u64 start, u64 end)
 			btrfs_writepage_fixup_worker, NULL, NULL);
 	fixup->page = page;
 	btrfs_queue_work(fs_info->fixup_workers, &fixup->work);
-	return -EBUSY;
+
+	return -EAGAIN;
 }
 
 static int insert_reserved_file_extent(struct btrfs_trans_handle *trans,
@@ -6449,12 +6488,7 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry,
 	u64 objectid;
 	u64 index = 0;
 
-	/*
-	 * 2 for inode item and ref
-	 * 2 for dir items
-	 * 1 for xattr if selinux is on
-	 */
-	trans = btrfs_start_transaction(root, 5);
+	trans = btrfs_start_transaction(root, BTRFS_NEW_INODE_ITEMS);
 	if (IS_ERR(trans))
 		return PTR_ERR(trans);
 
@@ -6513,12 +6547,7 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry,
 	u64 objectid;
 	u64 index = 0;
 
-	/*
-	 * 2 for inode item and ref
-	 * 2 for dir items
-	 * 1 for xattr if selinux is on
-	 */
-	trans = btrfs_start_transaction(root, 5);
+	trans = btrfs_start_transaction(root, BTRFS_NEW_INODE_ITEMS);
 	if (IS_ERR(trans))
 		return PTR_ERR(trans);
 
@@ -6665,12 +6694,7 @@ static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
 	u64 objectid = 0;
 	u64 index = 0;
 
-	/*
-	 * 2 items for inode and ref
-	 * 2 items for dir items
-	 * 1 for xattr if selinux is on
-	 */
-	trans = btrfs_start_transaction(root, 5);
+	trans = btrfs_start_transaction(root, BTRFS_NEW_INODE_ITEMS);
 	if (IS_ERR(trans))
 		return PTR_ERR(trans);
 
@@ -9400,14 +9424,11 @@ static int btrfs_rename_exchange(struct inode *old_dir,
 		down_read(&fs_info->subvol_sem);
 
 	/*
-	 * We want to reserve the absolute worst case amount of items.  So if
-	 * both inodes are subvols and we need to unlink them then that would
-	 * require 4 item modifications, but if they are both normal inodes it
-	 * would require 5 item modifications, so we'll assume their normal
-	 * inodes.  So 5 * 2 is 10, plus 2 for the new links, so 12 total items
-	 * should cover the worst case number of items we'll modify.
+	 * The same math from btrfs_rename applies here, except we need an extra
+	 * 2 items for the new links.
 	 */
-	trans = btrfs_start_transaction(root, 12);
+	trans = btrfs_start_transaction(root,
+					(BTRFS_NEW_INODE_ITEMS << 1) + 2);
 	if (IS_ERR(trans)) {
 		ret = PTR_ERR(trans);
 		goto out_notrans;
@@ -9740,19 +9761,19 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
 	if (old_ino == BTRFS_FIRST_FREE_OBJECTID)
 		down_read(&fs_info->subvol_sem);
 	/*
-	 * We want to reserve the absolute worst case amount of items.  So if
-	 * both inodes are subvols and we need to unlink them then that would
-	 * require 4 item modifications, but if they are both normal inodes it
-	 * would require 5 item modifications, so we'll assume they are normal
-	 * inodes.  So 5 * 2 is 10, plus 1 for the new link, so 11 total items
-	 * should cover the worst case number of items we'll modify.
-	 * If our rename has the whiteout flag, we need more 5 units for the
-	 * new inode (1 inode item, 1 inode ref, 2 dir items and 1 xattr item
-	 * when selinux is enabled).
+	 * We want to reserve the absolute worst case amount of items.  Subvol
+	 * inodes don't have an inode item to worry about and don't have a
+	 * selinux attr, so we use the BTRFS_NEW_INODE_ITEMS counter for how
+	 * much it costs per inode to modify.  Worse case we'll have to mess
+	 * with 2 inodes, so 2 x BTRFS_NEW_INODE_ITEMS, and then we need an
+	 * extra reservation for the new link.
+	 *
+	 * If our rename has the whiteout flag we need a full new inode which
+	 * means another set of BTRFS_NEW_INODE_ITEMS.
 	 */
-	trans_num_items = 11;
+	trans_num_items = (BTRFS_NEW_INODE_ITEMS << 1) + 1;
 	if (flags & RENAME_WHITEOUT)
-		trans_num_items += 5;
+		trans_num_items += BTRFS_NEW_INODE_ITEMS;
 	trans = btrfs_start_transaction(root, trans_num_items);
 	if (IS_ERR(trans)) {
 		ret = PTR_ERR(trans);
@@ -10121,14 +10142,8 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
 	if (name_len > BTRFS_MAX_INLINE_DATA_SIZE(fs_info))
 		return -ENAMETOOLONG;
 
-	/*
-	 * 2 items for inode item and ref
-	 * 2 items for dir items
-	 * 1 item for updating parent inode item
-	 * 1 item for the inline extent item
-	 * 1 item for xattr if selinux is on
-	 */
-	trans = btrfs_start_transaction(root, 7);
+	/* 1 item for the inline extent item */
+	trans = btrfs_start_transaction(root, BTRFS_NEW_INODE_ITEMS + 1);
 	if (IS_ERR(trans))
 		return PTR_ERR(trans);
 
@@ -10193,7 +10208,6 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
 
 	inode->i_op = &btrfs_symlink_inode_operations;
 	inode_nohighmem(inode);
-	inode->i_mapping->a_ops = &btrfs_aops;
 	inode_set_bytes(inode, name_len);
 	btrfs_i_size_write(BTRFS_I(inode), name_len);
 	err = btrfs_update_inode(trans, root, inode);
@@ -10399,10 +10413,8 @@ static int btrfs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
 	u64 index;
 	int ret = 0;
 
-	/*
-	 * 5 units required for adding orphan entry
-	 */
-	trans = btrfs_start_transaction(root, 5);
+	/* 1 unit required for adding orphan entry */
+	trans = btrfs_start_transaction(root, BTRFS_NEW_INODE_ITEMS + 1);
 	if (IS_ERR(trans))
 		return PTR_ERR(trans);
 
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index ec2d8919e7fb..2e24c29e1560 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -83,6 +83,17 @@ struct btrfs_ioctl_send_args_32 {
 			       struct btrfs_ioctl_send_args_32)
 #endif
 
+/*
+ * 1 - parent dir inode
+ * 2 - dir entries
+ * 1 - root item
+ * 2 - root ref/backref
+ * 1 - root of snapshot
+ * 1 - UUID item
+ * 1 - properties
+ */
+#define BTRFS_NEW_ROOT_ITEMS 9
+
 static int btrfs_clone(struct inode *src, struct inode *inode,
 		       u64 off, u64 olen, u64 olen_aligned, u64 destoff,
 		       int no_time_update);
@@ -596,7 +607,8 @@ static noinline int create_subvol(struct inode *dir,
 	 * The same as the snapshot creation, please see the comment
 	 * of create_snapshot().
 	 */
-	ret = btrfs_subvolume_reserve_metadata(root, &block_rsv, 8, false);
+	ret = btrfs_subvolume_reserve_metadata(root, &block_rsv,
+					       BTRFS_NEW_ROOT_ITEMS, false);
 	if (ret)
 		goto fail_free;
 
@@ -804,17 +816,10 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
 
 	btrfs_init_block_rsv(&pending_snapshot->block_rsv,
 			     BTRFS_BLOCK_RSV_TEMP);
-	/*
-	 * 1 - parent dir inode
-	 * 2 - dir entries
-	 * 1 - root item
-	 * 2 - root ref/backref
-	 * 1 - root of snapshot
-	 * 1 - UUID item
-	 */
+
 	ret = btrfs_subvolume_reserve_metadata(BTRFS_I(dir)->root,
-					&pending_snapshot->block_rsv, 8,
-					false);
+					&pending_snapshot->block_rsv,
+					BTRFS_NEW_ROOT_ITEMS, false);
 	if (ret)
 		goto dec_and_free;
 
diff --git a/fs/btrfs/props.c b/fs/btrfs/props.c
index dc6140013ae8..b3d22fef8c92 100644
--- a/fs/btrfs/props.c
+++ b/fs/btrfs/props.c
@@ -291,6 +291,7 @@ static int inherit_props(struct btrfs_trans_handle *trans,
 	struct btrfs_fs_info *fs_info = root->fs_info;
 	int ret;
 	int i;
+	bool need_reserve = false;
 
 	if (!test_bit(BTRFS_INODE_HAS_PROPS,
 		      &BTRFS_I(parent)->runtime_flags))
@@ -308,16 +309,31 @@ static int inherit_props(struct btrfs_trans_handle *trans,
 		if (!value)
 			continue;
 
-		num_bytes = btrfs_calc_trans_metadata_size(fs_info, 1);
-		ret = btrfs_block_rsv_add(root, trans->block_rsv,
-					  num_bytes, BTRFS_RESERVE_NO_FLUSH);
-		if (ret)
-			goto out;
+		/*
+		 * Currently callers should be reserving 1 credit for
+		 * properties, since we only have 1 property that we currently
+		 * support.  If we add more in the future we need to try and
+		 * reserve more space for them.  But we should also revisit how
+		 * we do space reservations if we do add more properties in the
+		 * future.
+		 */
+		if (need_reserve) {
+			num_bytes = btrfs_calc_trans_metadata_size(fs_info, 1);
+			ret = btrfs_block_rsv_add(root, trans->block_rsv,
+						  num_bytes,
+						  BTRFS_RESERVE_NO_FLUSH);
+			if (ret)
+				goto out;
+		}
 		ret = __btrfs_set_prop(trans, inode, h->xattr_name,
 				       value, strlen(value), 0);
-		btrfs_block_rsv_release(fs_info, trans->block_rsv, num_bytes);
-		if (ret)
-			goto out;
+		if (need_reserve) {
+			btrfs_block_rsv_release(fs_info, trans->block_rsv,
+						num_bytes);
+			if (ret)
+				goto out;
+		}
+		need_reserve = true;
 	}
 	ret = 0;
 out:
diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c
index d09b6cdb785a..b7c8e0169106 100644
--- a/fs/btrfs/ref-verify.c
+++ b/fs/btrfs/ref-verify.c
@@ -520,6 +520,7 @@ static int process_leaf(struct btrfs_root *root,
 		switch (key.type) {
 		case BTRFS_EXTENT_ITEM_KEY:
 			*num_bytes = key.offset;
+			/* fall through */
 		case BTRFS_METADATA_ITEM_KEY:
 			*bytenr = key.objectid;
 			ret = process_extent_item(fs_info, path, &key, i,
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c
index 893d12fbfda0..1b9a5d0de139 100644
--- a/fs/btrfs/root-tree.c
+++ b/fs/btrfs/root-tree.c
@@ -137,11 +137,14 @@ int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root
 		goto out;
 	}
 
-	if (ret != 0) {
-		btrfs_print_leaf(path->nodes[0]);
-		btrfs_crit(fs_info, "unable to update root key %llu %u %llu",
-			   key->objectid, key->type, key->offset);
-		BUG_ON(1);
+	if (ret > 0) {
+		btrfs_crit(fs_info,
+			"unable to find root key (%llu %u %llu) in tree %llu",
+			key->objectid, key->type, key->offset,
+			root->root_key.objectid);
+		ret = -EUCLEAN;
+		btrfs_abort_transaction(trans, ret);
+		goto out;
 	}
 
 	l = path->nodes[0];
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index a99588536c79..ed471ffbf115 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -3791,7 +3791,7 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
 	struct btrfs_workqueue *scrub_parity = NULL;
 
 	if (btrfs_fs_closing(fs_info))
-		return -EINVAL;
+		return -EAGAIN;
 
 	if (fs_info->nodesize > BTRFS_STRIPE_LEN) {
 		/*
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index acdad6d658f5..06161a4b8aed 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1886,8 +1886,10 @@ static void btrfs_cleanup_pending_block_groups(struct btrfs_trans_handle *trans)
        }
 }
 
-static inline int btrfs_start_delalloc_flush(struct btrfs_fs_info *fs_info)
+static inline int btrfs_start_delalloc_flush(struct btrfs_trans_handle *trans)
 {
+	struct btrfs_fs_info *fs_info = trans->fs_info;
+
 	/*
 	 * We use writeback_inodes_sb here because if we used
 	 * btrfs_start_delalloc_roots we would deadlock with fs freeze.
@@ -1897,15 +1899,52 @@ static inline int btrfs_start_delalloc_flush(struct btrfs_fs_info *fs_info)
 	 * from already being in a transaction and our join_transaction doesn't
 	 * have to re-take the fs freeze lock.
 	 */
-	if (btrfs_test_opt(fs_info, FLUSHONCOMMIT))
+	if (btrfs_test_opt(fs_info, FLUSHONCOMMIT)) {
 		writeback_inodes_sb(fs_info->sb, WB_REASON_SYNC);
+	} else {
+		struct btrfs_pending_snapshot *pending;
+		struct list_head *head = &trans->transaction->pending_snapshots;
+
+		/*
+		 * Flush dellaloc for any root that is going to be snapshotted.
+		 * This is done to avoid a corrupted version of files, in the
+		 * snapshots, that had both buffered and direct IO writes (even
+		 * if they were done sequentially) due to an unordered update of
+		 * the inode's size on disk.
+		 */
+		list_for_each_entry(pending, head, list) {
+			int ret;
+
+			ret = btrfs_start_delalloc_snapshot(pending->root);
+			if (ret < 0) {
+				writeback_inodes_sb(fs_info->sb, WB_REASON_SYNC);
+				break;
+			}
+		}
+	}
 	return 0;
 }
 
-static inline void btrfs_wait_delalloc_flush(struct btrfs_fs_info *fs_info)
+static inline void btrfs_wait_delalloc_flush(struct btrfs_trans_handle *trans)
 {
-	if (btrfs_test_opt(fs_info, FLUSHONCOMMIT))
+	struct btrfs_fs_info *fs_info = trans->fs_info;
+
+	if (btrfs_test_opt(fs_info, FLUSHONCOMMIT)) {
 		btrfs_wait_ordered_roots(fs_info, U64_MAX, 0, (u64)-1);
+	} else {
+		struct btrfs_pending_snapshot *pending;
+		struct list_head *head = &trans->transaction->pending_snapshots;
+
+		/*
+		 * Wait for any dellaloc that we started previously for the roots
+		 * that are going to be snapshotted. This is to avoid a corrupted
+		 * version of files in the snapshots that had both buffered and
+		 * direct IO writes (even if they were done sequentially).
+		 */
+		list_for_each_entry(pending, head, list)
+			btrfs_wait_ordered_extents(pending->root,
+						   U64_MAX, 0, U64_MAX);
+	}
 }
 
 int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
@@ -2023,7 +2062,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
 
 	extwriter_counter_dec(cur_trans, trans->type);
 
-	ret = btrfs_start_delalloc_flush(fs_info);
+	ret = btrfs_start_delalloc_flush(trans);
 	if (ret)
 		goto cleanup_transaction;
 
@@ -2039,7 +2078,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
 	if (ret)
 		goto cleanup_transaction;
 
-	btrfs_wait_delalloc_flush(fs_info);
+	btrfs_wait_delalloc_flush(trans);
 
 	btrfs_scrub_pause(fs_info);
 	/*
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index a62e1e837a89..b8cdaf472031 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -477,7 +477,7 @@ static int check_leaf_item(struct btrfs_fs_info *fs_info,
 }
 
 static int check_leaf(struct btrfs_fs_info *fs_info, struct extent_buffer *leaf,
-		      bool check_item_data)
+		      bool check_item_data, bool check_empty_leaf)
 {
 	/* No valid key type is 0, so all key should be larger than this key */
 	struct btrfs_key prev_key = {0, 0, 0};
@@ -516,6 +516,18 @@ static int check_leaf(struct btrfs_fs_info *fs_info, struct extent_buffer *leaf,
 				    owner);
 			return -EUCLEAN;
 		}
+
+		/*
+		 * Skip empty leaf check, mostly for write time tree block
+		 *
+		 * Such skip mostly happens for tree block write time, as
+		 * we can't use @owner as accurate owner indicator.
+		 * Case like balance and new tree block created for commit root
+		 * can break owner check easily.
+		 */
+		if (!check_empty_leaf)
+			return 0;
+
 		key.objectid = owner;
 		key.type = BTRFS_ROOT_ITEM_KEY;
 		key.offset = (u64)-1;
@@ -636,13 +648,19 @@ static int check_leaf(struct btrfs_fs_info *fs_info, struct extent_buffer *leaf,
 int btrfs_check_leaf_full(struct btrfs_fs_info *fs_info,
 			  struct extent_buffer *leaf)
 {
-	return check_leaf(fs_info, leaf, true);
+	return check_leaf(fs_info, leaf, true, true);
 }
 
 int btrfs_check_leaf_relaxed(struct btrfs_fs_info *fs_info,
 			     struct extent_buffer *leaf)
 {
-	return check_leaf(fs_info, leaf, false);
+	return check_leaf(fs_info, leaf, false, true);
+}
+
+int btrfs_check_leaf_write(struct btrfs_fs_info *fs_info,
+			   struct extent_buffer *leaf)
+{
+	return check_leaf(fs_info, leaf, false, false);
 }
 
 int btrfs_check_node(struct btrfs_fs_info *fs_info, struct extent_buffer *node)
diff --git a/fs/btrfs/tree-checker.h b/fs/btrfs/tree-checker.h
index ff043275b784..6f8d1b627c53 100644
--- a/fs/btrfs/tree-checker.h
+++ b/fs/btrfs/tree-checker.h
@@ -23,6 +23,14 @@ int btrfs_check_leaf_full(struct btrfs_fs_info *fs_info,
  */
 int btrfs_check_leaf_relaxed(struct btrfs_fs_info *fs_info,
 			     struct extent_buffer *leaf);
+
+/*
+ * Write time specific leaf checker.
+ * Don't check if the empty leaf belongs to a tree root. Mostly for balance
+ * and new tree created in current transaction.
+ */
+int btrfs_check_leaf_write(struct btrfs_fs_info *fs_info,
+			   struct extent_buffer *leaf);
 int btrfs_check_node(struct btrfs_fs_info *fs_info, struct extent_buffer *node);
 
 #endif
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index f06454a55e00..960ea49a7a0f 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -3578,9 +3578,16 @@ static noinline int log_dir_items(struct btrfs_trans_handle *trans,
 	}
 	btrfs_release_path(path);
 
-	/* find the first key from this transaction again */
+	/*
+	 * Find the first key from this transaction again.  See the note for
+	 * log_new_dir_dentries, if we're logging a directory recursively we
+	 * won't be holding its i_mutex, which means we can modify the directory
+	 * while we're logging it.  If we remove an entry between our first
+	 * search and this search we'll not find the key again and can just
+	 * bail.
+	 */
 	ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0);
-	if (WARN_ON(ret != 0))
+	if (ret != 0)
 		goto done;
 
 	/*
@@ -4544,6 +4551,19 @@ static int logged_inode_size(struct btrfs_root *log, struct btrfs_inode *inode,
 		item = btrfs_item_ptr(path->nodes[0], path->slots[0],
 				      struct btrfs_inode_item);
 		*size_ret = btrfs_inode_size(path->nodes[0], item);
+		/*
+		 * If the in-memory inode's i_size is smaller then the inode
+		 * size stored in the btree, return the inode's i_size, so
+		 * that we get a correct inode size after replaying the log
+		 * when before a power failure we had a shrinking truncate
+		 * followed by addition of a new name (rename / new hard link).
+		 * Otherwise return the inode size from the btree, to avoid
+		 * data loss when replaying a log due to previously doing a
+		 * write that expands the inode's size and logging a new name
+		 * immediately after.
+		 */
+		if (*size_ret > inode->vfs_inode.i_size)
+			*size_ret = inode->vfs_inode.i_size;
 	}
 
 	btrfs_release_path(path);
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 9024eee889b9..7af1770d9411 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1171,8 +1171,9 @@ void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step)
 {
 	struct btrfs_device *device, *next;
 	struct btrfs_device *latest_dev = NULL;
+	struct btrfs_fs_devices *parent_fs_devices = fs_devices;
 
-	mutex_lock(&uuid_mutex);
+	mutex_lock(&parent_fs_devices->device_list_mutex);
 again:
 	/* This is the initialized path, it is safe to release the devices. */
 	list_for_each_entry_safe(device, next, &fs_devices->devices, dev_list) {
@@ -1226,8 +1227,7 @@ void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step)
 	}
 
 	fs_devices->latest_bdev = latest_dev->bdev;
-
-	mutex_unlock(&uuid_mutex);
+	mutex_unlock(&parent_fs_devices->device_list_mutex);
 }
 
 static void free_device_rcu(struct rcu_head *head)
@@ -6407,7 +6407,7 @@ static void btrfs_end_bio(struct bio *bio)
 				if (bio_op(bio) == REQ_OP_WRITE)
 					btrfs_dev_stat_inc_and_print(dev,
 						BTRFS_DEV_STAT_WRITE_ERRS);
-				else
+				else if (!(bio->bi_opf & REQ_RAHEAD))
 					btrfs_dev_stat_inc_and_print(dev,
 						BTRFS_DEV_STAT_READ_ERRS);
 				if (bio->bi_opf & REQ_PREFLUSH)
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index 3ad9d58d1b66..adcbb4e7b1a0 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -390,6 +390,7 @@ static inline enum btrfs_map_op btrfs_op(struct bio *bio)
 		return BTRFS_MAP_WRITE;
 	default:
 		WARN_ON_ONCE(1);
+		/* fall through */
 	case REQ_OP_READ:
 		return BTRFS_MAP_READ;
 	}
diff --git a/fs/btrfs/zstd.c b/fs/btrfs/zstd.c
index 6b9e29d050f3..a6ff07cf11d5 100644
--- a/fs/btrfs/zstd.c
+++ b/fs/btrfs/zstd.c
@@ -90,6 +90,9 @@ static inline struct workspace *list_to_workspace(struct list_head *list)
 	return container_of(list, struct workspace, list);
 }
 
+static void zstd_free_workspace(struct list_head *ws);
+static struct list_head *zstd_alloc_workspace(unsigned int level);
+
 /*
  * zstd_reclaim_timer_fn - reclaim timer
  * @t: timer
@@ -124,7 +127,7 @@ static void zstd_reclaim_timer_fn(struct timer_list *timer)
 		level = victim->level;
 		list_del(&victim->lru_list);
 		list_del(&victim->list);
-		wsm.ops->free_workspace(&victim->list);
+		zstd_free_workspace(&victim->list);
 
 		if (list_empty(&wsm.idle_ws[level - 1]))
 			clear_bit(level - 1, &wsm.active_map);
@@ -180,7 +183,7 @@ static void zstd_init_workspace_manager(void)
 	for (i = 0; i < ZSTD_BTRFS_MAX_LEVEL; i++)
 		INIT_LIST_HEAD(&wsm.idle_ws[i]);
 
-	ws = wsm.ops->alloc_workspace(ZSTD_BTRFS_MAX_LEVEL);
+	ws = zstd_alloc_workspace(ZSTD_BTRFS_MAX_LEVEL);
 	if (IS_ERR(ws)) {
 		pr_warn(
 		"BTRFS: cannot preallocate zstd compression workspace\n");
@@ -202,7 +205,7 @@ static void zstd_cleanup_workspace_manager(void)
 						 struct workspace, list);
 			list_del(&workspace->list);
 			list_del(&workspace->lru_list);
-			wsm.ops->free_workspace(&workspace->list);
+			zstd_free_workspace(&workspace->list);
 		}
 	}
 	spin_unlock(&wsm.lock);
@@ -272,7 +275,7 @@ static struct list_head *zstd_get_workspace(unsigned int level)
 		return ws;
 
 	nofs_flag = memalloc_nofs_save();
-	ws = wsm.ops->alloc_workspace(level);
+	ws = zstd_alloc_workspace(level);
 	memalloc_nofs_restore(nofs_flag);
 
 	if (IS_ERR(ws)) {
diff --git a/fs/buffer.c b/fs/buffer.c
index ce357602f471..bb690b4c4b5a 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -955,10 +955,20 @@ grow_dev_page(struct block_device *bdev, sector_t block,
 			end_block = init_page_buffers(page, bdev,
 						(sector_t)index << sizebits,
 						size);
+#ifdef CONFIG_DEBUG_AID_FOR_SYZBOT
+			current->getblk_executed |= 0x01;
+#endif
 			goto done;
 		}
-		if (!try_to_free_buffers(page))
+		if (!try_to_free_buffers(page)) {
+#ifdef CONFIG_DEBUG_AID_FOR_SYZBOT
+			current->getblk_executed |= 0x02;
+#endif
 			goto failed;
+		}
+#ifdef CONFIG_DEBUG_AID_FOR_SYZBOT
+		current->getblk_executed |= 0x04;
+#endif
 	}
 
 	/*
@@ -978,6 +988,9 @@ grow_dev_page(struct block_device *bdev, sector_t block,
 	spin_unlock(&inode->i_mapping->private_lock);
 done:
 	ret = (block < end_block) ? 1 : -ENXIO;
+#ifdef CONFIG_DEBUG_AID_FOR_SYZBOT
+	current->getblk_executed |= 0x08;
+#endif
 failed:
 	unlock_page(page);
 	put_page(page);
@@ -1033,6 +1046,12 @@ __getblk_slow(struct block_device *bdev, sector_t block,
 		return NULL;
 	}
 
+#ifdef CONFIG_DEBUG_AID_FOR_SYZBOT
+	current->getblk_stamp = jiffies;
+	current->getblk_executed = 0;
+	current->getblk_bh_count = 0;
+	current->getblk_bh_state = 0;
+#endif
 	for (;;) {
 		struct buffer_head *bh;
 		int ret;
@@ -1044,6 +1063,24 @@ __getblk_slow(struct block_device *bdev, sector_t block,
 		ret = grow_buffers(bdev, block, size, gfp);
 		if (ret < 0)
 			return NULL;
+
+#ifdef CONFIG_DEBUG_AID_FOR_SYZBOT
+		if (!time_after(jiffies, current->getblk_stamp + 3 * HZ))
+			continue;
+		printk(KERN_ERR "%s(%u): getblk(): executed=%x bh_count=%d bh_state=%lx bdev_super_blocksize=%ld size=%u bdev_super_blocksize_bits=%d bdev_inode_blkbits=%d\n",
+		       current->comm, current->pid, current->getblk_executed,
+		       current->getblk_bh_count, current->getblk_bh_state,
+		       IS_ERR_OR_NULL(bdev->bd_super) ? -1L :
+		       bdev->bd_super->s_blocksize, size,
+		       IS_ERR_OR_NULL(bdev->bd_super) ? -1 :
+		       bdev->bd_super->s_blocksize_bits,
+		       IS_ERR_OR_NULL(bdev->bd_inode) ? -1 :
+		       bdev->bd_inode->i_blkbits);
+		current->getblk_executed = 0;
+		current->getblk_bh_count = 0;
+		current->getblk_bh_state = 0;
+		current->getblk_stamp = jiffies;
+#endif
 	}
 }
 
@@ -3226,6 +3263,11 @@ EXPORT_SYMBOL(sync_dirty_buffer);
  */
 static inline int buffer_busy(struct buffer_head *bh)
 {
+#ifdef CONFIG_DEBUG_AID_FOR_SYZBOT
+	current->getblk_executed |= 0x80;
+	current->getblk_bh_count = atomic_read(&bh->b_count);
+	current->getblk_bh_state = bh->b_state;
+#endif
 	return atomic_read(&bh->b_count) |
 		(bh->b_state & ((1 << BH_Dirty) | (1 << BH_Lock)));
 }
@@ -3264,11 +3306,18 @@ int try_to_free_buffers(struct page *page)
 	int ret = 0;
 
 	BUG_ON(!PageLocked(page));
-	if (PageWriteback(page))
+	if (PageWriteback(page)) {
+#ifdef CONFIG_DEBUG_AID_FOR_SYZBOT
+		current->getblk_executed |= 0x10;
+#endif
 		return 0;
+	}
 
 	if (mapping == NULL) {		/* can this still happen? */
 		ret = drop_buffers(page, &buffers_to_free);
+#ifdef CONFIG_DEBUG_AID_FOR_SYZBOT
+		current->getblk_executed |= 0x20;
+#endif
 		goto out;
 	}
 
@@ -3292,6 +3341,9 @@ int try_to_free_buffers(struct page *page)
 	if (ret)
 		cancel_dirty_page(page);
 	spin_unlock(&mapping->private_lock);
+#ifdef CONFIG_DEBUG_AID_FOR_SYZBOT
+	current->getblk_executed |= 0x40;
+#endif
 out:
 	if (buffers_to_free) {
 		struct buffer_head *bh = buffers_to_free;
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 9f53c3d99304..84725b53ac21 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -247,6 +247,7 @@ static int ceph_init_file(struct inode *inode, struct file *file, int fmode)
 	case S_IFREG:
 		ceph_fscache_register_inode_cookie(inode);
 		ceph_fscache_file_set_cookie(inode, file);
+		/* fall through */
 	case S_IFDIR:
 		ret = ceph_init_file_info(inode, file, fmode,
 						S_ISDIR(inode->i_mode));
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 217276b8b942..f9b71c12cc9f 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -1008,7 +1008,7 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off,
 	unsigned int xid;
 	int rc;
 
-	if (remap_flags & ~REMAP_FILE_ADVISORY)
+	if (remap_flags & ~(REMAP_FILE_DEDUP | REMAP_FILE_ADVISORY))
 		return -EINVAL;
 
 	cifs_dbg(FYI, "clone range\n");
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 2a6d20c0ce02..89006e044973 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -2632,43 +2632,56 @@ cifs_resend_wdata(struct cifs_writedata *wdata, struct list_head *wdata_list,
 	struct TCP_Server_Info *server =
 		tlink_tcon(wdata->cfile->tlink)->ses->server;
 
-	/*
-	 * Wait for credits to resend this wdata.
-	 * Note: we are attempting to resend the whole wdata not in segments
-	 */
 	do {
-		rc = server->ops->wait_mtu_credits(server, wdata->bytes, &wsize,
-						   &credits);
+		if (wdata->cfile->invalidHandle) {
+			rc = cifs_reopen_file(wdata->cfile, false);
+			if (rc == -EAGAIN)
+				continue;
+			else if (rc)
+				break;
+		}
 
-		if (rc)
-			goto out;
 
-		if (wsize < wdata->bytes) {
-			add_credits_and_wake_if(server, &credits, 0);
-			msleep(1000);
-		}
-	} while (wsize < wdata->bytes);
+		/*
+		 * Wait for credits to resend this wdata.
+		 * Note: we are attempting to resend the whole wdata not in
+		 * segments
+		 */
+		do {
+			rc = server->ops->wait_mtu_credits(server, wdata->bytes,
+						&wsize, &credits);
+			if (rc)
+				goto fail;
+
+			if (wsize < wdata->bytes) {
+				add_credits_and_wake_if(server, &credits, 0);
+				msleep(1000);
+			}
+		} while (wsize < wdata->bytes);
+		wdata->credits = credits;
 
-	wdata->credits = credits;
-	rc = -EAGAIN;
-	while (rc == -EAGAIN) {
-		rc = 0;
-		if (wdata->cfile->invalidHandle)
-			rc = cifs_reopen_file(wdata->cfile, false);
-		if (!rc)
-			rc = server->ops->async_writev(wdata,
+		rc = adjust_credits(server, &wdata->credits, wdata->bytes);
+
+		if (!rc) {
+			if (wdata->cfile->invalidHandle)
+				rc = -EAGAIN;
+			else
+				rc = server->ops->async_writev(wdata,
 					cifs_uncached_writedata_release);
-	}
+		}
 
-	if (!rc) {
-		list_add_tail(&wdata->list, wdata_list);
-		return 0;
-	}
+		/* If the write was successfully sent, we are done */
+		if (!rc) {
+			list_add_tail(&wdata->list, wdata_list);
+			return 0;
+		}
 
-	add_credits_and_wake_if(server, &wdata->credits, 0);
-out:
-	kref_put(&wdata->refcount, cifs_uncached_writedata_release);
+		/* Roll back credits and retry if needed */
+		add_credits_and_wake_if(server, &wdata->credits, 0);
+	} while (rc == -EAGAIN);
 
+fail:
+	kref_put(&wdata->refcount, cifs_uncached_writedata_release);
 	return rc;
 }
 
@@ -2896,12 +2909,12 @@ static void collect_uncached_write_data(struct cifs_aio_ctx *ctx)
 						wdata->bytes, &tmp_from,
 						ctx->cfile, cifs_sb, &tmp_list,
 						ctx);
+
+					kref_put(&wdata->refcount,
+						cifs_uncached_writedata_release);
 				}
 
 				list_splice(&tmp_list, &ctx->list);
-
-				kref_put(&wdata->refcount,
-					 cifs_uncached_writedata_release);
 				goto restart_loop;
 			}
 		}
@@ -3348,44 +3361,55 @@ static int cifs_resend_rdata(struct cifs_readdata *rdata,
 	struct TCP_Server_Info *server =
 		tlink_tcon(rdata->cfile->tlink)->ses->server;
 
-	/*
-	 * Wait for credits to resend this rdata.
-	 * Note: we are attempting to resend the whole rdata not in segments
-	 */
 	do {
-		rc = server->ops->wait_mtu_credits(server, rdata->bytes,
+		if (rdata->cfile->invalidHandle) {
+			rc = cifs_reopen_file(rdata->cfile, true);
+			if (rc == -EAGAIN)
+				continue;
+			else if (rc)
+				break;
+		}
+
+		/*
+		 * Wait for credits to resend this rdata.
+		 * Note: we are attempting to resend the whole rdata not in
+		 * segments
+		 */
+		do {
+			rc = server->ops->wait_mtu_credits(server, rdata->bytes,
 						&rsize, &credits);
 
-		if (rc)
-			goto out;
+			if (rc)
+				goto fail;
 
-		if (rsize < rdata->bytes) {
-			add_credits_and_wake_if(server, &credits, 0);
-			msleep(1000);
-		}
-	} while (rsize < rdata->bytes);
+			if (rsize < rdata->bytes) {
+				add_credits_and_wake_if(server, &credits, 0);
+				msleep(1000);
+			}
+		} while (rsize < rdata->bytes);
+		rdata->credits = credits;
 
-	rdata->credits = credits;
-	rc = -EAGAIN;
-	while (rc == -EAGAIN) {
-		rc = 0;
-		if (rdata->cfile->invalidHandle)
-			rc = cifs_reopen_file(rdata->cfile, true);
-		if (!rc)
-			rc = server->ops->async_readv(rdata);
-	}
+		rc = adjust_credits(server, &rdata->credits, rdata->bytes);
+		if (!rc) {
+			if (rdata->cfile->invalidHandle)
+				rc = -EAGAIN;
+			else
+				rc = server->ops->async_readv(rdata);
+		}
 
-	if (!rc) {
-		/* Add to aio pending list */
-		list_add_tail(&rdata->list, rdata_list);
-		return 0;
-	}
+		/* If the read was successfully sent, we are done */
+		if (!rc) {
+			/* Add to aio pending list */
+			list_add_tail(&rdata->list, rdata_list);
+			return 0;
+		}
 
-	add_credits_and_wake_if(server, &rdata->credits, 0);
-out:
-	kref_put(&rdata->refcount,
-		cifs_uncached_readdata_release);
+		/* Roll back credits and retry if needed */
+		add_credits_and_wake_if(server, &rdata->credits, 0);
+	} while (rc == -EAGAIN);
 
+fail:
+	kref_put(&rdata->refcount, cifs_uncached_readdata_release);
 	return rc;
 }
 
diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c
index 924269cec135..e32c264e3adb 100644
--- a/fs/cifs/smb2maperror.c
+++ b/fs/cifs/smb2maperror.c
@@ -1036,7 +1036,8 @@ static const struct status_to_posix_error smb2_error_map_table[] = {
 	{STATUS_UNFINISHED_CONTEXT_DELETED, -EIO,
 	"STATUS_UNFINISHED_CONTEXT_DELETED"},
 	{STATUS_NO_TGT_REPLY, -EIO, "STATUS_NO_TGT_REPLY"},
-	{STATUS_OBJECTID_NOT_FOUND, -EIO, "STATUS_OBJECTID_NOT_FOUND"},
+	/* Note that ENOATTTR and ENODATA are the same errno */
+	{STATUS_OBJECTID_NOT_FOUND, -ENODATA, "STATUS_OBJECTID_NOT_FOUND"},
 	{STATUS_NO_IP_ADDRESSES, -EIO, "STATUS_NO_IP_ADDRESSES"},
 	{STATUS_WRONG_CREDENTIAL_HANDLE, -EIO,
 	"STATUS_WRONG_CREDENTIAL_HANDLE"},
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index 39843fa7e11b..591e82ba443c 100644
--- a/fs/configfs/dir.c
+++ b/fs/configfs/dir.c
@@ -1690,9 +1690,11 @@ static loff_t configfs_dir_lseek(struct file *file, loff_t offset, int whence)
 	switch (whence) {
 		case 1:
 			offset += file->f_pos;
+			/* fall through */
 		case 0:
 			if (offset >= 0)
 				break;
+			/* fall through */
 		default:
 			return -EINVAL;
 	}
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index db43b98c4d64..738136a762d4 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -210,8 +210,10 @@ static int do_uevent(struct dlm_ls *ls, int in)
 	/* dlm_controld will see the uevent, do the necessary group management
 	   and then write to sysfs to wake us */
 
-	error = wait_event_interruptible(ls->ls_uevent_wait,
-			test_and_clear_bit(LSFL_UEVENT_WAIT, &ls->ls_flags));
+	do {
+		error = wait_event_interruptible(ls->ls_uevent_wait,
+						 test_and_clear_bit(LSFL_UEVENT_WAIT, &ls->ls_flags));
+	} while (error == -ERESTARTSYS);
 
 	log_rinfo(ls, "group event done %d %d", error, ls->ls_uevent_result);
 
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index f664da55234e..14a17a5ad812 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -37,6 +37,7 @@
 #include <linux/slab.h>
 #include <asm/unaligned.h>
 #include <linux/kernel.h>
+#include <linux/xattr.h>
 #include "ecryptfs_kernel.h"
 
 #define DECRYPT		0
@@ -1019,8 +1020,10 @@ int ecryptfs_read_and_validate_header_region(struct inode *inode)
 
 	rc = ecryptfs_read_lower(file_size, 0, ECRYPTFS_SIZE_AND_MARKER_BYTES,
 				 inode);
-	if (rc < ECRYPTFS_SIZE_AND_MARKER_BYTES)
-		return rc >= 0 ? -EINVAL : rc;
+	if (rc < 0)
+		return rc;
+	else if (rc < ECRYPTFS_SIZE_AND_MARKER_BYTES)
+		return -EINVAL;
 	rc = ecryptfs_validate_marker(marker);
 	if (!rc)
 		ecryptfs_i_size_init(file_size, inode);
@@ -1130,9 +1133,21 @@ ecryptfs_write_metadata_to_xattr(struct dentry *ecryptfs_dentry,
 				 char *page_virt, size_t size)
 {
 	int rc;
+	struct dentry *lower_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry);
+	struct inode *lower_inode = d_inode(lower_dentry);
 
-	rc = ecryptfs_setxattr(ecryptfs_dentry, ecryptfs_inode,
-			       ECRYPTFS_XATTR_NAME, page_virt, size, 0);
+	if (!(lower_inode->i_opflags & IOP_XATTR)) {
+		rc = -EOPNOTSUPP;
+		goto out;
+	}
+
+	inode_lock(lower_inode);
+	rc = __vfs_setxattr(lower_dentry, lower_inode, ECRYPTFS_XATTR_NAME,
+			    page_virt, size, 0);
+	if (!rc && ecryptfs_inode)
+		fsstack_copy_attr_all(ecryptfs_inode, lower_inode);
+	inode_unlock(lower_inode);
+out:
 	return rc;
 }
 
@@ -1382,8 +1397,10 @@ int ecryptfs_read_and_validate_xattr_region(struct dentry *dentry,
 				     ecryptfs_inode_to_lower(inode),
 				     ECRYPTFS_XATTR_NAME, file_size,
 				     ECRYPTFS_SIZE_AND_MARKER_BYTES);
-	if (rc < ECRYPTFS_SIZE_AND_MARKER_BYTES)
-		return rc >= 0 ? -EINVAL : rc;
+	if (rc < 0)
+		return rc;
+	else if (rc < ECRYPTFS_SIZE_AND_MARKER_BYTES)
+		return -EINVAL;
 	rc = ecryptfs_validate_marker(marker);
 	if (!rc)
 		ecryptfs_i_size_init(file_size, inode);
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
index e74fe84d0886..624ff4409c61 100644
--- a/fs/ecryptfs/keystore.c
+++ b/fs/ecryptfs/keystore.c
@@ -1063,8 +1063,9 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
 		       "rc = [%d]\n", __func__, rc);
 		goto out_free_unlock;
 	}
-	while (s->decrypted_filename[s->i] != '\0'
-	       && s->i < s->block_aligned_filename_size)
+
+	while (s->i < s->block_aligned_filename_size &&
+	       s->decrypted_filename[s->i] != '\0')
 		s->i++;
 	if (s->i == s->block_aligned_filename_size) {
 		printk(KERN_WARNING "%s: Invalid tag 70 packet; could not "
diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h
index a1ac7e9245ec..75a5309f2231 100644
--- a/fs/ext4/ext4_jbd2.h
+++ b/fs/ext4/ext4_jbd2.h
@@ -384,7 +384,7 @@ static inline void ext4_update_inode_fsync_trans(handle_t *handle,
 {
 	struct ext4_inode_info *ei = EXT4_I(inode);
 
-	if (ext4_handle_valid(handle)) {
+	if (ext4_handle_valid(handle) && !is_handle_aborted(handle)) {
 		ei->i_sync_tid = handle->h_transaction->t_tid;
 		if (datasync)
 			ei->i_datasync_tid = handle->h_transaction->t_tid;
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 69d65d49837b..98ec11f69cd4 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -125,7 +125,7 @@ ext4_unaligned_aio(struct inode *inode, struct iov_iter *from, loff_t pos)
 	struct super_block *sb = inode->i_sb;
 	int blockmask = sb->s_blocksize - 1;
 
-	if (pos >= i_size_read(inode))
+	if (pos >= ALIGN(i_size_read(inode), sb->s_blocksize))
 		return 0;
 
 	if ((pos | iov_iter_alignment(from)) & blockmask)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index b54b261ded36..b32a57bc5d5d 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -6080,36 +6080,6 @@ void ext4_dirty_inode(struct inode *inode, int flags)
 	return;
 }
 
-#if 0
-/*
- * Bind an inode's backing buffer_head into this transaction, to prevent
- * it from being flushed to disk early.  Unlike
- * ext4_reserve_inode_write, this leaves behind no bh reference and
- * returns no iloc structure, so the caller needs to repeat the iloc
- * lookup to mark the inode dirty later.
- */
-static int ext4_pin_inode(handle_t *handle, struct inode *inode)
-{
-	struct ext4_iloc iloc;
-
-	int err = 0;
-	if (handle) {
-		err = ext4_get_inode_loc(inode, &iloc);
-		if (!err) {
-			BUFFER_TRACE(iloc.bh, "get_write_access");
-			err = jbd2_journal_get_write_access(handle, iloc.bh);
-			if (!err)
-				err = ext4_handle_dirty_metadata(handle,
-								 NULL,
-								 iloc.bh);
-			brelse(iloc.bh);
-		}
-	}
-	ext4_std_error(inode->i_sb, err);
-	return err;
-}
-#endif
-
 int ext4_change_inode_journal_flag(struct inode *inode, int val)
 {
 	journal_t *journal;
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 3d9b18505c0c..e7ae26e36c9c 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -932,11 +932,18 @@ static int add_new_gdb_meta_bg(struct super_block *sb,
 	memcpy(n_group_desc, o_group_desc,
 	       EXT4_SB(sb)->s_gdb_count * sizeof(struct buffer_head *));
 	n_group_desc[gdb_num] = gdb_bh;
+
+	BUFFER_TRACE(gdb_bh, "get_write_access");
+	err = ext4_journal_get_write_access(handle, gdb_bh);
+	if (err) {
+		kvfree(n_group_desc);
+		brelse(gdb_bh);
+		return err;
+	}
+
 	EXT4_SB(sb)->s_group_desc = n_group_desc;
 	EXT4_SB(sb)->s_gdb_count++;
 	kvfree(o_group_desc);
-	BUFFER_TRACE(gdb_bh, "get_write_access");
-	err = ext4_journal_get_write_access(handle, gdb_bh);
 	return err;
 }
 
@@ -2073,6 +2080,10 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
 		free_flex_gd(flex_gd);
 	if (resize_inode != NULL)
 		iput(resize_inode);
-	ext4_msg(sb, KERN_INFO, "resized filesystem to %llu", n_blocks_count);
+	if (err)
+		ext4_warning(sb, "error (%d) occurred during "
+			     "file system resize", err);
+	ext4_msg(sb, KERN_INFO, "resized filesystem to %llu",
+		 ext4_blocks_count(es));
 	return err;
 }
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index f5b828bf1299..6ed4eb81e674 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -430,6 +430,12 @@ static void ext4_journal_commit_callback(journal_t *journal, transaction_t *txn)
 	spin_unlock(&sbi->s_md_lock);
 }
 
+static bool system_going_down(void)
+{
+	return system_state == SYSTEM_HALT || system_state == SYSTEM_POWER_OFF
+		|| system_state == SYSTEM_RESTART;
+}
+
 /* Deal with the reporting of failure conditions on a filesystem such as
  * inconsistencies detected or read IO failures.
  *
@@ -460,7 +466,12 @@ static void ext4_handle_error(struct super_block *sb)
 		if (journal)
 			jbd2_journal_abort(journal, -EIO);
 	}
-	if (test_opt(sb, ERRORS_RO)) {
+	/*
+	 * We force ERRORS_RO behavior when system is rebooting. Otherwise we
+	 * could panic during 'reboot -f' as the underlying device got already
+	 * disabled.
+	 */
+	if (test_opt(sb, ERRORS_RO) || system_going_down()) {
 		ext4_msg(sb, KERN_CRIT, "Remounting filesystem read-only");
 		/*
 		 * Make sure updated value of ->s_mount_flags will be visible
@@ -468,8 +479,7 @@ static void ext4_handle_error(struct super_block *sb)
 		 */
 		smp_wmb();
 		sb->s_flags |= SB_RDONLY;
-	}
-	if (test_opt(sb, ERRORS_PANIC)) {
+	} else if (test_opt(sb, ERRORS_PANIC)) {
 		if (EXT4_SB(sb)->s_journal &&
 		  !(EXT4_SB(sb)->s_journal->j_flags & JBD2_REC_ERR))
 			return;
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 3f99ab288695..d6e48a6487d5 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -616,8 +616,10 @@ pgoff_t f2fs_get_next_page_offset(struct dnode_of_data *dn, pgoff_t pgofs)
 	switch (dn->max_level) {
 	case 3:
 		base += 2 * indirect_blks;
+		/* fall through */
 	case 2:
 		base += 2 * direct_blks;
+		/* fall through */
 	case 1:
 		base += direct_index;
 		break;
diff --git a/fs/fcntl.c b/fs/fcntl.c
index 083185174c6d..3d40771e8e7c 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -769,7 +769,7 @@ static void send_sigio_to_task(struct task_struct *p,
 			si.si_fd    = fd;
 			if (!do_send_sig_info(signum, &si, p, type))
 				break;
-		/* fall-through: fall back on the old plain SIGIO signal */
+		/* fall-through - fall back on the old plain SIGIO signal */
 		case 0:
 			do_send_sig_info(SIGIO, SEND_SIG_PRIV, p, type);
 	}
diff --git a/fs/fs_parser.c b/fs/fs_parser.c
index 842e8f749db6..570d71043acf 100644
--- a/fs/fs_parser.c
+++ b/fs/fs_parser.c
@@ -410,7 +410,7 @@ bool fs_validate_description(const struct fs_parameter_description *desc)
 			for (param = desc->specs; param->name; param++) {
 				if (param->opt == e->opt &&
 				    param->type != fs_param_is_enum) {
-					pr_err("VALIDATE %s: e[%lu] enum val for %s\n",
+					pr_err("VALIDATE %s: e[%tu] enum val for %s\n",
 					       name, e - desc->enums, param->name);
 					good = false;
 				}
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 02b2646d84b3..fc95fe528c47 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -710,7 +710,7 @@ static int gfs2_iomap_alloc(struct inode *inode, struct iomap *iomap,
 			}
 			if (n == 0)
 				break;
-		/* Branching from existing tree */
+		/* fall through - To branching from existing tree */
 		case ALLOC_GROW_DEPTH:
 			if (i > 1 && i < mp->mp_fheight)
 				gfs2_trans_add_meta(ip->i_gl, mp->mp_bh[i-1]);
@@ -721,7 +721,7 @@ static int gfs2_iomap_alloc(struct inode *inode, struct iomap *iomap,
 				state = ALLOC_DATA;
 			if (n == 0)
 				break;
-		/* Tree complete, adding data blocks */
+		/* fall through - To tree complete, adding data blocks */
 		case ALLOC_DATA:
 			BUG_ON(n > dblks);
 			BUG_ON(mp->mp_bh[end_of_metadata] == NULL);
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c
index eab04eca95a3..112d85849db1 100644
--- a/fs/jffs2/fs.c
+++ b/fs/jffs2/fs.c
@@ -340,6 +340,7 @@ struct inode *jffs2_iget(struct super_block *sb, unsigned long ino)
 			rdev = old_decode_dev(je16_to_cpu(jdev.old_id));
 		else
 			rdev = new_decode_dev(je32_to_cpu(jdev.new_id));
+		/* fall through */
 
 	case S_IFSOCK:
 	case S_IFIFO:
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c
index 8c06a6ea862d..ebb299003a5b 100644
--- a/fs/jfs/acl.c
+++ b/fs/jfs/acl.c
@@ -117,7 +117,8 @@ int jfs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
 		rc = posix_acl_update_mode(inode, &mode, &acl);
 		if (rc)
 			goto end_tx;
-		update_mode = 1;
+		if (mode != inode->i_mode)
+			update_mode = 1;
 	}
 	rc = __jfs_set_acl(tid, inode, type, acl);
 	if (!rc) {
diff --git a/fs/jfs/jfs_incore.h b/fs/jfs/jfs_incore.h
index 912a3af2393e..340eb8e4f716 100644
--- a/fs/jfs/jfs_incore.h
+++ b/fs/jfs/jfs_incore.h
@@ -23,6 +23,8 @@
 #include <linux/rwsem.h>
 #include <linux/slab.h>
 #include <linux/bitops.h>
+#include <linux/uuid.h>
+
 #include "jfs_types.h"
 #include "jfs_xtree.h"
 #include "jfs_dtree.h"
@@ -178,8 +180,8 @@ struct jfs_sb_info {
 	pxd_t		logpxd;		/* pxd describing log	*/
 	pxd_t		fsckpxd;	/* pxd describing fsck wkspc */
 	pxd_t		ait2;		/* pxd describing AIT copy	*/
-	char		uuid[16];	/* 128-bit uuid for volume	*/
-	char		loguuid[16];	/* 128-bit uuid for log	*/
+	uuid_t		uuid;		/* 128-bit uuid for volume	*/
+	uuid_t		loguuid;	/* 128-bit uuid for log	*/
 	/*
 	 * commit_state is used for synchronization of the jfs_commit
 	 * threads.  It is protected by LAZY_LOCK().
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
index 6b68df395892..4c77b808020b 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -1092,8 +1092,7 @@ int lmLogOpen(struct super_block *sb)
 	mutex_lock(&jfs_log_mutex);
 	list_for_each_entry(log, &jfs_external_logs, journal_list) {
 		if (log->bdev->bd_dev == sbi->logdev) {
-			if (memcmp(log->uuid, sbi->loguuid,
-				   sizeof(log->uuid))) {
+			if (!uuid_equal(&log->uuid, &sbi->loguuid)) {
 				jfs_warn("wrong uuid on JFS journal");
 				mutex_unlock(&jfs_log_mutex);
 				return -EINVAL;
@@ -1130,7 +1129,7 @@ int lmLogOpen(struct super_block *sb)
 	}
 
 	log->bdev = bdev;
-	memcpy(log->uuid, sbi->loguuid, sizeof(log->uuid));
+	uuid_copy(&log->uuid, &sbi->loguuid);
 
 	/*
 	 * initialize log:
@@ -1336,7 +1335,7 @@ int lmLogInit(struct jfs_log * log)
 			jfs_info("lmLogInit: inline log:0x%p base:0x%Lx size:0x%x",
 				 log, (unsigned long long)log->base, log->size);
 		} else {
-			if (memcmp(logsuper->uuid, log->uuid, 16)) {
+			if (!uuid_equal(&logsuper->uuid, &log->uuid)) {
 				jfs_warn("wrong uuid on JFS log device");
 				goto errout20;
 			}
@@ -1732,7 +1731,7 @@ static int lmLogFileSystem(struct jfs_log * log, struct jfs_sb_info *sbi,
 	int i;
 	struct logsuper *logsuper;
 	struct lbuf *bpsuper;
-	char *uuid = sbi->uuid;
+	uuid_t *uuid = &sbi->uuid;
 
 	/*
 	 * insert/remove file system device to log active file system list.
@@ -1743,8 +1742,8 @@ static int lmLogFileSystem(struct jfs_log * log, struct jfs_sb_info *sbi,
 	logsuper = (struct logsuper *) bpsuper->l_ldata;
 	if (activate) {
 		for (i = 0; i < MAX_ACTIVE; i++)
-			if (!memcmp(logsuper->active[i].uuid, NULL_UUID, 16)) {
-				memcpy(logsuper->active[i].uuid, uuid, 16);
+			if (uuid_is_null(&logsuper->active[i].uuid)) {
+				uuid_copy(&logsuper->active[i].uuid, uuid);
 				sbi->aggregate = i;
 				break;
 			}
@@ -1755,8 +1754,9 @@ static int lmLogFileSystem(struct jfs_log * log, struct jfs_sb_info *sbi,
 		}
 	} else {
 		for (i = 0; i < MAX_ACTIVE; i++)
-			if (!memcmp(logsuper->active[i].uuid, uuid, 16)) {
-				memcpy(logsuper->active[i].uuid, NULL_UUID, 16);
+			if (uuid_equal(&logsuper->active[i].uuid, uuid)) {
+				uuid_copy(&logsuper->active[i].uuid,
+					  &uuid_null);
 				break;
 			}
 		if (i == MAX_ACTIVE) {
diff --git a/fs/jfs/jfs_logmgr.h b/fs/jfs/jfs_logmgr.h
index e38c21598850..870fc22360e7 100644
--- a/fs/jfs/jfs_logmgr.h
+++ b/fs/jfs/jfs_logmgr.h
@@ -19,6 +19,8 @@
 #ifndef	_H_JFS_LOGMGR
 #define _H_JFS_LOGMGR
 
+#include <linux/uuid.h>
+
 #include "jfs_filsys.h"
 #include "jfs_lock.h"
 
@@ -73,15 +75,13 @@ struct logsuper {
 	__le32 state;		/* 4: state - see below */
 
 	__le32 end;		/* 4: addr of last log record set by logredo */
-	char uuid[16];		/* 16: 128-bit journal uuid */
+	uuid_t uuid;		/* 16: 128-bit journal uuid */
 	char label[16];		/* 16: journal label */
 	struct {
-		char uuid[16];
+		uuid_t uuid;
 	} active[MAX_ACTIVE];	/* 2048: active file systems list */
 };
 
-#define NULL_UUID "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-
 /* log flag: commit option (see jfs_filsys.h) */
 
 /* log state */
@@ -410,7 +410,7 @@ struct jfs_log {
 	spinlock_t synclock;	/* 4: synclist lock */
 	struct lbuf *wqueue;	/* 4: log pageout queue */
 	int count;		/* 4: count */
-	char uuid[16];		/* 16: 128-bit uuid of log device */
+	uuid_t uuid;		/* 16: 128-bit uuid of log device */
 
 	int no_integrity;	/* 3: flag to disable journaling to disk */
 };
diff --git a/fs/jfs/jfs_mount.c b/fs/jfs/jfs_mount.c
index d8658607bf46..c9c1f16b93df 100644
--- a/fs/jfs/jfs_mount.c
+++ b/fs/jfs/jfs_mount.c
@@ -389,8 +389,8 @@ static int chkSuper(struct super_block *sb)
 		sbi->logpxd = j_sb->s_logpxd;
 	else {
 		sbi->logdev = new_decode_dev(le32_to_cpu(j_sb->s_logdev));
-		memcpy(sbi->uuid, j_sb->s_uuid, sizeof(sbi->uuid));
-		memcpy(sbi->loguuid, j_sb->s_loguuid, sizeof(sbi->uuid));
+		uuid_copy(&sbi->uuid, &j_sb->s_uuid);
+		uuid_copy(&sbi->loguuid, &j_sb->s_loguuid);
 	}
 	sbi->fsckpxd = j_sb->s_fsckpxd;
 	sbi->ait2 = j_sb->s_ait2;
diff --git a/fs/jfs/jfs_superblock.h b/fs/jfs/jfs_superblock.h
index 04847b8d3070..eb03de7fa925 100644
--- a/fs/jfs/jfs_superblock.h
+++ b/fs/jfs/jfs_superblock.h
@@ -18,6 +18,8 @@
 #ifndef	_H_JFS_SUPERBLOCK
 #define _H_JFS_SUPERBLOCK
 
+#include <linux/uuid.h>
+
 /*
  * make the magic number something a human could read
  */
@@ -98,11 +100,9 @@ struct jfs_superblock {
 	__le64 s_xsize;		/* 8: extendfs s_size */
 	pxd_t s_xfsckpxd;	/* 8: extendfs fsckpxd */
 	pxd_t s_xlogpxd;	/* 8: extendfs logpxd */
-	/* - 128 byte boundary - */
-
-	char s_uuid[16];	/* 16: 128-bit uuid for volume */
+	uuid_t s_uuid;		/* 16: 128-bit uuid for volume */
 	char s_label[16];	/* 16: volume label */
-	char s_loguuid[16];	/* 16: 128-bit uuid for log device */
+	uuid_t s_loguuid;	/* 16: 128-bit uuid for log device */
 
 };
 
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 14528c0ffe63..fa719a1553b6 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -203,7 +203,7 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, umode_t mode,
  * RETURN:	Errors from subroutines
  *
  * note:
- * EACCESS: user needs search+write permission on the parent directory
+ * EACCES: user needs search+write permission on the parent directory
  */
 static int jfs_mkdir(struct inode *dip, struct dentry *dentry, umode_t mode)
 {
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 65d8fc87ab11..c15ff56a8516 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -174,9 +174,11 @@ static int jfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 	buf->f_files = maxinodes;
 	buf->f_ffree = maxinodes - (atomic_read(&imap->im_numinos) -
 				    atomic_read(&imap->im_numfree));
-	buf->f_fsid.val[0] = (u32)crc32_le(0, sbi->uuid, sizeof(sbi->uuid)/2);
-	buf->f_fsid.val[1] = (u32)crc32_le(0, sbi->uuid + sizeof(sbi->uuid)/2,
-					sizeof(sbi->uuid)/2);
+	buf->f_fsid.val[0] = crc32_le(0, (char *)&sbi->uuid,
+				      sizeof(sbi->uuid)/2);
+	buf->f_fsid.val[1] = crc32_le(0,
+				      (char *)&sbi->uuid + sizeof(sbi->uuid)/2,
+				      sizeof(sbi->uuid)/2);
 
 	buf->f_namelen = JFS_NAME_MAX;
 	return 0;
diff --git a/fs/libfs.c b/fs/libfs.c
index 0fb590d79f30..9efb647917e0 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -146,9 +146,11 @@ loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence)
 	switch (whence) {
 		case 1:
 			offset += file->f_pos;
+			/* fall through */
 		case 0:
 			if (offset >= 0)
 				break;
+			/* fall through */
 		default:
 			return -EINVAL;
 	}
diff --git a/fs/locks.c b/fs/locks.c
index eaa1cfaf73b0..737166f3cf14 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1471,7 +1471,7 @@ static void lease_clear_pending(struct file_lock *fl, int arg)
 	switch (arg) {
 	case F_UNLCK:
 		fl->fl_flags &= ~FL_UNLOCK_PENDING;
-		/* fall through: */
+		/* fall through */
 	case F_RDLCK:
 		fl->fl_flags &= ~FL_DOWNGRADE_PENDING;
 	}
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 0cfd257ffdaf..4680ad3bf55b 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -427,6 +427,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 				goto out;
 			open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED;
 			reclaim = true;
+			/* fall through */
 		case NFS4_OPEN_CLAIM_FH:
 		case NFS4_OPEN_CLAIM_DELEG_CUR_FH:
 			status = do_open_fhandle(rqstp, cstate, open);
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 6a45fb00c5fc..0742aa44a756 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2576,6 +2576,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 		break;
 	default:				/* checked by xdr code */
 		WARN_ON_ONCE(1);
+		/* fall through */
 	case SP4_SSV:
 		status = nfserr_encr_alg_unsupp;
 		goto out_nolock;
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 6f0999015a44..c89fa18c9b03 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -6007,6 +6007,7 @@ int __ocfs2_flush_truncate_log(struct ocfs2_super *osb)
 	struct buffer_head *data_alloc_bh = NULL;
 	struct ocfs2_dinode *di;
 	struct ocfs2_truncate_log *tl;
+	struct ocfs2_journal *journal = osb->journal;
 
 	BUG_ON(inode_trylock(tl_inode));
 
@@ -6027,6 +6028,20 @@ int __ocfs2_flush_truncate_log(struct ocfs2_super *osb)
 		goto out;
 	}
 
+	/* Appending truncate log(TA) and and flushing truncate log(TF) are
+	 * two separated transactions. They can be both committed but not
+	 * checkpointed. If crash occurs then, both two transaction will be
+	 * replayed with several already released to global bitmap clusters.
+	 * Then truncate log will be replayed resulting in cluster double free.
+	 */
+	jbd2_journal_lock_updates(journal->j_journal);
+	status = jbd2_journal_flush(journal->j_journal);
+	jbd2_journal_unlock_updates(journal->j_journal);
+	if (status < 0) {
+		mlog_errno(status);
+		goto out;
+	}
+
 	data_alloc_inode = ocfs2_get_system_file_inode(osb,
 						       GLOBAL_BITMAP_SYSTEM_INODE,
 						       OCFS2_INVALID_SLOT);
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 832c1759a09a..e8ea6f783f19 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -2153,13 +2153,30 @@ static int ocfs2_dio_wr_get_block(struct inode *inode, sector_t iblock,
 	struct ocfs2_dio_write_ctxt *dwc = NULL;
 	struct buffer_head *di_bh = NULL;
 	u64 p_blkno;
-	loff_t pos = iblock << inode->i_sb->s_blocksize_bits;
+	unsigned int i_blkbits = inode->i_sb->s_blocksize_bits;
+	loff_t pos = iblock << i_blkbits;
+	sector_t endblk = (i_size_read(inode) - 1) >> i_blkbits;
 	unsigned len, total_len = bh_result->b_size;
 	int ret = 0, first_get_block = 0;
 
 	len = osb->s_clustersize - (pos & (osb->s_clustersize - 1));
 	len = min(total_len, len);
 
+	/*
+	 * bh_result->b_size is count in get_more_blocks according to write
+	 * "pos" and "end", we need map twice to return different buffer state:
+	 * 1. area in file size, not set NEW;
+	 * 2. area out file size, set  NEW.
+	 *
+	 *		   iblock    endblk
+	 * |--------|---------|---------|---------
+	 * |<-------area in file------->|
+	 */
+
+	if ((iblock <= endblk) &&
+	    ((iblock + ((len - 1) >> i_blkbits)) > endblk))
+		len = (endblk - iblock + 1) << i_blkbits;
+
 	mlog(0, "get block of %lu at %llu:%u req %u\n",
 			inode->i_ino, pos, len, total_len);
 
@@ -2243,6 +2260,9 @@ static int ocfs2_dio_wr_get_block(struct inode *inode, sector_t iblock,
 	if (desc->c_needs_zero)
 		set_buffer_new(bh_result);
 
+	if (iblock > endblk)
+		set_buffer_new(bh_result);
+
 	/* May sleep in end_io. It should not happen in a irq context. So defer
 	 * it to dio work queue. */
 	set_buffer_defer_completion(bh_result);
diff --git a/fs/ocfs2/cluster/quorum.c b/fs/ocfs2/cluster/quorum.c
index af2e7473956e..67dcee65fe50 100644
--- a/fs/ocfs2/cluster/quorum.c
+++ b/fs/ocfs2/cluster/quorum.c
@@ -81,6 +81,7 @@ static void o2quo_fence_self(void)
 	default:
 		WARN_ON(o2nm_single_cluster->cl_fence_method >=
 			O2NM_FENCE_METHODS);
+		/* fall through */
 	case O2NM_FENCE_RESET:
 		printk(KERN_ERR "*** ocfs2 is very sorry to be fencing this "
 		       "system by restarting ***\n");
diff --git a/fs/ocfs2/dlm/dlmunlock.c b/fs/ocfs2/dlm/dlmunlock.c
index 63d701cd1e2e..c8e9b7031d9a 100644
--- a/fs/ocfs2/dlm/dlmunlock.c
+++ b/fs/ocfs2/dlm/dlmunlock.c
@@ -105,7 +105,8 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,
 	enum dlm_status status;
 	int actions = 0;
 	int in_use;
-        u8 owner;
+	u8 owner;
+	int recovery_wait = 0;
 
 	mlog(0, "master_node = %d, valblk = %d\n", master_node,
 	     flags & LKM_VALBLK);
@@ -208,9 +209,12 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,
 		}
 		if (flags & LKM_CANCEL)
 			lock->cancel_pending = 0;
-		else
-			lock->unlock_pending = 0;
-
+		else {
+			if (!lock->unlock_pending)
+				recovery_wait = 1;
+			else
+				lock->unlock_pending = 0;
+		}
 	}
 
 	/* get an extra ref on lock.  if we are just switching
@@ -244,6 +248,17 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,
 	spin_unlock(&res->spinlock);
 	wake_up(&res->wq);
 
+	if (recovery_wait) {
+		spin_lock(&res->spinlock);
+		/* Unlock request will directly succeed after owner dies,
+		 * and the lock is already removed from grant list. We have to
+		 * wait for RECOVERING done or we miss the chance to purge it
+		 * since the removement is much faster than RECOVERING proc.
+		 */
+		__dlm_wait_on_lockres_flags(res, DLM_LOCK_RES_RECOVERING);
+		spin_unlock(&res->spinlock);
+	}
+
 	/* let the caller's final dlm_lock_put handle the actual kfree */
 	if (actions & DLM_UNLOCK_FREE_LOCK) {
 		/* this should always be coupled with list removal */
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index 11201b2d06b9..a26ae0b83f8f 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -145,6 +145,17 @@ static int ramfs_symlink(struct inode * dir, struct dentry *dentry, const char *
 	return error;
 }
 
+static int ramfs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
+{
+	struct inode *inode;
+
+	inode = ramfs_get_inode(dir->i_sb, dir, mode, 0);
+	if (!inode)
+		return -ENOSPC;
+	d_tmpfile(dentry, inode);
+	return 0;
+}
+
 static const struct inode_operations ramfs_dir_inode_operations = {
 	.create		= ramfs_create,
 	.lookup		= simple_lookup,
@@ -155,6 +166,7 @@ static const struct inode_operations ramfs_dir_inode_operations = {
 	.rmdir		= simple_rmdir,
 	.mknod		= ramfs_mknod,
 	.rename		= simple_rename,
+	.tmpfile	= ramfs_tmpfile,
 };
 
 /*
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 1dea7a8a5255..abe27ec43176 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -317,6 +317,7 @@ loff_t seq_lseek(struct file *file, loff_t offset, int whence)
 	switch (whence) {
 	case SEEK_CUR:
 		offset += file->f_pos;
+		/* fall through */
 	case SEEK_SET:
 		if (offset < 0)
 			break;
diff --git a/fs/signalfd.c b/fs/signalfd.c
index 757afc7c5895..44b6845b071c 100644
--- a/fs/signalfd.c
+++ b/fs/signalfd.c
@@ -176,6 +176,7 @@ static ssize_t signalfd_dequeue(struct signalfd_ctx *ctx, kernel_siginfo_t *info
 		if (!nonblock)
 			break;
 		ret = -EAGAIN;
+		/* fall through */
 	default:
 		spin_unlock_irq(&current->sighand->siglock);
 		return ret;
diff --git a/fs/ufs/util.h b/fs/ufs/util.h
index 1fd3011ea623..f1ce28975429 100644
--- a/fs/ufs/util.h
+++ b/fs/ufs/util.h
@@ -42,7 +42,7 @@ ufs_get_fs_state(struct super_block *sb, struct ufs_super_block_first *usb1,
 	case UFS_ST_SUNOS:
 		if (fs32_to_cpu(sb, usb3->fs_postblformat) == UFS_42POSTBLFMT)
 			return fs32_to_cpu(sb, usb1->fs_u0.fs_sun.fs_state);
-		/* Fall Through to UFS_ST_SUN */
+		/* Fall Through - to UFS_ST_SUN */
 	case UFS_ST_SUN:
 		return fs32_to_cpu(sb, usb3->fs_un2.fs_sun.fs_state);
 	case UFS_ST_SUNx86:
@@ -63,7 +63,7 @@ ufs_set_fs_state(struct super_block *sb, struct ufs_super_block_first *usb1,
 			usb1->fs_u0.fs_sun.fs_state = cpu_to_fs32(sb, value);
 			break;
 		}
-		/* Fall Through to UFS_ST_SUN */
+		/* Fall Through - to UFS_ST_SUN */
 	case UFS_ST_SUN:
 		usb3->fs_un2.fs_sun.fs_state = cpu_to_fs32(sb, value);
 		break;
diff --git a/include/asm-generic/barrier.h b/include/asm-generic/barrier.h
index 2cafdbb9ae4c..fa2e2ef72b68 100644
--- a/include/asm-generic/barrier.h
+++ b/include/asm-generic/barrier.h
@@ -70,6 +70,24 @@
 #define __smp_read_barrier_depends()	read_barrier_depends()
 #endif
 
+#if defined(COMPILER_HAS_OPTIMIZER_HIDE_VAR) && \
+	!defined(ARCH_NEEDS_READ_BARRIER_DEPENDS)
+
+#define dependent_ptr_mb(ptr, val) ({					\
+	long dependent_ptr_mb_val = (long)(val);			\
+	long dependent_ptr_mb_ptr = (long)(ptr) - dependent_ptr_mb_val;	\
+									\
+	BUILD_BUG_ON(sizeof(val) > sizeof(long));			\
+	OPTIMIZER_HIDE_VAR(dependent_ptr_mb_val);			\
+	(typeof(ptr))(dependent_ptr_mb_ptr + dependent_ptr_mb_val);	\
+})
+
+#else
+
+#define dependent_ptr_mb(ptr, val) ({ mb(); (ptr); })
+
+#endif
+
 #ifdef CONFIG_SMP
 
 #ifndef smp_mb
diff --git a/include/keys/trusted.h b/include/keys/trusted.h
index adbcb6817826..0071298b9b28 100644
--- a/include/keys/trusted.h
+++ b/include/keys/trusted.h
@@ -38,7 +38,7 @@ enum {
 
 int TSS_authhmac(unsigned char *digest, const unsigned char *key,
 			unsigned int keylen, unsigned char *h1,
-			unsigned char *h2, unsigned char h3, ...);
+			unsigned char *h2, unsigned int h3, ...);
 int TSS_checkhmac1(unsigned char *buffer,
 			  const uint32_t command,
 			  const unsigned char *ononce,
diff --git a/include/linux/atalk.h b/include/linux/atalk.h
index d5cfc0b15b76..f6034ba774be 100644
--- a/include/linux/atalk.h
+++ b/include/linux/atalk.h
@@ -108,7 +108,7 @@ static __inline__ struct elapaarp *aarp_hdr(struct sk_buff *skb)
 #define AARP_RESOLVE_TIME	(10 * HZ)
 
 extern struct datalink_proto *ddp_dl, *aarp_dl;
-extern void aarp_proto_init(void);
+extern int aarp_proto_init(void);
 
 /* Inter module exports */
 
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index a2132e09dc1c..f02367faa58d 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -193,7 +193,6 @@ enum bpf_arg_type {
 
 	ARG_PTR_TO_CTX,		/* pointer to context */
 	ARG_ANYTHING,		/* any (initialized) argument is ok */
-	ARG_PTR_TO_SOCKET,	/* pointer to bpf_sock */
 	ARG_PTR_TO_SPIN_LOCK,	/* pointer to bpf_spin_lock */
 	ARG_PTR_TO_SOCK_COMMON,	/* pointer to sock_common */
 };
diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
index 69f7a3449eda..7d8228d1c898 100644
--- a/include/linux/bpf_verifier.h
+++ b/include/linux/bpf_verifier.h
@@ -66,6 +66,46 @@ struct bpf_reg_state {
 	 * same reference to the socket, to determine proper reference freeing.
 	 */
 	u32 id;
+	/* PTR_TO_SOCKET and PTR_TO_TCP_SOCK could be a ptr returned
+	 * from a pointer-cast helper, bpf_sk_fullsock() and
+	 * bpf_tcp_sock().
+	 *
+	 * Consider the following where "sk" is a reference counted
+	 * pointer returned from "sk = bpf_sk_lookup_tcp();":
+	 *
+	 * 1: sk = bpf_sk_lookup_tcp();
+	 * 2: if (!sk) { return 0; }
+	 * 3: fullsock = bpf_sk_fullsock(sk);
+	 * 4: if (!fullsock) { bpf_sk_release(sk); return 0; }
+	 * 5: tp = bpf_tcp_sock(fullsock);
+	 * 6: if (!tp) { bpf_sk_release(sk); return 0; }
+	 * 7: bpf_sk_release(sk);
+	 * 8: snd_cwnd = tp->snd_cwnd;  // verifier will complain
+	 *
+	 * After bpf_sk_release(sk) at line 7, both "fullsock" ptr and
+	 * "tp" ptr should be invalidated also.  In order to do that,
+	 * the reg holding "fullsock" and "sk" need to remember
+	 * the original refcounted ptr id (i.e. sk_reg->id) in ref_obj_id
+	 * such that the verifier can reset all regs which have
+	 * ref_obj_id matching the sk_reg->id.
+	 *
+	 * sk_reg->ref_obj_id is set to sk_reg->id at line 1.
+	 * sk_reg->id will stay as NULL-marking purpose only.
+	 * After NULL-marking is done, sk_reg->id can be reset to 0.
+	 *
+	 * After "fullsock = bpf_sk_fullsock(sk);" at line 3,
+	 * fullsock_reg->ref_obj_id is set to sk_reg->ref_obj_id.
+	 *
+	 * After "tp = bpf_tcp_sock(fullsock);" at line 5,
+	 * tp_reg->ref_obj_id is set to fullsock_reg->ref_obj_id
+	 * which is the same as sk_reg->ref_obj_id.
+	 *
+	 * From the verifier perspective, if sk, fullsock and tp
+	 * are not NULL, they are the same ptr with different
+	 * reg->type.  In particular, bpf_sk_release(tp) is also
+	 * allowed and has the same effect as bpf_sk_release(sk).
+	 */
+	u32 ref_obj_id;
 	/* For scalar types (SCALAR_VALUE), this represents our knowledge of
 	 * the actual value.
 	 * For pointer types, this represents the variable part of the offset
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
index 1c70803e9f77..53669fdd5fad 100644
--- a/include/linux/cgroup-defs.h
+++ b/include/linux/cgroup-defs.h
@@ -83,6 +83,11 @@ enum {
 	 * Enable cpuset controller in v1 cgroup to use v2 behavior.
 	 */
 	CGRP_ROOT_CPUSET_V2_MODE = (1 << 4),
+
+	/*
+	 * Enable legacy local memory.events.
+	 */
+	CGRP_ROOT_MEMORY_LOCAL_EVENTS = (1 << 5),
 };
 
 /* cftype->flags */
diff --git a/include/linux/clk/at91_pmc.h b/include/linux/clk/at91_pmc.h
index 931ab05f771d..bd3a65c0bad3 100644
--- a/include/linux/clk/at91_pmc.h
+++ b/include/linux/clk/at91_pmc.h
@@ -159,6 +159,7 @@
 
 #define AT91_PMC_FSMR		0x70		/* Fast Startup Mode Register */
 #define AT91_PMC_FSTT(n)	BIT(n)
+#define AT91_PMC_RTTAL		BIT(16)
 #define AT91_PMC_RTCAL		BIT(17)		/* RTC Alarm Enable */
 #define AT91_PMC_USBAL		BIT(18)		/* USB Resume Enable */
 #define AT91_PMC_SDMMC_CD	BIT(19)		/* SDMMC Card Detect Enable */
diff --git a/include/linux/cmdline.h b/include/linux/cmdline.h
new file mode 100644
index 000000000000..126fa52f55d2
--- /dev/null
+++ b/include/linux/cmdline.h
@@ -0,0 +1,72 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_CMDLINE_H
+#define _LINUX_CMDLINE_H
+
+/*
+ *
+ * Copyright (C) 2015. Cisco Systems, Inc.
+ *
+ * Generic Append/Prepend cmdline support.
+ */
+
+#if defined(CONFIG_GENERIC_CMDLINE) && defined(CONFIG_CMDLINE_BOOL)
+
+#ifndef CONFIG_CMDLINE_OVERRIDE
+/*
+ * This function will append or prepend a builtin command line to the command
+ * line provided by the bootloader. Kconfig options can be used to alter
+ * the behavior of this builtin command line.
+ * @dest: The destination of the final appended/prepended string
+ * @src: The starting string or NULL if there isn't one.
+ * @tmp: temporary space used for prepending
+ * @length: the maximum length of the strings above.
+ */
+static inline void
+_cmdline_add_builtin(char *dest, char *src, char *tmp, unsigned long length)
+{
+	if (src != dest && src != NULL) {
+		strlcpy(dest, " ", length);
+		strlcat(dest, src, length);
+	}
+
+	strlcat(dest, " ", length);
+
+	if (sizeof(CONFIG_CMDLINE_APPEND) > 1)
+		strlcat(dest, CONFIG_CMDLINE_APPEND, length);
+
+	if (sizeof(CONFIG_CMDLINE_PREPEND) > 1) {
+		strlcpy(tmp, CONFIG_CMDLINE_PREPEND, length);
+		strlcat(tmp, " ", length);
+		strlcat(tmp, dest, length);
+		strlcpy(dest, tmp, length);
+	}
+}
+
+#define cmdline_add_builtin_section(dest, src, length, section) 	    \
+{									    \
+	if (sizeof(CONFIG_CMDLINE_PREPEND) > 1) {			    \
+		static char cmdline_tmp_space[length] section;	            \
+		_cmdline_add_builtin(dest, src, cmdline_tmp_space, length); \
+	} else {							    \
+		_cmdline_add_builtin(dest, src, NULL, length);		    \
+	}								    \
+}
+#else
+#define cmdline_add_builtin_section(dest, src, length, section) 	   \
+{									   \
+	strlcpy(dest, CONFIG_CMDLINE_PREPEND " " CONFIG_CMDLINE_APPEND,    \
+		length);						   \
+}
+#endif /* !CONFIG_CMDLINE_OVERRIDE */
+
+#else
+#define cmdline_add_builtin_section(dest, src, length, section) {          \
+	if (src != NULL)						   \
+		strlcpy(dest, src, length);				   \
+}
+#endif /* CONFIG_GENERIC_CMDLINE */
+
+#define cmdline_add_builtin(dest, src, length) \
+	cmdline_add_builtin_section(dest, src, length, __initdata)
+
+#endif /* _LINUX_CMDLINE_H */
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 445348facea9..87692fdae97a 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -161,9 +161,13 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
 #endif
 
 #ifndef OPTIMIZER_HIDE_VAR
+
 /* Make the optimizer believe the variable can be manipulated arbitrarily. */
 #define OPTIMIZER_HIDE_VAR(var)						\
-	__asm__ ("" : "=r" (var) : "0" (var))
+	__asm__ ("" : "=rm" (var) : "0" (var))
+
+#define COMPILER_HAS_OPTIMIZER_HIDE_VAR 1
+
 #endif
 
 /* Not-quite-unique ID. */
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h
index dd0a452373e7..c5e5bed82fbc 100644
--- a/include/linux/genalloc.h
+++ b/include/linux/genalloc.h
@@ -156,7 +156,7 @@ extern struct gen_pool *devm_gen_pool_create(struct device *dev,
 		int min_alloc_order, int nid, const char *name);
 extern struct gen_pool *gen_pool_get(struct device *dev, const char *name);
 
-bool addr_in_gen_pool(struct gen_pool *pool, unsigned long start,
+extern bool gen_pool_has_addr(struct gen_pool *pool, unsigned long start,
 			size_t size);
 
 #ifdef CONFIG_OF
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index fdab7de7490d..0af1a276aab5 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -589,8 +589,8 @@ static inline bool pm_suspended_storage(void)
 /* The below functions must be run on a range from a single zone. */
 extern int alloc_contig_range(unsigned long start, unsigned long end,
 			      unsigned migratetype, gfp_t gfp_mask);
-extern void free_contig_range(unsigned long pfn, unsigned nr_pages);
 #endif
+extern void free_contig_range(unsigned long pfn, unsigned int nr_pages);
 
 #ifdef CONFIG_CMA
 /* CMA stuff */
diff --git a/include/linux/hmm.h b/include/linux/hmm.h
index ad50b7b4f141..7aadf18b29cb 100644
--- a/include/linux/hmm.h
+++ b/include/linux/hmm.h
@@ -77,8 +77,34 @@
 #include <linux/migrate.h>
 #include <linux/memremap.h>
 #include <linux/completion.h>
+#include <linux/mmu_notifier.h>
 
-struct hmm;
+
+/*
+ * struct hmm - HMM per mm struct
+ *
+ * @mm: mm struct this HMM struct is bound to
+ * @lock: lock protecting ranges list
+ * @ranges: list of range being snapshotted
+ * @mirrors: list of mirrors for this mm
+ * @mmu_notifier: mmu notifier to track updates to CPU page table
+ * @mirrors_sem: read/write semaphore protecting the mirrors list
+ * @wq: wait queue for user waiting on a range invalidation
+ * @notifiers: count of active mmu notifiers
+ * @dead: is the mm dead ?
+ */
+struct hmm {
+	struct mm_struct	*mm;
+	struct kref		kref;
+	struct mutex		lock;
+	struct list_head	ranges;
+	struct list_head	mirrors;
+	struct mmu_notifier	mmu_notifier;
+	struct rw_semaphore	mirrors_sem;
+	wait_queue_head_t	wq;
+	long			notifiers;
+	bool			dead;
+};
 
 /*
  * hmm_pfn_flag_e - HMM flag enums
@@ -131,6 +157,7 @@ enum hmm_pfn_value_e {
 /*
  * struct hmm_range - track invalidation lock on virtual address range
  *
+ * @hmm: the core HMM structure this range is active against
  * @vma: the vm area struct for the range
  * @list: all range lock are on a list
  * @start: range virtual start address (inclusive)
@@ -138,10 +165,13 @@ enum hmm_pfn_value_e {
  * @pfns: array of pfns (big enough for the range)
  * @flags: pfn flags to match device driver page table
  * @values: pfn value for some special case (none, special, error, ...)
+ * @default_flags: default flags for the range (write, read, ...)
+ * @pfn_flags_mask: allows to mask pfn flags so that only default_flags matter
  * @pfn_shifts: pfn shift value (should be <= PAGE_SHIFT)
  * @valid: pfns array did not change since it has been fill by an HMM function
  */
 struct hmm_range {
+	struct hmm		*hmm;
 	struct vm_area_struct	*vma;
 	struct list_head	list;
 	unsigned long		start;
@@ -149,10 +179,65 @@ struct hmm_range {
 	uint64_t		*pfns;
 	const uint64_t		*flags;
 	const uint64_t		*values;
+	uint64_t		default_flags;
+	uint64_t		pfn_flags_mask;
+	uint8_t			page_shift;
 	uint8_t			pfn_shift;
 	bool			valid;
 };
 
+/*
+ * hmm_range_page_shift() - return the page shift for the range
+ * @range: range being queried
+ * Returns: page shift (page size = 1 << page shift) for the range
+ */
+static inline unsigned hmm_range_page_shift(const struct hmm_range *range)
+{
+	return range->page_shift;
+}
+
+/*
+ * hmm_range_page_size() - return the page size for the range
+ * @range: range being queried
+ * Returns: page size for the range in bytes
+ */
+static inline unsigned long hmm_range_page_size(const struct hmm_range *range)
+{
+	return 1UL << hmm_range_page_shift(range);
+}
+
+/*
+ * hmm_range_wait_until_valid() - wait for range to be valid
+ * @range: range affected by invalidation to wait on
+ * @timeout: time out for wait in ms (ie abort wait after that period of time)
+ * Returns: true if the range is valid, false otherwise.
+ */
+static inline bool hmm_range_wait_until_valid(struct hmm_range *range,
+					      unsigned long timeout)
+{
+	/* Check if mm is dead ? */
+	if (range->hmm == NULL || range->hmm->dead || range->hmm->mm == NULL) {
+		range->valid = false;
+		return false;
+	}
+	if (range->valid)
+		return true;
+	wait_event_timeout(range->hmm->wq, range->valid || range->hmm->dead,
+			   msecs_to_jiffies(timeout));
+	/* Return current valid status just in case we get lucky */
+	return range->valid;
+}
+
+/*
+ * hmm_range_valid() - test if a range is valid or not
+ * @range: range
+ * Returns: true if the range is valid, false otherwise.
+ */
+static inline bool hmm_range_valid(struct hmm_range *range)
+{
+	return range->valid;
+}
+
 /*
  * hmm_pfn_to_page() - return struct page pointed to by a valid HMM pfn
  * @range: range use to decode HMM pfn value
@@ -353,43 +438,194 @@ struct hmm_mirror {
 int hmm_mirror_register(struct hmm_mirror *mirror, struct mm_struct *mm);
 void hmm_mirror_unregister(struct hmm_mirror *mirror);
 
+/*
+ * hmm_mirror_mm_down_read() - lock the mmap_sem in read mode
+ * @mirror: the HMM mm mirror for which we want to lock the mmap_sem
+ * Returns: -EINVAL if the mm is dead, 0 otherwise (lock taken).
+ *
+ * The device driver context which holds reference to mirror and thus to core
+ * hmm struct might outlive the mm against which it was created. To avoid every
+ * driver to check for that case provide an helper that check if mm is still
+ * alive and take the mmap_sem in read mode if so. If the mm have been destroy
+ * (mmu_notifier release call back did happen) then we return -EINVAL so that
+ * calling code knows that it is trying to do something against a mm that is
+ * no longer valid.
+ */
+static inline int hmm_mirror_mm_down_read(struct hmm_mirror *mirror)
+{
+	struct mm_struct *mm;
+
+	/* Sanity check ... */
+	if (!mirror || !mirror->hmm)
+		return -EINVAL;
+	/*
+	 * Before trying to take the mmap_sem make sure the mm is still
+	 * alive as device driver context might outlive the mm lifetime.
+	 *
+	 * FIXME: should we also check for mm that outlive its owning
+	 * task ?
+	 */
+	mm = READ_ONCE(mirror->hmm->mm);
+	if (mirror->hmm->dead || !mm)
+		return -EINVAL;
+
+	down_read(&mm->mmap_sem);
+	return 0;
+}
 
 /*
- * To snapshot the CPU page table, call hmm_vma_get_pfns(), then take a device
- * driver lock that serializes device page table updates, then call
- * hmm_vma_range_done(), to check if the snapshot is still valid. The same
- * device driver page table update lock must also be used in the
- * hmm_mirror_ops.sync_cpu_device_pagetables() callback, so that CPU page
- * table invalidation serializes on it.
- *
- * YOU MUST CALL hmm_vma_range_done() ONCE AND ONLY ONCE EACH TIME YOU CALL
- * hmm_vma_get_pfns() WITHOUT ERROR !
- *
- * IF YOU DO NOT FOLLOW THE ABOVE RULE THE SNAPSHOT CONTENT MIGHT BE INVALID !
+ * hmm_mirror_mm_up_read() - unlock the mmap_sem from read mode
+ * @mirror: the HMM mm mirror for which we want to lock the mmap_sem
  */
-int hmm_vma_get_pfns(struct hmm_range *range);
-bool hmm_vma_range_done(struct hmm_range *range);
+static inline void hmm_mirror_mm_up_read(struct hmm_mirror *mirror)
+{
+	up_read(&mirror->hmm->mm->mmap_sem);
+}
 
 
 /*
- * Fault memory on behalf of device driver. Unlike handle_mm_fault(), this will
- * not migrate any device memory back to system memory. The HMM pfn array will
- * be updated with the fault result and current snapshot of the CPU page table
- * for the range.
+ * To snapshot the CPU page table you first have to call hmm_range_register()
+ * to register the range. If hmm_range_register() return an error then some-
+ * thing is horribly wrong and you should fail loudly. If it returned true then
+ * you can wait for the range to be stable with hmm_range_wait_until_valid()
+ * function, a range is valid when there are no concurrent changes to the CPU
+ * page table for the range.
+ *
+ * Once the range is valid you can call hmm_range_snapshot() if that returns
+ * without error then you can take your device page table lock (the same lock
+ * you use in the HMM mirror sync_cpu_device_pagetables() callback). After
+ * taking that lock you have to check the range validity, if it is still valid
+ * (ie hmm_range_valid() returns true) then you can program the device page
+ * table, otherwise you have to start again. Pseudo code:
+ *
+ *      mydevice_prefault(mydevice, mm, start, end)
+ *      {
+ *          struct hmm_range range;
+ *          ...
+ *
+ *          ret = hmm_range_register(&range, mm, start, end, page_shift);
+ *          if (ret)
+ *              return ret;
+ *
+ *          hmm_mirror_mm_down_read(mirror);
+ *      again:
+ *
+ *          if (!hmm_range_wait_until_valid(&range, TIMEOUT)) {
+ *              up_read(&mm->mmap_sem);
+ *              hmm_range_unregister(range);
+ *              // Handle time out, either sleep or retry or something else
+ *              ...
+ *              return -ESOMETHING; || goto again;
+ *          }
+ *
+ *          ret = hmm_range_snapshot(&range); or hmm_range_fault(&range);
+ *          if (ret == -EAGAIN) {
+ *              hmm_mirror_mm_down_read(mirror);
+ *              goto again;
+ *          } else if (ret == -EBUSY) {
+ *              goto again;
+ *          }
+ *
+ *          hmm_mirror_mm_up_read(mirror);
+ *          if (ret) {
+ *              hmm_range_unregister(range);
+ *              return ret;
+ *          }
+ *
+ *          // It might not have snap-shoted the whole range but only the first
+ *          // npages, the return values is the number of valid pages from the
+ *          // start of the range.
+ *          npages = ret;
  *
- * The mmap_sem must be taken in read mode before entering and it might be
- * dropped by the function if the block argument is false. In that case, the
- * function returns -EAGAIN.
+ *          ...
  *
- * Return value does not reflect if the fault was successful for every single
- * address or not. Therefore, the caller must to inspect the HMM pfn array to
- * determine fault status for each address.
+ *          mydevice_page_table_lock(mydevice);
+ *          if (!hmm_range_valid(range)) {
+ *              mydevice_page_table_unlock(mydevice);
+ *              goto again;
+ *          }
  *
- * Trying to fault inside an invalid vma will result in -EINVAL.
+ *          mydevice_populate_page_table(mydevice, range, npages);
+ *          ...
+ *          mydevice_take_page_table_unlock(mydevice);
+ *          hmm_range_unregister(range);
+ *
+ *          return 0;
+ *      }
  *
- * See the function description in mm/hmm.c for further documentation.
+ * The same scheme apply to hmm_range_fault() (ie replace hmm_range_snapshot()
+ * with hmm_range_fault() in above pseudo code).
+ *
+ * YOU MUST CALL hmm_range_unregister() ONCE AND ONLY ONCE EACH TIME YOU CALL
+ * hmm_range_register() AND hmm_range_register() RETURNED TRUE ! IF YOU DO NOT
+ * FOLLOW THIS RULE MEMORY CORRUPTION WILL ENSUE !
  */
-int hmm_vma_fault(struct hmm_range *range, bool block);
+int hmm_range_register(struct hmm_range *range,
+		       struct mm_struct *mm,
+		       unsigned long start,
+		       unsigned long end,
+		       unsigned page_shift);
+void hmm_range_unregister(struct hmm_range *range);
+long hmm_range_snapshot(struct hmm_range *range);
+long hmm_range_fault(struct hmm_range *range, bool block);
+long hmm_range_dma_map(struct hmm_range *range,
+		       struct device *device,
+		       dma_addr_t *daddrs,
+		       bool block);
+long hmm_range_dma_unmap(struct hmm_range *range,
+			 struct vm_area_struct *vma,
+			 struct device *device,
+			 dma_addr_t *daddrs,
+			 bool dirty);
+
+/*
+ * HMM_RANGE_DEFAULT_TIMEOUT - default timeout (ms) when waiting for a range
+ *
+ * When waiting for mmu notifiers we need some kind of time out otherwise we
+ * could potentialy wait for ever, 1000ms ie 1s sounds like a long time to
+ * wait already.
+ */
+#define HMM_RANGE_DEFAULT_TIMEOUT 1000
+
+/* This is a temporary helper to avoid merge conflict between trees. */
+static inline bool hmm_vma_range_done(struct hmm_range *range)
+{
+	bool ret = hmm_range_valid(range);
+
+	hmm_range_unregister(range);
+	return ret;
+}
+
+static inline int hmm_vma_fault(struct hmm_range *range, bool block)
+{
+	long ret;
+
+	range->default_flags = 0;
+	range->pfn_flags_mask = -1UL;
+
+	ret = hmm_range_register(range, range->vma->vm_mm,
+				 range->start, range->end,
+				 PAGE_SHIFT);
+	if (ret)
+		return (int)ret;
+
+	if (!hmm_range_wait_until_valid(range, HMM_RANGE_DEFAULT_TIMEOUT)) {
+		up_read(&range->vma->vm_mm->mmap_sem);
+		return -EAGAIN;
+	}
+
+	ret = hmm_range_fault(range, block);
+	if (ret <= 0) {
+		if (ret == -EBUSY || !ret) {
+			up_read(&range->vma->vm_mm->mmap_sem);
+			ret = -EBUSY;
+		} else if (ret == -EAGAIN)
+			ret = -EBUSY;
+		hmm_range_unregister(range);
+		return ret;
+	}
+	return 0;
+}
 
 /* Below are for HMM internal use only! Not to be used by device driver! */
 void hmm_mm_destroy(struct mm_struct *mm);
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h
index 6ab8c1bada3f..c309f43bde45 100644
--- a/include/linux/ipc_namespace.h
+++ b/include/linux/ipc_namespace.h
@@ -19,6 +19,7 @@ struct ipc_ids {
 	struct rw_semaphore rwsem;
 	struct idr ipcs_idr;
 	int max_idx;
+	int last_idx;	/* For wrap around detection */
 #ifdef CONFIG_CHECKPOINT_RESTORE
 	int next_id;
 #endif
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h
index 626179077bb0..0f049b384ccd 100644
--- a/include/linux/irqchip/arm-gic.h
+++ b/include/linux/irqchip/arm-gic.h
@@ -158,8 +158,7 @@ int gic_of_init_child(struct device *dev, struct gic_chip_data **gic, int irq);
  * Legacy platforms not converted to DT yet must use this to init
  * their GIC
  */
-void gic_init(unsigned int nr, int start,
-	      void __iomem *dist , void __iomem *cpu);
+void gic_init(void __iomem *dist , void __iomem *cpu);
 
 int gicv2m_init(struct fwnode_handle *parent_handle,
 		struct irq_domain *parent);
diff --git a/include/linux/list.h b/include/linux/list.h
index 79626b5ab36c..9a2b3913d99c 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -150,6 +150,23 @@ static inline void list_replace_init(struct list_head *old,
 	INIT_LIST_HEAD(old);
 }
 
+/**
+ * list_swap - replace entry1 with entry2 and re-add entry1 at entry2's position
+ * @entry1: the location to place entry2
+ * @entry2: the location to place entry1
+ */
+static inline void list_swap(struct list_head *entry1,
+			     struct list_head *entry2)
+{
+	struct list_head *pos = entry2->prev;
+
+	list_del(entry2);
+	list_replace(entry1, entry2);
+	if (pos == entry1)
+		pos = entry2;
+	list_add(entry1, pos);
+}
+
 /**
  * list_del_init - deletes entry from list and reinitialize it.
  * @entry: the element to delete from the list.
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 294d5d80e150..47e3c0612592 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -240,6 +240,47 @@ void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
 	     i >= 0; __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid))
 #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
 
+#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
+void __next_mem_pfn_range_in_zone(u64 *idx, struct zone *zone,
+				  unsigned long *out_spfn,
+				  unsigned long *out_epfn);
+/**
+ * for_each_free_mem_range_in_zone - iterate through zone specific free
+ * memblock areas
+ * @i: u64 used as loop variable
+ * @zone: zone in which all of the memory blocks reside
+ * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
+ * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
+ *
+ * Walks over free (memory && !reserved) areas of memblock in a specific
+ * zone. Available once memblock and an empty zone is initialized. The main
+ * assumption is that the zone start, end, and pgdat have been associated.
+ * This way we can use the zone to determine NUMA node, and if a given part
+ * of the memblock is valid for the zone.
+ */
+#define for_each_free_mem_pfn_range_in_zone(i, zone, p_start, p_end)	\
+	for (i = 0,							\
+	     __next_mem_pfn_range_in_zone(&i, zone, p_start, p_end);	\
+	     i != U64_MAX;					\
+	     __next_mem_pfn_range_in_zone(&i, zone, p_start, p_end))
+
+/**
+ * for_each_free_mem_range_in_zone_from - iterate through zone specific
+ * free memblock areas from a given point
+ * @i: u64 used as loop variable
+ * @zone: zone in which all of the memory blocks reside
+ * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
+ * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
+ *
+ * Walks over free (memory && !reserved) areas of memblock in a specific
+ * zone, continuing from current position. Available as soon as memblock is
+ * initialized.
+ */
+#define for_each_free_mem_pfn_range_in_zone_from(i, zone, p_start, p_end) \
+	for (; i != U64_MAX;					  \
+	     __next_mem_pfn_range_in_zone(&i, zone, p_start, p_end))
+#endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */
+
 /**
  * for_each_free_mem_range - iterate through free memblock areas
  * @i: u64 used as loop variable
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 1f3d880b7ca1..534267947664 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -94,8 +94,8 @@ enum mem_cgroup_events_target {
 	MEM_CGROUP_NTARGETS,
 };
 
-struct mem_cgroup_stat_cpu {
-	long count[MEMCG_NR_STAT];
+struct memcg_vmstats_percpu {
+	long stat[MEMCG_NR_STAT];
 	unsigned long events[NR_VM_EVENT_ITEMS];
 	unsigned long nr_page_events;
 	unsigned long targets[MEM_CGROUP_NTARGETS];
@@ -274,12 +274,12 @@ struct mem_cgroup {
 	struct task_struct	*move_lock_task;
 
 	/* memory.stat */
-	struct mem_cgroup_stat_cpu __percpu *stat_cpu;
+	struct memcg_vmstats_percpu __percpu *vmstats_percpu;
 
 	MEMCG_PADDING(_pad2_);
 
-	atomic_long_t		stat[MEMCG_NR_STAT];
-	atomic_long_t		events[NR_VM_EVENT_ITEMS];
+	atomic_long_t		vmstats[MEMCG_NR_STAT];
+	atomic_long_t		vmevents[NR_VM_EVENT_ITEMS];
 	atomic_long_t memory_events[MEMCG_NR_MEMORY_EVENTS];
 
 	unsigned long		socket_pressure;
@@ -333,6 +333,19 @@ static inline bool mem_cgroup_disabled(void)
 	return !cgroup_subsys_enabled(memory_cgrp_subsys);
 }
 
+static inline void mem_cgroup_protection(struct mem_cgroup *memcg,
+					 unsigned long *min, unsigned long *low)
+{
+	if (mem_cgroup_disabled()) {
+		*min = 0;
+		*low = 0;
+		return;
+	}
+
+	*min = READ_ONCE(memcg->memory.emin);
+	*low = READ_ONCE(memcg->memory.elow);
+}
+
 enum mem_cgroup_protection mem_cgroup_protected(struct mem_cgroup *root,
 						struct mem_cgroup *memcg);
 
@@ -531,6 +544,8 @@ void mem_cgroup_handle_over_high(void);
 
 unsigned long mem_cgroup_get_max(struct mem_cgroup *memcg);
 
+unsigned long mem_cgroup_size(struct mem_cgroup *memcg);
+
 void mem_cgroup_print_oom_context(struct mem_cgroup *memcg,
 				struct task_struct *p);
 
@@ -570,7 +585,7 @@ void unlock_page_memcg(struct page *page);
 static inline unsigned long memcg_page_state(struct mem_cgroup *memcg,
 					     int idx)
 {
-	long x = atomic_long_read(&memcg->stat[idx]);
+	long x = atomic_long_read(&memcg->vmstats[idx]);
 #ifdef CONFIG_SMP
 	if (x < 0)
 		x = 0;
@@ -587,12 +602,12 @@ static inline void __mod_memcg_state(struct mem_cgroup *memcg,
 	if (mem_cgroup_disabled())
 		return;
 
-	x = val + __this_cpu_read(memcg->stat_cpu->count[idx]);
+	x = val + __this_cpu_read(memcg->vmstats_percpu->stat[idx]);
 	if (unlikely(abs(x) > MEMCG_CHARGE_BATCH)) {
-		atomic_long_add(x, &memcg->stat[idx]);
+		atomic_long_add(x, &memcg->vmstats[idx]);
 		x = 0;
 	}
-	__this_cpu_write(memcg->stat_cpu->count[idx], x);
+	__this_cpu_write(memcg->vmstats_percpu->stat[idx], x);
 }
 
 /* idx can be of type enum memcg_stat_item or node_stat_item */
@@ -730,12 +745,12 @@ static inline void __count_memcg_events(struct mem_cgroup *memcg,
 	if (mem_cgroup_disabled())
 		return;
 
-	x = count + __this_cpu_read(memcg->stat_cpu->events[idx]);
+	x = count + __this_cpu_read(memcg->vmstats_percpu->events[idx]);
 	if (unlikely(x > MEMCG_CHARGE_BATCH)) {
-		atomic_long_add(x, &memcg->events[idx]);
+		atomic_long_add(x, &memcg->vmevents[idx]);
 		x = 0;
 	}
-	__this_cpu_write(memcg->stat_cpu->events[idx], x);
+	__this_cpu_write(memcg->vmstats_percpu->events[idx], x);
 }
 
 static inline void count_memcg_events(struct mem_cgroup *memcg,
@@ -774,8 +789,14 @@ static inline void count_memcg_event_mm(struct mm_struct *mm,
 static inline void memcg_memory_event(struct mem_cgroup *memcg,
 				      enum memcg_memory_event event)
 {
-	atomic_long_inc(&memcg->memory_events[event]);
-	cgroup_file_notify(&memcg->events_file);
+	do {
+		atomic_long_inc(&memcg->memory_events[event]);
+		cgroup_file_notify(&memcg->events_file);
+
+		if (cgrp_dfl_root.flags & CGRP_ROOT_MEMORY_LOCAL_EVENTS)
+			break;
+	} while ((memcg = parent_mem_cgroup(memcg)) &&
+		 !mem_cgroup_is_root(memcg));
 }
 
 static inline void memcg_memory_event_mm(struct mm_struct *mm,
@@ -824,6 +845,13 @@ static inline void memcg_memory_event_mm(struct mm_struct *mm,
 {
 }
 
+static inline void mem_cgroup_protection(struct mem_cgroup *memcg,
+					 unsigned long *min, unsigned long *low)
+{
+	*min = 0;
+	*low = 0;
+}
+
 static inline enum mem_cgroup_protection mem_cgroup_protected(
 	struct mem_cgroup *root, struct mem_cgroup *memcg)
 {
@@ -981,6 +1009,11 @@ static inline unsigned long mem_cgroup_get_max(struct mem_cgroup *memcg)
 	return 0;
 }
 
+static inline unsigned long mem_cgroup_size(struct mem_cgroup *memcg)
+{
+	return 0;
+}
+
 static inline void
 mem_cgroup_print_oom_context(struct mem_cgroup *memcg, struct task_struct *p)
 {
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 76769749b5a5..2d483dbdffc0 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -124,10 +124,45 @@ extern int mmap_rnd_compat_bits __read_mostly;
 
 /*
  * On some architectures it is expensive to call memset() for small sizes.
- * Those architectures should provide their own implementation of "struct page"
- * zeroing by defining this macro in <asm/pgtable.h>.
+ * If an architecture decides to implement their own version of
+ * mm_zero_struct_page they should wrap the defines below in a #ifndef and
+ * define their own version of this macro in <asm/pgtable.h>
  */
-#ifndef mm_zero_struct_page
+#if BITS_PER_LONG == 64
+/* This function must be updated when the size of struct page grows above 80
+ * or reduces below 56. The idea that compiler optimizes out switch()
+ * statement, and only leaves move/store instructions. Also the compiler can
+ * combine write statments if they are both assignments and can be reordered,
+ * this can result in several of the writes here being dropped.
+ */
+#define	mm_zero_struct_page(pp) __mm_zero_struct_page(pp)
+static inline void __mm_zero_struct_page(struct page *page)
+{
+	unsigned long *_pp = (void *)page;
+
+	 /* Check that struct page is either 56, 64, 72, or 80 bytes */
+	BUILD_BUG_ON(sizeof(struct page) & 7);
+	BUILD_BUG_ON(sizeof(struct page) < 56);
+	BUILD_BUG_ON(sizeof(struct page) > 80);
+
+	switch (sizeof(struct page)) {
+	case 80:
+		_pp[9] = 0;	/* fallthrough */
+	case 72:
+		_pp[8] = 0;	/* fallthrough */
+	case 64:
+		_pp[7] = 0;	/* fallthrough */
+	case 56:
+		_pp[6] = 0;
+		_pp[5] = 0;
+		_pp[4] = 0;
+		_pp[3] = 0;
+		_pp[2] = 0;
+		_pp[1] = 0;
+		_pp[0] = 0;
+	}
+}
+#else
 #define mm_zero_struct_page(pp)  ((void)memset((pp), 0, sizeof(struct page)))
 #endif
 
@@ -501,9 +536,6 @@ static inline void vma_set_anonymous(struct vm_area_struct *vma)
 struct mmu_gather;
 struct inode;
 
-#define page_private(page)		((page)->private)
-#define set_page_private(page, v)	((page)->private = (v))
-
 #if !defined(__HAVE_ARCH_PTE_DEVMAP) || !defined(CONFIG_TRANSPARENT_HUGEPAGE)
 static inline int pmd_devmap(pmd_t pmd)
 {
@@ -1193,11 +1225,18 @@ static inline void set_page_node(struct page *page, unsigned long node)
 	page->flags |= (node & NODES_MASK) << NODES_PGSHIFT;
 }
 
+static inline void set_page_reserved(struct page *page, bool reserved)
+{
+	page->flags &= ~(1ul << PG_reserved);
+	page->flags |= (unsigned long)(!!reserved) << PG_reserved;
+}
+
 static inline void set_page_links(struct page *page, enum zone_type zone,
-	unsigned long node, unsigned long pfn)
+	unsigned long node, unsigned long pfn, bool reserved)
 {
 	set_page_zone(page, zone);
 	set_page_node(page, node);
+	set_page_reserved(page, reserved);
 #ifdef SECTION_IN_PAGE_FLAGS
 	set_page_section(page, pfn_to_section_nr(pfn));
 #endif
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 7eade9132f02..9b9dd8350e26 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -220,6 +220,9 @@ struct page {
 #define PAGE_FRAG_CACHE_MAX_SIZE	__ALIGN_MASK(32768, ~PAGE_MASK)
 #define PAGE_FRAG_CACHE_MAX_ORDER	get_order(PAGE_FRAG_CACHE_MAX_SIZE)
 
+#define page_private(page)		((page)->private)
+#define set_page_private(page, v)	((page)->private = (v))
+
 struct page_frag_cache {
 	void * va;
 #if (PAGE_SIZE < PAGE_FRAG_CACHE_MAX_SIZE)
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index 4332199c71c2..d1a5d5df02f5 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -59,6 +59,8 @@
 #define SDIO_DEVICE_ID_MARVELL_8797_F0		0x9128
 #define SDIO_DEVICE_ID_MARVELL_8887WLAN	0x9134
 
+#define SDIO_VENDOR_ID_MEDIATEK			0x037a
+
 #define SDIO_VENDOR_ID_SIANO			0x039a
 #define SDIO_DEVICE_ID_SIANO_NOVA_B0		0x0201
 #define SDIO_DEVICE_ID_SIANO_NICE		0x0202
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index fba7741533be..22423763c0bd 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -18,6 +18,8 @@
 #include <linux/pageblock-flags.h>
 #include <linux/page-flags-layout.h>
 #include <linux/atomic.h>
+#include <linux/mm_types.h>
+#include <linux/page-flags.h>
 #include <asm/page.h>
 
 /* Free memory management - zoned buddy allocator.  */
@@ -98,6 +100,62 @@ struct free_area {
 	unsigned long		nr_free;
 };
 
+/* Used for pages not on another list */
+static inline void add_to_free_area(struct page *page, struct free_area *area,
+			     int migratetype)
+{
+	list_add(&page->lru, &area->free_list[migratetype]);
+	area->nr_free++;
+}
+
+/* Used for pages not on another list */
+static inline void add_to_free_area_tail(struct page *page, struct free_area *area,
+				  int migratetype)
+{
+	list_add_tail(&page->lru, &area->free_list[migratetype]);
+	area->nr_free++;
+}
+
+#ifdef CONFIG_SHUFFLE_PAGE_ALLOCATOR
+/* Used to preserve page allocation order entropy */
+void add_to_free_area_random(struct page *page, struct free_area *area,
+		int migratetype);
+#else
+static inline void add_to_free_area_random(struct page *page,
+		struct free_area *area, int migratetype)
+{
+	add_to_free_area(page, area, migratetype);
+}
+#endif
+
+/* Used for pages which are on another list */
+static inline void move_to_free_area(struct page *page, struct free_area *area,
+			     int migratetype)
+{
+	list_move(&page->lru, &area->free_list[migratetype]);
+}
+
+static inline struct page *get_page_from_free_area(struct free_area *area,
+					    int migratetype)
+{
+	return list_first_entry_or_null(&area->free_list[migratetype],
+					struct page, lru);
+}
+
+static inline void del_page_from_free_area(struct page *page,
+		struct free_area *area)
+{
+	list_del(&page->lru);
+	__ClearPageBuddy(page);
+	set_page_private(page, 0);
+	area->nr_free--;
+}
+
+static inline bool free_area_empty(struct free_area *area, int migratetype)
+{
+	return list_empty(&area->free_list[migratetype]);
+}
+
 struct pglist_data;
 
 /*
@@ -1276,6 +1334,7 @@ void sparse_init(void);
 #else
 #define sparse_init()	do {} while (0)
 #define sparse_index_init(_sec, _nid)  do {} while (0)
+#define pfn_present pfn_valid
 #endif /* CONFIG_SPARSEMEM */
 
 /*
diff --git a/include/linux/net.h b/include/linux/net.h
index 651fca72286c..c606c72311d0 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -83,6 +83,12 @@ enum sock_type {
 
 #endif /* ARCH_HAS_SOCKET_TYPES */
 
+/**
+ * enum sock_shutdown_cmd - Shutdown types
+ * @SHUT_RD: shutdown receptions
+ * @SHUT_WR: shutdown transmissions
+ * @SHUT_RDWR: shutdown receptions/transmissions
+ */
 enum sock_shutdown_cmd {
 	SHUT_RD,
 	SHUT_WR,
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 70b7123f38c7..9909dc0e273a 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -26,16 +26,10 @@
 #define PCPU_MIN_ALLOC_SHIFT		2
 #define PCPU_MIN_ALLOC_SIZE		(1 << PCPU_MIN_ALLOC_SHIFT)
 
-/* number of bits per page, used to trigger a scan if blocks are > PAGE_SIZE */
-#define PCPU_BITS_PER_PAGE		(PAGE_SIZE >> PCPU_MIN_ALLOC_SHIFT)
-
 /*
- * This determines the size of each metadata block.  There are several subtle
- * constraints around this constant.  The reserved region must be a multiple of
- * PCPU_BITMAP_BLOCK_SIZE.  Additionally, PCPU_BITMAP_BLOCK_SIZE must be a
- * multiple of PAGE_SIZE or PAGE_SIZE must be a multiple of
- * PCPU_BITMAP_BLOCK_SIZE to align with the populated page map. The unit_size
- * also has to be a multiple of PCPU_BITMAP_BLOCK_SIZE to ensure full blocks.
+ * The PCPU_BITMAP_BLOCK_SIZE must be the same size as PAGE_SIZE as the
+ * updating of hints is used to manage the nr_empty_pop_pages in both
+ * the chunk and globally.
  */
 #define PCPU_BITMAP_BLOCK_SIZE		PAGE_SIZE
 #define PCPU_BITMAP_BLOCK_BITS		(PCPU_BITMAP_BLOCK_SIZE >>	\
diff --git a/include/linux/psi.h b/include/linux/psi.h
index 7006008d5b72..e9029e19e60c 100644
--- a/include/linux/psi.h
+++ b/include/linux/psi.h
@@ -4,6 +4,7 @@
 #include <linux/jump_label.h>
 #include <linux/psi_types.h>
 #include <linux/sched.h>
+#include <linux/poll.h>
 
 struct seq_file;
 struct css_set;
@@ -26,6 +27,13 @@ int psi_show(struct seq_file *s, struct psi_group *group, enum psi_res res);
 int psi_cgroup_alloc(struct cgroup *cgrp);
 void psi_cgroup_free(struct cgroup *cgrp);
 void cgroup_move_task(struct task_struct *p, struct css_set *to);
+
+struct psi_trigger *psi_trigger_create(struct psi_group *group,
+			char *buf, size_t nbytes, enum psi_res res);
+void psi_trigger_destroy(struct psi_trigger *t);
+
+__poll_t psi_trigger_poll(struct psi_trigger *t, struct file *file,
+			poll_table *wait);
 #endif
 
 #else /* CONFIG_PSI */
diff --git a/include/linux/psi_types.h b/include/linux/psi_types.h
index 2cf422db5d18..92750524af27 100644
--- a/include/linux/psi_types.h
+++ b/include/linux/psi_types.h
@@ -3,6 +3,7 @@
 
 #include <linux/seqlock.h>
 #include <linux/types.h>
+#include <linux/wait.h>
 
 #ifdef CONFIG_PSI
 
@@ -11,7 +12,7 @@ enum psi_task_count {
 	NR_IOWAIT,
 	NR_MEMSTALL,
 	NR_RUNNING,
-	NR_PSI_TASK_COUNTS,
+	NR_PSI_TASK_COUNTS = 3,
 };
 
 /* Task state bitmasks */
@@ -24,7 +25,7 @@ enum psi_res {
 	PSI_IO,
 	PSI_MEM,
 	PSI_CPU,
-	NR_PSI_RESOURCES,
+	NR_PSI_RESOURCES = 3,
 };
 
 /*
@@ -41,7 +42,7 @@ enum psi_states {
 	PSI_CPU_SOME,
 	/* Only per-CPU, to weigh the CPU in the global average: */
 	PSI_NONIDLE,
-	NR_PSI_STATES,
+	NR_PSI_STATES = 6,
 };
 
 struct psi_group_cpu {
@@ -53,6 +54,9 @@ struct psi_group_cpu {
 	/* States of the tasks belonging to this group */
 	unsigned int tasks[NR_PSI_TASK_COUNTS];
 
+	/* Aggregate pressure state derived from the tasks */
+	u32 state_mask;
+
 	/* Period time sampling buckets for each state of interest (ns) */
 	u32 times[NR_PSI_STATES];
 
@@ -65,22 +69,81 @@ struct psi_group_cpu {
 	u32 times_prev[NR_PSI_STATES] ____cacheline_aligned_in_smp;
 };
 
+/* PSI growth tracking window */
+struct psi_window {
+	/* Window size in ns */
+	u64 size;
+
+	/* Start time of the current window in ns */
+	u64 start_time;
+
+	/* Value at the start of the window */
+	u64 start_value;
+
+	/* Value growth in the previous window */
+	u64 prev_growth;
+};
+
+struct psi_trigger {
+	/* PSI state being monitored by the trigger */
+	enum psi_states state;
+
+	/* User-spacified threshold in ns */
+	u64 threshold;
+
+	/* List node inside triggers list */
+	struct list_head node;
+
+	/* Backpointer needed during trigger destruction */
+	struct psi_group *group;
+
+	/* Wait queue for polling */
+	wait_queue_head_t event_wait;
+
+	/* Pending event flag */
+	int event;
+
+	/* Tracking window */
+	struct psi_window win;
+
+	/*
+	 * Time last event was generated. Used for rate-limiting
+	 * events to one per window
+	 */
+	u64 last_event_time;
+};
+
 struct psi_group {
-	/* Protects data updated during an aggregation */
-	struct mutex stat_lock;
+	/* Protects data used by the aggregator */
+	struct mutex update_lock;
 
 	/* Per-cpu task state & time tracking */
 	struct psi_group_cpu __percpu *pcpu;
 
-	/* Periodic aggregation state */
-	u64 total_prev[NR_PSI_STATES - 1];
-	u64 last_update;
-	u64 next_update;
+	/* Periodic work control */
+	atomic_t polling;
 	struct delayed_work clock_work;
 
-	/* Total stall times and sampled pressure averages */
+	/* Total stall times observed */
 	u64 total[NR_PSI_STATES - 1];
+
+	/* Running pressure averages */
+	u64 avg_total[NR_PSI_STATES - 1];
+	u64 avg_last_update;
+	u64 avg_next_update;
 	unsigned long avg[NR_PSI_STATES - 1][3];
+
+	/* Configured polling triggers */
+	struct list_head triggers;
+	u32 nr_triggers[NR_PSI_STATES - 1];
+	u32 trigger_states;
+	u64 trigger_min_period;
+
+	/* Polling state */
+	/* Total stall times at the start of monitor activation */
+	u64 polling_total[NR_PSI_STATES - 1];
+	u64 polling_next_update;
+	u64 polling_until;
 };
 
 #else /* CONFIG_PSI */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 1549584a1538..1a3c28d997d4 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1160,6 +1160,9 @@ struct task_struct {
 
 	/* Used by memcontrol for targeted memcg charge: */
 	struct mem_cgroup		*active_memcg;
+
+	/* Used by memcontrol for high relcaim: */
+	struct mem_cgroup		*memcg_high_reclaim;
 #endif
 
 #ifdef CONFIG_BLK_CGROUP
@@ -1200,6 +1203,13 @@ struct task_struct {
 	unsigned long			prev_lowest_stack;
 #endif
 
+#ifdef CONFIG_DEBUG_AID_FOR_SYZBOT
+	unsigned long			getblk_stamp;
+	unsigned int			getblk_executed;
+	unsigned int			getblk_bh_count;
+	unsigned long			getblk_bh_state;
+#endif
+
 	/*
 	 * New fields for task_struct should be added above here, so that
 	 * they are included in the randomized portion of task_struct.
diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h
index ae5655197698..38a0f0785323 100644
--- a/include/linux/sched/signal.h
+++ b/include/linux/sched/signal.h
@@ -271,17 +271,18 @@ static inline int signal_group_exit(const struct signal_struct *sig)
 extern void flush_signals(struct task_struct *);
 extern void ignore_signals(struct task_struct *);
 extern void flush_signal_handlers(struct task_struct *, int force_default);
-extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, kernel_siginfo_t *info);
+extern int dequeue_signal(struct task_struct *task,
+			  sigset_t *mask, kernel_siginfo_t *info);
 
 static inline int kernel_dequeue_signal(void)
 {
-	struct task_struct *tsk = current;
+	struct task_struct *task = current;
 	kernel_siginfo_t __info;
 	int ret;
 
-	spin_lock_irq(&tsk->sighand->siglock);
-	ret = dequeue_signal(tsk, &tsk->blocked, &__info);
-	spin_unlock_irq(&tsk->sighand->siglock);
+	spin_lock_irq(&task->sighand->siglock);
+	ret = dequeue_signal(task, &task->blocked, &__info);
+	spin_unlock_irq(&task->sighand->siglock);
 
 	return ret;
 }
@@ -418,10 +419,20 @@ static inline void set_restore_sigmask(void)
 	set_thread_flag(TIF_RESTORE_SIGMASK);
 	WARN_ON(!test_thread_flag(TIF_SIGPENDING));
 }
+
+static inline void clear_tsk_restore_sigmask(struct task_struct *task)
+{
+	clear_tsk_thread_flag(task, TIF_RESTORE_SIGMASK);
+}
+
 static inline void clear_restore_sigmask(void)
 {
 	clear_thread_flag(TIF_RESTORE_SIGMASK);
 }
+static inline bool test_tsk_restore_sigmask(struct task_struct *task)
+{
+	return test_tsk_thread_flag(task, TIF_RESTORE_SIGMASK);
+}
 static inline bool test_restore_sigmask(void)
 {
 	return test_thread_flag(TIF_RESTORE_SIGMASK);
@@ -439,6 +450,10 @@ static inline void set_restore_sigmask(void)
 	current->restore_sigmask = true;
 	WARN_ON(!test_thread_flag(TIF_SIGPENDING));
 }
+static inline void clear_tsk_restore_sigmask(struct task_struct *task)
+{
+	task->restore_sigmask = false;
+}
 static inline void clear_restore_sigmask(void)
 {
 	current->restore_sigmask = false;
@@ -447,6 +462,10 @@ static inline bool test_restore_sigmask(void)
 {
 	return current->restore_sigmask;
 }
+static inline bool test_tsk_restore_sigmask(struct task_struct *task)
+{
+	return task->restore_sigmask;
+}
 static inline bool test_and_clear_restore_sigmask(void)
 {
 	if (!current->restore_sigmask)
@@ -599,9 +618,9 @@ static inline struct pid *task_session(struct task_struct *task)
 	return task->signal->pids[PIDTYPE_SID];
 }
 
-static inline int get_nr_threads(struct task_struct *tsk)
+static inline int get_nr_threads(struct task_struct *task)
 {
-	return tsk->signal->nr_threads;
+	return task->signal->nr_threads;
 }
 
 static inline bool thread_group_leader(struct task_struct *p)
@@ -640,35 +659,35 @@ static inline int thread_group_empty(struct task_struct *p)
 #define delay_group_leader(p) \
 		(thread_group_leader(p) && !thread_group_empty(p))
 
-extern struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
+extern struct sighand_struct *__lock_task_sighand(struct task_struct *task,
 							unsigned long *flags);
 
-static inline struct sighand_struct *lock_task_sighand(struct task_struct *tsk,
+static inline struct sighand_struct *lock_task_sighand(struct task_struct *task,
 						       unsigned long *flags)
 {
 	struct sighand_struct *ret;
 
-	ret = __lock_task_sighand(tsk, flags);
-	(void)__cond_lock(&tsk->sighand->siglock, ret);
+	ret = __lock_task_sighand(task, flags);
+	(void)__cond_lock(&task->sighand->siglock, ret);
 	return ret;
 }
 
-static inline void unlock_task_sighand(struct task_struct *tsk,
+static inline void unlock_task_sighand(struct task_struct *task,
 						unsigned long *flags)
 {
-	spin_unlock_irqrestore(&tsk->sighand->siglock, *flags);
+	spin_unlock_irqrestore(&task->sighand->siglock, *flags);
 }
 
-static inline unsigned long task_rlimit(const struct task_struct *tsk,
+static inline unsigned long task_rlimit(const struct task_struct *task,
 		unsigned int limit)
 {
-	return READ_ONCE(tsk->signal->rlim[limit].rlim_cur);
+	return READ_ONCE(task->signal->rlim[limit].rlim_cur);
 }
 
-static inline unsigned long task_rlimit_max(const struct task_struct *tsk,
+static inline unsigned long task_rlimit_max(const struct task_struct *task,
 		unsigned int limit)
 {
-	return READ_ONCE(tsk->signal->rlim[limit].rlim_max);
+	return READ_ONCE(task->signal->rlim[limit].rlim_max);
 }
 
 static inline unsigned long rlimit(unsigned int limit)
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 6016daeecee4..b57cd8bf96e2 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -26,7 +26,7 @@ typedef __kernel_sa_family_t	sa_family_t;
 /*
  *	1003.1g requires sa_family_t and that sa_data is char.
  */
- 
+
 struct sockaddr {
 	sa_family_t	sa_family;	/* address family, AF_xxx	*/
 	char		sa_data[14];	/* 14 bytes of protocol address	*/
@@ -44,7 +44,7 @@ struct linger {
  *	system, not 4.3. Thus msg_accrights(len) are now missing. They
  *	belong in an obscure libc emulation or the bin.
  */
- 
+
 struct msghdr {
 	void		*msg_name;	/* ptr to socket address structure */
 	int		msg_namelen;	/* size of socket address structure */
@@ -54,7 +54,7 @@ struct msghdr {
 	unsigned int	msg_flags;	/* flags on received message */
 	struct kiocb	*msg_iocb;	/* ptr to iocb for async requests */
 };
- 
+
 struct user_msghdr {
 	void		__user *msg_name;	/* ptr to socket address structure */
 	int		msg_namelen;		/* size of socket address structure */
@@ -122,7 +122,7 @@ struct cmsghdr {
  *	inside range, given by msg->msg_controllen before using
  *	ancillary object DATA.				--ANK (980731)
  */
- 
+
 static inline struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
 					       struct cmsghdr *__cmsg)
 {
@@ -264,10 +264,10 @@ struct ucred {
 /* Maximum queue length specifiable by listen.  */
 #define SOMAXCONN	128
 
-/* Flags we can use with send/ and recv. 
+/* Flags we can use with send/ and recv.
    Added those for 1003.1g not all are supported yet
  */
- 
+
 #define MSG_OOB		1
 #define MSG_PEEK	2
 #define MSG_DONTROUTE	4
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
index 37b226e8df13..4c8b02f4edeb 100644
--- a/include/linux/uaccess.h
+++ b/include/linux/uaccess.h
@@ -263,6 +263,40 @@ extern long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
 #define probe_kernel_address(addr, retval)		\
 	probe_kernel_read(&retval, addr, sizeof(retval))
 
+/**
+ * probe_user_read(): safely attempt to read from a user location
+ * @dst: pointer to the buffer that shall take the data
+ * @src: address to read from
+ * @size: size of the data chunk
+ *
+ * Safely read from address @src to the buffer at @dst.  If a kernel fault
+ * happens, handle that and return -EFAULT.
+ *
+ * We ensure that the copy_from_user is executed in atomic context so that
+ * do_page_fault() doesn't attempt to take mmap_sem.  This makes
+ * probe_user_read() suitable for use within regions where the caller
+ * already holds mmap_sem, or other locks which nest inside mmap_sem.
+ *
+ * Returns 0 on success, -EFAULT on error.
+ */
+
+#ifndef probe_user_read
+static __always_inline long probe_user_read(void *dst, const void __user *src,
+					    size_t size)
+{
+	long ret;
+
+	if (!access_ok(src, size))
+		return -EFAULT;
+
+	pagefault_disable();
+	ret = __copy_from_user_inatomic(dst, src, size);
+	pagefault_enable();
+
+	return ret ? -EFAULT : 0;
+}
+#endif
+
 #ifndef user_access_begin
 #define user_access_begin(ptr,len) access_ok(ptr, len)
 #define user_access_end() do { } while (0)
diff --git a/include/misc/charlcd.h b/include/misc/charlcd.h
index 23f61850f363..1832402324ce 100644
--- a/include/misc/charlcd.h
+++ b/include/misc/charlcd.h
@@ -35,6 +35,7 @@ struct charlcd_ops {
 };
 
 struct charlcd *charlcd_alloc(unsigned int drvdata_size);
+void charlcd_free(struct charlcd *lcd);
 
 int charlcd_register(struct charlcd *lcd);
 int charlcd_unregister(struct charlcd *lcd);
diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h
index 59f45b1e9dac..d2a36fb9f92a 100644
--- a/include/net/netns/xfrm.h
+++ b/include/net/netns/xfrm.h
@@ -57,7 +57,7 @@ struct netns_xfrm {
 	struct list_head	inexact_bins;
 
 
-	struct sock		*nlsk;
+	struct sock		__rcu *nlsk;
 	struct sock		*nlsk_stash;
 
 	u32			sysctl_aevent_etime;
diff --git a/include/net/xdp_sock.h b/include/net/xdp_sock.h
index 61cf7dbb6782..d074b6d60f8a 100644
--- a/include/net/xdp_sock.h
+++ b/include/net/xdp_sock.h
@@ -36,7 +36,6 @@ struct xdp_umem {
 	u32 headroom;
 	u32 chunk_size_nohr;
 	struct user_struct *user;
-	struct pid *pid;
 	unsigned long address;
 	refcount_t users;
 	struct work_struct work;
diff --git a/include/sound/soc.h b/include/sound/soc.h
index eb7db605955b..1e2be35ed36f 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1083,6 +1083,8 @@ struct snd_soc_card {
 	struct mutex mutex;
 	struct mutex dapm_mutex;
 
+	spinlock_t dpcm_lock;
+
 	bool instantiated;
 	bool topology_shortname_created;
 
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 3c38ac9a92a7..929c8e537a14 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -502,16 +502,6 @@ union bpf_attr {
  * 	Return
  * 		0 on success, or a negative error in case of failure.
  *
- * int bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags)
- * 	Description
- * 		Push an element *value* in *map*. *flags* is one of:
- *
- * 		**BPF_EXIST**
- * 		If the queue/stack is full, the oldest element is removed to
- * 		make room for this.
- * 	Return
- * 		0 on success, or a negative error in case of failure.
- *
  * int bpf_probe_read(void *dst, u32 size, const void *src)
  * 	Description
  * 		For tracing programs, safely attempt to read *size* bytes from
@@ -1435,14 +1425,14 @@ union bpf_attr {
  * u64 bpf_get_socket_cookie(struct bpf_sock_addr *ctx)
  * 	Description
  * 		Equivalent to bpf_get_socket_cookie() helper that accepts
- * 		*skb*, but gets socket from **struct bpf_sock_addr** contex.
+ * 		*skb*, but gets socket from **struct bpf_sock_addr** context.
  * 	Return
  * 		A 8-byte long non-decreasing number.
  *
  * u64 bpf_get_socket_cookie(struct bpf_sock_ops *ctx)
  * 	Description
  * 		Equivalent to bpf_get_socket_cookie() helper that accepts
- * 		*skb*, but gets socket from **struct bpf_sock_ops** contex.
+ * 		*skb*, but gets socket from **struct bpf_sock_ops** context.
  * 	Return
  * 		A 8-byte long non-decreasing number.
  *
@@ -2098,52 +2088,52 @@ union bpf_attr {
  *	Return
  * 		0 on success, or a negative error in case of failure.
  *
- * int bpf_rc_keydown(void *ctx, u32 protocol, u64 scancode, u32 toggle)
+ * int bpf_rc_repeat(void *ctx)
  *	Description
  *		This helper is used in programs implementing IR decoding, to
- *		report a successfully decoded key press with *scancode*,
- *		*toggle* value in the given *protocol*. The scancode will be
- *		translated to a keycode using the rc keymap, and reported as
- *		an input key down event. After a period a key up event is
- *		generated. This period can be extended by calling either
- *		**bpf_rc_keydown**\ () again with the same values, or calling
- *		**bpf_rc_repeat**\ ().
+ *		report a successfully decoded repeat key message. This delays
+ *		the generation of a key up event for previously generated
+ *		key down event.
  *
- *		Some protocols include a toggle bit, in case the button	was
- *		released and pressed again between consecutive scancodes.
+ *		Some IR protocols like NEC have a special IR message for
+ *		repeating last button, for when a button is held down.
  *
  *		The *ctx* should point to the lirc sample as passed into
  *		the program.
  *
- *		The *protocol* is the decoded protocol number (see
- *		**enum rc_proto** for some predefined values).
- *
  *		This helper is only available is the kernel was compiled with
  *		the **CONFIG_BPF_LIRC_MODE2** configuration option set to
  *		"**y**".
  *	Return
  *		0
  *
- * int bpf_rc_repeat(void *ctx)
+ * int bpf_rc_keydown(void *ctx, u32 protocol, u64 scancode, u32 toggle)
  *	Description
  *		This helper is used in programs implementing IR decoding, to
- *		report a successfully decoded repeat key message. This delays
- *		the generation of a key up event for previously generated
- *		key down event.
+ *		report a successfully decoded key press with *scancode*,
+ *		*toggle* value in the given *protocol*. The scancode will be
+ *		translated to a keycode using the rc keymap, and reported as
+ *		an input key down event. After a period a key up event is
+ *		generated. This period can be extended by calling either
+ *		**bpf_rc_keydown**\ () again with the same values, or calling
+ *		**bpf_rc_repeat**\ ().
  *
- *		Some IR protocols like NEC have a special IR message for
- *		repeating last button, for when a button is held down.
+ *		Some protocols include a toggle bit, in case the button	was
+ *		released and pressed again between consecutive scancodes.
  *
  *		The *ctx* should point to the lirc sample as passed into
  *		the program.
  *
+ *		The *protocol* is the decoded protocol number (see
+ *		**enum rc_proto** for some predefined values).
+ *
  *		This helper is only available is the kernel was compiled with
  *		the **CONFIG_BPF_LIRC_MODE2** configuration option set to
  *		"**y**".
  *	Return
  *		0
  *
- * uint64_t bpf_skb_cgroup_id(struct sk_buff *skb)
+ * u64 bpf_skb_cgroup_id(struct sk_buff *skb)
  * 	Description
  * 		Return the cgroup v2 id of the socket associated with the *skb*.
  * 		This is roughly similar to the **bpf_get_cgroup_classid**\ ()
@@ -2159,30 +2149,12 @@ union bpf_attr {
  * 	Return
  * 		The id is returned or 0 in case the id could not be retrieved.
  *
- * u64 bpf_skb_ancestor_cgroup_id(struct sk_buff *skb, int ancestor_level)
- *	Description
- *		Return id of cgroup v2 that is ancestor of cgroup associated
- *		with the *skb* at the *ancestor_level*.  The root cgroup is at
- *		*ancestor_level* zero and each step down the hierarchy
- *		increments the level. If *ancestor_level* == level of cgroup
- *		associated with *skb*, then return value will be same as that
- *		of **bpf_skb_cgroup_id**\ ().
- *
- *		The helper is useful to implement policies based on cgroups
- *		that are upper in hierarchy than immediate cgroup associated
- *		with *skb*.
- *
- *		The format of returned id and helper limitations are same as in
- *		**bpf_skb_cgroup_id**\ ().
- *	Return
- *		The id is returned or 0 in case the id could not be retrieved.
- *
  * u64 bpf_get_current_cgroup_id(void)
  * 	Return
  * 		A 64-bit integer containing the current cgroup id based
  * 		on the cgroup within which the current task is running.
  *
- * void* get_local_storage(void *map, u64 flags)
+ * void *bpf_get_local_storage(void *map, u64 flags)
  *	Description
  *		Get the pointer to the local storage area.
  *		The type and the size of the local storage is defined
@@ -2209,6 +2181,24 @@ union bpf_attr {
  *	Return
  *		0 on success, or a negative error in case of failure.
  *
+ * u64 bpf_skb_ancestor_cgroup_id(struct sk_buff *skb, int ancestor_level)
+ *	Description
+ *		Return id of cgroup v2 that is ancestor of cgroup associated
+ *		with the *skb* at the *ancestor_level*.  The root cgroup is at
+ *		*ancestor_level* zero and each step down the hierarchy
+ *		increments the level. If *ancestor_level* == level of cgroup
+ *		associated with *skb*, then return value will be same as that
+ *		of **bpf_skb_cgroup_id**\ ().
+ *
+ *		The helper is useful to implement policies based on cgroups
+ *		that are upper in hierarchy than immediate cgroup associated
+ *		with *skb*.
+ *
+ *		The format of returned id and helper limitations are same as in
+ *		**bpf_skb_cgroup_id**\ ().
+ *	Return
+ *		The id is returned or 0 in case the id could not be retrieved.
+ *
  * struct bpf_sock *bpf_sk_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags)
  *	Description
  *		Look for TCP socket matching *tuple*, optionally in a child
@@ -2289,6 +2279,16 @@ union bpf_attr {
  *	Return
  *		0 on success, or a negative error in case of failure.
  *
+ * int bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags)
+ * 	Description
+ * 		Push an element *value* in *map*. *flags* is one of:
+ *
+ * 		**BPF_EXIST**
+ * 			If the queue/stack is full, the oldest element is
+ * 			removed to make room for this.
+ * 	Return
+ * 		0 on success, or a negative error in case of failure.
+ *
  * int bpf_map_pop_elem(struct bpf_map *map, void *value)
  * 	Description
  * 		Pop an element from *map*.
@@ -2343,29 +2343,94 @@ union bpf_attr {
  *	Return
  *		0
  *
+ * int bpf_spin_lock(struct bpf_spin_lock *lock)
+ *	Description
+ *		Acquire a spinlock represented by the pointer *lock*, which is
+ *		stored as part of a value of a map. Taking the lock allows to
+ *		safely update the rest of the fields in that value. The
+ *		spinlock can (and must) later be released with a call to
+ *		**bpf_spin_unlock**\ (\ *lock*\ ).
+ *
+ *		Spinlocks in BPF programs come with a number of restrictions
+ *		and constraints:
+ *
+ *		* **bpf_spin_lock** objects are only allowed inside maps of
+ *		  types **BPF_MAP_TYPE_HASH** and **BPF_MAP_TYPE_ARRAY** (this
+ *		  list could be extended in the future).
+ *		* BTF description of the map is mandatory.
+ *		* The BPF program can take ONE lock at a time, since taking two
+ *		  or more could cause dead locks.
+ *		* Only one **struct bpf_spin_lock** is allowed per map element.
+ *		* When the lock is taken, calls (either BPF to BPF or helpers)
+ *		  are not allowed.
+ *		* The **BPF_LD_ABS** and **BPF_LD_IND** instructions are not
+ *		  allowed inside a spinlock-ed region.
+ *		* The BPF program MUST call **bpf_spin_unlock**\ () to release
+ *		  the lock, on all execution paths, before it returns.
+ *		* The BPF program can access **struct bpf_spin_lock** only via
+ *		  the **bpf_spin_lock**\ () and **bpf_spin_unlock**\ ()
+ *		  helpers. Loading or storing data into the **struct
+ *		  bpf_spin_lock** *lock*\ **;** field of a map is not allowed.
+ *		* To use the **bpf_spin_lock**\ () helper, the BTF description
+ *		  of the map value must be a struct and have **struct
+ *		  bpf_spin_lock** *anyname*\ **;** field at the top level.
+ *		  Nested lock inside another struct is not allowed.
+ *		* The **struct bpf_spin_lock** *lock* field in a map value must
+ *		  be aligned on a multiple of 4 bytes in that value.
+ *		* Syscall with command **BPF_MAP_LOOKUP_ELEM** does not copy
+ *		  the **bpf_spin_lock** field to user space.
+ *		* Syscall with command **BPF_MAP_UPDATE_ELEM**, or update from
+ *		  a BPF program, do not update the **bpf_spin_lock** field.
+ *		* **bpf_spin_lock** cannot be on the stack or inside a
+ *		  networking packet (it can only be inside of a map values).
+ *		* **bpf_spin_lock** is available to root only.
+ *		* Tracing programs and socket filter programs cannot use
+ *		  **bpf_spin_lock**\ () due to insufficient preemption checks
+ *		  (but this may change in the future).
+ *		* **bpf_spin_lock** is not allowed in inner maps of map-in-map.
+ *	Return
+ *		0
+ *
+ * int bpf_spin_unlock(struct bpf_spin_lock *lock)
+ *	Description
+ *		Release the *lock* previously locked by a call to
+ *		**bpf_spin_lock**\ (\ *lock*\ ).
+ *	Return
+ *		0
+ *
  * struct bpf_sock *bpf_sk_fullsock(struct bpf_sock *sk)
  *	Description
  *		This helper gets a **struct bpf_sock** pointer such
- *		that all the fields in bpf_sock can be accessed.
+ *		that all the fields in this **bpf_sock** can be accessed.
  *	Return
- *		A **struct bpf_sock** pointer on success, or NULL in
+ *		A **struct bpf_sock** pointer on success, or **NULL** in
  *		case of failure.
  *
  * struct bpf_tcp_sock *bpf_tcp_sock(struct bpf_sock *sk)
  *	Description
  *		This helper gets a **struct bpf_tcp_sock** pointer from a
  *		**struct bpf_sock** pointer.
- *
  *	Return
- *		A **struct bpf_tcp_sock** pointer on success, or NULL in
+ *		A **struct bpf_tcp_sock** pointer on success, or **NULL** in
  *		case of failure.
  *
  * int bpf_skb_ecn_set_ce(struct sk_buf *skb)
- *     Description
- *             Sets ECN of IP header to ce (congestion encountered) if
- *             current value is ect (ECN capable). Works with IPv6 and IPv4.
- *     Return
- *             1 if set, 0 if not set.
+ *	Description
+ *		Set ECN (Explicit Congestion Notification) field of IP header
+ *		to **CE** (Congestion Encountered) if current value is **ECT**
+ *		(ECN Capable Transport). Otherwise, do nothing. Works with IPv6
+ *		and IPv4.
+ *	Return
+ *		1 if the **CE** flag is set (either by the current helper call
+ *		or because it was already present), 0 if it is not set.
+ *
+ * struct bpf_sock *bpf_get_listener_sock(struct bpf_sock *sk)
+ *	Description
+ *		Return a **struct bpf_sock** pointer in **TCP_LISTEN** state.
+ *		**bpf_sk_release**\ () is unnecessary and not allowed.
+ *	Return
+ *		A **struct bpf_sock** pointer on success, or **NULL** in
+ *		case of failure.
  */
 #define __BPF_FUNC_MAPPER(FN)		\
 	FN(unspec),			\
@@ -2465,7 +2530,8 @@ union bpf_attr {
 	FN(spin_unlock),		\
 	FN(sk_fullsock),		\
 	FN(tcp_sock),			\
-	FN(skb_ecn_set_ce),
+	FN(skb_ecn_set_ce),		\
+	FN(get_listener_sock),
 
 /* integer value in 'imm' field of BPF_CALL instruction selects which helper
  * function eBPF program intends to call
diff --git a/include/uapi/linux/virtio_ids.h b/include/uapi/linux/virtio_ids.h
index 6d5c3b2d4f4d..cfe47c5d9a56 100644
--- a/include/uapi/linux/virtio_ids.h
+++ b/include/uapi/linux/virtio_ids.h
@@ -43,5 +43,6 @@
 #define VIRTIO_ID_INPUT        18 /* virtio input */
 #define VIRTIO_ID_VSOCK        19 /* virtio vsock transport */
 #define VIRTIO_ID_CRYPTO       20 /* virtio crypto */
+#define VIRTIO_ID_IOMMU        23 /* virtio IOMMU */
 
 #endif /* _LINUX_VIRTIO_IDS_H */
diff --git a/include/uapi/linux/virtio_iommu.h b/include/uapi/linux/virtio_iommu.h
new file mode 100644
index 000000000000..ba1b460c9944
--- /dev/null
+++ b/include/uapi/linux/virtio_iommu.h
@@ -0,0 +1,161 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Virtio-iommu definition v0.9
+ *
+ * Copyright (C) 2018 Arm Ltd.
+ */
+#ifndef _UAPI_LINUX_VIRTIO_IOMMU_H
+#define _UAPI_LINUX_VIRTIO_IOMMU_H
+
+#include <linux/types.h>
+
+/* Feature bits */
+#define VIRTIO_IOMMU_F_INPUT_RANGE		0
+#define VIRTIO_IOMMU_F_DOMAIN_BITS		1
+#define VIRTIO_IOMMU_F_MAP_UNMAP		2
+#define VIRTIO_IOMMU_F_BYPASS			3
+#define VIRTIO_IOMMU_F_PROBE			4
+
+struct virtio_iommu_range {
+	__u64					start;
+	__u64					end;
+};
+
+struct virtio_iommu_config {
+	/* Supported page sizes */
+	__u64					page_size_mask;
+	/* Supported IOVA range */
+	struct virtio_iommu_range		input_range;
+	/* Max domain ID size */
+	__u8					domain_bits;
+	__u8					padding[3];
+	/* Probe buffer size */
+	__u32					probe_size;
+};
+
+/* Request types */
+#define VIRTIO_IOMMU_T_ATTACH			0x01
+#define VIRTIO_IOMMU_T_DETACH			0x02
+#define VIRTIO_IOMMU_T_MAP			0x03
+#define VIRTIO_IOMMU_T_UNMAP			0x04
+#define VIRTIO_IOMMU_T_PROBE			0x05
+
+/* Status types */
+#define VIRTIO_IOMMU_S_OK			0x00
+#define VIRTIO_IOMMU_S_IOERR			0x01
+#define VIRTIO_IOMMU_S_UNSUPP			0x02
+#define VIRTIO_IOMMU_S_DEVERR			0x03
+#define VIRTIO_IOMMU_S_INVAL			0x04
+#define VIRTIO_IOMMU_S_RANGE			0x05
+#define VIRTIO_IOMMU_S_NOENT			0x06
+#define VIRTIO_IOMMU_S_FAULT			0x07
+
+struct virtio_iommu_req_head {
+	__u8					type;
+	__u8					reserved[3];
+};
+
+struct virtio_iommu_req_tail {
+	__u8					status;
+	__u8					reserved[3];
+};
+
+struct virtio_iommu_req_attach {
+	struct virtio_iommu_req_head		head;
+	__le32					domain;
+	__le32					endpoint;
+	__u8					reserved[8];
+	struct virtio_iommu_req_tail		tail;
+};
+
+struct virtio_iommu_req_detach {
+	struct virtio_iommu_req_head		head;
+	__le32					domain;
+	__le32					endpoint;
+	__u8					reserved[8];
+	struct virtio_iommu_req_tail		tail;
+};
+
+#define VIRTIO_IOMMU_MAP_F_READ			(1 << 0)
+#define VIRTIO_IOMMU_MAP_F_WRITE		(1 << 1)
+#define VIRTIO_IOMMU_MAP_F_EXEC			(1 << 2)
+#define VIRTIO_IOMMU_MAP_F_MMIO			(1 << 3)
+
+#define VIRTIO_IOMMU_MAP_F_MASK			(VIRTIO_IOMMU_MAP_F_READ |	\
+						 VIRTIO_IOMMU_MAP_F_WRITE |	\
+						 VIRTIO_IOMMU_MAP_F_EXEC |	\
+						 VIRTIO_IOMMU_MAP_F_MMIO)
+
+struct virtio_iommu_req_map {
+	struct virtio_iommu_req_head		head;
+	__le32					domain;
+	__le64					virt_start;
+	__le64					virt_end;
+	__le64					phys_start;
+	__le32					flags;
+	struct virtio_iommu_req_tail		tail;
+};
+
+struct virtio_iommu_req_unmap {
+	struct virtio_iommu_req_head		head;
+	__le32					domain;
+	__le64					virt_start;
+	__le64					virt_end;
+	__u8					reserved[4];
+	struct virtio_iommu_req_tail		tail;
+};
+
+#define VIRTIO_IOMMU_PROBE_T_NONE		0
+#define VIRTIO_IOMMU_PROBE_T_RESV_MEM		1
+
+#define VIRTIO_IOMMU_PROBE_T_MASK		0xfff
+
+struct virtio_iommu_probe_property {
+	__le16					type;
+	__le16					length;
+};
+
+#define VIRTIO_IOMMU_RESV_MEM_T_RESERVED	0
+#define VIRTIO_IOMMU_RESV_MEM_T_MSI		1
+
+struct virtio_iommu_probe_resv_mem {
+	struct virtio_iommu_probe_property	head;
+	__u8					subtype;
+	__u8					reserved[3];
+	__le64					start;
+	__le64					end;
+};
+
+struct virtio_iommu_req_probe {
+	struct virtio_iommu_req_head		head;
+	__le32					endpoint;
+	__u8					reserved[64];
+
+	__u8					properties[];
+
+	/*
+	 * Tail follows the variable-length properties array. No padding,
+	 * property lengths are all aligned on 8 bytes.
+	 */
+};
+
+/* Fault types */
+#define VIRTIO_IOMMU_FAULT_R_UNKNOWN		0
+#define VIRTIO_IOMMU_FAULT_R_DOMAIN		1
+#define VIRTIO_IOMMU_FAULT_R_MAPPING		2
+
+#define VIRTIO_IOMMU_FAULT_F_READ		(1 << 0)
+#define VIRTIO_IOMMU_FAULT_F_WRITE		(1 << 1)
+#define VIRTIO_IOMMU_FAULT_F_EXEC		(1 << 2)
+#define VIRTIO_IOMMU_FAULT_F_ADDRESS		(1 << 8)
+
+struct virtio_iommu_fault {
+	__u8					reason;
+	__u8					reserved[3];
+	__le32					flags;
+	__le32					endpoint;
+	__u8					reserved2[4];
+	__le64					address;
+};
+
+#endif
diff --git a/init/Kconfig b/init/Kconfig
index 4592bf7997c0..e315fdfb909a 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1753,6 +1753,29 @@ config SLAB_FREELIST_HARDENED
 	  sacrifies to harden the kernel slab allocator against common
 	  freelist exploit methods.
 
+config SHUFFLE_PAGE_ALLOCATOR
+	bool "Page allocator randomization"
+	default SLAB_FREELIST_RANDOM && ACPI_NUMA
+	help
+	  Randomization of the page allocator improves the average
+	  utilization of a direct-mapped memory-side-cache. See section
+	  5.2.27 Heterogeneous Memory Attribute Table (HMAT) in the ACPI
+	  6.2a specification for an example of how a platform advertises
+	  the presence of a memory-side-cache. There are also incidental
+	  security benefits as it reduces the predictability of page
+	  allocations to compliment SLAB_FREELIST_RANDOM, but the
+	  default granularity of shuffling on 4MB (MAX_ORDER) pages is
+	  selected based on cache utilization benefits.
+
+	  While the randomization improves cache utilization it may
+	  negatively impact workloads on platforms without a cache. For
+	  this reason, by default, the randomization is enabled only
+	  after runtime detection of a direct-mapped memory-side-cache.
+	  Otherwise, the randomization may be force enabled with the
+	  'page_alloc.shuffle' kernel command line parameter.
+
+	  Say Y if unsure.
+
 config SLUB_CPU_PARTIAL
 	default y
 	depends on SLUB && SMP
@@ -1817,6 +1840,75 @@ config PROFILING
 config TRACEPOINTS
 	bool
 
+config GENERIC_CMDLINE
+	bool
+
+if GENERIC_CMDLINE
+
+config CMDLINE_BOOL
+	bool "Built-in kernel command line"
+	help
+	  Allow for specifying boot arguments to the kernel at
+	  build time.  On some systems (e.g. embedded ones), it is
+	  necessary or convenient to provide some or all of the
+	  kernel boot arguments with the kernel itself (that is,
+	  to not rely on the boot loader to provide them.)
+
+	  To compile command line arguments into the kernel,
+	  set this option to 'Y', then fill in the
+	  the boot arguments in CONFIG_CMDLINE.
+
+	  Systems with fully functional boot loaders (i.e. non-embedded)
+	  should leave this option set to 'N'.
+
+config CMDLINE_APPEND
+	string "Built-in kernel command string append"
+	depends on CMDLINE_BOOL
+	default ""
+	help
+	  Enter arguments here that should be compiled into the kernel
+	  image and used at boot time.  If the boot loader provides a
+	  command line at boot time, this string is appended to it to
+	  form the full kernel command line, when the system boots.
+
+	  However, you can use the CONFIG_CMDLINE_OVERRIDE option to
+	  change this behavior.
+
+	  In most cases, the command line (whether built-in or provided
+	  by the boot loader) should specify the device for the root
+	  file system.
+
+config CMDLINE_PREPEND
+	string "Built-in kernel command string prepend"
+	depends on CMDLINE_BOOL
+	default ""
+	help
+	  Enter arguments here that should be compiled into the kernel
+	  image and used at boot time.  If the boot loader provides a
+	  command line at boot time, this string is prepended to it to
+	  form the full kernel command line, when the system boots.
+
+	  However, you can use the CONFIG_CMDLINE_OVERRIDE option to
+	  change this behavior.
+
+	  In most cases, the command line (whether built-in or provided
+	  by the boot loader) should specify the device for the root
+	  file system.
+
+config CMDLINE_OVERRIDE
+	bool "Built-in command line overrides boot loader arguments"
+	depends on CMDLINE_BOOL
+	help
+	  Set this option to 'Y' to have the kernel ignore the boot loader
+	  command line, and use ONLY the built-in command line. In this case
+	  append and prepend strings are concatenated to form the full
+	  command line.
+
+	  This is used to work around broken boot loaders.  This should
+	  be set to 'N' under normal conditions.
+
+endif
+
 endmenu		# General setup
 
 source "arch/Kconfig"
diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c
index 49f9bf4ffc7f..d9ac6caf6a5e 100644
--- a/ipc/ipc_sysctl.c
+++ b/ipc/ipc_sysctl.c
@@ -120,7 +120,9 @@ static int proc_ipc_sem_dointvec(struct ctl_table *table, int write,
 static int zero;
 static int one = 1;
 static int int_max = INT_MAX;
-static int ipc_mni = IPCMNI;
+int ipc_mni = IPCMNI;
+int ipc_mni_shift = IPCMNI_SHIFT;
+bool ipc_mni_extended;
 
 static struct ctl_table ipc_kern_table[] = {
 	{
@@ -246,3 +248,13 @@ static int __init ipc_sysctl_init(void)
 }
 
 device_initcall(ipc_sysctl_init);
+
+static int __init ipc_mni_extend(char *str)
+{
+	ipc_mni = IPCMNI_EXTEND;
+	ipc_mni_shift = IPCMNI_EXTEND_SHIFT;
+	ipc_mni_extended = true;
+	pr_info("IPCMNI extended to %d.\n", ipc_mni);
+	return 0;
+}
+early_param("ipcmni_extend", ipc_mni_extend);
diff --git a/ipc/util.c b/ipc/util.c
index 0af05752969f..78e14acb51a7 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -110,7 +110,7 @@ static const struct rhashtable_params ipc_kht_params = {
  * @ids: ipc identifier set
  *
  * Set up the sequence range to use for the ipc identifier range (limited
- * below IPCMNI) then initialise the keys hashtable and ids idr.
+ * below ipc_mni) then initialise the keys hashtable and ids idr.
  */
 void ipc_init_ids(struct ipc_ids *ids)
 {
@@ -120,6 +120,7 @@ void ipc_init_ids(struct ipc_ids *ids)
 	rhashtable_init(&ids->key_ht, &ipc_kht_params);
 	idr_init(&ids->ipcs_idr);
 	ids->max_idx = -1;
+	ids->last_idx = -1;
 #ifdef CONFIG_CHECKPOINT_RESTORE
 	ids->next_id = -1;
 #endif
@@ -193,6 +194,10 @@ static struct kern_ipc_perm *ipc_findkey(struct ipc_ids *ids, key_t key)
  *
  * The caller must own kern_ipc_perm.lock.of the new object.
  * On error, the function returns a (negative) error code.
+ *
+ * To conserve sequence number space, especially with extended ipc_mni,
+ * the sequence number is incremented only when the returned ID is less than
+ * the last one.
  */
 static inline int ipc_idr_alloc(struct ipc_ids *ids, struct kern_ipc_perm *new)
 {
@@ -216,17 +221,23 @@ static inline int ipc_idr_alloc(struct ipc_ids *ids, struct kern_ipc_perm *new)
 	 */
 
 	if (next_id < 0) { /* !CHECKPOINT_RESTORE or next_id is unset */
-		new->seq = ids->seq++;
-		if (ids->seq > IPCID_SEQ_MAX)
+		if (ipc_mni_extended)
+			idx = idr_alloc_cyclic(&ids->ipcs_idr, new, 0, ipc_mni,
+						GFP_NOWAIT);
+		else
+			idx = idr_alloc(&ids->ipcs_idr, new, 0, 0, GFP_NOWAIT);
+
+		if ((idx <= ids->last_idx) && (++ids->seq > IPCID_SEQ_MAX))
 			ids->seq = 0;
-		idx = idr_alloc(&ids->ipcs_idr, new, 0, 0, GFP_NOWAIT);
+		new->seq = ids->seq;
+		ids->last_idx = idx;
 	} else {
 		new->seq = ipcid_to_seqx(next_id);
 		idx = idr_alloc(&ids->ipcs_idr, new, ipcid_to_idx(next_id),
 				0, GFP_NOWAIT);
 	}
 	if (idx >= 0)
-		new->id = SEQ_MULTIPLIER * new->seq + idx;
+		new->id = (new->seq << IPCMNI_SEQ_SHIFT) + idx;
 	return idx;
 }
 
@@ -254,8 +265,8 @@ int ipc_addid(struct ipc_ids *ids, struct kern_ipc_perm *new, int limit)
 	/* 1) Initialize the refcount so that ipc_rcu_putref works */
 	refcount_set(&new->refcount, 1);
 
-	if (limit > IPCMNI)
-		limit = IPCMNI;
+	if (limit > ipc_mni)
+		limit = ipc_mni;
 
 	if (ids->in_use >= limit)
 		return -ENOSPC;
@@ -738,7 +749,7 @@ static struct kern_ipc_perm *sysvipc_find_ipc(struct ipc_ids *ids, loff_t pos,
 	if (total >= ids->in_use)
 		return NULL;
 
-	for (; pos < IPCMNI; pos++) {
+	for (; pos < ipc_mni; pos++) {
 		ipc = idr_find(&ids->ipcs_idr, pos);
 		if (ipc != NULL) {
 			*new_pos = pos + 1;
diff --git a/ipc/util.h b/ipc/util.h
index e272be622ae7..836c2e993680 100644
--- a/ipc/util.h
+++ b/ipc/util.h
@@ -15,8 +15,36 @@
 #include <linux/err.h>
 #include <linux/ipc_namespace.h>
 
-#define IPCMNI 32768  /* <= MAX_INT limit for ipc arrays (including sysctl changes) */
-#define SEQ_MULTIPLIER	(IPCMNI)
+/*
+ * The IPC ID contains 2 separate numbers - index and sequence number.
+ * By default,
+ *   bits  0-14: index (32k, 15 bits)
+ *   bits 15-30: sequence number (64k, 16 bits)
+ *
+ * When IPCMNI extension mode is turned on, the composition changes:
+ *   bits  0-23: index (16M, 24 bits)
+ *   bits 24-30: sequence number (128, 7 bits)
+ */
+#define IPCMNI_SHIFT		15
+#define IPCMNI_EXTEND_SHIFT	24
+#define IPCMNI			(1 << IPCMNI_SHIFT)
+#define IPCMNI_EXTEND		(1 << IPCMNI_EXTEND_SHIFT)
+
+#ifdef CONFIG_SYSVIPC_SYSCTL
+extern int ipc_mni;
+extern int ipc_mni_shift;
+extern bool ipc_mni_extended;
+
+#define IPCMNI_SEQ_SHIFT	ipc_mni_shift
+#define IPCMNI_IDX_MASK		((1 << ipc_mni_shift) - 1)
+
+#else /* CONFIG_SYSVIPC_SYSCTL */
+
+#define ipc_mni			IPCMNI
+#define ipc_mni_extended	false
+#define IPCMNI_SEQ_SHIFT	IPCMNI_SHIFT
+#define IPCMNI_IDX_MASK		((1 << IPCMNI_SHIFT) - 1)
+#endif /* CONFIG_SYSVIPC_SYSCTL */
 
 void sem_init(void);
 void msg_init(void);
@@ -96,9 +124,9 @@ struct pid_namespace *ipc_seq_pid_ns(struct seq_file *);
 #define IPC_MSG_IDS	1
 #define IPC_SHM_IDS	2
 
-#define ipcid_to_idx(id) ((id) % SEQ_MULTIPLIER)
-#define ipcid_to_seqx(id) ((id) / SEQ_MULTIPLIER)
-#define IPCID_SEQ_MAX min_t(int, INT_MAX/SEQ_MULTIPLIER, USHRT_MAX)
+#define ipcid_to_idx(id)  ((id) & IPCMNI_IDX_MASK)
+#define ipcid_to_seqx(id) ((id) >> IPCMNI_SEQ_SHIFT)
+#define IPCID_SEQ_MAX	  (INT_MAX >> IPCMNI_SEQ_SHIFT)
 
 /* must be called with ids->rwsem acquired for writing */
 int ipc_addid(struct ipc_ids *, struct kern_ipc_perm *, int);
@@ -123,8 +151,8 @@ static inline int ipc_get_maxidx(struct ipc_ids *ids)
 	if (ids->in_use == 0)
 		return -1;
 
-	if (ids->in_use == IPCMNI)
-		return IPCMNI - 1;
+	if (ids->in_use == ipc_mni)
+		return ipc_mni - 1;
 
 	return ids->max_idx;
 }
@@ -216,10 +244,10 @@ void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids,
 
 static inline int sem_check_semmni(struct ipc_namespace *ns) {
 	/*
-	 * Check semmni range [0, IPCMNI]
+	 * Check semmni range [0, ipc_mni]
 	 * semmni is the last element of sem_ctls[4] array
 	 */
-	return ((ns->sem_ctls[3] < 0) || (ns->sem_ctls[3] > IPCMNI))
+	return ((ns->sem_ctls[3] < 0) || (ns->sem_ctls[3] > ipc_mni))
 		? -ERANGE : 0;
 }
 
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index ce166a002d16..86f9cd5d1c4e 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -212,7 +212,7 @@ struct bpf_call_arg_meta {
 	int access_size;
 	s64 msize_smax_value;
 	u64 msize_umax_value;
-	int ptr_id;
+	int ref_obj_id;
 	int func_id;
 };
 
@@ -346,35 +346,15 @@ static bool reg_type_may_be_null(enum bpf_reg_type type)
 	       type == PTR_TO_TCP_SOCK_OR_NULL;
 }
 
-static bool type_is_refcounted(enum bpf_reg_type type)
-{
-	return type == PTR_TO_SOCKET;
-}
-
-static bool type_is_refcounted_or_null(enum bpf_reg_type type)
-{
-	return type == PTR_TO_SOCKET || type == PTR_TO_SOCKET_OR_NULL;
-}
-
-static bool reg_is_refcounted(const struct bpf_reg_state *reg)
-{
-	return type_is_refcounted(reg->type);
-}
-
 static bool reg_may_point_to_spin_lock(const struct bpf_reg_state *reg)
 {
 	return reg->type == PTR_TO_MAP_VALUE &&
 		map_value_has_spin_lock(reg->map_ptr);
 }
 
-static bool reg_is_refcounted_or_null(const struct bpf_reg_state *reg)
+static bool arg_type_may_be_refcounted(enum bpf_arg_type type)
 {
-	return type_is_refcounted_or_null(reg->type);
-}
-
-static bool arg_type_is_refcounted(enum bpf_arg_type type)
-{
-	return type == ARG_PTR_TO_SOCKET;
+	return type == ARG_PTR_TO_SOCK_COMMON;
 }
 
 /* Determine whether the function releases some resources allocated by another
@@ -392,6 +372,12 @@ static bool is_acquire_function(enum bpf_func_id func_id)
 		func_id == BPF_FUNC_sk_lookup_udp;
 }
 
+static bool is_ptr_cast_function(enum bpf_func_id func_id)
+{
+	return func_id == BPF_FUNC_tcp_sock ||
+		func_id == BPF_FUNC_sk_fullsock;
+}
+
 /* string representation of 'enum bpf_reg_type' */
 static const char * const reg_type_str[] = {
 	[NOT_INIT]		= "?",
@@ -465,7 +451,8 @@ static void print_verifier_state(struct bpf_verifier_env *env,
 			if (t == PTR_TO_STACK)
 				verbose(env, ",call_%d", func(env, reg)->callsite);
 		} else {
-			verbose(env, "(id=%d", reg->id);
+			verbose(env, "(id=%d ref_obj_id=%d", reg->id,
+				reg->ref_obj_id);
 			if (t != SCALAR_VALUE)
 				verbose(env, ",off=%d", reg->off);
 			if (type_is_pkt_pointer(t))
@@ -2414,16 +2401,15 @@ static int check_func_arg(struct bpf_verifier_env *env, u32 regno,
 		/* Any sk pointer can be ARG_PTR_TO_SOCK_COMMON */
 		if (!type_is_sk_pointer(type))
 			goto err_type;
-	} else if (arg_type == ARG_PTR_TO_SOCKET) {
-		expected_type = PTR_TO_SOCKET;
-		if (type != expected_type)
-			goto err_type;
-		if (meta->ptr_id || !reg->id) {
-			verbose(env, "verifier internal error: mismatched references meta=%d, reg=%d\n",
-				meta->ptr_id, reg->id);
-			return -EFAULT;
+		if (reg->ref_obj_id) {
+			if (meta->ref_obj_id) {
+				verbose(env, "verifier internal error: more than one arg with ref_obj_id R%d %u %u\n",
+					regno, reg->ref_obj_id,
+					meta->ref_obj_id);
+				return -EFAULT;
+			}
+			meta->ref_obj_id = reg->ref_obj_id;
 		}
-		meta->ptr_id = reg->id;
 	} else if (arg_type == ARG_PTR_TO_SPIN_LOCK) {
 		if (meta->func_id == BPF_FUNC_spin_lock) {
 			if (process_spin_lock(env, regno, true))
@@ -2740,32 +2726,38 @@ static bool check_arg_pair_ok(const struct bpf_func_proto *fn)
 	return true;
 }
 
-static bool check_refcount_ok(const struct bpf_func_proto *fn)
+static bool check_refcount_ok(const struct bpf_func_proto *fn, int func_id)
 {
 	int count = 0;
 
-	if (arg_type_is_refcounted(fn->arg1_type))
+	if (arg_type_may_be_refcounted(fn->arg1_type))
 		count++;
-	if (arg_type_is_refcounted(fn->arg2_type))
+	if (arg_type_may_be_refcounted(fn->arg2_type))
 		count++;
-	if (arg_type_is_refcounted(fn->arg3_type))
+	if (arg_type_may_be_refcounted(fn->arg3_type))
 		count++;
-	if (arg_type_is_refcounted(fn->arg4_type))
+	if (arg_type_may_be_refcounted(fn->arg4_type))
 		count++;
-	if (arg_type_is_refcounted(fn->arg5_type))
+	if (arg_type_may_be_refcounted(fn->arg5_type))
 		count++;
 
+	/* A reference acquiring function cannot acquire
+	 * another refcounted ptr.
+	 */
+	if (is_acquire_function(func_id) && count)
+		return false;
+
 	/* We only support one arg being unreferenced at the moment,
 	 * which is sufficient for the helper functions we have right now.
 	 */
 	return count <= 1;
 }
 
-static int check_func_proto(const struct bpf_func_proto *fn)
+static int check_func_proto(const struct bpf_func_proto *fn, int func_id)
 {
 	return check_raw_mode_ok(fn) &&
 	       check_arg_pair_ok(fn) &&
-	       check_refcount_ok(fn) ? 0 : -EINVAL;
+	       check_refcount_ok(fn, func_id) ? 0 : -EINVAL;
 }
 
 /* Packet data might have moved, any old PTR_TO_PACKET[_META,_END]
@@ -2799,19 +2791,20 @@ static void clear_all_pkt_pointers(struct bpf_verifier_env *env)
 }
 
 static void release_reg_references(struct bpf_verifier_env *env,
-				   struct bpf_func_state *state, int id)
+				   struct bpf_func_state *state,
+				   int ref_obj_id)
 {
 	struct bpf_reg_state *regs = state->regs, *reg;
 	int i;
 
 	for (i = 0; i < MAX_BPF_REG; i++)
-		if (regs[i].id == id)
+		if (regs[i].ref_obj_id == ref_obj_id)
 			mark_reg_unknown(env, regs, i);
 
 	bpf_for_each_spilled_reg(i, state, reg) {
 		if (!reg)
 			continue;
-		if (reg_is_refcounted(reg) && reg->id == id)
+		if (reg->ref_obj_id == ref_obj_id)
 			__mark_reg_unknown(reg);
 	}
 }
@@ -2820,15 +2813,20 @@ static void release_reg_references(struct bpf_verifier_env *env,
  * resources. Identify all copies of the same pointer and clear the reference.
  */
 static int release_reference(struct bpf_verifier_env *env,
-			     struct bpf_call_arg_meta *meta)
+			     int ref_obj_id)
 {
 	struct bpf_verifier_state *vstate = env->cur_state;
+	int err;
 	int i;
 
+	err = release_reference_state(cur_func(env), ref_obj_id);
+	if (err)
+		return err;
+
 	for (i = 0; i <= vstate->curframe; i++)
-		release_reg_references(env, vstate->frame[i], meta->ptr_id);
+		release_reg_references(env, vstate->frame[i], ref_obj_id);
 
-	return release_reference_state(cur_func(env), meta->ptr_id);
+	return 0;
 }
 
 static int check_func_call(struct bpf_verifier_env *env, struct bpf_insn *insn,
@@ -3047,7 +3045,7 @@ static int check_helper_call(struct bpf_verifier_env *env, int func_id, int insn
 	memset(&meta, 0, sizeof(meta));
 	meta.pkt_access = fn->pkt_access;
 
-	err = check_func_proto(fn);
+	err = check_func_proto(fn, func_id);
 	if (err) {
 		verbose(env, "kernel subsystem misconfigured func %s#%d\n",
 			func_id_name(func_id), func_id);
@@ -3093,7 +3091,7 @@ static int check_helper_call(struct bpf_verifier_env *env, int func_id, int insn
 			return err;
 		}
 	} else if (is_release_function(func_id)) {
-		err = release_reference(env, &meta);
+		err = release_reference(env, meta.ref_obj_id);
 		if (err) {
 			verbose(env, "func %s#%d reference has not been acquired before\n",
 				func_id_name(func_id), func_id);
@@ -3154,8 +3152,10 @@ static int check_helper_call(struct bpf_verifier_env *env, int func_id, int insn
 
 			if (id < 0)
 				return id;
-			/* For release_reference() */
+			/* For mark_ptr_or_null_reg() */
 			regs[BPF_REG_0].id = id;
+			/* For release_reference() */
+			regs[BPF_REG_0].ref_obj_id = id;
 		} else {
 			/* For mark_ptr_or_null_reg() */
 			regs[BPF_REG_0].id = ++env->id_gen;
@@ -3170,6 +3170,10 @@ static int check_helper_call(struct bpf_verifier_env *env, int func_id, int insn
 		return -EINVAL;
 	}
 
+	if (is_ptr_cast_function(func_id))
+		/* For release_reference() */
+		regs[BPF_REG_0].ref_obj_id = meta.ref_obj_id;
+
 	do_refine_retval_range(regs, fn->ret_type, func_id, &meta);
 
 	err = check_map_func_compatibility(env, meta.map_ptr, func_id);
@@ -4665,11 +4669,19 @@ static void mark_ptr_or_null_reg(struct bpf_func_state *state,
 		} else if (reg->type == PTR_TO_TCP_SOCK_OR_NULL) {
 			reg->type = PTR_TO_TCP_SOCK;
 		}
-		if (is_null || !(reg_is_refcounted(reg) ||
-				 reg_may_point_to_spin_lock(reg))) {
-			/* We don't need id from this point onwards anymore,
-			 * thus we should better reset it, so that state
-			 * pruning has chances to take effect.
+		if (is_null) {
+			/* We don't need id and ref_obj_id from this point
+			 * onwards anymore, thus we should better reset it,
+			 * so that state pruning has chances to take effect.
+			 */
+			reg->id = 0;
+			reg->ref_obj_id = 0;
+		} else if (!reg_may_point_to_spin_lock(reg)) {
+			/* For not-NULL ptr, reg->ref_obj_id will be reset
+			 * in release_reg_references().
+			 *
+			 * reg->id is still used by spin_lock ptr. Other
+			 * than spin_lock ptr type, reg->id can be reset.
 			 */
 			reg->id = 0;
 		}
@@ -4684,11 +4696,16 @@ static void mark_ptr_or_null_regs(struct bpf_verifier_state *vstate, u32 regno,
 {
 	struct bpf_func_state *state = vstate->frame[vstate->curframe];
 	struct bpf_reg_state *reg, *regs = state->regs;
+	u32 ref_obj_id = regs[regno].ref_obj_id;
 	u32 id = regs[regno].id;
 	int i, j;
 
-	if (reg_is_refcounted_or_null(&regs[regno]) && is_null)
-		release_reference_state(state, id);
+	if (ref_obj_id && ref_obj_id == id && is_null)
+		/* regs[regno] is in the " == NULL" branch.
+		 * No one could have freed the reference state before
+		 * doing the NULL check.
+		 */
+		WARN_ON_ONCE(release_reference_state(state, id));
 
 	for (i = 0; i < MAX_BPF_REG; i++)
 		mark_ptr_or_null_reg(state, &regs[i], id, is_null);
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 3f2b4bde0f9c..88db41950f16 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -1775,11 +1775,13 @@ int cgroup_show_path(struct seq_file *sf, struct kernfs_node *kf_node,
 
 enum cgroup2_param {
 	Opt_nsdelegate,
+	Opt_memory_localevents,
 	nr__cgroup2_params
 };
 
 static const struct fs_parameter_spec cgroup2_param_specs[] = {
-	fsparam_flag  ("nsdelegate",		Opt_nsdelegate),
+	fsparam_flag("nsdelegate",		Opt_nsdelegate),
+	fsparam_flag("memory_localevents",	Opt_memory_localevents),
 	{}
 };
 
@@ -1802,6 +1804,9 @@ static int cgroup2_parse_param(struct fs_context *fc, struct fs_parameter *param
 	case Opt_nsdelegate:
 		ctx->flags |= CGRP_ROOT_NS_DELEGATE;
 		return 0;
+	case Opt_memory_localevents:
+		ctx->flags |= CGRP_ROOT_MEMORY_LOCAL_EVENTS;
+		return 0;
 	}
 	return -EINVAL;
 }
@@ -1813,6 +1818,11 @@ static void apply_cgroup_root_flags(unsigned int root_flags)
 			cgrp_dfl_root.flags |= CGRP_ROOT_NS_DELEGATE;
 		else
 			cgrp_dfl_root.flags &= ~CGRP_ROOT_NS_DELEGATE;
+
+		if (root_flags & CGRP_ROOT_MEMORY_LOCAL_EVENTS)
+			cgrp_dfl_root.flags |= CGRP_ROOT_MEMORY_LOCAL_EVENTS;
+		else
+			cgrp_dfl_root.flags &= ~CGRP_ROOT_MEMORY_LOCAL_EVENTS;
 	}
 }
 
@@ -1820,6 +1830,8 @@ static int cgroup_show_options(struct seq_file *seq, struct kernfs_root *kf_root
 {
 	if (cgrp_dfl_root.flags & CGRP_ROOT_NS_DELEGATE)
 		seq_puts(seq, ",nsdelegate");
+	if (cgrp_dfl_root.flags & CGRP_ROOT_MEMORY_LOCAL_EVENTS)
+		seq_puts(seq, ",memory_localevents");
 	return 0;
 }
 
@@ -3508,7 +3520,89 @@ static int cgroup_cpu_pressure_show(struct seq_file *seq, void *v)
 {
 	return psi_show(seq, &seq_css(seq)->cgroup->psi, PSI_CPU);
 }
-#endif
+
+static ssize_t cgroup_pressure_write(struct kernfs_open_file *of, char *buf,
+					  size_t nbytes, enum psi_res res)
+{
+	struct psi_trigger *old;
+	struct psi_trigger *new;
+	struct cgroup *cgrp;
+
+	cgrp = cgroup_kn_lock_live(of->kn, false);
+	if (!cgrp)
+		return -ENODEV;
+
+	cgroup_get(cgrp);
+	cgroup_kn_unlock(of->kn);
+
+	new = psi_trigger_create(&cgrp->psi, buf, nbytes, res);
+	if (IS_ERR(new)) {
+		cgroup_put(cgrp);
+		return PTR_ERR(new);
+	}
+
+	old = of->priv;
+	rcu_assign_pointer(of->priv, new);
+	if (old) {
+		synchronize_rcu();
+		psi_trigger_destroy(old);
+	}
+
+	cgroup_put(cgrp);
+
+	return nbytes;
+}
+
+static ssize_t cgroup_io_pressure_write(struct kernfs_open_file *of,
+					  char *buf, size_t nbytes,
+					  loff_t off)
+{
+	return cgroup_pressure_write(of, buf, nbytes, PSI_IO);
+}
+
+static ssize_t cgroup_memory_pressure_write(struct kernfs_open_file *of,
+					  char *buf, size_t nbytes,
+					  loff_t off)
+{
+	return cgroup_pressure_write(of, buf, nbytes, PSI_MEM);
+}
+
+static ssize_t cgroup_cpu_pressure_write(struct kernfs_open_file *of,
+					  char *buf, size_t nbytes,
+					  loff_t off)
+{
+	return cgroup_pressure_write(of, buf, nbytes, PSI_CPU);
+}
+
+static __poll_t cgroup_pressure_poll(struct kernfs_open_file *of,
+					  poll_table *pt)
+{
+	struct psi_trigger *t;
+	__poll_t ret;
+
+	rcu_read_lock();
+	t = rcu_dereference_raw(of->priv);
+	if (t)
+		ret = psi_trigger_poll(t, of->file, pt);
+	else
+		ret = DEFAULT_POLLMASK | EPOLLERR | EPOLLPRI;
+	rcu_read_unlock();
+
+	return ret;
+}
+
+static void cgroup_pressure_release(struct kernfs_open_file *of)
+{
+	struct psi_trigger *t = of->priv;
+
+	if (!t)
+		return;
+
+	rcu_assign_pointer(of->priv, NULL);
+	synchronize_rcu();
+	psi_trigger_destroy(t);
+}
+#endif /* CONFIG_PSI */
 
 static int cgroup_file_open(struct kernfs_open_file *of)
 {
@@ -4663,18 +4757,27 @@ static struct cftype cgroup_base_files[] = {
 		.name = "io.pressure",
 		.flags = CFTYPE_NOT_ON_ROOT,
 		.seq_show = cgroup_io_pressure_show,
+		.write = cgroup_io_pressure_write,
+		.poll = cgroup_pressure_poll,
+		.release = cgroup_pressure_release,
 	},
 	{
 		.name = "memory.pressure",
 		.flags = CFTYPE_NOT_ON_ROOT,
 		.seq_show = cgroup_memory_pressure_show,
+		.write = cgroup_memory_pressure_write,
+		.poll = cgroup_pressure_poll,
+		.release = cgroup_pressure_release,
 	},
 	{
 		.name = "cpu.pressure",
 		.flags = CFTYPE_NOT_ON_ROOT,
 		.seq_show = cgroup_cpu_pressure_show,
+		.write = cgroup_cpu_pressure_write,
+		.poll = cgroup_pressure_poll,
+		.release = cgroup_pressure_release,
 	},
-#endif
+#endif /* CONFIG_PSI */
 	{ }	/* terminate */
 };
 
@@ -6116,7 +6219,7 @@ static struct kobj_attribute cgroup_delegate_attr = __ATTR_RO(delegate);
 static ssize_t features_show(struct kobject *kobj, struct kobj_attribute *attr,
 			     char *buf)
 {
-	return snprintf(buf, PAGE_SIZE, "nsdelegate\n");
+	return snprintf(buf, PAGE_SIZE, "nsdelegate\nmemory_localevents\n");
 }
 static struct kobj_attribute cgroup_features_attr = __ATTR_RO(features);
 
diff --git a/kernel/dma/remap.c b/kernel/dma/remap.c
index 7a723194ecbe..2b750f13bc8f 100644
--- a/kernel/dma/remap.c
+++ b/kernel/dma/remap.c
@@ -158,7 +158,7 @@ int __init dma_atomic_pool_init(gfp_t gfp, pgprot_t prot)
 
 bool dma_in_atomic_pool(void *start, size_t size)
 {
-	return addr_in_gen_pool(atomic_pool, (unsigned long)start, size);
+	return gen_pool_has_addr(atomic_pool, (unsigned long)start, size);
 }
 
 void *dma_alloc_from_pool(size_t size, struct page **ret_page, gfp_t flags)
diff --git a/kernel/fork.c b/kernel/fork.c
index 9dcd18aa210b..3c516c6f7ce4 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -918,6 +918,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
 
 #ifdef CONFIG_MEMCG
 	tsk->active_memcg = NULL;
+	tsk->memcg_high_reclaim = NULL;
 #endif
 	return tsk;
 
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 771e93f9c43f..6f357f4fc859 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -29,6 +29,7 @@
 #include <linux/hw_breakpoint.h>
 #include <linux/cn_proc.h>
 #include <linux/compat.h>
+#include <linux/sched/signal.h>
 
 /*
  * Access another process' address space via ptrace.
@@ -924,18 +925,26 @@ int ptrace_request(struct task_struct *child, long request,
 			ret = ptrace_setsiginfo(child, &siginfo);
 		break;
 
-	case PTRACE_GETSIGMASK:
+	case PTRACE_GETSIGMASK: {
+		sigset_t *mask;
+
 		if (addr != sizeof(sigset_t)) {
 			ret = -EINVAL;
 			break;
 		}
 
-		if (copy_to_user(datavp, &child->blocked, sizeof(sigset_t)))
+		if (test_tsk_restore_sigmask(child))
+			mask = &child->saved_sigmask;
+		else
+			mask = &child->blocked;
+
+		if (copy_to_user(datavp, mask, sizeof(sigset_t)))
 			ret = -EFAULT;
 		else
 			ret = 0;
 
 		break;
+	}
 
 	case PTRACE_SETSIGMASK: {
 		sigset_t new_set;
@@ -961,6 +970,8 @@ int ptrace_request(struct task_struct *child, long request,
 		child->blocked = new_set;
 		spin_unlock_irq(&child->sighand->siglock);
 
+		clear_tsk_restore_sigmask(child);
+
 		ret = 0;
 		break;
 	}
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index ead464a0f2e5..4778c48a7fda 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6998,7 +6998,7 @@ static int __maybe_unused cpu_period_quota_parse(char *buf,
 {
 	char tok[21];	/* U64_MAX */
 
-	if (!sscanf(buf, "%s %llu", tok, periodp))
+	if (sscanf(buf, "%20s %llu", tok, periodp) < 1)
 		return -EINVAL;
 
 	*periodp *= NSEC_PER_USEC;
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index 2efe629425be..72b62ac1c7c2 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -48,10 +48,10 @@ struct sugov_cpu {
 
 	bool			iowait_boost_pending;
 	unsigned int		iowait_boost;
-	unsigned int		iowait_boost_max;
 	u64			last_update;
 
 	unsigned long		bw_dl;
+	unsigned long		min;
 	unsigned long		max;
 
 	/* The field below is for single-CPU policies only: */
@@ -303,8 +303,7 @@ static bool sugov_iowait_reset(struct sugov_cpu *sg_cpu, u64 time,
 	if (delta_ns <= TICK_NSEC)
 		return false;
 
-	sg_cpu->iowait_boost = set_iowait_boost
-		? sg_cpu->sg_policy->policy->min : 0;
+	sg_cpu->iowait_boost = set_iowait_boost ? sg_cpu->min : 0;
 	sg_cpu->iowait_boost_pending = set_iowait_boost;
 
 	return true;
@@ -344,14 +343,12 @@ static void sugov_iowait_boost(struct sugov_cpu *sg_cpu, u64 time,
 
 	/* Double the boost at each request */
 	if (sg_cpu->iowait_boost) {
-		sg_cpu->iowait_boost <<= 1;
-		if (sg_cpu->iowait_boost > sg_cpu->iowait_boost_max)
-			sg_cpu->iowait_boost = sg_cpu->iowait_boost_max;
+		sg_cpu->iowait_boost = min(sg_cpu->iowait_boost << 1, SCHED_CAPACITY_SCALE);
 		return;
 	}
 
 	/* First wakeup after IO: start with minimum boost */
-	sg_cpu->iowait_boost = sg_cpu->sg_policy->policy->min;
+	sg_cpu->iowait_boost = sg_cpu->min;
 }
 
 /**
@@ -373,47 +370,38 @@ static void sugov_iowait_boost(struct sugov_cpu *sg_cpu, u64 time,
  * This mechanism is designed to boost high frequently IO waiting tasks, while
  * being more conservative on tasks which does sporadic IO operations.
  */
-static void sugov_iowait_apply(struct sugov_cpu *sg_cpu, u64 time,
-			       unsigned long *util, unsigned long *max)
+static unsigned long sugov_iowait_apply(struct sugov_cpu *sg_cpu, u64 time,
+					unsigned long util, unsigned long max)
 {
-	unsigned int boost_util, boost_max;
+	unsigned long boost;
 
 	/* No boost currently required */
 	if (!sg_cpu->iowait_boost)
-		return;
+		return util;
 
 	/* Reset boost if the CPU appears to have been idle enough */
 	if (sugov_iowait_reset(sg_cpu, time, false))
-		return;
+		return util;
 
-	/*
-	 * An IO waiting task has just woken up:
-	 * allow to further double the boost value
-	 */
-	if (sg_cpu->iowait_boost_pending) {
-		sg_cpu->iowait_boost_pending = false;
-	} else {
+	if (!sg_cpu->iowait_boost_pending) {
 		/*
-		 * Otherwise: reduce the boost value and disable it when we
-		 * reach the minimum.
+		 * No boost pending; reduce the boost value.
 		 */
 		sg_cpu->iowait_boost >>= 1;
-		if (sg_cpu->iowait_boost < sg_cpu->sg_policy->policy->min) {
+		if (sg_cpu->iowait_boost < sg_cpu->min) {
 			sg_cpu->iowait_boost = 0;
-			return;
+			return util;
 		}
 	}
 
+	sg_cpu->iowait_boost_pending = false;
+
 	/*
-	 * Apply the current boost value: a CPU is boosted only if its current
-	 * utilization is smaller then the current IO boost level.
+	 * @util is already in capacity scale; convert iowait_boost
+	 * into the same scale so we can compare.
 	 */
-	boost_util = sg_cpu->iowait_boost;
-	boost_max = sg_cpu->iowait_boost_max;
-	if (*util * boost_max < *max * boost_util) {
-		*util = boost_util;
-		*max = boost_max;
-	}
+	boost = (sg_cpu->iowait_boost * max) >> SCHED_CAPACITY_SHIFT;
+	return max(boost, util);
 }
 
 #ifdef CONFIG_NO_HZ_COMMON
@@ -460,7 +448,7 @@ static void sugov_update_single(struct update_util_data *hook, u64 time,
 
 	util = sugov_get_util(sg_cpu);
 	max = sg_cpu->max;
-	sugov_iowait_apply(sg_cpu, time, &util, &max);
+	util = sugov_iowait_apply(sg_cpu, time, util, max);
 	next_f = get_next_freq(sg_policy, util, max);
 	/*
 	 * Do not reduce the frequency if the CPU has not been idle
@@ -500,7 +488,7 @@ static unsigned int sugov_next_freq_shared(struct sugov_cpu *sg_cpu, u64 time)
 
 		j_util = sugov_get_util(j_sg_cpu);
 		j_max = j_sg_cpu->max;
-		sugov_iowait_apply(j_sg_cpu, time, &j_util, &j_max);
+		j_util = sugov_iowait_apply(j_sg_cpu, time, j_util, j_max);
 
 		if (j_util * max > j_max * util) {
 			util = j_util;
@@ -837,7 +825,9 @@ static int sugov_start(struct cpufreq_policy *policy)
 		memset(sg_cpu, 0, sizeof(*sg_cpu));
 		sg_cpu->cpu			= cpu;
 		sg_cpu->sg_policy		= sg_policy;
-		sg_cpu->iowait_boost_max	= policy->cpuinfo.max_freq;
+		sg_cpu->min			=
+			(SCHED_CAPACITY_SCALE * policy->cpuinfo.min_freq) /
+			policy->cpuinfo.max_freq;
 	}
 
 	for_each_cpu(cpu, policy->cpus) {
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index ea74d43924b2..fdab7eb6f351 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -8059,6 +8059,18 @@ check_cpu_capacity(struct rq *rq, struct sched_domain *sd)
 				(rq->cpu_capacity_orig * 100));
 }
 
+/*
+ * Check whether a rq has a misfit task and if it looks like we can actually
+ * help that task: we can migrate the task to a CPU of higher capacity, or
+ * the task's current CPU is heavily pressured.
+ */
+static inline int check_misfit_status(struct rq *rq, struct sched_domain *sd)
+{
+	return rq->misfit_task_load &&
+		(rq->cpu_capacity_orig < rq->rd->max_cpu_capacity ||
+		 check_cpu_capacity(rq, sd));
+}
+
 /*
  * Group imbalance indicates (and tries to solve) the problem where balancing
  * groups is inadequate due to ->cpus_allowed constraints.
@@ -9586,35 +9598,21 @@ static void nohz_balancer_kick(struct rq *rq)
 	if (time_before(now, nohz.next_balance))
 		goto out;
 
-	if (rq->nr_running >= 2 || rq->misfit_task_load) {
+	if (rq->nr_running >= 2) {
 		flags = NOHZ_KICK_MASK;
 		goto out;
 	}
 
 	rcu_read_lock();
-	sds = rcu_dereference(per_cpu(sd_llc_shared, cpu));
-	if (sds) {
-		/*
-		 * If there is an imbalance between LLC domains (IOW we could
-		 * increase the overall cache use), we need some less-loaded LLC
-		 * domain to pull some load. Likewise, we may need to spread
-		 * load within the current LLC domain (e.g. packed SMT cores but
-		 * other CPUs are idle). We can't really know from here how busy
-		 * the others are - so just get a nohz balance going if it looks
-		 * like this LLC domain has tasks we could move.
-		 */
-		nr_busy = atomic_read(&sds->nr_busy_cpus);
-		if (nr_busy > 1) {
-			flags = NOHZ_KICK_MASK;
-			goto unlock;
-		}
-
-	}
 
 	sd = rcu_dereference(rq->sd);
 	if (sd) {
-		if ((rq->cfs.h_nr_running >= 1) &&
-		    check_cpu_capacity(rq, sd)) {
+		/*
+		 * If there's a CFS task and the current CPU has reduced
+		 * capacity; kick the ILB to see if there's a better CPU to run
+		 * on.
+		 */
+		if (rq->cfs.h_nr_running >= 1 && check_cpu_capacity(rq, sd)) {
 			flags = NOHZ_KICK_MASK;
 			goto unlock;
 		}
@@ -9622,6 +9620,11 @@ static void nohz_balancer_kick(struct rq *rq)
 
 	sd = rcu_dereference(per_cpu(sd_asym_packing, cpu));
 	if (sd) {
+		/*
+		 * When ASYM_PACKING; see if there's a more preferred CPU
+		 * currently idle; in which case, kick the ILB to move tasks
+		 * around.
+		 */
 		for_each_cpu_and(i, sched_domain_span(sd), nohz.idle_cpus_mask) {
 			if (sched_asym_prefer(i, cpu)) {
 				flags = NOHZ_KICK_MASK;
@@ -9629,6 +9632,45 @@ static void nohz_balancer_kick(struct rq *rq)
 			}
 		}
 	}
+
+	sd = rcu_dereference(per_cpu(sd_asym_cpucapacity, cpu));
+	if (sd) {
+		/*
+		 * When ASYM_CPUCAPACITY; see if there's a higher capacity CPU
+		 * to run the misfit task on.
+		 */
+		if (check_misfit_status(rq, sd)) {
+			flags = NOHZ_KICK_MASK;
+			goto unlock;
+		}
+
+		/*
+		 * For asymmetric systems, we do not want to nicely balance
+		 * cache use, instead we want to embrace asymmetry and only
+		 * ensure tasks have enough CPU capacity.
+		 *
+		 * Skip the LLC logic because it's not relevant in that case.
+		 */
+		goto unlock;
+	}
+
+	sds = rcu_dereference(per_cpu(sd_llc_shared, cpu));
+	if (sds) {
+		/*
+		 * If there is an imbalance between LLC domains (IOW we could
+		 * increase the overall cache use), we need some less-loaded LLC
+		 * domain to pull some load. Likewise, we may need to spread
+		 * load within the current LLC domain (e.g. packed SMT cores but
+		 * other CPUs are idle). We can't really know from here how busy
+		 * the others are - so just get a nohz balance going if it looks
+		 * like this LLC domain has tasks we could move.
+		 */
+		nr_busy = atomic_read(&sds->nr_busy_cpus);
+		if (nr_busy > 1) {
+			flags = NOHZ_KICK_MASK;
+			goto unlock;
+		}
+	}
 unlock:
 	rcu_read_unlock();
 out:
diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
index 0e97ca9306ef..0bb130692ad6 100644
--- a/kernel/sched/psi.c
+++ b/kernel/sched/psi.c
@@ -4,6 +4,9 @@
  * Copyright (c) 2018 Facebook, Inc.
  * Author: Johannes Weiner <hannes@cmpxchg.org>
  *
+ * Polling support by Suren Baghdasaryan <surenb@google.com>
+ * Copyright (c) 2018 Google, Inc.
+ *
  * When CPU, memory and IO are contended, tasks experience delays that
  * reduce throughput and introduce latencies into the workload. Memory
  * and IO contention, in addition, can cause a full loss of forward
@@ -127,11 +130,16 @@
 #include "../workqueue_internal.h"
 #include <linux/sched/loadavg.h>
 #include <linux/seq_file.h>
+#include <linux/eventfd.h>
 #include <linux/proc_fs.h>
 #include <linux/seqlock.h>
+#include <linux/uaccess.h>
 #include <linux/cgroup.h>
 #include <linux/module.h>
 #include <linux/sched.h>
+#include <linux/ctype.h>
+#include <linux/file.h>
+#include <linux/poll.h>
 #include <linux/psi.h>
 #include "sched.h"
 
@@ -140,9 +148,9 @@ static int psi_bug __read_mostly;
 DEFINE_STATIC_KEY_FALSE(psi_disabled);
 
 #ifdef CONFIG_PSI_DEFAULT_DISABLED
-bool psi_enable;
+static bool psi_enable;
 #else
-bool psi_enable = true;
+static bool psi_enable = true;
 #endif
 static int __init setup_psi(char *str)
 {
@@ -151,11 +159,16 @@ static int __init setup_psi(char *str)
 __setup("psi=", setup_psi);
 
 /* Running averages - we need to be higher-res than loadavg */
-#define PSI_FREQ	(2*HZ+1)	/* 2 sec intervals */
+#define PSI_FREQ	(2*HZ+1UL)	/* 2 sec intervals */
 #define EXP_10s		1677		/* 1/exp(2s/10s) as fixed-point */
 #define EXP_60s		1981		/* 1/exp(2s/60s) */
 #define EXP_300s	2034		/* 1/exp(2s/300s) */
 
+/* PSI trigger definitions */
+#define WINDOW_MIN_US 500000	/* Min window size is 500ms */
+#define WINDOW_MAX_US 10000000	/* Max window size is 10s */
+#define UPDATES_PER_WINDOW 10	/* 10 updates per window */
+
 /* Sampling frequency in nanoseconds */
 static u64 psi_period __read_mostly;
 
@@ -173,9 +186,18 @@ static void group_init(struct psi_group *group)
 
 	for_each_possible_cpu(cpu)
 		seqcount_init(&per_cpu_ptr(group->pcpu, cpu)->seq);
-	group->next_update = sched_clock() + psi_period;
+	group->avg_next_update = sched_clock() + psi_period;
+	atomic_set(&group->polling, 0);
 	INIT_DELAYED_WORK(&group->clock_work, psi_update_work);
-	mutex_init(&group->stat_lock);
+	mutex_init(&group->update_lock);
+	/* Init trigger-related members */
+	INIT_LIST_HEAD(&group->triggers);
+	memset(group->nr_triggers, 0, sizeof(group->nr_triggers));
+	group->trigger_states = 0;
+	group->trigger_min_period = U32_MAX;
+	memset(group->polling_total, 0, sizeof(group->polling_total));
+	group->polling_next_update = ULLONG_MAX;
+	group->polling_until = 0;
 }
 
 void __init psi_init(void)
@@ -210,20 +232,23 @@ static bool test_state(unsigned int *tasks, enum psi_states state)
 	}
 }
 
-static void get_recent_times(struct psi_group *group, int cpu, u32 *times)
+static void get_recent_times(struct psi_group *group, int cpu, u32 *times,
+							 u32 *pchanged_states)
 {
 	struct psi_group_cpu *groupc = per_cpu_ptr(group->pcpu, cpu);
-	unsigned int tasks[NR_PSI_TASK_COUNTS];
 	u64 now, state_start;
+	enum psi_states s;
 	unsigned int seq;
-	int s;
+	u32 state_mask;
+
+	*pchanged_states = 0;
 
 	/* Snapshot a coherent view of the CPU state */
 	do {
 		seq = read_seqcount_begin(&groupc->seq);
 		now = cpu_clock(cpu);
 		memcpy(times, groupc->times, sizeof(groupc->times));
-		memcpy(tasks, groupc->tasks, sizeof(groupc->tasks));
+		state_mask = groupc->state_mask;
 		state_start = groupc->state_start;
 	} while (read_seqcount_retry(&groupc->seq, seq));
 
@@ -239,13 +264,15 @@ static void get_recent_times(struct psi_group *group, int cpu, u32 *times)
 		 * (u32) and our reported pressure close to what's
 		 * actually happening.
 		 */
-		if (test_state(tasks, s))
+		if (state_mask & (1 << s))
 			times[s] += now - state_start;
 
 		delta = times[s] - groupc->times_prev[s];
 		groupc->times_prev[s] = times[s];
 
 		times[s] = delta;
+		if (delta)
+			*pchanged_states |= (1 << s);
 	}
 }
 
@@ -269,17 +296,14 @@ static void calc_avgs(unsigned long avg[3], int missed_periods,
 	avg[2] = calc_load(avg[2], EXP_300s, pct);
 }
 
-static bool update_stats(struct psi_group *group)
+static void collect_percpu_times(struct psi_group *group, u32 *pchanged_states)
 {
 	u64 deltas[NR_PSI_STATES - 1] = { 0, };
-	unsigned long missed_periods = 0;
 	unsigned long nonidle_total = 0;
-	u64 now, expires, period;
+	u32 changed_states = 0;
 	int cpu;
 	int s;
 
-	mutex_lock(&group->stat_lock);
-
 	/*
 	 * Collect the per-cpu time buckets and average them into a
 	 * single time sample that is normalized to wallclock time.
@@ -291,8 +315,10 @@ static bool update_stats(struct psi_group *group)
 	for_each_possible_cpu(cpu) {
 		u32 times[NR_PSI_STATES];
 		u32 nonidle;
+		u32 cpu_changed_states;
 
-		get_recent_times(group, cpu, times);
+		get_recent_times(group, cpu, times, &cpu_changed_states);
+		changed_states |= cpu_changed_states;
 
 		nonidle = nsecs_to_jiffies(times[PSI_NONIDLE]);
 		nonidle_total += nonidle;
@@ -317,11 +343,18 @@ static bool update_stats(struct psi_group *group)
 	for (s = 0; s < NR_PSI_STATES - 1; s++)
 		group->total[s] += div_u64(deltas[s], max(nonidle_total, 1UL));
 
-	/* avgX= */
-	now = sched_clock();
-	expires = group->next_update;
-	if (now < expires)
-		goto out;
+	if (pchanged_states)
+		*pchanged_states = changed_states;
+}
+
+static u64 update_averages(struct psi_group *group, u64 now)
+{
+	unsigned long missed_periods = 0;
+	u64 expires, period;
+	u64 avg_next_update;
+	int s;
+
+	expires = group->avg_next_update;
 	if (now - expires >= psi_period)
 		missed_periods = div_u64(now - expires, psi_period);
 
@@ -332,14 +365,14 @@ static bool update_stats(struct psi_group *group)
 	 * But the deltas we sample out of the per-cpu buckets above
 	 * are based on the actual time elapsing between clock ticks.
 	 */
-	group->next_update = expires + ((1 + missed_periods) * psi_period);
-	period = now - (group->last_update + (missed_periods * psi_period));
-	group->last_update = now;
+	avg_next_update = expires + ((1 + missed_periods) * psi_period);
+	period = now - (group->avg_last_update + (missed_periods * psi_period));
+	group->avg_last_update = now;
 
 	for (s = 0; s < NR_PSI_STATES - 1; s++) {
 		u32 sample;
 
-		sample = group->total[s] - group->total_prev[s];
+		sample = group->total[s] - group->avg_total[s];
 		/*
 		 * Due to the lockless sampling of the time buckets,
 		 * recorded time deltas can slip into the next period,
@@ -359,23 +392,244 @@ static bool update_stats(struct psi_group *group)
 		 */
 		if (sample > period)
 			sample = period;
-		group->total_prev[s] += sample;
+		group->avg_total[s] += sample;
 		calc_avgs(group->avg[s], missed_periods, sample, period);
 	}
-out:
-	mutex_unlock(&group->stat_lock);
-	return nonidle_total;
+
+	return avg_next_update;
+}
+
+/* Trigger tracking window manupulations */
+static void window_reset(struct psi_window *win, u64 now, u64 value,
+						 u64 prev_growth)
+{
+	win->start_time = now;
+	win->start_value = value;
+	win->prev_growth = prev_growth;
+}
+
+/*
+ * PSI growth tracking window update and growth calculation routine.
+ *
+ * This approximates a sliding tracking window by interpolating
+ * partially elapsed windows using historical growth data from the
+ * previous intervals. This minimizes memory requirements (by not storing
+ * all the intermediate values in the previous window) and simplifies
+ * the calculations. It works well because PSI signal changes only in
+ * positive direction and over relatively small window sizes the growth
+ * is close to linear.
+ */
+static u64 window_update(struct psi_window *win, u64 now, u64 value)
+{
+	u64 elapsed;
+	u64 growth;
+
+	elapsed = now - win->start_time;
+	growth = value - win->start_value;
+	/*
+	 * After each tracking window passes win->start_value and
+	 * win->start_time get reset and win->prev_growth stores
+	 * the average per-window growth of the previous window.
+	 * win->prev_growth is then used to interpolate additional
+	 * growth from the previous window assuming it was linear.
+	 */
+	if (elapsed > win->size)
+		window_reset(win, now, value, growth);
+	else {
+		u32 remaining;
+
+		remaining = win->size - elapsed;
+		growth += div_u64(win->prev_growth * remaining, win->size);
+	}
+
+	return growth;
+}
+
+static void init_triggers(struct psi_group *group, u64 now)
+{
+	struct psi_trigger *t;
+
+	list_for_each_entry(t, &group->triggers, node)
+		window_reset(&t->win, now, group->total[t->state], 0);
+	memcpy(group->polling_total, group->total,
+		   sizeof(group->polling_total));
+	group->polling_next_update = now + group->trigger_min_period;
 }
 
+static u64 update_triggers(struct psi_group *group, u64 now)
+{
+	struct psi_trigger *t;
+	bool new_stall = false;
+
+	/*
+	 * On subsequent updates, calculate growth deltas and let
+	 * watchers know when their specified thresholds are exceeded.
+	 */
+	list_for_each_entry(t, &group->triggers, node) {
+		u64 growth;
+
+		/* Check for stall activity */
+		if (group->polling_total[t->state] == group->total[t->state])
+			continue;
+
+		/*
+		 * Multiple triggers might be looking at the same state,
+		 * remember to update group->polling_total[] once we've
+		 * been through all of them. Also remember to extend the
+		 * polling time if we see new stall activity.
+		 */
+		new_stall = true;
+
+		/* Calculate growth since last update */
+		growth = window_update(&t->win, now, group->total[t->state]);
+		if (growth < t->threshold)
+			continue;
+
+		/* Limit event signaling to once per window */
+		if (now < t->last_event_time + t->win.size)
+			continue;
+
+		/* Generate an event */
+		if (cmpxchg(&t->event, 0, 1) == 0)
+			wake_up_interruptible(&t->event_wait);
+		t->last_event_time = now;
+	}
+
+	if (new_stall) {
+		memcpy(group->polling_total, group->total,
+			   sizeof(group->polling_total));
+	}
+
+	return now + group->trigger_min_period;
+}
+
+/*
+ * psi_update_work represents slowpath accounting part while psi_group_change
+ * represents hotpath part. There are two potential races between them:
+ * 1. Changes to group->polling when slowpath checks for new stall, then hotpath
+ *    records new stall and then slowpath resets group->polling flag. This leads
+ *    to the exit from the polling mode while monitored state is still changing.
+ * 2. Slowpath overwriting an immediate update scheduled from the hotpath with
+ *    a regular update further in the future and missing the immediate update.
+ * Both races are handled with a retry cycle in the slowpath:
+ *
+ *    HOTPATH:                         |    SLOWPATH:
+ *                                     |
+ * A) times[cpu] += delta              | E) delta = times[*]
+ * B) start_poll = (delta[poll_mask] &&|    polling = g->polling
+ *      cmpxchg(g->polling, 0, 1) == 0)|    if delta[poll_mask]:
+ *    if start_poll:                   | F)   polling_until = now + grace_period
+ * C)   mod_delayed_work(1)            |    if now > polling_until:
+ *     else if !delayed_work_pending():|      if polling:
+ * D)   schedule_delayed_work(PSI_FREQ)| G)     g->polling = polling = 0
+ *                                     |        smp_mb
+ *                                     | H)     goto SLOWPATH
+ *                                     |    else:
+ *                                     |      if !polling:
+ *                                     | I)     g->polling = polling = 1
+ *                                     | J) if delta && first_pass:
+ *                                     |      next_avg = update_averages()
+ *                                     |      if polling:
+ *                                     |        next_poll = update_triggers()
+ *                                     |    if (delta && first_pass) || polling:
+ *                                     | K)   mod_delayed_work(
+ *                                     |          min(next_avg, next_poll))
+ *                                     |      if !polling:
+ *                                     |        first_pass = false
+ *                                     | L)     goto SLOWPATH
+ *
+ * Race #1 is represented by (EABGD) sequence in which case slowpath deactivates
+ * polling mode because it misses new monitored stall and hotpath doesn't
+ * activate it because at (B) g->polling is not yet reset by slowpath in (G).
+ * This race is handled by the (H) retry, which in the race described above
+ * results in the new sequence of (EABGDHEIK) that reactivates polling mode.
+ *
+ * Race #2 is represented by polling==false && (JABCK) sequence which overwrites
+ * immediate update scheduled at (C) with a later (next_avg) update scheduled at
+ * (K). This race is handled by the (L) retry which results in the new sequence
+ * of polling==false && (JABCKLEIK) that reactivates polling mode and
+ * reschedules the next polling update (next_poll).
+ *
+ * Note that retries can't result in an infinite loop because retry #1 happens
+ * only during polling reactivation and retry #2 happens only on the first pass.
+ * Constant reactivations are impossible because polling will stay active for at
+ * least grace_period. Worst case scenario involves two retries (HEJKLE)
+ */
 static void psi_update_work(struct work_struct *work)
 {
 	struct delayed_work *dwork;
 	struct psi_group *group;
+	bool first_pass = true;
+	u64 next_update;
+	u32 changed_states;
+	int polling;
 	bool nonidle;
+	u64 now;
 
 	dwork = to_delayed_work(work);
 	group = container_of(dwork, struct psi_group, clock_work);
 
+	mutex_lock(&group->update_lock);
+
+	now = sched_clock();
+
+retry:
+	collect_percpu_times(group, &changed_states);
+	polling = atomic_read(&group->polling);
+
+	if (changed_states & group->trigger_states) {
+		/* Initialize trigger windows when entering polling mode */
+		if (now > group->polling_until)
+			init_triggers(group, now);
+
+		/*
+		 * Keep the monitor active for at least the duration of the
+		 * minimum tracking window as long as monitor states are
+		 * changing. This prevents frequent changes to polling flag
+		 * when system bounces in and out of stall states.
+		 */
+		group->polling_until = now +
+			group->trigger_min_period * UPDATES_PER_WINDOW;
+	}
+
+	/* Handle polling flag transitions */
+	if (now > group->polling_until) {
+		if (polling) {
+			group->polling_next_update = ULLONG_MAX;
+			polling = 0;
+			atomic_set(&group->polling, polling);
+			/*
+			 * Memory barrier is needed to order group->polling=0
+			 * write before times[] reads in collect_percpu_times()
+			 * to detect possible race with hotpath that modifies
+			 * times[] before it sets group->polling=1 (see Race #1
+			 * description in the comments at the top).
+			 */
+			smp_mb();
+			/*
+			 * Check if we missed stall recorded by hotpath while
+			 * polling flag was set to 1 causing hotpath to skip
+			 * entering polling mode
+			 */
+			goto retry;
+		}
+	} else {
+		if (!polling) {
+			/*
+			 * This can happen as a fixup in the retry cycle after
+			 * new stall is discovered
+			 */
+			polling = 1;
+			atomic_set(&group->polling, polling);
+		}
+	}
+	/*
+	 * At this point group->polling race with hotpath is resolved and
+	 * we rely on local polling flag ignoring possible further changes
+	 * to group->polling
+	 */
+
+	nonidle = (changed_states & (1 << PSI_NONIDLE));
 	/*
 	 * If there is task activity, periodically fold the per-cpu
 	 * times and feed samples into the running averages. If things
@@ -383,18 +637,34 @@ static void psi_update_work(struct work_struct *work)
 	 * Once restarted, we'll catch up the running averages in one
 	 * go - see calc_avgs() and missed_periods.
 	 */
+	if (nonidle && first_pass) {
+		if (now >= group->avg_next_update)
+			group->avg_next_update = update_averages(group, now);
 
-	nonidle = update_stats(group);
-
-	if (nonidle) {
-		unsigned long delay = 0;
-		u64 now;
-
-		now = sched_clock();
-		if (group->next_update > now)
-			delay = nsecs_to_jiffies(group->next_update - now) + 1;
-		schedule_delayed_work(dwork, delay);
+		if (now >= group->polling_next_update) {
+			group->polling_next_update = update_triggers(
+					group, now);
+		}
 	}
+	if ((nonidle && first_pass) || polling) {
+		/* Calculate closest update time */
+		next_update = min(group->polling_next_update,
+					group->avg_next_update);
+		mod_delayed_work(system_wq, dwork, nsecs_to_jiffies(
+				next_update - now) + 1);
+		if (!polling) {
+			/*
+			 * We might have overwritten an immediate update
+			 * scheduled from the hotpath with a longer regular
+			 * update (group->avg_next_update). Execute second pass
+			 * retry to discover that and resume polling.
+			 */
+			first_pass = false;
+			goto retry;
+		}
+	}
+
+	mutex_unlock(&group->update_lock);
 }
 
 static void record_times(struct psi_group_cpu *groupc, int cpu,
@@ -407,15 +677,15 @@ static void record_times(struct psi_group_cpu *groupc, int cpu,
 	delta = now - groupc->state_start;
 	groupc->state_start = now;
 
-	if (test_state(groupc->tasks, PSI_IO_SOME)) {
+	if (groupc->state_mask & (1 << PSI_IO_SOME)) {
 		groupc->times[PSI_IO_SOME] += delta;
-		if (test_state(groupc->tasks, PSI_IO_FULL))
+		if (groupc->state_mask & (1 << PSI_IO_FULL))
 			groupc->times[PSI_IO_FULL] += delta;
 	}
 
-	if (test_state(groupc->tasks, PSI_MEM_SOME)) {
+	if (groupc->state_mask & (1 << PSI_MEM_SOME)) {
 		groupc->times[PSI_MEM_SOME] += delta;
-		if (test_state(groupc->tasks, PSI_MEM_FULL))
+		if (groupc->state_mask & (1 << PSI_MEM_FULL))
 			groupc->times[PSI_MEM_FULL] += delta;
 		else if (memstall_tick) {
 			u32 sample;
@@ -436,18 +706,20 @@ static void record_times(struct psi_group_cpu *groupc, int cpu,
 		}
 	}
 
-	if (test_state(groupc->tasks, PSI_CPU_SOME))
+	if (groupc->state_mask & (1 << PSI_CPU_SOME))
 		groupc->times[PSI_CPU_SOME] += delta;
 
-	if (test_state(groupc->tasks, PSI_NONIDLE))
+	if (groupc->state_mask & (1 << PSI_NONIDLE))
 		groupc->times[PSI_NONIDLE] += delta;
 }
 
-static void psi_group_change(struct psi_group *group, int cpu,
+static u32 psi_group_change(struct psi_group *group, int cpu,
 			     unsigned int clear, unsigned int set)
 {
 	struct psi_group_cpu *groupc;
 	unsigned int t, m;
+	enum psi_states s;
+	u32 state_mask = 0;
 
 	groupc = per_cpu_ptr(group->pcpu, cpu);
 
@@ -480,7 +752,16 @@ static void psi_group_change(struct psi_group *group, int cpu,
 		if (set & (1 << t))
 			groupc->tasks[t]++;
 
+	/* Calculate state mask representing active states */
+	for (s = 0; s < NR_PSI_STATES; s++) {
+		if (test_state(groupc->tasks, s))
+			state_mask |= (1 << s);
+	}
+	groupc->state_mask = state_mask;
+
 	write_seqcount_end(&groupc->seq);
+
+	return state_mask;
 }
 
 static struct psi_group *iterate_groups(struct task_struct *task, void **iter)
@@ -541,7 +822,27 @@ void psi_task_change(struct task_struct *task, int clear, int set)
 		wake_clock = false;
 
 	while ((group = iterate_groups(task, &iter))) {
-		psi_group_change(group, cpu, clear, set);
+		u32 state_mask = psi_group_change(group, cpu, clear, set);
+
+		/*
+		 * Polling flag resets to 0 at the max rate of once per update
+		 * window (at least 500ms interval). smp_wmb is required after
+		 * group->polling 0-to-1 transition to order groupc->times and
+		 * group->polling writes because stall detection logic in the
+		 * slowpath relies on groupc->times changing before
+		 * group->polling. Explicit smp_wmb is missing because cmpxchg()
+		 * implies smp_mb.
+		 */
+		if ((state_mask & group->trigger_states) &&
+			atomic_cmpxchg(&group->polling, 0, 1) == 0) {
+			/*
+			 * Start polling immediately even if the work is already
+			 * scheduled
+			 */
+			mod_delayed_work(system_wq, &group->clock_work, 1);
+			continue;
+		}
+
 		if (wake_clock && !delayed_work_pending(&group->clock_work))
 			schedule_delayed_work(&group->clock_work, PSI_FREQ);
 	}
@@ -642,6 +943,8 @@ void psi_cgroup_free(struct cgroup *cgroup)
 
 	cancel_delayed_work_sync(&cgroup->psi.clock_work);
 	free_percpu(cgroup->psi.pcpu);
+	/* All triggers must be removed by now by psi_trigger_destroy */
+	WARN_ONCE(cgroup->psi.trigger_states, "psi: trigger leak\n");
 }
 
 /**
@@ -701,7 +1004,11 @@ int psi_show(struct seq_file *m, struct psi_group *group, enum psi_res res)
 	if (static_branch_likely(&psi_disabled))
 		return -EOPNOTSUPP;
 
-	update_stats(group);
+	/* Update averages before reporting them */
+	mutex_lock(&group->update_lock);
+	collect_percpu_times(group, NULL);
+	update_averages(group, sched_clock());
+	mutex_unlock(&group->update_lock);
 
 	for (full = 0; full < 2 - (res == PSI_CPU); full++) {
 		unsigned long avg[3];
@@ -753,25 +1060,223 @@ static int psi_cpu_open(struct inode *inode, struct file *file)
 	return single_open(file, psi_cpu_show, NULL);
 }
 
+struct psi_trigger *psi_trigger_create(struct psi_group *group,
+			char *buf, size_t nbytes, enum psi_res res)
+{
+	struct psi_trigger *t;
+	enum psi_states state;
+	u32 threshold_us;
+	u32 window_us;
+
+	if (static_branch_likely(&psi_disabled))
+		return ERR_PTR(-EOPNOTSUPP);
+
+	if (sscanf(buf, "some %u %u", &threshold_us, &window_us) == 2)
+		state = PSI_IO_SOME + res * 2;
+	else if (sscanf(buf, "full %u %u", &threshold_us, &window_us) == 2)
+		state = PSI_IO_FULL + res * 2;
+	else
+		return ERR_PTR(-EINVAL);
+
+	if (state >= PSI_NONIDLE)
+		return ERR_PTR(-EINVAL);
+
+	if (window_us < WINDOW_MIN_US ||
+		window_us > WINDOW_MAX_US)
+		return ERR_PTR(-EINVAL);
+
+	/* Check threshold */
+	if (threshold_us == 0 || threshold_us > window_us)
+		return ERR_PTR(-EINVAL);
+
+	t = kmalloc(sizeof(*t), GFP_KERNEL);
+	if (!t)
+		return ERR_PTR(-ENOMEM);
+
+	t->group = group;
+	t->state = state;
+	t->threshold = threshold_us * NSEC_PER_USEC;
+	t->win.size = window_us * NSEC_PER_USEC;
+	window_reset(&t->win, 0, 0, 0);
+
+	t->event = 0;
+	t->last_event_time = 0;
+	init_waitqueue_head(&t->event_wait);
+
+	mutex_lock(&group->update_lock);
+
+	list_add(&t->node, &group->triggers);
+	group->trigger_min_period = min(group->trigger_min_period,
+		div_u64(t->win.size, UPDATES_PER_WINDOW));
+	group->nr_triggers[t->state]++;
+	group->trigger_states |= (1 << t->state);
+
+	mutex_unlock(&group->update_lock);
+
+	return t;
+}
+
+void psi_trigger_destroy(struct psi_trigger *t)
+{
+	struct psi_group *group = t->group;
+
+	if (static_branch_likely(&psi_disabled))
+		return;
+
+	mutex_lock(&group->update_lock);
+	if (!list_empty(&t->node)) {
+		struct psi_trigger *tmp;
+		u64 period = ULLONG_MAX;
+
+		list_del(&t->node);
+		group->nr_triggers[t->state]--;
+		if (!group->nr_triggers[t->state])
+			group->trigger_states &= ~(1 << t->state);
+		/* reset min update period for the remaining triggers */
+		list_for_each_entry(tmp, &group->triggers, node) {
+			period = min(period, div_u64(tmp->win.size,
+					UPDATES_PER_WINDOW));
+		}
+		group->trigger_min_period = period;
+		/*
+		 * Wakeup waiters to stop polling.
+		 * Can happen if cgroup is deleted from under
+		 * a polling process.
+		 */
+		wake_up_interruptible(&t->event_wait);
+		kfree(t);
+	}
+	mutex_unlock(&group->update_lock);
+}
+
+__poll_t psi_trigger_poll(struct psi_trigger *t,
+				struct file *file, poll_table *wait)
+{
+	if (static_branch_likely(&psi_disabled))
+		return DEFAULT_POLLMASK | EPOLLERR | EPOLLPRI;
+
+	poll_wait(file, &t->event_wait, wait);
+
+	if (cmpxchg(&t->event, 1, 0) == 1)
+		return DEFAULT_POLLMASK | EPOLLPRI;
+
+	/* Wait */
+	return DEFAULT_POLLMASK;
+}
+
+static ssize_t psi_write(struct file *file, const char __user *user_buf,
+				size_t nbytes, enum psi_res res)
+{
+	char buf[32];
+	size_t buf_size;
+	struct seq_file *seq;
+	struct psi_trigger *old;
+	struct psi_trigger *new;
+
+	if (static_branch_likely(&psi_disabled))
+		return -EOPNOTSUPP;
+
+	buf_size = min(nbytes, (sizeof(buf) - 1));
+	if (copy_from_user(buf, user_buf, buf_size))
+		return -EFAULT;
+
+	buf[buf_size - 1] = '\0';
+
+	new = psi_trigger_create(&psi_system, buf, nbytes, res);
+	if (IS_ERR(new))
+		return PTR_ERR(new);
+
+	seq = file->private_data;
+	/* Take seq->lock to protect seq->private from concurrent writes */
+	mutex_lock(&seq->lock);
+	old = seq->private;
+	rcu_assign_pointer(seq->private, new);
+	mutex_unlock(&seq->lock);
+
+	if (old) {
+		synchronize_rcu();
+		psi_trigger_destroy(old);
+	}
+
+	return nbytes;
+}
+
+static ssize_t psi_io_write(struct file *file,
+		const char __user *user_buf, size_t nbytes, loff_t *ppos)
+{
+	return psi_write(file, user_buf, nbytes, PSI_IO);
+}
+
+static ssize_t psi_memory_write(struct file *file,
+		const char __user *user_buf, size_t nbytes, loff_t *ppos)
+{
+	return psi_write(file, user_buf, nbytes, PSI_MEM);
+}
+
+static ssize_t psi_cpu_write(struct file *file,
+		const char __user *user_buf, size_t nbytes, loff_t *ppos)
+{
+	return psi_write(file, user_buf, nbytes, PSI_CPU);
+}
+
+static __poll_t psi_fop_poll(struct file *file, poll_table *wait)
+{
+	struct seq_file *seq = file->private_data;
+	struct psi_trigger *t;
+	__poll_t ret;
+
+	rcu_read_lock();
+	t = rcu_dereference_raw(seq->private);
+	if (t)
+		ret = psi_trigger_poll(t, file, wait);
+	else
+		ret = DEFAULT_POLLMASK | EPOLLERR | EPOLLPRI;
+	rcu_read_unlock();
+
+	return ret;
+
+}
+
+static int psi_fop_release(struct inode *inode, struct file *file)
+{
+	struct seq_file *seq = file->private_data;
+	struct psi_trigger *t = seq->private;
+
+	if (static_branch_likely(&psi_disabled) || !t)
+		goto out;
+
+	rcu_assign_pointer(seq->private, NULL);
+	synchronize_rcu();
+	psi_trigger_destroy(t);
+out:
+	return single_release(inode, file);
+}
+
 static const struct file_operations psi_io_fops = {
 	.open           = psi_io_open,
 	.read           = seq_read,
 	.llseek         = seq_lseek,
-	.release        = single_release,
+	.write          = psi_io_write,
+	.poll           = psi_fop_poll,
+	.release        = psi_fop_release,
 };
 
 static const struct file_operations psi_memory_fops = {
 	.open           = psi_memory_open,
 	.read           = seq_read,
 	.llseek         = seq_lseek,
-	.release        = single_release,
+	.write          = psi_memory_write,
+	.poll           = psi_fop_poll,
+	.release        = psi_fop_release,
 };
 
 static const struct file_operations psi_cpu_fops = {
 	.open           = psi_cpu_open,
 	.read           = seq_read,
 	.llseek         = seq_lseek,
-	.release        = single_release,
+	.write          = psi_cpu_write,
+	.poll           = psi_fop_poll,
+	.release        = psi_fop_release,
 };
 
 static int __init psi_proc_init(void)
diff --git a/kernel/signal.c b/kernel/signal.c
index b7953934aa99..3a9e41197d46 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -3003,7 +3003,7 @@ static bool known_siginfo_layout(unsigned sig, int si_code)
 	if (si_code == SI_KERNEL)
 		return true;
 	else if ((si_code > SI_USER)) {
-		if (sig_specific_sicodes(sig)) {
+		if (sig && sig_specific_sicodes(sig)) {
 			if (si_code <= sig_sicodes[sig].limit)
 				return true;
 		}
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index e5da394d1ca3..b3df3ab7ac28 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2873,8 +2873,10 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int
 			if (neg)
 				continue;
 			val = convmul * val / convdiv;
-			if ((min && val < *min) || (max && val > *max))
-				continue;
+			if ((min && val < *min) || (max && val > *max)) {
+				err = -EINVAL;
+				break;
+			}
 			*i = val;
 		} else {
 			val = convdiv * (*i) / convmul;
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 4026d1871407..56b7cf898f10 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4208,6 +4208,7 @@ static int init_rescuer(struct workqueue_struct *wq)
 	return 0;
 }
 
+__printf(1, 4)
 struct workqueue_struct *alloc_workqueue(const char *fmt,
 					 unsigned int flags,
 					 int max_active, ...)
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 0d9e81779e37..6f5f6bef41d3 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -2077,6 +2077,12 @@ config IO_STRICT_DEVMEM
 
 	  If in doubt, say Y.
 
+config DEBUG_AID_FOR_SYZBOT
+       bool "Additional debug code for syzbot"
+       default n
+       help
+         This option is intended for testing by syzbot.
+
 source "arch/$(SRCARCH)/Kconfig.debug"
 
 endmenu # Kernel hacking
diff --git a/lib/asn1_decoder.c b/lib/asn1_decoder.c
index dc14beae2c9a..8f3d207d2b00 100644
--- a/lib/asn1_decoder.c
+++ b/lib/asn1_decoder.c
@@ -385,6 +385,8 @@ int asn1_ber_decoder(const struct asn1_decoder *decoder,
 	case ASN1_OP_END_SET_ACT:
 		if (unlikely(!(flags & FLAG_MATCHED)))
 			goto tag_mismatch;
+		/* fall through */
+
 	case ASN1_OP_END_SEQ:
 	case ASN1_OP_END_SET_OF:
 	case ASN1_OP_END_SEQ_OF:
@@ -450,6 +452,8 @@ int asn1_ber_decoder(const struct asn1_decoder *decoder,
 			pc += asn1_op_lengths[op];
 			goto next_op;
 		}
+		/* fall through */
+
 	case ASN1_OP_ACT:
 		ret = actions[machine[pc + 1]](context, hdr, tag, data + tdp, len);
 		if (ret < 0)
diff --git a/lib/cmdline.c b/lib/cmdline.c
index 171c19b6888e..dc59d6216318 100644
--- a/lib/cmdline.c
+++ b/lib/cmdline.c
@@ -135,18 +135,23 @@ unsigned long long memparse(const char *ptr, char **retptr)
 	case 'E':
 	case 'e':
 		ret <<= 10;
+		/* fall through */
 	case 'P':
 	case 'p':
 		ret <<= 10;
+		/* fall through */
 	case 'T':
 	case 't':
 		ret <<= 10;
+		/* fall through */
 	case 'G':
 	case 'g':
 		ret <<= 10;
+		/* fall through */
 	case 'M':
 	case 'm':
 		ret <<= 10;
+		/* fall through */
 	case 'K':
 	case 'k':
 		ret <<= 10;
diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 55437fd5128b..1546a3c00709 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -375,6 +375,7 @@ __debug_object_init(void *addr, struct debug_obj_descr *descr, int onstack)
 	struct debug_bucket *db;
 	struct debug_obj *obj;
 	unsigned long flags;
+	bool check_object_on_stack = false;
 
 	fill_pool();
 
@@ -391,7 +392,7 @@ __debug_object_init(void *addr, struct debug_obj_descr *descr, int onstack)
 			debug_objects_oom();
 			return;
 		}
-		debug_object_is_on_stack(addr, onstack);
+		check_object_on_stack = true;
 	}
 
 	switch (obj->state) {
@@ -402,20 +403,24 @@ __debug_object_init(void *addr, struct debug_obj_descr *descr, int onstack)
 		break;
 
 	case ODEBUG_STATE_ACTIVE:
-		debug_print_object(obj, "init");
 		state = obj->state;
 		raw_spin_unlock_irqrestore(&db->lock, flags);
+		debug_print_object(obj, "init");
 		debug_object_fixup(descr->fixup_init, addr, state);
 		return;
 
 	case ODEBUG_STATE_DESTROYED:
+		raw_spin_unlock_irqrestore(&db->lock, flags);
 		debug_print_object(obj, "init");
-		break;
+		return;
 	default:
 		break;
 	}
 
 	raw_spin_unlock_irqrestore(&db->lock, flags);
+	if (check_object_on_stack)
+		debug_object_is_on_stack(addr, onstack);
+
 }
 
 /**
@@ -473,33 +478,34 @@ int debug_object_activate(void *addr, struct debug_obj_descr *descr)
 
 	obj = lookup_object(addr, db);
 	if (obj) {
+		ret = 0;
 		switch (obj->state) {
 		case ODEBUG_STATE_INIT:
 		case ODEBUG_STATE_INACTIVE:
 			obj->state = ODEBUG_STATE_ACTIVE;
-			ret = 0;
 			break;
 
 		case ODEBUG_STATE_ACTIVE:
-			debug_print_object(obj, "activate");
 			state = obj->state;
 			raw_spin_unlock_irqrestore(&db->lock, flags);
+			debug_print_object(obj, "activate");
 			ret = debug_object_fixup(descr->fixup_activate, addr, state);
 			return ret ? 0 : -EINVAL;
 
 		case ODEBUG_STATE_DESTROYED:
-			debug_print_object(obj, "activate");
 			ret = -EINVAL;
 			break;
 		default:
-			ret = 0;
 			break;
 		}
 		raw_spin_unlock_irqrestore(&db->lock, flags);
+		if (ret)
+			debug_print_object(obj, "activate");
 		return ret;
 	}
 
 	raw_spin_unlock_irqrestore(&db->lock, flags);
+
 	/*
 	 * We are here when a static object is activated. We
 	 * let the type specific code confirm whether this is
@@ -548,24 +554,30 @@ void debug_object_deactivate(void *addr, struct debug_obj_descr *descr)
 			if (!obj->astate)
 				obj->state = ODEBUG_STATE_INACTIVE;
 			else
-				debug_print_object(obj, "deactivate");
+				goto out_unlock_print;
 			break;
 
 		case ODEBUG_STATE_DESTROYED:
-			debug_print_object(obj, "deactivate");
-			break;
+			goto out_unlock_print;
+
 		default:
 			break;
 		}
-	} else {
+	}
+
+	raw_spin_unlock_irqrestore(&db->lock, flags);
+	if (!obj) {
 		struct debug_obj o = { .object = addr,
 				       .state = ODEBUG_STATE_NOTAVAILABLE,
 				       .descr = descr };
 
 		debug_print_object(&o, "deactivate");
 	}
+	return;
 
+out_unlock_print:
 	raw_spin_unlock_irqrestore(&db->lock, flags);
+	debug_print_object(obj, "deactivate");
 }
 EXPORT_SYMBOL_GPL(debug_object_deactivate);
 
@@ -599,15 +611,16 @@ void debug_object_destroy(void *addr, struct debug_obj_descr *descr)
 		obj->state = ODEBUG_STATE_DESTROYED;
 		break;
 	case ODEBUG_STATE_ACTIVE:
-		debug_print_object(obj, "destroy");
 		state = obj->state;
 		raw_spin_unlock_irqrestore(&db->lock, flags);
+		debug_print_object(obj, "destroy");
 		debug_object_fixup(descr->fixup_destroy, addr, state);
 		return;
 
 	case ODEBUG_STATE_DESTROYED:
+		raw_spin_unlock_irqrestore(&db->lock, flags);
 		debug_print_object(obj, "destroy");
-		break;
+		return;
 	default:
 		break;
 	}
@@ -641,9 +654,9 @@ void debug_object_free(void *addr, struct debug_obj_descr *descr)
 
 	switch (obj->state) {
 	case ODEBUG_STATE_ACTIVE:
-		debug_print_object(obj, "free");
 		state = obj->state;
 		raw_spin_unlock_irqrestore(&db->lock, flags);
+		debug_print_object(obj, "free");
 		debug_object_fixup(descr->fixup_free, addr, state);
 		return;
 	default:
@@ -731,22 +744,27 @@ debug_object_active_state(void *addr, struct debug_obj_descr *descr,
 			if (obj->astate == expect)
 				obj->astate = next;
 			else
-				debug_print_object(obj, "active_state");
+				goto out_unlock_print;
 			break;
 
 		default:
-			debug_print_object(obj, "active_state");
-			break;
+			goto out_unlock_print;
 		}
-	} else {
+	}
+
+	raw_spin_unlock_irqrestore(&db->lock, flags);
+	if (!obj) {
 		struct debug_obj o = { .object = addr,
 				       .state = ODEBUG_STATE_NOTAVAILABLE,
 				       .descr = descr };
 
 		debug_print_object(&o, "active_state");
 	}
+	return;
 
+out_unlock_print:
 	raw_spin_unlock_irqrestore(&db->lock, flags);
+	debug_print_object(obj, "active_state");
 }
 EXPORT_SYMBOL_GPL(debug_object_active_state);
 
@@ -782,10 +800,10 @@ static void __debug_check_no_obj_freed(const void *address, unsigned long size)
 
 			switch (obj->state) {
 			case ODEBUG_STATE_ACTIVE:
-				debug_print_object(obj, "free");
 				descr = obj->descr;
 				state = obj->state;
 				raw_spin_unlock_irqrestore(&db->lock, flags);
+				debug_print_object(obj, "free");
 				debug_object_fixup(descr->fixup_free,
 						   (void *) oaddr, state);
 				goto repeat;
@@ -978,19 +996,24 @@ check_results(void *addr, enum debug_obj_state state, int fixups, int warnings)
 	struct debug_obj *obj;
 	unsigned long flags;
 	int res = -EINVAL;
+	enum debug_obj_state obj_state;
 
 	db = get_bucket((unsigned long) addr);
 
 	raw_spin_lock_irqsave(&db->lock, flags);
 
 	obj = lookup_object(addr, db);
+	obj_state = obj ? obj->state : state;
+
+	raw_spin_unlock_irqrestore(&db->lock, flags);
+
 	if (!obj && state != ODEBUG_STATE_NONE) {
 		WARN(1, KERN_ERR "ODEBUG: selftest object not found\n");
 		goto out;
 	}
-	if (obj && obj->state != state) {
+	if (obj_state != state) {
 		WARN(1, KERN_ERR "ODEBUG: selftest wrong state: %d != %d\n",
-		       obj->state, state);
+		       obj_state, state);
 		goto out;
 	}
 	if (fixups != debug_objects_fixups) {
@@ -1005,7 +1028,6 @@ check_results(void *addr, enum debug_obj_state state, int fixups, int warnings)
 	}
 	res = 0;
 out:
-	raw_spin_unlock_irqrestore(&db->lock, flags);
 	if (res)
 		debug_objects_enabled = 0;
 	return res;
diff --git a/lib/genalloc.c b/lib/genalloc.c
index 7e85d1e37a6e..2e45b3a94313 100644
--- a/lib/genalloc.c
+++ b/lib/genalloc.c
@@ -424,7 +424,7 @@ void gen_pool_for_each_chunk(struct gen_pool *pool,
 EXPORT_SYMBOL(gen_pool_for_each_chunk);
 
 /**
- * addr_in_gen_pool - checks if an address falls within the range of a pool
+ * gen_pool_has_addr - checks if an address falls within the range of a pool
  * @pool:	the generic memory pool
  * @start:	start address
  * @size:	size of the region
@@ -432,7 +432,7 @@ EXPORT_SYMBOL(gen_pool_for_each_chunk);
  * Check if the range of addresses falls within the specified pool. Returns
  * true if the entire range is contained in the pool and false otherwise.
  */
-bool addr_in_gen_pool(struct gen_pool *pool, unsigned long start,
+bool gen_pool_has_addr(struct gen_pool *pool, unsigned long start,
 			size_t size)
 {
 	bool found = false;
@@ -451,6 +451,7 @@ bool addr_in_gen_pool(struct gen_pool *pool, unsigned long start,
 	rcu_read_unlock();
 	return found;
 }
+EXPORT_SYMBOL(gen_pool_has_addr);
 
 /**
  * gen_pool_avail - get available free space of the pool
diff --git a/lib/zstd/bitstream.h b/lib/zstd/bitstream.h
index a826b99e1d63..3a49784d5c61 100644
--- a/lib/zstd/bitstream.h
+++ b/lib/zstd/bitstream.h
@@ -259,10 +259,15 @@ ZSTD_STATIC size_t BIT_initDStream(BIT_DStream_t *bitD, const void *srcBuffer, s
 		bitD->bitContainer = *(const BYTE *)(bitD->start);
 		switch (srcSize) {
 		case 7: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[6]) << (sizeof(bitD->bitContainer) * 8 - 16);
+			/* fall through */
 		case 6: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[5]) << (sizeof(bitD->bitContainer) * 8 - 24);
+			/* fall through */
 		case 5: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[4]) << (sizeof(bitD->bitContainer) * 8 - 32);
+			/* fall through */
 		case 4: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[3]) << 24;
+			/* fall through */
 		case 3: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[2]) << 16;
+			/* fall through */
 		case 2: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[1]) << 8;
 		default:;
 		}
diff --git a/lib/zstd/compress.c b/lib/zstd/compress.c
index f9166cf4f7a9..5e0b67003e55 100644
--- a/lib/zstd/compress.c
+++ b/lib/zstd/compress.c
@@ -3182,6 +3182,7 @@ static size_t ZSTD_compressStream_generic(ZSTD_CStream *zcs, void *dst, size_t *
 				zcs->outBuffFlushedSize = 0;
 				zcs->stage = zcss_flush; /* pass-through to flush stage */
 			}
+			/* fall through */
 
 		case zcss_flush: {
 			size_t const toFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize;
diff --git a/lib/zstd/decompress.c b/lib/zstd/decompress.c
index b17846725ca0..269ee9a796c1 100644
--- a/lib/zstd/decompress.c
+++ b/lib/zstd/decompress.c
@@ -1768,6 +1768,7 @@ size_t ZSTD_decompressContinue(ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, c
 			return 0;
 		}
 		dctx->expected = 0; /* not necessary to copy more */
+		/* fall through */
 
 	case ZSTDds_decodeFrameHeader:
 		memcpy(dctx->headerBuffer + ZSTD_frameHeaderSize_prefix, src, dctx->expected);
@@ -2375,7 +2376,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB
 			}
 			zds->stage = zdss_read;
 		}
-		/* pass-through */
+		/* fall through */
 
 		case zdss_read: {
 			size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds->dctx);
@@ -2404,6 +2405,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB
 			zds->stage = zdss_load;
 			/* pass-through */
 		}
+		/* fall through */
 
 		case zdss_load: {
 			size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds->dctx);
@@ -2436,6 +2438,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB
 				/* pass-through */
 			}
 		}
+		/* fall through */
 
 		case zdss_flush: {
 			size_t const toFlushSize = zds->outEnd - zds->outStart;
diff --git a/lib/zstd/huf_compress.c b/lib/zstd/huf_compress.c
index 40055a7016e6..e727812d12aa 100644
--- a/lib/zstd/huf_compress.c
+++ b/lib/zstd/huf_compress.c
@@ -556,7 +556,9 @@ size_t HUF_compress1X_usingCTable(void *dst, size_t dstSize, const void *src, si
 	n = srcSize & ~3; /* join to mod 4 */
 	switch (srcSize & 3) {
 	case 3: HUF_encodeSymbol(&bitC, ip[n + 2], CTable); HUF_FLUSHBITS_2(&bitC);
+		/* fall through */
 	case 2: HUF_encodeSymbol(&bitC, ip[n + 1], CTable); HUF_FLUSHBITS_1(&bitC);
+		/* fall through */
 	case 1: HUF_encodeSymbol(&bitC, ip[n + 0], CTable); HUF_FLUSHBITS(&bitC);
 	case 0:
 	default:;
diff --git a/localversion-next b/localversion-next
new file mode 100644
index 000000000000..e7b212765130
--- /dev/null
+++ b/localversion-next
@@ -0,0 +1 @@
+-next-20190318
diff --git a/mm/Kconfig b/mm/Kconfig
index 25c71eb8a7db..7e537ec7aea3 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -695,6 +695,7 @@ config DEV_PAGEMAP_OPS
 config HMM
 	bool
 	select MIGRATE_VMA_HELPER
+	select MMU_NOTIFIER
 
 config HMM_MIRROR
 	bool "HMM mirror CPU page table into a device page table"
diff --git a/mm/Makefile b/mm/Makefile
index d210cc9d6f80..ac5e5ba78874 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -33,7 +33,7 @@ mmu-$(CONFIG_MMU)	+= process_vm_access.o
 endif
 
 obj-y			:= filemap.o mempool.o oom_kill.o fadvise.o \
-			   maccess.o page_alloc.o page-writeback.o \
+			   maccess.o page-writeback.o \
 			   readahead.o swap.o truncate.o vmscan.o shmem.o \
 			   util.o mmzone.o vmstat.o backing-dev.o \
 			   mm_init.o mmu_context.o percpu.o slab_common.o \
@@ -41,6 +41,11 @@ obj-y			:= filemap.o mempool.o oom_kill.o fadvise.o \
 			   interval_tree.o list_lru.o workingset.o \
 			   debug.o $(mmu-y)
 
+# Give 'page_alloc' its own module-parameter namespace
+page-alloc-y := page_alloc.o
+page-alloc-$(CONFIG_SHUFFLE_PAGE_ALLOCATOR) += shuffle.o
+
+obj-y += page-alloc.o
 obj-y += init-mm.o
 obj-y += memblock.o
 
diff --git a/mm/compaction.c b/mm/compaction.c
index f171a83707ce..b2d02aba41d8 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1879,13 +1879,13 @@ static enum compact_result __compact_finished(struct compact_control *cc)
 		bool can_steal;
 
 		/* Job done if page is free of the right migratetype */
-		if (!list_empty(&area->free_list[migratetype]))
+		if (!free_area_empty(area, migratetype))
 			return COMPACT_SUCCESS;
 
 #ifdef CONFIG_CMA
 		/* MIGRATE_MOVABLE can fallback on MIGRATE_CMA */
 		if (migratetype == MIGRATE_MOVABLE &&
-			!list_empty(&area->free_list[MIGRATE_CMA]))
+			!free_area_empty(area, MIGRATE_CMA))
 			return COMPACT_SUCCESS;
 #endif
 		/*
diff --git a/mm/hmm.c b/mm/hmm.c
index fe1cd87e49ac..c1cbe82d12b5 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -30,6 +30,7 @@
 #include <linux/hugetlb.h>
 #include <linux/memremap.h>
 #include <linux/jump_label.h>
+#include <linux/dma-mapping.h>
 #include <linux/mmu_notifier.h>
 #include <linux/memory_hotplug.h>
 
@@ -38,24 +39,15 @@
 #if IS_ENABLED(CONFIG_HMM_MIRROR)
 static const struct mmu_notifier_ops hmm_mmu_notifier_ops;
 
-/*
- * struct hmm - HMM per mm struct
- *
- * @mm: mm struct this HMM struct is bound to
- * @lock: lock protecting ranges list
- * @ranges: list of range being snapshotted
- * @mirrors: list of mirrors for this mm
- * @mmu_notifier: mmu notifier to track updates to CPU page table
- * @mirrors_sem: read/write semaphore protecting the mirrors list
- */
-struct hmm {
-	struct mm_struct	*mm;
-	spinlock_t		lock;
-	struct list_head	ranges;
-	struct list_head	mirrors;
-	struct mmu_notifier	mmu_notifier;
-	struct rw_semaphore	mirrors_sem;
-};
+static inline struct hmm *hmm_get(struct mm_struct *mm)
+{
+	struct hmm *hmm = READ_ONCE(mm->hmm);
+
+	if (hmm && kref_get_unless_zero(&hmm->kref))
+		return hmm;
+
+	return NULL;
+}
 
 /*
  * hmm_register - register HMM against an mm (HMM internal)
@@ -67,25 +59,24 @@ struct hmm {
  */
 static struct hmm *hmm_register(struct mm_struct *mm)
 {
-	struct hmm *hmm = READ_ONCE(mm->hmm);
+	struct hmm *hmm = hmm_get(mm);
 	bool cleanup = false;
 
-	/*
-	 * The hmm struct can only be freed once the mm_struct goes away,
-	 * hence we should always have pre-allocated an new hmm struct
-	 * above.
-	 */
 	if (hmm)
 		return hmm;
 
 	hmm = kmalloc(sizeof(*hmm), GFP_KERNEL);
 	if (!hmm)
 		return NULL;
+	init_waitqueue_head(&hmm->wq);
 	INIT_LIST_HEAD(&hmm->mirrors);
 	init_rwsem(&hmm->mirrors_sem);
 	hmm->mmu_notifier.ops = NULL;
 	INIT_LIST_HEAD(&hmm->ranges);
-	spin_lock_init(&hmm->lock);
+	mutex_init(&hmm->lock);
+	kref_init(&hmm->kref);
+	hmm->notifiers = 0;
+	hmm->dead = false;
 	hmm->mm = mm;
 
 	spin_lock(&mm->page_table_lock);
@@ -106,7 +97,7 @@ static struct hmm *hmm_register(struct mm_struct *mm)
 	if (__mmu_notifier_register(&hmm->mmu_notifier, mm))
 		goto error_mm;
 
-	return mm->hmm;
+	return hmm;
 
 error_mm:
 	spin_lock(&mm->page_table_lock);
@@ -118,54 +109,60 @@ static struct hmm *hmm_register(struct mm_struct *mm)
 	return NULL;
 }
 
-void hmm_mm_destroy(struct mm_struct *mm)
-{
-	kfree(mm->hmm);
-}
-
-static int hmm_invalidate_range(struct hmm *hmm, bool device,
-				const struct hmm_update *update)
+static void hmm_free(struct kref *kref)
 {
-	struct hmm_mirror *mirror;
-	struct hmm_range *range;
+	struct hmm *hmm = container_of(kref, struct hmm, kref);
+	struct mm_struct *mm = hmm->mm;
 
-	spin_lock(&hmm->lock);
-	list_for_each_entry(range, &hmm->ranges, list) {
-		unsigned long addr, idx, npages;
+	mmu_notifier_unregister_no_release(&hmm->mmu_notifier, mm);
 
-		if (update->end < range->start || update->start >= range->end)
-			continue;
+	spin_lock(&mm->page_table_lock);
+	if (mm->hmm == hmm)
+		mm->hmm = NULL;
+	spin_unlock(&mm->page_table_lock);
 
-		range->valid = false;
-		addr = max(update->start, range->start);
-		idx = (addr - range->start) >> PAGE_SHIFT;
-		npages = (min(range->end, update->end) - addr) >> PAGE_SHIFT;
-		memset(&range->pfns[idx], 0, sizeof(*range->pfns) * npages);
-	}
-	spin_unlock(&hmm->lock);
+	kfree(hmm);
+}
 
-	if (!device)
-		return 0;
+static inline void hmm_put(struct hmm *hmm)
+{
+	kref_put(&hmm->kref, hmm_free);
+}
 
-	down_read(&hmm->mirrors_sem);
-	list_for_each_entry(mirror, &hmm->mirrors, list) {
-		int ret;
+void hmm_mm_destroy(struct mm_struct *mm)
+{
+	struct hmm *hmm;
 
-		ret = mirror->ops->sync_cpu_device_pagetables(mirror, update);
-		if (!update->blockable && ret == -EAGAIN) {
-			up_read(&hmm->mirrors_sem);
-			return -EAGAIN;
-		}
+	spin_lock(&mm->page_table_lock);
+	hmm = hmm_get(mm);
+	mm->hmm = NULL;
+	if (hmm) {
+		hmm->mm = NULL;
+		hmm->dead = true;
+		spin_unlock(&mm->page_table_lock);
+		hmm_put(hmm);
+		return;
 	}
-	up_read(&hmm->mirrors_sem);
 
-	return 0;
+	spin_unlock(&mm->page_table_lock);
 }
 
 static void hmm_release(struct mmu_notifier *mn, struct mm_struct *mm)
 {
+	struct hmm *hmm = hmm_get(mm);
 	struct hmm_mirror *mirror;
-	struct hmm *hmm = mm->hmm;
+	struct hmm_range *range;
+
+	/* Report this HMM as dying. */
+	hmm->dead = true;
+
+	/* Wake-up everyone waiting on any range. */
+	mutex_lock(&hmm->lock);
+	list_for_each_entry(range, &hmm->ranges, list) {
+		range->valid = false;
+	}
+	wake_up_all(&hmm->wq);
+	mutex_unlock(&hmm->lock);
 
 	down_write(&hmm->mirrors_sem);
 	mirror = list_first_entry_or_null(&hmm->mirrors, struct hmm_mirror,
@@ -186,36 +183,95 @@ static void hmm_release(struct mmu_notifier *mn, struct mm_struct *mm)
 						  struct hmm_mirror, list);
 	}
 	up_write(&hmm->mirrors_sem);
+
+	hmm_put(hmm);
 }
 
 static int hmm_invalidate_range_start(struct mmu_notifier *mn,
-			const struct mmu_notifier_range *range)
+			const struct mmu_notifier_range *nrange)
 {
+	struct hmm *hmm = hmm_get(nrange->mm);
+	struct hmm_mirror *mirror;
 	struct hmm_update update;
-	struct hmm *hmm = range->mm->hmm;
+	struct hmm_range *range;
+	int ret = 0;
 
 	VM_BUG_ON(!hmm);
 
-	update.start = range->start;
-	update.end = range->end;
+	/* Check if hmm_mm_destroy() was call. */
+	if (hmm->mm == NULL)
+		goto out;
+
+	update.start = nrange->start;
+	update.end = nrange->end;
 	update.event = HMM_UPDATE_INVALIDATE;
-	update.blockable = range->blockable;
-	return hmm_invalidate_range(hmm, true, &update);
+	update.blockable = nrange->blockable;
+
+	if (nrange->blockable)
+		mutex_lock(&hmm->lock);
+	else if (!mutex_trylock(&hmm->lock)) {
+		ret = -EAGAIN;
+		goto out;
+	}
+	hmm->notifiers++;
+	list_for_each_entry(range, &hmm->ranges, list) {
+		if (update.end < range->start || update.start >= range->end)
+			continue;
+
+		range->valid = false;
+	}
+	mutex_unlock(&hmm->lock);
+
+	if (nrange->blockable)
+		down_read(&hmm->mirrors_sem);
+	else if (!down_read_trylock(&hmm->mirrors_sem)) {
+		ret = -EAGAIN;
+		goto out;
+	}
+	list_for_each_entry(mirror, &hmm->mirrors, list) {
+		int ret;
+
+		ret = mirror->ops->sync_cpu_device_pagetables(mirror, &update);
+		if (!update.blockable && ret == -EAGAIN) {
+			up_read(&hmm->mirrors_sem);
+			ret = -EAGAIN;
+			goto out;
+		}
+	}
+	up_read(&hmm->mirrors_sem);
+
+out:
+	hmm_put(hmm);
+	return ret;
 }
 
 static void hmm_invalidate_range_end(struct mmu_notifier *mn,
-			const struct mmu_notifier_range *range)
+			const struct mmu_notifier_range *nrange)
 {
-	struct hmm_update update;
-	struct hmm *hmm = range->mm->hmm;
+	struct hmm *hmm = hmm_get(nrange->mm);
 
 	VM_BUG_ON(!hmm);
 
-	update.start = range->start;
-	update.end = range->end;
-	update.event = HMM_UPDATE_INVALIDATE;
-	update.blockable = true;
-	hmm_invalidate_range(hmm, false, &update);
+	/* Check if hmm_mm_destroy() was call. */
+	if (hmm->mm == NULL)
+		goto out;
+
+	mutex_lock(&hmm->lock);
+	hmm->notifiers--;
+	if (!hmm->notifiers) {
+		struct hmm_range *range;
+
+		list_for_each_entry(range, &hmm->ranges, list) {
+			if (range->valid)
+				continue;
+			range->valid = true;
+		}
+		wake_up_all(&hmm->wq);
+	}
+	mutex_unlock(&hmm->lock);
+
+out:
+	hmm_put(hmm);
 }
 
 static const struct mmu_notifier_ops hmm_mmu_notifier_ops = {
@@ -241,24 +297,13 @@ int hmm_mirror_register(struct hmm_mirror *mirror, struct mm_struct *mm)
 	if (!mm || !mirror || !mirror->ops)
 		return -EINVAL;
 
-again:
 	mirror->hmm = hmm_register(mm);
 	if (!mirror->hmm)
 		return -ENOMEM;
 
 	down_write(&mirror->hmm->mirrors_sem);
-	if (mirror->hmm->mm == NULL) {
-		/*
-		 * A racing hmm_mirror_unregister() is about to destroy the hmm
-		 * struct. Try again to allocate a new one.
-		 */
-		up_write(&mirror->hmm->mirrors_sem);
-		mirror->hmm = NULL;
-		goto again;
-	} else {
-		list_add(&mirror->list, &mirror->hmm->mirrors);
-		up_write(&mirror->hmm->mirrors_sem);
-	}
+	list_add(&mirror->list, &mirror->hmm->mirrors);
+	up_write(&mirror->hmm->mirrors_sem);
 
 	return 0;
 }
@@ -273,38 +318,24 @@ EXPORT_SYMBOL(hmm_mirror_register);
  */
 void hmm_mirror_unregister(struct hmm_mirror *mirror)
 {
-	bool should_unregister = false;
-	struct mm_struct *mm;
-	struct hmm *hmm;
+	struct hmm *hmm = READ_ONCE(mirror->hmm);
 
-	if (mirror->hmm == NULL)
+	if (hmm == NULL)
 		return;
 
-	hmm = mirror->hmm;
 	down_write(&hmm->mirrors_sem);
 	list_del_init(&mirror->list);
-	should_unregister = list_empty(&hmm->mirrors);
+	/* To protect us against double unregister ... */
 	mirror->hmm = NULL;
-	mm = hmm->mm;
-	hmm->mm = NULL;
 	up_write(&hmm->mirrors_sem);
 
-	if (!should_unregister || mm == NULL)
-		return;
-
-	mmu_notifier_unregister_no_release(&hmm->mmu_notifier, mm);
-
-	spin_lock(&mm->page_table_lock);
-	if (mm->hmm == hmm)
-		mm->hmm = NULL;
-	spin_unlock(&mm->page_table_lock);
-
-	kfree(hmm);
+	hmm_put(hmm);
 }
 EXPORT_SYMBOL(hmm_mirror_unregister);
 
 struct hmm_vma_walk {
 	struct hmm_range	*range;
+	struct dev_pagemap	*pgmap;
 	unsigned long		last;
 	bool			fault;
 	bool			block;
@@ -323,13 +354,13 @@ static int hmm_vma_do_fault(struct mm_walk *walk, unsigned long addr,
 	flags |= write_fault ? FAULT_FLAG_WRITE : 0;
 	ret = handle_mm_fault(vma, addr, flags);
 	if (ret & VM_FAULT_RETRY)
-		return -EBUSY;
+		return -EAGAIN;
 	if (ret & VM_FAULT_ERROR) {
 		*pfn = range->values[HMM_PFN_ERROR];
 		return -EFAULT;
 	}
 
-	return -EAGAIN;
+	return -EBUSY;
 }
 
 static int hmm_pfns_bad(unsigned long addr,
@@ -355,7 +386,7 @@ static int hmm_pfns_bad(unsigned long addr,
  * @fault: should we fault or not ?
  * @write_fault: write fault ?
  * @walk: mm_walk structure
- * Returns: 0 on success, -EAGAIN after page fault, or page fault error
+ * Returns: 0 on success, -EBUSY after page fault, or page fault error
  *
  * This function will be called whenever pmd_none() or pte_none() returns true,
  * or whenever there is no page directory covering the virtual address range.
@@ -367,23 +398,25 @@ static int hmm_vma_walk_hole_(unsigned long addr, unsigned long end,
 	struct hmm_vma_walk *hmm_vma_walk = walk->private;
 	struct hmm_range *range = hmm_vma_walk->range;
 	uint64_t *pfns = range->pfns;
-	unsigned long i;
+	unsigned long i, page_size;
 
 	hmm_vma_walk->last = addr;
-	i = (addr - range->start) >> PAGE_SHIFT;
-	for (; addr < end; addr += PAGE_SIZE, i++) {
+	page_size = 1UL << range->page_shift;
+	i = (addr - range->start) >> range->page_shift;
+
+	for (; addr < end; addr += page_size, i++) {
 		pfns[i] = range->values[HMM_PFN_NONE];
 		if (fault || write_fault) {
 			int ret;
 
 			ret = hmm_vma_do_fault(walk, addr, write_fault,
 					       &pfns[i]);
-			if (ret != -EAGAIN)
+			if (ret != -EBUSY)
 				return ret;
 		}
 	}
 
-	return (fault || write_fault) ? -EAGAIN : 0;
+	return (fault || write_fault) ? -EBUSY : 0;
 }
 
 static inline void hmm_pte_need_fault(const struct hmm_vma_walk *hmm_vma_walk,
@@ -392,10 +425,21 @@ static inline void hmm_pte_need_fault(const struct hmm_vma_walk *hmm_vma_walk,
 {
 	struct hmm_range *range = hmm_vma_walk->range;
 
-	*fault = *write_fault = false;
 	if (!hmm_vma_walk->fault)
 		return;
 
+	/*
+	 * So we not only consider the individual per page request we also
+	 * consider the default flags requested for the range. The API can
+	 * be use in 2 fashions. The first one where the HMM user coalesce
+	 * multiple page fault into one request and set flags per pfns for
+	 * of those faults. The second one where the HMM user want to pre-
+	 * fault a range with specific flags. For the latter one it is a
+	 * waste to have the user pre-fill the pfn arrays with a default
+	 * flags value.
+	 */
+	pfns = (pfns & range->pfn_flags_mask) | range->default_flags;
+
 	/* We aren't ask to do anything ... */
 	if (!(pfns & range->flags[HMM_PFN_VALID]))
 		return;
@@ -431,10 +475,11 @@ static void hmm_range_need_fault(const struct hmm_vma_walk *hmm_vma_walk,
 		return;
 	}
 
+	*fault = *write_fault = false;
 	for (i = 0; i < npages; ++i) {
 		hmm_pte_need_fault(hmm_vma_walk, pfns[i], cpu_flags,
 				   fault, write_fault);
-		if ((*fault) || (*write_fault))
+		if ((*write_fault))
 			return;
 	}
 }
@@ -465,6 +510,15 @@ static inline uint64_t pmd_to_hmm_pfn_flags(struct hmm_range *range, pmd_t pmd)
 				range->flags[HMM_PFN_VALID];
 }
 
+static inline uint64_t pud_to_hmm_pfn_flags(struct hmm_range *range, pud_t pud)
+{
+	if (!pud_present(pud))
+		return 0;
+	return pud_write(pud) ? range->flags[HMM_PFN_VALID] |
+				range->flags[HMM_PFN_WRITE] :
+				range->flags[HMM_PFN_VALID];
+}
+
 static int hmm_vma_handle_pmd(struct mm_walk *walk,
 			      unsigned long addr,
 			      unsigned long end,
@@ -486,8 +540,19 @@ static int hmm_vma_handle_pmd(struct mm_walk *walk,
 		return hmm_vma_walk_hole_(addr, end, fault, write_fault, walk);
 
 	pfn = pmd_pfn(pmd) + pte_index(addr);
-	for (i = 0; addr < end; addr += PAGE_SIZE, i++, pfn++)
+	for (i = 0; addr < end; addr += PAGE_SIZE, i++, pfn++) {
+		if (pmd_devmap(pmd)) {
+			hmm_vma_walk->pgmap = get_dev_pagemap(pfn,
+					      hmm_vma_walk->pgmap);
+			if (unlikely(!hmm_vma_walk->pgmap))
+				return -EBUSY;
+		}
 		pfns[i] = hmm_pfn_from_pfn(range, pfn) | cpu_flags;
+	}
+	if (hmm_vma_walk->pgmap) {
+		put_dev_pagemap(hmm_vma_walk->pgmap);
+		hmm_vma_walk->pgmap = NULL;
+	}
 	hmm_vma_walk->last = end;
 	return 0;
 }
@@ -514,11 +579,11 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,
 	uint64_t orig_pfn = *pfn;
 
 	*pfn = range->values[HMM_PFN_NONE];
-	cpu_flags = pte_to_hmm_pfn_flags(range, pte);
-	hmm_pte_need_fault(hmm_vma_walk, orig_pfn, cpu_flags,
-			   &fault, &write_fault);
+	fault = write_fault = false;
 
 	if (pte_none(pte)) {
+		hmm_pte_need_fault(hmm_vma_walk, orig_pfn, 0,
+				   &fault, &write_fault);
 		if (fault || write_fault)
 			goto fault;
 		return 0;
@@ -557,7 +622,7 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,
 				hmm_vma_walk->last = addr;
 				migration_entry_wait(vma->vm_mm,
 						     pmdp, addr);
-				return -EAGAIN;
+				return -EBUSY;
 			}
 			return 0;
 		}
@@ -565,15 +630,33 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,
 		/* Report error for everything else */
 		*pfn = range->values[HMM_PFN_ERROR];
 		return -EFAULT;
+	} else {
+		cpu_flags = pte_to_hmm_pfn_flags(range, pte);
+		hmm_pte_need_fault(hmm_vma_walk, orig_pfn, cpu_flags,
+				   &fault, &write_fault);
 	}
 
 	if (fault || write_fault)
 		goto fault;
 
+	if (pte_devmap(pte)) {
+		hmm_vma_walk->pgmap = get_dev_pagemap(pte_pfn(pte),
+					      hmm_vma_walk->pgmap);
+		if (unlikely(!hmm_vma_walk->pgmap))
+			return -EBUSY;
+	} else if (IS_ENABLED(CONFIG_ARCH_HAS_PTE_SPECIAL) && pte_special(pte)) {
+		*pfn = range->values[HMM_PFN_SPECIAL];
+		return -EFAULT;
+	}
+
 	*pfn = hmm_pfn_from_pfn(range, pte_pfn(pte)) | cpu_flags;
 	return 0;
 
 fault:
+	if (hmm_vma_walk->pgmap) {
+		put_dev_pagemap(hmm_vma_walk->pgmap);
+		hmm_vma_walk->pgmap = NULL;
+	}
 	pte_unmap(ptep);
 	/* Fault any virtual address we were asked to fault */
 	return hmm_vma_walk_hole_(addr, end, fault, write_fault, walk);
@@ -615,7 +698,7 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp,
 		if (fault || write_fault) {
 			hmm_vma_walk->last = addr;
 			pmd_migration_entry_wait(vma->vm_mm, pmdp);
-			return -EAGAIN;
+			return -EBUSY;
 		}
 		return 0;
 	} else if (!pmd_present(pmd))
@@ -661,12 +744,146 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp,
 			return r;
 		}
 	}
+	if (hmm_vma_walk->pgmap) {
+		put_dev_pagemap(hmm_vma_walk->pgmap);
+		hmm_vma_walk->pgmap = NULL;
+	}
 	pte_unmap(ptep - 1);
 
 	hmm_vma_walk->last = addr;
 	return 0;
 }
 
+static int hmm_vma_walk_pud(pud_t *pudp,
+			    unsigned long start,
+			    unsigned long end,
+			    struct mm_walk *walk)
+{
+	struct hmm_vma_walk *hmm_vma_walk = walk->private;
+	struct hmm_range *range = hmm_vma_walk->range;
+	unsigned long addr = start, next;
+	pmd_t *pmdp;
+	pud_t pud;
+	int ret;
+
+again:
+	pud = READ_ONCE(*pudp);
+	if (pud_none(pud))
+		return hmm_vma_walk_hole(start, end, walk);
+
+	if (pud_huge(pud) && pud_devmap(pud)) {
+		unsigned long i, npages, pfn;
+		uint64_t *pfns, cpu_flags;
+		bool fault, write_fault;
+
+		if (!pud_present(pud))
+			return hmm_vma_walk_hole(start, end, walk);
+
+		i = (addr - range->start) >> PAGE_SHIFT;
+		npages = (end - addr) >> PAGE_SHIFT;
+		pfns = &range->pfns[i];
+
+		cpu_flags = pud_to_hmm_pfn_flags(range, pud);
+		hmm_range_need_fault(hmm_vma_walk, pfns, npages,
+				     cpu_flags, &fault, &write_fault);
+		if (fault || write_fault)
+			return hmm_vma_walk_hole_(addr, end, fault,
+						write_fault, walk);
+
+		pfn = pud_pfn(pud) + ((addr & ~PUD_MASK) >> PAGE_SHIFT);
+		for (i = 0; i < npages; ++i, ++pfn) {
+			hmm_vma_walk->pgmap = get_dev_pagemap(pfn,
+					      hmm_vma_walk->pgmap);
+			if (unlikely(!hmm_vma_walk->pgmap))
+				return -EBUSY;
+			pfns[i] = hmm_pfn_from_pfn(range, pfn) | cpu_flags;
+		}
+		if (hmm_vma_walk->pgmap) {
+			put_dev_pagemap(hmm_vma_walk->pgmap);
+			hmm_vma_walk->pgmap = NULL;
+		}
+		hmm_vma_walk->last = end;
+		return 0;
+	}
+
+	split_huge_pud(walk->vma, pudp, addr);
+	if (pud_none(*pudp))
+		goto again;
+
+	pmdp = pmd_offset(pudp, addr);
+	do {
+		next = pmd_addr_end(addr, end);
+		ret = hmm_vma_walk_pmd(pmdp, addr, next, walk);
+		if (ret)
+			return ret;
+	} while (pmdp++, addr = next, addr != end);
+
+	return 0;
+}
+
+static int hmm_vma_walk_hugetlb_entry(pte_t *pte, unsigned long hmask,
+				      unsigned long start, unsigned long end,
+				      struct mm_walk *walk)
+{
+#ifdef CONFIG_HUGETLB_PAGE
+	unsigned long addr = start, i, pfn, mask, size, pfn_inc;
+	struct hmm_vma_walk *hmm_vma_walk = walk->private;
+	struct hmm_range *range = hmm_vma_walk->range;
+	struct vm_area_struct *vma = walk->vma;
+	struct hstate *h = hstate_vma(vma);
+	uint64_t orig_pfn, cpu_flags;
+	bool fault, write_fault;
+	spinlock_t *ptl;
+	pte_t entry;
+	int ret = 0;
+
+	size = 1UL << huge_page_shift(h);
+	mask = size - 1;
+	if (range->page_shift != PAGE_SHIFT) {
+		/* Make sure we are looking at full page. */
+		if (start & mask)
+			return -EINVAL;
+		if (end < (start + size))
+			return -EINVAL;
+		pfn_inc = size >> PAGE_SHIFT;
+	} else {
+		pfn_inc = 1;
+		size = PAGE_SIZE;
+	}
+
+
+	ptl = huge_pte_lock(hstate_vma(walk->vma), walk->mm, pte);
+	entry = huge_ptep_get(pte);
+
+	i = (start - range->start) >> range->page_shift;
+	orig_pfn = range->pfns[i];
+	range->pfns[i] = range->values[HMM_PFN_NONE];
+	cpu_flags = pte_to_hmm_pfn_flags(range, entry);
+	fault = write_fault = false;
+	hmm_pte_need_fault(hmm_vma_walk, orig_pfn, cpu_flags,
+			   &fault, &write_fault);
+	if (fault || write_fault) {
+		ret = -ENOENT;
+		goto unlock;
+	}
+
+	pfn = pte_pfn(entry) + (start & mask);
+	for (; addr < end; addr += size, i++, pfn += pfn_inc)
+		range->pfns[i] = hmm_pfn_from_pfn(range, pfn) | cpu_flags;
+	hmm_vma_walk->last = end;
+
+unlock:
+	spin_unlock(ptl);
+
+	if (ret == -ENOENT)
+		return hmm_vma_walk_hole_(addr, end, fault, write_fault, walk);
+
+	return ret;
+#else /* CONFIG_HUGETLB_PAGE */
+	return -EINVAL;
+#endif
+}
+
 static void hmm_pfns_clear(struct hmm_range *range,
 			   uint64_t *pfns,
 			   unsigned long addr,
@@ -676,279 +893,440 @@ static void hmm_pfns_clear(struct hmm_range *range,
 		*pfns = range->values[HMM_PFN_NONE];
 }
 
-static void hmm_pfns_special(struct hmm_range *range)
-{
-	unsigned long addr = range->start, i = 0;
-
-	for (; addr < range->end; addr += PAGE_SIZE, i++)
-		range->pfns[i] = range->values[HMM_PFN_SPECIAL];
-}
-
 /*
- * hmm_vma_get_pfns() - snapshot CPU page table for a range of virtual addresses
- * @range: range being snapshotted
- * Returns: -EINVAL if invalid argument, -ENOMEM out of memory, -EPERM invalid
- *          vma permission, 0 success
- *
- * This snapshots the CPU page table for a range of virtual addresses. Snapshot
- * validity is tracked by range struct. See hmm_vma_range_done() for further
- * information.
- *
- * The range struct is initialized here. It tracks the CPU page table, but only
- * if the function returns success (0), in which case the caller must then call
- * hmm_vma_range_done() to stop CPU page table update tracking on this range.
+ * hmm_range_register() - start tracking change to CPU page table over a range
+ * @range: range
+ * @mm: the mm struct for the range of virtual address
+ * @start: start virtual address (inclusive)
+ * @end: end virtual address (exclusive)
+ * @page_shift: expect page shift for the range
+ * Returns 0 on success, -EFAULT if the address space is no longer valid
  *
- * NOT CALLING hmm_vma_range_done() IF FUNCTION RETURNS 0 WILL LEAD TO SERIOUS
- * MEMORY CORRUPTION ! YOU HAVE BEEN WARNED !
+ * Track updates to the CPU page table see include/linux/hmm.h
  */
-int hmm_vma_get_pfns(struct hmm_range *range)
+int hmm_range_register(struct hmm_range *range,
+		       struct mm_struct *mm,
+		       unsigned long start,
+		       unsigned long end,
+		       unsigned page_shift)
 {
-	struct vm_area_struct *vma = range->vma;
-	struct hmm_vma_walk hmm_vma_walk;
-	struct mm_walk mm_walk;
-	struct hmm *hmm;
+	unsigned long mask = ((1UL << page_shift) - 1UL);
+
+	range->valid = false;
+	range->hmm = NULL;
 
-	/* Sanity check, this really should not happen ! */
-	if (range->start < vma->vm_start || range->start >= vma->vm_end)
+	if ((start & mask) || (end & mask))
 		return -EINVAL;
-	if (range->end < vma->vm_start || range->end > vma->vm_end)
+	if (start >= end)
 		return -EINVAL;
 
-	hmm = hmm_register(vma->vm_mm);
-	if (!hmm)
-		return -ENOMEM;
-	/* Caller must have registered a mirror, via hmm_mirror_register() ! */
-	if (!hmm->mmu_notifier.ops)
-		return -EINVAL;
+	range->page_shift = page_shift;
+	range->start = start;
+	range->end = end;
 
-	/* FIXME support hugetlb fs */
-	if (is_vm_hugetlb_page(vma) || (vma->vm_flags & VM_SPECIAL) ||
-			vma_is_dax(vma)) {
-		hmm_pfns_special(range);
-		return -EINVAL;
-	}
+	range->hmm = hmm_register(mm);
+	if (!range->hmm)
+		return -EFAULT;
 
-	if (!(vma->vm_flags & VM_READ)) {
-		/*
-		 * If vma do not allow read access, then assume that it does
-		 * not allow write access, either. Architecture that allow
-		 * write without read access are not supported by HMM, because
-		 * operations such has atomic access would not work.
-		 */
-		hmm_pfns_clear(range, range->pfns, range->start, range->end);
-		return -EPERM;
+	/* Check if hmm_mm_destroy() was call. */
+	if (range->hmm->mm == NULL || range->hmm->dead) {
+		hmm_put(range->hmm);
+		return -EFAULT;
 	}
 
 	/* Initialize range to track CPU page table update */
-	spin_lock(&hmm->lock);
-	range->valid = true;
-	list_add_rcu(&range->list, &hmm->ranges);
-	spin_unlock(&hmm->lock);
-
-	hmm_vma_walk.fault = false;
-	hmm_vma_walk.range = range;
-	mm_walk.private = &hmm_vma_walk;
-
-	mm_walk.vma = vma;
-	mm_walk.mm = vma->vm_mm;
-	mm_walk.pte_entry = NULL;
-	mm_walk.test_walk = NULL;
-	mm_walk.hugetlb_entry = NULL;
-	mm_walk.pmd_entry = hmm_vma_walk_pmd;
-	mm_walk.pte_hole = hmm_vma_walk_hole;
-
-	walk_page_range(range->start, range->end, &mm_walk);
+	mutex_lock(&range->hmm->lock);
+
+	list_add_rcu(&range->list, &range->hmm->ranges);
+
+	/*
+	 * If there are any concurrent notifiers we have to wait for them for
+	 * the range to be valid (see hmm_range_wait_until_valid()).
+	 */
+	if (!range->hmm->notifiers)
+		range->valid = true;
+	mutex_unlock(&range->hmm->lock);
+
 	return 0;
 }
-EXPORT_SYMBOL(hmm_vma_get_pfns);
+EXPORT_SYMBOL(hmm_range_register);
 
 /*
- * hmm_vma_range_done() - stop tracking change to CPU page table over a range
- * @range: range being tracked
- * Returns: false if range data has been invalidated, true otherwise
+ * hmm_range_unregister() - stop tracking change to CPU page table over a range
+ * @range: range
  *
  * Range struct is used to track updates to the CPU page table after a call to
- * either hmm_vma_get_pfns() or hmm_vma_fault(). Once the device driver is done
- * using the data,  or wants to lock updates to the data it got from those
- * functions, it must call the hmm_vma_range_done() function, which will then
- * stop tracking CPU page table updates.
- *
- * Note that device driver must still implement general CPU page table update
- * tracking either by using hmm_mirror (see hmm_mirror_register()) or by using
- * the mmu_notifier API directly.
- *
- * CPU page table update tracking done through hmm_range is only temporary and
- * to be used while trying to duplicate CPU page table contents for a range of
- * virtual addresses.
- *
- * There are two ways to use this :
- * again:
- *   hmm_vma_get_pfns(range); or hmm_vma_fault(...);
- *   trans = device_build_page_table_update_transaction(pfns);
- *   device_page_table_lock();
- *   if (!hmm_vma_range_done(range)) {
- *     device_page_table_unlock();
- *     goto again;
- *   }
- *   device_commit_transaction(trans);
- *   device_page_table_unlock();
+ * hmm_range_register(). See include/linux/hmm.h for how to use it.
+ */
+void hmm_range_unregister(struct hmm_range *range)
+{
+	/* Sanity check this really should not happen. */
+	if (range->hmm == NULL || range->end <= range->start)
+		return;
+
+	mutex_lock(&range->hmm->lock);
+	list_del_rcu(&range->list);
+	mutex_unlock(&range->hmm->lock);
+
+	/* Drop reference taken by hmm_range_register() */
+	range->valid = false;
+	hmm_put(range->hmm);
+	range->hmm = NULL;
+}
+EXPORT_SYMBOL(hmm_range_unregister);
+
+/*
+ * hmm_range_snapshot() - snapshot CPU page table for a range
+ * @range: range
+ * Returns: -EINVAL if invalid argument, -ENOMEM out of memory, -EPERM invalid
+ *          permission (for instance asking for write and range is read only),
+ *          -EAGAIN if you need to retry, -EFAULT invalid (ie either no valid
+ *          vma or it is illegal to access that range), number of valid pages
+ *          in range->pfns[] (from range start address).
  *
- * Or:
- *   hmm_vma_get_pfns(range); or hmm_vma_fault(...);
- *   device_page_table_lock();
- *   hmm_vma_range_done(range);
- *   device_update_page_table(range->pfns);
- *   device_page_table_unlock();
+ * This snapshots the CPU page table for a range of virtual addresses. Snapshot
+ * validity is tracked by range struct. See in include/linux/hmm.h for example
+ * on how to use.
  */
-bool hmm_vma_range_done(struct hmm_range *range)
+long hmm_range_snapshot(struct hmm_range *range)
 {
-	unsigned long npages = (range->end - range->start) >> PAGE_SHIFT;
-	struct hmm *hmm;
+	const unsigned long device_vma = VM_IO | VM_PFNMAP | VM_MIXEDMAP;
+	unsigned long start = range->start, end;
+	struct hmm_vma_walk hmm_vma_walk;
+	struct hmm *hmm = range->hmm;
+	struct vm_area_struct *vma;
+	struct mm_walk mm_walk;
 
-	if (range->end <= range->start) {
-		BUG();
-		return false;
-	}
+	/* Check if hmm_mm_destroy() was call. */
+	if (hmm->mm == NULL || hmm->dead)
+		return -EFAULT;
 
-	hmm = hmm_register(range->vma->vm_mm);
-	if (!hmm) {
-		memset(range->pfns, 0, sizeof(*range->pfns) * npages);
-		return false;
-	}
+	do {
+		/* If range is no longer valid force retry. */
+		if (!range->valid)
+			return -EAGAIN;
 
-	spin_lock(&hmm->lock);
-	list_del_rcu(&range->list);
-	spin_unlock(&hmm->lock);
+		vma = find_vma(hmm->mm, start);
+		if (vma == NULL || (vma->vm_flags & device_vma))
+			return -EFAULT;
+
+		if (is_vm_hugetlb_page(vma)) {
+			if (range->page_shift !=
+				huge_page_shift(hstate_vma(vma)) &&
+			    range->page_shift != PAGE_SHIFT)
+				return -EINVAL;
+		} else {
+			if (range->page_shift != PAGE_SHIFT)
+				return -EINVAL;
+		}
 
-	return range->valid;
+		if (!(vma->vm_flags & VM_READ)) {
+			/*
+			 * If vma do not allow read access, then assume that it
+			 * does not allow write access, either. HMM does not
+			 * support architecture that allow write without read.
+			 */
+			hmm_pfns_clear(range, range->pfns,
+				range->start, range->end);
+			return -EPERM;
+		}
+
+		range->vma = vma;
+		hmm_vma_walk.pgmap = NULL;
+		hmm_vma_walk.last = start;
+		hmm_vma_walk.fault = false;
+		hmm_vma_walk.range = range;
+		mm_walk.private = &hmm_vma_walk;
+		end = min(range->end, vma->vm_end);
+
+		mm_walk.vma = vma;
+		mm_walk.mm = vma->vm_mm;
+		mm_walk.pte_entry = NULL;
+		mm_walk.test_walk = NULL;
+		mm_walk.hugetlb_entry = NULL;
+		mm_walk.pud_entry = hmm_vma_walk_pud;
+		mm_walk.pmd_entry = hmm_vma_walk_pmd;
+		mm_walk.pte_hole = hmm_vma_walk_hole;
+		mm_walk.hugetlb_entry = hmm_vma_walk_hugetlb_entry;
+
+		walk_page_range(start, end, &mm_walk);
+		start = end;
+	} while (start < range->end);
+
+	return (hmm_vma_walk.last - range->start) >> PAGE_SHIFT;
 }
-EXPORT_SYMBOL(hmm_vma_range_done);
+EXPORT_SYMBOL(hmm_range_snapshot);
 
 /*
- * hmm_vma_fault() - try to fault some address in a virtual address range
+ * hmm_range_fault() - try to fault some address in a virtual address range
  * @range: range being faulted
  * @block: allow blocking on fault (if true it sleeps and do not drop mmap_sem)
- * Returns: 0 success, error otherwise (-EAGAIN means mmap_sem have been drop)
+ * Returns: 0 on success ortherwise:
+ *      -EINVAL:
+ *              Invalid argument
+ *      -ENOMEM:
+ *              Out of memory.
+ *      -EPERM:
+ *              Invalid permission (for instance asking for write and range
+ *              is read only).
+ *      -EAGAIN:
+ *              If you need to retry and mmap_sem was drop. This can only
+ *              happens if block argument is false.
+ *      -EBUSY:
+ *              If the the range is being invalidated and you should wait for
+ *              invalidation to finish.
+ *      -EFAULT:
+ *              Invalid (ie either no valid vma or it is illegal to access that
+ *              range), number of valid pages in range->pfns[] (from range start
+ *              address).
  *
  * This is similar to a regular CPU page fault except that it will not trigger
- * any memory migration if the memory being faulted is not accessible by CPUs.
+ * any memory migration if the memory being faulted is not accessible by CPUs
+ * and caller does not ask for migration.
  *
  * On error, for one virtual address in the range, the function will mark the
  * corresponding HMM pfn entry with an error flag.
- *
- * Expected use pattern:
- * retry:
- *   down_read(&mm->mmap_sem);
- *   // Find vma and address device wants to fault, initialize hmm_pfn_t
- *   // array accordingly
- *   ret = hmm_vma_fault(range, write, block);
- *   switch (ret) {
- *   case -EAGAIN:
- *     hmm_vma_range_done(range);
- *     // You might want to rate limit or yield to play nicely, you may
- *     // also commit any valid pfn in the array assuming that you are
- *     // getting true from hmm_vma_range_monitor_end()
- *     goto retry;
- *   case 0:
- *     break;
- *   case -ENOMEM:
- *   case -EINVAL:
- *   case -EPERM:
- *   default:
- *     // Handle error !
- *     up_read(&mm->mmap_sem)
- *     return;
- *   }
- *   // Take device driver lock that serialize device page table update
- *   driver_lock_device_page_table_update();
- *   hmm_vma_range_done(range);
- *   // Commit pfns we got from hmm_vma_fault()
- *   driver_unlock_device_page_table_update();
- *   up_read(&mm->mmap_sem)
- *
- * YOU MUST CALL hmm_vma_range_done() AFTER THIS FUNCTION RETURN SUCCESS (0)
- * BEFORE FREEING THE range struct OR YOU WILL HAVE SERIOUS MEMORY CORRUPTION !
- *
- * YOU HAVE BEEN WARNED !
  */
-int hmm_vma_fault(struct hmm_range *range, bool block)
+long hmm_range_fault(struct hmm_range *range, bool block)
 {
-	struct vm_area_struct *vma = range->vma;
-	unsigned long start = range->start;
+	const unsigned long device_vma = VM_IO | VM_PFNMAP | VM_MIXEDMAP;
+	unsigned long start = range->start, end;
 	struct hmm_vma_walk hmm_vma_walk;
+	struct hmm *hmm = range->hmm;
+	struct vm_area_struct *vma;
 	struct mm_walk mm_walk;
-	struct hmm *hmm;
 	int ret;
 
-	/* Sanity check, this really should not happen ! */
-	if (range->start < vma->vm_start || range->start >= vma->vm_end)
-		return -EINVAL;
-	if (range->end < vma->vm_start || range->end > vma->vm_end)
-		return -EINVAL;
+	/* Check if hmm_mm_destroy() was call. */
+	if (hmm->mm == NULL || hmm->dead)
+		return -EFAULT;
 
-	hmm = hmm_register(vma->vm_mm);
-	if (!hmm) {
-		hmm_pfns_clear(range, range->pfns, range->start, range->end);
-		return -ENOMEM;
-	}
-	/* Caller must have registered a mirror using hmm_mirror_register() */
-	if (!hmm->mmu_notifier.ops)
-		return -EINVAL;
+	do {
+		/* If range is no longer valid force retry. */
+		if (!range->valid) {
+			up_read(&hmm->mm->mmap_sem);
+			return -EAGAIN;
+		}
 
-	/* FIXME support hugetlb fs */
-	if (is_vm_hugetlb_page(vma) || (vma->vm_flags & VM_SPECIAL) ||
-			vma_is_dax(vma)) {
-		hmm_pfns_special(range);
-		return -EINVAL;
-	}
+		vma = find_vma(hmm->mm, start);
+		if (vma == NULL || (vma->vm_flags & device_vma))
+			return -EFAULT;
+
+		if (is_vm_hugetlb_page(vma)) {
+			if (range->page_shift !=
+				huge_page_shift(hstate_vma(vma)) &&
+			    range->page_shift != PAGE_SHIFT)
+				return -EINVAL;
+		} else {
+			if (range->page_shift != PAGE_SHIFT)
+				return -EINVAL;
+		}
+
+		if (!(vma->vm_flags & VM_READ)) {
+			/*
+			 * If vma do not allow read access, then assume that it
+			 * does not allow write access, either. HMM does not
+			 * support architecture that allow write without read.
+			 */
+			hmm_pfns_clear(range, range->pfns,
+				range->start, range->end);
+			return -EPERM;
+		}
+
+		range->vma = vma;
+		hmm_vma_walk.pgmap = NULL;
+		hmm_vma_walk.last = start;
+		hmm_vma_walk.fault = true;
+		hmm_vma_walk.block = block;
+		hmm_vma_walk.range = range;
+		mm_walk.private = &hmm_vma_walk;
+		end = min(range->end, vma->vm_end);
+
+		mm_walk.vma = vma;
+		mm_walk.mm = vma->vm_mm;
+		mm_walk.pte_entry = NULL;
+		mm_walk.test_walk = NULL;
+		mm_walk.hugetlb_entry = NULL;
+		mm_walk.pud_entry = hmm_vma_walk_pud;
+		mm_walk.pmd_entry = hmm_vma_walk_pmd;
+		mm_walk.pte_hole = hmm_vma_walk_hole;
+		mm_walk.hugetlb_entry = hmm_vma_walk_hugetlb_entry;
+
+		do {
+			ret = walk_page_range(start, end, &mm_walk);
+			start = hmm_vma_walk.last;
+
+			/* Keep trying while the range is valid. */
+		} while (ret == -EBUSY && range->valid);
+
+		if (ret) {
+			unsigned long i;
+
+			i = (hmm_vma_walk.last - range->start) >> PAGE_SHIFT;
+			hmm_pfns_clear(range, &range->pfns[i],
+				hmm_vma_walk.last, range->end);
+			return ret;
+		}
+		start = end;
+
+	} while (start < range->end);
+
+	return (hmm_vma_walk.last - range->start) >> PAGE_SHIFT;
+}
+EXPORT_SYMBOL(hmm_range_fault);
+
+/*
+ * hmm_range_dma_map() - hmm_range_fault() and dma map page all in one.
+ * @range: range being faulted
+ * @device: device against to dma map page to
+ * @daddrs: dma address of mapped pages
+ * @block: allow blocking on fault (if true it sleeps and do not drop mmap_sem)
+ * Returns: number of pages mapped on success, -EAGAIN if mmap_sem have been
+ *          drop and you need to try again, some other error value otherwise
+ *
+ * Note same usage pattern as hmm_range_fault().
+ */
+long hmm_range_dma_map(struct hmm_range *range,
+		       struct device *device,
+		       dma_addr_t *daddrs,
+		       bool block)
+{
+	unsigned long i, npages, mapped, page_size;
+	long ret;
+
+	ret = hmm_range_fault(range, block);
+	if (ret <= 0)
+		return ret ? ret : -EBUSY;
+
+	page_size = hmm_range_page_size(range);
+	npages = (range->end - range->start) >> range->page_shift;
+	for (i = 0, mapped = 0; i < npages; ++i) {
+		enum dma_data_direction dir = DMA_FROM_DEVICE;
+		struct page *page;
 
-	if (!(vma->vm_flags & VM_READ)) {
 		/*
-		 * If vma do not allow read access, then assume that it does
-		 * not allow write access, either. Architecture that allow
-		 * write without read access are not supported by HMM, because
-		 * operations such has atomic access would not work.
+		 * FIXME need to update DMA API to provide invalid DMA address
+		 * value instead of a function to test dma address value. This
+		 * would remove lot of dumb code duplicated accross many arch.
+		 *
+		 * For now setting it to 0 here is good enough as the pfns[]
+		 * value is what is use to check what is valid and what isn't.
 		 */
-		hmm_pfns_clear(range, range->pfns, range->start, range->end);
-		return -EPERM;
+		daddrs[i] = 0;
+
+		page = hmm_pfn_to_page(range, range->pfns[i]);
+		if (page == NULL)
+			continue;
+
+		/* Check if range is being invalidated */
+		if (!range->valid) {
+			ret = -EBUSY;
+			goto unmap;
+		}
+
+		/* If it is read and write than map bi-directional. */
+		if (range->pfns[i] & range->values[HMM_PFN_WRITE])
+			dir = DMA_BIDIRECTIONAL;
+
+		daddrs[i] = dma_map_page(device, page, 0, page_size, dir);
+		if (dma_mapping_error(device, daddrs[i])) {
+			ret = -EFAULT;
+			goto unmap;
+		}
+
+		mapped++;
 	}
 
-	/* Initialize range to track CPU page table update */
-	spin_lock(&hmm->lock);
-	range->valid = true;
-	list_add_rcu(&range->list, &hmm->ranges);
-	spin_unlock(&hmm->lock);
-
-	hmm_vma_walk.fault = true;
-	hmm_vma_walk.block = block;
-	hmm_vma_walk.range = range;
-	mm_walk.private = &hmm_vma_walk;
-	hmm_vma_walk.last = range->start;
-
-	mm_walk.vma = vma;
-	mm_walk.mm = vma->vm_mm;
-	mm_walk.pte_entry = NULL;
-	mm_walk.test_walk = NULL;
-	mm_walk.hugetlb_entry = NULL;
-	mm_walk.pmd_entry = hmm_vma_walk_pmd;
-	mm_walk.pte_hole = hmm_vma_walk_hole;
+	return mapped;
 
-	do {
-		ret = walk_page_range(start, range->end, &mm_walk);
-		start = hmm_vma_walk.last;
-	} while (ret == -EAGAIN);
+unmap:
+	for (npages = i, i = 0; (i < npages) && mapped; ++i) {
+		enum dma_data_direction dir = DMA_FROM_DEVICE;
+		struct page *page;
+
+		page = hmm_pfn_to_page(range, range->pfns[i]);
+		if (page == NULL)
+			continue;
+
+		if (dma_mapping_error(device, daddrs[i]))
+			continue;
 
-	if (ret) {
-		unsigned long i;
+		/* If it is read and write than map bi-directional. */
+		if (range->pfns[i] & range->values[HMM_PFN_WRITE])
+			dir = DMA_BIDIRECTIONAL;
 
-		i = (hmm_vma_walk.last - range->start) >> PAGE_SHIFT;
-		hmm_pfns_clear(range, &range->pfns[i], hmm_vma_walk.last,
-			       range->end);
-		hmm_vma_range_done(range);
+		dma_unmap_page(device, daddrs[i], page_size, dir);
+		mapped--;
 	}
+
 	return ret;
 }
-EXPORT_SYMBOL(hmm_vma_fault);
+EXPORT_SYMBOL(hmm_range_dma_map);
+
+/*
+ * hmm_range_dma_unmap() - unmap range of that was map with hmm_range_dma_map()
+ * @range: range being unmapped
+ * @vma: the vma against which the range (optional)
+ * @device: device against which dma map was done
+ * @daddrs: dma address of mapped pages
+ * @dirty: dirty page if it had the write flag set
+ * Returns: number of page unmapped on success, -EINVAL otherwise
+ *
+ * Note that caller MUST abide by mmu notifier or use HMM mirror and abide
+ * to the sync_cpu_device_pagetables() callback so that it is safe here to
+ * call set_page_dirty(). Caller must also take appropriate locks to avoid
+ * concurrent mmu notifier or sync_cpu_device_pagetables() to make progress.
+ */
+long hmm_range_dma_unmap(struct hmm_range *range,
+			 struct vm_area_struct *vma,
+			 struct device *device,
+			 dma_addr_t *daddrs,
+			 bool dirty)
+{
+	unsigned long i, npages, page_size;
+	long cpages = 0;
+
+	/* Sanity check. */
+	if (range->end <= range->start)
+		return -EINVAL;
+	if (!daddrs)
+		return -EINVAL;
+	if (!range->pfns)
+		return -EINVAL;
+
+	page_size = hmm_range_page_size(range);
+	npages = (range->end - range->start) >> range->page_shift;
+	for (i = 0; i < npages; ++i) {
+		enum dma_data_direction dir = DMA_FROM_DEVICE;
+		struct page *page;
+
+		page = hmm_pfn_to_page(range, range->pfns[i]);
+		if (page == NULL)
+			continue;
+
+		/* If it is read and write than map bi-directional. */
+		if (range->pfns[i] & range->values[HMM_PFN_WRITE]) {
+			dir = DMA_BIDIRECTIONAL;
+
+			/*
+			 * See comments in function description on why it is
+			 * safe here to call set_page_dirty()
+			 */
+			if (dirty)
+				set_page_dirty(page);
+		}
+
+		/* Unmap and clear pfns/dma address */
+		dma_unmap_page(device, daddrs[i], page_size, dir);
+		range->pfns[i] = range->values[HMM_PFN_NONE];
+		/* FIXME see comments in hmm_vma_dma_map() */
+		daddrs[i] = 0;
+		cpages++;
+	}
+
+	return cpages;
+}
+EXPORT_SYMBOL(hmm_range_dma_unmap);
 #endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */
 
 
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 97b1e0290c66..5a190a652cac 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1036,7 +1036,6 @@ static int hstate_next_node_to_free(struct hstate *h, nodemask_t *nodes_allowed)
 		((node = hstate_next_node_to_free(hs, mask)) || 1);	\
 		nr_nodes--)
 
-#ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE
 static void destroy_compound_gigantic_page(struct page *page,
 					unsigned int order)
 {
@@ -1059,6 +1058,7 @@ static void free_gigantic_page(struct page *page, unsigned int order)
 	free_contig_range(page_to_pfn(page), 1 << order);
 }
 
+#ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE_RUNTIME_ALLOCATION
 static int __alloc_gigantic_page(unsigned long start_pfn,
 				unsigned long nr_pages, gfp_t gfp_mask)
 {
@@ -1144,22 +1144,19 @@ static struct page *alloc_gigantic_page(struct hstate *h, gfp_t gfp_mask,
 static void prep_new_huge_page(struct hstate *h, struct page *page, int nid);
 static void prep_compound_gigantic_page(struct page *page, unsigned int order);
 
-#else /* !CONFIG_ARCH_HAS_GIGANTIC_PAGE */
-static inline bool gigantic_page_supported(void) { return false; }
+#else /* !CONFIG_ARCH_HAS_GIGANTIC_PAGE_RUNTIME_ALLOCATION */
+static inline bool gigantic_page_runtime_allocation_supported(void)
+{
+	return false;
+}
 static struct page *alloc_gigantic_page(struct hstate *h, gfp_t gfp_mask,
 		int nid, nodemask_t *nodemask) { return NULL; }
-static inline void free_gigantic_page(struct page *page, unsigned int order) { }
-static inline void destroy_compound_gigantic_page(struct page *page,
-						unsigned int order) { }
 #endif
 
 static void update_and_free_page(struct hstate *h, struct page *page)
 {
 	int i;
 
-	if (hstate_is_gigantic(h) && !gigantic_page_supported())
-		return;
-
 	h->nr_huge_pages--;
 	h->nr_huge_pages_node[page_to_nid(page)]--;
 	for (i = 0; i < pages_per_huge_page(h); i++) {
@@ -2277,13 +2274,42 @@ static int adjust_pool_surplus(struct hstate *h, nodemask_t *nodes_allowed,
 }
 
 #define persistent_huge_pages(h) (h->nr_huge_pages - h->surplus_huge_pages)
-static unsigned long set_max_huge_pages(struct hstate *h, unsigned long count,
+static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid,
 						nodemask_t *nodes_allowed)
 {
 	unsigned long min_count, ret;
 
-	if (hstate_is_gigantic(h) && !gigantic_page_supported())
-		return h->max_huge_pages;
+	if (hstate_is_gigantic(h) &&
+		!gigantic_page_runtime_allocation_supported()) {
+		spin_lock(&hugetlb_lock);
+		if (count > persistent_huge_pages(h)) {
+			spin_unlock(&hugetlb_lock);
+			return -EINVAL;
+		}
+		goto decrease_pool;
+	}
+
+	spin_lock(&hugetlb_lock);
+
+	/*
+	 * Check for a node specific request.
+	 * Changing node specific huge page count may require a corresponding
+	 * change to the global count.  In any case, the passed node mask
+	 * (nodes_allowed) will restrict alloc/free to the specified node.
+	 */
+	if (nid != NUMA_NO_NODE) {
+		unsigned long old_count = count;
+
+		count += h->nr_huge_pages - h->nr_huge_pages_node[nid];
+		/*
+		 * User may have specified a large count value which caused the
+		 * above calculation to overflow.  In this case, they wanted
+		 * to allocate as many huge pages as possible.  Set count to
+		 * largest possible value to align with their intention.
+		 */
+		if (count < old_count)
+			count = ULONG_MAX;
+	}
 
 	/*
 	 * Increase the pool size
@@ -2296,7 +2322,6 @@ static unsigned long set_max_huge_pages(struct hstate *h, unsigned long count,
 	 * pool might be one hugepage larger than it needs to be, but
 	 * within all the constraints specified by the sysctls.
 	 */
-	spin_lock(&hugetlb_lock);
 	while (h->surplus_huge_pages && count > persistent_huge_pages(h)) {
 		if (!adjust_pool_surplus(h, nodes_allowed, -1))
 			break;
@@ -2323,6 +2348,7 @@ static unsigned long set_max_huge_pages(struct hstate *h, unsigned long count,
 			goto out;
 	}
 
+decrease_pool:
 	/*
 	 * Decrease the pool size
 	 * First return free pages to the buddy allocator (being careful
@@ -2351,9 +2377,10 @@ static unsigned long set_max_huge_pages(struct hstate *h, unsigned long count,
 			break;
 	}
 out:
-	ret = persistent_huge_pages(h);
+	h->max_huge_pages = persistent_huge_pages(h);
 	spin_unlock(&hugetlb_lock);
-	return ret;
+
+	return 0;
 }
 
 #define HSTATE_ATTR_RO(_name) \
@@ -2405,11 +2432,6 @@ static ssize_t __nr_hugepages_store_common(bool obey_mempolicy,
 	int err;
 	NODEMASK_ALLOC(nodemask_t, nodes_allowed, GFP_KERNEL | __GFP_NORETRY);
 
-	if (hstate_is_gigantic(h) && !gigantic_page_supported()) {
-		err = -EINVAL;
-		goto out;
-	}
-
 	if (nid == NUMA_NO_NODE) {
 		/*
 		 * global hstate attribute
@@ -2420,16 +2442,21 @@ static ssize_t __nr_hugepages_store_common(bool obey_mempolicy,
 			nodes_allowed = &node_states[N_MEMORY];
 		}
 	} else if (nodes_allowed) {
+		/* Node specific request */
+		init_nodemask_of_node(nodes_allowed, nid);
+	} else {
 		/*
-		 * per node hstate attribute: adjust count to global,
-		 * but restrict alloc/free to the specified node.
+		 * Node specific request, but we could not allocate the few
+		 * words required for a node mask.  We are unlikely to hit
+		 * this condition.  Since we can not pass down the appropriate
+		 * node mask, just return ENOMEM.
 		 */
-		count += h->nr_huge_pages - h->nr_huge_pages_node[nid];
-		init_nodemask_of_node(nodes_allowed, nid);
-	} else
-		nodes_allowed = &node_states[N_MEMORY];
+		return -ENOMEM;
+	}
 
-	h->max_huge_pages = set_max_huge_pages(h, count, nodes_allowed);
+	err = set_max_huge_pages(h, count, nid, nodes_allowed);
+	if (err)
+		goto out;
 
 	if (nodes_allowed != &node_states[N_MEMORY])
 		NODEMASK_FREE(nodes_allowed);
diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h
index 3e0c11f7d7a1..3ce956efa0cb 100644
--- a/mm/kasan/kasan.h
+++ b/mm/kasan/kasan.h
@@ -163,7 +163,10 @@ static inline u8 random_tag(void)
 #endif
 
 #ifndef arch_kasan_set_tag
-#define arch_kasan_set_tag(addr, tag)	((void *)(addr))
+static inline const void *arch_kasan_set_tag(const void *addr, u8 tag)
+{
+	return addr;
+}
 #endif
 #ifndef arch_kasan_reset_tag
 #define arch_kasan_reset_tag(addr)	((void *)(addr))
diff --git a/mm/memblock.c b/mm/memblock.c
index e7665cf914b1..28fa8926d9f8 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1255,6 +1255,70 @@ int __init_memblock memblock_set_node(phys_addr_t base, phys_addr_t size,
 	return 0;
 }
 #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
+#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
+/**
+ * __next_mem_pfn_range_in_zone - iterator for for_each_*_range_in_zone()
+ *
+ * @idx: pointer to u64 loop variable
+ * @zone: zone in which all of the memory blocks reside
+ * @out_spfn: ptr to ulong for start pfn of the range, can be %NULL
+ * @out_epfn: ptr to ulong for end pfn of the range, can be %NULL
+ *
+ * This function is meant to be a zone/pfn specific wrapper for the
+ * for_each_mem_range type iterators. Specifically they are used in the
+ * deferred memory init routines and as such we were duplicating much of
+ * this logic throughout the code. So instead of having it in multiple
+ * locations it seemed like it would make more sense to centralize this to
+ * one new iterator that does everything they need.
+ */
+void __init_memblock
+__next_mem_pfn_range_in_zone(u64 *idx, struct zone *zone,
+			     unsigned long *out_spfn, unsigned long *out_epfn)
+{
+	int zone_nid = zone_to_nid(zone);
+	phys_addr_t spa, epa;
+	int nid;
+
+	__next_mem_range(idx, zone_nid, MEMBLOCK_NONE,
+			 &memblock.memory, &memblock.reserved,
+			 &spa, &epa, &nid);
+
+	while (*idx != U64_MAX) {
+		unsigned long epfn = PFN_DOWN(epa);
+		unsigned long spfn = PFN_UP(spa);
+
+		/*
+		 * Verify the end is at least past the start of the zone and
+		 * that we have at least one PFN to initialize.
+		 */
+		if (zone->zone_start_pfn < epfn && spfn < epfn) {
+			/* if we went too far just stop searching */
+			if (zone_end_pfn(zone) <= spfn) {
+				*idx = U64_MAX;
+				break;
+			}
+
+			if (out_spfn)
+				*out_spfn = max(zone->zone_start_pfn, spfn);
+			if (out_epfn)
+				*out_epfn = min(zone_end_pfn(zone), epfn);
+
+			return;
+		}
+
+		__next_mem_range(idx, zone_nid, MEMBLOCK_NONE,
+				 &memblock.memory, &memblock.reserved,
+				 &spa, &epa, &nid);
+	}
+
+	/* signal end of iteration */
+	if (out_spfn)
+		*out_spfn = ULONG_MAX;
+	if (out_epfn)
+		*out_epfn = 0;
+}
+
+#endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */
 
 /**
  * memblock_alloc_range_nid - allocate boot memory block
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 532e0e2a4817..c532f8685aa3 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -690,7 +690,7 @@ mem_cgroup_largest_soft_limit_node(struct mem_cgroup_tree_per_node *mctz)
 static unsigned long memcg_sum_events(struct mem_cgroup *memcg,
 				      int event)
 {
-	return atomic_long_read(&memcg->events[event]);
+	return atomic_long_read(&memcg->vmevents[event]);
 }
 
 static void mem_cgroup_charge_statistics(struct mem_cgroup *memcg,
@@ -722,7 +722,7 @@ static void mem_cgroup_charge_statistics(struct mem_cgroup *memcg,
 		nr_pages = -nr_pages; /* for event */
 	}
 
-	__this_cpu_add(memcg->stat_cpu->nr_page_events, nr_pages);
+	__this_cpu_add(memcg->vmstats_percpu->nr_page_events, nr_pages);
 }
 
 unsigned long mem_cgroup_node_nr_lru_pages(struct mem_cgroup *memcg,
@@ -758,8 +758,8 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,
 {
 	unsigned long val, next;
 
-	val = __this_cpu_read(memcg->stat_cpu->nr_page_events);
-	next = __this_cpu_read(memcg->stat_cpu->targets[target]);
+	val = __this_cpu_read(memcg->vmstats_percpu->nr_page_events);
+	next = __this_cpu_read(memcg->vmstats_percpu->targets[target]);
 	/* from time_after() in jiffies.h */
 	if ((long)(next - val) < 0) {
 		switch (target) {
@@ -775,7 +775,7 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,
 		default:
 			break;
 		}
-		__this_cpu_write(memcg->stat_cpu->targets[target], next);
+		__this_cpu_write(memcg->vmstats_percpu->targets[target], next);
 		return true;
 	}
 	return false;
@@ -1384,6 +1384,11 @@ unsigned long mem_cgroup_get_max(struct mem_cgroup *memcg)
 	return max;
 }
 
+unsigned long mem_cgroup_size(struct mem_cgroup *memcg)
+{
+	return page_counter_read(&memcg->memory);
+}
+
 static bool mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
 				     int order)
 {
@@ -2112,9 +2117,9 @@ static int memcg_hotplug_cpu_dead(unsigned int cpu)
 			int nid;
 			long x;
 
-			x = this_cpu_xchg(memcg->stat_cpu->count[i], 0);
+			x = this_cpu_xchg(memcg->vmstats_percpu->stat[i], 0);
 			if (x)
-				atomic_long_add(x, &memcg->stat[i]);
+				atomic_long_add(x, &memcg->vmstats[i]);
 
 			if (i >= NR_VM_NODE_STAT_ITEMS)
 				continue;
@@ -2132,9 +2137,9 @@ static int memcg_hotplug_cpu_dead(unsigned int cpu)
 		for (i = 0; i < NR_VM_EVENT_ITEMS; i++) {
 			long x;
 
-			x = this_cpu_xchg(memcg->stat_cpu->events[i], 0);
+			x = this_cpu_xchg(memcg->vmstats_percpu->events[i], 0);
 			if (x)
-				atomic_long_add(x, &memcg->events[i]);
+				atomic_long_add(x, &memcg->vmevents[i]);
 		}
 	}
 
@@ -2168,14 +2173,17 @@ static void high_work_func(struct work_struct *work)
 void mem_cgroup_handle_over_high(void)
 {
 	unsigned int nr_pages = current->memcg_nr_pages_over_high;
-	struct mem_cgroup *memcg;
+	struct mem_cgroup *memcg = current->memcg_high_reclaim;
 
 	if (likely(!nr_pages))
 		return;
 
-	memcg = get_mem_cgroup_from_mm(current->mm);
+	if (!memcg)
+		memcg = get_mem_cgroup_from_mm(current->mm);
+
 	reclaim_high(memcg, nr_pages, GFP_KERNEL);
 	css_put(&memcg->css);
+	current->memcg_high_reclaim = NULL;
 	current->memcg_nr_pages_over_high = 0;
 }
 
@@ -2327,10 +2335,10 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask,
 	 * If the hierarchy is above the normal consumption range, schedule
 	 * reclaim on returning to userland.  We can perform reclaim here
 	 * if __GFP_RECLAIM but let's always punt for simplicity and so that
-	 * GFP_KERNEL can consistently be used during reclaim.  @memcg is
-	 * not recorded as it most likely matches current's and won't
-	 * change in the meantime.  As high limit is checked again before
-	 * reclaim, the cost of mismatch is negligible.
+	 * GFP_KERNEL can consistently be used during reclaim. Record the memcg
+	 * for the return-to-userland high reclaim. If the memcg is already
+	 * recorded and the recorded memcg is not the descendant of the memcg
+	 * needing high reclaim, punt the high reclaim to the work queue.
 	 */
 	do {
 		if (page_counter_read(&memcg->memory) > memcg->high) {
@@ -2338,6 +2346,13 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask,
 			if (in_interrupt()) {
 				schedule_work(&memcg->high_work);
 				break;
+			} else if (!current->memcg_high_reclaim) {
+				css_get(&memcg->css);
+				current->memcg_high_reclaim = memcg;
+			} else if (!mem_cgroup_is_descendant(
+					current->memcg_high_reclaim, memcg)) {
+				schedule_work(&memcg->high_work);
+				break;
 			}
 			current->memcg_nr_pages_over_high += batch;
 			set_notify_resume(current);
@@ -2964,30 +2979,34 @@ static int mem_cgroup_hierarchy_write(struct cgroup_subsys_state *css,
 	return retval;
 }
 
-struct accumulated_stats {
-	unsigned long stat[MEMCG_NR_STAT];
-	unsigned long events[NR_VM_EVENT_ITEMS];
+struct accumulated_vmstats {
+	unsigned long vmstats[MEMCG_NR_STAT];
+	unsigned long vmevents[NR_VM_EVENT_ITEMS];
 	unsigned long lru_pages[NR_LRU_LISTS];
-	const unsigned int *stats_array;
-	const unsigned int *events_array;
-	int stats_size;
-	int events_size;
+
+	/* overrides for v1 */
+	const unsigned int *vmstats_array;
+	const unsigned int *vmevents_array;
+
+	int vmstats_size;
+	int vmevents_size;
 };
 
-static void accumulate_memcg_tree(struct mem_cgroup *memcg,
-				  struct accumulated_stats *acc)
+static void accumulate_vmstats(struct mem_cgroup *memcg,
+			       struct accumulated_vmstats *acc)
 {
 	struct mem_cgroup *mi;
 	int i;
 
 	for_each_mem_cgroup_tree(mi, memcg) {
-		for (i = 0; i < acc->stats_size; i++)
-			acc->stat[i] += memcg_page_state(mi,
-				acc->stats_array ? acc->stats_array[i] : i);
+		for (i = 0; i < acc->vmstats_size; i++)
+			acc->vmstats[i] += memcg_page_state(mi,
+				acc->vmstats_array ? acc->vmstats_array[i] : i);
 
-		for (i = 0; i < acc->events_size; i++)
-			acc->events[i] += memcg_sum_events(mi,
-				acc->events_array ? acc->events_array[i] : i);
+		for (i = 0; i < acc->vmevents_size; i++)
+			acc->vmevents[i] += memcg_sum_events(mi,
+				acc->vmevents_array
+				? acc->vmevents_array[i] : i);
 
 		for (i = 0; i < NR_LRU_LISTS; i++)
 			acc->lru_pages[i] +=
@@ -3402,7 +3421,7 @@ static int memcg_stat_show(struct seq_file *m, void *v)
 	unsigned long memory, memsw;
 	struct mem_cgroup *mi;
 	unsigned int i;
-	struct accumulated_stats acc;
+	struct accumulated_vmstats acc;
 
 	BUILD_BUG_ON(ARRAY_SIZE(memcg1_stat_names) != ARRAY_SIZE(memcg1_stats));
 	BUILD_BUG_ON(ARRAY_SIZE(mem_cgroup_lru_names) != NR_LRU_LISTS);
@@ -3436,22 +3455,22 @@ static int memcg_stat_show(struct seq_file *m, void *v)
 			   (u64)memsw * PAGE_SIZE);
 
 	memset(&acc, 0, sizeof(acc));
-	acc.stats_size = ARRAY_SIZE(memcg1_stats);
-	acc.stats_array = memcg1_stats;
-	acc.events_size = ARRAY_SIZE(memcg1_events);
-	acc.events_array = memcg1_events;
-	accumulate_memcg_tree(memcg, &acc);
+	acc.vmstats_size = ARRAY_SIZE(memcg1_stats);
+	acc.vmstats_array = memcg1_stats;
+	acc.vmevents_size = ARRAY_SIZE(memcg1_events);
+	acc.vmevents_array = memcg1_events;
+	accumulate_vmstats(memcg, &acc);
 
 	for (i = 0; i < ARRAY_SIZE(memcg1_stats); i++) {
 		if (memcg1_stats[i] == MEMCG_SWAP && !do_memsw_account())
 			continue;
 		seq_printf(m, "total_%s %llu\n", memcg1_stat_names[i],
-			   (u64)acc.stat[i] * PAGE_SIZE);
+			   (u64)acc.vmstats[i] * PAGE_SIZE);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(memcg1_events); i++)
 		seq_printf(m, "total_%s %llu\n", memcg1_event_names[i],
-			   (u64)acc.events[i]);
+			   (u64)acc.vmevents[i]);
 
 	for (i = 0; i < NR_LRU_LISTS; i++)
 		seq_printf(m, "total_%s %llu\n", mem_cgroup_lru_names[i],
@@ -4416,7 +4435,7 @@ static void __mem_cgroup_free(struct mem_cgroup *memcg)
 
 	for_each_node(node)
 		free_mem_cgroup_per_node_info(memcg, node);
-	free_percpu(memcg->stat_cpu);
+	free_percpu(memcg->vmstats_percpu);
 	kfree(memcg);
 }
 
@@ -4445,8 +4464,8 @@ static struct mem_cgroup *mem_cgroup_alloc(void)
 	if (memcg->id.id < 0)
 		goto fail;
 
-	memcg->stat_cpu = alloc_percpu(struct mem_cgroup_stat_cpu);
-	if (!memcg->stat_cpu)
+	memcg->vmstats_percpu = alloc_percpu(struct memcg_vmstats_percpu);
+	if (!memcg->vmstats_percpu)
 		goto fail;
 
 	for_each_node(node)
@@ -5532,7 +5551,7 @@ static int memory_events_show(struct seq_file *m, void *v)
 static int memory_stat_show(struct seq_file *m, void *v)
 {
 	struct mem_cgroup *memcg = mem_cgroup_from_seq(m);
-	struct accumulated_stats acc;
+	struct accumulated_vmstats acc;
 	int i;
 
 	/*
@@ -5547,30 +5566,30 @@ static int memory_stat_show(struct seq_file *m, void *v)
 	 */
 
 	memset(&acc, 0, sizeof(acc));
-	acc.stats_size = MEMCG_NR_STAT;
-	acc.events_size = NR_VM_EVENT_ITEMS;
-	accumulate_memcg_tree(memcg, &acc);
+	acc.vmstats_size = MEMCG_NR_STAT;
+	acc.vmevents_size = NR_VM_EVENT_ITEMS;
+	accumulate_vmstats(memcg, &acc);
 
 	seq_printf(m, "anon %llu\n",
-		   (u64)acc.stat[MEMCG_RSS] * PAGE_SIZE);
+		   (u64)acc.vmstats[MEMCG_RSS] * PAGE_SIZE);
 	seq_printf(m, "file %llu\n",
-		   (u64)acc.stat[MEMCG_CACHE] * PAGE_SIZE);
+		   (u64)acc.vmstats[MEMCG_CACHE] * PAGE_SIZE);
 	seq_printf(m, "kernel_stack %llu\n",
-		   (u64)acc.stat[MEMCG_KERNEL_STACK_KB] * 1024);
+		   (u64)acc.vmstats[MEMCG_KERNEL_STACK_KB] * 1024);
 	seq_printf(m, "slab %llu\n",
-		   (u64)(acc.stat[NR_SLAB_RECLAIMABLE] +
-			 acc.stat[NR_SLAB_UNRECLAIMABLE]) * PAGE_SIZE);
+		   (u64)(acc.vmstats[NR_SLAB_RECLAIMABLE] +
+			 acc.vmstats[NR_SLAB_UNRECLAIMABLE]) * PAGE_SIZE);
 	seq_printf(m, "sock %llu\n",
-		   (u64)acc.stat[MEMCG_SOCK] * PAGE_SIZE);
+		   (u64)acc.vmstats[MEMCG_SOCK] * PAGE_SIZE);
 
 	seq_printf(m, "shmem %llu\n",
-		   (u64)acc.stat[NR_SHMEM] * PAGE_SIZE);
+		   (u64)acc.vmstats[NR_SHMEM] * PAGE_SIZE);
 	seq_printf(m, "file_mapped %llu\n",
-		   (u64)acc.stat[NR_FILE_MAPPED] * PAGE_SIZE);
+		   (u64)acc.vmstats[NR_FILE_MAPPED] * PAGE_SIZE);
 	seq_printf(m, "file_dirty %llu\n",
-		   (u64)acc.stat[NR_FILE_DIRTY] * PAGE_SIZE);
+		   (u64)acc.vmstats[NR_FILE_DIRTY] * PAGE_SIZE);
 	seq_printf(m, "file_writeback %llu\n",
-		   (u64)acc.stat[NR_WRITEBACK] * PAGE_SIZE);
+		   (u64)acc.vmstats[NR_WRITEBACK] * PAGE_SIZE);
 
 	/*
 	 * TODO: We should eventually replace our own MEMCG_RSS_HUGE counter
@@ -5579,43 +5598,43 @@ static int memory_stat_show(struct seq_file *m, void *v)
 	 * where the page->mem_cgroup is set up and stable.
 	 */
 	seq_printf(m, "anon_thp %llu\n",
-		   (u64)acc.stat[MEMCG_RSS_HUGE] * PAGE_SIZE);
+		   (u64)acc.vmstats[MEMCG_RSS_HUGE] * PAGE_SIZE);
 
 	for (i = 0; i < NR_LRU_LISTS; i++)
 		seq_printf(m, "%s %llu\n", mem_cgroup_lru_names[i],
 			   (u64)acc.lru_pages[i] * PAGE_SIZE);
 
 	seq_printf(m, "slab_reclaimable %llu\n",
-		   (u64)acc.stat[NR_SLAB_RECLAIMABLE] * PAGE_SIZE);
+		   (u64)acc.vmstats[NR_SLAB_RECLAIMABLE] * PAGE_SIZE);
 	seq_printf(m, "slab_unreclaimable %llu\n",
-		   (u64)acc.stat[NR_SLAB_UNRECLAIMABLE] * PAGE_SIZE);
+		   (u64)acc.vmstats[NR_SLAB_UNRECLAIMABLE] * PAGE_SIZE);
 
 	/* Accumulated memory events */
 
-	seq_printf(m, "pgfault %lu\n", acc.events[PGFAULT]);
-	seq_printf(m, "pgmajfault %lu\n", acc.events[PGMAJFAULT]);
+	seq_printf(m, "pgfault %lu\n", acc.vmevents[PGFAULT]);
+	seq_printf(m, "pgmajfault %lu\n", acc.vmevents[PGMAJFAULT]);
 
 	seq_printf(m, "workingset_refault %lu\n",
-		   acc.stat[WORKINGSET_REFAULT]);
+		   acc.vmstats[WORKINGSET_REFAULT]);
 	seq_printf(m, "workingset_activate %lu\n",
-		   acc.stat[WORKINGSET_ACTIVATE]);
+		   acc.vmstats[WORKINGSET_ACTIVATE]);
 	seq_printf(m, "workingset_nodereclaim %lu\n",
-		   acc.stat[WORKINGSET_NODERECLAIM]);
-
-	seq_printf(m, "pgrefill %lu\n", acc.events[PGREFILL]);
-	seq_printf(m, "pgscan %lu\n", acc.events[PGSCAN_KSWAPD] +
-		   acc.events[PGSCAN_DIRECT]);
-	seq_printf(m, "pgsteal %lu\n", acc.events[PGSTEAL_KSWAPD] +
-		   acc.events[PGSTEAL_DIRECT]);
-	seq_printf(m, "pgactivate %lu\n", acc.events[PGACTIVATE]);
-	seq_printf(m, "pgdeactivate %lu\n", acc.events[PGDEACTIVATE]);
-	seq_printf(m, "pglazyfree %lu\n", acc.events[PGLAZYFREE]);
-	seq_printf(m, "pglazyfreed %lu\n", acc.events[PGLAZYFREED]);
+		   acc.vmstats[WORKINGSET_NODERECLAIM]);
+
+	seq_printf(m, "pgrefill %lu\n", acc.vmevents[PGREFILL]);
+	seq_printf(m, "pgscan %lu\n", acc.vmevents[PGSCAN_KSWAPD] +
+		   acc.vmevents[PGSCAN_DIRECT]);
+	seq_printf(m, "pgsteal %lu\n", acc.vmevents[PGSTEAL_KSWAPD] +
+		   acc.vmevents[PGSTEAL_DIRECT]);
+	seq_printf(m, "pgactivate %lu\n", acc.vmevents[PGACTIVATE]);
+	seq_printf(m, "pgdeactivate %lu\n", acc.vmevents[PGDEACTIVATE]);
+	seq_printf(m, "pglazyfree %lu\n", acc.vmevents[PGLAZYFREE]);
+	seq_printf(m, "pglazyfreed %lu\n", acc.vmevents[PGLAZYFREED]);
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
-	seq_printf(m, "thp_fault_alloc %lu\n", acc.events[THP_FAULT_ALLOC]);
+	seq_printf(m, "thp_fault_alloc %lu\n", acc.vmevents[THP_FAULT_ALLOC]);
 	seq_printf(m, "thp_collapse_alloc %lu\n",
-		   acc.events[THP_COLLAPSE_ALLOC]);
+		   acc.vmevents[THP_COLLAPSE_ALLOC]);
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 
 	return 0;
@@ -6051,7 +6070,7 @@ static void uncharge_batch(const struct uncharge_gather *ug)
 	__mod_memcg_state(ug->memcg, MEMCG_RSS_HUGE, -ug->nr_huge);
 	__mod_memcg_state(ug->memcg, NR_SHMEM, -ug->nr_shmem);
 	__count_memcg_events(ug->memcg, PGPGOUT, ug->pgpgout);
-	__this_cpu_add(ug->memcg->stat_cpu->nr_page_events, nr_pages);
+	__this_cpu_add(ug->memcg->vmstats_percpu->nr_page_events, nr_pages);
 	memcg_check_events(ug->memcg, ug->dummy_page);
 	local_irq_restore(flags);
 
diff --git a/mm/memory.c b/mm/memory.c
index 47fe250307c7..c0391a9f18b8 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2829,7 +2829,6 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
 	flush_icache_page(vma, page);
 	if (pte_swp_soft_dirty(vmf->orig_pte))
 		pte = pte_mksoft_dirty(pte);
-	set_pte_at(vma->vm_mm, vmf->address, vmf->pte, pte);
 	arch_do_swap_page(vma->vm_mm, vma, vmf->address, pte, vmf->orig_pte);
 	vmf->orig_pte = pte;
 
@@ -2843,6 +2842,7 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
 		mem_cgroup_commit_charge(page, memcg, true, false);
 		activate_page(page);
 	}
+	set_pte_at(vma->vm_mm, vmf->address, vmf->pte, pte);
 
 	swap_free(entry);
 	if (mem_cgroup_swap_full(page) ||
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index f767582af4f8..2a778602a821 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -39,6 +39,7 @@
 #include <asm/tlbflush.h>
 
 #include "internal.h"
+#include "shuffle.h"
 
 /*
  * online_page_callback contains pointer to current page onlining function.
@@ -911,6 +912,8 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
 	zone->zone_pgdat->node_present_pages += onlined_pages;
 	pgdat_resize_unlock(zone->zone_pgdat, &flags);
 
+	shuffle_zone(zone);
+
 	if (onlined_pages) {
 		node_states_set_node(nid, &arg);
 		if (need_zonelists_rebuild)
diff --git a/mm/mincore.c b/mm/mincore.c
index 218099b5ed31..b8842b849604 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -169,6 +169,16 @@ static int mincore_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
 	return 0;
 }
 
+static inline bool can_do_mincore(struct vm_area_struct *vma)
+{
+	if (vma_is_anonymous(vma))
+		return true;
+	if (!vma->vm_file)
+		return false;
+	return inode_owner_or_capable(file_inode(vma->vm_file)) ||
+		inode_permission(file_inode(vma->vm_file), MAY_WRITE) == 0;
+}
+
 /*
  * Do a chunk of "sys_mincore()". We've already checked
  * all the arguments, we hold the mmap semaphore: we should
@@ -189,8 +199,13 @@ static long do_mincore(unsigned long addr, unsigned long pages, unsigned char *v
 	vma = find_vma(current->mm, addr);
 	if (!vma || addr < vma->vm_start)
 		return -ENOMEM;
-	mincore_walk.mm = vma->vm_mm;
 	end = min(vma->vm_end, addr + (pages << PAGE_SHIFT));
+	if (!can_do_mincore(vma)) {
+		unsigned long pages = (end - addr) >> PAGE_SHIFT;
+		memset(vec, 1, pages);
+		return pages;
+	}
+	mincore_walk.mm = vma->vm_mm;
 	err = walk_page_range(addr, end, &mincore_walk);
 	if (err < 0)
 		return err;
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 03fcf73d47da..6d0fa5b65cd0 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -43,6 +43,7 @@
 #include <linux/mempolicy.h>
 #include <linux/memremap.h>
 #include <linux/stop_machine.h>
+#include <linux/random.h>
 #include <linux/sort.h>
 #include <linux/pfn.h>
 #include <linux/backing-dev.h>
@@ -72,6 +73,7 @@
 #include <asm/tlbflush.h>
 #include <asm/div64.h>
 #include "internal.h"
+#include "shuffle.h"
 
 /* prevent >1 _updater_ of zone percpu pageset ->high and ->batch fields */
 static DEFINE_MUTEX(pcp_batch_high_lock);
@@ -336,38 +338,33 @@ static inline bool __meminit early_page_uninitialised(unsigned long pfn)
 }
 
 /*
- * Returns true when the remaining initialisation should be deferred until
- * later in the boot cycle when it can be parallelised.
+ * Calculate first_deferred_pfn in case:
+ * - in MEMMAP_EARLY context
+ * - this is the last zone
+ *
+ * If the first aligned section doesn't exceed the end_pfn, set it to
+ * first_deferred_pfn and return it.
  */
-static bool __meminit
-defer_init(int nid, unsigned long pfn, unsigned long end_pfn)
+unsigned long __meminit
+defer_pfn(int nid, unsigned long start_pfn, unsigned long end_pfn,
+	  enum memmap_context context)
 {
-	static unsigned long prev_end_pfn, nr_initialised;
+	struct pglist_data *pgdat = NODE_DATA(nid);
+	unsigned long pfn;
 
-	/*
-	 * prev_end_pfn static that contains the end of previous zone
-	 * No need to protect because called very early in boot before smp_init.
-	 */
-	if (prev_end_pfn != end_pfn) {
-		prev_end_pfn = end_pfn;
-		nr_initialised = 0;
-	}
+	if (context != MEMMAP_EARLY)
+		return end_pfn;
 
-	/* Always populate low zones for address-constrained allocations */
-	if (end_pfn < pgdat_end_pfn(NODE_DATA(nid)))
-		return false;
+	/* Always populate low zones */
+	if (end_pfn < pgdat_end_pfn(pgdat))
+		return end_pfn;
 
-	/*
-	 * We start only with one section of pages, more pages are added as
-	 * needed until the rest of deferred pages are initialized.
-	 */
-	nr_initialised++;
-	if ((nr_initialised > PAGES_PER_SECTION) &&
-	    (pfn & (PAGES_PER_SECTION - 1)) == 0) {
-		NODE_DATA(nid)->first_deferred_pfn = pfn;
-		return true;
+	pfn = roundup(start_pfn + PAGES_PER_SECTION - 1, PAGES_PER_SECTION);
+	if (end_pfn > pfn) {
+		pgdat->first_deferred_pfn = pfn;
+		end_pfn = pfn;
 	}
-	return false;
+	return end_pfn;
 }
 #else
 #define kasan_free_nondeferred_pages(p, o)	kasan_free_pages(p, o)
@@ -377,9 +374,11 @@ static inline bool early_page_uninitialised(unsigned long pfn)
 	return false;
 }
 
-static inline bool defer_init(int nid, unsigned long pfn, unsigned long end_pfn)
+unsigned long __meminit
+defer_pfn(int nid, unsigned long start_pfn, unsigned long end_pfn,
+	  enum memmap_context context)
 {
-	return false;
+	return end_pfn;
 }
 #endif
 
@@ -742,12 +741,6 @@ static inline void set_page_order(struct page *page, unsigned int order)
 	__SetPageBuddy(page);
 }
 
-static inline void rmv_page_order(struct page *page)
-{
-	__ClearPageBuddy(page);
-	set_page_private(page, 0);
-}
-
 /*
  * This function checks whether a page is free && is the buddy
  * we can coalesce a page and its buddy if
@@ -905,13 +898,10 @@ static inline void __free_one_page(struct page *page,
 		 * Our buddy is free or it is CONFIG_DEBUG_PAGEALLOC guard page,
 		 * merge with it and move up one order.
 		 */
-		if (page_is_guard(buddy)) {
+		if (page_is_guard(buddy))
 			clear_page_guard(zone, buddy, order, migratetype);
-		} else {
-			list_del(&buddy->lru);
-			zone->free_area[order].nr_free--;
-			rmv_page_order(buddy);
-		}
+		else
+			del_page_from_free_area(buddy, &zone->free_area[order]);
 		combined_pfn = buddy_pfn & pfn;
 		page = page + (combined_pfn - pfn);
 		pfn = combined_pfn;
@@ -953,7 +943,8 @@ static inline void __free_one_page(struct page *page,
 	 * so it's less likely to be used soon and more likely to be merged
 	 * as a higher order page
 	 */
-	if ((order < MAX_ORDER-2) && pfn_valid_within(buddy_pfn)) {
+	if ((order < MAX_ORDER-2) && pfn_valid_within(buddy_pfn)
+			&& !is_shuffle_order(order)) {
 		struct page *higher_page, *higher_buddy;
 		combined_pfn = buddy_pfn & pfn;
 		higher_page = page + (combined_pfn - pfn);
@@ -961,15 +952,18 @@ static inline void __free_one_page(struct page *page,
 		higher_buddy = higher_page + (buddy_pfn - combined_pfn);
 		if (pfn_valid_within(buddy_pfn) &&
 		    page_is_buddy(higher_page, higher_buddy, order + 1)) {
-			list_add_tail(&page->lru,
-				&zone->free_area[order].free_list[migratetype]);
-			goto out;
+			add_to_free_area_tail(page, &zone->free_area[order],
+					      migratetype);
+			return;
 		}
 	}
 
-	list_add(&page->lru, &zone->free_area[order].free_list[migratetype]);
-out:
-	zone->free_area[order].nr_free++;
+	if (is_shuffle_order(order))
+		add_to_free_area_random(page, &zone->free_area[order],
+				migratetype);
+	else
+		add_to_free_area(page, &zone->free_area[order], migratetype);
+
 }
 
 /*
@@ -1270,17 +1264,23 @@ static void free_one_page(struct zone *zone,
 	spin_unlock(&zone->lock);
 }
 
-static void __meminit __init_single_page(struct page *page, unsigned long pfn,
-				unsigned long zone, int nid)
+static void __meminit __init_struct_page_nolru(struct page *page,
+					       unsigned long pfn,
+					       unsigned long zone, int nid,
+					       bool is_reserved)
 {
 	mm_zero_struct_page(page);
-	set_page_links(page, zone, nid, pfn);
+
+	/*
+	 * We can use a non-atomic operation for setting the
+	 * PG_reserved flag as we are still initializing the pages.
+	 */
+	set_page_links(page, zone, nid, pfn, is_reserved);
 	init_page_count(page);
 	page_mapcount_reset(page);
 	page_cpupid_reset_last(page);
 	page_kasan_tag_reset(page);
 
-	INIT_LIST_HEAD(&page->lru);
 #ifdef WANT_PAGE_VIRTUAL
 	/* The shift won't overflow because ZONE_NORMAL is below 4G. */
 	if (!is_highmem_idx(zone))
@@ -1288,6 +1288,74 @@ static void __meminit __init_single_page(struct page *page, unsigned long pfn,
 #endif
 }
 
+static void __meminit __init_single_page(struct page *page, unsigned long pfn,
+				unsigned long zone, int nid)
+{
+	__init_struct_page_nolru(page, pfn, zone, nid, false);
+	INIT_LIST_HEAD(&page->lru);
+}
+
+static void __meminit __init_pageblock(unsigned long start_pfn,
+				       unsigned long nr_pages,
+				       unsigned long zone, int nid,
+				       struct dev_pagemap *pgmap,
+				       bool is_reserved)
+{
+	unsigned long nr_pgmask = pageblock_nr_pages - 1;
+	struct page *start_page = pfn_to_page(start_pfn);
+	unsigned long pfn = start_pfn + nr_pages - 1;
+	struct page *page;
+
+	/*
+	 * Enforce the following requirements:
+	 * size > 0
+	 * size < pageblock_nr_pages
+	 * start_pfn -> pfn does not cross pageblock_nr_pages boundary
+	 */
+	VM_BUG_ON(((start_pfn ^ pfn) | (nr_pages - 1)) > nr_pgmask);
+
+	/*
+	 * Work from highest page to lowest, this way we will still be
+	 * warm in the cache when we call set_pageblock_migratetype
+	 * below.
+	 *
+	 * The loop is based around the page pointer as the main index
+	 * instead of the pfn because pfn is not used inside the loop if
+	 * the section number is not in page flags and WANT_PAGE_VIRTUAL
+	 * is not defined.
+	 */
+	for (page = start_page + nr_pages; page-- != start_page; pfn--) {
+		__init_struct_page_nolru(page, pfn, zone, nid, is_reserved);
+
+		/*
+		 * ZONE_DEVICE pages union ->lru with a ->pgmap back
+		 * pointer and hmm_data.  It is a bug if a ZONE_DEVICE
+		 * page is ever freed or placed on a driver-private list.
+		 */
+		page->pgmap = pgmap;
+		if (!pgmap)
+			INIT_LIST_HEAD(&page->lru);
+	}
+
+	/*
+	 * Mark the block movable so that blocks are reserved for
+	 * movable at startup. This will force kernel allocations
+	 * to reserve their blocks rather than leaking throughout
+	 * the address space during boot when many long-lived
+	 * kernel allocations are made.
+	 *
+	 * bitmap is created for zone's valid pfn range. but memmap
+	 * can be created for invalid pages (for alignment)
+	 * check here not to call set_pageblock_migratetype() against
+	 * pfn out of zone.
+	 *
+	 * Please note that MEMMAP_HOTPLUG path doesn't clear memmap
+	 * because this is done early in sparse_add_one_section
+	 */
+	if (!(start_pfn & nr_pgmask))
+		set_pageblock_migratetype(start_page, MIGRATE_MOVABLE);
+}
+
 #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
 static void __meminit init_reserved_page(unsigned long pfn)
 {
@@ -1401,36 +1469,22 @@ int __meminit early_pfn_to_nid(unsigned long pfn)
 #endif
 
 #ifdef CONFIG_NODES_SPAN_OTHER_NODES
-static inline bool __meminit __maybe_unused
-meminit_pfn_in_nid(unsigned long pfn, int node,
-		   struct mminit_pfnnid_cache *state)
+/* Only safe to use early in boot when initialisation is single-threaded */
+static inline bool __meminit early_pfn_in_nid(unsigned long pfn, int node)
 {
 	int nid;
 
-	nid = __early_pfn_to_nid(pfn, state);
+	nid = __early_pfn_to_nid(pfn, &early_pfnnid_cache);
 	if (nid >= 0 && nid != node)
 		return false;
 	return true;
 }
 
-/* Only safe to use early in boot when initialisation is single-threaded */
-static inline bool __meminit early_pfn_in_nid(unsigned long pfn, int node)
-{
-	return meminit_pfn_in_nid(pfn, node, &early_pfnnid_cache);
-}
-
 #else
-
 static inline bool __meminit early_pfn_in_nid(unsigned long pfn, int node)
 {
 	return true;
 }
-static inline bool __meminit  __maybe_unused
-meminit_pfn_in_nid(unsigned long pfn, int node,
-		   struct mminit_pfnnid_cache *state)
-{
-	return true;
-}
 #endif
 
 
@@ -1514,32 +1568,6 @@ void clear_zone_contiguous(struct zone *zone)
 }
 
 #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
-static void __init deferred_free_range(unsigned long pfn,
-				       unsigned long nr_pages)
-{
-	struct page *page;
-	unsigned long i;
-
-	if (!nr_pages)
-		return;
-
-	page = pfn_to_page(pfn);
-
-	/* Free a large naturally-aligned chunk if possible */
-	if (nr_pages == pageblock_nr_pages &&
-	    (pfn & (pageblock_nr_pages - 1)) == 0) {
-		set_pageblock_migratetype(page, MIGRATE_MOVABLE);
-		__free_pages_core(page, pageblock_order);
-		return;
-	}
-
-	for (i = 0; i < nr_pages; i++, page++, pfn++) {
-		if ((pfn & (pageblock_nr_pages - 1)) == 0)
-			set_pageblock_migratetype(page, MIGRATE_MOVABLE);
-		__free_pages_core(page, 0);
-	}
-}
-
 /* Completion tracking for deferred_init_memmap() threads */
 static atomic_t pgdat_init_n_undone __initdata;
 static __initdata DECLARE_COMPLETION(pgdat_init_all_done_comp);
@@ -1551,57 +1579,89 @@ static inline void __init pgdat_init_report_one_done(void)
 }
 
 /*
- * Returns true if page needs to be initialized or freed to buddy allocator.
+ * Returns count if page range needs to be initialized or freed
  *
- * First we check if pfn is valid on architectures where it is possible to have
- * holes within pageblock_nr_pages. On systems where it is not possible, this
- * function is optimized out.
+ * First we check if the contiguous pfns are valid on architectures where it
+ * is possible to have holes within pageblock_nr_pages. On systems where it
+ * is not possible, this function is optimized out.
  *
- * Then, we check if a current large page is valid by only checking the validity
- * of the head pfn.
+ * Then, we check if a current large page is valid by only checking the
+ * validity of the head pfn.
  *
- * Finally, meminit_pfn_in_nid is checked on systems where pfns can interleave
- * within a node: a pfn is between start and end of a node, but does not belong
- * to this memory node.
  */
-static inline bool __init
-deferred_pfn_valid(int nid, unsigned long pfn,
-		   struct mminit_pfnnid_cache *nid_init_state)
+static unsigned long __next_pfn_valid_range(unsigned long *pfn,
+					    unsigned long *i,
+					    unsigned long end_pfn)
 {
-	if (!pfn_valid_within(pfn))
-		return false;
-	if (!(pfn & (pageblock_nr_pages - 1)) && !pfn_valid(pfn))
-		return false;
-	if (!meminit_pfn_in_nid(pfn, nid, nid_init_state))
-		return false;
-	return true;
+	unsigned long start_pfn = *i;
+
+	while (start_pfn < end_pfn) {
+		unsigned long t = ALIGN(start_pfn + 1, pageblock_nr_pages);
+		unsigned long pageblock_pfn = min(t, end_pfn);
+		unsigned long count = 0;
+
+#ifndef CONFIG_HOLES_IN_ZONE
+		if (pfn_valid(start_pfn))
+			count = pageblock_pfn - start_pfn;
+		start_pfn = pageblock_pfn;
+#else
+		while (start_pfn < pageblock_pfn) {
+			if (pfn_valid(start_pfn++)) {
+				count++;
+				continue;
+			}
+
+			if (!count)
+				continue;
+
+			/*
+			 * The last PFN was invalid, report the block of
+			 * PFNs we currently have available and skip over
+			 * the invalid one.
+			 */
+			*pfn = start_pfn - (count + 1);
+			*i = start_pfn;
+			return count;
+		}
+#endif
+		if (!count)
+			continue;
+
+		*pfn = start_pfn - count;
+		*i = start_pfn;
+		return count;
+	}
+
+	return 0;
 }
 
+#define for_each_deferred_pfn_valid_range(pfn, count, i, start_pfn, end_pfn) \
+	for (i = (start_pfn),						     \
+	     count = __next_pfn_valid_range(&pfn, &i, (end_pfn));	     \
+	     count;							     \
+	     count = __next_pfn_valid_range(&pfn, &i, (end_pfn)))
+
 /*
  * Free pages to buddy allocator. Try to free aligned pages in
  * pageblock_nr_pages sizes.
  */
-static void __init deferred_free_pages(int nid, int zid, unsigned long pfn,
+static void __init deferred_free_pages(unsigned long start_pfn,
 				       unsigned long end_pfn)
 {
-	struct mminit_pfnnid_cache nid_init_state = { };
-	unsigned long nr_pgmask = pageblock_nr_pages - 1;
-	unsigned long nr_free = 0;
-
-	for (; pfn < end_pfn; pfn++) {
-		if (!deferred_pfn_valid(nid, pfn, &nid_init_state)) {
-			deferred_free_range(pfn - nr_free, nr_free);
-			nr_free = 0;
-		} else if (!(pfn & nr_pgmask)) {
-			deferred_free_range(pfn - nr_free, nr_free);
-			nr_free = 1;
-			touch_nmi_watchdog();
+	unsigned long i, pfn, count;
+
+	for_each_deferred_pfn_valid_range(pfn, count, i, start_pfn, end_pfn) {
+		struct page *page = pfn_to_page(pfn);
+
+		if (count == pageblock_nr_pages) {
+			__free_pages_core(page, pageblock_order);
 		} else {
-			nr_free++;
+			while (count--)
+				__free_pages_core(page++, 0);
 		}
+
+		touch_nmi_watchdog();
 	}
-	/* Free the last block of pages to allocator */
-	deferred_free_range(pfn - nr_free, nr_free);
 }
 
 /*
@@ -1609,43 +1669,121 @@ static void __init deferred_free_pages(int nid, int zid, unsigned long pfn,
  * by performing it only once every pageblock_nr_pages.
  * Return number of pages initialized.
  */
-static unsigned long  __init deferred_init_pages(int nid, int zid,
-						 unsigned long pfn,
+static unsigned long  __init deferred_init_pages(struct zone *zone,
+						 unsigned long start_pfn,
 						 unsigned long end_pfn)
 {
-	struct mminit_pfnnid_cache nid_init_state = { };
-	unsigned long nr_pgmask = pageblock_nr_pages - 1;
+	int nid = zone_to_nid(zone);
+	unsigned long i, pfn, count;
 	unsigned long nr_pages = 0;
-	struct page *page = NULL;
+	int zid = zone_idx(zone);
 
-	for (; pfn < end_pfn; pfn++) {
-		if (!deferred_pfn_valid(nid, pfn, &nid_init_state)) {
-			page = NULL;
+	for_each_deferred_pfn_valid_range(pfn, count, i, start_pfn, end_pfn) {
+		nr_pages += count;
+		__init_pageblock(pfn, count, zid, nid, NULL, false);
+
+		touch_nmi_watchdog();
+	}
+
+	return nr_pages;
+}
+
+/*
+ * This function is meant to pre-load the iterator for the zone init.
+ * Specifically it walks through the ranges until we are caught up to the
+ * first_init_pfn value and exits there. If we never encounter the value we
+ * return false indicating there are no valid ranges left.
+ */
+static bool __init
+deferred_init_mem_pfn_range_in_zone(u64 *i, struct zone *zone,
+				    unsigned long *spfn, unsigned long *epfn,
+				    unsigned long first_init_pfn)
+{
+	u64 j;
+
+	/*
+	 * Start out by walking through the ranges in this zone that have
+	 * already been initialized. We don't need to do anything with them
+	 * so we just need to flush them out of the system.
+	 */
+	for_each_free_mem_pfn_range_in_zone(j, zone, spfn, epfn) {
+		if (*epfn <= first_init_pfn)
 			continue;
-		} else if (!page || !(pfn & nr_pgmask)) {
-			page = pfn_to_page(pfn);
-			touch_nmi_watchdog();
-		} else {
-			page++;
-		}
-		__init_single_page(page, pfn, zid, nid);
-		nr_pages++;
+		if (*spfn < first_init_pfn)
+			*spfn = first_init_pfn;
+		*i = j;
+		return true;
 	}
-	return (nr_pages);
+
+	return false;
+}
+
+/*
+ * Initialize and free pages. We do it in two loops: first we initialize
+ * struct page, than free to buddy allocator, because while we are
+ * freeing pages we can access pages that are ahead (computing buddy
+ * page in __free_one_page()).
+ *
+ * In order to try and keep some memory in the cache we have the loop
+ * broken along max page order boundaries. This way we will not cause
+ * any issues with the buddy page computation.
+ */
+static unsigned long __init
+deferred_init_maxorder(u64 *i, struct zone *zone, unsigned long *start_pfn,
+		       unsigned long *end_pfn)
+{
+	unsigned long mo_pfn = ALIGN(*start_pfn + 1, MAX_ORDER_NR_PAGES);
+	unsigned long spfn = *start_pfn, epfn = *end_pfn;
+	unsigned long nr_pages = 0;
+	u64 j = *i;
+
+	/* First we loop through and initialize the page values */
+	for_each_free_mem_pfn_range_in_zone_from(j, zone, &spfn, &epfn) {
+		unsigned long t;
+
+		if (mo_pfn <= spfn)
+			break;
+
+		t = min(mo_pfn, epfn);
+		nr_pages += deferred_init_pages(zone, spfn, t);
+
+		if (mo_pfn <= epfn)
+			break;
+	}
+
+	/* Reset values and now loop through freeing pages as needed */
+	j = *i;
+
+	for_each_free_mem_pfn_range_in_zone_from(j, zone, start_pfn, end_pfn) {
+		unsigned long t;
+
+		if (mo_pfn <= *start_pfn)
+			break;
+
+		t = min(mo_pfn, *end_pfn);
+		deferred_free_pages(*start_pfn, t);
+		*start_pfn = t;
+
+		if (mo_pfn < *end_pfn)
+			break;
+	}
+
+	/* Store our current values to be reused on the next iteration */
+	*i = j;
+
+	return nr_pages;
 }
 
 /* Initialise remaining memory on a node */
 static int __init deferred_init_memmap(void *data)
 {
 	pg_data_t *pgdat = data;
-	int nid = pgdat->node_id;
+	const struct cpumask *cpumask = cpumask_of_node(pgdat->node_id);
+	unsigned long spfn = 0, epfn = 0, nr_pages = 0;
+	unsigned long first_init_pfn, flags;
 	unsigned long start = jiffies;
-	unsigned long nr_pages = 0;
-	unsigned long spfn, epfn, first_init_pfn, flags;
-	phys_addr_t spa, epa;
-	int zid;
 	struct zone *zone;
-	const struct cpumask *cpumask = cpumask_of_node(pgdat->node_id);
+	int zid;
 	u64 i;
 
 	/* Bind memory initialisation thread to a local node if possible */
@@ -1671,31 +1809,27 @@ static int __init deferred_init_memmap(void *data)
 		if (first_init_pfn < zone_end_pfn(zone))
 			break;
 	}
-	first_init_pfn = max(zone->zone_start_pfn, first_init_pfn);
+
+	/* If the zone is empty somebody else may have cleared out the zone */
+	if (!deferred_init_mem_pfn_range_in_zone(&i, zone, &spfn, &epfn,
+						 first_init_pfn))
+		goto zone_empty;
 
 	/*
-	 * Initialize and free pages. We do it in two loops: first we initialize
-	 * struct page, than free to buddy allocator, because while we are
-	 * freeing pages we can access pages that are ahead (computing buddy
-	 * page in __free_one_page()).
+	 * Initialize and free pages in MAX_ORDER sized increments so
+	 * that we can avoid introducing any issues with the buddy
+	 * allocator.
 	 */
-	for_each_free_mem_range(i, nid, MEMBLOCK_NONE, &spa, &epa, NULL) {
-		spfn = max_t(unsigned long, first_init_pfn, PFN_UP(spa));
-		epfn = min_t(unsigned long, zone_end_pfn(zone), PFN_DOWN(epa));
-		nr_pages += deferred_init_pages(nid, zid, spfn, epfn);
-	}
-	for_each_free_mem_range(i, nid, MEMBLOCK_NONE, &spa, &epa, NULL) {
-		spfn = max_t(unsigned long, first_init_pfn, PFN_UP(spa));
-		epfn = min_t(unsigned long, zone_end_pfn(zone), PFN_DOWN(epa));
-		deferred_free_pages(nid, zid, spfn, epfn);
-	}
+	while (spfn < epfn)
+		nr_pages += deferred_init_maxorder(&i, zone, &spfn, &epfn);
+zone_empty:
 	pgdat_resize_unlock(pgdat, &flags);
 
 	/* Sanity check that the next zone really is unpopulated */
 	WARN_ON(++zid < MAX_NR_ZONES && populated_zone(++zone));
 
-	pr_info("node %d initialised, %lu pages in %ums\n", nid, nr_pages,
-					jiffies_to_msecs(jiffies - start));
+	pr_info("node %d initialised, %lu pages in %ums\n",
+		pgdat->node_id,	nr_pages, jiffies_to_msecs(jiffies - start));
 
 	pgdat_init_report_one_done();
 	return 0;
@@ -1719,14 +1853,11 @@ static int __init deferred_init_memmap(void *data)
 static noinline bool __init
 deferred_grow_zone(struct zone *zone, unsigned int order)
 {
-	int zid = zone_idx(zone);
-	int nid = zone_to_nid(zone);
-	pg_data_t *pgdat = NODE_DATA(nid);
 	unsigned long nr_pages_needed = ALIGN(1 << order, PAGES_PER_SECTION);
-	unsigned long nr_pages = 0;
-	unsigned long first_init_pfn, spfn, epfn, t, flags;
+	pg_data_t *pgdat = zone->zone_pgdat;
 	unsigned long first_deferred_pfn = pgdat->first_deferred_pfn;
-	phys_addr_t spa, epa;
+	unsigned long spfn, epfn, flags;
+	unsigned long nr_pages = 0;
 	u64 i;
 
 	/* Only the last zone may have deferred pages */
@@ -1755,37 +1886,24 @@ deferred_grow_zone(struct zone *zone, unsigned int order)
 		return true;
 	}
 
-	first_init_pfn = max(zone->zone_start_pfn, first_deferred_pfn);
-
-	if (first_init_pfn >= pgdat_end_pfn(pgdat)) {
+	/* If the zone is empty somebody else may have cleared out the zone */
+	if (!deferred_init_mem_pfn_range_in_zone(&i, zone, &spfn, &epfn,
+						 first_deferred_pfn)) {
+		pgdat->first_deferred_pfn = ULONG_MAX;
 		pgdat_resize_unlock(pgdat, &flags);
-		return false;
+		return true;
 	}
 
-	for_each_free_mem_range(i, nid, MEMBLOCK_NONE, &spa, &epa, NULL) {
-		spfn = max_t(unsigned long, first_init_pfn, PFN_UP(spa));
-		epfn = min_t(unsigned long, zone_end_pfn(zone), PFN_DOWN(epa));
-
-		while (spfn < epfn && nr_pages < nr_pages_needed) {
-			t = ALIGN(spfn + PAGES_PER_SECTION, PAGES_PER_SECTION);
-			first_deferred_pfn = min(t, epfn);
-			nr_pages += deferred_init_pages(nid, zid, spfn,
-							first_deferred_pfn);
-			spfn = first_deferred_pfn;
-		}
-
-		if (nr_pages >= nr_pages_needed)
-			break;
+	/*
+	 * Initialize and free pages in MAX_ORDER sized increments so
+	 * that we can avoid introducing any issues with the buddy
+	 * allocator.
+	 */
+	while (spfn < epfn && nr_pages < nr_pages_needed) {
+		nr_pages += deferred_init_maxorder(&i, zone, &spfn, &epfn);
+		first_deferred_pfn = spfn;
 	}
 
-	for_each_free_mem_range(i, nid, MEMBLOCK_NONE, &spa, &epa, NULL) {
-		spfn = max_t(unsigned long, first_init_pfn, PFN_UP(spa));
-		epfn = min_t(unsigned long, first_deferred_pfn, PFN_DOWN(epa));
-		deferred_free_pages(nid, zid, spfn, epfn);
-
-		if (first_deferred_pfn == epfn)
-			break;
-	}
 	pgdat->first_deferred_pfn = first_deferred_pfn;
 	pgdat_resize_unlock(pgdat, &flags);
 
@@ -1809,9 +1927,9 @@ _deferred_grow_zone(struct zone *zone, unsigned int order)
 void __init page_alloc_init_late(void)
 {
 	struct zone *zone;
+	int nid;
 
 #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
-	int nid;
 
 	/* There will be num_node_state(N_MEMORY) threads */
 	atomic_set(&pgdat_init_n_undone, num_node_state(N_MEMORY));
@@ -1836,6 +1954,9 @@ void __init page_alloc_init_late(void)
 	memblock_discard();
 #endif
 
+	for_each_node_state(nid, N_MEMORY)
+		shuffle_free_memory(NODE_DATA(nid));
+
 	for_each_populated_zone(zone)
 		set_zone_contiguous(zone);
 }
@@ -1906,8 +2027,7 @@ static inline void expand(struct zone *zone, struct page *page,
 		if (set_page_guard(zone, &page[size], high, migratetype))
 			continue;
 
-		list_add(&page[size].lru, &area->free_list[migratetype]);
-		area->nr_free++;
+		add_to_free_area(&page[size], area, migratetype);
 		set_page_order(&page[size], high);
 	}
 }
@@ -2048,13 +2168,10 @@ struct page *__rmqueue_smallest(struct zone *zone, unsigned int order,
 	/* Find a page of the appropriate size in the preferred list */
 	for (current_order = order; current_order < MAX_ORDER; ++current_order) {
 		area = &(zone->free_area[current_order]);
-		page = list_first_entry_or_null(&area->free_list[migratetype],
-							struct page, lru);
+		page = get_page_from_free_area(area, migratetype);
 		if (!page)
 			continue;
-		list_del(&page->lru);
-		rmv_page_order(page);
-		area->nr_free--;
+		del_page_from_free_area(page, area);
 		expand(zone, page, order, current_order, area, migratetype);
 		set_pcppage_migratetype(page, migratetype);
 		return page;
@@ -2140,8 +2257,7 @@ static int move_freepages(struct zone *zone,
 		}
 
 		order = page_order(page);
-		list_move(&page->lru,
-			  &zone->free_area[order].free_list[migratetype]);
+		move_to_free_area(page, &zone->free_area[order], migratetype);
 		page += 1 << order;
 		pages_moved += 1 << order;
 	}
@@ -2329,7 +2445,7 @@ static void steal_suitable_fallback(struct zone *zone, struct page *page,
 
 single_page:
 	area = &zone->free_area[current_order];
-	list_move(&page->lru, &area->free_list[start_type]);
+	move_to_free_area(page, area, start_type);
 }
 
 /*
@@ -2353,7 +2469,7 @@ int find_suitable_fallback(struct free_area *area, unsigned int order,
 		if (fallback_mt == MIGRATE_TYPES)
 			break;
 
-		if (list_empty(&area->free_list[fallback_mt]))
+		if (free_area_empty(area, fallback_mt))
 			continue;
 
 		if (can_steal_fallback(order, migratetype))
@@ -2440,9 +2556,7 @@ static bool unreserve_highatomic_pageblock(const struct alloc_context *ac,
 		for (order = 0; order < MAX_ORDER; order++) {
 			struct free_area *area = &(zone->free_area[order]);
 
-			page = list_first_entry_or_null(
-					&area->free_list[MIGRATE_HIGHATOMIC],
-					struct page, lru);
+			page = get_page_from_free_area(area, MIGRATE_HIGHATOMIC);
 			if (!page)
 				continue;
 
@@ -2565,8 +2679,7 @@ __rmqueue_fallback(struct zone *zone, int order, int start_migratetype,
 	VM_BUG_ON(current_order == MAX_ORDER);
 
 do_steal:
-	page = list_first_entry(&area->free_list[fallback_mt],
-							struct page, lru);
+	page = get_page_from_free_area(area, fallback_mt);
 
 	steal_suitable_fallback(zone, page, alloc_flags, start_migratetype,
 								can_steal);
@@ -3003,6 +3116,7 @@ EXPORT_SYMBOL_GPL(split_page);
 
 int __isolate_free_page(struct page *page, unsigned int order)
 {
+	struct free_area *area = &page_zone(page)->free_area[order];
 	unsigned long watermark;
 	struct zone *zone;
 	int mt;
@@ -3027,9 +3141,8 @@ int __isolate_free_page(struct page *page, unsigned int order)
 	}
 
 	/* Remove page from free list */
-	list_del(&page->lru);
-	zone->free_area[order].nr_free--;
-	rmv_page_order(page);
+
+	del_page_from_free_area(page, area);
 
 	/*
 	 * Set the pageblock if the isolated page is at least half of a
@@ -3327,13 +3440,13 @@ bool __zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark,
 			continue;
 
 		for (mt = 0; mt < MIGRATE_PCPTYPES; mt++) {
-			if (!list_empty(&area->free_list[mt]))
+			if (!free_area_empty(area, mt))
 				return true;
 		}
 
 #ifdef CONFIG_CMA
 		if ((alloc_flags & ALLOC_CMA) &&
-		    !list_empty(&area->free_list[MIGRATE_CMA])) {
+		    !free_area_empty(area, MIGRATE_CMA)) {
 			return true;
 		}
 #endif
@@ -5254,7 +5367,7 @@ void show_free_areas(unsigned int filter, nodemask_t *nodemask)
 
 			types[order] = 0;
 			for (type = 0; type < MIGRATE_TYPES; type++) {
-				if (!list_empty(&area->free_list[type]))
+				if (!free_area_empty(area, type))
 					types[order] |= 1 << type;
 			}
 		}
@@ -5709,6 +5822,36 @@ overlap_memmap_init(unsigned long zone, unsigned long *pfn)
 	return false;
 }
 
+static void __meminit __memmap_init_hotplug(unsigned long size, int nid,
+					    unsigned long zone,
+					    unsigned long start_pfn,
+					    struct dev_pagemap *pgmap)
+{
+	unsigned long pfn = start_pfn + size;
+
+	while (pfn != start_pfn) {
+		unsigned long stride = pfn;
+
+		pfn = max(ALIGN_DOWN(pfn - 1, pageblock_nr_pages), start_pfn);
+		stride -= pfn;
+
+		/*
+		 * The last argument of __init_pageblock is a boolean
+		 * value indicating if the page will be marked as reserved.
+		 *
+		 * Mark page reserved as it will need to wait for onlining
+		 * phase for it to be fully associated with a zone.
+		 *
+		 * Under certain circumstances ZONE_DEVICE pages may not
+		 * need to be marked as reserved, however there is still
+		 * code that is depending on this being set for now.
+		 */
+		__init_pageblock(pfn, stride, zone, nid, pgmap, true);
+
+		cond_resched();
+	}
+}
+
 /*
  * Initially all pages are reserved - free ones are freed
  * up by memblock_free_all() once the early boot process is
@@ -5719,49 +5862,59 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
 		struct vmem_altmap *altmap)
 {
 	unsigned long pfn, end_pfn = start_pfn + size;
-	struct page *page;
 
 	if (highest_memmap_pfn < end_pfn - 1)
 		highest_memmap_pfn = end_pfn - 1;
 
+	if (context == MEMMAP_HOTPLUG) {
 #ifdef CONFIG_ZONE_DEVICE
-	/*
-	 * Honor reservation requested by the driver for this ZONE_DEVICE
-	 * memory. We limit the total number of pages to initialize to just
-	 * those that might contain the memory mapping. We will defer the
-	 * ZONE_DEVICE page initialization until after we have released
-	 * the hotplug lock.
-	 */
-	if (zone == ZONE_DEVICE) {
-		if (!altmap)
-			return;
+		/*
+		 * Honor reservation requested by the driver for this
+		 * ZONE_DEVICE memory. We limit the total number of pages to
+		 * initialize to just those that might contain the memory
+		 * mapping. We will defer the ZONE_DEVICE page initialization
+		 * until after we have released the hotplug lock.
+		 */
+		if (zone == ZONE_DEVICE) {
+			if (!altmap)
+				return;
+
+			if (start_pfn == altmap->base_pfn)
+				start_pfn += altmap->reserve;
+			end_pfn = altmap->base_pfn +
+				  vmem_altmap_offset(altmap);
+		}
+#endif
+		/*
+		 * For these ZONE_DEVICE pages we don't need to record the
+		 * pgmap as they should represent only those pages used to
+		 * store the memory map. The actual ZONE_DEVICE pages will
+		 * be initialized later.
+		 */
+		__memmap_init_hotplug(end_pfn - start_pfn, nid, zone,
+				      start_pfn, NULL);
 
-		if (start_pfn == altmap->base_pfn)
-			start_pfn += altmap->reserve;
-		end_pfn = altmap->base_pfn + vmem_altmap_offset(altmap);
+		return;
 	}
-#endif
+
+	end_pfn = defer_pfn(nid, start_pfn, end_pfn, context);
 
 	for (pfn = start_pfn; pfn < end_pfn; pfn++) {
+		struct page *page;
+
 		/*
 		 * There can be holes in boot-time mem_map[]s handed to this
 		 * function.  They do not exist on hotplugged memory.
 		 */
-		if (context == MEMMAP_EARLY) {
-			if (!early_pfn_valid(pfn))
-				continue;
-			if (!early_pfn_in_nid(pfn, nid))
-				continue;
-			if (overlap_memmap_init(zone, &pfn))
-				continue;
-			if (defer_init(nid, pfn, end_pfn))
-				break;
-		}
+		if (!early_pfn_valid(pfn))
+			continue;
+		if (!early_pfn_in_nid(pfn, nid))
+			continue;
+		if (overlap_memmap_init(zone, &pfn))
+			continue;
 
 		page = pfn_to_page(pfn);
 		__init_single_page(page, pfn, zone, nid);
-		if (context == MEMMAP_HOTPLUG)
-			__SetPageReserved(page);
 
 		/*
 		 * Mark the block movable so that blocks are reserved for
@@ -5788,7 +5941,6 @@ void __ref memmap_init_zone_device(struct zone *zone,
 				   unsigned long size,
 				   struct dev_pagemap *pgmap)
 {
-	unsigned long pfn, end_pfn = start_pfn + size;
 	struct pglist_data *pgdat = zone->zone_pgdat;
 	unsigned long zone_idx = zone_idx(zone);
 	unsigned long start = jiffies;
@@ -5804,53 +5956,13 @@ void __ref memmap_init_zone_device(struct zone *zone,
 	 */
 	if (pgmap->altmap_valid) {
 		struct vmem_altmap *altmap = &pgmap->altmap;
+		unsigned long end_pfn = start_pfn + size;
 
 		start_pfn = altmap->base_pfn + vmem_altmap_offset(altmap);
 		size = end_pfn - start_pfn;
 	}
 
-	for (pfn = start_pfn; pfn < end_pfn; pfn++) {
-		struct page *page = pfn_to_page(pfn);
-
-		__init_single_page(page, pfn, zone_idx, nid);
-
-		/*
-		 * Mark page reserved as it will need to wait for onlining
-		 * phase for it to be fully associated with a zone.
-		 *
-		 * We can use the non-atomic __set_bit operation for setting
-		 * the flag as we are still initializing the pages.
-		 */
-		__SetPageReserved(page);
-
-		/*
-		 * ZONE_DEVICE pages union ->lru with a ->pgmap back
-		 * pointer and hmm_data.  It is a bug if a ZONE_DEVICE
-		 * page is ever freed or placed on a driver-private list.
-		 */
-		page->pgmap = pgmap;
-		page->hmm_data = 0;
-
-		/*
-		 * Mark the block movable so that blocks are reserved for
-		 * movable at startup. This will force kernel allocations
-		 * to reserve their blocks rather than leaking throughout
-		 * the address space during boot when many long-lived
-		 * kernel allocations are made.
-		 *
-		 * bitmap is created for zone's valid pfn range. but memmap
-		 * can be created for invalid pages (for alignment)
-		 * check here not to call set_pageblock_migratetype() against
-		 * pfn out of zone.
-		 *
-		 * Please note that MEMMAP_HOTPLUG path doesn't clear memmap
-		 * because this is done early in sparse_add_one_section
-		 */
-		if (!(pfn & (pageblock_nr_pages - 1))) {
-			set_pageblock_migratetype(page, MIGRATE_MOVABLE);
-			cond_resched();
-		}
-	}
+	__memmap_init_hotplug(size, nid, zone_idx, start_pfn, pgmap);
 
 	pr_info("%s initialised, %lu pages in %ums\n", dev_name(pgmap->dev),
 		size, jiffies_to_msecs(jiffies - start));
@@ -8319,8 +8431,9 @@ int alloc_contig_range(unsigned long start, unsigned long end,
 				pfn_max_align_up(end), migratetype);
 	return ret;
 }
+#endif
 
-void free_contig_range(unsigned long pfn, unsigned nr_pages)
+void free_contig_range(unsigned long pfn, unsigned int nr_pages)
 {
 	unsigned int count = 0;
 
@@ -8332,7 +8445,6 @@ void free_contig_range(unsigned long pfn, unsigned nr_pages)
 	}
 	WARN(count != 0, "%d pages are still in use!\n", count);
 }
-#endif
 
 #ifdef CONFIG_MEMORY_HOTPLUG
 /*
@@ -8415,9 +8527,7 @@ __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn)
 		pr_info("remove from free list %lx %d %lx\n",
 			pfn, 1 << order, end_pfn);
 #endif
-		list_del(&page->lru);
-		rmv_page_order(page);
-		zone->free_area[order].nr_free--;
+		del_page_from_free_area(page, &zone->free_area[order]);
 		for (i = 0; i < (1 << order); i++)
 			SetPageReserved((page+i));
 		pfn += (1 << order);
diff --git a/mm/percpu-internal.h b/mm/percpu-internal.h
index b1739dc06b73..0468ba500bd4 100644
--- a/mm/percpu-internal.h
+++ b/mm/percpu-internal.h
@@ -9,8 +9,17 @@
  * pcpu_block_md is the metadata block struct.
  * Each chunk's bitmap is split into a number of full blocks.
  * All units are in terms of bits.
+ *
+ * The scan hint is the largest known contiguous area before the contig hint.
+ * It is not necessarily the actual largest contig hint though.  There is an
+ * invariant that the scan_hint_start > contig_hint_start iff
+ * scan_hint == contig_hint.  This is necessary because when scanning forward,
+ * we don't know if a new contig hint would be better than the current one.
  */
 struct pcpu_block_md {
+	int			scan_hint;	/* scan hint for block */
+	int			scan_hint_start; /* block relative starting
+						    position of the scan hint */
 	int                     contig_hint;    /* contig hint for block */
 	int                     contig_hint_start; /* block relative starting
 						      position of the contig hint */
@@ -19,6 +28,7 @@ struct pcpu_block_md {
 	int                     right_free;     /* size of free space along
 						   the right side of the block */
 	int                     first_free;     /* block position of first free */
+	int			nr_bits;	/* total bits responsible for */
 };
 
 struct pcpu_chunk {
@@ -29,9 +39,7 @@ struct pcpu_chunk {
 
 	struct list_head	list;		/* linked to pcpu_slot lists */
 	int			free_bytes;	/* free bytes in the chunk */
-	int			contig_bits;	/* max contiguous size hint */
-	int			contig_bits_start; /* contig_bits starting
-						      offset */
+	struct pcpu_block_md	chunk_md;
 	void			*base_addr;	/* base address of this chunk */
 
 	unsigned long		*alloc_map;	/* allocation map */
@@ -39,7 +47,6 @@ struct pcpu_chunk {
 	struct pcpu_block_md	*md_blocks;	/* metadata blocks */
 
 	void			*data;		/* chunk data */
-	int			first_bit;	/* no free below this */
 	bool			immutable;	/* no [de]population allowed */
 	int			start_offset;	/* the overlap with the previous
 						   region to have a page aligned
diff --git a/mm/percpu-km.c b/mm/percpu-km.c
index b68d5df14731..3a2ff5c9192c 100644
--- a/mm/percpu-km.c
+++ b/mm/percpu-km.c
@@ -70,7 +70,7 @@ static struct pcpu_chunk *pcpu_create_chunk(gfp_t gfp)
 	chunk->base_addr = page_address(pages);
 
 	spin_lock_irqsave(&pcpu_lock, flags);
-	pcpu_chunk_populated(chunk, 0, nr_pages, false);
+	pcpu_chunk_populated(chunk, 0, nr_pages);
 	spin_unlock_irqrestore(&pcpu_lock, flags);
 
 	pcpu_stats_chunk_alloc();
diff --git a/mm/percpu-stats.c b/mm/percpu-stats.c
index b5fdd43b60c9..ef5034a0464e 100644
--- a/mm/percpu-stats.c
+++ b/mm/percpu-stats.c
@@ -53,6 +53,7 @@ static int find_max_nr_alloc(void)
 static void chunk_map_stats(struct seq_file *m, struct pcpu_chunk *chunk,
 			    int *buffer)
 {
+	struct pcpu_block_md *chunk_md = &chunk->chunk_md;
 	int i, last_alloc, as_len, start, end;
 	int *alloc_sizes, *p;
 	/* statistics */
@@ -121,9 +122,9 @@ static void chunk_map_stats(struct seq_file *m, struct pcpu_chunk *chunk,
 	P("nr_alloc", chunk->nr_alloc);
 	P("max_alloc_size", chunk->max_alloc_size);
 	P("empty_pop_pages", chunk->nr_empty_pop_pages);
-	P("first_bit", chunk->first_bit);
+	P("first_bit", chunk_md->first_free);
 	P("free_bytes", chunk->free_bytes);
-	P("contig_bytes", chunk->contig_bits * PCPU_MIN_ALLOC_SIZE);
+	P("contig_bytes", chunk_md->contig_hint * PCPU_MIN_ALLOC_SIZE);
 	P("sum_frag", sum_frag);
 	P("max_frag", max_frag);
 	P("cur_min_alloc", cur_min_alloc);
diff --git a/mm/percpu.c b/mm/percpu.c
index 2e6fc8d552c9..30e683f42861 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -94,6 +94,8 @@
 
 /* the slots are sorted by free bytes left, 1-31 bytes share the same slot */
 #define PCPU_SLOT_BASE_SHIFT		5
+/* chunks in slots below this are subject to being sidelined on failed alloc */
+#define PCPU_SLOT_FAIL_THRESHOLD	3
 
 #define PCPU_EMPTY_POP_PAGES_LOW	2
 #define PCPU_EMPTY_POP_PAGES_HIGH	4
@@ -231,10 +233,13 @@ static int pcpu_size_to_slot(int size)
 
 static int pcpu_chunk_slot(const struct pcpu_chunk *chunk)
 {
-	if (chunk->free_bytes < PCPU_MIN_ALLOC_SIZE || chunk->contig_bits == 0)
+	const struct pcpu_block_md *chunk_md = &chunk->chunk_md;
+
+	if (chunk->free_bytes < PCPU_MIN_ALLOC_SIZE ||
+	    chunk_md->contig_hint == 0)
 		return 0;
 
-	return pcpu_size_to_slot(chunk->free_bytes);
+	return pcpu_size_to_slot(chunk_md->contig_hint * PCPU_MIN_ALLOC_SIZE);
 }
 
 /* set the pointer to a chunk in a page struct */
@@ -318,6 +323,34 @@ static unsigned long pcpu_block_off_to_off(int index, int off)
 	return index * PCPU_BITMAP_BLOCK_BITS + off;
 }
 
+/*
+ * pcpu_next_hint - determine which hint to use
+ * @block: block of interest
+ * @alloc_bits: size of allocation
+ *
+ * This determines if we should scan based on the scan_hint or first_free.
+ * In general, we want to scan from first_free to fulfill allocations by
+ * first fit.  However, if we know a scan_hint at position scan_hint_start
+ * cannot fulfill an allocation, we can begin scanning from there knowing
+ * the contig_hint will be our fallback.
+ */
+static int pcpu_next_hint(struct pcpu_block_md *block, int alloc_bits)
+{
+	/*
+	 * The three conditions below determine if we can skip past the
+	 * scan_hint.  First, does the scan hint exist.  Second, is the
+	 * contig_hint after the scan_hint (possibly not true iff
+	 * contig_hint == scan_hint).  Third, is the allocation request
+	 * larger than the scan_hint.
+	 */
+	if (block->scan_hint &&
+	    block->contig_hint_start > block->scan_hint_start &&
+	    alloc_bits > block->scan_hint)
+		return block->scan_hint_start + block->scan_hint;
+
+	return block->first_free;
+}
+
 /**
  * pcpu_next_md_free_region - finds the next hint free area
  * @chunk: chunk of interest
@@ -413,9 +446,11 @@ static void pcpu_next_fit_region(struct pcpu_chunk *chunk, int alloc_bits,
 		if (block->contig_hint &&
 		    block->contig_hint_start >= block_off &&
 		    block->contig_hint >= *bits + alloc_bits) {
+			int start = pcpu_next_hint(block, alloc_bits);
+
 			*bits += alloc_bits + block->contig_hint_start -
-				 block->first_free;
-			*bit_off = pcpu_block_off_to_off(i, block->first_free);
+				 start;
+			*bit_off = pcpu_block_off_to_off(i, start);
 			return;
 		}
 		/* reset to satisfy the second predicate above */
@@ -488,6 +523,22 @@ static void pcpu_mem_free(void *ptr)
 	kvfree(ptr);
 }
 
+static void __pcpu_chunk_move(struct pcpu_chunk *chunk, int slot,
+			      bool move_front)
+{
+	if (chunk != pcpu_reserved_chunk) {
+		if (move_front)
+			list_move(&chunk->list, &pcpu_slot[slot]);
+		else
+			list_move_tail(&chunk->list, &pcpu_slot[slot]);
+	}
+}
+
+static void pcpu_chunk_move(struct pcpu_chunk *chunk, int slot)
+{
+	__pcpu_chunk_move(chunk, slot, true);
+}
+
 /**
  * pcpu_chunk_relocate - put chunk in the appropriate chunk slot
  * @chunk: chunk of interest
@@ -505,110 +556,39 @@ static void pcpu_chunk_relocate(struct pcpu_chunk *chunk, int oslot)
 {
 	int nslot = pcpu_chunk_slot(chunk);
 
-	if (chunk != pcpu_reserved_chunk && oslot != nslot) {
-		if (oslot < nslot)
-			list_move(&chunk->list, &pcpu_slot[nslot]);
-		else
-			list_move_tail(&chunk->list, &pcpu_slot[nslot]);
-	}
+	if (oslot != nslot)
+		__pcpu_chunk_move(chunk, nslot, oslot < nslot);
 }
 
-/**
- * pcpu_cnt_pop_pages- counts populated backing pages in range
+/*
+ * pcpu_update_empty_pages - update empty page counters
  * @chunk: chunk of interest
- * @bit_off: start offset
- * @bits: size of area to check
+ * @nr: nr of empty pages
  *
- * Calculates the number of populated pages in the region
- * [page_start, page_end).  This keeps track of how many empty populated
- * pages are available and decide if async work should be scheduled.
- *
- * RETURNS:
- * The nr of populated pages.
+ * This is used to keep track of the empty pages now based on the premise
+ * a md_block covers a page.  The hint update functions recognize if a block
+ * is made full or broken to calculate deltas for keeping track of free pages.
  */
-static inline int pcpu_cnt_pop_pages(struct pcpu_chunk *chunk, int bit_off,
-				     int bits)
+static inline void pcpu_update_empty_pages(struct pcpu_chunk *chunk, int nr)
 {
-	int page_start = PFN_UP(bit_off * PCPU_MIN_ALLOC_SIZE);
-	int page_end = PFN_DOWN((bit_off + bits) * PCPU_MIN_ALLOC_SIZE);
-
-	if (page_start >= page_end)
-		return 0;
-
-	/*
-	 * bitmap_weight counts the number of bits set in a bitmap up to
-	 * the specified number of bits.  This is counting the populated
-	 * pages up to page_end and then subtracting the populated pages
-	 * up to page_start to count the populated pages in
-	 * [page_start, page_end).
-	 */
-	return bitmap_weight(chunk->populated, page_end) -
-	       bitmap_weight(chunk->populated, page_start);
-}
-
-/**
- * pcpu_chunk_update - updates the chunk metadata given a free area
- * @chunk: chunk of interest
- * @bit_off: chunk offset
- * @bits: size of free area
- *
- * This updates the chunk's contig hint and starting offset given a free area.
- * Choose the best starting offset if the contig hint is equal.
- */
-static void pcpu_chunk_update(struct pcpu_chunk *chunk, int bit_off, int bits)
-{
-	if (bits > chunk->contig_bits) {
-		chunk->contig_bits_start = bit_off;
-		chunk->contig_bits = bits;
-	} else if (bits == chunk->contig_bits && chunk->contig_bits_start &&
-		   (!bit_off ||
-		    __ffs(bit_off) > __ffs(chunk->contig_bits_start))) {
-		/* use the start with the best alignment */
-		chunk->contig_bits_start = bit_off;
-	}
+	chunk->nr_empty_pop_pages += nr;
+	if (chunk != pcpu_reserved_chunk)
+		pcpu_nr_empty_pop_pages += nr;
 }
 
-/**
- * pcpu_chunk_refresh_hint - updates metadata about a chunk
- * @chunk: chunk of interest
- *
- * Iterates over the metadata blocks to find the largest contig area.
- * It also counts the populated pages and uses the delta to update the
- * global count.
- *
- * Updates:
- *      chunk->contig_bits
- *      chunk->contig_bits_start
- *      nr_empty_pop_pages (chunk and global)
+/*
+ * pcpu_region_overlap - determines if two regions overlap
+ * @a: start of first region, inclusive
+ * @b: end of first region, exclusive
+ * @x: start of second region, inclusive
+ * @y: end of second region, exclusive
+ *
+ * This is used to determine if the hint region [a, b) overlaps with the
+ * allocated region [x, y).
  */
-static void pcpu_chunk_refresh_hint(struct pcpu_chunk *chunk)
+static inline bool pcpu_region_overlap(int a, int b, int x, int y)
 {
-	int bit_off, bits, nr_empty_pop_pages;
-
-	/* clear metadata */
-	chunk->contig_bits = 0;
-
-	bit_off = chunk->first_bit;
-	bits = nr_empty_pop_pages = 0;
-	pcpu_for_each_md_free_region(chunk, bit_off, bits) {
-		pcpu_chunk_update(chunk, bit_off, bits);
-
-		nr_empty_pop_pages += pcpu_cnt_pop_pages(chunk, bit_off, bits);
-	}
-
-	/*
-	 * Keep track of nr_empty_pop_pages.
-	 *
-	 * The chunk maintains the previous number of free pages it held,
-	 * so the delta is used to update the global counter.  The reserved
-	 * chunk is not part of the free page count as they are populated
-	 * at init and are special to serving reserved allocations.
-	 */
-	if (chunk != pcpu_reserved_chunk)
-		pcpu_nr_empty_pop_pages +=
-			(nr_empty_pop_pages - chunk->nr_empty_pop_pages);
-
-	chunk->nr_empty_pop_pages = nr_empty_pop_pages;
+	return (a < y) && (x < b);
 }
 
 /**
@@ -629,16 +609,132 @@ static void pcpu_block_update(struct pcpu_block_md *block, int start, int end)
 	if (start == 0)
 		block->left_free = contig;
 
-	if (end == PCPU_BITMAP_BLOCK_BITS)
+	if (end == block->nr_bits)
 		block->right_free = contig;
 
 	if (contig > block->contig_hint) {
+		/* promote the old contig_hint to be the new scan_hint */
+		if (start > block->contig_hint_start) {
+			if (block->contig_hint > block->scan_hint) {
+				block->scan_hint_start =
+					block->contig_hint_start;
+				block->scan_hint = block->contig_hint;
+			} else if (start < block->scan_hint_start) {
+				/*
+				 * The old contig_hint == scan_hint.  But, the
+				 * new contig is larger so hold the invariant
+				 * scan_hint_start < contig_hint_start.
+				 */
+				block->scan_hint = 0;
+			}
+		} else {
+			block->scan_hint = 0;
+		}
 		block->contig_hint_start = start;
 		block->contig_hint = contig;
-	} else if (block->contig_hint_start && contig == block->contig_hint &&
-		   (!start || __ffs(start) > __ffs(block->contig_hint_start))) {
-		/* use the start with the best alignment */
-		block->contig_hint_start = start;
+	} else if (contig == block->contig_hint) {
+		if (block->contig_hint_start &&
+		    (!start ||
+		     __ffs(start) > __ffs(block->contig_hint_start))) {
+			/* start has a better alignment so use it */
+			block->contig_hint_start = start;
+			if (start < block->scan_hint_start &&
+			    block->contig_hint > block->scan_hint)
+				block->scan_hint = 0;
+		} else if (start > block->scan_hint_start ||
+			   block->contig_hint > block->scan_hint) {
+			/*
+			 * Knowing contig == contig_hint, update the scan_hint
+			 * if it is farther than or larger than the current
+			 * scan_hint.
+			 */
+			block->scan_hint_start = start;
+			block->scan_hint = contig;
+		}
+	} else {
+		/*
+		 * The region is smaller than the contig_hint.  So only update
+		 * the scan_hint if it is larger than or equal and farther than
+		 * the current scan_hint.
+		 */
+		if ((start < block->contig_hint_start &&
+		     (contig > block->scan_hint ||
+		      (contig == block->scan_hint &&
+		       start > block->scan_hint_start)))) {
+			block->scan_hint_start = start;
+			block->scan_hint = contig;
+		}
+	}
+}
+
+/*
+ * pcpu_block_update_scan - update a block given a free area from a scan
+ * @chunk: chunk of interest
+ * @bit_off: chunk offset
+ * @bits: size of free area
+ *
+ * Finding the final allocation spot first goes through pcpu_find_block_fit()
+ * to find a block that can hold the allocation and then pcpu_alloc_area()
+ * where a scan is used.  When allocations require specific alignments,
+ * we can inadvertently create holes which will not be seen in the alloc
+ * or free paths.
+ *
+ * This takes a given free area hole and updates a block as it may change the
+ * scan_hint.  We need to scan backwards to ensure we don't miss free bits
+ * from alignment.
+ */
+static void pcpu_block_update_scan(struct pcpu_chunk *chunk, int bit_off,
+				   int bits)
+{
+	int s_off = pcpu_off_to_block_off(bit_off);
+	int e_off = s_off + bits;
+	int s_index, l_bit;
+	struct pcpu_block_md *block;
+
+	if (e_off > PCPU_BITMAP_BLOCK_BITS)
+		return;
+
+	s_index = pcpu_off_to_block_index(bit_off);
+	block = chunk->md_blocks + s_index;
+
+	/* scan backwards in case of alignment skipping free bits */
+	l_bit = find_last_bit(pcpu_index_alloc_map(chunk, s_index), s_off);
+	s_off = (s_off == l_bit) ? 0 : l_bit + 1;
+
+	pcpu_block_update(block, s_off, e_off);
+}
+
+/**
+ * pcpu_chunk_refresh_hint - updates metadata about a chunk
+ * @chunk: chunk of interest
+ * @full_scan: if we should scan from the beginning
+ *
+ * Iterates over the metadata blocks to find the largest contig area.
+ * A full scan can be avoided on the allocation path as this is triggered
+ * if we broke the contig_hint.  In doing so, the scan_hint will be before
+ * the contig_hint or after if the scan_hint == contig_hint.  This cannot
+ * be prevented on freeing as we want to find the largest area possibly
+ * spanning blocks.
+ */
+static void pcpu_chunk_refresh_hint(struct pcpu_chunk *chunk, bool full_scan)
+{
+	struct pcpu_block_md *chunk_md = &chunk->chunk_md;
+	int bit_off, bits;
+
+	/* promote scan_hint to contig_hint */
+	if (!full_scan && chunk_md->scan_hint) {
+		bit_off = chunk_md->scan_hint_start + chunk_md->scan_hint;
+		chunk_md->contig_hint_start = chunk_md->scan_hint_start;
+		chunk_md->contig_hint = chunk_md->scan_hint;
+		chunk_md->scan_hint = 0;
+	} else {
+		bit_off = chunk_md->first_free;
+		chunk_md->contig_hint = 0;
+	}
+
+	bits = 0;
+	pcpu_for_each_md_free_region(chunk, bit_off, bits) {
+		pcpu_block_update(chunk_md, bit_off, bit_off + bits);
 	}
 }
 
@@ -654,14 +750,23 @@ static void pcpu_block_refresh_hint(struct pcpu_chunk *chunk, int index)
 {
 	struct pcpu_block_md *block = chunk->md_blocks + index;
 	unsigned long *alloc_map = pcpu_index_alloc_map(chunk, index);
-	int rs, re;	/* region start, region end */
+	int rs, re, start;	/* region start, region end */
+
+	/* promote scan_hint to contig_hint */
+	if (block->scan_hint) {
+		start = block->scan_hint_start + block->scan_hint;
+		block->contig_hint_start = block->scan_hint_start;
+		block->contig_hint = block->scan_hint;
+		block->scan_hint = 0;
+	} else {
+		start = block->first_free;
+		block->contig_hint = 0;
+	}
 
-	/* clear hints */
-	block->contig_hint = 0;
-	block->left_free = block->right_free = 0;
+	block->right_free = 0;
 
 	/* iterate over free areas and update the contig hints */
-	pcpu_for_each_unpop_region(alloc_map, rs, re, block->first_free,
+	pcpu_for_each_unpop_region(alloc_map, rs, re, start,
 				   PCPU_BITMAP_BLOCK_BITS) {
 		pcpu_block_update(block, rs, re);
 	}
@@ -680,6 +785,8 @@ static void pcpu_block_refresh_hint(struct pcpu_chunk *chunk, int index)
 static void pcpu_block_update_hint_alloc(struct pcpu_chunk *chunk, int bit_off,
 					 int bits)
 {
+	struct pcpu_block_md *chunk_md = &chunk->chunk_md;
+	int nr_empty_pages = 0;
 	struct pcpu_block_md *s_block, *e_block, *block;
 	int s_index, e_index;	/* block indexes of the freed allocation */
 	int s_off, e_off;	/* block offsets of the freed allocation */
@@ -704,15 +811,29 @@ static void pcpu_block_update_hint_alloc(struct pcpu_chunk *chunk, int bit_off,
 	 * If the allocation breaks the contig_hint, a scan is required to
 	 * restore this hint.
 	 */
+	if (s_block->contig_hint == PCPU_BITMAP_BLOCK_BITS)
+		nr_empty_pages++;
+
 	if (s_off == s_block->first_free)
 		s_block->first_free = find_next_zero_bit(
 					pcpu_index_alloc_map(chunk, s_index),
 					PCPU_BITMAP_BLOCK_BITS,
 					s_off + bits);
 
-	if (s_off >= s_block->contig_hint_start &&
-	    s_off < s_block->contig_hint_start + s_block->contig_hint) {
+	if (pcpu_region_overlap(s_block->scan_hint_start,
+				s_block->scan_hint_start + s_block->scan_hint,
+				s_off,
+				s_off + bits))
+		s_block->scan_hint = 0;
+
+	if (pcpu_region_overlap(s_block->contig_hint_start,
+				s_block->contig_hint_start +
+				s_block->contig_hint,
+				s_off,
+				s_off + bits)) {
 		/* block contig hint is broken - scan to fix it */
+		if (!s_off)
+			s_block->left_free = 0;
 		pcpu_block_refresh_hint(chunk, s_index);
 	} else {
 		/* update left and right contig manually */
@@ -728,6 +849,9 @@ static void pcpu_block_update_hint_alloc(struct pcpu_chunk *chunk, int bit_off,
 	 * Update e_block.
 	 */
 	if (s_index != e_index) {
+		if (e_block->contig_hint == PCPU_BITMAP_BLOCK_BITS)
+			nr_empty_pages++;
+
 		/*
 		 * When the allocation is across blocks, the end is along
 		 * the left part of the e_block.
@@ -740,11 +864,14 @@ static void pcpu_block_update_hint_alloc(struct pcpu_chunk *chunk, int bit_off,
 			/* reset the block */
 			e_block++;
 		} else {
+			if (e_off > e_block->scan_hint_start)
+				e_block->scan_hint = 0;
+
+			e_block->left_free = 0;
 			if (e_off > e_block->contig_hint_start) {
 				/* contig hint is broken - scan to fix it */
 				pcpu_block_refresh_hint(chunk, e_index);
 			} else {
-				e_block->left_free = 0;
 				e_block->right_free =
 					min_t(int, e_block->right_free,
 					      PCPU_BITMAP_BLOCK_BITS - e_off);
@@ -752,21 +879,36 @@ static void pcpu_block_update_hint_alloc(struct pcpu_chunk *chunk, int bit_off,
 		}
 
 		/* update in-between md_blocks */
+		nr_empty_pages += (e_index - s_index - 1);
 		for (block = s_block + 1; block < e_block; block++) {
+			block->scan_hint = 0;
 			block->contig_hint = 0;
 			block->left_free = 0;
 			block->right_free = 0;
 		}
 	}
 
+	if (nr_empty_pages)
+		pcpu_update_empty_pages(chunk, -nr_empty_pages);
+
+	if (pcpu_region_overlap(chunk_md->scan_hint_start,
+				chunk_md->scan_hint_start +
+				chunk_md->scan_hint,
+				bit_off,
+				bit_off + bits))
+		chunk_md->scan_hint = 0;
+
 	/*
 	 * The only time a full chunk scan is required is if the chunk
 	 * contig hint is broken.  Otherwise, it means a smaller space
 	 * was used and therefore the chunk contig hint is still correct.
 	 */
-	if (bit_off >= chunk->contig_bits_start  &&
-	    bit_off < chunk->contig_bits_start + chunk->contig_bits)
-		pcpu_chunk_refresh_hint(chunk);
+	if (pcpu_region_overlap(chunk_md->contig_hint_start,
+				chunk_md->contig_hint_start +
+				chunk_md->contig_hint,
+				bit_off,
+				bit_off + bits))
+		pcpu_chunk_refresh_hint(chunk, false);
 }
 
 /**
@@ -782,13 +924,15 @@ static void pcpu_block_update_hint_alloc(struct pcpu_chunk *chunk, int bit_off,
  *
  * A chunk update is triggered if a page becomes free, a block becomes free,
  * or the free spans across blocks.  This tradeoff is to minimize iterating
- * over the block metadata to update chunk->contig_bits.  chunk->contig_bits
- * may be off by up to a page, but it will never be more than the available
- * space.  If the contig hint is contained in one block, it will be accurate.
+ * over the block metadata to update chunk_md->contig_hint.
+ * chunk_md->contig_hint may be off by up to a page, but it will never be more
+ * than the available space.  If the contig hint is contained in one block, it
+ * will be accurate.
  */
 static void pcpu_block_update_hint_free(struct pcpu_chunk *chunk, int bit_off,
 					int bits)
 {
+	int nr_empty_pages = 0;
 	struct pcpu_block_md *s_block, *e_block, *block;
 	int s_index, e_index;	/* block indexes of the freed allocation */
 	int s_off, e_off;	/* block offsets of the freed allocation */
@@ -842,16 +986,22 @@ static void pcpu_block_update_hint_free(struct pcpu_chunk *chunk, int bit_off,
 
 	/* update s_block */
 	e_off = (s_index == e_index) ? end : PCPU_BITMAP_BLOCK_BITS;
+	if (!start && e_off == PCPU_BITMAP_BLOCK_BITS)
+		nr_empty_pages++;
 	pcpu_block_update(s_block, start, e_off);
 
 	/* freeing in the same block */
 	if (s_index != e_index) {
 		/* update e_block */
+		if (end == PCPU_BITMAP_BLOCK_BITS)
+			nr_empty_pages++;
 		pcpu_block_update(e_block, 0, end);
 
 		/* reset md_blocks in the middle */
+		nr_empty_pages += (e_index - s_index - 1);
 		for (block = s_block + 1; block < e_block; block++) {
 			block->first_free = 0;
+			block->scan_hint = 0;
 			block->contig_hint_start = 0;
 			block->contig_hint = PCPU_BITMAP_BLOCK_BITS;
 			block->left_free = PCPU_BITMAP_BLOCK_BITS;
@@ -859,19 +1009,21 @@ static void pcpu_block_update_hint_free(struct pcpu_chunk *chunk, int bit_off,
 		}
 	}
 
+	if (nr_empty_pages)
+		pcpu_update_empty_pages(chunk, nr_empty_pages);
+
 	/*
-	 * Refresh chunk metadata when the free makes a page free, a block
-	 * free, or spans across blocks.  The contig hint may be off by up to
-	 * a page, but if the hint is contained in a block, it will be accurate
-	 * with the else condition below.
+	 * Refresh chunk metadata when the free makes a block free or spans
+	 * across blocks.  The contig_hint may be off by up to a page, but if
+	 * the contig_hint is contained in a block, it will be accurate with
+	 * the else condition below.
 	 */
-	if ((ALIGN_DOWN(end, min(PCPU_BITS_PER_PAGE, PCPU_BITMAP_BLOCK_BITS)) >
-	     ALIGN(start, min(PCPU_BITS_PER_PAGE, PCPU_BITMAP_BLOCK_BITS))) ||
-	    s_index != e_index)
-		pcpu_chunk_refresh_hint(chunk);
+	if (((end - start) >= PCPU_BITMAP_BLOCK_BITS) || s_index != e_index)
+		pcpu_chunk_refresh_hint(chunk, true);
 	else
-		pcpu_chunk_update(chunk, pcpu_block_off_to_off(s_index, start),
-				  s_block->contig_hint);
+		pcpu_block_update(&chunk->chunk_md,
+				  pcpu_block_off_to_off(s_index, start),
+				  end);
 }
 
 /**
@@ -926,6 +1078,7 @@ static bool pcpu_is_populated(struct pcpu_chunk *chunk, int bit_off, int bits,
 static int pcpu_find_block_fit(struct pcpu_chunk *chunk, int alloc_bits,
 			       size_t align, bool pop_only)
 {
+	struct pcpu_block_md *chunk_md = &chunk->chunk_md;
 	int bit_off, bits, next_off;
 
 	/*
@@ -934,12 +1087,12 @@ static int pcpu_find_block_fit(struct pcpu_chunk *chunk, int alloc_bits,
 	 * cannot fit in the global hint, there is memory pressure and creating
 	 * a new chunk would happen soon.
 	 */
-	bit_off = ALIGN(chunk->contig_bits_start, align) -
-		  chunk->contig_bits_start;
-	if (bit_off + alloc_bits > chunk->contig_bits)
+	bit_off = ALIGN(chunk_md->contig_hint_start, align) -
+		  chunk_md->contig_hint_start;
+	if (bit_off + alloc_bits > chunk_md->contig_hint)
 		return -1;
 
-	bit_off = chunk->first_bit;
+	bit_off = pcpu_next_hint(chunk_md, alloc_bits);
 	bits = 0;
 	pcpu_for_each_fit_region(chunk, alloc_bits, align, bit_off, bits) {
 		if (!pop_only || pcpu_is_populated(chunk, bit_off, bits,
@@ -956,6 +1109,62 @@ static int pcpu_find_block_fit(struct pcpu_chunk *chunk, int alloc_bits,
 	return bit_off;
 }
 
+/*
+ * pcpu_find_zero_area - modified from bitmap_find_next_zero_area_off()
+ * @map: the address to base the search on
+ * @size: the bitmap size in bits
+ * @start: the bitnumber to start searching at
+ * @nr: the number of zeroed bits we're looking for
+ * @align_mask: alignment mask for zero area
+ * @largest_off: offset of the largest area skipped
+ * @largest_bits: size of the largest area skipped
+ *
+ * The @align_mask should be one less than a power of 2.
+ *
+ * This is a modified version of bitmap_find_next_zero_area_off() to remember
+ * the largest area that was skipped.  This is imperfect, but in general is
+ * good enough.  The largest remembered region is the largest failed region
+ * seen.  This does not include anything we possibly skipped due to alignment.
+ * pcpu_block_update_scan() does scan backwards to try and recover what was
+ * lost to alignment.  While this can cause scanning to miss earlier possible
+ * free areas, smaller allocations will eventually fill those holes.
+ */
+static unsigned long pcpu_find_zero_area(unsigned long *map,
+					 unsigned long size,
+					 unsigned long start,
+					 unsigned long nr,
+					 unsigned long align_mask,
+					 unsigned long *largest_off,
+					 unsigned long *largest_bits)
+{
+	unsigned long index, end, i, area_off, area_bits;
+again:
+	index = find_next_zero_bit(map, size, start);
+
+	/* Align allocation */
+	index = __ALIGN_MASK(index, align_mask);
+	area_off = index;
+
+	end = index + nr;
+	if (end > size)
+		return end;
+	i = find_next_bit(map, end, index);
+	if (i < end) {
+		area_bits = i - area_off;
+		/* remember largest unused area with best alignment */
+		if (area_bits > *largest_bits ||
+		    (area_bits == *largest_bits && *largest_off &&
+		     (!area_off || __ffs(area_off) > __ffs(*largest_off)))) {
+			*largest_off = area_off;
+			*largest_bits = area_bits;
+		}
+
+		start = i + 1;
+		goto again;
+	}
+	return index;
+}
+
 /**
  * pcpu_alloc_area - allocates an area from a pcpu_chunk
  * @chunk: chunk of interest
@@ -978,7 +1187,9 @@ static int pcpu_find_block_fit(struct pcpu_chunk *chunk, int alloc_bits,
 static int pcpu_alloc_area(struct pcpu_chunk *chunk, int alloc_bits,
 			   size_t align, int start)
 {
+	struct pcpu_block_md *chunk_md = &chunk->chunk_md;
 	size_t align_mask = (align) ? (align - 1) : 0;
+	unsigned long area_off = 0, area_bits = 0;
 	int bit_off, end, oslot;
 
 	lockdep_assert_held(&pcpu_lock);
@@ -988,12 +1199,16 @@ static int pcpu_alloc_area(struct pcpu_chunk *chunk, int alloc_bits,
 	/*
 	 * Search to find a fit.
 	 */
-	end = start + alloc_bits + PCPU_BITMAP_BLOCK_BITS;
-	bit_off = bitmap_find_next_zero_area(chunk->alloc_map, end, start,
-					     alloc_bits, align_mask);
+	end = min_t(int, start + alloc_bits + PCPU_BITMAP_BLOCK_BITS,
+		    pcpu_chunk_map_bits(chunk));
+	bit_off = pcpu_find_zero_area(chunk->alloc_map, end, start, alloc_bits,
+				      align_mask, &area_off, &area_bits);
 	if (bit_off >= end)
 		return -1;
 
+	if (area_bits)
+		pcpu_block_update_scan(chunk, area_off, area_bits);
+
 	/* update alloc map */
 	bitmap_set(chunk->alloc_map, bit_off, alloc_bits);
 
@@ -1005,8 +1220,8 @@ static int pcpu_alloc_area(struct pcpu_chunk *chunk, int alloc_bits,
 	chunk->free_bytes -= alloc_bits * PCPU_MIN_ALLOC_SIZE;
 
 	/* update first free bit */
-	if (bit_off == chunk->first_bit)
-		chunk->first_bit = find_next_zero_bit(
+	if (bit_off == chunk_md->first_free)
+		chunk_md->first_free = find_next_zero_bit(
 					chunk->alloc_map,
 					pcpu_chunk_map_bits(chunk),
 					bit_off + alloc_bits);
@@ -1028,6 +1243,7 @@ static int pcpu_alloc_area(struct pcpu_chunk *chunk, int alloc_bits,
  */
 static void pcpu_free_area(struct pcpu_chunk *chunk, int off)
 {
+	struct pcpu_block_md *chunk_md = &chunk->chunk_md;
 	int bit_off, bits, end, oslot;
 
 	lockdep_assert_held(&pcpu_lock);
@@ -1047,24 +1263,34 @@ static void pcpu_free_area(struct pcpu_chunk *chunk, int off)
 	chunk->free_bytes += bits * PCPU_MIN_ALLOC_SIZE;
 
 	/* update first free bit */
-	chunk->first_bit = min(chunk->first_bit, bit_off);
+	chunk_md->first_free = min(chunk_md->first_free, bit_off);
 
 	pcpu_block_update_hint_free(chunk, bit_off, bits);
 
 	pcpu_chunk_relocate(chunk, oslot);
 }
 
+static void pcpu_init_md_block(struct pcpu_block_md *block, int nr_bits)
+{
+	block->scan_hint = 0;
+	block->contig_hint = nr_bits;
+	block->left_free = nr_bits;
+	block->right_free = nr_bits;
+	block->first_free = 0;
+	block->nr_bits = nr_bits;
+}
+
 static void pcpu_init_md_blocks(struct pcpu_chunk *chunk)
 {
 	struct pcpu_block_md *md_block;
 
+	/* init the chunk's block */
+	pcpu_init_md_block(&chunk->chunk_md, pcpu_chunk_map_bits(chunk));
+
 	for (md_block = chunk->md_blocks;
 	     md_block != chunk->md_blocks + pcpu_chunk_nr_blocks(chunk);
-	     md_block++) {
-		md_block->contig_hint = PCPU_BITMAP_BLOCK_BITS;
-		md_block->left_free = PCPU_BITMAP_BLOCK_BITS;
-		md_block->right_free = PCPU_BITMAP_BLOCK_BITS;
-	}
+	     md_block++)
+		pcpu_init_md_block(md_block, PCPU_BITMAP_BLOCK_BITS);
 }
 
 /**
@@ -1143,11 +1369,8 @@ static struct pcpu_chunk * __init pcpu_alloc_first_chunk(unsigned long tmp_addr,
 	chunk->immutable = true;
 	bitmap_fill(chunk->populated, chunk->nr_pages);
 	chunk->nr_populated = chunk->nr_pages;
-	chunk->nr_empty_pop_pages =
-		pcpu_cnt_pop_pages(chunk, start_offset / PCPU_MIN_ALLOC_SIZE,
-				   map_size / PCPU_MIN_ALLOC_SIZE);
+	chunk->nr_empty_pop_pages = chunk->nr_pages;
 
-	chunk->contig_bits = map_size / PCPU_MIN_ALLOC_SIZE;
 	chunk->free_bytes = map_size;
 
 	if (chunk->start_offset) {
@@ -1157,7 +1380,7 @@ static struct pcpu_chunk * __init pcpu_alloc_first_chunk(unsigned long tmp_addr,
 		set_bit(0, chunk->bound_map);
 		set_bit(offset_bits, chunk->bound_map);
 
-		chunk->first_bit = offset_bits;
+		chunk->chunk_md.first_free = offset_bits;
 
 		pcpu_block_update_hint_alloc(chunk, 0, offset_bits);
 	}
@@ -1210,7 +1433,6 @@ static struct pcpu_chunk *pcpu_alloc_chunk(gfp_t gfp)
 	pcpu_init_md_blocks(chunk);
 
 	/* init metadata */
-	chunk->contig_bits = region_bits;
 	chunk->free_bytes = chunk->nr_pages * PAGE_SIZE;
 
 	return chunk;
@@ -1240,7 +1462,6 @@ static void pcpu_free_chunk(struct pcpu_chunk *chunk)
  * @chunk: pcpu_chunk which got populated
  * @page_start: the start page
  * @page_end: the end page
- * @for_alloc: if this is to populate for allocation
  *
  * Pages in [@page_start,@page_end) have been populated to @chunk.  Update
  * the bookkeeping information accordingly.  Must be called after each
@@ -1250,7 +1471,7 @@ static void pcpu_free_chunk(struct pcpu_chunk *chunk)
  * is to serve an allocation in that area.
  */
 static void pcpu_chunk_populated(struct pcpu_chunk *chunk, int page_start,
-				 int page_end, bool for_alloc)
+				 int page_end)
 {
 	int nr = page_end - page_start;
 
@@ -1260,10 +1481,7 @@ static void pcpu_chunk_populated(struct pcpu_chunk *chunk, int page_start,
 	chunk->nr_populated += nr;
 	pcpu_nr_populated += nr;
 
-	if (!for_alloc) {
-		chunk->nr_empty_pop_pages += nr;
-		pcpu_nr_empty_pop_pages += nr;
-	}
+	pcpu_update_empty_pages(chunk, nr);
 }
 
 /**
@@ -1285,9 +1503,9 @@ static void pcpu_chunk_depopulated(struct pcpu_chunk *chunk,
 
 	bitmap_clear(chunk->populated, page_start, nr);
 	chunk->nr_populated -= nr;
-	chunk->nr_empty_pop_pages -= nr;
-	pcpu_nr_empty_pop_pages -= nr;
 	pcpu_nr_populated -= nr;
+
+	pcpu_update_empty_pages(chunk, -nr);
 }
 
 /*
@@ -1374,7 +1592,7 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved,
 	bool is_atomic = (gfp & GFP_KERNEL) != GFP_KERNEL;
 	bool do_warn = !(gfp & __GFP_NOWARN);
 	static int warn_limit = 10;
-	struct pcpu_chunk *chunk;
+	struct pcpu_chunk *chunk, *next;
 	const char *err;
 	int slot, off, cpu, ret;
 	unsigned long flags;
@@ -1436,11 +1654,14 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved,
 restart:
 	/* search through normal chunks */
 	for (slot = pcpu_size_to_slot(size); slot < pcpu_nr_slots; slot++) {
-		list_for_each_entry(chunk, &pcpu_slot[slot], list) {
+		list_for_each_entry_safe(chunk, next, &pcpu_slot[slot], list) {
 			off = pcpu_find_block_fit(chunk, bits, bit_align,
 						  is_atomic);
-			if (off < 0)
+			if (off < 0) {
+				if (slot < PCPU_SLOT_FAIL_THRESHOLD)
+					pcpu_chunk_move(chunk, 0);
 				continue;
+			}
 
 			off = pcpu_alloc_area(chunk, bits, bit_align, off);
 			if (off >= 0)
@@ -1499,7 +1720,7 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved,
 				err = "failed to populate";
 				goto fail_unlock;
 			}
-			pcpu_chunk_populated(chunk, rs, re, true);
+			pcpu_chunk_populated(chunk, rs, re);
 			spin_unlock_irqrestore(&pcpu_lock, flags);
 		}
 
@@ -1698,7 +1919,7 @@ static void pcpu_balance_workfn(struct work_struct *work)
 			if (!ret) {
 				nr_to_pop -= nr;
 				spin_lock_irq(&pcpu_lock);
-				pcpu_chunk_populated(chunk, rs, rs + nr, false);
+				pcpu_chunk_populated(chunk, rs, rs + nr);
 				spin_unlock_irq(&pcpu_lock);
 			} else {
 				nr_to_pop = 0;
diff --git a/mm/shuffle.c b/mm/shuffle.c
new file mode 100644
index 000000000000..3ce12481b1dc
--- /dev/null
+++ b/mm/shuffle.c
@@ -0,0 +1,207 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright(c) 2018 Intel Corporation. All rights reserved.
+
+#include <linux/mm.h>
+#include <linux/init.h>
+#include <linux/mmzone.h>
+#include <linux/random.h>
+#include <linux/moduleparam.h>
+#include "internal.h"
+#include "shuffle.h"
+
+DEFINE_STATIC_KEY_FALSE(page_alloc_shuffle_key);
+static unsigned long shuffle_state __ro_after_init;
+
+/*
+ * Depending on the architecture, module parameter parsing may run
+ * before, or after the cache detection. SHUFFLE_FORCE_DISABLE prevents,
+ * or reverts the enabling of the shuffle implementation. SHUFFLE_ENABLE
+ * attempts to turn on the implementation, but aborts if it finds
+ * SHUFFLE_FORCE_DISABLE already set.
+ */
+__meminit void page_alloc_shuffle(enum mm_shuffle_ctl ctl)
+{
+	if (ctl == SHUFFLE_FORCE_DISABLE)
+		set_bit(SHUFFLE_FORCE_DISABLE, &shuffle_state);
+
+	if (test_bit(SHUFFLE_FORCE_DISABLE, &shuffle_state)) {
+		if (test_and_clear_bit(SHUFFLE_ENABLE, &shuffle_state))
+			static_branch_disable(&page_alloc_shuffle_key);
+	} else if (ctl == SHUFFLE_ENABLE
+			&& !test_and_set_bit(SHUFFLE_ENABLE, &shuffle_state))
+		static_branch_enable(&page_alloc_shuffle_key);
+}
+
+static bool shuffle_param;
+extern int shuffle_show(char *buffer, const struct kernel_param *kp)
+{
+	return sprintf(buffer, "%c\n", test_bit(SHUFFLE_ENABLE, &shuffle_state)
+			? 'Y' : 'N');
+}
+
+static __meminit int shuffle_store(const char *val,
+		const struct kernel_param *kp)
+{
+	int rc = param_set_bool(val, kp);
+
+	if (rc < 0)
+		return rc;
+	if (shuffle_param)
+		page_alloc_shuffle(SHUFFLE_ENABLE);
+	else
+		page_alloc_shuffle(SHUFFLE_FORCE_DISABLE);
+	return 0;
+}
+module_param_call(shuffle, shuffle_store, shuffle_show, &shuffle_param, 0400);
+
+/*
+ * For two pages to be swapped in the shuffle, they must be free (on a
+ * 'free_area' lru), have the same order, and have the same migratetype.
+ */
+static struct page * __meminit shuffle_valid_page(unsigned long pfn, int order)
+{
+	struct page *page;
+
+	/*
+	 * Given we're dealing with randomly selected pfns in a zone we
+	 * need to ask questions like...
+	 */
+
+	/* ...is the pfn even in the memmap? */
+	if (!pfn_valid_within(pfn))
+		return NULL;
+
+	/* ...is the pfn in a present section or a hole? */
+	if (!pfn_present(pfn))
+		return NULL;
+
+	/* ...is the page free and currently on a free_area list? */
+	page = pfn_to_page(pfn);
+	if (!PageBuddy(page))
+		return NULL;
+
+	/*
+	 * ...is the page on the same list as the page we will
+	 * shuffle it with?
+	 */
+	if (page_order(page) != order)
+		return NULL;
+
+	return page;
+}
+
+/*
+ * Fisher-Yates shuffle the freelist which prescribes iterating through an
+ * array, pfns in this case, and randomly swapping each entry with another in
+ * the span, end_pfn - start_pfn.
+ *
+ * To keep the implementation simple it does not attempt to correct for sources
+ * of bias in the distribution, like modulo bias or pseudo-random number
+ * generator bias. I.e. the expectation is that this shuffling raises the bar
+ * for attacks that exploit the predictability of page allocations, but need not
+ * be a perfect shuffle.
+ */
+#define SHUFFLE_RETRY 10
+void __meminit __shuffle_zone(struct zone *z)
+{
+	unsigned long i, flags;
+	unsigned long start_pfn = z->zone_start_pfn;
+	unsigned long end_pfn = zone_end_pfn(z);
+	const int order = SHUFFLE_ORDER;
+	const int order_pages = 1 << order;
+
+	spin_lock_irqsave(&z->lock, flags);
+	start_pfn = ALIGN(start_pfn, order_pages);
+	for (i = start_pfn; i < end_pfn; i += order_pages) {
+		unsigned long j;
+		int migratetype, retry;
+		struct page *page_i, *page_j;
+
+		/*
+		 * We expect page_i, in the sub-range of a zone being added
+		 * (@start_pfn to @end_pfn), to more likely be valid compared to
+		 * page_j randomly selected in the span @zone_start_pfn to
+		 * @spanned_pages.
+		 */
+		page_i = shuffle_valid_page(i, order);
+		if (!page_i)
+			continue;
+
+		for (retry = 0; retry < SHUFFLE_RETRY; retry++) {
+			/*
+			 * Pick a random order aligned page in the zone span as
+			 * a swap target. If the selected pfn is a hole, retry
+			 * up to SHUFFLE_RETRY attempts find a random valid pfn
+			 * in the zone.
+			 */
+			j = z->zone_start_pfn +
+				ALIGN_DOWN(get_random_long() % z->spanned_pages,
+						order_pages);
+			page_j = shuffle_valid_page(j, order);
+			if (page_j && page_j != page_i)
+				break;
+		}
+		if (retry >= SHUFFLE_RETRY) {
+			pr_debug("%s: failed to swap %#lx\n", __func__, i);
+			continue;
+		}
+
+		/*
+		 * Each migratetype corresponds to its own list, make sure the
+		 * types match otherwise we're moving pages to lists where they
+		 * do not belong.
+		 */
+		migratetype = get_pageblock_migratetype(page_i);
+		if (get_pageblock_migratetype(page_j) != migratetype) {
+			pr_debug("%s: migratetype mismatch %#lx\n", __func__, i);
+			continue;
+		}
+
+		list_swap(&page_i->lru, &page_j->lru);
+
+		pr_debug("%s: swap: %#lx -> %#lx\n", __func__, i, j);
+
+		/* take it easy on the zone lock */
+		if ((i % (100 * order_pages)) == 0) {
+			spin_unlock_irqrestore(&z->lock, flags);
+			cond_resched();
+			spin_lock_irqsave(&z->lock, flags);
+		}
+	}
+	spin_unlock_irqrestore(&z->lock, flags);
+}
+
+/**
+ * shuffle_free_memory - reduce the predictability of the page allocator
+ * @pgdat: node page data
+ */
+void __meminit __shuffle_free_memory(pg_data_t *pgdat)
+{
+	struct zone *z;
+
+	for (z = pgdat->node_zones; z < pgdat->node_zones + MAX_NR_ZONES; z++)
+		shuffle_zone(z);
+}
+
+void add_to_free_area_random(struct page *page, struct free_area *area,
+		int migratetype)
+{
+	static u64 rand;
+	static u8 rand_bits;
+
+	/*
+	 * The lack of locking is deliberate. If 2 threads race to
+	 * update the rand state it just adds to the entropy.
+	 */
+	if (rand_bits == 0) {
+		rand_bits = 64;
+		rand = get_random_u64();
+	}
+
+	if (rand & 1)
+		add_to_free_area(page, area, migratetype);
+	else
+		add_to_free_area_tail(page, area, migratetype);
+	rand_bits--;
+	rand >>= 1;
+}
diff --git a/mm/shuffle.h b/mm/shuffle.h
new file mode 100644
index 000000000000..777a257a0d2f
--- /dev/null
+++ b/mm/shuffle.h
@@ -0,0 +1,64 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright(c) 2018 Intel Corporation. All rights reserved.
+#ifndef _MM_SHUFFLE_H
+#define _MM_SHUFFLE_H
+#include <linux/jump_label.h>
+
+/*
+ * SHUFFLE_ENABLE is called from the command line enabling path, or by
+ * platform-firmware enabling that indicates the presence of a
+ * direct-mapped memory-side-cache. SHUFFLE_FORCE_DISABLE is called from
+ * the command line path and overrides any previous or future
+ * SHUFFLE_ENABLE.
+ */
+enum mm_shuffle_ctl {
+	SHUFFLE_ENABLE,
+	SHUFFLE_FORCE_DISABLE,
+};
+
+#define SHUFFLE_ORDER (MAX_ORDER-1)
+
+#ifdef CONFIG_SHUFFLE_PAGE_ALLOCATOR
+DECLARE_STATIC_KEY_FALSE(page_alloc_shuffle_key);
+extern void page_alloc_shuffle(enum mm_shuffle_ctl ctl);
+extern void __shuffle_free_memory(pg_data_t *pgdat);
+static inline void shuffle_free_memory(pg_data_t *pgdat)
+{
+	if (!static_branch_unlikely(&page_alloc_shuffle_key))
+		return;
+	__shuffle_free_memory(pgdat);
+}
+
+extern void __shuffle_zone(struct zone *z);
+static inline void shuffle_zone(struct zone *z)
+{
+	if (!static_branch_unlikely(&page_alloc_shuffle_key))
+		return;
+	__shuffle_zone(z);
+}
+
+static inline bool is_shuffle_order(int order)
+{
+	if (!static_branch_unlikely(&page_alloc_shuffle_key))
+		return false;
+	return order >= SHUFFLE_ORDER;
+}
+#else
+static inline void shuffle_free_memory(pg_data_t *pgdat)
+{
+}
+
+static inline void shuffle_zone(struct zone *z)
+{
+}
+
+static inline void page_alloc_shuffle(enum mm_shuffle_ctl ctl)
+{
+}
+
+static inline bool is_shuffle_order(int order)
+{
+	return false;
+}
+#endif
+#endif /* _MM_SHUFFLE_H */
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 2b8d9c3fbb47..fd9b0025ad00 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1783,8 +1783,6 @@ static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd,
 	dec_mm_counter(vma->vm_mm, MM_SWAPENTS);
 	inc_mm_counter(vma->vm_mm, MM_ANONPAGES);
 	get_page(page);
-	set_pte_at(vma->vm_mm, addr, pte,
-		   pte_mkold(mk_pte(page, vma->vm_page_prot)));
 	if (page == swapcache) {
 		page_add_anon_rmap(page, vma, addr, false);
 		mem_cgroup_commit_charge(page, memcg, true, false);
@@ -1793,6 +1791,8 @@ static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd,
 		mem_cgroup_commit_charge(page, memcg, false, false);
 		lru_cache_add_active_or_unevictable(page, vma);
 	}
+	set_pte_at(vma->vm_mm, addr, pte,
+		   pte_mkold(mk_pte(page, vma->vm_page_prot)));
 	swap_free(entry);
 	/*
 	 * Move the page to the active list so it is not
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index e86ba6e74b50..b7455d4c8c12 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -632,7 +632,7 @@ static unsigned long lazy_max_pages(void)
 	return log * (32UL * 1024 * 1024 / PAGE_SIZE);
 }
 
-static atomic_t vmap_lazy_nr = ATOMIC_INIT(0);
+static atomic_long_t vmap_lazy_nr = ATOMIC_LONG_INIT(0);
 
 /*
  * Serialize vmap purging.  There is no actual criticial section protected
@@ -650,7 +650,7 @@ static void purge_fragmented_blocks_allcpus(void);
  */
 void set_iounmap_nonlazy(void)
 {
-	atomic_set(&vmap_lazy_nr, lazy_max_pages()+1);
+	atomic_long_set(&vmap_lazy_nr, lazy_max_pages()+1);
 }
 
 /*
@@ -658,34 +658,40 @@ void set_iounmap_nonlazy(void)
  */
 static bool __purge_vmap_area_lazy(unsigned long start, unsigned long end)
 {
+	unsigned long resched_threshold;
 	struct llist_node *valist;
 	struct vmap_area *va;
 	struct vmap_area *n_va;
-	bool do_free = false;
 
 	lockdep_assert_held(&vmap_purge_lock);
 
 	valist = llist_del_all(&vmap_purge_list);
+	if (unlikely(valist == NULL))
+		return false;
+
+	/*
+	 * TODO: to calculate a flush range without looping.
+	 * The list can be up to lazy_max_pages() elements.
+	 */
 	llist_for_each_entry(va, valist, purge_list) {
 		if (va->va_start < start)
 			start = va->va_start;
 		if (va->va_end > end)
 			end = va->va_end;
-		do_free = true;
 	}
 
-	if (!do_free)
-		return false;
-
 	flush_tlb_kernel_range(start, end);
+	resched_threshold = lazy_max_pages() << 1;
 
 	spin_lock(&vmap_area_lock);
 	llist_for_each_entry_safe(va, n_va, valist, purge_list) {
-		int nr = (va->va_end - va->va_start) >> PAGE_SHIFT;
+		unsigned long nr = (va->va_end - va->va_start) >> PAGE_SHIFT;
 
 		__free_vmap_area(va);
-		atomic_sub(nr, &vmap_lazy_nr);
-		cond_resched_lock(&vmap_area_lock);
+		atomic_long_sub(nr, &vmap_lazy_nr);
+
+		if (atomic_long_read(&vmap_lazy_nr) < resched_threshold)
+			cond_resched_lock(&vmap_area_lock);
 	}
 	spin_unlock(&vmap_area_lock);
 	return true;
@@ -721,10 +727,10 @@ static void purge_vmap_area_lazy(void)
  */
 static void free_vmap_area_noflush(struct vmap_area *va)
 {
-	int nr_lazy;
+	unsigned long nr_lazy;
 
-	nr_lazy = atomic_add_return((va->va_end - va->va_start) >> PAGE_SHIFT,
-				    &vmap_lazy_nr);
+	nr_lazy = atomic_long_add_return((va->va_end - va->va_start) >>
+				PAGE_SHIFT, &vmap_lazy_nr);
 
 	/* After this point, we may free va at any time */
 	llist_add(&va->purge_list, &vmap_purge_list);
diff --git a/mm/vmscan.c b/mm/vmscan.c
index a5ad0b35ab8e..07f74e9507b6 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2257,8 +2257,7 @@ enum scan_balance {
  * nr[2] = file inactive pages to scan; nr[3] = file active pages to scan
  */
 static void get_scan_count(struct lruvec *lruvec, struct mem_cgroup *memcg,
-			   struct scan_control *sc, unsigned long *nr,
-			   unsigned long *lru_pages)
+			   struct scan_control *sc, unsigned long *nr)
 {
 	int swappiness = mem_cgroup_swappiness(memcg);
 	struct zone_reclaim_stat *reclaim_stat = &lruvec->reclaim_stat;
@@ -2409,20 +2408,93 @@ static void get_scan_count(struct lruvec *lruvec, struct mem_cgroup *memcg,
 	fraction[1] = fp;
 	denominator = ap + fp + 1;
 out:
-	*lru_pages = 0;
 	for_each_evictable_lru(lru) {
 		int file = is_file_lru(lru);
-		unsigned long size;
+		unsigned long lruvec_size;
 		unsigned long scan;
+		unsigned long min, low;
+
+		lruvec_size = lruvec_lru_size(lruvec, lru, sc->reclaim_idx);
+		mem_cgroup_protection(memcg, &min, &low);
+
+		if (min || low) {
+			/*
+			 * Scale a cgroup's reclaim pressure by proportioning
+			 * its current usage to its memory.low or memory.min
+			 * setting.
+			 *
+			 * This is important, as otherwise scanning aggression
+			 * becomes extremely binary -- from nothing as we
+			 * approach the memory protection threshold, to totally
+			 * nominal as we exceed it.  This results in requiring
+			 * setting extremely liberal protection thresholds. It
+			 * also means we simply get no protection at all if we
+			 * set it too low, which is not ideal.
+			 */
+			unsigned long cgroup_size = mem_cgroup_size(memcg);
+
+			/*
+			 * If there is any protection in place, we adjust scan
+			 * pressure in proportion to how much a group's current
+			 * usage exceeds that, in percent.
+			 *
+			 * There is one special case: in the first reclaim pass,
+			 * we skip over all groups that are within their low
+			 * protection. If that fails to reclaim enough pages to
+			 * satisfy the reclaim goal, we come back and override
+			 * the best-effort low protection. However, we still
+			 * ideally want to honor how well-behaved groups are in
+			 * that case instead of simply punishing them all
+			 * equally. As such, we reclaim them based on how much
+			 * of their best-effort protection they are using. Usage
+			 * below memory.min is excluded from consideration when
+			 * calculating utilisation, as it isn't ever
+			 * reclaimable, so it might as well not exist for our
+			 * purposes.
+			 */
+			if (sc->memcg_low_reclaim && low > min) {
+				/*
+				 * Reclaim according to utilisation between min
+				 * and low
+				 */
+				scan = lruvec_size * (cgroup_size - min) /
+					(low - min);
+			} else {
+				/* Reclaim according to protection overage */
+				scan = lruvec_size * cgroup_size /
+					max(min, low) - lruvec_size;
+			}
+
+			/*
+			 * Don't allow the scan target to exceed the lruvec
+			 * size, which otherwise could happen if we have >200%
+			 * overage in the normal case, or >100% overage when
+			 * sc->memcg_low_reclaim is set.
+			 *
+			 * This is important because other cgroups without
+			 * memory.low have their scan target initially set to
+			 * their lruvec size, so allowing values >100% of the
+			 * lruvec size here could result in penalising cgroups
+			 * with memory.low set even *more* than their peers in
+			 * some cases in the case of large overages.
+			 *
+			 * Also, minimally target SWAP_CLUSTER_MAX pages to keep
+			 * reclaim moving forwards, avoiding decremeting
+			 * sc->priority further than desirable.
+			 */
+			scan = clamp(scan, SWAP_CLUSTER_MAX, lruvec_size);
+		} else {
+			scan = lruvec_size;
+		}
+
+		scan >>= sc->priority;
 
-		size = lruvec_lru_size(lruvec, lru, sc->reclaim_idx);
-		scan = size >> sc->priority;
 		/*
 		 * If the cgroup's already been deleted, make sure to
 		 * scrape out the remaining cache.
 		 */
 		if (!scan && !mem_cgroup_online(memcg))
-			scan = min(size, SWAP_CLUSTER_MAX);
+			scan = min(lruvec_size, SWAP_CLUSTER_MAX);
 
 		switch (scan_balance) {
 		case SCAN_EQUAL:
@@ -2442,7 +2514,7 @@ static void get_scan_count(struct lruvec *lruvec, struct mem_cgroup *memcg,
 		case SCAN_ANON:
 			/* Scan one type exclusively */
 			if ((scan_balance == SCAN_FILE) != file) {
-				size = 0;
+				lruvec_size = 0;
 				scan = 0;
 			}
 			break;
@@ -2451,7 +2523,6 @@ static void get_scan_count(struct lruvec *lruvec, struct mem_cgroup *memcg,
 			BUG();
 		}
 
-		*lru_pages += size;
 		nr[lru] = scan;
 	}
 }
@@ -2460,7 +2531,7 @@ static void get_scan_count(struct lruvec *lruvec, struct mem_cgroup *memcg,
  * This is a basic per-node page freer.  Used by both kswapd and direct reclaim.
  */
 static void shrink_node_memcg(struct pglist_data *pgdat, struct mem_cgroup *memcg,
-			      struct scan_control *sc, unsigned long *lru_pages)
+			      struct scan_control *sc)
 {
 	struct lruvec *lruvec = mem_cgroup_lruvec(pgdat, memcg);
 	unsigned long nr[NR_LRU_LISTS];
@@ -2472,7 +2543,7 @@ static void shrink_node_memcg(struct pglist_data *pgdat, struct mem_cgroup *memc
 	struct blk_plug plug;
 	bool scan_adjusted;
 
-	get_scan_count(lruvec, memcg, sc, nr, lru_pages);
+	get_scan_count(lruvec, memcg, sc, nr);
 
 	/* Record the original scan target for proportional adjustments later */
 	memcpy(targets, nr, sizeof(nr));
@@ -2677,7 +2748,6 @@ static bool shrink_node(pg_data_t *pgdat, struct scan_control *sc)
 			.pgdat = pgdat,
 			.priority = sc->priority,
 		};
-		unsigned long node_lru_pages = 0;
 		struct mem_cgroup *memcg;
 
 		memset(&sc->nr, 0, sizeof(sc->nr));
@@ -2687,7 +2757,6 @@ static bool shrink_node(pg_data_t *pgdat, struct scan_control *sc)
 
 		memcg = mem_cgroup_iter(root, NULL, &reclaim);
 		do {
-			unsigned long lru_pages;
 			unsigned long reclaimed;
 			unsigned long scanned;
 
@@ -2712,13 +2781,19 @@ static bool shrink_node(pg_data_t *pgdat, struct scan_control *sc)
 				memcg_memory_event(memcg, MEMCG_LOW);
 				break;
 			case MEMCG_PROT_NONE:
+				/*
+				 * All protection thresholds breached. We may
+				 * still choose to vary the scan pressure
+				 * applied based on by how much the cgroup in
+				 * question has exceeded its protection
+				 * thresholds (see get_scan_count).
+				 */
 				break;
 			}
 
 			reclaimed = sc->nr_reclaimed;
 			scanned = sc->nr_scanned;
-			shrink_node_memcg(pgdat, memcg, sc, &lru_pages);
-			node_lru_pages += lru_pages;
+			shrink_node_memcg(pgdat, memcg, sc);
 
 			if (sc->may_shrinkslab) {
 				shrink_slab(sc->gfp_mask, pgdat->node_id,
@@ -3251,7 +3326,6 @@ unsigned long mem_cgroup_shrink_node(struct mem_cgroup *memcg,
 		.may_swap = !noswap,
 		.may_shrinkslab = 1,
 	};
-	unsigned long lru_pages;
 
 	sc.gfp_mask = (gfp_mask & GFP_RECLAIM_MASK) |
 			(GFP_HIGHUSER_MOVABLE & ~GFP_RECLAIM_MASK);
@@ -3268,7 +3342,7 @@ unsigned long mem_cgroup_shrink_node(struct mem_cgroup *memcg,
 	 * will pick up pages from other mem cgroup's as well. We hack
 	 * the priority and make it zero.
 	 */
-	shrink_node_memcg(pgdat, memcg, &sc, &lru_pages);
+	shrink_node_memcg(pgdat, memcg, &sc);
 
 	trace_mm_vmscan_memcg_softlimit_reclaim_end(sc.nr_reclaimed);
 
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index 49a16cee2aae..420a98bf79b5 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -879,15 +879,24 @@ static struct notifier_block aarp_notifier = {
 
 static unsigned char aarp_snap_id[] = { 0x00, 0x00, 0x00, 0x80, 0xF3 };
 
-void __init aarp_proto_init(void)
+int __init aarp_proto_init(void)
 {
+	int rc;
+
 	aarp_dl = register_snap_client(aarp_snap_id, aarp_rcv);
-	if (!aarp_dl)
+	if (!aarp_dl) {
 		printk(KERN_CRIT "Unable to register AARP with SNAP.\n");
+		return -ENOMEM;
+	}
 	timer_setup(&aarp_timer, aarp_expire_timeout, 0);
 	aarp_timer.expires  = jiffies + sysctl_aarp_expiry_time;
 	add_timer(&aarp_timer);
-	register_netdevice_notifier(&aarp_notifier);
+	rc = register_netdevice_notifier(&aarp_notifier);
+	if (rc) {
+		del_timer_sync(&aarp_timer);
+		unregister_snap_client(aarp_dl);
+	}
+	return rc;
 }
 
 /* Remove the AARP entries associated with a device. */
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 795fbc6c06aa..709d2542f729 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -1904,9 +1904,6 @@ static unsigned char ddp_snap_id[] = { 0x08, 0x00, 0x07, 0x80, 0x9B };
 EXPORT_SYMBOL(atrtr_get_dev);
 EXPORT_SYMBOL(atalk_find_dev_addr);
 
-static const char atalk_err_snap[] __initconst =
-	KERN_CRIT "Unable to register DDP with SNAP.\n";
-
 /* Called by proto.c on kernel start up */
 static int __init atalk_init(void)
 {
@@ -1921,17 +1918,22 @@ static int __init atalk_init(void)
 		goto out_proto;
 
 	ddp_dl = register_snap_client(ddp_snap_id, atalk_rcv);
-	if (!ddp_dl)
-		printk(atalk_err_snap);
+	if (!ddp_dl) {
+		pr_crit("Unable to register DDP with SNAP.\n");
+		goto out_sock;
+	}
 
 	dev_add_pack(&ltalk_packet_type);
 	dev_add_pack(&ppptalk_packet_type);
 
 	rc = register_netdevice_notifier(&ddp_notifier);
 	if (rc)
-		goto out_sock;
+		goto out_snap;
+
+	rc = aarp_proto_init();
+	if (rc)
+		goto out_dev;
 
-	aarp_proto_init();
 	rc = atalk_proc_init();
 	if (rc)
 		goto out_aarp;
@@ -1945,11 +1947,13 @@ static int __init atalk_init(void)
 	atalk_proc_exit();
 out_aarp:
 	aarp_cleanup_module();
+out_dev:
 	unregister_netdevice_notifier(&ddp_notifier);
-out_sock:
+out_snap:
 	dev_remove_pack(&ppptalk_packet_type);
 	dev_remove_pack(&ltalk_packet_type);
 	unregister_snap_client(ddp_dl);
+out_sock:
 	sock_unregister(PF_APPLETALK);
 out_proto:
 	proto_unregister(&ddp_proto);
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index f17e393b43b4..b53acd6c9a3d 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -510,12 +510,12 @@ void l2cap_chan_set_defaults(struct l2cap_chan *chan)
 }
 EXPORT_SYMBOL_GPL(l2cap_chan_set_defaults);
 
-static void l2cap_le_flowctl_init(struct l2cap_chan *chan)
+static void l2cap_le_flowctl_init(struct l2cap_chan *chan, u16 tx_credits)
 {
 	chan->sdu = NULL;
 	chan->sdu_last_frag = NULL;
 	chan->sdu_len = 0;
-	chan->tx_credits = 0;
+	chan->tx_credits = tx_credits;
 	/* Derive MPS from connection MTU to stop HCI fragmentation */
 	chan->mps = min_t(u16, chan->imtu, chan->conn->mtu - L2CAP_HDR_SIZE);
 	/* Give enough credits for a full packet */
@@ -1281,7 +1281,7 @@ static void l2cap_le_connect(struct l2cap_chan *chan)
 	if (test_and_set_bit(FLAG_LE_CONN_REQ_SENT, &chan->flags))
 		return;
 
-	l2cap_le_flowctl_init(chan);
+	l2cap_le_flowctl_init(chan, 0);
 
 	req.psm     = chan->psm;
 	req.scid    = cpu_to_le16(chan->scid);
@@ -5532,11 +5532,10 @@ static int l2cap_le_connect_req(struct l2cap_conn *conn,
 	chan->dcid = scid;
 	chan->omtu = mtu;
 	chan->remote_mps = mps;
-	chan->tx_credits = __le16_to_cpu(req->credits);
 
 	__l2cap_chan_add(conn, chan);
 
-	l2cap_le_flowctl_init(chan);
+	l2cap_le_flowctl_init(chan, __le16_to_cpu(req->credits));
 
 	dcid = chan->scid;
 	credits = chan->rx_credits;
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index a3a2cd55e23a..ba5d176de671 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -791,10 +791,13 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
 
 		conn = chan->conn;
 
-		/*change security for LE channels */
+		/* change security for LE channels */
 		if (chan->scid == L2CAP_CID_ATT) {
-			if (smp_conn_security(conn->hcon, sec.level))
+			if (smp_conn_security(conn->hcon, sec.level)) {
+				err = -EINVAL;
 				break;
+			}
+
 			set_bit(FLAG_PENDING_SECURITY, &chan->flags);
 			sk->sk_state = BT_CONFIG;
 			chan->state = BT_CONFIG;
diff --git a/net/core/filter.c b/net/core/filter.c
index f274620945ff..647c63a7b25b 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -1796,8 +1796,6 @@ static const struct bpf_func_proto bpf_skb_pull_data_proto = {
 
 BPF_CALL_1(bpf_sk_fullsock, struct sock *, sk)
 {
-	sk = sk_to_full_sk(sk);
-
 	return sk_fullsock(sk) ? (unsigned long)sk : (unsigned long)NULL;
 }
 
@@ -5266,7 +5264,7 @@ static const struct bpf_func_proto bpf_sk_release_proto = {
 	.func		= bpf_sk_release,
 	.gpl_only	= false,
 	.ret_type	= RET_INTEGER,
-	.arg1_type	= ARG_PTR_TO_SOCKET,
+	.arg1_type	= ARG_PTR_TO_SOCK_COMMON,
 };
 
 BPF_CALL_5(bpf_xdp_sk_lookup_udp, struct xdp_buff *, ctx,
@@ -5407,8 +5405,6 @@ u32 bpf_tcp_sock_convert_ctx_access(enum bpf_access_type type,
 
 BPF_CALL_1(bpf_tcp_sock, struct sock *, sk)
 {
-	sk = sk_to_full_sk(sk);
-
 	if (sk_fullsock(sk) && sk->sk_protocol == IPPROTO_TCP)
 		return (unsigned long)sk;
 
@@ -5422,6 +5418,23 @@ static const struct bpf_func_proto bpf_tcp_sock_proto = {
 	.arg1_type	= ARG_PTR_TO_SOCK_COMMON,
 };
 
+BPF_CALL_1(bpf_get_listener_sock, struct sock *, sk)
+{
+	sk = sk_to_full_sk(sk);
+
+	if (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_RCU_FREE))
+		return (unsigned long)sk;
+
+	return (unsigned long)NULL;
+}
+
+static const struct bpf_func_proto bpf_get_listener_sock_proto = {
+	.func		= bpf_get_listener_sock,
+	.gpl_only	= false,
+	.ret_type	= RET_PTR_TO_SOCKET_OR_NULL,
+	.arg1_type	= ARG_PTR_TO_SOCK_COMMON,
+};
+
 BPF_CALL_1(bpf_skb_ecn_set_ce, struct sk_buff *, skb)
 {
 	unsigned int iphdr_len;
@@ -5607,6 +5620,8 @@ cg_skb_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
 #ifdef CONFIG_INET
 	case BPF_FUNC_tcp_sock:
 		return &bpf_tcp_sock_proto;
+	case BPF_FUNC_get_listener_sock:
+		return &bpf_get_listener_sock_proto;
 	case BPF_FUNC_skb_ecn_set_ce:
 		return &bpf_skb_ecn_set_ce_proto;
 #endif
@@ -5702,6 +5717,8 @@ tc_cls_act_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
 		return &bpf_sk_release_proto;
 	case BPF_FUNC_tcp_sock:
 		return &bpf_tcp_sock_proto;
+	case BPF_FUNC_get_listener_sock:
+		return &bpf_get_listener_sock_proto;
 #endif
 	default:
 		return bpf_base_func_proto(func_id);
diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c
index 8756e0e790d2..d3170a8001b2 100644
--- a/net/ipv4/esp4_offload.c
+++ b/net/ipv4/esp4_offload.c
@@ -52,13 +52,13 @@ static struct sk_buff *esp4_gro_receive(struct list_head *head,
 			goto out;
 
 		if (sp->len == XFRM_MAX_DEPTH)
-			goto out;
+			goto out_reset;
 
 		x = xfrm_state_lookup(dev_net(skb->dev), skb->mark,
 				      (xfrm_address_t *)&ip_hdr(skb)->daddr,
 				      spi, IPPROTO_ESP, AF_INET);
 		if (!x)
-			goto out;
+			goto out_reset;
 
 		sp->xvec[sp->len++] = x;
 		sp->olen++;
@@ -66,7 +66,7 @@ static struct sk_buff *esp4_gro_receive(struct list_head *head,
 		xo = xfrm_offload(skb);
 		if (!xo) {
 			xfrm_state_put(x);
-			goto out;
+			goto out_reset;
 		}
 	}
 
@@ -82,6 +82,8 @@ static struct sk_buff *esp4_gro_receive(struct list_head *head,
 	xfrm_input(skb, IPPROTO_ESP, spi, -2);
 
 	return ERR_PTR(-EINPROGRESS);
+out_reset:
+	secpath_reset(skb);
 out:
 	skb_push(skb, offset);
 	NAPI_GRO_CB(skb)->same_flow = 0;
diff --git a/net/ipv6/esp6_offload.c b/net/ipv6/esp6_offload.c
index d46b4eb645c2..cb99f6fb79b7 100644
--- a/net/ipv6/esp6_offload.c
+++ b/net/ipv6/esp6_offload.c
@@ -74,13 +74,13 @@ static struct sk_buff *esp6_gro_receive(struct list_head *head,
 			goto out;
 
 		if (sp->len == XFRM_MAX_DEPTH)
-			goto out;
+			goto out_reset;
 
 		x = xfrm_state_lookup(dev_net(skb->dev), skb->mark,
 				      (xfrm_address_t *)&ipv6_hdr(skb)->daddr,
 				      spi, IPPROTO_ESP, AF_INET6);
 		if (!x)
-			goto out;
+			goto out_reset;
 
 		sp->xvec[sp->len++] = x;
 		sp->olen++;
@@ -88,7 +88,7 @@ static struct sk_buff *esp6_gro_receive(struct list_head *head,
 		xo = xfrm_offload(skb);
 		if (!xo) {
 			xfrm_state_put(x);
-			goto out;
+			goto out_reset;
 		}
 	}
 
@@ -109,6 +109,8 @@ static struct sk_buff *esp6_gro_receive(struct list_head *head,
 	xfrm_input(skb, IPPROTO_ESP, spi, -2);
 
 	return ERR_PTR(-EINPROGRESS);
+out_reset:
+	secpath_reset(skb);
 out:
 	skb_push(skb, offset);
 	NAPI_GRO_CB(skb)->same_flow = 0;
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c
index bc65db782bfb..12cb3aa990af 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -402,6 +402,10 @@ static void __exit xfrm6_tunnel_fini(void)
 	xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
 	xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
 	unregister_pernet_subsys(&xfrm6_tunnel_net_ops);
+	/* Someone maybe has gotten the xfrm6_tunnel_spi.
+	 * So need to wait it.
+	 */
+	rcu_barrier();
 	kmem_cache_destroy(xfrm6_tunnel_spi_kmem);
 }
 
diff --git a/net/ncsi/ncsi-netlink.c b/net/ncsi/ncsi-netlink.c
index 5d782445d2fc..bad17bba8ba7 100644
--- a/net/ncsi/ncsi-netlink.c
+++ b/net/ncsi/ncsi-netlink.c
@@ -251,6 +251,10 @@ static int ncsi_pkg_info_all_nl(struct sk_buff *skb,
 	}
 
 	attr = nla_nest_start(skb, NCSI_ATTR_PACKAGE_LIST);
+	if (!attr) {
+		rc = -EMSGSIZE;
+		goto err;
+	}
 	rc = ncsi_write_package_info(skb, ndp, package->id);
 	if (rc) {
 		nla_nest_cancel(skb, attr);
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index 376181cc1def..8b70bf2ac604 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -922,7 +922,8 @@ static int nfc_genl_deactivate_target(struct sk_buff *skb,
 	u32 device_idx, target_idx;
 	int rc;
 
-	if (!info->attrs[NFC_ATTR_DEVICE_INDEX])
+	if (!info->attrs[NFC_ATTR_DEVICE_INDEX] ||
+	    !info->attrs[NFC_ATTR_TARGET_INDEX])
 		return -EINVAL;
 
 	device_idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX]);
@@ -1230,7 +1231,8 @@ static int nfc_genl_fw_download(struct sk_buff *skb, struct genl_info *info)
 	u32 idx;
 	char firmware_name[NFC_FIRMWARE_NAME_MAXSIZE + 1];
 
-	if (!info->attrs[NFC_ATTR_DEVICE_INDEX])
+	if (!info->attrs[NFC_ATTR_DEVICE_INDEX] ||
+	    !info->attrs[NFC_ATTR_FIRMWARE_NAME])
 		return -EINVAL;
 
 	idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX]);
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 6679e96ab1dc..9dd158ab51b3 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -448,6 +448,10 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
 
 	upcall = genlmsg_put(user_skb, 0, 0, &dp_packet_genl_family,
 			     0, upcall_info->cmd);
+	if (!upcall) {
+		err = -EINVAL;
+		goto out;
+	}
 	upcall->dp_ifindex = dp_ifindex;
 
 	err = ovs_nla_put_key(key, key, OVS_PACKET_ATTR_KEY, false, user_skb);
@@ -460,6 +464,10 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
 
 	if (upcall_info->egress_tun_info) {
 		nla = nla_nest_start(user_skb, OVS_PACKET_ATTR_EGRESS_TUN_KEY);
+		if (!nla) {
+			err = -EMSGSIZE;
+			goto out;
+		}
 		err = ovs_nla_put_tunnel_info(user_skb,
 					      upcall_info->egress_tun_info);
 		BUG_ON(err);
@@ -468,6 +476,10 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
 
 	if (upcall_info->actions_len) {
 		nla = nla_nest_start(user_skb, OVS_PACKET_ATTR_ACTIONS);
+		if (!nla) {
+			err = -EMSGSIZE;
+			goto out;
+		}
 		err = ovs_nla_put_actions(upcall_info->actions,
 					  upcall_info->actions_len,
 					  user_skb);
diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index 1d2a12132abc..acc9b9da985f 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -211,6 +211,9 @@ struct cake_sched_data {
 	u8		ack_filter;
 	u8		atm_mode;
 
+	u32		fwmark_mask;
+	u16		fwmark_shft;
+
 	/* time_next = time_this + ((len * rate_ns) >> rate_shft) */
 	u16		rate_shft;
 	ktime_t		time_next_packet;
@@ -258,8 +261,7 @@ enum {
 	CAKE_FLAG_AUTORATE_INGRESS = BIT(1),
 	CAKE_FLAG_INGRESS	   = BIT(2),
 	CAKE_FLAG_WASH		   = BIT(3),
-	CAKE_FLAG_SPLIT_GSO	   = BIT(4),
-	CAKE_FLAG_FWMARK	   = BIT(5)
+	CAKE_FLAG_SPLIT_GSO	   = BIT(4)
 };
 
 /* COBALT operates the Codel and BLUE algorithms in parallel, in order to
@@ -1543,7 +1545,7 @@ static struct cake_tin_data *cake_select_tin(struct Qdisc *sch,
 					     struct sk_buff *skb)
 {
 	struct cake_sched_data *q = qdisc_priv(sch);
-	u32 tin;
+	u32 tin, mark;
 	u8 dscp;
 
 	/* Tin selection: Default to diffserv-based selection, allow overriding
@@ -1551,14 +1553,13 @@ static struct cake_tin_data *cake_select_tin(struct Qdisc *sch,
 	 */
 	dscp = cake_handle_diffserv(skb,
 				    q->rate_flags & CAKE_FLAG_WASH);
+	mark = (skb->mark & q->fwmark_mask) >> q->fwmark_shft;
 
 	if (q->tin_mode == CAKE_DIFFSERV_BESTEFFORT)
 		tin = 0;
 
-	else if (q->rate_flags & CAKE_FLAG_FWMARK && /* use fw mark */
-		 skb->mark &&
-		 skb->mark <= q->tin_cnt)
-		tin = q->tin_order[skb->mark - 1];
+	else if (mark && mark <= q->tin_cnt)
+		tin = q->tin_order[mark - 1];
 
 	else if (TC_H_MAJ(skb->priority) == sch->handle &&
 		 TC_H_MIN(skb->priority) > 0 &&
@@ -2172,6 +2173,7 @@ static const struct nla_policy cake_policy[TCA_CAKE_MAX + 1] = {
 	[TCA_CAKE_MPU]		 = { .type = NLA_U32 },
 	[TCA_CAKE_INGRESS]	 = { .type = NLA_U32 },
 	[TCA_CAKE_ACK_FILTER]	 = { .type = NLA_U32 },
+	[TCA_CAKE_FWMARK]	 = { .type = NLA_U32 },
 };
 
 static void cake_set_rate(struct cake_tin_data *b, u64 rate, u32 mtu,
@@ -2619,10 +2621,8 @@ static int cake_change(struct Qdisc *sch, struct nlattr *opt,
 	}
 
 	if (tb[TCA_CAKE_FWMARK]) {
-		if (!!nla_get_u32(tb[TCA_CAKE_FWMARK]))
-			q->rate_flags |= CAKE_FLAG_FWMARK;
-		else
-			q->rate_flags &= ~CAKE_FLAG_FWMARK;
+		q->fwmark_mask = nla_get_u32(tb[TCA_CAKE_FWMARK]);
+		q->fwmark_shft = q->fwmark_mask ? __ffs(q->fwmark_mask) : 0;
 	}
 
 	if (q->tins) {
@@ -2784,8 +2784,7 @@ static int cake_dump(struct Qdisc *sch, struct sk_buff *skb)
 			!!(q->rate_flags & CAKE_FLAG_SPLIT_GSO)))
 		goto nla_put_failure;
 
-	if (nla_put_u32(skb, TCA_CAKE_FWMARK,
-			!!(q->rate_flags & CAKE_FLAG_FWMARK)))
+	if (nla_put_u32(skb, TCA_CAKE_FWMARK, q->fwmark_mask))
 		goto nla_put_failure;
 
 	return nla_nest_end(skb, opts);
diff --git a/net/socket.c b/net/socket.c
index 3c176a12fe48..8255f5bda0aa 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -384,6 +384,18 @@ static struct file_system_type sock_fs_type = {
  *	but we take care of internal coherence yet.
  */
 
+/**
+ *	sock_alloc_file - Bind a &socket to a &file
+ *	@sock: socket
+ *	@flags: file status flags
+ *	@dname: protocol name
+ *
+ *	Returns the &file bound with @sock, implicitly storing it
+ *	in sock->file. If dname is %NULL, sets to "".
+ *	On failure the return is a ERR pointer (see linux/err.h).
+ *	This function uses GFP_KERNEL internally.
+ */
+
 struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname)
 {
 	struct file *file;
@@ -424,6 +436,14 @@ static int sock_map_fd(struct socket *sock, int flags)
 	return PTR_ERR(newfile);
 }
 
+/**
+ *	sock_from_file - Return the &socket bounded to @file.
+ *	@file: file
+ *	@err: pointer to an error code return
+ *
+ *	On failure returns %NULL and assigns -ENOTSOCK to @err.
+ */
+
 struct socket *sock_from_file(struct file *file, int *err)
 {
 	if (file->f_op == &socket_file_ops)
@@ -532,11 +552,11 @@ static const struct inode_operations sockfs_inode_ops = {
 };
 
 /**
- *	sock_alloc	-	allocate a socket
+ *	sock_alloc - allocate a socket
  *
  *	Allocate a new inode and socket object. The two are bound together
  *	and initialised. The socket is then returned. If we are out of inodes
- *	NULL is returned.
+ *	NULL is returned. This functions uses GFP_KERNEL internally.
  */
 
 struct socket *sock_alloc(void)
@@ -561,7 +581,7 @@ struct socket *sock_alloc(void)
 EXPORT_SYMBOL(sock_alloc);
 
 /**
- *	sock_release	-	close a socket
+ *	sock_release - close a socket
  *	@sock: socket to close
  *
  *	The socket is released from the protocol stack if it has a release
@@ -617,6 +637,15 @@ void __sock_tx_timestamp(__u16 tsflags, __u8 *tx_flags)
 }
 EXPORT_SYMBOL(__sock_tx_timestamp);
 
+/**
+ *	sock_sendmsg - send a message through @sock
+ *	@sock: socket
+ *	@msg: message to send
+ *
+ *	Sends @msg through @sock, passing through LSM.
+ *	Returns the number of bytes sent, or an error code.
+ */
+
 static inline int sock_sendmsg_nosec(struct socket *sock, struct msghdr *msg)
 {
 	int ret = sock->ops->sendmsg(sock, msg, msg_data_left(msg));
@@ -633,6 +662,18 @@ int sock_sendmsg(struct socket *sock, struct msghdr *msg)
 }
 EXPORT_SYMBOL(sock_sendmsg);
 
+/**
+ *	kernel_sendmsg - send a message through @sock (kernel-space)
+ *	@sock: socket
+ *	@msg: message header
+ *	@vec: kernel vec
+ *	@num: vec array length
+ *	@size: total message data size
+ *
+ *	Builds the message data with @vec and sends it through @sock.
+ *	Returns the number of bytes sent, or an error code.
+ */
+
 int kernel_sendmsg(struct socket *sock, struct msghdr *msg,
 		   struct kvec *vec, size_t num, size_t size)
 {
@@ -641,6 +682,19 @@ int kernel_sendmsg(struct socket *sock, struct msghdr *msg,
 }
 EXPORT_SYMBOL(kernel_sendmsg);
 
+/**
+ *	kernel_sendmsg_locked - send a message through @sock (kernel-space)
+ *	@sk: sock
+ *	@msg: message header
+ *	@vec: output s/g array
+ *	@num: output s/g array length
+ *	@size: total message data size
+ *
+ *	Builds the message data with @vec and sends it through @sock.
+ *	Returns the number of bytes sent, or an error code.
+ *	Caller must hold @sk.
+ */
+
 int kernel_sendmsg_locked(struct sock *sk, struct msghdr *msg,
 			  struct kvec *vec, size_t num, size_t size)
 {
@@ -811,6 +865,16 @@ void __sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
 }
 EXPORT_SYMBOL_GPL(__sock_recv_ts_and_drops);
 
+/**
+ *	sock_recvmsg - receive a message from @sock
+ *	@sock: socket
+ *	@msg: message to receive
+ *	@flags: message flags
+ *
+ *	Receives @msg from @sock, passing through LSM. Returns the total number
+ *	of bytes received, or an error.
+ */
+
 static inline int sock_recvmsg_nosec(struct socket *sock, struct msghdr *msg,
 				     int flags)
 {
@@ -826,20 +890,21 @@ int sock_recvmsg(struct socket *sock, struct msghdr *msg, int flags)
 EXPORT_SYMBOL(sock_recvmsg);
 
 /**
- * kernel_recvmsg - Receive a message from a socket (kernel space)
- * @sock:       The socket to receive the message from
- * @msg:        Received message
- * @vec:        Input s/g array for message data
- * @num:        Size of input s/g array
- * @size:       Number of bytes to read
- * @flags:      Message flags (MSG_DONTWAIT, etc...)
+ *	kernel_recvmsg - Receive a message from a socket (kernel space)
+ *	@sock: The socket to receive the message from
+ *	@msg: Received message
+ *	@vec: Input s/g array for message data
+ *	@num: Size of input s/g array
+ *	@size: Number of bytes to read
+ *	@flags: Message flags (MSG_DONTWAIT, etc...)
  *
- * On return the msg structure contains the scatter/gather array passed in the
- * vec argument. The array is modified so that it consists of the unfilled
- * portion of the original array.
+ *	On return the msg structure contains the scatter/gather array passed in the
+ *	vec argument. The array is modified so that it consists of the unfilled
+ *	portion of the original array.
  *
- * The returned value is the total number of bytes received, or an error.
+ *	The returned value is the total number of bytes received, or an error.
  */
+
 int kernel_recvmsg(struct socket *sock, struct msghdr *msg,
 		   struct kvec *vec, size_t num, size_t size, int flags)
 {
@@ -1005,6 +1070,13 @@ static long sock_do_ioctl(struct net *net, struct socket *sock,
  *	what to do with it - that's up to the protocol still.
  */
 
+/**
+ *	get_net_ns - increment the refcount of the network namespace
+ *	@ns: common namespace (net)
+ *
+ *	Returns the net's common namespace.
+ */
+
 struct ns_common *get_net_ns(struct ns_common *ns)
 {
 	return &get_net(container_of(ns, struct net, ns))->ns;
@@ -1099,6 +1171,19 @@ static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg)
 	return err;
 }
 
+/**
+ *	sock_create_lite - creates a socket
+ *	@family: protocol family (AF_INET, ...)
+ *	@type: communication type (SOCK_STREAM, ...)
+ *	@protocol: protocol (0, ...)
+ *	@res: new socket
+ *
+ *	Creates a new socket and assigns it to @res, passing through LSM.
+ *	The new socket initialization is not complete, see kernel_accept().
+ *	Returns 0 or an error. On failure @res is set to %NULL.
+ *	This function internally uses GFP_KERNEL.
+ */
+
 int sock_create_lite(int family, int type, int protocol, struct socket **res)
 {
 	int err;
@@ -1224,6 +1309,21 @@ int sock_wake_async(struct socket_wq *wq, int how, int band)
 }
 EXPORT_SYMBOL(sock_wake_async);
 
+/**
+ *	__sock_create - creates a socket
+ *	@net: net namespace
+ *	@family: protocol family (AF_INET, ...)
+ *	@type: communication type (SOCK_STREAM, ...)
+ *	@protocol: protocol (0, ...)
+ *	@res: new socket
+ *	@kern: boolean for kernel space sockets
+ *
+ *	Creates a new socket and assigns it to @res, passing through LSM.
+ *	Returns 0 or an error. On failure @res is set to %NULL. @kern must
+ *	be set to true if the socket resides in kernel space.
+ *	This function internally uses GFP_KERNEL.
+ */
+
 int __sock_create(struct net *net, int family, int type, int protocol,
 			 struct socket **res, int kern)
 {
@@ -1333,12 +1433,35 @@ int __sock_create(struct net *net, int family, int type, int protocol,
 }
 EXPORT_SYMBOL(__sock_create);
 
+/**
+ *	sock_create - creates a socket
+ *	@family: protocol family (AF_INET, ...)
+ *	@type: communication type (SOCK_STREAM, ...)
+ *	@protocol: protocol (0, ...)
+ *	@res: new socket
+ *
+ *	A wrapper around __sock_create().
+ *	Returns 0 or an error. This function internally uses GFP_KERNEL.
+ */
+
 int sock_create(int family, int type, int protocol, struct socket **res)
 {
 	return __sock_create(current->nsproxy->net_ns, family, type, protocol, res, 0);
 }
 EXPORT_SYMBOL(sock_create);
 
+/**
+ *	sock_create_kern - creates a socket (kernel space)
+ *	@net: net namespace
+ *	@family: protocol family (AF_INET, ...)
+ *	@type: communication type (SOCK_STREAM, ...)
+ *	@protocol: protocol (0, ...)
+ *	@res: new socket
+ *
+ *	A wrapper around __sock_create().
+ *	Returns 0 or an error. This function internally uses GFP_KERNEL.
+ */
+
 int sock_create_kern(struct net *net, int family, int type, int protocol, struct socket **res)
 {
 	return __sock_create(net, family, type, protocol, res, 1);
@@ -3322,18 +3445,46 @@ static long compat_sock_ioctl(struct file *file, unsigned int cmd,
 }
 #endif
 
+/**
+ *	kernel_bind - bind an address to a socket (kernel space)
+ *	@sock: socket
+ *	@addr: address
+ *	@addrlen: length of address
+ *
+ *	Returns 0 or an error.
+ */
+
 int kernel_bind(struct socket *sock, struct sockaddr *addr, int addrlen)
 {
 	return sock->ops->bind(sock, addr, addrlen);
 }
 EXPORT_SYMBOL(kernel_bind);
 
+/**
+ *	kernel_listen - move socket to listening state (kernel space)
+ *	@sock: socket
+ *	@backlog: pending connections queue size
+ *
+ *	Returns 0 or an error.
+ */
+
 int kernel_listen(struct socket *sock, int backlog)
 {
 	return sock->ops->listen(sock, backlog);
 }
 EXPORT_SYMBOL(kernel_listen);
 
+/**
+ *	kernel_accept - accept a connection (kernel space)
+ *	@sock: listening socket
+ *	@newsock: new connected socket
+ *	@flags: flags
+ *
+ *	@flags must be SOCK_CLOEXEC, SOCK_NONBLOCK or 0.
+ *	If it fails, @newsock is guaranteed to be %NULL.
+ *	Returns 0 or an error.
+ */
+
 int kernel_accept(struct socket *sock, struct socket **newsock, int flags)
 {
 	struct sock *sk = sock->sk;
@@ -3359,6 +3510,19 @@ int kernel_accept(struct socket *sock, struct socket **newsock, int flags)
 }
 EXPORT_SYMBOL(kernel_accept);
 
+/**
+ *	kernel_connect - connect a socket (kernel space)
+ *	@sock: socket
+ *	@addr: address
+ *	@addrlen: address length
+ *	@flags: flags (O_NONBLOCK, ...)
+ *
+ *	For datagram sockets, @addr is the addres to which datagrams are sent
+ *	by default, and the only address from which datagrams are received.
+ *	For stream sockets, attempts to connect to @addr.
+ *	Returns 0 or an error code.
+ */
+
 int kernel_connect(struct socket *sock, struct sockaddr *addr, int addrlen,
 		   int flags)
 {
@@ -3366,18 +3530,48 @@ int kernel_connect(struct socket *sock, struct sockaddr *addr, int addrlen,
 }
 EXPORT_SYMBOL(kernel_connect);
 
+/**
+ *	kernel_getsockname - get the address which the socket is bound (kernel space)
+ *	@sock: socket
+ *	@addr: address holder
+ *
+ * 	Fills the @addr pointer with the address which the socket is bound.
+ *	Returns 0 or an error code.
+ */
+
 int kernel_getsockname(struct socket *sock, struct sockaddr *addr)
 {
 	return sock->ops->getname(sock, addr, 0);
 }
 EXPORT_SYMBOL(kernel_getsockname);
 
+/**
+ *	kernel_peername - get the address which the socket is connected (kernel space)
+ *	@sock: socket
+ *	@addr: address holder
+ *
+ * 	Fills the @addr pointer with the address which the socket is connected.
+ *	Returns 0 or an error code.
+ */
+
 int kernel_getpeername(struct socket *sock, struct sockaddr *addr)
 {
 	return sock->ops->getname(sock, addr, 1);
 }
 EXPORT_SYMBOL(kernel_getpeername);
 
+/**
+ *	kernel_getsockopt - get a socket option (kernel space)
+ *	@sock: socket
+ *	@level: API level (SOL_SOCKET, ...)
+ *	@optname: option tag
+ *	@optval: option value
+ *	@optlen: option length
+ *
+ *	Assigns the option length to @optlen.
+ *	Returns 0 or an error.
+ */
+
 int kernel_getsockopt(struct socket *sock, int level, int optname,
 			char *optval, int *optlen)
 {
@@ -3400,6 +3594,17 @@ int kernel_getsockopt(struct socket *sock, int level, int optname,
 }
 EXPORT_SYMBOL(kernel_getsockopt);
 
+/**
+ *	kernel_setsockopt - set a socket option (kernel space)
+ *	@sock: socket
+ *	@level: API level (SOL_SOCKET, ...)
+ *	@optname: option tag
+ *	@optval: option value
+ *	@optlen: option length
+ *
+ *	Returns 0 or an error.
+ */
+
 int kernel_setsockopt(struct socket *sock, int level, int optname,
 			char *optval, unsigned int optlen)
 {
@@ -3420,6 +3625,17 @@ int kernel_setsockopt(struct socket *sock, int level, int optname,
 }
 EXPORT_SYMBOL(kernel_setsockopt);
 
+/**
+ *	kernel_sendpage - send a &page through a socket (kernel space)
+ *	@sock: socket
+ *	@page: page
+ *	@offset: page offset
+ *	@size: total size in bytes
+ *	@flags: flags (MSG_DONTWAIT, ...)
+ *
+ *	Returns the total amount sent in bytes or an error.
+ */
+
 int kernel_sendpage(struct socket *sock, struct page *page, int offset,
 		    size_t size, int flags)
 {
@@ -3430,6 +3646,18 @@ int kernel_sendpage(struct socket *sock, struct page *page, int offset,
 }
 EXPORT_SYMBOL(kernel_sendpage);
 
+/**
+ *	kernel_sendpage_locked - send a &page through the locked sock (kernel space)
+ *	@sk: sock
+ *	@page: page
+ *	@offset: page offset
+ *	@size: total size in bytes
+ *	@flags: flags (MSG_DONTWAIT, ...)
+ *
+ *	Returns the total amount sent in bytes or an error.
+ *	Caller must hold @sk.
+ */
+
 int kernel_sendpage_locked(struct sock *sk, struct page *page, int offset,
 			   size_t size, int flags)
 {
@@ -3443,17 +3671,30 @@ int kernel_sendpage_locked(struct sock *sk, struct page *page, int offset,
 }
 EXPORT_SYMBOL(kernel_sendpage_locked);
 
+/**
+ *	kernel_shutdown - shut down part of a full-duplex connection (kernel space)
+ *	@sock: socket
+ *	@how: connection part
+ *
+ *	Returns 0 or an error.
+ */
+
 int kernel_sock_shutdown(struct socket *sock, enum sock_shutdown_cmd how)
 {
 	return sock->ops->shutdown(sock, how);
 }
 EXPORT_SYMBOL(kernel_sock_shutdown);
 
-/* This routine returns the IP overhead imposed by a socket i.e.
- * the length of the underlying IP header, depending on whether
- * this is an IPv4 or IPv6 socket and the length from IP options turned
- * on at the socket. Assumes that the caller has a lock on the socket.
+/**
+ *	kernel_sock_ip_overhead - returns the IP overhead imposed by a socket
+ *	@sk: socket
+ *
+ *	This routine returns the IP overhead imposed by a socket i.e.
+ *	the length of the underlying IP header, depending on whether
+ *	this is an IPv4 or IPv6 socket and the length from IP options turned
+ *	on at the socket. Assumes that the caller has a lock on the socket.
  */
+
 u32 kernel_sock_ip_overhead(struct sock *sk)
 {
 	struct inet_sock *inet;
diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c
index da1a676860ca..860dcfb95ee4 100644
--- a/net/strparser/strparser.c
+++ b/net/strparser/strparser.c
@@ -550,6 +550,8 @@ EXPORT_SYMBOL_GPL(strp_check_rcv);
 static int __init strp_mod_init(void)
 {
 	strp_wq = create_singlethread_workqueue("kstrp");
+	if (unlikely(!strp_wq))
+		return -ENOMEM;
 
 	return 0;
 }
diff --git a/net/tipc/group.c b/net/tipc/group.c
index 06fee142f09f..63f39201e41e 100644
--- a/net/tipc/group.c
+++ b/net/tipc/group.c
@@ -919,6 +919,9 @@ int tipc_group_fill_sock_diag(struct tipc_group *grp, struct sk_buff *skb)
 {
 	struct nlattr *group = nla_nest_start(skb, TIPC_NLA_SOCK_GROUP);
 
+	if (!group)
+		return -EMSGSIZE;
+
 	if (nla_put_u32(skb, TIPC_NLA_SOCK_GROUP_ID,
 			grp->type) ||
 	    nla_put_u32(skb, TIPC_NLA_SOCK_GROUP_INSTANCE,
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 3274ef625dba..d6b26862b34e 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -3255,6 +3255,8 @@ static int __tipc_nl_add_sk_con(struct sk_buff *skb, struct tipc_sock *tsk)
 	peer_port = tsk_peer_port(tsk);
 
 	nest = nla_nest_start(skb, TIPC_NLA_SOCK_CON);
+	if (!nest)
+		return -EMSGSIZE;
 
 	if (nla_put_u32(skb, TIPC_NLA_CON_NODE, peer_node))
 		goto msg_full;
diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c
index 77520eacee8f..989e52386c35 100644
--- a/net/xdp/xdp_umem.c
+++ b/net/xdp/xdp_umem.c
@@ -193,9 +193,6 @@ static void xdp_umem_unaccount_pages(struct xdp_umem *umem)
 
 static void xdp_umem_release(struct xdp_umem *umem)
 {
-	struct task_struct *task;
-	struct mm_struct *mm;
-
 	xdp_umem_clear_dev(umem);
 
 	ida_simple_remove(&umem_ida, umem->id);
@@ -214,21 +211,10 @@ static void xdp_umem_release(struct xdp_umem *umem)
 
 	xdp_umem_unpin_pages(umem);
 
-	task = get_pid_task(umem->pid, PIDTYPE_PID);
-	put_pid(umem->pid);
-	if (!task)
-		goto out;
-	mm = get_task_mm(task);
-	put_task_struct(task);
-	if (!mm)
-		goto out;
-
-	mmput(mm);
 	kfree(umem->pages);
 	umem->pages = NULL;
 
 	xdp_umem_unaccount_pages(umem);
-out:
 	kfree(umem);
 }
 
@@ -357,7 +343,6 @@ static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)
 	if (size_chk < 0)
 		return -EINVAL;
 
-	umem->pid = get_task_pid(current, PIDTYPE_PID);
 	umem->address = (unsigned long)addr;
 	umem->chunk_mask = ~((u64)chunk_size - 1);
 	umem->size = size;
@@ -373,7 +358,7 @@ static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)
 
 	err = xdp_umem_account_pages(umem);
 	if (err)
-		goto out;
+		return err;
 
 	err = xdp_umem_pin_pages(umem);
 	if (err)
@@ -392,8 +377,6 @@ static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)
 
 out_account:
 	xdp_umem_unaccount_pages(umem);
-out:
-	put_pid(umem->pid);
 	return err;
 }
 
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index a131f9ff979e..944589832343 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1071,6 +1071,22 @@ static inline int xfrm_nlmsg_multicast(struct net *net, struct sk_buff *skb,
 	return nlmsg_multicast(nlsk, skb, pid, group, GFP_ATOMIC);
 }
 
+/* A similar wrapper like xfrm_nlmsg_multicast checking that nlsk is still
+ * available.
+ */
+static inline int xfrm_nlmsg_unicast(struct net *net, struct sk_buff *skb,
+				     u32 pid)
+{
+	struct sock *nlsk = rcu_dereference(net->xfrm.nlsk);
+
+	if (!nlsk) {
+		kfree_skb(skb);
+		return -EPIPE;
+	}
+
+	return nlmsg_unicast(nlsk, skb, pid);
+}
+
 static inline unsigned int xfrm_spdinfo_msgsize(void)
 {
 	return NLMSG_ALIGN(4)
@@ -1195,7 +1211,7 @@ static int xfrm_get_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh,
 	err = build_spdinfo(r_skb, net, sportid, seq, *flags);
 	BUG_ON(err < 0);
 
-	return nlmsg_unicast(net->xfrm.nlsk, r_skb, sportid);
+	return xfrm_nlmsg_unicast(net, r_skb, sportid);
 }
 
 static inline unsigned int xfrm_sadinfo_msgsize(void)
@@ -1254,7 +1270,7 @@ static int xfrm_get_sadinfo(struct sk_buff *skb, struct nlmsghdr *nlh,
 	err = build_sadinfo(r_skb, net, sportid, seq, *flags);
 	BUG_ON(err < 0);
 
-	return nlmsg_unicast(net->xfrm.nlsk, r_skb, sportid);
+	return xfrm_nlmsg_unicast(net, r_skb, sportid);
 }
 
 static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
@@ -1274,7 +1290,7 @@ static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
 	if (IS_ERR(resp_skb)) {
 		err = PTR_ERR(resp_skb);
 	} else {
-		err = nlmsg_unicast(net->xfrm.nlsk, resp_skb, NETLINK_CB(skb).portid);
+		err = xfrm_nlmsg_unicast(net, resp_skb, NETLINK_CB(skb).portid);
 	}
 	xfrm_state_put(x);
 out_noput:
@@ -1337,7 +1353,7 @@ static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh,
 		goto out;
 	}
 
-	err = nlmsg_unicast(net->xfrm.nlsk, resp_skb, NETLINK_CB(skb).portid);
+	err = xfrm_nlmsg_unicast(net, resp_skb, NETLINK_CB(skb).portid);
 
 out:
 	xfrm_state_put(x);
@@ -1424,7 +1440,7 @@ static int verify_newpolicy_info(struct xfrm_userpolicy_info *p)
 	ret = verify_policy_dir(p->dir);
 	if (ret)
 		return ret;
-	if (p->index && ((p->index & XFRM_POLICY_MAX) != p->dir))
+	if (p->index && (xfrm_policy_id2dir(p->index) != p->dir))
 		return -EINVAL;
 
 	return 0;
@@ -1903,8 +1919,8 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
 		if (IS_ERR(resp_skb)) {
 			err = PTR_ERR(resp_skb);
 		} else {
-			err = nlmsg_unicast(net->xfrm.nlsk, resp_skb,
-					    NETLINK_CB(skb).portid);
+			err = xfrm_nlmsg_unicast(net, resp_skb,
+						 NETLINK_CB(skb).portid);
 		}
 	} else {
 		xfrm_audit_policy_delete(xp, err ? 0 : 1, true);
@@ -2062,7 +2078,7 @@ static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh,
 	err = build_aevent(r_skb, x, &c);
 	BUG_ON(err < 0);
 
-	err = nlmsg_unicast(net->xfrm.nlsk, r_skb, NETLINK_CB(skb).portid);
+	err = xfrm_nlmsg_unicast(net, r_skb, NETLINK_CB(skb).portid);
 	spin_unlock_bh(&x->lock);
 	xfrm_state_put(x);
 	return err;
diff --git a/scripts/atomic/gen-atomics.sh b/scripts/atomic/gen-atomics.sh
index 27400b0cd732..000dc6437893 100644
--- a/scripts/atomic/gen-atomics.sh
+++ b/scripts/atomic/gen-atomics.sh
@@ -13,7 +13,7 @@ gen-atomic-long.sh              asm-generic/atomic-long.h
 gen-atomic-fallback.sh          linux/atomic-fallback.h
 EOF
 while read script header; do
-	${ATOMICDIR}/${script} ${ATOMICTBL} > ${LINUXDIR}/include/${header}
+	/bin/sh ${ATOMICDIR}/${script} ${ATOMICTBL} > ${LINUXDIR}/include/${header}
 	HASH="$(sha1sum ${LINUXDIR}/include/${header})"
 	HASH="${HASH%% *}"
 	printf "// %s\n" "${HASH}" >> ${LINUXDIR}/include/${header}
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 5b756278df13..d0001fd1112d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2707,8 +2707,10 @@ sub process {
 		    ($line =~ /^\s*(?:WARNING:|BUG:)/ ||
 		     $line =~ /^\s*\[\s*\d+\.\d{6,6}\s*\]/ ||
 					# timestamp
-		     $line =~ /^\s*\[\<[0-9a-fA-F]{8,}\>\]/)) {
-					# stack dump address
+		     $line =~ /^\s*\[\<[0-9a-fA-F]{8,}\>\]/) ||
+		     $line =~ /^(?:\s+\w+:\s+[0-9a-fA-F]+){3,3}/ ||
+		     $line =~ /^\s*\#\d+\s*\[[0-9a-fA-F]+\]\s*\w+ at [0-9a-fA-F]+/) {
+					# stack dump address styles
 			$commit_log_possible_stack_dump = 1;
 		}
 
@@ -3051,21 +3053,21 @@ sub process {
 # check SPDX comment style for .[chsS] files
 				if ($realfile =~ /\.[chsS]$/ &&
 				    $rawline =~ /SPDX-License-Identifier:/ &&
-				    $rawline !~ /^\+\s*\Q$comment\E\s*/) {
+				    $rawline !~ m@^\+\s*\Q$comment\E\s*@) {
 					WARN("SPDX_LICENSE_TAG",
 					     "Improper SPDX comment style for '$realfile', please use '$comment' instead\n" . $herecurr);
 				}
 
 				if ($comment !~ /^$/ &&
-				    $rawline !~ /^\+\Q$comment\E SPDX-License-Identifier: /) {
-					 WARN("SPDX_LICENSE_TAG",
-					      "Missing or malformed SPDX-License-Identifier tag in line $checklicenseline\n" . $herecurr);
+				    $rawline !~ m@^\+\Q$comment\E SPDX-License-Identifier: @) {
+					WARN("SPDX_LICENSE_TAG",
+					     "Missing or malformed SPDX-License-Identifier tag in line $checklicenseline\n" . $herecurr);
 				} elsif ($rawline =~ /(SPDX-License-Identifier: .*)/) {
-					 my $spdx_license = $1;
-					 if (!is_SPDX_License_valid($spdx_license)) {
-						  WARN("SPDX_LICENSE_TAG",
-						       "'$spdx_license' is not supported in LICENSES/...\n" . $herecurr);
-					 }
+					my $spdx_license = $1;
+					if (!is_SPDX_License_valid($spdx_license)) {
+						WARN("SPDX_LICENSE_TAG",
+						     "'$spdx_license' is not supported in LICENSES/...\n" . $herecurr);
+					}
 				}
 			}
 		}
diff --git a/security/apparmor/Kconfig b/security/apparmor/Kconfig
index 3de21f46c82a..99c35e22c119 100644
--- a/security/apparmor/Kconfig
+++ b/security/apparmor/Kconfig
@@ -5,6 +5,8 @@ config SECURITY_APPARMOR
 	select SECURITY_PATH
 	select SECURITYFS
 	select SECURITY_NETWORK
+	select ZLIB_INFLATE
+	select ZLIB_DEFLATE
 	default n
 	help
 	  This enables the AppArmor security module.
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index fefee040bf79..9c0e593e30aa 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -24,6 +24,7 @@
 #include <linux/rcupdate.h>
 #include <linux/fs.h>
 #include <linux/poll.h>
+#include <linux/zlib.h>
 #include <uapi/linux/major.h>
 #include <uapi/linux/magic.h>
 
@@ -68,6 +69,35 @@
  * support fns
  */
 
+struct rawdata_f_data {
+	struct aa_loaddata *loaddata;
+};
+
+#define RAWDATA_F_DATA_BUF(p) (char *)(p + 1)
+
+static void rawdata_f_data_free(struct rawdata_f_data *private)
+{
+	if (!private)
+		return;
+
+	aa_put_loaddata(private->loaddata);
+	kvfree(private);
+}
+
+static struct rawdata_f_data *rawdata_f_data_alloc(size_t size)
+{
+	struct rawdata_f_data *ret;
+
+	if (size > SIZE_MAX - sizeof(*ret))
+		return ERR_PTR(-EINVAL);
+
+	ret = kvzalloc(sizeof(*ret) + size, GFP_KERNEL);
+	if (!ret)
+		return ERR_PTR(-ENOMEM);
+
+	return ret;
+}
+
 /**
  * aa_mangle_name - mangle a profile name to std profile layout form
  * @name: profile name to mangle  (NOT NULL)
@@ -1275,36 +1305,117 @@ static int seq_rawdata_hash_show(struct seq_file *seq, void *v)
 	return 0;
 }
 
+static int seq_rawdata_compressed_size_show(struct seq_file *seq, void *v)
+{
+	struct aa_loaddata *data = seq->private;
+
+	seq_printf(seq, "%zu\n", data->compressed_size);
+
+	return 0;
+}
+
 SEQ_RAWDATA_FOPS(abi);
 SEQ_RAWDATA_FOPS(revision);
 SEQ_RAWDATA_FOPS(hash);
+SEQ_RAWDATA_FOPS(compressed_size);
+
+static int deflate_decompress(char *src, size_t slen, char *dst, size_t dlen)
+{
+	int error;
+	struct z_stream_s strm;
+
+	if (aa_g_rawdata_compression_level == 0) {
+		if (dlen < slen)
+			return -EINVAL;
+		memcpy(dst, src, slen);
+		return 0;
+	}
+
+	memset(&strm, 0, sizeof(strm));
+
+	strm.workspace = kvzalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
+	if (!strm.workspace)
+		return -ENOMEM;
+
+	strm.next_in = src;
+	strm.avail_in = slen;
+
+	error = zlib_inflateInit(&strm);
+	if (error != Z_OK) {
+		error = -ENOMEM;
+		goto fail_inflate_init;
+	}
+
+	strm.next_out = dst;
+	strm.avail_out = dlen;
+
+	error = zlib_inflate(&strm, Z_FINISH);
+	if (error != Z_STREAM_END)
+		error = -EINVAL;
+	else
+		error = 0;
+
+	zlib_inflateEnd(&strm);
+fail_inflate_init:
+	kvfree(strm.workspace);
+	return error;
+}
 
 static ssize_t rawdata_read(struct file *file, char __user *buf, size_t size,
 			    loff_t *ppos)
 {
-	struct aa_loaddata *rawdata = file->private_data;
+	struct rawdata_f_data *private = file->private_data;
 
-	return simple_read_from_buffer(buf, size, ppos, rawdata->data,
-				       rawdata->size);
+	return simple_read_from_buffer(buf, size, ppos,
+				       RAWDATA_F_DATA_BUF(private),
+				       private->loaddata->size);
 }
 
 static int rawdata_release(struct inode *inode, struct file *file)
 {
-	aa_put_loaddata(file->private_data);
+	rawdata_f_data_free(file->private_data);
 
 	return 0;
 }
 
 static int rawdata_open(struct inode *inode, struct file *file)
 {
+	int error;
+	struct aa_loaddata *loaddata;
+	struct rawdata_f_data *private;
+
 	if (!policy_view_capable(NULL))
 		return -EACCES;
-	file->private_data = __aa_get_loaddata(inode->i_private);
-	if (!file->private_data)
+
+	loaddata = __aa_get_loaddata(inode->i_private);
+	if (!loaddata)
 		/* lost race: this entry is being reaped */
 		return -ENOENT;
 
+	private = rawdata_f_data_alloc(loaddata->size);
+	if (IS_ERR(private)) {
+		error = PTR_ERR(private);
+		goto fail_private_alloc;
+	}
+
+	private->loaddata = loaddata;
+
+	error = deflate_decompress(loaddata->data, loaddata->compressed_size,
+				   RAWDATA_F_DATA_BUF(private),
+				   loaddata->size);
+	if (error)
+		goto fail_decompress;
+
+	file->private_data = private;
 	return 0;
+
+fail_decompress:
+	rawdata_f_data_free(private);
+	return error;
+
+fail_private_alloc:
+	aa_put_loaddata(loaddata);
+	return error;
 }
 
 static const struct file_operations rawdata_fops = {
@@ -1383,6 +1494,13 @@ int __aa_fs_create_rawdata(struct aa_ns *ns, struct aa_loaddata *rawdata)
 		rawdata->dents[AAFS_LOADDATA_HASH] = dent;
 	}
 
+	dent = aafs_create_file("compressed_size", S_IFREG | 0444, dir,
+				rawdata,
+				&seq_rawdata_compressed_size_fops);
+	if (IS_ERR(dent))
+		goto fail;
+	rawdata->dents[AAFS_LOADDATA_COMPRESSED_SIZE] = dent;
+
 	dent = aafs_create_file("raw_data", S_IFREG | 0444,
 				      dir, rawdata, &rawdata_fops);
 	if (IS_ERR(dent))
diff --git a/security/apparmor/include/apparmor.h b/security/apparmor/include/apparmor.h
index 73d63b58d875..fc04e422b8ba 100644
--- a/security/apparmor/include/apparmor.h
+++ b/security/apparmor/include/apparmor.h
@@ -40,6 +40,7 @@ extern enum audit_mode aa_g_audit;
 extern bool aa_g_audit_header;
 extern bool aa_g_debug;
 extern bool aa_g_hash_policy;
+extern int aa_g_rawdata_compression_level;
 extern bool aa_g_lock_policy;
 extern bool aa_g_logsyscall;
 extern bool aa_g_paranoid_load;
diff --git a/security/apparmor/include/policy_unpack.h b/security/apparmor/include/policy_unpack.h
index 8db4ab759e80..0739867bb87c 100644
--- a/security/apparmor/include/policy_unpack.h
+++ b/security/apparmor/include/policy_unpack.h
@@ -45,6 +45,7 @@ enum {
 	AAFS_LOADDATA_REVISION,
 	AAFS_LOADDATA_HASH,
 	AAFS_LOADDATA_DATA,
+	AAFS_LOADDATA_COMPRESSED_SIZE,
 	AAFS_LOADDATA_DIR,		/* must be last actual entry */
 	AAFS_LOADDATA_NDENTS		/* count of entries */
 };
@@ -65,11 +66,16 @@ struct aa_loaddata {
 	struct dentry *dents[AAFS_LOADDATA_NDENTS];
 	struct aa_ns *ns;
 	char *name;
-	size_t size;
+	size_t size;			/* the original size of the payload */
+	size_t compressed_size;		/* the compressed size of the payload */
 	long revision;			/* the ns policy revision this caused */
 	int abi;
 	unsigned char *hash;
 
+	/* Pointer to payload. If @compressed_size > 0, then this is the
+	 * compressed version of the payload, else it is the uncompressed
+	 * version (with the size indicated by @size).
+	 */
 	char *data;
 };
 
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index 49d664ddff44..88fcbe424ef0 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -25,6 +25,7 @@
 #include <linux/user_namespace.h>
 #include <linux/netfilter_ipv4.h>
 #include <linux/netfilter_ipv6.h>
+#include <linux/zlib.h>
 #include <net/sock.h>
 #include <uapi/linux/mount.h>
 
@@ -1266,6 +1267,16 @@ static const struct kernel_param_ops param_ops_aauint = {
 	.get = param_get_aauint
 };
 
+static int param_set_aacompressionlevel(const char *val,
+					const struct kernel_param *kp);
+static int param_get_aacompressionlevel(char *buffer,
+					const struct kernel_param *kp);
+#define param_check_aacompressionlevel param_check_int
+static const struct kernel_param_ops param_ops_aacompressionlevel = {
+	.set = param_set_aacompressionlevel,
+	.get = param_get_aacompressionlevel
+};
+
 static int param_set_aalockpolicy(const char *val, const struct kernel_param *kp);
 static int param_get_aalockpolicy(char *buffer, const struct kernel_param *kp);
 #define param_check_aalockpolicy param_check_bool
@@ -1296,6 +1307,11 @@ bool aa_g_hash_policy = IS_ENABLED(CONFIG_SECURITY_APPARMOR_HASH_DEFAULT);
 module_param_named(hash_policy, aa_g_hash_policy, aabool, S_IRUSR | S_IWUSR);
 #endif
 
+/* policy loaddata compression level */
+int aa_g_rawdata_compression_level = Z_DEFAULT_COMPRESSION;
+module_param_named(rawdata_compression_level, aa_g_rawdata_compression_level,
+		   aacompressionlevel, S_IRUSR);
+
 /* Debug mode */
 bool aa_g_debug = IS_ENABLED(CONFIG_SECURITY_APPARMOR_DEBUG_MESSAGES);
 module_param_named(debug, aa_g_debug, aabool, S_IRUSR | S_IWUSR);
@@ -1413,6 +1429,37 @@ static int param_get_aauint(char *buffer, const struct kernel_param *kp)
 	return param_get_uint(buffer, kp);
 }
 
+static int param_set_aacompressionlevel(const char *val,
+					const struct kernel_param *kp)
+{
+	int error;
+
+	if (!apparmor_enabled)
+		return -EINVAL;
+	if (apparmor_initialized)
+		return -EPERM;
+
+	error = param_set_int(val, kp);
+
+	aa_g_rawdata_compression_level = clamp(aa_g_rawdata_compression_level,
+					       Z_NO_COMPRESSION,
+					       Z_BEST_COMPRESSION);
+	pr_info("AppArmor: policy rawdata compression level set to %u\n",
+		aa_g_rawdata_compression_level);
+
+	return error;
+}
+
+static int param_get_aacompressionlevel(char *buffer,
+					const struct kernel_param *kp)
+{
+	if (!apparmor_enabled)
+		return -EINVAL;
+	if (apparmor_initialized && !policy_view_capable(NULL))
+		return -EPERM;
+	return param_get_int(buffer, kp);
+}
+
 static int param_get_audit(char *buffer, const struct kernel_param *kp)
 {
 	if (!apparmor_enabled)
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c
index df9c5890a878..71a3e6291478 100644
--- a/security/apparmor/policy.c
+++ b/security/apparmor/policy.c
@@ -861,7 +861,7 @@ static struct aa_profile *update_to_newest_parent(struct aa_profile *new)
 ssize_t aa_replace_profiles(struct aa_ns *policy_ns, struct aa_label *label,
 			    u32 mask, struct aa_loaddata *udata)
 {
-	const char *ns_name, *info = NULL;
+	const char *ns_name = NULL, *info = NULL;
 	struct aa_ns *ns = NULL;
 	struct aa_load_ent *ent, *tmp;
 	struct aa_loaddata *rawdata_ent;
@@ -1048,6 +1048,7 @@ ssize_t aa_replace_profiles(struct aa_ns *policy_ns, struct aa_label *label,
 out:
 	aa_put_ns(ns);
 	aa_put_loaddata(udata);
+	kfree(ns_name);
 
 	if (error)
 		return error;
diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index f6c2bcb2ab14..102359f34183 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -20,6 +20,7 @@
 #include <asm/unaligned.h>
 #include <linux/ctype.h>
 #include <linux/errno.h>
+#include <linux/zlib.h>
 
 #include "include/apparmor.h"
 #include "include/audit.h"
@@ -143,9 +144,11 @@ bool aa_rawdata_eq(struct aa_loaddata *l, struct aa_loaddata *r)
 {
 	if (l->size != r->size)
 		return false;
+	if (l->compressed_size != r->compressed_size)
+		return false;
 	if (aa_g_hash_policy && memcmp(l->hash, r->hash, aa_hash_size()) != 0)
 		return false;
-	return memcmp(l->data, r->data, r->size) == 0;
+	return memcmp(l->data, r->data, r->compressed_size ?: r->size) == 0;
 }
 
 /*
@@ -941,11 +944,14 @@ static int verify_header(struct aa_ext *e, int required, const char **ns)
 				    e, error);
 			return error;
 		}
-		if (*ns && strcmp(*ns, name))
+		if (*ns && strcmp(*ns, name)) {
 			audit_iface(NULL, NULL, NULL, "invalid ns change", e,
 				    error);
-		else if (!*ns)
-			*ns = name;
+		} else if (!*ns) {
+			*ns = kstrdup(name, GFP_KERNEL);
+			if (!*ns)
+				return -ENOMEM;
+		}
 	}
 
 	return 0;
@@ -1012,6 +1018,101 @@ struct aa_load_ent *aa_load_ent_alloc(void)
 	return ent;
 }
 
+static int deflate_compress(const char *src, size_t slen, char **dst,
+			    size_t *dlen)
+{
+	int error;
+	struct z_stream_s strm;
+	void *stgbuf, *dstbuf;
+	size_t stglen = deflateBound(slen);
+
+	memset(&strm, 0, sizeof(strm));
+
+	if (stglen < slen)
+		return -EFBIG;
+
+	strm.workspace = kvzalloc(zlib_deflate_workspacesize(MAX_WBITS,
+							     MAX_MEM_LEVEL),
+				  GFP_KERNEL);
+	if (!strm.workspace)
+		return -ENOMEM;
+
+	error = zlib_deflateInit(&strm, aa_g_rawdata_compression_level);
+	if (error != Z_OK) {
+		error = -ENOMEM;
+		goto fail_deflate_init;
+	}
+
+	stgbuf = kvzalloc(stglen, GFP_KERNEL);
+	if (!stgbuf) {
+		error = -ENOMEM;
+		goto fail_stg_alloc;
+	}
+
+	strm.next_in = src;
+	strm.avail_in = slen;
+	strm.next_out = stgbuf;
+	strm.avail_out = stglen;
+
+	error = zlib_deflate(&strm, Z_FINISH);
+	if (error != Z_STREAM_END) {
+		error = -EINVAL;
+		goto fail_deflate;
+	}
+	error = 0;
+
+	if (is_vmalloc_addr(stgbuf)) {
+		dstbuf = kvzalloc(strm.total_out, GFP_KERNEL);
+		if (dstbuf) {
+			memcpy(dstbuf, stgbuf, strm.total_out);
+			kvfree(stgbuf);
+		}
+	} else
+		/* If the staging buffer was kmalloc'd, then using krealloc is
+		 * probably going to be faster. The destination buffer will
+		 * always be smaller, so it's just shrunk, avoiding a memcpy */
+		dstbuf = krealloc(stgbuf, strm.total_out, GFP_KERNEL);
+
+	if (!dstbuf) {
+		error = -ENOMEM;
+		goto fail_deflate;
+	}
+
+	*dst = dstbuf;
+	*dlen = strm.total_out;
+
+fail_stg_alloc:
+	zlib_deflateEnd(&strm);
+fail_deflate_init:
+	kvfree(strm.workspace);
+	return error;
+
+fail_deflate:
+	kvfree(stgbuf);
+	goto fail_stg_alloc;
+}
+
+static int compress_loaddata(struct aa_loaddata *data)
+{
+
+	AA_BUG(data->compressed_size > 0);
+
+	/* Shortcut the no compression case, else we increase the amount of
+	 * storage required by a small amount */
+	if (aa_g_rawdata_compression_level != 0) {
+		void *udata = data->data;
+		int error = deflate_compress(udata, data->size, &data->data,
+					     &data->compressed_size);
+		if (error)
+			return error;
+
+		kvfree(udata);
+	} else
+		data->compressed_size = data->size;
+
+	return 0;
+}
+
 /**
  * aa_unpack - unpack packed binary profile(s) data loaded from user space
  * @udata: user data copied to kmem  (NOT NULL)
@@ -1080,6 +1181,9 @@ int aa_unpack(struct aa_loaddata *udata, struct list_head *lh,
 			goto fail;
 		}
 	}
+	error = compress_loaddata(udata);
+	if (error)
+		goto fail;
 	return 0;
 
 fail_profile:
diff --git a/security/keys/trusted.c b/security/keys/trusted.c
index bcc9c6ead7fd..ecec672d3a77 100644
--- a/security/keys/trusted.c
+++ b/security/keys/trusted.c
@@ -125,7 +125,7 @@ static int TSS_rawhmac(unsigned char *digest, const unsigned char *key,
  */
 int TSS_authhmac(unsigned char *digest, const unsigned char *key,
 			unsigned int keylen, unsigned char *h1,
-			unsigned char *h2, unsigned char h3, ...)
+			unsigned char *h2, unsigned int h3, ...)
 {
 	unsigned char paramdigest[SHA1_DIGEST_SIZE];
 	struct sdesc *sdesc;
@@ -141,7 +141,7 @@ int TSS_authhmac(unsigned char *digest, const unsigned char *key,
 		return PTR_ERR(sdesc);
 	}
 
-	c = h3;
+	c = !!h3;
 	ret = crypto_shash_init(&sdesc->shash);
 	if (ret < 0)
 		goto out;
diff --git a/sound/firewire/motu/motu.c b/sound/firewire/motu/motu.c
index 220e61926ea4..513291ba0ab0 100644
--- a/sound/firewire/motu/motu.c
+++ b/sound/firewire/motu/motu.c
@@ -36,7 +36,7 @@ static void name_card(struct snd_motu *motu)
 	fw_csr_iterator_init(&it, motu->unit->directory);
 	while (fw_csr_iterator_next(&it, &key, &val)) {
 		switch (key) {
-		case CSR_VERSION:
+		case CSR_MODEL:
 			version = val;
 			break;
 		}
@@ -46,7 +46,7 @@ static void name_card(struct snd_motu *motu)
 	strcpy(motu->card->shortname, motu->spec->name);
 	strcpy(motu->card->mixername, motu->spec->name);
 	snprintf(motu->card->longname, sizeof(motu->card->longname),
-		 "MOTU %s (version:%d), GUID %08x%08x at %s, S%d",
+		 "MOTU %s (version:%06x), GUID %08x%08x at %s, S%d",
 		 motu->spec->name, version,
 		 fw_dev->config_rom[3], fw_dev->config_rom[4],
 		 dev_name(&motu->unit->device), 100 << fw_dev->max_speed);
@@ -237,20 +237,20 @@ static const struct snd_motu_spec motu_audio_express = {
 #define SND_MOTU_DEV_ENTRY(model, data)			\
 {							\
 	.match_flags	= IEEE1394_MATCH_VENDOR_ID |	\
-			  IEEE1394_MATCH_MODEL_ID |	\
-			  IEEE1394_MATCH_SPECIFIER_ID,	\
+			  IEEE1394_MATCH_SPECIFIER_ID |	\
+			  IEEE1394_MATCH_VERSION,	\
 	.vendor_id	= OUI_MOTU,			\
-	.model_id	= model,			\
 	.specifier_id	= OUI_MOTU,			\
+	.version	= model,			\
 	.driver_data	= (kernel_ulong_t)data,		\
 }
 
 static const struct ieee1394_device_id motu_id_table[] = {
-	SND_MOTU_DEV_ENTRY(0x101800, &motu_828mk2),
-	SND_MOTU_DEV_ENTRY(0x107800, &snd_motu_spec_traveler),
-	SND_MOTU_DEV_ENTRY(0x106800, &motu_828mk3),	/* FireWire only. */
-	SND_MOTU_DEV_ENTRY(0x100800, &motu_828mk3),	/* Hybrid. */
-	SND_MOTU_DEV_ENTRY(0x104800, &motu_audio_express),
+	SND_MOTU_DEV_ENTRY(0x000003, &motu_828mk2),
+	SND_MOTU_DEV_ENTRY(0x000009, &snd_motu_spec_traveler),
+	SND_MOTU_DEV_ENTRY(0x000015, &motu_828mk3),	/* FireWire only. */
+	SND_MOTU_DEV_ENTRY(0x000035, &motu_828mk3),	/* Hybrid. */
+	SND_MOTU_DEV_ENTRY(0x000033, &motu_audio_express),
 	{ }
 };
 MODULE_DEVICE_TABLE(ieee1394, motu_id_table);
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
index aa2a83eb81a9..dc27a480c2d9 100644
--- a/sound/isa/sb/sb8.c
+++ b/sound/isa/sb/sb8.c
@@ -111,6 +111,10 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)
 
 	/* block the 0x388 port to avoid PnP conflicts */
 	acard->fm_res = request_region(0x388, 4, "SoundBlaster FM");
+	if (!acard->fm_res) {
+		err = -EBUSY;
+		goto _err;
+	}
 
 	if (port[dev] != SNDRV_AUTO_PORT) {
 		if ((err = snd_sbdsp_create(card, port[dev], irq[dev],
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index ea876b0b02b9..dc0084dc8550 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -1952,6 +1952,11 @@ static int snd_echo_create(struct snd_card *card,
 	}
 	chip->dsp_registers = (volatile u32 __iomem *)
 		ioremap_nocache(chip->dsp_registers_phys, sz);
+	if (!chip->dsp_registers) {
+		dev_err(chip->card->dev, "ioremap failed\n");
+		snd_echo_free(chip);
+		return -ENOMEM;
+	}
 
 	if (request_irq(pci->irq, snd_echo_interrupt, IRQF_SHARED,
 			KBUILD_MODNAME, chip)) {
diff --git a/sound/soc/codecs/ab8500-codec.c b/sound/soc/codecs/ab8500-codec.c
index 03bbbcd3b6c1..87616b126018 100644
--- a/sound/soc/codecs/ab8500-codec.c
+++ b/sound/soc/codecs/ab8500-codec.c
@@ -2129,6 +2129,7 @@ static int ab8500_codec_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 		dev_err(dai->component->dev,
 			"%s: ERROR: The device is either a master or a slave.\n",
 			__func__);
+		/* fall through */
 	default:
 		dev_err(dai->component->dev,
 			"%s: ERROR: Unsupporter master mask 0x%x\n",
diff --git a/sound/soc/codecs/hdac_hda.c b/sound/soc/codecs/hdac_hda.c
index ffecdaaa8cf2..f889d94c8e3c 100644
--- a/sound/soc/codecs/hdac_hda.c
+++ b/sound/soc/codecs/hdac_hda.c
@@ -38,6 +38,9 @@ static void hdac_hda_dai_close(struct snd_pcm_substream *substream,
 			       struct snd_soc_dai *dai);
 static int hdac_hda_dai_prepare(struct snd_pcm_substream *substream,
 				struct snd_soc_dai *dai);
+static int hdac_hda_dai_hw_params(struct snd_pcm_substream *substream,
+				  struct snd_pcm_hw_params *params,
+				  struct snd_soc_dai *dai);
 static int hdac_hda_dai_hw_free(struct snd_pcm_substream *substream,
 				struct snd_soc_dai *dai);
 static int hdac_hda_dai_set_tdm_slot(struct snd_soc_dai *dai,
@@ -50,6 +53,7 @@ static const struct snd_soc_dai_ops hdac_hda_dai_ops = {
 	.startup = hdac_hda_dai_open,
 	.shutdown = hdac_hda_dai_close,
 	.prepare = hdac_hda_dai_prepare,
+	.hw_params = hdac_hda_dai_hw_params,
 	.hw_free = hdac_hda_dai_hw_free,
 	.set_tdm_slot = hdac_hda_dai_set_tdm_slot,
 };
@@ -139,6 +143,39 @@ static int hdac_hda_dai_set_tdm_slot(struct snd_soc_dai *dai,
 	return 0;
 }
 
+static int hdac_hda_dai_hw_params(struct snd_pcm_substream *substream,
+				  struct snd_pcm_hw_params *params,
+				  struct snd_soc_dai *dai)
+{
+	struct snd_soc_component *component = dai->component;
+	struct hdac_hda_priv *hda_pvt;
+	unsigned int format_val;
+	unsigned int maxbps;
+
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		maxbps = dai->driver->playback.sig_bits;
+	else
+		maxbps = dai->driver->capture.sig_bits;
+
+	hda_pvt = snd_soc_component_get_drvdata(component);
+	format_val = snd_hdac_calc_stream_format(params_rate(params),
+						 params_channels(params),
+						 params_format(params),
+						 maxbps,
+						 0);
+	if (!format_val) {
+		dev_err(dai->dev,
+			"invalid format_val, rate=%d, ch=%d, format=%d, maxbps=%d\n",
+			params_rate(params), params_channels(params),
+			params_format(params), maxbps);
+
+		return -EINVAL;
+	}
+
+	hda_pvt->pcm[dai->id].format_val[substream->stream] = format_val;
+	return 0;
+}
+
 static int hdac_hda_dai_hw_free(struct snd_pcm_substream *substream,
 				struct snd_soc_dai *dai)
 {
@@ -162,10 +199,9 @@ static int hdac_hda_dai_prepare(struct snd_pcm_substream *substream,
 				struct snd_soc_dai *dai)
 {
 	struct snd_soc_component *component = dai->component;
+	struct hda_pcm_stream *hda_stream;
 	struct hdac_hda_priv *hda_pvt;
-	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct hdac_device *hdev;
-	struct hda_pcm_stream *hda_stream;
 	unsigned int format_val;
 	struct hda_pcm *pcm;
 	unsigned int stream;
@@ -179,19 +215,8 @@ static int hdac_hda_dai_prepare(struct snd_pcm_substream *substream,
 
 	hda_stream = &pcm->stream[substream->stream];
 
-	format_val = snd_hdac_calc_stream_format(runtime->rate,
-						 runtime->channels,
-						 runtime->format,
-						 hda_stream->maxbps,
-						 0);
-	if (!format_val) {
-		dev_err(&hdev->dev,
-			"invalid format_val, rate=%d, ch=%d, format=%d\n",
-			runtime->rate, runtime->channels, runtime->format);
-		return -EINVAL;
-	}
-
 	stream = hda_pvt->pcm[dai->id].stream_tag[substream->stream];
+	format_val = hda_pvt->pcm[dai->id].format_val[substream->stream];
 
 	ret = snd_hda_codec_prepare(&hda_pvt->codec, hda_stream,
 				    stream, format_val, substream);
diff --git a/sound/soc/codecs/hdac_hda.h b/sound/soc/codecs/hdac_hda.h
index e444ef593360..6b1bd4f428e7 100644
--- a/sound/soc/codecs/hdac_hda.h
+++ b/sound/soc/codecs/hdac_hda.h
@@ -8,6 +8,7 @@
 
 struct hdac_hda_pcm {
 	int stream_tag[2];
+	unsigned int format_val[2];
 };
 
 struct hdac_hda_priv {
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index e5b6769b9797..35df73e42cbc 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -484,9 +484,6 @@ static int hdmi_codec_hw_params(struct snd_pcm_substream *substream,
 		params_width(params), params_rate(params),
 		params_channels(params));
 
-	if (params_width(params) > 24)
-		params->msbits = 24;
-
 	ret = snd_pcm_create_iec958_consumer_hw_params(params, hp.iec.status,
 						       sizeof(hp.iec.status));
 	if (ret < 0) {
@@ -529,73 +526,71 @@ static int hdmi_codec_set_fmt(struct snd_soc_dai *dai,
 {
 	struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai);
 	struct hdmi_codec_daifmt cf = { 0 };
-	int ret = 0;
 
 	dev_dbg(dai->dev, "%s()\n", __func__);
 
-	if (dai->id == DAI_ID_SPDIF) {
-		cf.fmt = HDMI_SPDIF;
-	} else {
-		switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
-		case SND_SOC_DAIFMT_CBM_CFM:
-			cf.bit_clk_master = 1;
-			cf.frame_clk_master = 1;
-			break;
-		case SND_SOC_DAIFMT_CBS_CFM:
-			cf.frame_clk_master = 1;
-			break;
-		case SND_SOC_DAIFMT_CBM_CFS:
-			cf.bit_clk_master = 1;
-			break;
-		case SND_SOC_DAIFMT_CBS_CFS:
-			break;
-		default:
-			return -EINVAL;
-		}
+	if (dai->id == DAI_ID_SPDIF)
+		return 0;
+
+	switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
+	case SND_SOC_DAIFMT_CBM_CFM:
+		cf.bit_clk_master = 1;
+		cf.frame_clk_master = 1;
+		break;
+	case SND_SOC_DAIFMT_CBS_CFM:
+		cf.frame_clk_master = 1;
+		break;
+	case SND_SOC_DAIFMT_CBM_CFS:
+		cf.bit_clk_master = 1;
+		break;
+	case SND_SOC_DAIFMT_CBS_CFS:
+		break;
+	default:
+		return -EINVAL;
+	}
 
-		switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
-		case SND_SOC_DAIFMT_NB_NF:
-			break;
-		case SND_SOC_DAIFMT_NB_IF:
-			cf.frame_clk_inv = 1;
-			break;
-		case SND_SOC_DAIFMT_IB_NF:
-			cf.bit_clk_inv = 1;
-			break;
-		case SND_SOC_DAIFMT_IB_IF:
-			cf.frame_clk_inv = 1;
-			cf.bit_clk_inv = 1;
-			break;
-		}
+	switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
+	case SND_SOC_DAIFMT_NB_NF:
+		break;
+	case SND_SOC_DAIFMT_NB_IF:
+		cf.frame_clk_inv = 1;
+		break;
+	case SND_SOC_DAIFMT_IB_NF:
+		cf.bit_clk_inv = 1;
+		break;
+	case SND_SOC_DAIFMT_IB_IF:
+		cf.frame_clk_inv = 1;
+		cf.bit_clk_inv = 1;
+		break;
+	}
 
-		switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
-		case SND_SOC_DAIFMT_I2S:
-			cf.fmt = HDMI_I2S;
-			break;
-		case SND_SOC_DAIFMT_DSP_A:
-			cf.fmt = HDMI_DSP_A;
-			break;
-		case SND_SOC_DAIFMT_DSP_B:
-			cf.fmt = HDMI_DSP_B;
-			break;
-		case SND_SOC_DAIFMT_RIGHT_J:
-			cf.fmt = HDMI_RIGHT_J;
-			break;
-		case SND_SOC_DAIFMT_LEFT_J:
-			cf.fmt = HDMI_LEFT_J;
-			break;
-		case SND_SOC_DAIFMT_AC97:
-			cf.fmt = HDMI_AC97;
-			break;
-		default:
-			dev_err(dai->dev, "Invalid DAI interface format\n");
-			return -EINVAL;
-		}
+	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+	case SND_SOC_DAIFMT_I2S:
+		cf.fmt = HDMI_I2S;
+		break;
+	case SND_SOC_DAIFMT_DSP_A:
+		cf.fmt = HDMI_DSP_A;
+		break;
+	case SND_SOC_DAIFMT_DSP_B:
+		cf.fmt = HDMI_DSP_B;
+		break;
+	case SND_SOC_DAIFMT_RIGHT_J:
+		cf.fmt = HDMI_RIGHT_J;
+		break;
+	case SND_SOC_DAIFMT_LEFT_J:
+		cf.fmt = HDMI_LEFT_J;
+		break;
+	case SND_SOC_DAIFMT_AC97:
+		cf.fmt = HDMI_AC97;
+		break;
+	default:
+		dev_err(dai->dev, "Invalid DAI interface format\n");
+		return -EINVAL;
 	}
 
 	hcp->daifmt[dai->id] = cf;
 
-	return ret;
+	return 0;
 }
 
 static int hdmi_codec_digital_mute(struct snd_soc_dai *dai, int mute)
@@ -792,8 +787,10 @@ static int hdmi_codec_probe(struct platform_device *pdev)
 		i++;
 	}
 
-	if (hcd->spdif)
+	if (hcd->spdif) {
 		hcp->daidrv[i] = hdmi_spdif_dai;
+		hcp->daifmt[DAI_ID_SPDIF].fmt = HDMI_SPDIF;
+	}
 
 	dev_set_drvdata(dev, hcp);
 
diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c
index bfd74b86c9d2..645aa0794123 100644
--- a/sound/soc/codecs/nau8810.c
+++ b/sound/soc/codecs/nau8810.c
@@ -411,9 +411,9 @@ static const struct snd_soc_dapm_widget nau8810_dapm_widgets[] = {
 	SND_SOC_DAPM_MIXER("Mono Mixer", NAU8810_REG_POWER3,
 		NAU8810_MOUTMX_EN_SFT, 0, &nau8810_mono_mixer_controls[0],
 		ARRAY_SIZE(nau8810_mono_mixer_controls)),
-	SND_SOC_DAPM_DAC("DAC", "HiFi Playback", NAU8810_REG_POWER3,
+	SND_SOC_DAPM_DAC("DAC", "Playback", NAU8810_REG_POWER3,
 		NAU8810_DAC_EN_SFT, 0),
-	SND_SOC_DAPM_ADC("ADC", "HiFi Capture", NAU8810_REG_POWER2,
+	SND_SOC_DAPM_ADC("ADC", "Capture", NAU8810_REG_POWER2,
 		NAU8810_ADC_EN_SFT, 0),
 	SND_SOC_DAPM_PGA("SpkN Out", NAU8810_REG_POWER3,
 		NAU8810_NSPK_EN_SFT, 0, NULL, 0),
diff --git a/sound/soc/codecs/nau8824.c b/sound/soc/codecs/nau8824.c
index 87ed3dc496dc..5ab05e75edea 100644
--- a/sound/soc/codecs/nau8824.c
+++ b/sound/soc/codecs/nau8824.c
@@ -681,8 +681,8 @@ static const struct snd_soc_dapm_widget nau8824_dapm_widgets[] = {
 	SND_SOC_DAPM_ADC("ADCR", NULL, NAU8824_REG_ANALOG_ADC_2,
 		NAU8824_ADCR_EN_SFT, 0),
 
-	SND_SOC_DAPM_AIF_OUT("AIFTX", "HiFi Capture", 0, SND_SOC_NOPM, 0, 0),
-	SND_SOC_DAPM_AIF_IN("AIFRX", "HiFi Playback", 0, SND_SOC_NOPM, 0, 0),
+	SND_SOC_DAPM_AIF_OUT("AIFTX", "Capture", 0, SND_SOC_NOPM, 0, 0),
+	SND_SOC_DAPM_AIF_IN("AIFRX", "Playback", 0, SND_SOC_NOPM, 0, 0),
 
 	SND_SOC_DAPM_DAC("DACL", NULL, NAU8824_REG_RDAC,
 		NAU8824_DACL_EN_SFT, 0),
@@ -831,6 +831,36 @@ static void nau8824_int_status_clear_all(struct regmap *regmap)
 	}
 }
 
+static void nau8824_dapm_disable_pin(struct nau8824 *nau8824, const char *pin)
+{
+	struct snd_soc_dapm_context *dapm = nau8824->dapm;
+	const char *prefix = dapm->component->name_prefix;
+	char prefixed_pin[80];
+
+	if (prefix) {
+		snprintf(prefixed_pin, sizeof(prefixed_pin), "%s %s",
+			 prefix, pin);
+		snd_soc_dapm_disable_pin(dapm, prefixed_pin);
+	} else {
+		snd_soc_dapm_disable_pin(dapm, pin);
+	}
+}
+
+static void nau8824_dapm_enable_pin(struct nau8824 *nau8824, const char *pin)
+{
+	struct snd_soc_dapm_context *dapm = nau8824->dapm;
+	const char *prefix = dapm->component->name_prefix;
+	char prefixed_pin[80];
+
+	if (prefix) {
+		snprintf(prefixed_pin, sizeof(prefixed_pin), "%s %s",
+			 prefix, pin);
+		snd_soc_dapm_force_enable_pin(dapm, prefixed_pin);
+	} else {
+		snd_soc_dapm_force_enable_pin(dapm, pin);
+	}
+}
+
 static void nau8824_eject_jack(struct nau8824 *nau8824)
 {
 	struct snd_soc_dapm_context *dapm = nau8824->dapm;
@@ -839,8 +869,8 @@ static void nau8824_eject_jack(struct nau8824 *nau8824)
 	/* Clear all interruption status */
 	nau8824_int_status_clear_all(regmap);
 
-	snd_soc_dapm_disable_pin(dapm, "SAR");
-	snd_soc_dapm_disable_pin(dapm, "MICBIAS");
+	nau8824_dapm_disable_pin(nau8824, "SAR");
+	nau8824_dapm_disable_pin(nau8824, "MICBIAS");
 	snd_soc_dapm_sync(dapm);
 
 	/* Enable the insertion interruption, disable the ejection
@@ -870,8 +900,8 @@ static void nau8824_jdet_work(struct work_struct *work)
 	struct regmap *regmap = nau8824->regmap;
 	int adc_value, event = 0, event_mask = 0;
 
-	snd_soc_dapm_force_enable_pin(dapm, "MICBIAS");
-	snd_soc_dapm_force_enable_pin(dapm, "SAR");
+	nau8824_dapm_enable_pin(nau8824, "MICBIAS");
+	nau8824_dapm_enable_pin(nau8824, "SAR");
 	snd_soc_dapm_sync(dapm);
 
 	msleep(100);
@@ -882,8 +912,8 @@ static void nau8824_jdet_work(struct work_struct *work)
 	if (adc_value < HEADSET_SARADC_THD) {
 		event |= SND_JACK_HEADPHONE;
 
-		snd_soc_dapm_disable_pin(dapm, "SAR");
-		snd_soc_dapm_disable_pin(dapm, "MICBIAS");
+		nau8824_dapm_disable_pin(nau8824, "SAR");
+		nau8824_dapm_disable_pin(nau8824, "MICBIAS");
 		snd_soc_dapm_sync(dapm);
 	} else {
 		event |= SND_JACK_HEADSET;
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index 283583d1db60..516d17cb2182 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -1609,7 +1609,6 @@ static int aic3x_probe(struct snd_soc_component *component)
 	struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component);
 	int ret, i;
 
-	INIT_LIST_HEAD(&aic3x->list);
 	aic3x->component = component;
 
 	for (i = 0; i < ARRAY_SIZE(aic3x->supplies); i++) {
@@ -1873,6 +1872,7 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
 	if (ret != 0)
 		goto err_gpio;
 
+	INIT_LIST_HEAD(&aic3x->list);
 	list_add(&aic3x->list, &reset_list);
 
 	return 0;
@@ -1889,6 +1889,8 @@ static int aic3x_i2c_remove(struct i2c_client *client)
 {
 	struct aic3x_priv *aic3x = i2c_get_clientdata(client);
 
+	list_del(&aic3x->list);
+
 	if (gpio_is_valid(aic3x->gpio_reset) &&
 	    !aic3x_is_shared_reset(aic3x)) {
 		gpio_set_value(aic3x->gpio_reset, 0);
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index 1ae83f4ccc36..56099db8f86d 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -181,6 +181,7 @@ int skl_pcm_link_dma_prepare(struct device *dev, struct skl_pipe_params *params)
 	struct hdac_stream *hstream;
 	struct hdac_ext_stream *stream;
 	struct hdac_ext_link *link;
+	unsigned char stream_tag;
 
 	hstream = snd_hdac_get_stream(bus, params->stream,
 					params->link_dma_id + 1);
@@ -199,10 +200,13 @@ int skl_pcm_link_dma_prepare(struct device *dev, struct skl_pipe_params *params)
 
 	snd_hdac_ext_link_stream_setup(stream, format_val);
 
-	list_for_each_entry(link, &bus->hlink_list, list) {
-		if (link->index == params->link_index)
-			snd_hdac_ext_link_set_stream_id(link,
-					hstream->stream_tag);
+	stream_tag = hstream->stream_tag;
+	if (stream->hstream.direction == SNDRV_PCM_STREAM_PLAYBACK) {
+		list_for_each_entry(link, &bus->hlink_list, list) {
+			if (link->index == params->link_index)
+				snd_hdac_ext_link_set_stream_id(link,
+								stream_tag);
+		}
 	}
 
 	stream->link_prepared = 1;
@@ -645,6 +649,7 @@ static int skl_link_hw_free(struct snd_pcm_substream *substream,
 	struct hdac_ext_stream *link_dev =
 				snd_soc_dai_get_dma_data(dai, substream);
 	struct hdac_ext_link *link;
+	unsigned char stream_tag;
 
 	dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name);
 
@@ -654,7 +659,11 @@ static int skl_link_hw_free(struct snd_pcm_substream *substream,
 	if (!link)
 		return -EINVAL;
 
-	snd_hdac_ext_link_clear_stream_id(link, hdac_stream(link_dev)->stream_tag);
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+		stream_tag = hdac_stream(link_dev)->stream_tag;
+		snd_hdac_ext_link_clear_stream_id(link, stream_tag);
+	}
+
 	snd_hdac_ext_stream_release(link_dev, HDAC_EXT_STREAM_TYPE_LINK);
 	return 0;
 }
diff --git a/sound/soc/mediatek/common/mtk-btcvsd.c b/sound/soc/mediatek/common/mtk-btcvsd.c
index 1b8bcdaf02d1..9a163d7064d1 100644
--- a/sound/soc/mediatek/common/mtk-btcvsd.c
+++ b/sound/soc/mediatek/common/mtk-btcvsd.c
@@ -49,6 +49,7 @@ enum bt_sco_state {
 	BT_SCO_STATE_IDLE,
 	BT_SCO_STATE_RUNNING,
 	BT_SCO_STATE_ENDING,
+	BT_SCO_STATE_LOOPBACK,
 };
 
 enum bt_sco_direct {
@@ -486,7 +487,8 @@ static irqreturn_t mtk_btcvsd_snd_irq_handler(int irq_id, void *dev)
 	if (bt->rx->state != BT_SCO_STATE_RUNNING &&
 	    bt->rx->state != BT_SCO_STATE_ENDING &&
 	    bt->tx->state != BT_SCO_STATE_RUNNING &&
-	    bt->tx->state != BT_SCO_STATE_ENDING) {
+	    bt->tx->state != BT_SCO_STATE_ENDING &&
+	    bt->tx->state != BT_SCO_STATE_LOOPBACK) {
 		dev_warn(bt->dev, "%s(), in idle state: rx->state: %d, tx->state: %d\n",
 			 __func__, bt->rx->state, bt->tx->state);
 		goto irq_handler_exit;
@@ -512,6 +514,42 @@ static irqreturn_t mtk_btcvsd_snd_irq_handler(int irq_id, void *dev)
 	buf_cnt_tx = btsco_packet_info[packet_type][2];
 	buf_cnt_rx = btsco_packet_info[packet_type][3];
 
+	if (bt->tx->state == BT_SCO_STATE_LOOPBACK) {
+		u8 *src, *dst;
+		unsigned long connsys_addr_rx, ap_addr_rx;
+		unsigned long connsys_addr_tx, ap_addr_tx;
+
+		connsys_addr_rx = *bt->bt_reg_pkt_r;
+		ap_addr_rx = (unsigned long)bt->bt_sram_bank2_base +
+			     (connsys_addr_rx & 0xFFFF);
+
+		connsys_addr_tx = *bt->bt_reg_pkt_w;
+		ap_addr_tx = (unsigned long)bt->bt_sram_bank2_base +
+			     (connsys_addr_tx & 0xFFFF);
+
+		if (connsys_addr_tx == 0xdeadfeed ||
+		    connsys_addr_rx == 0xdeadfeed) {
+			/* bt return 0xdeadfeed if read reg during bt sleep */
+			dev_warn(bt->dev, "%s(), connsys_addr_tx == 0xdeadfeed\n",
+				 __func__);
+			goto irq_handler_exit;
+		}
+
+		src = (u8 *)ap_addr_rx;
+		dst = (u8 *)ap_addr_tx;
+
+		mtk_btcvsd_snd_data_transfer(BT_SCO_DIRECT_BT2ARM, src,
+					     bt->tx->temp_packet_buf,
+					     packet_length,
+					     packet_num);
+		mtk_btcvsd_snd_data_transfer(BT_SCO_DIRECT_ARM2BT,
+					     bt->tx->temp_packet_buf, dst,
+					     packet_length,
+					     packet_num);
+		bt->rx->rw_cnt++;
+		bt->tx->rw_cnt++;
+	}
+
 	if (bt->rx->state == BT_SCO_STATE_RUNNING ||
 	    bt->rx->state == BT_SCO_STATE_ENDING) {
 		if (bt->rx->xrun) {
@@ -1067,6 +1105,33 @@ static int btcvsd_band_set(struct snd_kcontrol *kcontrol,
 	return 0;
 }
 
+static int btcvsd_loopback_get(struct snd_kcontrol *kcontrol,
+			       struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol);
+	struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt);
+	bool lpbk_en = bt->tx->state == BT_SCO_STATE_LOOPBACK;
+
+	ucontrol->value.integer.value[0] = lpbk_en;
+	return 0;
+}
+
+static int btcvsd_loopback_set(struct snd_kcontrol *kcontrol,
+			       struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol);
+	struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt);
+
+	if (ucontrol->value.integer.value[0]) {
+		mtk_btcvsd_snd_set_state(bt, bt->tx, BT_SCO_STATE_LOOPBACK);
+		mtk_btcvsd_snd_set_state(bt, bt->rx, BT_SCO_STATE_LOOPBACK);
+	} else {
+		mtk_btcvsd_snd_set_state(bt, bt->tx, BT_SCO_STATE_RUNNING);
+		mtk_btcvsd_snd_set_state(bt, bt->rx, BT_SCO_STATE_RUNNING);
+	}
+	return 0;
+}
+
 static int btcvsd_tx_mute_get(struct snd_kcontrol *kcontrol,
 			      struct snd_ctl_elem_value *ucontrol)
 {
@@ -1202,6 +1267,8 @@ static int btcvsd_tx_timestamp_get(struct snd_kcontrol *kcontrol,
 static const struct snd_kcontrol_new mtk_btcvsd_snd_controls[] = {
 	SOC_ENUM_EXT("BTCVSD Band", btcvsd_enum[0],
 		     btcvsd_band_get, btcvsd_band_set),
+	SOC_SINGLE_BOOL_EXT("BTCVSD Loopback Switch", 0,
+			    btcvsd_loopback_get, btcvsd_loopback_set),
 	SOC_SINGLE_BOOL_EXT("BTCVSD Tx Mute Switch", 0,
 			    btcvsd_tx_mute_get, btcvsd_tx_mute_set),
 	SOC_SINGLE_BOOL_EXT("BTCVSD Tx Irq Received Switch", 0,
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 4231001226f4..ab471d550d17 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -1130,11 +1130,11 @@ static const struct snd_soc_dapm_widget samsung_i2s_widgets[] = {
 };
 
 static const struct snd_soc_dapm_route samsung_i2s_dapm_routes[] = {
-	{ "Playback Mixer", NULL, "Primary" },
-	{ "Playback Mixer", NULL, "Secondary" },
+	{ "Playback Mixer", NULL, "Primary Playback" },
+	{ "Playback Mixer", NULL, "Secondary Playback" },
 
 	{ "Mixer DAI TX", NULL, "Playback Mixer" },
-	{ "Playback Mixer", NULL, "Mixer DAI RX" },
+	{ "Primary Capture", NULL, "Mixer DAI RX" },
 };
 
 static const struct snd_soc_component_driver samsung_i2s_component = {
@@ -1155,7 +1155,8 @@ static int i2s_alloc_dais(struct samsung_i2s_priv *priv,
 			  int num_dais)
 {
 	static const char *dai_names[] = { "samsung-i2s", "samsung-i2s-sec" };
-	static const char *stream_names[] = { "Primary", "Secondary" };
+	static const char *stream_names[] = { "Primary Playback",
+					      "Secondary Playback" };
 	struct snd_soc_dai_driver *dai_drv;
 	struct i2s_dai *dai;
 	int i;
@@ -1201,6 +1202,7 @@ static int i2s_alloc_dais(struct samsung_i2s_priv *priv,
 	dai_drv->capture.channels_max = 2;
 	dai_drv->capture.rates = i2s_dai_data->pcm_rates;
 	dai_drv->capture.formats = SAMSUNG_I2S_FMTS;
+	dai_drv->capture.stream_name = "Primary Capture";
 
 	return 0;
 }
diff --git a/sound/soc/samsung/odroid.c b/sound/soc/samsung/odroid.c
index 694512f980fd..1dc54c4206f0 100644
--- a/sound/soc/samsung/odroid.c
+++ b/sound/soc/samsung/odroid.c
@@ -91,11 +91,11 @@ static int odroid_card_be_hw_params(struct snd_pcm_substream *substream,
 		return ret;
 
 	/*
-	 *  We add 1 to the rclk_freq value in order to avoid too low clock
+	 *  We add 2 to the rclk_freq value in order to avoid too low clock
 	 *  frequency values due to the EPLL output frequency not being exact
 	 *  multiple of the audio sampling rate.
 	 */
-	rclk_freq = params_rate(params) * rfs + 1;
+	rclk_freq = params_rate(params) * rfs + 2;
 
 	ret = clk_set_rate(priv->sclk_i2s, rclk_freq);
 	if (ret < 0)
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 022996d2db13..4fe83e611c01 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -110,6 +110,8 @@ static const struct of_device_id rsnd_of_match[] = {
 	{ .compatible = "renesas,rcar_sound-gen1", .data = (void *)RSND_GEN1 },
 	{ .compatible = "renesas,rcar_sound-gen2", .data = (void *)RSND_GEN2 },
 	{ .compatible = "renesas,rcar_sound-gen3", .data = (void *)RSND_GEN3 },
+	/* Special Handling */
+	{ .compatible = "renesas,rcar_sound-r8a77990", .data = (void *)(RSND_GEN3 | RSND_SOC_E) },
 	{},
 };
 MODULE_DEVICE_TABLE(of, rsnd_of_match);
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index 90625c57847b..0e6ef4e18400 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -607,6 +607,8 @@ struct rsnd_priv {
 #define RSND_GEN1	(1 << 0)
 #define RSND_GEN2	(2 << 0)
 #define RSND_GEN3	(3 << 0)
+#define RSND_SOC_MASK	(0xFF << 4)
+#define RSND_SOC_E	(1 << 4) /* E1/E2/E3 */
 
 	/*
 	 * below value will be filled on rsnd_gen_probe()
@@ -679,6 +681,9 @@ struct rsnd_priv {
 #define rsnd_is_gen1(priv)	(((priv)->flags & RSND_GEN_MASK) == RSND_GEN1)
 #define rsnd_is_gen2(priv)	(((priv)->flags & RSND_GEN_MASK) == RSND_GEN2)
 #define rsnd_is_gen3(priv)	(((priv)->flags & RSND_GEN_MASK) == RSND_GEN3)
+#define rsnd_is_e3(priv)	(((priv)->flags & \
+					(RSND_GEN_MASK | RSND_SOC_MASK)) == \
+					(RSND_GEN3 | RSND_SOC_E))
 
 #define rsnd_flags_has(p, f) ((p)->flags & (f))
 #define rsnd_flags_set(p, f) ((p)->flags |= (f))
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
index db81e066b92e..585ffba0244b 100644
--- a/sound/soc/sh/rcar/src.c
+++ b/sound/soc/sh/rcar/src.c
@@ -14,7 +14,6 @@
  */
 
 #include "rsnd.h"
-#include <linux/sys_soc.h>
 
 #define SRC_NAME "src"
 
@@ -135,7 +134,7 @@ unsigned int rsnd_src_get_rate(struct rsnd_priv *priv,
 	return rate;
 }
 
-const static u32 bsdsr_table_pattern1[] = {
+static const u32 bsdsr_table_pattern1[] = {
 	0x01800000, /* 6 - 1/6 */
 	0x01000000, /* 6 - 1/4 */
 	0x00c00000, /* 6 - 1/3 */
@@ -144,7 +143,7 @@ const static u32 bsdsr_table_pattern1[] = {
 	0x00400000, /* 6 - 1   */
 };
 
-const static u32 bsdsr_table_pattern2[] = {
+static const u32 bsdsr_table_pattern2[] = {
 	0x02400000, /* 6 - 1/6 */
 	0x01800000, /* 6 - 1/4 */
 	0x01200000, /* 6 - 1/3 */
@@ -153,7 +152,7 @@ const static u32 bsdsr_table_pattern2[] = {
 	0x00600000, /* 6 - 1   */
 };
 
-const static u32 bsisr_table[] = {
+static const u32 bsisr_table[] = {
 	0x00100060, /* 6 - 1/6 */
 	0x00100040, /* 6 - 1/4 */
 	0x00100030, /* 6 - 1/3 */
@@ -162,7 +161,7 @@ const static u32 bsisr_table[] = {
 	0x00100020, /* 6 - 1   */
 };
 
-const static u32 chan288888[] = {
+static const u32 chan288888[] = {
 	0x00000006, /* 1 to 2 */
 	0x000001fe, /* 1 to 8 */
 	0x000001fe, /* 1 to 8 */
@@ -171,7 +170,7 @@ const static u32 chan288888[] = {
 	0x000001fe, /* 1 to 8 */
 };
 
-const static u32 chan244888[] = {
+static const u32 chan244888[] = {
 	0x00000006, /* 1 to 2 */
 	0x0000001e, /* 1 to 4 */
 	0x0000001e, /* 1 to 4 */
@@ -180,7 +179,7 @@ const static u32 chan244888[] = {
 	0x000001fe, /* 1 to 8 */
 };
 
-const static u32 chan222222[] = {
+static const u32 chan222222[] = {
 	0x00000006, /* 1 to 2 */
 	0x00000006, /* 1 to 2 */
 	0x00000006, /* 1 to 2 */
@@ -189,18 +188,12 @@ const static u32 chan222222[] = {
 	0x00000006, /* 1 to 2 */
 };
 
-static const struct soc_device_attribute ov_soc[] = {
-	{ .soc_id = "r8a77990" }, /* E3 */
-	{ /* sentinel */ }
-};
-
 static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io,
 				      struct rsnd_mod *mod)
 {
 	struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
 	struct device *dev = rsnd_priv_to_dev(priv);
 	struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
-	const struct soc_device_attribute *soc = soc_device_match(ov_soc);
 	int is_play = rsnd_io_is_play(io);
 	int use_src = 0;
 	u32 fin, fout;
@@ -307,7 +300,7 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io,
 	/*
 	 * E3 need to overwrite
 	 */
-	if (soc)
+	if (rsnd_is_e3(priv))
 		switch (rsnd_mod_id(mod)) {
 		case 0:
 		case 4:
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 93d316d5bf8e..d88757659729 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2797,6 +2797,7 @@ int snd_soc_register_card(struct snd_soc_card *card)
 
 		ret = soc_init_dai_link(card, link);
 		if (ret) {
+			soc_cleanup_platform(card);
 			dev_err(card->dev, "ASoC: failed to init link %s\n",
 				link->name);
 			mutex_unlock(&client_mutex);
@@ -2819,6 +2820,7 @@ int snd_soc_register_card(struct snd_soc_card *card)
 	card->instantiated = 0;
 	mutex_init(&card->mutex);
 	mutex_init(&card->dapm_mutex);
+	spin_lock_init(&card->dpcm_lock);
 
 	return snd_soc_bind_card(card);
 }
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 0d5ec68a1e50..7fe5321000e8 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -954,10 +954,13 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
 		codec_params = *params;
 
 		/* fixup params based on TDM slot masks */
-		if (codec_dai->tx_mask)
+		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
+		    codec_dai->tx_mask)
 			soc_pcm_codec_params_fixup(&codec_params,
 						   codec_dai->tx_mask);
-		if (codec_dai->rx_mask)
+
+		if (substream->stream == SNDRV_PCM_STREAM_CAPTURE &&
+		    codec_dai->rx_mask)
 			soc_pcm_codec_params_fixup(&codec_params,
 						   codec_dai->rx_mask);
 
@@ -1213,6 +1216,7 @@ static int dpcm_be_connect(struct snd_soc_pcm_runtime *fe,
 		struct snd_soc_pcm_runtime *be, int stream)
 {
 	struct snd_soc_dpcm *dpcm;
+	unsigned long flags;
 
 	/* only add new dpcms */
 	for_each_dpcm_be(fe, stream, dpcm) {
@@ -1228,8 +1232,10 @@ static int dpcm_be_connect(struct snd_soc_pcm_runtime *fe,
 	dpcm->fe = fe;
 	be->dpcm[stream].runtime = fe->dpcm[stream].runtime;
 	dpcm->state = SND_SOC_DPCM_LINK_STATE_NEW;
+	spin_lock_irqsave(&fe->card->dpcm_lock, flags);
 	list_add(&dpcm->list_be, &fe->dpcm[stream].be_clients);
 	list_add(&dpcm->list_fe, &be->dpcm[stream].fe_clients);
+	spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);
 
 	dev_dbg(fe->dev, "connected new DPCM %s path %s %s %s\n",
 			stream ? "capture" : "playback",  fe->dai_link->name,
@@ -1275,6 +1281,7 @@ static void dpcm_be_reparent(struct snd_soc_pcm_runtime *fe,
 void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream)
 {
 	struct snd_soc_dpcm *dpcm, *d;
+	unsigned long flags;
 
 	for_each_dpcm_be_safe(fe, stream, dpcm, d) {
 		dev_dbg(fe->dev, "ASoC: BE %s disconnect check for %s\n",
@@ -1294,8 +1301,10 @@ void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream)
 #ifdef CONFIG_DEBUG_FS
 		debugfs_remove(dpcm->debugfs_state);
 #endif
+		spin_lock_irqsave(&fe->card->dpcm_lock, flags);
 		list_del(&dpcm->list_be);
 		list_del(&dpcm->list_fe);
+		spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);
 		kfree(dpcm);
 	}
 }
@@ -1547,10 +1556,13 @@ int dpcm_process_paths(struct snd_soc_pcm_runtime *fe,
 void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream)
 {
 	struct snd_soc_dpcm *dpcm;
+	unsigned long flags;
 
+	spin_lock_irqsave(&fe->card->dpcm_lock, flags);
 	for_each_dpcm_be(fe, stream, dpcm)
 		dpcm->be->dpcm[stream].runtime_update =
 						SND_SOC_DPCM_UPDATE_NO;
+	spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);
 }
 
 static void dpcm_be_dai_startup_unwind(struct snd_soc_pcm_runtime *fe,
@@ -2571,6 +2583,7 @@ static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream)
 	struct snd_soc_dpcm *dpcm;
 	enum snd_soc_dpcm_trigger trigger = fe->dai_link->trigger[stream];
 	int ret;
+	unsigned long flags;
 
 	dev_dbg(fe->dev, "ASoC: runtime %s open on FE %s\n",
 			stream ? "capture" : "playback", fe->dai_link->name);
@@ -2640,11 +2653,13 @@ static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream)
 	dpcm_be_dai_shutdown(fe, stream);
 disconnect:
 	/* disconnect any non started BEs */
+	spin_lock_irqsave(&fe->card->dpcm_lock, flags);
 	for_each_dpcm_be(fe, stream, dpcm) {
 		struct snd_soc_pcm_runtime *be = dpcm->be;
 		if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START)
 				dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE;
 	}
+	spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);
 
 	return ret;
 }
@@ -3221,7 +3236,10 @@ int snd_soc_dpcm_can_be_free_stop(struct snd_soc_pcm_runtime *fe,
 {
 	struct snd_soc_dpcm *dpcm;
 	int state;
+	int ret = 1;
+	unsigned long flags;
 
+	spin_lock_irqsave(&fe->card->dpcm_lock, flags);
 	for_each_dpcm_fe(be, stream, dpcm) {
 
 		if (dpcm->fe == fe)
@@ -3230,12 +3248,15 @@ int snd_soc_dpcm_can_be_free_stop(struct snd_soc_pcm_runtime *fe,
 		state = dpcm->fe->dpcm[stream].state;
 		if (state == SND_SOC_DPCM_STATE_START ||
 			state == SND_SOC_DPCM_STATE_PAUSED ||
-			state == SND_SOC_DPCM_STATE_SUSPEND)
-			return 0;
+			state == SND_SOC_DPCM_STATE_SUSPEND) {
+			ret = 0;
+			break;
+		}
 	}
+	spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);
 
 	/* it's safe to free/stop this BE DAI */
-	return 1;
+	return ret;
 }
 EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_free_stop);
 
@@ -3248,7 +3269,10 @@ int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe,
 {
 	struct snd_soc_dpcm *dpcm;
 	int state;
+	int ret = 1;
+	unsigned long flags;
 
+	spin_lock_irqsave(&fe->card->dpcm_lock, flags);
 	for_each_dpcm_fe(be, stream, dpcm) {
 
 		if (dpcm->fe == fe)
@@ -3258,12 +3282,15 @@ int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe,
 		if (state == SND_SOC_DPCM_STATE_START ||
 			state == SND_SOC_DPCM_STATE_PAUSED ||
 			state == SND_SOC_DPCM_STATE_SUSPEND ||
-			state == SND_SOC_DPCM_STATE_PREPARE)
-			return 0;
+			state == SND_SOC_DPCM_STATE_PREPARE) {
+			ret = 0;
+			break;
+		}
 	}
+	spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);
 
 	/* it's safe to change hw_params */
-	return 1;
+	return ret;
 }
 EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_params);
 
@@ -3302,6 +3329,7 @@ static ssize_t dpcm_show_state(struct snd_soc_pcm_runtime *fe,
 	struct snd_pcm_hw_params *params = &fe->dpcm[stream].hw_params;
 	struct snd_soc_dpcm *dpcm;
 	ssize_t offset = 0;
+	unsigned long flags;
 
 	/* FE state */
 	offset += snprintf(buf + offset, size - offset,
@@ -3329,6 +3357,7 @@ static ssize_t dpcm_show_state(struct snd_soc_pcm_runtime *fe,
 		goto out;
 	}
 
+	spin_lock_irqsave(&fe->card->dpcm_lock, flags);
 	for_each_dpcm_be(fe, stream, dpcm) {
 		struct snd_soc_pcm_runtime *be = dpcm->be;
 		params = &dpcm->hw_params;
@@ -3349,7 +3378,7 @@ static ssize_t dpcm_show_state(struct snd_soc_pcm_runtime *fe,
 				params_channels(params),
 				params_rate(params));
 	}
-
+	spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);
 out:
 	return offset;
 }
diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c
index 47c334de6b09..8968458eec62 100644
--- a/sound/soc/stm/stm32_i2s.c
+++ b/sound/soc/stm/stm32_i2s.c
@@ -281,7 +281,6 @@ static bool stm32_i2s_readable_reg(struct device *dev, unsigned int reg)
 	case STM32_I2S_CFG2_REG:
 	case STM32_I2S_IER_REG:
 	case STM32_I2S_SR_REG:
-	case STM32_I2S_TXDR_REG:
 	case STM32_I2S_RXDR_REG:
 	case STM32_I2S_CGFR_REG:
 		return true;
@@ -293,7 +292,7 @@ static bool stm32_i2s_readable_reg(struct device *dev, unsigned int reg)
 static bool stm32_i2s_volatile_reg(struct device *dev, unsigned int reg)
 {
 	switch (reg) {
-	case STM32_I2S_TXDR_REG:
+	case STM32_I2S_SR_REG:
 	case STM32_I2S_RXDR_REG:
 		return true;
 	default:
diff --git a/sound/soc/stm/stm32_sai.c b/sound/soc/stm/stm32_sai.c
index 14c9591aae42..d68d62f12df5 100644
--- a/sound/soc/stm/stm32_sai.c
+++ b/sound/soc/stm/stm32_sai.c
@@ -105,6 +105,7 @@ static int stm32_sai_set_sync(struct stm32_sai_data *sai_client,
 	if (!pdev) {
 		dev_err(&sai_client->pdev->dev,
 			"Device not found for node %pOFn\n", np_provider);
+		of_node_put(np_provider);
 		return -ENODEV;
 	}
 
@@ -113,19 +114,20 @@ static int stm32_sai_set_sync(struct stm32_sai_data *sai_client,
 		dev_err(&sai_client->pdev->dev,
 			"SAI sync provider data not found\n");
 		ret = -EINVAL;
-		goto out_put_dev;
+		goto error;
 	}
 
 	/* Configure sync client */
 	ret = stm32_sai_sync_conf_client(sai_client, synci);
 	if (ret < 0)
-		goto out_put_dev;
+		goto error;
 
 	/* Configure sync provider */
 	ret = stm32_sai_sync_conf_provider(sai_provider, synco);
 
-out_put_dev:
+error:
 	put_device(&pdev->dev);
+	of_node_put(np_provider);
 	return ret;
 }
 
diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
index f9297228c41c..55d802f51c15 100644
--- a/sound/soc/stm/stm32_sai_sub.c
+++ b/sound/soc/stm/stm32_sai_sub.c
@@ -100,8 +100,9 @@
  * @slot_mask: rx or tx active slots mask. set at init or at runtime
  * @data_size: PCM data width. corresponds to PCM substream width.
  * @spdif_frm_cnt: S/PDIF playback frame counter
- * @snd_aes_iec958: iec958 data
+ * @iec958: iec958 data
  * @ctrl_lock: control lock
+ * @irq_lock: prevent race condition with IRQ
  */
 struct stm32_sai_sub_data {
 	struct platform_device *pdev;
@@ -133,6 +134,7 @@ struct stm32_sai_sub_data {
 	unsigned int spdif_frm_cnt;
 	struct snd_aes_iec958 iec958;
 	struct mutex ctrl_lock; /* protect resources accessed by controls */
+	spinlock_t irq_lock; /* used to prevent race condition with IRQ */
 };
 
 enum stm32_sai_fifo_th {
@@ -474,8 +476,10 @@ static irqreturn_t stm32_sai_isr(int irq, void *devid)
 		status = SNDRV_PCM_STATE_XRUN;
 	}
 
-	if (status != SNDRV_PCM_STATE_RUNNING)
+	spin_lock(&sai->irq_lock);
+	if (status != SNDRV_PCM_STATE_RUNNING && sai->substream)
 		snd_pcm_stop_xrun(sai->substream);
+	spin_unlock(&sai->irq_lock);
 
 	return IRQ_HANDLED;
 }
@@ -679,8 +683,19 @@ static int stm32_sai_startup(struct snd_pcm_substream *substream,
 {
 	struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);
 	int imr, cr2, ret;
+	unsigned long flags;
 
+	spin_lock_irqsave(&sai->irq_lock, flags);
 	sai->substream = substream;
+	spin_unlock_irqrestore(&sai->irq_lock, flags);
+
+	if (STM_SAI_PROTOCOL_IS_SPDIF(sai)) {
+		snd_pcm_hw_constraint_mask64(substream->runtime,
+					     SNDRV_PCM_HW_PARAM_FORMAT,
+					     SNDRV_PCM_FMTBIT_S32_LE);
+		snd_pcm_hw_constraint_single(substream->runtime,
+					     SNDRV_PCM_HW_PARAM_CHANNELS, 2);
+	}
 
 	ret = clk_prepare_enable(sai->sai_ck);
 	if (ret < 0) {
@@ -898,7 +913,7 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai,
 				     struct snd_pcm_hw_params *params)
 {
 	struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);
-	int div = 0;
+	int div = 0, cr1 = 0;
 	int sai_clk_rate, mclk_ratio, den;
 	unsigned int rate = params_rate(params);
 
@@ -943,13 +958,19 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai,
 		} else {
 			if (sai->mclk_rate) {
 				mclk_ratio = sai->mclk_rate / rate;
-				if ((mclk_ratio != 512) &&
-				    (mclk_ratio != 256)) {
+				if (mclk_ratio == 512) {
+					cr1 = SAI_XCR1_OSR;
+				} else if (mclk_ratio != 256) {
 					dev_err(cpu_dai->dev,
 						"Wrong mclk ratio %d\n",
 						mclk_ratio);
 					return -EINVAL;
 				}
+
+				regmap_update_bits(sai->regmap,
+						   STM_SAI_CR1_REGX,
+						   SAI_XCR1_OSR, cr1);
+
 				div = stm32_sai_get_clk_div(sai, sai_clk_rate,
 							    sai->mclk_rate);
 				if (div < 0)
@@ -1051,6 +1072,7 @@ static void stm32_sai_shutdown(struct snd_pcm_substream *substream,
 			       struct snd_soc_dai *cpu_dai)
 {
 	struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);
+	unsigned long flags;
 
 	regmap_update_bits(sai->regmap, STM_SAI_IMR_REGX, SAI_XIMR_MASK, 0);
 
@@ -1061,18 +1083,21 @@ static void stm32_sai_shutdown(struct snd_pcm_substream *substream,
 
 	clk_rate_exclusive_put(sai->sai_mclk);
 
+	spin_lock_irqsave(&sai->irq_lock, flags);
 	sai->substream = NULL;
+	spin_unlock_irqrestore(&sai->irq_lock, flags);
 }
 
 static int stm32_sai_pcm_new(struct snd_soc_pcm_runtime *rtd,
 			     struct snd_soc_dai *cpu_dai)
 {
 	struct stm32_sai_sub_data *sai = dev_get_drvdata(cpu_dai->dev);
+	struct snd_kcontrol_new knew = iec958_ctls;
 
 	if (STM_SAI_PROTOCOL_IS_SPDIF(sai)) {
 		dev_dbg(&sai->pdev->dev, "%s: register iec controls", __func__);
-		return snd_ctl_add(rtd->pcm->card,
-				   snd_ctl_new1(&iec958_ctls, sai));
+		knew.device = rtd->pcm->device;
+		return snd_ctl_add(rtd->pcm->card, snd_ctl_new1(&knew, sai));
 	}
 
 	return 0;
@@ -1081,7 +1106,7 @@ static int stm32_sai_pcm_new(struct snd_soc_pcm_runtime *rtd,
 static int stm32_sai_dai_probe(struct snd_soc_dai *cpu_dai)
 {
 	struct stm32_sai_sub_data *sai = dev_get_drvdata(cpu_dai->dev);
-	int cr1 = 0, cr1_mask;
+	int cr1 = 0, cr1_mask, ret;
 
 	sai->cpu_dai = cpu_dai;
 
@@ -1111,8 +1136,10 @@ static int stm32_sai_dai_probe(struct snd_soc_dai *cpu_dai)
 	/* Configure synchronization */
 	if (sai->sync == SAI_SYNC_EXTERNAL) {
 		/* Configure synchro client and provider */
-		sai->pdata->set_sync(sai->pdata, sai->np_sync_provider,
-				     sai->synco, sai->synci);
+		ret = sai->pdata->set_sync(sai->pdata, sai->np_sync_provider,
+					   sai->synco, sai->synci);
+		if (ret)
+			return ret;
 	}
 
 	cr1_mask |= SAI_XCR1_SYNCEN_MASK;
@@ -1424,6 +1451,7 @@ static int stm32_sai_sub_probe(struct platform_device *pdev)
 
 	sai->pdev = pdev;
 	mutex_init(&sai->ctrl_lock);
+	spin_lock_init(&sai->irq_lock);
 	platform_set_drvdata(pdev, sai);
 
 	sai->pdata = dev_get_drvdata(pdev->dev.parent);
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 3c38ac9a92a7..929c8e537a14 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -502,16 +502,6 @@ union bpf_attr {
  * 	Return
  * 		0 on success, or a negative error in case of failure.
  *
- * int bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags)
- * 	Description
- * 		Push an element *value* in *map*. *flags* is one of:
- *
- * 		**BPF_EXIST**
- * 		If the queue/stack is full, the oldest element is removed to
- * 		make room for this.
- * 	Return
- * 		0 on success, or a negative error in case of failure.
- *
  * int bpf_probe_read(void *dst, u32 size, const void *src)
  * 	Description
  * 		For tracing programs, safely attempt to read *size* bytes from
@@ -1435,14 +1425,14 @@ union bpf_attr {
  * u64 bpf_get_socket_cookie(struct bpf_sock_addr *ctx)
  * 	Description
  * 		Equivalent to bpf_get_socket_cookie() helper that accepts
- * 		*skb*, but gets socket from **struct bpf_sock_addr** contex.
+ * 		*skb*, but gets socket from **struct bpf_sock_addr** context.
  * 	Return
  * 		A 8-byte long non-decreasing number.
  *
  * u64 bpf_get_socket_cookie(struct bpf_sock_ops *ctx)
  * 	Description
  * 		Equivalent to bpf_get_socket_cookie() helper that accepts
- * 		*skb*, but gets socket from **struct bpf_sock_ops** contex.
+ * 		*skb*, but gets socket from **struct bpf_sock_ops** context.
  * 	Return
  * 		A 8-byte long non-decreasing number.
  *
@@ -2098,52 +2088,52 @@ union bpf_attr {
  *	Return
  * 		0 on success, or a negative error in case of failure.
  *
- * int bpf_rc_keydown(void *ctx, u32 protocol, u64 scancode, u32 toggle)
+ * int bpf_rc_repeat(void *ctx)
  *	Description
  *		This helper is used in programs implementing IR decoding, to
- *		report a successfully decoded key press with *scancode*,
- *		*toggle* value in the given *protocol*. The scancode will be
- *		translated to a keycode using the rc keymap, and reported as
- *		an input key down event. After a period a key up event is
- *		generated. This period can be extended by calling either
- *		**bpf_rc_keydown**\ () again with the same values, or calling
- *		**bpf_rc_repeat**\ ().
+ *		report a successfully decoded repeat key message. This delays
+ *		the generation of a key up event for previously generated
+ *		key down event.
  *
- *		Some protocols include a toggle bit, in case the button	was
- *		released and pressed again between consecutive scancodes.
+ *		Some IR protocols like NEC have a special IR message for
+ *		repeating last button, for when a button is held down.
  *
  *		The *ctx* should point to the lirc sample as passed into
  *		the program.
  *
- *		The *protocol* is the decoded protocol number (see
- *		**enum rc_proto** for some predefined values).
- *
  *		This helper is only available is the kernel was compiled with
  *		the **CONFIG_BPF_LIRC_MODE2** configuration option set to
  *		"**y**".
  *	Return
  *		0
  *
- * int bpf_rc_repeat(void *ctx)
+ * int bpf_rc_keydown(void *ctx, u32 protocol, u64 scancode, u32 toggle)
  *	Description
  *		This helper is used in programs implementing IR decoding, to
- *		report a successfully decoded repeat key message. This delays
- *		the generation of a key up event for previously generated
- *		key down event.
+ *		report a successfully decoded key press with *scancode*,
+ *		*toggle* value in the given *protocol*. The scancode will be
+ *		translated to a keycode using the rc keymap, and reported as
+ *		an input key down event. After a period a key up event is
+ *		generated. This period can be extended by calling either
+ *		**bpf_rc_keydown**\ () again with the same values, or calling
+ *		**bpf_rc_repeat**\ ().
  *
- *		Some IR protocols like NEC have a special IR message for
- *		repeating last button, for when a button is held down.
+ *		Some protocols include a toggle bit, in case the button	was
+ *		released and pressed again between consecutive scancodes.
  *
  *		The *ctx* should point to the lirc sample as passed into
  *		the program.
  *
+ *		The *protocol* is the decoded protocol number (see
+ *		**enum rc_proto** for some predefined values).
+ *
  *		This helper is only available is the kernel was compiled with
  *		the **CONFIG_BPF_LIRC_MODE2** configuration option set to
  *		"**y**".
  *	Return
  *		0
  *
- * uint64_t bpf_skb_cgroup_id(struct sk_buff *skb)
+ * u64 bpf_skb_cgroup_id(struct sk_buff *skb)
  * 	Description
  * 		Return the cgroup v2 id of the socket associated with the *skb*.
  * 		This is roughly similar to the **bpf_get_cgroup_classid**\ ()
@@ -2159,30 +2149,12 @@ union bpf_attr {
  * 	Return
  * 		The id is returned or 0 in case the id could not be retrieved.
  *
- * u64 bpf_skb_ancestor_cgroup_id(struct sk_buff *skb, int ancestor_level)
- *	Description
- *		Return id of cgroup v2 that is ancestor of cgroup associated
- *		with the *skb* at the *ancestor_level*.  The root cgroup is at
- *		*ancestor_level* zero and each step down the hierarchy
- *		increments the level. If *ancestor_level* == level of cgroup
- *		associated with *skb*, then return value will be same as that
- *		of **bpf_skb_cgroup_id**\ ().
- *
- *		The helper is useful to implement policies based on cgroups
- *		that are upper in hierarchy than immediate cgroup associated
- *		with *skb*.
- *
- *		The format of returned id and helper limitations are same as in
- *		**bpf_skb_cgroup_id**\ ().
- *	Return
- *		The id is returned or 0 in case the id could not be retrieved.
- *
  * u64 bpf_get_current_cgroup_id(void)
  * 	Return
  * 		A 64-bit integer containing the current cgroup id based
  * 		on the cgroup within which the current task is running.
  *
- * void* get_local_storage(void *map, u64 flags)
+ * void *bpf_get_local_storage(void *map, u64 flags)
  *	Description
  *		Get the pointer to the local storage area.
  *		The type and the size of the local storage is defined
@@ -2209,6 +2181,24 @@ union bpf_attr {
  *	Return
  *		0 on success, or a negative error in case of failure.
  *
+ * u64 bpf_skb_ancestor_cgroup_id(struct sk_buff *skb, int ancestor_level)
+ *	Description
+ *		Return id of cgroup v2 that is ancestor of cgroup associated
+ *		with the *skb* at the *ancestor_level*.  The root cgroup is at
+ *		*ancestor_level* zero and each step down the hierarchy
+ *		increments the level. If *ancestor_level* == level of cgroup
+ *		associated with *skb*, then return value will be same as that
+ *		of **bpf_skb_cgroup_id**\ ().
+ *
+ *		The helper is useful to implement policies based on cgroups
+ *		that are upper in hierarchy than immediate cgroup associated
+ *		with *skb*.
+ *
+ *		The format of returned id and helper limitations are same as in
+ *		**bpf_skb_cgroup_id**\ ().
+ *	Return
+ *		The id is returned or 0 in case the id could not be retrieved.
+ *
  * struct bpf_sock *bpf_sk_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags)
  *	Description
  *		Look for TCP socket matching *tuple*, optionally in a child
@@ -2289,6 +2279,16 @@ union bpf_attr {
  *	Return
  *		0 on success, or a negative error in case of failure.
  *
+ * int bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags)
+ * 	Description
+ * 		Push an element *value* in *map*. *flags* is one of:
+ *
+ * 		**BPF_EXIST**
+ * 			If the queue/stack is full, the oldest element is
+ * 			removed to make room for this.
+ * 	Return
+ * 		0 on success, or a negative error in case of failure.
+ *
  * int bpf_map_pop_elem(struct bpf_map *map, void *value)
  * 	Description
  * 		Pop an element from *map*.
@@ -2343,29 +2343,94 @@ union bpf_attr {
  *	Return
  *		0
  *
+ * int bpf_spin_lock(struct bpf_spin_lock *lock)
+ *	Description
+ *		Acquire a spinlock represented by the pointer *lock*, which is
+ *		stored as part of a value of a map. Taking the lock allows to
+ *		safely update the rest of the fields in that value. The
+ *		spinlock can (and must) later be released with a call to
+ *		**bpf_spin_unlock**\ (\ *lock*\ ).
+ *
+ *		Spinlocks in BPF programs come with a number of restrictions
+ *		and constraints:
+ *
+ *		* **bpf_spin_lock** objects are only allowed inside maps of
+ *		  types **BPF_MAP_TYPE_HASH** and **BPF_MAP_TYPE_ARRAY** (this
+ *		  list could be extended in the future).
+ *		* BTF description of the map is mandatory.
+ *		* The BPF program can take ONE lock at a time, since taking two
+ *		  or more could cause dead locks.
+ *		* Only one **struct bpf_spin_lock** is allowed per map element.
+ *		* When the lock is taken, calls (either BPF to BPF or helpers)
+ *		  are not allowed.
+ *		* The **BPF_LD_ABS** and **BPF_LD_IND** instructions are not
+ *		  allowed inside a spinlock-ed region.
+ *		* The BPF program MUST call **bpf_spin_unlock**\ () to release
+ *		  the lock, on all execution paths, before it returns.
+ *		* The BPF program can access **struct bpf_spin_lock** only via
+ *		  the **bpf_spin_lock**\ () and **bpf_spin_unlock**\ ()
+ *		  helpers. Loading or storing data into the **struct
+ *		  bpf_spin_lock** *lock*\ **;** field of a map is not allowed.
+ *		* To use the **bpf_spin_lock**\ () helper, the BTF description
+ *		  of the map value must be a struct and have **struct
+ *		  bpf_spin_lock** *anyname*\ **;** field at the top level.
+ *		  Nested lock inside another struct is not allowed.
+ *		* The **struct bpf_spin_lock** *lock* field in a map value must
+ *		  be aligned on a multiple of 4 bytes in that value.
+ *		* Syscall with command **BPF_MAP_LOOKUP_ELEM** does not copy
+ *		  the **bpf_spin_lock** field to user space.
+ *		* Syscall with command **BPF_MAP_UPDATE_ELEM**, or update from
+ *		  a BPF program, do not update the **bpf_spin_lock** field.
+ *		* **bpf_spin_lock** cannot be on the stack or inside a
+ *		  networking packet (it can only be inside of a map values).
+ *		* **bpf_spin_lock** is available to root only.
+ *		* Tracing programs and socket filter programs cannot use
+ *		  **bpf_spin_lock**\ () due to insufficient preemption checks
+ *		  (but this may change in the future).
+ *		* **bpf_spin_lock** is not allowed in inner maps of map-in-map.
+ *	Return
+ *		0
+ *
+ * int bpf_spin_unlock(struct bpf_spin_lock *lock)
+ *	Description
+ *		Release the *lock* previously locked by a call to
+ *		**bpf_spin_lock**\ (\ *lock*\ ).
+ *	Return
+ *		0
+ *
  * struct bpf_sock *bpf_sk_fullsock(struct bpf_sock *sk)
  *	Description
  *		This helper gets a **struct bpf_sock** pointer such
- *		that all the fields in bpf_sock can be accessed.
+ *		that all the fields in this **bpf_sock** can be accessed.
  *	Return
- *		A **struct bpf_sock** pointer on success, or NULL in
+ *		A **struct bpf_sock** pointer on success, or **NULL** in
  *		case of failure.
  *
  * struct bpf_tcp_sock *bpf_tcp_sock(struct bpf_sock *sk)
  *	Description
  *		This helper gets a **struct bpf_tcp_sock** pointer from a
  *		**struct bpf_sock** pointer.
- *
  *	Return
- *		A **struct bpf_tcp_sock** pointer on success, or NULL in
+ *		A **struct bpf_tcp_sock** pointer on success, or **NULL** in
  *		case of failure.
  *
  * int bpf_skb_ecn_set_ce(struct sk_buf *skb)
- *     Description
- *             Sets ECN of IP header to ce (congestion encountered) if
- *             current value is ect (ECN capable). Works with IPv6 and IPv4.
- *     Return
- *             1 if set, 0 if not set.
+ *	Description
+ *		Set ECN (Explicit Congestion Notification) field of IP header
+ *		to **CE** (Congestion Encountered) if current value is **ECT**
+ *		(ECN Capable Transport). Otherwise, do nothing. Works with IPv6
+ *		and IPv4.
+ *	Return
+ *		1 if the **CE** flag is set (either by the current helper call
+ *		or because it was already present), 0 if it is not set.
+ *
+ * struct bpf_sock *bpf_get_listener_sock(struct bpf_sock *sk)
+ *	Description
+ *		Return a **struct bpf_sock** pointer in **TCP_LISTEN** state.
+ *		**bpf_sk_release**\ () is unnecessary and not allowed.
+ *	Return
+ *		A **struct bpf_sock** pointer on success, or **NULL** in
+ *		case of failure.
  */
 #define __BPF_FUNC_MAPPER(FN)		\
 	FN(unspec),			\
@@ -2465,7 +2530,8 @@ union bpf_attr {
 	FN(spin_unlock),		\
 	FN(sk_fullsock),		\
 	FN(tcp_sock),			\
-	FN(skb_ecn_set_ce),
+	FN(skb_ecn_set_ce),		\
+	FN(get_listener_sock),
 
 /* integer value in 'imm' field of BPF_CALL instruction selects which helper
  * function eBPF program intends to call
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index 1b8d8cdd3575..87e3020ac1bc 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@ -1602,16 +1602,12 @@ static bool btf_equal_int(struct btf_type *t1, struct btf_type *t2)
 /* Calculate type signature hash of ENUM. */
 static __u32 btf_hash_enum(struct btf_type *t)
 {
-	struct btf_enum *member = (struct btf_enum *)(t + 1);
-	__u32 vlen = BTF_INFO_VLEN(t->info);
-	__u32 h = btf_hash_common(t);
-	int i;
+	__u32 h;
 
-	for (i = 0; i < vlen; i++) {
-		h = hash_combine(h, member->name_off);
-		h = hash_combine(h, member->val);
-		member++;
-	}
+	/* don't hash vlen and enum members to support enum fwd resolving */
+	h = hash_combine(0, t->name_off);
+	h = hash_combine(h, t->info & ~0xffff);
+	h = hash_combine(h, t->size);
 	return h;
 }
 
@@ -1637,6 +1633,22 @@ static bool btf_equal_enum(struct btf_type *t1, struct btf_type *t2)
 	return true;
 }
 
+static inline bool btf_is_enum_fwd(struct btf_type *t)
+{
+	return BTF_INFO_KIND(t->info) == BTF_KIND_ENUM &&
+	       BTF_INFO_VLEN(t->info) == 0;
+}
+
+static bool btf_compat_enum(struct btf_type *t1, struct btf_type *t2)
+{
+	if (!btf_is_enum_fwd(t1) && !btf_is_enum_fwd(t2))
+		return btf_equal_enum(t1, t2);
+	/* ignore vlen when comparing */
+	return t1->name_off == t2->name_off &&
+	       (t1->info & ~0xffff) == (t2->info & ~0xffff) &&
+	       t1->size == t2->size;
+}
+
 /*
  * Calculate type signature hash of STRUCT/UNION, ignoring referenced type IDs,
  * as referenced type IDs equivalence is established separately during type
@@ -1860,6 +1872,17 @@ static int btf_dedup_prim_type(struct btf_dedup *d, __u32 type_id)
 				new_id = cand_node->type_id;
 				break;
 			}
+			if (d->opts.dont_resolve_fwds)
+				continue;
+			if (btf_compat_enum(t, cand)) {
+				if (btf_is_enum_fwd(t)) {
+					/* resolve fwd to full enum */
+					new_id = cand_node->type_id;
+					break;
+				}
+				/* resolve canonical enum fwd to full enum */
+				d->map[cand_node->type_id] = type_id;
+			}
 		}
 		break;
 
@@ -2084,15 +2107,15 @@ static int btf_dedup_is_equiv(struct btf_dedup *d, __u32 cand_id,
 		return fwd_kind == real_kind;
 	}
 
-	if (cand_type->info != canon_type->info)
-		return 0;
-
 	switch (cand_kind) {
 	case BTF_KIND_INT:
 		return btf_equal_int(cand_type, canon_type);
 
 	case BTF_KIND_ENUM:
-		return btf_equal_enum(cand_type, canon_type);
+		if (d->opts.dont_resolve_fwds)
+			return btf_equal_enum(cand_type, canon_type);
+		else
+			return btf_compat_enum(cand_type, canon_type);
 
 	case BTF_KIND_FWD:
 		return btf_equal_common(cand_type, canon_type);
@@ -2103,6 +2126,8 @@ static int btf_dedup_is_equiv(struct btf_dedup *d, __u32 cand_id,
 	case BTF_KIND_PTR:
 	case BTF_KIND_TYPEDEF:
 	case BTF_KIND_FUNC:
+		if (cand_type->info != canon_type->info)
+			return 0;
 		return btf_dedup_is_equiv(d, cand_type->type, canon_type->type);
 
 	case BTF_KIND_ARRAY: {
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index d5b830d60601..5e977d2688da 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -835,12 +835,19 @@ static int bpf_object__elf_collect(struct bpf_object *obj, int flags)
 			obj->efile.maps_shndx = idx;
 		else if (strcmp(name, BTF_ELF_SEC) == 0) {
 			obj->btf = btf__new(data->d_buf, data->d_size);
-			if (IS_ERR(obj->btf) || btf__load(obj->btf)) {
+			if (IS_ERR(obj->btf)) {
 				pr_warning("Error loading ELF section %s: %ld. Ignored and continue.\n",
 					   BTF_ELF_SEC, PTR_ERR(obj->btf));
-				if (!IS_ERR(obj->btf))
-					btf__free(obj->btf);
 				obj->btf = NULL;
+				continue;
+			}
+			err = btf__load(obj->btf);
+			if (err) {
+				pr_warning("Error loading %s into kernel: %d. Ignored and continue.\n",
+					   BTF_ELF_SEC, err);
+				btf__free(obj->btf);
+				obj->btf = NULL;
+				err = 0;
 			}
 		} else if (strcmp(name, BTF_EXT_ELF_SEC) == 0) {
 			btf_ext_data = data;
diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c
index f98ac82c9aea..8d0078b65486 100644
--- a/tools/lib/bpf/xsk.c
+++ b/tools/lib/bpf/xsk.c
@@ -126,8 +126,8 @@ static void xsk_set_umem_config(struct xsk_umem_config *cfg,
 	cfg->frame_headroom = usr_cfg->frame_headroom;
 }
 
-static void xsk_set_xdp_socket_config(struct xsk_socket_config *cfg,
-				      const struct xsk_socket_config *usr_cfg)
+static int xsk_set_xdp_socket_config(struct xsk_socket_config *cfg,
+				     const struct xsk_socket_config *usr_cfg)
 {
 	if (!usr_cfg) {
 		cfg->rx_size = XSK_RING_CONS__DEFAULT_NUM_DESCS;
@@ -135,14 +135,19 @@ static void xsk_set_xdp_socket_config(struct xsk_socket_config *cfg,
 		cfg->libbpf_flags = 0;
 		cfg->xdp_flags = 0;
 		cfg->bind_flags = 0;
-		return;
+		return 0;
 	}
 
+	if (usr_cfg->libbpf_flags & ~XSK_LIBBPF_FLAGS__INHIBIT_PROG_LOAD)
+		return -EINVAL;
+
 	cfg->rx_size = usr_cfg->rx_size;
 	cfg->tx_size = usr_cfg->tx_size;
 	cfg->libbpf_flags = usr_cfg->libbpf_flags;
 	cfg->xdp_flags = usr_cfg->xdp_flags;
 	cfg->bind_flags = usr_cfg->bind_flags;
+
+	return 0;
 }
 
 int xsk_umem__create(struct xsk_umem **umem_ptr, void *umem_area, __u64 size,
@@ -557,7 +562,9 @@ int xsk_socket__create(struct xsk_socket **xsk_ptr, const char *ifname,
 	}
 	strncpy(xsk->ifname, ifname, IFNAMSIZ);
 
-	xsk_set_xdp_socket_config(&xsk->config, usr_config);
+	err = xsk_set_xdp_socket_config(&xsk->config, usr_config);
+	if (err)
+		goto out_socket;
 
 	if (rx) {
 		err = setsockopt(xsk->fd, SOL_XDP, XDP_RX_RING,
diff --git a/tools/memory-model/Documentation/explanation.txt b/tools/memory-model/Documentation/explanation.txt
index 35bff92cc773..68caa9a976d0 100644
--- a/tools/memory-model/Documentation/explanation.txt
+++ b/tools/memory-model/Documentation/explanation.txt
@@ -27,7 +27,7 @@ Explanation of the Linux-Kernel Memory Consistency Model
   19. AND THEN THERE WAS ALPHA
   20. THE HAPPENS-BEFORE RELATION: hb
   21. THE PROPAGATES-BEFORE RELATION: pb
-  22. RCU RELATIONS: rcu-link, gp, rscs, rcu-fence, and rb
+  22. RCU RELATIONS: rcu-link, rcu-gp, rcu-rscsi, rcu-fence, and rb
   23. LOCKING
   24. ODDS AND ENDS
 
@@ -1430,8 +1430,8 @@ they execute means that it cannot have cycles.  This requirement is
 the content of the LKMM's "propagation" axiom.
 
 
-RCU RELATIONS: rcu-link, gp, rscs, rcu-fence, and rb
-----------------------------------------------------
+RCU RELATIONS: rcu-link, rcu-gp, rcu-rscsi, rcu-fence, and rb
+-------------------------------------------------------------
 
 RCU (Read-Copy-Update) is a powerful synchronization mechanism.  It
 rests on two concepts: grace periods and read-side critical sections.
@@ -1446,17 +1446,19 @@ As far as memory models are concerned, RCU's main feature is its
 Grace-Period Guarantee, which states that a critical section can never
 span a full grace period.  In more detail, the Guarantee says:
 
-	If a critical section starts before a grace period then it
-	must end before the grace period does.  In addition, every
-	store that propagates to the critical section's CPU before the
-	end of the critical section must propagate to every CPU before
-	the end of the grace period.
+	For any critical section C and any grace period G, at least
+	one of the following statements must hold:
 
-	If a critical section ends after a grace period ends then it
-	must start after the grace period does.  In addition, every
-	store that propagates to the grace period's CPU before the
-	start of the grace period must propagate to every CPU before
-	the start of the critical section.
+(1)	C ends before G does, and in addition, every store that
+	propagates to C's CPU before the end of C must propagate to
+	every CPU before G ends.
+
+(2)	G starts before C does, and in addition, every store that
+	propagates to G's CPU before the start of G must propagate
+	to every CPU before C starts.
+
+In particular, it is not possible for a critical section to both start
+before and end after a grace period.
 
 Here is a simple example of RCU in action:
 
@@ -1483,10 +1485,11 @@ The Grace Period Guarantee tells us that when this code runs, it will
 never end with r1 = 1 and r2 = 0.  The reasoning is as follows.  r1 = 1
 means that P0's store to x propagated to P1 before P1 called
 synchronize_rcu(), so P0's critical section must have started before
-P1's grace period.  On the other hand, r2 = 0 means that P0's store to
-y, which occurs before the end of the critical section, did not
-propagate to P1 before the end of the grace period, violating the
-Guarantee.
+P1's grace period, contrary to part (2) of the Guarantee.  On the
+other hand, r2 = 0 means that P0's store to y, which occurs before the
+end of the critical section, did not propagate to P1 before the end of
+the grace period, contrary to part (1).  Together the results violate
+the Guarantee.
 
 In the kernel's implementations of RCU, the requirements for stores
 to propagate to every CPU are fulfilled by placing strong fences at
@@ -1504,11 +1507,11 @@ before" or "ends after" a grace period?  Some aspects of the meaning
 are pretty obvious, as in the example above, but the details aren't
 entirely clear.  The LKMM formalizes this notion by means of the
 rcu-link relation.  rcu-link encompasses a very general notion of
-"before": Among other things, X ->rcu-link Z includes cases where X
-happens-before or is equal to some event Y which is equal to or comes
-before Z in the coherence order.  When Y = Z this says that X ->rfe Z
-implies X ->rcu-link Z.  In addition, when Y = X it says that X ->fr Z
-and X ->co Z each imply X ->rcu-link Z.
+"before": If E and F are RCU fence events (i.e., rcu_read_lock(),
+rcu_read_unlock(), or synchronize_rcu()) then among other things,
+E ->rcu-link F includes cases where E is po-before some memory-access
+event X, F is po-after some memory-access event Y, and we have any of
+X ->rfe Y, X ->co Y, or X ->fr Y.
 
 The formal definition of the rcu-link relation is more than a little
 obscure, and we won't give it here.  It is closely related to the pb
@@ -1516,171 +1519,173 @@ relation, and the details don't matter unless you want to comb through
 a somewhat lengthy formal proof.  Pretty much all you need to know
 about rcu-link is the information in the preceding paragraph.
 
-The LKMM also defines the gp and rscs relations.  They bring grace
-periods and read-side critical sections into the picture, in the
+The LKMM also defines the rcu-gp and rcu-rscsi relations.  They bring
+grace periods and read-side critical sections into the picture, in the
 following way:
 
-	E ->gp F means there is a synchronize_rcu() fence event S such
-	that E ->po S and either S ->po F or S = F.  In simple terms,
-	there is a grace period po-between E and F.
+	E ->rcu-gp F means that E and F are in fact the same event,
+	and that event is a synchronize_rcu() fence (i.e., a grace
+	period).
 
-	E ->rscs F means there is a critical section delimited by an
-	rcu_read_lock() fence L and an rcu_read_unlock() fence U, such
-	that E ->po U and either L ->po F or L = F.  You can think of
-	this as saying that E and F are in the same critical section
-	(in fact, it also allows E to be po-before the start of the
-	critical section and F to be po-after the end).
+	E ->rcu-rscsi F means that E and F are the rcu_read_unlock()
+	and rcu_read_lock() fence events delimiting some read-side
+	critical section.  (The 'i' at the end of the name emphasizes
+	that this relation is "inverted": It links the end of the
+	critical section to the start.)
 
 If we think of the rcu-link relation as standing for an extended
-"before", then X ->gp Y ->rcu-link Z says that X executes before a
-grace period which ends before Z executes.  (In fact it covers more
-than this, because it also includes cases where X executes before a
-grace period and some store propagates to Z's CPU before Z executes
-but doesn't propagate to some other CPU until after the grace period
-ends.)  Similarly, X ->rscs Y ->rcu-link Z says that X is part of (or
-before the start of) a critical section which starts before Z
-executes.
-
-The LKMM goes on to define the rcu-fence relation as a sequence of gp
-and rscs links separated by rcu-link links, in which the number of gp
-links is >= the number of rscs links.  For example:
+"before", then X ->rcu-gp Y ->rcu-link Z roughly says that X is a
+grace period which ends before Z begins.  (In fact it covers more than
+this, because it also includes cases where some store propagates to
+Z's CPU before Z begins but doesn't propagate to some other CPU until
+after X ends.)  Similarly, X ->rcu-rscsi Y ->rcu-link Z says that X is
+the end of a critical section which starts before Z begins.
+
+The LKMM goes on to define the rcu-fence relation as a sequence of
+rcu-gp and rcu-rscsi links separated by rcu-link links, in which the
+number of rcu-gp links is >= the number of rcu-rscsi links.  For
+example:
 
-	X ->gp Y ->rcu-link Z ->rscs T ->rcu-link U ->gp V
+	X ->rcu-gp Y ->rcu-link Z ->rcu-rscsi T ->rcu-link U ->rcu-gp V
 
 would imply that X ->rcu-fence V, because this sequence contains two
-gp links and only one rscs link.  (It also implies that X ->rcu-fence T
-and Z ->rcu-fence V.)  On the other hand:
+rcu-gp links and one rcu-rscsi link.  (It also implies that
+X ->rcu-fence T and Z ->rcu-fence V.)  On the other hand:
 
-	X ->rscs Y ->rcu-link Z ->rscs T ->rcu-link U ->gp V
+	X ->rcu-rscsi Y ->rcu-link Z ->rcu-rscsi T ->rcu-link U ->rcu-gp V
 
 does not imply X ->rcu-fence V, because the sequence contains only
-one gp link but two rscs links.
+one rcu-gp link but two rcu-rscsi links.
 
 The rcu-fence relation is important because the Grace Period Guarantee
 means that rcu-fence acts kind of like a strong fence.  In particular,
-if W is a write and we have W ->rcu-fence Z, the Guarantee says that W
-will propagate to every CPU before Z executes.
+E ->rcu-fence F implies not only that E begins before F ends, but also
+that any write po-before E will propagate to every CPU before any
+instruction po-after F can execute.  (However, it does not imply that
+E must execute before F; in fact, each synchronize_rcu() fence event
+is linked to itself by rcu-fence as a degenerate case.)
 
 To prove this in full generality requires some intellectual effort.
 We'll consider just a very simple case:
 
-	W ->gp X ->rcu-link Y ->rscs Z.
+	G ->rcu-gp W ->rcu-link Z ->rcu-rscsi F.
 
-This formula means that there is a grace period G and a critical
-section C such that:
+This formula means that G and W are the same event (a grace period),
+and there are events X, Y and a read-side critical section C such that:
 
-	1. W is po-before G;
+	1. G = W is po-before or equal to X;
 
-	2. X is equal to or po-after G;
+	2. X comes "before" Y in some sense (including rfe, co and fr);
 
-	3. X comes "before" Y in some sense;
+	2. Y is po-before Z;
 
-	4. Y is po-before the end of C;
+	4. Z is the rcu_read_unlock() event marking the end of C;
 
-	5. Z is equal to or po-after the start of C.
+	5. F is the rcu_read_lock() event marking the start of C.
 
-From 2 - 4 we deduce that the grace period G ends before the critical
-section C.  Then the second part of the Grace Period Guarantee says
-not only that G starts before C does, but also that W (which executes
-on G's CPU before G starts) must propagate to every CPU before C
-starts.  In particular, W propagates to every CPU before Z executes
-(or finishes executing, in the case where Z is equal to the
-rcu_read_lock() fence event which starts C.)  This sort of reasoning
-can be expanded to handle all the situations covered by rcu-fence.
+From 1 - 4 we deduce that the grace period G ends before the critical
+section C.  Then part (2) of the Grace Period Guarantee says not only
+that G starts before C does, but also that any write which executes on
+G's CPU before G starts must propagate to every CPU before C starts.
+In particular, the write propagates to every CPU before F finishes
+executing and hence before any instruction po-after F can execute.
+This sort of reasoning can be extended to handle all the situations
+covered by rcu-fence.
 
 Finally, the LKMM defines the RCU-before (rb) relation in terms of
 rcu-fence.  This is done in essentially the same way as the pb
 relation was defined in terms of strong-fence.  We will omit the
-details; the end result is that E ->rb F implies E must execute before
-F, just as E ->pb F does (and for much the same reasons).
+details; the end result is that E ->rb F implies E must execute
+before F, just as E ->pb F does (and for much the same reasons).
 
 Putting this all together, the LKMM expresses the Grace Period
 Guarantee by requiring that the rb relation does not contain a cycle.
-Equivalently, this "rcu" axiom requires that there are no events E and
-F with E ->rcu-link F ->rcu-fence E.  Or to put it a third way, the
-axiom requires that there are no cycles consisting of gp and rscs
-alternating with rcu-link, where the number of gp links is >= the
-number of rscs links.
+Equivalently, this "rcu" axiom requires that there are no events E
+and F with E ->rcu-link F ->rcu-fence E.  Or to put it a third way,
+the axiom requires that there are no cycles consisting of rcu-gp and
+rcu-rscsi alternating with rcu-link, where the number of rcu-gp links
+is >= the number of rcu-rscsi links.
 
 Justifying the axiom isn't easy, but it is in fact a valid
 formalization of the Grace Period Guarantee.  We won't attempt to go
 through the detailed argument, but the following analysis gives a
-taste of what is involved.  Suppose we have a violation of the first
-part of the Guarantee: A critical section starts before a grace
-period, and some store propagates to the critical section's CPU before
-the end of the critical section but doesn't propagate to some other
-CPU until after the end of the grace period.
+taste of what is involved.  Suppose both parts of the Guarantee are
+violated: A critical section starts before a grace period, and some
+store propagates to the critical section's CPU before the end of the
+critical section but doesn't propagate to some other CPU until after
+the end of the grace period.
 
 Putting symbols to these ideas, let L and U be the rcu_read_lock() and
 rcu_read_unlock() fence events delimiting the critical section in
 question, and let S be the synchronize_rcu() fence event for the grace
 period.  Saying that the critical section starts before S means there
-are events E and F where E is po-after L (which marks the start of the
-critical section), E is "before" F in the sense of the rcu-link
-relation, and F is po-before the grace period S:
+are events Q and R where Q is po-after L (which marks the start of the
+critical section), Q is "before" R in the sense used by the rcu-link
+relation, and R is po-before the grace period S.  Thus we have:
 
-	L ->po E ->rcu-link F ->po S.
+	L ->rcu-link S.
 
-Let W be the store mentioned above, let Z come before the end of the
+Let W be the store mentioned above, let Y come before the end of the
 critical section and witness that W propagates to the critical
-section's CPU by reading from W, and let Y on some arbitrary CPU be a
-witness that W has not propagated to that CPU, where Y happens after
+section's CPU by reading from W, and let Z on some arbitrary CPU be a
+witness that W has not propagated to that CPU, where Z happens after
 some event X which is po-after S.  Symbolically, this amounts to:
 
-	S ->po X ->hb* Y ->fr W ->rf Z ->po U.
+	S ->po X ->hb* Z ->fr W ->rf Y ->po U.
 
-The fr link from Y to W indicates that W has not propagated to Y's CPU
-at the time that Y executes.  From this, it can be shown (see the
-discussion of the rcu-link relation earlier) that X and Z are related
-by rcu-link, yielding:
+The fr link from Z to W indicates that W has not propagated to Z's CPU
+at the time that Z executes.  From this, it can be shown (see the
+discussion of the rcu-link relation earlier) that S and U are related
+by rcu-link:
 
-	S ->po X ->rcu-link Z ->po U.
+	S ->rcu-link U.
 
-The formulas say that S is po-between F and X, hence F ->gp X.  They
-also say that Z comes before the end of the critical section and E
-comes after its start, hence Z ->rscs E.  From all this we obtain:
+Since S is a grace period we have S ->rcu-gp S, and since L and U are
+the start and end of the critical section C we have U ->rcu-rscsi L.
+From this we obtain:
 
-	F ->gp X ->rcu-link Z ->rscs E ->rcu-link F,
+	S ->rcu-gp S ->rcu-link U ->rcu-rscsi L ->rcu-link S,
 
 a forbidden cycle.  Thus the "rcu" axiom rules out this violation of
 the Grace Period Guarantee.
 
 For something a little more down-to-earth, let's see how the axiom
 works out in practice.  Consider the RCU code example from above, this
-time with statement labels added to the memory access instructions:
+time with statement labels added:
 
 	int x, y;
 
 	P0()
 	{
-		rcu_read_lock();
-		W: WRITE_ONCE(x, 1);
-		X: WRITE_ONCE(y, 1);
-		rcu_read_unlock();
+		L: rcu_read_lock();
+		X: WRITE_ONCE(x, 1);
+		Y: WRITE_ONCE(y, 1);
+		U: rcu_read_unlock();
 	}
 
 	P1()
 	{
 		int r1, r2;
 
-		Y: r1 = READ_ONCE(x);
-		synchronize_rcu();
-		Z: r2 = READ_ONCE(y);
+		Z: r1 = READ_ONCE(x);
+		S: synchronize_rcu();
+		W: r2 = READ_ONCE(y);
 	}
 
 
-If r2 = 0 at the end then P0's store at X overwrites the value that
-P1's load at Z reads from, so we have Z ->fre X and thus Z ->rcu-link X.
-In addition, there is a synchronize_rcu() between Y and Z, so therefore
-we have Y ->gp Z.
+If r2 = 0 at the end then P0's store at Y overwrites the value that
+P1's load at W reads from, so we have W ->fre Y.  Since S ->po W and
+also Y ->po U, we get S ->rcu-link U.  In addition, S ->rcu-gp S
+because S is a grace period.
 
-If r1 = 1 at the end then P1's load at Y reads from P0's store at W,
-so we have W ->rcu-link Y.  In addition, W and X are in the same critical
-section, so therefore we have X ->rscs W.
+If r1 = 1 at the end then P1's load at Z reads from P0's store at X,
+so we have X ->rfe Z.  Together with L ->po X and Z ->po S, this
+yields L ->rcu-link S.  And since L and U are the start and end of a
+critical section, we have U ->rcu-rscsi L.
 
-Then X ->rscs W ->rcu-link Y ->gp Z ->rcu-link X is a forbidden cycle,
-violating the "rcu" axiom.  Hence the outcome is not allowed by the
-LKMM, as we would expect.
+Then U ->rcu-rscsi L ->rcu-link S ->rcu-gp S ->rcu-link U is a
+forbidden cycle, violating the "rcu" axiom.  Hence the outcome is not
+allowed by the LKMM, as we would expect.
 
 For contrast, let's see what can happen in a more complicated example:
 
@@ -1690,51 +1695,52 @@ For contrast, let's see what can happen in a more complicated example:
 	{
 		int r0;
 
-		rcu_read_lock();
-		W: r0 = READ_ONCE(x);
-		X: WRITE_ONCE(y, 1);
-		rcu_read_unlock();
+		L0: rcu_read_lock();
+		    r0 = READ_ONCE(x);
+		    WRITE_ONCE(y, 1);
+		U0: rcu_read_unlock();
 	}
 
 	P1()
 	{
 		int r1;
 
-		Y: r1 = READ_ONCE(y);
-		synchronize_rcu();
-		Z: WRITE_ONCE(z, 1);
+		    r1 = READ_ONCE(y);
+		S1: synchronize_rcu();
+		    WRITE_ONCE(z, 1);
 	}
 
 	P2()
 	{
 		int r2;
 
-		rcu_read_lock();
-		U: r2 = READ_ONCE(z);
-		V: WRITE_ONCE(x, 1);
-		rcu_read_unlock();
+		L2: rcu_read_lock();
+		    r2 = READ_ONCE(z);
+		    WRITE_ONCE(x, 1);
+		U2: rcu_read_unlock();
 	}
 
 If r0 = r1 = r2 = 1 at the end, then similar reasoning to before shows
-that W ->rscs X ->rcu-link Y ->gp Z ->rcu-link U ->rscs V ->rcu-link W.
-However this cycle is not forbidden, because the sequence of relations
-contains fewer instances of gp (one) than of rscs (two).  Consequently
-the outcome is allowed by the LKMM.  The following instruction timing
-diagram shows how it might actually occur:
+that U0 ->rcu-rscsi L0 ->rcu-link S1 ->rcu-gp S1 ->rcu-link U2 ->rcu-rscsi
+L2 ->rcu-link U0.  However this cycle is not forbidden, because the
+sequence of relations contains fewer instances of rcu-gp (one) than of
+rcu-rscsi (two).  Consequently the outcome is allowed by the LKMM.
+The following instruction timing diagram shows how it might actually
+occur:
 
 P0			P1			P2
 --------------------	--------------------	--------------------
 rcu_read_lock()
-X: WRITE_ONCE(y, 1)
-			Y: r1 = READ_ONCE(y)
+WRITE_ONCE(y, 1)
+			r1 = READ_ONCE(y)
 			synchronize_rcu() starts
 			.			rcu_read_lock()
-			.			V: WRITE_ONCE(x, 1)
-W: r0 = READ_ONCE(x)	.
+			.			WRITE_ONCE(x, 1)
+r0 = READ_ONCE(x)	.
 rcu_read_unlock()	.
 			synchronize_rcu() ends
-			Z: WRITE_ONCE(z, 1)
-						U: r2 = READ_ONCE(z)
+			WRITE_ONCE(z, 1)
+						r2 = READ_ONCE(z)
 						rcu_read_unlock()
 
 This requires P0 and P2 to execute their loads and stores out of
@@ -1744,6 +1750,15 @@ section in P0 both starts before P1's grace period does and ends
 before it does, and the critical section in P2 both starts after P1's
 grace period does and ends after it does.
 
+Addendum: The LKMM now supports SRCU (Sleepable Read-Copy-Update) in
+addition to normal RCU.  The ideas involved are much the same as
+above, with new relations srcu-gp and srcu-rscsi added to represent
+SRCU grace periods and read-side critical sections.  There is a
+restriction on the srcu-gp and srcu-rscsi links that can appear in an
+rcu-fence sequence (the srcu-rscsi links must be paired with srcu-gp
+links having the same SRCU domain with proper nesting); the details
+are relatively unimportant.
+
 
 LOCKING
 -------
diff --git a/tools/memory-model/README b/tools/memory-model/README
index 0f2c366518c6..2b87f3971548 100644
--- a/tools/memory-model/README
+++ b/tools/memory-model/README
@@ -20,13 +20,17 @@ that litmus test to be exercised within the Linux kernel.
 REQUIREMENTS
 ============
 
-Version 7.49 of the "herd7" and "klitmus7" tools must be downloaded
-separately:
+Version 7.52 or higher of the "herd7" and "klitmus7" tools must be
+downloaded separately:
 
   https://github.com/herd/herdtools7
 
 See "herdtools7/INSTALL.md" for installation instructions.
 
+Note that although these tools usually provide backwards compatibility,
+this is not absolutely guaranteed.  Therefore, if a later version does
+not work, please try using the exact version called out above.
+
 
 ==================
 BASIC USAGE: HERD7
@@ -221,8 +225,29 @@ The Linux-kernel memory model has the following limitations:
 		additional call_rcu() process to the site of the
 		emulated rcu-barrier().
 
-	e.	Sleepable RCU (SRCU) is not modeled.  It can be
-		emulated, but perhaps not simply.
+	e.	Although sleepable RCU (SRCU) is now modeled, there
+		are some subtle differences between its semantics and
+		those in the Linux kernel.  For example, the kernel
+		might interpret the following sequence as two partially
+		overlapping SRCU read-side critical sections:
+
+			 1  r1 = srcu_read_lock(&my_srcu);
+			 2  do_something_1();
+			 3  r2 = srcu_read_lock(&my_srcu);
+			 4  do_something_2();
+			 5  srcu_read_unlock(&my_srcu, r1);
+			 6  do_something_3();
+			 7  srcu_read_unlock(&my_srcu, r2);
+
+		In contrast, LKMM will interpret this as a nested pair of
+		SRCU read-side critical sections, with the outer critical
+		section spanning lines 1-7 and the inner critical section
+		spanning lines 3-5.
+
+		This difference would be more of a concern had anyone
+		identified a reasonable use case for partially overlapping
+		SRCU read-side critical sections.  For more information,
+		please see: https://paulmck.livejournal.com/40593.html
 
 	f.	Reader-writer locking is not modeled.  It can be
 		emulated in litmus tests using atomic read-modify-write
diff --git a/tools/memory-model/linux-kernel.bell b/tools/memory-model/linux-kernel.bell
index 796513362c05..def9131d3d8e 100644
--- a/tools/memory-model/linux-kernel.bell
+++ b/tools/memory-model/linux-kernel.bell
@@ -33,8 +33,14 @@ enum Barriers = 'wmb (*smp_wmb*) ||
 		'after-unlock-lock (*smp_mb__after_unlock_lock*)
 instructions F[Barriers]
 
+(* SRCU *)
+enum SRCU = 'srcu-lock || 'srcu-unlock || 'sync-srcu
+instructions SRCU[SRCU]
+(* All srcu events *)
+let Srcu = Srcu-lock | Srcu-unlock | Sync-srcu
+
 (* Compute matching pairs of nested Rcu-lock and Rcu-unlock *)
-let matched = let rec
+let rcu-rscs = let rec
 	    unmatched-locks = Rcu-lock \ domain(matched)
 	and unmatched-unlocks = Rcu-unlock \ range(matched)
 	and unmatched = unmatched-locks | unmatched-unlocks
@@ -46,8 +52,27 @@ let matched = let rec
 	in matched
 
 (* Validate nesting *)
-flag ~empty Rcu-lock \ domain(matched) as unbalanced-rcu-locking
-flag ~empty Rcu-unlock \ range(matched) as unbalanced-rcu-locking
+flag ~empty Rcu-lock \ domain(rcu-rscs) as unbalanced-rcu-locking
+flag ~empty Rcu-unlock \ range(rcu-rscs) as unbalanced-rcu-locking
+
+(* Compute matching pairs of nested Srcu-lock and Srcu-unlock *)
+let srcu-rscs = let rec
+	    unmatched-locks = Srcu-lock \ domain(matched)
+	and unmatched-unlocks = Srcu-unlock \ range(matched)
+	and unmatched = unmatched-locks | unmatched-unlocks
+	and unmatched-po = ([unmatched] ; po ; [unmatched]) & loc
+	and unmatched-locks-to-unlocks =
+		([unmatched-locks] ; po ; [unmatched-unlocks]) & loc
+	and matched = matched | (unmatched-locks-to-unlocks \
+		(unmatched-po ; unmatched-po))
+	in matched
+
+(* Validate nesting *)
+flag ~empty Srcu-lock \ domain(srcu-rscs) as unbalanced-srcu-locking
+flag ~empty Srcu-unlock \ range(srcu-rscs) as unbalanced-srcu-locking
+
+(* Check for use of synchronize_srcu() inside an RCU critical section *)
+flag ~empty rcu-rscs & (po ; [Sync-srcu] ; po) as invalid-sleep
 
-(* Outermost level of nesting only *)
-let crit = matched \ (po^-1 ; matched ; po^-1)
+(* Validate SRCU dynamic match *)
+flag ~empty different-values(srcu-rscs) as srcu-bad-nesting
diff --git a/tools/memory-model/linux-kernel.cat b/tools/memory-model/linux-kernel.cat
index 8f23c74a96fd..8dcb37835b61 100644
--- a/tools/memory-model/linux-kernel.cat
+++ b/tools/memory-model/linux-kernel.cat
@@ -33,7 +33,7 @@ let mb = ([M] ; fencerel(Mb) ; [M]) |
 	([M] ; po? ; [LKW] ; fencerel(After-spinlock) ; [M]) |
 	([M] ; po ; [UL] ; (co | po) ; [LKW] ;
 		fencerel(After-unlock-lock) ; [M])
-let gp = po ; [Sync-rcu] ; po?
+let gp = po ; [Sync-rcu | Sync-srcu] ; po?
 
 let strong-fence = mb | gp
 
@@ -91,32 +91,47 @@ acyclic pb as propagation
 (*******)
 
 (*
- * Effect of read-side critical section proceeds from the rcu_read_lock()
- * onward on the one hand and from the rcu_read_unlock() backwards on the
- * other hand.
+ * Effects of read-side critical sections proceed from the rcu_read_unlock()
+ * or srcu_read_unlock() backwards on the one hand, and from the
+ * rcu_read_lock() or srcu_read_lock() forwards on the other hand.
+ *
+ * In the definition of rcu-fence below, the po term at the left-hand side
+ * of each disjunct and the po? term at the right-hand end have been factored
+ * out.  They have been moved into the definitions of rcu-link and rb.
+ * This was necessary in order to apply the "& loc" tests correctly.
  *)
-let rscs = po ; crit^-1 ; po?
+let rcu-gp = [Sync-rcu]		(* Compare with gp *)
+let srcu-gp = [Sync-srcu]
+let rcu-rscsi = rcu-rscs^-1
+let srcu-rscsi = srcu-rscs^-1
 
 (*
  * The synchronize_rcu() strong fence is special in that it can order not
  * one but two non-rf relations, but only in conjunction with an RCU
  * read-side critical section.
  *)
-let rcu-link = hb* ; pb* ; prop
+let rcu-link = po? ; hb* ; pb* ; prop ; po
 
 (*
  * Any sequence containing at least as many grace periods as RCU read-side
  * critical sections (joined by rcu-link) acts as a generalized strong fence.
+ * Likewise for SRCU grace periods and read-side critical sections, provided
+ * the synchronize_srcu() and srcu_read_[un]lock() calls refer to the same
+ * struct srcu_struct location.
  *)
-let rec rcu-fence = gp |
-	(gp ; rcu-link ; rscs) |
-	(rscs ; rcu-link ; gp) |
-	(gp ; rcu-link ; rcu-fence ; rcu-link ; rscs) |
-	(rscs ; rcu-link ; rcu-fence ; rcu-link ; gp) |
+let rec rcu-fence = rcu-gp | srcu-gp |
+	(rcu-gp ; rcu-link ; rcu-rscsi) |
+	((srcu-gp ; rcu-link ; srcu-rscsi) & loc) |
+	(rcu-rscsi ; rcu-link ; rcu-gp) |
+	((srcu-rscsi ; rcu-link ; srcu-gp) & loc) |
+	(rcu-gp ; rcu-link ; rcu-fence ; rcu-link ; rcu-rscsi) |
+	((srcu-gp ; rcu-link ; rcu-fence ; rcu-link ; srcu-rscsi) & loc) |
+	(rcu-rscsi ; rcu-link ; rcu-fence ; rcu-link ; rcu-gp) |
+	((srcu-rscsi ; rcu-link ; rcu-fence ; rcu-link ; srcu-gp) & loc) |
 	(rcu-fence ; rcu-link ; rcu-fence)
 
 (* rb orders instructions just as pb does *)
-let rb = prop ; rcu-fence ; hb* ; pb*
+let rb = prop ; po ; rcu-fence ; po? ; hb* ; pb*
 
 irreflexive rb as rcu
 
diff --git a/tools/memory-model/linux-kernel.def b/tools/memory-model/linux-kernel.def
index b27911cc087d..0c3f0ef486f4 100644
--- a/tools/memory-model/linux-kernel.def
+++ b/tools/memory-model/linux-kernel.def
@@ -47,6 +47,11 @@ rcu_read_unlock() { __fence{rcu-unlock}; }
 synchronize_rcu() { __fence{sync-rcu}; }
 synchronize_rcu_expedited() { __fence{sync-rcu}; }
 
+// SRCU
+srcu_read_lock(X)  __srcu{srcu-lock}(X)
+srcu_read_unlock(X,Y) { __srcu{srcu-unlock}(X,Y); }
+synchronize_srcu(X)  { __srcu{sync-srcu}(X); }
+
 // Atomic
 atomic_read(X) READ_ONCE(*X)
 atomic_set(X,V) { WRITE_ONCE(*X,V); }
diff --git a/tools/memory-model/lock.cat b/tools/memory-model/lock.cat
index 305ded17e741..a059d1a6d8a2 100644
--- a/tools/memory-model/lock.cat
+++ b/tools/memory-model/lock.cat
@@ -6,9 +6,6 @@
 
 (*
  * Generate coherence orders and handle lock operations
- *
- * Warning: spin_is_locked() crashes herd7 versions strictly before 7.48.
- * spin_is_locked() is functional from herd7 version 7.49.
  *)
 
 include "cross.cat"
diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h
index c9433a496d54..c81fc350f7ad 100644
--- a/tools/testing/selftests/bpf/bpf_helpers.h
+++ b/tools/testing/selftests/bpf/bpf_helpers.h
@@ -180,6 +180,8 @@ static struct bpf_sock *(*bpf_sk_fullsock)(struct bpf_sock *sk) =
 	(void *) BPF_FUNC_sk_fullsock;
 static struct bpf_tcp_sock *(*bpf_tcp_sock)(struct bpf_sock *sk) =
 	(void *) BPF_FUNC_tcp_sock;
+static struct bpf_sock *(*bpf_get_listener_sock)(struct bpf_sock *sk) =
+	(void *) BPF_FUNC_get_listener_sock;
 static int (*bpf_skb_ecn_set_ce)(void *ctx) =
 	(void *) BPF_FUNC_skb_ecn_set_ce;
 
diff --git a/tools/testing/selftests/bpf/prog_tests/map_lock.c b/tools/testing/selftests/bpf/prog_tests/map_lock.c
index 90f8a206340a..ee99368c595c 100644
--- a/tools/testing/selftests/bpf/prog_tests/map_lock.c
+++ b/tools/testing/selftests/bpf/prog_tests/map_lock.c
@@ -37,7 +37,7 @@ void test_map_lock(void)
 	const char *file = "./test_map_lock.o";
 	int prog_fd, map_fd[2], vars[17] = {};
 	pthread_t thread_id[6];
-	struct bpf_object *obj;
+	struct bpf_object *obj = NULL;
 	int err = 0, key = 0, i;
 	void *ret;
 
diff --git a/tools/testing/selftests/bpf/prog_tests/spinlock.c b/tools/testing/selftests/bpf/prog_tests/spinlock.c
index 9a573a9675d7..114ebe6a438e 100644
--- a/tools/testing/selftests/bpf/prog_tests/spinlock.c
+++ b/tools/testing/selftests/bpf/prog_tests/spinlock.c
@@ -5,7 +5,7 @@ void test_spinlock(void)
 {
 	const char *file = "./test_spin_lock.o";
 	pthread_t thread_id[4];
-	struct bpf_object *obj;
+	struct bpf_object *obj = NULL;
 	int prog_fd;
 	int err = 0, i;
 	void *ret;
diff --git a/tools/testing/selftests/bpf/progs/test_sock_fields_kern.c b/tools/testing/selftests/bpf/progs/test_sock_fields_kern.c
index de1a43e8f610..37328f148538 100644
--- a/tools/testing/selftests/bpf/progs/test_sock_fields_kern.c
+++ b/tools/testing/selftests/bpf/progs/test_sock_fields_kern.c
@@ -8,38 +8,51 @@
 #include "bpf_helpers.h"
 #include "bpf_endian.h"
 
-enum bpf_array_idx {
-	SRV_IDX,
-	CLI_IDX,
-	__NR_BPF_ARRAY_IDX,
+enum bpf_addr_array_idx {
+	ADDR_SRV_IDX,
+	ADDR_CLI_IDX,
+	__NR_BPF_ADDR_ARRAY_IDX,
+};
+
+enum bpf_result_array_idx {
+	EGRESS_SRV_IDX,
+	EGRESS_CLI_IDX,
+	INGRESS_LISTEN_IDX,
+	__NR_BPF_RESULT_ARRAY_IDX,
+};
+
+enum bpf_linum_array_idx {
+	EGRESS_LINUM_IDX,
+	INGRESS_LINUM_IDX,
+	__NR_BPF_LINUM_ARRAY_IDX,
 };
 
 struct bpf_map_def SEC("maps") addr_map = {
 	.type = BPF_MAP_TYPE_ARRAY,
 	.key_size = sizeof(__u32),
 	.value_size = sizeof(struct sockaddr_in6),
-	.max_entries = __NR_BPF_ARRAY_IDX,
+	.max_entries = __NR_BPF_ADDR_ARRAY_IDX,
 };
 
 struct bpf_map_def SEC("maps") sock_result_map = {
 	.type = BPF_MAP_TYPE_ARRAY,
 	.key_size = sizeof(__u32),
 	.value_size = sizeof(struct bpf_sock),
-	.max_entries = __NR_BPF_ARRAY_IDX,
+	.max_entries = __NR_BPF_RESULT_ARRAY_IDX,
 };
 
 struct bpf_map_def SEC("maps") tcp_sock_result_map = {
 	.type = BPF_MAP_TYPE_ARRAY,
 	.key_size = sizeof(__u32),
 	.value_size = sizeof(struct bpf_tcp_sock),
-	.max_entries = __NR_BPF_ARRAY_IDX,
+	.max_entries = __NR_BPF_RESULT_ARRAY_IDX,
 };
 
 struct bpf_map_def SEC("maps") linum_map = {
 	.type = BPF_MAP_TYPE_ARRAY,
 	.key_size = sizeof(__u32),
 	.value_size = sizeof(__u32),
-	.max_entries = 1,
+	.max_entries = __NR_BPF_LINUM_ARRAY_IDX,
 };
 
 static bool is_loopback6(__u32 *a6)
@@ -100,18 +113,20 @@ static void tpcpy(struct bpf_tcp_sock *dst,
 
 #define RETURN {						\
 	linum = __LINE__;					\
-	bpf_map_update_elem(&linum_map, &idx0, &linum, 0);	\
+	bpf_map_update_elem(&linum_map, &linum_idx, &linum, 0);	\
 	return 1;						\
 }
 
 SEC("cgroup_skb/egress")
-int read_sock_fields(struct __sk_buff *skb)
+int egress_read_sock_fields(struct __sk_buff *skb)
 {
-	__u32 srv_idx = SRV_IDX, cli_idx = CLI_IDX, idx;
+	__u32 srv_idx = ADDR_SRV_IDX, cli_idx = ADDR_CLI_IDX, result_idx;
 	struct sockaddr_in6 *srv_sa6, *cli_sa6;
 	struct bpf_tcp_sock *tp, *tp_ret;
 	struct bpf_sock *sk, *sk_ret;
-	__u32 linum, idx0 = 0;
+	__u32 linum, linum_idx;
+
+	linum_idx = EGRESS_LINUM_IDX;
 
 	sk = skb->sk;
 	if (!sk || sk->state == 10)
@@ -132,14 +147,55 @@ int read_sock_fields(struct __sk_buff *skb)
 		RETURN;
 
 	if (sk->src_port == bpf_ntohs(srv_sa6->sin6_port))
-		idx = srv_idx;
+		result_idx = EGRESS_SRV_IDX;
 	else if (sk->src_port == bpf_ntohs(cli_sa6->sin6_port))
-		idx = cli_idx;
+		result_idx = EGRESS_CLI_IDX;
 	else
 		RETURN;
 
-	sk_ret = bpf_map_lookup_elem(&sock_result_map, &idx);
-	tp_ret = bpf_map_lookup_elem(&tcp_sock_result_map, &idx);
+	sk_ret = bpf_map_lookup_elem(&sock_result_map, &result_idx);
+	tp_ret = bpf_map_lookup_elem(&tcp_sock_result_map, &result_idx);
+	if (!sk_ret || !tp_ret)
+		RETURN;
+
+	skcpy(sk_ret, sk);
+	tpcpy(tp_ret, tp);
+
+	RETURN;
+}
+
+SEC("cgroup_skb/ingress")
+int ingress_read_sock_fields(struct __sk_buff *skb)
+{
+	__u32 srv_idx = ADDR_SRV_IDX, result_idx = INGRESS_LISTEN_IDX;
+	struct bpf_tcp_sock *tp, *tp_ret;
+	struct bpf_sock *sk, *sk_ret;
+	struct sockaddr_in6 *srv_sa6;
+	__u32 linum, linum_idx;
+
+	linum_idx = INGRESS_LINUM_IDX;
+
+	sk = skb->sk;
+	if (!sk || sk->family != AF_INET6 || !is_loopback6(sk->src_ip6))
+		RETURN;
+
+	srv_sa6 = bpf_map_lookup_elem(&addr_map, &srv_idx);
+	if (!srv_sa6 || sk->src_port != bpf_ntohs(srv_sa6->sin6_port))
+		RETURN;
+
+	if (sk->state != 10 && sk->state != 12)
+		RETURN;
+
+	sk = bpf_get_listener_sock(sk);
+	if (!sk)
+		RETURN;
+
+	tp = bpf_tcp_sock(sk);
+	if (!tp)
+		RETURN;
+
+	sk_ret = bpf_map_lookup_elem(&sock_result_map, &result_idx);
+	tp_ret = bpf_map_lookup_elem(&tcp_sock_result_map, &result_idx);
 	if (!sk_ret || !tp_ret)
 		RETURN;
 
diff --git a/tools/testing/selftests/bpf/test_btf.c b/tools/testing/selftests/bpf/test_btf.c
index 38797aa627a7..23e3b314ca60 100644
--- a/tools/testing/selftests/bpf/test_btf.c
+++ b/tools/testing/selftests/bpf/test_btf.c
@@ -5874,6 +5874,50 @@ const struct btf_dedup_test dedup_tests[] = {
 		.dont_resolve_fwds = false,
 	},
 },
+{
+	.descr = "dedup: enum fwd resolution",
+	.input = {
+		.raw_types = {
+			/* [1] fwd enum 'e1' before full enum */
+			BTF_TYPE_ENC(NAME_NTH(1), BTF_INFO_ENC(BTF_KIND_ENUM, 0, 0), 4),
+			/* [2] full enum 'e1' after fwd */
+			BTF_TYPE_ENC(NAME_NTH(1), BTF_INFO_ENC(BTF_KIND_ENUM, 0, 1), 4),
+				BTF_ENUM_ENC(NAME_NTH(2), 123),
+			/* [3] full enum 'e2' before fwd */
+			BTF_TYPE_ENC(NAME_NTH(3), BTF_INFO_ENC(BTF_KIND_ENUM, 0, 1), 4),
+				BTF_ENUM_ENC(NAME_NTH(4), 456),
+			/* [4] fwd enum 'e2' after full enum */
+			BTF_TYPE_ENC(NAME_NTH(3), BTF_INFO_ENC(BTF_KIND_ENUM, 0, 0), 4),
+			/* [5] incompatible fwd enum with different size */
+			BTF_TYPE_ENC(NAME_NTH(1), BTF_INFO_ENC(BTF_KIND_ENUM, 0, 0), 1),
+			/* [6] incompatible full enum with different value */
+			BTF_TYPE_ENC(NAME_NTH(1), BTF_INFO_ENC(BTF_KIND_ENUM, 0, 1), 4),
+				BTF_ENUM_ENC(NAME_NTH(2), 321),
+			BTF_END_RAW,
+		},
+		BTF_STR_SEC("\0e1\0e1_val\0e2\0e2_val"),
+	},
+	.expect = {
+		.raw_types = {
+			/* [1] full enum 'e1' */
+			BTF_TYPE_ENC(NAME_NTH(1), BTF_INFO_ENC(BTF_KIND_ENUM, 0, 1), 4),
+				BTF_ENUM_ENC(NAME_NTH(2), 123),
+			/* [2] full enum 'e2' */
+			BTF_TYPE_ENC(NAME_NTH(3), BTF_INFO_ENC(BTF_KIND_ENUM, 0, 1), 4),
+				BTF_ENUM_ENC(NAME_NTH(4), 456),
+			/* [3] incompatible fwd enum with different size */
+			BTF_TYPE_ENC(NAME_NTH(1), BTF_INFO_ENC(BTF_KIND_ENUM, 0, 0), 1),
+			/* [4] incompatible full enum with different value */
+			BTF_TYPE_ENC(NAME_NTH(1), BTF_INFO_ENC(BTF_KIND_ENUM, 0, 1), 4),
+				BTF_ENUM_ENC(NAME_NTH(2), 321),
+			BTF_END_RAW,
+		},
+		BTF_STR_SEC("\0e1\0e1_val\0e2\0e2_val"),
+	},
+	.opts = {
+		.dont_resolve_fwds = false,
+	},
+},
 
 };
 
diff --git a/tools/testing/selftests/bpf/test_sock_fields.c b/tools/testing/selftests/bpf/test_sock_fields.c
index bc8943938bf5..dcae7f664dce 100644
--- a/tools/testing/selftests/bpf/test_sock_fields.c
+++ b/tools/testing/selftests/bpf/test_sock_fields.c
@@ -16,10 +16,23 @@
 #include "cgroup_helpers.h"
 #include "bpf_rlimit.h"
 
-enum bpf_array_idx {
-	SRV_IDX,
-	CLI_IDX,
-	__NR_BPF_ARRAY_IDX,
+enum bpf_addr_array_idx {
+	ADDR_SRV_IDX,
+	ADDR_CLI_IDX,
+	__NR_BPF_ADDR_ARRAY_IDX,
+};
+
+enum bpf_result_array_idx {
+	EGRESS_SRV_IDX,
+	EGRESS_CLI_IDX,
+	INGRESS_LISTEN_IDX,
+	__NR_BPF_RESULT_ARRAY_IDX,
+};
+
+enum bpf_linum_array_idx {
+	EGRESS_LINUM_IDX,
+	INGRESS_LINUM_IDX,
+	__NR_BPF_LINUM_ARRAY_IDX,
 };
 
 #define CHECK(condition, tag, format...) ({				\
@@ -41,8 +54,16 @@ static int linum_map_fd;
 static int addr_map_fd;
 static int tp_map_fd;
 static int sk_map_fd;
-static __u32 srv_idx = SRV_IDX;
-static __u32 cli_idx = CLI_IDX;
+
+static __u32 addr_srv_idx = ADDR_SRV_IDX;
+static __u32 addr_cli_idx = ADDR_CLI_IDX;
+
+static __u32 egress_srv_idx = EGRESS_SRV_IDX;
+static __u32 egress_cli_idx = EGRESS_CLI_IDX;
+static __u32 ingress_listen_idx = INGRESS_LISTEN_IDX;
+
+static __u32 egress_linum_idx = EGRESS_LINUM_IDX;
+static __u32 ingress_linum_idx = INGRESS_LINUM_IDX;
 
 static void init_loopback6(struct sockaddr_in6 *sa6)
 {
@@ -93,29 +114,46 @@ static void print_tp(const struct bpf_tcp_sock *tp)
 
 static void check_result(void)
 {
-	struct bpf_tcp_sock srv_tp, cli_tp;
-	struct bpf_sock srv_sk, cli_sk;
-	__u32 linum, idx0 = 0;
+	struct bpf_tcp_sock srv_tp, cli_tp, listen_tp;
+	struct bpf_sock srv_sk, cli_sk, listen_sk;
+	__u32 ingress_linum, egress_linum;
 	int err;
 
-	err = bpf_map_lookup_elem(linum_map_fd, &idx0, &linum);
+	err = bpf_map_lookup_elem(linum_map_fd, &egress_linum_idx,
+				  &egress_linum);
 	CHECK(err == -1, "bpf_map_lookup_elem(linum_map_fd)",
 	      "err:%d errno:%d", err, errno);
 
-	err = bpf_map_lookup_elem(sk_map_fd, &srv_idx, &srv_sk);
-	CHECK(err == -1, "bpf_map_lookup_elem(sk_map_fd, &srv_idx)",
+	err = bpf_map_lookup_elem(linum_map_fd, &ingress_linum_idx,
+				  &ingress_linum);
+	CHECK(err == -1, "bpf_map_lookup_elem(linum_map_fd)",
+	      "err:%d errno:%d", err, errno);
+
+	err = bpf_map_lookup_elem(sk_map_fd, &egress_srv_idx, &srv_sk);
+	CHECK(err == -1, "bpf_map_lookup_elem(sk_map_fd, &egress_srv_idx)",
+	      "err:%d errno:%d", err, errno);
+	err = bpf_map_lookup_elem(tp_map_fd, &egress_srv_idx, &srv_tp);
+	CHECK(err == -1, "bpf_map_lookup_elem(tp_map_fd, &egress_srv_idx)",
+	      "err:%d errno:%d", err, errno);
+
+	err = bpf_map_lookup_elem(sk_map_fd, &egress_cli_idx, &cli_sk);
+	CHECK(err == -1, "bpf_map_lookup_elem(sk_map_fd, &egress_cli_idx)",
 	      "err:%d errno:%d", err, errno);
-	err = bpf_map_lookup_elem(tp_map_fd, &srv_idx, &srv_tp);
-	CHECK(err == -1, "bpf_map_lookup_elem(tp_map_fd, &srv_idx)",
+	err = bpf_map_lookup_elem(tp_map_fd, &egress_cli_idx, &cli_tp);
+	CHECK(err == -1, "bpf_map_lookup_elem(tp_map_fd, &egress_cli_idx)",
 	      "err:%d errno:%d", err, errno);
 
-	err = bpf_map_lookup_elem(sk_map_fd, &cli_idx, &cli_sk);
-	CHECK(err == -1, "bpf_map_lookup_elem(sk_map_fd, &cli_idx)",
+	err = bpf_map_lookup_elem(sk_map_fd, &ingress_listen_idx, &listen_sk);
+	CHECK(err == -1, "bpf_map_lookup_elem(sk_map_fd, &ingress_listen_idx)",
 	      "err:%d errno:%d", err, errno);
-	err = bpf_map_lookup_elem(tp_map_fd, &cli_idx, &cli_tp);
-	CHECK(err == -1, "bpf_map_lookup_elem(tp_map_fd, &cli_idx)",
+	err = bpf_map_lookup_elem(tp_map_fd, &ingress_listen_idx, &listen_tp);
+	CHECK(err == -1, "bpf_map_lookup_elem(tp_map_fd, &ingress_listen_idx)",
 	      "err:%d errno:%d", err, errno);
 
+	printf("listen_sk: ");
+	print_sk(&listen_sk);
+	printf("\n");
+
 	printf("srv_sk: ");
 	print_sk(&srv_sk);
 	printf("\n");
@@ -124,6 +162,10 @@ static void check_result(void)
 	print_sk(&cli_sk);
 	printf("\n");
 
+	printf("listen_tp: ");
+	print_tp(&listen_tp);
+	printf("\n");
+
 	printf("srv_tp: ");
 	print_tp(&srv_tp);
 	printf("\n");
@@ -132,6 +174,19 @@ static void check_result(void)
 	print_tp(&cli_tp);
 	printf("\n");
 
+	CHECK(listen_sk.state != 10 ||
+	      listen_sk.family != AF_INET6 ||
+	      listen_sk.protocol != IPPROTO_TCP ||
+	      memcmp(listen_sk.src_ip6, &in6addr_loopback,
+		     sizeof(listen_sk.src_ip6)) ||
+	      listen_sk.dst_ip6[0] || listen_sk.dst_ip6[1] ||
+	      listen_sk.dst_ip6[2] || listen_sk.dst_ip6[3] ||
+	      listen_sk.src_port != ntohs(srv_sa6.sin6_port) ||
+	      listen_sk.dst_port,
+	      "Unexpected listen_sk",
+	      "Check listen_sk output. ingress_linum:%u",
+	      ingress_linum);
+
 	CHECK(srv_sk.state == 10 ||
 	      !srv_sk.state ||
 	      srv_sk.family != AF_INET6 ||
@@ -142,7 +197,8 @@ static void check_result(void)
 		     sizeof(srv_sk.dst_ip6)) ||
 	      srv_sk.src_port != ntohs(srv_sa6.sin6_port) ||
 	      srv_sk.dst_port != cli_sa6.sin6_port,
-	      "Unexpected srv_sk", "Check srv_sk output. linum:%u", linum);
+	      "Unexpected srv_sk", "Check srv_sk output. egress_linum:%u",
+	      egress_linum);
 
 	CHECK(cli_sk.state == 10 ||
 	      !cli_sk.state ||
@@ -154,21 +210,31 @@ static void check_result(void)
 		     sizeof(cli_sk.dst_ip6)) ||
 	      cli_sk.src_port != ntohs(cli_sa6.sin6_port) ||
 	      cli_sk.dst_port != srv_sa6.sin6_port,
-	      "Unexpected cli_sk", "Check cli_sk output. linum:%u", linum);
+	      "Unexpected cli_sk", "Check cli_sk output. egress_linum:%u",
+	      egress_linum);
+
+	CHECK(listen_tp.data_segs_out ||
+	      listen_tp.data_segs_in ||
+	      listen_tp.total_retrans ||
+	      listen_tp.bytes_acked,
+	      "Unexpected listen_tp", "Check listen_tp output. ingress_linum:%u",
+	      ingress_linum);
 
 	CHECK(srv_tp.data_segs_out != 1 ||
 	      srv_tp.data_segs_in ||
 	      srv_tp.snd_cwnd != 10 ||
 	      srv_tp.total_retrans ||
 	      srv_tp.bytes_acked != DATA_LEN,
-	      "Unexpected srv_tp", "Check srv_tp output. linum:%u", linum);
+	      "Unexpected srv_tp", "Check srv_tp output. egress_linum:%u",
+	      egress_linum);
 
 	CHECK(cli_tp.data_segs_out ||
 	      cli_tp.data_segs_in != 1 ||
 	      cli_tp.snd_cwnd != 10 ||
 	      cli_tp.total_retrans ||
 	      cli_tp.bytes_received != DATA_LEN,
-	      "Unexpected cli_tp", "Check cli_tp output. linum:%u", linum);
+	      "Unexpected cli_tp", "Check cli_tp output. egress_linum:%u",
+	      egress_linum);
 }
 
 static void test(void)
@@ -211,10 +277,10 @@ static void test(void)
 	      err, errno);
 
 	/* Update addr_map with srv_sa6 and cli_sa6 */
-	err = bpf_map_update_elem(addr_map_fd, &srv_idx, &srv_sa6, 0);
+	err = bpf_map_update_elem(addr_map_fd, &addr_srv_idx, &srv_sa6, 0);
 	CHECK(err, "map_update", "err:%d errno:%d", err, errno);
 
-	err = bpf_map_update_elem(addr_map_fd, &cli_idx, &cli_sa6, 0);
+	err = bpf_map_update_elem(addr_map_fd, &addr_cli_idx, &cli_sa6, 0);
 	CHECK(err, "map_update", "err:%d errno:%d", err, errno);
 
 	/* Connect from cli_sa6 to srv_sa6 */
@@ -273,9 +339,9 @@ int main(int argc, char **argv)
 	struct bpf_prog_load_attr attr = {
 		.file = "test_sock_fields_kern.o",
 		.prog_type = BPF_PROG_TYPE_CGROUP_SKB,
-		.expected_attach_type = BPF_CGROUP_INET_EGRESS,
 	};
-	int cgroup_fd, prog_fd, err;
+	int cgroup_fd, egress_fd, ingress_fd, err;
+	struct bpf_program *ingress_prog;
 	struct bpf_object *obj;
 	struct bpf_map *map;
 
@@ -293,12 +359,24 @@ int main(int argc, char **argv)
 	err = join_cgroup(TEST_CGROUP);
 	CHECK(err, "join_cgroup", "err:%d errno:%d", err, errno);
 
-	err = bpf_prog_load_xattr(&attr, &obj, &prog_fd);
+	err = bpf_prog_load_xattr(&attr, &obj, &egress_fd);
 	CHECK(err, "bpf_prog_load_xattr()", "err:%d", err);
 
-	err = bpf_prog_attach(prog_fd, cgroup_fd, BPF_CGROUP_INET_EGRESS, 0);
+	ingress_prog = bpf_object__find_program_by_title(obj,
+							 "cgroup_skb/ingress");
+	CHECK(!ingress_prog,
+	      "bpf_object__find_program_by_title(cgroup_skb/ingress)",
+	      "not found");
+	ingress_fd = bpf_program__fd(ingress_prog);
+
+	err = bpf_prog_attach(egress_fd, cgroup_fd, BPF_CGROUP_INET_EGRESS, 0);
 	CHECK(err == -1, "bpf_prog_attach(CPF_CGROUP_INET_EGRESS)",
 	      "err:%d errno%d", err, errno);
+
+	err = bpf_prog_attach(ingress_fd, cgroup_fd,
+			      BPF_CGROUP_INET_INGRESS, 0);
+	CHECK(err == -1, "bpf_prog_attach(CPF_CGROUP_INET_INGRESS)",
+	      "err:%d errno%d", err, errno);
 	close(cgroup_fd);
 
 	map = bpf_object__find_map_by_name(obj, "addr_map");
diff --git a/tools/testing/selftests/bpf/verifier/ref_tracking.c b/tools/testing/selftests/bpf/verifier/ref_tracking.c
index 3ed3593bd8b6..923f2110072d 100644
--- a/tools/testing/selftests/bpf/verifier/ref_tracking.c
+++ b/tools/testing/selftests/bpf/verifier/ref_tracking.c
@@ -605,3 +605,171 @@
 	.prog_type = BPF_PROG_TYPE_SCHED_CLS,
 	.result = ACCEPT,
 },
+{
+	"reference tracking: use ptr from bpf_tcp_sock() after release",
+	.insns = {
+	BPF_SK_LOOKUP,
+	BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 1),
+	BPF_EXIT_INSN(),
+	BPF_MOV64_REG(BPF_REG_6, BPF_REG_0),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
+	BPF_EMIT_CALL(BPF_FUNC_tcp_sock),
+	BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 3),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
+	BPF_EMIT_CALL(BPF_FUNC_sk_release),
+	BPF_EXIT_INSN(),
+	BPF_MOV64_REG(BPF_REG_7, BPF_REG_0),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
+	BPF_EMIT_CALL(BPF_FUNC_sk_release),
+	BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_7, offsetof(struct bpf_tcp_sock, snd_cwnd)),
+	BPF_EXIT_INSN(),
+	},
+	.prog_type = BPF_PROG_TYPE_SCHED_CLS,
+	.result = REJECT,
+	.errstr = "invalid mem access",
+},
+{
+	"reference tracking: use ptr from bpf_sk_fullsock() after release",
+	.insns = {
+	BPF_SK_LOOKUP,
+	BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 1),
+	BPF_EXIT_INSN(),
+	BPF_MOV64_REG(BPF_REG_6, BPF_REG_0),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
+	BPF_EMIT_CALL(BPF_FUNC_sk_fullsock),
+	BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 3),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
+	BPF_EMIT_CALL(BPF_FUNC_sk_release),
+	BPF_EXIT_INSN(),
+	BPF_MOV64_REG(BPF_REG_7, BPF_REG_0),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
+	BPF_EMIT_CALL(BPF_FUNC_sk_release),
+	BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_7, offsetof(struct bpf_sock, type)),
+	BPF_EXIT_INSN(),
+	},
+	.prog_type = BPF_PROG_TYPE_SCHED_CLS,
+	.result = REJECT,
+	.errstr = "invalid mem access",
+},
+{
+	"reference tracking: use ptr from bpf_sk_fullsock(tp) after release",
+	.insns = {
+	BPF_SK_LOOKUP,
+	BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 1),
+	BPF_EXIT_INSN(),
+	BPF_MOV64_REG(BPF_REG_6, BPF_REG_0),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
+	BPF_EMIT_CALL(BPF_FUNC_tcp_sock),
+	BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 3),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
+	BPF_EMIT_CALL(BPF_FUNC_sk_release),
+	BPF_EXIT_INSN(),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
+	BPF_EMIT_CALL(BPF_FUNC_sk_fullsock),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
+	BPF_MOV64_REG(BPF_REG_6, BPF_REG_0),
+	BPF_EMIT_CALL(BPF_FUNC_sk_release),
+	BPF_JMP_IMM(BPF_JNE, BPF_REG_6, 0, 1),
+	BPF_EXIT_INSN(),
+	BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_6, offsetof(struct bpf_sock, type)),
+	BPF_EXIT_INSN(),
+	},
+	.prog_type = BPF_PROG_TYPE_SCHED_CLS,
+	.result = REJECT,
+	.errstr = "invalid mem access",
+},
+{
+	"reference tracking: use sk after bpf_sk_release(tp)",
+	.insns = {
+	BPF_SK_LOOKUP,
+	BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 1),
+	BPF_EXIT_INSN(),
+	BPF_MOV64_REG(BPF_REG_6, BPF_REG_0),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
+	BPF_EMIT_CALL(BPF_FUNC_tcp_sock),
+	BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 3),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
+	BPF_EMIT_CALL(BPF_FUNC_sk_release),
+	BPF_EXIT_INSN(),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
+	BPF_EMIT_CALL(BPF_FUNC_sk_release),
+	BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_6, offsetof(struct bpf_sock, type)),
+	BPF_EXIT_INSN(),
+	},
+	.prog_type = BPF_PROG_TYPE_SCHED_CLS,
+	.result = REJECT,
+	.errstr = "invalid mem access",
+},
+{
+	"reference tracking: use ptr from bpf_get_listener_sock() after bpf_sk_release(sk)",
+	.insns = {
+	BPF_SK_LOOKUP,
+	BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 1),
+	BPF_EXIT_INSN(),
+	BPF_MOV64_REG(BPF_REG_6, BPF_REG_0),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
+	BPF_EMIT_CALL(BPF_FUNC_get_listener_sock),
+	BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 3),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
+	BPF_EMIT_CALL(BPF_FUNC_sk_release),
+	BPF_EXIT_INSN(),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
+	BPF_MOV64_REG(BPF_REG_6, BPF_REG_0),
+	BPF_EMIT_CALL(BPF_FUNC_sk_release),
+	BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_6, offsetof(struct bpf_sock, src_port)),
+	BPF_EXIT_INSN(),
+	},
+	.prog_type = BPF_PROG_TYPE_SCHED_CLS,
+	.result = ACCEPT,
+},
+{
+	"reference tracking: bpf_sk_release(listen_sk)",
+	.insns = {
+	BPF_SK_LOOKUP,
+	BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 1),
+	BPF_EXIT_INSN(),
+	BPF_MOV64_REG(BPF_REG_6, BPF_REG_0),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
+	BPF_EMIT_CALL(BPF_FUNC_get_listener_sock),
+	BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 3),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
+	BPF_EMIT_CALL(BPF_FUNC_sk_release),
+	BPF_EXIT_INSN(),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
+	BPF_EMIT_CALL(BPF_FUNC_sk_release),
+	BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_6, offsetof(struct bpf_sock, type)),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
+	BPF_EMIT_CALL(BPF_FUNC_sk_release),
+	BPF_EXIT_INSN(),
+	},
+	.prog_type = BPF_PROG_TYPE_SCHED_CLS,
+	.result = REJECT,
+	.errstr = "reference has not been acquired before",
+},
+{
+	/* !bpf_sk_fullsock(sk) is checked but !bpf_tcp_sock(sk) is not checked */
+	"reference tracking: tp->snd_cwnd after bpf_sk_fullsock(sk) and bpf_tcp_sock(sk)",
+	.insns = {
+	BPF_SK_LOOKUP,
+	BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 1),
+	BPF_EXIT_INSN(),
+	BPF_MOV64_REG(BPF_REG_6, BPF_REG_0),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
+	BPF_EMIT_CALL(BPF_FUNC_sk_fullsock),
+	BPF_MOV64_REG(BPF_REG_7, BPF_REG_0),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
+	BPF_EMIT_CALL(BPF_FUNC_tcp_sock),
+	BPF_MOV64_REG(BPF_REG_8, BPF_REG_0),
+	BPF_JMP_IMM(BPF_JNE, BPF_REG_7, 0, 3),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
+	BPF_EMIT_CALL(BPF_FUNC_sk_release),
+	BPF_EXIT_INSN(),
+	BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_8, offsetof(struct bpf_tcp_sock, snd_cwnd)),
+	BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
+	BPF_EMIT_CALL(BPF_FUNC_sk_release),
+	BPF_EXIT_INSN(),
+	},
+	.prog_type = BPF_PROG_TYPE_SCHED_CLS,
+	.result = REJECT,
+	.errstr = "invalid mem access",
+},
diff --git a/tools/testing/selftests/bpf/verifier/sock.c b/tools/testing/selftests/bpf/verifier/sock.c
index 0ddfdf76aba5..416436231fab 100644
--- a/tools/testing/selftests/bpf/verifier/sock.c
+++ b/tools/testing/selftests/bpf/verifier/sock.c
@@ -342,7 +342,7 @@
 	},
 	.prog_type = BPF_PROG_TYPE_SCHED_CLS,
 	.result = REJECT,
-	.errstr = "type=sock_common expected=sock",
+	.errstr = "reference has not been acquired before",
 },
 {
 	"bpf_sk_release(bpf_sk_fullsock(skb->sk))",
@@ -380,5 +380,5 @@
 	},
 	.prog_type = BPF_PROG_TYPE_SCHED_CLS,
 	.result = REJECT,
-	.errstr = "type=tcp_sock expected=sock",
+	.errstr = "reference has not been acquired before",
 },
diff --git a/tools/testing/selftests/ntb/ntb_test.sh b/tools/testing/selftests/ntb/ntb_test.sh
index 08cbfbbc7029..17ca36403d04 100755
--- a/tools/testing/selftests/ntb/ntb_test.sh
+++ b/tools/testing/selftests/ntb/ntb_test.sh
@@ -250,7 +250,7 @@ function get_files_count()
 	split_remote $LOC
 
 	if [[ "$REMOTE" == "" ]]; then
-		echo $(ls -1 "$LOC"/${NAME}* 2>/dev/null | wc -l)
+		echo $(ls -1 "$VPATH"/${NAME}* 2>/dev/null | wc -l)
 	else
 		echo $(ssh "$REMOTE" "ls -1 \"$VPATH\"/${NAME}* | \
 		       wc -l" 2> /dev/null)
diff --git a/tools/testing/selftests/tpm2/tpm2.py b/tools/testing/selftests/tpm2/tpm2.py
index 40ea95ce2ead..828c18584624 100644
--- a/tools/testing/selftests/tpm2/tpm2.py
+++ b/tools/testing/selftests/tpm2/tpm2.py
@@ -22,6 +22,7 @@ TPM2_CC_UNSEAL = 0x015E
 TPM2_CC_FLUSH_CONTEXT = 0x0165
 TPM2_CC_START_AUTH_SESSION = 0x0176
 TPM2_CC_GET_CAPABILITY	= 0x017A
+TPM2_CC_GET_RANDOM = 0x017B
 TPM2_CC_PCR_READ = 0x017E
 TPM2_CC_POLICY_PCR = 0x017F
 TPM2_CC_PCR_EXTEND = 0x0182
@@ -357,9 +358,9 @@ class Client:
         self.flags = flags
 
         if (self.flags & Client.FLAG_SPACE) == 0:
-            self.tpm = open('/dev/tpm0', 'r+b')
+            self.tpm = open('/dev/tpm0', 'r+b', buffering=0)
         else:
-            self.tpm = open('/dev/tpmrm0', 'r+b')
+            self.tpm = open('/dev/tpmrm0', 'r+b', buffering=0)
 
     def close(self):
         self.tpm.close()
diff --git a/tools/testing/selftests/tpm2/tpm2_tests.py b/tools/testing/selftests/tpm2/tpm2_tests.py
index 3bb066fea4a0..d4973be53493 100644
--- a/tools/testing/selftests/tpm2/tpm2_tests.py
+++ b/tools/testing/selftests/tpm2/tpm2_tests.py
@@ -158,6 +158,69 @@ class SmokeTest(unittest.TestCase):
             pass
         self.assertEqual(rejected, True)
 
+    def test_read_partial_resp(self):
+        try:
+            fmt = '>HIIH'
+            cmd = struct.pack(fmt,
+                              tpm2.TPM2_ST_NO_SESSIONS,
+                              struct.calcsize(fmt),
+                              tpm2.TPM2_CC_GET_RANDOM,
+                              0x20)
+            self.client.tpm.write(cmd)
+            hdr = self.client.tpm.read(10)
+            sz = struct.unpack('>I', hdr[2:6])[0]
+            rsp = self.client.tpm.read()
+        except:
+            pass
+        self.assertEqual(sz, 10 + 2 + 32)
+        self.assertEqual(len(rsp), 2 + 32)
+
+    def test_read_partial_overwrite(self):
+        try:
+            fmt = '>HIIH'
+            cmd = struct.pack(fmt,
+                              tpm2.TPM2_ST_NO_SESSIONS,
+                              struct.calcsize(fmt),
+                              tpm2.TPM2_CC_GET_RANDOM,
+                              0x20)
+            self.client.tpm.write(cmd)
+            # Read part of the respone
+            rsp1 = self.client.tpm.read(15)
+
+            # Send a new cmd
+            self.client.tpm.write(cmd)
+
+            # Read the whole respone
+            rsp2 = self.client.tpm.read()
+        except:
+            pass
+        self.assertEqual(len(rsp1), 15)
+        self.assertEqual(len(rsp2), 10 + 2 + 32)
+
+    def test_send_two_cmds(self):
+        rejected = False
+        try:
+            fmt = '>HIIH'
+            cmd = struct.pack(fmt,
+                              tpm2.TPM2_ST_NO_SESSIONS,
+                              struct.calcsize(fmt),
+                              tpm2.TPM2_CC_GET_RANDOM,
+                              0x20)
+            self.client.tpm.write(cmd)
+
+            # expect the second one to raise -EBUSY error
+            self.client.tpm.write(cmd)
+            rsp = self.client.tpm.read()
+
+        except IOError, e:
+            # read the response
+            rsp = self.client.tpm.read()
+            rejected = True
+            pass
+        except:
+            pass
+        self.assertEqual(rejected, True)
+
 class SpaceTest(unittest.TestCase):
     def setUp(self):
         logging.basicConfig(filename='SpaceTest.log', level=logging.DEBUG)
