Переглянути джерело

Merge branch 'timers/for-arm' into timers/core

Thomas Gleixner 12 роки тому
батько
коміт
a9037430c6
100 змінених файлів з 682 додано та 346 видалено
  1. 1 0
      Documentation/device-mapper/dm-raid.txt
  2. 3 2
      Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt
  3. 26 1
      Documentation/x86/boot.txt
  4. 4 0
      Documentation/x86/zero-page.txt
  5. 4 4
      MAINTAINERS
  6. 1 1
      Makefile
  7. 1 1
      arch/arm/boot/dts/armada-370-db.dts
  8. 6 8
      arch/arm/boot/dts/armada-xp-mv78230.dtsi
  9. 9 12
      arch/arm/boot/dts/armada-xp-mv78260.dtsi
  10. 9 12
      arch/arm/boot/dts/armada-xp-mv78460.dtsi
  11. 2 2
      arch/arm/boot/dts/at91rm9200.dtsi
  12. 40 20
      arch/arm/boot/dts/at91sam9x5.dtsi
  13. 6 6
      arch/arm/boot/dts/cros5250-common.dtsi
  14. 12 2
      arch/arm/boot/dts/dove-cubox.dts
  15. 4 4
      arch/arm/boot/dts/exynos5250-smdk5250.dts
  16. 16 0
      arch/arm/boot/dts/kirkwood-ns2-common.dtsi
  17. 2 0
      arch/arm/boot/dts/kirkwood.dtsi
  18. 2 0
      arch/arm/boot/dts/kizbox.dts
  19. 4 2
      arch/arm/boot/dts/sunxi.dtsi
  20. 0 2
      arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts
  21. 2 1
      arch/arm/configs/at91_dt_defconfig
  22. 2 0
      arch/arm/kernel/debug.S
  23. 4 1
      arch/arm/kernel/head.S
  24. 6 12
      arch/arm/kernel/hyp-stub.S
  25. 2 0
      arch/arm/mach-at91/setup.c
  26. 1 0
      arch/arm/mach-imx/Kconfig
  27. 3 0
      arch/arm/mach-imx/clk-imx6q.c
  28. 1 0
      arch/arm/mach-imx/common.h
  29. 1 1
      arch/arm/mach-imx/devices/platform-imx-fb.c
  30. 6 4
      arch/arm/mach-imx/hotplug.c
  31. 1 2
      arch/arm/mach-imx/iram_alloc.c
  32. 1 0
      arch/arm/mach-imx/platsmp.c
  33. 1 0
      arch/arm/mach-imx/pm-imx6q.c
  34. 10 4
      arch/arm/mach-integrator/pci_v3.c
  35. 0 38
      arch/arm/mach-kirkwood/board-ns2.c
  36. 2 0
      arch/arm/mach-mvebu/Makefile
  37. 6 0
      arch/arm/mach-omap2/board-omap4panda.c
  38. 2 0
      arch/arm/mach-omap2/cclock2420_data.c
  39. 2 0
      arch/arm/mach-omap2/cclock2430_data.c
  40. 6 7
      arch/arm/mach-omap2/cclock44xx_data.c
  41. 1 1
      arch/arm/mach-omap2/devices.c
  42. 2 1
      arch/arm/mach-omap2/drm.c
  43. 5 1
      arch/arm/mach-omap2/omap_hwmod_44xx_data.c
  44. 2 6
      arch/arm/mach-omap2/timer.c
  45. 1 1
      arch/arm/mach-s3c64xx/mach-crag6410-module.c
  46. 2 0
      arch/arm/mach-s3c64xx/pm.c
  47. 10 8
      arch/arm/mm/dma-mapping.c
  48. 1 1
      arch/arm/mm/mmu.c
  49. 1 1
      arch/arm/plat-versatile/headsmp.S
  50. 3 3
      arch/arm/vfp/entry.S
  51. 2 2
      arch/arm/vfp/vfphw.S
  52. 2 0
      arch/powerpc/kernel/entry_32.S
  53. 13 0
      arch/powerpc/kernel/entry_64.S
  54. 3 2
      arch/powerpc/kernel/kgdb.c
  55. 7 2
      arch/powerpc/kernel/time.c
  56. 2 0
      arch/powerpc/kvm/emulate.c
  57. 1 1
      arch/powerpc/oprofile/op_model_power4.c
  58. 7 0
      arch/powerpc/platforms/pasemi/cpufreq.c
  59. 12 0
      arch/s390/include/asm/pgtable.h
  60. 1 0
      arch/x86/Kconfig
  61. 2 2
      arch/x86/boot/Makefile
  62. 11 10
      arch/x86/boot/compressed/eboot.c
  63. 5 3
      arch/x86/boot/compressed/head_32.S
  64. 4 4
      arch/x86/boot/compressed/head_64.S
  65. 29 10
      arch/x86/boot/header.S
  66. 1 1
      arch/x86/boot/setup.ld
  67. 63 18
      arch/x86/boot/tools/build.c
  68. 1 0
      arch/x86/include/asm/efi.h
  69. 1 1
      arch/x86/include/asm/uv/uv.h
  70. 46 17
      arch/x86/include/uapi/asm/bootparam.h
  71. 3 4
      arch/x86/kernel/entry_64.S
  72. 7 2
      arch/x86/kernel/head_32.S
  73. 3 0
      arch/x86/kernel/msr.c
  74. 1 1
      arch/x86/kernel/pci-dma.c
  75. 1 1
      arch/x86/kernel/reboot.c
  76. 14 14
      arch/x86/kernel/setup.c
  77. 35 24
      arch/x86/platform/efi/efi.c
  78. 17 5
      arch/x86/platform/efi/efi_64.c
  79. 7 3
      arch/x86/platform/uv/tlb_uv.c
  80. 4 2
      arch/x86/tools/relocs.c
  81. 3 0
      drivers/acpi/apei/apei-base.c
  82. 1 1
      drivers/acpi/osl.c
  83. 4 0
      drivers/acpi/processor_idle.c
  84. 7 0
      drivers/acpi/processor_perflib.c
  85. 0 2
      drivers/base/regmap/regmap-debugfs.c
  86. 1 1
      drivers/base/regmap/regmap.c
  87. 10 0
      drivers/bluetooth/ath3k.c
  88. 5 0
      drivers/bluetooth/btusb.c
  89. 6 3
      drivers/clk/mvebu/clk-cpu.c
  90. 1 1
      drivers/cpufreq/Kconfig.x86
  91. 7 0
      drivers/cpufreq/acpi-cpufreq.c
  92. 5 0
      drivers/cpufreq/cpufreq-cpu0.c
  93. 3 0
      drivers/cpufreq/omap-cpufreq.c
  94. 5 0
      drivers/devfreq/devfreq.c
  95. 67 27
      drivers/devfreq/exynos4_bus.c
  96. 2 3
      drivers/dma/imx-dma.c
  97. 1 1
      drivers/dma/ioat/dma_v3.c
  98. 6 2
      drivers/dma/tegra20-apb-dma.c
  99. 3 3
      drivers/edac/edac_mc.c
  100. 1 1
      drivers/edac/edac_pci_sysfs.c

+ 1 - 0
Documentation/device-mapper/dm-raid.txt

@@ -141,3 +141,4 @@ Version History
 1.2.0	Handle creation of arrays that contain failed devices.
 1.2.0	Handle creation of arrays that contain failed devices.
 1.3.0	Added support for RAID 10
 1.3.0	Added support for RAID 10
 1.3.1	Allow device replacement/rebuild for RAID 10
 1.3.1	Allow device replacement/rebuild for RAID 10
+1.3.2   Fix/improve redundancy checking for RAID10

+ 3 - 2
Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt

@@ -81,7 +81,8 @@ PA31	TXD4
 Required properties for pin configuration node:
 Required properties for pin configuration node:
 - atmel,pins: 4 integers array, represents a group of pins mux and config
 - atmel,pins: 4 integers array, represents a group of pins mux and config
   setting. The format is atmel,pins = <PIN_BANK PIN_BANK_NUM PERIPH CONFIG>.
   setting. The format is atmel,pins = <PIN_BANK PIN_BANK_NUM PERIPH CONFIG>.
-  The PERIPH 0 means gpio.
+  The PERIPH 0 means gpio, PERIPH 1 is periph A, PERIPH 2 is periph B...
+  PIN_BANK 0 is pioA, PIN_BANK 1 is pioB...
 
 
 Bits used for CONFIG:
 Bits used for CONFIG:
 PULL_UP		(1 << 0): indicate this pin need a pull up.
 PULL_UP		(1 << 0): indicate this pin need a pull up.
@@ -126,7 +127,7 @@ pinctrl@fffff400 {
 		pinctrl_dbgu: dbgu-0 {
 		pinctrl_dbgu: dbgu-0 {
 			atmel,pins =
 			atmel,pins =
 				<1 14 0x1 0x0	/* PB14 periph A */
 				<1 14 0x1 0x0	/* PB14 periph A */
-				 1 15 0x1 0x1>;	/* PB15 periph with pullup */
+				 1 15 0x1 0x1>;	/* PB15 periph A with pullup */
 		};
 		};
 	};
 	};
 };
 };

+ 26 - 1
Documentation/x86/boot.txt

@@ -57,6 +57,10 @@ Protocol 2.10:	(Kernel 2.6.31) Added a protocol for relaxed alignment
 Protocol 2.11:	(Kernel 3.6) Added a field for offset of EFI handover
 Protocol 2.11:	(Kernel 3.6) Added a field for offset of EFI handover
 		protocol entry point.
 		protocol entry point.
 
 
+Protocol 2.12:	(Kernel 3.9) Added the xloadflags field and extension fields
+	 	to struct boot_params for for loading bzImage and ramdisk
+		above 4G in 64bit.
+
 **** MEMORY LAYOUT
 **** MEMORY LAYOUT
 
 
 The traditional memory map for the kernel loader, used for Image or
 The traditional memory map for the kernel loader, used for Image or
@@ -182,7 +186,7 @@ Offset	Proto	Name		Meaning
 0230/4	2.05+	kernel_alignment Physical addr alignment required for kernel
 0230/4	2.05+	kernel_alignment Physical addr alignment required for kernel
 0234/1	2.05+	relocatable_kernel Whether kernel is relocatable or not
 0234/1	2.05+	relocatable_kernel Whether kernel is relocatable or not
 0235/1	2.10+	min_alignment	Minimum alignment, as a power of two
 0235/1	2.10+	min_alignment	Minimum alignment, as a power of two
-0236/2	N/A	pad3		Unused
+0236/2	2.12+	xloadflags	Boot protocol option flags
 0238/4	2.06+	cmdline_size	Maximum size of the kernel command line
 0238/4	2.06+	cmdline_size	Maximum size of the kernel command line
 023C/4	2.07+	hardware_subarch Hardware subarchitecture
 023C/4	2.07+	hardware_subarch Hardware subarchitecture
 0240/8	2.07+	hardware_subarch_data Subarchitecture-specific data
 0240/8	2.07+	hardware_subarch_data Subarchitecture-specific data
@@ -582,6 +586,27 @@ Protocol:	2.10+
   misaligned kernel.  Therefore, a loader should typically try each
   misaligned kernel.  Therefore, a loader should typically try each
   power-of-two alignment from kernel_alignment down to this alignment.
   power-of-two alignment from kernel_alignment down to this alignment.
 
 
+Field name:     xloadflags
+Type:           read
+Offset/size:    0x236/2
+Protocol:       2.12+
+
+  This field is a bitmask.
+
+  Bit 0 (read):	XLF_KERNEL_64
+	- If 1, this kernel has the legacy 64-bit entry point at 0x200.
+
+  Bit 1 (read): XLF_CAN_BE_LOADED_ABOVE_4G
+        - If 1, kernel/boot_params/cmdline/ramdisk can be above 4G.
+
+  Bit 2 (read):	XLF_EFI_HANDOVER_32
+	- If 1, the kernel supports the 32-bit EFI handoff entry point
+          given at handover_offset.
+
+  Bit 3 (read): XLF_EFI_HANDOVER_64
+	- If 1, the kernel supports the 64-bit EFI handoff entry point
+          given at handover_offset + 0x200.
+
 Field name:	cmdline_size
 Field name:	cmdline_size
 Type:		read
 Type:		read
 Offset/size:	0x238/4
 Offset/size:	0x238/4

+ 4 - 0
Documentation/x86/zero-page.txt

@@ -19,6 +19,9 @@ Offset	Proto	Name		Meaning
 090/010	ALL	hd1_info	hd1 disk parameter, OBSOLETE!!
 090/010	ALL	hd1_info	hd1 disk parameter, OBSOLETE!!
 0A0/010	ALL	sys_desc_table	System description table (struct sys_desc_table)
 0A0/010	ALL	sys_desc_table	System description table (struct sys_desc_table)
 0B0/010	ALL	olpc_ofw_header	OLPC's OpenFirmware CIF and friends
 0B0/010	ALL	olpc_ofw_header	OLPC's OpenFirmware CIF and friends
+0C0/004	ALL	ext_ramdisk_image ramdisk_image high 32bits
+0C4/004	ALL	ext_ramdisk_size  ramdisk_size high 32bits
+0C8/004	ALL	ext_cmd_line_ptr  cmd_line_ptr high 32bits
 140/080	ALL	edid_info	Video mode setup (struct edid_info)
 140/080	ALL	edid_info	Video mode setup (struct edid_info)
 1C0/020	ALL	efi_info	EFI 32 information (struct efi_info)
 1C0/020	ALL	efi_info	EFI 32 information (struct efi_info)
 1E0/004	ALL	alk_mem_k	Alternative mem check, in KB
 1E0/004	ALL	alk_mem_k	Alternative mem check, in KB
@@ -27,6 +30,7 @@ Offset	Proto	Name		Meaning
 1E9/001	ALL	eddbuf_entries	Number of entries in eddbuf (below)
 1E9/001	ALL	eddbuf_entries	Number of entries in eddbuf (below)
 1EA/001	ALL	edd_mbr_sig_buf_entries	Number of entries in edd_mbr_sig_buffer
 1EA/001	ALL	edd_mbr_sig_buf_entries	Number of entries in edd_mbr_sig_buffer
 				(below)
 				(below)
+1EF/001	ALL	sentinel	Used to detect broken bootloaders
 290/040	ALL	edd_mbr_sig_buffer EDD MBR signatures
 290/040	ALL	edd_mbr_sig_buffer EDD MBR signatures
 2D0/A00	ALL	e820_map	E820 memory map table
 2D0/A00	ALL	e820_map	E820 memory map table
 				(array of struct e820entry)
 				(array of struct e820entry)

+ 4 - 4
MAINTAINERS

@@ -2966,7 +2966,7 @@ S:	Maintained
 F:	drivers/net/ethernet/i825xx/eexpress.*
 F:	drivers/net/ethernet/i825xx/eexpress.*
 
 
 ETHERNET BRIDGE
 ETHERNET BRIDGE
-M:	Stephen Hemminger <shemminger@vyatta.com>
+M:	Stephen Hemminger <stephen@networkplumber.org>
 L:	bridge@lists.linux-foundation.org
 L:	bridge@lists.linux-foundation.org
 L:	netdev@vger.kernel.org
 L:	netdev@vger.kernel.org
 W:	http://www.linuxfoundation.org/en/Net:Bridge
 W:	http://www.linuxfoundation.org/en/Net:Bridge
@@ -4905,7 +4905,7 @@ S:	Maintained
 
 
 MARVELL GIGABIT ETHERNET DRIVERS (skge/sky2)
 MARVELL GIGABIT ETHERNET DRIVERS (skge/sky2)
 M:	Mirko Lindner <mlindner@marvell.com>
 M:	Mirko Lindner <mlindner@marvell.com>
-M:	Stephen Hemminger <shemminger@vyatta.com>
+M:	Stephen Hemminger <stephen@networkplumber.org>
 L:	netdev@vger.kernel.org
 L:	netdev@vger.kernel.org
 S:	Maintained
 S:	Maintained
 F:	drivers/net/ethernet/marvell/sk*
 F:	drivers/net/ethernet/marvell/sk*
@@ -5180,7 +5180,7 @@ S:	Supported
 F:	drivers/infiniband/hw/nes/
 F:	drivers/infiniband/hw/nes/
 
 
 NETEM NETWORK EMULATOR
 NETEM NETWORK EMULATOR
-M:	Stephen Hemminger <shemminger@vyatta.com>
+M:	Stephen Hemminger <stephen@networkplumber.org>
 L:	netem@lists.linux-foundation.org
 L:	netem@lists.linux-foundation.org
 S:	Maintained
 S:	Maintained
 F:	net/sched/sch_netem.c
 F:	net/sched/sch_netem.c
@@ -7088,7 +7088,7 @@ F:	include/uapi/sound/
 F:	sound/
 F:	sound/
 
 
 SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
 SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
-M:	Liam Girdwood <lrg@ti.com>
+M:	Liam Girdwood <lgirdwood@gmail.com>
 M:	Mark Brown <broonie@opensource.wolfsonmicro.com>
 M:	Mark Brown <broonie@opensource.wolfsonmicro.com>
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
 L:	alsa-devel@alsa-project.org (moderated for non-subscribers)
 L:	alsa-devel@alsa-project.org (moderated for non-subscribers)

+ 1 - 1
Makefile

@@ -1,7 +1,7 @@
 VERSION = 3
 VERSION = 3
 PATCHLEVEL = 8
 PATCHLEVEL = 8
 SUBLEVEL = 0
 SUBLEVEL = 0
-EXTRAVERSION = -rc4
+EXTRAVERSION = -rc5
 NAME = Terrified Chipmunk
 NAME = Terrified Chipmunk
 
 
 # *DOCUMENTATION*
 # *DOCUMENTATION*

+ 1 - 1
arch/arm/boot/dts/armada-370-db.dts

@@ -26,7 +26,7 @@
 
 
 	memory {
 	memory {
 		device_type = "memory";
 		device_type = "memory";
-		reg = <0x00000000 0x20000000>; /* 512 MB */
+		reg = <0x00000000 0x40000000>; /* 1 GB */
 	};
 	};
 
 
 	soc {
 	soc {

+ 6 - 8
arch/arm/boot/dts/armada-xp-mv78230.dtsi

@@ -50,27 +50,25 @@
 		};
 		};
 
 
 		gpio0: gpio@d0018100 {
 		gpio0: gpio@d0018100 {
-			compatible = "marvell,armadaxp-gpio";
-			reg = <0xd0018100 0x40>,
-			    <0xd0018800 0x30>;
+			compatible = "marvell,orion-gpio";
+			reg = <0xd0018100 0x40>;
 			ngpios = <32>;
 			ngpios = <32>;
 			gpio-controller;
 			gpio-controller;
 			#gpio-cells = <2>;
 			#gpio-cells = <2>;
 			interrupt-controller;
 			interrupt-controller;
 			#interrupts-cells = <2>;
 			#interrupts-cells = <2>;
-			interrupts = <16>, <17>, <18>, <19>;
+			interrupts = <82>, <83>, <84>, <85>;
 		};
 		};
 
 
 		gpio1: gpio@d0018140 {
 		gpio1: gpio@d0018140 {
-			compatible = "marvell,armadaxp-gpio";
-			reg = <0xd0018140 0x40>,
-			    <0xd0018840 0x30>;
+			compatible = "marvell,orion-gpio";
+			reg = <0xd0018140 0x40>;
 			ngpios = <17>;
 			ngpios = <17>;
 			gpio-controller;
 			gpio-controller;
 			#gpio-cells = <2>;
 			#gpio-cells = <2>;
 			interrupt-controller;
 			interrupt-controller;
 			#interrupts-cells = <2>;
 			#interrupts-cells = <2>;
-			interrupts = <20>, <21>, <22>;
+			interrupts = <87>, <88>, <89>;
 		};
 		};
 	};
 	};
 };
 };

+ 9 - 12
arch/arm/boot/dts/armada-xp-mv78260.dtsi

