فهرست منبع

Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

David S. Miller 14 سال پیش
والد
کامیت
e12fe68ce3
100فایلهای تغییر یافته به همراه898 افزوده شده و 516 حذف شده
  1. 14 53
      Documentation/power/devices.txt
  2. 0 5
      Documentation/power/runtime_pm.txt
  3. 8 1
      Documentation/usb/error-codes.txt
  4. 19 10
      MAINTAINERS
  5. 1 1
      Makefile
  6. 0 1
      arch/alpha/include/asm/mmzone.h
  7. 13 1
      arch/arm/boot/compressed/head.S
  8. 4 0
      arch/arm/include/asm/assembler.h
  9. 2 0
      arch/arm/include/asm/entry-macro-multi.S
  10. 11 2
      arch/arm/kernel/module.c
  11. 5 1
      arch/arm/kernel/smp.c
  12. 1 0
      arch/arm/mach-exynos4/init.c
  13. 2 0
      arch/arm/mach-h720x/Kconfig
  14. 2 2
      arch/arm/mach-shmobile/board-ag5evm.c
  15. 1 1
      arch/arm/mach-shmobile/board-ap4evb.c
  16. 1 1
      arch/arm/mach-shmobile/board-mackerel.c
  17. 12 4
      arch/arm/mach-ux500/board-mop500-pins.c
  18. 54 0
      arch/arm/mach-ux500/board-mop500.c
  19. 10 6
      arch/arm/mm/proc-v7.S
  20. 1 0
      arch/arm/plat-iop/cp6.c
  21. 2 0
      arch/arm/plat-samsung/include/plat/regs-serial.h
  22. 1 7
      arch/m32r/include/asm/mmzone.h
  23. 1 0
      arch/mn10300/include/asm/uaccess.h
  24. 0 7
      arch/parisc/include/asm/mmzone.h
  25. 6 3
      arch/powerpc/boot/dts/p1022ds.dts
  26. 0 1
      arch/powerpc/configs/pseries_defconfig
  27. 0 7
      arch/powerpc/include/asm/mmzone.h
  28. 17 12
      arch/powerpc/kernel/rtas-rtc.c
  29. 31 26
      arch/powerpc/kernel/signal_32.c
  30. 9 8
      arch/powerpc/kernel/signal_64.c
  31. 11 13
      arch/powerpc/kernel/traps.c
  32. 5 5
      arch/powerpc/mm/fault.c
  33. 18 17
      arch/powerpc/sysdev/fsl_rio.c
  34. 5 6
      arch/powerpc/sysdev/mpic.c
  35. 1 0
      arch/s390/Kconfig
  36. 2 2
      arch/s390/kernel/smp.c
  37. 7 1
      arch/s390/oprofile/init.c
  38. 5 0
      arch/sh/Kconfig
  39. 3 5
      arch/sh/configs/sh7757lcr_defconfig
  40. 0 4
      arch/sh/include/asm/mmzone.h
  41. 78 28
      arch/sh/kernel/cpu/sh4a/setup-sh7757.c
  42. 3 3
      arch/sh/kernel/irq.c
  43. 5 4
      arch/sh/mm/alignment.c
  44. 0 2
      arch/sparc/include/asm/mmzone.h
  45. 0 11
      arch/tile/include/asm/mmzone.h
  46. 6 0
      arch/um/include/asm/percpu.h
  47. 1 1
      arch/x86/include/asm/apb_timer.h
  48. 0 11
      arch/x86/include/asm/mmzone_32.h
  49. 0 3
      arch/x86/include/asm/mmzone_64.h
  50. 7 5
      arch/x86/kvm/emulate.c
  51. 1 1
      arch/x86/pci/acpi.c
  52. 2 2
      block/blk-throttle.c
  53. 10 6
      block/cfq-iosched.c
  54. 45 34
      block/genhd.c
  55. 3 4
      crypto/deflate.c
  56. 3 4
      crypto/zlib.c
  57. 1 1
      drivers/ata/libahci.c
  58. 3 3
      drivers/ata/libata-core.c
  59. 6 0
      drivers/ata/libata-scsi.c
  60. 3 0
      drivers/ata/pata_marvell.c
  61. 1 1
      drivers/ata/sata_dwc_460ex.c
  62. 1 1
      drivers/base/platform.c
  63. 2 2
      drivers/base/power/clock_ops.c
  64. 21 7
      drivers/base/power/main.c
  65. 1 0
      drivers/connector/connector.c
  66. 3 3
      drivers/crypto/caam/caamalg.c
  67. 1 0
      drivers/firmware/google/Kconfig
  68. 1 0
      drivers/gpu/drm/drm_gem.c
  69. 1 2
      drivers/gpu/drm/i915/i915_dma.c
  70. 3 0
      drivers/gpu/drm/i915/i915_drv.c
  71. 3 0
      drivers/gpu/drm/i915/i915_drv.h
  72. 22 30
      drivers/gpu/drm/i915/i915_gem.c
  73. 0 4
      drivers/gpu/drm/i915/i915_gem_execbuffer.c
  74. 1 0
      drivers/gpu/drm/i915/i915_irq.c
  75. 1 0
      drivers/gpu/drm/i915/i915_reg.h
  76. 5 0
      drivers/gpu/drm/i915/i915_suspend.c
  77. 223 85
      drivers/gpu/drm/i915/intel_display.c
  78. 5 0
      drivers/gpu/drm/i915/intel_overlay.c
  79. 2 2
      drivers/gpu/drm/radeon/evergreen.c
  80. 1 0
      drivers/gpu/drm/radeon/radeon.h
  81. 36 0
      drivers/gpu/drm/radeon/radeon_atombios.c
  82. 1 1
      drivers/gpu/drm/radeon/radeon_bios.c
  83. 3 2
      drivers/gpu/drm/ttm/ttm_tt.c
  84. 1 0
      drivers/hid/hid-core.c
  85. 1 0
      drivers/hid/hid-ids.h
  86. 7 5
      drivers/hid/hid-multitouch.c
  87. 4 4
      drivers/i2c/busses/i2c-taos-evm.c
  88. 4 3
      drivers/i2c/muxes/pca954x.c
  89. 37 9
      drivers/infiniband/hw/cxgb4/cm.c
  90. 4 0
      drivers/infiniband/hw/cxgb4/cq.c
  91. 1 1
      drivers/infiniband/hw/cxgb4/mem.c
  92. 1 4
      drivers/infiniband/hw/cxgb4/qp.c
  93. 18 7
      drivers/infiniband/hw/qib/qib_iba7322.c
  94. 5 1
      drivers/infiniband/hw/qib/qib_intr.c
  95. 2 2
      drivers/leds/leds-lp5521.c
  96. 2 2
      drivers/leds/leds-lp5523.c
  97. 1 0
      drivers/md/md.c
  98. 1 1
      drivers/misc/cb710/sgbuf2.c
  99. 1 1
      drivers/misc/ioc4.c
  100. 8 0
      drivers/misc/lkdtm.c

+ 14 - 53
Documentation/power/devices.txt

@@ -520,59 +520,20 @@ Support for power domains is provided through the pwr_domain field of struct
 device.  This field is a pointer to an object of type struct dev_power_domain,
 device.  This field is a pointer to an object of type struct dev_power_domain,
 defined in include/linux/pm.h, providing a set of power management callbacks
 defined in include/linux/pm.h, providing a set of power management callbacks
 analogous to the subsystem-level and device driver callbacks that are executed
 analogous to the subsystem-level and device driver callbacks that are executed
-for the given device during all power transitions, in addition to the respective
-subsystem-level callbacks.  Specifically, the power domain "suspend" callbacks
-(i.e. ->runtime_suspend(), ->suspend(), ->freeze(), ->poweroff(), etc.) are
-executed after the analogous subsystem-level callbacks, while the power domain
-"resume" callbacks (i.e. ->runtime_resume(), ->resume(), ->thaw(), ->restore,
-etc.) are executed before the analogous subsystem-level callbacks.  Error codes
-returned by the "suspend" and "resume" power domain callbacks are ignored.
-
-Power domain ->runtime_idle() callback is executed before the subsystem-level
-->runtime_idle() callback and the result returned by it is not ignored.  Namely,
-if it returns error code, the subsystem-level ->runtime_idle() callback will not
-be called and the helper function rpm_idle() executing it will return error
-code.  This mechanism is intended to help platforms where saving device state
-is a time consuming operation and should only be carried out if all devices
-in the power domain are idle, before turning off the shared power resource(s).
-Namely, the power domain ->runtime_idle() callback may return error code until
-the pm_runtime_idle() helper (or its asychronous version) has been called for
-all devices in the power domain (it is recommended that the returned error code
-be -EBUSY in those cases), preventing the subsystem-level ->runtime_idle()
-callback from being run prematurely.
-
-The support for device power domains is only relevant to platforms needing to
-use the same subsystem-level (e.g. platform bus type) and device driver power
-management callbacks in many different power domain configurations and wanting
-to avoid incorporating the support for power domains into the subsystem-level
-callbacks.  The other platforms need not implement it or take it into account
-in any way.
-
-
-System Devices
---------------
-System devices (sysdevs) follow a slightly different API, which can be found in
-
-	include/linux/sysdev.h
-	drivers/base/sys.c
-
-System devices will be suspended with interrupts disabled, and after all other
-devices have been suspended.  On resume, they will be resumed before any other
-devices, and also with interrupts disabled.  These things occur in special
-"sysdev_driver" phases, which affect only system devices.
-
-Thus, after the suspend_noirq (or freeze_noirq or poweroff_noirq) phase, when
-the non-boot CPUs are all offline and IRQs are disabled on the remaining online
-CPU, then a sysdev_driver.suspend phase is carried out, and the system enters a
-sleep state (or a system image is created).  During resume (or after the image
-has been created or loaded) a sysdev_driver.resume phase is carried out, IRQs
-are enabled on the only online CPU, the non-boot CPUs are enabled, and the
-resume_noirq (or thaw_noirq or restore_noirq) phase begins.
-
-Code to actually enter and exit the system-wide low power state sometimes
-involves hardware details that are only known to the boot firmware, and
-may leave a CPU running software (from SRAM or flash memory) that monitors
-the system and manages its wakeup sequence.
+for the given device during all power transitions, instead of the respective
+subsystem-level callbacks.  Specifically, if a device's pm_domain pointer is
+not NULL, the ->suspend() callback from the object pointed to by it will be
+executed instead of its subsystem's (e.g. bus type's) ->suspend() callback and
+anlogously for all of the remaining callbacks.  In other words, power management
+domain callbacks, if defined for the given device, always take precedence over
+the callbacks provided by the device's subsystem (e.g. bus type).
+
+The support for device power management domains is only relevant to platforms
+needing to use the same device driver power management callbacks in many
+different power domain configurations and wanting to avoid incorporating the
+support for power domains into subsystem-level callbacks, for example by
+modifying the platform bus type.  Other platforms need not implement it or take
+it into account in any way.
 
 
 
 
 Device Low Power (suspend) States
 Device Low Power (suspend) States

+ 0 - 5
Documentation/power/runtime_pm.txt

@@ -566,11 +566,6 @@ to do this is:
 	pm_runtime_set_active(dev);
 	pm_runtime_set_active(dev);
 	pm_runtime_enable(dev);
 	pm_runtime_enable(dev);
 
 
-The PM core always increments the run-time usage counter before calling the
-->prepare() callback and decrements it after calling the ->complete() callback.
-Hence disabling run-time PM temporarily like this will not cause any run-time
-suspend callbacks to be lost.
-
 7. Generic subsystem callbacks
 7. Generic subsystem callbacks
 
 
 Subsystems may wish to conserve code space by using the set of generic power
 Subsystems may wish to conserve code space by using the set of generic power

+ 8 - 1
Documentation/usb/error-codes.txt

@@ -76,6 +76,13 @@ A transfer's actual_length may be positive even when an error has been
 reported.  That's because transfers often involve several packets, so that
 reported.  That's because transfers often involve several packets, so that
 one or more packets could finish before an error stops further endpoint I/O.
 one or more packets could finish before an error stops further endpoint I/O.
 
 
+For isochronous URBs, the urb status value is non-zero only if the URB is
+unlinked, the device is removed, the host controller is disabled, or the total
+transferred length is less than the requested length and the URB_SHORT_NOT_OK
+flag is set.  Completion handlers for isochronous URBs should only see
+urb->status set to zero, -ENOENT, -ECONNRESET, -ESHUTDOWN, or -EREMOTEIO.
+Individual frame descriptor status fields may report more status codes.
+
 
 
 0			Transfer completed successfully
 0			Transfer completed successfully
 
 
@@ -132,7 +139,7 @@ one or more packets could finish before an error stops further endpoint I/O.
 			device removal events immediately.
 			device removal events immediately.
 
 
 -EXDEV			ISO transfer only partially completed
 -EXDEV			ISO transfer only partially completed
-			look at individual frame status for details
+			(only set in iso_frame_desc[n].status, not urb->status)
 
 
 -EINVAL			ISO madness, if this happens: Log off and go home
 -EINVAL			ISO madness, if this happens: Log off and go home
 
 

+ 19 - 10
MAINTAINERS

@@ -1345,16 +1345,18 @@ F:	drivers/auxdisplay/
 F:	include/linux/cfag12864b.h
 F:	include/linux/cfag12864b.h
 
 
 AVR32 ARCHITECTURE
 AVR32 ARCHITECTURE
-M:	Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
+M:	Haavard Skinnemoen <hskinnemoen@gmail.com>
+M:	Hans-Christian Egtvedt <egtvedt@samfundet.no>
 W:	http://www.atmel.com/products/AVR32/
 W:	http://www.atmel.com/products/AVR32/
 W:	http://avr32linux.org/
 W:	http://avr32linux.org/
 W:	http://avrfreaks.net/
 W:	http://avrfreaks.net/
-S:	Supported
+S:	Maintained
 F:	arch/avr32/
 F:	arch/avr32/
 
 
 AVR32/AT32AP MACHINE SUPPORT
 AVR32/AT32AP MACHINE SUPPORT
-M:	Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
-S:	Supported
+M:	Haavard Skinnemoen <hskinnemoen@gmail.com>
+M:	Hans-Christian Egtvedt <egtvedt@samfundet.no>
+S:	Maintained
 F:	arch/avr32/mach-at32ap/
 F:	arch/avr32/mach-at32ap/
 
 
 AX.25 NETWORK LAYER
 AX.25 NETWORK LAYER
@@ -1390,7 +1392,6 @@ F:	include/linux/backlight.h
 BATMAN ADVANCED
 BATMAN ADVANCED
 M:	Marek Lindner <lindner_marek@yahoo.de>
 M:	Marek Lindner <lindner_marek@yahoo.de>
 M:	Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
 M:	Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
-M:	Sven Eckelmann <sven@narfation.org>
 L:	b.a.t.m.a.n@lists.open-mesh.org
 L:	b.a.t.m.a.n@lists.open-mesh.org
 W:	http://www.open-mesh.org/
 W:	http://www.open-mesh.org/
 S:	Maintained
 S:	Maintained
@@ -1423,7 +1424,6 @@ S:	Supported
 F:	arch/blackfin/
 F:	arch/blackfin/
 
 
 BLACKFIN EMAC DRIVER
 BLACKFIN EMAC DRIVER
-M:	Michael Hennerich <michael.hennerich@analog.com>
 L:	uclinux-dist-devel@blackfin.uclinux.org
 L:	uclinux-dist-devel@blackfin.uclinux.org
 W:	http://blackfin.uclinux.org
 W:	http://blackfin.uclinux.org
 S:	Supported
 S:	Supported
@@ -1639,7 +1639,7 @@ CAN NETWORK LAYER
 M:	Oliver Hartkopp <socketcan@hartkopp.net>
 M:	Oliver Hartkopp <socketcan@hartkopp.net>
 M:	Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
 M:	Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
 M:	Urs Thuermann <urs.thuermann@volkswagen.de>
 M:	Urs Thuermann <urs.thuermann@volkswagen.de>
-L:	socketcan-core@lists.berlios.de
+L:	socketcan-core@lists.berlios.de (subscribers-only)
 L:	netdev@vger.kernel.org
 L:	netdev@vger.kernel.org
 W:	http://developer.berlios.de/projects/socketcan/
 W:	http://developer.berlios.de/projects/socketcan/
 S:	Maintained
 S:	Maintained
@@ -1651,7 +1651,7 @@ F:	include/linux/can/raw.h
 
 
 CAN NETWORK DRIVERS
 CAN NETWORK DRIVERS
 M:	Wolfgang Grandegger <wg@grandegger.com>
 M:	Wolfgang Grandegger <wg@grandegger.com>
-L:	socketcan-core@lists.berlios.de
+L:	socketcan-core@lists.berlios.de (subscribers-only)
 L:	netdev@vger.kernel.org
 L:	netdev@vger.kernel.org
 W:	http://developer.berlios.de/projects/socketcan/
 W:	http://developer.berlios.de/projects/socketcan/
 S:	Maintained
 S:	Maintained
@@ -5181,6 +5181,7 @@ S:	Supported
 F:	drivers/net/qlcnic/
 F:	drivers/net/qlcnic/
 
 
 QLOGIC QLGE 10Gb ETHERNET DRIVER
 QLOGIC QLGE 10Gb ETHERNET DRIVER
+M:	Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
 M:	Ron Mercer <ron.mercer@qlogic.com>
 M:	Ron Mercer <ron.mercer@qlogic.com>
 M:	linux-driver@qlogic.com
 M:	linux-driver@qlogic.com
 L:	netdev@vger.kernel.org
 L:	netdev@vger.kernel.org
@@ -6434,8 +6435,9 @@ S:	Maintained
 F:	drivers/usb/misc/rio500*
 F:	drivers/usb/misc/rio500*
 
 
 USB EHCI DRIVER
 USB EHCI DRIVER
+M:	Alan Stern <stern@rowland.harvard.edu>
 L:	linux-usb@vger.kernel.org
 L:	linux-usb@vger.kernel.org
-S:	Orphan
+S:	Maintained
 F:	Documentation/usb/ehci.txt
 F:	Documentation/usb/ehci.txt
 F:	drivers/usb/host/ehci*
 F:	drivers/usb/host/ehci*
 
 
@@ -6465,6 +6467,12 @@ S:	Maintained
 F:	Documentation/hid/hiddev.txt
 F:	Documentation/hid/hiddev.txt
 F:	drivers/hid/usbhid/
 F:	drivers/hid/usbhid/
 
 
+USB/IP DRIVERS
+M:	Matt Mooney <mfm@muteddisk.com>
+L:	linux-usb@vger.kernel.org
+S:	Maintained
+F:	drivers/staging/usbip/
+
 USB ISP116X DRIVER
 USB ISP116X DRIVER
 M:	Olav Kongas <ok@artecdesign.ee>
 M:	Olav Kongas <ok@artecdesign.ee>
 L:	linux-usb@vger.kernel.org
 L:	linux-usb@vger.kernel.org
@@ -6494,8 +6502,9 @@ S:	Maintained
 F:	sound/usb/midi.*
 F:	sound/usb/midi.*
 
 
 USB OHCI DRIVER
 USB OHCI DRIVER
+M:	Alan Stern <stern@rowland.harvard.edu>
 L:	linux-usb@vger.kernel.org
 L:	linux-usb@vger.kernel.org
-S:	Orphan
+S:	Maintained
 F:	Documentation/usb/ohci.txt
 F:	Documentation/usb/ohci.txt
 F:	drivers/usb/host/ohci*
 F:	drivers/usb/host/ohci*
 
 

+ 1 - 1
Makefile

@@ -1,7 +1,7 @@
 VERSION = 3
 VERSION = 3
 PATCHLEVEL = 0
 PATCHLEVEL = 0
 SUBLEVEL = 0
 SUBLEVEL = 0
-EXTRAVERSION = -rc4
+EXTRAVERSION = -rc5
 NAME = Sneaky Weasel
 NAME = Sneaky Weasel
 
 
 # *DOCUMENTATION*
 # *DOCUMENTATION*

+ 0 - 1
arch/alpha/include/asm/mmzone.h

@@ -56,7 +56,6 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n)
  * Given a kernel address, find the home node of the underlying memory.
  * Given a kernel address, find the home node of the underlying memory.
  */
  */
 #define kvaddr_to_nid(kaddr)	pa_to_nid(__pa(kaddr))
 #define kvaddr_to_nid(kaddr)	pa_to_nid(__pa(kaddr))
-#define node_start_pfn(nid)	(NODE_DATA(nid)->node_start_pfn)
 
 
 /*
 /*
  * Given a kaddr, LOCAL_BASE_ADDR finds the owning node of the memory
  * Given a kaddr, LOCAL_BASE_ADDR finds the owning node of the memory

+ 13 - 1
arch/arm/boot/compressed/head.S

@@ -597,6 +597,8 @@ __common_mmu_cache_on:
 		sub	pc, lr, r0, lsr #32	@ properly flush pipeline
 		sub	pc, lr, r0, lsr #32	@ properly flush pipeline
 #endif
 #endif
 
 
+#define PROC_ENTRY_SIZE (4*5)
+
 /*
 /*
  * Here follow the relocatable cache support functions for the
  * Here follow the relocatable cache support functions for the
  * various processors.  This is a generic hook for locating an
  * various processors.  This is a generic hook for locating an
@@ -624,7 +626,7 @@ call_cache_fn:	adr	r12, proc_types
  ARM(		addeq	pc, r12, r3		) @ call cache function
  ARM(		addeq	pc, r12, r3		) @ call cache function
  THUMB(		addeq	r12, r3			)
  THUMB(		addeq	r12, r3			)
  THUMB(		moveq	pc, r12			) @ call cache function
  THUMB(		moveq	pc, r12			) @ call cache function
-		add	r12, r12, #4*5
+		add	r12, r12, #PROC_ENTRY_SIZE
 		b	1b
 		b	1b
 
 
 /*
 /*
@@ -794,6 +796,16 @@ proc_types:
 
 
 		.size	proc_types, . - proc_types
 		.size	proc_types, . - proc_types
 
 
+		/*
+		 * If you get a "non-constant expression in ".if" statement"
+		 * error from the assembler on this line, check that you have
+		 * not accidentally written a "b" instruction where you should
+		 * have written W(b).
+		 */
+		.if (. - proc_types) % PROC_ENTRY_SIZE != 0
+		.error "The size of one or more proc_types entries is wrong."
+		.endif
+
 /*
 /*
  * Turn off the Cache and MMU.  ARMv3 does not support
  * Turn off the Cache and MMU.  ARMv3 does not support
  * reading the control register, but ARMv4 does.
  * reading the control register, but ARMv4 does.

+ 4 - 0
arch/arm/include/asm/assembler.h

@@ -13,6 +13,9 @@
  *  Do not include any C declarations in this file - it is included by
  *  Do not include any C declarations in this file - it is included by
  *  assembler source.
  *  assembler source.
  */
  */
+#ifndef __ASM_ASSEMBLER_H__
+#define __ASM_ASSEMBLER_H__
+
 #ifndef __ASSEMBLY__
 #ifndef __ASSEMBLY__
 #error "Only include this from assembly code"
 #error "Only include this from assembly code"
 #endif
 #endif
@@ -290,3 +293,4 @@
 	.macro	ldrusr, reg, ptr, inc, cond=al, rept=1, abort=9001f
 	.macro	ldrusr, reg, ptr, inc, cond=al, rept=1, abort=9001f
 	usracc	ldr, \reg, \ptr, \inc, \cond, \rept, \abort
 	usracc	ldr, \reg, \ptr, \inc, \cond, \rept, \abort
 	.endm
 	.endm
+#endif /* __ASM_ASSEMBLER_H__ */

+ 2 - 0
arch/arm/include/asm/entry-macro-multi.S

@@ -1,3 +1,5 @@
+#include <asm/assembler.h>
+
 /*
 /*
  * Interrupt handling.  Preserves r7, r8, r9
  * Interrupt handling.  Preserves r7, r8, r9
  */
  */

+ 11 - 2
arch/arm/kernel/module.c

@@ -193,8 +193,17 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
 				offset -= 0x02000000;
 				offset -= 0x02000000;
 			offset += sym->st_value - loc;
 			offset += sym->st_value - loc;
 
 
-			/* only Thumb addresses allowed (no interworking) */
-			if (!(offset & 1) ||
+			/*
+			 * For function symbols, only Thumb addresses are
+			 * allowed (no interworking).
+			 *
+			 * For non-function symbols, the destination
+			 * has no specific ARM/Thumb disposition, so
+			 * the branch is resolved under the assumption
+			 * that interworking is not required.
+			 */
+			if ((ELF32_ST_TYPE(sym->st_info) == STT_FUNC &&
+				!(offset & 1)) ||
 			    offset <= (s32)0xff000000 ||
 			    offset <= (s32)0xff000000 ||
 			    offset >= (s32)0x01000000) {
 			    offset >= (s32)0x01000000) {
 				pr_err("%s: section %u reloc %u sym '%s': relocation %u out of range (%#lx -> %#x)\n",
 				pr_err("%s: section %u reloc %u sym '%s': relocation %u out of range (%#lx -> %#x)\n",

+ 5 - 1
arch/arm/kernel/smp.c

@@ -318,9 +318,13 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
 	smp_store_cpu_info(cpu);
 	smp_store_cpu_info(cpu);
 
 
 	/*
 	/*
-	 * OK, now it's safe to let the boot CPU continue
+	 * OK, now it's safe to let the boot CPU continue.  Wait for
+	 * the CPU migration code to notice that the CPU is online
+	 * before we continue.
 	 */
 	 */
 	set_cpu_online(cpu, true);
 	set_cpu_online(cpu, true);
+	while (!cpu_active(cpu))
+		cpu_relax();
 
 
 	/*
 	/*
 	 * OK, it's off to the idle thread for us
 	 * OK, it's off to the idle thread for us

+ 1 - 0
arch/arm/mach-exynos4/init.c

@@ -35,6 +35,7 @@ void __init exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
 			tcfg->clocks = exynos4_serial_clocks;
 			tcfg->clocks = exynos4_serial_clocks;
 			tcfg->clocks_size = ARRAY_SIZE(exynos4_serial_clocks);
 			tcfg->clocks_size = ARRAY_SIZE(exynos4_serial_clocks);
 		}
 		}
+		tcfg->flags |= NO_NEED_CHECK_CLKSRC;
 	}
 	}
 
 
 	s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
 	s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);

+ 2 - 0
arch/arm/mach-h720x/Kconfig

@@ -6,12 +6,14 @@ config ARCH_H7201
 	bool "gms30c7201"
 	bool "gms30c7201"
 	depends on ARCH_H720X
 	depends on ARCH_H720X
 	select CPU_H7201
 	select CPU_H7201
+	select ZONE_DMA
 	help
 	help
 	  Say Y here if you are using the Hynix GMS30C7201 Reference Board
 	  Say Y here if you are using the Hynix GMS30C7201 Reference Board
 
 
 config ARCH_H7202
 config ARCH_H7202
 	bool "hms30c7202"
 	bool "hms30c7202"
 	select CPU_H7202
 	select CPU_H7202
+	select ZONE_DMA
 	depends on ARCH_H720X
 	depends on ARCH_H720X
 	help
 	help
 	  Say Y here if you are using the Hynix HMS30C7202 Reference Board
 	  Say Y here if you are using the Hynix HMS30C7202 Reference Board

+ 2 - 2
arch/arm/mach-shmobile/board-ag5evm.c

@@ -381,7 +381,7 @@ void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state)
 	gpio_set_value(GPIO_PORT114, state);
 	gpio_set_value(GPIO_PORT114, state);
 }
 }
 
 
-static struct sh_mobile_sdhi_info sh_sdhi1_platdata = {
+static struct sh_mobile_sdhi_info sh_sdhi1_info = {
 	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE,
 	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE,
 	.tmio_caps	= MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
 	.tmio_caps	= MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
 	.tmio_ocr_mask	= MMC_VDD_32_33 | MMC_VDD_33_34,
 	.tmio_ocr_mask	= MMC_VDD_32_33 | MMC_VDD_33_34,
@@ -413,7 +413,7 @@ static struct platform_device sdhi1_device = {
 	.name		= "sh_mobile_sdhi",
 	.name		= "sh_mobile_sdhi",
 	.id		= 1,
 	.id		= 1,
 	.dev		= {
 	.dev		= {
-		.platform_data	= &sh_sdhi1_platdata,
+		.platform_data	= &sh_sdhi1_info,
 	},
 	},
 	.num_resources	= ARRAY_SIZE(sdhi1_resources),
 	.num_resources	= ARRAY_SIZE(sdhi1_resources),
 	.resource	= sdhi1_resources,
 	.resource	= sdhi1_resources,

+ 1 - 1
arch/arm/mach-shmobile/board-ap4evb.c

@@ -913,7 +913,7 @@ static struct i2c_board_info imx074_info = {
 	I2C_BOARD_INFO("imx074", 0x1a),
 	I2C_BOARD_INFO("imx074", 0x1a),
 };
 };
 
 
-struct soc_camera_link imx074_link = {
+static struct soc_camera_link imx074_link = {
 	.bus_id		= 0,
 	.bus_id		= 0,
 	.board_info	= &imx074_info,
 	.board_info	= &imx074_info,
 	.i2c_adapter_id	= 0,
 	.i2c_adapter_id	= 0,

+ 1 - 1
arch/arm/mach-shmobile/board-mackerel.c

@@ -1287,9 +1287,9 @@ static struct platform_device *mackerel_devices[] __initdata = {
 	&nor_flash_device,
 	&nor_flash_device,
 	&smc911x_device,
 	&smc911x_device,
 	&lcdc_device,
 	&lcdc_device,
-	&usbhs0_device,
 	&usb1_host_device,
 	&usb1_host_device,
 	&usbhs1_device,
 	&usbhs1_device,
+	&usbhs0_device,
 	&leds_device,
 	&leds_device,
 	&fsi_device,
 	&fsi_device,
 	&fsi_ak4643_device,
 	&fsi_ak4643_device,

+ 12 - 4
arch/arm/mach-ux500/board-mop500-pins.c

@@ -110,10 +110,18 @@ static pin_cfg_t mop500_pins_common[] = {
 	GPIO168_KP_O0,
 	GPIO168_KP_O0,
 
 
 	/* UART */
 	/* UART */
-	GPIO0_U0_CTSn	| PIN_INPUT_PULLUP,
-	GPIO1_U0_RTSn	| PIN_OUTPUT_HIGH,
-	GPIO2_U0_RXD	| PIN_INPUT_PULLUP,
-	GPIO3_U0_TXD	| PIN_OUTPUT_HIGH,
+	/* uart-0 pins gpio configuration should be
+	 * kept intact to prevent glitch in tx line
+	 * when tty dev is opened. Later these pins
+	 * are configured to uart mop500_pins_uart0
+	 *
+	 * It will be replaced with uart configuration
+	 * once the issue is solved.
+	 */
+	GPIO0_GPIO	| PIN_INPUT_PULLUP,
+	GPIO1_GPIO	| PIN_OUTPUT_HIGH,
+	GPIO2_GPIO	| PIN_INPUT_PULLUP,
+	GPIO3_GPIO	| PIN_OUTPUT_HIGH,
 
 
 	GPIO29_U2_RXD	| PIN_INPUT_PULLUP,
 	GPIO29_U2_RXD	| PIN_INPUT_PULLUP,
 	GPIO30_U2_TXD	| PIN_OUTPUT_HIGH,
 	GPIO30_U2_TXD	| PIN_OUTPUT_HIGH,

+ 54 - 0
arch/arm/mach-ux500/board-mop500.c

@@ -27,18 +27,21 @@
 #include <linux/leds-lp5521.h>
 #include <linux/leds-lp5521.h>
 #include <linux/input.h>
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
 #include <linux/gpio_keys.h>
+#include <linux/delay.h>
 
 
 #include <asm/mach-types.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/arch.h>
 
 
 #include <plat/i2c.h>
 #include <plat/i2c.h>
 #include <plat/ste_dma40.h>
 #include <plat/ste_dma40.h>
+#include <plat/pincfg.h>
 
 
 #include <mach/hardware.h>
 #include <mach/hardware.h>
 #include <mach/setup.h>
 #include <mach/setup.h>
 #include <mach/devices.h>
 #include <mach/devices.h>
 #include <mach/irqs.h>
 #include <mach/irqs.h>
 
 
+#include "pins-db8500.h"
 #include "ste-dma40-db8500.h"
 #include "ste-dma40-db8500.h"
 #include "devices-db8500.h"
 #include "devices-db8500.h"
 #include "board-mop500.h"
 #include "board-mop500.h"
@@ -393,12 +396,63 @@ static struct stedma40_chan_cfg uart2_dma_cfg_tx = {
 };
 };
 #endif
 #endif
 
 
+
+static pin_cfg_t mop500_pins_uart0[] = {
+	GPIO0_U0_CTSn   | PIN_INPUT_PULLUP,
+	GPIO1_U0_RTSn   | PIN_OUTPUT_HIGH,
+	GPIO2_U0_RXD    | PIN_INPUT_PULLUP,
+	GPIO3_U0_TXD    | PIN_OUTPUT_HIGH,
+};
+
+#define PRCC_K_SOFTRST_SET      0x18
+#define PRCC_K_SOFTRST_CLEAR    0x1C
+static void ux500_uart0_reset(void)
+{
+	void __iomem *prcc_rst_set, *prcc_rst_clr;
+
+	prcc_rst_set = (void __iomem *)IO_ADDRESS(U8500_CLKRST1_BASE +
+			PRCC_K_SOFTRST_SET);
+	prcc_rst_clr = (void __iomem *)IO_ADDRESS(U8500_CLKRST1_BASE +
+			PRCC_K_SOFTRST_CLEAR);
+
+	/* Activate soft reset PRCC_K_SOFTRST_CLEAR */
+	writel((readl(prcc_rst_clr) | 0x1), prcc_rst_clr);
+	udelay(1);
+
+	/* Release soft reset PRCC_K_SOFTRST_SET */
+	writel((readl(prcc_rst_set) | 0x1), prcc_rst_set);
+	udelay(1);
+}
+
+static void ux500_uart0_init(void)
+{
+	int ret;
+
+	ret = nmk_config_pins(mop500_pins_uart0,
+			ARRAY_SIZE(mop500_pins_uart0));
+	if (ret < 0)
+		pr_err("pl011: uart pins_enable failed\n");
+}
+
+static void ux500_uart0_exit(void)
+{
+	int ret;
+
+	ret = nmk_config_pins_sleep(mop500_pins_uart0,
+			ARRAY_SIZE(mop500_pins_uart0));
+	if (ret < 0)
+		pr_err("pl011: uart pins_disable failed\n");
+}
+
 static struct amba_pl011_data uart0_plat = {
 static struct amba_pl011_data uart0_plat = {
 #ifdef CONFIG_STE_DMA40
 #ifdef CONFIG_STE_DMA40
 	.dma_filter = stedma40_filter,
 	.dma_filter = stedma40_filter,
 	.dma_rx_param = &uart0_dma_cfg_rx,
 	.dma_rx_param = &uart0_dma_cfg_rx,
 	.dma_tx_param = &uart0_dma_cfg_tx,
 	.dma_tx_param = &uart0_dma_cfg_tx,
 #endif
 #endif
+	.init = ux500_uart0_init,
+	.exit = ux500_uart0_exit,
+	.reset = ux500_uart0_reset,
 };
 };
 
 
 static struct amba_pl011_data uart1_plat = {
 static struct amba_pl011_data uart1_plat = {

+ 10 - 6
arch/arm/mm/proc-v7.S

@@ -210,19 +210,21 @@ cpu_v7_name:
 
 
 /* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */
 /* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */
 .globl	cpu_v7_suspend_size
 .globl	cpu_v7_suspend_size
-.equ	cpu_v7_suspend_size, 4 * 8
+.equ	cpu_v7_suspend_size, 4 * 9
 #ifdef CONFIG_PM_SLEEP
 #ifdef CONFIG_PM_SLEEP
 ENTRY(cpu_v7_do_suspend)
 ENTRY(cpu_v7_do_suspend)
 	stmfd	sp!, {r4 - r11, lr}
 	stmfd	sp!, {r4 - r11, lr}
 	mrc	p15, 0, r4, c13, c0, 0	@ FCSE/PID
 	mrc	p15, 0, r4, c13, c0, 0	@ FCSE/PID
 	mrc	p15, 0, r5, c13, c0, 1	@ Context ID
 	mrc	p15, 0, r5, c13, c0, 1	@ Context ID
+	mrc	p15, 0, r6, c13, c0, 3	@ User r/o thread ID
+	stmia	r0!, {r4 - r6}
 	mrc	p15, 0, r6, c3, c0, 0	@ Domain ID
 	mrc	p15, 0, r6, c3, c0, 0	@ Domain ID
 	mrc	p15, 0, r7, c2, c0, 0	@ TTB 0
 	mrc	p15, 0, r7, c2, c0, 0	@ TTB 0
 	mrc	p15, 0, r8, c2, c0, 1	@ TTB 1
 	mrc	p15, 0, r8, c2, c0, 1	@ TTB 1
 	mrc	p15, 0, r9, c1, c0, 0	@ Control register
 	mrc	p15, 0, r9, c1, c0, 0	@ Control register
 	mrc	p15, 0, r10, c1, c0, 1	@ Auxiliary control register
 	mrc	p15, 0, r10, c1, c0, 1	@ Auxiliary control register
 	mrc	p15, 0, r11, c1, c0, 2	@ Co-processor access control
 	mrc	p15, 0, r11, c1, c0, 2	@ Co-processor access control
-	stmia	r0, {r4 - r11}
+	stmia	r0, {r6 - r11}
 	ldmfd	sp!, {r4 - r11, pc}
 	ldmfd	sp!, {r4 - r11, pc}
 ENDPROC(cpu_v7_do_suspend)
 ENDPROC(cpu_v7_do_suspend)
 
 
@@ -230,9 +232,11 @@ ENTRY(cpu_v7_do_resume)
 	mov	ip, #0
 	mov	ip, #0
 	mcr	p15, 0, ip, c8, c7, 0	@ invalidate TLBs
 	mcr	p15, 0, ip, c8, c7, 0	@ invalidate TLBs
 	mcr	p15, 0, ip, c7, c5, 0	@ invalidate I cache
 	mcr	p15, 0, ip, c7, c5, 0	@ invalidate I cache
-	ldmia	r0, {r4 - r11}
+	ldmia	r0!, {r4 - r6}
 	mcr	p15, 0, r4, c13, c0, 0	@ FCSE/PID
 	mcr	p15, 0, r4, c13, c0, 0	@ FCSE/PID
 	mcr	p15, 0, r5, c13, c0, 1	@ Context ID
 	mcr	p15, 0, r5, c13, c0, 1	@ Context ID
+	mcr	p15, 0, r6, c13, c0, 3	@ User r/o thread ID
+	ldmia	r0, {r6 - r11}
 	mcr	p15, 0, r6, c3, c0, 0	@ Domain ID
 	mcr	p15, 0, r6, c3, c0, 0	@ Domain ID
 	mcr	p15, 0, r7, c2, c0, 0	@ TTB 0
 	mcr	p15, 0, r7, c2, c0, 0	@ TTB 0
 	mcr	p15, 0, r8, c2, c0, 1	@ TTB 1
 	mcr	p15, 0, r8, c2, c0, 1	@ TTB 1
@@ -418,9 +422,9 @@ ENTRY(v7_processor_functions)
 	.word	cpu_v7_dcache_clean_area
 	.word	cpu_v7_dcache_clean_area
 	.word	cpu_v7_switch_mm
 	.word	cpu_v7_switch_mm
 	.word	cpu_v7_set_pte_ext
 	.word	cpu_v7_set_pte_ext
-	.word	0
-	.word	0
-	.word	0
+	.word	cpu_v7_suspend_size
+	.word	cpu_v7_do_suspend
+	.word	cpu_v7_do_resume
 	.size	v7_processor_functions, . - v7_processor_functions
 	.size	v7_processor_functions, . - v7_processor_functions
 
 
 	.section ".rodata"
 	.section ".rodata"

+ 1 - 0
arch/arm/plat-iop/cp6.c

@@ -18,6 +18,7 @@
  */
  */
 #include <linux/init.h>
 #include <linux/init.h>
 #include <asm/traps.h>
 #include <asm/traps.h>
+#include <asm/ptrace.h>
 
 
 static int cp6_trap(struct pt_regs *regs, unsigned int instr)
 static int cp6_trap(struct pt_regs *regs, unsigned int instr)
 {
 {

+ 2 - 0
arch/arm/plat-samsung/include/plat/regs-serial.h

@@ -224,6 +224,8 @@
 #define S5PV210_UFSTAT_RXMASK	(255<<0)
 #define S5PV210_UFSTAT_RXMASK	(255<<0)
 #define S5PV210_UFSTAT_RXSHIFT	(0)
 #define S5PV210_UFSTAT_RXSHIFT	(0)
 
 
+#define NO_NEED_CHECK_CLKSRC	1
+
 #ifndef __ASSEMBLY__
 #ifndef __ASSEMBLY__
 
 
 /* struct s3c24xx_uart_clksrc
 /* struct s3c24xx_uart_clksrc

+ 1 - 7
arch/m32r/include/asm/mmzone.h

@@ -14,12 +14,6 @@ extern struct pglist_data *node_data[];
 #define NODE_DATA(nid)		(node_data[nid])
 #define NODE_DATA(nid)		(node_data[nid])
 
 
 #define node_localnr(pfn, nid)	((pfn) - NODE_DATA(nid)->node_start_pfn)
 #define node_localnr(pfn, nid)	((pfn) - NODE_DATA(nid)->node_start_pfn)
-#define node_start_pfn(nid)	(NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)						\
-({									\
-	pg_data_t *__pgdat = NODE_DATA(nid);				\
-	__pgdat->node_start_pfn + __pgdat->node_spanned_pages - 1;	\
-})
 
 
 #define pmd_page(pmd)		(pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
 #define pmd_page(pmd)		(pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
 /*
 /*
@@ -44,7 +38,7 @@ static __inline__ int pfn_to_nid(unsigned long pfn)
 	int node;
 	int node;
 
 
 	for (node = 0 ; node < MAX_NUMNODES ; node++)
 	for (node = 0 ; node < MAX_NUMNODES ; node++)
-		if (pfn >= node_start_pfn(node) && pfn <= node_end_pfn(node))
+		if (pfn >= node_start_pfn(node) && pfn < node_end_pfn(node))
 			break;
 			break;
 
 
 	return node;
 	return node;

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

@@ -15,6 +15,7 @@
  * User space memory access functions
  * User space memory access functions
  */
  */
 #include <linux/thread_info.h>
 #include <linux/thread_info.h>
+#include <linux/kernel.h>
 #include <asm/page.h>
 #include <asm/page.h>
 #include <asm/errno.h>
 #include <asm/errno.h>
 
 

+ 0 - 7
arch/parisc/include/asm/mmzone.h

@@ -14,13 +14,6 @@ extern struct node_map_data node_data[];
 
 
 #define NODE_DATA(nid)          (&node_data[nid].pg_data)
 #define NODE_DATA(nid)          (&node_data[nid].pg_data)
 
 
-#define node_start_pfn(nid)	(NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)						\
-({									\
-	pg_data_t *__pgdat = NODE_DATA(nid);				\
-	__pgdat->node_start_pfn + __pgdat->node_spanned_pages;		\
-})
-
 /* We have these possible memory map layouts:
 /* We have these possible memory map layouts:
  * Astro: 0-3.75, 67.75-68, 4-64
  * Astro: 0-3.75, 67.75-68, 4-64
  * zx1: 0-1, 257-260, 4-256
  * zx1: 0-1, 257-260, 4-256

+ 6 - 3
arch/powerpc/boot/dts/p1022ds.dts

@@ -209,8 +209,10 @@
 			wm8776:codec@1a {
 			wm8776:codec@1a {
 				compatible = "wlf,wm8776";
 				compatible = "wlf,wm8776";
 				reg = <0x1a>;
 				reg = <0x1a>;
-				/* MCLK source is a stand-alone oscillator */
-				clock-frequency = <12288000>;
+				/*
+				 * clock-frequency will be set by U-Boot if
+				 * the clock is enabled.
+				 */
 			};
 			};
 		};
 		};
 
 
@@ -280,7 +282,8 @@
 			codec-handle = <&wm8776>;
 			codec-handle = <&wm8776>;
 			fsl,playback-dma = <&dma00>;
 			fsl,playback-dma = <&dma00>;
 			fsl,capture-dma = <&dma01>;
 			fsl,capture-dma = <&dma01>;
-			fsl,fifo-depth = <16>;
+			fsl,fifo-depth = <15>;
+			fsl,ssi-asynchronous;
 		};
 		};
 
 
 		dma@c300 {
 		dma@c300 {

+ 0 - 1
arch/powerpc/configs/pseries_defconfig

@@ -148,7 +148,6 @@ CONFIG_SCSI_SAS_ATTRS=m
 CONFIG_SCSI_CXGB3_ISCSI=m
 CONFIG_SCSI_CXGB3_ISCSI=m
 CONFIG_SCSI_CXGB4_ISCSI=m
 CONFIG_SCSI_CXGB4_ISCSI=m
 CONFIG_SCSI_BNX2_ISCSI=m
 CONFIG_SCSI_BNX2_ISCSI=m
-CONFIG_SCSI_BNX2_ISCSI=m
 CONFIG_BE2ISCSI=m
 CONFIG_BE2ISCSI=m
 CONFIG_SCSI_IBMVSCSI=y
 CONFIG_SCSI_IBMVSCSI=y
 CONFIG_SCSI_IBMVFC=m
 CONFIG_SCSI_IBMVFC=m

+ 0 - 7
arch/powerpc/include/asm/mmzone.h

@@ -38,13 +38,6 @@ u64 memory_hotplug_max(void);
 #define memory_hotplug_max() memblock_end_of_DRAM()
 #define memory_hotplug_max() memblock_end_of_DRAM()
 #endif
 #endif
 
 
-/*
- * Following are macros that each numa implmentation must define.
- */
-
-#define node_start_pfn(nid)	(NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)	(NODE_DATA(nid)->node_end_pfn)
-
 #else
 #else
 #define memory_hotplug_max() memblock_end_of_DRAM()
 #define memory_hotplug_max() memblock_end_of_DRAM()
 #endif /* CONFIG_NEED_MULTIPLE_NODES */
 #endif /* CONFIG_NEED_MULTIPLE_NODES */

+ 17 - 12
arch/powerpc/kernel/rtas-rtc.c

@@ -4,6 +4,7 @@
 #include <linux/init.h>
 #include <linux/init.h>
 #include <linux/rtc.h>
 #include <linux/rtc.h>
 #include <linux/delay.h>
 #include <linux/delay.h>
+#include <linux/ratelimit.h>
 #include <asm/prom.h>
 #include <asm/prom.h>
 #include <asm/rtas.h>
 #include <asm/rtas.h>
 #include <asm/time.h>
 #include <asm/time.h>
@@ -29,9 +30,10 @@ unsigned long __init rtas_get_boot_time(void)
 		}
 		}
 	} while (wait_time && (get_tb() < max_wait_tb));
 	} while (wait_time && (get_tb() < max_wait_tb));
 
 
-	if (error != 0 && printk_ratelimit()) {
-		printk(KERN_WARNING "error: reading the clock failed (%d)\n",
-			error);
+	if (error != 0) {
+		printk_ratelimited(KERN_WARNING
+				   "error: reading the clock failed (%d)\n",
+				   error);
 		return 0;
 		return 0;
 	}
 	}
 
 
@@ -55,19 +57,21 @@ void rtas_get_rtc_time(struct rtc_time *rtc_tm)
 
 
 		wait_time = rtas_busy_delay_time(error);
 		wait_time = rtas_busy_delay_time(error);
 		if (wait_time) {
 		if (wait_time) {
-			if (in_interrupt() && printk_ratelimit()) {
+			if (in_interrupt()) {
 				memset(rtc_tm, 0, sizeof(struct rtc_time));
 				memset(rtc_tm, 0, sizeof(struct rtc_time));
-				printk(KERN_WARNING "error: reading clock"
-				       " would delay interrupt\n");
+				printk_ratelimited(KERN_WARNING
+						   "error: reading clock "
+						   "would delay interrupt\n");
 				return;	/* delay not allowed */
 				return;	/* delay not allowed */
 			}
 			}
 			msleep(wait_time);
 			msleep(wait_time);
 		}
 		}
 	} while (wait_time && (get_tb() < max_wait_tb));
 	} while (wait_time && (get_tb() < max_wait_tb));
 
 
-        if (error != 0 && printk_ratelimit()) {
-                printk(KERN_WARNING "error: reading the clock failed (%d)\n",
-		       error);
+	if (error != 0) {
+		printk_ratelimited(KERN_WARNING
+				   "error: reading the clock failed (%d)\n",
+				   error);
 		return;
 		return;
         }
         }
 
 
@@ -99,9 +103,10 @@ int rtas_set_rtc_time(struct rtc_time *tm)
 		}
 		}
 	} while (wait_time && (get_tb() < max_wait_tb));
 	} while (wait_time && (get_tb() < max_wait_tb));
 
 
-        if (error != 0 && printk_ratelimit())
-                printk(KERN_WARNING "error: setting the clock failed (%d)\n",
-		       error);
+	if (error != 0)
+		printk_ratelimited(KERN_WARNING
+				   "error: setting the clock failed (%d)\n",
+				   error);
 
 
         return 0;
         return 0;
 }
 }

+ 31 - 26
arch/powerpc/kernel/signal_32.c

@@ -25,6 +25,7 @@
 #include <linux/errno.h>
 #include <linux/errno.h>
 #include <linux/elf.h>
 #include <linux/elf.h>
 #include <linux/ptrace.h>
 #include <linux/ptrace.h>
+#include <linux/ratelimit.h>
 #ifdef CONFIG_PPC64
 #ifdef CONFIG_PPC64
 #include <linux/syscalls.h>
 #include <linux/syscalls.h>
 #include <linux/compat.h>
 #include <linux/compat.h>
@@ -892,11 +893,12 @@ badframe:
 	printk("badframe in handle_rt_signal, regs=%p frame=%p newsp=%lx\n",
 	printk("badframe in handle_rt_signal, regs=%p frame=%p newsp=%lx\n",
 	       regs, frame, newsp);
 	       regs, frame, newsp);
 #endif
 #endif
-	if (show_unhandled_signals && printk_ratelimit())
-		printk(KERN_INFO "%s[%d]: bad frame in handle_rt_signal32: "
-			"%p nip %08lx lr %08lx\n",
-			current->comm, current->pid,
-			addr, regs->nip, regs->link);
+	if (show_unhandled_signals)
+		printk_ratelimited(KERN_INFO
+				   "%s[%d]: bad frame in handle_rt_signal32: "
+				   "%p nip %08lx lr %08lx\n",
+				   current->comm, current->pid,
+				   addr, regs->nip, regs->link);
 
 
 	force_sigsegv(sig, current);
 	force_sigsegv(sig, current);
 	return 0;
 	return 0;
@@ -1058,11 +1060,12 @@ long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
 	return 0;
 	return 0;
 
 
  bad:
  bad:
-	if (show_unhandled_signals && printk_ratelimit())
-		printk(KERN_INFO "%s[%d]: bad frame in sys_rt_sigreturn: "
-			"%p nip %08lx lr %08lx\n",
-			current->comm, current->pid,
-			rt_sf, regs->nip, regs->link);
+	if (show_unhandled_signals)
+		printk_ratelimited(KERN_INFO
+				   "%s[%d]: bad frame in sys_rt_sigreturn: "
+				   "%p nip %08lx lr %08lx\n",
+				   current->comm, current->pid,
+				   rt_sf, regs->nip, regs->link);
 
 
 	force_sig(SIGSEGV, current);
 	force_sig(SIGSEGV, current);
 	return 0;
 	return 0;
@@ -1149,12 +1152,12 @@ int sys_debug_setcontext(struct ucontext __user *ctx,
 	 * We kill the task with a SIGSEGV in this situation.
 	 * We kill the task with a SIGSEGV in this situation.
 	 */
 	 */
 	if (do_setcontext(ctx, regs, 1)) {
 	if (do_setcontext(ctx, regs, 1)) {
-		if (show_unhandled_signals && printk_ratelimit())
-			printk(KERN_INFO "%s[%d]: bad frame in "
-				"sys_debug_setcontext: %p nip %08lx "
-				"lr %08lx\n",
-				current->comm, current->pid,
-				ctx, regs->nip, regs->link);
+		if (show_unhandled_signals)
+			printk_ratelimited(KERN_INFO "%s[%d]: bad frame in "
+					   "sys_debug_setcontext: %p nip %08lx "
+					   "lr %08lx\n",
+					   current->comm, current->pid,
+					   ctx, regs->nip, regs->link);
 
 
 		force_sig(SIGSEGV, current);
 		force_sig(SIGSEGV, current);
 		goto out;
 		goto out;
@@ -1236,11 +1239,12 @@ badframe:
 	printk("badframe in handle_signal, regs=%p frame=%p newsp=%lx\n",
 	printk("badframe in handle_signal, regs=%p frame=%p newsp=%lx\n",
 	       regs, frame, newsp);
 	       regs, frame, newsp);
 #endif
 #endif
-	if (show_unhandled_signals && printk_ratelimit())
-		printk(KERN_INFO "%s[%d]: bad frame in handle_signal32: "
-			"%p nip %08lx lr %08lx\n",
-			current->comm, current->pid,
-			frame, regs->nip, regs->link);
+	if (show_unhandled_signals)
+		printk_ratelimited(KERN_INFO
+				   "%s[%d]: bad frame in handle_signal32: "
+				   "%p nip %08lx lr %08lx\n",
+				   current->comm, current->pid,
+				   frame, regs->nip, regs->link);
 
 
 	force_sigsegv(sig, current);
 	force_sigsegv(sig, current);
 	return 0;
 	return 0;
@@ -1288,11 +1292,12 @@ long sys_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
 	return 0;
 	return 0;
 
 
 badframe:
 badframe:
-	if (show_unhandled_signals && printk_ratelimit())
-		printk(KERN_INFO "%s[%d]: bad frame in sys_sigreturn: "
-			"%p nip %08lx lr %08lx\n",
-			current->comm, current->pid,
-			addr, regs->nip, regs->link);
+	if (show_unhandled_signals)
+		printk_ratelimited(KERN_INFO
+				   "%s[%d]: bad frame in sys_sigreturn: "
+				   "%p nip %08lx lr %08lx\n",
+				   current->comm, current->pid,
+				   addr, regs->nip, regs->link);
 
 
 	force_sig(SIGSEGV, current);
 	force_sig(SIGSEGV, current);
 	return 0;
 	return 0;

+ 9 - 8
arch/powerpc/kernel/signal_64.c

@@ -24,6 +24,7 @@
 #include <linux/elf.h>
 #include <linux/elf.h>
 #include <linux/ptrace.h>
 #include <linux/ptrace.h>
 #include <linux/module.h>
 #include <linux/module.h>
+#include <linux/ratelimit.h>
 
 
 #include <asm/sigcontext.h>
 #include <asm/sigcontext.h>
 #include <asm/ucontext.h>
 #include <asm/ucontext.h>
@@ -380,10 +381,10 @@ badframe:
 	printk("badframe in sys_rt_sigreturn, regs=%p uc=%p &uc->uc_mcontext=%p\n",
 	printk("badframe in sys_rt_sigreturn, regs=%p uc=%p &uc->uc_mcontext=%p\n",
 	       regs, uc, &uc->uc_mcontext);
 	       regs, uc, &uc->uc_mcontext);
 #endif
 #endif
-	if (show_unhandled_signals && printk_ratelimit())
-		printk(regs->msr & MSR_64BIT ? fmt64 : fmt32,
-			current->comm, current->pid, "rt_sigreturn",
-			(long)uc, regs->nip, regs->link);
+	if (show_unhandled_signals)
+		printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32,
+				   current->comm, current->pid, "rt_sigreturn",
+				   (long)uc, regs->nip, regs->link);
 
 
 	force_sig(SIGSEGV, current);
 	force_sig(SIGSEGV, current);
 	return 0;
 	return 0;
@@ -468,10 +469,10 @@ badframe:
 	printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n",
 	printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n",
 	       regs, frame, newsp);
 	       regs, frame, newsp);
 #endif
 #endif
-	if (show_unhandled_signals && printk_ratelimit())
-		printk(regs->msr & MSR_64BIT ? fmt64 : fmt32,
-			current->comm, current->pid, "setup_rt_frame",
-			(long)frame, regs->nip, regs->link);
+	if (show_unhandled_signals)
+		printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32,
+				   current->comm, current->pid, "setup_rt_frame",
+				   (long)frame, regs->nip, regs->link);
 
 
 	force_sigsegv(signr, current);
 	force_sigsegv(signr, current);
 	return 0;
 	return 0;

+ 11 - 13
arch/powerpc/kernel/traps.c

@@ -34,6 +34,7 @@
 #include <linux/bug.h>
 #include <linux/bug.h>
 #include <linux/kdebug.h>
 #include <linux/kdebug.h>
 #include <linux/debugfs.h>
 #include <linux/debugfs.h>
+#include <linux/ratelimit.h>
 
 
 #include <asm/emulated_ops.h>
 #include <asm/emulated_ops.h>
 #include <asm/pgtable.h>
 #include <asm/pgtable.h>
@@ -197,12 +198,11 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
 		if (die("Exception in kernel mode", regs, signr))
 		if (die("Exception in kernel mode", regs, signr))
 			return;
 			return;
 	} else if (show_unhandled_signals &&
 	} else if (show_unhandled_signals &&
-		    unhandled_signal(current, signr) &&
-		    printk_ratelimit()) {
-			printk(regs->msr & MSR_64BIT ? fmt64 : fmt32,
-				current->comm, current->pid, signr,
-				addr, regs->nip, regs->link, code);
-		}
+		   unhandled_signal(current, signr)) {
+		printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32,
+				   current->comm, current->pid, signr,
+				   addr, regs->nip, regs->link, code);
+	}
 
 
 	memset(&info, 0, sizeof(info));
 	memset(&info, 0, sizeof(info));
 	info.si_signo = signr;
 	info.si_signo = signr;
@@ -425,7 +425,7 @@ int machine_check_e500mc(struct pt_regs *regs)
 	unsigned long reason = mcsr;
 	unsigned long reason = mcsr;
 	int recoverable = 1;
 	int recoverable = 1;
 
 
-	if (reason & MCSR_BUS_RBERR) {
+	if (reason & MCSR_LD) {
 		recoverable = fsl_rio_mcheck_exception(regs);
 		recoverable = fsl_rio_mcheck_exception(regs);
 		if (recoverable == 1)
 		if (recoverable == 1)
 			goto silent_out;
 			goto silent_out;
@@ -1342,9 +1342,8 @@ void altivec_assist_exception(struct pt_regs *regs)
 	} else {
 	} else {
 		/* didn't recognize the instruction */
 		/* didn't recognize the instruction */
 		/* XXX quick hack for now: set the non-Java bit in the VSCR */
 		/* XXX quick hack for now: set the non-Java bit in the VSCR */
-		if (printk_ratelimit())
-			printk(KERN_ERR "Unrecognized altivec instruction "
-			       "in %s at %lx\n", current->comm, regs->nip);
+		printk_ratelimited(KERN_ERR "Unrecognized altivec instruction "
+				   "in %s at %lx\n", current->comm, regs->nip);
 		current->thread.vscr.u[3] |= 0x10000;
 		current->thread.vscr.u[3] |= 0x10000;
 	}
 	}
 }
 }
@@ -1548,9 +1547,8 @@ u32 ppc_warn_emulated;
 
 
 void ppc_warn_emulated_print(const char *type)
 void ppc_warn_emulated_print(const char *type)
 {
 {
-	if (printk_ratelimit())
-		pr_warning("%s used emulated %s instruction\n", current->comm,
-			   type);
+	pr_warn_ratelimited("%s used emulated %s instruction\n", current->comm,
+			    type);
 }
 }
 
 
 static int __init ppc_warn_emulated_init(void)
 static int __init ppc_warn_emulated_init(void)

+ 5 - 5
arch/powerpc/mm/fault.c

@@ -31,6 +31,7 @@
 #include <linux/kdebug.h>
 #include <linux/kdebug.h>
 #include <linux/perf_event.h>
 #include <linux/perf_event.h>
 #include <linux/magic.h>
 #include <linux/magic.h>
+#include <linux/ratelimit.h>
 
 
 #include <asm/firmware.h>
 #include <asm/firmware.h>
 #include <asm/page.h>
 #include <asm/page.h>
@@ -346,11 +347,10 @@ bad_area_nosemaphore:
 		return 0;
 		return 0;
 	}
 	}
 
 
-	if (is_exec && (error_code & DSISR_PROTFAULT)
-	    && printk_ratelimit())
-		printk(KERN_CRIT "kernel tried to execute NX-protected"
-		       " page (%lx) - exploit attempt? (uid: %d)\n",
-		       address, current_uid());
+	if (is_exec && (error_code & DSISR_PROTFAULT))
+		printk_ratelimited(KERN_CRIT "kernel tried to execute NX-protected"
+				   " page (%lx) - exploit attempt? (uid: %d)\n",
+				   address, current_uid());
 
 
 	return SIGSEGV;
 	return SIGSEGV;
 
 

+ 18 - 17
arch/powerpc/sysdev/fsl_rio.c

@@ -283,23 +283,24 @@ static void __iomem *rio_regs_win;
 #ifdef CONFIG_E500
 #ifdef CONFIG_E500
 int fsl_rio_mcheck_exception(struct pt_regs *regs)
 int fsl_rio_mcheck_exception(struct pt_regs *regs)
 {
 {
-	const struct exception_table_entry *entry = NULL;
-	unsigned long reason = mfspr(SPRN_MCSR);
-
-	if (reason & MCSR_BUS_RBERR) {
-		reason = in_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR));
-		if (reason & (RIO_LTLEDCSR_IER | RIO_LTLEDCSR_PRT)) {
-			/* Check if we are prepared to handle this fault */
-			entry = search_exception_tables(regs->nip);
-			if (entry) {
-				pr_debug("RIO: %s - MC Exception handled\n",
-					 __func__);
-				out_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR),
-					 0);
-				regs->msr |= MSR_RI;
-				regs->nip = entry->fixup;
-				return 1;
-			}
+	const struct exception_table_entry *entry;
+	unsigned long reason;
+
+	if (!rio_regs_win)
+		return 0;
+
+	reason = in_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR));
+	if (reason & (RIO_LTLEDCSR_IER | RIO_LTLEDCSR_PRT)) {
+		/* Check if we are prepared to handle this fault */
+		entry = search_exception_tables(regs->nip);
+		if (entry) {
+			pr_debug("RIO: %s - MC Exception handled\n",
+				 __func__);
+			out_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR),
+				 0);
+			regs->msr |= MSR_RI;
+			regs->nip = entry->fixup;
+			return 1;
 		}
 		}
 	}
 	}
 
 

+ 5 - 6
arch/powerpc/sysdev/mpic.c

@@ -29,6 +29,7 @@
 #include <linux/pci.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/syscore_ops.h>
 #include <linux/syscore_ops.h>
+#include <linux/ratelimit.h>
 
 
 #include <asm/ptrace.h>
 #include <asm/ptrace.h>
 #include <asm/signal.h>
 #include <asm/signal.h>
@@ -1648,9 +1649,8 @@ static unsigned int _mpic_get_one_irq(struct mpic *mpic, int reg)
 		return NO_IRQ;
 		return NO_IRQ;
 	}
 	}
 	if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
 	if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
-		if (printk_ratelimit())
-			printk(KERN_WARNING "%s: Got protected source %d !\n",
-			       mpic->name, (int)src);
+		printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n",
+				   mpic->name, (int)src);
 		mpic_eoi(mpic);
 		mpic_eoi(mpic);
 		return NO_IRQ;
 		return NO_IRQ;
 	}
 	}
@@ -1688,9 +1688,8 @@ unsigned int mpic_get_coreint_irq(void)
 		return NO_IRQ;
 		return NO_IRQ;
 	}
 	}
 	if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
 	if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
-		if (printk_ratelimit())
-			printk(KERN_WARNING "%s: Got protected source %d !\n",
-			       mpic->name, (int)src);
+		printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n",
+				   mpic->name, (int)src);
 		return NO_IRQ;
 		return NO_IRQ;
 	}
 	}
 
 

+ 1 - 0
arch/s390/Kconfig

@@ -579,6 +579,7 @@ config S390_GUEST
 	def_bool y
 	def_bool y
 	prompt "s390 guest support for KVM (EXPERIMENTAL)"
 	prompt "s390 guest support for KVM (EXPERIMENTAL)"
 	depends on 64BIT && EXPERIMENTAL
 	depends on 64BIT && EXPERIMENTAL
+	select VIRTUALIZATION
 	select VIRTIO
 	select VIRTIO
 	select VIRTIO_RING
 	select VIRTIO_RING
 	select VIRTIO_CONSOLE
 	select VIRTIO_CONSOLE

+ 2 - 2
arch/s390/kernel/smp.c

@@ -262,7 +262,7 @@ void smp_ctl_set_bit(int cr, int bit)
 
 
 	memset(&parms.orvals, 0, sizeof(parms.orvals));
 	memset(&parms.orvals, 0, sizeof(parms.orvals));
 	memset(&parms.andvals, 0xff, sizeof(parms.andvals));
 	memset(&parms.andvals, 0xff, sizeof(parms.andvals));
-	parms.orvals[cr] = 1 << bit;
+	parms.orvals[cr] = 1UL << bit;
 	on_each_cpu(smp_ctl_bit_callback, &parms, 1);
 	on_each_cpu(smp_ctl_bit_callback, &parms, 1);
 }
 }
 EXPORT_SYMBOL(smp_ctl_set_bit);
 EXPORT_SYMBOL(smp_ctl_set_bit);
@@ -276,7 +276,7 @@ void smp_ctl_clear_bit(int cr, int bit)
 
 
 	memset(&parms.orvals, 0, sizeof(parms.orvals));
 	memset(&parms.orvals, 0, sizeof(parms.orvals));
 	memset(&parms.andvals, 0xff, sizeof(parms.andvals));
 	memset(&parms.andvals, 0xff, sizeof(parms.andvals));
-	parms.andvals[cr] = ~(1L << bit);
+	parms.andvals[cr] = ~(1UL << bit);
 	on_each_cpu(smp_ctl_bit_callback, &parms, 1);
 	on_each_cpu(smp_ctl_bit_callback, &parms, 1);
 }
 }
 EXPORT_SYMBOL(smp_ctl_clear_bit);
 EXPORT_SYMBOL(smp_ctl_clear_bit);

+ 7 - 1
arch/s390/oprofile/init.c

@@ -25,7 +25,7 @@ extern void s390_backtrace(struct pt_regs * const regs, unsigned int depth);
 
 
 #include "hwsampler.h"
 #include "hwsampler.h"
 
 
-#define DEFAULT_INTERVAL	4096
+#define DEFAULT_INTERVAL	4127518
 
 
 #define DEFAULT_SDBT_BLOCKS	1
 #define DEFAULT_SDBT_BLOCKS	1
 #define DEFAULT_SDB_BLOCKS	511
 #define DEFAULT_SDB_BLOCKS	511
@@ -151,6 +151,12 @@ static int oprofile_hwsampler_init(struct oprofile_operations *ops)
 	if (oprofile_max_interval == 0)
 	if (oprofile_max_interval == 0)
 		return -ENODEV;
 		return -ENODEV;
 
 
+	/* The initial value should be sane */
+	if (oprofile_hw_interval < oprofile_min_interval)
+		oprofile_hw_interval = oprofile_min_interval;
+	if (oprofile_hw_interval > oprofile_max_interval)
+		oprofile_hw_interval = oprofile_max_interval;
+
 	if (oprofile_timer_init(ops))
 	if (oprofile_timer_init(ops))
 		return -ENODEV;
 		return -ENODEV;
 
 

+ 5 - 0
arch/sh/Kconfig

@@ -348,6 +348,7 @@ config CPU_SUBTYPE_SH7720
 	select SYS_SUPPORTS_CMT
 	select SYS_SUPPORTS_CMT
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select USB_ARCH_HAS_OHCI
 	select USB_ARCH_HAS_OHCI
+	select USB_OHCI_SH if USB_OHCI_HCD
 	help
 	help
 	  Select SH7720 if you have a SH3-DSP SH7720 CPU.
 	  Select SH7720 if you have a SH3-DSP SH7720 CPU.
 
 
@@ -357,6 +358,7 @@ config CPU_SUBTYPE_SH7721
 	select CPU_HAS_DSP
 	select CPU_HAS_DSP
 	select SYS_SUPPORTS_CMT
 	select SYS_SUPPORTS_CMT
 	select USB_ARCH_HAS_OHCI
 	select USB_ARCH_HAS_OHCI
+	select USB_OHCI_SH if USB_OHCI_HCD
 	help
 	help
 	  Select SH7721 if you have a SH3-DSP SH7721 CPU.
 	  Select SH7721 if you have a SH3-DSP SH7721 CPU.
 
 
@@ -440,6 +442,7 @@ config CPU_SUBTYPE_SH7763
 	bool "Support SH7763 processor"
 	bool "Support SH7763 processor"
 	select CPU_SH4A
 	select CPU_SH4A
 	select USB_ARCH_HAS_OHCI
 	select USB_ARCH_HAS_OHCI
+	select USB_OHCI_SH if USB_OHCI_HCD
 	help
 	help
 	  Select SH7763 if you have a SH4A SH7763(R5S77631) CPU.
 	  Select SH7763 if you have a SH4A SH7763(R5S77631) CPU.
 
 
@@ -467,7 +470,9 @@ config CPU_SUBTYPE_SH7786
 	select GENERIC_CLOCKEVENTS_BROADCAST if SMP
 	select GENERIC_CLOCKEVENTS_BROADCAST if SMP
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select USB_ARCH_HAS_OHCI
 	select USB_ARCH_HAS_OHCI
+	select USB_OHCI_SH if USB_OHCI_HCD
 	select USB_ARCH_HAS_EHCI
 	select USB_ARCH_HAS_EHCI
+	select USB_EHCI_SH if USB_EHCI_HCD
 
 
 config CPU_SUBTYPE_SHX3
 config CPU_SUBTYPE_SHX3
 	bool "Support SH-X3 processor"
 	bool "Support SH-X3 processor"

+ 3 - 5
arch/sh/configs/sh7757lcr_defconfig

@@ -9,7 +9,6 @@ CONFIG_TASK_XACCT=y
 CONFIG_TASK_IO_ACCOUNTING=y
 CONFIG_TASK_IO_ACCOUNTING=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_BLK_DEV_INITRD=y
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_SYSCTL_SYSCALL is not set
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_SLAB=y
 CONFIG_SLAB=y
@@ -39,8 +38,6 @@ CONFIG_IPV6=y
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 # CONFIG_FW_LOADER is not set
 # CONFIG_FW_LOADER is not set
 CONFIG_MTD=y
 CONFIG_MTD=y
-CONFIG_MTD_CONCAT=y
-CONFIG_MTD_PARTITIONS=y
 CONFIG_MTD_CHAR=y
 CONFIG_MTD_CHAR=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_M25P80=y
 CONFIG_MTD_M25P80=y
@@ -56,18 +53,19 @@ CONFIG_SH_ETH=y
 # CONFIG_KEYBOARD_ATKBD is not set
 # CONFIG_KEYBOARD_ATKBD is not set
 # CONFIG_MOUSE_PS2 is not set
 # CONFIG_MOUSE_PS2 is not set
 # CONFIG_SERIO is not set
 # CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_SH_SCI=y
 CONFIG_SERIAL_SH_SCI=y
 CONFIG_SERIAL_SH_SCI_NR_UARTS=3
 CONFIG_SERIAL_SH_SCI_NR_UARTS=3
 CONFIG_SERIAL_SH_SCI_CONSOLE=y
 CONFIG_SERIAL_SH_SCI_CONSOLE=y
-# CONFIG_LEGACY_PTYS is not set
 # CONFIG_HW_RANDOM is not set
 # CONFIG_HW_RANDOM is not set
 CONFIG_SPI=y
 CONFIG_SPI=y
 CONFIG_SPI_SH=y
 CONFIG_SPI_SH=y
 # CONFIG_HWMON is not set
 # CONFIG_HWMON is not set
-CONFIG_MFD_SH_MOBILE_SDHI=y
 CONFIG_USB=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_SH=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_SH=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_STORAGE=y
 CONFIG_MMC=y
 CONFIG_MMC=y
 CONFIG_MMC_SDHI=y
 CONFIG_MMC_SDHI=y

+ 0 - 4
arch/sh/include/asm/mmzone.h

@@ -9,10 +9,6 @@
 extern struct pglist_data *node_data[];
 extern struct pglist_data *node_data[];
 #define NODE_DATA(nid)		(node_data[nid])
 #define NODE_DATA(nid)		(node_data[nid])
 
 
-#define node_start_pfn(nid)	(NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)	(NODE_DATA(nid)->node_start_pfn + \
-				 NODE_DATA(nid)->node_spanned_pages)
-
 static inline int pfn_to_nid(unsigned long pfn)
 static inline int pfn_to_nid(unsigned long pfn)
 {
 {
 	int nid;
 	int nid;

+ 78 - 28
arch/sh/kernel/cpu/sh4a/setup-sh7757.c

@@ -183,7 +183,7 @@ static const struct sh_dmae_slave_config sh7757_dmae1_slaves[] = {
 	{
 	{
 		.slave_id	= SHDMA_SLAVE_SCIF2_RX,
 		.slave_id	= SHDMA_SLAVE_SCIF2_RX,
 		.addr		= 0x1f4b0014,
 		.addr		= 0x1f4b0014,
-		.chcr		= SM_INC | 0x800 | 0x40000000 |
+		.chcr		= DM_INC | 0x800 | 0x40000000 |
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 		.mid_rid	= 0x22,
 		.mid_rid	= 0x22,
 	},
 	},
@@ -197,7 +197,7 @@ static const struct sh_dmae_slave_config sh7757_dmae1_slaves[] = {
 	{
 	{
 		.slave_id	= SHDMA_SLAVE_SCIF3_RX,
 		.slave_id	= SHDMA_SLAVE_SCIF3_RX,
 		.addr		= 0x1f4c0014,
 		.addr		= 0x1f4c0014,
-		.chcr		= SM_INC | 0x800 | 0x40000000 |
+		.chcr		= DM_INC | 0x800 | 0x40000000 |
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 		.mid_rid	= 0x2a,
 		.mid_rid	= 0x2a,
 	},
 	},
@@ -211,7 +211,7 @@ static const struct sh_dmae_slave_config sh7757_dmae1_slaves[] = {
 	{
 	{
 		.slave_id	= SHDMA_SLAVE_SCIF4_RX,
 		.slave_id	= SHDMA_SLAVE_SCIF4_RX,
 		.addr		= 0x1f4d0014,
 		.addr		= 0x1f4d0014,
-		.chcr		= SM_INC | 0x800 | 0x40000000 |
+		.chcr		= DM_INC | 0x800 | 0x40000000 |
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 		.mid_rid	= 0x42,
 		.mid_rid	= 0x42,
 	},
 	},
@@ -228,7 +228,7 @@ static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
 	{
 	{
 		.slave_id	= SHDMA_SLAVE_RIIC0_RX,
 		.slave_id	= SHDMA_SLAVE_RIIC0_RX,
 		.addr		= 0x1e500013,
 		.addr		= 0x1e500013,
-		.chcr		= SM_INC | 0x800 | 0x40000000 |
+		.chcr		= DM_INC | 0x800 | 0x40000000 |
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 		.mid_rid	= 0x22,
 		.mid_rid	= 0x22,
 	},
 	},
@@ -242,7 +242,7 @@ static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
 	{
 	{
 		.slave_id	= SHDMA_SLAVE_RIIC1_RX,
 		.slave_id	= SHDMA_SLAVE_RIIC1_RX,
 		.addr		= 0x1e510013,
 		.addr		= 0x1e510013,
-		.chcr		= SM_INC | 0x800 | 0x40000000 |
+		.chcr		= DM_INC | 0x800 | 0x40000000 |
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 		.mid_rid	= 0x2a,
 		.mid_rid	= 0x2a,
 	},
 	},
@@ -256,7 +256,7 @@ static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
 	{
 	{
 		.slave_id	= SHDMA_SLAVE_RIIC2_RX,
 		.slave_id	= SHDMA_SLAVE_RIIC2_RX,
 		.addr		= 0x1e520013,
 		.addr		= 0x1e520013,
-		.chcr		= SM_INC | 0x800 | 0x40000000 |
+		.chcr		= DM_INC | 0x800 | 0x40000000 |
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 		.mid_rid	= 0xa2,
 		.mid_rid	= 0xa2,
 	},
 	},
@@ -265,12 +265,12 @@ static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
 		.addr		= 0x1e530012,
 		.addr		= 0x1e530012,
 		.chcr		= SM_INC | 0x800 | 0x40000000 |
 		.chcr		= SM_INC | 0x800 | 0x40000000 |
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
-		.mid_rid	= 0xab,
+		.mid_rid	= 0xa9,
 	},
 	},
 	{
 	{
 		.slave_id	= SHDMA_SLAVE_RIIC3_RX,
 		.slave_id	= SHDMA_SLAVE_RIIC3_RX,
 		.addr		= 0x1e530013,
 		.addr		= 0x1e530013,
-		.chcr		= SM_INC | 0x800 | 0x40000000 |
+		.chcr		= DM_INC | 0x800 | 0x40000000 |
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 		.mid_rid	= 0xaf,
 		.mid_rid	= 0xaf,
 	},
 	},
@@ -279,14 +279,14 @@ static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
 		.addr		= 0x1e540012,
 		.addr		= 0x1e540012,
 		.chcr		= SM_INC | 0x800 | 0x40000000 |
 		.chcr		= SM_INC | 0x800 | 0x40000000 |
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
-		.mid_rid	= 0xc1,
+		.mid_rid	= 0xc5,
 	},
 	},
 	{
 	{
 		.slave_id	= SHDMA_SLAVE_RIIC4_RX,
 		.slave_id	= SHDMA_SLAVE_RIIC4_RX,
 		.addr		= 0x1e540013,
 		.addr		= 0x1e540013,
-		.chcr		= SM_INC | 0x800 | 0x40000000 |
+		.chcr		= DM_INC | 0x800 | 0x40000000 |
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
-		.mid_rid	= 0xc2,
+		.mid_rid	= 0xc6,
 	},
 	},
 };
 };
 
 
@@ -301,7 +301,7 @@ static const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = {
 	{
 	{
 		.slave_id	= SHDMA_SLAVE_RIIC5_RX,
 		.slave_id	= SHDMA_SLAVE_RIIC5_RX,
 		.addr		= 0x1e550013,
 		.addr		= 0x1e550013,
-		.chcr		= SM_INC | 0x800 | 0x40000000 |
+		.chcr		= DM_INC | 0x800 | 0x40000000 |
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 		.mid_rid	= 0x22,
 		.mid_rid	= 0x22,
 	},
 	},
@@ -315,7 +315,7 @@ static const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = {
 	{
 	{
 		.slave_id	= SHDMA_SLAVE_RIIC6_RX,
 		.slave_id	= SHDMA_SLAVE_RIIC6_RX,
 		.addr		= 0x1e560013,
 		.addr		= 0x1e560013,
-		.chcr		= SM_INC | 0x800 | 0x40000000 |
+		.chcr		= DM_INC | 0x800 | 0x40000000 |
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 		.mid_rid	= 0x2a,
 		.mid_rid	= 0x2a,
 	},
 	},
@@ -329,7 +329,7 @@ static const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = {
 	{
 	{
 		.slave_id	= SHDMA_SLAVE_RIIC7_RX,
 		.slave_id	= SHDMA_SLAVE_RIIC7_RX,
 		.addr		= 0x1e570013,
 		.addr		= 0x1e570013,
-		.chcr		= SM_INC | 0x800 | 0x40000000 |
+		.chcr		= DM_INC | 0x800 | 0x40000000 |
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 		.mid_rid	= 0x42,
 		.mid_rid	= 0x42,
 	},
 	},
@@ -343,7 +343,7 @@ static const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = {
 	{
 	{
 		.slave_id	= SHDMA_SLAVE_RIIC8_RX,
 		.slave_id	= SHDMA_SLAVE_RIIC8_RX,
 		.addr		= 0x1e580013,
 		.addr		= 0x1e580013,
-		.chcr		= SM_INC | 0x800 | 0x40000000 |
+		.chcr		= DM_INC | 0x800 | 0x40000000 |
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 		.mid_rid	= 0x46,
 		.mid_rid	= 0x46,
 	},
 	},
@@ -357,7 +357,7 @@ static const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = {
 	{
 	{
 		.slave_id	= SHDMA_SLAVE_RIIC9_RX,
 		.slave_id	= SHDMA_SLAVE_RIIC9_RX,
 		.addr		= 0x1e590013,
 		.addr		= 0x1e590013,
-		.chcr		= SM_INC | 0x800 | 0x40000000 |
+		.chcr		= DM_INC | 0x800 | 0x40000000 |
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 				  TS_INDEX2VAL(XMIT_SZ_8BIT),
 		.mid_rid	= 0x52,
 		.mid_rid	= 0x52,
 	},
 	},
@@ -659,6 +659,54 @@ static struct platform_device spi0_device = {
 	.resource	= spi0_resources,
 	.resource	= spi0_resources,
 };
 };
 
 
+static struct resource usb_ehci_resources[] = {
+	[0] = {
+		.start	= 0xfe4f1000,
+		.end	= 0xfe4f10ff,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= 57,
+		.end	= 57,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device usb_ehci_device = {
+	.name		= "sh_ehci",
+	.id		= -1,
+	.dev = {
+		.dma_mask = &usb_ehci_device.dev.coherent_dma_mask,
+		.coherent_dma_mask = DMA_BIT_MASK(32),
+	},
+	.num_resources	= ARRAY_SIZE(usb_ehci_resources),
+	.resource	= usb_ehci_resources,
+};
+
+static struct resource usb_ohci_resources[] = {
+	[0] = {
+		.start	= 0xfe4f1800,
+		.end	= 0xfe4f18ff,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= 57,
+		.end	= 57,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device usb_ohci_device = {
+	.name		= "sh_ohci",
+	.id		= -1,
+	.dev = {
+		.dma_mask = &usb_ohci_device.dev.coherent_dma_mask,
+		.coherent_dma_mask = DMA_BIT_MASK(32),
+	},
+	.num_resources	= ARRAY_SIZE(usb_ohci_resources),
+	.resource	= usb_ohci_resources,
+};
+
 static struct platform_device *sh7757_devices[] __initdata = {
 static struct platform_device *sh7757_devices[] __initdata = {
 	&scif2_device,
 	&scif2_device,
 	&scif3_device,
 	&scif3_device,
@@ -670,6 +718,8 @@ static struct platform_device *sh7757_devices[] __initdata = {
 	&dma2_device,
 	&dma2_device,
 	&dma3_device,
 	&dma3_device,
 	&spi0_device,
 	&spi0_device,
+	&usb_ehci_device,
+	&usb_ohci_device,
 };
 };
 
 
 static int __init sh7757_devices_setup(void)
 static int __init sh7757_devices_setup(void)
@@ -1039,13 +1089,13 @@ static DECLARE_INTC_DESC(intc_desc, "sh7757", vectors, groups,
 
 
 /* Support for external interrupt pins in IRQ mode */
 /* Support for external interrupt pins in IRQ mode */
 static struct intc_vect vectors_irq0123[] __initdata = {
 static struct intc_vect vectors_irq0123[] __initdata = {
-	INTC_VECT(IRQ0, 0x240), INTC_VECT(IRQ1, 0x280),
-	INTC_VECT(IRQ2, 0x2c0), INTC_VECT(IRQ3, 0x300),
+	INTC_VECT(IRQ0, 0x200), INTC_VECT(IRQ1, 0x240),
+	INTC_VECT(IRQ2, 0x280), INTC_VECT(IRQ3, 0x2c0),
 };
 };
 
 
 static struct intc_vect vectors_irq4567[] __initdata = {
 static struct intc_vect vectors_irq4567[] __initdata = {
-	INTC_VECT(IRQ4, 0x340), INTC_VECT(IRQ5, 0x380),
-	INTC_VECT(IRQ6, 0x3c0), INTC_VECT(IRQ7, 0x200),
+	INTC_VECT(IRQ4, 0x300), INTC_VECT(IRQ5, 0x340),
+	INTC_VECT(IRQ6, 0x380), INTC_VECT(IRQ7, 0x3c0),
 };
 };
 
 
 static struct intc_sense_reg sense_registers[] __initdata = {
 static struct intc_sense_reg sense_registers[] __initdata = {
@@ -1079,14 +1129,14 @@ static struct intc_vect vectors_irl0123[] __initdata = {
 };
 };
 
 
 static struct intc_vect vectors_irl4567[] __initdata = {
 static struct intc_vect vectors_irl4567[] __initdata = {
-	INTC_VECT(IRL4_LLLL, 0xb00), INTC_VECT(IRL4_LLLH, 0xb20),
-	INTC_VECT(IRL4_LLHL, 0xb40), INTC_VECT(IRL4_LLHH, 0xb60),
-	INTC_VECT(IRL4_LHLL, 0xb80), INTC_VECT(IRL4_LHLH, 0xba0),
-	INTC_VECT(IRL4_LHHL, 0xbc0), INTC_VECT(IRL4_LHHH, 0xbe0),
-	INTC_VECT(IRL4_HLLL, 0xc00), INTC_VECT(IRL4_HLLH, 0xc20),
-	INTC_VECT(IRL4_HLHL, 0xc40), INTC_VECT(IRL4_HLHH, 0xc60),
-	INTC_VECT(IRL4_HHLL, 0xc80), INTC_VECT(IRL4_HHLH, 0xca0),
-	INTC_VECT(IRL4_HHHL, 0xcc0),
+	INTC_VECT(IRL4_LLLL, 0x200), INTC_VECT(IRL4_LLLH, 0x220),
+	INTC_VECT(IRL4_LLHL, 0x240), INTC_VECT(IRL4_LLHH, 0x260),
+	INTC_VECT(IRL4_LHLL, 0x280), INTC_VECT(IRL4_LHLH, 0x2a0),
+	INTC_VECT(IRL4_LHHL, 0x2c0), INTC_VECT(IRL4_LHHH, 0x2e0),
+	INTC_VECT(IRL4_HLLL, 0x300), INTC_VECT(IRL4_HLLH, 0x320),
+	INTC_VECT(IRL4_HLHL, 0x340), INTC_VECT(IRL4_HLHH, 0x360),
+	INTC_VECT(IRL4_HHLL, 0x380), INTC_VECT(IRL4_HHLH, 0x3a0),
+	INTC_VECT(IRL4_HHHL, 0x3c0),
 };
 };
 
 
 static DECLARE_INTC_DESC(intc_desc_irl0123, "sh7757-irl0123", vectors_irl0123,
 static DECLARE_INTC_DESC(intc_desc_irl0123, "sh7757-irl0123", vectors_irl0123,

+ 3 - 3
arch/sh/kernel/irq.c

@@ -13,6 +13,7 @@
 #include <linux/seq_file.h>
 #include <linux/seq_file.h>
 #include <linux/ftrace.h>
 #include <linux/ftrace.h>
 #include <linux/delay.h>
 #include <linux/delay.h>
+#include <linux/ratelimit.h>
 #include <asm/processor.h>
 #include <asm/processor.h>
 #include <asm/machvec.h>
 #include <asm/machvec.h>
 #include <asm/uaccess.h>
 #include <asm/uaccess.h>
@@ -268,9 +269,8 @@ void migrate_irqs(void)
 			unsigned int newcpu = cpumask_any_and(data->affinity,
 			unsigned int newcpu = cpumask_any_and(data->affinity,
 							      cpu_online_mask);
 							      cpu_online_mask);
 			if (newcpu >= nr_cpu_ids) {
 			if (newcpu >= nr_cpu_ids) {
-				if (printk_ratelimit())
-					printk(KERN_INFO "IRQ%u no longer affine to CPU%u\n",
-					       irq, cpu);
+				pr_info_ratelimited("IRQ%u no longer affine to CPU%u\n",
+						    irq, cpu);
 
 
 				cpumask_setall(data->affinity);
 				cpumask_setall(data->affinity);
 				newcpu = cpumask_any_and(data->affinity,
 				newcpu = cpumask_any_and(data->affinity,

+ 5 - 4
arch/sh/mm/alignment.c

@@ -13,6 +13,7 @@
 #include <linux/seq_file.h>
 #include <linux/seq_file.h>
 #include <linux/proc_fs.h>
 #include <linux/proc_fs.h>
 #include <linux/uaccess.h>
 #include <linux/uaccess.h>
+#include <linux/ratelimit.h>
 #include <asm/alignment.h>
 #include <asm/alignment.h>
 #include <asm/processor.h>
 #include <asm/processor.h>
 
 
@@ -95,13 +96,13 @@ int set_unalign_ctl(struct task_struct *tsk, unsigned int val)
 void unaligned_fixups_notify(struct task_struct *tsk, insn_size_t insn,
 void unaligned_fixups_notify(struct task_struct *tsk, insn_size_t insn,
 			     struct pt_regs *regs)
 			     struct pt_regs *regs)
 {
 {
-	if (user_mode(regs) && (se_usermode & UM_WARN) && printk_ratelimit())
-		pr_notice("Fixing up unaligned userspace access "
+	if (user_mode(regs) && (se_usermode & UM_WARN))
+		pr_notice_ratelimited("Fixing up unaligned userspace access "
 			  "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
 			  "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
 			  tsk->comm, task_pid_nr(tsk),
 			  tsk->comm, task_pid_nr(tsk),
 			  (void *)instruction_pointer(regs), insn);
 			  (void *)instruction_pointer(regs), insn);
-	else if (se_kernmode_warn && printk_ratelimit())
-		pr_notice("Fixing up unaligned kernel access "
+	else if (se_kernmode_warn)
+		pr_notice_ratelimited("Fixing up unaligned kernel access "
 			  "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
 			  "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
 			  tsk->comm, task_pid_nr(tsk),
 			  tsk->comm, task_pid_nr(tsk),
 			  (void *)instruction_pointer(regs), insn);
 			  (void *)instruction_pointer(regs), insn);

+ 0 - 2
arch/sparc/include/asm/mmzone.h

@@ -8,8 +8,6 @@
 extern struct pglist_data *node_data[];
 extern struct pglist_data *node_data[];
 
 
 #define NODE_DATA(nid)		(node_data[nid])
 #define NODE_DATA(nid)		(node_data[nid])
-#define node_start_pfn(nid)	(NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)	(NODE_DATA(nid)->node_end_pfn)
 
 
 extern int numa_cpu_lookup_table[];
 extern int numa_cpu_lookup_table[];
 extern cpumask_t numa_cpumask_lookup_table[];
 extern cpumask_t numa_cpumask_lookup_table[];

+ 0 - 11
arch/tile/include/asm/mmzone.h

@@ -40,17 +40,6 @@ static inline int pfn_to_nid(unsigned long pfn)
 	return highbits_to_node[__pfn_to_highbits(pfn)];
 	return highbits_to_node[__pfn_to_highbits(pfn)];
 }
 }
 
 
-/*
- * Following are macros that each numa implmentation must define.
- */
-
-#define node_start_pfn(nid)	(NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)						\
-({									\
-	pg_data_t *__pgdat = NODE_DATA(nid);				\
-	__pgdat->node_start_pfn + __pgdat->node_spanned_pages;		\
-})
-
 #define kern_addr_valid(kaddr)	virt_addr_valid((void *)kaddr)
 #define kern_addr_valid(kaddr)	virt_addr_valid((void *)kaddr)
 
 
 static inline int pfn_valid(int pfn)
 static inline int pfn_valid(int pfn)

+ 6 - 0
arch/um/include/asm/percpu.h

@@ -0,0 +1,6 @@
+#ifndef __UM_PERCPU_H
+#define __UM_PERCPU_H
+
+#include <asm-generic/percpu.h>
+
+#endif /* __UM_PERCPU_H */

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

@@ -62,7 +62,7 @@ extern int sfi_mtimer_num;
 #else /* CONFIG_APB_TIMER */
 #else /* CONFIG_APB_TIMER */
 
 
 static inline unsigned long apbt_quick_calibrate(void) {return 0; }
 static inline unsigned long apbt_quick_calibrate(void) {return 0; }
-static inline void apbt_time_init(void) {return 0; }
+static inline void apbt_time_init(void) { }
 
 
 #endif
 #endif
 #endif /* ASM_X86_APBT_H */
 #endif /* ASM_X86_APBT_H */

+ 0 - 11
arch/x86/include/asm/mmzone_32.h

@@ -48,17 +48,6 @@ static inline int pfn_to_nid(unsigned long pfn)
 #endif
 #endif
 }
 }
 
 
-/*
- * Following are macros that each numa implmentation must define.
- */
-
-#define node_start_pfn(nid)	(NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)						\
-({									\
-	pg_data_t *__pgdat = NODE_DATA(nid);				\
-	__pgdat->node_start_pfn + __pgdat->node_spanned_pages;		\
-})
-
 static inline int pfn_valid(int pfn)
 static inline int pfn_valid(int pfn)
 {
 {
 	int nid = pfn_to_nid(pfn);
 	int nid = pfn_to_nid(pfn);

+ 0 - 3
arch/x86/include/asm/mmzone_64.h

@@ -13,8 +13,5 @@ extern struct pglist_data *node_data[];
 
 
 #define NODE_DATA(nid)		(node_data[nid])
 #define NODE_DATA(nid)		(node_data[nid])
 
 
-#define node_start_pfn(nid)	(NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)       (NODE_DATA(nid)->node_start_pfn +	\
-				 NODE_DATA(nid)->node_spanned_pages)
 #endif
 #endif
 #endif /* _ASM_X86_MMZONE_64_H */
 #endif /* _ASM_X86_MMZONE_64_H */

+ 7 - 5
arch/x86/kvm/emulate.c

@@ -3372,7 +3372,7 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, void *insn, int insn_len)
 	int def_op_bytes, def_ad_bytes, goffset, simd_prefix;
 	int def_op_bytes, def_ad_bytes, goffset, simd_prefix;
 	bool op_prefix = false;
 	bool op_prefix = false;
 	struct opcode opcode;
 	struct opcode opcode;
-	struct operand memop = { .type = OP_NONE };
+	struct operand memop = { .type = OP_NONE }, *memopp = NULL;
 
 
 	c->eip = ctxt->eip;
 	c->eip = ctxt->eip;
 	c->fetch.start = c->eip;
 	c->fetch.start = c->eip;
@@ -3547,9 +3547,6 @@ done_prefixes:
 	if (memop.type == OP_MEM && c->ad_bytes != 8)
 	if (memop.type == OP_MEM && c->ad_bytes != 8)
 		memop.addr.mem.ea = (u32)memop.addr.mem.ea;
 		memop.addr.mem.ea = (u32)memop.addr.mem.ea;
 
 
-	if (memop.type == OP_MEM && c->rip_relative)
-		memop.addr.mem.ea += c->eip;
-
 	/*
 	/*
 	 * Decode and fetch the source operand: register, memory
 	 * Decode and fetch the source operand: register, memory
 	 * or immediate.
 	 * or immediate.
@@ -3571,6 +3568,7 @@ done_prefixes:
 							   c->op_bytes;
 							   c->op_bytes;
 	srcmem_common:
 	srcmem_common:
 		c->src = memop;
 		c->src = memop;
+		memopp = &c->src;
 		break;
 		break;
 	case SrcImmU16:
 	case SrcImmU16:
 		rc = decode_imm(ctxt, &c->src, 2, false);
 		rc = decode_imm(ctxt, &c->src, 2, false);
@@ -3667,6 +3665,7 @@ done_prefixes:
 	case DstMem:
 	case DstMem:
 	case DstMem64:
 	case DstMem64:
 		c->dst = memop;
 		c->dst = memop;
+		memopp = &c->dst;
 		if ((c->d & DstMask) == DstMem64)
 		if ((c->d & DstMask) == DstMem64)
 			c->dst.bytes = 8;
 			c->dst.bytes = 8;
 		else
 		else
@@ -3700,10 +3699,13 @@ done_prefixes:
 		/* Special instructions do their own operand decoding. */
 		/* Special instructions do their own operand decoding. */
 	default:
 	default:
 		c->dst.type = OP_NONE; /* Disable writeback. */
 		c->dst.type = OP_NONE; /* Disable writeback. */
-		return 0;
+		break;
 	}
 	}
 
 
 done:
 done:
+	if (memopp && memopp->type == OP_MEM && c->rip_relative)
+		memopp->addr.mem.ea += c->eip;
+
 	return (rc == X86EMUL_UNHANDLEABLE) ? EMULATION_FAILED : EMULATION_OK;
 	return (rc == X86EMUL_UNHANDLEABLE) ? EMULATION_FAILED : EMULATION_OK;
 }
 }
 
 

+ 1 - 1
arch/x86/pci/acpi.c

@@ -188,7 +188,7 @@ static bool resource_contains(struct resource *res, resource_size_t point)
 	return false;
 	return false;
 }
 }
 
 
-static void coalesce_windows(struct pci_root_info *info, int type)
+static void coalesce_windows(struct pci_root_info *info, unsigned long type)
 {
 {
 	int i, j;
 	int i, j;
 	struct resource *res1, *res2;
 	struct resource *res1, *res2;

+ 2 - 2
block/blk-throttle.c

@@ -927,7 +927,7 @@ static int throtl_dispatch(struct request_queue *q)
 
 
 	bio_list_init(&bio_list_on_stack);
 	bio_list_init(&bio_list_on_stack);
 
 
-	throtl_log(td, "dispatch nr_queued=%lu read=%u write=%u",
+	throtl_log(td, "dispatch nr_queued=%d read=%u write=%u",
 			total_nr_queued(td), td->nr_queued[READ],
 			total_nr_queued(td), td->nr_queued[READ],
 			td->nr_queued[WRITE]);
 			td->nr_queued[WRITE]);
 
 
@@ -1204,7 +1204,7 @@ int blk_throtl_bio(struct request_queue *q, struct bio **biop)
 	}
 	}
 
 
 queue_bio:
 queue_bio:
-	throtl_log_tg(td, tg, "[%c] bio. bdisp=%u sz=%u bps=%llu"
+	throtl_log_tg(td, tg, "[%c] bio. bdisp=%llu sz=%u bps=%llu"
 			" iodisp=%u iops=%u queued=%d/%d",
 			" iodisp=%u iops=%u queued=%d/%d",
 			rw == READ ? 'R' : 'W',
 			rw == READ ? 'R' : 'W',
 			tg->bytes_disp[rw], bio->bi_size, tg->bps[rw],
 			tg->bytes_disp[rw], bio->bi_size, tg->bps[rw],

+ 10 - 6
block/cfq-iosched.c

@@ -988,9 +988,10 @@ static void cfq_group_served(struct cfq_data *cfqd, struct cfq_group *cfqg,
 
 
 	cfq_log_cfqg(cfqd, cfqg, "served: vt=%llu min_vt=%llu", cfqg->vdisktime,
 	cfq_log_cfqg(cfqd, cfqg, "served: vt=%llu min_vt=%llu", cfqg->vdisktime,
 					st->min_vdisktime);
 					st->min_vdisktime);
-	cfq_log_cfqq(cfqq->cfqd, cfqq, "sl_used=%u disp=%u charge=%u iops=%u"
-			" sect=%u", used_sl, cfqq->slice_dispatch, charge,
-			iops_mode(cfqd), cfqq->nr_sectors);
+	cfq_log_cfqq(cfqq->cfqd, cfqq,
+		     "sl_used=%u disp=%u charge=%u iops=%u sect=%lu",
+		     used_sl, cfqq->slice_dispatch, charge,
+		     iops_mode(cfqd), cfqq->nr_sectors);
 	cfq_blkiocg_update_timeslice_used(&cfqg->blkg, used_sl,
 	cfq_blkiocg_update_timeslice_used(&cfqg->blkg, used_sl,
 					  unaccounted_sl);
 					  unaccounted_sl);
 	cfq_blkiocg_set_start_empty_time(&cfqg->blkg);
 	cfq_blkiocg_set_start_empty_time(&cfqg->blkg);
@@ -2023,8 +2024,8 @@ static void cfq_arm_slice_timer(struct cfq_data *cfqd)
 	 */
 	 */
 	if (sample_valid(cic->ttime_samples) &&
 	if (sample_valid(cic->ttime_samples) &&
 	    (cfqq->slice_end - jiffies < cic->ttime_mean)) {
 	    (cfqq->slice_end - jiffies < cic->ttime_mean)) {
-		cfq_log_cfqq(cfqd, cfqq, "Not idling. think_time:%d",
-				cic->ttime_mean);
+		cfq_log_cfqq(cfqd, cfqq, "Not idling. think_time:%lu",
+			     cic->ttime_mean);
 		return;
 		return;
 	}
 	}
 
 
@@ -2772,8 +2773,11 @@ static void __cfq_exit_single_io_context(struct cfq_data *cfqd,
 	smp_wmb();
 	smp_wmb();
 	cic->key = cfqd_dead_key(cfqd);
 	cic->key = cfqd_dead_key(cfqd);
 
 
-	if (ioc->ioc_data == cic)
+	if (rcu_dereference(ioc->ioc_data) == cic) {
+		spin_lock(&ioc->lock);
 		rcu_assign_pointer(ioc->ioc_data, NULL);
 		rcu_assign_pointer(ioc->ioc_data, NULL);
+		spin_unlock(&ioc->lock);
+	}
 
 
 	if (cic->cfqq[BLK_RW_ASYNC]) {
 	if (cic->cfqq[BLK_RW_ASYNC]) {
 		cfq_exit_cfqq(cfqd, cic->cfqq[BLK_RW_ASYNC]);
 		cfq_exit_cfqq(cfqd, cic->cfqq[BLK_RW_ASYNC]);

+ 45 - 34
block/genhd.c

@@ -1371,6 +1371,7 @@ struct disk_events {
 	struct gendisk		*disk;		/* the associated disk */
 	struct gendisk		*disk;		/* the associated disk */
 	spinlock_t		lock;
 	spinlock_t		lock;
 
 
+	struct mutex		block_mutex;	/* protects blocking */
 	int			block;		/* event blocking depth */
 	int			block;		/* event blocking depth */
 	unsigned int		pending;	/* events already sent out */
 	unsigned int		pending;	/* events already sent out */
 	unsigned int		clearing;	/* events being cleared */
 	unsigned int		clearing;	/* events being cleared */
@@ -1414,22 +1415,44 @@ static unsigned long disk_events_poll_jiffies(struct gendisk *disk)
 	return msecs_to_jiffies(intv_msecs);
 	return msecs_to_jiffies(intv_msecs);
 }
 }
 
 
-static void __disk_block_events(struct gendisk *disk, bool sync)
+/**
+ * disk_block_events - block and flush disk event checking
+ * @disk: disk to block events for
+ *
+ * On return from this function, it is guaranteed that event checking
+ * isn't in progress and won't happen until unblocked by
+ * disk_unblock_events().  Events blocking is counted and the actual
+ * unblocking happens after the matching number of unblocks are done.
+ *
+ * Note that this intentionally does not block event checking from
+ * disk_clear_events().
+ *
+ * CONTEXT:
+ * Might sleep.
+ */
+void disk_block_events(struct gendisk *disk)
 {
 {
 	struct disk_events *ev = disk->ev;
 	struct disk_events *ev = disk->ev;
 	unsigned long flags;
 	unsigned long flags;
 	bool cancel;
 	bool cancel;
 
 
+	if (!ev)
+		return;
+
+	/*
+	 * Outer mutex ensures that the first blocker completes canceling
+	 * the event work before further blockers are allowed to finish.
+	 */
+	mutex_lock(&ev->block_mutex);
+
 	spin_lock_irqsave(&ev->lock, flags);
 	spin_lock_irqsave(&ev->lock, flags);
 	cancel = !ev->block++;
 	cancel = !ev->block++;
 	spin_unlock_irqrestore(&ev->lock, flags);
 	spin_unlock_irqrestore(&ev->lock, flags);
 
 
-	if (cancel) {
-		if (sync)
-			cancel_delayed_work_sync(&disk->ev->dwork);
-		else
-			cancel_delayed_work(&disk->ev->dwork);
-	}
+	if (cancel)
+		cancel_delayed_work_sync(&disk->ev->dwork);
+
+	mutex_unlock(&ev->block_mutex);
 }
 }
 
 
 static void __disk_unblock_events(struct gendisk *disk, bool check_now)
 static void __disk_unblock_events(struct gendisk *disk, bool check_now)
@@ -1460,27 +1483,6 @@ out_unlock:
 	spin_unlock_irqrestore(&ev->lock, flags);
 	spin_unlock_irqrestore(&ev->lock, flags);
 }
 }
 
 
-/**
- * disk_block_events - block and flush disk event checking
- * @disk: disk to block events for
- *
- * On return from this function, it is guaranteed that event checking
- * isn't in progress and won't happen until unblocked by
- * disk_unblock_events().  Events blocking is counted and the actual
- * unblocking happens after the matching number of unblocks are done.
- *
- * Note that this intentionally does not block event checking from
- * disk_clear_events().
- *
- * CONTEXT:
- * Might sleep.
- */
-void disk_block_events(struct gendisk *disk)
-{
-	if (disk->ev)
-		__disk_block_events(disk, true);
-}
-
 /**
 /**
  * disk_unblock_events - unblock disk event checking
  * disk_unblock_events - unblock disk event checking
  * @disk: disk to unblock events for
  * @disk: disk to unblock events for
@@ -1508,10 +1510,18 @@ void disk_unblock_events(struct gendisk *disk)
  */
  */
 void disk_check_events(struct gendisk *disk)
 void disk_check_events(struct gendisk *disk)
 {
 {
-	if (disk->ev) {
-		__disk_block_events(disk, false);
-		__disk_unblock_events(disk, true);
+	struct disk_events *ev = disk->ev;
+	unsigned long flags;
+
+	if (!ev)
+		return;
+
+	spin_lock_irqsave(&ev->lock, flags);
+	if (!ev->block) {
+		cancel_delayed_work(&ev->dwork);
+		queue_delayed_work(system_nrt_wq, &ev->dwork, 0);
 	}
 	}
+	spin_unlock_irqrestore(&ev->lock, flags);
 }
 }
 EXPORT_SYMBOL_GPL(disk_check_events);
 EXPORT_SYMBOL_GPL(disk_check_events);
 
 
@@ -1546,7 +1556,7 @@ unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask)
 	spin_unlock_irq(&ev->lock);
 	spin_unlock_irq(&ev->lock);
 
 
 	/* uncondtionally schedule event check and wait for it to finish */
 	/* uncondtionally schedule event check and wait for it to finish */
-	__disk_block_events(disk, true);
+	disk_block_events(disk);
 	queue_delayed_work(system_nrt_wq, &ev->dwork, 0);
 	queue_delayed_work(system_nrt_wq, &ev->dwork, 0);
 	flush_delayed_work(&ev->dwork);
 	flush_delayed_work(&ev->dwork);
 	__disk_unblock_events(disk, false);
 	__disk_unblock_events(disk, false);
@@ -1664,7 +1674,7 @@ static ssize_t disk_events_poll_msecs_store(struct device *dev,
 	if (intv < 0 && intv != -1)
 	if (intv < 0 && intv != -1)
 		return -EINVAL;
 		return -EINVAL;
 
 
-	__disk_block_events(disk, true);
+	disk_block_events(disk);
 	disk->ev->poll_msecs = intv;
 	disk->ev->poll_msecs = intv;
 	__disk_unblock_events(disk, true);
 	__disk_unblock_events(disk, true);
 
 
@@ -1750,6 +1760,7 @@ static void disk_add_events(struct gendisk *disk)
 	INIT_LIST_HEAD(&ev->node);
 	INIT_LIST_HEAD(&ev->node);
 	ev->disk = disk;
 	ev->disk = disk;
 	spin_lock_init(&ev->lock);
 	spin_lock_init(&ev->lock);
+	mutex_init(&ev->block_mutex);
 	ev->block = 1;
 	ev->block = 1;
 	ev->poll_msecs = -1;
 	ev->poll_msecs = -1;
 	INIT_DELAYED_WORK(&ev->dwork, disk_events_workfn);
 	INIT_DELAYED_WORK(&ev->dwork, disk_events_workfn);
@@ -1770,7 +1781,7 @@ static void disk_del_events(struct gendisk *disk)
 	if (!disk->ev)
 	if (!disk->ev)
 		return;
 		return;
 
 
-	__disk_block_events(disk, true);
+	disk_block_events(disk);
 
 
 	mutex_lock(&disk_events_mutex);
 	mutex_lock(&disk_events_mutex);
 	list_del_init(&disk->ev->node);
 	list_del_init(&disk->ev->node);

+ 3 - 4
crypto/deflate.c

@@ -32,7 +32,6 @@
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
 #include <linux/mm.h>
 #include <linux/mm.h>
 #include <linux/net.h>
 #include <linux/net.h>
-#include <linux/slab.h>
 
 
 #define DEFLATE_DEF_LEVEL		Z_DEFAULT_COMPRESSION
 #define DEFLATE_DEF_LEVEL		Z_DEFAULT_COMPRESSION
 #define DEFLATE_DEF_WINBITS		11
 #define DEFLATE_DEF_WINBITS		11
@@ -73,7 +72,7 @@ static int deflate_decomp_init(struct deflate_ctx *ctx)
 	int ret = 0;
 	int ret = 0;
 	struct z_stream_s *stream = &ctx->decomp_stream;
 	struct z_stream_s *stream = &ctx->decomp_stream;
 
 
-	stream->workspace = kzalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
+	stream->workspace = vzalloc(zlib_inflate_workspacesize());
 	if (!stream->workspace) {
 	if (!stream->workspace) {
 		ret = -ENOMEM;
 		ret = -ENOMEM;
 		goto out;
 		goto out;
@@ -86,7 +85,7 @@ static int deflate_decomp_init(struct deflate_ctx *ctx)
 out:
 out:
 	return ret;
 	return ret;
 out_free:
 out_free:
-	kfree(stream->workspace);
+	vfree(stream->workspace);
 	goto out;
 	goto out;
 }
 }
 
 
@@ -99,7 +98,7 @@ static void deflate_comp_exit(struct deflate_ctx *ctx)
 static void deflate_decomp_exit(struct deflate_ctx *ctx)
 static void deflate_decomp_exit(struct deflate_ctx *ctx)
 {
 {
 	zlib_inflateEnd(&ctx->decomp_stream);
 	zlib_inflateEnd(&ctx->decomp_stream);
-	kfree(ctx->decomp_stream.workspace);
+	vfree(ctx->decomp_stream.workspace);
 }
 }
 
 
 static int deflate_init(struct crypto_tfm *tfm)
 static int deflate_init(struct crypto_tfm *tfm)

+ 3 - 4
crypto/zlib.c

@@ -29,7 +29,6 @@
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
 #include <linux/mm.h>
 #include <linux/mm.h>
 #include <linux/net.h>
 #include <linux/net.h>
-#include <linux/slab.h>
 
 
 #include <crypto/internal/compress.h>
 #include <crypto/internal/compress.h>
 
 
@@ -60,7 +59,7 @@ static void zlib_decomp_exit(struct zlib_ctx *ctx)
 
 
 	if (stream->workspace) {
 	if (stream->workspace) {
 		zlib_inflateEnd(stream);
 		zlib_inflateEnd(stream);
-		kfree(stream->workspace);
+		vfree(stream->workspace);
 		stream->workspace = NULL;
 		stream->workspace = NULL;
 	}
 	}
 }
 }
@@ -228,13 +227,13 @@ static int zlib_decompress_setup(struct crypto_pcomp *tfm, void *params,
 				 ? nla_get_u32(tb[ZLIB_DECOMP_WINDOWBITS])
 				 ? nla_get_u32(tb[ZLIB_DECOMP_WINDOWBITS])
 				 : DEF_WBITS;
 				 : DEF_WBITS;
 
 
-	stream->workspace = kzalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
+	stream->workspace = vzalloc(zlib_inflate_workspacesize());
 	if (!stream->workspace)
 	if (!stream->workspace)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
 	ret = zlib_inflateInit2(stream, ctx->decomp_windowBits);
 	ret = zlib_inflateInit2(stream, ctx->decomp_windowBits);
 	if (ret != Z_OK) {
 	if (ret != Z_OK) {
-		kfree(stream->workspace);
+		vfree(stream->workspace);
 		stream->workspace = NULL;
 		stream->workspace = NULL;
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}

+ 1 - 1
drivers/ata/libahci.c

@@ -452,7 +452,7 @@ void ahci_save_initial_config(struct device *dev,
 	}
 	}
 
 
 	if (mask_port_map) {
 	if (mask_port_map) {
-		dev_printk(KERN_ERR, dev, "masking port_map 0x%x -> 0x%x\n",
+		dev_printk(KERN_WARNING, dev, "masking port_map 0x%x -> 0x%x\n",
 			   port_map,
 			   port_map,
 			   port_map & mask_port_map);
 			   port_map & mask_port_map);
 		port_map &= mask_port_map;
 		port_map &= mask_port_map;

+ 3 - 3
drivers/ata/libata-core.c

@@ -4143,9 +4143,9 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
 	 * Devices which choke on SETXFER.  Applies only if both the
 	 * Devices which choke on SETXFER.  Applies only if both the
 	 * device and controller are SATA.
 	 * device and controller are SATA.
 	 */
 	 */
-	{ "PIONEER DVD-RW  DVRTD08",	"1.00",	ATA_HORKAGE_NOSETXFER },
-	{ "PIONEER DVD-RW  DVR-212D",	"1.28", ATA_HORKAGE_NOSETXFER },
-	{ "PIONEER DVD-RW  DVR-216D",	"1.08", ATA_HORKAGE_NOSETXFER },
+	{ "PIONEER DVD-RW  DVRTD08",	NULL,	ATA_HORKAGE_NOSETXFER },
+	{ "PIONEER DVD-RW  DVR-212D",	NULL,	ATA_HORKAGE_NOSETXFER },
+	{ "PIONEER DVD-RW  DVR-216D",	NULL,	ATA_HORKAGE_NOSETXFER },
 
 
 	/* End Marker */
 	/* End Marker */
 	{ }
 	{ }

+ 6 - 0
drivers/ata/libata-scsi.c

@@ -3797,6 +3797,12 @@ EXPORT_SYMBOL_GPL(ata_sas_port_alloc);
  */
  */
 int ata_sas_port_start(struct ata_port *ap)
 int ata_sas_port_start(struct ata_port *ap)
 {
 {
+	/*
+	 * the port is marked as frozen at allocation time, but if we don't
+	 * have new eh, we won't thaw it
+	 */
+	if (!ap->ops->error_handler)
+		ap->pflags &= ~ATA_PFLAG_FROZEN;
 	return 0;
 	return 0;
 }
 }
 EXPORT_SYMBOL_GPL(ata_sas_port_start);
 EXPORT_SYMBOL_GPL(ata_sas_port_start);

+ 3 - 0
drivers/ata/pata_marvell.c

@@ -161,6 +161,9 @@ static const struct pci_device_id marvell_pci_tbl[] = {
 	{ PCI_DEVICE(0x11AB, 0x6121), },
 	{ PCI_DEVICE(0x11AB, 0x6121), },
 	{ PCI_DEVICE(0x11AB, 0x6123), },
 	{ PCI_DEVICE(0x11AB, 0x6123), },
 	{ PCI_DEVICE(0x11AB, 0x6145), },
 	{ PCI_DEVICE(0x11AB, 0x6145), },
+	{ PCI_DEVICE(0x1B4B, 0x91A0), },
+	{ PCI_DEVICE(0x1B4B, 0x91A4), },
+
 	{ }	/* terminate list */
 	{ }	/* terminate list */
 };
 };
 
 

+ 1 - 1
drivers/ata/sata_dwc_460ex.c

@@ -389,7 +389,7 @@ static void sata_dwc_tf_dump(struct ata_taskfile *tf)
 /*
 /*
  * Function: get_burst_length_encode
  * Function: get_burst_length_encode
  * arguments: datalength: length in bytes of data
  * arguments: datalength: length in bytes of data
- * returns value to be programmed in register corrresponding to data length
+ * returns value to be programmed in register corresponding to data length
  * This value is effectively the log(base 2) of the length
  * This value is effectively the log(base 2) of the length
  */
  */
 static  int get_burst_length_encode(int datalength)
 static  int get_burst_length_encode(int datalength)

+ 1 - 1
drivers/base/platform.c

@@ -367,7 +367,7 @@ EXPORT_SYMBOL_GPL(platform_device_unregister);
  *
  *
  * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
  * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
  */
  */
-struct platform_device *__init_or_module platform_device_register_resndata(
+struct platform_device *platform_device_register_resndata(
 		struct device *parent,
 		struct device *parent,
 		const char *name, int id,
 		const char *name, int id,
 		const struct resource *res, unsigned int num,
 		const struct resource *res, unsigned int num,

+ 2 - 2
drivers/base/power/clock_ops.c

@@ -387,7 +387,7 @@ static int pm_runtime_clk_notify(struct notifier_block *nb,
 	clknb = container_of(nb, struct pm_clk_notifier_block, nb);
 	clknb = container_of(nb, struct pm_clk_notifier_block, nb);
 
 
 	switch (action) {
 	switch (action) {
-	case BUS_NOTIFY_ADD_DEVICE:
+	case BUS_NOTIFY_BIND_DRIVER:
 		if (clknb->con_ids[0]) {
 		if (clknb->con_ids[0]) {
 			for (con_id = clknb->con_ids; *con_id; con_id++)
 			for (con_id = clknb->con_ids; *con_id; con_id++)
 				enable_clock(dev, *con_id);
 				enable_clock(dev, *con_id);
@@ -395,7 +395,7 @@ static int pm_runtime_clk_notify(struct notifier_block *nb,
 			enable_clock(dev, NULL);
 			enable_clock(dev, NULL);
 		}
 		}
 		break;
 		break;
-	case BUS_NOTIFY_DEL_DEVICE:
+	case BUS_NOTIFY_UNBOUND_DRIVER:
 		if (clknb->con_ids[0]) {
 		if (clknb->con_ids[0]) {
 			for (con_id = clknb->con_ids; *con_id; con_id++)
 			for (con_id = clknb->con_ids; *con_id; con_id++)
 				disable_clock(dev, *con_id);
 				disable_clock(dev, *con_id);

+ 21 - 7
drivers/base/power/main.c

@@ -57,7 +57,8 @@ static int async_error;
  */
  */
 void device_pm_init(struct device *dev)
 void device_pm_init(struct device *dev)
 {
 {
-	dev->power.in_suspend = false;
+	dev->power.is_prepared = false;
+	dev->power.is_suspended = false;
 	init_completion(&dev->power.completion);
 	init_completion(&dev->power.completion);
 	complete_all(&dev->power.completion);
 	complete_all(&dev->power.completion);
 	dev->power.wakeup = NULL;
 	dev->power.wakeup = NULL;
@@ -91,7 +92,7 @@ void device_pm_add(struct device *dev)
 	pr_debug("PM: Adding info for %s:%s\n",
 	pr_debug("PM: Adding info for %s:%s\n",
 		 dev->bus ? dev->bus->name : "No Bus", dev_name(dev));
 		 dev->bus ? dev->bus->name : "No Bus", dev_name(dev));
 	mutex_lock(&dpm_list_mtx);
 	mutex_lock(&dpm_list_mtx);
-	if (dev->parent && dev->parent->power.in_suspend)
+	if (dev->parent && dev->parent->power.is_prepared)
 		dev_warn(dev, "parent %s should not be sleeping\n",
 		dev_warn(dev, "parent %s should not be sleeping\n",
 			dev_name(dev->parent));
 			dev_name(dev->parent));
 	list_add_tail(&dev->power.entry, &dpm_list);
 	list_add_tail(&dev->power.entry, &dpm_list);
@@ -511,7 +512,14 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
 	dpm_wait(dev->parent, async);
 	dpm_wait(dev->parent, async);
 	device_lock(dev);
 	device_lock(dev);
 
 
-	dev->power.in_suspend = false;
+	/*
+	 * This is a fib.  But we'll allow new children to be added below
+	 * a resumed device, even if the device hasn't been completed yet.
+	 */
+	dev->power.is_prepared = false;
+
+	if (!dev->power.is_suspended)
+		goto Unlock;
 
 
 	if (dev->pwr_domain) {
 	if (dev->pwr_domain) {
 		pm_dev_dbg(dev, state, "power domain ");
 		pm_dev_dbg(dev, state, "power domain ");
@@ -548,6 +556,9 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
 	}
 	}
 
 
  End:
  End:
+	dev->power.is_suspended = false;
+
+ Unlock:
 	device_unlock(dev);
 	device_unlock(dev);
 	complete_all(&dev->power.completion);
 	complete_all(&dev->power.completion);
 
 
@@ -670,7 +681,7 @@ void dpm_complete(pm_message_t state)
 		struct device *dev = to_device(dpm_prepared_list.prev);
 		struct device *dev = to_device(dpm_prepared_list.prev);
 
 
 		get_device(dev);
 		get_device(dev);
-		dev->power.in_suspend = false;
+		dev->power.is_prepared = false;
 		list_move(&dev->power.entry, &list);
 		list_move(&dev->power.entry, &list);
 		mutex_unlock(&dpm_list_mtx);
 		mutex_unlock(&dpm_list_mtx);
 
 
@@ -835,11 +846,11 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
 	device_lock(dev);
 	device_lock(dev);
 
 
 	if (async_error)
 	if (async_error)
-		goto End;
+		goto Unlock;
 
 
 	if (pm_wakeup_pending()) {
 	if (pm_wakeup_pending()) {
 		async_error = -EBUSY;
 		async_error = -EBUSY;
-		goto End;
+		goto Unlock;
 	}
 	}
 
 
 	if (dev->pwr_domain) {
 	if (dev->pwr_domain) {
@@ -877,6 +888,9 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
 	}
 	}
 
 
  End:
  End:
+	dev->power.is_suspended = !error;
+
+ Unlock:
 	device_unlock(dev);
 	device_unlock(dev);
 	complete_all(&dev->power.completion);
 	complete_all(&dev->power.completion);
 
 
@@ -1042,7 +1056,7 @@ int dpm_prepare(pm_message_t state)
 			put_device(dev);
 			put_device(dev);
 			break;
 			break;
 		}
 		}
-		dev->power.in_suspend = true;
+		dev->power.is_prepared = true;
 		if (!list_empty(&dev->power.entry))
 		if (!list_empty(&dev->power.entry))
 			list_move_tail(&dev->power.entry, &dpm_prepared_list);
 			list_move_tail(&dev->power.entry, &dpm_prepared_list);
 		put_device(dev);
 		put_device(dev);

+ 1 - 0
drivers/connector/connector.c

@@ -139,6 +139,7 @@ static int cn_call_callback(struct sk_buff *skb)
 	spin_unlock_bh(&dev->cbdev->queue_lock);
 	spin_unlock_bh(&dev->cbdev->queue_lock);
 
 
 	if (cbq != NULL) {
 	if (cbq != NULL) {
+		err = 0;
 		cbq->callback(msg, nsp);
 		cbq->callback(msg, nsp);
 		kfree_skb(skb);
 		kfree_skb(skb);
 		cn_queue_release_callback(cbq);
 		cn_queue_release_callback(cbq);

+ 3 - 3
drivers/crypto/caam/caamalg.c

@@ -238,9 +238,9 @@ static int build_sh_desc_ipsec(struct caam_ctx *ctx)
 
 
 	/* build shared descriptor for this session */
 	/* build shared descriptor for this session */
 	sh_desc = kmalloc(CAAM_CMD_SZ * DESC_AEAD_SHARED_TEXT_LEN +
 	sh_desc = kmalloc(CAAM_CMD_SZ * DESC_AEAD_SHARED_TEXT_LEN +
-			  keys_fit_inline ?
-			  ctx->split_key_pad_len + ctx->enckeylen :
-			  CAAM_PTR_SZ * 2, GFP_DMA | GFP_KERNEL);
+			  (keys_fit_inline ?
+			   ctx->split_key_pad_len + ctx->enckeylen :
+			   CAAM_PTR_SZ * 2), GFP_DMA | GFP_KERNEL);
 	if (!sh_desc) {
 	if (!sh_desc) {
 		dev_err(jrdev, "could not allocate shared descriptor\n");
 		dev_err(jrdev, "could not allocate shared descriptor\n");
 		return -ENOMEM;
 		return -ENOMEM;

+ 1 - 0
drivers/firmware/google/Kconfig

@@ -13,6 +13,7 @@ menu "Google Firmware Drivers"
 config GOOGLE_SMI
 config GOOGLE_SMI
 	tristate "SMI interface for Google platforms"
 	tristate "SMI interface for Google platforms"
 	depends on ACPI && DMI
 	depends on ACPI && DMI
+	select EFI
 	select EFI_VARS
 	select EFI_VARS
 	help
 	help
 	  Say Y here if you want to enable SMI callbacks for Google
 	  Say Y here if you want to enable SMI callbacks for Google

+ 1 - 0
drivers/gpu/drm/drm_gem.c

@@ -34,6 +34,7 @@
 #include <linux/module.h>
 #include <linux/module.h>
 #include <linux/mman.h>
 #include <linux/mman.h>
 #include <linux/pagemap.h>
 #include <linux/pagemap.h>
+#include <linux/shmem_fs.h>
 #include "drmP.h"
 #include "drmP.h"
 
 
 /** @file drm_gem.c
 /** @file drm_gem.c

+ 1 - 2
drivers/gpu/drm/i915/i915_dma.c

@@ -2182,9 +2182,8 @@ int i915_driver_unload(struct drm_device *dev)
 		/* Flush any outstanding unpin_work. */
 		/* Flush any outstanding unpin_work. */
 		flush_workqueue(dev_priv->wq);
 		flush_workqueue(dev_priv->wq);
 
 
-		i915_gem_free_all_phys_object(dev);
-
 		mutex_lock(&dev->struct_mutex);
 		mutex_lock(&dev->struct_mutex);
+		i915_gem_free_all_phys_object(dev);
 		i915_gem_cleanup_ringbuffer(dev);
 		i915_gem_cleanup_ringbuffer(dev);
 		mutex_unlock(&dev->struct_mutex);
 		mutex_unlock(&dev->struct_mutex);
 		if (I915_HAS_FBC(dev) && i915_powersave)
 		if (I915_HAS_FBC(dev) && i915_powersave)

+ 3 - 0
drivers/gpu/drm/i915/i915_drv.c

@@ -579,6 +579,9 @@ int i915_reset(struct drm_device *dev, u8 flags)
 	} else switch (INTEL_INFO(dev)->gen) {
 	} else switch (INTEL_INFO(dev)->gen) {
 	case 6:
 	case 6:
 		ret = gen6_do_reset(dev, flags);
 		ret = gen6_do_reset(dev, flags);
+		/* If reset with a user forcewake, try to restore */
+		if (atomic_read(&dev_priv->forcewake_count))
+			__gen6_gt_force_wake_get(dev_priv);
 		break;
 		break;
 	case 5:
 	case 5:
 		ret = ironlake_do_reset(dev, flags);
 		ret = ironlake_do_reset(dev, flags);

+ 3 - 0
drivers/gpu/drm/i915/i915_drv.h

@@ -211,6 +211,9 @@ struct drm_i915_display_funcs {
 	void (*fdi_link_train)(struct drm_crtc *crtc);
 	void (*fdi_link_train)(struct drm_crtc *crtc);
 	void (*init_clock_gating)(struct drm_device *dev);
 	void (*init_clock_gating)(struct drm_device *dev);
 	void (*init_pch_clock_gating)(struct drm_device *dev);
 	void (*init_pch_clock_gating)(struct drm_device *dev);
+	int (*queue_flip)(struct drm_device *dev, struct drm_crtc *crtc,
+			  struct drm_framebuffer *fb,
+			  struct drm_i915_gem_object *obj);
 	/* clock updates for mode set */
 	/* clock updates for mode set */
 	/* cursor updates */
 	/* cursor updates */
 	/* render clock increase/decrease */
 	/* render clock increase/decrease */

+ 22 - 30
drivers/gpu/drm/i915/i915_gem.c

@@ -31,6 +31,7 @@
 #include "i915_drv.h"
 #include "i915_drv.h"
 #include "i915_trace.h"
 #include "i915_trace.h"
 #include "intel_drv.h"
 #include "intel_drv.h"
+#include <linux/shmem_fs.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/swap.h>
 #include <linux/swap.h>
 #include <linux/pci.h>
 #include <linux/pci.h>
@@ -359,8 +360,7 @@ i915_gem_shmem_pread_fast(struct drm_device *dev,
 		if ((page_offset + remain) > PAGE_SIZE)
 		if ((page_offset + remain) > PAGE_SIZE)
 			page_length = PAGE_SIZE - page_offset;
 			page_length = PAGE_SIZE - page_offset;
 
 
-		page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
-					   GFP_HIGHUSER | __GFP_RECLAIMABLE);
+		page = shmem_read_mapping_page(mapping, offset >> PAGE_SHIFT);
 		if (IS_ERR(page))
 		if (IS_ERR(page))
 			return PTR_ERR(page);
 			return PTR_ERR(page);
 
 
@@ -463,8 +463,7 @@ i915_gem_shmem_pread_slow(struct drm_device *dev,
 		if ((data_page_offset + page_length) > PAGE_SIZE)
 		if ((data_page_offset + page_length) > PAGE_SIZE)
 			page_length = PAGE_SIZE - data_page_offset;
 			page_length = PAGE_SIZE - data_page_offset;
 
 
-		page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
-					   GFP_HIGHUSER | __GFP_RECLAIMABLE);
+		page = shmem_read_mapping_page(mapping, offset >> PAGE_SHIFT);
 		if (IS_ERR(page)) {
 		if (IS_ERR(page)) {
 			ret = PTR_ERR(page);
 			ret = PTR_ERR(page);
 			goto out;
 			goto out;
@@ -797,8 +796,7 @@ i915_gem_shmem_pwrite_fast(struct drm_device *dev,
 		if ((page_offset + remain) > PAGE_SIZE)
 		if ((page_offset + remain) > PAGE_SIZE)
 			page_length = PAGE_SIZE - page_offset;
 			page_length = PAGE_SIZE - page_offset;
 
 
-		page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
-					   GFP_HIGHUSER | __GFP_RECLAIMABLE);
+		page = shmem_read_mapping_page(mapping, offset >> PAGE_SHIFT);
 		if (IS_ERR(page))
 		if (IS_ERR(page))
 			return PTR_ERR(page);
 			return PTR_ERR(page);
 
 
@@ -907,8 +905,7 @@ i915_gem_shmem_pwrite_slow(struct drm_device *dev,
 		if ((data_page_offset + page_length) > PAGE_SIZE)
 		if ((data_page_offset + page_length) > PAGE_SIZE)
 			page_length = PAGE_SIZE - data_page_offset;
 			page_length = PAGE_SIZE - data_page_offset;
 
 
-		page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
-					   GFP_HIGHUSER | __GFP_RECLAIMABLE);
+		page = shmem_read_mapping_page(mapping, offset >> PAGE_SHIFT);
 		if (IS_ERR(page)) {
 		if (IS_ERR(page)) {
 			ret = PTR_ERR(page);
 			ret = PTR_ERR(page);
 			goto out;
 			goto out;
@@ -1219,11 +1216,11 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 		ret = i915_gem_object_bind_to_gtt(obj, 0, true);
 		ret = i915_gem_object_bind_to_gtt(obj, 0, true);
 		if (ret)
 		if (ret)
 			goto unlock;
 			goto unlock;
-	}
 
 
-	ret = i915_gem_object_set_to_gtt_domain(obj, write);
-	if (ret)
-		goto unlock;
+		ret = i915_gem_object_set_to_gtt_domain(obj, write);
+		if (ret)
+			goto unlock;
+	}
 
 
 	if (obj->tiling_mode == I915_TILING_NONE)
 	if (obj->tiling_mode == I915_TILING_NONE)
 		ret = i915_gem_object_put_fence(obj);
 		ret = i915_gem_object_put_fence(obj);
@@ -1558,12 +1555,10 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj,
 
 
 	inode = obj->base.filp->f_path.dentry->d_inode;
 	inode = obj->base.filp->f_path.dentry->d_inode;
 	mapping = inode->i_mapping;
 	mapping = inode->i_mapping;
+	gfpmask |= mapping_gfp_mask(mapping);
+
 	for (i = 0; i < page_count; i++) {
 	for (i = 0; i < page_count; i++) {
-		page = read_cache_page_gfp(mapping, i,
-					   GFP_HIGHUSER |
-					   __GFP_COLD |
-					   __GFP_RECLAIMABLE |
-					   gfpmask);
+		page = shmem_read_mapping_page_gfp(mapping, i, gfpmask);
 		if (IS_ERR(page))
 		if (IS_ERR(page))
 			goto err_pages;
 			goto err_pages;
 
 
@@ -1701,13 +1696,10 @@ i915_gem_object_truncate(struct drm_i915_gem_object *obj)
 	/* Our goal here is to return as much of the memory as
 	/* Our goal here is to return as much of the memory as
 	 * is possible back to the system as we are called from OOM.
 	 * is possible back to the system as we are called from OOM.
 	 * To do this we must instruct the shmfs to drop all of its
 	 * To do this we must instruct the shmfs to drop all of its
-	 * backing pages, *now*. Here we mirror the actions taken
-	 * when by shmem_delete_inode() to release the backing store.
+	 * backing pages, *now*.
 	 */
 	 */
 	inode = obj->base.filp->f_path.dentry->d_inode;
 	inode = obj->base.filp->f_path.dentry->d_inode;
-	truncate_inode_pages(inode->i_mapping, 0);
-	if (inode->i_op->truncate_range)
-		inode->i_op->truncate_range(inode, 0, (loff_t)-1);
+	shmem_truncate_range(inode, 0, (loff_t)-1);
 
 
 	obj->madv = __I915_MADV_PURGED;
 	obj->madv = __I915_MADV_PURGED;
 }
 }
@@ -2080,8 +2072,8 @@ i915_wait_request(struct intel_ring_buffer *ring,
 		if (!ier) {
 		if (!ier) {
 			DRM_ERROR("something (likely vbetool) disabled "
 			DRM_ERROR("something (likely vbetool) disabled "
 				  "interrupts, re-enabling\n");
 				  "interrupts, re-enabling\n");
-			i915_driver_irq_preinstall(ring->dev);
-			i915_driver_irq_postinstall(ring->dev);
+			ring->dev->driver->irq_preinstall(ring->dev);
+			ring->dev->driver->irq_postinstall(ring->dev);
 		}
 		}
 
 
 		trace_i915_gem_request_wait_begin(ring, seqno);
 		trace_i915_gem_request_wait_begin(ring, seqno);
@@ -2926,8 +2918,6 @@ i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj)
 	 */
 	 */
 	wmb();
 	wmb();
 
 
-	i915_gem_release_mmap(obj);
-
 	old_write_domain = obj->base.write_domain;
 	old_write_domain = obj->base.write_domain;
 	obj->base.write_domain = 0;
 	obj->base.write_domain = 0;
 
 
@@ -3567,6 +3557,7 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
 {
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct drm_i915_gem_object *obj;
 	struct drm_i915_gem_object *obj;
+	struct address_space *mapping;
 
 
 	obj = kzalloc(sizeof(*obj), GFP_KERNEL);
 	obj = kzalloc(sizeof(*obj), GFP_KERNEL);
 	if (obj == NULL)
 	if (obj == NULL)
@@ -3577,6 +3568,9 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
 		return NULL;
 		return NULL;
 	}
 	}
 
 
+	mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping;
+	mapping_set_gfp_mask(mapping, GFP_HIGHUSER | __GFP_RECLAIMABLE);
+
 	i915_gem_info_add_obj(dev_priv, size);
 	i915_gem_info_add_obj(dev_priv, size);
 
 
 	obj->base.write_domain = I915_GEM_DOMAIN_CPU;
 	obj->base.write_domain = I915_GEM_DOMAIN_CPU;
@@ -3952,8 +3946,7 @@ void i915_gem_detach_phys_object(struct drm_device *dev,
 
 
 	page_count = obj->base.size / PAGE_SIZE;
 	page_count = obj->base.size / PAGE_SIZE;
 	for (i = 0; i < page_count; i++) {
 	for (i = 0; i < page_count; i++) {
-		struct page *page = read_cache_page_gfp(mapping, i,
-							GFP_HIGHUSER | __GFP_RECLAIMABLE);
+		struct page *page = shmem_read_mapping_page(mapping, i);
 		if (!IS_ERR(page)) {
 		if (!IS_ERR(page)) {
 			char *dst = kmap_atomic(page);
 			char *dst = kmap_atomic(page);
 			memcpy(dst, vaddr + i*PAGE_SIZE, PAGE_SIZE);
 			memcpy(dst, vaddr + i*PAGE_SIZE, PAGE_SIZE);
@@ -4014,8 +4007,7 @@ i915_gem_attach_phys_object(struct drm_device *dev,
 		struct page *page;
 		struct page *page;
 		char *dst, *src;
 		char *dst, *src;
 
 
-		page = read_cache_page_gfp(mapping, i,
-					   GFP_HIGHUSER | __GFP_RECLAIMABLE);
+		page = shmem_read_mapping_page(mapping, i);
 		if (IS_ERR(page))
 		if (IS_ERR(page))
 			return PTR_ERR(page);
 			return PTR_ERR(page);
 
 

+ 0 - 4
drivers/gpu/drm/i915/i915_gem_execbuffer.c

@@ -187,10 +187,6 @@ i915_gem_object_set_to_gpu_domain(struct drm_i915_gem_object *obj,
 	if ((flush_domains | invalidate_domains) & I915_GEM_DOMAIN_CPU)
 	if ((flush_domains | invalidate_domains) & I915_GEM_DOMAIN_CPU)
 		i915_gem_clflush_object(obj);
 		i915_gem_clflush_object(obj);
 
 
-	/* blow away mappings if mapped through GTT */
-	if ((flush_domains | invalidate_domains) & I915_GEM_DOMAIN_GTT)
-		i915_gem_release_mmap(obj);
-
 	if (obj->base.pending_write_domain)
 	if (obj->base.pending_write_domain)
 		cd->flips |= atomic_read(&obj->pending_flip);
 		cd->flips |= atomic_read(&obj->pending_flip);
 
 

+ 1 - 0
drivers/gpu/drm/i915/i915_irq.c

@@ -1749,6 +1749,7 @@ void ironlake_irq_preinstall(struct drm_device *dev)
 		 * happens.
 		 * happens.
 		 */
 		 */
 		I915_WRITE(GEN6_BLITTER_HWSTAM, ~GEN6_BLITTER_USER_INTERRUPT);
 		I915_WRITE(GEN6_BLITTER_HWSTAM, ~GEN6_BLITTER_USER_INTERRUPT);
+		I915_WRITE(GEN6_BSD_HWSTAM, ~GEN6_BSD_USER_INTERRUPT);
 	}
 	}
 
 
 	/* XXX hotplug from PCH */
 	/* XXX hotplug from PCH */

+ 1 - 0
drivers/gpu/drm/i915/i915_reg.h

@@ -531,6 +531,7 @@
 #define   GEN6_BSD_SLEEP_PSMI_CONTROL_RC_ILDL_MESSAGE_ENABLE		0
 #define   GEN6_BSD_SLEEP_PSMI_CONTROL_RC_ILDL_MESSAGE_ENABLE		0
 #define   GEN6_BSD_SLEEP_PSMI_CONTROL_IDLE_INDICATOR			(1 << 3)
 #define   GEN6_BSD_SLEEP_PSMI_CONTROL_IDLE_INDICATOR			(1 << 3)
 
 
+#define GEN6_BSD_HWSTAM			0x12098
 #define GEN6_BSD_IMR			0x120a8
 #define GEN6_BSD_IMR			0x120a8
 #define   GEN6_BSD_USER_INTERRUPT	(1 << 12)
 #define   GEN6_BSD_USER_INTERRUPT	(1 << 12)
 
 

+ 5 - 0
drivers/gpu/drm/i915/i915_suspend.c

@@ -678,6 +678,7 @@ void i915_save_display(struct drm_device *dev)
 	}
 	}
 
 
 	/* VGA state */
 	/* VGA state */
+	mutex_lock(&dev->struct_mutex);
 	dev_priv->saveVGA0 = I915_READ(VGA0);
 	dev_priv->saveVGA0 = I915_READ(VGA0);
 	dev_priv->saveVGA1 = I915_READ(VGA1);
 	dev_priv->saveVGA1 = I915_READ(VGA1);
 	dev_priv->saveVGA_PD = I915_READ(VGA_PD);
 	dev_priv->saveVGA_PD = I915_READ(VGA_PD);
@@ -687,6 +688,7 @@ void i915_save_display(struct drm_device *dev)
 		dev_priv->saveVGACNTRL = I915_READ(VGACNTRL);
 		dev_priv->saveVGACNTRL = I915_READ(VGACNTRL);
 
 
 	i915_save_vga(dev);
 	i915_save_vga(dev);
+	mutex_unlock(&dev->struct_mutex);
 }
 }
 
 
 void i915_restore_display(struct drm_device *dev)
 void i915_restore_display(struct drm_device *dev)
@@ -780,6 +782,8 @@ void i915_restore_display(struct drm_device *dev)
 		I915_WRITE(CPU_VGACNTRL, dev_priv->saveVGACNTRL);
 		I915_WRITE(CPU_VGACNTRL, dev_priv->saveVGACNTRL);
 	else
 	else
 		I915_WRITE(VGACNTRL, dev_priv->saveVGACNTRL);
 		I915_WRITE(VGACNTRL, dev_priv->saveVGACNTRL);
+
+	mutex_lock(&dev->struct_mutex);
 	I915_WRITE(VGA0, dev_priv->saveVGA0);
 	I915_WRITE(VGA0, dev_priv->saveVGA0);
 	I915_WRITE(VGA1, dev_priv->saveVGA1);
 	I915_WRITE(VGA1, dev_priv->saveVGA1);
 	I915_WRITE(VGA_PD, dev_priv->saveVGA_PD);
 	I915_WRITE(VGA_PD, dev_priv->saveVGA_PD);
@@ -787,6 +791,7 @@ void i915_restore_display(struct drm_device *dev)
 	udelay(150);
 	udelay(150);
 
 
 	i915_restore_vga(dev);
 	i915_restore_vga(dev);
+	mutex_unlock(&dev->struct_mutex);
 }
 }
 
 
 int i915_save_state(struct drm_device *dev)
 int i915_save_state(struct drm_device *dev)

+ 223 - 85
drivers/gpu/drm/i915/intel_display.c

@@ -4687,6 +4687,7 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
 
 
 	I915_WRITE(DSPCNTR(plane), dspcntr);
 	I915_WRITE(DSPCNTR(plane), dspcntr);
 	POSTING_READ(DSPCNTR(plane));
 	POSTING_READ(DSPCNTR(plane));
+	intel_enable_plane(dev_priv, plane, pipe);
 
 
 	ret = intel_pipe_set_base(crtc, x, y, old_fb);
 	ret = intel_pipe_set_base(crtc, x, y, old_fb);
 
 
@@ -5217,8 +5218,6 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
 
 
 	I915_WRITE(DSPCNTR(plane), dspcntr);
 	I915_WRITE(DSPCNTR(plane), dspcntr);
 	POSTING_READ(DSPCNTR(plane));
 	POSTING_READ(DSPCNTR(plane));
-	if (!HAS_PCH_SPLIT(dev))
-		intel_enable_plane(dev_priv, plane, pipe);
 
 
 	ret = intel_pipe_set_base(crtc, x, y, old_fb);
 	ret = intel_pipe_set_base(crtc, x, y, old_fb);
 
 
@@ -6262,6 +6261,197 @@ void intel_prepare_page_flip(struct drm_device *dev, int plane)
 	spin_unlock_irqrestore(&dev->event_lock, flags);
 	spin_unlock_irqrestore(&dev->event_lock, flags);
 }
 }
 
 
+static int intel_gen2_queue_flip(struct drm_device *dev,
+				 struct drm_crtc *crtc,
+				 struct drm_framebuffer *fb,
+				 struct drm_i915_gem_object *obj)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+	unsigned long offset;
+	u32 flip_mask;
+	int ret;
+
+	ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
+	if (ret)
+		goto out;
+
+	/* Offset into the new buffer for cases of shared fbs between CRTCs */
+	offset = crtc->y * fb->pitch + crtc->x * fb->bits_per_pixel/8;
+
+	ret = BEGIN_LP_RING(6);
+	if (ret)
+		goto out;
+
+	/* Can't queue multiple flips, so wait for the previous
+	 * one to finish before executing the next.
+	 */
+	if (intel_crtc->plane)
+		flip_mask = MI_WAIT_FOR_PLANE_B_FLIP;
+	else
+		flip_mask = MI_WAIT_FOR_PLANE_A_FLIP;
+	OUT_RING(MI_WAIT_FOR_EVENT | flip_mask);
+	OUT_RING(MI_NOOP);
+	OUT_RING(MI_DISPLAY_FLIP |
+		 MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
+	OUT_RING(fb->pitch);
+	OUT_RING(obj->gtt_offset + offset);
+	OUT_RING(MI_NOOP);
+	ADVANCE_LP_RING();
+out:
+	return ret;
+}
+
+static int intel_gen3_queue_flip(struct drm_device *dev,
+				 struct drm_crtc *crtc,
+				 struct drm_framebuffer *fb,
+				 struct drm_i915_gem_object *obj)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+	unsigned long offset;
+	u32 flip_mask;
+	int ret;
+
+	ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
+	if (ret)
+		goto out;
+
+	/* Offset into the new buffer for cases of shared fbs between CRTCs */
+	offset = crtc->y * fb->pitch + crtc->x * fb->bits_per_pixel/8;
+
+	ret = BEGIN_LP_RING(6);
+	if (ret)
+		goto out;
+
+	if (intel_crtc->plane)
+		flip_mask = MI_WAIT_FOR_PLANE_B_FLIP;
+	else
+		flip_mask = MI_WAIT_FOR_PLANE_A_FLIP;
+	OUT_RING(MI_WAIT_FOR_EVENT | flip_mask);
+	OUT_RING(MI_NOOP);
+	OUT_RING(MI_DISPLAY_FLIP_I915 |
+		 MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
+	OUT_RING(fb->pitch);
+	OUT_RING(obj->gtt_offset + offset);
+	OUT_RING(MI_NOOP);
+
+	ADVANCE_LP_RING();
+out:
+	return ret;
+}
+
+static int intel_gen4_queue_flip(struct drm_device *dev,
+				 struct drm_crtc *crtc,
+				 struct drm_framebuffer *fb,
+				 struct drm_i915_gem_object *obj)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+	uint32_t pf, pipesrc;
+	int ret;
+
+	ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
+	if (ret)
+		goto out;
+
+	ret = BEGIN_LP_RING(4);
+	if (ret)
+		goto out;
+
+	/* i965+ uses the linear or tiled offsets from the
+	 * Display Registers (which do not change across a page-flip)
+	 * so we need only reprogram the base address.
+	 */
+	OUT_RING(MI_DISPLAY_FLIP |
+		 MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
+	OUT_RING(fb->pitch);
+	OUT_RING(obj->gtt_offset | obj->tiling_mode);
+
+	/* XXX Enabling the panel-fitter across page-flip is so far
+	 * untested on non-native modes, so ignore it for now.
+	 * pf = I915_READ(pipe == 0 ? PFA_CTL_1 : PFB_CTL_1) & PF_ENABLE;
+	 */
+	pf = 0;
+	pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff;
+	OUT_RING(pf | pipesrc);
+	ADVANCE_LP_RING();
+out:
+	return ret;
+}
+
+static int intel_gen6_queue_flip(struct drm_device *dev,
+				 struct drm_crtc *crtc,
+				 struct drm_framebuffer *fb,
+				 struct drm_i915_gem_object *obj)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+	uint32_t pf, pipesrc;
+	int ret;
+
+	ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
+	if (ret)
+		goto out;
+
+	ret = BEGIN_LP_RING(4);
+	if (ret)
+		goto out;
+
+	OUT_RING(MI_DISPLAY_FLIP |
+		 MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
+	OUT_RING(fb->pitch | obj->tiling_mode);
+	OUT_RING(obj->gtt_offset);
+
+	pf = I915_READ(PF_CTL(intel_crtc->pipe)) & PF_ENABLE;
+	pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff;
+	OUT_RING(pf | pipesrc);
+	ADVANCE_LP_RING();
+out:
+	return ret;
+}
+
+/*
+ * On gen7 we currently use the blit ring because (in early silicon at least)
+ * the render ring doesn't give us interrpts for page flip completion, which
+ * means clients will hang after the first flip is queued.  Fortunately the
+ * blit ring generates interrupts properly, so use it instead.
+ */
+static int intel_gen7_queue_flip(struct drm_device *dev,
+				 struct drm_crtc *crtc,
+				 struct drm_framebuffer *fb,
+				 struct drm_i915_gem_object *obj)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+	struct intel_ring_buffer *ring = &dev_priv->ring[BCS];
+	int ret;
+
+	ret = intel_pin_and_fence_fb_obj(dev, obj, ring);
+	if (ret)
+		goto out;
+
+	ret = intel_ring_begin(ring, 4);
+	if (ret)
+		goto out;
+
+	intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | (intel_crtc->plane << 19));
+	intel_ring_emit(ring, (fb->pitch | obj->tiling_mode));
+	intel_ring_emit(ring, (obj->gtt_offset));
+	intel_ring_emit(ring, (MI_NOOP));
+	intel_ring_advance(ring);
+out:
+	return ret;
+}
+
+static int intel_default_queue_flip(struct drm_device *dev,
+				    struct drm_crtc *crtc,
+				    struct drm_framebuffer *fb,
+				    struct drm_i915_gem_object *obj)
+{
+	return -ENODEV;
+}
+
 static int intel_crtc_page_flip(struct drm_crtc *crtc,
 static int intel_crtc_page_flip(struct drm_crtc *crtc,
 				struct drm_framebuffer *fb,
 				struct drm_framebuffer *fb,
 				struct drm_pending_vblank_event *event)
 				struct drm_pending_vblank_event *event)
@@ -6272,9 +6462,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 	struct drm_i915_gem_object *obj;
 	struct drm_i915_gem_object *obj;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	struct intel_unpin_work *work;
 	struct intel_unpin_work *work;
-	unsigned long flags, offset;
-	int pipe = intel_crtc->pipe;
-	u32 pf, pipesrc;
+	unsigned long flags;
 	int ret;
 	int ret;
 
 
 	work = kzalloc(sizeof *work, GFP_KERNEL);
 	work = kzalloc(sizeof *work, GFP_KERNEL);
@@ -6303,9 +6491,6 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 	obj = intel_fb->obj;
 	obj = intel_fb->obj;
 
 
 	mutex_lock(&dev->struct_mutex);
 	mutex_lock(&dev->struct_mutex);
-	ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
-	if (ret)
-		goto cleanup_work;
 
 
 	/* Reference the objects for the scheduled work. */
 	/* Reference the objects for the scheduled work. */
 	drm_gem_object_reference(&work->old_fb_obj->base);
 	drm_gem_object_reference(&work->old_fb_obj->base);
@@ -6317,91 +6502,18 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 	if (ret)
 	if (ret)
 		goto cleanup_objs;
 		goto cleanup_objs;
 
 
-	if (IS_GEN3(dev) || IS_GEN2(dev)) {
-		u32 flip_mask;
-
-		/* Can't queue multiple flips, so wait for the previous
-		 * one to finish before executing the next.
-		 */
-		ret = BEGIN_LP_RING(2);
-		if (ret)
-			goto cleanup_objs;
-
-		if (intel_crtc->plane)
-			flip_mask = MI_WAIT_FOR_PLANE_B_FLIP;
-		else
-			flip_mask = MI_WAIT_FOR_PLANE_A_FLIP;
-		OUT_RING(MI_WAIT_FOR_EVENT | flip_mask);
-		OUT_RING(MI_NOOP);
-		ADVANCE_LP_RING();
-	}
-
 	work->pending_flip_obj = obj;
 	work->pending_flip_obj = obj;
 
 
 	work->enable_stall_check = true;
 	work->enable_stall_check = true;
 
 
-	/* Offset into the new buffer for cases of shared fbs between CRTCs */
-	offset = crtc->y * fb->pitch + crtc->x * fb->bits_per_pixel/8;
-
-	ret = BEGIN_LP_RING(4);
-	if (ret)
-		goto cleanup_objs;
-
 	/* Block clients from rendering to the new back buffer until
 	/* Block clients from rendering to the new back buffer until
 	 * the flip occurs and the object is no longer visible.
 	 * the flip occurs and the object is no longer visible.
 	 */
 	 */
 	atomic_add(1 << intel_crtc->plane, &work->old_fb_obj->pending_flip);
 	atomic_add(1 << intel_crtc->plane, &work->old_fb_obj->pending_flip);
 
 
-	switch (INTEL_INFO(dev)->gen) {
-	case 2:
-		OUT_RING(MI_DISPLAY_FLIP |
-			 MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
-		OUT_RING(fb->pitch);
-		OUT_RING(obj->gtt_offset + offset);
-		OUT_RING(MI_NOOP);
-		break;
-
-	case 3:
-		OUT_RING(MI_DISPLAY_FLIP_I915 |
-			 MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
-		OUT_RING(fb->pitch);
-		OUT_RING(obj->gtt_offset + offset);
-		OUT_RING(MI_NOOP);
-		break;
-
-	case 4:
-	case 5:
-		/* i965+ uses the linear or tiled offsets from the
-		 * Display Registers (which do not change across a page-flip)
-		 * so we need only reprogram the base address.
-		 */
-		OUT_RING(MI_DISPLAY_FLIP |
-			 MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
-		OUT_RING(fb->pitch);
-		OUT_RING(obj->gtt_offset | obj->tiling_mode);
-
-		/* XXX Enabling the panel-fitter across page-flip is so far
-		 * untested on non-native modes, so ignore it for now.
-		 * pf = I915_READ(pipe == 0 ? PFA_CTL_1 : PFB_CTL_1) & PF_ENABLE;
-		 */
-		pf = 0;
-		pipesrc = I915_READ(PIPESRC(pipe)) & 0x0fff0fff;
-		OUT_RING(pf | pipesrc);
-		break;
-
-	case 6:
-	case 7:
-		OUT_RING(MI_DISPLAY_FLIP |
-			 MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
-		OUT_RING(fb->pitch | obj->tiling_mode);
-		OUT_RING(obj->gtt_offset);
-
-		pf = I915_READ(PF_CTL(pipe)) & PF_ENABLE;
-		pipesrc = I915_READ(PIPESRC(pipe)) & 0x0fff0fff;
-		OUT_RING(pf | pipesrc);
-		break;
-	}
-	ADVANCE_LP_RING();
+	ret = dev_priv->display.queue_flip(dev, crtc, fb, obj);
+	if (ret)
+		goto cleanup_pending;
 
 
 	mutex_unlock(&dev->struct_mutex);
 	mutex_unlock(&dev->struct_mutex);
 
 
@@ -6409,10 +6521,11 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 
 
 	return 0;
 	return 0;
 
 
+cleanup_pending:
+	atomic_sub(1 << intel_crtc->plane, &work->old_fb_obj->pending_flip);
 cleanup_objs:
 cleanup_objs:
 	drm_gem_object_unreference(&work->old_fb_obj->base);
 	drm_gem_object_unreference(&work->old_fb_obj->base);
 	drm_gem_object_unreference(&obj->base);
 	drm_gem_object_unreference(&obj->base);
-cleanup_work:
 	mutex_unlock(&dev->struct_mutex);
 	mutex_unlock(&dev->struct_mutex);
 
 
 	spin_lock_irqsave(&dev->event_lock, flags);
 	spin_lock_irqsave(&dev->event_lock, flags);
@@ -7657,6 +7770,31 @@ static void intel_init_display(struct drm_device *dev)
 		else
 		else
 			dev_priv->display.get_fifo_size = i830_get_fifo_size;
 			dev_priv->display.get_fifo_size = i830_get_fifo_size;
 	}
 	}
+
+	/* Default just returns -ENODEV to indicate unsupported */
+	dev_priv->display.queue_flip = intel_default_queue_flip;
+
+	switch (INTEL_INFO(dev)->gen) {
+	case 2:
+		dev_priv->display.queue_flip = intel_gen2_queue_flip;
+		break;
+
+	case 3:
+		dev_priv->display.queue_flip = intel_gen3_queue_flip;
+		break;
+
+	case 4:
+	case 5:
+		dev_priv->display.queue_flip = intel_gen4_queue_flip;
+		break;
+
+	case 6:
+		dev_priv->display.queue_flip = intel_gen6_queue_flip;
+		break;
+	case 7:
+		dev_priv->display.queue_flip = intel_gen7_queue_flip;
+		break;
+	}
 }
 }
 
 
 /*
 /*

+ 5 - 0
drivers/gpu/drm/i915/intel_overlay.c

@@ -1416,6 +1416,8 @@ void intel_setup_overlay(struct drm_device *dev)
 		goto out_free;
 		goto out_free;
 	overlay->reg_bo = reg_bo;
 	overlay->reg_bo = reg_bo;
 
 
+	mutex_lock(&dev->struct_mutex);
+
 	if (OVERLAY_NEEDS_PHYSICAL(dev)) {
 	if (OVERLAY_NEEDS_PHYSICAL(dev)) {
 		ret = i915_gem_attach_phys_object(dev, reg_bo,
 		ret = i915_gem_attach_phys_object(dev, reg_bo,
 						  I915_GEM_PHYS_OVERLAY_REGS,
 						  I915_GEM_PHYS_OVERLAY_REGS,
@@ -1440,6 +1442,8 @@ void intel_setup_overlay(struct drm_device *dev)
                 }
                 }
 	}
 	}
 
 
+	mutex_unlock(&dev->struct_mutex);
+
 	/* init all values */
 	/* init all values */
 	overlay->color_key = 0x0101fe;
 	overlay->color_key = 0x0101fe;
 	overlay->brightness = -19;
 	overlay->brightness = -19;
@@ -1464,6 +1468,7 @@ out_unpin_bo:
 	i915_gem_object_unpin(reg_bo);
 	i915_gem_object_unpin(reg_bo);
 out_free_bo:
 out_free_bo:
 	drm_gem_object_unreference(&reg_bo->base);
 	drm_gem_object_unreference(&reg_bo->base);
+	mutex_unlock(&dev->struct_mutex);
 out_free:
 out_free:
 	kfree(overlay);
 	kfree(overlay);
 	return;
 	return;

+ 2 - 2
drivers/gpu/drm/radeon/evergreen.c

@@ -2013,9 +2013,9 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
 		rdev->config.evergreen.tile_config |= (3 << 0);
 		rdev->config.evergreen.tile_config |= (3 << 0);
 		break;
 		break;
 	}
 	}
-	/* num banks is 8 on all fusion asics */
+	/* num banks is 8 on all fusion asics. 0 = 4, 1 = 8, 2 = 16 */
 	if (rdev->flags & RADEON_IS_IGP)
 	if (rdev->flags & RADEON_IS_IGP)
-		rdev->config.evergreen.tile_config |= 8 << 4;
+		rdev->config.evergreen.tile_config |= 1 << 4;
 	else
 	else
 		rdev->config.evergreen.tile_config |=
 		rdev->config.evergreen.tile_config |=
 			((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) << 4;
 			((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) << 4;

+ 1 - 0
drivers/gpu/drm/radeon/radeon.h

@@ -179,6 +179,7 @@ void radeon_pm_resume(struct radeon_device *rdev);
 void radeon_combios_get_power_modes(struct radeon_device *rdev);
 void radeon_combios_get_power_modes(struct radeon_device *rdev);
 void radeon_atombios_get_power_modes(struct radeon_device *rdev);
 void radeon_atombios_get_power_modes(struct radeon_device *rdev);
 void radeon_atom_set_voltage(struct radeon_device *rdev, u16 voltage_level, u8 voltage_type);
 void radeon_atom_set_voltage(struct radeon_device *rdev, u16 voltage_level, u8 voltage_type);
+int radeon_atom_get_max_vddc(struct radeon_device *rdev, u16 *voltage);
 void rs690_pm_info(struct radeon_device *rdev);
 void rs690_pm_info(struct radeon_device *rdev);
 extern int rv6xx_get_temp(struct radeon_device *rdev);
 extern int rv6xx_get_temp(struct radeon_device *rdev);
 extern int rv770_get_temp(struct radeon_device *rdev);
 extern int rv770_get_temp(struct radeon_device *rdev);

+ 36 - 0
drivers/gpu/drm/radeon/radeon_atombios.c

@@ -2320,6 +2320,14 @@ static bool radeon_atombios_parse_pplib_clock_info(struct radeon_device *rdev,
 			le16_to_cpu(clock_info->r600.usVDDC);
 			le16_to_cpu(clock_info->r600.usVDDC);
 	}
 	}
 
 
+	/* patch up vddc if necessary */
+	if (rdev->pm.power_state[state_index].clock_info[mode_index].voltage.voltage == 0xff01) {
+		u16 vddc;
+
+		if (radeon_atom_get_max_vddc(rdev, &vddc) == 0)
+			rdev->pm.power_state[state_index].clock_info[mode_index].voltage.voltage = vddc;
+	}
+
 	if (rdev->flags & RADEON_IS_IGP) {
 	if (rdev->flags & RADEON_IS_IGP) {
 		/* skip invalid modes */
 		/* skip invalid modes */
 		if (rdev->pm.power_state[state_index].clock_info[mode_index].sclk == 0)
 		if (rdev->pm.power_state[state_index].clock_info[mode_index].sclk == 0)
@@ -2630,7 +2638,35 @@ void radeon_atom_set_voltage(struct radeon_device *rdev, u16 voltage_level, u8 v
 	atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
 	atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
 }
 }
 
 
+int radeon_atom_get_max_vddc(struct radeon_device *rdev,
+			     u16 *voltage)
+{
+	union set_voltage args;
+	int index = GetIndexIntoMasterTable(COMMAND, SetVoltage);
+	u8 frev, crev;
+
+	if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev))
+		return -EINVAL;
+
+	switch (crev) {
+	case 1:
+		return -EINVAL;
+	case 2:
+		args.v2.ucVoltageType = SET_VOLTAGE_GET_MAX_VOLTAGE;
+		args.v2.ucVoltageMode = 0;
+		args.v2.usVoltageLevel = 0;
+
+		atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
+
+		*voltage = le16_to_cpu(args.v2.usVoltageLevel);
+		break;
+	default:
+		DRM_ERROR("Unknown table version %d, %d\n", frev, crev);
+		return -EINVAL;
+	}
 
 
+	return 0;
+}
 
 
 void radeon_atom_initialize_bios_scratch_regs(struct drm_device *dev)
 void radeon_atom_initialize_bios_scratch_regs(struct drm_device *dev)
 {
 {

+ 1 - 1
drivers/gpu/drm/radeon/radeon_bios.c

@@ -104,7 +104,7 @@ static bool radeon_read_bios(struct radeon_device *rdev)
 static bool radeon_atrm_get_bios(struct radeon_device *rdev)
 static bool radeon_atrm_get_bios(struct radeon_device *rdev)
 {
 {
 	int ret;
 	int ret;
-	int size = 64 * 1024;
+	int size = 256 * 1024;
 	int i;
 	int i;
 
 
 	if (!radeon_atrm_supported(rdev->pdev))
 	if (!radeon_atrm_supported(rdev->pdev))

+ 3 - 2
drivers/gpu/drm/ttm/ttm_tt.c

@@ -31,6 +31,7 @@
 #include <linux/sched.h>
 #include <linux/sched.h>
 #include <linux/highmem.h>
 #include <linux/highmem.h>
 #include <linux/pagemap.h>
 #include <linux/pagemap.h>
+#include <linux/shmem_fs.h>
 #include <linux/file.h>
 #include <linux/file.h>
 #include <linux/swap.h>
 #include <linux/swap.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
@@ -484,7 +485,7 @@ static int ttm_tt_swapin(struct ttm_tt *ttm)
 	swap_space = swap_storage->f_path.dentry->d_inode->i_mapping;
 	swap_space = swap_storage->f_path.dentry->d_inode->i_mapping;
 
 
 	for (i = 0; i < ttm->num_pages; ++i) {
 	for (i = 0; i < ttm->num_pages; ++i) {
-		from_page = read_mapping_page(swap_space, i, NULL);
+		from_page = shmem_read_mapping_page(swap_space, i);
 		if (IS_ERR(from_page)) {
 		if (IS_ERR(from_page)) {
 			ret = PTR_ERR(from_page);
 			ret = PTR_ERR(from_page);
 			goto out_err;
 			goto out_err;
@@ -557,7 +558,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage)
 		from_page = ttm->pages[i];
 		from_page = ttm->pages[i];
 		if (unlikely(from_page == NULL))
 		if (unlikely(from_page == NULL))
 			continue;
 			continue;
-		to_page = read_mapping_page(swap_space, i, NULL);
+		to_page = shmem_read_mapping_page(swap_space, i);
 		if (unlikely(IS_ERR(to_page))) {
 		if (unlikely(IS_ERR(to_page))) {
 			ret = PTR_ERR(to_page);
 			ret = PTR_ERR(to_page);
 			goto out_err;
 			goto out_err;

+ 1 - 0
drivers/hid/hid-core.c

@@ -1423,6 +1423,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACETRAVELLER) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACETRAVELLER) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACENAVIGATOR) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACENAVIGATOR) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_LUMIO, USB_DEVICE_ID_CRYSTALTOUCH) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_LUMIO, USB_DEVICE_ID_CRYSTALTOUCH) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_LUMIO, USB_DEVICE_ID_CRYSTALTOUCH_DUAL) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD_BOOTLOADER) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD_BOOTLOADER) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV) },

+ 1 - 0
drivers/hid/hid-ids.h

@@ -449,6 +449,7 @@
 
 
 #define USB_VENDOR_ID_LUMIO		0x202e
 #define USB_VENDOR_ID_LUMIO		0x202e
 #define USB_DEVICE_ID_CRYSTALTOUCH	0x0006
 #define USB_DEVICE_ID_CRYSTALTOUCH	0x0006
+#define USB_DEVICE_ID_CRYSTALTOUCH_DUAL	0x0007
 
 
 #define USB_VENDOR_ID_MCC		0x09db
 #define USB_VENDOR_ID_MCC		0x09db
 #define USB_DEVICE_ID_MCC_PMD1024LS	0x0076
 #define USB_DEVICE_ID_MCC_PMD1024LS	0x0076

+ 7 - 5
drivers/hid/hid-multitouch.c

@@ -271,6 +271,8 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 			}
 			}
 			return 1;
 			return 1;
 		case HID_DG_CONTACTID:
 		case HID_DG_CONTACTID:
+			if (!td->maxcontacts)
+				td->maxcontacts = MT_DEFAULT_MAXCONTACT;
 			input_mt_init_slots(hi->input, td->maxcontacts);
 			input_mt_init_slots(hi->input, td->maxcontacts);
 			td->last_slot_field = usage->hid;
 			td->last_slot_field = usage->hid;
 			td->last_field_index = field->index;
 			td->last_field_index = field->index;
@@ -547,9 +549,6 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
 	if (ret)
 	if (ret)
 		goto fail;
 		goto fail;
 
 
-	if (!td->maxcontacts)
-		td->maxcontacts = MT_DEFAULT_MAXCONTACT;
-
 	td->slots = kzalloc(td->maxcontacts * sizeof(struct mt_slot),
 	td->slots = kzalloc(td->maxcontacts * sizeof(struct mt_slot),
 				GFP_KERNEL);
 				GFP_KERNEL);
 	if (!td->slots) {
 	if (!td->slots) {
@@ -677,6 +676,9 @@ static const struct hid_device_id mt_devices[] = {
 	{ .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
 	{ .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
 		HID_USB_DEVICE(USB_VENDOR_ID_LUMIO,
 		HID_USB_DEVICE(USB_VENDOR_ID_LUMIO,
 			USB_DEVICE_ID_CRYSTALTOUCH) },
 			USB_DEVICE_ID_CRYSTALTOUCH) },
+	{ .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
+		HID_USB_DEVICE(USB_VENDOR_ID_LUMIO,
+			USB_DEVICE_ID_CRYSTALTOUCH_DUAL) },
 
 
 	/* MosArt panels */
 	/* MosArt panels */
 	{ .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
 	{ .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
@@ -707,10 +709,10 @@ static const struct hid_device_id mt_devices[] = {
 		HID_USB_DEVICE(USB_VENDOR_ID_STANTUM,
 		HID_USB_DEVICE(USB_VENDOR_ID_STANTUM,
 			USB_DEVICE_ID_MTP)},
 			USB_DEVICE_ID_MTP)},
 	{ .driver_data = MT_CLS_CONFIDENCE,
 	{ .driver_data = MT_CLS_CONFIDENCE,
-		HID_USB_DEVICE(USB_VENDOR_ID_STANTUM,
+		HID_USB_DEVICE(USB_VENDOR_ID_STANTUM_STM,
 			USB_DEVICE_ID_MTP_STM)},
 			USB_DEVICE_ID_MTP_STM)},
 	{ .driver_data = MT_CLS_CONFIDENCE,
 	{ .driver_data = MT_CLS_CONFIDENCE,
-		HID_USB_DEVICE(USB_VENDOR_ID_STANTUM,
+		HID_USB_DEVICE(USB_VENDOR_ID_STANTUM_SITRONIX,
 			USB_DEVICE_ID_MTP_SITRONIX)},
 			USB_DEVICE_ID_MTP_SITRONIX)},
 
 
 	/* Touch International panels */
 	/* Touch International panels */

+ 4 - 4
drivers/i2c/busses/i2c-taos-evm.c

@@ -234,7 +234,7 @@ static int taos_connect(struct serio *serio, struct serio_driver *drv)
 
 
 	if (taos->state != TAOS_STATE_IDLE) {
 	if (taos->state != TAOS_STATE_IDLE) {
 		err = -ENODEV;
 		err = -ENODEV;
-		dev_dbg(&serio->dev, "TAOS EVM reset failed (state=%d, "
+		dev_err(&serio->dev, "TAOS EVM reset failed (state=%d, "
 			"pos=%d)\n", taos->state, taos->pos);
 			"pos=%d)\n", taos->state, taos->pos);
 		goto exit_close;
 		goto exit_close;
 	}
 	}
@@ -255,7 +255,7 @@ static int taos_connect(struct serio *serio, struct serio_driver *drv)
 					 msecs_to_jiffies(250));
 					 msecs_to_jiffies(250));
 	if (taos->state != TAOS_STATE_IDLE) {
 	if (taos->state != TAOS_STATE_IDLE) {
 		err = -ENODEV;
 		err = -ENODEV;
-		dev_err(&adapter->dev, "Echo off failed "
+		dev_err(&serio->dev, "TAOS EVM echo off failed "
 			"(state=%d)\n", taos->state);
 			"(state=%d)\n", taos->state);
 		goto exit_close;
 		goto exit_close;
 	}
 	}
@@ -263,7 +263,7 @@ static int taos_connect(struct serio *serio, struct serio_driver *drv)
 	err = i2c_add_adapter(adapter);
 	err = i2c_add_adapter(adapter);
 	if (err)
 	if (err)
 		goto exit_close;
 		goto exit_close;
-	dev_dbg(&serio->dev, "Connected to TAOS EVM\n");
+	dev_info(&serio->dev, "Connected to TAOS EVM\n");
 
 
 	taos->client = taos_instantiate_device(adapter);
 	taos->client = taos_instantiate_device(adapter);
 	return 0;
 	return 0;
@@ -288,7 +288,7 @@ static void taos_disconnect(struct serio *serio)
 	serio_set_drvdata(serio, NULL);
 	serio_set_drvdata(serio, NULL);
 	kfree(taos);
 	kfree(taos);
 
 
-	dev_dbg(&serio->dev, "Disconnected from TAOS EVM\n");
+	dev_info(&serio->dev, "Disconnected from TAOS EVM\n");
 }
 }
 
 
 static struct serio_device_id taos_serio_ids[] = {
 static struct serio_device_id taos_serio_ids[] = {

+ 4 - 3
drivers/i2c/muxes/pca954x.c

@@ -201,10 +201,11 @@ static int pca954x_probe(struct i2c_client *client,
 
 
 	i2c_set_clientdata(client, data);
 	i2c_set_clientdata(client, data);
 
 
-	/* Read the mux register at addr to verify
-	 * that the mux is in fact present.
+	/* Write the mux register at addr to verify
+	 * that the mux is in fact present. This also
+	 * initializes the mux to disconnected state.
 	 */
 	 */
-	if (i2c_smbus_read_byte(client) < 0) {
+	if (i2c_smbus_write_byte(client, 0) < 0) {
 		dev_warn(&client->dev, "probe failed\n");
 		dev_warn(&client->dev, "probe failed\n");
 		goto exit_free;
 		goto exit_free;
 	}
 	}

+ 37 - 9
drivers/infiniband/hw/cxgb4/cm.c

@@ -1463,9 +1463,9 @@ static int peer_close(struct c4iw_dev *dev, struct sk_buff *skb)
 	struct c4iw_qp_attributes attrs;
 	struct c4iw_qp_attributes attrs;
 	int disconnect = 1;
 	int disconnect = 1;
 	int release = 0;
 	int release = 0;
-	int abort = 0;
 	struct tid_info *t = dev->rdev.lldi.tids;
 	struct tid_info *t = dev->rdev.lldi.tids;
 	unsigned int tid = GET_TID(hdr);
 	unsigned int tid = GET_TID(hdr);
+	int ret;
 
 
 	ep = lookup_tid(t, tid);
 	ep = lookup_tid(t, tid);
 	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
 	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
@@ -1501,10 +1501,12 @@ static int peer_close(struct c4iw_dev *dev, struct sk_buff *skb)
 		start_ep_timer(ep);
 		start_ep_timer(ep);
 		__state_set(&ep->com, CLOSING);
 		__state_set(&ep->com, CLOSING);
 		attrs.next_state = C4IW_QP_STATE_CLOSING;
 		attrs.next_state = C4IW_QP_STATE_CLOSING;
-		abort = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp,
+		ret = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp,
 				       C4IW_QP_ATTR_NEXT_STATE, &attrs, 1);
 				       C4IW_QP_ATTR_NEXT_STATE, &attrs, 1);
-		peer_close_upcall(ep);
-		disconnect = 1;
+		if (ret != -ECONNRESET) {
+			peer_close_upcall(ep);
+			disconnect = 1;
+		}
 		break;
 		break;
 	case ABORTING:
 	case ABORTING:
 		disconnect = 0;
 		disconnect = 0;
@@ -2109,15 +2111,16 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp)
 		break;
 		break;
 	}
 	}
 
 
-	mutex_unlock(&ep->com.mutex);
 	if (close) {
 	if (close) {
-		if (abrupt)
-			ret = abort_connection(ep, NULL, gfp);
-		else
+		if (abrupt) {
+			close_complete_upcall(ep);
+			ret = send_abort(ep, NULL, gfp);
+		} else
 			ret = send_halfclose(ep, gfp);
 			ret = send_halfclose(ep, gfp);
 		if (ret)
 		if (ret)
 			fatal = 1;
 			fatal = 1;
 	}
 	}
+	mutex_unlock(&ep->com.mutex);
 	if (fatal)
 	if (fatal)
 		release_ep_resources(ep);
 		release_ep_resources(ep);
 	return ret;
 	return ret;
@@ -2301,6 +2304,31 @@ static int fw6_msg(struct c4iw_dev *dev, struct sk_buff *skb)
 	return 0;
 	return 0;
 }
 }
 
 
+static int peer_abort_intr(struct c4iw_dev *dev, struct sk_buff *skb)
+{
+	struct cpl_abort_req_rss *req = cplhdr(skb);
+	struct c4iw_ep *ep;
+	struct tid_info *t = dev->rdev.lldi.tids;
+	unsigned int tid = GET_TID(req);
+
+	ep = lookup_tid(t, tid);
+	if (is_neg_adv_abort(req->status)) {
+		PDBG("%s neg_adv_abort ep %p tid %u\n", __func__, ep,
+		     ep->hwtid);
+		kfree_skb(skb);
+		return 0;
+	}
+	PDBG("%s ep %p tid %u state %u\n", __func__, ep, ep->hwtid,
+	     ep->com.state);
+
+	/*
+	 * Wake up any threads in rdma_init() or rdma_fini().
+	 */
+	c4iw_wake_up(&ep->com.wr_wait, -ECONNRESET);
+	sched(dev, skb);
+	return 0;
+}
+
 /*
 /*
  * Most upcalls from the T4 Core go to sched() to
  * Most upcalls from the T4 Core go to sched() to
  * schedule the processing on a work queue.
  * schedule the processing on a work queue.
@@ -2317,7 +2345,7 @@ c4iw_handler_func c4iw_handlers[NUM_CPL_CMDS] = {
 	[CPL_PASS_ESTABLISH] = sched,
 	[CPL_PASS_ESTABLISH] = sched,
 	[CPL_PEER_CLOSE] = sched,
 	[CPL_PEER_CLOSE] = sched,
 	[CPL_CLOSE_CON_RPL] = sched,
 	[CPL_CLOSE_CON_RPL] = sched,
-	[CPL_ABORT_REQ_RSS] = sched,
+	[CPL_ABORT_REQ_RSS] = peer_abort_intr,
 	[CPL_RDMA_TERMINATE] = sched,
 	[CPL_RDMA_TERMINATE] = sched,
 	[CPL_FW4_ACK] = sched,
 	[CPL_FW4_ACK] = sched,
 	[CPL_SET_TCB_RPL] = set_tcb_rpl,
 	[CPL_SET_TCB_RPL] = set_tcb_rpl,

+ 4 - 0
drivers/infiniband/hw/cxgb4/cq.c

@@ -801,6 +801,10 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int entries,
 	if (ucontext) {
 	if (ucontext) {
 		memsize = roundup(memsize, PAGE_SIZE);
 		memsize = roundup(memsize, PAGE_SIZE);
 		hwentries = memsize / sizeof *chp->cq.queue;
 		hwentries = memsize / sizeof *chp->cq.queue;
+		while (hwentries > T4_MAX_IQ_SIZE) {
+			memsize -= PAGE_SIZE;
+			hwentries = memsize / sizeof *chp->cq.queue;
+		}
 	}
 	}
 	chp->cq.size = hwentries;
 	chp->cq.size = hwentries;
 	chp->cq.memsize = memsize;
 	chp->cq.memsize = memsize;

+ 1 - 1
drivers/infiniband/hw/cxgb4/mem.c

@@ -625,7 +625,7 @@ pbl_done:
 	mhp->attr.perms = c4iw_ib_to_tpt_access(acc);
 	mhp->attr.perms = c4iw_ib_to_tpt_access(acc);
 	mhp->attr.va_fbo = virt;
 	mhp->attr.va_fbo = virt;
 	mhp->attr.page_size = shift - 12;
 	mhp->attr.page_size = shift - 12;
-	mhp->attr.len = (u32) length;
+	mhp->attr.len = length;
 
 
 	err = register_mem(rhp, php, mhp, shift);
 	err = register_mem(rhp, php, mhp, shift);
 	if (err)
 	if (err)

+ 1 - 4
drivers/infiniband/hw/cxgb4/qp.c

@@ -1207,11 +1207,8 @@ int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_qp *qhp,
 				c4iw_get_ep(&qhp->ep->com);
 				c4iw_get_ep(&qhp->ep->com);
 			}
 			}
 			ret = rdma_fini(rhp, qhp, ep);
 			ret = rdma_fini(rhp, qhp, ep);
-			if (ret) {
-				if (internal)
-					c4iw_get_ep(&qhp->ep->com);
+			if (ret)
 				goto err;
 				goto err;
-			}
 			break;
 			break;
 		case C4IW_QP_STATE_TERMINATE:
 		case C4IW_QP_STATE_TERMINATE:
 			set_state(qhp, C4IW_QP_STATE_TERMINATE);
 			set_state(qhp, C4IW_QP_STATE_TERMINATE);

+ 18 - 7
drivers/infiniband/hw/qib/qib_iba7322.c

@@ -469,6 +469,8 @@ static u8 ib_rate_to_delay[IB_RATE_120_GBPS + 1] = {
 #define IB_7322_LT_STATE_RECOVERIDLE     0x0f
 #define IB_7322_LT_STATE_RECOVERIDLE     0x0f
 #define IB_7322_LT_STATE_CFGENH          0x10
 #define IB_7322_LT_STATE_CFGENH          0x10
 #define IB_7322_LT_STATE_CFGTEST         0x11
 #define IB_7322_LT_STATE_CFGTEST         0x11
+#define IB_7322_LT_STATE_CFGWAITRMTTEST  0x12
+#define IB_7322_LT_STATE_CFGWAITENH      0x13
 
 
 /* link state machine states from IBC */
 /* link state machine states from IBC */
 #define IB_7322_L_STATE_DOWN             0x0
 #define IB_7322_L_STATE_DOWN             0x0
@@ -498,8 +500,10 @@ static const u8 qib_7322_physportstate[0x20] = {
 		IB_PHYSPORTSTATE_LINK_ERR_RECOVER,
 		IB_PHYSPORTSTATE_LINK_ERR_RECOVER,
 	[IB_7322_LT_STATE_CFGENH] = IB_PHYSPORTSTATE_CFG_ENH,
 	[IB_7322_LT_STATE_CFGENH] = IB_PHYSPORTSTATE_CFG_ENH,
 	[IB_7322_LT_STATE_CFGTEST] = IB_PHYSPORTSTATE_CFG_TRAIN,
 	[IB_7322_LT_STATE_CFGTEST] = IB_PHYSPORTSTATE_CFG_TRAIN,
-	[0x12] = IB_PHYSPORTSTATE_CFG_TRAIN,
-	[0x13] = IB_PHYSPORTSTATE_CFG_WAIT_ENH,
+	[IB_7322_LT_STATE_CFGWAITRMTTEST] =
+		IB_PHYSPORTSTATE_CFG_TRAIN,
+	[IB_7322_LT_STATE_CFGWAITENH] =
+		IB_PHYSPORTSTATE_CFG_WAIT_ENH,
 	[0x14] = IB_PHYSPORTSTATE_CFG_TRAIN,
 	[0x14] = IB_PHYSPORTSTATE_CFG_TRAIN,
 	[0x15] = IB_PHYSPORTSTATE_CFG_TRAIN,
 	[0x15] = IB_PHYSPORTSTATE_CFG_TRAIN,
 	[0x16] = IB_PHYSPORTSTATE_CFG_TRAIN,
 	[0x16] = IB_PHYSPORTSTATE_CFG_TRAIN,
@@ -1692,7 +1696,9 @@ static void handle_serdes_issues(struct qib_pportdata *ppd, u64 ibcst)
 		break;
 		break;
 	}
 	}
 
 
-	if (ibclt == IB_7322_LT_STATE_CFGTEST &&
+	if (((ibclt >= IB_7322_LT_STATE_CFGTEST &&
+	      ibclt <= IB_7322_LT_STATE_CFGWAITENH) ||
+	     ibclt == IB_7322_LT_STATE_LINKUP) &&
 	    (ibcst & SYM_MASK(IBCStatusA_0, LinkSpeedQDR))) {
 	    (ibcst & SYM_MASK(IBCStatusA_0, LinkSpeedQDR))) {
 		force_h1(ppd);
 		force_h1(ppd);
 		ppd->cpspec->qdr_reforce = 1;
 		ppd->cpspec->qdr_reforce = 1;
@@ -7301,12 +7307,17 @@ static void ibsd_wr_allchans(struct qib_pportdata *ppd, int addr, unsigned data,
 static void serdes_7322_los_enable(struct qib_pportdata *ppd, int enable)
 static void serdes_7322_los_enable(struct qib_pportdata *ppd, int enable)
 {
 {
 	u64 data = qib_read_kreg_port(ppd, krp_serdesctrl);
 	u64 data = qib_read_kreg_port(ppd, krp_serdesctrl);
-	printk(KERN_INFO QIB_DRV_NAME " IB%u:%u Turning LOS %s\n",
-		ppd->dd->unit, ppd->port, (enable ? "on" : "off"));
-	if (enable)
+	u8 state = SYM_FIELD(data, IBSerdesCtrl_0, RXLOSEN);
+
+	if (enable && !state) {
+		printk(KERN_INFO QIB_DRV_NAME " IB%u:%u Turning LOS on\n",
+			ppd->dd->unit, ppd->port);
 		data |= SYM_MASK(IBSerdesCtrl_0, RXLOSEN);
 		data |= SYM_MASK(IBSerdesCtrl_0, RXLOSEN);
-	else
+	} else if (!enable && state) {
+		printk(KERN_INFO QIB_DRV_NAME " IB%u:%u Turning LOS off\n",
+			ppd->dd->unit, ppd->port);
 		data &= ~SYM_MASK(IBSerdesCtrl_0, RXLOSEN);
 		data &= ~SYM_MASK(IBSerdesCtrl_0, RXLOSEN);
+	}
 	qib_write_kreg_port(ppd, krp_serdesctrl, data);
 	qib_write_kreg_port(ppd, krp_serdesctrl, data);
 }
 }
 
 

+ 5 - 1
drivers/infiniband/hw/qib/qib_intr.c

@@ -96,8 +96,12 @@ void qib_handle_e_ibstatuschanged(struct qib_pportdata *ppd, u64 ibcs)
 	 * states, or if it transitions from any of the up (INIT or better)
 	 * states, or if it transitions from any of the up (INIT or better)
 	 * states into any of the down states (except link recovery), then
 	 * states into any of the down states (except link recovery), then
 	 * call the chip-specific code to take appropriate actions.
 	 * call the chip-specific code to take appropriate actions.
+	 *
+	 * ppd->lflags could be 0 if this is the first time the interrupt
+	 * handlers has been called but the link is already up.
 	 */
 	 */
-	if (lstate >= IB_PORT_INIT && (ppd->lflags & QIBL_LINKDOWN) &&
+	if (lstate >= IB_PORT_INIT &&
+	    (!ppd->lflags || (ppd->lflags & QIBL_LINKDOWN)) &&
 	    ltstate == IB_PHYSPORTSTATE_LINKUP) {
 	    ltstate == IB_PHYSPORTSTATE_LINKUP) {
 		/* transitioned to UP */
 		/* transitioned to UP */
 		if (dd->f_ib_updown(ppd, 1, ibcs))
 		if (dd->f_ib_updown(ppd, 1, ibcs))

+ 2 - 2
drivers/leds/leds-lp5521.c

@@ -593,7 +593,7 @@ static void lp5521_unregister_sysfs(struct i2c_client *client)
 				&lp5521_led_attribute_group);
 				&lp5521_led_attribute_group);
 }
 }
 
 
-static int __init lp5521_init_led(struct lp5521_led *led,
+static int __devinit lp5521_init_led(struct lp5521_led *led,
 				struct i2c_client *client,
 				struct i2c_client *client,
 				int chan, struct lp5521_platform_data *pdata)
 				int chan, struct lp5521_platform_data *pdata)
 {
 {
@@ -637,7 +637,7 @@ static int __init lp5521_init_led(struct lp5521_led *led,
 	return 0;
 	return 0;
 }
 }
 
 
-static int lp5521_probe(struct i2c_client *client,
+static int __devinit lp5521_probe(struct i2c_client *client,
 			const struct i2c_device_id *id)
 			const struct i2c_device_id *id)
 {
 {
 	struct lp5521_chip		*chip;
 	struct lp5521_chip		*chip;

+ 2 - 2
drivers/leds/leds-lp5523.c

@@ -826,7 +826,7 @@ static int __init lp5523_init_engine(struct lp5523_engine *engine, int id)
 	return 0;
 	return 0;
 }
 }
 
 
-static int __init lp5523_init_led(struct lp5523_led *led, struct device *dev,
+static int __devinit lp5523_init_led(struct lp5523_led *led, struct device *dev,
 			   int chan, struct lp5523_platform_data *pdata)
 			   int chan, struct lp5523_platform_data *pdata)
 {
 {
 	char name[32];
 	char name[32];
@@ -872,7 +872,7 @@ static int __init lp5523_init_led(struct lp5523_led *led, struct device *dev,
 
 
 static struct i2c_driver lp5523_driver;
 static struct i2c_driver lp5523_driver;
 
 
-static int lp5523_probe(struct i2c_client *client,
+static int __devinit lp5523_probe(struct i2c_client *client,
 			const struct i2c_device_id *id)
 			const struct i2c_device_id *id)
 {
 {
 	struct lp5523_chip		*chip;
 	struct lp5523_chip		*chip;

+ 1 - 0
drivers/md/md.c

@@ -7088,6 +7088,7 @@ static int remove_and_add_spares(mddev_t *mddev)
 		list_for_each_entry(rdev, &mddev->disks, same_set) {
 		list_for_each_entry(rdev, &mddev->disks, same_set) {
 			if (rdev->raid_disk >= 0 &&
 			if (rdev->raid_disk >= 0 &&
 			    !test_bit(In_sync, &rdev->flags) &&
 			    !test_bit(In_sync, &rdev->flags) &&
+			    !test_bit(Faulty, &rdev->flags) &&
 			    !test_bit(Blocked, &rdev->flags))
 			    !test_bit(Blocked, &rdev->flags))
 				spares++;
 				spares++;
 			if (rdev->raid_disk < 0
 			if (rdev->raid_disk < 0

+ 1 - 1
drivers/misc/cb710/sgbuf2.c

@@ -47,7 +47,7 @@ static uint32_t sg_dwiter_read_buffer(struct sg_mapping_iter *miter)
 
 
 static inline bool needs_unaligned_copy(const void *ptr)
 static inline bool needs_unaligned_copy(const void *ptr)
 {
 {
-#ifdef HAVE_EFFICIENT_UNALIGNED_ACCESS
+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
 	return false;
 	return false;
 #else
 #else
 	return ((ptr - NULL) & 3) != 0;
 	return ((ptr - NULL) & 3) != 0;

+ 1 - 1
drivers/misc/ioc4.c

@@ -270,7 +270,7 @@ ioc4_variant(struct ioc4_driver_data *idd)
 	return IOC4_VARIANT_PCI_RT;
 	return IOC4_VARIANT_PCI_RT;
 }
 }
 
 
-static void __devinit
+static void
 ioc4_load_modules(struct work_struct *work)
 ioc4_load_modules(struct work_struct *work)
 {
 {
 	request_module("sgiioc4");
 	request_module("sgiioc4");

+ 8 - 0
drivers/misc/lkdtm.c

@@ -120,6 +120,7 @@ static int recur_count = REC_NUM_DEFAULT;
 static enum cname cpoint = CN_INVALID;
 static enum cname cpoint = CN_INVALID;
 static enum ctype cptype = CT_NONE;
 static enum ctype cptype = CT_NONE;
 static int count = DEFAULT_COUNT;
 static int count = DEFAULT_COUNT;
+static DEFINE_SPINLOCK(count_lock);
 
 
 module_param(recur_count, int, 0644);
 module_param(recur_count, int, 0644);
 MODULE_PARM_DESC(recur_count, " Recursion level for the stack overflow test, "\
 MODULE_PARM_DESC(recur_count, " Recursion level for the stack overflow test, "\
@@ -230,11 +231,14 @@ static const char *cp_name_to_str(enum cname name)
 static int lkdtm_parse_commandline(void)
 static int lkdtm_parse_commandline(void)
 {
 {
 	int i;
 	int i;
+	unsigned long flags;
 
 
 	if (cpoint_count < 1 || recur_count < 1)
 	if (cpoint_count < 1 || recur_count < 1)
 		return -EINVAL;
 		return -EINVAL;
 
 
+	spin_lock_irqsave(&count_lock, flags);
 	count = cpoint_count;
 	count = cpoint_count;
+	spin_unlock_irqrestore(&count_lock, flags);
 
 
 	/* No special parameters */
 	/* No special parameters */
 	if (!cpoint_type && !cpoint_name)
 	if (!cpoint_type && !cpoint_name)
@@ -349,6 +353,9 @@ static void lkdtm_do_action(enum ctype which)
 
 
 static void lkdtm_handler(void)
 static void lkdtm_handler(void)
 {
 {
+	unsigned long flags;
+
+	spin_lock_irqsave(&count_lock, flags);
 	count--;
 	count--;
 	printk(KERN_INFO "lkdtm: Crash point %s of type %s hit, trigger in %d rounds\n",
 	printk(KERN_INFO "lkdtm: Crash point %s of type %s hit, trigger in %d rounds\n",
 			cp_name_to_str(cpoint), cp_type_to_str(cptype), count);
 			cp_name_to_str(cpoint), cp_type_to_str(cptype), count);
@@ -357,6 +364,7 @@ static void lkdtm_handler(void)
 		lkdtm_do_action(cptype);
 		lkdtm_do_action(cptype);
 		count = cpoint_count;
 		count = cpoint_count;
 	}
 	}
+	spin_unlock_irqrestore(&count_lock, flags);
 }
 }
 
 
 static int lkdtm_register_cpoint(enum cname which)
 static int lkdtm_register_cpoint(enum cname which)

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است