Browse Source

Merge branch 'sched/urgent' into sched/core, to pick up fixes before applying more changes

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Ingo Molnar 10 years ago
parent
commit
e9ac5f0fa8
100 changed files with 494 additions and 482 deletions
  1. 1 1
      Documentation/ABI/testing/sysfs-ibft
  2. 1 1
      Documentation/DocBook/media/Makefile
  3. 4 0
      Documentation/DocBook/media/v4l/compat.xml
  4. 0 1
      Documentation/HOWTO
  5. 4 6
      Documentation/SubmittingPatches
  6. 0 4
      Documentation/development-process/2.Process
  7. 0 4
      Documentation/development-process/8.Conclusion
  8. 2 0
      Documentation/devicetree/bindings/net/smsc-lan91c111.txt
  9. 10 0
      Documentation/devicetree/bindings/sound/sgtl5000.txt
  10. 3 0
      Documentation/devicetree/bindings/submitting-patches.txt
  11. 15 1
      Documentation/kernel-parameters.txt
  12. 4 0
      Documentation/kmemleak.txt
  13. 1 1
      Documentation/prctl/Makefile
  14. 33 0
      Documentation/ptp/testptp.mk
  15. 3 0
      Documentation/vDSO/Makefile
  16. 1 1
      Documentation/vDSO/vdso_standalone_test_x86.c
  17. 1 1
      Documentation/vm/hugetlbpage.txt
  18. 9 6
      MAINTAINERS
  19. 2 2
      Makefile
  20. 1 1
      arch/arm/Kconfig.debug
  21. 2 0
      arch/arm/boot/dts/omap3-n900.dts
  22. 2 0
      arch/arm/configs/multi_v7_defconfig
  23. 2 2
      arch/arm/configs/omap2plus_defconfig
  24. 28 43
      arch/arm/configs/socfpga_defconfig
  25. 1 0
      arch/arm/include/uapi/asm/unistd.h
  26. 11 1
      arch/arm/kernel/asm-offsets.c
  27. 1 0
      arch/arm/kernel/calls.S
  28. 2 2
      arch/arm/mach-ixp4xx/include/mach/io.h
  29. 4 0
      arch/arm/mach-omap2/omap_device.c
  30. 0 3
      arch/arm/mach-omap2/pdata-quirks.c
  31. 5 0
      arch/arm/mach-pxa/include/mach/addr-map.h
  32. 18 8
      arch/arm/mm/cache-l2x0.c
  33. 0 1
      arch/arm/mm/dma-mapping.c
  34. 3 0
      arch/arm/mm/highmem.c
  35. 4 4
      arch/arm/mm/init.c
  36. 1 1
      arch/m68k/include/asm/unistd.h
  37. 1 0
      arch/m68k/include/uapi/asm/unistd.h
  38. 1 0
      arch/m68k/kernel/syscalltable.S
  39. 4 0
      arch/microblaze/Kconfig
  40. 1 1
      arch/microblaze/include/asm/unistd.h
  41. 1 0
      arch/microblaze/include/uapi/asm/unistd.h
  42. 1 0
      arch/microblaze/kernel/syscall_table.S
  43. 7 2
      arch/microblaze/pci/pci-common.c
  44. 1 1
      arch/powerpc/include/asm/hugetlb.h
  45. 1 0
      arch/powerpc/include/asm/systbl.h
  46. 1 1
      arch/powerpc/include/asm/unistd.h
  47. 1 0
      arch/powerpc/include/uapi/asm/unistd.h
  48. 1 2
      arch/powerpc/mm/copro_fault.c
  49. 5 2
      arch/powerpc/mm/numa.c
  50. 2 1
      arch/powerpc/mm/slice.c
  51. 0 6
      arch/powerpc/perf/hv-24x7.c
  52. 0 6
      arch/powerpc/perf/hv-gpci.c
  53. 1 3
      arch/powerpc/platforms/powernv/opal-lpc.c
  54. 1 1
      arch/powerpc/platforms/powernv/opal-wrappers.S
  55. 0 6
      arch/s390/kernel/perf_cpum_sf.c
  56. 3 3
      arch/sh/kernel/cpu/sh3/setup-sh770x.c
  57. 2 1
      arch/sparc/include/uapi/asm/unistd.h
  58. 1 1
      arch/sparc/kernel/systbls_32.S
  59. 2 2
      arch/sparc/kernel/systbls_64.S
  60. 4 0
      arch/x86/Kconfig
  61. 1 1
      arch/x86/ia32/ia32entry.S
  62. 10 6
      arch/x86/kernel/acpi/boot.c
  63. 0 2
      arch/x86/kernel/apb_timer.c
  64. 2 2
      arch/x86/kernel/apic/apic.c
  65. 5 2
      arch/x86/kernel/cpu/Makefile
  66. 3 2
      arch/x86/kernel/cpu/intel.c
  67. 3 11
      arch/x86/kernel/cpu/perf_event.c
  68. 0 1
      arch/x86/kernel/cpu/perf_event.h
  69. 2 171
      arch/x86/kernel/cpu/perf_event_intel.c
  70. 7 8
      arch/x86/kernel/entry_32.S
  71. 1 2
      arch/x86/kernel/i8259.c
  72. 1 2
      arch/x86/kernel/irqinit.c
  73. 1 1
      arch/x86/kernel/setup.c
  74. 2 2
      arch/x86/kernel/smpboot.c
  75. 4 1
      arch/x86/kernel/tsc.c
  76. 40 15
      arch/x86/kvm/emulate.c
  77. 5 1
      arch/x86/kvm/vmx.c
  78. 1 1
      arch/x86/mm/pageattr.c
  79. 2 0
      arch/x86/platform/intel-mid/sfi.c
  80. 3 2
      block/blk-merge.c
  81. 3 1
      block/elevator.c
  82. 1 2
      block/scsi_ioctl.c
  83. 21 10
      drivers/acpi/ec.c
  84. 54 16
      drivers/acpi/scan.c
  85. 2 1
      drivers/base/dma-contiguous.c
  86. 2 0
      drivers/base/power/main.c
  87. 3 2
      drivers/bcma/host_pci.c
  88. 1 1
      drivers/bcma/main.c
  89. 7 7
      drivers/block/null_blk.c
  90. 19 16
      drivers/block/rbd.c
  91. 0 9
      drivers/block/sunvdc.c
  92. 6 4
      drivers/block/zram/zram_drv.c
  93. 1 1
      drivers/char/raw.c
  94. 3 3
      drivers/clocksource/arm_arch_timer.c
  95. 42 26
      drivers/cpufreq/cpufreq-dt.c
  96. 1 1
      drivers/edac/cpc925_edac.c
  97. 1 1
      drivers/edac/e7xxx_edac.c
  98. 2 2
      drivers/edac/i3200_edac.c
  99. 1 1
      drivers/edac/i82860_edac.c
  100. 10 11
      drivers/gpu/drm/armada/armada_crtc.c

+ 1 - 1
Documentation/ABI/testing/sysfs-ibft

@@ -20,4 +20,4 @@ Date:		November 2007
 Contact:	Konrad Rzeszutek <ketuzsezr@darnok.org>
 Contact:	Konrad Rzeszutek <ketuzsezr@darnok.org>
 Description:	The /sys/firmware/ibft/ethernetX directory will contain
 Description:	The /sys/firmware/ibft/ethernetX directory will contain
 		files that expose the iSCSI Boot Firmware Table NIC data.
 		files that expose the iSCSI Boot Firmware Table NIC data.
-		This can this can the IP address, MAC, and gateway of the NIC.
+		Usually this contains the IP address, MAC, and gateway of the NIC.

+ 1 - 1
Documentation/DocBook/media/Makefile

@@ -25,7 +25,7 @@ GENFILES := $(addprefix $(MEDIA_OBJ_DIR)/, $(MEDIA_TEMP))
 PHONY += cleanmediadocs
 PHONY += cleanmediadocs
 
 
 cleanmediadocs:
 cleanmediadocs:
-	-@rm `find $(MEDIA_OBJ_DIR) -type l` $(GENFILES) $(OBJIMGFILES) 2>/dev/null
+	-@rm -f `find $(MEDIA_OBJ_DIR) -type l` $(GENFILES) $(OBJIMGFILES) 2>/dev/null
 
 
 $(obj)/media_api.xml: $(GENFILES) FORCE
 $(obj)/media_api.xml: $(GENFILES) FORCE
 
 

+ 4 - 0
Documentation/DocBook/media/v4l/compat.xml

@@ -2566,6 +2566,10 @@ fields changed from _s32 to _u32.
 	  <para>Added compound control types and &VIDIOC-QUERY-EXT-CTRL;.
 	  <para>Added compound control types and &VIDIOC-QUERY-EXT-CTRL;.
 	  </para>
 	  </para>
         </listitem>
         </listitem>
+      </orderedlist>
+    </section>
+
+    <section>
       <title>V4L2 in Linux 3.18</title>
       <title>V4L2 in Linux 3.18</title>
       <orderedlist>
       <orderedlist>
 	<listitem>
 	<listitem>

+ 0 - 1
Documentation/HOWTO

@@ -324,7 +324,6 @@ tree, they need to be integration-tested.  For this purpose, a special
 testing repository exists into which virtually all subsystem trees are
 testing repository exists into which virtually all subsystem trees are
 pulled on an almost daily basis:
 pulled on an almost daily basis:
 	http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git
 	http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git
-	http://linux.f-seidel.de/linux-next/pmwiki/
 
 
 This way, the -next kernel gives a summary outlook onto what will be
 This way, the -next kernel gives a summary outlook onto what will be
 expected to go into the mainline kernel at the next merge period.
 expected to go into the mainline kernel at the next merge period.

+ 4 - 6
Documentation/SubmittingPatches

@@ -483,12 +483,10 @@ have been included in the discussion
 
 
 14) Using Reported-by:, Tested-by:, Reviewed-by:, Suggested-by: and Fixes:
 14) Using Reported-by:, Tested-by:, Reviewed-by:, Suggested-by: and Fixes:
 
 
-If this patch fixes a problem reported by somebody else, consider adding a
-Reported-by: tag to credit the reporter for their contribution.  Please
-note that this tag should not be added without the reporter's permission,
-especially if the problem was not reported in a public forum.  That said,
-if we diligently credit our bug reporters, they will, hopefully, be
-inspired to help us again in the future.
+The Reported-by tag gives credit to people who find bugs and report them and it
+hopefully inspires them to help us again in the future.  Please note that if
+the bug was reported in private, then ask for permission first before using the
+Reported-by tag.
 
 
 A Tested-by: tag indicates that the patch has been successfully tested (in
 A Tested-by: tag indicates that the patch has been successfully tested (in
 some environment) by the person named.  This tag informs maintainers that
 some environment) by the person named.  This tag informs maintainers that

+ 0 - 4
Documentation/development-process/2.Process

@@ -289,10 +289,6 @@ lists when they are assembled; they can be downloaded from:
 
 
 	http://www.kernel.org/pub/linux/kernel/next/
 	http://www.kernel.org/pub/linux/kernel/next/
 
 
-Some information about linux-next has been gathered at:
-
-	http://linux.f-seidel.de/linux-next/pmwiki/
-
 Linux-next has become an integral part of the kernel development process;
 Linux-next has become an integral part of the kernel development process;
 all patches merged during a given merge window should really have found
 all patches merged during a given merge window should really have found
 their way into linux-next some time before the merge window opens.
 their way into linux-next some time before the merge window opens.

+ 0 - 4
Documentation/development-process/8.Conclusion

@@ -22,10 +22,6 @@ Beyond that, a valuable resource for kernel developers is:
 
 
 	http://kernelnewbies.org/
 	http://kernelnewbies.org/
 
 
-Information about the linux-next tree gathers at:
-
-	http://linux.f-seidel.de/linux-next/pmwiki/
-
 And, of course, one should not forget http://kernel.org/, the definitive
 And, of course, one should not forget http://kernel.org/, the definitive
 location for kernel release information.
 location for kernel release information.
 
 

+ 2 - 0
Documentation/devicetree/bindings/net/smsc-lan91c111.txt

@@ -11,3 +11,5 @@ Optional properties:
   are supported on the device.  Valid value for SMSC LAN91c111 are
   are supported on the device.  Valid value for SMSC LAN91c111 are
   1, 2 or 4.  If it's omitted or invalid, the size would be 2 meaning
   1, 2 or 4.  If it's omitted or invalid, the size would be 2 meaning
   16-bit access only.
   16-bit access only.
+- power-gpios: GPIO to control the PWRDWN pin
+- reset-gpios: GPIO to control the RESET pin

+ 10 - 0
Documentation/devicetree/bindings/sound/sgtl5000.txt

@@ -7,10 +7,20 @@ Required properties:
 
 
 - clocks : the clock provider of SYS_MCLK
 - clocks : the clock provider of SYS_MCLK
 
 
+- VDDA-supply : the regulator provider of VDDA
+
+- VDDIO-supply: the regulator provider of VDDIO
+
+Optional properties:
+
+- VDDD-supply : the regulator provider of VDDD
+
 Example:
 Example:
 
 
 codec: sgtl5000@0a {
 codec: sgtl5000@0a {
 	compatible = "fsl,sgtl5000";
 	compatible = "fsl,sgtl5000";
 	reg = <0x0a>;
 	reg = <0x0a>;
 	clocks = <&clks 150>;
 	clocks = <&clks 150>;
+	VDDA-supply = <&reg_3p3v>;
+	VDDIO-supply = <&reg_3p3v>;
 };
 };

+ 3 - 0
Documentation/devicetree/bindings/submitting-patches.txt

@@ -12,6 +12,9 @@ I. For patch submitters
 
 
        devicetree@vger.kernel.org
        devicetree@vger.kernel.org
 
 
+  3) The Documentation/ portion of the patch should come in the series before
+     the code implementing the binding.
+
 II. For kernel maintainers
 II. For kernel maintainers
 
 
   1) If you aren't comfortable reviewing a given binding, reply to it and ask
   1) If you aren't comfortable reviewing a given binding, reply to it and ask

+ 15 - 1
Documentation/kernel-parameters.txt

@@ -1264,7 +1264,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 	i8042.noloop	[HW] Disable the AUX Loopback command while probing
 	i8042.noloop	[HW] Disable the AUX Loopback command while probing
 			     for the AUX port
 			     for the AUX port
 	i8042.nomux	[HW] Don't check presence of an active multiplexing
 	i8042.nomux	[HW] Don't check presence of an active multiplexing
-			     controller. Default: true.
+			     controller
 	i8042.nopnp	[HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX
 	i8042.nopnp	[HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX
 			     controllers
 			     controllers
 	i8042.notimeout	[HW] Ignore timeout condition signalled by controller
 	i8042.notimeout	[HW] Ignore timeout condition signalled by controller
@@ -1307,6 +1307,18 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 			.cdrom .chs .ignore_cable are additional options
 			.cdrom .chs .ignore_cable are additional options
 			See Documentation/ide/ide.txt.
 			See Documentation/ide/ide.txt.
 
 
+	ide-generic.probe-mask= [HW] (E)IDE subsystem
+			Format: <int>
+			Probe mask for legacy ISA IDE ports.  Depending on
+			platform up to 6 ports are supported, enabled by
+			setting corresponding bits in the mask to 1.  The
+			default value is 0x0, which has a special meaning.
+			On systems that have PCI, it triggers scanning the
+			PCI bus for the first and the second port, which
+			are then probed.  On systems without PCI the value
+			of 0x0 enables probing the two first ports as if it
+			was 0x3.
+
 	ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem
 	ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem
 			Claim all unknown PCI IDE storage controllers.
 			Claim all unknown PCI IDE storage controllers.
 
 
@@ -1587,6 +1599,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 	kmemleak=	[KNL] Boot-time kmemleak enable/disable
 	kmemleak=	[KNL] Boot-time kmemleak enable/disable
 			Valid arguments: on, off
 			Valid arguments: on, off
 			Default: on
 			Default: on
+			Built with CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y,
+			the default is off.
 
 
 	kmemcheck=	[X86] Boot-time kmemcheck enable/disable/one-shot mode
 	kmemcheck=	[X86] Boot-time kmemcheck enable/disable/one-shot mode
 			Valid arguments: 0, 1, 2
 			Valid arguments: 0, 1, 2

+ 4 - 0
Documentation/kmemleak.txt

@@ -62,6 +62,10 @@ Memory may be allocated or freed before kmemleak is initialised and
 these actions are stored in an early log buffer. The size of this buffer
 these actions are stored in an early log buffer. The size of this buffer
 is configured via the CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE option.
 is configured via the CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE option.
 
 
+If CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF are enabled, the kmemleak is
+disabled by default. Passing "kmemleak=on" on the kernel command
+line enables the function. 
+
 Basic Algorithm
 Basic Algorithm
 ---------------
 ---------------
 
 

+ 1 - 1
Documentation/prctl/Makefile

@@ -1,5 +1,5 @@
 # List of programs to build
 # List of programs to build
-hostprogs-y := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test disable-tsc-test
+hostprogs-$(CONFIG_X86) := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test disable-tsc-test
 # Tell kbuild to always build the programs
 # Tell kbuild to always build the programs
 always := $(hostprogs-y)
 always := $(hostprogs-y)
 
 

+ 33 - 0
Documentation/ptp/testptp.mk

@@ -0,0 +1,33 @@
+# PTP 1588 clock support - User space test program
+#
+# Copyright (C) 2010 OMICRON electronics GmbH
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+CC        = $(CROSS_COMPILE)gcc
+INC       = -I$(KBUILD_OUTPUT)/usr/include
+CFLAGS    = -Wall $(INC)
+LDLIBS    = -lrt
+PROGS     = testptp
+
+all: $(PROGS)
+
+testptp: testptp.o
+
+clean:
+	rm -f testptp.o
+
+distclean: clean
+	rm -f $(PROGS)

+ 3 - 0
Documentation/vDSO/Makefile

@@ -10,3 +10,6 @@ always := $(hostprogs-y)
 HOSTCFLAGS := -I$(objtree)/usr/include -std=gnu99
 HOSTCFLAGS := -I$(objtree)/usr/include -std=gnu99
 HOSTCFLAGS_vdso_standalone_test_x86.o := -fno-asynchronous-unwind-tables -fno-stack-protector
 HOSTCFLAGS_vdso_standalone_test_x86.o := -fno-asynchronous-unwind-tables -fno-stack-protector
 HOSTLOADLIBES_vdso_standalone_test_x86 := -nostdlib
 HOSTLOADLIBES_vdso_standalone_test_x86 := -nostdlib
+ifeq ($(CONFIG_X86_32),y)
+HOSTLOADLIBES_vdso_standalone_test_x86 += -lgcc_s
+endif

+ 1 - 1
Documentation/vDSO/vdso_standalone_test_x86.c

@@ -63,7 +63,7 @@ static inline void linux_exit(int code)
 	x86_syscall3(__NR_exit, code, 0, 0);
 	x86_syscall3(__NR_exit, code, 0, 0);
 }
 }
 
 
