Przeglądaj źródła

Merge branch 'linus' into sched/core, to pick up fixes

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Ingo Molnar 9 lat temu
rodzic
commit
50797851b4
100 zmienionych plików z 430 dodań i 358 usunięć
  1. 1 0
      .mailmap
  2. 10 6
      Documentation/arm/CCN.txt
  3. 1 1
      Documentation/cpu-freq/cpufreq-stats.txt
  4. 1 1
      Documentation/devicetree/bindings/mmc/sdhci-st.txt
  5. 5 0
      Documentation/i2c/slave-interface
  6. 26 11
      MAINTAINERS
  7. 1 1
      Makefile
  8. 0 11
      arch/Kconfig
  9. 8 11
      arch/alpha/include/asm/uaccess.h
  10. 9 2
      arch/arc/include/asm/uaccess.h
  11. 1 1
      arch/arm/boot/dts/am335x-baltos.dtsi
  12. 1 1
      arch/arm/boot/dts/am335x-igep0033.dtsi
  13. 1 1
      arch/arm/boot/dts/am335x-phycore-som.dtsi
  14. 4 4
      arch/arm/boot/dts/armada-388-clearfog.dts
  15. 1 0
      arch/arm/boot/dts/bcm2835-rpi.dtsi
  16. 2 1
      arch/arm/boot/dts/bcm283x.dtsi
  17. 0 3
      arch/arm/boot/dts/exynos5410-odroidxu.dts
  18. 1 1
      arch/arm/boot/dts/imx6qdl.dtsi
  19. 1 1
      arch/arm/boot/dts/imx6sx-sabreauto.dts
  20. 1 1
      arch/arm/boot/dts/imx7d-sdb.dts
  21. 1 1
      arch/arm/boot/dts/kirkwood-ib62x0.dts
  22. 4 0
      arch/arm/boot/dts/kirkwood-openrd.dtsi
  23. 6 5
      arch/arm/boot/dts/logicpd-som-lv.dtsi
  24. 1 0
      arch/arm/boot/dts/logicpd-torpedo-som.dtsi
  25. 3 1
      arch/arm/boot/dts/omap3-overo-base.dtsi
  26. 0 2
      arch/arm/boot/dts/omap3-overo-chestnut43-common.dtsi
  27. 0 2
      arch/arm/boot/dts/omap3-overo-tobi-common.dtsi
  28. 0 3
      arch/arm/boot/dts/omap3-overo-tobiduo-common.dtsi
  29. 6 4
      arch/arm/boot/dts/stih407-family.dtsi
  30. 8 4
      arch/arm/boot/dts/stih410.dtsi
  31. 1 1
      arch/arm/boot/dts/sun5i-a13.dtsi
  32. 1 1
      arch/arm/boot/dts/tegra114-dalmore.dts
  33. 1 1
      arch/arm/boot/dts/tegra114-roth.dts
  34. 1 1
      arch/arm/boot/dts/tegra114-tn7.dts
  35. 2 2
      arch/arm/boot/dts/tegra124-jetson-tk1.dts
  36. 2 3
      arch/arm/common/locomo.c
  37. 19 13
      arch/arm/common/sa1111.c
  38. 1 0
      arch/arm/configs/keystone_defconfig
  39. 1 1
      arch/arm/configs/multi_v7_defconfig
  40. 1 1
      arch/arm/crypto/aes-ce-glue.c
  41. 1 0
      arch/arm/include/asm/pgtable-2level-hwdef.h
  42. 1 0
      arch/arm/include/asm/pgtable-3level-hwdef.h
  43. 13 0
      arch/arm/kernel/hyp-stub.S
  44. 0 2
      arch/arm/kvm/arm.c
  45. 3 1
      arch/arm/kvm/mmu.c
  46. 6 0
      arch/arm/mach-exynos/suspend.c
  47. 1 0
      arch/arm/mach-imx/mach-imx6ul.c
  48. 2 2
      arch/arm/mach-imx/pm-imx6.c
  49. 0 6
      arch/arm/mach-omap2/cm33xx.c
  50. 0 6
      arch/arm/mach-omap2/cminst44xx.c
  51. 8 0
      arch/arm/mach-omap2/omap_hwmod.c
  52. 4 0
      arch/arm/mach-omap2/omap_hwmod.h
  53. 2 0
      arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
  54. 12 0
      arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
  55. 14 0
      arch/arm/mach-pxa/lubbock.c
  56. 3 2
      arch/arm/mach-sa1100/clock.c
  57. 4 0
      arch/arm/mach-sa1100/generic.c
  58. 2 0
      arch/arm/mach-sa1100/generic.h
  59. 26 36
      arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
  60. 1 1
      arch/arm/mm/mmu.c
  61. 1 0
      arch/arm/mm/proc-v7.S
  62. 3 4
      arch/arm/xen/enlighten.c
  63. 4 4
      arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
  64. 4 4
      arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
  65. 4 4
      arch/arm64/boot/dts/apm/apm-storm.dtsi
  66. 1 0
      arch/arm64/boot/dts/broadcom/bcm2835-rpi.dtsi
  67. 2 2
      arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts
  68. 1 1
      arch/arm64/boot/dts/broadcom/bcm2837.dtsi
  69. 1 0
      arch/arm64/boot/dts/broadcom/bcm283x-rpi-smsc9514.dtsi
  70. 1 0
      arch/arm64/boot/dts/broadcom/bcm283x.dtsi
  71. 4 4
      arch/arm64/boot/dts/broadcom/ns2.dtsi
  72. 4 4
      arch/arm64/boot/dts/cavium/thunder-88xx.dtsi
  73. 4 4
      arch/arm64/boot/dts/exynos/exynos7.dtsi
  74. 4 4
      arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
  75. 4 4
      arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi
  76. 4 4
      arch/arm64/boot/dts/marvell/armada-ap806.dtsi
  77. 4 4
      arch/arm64/boot/dts/socionext/uniphier-ph1-ld20.dtsi
  78. 4 4
      arch/arm64/boot/dts/xilinx/zynqmp.dtsi
  79. 1 1
      arch/arm64/crypto/aes-glue.c
  80. 4 4
      arch/arm64/include/asm/percpu.h
  81. 10 0
      arch/arm64/include/asm/spinlock.h
  82. 10 1
      arch/avr32/include/asm/uaccess.h
  83. 1 1
      arch/avr32/kernel/avr32_ksyms.c
  84. 4 4
      arch/avr32/lib/copy_user.S
  85. 5 4
      arch/blackfin/include/asm/uaccess.h
  86. 32 39
      arch/cris/include/asm/uaccess.h
  87. 9 3
      arch/frv/include/asm/uaccess.h
  88. 2 1
      arch/hexagon/include/asm/uaccess.h
  89. 13 20
      arch/ia64/include/asm/uaccess.h
  90. 1 1
      arch/m32r/include/asm/uaccess.h
  91. 2 1
      arch/metag/include/asm/uaccess.h
  92. 7 4
      arch/microblaze/include/asm/uaccess.h
  93. 3 0
      arch/mips/include/asm/uaccess.h
  94. 1 0
      arch/mn10300/include/asm/uaccess.h
  95. 3 1
      arch/mn10300/lib/usercopy.c
  96. 8 5
      arch/nios2/include/asm/uaccess.h
  97. 11 24
      arch/openrisc/include/asm/uaccess.h
  98. 4 1
      arch/parisc/include/asm/uaccess.h
  99. 1 1
      arch/powerpc/include/asm/cpu_has_feature.h
  100. 7 31
      arch/powerpc/include/asm/uaccess.h

+ 1 - 0
.mailmap

@@ -88,6 +88,7 @@ Kay Sievers <kay.sievers@vrfy.org>
 Kenneth W Chen <kenneth.w.chen@intel.com>
 Kenneth W Chen <kenneth.w.chen@intel.com>
 Konstantin Khlebnikov <koct9i@gmail.com> <k.khlebnikov@samsung.com>
 Konstantin Khlebnikov <koct9i@gmail.com> <k.khlebnikov@samsung.com>
 Koushik <raghavendra.koushik@neterion.com>
 Koushik <raghavendra.koushik@neterion.com>
+Krzysztof Kozlowski <krzk@kernel.org> <k.kozlowski@samsung.com>
 Krzysztof Kozlowski <krzk@kernel.org> <k.kozlowski.k@gmail.com>
 Krzysztof Kozlowski <krzk@kernel.org> <k.kozlowski.k@gmail.com>
 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
 Leonid I Ananiev <leonid.i.ananiev@intel.com>
 Leonid I Ananiev <leonid.i.ananiev@intel.com>

+ 10 - 6
Documentation/arm/CCN.txt

@@ -18,13 +18,17 @@ and config2 fields of the perf_event_attr structure. The "events"
 directory provides configuration templates for all documented
 directory provides configuration templates for all documented
 events, that can be used with perf tool. For example "xp_valid_flit"
 events, that can be used with perf tool. For example "xp_valid_flit"
 is an equivalent of "type=0x8,event=0x4". Other parameters must be
 is an equivalent of "type=0x8,event=0x4". Other parameters must be
-explicitly specified. For events originating from device, "node"
-defines its index. All crosspoint events require "xp" (index),
-"port" (device port number) and "vc" (virtual channel ID) and
-"dir" (direction). Watchpoints (special "event" value 0xfe) also
-require comparator values ("cmp_l" and "cmp_h") and "mask", being
-index of the comparator mask.
+explicitly specified.
 
 
+For events originating from device, "node" defines its index.
+
+Crosspoint PMU events require "xp" (index), "bus" (bus number)
+and "vc" (virtual channel ID).
+
+Crosspoint watchpoint-based events (special "event" value 0xfe)
+require "xp" and "vc" as as above plus "port" (device port index),
+"dir" (transmit/receive direction), comparator values ("cmp_l"
+and "cmp_h") and "mask", being index of the comparator mask.
 Masks are defined separately from the event description
 Masks are defined separately from the event description
 (due to limited number of the config values) in the "cmp_mask"
 (due to limited number of the config values) in the "cmp_mask"
 directory, with first 8 configurable by user and additional
 directory, with first 8 configurable by user and additional

+ 1 - 1
Documentation/cpu-freq/cpufreq-stats.txt

@@ -103,7 +103,7 @@ Config Main Menu
 	Power management options (ACPI, APM)  --->
 	Power management options (ACPI, APM)  --->
 		CPU Frequency scaling  --->
 		CPU Frequency scaling  --->
 			[*] CPU Frequency scaling
 			[*] CPU Frequency scaling
-			<*>   CPU frequency translation statistics 
+			[*]   CPU frequency translation statistics
 			[*]     CPU frequency translation statistics details
 			[*]     CPU frequency translation statistics details
 
 
 
 

+ 1 - 1
Documentation/devicetree/bindings/mmc/sdhci-st.txt

@@ -10,7 +10,7 @@ Required properties:
 			subsystem (mmcss) inside the FlashSS (available in STiH407 SoC
 			subsystem (mmcss) inside the FlashSS (available in STiH407 SoC
 			family).
 			family).
 
 
-- clock-names:		Should be "mmc".
+- clock-names:		Should be "mmc" and "icn".  (NB: The latter is not compulsory)
 			See: Documentation/devicetree/bindings/resource-names.txt
 			See: Documentation/devicetree/bindings/resource-names.txt
 - clocks:		Phandle to the clock.
 - clocks:		Phandle to the clock.
 			See: Documentation/devicetree/bindings/clock/clock-bindings.txt
 			See: Documentation/devicetree/bindings/clock/clock-bindings.txt

+ 5 - 0
Documentation/i2c/slave-interface

@@ -145,6 +145,11 @@ If you want to add slave support to the bus driver:
 
 
 * Catch the slave interrupts and send appropriate i2c_slave_events to the backend.
 * Catch the slave interrupts and send appropriate i2c_slave_events to the backend.
 
 
+Note that most hardware supports being master _and_ slave on the same bus. So,
+if you extend a bus driver, please make sure that the driver supports that as
+well. In almost all cases, slave support does not need to disable the master
+functionality.
+
 Check the i2c-rcar driver as an example.
 Check the i2c-rcar driver as an example.
 
 
 
 

+ 26 - 11
MAINTAINERS

@@ -1624,7 +1624,8 @@ N:	rockchip
 
 
 ARM/SAMSUNG EXYNOS ARM ARCHITECTURES
 ARM/SAMSUNG EXYNOS ARM ARCHITECTURES
 M:	Kukjin Kim <kgene@kernel.org>
 M:	Kukjin Kim <kgene@kernel.org>
-M:	Krzysztof Kozlowski <k.kozlowski@samsung.com>
+M:	Krzysztof Kozlowski <krzk@kernel.org>
+R:	Javier Martinez Canillas <javier@osg.samsung.com>
 L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 L:	linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
 L:	linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
 S:	Maintained
 S:	Maintained
@@ -1644,7 +1645,6 @@ F:	drivers/*/*s3c64xx*
 F:	drivers/*/*s5pv210*
 F:	drivers/*/*s5pv210*
 F:	drivers/memory/samsung/*
 F:	drivers/memory/samsung/*
 F:	drivers/soc/samsung/*
 F:	drivers/soc/samsung/*
-F:	drivers/spi/spi-s3c*
 F:	Documentation/arm/Samsung/
 F:	Documentation/arm/Samsung/
 F:	Documentation/devicetree/bindings/arm/samsung/
 F:	Documentation/devicetree/bindings/arm/samsung/
 F:	Documentation/devicetree/bindings/sram/samsung-sram.txt
 F:	Documentation/devicetree/bindings/sram/samsung-sram.txt
@@ -1832,6 +1832,7 @@ T:	git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson.git
 ARM/UNIPHIER ARCHITECTURE
 ARM/UNIPHIER ARCHITECTURE
 M:	Masahiro Yamada <yamada.masahiro@socionext.com>
 M:	Masahiro Yamada <yamada.masahiro@socionext.com>
 L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+T:	git git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier.git
 S:	Maintained
 S:	Maintained
 F:	arch/arm/boot/dts/uniphier*
 F:	arch/arm/boot/dts/uniphier*
 F:	arch/arm/include/asm/hardware/cache-uniphier.h
 F:	arch/arm/include/asm/hardware/cache-uniphier.h
@@ -2485,7 +2486,7 @@ F:	include/net/bluetooth/
 BONDING DRIVER
 BONDING DRIVER
 M:	Jay Vosburgh <j.vosburgh@gmail.com>
 M:	Jay Vosburgh <j.vosburgh@gmail.com>
 M:	Veaceslav Falico <vfalico@gmail.com>
 M:	Veaceslav Falico <vfalico@gmail.com>
-M:	Andy Gospodarek <gospo@cumulusnetworks.com>
+M:	Andy Gospodarek <andy@greyhouse.net>
 L:	netdev@vger.kernel.org
 L:	netdev@vger.kernel.org
 W:	http://sourceforge.net/projects/bonding/
 W:	http://sourceforge.net/projects/bonding/
 S:	Supported
 S:	Supported
@@ -3269,7 +3270,7 @@ S:	Maintained
 F:	drivers/net/wan/cosa*
 F:	drivers/net/wan/cosa*
 
 
 CPMAC ETHERNET DRIVER
 CPMAC ETHERNET DRIVER
-M:	Florian Fainelli <florian@openwrt.org>
+M:	Florian Fainelli <f.fainelli@gmail.com>
 L:	netdev@vger.kernel.org
 L:	netdev@vger.kernel.org
 S:	Maintained
 S:	Maintained
 F:	drivers/net/ethernet/ti/cpmac.c
 F:	drivers/net/ethernet/ti/cpmac.c
@@ -6102,7 +6103,7 @@ S:	Supported
 F:	drivers/cpufreq/intel_pstate.c
 F:	drivers/cpufreq/intel_pstate.c
 
 
 INTEL FRAMEBUFFER DRIVER (excluding 810 and 815)
 INTEL FRAMEBUFFER DRIVER (excluding 810 and 815)
-M:	Maik Broemme <mbroemme@plusserver.de>
+M:	Maik Broemme <mbroemme@libmpq.org>
 L:	linux-fbdev@vger.kernel.org
 L:	linux-fbdev@vger.kernel.org
 S:	Maintained
 S:	Maintained
 F:	Documentation/fb/intelfb.txt
 F:	Documentation/fb/intelfb.txt
@@ -7465,7 +7466,8 @@ F:	Documentation/devicetree/bindings/sound/max9860.txt
 F:	sound/soc/codecs/max9860.*
 F:	sound/soc/codecs/max9860.*
 
 
 MAXIM MUIC CHARGER DRIVERS FOR EXYNOS BASED BOARDS
 MAXIM MUIC CHARGER DRIVERS FOR EXYNOS BASED BOARDS
-M:	Krzysztof Kozlowski <k.kozlowski@samsung.com>
+M:	Krzysztof Kozlowski <krzk@kernel.org>
+M:	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
 L:	linux-pm@vger.kernel.org
 L:	linux-pm@vger.kernel.org
 S:	Supported
 S:	Supported
 F:	drivers/power/max14577_charger.c
 F:	drivers/power/max14577_charger.c
@@ -7481,7 +7483,8 @@ F:	include/dt-bindings/*/*max77802.h
 
 
 MAXIM PMIC AND MUIC DRIVERS FOR EXYNOS BASED BOARDS
 MAXIM PMIC AND MUIC DRIVERS FOR EXYNOS BASED BOARDS
 M:	Chanwoo Choi <cw00.choi@samsung.com>
 M:	Chanwoo Choi <cw00.choi@samsung.com>
