Browse Source

Merge tag 'asoc-fix-v4.14-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v4.14

A bunch of fixes here, mostly device specific ones (the biggest one
being the revert of the hotword support for rt5514), with a couple of
core fixes for potential issues with corrupted or otherwise invalid
topology files.
Takashi Iwai 7 years ago
parent
commit
a53a0ab8ff
100 changed files with 703 additions and 296 deletions
  1. 8 0
      Documentation/ABI/testing/sysfs-bus-iio-proximity-as3935
  2. 3 1
      Documentation/ABI/testing/sysfs-devices-power
  3. 0 10
      Documentation/ABI/testing/sysfs-kernel-mm-swap
  4. 0 14
      Documentation/core-api/kernel-api.rst
  5. 5 0
      Documentation/devicetree/bindings/iio/proximity/as3935.txt
  6. 3 3
      Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.txt
  7. 18 13
      Documentation/kbuild/makefiles.txt
  8. 1 1
      Documentation/networking/bonding.txt
  9. 1 0
      Documentation/process/index.rst
  10. 147 0
      Documentation/process/kernel-enforcement-statement.rst
  11. 5 5
      MAINTAINERS
  12. 11 7
      Makefile
  13. 0 3
      arch/Kconfig
  14. 2 2
      arch/alpha/kernel/sys_alcor.c
  15. 6 6
      arch/alpha/kernel/sys_cabriolet.c
  16. 10 10
      arch/alpha/kernel/sys_dp264.c
  17. 2 2
      arch/alpha/kernel/sys_eb64p.c
  18. 2 2
      arch/alpha/kernel/sys_eiger.c
  19. 3 3
      arch/alpha/kernel/sys_miata.c
  20. 2 2
      arch/alpha/kernel/sys_mikasa.c
  21. 1 1
      arch/alpha/kernel/sys_nautilus.c
  22. 3 3
      arch/alpha/kernel/sys_noritake.c
  23. 2 2
      arch/alpha/kernel/sys_rawhide.c
  24. 3 3
      arch/alpha/kernel/sys_ruffian.c
  25. 2 2
      arch/alpha/kernel/sys_rx164.c
  26. 5 5
      arch/alpha/kernel/sys_sable.c
  27. 4 4
      arch/alpha/kernel/sys_sio.c
  28. 2 2
      arch/alpha/kernel/sys_sx164.c
  29. 3 3
      arch/alpha/kernel/sys_takara.c
  30. 2 2
      arch/alpha/kernel/sys_wildfire.c
  31. 6 5
      arch/arc/boot/dts/hsdk.dts
  32. 0 1
      arch/arc/configs/hsdk_defconfig
  33. 5 0
      arch/arc/kernel/smp.c
  34. 1 0
      arch/arc/plat-hsdk/Kconfig
  35. 10 0
      arch/arc/plat-hsdk/platform.c
  36. 1 1
      arch/arm/Makefile
  37. 4 0
      arch/arm/boot/compressed/debug.S
  38. 2 2
      arch/arm/boot/dts/armada-38x.dtsi
  39. 2 2
      arch/arm/boot/dts/at91-sama5d27_som1.dtsi
  40. 15 1
      arch/arm/boot/dts/at91-sama5d2_xplained.dts
  41. 3 6
      arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
  42. 5 0
      arch/arm/boot/dts/bcm2837-rpi-3-b.dts
  43. 6 1
      arch/arm/boot/dts/bcm283x.dtsi
  44. 2 1
      arch/arm/boot/dts/gemini.dtsi
  45. 4 4
      arch/arm/boot/dts/imx7d.dtsi
  46. 2 1
      arch/arm/boot/dts/moxart.dtsi
  47. 1 0
      arch/arm/boot/dts/sama5d2.dtsi
  48. 8 8
      arch/arm/boot/dts/sun6i-a31.dtsi
  49. 8 0
      arch/arm/kernel/debug.S
  50. 4 0
      arch/arm/mach-ux500/cpu-db8500.c
  51. 0 4
      arch/arm/mach-ux500/pm.c
  52. 5 0
      arch/arm/mm/nommu.c
  53. 1 1
      arch/arm/xen/p2m.c
  54. 1 8
      arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
  55. 3 3
      arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi
  56. 3 3
      arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi
  57. 10 0
      arch/arm64/boot/dts/renesas/salvator-common.dtsi
  58. 1 1
      arch/arm64/boot/dts/rockchip/rk3328.dtsi
  59. 1 1
      arch/arm64/boot/dts/rockchip/rk3368.dtsi
  60. 2 2
      arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
  61. 2 2
      arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
  62. 2 2
      arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
  63. 4 2
      arch/mips/include/asm/cmpxchg.h
  64. 21 17
      arch/mips/loongson32/common/platform.c
  65. 0 2
      arch/mips/math-emu/cp1emu.c
  66. 1 1
      arch/mips/net/ebpf_jit.c
  67. 2 4
      arch/mips/tools/generic-board-config.sh
  68. 1 1
      arch/parisc/kernel/parisc_ksyms.c
  69. 3 3
      arch/parisc/kernel/syscall.S
  70. 4 1
      arch/parisc/kernel/time.c
  71. 23 1
      arch/powerpc/kernel/exceptions-64s.S
  72. 12 1
      arch/powerpc/kernel/signal_64.c
  73. 15 30
      arch/powerpc/kernel/trace/ftrace_64_mprofile.S
  74. 14 9
      arch/powerpc/kvm/book3s_64_vio.c
  75. 10 3
      arch/powerpc/kvm/book3s_hv_rmhandlers.S
  76. 1 2
      arch/powerpc/kvm/powerpc.c
  77. 4 2
      arch/powerpc/lib/sstep.c
  78. 0 1
      arch/powerpc/mm/numa.c
  79. 34 5
      arch/powerpc/perf/imc-pmu.c
  80. 2 0
      arch/s390/configs/zfcpdump_defconfig
  81. 5 2
      arch/s390/kernel/entry.S
  82. 3 0
      arch/s390/kernel/smp.c
  83. 0 1
      arch/sparc/Kconfig
  84. 2 2
      arch/x86/entry/entry_32.S
  85. 1 1
      arch/x86/entry/entry_64.S
  86. 3 3
      arch/x86/events/intel/bts.c
  87. 10 2
      arch/x86/events/intel/uncore.c
  88. 5 0
      arch/x86/hyperv/hv_init.c
  89. 43 14
      arch/x86/hyperv/mmu.c
  90. 3 1
      arch/x86/include/asm/alternative-asm.h
  91. 3 3
      arch/x86/include/asm/alternative.h
  92. 0 1
      arch/x86/include/asm/mce.h
  93. 1 7
      arch/x86/include/asm/mmu_context.h
  94. 1 0
      arch/x86/include/asm/mshyperv.h
  95. 33 0
      arch/x86/include/asm/tlbflush.h
  96. 41 0
      arch/x86/kernel/amd_nb.c
  97. 13 2
      arch/x86/kernel/apic/apic.c
  98. 0 1
      arch/x86/kernel/cpu/intel_cacheinfo.c
  99. 7 0
      arch/x86/kernel/cpu/mcheck/mce-internal.h
  100. 2 0
      arch/x86/kernel/cpu/mcheck/mce_amd.c

+ 8 - 0
Documentation/ABI/testing/sysfs-bus-iio-proximity-as3935

@@ -14,3 +14,11 @@ Description:
 		Show or set the gain boost of the amp, from 0-31 range.
 		Show or set the gain boost of the amp, from 0-31 range.
 		18 = indoors (default)
 		18 = indoors (default)
 		14 = outdoors
 		14 = outdoors
+
+What		/sys/bus/iio/devices/iio:deviceX/noise_level_tripped
+Date:		May 2017
+KernelVersion:	4.13
+Contact:	Matt Ranostay <matt.ranostay@konsulko.com>
+Description:
+		When 1 the noise level is over the trip level and not reporting
+		valid data

+ 3 - 1
Documentation/ABI/testing/sysfs-devices-power

@@ -211,7 +211,9 @@ Description:
 		device, after it has been suspended at run time, from a resume
 		device, after it has been suspended at run time, from a resume
 		request to the moment the device will be ready to process I/O,
 		request to the moment the device will be ready to process I/O,
 		in microseconds.  If it is equal to 0, however, this means that
 		in microseconds.  If it is equal to 0, however, this means that
-		the PM QoS resume latency may be arbitrary.
+		the PM QoS resume latency may be arbitrary and the special value
+		"n/a" means that user space cannot accept any resume latency at
+		all for the given device.
 
 
 		Not all drivers support this attribute.  If it isn't supported,
 		Not all drivers support this attribute.  If it isn't supported,
 		it is not present.
 		it is not present.

+ 0 - 10
Documentation/ABI/testing/sysfs-kernel-mm-swap

@@ -14,13 +14,3 @@ Description:	Enable/disable VMA based swap readahead.
 		still used for tmpfs etc. other users.  If set to
 		still used for tmpfs etc. other users.  If set to
 		false, the global swap readahead algorithm will be
 		false, the global swap readahead algorithm will be
 		used for all swappable pages.
 		used for all swappable pages.
-
-What:		/sys/kernel/mm/swap/vma_ra_max_order
-Date:		August 2017
-Contact:	Linux memory management mailing list <linux-mm@kvack.org>
-Description:	The max readahead size in order for VMA based swap readahead
-
-		VMA based swap readahead algorithm will readahead at
-		most 1 << max_order pages for each readahead.  The
-		real readahead size for each readahead will be scaled
-		according to the estimation algorithm.

+ 0 - 14
Documentation/core-api/kernel-api.rst

@@ -352,44 +352,30 @@ Read-Copy Update (RCU)
 ----------------------
 ----------------------
 
 
 .. kernel-doc:: include/linux/rcupdate.h
 .. kernel-doc:: include/linux/rcupdate.h
-   :external:
 
 
 .. kernel-doc:: include/linux/rcupdate_wait.h
 .. kernel-doc:: include/linux/rcupdate_wait.h
-   :external:
 
 
 .. kernel-doc:: include/linux/rcutree.h
 .. kernel-doc:: include/linux/rcutree.h
-   :external:
 
 
 .. kernel-doc:: kernel/rcu/tree.c
 .. kernel-doc:: kernel/rcu/tree.c
-   :external:
 
 
 .. kernel-doc:: kernel/rcu/tree_plugin.h
 .. kernel-doc:: kernel/rcu/tree_plugin.h
-   :external:
 
 
 .. kernel-doc:: kernel/rcu/tree_exp.h
 .. kernel-doc:: kernel/rcu/tree_exp.h
-   :external:
 
 
 .. kernel-doc:: kernel/rcu/update.c
 .. kernel-doc:: kernel/rcu/update.c
-   :external:
 
 
 .. kernel-doc:: include/linux/srcu.h
 .. kernel-doc:: include/linux/srcu.h
-   :external:
 
 
 .. kernel-doc:: kernel/rcu/srcutree.c
 .. kernel-doc:: kernel/rcu/srcutree.c
-   :external:
 
 
 .. kernel-doc:: include/linux/rculist_bl.h
 .. kernel-doc:: include/linux/rculist_bl.h
-   :external:
 
 
 .. kernel-doc:: include/linux/rculist.h
 .. kernel-doc:: include/linux/rculist.h
-   :external:
 
 
 .. kernel-doc:: include/linux/rculist_nulls.h
 .. kernel-doc:: include/linux/rculist_nulls.h
-   :external:
 
 
 .. kernel-doc:: include/linux/rcu_sync.h
 .. kernel-doc:: include/linux/rcu_sync.h
-   :external:
 
 
 .. kernel-doc:: kernel/rcu/sync.c
 .. kernel-doc:: kernel/rcu/sync.c
-   :external:
 
 

+ 5 - 0
Documentation/devicetree/bindings/iio/proximity/as3935.txt

@@ -16,6 +16,10 @@ Optional properties:
 	- ams,tuning-capacitor-pf: Calibration tuning capacitor stepping
 	- ams,tuning-capacitor-pf: Calibration tuning capacitor stepping
 	  value 0 - 120pF. This will require using the calibration data from
 	  value 0 - 120pF. This will require using the calibration data from
 	  the manufacturer.
 	  the manufacturer.
+	- ams,nflwdth: Set the noise and watchdog threshold register on
+	  startup. This will need to set according to the noise from the
+	  MCU board, and possibly the local environment. Refer to the
+	  datasheet for the threshold settings.
 
 
 Example:
 Example:
 
 
@@ -27,4 +31,5 @@ as3935@0 {
 	interrupt-parent = <&gpio1>;
 	interrupt-parent = <&gpio1>;
 	interrupts = <16 1>;
 	interrupts = <16 1>;
 	ams,tuning-capacitor-pf = <80>;
 	ams,tuning-capacitor-pf = <80>;
+	ams,nflwdth = <0x44>;
 };
 };

+ 3 - 3
Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.txt

@@ -99,7 +99,7 @@ Examples:
 			compatible = "arm,gic-v3-its";
 			compatible = "arm,gic-v3-its";
 			msi-controller;
 			msi-controller;
 			#msi-cells = <1>;
 			#msi-cells = <1>;
-			reg = <0x0 0x2c200000 0 0x200000>;
+			reg = <0x0 0x2c200000 0 0x20000>;
 		};
 		};
 	};
 	};
 
 
@@ -124,14 +124,14 @@ Examples:
 			compatible = "arm,gic-v3-its";
 			compatible = "arm,gic-v3-its";
 			msi-controller;
 			msi-controller;
 			#msi-cells = <1>;
 			#msi-cells = <1>;
-			reg = <0x0 0x2c200000 0 0x200000>;
+			reg = <0x0 0x2c200000 0 0x20000>;
 		};
 		};
 
 
 		gic-its@2c400000 {
 		gic-its@2c400000 {
 			compatible = "arm,gic-v3-its";
 			compatible = "arm,gic-v3-its";
 			msi-controller;
 			msi-controller;
 			#msi-cells = <1>;
 			#msi-cells = <1>;
-			reg = <0x0 0x2c400000 0 0x200000>;
+			reg = <0x0 0x2c400000 0 0x20000>;
 		};
 		};
 
 
 		ppi-partitions {
 		ppi-partitions {

+ 18 - 13
Documentation/kbuild/makefiles.txt

@@ -1108,14 +1108,6 @@ When kbuild executes, the following steps are followed (roughly):
     ld
     ld
 	Link target. Often, LDFLAGS_$@ is used to set specific options to ld.
 	Link target. Often, LDFLAGS_$@ is used to set specific options to ld.
 
 
-    objcopy
-	Copy binary. Uses OBJCOPYFLAGS usually specified in
-	arch/$(ARCH)/Makefile.
-	OBJCOPYFLAGS_$@ may be used to set additional options.
-
-    gzip
-	Compress target. Use maximum compression to compress target.
-
 	Example:
 	Example:
 		#arch/x86/boot/Makefile
 		#arch/x86/boot/Makefile
 		LDFLAGS_bootsect := -Ttext 0x0 -s --oformat binary
 		LDFLAGS_bootsect := -Ttext 0x0 -s --oformat binary
@@ -1139,6 +1131,19 @@ When kbuild executes, the following steps are followed (roughly):
 	      resulting in the target file being recompiled for no
 	      resulting in the target file being recompiled for no
 	      obvious reason.
 	      obvious reason.
 
 
+    objcopy
+	Copy binary. Uses OBJCOPYFLAGS usually specified in
+	arch/$(ARCH)/Makefile.
+	OBJCOPYFLAGS_$@ may be used to set additional options.
+
+    gzip
+	Compress target. Use maximum compression to compress target.
+
+	Example:
+		#arch/x86/boot/compressed/Makefile
+		$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
+			$(call if_changed,gzip)
+
     dtc
     dtc
 	Create flattened device tree blob object suitable for linking
 	Create flattened device tree blob object suitable for linking
 	into vmlinux. Device tree blobs linked into vmlinux are placed
 	into vmlinux. Device tree blobs linked into vmlinux are placed
@@ -1219,7 +1224,7 @@ When kbuild executes, the following steps are followed (roughly):
 	that may be shared between individual architectures.
 	that may be shared between individual architectures.
 	The recommended approach how to use a generic header file is
 	The recommended approach how to use a generic header file is
 	to list the file in the Kbuild file.
 	to list the file in the Kbuild file.
-	See "7.3 generic-y" for further info on syntax etc.
+	See "7.2 generic-y" for further info on syntax etc.
 
 
 --- 6.11 Post-link pass
 --- 6.11 Post-link pass
 
 
@@ -1254,13 +1259,13 @@ A Kbuild file may be defined under arch/<arch>/include/uapi/asm/ and
 arch/<arch>/include/asm/ to list asm files coming from asm-generic.
 arch/<arch>/include/asm/ to list asm files coming from asm-generic.
 See subsequent chapter for the syntax of the Kbuild file.
 See subsequent chapter for the syntax of the Kbuild file.
 
 
-	--- 7.1 no-export-headers
+--- 7.1 no-export-headers
 
 
 	no-export-headers is essentially used by include/uapi/linux/Kbuild to
 	no-export-headers is essentially used by include/uapi/linux/Kbuild to
 	avoid exporting specific headers (e.g. kvm.h) on architectures that do
 	avoid exporting specific headers (e.g. kvm.h) on architectures that do
 	not support it. It should be avoided as much as possible.
 	not support it. It should be avoided as much as possible.
 
 
-	--- 7.2 generic-y
+--- 7.2 generic-y
 
 
 	If an architecture uses a verbatim copy of a header from
 	If an architecture uses a verbatim copy of a header from
 	include/asm-generic then this is listed in the file
 	include/asm-generic then this is listed in the file
@@ -1287,7 +1292,7 @@ See subsequent chapter for the syntax of the Kbuild file.
 		Example: termios.h
 		Example: termios.h
 			#include <asm-generic/termios.h>
 			#include <asm-generic/termios.h>
 
 
-	--- 7.3 generated-y
+--- 7.3 generated-y
 
 
 	If an architecture generates other header files alongside generic-y
 	If an architecture generates other header files alongside generic-y
 	wrappers, generated-y specifies them.
 	wrappers, generated-y specifies them.
@@ -1299,7 +1304,7 @@ See subsequent chapter for the syntax of the Kbuild file.
 			#arch/x86/include/asm/Kbuild
 			#arch/x86/include/asm/Kbuild
 			generated-y += syscalls_32.h
 			generated-y += syscalls_32.h
 
 
-	--- 7.5 mandatory-y
+--- 7.4 mandatory-y
 
 
 	mandatory-y is essentially used by include/uapi/asm-generic/Kbuild.asm
 	mandatory-y is essentially used by include/uapi/asm-generic/Kbuild.asm
 	to define the minimum set of headers that must be exported in
 	to define the minimum set of headers that must be exported in

+ 1 - 1
Documentation/networking/bonding.txt

@@ -2387,7 +2387,7 @@ broadcast: Like active-backup, there is not much advantage to this
 	and packet type ID), so in a "gatewayed" configuration, all
 	and packet type ID), so in a "gatewayed" configuration, all
 	outgoing traffic will generally use the same device.  Incoming
 	outgoing traffic will generally use the same device.  Incoming
 	traffic may also end up on a single device, but that is
 	traffic may also end up on a single device, but that is
-	dependent upon the balancing policy of the peer's 8023.ad
+	dependent upon the balancing policy of the peer's 802.3ad
 	implementation.  In a "local" configuration, traffic will be
 	implementation.  In a "local" configuration, traffic will be
 	distributed across the devices in the bond.
 	distributed across the devices in the bond.
 
 

+ 1 - 0
Documentation/process/index.rst