-void to_base10(char *lastdig, uint64_t n)
+void to_base10(char *lastdig, time_t n)
 {
 {
 	while (n) {
 	while (n) {
 		*lastdig = (n % 10) + '0';
 		*lastdig = (n % 10) + '0';

+ 1 - 1
Documentation/vm/hugetlbpage.txt

@@ -274,7 +274,7 @@ This command mounts a (pseudo) filesystem of type hugetlbfs on the directory
 /mnt/huge.  Any files created on /mnt/huge uses huge pages.  The uid and gid
 /mnt/huge.  Any files created on /mnt/huge uses huge pages.  The uid and gid
 options sets the owner and group of the root of the file system.  By default
 options sets the owner and group of the root of the file system.  By default
 the uid and gid of the current process are taken.  The mode option sets the
 the uid and gid of the current process are taken.  The mode option sets the
-mode of root of file system to value & 0777.  This value is given in octal.
+mode of root of file system to value & 01777.  This value is given in octal.
 By default the value 0755 is picked. The size option sets the maximum value of
 By default the value 0755 is picked. The size option sets the maximum value of
 memory (huge pages) allowed for that filesystem (/mnt/huge). The size is
 memory (huge pages) allowed for that filesystem (/mnt/huge). The size is
 rounded down to HPAGE_SIZE.  The option nr_inodes sets the maximum number of
 rounded down to HPAGE_SIZE.  The option nr_inodes sets the maximum number of

+ 9 - 6
MAINTAINERS

@@ -1543,6 +1543,7 @@ F:	arch/arm/mach-pxa/include/mach/z2.h
 
 
 ARM/ZYNQ ARCHITECTURE
 ARM/ZYNQ ARCHITECTURE
 M:	Michal Simek <michal.simek@xilinx.com>
 M:	Michal Simek <michal.simek@xilinx.com>
+R:	Sören Brinkmann <soren.brinkmann@xilinx.com>
 L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 W:	http://wiki.xilinx.com
 W:	http://wiki.xilinx.com
 T:	git git://git.xilinx.com/linux-xlnx.git
 T:	git git://git.xilinx.com/linux-xlnx.git
@@ -4312,8 +4313,10 @@ F:	Documentation/blockdev/cpqarray.txt
 F:	drivers/block/cpqarray.*
 F:	drivers/block/cpqarray.*
 
 
 HEWLETT-PACKARD SMART ARRAY RAID DRIVER (hpsa)
 HEWLETT-PACKARD SMART ARRAY RAID DRIVER (hpsa)
-M:	"Stephen M. Cameron" <scameron@beardog.cce.hp.com>
+M:	Don Brace <don.brace@pmcs.com>
 L:	iss_storagedev@hp.com
 L:	iss_storagedev@hp.com
+L:	storagedev@pmcs.com
+L:	linux-scsi@vger.kernel.org
 S:	Supported
 S:	Supported
 F:	Documentation/scsi/hpsa.txt
 F:	Documentation/scsi/hpsa.txt
 F:	drivers/scsi/hpsa*.[ch]
 F:	drivers/scsi/hpsa*.[ch]
@@ -4321,8 +4324,10 @@ F:	include/linux/cciss*.h
 F:	include/uapi/linux/cciss*.h
 F:	include/uapi/linux/cciss*.h
 
 
 HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss)
 HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss)
-M:	Mike Miller <mike.miller@hp.com>
+M:	Don Brace <don.brace@pmcs.com>
 L:	iss_storagedev@hp.com
 L:	iss_storagedev@hp.com
+L:	storagedev@pmcs.com
+L:	linux-scsi@vger.kernel.org
 S:	Supported
 S:	Supported
 F:	Documentation/blockdev/cciss.txt
 F:	Documentation/blockdev/cciss.txt
 F:	drivers/block/cciss*
 F:	drivers/block/cciss*
@@ -4608,7 +4613,7 @@ S:	Supported
 F:	drivers/crypto/nx/
 F:	drivers/crypto/nx/
 
 
 IBM Power 842 compression accelerator
 IBM Power 842 compression accelerator
-M:	Nathan Fontenot <nfont@linux.vnet.ibm.com>
+M:	Dan Streetman <ddstreet@us.ibm.com>
 S:	Supported
 S:	Supported
 F:	drivers/crypto/nx/nx-842.c
 F:	drivers/crypto/nx/nx-842.c
 F:	include/linux/nx842.h
 F:	include/linux/nx842.h
@@ -7175,6 +7180,7 @@ F:	drivers/crypto/picoxcell*
 
 
 PIN CONTROL SUBSYSTEM
 PIN CONTROL SUBSYSTEM
 M:	Linus Walleij <linus.walleij@linaro.org>
 M:	Linus Walleij <linus.walleij@linaro.org>
+L:	linux-gpio@vger.kernel.org
 S:	Maintained
 S:	Maintained
 F:	drivers/pinctrl/
 F:	drivers/pinctrl/
 F:	include/linux/pinctrl/
 F:	include/linux/pinctrl/
@@ -8479,7 +8485,6 @@ F:	arch/arm/mach-s3c24xx/bast-irq.c
 TI DAVINCI MACHINE SUPPORT
 TI DAVINCI MACHINE SUPPORT
 M:	Sekhar Nori <nsekhar@ti.com>
 M:	Sekhar Nori <nsekhar@ti.com>
 M:	Kevin Hilman <khilman@deeprootsystems.com>
 M:	Kevin Hilman <khilman@deeprootsystems.com>
-L:	davinci-linux-open-source@linux.davincidsp.com (moderated for non-subscribers)
 T:	git git://gitorious.org/linux-davinci/linux-davinci.git
 T:	git git://gitorious.org/linux-davinci/linux-davinci.git
 Q:	http://patchwork.kernel.org/project/linux-davinci/list/
 Q:	http://patchwork.kernel.org/project/linux-davinci/list/
 S:	Supported
 S:	Supported
@@ -8489,7 +8494,6 @@ F:	drivers/i2c/busses/i2c-davinci.c
 TI DAVINCI SERIES MEDIA DRIVER
 TI DAVINCI SERIES MEDIA DRIVER
 M:	Lad, Prabhakar <prabhakar.csengg@gmail.com>
 M:	Lad, Prabhakar <prabhakar.csengg@gmail.com>
 L:	linux-media@vger.kernel.org
 L:	linux-media@vger.kernel.org
-L:	davinci-linux-open-source@linux.davincidsp.com (moderated for non-subscribers)
 W:	http://linuxtv.org/
 W:	http://linuxtv.org/
 Q:	http://patchwork.linuxtv.org/project/linux-media/list/
 Q:	http://patchwork.linuxtv.org/project/linux-media/list/
 T:	git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
 T:	git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
@@ -9606,7 +9610,6 @@ F:     drivers/staging/unisys/
 
 
 UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER
 UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER
 M:	Vinayak Holikatti <vinholikatti@gmail.com>
 M:	Vinayak Holikatti <vinholikatti@gmail.com>
-M:	Santosh Y <santoshsy@gmail.com>
 L:	linux-scsi@vger.kernel.org
 L:	linux-scsi@vger.kernel.org
 S:	Supported
 S:	Supported
 F:	Documentation/scsi/ufs.txt
 F:	Documentation/scsi/ufs.txt

+ 2 - 2
Makefile

@@ -1,8 +1,8 @@
 VERSION = 3
 VERSION = 3
 PATCHLEVEL = 18
 PATCHLEVEL = 18
 SUBLEVEL = 0
 SUBLEVEL = 0
-EXTRAVERSION = -rc2
-NAME = Shuffling Zombie Juror
+EXTRAVERSION = -rc3
+NAME = Diseased Newt
 
 
 # *DOCUMENTATION*
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
 # To see a list of typical targets execute "make help"

+ 1 - 1
arch/arm/Kconfig.debug

@@ -1187,7 +1187,7 @@ config DEBUG_UART_VIRT
 	default 0xf1c28000 if DEBUG_SUNXI_UART0
 	default 0xf1c28000 if DEBUG_SUNXI_UART0
 	default 0xf1c28400 if DEBUG_SUNXI_UART1
 	default 0xf1c28400 if DEBUG_SUNXI_UART1
 	default 0xf1f02800 if DEBUG_SUNXI_R_UART
 	default 0xf1f02800 if DEBUG_SUNXI_R_UART
-	default 0xf2100000 if DEBUG_PXA_UART1
+	default 0xf6200000 if DEBUG_PXA_UART1
 	default 0xf4090000 if ARCH_LPC32XX
 	default 0xf4090000 if ARCH_LPC32XX
 	default 0xf4200000 if ARCH_GEMINI
 	default 0xf4200000 if ARCH_GEMINI
 	default 0xf7000000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \
 	default 0xf7000000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \

+ 2 - 0
arch/arm/boot/dts/omap3-n900.dts

@@ -668,6 +668,8 @@
 		bank-width = <2>;
 		bank-width = <2>;
 		pinctrl-names = "default";
 		pinctrl-names = "default";
 		pinctrl-0 = <&ethernet_pins>;
 		pinctrl-0 = <&ethernet_pins>;
+		power-gpios = <&gpio3 22 GPIO_ACTIVE_HIGH>;	/* gpio86 */
+		reset-gpios = <&gpio6 4 GPIO_ACTIVE_HIGH>;	/* gpio164 */
 		gpmc,device-width = <2>;
 		gpmc,device-width = <2>;
 		gpmc,sync-clk-ps = <0>;
 		gpmc,sync-clk-ps = <0>;
 		gpmc,cs-on-ns = <0>;
 		gpmc,cs-on-ns = <0>;

+ 2 - 0
arch/arm/configs/multi_v7_defconfig

@@ -235,6 +235,7 @@ CONFIG_SPI_TEGRA20_SLINK=y
 CONFIG_SPI_XILINX=y
 CONFIG_SPI_XILINX=y
 CONFIG_PINCTRL_AS3722=y
 CONFIG_PINCTRL_AS3722=y
 CONFIG_PINCTRL_PALMAS=y
 CONFIG_PINCTRL_PALMAS=y
+CONFIG_PINCTRL_APQ8084=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_GENERIC_PLATFORM=y
 CONFIG_GPIO_GENERIC_PLATFORM=y
 CONFIG_GPIO_DWAPB=y
 CONFIG_GPIO_DWAPB=y
@@ -411,6 +412,7 @@ CONFIG_NVEC_POWER=y
 CONFIG_NVEC_PAZ00=y
 CONFIG_NVEC_PAZ00=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_GSBI=y
 CONFIG_COMMON_CLK_QCOM=y
 CONFIG_COMMON_CLK_QCOM=y
+CONFIG_APQ_MMCC_8084=y
 CONFIG_MSM_GCC_8660=y
 CONFIG_MSM_GCC_8660=y
 CONFIG_MSM_MMCC_8960=y
 CONFIG_MSM_MMCC_8960=y
 CONFIG_MSM_MMCC_8974=y
 CONFIG_MSM_MMCC_8974=y

+ 2 - 2
arch/arm/configs/omap2plus_defconfig

@@ -86,7 +86,6 @@ CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_BOOTP=y
 CONFIG_IP_PNP_BOOTP=y
 CONFIG_IP_PNP_RARP=y
 CONFIG_IP_PNP_RARP=y
 # CONFIG_INET_LRO is not set
 # CONFIG_INET_LRO is not set
-CONFIG_IPV6=y
 CONFIG_NETFILTER=y
 CONFIG_NETFILTER=y
 CONFIG_CAN=m
 CONFIG_CAN=m
 CONFIG_CAN_C_CAN=m
 CONFIG_CAN_C_CAN=m
@@ -112,6 +111,7 @@ CONFIG_MTD_OOPS=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_INTELEXT=y
 CONFIG_MTD_CFI_INTELEXT=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_ECC_BCH=y
 CONFIG_MTD_NAND_OMAP2=y
 CONFIG_MTD_NAND_OMAP2=y
 CONFIG_MTD_ONENAND=y
 CONFIG_MTD_ONENAND=y
 CONFIG_MTD_ONENAND_VERIFY_WRITE=y
 CONFIG_MTD_ONENAND_VERIFY_WRITE=y
@@ -317,7 +317,7 @@ CONFIG_EXT4_FS=y
 CONFIG_FANOTIFY=y
 CONFIG_FANOTIFY=y
 CONFIG_QUOTA=y
 CONFIG_QUOTA=y
 CONFIG_QFMT_V2=y
 CONFIG_QFMT_V2=y
-CONFIG_AUTOFS4_FS=y
+CONFIG_AUTOFS4_FS=m
 CONFIG_MSDOS_FS=y
 CONFIG_MSDOS_FS=y
 CONFIG_VFAT_FS=y
 CONFIG_VFAT_FS=y
 CONFIG_TMPFS=y
 CONFIG_TMPFS=y

+ 28 - 43
arch/arm/configs/socfpga_defconfig

@@ -1,5 +1,6 @@
-CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_SYSVIPC=y
+CONFIG_FHANDLE=y
+CONFIG_HIGH_RES_TIMERS=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_LOG_BUF_SHIFT=14
@@ -11,23 +12,17 @@ CONFIG_PROFILING=y
 CONFIG_OPROFILE=y
 CONFIG_OPROFILE=y
 CONFIG_MODULES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_UNLOAD=y
-CONFIG_HOTPLUG=y
 # CONFIG_LBDAF is not set
 # CONFIG_LBDAF is not set
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_IOSCHED_DEADLINE is not set
 # CONFIG_IOSCHED_DEADLINE is not set
 # CONFIG_IOSCHED_CFQ is not set
 # CONFIG_IOSCHED_CFQ is not set
 CONFIG_ARCH_SOCFPGA=y
 CONFIG_ARCH_SOCFPGA=y
-CONFIG_MACH_SOCFPGA_CYCLONE5=y
 CONFIG_ARM_THUMBEE=y
 CONFIG_ARM_THUMBEE=y
-# CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA is not set
-# CONFIG_CACHE_L2X0 is not set
-CONFIG_HIGH_RES_TIMERS=y
 CONFIG_SMP=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=2
 CONFIG_NR_CPUS=2
 CONFIG_AEABI=y
 CONFIG_AEABI=y
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE=""
 CONFIG_VFP=y
 CONFIG_VFP=y
 CONFIG_NEON=y
 CONFIG_NEON=y
 CONFIG_NET=y
 CONFIG_NET=y
@@ -41,38 +36,30 @@ CONFIG_IP_PNP=y
 CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_BOOTP=y
 CONFIG_IP_PNP_BOOTP=y
 CONFIG_IP_PNP_RARP=y
 CONFIG_IP_PNP_RARP=y
+CONFIG_IPV6=y
+CONFIG_NETWORK_PHY_TIMESTAMPING=y
+CONFIG_VLAN_8021Q=y
+CONFIG_VLAN_8021Q_GVRP=y
 CONFIG_CAN=y
 CONFIG_CAN=y
-CONFIG_CAN_RAW=y
-CONFIG_CAN_BCM=y
-CONFIG_CAN_GW=y
-CONFIG_CAN_DEV=y
-CONFIG_CAN_CALC_BITTIMING=y
 CONFIG_CAN_C_CAN=y
 CONFIG_CAN_C_CAN=y
 CONFIG_CAN_C_CAN_PLATFORM=y
 CONFIG_CAN_C_CAN_PLATFORM=y
 CONFIG_CAN_DEBUG_DEVICES=y
 CONFIG_CAN_DEBUG_DEVICES=y
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS=y
-CONFIG_PROC_DEVICETREE=y
+CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=2
 CONFIG_BLK_DEV_RAM_COUNT=2
 CONFIG_BLK_DEV_RAM_SIZE=8192
 CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_SRAM=y
 CONFIG_SCSI=y
 CONFIG_SCSI=y
 # CONFIG_SCSI_PROC_FS is not set
 # CONFIG_SCSI_PROC_FS is not set
 CONFIG_BLK_DEV_SD=y
 CONFIG_BLK_DEV_SD=y
 # CONFIG_SCSI_LOWLEVEL is not set
 # CONFIG_SCSI_LOWLEVEL is not set
 CONFIG_NETDEVICES=y
 CONFIG_NETDEVICES=y
 CONFIG_STMMAC_ETH=y
 CONFIG_STMMAC_ETH=y
+CONFIG_DWMAC_SOCFPGA=y
 CONFIG_MICREL_PHY=y
 CONFIG_MICREL_PHY=y
-# CONFIG_STMMAC_PHY_ID_ZERO_WORKAROUND is not set
 CONFIG_INPUT_EVDEV=y
 CONFIG_INPUT_EVDEV=y
-CONFIG_DWMAC_SOCFPGA=y
-CONFIG_PPS=y
-CONFIG_NETWORK_PHY_TIMESTAMPING=y
-CONFIG_PTP_1588_CLOCK=y
-CONFIG_VLAN_8021Q=y
-CONFIG_VLAN_8021Q_GVRP=y
-CONFIG_GARP=y
-CONFIG_IPV6=y
 # CONFIG_SERIO_SERPORT is not set
 # CONFIG_SERIO_SERPORT is not set
 CONFIG_SERIO_AMBAKMI=y
 CONFIG_SERIO_AMBAKMI=y
 CONFIG_LEGACY_PTY_COUNT=16
 CONFIG_LEGACY_PTY_COUNT=16
@@ -81,45 +68,43 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=2
 CONFIG_SERIAL_8250_NR_UARTS=2
 CONFIG_SERIAL_8250_RUNTIME_UARTS=2
 CONFIG_SERIAL_8250_RUNTIME_UARTS=2
 CONFIG_SERIAL_8250_DW=y
 CONFIG_SERIAL_8250_DW=y
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_DESIGNWARE_PLATFORM=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_DWAPB=y
 CONFIG_GPIO_DWAPB=y
-# CONFIG_RTC_HCTOSYS is not set
+CONFIG_PMBUS=y
+CONFIG_SENSORS_LTC2978=y
+CONFIG_SENSORS_LTC2978_REGULATOR=y
 CONFIG_WATCHDOG=y
 CONFIG_WATCHDOG=y
 CONFIG_DW_WATCHDOG=y
 CONFIG_DW_WATCHDOG=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_USB=y
+CONFIG_USB_DWC2=y
+CONFIG_USB_DWC2_HOST=y
+CONFIG_MMC=y
+CONFIG_MMC_DW=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT2_FS_XATTR=y
 CONFIG_EXT2_FS_XATTR=y
 CONFIG_EXT2_FS_POSIX_ACL=y
 CONFIG_EXT2_FS_POSIX_ACL=y
 CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS=y
-CONFIG_NFS_FS=y
-CONFIG_ROOT_NFS=y
-# CONFIG_DNOTIFY is not set
-# CONFIG_INOTIFY_USER is not set
-CONFIG_FHANDLE=y
+CONFIG_EXT4_FS=y
 CONFIG_VFAT_FS=y
 CONFIG_VFAT_FS=y
 CONFIG_NTFS_FS=y
 CONFIG_NTFS_FS=y
 CONFIG_NTFS_RW=y
 CONFIG_NTFS_RW=y
 CONFIG_TMPFS=y
 CONFIG_TMPFS=y
-CONFIG_JFFS2_FS=y
+CONFIG_CONFIGFS_FS=y
+CONFIG_NFS_FS=y
+CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_1=y
+CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_INFO=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DETECT_HUNG_TASK=y
 CONFIG_DETECT_HUNG_TASK=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_SCHED_DEBUG is not set
-CONFIG_DEBUG_INFO=y
 CONFIG_ENABLE_DEFAULT_TRACERS=y
 CONFIG_ENABLE_DEFAULT_TRACERS=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_USER=y
 CONFIG_XZ_DEC=y
 CONFIG_XZ_DEC=y
-CONFIG_I2C=y
-CONFIG_I2C_DESIGNWARE_CORE=y
-CONFIG_I2C_DESIGNWARE_PLATFORM=y
-CONFIG_I2C_CHARDEV=y
-CONFIG_MMC=y
-CONFIG_MMC_DW=y
-CONFIG_PM=y
-CONFIG_SUSPEND=y
-CONFIG_MMC_UNSAFE_RESUME=y
-CONFIG_USB=y
-CONFIG_USB_DWC2=y
-CONFIG_USB_DWC2_HOST=y
-CONFIG_USB_DWC2_PLATFORM=y

+ 1 - 0
arch/arm/include/uapi/asm/unistd.h

@@ -412,6 +412,7 @@
 #define __NR_seccomp			(__NR_SYSCALL_BASE+383)
 #define __NR_seccomp			(__NR_SYSCALL_BASE+383)
 #define __NR_getrandom			(__NR_SYSCALL_BASE+384)
 #define __NR_getrandom			(__NR_SYSCALL_BASE+384)
 #define __NR_memfd_create		(__NR_SYSCALL_BASE+385)
 #define __NR_memfd_create		(__NR_SYSCALL_BASE+385)
+#define __NR_bpf			(__NR_SYSCALL_BASE+386)
 
 
 /*
 /*
  * The following SWIs are ARM private.
  * The following SWIs are ARM private.

+ 11 - 1
arch/arm/kernel/asm-offsets.c

@@ -10,6 +10,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  * published by the Free Software Foundation.
  */
  */
+#include <linux/compiler.h>
 #include <linux/sched.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/mm.h>
 #include <linux/dma-mapping.h>
 #include <linux/dma-mapping.h>
@@ -39,10 +40,19 @@
  * GCC 3.2.x: miscompiles NEW_AUX_ENT in fs/binfmt_elf.c
  * GCC 3.2.x: miscompiles NEW_AUX_ENT in fs/binfmt_elf.c
  *            (http://gcc.gnu.org/PR8896) and incorrect structure
  *            (http://gcc.gnu.org/PR8896) and incorrect structure
  *	      initialisation in fs/jffs2/erase.c
  *	      initialisation in fs/jffs2/erase.c
+ * GCC 4.8.0-4.8.2: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58854
+ *	      miscompiles find_get_entry(), and can result in EXT3 and EXT4
+ *	      filesystem corruption (possibly other FS too).
  */
  */
+#ifdef __GNUC__
 #if (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
 #if (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
 #error Your compiler is too buggy; it is known to miscompile kernels.
 #error Your compiler is too buggy; it is known to miscompile kernels.
-#error    Known good compilers: 3.3
+#error    Known good compilers: 3.3, 4.x
+#endif
+#if GCC_VERSION >= 40800 && GCC_VERSION < 40803
+#error Your compiler is too buggy; it is known to miscompile kernels
+#error and result in filesystem corruption and oopses.
+#endif
 #endif
 #endif
 
 
 int main(void)
 int main(void)

+ 1 - 0
arch/arm/kernel/calls.S

@@ -395,6 +395,7 @@
 		CALL(sys_seccomp)
 		CALL(sys_seccomp)
 		CALL(sys_getrandom)
 		CALL(sys_getrandom)
 /* 385 */	CALL(sys_memfd_create)
 /* 385 */	CALL(sys_memfd_create)
+		CALL(sys_bpf)
 #ifndef syscalls_counted
 #ifndef syscalls_counted
 .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
 .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
 #define syscalls_counted
 #define syscalls_counted

+ 2 - 2
arch/arm/mach-ixp4xx/include/mach/io.h

@@ -76,7 +76,7 @@ static inline void __indirect_writeb(u8 value, volatile void __iomem *p)
 	u32 n, byte_enables, data;
 	u32 n, byte_enables, data;
 
 
 	if (!is_pci_memory(addr)) {
 	if (!is_pci_memory(addr)) {
-		__raw_writeb(value, addr);
+		__raw_writeb(value, p);
 		return;
 		return;
 	}
 	}
 
 
@@ -141,7 +141,7 @@ static inline unsigned char __indirect_readb(const volatile void __iomem *p)
 	u32 n, byte_enables, data;
 	u32 n, byte_enables, data;
 
 
 	if (!is_pci_memory(addr))
 	if (!is_pci_memory(addr))
-		return __raw_readb(addr);
+		return __raw_readb(p);
 
 
 	n = addr % 4;
 	n = addr % 4;
 	byte_enables = (0xf & ~BIT(n)) << IXP4XX_PCI_NP_CBE_BESL;
 	byte_enables = (0xf & ~BIT(n)) << IXP4XX_PCI_NP_CBE_BESL;

+ 4 - 0
arch/arm/mach-omap2/omap_device.c

@@ -917,6 +917,10 @@ static int __init omap_device_late_idle(struct device *dev, void *data)
 static int __init omap_device_late_init(void)
 static int __init omap_device_late_init(void)
 {
 {
 	bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle);
 	bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle);
+
+	WARN(!of_have_populated_dt(),
+		"legacy booting deprecated, please update to boot with .dts\n");
+
 	return 0;
 	return 0;
 }
 }
 omap_late_initcall_sync(omap_device_late_init);
 omap_late_initcall_sync(omap_device_late_init);

+ 0 - 3
arch/arm/mach-omap2/pdata-quirks.c

@@ -252,9 +252,6 @@ static void __init nokia_n900_legacy_init(void)
 		platform_device_register(&omap3_rom_rng_device);
 		platform_device_register(&omap3_rom_rng_device);
 
 
 	}
 	}
-
-	/* Only on some development boards */
-	gpio_request_one(164, GPIOF_OUT_INIT_LOW, "smc91x reset");
 }
 }
 
 
 static void __init omap3_tao3530_legacy_init(void)
 static void __init omap3_tao3530_legacy_init(void)

+ 5 - 0
arch/arm/mach-pxa/include/mach/addr-map.h

@@ -38,6 +38,11 @@
 #define DMEMC_VIRT		IOMEM(0xf6100000)
 #define DMEMC_VIRT		IOMEM(0xf6100000)
 #define DMEMC_SIZE		0x00100000
 #define DMEMC_SIZE		0x00100000
 
 
+/*
+ * Reserved space for low level debug virtual addresses within
+ * 0xf6200000..0xf6201000
+ */
+
 /*
 /*
  * Internal Memory Controller (PXA27x and later)
  * Internal Memory Controller (PXA27x and later)
  */
  */

+ 18 - 8
arch/arm/mm/cache-l2x0.c

@@ -956,7 +956,7 @@ static u32 cache_id_part_number_from_dt;
  * @associativity: variable to return the calculated associativity in
  * @associativity: variable to return the calculated associativity in
  * @max_way_size: the maximum size in bytes for the cache ways
  * @max_way_size: the maximum size in bytes for the cache ways
  */
  */
-static void __init l2x0_cache_size_of_parse(const struct device_node *np,
+static int __init l2x0_cache_size_of_parse(const struct device_node *np,
 					    u32 *aux_val, u32 *aux_mask,
 					    u32 *aux_val, u32 *aux_mask,
 					    u32 *associativity,
 					    u32 *associativity,
 					    u32 max_way_size)
 					    u32 max_way_size)
@@ -974,7 +974,7 @@ static void __init l2x0_cache_size_of_parse(const struct device_node *np,
 	of_property_read_u32(np, "cache-line-size", &line_size);
 	of_property_read_u32(np, "cache-line-size", &line_size);
 
 
 	if (!cache_size || !sets)
 	if (!cache_size || !sets)
-		return;
+		return -ENODEV;
 
 
 	/* All these l2 caches have the same line = block size actually */
 	/* All these l2 caches have the same line = block size actually */
 	if (!line_size) {
 	if (!line_size) {
@@ -1009,7 +1009,7 @@ static void __init l2x0_cache_size_of_parse(const struct device_node *np,
 
 
 	if (way_size > max_way_size) {
 	if (way_size > max_way_size) {
 		pr_err("L2C OF: set size %dKB is too large\n", way_size);
 		pr_err("L2C OF: set size %dKB is too large\n", way_size);
-		return;
+		return -EINVAL;
 	}
 	}
 
 
 	pr_info("L2C OF: override cache size: %d bytes (%dKB)\n",
 	pr_info("L2C OF: override cache size: %d bytes (%dKB)\n",
@@ -1027,7 +1027,7 @@ static void __init l2x0_cache_size_of_parse(const struct device_node *np,
 	if (way_size_bits < 1 || way_size_bits > 6) {
 	if (way_size_bits < 1 || way_size_bits > 6) {
 		pr_err("L2C OF: cache way size illegal: %dKB is not mapped\n",
 		pr_err("L2C OF: cache way size illegal: %dKB is not mapped\n",
 		       way_size);
 		       way_size);
-		return;
+		return -EINVAL;
 	}
 	}
 
 
 	mask |= L2C_AUX_CTRL_WAY_SIZE_MASK;
 	mask |= L2C_AUX_CTRL_WAY_SIZE_MASK;
@@ -1036,6 +1036,8 @@ static void __init l2x0_cache_size_of_parse(const struct device_node *np,
 	*aux_val &= ~mask;
 	*aux_val &= ~mask;
 	*aux_val |= val;
 	*aux_val |= val;
 	*aux_mask &= ~mask;
 	*aux_mask &= ~mask;
+
+	return 0;
 }
 }
 
 
 static void __init l2x0_of_parse(const struct device_node *np,
 static void __init l2x0_of_parse(const struct device_node *np,
@@ -1046,6 +1048,7 @@ static void __init l2x0_of_parse(const struct device_node *np,
 	u32 dirty = 0;
 	u32 dirty = 0;
 	u32 val = 0, mask = 0;
 	u32 val = 0, mask = 0;
 	u32 assoc;
 	u32 assoc;
+	int ret;
 
 
 	of_property_read_u32(np, "arm,tag-latency", &tag);
 	of_property_read_u32(np, "arm,tag-latency", &tag);
 	if (tag) {
 	if (tag) {
@@ -1068,7 +1071,10 @@ static void __init l2x0_of_parse(const struct device_node *np,
 		val |= (dirty - 1) << L2X0_AUX_CTRL_DIRTY_LATENCY_SHIFT;
 		val |= (dirty - 1) << L2X0_AUX_CTRL_DIRTY_LATENCY_SHIFT;
 	}
 	}
 
 
-	l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_256K);
+	ret = l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_256K);
+	if (ret)
+		return;
+
 	if (assoc > 8) {
 	if (assoc > 8) {
 		pr_err("l2x0 of: cache setting yield too high associativity\n");
 		pr_err("l2x0 of: cache setting yield too high associativity\n");
 		pr_err("l2x0 of: %d calculated, max 8\n", assoc);
 		pr_err("l2x0 of: %d calculated, max 8\n", assoc);
@@ -1125,6 +1131,7 @@ static void __init l2c310_of_parse(const struct device_node *np,
 	u32 tag[3] = { 0, 0, 0 };
 	u32 tag[3] = { 0, 0, 0 };
 	u32 filter[2] = { 0, 0 };
 	u32 filter[2] = { 0, 0 };
 	u32 assoc;
 	u32 assoc;
+	int ret;
 
 
 	of_property_read_u32_array(np, "arm,tag-latency", tag, ARRAY_SIZE(tag));
 	of_property_read_u32_array(np, "arm,tag-latency", tag, ARRAY_SIZE(tag));
 	if (tag[0] && tag[1] && tag[2])
 	if (tag[0] && tag[1] && tag[2])
@@ -1152,7 +1159,10 @@ static void __init l2c310_of_parse(const struct device_node *np,
 			       l2x0_base + L310_ADDR_FILTER_START);
 			       l2x0_base + L310_ADDR_FILTER_START);
 	}
 	}
 
 
-	l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_512K);
+	ret = l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_512K);
+	if (ret)
+		return;
+
 	switch (assoc) {
 	switch (assoc) {
 	case 16:
 	case 16:
 		*aux_val &= ~L2X0_AUX_CTRL_ASSOC_MASK;
 		*aux_val &= ~L2X0_AUX_CTRL_ASSOC_MASK;
@@ -1164,8 +1174,8 @@ static void __init l2c310_of_parse(const struct device_node *np,
 		*aux_mask &= ~L2X0_AUX_CTRL_ASSOC_MASK;
 		*aux_mask &= ~L2X0_AUX_CTRL_ASSOC_MASK;
 		break;
 		break;
 	default:
 	default:
-		pr_err("PL310 OF: cache setting yield illegal associativity\n");
-		pr_err("PL310 OF: %d calculated, only 8 and 16 legal\n", assoc);
+		pr_err("L2C-310 OF cache associativity %d invalid, only 8 or 16 permitted\n",
+		       assoc);
 		break;
 		break;
 	}
 	}
 }
 }

+ 0 - 1
arch/arm/mm/dma-mapping.c

@@ -1198,7 +1198,6 @@ __iommu_alloc_remap(struct page **pages, size_t size, gfp_t gfp, pgprot_t prot,
 {
 {
 	return dma_common_pages_remap(pages, size,
 	return dma_common_pages_remap(pages, size,
 			VM_ARM_DMA_CONSISTENT | VM_USERMAP, prot, caller);
 			VM_ARM_DMA_CONSISTENT | VM_USERMAP, prot, caller);
-	return NULL;
 }
 }
 
 
 /*
 /*

+ 3 - 0
arch/arm/mm/highmem.c

@@ -127,8 +127,11 @@ void *kmap_atomic_pfn(unsigned long pfn)
 {
 {
 	unsigned long vaddr;
 	unsigned long vaddr;
 	int idx, type;
 	int idx, type;
+	struct page *page = pfn_to_page(pfn);
 
 
 	pagefault_disable();
 	pagefault_disable();
+	if (!PageHighMem(page))
+		return page_address(page);
 
 
 	type = kmap_atomic_idx_push();
 	type = kmap_atomic_idx_push();
 	idx = type + KM_TYPE_NR * smp_processor_id();
 	idx = type + KM_TYPE_NR * smp_processor_id();

+ 4 - 4
arch/arm/mm/init.c

@@ -559,10 +559,10 @@ void __init mem_init(void)
 #ifdef CONFIG_MODULES
 #ifdef CONFIG_MODULES
 			"    modules : 0x%08lx - 0x%08lx   (%4ld MB)\n"
 			"    modules : 0x%08lx - 0x%08lx   (%4ld MB)\n"
 #endif
 #endif
-			"      .text : 0x%p" " - 0x%p" "   (%4d kB)\n"
-			"      .init : 0x%p" " - 0x%p" "   (%4d kB)\n"
-			"      .data : 0x%p" " - 0x%p" "   (%4d kB)\n"
-			"       .bss : 0x%p" " - 0x%p" "   (%4d kB)\n",
+			"      .text : 0x%p" " - 0x%p" "   (%4td kB)\n"
+			"      .init : 0x%p" " - 0x%p" "   (%4td kB)\n"
+			"      .data : 0x%p" " - 0x%p" "   (%4td kB)\n"
+			"       .bss : 0x%p" " - 0x%p" "   (%4td kB)\n",
 
 
 			MLK(UL(CONFIG_VECTORS_BASE), UL(CONFIG_VECTORS_BASE) +
 			MLK(UL(CONFIG_VECTORS_BASE), UL(CONFIG_VECTORS_BASE) +
 				(PAGE_SIZE)),
 				(PAGE_SIZE)),

+ 1 - 1
arch/m68k/include/asm/unistd.h

@@ -4,7 +4,7 @@
 #include <uapi/asm/unistd.h>
 #include <uapi/asm/unistd.h>
 
 
 
 
-#define NR_syscalls		354
+#define NR_syscalls		355
 
 
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_OLD_STAT
 #define __ARCH_WANT_OLD_STAT

+ 1 - 0
arch/m68k/include/uapi/asm/unistd.h

@@ -359,5 +359,6 @@
 #define __NR_renameat2		351
 #define __NR_renameat2		351
 #define __NR_getrandom		352
 #define __NR_getrandom		352
 #define __NR_memfd_create	353
 #define __NR_memfd_create	353
+#define __NR_bpf		354
 
 
 #endif /* _UAPI_ASM_M68K_UNISTD_H_ */
 #endif /* _UAPI_ASM_M68K_UNISTD_H_ */

+ 1 - 0
arch/m68k/kernel/syscalltable.S

@@ -374,4 +374,5 @@ ENTRY(sys_call_table)
 	.long sys_renameat2
 	.long sys_renameat2
 	.long sys_getrandom
 	.long sys_getrandom
 	.long sys_memfd_create
 	.long sys_memfd_create
+	.long sys_bpf
 
 

+ 4 - 0
arch/microblaze/Kconfig

@@ -129,6 +129,10 @@ endmenu
 
 
 menu "Kernel features"
 menu "Kernel features"
 
 
+config NR_CPUS
+	int
+	default "1"
+
 config ADVANCED_OPTIONS
 config ADVANCED_OPTIONS
 	bool "Prompt for advanced kernel configuration options"
 	bool "Prompt for advanced kernel configuration options"
 	help
 	help

+ 1 - 1
arch/microblaze/include/asm/unistd.h

@@ -38,6 +38,6 @@
 
 
 #endif /* __ASSEMBLY__ */
 #endif /* __ASSEMBLY__ */
 
 
-#define __NR_syscalls         387
+#define __NR_syscalls         388
 
 
 #endif /* _ASM_MICROBLAZE_UNISTD_H */
 #endif /* _ASM_MICROBLAZE_UNISTD_H */

+ 1 - 0
arch/microblaze/include/uapi/asm/unistd.h

@@ -402,5 +402,6 @@
 #define __NR_seccomp		384
 #define __NR_seccomp		384
 #define __NR_getrandom		385
 #define __NR_getrandom		385
 #define __NR_memfd_create	386
 #define __NR_memfd_create	386
+#define __NR_bpf		387
 
 
 #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */
 #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */

+ 1 - 0
arch/microblaze/kernel/syscall_table.S

@@ -387,3 +387,4 @@ ENTRY(sys_call_table)
 	.long sys_seccomp
 	.long sys_seccomp
 	.long sys_getrandom		/* 385 */
 	.long sys_getrandom		/* 385 */
 	.long sys_memfd_create
 	.long sys_memfd_create
+	.long sys_bpf

+ 7 - 2
arch/microblaze/pci/pci-common.c

@@ -660,8 +660,13 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose,
 			res = &hose->mem_resources[memno++];
 			res = &hose->mem_resources[memno++];
 			break;
 			break;
 		}
 		}
-		if (res != NULL)
-			of_pci_range_to_resource(&range, dev, res);
+		if (res != NULL) {
+			res->name = dev->full_name;
+			res->flags = range.flags;
+			res->start = range.cpu_addr;
+			res->end = range.cpu_addr + range.size - 1;
+			res->parent = res->child = res->sibling = NULL;
+		}
 	}
 	}
 
 
 	/* If there's an ISA hole and the pci_mem_offset is -not- matching
 	/* If there's an ISA hole and the pci_mem_offset is -not- matching

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

@@ -71,7 +71,7 @@ pte_t *huge_pte_offset_and_shift(struct mm_struct *mm,
 
 
 void flush_dcache_icache_hugepage(struct page *page);
 void flush_dcache_icache_hugepage(struct page *page);
 
 
-#if defined(CONFIG_PPC_MM_SLICES) || defined(CONFIG_PPC_SUBPAGE_PROT)
+#if defined(CONFIG_PPC_MM_SLICES)
 int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
 int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
 			   unsigned long len);
 			   unsigned long len);
 #else
 #else

+ 1 - 0
arch/powerpc/include/asm/systbl.h

@@ -365,3 +365,4 @@ SYSCALL_SPU(renameat2)
 SYSCALL_SPU(seccomp)
 SYSCALL_SPU(seccomp)
 SYSCALL_SPU(getrandom)
 SYSCALL_SPU(getrandom)
 SYSCALL_SPU(memfd_create)
 SYSCALL_SPU(memfd_create)
+SYSCALL_SPU(bpf)

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

@@ -12,7 +12,7 @@
 #include <uapi/asm/unistd.h>
 #include <uapi/asm/unistd.h>
 
 
 
 
-#define __NR_syscalls		361
+#define __NR_syscalls		362
 
 
 #define __NR__exit __NR_exit
 #define __NR__exit __NR_exit
 #define NR_syscalls	__NR_syscalls
 #define NR_syscalls	__NR_syscalls

+ 1 - 0
arch/powerpc/include/uapi/asm/unistd.h

@@ -383,5 +383,6 @@
 #define __NR_seccomp		358
 #define __NR_seccomp		358
 #define __NR_getrandom		359
 #define __NR_getrandom		359
 #define __NR_memfd_create	360
 #define __NR_memfd_create	360
+#define __NR_bpf		361
 
 
 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */

+ 1 - 2
arch/powerpc/mm/copro_fault.c

@@ -99,8 +99,6 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb)
 	u64 vsid;
 	u64 vsid;
 	int psize, ssize;
 	int psize, ssize;
 
 
-	slb->esid = (ea & ESID_MASK) | SLB_ESID_V;
-
 	switch (REGION_ID(ea)) {
 	switch (REGION_ID(ea)) {
 	case USER_REGION_ID:
 	case USER_REGION_ID:
 		pr_devel("%s: 0x%llx -- USER_REGION_ID\n", __func__, ea);
 		pr_devel("%s: 0x%llx -- USER_REGION_ID\n", __func__, ea);
@@ -133,6 +131,7 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb)
 	vsid |= mmu_psize_defs[psize].sllp |
 	vsid |= mmu_psize_defs[psize].sllp |
 		((ssize == MMU_SEGSIZE_1T) ? SLB_VSID_B_1T : 0);
 		((ssize == MMU_SEGSIZE_1T) ? SLB_VSID_B_1T : 0);
 
 
+	slb->esid = (ea & (ssize == MMU_SEGSIZE_1T ? ESID_MASK_1T : ESID_MASK)) | SLB_ESID_V;
 	slb->vsid = vsid;
 	slb->vsid = vsid;
 
 
 	return 0;
 	return 0;

+ 5 - 2
arch/powerpc/mm/numa.c

@@ -1509,11 +1509,14 @@ static int update_cpu_topology(void *data)
 	cpu = smp_processor_id();
 	cpu = smp_processor_id();
 
 
 	for (update = data; update; update = update->next) {
 	for (update = data; update; update = update->next) {
+		int new_nid = update->new_nid;
 		if (cpu != update->cpu)
 		if (cpu != update->cpu)
 			continue;
 			continue;
 
 
-		unmap_cpu_from_node(update->cpu);
-		map_cpu_to_node(update->cpu, update->new_nid);
+		unmap_cpu_from_node(cpu);
+		map_cpu_to_node(cpu, new_nid);
+		set_cpu_numa_node(cpu, new_nid);
+		set_cpu_numa_mem(cpu, local_memory_node(new_nid));
 		vdso_getcpu_init();
 		vdso_getcpu_init();
 	}
 	}
 
 

+ 2 - 1
arch/powerpc/mm/slice.c

@@ -682,6 +682,7 @@ void slice_set_range_psize(struct mm_struct *mm, unsigned long start,
 	slice_convert(mm, mask, psize);
 	slice_convert(mm, mask, psize);
 }
 }
 
 
+#ifdef CONFIG_HUGETLB_PAGE
 /*
 /*
  * is_hugepage_only_range() is used by generic code to verify whether
  * is_hugepage_only_range() is used by generic code to verify whether
  * a normal mmap mapping (non hugetlbfs) is valid on a given area.
  * a normal mmap mapping (non hugetlbfs) is valid on a given area.
@@ -726,4 +727,4 @@ int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
 #endif
 #endif
 	return !slice_check_fit(mask, available);
 	return !slice_check_fit(mask, available);
 }
 }
-
+#endif

+ 0 - 6
arch/powerpc/perf/hv-24x7.c

@@ -417,11 +417,6 @@ static int h_24x7_event_add(struct perf_event *event, int flags)
 	return 0;
 	return 0;
 }
 }
 
 
-static int h_24x7_event_idx(struct perf_event *event)
-{
-	return 0;
-}
-
 static struct pmu h_24x7_pmu = {
 static struct pmu h_24x7_pmu = {
 	.task_ctx_nr = perf_invalid_context,
 	.task_ctx_nr = perf_invalid_context,
 
 
@@ -433,7 +428,6 @@ static struct pmu h_24x7_pmu = {
 	.start       = h_24x7_event_start,
 	.start       = h_24x7_event_start,
 	.stop        = h_24x7_event_stop,
 	.stop        = h_24x7_event_stop,
 	.read        = h_24x7_event_update,
 	.read        = h_24x7_event_update,
-	.event_idx   = h_24x7_event_idx,
 };
 };
 
 
 static int hv_24x7_init(void)
 static int hv_24x7_init(void)

+ 0 - 6
arch/powerpc/perf/hv-gpci.c

@@ -246,11 +246,6 @@ static int h_gpci_event_init(struct perf_event *event)
 	return 0;
 	return 0;
 }
 }
 
 
-static int h_gpci_event_idx(struct perf_event *event)
-{
-	return 0;
-}
-
 static struct pmu h_gpci_pmu = {
 static struct pmu h_gpci_pmu = {
 	.task_ctx_nr = perf_invalid_context,
 	.task_ctx_nr = perf_invalid_context,
 
 
@@ -262,7 +257,6 @@ static struct pmu h_gpci_pmu = {
 	.start       = h_gpci_event_start,
 	.start       = h_gpci_event_start,
 	.stop        = h_gpci_event_stop,
 	.stop        = h_gpci_event_stop,
 	.read        = h_gpci_event_update,
 	.read        = h_gpci_event_update,
-	.event_idx   = h_gpci_event_idx,
 };
 };
 
 
 static int hv_gpci_init(void)
 static int hv_gpci_init(void)

+ 1 - 3
arch/powerpc/platforms/powernv/opal-lpc.c

@@ -191,7 +191,6 @@ static ssize_t lpc_debug_read(struct file *filp, char __user *ubuf,
 {
 {
 	struct lpc_debugfs_entry *lpc = filp->private_data;
 	struct lpc_debugfs_entry *lpc = filp->private_data;
 	u32 data, pos, len, todo;
 	u32 data, pos, len, todo;
-	__be32 bedata;
 	int rc;
 	int rc;
 
 
 	if (!access_ok(VERIFY_WRITE, ubuf, count))
 	if (!access_ok(VERIFY_WRITE, ubuf, count))
@@ -214,10 +213,9 @@ static ssize_t lpc_debug_read(struct file *filp, char __user *ubuf,
 				len = 2;
 				len = 2;
 		}
 		}
 		rc = opal_lpc_read(opal_lpc_chip_id, lpc->lpc_type, pos,
 		rc = opal_lpc_read(opal_lpc_chip_id, lpc->lpc_type, pos,
-				   &bedata, len);
+				   &data, len);
 		if (rc)
 		if (rc)
 			return -ENXIO;
 			return -ENXIO;
-		data = be32_to_cpu(bedata);
 		switch(len) {
 		switch(len) {
 		case 4:
 		case 4:
 			rc = __put_user((u32)data, (u32 __user *)ubuf);
 			rc = __put_user((u32)data, (u32 __user *)ubuf);

+ 1 - 1
arch/powerpc/platforms/powernv/opal-wrappers.S

@@ -58,7 +58,7 @@ END_FTR_SECTION(0, 1);						\
  */
  */
 
 
 #define OPAL_CALL(name, token)		\
 #define OPAL_CALL(name, token)		\
- _GLOBAL(name);				\
+ _GLOBAL_TOC(name);			\
 	mflr	r0;			\
 	mflr	r0;			\
 	std	r0,16(r1);		\
 	std	r0,16(r1);		\
 	li	r0,token;		\
 	li	r0,token;		\

+ 0 - 6
arch/s390/kernel/perf_cpum_sf.c

@@ -1411,11 +1411,6 @@ static void cpumsf_pmu_del(struct perf_event *event, int flags)
 	perf_pmu_enable(event->pmu);
 	perf_pmu_enable(event->pmu);
 }
 }
 
 
-static int cpumsf_pmu_event_idx(struct perf_event *event)
-{
-	return event->hw.idx;
-}
-
 CPUMF_EVENT_ATTR(SF, SF_CYCLES_BASIC, PERF_EVENT_CPUM_SF);
 CPUMF_EVENT_ATTR(SF, SF_CYCLES_BASIC, PERF_EVENT_CPUM_SF);
 CPUMF_EVENT_ATTR(SF, SF_CYCLES_BASIC_DIAG, PERF_EVENT_CPUM_SF_DIAG);
 CPUMF_EVENT_ATTR(SF, SF_CYCLES_BASIC_DIAG, PERF_EVENT_CPUM_SF_DIAG);
 
 
@@ -1458,7 +1453,6 @@ static struct pmu cpumf_sampling = {
 	.stop	      = cpumsf_pmu_stop,
 	.stop	      = cpumsf_pmu_stop,
 	.read	      = cpumsf_pmu_read,
 	.read	      = cpumsf_pmu_read,
 
 
-	.event_idx    = cpumsf_pmu_event_idx,
 	.attr_groups  = cpumsf_pmu_attr_groups,
 	.attr_groups  = cpumsf_pmu_attr_groups,
 };
 };
 
 

+ 3 - 3
arch/sh/kernel/cpu/sh3/setup-sh770x.c

@@ -118,7 +118,7 @@ static struct plat_sci_port scif0_platform_data = {
 };
 };
 
 
 static struct resource scif0_resources[] = {
 static struct resource scif0_resources[] = {
-	DEFINE_RES_MEM(0xfffffe80, 0x100),
+	DEFINE_RES_MEM(0xfffffe80, 0x10),
 	DEFINE_RES_IRQ(evt2irq(0x4e0)),
 	DEFINE_RES_IRQ(evt2irq(0x4e0)),
 };
 };
 
 
@@ -143,7 +143,7 @@ static struct plat_sci_port scif1_platform_data = {
 };
 };
 
 
 static struct resource scif1_resources[] = {
 static struct resource scif1_resources[] = {
-	DEFINE_RES_MEM(0xa4000150, 0x100),
+	DEFINE_RES_MEM(0xa4000150, 0x10),
 	DEFINE_RES_IRQ(evt2irq(0x900)),
 	DEFINE_RES_IRQ(evt2irq(0x900)),
 };
 };
 
 
@@ -169,7 +169,7 @@ static struct plat_sci_port scif2_platform_data = {
 };
 };
 
 
 static struct resource scif2_resources[] = {
 static struct resource scif2_resources[] = {
-	DEFINE_RES_MEM(0xa4000140, 0x100),
+	DEFINE_RES_MEM(0xa4000140, 0x10),
 	DEFINE_RES_IRQ(evt2irq(0x880)),
 	DEFINE_RES_IRQ(evt2irq(0x880)),
 };
 };
 
 

+ 2 - 1
arch/sparc/include/uapi/asm/unistd.h

@@ -414,8 +414,9 @@
 #define __NR_seccomp		346
 #define __NR_seccomp		346
 #define __NR_getrandom		347
 #define __NR_getrandom		347
 #define __NR_memfd_create	348
 #define __NR_memfd_create	348
+#define __NR_bpf		349
 
 
-#define NR_syscalls		349
+#define NR_syscalls		350
 
 
 /* Bitmask values returned from kern_features system call.  */
 /* Bitmask values returned from kern_features system call.  */
 #define KERN_FEATURE_MIXED_MODE_STACK	0x00000001
 #define KERN_FEATURE_MIXED_MODE_STACK	0x00000001

+ 1 - 1
arch/sparc/kernel/systbls_32.S

@@ -86,4 +86,4 @@ sys_call_table:
 /*330*/	.long sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime
 /*330*/	.long sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime
 /*335*/	.long sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev
 /*335*/	.long sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev
 /*340*/	.long sys_ni_syscall, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
 /*340*/	.long sys_ni_syscall, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
-/*345*/	.long sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create
+/*345*/	.long sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf

+ 2 - 2
arch/sparc/kernel/systbls_64.S

@@ -87,7 +87,7 @@ sys_call_table32:
 /*330*/	.word compat_sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, compat_sys_open_by_handle_at, compat_sys_clock_adjtime
 /*330*/	.word compat_sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, compat_sys_open_by_handle_at, compat_sys_clock_adjtime
 	.word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev
 	.word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev
 /*340*/	.word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
 /*340*/	.word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
-	.word sys32_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create
+	.word sys32_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf
 
 
 #endif /* CONFIG_COMPAT */
 #endif /* CONFIG_COMPAT */
 
 
@@ -166,4 +166,4 @@ sys_call_table:
 /*330*/	.word sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime
 /*330*/	.word sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime
 	.word sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev
 	.word sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev
 /*340*/	.word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
 /*340*/	.word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
-	.word sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create
+	.word sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf

+ 4 - 0
arch/x86/Kconfig

@@ -142,6 +142,10 @@ config INSTRUCTION_DECODER
 	def_bool y
 	def_bool y
 	depends on KPROBES || PERF_EVENTS || UPROBES
 	depends on KPROBES || PERF_EVENTS || UPROBES
 
 
+config PERF_EVENTS_INTEL_UNCORE
+	def_bool y
+	depends on PERF_EVENTS && SUP_SUP_INTEL && PCI
+
 config OUTPUT_FORMAT
 config OUTPUT_FORMAT
 	string
 	string
 	default "elf32-i386" if X86_32
 	default "elf32-i386" if X86_32

+ 1 - 1
arch/x86/ia32/ia32entry.S

@@ -157,7 +157,7 @@ ENTRY(ia32_sysenter_target)
 	 * ourselves.  To save a few cycles, we can check whether
 	 * ourselves.  To save a few cycles, we can check whether
 	 * NT was set instead of doing an unconditional popfq.
 	 * NT was set instead of doing an unconditional popfq.
 	 */
 	 */
-	testl $X86_EFLAGS_NT,EFLAGS(%rsp)	/* saved EFLAGS match cpu */
+	testl $X86_EFLAGS_NT,EFLAGS-ARGOFFSET(%rsp)
 	jnz sysenter_fix_flags
 	jnz sysenter_fix_flags
 sysenter_flags_fixed:
 sysenter_flags_fixed:
 
 

+ 10 - 6
arch/x86/kernel/acpi/boot.c

@@ -397,7 +397,7 @@ static int mp_register_gsi(struct device *dev, u32 gsi, int trigger,
 
 
 	/* Don't set up the ACPI SCI because it's already set up */
 	/* Don't set up the ACPI SCI because it's already set up */
 	if (acpi_gbl_FADT.sci_interrupt == gsi)
 	if (acpi_gbl_FADT.sci_interrupt == gsi)
-		return gsi;
+		return mp_map_gsi_to_irq(gsi, IOAPIC_MAP_ALLOC);
 
 
 	trigger = trigger == ACPI_EDGE_SENSITIVE ? 0 : 1;
 	trigger = trigger == ACPI_EDGE_SENSITIVE ? 0 : 1;
 	polarity = polarity == ACPI_ACTIVE_HIGH ? 0 : 1;
 	polarity = polarity == ACPI_ACTIVE_HIGH ? 0 : 1;
@@ -604,14 +604,18 @@ void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
 
 
 int acpi_gsi_to_irq(u32 gsi, unsigned int *irqp)
 int acpi_gsi_to_irq(u32 gsi, unsigned int *irqp)
 {
 {
-	int irq = mp_map_gsi_to_irq(gsi, IOAPIC_MAP_ALLOC | IOAPIC_MAP_CHECK);
+	int irq;
 
 
-	if (irq >= 0) {
+	if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) {
+		*irqp = gsi;
+	} else {
+		irq = mp_map_gsi_to_irq(gsi,
+					IOAPIC_MAP_ALLOC | IOAPIC_MAP_CHECK);
+		if (irq < 0)
+			return -1;
 		*irqp = irq;
 		*irqp = irq;
-		return 0;
 	}
 	}
-
-	return -1;
+	return 0;
 }
 }
 EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
 EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
 
 

+ 0 - 2
arch/x86/kernel/apb_timer.c

@@ -185,8 +185,6 @@ static void apbt_setup_irq(struct apbt_dev *adev)
 
 
 	irq_modify_status(adev->irq, 0, IRQ_MOVE_PCNTXT);
 	irq_modify_status(adev->irq, 0, IRQ_MOVE_PCNTXT);
 	irq_set_affinity(adev->irq, cpumask_of(adev->cpu));
 	irq_set_affinity(adev->irq, cpumask_of(adev->cpu));
-	/* APB timer irqs are set up as mp_irqs, timer is edge type */
-	__irq_set_handler(adev->irq, handle_edge_irq, 0, "edge");
 }
 }
 
 
 /* Should be called with per cpu */
 /* Should be called with per cpu */

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

@@ -1297,7 +1297,7 @@ void setup_local_APIC(void)
 	unsigned int value, queued;
 	unsigned int value, queued;
 	int i, j, acked = 0;
 	int i, j, acked = 0;
 	unsigned long long tsc = 0, ntsc;
 	unsigned long long tsc = 0, ntsc;
-	long long max_loops = cpu_khz;
+	long long max_loops = cpu_khz ? cpu_khz : 1000000;
 
 
 	if (cpu_has_tsc)
 	if (cpu_has_tsc)
 		rdtscll(tsc);
 		rdtscll(tsc);
@@ -1383,7 +1383,7 @@ void setup_local_APIC(void)
 			break;
 			break;
 		}
 		}
 		if (queued) {
 		if (queued) {
-			if (cpu_has_tsc) {
+			if (cpu_has_tsc && cpu_khz) {
 				rdtscll(ntsc);
 				rdtscll(ntsc);
 				max_loops = (cpu_khz << 10) - (ntsc - tsc);
 				max_loops = (cpu_khz << 10) - (ntsc - tsc);
 			} else
 			} else

+ 5 - 2
arch/x86/kernel/cpu/Makefile

@@ -39,9 +39,12 @@ obj-$(CONFIG_CPU_SUP_AMD)		+= perf_event_amd_iommu.o
 endif
 endif
 obj-$(CONFIG_CPU_SUP_INTEL)		+= perf_event_p6.o perf_event_knc.o perf_event_p4.o
 obj-$(CONFIG_CPU_SUP_INTEL)		+= perf_event_p6.o perf_event_knc.o perf_event_p4.o
 obj-$(CONFIG_CPU_SUP_INTEL)		+= perf_event_intel_lbr.o perf_event_intel_ds.o perf_event_intel.o
 obj-$(CONFIG_CPU_SUP_INTEL)		+= perf_event_intel_lbr.o perf_event_intel_ds.o perf_event_intel.o
-obj-$(CONFIG_CPU_SUP_INTEL)		+= perf_event_intel_uncore.o perf_event_intel_uncore_snb.o
-obj-$(CONFIG_CPU_SUP_INTEL)		+= perf_event_intel_uncore_snbep.o perf_event_intel_uncore_nhmex.o
 obj-$(CONFIG_CPU_SUP_INTEL)		+= perf_event_intel_rapl.o
 obj-$(CONFIG_CPU_SUP_INTEL)		+= perf_event_intel_rapl.o
+
+obj-$(CONFIG_PERF_EVENTS_INTEL_UNCORE)	+= perf_event_intel_uncore.o \
+					   perf_event_intel_uncore_snb.o \
+					   perf_event_intel_uncore_snbep.o \
+					   perf_event_intel_uncore_nhmex.o
 endif
 endif
 
 
 
 

+ 3 - 2
arch/x86/kernel/cpu/intel.c

@@ -213,12 +213,13 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
 {
 {
 #ifdef CONFIG_X86_F00F_BUG
 #ifdef CONFIG_X86_F00F_BUG
 	/*
 	/*
-	 * All current models of Pentium and Pentium with MMX technology CPUs
+	 * All models of Pentium and Pentium with MMX technology CPUs
 	 * have the F0 0F bug, which lets nonprivileged users lock up the
 	 * have the F0 0F bug, which lets nonprivileged users lock up the
 	 * system. Announce that the fault handler will be checking for it.
 	 * system. Announce that the fault handler will be checking for it.
+	 * The Quark is also family 5, but does not have the same bug.
 	 */
 	 */
 	clear_cpu_bug(c, X86_BUG_F00F);
 	clear_cpu_bug(c, X86_BUG_F00F);
-	if (!paravirt_enabled() && c->x86 == 5) {
+	if (!paravirt_enabled() && c->x86 == 5 && c->x86_model < 9) {
 		static int f00f_workaround_enabled;
 		static int f00f_workaround_enabled;
 
 
 		set_cpu_bug(c, X86_BUG_F00F);
 		set_cpu_bug(c, X86_BUG_F00F);

+ 3 - 11
arch/x86/kernel/cpu/perf_event.c

@@ -243,8 +243,9 @@ static bool check_hw_exists(void)
 
 
 msr_fail:
 msr_fail:
 	printk(KERN_CONT "Broken PMU hardware detected, using software events only.\n");
 	printk(KERN_CONT "Broken PMU hardware detected, using software events only.\n");
-	printk(boot_cpu_has(X86_FEATURE_HYPERVISOR) ? KERN_INFO : KERN_ERR
-	       "Failed to access perfctr msr (MSR %x is %Lx)\n", reg, val_new);
+	printk("%sFailed to access perfctr msr (MSR %x is %Lx)\n",
+		boot_cpu_has(X86_FEATURE_HYPERVISOR) ? KERN_INFO : KERN_ERR,
+		reg, val_new);
 
 
 	return false;
 	return false;
 }
 }
@@ -444,12 +445,6 @@ int x86_pmu_hw_config(struct perf_event *event)
 	if (event->attr.type == PERF_TYPE_RAW)
 	if (event->attr.type == PERF_TYPE_RAW)
 		event->hw.config |= event->attr.config & X86_RAW_EVENT_MASK;
 		event->hw.config |= event->attr.config & X86_RAW_EVENT_MASK;
 
 
-	if (event->attr.sample_period && x86_pmu.limit_period) {
-		if (x86_pmu.limit_period(event, event->attr.sample_period) >
-				event->attr.sample_period)
-			return -EINVAL;
-	}
-
 	return x86_setup_perfctr(event);
 	return x86_setup_perfctr(event);
 }
 }
 
 
@@ -987,9 +982,6 @@ int x86_perf_event_set_period(struct perf_event *event)
 	if (left > x86_pmu.max_period)
 	if (left > x86_pmu.max_period)
 		left = x86_pmu.max_period;
 		left = x86_pmu.max_period;
 
 
-	if (x86_pmu.limit_period)
-		left = x86_pmu.limit_period(event, left);
-
 	per_cpu(pmc_prev_left[idx], smp_processor_id()) = left;
 	per_cpu(pmc_prev_left[idx], smp_processor_id()) = left;
 
 
 	/*
 	/*

+ 0 - 1
arch/x86/kernel/cpu/perf_event.h

@@ -445,7 +445,6 @@ struct x86_pmu {
 	struct x86_pmu_quirk *quirks;
 	struct x86_pmu_quirk *quirks;
 	int		perfctr_second_write;
 	int		perfctr_second_write;
 	bool		late_ack;
 	bool		late_ack;
-	unsigned	(*limit_period)(struct perf_event *event, unsigned l);
 
 
 	/*
 	/*
 	 * sysfs attrs
 	 * sysfs attrs

+ 2 - 171
arch/x86/kernel/cpu/perf_event_intel.c

@@ -220,15 +220,6 @@ static struct event_constraint intel_hsw_event_constraints[] = {
 	EVENT_CONSTRAINT_END
 	EVENT_CONSTRAINT_END
 };
 };
 
 
-static struct event_constraint intel_bdw_event_constraints[] = {
-	FIXED_EVENT_CONSTRAINT(0x00c0, 0),	/* INST_RETIRED.ANY */
-	FIXED_EVENT_CONSTRAINT(0x003c, 1),	/* CPU_CLK_UNHALTED.CORE */
-	FIXED_EVENT_CONSTRAINT(0x0300, 2),	/* CPU_CLK_UNHALTED.REF */
-	INTEL_UEVENT_CONSTRAINT(0x148, 0x4),	/* L1D_PEND_MISS.PENDING */
-	INTEL_EVENT_CONSTRAINT(0xa3, 0x4),	/* CYCLE_ACTIVITY.* */
-	EVENT_CONSTRAINT_END
-};
-
 static u64 intel_pmu_event_map(int hw_event)
 static u64 intel_pmu_event_map(int hw_event)
 {
 {
 	return intel_perfmon_event_map[hw_event];
 	return intel_perfmon_event_map[hw_event];
@@ -424,126 +415,6 @@ static __initconst const u64 snb_hw_cache_event_ids
 
 
 };
 };
 
 
-static __initconst const u64 hsw_hw_cache_event_ids
-				[PERF_COUNT_HW_CACHE_MAX]
-				[PERF_COUNT_HW_CACHE_OP_MAX]
-				[PERF_COUNT_HW_CACHE_RESULT_MAX] =
-{
- [ C(L1D ) ] = {
-	[ C(OP_READ) ] = {
-		[ C(RESULT_ACCESS) ] = 0x81d0, 	/* MEM_UOPS_RETIRED.ALL_LOADS */
-		[ C(RESULT_MISS)   ] = 0x151, 	/* L1D.REPLACEMENT */
-	},
-	[ C(OP_WRITE) ] = {
-		[ C(RESULT_ACCESS) ] = 0x82d0, 	/* MEM_UOPS_RETIRED.ALL_STORES */
-		[ C(RESULT_MISS)   ] = 0x0,
-	},
-	[ C(OP_PREFETCH) ] = {
-		[ C(RESULT_ACCESS) ] = 0x0,
-		[ C(RESULT_MISS)   ] = 0x0,
-	},
- },
- [ C(L1I ) ] = {
-	[ C(OP_READ) ] = {
-		[ C(RESULT_ACCESS) ] = 0x0,
-		[ C(RESULT_MISS)   ] = 0x280, 	/* ICACHE.MISSES */
-	},
-	[ C(OP_WRITE) ] = {
-		[ C(RESULT_ACCESS) ] = -1,
-		[ C(RESULT_MISS)   ] = -1,
-	},
-	[ C(OP_PREFETCH) ] = {
-		[ C(RESULT_ACCESS) ] = 0x0,
-		[ C(RESULT_MISS)   ] = 0x0,
-	},
- },
- [ C(LL  ) ] = {
-	[ C(OP_READ) ] = {
-		/* OFFCORE_RESPONSE:ALL_DATA_RD|ALL_CODE_RD */
-		[ C(RESULT_ACCESS) ] = 0x1b7,
-		/* OFFCORE_RESPONSE:ALL_DATA_RD|ALL_CODE_RD|SUPPLIER_NONE|
-                   L3_MISS|ANY_SNOOP */
-		[ C(RESULT_MISS)   ] = 0x1b7,
-	},
-	[ C(OP_WRITE) ] = {
-		[ C(RESULT_ACCESS) ] = 0x1b7, 	/* OFFCORE_RESPONSE:ALL_RFO */
-		/* OFFCORE_RESPONSE:ALL_RFO|SUPPLIER_NONE|L3_MISS|ANY_SNOOP */
-		[ C(RESULT_MISS)   ] = 0x1b7,
-	},
-	[ C(OP_PREFETCH) ] = {
-		[ C(RESULT_ACCESS) ] = 0x0,
-		[ C(RESULT_MISS)   ] = 0x0,
-	},
- },
- [ C(DTLB) ] = {
-	[ C(OP_READ) ] = {
-		[ C(RESULT_ACCESS) ] = 0x81d0, 	/* MEM_UOPS_RETIRED.ALL_LOADS */
-		[ C(RESULT_MISS)   ] = 0x108, 	/* DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK */
-	},
-	[ C(OP_WRITE) ] = {
-		[ C(RESULT_ACCESS) ] = 0x82d0, 	/* MEM_UOPS_RETIRED.ALL_STORES */
-		[ C(RESULT_MISS)   ] = 0x149, 	/* DTLB_STORE_MISSES.MISS_CAUSES_A_WALK */
-	},
-	[ C(OP_PREFETCH) ] = {
-		[ C(RESULT_ACCESS) ] = 0x0,
-		[ C(RESULT_MISS)   ] = 0x0,
-	},
- },
- [ C(ITLB) ] = {
-	[ C(OP_READ) ] = {
-		[ C(RESULT_ACCESS) ] = 0x6085, 	/* ITLB_MISSES.STLB_HIT */
-		[ C(RESULT_MISS)   ] = 0x185, 	/* ITLB_MISSES.MISS_CAUSES_A_WALK */
-	},
-	[ C(OP_WRITE) ] = {
-		[ C(RESULT_ACCESS) ] = -1,
-		[ C(RESULT_MISS)   ] = -1,
-	},
-	[ C(OP_PREFETCH) ] = {
-		[ C(RESULT_ACCESS) ] = -1,
-		[ C(RESULT_MISS)   ] = -1,
-	},
- },
- [ C(BPU ) ] = {
-	[ C(OP_READ) ] = {
-		[ C(RESULT_ACCESS) ] = 0xc4, 	/* BR_INST_RETIRED.ALL_BRANCHES */
-		[ C(RESULT_MISS)   ] = 0xc5, 	/* BR_MISP_RETIRED.ALL_BRANCHES */
-	},
-	[ C(OP_WRITE) ] = {
-		[ C(RESULT_ACCESS) ] = -1,
-		[ C(RESULT_MISS)   ] = -1,
-	},
-	[ C(OP_PREFETCH) ] = {
-		[ C(RESULT_ACCESS) ] = -1,
-		[ C(RESULT_MISS)   ] = -1,
-	},
- },
-};
-
-static __initconst const u64 hsw_hw_cache_extra_regs
-				[PERF_COUNT_HW_CACHE_MAX]
-				[PERF_COUNT_HW_CACHE_OP_MAX]
-				[PERF_COUNT_HW_CACHE_RESULT_MAX] =
-{
- [ C(LL  ) ] = {
-	[ C(OP_READ) ] = {
-		/* OFFCORE_RESPONSE:ALL_DATA_RD|ALL_CODE_RD */
-		[ C(RESULT_ACCESS) ] = 0x2d5,
-		/* OFFCORE_RESPONSE:ALL_DATA_RD|ALL_CODE_RD|SUPPLIER_NONE|
-                   L3_MISS|ANY_SNOOP */
-		[ C(RESULT_MISS)   ] = 0x3fbc0202d5ull,
-	},
-	[ C(OP_WRITE) ] = {
-		[ C(RESULT_ACCESS) ] = 0x122, 	/* OFFCORE_RESPONSE:ALL_RFO */
-		/* OFFCORE_RESPONSE:ALL_RFO|SUPPLIER_NONE|L3_MISS|ANY_SNOOP */
-		[ C(RESULT_MISS)   ] = 0x3fbc020122ull,
-	},
-	[ C(OP_PREFETCH) ] = {
-		[ C(RESULT_ACCESS) ] = 0x0,
-		[ C(RESULT_MISS)   ] = 0x0,
-	},
- },
-};
-
 static __initconst const u64 westmere_hw_cache_event_ids
 static __initconst const u64 westmere_hw_cache_event_ids
 				[PERF_COUNT_HW_CACHE_MAX]
 				[PERF_COUNT_HW_CACHE_MAX]
 				[PERF_COUNT_HW_CACHE_OP_MAX]
 				[PERF_COUNT_HW_CACHE_OP_MAX]
@@ -2034,24 +1905,6 @@ hsw_get_event_constraints(struct cpu_hw_events *cpuc, struct perf_event *event)
 	return c;
 	return c;
 }
 }
 
 
-/*
- * Broadwell:
- * The INST_RETIRED.ALL period always needs to have lowest
- * 6bits cleared (BDM57). It shall not use a period smaller
- * than 100 (BDM11). We combine the two to enforce
- * a min-period of 128.
- */
-static unsigned bdw_limit_period(struct perf_event *event, unsigned left)
-{
-	if ((event->hw.config & INTEL_ARCH_EVENT_MASK) ==
-			X86_CONFIG(.event=0xc0, .umask=0x01)) {
-		if (left < 128)
-			left = 128;
-		left &= ~0x3fu;
-	}
-	return left;
-}
-
 PMU_FORMAT_ATTR(event,	"config:0-7"	);
 PMU_FORMAT_ATTR(event,	"config:0-7"	);
 PMU_FORMAT_ATTR(umask,	"config:8-15"	);
 PMU_FORMAT_ATTR(umask,	"config:8-15"	);
 PMU_FORMAT_ATTR(edge,	"config:18"	);
 PMU_FORMAT_ATTR(edge,	"config:18"	);
@@ -2692,8 +2545,8 @@ __init int intel_pmu_init(void)
 	case 69: /* 22nm Haswell ULT */
 	case 69: /* 22nm Haswell ULT */
 	case 70: /* 22nm Haswell + GT3e (Intel Iris Pro graphics) */
 	case 70: /* 22nm Haswell + GT3e (Intel Iris Pro graphics) */
 		x86_pmu.late_ack = true;
 		x86_pmu.late_ack = true;
-		memcpy(hw_cache_event_ids, hsw_hw_cache_event_ids, sizeof(hw_cache_event_ids));
-		memcpy(hw_cache_extra_regs, hsw_hw_cache_extra_regs, sizeof(hw_cache_extra_regs));
+		memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, sizeof(hw_cache_event_ids));
+		memcpy(hw_cache_extra_regs, snb_hw_cache_extra_regs, sizeof(hw_cache_extra_regs));
 
 
 		intel_pmu_lbr_init_snb();
 		intel_pmu_lbr_init_snb();
 
 
@@ -2712,28 +2565,6 @@ __init int intel_pmu_init(void)
 		pr_cont("Haswell events, ");
 		pr_cont("Haswell events, ");
 		break;
 		break;
 
 
-	case 61: /* 14nm Broadwell Core-M */
-		x86_pmu.late_ack = true;
-		memcpy(hw_cache_event_ids, hsw_hw_cache_event_ids, sizeof(hw_cache_event_ids));
-		memcpy(hw_cache_extra_regs, hsw_hw_cache_extra_regs, sizeof(hw_cache_extra_regs));
-
-		intel_pmu_lbr_init_snb();
-
-		x86_pmu.event_constraints = intel_bdw_event_constraints;
-		x86_pmu.pebs_constraints = intel_hsw_pebs_event_constraints;
-		x86_pmu.extra_regs = intel_snbep_extra_regs;
-		x86_pmu.pebs_aliases = intel_pebs_aliases_snb;
-		/* all extra regs are per-cpu when HT is on */
-		x86_pmu.er_flags |= ERF_HAS_RSP_1;
-		x86_pmu.er_flags |= ERF_NO_HT_SHARING;
-
-		x86_pmu.hw_config = hsw_hw_config;
-		x86_pmu.get_event_constraints = hsw_get_event_constraints;
-		x86_pmu.cpu_events = hsw_events_attrs;
-		x86_pmu.limit_period = bdw_limit_period;
-		pr_cont("Broadwell events, ");
-		break;
-
 	default:
 	default:
 		switch (x86_pmu.version) {
 		switch (x86_pmu.version) {
 		case 1:
 		case 1:

+ 7 - 8
arch/x86/kernel/entry_32.S

@@ -447,15 +447,14 @@ sysenter_exit:
 sysenter_audit:
 sysenter_audit:
 	testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
 	testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
 	jnz syscall_trace_entry
 	jnz syscall_trace_entry
-	addl $4,%esp
-	CFI_ADJUST_CFA_OFFSET -4
-	movl %esi,4(%esp)		/* 5th arg: 4th syscall arg */
-	movl %edx,(%esp)		/* 4th arg: 3rd syscall arg */
-	/* %ecx already in %ecx		   3rd arg: 2nd syscall arg */
-	movl %ebx,%edx			/* 2nd arg: 1st syscall arg */
-	/* %eax already in %eax		   1st arg: syscall number */
+	/* movl PT_EAX(%esp), %eax	already set, syscall number: 1st arg to audit */
+	movl PT_EBX(%esp), %edx		/* ebx/a0: 2nd arg to audit */
+	/* movl PT_ECX(%esp), %ecx	already set, a1: 3nd arg to audit */
+	pushl_cfi PT_ESI(%esp)		/* a3: 5th arg */
+	pushl_cfi PT_EDX+4(%esp)	/* a2: 4th arg */
 	call __audit_syscall_entry
 	call __audit_syscall_entry
-	pushl_cfi %ebx
+	popl_cfi %ecx /* get that remapped edx off the stack */
+	popl_cfi %ecx /* get that remapped esi off the stack */
 	movl PT_EAX(%esp),%eax		/* reload syscall number */
 	movl PT_EAX(%esp),%eax		/* reload syscall number */
 	jmp sysenter_do_call
 	jmp sysenter_do_call
 
 

+ 1 - 2
arch/x86/kernel/i8259.c

@@ -111,8 +111,7 @@ static void make_8259A_irq(unsigned int irq)
 {
 {
 	disable_irq_nosync(irq);
 	disable_irq_nosync(irq);
 	io_apic_irqs &= ~(1<<irq);
 	io_apic_irqs &= ~(1<<irq);
-	irq_set_chip_and_handler_name(irq, &i8259A_chip, handle_level_irq,
-				      i8259A_chip.name);
+	irq_set_chip_and_handler(irq, &i8259A_chip, handle_level_irq);
 	enable_irq(irq);
 	enable_irq(irq);
 }
 }
 
 

+ 1 - 2
arch/x86/kernel/irqinit.c

@@ -70,7 +70,6 @@ int vector_used_by_percpu_irq(unsigned int vector)
 void __init init_ISA_irqs(void)
 void __init init_ISA_irqs(void)
 {
 {
 	struct irq_chip *chip = legacy_pic->chip;
 	struct irq_chip *chip = legacy_pic->chip;
-	const char *name = chip->name;
 	int i;
 	int i;
 
 
 #if defined(CONFIG_X86_64) || defined(CONFIG_X86_LOCAL_APIC)
 #if defined(CONFIG_X86_64) || defined(CONFIG_X86_LOCAL_APIC)
@@ -79,7 +78,7 @@ void __init init_ISA_irqs(void)
 	legacy_pic->init(0);
 	legacy_pic->init(0);
 
 
 	for (i = 0; i < nr_legacy_irqs(); i++)
 	for (i = 0; i < nr_legacy_irqs(); i++)
-		irq_set_chip_and_handler_name(i, chip, handle_level_irq, name);
+		irq_set_chip_and_handler(i, chip, handle_level_irq);
 }
 }
 
 
 void __init init_IRQ(void)
 void __init init_IRQ(void)

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

@@ -1128,7 +1128,6 @@ void __init setup_arch(char **cmdline_p)
 	setup_real_mode();
 	setup_real_mode();
 
 
 	memblock_set_current_limit(get_max_mapped());
 	memblock_set_current_limit(get_max_mapped());
-	dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT);
 
 
 	/*
 	/*
 	 * NOTE: On x86-32, only from this point on, fixmaps are ready for use.
 	 * NOTE: On x86-32, only from this point on, fixmaps are ready for use.
@@ -1159,6 +1158,7 @@ void __init setup_arch(char **cmdline_p)
 	early_acpi_boot_init();
 	early_acpi_boot_init();
 
 
 	initmem_init();
 	initmem_init();
+	dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT);
 
 
 	/*
 	/*
 	 * Reserve memory for crash kernel after SRAT is parsed so that it
 	 * Reserve memory for crash kernel after SRAT is parsed so that it

+ 2 - 2
arch/x86/kernel/smpboot.c

@@ -102,8 +102,6 @@ DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_llc_shared_map);
 DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info);
 DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info);
 EXPORT_PER_CPU_SYMBOL(cpu_info);
 EXPORT_PER_CPU_SYMBOL(cpu_info);
 
 
-static DEFINE_PER_CPU(struct completion, die_complete);
-
 atomic_t init_deasserted;
 atomic_t init_deasserted;
 
 
 /*
 /*
@@ -1318,6 +1316,8 @@ void cpu_disable_common(void)
 	fixup_irqs();
 	fixup_irqs();
 }
 }
 
 
+static DEFINE_PER_CPU(struct completion, die_complete);
+
 int native_cpu_disable(void)
 int native_cpu_disable(void)
 {
 {
 	int ret;
 	int ret;

+ 4 - 1
arch/x86/kernel/tsc.c

@@ -1166,14 +1166,17 @@ void __init tsc_init(void)
 
 
 	x86_init.timers.tsc_pre_init();
 	x86_init.timers.tsc_pre_init();
 
 
-	if (!cpu_has_tsc)
+	if (!cpu_has_tsc) {
+		setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER);
 		return;
 		return;
+	}
 
 
 	tsc_khz = x86_platform.calibrate_tsc();
 	tsc_khz = x86_platform.calibrate_tsc();
 	cpu_khz = tsc_khz;
 	cpu_khz = tsc_khz;
 
 
 	if (!tsc_khz) {
 	if (!tsc_khz) {
 		mark_tsc_unstable("could not calculate TSC khz");
 		mark_tsc_unstable("could not calculate TSC khz");
+		setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER);
 		return;
 		return;
 	}
 	}
 
 

+ 40 - 15
arch/x86/kvm/emulate.c

@@ -574,12 +574,14 @@ static inline int assign_eip_far(struct x86_emulate_ctxt *ctxt, ulong dst,
 	case 4:
 	case 4:
 		ctxt->_eip = (u32)dst;
 		ctxt->_eip = (u32)dst;
 		break;
 		break;
+#ifdef CONFIG_X86_64
 	case 8:
 	case 8:
 		if ((cs_l && is_noncanonical_address(dst)) ||
 		if ((cs_l && is_noncanonical_address(dst)) ||
-		    (!cs_l && (dst & ~(u32)-1)))
+		    (!cs_l && (dst >> 32) != 0))
 			return emulate_gp(ctxt, 0);
 			return emulate_gp(ctxt, 0);
 		ctxt->_eip = dst;
 		ctxt->_eip = dst;
 		break;
 		break;
+#endif
 	default:
 	default:
 		WARN(1, "unsupported eip assignment size\n");
 		WARN(1, "unsupported eip assignment size\n");
 	}
 	}
@@ -641,7 +643,8 @@ static bool insn_aligned(struct x86_emulate_ctxt *ctxt, unsigned size)
 
 
 static int __linearize(struct x86_emulate_ctxt *ctxt,
 static int __linearize(struct x86_emulate_ctxt *ctxt,
 		     struct segmented_address addr,
 		     struct segmented_address addr,
-		     unsigned size, bool write, bool fetch,
+		     unsigned *max_size, unsigned size,
+		     bool write, bool fetch,
 		     ulong *linear)
 		     ulong *linear)
 {
 {
 	struct desc_struct desc;
 	struct desc_struct desc;
@@ -652,10 +655,15 @@ static int __linearize(struct x86_emulate_ctxt *ctxt,
 	unsigned cpl;
 	unsigned cpl;
 
 
 	la = seg_base(ctxt, addr.seg) + addr.ea;
 	la = seg_base(ctxt, addr.seg) + addr.ea;
+	*max_size = 0;
 	switch (ctxt->mode) {
 	switch (ctxt->mode) {
 	case X86EMUL_MODE_PROT64:
 	case X86EMUL_MODE_PROT64:
 		if (((signed long)la << 16) >> 16 != la)
 		if (((signed long)la << 16) >> 16 != la)
 			return emulate_gp(ctxt, 0);
 			return emulate_gp(ctxt, 0);
+
+		*max_size = min_t(u64, ~0u, (1ull << 48) - la);
+		if (size > *max_size)
+			goto bad;
 		break;
 		break;
 	default:
 	default:
 		usable = ctxt->ops->get_segment(ctxt, &sel, &desc, NULL,
 		usable = ctxt->ops->get_segment(ctxt, &sel, &desc, NULL,
@@ -673,20 +681,25 @@ static int __linearize(struct x86_emulate_ctxt *ctxt,
 		if ((ctxt->mode == X86EMUL_MODE_REAL) && !fetch &&
 		if ((ctxt->mode == X86EMUL_MODE_REAL) && !fetch &&
 		    (ctxt->d & NoBigReal)) {
 		    (ctxt->d & NoBigReal)) {
 			/* la is between zero and 0xffff */
 			/* la is between zero and 0xffff */
-			if (la > 0xffff || (u32)(la + size - 1) > 0xffff)
+			if (la > 0xffff)
 				goto bad;
 				goto bad;
+			*max_size = 0x10000 - la;
 		} else if ((desc.type & 8) || !(desc.type & 4)) {
 		} else if ((desc.type & 8) || !(desc.type & 4)) {
 			/* expand-up segment */
 			/* expand-up segment */
-			if (addr.ea > lim || (u32)(addr.ea + size - 1) > lim)
+			if (addr.ea > lim)
 				goto bad;
 				goto bad;
+			*max_size = min_t(u64, ~0u, (u64)lim + 1 - addr.ea);
 		} else {
 		} else {
 			/* expand-down segment */
 			/* expand-down segment */
-			if (addr.ea <= lim || (u32)(addr.ea + size - 1) <= lim)
+			if (addr.ea <= lim)
 				goto bad;
 				goto bad;
 			lim = desc.d ? 0xffffffff : 0xffff;
 			lim = desc.d ? 0xffffffff : 0xffff;
-			if (addr.ea > lim || (u32)(addr.ea + size - 1) > lim)
+			if (addr.ea > lim)
 				goto bad;
 				goto bad;
+			*max_size = min_t(u64, ~0u, (u64)lim + 1 - addr.ea);
 		}
 		}
+		if (size > *max_size)
+			goto bad;
 		cpl = ctxt->ops->cpl(ctxt);
 		cpl = ctxt->ops->cpl(ctxt);
 		if (!(desc.type & 8)) {
 		if (!(desc.type & 8)) {
 			/* data segment */
 			/* data segment */
@@ -711,9 +724,9 @@ static int __linearize(struct x86_emulate_ctxt *ctxt,
 	return X86EMUL_CONTINUE;
 	return X86EMUL_CONTINUE;
 bad:
 bad:
 	if (addr.seg == VCPU_SREG_SS)
 	if (addr.seg == VCPU_SREG_SS)
-		return emulate_ss(ctxt, sel);
+		return emulate_ss(ctxt, 0);
 	else
 	else
-		return emulate_gp(ctxt, sel);
+		return emulate_gp(ctxt, 0);
 }
 }
 
 
 static int linearize(struct x86_emulate_ctxt *ctxt,
 static int linearize(struct x86_emulate_ctxt *ctxt,
@@ -721,7 +734,8 @@ static int linearize(struct x86_emulate_ctxt *ctxt,
 		     unsigned size, bool write,
 		     unsigned size, bool write,
 		     ulong *linear)
 		     ulong *linear)
 {
 {
-	return __linearize(ctxt, addr, size, write, false, linear);
+	unsigned max_size;
+	return __linearize(ctxt, addr, &max_size, size, write, false, linear);
 }
 }
 
 
 
 
@@ -746,17 +760,27 @@ static int segmented_read_std(struct x86_emulate_ctxt *ctxt,
 static int __do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt, int op_size)
 static int __do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt, int op_size)
 {
 {
 	int rc;
 	int rc;
-	unsigned size;
+	unsigned size, max_size;
 	unsigned long linear;
 	unsigned long linear;
 	int cur_size = ctxt->fetch.end - ctxt->fetch.data;
 	int cur_size = ctxt->fetch.end - ctxt->fetch.data;
 	struct segmented_address addr = { .seg = VCPU_SREG_CS,
 	struct segmented_address addr = { .seg = VCPU_SREG_CS,
 					   .ea = ctxt->eip + cur_size };
 					   .ea = ctxt->eip + cur_size };
 
 
-	size = 15UL ^ cur_size;
-	rc = __linearize(ctxt, addr, size, false, true, &linear);
+	/*
+	 * We do not know exactly how many bytes will be needed, and
+	 * __linearize is expensive, so fetch as much as possible.  We
+	 * just have to avoid going beyond the 15 byte limit, the end
+	 * of the segment, or the end of the page.
+	 *
+	 * __linearize is called with size 0 so that it does not do any
+	 * boundary check itself.  Instead, we use max_size to check
+	 * against op_size.
+	 */
+	rc = __linearize(ctxt, addr, &max_size, 0, false, true, &linear);
 	if (unlikely(rc != X86EMUL_CONTINUE))
 	if (unlikely(rc != X86EMUL_CONTINUE))
 		return rc;
 		return rc;
 
 
+	size = min_t(unsigned, 15UL ^ cur_size, max_size);
 	size = min_t(unsigned, size, PAGE_SIZE - offset_in_page(linear));
 	size = min_t(unsigned, size, PAGE_SIZE - offset_in_page(linear));
 
 
 	/*
 	/*
@@ -766,7 +790,8 @@ static int __do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt, int op_size)
 	 * still, we must have hit the 15-byte boundary.
 	 * still, we must have hit the 15-byte boundary.
 	 */
 	 */
 	if (unlikely(size < op_size))
 	if (unlikely(size < op_size))
-		return X86EMUL_UNHANDLEABLE;
+		return emulate_gp(ctxt, 0);
+
 	rc = ctxt->ops->fetch(ctxt, linear, ctxt->fetch.end,
 	rc = ctxt->ops->fetch(ctxt, linear, ctxt->fetch.end,
 			      size, &ctxt->exception);
 			      size, &ctxt->exception);
 	if (unlikely(rc != X86EMUL_CONTINUE))
 	if (unlikely(rc != X86EMUL_CONTINUE))
@@ -2012,7 +2037,7 @@ static int em_jmp_far(struct x86_emulate_ctxt *ctxt)
 
 
 	rc = assign_eip_far(ctxt, ctxt->src.val, new_desc.l);
 	rc = assign_eip_far(ctxt, ctxt->src.val, new_desc.l);
 	if (rc != X86EMUL_CONTINUE) {
 	if (rc != X86EMUL_CONTINUE) {
-		WARN_ON(!ctxt->mode != X86EMUL_MODE_PROT64);
+		WARN_ON(ctxt->mode != X86EMUL_MODE_PROT64);
 		/* assigning eip failed; restore the old cs */
 		/* assigning eip failed; restore the old cs */
 		ops->set_segment(ctxt, old_sel, &old_desc, 0, VCPU_SREG_CS);
 		ops->set_segment(ctxt, old_sel, &old_desc, 0, VCPU_SREG_CS);
 		return rc;
 		return rc;
@@ -2109,7 +2134,7 @@ static int em_ret_far(struct x86_emulate_ctxt *ctxt)
 		return rc;
 		return rc;
 	rc = assign_eip_far(ctxt, eip, new_desc.l);
 	rc = assign_eip_far(ctxt, eip, new_desc.l);
 	if (rc != X86EMUL_CONTINUE) {
 	if (rc != X86EMUL_CONTINUE) {
-		WARN_ON(!ctxt->mode != X86EMUL_MODE_PROT64);
+		WARN_ON(ctxt->mode != X86EMUL_MODE_PROT64);
 		ops->set_segment(ctxt, old_cs, &old_desc, 0, VCPU_SREG_CS);
 		ops->set_segment(ctxt, old_cs, &old_desc, 0, VCPU_SREG_CS);
 	}
 	}
 	return rc;
 	return rc;

+ 5 - 1
arch/x86/kvm/vmx.c

@@ -4579,7 +4579,7 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu)
 		vmcs_write32(TPR_THRESHOLD, 0);
 		vmcs_write32(TPR_THRESHOLD, 0);
 	}
 	}
 
 
-	kvm_vcpu_reload_apic_access_page(vcpu);
+	kvm_make_request(KVM_REQ_APIC_PAGE_RELOAD, vcpu);
 
 
 	if (vmx_vm_has_apicv(vcpu->kvm))
 	if (vmx_vm_has_apicv(vcpu->kvm))
 		memset(&vmx->pi_desc, 0, sizeof(struct pi_desc));
 		memset(&vmx->pi_desc, 0, sizeof(struct pi_desc));
@@ -6426,6 +6426,8 @@ static void copy_shadow_to_vmcs12(struct vcpu_vmx *vmx)
 	const unsigned long *fields = shadow_read_write_fields;
 	const unsigned long *fields = shadow_read_write_fields;
 	const int num_fields = max_shadow_read_write_fields;
 	const int num_fields = max_shadow_read_write_fields;
 
 
+	preempt_disable();
+
 	vmcs_load(shadow_vmcs);
 	vmcs_load(shadow_vmcs);
 
 
 	for (i = 0; i < num_fields; i++) {
 	for (i = 0; i < num_fields; i++) {
@@ -6449,6 +6451,8 @@ static void copy_shadow_to_vmcs12(struct vcpu_vmx *vmx)
 
 
 	vmcs_clear(shadow_vmcs);
 	vmcs_clear(shadow_vmcs);
 	vmcs_load(vmx->loaded_vmcs->vmcs);
 	vmcs_load(vmx->loaded_vmcs->vmcs);
+
+	preempt_enable();
 }
 }
 
 
 static void copy_vmcs12_to_shadow(struct vcpu_vmx *vmx)
 static void copy_vmcs12_to_shadow(struct vcpu_vmx *vmx)

+ 1 - 1
arch/x86/mm/pageattr.c

@@ -409,7 +409,7 @@ phys_addr_t slow_virt_to_phys(void *__virt_addr)
 	psize = page_level_size(level);
 	psize = page_level_size(level);
 	pmask = page_level_mask(level);
 	pmask = page_level_mask(level);
 	offset = virt_addr & ~pmask;
 	offset = virt_addr & ~pmask;
-	phys_addr = pte_pfn(*pte) << PAGE_SHIFT;
+	phys_addr = (phys_addr_t)pte_pfn(*pte) << PAGE_SHIFT;
 	return (phys_addr | offset);
 	return (phys_addr | offset);
 }
 }
 EXPORT_SYMBOL_GPL(slow_virt_to_phys);
 EXPORT_SYMBOL_GPL(slow_virt_to_phys);

+ 2 - 0
arch/x86/platform/intel-mid/sfi.c

@@ -106,6 +106,7 @@ int __init sfi_parse_mtmr(struct sfi_table_header *table)
 			mp_irq.dstapic = MP_APIC_ALL;
 			mp_irq.dstapic = MP_APIC_ALL;
 			mp_irq.dstirq = pentry->irq;
 			mp_irq.dstirq = pentry->irq;
 			mp_save_irq(&mp_irq);
 			mp_save_irq(&mp_irq);
+			mp_map_gsi_to_irq(pentry->irq, IOAPIC_MAP_ALLOC);
 	}
 	}
 
 
 	return 0;
 	return 0;
@@ -176,6 +177,7 @@ int __init sfi_parse_mrtc(struct sfi_table_header *table)
 		mp_irq.dstapic = MP_APIC_ALL;
 		mp_irq.dstapic = MP_APIC_ALL;
 		mp_irq.dstirq = pentry->irq;
 		mp_irq.dstirq = pentry->irq;
 		mp_save_irq(&mp_irq);
 		mp_save_irq(&mp_irq);
+		mp_map_gsi_to_irq(pentry->irq, IOAPIC_MAP_ALLOC);
 	}
 	}
 	return 0;
 	return 0;
 }
 }

+ 3 - 2
block/blk-merge.c

@@ -99,16 +99,17 @@ void blk_recount_segments(struct request_queue *q, struct bio *bio)
 {
 {
 	bool no_sg_merge = !!test_bit(QUEUE_FLAG_NO_SG_MERGE,
 	bool no_sg_merge = !!test_bit(QUEUE_FLAG_NO_SG_MERGE,
 			&q->queue_flags);
 			&q->queue_flags);
+	bool merge_not_need = bio->bi_vcnt < queue_max_segments(q);
 
 
 	if (no_sg_merge && !bio_flagged(bio, BIO_CLONED) &&
 	if (no_sg_merge && !bio_flagged(bio, BIO_CLONED) &&
-			bio->bi_vcnt < queue_max_segments(q))
+			merge_not_need)
 		bio->bi_phys_segments = bio->bi_vcnt;
 		bio->bi_phys_segments = bio->bi_vcnt;
 	else {
 	else {
 		struct bio *nxt = bio->bi_next;
 		struct bio *nxt = bio->bi_next;
 
 
 		bio->bi_next = NULL;
 		bio->bi_next = NULL;
 		bio->bi_phys_segments = __blk_recalc_rq_segments(q, bio,
 		bio->bi_phys_segments = __blk_recalc_rq_segments(q, bio,
-				no_sg_merge);
+				no_sg_merge && merge_not_need);
 		bio->bi_next = nxt;
 		bio->bi_next = nxt;
 	}
 	}
 
 

+ 3 - 1
block/elevator.c

@@ -229,7 +229,9 @@ int elevator_init(struct request_queue *q, char *name)
 	}
 	}
 
 
 	err = e->ops.elevator_init_fn(q, e);
 	err = e->ops.elevator_init_fn(q, e);
-	return 0;
+	if (err)
+		elevator_put(e);
+	return err;
 }
 }
 EXPORT_SYMBOL(elevator_init);
 EXPORT_SYMBOL(elevator_init);
 
 

+ 1 - 2
block/scsi_ioctl.c

@@ -508,7 +508,7 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
 
 
 	if (bytes && blk_rq_map_kern(q, rq, buffer, bytes, __GFP_WAIT)) {
 	if (bytes && blk_rq_map_kern(q, rq, buffer, bytes, __GFP_WAIT)) {
 		err = DRIVER_ERROR << 24;
 		err = DRIVER_ERROR << 24;
-		goto out;
+		goto error;
 	}
 	}
 
 
 	memset(sense, 0, sizeof(sense));
 	memset(sense, 0, sizeof(sense));
@@ -517,7 +517,6 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
 
 
 	blk_execute_rq(q, disk, rq, 0);
 	blk_execute_rq(q, disk, rq, 0);
 
 
-out:
 	err = rq->errors & 0xff;	/* only 8 bit SCSI status */
 	err = rq->errors & 0xff;	/* only 8 bit SCSI status */
 	if (err) {
 	if (err) {
 		if (rq->sense_len && rq->sense) {
 		if (rq->sense_len && rq->sense) {

+ 21 - 10
drivers/acpi/ec.c

@@ -126,6 +126,7 @@ static int EC_FLAGS_MSI; /* Out-of-spec MSI controller */
 static int EC_FLAGS_VALIDATE_ECDT; /* ASUStec ECDTs need to be validated */
 static int EC_FLAGS_VALIDATE_ECDT; /* ASUStec ECDTs need to be validated */
 static int EC_FLAGS_SKIP_DSDT_SCAN; /* Not all BIOS survive early DSDT scan */
 static int EC_FLAGS_SKIP_DSDT_SCAN; /* Not all BIOS survive early DSDT scan */
 static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */
 static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */
+static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */
 
 
 /* --------------------------------------------------------------------------
 /* --------------------------------------------------------------------------
  *                           Transaction Management
  *                           Transaction Management
@@ -236,13 +237,8 @@ static bool advance_transaction(struct acpi_ec *ec)
 		}
 		}
 		return wakeup;
 		return wakeup;
 	} else {
 	} else {
-		/*
-		 * There is firmware refusing to respond QR_EC when SCI_EVT
-		 * is not set, for which case, we complete the QR_EC
-		 * without issuing it to the firmware.
-		 * https://bugzilla.kernel.org/show_bug.cgi?id=86211
-		 */
-		if (!(status & ACPI_EC_FLAG_SCI) &&
+		if (EC_FLAGS_QUERY_HANDSHAKE &&
+		    !(status & ACPI_EC_FLAG_SCI) &&
 		    (t->command == ACPI_EC_COMMAND_QUERY)) {
 		    (t->command == ACPI_EC_COMMAND_QUERY)) {
 			t->flags |= ACPI_EC_COMMAND_POLL;
 			t->flags |= ACPI_EC_COMMAND_POLL;
 			t->rdata[t->ri++] = 0x00;
 			t->rdata[t->ri++] = 0x00;
@@ -334,13 +330,13 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
 	pr_debug("***** Command(%s) started *****\n",
 	pr_debug("***** Command(%s) started *****\n",
 		 acpi_ec_cmd_string(t->command));
 		 acpi_ec_cmd_string(t->command));
 	start_transaction(ec);
 	start_transaction(ec);
-	spin_unlock_irqrestore(&ec->lock, tmp);
-	ret = ec_poll(ec);
-	spin_lock_irqsave(&ec->lock, tmp);
 	if (ec->curr->command == ACPI_EC_COMMAND_QUERY) {
 	if (ec->curr->command == ACPI_EC_COMMAND_QUERY) {
 		clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
 		clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
 		pr_debug("***** Event stopped *****\n");
 		pr_debug("***** Event stopped *****\n");
 	}
 	}
+	spin_unlock_irqrestore(&ec->lock, tmp);
+	ret = ec_poll(ec);
+	spin_lock_irqsave(&ec->lock, tmp);
 	pr_debug("***** Command(%s) stopped *****\n",
 	pr_debug("***** Command(%s) stopped *****\n",
 		 acpi_ec_cmd_string(t->command));
 		 acpi_ec_cmd_string(t->command));
 	ec->curr = NULL;
 	ec->curr = NULL;
@@ -1011,6 +1007,18 @@ static int ec_enlarge_storm_threshold(const struct dmi_system_id *id)
 	return 0;
 	return 0;
 }
 }
 
 
+/*
+ * Acer EC firmware refuses to respond QR_EC when SCI_EVT is not set, for
+ * which case, we complete the QR_EC without issuing it to the firmware.
+ * https://bugzilla.kernel.org/show_bug.cgi?id=86211
+ */
+static int ec_flag_query_handshake(const struct dmi_system_id *id)
+{
+	pr_debug("Detected the EC firmware requiring QR_EC issued when SCI_EVT set\n");
+	EC_FLAGS_QUERY_HANDSHAKE = 1;
+	return 0;
+}
+
 /*
 /*
  * On some hardware it is necessary to clear events accumulated by the EC during
  * On some hardware it is necessary to clear events accumulated by the EC during
  * sleep. These ECs stop reporting GPEs until they are manually polled, if too
  * sleep. These ECs stop reporting GPEs until they are manually polled, if too
@@ -1085,6 +1093,9 @@ static struct dmi_system_id ec_dmi_table[] __initdata = {
 	{
 	{
 	ec_clear_on_resume, "Samsung hardware", {
 	ec_clear_on_resume, "Samsung hardware", {
 	DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD.")}, NULL},
 	DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD.")}, NULL},
+	{
+	ec_flag_query_handshake, "Acer hardware", {
+	DMI_MATCH(DMI_SYS_VENDOR, "Acer"), }, NULL},
 	{},
 	{},
 };
 };
 
 

+ 54 - 16
drivers/acpi/scan.c

@@ -141,6 +141,53 @@ static int create_modalias(struct acpi_device *acpi_dev, char *modalias,
 	return len;
 	return len;
 }
 }
 
 
+/*
+ * acpi_companion_match() - Can we match via ACPI companion device
+ * @dev: Device in question
+ *
+ * Check if the given device has an ACPI companion and if that companion has
+ * a valid list of PNP IDs, and if the device is the first (primary) physical
+ * device associated with it.
+ *
+ * If multiple physical devices are attached to a single ACPI companion, we need
+ * to be careful.  The usage scenario for this kind of relationship is that all
+ * of the physical devices in question use resources provided by the ACPI
+ * companion.  A typical case is an MFD device where all the sub-devices share
+ * the parent's ACPI companion.  In such cases we can only allow the primary
+ * (first) physical device to be matched with the help of the companion's PNP
+ * IDs.
+ *
+ * Additional physical devices sharing the ACPI companion can still use
+ * resources available from it but they will be matched normally using functions
+ * provided by their bus types (and analogously for their modalias).
+ */
+static bool acpi_companion_match(const struct device *dev)
+{
+	struct acpi_device *adev;
+	bool ret;
+
+	adev = ACPI_COMPANION(dev);
+	if (!adev)
+		return false;
+
+	if (list_empty(&adev->pnp.ids))
+		return false;
+
+	mutex_lock(&adev->physical_node_lock);
+	if (list_empty(&adev->physical_node_list)) {
+		ret = false;
+	} else {
+		const struct acpi_device_physical_node *node;
+
+		node = list_first_entry(&adev->physical_node_list,
+					struct acpi_device_physical_node, node);
+		ret = node->dev == dev;
+	}
+	mutex_unlock(&adev->physical_node_lock);
+
+	return ret;
+}
+
 /*
 /*
  * Creates uevent modalias field for ACPI enumerated devices.
  * Creates uevent modalias field for ACPI enumerated devices.
  * Because the other buses does not support ACPI HIDs & CIDs.
  * Because the other buses does not support ACPI HIDs & CIDs.
@@ -149,20 +196,14 @@ static int create_modalias(struct acpi_device *acpi_dev, char *modalias,
  */
  */
 int acpi_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env)
 int acpi_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env)
 {
 {
-	struct acpi_device *acpi_dev;
 	int len;
 	int len;
 
 
-	acpi_dev = ACPI_COMPANION(dev);
-	if (!acpi_dev)
-		return -ENODEV;
-
-	/* Fall back to bus specific way of modalias exporting */
-	if (list_empty(&acpi_dev->pnp.ids))
+	if (!acpi_companion_match(dev))
 		return -ENODEV;
 		return -ENODEV;
 
 
 	if (add_uevent_var(env, "MODALIAS="))
 	if (add_uevent_var(env, "MODALIAS="))
 		return -ENOMEM;
 		return -ENOMEM;
-	len = create_modalias(acpi_dev, &env->buf[env->buflen - 1],
+	len = create_modalias(ACPI_COMPANION(dev), &env->buf[env->buflen - 1],
 				sizeof(env->buf) - env->buflen);
 				sizeof(env->buf) - env->buflen);
 	if (len <= 0)
 	if (len <= 0)
 		return len;
 		return len;
@@ -179,18 +220,12 @@ EXPORT_SYMBOL_GPL(acpi_device_uevent_modalias);
  */
  */
 int acpi_device_modalias(struct device *dev, char *buf, int size)
 int acpi_device_modalias(struct device *dev, char *buf, int size)
 {
 {
-	struct acpi_device *acpi_dev;
 	int len;
 	int len;
 
 
-	acpi_dev = ACPI_COMPANION(dev);
-	if (!acpi_dev)
+	if (!acpi_companion_match(dev))
 		return -ENODEV;
 		return -ENODEV;
 
 
-	/* Fall back to bus specific way of modalias exporting */
-	if (list_empty(&acpi_dev->pnp.ids))
-		return -ENODEV;
-
-	len = create_modalias(acpi_dev, buf, size -1);
+	len = create_modalias(ACPI_COMPANION(dev), buf, size -1);
 	if (len <= 0)
 	if (len <= 0)
 		return len;
 		return len;
 	buf[len++] = '\n';
 	buf[len++] = '\n';
@@ -853,6 +888,9 @@ const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
 	if (!ids || !handle || acpi_bus_get_device(handle, &adev))
 	if (!ids || !handle || acpi_bus_get_device(handle, &adev))
 		return NULL;
 		return NULL;
 
 
+	if (!acpi_companion_match(dev))
+		return NULL;
+
 	return __acpi_match_device(adev, ids);
 	return __acpi_match_device(adev, ids);
 }
 }
 EXPORT_SYMBOL_GPL(acpi_match_device);
 EXPORT_SYMBOL_GPL(acpi_match_device);

+ 2 - 1
drivers/base/dma-contiguous.c

@@ -223,9 +223,10 @@ bool dma_release_from_contiguous(struct device *dev, struct page *pages,
 #undef pr_fmt
 #undef pr_fmt
 #define pr_fmt(fmt) fmt
 #define pr_fmt(fmt) fmt
 
 
-static void rmem_cma_device_init(struct reserved_mem *rmem, struct device *dev)
+static int rmem_cma_device_init(struct reserved_mem *rmem, struct device *dev)
 {
 {
 	dev_set_cma_area(dev, rmem->priv);
 	dev_set_cma_area(dev, rmem->priv);
+	return 0;
 }
 }
 
 
 static void rmem_cma_device_release(struct reserved_mem *rmem,
 static void rmem_cma_device_release(struct reserved_mem *rmem,

+ 2 - 0
drivers/base/power/main.c

@@ -1266,6 +1266,8 @@ int dpm_suspend_late(pm_message_t state)
 	}
 	}
 	mutex_unlock(&dpm_list_mtx);
 	mutex_unlock(&dpm_list_mtx);
 	async_synchronize_full();
 	async_synchronize_full();
+	if (!error)
+		error = async_error;
 	if (error) {
 	if (error) {
 		suspend_stats.failed_suspend_late++;
 		suspend_stats.failed_suspend_late++;
 		dpm_save_failed_step(SUSPEND_SUSPEND_LATE);
 		dpm_save_failed_step(SUSPEND_SUSPEND_LATE);

+ 3 - 2
drivers/bcma/host_pci.c

@@ -275,7 +275,7 @@ static SIMPLE_DEV_PM_OPS(bcma_pm_ops, bcma_host_pci_suspend,
 static const struct pci_device_id bcma_pci_bridge_tbl[] = {
 static const struct pci_device_id bcma_pci_bridge_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x0576) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x0576) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4313) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4313) },
-	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43224) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43224) },	/* 0xa8d8 */
 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4331) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4331) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4353) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4353) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4357) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4357) },
@@ -285,7 +285,8 @@ static const struct pci_device_id bcma_pci_bridge_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) },
-	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43227) },	/* 0xA8DB */
+	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43227) },	/* 0xa8db, BCM43217 (sic!) */
+	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43228) },	/* 0xa8dc */
 	{ 0, },
 	{ 0, },
 };
 };
 MODULE_DEVICE_TABLE(pci, bcma_pci_bridge_tbl);
 MODULE_DEVICE_TABLE(pci, bcma_pci_bridge_tbl);

+ 1 - 1
drivers/bcma/main.c

@@ -132,7 +132,7 @@ static bool bcma_is_core_needed_early(u16 core_id)
 	return false;
 	return false;
 }
 }
 
 
-#ifdef CONFIG_OF
+#if defined(CONFIG_OF) && defined(CONFIG_OF_ADDRESS)
 static struct device_node *bcma_of_find_child_device(struct platform_device *parent,
 static struct device_node *bcma_of_find_child_device(struct platform_device *parent,
 						     struct bcma_device *core)
 						     struct bcma_device *core)
 {
 {

+ 7 - 7
drivers/block/null_blk.c

@@ -450,14 +450,10 @@ static int init_driver_queues(struct nullb *nullb)
 
 
 		ret = setup_commands(nq);
 		ret = setup_commands(nq);
 		if (ret)
 		if (ret)
-			goto err_queue;
+			return ret;
 		nullb->nr_queues++;
 		nullb->nr_queues++;
 	}
 	}
-
 	return 0;
 	return 0;
-err_queue:
-	cleanup_queues(nullb);
-	return ret;
 }
 }
 
 
 static int null_add_dev(void)
 static int null_add_dev(void)
@@ -507,7 +503,9 @@ static int null_add_dev(void)
 			goto out_cleanup_queues;
 			goto out_cleanup_queues;
 		}
 		}
 		blk_queue_make_request(nullb->q, null_queue_bio);
 		blk_queue_make_request(nullb->q, null_queue_bio);
-		init_driver_queues(nullb);
+		rv = init_driver_queues(nullb);
+		if (rv)
+			goto out_cleanup_blk_queue;
 	} else {
 	} else {
 		nullb->q = blk_init_queue_node(null_request_fn, &nullb->lock, home_node);
 		nullb->q = blk_init_queue_node(null_request_fn, &nullb->lock, home_node);
 		if (!nullb->q) {
 		if (!nullb->q) {
@@ -516,7 +514,9 @@ static int null_add_dev(void)
 		}
 		}
 		blk_queue_prep_rq(nullb->q, null_rq_prep_fn);
 		blk_queue_prep_rq(nullb->q, null_rq_prep_fn);
 		blk_queue_softirq_done(nullb->q, null_softirq_done_fn);
 		blk_queue_softirq_done(nullb->q, null_softirq_done_fn);
-		init_driver_queues(nullb);
+		rv = init_driver_queues(nullb);
+		if (rv)
+			goto out_cleanup_blk_queue;
 	}
 	}
 
 
 	nullb->q->queuedata = nullb;
 	nullb->q->queuedata = nullb;

+ 19 - 16
drivers/block/rbd.c

@@ -342,7 +342,6 @@ struct rbd_device {
 
 
 	struct list_head	rq_queue;	/* incoming rq queue */
 	struct list_head	rq_queue;	/* incoming rq queue */
 	spinlock_t		lock;		/* queue, flags, open_count */
 	spinlock_t		lock;		/* queue, flags, open_count */
-	struct workqueue_struct	*rq_wq;
 	struct work_struct	rq_work;
 	struct work_struct	rq_work;
 
 
 	struct rbd_image_header	header;
 	struct rbd_image_header	header;
@@ -402,6 +401,8 @@ static struct kmem_cache	*rbd_segment_name_cache;
 static int rbd_major;
 static int rbd_major;
 static DEFINE_IDA(rbd_dev_id_ida);
 static DEFINE_IDA(rbd_dev_id_ida);
 
 
+static struct workqueue_struct *rbd_wq;
+
 /*
 /*
  * Default to false for now, as single-major requires >= 0.75 version of
  * Default to false for now, as single-major requires >= 0.75 version of
  * userspace rbd utility.
  * userspace rbd utility.
@@ -3452,7 +3453,7 @@ static void rbd_request_fn(struct request_queue *q)
 	}
 	}
 
 
 	if (queued)
 	if (queued)
-		queue_work(rbd_dev->rq_wq, &rbd_dev->rq_work);
+		queue_work(rbd_wq, &rbd_dev->rq_work);
 }
 }
 
 
 /*
 /*
@@ -3532,7 +3533,7 @@ static int rbd_obj_read_sync(struct rbd_device *rbd_dev,
 	page_count = (u32) calc_pages_for(offset, length);
 	page_count = (u32) calc_pages_for(offset, length);
 	pages = ceph_alloc_page_vector(page_count, GFP_KERNEL);
 	pages = ceph_alloc_page_vector(page_count, GFP_KERNEL);
 	if (IS_ERR(pages))
 	if (IS_ERR(pages))
-		ret = PTR_ERR(pages);
+		return PTR_ERR(pages);
 
 
 	ret = -ENOMEM;
 	ret = -ENOMEM;
 	obj_request = rbd_obj_request_create(object_name, offset, length,
 	obj_request = rbd_obj_request_create(object_name, offset, length,
@@ -5242,16 +5243,9 @@ static int rbd_dev_device_setup(struct rbd_device *rbd_dev)
 	set_capacity(rbd_dev->disk, rbd_dev->mapping.size / SECTOR_SIZE);
 	set_capacity(rbd_dev->disk, rbd_dev->mapping.size / SECTOR_SIZE);
 	set_disk_ro(rbd_dev->disk, rbd_dev->mapping.read_only);
 	set_disk_ro(rbd_dev->disk, rbd_dev->mapping.read_only);
 
 
-	rbd_dev->rq_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0,
-					 rbd_dev->disk->disk_name);
-	if (!rbd_dev->rq_wq) {
-		ret = -ENOMEM;
-		goto err_out_mapping;
-	}
-
 	ret = rbd_bus_add_dev(rbd_dev);
 	ret = rbd_bus_add_dev(rbd_dev);
 	if (ret)
 	if (ret)
-		goto err_out_workqueue;
+		goto err_out_mapping;
 
 
 	/* Everything's ready.  Announce the disk to the world. */
 	/* Everything's ready.  Announce the disk to the world. */
 
 
@@ -5263,9 +5257,6 @@ static int rbd_dev_device_setup(struct rbd_device *rbd_dev)
 
 
 	return ret;
 	return ret;
 
 
-err_out_workqueue:
-	destroy_workqueue(rbd_dev->rq_wq);
-	rbd_dev->rq_wq = NULL;
 err_out_mapping:
 err_out_mapping:
 	rbd_dev_mapping_clear(rbd_dev);
 	rbd_dev_mapping_clear(rbd_dev);
 err_out_disk:
 err_out_disk:
@@ -5512,7 +5503,6 @@ static void rbd_dev_device_release(struct device *dev)
 {
 {
 	struct rbd_device *rbd_dev = dev_to_rbd_dev(dev);
 	struct rbd_device *rbd_dev = dev_to_rbd_dev(dev);
 
 
-	destroy_workqueue(rbd_dev->rq_wq);
 	rbd_free_disk(rbd_dev);
 	rbd_free_disk(rbd_dev);
 	clear_bit(RBD_DEV_FLAG_EXISTS, &rbd_dev->flags);
 	clear_bit(RBD_DEV_FLAG_EXISTS, &rbd_dev->flags);
 	rbd_dev_mapping_clear(rbd_dev);
 	rbd_dev_mapping_clear(rbd_dev);
@@ -5716,11 +5706,21 @@ static int __init rbd_init(void)
 	if (rc)
 	if (rc)
 		return rc;
 		return rc;
 
 
+	/*
+	 * The number of active work items is limited by the number of
+	 * rbd devices, so leave @max_active at default.
+	 */
+	rbd_wq = alloc_workqueue(RBD_DRV_NAME, WQ_MEM_RECLAIM, 0);
+	if (!rbd_wq) {
+		rc = -ENOMEM;
+		goto err_out_slab;
+	}
+
 	if (single_major) {
 	if (single_major) {
 		rbd_major = register_blkdev(0, RBD_DRV_NAME);
 		rbd_major = register_blkdev(0, RBD_DRV_NAME);
 		if (rbd_major < 0) {
 		if (rbd_major < 0) {
 			rc = rbd_major;
 			rc = rbd_major;
-			goto err_out_slab;
+			goto err_out_wq;
 		}
 		}
 	}
 	}
 
 
@@ -5738,6 +5738,8 @@ static int __init rbd_init(void)
 err_out_blkdev:
 err_out_blkdev:
 	if (single_major)
 	if (single_major)
 		unregister_blkdev(rbd_major, RBD_DRV_NAME);
 		unregister_blkdev(rbd_major, RBD_DRV_NAME);
+err_out_wq:
+	destroy_workqueue(rbd_wq);
 err_out_slab:
 err_out_slab:
 	rbd_slab_exit();
 	rbd_slab_exit();
 	return rc;
 	return rc;
@@ -5749,6 +5751,7 @@ static void __exit rbd_exit(void)
 	rbd_sysfs_cleanup();
 	rbd_sysfs_cleanup();
 	if (single_major)
 	if (single_major)
 		unregister_blkdev(rbd_major, RBD_DRV_NAME);
 		unregister_blkdev(rbd_major, RBD_DRV_NAME);
+	destroy_workqueue(rbd_wq);
 	rbd_slab_exit();
 	rbd_slab_exit();
 }
 }
 
 

+ 0 - 9
drivers/block/sunvdc.c

@@ -69,8 +69,6 @@ struct vdc_port {
 	u8			vdisk_mtype;
 	u8			vdisk_mtype;
 
 
 	char			disk_name[32];
 	char			disk_name[32];
-
-	struct vio_disk_vtoc	label;
 };
 };
 
 
 static inline struct vdc_port *to_vdc_port(struct vio_driver_state *vio)
 static inline struct vdc_port *to_vdc_port(struct vio_driver_state *vio)
@@ -710,13 +708,6 @@ static int probe_disk(struct vdc_port *port)
 	if (comp.err)
 	if (comp.err)
 		return comp.err;
 		return comp.err;
 
 
-	err = generic_request(port, VD_OP_GET_VTOC,
-			      &port->label, sizeof(port->label));
-	if (err < 0) {
-		printk(KERN_ERR PFX "VD_OP_GET_VTOC returns error %d\n", err);
-		return err;
-	}
-
 	if (vdc_version_supported(port, 1, 1)) {
 	if (vdc_version_supported(port, 1, 1)) {
 		/* vdisk_size should be set during the handshake, if it wasn't
 		/* vdisk_size should be set during the handshake, if it wasn't
 		 * then the underlying disk is reserved by another system
 		 * then the underlying disk is reserved by another system

+ 6 - 4
drivers/block/zram/zram_drv.c

@@ -99,11 +99,12 @@ static ssize_t mem_used_total_show(struct device *dev,
 {
 {
 	u64 val = 0;
 	u64 val = 0;
 	struct zram *zram = dev_to_zram(dev);
 	struct zram *zram = dev_to_zram(dev);
-	struct zram_meta *meta = zram->meta;
 
 
 	down_read(&zram->init_lock);
 	down_read(&zram->init_lock);
-	if (init_done(zram))
+	if (init_done(zram)) {
+		struct zram_meta *meta = zram->meta;
 		val = zs_get_total_pages(meta->mem_pool);
 		val = zs_get_total_pages(meta->mem_pool);
+	}
 	up_read(&zram->init_lock);
 	up_read(&zram->init_lock);
 
 
 	return scnprintf(buf, PAGE_SIZE, "%llu\n", val << PAGE_SHIFT);
 	return scnprintf(buf, PAGE_SIZE, "%llu\n", val << PAGE_SHIFT);
@@ -173,16 +174,17 @@ static ssize_t mem_used_max_store(struct device *dev,
 	int err;
 	int err;
 	unsigned long val;
 	unsigned long val;
 	struct zram *zram = dev_to_zram(dev);
 	struct zram *zram = dev_to_zram(dev);
-	struct zram_meta *meta = zram->meta;
 
 
 	err = kstrtoul(buf, 10, &val);
 	err = kstrtoul(buf, 10, &val);
 	if (err || val != 0)
 	if (err || val != 0)
 		return -EINVAL;
 		return -EINVAL;
 
 
 	down_read(&zram->init_lock);
 	down_read(&zram->init_lock);
-	if (init_done(zram))
+	if (init_done(zram)) {
+		struct zram_meta *meta = zram->meta;
 		atomic_long_set(&zram->stats.max_used_pages,
 		atomic_long_set(&zram->stats.max_used_pages,
 				zs_get_total_pages(meta->mem_pool));
 				zs_get_total_pages(meta->mem_pool));
+	}
 	up_read(&zram->init_lock);
 	up_read(&zram->init_lock);
 
 
 	return len;
 	return len;

+ 1 - 1
drivers/char/raw.c

@@ -285,7 +285,7 @@ static long raw_ctl_compat_ioctl(struct file *file, unsigned int cmd,
 
 
 static const struct file_operations raw_fops = {
 static const struct file_operations raw_fops = {
 	.read		= new_sync_read,
 	.read		= new_sync_read,
-	.read_iter	= generic_file_read_iter,
+	.read_iter	= blkdev_read_iter,
 	.write		= new_sync_write,
 	.write		= new_sync_write,
 	.write_iter	= blkdev_write_iter,
 	.write_iter	= blkdev_write_iter,
 	.fsync		= blkdev_fsync,
 	.fsync		= blkdev_fsync,

+ 3 - 3
drivers/clocksource/arm_arch_timer.c

@@ -660,11 +660,11 @@ static bool __init
 arch_timer_probed(int type, const struct of_device_id *matches)
 arch_timer_probed(int type, const struct of_device_id *matches)
 {
 {
 	struct device_node *dn;
 	struct device_node *dn;
-	bool probed = false;
+	bool probed = true;
 
 
 	dn = of_find_matching_node(NULL, matches);
 	dn = of_find_matching_node(NULL, matches);
-	if (dn && of_device_is_available(dn) && (arch_timers_present & type))
-		probed = true;
+	if (dn && of_device_is_available(dn) && !(arch_timers_present & type))
+		probed = false;
 	of_node_put(dn);
 	of_node_put(dn);
 
 
 	return probed;
 	return probed;

+ 42 - 26
drivers/cpufreq/cpufreq-dt.c

@@ -187,6 +187,7 @@ static int cpufreq_init(struct cpufreq_policy *policy)
 	struct device *cpu_dev;
 	struct device *cpu_dev;
 	struct regulator *cpu_reg;
 	struct regulator *cpu_reg;
 	struct clk *cpu_clk;
 	struct clk *cpu_clk;
+	unsigned long min_uV = ~0, max_uV = 0;
 	unsigned int transition_latency;
 	unsigned int transition_latency;
 	int ret;
 	int ret;
 
 
@@ -206,16 +207,10 @@ static int cpufreq_init(struct cpufreq_policy *policy)
 	/* OPPs might be populated at runtime, don't check for error here */
 	/* OPPs might be populated at runtime, don't check for error here */
 	of_init_opp_table(cpu_dev);
 	of_init_opp_table(cpu_dev);
 
 
-	ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table);
-	if (ret) {
-		dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret);
-		goto out_put_node;
-	}
-
 	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
 	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
 	if (!priv) {
 	if (!priv) {
 		ret = -ENOMEM;
 		ret = -ENOMEM;
-		goto out_free_table;
+		goto out_put_node;
 	}
 	}
 
 
 	of_property_read_u32(np, "voltage-tolerance", &priv->voltage_tolerance);
 	of_property_read_u32(np, "voltage-tolerance", &priv->voltage_tolerance);
@@ -224,30 +219,51 @@ static int cpufreq_init(struct cpufreq_policy *policy)
 		transition_latency = CPUFREQ_ETERNAL;
 		transition_latency = CPUFREQ_ETERNAL;
 
 
 	if (!IS_ERR(cpu_reg)) {
 	if (!IS_ERR(cpu_reg)) {
-		struct dev_pm_opp *opp;
-		unsigned long min_uV, max_uV;
-		int i;
+		unsigned long opp_freq = 0;
 
 
 		/*
 		/*
-		 * OPP is maintained in order of increasing frequency, and
-		 * freq_table initialised from OPP is therefore sorted in the
-		 * same order.
+		 * Disable any OPPs where the connected regulator isn't able to
+		 * provide the specified voltage and record minimum and maximum
+		 * voltage levels.
 		 */
 		 */
-		for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++)
-			;
-		rcu_read_lock();
-		opp = dev_pm_opp_find_freq_exact(cpu_dev,
-				freq_table[0].frequency * 1000, true);
-		min_uV = dev_pm_opp_get_voltage(opp);
-		opp = dev_pm_opp_find_freq_exact(cpu_dev,
-				freq_table[i-1].frequency * 1000, true);
-		max_uV = dev_pm_opp_get_voltage(opp);
-		rcu_read_unlock();
+		while (1) {
+			struct dev_pm_opp *opp;
+			unsigned long opp_uV, tol_uV;
+
+			rcu_read_lock();
+			opp = dev_pm_opp_find_freq_ceil(cpu_dev, &opp_freq);
+			if (IS_ERR(opp)) {
+				rcu_read_unlock();
+				break;
+			}
+			opp_uV = dev_pm_opp_get_voltage(opp);
+			rcu_read_unlock();
+
+			tol_uV = opp_uV * priv->voltage_tolerance / 100;
+			if (regulator_is_supported_voltage(cpu_reg, opp_uV,
+							   opp_uV + tol_uV)) {
+				if (opp_uV < min_uV)
+					min_uV = opp_uV;
+				if (opp_uV > max_uV)
+					max_uV = opp_uV;
+			} else {
+				dev_pm_opp_disable(cpu_dev, opp_freq);
+			}
+
+			opp_freq++;
+		}
+
 		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;
 	}
 	}
 
 
+	ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table);
+	if (ret) {
+		pr_err("failed to init cpufreq table: %d\n", ret);
+		goto out_free_priv;
+	}
+
 	/*
 	/*
 	 * For now, just loading the cooling device;
 	 * For now, just loading the cooling device;
 	 * thermal DT code takes care of matching them.
 	 * thermal DT code takes care of matching them.
@@ -277,7 +293,7 @@ static int cpufreq_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = transition_latency;
 	policy->cpuinfo.transition_latency = transition_latency;
 
 
 	pd = cpufreq_get_driver_data();
 	pd = cpufreq_get_driver_data();
-	if (pd && !pd->independent_clocks)
+	if (!pd || !pd->independent_clocks)
 		cpumask_setall(policy->cpus);
 		cpumask_setall(policy->cpus);
 
 
 	of_node_put(np);
 	of_node_put(np);
@@ -286,9 +302,9 @@ static int cpufreq_init(struct cpufreq_policy *policy)
 
 
 out_cooling_unregister:
 out_cooling_unregister:
 	cpufreq_cooling_unregister(priv->cdev);
 	cpufreq_cooling_unregister(priv->cdev);
-	kfree(priv);
-out_free_table:
 	dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
 	dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
+out_free_priv:
+	kfree(priv);
 out_put_node:
 out_put_node:
 	of_node_put(np);
 	of_node_put(np);
 out_put_reg_clk:
 out_put_reg_clk:

+ 1 - 1
drivers/edac/cpc925_edac.c

@@ -562,7 +562,7 @@ static void cpc925_mc_check(struct mem_ctl_info *mci)
 
 
 	if (apiexcp & UECC_EXCP_DETECTED) {
 	if (apiexcp & UECC_EXCP_DETECTED) {
 		cpc925_mc_printk(mci, KERN_INFO, "DRAM UECC Fault\n");
 		cpc925_mc_printk(mci, KERN_INFO, "DRAM UECC Fault\n");
-		edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, 1,
+		edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1,
 				     pfn, offset, 0,
 				     pfn, offset, 0,
 				     csrow, -1, -1,
 				     csrow, -1, -1,
 				     mci->ctl_name, "");
 				     mci->ctl_name, "");

+ 1 - 1
drivers/edac/e7xxx_edac.c

@@ -226,7 +226,7 @@ static void process_ce(struct mem_ctl_info *mci, struct e7xxx_error_info *info)
 static void process_ce_no_info(struct mem_ctl_info *mci)
 static void process_ce_no_info(struct mem_ctl_info *mci)
 {
 {
 	edac_dbg(3, "\n");
 	edac_dbg(3, "\n");
-	edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1, 0, 0, 0, -1, -1, -1,
+	edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, 1, 0, 0, 0, -1, -1, -1,
 			     "e7xxx CE log register overflow", "");
 			     "e7xxx CE log register overflow", "");
 }
 }
 
 

+ 2 - 2
drivers/edac/i3200_edac.c

@@ -242,11 +242,11 @@ static void i3200_process_error_info(struct mem_ctl_info *mci,
 					     -1, -1,
 					     -1, -1,
 					     "i3000 UE", "");
 					     "i3000 UE", "");
 		} else if (log & I3200_ECCERRLOG_CE) {
 		} else if (log & I3200_ECCERRLOG_CE) {
-			edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1,
+			edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, 1,
 					     0, 0, eccerrlog_syndrome(log),
 					     0, 0, eccerrlog_syndrome(log),
 					     eccerrlog_row(channel, log),
 					     eccerrlog_row(channel, log),
 					     -1, -1,
 					     -1, -1,
-					     "i3000 UE", "");
+					     "i3000 CE", "");
 		}
 		}
 	}
 	}
 }
 }

+ 1 - 1
drivers/edac/i82860_edac.c

@@ -124,7 +124,7 @@ static int i82860_process_error_info(struct mem_ctl_info *mci,
 				     dimm->location[0], dimm->location[1], -1,
 				     dimm->location[0], dimm->location[1], -1,
 				     "i82860 UE", "");
 				     "i82860 UE", "");
 	else
 	else
-		edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1,
+		edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, 1,
 				     info->eap, 0, info->derrsyn,
 				     info->eap, 0, info->derrsyn,
 				     dimm->location[0], dimm->location[1], -1,
 				     dimm->location[0], dimm->location[1], -1,
 				     "i82860 CE", "");
 				     "i82860 CE", "");

+ 10 - 11
drivers/gpu/drm/armada/armada_crtc.c

@@ -260,7 +260,7 @@ static void armada_drm_vblank_off(struct armada_crtc *dcrtc)
 	 * Tell the DRM core that vblank IRQs aren't going to happen for
 	 * Tell the DRM core that vblank IRQs aren't going to happen for
 	 * a while.  This cleans up any pending vblank events for us.
 	 * a while.  This cleans up any pending vblank events for us.
 	 */
 	 */
-	drm_vblank_off(dev, dcrtc->num);
+	drm_crtc_vblank_off(&dcrtc->crtc);
 
 
 	/* Handle any pending flip event. */
 	/* Handle any pending flip event. */
 	spin_lock_irq(&dev->event_lock);
 	spin_lock_irq(&dev->event_lock);
@@ -289,6 +289,8 @@ static void armada_drm_crtc_dpms(struct drm_crtc *crtc, int dpms)
 		armada_drm_crtc_update(dcrtc);
 		armada_drm_crtc_update(dcrtc);
 		if (dpms_blanked(dpms))
 		if (dpms_blanked(dpms))
 			armada_drm_vblank_off(dcrtc);
 			armada_drm_vblank_off(dcrtc);
+		else
+			drm_crtc_vblank_on(&dcrtc->crtc);
 	}
 	}
 }
 }
 
 
@@ -526,7 +528,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
 	/* Wait for pending flips to complete */
 	/* Wait for pending flips to complete */
 	wait_event(dcrtc->frame_wait, !dcrtc->frame_work);
 	wait_event(dcrtc->frame_wait, !dcrtc->frame_work);
 
 
-	drm_vblank_pre_modeset(crtc->dev, dcrtc->num);
+	drm_crtc_vblank_off(crtc);
 
 
 	crtc->mode = *adj;
 	crtc->mode = *adj;
 
 
@@ -617,7 +619,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
 
 
 	armada_drm_crtc_update(dcrtc);
 	armada_drm_crtc_update(dcrtc);
 
 
-	drm_vblank_post_modeset(crtc->dev, dcrtc->num);
+	drm_crtc_vblank_on(crtc);
 	armada_drm_crtc_finish_fb(dcrtc, old_fb, dpms_blanked(dcrtc->dpms));
 	armada_drm_crtc_finish_fb(dcrtc, old_fb, dpms_blanked(dcrtc->dpms));
 
 
 	return 0;
 	return 0;
@@ -945,18 +947,15 @@ static int armada_drm_crtc_page_flip(struct drm_crtc *crtc,
 	armada_reg_queue_end(work->regs, i);
 	armada_reg_queue_end(work->regs, i);
 
 
 	/*
 	/*
-	 * Hold the old framebuffer for the work - DRM appears to drop our
-	 * reference to the old framebuffer in drm_mode_page_flip_ioctl().
+	 * Ensure that we hold a reference on the new framebuffer.
+	 * This has to match the behaviour in mode_set.
 	 */
 	 */
-	drm_framebuffer_reference(work->old_fb);
+	drm_framebuffer_reference(fb);
 
 
 	ret = armada_drm_crtc_queue_frame_work(dcrtc, work);
 	ret = armada_drm_crtc_queue_frame_work(dcrtc, work);
 	if (ret) {
 	if (ret) {
-		/*
-		 * Undo our reference above; DRM does not drop the reference
-		 * to this object on error, so that's okay.
-		 */
-		drm_framebuffer_unreference(work->old_fb);
+		/* Undo our reference above */
+		drm_framebuffer_unreference(fb);
 		kfree(work);
 		kfree(work);
 		return ret;
 		return ret;
 	}
 	}

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