-M:	Krzysztof Kozlowski <k.kozlowski@samsung.com>
+M:	Krzysztof Kozlowski <krzk@kernel.org>
+M:	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
 L:	linux-kernel@vger.kernel.org
 L:	linux-kernel@vger.kernel.org
 S:	Supported
 S:	Supported
 F:	drivers/*/max14577*.c
 F:	drivers/*/max14577*.c
@@ -9247,7 +9250,7 @@ F:	drivers/pinctrl/sh-pfc/
 
 
 PIN CONTROLLER - SAMSUNG
 PIN CONTROLLER - SAMSUNG
 M:	Tomasz Figa <tomasz.figa@gmail.com>
 M:	Tomasz Figa <tomasz.figa@gmail.com>
-M:	Krzysztof Kozlowski <k.kozlowski@samsung.com>
+M:	Krzysztof Kozlowski <krzk@kernel.org>
 M:	Sylwester Nawrocki <s.nawrocki@samsung.com>
 M:	Sylwester Nawrocki <s.nawrocki@samsung.com>
 L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 L:	linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
 L:	linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
@@ -10180,7 +10183,7 @@ S:	Maintained
 F:	drivers/platform/x86/samsung-laptop.c
 F:	drivers/platform/x86/samsung-laptop.c
 
 
 SAMSUNG AUDIO (ASoC) DRIVERS
 SAMSUNG AUDIO (ASoC) DRIVERS
-M:	Krzysztof Kozlowski <k.kozlowski@samsung.com>
+M:	Krzysztof Kozlowski <krzk@kernel.org>
 M:	Sangbeom Kim <sbkim73@samsung.com>
 M:	Sangbeom Kim <sbkim73@samsung.com>
 M:	Sylwester Nawrocki <s.nawrocki@samsung.com>
 M:	Sylwester Nawrocki <s.nawrocki@samsung.com>
 L:	alsa-devel@alsa-project.org (moderated for non-subscribers)
 L:	alsa-devel@alsa-project.org (moderated for non-subscribers)
@@ -10195,7 +10198,8 @@ F:	drivers/video/fbdev/s3c-fb.c
 
 
 SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS
 SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS
 M:	Sangbeom Kim <sbkim73@samsung.com>
 M:	Sangbeom Kim <sbkim73@samsung.com>
-M:	Krzysztof Kozlowski <k.kozlowski@samsung.com>
+M:	Krzysztof Kozlowski <krzk@kernel.org>
+M:	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
 L:	linux-kernel@vger.kernel.org
 L:	linux-kernel@vger.kernel.org
 L:	linux-samsung-soc@vger.kernel.org
 L:	linux-samsung-soc@vger.kernel.org
 S:	Supported
 S:	Supported
@@ -10254,6 +10258,17 @@ S:	Supported
 L:	linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
 L:	linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
 F:	drivers/clk/samsung/
 F:	drivers/clk/samsung/
 
 
+SAMSUNG SPI DRIVERS
+M:	Kukjin Kim <kgene@kernel.org>
+M:	Krzysztof Kozlowski <krzk@kernel.org>
+M:	Andi Shyti <andi.shyti@samsung.com>
+L:	linux-spi@vger.kernel.org
+L:	linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
+S:	Maintained
+F:	Documentation/devicetree/bindings/spi/spi-samsung.txt
+F:	drivers/spi/spi-s3c*
+F:	include/linux/platform_data/spi-s3c64xx.h
+
 SAMSUNG SXGBE DRIVERS
 SAMSUNG SXGBE DRIVERS
 M:	Byungho An <bh74.an@samsung.com>
 M:	Byungho An <bh74.an@samsung.com>
 M:	Girish K S <ks.giri@samsung.com>
 M:	Girish K S <ks.giri@samsung.com>
@@ -12554,7 +12569,7 @@ F:	include/linux/if_*vlan.h
 F:	net/8021q/
 F:	net/8021q/
 
 
 VLYNQ BUS
 VLYNQ BUS
-M:	Florian Fainelli <florian@openwrt.org>
+M:	Florian Fainelli <f.fainelli@gmail.com>
 L:	openwrt-devel@lists.openwrt.org (subscribers-only)
 L:	openwrt-devel@lists.openwrt.org (subscribers-only)
 S:	Maintained
 S:	Maintained
 F:	drivers/vlynq/vlynq.c
 F:	drivers/vlynq/vlynq.c

+ 1 - 1
Makefile

@@ -1,7 +1,7 @@
 VERSION = 4
 VERSION = 4
 PATCHLEVEL = 8
 PATCHLEVEL = 8
 SUBLEVEL = 0
 SUBLEVEL = 0
-EXTRAVERSION = -rc5
+EXTRAVERSION = -rc7
 NAME = Psychotic Stoned Sheep
 NAME = Psychotic Stoned Sheep
 
 
 # *DOCUMENTATION*
 # *DOCUMENTATION*

+ 0 - 11
arch/Kconfig

@@ -336,17 +336,6 @@ config HAVE_ARCH_SECCOMP_FILTER
 	    results in the system call being skipped immediately.
 	    results in the system call being skipped immediately.
 	  - seccomp syscall wired up
 	  - seccomp syscall wired up
 
 
-	  For best performance, an arch should use seccomp_phase1 and
-	  seccomp_phase2 directly.  It should call seccomp_phase1 for all
-	  syscalls if TIF_SECCOMP is set, but seccomp_phase1 does not
-	  need to be called from a ptrace-safe context.  It must then
-	  call seccomp_phase2 if seccomp_phase1 returns anything other
-	  than SECCOMP_PHASE1_OK or SECCOMP_PHASE1_SKIP.
-
-	  As an additional optimization, an arch may provide seccomp_data
-	  directly to seccomp_phase1; this avoids multiple calls
-	  to the syscall_xyz helpers for every syscall.
-
 config SECCOMP_FILTER
 config SECCOMP_FILTER
 	def_bool y
 	def_bool y
 	depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
 	depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET

+ 8 - 11
arch/alpha/include/asm/uaccess.h

@@ -371,14 +371,6 @@ __copy_tofrom_user_nocheck(void *to, const void *from, long len)
 	return __cu_len;
 	return __cu_len;
 }
 }
 
 