@@ -25,6 +25,7 @@ Below are the essential guides that every developer should read.
    submitting-patches
    submitting-patches
    coding-style
    coding-style
    email-clients
    email-clients
+   kernel-enforcement-statement
 
 
 Other guides to the community that are of interest to most developers are: 
 Other guides to the community that are of interest to most developers are: 
 
 

+ 147 - 0
Documentation/process/kernel-enforcement-statement.rst

@@ -0,0 +1,147 @@
+Linux Kernel Enforcement Statement
+----------------------------------
+
+As developers of the Linux kernel, we have a keen interest in how our software
+is used and how the license for our software is enforced.  Compliance with the
+reciprocal sharing obligations of GPL-2.0 is critical to the long-term
+sustainability of our software and community.
+
+Although there is a right to enforce the separate copyright interests in the
+contributions made to our community, we share an interest in ensuring that
+individual enforcement actions are conducted in a manner that benefits our
+community and do not have an unintended negative impact on the health and
+growth of our software ecosystem.  In order to deter unhelpful enforcement
+actions, we agree that it is in the best interests of our development
+community to undertake the following commitment to users of the Linux kernel
+on behalf of ourselves and any successors to our copyright interests:
+
+    Notwithstanding the termination provisions of the GPL-2.0, we agree that
+    it is in the best interests of our development community to adopt the
+    following provisions of GPL-3.0 as additional permissions under our
+    license with respect to any non-defensive assertion of rights under the
+    license.
+
+	However, if you cease all violation of this License, then your license
+	from a particular copyright holder is reinstated (a) provisionally,
+	unless and until the copyright holder explicitly and finally
+	terminates your license, and (b) permanently, if the copyright holder
+	fails to notify you of the violation by some reasonable means prior to
+	60 days after the cessation.
+
+	Moreover, your license from a particular copyright holder is
+	reinstated permanently if the copyright holder notifies you of the
+	violation by some reasonable means, this is the first time you have
+	received notice of violation of this License (for any work) from that
+	copyright holder, and you cure the violation prior to 30 days after
+	your receipt of the notice.
+
+Our intent in providing these assurances is to encourage more use of the
+software.  We want companies and individuals to use, modify and distribute
+this software.  We want to work with users in an open and transparent way to
+eliminate any uncertainty about our expectations regarding compliance or
+enforcement that might limit adoption of our software.  We view legal action
+as a last resort, to be initiated only when other community efforts have
+failed to resolve the problem.
+
+Finally, once a non-compliance issue is resolved, we hope the user will feel
+welcome to join us in our efforts on this project.  Working together, we will
+be stronger.
+
+Except where noted below, we speak only for ourselves, and not for any company
+we might work for today, have in the past, or will in the future.
+
+  - Bjorn Andersson (Linaro)
+  - Andrea Arcangeli (Red Hat)
+  - Neil Armstrong
+  - Jens Axboe
+  - Pablo Neira Ayuso
+  - Khalid Aziz
+  - Ralf Baechle
+  - Felipe Balbi
+  - Arnd Bergmann
+  - Ard Biesheuvel
+  - Paolo Bonzini (Red Hat)
+  - Christian Borntraeger
+  - Mark Brown (Linaro)
+  - Paul Burton
+  - Javier Martinez Canillas
+  - Rob Clark
+  - Jonathan Corbet
+  - Vivien Didelot (Savoir-faire Linux)
+  - Hans de Goede (Red Hat)
+  - Mel Gorman (SUSE)
+  - Sven Eckelmann
+  - Alex Elder (Linaro)
+  - Fabio Estevam
+  - Larry Finger
+  - Bhumika Goyal
+  - Andy Gross
+  - Juergen Gross
+  - Shawn Guo
+  - Ulf Hansson
+  - Tejun Heo
+  - Rob Herring
+  - Masami Hiramatsu
+  - Michal Hocko
+  - Simon Horman
+  - Johan Hovold (Hovold Consulting AB)
+  - Christophe JAILLET
+  - Olof Johansson
+  - Lee Jones (Linaro)
+  - Heiner Kallweit
+  - Srinivas Kandagatla
+  - Jan Kara
+  - Shuah Khan (Samsung)
+  - David Kershner
+  - Jaegeuk Kim
+  - Namhyung Kim
+  - Colin Ian King
+  - Jeff Kirsher
+  - Greg Kroah-Hartman (Linux Foundation)
+  - Christian König
+  - Vinod Koul
+  - Krzysztof Kozlowski
+  - Viresh Kumar
+  - Aneesh Kumar K.V
+  - Julia Lawall
+  - Doug Ledford (Red Hat)
+  - Chuck Lever (Oracle)
+  - Daniel Lezcano
+  - Shaohua Li
+  - Xin Long (Red Hat)
+  - Tony Luck
+  - Mike Marshall
+  - Chris Mason
+  - Paul E. McKenney
+  - David S. Miller
+  - Ingo Molnar
+  - Kuninori Morimoto
+  - Borislav Petkov
+  - Jiri Pirko
+  - Josh Poimboeuf
+  - Sebastian Reichel (Collabora)
+  - Guenter Roeck
+  - Joerg Roedel
+  - Leon Romanovsky
+  - Steven Rostedt (VMware)
+  - Ivan Safonov
+  - Ivan Safonov
+  - Anna Schumaker
+  - Jes Sorensen
+  - K.Y. Srinivasan
+  - Heiko Stuebner
+  - Jiri Kosina (SUSE)
+  - Dmitry Torokhov
+  - Linus Torvalds
+  - Thierry Reding
+  - Rik van Riel
+  - Geert Uytterhoeven (Glider bvba)
+  - Daniel Vetter
+  - Linus Walleij
+  - Richard Weinberger
+  - Dan Williams
+  - Rafael J. Wysocki
+  - Arvind Yadav
+  - Masahiro Yamada
+  - Wei Yongjun
+  - Lv Zheng

+ 5 - 5
MAINTAINERS

@@ -5346,9 +5346,7 @@ M:	"J. Bruce Fields" <bfields@fieldses.org>
 L:	linux-fsdevel@vger.kernel.org
 L:	linux-fsdevel@vger.kernel.org
 S:	Maintained
 S:	Maintained
 F:	include/linux/fcntl.h
 F:	include/linux/fcntl.h
-F:	include/linux/fs.h
 F:	include/uapi/linux/fcntl.h
 F:	include/uapi/linux/fcntl.h
-F:	include/uapi/linux/fs.h
 F:	fs/fcntl.c
 F:	fs/fcntl.c
 F:	fs/locks.c
 F:	fs/locks.c
 
 
@@ -5357,6 +5355,8 @@ M:	Alexander Viro <viro@zeniv.linux.org.uk>
 L:	linux-fsdevel@vger.kernel.org
 L:	linux-fsdevel@vger.kernel.org
 S:	Maintained
 S:	Maintained
 F:	fs/*
 F:	fs/*
+F:	include/linux/fs.h
+F:	include/uapi/linux/fs.h
 
 
 FINTEK F75375S HARDWARE MONITOR AND FAN CONTROLLER DRIVER
 FINTEK F75375S HARDWARE MONITOR AND FAN CONTROLLER DRIVER
 M:	Riku Voipio <riku.voipio@iki.fi>
 M:	Riku Voipio <riku.voipio@iki.fi>
@@ -7571,7 +7571,7 @@ F:	arch/mips/include/asm/kvm*
 F:	arch/mips/kvm/
 F:	arch/mips/kvm/
 
 
 KERNEL VIRTUAL MACHINE FOR POWERPC (KVM/powerpc)
 KERNEL VIRTUAL MACHINE FOR POWERPC (KVM/powerpc)
-M:	Alexander Graf <agraf@suse.com>
+M:	Paul Mackerras <paulus@ozlabs.org>
 L:	kvm-ppc@vger.kernel.org
 L:	kvm-ppc@vger.kernel.org
 W:	http://www.linux-kvm.org/
 W:	http://www.linux-kvm.org/
 T:	git git://github.com/agraf/linux-2.6.git
 T:	git git://github.com/agraf/linux-2.6.git
@@ -9213,7 +9213,6 @@ F:	include/linux/isicom.h
 MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER
 MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER
 M:	Bin Liu <b-liu@ti.com>
 M:	Bin Liu <b-liu@ti.com>
 L:	linux-usb@vger.kernel.org
 L:	linux-usb@vger.kernel.org
-T:	git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
 S:	Maintained
 S:	Maintained
 F:	drivers/usb/musb/
 F:	drivers/usb/musb/
 
 
@@ -10180,7 +10179,6 @@ F:	Documentation/parport*.txt
 
 
 PARAVIRT_OPS INTERFACE
 PARAVIRT_OPS INTERFACE
 M:	Juergen Gross <jgross@suse.com>
 M:	Juergen Gross <jgross@suse.com>
-M:	Chris Wright <chrisw@sous-sol.org>
 M:	Alok Kataria <akataria@vmware.com>
 M:	Alok Kataria <akataria@vmware.com>
 M:	Rusty Russell <rusty@rustcorp.com.au>
 M:	Rusty Russell <rusty@rustcorp.com.au>
 L:	virtualization@lists.linux-foundation.org
 L:	virtualization@lists.linux-foundation.org
@@ -10560,6 +10558,8 @@ M:	Peter Zijlstra <peterz@infradead.org>
 M:	Ingo Molnar <mingo@redhat.com>
 M:	Ingo Molnar <mingo@redhat.com>
 M:	Arnaldo Carvalho de Melo <acme@kernel.org>
 M:	Arnaldo Carvalho de Melo <acme@kernel.org>
 R:	Alexander Shishkin <alexander.shishkin@linux.intel.com>
 R:	Alexander Shishkin <alexander.shishkin@linux.intel.com>
+R:	Jiri Olsa <jolsa@redhat.com>
+R:	Namhyung Kim <namhyung@kernel.org>
 L:	linux-kernel@vger.kernel.org
 L:	linux-kernel@vger.kernel.org
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf/core
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf/core
 S:	Supported
 S:	Supported

+ 11 - 7
Makefile

@@ -1,7 +1,7 @@
 VERSION = 4
 VERSION = 4
 PATCHLEVEL = 14
 PATCHLEVEL = 14
 SUBLEVEL = 0
 SUBLEVEL = 0
-EXTRAVERSION = -rc4
+EXTRAVERSION = -rc7
 NAME = Fearless Coyote
 NAME = Fearless Coyote
 
 
 # *DOCUMENTATION*
 # *DOCUMENTATION*
@@ -130,8 +130,8 @@ endif
 ifneq ($(KBUILD_OUTPUT),)
 ifneq ($(KBUILD_OUTPUT),)
 # check that the output directory actually exists
 # check that the output directory actually exists
 saved-output := $(KBUILD_OUTPUT)
 saved-output := $(KBUILD_OUTPUT)
-$(shell [ -d $(KBUILD_OUTPUT) ] || mkdir -p $(KBUILD_OUTPUT))
-KBUILD_OUTPUT := $(realpath $(KBUILD_OUTPUT))
+KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
+								&& /bin/pwd)
 $(if $(KBUILD_OUTPUT),, \
 $(if $(KBUILD_OUTPUT),, \
      $(error failed to create output directory "$(saved-output)"))
      $(error failed to create output directory "$(saved-output)"))
 
 
@@ -697,11 +697,11 @@ KBUILD_CFLAGS += $(stackp-flag)
 
 
 ifeq ($(cc-name),clang)
 ifeq ($(cc-name),clang)
 ifneq ($(CROSS_COMPILE),)
 ifneq ($(CROSS_COMPILE),)
-CLANG_TARGET	:= -target $(notdir $(CROSS_COMPILE:%-=%))
+CLANG_TARGET	:= --target=$(notdir $(CROSS_COMPILE:%-=%))
 GCC_TOOLCHAIN	:= $(realpath $(dir $(shell which $(LD)))/..)
 GCC_TOOLCHAIN	:= $(realpath $(dir $(shell which $(LD)))/..)
 endif
 endif
 ifneq ($(GCC_TOOLCHAIN),)
 ifneq ($(GCC_TOOLCHAIN),)
-CLANG_GCC_TC	:= -gcc-toolchain $(GCC_TOOLCHAIN)
+CLANG_GCC_TC	:= --gcc-toolchain=$(GCC_TOOLCHAIN)
 endif
 endif
 KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
 KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
 KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
 KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
@@ -933,7 +933,11 @@ ifdef CONFIG_STACK_VALIDATION
   ifeq ($(has_libelf),1)
   ifeq ($(has_libelf),1)
     objtool_target := tools/objtool FORCE
     objtool_target := tools/objtool FORCE
   else
   else
-    $(warning "Cannot use CONFIG_STACK_VALIDATION, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
+    ifdef CONFIG_ORC_UNWINDER
+      $(error "Cannot generate ORC metadata for CONFIG_ORC_UNWINDER=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
+    else
+      $(warning "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
+    endif
     SKIP_STACK_VALIDATION := 1
     SKIP_STACK_VALIDATION := 1
     export SKIP_STACK_VALIDATION
     export SKIP_STACK_VALIDATION
   endif
   endif
@@ -1395,7 +1399,7 @@ help:
 	@echo  '                    Build, install, and boot kernel before'
 	@echo  '                    Build, install, and boot kernel before'
 	@echo  '                    running kselftest on it'
 	@echo  '                    running kselftest on it'
 	@echo  '  kselftest-clean - Remove all generated kselftest files'
 	@echo  '  kselftest-clean - Remove all generated kselftest files'
-	@echo  '  kselftest-merge - Merge all the config dependencies of kselftest to existed'
+	@echo  '  kselftest-merge - Merge all the config dependencies of kselftest to existing'
 	@echo  '                    .config.'
 	@echo  '                    .config.'
 	@echo  ''
 	@echo  ''
 	@echo 'Userspace tools targets:'
 	@echo 'Userspace tools targets:'

+ 0 - 3
arch/Kconfig

@@ -937,9 +937,6 @@ config STRICT_MODULE_RWX
 	  and non-text memory will be made non-executable. This provides
 	  and non-text memory will be made non-executable. This provides
 	  protection against certain security exploits (e.g. writing to text)
 	  protection against certain security exploits (e.g. writing to text)
 
 
-config ARCH_WANT_RELAX_ORDER
-	bool
-
 config ARCH_HAS_REFCOUNT
 config ARCH_HAS_REFCOUNT
 	bool
 	bool
 	help
 	help

+ 2 - 2
arch/alpha/kernel/sys_alcor.c

@@ -181,10 +181,10 @@ alcor_init_irq(void)
  * comes in on.  This makes interrupt processing much easier.
  * comes in on.  This makes interrupt processing much easier.
  */
  */
 
 
-static int __init
+static int
 alcor_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 alcor_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[7][5] __initdata = {
+	static char irq_tab[7][5] = {
 		/*INT    INTA   INTB   INTC   INTD */
 		/*INT    INTA   INTB   INTC   INTD */
 		/* note: IDSEL 17 is XLT only */
 		/* note: IDSEL 17 is XLT only */
 		{16+13, 16+13, 16+13, 16+13, 16+13},	/* IdSel 17,  TULIP  */
 		{16+13, 16+13, 16+13, 16+13, 16+13},	/* IdSel 17,  TULIP  */

+ 6 - 6
arch/alpha/kernel/sys_cabriolet.c

@@ -173,10 +173,10 @@ pc164_init_irq(void)
  * because it is the Saturn IO (SIO) PCI/ISA Bridge Chip.
  * because it is the Saturn IO (SIO) PCI/ISA Bridge Chip.
  */
  */
 
 
-static inline int __init
+static inline int
 eb66p_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 eb66p_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[5][5] __initdata = {
+	static char irq_tab[5][5] = {
 		/*INT  INTA  INTB  INTC   INTD */
 		/*INT  INTA  INTB  INTC   INTD */
 		{16+0, 16+0, 16+5,  16+9, 16+13},  /* IdSel 6,  slot 0, J25 */
 		{16+0, 16+0, 16+5,  16+9, 16+13},  /* IdSel 6,  slot 0, J25 */
 		{16+1, 16+1, 16+6, 16+10, 16+14},  /* IdSel 7,  slot 1, J26 */
 		{16+1, 16+1, 16+6, 16+10, 16+14},  /* IdSel 7,  slot 1, J26 */
@@ -203,10 +203,10 @@ eb66p_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  * because it is the Saturn IO (SIO) PCI/ISA Bridge Chip.
  * because it is the Saturn IO (SIO) PCI/ISA Bridge Chip.
  */
  */
 
 
-static inline int __init
+static inline int
 cabriolet_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 cabriolet_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[5][5] __initdata = {
+	static char irq_tab[5][5] = {
 		/*INT   INTA  INTB  INTC   INTD */
 		/*INT   INTA  INTB  INTC   INTD */
 		{ 16+2, 16+2, 16+7, 16+11, 16+15}, /* IdSel 5,  slot 2, J21 */
 		{ 16+2, 16+2, 16+7, 16+11, 16+15}, /* IdSel 5,  slot 2, J21 */
 		{ 16+0, 16+0, 16+5,  16+9, 16+13}, /* IdSel 6,  slot 0, J19 */
 		{ 16+0, 16+0, 16+5,  16+9, 16+13}, /* IdSel 6,  slot 0, J19 */
@@ -287,10 +287,10 @@ cia_cab_init_pci(void)
  * 
  * 
  */
  */
 
 
-static inline int __init
+static inline int
 alphapc164_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 alphapc164_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[7][5] __initdata = {
+	static char irq_tab[7][5] = {
 		/*INT   INTA  INTB   INTC   INTD */
 		/*INT   INTA  INTB   INTC   INTD */
 		{ 16+2, 16+2, 16+9,  16+13, 16+17}, /* IdSel  5, slot 2, J20 */
 		{ 16+2, 16+2, 16+9,  16+13, 16+17}, /* IdSel  5, slot 2, J20 */
 		{ 16+0, 16+0, 16+7,  16+11, 16+15}, /* IdSel  6, slot 0, J29 */
 		{ 16+0, 16+0, 16+7,  16+11, 16+15}, /* IdSel  6, slot 0, J29 */

+ 10 - 10
arch/alpha/kernel/sys_dp264.c

@@ -356,7 +356,7 @@ clipper_init_irq(void)
  *  10	 64 bit PCI option slot 3 (not bus 0)
  *  10	 64 bit PCI option slot 3 (not bus 0)
  */
  */
 
 
-static int __init
+static int
 isa_irq_fixup(const struct pci_dev *dev, int irq)
 isa_irq_fixup(const struct pci_dev *dev, int irq)
 {
 {
 	u8 irq8;
 	u8 irq8;
@@ -372,10 +372,10 @@ isa_irq_fixup(const struct pci_dev *dev, int irq)
 	return irq8 & 0xf;
 	return irq8 & 0xf;
 }
 }
 
 
-static int __init
+static int
 dp264_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 dp264_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[6][5] __initdata = {
+	static char irq_tab[6][5] = {
 		/*INT    INTA   INTB   INTC   INTD */
 		/*INT    INTA   INTB   INTC   INTD */
 		{    -1,    -1,    -1,    -1,    -1}, /* IdSel 5 ISA Bridge */
 		{    -1,    -1,    -1,    -1,    -1}, /* IdSel 5 ISA Bridge */
 		{ 16+ 3, 16+ 3, 16+ 2, 16+ 2, 16+ 2}, /* IdSel 6 SCSI builtin*/
 		{ 16+ 3, 16+ 3, 16+ 2, 16+ 2, 16+ 2}, /* IdSel 6 SCSI builtin*/
@@ -394,10 +394,10 @@ dp264_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	return isa_irq_fixup(dev, irq);
 	return isa_irq_fixup(dev, irq);
 }
 }
 
 
-static int __init
+static int
 monet_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 monet_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[13][5] __initdata = {
+	static char irq_tab[13][5] = {
 		/*INT    INTA   INTB   INTC   INTD */
 		/*INT    INTA   INTB   INTC   INTD */
 		{    45,    45,    45,    45,    45}, /* IdSel 3 21143 PCI1 */
 		{    45,    45,    45,    45,    45}, /* IdSel 3 21143 PCI1 */
 		{    -1,    -1,    -1,    -1,    -1}, /* IdSel 4 unused */
 		{    -1,    -1,    -1,    -1,    -1}, /* IdSel 4 unused */
@@ -423,7 +423,7 @@ monet_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	return isa_irq_fixup(dev, COMMON_TABLE_LOOKUP);
 	return isa_irq_fixup(dev, COMMON_TABLE_LOOKUP);
 }
 }
 
 
-static u8 __init
+static u8
 monet_swizzle(struct pci_dev *dev, u8 *pinp)
 monet_swizzle(struct pci_dev *dev, u8 *pinp)
 {
 {
 	struct pci_controller *hose = dev->sysdata;
 	struct pci_controller *hose = dev->sysdata;
@@ -456,10 +456,10 @@ monet_swizzle(struct pci_dev *dev, u8 *pinp)
 	return slot;
 	return slot;
 }
 }
 
 
-static int __init
+static int
 webbrick_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 webbrick_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[13][5] __initdata = {
+	static char irq_tab[13][5] = {
 		/*INT    INTA   INTB   INTC   INTD */
 		/*INT    INTA   INTB   INTC   INTD */
 		{    -1,    -1,    -1,    -1,    -1}, /* IdSel 7 ISA Bridge */
 		{    -1,    -1,    -1,    -1,    -1}, /* IdSel 7 ISA Bridge */
 		{    -1,    -1,    -1,    -1,    -1}, /* IdSel 8 unused */
 		{    -1,    -1,    -1,    -1,    -1}, /* IdSel 8 unused */
@@ -478,10 +478,10 @@ webbrick_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	return isa_irq_fixup(dev, COMMON_TABLE_LOOKUP);
 	return isa_irq_fixup(dev, COMMON_TABLE_LOOKUP);
 }
 }
 
 
-static int __init
+static int
 clipper_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 clipper_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[7][5] __initdata = {
+	static char irq_tab[7][5] = {
 		/*INT    INTA   INTB   INTC   INTD */
 		/*INT    INTA   INTB   INTC   INTD */
 		{ 16+ 8, 16+ 8, 16+ 9, 16+10, 16+11}, /* IdSel 1 slot 1 */
 		{ 16+ 8, 16+ 8, 16+ 9, 16+10, 16+11}, /* IdSel 1 slot 1 */
 		{ 16+12, 16+12, 16+13, 16+14, 16+15}, /* IdSel 2 slot 2 */
 		{ 16+12, 16+12, 16+13, 16+14, 16+15}, /* IdSel 2 slot 2 */

+ 2 - 2
arch/alpha/kernel/sys_eb64p.c

@@ -167,10 +167,10 @@ eb64p_init_irq(void)
  * comes in on.  This makes interrupt processing much easier.
  * comes in on.  This makes interrupt processing much easier.
  */
  */
 
 
-static int __init
+static int
 eb64p_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 eb64p_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[5][5] __initdata = {
+	static char irq_tab[5][5] = {
 		/*INT  INTA  INTB  INTC   INTD */
 		/*INT  INTA  INTB  INTC   INTD */
 		{16+7, 16+7, 16+7, 16+7,  16+7},  /* IdSel 5,  slot ?, ?? */
 		{16+7, 16+7, 16+7, 16+7,  16+7},  /* IdSel 5,  slot ?, ?? */
 		{16+0, 16+0, 16+2, 16+4,  16+9},  /* IdSel 6,  slot ?, ?? */
 		{16+0, 16+0, 16+2, 16+4,  16+9},  /* IdSel 6,  slot ?, ?? */

+ 2 - 2
arch/alpha/kernel/sys_eiger.c

@@ -141,7 +141,7 @@ eiger_init_irq(void)
 	}
 	}
 }
 }
 
 
-static int __init
+static int
 eiger_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 eiger_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
 	u8 irq_orig;
 	u8 irq_orig;
@@ -158,7 +158,7 @@ eiger_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	return irq_orig - 0x80;
 	return irq_orig - 0x80;
 }
 }
 
 
-static u8 __init
+static u8
 eiger_swizzle(struct pci_dev *dev, u8 *pinp)
 eiger_swizzle(struct pci_dev *dev, u8 *pinp)
 {
 {
 	struct pci_controller *hose = dev->sysdata;
 	struct pci_controller *hose = dev->sysdata;

+ 3 - 3
arch/alpha/kernel/sys_miata.c

@@ -149,10 +149,10 @@ miata_init_irq(void)
  * comes in on.  This makes interrupt processing much easier.
  * comes in on.  This makes interrupt processing much easier.
  */
  */
 
 
-static int __init
+static int
 miata_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 miata_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-        static char irq_tab[18][5] __initdata = {
+        static char irq_tab[18][5] = {
 		/*INT    INTA   INTB   INTC   INTD */
 		/*INT    INTA   INTB   INTC   INTD */
 		{16+ 8, 16+ 8, 16+ 8, 16+ 8, 16+ 8},  /* IdSel 14,  DC21142 */
 		{16+ 8, 16+ 8, 16+ 8, 16+ 8, 16+ 8},  /* IdSel 14,  DC21142 */
 		{   -1,    -1,    -1,    -1,    -1},  /* IdSel 15,  EIDE    */
 		{   -1,    -1,    -1,    -1,    -1},  /* IdSel 15,  EIDE    */
@@ -196,7 +196,7 @@ miata_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	return COMMON_TABLE_LOOKUP;
 	return COMMON_TABLE_LOOKUP;
 }
 }
 
 
-static u8 __init
+static u8
 miata_swizzle(struct pci_dev *dev, u8 *pinp)
 miata_swizzle(struct pci_dev *dev, u8 *pinp)
 {
 {
 	int slot, pin = *pinp;
 	int slot, pin = *pinp;

+ 2 - 2
arch/alpha/kernel/sys_mikasa.c

@@ -145,10 +145,10 @@ mikasa_init_irq(void)
  * comes in on.  This makes interrupt processing much easier.
  * comes in on.  This makes interrupt processing much easier.
  */
  */
 
 
-static int __init
+static int
 mikasa_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 mikasa_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[8][5] __initdata = {
+	static char irq_tab[8][5] = {
 		/*INT    INTA   INTB   INTC   INTD */
 		/*INT    INTA   INTB   INTC   INTD */
 		{16+12, 16+12, 16+12, 16+12, 16+12},	/* IdSel 17,  SCSI */
 		{16+12, 16+12, 16+12, 16+12, 16+12},	/* IdSel 17,  SCSI */
 		{   -1,    -1,    -1,    -1,    -1},	/* IdSel 18,  PCEB */
 		{   -1,    -1,    -1,    -1,    -1},	/* IdSel 18,  PCEB */

+ 1 - 1
arch/alpha/kernel/sys_nautilus.c

@@ -62,7 +62,7 @@ nautilus_init_irq(void)
 	common_init_isa_dma();
 	common_init_isa_dma();
 }
 }
 
 
-static int __init
+static int
 nautilus_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 nautilus_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
 	/* Preserve the IRQ set up by the console.  */
 	/* Preserve the IRQ set up by the console.  */

+ 3 - 3
arch/alpha/kernel/sys_noritake.c

@@ -193,10 +193,10 @@ noritake_init_irq(void)
  * comes in on.  This makes interrupt processing much easier.
  * comes in on.  This makes interrupt processing much easier.
  */
  */
 
 
-static int __init
+static int
 noritake_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 noritake_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[15][5] __initdata = {
+	static char irq_tab[15][5] = {
 		/*INT    INTA   INTB   INTC   INTD */
 		/*INT    INTA   INTB   INTC   INTD */
 		/* note: IDSELs 16, 17, and 25 are CORELLE only */
 		/* note: IDSELs 16, 17, and 25 are CORELLE only */
 		{ 16+1,  16+1,  16+1,  16+1,  16+1},  /* IdSel 16,  QLOGIC */
 		{ 16+1,  16+1,  16+1,  16+1,  16+1},  /* IdSel 16,  QLOGIC */
@@ -221,7 +221,7 @@ noritake_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	return COMMON_TABLE_LOOKUP;
 	return COMMON_TABLE_LOOKUP;
 }
 }
 
 
-static u8 __init
+static u8
 noritake_swizzle(struct pci_dev *dev, u8 *pinp)
 noritake_swizzle(struct pci_dev *dev, u8 *pinp)
 {
 {
 	int slot, pin = *pinp;
 	int slot, pin = *pinp;

+ 2 - 2
arch/alpha/kernel/sys_rawhide.c

@@ -221,10 +221,10 @@ rawhide_init_irq(void)
  * 
  * 
  */
  */
 
 
-static int __init
+static int
 rawhide_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 rawhide_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[5][5] __initdata = {
+	static char irq_tab[5][5] = {
 		/*INT    INTA   INTB   INTC   INTD */
 		/*INT    INTA   INTB   INTC   INTD */
 		{ 16+16, 16+16, 16+16, 16+16, 16+16}, /* IdSel 1 SCSI PCI 1 */
 		{ 16+16, 16+16, 16+16, 16+16, 16+16}, /* IdSel 1 SCSI PCI 1 */
 		{ 16+ 0, 16+ 0, 16+ 1, 16+ 2, 16+ 3}, /* IdSel 2 slot 2 */
 		{ 16+ 0, 16+ 0, 16+ 1, 16+ 2, 16+ 3}, /* IdSel 2 slot 2 */

+ 3 - 3
arch/alpha/kernel/sys_ruffian.c

@@ -117,10 +117,10 @@ ruffian_kill_arch (int mode)
  *
  *
  */
  */
 
 
-static int __init
+static int
 ruffian_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 ruffian_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-        static char irq_tab[11][5] __initdata = {
+        static char irq_tab[11][5] = {
 	      /*INT  INTA INTB INTC INTD */
 	      /*INT  INTA INTB INTC INTD */
 		{-1,  -1,  -1,  -1,  -1},  /* IdSel 13,  21052	     */
 		{-1,  -1,  -1,  -1,  -1},  /* IdSel 13,  21052	     */
 		{-1,  -1,  -1,  -1,  -1},  /* IdSel 14,  SIO	     */
 		{-1,  -1,  -1,  -1,  -1},  /* IdSel 14,  SIO	     */
@@ -139,7 +139,7 @@ ruffian_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	return COMMON_TABLE_LOOKUP;
 	return COMMON_TABLE_LOOKUP;
 }
 }
 
 
-static u8 __init
+static u8
 ruffian_swizzle(struct pci_dev *dev, u8 *pinp)
 ruffian_swizzle(struct pci_dev *dev, u8 *pinp)
 {
 {
 	int slot, pin = *pinp;
 	int slot, pin = *pinp;

+ 2 - 2
arch/alpha/kernel/sys_rx164.c

@@ -142,7 +142,7 @@ rx164_init_irq(void)
  * 
  * 
  */
  */
 
 
-static int __init
+static int
 rx164_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 rx164_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
 #if 0
 #if 0
@@ -156,7 +156,7 @@ rx164_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	  { 16+1, 16+1, 16+6, 16+11, 16+16},      /* IdSel 10, slot 4 */
 	  { 16+1, 16+1, 16+6, 16+11, 16+16},      /* IdSel 10, slot 4 */
 	};
 	};
 #else
 #else
-	static char irq_tab[6][5] __initdata = {
+	static char irq_tab[6][5] = {
 	  /*INT   INTA  INTB  INTC   INTD */
 	  /*INT   INTA  INTB  INTC   INTD */
 	  { 16+0, 16+0, 16+6, 16+11, 16+16},      /* IdSel 5,  slot 0 */
 	  { 16+0, 16+0, 16+6, 16+11, 16+16},      /* IdSel 5,  slot 0 */
 	  { 16+1, 16+1, 16+7, 16+12, 16+17},      /* IdSel 6,  slot 1 */
 	  { 16+1, 16+1, 16+7, 16+12, 16+17},      /* IdSel 6,  slot 1 */

+ 5 - 5
arch/alpha/kernel/sys_sable.c

@@ -192,10 +192,10 @@ sable_init_irq(void)
  * with the values in the irq swizzling tables above.
  * with the values in the irq swizzling tables above.
  */
  */
 
 
-static int __init
+static int
 sable_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 sable_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[9][5] __initdata = {
+	static char irq_tab[9][5] = {
 		/*INT    INTA   INTB   INTC   INTD */
 		/*INT    INTA   INTB   INTC   INTD */
 		{ 32+0,  32+0,  32+0,  32+0,  32+0},  /* IdSel 0,  TULIP  */
 		{ 32+0,  32+0,  32+0,  32+0,  32+0},  /* IdSel 0,  TULIP  */
 		{ 32+1,  32+1,  32+1,  32+1,  32+1},  /* IdSel 1,  SCSI   */
 		{ 32+1,  32+1,  32+1,  32+1,  32+1},  /* IdSel 1,  SCSI   */
@@ -374,10 +374,10 @@ lynx_init_irq(void)
  * with the values in the irq swizzling tables above.
  * with the values in the irq swizzling tables above.
  */
  */
 
 
-static int __init
+static int
 lynx_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 lynx_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[19][5] __initdata = {
+	static char irq_tab[19][5] = {
 		/*INT    INTA   INTB   INTC   INTD */
 		/*INT    INTA   INTB   INTC   INTD */
 		{   -1,    -1,    -1,    -1,    -1},  /* IdSel 13,  PCEB   */
 		{   -1,    -1,    -1,    -1,    -1},  /* IdSel 13,  PCEB   */
 		{   -1,    -1,    -1,    -1,    -1},  /* IdSel 14,  PPB    */
 		{   -1,    -1,    -1,    -1,    -1},  /* IdSel 14,  PPB    */
@@ -404,7 +404,7 @@ lynx_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	return COMMON_TABLE_LOOKUP;
 	return COMMON_TABLE_LOOKUP;
 }
 }
 
 
-static u8 __init
+static u8
 lynx_swizzle(struct pci_dev *dev, u8 *pinp)
 lynx_swizzle(struct pci_dev *dev, u8 *pinp)
 {
 {
 	int slot, pin = *pinp;
 	int slot, pin = *pinp;

+ 4 - 4
arch/alpha/kernel/sys_sio.c

@@ -144,7 +144,7 @@ sio_fixup_irq_levels(unsigned int level_bits)
 	outb((level_bits >> 8) & 0xff, 0x4d1);
 	outb((level_bits >> 8) & 0xff, 0x4d1);
 }
 }
 
 
-static inline int __init
+static inline int
 noname_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 noname_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
 	/*
 	/*
@@ -165,7 +165,7 @@ noname_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	 * that they use the default INTA line, if they are interrupt
 	 * that they use the default INTA line, if they are interrupt
 	 * driven at all).
 	 * driven at all).
 	 */
 	 */
-	static char irq_tab[][5] __initdata = {
+	static char irq_tab[][5] = {
 		/*INT A   B   C   D */
 		/*INT A   B   C   D */
 		{ 3,  3,  3,  3,  3}, /* idsel  6 (53c810) */ 
 		{ 3,  3,  3,  3,  3}, /* idsel  6 (53c810) */ 
 		{-1, -1, -1, -1, -1}, /* idsel  7 (SIO: PCI/ISA bridge) */
 		{-1, -1, -1, -1, -1}, /* idsel  7 (SIO: PCI/ISA bridge) */
@@ -183,10 +183,10 @@ noname_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	return irq >= 0 ? tmp : -1;
 	return irq >= 0 ? tmp : -1;
 }
 }
 
 
-static inline int __init
+static inline int
 p2k_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 p2k_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[][5] __initdata = {
+	static char irq_tab[][5] = {
 		/*INT A   B   C   D */
 		/*INT A   B   C   D */
 		{ 0,  0, -1, -1, -1}, /* idsel  6 (53c810) */
 		{ 0,  0, -1, -1, -1}, /* idsel  6 (53c810) */
 		{-1, -1, -1, -1, -1}, /* idsel  7 (SIO: PCI/ISA bridge) */
 		{-1, -1, -1, -1, -1}, /* idsel  7 (SIO: PCI/ISA bridge) */

+ 2 - 2
arch/alpha/kernel/sys_sx164.c

@@ -94,10 +94,10 @@ sx164_init_irq(void)
  *   9  32 bit PCI option slot 3
  *   9  32 bit PCI option slot 3
  */
  */
 
 
-static int __init
+static int
 sx164_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 sx164_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[5][5] __initdata = {
+	static char irq_tab[5][5] = {
 		/*INT    INTA   INTB   INTC   INTD */
 		/*INT    INTA   INTB   INTC   INTD */
 		{ 16+ 9, 16+ 9, 16+13, 16+17, 16+21}, /* IdSel 5 slot 2 J17 */
 		{ 16+ 9, 16+ 9, 16+13, 16+17, 16+21}, /* IdSel 5 slot 2 J17 */
 		{ 16+11, 16+11, 16+15, 16+19, 16+23}, /* IdSel 6 slot 0 J19 */
 		{ 16+11, 16+11, 16+15, 16+19, 16+23}, /* IdSel 6 slot 0 J19 */

+ 3 - 3
arch/alpha/kernel/sys_takara.c

@@ -155,10 +155,10 @@ takara_init_irq(void)
  * assign it whatever the hell IRQ we like and it doesn't matter.
  * assign it whatever the hell IRQ we like and it doesn't matter.
  */
  */
 
 
-static int __init
+static int
 takara_map_irq_srm(const struct pci_dev *dev, u8 slot, u8 pin)
 takara_map_irq_srm(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[15][5] __initdata = {
+	static char irq_tab[15][5] = {
 		{ 16+3, 16+3, 16+3, 16+3, 16+3},   /* slot  6 == device 3 */
 		{ 16+3, 16+3, 16+3, 16+3, 16+3},   /* slot  6 == device 3 */
 		{ 16+2, 16+2, 16+2, 16+2, 16+2},   /* slot  7 == device 2 */
 		{ 16+2, 16+2, 16+2, 16+2, 16+2},   /* slot  7 == device 2 */
 		{ 16+1, 16+1, 16+1, 16+1, 16+1},   /* slot  8 == device 1 */
 		{ 16+1, 16+1, 16+1, 16+1, 16+1},   /* slot  8 == device 1 */
@@ -210,7 +210,7 @@ takara_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	return COMMON_TABLE_LOOKUP;
 	return COMMON_TABLE_LOOKUP;
 }
 }
 
 
-static u8 __init
+static u8
 takara_swizzle(struct pci_dev *dev, u8 *pinp)
 takara_swizzle(struct pci_dev *dev, u8 *pinp)
 {
 {
 	int slot = PCI_SLOT(dev->devfn);
 	int slot = PCI_SLOT(dev->devfn);

+ 2 - 2
arch/alpha/kernel/sys_wildfire.c

@@ -288,10 +288,10 @@ wildfire_device_interrupt(unsigned long vector)
  *   7	 64 bit PCI 1 option slot 7
  *   7	 64 bit PCI 1 option slot 7
  */
  */
 
 
-static int __init
+static int
 wildfire_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 wildfire_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 {
-	static char irq_tab[8][5] __initdata = {
+	static char irq_tab[8][5] = {
 		/*INT    INTA   INTB   INTC   INTD */
 		/*INT    INTA   INTB   INTC   INTD */
 		{ -1,    -1,    -1,    -1,    -1}, /* IdSel 0 ISA Bridge */
 		{ -1,    -1,    -1,    -1,    -1}, /* IdSel 0 ISA Bridge */
 		{ 36,    36,    36+1, 36+2, 36+3}, /* IdSel 1 SCSI builtin */
 		{ 36,    36,    36+1, 36+2, 36+3}, /* IdSel 1 SCSI builtin */

+ 6 - 5
arch/arc/boot/dts/hsdk.dts

@@ -137,14 +137,15 @@
 			/*
 			/*
 			 * DW sdio controller has external ciu clock divider
 			 * DW sdio controller has external ciu clock divider
 			 * controlled via register in SDIO IP. Due to its
 			 * controlled via register in SDIO IP. Due to its
-			 * unexpected default value (it should devide by 1
-			 * but it devides by 8) SDIO IP uses wrong clock and
+			 * unexpected default value (it should divide by 1
+			 * but it divides by 8) SDIO IP uses wrong clock and
 			 * works unstable (see STAR 9001204800)
 			 * works unstable (see STAR 9001204800)
+			 * We switched to the minimum possible value of the
+			 * divisor (div-by-2) in HSDK platform code.
 			 * So add temporary fix and change clock frequency
 			 * So add temporary fix and change clock frequency
-			 * from 100000000 to 12500000 Hz until we fix dw sdio
-			 * driver itself.
+			 * to 50000000 Hz until we fix dw sdio driver itself.
 			 */
 			 */
-			clock-frequency = <12500000>;
+			clock-frequency = <50000000>;
 			#clock-cells = <0>;
 			#clock-cells = <0>;
 		};
 		};
 
 

+ 0 - 1
arch/arc/configs/hsdk_defconfig

@@ -63,7 +63,6 @@ CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_PLTFM=y
 CONFIG_MMC_SDHCI_PLTFM=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW=y
 # CONFIG_IOMMU_SUPPORT is not set
 # CONFIG_IOMMU_SUPPORT is not set
-CONFIG_RESET_HSDK=y
 CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS=y
 CONFIG_VFAT_FS=y
 CONFIG_VFAT_FS=y
 CONFIG_TMPFS=y
 CONFIG_TMPFS=y

+ 5 - 0
arch/arc/kernel/smp.c

@@ -23,6 +23,8 @@
 #include <linux/cpumask.h>
 #include <linux/cpumask.h>
 #include <linux/reboot.h>
 #include <linux/reboot.h>
 #include <linux/irqdomain.h>
 #include <linux/irqdomain.h>
+#include <linux/export.h>
+
 #include <asm/processor.h>
 #include <asm/processor.h>
 #include <asm/setup.h>
 #include <asm/setup.h>
 #include <asm/mach_desc.h>
 #include <asm/mach_desc.h>
@@ -30,6 +32,9 @@
 #ifndef CONFIG_ARC_HAS_LLSC
 #ifndef CONFIG_ARC_HAS_LLSC
 arch_spinlock_t smp_atomic_ops_lock = __ARCH_SPIN_LOCK_UNLOCKED;
 arch_spinlock_t smp_atomic_ops_lock = __ARCH_SPIN_LOCK_UNLOCKED;
 arch_spinlock_t smp_bitops_lock = __ARCH_SPIN_LOCK_UNLOCKED;
 arch_spinlock_t smp_bitops_lock = __ARCH_SPIN_LOCK_UNLOCKED;
+
+EXPORT_SYMBOL_GPL(smp_atomic_ops_lock);
+EXPORT_SYMBOL_GPL(smp_bitops_lock);
 #endif
 #endif
 
 
 struct plat_smp_ops  __weak plat_smp_ops;
 struct plat_smp_ops  __weak plat_smp_ops;

+ 1 - 0
arch/arc/plat-hsdk/Kconfig

@@ -8,3 +8,4 @@
 menuconfig ARC_SOC_HSDK
 menuconfig ARC_SOC_HSDK
 	bool "ARC HS Development Kit SOC"
 	bool "ARC HS Development Kit SOC"
 	select CLK_HSDK
 	select CLK_HSDK
+	select RESET_HSDK

+ 10 - 0
arch/arc/plat-hsdk/platform.c

@@ -74,6 +74,10 @@ static void __init hsdk_set_cpu_freq_1ghz(void)
 		pr_err("Failed to setup CPU frequency to 1GHz!");
 		pr_err("Failed to setup CPU frequency to 1GHz!");
 }
 }
 
 
+#define SDIO_BASE		(ARC_PERIPHERAL_BASE + 0xA000)
+#define SDIO_UHS_REG_EXT	(SDIO_BASE + 0x108)
+#define SDIO_UHS_REG_EXT_DIV_2	(2 << 30)
+
 static void __init hsdk_init_early(void)
 static void __init hsdk_init_early(void)
 {
 {
 	/*
 	/*
@@ -89,6 +93,12 @@ static void __init hsdk_init_early(void)
 	/* Really apply settings made above */
 	/* Really apply settings made above */
 	writel(1, (void __iomem *) CREG_PAE_UPDATE);
 	writel(1, (void __iomem *) CREG_PAE_UPDATE);
 
 
+	/*
+	 * Switch SDIO external ciu clock divider from default div-by-8 to
+	 * minimum possible div-by-2.
+	 */
+	iowrite32(SDIO_UHS_REG_EXT_DIV_2, (void __iomem *) SDIO_UHS_REG_EXT);
+
 	/*
 	/*
 	 * Setup CPU frequency to 1GHz.
 	 * Setup CPU frequency to 1GHz.
 	 * TODO: remove it after smart hsdk pll driver will be introduced.
 	 * TODO: remove it after smart hsdk pll driver will be introduced.

+ 1 - 1
arch/arm/Makefile

@@ -131,7 +131,7 @@ endif
 KBUILD_CFLAGS	+=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
 KBUILD_CFLAGS	+=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
 KBUILD_AFLAGS	+=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float
 KBUILD_AFLAGS	+=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float
 
 
-CHECKFLAGS	+= -D__arm__
+CHECKFLAGS	+= -D__arm__ -m32
 
 
 #Default value
 #Default value
 head-y		:= arch/arm/kernel/head$(MMUEXT).o
 head-y		:= arch/arm/kernel/head$(MMUEXT).o

+ 4 - 0
arch/arm/boot/compressed/debug.S

@@ -23,7 +23,11 @@ ENTRY(putc)
 	strb	r0, [r1]
 	strb	r0, [r1]
 	mov	r0, #0x03		@ SYS_WRITEC
 	mov	r0, #0x03		@ SYS_WRITEC
    ARM(	svc	#0x123456	)
    ARM(	svc	#0x123456	)
+#ifdef CONFIG_CPU_V7M
+ THUMB(	bkpt	#0xab		)
+#else
  THUMB(	svc	#0xab		)
  THUMB(	svc	#0xab		)
+#endif
 	mov	pc, lr
 	mov	pc, lr
 	.align	2
 	.align	2
 1:	.word	_GLOBAL_OFFSET_TABLE_ - .
 1:	.word	_GLOBAL_OFFSET_TABLE_ - .

+ 2 - 2
arch/arm/boot/dts/armada-38x.dtsi

@@ -178,7 +178,7 @@
 			};
 			};
 
 
 			i2c0: i2c@11000 {
 			i2c0: i2c@11000 {
-				compatible = "marvell,mv64xxx-i2c";
+				compatible = "marvell,mv78230-a0-i2c", "marvell,mv64xxx-i2c";
 				reg = <0x11000 0x20>;
 				reg = <0x11000 0x20>;
 				#address-cells = <1>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				#size-cells = <0>;
@@ -189,7 +189,7 @@
 			};
 			};
 
 
 			i2c1: i2c@11100 {
 			i2c1: i2c@11100 {
-				compatible = "marvell,mv64xxx-i2c";
+				compatible = "marvell,mv78230-a0-i2c", "marvell,mv64xxx-i2c";
 				reg = <0x11100 0x20>;
 				reg = <0x11100 0x20>;
 				#address-cells = <1>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				#size-cells = <0>;

+ 2 - 2
arch/arm/boot/dts/at91-sama5d27_som1.dtsi

@@ -67,8 +67,8 @@
 				pinctrl-0 = <&pinctrl_macb0_default>;
 				pinctrl-0 = <&pinctrl_macb0_default>;
 				phy-mode = "rmii";
 				phy-mode = "rmii";
 
 
-				ethernet-phy@1 {
-					reg = <0x1>;
+				ethernet-phy@0 {
+					reg = <0x0>;
 					interrupt-parent = <&pioA>;
 					interrupt-parent = <&pioA>;
 					interrupts = <PIN_PD31 IRQ_TYPE_LEVEL_LOW>;
 					interrupts = <PIN_PD31 IRQ_TYPE_LEVEL_LOW>;
 					pinctrl-names = "default";
 					pinctrl-names = "default";

+ 15 - 1
arch/arm/boot/dts/at91-sama5d2_xplained.dts

@@ -309,7 +309,7 @@
 				vddana-supply = <&vdd_3v3_lp_reg>;
 				vddana-supply = <&vdd_3v3_lp_reg>;
 				vref-supply = <&vdd_3v3_lp_reg>;
 				vref-supply = <&vdd_3v3_lp_reg>;
 				pinctrl-names = "default";
 				pinctrl-names = "default";
-				pinctrl-0 = <&pinctrl_adc_default>;
+				pinctrl-0 = <&pinctrl_adc_default &pinctrl_adtrg_default>;
 				status = "okay";
 				status = "okay";
 			};
 			};
 
 
@@ -340,6 +340,20 @@
 					bias-disable;
 					bias-disable;
 				};
 				};
 
 
+				/*
+				 * The ADTRG pin can work on any edge type.
+				 * In here it's being pulled up, so need to
+				 * connect it to ground to get an edge e.g.
+				 * Trigger can be configured on falling, rise
+				 * or any edge, and the pull-up can be changed
+				 * to pull-down or left floating according to
+				 * needs.
+				 */
+				pinctrl_adtrg_default: adtrg_default {
+					pinmux = <PIN_PD31__ADTRG>;
+					bias-pull-up;
+				};
+
 				pinctrl_charger_chglev: charger_chglev {
 				pinctrl_charger_chglev: charger_chglev {
 					pinmux = <PIN_PA12__GPIO>;
 					pinmux = <PIN_PA12__GPIO>;
 					bias-disable;
 					bias-disable;

+ 3 - 6
arch/arm/boot/dts/bcm2835-rpi-zero-w.dts

@@ -18,12 +18,9 @@
 	compatible = "raspberrypi,model-zero-w", "brcm,bcm2835";
 	compatible = "raspberrypi,model-zero-w", "brcm,bcm2835";
 	model = "Raspberry Pi Zero W";
 	model = "Raspberry Pi Zero W";
 
 
-	/* Needed by firmware to properly init UARTs */
-	aliases {
-		uart0 = "/soc/serial@7e201000";
-		uart1 = "/soc/serial@7e215040";
-		serial0 = "/soc/serial@7e201000";
-		serial1 = "/soc/serial@7e215040";
+	chosen {
+		/* 8250 auxiliary UART instead of pl011 */
+		stdout-path = "serial1:115200n8";
 	};
 	};
 
 
 	leds {
 	leds {

+ 5 - 0
arch/arm/boot/dts/bcm2837-rpi-3-b.dts

@@ -8,6 +8,11 @@
 	compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
 	compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
 	model = "Raspberry Pi 3 Model B";
 	model = "Raspberry Pi 3 Model B";
 
 
+	chosen {
+		/* 8250 auxiliary UART instead of pl011 */
+		stdout-path = "serial1:115200n8";
+	};
+
 	memory {
 	memory {
 		reg = <0 0x40000000>;
 		reg = <0 0x40000000>;
 	};
 	};

+ 6 - 1
arch/arm/boot/dts/bcm283x.dtsi

@@ -20,8 +20,13 @@
 	#address-cells = <1>;
 	#address-cells = <1>;
 	#size-cells = <1>;
 	#size-cells = <1>;
 
 
+	aliases {
+		serial0 = &uart0;
+		serial1 = &uart1;
+	};
+
 	chosen {
 	chosen {
-		bootargs = "earlyprintk console=ttyAMA0";
+		stdout-path = "serial0:115200n8";
 	};
 	};
 
 
 	thermal-zones {
 	thermal-zones {

+ 2 - 1
arch/arm/boot/dts/gemini.dtsi

@@ -145,11 +145,12 @@
 		};
 		};
 
 
 		watchdog@41000000 {
 		watchdog@41000000 {
-			compatible = "cortina,gemini-watchdog";
+			compatible = "cortina,gemini-watchdog", "faraday,ftwdt010";
 			reg = <0x41000000 0x1000>;
 			reg = <0x41000000 0x1000>;
 			interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
 			interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
 			resets = <&syscon GEMINI_RESET_WDOG>;
 			resets = <&syscon GEMINI_RESET_WDOG>;
 			clocks = <&syscon GEMINI_CLK_APB>;
 			clocks = <&syscon GEMINI_CLK_APB>;
+			clock-names = "PCLK";
 		};
 		};
 
 
 		uart0: serial@42000000 {
 		uart0: serial@42000000 {

+ 4 - 4
arch/arm/boot/dts/imx7d.dtsi

@@ -144,10 +144,10 @@
 		interrupt-names = "msi";
 		interrupt-names = "msi";
 		#interrupt-cells = <1>;
 		#interrupt-cells = <1>;
 		interrupt-map-mask = <0 0 0 0x7>;
 		interrupt-map-mask = <0 0 0 0x7>;
-		interrupt-map = <0 0 0 1 &intc GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
-				<0 0 0 2 &intc GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
-				<0 0 0 3 &intc GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
-				<0 0 0 4 &intc GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-map = <0 0 0 1 &intc GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
+				<0 0 0 2 &intc GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
+				<0 0 0 3 &intc GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
+				<0 0 0 4 &intc GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&clks IMX7D_PCIE_CTRL_ROOT_CLK>,
 		clocks = <&clks IMX7D_PCIE_CTRL_ROOT_CLK>,
 			 <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>,
 			 <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>,
 			 <&clks IMX7D_PCIE_PHY_ROOT_CLK>;
 			 <&clks IMX7D_PCIE_PHY_ROOT_CLK>;

+ 2 - 1
arch/arm/boot/dts/moxart.dtsi

@@ -87,9 +87,10 @@
 		};
 		};
 
 
 		watchdog: watchdog@98500000 {
 		watchdog: watchdog@98500000 {
-			compatible = "moxa,moxart-watchdog";
+			compatible = "moxa,moxart-watchdog", "faraday,ftwdt010";
 			reg = <0x98500000 0x10>;
 			reg = <0x98500000 0x10>;
 			clocks = <&clk_apb>;
 			clocks = <&clk_apb>;
+			clock-names = "PCLK";
 		};
 		};
 
 
 		sdhci: sdhci@98e00000 {
 		sdhci: sdhci@98e00000 {

+ 1 - 0
arch/arm/boot/dts/sama5d2.dtsi

@@ -1430,6 +1430,7 @@
 				atmel,min-sample-rate-hz = <200000>;
 				atmel,min-sample-rate-hz = <200000>;
 				atmel,max-sample-rate-hz = <20000000>;
 				atmel,max-sample-rate-hz = <20000000>;
 				atmel,startup-time-ms = <4>;
 				atmel,startup-time-ms = <4>;
+				atmel,trigger-edge-type = <IRQ_TYPE_EDGE_RISING>;
 				status = "disabled";
 				status = "disabled";
 			};
 			};
 
 

+ 8 - 8
arch/arm/boot/dts/sun6i-a31.dtsi

@@ -311,8 +311,8 @@
 					#size-cells = <0>;
 					#size-cells = <0>;
 					reg = <0>;
 					reg = <0>;
 
 
-					tcon1_in_drc1: endpoint@0 {
-						reg = <0>;
+					tcon1_in_drc1: endpoint@1 {
+						reg = <1>;
 						remote-endpoint = <&drc1_out_tcon1>;
 						remote-endpoint = <&drc1_out_tcon1>;
 					};
 					};
 				};
 				};
@@ -1012,8 +1012,8 @@
 					#size-cells = <0>;
 					#size-cells = <0>;
 					reg = <1>;
 					reg = <1>;
 
 
-					be1_out_drc1: endpoint@0 {
-						reg = <0>;
+					be1_out_drc1: endpoint@1 {
+						reg = <1>;
 						remote-endpoint = <&drc1_in_be1>;
 						remote-endpoint = <&drc1_in_be1>;
 					};
 					};
 				};
 				};
@@ -1042,8 +1042,8 @@
 					#size-cells = <0>;
 					#size-cells = <0>;
 					reg = <0>;
 					reg = <0>;
 
 
-					drc1_in_be1: endpoint@0 {
-						reg = <0>;
+					drc1_in_be1: endpoint@1 {
+						reg = <1>;
 						remote-endpoint = <&be1_out_drc1>;
 						remote-endpoint = <&be1_out_drc1>;
 					};
 					};
 				};
 				};
@@ -1053,8 +1053,8 @@
 					#size-cells = <0>;
 					#size-cells = <0>;
 					reg = <1>;
 					reg = <1>;
 
 
-					drc1_out_tcon1: endpoint@0 {
-						reg = <0>;
+					drc1_out_tcon1: endpoint@1 {
+						reg = <1>;
 						remote-endpoint = <&tcon1_in_drc1>;
 						remote-endpoint = <&tcon1_in_drc1>;
 					};
 					};
 				};
 				};

+ 8 - 0
arch/arm/kernel/debug.S

@@ -115,7 +115,11 @@ ENTRY(printascii)
 		mov	r1, r0
 		mov	r1, r0
 		mov	r0, #0x04		@ SYS_WRITE0
 		mov	r0, #0x04		@ SYS_WRITE0
 	ARM(	svc	#0x123456	)
 	ARM(	svc	#0x123456	)
+#ifdef CONFIG_CPU_V7M
+	THUMB(	bkpt	#0xab		)
+#else
 	THUMB(	svc	#0xab		)
 	THUMB(	svc	#0xab		)
+#endif
 		ret	lr
 		ret	lr
 ENDPROC(printascii)
 ENDPROC(printascii)
 
 
@@ -124,7 +128,11 @@ ENTRY(printch)
 		strb	r0, [r1]
 		strb	r0, [r1]
 		mov	r0, #0x03		@ SYS_WRITEC
 		mov	r0, #0x03		@ SYS_WRITEC
 	ARM(	svc	#0x123456	)
 	ARM(	svc	#0x123456	)
+#ifdef CONFIG_CPU_V7M
+	THUMB(	bkpt	#0xab		)
+#else
 	THUMB(	svc	#0xab		)
 	THUMB(	svc	#0xab		)
+#endif
 		ret	lr
 		ret	lr
 ENDPROC(printch)
 ENDPROC(printch)
 
 

+ 4 - 0
arch/arm/mach-ux500/cpu-db8500.c

@@ -32,6 +32,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/arch.h>
 
 
 #include "db8500-regs.h"
 #include "db8500-regs.h"
+#include "pm_domains.h"
 
 
 static int __init ux500_l2x0_unlock(void)
 static int __init ux500_l2x0_unlock(void)
 {
 {
@@ -157,6 +158,9 @@ static const struct of_device_id u8500_local_bus_nodes[] = {
 
 
 static void __init u8500_init_machine(void)
 static void __init u8500_init_machine(void)
 {
 {
+	/* Initialize ux500 power domains */
+	ux500_pm_domains_init();
+
 	/* automatically probe child nodes of dbx5x0 devices */
 	/* automatically probe child nodes of dbx5x0 devices */
 	if (of_machine_is_compatible("st-ericsson,u8540"))
 	if (of_machine_is_compatible("st-ericsson,u8540"))
 		of_platform_populate(NULL, u8500_local_bus_nodes,
 		of_platform_populate(NULL, u8500_local_bus_nodes,

+ 0 - 4
arch/arm/mach-ux500/pm.c

@@ -19,7 +19,6 @@
 #include <linux/of_address.h>
 #include <linux/of_address.h>
 
 
 #include "db8500-regs.h"
 #include "db8500-regs.h"
-#include "pm_domains.h"
 
 
 /* ARM WFI Standby signal register */
 /* ARM WFI Standby signal register */
 #define PRCM_ARM_WFI_STANDBY    (prcmu_base + 0x130)
 #define PRCM_ARM_WFI_STANDBY    (prcmu_base + 0x130)
@@ -203,7 +202,4 @@ void __init ux500_pm_init(u32 phy_base, u32 size)
 
 
 	/* Set up ux500 suspend callbacks. */
 	/* Set up ux500 suspend callbacks. */
 	suspend_set_ops(UX500_SUSPEND_OPS);
 	suspend_set_ops(UX500_SUSPEND_OPS);
-
-	/* Initialize ux500 power domains */
-	ux500_pm_domains_init();
 }
 }

+ 5 - 0
arch/arm/mm/nommu.c

@@ -344,6 +344,11 @@ void __init arm_mm_memblock_reserve(void)
 	 * reserved here.
 	 * reserved here.
 	 */
 	 */
 #endif
 #endif
+	/*
+	 * In any case, always ensure address 0 is never used as many things
+	 * get very confused if 0 is returned as a legitimate address.
+	 */
+	memblock_reserve(0, 1);
 }
 }
 
 
 void __init adjust_lowmem_bounds(void)
 void __init adjust_lowmem_bounds(void)

+ 1 - 1
arch/arm/xen/p2m.c

@@ -1,7 +1,7 @@
 #include <linux/bootmem.h>
 #include <linux/bootmem.h>
 #include <linux/gfp.h>
 #include <linux/gfp.h>
 #include <linux/export.h>
 #include <linux/export.h>
-#include <linux/rwlock.h>
+#include <linux/spinlock.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/types.h>
 #include <linux/dma-mapping.h>
 #include <linux/dma-mapping.h>

+ 1 - 8
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts

@@ -61,13 +61,6 @@
 	chosen {
 	chosen {
 		stdout-path = "serial0:115200n8";
 		stdout-path = "serial0:115200n8";
 	};
 	};
-
-	reg_vcc3v3: vcc3v3 {
-		compatible = "regulator-fixed";
-		regulator-name = "vcc3v3";
-		regulator-min-microvolt = <3300000>;
-		regulator-max-microvolt = <3300000>;
-	};
 };
 };
 
 
 &ehci0 {
 &ehci0 {
@@ -91,7 +84,7 @@
 &mmc0 {
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
 	pinctrl-0 = <&mmc0_pins>;
-	vmmc-supply = <&reg_vcc3v3>;
+	vmmc-supply = <&reg_dcdc1>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
 	cd-inverted;
 	cd-inverted;
 	disable-wp;
 	disable-wp;

+ 3 - 3
arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi

@@ -336,7 +336,7 @@
 				/* non-prefetchable memory */
 				/* non-prefetchable memory */
 				0x82000000 0 0xf6000000 0  0xf6000000 0 0xf00000>;
 				0x82000000 0 0xf6000000 0  0xf6000000 0 0xf00000>;
 			interrupt-map-mask = <0 0 0 0>;
 			interrupt-map-mask = <0 0 0 0>;
-			interrupt-map = <0 0 0 0 &cpm_icu 0 ICU_GRP_NSR 22 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-map = <0 0 0 0 &cpm_icu ICU_GRP_NSR 22 IRQ_TYPE_LEVEL_HIGH>;
 			interrupts = <ICU_GRP_NSR 22 IRQ_TYPE_LEVEL_HIGH>;
 			interrupts = <ICU_GRP_NSR 22 IRQ_TYPE_LEVEL_HIGH>;
 			num-lanes = <1>;
 			num-lanes = <1>;
 			clocks = <&cpm_clk 1 13>;
 			clocks = <&cpm_clk 1 13>;
@@ -362,7 +362,7 @@
 				/* non-prefetchable memory */
 				/* non-prefetchable memory */
 				0x82000000 0 0xf7000000 0  0xf7000000 0 0xf00000>;
 				0x82000000 0 0xf7000000 0  0xf7000000 0 0xf00000>;
 			interrupt-map-mask = <0 0 0 0>;
 			interrupt-map-mask = <0 0 0 0>;
-			interrupt-map = <0 0 0 0 &cpm_icu 0 ICU_GRP_NSR 24 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-map = <0 0 0 0 &cpm_icu ICU_GRP_NSR 24 IRQ_TYPE_LEVEL_HIGH>;
 			interrupts = <ICU_GRP_NSR 24 IRQ_TYPE_LEVEL_HIGH>;
 			interrupts = <ICU_GRP_NSR 24 IRQ_TYPE_LEVEL_HIGH>;
 
 
 			num-lanes = <1>;
 			num-lanes = <1>;
@@ -389,7 +389,7 @@
 				/* non-prefetchable memory */
 				/* non-prefetchable memory */
 				0x82000000 0 0xf8000000 0  0xf8000000 0 0xf00000>;
 				0x82000000 0 0xf8000000 0  0xf8000000 0 0xf00000>;
 			interrupt-map-mask = <0 0 0 0>;
 			interrupt-map-mask = <0 0 0 0>;
-			interrupt-map = <0 0 0 0 &cpm_icu 0 ICU_GRP_NSR 23 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-map = <0 0 0 0 &cpm_icu ICU_GRP_NSR 23 IRQ_TYPE_LEVEL_HIGH>;
 			interrupts = <ICU_GRP_NSR 23 IRQ_TYPE_LEVEL_HIGH>;
 			interrupts = <ICU_GRP_NSR 23 IRQ_TYPE_LEVEL_HIGH>;
 
 
 			num-lanes = <1>;
 			num-lanes = <1>;

+ 3 - 3
arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi

@@ -335,7 +335,7 @@
 				/* non-prefetchable memory */
 				/* non-prefetchable memory */
 				0x82000000 0 0xfa000000 0  0xfa000000 0 0xf00000>;
 				0x82000000 0 0xfa000000 0  0xfa000000 0 0xf00000>;
 			interrupt-map-mask = <0 0 0 0>;
 			interrupt-map-mask = <0 0 0 0>;
-			interrupt-map = <0 0 0 0 &cps_icu 0 ICU_GRP_NSR 22 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-map = <0 0 0 0 &cps_icu ICU_GRP_NSR 22 IRQ_TYPE_LEVEL_HIGH>;
 			interrupts = <ICU_GRP_NSR 22 IRQ_TYPE_LEVEL_HIGH>;
 			interrupts = <ICU_GRP_NSR 22 IRQ_TYPE_LEVEL_HIGH>;
 			num-lanes = <1>;
 			num-lanes = <1>;
 			clocks = <&cps_clk 1 13>;
 			clocks = <&cps_clk 1 13>;
@@ -361,7 +361,7 @@
 				/* non-prefetchable memory */
 				/* non-prefetchable memory */
 				0x82000000 0 0xfb000000 0  0xfb000000 0 0xf00000>;
 				0x82000000 0 0xfb000000 0  0xfb000000 0 0xf00000>;
 			interrupt-map-mask = <0 0 0 0>;
 			interrupt-map-mask = <0 0 0 0>;
-			interrupt-map = <0 0 0 0 &cps_icu 0 ICU_GRP_NSR 24 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-map = <0 0 0 0 &cps_icu ICU_GRP_NSR 24 IRQ_TYPE_LEVEL_HIGH>;
 			interrupts = <ICU_GRP_NSR 24 IRQ_TYPE_LEVEL_HIGH>;
 			interrupts = <ICU_GRP_NSR 24 IRQ_TYPE_LEVEL_HIGH>;
 
 
 			num-lanes = <1>;
 			num-lanes = <1>;
@@ -388,7 +388,7 @@
 				/* non-prefetchable memory */
 				/* non-prefetchable memory */
 				0x82000000 0 0xfc000000 0  0xfc000000 0 0xf00000>;
 				0x82000000 0 0xfc000000 0  0xfc000000 0 0xf00000>;
 			interrupt-map-mask = <0 0 0 0>;
 			interrupt-map-mask = <0 0 0 0>;
-			interrupt-map = <0 0 0 0 &cps_icu 0 ICU_GRP_NSR 23 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-map = <0 0 0 0 &cps_icu ICU_GRP_NSR 23 IRQ_TYPE_LEVEL_HIGH>;
 			interrupts = <ICU_GRP_NSR 23 IRQ_TYPE_LEVEL_HIGH>;
 			interrupts = <ICU_GRP_NSR 23 IRQ_TYPE_LEVEL_HIGH>;
 
 
 			num-lanes = <1>;
 			num-lanes = <1>;

+ 10 - 0
arch/arm64/boot/dts/renesas/salvator-common.dtsi

@@ -62,6 +62,7 @@
 		brightness-levels = <256 128 64 16 8 4 0>;
 		brightness-levels = <256 128 64 16 8 4 0>;
 		default-brightness-level = <6>;
 		default-brightness-level = <6>;
 
 
+		power-supply = <&reg_12v>;
 		enable-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
 		enable-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
 	};
 	};
 
 
@@ -83,6 +84,15 @@
 		regulator-always-on;
 		regulator-always-on;
 	};
 	};
 
 
+	reg_12v: regulator2 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-12V";
+		regulator-min-microvolt = <12000000>;
+		regulator-max-microvolt = <12000000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
 	rsnd_ak4613: sound {
 	rsnd_ak4613: sound {
 		compatible = "simple-audio-card";
 		compatible = "simple-audio-card";
 
 

+ 1 - 1
arch/arm64/boot/dts/rockchip/rk3328.dtsi

@@ -582,7 +582,7 @@
 	vop_mmu: iommu@ff373f00 {
 	vop_mmu: iommu@ff373f00 {
 		compatible = "rockchip,iommu";
 		compatible = "rockchip,iommu";
 		reg = <0x0 0xff373f00 0x0 0x100>;
 		reg = <0x0 0xff373f00 0x0 0x100>;
-		interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH 0>;
+		interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
 		interrupt-names = "vop_mmu";
 		interrupt-names = "vop_mmu";
 		#iommu-cells = <0>;
 		#iommu-cells = <0>;
 		status = "disabled";
 		status = "disabled";

+ 1 - 1
arch/arm64/boot/dts/rockchip/rk3368.dtsi

@@ -740,7 +740,7 @@
 	iep_mmu: iommu@ff900800 {
 	iep_mmu: iommu@ff900800 {
 		compatible = "rockchip,iommu";
 		compatible = "rockchip,iommu";
 		reg = <0x0 0xff900800 0x0 0x100>;
 		reg = <0x0 0xff900800 0x0 0x100>;
-		interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH 0>;
+		interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
 		interrupt-names = "iep_mmu";
 		interrupt-names = "iep_mmu";
 		#iommu-cells = <0>;
 		#iommu-cells = <0>;
 		status = "disabled";
 		status = "disabled";

+ 2 - 2
arch/arm64/boot/dts/rockchip/rk3399-firefly.dts

@@ -371,10 +371,10 @@
 				regulator-always-on;
 				regulator-always-on;
 				regulator-boot-on;
 				regulator-boot-on;
 				regulator-min-microvolt = <1800000>;
 				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <3300000>;
+				regulator-max-microvolt = <3000000>;
 				regulator-state-mem {
 				regulator-state-mem {
 					regulator-on-in-suspend;
 					regulator-on-in-suspend;
-					regulator-suspend-microvolt = <3300000>;
+					regulator-suspend-microvolt = <3000000>;
 				};
 				};
 			};
 			};
 
 

+ 2 - 2
arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi

@@ -325,12 +325,12 @@
 			vcc_sd: LDO_REG4 {
 			vcc_sd: LDO_REG4 {
 				regulator-name = "vcc_sd";
 				regulator-name = "vcc_sd";
 				regulator-min-microvolt = <1800000>;
 				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <3300000>;
+				regulator-max-microvolt = <3000000>;
 				regulator-always-on;
 				regulator-always-on;
 				regulator-boot-on;
 				regulator-boot-on;
 				regulator-state-mem {
 				regulator-state-mem {
 					regulator-on-in-suspend;
 					regulator-on-in-suspend;
-					regulator-suspend-microvolt = <3300000>;
+					regulator-suspend-microvolt = <3000000>;
 				};
 				};
 			};
 			};
 
 

+ 2 - 2
arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi

@@ -315,10 +315,10 @@
 				regulator-always-on;
 				regulator-always-on;
 				regulator-boot-on;
 				regulator-boot-on;
 				regulator-min-microvolt = <1800000>;
 				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <3300000>;
+				regulator-max-microvolt = <3000000>;
 				regulator-state-mem {
 				regulator-state-mem {
 					regulator-on-in-suspend;
 					regulator-on-in-suspend;
-					regulator-suspend-microvolt = <3300000>;
+					regulator-suspend-microvolt = <3000000>;
 				};
 				};
 			};
 			};
 
 

+ 4 - 2
arch/mips/include/asm/cmpxchg.h

@@ -155,14 +155,16 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
 		return __cmpxchg_small(ptr, old, new, size);
 		return __cmpxchg_small(ptr, old, new, size);
 
 
 	case 4:
 	case 4:
-		return __cmpxchg_asm("ll", "sc", (volatile u32 *)ptr, old, new);
+		return __cmpxchg_asm("ll", "sc", (volatile u32 *)ptr,
+				     (u32)old, new);
 
 
 	case 8:
 	case 8:
 		/* lld/scd are only available for MIPS64 */
 		/* lld/scd are only available for MIPS64 */
 		if (!IS_ENABLED(CONFIG_64BIT))
 		if (!IS_ENABLED(CONFIG_64BIT))
 			return __cmpxchg_called_with_bad_pointer();
 			return __cmpxchg_called_with_bad_pointer();
 
 
-		return __cmpxchg_asm("lld", "scd", (volatile u64 *)ptr, old, new);
+		return __cmpxchg_asm("lld", "scd", (volatile u64 *)ptr,
+				     (u64)old, new);
 
 
 	default:
 	default:
 		return __cmpxchg_called_with_bad_pointer();
 		return __cmpxchg_called_with_bad_pointer();

+ 21 - 17
arch/mips/loongson32/common/platform.c

@@ -183,18 +183,20 @@ int ls1x_eth_mux_init(struct platform_device *pdev, void *priv)
 }
 }
 
 
 static struct plat_stmmacenet_data ls1x_eth0_pdata = {
 static struct plat_stmmacenet_data ls1x_eth0_pdata = {
-	.bus_id		= 0,
-	.phy_addr	= -1,
+	.bus_id			= 0,
+	.phy_addr		= -1,
 #if defined(CONFIG_LOONGSON1_LS1B)
 #if defined(CONFIG_LOONGSON1_LS1B)
-	.interface	= PHY_INTERFACE_MODE_MII,
+	.interface		= PHY_INTERFACE_MODE_MII,
 #elif defined(CONFIG_LOONGSON1_LS1C)
 #elif defined(CONFIG_LOONGSON1_LS1C)
-	.interface	= PHY_INTERFACE_MODE_RMII,
+	.interface		= PHY_INTERFACE_MODE_RMII,
 #endif
 #endif
-	.mdio_bus_data	= &ls1x_mdio_bus_data,
-	.dma_cfg	= &ls1x_eth_dma_cfg,
-	.has_gmac	= 1,
-	.tx_coe		= 1,
-	.init		= ls1x_eth_mux_init,
+	.mdio_bus_data		= &ls1x_mdio_bus_data,
+	.dma_cfg		= &ls1x_eth_dma_cfg,
+	.has_gmac		= 1,
+	.tx_coe			= 1,
+	.rx_queues_to_use	= 1,
+	.tx_queues_to_use	= 1,
+	.init			= ls1x_eth_mux_init,
 };
 };
 
 
 static struct resource ls1x_eth0_resources[] = {
 static struct resource ls1x_eth0_resources[] = {
@@ -222,14 +224,16 @@ struct platform_device ls1x_eth0_pdev = {
 
 
 #ifdef CONFIG_LOONGSON1_LS1B
 #ifdef CONFIG_LOONGSON1_LS1B
 static struct plat_stmmacenet_data ls1x_eth1_pdata = {
 static struct plat_stmmacenet_data ls1x_eth1_pdata = {
-	.bus_id		= 1,
-	.phy_addr	= -1,
-	.interface	= PHY_INTERFACE_MODE_MII,
-	.mdio_bus_data	= &ls1x_mdio_bus_data,
-	.dma_cfg	= &ls1x_eth_dma_cfg,
-	.has_gmac	= 1,
-	.tx_coe		= 1,
-	.init		= ls1x_eth_mux_init,
+	.bus_id			= 1,
+	.phy_addr		= -1,
+	.interface		= PHY_INTERFACE_MODE_MII,
+	.mdio_bus_data		= &ls1x_mdio_bus_data,
+	.dma_cfg		= &ls1x_eth_dma_cfg,
+	.has_gmac		= 1,
+	.tx_coe			= 1,
+	.rx_queues_to_use	= 1,
+	.tx_queues_to_use	= 1,
+	.init			= ls1x_eth_mux_init,
 };
 };
 
 
 static struct resource ls1x_eth1_resources[] = {
 static struct resource ls1x_eth1_resources[] = {

+ 0 - 2
arch/mips/math-emu/cp1emu.c

@@ -2558,7 +2558,6 @@ dcopuop:
 					break;
 					break;
 				default:
 				default:
 					/* Reserved R6 ops */
 					/* Reserved R6 ops */
-					pr_err("Reserved MIPS R6 CMP.condn.S operation\n");
 					return SIGILL;
 					return SIGILL;
 				}
 				}
 			}
 			}
@@ -2719,7 +2718,6 @@ dcopuop:
 					break;
 					break;
 				default:
 				default:
 					/* Reserved R6 ops */
 					/* Reserved R6 ops */
-					pr_err("Reserved MIPS R6 CMP.condn.D operation\n");
 					return SIGILL;
 					return SIGILL;
 				}
 				}
 			}
 			}

+ 1 - 1
arch/mips/net/ebpf_jit.c

@@ -667,7 +667,7 @@ static int build_one_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
 {
 {
 	int src, dst, r, td, ts, mem_off, b_off;
 	int src, dst, r, td, ts, mem_off, b_off;
 	bool need_swap, did_move, cmp_eq;
 	bool need_swap, did_move, cmp_eq;
-	unsigned int target;
+	unsigned int target = 0;
 	u64 t64;
 	u64 t64;
 	s64 t64s;
 	s64 t64s;
 	int bpf_op = BPF_OP(insn->code);
 	int bpf_op = BPF_OP(insn->code);

+ 2 - 4
arch/mips/tools/generic-board-config.sh

@@ -30,8 +30,6 @@ cfg="$4"
 boards_origin="$5"
 boards_origin="$5"
 shift 5
 shift 5
 
 
-cd "${srctree}"
-
 # Only print Skipping... lines if the user explicitly specified BOARDS=. In the
 # Only print Skipping... lines if the user explicitly specified BOARDS=. In the
 # general case it only serves to obscure the useful output about what actually
 # general case it only serves to obscure the useful output about what actually
 # was included.
 # was included.
@@ -48,7 +46,7 @@ environment*)
 esac
 esac
 
 
 for board in $@; do
 for board in $@; do
-	board_cfg="arch/mips/configs/generic/board-${board}.config"
+	board_cfg="${srctree}/arch/mips/configs/generic/board-${board}.config"
 	if [ ! -f "${board_cfg}" ]; then
 	if [ ! -f "${board_cfg}" ]; then
 		echo "WARNING: Board config '${board_cfg}' not found"
 		echo "WARNING: Board config '${board_cfg}' not found"
 		continue
 		continue
@@ -84,7 +82,7 @@ for board in $@; do
 	done || continue
 	done || continue
 
 
 	# Merge this board config fragment into our final config file
 	# Merge this board config fragment into our final config file
-	./scripts/kconfig/merge_config.sh \
+	${srctree}/scripts/kconfig/merge_config.sh \
 		-m -O ${objtree} ${cfg} ${board_cfg} \
 		-m -O ${objtree} ${cfg} ${board_cfg} \
 		| grep -Ev '^(#|Using)'
 		| grep -Ev '^(#|Using)'
 done
 done

+ 1 - 1
arch/parisc/kernel/parisc_ksyms.c

@@ -35,12 +35,12 @@ EXPORT_SYMBOL(memset);
 EXPORT_SYMBOL(__xchg8);
 EXPORT_SYMBOL(__xchg8);
 EXPORT_SYMBOL(__xchg32);
 EXPORT_SYMBOL(__xchg32);
 EXPORT_SYMBOL(__cmpxchg_u32);
 EXPORT_SYMBOL(__cmpxchg_u32);
+EXPORT_SYMBOL(__cmpxchg_u64);
 #ifdef CONFIG_SMP
 #ifdef CONFIG_SMP
 EXPORT_SYMBOL(__atomic_hash);
 EXPORT_SYMBOL(__atomic_hash);
 #endif
 #endif
 #ifdef CONFIG_64BIT
 #ifdef CONFIG_64BIT
 EXPORT_SYMBOL(__xchg64);
 EXPORT_SYMBOL(__xchg64);
-EXPORT_SYMBOL(__cmpxchg_u64);
 #endif
 #endif
 
 
 #include <linux/uaccess.h>
 #include <linux/uaccess.h>

+ 3 - 3
arch/parisc/kernel/syscall.S

@@ -742,7 +742,7 @@ lws_compare_and_swap_2:
 10:	ldd	0(%r25), %r25
 10:	ldd	0(%r25), %r25
 11:	ldd	0(%r24), %r24
 11:	ldd	0(%r24), %r24
 #else
 #else
-	/* Load new value into r22/r23 - high/low */
+	/* Load old value into r22/r23 - high/low */
 10:	ldw	0(%r25), %r22
 10:	ldw	0(%r25), %r22
 11:	ldw	4(%r25), %r23
 11:	ldw	4(%r25), %r23
 	/* Load new value into fr4 for atomic store later */
 	/* Load new value into fr4 for atomic store later */
@@ -834,11 +834,11 @@ cas2_action:
 	copy	%r0, %r28
 	copy	%r0, %r28
 #else
 #else
 	/* Compare first word */
 	/* Compare first word */
-19:	ldw,ma	0(%r26), %r29
+19:	ldw	0(%r26), %r29
 	sub,=	%r29, %r22, %r0
 	sub,=	%r29, %r22, %r0
 	b,n	cas2_end
 	b,n	cas2_end
 	/* Compare second word */
 	/* Compare second word */
-20:	ldw,ma	4(%r26), %r29
+20:	ldw	4(%r26), %r29
 	sub,=	%r29, %r23, %r0
 	sub,=	%r29, %r23, %r0
 	b,n	cas2_end
 	b,n	cas2_end
 	/* Perform the store */
 	/* Perform the store */

+ 4 - 1
arch/parisc/kernel/time.c

@@ -253,7 +253,10 @@ static int __init init_cr16_clocksource(void)
 		cpu0_loc = per_cpu(cpu_data, 0).cpu_loc;
 		cpu0_loc = per_cpu(cpu_data, 0).cpu_loc;
 
 
 		for_each_online_cpu(cpu) {
 		for_each_online_cpu(cpu) {
-			if (cpu0_loc == per_cpu(cpu_data, cpu).cpu_loc)
+			if (cpu == 0)
+				continue;
+			if ((cpu0_loc != 0) &&
+			    (cpu0_loc == per_cpu(cpu_data, cpu).cpu_loc))
 				continue;
 				continue;
 
 
 			clocksource_cr16.name = "cr16_unstable";
 			clocksource_cr16.name = "cr16_unstable";

+ 23 - 1
arch/powerpc/kernel/exceptions-64s.S

@@ -734,7 +734,29 @@ EXC_REAL(program_check, 0x700, 0x100)
 EXC_VIRT(program_check, 0x4700, 0x100, 0x700)
 EXC_VIRT(program_check, 0x4700, 0x100, 0x700)
 TRAMP_KVM(PACA_EXGEN, 0x700)
 TRAMP_KVM(PACA_EXGEN, 0x700)
 EXC_COMMON_BEGIN(program_check_common)
 EXC_COMMON_BEGIN(program_check_common)
-	EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN)
+	/*
+	 * It's possible to receive a TM Bad Thing type program check with
+	 * userspace register values (in particular r1), but with SRR1 reporting
+	 * that we came from the kernel. Normally that would confuse the bad
+	 * stack logic, and we would report a bad kernel stack pointer. Instead
+	 * we switch to the emergency stack if we're taking a TM Bad Thing from
+	 * the kernel.
+	 */
+	li	r10,MSR_PR		/* Build a mask of MSR_PR ..	*/
+	oris	r10,r10,0x200000@h	/* .. and SRR1_PROGTM		*/
+	and	r10,r10,r12		/* Mask SRR1 with that.		*/
+	srdi	r10,r10,8		/* Shift it so we can compare	*/
+	cmpldi	r10,(0x200000 >> 8)	/* .. with an immediate.	*/
+	bne 1f				/* If != go to normal path.	*/
+
+	/* SRR1 had PR=0 and SRR1_PROGTM=1, so use the emergency stack	*/
+	andi.	r10,r12,MSR_PR;		/* Set CR0 correctly for label	*/
+					/* 3 in EXCEPTION_PROLOG_COMMON	*/
+	mr	r10,r1			/* Save r1			*/
+	ld	r1,PACAEMERGSP(r13)	/* Use emergency stack		*/
+	subi	r1,r1,INT_FRAME_SIZE	/* alloc stack frame		*/
+	b 3f				/* Jump into the macro !!	*/
+1:	EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN)
 	bl	save_nvgprs
 	bl	save_nvgprs
 	RECONCILE_IRQ_STATE(r10, r11)
 	RECONCILE_IRQ_STATE(r10, r11)
 	addi	r3,r1,STACK_FRAME_OVERHEAD
 	addi	r3,r1,STACK_FRAME_OVERHEAD

+ 12 - 1
arch/powerpc/kernel/signal_64.c

@@ -452,9 +452,20 @@ static long restore_tm_sigcontexts(struct task_struct *tsk,
 	if (MSR_TM_RESV(msr))
 	if (MSR_TM_RESV(msr))
 		return -EINVAL;
 		return -EINVAL;
 
 
-	/* pull in MSR TM from user context */
+	/* pull in MSR TS bits from user context */
 	regs->msr = (regs->msr & ~MSR_TS_MASK) | (msr & MSR_TS_MASK);
 	regs->msr = (regs->msr & ~MSR_TS_MASK) | (msr & MSR_TS_MASK);
 
 
+	/*
+	 * Ensure that TM is enabled in regs->msr before we leave the signal
+	 * handler. It could be the case that (a) user disabled the TM bit
+	 * through the manipulation of the MSR bits in uc_mcontext or (b) the
+	 * TM bit was disabled because a sufficient number of context switches
+	 * happened whilst in the signal handler and load_tm overflowed,
+	 * disabling the TM bit. In either case we can end up with an illegal
+	 * TM state leading to a TM Bad Thing when we return to userspace.
+	 */
+	regs->msr |= MSR_TM;
+
 	/* pull in MSR LE from user context */
 	/* pull in MSR LE from user context */
 	regs->msr = (regs->msr & ~MSR_LE) | (msr & MSR_LE);
 	regs->msr = (regs->msr & ~MSR_LE) | (msr & MSR_LE);
 
 

+ 15 - 30
arch/powerpc/kernel/trace/ftrace_64_mprofile.S

@@ -181,34 +181,25 @@ _GLOBAL(ftrace_stub)
 	 *  - we have no stack frame and can not allocate one
 	 *  - we have no stack frame and can not allocate one
 	 *  - LR points back to the original caller (in A)
 	 *  - LR points back to the original caller (in A)
 	 *  - CTR holds the new NIP in C
 	 *  - CTR holds the new NIP in C
-	 *  - r0 & r12 are free
-	 *
-	 * r0 can't be used as the base register for a DS-form load or store, so
-	 * we temporarily shuffle r1 (stack pointer) into r0 and then put it back.
+	 *  - r0, r11 & r12 are free
 	 */
 	 */
 livepatch_handler:
 livepatch_handler:
 	CURRENT_THREAD_INFO(r12, r1)
 	CURRENT_THREAD_INFO(r12, r1)
 
 
-	/* Save stack pointer into r0 */
-	mr	r0, r1
-
 	/* Allocate 3 x 8 bytes */
 	/* Allocate 3 x 8 bytes */
-	ld	r1, TI_livepatch_sp(r12)
-	addi	r1, r1, 24
-	std	r1, TI_livepatch_sp(r12)
+	ld	r11, TI_livepatch_sp(r12)
+	addi	r11, r11, 24
+	std	r11, TI_livepatch_sp(r12)
 
 
 	/* Save toc & real LR on livepatch stack */
 	/* Save toc & real LR on livepatch stack */
-	std	r2,  -24(r1)
+	std	r2,  -24(r11)
 	mflr	r12
 	mflr	r12
-	std	r12, -16(r1)
+	std	r12, -16(r11)
 
 
 	/* Store stack end marker */
 	/* Store stack end marker */
 	lis     r12, STACK_END_MAGIC@h
 	lis     r12, STACK_END_MAGIC@h
 	ori     r12, r12, STACK_END_MAGIC@l
 	ori     r12, r12, STACK_END_MAGIC@l
-	std	r12, -8(r1)
-
-	/* Restore real stack pointer */
-	mr	r1, r0
+	std	r12, -8(r11)
 
 
 	/* Put ctr in r12 for global entry and branch there */
 	/* Put ctr in r12 for global entry and branch there */
 	mfctr	r12
 	mfctr	r12
@@ -216,36 +207,30 @@ livepatch_handler:
 
 
 	/*
 	/*
 	 * Now we are returning from the patched function to the original
 	 * Now we are returning from the patched function to the original
-	 * caller A. We are free to use r0 and r12, and we can use r2 until we
+	 * caller A. We are free to use r11, r12 and we can use r2 until we
 	 * restore it.
 	 * restore it.
 	 */
 	 */
 
 
 	CURRENT_THREAD_INFO(r12, r1)
 	CURRENT_THREAD_INFO(r12, r1)
 
 
-	/* Save stack pointer into r0 */
-	mr	r0, r1
-
-	ld	r1, TI_livepatch_sp(r12)
+	ld	r11, TI_livepatch_sp(r12)
 
 
 	/* Check stack marker hasn't been trashed */
 	/* Check stack marker hasn't been trashed */
 	lis     r2,  STACK_END_MAGIC@h
 	lis     r2,  STACK_END_MAGIC@h
 	ori     r2,  r2, STACK_END_MAGIC@l
 	ori     r2,  r2, STACK_END_MAGIC@l
-	ld	r12, -8(r1)
+	ld	r12, -8(r11)
 1:	tdne	r12, r2
 1:	tdne	r12, r2
 	EMIT_BUG_ENTRY 1b, __FILE__, __LINE__ - 1, 0
 	EMIT_BUG_ENTRY 1b, __FILE__, __LINE__ - 1, 0
 
 
 	/* Restore LR & toc from livepatch stack */
 	/* Restore LR & toc from livepatch stack */
-	ld	r12, -16(r1)
+	ld	r12, -16(r11)
 	mtlr	r12
 	mtlr	r12
-	ld	r2,  -24(r1)
+	ld	r2,  -24(r11)
 
 
 	/* Pop livepatch stack frame */
 	/* Pop livepatch stack frame */
-	CURRENT_THREAD_INFO(r12, r0)
-	subi	r1, r1, 24
-	std	r1, TI_livepatch_sp(r12)
-
-	/* Restore real stack pointer */
-	mr	r1, r0
+	CURRENT_THREAD_INFO(r12, r1)
+	subi	r11, r11, 24
+	std	r11, TI_livepatch_sp(r12)
 
 
 	/* Return to original caller of live patched function */
 	/* Return to original caller of live patched function */
 	blr
 	blr

+ 14 - 9
arch/powerpc/kvm/book3s_64_vio.c

@@ -478,28 +478,30 @@ long kvmppc_h_put_tce(struct kvm_vcpu *vcpu, unsigned long liobn,
 		return ret;
 		return ret;
 
 
 	dir = iommu_tce_direction(tce);
 	dir = iommu_tce_direction(tce);
+
+	idx = srcu_read_lock(&vcpu->kvm->srcu);
+
 	if ((dir != DMA_NONE) && kvmppc_gpa_to_ua(vcpu->kvm,
 	if ((dir != DMA_NONE) && kvmppc_gpa_to_ua(vcpu->kvm,
-			tce & ~(TCE_PCI_READ | TCE_PCI_WRITE), &ua, NULL))
-		return H_PARAMETER;
+			tce & ~(TCE_PCI_READ | TCE_PCI_WRITE), &ua, NULL)) {
+		ret = H_PARAMETER;
+		goto unlock_exit;
+	}
 
 
 	entry = ioba >> stt->page_shift;
 	entry = ioba >> stt->page_shift;
 
 
 	list_for_each_entry_lockless(stit, &stt->iommu_tables, next) {
 	list_for_each_entry_lockless(stit, &stt->iommu_tables, next) {
-		if (dir == DMA_NONE) {
+		if (dir == DMA_NONE)
 			ret = kvmppc_tce_iommu_unmap(vcpu->kvm,
 			ret = kvmppc_tce_iommu_unmap(vcpu->kvm,
 					stit->tbl, entry);
 					stit->tbl, entry);
-		} else {
-			idx = srcu_read_lock(&vcpu->kvm->srcu);
+		else
 			ret = kvmppc_tce_iommu_map(vcpu->kvm, stit->tbl,
 			ret = kvmppc_tce_iommu_map(vcpu->kvm, stit->tbl,
 					entry, ua, dir);
 					entry, ua, dir);
-			srcu_read_unlock(&vcpu->kvm->srcu, idx);
-		}
 
 
 		if (ret == H_SUCCESS)
 		if (ret == H_SUCCESS)
 			continue;
 			continue;
 
 
 		if (ret == H_TOO_HARD)
 		if (ret == H_TOO_HARD)
-			return ret;
+			goto unlock_exit;
 
 
 		WARN_ON_ONCE(1);
 		WARN_ON_ONCE(1);
 		kvmppc_clear_tce(stit->tbl, entry);
 		kvmppc_clear_tce(stit->tbl, entry);
@@ -507,7 +509,10 @@ long kvmppc_h_put_tce(struct kvm_vcpu *vcpu, unsigned long liobn,
 
 
 	kvmppc_tce_put(stt, entry, tce);
 	kvmppc_tce_put(stt, entry, tce);
 
 
-	return H_SUCCESS;
+unlock_exit:
+	srcu_read_unlock(&vcpu->kvm->srcu, idx);
+
+	return ret;
 }
 }
 EXPORT_SYMBOL_GPL(kvmppc_h_put_tce);
 EXPORT_SYMBOL_GPL(kvmppc_h_put_tce);
 
 

+ 10 - 3
arch/powerpc/kvm/book3s_hv_rmhandlers.S

@@ -989,13 +989,14 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_ARCH_300)
 	beq	no_xive
 	beq	no_xive
 	ld	r11, VCPU_XIVE_SAVED_STATE(r4)
 	ld	r11, VCPU_XIVE_SAVED_STATE(r4)
 	li	r9, TM_QW1_OS
 	li	r9, TM_QW1_OS
-	stdcix	r11,r9,r10
 	eieio
 	eieio
+	stdcix	r11,r9,r10
 	lwz	r11, VCPU_XIVE_CAM_WORD(r4)
 	lwz	r11, VCPU_XIVE_CAM_WORD(r4)
 	li	r9, TM_QW1_OS + TM_WORD2
 	li	r9, TM_QW1_OS + TM_WORD2
 	stwcix	r11,r9,r10
 	stwcix	r11,r9,r10
 	li	r9, 1
 	li	r9, 1
 	stw	r9, VCPU_XIVE_PUSHED(r4)
 	stw	r9, VCPU_XIVE_PUSHED(r4)
+	eieio
 no_xive:
 no_xive:
 #endif /* CONFIG_KVM_XICS */
 #endif /* CONFIG_KVM_XICS */
 
 
@@ -1310,6 +1311,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
 	bne	3f
 	bne	3f
 BEGIN_FTR_SECTION
 BEGIN_FTR_SECTION
 	PPC_MSGSYNC
 	PPC_MSGSYNC
+	lwsync
 END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
 END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
 	lbz	r0, HSTATE_HOST_IPI(r13)
 	lbz	r0, HSTATE_HOST_IPI(r13)
 	cmpwi	r0, 0
 	cmpwi	r0, 0
@@ -1400,8 +1402,8 @@ guest_exit_cont:		/* r9 = vcpu, r12 = trap, r13 = paca */
 	cmpldi	cr0, r10, 0
 	cmpldi	cr0, r10, 0
 	beq	1f
 	beq	1f
 	/* First load to pull the context, we ignore the value */
 	/* First load to pull the context, we ignore the value */
-	lwzx	r11, r7, r10
 	eieio
 	eieio
+	lwzx	r11, r7, r10
 	/* Second load to recover the context state (Words 0 and 1) */
 	/* Second load to recover the context state (Words 0 and 1) */
 	ldx	r11, r6, r10
 	ldx	r11, r6, r10
 	b	3f
 	b	3f
@@ -1409,8 +1411,8 @@ guest_exit_cont:		/* r9 = vcpu, r12 = trap, r13 = paca */
 	cmpldi	cr0, r10, 0
 	cmpldi	cr0, r10, 0
 	beq	1f
 	beq	1f
 	/* First load to pull the context, we ignore the value */
 	/* First load to pull the context, we ignore the value */
-	lwzcix	r11, r7, r10
 	eieio
 	eieio
+	lwzcix	r11, r7, r10
 	/* Second load to recover the context state (Words 0 and 1) */
 	/* Second load to recover the context state (Words 0 and 1) */
 	ldcix	r11, r6, r10
 	ldcix	r11, r6, r10
 3:	std	r11, VCPU_XIVE_SAVED_STATE(r9)
 3:	std	r11, VCPU_XIVE_SAVED_STATE(r9)
@@ -1420,6 +1422,7 @@ guest_exit_cont:		/* r9 = vcpu, r12 = trap, r13 = paca */
 	stw	r10, VCPU_XIVE_PUSHED(r9)
 	stw	r10, VCPU_XIVE_PUSHED(r9)
 	stb	r10, (VCPU_XIVE_SAVED_STATE+3)(r9)
 	stb	r10, (VCPU_XIVE_SAVED_STATE+3)(r9)
 	stb	r0, (VCPU_XIVE_SAVED_STATE+4)(r9)
 	stb	r0, (VCPU_XIVE_SAVED_STATE+4)(r9)
+	eieio
 1:
 1:
 #endif /* CONFIG_KVM_XICS */
 #endif /* CONFIG_KVM_XICS */
 	/* Save more register state  */
 	/* Save more register state  */
@@ -2788,6 +2791,10 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
 	PPC_MSGCLR(6)
 	PPC_MSGCLR(6)
 	/* see if it's a host IPI */
 	/* see if it's a host IPI */
 	li	r3, 1
 	li	r3, 1
+BEGIN_FTR_SECTION
+	PPC_MSGSYNC
+	lwsync
+END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
 	lbz	r0, HSTATE_HOST_IPI(r13)
 	lbz	r0, HSTATE_HOST_IPI(r13)
 	cmpwi	r0, 0
 	cmpwi	r0, 0
 	bnelr
 	bnelr

+ 1 - 2
arch/powerpc/kvm/powerpc.c

@@ -644,8 +644,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 		break;
 		break;
 #endif
 #endif
 	case KVM_CAP_PPC_HTM:
 	case KVM_CAP_PPC_HTM:
-		r = cpu_has_feature(CPU_FTR_TM_COMP) &&
-		    is_kvmppc_hv_enabled(kvm);
+		r = cpu_has_feature(CPU_FTR_TM_COMP) && hv_enabled;
 		break;
 		break;
 	default:
 	default:
 		r = 0;
 		r = 0;

+ 4 - 2
arch/powerpc/lib/sstep.c

@@ -1684,11 +1684,13 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
  * Logical instructions
  * Logical instructions
  */
  */
 		case 26:	/* cntlzw */
 		case 26:	/* cntlzw */
-			op->val = __builtin_clz((unsigned int) regs->gpr[rd]);
+			val = (unsigned int) regs->gpr[rd];
+			op->val = ( val ? __builtin_clz(val) : 32 );
 			goto logical_done;
 			goto logical_done;
 #ifdef __powerpc64__
 #ifdef __powerpc64__
 		case 58:	/* cntlzd */
 		case 58:	/* cntlzd */
-			op->val = __builtin_clzl(regs->gpr[rd]);
+			val = regs->gpr[rd];
+			op->val = ( val ? __builtin_clzl(val) : 64 );
 			goto logical_done;
 			goto logical_done;
 #endif
 #endif
 		case 28:	/* and */
 		case 28:	/* and */

+ 0 - 1
arch/powerpc/mm/numa.c

@@ -1438,7 +1438,6 @@ out:
 
 
 int arch_update_cpu_topology(void)
 int arch_update_cpu_topology(void)
 {
 {
-	lockdep_assert_cpus_held();
 	return numa_update_cpu_topology(true);
 	return numa_update_cpu_topology(true);
 }
 }
 
 

+ 34 - 5
arch/powerpc/perf/imc-pmu.c

@@ -399,6 +399,20 @@ static void nest_imc_counters_release(struct perf_event *event)
 
 
 	/* Take the mutex lock for this node and then decrement the reference count */
 	/* Take the mutex lock for this node and then decrement the reference count */
 	mutex_lock(&ref->lock);
 	mutex_lock(&ref->lock);
+	if (ref->refc == 0) {
+		/*
+		 * The scenario where this is true is, when perf session is
+		 * started, followed by offlining of all cpus in a given node.
+		 *
+		 * In the cpuhotplug offline path, ppc_nest_imc_cpu_offline()
+		 * function set the ref->count to zero, if the cpu which is
+		 * about to offline is the last cpu in a given node and make
+		 * an OPAL call to disable the engine in that node.
+		 *
+		 */
+		mutex_unlock(&ref->lock);
+		return;
+	}
 	ref->refc--;
 	ref->refc--;
 	if (ref->refc == 0) {
 	if (ref->refc == 0) {
 		rc = opal_imc_counters_stop(OPAL_IMC_COUNTERS_NEST,
 		rc = opal_imc_counters_stop(OPAL_IMC_COUNTERS_NEST,
@@ -523,8 +537,8 @@ static int core_imc_mem_init(int cpu, int size)
 
 
 	/* We need only vbase for core counters */
 	/* We need only vbase for core counters */
 	mem_info->vbase = page_address(alloc_pages_node(phys_id,
 	mem_info->vbase = page_address(alloc_pages_node(phys_id,
-					  GFP_KERNEL | __GFP_ZERO | __GFP_THISNODE,
-					  get_order(size)));
+					  GFP_KERNEL | __GFP_ZERO | __GFP_THISNODE |
+					  __GFP_NOWARN, get_order(size)));
 	if (!mem_info->vbase)
 	if (!mem_info->vbase)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
@@ -646,6 +660,20 @@ static void core_imc_counters_release(struct perf_event *event)
 		return;
 		return;
 
 
 	mutex_lock(&ref->lock);
 	mutex_lock(&ref->lock);
+	if (ref->refc == 0) {
+		/*
+		 * The scenario where this is true is, when perf session is
+		 * started, followed by offlining of all cpus in a given core.
+		 *
+		 * In the cpuhotplug offline path, ppc_core_imc_cpu_offline()
+		 * function set the ref->count to zero, if the cpu which is
+		 * about to offline is the last cpu in a given core and make
+		 * an OPAL call to disable the engine in that core.
+		 *
+		 */
+		mutex_unlock(&ref->lock);
+		return;
+	}
 	ref->refc--;
 	ref->refc--;
 	if (ref->refc == 0) {
 	if (ref->refc == 0) {
 		rc = opal_imc_counters_stop(OPAL_IMC_COUNTERS_CORE,
 		rc = opal_imc_counters_stop(OPAL_IMC_COUNTERS_CORE,
@@ -763,8 +791,8 @@ static int thread_imc_mem_alloc(int cpu_id, int size)
 		 * free the memory in cpu offline path.
 		 * free the memory in cpu offline path.
 		 */
 		 */
 		local_mem = page_address(alloc_pages_node(phys_id,
 		local_mem = page_address(alloc_pages_node(phys_id,
-				  GFP_KERNEL | __GFP_ZERO | __GFP_THISNODE,
-				  get_order(size)));
+				  GFP_KERNEL | __GFP_ZERO | __GFP_THISNODE |
+				  __GFP_NOWARN, get_order(size)));
 		if (!local_mem)
 		if (!local_mem)
 			return -ENOMEM;
 			return -ENOMEM;
 
 
@@ -1148,7 +1176,8 @@ static void imc_common_cpuhp_mem_free(struct imc_pmu *pmu_ptr)
 	}
 	}
 
 
 	/* Only free the attr_groups which are dynamically allocated  */
 	/* Only free the attr_groups which are dynamically allocated  */
-	kfree(pmu_ptr->attr_groups[IMC_EVENT_ATTR]->attrs);
+	if (pmu_ptr->attr_groups[IMC_EVENT_ATTR])
+		kfree(pmu_ptr->attr_groups[IMC_EVENT_ATTR]->attrs);
 	kfree(pmu_ptr->attr_groups[IMC_EVENT_ATTR]);
 	kfree(pmu_ptr->attr_groups[IMC_EVENT_ATTR]);
 	kfree(pmu_ptr);
 	kfree(pmu_ptr);
 	return;
 	return;

+ 2 - 0
arch/s390/configs/zfcpdump_defconfig

@@ -27,6 +27,7 @@ CONFIG_NET=y
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS=y
 # CONFIG_FIRMWARE_IN_KERNEL is not set
 # CONFIG_FIRMWARE_IN_KERNEL is not set
+CONFIG_BLK_DEV_RAM=y
 # CONFIG_BLK_DEV_XPRAM is not set
 # CONFIG_BLK_DEV_XPRAM is not set
 # CONFIG_DCSSBLK is not set
 # CONFIG_DCSSBLK is not set
 # CONFIG_DASD is not set
 # CONFIG_DASD is not set
@@ -59,6 +60,7 @@ CONFIG_CONFIGFS_FS=y
 # CONFIG_NETWORK_FILESYSTEMS is not set
 # CONFIG_NETWORK_FILESYSTEMS is not set
 CONFIG_PRINTK_TIME=y
 CONFIG_PRINTK_TIME=y
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_PANIC_ON_OOPS=y
 CONFIG_PANIC_ON_OOPS=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_SCHED_DEBUG is not set

+ 5 - 2
arch/s390/kernel/entry.S

@@ -521,12 +521,15 @@ ENTRY(pgm_check_handler)
 	tmhh	%r8,0x0001		# test problem state bit
 	tmhh	%r8,0x0001		# test problem state bit
 	jnz	2f			# -> fault in user space
 	jnz	2f			# -> fault in user space
 #if IS_ENABLED(CONFIG_KVM)
 #if IS_ENABLED(CONFIG_KVM)
-	# cleanup critical section for sie64a
+	# cleanup critical section for program checks in sie64a
 	lgr	%r14,%r9
 	lgr	%r14,%r9
 	slg	%r14,BASED(.Lsie_critical_start)
 	slg	%r14,BASED(.Lsie_critical_start)
 	clg	%r14,BASED(.Lsie_critical_length)
 	clg	%r14,BASED(.Lsie_critical_length)
 	jhe	0f
 	jhe	0f
-	brasl	%r14,.Lcleanup_sie
+	lg	%r14,__SF_EMPTY(%r15)		# get control block pointer
+	ni	__SIE_PROG0C+3(%r14),0xfe	# no longer in SIE
+	lctlg	%c1,%c1,__LC_USER_ASCE		# load primary asce
+	larl	%r9,sie_exit			# skip forward to sie_exit
 #endif
 #endif
 0:	tmhh	%r8,0x4000		# PER bit set in old PSW ?
 0:	tmhh	%r8,0x4000		# PER bit set in old PSW ?
 	jnz	1f			# -> enabled, can't be a double fault
 	jnz	1f			# -> enabled, can't be a double fault

+ 3 - 0
arch/s390/kernel/smp.c

@@ -293,7 +293,10 @@ static void pcpu_attach_task(struct pcpu *pcpu, struct task_struct *tsk)
 	lc->lpp = LPP_MAGIC;
 	lc->lpp = LPP_MAGIC;
 	lc->current_pid = tsk->pid;
 	lc->current_pid = tsk->pid;
 	lc->user_timer = tsk->thread.user_timer;
 	lc->user_timer = tsk->thread.user_timer;
+	lc->guest_timer = tsk->thread.guest_timer;
 	lc->system_timer = tsk->thread.system_timer;
 	lc->system_timer = tsk->thread.system_timer;
+	lc->hardirq_timer = tsk->thread.hardirq_timer;
+	lc->softirq_timer = tsk->thread.softirq_timer;
 	lc->steal_timer = 0;
 	lc->steal_timer = 0;
 }
 }
 
 

+ 0 - 1
arch/sparc/Kconfig

@@ -44,7 +44,6 @@ config SPARC
 	select ARCH_HAS_SG_CHAIN
 	select ARCH_HAS_SG_CHAIN
 	select CPU_NO_EFFICIENT_FFS
 	select CPU_NO_EFFICIENT_FFS
 	select LOCKDEP_SMALL if LOCKDEP
 	select LOCKDEP_SMALL if LOCKDEP
-	select ARCH_WANT_RELAX_ORDER
 
 
 config SPARC32
 config SPARC32
 	def_bool !64BIT
 	def_bool !64BIT

+ 2 - 2
arch/x86/entry/entry_32.S

@@ -176,7 +176,7 @@
 /*
 /*
  * This is a sneaky trick to help the unwinder find pt_regs on the stack.  The
  * This is a sneaky trick to help the unwinder find pt_regs on the stack.  The
  * frame pointer is replaced with an encoded pointer to pt_regs.  The encoding
  * frame pointer is replaced with an encoded pointer to pt_regs.  The encoding
- * is just setting the LSB, which makes it an invalid stack address and is also
+ * is just clearing the MSB, which makes it an invalid stack address and is also
  * a signal to the unwinder that it's a pt_regs pointer in disguise.
  * a signal to the unwinder that it's a pt_regs pointer in disguise.
  *
  *
  * NOTE: This macro must be used *after* SAVE_ALL because it corrupts the
  * NOTE: This macro must be used *after* SAVE_ALL because it corrupts the
@@ -185,7 +185,7 @@
 .macro ENCODE_FRAME_POINTER
 .macro ENCODE_FRAME_POINTER
 #ifdef CONFIG_FRAME_POINTER
 #ifdef CONFIG_FRAME_POINTER
 	mov %esp, %ebp
 	mov %esp, %ebp
-	orl $0x1, %ebp
+	andl $0x7fffffff, %ebp
 #endif
 #endif
 .endm
 .endm
 
 

+ 1 - 1
arch/x86/entry/entry_64.S

@@ -808,7 +808,7 @@ apicinterrupt IRQ_WORK_VECTOR			irq_work_interrupt		smp_irq_work_interrupt
 
 
 .macro idtentry sym do_sym has_error_code:req paranoid=0 shift_ist=-1
 .macro idtentry sym do_sym has_error_code:req paranoid=0 shift_ist=-1
 ENTRY(\sym)
 ENTRY(\sym)
-	UNWIND_HINT_IRET_REGS offset=8
+	UNWIND_HINT_IRET_REGS offset=\has_error_code*8
 
 
 	/* Sanity check */
 	/* Sanity check */
 	.if \shift_ist != -1 && \paranoid == 0
 	.if \shift_ist != -1 && \paranoid == 0

+ 3 - 3
arch/x86/events/intel/bts.c

@@ -546,9 +546,6 @@ static int bts_event_init(struct perf_event *event)
 	if (event->attr.type != bts_pmu.type)
 	if (event->attr.type != bts_pmu.type)
 		return -ENOENT;
 		return -ENOENT;
 
 
-	if (x86_add_exclusive(x86_lbr_exclusive_bts))
-		return -EBUSY;
-
 	/*
 	/*
 	 * BTS leaks kernel addresses even when CPL0 tracing is
 	 * BTS leaks kernel addresses even when CPL0 tracing is
 	 * disabled, so disallow intel_bts driver for unprivileged
 	 * disabled, so disallow intel_bts driver for unprivileged
@@ -562,6 +559,9 @@ static int bts_event_init(struct perf_event *event)
 	    !capable(CAP_SYS_ADMIN))
 	    !capable(CAP_SYS_ADMIN))
 		return -EACCES;
 		return -EACCES;
 
 
+	if (x86_add_exclusive(x86_lbr_exclusive_bts))
+		return -EBUSY;
+
 	ret = x86_reserve_hardware();
 	ret = x86_reserve_hardware();
 	if (ret) {
 	if (ret) {
 		x86_del_exclusive(x86_lbr_exclusive_bts);
 		x86_del_exclusive(x86_lbr_exclusive_bts);

+ 10 - 2
arch/x86/events/intel/uncore.c

@@ -822,7 +822,7 @@ static int __init uncore_type_init(struct intel_uncore_type *type, bool setid)
 		pmus[i].type	= type;
 		pmus[i].type	= type;
 		pmus[i].boxes	= kzalloc(size, GFP_KERNEL);
 		pmus[i].boxes	= kzalloc(size, GFP_KERNEL);
 		if (!pmus[i].boxes)
 		if (!pmus[i].boxes)
-			return -ENOMEM;
+			goto err;
 	}
 	}
 
 
 	type->pmus = pmus;
 	type->pmus = pmus;
@@ -836,7 +836,7 @@ static int __init uncore_type_init(struct intel_uncore_type *type, bool setid)
 		attr_group = kzalloc(sizeof(struct attribute *) * (i + 1) +
 		attr_group = kzalloc(sizeof(struct attribute *) * (i + 1) +
 					sizeof(*attr_group), GFP_KERNEL);
 					sizeof(*attr_group), GFP_KERNEL);
 		if (!attr_group)
 		if (!attr_group)
-			return -ENOMEM;
+			goto err;
 
 
 		attrs = (struct attribute **)(attr_group + 1);
 		attrs = (struct attribute **)(attr_group + 1);
 		attr_group->name = "events";
 		attr_group->name = "events";
@@ -849,7 +849,15 @@ static int __init uncore_type_init(struct intel_uncore_type *type, bool setid)
 	}
 	}
 
 
 	type->pmu_group = &uncore_pmu_attr_group;
 	type->pmu_group = &uncore_pmu_attr_group;
+
 	return 0;
 	return 0;
+
+err:
+	for (i = 0; i < type->num_boxes; i++)
+		kfree(pmus[i].boxes);
+	kfree(pmus);
+
+	return -ENOMEM;
 }
 }
 
 
 static int __init
 static int __init

+ 5 - 0
arch/x86/hyperv/hv_init.c

@@ -85,6 +85,8 @@ EXPORT_SYMBOL_GPL(hyperv_cs);
 u32 *hv_vp_index;
 u32 *hv_vp_index;
 EXPORT_SYMBOL_GPL(hv_vp_index);
 EXPORT_SYMBOL_GPL(hv_vp_index);
 
 
+u32 hv_max_vp_index;
+
 static int hv_cpu_init(unsigned int cpu)
 static int hv_cpu_init(unsigned int cpu)
 {
 {
 	u64 msr_vp_index;
 	u64 msr_vp_index;
@@ -93,6 +95,9 @@ static int hv_cpu_init(unsigned int cpu)
 
 
 	hv_vp_index[smp_processor_id()] = msr_vp_index;
 	hv_vp_index[smp_processor_id()] = msr_vp_index;
 
 
+	if (msr_vp_index > hv_max_vp_index)
+		hv_max_vp_index = msr_vp_index;
+
 	return 0;
 	return 0;
 }
 }
 
 

+ 43 - 14
arch/x86/hyperv/mmu.c

@@ -36,9 +36,9 @@ struct hv_flush_pcpu_ex {
 /* Each gva in gva_list encodes up to 4096 pages to flush */
 /* Each gva in gva_list encodes up to 4096 pages to flush */
 #define HV_TLB_FLUSH_UNIT (4096 * PAGE_SIZE)
 #define HV_TLB_FLUSH_UNIT (4096 * PAGE_SIZE)
 
 
-static struct hv_flush_pcpu __percpu *pcpu_flush;
+static struct hv_flush_pcpu __percpu **pcpu_flush;
 
 
-static struct hv_flush_pcpu_ex __percpu *pcpu_flush_ex;
+static struct hv_flush_pcpu_ex __percpu **pcpu_flush_ex;
 
 
 /*
 /*
  * Fills in gva_list starting from offset. Returns the number of items added.
  * Fills in gva_list starting from offset. Returns the number of items added.
@@ -76,6 +76,18 @@ static inline int cpumask_to_vp_set(struct hv_flush_pcpu_ex *flush,
 {
 {
 	int cpu, vcpu, vcpu_bank, vcpu_offset, nr_bank = 1;
 	int cpu, vcpu, vcpu_bank, vcpu_offset, nr_bank = 1;
 
 
+	/* valid_bank_mask can represent up to 64 banks */
+	if (hv_max_vp_index / 64 >= 64)
+		return 0;
+
+	/*
+	 * Clear all banks up to the maximum possible bank as hv_flush_pcpu_ex
+	 * structs are not cleared between calls, we risk flushing unneeded
+	 * vCPUs otherwise.
+	 */
+	for (vcpu_bank = 0; vcpu_bank <= hv_max_vp_index / 64; vcpu_bank++)
+		flush->hv_vp_set.bank_contents[vcpu_bank] = 0;
+
 	/*
 	/*
 	 * Some banks may end up being empty but this is acceptable.
 	 * Some banks may end up being empty but this is acceptable.
 	 */
 	 */
@@ -83,11 +95,6 @@ static inline int cpumask_to_vp_set(struct hv_flush_pcpu_ex *flush,
 		vcpu = hv_cpu_number_to_vp_number(cpu);
 		vcpu = hv_cpu_number_to_vp_number(cpu);
 		vcpu_bank = vcpu / 64;
 		vcpu_bank = vcpu / 64;
 		vcpu_offset = vcpu % 64;
 		vcpu_offset = vcpu % 64;
-
-		/* valid_bank_mask can represent up to 64 banks */
-		if (vcpu_bank >= 64)
-			return 0;
-
 		__set_bit(vcpu_offset, (unsigned long *)
 		__set_bit(vcpu_offset, (unsigned long *)
 			  &flush->hv_vp_set.bank_contents[vcpu_bank]);
 			  &flush->hv_vp_set.bank_contents[vcpu_bank]);
 		if (vcpu_bank >= nr_bank)
 		if (vcpu_bank >= nr_bank)
@@ -102,6 +109,7 @@ static void hyperv_flush_tlb_others(const struct cpumask *cpus,
 				    const struct flush_tlb_info *info)
 				    const struct flush_tlb_info *info)
 {
 {
 	int cpu, vcpu, gva_n, max_gvas;
 	int cpu, vcpu, gva_n, max_gvas;
+	struct hv_flush_pcpu **flush_pcpu;
 	struct hv_flush_pcpu *flush;
 	struct hv_flush_pcpu *flush;
 	u64 status = U64_MAX;
 	u64 status = U64_MAX;
 	unsigned long flags;
 	unsigned long flags;
@@ -116,7 +124,17 @@ static void hyperv_flush_tlb_others(const struct cpumask *cpus,
 
 
 	local_irq_save(flags);
 	local_irq_save(flags);
 
 
-	flush = this_cpu_ptr(pcpu_flush);
+	flush_pcpu = this_cpu_ptr(pcpu_flush);
+
+	if (unlikely(!*flush_pcpu))
+		*flush_pcpu = page_address(alloc_page(GFP_ATOMIC));
+
+	flush = *flush_pcpu;
+
+	if (unlikely(!flush)) {
+		local_irq_restore(flags);
+		goto do_native;
+	}
 
 
 	if (info->mm) {
 	if (info->mm) {
 		flush->address_space = virt_to_phys(info->mm->pgd);
 		flush->address_space = virt_to_phys(info->mm->pgd);
@@ -173,6 +191,7 @@ static void hyperv_flush_tlb_others_ex(const struct cpumask *cpus,
 				       const struct flush_tlb_info *info)
 				       const struct flush_tlb_info *info)
 {
 {
 	int nr_bank = 0, max_gvas, gva_n;
 	int nr_bank = 0, max_gvas, gva_n;
+	struct hv_flush_pcpu_ex **flush_pcpu;
 	struct hv_flush_pcpu_ex *flush;
 	struct hv_flush_pcpu_ex *flush;
 	u64 status = U64_MAX;
 	u64 status = U64_MAX;
 	unsigned long flags;
 	unsigned long flags;
@@ -187,7 +206,17 @@ static void hyperv_flush_tlb_others_ex(const struct cpumask *cpus,
 
 
 	local_irq_save(flags);
 	local_irq_save(flags);
 
 
-	flush = this_cpu_ptr(pcpu_flush_ex);
+	flush_pcpu = this_cpu_ptr(pcpu_flush_ex);
+
+	if (unlikely(!*flush_pcpu))
+		*flush_pcpu = page_address(alloc_page(GFP_ATOMIC));
+
+	flush = *flush_pcpu;
+
+	if (unlikely(!flush)) {
+		local_irq_restore(flags);
+		goto do_native;
+	}
 
 
 	if (info->mm) {
 	if (info->mm) {
 		flush->address_space = virt_to_phys(info->mm->pgd);
 		flush->address_space = virt_to_phys(info->mm->pgd);
@@ -222,18 +251,18 @@ static void hyperv_flush_tlb_others_ex(const struct cpumask *cpus,
 		flush->flags |= HV_FLUSH_NON_GLOBAL_MAPPINGS_ONLY;
 		flush->flags |= HV_FLUSH_NON_GLOBAL_MAPPINGS_ONLY;
 		status = hv_do_rep_hypercall(
 		status = hv_do_rep_hypercall(
 			HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX,
 			HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX,
-			0, nr_bank + 2, flush, NULL);
+			0, nr_bank, flush, NULL);
 	} else if (info->end &&
 	} else if (info->end &&
 		   ((info->end - info->start)/HV_TLB_FLUSH_UNIT) > max_gvas) {
 		   ((info->end - info->start)/HV_TLB_FLUSH_UNIT) > max_gvas) {
 		status = hv_do_rep_hypercall(
 		status = hv_do_rep_hypercall(
 			HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX,
 			HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX,
-			0, nr_bank + 2, flush, NULL);
+			0, nr_bank, flush, NULL);
 	} else {
 	} else {
 		gva_n = fill_gva_list(flush->gva_list, nr_bank,
 		gva_n = fill_gva_list(flush->gva_list, nr_bank,
 				      info->start, info->end);
 				      info->start, info->end);
 		status = hv_do_rep_hypercall(
 		status = hv_do_rep_hypercall(
 			HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST_EX,
 			HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST_EX,
-			gva_n, nr_bank + 2, flush, NULL);
+			gva_n, nr_bank, flush, NULL);
 	}
 	}
 
 
 	local_irq_restore(flags);
 	local_irq_restore(flags);
@@ -266,7 +295,7 @@ void hyper_alloc_mmu(void)
 		return;
 		return;
 
 
 	if (!(ms_hyperv.hints & HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED))
 	if (!(ms_hyperv.hints & HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED))
-		pcpu_flush = __alloc_percpu(PAGE_SIZE, PAGE_SIZE);
+		pcpu_flush = alloc_percpu(struct hv_flush_pcpu *);
 	else
 	else
-		pcpu_flush_ex = __alloc_percpu(PAGE_SIZE, PAGE_SIZE);
+		pcpu_flush_ex = alloc_percpu(struct hv_flush_pcpu_ex *);
 }
 }

+ 3 - 1
arch/x86/include/asm/alternative-asm.h

@@ -62,8 +62,10 @@
 #define new_len2		145f-144f
 #define new_len2		145f-144f
 
 
 /*
 /*
- * max without conditionals. Idea adapted from:
+ * gas compatible max based on the idea from:
  * http://graphics.stanford.edu/~seander/bithacks.html#IntegerMinOrMax
  * http://graphics.stanford.edu/~seander/bithacks.html#IntegerMinOrMax
+ *
+ * The additional "-" is needed because gas uses a "true" value of -1.
  */
  */
 #define alt_max_short(a, b)	((a) ^ (((a) ^ (b)) & -(-((a) < (b)))))
 #define alt_max_short(a, b)	((a) ^ (((a) ^ (b)) & -(-((a) < (b)))))
 
 

+ 3 - 3
arch/x86/include/asm/alternative.h

@@ -103,12 +103,12 @@ static inline int alternatives_text_reserved(void *start, void *end)
 	alt_end_marker ":\n"
 	alt_end_marker ":\n"
 
 
 /*
 /*
- * max without conditionals. Idea adapted from:
+ * gas compatible max based on the idea from:
  * http://graphics.stanford.edu/~seander/bithacks.html#IntegerMinOrMax
  * http://graphics.stanford.edu/~seander/bithacks.html#IntegerMinOrMax
  *
  *
- * The additional "-" is needed because gas works with s32s.
+ * The additional "-" is needed because gas uses a "true" value of -1.
  */
  */
-#define alt_max_short(a, b)	"((" a ") ^ (((" a ") ^ (" b ")) & -(-((" a ") - (" b ")))))"
+#define alt_max_short(a, b)	"((" a ") ^ (((" a ") ^ (" b ")) & -(-((" a ") < (" b ")))))"
 
 
 /*
 /*
  * Pad the second replacement alternative with additional NOPs if it is
  * Pad the second replacement alternative with additional NOPs if it is

+ 0 - 1
arch/x86/include/asm/mce.h

@@ -187,7 +187,6 @@ struct mca_msr_regs {
 
 
 extern struct mce_vendor_flags mce_flags;
 extern struct mce_vendor_flags mce_flags;
 
 
-extern struct mca_config mca_cfg;
 extern struct mca_msr_regs msr_ops;
 extern struct mca_msr_regs msr_ops;
 
 
 enum mce_notifier_prios {
 enum mce_notifier_prios {

+ 1 - 7
arch/x86/include/asm/mmu_context.h

@@ -126,13 +126,7 @@ static inline void switch_ldt(struct mm_struct *prev, struct mm_struct *next)
 	DEBUG_LOCKS_WARN_ON(preemptible());
 	DEBUG_LOCKS_WARN_ON(preemptible());
 }
 }
 
 
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
-{
-	int cpu = smp_processor_id();
-
-	if (cpumask_test_cpu(cpu, mm_cpumask(mm)))
-		cpumask_clear_cpu(cpu, mm_cpumask(mm));
-}
+void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk);
 
 
 static inline int init_new_context(struct task_struct *tsk,
 static inline int init_new_context(struct task_struct *tsk,
 				   struct mm_struct *mm)
 				   struct mm_struct *mm)

+ 1 - 0
arch/x86/include/asm/mshyperv.h

@@ -289,6 +289,7 @@ static inline u64 hv_do_rep_hypercall(u16 code, u16 rep_count, u16 varhead_size,
  * to this information.
  * to this information.
  */
  */
 extern u32 *hv_vp_index;
 extern u32 *hv_vp_index;
+extern u32 hv_max_vp_index;
 
 
 /**
 /**
  * hv_cpu_number_to_vp_number() - Map CPU to VP.
  * hv_cpu_number_to_vp_number() - Map CPU to VP.

+ 33 - 0
arch/x86/include/asm/tlbflush.h

@@ -82,6 +82,22 @@ static inline u64 inc_mm_tlb_gen(struct mm_struct *mm)
 #define __flush_tlb_single(addr) __native_flush_tlb_single(addr)
 #define __flush_tlb_single(addr) __native_flush_tlb_single(addr)
 #endif
 #endif
 
 
+static inline bool tlb_defer_switch_to_init_mm(void)
+{
+	/*
+	 * If we have PCID, then switching to init_mm is reasonably
+	 * fast.  If we don't have PCID, then switching to init_mm is
+	 * quite slow, so we try to defer it in the hopes that we can
+	 * avoid it entirely.  The latter approach runs the risk of
+	 * receiving otherwise unnecessary IPIs.
+	 *
+	 * This choice is just a heuristic.  The tlb code can handle this
+	 * function returning true or false regardless of whether we have
+	 * PCID.
+	 */
+	return !static_cpu_has(X86_FEATURE_PCID);
+}
+
 /*
 /*
  * 6 because 6 should be plenty and struct tlb_state will fit in
  * 6 because 6 should be plenty and struct tlb_state will fit in
  * two cache lines.
  * two cache lines.
@@ -104,6 +120,23 @@ struct tlb_state {
 	u16 loaded_mm_asid;
 	u16 loaded_mm_asid;
 	u16 next_asid;
 	u16 next_asid;
 
 
+	/*
+	 * We can be in one of several states:
+	 *
+	 *  - Actively using an mm.  Our CPU's bit will be set in
+	 *    mm_cpumask(loaded_mm) and is_lazy == false;
+	 *
+	 *  - Not using a real mm.  loaded_mm == &init_mm.  Our CPU's bit
+	 *    will not be set in mm_cpumask(&init_mm) and is_lazy == false.
+	 *
+	 *  - Lazily using a real mm.  loaded_mm != &init_mm, our bit
+	 *    is set in mm_cpumask(loaded_mm), but is_lazy == true.
+	 *    We're heuristically guessing that the CR3 load we
+	 *    skipped more than makes up for the overhead added by
+	 *    lazy mode.
+	 */
+	bool is_lazy;
+
 	/*
 	/*
 	 * Access to this CR4 shadow and to H/W CR4 is protected by
 	 * Access to this CR4 shadow and to H/W CR4 is protected by
 	 * disabling interrupts when modifying either one.
 	 * disabling interrupts when modifying either one.

+ 41 - 0
arch/x86/kernel/amd_nb.c

@@ -27,6 +27,8 @@ static const struct pci_device_id amd_root_ids[] = {
 	{}
 	{}
 };
 };
 
 
+#define PCI_DEVICE_ID_AMD_CNB17H_F4     0x1704
+
 const struct pci_device_id amd_nb_misc_ids[] = {
 const struct pci_device_id amd_nb_misc_ids[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB_MISC) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB_MISC) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) },
@@ -37,6 +39,7 @@ const struct pci_device_id amd_nb_misc_ids[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F3) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F3) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_DF_F3) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_DF_F3) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) },
 	{}
 	{}
 };
 };
 EXPORT_SYMBOL_GPL(amd_nb_misc_ids);
 EXPORT_SYMBOL_GPL(amd_nb_misc_ids);
@@ -48,6 +51,7 @@ static const struct pci_device_id amd_nb_link_ids[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F4) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F4) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_DF_F4) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_DF_F4) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F4) },
 	{}
 	{}
 };
 };
 
 
@@ -402,11 +406,48 @@ void amd_flush_garts(void)
 }
 }
 EXPORT_SYMBOL_GPL(amd_flush_garts);
 EXPORT_SYMBOL_GPL(amd_flush_garts);
 
 
+static void __fix_erratum_688(void *info)
+{
+#define MSR_AMD64_IC_CFG 0xC0011021
+
+	msr_set_bit(MSR_AMD64_IC_CFG, 3);
+	msr_set_bit(MSR_AMD64_IC_CFG, 14);
+}
+
+/* Apply erratum 688 fix so machines without a BIOS fix work. */
+static __init void fix_erratum_688(void)
+{
+	struct pci_dev *F4;
+	u32 val;
+
+	if (boot_cpu_data.x86 != 0x14)
+		return;
+
+	if (!amd_northbridges.num)
+		return;
+
+	F4 = node_to_amd_nb(0)->link;
+	if (!F4)
+		return;
+
+	if (pci_read_config_dword(F4, 0x164, &val))
+		return;
+
+	if (val & BIT(2))
+		return;
+
+	on_each_cpu(__fix_erratum_688, NULL, 0);
+
+	pr_info("x86/cpu/AMD: CPU erratum 688 worked around\n");
+}
+
 static __init int init_amd_nbs(void)
 static __init int init_amd_nbs(void)
 {
 {
 	amd_cache_northbridges();
 	amd_cache_northbridges();
 	amd_cache_gart();
 	amd_cache_gart();
 
 
+	fix_erratum_688();
+
 	return 0;
 	return 0;
 }
 }
 
 

+ 13 - 2
arch/x86/kernel/apic/apic.c

@@ -573,11 +573,21 @@ static u32 bdx_deadline_rev(void)
 	return ~0U;
 	return ~0U;
 }
 }
 
 
+static u32 skx_deadline_rev(void)
+{
+	switch (boot_cpu_data.x86_mask) {
+	case 0x03: return 0x01000136;
+	case 0x04: return 0x02000014;
+	}
+
+	return ~0U;
+}
+
 static const struct x86_cpu_id deadline_match[] = {
 static const struct x86_cpu_id deadline_match[] = {
 	DEADLINE_MODEL_MATCH_FUNC( INTEL_FAM6_HASWELL_X,	hsx_deadline_rev),
 	DEADLINE_MODEL_MATCH_FUNC( INTEL_FAM6_HASWELL_X,	hsx_deadline_rev),
 	DEADLINE_MODEL_MATCH_REV ( INTEL_FAM6_BROADWELL_X,	0x0b000020),
 	DEADLINE_MODEL_MATCH_REV ( INTEL_FAM6_BROADWELL_X,	0x0b000020),
 	DEADLINE_MODEL_MATCH_FUNC( INTEL_FAM6_BROADWELL_XEON_D,	bdx_deadline_rev),
 	DEADLINE_MODEL_MATCH_FUNC( INTEL_FAM6_BROADWELL_XEON_D,	bdx_deadline_rev),
-	DEADLINE_MODEL_MATCH_REV ( INTEL_FAM6_SKYLAKE_X,	0x02000014),
+	DEADLINE_MODEL_MATCH_FUNC( INTEL_FAM6_SKYLAKE_X,	skx_deadline_rev),
 
 
 	DEADLINE_MODEL_MATCH_REV ( INTEL_FAM6_HASWELL_CORE,	0x22),
 	DEADLINE_MODEL_MATCH_REV ( INTEL_FAM6_HASWELL_CORE,	0x22),
 	DEADLINE_MODEL_MATCH_REV ( INTEL_FAM6_HASWELL_ULT,	0x20),
 	DEADLINE_MODEL_MATCH_REV ( INTEL_FAM6_HASWELL_ULT,	0x20),
@@ -600,7 +610,8 @@ static void apic_check_deadline_errata(void)
 	const struct x86_cpu_id *m;
 	const struct x86_cpu_id *m;
 	u32 rev;
 	u32 rev;
 
 
-	if (!boot_cpu_has(X86_FEATURE_TSC_DEADLINE_TIMER))
+	if (!boot_cpu_has(X86_FEATURE_TSC_DEADLINE_TIMER) ||
+	    boot_cpu_has(X86_FEATURE_HYPERVISOR))
 		return;
 		return;
 
 
 	m = x86_match_cpu(deadline_match);
 	m = x86_match_cpu(deadline_match);

+ 0 - 1
arch/x86/kernel/cpu/intel_cacheinfo.c

@@ -831,7 +831,6 @@ static int __cache_amd_cpumap_setup(unsigned int cpu, int index,
 	} else if (boot_cpu_has(X86_FEATURE_TOPOEXT)) {
 	} else if (boot_cpu_has(X86_FEATURE_TOPOEXT)) {
 		unsigned int apicid, nshared, first, last;
 		unsigned int apicid, nshared, first, last;
 
 
-		this_leaf = this_cpu_ci->info_list + index;
 		nshared = base->eax.split.num_threads_sharing + 1;
 		nshared = base->eax.split.num_threads_sharing + 1;
 		apicid = cpu_data(cpu).apicid;
 		apicid = cpu_data(cpu).apicid;
 		first = apicid - (apicid % nshared);
 		first = apicid - (apicid % nshared);

+ 7 - 0
arch/x86/kernel/cpu/mcheck/mce-internal.h

@@ -1,3 +1,6 @@
+#ifndef __X86_MCE_INTERNAL_H__
+#define __X86_MCE_INTERNAL_H__
+
 #include <linux/device.h>
 #include <linux/device.h>
 #include <asm/mce.h>
 #include <asm/mce.h>
 
 
@@ -108,3 +111,7 @@ static inline void mce_work_trigger(void)	{ }
 static inline void mce_register_injector_chain(struct notifier_block *nb)	{ }
 static inline void mce_register_injector_chain(struct notifier_block *nb)	{ }
 static inline void mce_unregister_injector_chain(struct notifier_block *nb)	{ }
 static inline void mce_unregister_injector_chain(struct notifier_block *nb)	{ }
 #endif
 #endif
+
+extern struct mca_config mca_cfg;
+
+#endif /* __X86_MCE_INTERNAL_H__ */

+ 2 - 0
arch/x86/kernel/cpu/mcheck/mce_amd.c

@@ -28,6 +28,8 @@
 #include <asm/msr.h>
 #include <asm/msr.h>
 #include <asm/trace/irq_vectors.h>
 #include <asm/trace/irq_vectors.h>
 
 
+#include "mce-internal.h"
+
 #define NR_BLOCKS         5
 #define NR_BLOCKS         5
 #define THRESHOLD_MAX     0xFFF
 #define THRESHOLD_MAX     0xFFF
 #define INT_TYPE_APIC     0x00020000
 #define INT_TYPE_APIC     0x00020000

Some files were not shown because too many files changed in this diff