@@ -51,39 +51,36 @@
 		};
 		};
 
 
 		gpio0: gpio@d0018100 {
 		gpio0: gpio@d0018100 {
-			compatible = "marvell,armadaxp-gpio";
-			reg = <0xd0018100 0x40>,
-			    <0xd0018800 0x30>;
+			compatible = "marvell,orion-gpio";
+			reg = <0xd0018100 0x40>;
 			ngpios = <32>;
 			ngpios = <32>;
 			gpio-controller;
 			gpio-controller;
 			#gpio-cells = <2>;
 			#gpio-cells = <2>;
 			interrupt-controller;
 			interrupt-controller;
 			#interrupts-cells = <2>;
 			#interrupts-cells = <2>;
-			interrupts = <16>, <17>, <18>, <19>;
+			interrupts = <82>, <83>, <84>, <85>;
 		};
 		};
 
 
 		gpio1: gpio@d0018140 {
 		gpio1: gpio@d0018140 {
-			compatible = "marvell,armadaxp-gpio";
-			reg = <0xd0018140 0x40>,
-			    <0xd0018840 0x30>;
+			compatible = "marvell,orion-gpio";
+			reg = <0xd0018140 0x40>;
 			ngpios = <32>;
 			ngpios = <32>;
 			gpio-controller;
 			gpio-controller;
 			#gpio-cells = <2>;
 			#gpio-cells = <2>;
 			interrupt-controller;
 			interrupt-controller;
 			#interrupts-cells = <2>;
 			#interrupts-cells = <2>;
-			interrupts = <20>, <21>, <22>, <23>;
+			interrupts = <87>, <88>, <89>, <90>;
 		};
 		};
 
 
 		gpio2: gpio@d0018180 {
 		gpio2: gpio@d0018180 {
-			compatible = "marvell,armadaxp-gpio";
-			reg = <0xd0018180 0x40>,
-			    <0xd0018870 0x30>;
+			compatible = "marvell,orion-gpio";
+			reg = <0xd0018180 0x40>;
 			ngpios = <3>;
 			ngpios = <3>;
 			gpio-controller;
 			gpio-controller;
 			#gpio-cells = <2>;
 			#gpio-cells = <2>;
 			interrupt-controller;
 			interrupt-controller;
 			#interrupts-cells = <2>;
 			#interrupts-cells = <2>;
-			interrupts = <24>;
+			interrupts = <91>;
 		};
 		};
 
 
 		ethernet@d0034000 {
 		ethernet@d0034000 {

+ 9 - 12
arch/arm/boot/dts/armada-xp-mv78460.dtsi

@@ -66,39 +66,36 @@
 		};
 		};
 
 
 		gpio0: gpio@d0018100 {
 		gpio0: gpio@d0018100 {
-			compatible = "marvell,armadaxp-gpio";
-			reg = <0xd0018100 0x40>,
-			    <0xd0018800 0x30>;
+			compatible = "marvell,orion-gpio";
+			reg = <0xd0018100 0x40>;
 			ngpios = <32>;
 			ngpios = <32>;
 			gpio-controller;
 			gpio-controller;
 			#gpio-cells = <2>;
 			#gpio-cells = <2>;
 			interrupt-controller;
 			interrupt-controller;
 			#interrupts-cells = <2>;
 			#interrupts-cells = <2>;
-			interrupts = <16>, <17>, <18>, <19>;
+			interrupts = <82>, <83>, <84>, <85>;
 		};
 		};
 
 
 		gpio1: gpio@d0018140 {
 		gpio1: gpio@d0018140 {
-			compatible = "marvell,armadaxp-gpio";
-			reg = <0xd0018140 0x40>,
-			    <0xd0018840 0x30>;
+			compatible = "marvell,orion-gpio";
+			reg = <0xd0018140 0x40>;
 			ngpios = <32>;
 			ngpios = <32>;
 			gpio-controller;
 			gpio-controller;
 			#gpio-cells = <2>;
 			#gpio-cells = <2>;
 			interrupt-controller;
 			interrupt-controller;
 			#interrupts-cells = <2>;
 			#interrupts-cells = <2>;
-			interrupts = <20>, <21>, <22>, <23>;
+			interrupts = <87>, <88>, <89>, <90>;
 		};
 		};
 
 
 		gpio2: gpio@d0018180 {
 		gpio2: gpio@d0018180 {
-			compatible = "marvell,armadaxp-gpio";
-			reg = <0xd0018180 0x40>,
-			    <0xd0018870 0x30>;
+			compatible = "marvell,orion-gpio";
+			reg = <0xd0018180 0x40>;
 			ngpios = <3>;
 			ngpios = <3>;
 			gpio-controller;
 			gpio-controller;
 			#gpio-cells = <2>;
 			#gpio-cells = <2>;
 			interrupt-controller;
 			interrupt-controller;
 			#interrupts-cells = <2>;
 			#interrupts-cells = <2>;
-			interrupts = <24>;
+			interrupts = <91>;
 		};
 		};
 
 
 		ethernet@d0034000 {
 		ethernet@d0034000 {

+ 2 - 2
arch/arm/boot/dts/at91rm9200.dtsi

@@ -336,8 +336,8 @@
 
 
 	i2c@0 {
 	i2c@0 {
 		compatible = "i2c-gpio";
 		compatible = "i2c-gpio";
-		gpios = <&pioA 23 0 /* sda */
-			 &pioA 24 0 /* scl */
+		gpios = <&pioA 25 0 /* sda */
+			 &pioA 26 0 /* scl */
 			>;
 			>;
 		i2c-gpio,sda-open-drain;
 		i2c-gpio,sda-open-drain;
 		i2c-gpio,scl-open-drain;
 		i2c-gpio,scl-open-drain;

+ 40 - 20
arch/arm/boot/dts/at91sam9x5.dtsi

@@ -143,6 +143,11 @@
 						atmel,pins =
 						atmel,pins =
 							<0 3 0x1 0x0>;	/* PA3 periph A */
 							<0 3 0x1 0x0>;	/* PA3 periph A */
 					};
 					};
+
+					pinctrl_usart0_sck: usart0_sck-0 {
+						atmel,pins =
+							<0 4 0x1 0x0>;	/* PA4 periph A */
+					};
 				};
 				};
 
 
 				usart1 {
 				usart1 {
@@ -154,12 +159,17 @@
 
 
 					pinctrl_usart1_rts: usart1_rts-0 {
 					pinctrl_usart1_rts: usart1_rts-0 {
 						atmel,pins =
 						atmel,pins =
-							<3 27 0x3 0x0>;	/* PC27 periph C */
+							<2 27 0x3 0x0>;	/* PC27 periph C */
 					};
 					};
 
 
 					pinctrl_usart1_cts: usart1_cts-0 {
 					pinctrl_usart1_cts: usart1_cts-0 {
 						atmel,pins =
 						atmel,pins =
-							<3 28 0x3 0x0>;	/* PC28 periph C */
+							<2 28 0x3 0x0>;	/* PC28 periph C */
+					};
+
+					pinctrl_usart1_sck: usart1_sck-0 {
+						atmel,pins =
+							<2 28 0x3 0x0>;	/* PC29 periph C */
 					};
 					};
 				};
 				};
 
 
@@ -172,46 +182,56 @@
 
 
 					pinctrl_uart2_rts: uart2_rts-0 {
 					pinctrl_uart2_rts: uart2_rts-0 {
 						atmel,pins =
 						atmel,pins =
-							<0 0 0x2 0x0>;	/* PB0 periph B */
+							<1 0 0x2 0x0>;	/* PB0 periph B */
 					};
 					};
 
 
 					pinctrl_uart2_cts: uart2_cts-0 {
 					pinctrl_uart2_cts: uart2_cts-0 {
 						atmel,pins =
 						atmel,pins =
-							<0 1 0x2 0x0>;	/* PB1 periph B */
+							<1 1 0x2 0x0>;	/* PB1 periph B */
+					};
+
+					pinctrl_usart2_sck: usart2_sck-0 {
+						atmel,pins =
+							<1 2 0x2 0x0>;	/* PB2 periph B */
 					};
 					};
 				};
 				};
 
 
 				usart3 {
 				usart3 {
 					pinctrl_uart3: usart3-0 {
 					pinctrl_uart3: usart3-0 {
 						atmel,pins =
 						atmel,pins =
-							<3 23 0x2 0x1	/* PC22 periph B with pullup */
-							 3 23 0x2 0x0>;	/* PC23 periph B */
+							<2 23 0x2 0x1	/* PC22 periph B with pullup */
+							 2 23 0x2 0x0>;	/* PC23 periph B */
 					};
 					};
 
 
 					pinctrl_usart3_rts: usart3_rts-0 {
 					pinctrl_usart3_rts: usart3_rts-0 {
 						atmel,pins =
 						atmel,pins =
-							<3 24 0x2 0x0>;	/* PC24 periph B */
+							<2 24 0x2 0x0>;	/* PC24 periph B */
 					};
 					};
 
 
 					pinctrl_usart3_cts: usart3_cts-0 {
 					pinctrl_usart3_cts: usart3_cts-0 {
 						atmel,pins =
 						atmel,pins =
-							<3 25 0x2 0x0>;	/* PC25 periph B */
+							<2 25 0x2 0x0>;	/* PC25 periph B */
+					};
+
+					pinctrl_usart3_sck: usart3_sck-0 {
+						atmel,pins =
+							<2 26 0x2 0x0>;	/* PC26 periph B */
 					};
 					};
 				};
 				};
 
 
 				uart0 {
 				uart0 {
 					pinctrl_uart0: uart0-0 {
 					pinctrl_uart0: uart0-0 {
 						atmel,pins =
 						atmel,pins =
-							<3 8 0x3 0x0	/* PC8 periph C */
-							 3 9 0x3 0x1>;	/* PC9 periph C with pullup */
+							<2 8 0x3 0x0	/* PC8 periph C */
+							 2 9 0x3 0x1>;	/* PC9 periph C with pullup */
 					};
 					};
 				};
 				};
 
 
 				uart1 {
 				uart1 {
 					pinctrl_uart1: uart1-0 {
 					pinctrl_uart1: uart1-0 {
 						atmel,pins =
 						atmel,pins =
-							<3 16 0x3 0x0	/* PC16 periph C */
-							 3 17 0x3 0x1>;	/* PC17 periph C with pullup */
+							<2 16 0x3 0x0	/* PC16 periph C */
+							 2 17 0x3 0x1>;	/* PC17 periph C with pullup */
 					};
 					};
 				};
 				};
 
 
@@ -240,14 +260,14 @@
 
 
 					pinctrl_macb0_rmii_mii: macb0_rmii_mii-0 {
 					pinctrl_macb0_rmii_mii: macb0_rmii_mii-0 {
 						atmel,pins =
 						atmel,pins =
-							<1 8 0x1 0x0	/* PA8 periph A */
-							 1 11 0x1 0x0	/* PA11 periph A */
-							 1 12 0x1 0x0	/* PA12 periph A */
-							 1 13 0x1 0x0	/* PA13 periph A */
-							 1 14 0x1 0x0	/* PA14 periph A */
-							 1 15 0x1 0x0	/* PA15 periph A */
-							 1 16 0x1 0x0	/* PA16 periph A */
-							 1 17 0x1 0x0>;	/* PA17 periph A */
+							<1 8 0x1 0x0	/* PB8 periph A */
+							 1 11 0x1 0x0	/* PB11 periph A */
+							 1 12 0x1 0x0	/* PB12 periph A */
+							 1 13 0x1 0x0	/* PB13 periph A */
+							 1 14 0x1 0x0	/* PB14 periph A */
+							 1 15 0x1 0x0	/* PB15 periph A */
+							 1 16 0x1 0x0	/* PB16 periph A */
+							 1 17 0x1 0x0>;	/* PB17 periph A */
 					};
 					};
 				};
 				};
 
 

+ 6 - 6
arch/arm/boot/dts/cros5250-common.dtsi

@@ -96,8 +96,8 @@
 		fifo-depth = <0x80>;
 		fifo-depth = <0x80>;
 		card-detect-delay = <200>;
 		card-detect-delay = <200>;
 		samsung,dw-mshc-ciu-div = <3>;
 		samsung,dw-mshc-ciu-div = <3>;
-		samsung,dw-mshc-sdr-timing = <2 3 3>;
-		samsung,dw-mshc-ddr-timing = <1 2 3>;
+		samsung,dw-mshc-sdr-timing = <2 3>;
+		samsung,dw-mshc-ddr-timing = <1 2>;
 
 
 		slot@0 {
 		slot@0 {
 			reg = <0>;
 			reg = <0>;
@@ -120,8 +120,8 @@
 		fifo-depth = <0x80>;
 		fifo-depth = <0x80>;
 		card-detect-delay = <200>;
 		card-detect-delay = <200>;
 		samsung,dw-mshc-ciu-div = <3>;
 		samsung,dw-mshc-ciu-div = <3>;
-		samsung,dw-mshc-sdr-timing = <2 3 3>;
-		samsung,dw-mshc-ddr-timing = <1 2 3>;
+		samsung,dw-mshc-sdr-timing = <2 3>;
+		samsung,dw-mshc-ddr-timing = <1 2>;
 
 
 		slot@0 {
 		slot@0 {
 			reg = <0>;
 			reg = <0>;
@@ -141,8 +141,8 @@
 		fifo-depth = <0x80>;
 		fifo-depth = <0x80>;
 		card-detect-delay = <200>;
 		card-detect-delay = <200>;
 		samsung,dw-mshc-ciu-div = <3>;
 		samsung,dw-mshc-ciu-div = <3>;
-		samsung,dw-mshc-sdr-timing = <2 3 3>;
-		samsung,dw-mshc-ddr-timing = <1 2 3>;
+		samsung,dw-mshc-sdr-timing = <2 3>;
+		samsung,dw-mshc-ddr-timing = <1 2>;
 
 
 		slot@0 {
 		slot@0 {
 			reg = <0>;
 			reg = <0>;

+ 12 - 2
arch/arm/boot/dts/dove-cubox.dts

@@ -26,10 +26,15 @@
 };
 };
 
 
 &uart0 { status = "okay"; };
 &uart0 { status = "okay"; };
-&sdio0 { status = "okay"; };
 &sata0 { status = "okay"; };
 &sata0 { status = "okay"; };
 &i2c0 { status = "okay"; };
 &i2c0 { status = "okay"; };
 
 
+&sdio0 {
+	status = "okay";
+	/* sdio0 card detect is connected to wrong pin on CuBox */
+	cd-gpios = <&gpio0 12 1>;
+};
+
 &spi0 {
 &spi0 {
 	status = "okay";
 	status = "okay";
 
 
@@ -42,9 +47,14 @@
 };
 };
 
 
 &pinctrl {
 &pinctrl {
-	pinctrl-0 = <&pmx_gpio_18>;
+	pinctrl-0 = <&pmx_gpio_12 &pmx_gpio_18>;
 	pinctrl-names = "default";
 	pinctrl-names = "default";
 
 
+	pmx_gpio_12: pmx-gpio-12 {
+		marvell,pins = "mpp12";
+		marvell,function = "gpio";
+	};
+
 	pmx_gpio_18: pmx-gpio-18 {
 	pmx_gpio_18: pmx-gpio-18 {
 		marvell,pins = "mpp18";
 		marvell,pins = "mpp18";
 		marvell,function = "gpio";
 		marvell,function = "gpio";

+ 4 - 4
arch/arm/boot/dts/exynos5250-smdk5250.dts

@@ -115,8 +115,8 @@
 		fifo-depth = <0x80>;
 		fifo-depth = <0x80>;
 		card-detect-delay = <200>;
 		card-detect-delay = <200>;
 		samsung,dw-mshc-ciu-div = <3>;
 		samsung,dw-mshc-ciu-div = <3>;
-		samsung,dw-mshc-sdr-timing = <2 3 3>;
-		samsung,dw-mshc-ddr-timing = <1 2 3>;
+		samsung,dw-mshc-sdr-timing = <2 3>;
+		samsung,dw-mshc-ddr-timing = <1 2>;
 
 
 		slot@0 {
 		slot@0 {
 			reg = <0>;
 			reg = <0>;
@@ -139,8 +139,8 @@
 		fifo-depth = <0x80>;
 		fifo-depth = <0x80>;
 		card-detect-delay = <200>;
 		card-detect-delay = <200>;
 		samsung,dw-mshc-ciu-div = <3>;
 		samsung,dw-mshc-ciu-div = <3>;
-		samsung,dw-mshc-sdr-timing = <2 3 3>;
-		samsung,dw-mshc-ddr-timing = <1 2 3>;
+		samsung,dw-mshc-sdr-timing = <2 3>;
+		samsung,dw-mshc-ddr-timing = <1 2>;
 
 
 		slot@0 {
 		slot@0 {
 			reg = <0>;
 			reg = <0>;

+ 16 - 0
arch/arm/boot/dts/kirkwood-ns2-common.dtsi

@@ -1,4 +1,5 @@
 /include/ "kirkwood.dtsi"
 /include/ "kirkwood.dtsi"
+/include/ "kirkwood-6281.dtsi"
 
 
 / {
 / {
 	chosen {
 	chosen {
@@ -6,6 +7,21 @@
 	};
 	};
 
 
 	ocp@f1000000 {
 	ocp@f1000000 {
+		pinctrl: pinctrl@10000 {
+			pinctrl-0 = < &pmx_spi &pmx_twsi0 &pmx_uart0
+					&pmx_ns2_sata0 &pmx_ns2_sata1>;
+			pinctrl-names = "default";
+
+			pmx_ns2_sata0: pmx-ns2-sata0 {
+				marvell,pins = "mpp21";
+				marvell,function = "sata0";
+			};
+			pmx_ns2_sata1: pmx-ns2-sata1 {
+				marvell,pins = "mpp20";
+				marvell,function = "sata1";
+			};
+		};
+
 		serial@12000 {
 		serial@12000 {
 			clock-frequency = <166666667>;
 			clock-frequency = <166666667>;
 			status = "okay";
 			status = "okay";

+ 2 - 0
arch/arm/boot/dts/kirkwood.dtsi

@@ -36,6 +36,7 @@
 			reg = <0x10100 0x40>;
 			reg = <0x10100 0x40>;
 			ngpios = <32>;
 			ngpios = <32>;
 			interrupt-controller;
 			interrupt-controller;
+			#interrupt-cells = <2>;
 			interrupts = <35>, <36>, <37>, <38>;
 			interrupts = <35>, <36>, <37>, <38>;
 		};
 		};
 
 
@@ -46,6 +47,7 @@
 			reg = <0x10140 0x40>;
 			reg = <0x10140 0x40>;
 			ngpios = <18>;
 			ngpios = <18>;
 			interrupt-controller;
 			interrupt-controller;
+			#interrupt-cells = <2>;
 			interrupts = <39>, <40>, <41>;
 			interrupts = <39>, <40>, <41>;
 		};
 		};
 
 

+ 2 - 0
arch/arm/boot/dts/kizbox.dts

@@ -48,6 +48,8 @@
 
 
 			macb0: ethernet@fffc4000 {
 			macb0: ethernet@fffc4000 {
 				phy-mode = "mii";
 				phy-mode = "mii";
+				pinctrl-0 = <&pinctrl_macb_rmii
+				             &pinctrl_macb_rmii_mii_alt>;
 				status = "okay";
 				status = "okay";
 			};
 			};
 
 

+ 4 - 2
arch/arm/boot/dts/sunxi.dtsi

@@ -60,19 +60,21 @@
 		};
 		};
 
 
 		uart0: uart@01c28000 {
 		uart0: uart@01c28000 {
-			compatible = "ns8250";
+			compatible = "snps,dw-apb-uart";
 			reg = <0x01c28000 0x400>;
 			reg = <0x01c28000 0x400>;
 			interrupts = <1>;
 			interrupts = <1>;
 			reg-shift = <2>;
 			reg-shift = <2>;
+			reg-io-width = <4>;
 			clock-frequency = <24000000>;
 			clock-frequency = <24000000>;
 			status = "disabled";
 			status = "disabled";
 		};
 		};
 
 
 		uart1: uart@01c28400 {
 		uart1: uart@01c28400 {
-			compatible = "ns8250";
+			compatible = "snps,dw-apb-uart";
 			reg = <0x01c28400 0x400>;
 			reg = <0x01c28400 0x400>;
 			interrupts = <2>;
 			interrupts = <2>;
 			reg-shift = <2>;
 			reg-shift = <2>;
+			reg-io-width = <4>;
 			clock-frequency = <24000000>;
 			clock-frequency = <24000000>;
 			status = "disabled";
 			status = "disabled";
 		};
 		};

+ 0 - 2
arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts

@@ -45,7 +45,6 @@
 			reg = <1>;
 			reg = <1>;
 		};
 		};
 
 
-/* A7s disabled till big.LITTLE patches are available...
 		cpu2: cpu@2 {
 		cpu2: cpu@2 {
 			device_type = "cpu";
 			device_type = "cpu";
 			compatible = "arm,cortex-a7";
 			compatible = "arm,cortex-a7";
@@ -63,7 +62,6 @@
 			compatible = "arm,cortex-a7";
 			compatible = "arm,cortex-a7";
 			reg = <0x102>;
 			reg = <0x102>;
 		};
 		};
-*/
 	};
 	};
 
 
 	memory@80000000 {
 	memory@80000000 {

+ 2 - 1
arch/arm/configs/at91_dt_defconfig

@@ -19,6 +19,7 @@ CONFIG_SOC_AT91SAM9260=y
 CONFIG_SOC_AT91SAM9263=y
 CONFIG_SOC_AT91SAM9263=y
 CONFIG_SOC_AT91SAM9G45=y
 CONFIG_SOC_AT91SAM9G45=y
 CONFIG_SOC_AT91SAM9X5=y
 CONFIG_SOC_AT91SAM9X5=y
+CONFIG_SOC_AT91SAM9N12=y
 CONFIG_MACH_AT91SAM_DT=y
 CONFIG_MACH_AT91SAM_DT=y
 CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
 CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
 CONFIG_AT91_TIMER_HZ=128
 CONFIG_AT91_TIMER_HZ=128
@@ -31,7 +32,7 @@ CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
-CONFIG_CMDLINE="mem=128M console=ttyS0,115200 initrd=0x21100000,25165824 root=/dev/ram0 rw"
+CONFIG_CMDLINE="console=ttyS0,115200 initrd=0x21100000,25165824 root=/dev/ram0 rw"
 CONFIG_KEXEC=y
 CONFIG_KEXEC=y
 CONFIG_AUTO_ZRELADDR=y
 CONFIG_AUTO_ZRELADDR=y
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set

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

@@ -100,12 +100,14 @@ ENTRY(printch)
 		b	1b
 		b	1b
 ENDPROC(printch)
 ENDPROC(printch)
 
 
+#ifdef CONFIG_MMU
 ENTRY(debug_ll_addr)
 ENTRY(debug_ll_addr)
 		addruart r2, r3, ip
 		addruart r2, r3, ip
 		str	r2, [r0]
 		str	r2, [r0]
 		str	r3, [r1]
 		str	r3, [r1]
 		mov	pc, lr
 		mov	pc, lr
 ENDPROC(debug_ll_addr)
 ENDPROC(debug_ll_addr)
+#endif
 
 
 #else
 #else
 
 

+ 4 - 1
arch/arm/kernel/head.S

@@ -246,6 +246,7 @@ __create_page_tables:
 
 
 	/*
 	/*
 	 * Then map boot params address in r2 if specified.
 	 * Then map boot params address in r2 if specified.
+	 * We map 2 sections in case the ATAGs/DTB crosses a section boundary.
 	 */
 	 */
 	mov	r0, r2, lsr #SECTION_SHIFT
 	mov	r0, r2, lsr #SECTION_SHIFT
 	movs	r0, r0, lsl #SECTION_SHIFT
 	movs	r0, r0, lsl #SECTION_SHIFT
@@ -253,6 +254,8 @@ __create_page_tables:
 	addne	r3, r3, #PAGE_OFFSET
 	addne	r3, r3, #PAGE_OFFSET
 	addne	r3, r4, r3, lsr #(SECTION_SHIFT - PMD_ORDER)
 	addne	r3, r4, r3, lsr #(SECTION_SHIFT - PMD_ORDER)
 	orrne	r6, r7, r0
 	orrne	r6, r7, r0
+	strne	r6, [r3], #1 << PMD_ORDER
+	addne	r6, r6, #1 << SECTION_SHIFT
 	strne	r6, [r3]
 	strne	r6, [r3]
 
 
 #ifdef CONFIG_DEBUG_LL
 #ifdef CONFIG_DEBUG_LL
@@ -331,7 +334,7 @@ ENTRY(secondary_startup)
 	 * as it has already been validated by the primary processor.
 	 * as it has already been validated by the primary processor.
 	 */
 	 */
 #ifdef CONFIG_ARM_VIRT_EXT
 #ifdef CONFIG_ARM_VIRT_EXT
-	bl	__hyp_stub_install
+	bl	__hyp_stub_install_secondary
 #endif
 #endif
 	safe_svcmode_maskall r9
 	safe_svcmode_maskall r9
 
 

+ 6 - 12
arch/arm/kernel/hyp-stub.S

@@ -99,7 +99,7 @@ ENTRY(__hyp_stub_install_secondary)
 	 * immediately.
 	 * immediately.
 	 */
 	 */
 	compare_cpu_mode_with_primary	r4, r5, r6, r7
 	compare_cpu_mode_with_primary	r4, r5, r6, r7
-	bxne	lr
+	movne	pc, lr
 
 
 	/*
 	/*
 	 * Once we have given up on one CPU, we do not try to install the
 	 * Once we have given up on one CPU, we do not try to install the
@@ -111,7 +111,7 @@ ENTRY(__hyp_stub_install_secondary)
 	 */
 	 */
 
 
 	cmp	r4, #HYP_MODE
 	cmp	r4, #HYP_MODE
-	bxne	lr			@ give up if the CPU is not in HYP mode
+	movne	pc, lr			@ give up if the CPU is not in HYP mode
 
 
 /*
 /*
  * Configure HSCTLR to set correct exception endianness/instruction set
  * Configure HSCTLR to set correct exception endianness/instruction set
@@ -120,7 +120,8 @@ ENTRY(__hyp_stub_install_secondary)
  * Eventually, CPU-specific code might be needed -- assume not for now
  * Eventually, CPU-specific code might be needed -- assume not for now
  *
  *
  * This code relies on the "eret" instruction to synchronize the
  * This code relies on the "eret" instruction to synchronize the
- * various coprocessor accesses.
+ * various coprocessor accesses. This is done when we switch to SVC
+ * (see safe_svcmode_maskall).
  */
  */
 	@ Now install the hypervisor stub:
 	@ Now install the hypervisor stub:
 	adr	r7, __hyp_stub_vectors
 	adr	r7, __hyp_stub_vectors
@@ -155,14 +156,7 @@ THUMB(	orr	r7, #(1 << 30)	)	@ HSCTLR.TE
 1:
 1:
 #endif
 #endif
 
 
-	bic	r7, r4, #MODE_MASK
-	orr	r7, r7, #SVC_MODE
-THUMB(	orr	r7, r7, #PSR_T_BIT	)
-	msr	spsr_cxsf, r7		@ This is SPSR_hyp.
-
-	__MSR_ELR_HYP(14)		@ msr elr_hyp, lr
-	__ERET				@ return, switching to SVC mode
-					@ The boot CPU mode is left in r4.
+	bx	lr			@ The boot CPU mode is left in r4.
 ENDPROC(__hyp_stub_install_secondary)
 ENDPROC(__hyp_stub_install_secondary)
 
 
 __hyp_stub_do_trap:
 __hyp_stub_do_trap:
@@ -200,7 +194,7 @@ ENDPROC(__hyp_get_vectors)
 	@ fall through
 	@ fall through
 ENTRY(__hyp_set_vectors)
 ENTRY(__hyp_set_vectors)
 	__HVC(0)
 	__HVC(0)
-	bx	lr
+	mov	pc, lr
 ENDPROC(__hyp_set_vectors)
 ENDPROC(__hyp_set_vectors)
 
 
 #ifndef ZIMAGE
 #ifndef ZIMAGE

+ 2 - 0
arch/arm/mach-at91/setup.c

@@ -105,6 +105,8 @@ static void __init soc_detect(u32 dbgu_base)
 	switch (socid) {
 	switch (socid) {
 	case ARCH_ID_AT91RM9200:
 	case ARCH_ID_AT91RM9200:
 		at91_soc_initdata.type = AT91_SOC_RM9200;
 		at91_soc_initdata.type = AT91_SOC_RM9200;
+		if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_NONE)
+			at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA;
 		at91_boot_soc = at91rm9200_soc;
 		at91_boot_soc = at91rm9200_soc;
 		break;
 		break;
 
 

+ 1 - 0
arch/arm/mach-imx/Kconfig

@@ -851,6 +851,7 @@ config SOC_IMX6Q
 	select HAVE_CAN_FLEXCAN if CAN
 	select HAVE_CAN_FLEXCAN if CAN
 	select HAVE_IMX_GPC
 	select HAVE_IMX_GPC
 	select HAVE_IMX_MMDC
 	select HAVE_IMX_MMDC
+	select HAVE_IMX_SRC
 	select HAVE_SMP
 	select HAVE_SMP
 	select MFD_SYSCON
 	select MFD_SYSCON
 	select PINCTRL
 	select PINCTRL

+ 3 - 0
arch/arm/mach-imx/clk-imx6q.c

@@ -436,6 +436,9 @@ int __init mx6q_clocks_init(void)
 	for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
 	for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
 		clk_prepare_enable(clk[clks_init_on[i]]);
 		clk_prepare_enable(clk[clks_init_on[i]]);
 
 
+	/* Set initial power mode */
+	imx6q_set_lpm(WAIT_CLOCKED);
+
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpt");
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpt");
 	base = of_iomap(np, 0);
 	base = of_iomap(np, 0);
 	WARN_ON(!base);
 	WARN_ON(!base);

+ 1 - 0
arch/arm/mach-imx/common.h

@@ -142,6 +142,7 @@ extern int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode);
 extern void imx6q_clock_map_io(void);
 extern void imx6q_clock_map_io(void);
 
 
 extern void imx_cpu_die(unsigned int cpu);
 extern void imx_cpu_die(unsigned int cpu);
+extern int imx_cpu_kill(unsigned int cpu);
 
 
 #ifdef CONFIG_PM
 #ifdef CONFIG_PM
 extern void imx6q_pm_init(void);
 extern void imx6q_pm_init(void);

+ 1 - 1
arch/arm/mach-imx/devices/platform-imx-fb.c

@@ -54,7 +54,7 @@ struct platform_device *__init imx_add_imx_fb(
 			.flags = IORESOURCE_IRQ,
 			.flags = IORESOURCE_IRQ,
 		},
 		},
 	};
 	};
-	return imx_add_platform_device_dmamask("imx-fb", 0,
+	return imx_add_platform_device_dmamask(data->devid, 0,
 			res, ARRAY_SIZE(res),
 			res, ARRAY_SIZE(res),
 			pdata, sizeof(*pdata), DMA_BIT_MASK(32));
 			pdata, sizeof(*pdata), DMA_BIT_MASK(32));
 }
 }

+ 6 - 4
arch/arm/mach-imx/hotplug.c

@@ -46,9 +46,11 @@ static inline void cpu_enter_lowpower(void)
 void imx_cpu_die(unsigned int cpu)
 void imx_cpu_die(unsigned int cpu)
 {
 {
 	cpu_enter_lowpower();
 	cpu_enter_lowpower();
-	imx_enable_cpu(cpu, false);
+	cpu_do_idle();
+}
 
 
-	/* spin here until hardware takes it down */
-	while (1)
-		;
+int imx_cpu_kill(unsigned int cpu)
+{
+	imx_enable_cpu(cpu, false);
+	return 1;
 }
 }

+ 1 - 2
arch/arm/mach-imx/iram_alloc.c

@@ -22,8 +22,7 @@
 #include <linux/module.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/spinlock.h>
 #include <linux/genalloc.h>
 #include <linux/genalloc.h>
-
-#include "iram.h"
+#include "linux/platform_data/imx-iram.h"
 
 
 static unsigned long iram_phys_base;
 static unsigned long iram_phys_base;
 static void __iomem *iram_virt_base;
 static void __iomem *iram_virt_base;

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

@@ -92,5 +92,6 @@ struct smp_operations  imx_smp_ops __initdata = {
 	.smp_boot_secondary	= imx_boot_secondary,
 	.smp_boot_secondary	= imx_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
 #ifdef CONFIG_HOTPLUG_CPU
 	.cpu_die		= imx_cpu_die,
 	.cpu_die		= imx_cpu_die,
+	.cpu_kill		= imx_cpu_kill,
 #endif
 #endif
 };
 };

+ 1 - 0
arch/arm/mach-imx/pm-imx6q.c

@@ -41,6 +41,7 @@ static int imx6q_pm_enter(suspend_state_t state)
 		cpu_suspend(0, imx6q_suspend_finish);
 		cpu_suspend(0, imx6q_suspend_finish);
 		imx_smp_prepare();
 		imx_smp_prepare();
 		imx_gpc_post_resume();
 		imx_gpc_post_resume();
+		imx6q_set_lpm(WAIT_CLOCKED);
 		break;
 		break;
 	default:
 	default:
 		return -EINVAL;
 		return -EINVAL;

+ 10 - 4
arch/arm/mach-integrator/pci_v3.c

@@ -475,13 +475,12 @@ int __init pci_v3_setup(int nr, struct pci_sys_data *sys)
 {
 {
 	int ret = 0;
 	int ret = 0;
 
 
+	if (!ap_syscon_base)
+		return -EINVAL;
+
 	if (nr == 0) {
 	if (nr == 0) {
 		sys->mem_offset = PHYS_PCI_MEM_BASE;
 		sys->mem_offset = PHYS_PCI_MEM_BASE;
 		ret = pci_v3_setup_resources(sys);
 		ret = pci_v3_setup_resources(sys);
-		/* Remap the Integrator system controller */
-		ap_syscon_base = ioremap(INTEGRATOR_SC_BASE, 0x100);
-		if (!ap_syscon_base)
-			return -EINVAL;
 	}
 	}
 
 
 	return ret;
 	return ret;
@@ -497,6 +496,13 @@ void __init pci_v3_preinit(void)
 	unsigned int temp;
 	unsigned int temp;
 	int ret;
 	int ret;
 
 
+	/* Remap the Integrator system controller */
+	ap_syscon_base = ioremap(INTEGRATOR_SC_BASE, 0x100);
+	if (!ap_syscon_base) {
+		pr_err("unable to remap the AP syscon for PCIv3\n");
+		return;
+	}
+
 	pcibios_min_mem = 0x00100000;
 	pcibios_min_mem = 0x00100000;
 
 
 	/*
 	/*

+ 0 - 38
arch/arm/mach-kirkwood/board-ns2.c

@@ -18,47 +18,11 @@
 #include <linux/gpio.h>
 #include <linux/gpio.h>
 #include <linux/of.h>
 #include <linux/of.h>
 #include "common.h"
 #include "common.h"
-#include "mpp.h"
 
 
 static struct mv643xx_eth_platform_data ns2_ge00_data = {
 static struct mv643xx_eth_platform_data ns2_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
 };
 };
 
 
-static unsigned int ns2_mpp_config[] __initdata = {
-	MPP0_SPI_SCn,
-	MPP1_SPI_MOSI,
-	MPP2_SPI_SCK,
-	MPP3_SPI_MISO,
-	MPP4_NF_IO6,
-	MPP5_NF_IO7,
-	MPP6_SYSRST_OUTn,
-	MPP7_GPO,		/* Fan speed (bit 1) */
-	MPP8_TW0_SDA,
-	MPP9_TW0_SCK,
-	MPP10_UART0_TXD,
-	MPP11_UART0_RXD,
-	MPP12_GPO,		/* Red led */
-	MPP14_GPIO,		/* USB fuse */
-	MPP16_GPIO,		/* SATA 0 power */
-	MPP17_GPIO,		/* SATA 1 power */
-	MPP18_NF_IO0,
-	MPP19_NF_IO1,
-	MPP20_SATA1_ACTn,
-	MPP21_SATA0_ACTn,
-	MPP22_GPIO,		/* Fan speed (bit 0) */
-	MPP23_GPIO,		/* Fan power */
-	MPP24_GPIO,		/* USB mode select */
-	MPP25_GPIO,		/* Fan rotation fail */
-	MPP26_GPIO,		/* USB device vbus */
-	MPP28_GPIO,		/* USB enable host vbus */
-	MPP29_GPIO,		/* Blue led (slow register) */
-	MPP30_GPIO,		/* Blue led (command register) */
-	MPP31_GPIO,		/* Board power off */
-	MPP32_GPIO,		/* Power button (0 = Released, 1 = Pushed) */
-	MPP33_GPO,		/* Fan speed (bit 2) */
-	0
-};
-
 #define NS2_GPIO_POWER_OFF	31
 #define NS2_GPIO_POWER_OFF	31
 
 
 static void ns2_power_off(void)
 static void ns2_power_off(void)
@@ -71,8 +35,6 @@ void __init ns2_init(void)
 	/*
 	/*
 	 * Basic setup. Needs to be called early.
 	 * Basic setup. Needs to be called early.
 	 */
 	 */
-	kirkwood_mpp_conf(ns2_mpp_config);
-
 	if (of_machine_is_compatible("lacie,netspace_lite_v2") ||
 	if (of_machine_is_compatible("lacie,netspace_lite_v2") ||
 	    of_machine_is_compatible("lacie,netspace_mini_v2"))
 	    of_machine_is_compatible("lacie,netspace_mini_v2"))
 		ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
 		ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);

+ 2 - 0
arch/arm/mach-mvebu/Makefile

@@ -1,6 +1,8 @@
 ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
 ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
 	-I$(srctree)/arch/arm/plat-orion/include
 	-I$(srctree)/arch/arm/plat-orion/include
 
 
+AFLAGS_coherency_ll.o		:= -Wa,-march=armv7-a
+
 obj-y += system-controller.o
 obj-y += system-controller.o
 obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o irq-armada-370-xp.o addr-map.o coherency.o coherency_ll.o pmsu.o
 obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o irq-armada-370-xp.o addr-map.o coherency.o coherency_ll.o pmsu.o
 obj-$(CONFIG_SMP)                += platsmp.o headsmp.o
 obj-$(CONFIG_SMP)                += platsmp.o headsmp.o

+ 6 - 0
arch/arm/mach-omap2/board-omap4panda.c

@@ -397,6 +397,12 @@ static struct omap_board_mux board_mux[] __initdata = {
 		  OMAP_PULL_ENA),
 		  OMAP_PULL_ENA),
 	OMAP4_MUX(ABE_MCBSP1_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
 	OMAP4_MUX(ABE_MCBSP1_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
 
 
+	/* UART2 - BT/FM/GPS shared transport */
+	OMAP4_MUX(UART2_CTS,	OMAP_PIN_INPUT	| OMAP_MUX_MODE0),
+	OMAP4_MUX(UART2_RTS,	OMAP_PIN_OUTPUT	| OMAP_MUX_MODE0),
+	OMAP4_MUX(UART2_RX,	OMAP_PIN_INPUT	| OMAP_MUX_MODE0),
+	OMAP4_MUX(UART2_TX,	OMAP_PIN_OUTPUT	| OMAP_MUX_MODE0),
+
 	{ .reg_offset = OMAP_MUX_TERMINATOR },
 	{ .reg_offset = OMAP_MUX_TERMINATOR },
 };
 };
 
 

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

@@ -1935,6 +1935,8 @@ int __init omap2420_clk_init(void)
 			omap2_init_clk_hw_omap_clocks(c->lk.clk);
 			omap2_init_clk_hw_omap_clocks(c->lk.clk);
 	}
 	}
 
 
+	omap2xxx_clkt_vps_late_init();
+
 	omap2_clk_disable_autoidle_all();
 	omap2_clk_disable_autoidle_all();
 
 
 	omap2_clk_enable_init_clocks(enable_init_clks,
 	omap2_clk_enable_init_clocks(enable_init_clks,

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

@@ -2050,6 +2050,8 @@ int __init omap2430_clk_init(void)
 			omap2_init_clk_hw_omap_clocks(c->lk.clk);
 			omap2_init_clk_hw_omap_clocks(c->lk.clk);
 	}
 	}
 
 
+	omap2xxx_clkt_vps_late_init();
+
 	omap2_clk_disable_autoidle_all();
 	omap2_clk_disable_autoidle_all();
 
 
 	omap2_clk_enable_init_clocks(enable_init_clks,
 	omap2_clk_enable_init_clocks(enable_init_clks,

+ 6 - 7
arch/arm/mach-omap2/cclock44xx_data.c

@@ -2026,14 +2026,13 @@ int __init omap4xxx_clk_init(void)
 	 * On OMAP4460 the ABE DPLL fails to turn on if in idle low-power
 	 * On OMAP4460 the ABE DPLL fails to turn on if in idle low-power
 	 * state when turning the ABE clock domain. Workaround this by
 	 * state when turning the ABE clock domain. Workaround this by
 	 * locking the ABE DPLL on boot.
 	 * locking the ABE DPLL on boot.
+	 * Lock the ABE DPLL in any case to avoid issues with audio.
 	 */
 	 */
-	if (cpu_is_omap446x()) {
-		rc = clk_set_parent(&abe_dpll_refclk_mux_ck, &sys_32k_ck);
-		if (!rc)
-			rc = clk_set_rate(&dpll_abe_ck, OMAP4_DPLL_ABE_DEFFREQ);
-		if (rc)
-			pr_err("%s: failed to configure ABE DPLL!\n", __func__);
-	}
+	rc = clk_set_parent(&abe_dpll_refclk_mux_ck, &sys_32k_ck);
+	if (!rc)
+		rc = clk_set_rate(&dpll_abe_ck, OMAP4_DPLL_ABE_DEFFREQ);
+	if (rc)
+		pr_err("%s: failed to configure ABE DPLL!\n", __func__);
 
 
 	return 0;
 	return 0;
 }
 }

+ 1 - 1
arch/arm/mach-omap2/devices.c

@@ -639,7 +639,7 @@ static int count_ocp2scp_devices(struct omap_ocp2scp_dev *ocp2scp_dev)
 	return cnt;
 	return cnt;
 }
 }
 
 
-static void omap_init_ocp2scp(void)
+static void __init omap_init_ocp2scp(void)
 {
 {
 	struct omap_hwmod	*oh;
 	struct omap_hwmod	*oh;
 	struct platform_device	*pdev;
 	struct platform_device	*pdev;

+ 2 - 1
arch/arm/mach-omap2/drm.c

@@ -25,6 +25,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/dma-mapping.h>
 #include <linux/platform_data/omap_drm.h>
 #include <linux/platform_data/omap_drm.h>
 
 
+#include "soc.h"
 #include "omap_device.h"
 #include "omap_device.h"
 #include "omap_hwmod.h"
 #include "omap_hwmod.h"
 
 
@@ -56,7 +57,7 @@ static int __init omap_init_drm(void)
 			oh->name);
 			oh->name);
 	}
 	}
 
 
-	platform_data.omaprev = GET_OMAP_REVISION();
+	platform_data.omaprev = GET_OMAP_TYPE;
 
 
 	return platform_device_register(&omap_drm_device);
 	return platform_device_register(&omap_drm_device);
 
 

+ 5 - 1
arch/arm/mach-omap2/omap_hwmod_44xx_data.c

@@ -2132,8 +2132,12 @@ static struct omap_hwmod omap44xx_mcpdm_hwmod = {
 	 * currently reset very early during boot, before I2C is
 	 * currently reset very early during boot, before I2C is
 	 * available, so it doesn't seem that we have any choice in
 	 * available, so it doesn't seem that we have any choice in
 	 * the kernel other than to avoid resetting it.
 	 * the kernel other than to avoid resetting it.
+	 *
+	 * Also, McPDM needs to be configured to NO_IDLE mode when it
+	 * is in used otherwise vital clocks will be gated which
+	 * results 'slow motion' audio playback.
 	 */
 	 */
-	.flags		= HWMOD_EXT_OPT_MAIN_CLK,
+	.flags		= HWMOD_EXT_OPT_MAIN_CLK | HWMOD_SWSUP_SIDLE,
 	.mpu_irqs	= omap44xx_mcpdm_irqs,
 	.mpu_irqs	= omap44xx_mcpdm_irqs,
 	.sdma_reqs	= omap44xx_mcpdm_sdma_reqs,
 	.sdma_reqs	= omap44xx_mcpdm_sdma_reqs,
 	.main_clk	= "mcpdm_fck",
 	.main_clk	= "mcpdm_fck",

+ 2 - 6
arch/arm/mach-omap2/timer.c

@@ -165,15 +165,11 @@ static struct device_node * __init omap_get_timer_dt(struct of_device_id *match,
 	struct device_node *np;
 	struct device_node *np;
 
 
 	for_each_matching_node(np, match) {
 	for_each_matching_node(np, match) {
-		if (!of_device_is_available(np)) {
-			of_node_put(np);
+		if (!of_device_is_available(np))
 			continue;
 			continue;
-		}
 
 
-		if (property && !of_get_property(np, property, NULL)) {
-			of_node_put(np);
+		if (property && !of_get_property(np, property, NULL))
 			continue;
 			continue;
-		}
 
 
 		of_add_property(np, &device_disabled);
 		of_add_property(np, &device_disabled);
 		return np;
 		return np;

+ 1 - 1
arch/arm/mach-s3c64xx/mach-crag6410-module.c

@@ -47,7 +47,7 @@ static struct spi_board_info wm1253_devs[] = {
 		.bus_num	= 0,
 		.bus_num	= 0,
 		.chip_select	= 0,
 		.chip_select	= 0,
 		.mode		= SPI_MODE_0,
 		.mode		= SPI_MODE_0,
-		.irq		= S3C_EINT(5),
+		.irq		= S3C_EINT(4),
 		.controller_data = &wm0010_spi_csinfo,
 		.controller_data = &wm0010_spi_csinfo,
 		.platform_data = &wm0010_pdata,
 		.platform_data = &wm0010_pdata,
 	},
 	},

+ 2 - 0
arch/arm/mach-s3c64xx/pm.c

@@ -338,8 +338,10 @@ int __init s3c64xx_pm_init(void)
 	for (i = 0; i < ARRAY_SIZE(s3c64xx_pm_domains); i++)
 	for (i = 0; i < ARRAY_SIZE(s3c64xx_pm_domains); i++)
 		pm_genpd_init(&s3c64xx_pm_domains[i]->pd, NULL, false);
 		pm_genpd_init(&s3c64xx_pm_domains[i]->pd, NULL, false);
 
 
+#ifdef CONFIG_S3C_DEV_FB
 	if (dev_get_platdata(&s3c_device_fb.dev))
 	if (dev_get_platdata(&s3c_device_fb.dev))
 		pm_genpd_add_device(&s3c64xx_pm_f.pd, &s3c_device_fb.dev);
 		pm_genpd_add_device(&s3c64xx_pm_f.pd, &s3c_device_fb.dev);
+#endif
 
 
 	return 0;
 	return 0;
 }
 }

+ 10 - 8
arch/arm/mm/dma-mapping.c

@@ -774,25 +774,27 @@ static void dma_cache_maint_page(struct page *page, unsigned long offset,
 	size_t size, enum dma_data_direction dir,
 	size_t size, enum dma_data_direction dir,
 	void (*op)(const void *, size_t, int))
 	void (*op)(const void *, size_t, int))
 {
 {
+	unsigned long pfn;
+	size_t left = size;
+
+	pfn = page_to_pfn(page) + offset / PAGE_SIZE;
+	offset %= PAGE_SIZE;
+
 	/*
 	/*
 	 * A single sg entry may refer to multiple physically contiguous
 	 * A single sg entry may refer to multiple physically contiguous
 	 * pages.  But we still need to process highmem pages individually.
 	 * pages.  But we still need to process highmem pages individually.
 	 * If highmem is not configured then the bulk of this loop gets
 	 * If highmem is not configured then the bulk of this loop gets
 	 * optimized out.
 	 * optimized out.
 	 */
 	 */
-	size_t left = size;
 	do {
 	do {
 		size_t len = left;
 		size_t len = left;
 		void *vaddr;
 		void *vaddr;
 
 
+		page = pfn_to_page(pfn);
+
 		if (PageHighMem(page)) {
 		if (PageHighMem(page)) {
-			if (len + offset > PAGE_SIZE) {
-				if (offset >= PAGE_SIZE) {
-					page += offset / PAGE_SIZE;
-					offset %= PAGE_SIZE;
-				}
+			if (len + offset > PAGE_SIZE)
 				len = PAGE_SIZE - offset;
 				len = PAGE_SIZE - offset;
-			}
 			vaddr = kmap_high_get(page);
 			vaddr = kmap_high_get(page);
 			if (vaddr) {
 			if (vaddr) {
 				vaddr += offset;
 				vaddr += offset;
@@ -809,7 +811,7 @@ static void dma_cache_maint_page(struct page *page, unsigned long offset,
 			op(vaddr, len, dir);
 			op(vaddr, len, dir);
 		}
 		}
 		offset = 0;
 		offset = 0;
-		page++;
+		pfn++;
 		left -= len;
 		left -= len;
 	} while (left);
 	} while (left);
 }
 }

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

@@ -283,7 +283,7 @@ static struct mem_type mem_types[] = {
 	},
 	},
 	[MT_MEMORY_SO] = {
 	[MT_MEMORY_SO] = {
 		.prot_pte  = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
 		.prot_pte  = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
-				L_PTE_MT_UNCACHED,
+				L_PTE_MT_UNCACHED | L_PTE_XN,
 		.prot_l1   = PMD_TYPE_TABLE,
 		.prot_l1   = PMD_TYPE_TABLE,
 		.prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_S |
 		.prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_S |
 				PMD_SECT_UNCACHED | PMD_SECT_XN,
 				PMD_SECT_UNCACHED | PMD_SECT_XN,

+ 1 - 1
arch/arm/plat-versatile/headsmp.S

@@ -20,7 +20,7 @@
  */
  */
 ENTRY(versatile_secondary_startup)
 ENTRY(versatile_secondary_startup)
 	mrc	p15, 0, r0, c0, c0, 5
 	mrc	p15, 0, r0, c0, c0, 5
-	and	r0, r0, #15
+	bic	r0, #0xff000000
 	adr	r4, 1f
 	adr	r4, 1f
 	ldmia	r4, {r5, r6}
 	ldmia	r4, {r5, r6}
 	sub	r4, r4, r5
 	sub	r4, r4, r5

+ 3 - 3
arch/arm/vfp/entry.S

@@ -22,7 +22,7 @@
 @  IRQs disabled.
 @  IRQs disabled.
 @
 @
 ENTRY(do_vfp)
 ENTRY(do_vfp)
-#ifdef CONFIG_PREEMPT
+#ifdef CONFIG_PREEMPT_COUNT
 	ldr	r4, [r10, #TI_PREEMPT]	@ get preempt count
 	ldr	r4, [r10, #TI_PREEMPT]	@ get preempt count
 	add	r11, r4, #1		@ increment it
 	add	r11, r4, #1		@ increment it
 	str	r11, [r10, #TI_PREEMPT]
 	str	r11, [r10, #TI_PREEMPT]
@@ -35,7 +35,7 @@ ENTRY(do_vfp)
 ENDPROC(do_vfp)
 ENDPROC(do_vfp)
 
 
 ENTRY(vfp_null_entry)
 ENTRY(vfp_null_entry)
-#ifdef CONFIG_PREEMPT
+#ifdef CONFIG_PREEMPT_COUNT
 	get_thread_info	r10
 	get_thread_info	r10
 	ldr	r4, [r10, #TI_PREEMPT]	@ get preempt count
 	ldr	r4, [r10, #TI_PREEMPT]	@ get preempt count
 	sub	r11, r4, #1		@ decrement it
 	sub	r11, r4, #1		@ decrement it
@@ -53,7 +53,7 @@ ENDPROC(vfp_null_entry)
 
 
 	__INIT
 	__INIT
 ENTRY(vfp_testing_entry)
 ENTRY(vfp_testing_entry)
-#ifdef CONFIG_PREEMPT
+#ifdef CONFIG_PREEMPT_COUNT
 	get_thread_info	r10
 	get_thread_info	r10
 	ldr	r4, [r10, #TI_PREEMPT]	@ get preempt count
 	ldr	r4, [r10, #TI_PREEMPT]	@ get preempt count
 	sub	r11, r4, #1		@ decrement it
 	sub	r11, r4, #1		@ decrement it

+ 2 - 2
arch/arm/vfp/vfphw.S

@@ -168,7 +168,7 @@ vfp_hw_state_valid:
 					@ else it's one 32-bit instruction, so
 					@ else it's one 32-bit instruction, so
 					@ always subtract 4 from the following
 					@ always subtract 4 from the following
 					@ instruction address.
 					@ instruction address.
-#ifdef CONFIG_PREEMPT
+#ifdef CONFIG_PREEMPT_COUNT
 	get_thread_info	r10
 	get_thread_info	r10
 	ldr	r4, [r10, #TI_PREEMPT]	@ get preempt count
 	ldr	r4, [r10, #TI_PREEMPT]	@ get preempt count
 	sub	r11, r4, #1		@ decrement it
 	sub	r11, r4, #1		@ decrement it
@@ -192,7 +192,7 @@ look_for_VFP_exceptions:
 	@ not recognised by VFP
 	@ not recognised by VFP
 
 
 	DBGSTR	"not VFP"
 	DBGSTR	"not VFP"
-#ifdef CONFIG_PREEMPT
+#ifdef CONFIG_PREEMPT_COUNT
 	get_thread_info	r10
 	get_thread_info	r10
 	ldr	r4, [r10, #TI_PREEMPT]	@ get preempt count
 	ldr	r4, [r10, #TI_PREEMPT]	@ get preempt count
 	sub	r11, r4, #1		@ decrement it
 	sub	r11, r4, #1		@ decrement it

+ 2 - 0
arch/powerpc/kernel/entry_32.S

@@ -439,6 +439,8 @@ ret_from_fork:
 ret_from_kernel_thread:
 ret_from_kernel_thread:
 	REST_NVGPRS(r1)
 	REST_NVGPRS(r1)
 	bl	schedule_tail
 	bl	schedule_tail
+	li	r3,0
+	stw	r3,0(r1)
 	mtlr	r14
 	mtlr	r14
 	mr	r3,r15
 	mr	r3,r15
 	PPC440EP_ERR42
 	PPC440EP_ERR42

+ 13 - 0
arch/powerpc/kernel/entry_64.S

@@ -664,6 +664,19 @@ resume_kernel:
 	ld	r4,TI_FLAGS(r9)
 	ld	r4,TI_FLAGS(r9)
 	andi.	r0,r4,_TIF_NEED_RESCHED
 	andi.	r0,r4,_TIF_NEED_RESCHED
 	bne	1b
 	bne	1b
+
+	/*
+	 * arch_local_irq_restore() from preempt_schedule_irq above may
+	 * enable hard interrupt but we really should disable interrupts
+	 * when we return from the interrupt, and so that we don't get
+	 * interrupted after loading SRR0/1.
+	 */
+#ifdef CONFIG_PPC_BOOK3E
+	wrteei	0
+#else
+	ld	r10,PACAKMSR(r13) /* Get kernel MSR without EE */
+	mtmsrd	r10,1		  /* Update machine state */
+#endif /* CONFIG_PPC_BOOK3E */
 #endif /* CONFIG_PREEMPT */
 #endif /* CONFIG_PREEMPT */
 
 
 	.globl	fast_exc_return_irq
 	.globl	fast_exc_return_irq

+ 3 - 2
arch/powerpc/kernel/kgdb.c

@@ -154,12 +154,12 @@ static int kgdb_handle_breakpoint(struct pt_regs *regs)
 static int kgdb_singlestep(struct pt_regs *regs)
 static int kgdb_singlestep(struct pt_regs *regs)
 {
 {
 	struct thread_info *thread_info, *exception_thread_info;
 	struct thread_info *thread_info, *exception_thread_info;
-	struct thread_info *backup_current_thread_info = \
-		(struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL);
+	struct thread_info *backup_current_thread_info;
 
 
 	if (user_mode(regs))
 	if (user_mode(regs))
 		return 0;
 		return 0;
 
 
+	backup_current_thread_info = (struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL);
 	/*
 	/*
 	 * On Book E and perhaps other processors, singlestep is handled on
 	 * On Book E and perhaps other processors, singlestep is handled on
 	 * the critical exception stack.  This causes current_thread_info()
 	 * the critical exception stack.  This causes current_thread_info()
@@ -185,6 +185,7 @@ static int kgdb_singlestep(struct pt_regs *regs)
 		/* Restore current_thread_info lastly. */
 		/* Restore current_thread_info lastly. */
 		memcpy(exception_thread_info, backup_current_thread_info, sizeof *thread_info);
 		memcpy(exception_thread_info, backup_current_thread_info, sizeof *thread_info);
 
 
+	kfree(backup_current_thread_info);
 	return 1;
 	return 1;
 }
 }
 
 

+ 7 - 2
arch/powerpc/kernel/time.c

@@ -494,10 +494,15 @@ void timer_interrupt(struct pt_regs * regs)
 	set_dec(DECREMENTER_MAX);
 	set_dec(DECREMENTER_MAX);
 
 
 	/* Some implementations of hotplug will get timer interrupts while
 	/* Some implementations of hotplug will get timer interrupts while
-	 * offline, just ignore these
+	 * offline, just ignore these and we also need to set
+	 * decrementers_next_tb as MAX to make sure __check_irq_replay
+	 * don't replay timer interrupt when return, otherwise we'll trap
+	 * here infinitely :(
 	 */
 	 */
-	if (!cpu_online(smp_processor_id()))
+	if (!cpu_online(smp_processor_id())) {
+		*next_tb = ~(u64)0;
 		return;
 		return;
+	}
 
 
 	/* Conditionally hard-enable interrupts now that the DEC has been
 	/* Conditionally hard-enable interrupts now that the DEC has been
 	 * bumped to its maximum value
 	 * bumped to its maximum value

+ 2 - 0
arch/powerpc/kvm/emulate.c

@@ -39,6 +39,7 @@
 #define OP_31_XOP_TRAP      4
 #define OP_31_XOP_TRAP      4
 #define OP_31_XOP_LWZX      23
 #define OP_31_XOP_LWZX      23
 #define OP_31_XOP_TRAP_64   68
 #define OP_31_XOP_TRAP_64   68
+#define OP_31_XOP_DCBF      86
 #define OP_31_XOP_LBZX      87
 #define OP_31_XOP_LBZX      87
 #define OP_31_XOP_STWX      151
 #define OP_31_XOP_STWX      151
 #define OP_31_XOP_STBX      215
 #define OP_31_XOP_STBX      215
@@ -374,6 +375,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
 			emulated = kvmppc_emulate_mtspr(vcpu, sprn, rs);
 			emulated = kvmppc_emulate_mtspr(vcpu, sprn, rs);
 			break;
 			break;
 
 
+		case OP_31_XOP_DCBF:
 		case OP_31_XOP_DCBI:
 		case OP_31_XOP_DCBI:
 			/* Do nothing. The guest is performing dcbi because
 			/* Do nothing. The guest is performing dcbi because
 			 * hardware DMA is not snooped by the dcache, but
 			 * hardware DMA is not snooped by the dcache, but

+ 1 - 1
arch/powerpc/oprofile/op_model_power4.c

@@ -52,7 +52,7 @@ static int power7_marked_instr_event(u64 mmcr1)
 	for (pmc = 0; pmc < 4; pmc++) {
 	for (pmc = 0; pmc < 4; pmc++) {
 		psel = mmcr1 & (OPROFILE_PM_PMCSEL_MSK
 		psel = mmcr1 & (OPROFILE_PM_PMCSEL_MSK
 				<< (OPROFILE_MAX_PMC_NUM - pmc)
 				<< (OPROFILE_MAX_PMC_NUM - pmc)
-				* OPROFILE_MAX_PMC_NUM);
+				* OPROFILE_PMSEL_FIELD_WIDTH);
 		psel = (psel >> ((OPROFILE_MAX_PMC_NUM - pmc)
 		psel = (psel >> ((OPROFILE_MAX_PMC_NUM - pmc)
 				 * OPROFILE_PMSEL_FIELD_WIDTH)) & ~1ULL;
 				 * OPROFILE_PMSEL_FIELD_WIDTH)) & ~1ULL;
 		unit = mmcr1 & (OPROFILE_PM_UNIT_MSK
 		unit = mmcr1 & (OPROFILE_PM_UNIT_MSK

+ 7 - 0
arch/powerpc/platforms/pasemi/cpufreq.c

@@ -236,6 +236,13 @@ out:
 
 
 static int pas_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 static int pas_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 {
 {
+	/*
+	 * We don't support CPU hotplug. Don't unmap after the system
+	 * has already made it to a running state.
+	 */
+	if (system_state != SYSTEM_BOOTING)
+		return 0;
+
 	if (sdcasr_mapbase)
 	if (sdcasr_mapbase)
 		iounmap(sdcasr_mapbase);
 		iounmap(sdcasr_mapbase);
 	if (sdcpwr_mapbase)
 	if (sdcpwr_mapbase)

+ 12 - 0
arch/s390/include/asm/pgtable.h

@@ -1365,6 +1365,18 @@ static inline void pmdp_invalidate(struct vm_area_struct *vma,
 	__pmd_idte(address, pmdp);
 	__pmd_idte(address, pmdp);
 }
 }
 
 
+#define __HAVE_ARCH_PMDP_SET_WRPROTECT
+static inline void pmdp_set_wrprotect(struct mm_struct *mm,
+				      unsigned long address, pmd_t *pmdp)
+{
+	pmd_t pmd = *pmdp;
+
+	if (pmd_write(pmd)) {
+		__pmd_idte(address, pmdp);
+		set_pmd_at(mm, address, pmdp, pmd_wrprotect(pmd));
+	}
+}
+
 static inline pmd_t mk_pmd_phys(unsigned long physpage, pgprot_t pgprot)
 static inline pmd_t mk_pmd_phys(unsigned long physpage, pgprot_t pgprot)
 {
 {
 	pmd_t __pmd;
 	pmd_t __pmd;

+ 1 - 0
arch/x86/Kconfig

@@ -2138,6 +2138,7 @@ config OLPC_XO1_RTC
 config OLPC_XO1_SCI
 config OLPC_XO1_SCI
 	bool "OLPC XO-1 SCI extras"
 	bool "OLPC XO-1 SCI extras"
 	depends on OLPC && OLPC_XO1_PM
 	depends on OLPC && OLPC_XO1_PM
+	depends on INPUT=y
 	select POWER_SUPPLY
 	select POWER_SUPPLY
 	select GPIO_CS5535
 	select GPIO_CS5535
 	select MFD_CORE
 	select MFD_CORE

+ 2 - 2
arch/x86/boot/Makefile

@@ -71,7 +71,7 @@ GCOV_PROFILE := n
 $(obj)/bzImage: asflags-y  := $(SVGA_MODE)
 $(obj)/bzImage: asflags-y  := $(SVGA_MODE)
 
 
 quiet_cmd_image = BUILD   $@
 quiet_cmd_image = BUILD   $@
-cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin > $@
+cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/zoffset.h > $@
 
 
 $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
 $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
 	$(call if_changed,image)
 	$(call if_changed,image)
@@ -92,7 +92,7 @@ targets += voffset.h
 $(obj)/voffset.h: vmlinux FORCE
 $(obj)/voffset.h: vmlinux FORCE
 	$(call if_changed,voffset)
 	$(call if_changed,voffset)
 
 
-sed-zoffset := -e 's/^\([0-9a-fA-F]*\) . \(startup_32\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p'
+sed-zoffset := -e 's/^\([0-9a-fA-F]*\) . \(startup_32\|startup_64\|efi_pe_entry\|efi_stub_entry\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p'
 
 
 quiet_cmd_zoffset = ZOFFSET $@
 quiet_cmd_zoffset = ZOFFSET $@
       cmd_zoffset = $(NM) $< | sed -n $(sed-zoffset) > $@
       cmd_zoffset = $(NM) $< | sed -n $(sed-zoffset) > $@

+ 11 - 10
arch/x86/boot/compressed/eboot.c

@@ -256,10 +256,10 @@ static efi_status_t setup_efi_pci(struct boot_params *params)
 	int i;
 	int i;
 	struct setup_data *data;
 	struct setup_data *data;
 
 
-	data = (struct setup_data *)params->hdr.setup_data;
+	data = (struct setup_data *)(unsigned long)params->hdr.setup_data;
 
 
 	while (data && data->next)
 	while (data && data->next)
-		data = (struct setup_data *)data->next;
+		data = (struct setup_data *)(unsigned long)data->next;
 
 
 	status = efi_call_phys5(sys_table->boottime->locate_handle,
 	status = efi_call_phys5(sys_table->boottime->locate_handle,
 				EFI_LOCATE_BY_PROTOCOL, &pci_proto,
 				EFI_LOCATE_BY_PROTOCOL, &pci_proto,
@@ -295,16 +295,18 @@ static efi_status_t setup_efi_pci(struct boot_params *params)
 		if (!pci)
 		if (!pci)
 			continue;
 			continue;
 
 
+#ifdef CONFIG_X86_64
 		status = efi_call_phys4(pci->attributes, pci,
 		status = efi_call_phys4(pci->attributes, pci,
 					EfiPciIoAttributeOperationGet, 0,
 					EfiPciIoAttributeOperationGet, 0,
 					&attributes);
 					&attributes);
-
+#else
+		status = efi_call_phys5(pci->attributes, pci,
+					EfiPciIoAttributeOperationGet, 0, 0,
+					&attributes);
+#endif
 		if (status != EFI_SUCCESS)
 		if (status != EFI_SUCCESS)
 			continue;
 			continue;
 
 
-		if (!(attributes & EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM))
-			continue;
-
 		if (!pci->romimage || !pci->romsize)
 		if (!pci->romimage || !pci->romsize)
 			continue;
 			continue;
 
 
@@ -345,9 +347,9 @@ static efi_status_t setup_efi_pci(struct boot_params *params)
 		memcpy(rom->romdata, pci->romimage, pci->romsize);
 		memcpy(rom->romdata, pci->romimage, pci->romsize);
 
 
 		if (data)
 		if (data)
-			data->next = (uint64_t)rom;
+			data->next = (unsigned long)rom;
 		else
 		else
-			params->hdr.setup_data = (uint64_t)rom;
+			params->hdr.setup_data = (unsigned long)rom;
 
 
 		data = (struct setup_data *)rom;
 		data = (struct setup_data *)rom;
 
 
@@ -432,10 +434,9 @@ static efi_status_t setup_gop(struct screen_info *si, efi_guid_t *proto,
 			 * Once we've found a GOP supporting ConOut,
 			 * Once we've found a GOP supporting ConOut,
 			 * don't bother looking any further.
 			 * don't bother looking any further.
 			 */
 			 */
+			first_gop = gop;
 			if (conout_found)
 			if (conout_found)
 				break;
 				break;
-
-			first_gop = gop;
 		}
 		}
 	}
 	}
 
 

+ 5 - 3
arch/x86/boot/compressed/head_32.S

@@ -35,11 +35,11 @@ ENTRY(startup_32)
 #ifdef CONFIG_EFI_STUB
 #ifdef CONFIG_EFI_STUB
 	jmp	preferred_addr
 	jmp	preferred_addr
 
 
-	.balign	0x10
 	/*
 	/*
 	 * We don't need the return address, so set up the stack so
 	 * We don't need the return address, so set up the stack so
-	 * efi_main() can find its arugments.
+	 * efi_main() can find its arguments.
 	 */
 	 */
+ENTRY(efi_pe_entry)
 	add	$0x4, %esp
 	add	$0x4, %esp
 
 
 	call	make_boot_params
 	call	make_boot_params
@@ -50,8 +50,10 @@ ENTRY(startup_32)
 	pushl	%eax
 	pushl	%eax
 	pushl	%esi
 	pushl	%esi
 	pushl	%ecx
 	pushl	%ecx
+	sub	$0x4, %esp
 
 
-	.org 0x30,0x90
+ENTRY(efi_stub_entry)
+	add	$0x4, %esp
 	call	efi_main
 	call	efi_main
 	cmpl	$0, %eax
 	cmpl	$0, %eax
 	movl	%eax, %esi
 	movl	%eax, %esi

+ 4 - 4
arch/x86/boot/compressed/head_64.S

@@ -201,12 +201,12 @@ ENTRY(startup_64)
 	 */
 	 */
 #ifdef CONFIG_EFI_STUB
 #ifdef CONFIG_EFI_STUB
 	/*
 	/*
-	 * The entry point for the PE/COFF executable is 0x210, so only
-	 * legacy boot loaders will execute this jmp.
+	 * The entry point for the PE/COFF executable is efi_pe_entry, so
+	 * only legacy boot loaders will execute this jmp.
 	 */
 	 */
 	jmp	preferred_addr
 	jmp	preferred_addr
 
 
-	.org 0x210
+ENTRY(efi_pe_entry)
 	mov	%rcx, %rdi
 	mov	%rcx, %rdi
 	mov	%rdx, %rsi
 	mov	%rdx, %rsi
 	pushq	%rdi
 	pushq	%rdi
@@ -218,7 +218,7 @@ ENTRY(startup_64)
 	popq	%rsi
 	popq	%rsi
 	popq	%rdi
 	popq	%rdi
 
 
-	.org 0x230,0x90
+ENTRY(efi_stub_entry)
 	call	efi_main
 	call	efi_main
 	movq	%rax,%rsi
 	movq	%rax,%rsi
 	cmpq	$0,%rax
 	cmpq	$0,%rax

+ 29 - 10
arch/x86/boot/header.S

@@ -21,6 +21,7 @@
 #include <asm/e820.h>
 #include <asm/e820.h>
 #include <asm/page_types.h>
 #include <asm/page_types.h>
 #include <asm/setup.h>
 #include <asm/setup.h>
+#include <asm/bootparam.h>
 #include "boot.h"
 #include "boot.h"
 #include "voffset.h"
 #include "voffset.h"
 #include "zoffset.h"
 #include "zoffset.h"
@@ -255,6 +256,9 @@ section_table:
 	# header, from the old boot sector.
 	# header, from the old boot sector.
 
 
 	.section ".header", "a"
 	.section ".header", "a"
+	.globl	sentinel
+sentinel:	.byte 0xff, 0xff        /* Used to detect broken loaders */
+
 	.globl	hdr
 	.globl	hdr
 hdr:
 hdr:
 setup_sects:	.byte 0			/* Filled in by build.c */
 setup_sects:	.byte 0			/* Filled in by build.c */
@@ -279,7 +283,7 @@ _start:
 	# Part 2 of the header, from the old setup.S
 	# Part 2 of the header, from the old setup.S
 
 
 		.ascii	"HdrS"		# header signature
 		.ascii	"HdrS"		# header signature
-		.word	0x020b		# header version number (>= 0x0105)
+		.word	0x020c		# header version number (>= 0x0105)
 					# or else old loadlin-1.5 will fail)
 					# or else old loadlin-1.5 will fail)
 		.globl realmode_swtch
 		.globl realmode_swtch
 realmode_swtch:	.word	0, 0		# default_switch, SETUPSEG
 realmode_swtch:	.word	0, 0		# default_switch, SETUPSEG
@@ -297,13 +301,7 @@ type_of_loader:	.byte	0		# 0 means ancient bootloader, newer
 
 
 # flags, unused bits must be zero (RFU) bit within loadflags
 # flags, unused bits must be zero (RFU) bit within loadflags
 loadflags:
 loadflags:
-LOADED_HIGH	= 1			# If set, the kernel is loaded high
-CAN_USE_HEAP	= 0x80			# If set, the loader also has set
-					# heap_end_ptr to tell how much
-					# space behind setup.S can be used for
-					# heap purposes.
-					# Only the loader knows what is free
-		.byte	LOADED_HIGH
+		.byte	LOADED_HIGH	# The kernel is to be loaded high
 
 
 setup_move_size: .word  0x8000		# size to move, when setup is not
 setup_move_size: .word  0x8000		# size to move, when setup is not
 					# loaded at 0x90000. We will move setup
 					# loaded at 0x90000. We will move setup
@@ -369,7 +367,23 @@ relocatable_kernel:    .byte 1
 relocatable_kernel:    .byte 0
 relocatable_kernel:    .byte 0
 #endif
 #endif
 min_alignment:		.byte MIN_KERNEL_ALIGN_LG2	# minimum alignment
 min_alignment:		.byte MIN_KERNEL_ALIGN_LG2	# minimum alignment
-pad3:			.word 0
+
+xloadflags:
+#ifdef CONFIG_X86_64
+# define XLF0 XLF_KERNEL_64			/* 64-bit kernel */
+#else
+# define XLF0 0
+#endif
+#ifdef CONFIG_EFI_STUB
+# ifdef CONFIG_X86_64
+#  define XLF23 XLF_EFI_HANDOVER_64		/* 64-bit EFI handover ok */
+# else
+#  define XLF23 XLF_EFI_HANDOVER_32		/* 32-bit EFI handover ok */
+# endif
+#else
+# define XLF23 0
+#endif
+			.word XLF0 | XLF23
 
 
 cmdline_size:   .long   COMMAND_LINE_SIZE-1     #length of the command line,
 cmdline_size:   .long   COMMAND_LINE_SIZE-1     #length of the command line,
                                                 #added with boot protocol
                                                 #added with boot protocol
@@ -397,8 +411,13 @@ pref_address:		.quad LOAD_PHYSICAL_ADDR	# preferred load addr
 #define INIT_SIZE VO_INIT_SIZE
 #define INIT_SIZE VO_INIT_SIZE
 #endif
 #endif
 init_size:		.long INIT_SIZE		# kernel initialization size
 init_size:		.long INIT_SIZE		# kernel initialization size
-handover_offset:	.long 0x30		# offset to the handover
+handover_offset:
+#ifdef CONFIG_EFI_STUB
+  			.long 0x30		# offset to the handover
 						# protocol entry point
 						# protocol entry point
+#else
+			.long 0
+#endif
 
 
 # End of setup header #####################################################
 # End of setup header #####################################################
 
 

+ 1 - 1
arch/x86/boot/setup.ld

@@ -13,7 +13,7 @@ SECTIONS
 	.bstext		: { *(.bstext) }
 	.bstext		: { *(.bstext) }
 	.bsdata		: { *(.bsdata) }
 	.bsdata		: { *(.bsdata) }
 
 
-	. = 497;
+	. = 495;
 	.header		: { *(.header) }
 	.header		: { *(.header) }
 	.entrytext	: { *(.entrytext) }
 	.entrytext	: { *(.entrytext) }
 	.inittext	: { *(.inittext) }
 	.inittext	: { *(.inittext) }

+ 63 - 18
arch/x86/boot/tools/build.c

@@ -52,6 +52,10 @@ int is_big_kernel;
 
 
 #define PECOFF_RELOC_RESERVE 0x20
 #define PECOFF_RELOC_RESERVE 0x20
 
 
+unsigned long efi_stub_entry;
+unsigned long efi_pe_entry;
+unsigned long startup_64;
+
 /*----------------------------------------------------------------------*/
 /*----------------------------------------------------------------------*/
 
 
 static const u32 crctab32[] = {
 static const u32 crctab32[] = {
@@ -132,7 +136,7 @@ static void die(const char * str, ...)
 
 
 static void usage(void)
 static void usage(void)
 {
 {
-	die("Usage: build setup system [> image]");
+	die("Usage: build setup system [zoffset.h] [> image]");
 }
 }
 
 
 #ifdef CONFIG_EFI_STUB
 #ifdef CONFIG_EFI_STUB
@@ -206,30 +210,54 @@ static void update_pecoff_text(unsigned int text_start, unsigned int file_sz)
 	 */
 	 */
 	put_unaligned_le32(file_sz - 512, &buf[pe_header + 0x1c]);
 	put_unaligned_le32(file_sz - 512, &buf[pe_header + 0x1c]);
 
 
-#ifdef CONFIG_X86_32
 	/*
 	/*
-	 * Address of entry point.
-	 *
-	 * The EFI stub entry point is +16 bytes from the start of
-	 * the .text section.
+	 * Address of entry point for PE/COFF executable
 	 */
 	 */
-	put_unaligned_le32(text_start + 16, &buf[pe_header + 0x28]);
-#else
-	/*
-	 * Address of entry point. startup_32 is at the beginning and
-	 * the 64-bit entry point (startup_64) is always 512 bytes
-	 * after. The EFI stub entry point is 16 bytes after that, as
-	 * the first instruction allows legacy loaders to jump over
-	 * the EFI stub initialisation
-	 */
-	put_unaligned_le32(text_start + 528, &buf[pe_header + 0x28]);
-#endif /* CONFIG_X86_32 */
+	put_unaligned_le32(text_start + efi_pe_entry, &buf[pe_header + 0x28]);
 
 
 	update_pecoff_section_header(".text", text_start, text_sz);
 	update_pecoff_section_header(".text", text_start, text_sz);
 }
 }
 
 
 #endif /* CONFIG_EFI_STUB */
 #endif /* CONFIG_EFI_STUB */
 
 
+
+/*
+ * Parse zoffset.h and find the entry points. We could just #include zoffset.h
+ * but that would mean tools/build would have to be rebuilt every time. It's
+ * not as if parsing it is hard...
+ */
+#define PARSE_ZOFS(p, sym) do { \
+	if (!strncmp(p, "#define ZO_" #sym " ", 11+sizeof(#sym)))	\
+		sym = strtoul(p + 11 + sizeof(#sym), NULL, 16);		\
+} while (0)
+
+static void parse_zoffset(char *fname)
+{
+	FILE *file;
+	char *p;
+	int c;
+
+	file = fopen(fname, "r");
+	if (!file)
+		die("Unable to open `%s': %m", fname);
+	c = fread(buf, 1, sizeof(buf) - 1, file);
+	if (ferror(file))
+		die("read-error on `zoffset.h'");
+	buf[c] = 0;
+
+	p = (char *)buf;
+
+	while (p && *p) {
+		PARSE_ZOFS(p, efi_stub_entry);
+		PARSE_ZOFS(p, efi_pe_entry);
+		PARSE_ZOFS(p, startup_64);
+
+		p = strchr(p, '\n');
+		while (p && (*p == '\r' || *p == '\n'))
+			p++;
+	}
+}
+
 int main(int argc, char ** argv)
 int main(int argc, char ** argv)
 {
 {
 	unsigned int i, sz, setup_sectors;
 	unsigned int i, sz, setup_sectors;
@@ -241,7 +269,19 @@ int main(int argc, char ** argv)
 	void *kernel;
 	void *kernel;
 	u32 crc = 0xffffffffUL;
 	u32 crc = 0xffffffffUL;
 
 
-	if (argc != 3)
+	/* Defaults for old kernel */
+#ifdef CONFIG_X86_32
+	efi_pe_entry = 0x10;
+	efi_stub_entry = 0x30;
+#else
+	efi_pe_entry = 0x210;
+	efi_stub_entry = 0x230;
+	startup_64 = 0x200;
+#endif
+
+	if (argc == 4)
+		parse_zoffset(argv[3]);
+	else if (argc != 3)
 		usage();
 		usage();
 
 
 	/* Copy the setup code */
 	/* Copy the setup code */
@@ -299,6 +339,11 @@ int main(int argc, char ** argv)
 
 
 #ifdef CONFIG_EFI_STUB
 #ifdef CONFIG_EFI_STUB
 	update_pecoff_text(setup_sectors * 512, sz + i + ((sys_size * 16) - sz));
 	update_pecoff_text(setup_sectors * 512, sz + i + ((sys_size * 16) - sz));
+
+#ifdef CONFIG_X86_64 /* Yes, this is really how we defined it :( */
+	efi_stub_entry -= 0x200;
+#endif
+	put_unaligned_le32(efi_stub_entry, &buf[0x264]);
 #endif
 #endif
 
 
 	crc = partial_crc32(buf, i, crc);
 	crc = partial_crc32(buf, i, crc);

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

@@ -94,6 +94,7 @@ extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size,
 #endif /* CONFIG_X86_32 */
 #endif /* CONFIG_X86_32 */
 
 
 extern int add_efi_memmap;
 extern int add_efi_memmap;
+extern unsigned long x86_efi_facility;
 extern void efi_set_executable(efi_memory_desc_t *md, bool executable);
 extern void efi_set_executable(efi_memory_desc_t *md, bool executable);
 extern int efi_memblock_x86_reserve_range(void);
 extern int efi_memblock_x86_reserve_range(void);
 extern void efi_call_phys_prelog(void);
 extern void efi_call_phys_prelog(void);

+ 1 - 1
arch/x86/include/asm/uv/uv.h

@@ -16,7 +16,7 @@ extern void uv_system_init(void);
 extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
 extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
 						 struct mm_struct *mm,
 						 struct mm_struct *mm,
 						 unsigned long start,
 						 unsigned long start,
-						 unsigned end,
+						 unsigned long end,
 						 unsigned int cpu);
 						 unsigned int cpu);
 
 
 #else	/* X86_UV */
 #else	/* X86_UV */

+ 46 - 17
arch/x86/include/uapi/asm/bootparam.h

@@ -1,6 +1,31 @@
 #ifndef _ASM_X86_BOOTPARAM_H
 #ifndef _ASM_X86_BOOTPARAM_H
 #define _ASM_X86_BOOTPARAM_H
 #define _ASM_X86_BOOTPARAM_H
 
 
+/* setup_data types */
+#define SETUP_NONE			0
+#define SETUP_E820_EXT			1
+#define SETUP_DTB			2
+#define SETUP_PCI			3
+
+/* ram_size flags */
+#define RAMDISK_IMAGE_START_MASK	0x07FF
+#define RAMDISK_PROMPT_FLAG		0x8000
+#define RAMDISK_LOAD_FLAG		0x4000
+
+/* loadflags */
+#define LOADED_HIGH	(1<<0)
+#define QUIET_FLAG	(1<<5)
+#define KEEP_SEGMENTS	(1<<6)
+#define CAN_USE_HEAP	(1<<7)
+
+/* xloadflags */
+#define XLF_KERNEL_64			(1<<0)
+#define XLF_CAN_BE_LOADED_ABOVE_4G	(1<<1)
+#define XLF_EFI_HANDOVER_32		(1<<2)
+#define XLF_EFI_HANDOVER_64		(1<<3)
+
+#ifndef __ASSEMBLY__
+
 #include <linux/types.h>
 #include <linux/types.h>
 #include <linux/screen_info.h>
 #include <linux/screen_info.h>
 #include <linux/apm_bios.h>
 #include <linux/apm_bios.h>
@@ -9,12 +34,6 @@
 #include <asm/ist.h>
 #include <asm/ist.h>
 #include <video/edid.h>
 #include <video/edid.h>
 
 
-/* setup data types */
-#define SETUP_NONE			0
-#define SETUP_E820_EXT			1
-#define SETUP_DTB			2
-#define SETUP_PCI			3
-
 /* extensible setup data list node */
 /* extensible setup data list node */
 struct setup_data {
 struct setup_data {
 	__u64 next;
 	__u64 next;
@@ -28,9 +47,6 @@ struct setup_header {
 	__u16	root_flags;
 	__u16	root_flags;
 	__u32	syssize;
 	__u32	syssize;
 	__u16	ram_size;
 	__u16	ram_size;
-#define RAMDISK_IMAGE_START_MASK	0x07FF
-#define RAMDISK_PROMPT_FLAG		0x8000
-#define RAMDISK_LOAD_FLAG		0x4000
 	__u16	vid_mode;
 	__u16	vid_mode;
 	__u16	root_dev;
 	__u16	root_dev;
 	__u16	boot_flag;
 	__u16	boot_flag;
@@ -42,10 +58,6 @@ struct setup_header {
 	__u16	kernel_version;
 	__u16	kernel_version;
 	__u8	type_of_loader;
 	__u8	type_of_loader;
 	__u8	loadflags;
 	__u8	loadflags;
-#define LOADED_HIGH	(1<<0)
-#define QUIET_FLAG	(1<<5)
-#define KEEP_SEGMENTS	(1<<6)
-#define CAN_USE_HEAP	(1<<7)
 	__u16	setup_move_size;
 	__u16	setup_move_size;
 	__u32	code32_start;
 	__u32	code32_start;
 	__u32	ramdisk_image;
 	__u32	ramdisk_image;
@@ -58,7 +70,8 @@ struct setup_header {
 	__u32	initrd_addr_max;
 	__u32	initrd_addr_max;
 	__u32	kernel_alignment;
 	__u32	kernel_alignment;
 	__u8	relocatable_kernel;
 	__u8	relocatable_kernel;
-	__u8	_pad2[3];
+	__u8	min_alignment;
+	__u16	xloadflags;
 	__u32	cmdline_size;
 	__u32	cmdline_size;
 	__u32	hardware_subarch;
 	__u32	hardware_subarch;
 	__u64	hardware_subarch_data;
 	__u64	hardware_subarch_data;
@@ -106,7 +119,10 @@ struct boot_params {
 	__u8  hd1_info[16];	/* obsolete! */		/* 0x090 */
 	__u8  hd1_info[16];	/* obsolete! */		/* 0x090 */
 	struct sys_desc_table sys_desc_table;		/* 0x0a0 */
 	struct sys_desc_table sys_desc_table;		/* 0x0a0 */
 	struct olpc_ofw_header olpc_ofw_header;		/* 0x0b0 */
 	struct olpc_ofw_header olpc_ofw_header;		/* 0x0b0 */
-	__u8  _pad4[128];				/* 0x0c0 */
+	__u32 ext_ramdisk_image;			/* 0x0c0 */
+	__u32 ext_ramdisk_size;				/* 0x0c4 */
+	__u32 ext_cmd_line_ptr;				/* 0x0c8 */
+	__u8  _pad4[116];				/* 0x0cc */
 	struct edid_info edid_info;			/* 0x140 */
 	struct edid_info edid_info;			/* 0x140 */
 	struct efi_info efi_info;			/* 0x1c0 */
 	struct efi_info efi_info;			/* 0x1c0 */
 	__u32 alt_mem_k;				/* 0x1e0 */
 	__u32 alt_mem_k;				/* 0x1e0 */
@@ -115,7 +131,20 @@ struct boot_params {
 	__u8  eddbuf_entries;				/* 0x1e9 */
 	__u8  eddbuf_entries;				/* 0x1e9 */
 	__u8  edd_mbr_sig_buf_entries;			/* 0x1ea */
 	__u8  edd_mbr_sig_buf_entries;			/* 0x1ea */
 	__u8  kbd_status;				/* 0x1eb */
 	__u8  kbd_status;				/* 0x1eb */
-	__u8  _pad6[5];					/* 0x1ec */
+	__u8  _pad5[3];					/* 0x1ec */
+	/*
+	 * The sentinel is set to a nonzero value (0xff) in header.S.
+	 *
+	 * A bootloader is supposed to only take setup_header and put
+	 * it into a clean boot_params buffer. If it turns out that
+	 * it is clumsy or too generous with the buffer, it most
+	 * probably will pick up the sentinel variable too. The fact
+	 * that this variable then is still 0xff will let kernel
+	 * know that some variables in boot_params are invalid and
+	 * kernel should zero out certain portions of boot_params.
+	 */
+	__u8  sentinel;					/* 0x1ef */
+	__u8  _pad6[1];					/* 0x1f0 */
 	struct setup_header hdr;    /* setup header */	/* 0x1f1 */
 	struct setup_header hdr;    /* setup header */	/* 0x1f1 */
 	__u8  _pad7[0x290-0x1f1-sizeof(struct setup_header)];
 	__u8  _pad7[0x290-0x1f1-sizeof(struct setup_header)];
 	__u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX];	/* 0x290 */
 	__u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX];	/* 0x290 */
@@ -134,6 +163,6 @@ enum {
 	X86_NR_SUBARCHS,
 	X86_NR_SUBARCHS,
 };
 };
 
 
-
+#endif /* __ASSEMBLY__ */
 
 
 #endif /* _ASM_X86_BOOTPARAM_H */
 #endif /* _ASM_X86_BOOTPARAM_H */

+ 3 - 4
arch/x86/kernel/entry_64.S

@@ -1781,6 +1781,7 @@ first_nmi:
 	 * Leave room for the "copied" frame
 	 * Leave room for the "copied" frame
 	 */
 	 */
 	subq $(5*8), %rsp
 	subq $(5*8), %rsp
+	CFI_ADJUST_CFA_OFFSET 5*8
 
 
 	/* Copy the stack frame to the Saved frame */
 	/* Copy the stack frame to the Saved frame */
 	.rept 5
 	.rept 5
@@ -1863,10 +1864,8 @@ end_repeat_nmi:
 nmi_swapgs:
 nmi_swapgs:
 	SWAPGS_UNSAFE_STACK
 	SWAPGS_UNSAFE_STACK
 nmi_restore:
 nmi_restore:
-	RESTORE_ALL 8
-
-	/* Pop the extra iret frame */
-	addq $(5*8), %rsp
+	/* Pop the extra iret frame at once */
+	RESTORE_ALL 6*8
 
 
 	/* Clear the NMI executing stack variable */
 	/* Clear the NMI executing stack variable */
 	movq $0, 5*8(%rsp)
 	movq $0, 5*8(%rsp)

+ 7 - 2
arch/x86/kernel/head_32.S

@@ -300,6 +300,12 @@ ENTRY(startup_32_smp)
 	leal -__PAGE_OFFSET(%ecx),%esp
 	leal -__PAGE_OFFSET(%ecx),%esp
 
 
 default_entry:
 default_entry:
+#define CR0_STATE	(X86_CR0_PE | X86_CR0_MP | X86_CR0_ET | \
+			 X86_CR0_NE | X86_CR0_WP | X86_CR0_AM | \
+			 X86_CR0_PG)
+	movl $(CR0_STATE & ~X86_CR0_PG),%eax
+	movl %eax,%cr0
+
 /*
 /*
  *	New page tables may be in 4Mbyte page mode and may
  *	New page tables may be in 4Mbyte page mode and may
  *	be using the global pages. 
  *	be using the global pages. 
@@ -364,8 +370,7 @@ default_entry:
  */
  */
 	movl $pa(initial_page_table), %eax
 	movl $pa(initial_page_table), %eax
 	movl %eax,%cr3		/* set the page table pointer.. */
 	movl %eax,%cr3		/* set the page table pointer.. */
-	movl %cr0,%eax
-	orl  $X86_CR0_PG,%eax
+	movl $CR0_STATE,%eax
 	movl %eax,%cr0		/* ..and set paging (PG) bit */
 	movl %eax,%cr0		/* ..and set paging (PG) bit */
 	ljmp $__BOOT_CS,$1f	/* Clear prefetch and normalize %eip */
 	ljmp $__BOOT_CS,$1f	/* Clear prefetch and normalize %eip */
 1:
 1:

+ 3 - 0
arch/x86/kernel/msr.c

@@ -174,6 +174,9 @@ static int msr_open(struct inode *inode, struct file *file)
 	unsigned int cpu;
 	unsigned int cpu;
 	struct cpuinfo_x86 *c;
 	struct cpuinfo_x86 *c;
 
 
+	if (!capable(CAP_SYS_RAWIO))
+		return -EPERM;
+
 	cpu = iminor(file->f_path.dentry->d_inode);
 	cpu = iminor(file->f_path.dentry->d_inode);
 	if (cpu >= nr_cpu_ids || !cpu_online(cpu))
 	if (cpu >= nr_cpu_ids || !cpu_online(cpu))
 		return -ENXIO;	/* No such CPU */
 		return -ENXIO;	/* No such CPU */

+ 1 - 1
arch/x86/kernel/pci-dma.c

@@ -56,7 +56,7 @@ struct device x86_dma_fallback_dev = {
 EXPORT_SYMBOL(x86_dma_fallback_dev);
 EXPORT_SYMBOL(x86_dma_fallback_dev);
 
 
 /* Number of entries preallocated for DMA-API debugging */
 /* Number of entries preallocated for DMA-API debugging */
-#define PREALLOC_DMA_DEBUG_ENTRIES       32768
+#define PREALLOC_DMA_DEBUG_ENTRIES       65536
 
 
 int dma_set_mask(struct device *dev, u64 mask)
 int dma_set_mask(struct device *dev, u64 mask)
 {
 {

+ 1 - 1
arch/x86/kernel/reboot.c

@@ -584,7 +584,7 @@ static void native_machine_emergency_restart(void)
 			break;
 			break;
 
 
 		case BOOT_EFI:
 		case BOOT_EFI:
-			if (efi_enabled)
+			if (efi_enabled(EFI_RUNTIME_SERVICES))
 				efi.reset_system(reboot_mode ?
 				efi.reset_system(reboot_mode ?
 						 EFI_RESET_WARM :
 						 EFI_RESET_WARM :
 						 EFI_RESET_COLD,
 						 EFI_RESET_COLD,

+ 14 - 14
arch/x86/kernel/setup.c

@@ -807,15 +807,15 @@ void __init setup_arch(char **cmdline_p)
 #ifdef CONFIG_EFI
 #ifdef CONFIG_EFI
 	if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
 	if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
 		     "EL32", 4)) {
 		     "EL32", 4)) {
-		efi_enabled = 1;
-		efi_64bit = false;
+		set_bit(EFI_BOOT, &x86_efi_facility);
 	} else if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
 	} else if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
 		     "EL64", 4)) {
 		     "EL64", 4)) {
-		efi_enabled = 1;
-		efi_64bit = true;
+		set_bit(EFI_BOOT, &x86_efi_facility);
+		set_bit(EFI_64BIT, &x86_efi_facility);
 	}
 	}
-	if (efi_enabled && efi_memblock_x86_reserve_range())
-		efi_enabled = 0;
+
+	if (efi_enabled(EFI_BOOT))
+		efi_memblock_x86_reserve_range();
 #endif
 #endif
 
 
 	x86_init.oem.arch_setup();
 	x86_init.oem.arch_setup();
@@ -888,7 +888,7 @@ void __init setup_arch(char **cmdline_p)
 
 
 	finish_e820_parsing();
 	finish_e820_parsing();
 
 
-	if (efi_enabled)
+	if (efi_enabled(EFI_BOOT))
 		efi_init();
 		efi_init();
 
 
 	dmi_scan_machine();
 	dmi_scan_machine();
@@ -971,7 +971,7 @@ void __init setup_arch(char **cmdline_p)
 	 * The EFI specification says that boot service code won't be called
 	 * The EFI specification says that boot service code won't be called
 	 * after ExitBootServices(). This is, in fact, a lie.
 	 * after ExitBootServices(). This is, in fact, a lie.
 	 */
 	 */
-	if (efi_enabled)
+	if (efi_enabled(EFI_MEMMAP))
 		efi_reserve_boot_services();
 		efi_reserve_boot_services();
 
 
 	/* preallocate 4k for mptable mpc */
 	/* preallocate 4k for mptable mpc */
@@ -1114,7 +1114,7 @@ void __init setup_arch(char **cmdline_p)
 
 
 #ifdef CONFIG_VT
 #ifdef CONFIG_VT
 #if defined(CONFIG_VGA_CONSOLE)
 #if defined(CONFIG_VGA_CONSOLE)
-	if (!efi_enabled || (efi_mem_type(0xa0000) != EFI_CONVENTIONAL_MEMORY))
+	if (!efi_enabled(EFI_BOOT) || (efi_mem_type(0xa0000) != EFI_CONVENTIONAL_MEMORY))
 		conswitchp = &vga_con;
 		conswitchp = &vga_con;
 #elif defined(CONFIG_DUMMY_CONSOLE)
 #elif defined(CONFIG_DUMMY_CONSOLE)
 	conswitchp = &dummy_con;
 	conswitchp = &dummy_con;
@@ -1131,14 +1131,14 @@ void __init setup_arch(char **cmdline_p)
 	register_refined_jiffies(CLOCK_TICK_RATE);
 	register_refined_jiffies(CLOCK_TICK_RATE);
 
 
 #ifdef CONFIG_EFI
 #ifdef CONFIG_EFI
-	/* Once setup is done above, disable efi_enabled on mismatched
-	 * firmware/kernel archtectures since there is no support for
-	 * runtime services.
+	/* Once setup is done above, unmap the EFI memory map on
+	 * mismatched firmware/kernel archtectures since there is no
+	 * support for runtime services.
 	 */
 	 */
-	if (efi_enabled && IS_ENABLED(CONFIG_X86_64) != efi_64bit) {
+	if (efi_enabled(EFI_BOOT) &&
+	    IS_ENABLED(CONFIG_X86_64) != efi_enabled(EFI_64BIT)) {
 		pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n");
 		pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n");
 		efi_unmap_memmap();
 		efi_unmap_memmap();
-		efi_enabled = 0;
 	}
 	}
 #endif
 #endif
 }
 }

+ 35 - 24
arch/x86/platform/efi/efi.c

@@ -51,9 +51,6 @@
 
 
 #define EFI_DEBUG	1
 #define EFI_DEBUG	1
 
 
-int efi_enabled;
-EXPORT_SYMBOL(efi_enabled);
-
 struct efi __read_mostly efi = {
 struct efi __read_mostly efi = {
 	.mps        = EFI_INVALID_TABLE_ADDR,
 	.mps        = EFI_INVALID_TABLE_ADDR,
 	.acpi       = EFI_INVALID_TABLE_ADDR,
 	.acpi       = EFI_INVALID_TABLE_ADDR,
@@ -69,19 +66,28 @@ EXPORT_SYMBOL(efi);
 
 
 struct efi_memory_map memmap;
 struct efi_memory_map memmap;
 
 
-bool efi_64bit;
-
 static struct efi efi_phys __initdata;
 static struct efi efi_phys __initdata;
 static efi_system_table_t efi_systab __initdata;
 static efi_system_table_t efi_systab __initdata;
 
 
 static inline bool efi_is_native(void)
 static inline bool efi_is_native(void)
 {
 {
-	return IS_ENABLED(CONFIG_X86_64) == efi_64bit;
+	return IS_ENABLED(CONFIG_X86_64) == efi_enabled(EFI_64BIT);
+}
+
+unsigned long x86_efi_facility;
+
+/*
+ * Returns 1 if 'facility' is enabled, 0 otherwise.
+ */
+int efi_enabled(int facility)
+{
+	return test_bit(facility, &x86_efi_facility) != 0;
 }
 }
+EXPORT_SYMBOL(efi_enabled);
 
 
 static int __init setup_noefi(char *arg)
 static int __init setup_noefi(char *arg)
 {
 {
-	efi_enabled = 0;
+	clear_bit(EFI_BOOT, &x86_efi_facility);
 	return 0;
 	return 0;
 }
 }
 early_param("noefi", setup_noefi);
 early_param("noefi", setup_noefi);
@@ -426,6 +432,7 @@ void __init efi_reserve_boot_services(void)
 
 
 void __init efi_unmap_memmap(void)
 void __init efi_unmap_memmap(void)
 {
 {
+	clear_bit(EFI_MEMMAP, &x86_efi_facility);
 	if (memmap.map) {
 	if (memmap.map) {
 		early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
 		early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
 		memmap.map = NULL;
 		memmap.map = NULL;
@@ -460,7 +467,7 @@ void __init efi_free_boot_services(void)
 
 
 static int __init efi_systab_init(void *phys)
 static int __init efi_systab_init(void *phys)
 {
 {
-	if (efi_64bit) {
+	if (efi_enabled(EFI_64BIT)) {
 		efi_system_table_64_t *systab64;
 		efi_system_table_64_t *systab64;
 		u64 tmp = 0;
 		u64 tmp = 0;
 
 
@@ -552,7 +559,7 @@ static int __init efi_config_init(u64 tables, int nr_tables)
 	void *config_tables, *tablep;
 	void *config_tables, *tablep;
 	int i, sz;
 	int i, sz;
 
 
-	if (efi_64bit)
+	if (efi_enabled(EFI_64BIT))
 		sz = sizeof(efi_config_table_64_t);
 		sz = sizeof(efi_config_table_64_t);
 	else
 	else
 		sz = sizeof(efi_config_table_32_t);
 		sz = sizeof(efi_config_table_32_t);
@@ -572,7 +579,7 @@ static int __init efi_config_init(u64 tables, int nr_tables)
 		efi_guid_t guid;
 		efi_guid_t guid;
 		unsigned long table;
 		unsigned long table;
 
 
-		if (efi_64bit) {
+		if (efi_enabled(EFI_64BIT)) {
 			u64 table64;
 			u64 table64;
 			guid = ((efi_config_table_64_t *)tablep)->guid;
 			guid = ((efi_config_table_64_t *)tablep)->guid;
 			table64 = ((efi_config_table_64_t *)tablep)->table;
 			table64 = ((efi_config_table_64_t *)tablep)->table;
@@ -684,7 +691,6 @@ void __init efi_init(void)
 	if (boot_params.efi_info.efi_systab_hi ||
 	if (boot_params.efi_info.efi_systab_hi ||
 	    boot_params.efi_info.efi_memmap_hi) {
 	    boot_params.efi_info.efi_memmap_hi) {
 		pr_info("Table located above 4GB, disabling EFI.\n");
 		pr_info("Table located above 4GB, disabling EFI.\n");
-		efi_enabled = 0;
 		return;
 		return;
 	}
 	}
 	efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab;
 	efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab;
@@ -694,10 +700,10 @@ void __init efi_init(void)
 			  ((__u64)boot_params.efi_info.efi_systab_hi<<32));
 			  ((__u64)boot_params.efi_info.efi_systab_hi<<32));
 #endif
 #endif
 
 
-	if (efi_systab_init(efi_phys.systab)) {
-		efi_enabled = 0;
+	if (efi_systab_init(efi_phys.systab))
 		return;
 		return;
-	}
+
+	set_bit(EFI_SYSTEM_TABLES, &x86_efi_facility);
 
 
 	/*
 	/*
 	 * Show what we know for posterity
 	 * Show what we know for posterity
@@ -715,10 +721,10 @@ void __init efi_init(void)
 		efi.systab->hdr.revision >> 16,
 		efi.systab->hdr.revision >> 16,
 		efi.systab->hdr.revision & 0xffff, vendor);
 		efi.systab->hdr.revision & 0xffff, vendor);
 
 
-	if (efi_config_init(efi.systab->tables, efi.systab->nr_tables)) {
-		efi_enabled = 0;
+	if (efi_config_init(efi.systab->tables, efi.systab->nr_tables))
 		return;
 		return;
-	}
+
+	set_bit(EFI_CONFIG_TABLES, &x86_efi_facility);
 
 
 	/*
 	/*
 	 * Note: We currently don't support runtime services on an EFI
 	 * Note: We currently don't support runtime services on an EFI
@@ -727,15 +733,17 @@ void __init efi_init(void)
 
 
 	if (!efi_is_native())
 	if (!efi_is_native())
 		pr_info("No EFI runtime due to 32/64-bit mismatch with kernel\n");
 		pr_info("No EFI runtime due to 32/64-bit mismatch with kernel\n");
-	else if (efi_runtime_init()) {
-		efi_enabled = 0;
-		return;
+	else {
+		if (efi_runtime_init())
+			return;
+		set_bit(EFI_RUNTIME_SERVICES, &x86_efi_facility);
 	}
 	}
 
 
-	if (efi_memmap_init()) {
-		efi_enabled = 0;
+	if (efi_memmap_init())
 		return;
 		return;
-	}
+
+	set_bit(EFI_MEMMAP, &x86_efi_facility);
+
 #ifdef CONFIG_X86_32
 #ifdef CONFIG_X86_32
 	if (efi_is_native()) {
 	if (efi_is_native()) {
 		x86_platform.get_wallclock = efi_get_time;
 		x86_platform.get_wallclock = efi_get_time;
@@ -941,7 +949,7 @@ void __init efi_enter_virtual_mode(void)
 	 *
 	 *
 	 * Call EFI services through wrapper functions.
 	 * Call EFI services through wrapper functions.
 	 */
 	 */
-	efi.runtime_version = efi_systab.fw_revision;
+	efi.runtime_version = efi_systab.hdr.revision;
 	efi.get_time = virt_efi_get_time;
 	efi.get_time = virt_efi_get_time;
 	efi.set_time = virt_efi_set_time;
 	efi.set_time = virt_efi_set_time;
 	efi.get_wakeup_time = virt_efi_get_wakeup_time;
 	efi.get_wakeup_time = virt_efi_get_wakeup_time;
@@ -969,6 +977,9 @@ u32 efi_mem_type(unsigned long phys_addr)
 	efi_memory_desc_t *md;
 	efi_memory_desc_t *md;
 	void *p;
 	void *p;
 
 
+	if (!efi_enabled(EFI_MEMMAP))
+		return 0;
+
 	for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
 	for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
 		md = p;
 		md = p;
 		if ((md->phys_addr <= phys_addr) &&
 		if ((md->phys_addr <= phys_addr) &&

+ 17 - 5
arch/x86/platform/efi/efi_64.c

@@ -38,7 +38,7 @@
 #include <asm/cacheflush.h>
 #include <asm/cacheflush.h>
 #include <asm/fixmap.h>
 #include <asm/fixmap.h>
 
 
-static pgd_t save_pgd __initdata;
+static pgd_t *save_pgd __initdata;
 static unsigned long efi_flags __initdata;
 static unsigned long efi_flags __initdata;
 
 
 static void __init early_code_mapping_set_exec(int executable)
 static void __init early_code_mapping_set_exec(int executable)
@@ -61,12 +61,20 @@ static void __init early_code_mapping_set_exec(int executable)
 void __init efi_call_phys_prelog(void)
 void __init efi_call_phys_prelog(void)
 {
 {
 	unsigned long vaddress;
 	unsigned long vaddress;
+	int pgd;
+	int n_pgds;
 
 
 	early_code_mapping_set_exec(1);
 	early_code_mapping_set_exec(1);
 	local_irq_save(efi_flags);
 	local_irq_save(efi_flags);
-	vaddress = (unsigned long)__va(0x0UL);
-	save_pgd = *pgd_offset_k(0x0UL);
-	set_pgd(pgd_offset_k(0x0UL), *pgd_offset_k(vaddress));
+
+	n_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT), PGDIR_SIZE);
+	save_pgd = kmalloc(n_pgds * sizeof(pgd_t), GFP_KERNEL);
+
+	for (pgd = 0; pgd < n_pgds; pgd++) {
+		save_pgd[pgd] = *pgd_offset_k(pgd * PGDIR_SIZE);
+		vaddress = (unsigned long)__va(pgd * PGDIR_SIZE);
+		set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), *pgd_offset_k(vaddress));
+	}
 	__flush_tlb_all();
 	__flush_tlb_all();
 }
 }
 
 
@@ -75,7 +83,11 @@ void __init efi_call_phys_epilog(void)
 	/*
 	/*
 	 * After the lock is released, the original page table is restored.
 	 * After the lock is released, the original page table is restored.
 	 */
 	 */
-	set_pgd(pgd_offset_k(0x0UL), save_pgd);
+	int pgd;
+	int n_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT) , PGDIR_SIZE);
+	for (pgd = 0; pgd < n_pgds; pgd++)
+		set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), save_pgd[pgd]);
+	kfree(save_pgd);
 	__flush_tlb_all();
 	__flush_tlb_all();
 	local_irq_restore(efi_flags);
 	local_irq_restore(efi_flags);
 	early_code_mapping_set_exec(0);
 	early_code_mapping_set_exec(0);

+ 7 - 3
arch/x86/platform/uv/tlb_uv.c

@@ -1034,7 +1034,8 @@ static int set_distrib_bits(struct cpumask *flush_mask, struct bau_control *bcp,
  * globally purge translation cache of a virtual address or all TLB's
  * globally purge translation cache of a virtual address or all TLB's
  * @cpumask: mask of all cpu's in which the address is to be removed
  * @cpumask: mask of all cpu's in which the address is to be removed
  * @mm: mm_struct containing virtual address range
  * @mm: mm_struct containing virtual address range
- * @va: virtual address to be removed (or TLB_FLUSH_ALL for all TLB's on cpu)
+ * @start: start virtual address to be removed from TLB
+ * @end: end virtual address to be remove from TLB
  * @cpu: the current cpu
  * @cpu: the current cpu
  *
  *
  * This is the entry point for initiating any UV global TLB shootdown.
  * This is the entry point for initiating any UV global TLB shootdown.
@@ -1056,7 +1057,7 @@ static int set_distrib_bits(struct cpumask *flush_mask, struct bau_control *bcp,
  */
  */
 const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
 const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
 				struct mm_struct *mm, unsigned long start,
 				struct mm_struct *mm, unsigned long start,
-				unsigned end, unsigned int cpu)
+				unsigned long end, unsigned int cpu)
 {
 {
 	int locals = 0;
 	int locals = 0;
 	int remotes = 0;
 	int remotes = 0;
@@ -1113,7 +1114,10 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
 
 
 	record_send_statistics(stat, locals, hubs, remotes, bau_desc);
 	record_send_statistics(stat, locals, hubs, remotes, bau_desc);
 
 
-	bau_desc->payload.address = start;
+	if (!end || (end - start) <= PAGE_SIZE)
+		bau_desc->payload.address = start;
+	else
+		bau_desc->payload.address = TLB_FLUSH_ALL;
 	bau_desc->payload.sending_cpu = cpu;
 	bau_desc->payload.sending_cpu = cpu;
 	/*
 	/*
 	 * uv_flush_send_and_wait returns 0 if all cpu's were messaged,
 	 * uv_flush_send_and_wait returns 0 if all cpu's were messaged,

+ 4 - 2
arch/x86/tools/relocs.c

@@ -814,12 +814,14 @@ int main(int argc, char **argv)
 	read_relocs(fp);
 	read_relocs(fp);
 	if (show_absolute_syms) {
 	if (show_absolute_syms) {
 		print_absolute_symbols();
 		print_absolute_symbols();
-		return 0;
+		goto out;
 	}
 	}
 	if (show_absolute_relocs) {
 	if (show_absolute_relocs) {
 		print_absolute_relocs();
 		print_absolute_relocs();
-		return 0;
+		goto out;
 	}
 	}
 	emit_relocs(as_text, use_real_mode);
 	emit_relocs(as_text, use_real_mode);
+out:
+	fclose(fp);
 	return 0;
 	return 0;
 }
 }

+ 3 - 0
drivers/acpi/apei/apei-base.c

@@ -590,6 +590,9 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr,
 	if (bit_width == 32 && bit_offset == 0 && (*paddr & 0x03) == 0 &&
 	if (bit_width == 32 && bit_offset == 0 && (*paddr & 0x03) == 0 &&
 	    *access_bit_width < 32)
 	    *access_bit_width < 32)
 		*access_bit_width = 32;
 		*access_bit_width = 32;
+	else if (bit_width == 64 && bit_offset == 0 && (*paddr & 0x07) == 0 &&
+	    *access_bit_width < 64)
+		*access_bit_width = 64;
 
 
 	if ((bit_width + bit_offset) > *access_bit_width) {
 	if ((bit_width + bit_offset) > *access_bit_width) {
 		pr_warning(FW_BUG APEI_PFX
 		pr_warning(FW_BUG APEI_PFX

+ 1 - 1
drivers/acpi/osl.c

@@ -250,7 +250,7 @@ acpi_physical_address __init acpi_os_get_root_pointer(void)
 		return acpi_rsdp;
 		return acpi_rsdp;
 #endif
 #endif
 
 
-	if (efi_enabled) {
+	if (efi_enabled(EFI_CONFIG_TABLES)) {
 		if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
 		if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
 			return efi.acpi20;
 			return efi.acpi20;
 		else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
 		else if (efi.acpi != EFI_INVALID_TABLE_ADDR)

+ 4 - 0
drivers/acpi/processor_idle.c

@@ -958,6 +958,9 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr)
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
 
 
+	if (!dev)
+		return -EINVAL;
+
 	dev->cpu = pr->id;
 	dev->cpu = pr->id;
 
 
 	if (max_cstate == 0)
 	if (max_cstate == 0)
@@ -1149,6 +1152,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr)
 		}
 		}
 
 
 		/* Populate Updated C-state information */
 		/* Populate Updated C-state information */
+		acpi_processor_get_power_info(pr);
 		acpi_processor_setup_cpuidle_states(pr);
 		acpi_processor_setup_cpuidle_states(pr);
 
 
 		/* Enable all cpuidle devices */
 		/* Enable all cpuidle devices */

+ 7 - 0
drivers/acpi/processor_perflib.c

@@ -340,6 +340,13 @@ static void amd_fixup_frequency(struct acpi_processor_px *px, int i)
 	if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10)
 	if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10)
 	    || boot_cpu_data.x86 == 0x11) {
 	    || boot_cpu_data.x86 == 0x11) {
 		rdmsr(MSR_AMD_PSTATE_DEF_BASE + index, lo, hi);
 		rdmsr(MSR_AMD_PSTATE_DEF_BASE + index, lo, hi);
+		/*
+		 * MSR C001_0064+:
+		 * Bit 63: PstateEn. Read-write. If set, the P-state is valid.
+		 */
+		if (!(hi & BIT(31)))
+			return;
+
 		fid = lo & 0x3f;
 		fid = lo & 0x3f;
 		did = (lo >> 6) & 7;
 		did = (lo >> 6) & 7;
 		if (boot_cpu_data.x86 == 0x10)
 		if (boot_cpu_data.x86 == 0x10)

+ 0 - 2
drivers/base/regmap/regmap-debugfs.c

@@ -121,8 +121,6 @@ static unsigned int regmap_debugfs_get_dump_start(struct regmap *map,
 		c->max = p - 1;
 		c->max = p - 1;
 		list_add_tail(&c->list,
 		list_add_tail(&c->list,
 			      &map->debugfs_off_cache);
 			      &map->debugfs_off_cache);
-	} else {
-		return base;
 	}
 	}
 
 
 	/*
 	/*

+ 1 - 1
drivers/base/regmap/regmap.c

@@ -1106,7 +1106,7 @@ EXPORT_SYMBOL_GPL(regmap_raw_write);
  * @val_count: Number of registers to write
  * @val_count: Number of registers to write
  *
  *
  * This function is intended to be used for writing a large block of
  * This function is intended to be used for writing a large block of
- * data to be device either in single transfer or multiple transfer.
+ * data to the device either in single transfer or multiple transfer.
  *
  *
  * A value of zero will be returned on success, a negative errno will
  * A value of zero will be returned on success, a negative errno will
  * be returned in error cases.
  * be returned in error cases.

+ 10 - 0
drivers/bluetooth/ath3k.c

@@ -77,10 +77,15 @@ static struct usb_device_id ath3k_table[] = {
 	{ USB_DEVICE(0x0CF3, 0x311D) },
 	{ USB_DEVICE(0x0CF3, 0x311D) },
 	{ USB_DEVICE(0x13d3, 0x3375) },
 	{ USB_DEVICE(0x13d3, 0x3375) },
 	{ USB_DEVICE(0x04CA, 0x3005) },
 	{ USB_DEVICE(0x04CA, 0x3005) },
+	{ USB_DEVICE(0x04CA, 0x3006) },
+	{ USB_DEVICE(0x04CA, 0x3008) },
 	{ USB_DEVICE(0x13d3, 0x3362) },
 	{ USB_DEVICE(0x13d3, 0x3362) },
 	{ USB_DEVICE(0x0CF3, 0xE004) },
 	{ USB_DEVICE(0x0CF3, 0xE004) },
 	{ USB_DEVICE(0x0930, 0x0219) },
 	{ USB_DEVICE(0x0930, 0x0219) },
 	{ USB_DEVICE(0x0489, 0xe057) },
 	{ USB_DEVICE(0x0489, 0xe057) },
+	{ USB_DEVICE(0x13d3, 0x3393) },
+	{ USB_DEVICE(0x0489, 0xe04e) },
+	{ USB_DEVICE(0x0489, 0xe056) },
 
 
 	/* Atheros AR5BBU12 with sflash firmware */
 	/* Atheros AR5BBU12 with sflash firmware */
 	{ USB_DEVICE(0x0489, 0xE02C) },
 	{ USB_DEVICE(0x0489, 0xE02C) },
@@ -104,10 +109,15 @@ static struct usb_device_id ath3k_blist_tbl[] = {
 	{ USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
 
 
 	/* Atheros AR5BBU22 with sflash firmware */
 	/* Atheros AR5BBU22 with sflash firmware */
 	{ USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 },

+ 5 - 0
drivers/bluetooth/btusb.c

@@ -135,10 +135,15 @@ static struct usb_device_id blacklist_table[] = {
 	{ USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
 
 
 	/* Atheros AR5BBU12 with sflash firmware */
 	/* Atheros AR5BBU12 with sflash firmware */
 	{ USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
 	{ USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },

+ 6 - 3
drivers/clk/mvebu/clk-cpu.c

@@ -124,7 +124,7 @@ void __init of_cpu_clk_setup(struct device_node *node)
 
 
 	clks = kzalloc(ncpus * sizeof(*clks), GFP_KERNEL);
 	clks = kzalloc(ncpus * sizeof(*clks), GFP_KERNEL);
 	if (WARN_ON(!clks))
 	if (WARN_ON(!clks))
-		return;
+		goto clks_out;
 
 
 	for_each_node_by_type(dn, "cpu") {
 	for_each_node_by_type(dn, "cpu") {
 		struct clk_init_data init;
 		struct clk_init_data init;
@@ -134,11 +134,11 @@ void __init of_cpu_clk_setup(struct device_node *node)
 		int cpu, err;
 		int cpu, err;
 
 
 		if (WARN_ON(!clk_name))
 		if (WARN_ON(!clk_name))
-			return;
+			goto bail_out;
 
 
 		err = of_property_read_u32(dn, "reg", &cpu);
 		err = of_property_read_u32(dn, "reg", &cpu);
 		if (WARN_ON(err))
 		if (WARN_ON(err))
-			return;
+			goto bail_out;
 
 
 		sprintf(clk_name, "cpu%d", cpu);
 		sprintf(clk_name, "cpu%d", cpu);
 		parent_clk = of_clk_get(node, 0);
 		parent_clk = of_clk_get(node, 0);
@@ -167,6 +167,9 @@ void __init of_cpu_clk_setup(struct device_node *node)
 	return;
 	return;
 bail_out:
 bail_out:
 	kfree(clks);
 	kfree(clks);
+	while(ncpus--)
+		kfree(cpuclk[ncpus].clk_name);
+clks_out:
 	kfree(cpuclk);
 	kfree(cpuclk);
 }
 }
 
 

+ 1 - 1
drivers/cpufreq/Kconfig.x86

@@ -106,7 +106,7 @@ config X86_POWERNOW_K7_ACPI
 config X86_POWERNOW_K8
 config X86_POWERNOW_K8
 	tristate "AMD Opteron/Athlon64 PowerNow!"
 	tristate "AMD Opteron/Athlon64 PowerNow!"
 	select CPU_FREQ_TABLE
 	select CPU_FREQ_TABLE
-	depends on ACPI && ACPI_PROCESSOR
+	depends on ACPI && ACPI_PROCESSOR && X86_ACPI_CPUFREQ
 	help
 	help
 	  This adds the CPUFreq driver for K8/early Opteron/Athlon64 processors.
 	  This adds the CPUFreq driver for K8/early Opteron/Athlon64 processors.
 	  Support for K10 and newer processors is now in acpi-cpufreq.
 	  Support for K10 and newer processors is now in acpi-cpufreq.

+ 7 - 0
drivers/cpufreq/acpi-cpufreq.c

@@ -1030,4 +1030,11 @@ MODULE_PARM_DESC(acpi_pstate_strict,
 late_initcall(acpi_cpufreq_init);
 late_initcall(acpi_cpufreq_init);
 module_exit(acpi_cpufreq_exit);
 module_exit(acpi_cpufreq_exit);
 
 
+static const struct x86_cpu_id acpi_cpufreq_ids[] = {
+	X86_FEATURE_MATCH(X86_FEATURE_ACPI),
+	X86_FEATURE_MATCH(X86_FEATURE_HW_PSTATE),
+	{}
+};
+MODULE_DEVICE_TABLE(x86cpu, acpi_cpufreq_ids);
+
 MODULE_ALIAS("acpi");
 MODULE_ALIAS("acpi");

+ 5 - 0
drivers/cpufreq/cpufreq-cpu0.c

@@ -71,12 +71,15 @@ static int cpu0_set_target(struct cpufreq_policy *policy,
 	}
 	}
 
 
 	if (cpu_reg) {
 	if (cpu_reg) {
+		rcu_read_lock();
 		opp = opp_find_freq_ceil(cpu_dev, &freq_Hz);
 		opp = opp_find_freq_ceil(cpu_dev, &freq_Hz);
 		if (IS_ERR(opp)) {
 		if (IS_ERR(opp)) {
+			rcu_read_unlock();
 			pr_err("failed to find OPP for %ld\n", freq_Hz);
 			pr_err("failed to find OPP for %ld\n", freq_Hz);
 			return PTR_ERR(opp);
 			return PTR_ERR(opp);
 		}
 		}
 		volt = opp_get_voltage(opp);
 		volt = opp_get_voltage(opp);
+		rcu_read_unlock();
 		tol = volt * voltage_tolerance / 100;
 		tol = volt * voltage_tolerance / 100;
 		volt_old = regulator_get_voltage(cpu_reg);
 		volt_old = regulator_get_voltage(cpu_reg);
 	}
 	}
@@ -236,12 +239,14 @@ static int cpu0_cpufreq_driver_init(void)
 		 */
 		 */
 		for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++)
 		for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++)
 			;
 			;
+		rcu_read_lock();
 		opp = opp_find_freq_exact(cpu_dev,
 		opp = opp_find_freq_exact(cpu_dev,
 				freq_table[0].frequency * 1000, true);
 				freq_table[0].frequency * 1000, true);
 		min_uV = opp_get_voltage(opp);
 		min_uV = opp_get_voltage(opp);
 		opp = opp_find_freq_exact(cpu_dev,
 		opp = opp_find_freq_exact(cpu_dev,
 				freq_table[i-1].frequency * 1000, true);
 				freq_table[i-1].frequency * 1000, true);
 		max_uV = opp_get_voltage(opp);
 		max_uV = opp_get_voltage(opp);
+		rcu_read_unlock();
 		ret = regulator_set_voltage_time(cpu_reg, min_uV, max_uV);
 		ret = regulator_set_voltage_time(cpu_reg, min_uV, max_uV);
 		if (ret > 0)
 		if (ret > 0)
 			transition_latency += ret * 1000;
 			transition_latency += ret * 1000;

+ 3 - 0
drivers/cpufreq/omap-cpufreq.c

@@ -110,13 +110,16 @@ static int omap_target(struct cpufreq_policy *policy,
 	freq = ret;
 	freq = ret;
 
 
 	if (mpu_reg) {
 	if (mpu_reg) {
+		rcu_read_lock();
 		opp = opp_find_freq_ceil(mpu_dev, &freq);
 		opp = opp_find_freq_ceil(mpu_dev, &freq);
 		if (IS_ERR(opp)) {
 		if (IS_ERR(opp)) {
+			rcu_read_unlock();
 			dev_err(mpu_dev, "%s: unable to find MPU OPP for %d\n",
 			dev_err(mpu_dev, "%s: unable to find MPU OPP for %d\n",
 				__func__, freqs.new);
 				__func__, freqs.new);
 			return -EINVAL;
 			return -EINVAL;
 		}
 		}
 		volt = opp_get_voltage(opp);
 		volt = opp_get_voltage(opp);
+		rcu_read_unlock();
 		tol = volt * OPP_TOLERANCE / 100;
 		tol = volt * OPP_TOLERANCE / 100;
 		volt_old = regulator_get_voltage(mpu_reg);
 		volt_old = regulator_get_voltage(mpu_reg);
 	}
 	}

+ 5 - 0
drivers/devfreq/devfreq.c

@@ -994,6 +994,11 @@ module_exit(devfreq_exit);
  * @freq:	The frequency given to target function
  * @freq:	The frequency given to target function
  * @flags:	Flags handed from devfreq framework.
  * @flags:	Flags handed from devfreq framework.
  *
  *
+ * Locking: This function must be called under rcu_read_lock(). opp is a rcu
+ * protected pointer. The reason for the same is that the opp pointer which is
+ * returned will remain valid for use with opp_get_{voltage, freq} only while
+ * under the locked area. The pointer returned must be used prior to unlocking
+ * with rcu_read_unlock() to maintain the integrity of the pointer.
  */
  */
 struct opp *devfreq_recommended_opp(struct device *dev, unsigned long *freq,
 struct opp *devfreq_recommended_opp(struct device *dev, unsigned long *freq,
 				    u32 flags)
 				    u32 flags)

+ 67 - 27
drivers/devfreq/exynos4_bus.c

@@ -73,6 +73,16 @@ enum busclk_level_idx {
 #define EX4210_LV_NUM	(LV_2 + 1)
 #define EX4210_LV_NUM	(LV_2 + 1)
 #define EX4x12_LV_NUM	(LV_4 + 1)
 #define EX4x12_LV_NUM	(LV_4 + 1)
 
 
+/**
+ * struct busfreq_opp_info - opp information for bus
+ * @rate:	Frequency in hertz
+ * @volt:	Voltage in microvolts corresponding to this OPP
+ */
+struct busfreq_opp_info {
+	unsigned long rate;
+	unsigned long volt;
+};
+
 struct busfreq_data {
 struct busfreq_data {
 	enum exynos4_busf_type type;
 	enum exynos4_busf_type type;
 	struct device *dev;
 	struct device *dev;
@@ -80,7 +90,7 @@ struct busfreq_data {
 	bool disabled;
 	bool disabled;
 	struct regulator *vdd_int;
 	struct regulator *vdd_int;
 	struct regulator *vdd_mif; /* Exynos4412/4212 only */
 	struct regulator *vdd_mif; /* Exynos4412/4212 only */
-	struct opp *curr_opp;
+	struct busfreq_opp_info curr_oppinfo;
 	struct exynos4_ppmu dmc[2];
 	struct exynos4_ppmu dmc[2];
 
 
 	struct notifier_block pm_notifier;
 	struct notifier_block pm_notifier;
@@ -296,13 +306,14 @@ static unsigned int exynos4x12_clkdiv_sclkip[][3] = {
 };
 };
 
 
 
 
-static int exynos4210_set_busclk(struct busfreq_data *data, struct opp *opp)
+static int exynos4210_set_busclk(struct busfreq_data *data,
+				 struct busfreq_opp_info *oppi)
 {
 {
 	unsigned int index;
 	unsigned int index;
 	unsigned int tmp;
 	unsigned int tmp;
 
 
 	for (index = LV_0; index < EX4210_LV_NUM; index++)
 	for (index = LV_0; index < EX4210_LV_NUM; index++)
-		if (opp_get_freq(opp) == exynos4210_busclk_table[index].clk)
+		if (oppi->rate == exynos4210_busclk_table[index].clk)
 			break;
 			break;
 
 
 	if (index == EX4210_LV_NUM)
 	if (index == EX4210_LV_NUM)
@@ -361,13 +372,14 @@ static int exynos4210_set_busclk(struct busfreq_data *data, struct opp *opp)
 	return 0;
 	return 0;
 }
 }
 
 
-static int exynos4x12_set_busclk(struct busfreq_data *data, struct opp *opp)
+static int exynos4x12_set_busclk(struct busfreq_data *data,
+				 struct busfreq_opp_info *oppi)
 {
 {
 	unsigned int index;
 	unsigned int index;
 	unsigned int tmp;
 	unsigned int tmp;
 
 
 	for (index = LV_0; index < EX4x12_LV_NUM; index++)
 	for (index = LV_0; index < EX4x12_LV_NUM; index++)
-		if (opp_get_freq(opp) == exynos4x12_mifclk_table[index].clk)
+		if (oppi->rate == exynos4x12_mifclk_table[index].clk)
 			break;
 			break;
 
 
 	if (index == EX4x12_LV_NUM)
 	if (index == EX4x12_LV_NUM)
@@ -576,11 +588,12 @@ static int exynos4x12_get_intspec(unsigned long mifclk)
 	return -EINVAL;
 	return -EINVAL;
 }
 }
 
 
-static int exynos4_bus_setvolt(struct busfreq_data *data, struct opp *opp,
-			       struct opp *oldopp)
+static int exynos4_bus_setvolt(struct busfreq_data *data,
+			       struct busfreq_opp_info *oppi,
+			       struct busfreq_opp_info *oldoppi)
 {
 {
 	int err = 0, tmp;
 	int err = 0, tmp;
-	unsigned long volt = opp_get_voltage(opp);
+	unsigned long volt = oppi->volt;
 
 
 	switch (data->type) {
 	switch (data->type) {
 	case TYPE_BUSF_EXYNOS4210:
 	case TYPE_BUSF_EXYNOS4210:
@@ -595,11 +608,11 @@ static int exynos4_bus_setvolt(struct busfreq_data *data, struct opp *opp,
 		if (err)
 		if (err)
 			break;
 			break;
 
 
-		tmp = exynos4x12_get_intspec(opp_get_freq(opp));
+		tmp = exynos4x12_get_intspec(oppi->rate);
 		if (tmp < 0) {
 		if (tmp < 0) {
 			err = tmp;
 			err = tmp;
 			regulator_set_voltage(data->vdd_mif,
 			regulator_set_voltage(data->vdd_mif,
-					      opp_get_voltage(oldopp),
+					      oldoppi->volt,
 					      MAX_SAFEVOLT);
 					      MAX_SAFEVOLT);
 			break;
 			break;
 		}
 		}
@@ -609,7 +622,7 @@ static int exynos4_bus_setvolt(struct busfreq_data *data, struct opp *opp,
 		/*  Try to recover */
 		/*  Try to recover */
 		if (err)
 		if (err)
 			regulator_set_voltage(data->vdd_mif,
 			regulator_set_voltage(data->vdd_mif,
-					      opp_get_voltage(oldopp),
+					      oldoppi->volt,
 					      MAX_SAFEVOLT);
 					      MAX_SAFEVOLT);
 		break;
 		break;
 	default:
 	default:
@@ -626,17 +639,26 @@ static int exynos4_bus_target(struct device *dev, unsigned long *_freq,
 	struct platform_device *pdev = container_of(dev, struct platform_device,
 	struct platform_device *pdev = container_of(dev, struct platform_device,
 						    dev);
 						    dev);
 	struct busfreq_data *data = platform_get_drvdata(pdev);
 	struct busfreq_data *data = platform_get_drvdata(pdev);
-	struct opp *opp = devfreq_recommended_opp(dev, _freq, flags);
-	unsigned long freq = opp_get_freq(opp);
-	unsigned long old_freq = opp_get_freq(data->curr_opp);
+	struct opp *opp;
+	unsigned long freq;
+	unsigned long old_freq = data->curr_oppinfo.rate;
+	struct busfreq_opp_info	new_oppinfo;
 
 
-	if (IS_ERR(opp))
+	rcu_read_lock();
+	opp = devfreq_recommended_opp(dev, _freq, flags);
+	if (IS_ERR(opp)) {
+		rcu_read_unlock();
 		return PTR_ERR(opp);
 		return PTR_ERR(opp);
+	}
+	new_oppinfo.rate = opp_get_freq(opp);
+	new_oppinfo.volt = opp_get_voltage(opp);
+	rcu_read_unlock();
+	freq = new_oppinfo.rate;
 
 
 	if (old_freq == freq)
 	if (old_freq == freq)
 		return 0;
 		return 0;
 
 
-	dev_dbg(dev, "targetting %lukHz %luuV\n", freq, opp_get_voltage(opp));
+	dev_dbg(dev, "targetting %lukHz %luuV\n", freq, new_oppinfo.volt);
 
 
 	mutex_lock(&data->lock);
 	mutex_lock(&data->lock);
 
 
@@ -644,17 +666,18 @@ static int exynos4_bus_target(struct device *dev, unsigned long *_freq,
 		goto out;
 		goto out;
 
 
 	if (old_freq < freq)
 	if (old_freq < freq)
-		err = exynos4_bus_setvolt(data, opp, data->curr_opp);
+		err = exynos4_bus_setvolt(data, &new_oppinfo,
+					  &data->curr_oppinfo);
 	if (err)
 	if (err)
 		goto out;
 		goto out;
 
 
 	if (old_freq != freq) {
 	if (old_freq != freq) {
 		switch (data->type) {
 		switch (data->type) {
 		case TYPE_BUSF_EXYNOS4210:
 		case TYPE_BUSF_EXYNOS4210:
-			err = exynos4210_set_busclk(data, opp);
+			err = exynos4210_set_busclk(data, &new_oppinfo);
 			break;
 			break;
 		case TYPE_BUSF_EXYNOS4x12:
 		case TYPE_BUSF_EXYNOS4x12:
-			err = exynos4x12_set_busclk(data, opp);
+			err = exynos4x12_set_busclk(data, &new_oppinfo);
 			break;
 			break;
 		default:
 		default:
 			err = -EINVAL;
 			err = -EINVAL;
@@ -664,11 +687,12 @@ static int exynos4_bus_target(struct device *dev, unsigned long *_freq,
 		goto out;
 		goto out;
 
 
 	if (old_freq > freq)
 	if (old_freq > freq)
-		err = exynos4_bus_setvolt(data, opp, data->curr_opp);
+		err = exynos4_bus_setvolt(data, &new_oppinfo,
+					  &data->curr_oppinfo);
 	if (err)
 	if (err)
 		goto out;
 		goto out;
 
 
-	data->curr_opp = opp;
+	data->curr_oppinfo = new_oppinfo;
 out:
 out:
 	mutex_unlock(&data->lock);
 	mutex_unlock(&data->lock);
 	return err;
 	return err;
@@ -702,7 +726,7 @@ static int exynos4_bus_get_dev_status(struct device *dev,
 
 
 	exynos4_read_ppmu(data);
 	exynos4_read_ppmu(data);
 	busier_dmc = exynos4_get_busier_dmc(data);
 	busier_dmc = exynos4_get_busier_dmc(data);
-	stat->current_frequency = opp_get_freq(data->curr_opp);
+	stat->current_frequency = data->curr_oppinfo.rate;
 
 
 	if (busier_dmc)
 	if (busier_dmc)
 		addr = S5P_VA_DMC1;
 		addr = S5P_VA_DMC1;
@@ -933,6 +957,7 @@ static int exynos4_busfreq_pm_notifier_event(struct notifier_block *this,
 	struct busfreq_data *data = container_of(this, struct busfreq_data,
 	struct busfreq_data *data = container_of(this, struct busfreq_data,
 						 pm_notifier);
 						 pm_notifier);
 	struct opp *opp;
 	struct opp *opp;
+	struct busfreq_opp_info	new_oppinfo;
 	unsigned long maxfreq = ULONG_MAX;
 	unsigned long maxfreq = ULONG_MAX;
 	int err = 0;
 	int err = 0;
 
 
@@ -943,18 +968,29 @@ static int exynos4_busfreq_pm_notifier_event(struct notifier_block *this,
 
 
 		data->disabled = true;
 		data->disabled = true;
 
 
+		rcu_read_lock();
 		opp = opp_find_freq_floor(data->dev, &maxfreq);
 		opp = opp_find_freq_floor(data->dev, &maxfreq);
+		if (IS_ERR(opp)) {
+			rcu_read_unlock();
+			dev_err(data->dev, "%s: unable to find a min freq\n",
+				__func__);
+			return PTR_ERR(opp);
+		}
+		new_oppinfo.rate = opp_get_freq(opp);
+		new_oppinfo.volt = opp_get_voltage(opp);
+		rcu_read_unlock();
 
 
-		err = exynos4_bus_setvolt(data, opp, data->curr_opp);
+		err = exynos4_bus_setvolt(data, &new_oppinfo,
+					  &data->curr_oppinfo);
 		if (err)
 		if (err)
 			goto unlock;
 			goto unlock;
 
 
 		switch (data->type) {
 		switch (data->type) {
 		case TYPE_BUSF_EXYNOS4210:
 		case TYPE_BUSF_EXYNOS4210:
-			err = exynos4210_set_busclk(data, opp);
+			err = exynos4210_set_busclk(data, &new_oppinfo);
 			break;
 			break;
 		case TYPE_BUSF_EXYNOS4x12:
 		case TYPE_BUSF_EXYNOS4x12:
-			err = exynos4x12_set_busclk(data, opp);
+			err = exynos4x12_set_busclk(data, &new_oppinfo);
 			break;
 			break;
 		default:
 		default:
 			err = -EINVAL;
 			err = -EINVAL;
@@ -962,7 +998,7 @@ static int exynos4_busfreq_pm_notifier_event(struct notifier_block *this,
 		if (err)
 		if (err)
 			goto unlock;
 			goto unlock;
 
 
-		data->curr_opp = opp;
+		data->curr_oppinfo = new_oppinfo;
 unlock:
 unlock:
 		mutex_unlock(&data->lock);
 		mutex_unlock(&data->lock);
 		if (err)
 		if (err)
@@ -1027,13 +1063,17 @@ static int exynos4_busfreq_probe(struct platform_device *pdev)
 		}
 		}
 	}
 	}
 
 
+	rcu_read_lock();
 	opp = opp_find_freq_floor(dev, &exynos4_devfreq_profile.initial_freq);
 	opp = opp_find_freq_floor(dev, &exynos4_devfreq_profile.initial_freq);
 	if (IS_ERR(opp)) {
 	if (IS_ERR(opp)) {
+		rcu_read_unlock();
 		dev_err(dev, "Invalid initial frequency %lu kHz.\n",
 		dev_err(dev, "Invalid initial frequency %lu kHz.\n",
 			exynos4_devfreq_profile.initial_freq);
 			exynos4_devfreq_profile.initial_freq);
 		return PTR_ERR(opp);
 		return PTR_ERR(opp);
 	}
 	}
-	data->curr_opp = opp;
+	data->curr_oppinfo.rate = opp_get_freq(opp);
+	data->curr_oppinfo.volt = opp_get_voltage(opp);
+	rcu_read_unlock();
 
 
 	platform_set_drvdata(pdev, data);
 	platform_set_drvdata(pdev, data);
 
 

+ 2 - 3
drivers/dma/imx-dma.c

@@ -684,9 +684,8 @@ static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
 			break;
 			break;
 		}
 		}
 
 
-		imxdmac->hw_chaining = 1;
-		if (!imxdma_hw_chain(imxdmac))
-			return -EINVAL;
+		imxdmac->hw_chaining = 0;
+
 		imxdmac->ccr_from_device = (mode | IMX_DMA_TYPE_FIFO) |
 		imxdmac->ccr_from_device = (mode | IMX_DMA_TYPE_FIFO) |
 			((IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_LINEAR) << 2) |
 			((IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_LINEAR) << 2) |
 			CCR_REN;
 			CCR_REN;

+ 1 - 1
drivers/dma/ioat/dma_v3.c

@@ -951,7 +951,7 @@ static int ioat_xor_val_self_test(struct ioatdma_device *device)
 			goto free_resources;
 			goto free_resources;
 		}
 		}
 	}
 	}
-	dma_sync_single_for_device(dev, dest_dma, PAGE_SIZE, DMA_TO_DEVICE);
+	dma_sync_single_for_device(dev, dest_dma, PAGE_SIZE, DMA_FROM_DEVICE);
 
 
 	/* skip validate if the capability is not present */
 	/* skip validate if the capability is not present */
 	if (!dma_has_cap(DMA_XOR_VAL, dma_chan->device->cap_mask))
 	if (!dma_has_cap(DMA_XOR_VAL, dma_chan->device->cap_mask))

+ 6 - 2
drivers/dma/tegra20-apb-dma.c

@@ -266,6 +266,7 @@ static struct tegra_dma_desc *tegra_dma_desc_get(
 		if (async_tx_test_ack(&dma_desc->txd)) {
 		if (async_tx_test_ack(&dma_desc->txd)) {
 			list_del(&dma_desc->node);
 			list_del(&dma_desc->node);
 			spin_unlock_irqrestore(&tdc->lock, flags);
 			spin_unlock_irqrestore(&tdc->lock, flags);
+			dma_desc->txd.flags = 0;
 			return dma_desc;
 			return dma_desc;
 		}
 		}
 	}
 	}
@@ -1050,7 +1051,9 @@ struct dma_async_tx_descriptor *tegra_dma_prep_dma_cyclic(
 					TEGRA_APBDMA_AHBSEQ_WRAP_SHIFT;
 					TEGRA_APBDMA_AHBSEQ_WRAP_SHIFT;
 	ahb_seq |= TEGRA_APBDMA_AHBSEQ_BUS_WIDTH_32;
 	ahb_seq |= TEGRA_APBDMA_AHBSEQ_BUS_WIDTH_32;
 
 
-	csr |= TEGRA_APBDMA_CSR_FLOW | TEGRA_APBDMA_CSR_IE_EOC;
+	csr |= TEGRA_APBDMA_CSR_FLOW;
+	if (flags & DMA_PREP_INTERRUPT)
+		csr |= TEGRA_APBDMA_CSR_IE_EOC;
 	csr |= tdc->dma_sconfig.slave_id << TEGRA_APBDMA_CSR_REQ_SEL_SHIFT;
 	csr |= tdc->dma_sconfig.slave_id << TEGRA_APBDMA_CSR_REQ_SEL_SHIFT;
 
 
 	apb_seq |= TEGRA_APBDMA_APBSEQ_WRAP_WORD_1;
 	apb_seq |= TEGRA_APBDMA_APBSEQ_WRAP_WORD_1;
@@ -1095,7 +1098,8 @@ struct dma_async_tx_descriptor *tegra_dma_prep_dma_cyclic(
 		mem += len;
 		mem += len;
 	}
 	}
 	sg_req->last_sg = true;
 	sg_req->last_sg = true;
-	dma_desc->txd.flags = 0;
+	if (flags & DMA_CTRL_ACK)
+		dma_desc->txd.flags = DMA_CTRL_ACK;
 
 
 	/*
 	/*
 	 * Make sure that mode should not be conflicting with currently
 	 * Make sure that mode should not be conflicting with currently

+ 3 - 3
drivers/edac/edac_mc.c

@@ -340,7 +340,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
 	/*
 	/*
 	 * Alocate and fill the csrow/channels structs
 	 * Alocate and fill the csrow/channels structs
 	 */
 	 */
-	mci->csrows = kcalloc(sizeof(*mci->csrows), tot_csrows, GFP_KERNEL);
+	mci->csrows = kcalloc(tot_csrows, sizeof(*mci->csrows), GFP_KERNEL);
 	if (!mci->csrows)
 	if (!mci->csrows)
 		goto error;
 		goto error;
 	for (row = 0; row < tot_csrows; row++) {
 	for (row = 0; row < tot_csrows; row++) {
@@ -351,7 +351,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
 		csr->csrow_idx = row;
 		csr->csrow_idx = row;
 		csr->mci = mci;
 		csr->mci = mci;
 		csr->nr_channels = tot_channels;
 		csr->nr_channels = tot_channels;
-		csr->channels = kcalloc(sizeof(*csr->channels), tot_channels,
+		csr->channels = kcalloc(tot_channels, sizeof(*csr->channels),
 					GFP_KERNEL);
 					GFP_KERNEL);
 		if (!csr->channels)
 		if (!csr->channels)
 			goto error;
 			goto error;
@@ -369,7 +369,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
 	/*
 	/*
 	 * Allocate and fill the dimm structs
 	 * Allocate and fill the dimm structs
 	 */
 	 */
-	mci->dimms  = kcalloc(sizeof(*mci->dimms), tot_dimms, GFP_KERNEL);
+	mci->dimms  = kcalloc(tot_dimms, sizeof(*mci->dimms), GFP_KERNEL);
 	if (!mci->dimms)
 	if (!mci->dimms)
 		goto error;
 		goto error;
 
 

+ 1 - 1
drivers/edac/edac_pci_sysfs.c

@@ -256,7 +256,7 @@ static ssize_t edac_pci_dev_store(struct kobject *kobj,
 	struct edac_pci_dev_attribute *edac_pci_dev;
 	struct edac_pci_dev_attribute *edac_pci_dev;
 	edac_pci_dev = (struct edac_pci_dev_attribute *)attr;
 	edac_pci_dev = (struct edac_pci_dev_attribute *)attr;
 
 
-	if (edac_pci_dev->show)
+	if (edac_pci_dev->store)
 		return edac_pci_dev->store(edac_pci_dev->value, buffer, count);
 		return edac_pci_dev->store(edac_pci_dev->value, buffer, count);
 	return -EIO;
 	return -EIO;
 }
 }

Деякі файли не було показано, через те що забагато файлів було змінено