-extern inline long
-__copy_tofrom_user(void *to, const void *from, long len, const void __user *validate)
-{
-	if (__access_ok((unsigned long)validate, len, get_fs()))
-		len = __copy_tofrom_user_nocheck(to, from, len);
-	return len;
-}
-
 #define __copy_to_user(to, from, n)					\
 #define __copy_to_user(to, from, n)					\
 ({									\
 ({									\
 	__chk_user_ptr(to);						\
 	__chk_user_ptr(to);						\
@@ -393,17 +385,22 @@ __copy_tofrom_user(void *to, const void *from, long len, const void __user *vali
 #define __copy_to_user_inatomic __copy_to_user
 #define __copy_to_user_inatomic __copy_to_user
 #define __copy_from_user_inatomic __copy_from_user
 #define __copy_from_user_inatomic __copy_from_user
 
 
-
 extern inline long
 extern inline long
 copy_to_user(void __user *to, const void *from, long n)
 copy_to_user(void __user *to, const void *from, long n)
 {
 {
-	return __copy_tofrom_user((__force void *)to, from, n, to);
+	if (likely(__access_ok((unsigned long)to, n, get_fs())))
+		n = __copy_tofrom_user_nocheck((__force void *)to, from, n);
+	return n;
 }
 }
 
 
 extern inline long
 extern inline long
 copy_from_user(void *to, const void __user *from, long n)
 copy_from_user(void *to, const void __user *from, long n)
 {
 {
-	return __copy_tofrom_user(to, (__force void *)from, n, from);
+	if (likely(__access_ok((unsigned long)from, n, get_fs())))
+		n = __copy_tofrom_user_nocheck(to, (__force void *)from, n);
+	else
+		memset(to, 0, n);
+	return n;
 }
 }
 
 
 extern void __do_clear_user(void);
 extern void __do_clear_user(void);

+ 9 - 2
arch/arc/include/asm/uaccess.h

@@ -83,7 +83,10 @@
 	"2:	;nop\n"				\
 	"2:	;nop\n"				\
 	"	.section .fixup, \"ax\"\n"	\
 	"	.section .fixup, \"ax\"\n"	\
 	"	.align 4\n"			\
 	"	.align 4\n"			\
-	"3:	mov %0, %3\n"			\
+	"3:	# return -EFAULT\n"		\
+	"	mov %0, %3\n"			\
+	"	# zero out dst ptr\n"		\
+	"	mov %1,  0\n"			\
 	"	j   2b\n"			\
 	"	j   2b\n"			\
 	"	.previous\n"			\
 	"	.previous\n"			\
 	"	.section __ex_table, \"a\"\n"	\
 	"	.section __ex_table, \"a\"\n"	\
@@ -101,7 +104,11 @@
 	"2:	;nop\n"				\
 	"2:	;nop\n"				\
 	"	.section .fixup, \"ax\"\n"	\
 	"	.section .fixup, \"ax\"\n"	\
 	"	.align 4\n"			\
 	"	.align 4\n"			\
-	"3:	mov %0, %3\n"			\
+	"3:	# return -EFAULT\n"		\
+	"	mov %0, %3\n"			\
+	"	# zero out dst ptr\n"		\
+	"	mov %1,  0\n"			\
+	"	mov %R1, 0\n"			\
 	"	j   2b\n"			\
 	"	j   2b\n"			\
 	"	.previous\n"			\
 	"	.previous\n"			\
 	"	.section __ex_table, \"a\"\n"	\
 	"	.section __ex_table, \"a\"\n"	\

+ 1 - 1
arch/arm/boot/dts/am335x-baltos.dtsi

@@ -226,7 +226,7 @@
 
 
 		#address-cells = <1>;
 		#address-cells = <1>;
 		#size-cells = <1>;
 		#size-cells = <1>;
-		elm_id = <&elm>;
+		ti,elm-id = <&elm>;
 	};
 	};
 };
 };
 
 

+ 1 - 1
arch/arm/boot/dts/am335x-igep0033.dtsi

@@ -161,7 +161,7 @@
 
 
 		#address-cells = <1>;
 		#address-cells = <1>;
 		#size-cells = <1>;
 		#size-cells = <1>;
-		elm_id = <&elm>;
+		ti,elm-id = <&elm>;
 
 
 		/* MTD partition table */
 		/* MTD partition table */
 		partition@0 {
 		partition@0 {

+ 1 - 1
arch/arm/boot/dts/am335x-phycore-som.dtsi

@@ -197,7 +197,7 @@
 		gpmc,wr-access-ns = <30>;
 		gpmc,wr-access-ns = <30>;
 		gpmc,wr-data-mux-bus-ns = <0>;
 		gpmc,wr-data-mux-bus-ns = <0>;
 
 
-		elm_id = <&elm>;
+		ti,elm-id = <&elm>;
 
 
 		#address-cells = <1>;
 		#address-cells = <1>;
 		#size-cells = <1>;
 		#size-cells = <1>;

+ 4 - 4
arch/arm/boot/dts/armada-388-clearfog.dts

@@ -390,12 +390,12 @@
 
 
 			port@0 {
 			port@0 {
 				reg = <0>;
 				reg = <0>;
-				label = "lan1";
+				label = "lan5";
 			};
 			};
 
 
 			port@1 {
 			port@1 {
 				reg = <1>;
 				reg = <1>;
-				label = "lan2";
+				label = "lan4";
 			};
 			};
 
 
 			port@2 {
 			port@2 {
@@ -405,12 +405,12 @@
 
 
 			port@3 {
 			port@3 {
 				reg = <3>;
 				reg = <3>;
-				label = "lan4";
+				label = "lan2";
 			};
 			};
 
 
 			port@4 {
 			port@4 {
 				reg = <4>;
 				reg = <4>;
-				label = "lan5";
+				label = "lan1";
 			};
 			};
 
 
 			port@5 {
 			port@5 {

+ 1 - 0
arch/arm/boot/dts/bcm2835-rpi.dtsi

@@ -2,6 +2,7 @@
 
 
 / {
 / {
 	memory {
 	memory {
+		device_type = "memory";
 		reg = <0 0x10000000>;
 		reg = <0 0x10000000>;
 	};
 	};
 
 

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

@@ -2,7 +2,6 @@
 #include <dt-bindings/clock/bcm2835.h>
 #include <dt-bindings/clock/bcm2835.h>
 #include <dt-bindings/clock/bcm2835-aux.h>
 #include <dt-bindings/clock/bcm2835-aux.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/gpio/gpio.h>
-#include "skeleton.dtsi"
 
 
 /* This include file covers the common peripherals and configuration between
 /* This include file covers the common peripherals and configuration between
  * bcm2835 and bcm2836 implementations, leaving the CPU configuration to
  * bcm2835 and bcm2836 implementations, leaving the CPU configuration to
@@ -13,6 +12,8 @@
 	compatible = "brcm,bcm2835";
 	compatible = "brcm,bcm2835";
 	model = "BCM2835";
 	model = "BCM2835";
 	interrupt-parent = <&intc>;
 	interrupt-parent = <&intc>;
+	#address-cells = <1>;
+	#size-cells = <1>;
 
 
 	chosen {
 	chosen {
 		bootargs = "earlyprintk console=ttyAMA0";
 		bootargs = "earlyprintk console=ttyAMA0";

+ 0 - 3
arch/arm/boot/dts/exynos5410-odroidxu.dts

@@ -447,14 +447,11 @@
 	samsung,dw-mshc-ciu-div = <3>;
 	samsung,dw-mshc-ciu-div = <3>;
 	samsung,dw-mshc-sdr-timing = <0 4>;
 	samsung,dw-mshc-sdr-timing = <0 4>;
 	samsung,dw-mshc-ddr-timing = <0 2>;
 	samsung,dw-mshc-ddr-timing = <0 2>;
-	samsung,dw-mshc-hs400-timing = <0 2>;
-	samsung,read-strobe-delay = <90>;
 	pinctrl-names = "default";
 	pinctrl-names = "default";
 	pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus1 &sd0_bus4 &sd0_bus8 &sd0_cd>;
 	pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus1 &sd0_bus4 &sd0_bus8 &sd0_cd>;
 	bus-width = <8>;
 	bus-width = <8>;
 	cap-mmc-highspeed;
 	cap-mmc-highspeed;
 	mmc-hs200-1_8v;
 	mmc-hs200-1_8v;
-	mmc-hs400-1_8v;
 	vmmc-supply = <&ldo20_reg>;
 	vmmc-supply = <&ldo20_reg>;
 	vqmmc-supply = <&ldo11_reg>;
 	vqmmc-supply = <&ldo11_reg>;
 };
 };

+ 1 - 1
arch/arm/boot/dts/imx6qdl.dtsi

@@ -243,7 +243,7 @@
 					clocks = <&clks IMX6QDL_CLK_SPDIF_GCLK>, <&clks IMX6QDL_CLK_OSC>,
 					clocks = <&clks IMX6QDL_CLK_SPDIF_GCLK>, <&clks IMX6QDL_CLK_OSC>,
 						 <&clks IMX6QDL_CLK_SPDIF>, <&clks IMX6QDL_CLK_ASRC>,
 						 <&clks IMX6QDL_CLK_SPDIF>, <&clks IMX6QDL_CLK_ASRC>,
 						 <&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_ESAI_EXTAL>,
 						 <&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_ESAI_EXTAL>,
-						 <&clks IMX6QDL_CLK_IPG>, <&clks IMX6QDL_CLK_MLB>,
+						 <&clks IMX6QDL_CLK_IPG>, <&clks IMX6QDL_CLK_DUMMY>,
 						 <&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_SPBA>;
 						 <&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_SPBA>;
 					clock-names = "core",  "rxtx0",
 					clock-names = "core",  "rxtx0",
 						      "rxtx1", "rxtx2",
 						      "rxtx1", "rxtx2",

+ 1 - 1
arch/arm/boot/dts/imx6sx-sabreauto.dts

@@ -64,7 +64,7 @@
 	cd-gpios = <&gpio7 11 GPIO_ACTIVE_LOW>;
 	cd-gpios = <&gpio7 11 GPIO_ACTIVE_LOW>;
 	no-1-8-v;
 	no-1-8-v;
 	keep-power-in-suspend;
 	keep-power-in-suspend;
-	enable-sdio-wakup;
+	wakeup-source;
 	status = "okay";
 	status = "okay";
 };
 };
 
 

+ 1 - 1
arch/arm/boot/dts/imx7d-sdb.dts

@@ -131,7 +131,7 @@
 		ti,y-min = /bits/ 16 <0>;
 		ti,y-min = /bits/ 16 <0>;
 		ti,y-max = /bits/ 16 <0>;
 		ti,y-max = /bits/ 16 <0>;
 		ti,pressure-max = /bits/ 16 <0>;
 		ti,pressure-max = /bits/ 16 <0>;
-		ti,x-plat-ohms = /bits/ 16 <400>;
+		ti,x-plate-ohms = /bits/ 16 <400>;
 		wakeup-source;
 		wakeup-source;
 	};
 	};
 };
 };

+ 1 - 1
arch/arm/boot/dts/kirkwood-ib62x0.dts

@@ -113,7 +113,7 @@
 
 
 	partition@e0000 {
 	partition@e0000 {
 		label = "u-boot environment";
 		label = "u-boot environment";
-		reg = <0xe0000 0x100000>;
+		reg = <0xe0000 0x20000>;
 	};
 	};
 
 
 	partition@100000 {
 	partition@100000 {

+ 4 - 0
arch/arm/boot/dts/kirkwood-openrd.dtsi

@@ -116,6 +116,10 @@
 	};
 	};
 };
 };
 
 
+&pciec {
+	status = "okay";
+};
+
 &pcie0 {
 &pcie0 {
 	status = "okay";
 	status = "okay";
 };
 };

+ 6 - 5
arch/arm/boot/dts/logicpd-som-lv.dtsi

@@ -35,10 +35,15 @@
 	ranges = <0 0 0x00000000 0x1000000>;	/* CS0: 16MB for NAND */
 	ranges = <0 0 0x00000000 0x1000000>;	/* CS0: 16MB for NAND */
 
 
 	nand@0,0 {
 	nand@0,0 {
-		linux,mtd-name = "micron,mt29f4g16abbda3w";
+		compatible = "ti,omap2-nand";
 		reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
 		reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
+		interrupt-parent = <&gpmc>;
+		interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
+			     <1 IRQ_TYPE_NONE>;	/* termcount */
+		linux,mtd-name = "micron,mt29f4g16abbda3w";
 		nand-bus-width = <16>;
 		nand-bus-width = <16>;
 		ti,nand-ecc-opt = "bch8";
 		ti,nand-ecc-opt = "bch8";
+		rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */
 		gpmc,sync-clk-ps = <0>;
 		gpmc,sync-clk-ps = <0>;
 		gpmc,cs-on-ns = <0>;
 		gpmc,cs-on-ns = <0>;
 		gpmc,cs-rd-off-ns = <44>;
 		gpmc,cs-rd-off-ns = <44>;
@@ -54,10 +59,6 @@
 		gpmc,wr-access-ns = <40>;
 		gpmc,wr-access-ns = <40>;
 		gpmc,wr-data-mux-bus-ns = <0>;
 		gpmc,wr-data-mux-bus-ns = <0>;
 		gpmc,device-width = <2>;
 		gpmc,device-width = <2>;
-
-		gpmc,page-burst-access-ns = <5>;
-		gpmc,cycle2cycle-delay-ns = <50>;
-
 		#address-cells = <1>;
 		#address-cells = <1>;
 		#size-cells = <1>;
 		#size-cells = <1>;
 
 

+ 1 - 0
arch/arm/boot/dts/logicpd-torpedo-som.dtsi

@@ -46,6 +46,7 @@
 		linux,mtd-name = "micron,mt29f4g16abbda3w";
 		linux,mtd-name = "micron,mt29f4g16abbda3w";
 		nand-bus-width = <16>;
 		nand-bus-width = <16>;
 		ti,nand-ecc-opt = "bch8";
 		ti,nand-ecc-opt = "bch8";
+		rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */
 		gpmc,sync-clk-ps = <0>;
 		gpmc,sync-clk-ps = <0>;
 		gpmc,cs-on-ns = <0>;
 		gpmc,cs-on-ns = <0>;
 		gpmc,cs-rd-off-ns = <44>;
 		gpmc,cs-rd-off-ns = <44>;

+ 3 - 1
arch/arm/boot/dts/omap3-overo-base.dtsi

@@ -223,7 +223,9 @@
 };
 };
 
 
 &gpmc {
 &gpmc {
-	ranges = <0 0 0x00000000 0x20000000>;
+	ranges = <0 0 0x30000000 0x1000000>,	/* CS0 */
+		 <4 0 0x2b000000 0x1000000>,	/* CS4 */
+		 <5 0 0x2c000000 0x1000000>;	/* CS5 */
 
 
 	nand@0,0 {
 	nand@0,0 {
 		compatible = "ti,omap2-nand";
 		compatible = "ti,omap2-nand";

+ 0 - 2
arch/arm/boot/dts/omap3-overo-chestnut43-common.dtsi

@@ -55,8 +55,6 @@
 #include "omap-gpmc-smsc9221.dtsi"
 #include "omap-gpmc-smsc9221.dtsi"
 
 
 &gpmc {
 &gpmc {
-	ranges = <5 0 0x2c000000 0x1000000>;	/* CS5 */
-
 	ethernet@gpmc {
 	ethernet@gpmc {
 		reg = <5 0 0xff>;
 		reg = <5 0 0xff>;
 		interrupt-parent = <&gpio6>;
 		interrupt-parent = <&gpio6>;

+ 0 - 2
arch/arm/boot/dts/omap3-overo-tobi-common.dtsi

@@ -27,8 +27,6 @@
 #include "omap-gpmc-smsc9221.dtsi"
 #include "omap-gpmc-smsc9221.dtsi"
 
 
 &gpmc {
 &gpmc {
-	ranges = <5 0 0x2c000000 0x1000000>;	/* CS5 */
-
 	ethernet@gpmc {
 	ethernet@gpmc {
 		reg = <5 0 0xff>;
 		reg = <5 0 0xff>;
 		interrupt-parent = <&gpio6>;
 		interrupt-parent = <&gpio6>;

+ 0 - 3
arch/arm/boot/dts/omap3-overo-tobiduo-common.dtsi

@@ -15,9 +15,6 @@
 #include "omap-gpmc-smsc9221.dtsi"
 #include "omap-gpmc-smsc9221.dtsi"
 
 
 &gpmc {
 &gpmc {
-	ranges = <4 0 0x2b000000 0x1000000>,	/* CS4 */
-		 <5 0 0x2c000000 0x1000000>;	/* CS5 */
-
 	smsc1: ethernet@gpmc {
 	smsc1: ethernet@gpmc {
 		reg = <5 0 0xff>;
 		reg = <5 0 0xff>;
 		interrupt-parent = <&gpio6>;
 		interrupt-parent = <&gpio6>;

+ 6 - 4
arch/arm/boot/dts/stih407-family.dtsi

@@ -550,8 +550,9 @@
 			interrupt-names = "mmcirq";
 			interrupt-names = "mmcirq";
 			pinctrl-names = "default";
 			pinctrl-names = "default";
 			pinctrl-0 = <&pinctrl_mmc0>;
 			pinctrl-0 = <&pinctrl_mmc0>;
-			clock-names = "mmc";
-			clocks = <&clk_s_c0_flexgen CLK_MMC_0>;
+			clock-names = "mmc", "icn";
+			clocks = <&clk_s_c0_flexgen CLK_MMC_0>,
+				 <&clk_s_c0_flexgen CLK_RX_ICN_HVA>;
 			bus-width = <8>;
 			bus-width = <8>;
 			non-removable;
 			non-removable;
 		};
 		};
@@ -565,8 +566,9 @@
 			interrupt-names = "mmcirq";
 			interrupt-names = "mmcirq";
 			pinctrl-names = "default";
 			pinctrl-names = "default";
 			pinctrl-0 = <&pinctrl_sd1>;
 			pinctrl-0 = <&pinctrl_sd1>;
-			clock-names = "mmc";
-			clocks = <&clk_s_c0_flexgen CLK_MMC_1>;
+			clock-names = "mmc", "icn";
+			clocks = <&clk_s_c0_flexgen CLK_MMC_1>,
+				 <&clk_s_c0_flexgen CLK_RX_ICN_HVA>;
 			resets = <&softreset STIH407_MMC1_SOFTRESET>;
 			resets = <&softreset STIH407_MMC1_SOFTRESET>;
 			bus-width = <4>;
 			bus-width = <4>;
 		};
 		};

+ 8 - 4
arch/arm/boot/dts/stih410.dtsi

@@ -41,7 +41,8 @@
 			compatible = "st,st-ohci-300x";
 			compatible = "st,st-ohci-300x";
 			reg = <0x9a03c00 0x100>;
 			reg = <0x9a03c00 0x100>;
 			interrupts = <GIC_SPI 180 IRQ_TYPE_NONE>;
 			interrupts = <GIC_SPI 180 IRQ_TYPE_NONE>;
-			clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>;
+			clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>,
+				 <&clk_s_c0_flexgen CLK_RX_ICN_DISP_0>;
 			resets = <&powerdown STIH407_USB2_PORT0_POWERDOWN>,
 			resets = <&powerdown STIH407_USB2_PORT0_POWERDOWN>,
 				 <&softreset STIH407_USB2_PORT0_SOFTRESET>;
 				 <&softreset STIH407_USB2_PORT0_SOFTRESET>;
 			reset-names = "power", "softreset";
 			reset-names = "power", "softreset";
@@ -57,7 +58,8 @@
 			interrupts = <GIC_SPI 151 IRQ_TYPE_NONE>;
 			interrupts = <GIC_SPI 151 IRQ_TYPE_NONE>;
 			pinctrl-names = "default";
 			pinctrl-names = "default";
 			pinctrl-0 = <&pinctrl_usb0>;
 			pinctrl-0 = <&pinctrl_usb0>;
-			clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>;
+			clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>,
+				 <&clk_s_c0_flexgen CLK_RX_ICN_DISP_0>;
 			resets = <&powerdown STIH407_USB2_PORT0_POWERDOWN>,
 			resets = <&powerdown STIH407_USB2_PORT0_POWERDOWN>,
 				 <&softreset STIH407_USB2_PORT0_SOFTRESET>;
 				 <&softreset STIH407_USB2_PORT0_SOFTRESET>;
 			reset-names = "power", "softreset";
 			reset-names = "power", "softreset";
@@ -71,7 +73,8 @@
 			compatible = "st,st-ohci-300x";
 			compatible = "st,st-ohci-300x";
 			reg = <0x9a83c00 0x100>;
 			reg = <0x9a83c00 0x100>;
 			interrupts = <GIC_SPI 181 IRQ_TYPE_NONE>;
 			interrupts = <GIC_SPI 181 IRQ_TYPE_NONE>;
-			clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>;
+			clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>,
+				 <&clk_s_c0_flexgen CLK_RX_ICN_DISP_0>;
 			resets = <&powerdown STIH407_USB2_PORT1_POWERDOWN>,
 			resets = <&powerdown STIH407_USB2_PORT1_POWERDOWN>,
 				 <&softreset STIH407_USB2_PORT1_SOFTRESET>;
 				 <&softreset STIH407_USB2_PORT1_SOFTRESET>;
 			reset-names = "power", "softreset";
 			reset-names = "power", "softreset";
@@ -87,7 +90,8 @@
 			interrupts = <GIC_SPI 153 IRQ_TYPE_NONE>;
 			interrupts = <GIC_SPI 153 IRQ_TYPE_NONE>;
 			pinctrl-names = "default";
 			pinctrl-names = "default";
 			pinctrl-0 = <&pinctrl_usb1>;
 			pinctrl-0 = <&pinctrl_usb1>;
-			clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>;
+			clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>,
+				 <&clk_s_c0_flexgen CLK_RX_ICN_DISP_0>;
 			resets = <&powerdown STIH407_USB2_PORT1_POWERDOWN>,
 			resets = <&powerdown STIH407_USB2_PORT1_POWERDOWN>,
 				 <&softreset STIH407_USB2_PORT1_SOFTRESET>;
 				 <&softreset STIH407_USB2_PORT1_SOFTRESET>;
 			reset-names = "power", "softreset";
 			reset-names = "power", "softreset";

+ 1 - 1
arch/arm/boot/dts/sun5i-a13.dtsi

@@ -84,7 +84,7 @@
 			trips {
 			trips {
 				cpu_alert0: cpu_alert0 {
 				cpu_alert0: cpu_alert0 {
 					/* milliCelsius */
 					/* milliCelsius */
-					temperature = <850000>;
+					temperature = <85000>;
 					hysteresis = <2000>;
 					hysteresis = <2000>;
 					type = "passive";
 					type = "passive";
 				};
 				};

+ 1 - 1
arch/arm/boot/dts/tegra114-dalmore.dts

@@ -897,7 +897,7 @@
 		palmas: tps65913@58 {
 		palmas: tps65913@58 {
 			compatible = "ti,palmas";
 			compatible = "ti,palmas";
 			reg = <0x58>;
 			reg = <0x58>;
-			interrupts = <0 86 IRQ_TYPE_LEVEL_LOW>;
+			interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>;
 
 
 			#interrupt-cells = <2>;
 			#interrupt-cells = <2>;
 			interrupt-controller;
 			interrupt-controller;

+ 1 - 1
arch/arm/boot/dts/tegra114-roth.dts

@@ -802,7 +802,7 @@
 		palmas: pmic@58 {
 		palmas: pmic@58 {
 			compatible = "ti,palmas";
 			compatible = "ti,palmas";
 			reg = <0x58>;
 			reg = <0x58>;
-			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_LOW>;
+			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
 
 
 			#interrupt-cells = <2>;
 			#interrupt-cells = <2>;
 			interrupt-controller;
 			interrupt-controller;

+ 1 - 1
arch/arm/boot/dts/tegra114-tn7.dts

@@ -63,7 +63,7 @@
 		palmas: pmic@58 {
 		palmas: pmic@58 {
 			compatible = "ti,palmas";
 			compatible = "ti,palmas";
 			reg = <0x58>;
 			reg = <0x58>;
-			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_LOW>;
+			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
 
 
 			#interrupt-cells = <2>;
 			#interrupt-cells = <2>;
 			interrupt-controller;
 			interrupt-controller;

+ 2 - 2
arch/arm/boot/dts/tegra124-jetson-tk1.dts

@@ -1382,7 +1382,7 @@
 	 *   Pin 41: BR_UART1_TXD
 	 *   Pin 41: BR_UART1_TXD
 	 *   Pin 44: BR_UART1_RXD
 	 *   Pin 44: BR_UART1_RXD
 	 */
 	 */
-	serial@0,70006000 {
+	serial@70006000 {
 		compatible = "nvidia,tegra124-hsuart", "nvidia,tegra30-hsuart";
 		compatible = "nvidia,tegra124-hsuart", "nvidia,tegra30-hsuart";
 		status = "okay";
 		status = "okay";
 	};
 	};
@@ -1394,7 +1394,7 @@
 	 *   Pin 71: UART2_CTS_L
 	 *   Pin 71: UART2_CTS_L
 	 *   Pin 74: UART2_RTS_L
 	 *   Pin 74: UART2_RTS_L
 	 */
 	 */
-	serial@0,70006040 {
+	serial@70006040 {
 		compatible = "nvidia,tegra124-hsuart", "nvidia,tegra30-hsuart";
 		compatible = "nvidia,tegra124-hsuart", "nvidia,tegra30-hsuart";
 		status = "okay";
 		status = "okay";
 	};
 	};

+ 2 - 3
arch/arm/common/locomo.c

@@ -140,7 +140,7 @@ static struct locomo_dev_info locomo_devices[] = {
 
 
 static void locomo_handler(struct irq_desc *desc)
 static void locomo_handler(struct irq_desc *desc)
 {
 {
-	struct locomo *lchip = irq_desc_get_chip_data(desc);
+	struct locomo *lchip = irq_desc_get_handler_data(desc);
 	int req, i;
 	int req, i;
 
 
 	/* Acknowledge the parent IRQ */
 	/* Acknowledge the parent IRQ */
@@ -200,8 +200,7 @@ static void locomo_setup_irq(struct locomo *lchip)
 	 * Install handler for IRQ_LOCOMO_HW.
 	 * Install handler for IRQ_LOCOMO_HW.
 	 */
 	 */
 	irq_set_irq_type(lchip->irq, IRQ_TYPE_EDGE_FALLING);
 	irq_set_irq_type(lchip->irq, IRQ_TYPE_EDGE_FALLING);
-	irq_set_chip_data(lchip->irq, lchip);
-	irq_set_chained_handler(lchip->irq, locomo_handler);
+	irq_set_chained_handler_and_data(lchip->irq, locomo_handler, lchip);
 
 
 	/* Install handlers for IRQ_LOCOMO_* */
 	/* Install handlers for IRQ_LOCOMO_* */
 	for ( ; irq <= lchip->irq_base + 3; irq++) {
 	for ( ; irq <= lchip->irq_base + 3; irq++) {

+ 19 - 13
arch/arm/common/sa1111.c

@@ -472,8 +472,8 @@ static int sa1111_setup_irq(struct sa1111 *sachip, unsigned irq_base)
 	 * specifies that S0ReadyInt and S1ReadyInt should be '1'.
 	 * specifies that S0ReadyInt and S1ReadyInt should be '1'.
 	 */
 	 */
 	sa1111_writel(0, irqbase + SA1111_INTPOL0);
 	sa1111_writel(0, irqbase + SA1111_INTPOL0);
-	sa1111_writel(SA1111_IRQMASK_HI(IRQ_S0_READY_NINT) |
-		      SA1111_IRQMASK_HI(IRQ_S1_READY_NINT),
+	sa1111_writel(BIT(IRQ_S0_READY_NINT & 31) |
+		      BIT(IRQ_S1_READY_NINT & 31),
 		      irqbase + SA1111_INTPOL1);
 		      irqbase + SA1111_INTPOL1);
 
 
 	/* clear all IRQs */
 	/* clear all IRQs */
@@ -754,7 +754,7 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq)
 	if (sachip->irq != NO_IRQ) {
 	if (sachip->irq != NO_IRQ) {
 		ret = sa1111_setup_irq(sachip, pd->irq_base);
 		ret = sa1111_setup_irq(sachip, pd->irq_base);
 		if (ret)
 		if (ret)
-			goto err_unmap;
+			goto err_clk;
 	}
 	}
 
 
 #ifdef CONFIG_ARCH_SA1100
 #ifdef CONFIG_ARCH_SA1100
@@ -799,6 +799,8 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq)
 
 
 	return 0;
 	return 0;
 
 
+ err_clk:
+	clk_disable(sachip->clk);
  err_unmap:
  err_unmap:
 	iounmap(sachip->base);
 	iounmap(sachip->base);
  err_clk_unprep:
  err_clk_unprep:
@@ -869,9 +871,9 @@ struct sa1111_save_data {
 
 
 #ifdef CONFIG_PM
 #ifdef CONFIG_PM
 
 
-static int sa1111_suspend(struct platform_device *dev, pm_message_t state)
+static int sa1111_suspend_noirq(struct device *dev)
 {
 {
-	struct sa1111 *sachip = platform_get_drvdata(dev);
+	struct sa1111 *sachip = dev_get_drvdata(dev);
 	struct sa1111_save_data *save;
 	struct sa1111_save_data *save;
 	unsigned long flags;
 	unsigned long flags;
 	unsigned int val;
 	unsigned int val;
@@ -934,9 +936,9 @@ static int sa1111_suspend(struct platform_device *dev, pm_message_t state)
  *	restored by their respective drivers, and must be called
  *	restored by their respective drivers, and must be called
  *	via LDM after this function.
  *	via LDM after this function.
  */
  */
-static int sa1111_resume(struct platform_device *dev)
+static int sa1111_resume_noirq(struct device *dev)
 {
 {
-	struct sa1111 *sachip = platform_get_drvdata(dev);
+	struct sa1111 *sachip = dev_get_drvdata(dev);
 	struct sa1111_save_data *save;
 	struct sa1111_save_data *save;
 	unsigned long flags, id;
 	unsigned long flags, id;
 	void __iomem *base;
 	void __iomem *base;
@@ -952,7 +954,7 @@ static int sa1111_resume(struct platform_device *dev)
 	id = sa1111_readl(sachip->base + SA1111_SKID);
 	id = sa1111_readl(sachip->base + SA1111_SKID);
 	if ((id & SKID_ID_MASK) != SKID_SA1111_ID) {
 	if ((id & SKID_ID_MASK) != SKID_SA1111_ID) {
 		__sa1111_remove(sachip);
 		__sa1111_remove(sachip);
-		platform_set_drvdata(dev, NULL);
+		dev_set_drvdata(dev, NULL);
 		kfree(save);
 		kfree(save);
 		return 0;
 		return 0;
 	}
 	}
@@ -1003,8 +1005,8 @@ static int sa1111_resume(struct platform_device *dev)
 }
 }
 
 
 #else
 #else
-#define sa1111_suspend NULL
-#define sa1111_resume  NULL
+#define sa1111_suspend_noirq NULL
+#define sa1111_resume_noirq  NULL
 #endif
 #endif
 
 
 static int sa1111_probe(struct platform_device *pdev)
 static int sa1111_probe(struct platform_device *pdev)
@@ -1017,7 +1019,7 @@ static int sa1111_probe(struct platform_device *pdev)
 		return -EINVAL;
 		return -EINVAL;
 	irq = platform_get_irq(pdev, 0);
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
 	if (irq < 0)
-		return -ENXIO;
+		return irq;
 
 
 	return __sa1111_probe(&pdev->dev, mem, irq);
 	return __sa1111_probe(&pdev->dev, mem, irq);
 }
 }
@@ -1038,6 +1040,11 @@ static int sa1111_remove(struct platform_device *pdev)
 	return 0;
 	return 0;
 }
 }
 
 
+static struct dev_pm_ops sa1111_pm_ops = {
+	.suspend_noirq = sa1111_suspend_noirq,
+	.resume_noirq = sa1111_resume_noirq,
+};
+
 /*
 /*
  *	Not sure if this should be on the system bus or not yet.
  *	Not sure if this should be on the system bus or not yet.
  *	We really want some way to register a system device at
  *	We really want some way to register a system device at
@@ -1050,10 +1057,9 @@ static int sa1111_remove(struct platform_device *pdev)
 static struct platform_driver sa1111_device_driver = {
 static struct platform_driver sa1111_device_driver = {
 	.probe		= sa1111_probe,
 	.probe		= sa1111_probe,
 	.remove		= sa1111_remove,
 	.remove		= sa1111_remove,
-	.suspend	= sa1111_suspend,
-	.resume		= sa1111_resume,
 	.driver		= {
 	.driver		= {
 		.name	= "sa1111",
 		.name	= "sa1111",
+		.pm	= &sa1111_pm_ops,
 	},
 	},
 };
 };
 
 

+ 1 - 0
arch/arm/configs/keystone_defconfig

@@ -161,6 +161,7 @@ CONFIG_USB_MON=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3=y
+CONFIG_NOP_USB_XCEIV=y
 CONFIG_KEYSTONE_USB_PHY=y
 CONFIG_KEYSTONE_USB_PHY=y
 CONFIG_NEW_LEDS=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
 CONFIG_LEDS_CLASS=y

+ 1 - 1
arch/arm/configs/multi_v7_defconfig

@@ -781,7 +781,7 @@ CONFIG_MXS_DMA=y
 CONFIG_DMA_BCM2835=y
 CONFIG_DMA_BCM2835=y
 CONFIG_DMA_OMAP=y
 CONFIG_DMA_OMAP=y
 CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_BAM_DMA=y
-CONFIG_XILINX_VDMA=y
+CONFIG_XILINX_DMA=y
 CONFIG_DMA_SUN6I=y
 CONFIG_DMA_SUN6I=y
 CONFIG_STAGING=y
 CONFIG_STAGING=y
 CONFIG_SENSORS_ISL29018=y
 CONFIG_SENSORS_ISL29018=y

+ 1 - 1
arch/arm/crypto/aes-ce-glue.c

@@ -284,7 +284,7 @@ static int ctr_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
 		err = blkcipher_walk_done(desc, &walk,
 		err = blkcipher_walk_done(desc, &walk,
 					  walk.nbytes % AES_BLOCK_SIZE);
 					  walk.nbytes % AES_BLOCK_SIZE);
 	}
 	}
-	if (nbytes) {
+	if (walk.nbytes % AES_BLOCK_SIZE) {
 		u8 *tdst = walk.dst.virt.addr + blocks * AES_BLOCK_SIZE;
 		u8 *tdst = walk.dst.virt.addr + blocks * AES_BLOCK_SIZE;
 		u8 *tsrc = walk.src.virt.addr + blocks * AES_BLOCK_SIZE;
 		u8 *tsrc = walk.src.virt.addr + blocks * AES_BLOCK_SIZE;
 		u8 __aligned(8) tail[AES_BLOCK_SIZE];
 		u8 __aligned(8) tail[AES_BLOCK_SIZE];

+ 1 - 0
arch/arm/include/asm/pgtable-2level-hwdef.h

@@ -47,6 +47,7 @@
 #define PMD_SECT_WB		(PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
 #define PMD_SECT_WB		(PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
 #define PMD_SECT_MINICACHE	(PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE)
 #define PMD_SECT_MINICACHE	(PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE)
 #define PMD_SECT_WBWA		(PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
 #define PMD_SECT_WBWA		(PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
+#define PMD_SECT_CACHE_MASK	(PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
 #define PMD_SECT_NONSHARED_DEV	(PMD_SECT_TEX(2))
 #define PMD_SECT_NONSHARED_DEV	(PMD_SECT_TEX(2))
 
 
 /*
 /*

+ 1 - 0
arch/arm/include/asm/pgtable-3level-hwdef.h

@@ -62,6 +62,7 @@
 #define PMD_SECT_WT		(_AT(pmdval_t, 2) << 2)	/* normal inner write-through */
 #define PMD_SECT_WT		(_AT(pmdval_t, 2) << 2)	/* normal inner write-through */
 #define PMD_SECT_WB		(_AT(pmdval_t, 3) << 2)	/* normal inner write-back */
 #define PMD_SECT_WB		(_AT(pmdval_t, 3) << 2)	/* normal inner write-back */
 #define PMD_SECT_WBWA		(_AT(pmdval_t, 7) << 2)	/* normal inner write-alloc */
 #define PMD_SECT_WBWA		(_AT(pmdval_t, 7) << 2)	/* normal inner write-alloc */
+#define PMD_SECT_CACHE_MASK	(_AT(pmdval_t, 7) << 2)
 
 
 /*
 /*
  * + Level 3 descriptor (PTE)
  * + Level 3 descriptor (PTE)

+ 13 - 0
arch/arm/kernel/hyp-stub.S

@@ -142,6 +142,19 @@ ARM_BE8(orr	r7, r7, #(1 << 25))     @ HSCTLR.EE
 	and	r7, #0x1f		@ Preserve HPMN
 	and	r7, #0x1f		@ Preserve HPMN
 	mcr	p15, 4, r7, c1, c1, 1	@ HDCR
 	mcr	p15, 4, r7, c1, c1, 1	@ HDCR
 
 
+	@ Make sure NS-SVC is initialised appropriately
+	mrc	p15, 0, r7, c1, c0, 0	@ SCTLR
+	orr	r7, #(1 << 5)		@ CP15 barriers enabled
+	bic	r7, #(3 << 7)		@ Clear SED/ITD for v8 (RES0 for v7)
+	bic	r7, #(3 << 19)		@ WXN and UWXN disabled
+	mcr	p15, 0, r7, c1, c0, 0	@ SCTLR
+
+	mrc	p15, 0, r7, c0, c0, 0	@ MIDR
+	mcr	p15, 4, r7, c0, c0, 0	@ VPIDR
+
+	mrc	p15, 0, r7, c0, c0, 5	@ MPIDR
+	mcr	p15, 4, r7, c0, c0, 5	@ VMPIDR
+
 #if !defined(ZIMAGE) && defined(CONFIG_ARM_ARCH_TIMER)
 #if !defined(ZIMAGE) && defined(CONFIG_ARM_ARCH_TIMER)
 	@ make CNTP_* and CNTPCT accessible from PL1
 	@ make CNTP_* and CNTPCT accessible from PL1
 	mrc	p15, 0, r7, c0, c1, 1	@ ID_PFR1
 	mrc	p15, 0, r7, c0, c1, 1	@ ID_PFR1

+ 0 - 2
arch/arm/kvm/arm.c

@@ -158,8 +158,6 @@ void kvm_arch_destroy_vm(struct kvm *kvm)
 {
 {
 	int i;
 	int i;
 
 
-	kvm_free_stage2_pgd(kvm);
-
 	for (i = 0; i < KVM_MAX_VCPUS; ++i) {
 	for (i = 0; i < KVM_MAX_VCPUS; ++i) {
 		if (kvm->vcpus[i]) {
 		if (kvm->vcpus[i]) {
 			kvm_arch_vcpu_free(kvm->vcpus[i]);
 			kvm_arch_vcpu_free(kvm->vcpus[i]);

+ 3 - 1
arch/arm/kvm/mmu.c

@@ -1714,7 +1714,8 @@ int kvm_mmu_init(void)
 		 kern_hyp_va(PAGE_OFFSET), kern_hyp_va(~0UL));
 		 kern_hyp_va(PAGE_OFFSET), kern_hyp_va(~0UL));
 
 
 	if (hyp_idmap_start >= kern_hyp_va(PAGE_OFFSET) &&
 	if (hyp_idmap_start >= kern_hyp_va(PAGE_OFFSET) &&
-	    hyp_idmap_start <  kern_hyp_va(~0UL)) {
+	    hyp_idmap_start <  kern_hyp_va(~0UL) &&
+	    hyp_idmap_start != (unsigned long)__hyp_idmap_text_start) {
 		/*
 		/*
 		 * The idmap page is intersecting with the VA space,
 		 * The idmap page is intersecting with the VA space,
 		 * it is not safe to continue further.
 		 * it is not safe to continue further.
@@ -1893,6 +1894,7 @@ void kvm_arch_memslots_updated(struct kvm *kvm, struct kvm_memslots *slots)
 
 
 void kvm_arch_flush_shadow_all(struct kvm *kvm)
 void kvm_arch_flush_shadow_all(struct kvm *kvm)
 {
 {
+	kvm_free_stage2_pgd(kvm);
 }
 }
 
 
 void kvm_arch_flush_shadow_memslot(struct kvm *kvm,
 void kvm_arch_flush_shadow_memslot(struct kvm *kvm,

+ 6 - 0
arch/arm/mach-exynos/suspend.c

@@ -255,6 +255,12 @@ static int __init exynos_pmu_irq_init(struct device_node *node,
 		return -ENOMEM;
 		return -ENOMEM;
 	}
 	}
 
 
+	/*
+	 * Clear the OF_POPULATED flag set in of_irq_init so that
+	 * later the Exynos PMU platform device won't be skipped.
+	 */
+	of_node_clear_flag(node, OF_POPULATED);
+
 	return 0;
 	return 0;
 }
 }
 
 

+ 1 - 0
arch/arm/mach-imx/mach-imx6ul.c

@@ -64,6 +64,7 @@ static void __init imx6ul_init_machine(void)
 	if (parent == NULL)
 	if (parent == NULL)
 		pr_warn("failed to initialize soc device\n");
 		pr_warn("failed to initialize soc device\n");
 
 
+	of_platform_default_populate(NULL, NULL, parent);
 	imx6ul_enet_init();
 	imx6ul_enet_init();
 	imx_anatop_init();
 	imx_anatop_init();
 	imx6ul_pm_init();
 	imx6ul_pm_init();

+ 2 - 2
arch/arm/mach-imx/pm-imx6.c

@@ -295,7 +295,7 @@ int imx6_set_lpm(enum mxc_cpu_pwr_mode mode)
 		val &= ~BM_CLPCR_SBYOS;
 		val &= ~BM_CLPCR_SBYOS;
 		if (cpu_is_imx6sl())
 		if (cpu_is_imx6sl())
 			val |= BM_CLPCR_BYPASS_PMIC_READY;
 			val |= BM_CLPCR_BYPASS_PMIC_READY;
-		if (cpu_is_imx6sl() || cpu_is_imx6sx())
+		if (cpu_is_imx6sl() || cpu_is_imx6sx() || cpu_is_imx6ul())
 			val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;
 			val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;
 		else
 		else
 			val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
 			val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
@@ -310,7 +310,7 @@ int imx6_set_lpm(enum mxc_cpu_pwr_mode mode)
 		val |= 0x3 << BP_CLPCR_STBY_COUNT;
 		val |= 0x3 << BP_CLPCR_STBY_COUNT;
 		val |= BM_CLPCR_VSTBY;
 		val |= BM_CLPCR_VSTBY;
 		val |= BM_CLPCR_SBYOS;
 		val |= BM_CLPCR_SBYOS;
-		if (cpu_is_imx6sl())
+		if (cpu_is_imx6sl() || cpu_is_imx6sx())
 			val |= BM_CLPCR_BYPASS_PMIC_READY;
 			val |= BM_CLPCR_BYPASS_PMIC_READY;
 		if (cpu_is_imx6sl() || cpu_is_imx6sx() || cpu_is_imx6ul())
 		if (cpu_is_imx6sl() || cpu_is_imx6sx() || cpu_is_imx6ul())
 			val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;
 			val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;

+ 0 - 6
arch/arm/mach-omap2/cm33xx.c

@@ -220,9 +220,6 @@ static int am33xx_cm_wait_module_ready(u8 part, s16 inst, u16 clkctrl_offs,
 {
 {
 	int i = 0;
 	int i = 0;
 
 
-	if (!clkctrl_offs)
-		return 0;
-
 	omap_test_timeout(_is_module_ready(inst, clkctrl_offs),
 	omap_test_timeout(_is_module_ready(inst, clkctrl_offs),
 			  MAX_MODULE_READY_TIME, i);
 			  MAX_MODULE_READY_TIME, i);
 
 
@@ -246,9 +243,6 @@ static int am33xx_cm_wait_module_idle(u8 part, s16 inst, u16 clkctrl_offs,
 {
 {
 	int i = 0;
 	int i = 0;
 
 
-	if (!clkctrl_offs)
-		return 0;
-
 	omap_test_timeout((_clkctrl_idlest(inst, clkctrl_offs) ==
 	omap_test_timeout((_clkctrl_idlest(inst, clkctrl_offs) ==
 				CLKCTRL_IDLEST_DISABLED),
 				CLKCTRL_IDLEST_DISABLED),
 				MAX_MODULE_READY_TIME, i);
 				MAX_MODULE_READY_TIME, i);

+ 0 - 6
arch/arm/mach-omap2/cminst44xx.c

@@ -278,9 +278,6 @@ static int omap4_cminst_wait_module_ready(u8 part, s16 inst, u16 clkctrl_offs,
 {
 {
 	int i = 0;
 	int i = 0;
 
 
-	if (!clkctrl_offs)
-		return 0;
-
 	omap_test_timeout(_is_module_ready(part, inst, clkctrl_offs),
 	omap_test_timeout(_is_module_ready(part, inst, clkctrl_offs),
 			  MAX_MODULE_READY_TIME, i);
 			  MAX_MODULE_READY_TIME, i);
 
 
@@ -304,9 +301,6 @@ static int omap4_cminst_wait_module_idle(u8 part, s16 inst, u16 clkctrl_offs,
 {
 {
 	int i = 0;
 	int i = 0;
 
 
-	if (!clkctrl_offs)
-		return 0;
-
 	omap_test_timeout((_clkctrl_idlest(part, inst, clkctrl_offs) ==
 	omap_test_timeout((_clkctrl_idlest(part, inst, clkctrl_offs) ==
 			   CLKCTRL_IDLEST_DISABLED),
 			   CLKCTRL_IDLEST_DISABLED),
 			  MAX_MODULE_DISABLE_TIME, i);
 			  MAX_MODULE_DISABLE_TIME, i);

+ 8 - 0
arch/arm/mach-omap2/omap_hwmod.c

@@ -1053,6 +1053,10 @@ static int _omap4_wait_target_disable(struct omap_hwmod *oh)
 	if (oh->flags & HWMOD_NO_IDLEST)
 	if (oh->flags & HWMOD_NO_IDLEST)
 		return 0;
 		return 0;
 
 
+	if (!oh->prcm.omap4.clkctrl_offs &&
+	    !(oh->prcm.omap4.flags & HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET))
+		return 0;
+
 	return omap_cm_wait_module_idle(oh->clkdm->prcm_partition,
 	return omap_cm_wait_module_idle(oh->clkdm->prcm_partition,
 					oh->clkdm->cm_inst,
 					oh->clkdm->cm_inst,
 					oh->prcm.omap4.clkctrl_offs, 0);
 					oh->prcm.omap4.clkctrl_offs, 0);
@@ -2971,6 +2975,10 @@ static int _omap4_wait_target_ready(struct omap_hwmod *oh)
 	if (!_find_mpu_rt_port(oh))
 	if (!_find_mpu_rt_port(oh))
 		return 0;
 		return 0;
 
 
+	if (!oh->prcm.omap4.clkctrl_offs &&
+	    !(oh->prcm.omap4.flags & HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET))
+		return 0;
+
 	/* XXX check module SIDLEMODE, hardreset status */
 	/* XXX check module SIDLEMODE, hardreset status */
 
 
 	return omap_cm_wait_module_ready(oh->clkdm->prcm_partition,
 	return omap_cm_wait_module_ready(oh->clkdm->prcm_partition,

+ 4 - 0
arch/arm/mach-omap2/omap_hwmod.h

@@ -443,8 +443,12 @@ struct omap_hwmod_omap2_prcm {
  * HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT: Some IP blocks don't have a PRCM
  * HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT: Some IP blocks don't have a PRCM
  *     module-level context loss register associated with them; this
  *     module-level context loss register associated with them; this
  *     flag bit should be set in those cases
  *     flag bit should be set in those cases
+ * HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET: Some IP blocks have a valid CLKCTRL
+ *	offset of zero; this flag bit should be set in those cases to
+ *	distinguish from hwmods that have no clkctrl offset.
  */
  */
 #define HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT		(1 << 0)
 #define HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT		(1 << 0)
+#define HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET		(1 << 1)
 
 
 /**
 /**
  * struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data
  * struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data

+ 2 - 0
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c

@@ -29,6 +29,7 @@
 #define CLKCTRL(oh, clkctrl) ((oh).prcm.omap4.clkctrl_offs = (clkctrl))
 #define CLKCTRL(oh, clkctrl) ((oh).prcm.omap4.clkctrl_offs = (clkctrl))
 #define RSTCTRL(oh, rstctrl) ((oh).prcm.omap4.rstctrl_offs = (rstctrl))
 #define RSTCTRL(oh, rstctrl) ((oh).prcm.omap4.rstctrl_offs = (rstctrl))
 #define RSTST(oh, rstst) ((oh).prcm.omap4.rstst_offs = (rstst))
 #define RSTST(oh, rstst) ((oh).prcm.omap4.rstst_offs = (rstst))
+#define PRCM_FLAGS(oh, flag) ((oh).prcm.omap4.flags = (flag))
 
 
 /*
 /*
  * 'l3' class
  * 'l3' class
@@ -1296,6 +1297,7 @@ static void omap_hwmod_am33xx_clkctrl(void)
 	CLKCTRL(am33xx_i2c1_hwmod, AM33XX_CM_WKUP_I2C0_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_i2c1_hwmod, AM33XX_CM_WKUP_I2C0_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_wd_timer1_hwmod, AM33XX_CM_WKUP_WDT1_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_wd_timer1_hwmod, AM33XX_CM_WKUP_WDT1_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_rtc_hwmod, AM33XX_CM_RTC_RTC_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_rtc_hwmod, AM33XX_CM_RTC_RTC_CLKCTRL_OFFSET);
+	PRCM_FLAGS(am33xx_rtc_hwmod, HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_mmc2_hwmod, AM33XX_CM_PER_MMC2_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_mmc2_hwmod, AM33XX_CM_PER_MMC2_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_gpmc_hwmod, AM33XX_CM_PER_GPMC_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_gpmc_hwmod, AM33XX_CM_PER_GPMC_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_l4_ls_hwmod, AM33XX_CM_PER_L4LS_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_l4_ls_hwmod, AM33XX_CM_PER_L4LS_CLKCTRL_OFFSET);

+ 12 - 0
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c

@@ -722,8 +722,20 @@ static struct omap_hwmod omap3xxx_dss_dispc_hwmod = {
  * display serial interface controller
  * display serial interface controller
  */
  */
 
 
+static struct omap_hwmod_class_sysconfig omap3xxx_dsi_sysc = {
+	.rev_offs	= 0x0000,
+	.sysc_offs	= 0x0010,
+	.syss_offs	= 0x0014,
+	.sysc_flags	= (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
+			   SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
+			   SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+	.sysc_fields	= &omap_hwmod_sysc_type1,
+};
+
 static struct omap_hwmod_class omap3xxx_dsi_hwmod_class = {
 static struct omap_hwmod_class omap3xxx_dsi_hwmod_class = {
 	.name = "dsi",
 	.name = "dsi",
+	.sysc	= &omap3xxx_dsi_sysc,
 };
 };
 
 
 static struct omap_hwmod_irq_info omap3xxx_dsi1_irqs[] = {
 static struct omap_hwmod_irq_info omap3xxx_dsi1_irqs[] = {

+ 14 - 0
arch/arm/mach-pxa/lubbock.c

@@ -137,6 +137,18 @@ static struct pxa2xx_udc_mach_info udc_info __initdata = {
 	// no D+ pullup; lubbock can't connect/disconnect in software
 	// no D+ pullup; lubbock can't connect/disconnect in software
 };
 };
 
 
+static void lubbock_init_pcmcia(void)
+{
+	struct clk *clk;
+
+	/* Add an alias for the SA1111 PCMCIA clock */
+	clk = clk_get_sys("pxa2xx-pcmcia", NULL);
+	if (!IS_ERR(clk)) {
+		clkdev_create(clk, NULL, "1800");
+		clk_put(clk);
+	}
+}
+
 static struct resource sa1111_resources[] = {
 static struct resource sa1111_resources[] = {
 	[0] = {
 	[0] = {
 		.start	= 0x10000000,
 		.start	= 0x10000000,
@@ -467,6 +479,8 @@ static void __init lubbock_init(void)
 	pxa_set_btuart_info(NULL);
 	pxa_set_btuart_info(NULL);
 	pxa_set_stuart_info(NULL);
 	pxa_set_stuart_info(NULL);
 
 
+	lubbock_init_pcmcia();
+
 	clk_add_alias("SA1111_CLK", NULL, "GPIO11_CLK", NULL);
 	clk_add_alias("SA1111_CLK", NULL, "GPIO11_CLK", NULL);
 	pxa_set_udc_info(&udc_info);
 	pxa_set_udc_info(&udc_info);
 	pxa_set_fb_info(NULL, &sharp_lm8v31);
 	pxa_set_fb_info(NULL, &sharp_lm8v31);

+ 3 - 2
arch/arm/mach-sa1100/clock.c

@@ -125,6 +125,8 @@ static unsigned long clk_36864_get_rate(struct clk *clk)
 }
 }
 
 
 static struct clkops clk_36864_ops = {
 static struct clkops clk_36864_ops = {
+	.enable		= clk_cpu_enable,
+	.disable	= clk_cpu_disable,
 	.get_rate	= clk_36864_get_rate,
 	.get_rate	= clk_36864_get_rate,
 };
 };
 
 
@@ -140,9 +142,8 @@ static struct clk_lookup sa11xx_clkregs[] = {
 	CLKDEV_INIT(NULL, "OSTIMER0", &clk_36864),
 	CLKDEV_INIT(NULL, "OSTIMER0", &clk_36864),
 };
 };
 
 
-static int __init sa11xx_clk_init(void)
+int __init sa11xx_clk_init(void)
 {
 {
 	clkdev_add_table(sa11xx_clkregs, ARRAY_SIZE(sa11xx_clkregs));
 	clkdev_add_table(sa11xx_clkregs, ARRAY_SIZE(sa11xx_clkregs));
 	return 0;
 	return 0;
 }
 }
-core_initcall(sa11xx_clk_init);

+ 4 - 0
arch/arm/mach-sa1100/generic.c

@@ -34,6 +34,7 @@
 
 
 #include <mach/hardware.h>
 #include <mach/hardware.h>
 #include <mach/irqs.h>
 #include <mach/irqs.h>
+#include <mach/reset.h>
 
 
 #include "generic.h"
 #include "generic.h"
 #include <clocksource/pxa.h>
 #include <clocksource/pxa.h>
@@ -95,6 +96,8 @@ static void sa1100_power_off(void)
 
 
 void sa11x0_restart(enum reboot_mode mode, const char *cmd)
 void sa11x0_restart(enum reboot_mode mode, const char *cmd)
 {
 {
+	clear_reset_status(RESET_STATUS_ALL);
+
 	if (mode == REBOOT_SOFT) {
 	if (mode == REBOOT_SOFT) {
 		/* Jump into ROM at address 0 */
 		/* Jump into ROM at address 0 */
 		soft_restart(0);
 		soft_restart(0);
@@ -388,6 +391,7 @@ void __init sa1100_init_irq(void)
 	sa11x0_init_irq_nodt(IRQ_GPIO0_SC, irq_resource.start);
 	sa11x0_init_irq_nodt(IRQ_GPIO0_SC, irq_resource.start);
 
 
 	sa1100_init_gpio();
 	sa1100_init_gpio();
+	sa11xx_clk_init();
 }
 }
 
 
 /*
 /*

+ 2 - 0
arch/arm/mach-sa1100/generic.h

@@ -44,3 +44,5 @@ int sa11x0_pm_init(void);
 #else
 #else
 static inline int sa11x0_pm_init(void) { return 0; }
 static inline int sa11x0_pm_init(void) { return 0; }
 #endif
 #endif
+
+int sa11xx_clk_init(void);

+ 26 - 36
arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c

@@ -41,39 +41,26 @@
 
 
 #define REGULATOR_IRQ_MASK	BIT(2)	/* IRQ2, active low */
 #define REGULATOR_IRQ_MASK	BIT(2)	/* IRQ2, active low */
 
 
-static void __iomem *irqc;
-
-static const u8 da9063_mask_regs[] = {
-	DA9063_REG_IRQ_MASK_A,
-	DA9063_REG_IRQ_MASK_B,
-	DA9063_REG_IRQ_MASK_C,
-	DA9063_REG_IRQ_MASK_D,
-};
-
-/* DA9210 System Control and Event Registers */
+/* start of DA9210 System Control and Event Registers */
 #define DA9210_REG_MASK_A		0x54
 #define DA9210_REG_MASK_A		0x54
-#define DA9210_REG_MASK_B		0x55
-
-static const u8 da9210_mask_regs[] = {
-	DA9210_REG_MASK_A,
-	DA9210_REG_MASK_B,
-};
-
-static void da9xxx_mask_irqs(struct i2c_client *client, const u8 regs[],
-			     unsigned int nregs)
-{
-	unsigned int i;
 
 
-	dev_info(&client->dev, "Masking %s interrupt sources\n", client->name);
+static void __iomem *irqc;
 
 
-	for (i = 0; i < nregs; i++) {
-		int error = i2c_smbus_write_byte_data(client, regs[i], ~0);
-		if (error) {
-			dev_err(&client->dev, "i2c error %d\n", error);
-			return;
-		}
-	}
-}
+/* first byte sets the memory pointer, following are consecutive reg values */
+static u8 da9063_irq_clr[] = { DA9063_REG_IRQ_MASK_A, 0xff, 0xff, 0xff, 0xff };
+static u8 da9210_irq_clr[] = { DA9210_REG_MASK_A, 0xff, 0xff };
+
+static struct i2c_msg da9xxx_msgs[2] = {
+	{
+		.addr = 0x58,
+		.len = ARRAY_SIZE(da9063_irq_clr),
+		.buf = da9063_irq_clr,
+	}, {
+		.addr = 0x68,
+		.len = ARRAY_SIZE(da9210_irq_clr),
+		.buf = da9210_irq_clr,
+	},
+};
 
 
 static int regulator_quirk_notify(struct notifier_block *nb,
 static int regulator_quirk_notify(struct notifier_block *nb,
 				  unsigned long action, void *data)
 				  unsigned long action, void *data)
@@ -93,12 +80,15 @@ static int regulator_quirk_notify(struct notifier_block *nb,
 	client = to_i2c_client(dev);
 	client = to_i2c_client(dev);
 	dev_dbg(dev, "Detected %s\n", client->name);
 	dev_dbg(dev, "Detected %s\n", client->name);
 
 
-	if ((client->addr == 0x58 && !strcmp(client->name, "da9063")))
-		da9xxx_mask_irqs(client, da9063_mask_regs,
-				 ARRAY_SIZE(da9063_mask_regs));
-	else if (client->addr == 0x68 && !strcmp(client->name, "da9210"))
-		da9xxx_mask_irqs(client, da9210_mask_regs,
-				 ARRAY_SIZE(da9210_mask_regs));
+	if ((client->addr == 0x58 && !strcmp(client->name, "da9063")) ||
+	    (client->addr == 0x68 && !strcmp(client->name, "da9210"))) {
+		int ret;
+
+		dev_info(&client->dev, "clearing da9063/da9210 interrupts\n");
+		ret = i2c_transfer(client->adapter, da9xxx_msgs, ARRAY_SIZE(da9xxx_msgs));
+		if (ret != ARRAY_SIZE(da9xxx_msgs))
+			dev_err(&client->dev, "i2c error %d\n", ret);
+	}
 
 
 	mon = ioread32(irqc + IRQC_MONITOR);
 	mon = ioread32(irqc + IRQC_MONITOR);
 	if (mon & REGULATOR_IRQ_MASK)
 	if (mon & REGULATOR_IRQ_MASK)

+ 1 - 1
arch/arm/mm/mmu.c

@@ -137,7 +137,7 @@ void __init init_default_cache_policy(unsigned long pmd)
 
 
 	initial_pmd_value = pmd;
 	initial_pmd_value = pmd;
 
 
-	pmd &= PMD_SECT_TEX(1) | PMD_SECT_BUFFERABLE | PMD_SECT_CACHEABLE;
+	pmd &= PMD_SECT_CACHE_MASK;
 
 
 	for (i = 0; i < ARRAY_SIZE(cache_policies); i++)
 	for (i = 0; i < ARRAY_SIZE(cache_policies); i++)
 		if (cache_policies[i].pmd == pmd) {
 		if (cache_policies[i].pmd == pmd) {

+ 1 - 0
arch/arm/mm/proc-v7.S

@@ -16,6 +16,7 @@
 #include <asm/hwcap.h>
 #include <asm/hwcap.h>
 #include <asm/pgtable-hwdef.h>
 #include <asm/pgtable-hwdef.h>
 #include <asm/pgtable.h>
 #include <asm/pgtable.h>
+#include <asm/memory.h>
 
 
 #include "proc-macros.S"
 #include "proc-macros.S"
 
 

+ 3 - 4
arch/arm/xen/enlighten.c

@@ -170,9 +170,6 @@ static int xen_starting_cpu(unsigned int cpu)
 	pr_info("Xen: initializing cpu%d\n", cpu);
 	pr_info("Xen: initializing cpu%d\n", cpu);
 	vcpup = per_cpu_ptr(xen_vcpu_info, cpu);
 	vcpup = per_cpu_ptr(xen_vcpu_info, cpu);
 
 
-	/* Direct vCPU id mapping for ARM guests. */
-	per_cpu(xen_vcpu_id, cpu) = cpu;
-
 	info.mfn = virt_to_gfn(vcpup);
 	info.mfn = virt_to_gfn(vcpup);
 	info.offset = xen_offset_in_page(vcpup);
 	info.offset = xen_offset_in_page(vcpup);
 
 
@@ -330,6 +327,7 @@ static int __init xen_guest_init(void)
 {
 {
 	struct xen_add_to_physmap xatp;
 	struct xen_add_to_physmap xatp;
 	struct shared_info *shared_info_page = NULL;
 	struct shared_info *shared_info_page = NULL;
+	int cpu;
 
 
 	if (!xen_domain())
 	if (!xen_domain())
 		return 0;
 		return 0;
@@ -380,7 +378,8 @@ static int __init xen_guest_init(void)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
 	/* Direct vCPU id mapping for ARM guests. */
 	/* Direct vCPU id mapping for ARM guests. */
-	per_cpu(xen_vcpu_id, 0) = 0;
+	for_each_possible_cpu(cpu)
+		per_cpu(xen_vcpu_id, cpu) = cpu;
 
 
 	xen_auto_xlat_grant_frames.count = gnttab_max_grant_frames();
 	xen_auto_xlat_grant_frames.count = gnttab_max_grant_frames();
 	if (xen_xlate_map_ballooned_pages(&xen_auto_xlat_grant_frames.pfn,
 	if (xen_xlate_map_ballooned_pages(&xen_auto_xlat_grant_frames.pfn,

+ 4 - 4
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi

@@ -255,10 +255,10 @@
 		/* Local timer */
 		/* Local timer */
 		timer {
 		timer {
 			compatible = "arm,armv8-timer";
 			compatible = "arm,armv8-timer";
-			interrupts = <1 13 0xf01>,
-				     <1 14 0xf01>,
-				     <1 11 0xf01>,
-				     <1 10 0xf01>;
+			interrupts = <1 13 0xf08>,
+				     <1 14 0xf08>,
+				     <1 11 0xf08>,
+				     <1 10 0xf08>;
 		};
 		};
 
 
 		timer0: timer0@ffc03000 {
 		timer0: timer0@ffc03000 {

+ 4 - 4
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi

@@ -102,13 +102,13 @@
 	timer {
 	timer {
 		compatible = "arm,armv8-timer";
 		compatible = "arm,armv8-timer";
 		interrupts = <GIC_PPI 13
 		interrupts = <GIC_PPI 13
-			(GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_EDGE_RISING)>,
+			(GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 14
 			     <GIC_PPI 14
-			(GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_EDGE_RISING)>,
+			(GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 11
 			     <GIC_PPI 11
-			(GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_EDGE_RISING)>,
+			(GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 10
 			     <GIC_PPI 10
-			(GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_EDGE_RISING)>;
+			(GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>;
 	};
 	};
 
 
 	xtal: xtal-clk {
 	xtal: xtal-clk {

+ 4 - 4
arch/arm64/boot/dts/apm/apm-storm.dtsi

@@ -110,10 +110,10 @@
 
 
 	timer {
 	timer {
 		compatible = "arm,armv8-timer";
 		compatible = "arm,armv8-timer";
-		interrupts = <1 0 0xff01>,	/* Secure Phys IRQ */
-			     <1 13 0xff01>,	/* Non-secure Phys IRQ */
-			     <1 14 0xff01>,	/* Virt IRQ */
-			     <1 15 0xff01>;	/* Hyp IRQ */
+		interrupts = <1 0 0xff08>,	/* Secure Phys IRQ */
+			     <1 13 0xff08>,	/* Non-secure Phys IRQ */
+			     <1 14 0xff08>,	/* Virt IRQ */
+			     <1 15 0xff08>;	/* Hyp IRQ */
 		clock-frequency = <50000000>;
 		clock-frequency = <50000000>;
 	};
 	};
 
 

+ 1 - 0
arch/arm64/boot/dts/broadcom/bcm2835-rpi.dtsi

@@ -0,0 +1 @@
+../../../../arm/boot/dts/bcm2835-rpi.dtsi

+ 2 - 2
arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts

@@ -1,7 +1,7 @@
 /dts-v1/;
 /dts-v1/;
 #include "bcm2837.dtsi"
 #include "bcm2837.dtsi"
-#include "../../../../arm/boot/dts/bcm2835-rpi.dtsi"
-#include "../../../../arm/boot/dts/bcm283x-rpi-smsc9514.dtsi"
+#include "bcm2835-rpi.dtsi"
+#include "bcm283x-rpi-smsc9514.dtsi"
 
 
 / {
 / {
 	compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
 	compatible = "raspberrypi,3-model-b", "brcm,bcm2837";

+ 1 - 1
arch/arm64/boot/dts/broadcom/bcm2837.dtsi

@@ -1,4 +1,4 @@
-#include "../../../../arm/boot/dts/bcm283x.dtsi"
+#include "bcm283x.dtsi"
 
 
 / {
 / {
 	compatible = "brcm,bcm2836";
 	compatible = "brcm,bcm2836";

+ 1 - 0
arch/arm64/boot/dts/broadcom/bcm283x-rpi-smsc9514.dtsi

@@ -0,0 +1 @@
+../../../../arm/boot/dts/bcm283x-rpi-smsc9514.dtsi

+ 1 - 0
arch/arm64/boot/dts/broadcom/bcm283x.dtsi

@@ -0,0 +1 @@
+../../../../arm/boot/dts/bcm283x.dtsi

+ 4 - 4
arch/arm64/boot/dts/broadcom/ns2.dtsi

@@ -88,13 +88,13 @@
 	timer {
 	timer {
 		compatible = "arm,armv8-timer";
 		compatible = "arm,armv8-timer";
 		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_RAW(0xff) |
 		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_RAW(0xff) |
-			      IRQ_TYPE_EDGE_RISING)>,
+			      IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 14 (GIC_CPU_MASK_RAW(0xff) |
 			     <GIC_PPI 14 (GIC_CPU_MASK_RAW(0xff) |
-			      IRQ_TYPE_EDGE_RISING)>,
+			      IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 11 (GIC_CPU_MASK_RAW(0xff) |
 			     <GIC_PPI 11 (GIC_CPU_MASK_RAW(0xff) |
-			      IRQ_TYPE_EDGE_RISING)>,
+			      IRQ_TYPE_LEVEL_LOW)>,
 			     <GIC_PPI 10 (GIC_CPU_MASK_RAW(0xff) |
 			     <GIC_PPI 10 (GIC_CPU_MASK_RAW(0xff) |
-			      IRQ_TYPE_EDGE_RISING)>;
+			      IRQ_TYPE_LEVEL_LOW)>;
 	};
 	};
 
 
 	pmu {
 	pmu {

+ 4 - 4
arch/arm64/boot/dts/cavium/thunder-88xx.dtsi

@@ -354,10 +354,10 @@
 
 
 	timer {
 	timer {
 		compatible = "arm,armv8-timer";
 		compatible = "arm,armv8-timer";
-		interrupts = <1 13 0xff01>,
-		             <1 14 0xff01>,
-		             <1 11 0xff01>,
-		             <1 10 0xff01>;
+		interrupts = <1 13 4>,
+		             <1 14 4>,
+		             <1 11 4>,
+		             <1 10 4>;
 	};
 	};
 
 
 	pmu {
 	pmu {

+ 4 - 4
arch/arm64/boot/dts/exynos/exynos7.dtsi

@@ -473,10 +473,10 @@
 
 
 		timer {
 		timer {
 			compatible = "arm,armv8-timer";
 			compatible = "arm,armv8-timer";
-			interrupts = <1 13 0xff01>,
-				     <1 14 0xff01>,
-				     <1 11 0xff01>,
-				     <1 10 0xff01>;
+			interrupts = <1 13 0xff08>,
+				     <1 14 0xff08>,
+				     <1 11 0xff08>,
+				     <1 10 0xff08>;
 		};
 		};
 
 
 		pmu_system_controller: system-controller@105c0000 {
 		pmu_system_controller: system-controller@105c0000 {

+ 4 - 4
arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi

@@ -119,10 +119,10 @@
 
 
 	timer {
 	timer {
 		compatible = "arm,armv8-timer";
 		compatible = "arm,armv8-timer";
-		interrupts = <1 13 0x1>, /* Physical Secure PPI */
-			     <1 14 0x1>, /* Physical Non-Secure PPI */
-			     <1 11 0x1>, /* Virtual PPI */
-			     <1 10 0x1>; /* Hypervisor PPI */
+		interrupts = <1 13 0xf08>, /* Physical Secure PPI */
+			     <1 14 0xf08>, /* Physical Non-Secure PPI */
+			     <1 11 0xf08>, /* Virtual PPI */
+			     <1 10 0xf08>; /* Hypervisor PPI */
 	};
 	};
 
 
 	pmu {
 	pmu {

+ 4 - 4
arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi

@@ -191,10 +191,10 @@
 
 
 	timer {
 	timer {
 		compatible = "arm,armv8-timer";
 		compatible = "arm,armv8-timer";
-		interrupts = <1 13 0x8>, /* Physical Secure PPI, active-low */
-			     <1 14 0x8>, /* Physical Non-Secure PPI, active-low */
-			     <1 11 0x8>, /* Virtual PPI, active-low */
-			     <1 10 0x8>; /* Hypervisor PPI, active-low */
+		interrupts = <1 13 4>, /* Physical Secure PPI, active-low */
+			     <1 14 4>, /* Physical Non-Secure PPI, active-low */
+			     <1 11 4>, /* Virtual PPI, active-low */
+			     <1 10 4>; /* Hypervisor PPI, active-low */
 	};
 	};
 
 
 	pmu {
 	pmu {

+ 4 - 4
arch/arm64/boot/dts/marvell/armada-ap806.dtsi

@@ -122,10 +122,10 @@
 
 
 			timer {
 			timer {
 				compatible = "arm,armv8-timer";
 				compatible = "arm,armv8-timer";
-				interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>,
-					     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>,
-					     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>,
-					     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>;
+				interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+					     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+					     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+					     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
 			};
 			};
 
 
 			odmi: odmi@300000 {
 			odmi: odmi@300000 {

+ 4 - 4
arch/arm64/boot/dts/socionext/uniphier-ph1-ld20.dtsi

@@ -129,10 +129,10 @@
 
 
 	timer {
 	timer {
 		compatible = "arm,armv8-timer";
 		compatible = "arm,armv8-timer";
-		interrupts = <1 13 0xf01>,
-			     <1 14 0xf01>,
-			     <1 11 0xf01>,
-			     <1 10 0xf01>;
+		interrupts = <1 13 4>,
+			     <1 14 4>,
+			     <1 11 4>,
+			     <1 10 4>;
 	};
 	};
 
 
 	soc {
 	soc {

+ 4 - 4
arch/arm64/boot/dts/xilinx/zynqmp.dtsi

@@ -65,10 +65,10 @@
 	timer {
 	timer {
 		compatible = "arm,armv8-timer";
 		compatible = "arm,armv8-timer";
 		interrupt-parent = <&gic>;
 		interrupt-parent = <&gic>;
-		interrupts = <1 13 0xf01>,
-			     <1 14 0xf01>,
-			     <1 11 0xf01>,
-			     <1 10 0xf01>;
+		interrupts = <1 13 0xf08>,
+			     <1 14 0xf08>,
+			     <1 11 0xf08>,
+			     <1 10 0xf08>;
 	};
 	};
 
 
 	amba_apu {
 	amba_apu {

+ 1 - 1
arch/arm64/crypto/aes-glue.c

@@ -216,7 +216,7 @@ static int ctr_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
 		err = blkcipher_walk_done(desc, &walk,
 		err = blkcipher_walk_done(desc, &walk,
 					  walk.nbytes % AES_BLOCK_SIZE);
 					  walk.nbytes % AES_BLOCK_SIZE);
 	}
 	}
-	if (nbytes) {
+	if (walk.nbytes % AES_BLOCK_SIZE) {
 		u8 *tdst = walk.dst.virt.addr + blocks * AES_BLOCK_SIZE;
 		u8 *tdst = walk.dst.virt.addr + blocks * AES_BLOCK_SIZE;
 		u8 *tsrc = walk.src.virt.addr + blocks * AES_BLOCK_SIZE;
 		u8 *tsrc = walk.src.virt.addr + blocks * AES_BLOCK_SIZE;
 		u8 __aligned(8) tail[AES_BLOCK_SIZE];
 		u8 __aligned(8) tail[AES_BLOCK_SIZE];

+ 4 - 4
arch/arm64/include/asm/percpu.h

@@ -199,19 +199,19 @@ static inline unsigned long __percpu_xchg(void *ptr, unsigned long val,
 #define _percpu_read(pcp)						\
 #define _percpu_read(pcp)						\
 ({									\
 ({									\
 	typeof(pcp) __retval;						\
 	typeof(pcp) __retval;						\
-	preempt_disable();						\
+	preempt_disable_notrace();					\
 	__retval = (typeof(pcp))__percpu_read(raw_cpu_ptr(&(pcp)), 	\
 	__retval = (typeof(pcp))__percpu_read(raw_cpu_ptr(&(pcp)), 	\
 					      sizeof(pcp));		\
 					      sizeof(pcp));		\
-	preempt_enable();						\
+	preempt_enable_notrace();					\
 	__retval;							\
 	__retval;							\
 })
 })
 
 
 #define _percpu_write(pcp, val)						\
 #define _percpu_write(pcp, val)						\
 do {									\
 do {									\
-	preempt_disable();						\
+	preempt_disable_notrace();					\
 	__percpu_write(raw_cpu_ptr(&(pcp)), (unsigned long)(val), 	\
 	__percpu_write(raw_cpu_ptr(&(pcp)), (unsigned long)(val), 	\
 				sizeof(pcp));				\
 				sizeof(pcp));				\
-	preempt_enable();						\
+	preempt_enable_notrace();					\
 } while(0)								\
 } while(0)								\
 
 
 #define _pcp_protect(operation, pcp, val)			\
 #define _pcp_protect(operation, pcp, val)			\

+ 10 - 0
arch/arm64/include/asm/spinlock.h

@@ -363,4 +363,14 @@ static inline int arch_read_trylock(arch_rwlock_t *rw)
 #define arch_read_relax(lock)	cpu_relax()
 #define arch_read_relax(lock)	cpu_relax()
 #define arch_write_relax(lock)	cpu_relax()
 #define arch_write_relax(lock)	cpu_relax()
 
 
+/*
+ * Accesses appearing in program order before a spin_lock() operation
+ * can be reordered with accesses inside the critical section, by virtue
+ * of arch_spin_lock being constructed using acquire semantics.
+ *
+ * In cases where this is problematic (e.g. try_to_wake_up), an
+ * smp_mb__before_spinlock() can restore the required ordering.
+ */
+#define smp_mb__before_spinlock()	smp_mb()
+
 #endif /* __ASM_SPINLOCK_H */
 #endif /* __ASM_SPINLOCK_H */

+ 10 - 1
arch/avr32/include/asm/uaccess.h

@@ -74,7 +74,7 @@ extern __kernel_size_t __copy_user(void *to, const void *from,
 
 
 extern __kernel_size_t copy_to_user(void __user *to, const void *from,
 extern __kernel_size_t copy_to_user(void __user *to, const void *from,
 				    __kernel_size_t n);
 				    __kernel_size_t n);
-extern __kernel_size_t copy_from_user(void *to, const void __user *from,
+extern __kernel_size_t ___copy_from_user(void *to, const void __user *from,
 				      __kernel_size_t n);
 				      __kernel_size_t n);
 
 
 static inline __kernel_size_t __copy_to_user(void __user *to, const void *from,
 static inline __kernel_size_t __copy_to_user(void __user *to, const void *from,
@@ -88,6 +88,15 @@ static inline __kernel_size_t __copy_from_user(void *to,
 {
 {
 	return __copy_user(to, (const void __force *)from, n);
 	return __copy_user(to, (const void __force *)from, n);
 }
 }
+static inline __kernel_size_t copy_from_user(void *to,
+					       const void __user *from,
+					       __kernel_size_t n)
+{
+	size_t res = ___copy_from_user(to, from, n);
+	if (unlikely(res))
+		memset(to + (n - res), 0, res);
+	return res;
+}
 
 
 #define __copy_to_user_inatomic __copy_to_user
 #define __copy_to_user_inatomic __copy_to_user
 #define __copy_from_user_inatomic __copy_from_user
 #define __copy_from_user_inatomic __copy_from_user

+ 1 - 1
arch/avr32/kernel/avr32_ksyms.c

@@ -36,7 +36,7 @@ EXPORT_SYMBOL(copy_page);
 /*
 /*
  * Userspace access stuff.
  * Userspace access stuff.
  */
  */
-EXPORT_SYMBOL(copy_from_user);
+EXPORT_SYMBOL(___copy_from_user);
 EXPORT_SYMBOL(copy_to_user);
 EXPORT_SYMBOL(copy_to_user);
 EXPORT_SYMBOL(__copy_user);
 EXPORT_SYMBOL(__copy_user);
 EXPORT_SYMBOL(strncpy_from_user);
 EXPORT_SYMBOL(strncpy_from_user);

+ 4 - 4
arch/avr32/lib/copy_user.S

@@ -23,13 +23,13 @@
 	 */
 	 */
 	.text
 	.text
 	.align	1
 	.align	1
-	.global	copy_from_user
-	.type	copy_from_user, @function
-copy_from_user:
+	.global	___copy_from_user
+	.type	___copy_from_user, @function
+___copy_from_user:
 	branch_if_kernel r8, __copy_user
 	branch_if_kernel r8, __copy_user
 	ret_if_privileged r8, r11, r10, r10
 	ret_if_privileged r8, r11, r10, r10
 	rjmp	__copy_user
 	rjmp	__copy_user
-	.size	copy_from_user, . - copy_from_user
+	.size	___copy_from_user, . - ___copy_from_user
 
 
 	.global	copy_to_user
 	.global	copy_to_user
 	.type	copy_to_user, @function
 	.type	copy_to_user, @function

+ 5 - 4
arch/blackfin/include/asm/uaccess.h

@@ -171,11 +171,12 @@ static inline int bad_user_access_length(void)
 static inline unsigned long __must_check
 static inline unsigned long __must_check
 copy_from_user(void *to, const void __user *from, unsigned long n)
 copy_from_user(void *to, const void __user *from, unsigned long n)
 {
 {
-	if (access_ok(VERIFY_READ, from, n))
+	if (likely(access_ok(VERIFY_READ, from, n))) {
 		memcpy(to, (const void __force *)from, n);
 		memcpy(to, (const void __force *)from, n);
-	else
-		return n;
-	return 0;
+		return 0;
+	}
+	memset(to, 0, n);
+	return n;
 }
 }
 
 
 static inline unsigned long __must_check
 static inline unsigned long __must_check

+ 32 - 39
arch/cris/include/asm/uaccess.h

@@ -194,30 +194,6 @@ extern unsigned long __copy_user(void __user *to, const void *from, unsigned lon
 extern unsigned long __copy_user_zeroing(void *to, const void __user *from, unsigned long n);
 extern unsigned long __copy_user_zeroing(void *to, const void __user *from, unsigned long n);
 extern unsigned long __do_clear_user(void __user *to, unsigned long n);
 extern unsigned long __do_clear_user(void __user *to, unsigned long n);
 
 
-static inline unsigned long
-__generic_copy_to_user(void __user *to, const void *from, unsigned long n)
-{
-	if (access_ok(VERIFY_WRITE, to, n))
-		return __copy_user(to, from, n);
-	return n;
-}
-
-static inline unsigned long
-__generic_copy_from_user(void *to, const void __user *from, unsigned long n)
-{
-	if (access_ok(VERIFY_READ, from, n))
-		return __copy_user_zeroing(to, from, n);
-	return n;
-}
-
-static inline unsigned long
-__generic_clear_user(void __user *to, unsigned long n)
-{
-	if (access_ok(VERIFY_WRITE, to, n))
-		return __do_clear_user(to, n);
-	return n;
-}
-
 static inline long
 static inline long
 __strncpy_from_user(char *dst, const char __user *src, long count)
 __strncpy_from_user(char *dst, const char __user *src, long count)
 {
 {
@@ -282,7 +258,7 @@ __constant_copy_from_user(void *to, const void __user *from, unsigned long n)
 	else if (n == 24)
 	else if (n == 24)
 		__asm_copy_from_user_24(to, from, ret);
 		__asm_copy_from_user_24(to, from, ret);
 	else
 	else
-		ret = __generic_copy_from_user(to, from, n);
+		ret = __copy_user_zeroing(to, from, n);
 
 
 	return ret;
 	return ret;
 }
 }
@@ -333,7 +309,7 @@ __constant_copy_to_user(void __user *to, const void *from, unsigned long n)
 	else if (n == 24)
 	else if (n == 24)
 		__asm_copy_to_user_24(to, from, ret);
 		__asm_copy_to_user_24(to, from, ret);
 	else
 	else
-		ret = __generic_copy_to_user(to, from, n);
+		ret = __copy_user(to, from, n);
 
 
 	return ret;
 	return ret;
 }
 }
@@ -366,26 +342,43 @@ __constant_clear_user(void __user *to, unsigned long n)
 	else if (n == 24)
 	else if (n == 24)
 		__asm_clear_24(to, ret);
 		__asm_clear_24(to, ret);
 	else
 	else
-		ret = __generic_clear_user(to, n);
+		ret = __do_clear_user(to, n);
 
 
 	return ret;
 	return ret;
 }
 }
 
 
 
 
-#define clear_user(to, n)				\
-	(__builtin_constant_p(n) ?			\
-	 __constant_clear_user(to, n) :			\
-	 __generic_clear_user(to, n))
+static inline size_t clear_user(void __user *to, size_t n)
+{
+	if (unlikely(!access_ok(VERIFY_WRITE, to, n)))
+		return n;
+	if (__builtin_constant_p(n))
+		return __constant_clear_user(to, n);
+	else
+		return __do_clear_user(to, n);
+}
 
 
-#define copy_from_user(to, from, n)			\
-	(__builtin_constant_p(n) ?			\
-	 __constant_copy_from_user(to, from, n) :	\
-	 __generic_copy_from_user(to, from, n))
+static inline size_t copy_from_user(void *to, const void __user *from, size_t n)
+{
+	if (unlikely(!access_ok(VERIFY_READ, from, n))) {
+		memset(to, 0, n);
+		return n;
+	}
+	if (__builtin_constant_p(n))
+		return __constant_copy_from_user(to, from, n);
+	else
+		return __copy_user_zeroing(to, from, n);
+}
 
 
-#define copy_to_user(to, from, n)			\
-	(__builtin_constant_p(n) ?			\
-	 __constant_copy_to_user(to, from, n) :		\
-	 __generic_copy_to_user(to, from, n))
+static inline size_t copy_to_user(void __user *to, const void *from, size_t n)
+{
+	if (unlikely(!access_ok(VERIFY_WRITE, to, n)))
+		return n;
+	if (__builtin_constant_p(n))
+		return __constant_copy_to_user(to, from, n);
+	else
+		return __copy_user(to, from, n);
+}
 
 
 /* We let the __ versions of copy_from/to_user inline, because they're often
 /* We let the __ versions of copy_from/to_user inline, because they're often
  * used in fast paths and have only a small space overhead.
  * used in fast paths and have only a small space overhead.

+ 9 - 3
arch/frv/include/asm/uaccess.h

@@ -263,19 +263,25 @@ do {							\
 extern long __memset_user(void *dst, unsigned long count);
 extern long __memset_user(void *dst, unsigned long count);
 extern long __memcpy_user(void *dst, const void *src, unsigned long count);
 extern long __memcpy_user(void *dst, const void *src, unsigned long count);
 
 
-#define clear_user(dst,count)			__memset_user(____force(dst), (count))
+#define __clear_user(dst,count)			__memset_user(____force(dst), (count))
 #define __copy_from_user_inatomic(to, from, n)	__memcpy_user((to), ____force(from), (n))
 #define __copy_from_user_inatomic(to, from, n)	__memcpy_user((to), ____force(from), (n))
 #define __copy_to_user_inatomic(to, from, n)	__memcpy_user(____force(to), (from), (n))
 #define __copy_to_user_inatomic(to, from, n)	__memcpy_user(____force(to), (from), (n))
 
 
 #else
 #else
 
 
-#define clear_user(dst,count)			(memset(____force(dst), 0, (count)), 0)
+#define __clear_user(dst,count)			(memset(____force(dst), 0, (count)), 0)
 #define __copy_from_user_inatomic(to, from, n)	(memcpy((to), ____force(from), (n)), 0)
 #define __copy_from_user_inatomic(to, from, n)	(memcpy((to), ____force(from), (n)), 0)
 #define __copy_to_user_inatomic(to, from, n)	(memcpy(____force(to), (from), (n)), 0)
 #define __copy_to_user_inatomic(to, from, n)	(memcpy(____force(to), (from), (n)), 0)
 
 
 #endif
 #endif
 
 
-#define __clear_user clear_user
+static inline unsigned long __must_check
+clear_user(void __user *to, unsigned long n)
+{
+	if (likely(__access_ok(to, n)))
+		n = __clear_user(to, n);
+	return n;
+}
 
 
 static inline unsigned long __must_check
 static inline unsigned long __must_check
 __copy_to_user(void __user *to, const void *from, unsigned long n)
 __copy_to_user(void __user *to, const void *from, unsigned long n)

+ 2 - 1
arch/hexagon/include/asm/uaccess.h

@@ -103,7 +103,8 @@ static inline long hexagon_strncpy_from_user(char *dst, const char __user *src,
 {
 {
 	long res = __strnlen_user(src, n);
 	long res = __strnlen_user(src, n);
 
 
-	/* return from strnlen can't be zero -- that would be rubbish. */
+	if (unlikely(!res))
+		return -EFAULT;
 
 
 	if (res > n) {
 	if (res > n) {
 		copy_from_user(dst, src, n);
 		copy_from_user(dst, src, n);

+ 13 - 20
arch/ia64/include/asm/uaccess.h

@@ -241,8 +241,7 @@ extern unsigned long __must_check __copy_user (void __user *to, const void __use
 static inline unsigned long
 static inline unsigned long
 __copy_to_user (void __user *to, const void *from, unsigned long count)
 __copy_to_user (void __user *to, const void *from, unsigned long count)
 {
 {
-	if (!__builtin_constant_p(count))
-		check_object_size(from, count, true);
+	check_object_size(from, count, true);
 
 
 	return __copy_user(to, (__force void __user *) from, count);
 	return __copy_user(to, (__force void __user *) from, count);
 }
 }
@@ -250,8 +249,7 @@ __copy_to_user (void __user *to, const void *from, unsigned long count)
 static inline unsigned long
 static inline unsigned long
 __copy_from_user (void *to, const void __user *from, unsigned long count)
 __copy_from_user (void *to, const void __user *from, unsigned long count)
 {
 {
-	if (!__builtin_constant_p(count))
-		check_object_size(to, count, false);
+	check_object_size(to, count, false);
 
 
 	return __copy_user((__force void __user *) to, from, count);
 	return __copy_user((__force void __user *) to, from, count);
 }
 }
@@ -265,27 +263,22 @@ __copy_from_user (void *to, const void __user *from, unsigned long count)
 	long __cu_len = (n);								\
 	long __cu_len = (n);								\
 											\
 											\
 	if (__access_ok(__cu_to, __cu_len, get_fs())) {					\
 	if (__access_ok(__cu_to, __cu_len, get_fs())) {					\
-		if (!__builtin_constant_p(n))						\
-			check_object_size(__cu_from, __cu_len, true);			\
+		check_object_size(__cu_from, __cu_len, true);			\
 		__cu_len = __copy_user(__cu_to, (__force void __user *)  __cu_from, __cu_len);	\
 		__cu_len = __copy_user(__cu_to, (__force void __user *)  __cu_from, __cu_len);	\
 	}										\
 	}										\
 	__cu_len;									\
 	__cu_len;									\
 })
 })
 
 
-#define copy_from_user(to, from, n)							\
-({											\
-	void *__cu_to = (to);								\
-	const void __user *__cu_from = (from);						\
-	long __cu_len = (n);								\
-											\
-	__chk_user_ptr(__cu_from);							\
-	if (__access_ok(__cu_from, __cu_len, get_fs())) {				\
-		if (!__builtin_constant_p(n))						\
-			check_object_size(__cu_to, __cu_len, false);			\
-		__cu_len = __copy_user((__force void __user *) __cu_to, __cu_from, __cu_len);	\
-	}										\
-	__cu_len;									\
-})
+static inline unsigned long
+copy_from_user(void *to, const void __user *from, unsigned long n)
+{
+	check_object_size(to, n, false);
+	if (likely(__access_ok(from, n, get_fs())))
+		n = __copy_user((__force void __user *) to, from, n);
+	else
+		memset(to, 0, n);
+	return n;
+}
 
 
 #define __copy_in_user(to, from, size)	__copy_user((to), (from), (size))
 #define __copy_in_user(to, from, size)	__copy_user((to), (from), (size))
 
 

+ 1 - 1
arch/m32r/include/asm/uaccess.h

@@ -219,7 +219,7 @@ extern int fixup_exception(struct pt_regs *regs);
 #define __get_user_nocheck(x, ptr, size)				\
 #define __get_user_nocheck(x, ptr, size)				\
 ({									\
 ({									\
 	long __gu_err = 0;						\
 	long __gu_err = 0;						\
-	unsigned long __gu_val;						\
+	unsigned long __gu_val = 0;					\
 	might_fault();							\
 	might_fault();							\
 	__get_user_size(__gu_val, (ptr), (size), __gu_err);		\
 	__get_user_size(__gu_val, (ptr), (size), __gu_err);		\
 	(x) = (__force __typeof__(*(ptr)))__gu_val;			\
 	(x) = (__force __typeof__(*(ptr)))__gu_val;			\

+ 2 - 1
arch/metag/include/asm/uaccess.h

@@ -204,8 +204,9 @@ extern unsigned long __must_check __copy_user_zeroing(void *to,
 static inline unsigned long
 static inline unsigned long
 copy_from_user(void *to, const void __user *from, unsigned long n)
 copy_from_user(void *to, const void __user *from, unsigned long n)
 {
 {
-	if (access_ok(VERIFY_READ, from, n))
+	if (likely(access_ok(VERIFY_READ, from, n)))
 		return __copy_user_zeroing(to, from, n);
 		return __copy_user_zeroing(to, from, n);
+	memset(to, 0, n);
 	return n;
 	return n;
 }
 }
 
 

+ 7 - 4
arch/microblaze/include/asm/uaccess.h

@@ -227,7 +227,7 @@ extern long __user_bad(void);
 
 
 #define __get_user(x, ptr)						\
 #define __get_user(x, ptr)						\
 ({									\
 ({									\
-	unsigned long __gu_val;						\
+	unsigned long __gu_val = 0;					\
 	/*unsigned long __gu_ptr = (unsigned long)(ptr);*/		\
 	/*unsigned long __gu_ptr = (unsigned long)(ptr);*/		\
 	long __gu_err;							\
 	long __gu_err;							\
 	switch (sizeof(*(ptr))) {					\
 	switch (sizeof(*(ptr))) {					\
@@ -373,10 +373,13 @@ extern long __user_bad(void);
 static inline long copy_from_user(void *to,
 static inline long copy_from_user(void *to,
 		const void __user *from, unsigned long n)
 		const void __user *from, unsigned long n)
 {
 {
+	unsigned long res = n;
 	might_fault();
 	might_fault();
-	if (access_ok(VERIFY_READ, from, n))
-		return __copy_from_user(to, from, n);
-	return n;
+	if (likely(access_ok(VERIFY_READ, from, n)))
+		res = __copy_from_user(to, from, n);
+	if (unlikely(res))
+		memset(to + (n - res), 0, res);
+	return res;
 }
 }
 
 
 #define __copy_to_user(to, from, n)	\
 #define __copy_to_user(to, from, n)	\

+ 3 - 0
arch/mips/include/asm/uaccess.h

@@ -14,6 +14,7 @@
 #include <linux/kernel.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/errno.h>
 #include <linux/thread_info.h>
 #include <linux/thread_info.h>
+#include <linux/string.h>
 #include <asm/asm-eva.h>
 #include <asm/asm-eva.h>
 
 
 /*
 /*
@@ -1170,6 +1171,8 @@ extern size_t __copy_in_user_eva(void *__to, const void *__from, size_t __n);
 			__cu_len = __invoke_copy_from_user(__cu_to,	\
 			__cu_len = __invoke_copy_from_user(__cu_to,	\
 							   __cu_from,	\
 							   __cu_from,	\
 							   __cu_len);   \
 							   __cu_len);   \
+		} else {						\
+			memset(__cu_to, 0, __cu_len);			\
 		}							\
 		}							\
 	}								\
 	}								\
 	__cu_len;							\
 	__cu_len;							\

+ 1 - 0
arch/mn10300/include/asm/uaccess.h

@@ -166,6 +166,7 @@ struct __large_struct { unsigned long buf[100]; };
 		"2:\n"						\
 		"2:\n"						\
 		"	.section	.fixup,\"ax\"\n"	\
 		"	.section	.fixup,\"ax\"\n"	\
 		"3:\n\t"					\
 		"3:\n\t"					\
+		"	mov		0,%1\n"			\
 		"	mov		%3,%0\n"		\
 		"	mov		%3,%0\n"		\
 		"	jmp		2b\n"			\
 		"	jmp		2b\n"			\
 		"	.previous\n"				\
 		"	.previous\n"				\

+ 3 - 1
arch/mn10300/lib/usercopy.c

@@ -9,7 +9,7 @@
  * as published by the Free Software Foundation; either version
  * as published by the Free Software Foundation; either version
  * 2 of the Licence, or (at your option) any later version.
  * 2 of the Licence, or (at your option) any later version.
  */
  */
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 
 
 unsigned long
 unsigned long
 __generic_copy_to_user(void *to, const void *from, unsigned long n)
 __generic_copy_to_user(void *to, const void *from, unsigned long n)
@@ -24,6 +24,8 @@ __generic_copy_from_user(void *to, const void *from, unsigned long n)
 {
 {
 	if (access_ok(VERIFY_READ, from, n))
 	if (access_ok(VERIFY_READ, from, n))
 		__copy_user_zeroing(to, from, n);
 		__copy_user_zeroing(to, from, n);
+	else
+		memset(to, 0, n);
 	return n;
 	return n;
 }
 }
 
 

+ 8 - 5
arch/nios2/include/asm/uaccess.h

@@ -102,9 +102,12 @@ extern long __copy_to_user(void __user *to, const void *from, unsigned long n);
 static inline long copy_from_user(void *to, const void __user *from,
 static inline long copy_from_user(void *to, const void __user *from,
 				unsigned long n)
 				unsigned long n)
 {
 {
-	if (!access_ok(VERIFY_READ, from, n))
-		return n;
-	return __copy_from_user(to, from, n);
+	unsigned long res = n;
+	if (access_ok(VERIFY_READ, from, n))
+		res = __copy_from_user(to, from, n);
+	if (unlikely(res))
+		memset(to + (n - res), 0, res);
+	return res;
 }
 }
 
 
 static inline long copy_to_user(void __user *to, const void *from,
 static inline long copy_to_user(void __user *to, const void *from,
@@ -139,7 +142,7 @@ extern long strnlen_user(const char __user *s, long n);
 
 
 #define __get_user_unknown(val, size, ptr, err) do {			\
 #define __get_user_unknown(val, size, ptr, err) do {			\
 	err = 0;							\
 	err = 0;							\
-	if (copy_from_user(&(val), ptr, size)) {			\
+	if (__copy_from_user(&(val), ptr, size)) {			\
 		err = -EFAULT;						\
 		err = -EFAULT;						\
 	}								\
 	}								\
 	} while (0)
 	} while (0)
@@ -166,7 +169,7 @@ do {									\
 	({								\
 	({								\
 	long __gu_err = -EFAULT;					\
 	long __gu_err = -EFAULT;					\
 	const __typeof__(*(ptr)) __user *__gu_ptr = (ptr);		\
 	const __typeof__(*(ptr)) __user *__gu_ptr = (ptr);		\
-	unsigned long __gu_val;						\
+	unsigned long __gu_val = 0;					\
 	__get_user_common(__gu_val, sizeof(*(ptr)), __gu_ptr, __gu_err);\
 	__get_user_common(__gu_val, sizeof(*(ptr)), __gu_ptr, __gu_err);\
 	(x) = (__force __typeof__(x))__gu_val;				\
 	(x) = (__force __typeof__(x))__gu_val;				\
 	__gu_err;							\
 	__gu_err;							\

+ 11 - 24
arch/openrisc/include/asm/uaccess.h

@@ -273,28 +273,20 @@ __copy_tofrom_user(void *to, const void *from, unsigned long size);
 static inline unsigned long
 static inline unsigned long
 copy_from_user(void *to, const void *from, unsigned long n)
 copy_from_user(void *to, const void *from, unsigned long n)
 {
 {
-	unsigned long over;
-
-	if (access_ok(VERIFY_READ, from, n))
-		return __copy_tofrom_user(to, from, n);
-	if ((unsigned long)from < TASK_SIZE) {
-		over = (unsigned long)from + n - TASK_SIZE;
-		return __copy_tofrom_user(to, from, n - over) + over;
-	}
-	return n;
+	unsigned long res = n;
+
+	if (likely(access_ok(VERIFY_READ, from, n)))
+		res = __copy_tofrom_user(to, from, n);
+	if (unlikely(res))
+		memset(to + (n - res), 0, res);
+	return res;
 }
 }
 
 
 static inline unsigned long
 static inline unsigned long
 copy_to_user(void *to, const void *from, unsigned long n)
 copy_to_user(void *to, const void *from, unsigned long n)
 {
 {
-	unsigned long over;
-
-	if (access_ok(VERIFY_WRITE, to, n))
-		return __copy_tofrom_user(to, from, n);
-	if ((unsigned long)to < TASK_SIZE) {
-		over = (unsigned long)to + n - TASK_SIZE;
-		return __copy_tofrom_user(to, from, n - over) + over;
-	}
+	if (likely(access_ok(VERIFY_WRITE, to, n)))
+		n = __copy_tofrom_user(to, from, n);
 	return n;
 	return n;
 }
 }
 
 
@@ -303,13 +295,8 @@ extern unsigned long __clear_user(void *addr, unsigned long size);
 static inline __must_check unsigned long
 static inline __must_check unsigned long
 clear_user(void *addr, unsigned long size)
 clear_user(void *addr, unsigned long size)
 {
 {
-
-	if (access_ok(VERIFY_WRITE, addr, size))
-		return __clear_user(addr, size);
-	if ((unsigned long)addr < TASK_SIZE) {
-		unsigned long over = (unsigned long)addr + size - TASK_SIZE;
-		return __clear_user(addr, size - over) + over;
-	}
+	if (likely(access_ok(VERIFY_WRITE, addr, size)))
+		size = __clear_user(addr, size);
 	return size;
 	return size;
 }
 }
 
 

+ 4 - 1
arch/parisc/include/asm/uaccess.h

@@ -10,6 +10,7 @@
 #include <asm-generic/uaccess-unaligned.h>
 #include <asm-generic/uaccess-unaligned.h>
 
 
 #include <linux/bug.h>
 #include <linux/bug.h>
+#include <linux/string.h>
 
 
 #define VERIFY_READ 0
 #define VERIFY_READ 0
 #define VERIFY_WRITE 1
 #define VERIFY_WRITE 1
@@ -221,7 +222,7 @@ static inline unsigned long __must_check copy_from_user(void *to,
                                           unsigned long n)
                                           unsigned long n)
 {
 {
         int sz = __compiletime_object_size(to);
         int sz = __compiletime_object_size(to);
-        int ret = -EFAULT;
+        unsigned long ret = n;
 
 
         if (likely(sz == -1 || sz >= n))
         if (likely(sz == -1 || sz >= n))
                 ret = __copy_from_user(to, from, n);
                 ret = __copy_from_user(to, from, n);
@@ -230,6 +231,8 @@ static inline unsigned long __must_check copy_from_user(void *to,
 	else
 	else
                 __bad_copy_user();
                 __bad_copy_user();
 
 
+	if (unlikely(ret))
+		memset(to + (n - ret), 0, ret);
         return ret;
         return ret;
 }
 }
 
 

+ 1 - 1
arch/powerpc/include/asm/cpu_has_feature.h

@@ -15,7 +15,7 @@ static inline bool early_cpu_has_feature(unsigned long feature)
 #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECKS
 #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECKS
 #include <linux/jump_label.h>
 #include <linux/jump_label.h>
 
 
-#define NUM_CPU_FTR_KEYS	64
+#define NUM_CPU_FTR_KEYS	BITS_PER_LONG
 
 
 extern struct static_key_true cpu_feature_keys[NUM_CPU_FTR_KEYS];
 extern struct static_key_true cpu_feature_keys[NUM_CPU_FTR_KEYS];
 
 

+ 7 - 31
arch/powerpc/include/asm/uaccess.h

@@ -308,40 +308,21 @@ extern unsigned long __copy_tofrom_user(void __user *to,
 static inline unsigned long copy_from_user(void *to,
 static inline unsigned long copy_from_user(void *to,
 		const void __user *from, unsigned long n)
 		const void __user *from, unsigned long n)
 {
 {
-	unsigned long over;
-
-	if (access_ok(VERIFY_READ, from, n)) {
-		if (!__builtin_constant_p(n))
-			check_object_size(to, n, false);
+	if (likely(access_ok(VERIFY_READ, from, n))) {
+		check_object_size(to, n, false);
 		return __copy_tofrom_user((__force void __user *)to, from, n);
 		return __copy_tofrom_user((__force void __user *)to, from, n);
 	}
 	}
-	if ((unsigned long)from < TASK_SIZE) {
-		over = (unsigned long)from + n - TASK_SIZE;
-		if (!__builtin_constant_p(n - over))
-			check_object_size(to, n - over, false);
-		return __copy_tofrom_user((__force void __user *)to, from,
-				n - over) + over;
-	}
+	memset(to, 0, n);
 	return n;
 	return n;
 }
 }
 
 
 static inline unsigned long copy_to_user(void __user *to,
 static inline unsigned long copy_to_user(void __user *to,
 		const void *from, unsigned long n)
 		const void *from, unsigned long n)
 {
 {
-	unsigned long over;
-
 	if (access_ok(VERIFY_WRITE, to, n)) {
 	if (access_ok(VERIFY_WRITE, to, n)) {
-		if (!__builtin_constant_p(n))
-			check_object_size(from, n, true);
+		check_object_size(from, n, true);
 		return __copy_tofrom_user(to, (__force void __user *)from, n);
 		return __copy_tofrom_user(to, (__force void __user *)from, n);
 	}
 	}
-	if ((unsigned long)to < TASK_SIZE) {
-		over = (unsigned long)to + n - TASK_SIZE;
-		if (!__builtin_constant_p(n))
-			check_object_size(from, n - over, true);
-		return __copy_tofrom_user(to, (__force void __user *)from,
-				n - over) + over;
-	}
 	return n;
 	return n;
 }
 }
 
 
@@ -383,8 +364,7 @@ static inline unsigned long __copy_from_user_inatomic(void *to,
 			return 0;
 			return 0;
 	}
 	}
 
 
-	if (!__builtin_constant_p(n))
-		check_object_size(to, n, false);
+	check_object_size(to, n, false);
 
 
 	return __copy_tofrom_user((__force void __user *)to, from, n);
 	return __copy_tofrom_user((__force void __user *)to, from, n);
 }
 }
@@ -412,8 +392,8 @@ static inline unsigned long __copy_to_user_inatomic(void __user *to,
 		if (ret == 0)
 		if (ret == 0)
 			return 0;
 			return 0;
 	}
 	}
-	if (!__builtin_constant_p(n))
-		check_object_size(from, n, true);
+
+	check_object_size(from, n, true);
 
 
 	return __copy_tofrom_user(to, (__force const void __user *)from, n);
 	return __copy_tofrom_user(to, (__force const void __user *)from, n);
 }
 }
@@ -439,10 +419,6 @@ static inline unsigned long clear_user(void __user *addr, unsigned long size)
 	might_fault();
 	might_fault();
 	if (likely(access_ok(VERIFY_WRITE, addr, size)))
 	if (likely(access_ok(VERIFY_WRITE, addr, size)))
 		return __clear_user(addr, size);
 		return __clear_user(addr, size);
-	if ((unsigned long)addr < TASK_SIZE) {
-		unsigned long over = (unsigned long)addr + size - TASK_SIZE;
-		return __clear_user(addr, size - over) + over;
-	}
 	return size;
 	return size;
 }
 }
 
 

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików