History

Merge tag 'v3.4-rc5' into next

Linux 3.4-rc5 Merge to pull in prerequisite change for Smack: 86812bb0de1a3758dc6c7aa01a763158a7c0638a Requested by Casey.

James Morris committed 14 years ago

Commit 898bfc12 parents 08162e6 69964ea811 files · +7629 −5435Browse files

Unified · Split

811 files
  1. Documentation/ABI/stable/sysfs-driver-usb-usbtmc +7 −7
  2. Documentation/ABI/testing/sysfs-block-rssd +18 −0
  3. Documentation/ABI/testing/sysfs-bus-hsi +19 −0
  4. Documentation/ABI/testing/sysfs-cfq-target-latency +8 −0
  5. Documentation/DocBook/media/v4l/pixfmt-nv12m.xml +1 −1
  6. Documentation/DocBook/media/v4l/pixfmt-yuv420m.xml +1 −1
  7. Documentation/cgroups/memory.txt +2 −3
  8. Documentation/feature-removal-schedule.txt +8 −0
  9. Documentation/filesystems/vfs.txt +1 −1
  10. Documentation/power/freezing-of-tasks.txt +19 −18
  11. Documentation/security/keys.txt +13 −1
  12. Documentation/sound/alsa/HD-Audio-Models.txt +3 −1
  13. Documentation/usb/URB.txt +22 −0
  14. Documentation/usb/usbmon.txt +3 −3
  15. MAINTAINERS +18 −12
  16. Makefile +1 −1
  17. arch/alpha/include/asm/atomic.h +1 −67
  18. arch/alpha/include/asm/cmpxchg.h +71 −0
  19. arch/alpha/include/asm/xchg.h +2 −2
  20. arch/arm/boot/compressed/atags_to_fdt.c +2 −0
  21. arch/arm/boot/compressed/head.S +1 −1
  22. arch/arm/boot/dts/at91sam9g20.dtsi +0 −1
  23. arch/arm/boot/dts/at91sam9g45.dtsi +0 −1
  24. arch/arm/boot/dts/at91sam9x5.dtsi +0 −1
  25. arch/arm/boot/dts/db8500.dtsi +0 −1
  26. arch/arm/boot/dts/highbank.dts +0 −1
  27. arch/arm/boot/dts/msm8660-surf.dts +2 −2
  28. arch/arm/common/vic.c +4 −5
  29. arch/arm/configs/imx_v4_v5_defconfig +1 −0
  30. arch/arm/configs/mini2440_defconfig +2 −0
  31. arch/arm/configs/u8500_defconfig +4 −5
  32. arch/arm/include/asm/jump_label.h +1 −1
  33. arch/arm/kernel/setup.c +15 −1
  34. arch/arm/mach-at91/at91rm9200_devices.c +0 −1
  35. arch/arm/mach-at91/at91rm9200_time.c +2 −0
  36. arch/arm/mach-at91/board-rm9200ek.c +1 −1
  37. arch/arm/mach-at91/board-sam9261ek.c +3 −2
  38. arch/arm/mach-at91/clock.c +1 −0
  39. arch/arm/mach-at91/include/mach/at91_pmc.h +1 −1
  40. arch/arm/mach-at91/setup.c +2 −0
  41. arch/arm/mach-bcmring/core.c +2 −2
  42. arch/arm/mach-exynos/Kconfig +2 −0
  43. arch/arm/mach-exynos/clock-exynos4.c +12 −12
  44. arch/arm/mach-exynos/clock-exynos5.c +12 −12
  45. arch/arm/mach-exynos/common.c +13 −1
  46. arch/arm/mach-exynos/dev-dwmci.c +3 −10
  47. arch/arm/mach-exynos/include/mach/irqs.h +2 −0
  48. arch/arm/mach-exynos/include/mach/map.h +4 −0
  49. arch/arm/mach-exynos/include/mach/regs-clock.h +6 −0
  50. arch/arm/mach-exynos/mach-exynos5-dt.c +1 −1
  51. arch/arm/mach-exynos/mach-nuri.c +3 −44
  52. arch/arm/mach-exynos/mach-universal_c210.c +3 −0
  53. arch/arm/mach-imx/imx27-dt.c +4 −2
  54. arch/arm/mach-imx/mm-imx5.c +1 −1
  55. arch/arm/mach-msm/board-halibut.c +0 −3
  56. arch/arm/mach-msm/board-msm8x60.c +15 −10
  57. arch/arm/mach-msm/board-trout-panel.c +1 −0
  58. arch/arm/mach-msm/board-trout.c +1 −0
  59. arch/arm/mach-msm/proc_comm.c +1 −1
  60. arch/arm/mach-omap1/mux.c +1 −0
  61. arch/arm/mach-omap1/timer.c +2 −2
  62. arch/arm/mach-omap2/board-4430sdp.c +6 −6
  63. arch/arm/mach-omap2/board-generic.c +1 −1
  64. arch/arm/mach-omap2/board-omap4panda.c +6 −7
  65. arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +0 −80
  66. arch/arm/mach-omap2/clock.c +0 −5
  67. arch/arm/mach-omap2/clock.h +0 −8
  68. arch/arm/mach-omap2/omap_hwmod.c +15 −2
  69. arch/arm/mach-omap2/omap_hwmod_2420_data.c +0 −1
  70. arch/arm/mach-omap2/omap_hwmod_2430_data.c +0 −1
  71. arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +0 −1
  72. arch/arm/mach-omap2/omap_hwmod_44xx_data.c +9 −0
  73. arch/arm/mach-omap2/serial.c +7 −117
  74. arch/arm/mach-omap2/twl-common.c +32 −5
  75. arch/arm/mach-omap2/twl-common.h +4 −6
  76. arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h +7 −0
  77. arch/arm/mach-pxa/mfp-pxa2xx.c +19 −2
  78. arch/arm/mach-pxa/pxa27x.c +5 −1
  79. arch/arm/mach-s3c24xx/Kconfig +4 −4
  80. arch/arm/mach-s5pv210/dma.c +0 −2
  81. arch/arm/mach-s5pv210/mach-aquila.c +2 −2
  82. arch/arm/mach-s5pv210/mach-goni.c +4 −2
  83. arch/arm/mach-sa1100/generic.c +1 −1
  84. arch/arm/mach-u300/core.c +4 −2
  85. arch/arm/mach-u300/i2c.c +1 −8
  86. arch/arm/mach-u300/include/mach/irqs.h +75 −75
  87. arch/arm/mach-ux500/Kconfig +1 −0
  88. arch/arm/mach-ux500/mbox-db5500.c +1 −1
  89. arch/arm/mach-ux500/platsmp.c +1 −1
  90. arch/arm/mm/Kconfig +1 −1
  91. arch/arm/mm/fault.c +1 −1
  92. arch/arm/mm/nommu.c +2 −0
  93. arch/arm/mm/proc-v7.S +12 −0
  94. arch/arm/plat-omap/clock.c +0 −26
  95. arch/arm/plat-omap/include/plat/clock.h +0 −10
  96. arch/arm/plat-omap/include/plat/omap_hwmod.h +3 −1
  97. arch/arm/plat-omap/sram.c +6 −6
  98. arch/arm/plat-samsung/Kconfig +1 −0
  99. arch/arm/plat-samsung/include/plat/sdhci.h +28 −0
  100. arch/blackfin/mach-bf538/boards/ezkit.c +26 −27
  101. arch/c6x/include/asm/irq.h +0 −4
  102. arch/c6x/kernel/irq.c +0 −13
  103. arch/hexagon/kernel/dma.c +1 −0
  104. arch/hexagon/kernel/process.c +3 −3
  105. arch/hexagon/kernel/ptrace.c +1 −0
  106. arch/hexagon/kernel/smp.c +7 −1
  107. arch/hexagon/kernel/time.c +1 −0
  108. arch/hexagon/kernel/vdso.c +1 −0
  109. arch/ia64/include/asm/cmpxchg.h +147 −1
  110. arch/ia64/include/asm/futex.h +5 −4
  111. arch/ia64/include/asm/intrinsics.h +1 −113
  112. arch/ia64/kernel/perfmon.c +4 −14
  113. arch/m68k/configs/m5275evb_defconfig +0 −1
  114. arch/m68k/platform/527x/config.c +0 −2
  115. arch/m68k/platform/68EZ328/Makefile +0 −6
  116. arch/m68k/platform/68VZ328/Makefile +2 −7
  117. arch/m68k/platform/68VZ328/bootlogo.h +1 −1
  118. arch/m68k/platform/coldfire/device.c +1 −1
  119. arch/powerpc/boot/dts/fsl/pq3-mpic-message-B.dtsi +43 −0
  120. arch/powerpc/boot/dts/fsl/pq3-mpic.dtsi +10 −0
  121. arch/powerpc/include/asm/irq.h +0 −2
  122. arch/powerpc/include/asm/mpic.h +0 −18
  123. arch/powerpc/include/asm/mpic_msgr.h +1 −0
  124. arch/powerpc/include/asm/reg_booke.h +0 −5
  125. arch/powerpc/kernel/entry_32.S +21 −18
  126. arch/powerpc/kernel/irq.c +0 −6
  127. arch/powerpc/kernel/process.c +2 −2
  128. arch/powerpc/kernel/setup_32.c +3 −0
  129. arch/powerpc/platforms/85xx/common.c +6 −0
  130. arch/powerpc/platforms/85xx/mpc85xx_mds.c +1 −10
  131. arch/powerpc/platforms/85xx/p1022_ds.c +1 −12
  132. arch/powerpc/platforms/cell/axon_msi.c +1 −1
  133. arch/powerpc/platforms/cell/beat_interrupt.c +1 −1
  134. arch/powerpc/platforms/powermac/low_i2c.c +9 −0
  135. arch/powerpc/platforms/powermac/smp.c +1 −1
  136. arch/powerpc/platforms/ps3/interrupt.c +1 −2
  137. arch/powerpc/platforms/pseries/eeh.c +1 −1
  138. arch/powerpc/sysdev/mpic.c +34 −20
  139. arch/powerpc/sysdev/mpic_msgr.c +6 −6
  140. arch/powerpc/sysdev/scom.c +1 −0
  141. arch/s390/Kconfig +0 −1
  142. arch/s390/defconfig +18 −19
  143. arch/s390/include/asm/facility.h +1 −2
  144. arch/s390/include/asm/pgalloc.h +0 −3
  145. arch/s390/include/asm/swab.h +1 −1
  146. arch/s390/include/asm/tlb.h +1 −21
  147. arch/s390/kernel/head.S +1 −1
  148. arch/s390/kernel/irq.c +6 −3
  149. arch/s390/kernel/perf_cpum_cf.c +2 −2
  150. arch/s390/mm/maccess.c +18 −9
  151. arch/s390/mm/pgtable.c +60 −3
  152. arch/sh/include/asm/atomic.h +1 −1
  153. arch/sh/mm/fault_32.c +1 −1
  154. arch/sparc/kernel/ds.c +1 −1
  155. arch/sparc/kernel/leon_pci.c +0 −13
  156. arch/sparc/kernel/leon_smp.c +3 −0
  157. arch/sparc/kernel/rtrap_64.S +0 −7
  158. arch/sparc/kernel/sys_sparc_64.c +1 −6
  159. arch/sparc/mm/fault_32.c +30 −7
  160. arch/sparc/mm/fault_64.c +30 −7
  161. arch/tile/include/asm/pci.h +2 −2
  162. arch/tile/kernel/pci.c +2 −2
  163. arch/tile/kernel/proc.c +1 −3
  164. arch/tile/kernel/single_step.c +1 −3
  165. arch/tile/kernel/smpboot.c +2 −0
  166. arch/um/drivers/cow.h +0 −35
  167. arch/um/drivers/cow_user.c +21 −22
  168. arch/um/drivers/mconsole_kern.c +1 −0
  169. arch/um/include/asm/Kbuild +2 −1
  170. arch/um/kernel/Makefile +4 −3
  171. arch/um/kernel/process.c +1 −5
  172. arch/um/kernel/skas/mmu.c +0 −1
  173. arch/x86/Makefile.um +3 −0
  174. arch/x86/boot/compressed/head_32.S +11 −3
  175. arch/x86/boot/compressed/head_64.S +16 −6
  176. arch/x86/boot/tools/build.c +11 −4
  177. arch/x86/ia32/ia32_aout.c +8 −24
  178. arch/x86/include/asm/cmpxchg.h +2 −2
  179. arch/x86/include/asm/posix_types.h +3 −3
  180. arch/x86/include/asm/sigcontext.h +1 −1
  181. arch/x86/include/asm/siginfo.h +7 −1
  182. arch/x86/include/asm/uaccess.h +2 −0
  183. arch/x86/include/asm/uaccess_32.h +0 −5
  184. arch/x86/include/asm/uaccess_64.h +0 −4
  185. arch/x86/include/asm/unistd.h +3 −3
  186. arch/x86/include/asm/x86_init.h +0 −1
  187. arch/x86/kernel/acpi/sleep.c +4 −0
  188. arch/x86/kernel/acpi/sleep.h +4 −0
  189. arch/x86/kernel/acpi/wakeup_32.S +1 −3
  190. arch/x86/kernel/acpi/wakeup_64.S +1 −3
  191. arch/x86/kernel/apic/apic.c +20 −14
  192. arch/x86/kernel/apic/apic_numachip.c +5 −2
  193. arch/x86/kernel/apic/x2apic_phys.c +6 −0
  194. arch/x86/kernel/cpu/amd.c +6 −5
  195. arch/x86/kernel/cpu/common.c +0 −9
  196. arch/x86/kernel/cpu/intel_cacheinfo.c +4 −4
  197. arch/x86/kernel/i387.c +1 −0
  198. arch/x86/kernel/microcode_amd.c +7 −5
  199. arch/x86/kernel/microcode_core.c +4 −6
  200. arch/x86/kernel/vsyscall_64.c +3 −3
  201. arch/x86/kernel/x86_init.c +0 −1
  202. arch/x86/kvm/pmu.c +9 −9
  203. arch/x86/kvm/vmx.c +4 −1
  204. arch/x86/kvm/x86.c +2 −6
  205. arch/x86/lib/insn.c +36 −17
  206. arch/x86/lib/usercopy.c +103 −0
  207. arch/x86/lib/usercopy_32.c +0 −87
  208. arch/x86/lib/usercopy_64.c +0 −49
  209. arch/x86/platform/mrst/mrst.c +2 −2
  210. arch/x86/um/asm/barrier.h +75 −0
  211. arch/x86/um/asm/system.h +0 −135
  212. arch/x86/xen/enlighten.c +2 −2
  213. arch/x86/xen/smp.c +15 −0
  214. arch/x86/xen/xen-asm.S +1 −1
  215. arch/xtensa/include/asm/hardirq.h +0 −3
  216. arch/xtensa/include/asm/io.h +1 −0
  217. arch/xtensa/kernel/signal.c +1 −0
  218. block/blk-core.c +3 −2
  219. block/blk-throttle.c +1 −1
  220. block/cfq-iosched.c +8 −2
  221. crypto/Kconfig +3 −3
  222. crypto/sha512_generic.c +1 −1
  223. drivers/acpi/acpica/hwxface.c +2 −1
  224. drivers/acpi/osl.c +1 −2
  225. drivers/acpi/reboot.c +2 −1
  226. drivers/acpi/sleep.c +28 −24
  227. drivers/amba/bus.c +1 −41
  228. drivers/ata/ata_piix.c +2 −0
  229. drivers/ata/libata-core.c +2 −2
  230. drivers/ata/libata-scsi.c +2 −2
  231. drivers/ata/libata-transport.c +1 −0
  232. drivers/ata/libata.h +1 −1
  233. drivers/ata/sata_mv.c +2 −1
  234. drivers/base/soc.c +1 −3
  235. drivers/bcma/Kconfig +1 −1
  236. drivers/bcma/driver_pci_host.c +1 −0
  237. drivers/bcma/sprom.c +5 −2
  238. drivers/block/cciss_scsi.c +2 −1
  239. drivers/block/mtip32xx/Kconfig +1 −1
  240. drivers/block/mtip32xx/mtip32xx.c +664 −196
  241. drivers/block/mtip32xx/mtip32xx.h +45 −13
  242. drivers/block/virtio_blk.c +30 −12
  243. drivers/block/xen-blkback/blkback.c +13 −37
  244. drivers/block/xen-blkback/common.h +0 −6
  245. drivers/block/xen-blkback/xenbus.c +32 −57
  246. drivers/block/xen-blkfront.c +20 −21
  247. drivers/bluetooth/ath3k.c +4 −0
  248. drivers/bluetooth/btusb.c +4 −1
  249. drivers/bluetooth/hci_ldisc.c +1 −1
  250. drivers/char/hpet.c +2 −2
  251. drivers/char/random.c +8 −3
  252. drivers/clocksource/acpi_pm.c +8 −16
  253. drivers/cpufreq/Kconfig.arm +1 −0
  254. drivers/crypto/ixp4xx_crypto.c +1 −0
  255. drivers/crypto/talitos.c +17 −3
  256. drivers/dma/Kconfig +2 −3
  257. drivers/dma/amba-pl08x.c +1 −0
  258. drivers/dma/at_hdmac.c +0 −4
  259. drivers/dma/dmaengine.c +14 −0
  260. drivers/dma/imx-dma.c +6 −3
  261. drivers/dma/ioat/dma.c +8 −8
  262. drivers/dma/ioat/dma.h +3 −3
  263. drivers/dma/ioat/dma_v2.c +6 −6
  264. drivers/dma/ioat/dma_v2.h +2 −2
  265. drivers/dma/ioat/dma_v3.c +45 −4
  266. drivers/dma/iop-adma.c +2 −2
  267. drivers/dma/mxs-dma.c +3 −7
  268. drivers/dma/pl330.c +15 −10
  269. drivers/dma/ste_dma40.c +201 −122
  270. drivers/dma/ste_dma40_ll.h +0 −2
  271. drivers/gpio/Kconfig +1 −1
  272. drivers/gpio/gpio-adp5588.c +1 −1
  273. drivers/gpio/gpio-pxa.c +19 −2
  274. drivers/gpio/gpio-samsung.c +8 −8
  275. drivers/gpio/gpio-sodaville.c +10 −13
  276. drivers/gpu/drm/drm_bufs.c +4 −8
  277. drivers/gpu/drm/drm_crtc.c +6 −4
  278. drivers/gpu/drm/drm_fops.c +3 −3
  279. drivers/gpu/drm/drm_usb.c +5 −1
  280. drivers/gpu/drm/exynos/exynos_drm_buf.c +14 −33
  281. drivers/gpu/drm/exynos/exynos_drm_core.c +8 −6
  282. drivers/gpu/drm/exynos/exynos_drm_drv.h +5 −5
  283. drivers/gpu/drm/exynos/exynos_drm_fimd.c +12 −8
  284. drivers/gpu/drm/exynos/exynos_drm_gem.c +42 −37
  285. drivers/gpu/drm/exynos/exynos_drm_gem.h +2 −0
  286. drivers/gpu/drm/exynos/exynos_drm_hdmi.c +48 −59
  287. drivers/gpu/drm/exynos/exynos_drm_hdmi.h +9 −14
  288. drivers/gpu/drm/exynos/exynos_drm_plane.c +4 −0
  289. drivers/gpu/drm/exynos/exynos_drm_vidi.c +12 −8
  290. drivers/gpu/drm/exynos/exynos_hdmi.c +20 −22
  291. drivers/gpu/drm/exynos/exynos_mixer.c +19 −21
  292. drivers/gpu/drm/gma500/mdfld_dsi_output.h +0 −1
  293. drivers/gpu/drm/i810/i810_dma.c +2 −4
  294. drivers/gpu/drm/i915/i915_drv.c +1 −1
  295. drivers/gpu/drm/i915/i915_gem.c +3 −3
  296. drivers/gpu/drm/i915/i915_gem_execbuffer.c +7 −1
  297. drivers/gpu/drm/i915/i915_reg.h +4 −0
  298. drivers/gpu/drm/i915/intel_crt.c +11 −18
  299. drivers/gpu/drm/i915/intel_display.c +62 −22
  300. drivers/gpu/drm/i915/intel_dp.c +35 −14
  301. drivers/gpu/drm/i915/intel_drv.h +4 −0
  302. drivers/gpu/drm/i915/intel_fb.c +4 −0
  303. drivers/gpu/drm/i915/intel_i2c.c +1 −1
  304. drivers/gpu/drm/i915/intel_lvds.c +6 −0
  305. drivers/gpu/drm/i915/intel_panel.c +0 −2
  306. drivers/gpu/drm/i915/intel_ringbuffer.c +9 −1
  307. drivers/gpu/drm/i915/intel_sdvo.c +18 −16
  308. drivers/gpu/drm/i915/intel_sprite.c +0 −1
  309. drivers/gpu/drm/nouveau/nouveau_pm.c +1 −0
  310. drivers/gpu/drm/nouveau/nv50_sor.c +1 −1
  311. drivers/gpu/drm/radeon/atombios_crtc.c +5 −2
  312. drivers/gpu/drm/radeon/atombios_encoders.c +4 −0
  313. drivers/gpu/drm/radeon/r100.c +1 −1
  314. drivers/gpu/drm/radeon/r600.c +3 −3
  315. drivers/gpu/drm/radeon/r600_cp.c +3 −3
  316. drivers/gpu/drm/radeon/radeon_clocks.c +12 −12
  317. drivers/gpu/drm/radeon/radeon_combios.c +4 −4
  318. drivers/gpu/drm/radeon/radeon_connectors.c +2 −2
  319. drivers/gpu/drm/radeon/radeon_display.c +2 −1
  320. drivers/gpu/drm/radeon/radeon_i2c.c +4 −0
  321. drivers/gpu/drm/radeon/radeon_irq_kms.c +6 −0
  322. drivers/gpu/drm/radeon/radeon_legacy_encoders.c +6 −6
  323. drivers/gpu/drm/radeon/rv770.c +2 −2
  324. drivers/gpu/drm/radeon/si.c +2 −3
  325. drivers/gpu/drm/savage/savage_state.c +3 −3
  326. drivers/hid/Kconfig +1 −1
  327. drivers/hid/hid-tivo.c +1 −1
  328. drivers/hsi/clients/hsi_char.c +1 −1
  329. drivers/hsi/hsi.c +118 −105
  330. drivers/hwmon/acpi_power_meter.c +1 −0
  331. drivers/hwmon/ad7314.c +5 −7
  332. drivers/hwmon/ads1015.c +16 −17
  333. drivers/hwmon/fam15h_power.c +42 −0
  334. drivers/hwmon/pmbus/pmbus_core.c +8 −9
  335. drivers/hwmon/smsc47b397.c +8 −6
  336. drivers/hwmon/smsc47m1.c +10 −9
  337. drivers/i2c/busses/i2c-designware-pcidrv.c +0 −1
  338. drivers/infiniband/core/mad.c +5 −3
  339. drivers/infiniband/core/sysfs.c +5 −4
  340. drivers/infiniband/hw/mlx4/main.c +6 −1
  341. drivers/infiniband/ulp/srpt/ib_srpt.c +1 −0
  342. drivers/input/misc/Kconfig +1 −2
  343. drivers/input/misc/da9052_onkey.c +2 −1
  344. drivers/input/misc/twl6040-vibra.c +2 −2
  345. drivers/input/mouse/elantech.c +8 −2
  346. drivers/input/mouse/gpio_mouse.c +1 −1
  347. drivers/input/mouse/sentelic.c +8 −0
  348. drivers/input/mouse/trackpoint.c +8 −6
  349. drivers/input/touchscreen/tps6507x-ts.c +1 −3
  350. drivers/isdn/gigaset/interface.c +1 −1
  351. drivers/leds/leds-atmel-pwm.c +1 −1
  352. drivers/md/bitmap.c +2 −3
  353. drivers/md/dm-raid.c +2 −2
  354. drivers/md/md.c +4 −3
  355. drivers/md/raid1.c +2 −1
  356. drivers/md/raid10.c +2 −2
  357. drivers/media/common/tuners/xc5000.c +35 −4
  358. drivers/media/common/tuners/xc5000.h +1 −0
  359. drivers/media/dvb/dvb-core/dvb_frontend.c +35 −2
  360. drivers/media/dvb/dvb-usb/it913x.c +40 −14
  361. drivers/media/dvb/frontends/drxk_hard.c +4 −2
  362. drivers/media/rc/winbond-cir.c +1 −0
  363. drivers/media/video/Kconfig +1 −1
  364. drivers/media/video/ivtv/ivtv-ioctl.c +2 −2
  365. drivers/media/video/mt9m032.c +3 −2
  366. drivers/media/video/uvc/uvc_video.c +32 −18
  367. drivers/mfd/Kconfig +9 −2
  368. drivers/mfd/asic3.c +3 −1
  369. drivers/mfd/db8500-prcmu.c +1 −0
  370. drivers/mfd/omap-usb-host.c +0 −44
  371. drivers/mfd/rc5t583.c +1 −38
  372. drivers/mfd/twl6040-core.c +68 −46
  373. drivers/mmc/card/block.c +39 −17
  374. drivers/mmc/card/queue.c +1 −1
  375. drivers/mmc/core/bus.c +8 −16
  376. drivers/mmc/core/cd-gpio.c +1 −0
  377. drivers/mmc/core/core.c +26 −38
  378. drivers/mmc/host/dw_mmc.c +5 −2
  379. drivers/mmc/host/mxs-mmc.c +3 −0
  380. drivers/mmc/host/omap_hsmmc.c +3 −3
  381. drivers/mmc/host/sdhci-esdhc-imx.c +1 −2
  382. drivers/mmc/host/sdhci.c +1 −1
  383. drivers/mtd/mtdchar.c +10 −10
  384. drivers/mtd/nand/gpmi-nand/gpmi-nand.c +1 −0
  385. drivers/net/arcnet/arc-rimi.c +4 −4
  386. drivers/net/caif/caif_hsi.c +5 −4
  387. drivers/net/can/usb/peak_usb/pcan_usb_pro.c +2 −0
  388. drivers/net/dummy.c +3 −3
  389. drivers/net/ethernet/atheros/atlx/atl1.c +5 −7
  390. drivers/net/ethernet/atheros/atlx/atl1.h +1 −2
  391. drivers/net/ethernet/atheros/atlx/atlx.c +1 −1
  392. drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +6 −6
  393. drivers/net/ethernet/intel/e1000e/ich8lan.c +10 −5
  394. drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c +10 −0
  395. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +12 −8
  396. drivers/net/ethernet/micrel/ks8851.c +11 −10
  397. drivers/net/ethernet/micrel/ks8851_mll.c +1 −1
  398. drivers/net/ethernet/micrel/ksz884x.c +1 −1
  399. drivers/net/ethernet/realtek/8139cp.c +8 −2
  400. drivers/net/ethernet/smsc/smsc911x.c +6 −11
  401. drivers/net/ethernet/ti/davinci_mdio.c +5 −0
  402. drivers/net/ethernet/xilinx/xilinx_axienet.h +1 −3
  403. drivers/net/ethernet/xilinx/xilinx_axienet_main.c +3 −3
  404. drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c +3 −3
  405. drivers/net/hyperv/netvsc_drv.c +14 −24
  406. drivers/net/phy/icplus.c +11 −1
  407. drivers/net/ppp/ppp_generic.c +6 −9
  408. drivers/net/usb/qmi_wwan.c +30 −0
  409. drivers/net/usb/smsc75xx.c +1 −0
  410. drivers/net/virtio_net.c +2 −3
  411. drivers/net/wan/farsync.c +1 −0
  412. drivers/net/wireless/ath/ath5k/ahb.c +5 −2
  413. drivers/net/wireless/ath/ath9k/main.c +11 −6
  414. drivers/net/wireless/ath/ath9k/xmit.c +9 −1
  415. drivers/net/wireless/brcm80211/brcmsmac/main.c +8 −0
  416. drivers/net/wireless/libertas/cfg.c +7 −2
  417. drivers/net/wireless/mwifiex/pcie.h +9 −9
  418. drivers/net/wireless/rt2x00/rt2x00dev.c +1 −5
  419. drivers/net/wireless/rtlwifi/base.c +4 −1
  420. drivers/net/wireless/rtlwifi/pci.c +6 −1
  421. drivers/net/wireless/rtlwifi/rtl8192de/sw.c +0 −6
  422. drivers/net/wireless/rtlwifi/usb.c +16 −18
  423. drivers/net/wireless/rtlwifi/wifi.h +5 −1
  424. drivers/of/gpio.c +1 −1
  425. drivers/pci/Makefile +1 −0
  426. drivers/pci/pci.c +49 −22
  427. drivers/pinctrl/core.c +21 −4
  428. drivers/platform/x86/acerhdf.c +45 −22
  429. drivers/platform/x86/dell-laptop.c +1 −0
  430. drivers/platform/x86/intel_ips.c +1 −1
  431. drivers/regulator/anatop-regulator.c +3 −3
  432. drivers/rtc/rtc-ds1307.c +1 −0
  433. drivers/rtc/rtc-efi.c +0 −1
  434. drivers/rtc/rtc-pl031.c +1 −2
  435. drivers/rtc/rtc-r9701.c +22 −0
  436. drivers/rtc/rtc-s3c.c +22 −9
  437. drivers/rtc/rtc-twl.c +38 −5
  438. drivers/s390/block/dasd_eckd.c +16 −8
  439. drivers/s390/char/vmur.c +1 −1
  440. drivers/scsi/scsi_error.c +1 −1
  441. drivers/spi/Kconfig +1 −1
  442. drivers/spi/Makefile +1 −1
  443. drivers/spi/spi-bcm63xx.c +92 −71
  444. drivers/spi/spi-bfin-sport.c +11 −10
  445. drivers/spi/spi-bfin5xx.c +8 −6
  446. drivers/spi/spi-davinci.c +3 −3
  447. drivers/spi/spi-ep93xx.c +10 −14
  448. drivers/spi/spi-fsl-spi.c +3 −1
  449. drivers/spi/spi-imx.c +8 −4
  450. drivers/spi/spi-pl022.c +34 −26
  451. drivers/staging/android/Kconfig +2 −1
  452. drivers/staging/android/lowmemorykiller.c +7 −41
  453. drivers/staging/android/persistent_ram.c +7 −4
  454. drivers/staging/android/timed_gpio.c +15 −12
  455. drivers/staging/iio/inkern.c +1 −0
  456. drivers/staging/iio/magnetometer/ak8975.c +5 −3
  457. drivers/staging/iio/magnetometer/hmc5843.c +3 −1
  458. drivers/staging/media/as102/as102_fw.c +1 −1
  459. drivers/staging/octeon/ethernet-rx.c +1 −0
  460. drivers/staging/octeon/ethernet-tx.c +1 −0
  461. drivers/staging/octeon/ethernet.c +1 −0
  462. drivers/staging/omapdrm/omap_drv.c +4 −3
  463. drivers/staging/ozwpan/TODO +3 −1
  464. drivers/staging/ozwpan/ozpd.c +0 −2
  465. drivers/staging/ramster/Kconfig +1 −5
  466. drivers/staging/rts_pstor/ms.c +2 −1
  467. drivers/staging/rts_pstor/rtsx.c +5 −0
  468. drivers/staging/rts_pstor/rtsx_transport.c +6 −5
  469. drivers/staging/sep/sep_main.c +3 −3
  470. drivers/staging/tidspbridge/core/tiomap3430.c +12 −8
  471. drivers/staging/tidspbridge/core/wdt.c +7 −1
  472. drivers/staging/vme/devices/vme_pio2_core.c +2 −2
  473. drivers/staging/vt6655/key.c +3 −0
  474. drivers/staging/vt6656/ioctl.c +2 −1
  475. drivers/staging/vt6656/key.c +3 −0
  476. drivers/staging/xgifb/vb_init.c +1 −1
  477. drivers/staging/xgifb/vb_setmode.c +7 −0
  478. drivers/staging/xgifb/vb_table.h +10 −1
  479. drivers/staging/zcache/Kconfig +1 −1
  480. drivers/staging/zsmalloc/zsmalloc-main.c +18 −12
  481. drivers/tty/amiserial.c +3 −1
  482. drivers/tty/serial/8250/8250.c +6 −6
  483. drivers/tty/serial/8250/8250_pci.c +1 −15
  484. drivers/tty/serial/Kconfig +1 −1
  485. drivers/tty/serial/altera_uart.c +2 −2
  486. drivers/tty/serial/amba-pl011.c +4 −4
  487. drivers/tty/serial/atmel_serial.c +4 −0
  488. drivers/tty/serial/clps711x.c +8 −6
  489. drivers/tty/serial/omap-serial.c +20 −23
  490. drivers/tty/serial/pch_uart.c +11 −1
  491. drivers/tty/serial/samsung.c +1 −0
  492. drivers/tty/vt/vt.c +1 −2
  493. drivers/usb/Kconfig +8 −8
  494. drivers/usb/class/cdc-wdm.c +5 −2
  495. drivers/usb/core/driver.c +7 −2
  496. drivers/usb/core/hcd-pci.c +9 −0
  497. drivers/usb/core/hcd.c +12 −0
  498. drivers/usb/core/hub.c +16 −3
  499. drivers/usb/core/message.c +9 −8
  500. drivers/usb/core/urb.c +12 −0
  501. drivers/usb/dwc3/core.c +3 −3
  502. drivers/usb/dwc3/ep0.c +10 −2
  503. drivers/usb/gadget/at91_udc.c +4 −4
  504. drivers/usb/gadget/dummy_hcd.c +0 −1
  505. drivers/usb/gadget/f_fs.c +2 −1
  506. drivers/usb/gadget/f_mass_storage.c +1 −1
  507. drivers/usb/gadget/f_rndis.c +1 −0
  508. drivers/usb/gadget/file_storage.c +1 −1
  509. drivers/usb/gadget/fsl_udc_core.c +16 −9
  510. drivers/usb/gadget/g_ffs.c +2 −2
  511. drivers/usb/gadget/inode.c +0 −1
  512. drivers/usb/gadget/s3c-hsotg.c +10 −7
  513. drivers/usb/gadget/udc-core.c +5 −1
  514. drivers/usb/gadget/uvc.h +1 −1
  515. drivers/usb/gadget/uvc_queue.c +1 −3
  516. drivers/usb/gadget/uvc_v4l2.c +1 −1
  517. drivers/usb/host/ehci-fsl.c +6 −1
  518. drivers/usb/host/ehci-hcd.c +10 −2
  519. drivers/usb/host/ehci-hub.c +16 −15
  520. drivers/usb/host/ehci-omap.c +37 −2
  521. drivers/usb/host/ehci-pci.c +8 −0
  522. drivers/usb/host/ehci-tegra.c +2 −1
  523. drivers/usb/host/ehci.h +2 −0
  524. drivers/usb/host/ohci-at91.c +6 −6
  525. drivers/usb/host/pci-quirks.c +7 −3
  526. drivers/usb/host/uhci-hub.c +3 −2
  527. drivers/usb/host/xhci-dbg.c +1 −1
  528. drivers/usb/host/xhci-ext-caps.h +3 −2
  529. drivers/usb/host/xhci-mem.c +2 −7
  530. drivers/usb/host/xhci-pci.c +3 −1
  531. drivers/usb/host/xhci-ring.c +3 −3
  532. drivers/usb/host/xhci.c +8 −4
  533. drivers/usb/host/xhci.h +4 −0
  534. drivers/usb/misc/usbtest.c +6 −3
  535. drivers/usb/misc/yurex.c +3 −7
  536. drivers/usb/musb/davinci.c +2 −1
  537. drivers/usb/musb/musb_core.c +33 −7
  538. drivers/usb/musb/musb_core.h +1 −1
  539. drivers/usb/musb/musb_host.c +1 −1
  540. drivers/usb/musb/omap2430.c +18 −13
  541. drivers/usb/otg/gpio_vbus.c +14 −1
  542. drivers/usb/serial/bus.c +0 −5
  543. drivers/usb/serial/cp210x.c +6 −3
  544. drivers/usb/serial/ftdi_sio.c +20 −16
  545. drivers/usb/serial/metro-usb.c +3 −3
  546. drivers/usb/serial/option.c +1 −0
  547. drivers/usb/serial/pl2303.c +1 −1
  548. drivers/usb/serial/sierra.c +4 −1
  549. drivers/usb/serial/usb-serial.c +10 −21
  550. drivers/usb/storage/usb.c +30 −0
  551. drivers/uwb/hwa-rc.c +2 −1
  552. drivers/uwb/neh.c +11 −1
  553. drivers/vhost/net.c +1 −1
  554. drivers/vhost/test.c +1 −1
  555. drivers/vhost/vhost.c +2 −3
  556. drivers/vhost/vhost.h +1 −1
  557. drivers/video/au1100fb.c +3 −2
  558. drivers/video/au1200fb.c +1 −1
  559. drivers/video/bfin-lq035q1-fb.c +1 −0
  560. drivers/video/kyro/STG4000Reg.h +188 −188
  561. drivers/video/msm/mddi.c +4 −4
  562. drivers/video/uvesafb.c +9 −2
  563. drivers/virtio/virtio_balloon.c +46 −12
  564. drivers/watchdog/hpwdt.c +3 −3
  565. drivers/xen/events.c +1 −1
  566. drivers/xen/gntdev.c +1 −1
  567. drivers/xen/grant-table.c +9 −4
  568. drivers/xen/manage.c +1 −0
  569. drivers/xen/xen-acpi-processor.c +4 −1
  570. drivers/xen/xenbus/xenbus_probe_frontend.c +53 −16
  571. fs/aio.c +13 −3
  572. fs/autofs4/autofs_i.h +11 −1
  573. fs/autofs4/dev-ioctl.c +1 −2
  574. fs/autofs4/inode.c +1 −3
  575. fs/autofs4/waitq.c +3 −19
  576. fs/binfmt_aout.c +8 −24
  577. fs/binfmt_elf.c +6 −17
  578. fs/binfmt_elf_fdpic.c +4 −14
  579. fs/binfmt_flat.c +3 −9
  580. fs/binfmt_som.c +3 −9
  581. fs/btrfs/backref.c +20 −7
  582. fs/btrfs/compression.c +2 −0
  583. fs/btrfs/ctree.h +2 −2
  584. fs/btrfs/disk-io.c +11 −11
  585. fs/btrfs/extent-tree.c +11 −15
  586. fs/btrfs/extent_io.c +33 −29
  587. fs/btrfs/extent_io.h +2 −2
  588. fs/btrfs/file.c +7 −2
  589. fs/btrfs/free-space-cache.c +2 −7
  590. fs/btrfs/inode.c +18 −36
  591. fs/btrfs/ioctl.c +4 −1
  592. fs/btrfs/reada.c +29 −19
  593. fs/btrfs/relocation.c +3 −1
  594. fs/btrfs/scrub.c +4 −15
  595. fs/btrfs/super.c +4 −3
  596. fs/btrfs/transaction.c +10 −5
  597. fs/btrfs/volumes.c +27 −6
  598. fs/buffer.c +0 −1
  599. fs/cifs/cifsfs.c +8 −4
  600. fs/cifs/connect.c +26 −68
  601. fs/cifs/file.c +2 −1
  602. fs/dlm/lock.c +12 −0
  603. fs/eventpoll.c +3 −1
  604. fs/ext4/ext4.h +0 −3
  605. fs/ext4/extents.c +1 −5
  606. fs/ext4/super.c +17 −33
  607. fs/fuse/dir.c +15 −10
  608. fs/fuse/file.c +112 −17
  609. fs/fuse/inode.c +1 −0
  610. fs/gfs2/Kconfig +2 −5
  611. fs/gfs2/aops.c +2 −2
  612. fs/gfs2/bmap.c +5 −1
  613. fs/gfs2/dir.c +4 −0
  614. fs/gfs2/inode.c +11 −2
  615. fs/gfs2/lock_dlm.c +7 −3
  616. fs/gfs2/rgrp.c +5 −3
  617. fs/gfs2/xattr.c +12 −0
  618. fs/hugetlbfs/inode.c +1 −0
  619. fs/jbd2/commit.c +2 −2
  620. fs/libfs.c +1 −0
  621. fs/lockd/clnt4xdr.c +1 −1
  622. fs/lockd/clntxdr.c +1 −1
  623. fs/nfs/dir.c +2 −2
  624. fs/nfs/nfs4_fs.h +1 −0
  625. fs/nfs/nfs4proc.c +36 −8
  626. fs/nfs/nfs4state.c +19 −12
  627. fs/nfs/nfs4xdr.c +5 −4
  628. fs/nfs/read.c +1 −1
  629. fs/nfs/super.c +6 −2
  630. fs/nfs/write.c +3 −2
  631. fs/nfsd/nfs3xdr.c +8 −14
  632. fs/nfsd/nfs4proc.c +8 −7
  633. fs/nfsd/nfs4state.c +9 −14
  634. fs/nfsd/nfs4xdr.c +2 −2
  635. fs/nfsd/vfs.c +1 −1
  636. fs/ocfs2/alloc.c +1 −1
  637. fs/ocfs2/refcounttree.c +6 −6
  638. fs/ocfs2/suballoc.c +2 −2
  639. fs/pipe.c +29 −2
  640. fs/proc/stat.c +28 −6
  641. fs/proc/task_mmu.c +0 −3
  642. fs/sysfs/dir.c +4 −1
  643. fs/sysfs/group.c +5 −1
  644. include/asm-generic/siginfo.h +11 −3
  645. include/drm/exynos_drm.h +3 −2
  646. include/linux/amba/bus.h +0 −7
  647. include/linux/amba/pl022.h +2 −0
  648. include/linux/blkdev.h +7 −11
  649. include/linux/dmaengine.h +1 −0
  650. include/linux/fuse.h +1 −1
  651. include/linux/gpio-pxa.h +4 −0
  652. include/linux/hsi/hsi.h +17 −14
  653. include/linux/i2c/twl.h +0 −12
  654. include/linux/irq.h +12 −0
  655. include/linux/irqdomain.h +4 −8
  656. include/linux/kconfig.h +18 −4
  657. include/linux/kvm_host.h +6 −0
  658. include/linux/mfd/db5500-prcmu.h +37 −51
  659. include/linux/mfd/rc5t583.h +39 −8
  660. include/linux/mfd/twl6040.h +27 −0
  661. include/linux/mm.h +9 −18
  662. include/linux/mmc/card.h +1 −1
  663. include/linux/netfilter_ipv6/ip6_tables.h +11 −1
  664. include/linux/nfs_xdr.h +6 −1
  665. include/linux/nfsd/Kbuild +1 −0
  666. include/linux/pinctrl/machine.h +3 −1
  667. include/linux/pipe_fs_i.h +1 −0
  668. include/linux/serial_core.h +1 −1
  669. include/linux/skbuff.h +17 −3
  670. include/linux/spi/spi.h +1 −1
  671. include/linux/stddef.h +2 −6
  672. include/linux/types.h +6 −0
  673. include/linux/usb/hcd.h +2 −0
  674. include/linux/usb/otg.h +1 −0
  675. include/linux/usb/serial.h +0 −8
  676. include/linux/vgaarb.h +2 −0
  677. include/linux/vm_event_item.h +3 −2
  678. include/net/bluetooth/hci.h +2 −1
  679. include/net/bluetooth/hci_core.h +7 −5
  680. include/net/bluetooth/mgmt.h +1 −1
  681. include/net/dst.h +5 −1
  682. include/net/ip6_fib.h +48 −0
  683. include/net/mac80211.h +1 −1
  684. include/net/red.h +3 −3
  685. include/net/sock.h +1 −0
  686. include/scsi/scsi_cmnd.h +3 −0
  687. include/sound/core.h +10 −0
  688. init/main.c +13 −12
  689. kernel/cred.c +2 −0
  690. kernel/events/core.c +1 −1
  691. kernel/irq/Kconfig +1 −1
  692. kernel/irq/debug.h +19 −19
  693. kernel/irq/irqdomain.c +17 −30
  694. kernel/irq_work.c +1 −0
  695. kernel/itimer.c +6 −2
  696. kernel/panic.c +1 −1
  697. kernel/power/swap.c +22 −6
  698. kernel/rcutree.c +0 −1
  699. kernel/sched/core.c +16 −6
  700. kernel/sched/fair.c +10 −8
  701. kernel/sched/features.h +1 −0
  702. kernel/time/Kconfig +4 −0
  703. kernel/time/tick-broadcast.c +6 −5
  704. kernel/time/tick-sched.c +2 −2
  705. kernel/trace/trace.c +5 −3
  706. kernel/trace/trace.h +2 −2
  707. kernel/trace/trace_output.c +5 −0
  708. lib/kobject.c +7 −7
  709. lib/mpi/mpi-bit.c +3 −2
  710. mm/hugetlb.c +3 −1
  711. mm/memblock.c +6 −1
  712. mm/memcontrol.c +8 −14
  713. mm/mempolicy.c +7 −4
  714. mm/migrate.c +8 −8
  715. mm/mmap.c +50 −9
  716. mm/nobootmem.c +8 −2
  717. mm/nommu.c +36 −5
  718. mm/swap_state.c +1 −1
  719. mm/vmscan.c +9 −9
  720. mm/vmstat.c +2 −2
  721. net/ax25/af_ax25.c +5 −4
  722. net/bluetooth/hci_core.c +7 −0
  723. net/bluetooth/l2cap_core.c +3 −0
  724. net/bluetooth/l2cap_sock.c +3 −2
  725. net/bluetooth/mgmt.c +9 −4
  726. net/bridge/br_multicast.c +0 −81
  727. net/bridge/br_private.h +0 −4
  728. net/caif/chnl_net.c +6 −3
  729. net/core/dev.c +20 −0
  730. net/core/drop_monitor.c +1 −0
  731. net/core/net_namespace.c +18 −15
  732. net/core/skbuff.c +3 −1
  733. net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +10 −2
  734. net/ipv4/tcp.c +7 −8
  735. net/ipv4/tcp_input.c +7 −3
  736. net/ipv4/tcp_ipv4.c +1 −1
  737. net/ipv4/tcp_output.c +2 −1
  738. net/ipv6/addrconf.c +3 −6
  739. net/ipv6/ip6_fib.c +4 −5
  740. net/ipv6/ndisc.c +1 −2
  741. net/ipv6/netfilter/ip6_tables.c +0 −14
  742. net/ipv6/route.c +44 −27
  743. net/ipv6/tcp_ipv6.c +5 −1
  744. net/key/af_key.c +1 −1
  745. net/l2tp/l2tp_ip.c +3 −2
  746. net/mac80211/ibss.c +2 −2
  747. net/mac80211/mlme.c +1 −2
  748. net/mac80211/rx.c +6 −4
  749. net/netfilter/nf_conntrack_core.c +1 −1
  750. net/netfilter/nf_conntrack_proto_tcp.c +2 −2
  751. net/nfc/llcp/commands.c +2 −2
  752. net/phonet/pn_dev.c +2 −19
  753. net/sched/sch_gred.c +2 −5
  754. net/sunrpc/sunrpc_syms.c +9 −8
  755. net/wireless/nl80211.c +18 −13
  756. net/wireless/util.c +1 −1
  757. net/wireless/wext-core.c +4 −2
  758. scripts/checkpatch.pl +0 −6
  759. scripts/kconfig/confdata.c +2 −36
  760. scripts/mod/file2alias.c +4 −0
  761. scripts/mod/modpost.c +5 −2
  762. scripts/mod/modpost.h +1 −0
  763. scripts/xz_wrap.sh +2 −2
  764. security/commoncap.c +6 −0
  765. security/smack/smack_lsm.c +48 −15
  766. security/smack/smackfs.c +0 −14
  767. sound/core/vmaster.c +1 −0
  768. sound/isa/sscape.c +4 −2
  769. sound/last.c +1 −1
  770. sound/oss/msnd_pinnacle.c +6 −2
  771. sound/pci/Kconfig +2 −2
  772. sound/pci/asihpi/hpi_internal.h +2 −2
  773. sound/pci/asihpi/hpios.c +5 −5
  774. sound/pci/hda/hda_codec.h +3 −0
  775. sound/pci/hda/hda_eld.c +3 −3
  776. sound/pci/hda/hda_proc.c +10 −3
  777. sound/pci/hda/patch_conexant.c +71 −72
  778. sound/pci/hda/patch_hdmi.c +4 −5
  779. sound/pci/hda/patch_realtek.c +72 −14
  780. sound/pci/hda/patch_sigmatel.c +2 −3
  781. sound/soc/codecs/Kconfig +1 −2
  782. sound/soc/codecs/ak4642.c +1 −1
  783. sound/soc/codecs/cs42l73.c +2 −0
  784. sound/soc/codecs/sgtl5000.c +13 −12
  785. sound/soc/codecs/twl6040.c +1 −2
  786. sound/soc/codecs/wm8994.c +222 −54
  787. sound/soc/imx/imx-audmux.c +4 −1
  788. sound/soc/omap/Kconfig +1 −1
  789. sound/soc/pxa/pxa2xx-i2s.c +1 −0
  790. sound/soc/sh/fsi.c +3 −4
  791. sound/soc/soc-core.c +3 −0
  792. sound/soc/soc-dapm.c +2 −0
  793. sound/soc/tegra/tegra_i2s.c +5 −1
  794. sound/soc/tegra/tegra_spdif.c +4 −0
  795. tools/perf/.gitignore +2 −0
  796. tools/perf/Makefile +11 −14
  797. tools/perf/builtin-report.c +12 −5
  798. tools/perf/builtin-sched.c +1 −0
  799. tools/perf/builtin-test.c +30 −0
  800. tools/perf/builtin-top.c +35 −1
  801. tools/perf/perf-archive.sh +2 −1
  802. tools/perf/util/annotate.c +6 −10
  803. tools/perf/util/hist.c +12 −0
  804. tools/perf/util/map.c +1 −0
  805. tools/perf/util/map.h +1 −0
  806. tools/perf/util/parse-events.l +1 −1
  807. tools/perf/util/session.c +12 −4
  808. tools/perf/util/symbol.c +6 −7
  809. tools/perf/util/ui/browsers/hists.c +3 −0
  810. virt/kvm/iommu.c +21 −9
  811. virt/kvm/kvm_main.c +3 −2
Documentation/ABI/stable/sysfs-driver-usb-usbtmc+7−7
@@ -1,5 +1,5 @@
1−What: /sys/bus/usb/drivers/usbtmc/devices/*/interface_capabilities
2−What: /sys/bus/usb/drivers/usbtmc/devices/*/device_capabilities
1+What: /sys/bus/usb/drivers/usbtmc/*/interface_capabilities
2+What: /sys/bus/usb/drivers/usbtmc/*/device_capabilities
33 Date: August 2008
44 Contact: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
55 Description:
@@ -12,8 +12,8 @@ Description: · 6 unmodified lines
1212 The files are read only.
1313
1414
15−What: /sys/bus/usb/drivers/usbtmc/devices/*/usb488_interface_capabilities
16−What: /sys/bus/usb/drivers/usbtmc/devices/*/usb488_device_capabilities
15+What: /sys/bus/usb/drivers/usbtmc/*/usb488_interface_capabilities
16+What: /sys/bus/usb/drivers/usbtmc/*/usb488_device_capabilities
1717 Date: August 2008
1818 Contact: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1919 Description:
@@ -27,7 +27,7 @@ Description: · 7 unmodified lines
2727 The files are read only.
2828
2929
30−What: /sys/bus/usb/drivers/usbtmc/devices/*/TermChar
30+What: /sys/bus/usb/drivers/usbtmc/*/TermChar
3131 Date: August 2008
3232 Contact: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3333 Description:
@@ -40,7 +40,7 @@ Description: · 6 unmodified lines
4040 sent to the device or not.
4141
4242
43−What: /sys/bus/usb/drivers/usbtmc/devices/*/TermCharEnabled
43+What: /sys/bus/usb/drivers/usbtmc/*/TermCharEnabled
4444 Date: August 2008
4545 Contact: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4646 Description:
@@ -51,7 +51,7 @@ Description: · 4 unmodified lines
5151 published by the USB-IF.
5252
5353
54−What: /sys/bus/usb/drivers/usbtmc/devices/*/auto_abort
54+What: /sys/bus/usb/drivers/usbtmc/*/auto_abort
5555 Date: August 2008
5656 Contact: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5757 Description:
Documentation/ABI/testing/sysfs-block-rssd+18−0
@@ -0,0 +1,18 @@
1+What: /sys/block/rssd*/registers
2+Date: March 2012
3+KernelVersion: 3.3
4+Contact: Asai Thambi S P <asamymuthupa@micron.com>
5+Description: This is a read-only file. Dumps below driver information and
6+ hardware registers.
7+ - S ACTive
8+ - Command Issue
9+ - Allocated
10+ - Completed
11+ - PORT IRQ STAT
12+ - HOST IRQ STAT
13+
14+What: /sys/block/rssd*/status
15+Date: April 2012
16+KernelVersion: 3.4
17+Contact: Asai Thambi S P <asamymuthupa@micron.com>
18+Description: This is a read-only file. Indicates the status of the device.
Documentation/ABI/testing/sysfs-bus-hsi+19−0
@@ -0,0 +1,19 @@
1+What: /sys/bus/hsi
2+Date: April 2012
3+KernelVersion: 3.4
4+Contact: Carlos Chinea <carlos.chinea@nokia.com>
5+Description:
6+ High Speed Synchronous Serial Interface (HSI) is a
7+ serial interface mainly used for connecting application
8+ engines (APE) with cellular modem engines (CMT) in cellular
9+ handsets.
10+ The bus will be populated with devices (hsi_clients) representing
11+ the protocols available in the system. Bus drivers implement
12+ those protocols.
13+
14+What: /sys/bus/hsi/devices/.../modalias
15+Date: April 2012
16+KernelVersion: 3.4
17+Contact: Carlos Chinea <carlos.chinea@nokia.com>
18+Description: Stores the same MODALIAS value emitted by uevent
19+ Format: hsi:<hsi_client device name>
Documentation/ABI/testing/sysfs-cfq-target-latency+8−0
@@ -0,0 +1,8 @@
1+What: /sys/block/<device>/iosched/target_latency
2+Date: March 2012
3+contact: Tao Ma <boyu.mt@taobao.com>
4+Description:
5+ The /sys/block/<device>/iosched/target_latency only exists
6+ when the user sets cfq to /sys/block/<device>/scheduler.
7+ It contains an estimated latency time for the cfq. cfq will
8+ use it to calculate the time slice used for every task.
Documentation/DocBook/media/v4l/pixfmt-nv12m.xml+1−1
@@ -1,6 +1,6 @@
11 <refentry id="V4L2-PIX-FMT-NV12M">
22 <refmeta>
3− <refentrytitle>V4L2_PIX_FMT_NV12M ('NV12M')</refentrytitle>
3+ <refentrytitle>V4L2_PIX_FMT_NV12M ('NM12')</refentrytitle>
44 &manvol;
55 </refmeta>
66 <refnamediv>
Documentation/DocBook/media/v4l/pixfmt-yuv420m.xml+1−1
@@ -1,6 +1,6 @@
11 <refentry id="V4L2-PIX-FMT-YUV420M">
22 <refmeta>
3− <refentrytitle>V4L2_PIX_FMT_YUV420M ('YU12M')</refentrytitle>
3+ <refentrytitle>V4L2_PIX_FMT_YUV420M ('YM12')</refentrytitle>
44 &manvol;
55 </refmeta>
66 <refnamediv>
Documentation/cgroups/memory.txt+2−3
@@ -34,8 +34,7 @@ Current Status: linux-2.6.34-mmotm(development version of 2010/April) · 33 unmodified lines
3434
3535 Features:
3636 - accounting anonymous pages, file caches, swap caches usage and limiting them.
37− - private LRU and reclaim routine. (system's global LRU and private LRU
38− work independently from each other)
37+ - pages are linked to per-memcg LRU exclusively, and there is no global LRU.
3938 - optionally, memory+swap usage can be accounted and limited.
4039 - hierarchical accounting
4140 - soft limit
@@ -154,7 +153,7 @@ updated. page_cgroup has its own LRU on cgroup. · 112 unmodified lines
154153 2.2.1 Accounting details
155154
156155 All mapped anon pages (RSS) and cache pages (Page Cache) are accounted.
157−Some pages which are never reclaimable and will not be on the global LRU
156+Some pages which are never reclaimable and will not be on the LRU
158157 are not accounted. We just account pages under usual VM management.
159158
160159 RSS pages are accounted at page_fault unless they've already been accounted
Documentation/feature-removal-schedule.txt+8−0
@@ -531,3 +531,11 @@ Why: There appear to be no production users of the get_robust_list syscall, · 530 unmodified lines
531531 of ASLR. It was only ever intended for debugging, so it should be
532532 removed.
533533 Who: Kees Cook <keescook@chromium.org>
534+
535+----------------------------
536+
537+What: setitimer accepts user NULL pointer (value)
538+When: 3.6
539+Why: setitimer is not returning -EFAULT if user pointer is NULL. This
540+ violates the spec.
541+Who: Sasikantha Babu <sasikanth.v19@gmail.com>
Documentation/filesystems/vfs.txt+1−1
@@ -114,7 +114,7 @@ members are defined: · 113 unmodified lines
114114 struct file_system_type {
115115 const char *name;
116116 int fs_flags;
117− struct dentry (*mount) (struct file_system_type *, int,
117+ struct dentry *(*mount) (struct file_system_type *, int,
118118 const char *, void *);
119119 void (*kill_sb) (struct super_block *);
120120 struct module *owner;
Documentation/power/freezing-of-tasks.txt+19−18
@@ -9,7 +9,7 @@ architectures). · 8 unmodified lines
99
1010 II. How does it work?
1111
12−There are four per-task flags used for that, PF_NOFREEZE, PF_FROZEN, TIF_FREEZE
12+There are three per-task flags used for that, PF_NOFREEZE, PF_FROZEN
1313 and PF_FREEZER_SKIP (the last one is auxiliary). The tasks that have
1414 PF_NOFREEZE unset (all user space processes and some kernel threads) are
1515 regarded as 'freezable' and treated in a special way before the system enters a
@@ -17,30 +17,31 @@ suspend state as well as before a hibernation image is created (in what follows · 1 unmodified line
1717 we only consider hibernation, but the description also applies to suspend).
1818
1919 Namely, as the first step of the hibernation procedure the function
20−freeze_processes() (defined in kernel/power/process.c) is called. It executes
21−try_to_freeze_tasks() that sets TIF_FREEZE for all of the freezable tasks and
22−either wakes them up, if they are kernel threads, or sends fake signals to them,
23−if they are user space processes. A task that has TIF_FREEZE set, should react
24−to it by calling the function called __refrigerator() (defined in
25−kernel/freezer.c), which sets the task's PF_FROZEN flag, changes its state
26−to TASK_UNINTERRUPTIBLE and makes it loop until PF_FROZEN is cleared for it.
27−Then, we say that the task is 'frozen' and therefore the set of functions
28−handling this mechanism is referred to as 'the freezer' (these functions are
29−defined in kernel/power/process.c, kernel/freezer.c & include/linux/freezer.h).
30−User space processes are generally frozen before kernel threads.
20+freeze_processes() (defined in kernel/power/process.c) is called. A system-wide
21+variable system_freezing_cnt (as opposed to a per-task flag) is used to indicate
22+whether the system is to undergo a freezing operation. And freeze_processes()
23+sets this variable. After this, it executes try_to_freeze_tasks() that sends a
24+fake signal to all user space processes, and wakes up all the kernel threads.
25+All freezable tasks must react to that by calling try_to_freeze(), which
26+results in a call to __refrigerator() (defined in kernel/freezer.c), which sets
27+the task's PF_FROZEN flag, changes its state to TASK_UNINTERRUPTIBLE and makes
28+it loop until PF_FROZEN is cleared for it. Then, we say that the task is
29+'frozen' and therefore the set of functions handling this mechanism is referred
30+to as 'the freezer' (these functions are defined in kernel/power/process.c,
31+kernel/freezer.c & include/linux/freezer.h). User space processes are generally
32+frozen before kernel threads.
3133
3234 __refrigerator() must not be called directly. Instead, use the
3335 try_to_freeze() function (defined in include/linux/freezer.h), that checks
34−the task's TIF_FREEZE flag and makes the task enter __refrigerator() if the
35−flag is set.
36+if the task is to be frozen and makes the task enter __refrigerator().
3637
3738 For user space processes try_to_freeze() is called automatically from the
3839 signal-handling code, but the freezable kernel threads need to call it
3940 explicitly in suitable places or use the wait_event_freezable() or
4041 wait_event_freezable_timeout() macros (defined in include/linux/freezer.h)
41−that combine interruptible sleep with checking if TIF_FREEZE is set and calling
42−try_to_freeze(). The main loop of a freezable kernel thread may look like the
43−following one:
42+that combine interruptible sleep with checking if the task is to be frozen and
43+calling try_to_freeze(). The main loop of a freezable kernel thread may look
44+like the following one:
4445
4546 set_freezable();
4647 do {
@@ -53,7 +54,7 @@ following one: · 6 unmodified lines
5354 (from drivers/usb/core/hub.c::hub_thread()).
5455
5556 If a freezable kernel thread fails to call try_to_freeze() after the freezer has
56−set TIF_FREEZE for it, the freezing of tasks will fail and the entire
57+initiated a freezing operation, the freezing of tasks will fail and the entire
5758 hibernation operation will be cancelled. For this reason, freezable kernel
5859 threads must call try_to_freeze() somewhere or use one of the
5960 wait_event_freezable() and wait_event_freezable_timeout() macros.
Documentation/security/keys.txt+13−1
@@ -123,7 +123,7 @@ KEY SERVICE OVERVIEW · 122 unmodified lines
123123
124124 The key service provides a number of features besides keys:
125125
126− (*) The key service defines two special key types:
126+ (*) The key service defines three special key types:
127127
128128 (+) "keyring"
129129
@@ -137,6 +137,18 @@ The key service provides a number of features besides keys: · 7 unmodified lines
137137 blobs of data. These can be created, updated and read by userspace,
138138 and aren't intended for use by kernel services.
139139
140+ (+) "logon"
141+
142+ Like a "user" key, a "logon" key has a payload that is an arbitrary
143+ blob of data. It is intended as a place to store secrets which are
144+ accessible to the kernel but not to userspace programs.
145+
146+ The description can be arbitrary, but must be prefixed with a non-zero
147+ length string that describes the key "subclass". The subclass is
148+ separated from the rest of the description by a ':'. "logon" keys can
149+ be created and updated from userspace, but the payload is only
150+ readable from kernel space.
151+
140152 (*) Each process subscribes to three keyrings: a thread-specific keyring, a
141153 process-specific keyring, and a session-specific keyring.
142154
Documentation/sound/alsa/HD-Audio-Models.txt+3−1
@@ -43,7 +43,9 @@ ALC680 · 42 unmodified lines
4343
4444 ALC882/883/885/888/889
4545 ======================
46− N/A
46+ acer-aspire-4930g Acer Aspire 4930G/5930G/6530G/6930G/7730G
47+ acer-aspire-8930g Acer Aspire 8330G/6935G
48+ acer-aspire Acer Aspire others
4749
4850 ALC861/660
4951 ==========
Documentation/usb/URB.txt+22−0
@@ -168,6 +168,28 @@ that if the completion handler or anyone else tries to resubmit it · 167 unmodified lines
168168 they will get a -EPERM error. Thus you can be sure that when
169169 usb_kill_urb() returns, the URB is totally idle.
170170
171+There is a lifetime issue to consider. An URB may complete at any
172+time, and the completion handler may free the URB. If this happens
173+while usb_unlink_urb or usb_kill_urb is running, it will cause a
174+memory-access violation. The driver is responsible for avoiding this,
175+which often means some sort of lock will be needed to prevent the URB
176+from being deallocated while it is still in use.
177+
178+On the other hand, since usb_unlink_urb may end up calling the
179+completion handler, the handler must not take any lock that is held
180+when usb_unlink_urb is invoked. The general solution to this problem
181+is to increment the URB's reference count while holding the lock, then
182+drop the lock and call usb_unlink_urb or usb_kill_urb, and then
183+decrement the URB's reference count. You increment the reference
184+count by calling
185+
186+ struct urb *usb_get_urb(struct urb *urb)
187+
188+(ignore the return value; it is the same as the argument) and
189+decrement the reference count by calling usb_free_urb. Of course,
190+none of this is necessary if there's no danger of the URB being freed
191+by the completion handler.
192+
171193
172194 1.7. What about the completion handler?
173195
Documentation/usb/usbmon.txt+3−3
@@ -183,10 +183,10 @@ An input control transfer to get a port status. · 182 unmodified lines
183183 d5ea89a0 3575914555 S Ci:1:001:0 s a3 00 0000 0003 0004 4 <
184184 d5ea89a0 3575914560 C Ci:1:001:0 0 4 = 01050000
185185
186−An output bulk transfer to send a SCSI command 0x5E in a 31-byte Bulk wrapper
187−to a storage device at address 5:
186+An output bulk transfer to send a SCSI command 0x28 (READ_10) in a 31-byte
187+Bulk wrapper to a storage device at address 5:
188188
189−dd65f0e8 4128379752 S Bo:1:005:2 -115 31 = 55534243 5e000000 00000000 00000600 00000000 00000000 00000000 000000
189+dd65f0e8 4128379752 S Bo:1:005:2 -115 31 = 55534243 ad000000 00800000 80010a28 20000000 20000040 00000000 000000
190190 dd65f0e8 4128379808 C Bo:1:005:2 0 31 >
191191
192192 * Raw binary format and API
MAINTAINERS+18−12
@@ -1521,8 +1521,8 @@ M: Gustavo Padovan <gustavo@padovan.org> · 1520 unmodified lines
15211521 M: Johan Hedberg <johan.hedberg@gmail.com>
15221522 L: linux-bluetooth@vger.kernel.org
15231523 W: http://www.bluez.org/
1524−T: git git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth.git
1525−T: git git://git.kernel.org/pub/scm/linux/kernel/git/jh/bluetooth.git
1524+T: git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git
1525+T: git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
15261526 S: Maintained
15271527 F: drivers/bluetooth/
15281528
@@ -1532,8 +1532,8 @@ M: Gustavo Padovan <gustavo@padovan.org> · 3 unmodified lines
15321532 M: Johan Hedberg <johan.hedberg@gmail.com>
15331533 L: linux-bluetooth@vger.kernel.org
15341534 W: http://www.bluez.org/
1535−T: git git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth.git
1536−T: git git://git.kernel.org/pub/scm/linux/kernel/git/jh/bluetooth.git
1535+T: git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git
1536+T: git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
15371537 S: Maintained
15381538 F: net/bluetooth/
15391539 F: include/net/bluetooth/
@@ -2322,9 +2322,9 @@ S: Supported · 782 unmodified lines
23222322 F: drivers/acpi/dock.c
23232323
23242324 DOCUMENTATION
2325−M: Randy Dunlap <rdunlap@xenotime.net>
2325+M: Rob Landley <rob@landley.net>
23262326 L: linux-doc@vger.kernel.org
2327−T: quilt http://xenotime.net/kernel-doc-patches/current/
2327+T: TBD
23282328 S: Maintained
23292329 F: Documentation/
23302330
@@ -3593,6 +3593,7 @@ S: Supported · 1262 unmodified lines
35933593 F: drivers/net/wireless/iwlegacy/
35943594
35953595 INTEL WIRELESS WIFI LINK (iwlwifi)
3596+M: Johannes Berg <johannes.berg@intel.com>
35963597 M: Wey-Yi Guy <wey-yi.w.guy@intel.com>
35973598 M: Intel Linux Wireless <ilw@linux.intel.com>
35983599 L: linux-wireless@vger.kernel.org
@@ -4534,8 +4535,7 @@ S: Supported · 935 unmodified lines
45344535 F: drivers/net/ethernet/myricom/myri10ge/
45354536
45364537 NATSEMI ETHERNET DRIVER (DP8381x)
4537−M: Tim Hockin <thockin@hockin.org>
4538−S: Maintained
4538+S: Orphan
45394539 F: drivers/net/ethernet/natsemi/natsemi.c
45404540
45414541 NATIVE INSTRUMENTS USB SOUND INTERFACE DRIVER
@@ -4804,6 +4804,7 @@ F: arch/arm/mach-omap2/clockdomain2xxx_3xxx.c · 262 unmodified lines
48044804 F: arch/arm/mach-omap2/clockdomain44xx.c
48054805
48064806 OMAP AUDIO SUPPORT
4807+M: Peter Ujfalusi <peter.ujfalusi@ti.com>
48074808 M: Jarkko Nikula <jarkko.nikula@bitmer.com>
48084809 L: alsa-devel@alsa-project.org (subscribers-only)
48094810 L: linux-omap@vger.kernel.org
@@ -5118,6 +5119,11 @@ F: drivers/i2c/busses/i2c-pca-* · 308 unmodified lines
51185119 F: include/linux/i2c-algo-pca.h
51195120 F: include/linux/i2c-pca-platform.h
51205121
5122+PCDP - PRIMARY CONSOLE AND DEBUG PORT
5123+M: Khalid Aziz <khalid.aziz@hp.com>
5124+S: Maintained
5125+F: drivers/firmware/pcdp.*
5126+
51215127 PCI ERROR RECOVERY
51225128 M: Linas Vepstas <linasvepstas@gmail.com>
51235129 L: linux-pci@vger.kernel.org
@@ -6467,6 +6473,7 @@ S: Odd Fixes · 1343 unmodified lines
64676473 F: drivers/staging/olpc_dcon/
64686474
64696475 STAGING - OZMO DEVICES USB OVER WIFI DRIVER
6476+M: Rupesh Gujare <rgujare@ozmodevices.com>
64706477 M: Chris Kelly <ckelly@ozmodevices.com>
64716478 S: Maintained
64726479 F: drivers/staging/ozwpan/
@@ -7462,8 +7469,7 @@ F: include/linux/wm97xx.h · 989 unmodified lines
74627469
74637470 WOLFSON MICROELECTRONICS DRIVERS
74647471 M: Mark Brown <broonie@opensource.wolfsonmicro.com>
7465−M: Ian Lartey <ian@opensource.wolfsonmicro.com>
7466−M: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
7472+L: patches@opensource.wolfsonmicro.com
74677473 T: git git://opensource.wolfsonmicro.com/linux-2.6-asoc
74687474 T: git git://opensource.wolfsonmicro.com/linux-2.6-audioplus
74697475 W: http://opensource.wolfsonmicro.com/content/linux-drivers-wolfson-devices
@@ -7574,8 +7580,8 @@ F: Documentation/filesystems/xfs.txt · 104 unmodified lines
75747580 F: fs/xfs/
75757581
75767582 XILINX AXI ETHERNET DRIVER
7577−M: Ariane Keller <ariane.keller@tik.ee.ethz.ch>
7578−M: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
7583+M: Anirudha Sarangi <anirudh@xilinx.com>
7584+M: John Linn <John.Linn@xilinx.com>
75797585 S: Maintained
75807586 F: drivers/net/ethernet/xilinx/xilinx_axienet*
75817587
Makefile+1−1
@@ -1,7 +1,7 @@
11 VERSION = 3
22 PATCHLEVEL = 4
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc2
4+EXTRAVERSION = -rc5
55 NAME = Saber-toothed Squirrel
66
77 # *DOCUMENTATION*
arch/alpha/include/asm/atomic.h+1−67
@@ -3,6 +3,7 @@ · 2 unmodified lines
33
44 #include <linux/types.h>
55 #include <asm/barrier.h>
6+#include <asm/cmpxchg.h>
67
78 /*
89 * Atomic operations that C can't guarantee us. Useful for
@@ -168,73 +169,6 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v) · 159 unmodified lines
168169 return result;
169170 }
170171
171−/*
172− * Atomic exchange routines.
173− */
174−
175−#define __ASM__MB
176−#define ____xchg(type, args...) __xchg ## type ## _local(args)
177−#define ____cmpxchg(type, args...) __cmpxchg ## type ## _local(args)
178−#include <asm/xchg.h>
179−
180−#define xchg_local(ptr,x) \
181− ({ \
182− __typeof__(*(ptr)) _x_ = (x); \
183− (__typeof__(*(ptr))) __xchg_local((ptr), (unsigned long)_x_, \
184− sizeof(*(ptr))); \
185− })
186−
187−#define cmpxchg_local(ptr, o, n) \
188− ({ \
189− __typeof__(*(ptr)) _o_ = (o); \
190− __typeof__(*(ptr)) _n_ = (n); \
191− (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_, \
192− (unsigned long)_n_, \
193− sizeof(*(ptr))); \
194− })
195−
196−#define cmpxchg64_local(ptr, o, n) \
197− ({ \
198− BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
199− cmpxchg_local((ptr), (o), (n)); \
200− })
201−
202−#ifdef CONFIG_SMP
203−#undef __ASM__MB
204−#define __ASM__MB "\tmb\n"
205−#endif
206−#undef ____xchg
207−#undef ____cmpxchg
208−#define ____xchg(type, args...) __xchg ##type(args)
209−#define ____cmpxchg(type, args...) __cmpxchg ##type(args)
210−#include <asm/xchg.h>
211−
212−#define xchg(ptr,x) \
213− ({ \
214− __typeof__(*(ptr)) _x_ = (x); \
215− (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, \
216− sizeof(*(ptr))); \
217− })
218−
219−#define cmpxchg(ptr, o, n) \
220− ({ \
221− __typeof__(*(ptr)) _o_ = (o); \
222− __typeof__(*(ptr)) _n_ = (n); \
223− (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
224− (unsigned long)_n_, sizeof(*(ptr)));\
225− })
226−
227−#define cmpxchg64(ptr, o, n) \
228− ({ \
229− BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
230− cmpxchg((ptr), (o), (n)); \
231− })
232−
233−#undef __ASM__MB
234−#undef ____cmpxchg
235−
236−#define __HAVE_ARCH_CMPXCHG 1
237−
238172 #define atomic64_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
239173 #define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
240174
arch/alpha/include/asm/cmpxchg.h+71−0
@@ -0,0 +1,71 @@
1+#ifndef _ALPHA_CMPXCHG_H
2+#define _ALPHA_CMPXCHG_H
3+
4+/*
5+ * Atomic exchange routines.
6+ */
7+
8+#define __ASM__MB
9+#define ____xchg(type, args...) __xchg ## type ## _local(args)
10+#define ____cmpxchg(type, args...) __cmpxchg ## type ## _local(args)
11+#include <asm/xchg.h>
12+
13+#define xchg_local(ptr, x) \
14+({ \
15+ __typeof__(*(ptr)) _x_ = (x); \
16+ (__typeof__(*(ptr))) __xchg_local((ptr), (unsigned long)_x_, \
17+ sizeof(*(ptr))); \
18+})
19+
20+#define cmpxchg_local(ptr, o, n) \
21+({ \
22+ __typeof__(*(ptr)) _o_ = (o); \
23+ __typeof__(*(ptr)) _n_ = (n); \
24+ (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_, \
25+ (unsigned long)_n_, \
26+ sizeof(*(ptr))); \
27+})
28+
29+#define cmpxchg64_local(ptr, o, n) \
30+({ \
31+ BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
32+ cmpxchg_local((ptr), (o), (n)); \
33+})
34+
35+#ifdef CONFIG_SMP
36+#undef __ASM__MB
37+#define __ASM__MB "\tmb\n"
38+#endif
39+#undef ____xchg
40+#undef ____cmpxchg
41+#define ____xchg(type, args...) __xchg ##type(args)
42+#define ____cmpxchg(type, args...) __cmpxchg ##type(args)
43+#include <asm/xchg.h>
44+
45+#define xchg(ptr, x) \
46+({ \
47+ __typeof__(*(ptr)) _x_ = (x); \
48+ (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, \
49+ sizeof(*(ptr))); \
50+})
51+
52+#define cmpxchg(ptr, o, n) \
53+({ \
54+ __typeof__(*(ptr)) _o_ = (o); \
55+ __typeof__(*(ptr)) _n_ = (n); \
56+ (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
57+ (unsigned long)_n_, sizeof(*(ptr)));\
58+})
59+
60+#define cmpxchg64(ptr, o, n) \
61+({ \
62+ BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
63+ cmpxchg((ptr), (o), (n)); \
64+})
65+
66+#undef __ASM__MB
67+#undef ____cmpxchg
68+
69+#define __HAVE_ARCH_CMPXCHG 1
70+
71+#endif /* _ALPHA_CMPXCHG_H */
arch/alpha/include/asm/xchg.h+2−2
@@ -1,10 +1,10 @@
1−#ifndef _ALPHA_ATOMIC_H
1+#ifndef _ALPHA_CMPXCHG_H
22 #error Do not include xchg.h directly!
33 #else
44 /*
55 * xchg/xchg_local and cmpxchg/cmpxchg_local share the same code
66 * except that local version do not have the expensive memory barrier.
7− * So this file is included twice from asm/system.h.
7+ * So this file is included twice from asm/cmpxchg.h.
88 */
99
1010 /*
arch/arm/boot/compressed/atags_to_fdt.c+2−0
@@ -77,6 +77,8 @@ int atags_to_fdt(void *atag_list, void *fdt, int total_space) · 76 unmodified lines
7777 } else if (atag->hdr.tag == ATAG_MEM) {
7878 if (memcount >= sizeof(mem_reg_property)/4)
7979 continue;
80+ if (!atag->u.mem.size)
81+ continue;
8082 mem_reg_property[memcount++] = cpu_to_fdt32(atag->u.mem.start);
8183 mem_reg_property[memcount++] = cpu_to_fdt32(atag->u.mem.size);
8284 } else if (atag->hdr.tag == ATAG_INITRD2) {
arch/arm/boot/compressed/head.S+1−1
@@ -273,7 +273,7 @@ restart: adr r0, LC0 · 272 unmodified lines
273273 add r0, r0, #0x100
274274 mov r1, r6
275275 sub r2, sp, r6
276− blne atags_to_fdt
276+ bleq atags_to_fdt
277277
278278 ldmfd sp!, {r0-r3, ip, lr}
279279 sub sp, sp, #0x10000
arch/arm/boot/dts/at91sam9g20.dtsi+0−1
@@ -55,7 +55,6 @@ · 54 unmodified lines
5555 #interrupt-cells = <2>;
5656 compatible = "atmel,at91rm9200-aic";
5757 interrupt-controller;
58− interrupt-parent;
5958 reg = <0xfffff000 0x200>;
6059 };
6160
arch/arm/boot/dts/at91sam9g45.dtsi+0−1
@@ -56,7 +56,6 @@ · 55 unmodified lines
5656 #interrupt-cells = <2>;
5757 compatible = "atmel,at91rm9200-aic";
5858 interrupt-controller;
59− interrupt-parent;
6059 reg = <0xfffff000 0x200>;
6160 };
6261
arch/arm/boot/dts/at91sam9x5.dtsi+0−1
@@ -54,7 +54,6 @@ · 53 unmodified lines
5454 #interrupt-cells = <2>;
5555 compatible = "atmel,at91rm9200-aic";
5656 interrupt-controller;
57− interrupt-parent;
5857 reg = <0xfffff000 0x200>;
5958 };
6059
arch/arm/boot/dts/db8500.dtsi+0−1
@@ -24,7 +24,6 @@ · 23 unmodified lines
2424 #interrupt-cells = <3>;
2525 #address-cells = <1>;
2626 interrupt-controller;
27− interrupt-parent;
2827 reg = <0xa0411000 0x1000>,
2928 <0xa0410100 0x100>;
3029 };
arch/arm/boot/dts/highbank.dts+0−1
@@ -89,7 +89,6 @@ · 88 unmodified lines
8989 #size-cells = <0>;
9090 #address-cells = <1>;
9191 interrupt-controller;
92− interrupt-parent;
9392 reg = <0xfff11000 0x1000>,
9493 <0xfff10100 0x100>;
9594 };
arch/arm/boot/dts/msm8660-surf.dts+2−2
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 intc: interrupt-controller@02080000 {
1111 compatible = "qcom,msm-8660-qgic";
1212 interrupt-controller;
13− #interrupt-cells = <1>;
13+ #interrupt-cells = <3>;
1414 reg = < 0x02080000 0x1000 >,
1515 < 0x02081000 0x1000 >;
1616 };
@@ -19,6 +19,6 @@ · 2 unmodified lines
1919 compatible = "qcom,msm-hsuart", "qcom,msm-uart";
2020 reg = <0x19c40000 0x1000>,
2121 <0x19c00000 0x1000>;
22− interrupts = <195>;
22+ interrupts = <0 195 0x0>;
2323 };
2424 };
arch/arm/common/vic.c+4−5
@@ -427,19 +427,18 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent) · 426 unmodified lines
427427
428428 /*
429429 * Handle each interrupt in a single VIC. Returns non-zero if we've
430− * handled at least one interrupt. This does a single read of the
431− * status register and handles all interrupts in order from LSB first.
430+ * handled at least one interrupt. This reads the status register
431+ * before handling each interrupt, which is necessary given that
432+ * handle_IRQ may briefly re-enable interrupts for soft IRQ handling.
432433 */
433434 static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs)
434435 {
435436 u32 stat, irq;
436437 int handled = 0;
437438
438− stat = readl_relaxed(vic->base + VIC_IRQ_STATUS);
439− while (stat) {
439+ while ((stat = readl_relaxed(vic->base + VIC_IRQ_STATUS))) {
440440 irq = ffs(stat) - 1;
441441 handle_IRQ(irq_find_mapping(vic->domain, irq), regs);
442− stat &= ~(1 << irq);
443442 handled = 1;
444443 }
445444
arch/arm/configs/imx_v4_v5_defconfig+1−0
@@ -112,6 +112,7 @@ CONFIG_WATCHDOG=y · 111 unmodified lines
112112 CONFIG_IMX2_WDT=y
113113 CONFIG_MFD_MC13XXX=y
114114 CONFIG_REGULATOR=y
115+CONFIG_REGULATOR_FIXED_VOLTAGE=y
115116 CONFIG_REGULATOR_MC13783=y
116117 CONFIG_REGULATOR_MC13892=y
117118 CONFIG_FB=y
arch/arm/configs/mini2440_defconfig+2−0
@@ -14,6 +14,8 @@ CONFIG_MODULE_FORCE_UNLOAD=y · 13 unmodified lines
1414 # CONFIG_BLK_DEV_BSG is not set
1515 CONFIG_BLK_DEV_INTEGRITY=y
1616 CONFIG_ARCH_S3C24XX=y
17+# CONFIG_CPU_S3C2410 is not set
18+CONFIG_CPU_S3C2440=y
1719 CONFIG_S3C_ADC=y
1820 CONFIG_S3C24XX_PWM=y
1921 CONFIG_MACH_MINI2440=y
arch/arm/configs/u8500_defconfig+4−5
@@ -8,8 +8,6 @@ CONFIG_MODULE_UNLOAD=y · 7 unmodified lines
88 # CONFIG_LBDAF is not set
99 # CONFIG_BLK_DEV_BSG is not set
1010 CONFIG_ARCH_U8500=y
11−CONFIG_UX500_SOC_DB5500=y
12−CONFIG_UX500_SOC_DB8500=y
1311 CONFIG_MACH_HREFV60=y
1412 CONFIG_MACH_SNOWBALL=y
1513 CONFIG_MACH_U5500=y
@@ -39,7 +37,6 @@ CONFIG_CAIF=y · 23 unmodified lines
3937 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
4038 CONFIG_BLK_DEV_RAM=y
4139 CONFIG_BLK_DEV_RAM_SIZE=65536
42−CONFIG_MISC_DEVICES=y
4340 CONFIG_AB8500_PWM=y
4441 CONFIG_SENSORS_BH1780=y
4542 CONFIG_NETDEVICES=y
@@ -65,16 +62,18 @@ CONFIG_SERIAL_AMBA_PL011=y · 19 unmodified lines
6562 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
6663 CONFIG_HW_RANDOM=y
6764 CONFIG_HW_RANDOM_NOMADIK=y
68−CONFIG_I2C=y
69−CONFIG_I2C_NOMADIK=y
7065 CONFIG_SPI=y
7166 CONFIG_SPI_PL022=y
7267 CONFIG_GPIO_STMPE=y
7368 CONFIG_GPIO_TC3589X=y
69+CONFIG_POWER_SUPPLY=y
70+CONFIG_AB8500_BM=y
71+CONFIG_AB8500_BATTERY_THERM_ON_BATCTRL=y
7472 CONFIG_MFD_STMPE=y
7573 CONFIG_MFD_TC3589X=y
7674 CONFIG_AB5500_CORE=y
7775 CONFIG_AB8500_CORE=y
76+CONFIG_REGULATOR=y
7877 CONFIG_REGULATOR_AB8500=y
7978 # CONFIG_HID_SUPPORT is not set
8079 CONFIG_USB_GADGET=y
arch/arm/include/asm/jump_label.h+1−1
@@ -14,7 +14,7 @@ · 13 unmodified lines
1414 #define JUMP_LABEL_NOP "nop"
1515 #endif
1616
17−static __always_inline bool arch_static_branch(struct jump_label_key *key)
17+static __always_inline bool arch_static_branch(struct static_key *key)
1818 {
1919 asm goto("1:\n\t"
2020 JUMP_LABEL_NOP "\n\t"
arch/arm/kernel/setup.c+15−1
@@ -523,7 +523,21 @@ int __init arm_add_memory(phys_addr_t start, unsigned long size) · 522 unmodified lines
523523 */
524524 size -= start & ~PAGE_MASK;
525525 bank->start = PAGE_ALIGN(start);
526− bank->size = size & PAGE_MASK;
526+
527+#ifndef CONFIG_LPAE
528+ if (bank->start + size < bank->start) {
529+ printk(KERN_CRIT "Truncating memory at 0x%08llx to fit in "
530+ "32-bit physical address space\n", (long long)start);
531+ /*
532+ * To ensure bank->start + bank->size is representable in
533+ * 32 bits, we use ULONG_MAX as the upper limit rather than 4GB.
534+ * This means we lose a page after masking.
535+ */
536+ size = ULONG_MAX - bank->start;
537+ }
538+#endif
539+
540+ bank->size = size & PAGE_MASK;
527541
528542 /*
529543 * Check whether this memory region has non-zero size or
arch/arm/mach-at91/at91rm9200_devices.c+0−1
@@ -1173,7 +1173,6 @@ void __init at91_add_device_serial(void) · 1172 unmodified lines
11731173 printk(KERN_INFO "AT91: No default serial console defined.\n");
11741174 }
11751175 #else
1176−void __init __deprecated at91_init_serial(struct at91_uart_config *config) {}
11771176 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
11781177 void __init at91_set_serial_console(unsigned portnr) {}
11791178 void __init at91_add_device_serial(void) {}
arch/arm/mach-at91/at91rm9200_time.c+2−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <linux/interrupt.h>
2424 #include <linux/irq.h>
2525 #include <linux/clockchips.h>
26+#include <linux/export.h>
2627
2728 #include <asm/mach/time.h>
2829
@@ -176,6 +177,7 @@ static struct clock_event_device clkevt = { · 147 unmodified lines
176177 };
177178
178179 void __iomem *at91_st_base;
180+EXPORT_SYMBOL_GPL(at91_st_base);
179181
180182 void __init at91rm9200_ioremap_st(u32 addr)
181183 {
arch/arm/mach-at91/board-rm9200ek.c+1−1
@@ -117,7 +117,7 @@ static struct i2c_board_info __initdata ek_i2c_devices[] = { · 116 unmodified lines
117117 };
118118
119119 #define EK_FLASH_BASE AT91_CHIPSELECT_0
120−#define EK_FLASH_SIZE SZ_2M
120+#define EK_FLASH_SIZE SZ_8M
121121
122122 static struct physmap_flash_data ek_flash_data = {
123123 .width = 2,
arch/arm/mach-at91/board-sam9261ek.c+3−2
@@ -85,8 +85,6 @@ static struct resource dm9000_resource[] = { · 84 unmodified lines
8585 .flags = IORESOURCE_MEM
8686 },
8787 [2] = {
88− .start = AT91_PIN_PC11,
89− .end = AT91_PIN_PC11,
9088 .flags = IORESOURCE_IRQ
9189 | IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE,
9290 }
@@ -130,6 +128,8 @@ static struct sam9_smc_config __initdata dm9000_smc_config = { · 37 unmodified lines
130128
131129 static void __init ek_add_device_dm9000(void)
132130 {
131+ struct resource *r = &dm9000_resource[2];
132+
133133 /* Configure chip-select 2 (DM9000) */
134134 sam9_smc_configure(0, 2, &dm9000_smc_config);
135135
@@ -139,6 +139,7 @@ static void __init ek_add_device_dm9000(void) · 3 unmodified lines
139139 /* Configure Interrupt pin as input, no pull-up */
140140 at91_set_gpio_input(AT91_PIN_PC11, 0);
141141
142+ r->start = r->end = gpio_to_irq(AT91_PIN_PC11);
142143 platform_device_register(&dm9000_device);
143144 }
144145 #else
arch/arm/mach-at91/clock.c+1−0
@@ -35,6 +35,7 @@ · 34 unmodified lines
3535 #include "generic.h"
3636
3737 void __iomem *at91_pmc_base;
38+EXPORT_SYMBOL_GPL(at91_pmc_base);
3839
3940 /*
4041 * There's a lot more which can be done with clocks, including cpufreq
arch/arm/mach-at91/include/mach/at91_pmc.h+1−1
@@ -25,7 +25,7 @@ extern void __iomem *at91_pmc_base; · 24 unmodified lines
2525 #define at91_pmc_write(field, value) \
2626 __raw_writel(value, at91_pmc_base + field)
2727 #else
28−.extern at91_aic_base
28+.extern at91_pmc_base
2929 #endif
3030
3131 #define AT91_PMC_SCER 0x00 /* System Clock Enable Register */
arch/arm/mach-at91/setup.c+2−0
@@ -54,6 +54,7 @@ void __init at91_init_interrupts(unsigned int *priority) · 53 unmodified lines
5454 }
5555
5656 void __iomem *at91_ramc_base[2];
57+EXPORT_SYMBOL_GPL(at91_ramc_base);
5758
5859 void __init at91_ioremap_ramc(int id, u32 addr, u32 size)
5960 {
@@ -292,6 +293,7 @@ void __init at91_ioremap_rstc(u32 base_addr) · 232 unmodified lines
292293 }
293294
294295 void __iomem *at91_matrix_base;
296+EXPORT_SYMBOL_GPL(at91_matrix_base);
295297
296298 void __init at91_ioremap_matrix(u32 base_addr)
297299 {
arch/arm/mach-bcmring/core.c+2−2
@@ -52,8 +52,8 @@ · 51 unmodified lines
5252 #include <mach/csp/chipcHw_inline.h>
5353 #include <mach/csp/tmrHw_reg.h>
5454
55−static AMBA_APB_DEVICE(uartA, "uarta", MM_ADDR_IO_UARTA, { IRQ_UARTA }, NULL);
56−static AMBA_APB_DEVICE(uartB, "uartb", MM_ADDR_IO_UARTB, { IRQ_UARTB }, NULL);
55+static AMBA_APB_DEVICE(uartA, "uartA", 0, MM_ADDR_IO_UARTA, {IRQ_UARTA}, NULL);
56+static AMBA_APB_DEVICE(uartB, "uartB", 0, MM_ADDR_IO_UARTB, {IRQ_UARTB}, NULL);
5757
5858 static struct clk pll1_clk = {
5959 .name = "PLL1",
arch/arm/mach-exynos/Kconfig+2−0
@@ -368,6 +368,7 @@ comment "Flattened Device Tree based board for EXYNOS SoCs" · 367 unmodified lines
368368
369369 config MACH_EXYNOS4_DT
370370 bool "Samsung Exynos4 Machine using device tree"
371+ depends on ARCH_EXYNOS4
371372 select CPU_EXYNOS4210
372373 select USE_OF
373374 select ARM_AMBA
@@ -380,6 +381,7 @@ config MACH_EXYNOS4_DT · 6 unmodified lines
380381
381382 config MACH_EXYNOS5_DT
382383 bool "SAMSUNG EXYNOS5 Machine using device tree"
384+ depends on ARCH_EXYNOS5
383385 select SOC_EXYNOS5250
384386 select USE_OF
385387 select ARM_AMBA
arch/arm/mach-exynos/clock-exynos4.c+12−12
@@ -497,25 +497,25 @@ static struct clk exynos4_init_clocks_off[] = { · 496 unmodified lines
497497 .ctrlbit = (1 << 3),
498498 }, {
499499 .name = "hsmmc",
500− .devname = "s3c-sdhci.0",
500+ .devname = "exynos4-sdhci.0",
501501 .parent = &exynos4_clk_aclk_133.clk,
502502 .enable = exynos4_clk_ip_fsys_ctrl,
503503 .ctrlbit = (1 << 5),
504504 }, {
505505 .name = "hsmmc",
506− .devname = "s3c-sdhci.1",
506+ .devname = "exynos4-sdhci.1",
507507 .parent = &exynos4_clk_aclk_133.clk,
508508 .enable = exynos4_clk_ip_fsys_ctrl,
509509 .ctrlbit = (1 << 6),
510510 }, {
511511 .name = "hsmmc",
512− .devname = "s3c-sdhci.2",
512+ .devname = "exynos4-sdhci.2",
513513 .parent = &exynos4_clk_aclk_133.clk,
514514 .enable = exynos4_clk_ip_fsys_ctrl,
515515 .ctrlbit = (1 << 7),
516516 }, {
517517 .name = "hsmmc",
518− .devname = "s3c-sdhci.3",
518+ .devname = "exynos4-sdhci.3",
519519 .parent = &exynos4_clk_aclk_133.clk,
520520 .enable = exynos4_clk_ip_fsys_ctrl,
521521 .ctrlbit = (1 << 8),
@@ -1202,7 +1202,7 @@ static struct clksrc_clk exynos4_clk_sclk_uart3 = { · 680 unmodified lines
12021202 static struct clksrc_clk exynos4_clk_sclk_mmc0 = {
12031203 .clk = {
12041204 .name = "sclk_mmc",
1205− .devname = "s3c-sdhci.0",
1205+ .devname = "exynos4-sdhci.0",
12061206 .parent = &exynos4_clk_dout_mmc0.clk,
12071207 .enable = exynos4_clksrc_mask_fsys_ctrl,
12081208 .ctrlbit = (1 << 0),
@@ -1213,7 +1213,7 @@ static struct clksrc_clk exynos4_clk_sclk_mmc0 = { · 4 unmodified lines
12131213 static struct clksrc_clk exynos4_clk_sclk_mmc1 = {
12141214 .clk = {
12151215 .name = "sclk_mmc",
1216− .devname = "s3c-sdhci.1",
1216+ .devname = "exynos4-sdhci.1",
12171217 .parent = &exynos4_clk_dout_mmc1.clk,
12181218 .enable = exynos4_clksrc_mask_fsys_ctrl,
12191219 .ctrlbit = (1 << 4),
@@ -1224,7 +1224,7 @@ static struct clksrc_clk exynos4_clk_sclk_mmc1 = { · 4 unmodified lines
12241224 static struct clksrc_clk exynos4_clk_sclk_mmc2 = {
12251225 .clk = {
12261226 .name = "sclk_mmc",
1227− .devname = "s3c-sdhci.2",
1227+ .devname = "exynos4-sdhci.2",
12281228 .parent = &exynos4_clk_dout_mmc2.clk,
12291229 .enable = exynos4_clksrc_mask_fsys_ctrl,
12301230 .ctrlbit = (1 << 8),
@@ -1235,7 +1235,7 @@ static struct clksrc_clk exynos4_clk_sclk_mmc2 = { · 4 unmodified lines
12351235 static struct clksrc_clk exynos4_clk_sclk_mmc3 = {
12361236 .clk = {
12371237 .name = "sclk_mmc",
1238− .devname = "s3c-sdhci.3",
1238+ .devname = "exynos4-sdhci.3",
12391239 .parent = &exynos4_clk_dout_mmc3.clk,
12401240 .enable = exynos4_clksrc_mask_fsys_ctrl,
12411241 .ctrlbit = (1 << 12),
@@ -1340,10 +1340,10 @@ static struct clk_lookup exynos4_clk_lookup[] = { · 98 unmodified lines
13401340 CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &exynos4_clk_sclk_uart1.clk),
13411341 CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &exynos4_clk_sclk_uart2.clk),
13421342 CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &exynos4_clk_sclk_uart3.clk),
1343− CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &exynos4_clk_sclk_mmc0.clk),
1344− CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &exynos4_clk_sclk_mmc1.clk),
1345− CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &exynos4_clk_sclk_mmc2.clk),
1346− CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.2", &exynos4_clk_sclk_mmc3.clk),
1343+ CLKDEV_INIT("exynos4-sdhci.0", "mmc_busclk.2", &exynos4_clk_sclk_mmc0.clk),
1344+ CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &exynos4_clk_sclk_mmc1.clk),
1345+ CLKDEV_INIT("exynos4-sdhci.2", "mmc_busclk.2", &exynos4_clk_sclk_mmc2.clk),
1346+ CLKDEV_INIT("exynos4-sdhci.3", "mmc_busclk.2", &exynos4_clk_sclk_mmc3.clk),
13471347 CLKDEV_INIT("exynos4-fb.0", "lcd", &exynos4_clk_fimd0),
13481348 CLKDEV_INIT("dma-pl330.0", "apb_pclk", &exynos4_clk_pdma0),
13491349 CLKDEV_INIT("dma-pl330.1", "apb_pclk", &exynos4_clk_pdma1),
arch/arm/mach-exynos/clock-exynos5.c+12−12
@@ -455,25 +455,25 @@ static struct clk exynos5_init_clocks_off[] = { · 454 unmodified lines
455455 .ctrlbit = (1 << 20),
456456 }, {
457457 .name = "hsmmc",
458− .devname = "s3c-sdhci.0",
458+ .devname = "exynos4-sdhci.0",
459459 .parent = &exynos5_clk_aclk_200.clk,
460460 .enable = exynos5_clk_ip_fsys_ctrl,
461461 .ctrlbit = (1 << 12),
462462 }, {
463463 .name = "hsmmc",
464− .devname = "s3c-sdhci.1",
464+ .devname = "exynos4-sdhci.1",
465465 .parent = &exynos5_clk_aclk_200.clk,
466466 .enable = exynos5_clk_ip_fsys_ctrl,
467467 .ctrlbit = (1 << 13),
468468 }, {
469469 .name = "hsmmc",
470− .devname = "s3c-sdhci.2",
470+ .devname = "exynos4-sdhci.2",
471471 .parent = &exynos5_clk_aclk_200.clk,
472472 .enable = exynos5_clk_ip_fsys_ctrl,
473473 .ctrlbit = (1 << 14),
474474 }, {
475475 .name = "hsmmc",
476− .devname = "s3c-sdhci.3",
476+ .devname = "exynos4-sdhci.3",
477477 .parent = &exynos5_clk_aclk_200.clk,
478478 .enable = exynos5_clk_ip_fsys_ctrl,
479479 .ctrlbit = (1 << 15),
@@ -813,7 +813,7 @@ static struct clksrc_clk exynos5_clk_sclk_uart3 = { · 333 unmodified lines
813813 static struct clksrc_clk exynos5_clk_sclk_mmc0 = {
814814 .clk = {
815815 .name = "sclk_mmc",
816− .devname = "s3c-sdhci.0",
816+ .devname = "exynos4-sdhci.0",
817817 .parent = &exynos5_clk_dout_mmc0.clk,
818818 .enable = exynos5_clksrc_mask_fsys_ctrl,
819819 .ctrlbit = (1 << 0),
@@ -824,7 +824,7 @@ static struct clksrc_clk exynos5_clk_sclk_mmc0 = { · 4 unmodified lines
824824 static struct clksrc_clk exynos5_clk_sclk_mmc1 = {
825825 .clk = {
826826 .name = "sclk_mmc",
827− .devname = "s3c-sdhci.1",
827+ .devname = "exynos4-sdhci.1",
828828 .parent = &exynos5_clk_dout_mmc1.clk,
829829 .enable = exynos5_clksrc_mask_fsys_ctrl,
830830 .ctrlbit = (1 << 4),
@@ -835,7 +835,7 @@ static struct clksrc_clk exynos5_clk_sclk_mmc1 = { · 4 unmodified lines
835835 static struct clksrc_clk exynos5_clk_sclk_mmc2 = {
836836 .clk = {
837837 .name = "sclk_mmc",
838− .devname = "s3c-sdhci.2",
838+ .devname = "exynos4-sdhci.2",
839839 .parent = &exynos5_clk_dout_mmc2.clk,
840840 .enable = exynos5_clksrc_mask_fsys_ctrl,
841841 .ctrlbit = (1 << 8),
@@ -846,7 +846,7 @@ static struct clksrc_clk exynos5_clk_sclk_mmc2 = { · 4 unmodified lines
846846 static struct clksrc_clk exynos5_clk_sclk_mmc3 = {
847847 .clk = {
848848 .name = "sclk_mmc",
849− .devname = "s3c-sdhci.3",
849+ .devname = "exynos4-sdhci.3",
850850 .parent = &exynos5_clk_dout_mmc3.clk,
851851 .enable = exynos5_clksrc_mask_fsys_ctrl,
852852 .ctrlbit = (1 << 12),
@@ -990,10 +990,10 @@ static struct clk_lookup exynos5_clk_lookup[] = { · 137 unmodified lines
990990 CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &exynos5_clk_sclk_uart1.clk),
991991 CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &exynos5_clk_sclk_uart2.clk),
992992 CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &exynos5_clk_sclk_uart3.clk),
993− CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &exynos5_clk_sclk_mmc0.clk),
994− CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &exynos5_clk_sclk_mmc1.clk),
995− CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &exynos5_clk_sclk_mmc2.clk),
996− CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.2", &exynos5_clk_sclk_mmc3.clk),
993+ CLKDEV_INIT("exynos4-sdhci.0", "mmc_busclk.2", &exynos5_clk_sclk_mmc0.clk),
994+ CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &exynos5_clk_sclk_mmc1.clk),
995+ CLKDEV_INIT("exynos4-sdhci.2", "mmc_busclk.2", &exynos5_clk_sclk_mmc2.clk),
996+ CLKDEV_INIT("exynos4-sdhci.3", "mmc_busclk.2", &exynos5_clk_sclk_mmc3.clk),
997997 CLKDEV_INIT("dma-pl330.0", "apb_pclk", &exynos5_clk_pdma0),
998998 CLKDEV_INIT("dma-pl330.1", "apb_pclk", &exynos5_clk_pdma1),
999999 CLKDEV_INIT("dma-pl330.2", "apb_pclk", &exynos5_clk_mdma1),
arch/arm/mach-exynos/common.c+13−1
@@ -326,6 +326,11 @@ static void __init exynos4_map_io(void) · 325 unmodified lines
326326 s3c_fimc_setname(2, "exynos4-fimc");
327327 s3c_fimc_setname(3, "exynos4-fimc");
328328
329+ s3c_sdhci_setname(0, "exynos4-sdhci");
330+ s3c_sdhci_setname(1, "exynos4-sdhci");
331+ s3c_sdhci_setname(2, "exynos4-sdhci");
332+ s3c_sdhci_setname(3, "exynos4-sdhci");
333+
329334 /* The I2C bus controllers are directly compatible with s3c2440 */
330335 s3c_i2c0_setname("s3c2440-i2c");
331336 s3c_i2c1_setname("s3c2440-i2c");
@@ -344,6 +349,11 @@ static void __init exynos5_map_io(void) · 12 unmodified lines
344349 s3c_device_i2c0.resource[1].start = EXYNOS5_IRQ_IIC;
345350 s3c_device_i2c0.resource[1].end = EXYNOS5_IRQ_IIC;
346351
352+ s3c_sdhci_setname(0, "exynos4-sdhci");
353+ s3c_sdhci_setname(1, "exynos4-sdhci");
354+ s3c_sdhci_setname(2, "exynos4-sdhci");
355+ s3c_sdhci_setname(3, "exynos4-sdhci");
356+
347357 /* The I2C bus controllers are directly compatible with s3c2440 */
348358 s3c_i2c0_setname("s3c2440-i2c");
349359 s3c_i2c1_setname("s3c2440-i2c");
@@ -537,7 +547,9 @@ void __init exynos5_init_irq(void) · 187 unmodified lines
537547 {
538548 int irq;
539549
540− gic_init(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU);
550+#ifdef CONFIG_OF
551+ of_irq_init(exynos4_dt_irq_match);
552+#endif
541553
542554 for (irq = 0; irq < EXYNOS5_MAX_COMBINER_NR; irq++) {
543555 combiner_init(irq, (void __iomem *)S5P_VA_COMBINER(irq),
arch/arm/mach-exynos/dev-dwmci.c+3−10
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/dma-mapping.h>
1717 #include <linux/platform_device.h>
1818 #include <linux/interrupt.h>
19+#include <linux/ioport.h>
1920 #include <linux/mmc/dw_mmc.h>
2021
2122 #include <plat/devs.h>
@@ -33,16 +34,8 @@ static int exynos4_dwmci_init(u32 slot_id, irq_handler_t handler, void *data) · 11 unmodified lines
3334 }
3435
3536 static struct resource exynos4_dwmci_resource[] = {
36− [0] = {
37− .start = EXYNOS4_PA_DWMCI,
38− .end = EXYNOS4_PA_DWMCI + SZ_4K - 1,
39− .flags = IORESOURCE_MEM,
40− },
41− [1] = {
42− .start = IRQ_DWMCI,
43− .end = IRQ_DWMCI,
44− .flags = IORESOURCE_IRQ,
45− }
37+ [0] = DEFINE_RES_MEM(EXYNOS4_PA_DWMCI, SZ_4K),
38+ [1] = DEFINE_RES_IRQ(EXYNOS4_IRQ_DWMCI),
4639 };
4740
4841 static struct dw_mci_board exynos4_dwci_pdata = {
arch/arm/mach-exynos/include/mach/irqs.h+2−0
@@ -212,6 +212,8 @@ · 211 unmodified lines
212212 #define IRQ_MFC EXYNOS4_IRQ_MFC
213213 #define IRQ_SDO EXYNOS4_IRQ_SDO
214214
215+#define IRQ_I2S0 EXYNOS4_IRQ_I2S0
216+
215217 #define IRQ_ADC EXYNOS4_IRQ_ADC0
216218 #define IRQ_TC EXYNOS4_IRQ_PEN0
217219
arch/arm/mach-exynos/include/mach/map.h+4−0
@@ -89,6 +89,10 @@ · 88 unmodified lines
8989 #define EXYNOS4_PA_MDMA1 0x12840000
9090 #define EXYNOS4_PA_PDMA0 0x12680000
9191 #define EXYNOS4_PA_PDMA1 0x12690000
92+#define EXYNOS5_PA_MDMA0 0x10800000
93+#define EXYNOS5_PA_MDMA1 0x11C10000
94+#define EXYNOS5_PA_PDMA0 0x121A0000
95+#define EXYNOS5_PA_PDMA1 0x121B0000
9296
9397 #define EXYNOS4_PA_SYSMMU_MDMA 0x10A40000
9498 #define EXYNOS4_PA_SYSMMU_SSS 0x10A50000
arch/arm/mach-exynos/include/mach/regs-clock.h+6−0
@@ -255,9 +255,15 @@ · 254 unmodified lines
255255
256256 /* For EXYNOS5250 */
257257
258+#define EXYNOS5_APLL_LOCK EXYNOS_CLKREG(0x00000)
258259 #define EXYNOS5_APLL_CON0 EXYNOS_CLKREG(0x00100)
259260 #define EXYNOS5_CLKSRC_CPU EXYNOS_CLKREG(0x00200)
261+#define EXYNOS5_CLKMUX_STATCPU EXYNOS_CLKREG(0x00400)
260262 #define EXYNOS5_CLKDIV_CPU0 EXYNOS_CLKREG(0x00500)
263+#define EXYNOS5_CLKDIV_CPU1 EXYNOS_CLKREG(0x00504)
264+#define EXYNOS5_CLKDIV_STATCPU0 EXYNOS_CLKREG(0x00600)
265+#define EXYNOS5_CLKDIV_STATCPU1 EXYNOS_CLKREG(0x00604)
266+
261267 #define EXYNOS5_MPLL_CON0 EXYNOS_CLKREG(0x04100)
262268 #define EXYNOS5_CLKSRC_CORE1 EXYNOS_CLKREG(0x04204)
263269
arch/arm/mach-exynos/mach-exynos5-dt.c+1−1
@@ -45,7 +45,7 @@ static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = { · 44 unmodified lines
4545 "exynos4210-uart.3", NULL),
4646 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA0, "dma-pl330.0", NULL),
4747 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA1, "dma-pl330.1", NULL),
48− OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA1, "dma-pl330.2", NULL),
48+ OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_MDMA1, "dma-pl330.2", NULL),
4949 {},
5050 };
5151
arch/arm/mach-exynos/mach-nuri.c+3−44
@@ -112,6 +112,7 @@ static struct s3c_sdhci_platdata nuri_hsmmc0_data __initdata = { · 111 unmodified lines
112112 .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA |
113113 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
114114 MMC_CAP_ERASE),
115+ .host_caps2 = MMC_CAP2_BROKEN_VOLTAGE,
115116 .cd_type = S3C_SDHCI_CD_PERMANENT,
116117 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
117118 };
@@ -307,49 +308,7 @@ static struct i2c_board_info i2c1_devs[] __initdata = { · 189 unmodified lines
307308 };
308309
309310 /* TSP */
310−static u8 mxt_init_vals[] = {
311− /* MXT_GEN_COMMAND(6) */
312− 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
313− /* MXT_GEN_POWER(7) */
314− 0x20, 0xff, 0x32,
315− /* MXT_GEN_ACQUIRE(8) */
316− 0x0a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x09, 0x23,
317− /* MXT_TOUCH_MULTI(9) */
318− 0x00, 0x00, 0x00, 0x13, 0x0b, 0x00, 0x00, 0x00, 0x02, 0x00,
319− 0x00, 0x01, 0x01, 0x0e, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x00,
320− 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
321− 0x00,
322− /* MXT_TOUCH_KEYARRAY(15) */
323− 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
324− 0x00,
325− /* MXT_SPT_GPIOPWM(19) */
326− 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
327− 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
328− /* MXT_PROCI_GRIPFACE(20) */
329− 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x28, 0x04,
330− 0x0f, 0x0a,
331− /* MXT_PROCG_NOISE(22) */
332− 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x23, 0x00,
333− 0x00, 0x05, 0x0f, 0x19, 0x23, 0x2d, 0x03,
334− /* MXT_TOUCH_PROXIMITY(23) */
335− 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
336− 0x00, 0x00, 0x00, 0x00, 0x00,
337− /* MXT_PROCI_ONETOUCH(24) */
338− 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
339− 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
340− /* MXT_SPT_SELFTEST(25) */
341− 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
342− 0x00, 0x00, 0x00, 0x00,
343− /* MXT_PROCI_TWOTOUCH(27) */
344− 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
345− /* MXT_SPT_CTECONFIG(28) */
346− 0x00, 0x00, 0x02, 0x08, 0x10, 0x00,
347−};
348−
349311 static struct mxt_platform_data mxt_platform_data = {
350− .config = mxt_init_vals,
351− .config_length = ARRAY_SIZE(mxt_init_vals),
352−
353312 .x_line = 18,
354313 .y_line = 11,
355314 .x_size = 1024,
@@ -571,7 +530,7 @@ static struct regulator_init_data __initdata max8997_ldo7_data = { · 215 unmodified lines
571530
572531 static struct regulator_init_data __initdata max8997_ldo8_data = {
573532 .constraints = {
574− .name = "VUSB/VDAC_3.3V_C210",
533+ .name = "VUSB+VDAC_3.3V_C210",
575534 .min_uV = 3300000,
576535 .max_uV = 3300000,
577536 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
@@ -1347,6 +1306,7 @@ static struct platform_device *nuri_devices[] __initdata = { · 769 unmodified lines
13471306
13481307 static void __init nuri_map_io(void)
13491308 {
1309+ clk_xusbxti.rate = 24000000;
13501310 exynos_init_io(NULL, 0);
13511311 s3c24xx_init_clocks(24000000);
13521312 s3c24xx_init_uarts(nuri_uartcfgs, ARRAY_SIZE(nuri_uartcfgs));
@@ -1379,7 +1339,6 @@ static void __init nuri_machine_init(void) · 26 unmodified lines
13791339 nuri_camera_init();
13801340
13811341 nuri_ehci_init();
1382− clk_xusbxti.rate = 24000000;
13831342
13841343 /* Last */
13851344 platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices));
arch/arm/mach-exynos/mach-universal_c210.c+3−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include <asm/mach-types.h>
3030
3131 #include <plat/regs-serial.h>
32+#include <plat/clock.h>
3233 #include <plat/cpu.h>
3334 #include <plat/devs.h>
3435 #include <plat/iic.h>
@@ -746,6 +747,7 @@ static struct s3c_sdhci_platdata universal_hsmmc0_data __initdata = { · 711 unmodified lines
746747 .max_width = 8,
747748 .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA |
748749 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
750+ .host_caps2 = MMC_CAP2_BROKEN_VOLTAGE,
749751 .cd_type = S3C_SDHCI_CD_PERMANENT,
750752 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
751753 };
@@ -1057,6 +1059,7 @@ static struct platform_device *universal_devices[] __initdata = { · 305 unmodified lines
10571059
10581060 static void __init universal_map_io(void)
10591061 {
1062+ clk_xusbxti.rate = 24000000;
10601063 exynos_init_io(NULL, 0);
10611064 s3c24xx_init_clocks(24000000);
10621065 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
arch/arm/mach-imx/imx27-dt.c+4−2
@@ -35,7 +35,7 @@ static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = { · 34 unmodified lines
3535 static int __init imx27_avic_add_irq_domain(struct device_node *np,
3636 struct device_node *interrupt_parent)
3737 {
38− irq_domain_add_simple(np, 0);
38+ irq_domain_add_legacy(np, 64, 0, 0, &irq_domain_simple_ops, NULL);
3939 return 0;
4040 }
4141
@@ -44,7 +44,9 @@ static int __init imx27_gpio_add_irq_domain(struct device_node *np, · 2 unmodified lines
4444 {
4545 static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS;
4646
47− irq_domain_add_simple(np, gpio_irq_base);
47+ gpio_irq_base -= 32;
48+ irq_domain_add_legacy(np, 32, gpio_irq_base, 0, &irq_domain_simple_ops,
49+ NULL);
4850
4951 return 0;
5052 }
arch/arm/mach-imx/mm-imx5.c+1−1
@@ -35,7 +35,7 @@ static void imx5_idle(void) · 34 unmodified lines
3535 }
3636 clk_enable(gpc_dvfs_clk);
3737 mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF);
38− if (tzic_enable_wake() != 0)
38+ if (!tzic_enable_wake())
3939 cpu_do_idle();
4040 clk_disable(gpc_dvfs_clk);
4141 }
arch/arm/mach-msm/board-halibut.c+0−3
@@ -86,9 +86,6 @@ static void __init halibut_init(void) · 85 unmodified lines
8686 static void __init halibut_fixup(struct tag *tags, char **cmdline,
8787 struct meminfo *mi)
8888 {
89− mi->nr_banks=1;
90− mi->bank[0].start = PHYS_OFFSET;
91− mi->bank[0].size = (101*1024*1024);
9289 }
9390
9491 static void __init halibut_map_io(void)
arch/arm/mach-msm/board-msm8x60.c+15−10
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <linux/irqdomain.h>
1818 #include <linux/of.h>
1919 #include <linux/of_address.h>
20+#include <linux/of_irq.h>
2021 #include <linux/of_platform.h>
2122 #include <linux/memblock.h>
2223
@@ -49,10 +50,22 @@ static void __init msm8x60_map_io(void) · 26 unmodified lines
4950 msm_map_msm8x60_io();
5051 }
5152
53+#ifdef CONFIG_OF
54+static struct of_device_id msm_dt_gic_match[] __initdata = {
55+ { .compatible = "qcom,msm-8660-qgic", .data = gic_of_init },
56+ {}
57+};
58+#endif
59+
5260 static void __init msm8x60_init_irq(void)
5361 {
54− gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
55− (void *)MSM_QGIC_CPU_BASE);
62+ if (!of_have_populated_dt())
63+ gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
64+ (void *)MSM_QGIC_CPU_BASE);
65+#ifdef CONFIG_OF
66+ else
67+ of_irq_init(msm_dt_gic_match);
68+#endif
5669
5770 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
5871 writel(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
@@ -73,16 +86,8 @@ static struct of_dev_auxdata msm_auxdata_lookup[] __initdata = { · 14 unmodified lines
7386 {}
7487 };
7588
76−static struct of_device_id msm_dt_gic_match[] __initdata = {
77− { .compatible = "qcom,msm-8660-qgic", },
78− {}
79−};
80−
8189 static void __init msm8x60_dt_init(void)
8290 {
83− irq_domain_generate_simple(msm_dt_gic_match, MSM8X60_QGIC_DIST_PHYS,
84− GIC_SPI_START);
85−
8691 if (of_machine_is_compatible("qcom,msm8660-surf")) {
8792 printk(KERN_INFO "Init surf UART registers\n");
8893 msm8x60_init_uart12dm();
arch/arm/mach-msm/board-trout-panel.c+1−0
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212
1313 #include <asm/io.h>
1414 #include <asm/mach-types.h>
15+#include <asm/system_info.h>
1516
1617 #include <mach/msm_fb.h>
1718 #include <mach/vreg.h>
arch/arm/mach-msm/board-trout.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/platform_device.h>
2020 #include <linux/clkdev.h>
2121
22+#include <asm/system_info.h>
2223 #include <asm/mach-types.h>
2324 #include <asm/mach/arch.h>
2425 #include <asm/mach/map.h>
arch/arm/mach-msm/proc_comm.c+1−1
@@ -121,7 +121,7 @@ int msm_proc_comm(unsigned cmd, unsigned *data1, unsigned *data2) · 120 unmodified lines
121121 * and unknown state. This function should be called early to
122122 * wait on the ARM9.
123123 */
124−void __init proc_comm_boot_wait(void)
124+void __devinit proc_comm_boot_wait(void)
125125 {
126126 void __iomem *base = MSM_SHARED_RAM_BASE;
127127
arch/arm/mach-omap1/mux.c+1−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 #include <linux/io.h>
2828 #include <linux/spinlock.h>
2929
30+#include <mach/hardware.h>
3031
3132 #include <plat/mux.h>
3233
arch/arm/mach-omap1/timer.c+2−2
@@ -47,9 +47,9 @@ static int omap1_dm_timer_set_src(struct platform_device *pdev, · 46 unmodified lines
4747 int n = (pdev->id - 1) << 1;
4848 u32 l;
4949
50− l = __raw_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
50+ l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
5151 l |= source << n;
52− __raw_writel(l, MOD_CONF_CTRL_1);
52+ omap_writel(l, MOD_CONF_CTRL_1);
5353
5454 return 0;
5555 }
arch/arm/mach-omap2/board-4430sdp.c+6−6
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 #include <linux/usb/otg.h>
2121 #include <linux/spi/spi.h>
2222 #include <linux/i2c/twl.h>
23+#include <linux/mfd/twl6040.h>
2324 #include <linux/gpio_keys.h>
2425 #include <linux/regulator/machine.h>
2526 #include <linux/regulator/fixed.h>
@@ -560,7 +561,7 @@ static struct regulator_init_data sdp4430_vusim = { · 534 unmodified lines
560561 },
561562 };
562563
563−static struct twl4030_codec_data twl6040_codec = {
564+static struct twl6040_codec_data twl6040_codec = {
564565 /* single-step ramp for headset and handsfree */
565566 .hs_left_step = 0x0f,
566567 .hs_right_step = 0x0f,
@@ -568,7 +569,7 @@ static struct twl4030_codec_data twl6040_codec = { · 1 unmodified line
568569 .hf_right_step = 0x1d,
569570 };
570571
571−static struct twl4030_vibra_data twl6040_vibra = {
572+static struct twl6040_vibra_data twl6040_vibra = {
572573 .vibldrv_res = 8,
573574 .vibrdrv_res = 3,
574575 .viblmotor_res = 10,
@@ -577,16 +578,14 @@ static struct twl4030_vibra_data twl6040_vibra = { · 2 unmodified lines
577578 .vddvibr_uV = 0, /* fixed volt supply - VBAT */
578579 };
579580
580−static struct twl4030_audio_data twl6040_audio = {
581+static struct twl6040_platform_data twl6040_data = {
581582 .codec = &twl6040_codec,
582583 .vibra = &twl6040_vibra,
583584 .audpwron_gpio = 127,
584− .naudint_irq = OMAP44XX_IRQ_SYS_2N,
585585 .irq_base = TWL6040_CODEC_IRQ_BASE,
586586 };
587587
588588 static struct twl4030_platform_data sdp4430_twldata = {
589− .audio = &twl6040_audio,
590589 /* Regulators */
591590 .vusim = &sdp4430_vusim,
592591 .vaux1 = &sdp4430_vaux1,
@@ -617,7 +616,8 @@ static int __init omap4_i2c_init(void) · 24 unmodified lines
617616 TWL_COMMON_REGULATOR_VCXIO |
618617 TWL_COMMON_REGULATOR_VUSB |
619618 TWL_COMMON_REGULATOR_CLK32KG);
620− omap4_pmic_init("twl6030", &sdp4430_twldata);
619+ omap4_pmic_init("twl6030", &sdp4430_twldata,
620+ &twl6040_data, OMAP44XX_IRQ_SYS_2N);
621621 omap_register_i2c_bus(2, 400, NULL, 0);
622622 omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
623623 ARRAY_SIZE(sdp4430_i2c_3_boardinfo));
arch/arm/mach-omap2/board-generic.c+1−1
@@ -137,7 +137,7 @@ static struct twl4030_platform_data sdp4430_twldata = { · 136 unmodified lines
137137
138138 static void __init omap4_i2c_init(void)
139139 {
140− omap4_pmic_init("twl6030", &sdp4430_twldata);
140+ omap4_pmic_init("twl6030", &sdp4430_twldata, NULL, 0);
141141 }
142142
143143 static void __init omap4_init(void)
arch/arm/mach-omap2/board-omap4panda.c+6−7
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <linux/gpio.h>
2626 #include <linux/usb/otg.h>
2727 #include <linux/i2c/twl.h>
28+#include <linux/mfd/twl6040.h>
2829 #include <linux/regulator/machine.h>
2930 #include <linux/regulator/fixed.h>
3031 #include <linux/wl12xx.h>
@@ -284,7 +285,7 @@ static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) · 253 unmodified lines
284285 return 0;
285286 }
286287
287−static struct twl4030_codec_data twl6040_codec = {
288+static struct twl6040_codec_data twl6040_codec = {
288289 /* single-step ramp for headset and handsfree */
289290 .hs_left_step = 0x0f,
290291 .hs_right_step = 0x0f,
@@ -292,17 +293,14 @@ static struct twl4030_codec_data twl6040_codec = { · 1 unmodified line
292293 .hf_right_step = 0x1d,
293294 };
294295
295−static struct twl4030_audio_data twl6040_audio = {
296+static struct twl6040_platform_data twl6040_data = {
296297 .codec = &twl6040_codec,
297298 .audpwron_gpio = 127,
298− .naudint_irq = OMAP44XX_IRQ_SYS_2N,
299299 .irq_base = TWL6040_CODEC_IRQ_BASE,
300300 };
301301
302302 /* Panda board uses the common PMIC configuration */
303−static struct twl4030_platform_data omap4_panda_twldata = {
304− .audio = &twl6040_audio,
305−};
303+static struct twl4030_platform_data omap4_panda_twldata;
306304
307305 /*
308306 * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM
@@ -326,7 +324,8 @@ static int __init omap4_panda_i2c_init(void) · 17 unmodified lines
326324 TWL_COMMON_REGULATOR_VCXIO |
327325 TWL_COMMON_REGULATOR_VUSB |
328326 TWL_COMMON_REGULATOR_CLK32KG);
329− omap4_pmic_init("twl6030", &omap4_panda_twldata);
327+ omap4_pmic_init("twl6030", &omap4_panda_twldata,
328+ &twl6040_data, OMAP44XX_IRQ_SYS_2N);
330329 omap_register_i2c_bus(2, 400, NULL, 0);
331330 /*
332331 * Bus 3 is attached to the DVI port where devices like the pico DLP
arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c+0−80
@@ -165,83 +165,3 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate) · 164 unmodified lines
165165
166166 return 0;
167167 }
168−
169−#ifdef CONFIG_CPU_FREQ
170−/*
171− * Walk PRCM rate table and fillout cpufreq freq_table
172− * XXX This should be replaced by an OPP layer in the near future
173− */
174−static struct cpufreq_frequency_table *freq_table;
175−
176−void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
177−{
178− const struct prcm_config *prcm;
179− int i = 0;
180− int tbl_sz = 0;
181−
182− if (!cpu_is_omap24xx())
183− return;
184−
185− for (prcm = rate_table; prcm->mpu_speed; prcm++) {
186− if (!(prcm->flags & cpu_mask))
187− continue;
188− if (prcm->xtal_speed != sclk->rate)
189− continue;
190−
191− /* don't put bypass rates in table */
192− if (prcm->dpll_speed == prcm->xtal_speed)
193− continue;
194−
195− tbl_sz++;
196− }
197−
198− /*
199− * XXX Ensure that we're doing what CPUFreq expects for this error
200− * case and the following one
201− */
202− if (tbl_sz == 0) {
203− pr_warning("%s: no matching entries in rate_table\n",
204− __func__);
205− return;
206− }
207−
208− /* Include the CPUFREQ_TABLE_END terminator entry */
209− tbl_sz++;
210−
211− freq_table = kzalloc(sizeof(struct cpufreq_frequency_table) * tbl_sz,
212− GFP_ATOMIC);
213− if (!freq_table) {
214− pr_err("%s: could not kzalloc frequency table\n", __func__);
215− return;
216− }
217−
218− for (prcm = rate_table; prcm->mpu_speed; prcm++) {
219− if (!(prcm->flags & cpu_mask))
220− continue;
221− if (prcm->xtal_speed != sclk->rate)
222− continue;
223−
224− /* don't put bypass rates in table */
225− if (prcm->dpll_speed == prcm->xtal_speed)
226− continue;
227−
228− freq_table[i].index = i;
229− freq_table[i].frequency = prcm->mpu_speed / 1000;
230− i++;
231− }
232−
233− freq_table[i].index = i;
234− freq_table[i].frequency = CPUFREQ_TABLE_END;
235−
236− *table = &freq_table[0];
237−}
238−
239−void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table)
240−{
241− if (!cpu_is_omap24xx())
242− return;
243−
244− kfree(freq_table);
245−}
246−
247−#endif
arch/arm/mach-omap2/clock.c+0−5
@@ -536,10 +536,5 @@ struct clk_functions omap2_clk_functions = { · 535 unmodified lines
536536 .clk_set_rate = omap2_clk_set_rate,
537537 .clk_set_parent = omap2_clk_set_parent,
538538 .clk_disable_unused = omap2_clk_disable_unused,
539−#ifdef CONFIG_CPU_FREQ
540− /* These will be removed when the OPP code is integrated */
541− .clk_init_cpufreq_table = omap2_clk_init_cpufreq_table,
542− .clk_exit_cpufreq_table = omap2_clk_exit_cpufreq_table,
543−#endif
544539 };
545540
arch/arm/mach-omap2/clock.h+0−8
@@ -146,14 +146,6 @@ extern const struct clksel_rate gpt_sys_rates[]; · 145 unmodified lines
146146 extern const struct clksel_rate gfx_l3_rates[];
147147 extern const struct clksel_rate dsp_ick_rates[];
148148
149−#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_CPU_FREQ)
150−extern void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
151−extern void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table);
152−#else
153−#define omap2_clk_init_cpufreq_table 0
154−#define omap2_clk_exit_cpufreq_table 0
155−#endif
156−
157149 extern const struct clkops clkops_omap2_iclk_dflt_wait;
158150 extern const struct clkops clkops_omap2_iclk_dflt;
159151 extern const struct clkops clkops_omap2_iclk_idle_only;
arch/arm/mach-omap2/omap_hwmod.c+15−2
@@ -1422,6 +1422,9 @@ static int _ocp_softreset(struct omap_hwmod *oh) · 1421 unmodified lines
14221422 goto dis_opt_clks;
14231423 _write_sysconfig(v, oh);
14241424
1425+ if (oh->class->sysc->srst_udelay)
1426+ udelay(oh->class->sysc->srst_udelay);
1427+
14251428 if (oh->class->sysc->sysc_flags & SYSS_HAS_RESET_STATUS)
14261429 omap_test_timeout((omap_hwmod_read(oh,
14271430 oh->class->sysc->syss_offs)
@@ -1903,10 +1906,20 @@ void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs) · 475 unmodified lines
19031906 */
19041907 int omap_hwmod_softreset(struct omap_hwmod *oh)
19051908 {
1906− if (!oh)
1909+ u32 v;
1910+ int ret;
1911+
1912+ if (!oh || !(oh->_sysc_cache))
19071913 return -EINVAL;
19081914
1909− return _ocp_softreset(oh);
1915+ v = oh->_sysc_cache;
1916+ ret = _set_softreset(oh, &v);
1917+ if (ret)
1918+ goto error;
1919+ _write_sysconfig(v, oh);
1920+
1921+error:
1922+ return ret;
19101923 }
19111924
19121925 /**
arch/arm/mach-omap2/omap_hwmod_2420_data.c+0−1
@@ -1000,7 +1000,6 @@ static struct omap_hwmod_ocp_if omap2420_l4_core__dss_venc = { · 999 unmodified lines
10001000 .flags = OMAP_FIREWALL_L4,
10011001 }
10021002 },
1003− .flags = OCPIF_SWSUP_IDLE,
10041003 .user = OCP_USER_MPU | OCP_USER_SDMA,
10051004 };
10061005
arch/arm/mach-omap2/omap_hwmod_2430_data.c+0−1
@@ -1049,7 +1049,6 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__dss_venc = { · 1048 unmodified lines
10491049 .slave = &omap2430_dss_venc_hwmod,
10501050 .clk = "dss_ick",
10511051 .addr = omap2_dss_venc_addrs,
1052− .flags = OCPIF_SWSUP_IDLE,
10531052 .user = OCP_USER_MPU | OCP_USER_SDMA,
10541053 };
10551054
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c+0−1
@@ -1676,7 +1676,6 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_venc = { · 1675 unmodified lines
16761676 .flags = OMAP_FIREWALL_L4,
16771677 }
16781678 },
1679− .flags = OCPIF_SWSUP_IDLE,
16801679 .user = OCP_USER_MPU | OCP_USER_SDMA,
16811680 };
16821681
arch/arm/mach-omap2/omap_hwmod_44xx_data.c+9−0
@@ -2594,6 +2594,15 @@ static struct omap_hwmod omap44xx_ipu_hwmod = { · 2593 unmodified lines
25942594 static struct omap_hwmod_class_sysconfig omap44xx_iss_sysc = {
25952595 .rev_offs = 0x0000,
25962596 .sysc_offs = 0x0010,
2597+ /*
2598+ * ISS needs 100 OCP clk cycles delay after a softreset before
2599+ * accessing sysconfig again.
2600+ * The lowest frequency at the moment for L3 bus is 100 MHz, so
2601+ * 1usec delay is needed. Add an x2 margin to be safe (2 usecs).
2602+ *
2603+ * TODO: Indicate errata when available.
2604+ */
2605+ .srst_udelay = 2,
25972606 .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_RESET_STATUS |
25982607 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
25992608 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
arch/arm/mach-omap2/serial.c+7−117
@@ -108,8 +108,14 @@ static void omap_uart_set_noidle(struct platform_device *pdev) · 107 unmodified lines
108108 static void omap_uart_set_smartidle(struct platform_device *pdev)
109109 {
110110 struct omap_device *od = to_omap_device(pdev);
111+ u8 idlemode;
111112
112− omap_hwmod_set_slave_idlemode(od->hwmods[0], HWMOD_IDLEMODE_SMART);
113+ if (od->hwmods[0]->class->sysc->idlemodes & SIDLE_SMART_WKUP)
114+ idlemode = HWMOD_IDLEMODE_SMART_WKUP;
115+ else
116+ idlemode = HWMOD_IDLEMODE_SMART;
117+
118+ omap_hwmod_set_slave_idlemode(od->hwmods[0], idlemode);
113119 }
114120
115121 #else
@@ -120,124 +126,8 @@ static void omap_uart_set_smartidle(struct platform_device *pdev) {} · 4 unmodified lines
120126 #endif /* CONFIG_PM */
121127
122128 #ifdef CONFIG_OMAP_MUX
123−static struct omap_device_pad default_uart1_pads[] __initdata = {
124− {
125− .name = "uart1_cts.uart1_cts",
126− .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
127− },
128− {
129− .name = "uart1_rts.uart1_rts",
130− .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
131− },
132− {
133− .name = "uart1_tx.uart1_tx",
134− .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
135− },
136− {
137− .name = "uart1_rx.uart1_rx",
138− .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
139− .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
140− .idle = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
141− },
142−};
143−
144−static struct omap_device_pad default_uart2_pads[] __initdata = {
145− {
146− .name = "uart2_cts.uart2_cts",
147− .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
148− },
149− {
150− .name = "uart2_rts.uart2_rts",
151− .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
152− },
153− {
154− .name = "uart2_tx.uart2_tx",
155− .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
156− },
157− {
158− .name = "uart2_rx.uart2_rx",
159− .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
160− .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
161− .idle = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
162− },
163−};
164−
165−static struct omap_device_pad default_uart3_pads[] __initdata = {
166− {
167− .name = "uart3_cts_rctx.uart3_cts_rctx",
168− .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
169− },
170− {
171− .name = "uart3_rts_sd.uart3_rts_sd",
172− .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
173− },
174− {
175− .name = "uart3_tx_irtx.uart3_tx_irtx",
176− .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
177− },
178− {
179− .name = "uart3_rx_irrx.uart3_rx_irrx",
180− .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
181− .enable = OMAP_PIN_INPUT | OMAP_MUX_MODE0,
182− .idle = OMAP_PIN_INPUT | OMAP_MUX_MODE0,
183− },
184−};
185−
186−static struct omap_device_pad default_omap36xx_uart4_pads[] __initdata = {
187− {
188− .name = "gpmc_wait2.uart4_tx",
189− .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
190− },
191− {
192− .name = "gpmc_wait3.uart4_rx",
193− .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
194− .enable = OMAP_PIN_INPUT | OMAP_MUX_MODE2,
195− .idle = OMAP_PIN_INPUT | OMAP_MUX_MODE2,
196− },
197−};
198−
199−static struct omap_device_pad default_omap4_uart4_pads[] __initdata = {
200− {
201− .name = "uart4_tx.uart4_tx",
202− .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
203− },
204− {
205− .name = "uart4_rx.uart4_rx",
206− .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
207− .enable = OMAP_PIN_INPUT | OMAP_MUX_MODE0,
208− .idle = OMAP_PIN_INPUT | OMAP_MUX_MODE0,
209− },
210−};
211−
212129 static void omap_serial_fill_default_pads(struct omap_board_data *bdata)
213130 {
214− switch (bdata->id) {
215− case 0:
216− bdata->pads = default_uart1_pads;
217− bdata->pads_cnt = ARRAY_SIZE(default_uart1_pads);
218− break;
219− case 1:
220− bdata->pads = default_uart2_pads;
221− bdata->pads_cnt = ARRAY_SIZE(default_uart2_pads);
222− break;
223− case 2:
224− bdata->pads = default_uart3_pads;
225− bdata->pads_cnt = ARRAY_SIZE(default_uart3_pads);
226− break;
227− case 3:
228− if (cpu_is_omap44xx()) {
229− bdata->pads = default_omap4_uart4_pads;
230− bdata->pads_cnt =
231− ARRAY_SIZE(default_omap4_uart4_pads);
232− } else if (cpu_is_omap3630()) {
233− bdata->pads = default_omap36xx_uart4_pads;
234− bdata->pads_cnt =
235− ARRAY_SIZE(default_omap36xx_uart4_pads);
236− }
237− break;
238− default:
239− break;
240− }
241131 }
242132 #else
243133 static void omap_serial_fill_default_pads(struct omap_board_data *bdata) {}
arch/arm/mach-omap2/twl-common.c+32−5
@@ -37,6 +37,16 @@ static struct i2c_board_info __initdata pmic_i2c_board_info = { · 36 unmodified lines
3737 .flags = I2C_CLIENT_WAKE,
3838 };
3939
40+static struct i2c_board_info __initdata omap4_i2c1_board_info[] = {
41+ {
42+ .addr = 0x48,
43+ .flags = I2C_CLIENT_WAKE,
44+ },
45+ {
46+ I2C_BOARD_INFO("twl6040", 0x4b),
47+ },
48+};
49+
4050 void __init omap_pmic_init(int bus, u32 clkrate,
4151 const char *pmic_type, int pmic_irq,
4252 struct twl4030_platform_data *pmic_data)
@@ -49,14 +59,31 @@ void __init omap_pmic_init(int bus, u32 clkrate, · 6 unmodified lines
4959 omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1);
5060 }
5161
62+void __init omap4_pmic_init(const char *pmic_type,
63+ struct twl4030_platform_data *pmic_data,
64+ struct twl6040_platform_data *twl6040_data, int twl6040_irq)
65+{
66+ /* PMIC part*/
67+ strncpy(omap4_i2c1_board_info[0].type, pmic_type,
68+ sizeof(omap4_i2c1_board_info[0].type));
69+ omap4_i2c1_board_info[0].irq = OMAP44XX_IRQ_SYS_1N;
70+ omap4_i2c1_board_info[0].platform_data = pmic_data;
71+
72+ /* TWL6040 audio IC part */
73+ omap4_i2c1_board_info[1].irq = twl6040_irq;
74+ omap4_i2c1_board_info[1].platform_data = twl6040_data;
75+
76+ omap_register_i2c_bus(1, 400, omap4_i2c1_board_info, 2);
77+
78+}
79+
5280 void __init omap_pmic_late_init(void)
5381 {
5482 /* Init the OMAP TWL parameters (if PMIC has been registerd) */
55− if (!pmic_i2c_board_info.irq)
56− return;
57−
58− omap3_twl_init();
59− omap4_twl_init();
83+ if (pmic_i2c_board_info.irq)
84+ omap3_twl_init();
85+ if (omap4_i2c1_board_info[0].irq)
86+ omap4_twl_init();
6087 }
6188
6289 #if defined(CONFIG_ARCH_OMAP3)
arch/arm/mach-omap2/twl-common.h+4−6
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929
3030
3131 struct twl4030_platform_data;
32+struct twl6040_platform_data;
3233
3334 void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq,
3435 struct twl4030_platform_data *pmic_data);
@@ -46,12 +47,9 @@ static inline void omap3_pmic_init(const char *pmic_type, · 11 unmodified lines
4647 omap_pmic_init(1, 2600, pmic_type, INT_34XX_SYS_NIRQ, pmic_data);
4748 }
4849
49−static inline void omap4_pmic_init(const char *pmic_type,
50− struct twl4030_platform_data *pmic_data)
51−{
52− /* Phoenix Audio IC needs I2C1 to start with 400 KHz or less */
53− omap_pmic_init(1, 400, pmic_type, OMAP44XX_IRQ_SYS_1N, pmic_data);
54−}
50+void omap4_pmic_init(const char *pmic_type,
51+ struct twl4030_platform_data *pmic_data,
52+ struct twl6040_platform_data *audio_data, int twl6040_irq);
5553
5654 void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
5755 u32 pdata_flags, u32 regulators_flags);
arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h+7−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 *
1818 * bit 23 - Input/Output (PXA2xx specific)
1919 * bit 24 - Wakeup Enable(PXA2xx specific)
20+ * bit 25 - Keep Output (PXA2xx specific)
2021 */
2122
2223 #define MFP_DIR_IN (0x0 << 23)
@@ -25,6 +26,12 @@ · 2 unmodified lines
2526 #define MFP_DIR(x) (((x) >> 23) & 0x1)
2627
2728 #define MFP_LPM_CAN_WAKEUP (0x1 << 24)
29+
30+/*
31+ * MFP_LPM_KEEP_OUTPUT must be specified for pins that need to
32+ * retain their last output level (low or high).
33+ * Note: MFP_LPM_KEEP_OUTPUT has no effect on pins configured for input.
34+ */
2835 #define MFP_LPM_KEEP_OUTPUT (0x1 << 25)
2936
3037 #define WAKEUP_ON_EDGE_RISE (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_RISE)
arch/arm/mach-pxa/mfp-pxa2xx.c+19−2
@@ -33,6 +33,8 @@ · 32 unmodified lines
3333 #define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
3434 #define GPLR(x) __REG2(0x40E00000, BANK_OFF((x) >> 5))
3535 #define GPDR(x) __REG2(0x40E00000, BANK_OFF((x) >> 5) + 0x0c)
36+#define GPSR(x) __REG2(0x40E00000, BANK_OFF((x) >> 5) + 0x18)
37+#define GPCR(x) __REG2(0x40E00000, BANK_OFF((x) >> 5) + 0x24)
3638
3739 #define PWER_WE35 (1 << 24)
3840
@@ -348,6 +350,7 @@ static inline void pxa27x_mfp_init(void) {} · 309 unmodified lines
348350 #ifdef CONFIG_PM
349351 static unsigned long saved_gafr[2][4];
350352 static unsigned long saved_gpdr[4];
353+static unsigned long saved_gplr[4];
351354 static unsigned long saved_pgsr[4];
352355
353356 static int pxa2xx_mfp_suspend(void)
@@ -366,14 +369,26 @@ static int pxa2xx_mfp_suspend(void) · 12 unmodified lines
366369 }
367370
368371 for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) {
369−
370372 saved_gafr[0][i] = GAFR_L(i);
371373 saved_gafr[1][i] = GAFR_U(i);
372374 saved_gpdr[i] = GPDR(i * 32);
375+ saved_gplr[i] = GPLR(i * 32);
373376 saved_pgsr[i] = PGSR(i);
374377
375− GPDR(i * 32) = gpdr_lpm[i];
378+ GPSR(i * 32) = PGSR(i);
379+ GPCR(i * 32) = ~PGSR(i);
380+ }
381+
382+ /* set GPDR bits taking into account MFP_LPM_KEEP_OUTPUT */
383+ for (i = 0; i < pxa_last_gpio; i++) {
384+ if ((gpdr_lpm[gpio_to_bank(i)] & GPIO_bit(i)) ||
385+ ((gpio_desc[i].config & MFP_LPM_KEEP_OUTPUT) &&
386+ (saved_gpdr[gpio_to_bank(i)] & GPIO_bit(i))))
387+ GPDR(i) |= GPIO_bit(i);
388+ else
389+ GPDR(i) &= ~GPIO_bit(i);
376390 }
391+
377392 return 0;
378393 }
379394
@@ -384,6 +399,8 @@ static void pxa2xx_mfp_resume(void) · 4 unmodified lines
384399 for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) {
385400 GAFR_L(i) = saved_gafr[0][i];
386401 GAFR_U(i) = saved_gafr[1][i];
402+ GPSR(i * 32) = saved_gplr[i];
403+ GPCR(i * 32) = ~saved_gplr[i];
387404 GPDR(i * 32) = saved_gpdr[i];
388405 PGSR(i) = saved_pgsr[i];
389406 }
arch/arm/mach-pxa/pxa27x.c+5−1
@@ -421,8 +421,11 @@ void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info) · 420 unmodified lines
421421 pxa_register_device(&pxa27x_device_i2c_power, info);
422422 }
423423
424+static struct pxa_gpio_platform_data pxa27x_gpio_info __initdata = {
425+ .gpio_set_wake = gpio_set_wake,
426+};
427+
424428 static struct platform_device *devices[] __initdata = {
425− &pxa_device_gpio,
426429 &pxa27x_device_udc,
427430 &pxa_device_pmu,
428431 &pxa_device_i2s,
@@ -458,6 +461,7 @@ static int __init pxa27x_init(void) · 29 unmodified lines
458461 register_syscore_ops(&pxa2xx_mfp_syscore_ops);
459462 register_syscore_ops(&pxa2xx_clock_syscore_ops);
460463
464+ pxa_register_device(&pxa_device_gpio, &pxa27x_gpio_info);
461465 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
462466 }
463467
arch/arm/mach-s3c24xx/Kconfig+4−4
@@ -111,10 +111,6 @@ config S3C24XX_SETUP_TS · 110 unmodified lines
111111 help
112112 Compile in platform device definition for Samsung TouchScreen.
113113
114−# cpu-specific sections
115−
116−if CPU_S3C2410
117−
118114 config S3C2410_DMA
119115 bool
120116 depends on S3C24XX_DMA && (CPU_S3C2410 || CPU_S3C2442)
@@ -127,6 +123,10 @@ config S3C2410_PM · 6 unmodified lines
127123 help
128124 Power Management code common to S3C2410 and better
129125
126+# cpu-specific sections
127+
128+if CPU_S3C2410
129+
130130 config S3C24XX_SIMTEC_NOR
131131 bool
132132 help
arch/arm/mach-s5pv210/dma.c+0−2
@@ -33,8 +33,6 @@ · 32 unmodified lines
3333 #include <mach/irqs.h>
3434 #include <mach/dma.h>
3535
36−static u64 dma_dmamask = DMA_BIT_MASK(32);
37−
3836 static u8 pdma0_peri[] = {
3937 DMACH_UART0_RX,
4038 DMACH_UART0_TX,
arch/arm/mach-s5pv210/mach-aquila.c+2−2
@@ -484,8 +484,8 @@ static struct wm8994_pdata wm8994_platform_data = { · 483 unmodified lines
484484 .gpio_defaults[8] = 0x0100,
485485 .gpio_defaults[9] = 0x0100,
486486 .gpio_defaults[10] = 0x0100,
487− .ldo[0] = { S5PV210_MP03(6), NULL, &wm8994_ldo1_data }, /* XM0FRNB_2 */
488− .ldo[1] = { 0, NULL, &wm8994_ldo2_data },
487+ .ldo[0] = { S5PV210_MP03(6), &wm8994_ldo1_data }, /* XM0FRNB_2 */
488+ .ldo[1] = { 0, &wm8994_ldo2_data },
489489 };
490490
491491 /* GPIO I2C PMIC */
arch/arm/mach-s5pv210/mach-goni.c+4−2
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <linux/gpio_keys.h>
2626 #include <linux/input.h>
2727 #include <linux/gpio.h>
28+#include <linux/mmc/host.h>
2829 #include <linux/interrupt.h>
2930
3031 #include <asm/hardware/vic.h>
@@ -674,8 +675,8 @@ static struct wm8994_pdata wm8994_platform_data = { · 643 unmodified lines
674675 .gpio_defaults[8] = 0x0100,
675676 .gpio_defaults[9] = 0x0100,
676677 .gpio_defaults[10] = 0x0100,
677− .ldo[0] = { S5PV210_MP03(6), NULL, &wm8994_ldo1_data }, /* XM0FRNB_2 */
678− .ldo[1] = { 0, NULL, &wm8994_ldo2_data },
678+ .ldo[0] = { S5PV210_MP03(6), &wm8994_ldo1_data }, /* XM0FRNB_2 */
679+ .ldo[1] = { 0, &wm8994_ldo2_data },
679680 };
680681
681682 /* GPIO I2C PMIC */
@@ -765,6 +766,7 @@ static void __init goni_pmic_init(void) · 83 unmodified lines
765766 /* MoviNAND */
766767 static struct s3c_sdhci_platdata goni_hsmmc0_data __initdata = {
767768 .max_width = 4,
769+ .host_caps2 = MMC_CAP2_BROKEN_VOLTAGE,
768770 .cd_type = S3C_SDHCI_CD_PERMANENT,
769771 };
770772
arch/arm/mach-sa1100/generic.c+1−1
@@ -306,7 +306,7 @@ void sa11x0_register_irda(struct irda_platform_data *irda) · 305 unmodified lines
306306 }
307307
308308 static struct resource sa1100_rtc_resources[] = {
309− DEFINE_RES_MEM(0x90010000, 0x9001003f),
309+ DEFINE_RES_MEM(0x90010000, 0x40),
310310 DEFINE_RES_IRQ_NAMED(IRQ_RTC1Hz, "rtc 1Hz"),
311311 DEFINE_RES_IRQ_NAMED(IRQ_RTCAlrm, "rtc alarm"),
312312 };
arch/arm/mach-u300/core.c+4−2
@@ -1667,8 +1667,10 @@ void __init u300_init_irq(void) · 1666 unmodified lines
16671667
16681668 for (i = 0; i < U300_VIC_IRQS_END; i++)
16691669 set_bit(i, (unsigned long *) &mask[0]);
1670− vic_init((void __iomem *) U300_INTCON0_VBASE, 0, mask[0], mask[0]);
1671− vic_init((void __iomem *) U300_INTCON1_VBASE, 32, mask[1], mask[1]);
1670+ vic_init((void __iomem *) U300_INTCON0_VBASE, IRQ_U300_INTCON0_START,
1671+ mask[0], mask[0]);
1672+ vic_init((void __iomem *) U300_INTCON1_VBASE, IRQ_U300_INTCON1_START,
1673+ mask[1], mask[1]);
16721674 }
16731675
16741676
arch/arm/mach-u300/i2c.c+1−8
@@ -146,9 +146,6 @@ static struct ab3100_platform_data ab3100_plf_data = { · 145 unmodified lines
146146 .min_uV = 1800000,
147147 .max_uV = 1800000,
148148 .valid_modes_mask = REGULATOR_MODE_NORMAL,
149− .valid_ops_mask =
150− REGULATOR_CHANGE_VOLTAGE |
151− REGULATOR_CHANGE_STATUS,
152149 .always_on = 1,
153150 .boot_on = 1,
154151 },
@@ -160,9 +157,6 @@ static struct ab3100_platform_data ab3100_plf_data = { · 5 unmodified lines
160157 .min_uV = 2500000,
161158 .max_uV = 2500000,
162159 .valid_modes_mask = REGULATOR_MODE_NORMAL,
163− .valid_ops_mask =
164− REGULATOR_CHANGE_VOLTAGE |
165− REGULATOR_CHANGE_STATUS,
166160 .always_on = 1,
167161 .boot_on = 1,
168162 },
@@ -230,8 +224,7 @@ static struct ab3100_platform_data ab3100_plf_data = { · 61 unmodified lines
230224 .max_uV = 1800000,
231225 .valid_modes_mask = REGULATOR_MODE_NORMAL,
232226 .valid_ops_mask =
233− REGULATOR_CHANGE_VOLTAGE |
234− REGULATOR_CHANGE_STATUS,
227+ REGULATOR_CHANGE_VOLTAGE,
235228 .always_on = 1,
236229 .boot_on = 1,
237230 },
arch/arm/mach-u300/include/mach/irqs.h+75−75
@@ -12,101 +12,101 @@ · 11 unmodified lines
1212 #ifndef __MACH_IRQS_H
1313 #define __MACH_IRQS_H
1414
15−#define IRQ_U300_INTCON0_START 0
16−#define IRQ_U300_INTCON1_START 32
15+#define IRQ_U300_INTCON0_START 1
16+#define IRQ_U300_INTCON1_START 33
1717 /* These are on INTCON0 - 30 lines */
18−#define IRQ_U300_IRQ0_EXT 0
19−#define IRQ_U300_IRQ1_EXT 1
20−#define IRQ_U300_DMA 2
21−#define IRQ_U300_VIDEO_ENC_0 3
22−#define IRQ_U300_VIDEO_ENC_1 4
23−#define IRQ_U300_AAIF_RX 5
24−#define IRQ_U300_AAIF_TX 6
25−#define IRQ_U300_AAIF_VGPIO 7
26−#define IRQ_U300_AAIF_WAKEUP 8
27−#define IRQ_U300_PCM_I2S0_FRAME 9
28−#define IRQ_U300_PCM_I2S0_FIFO 10
29−#define IRQ_U300_PCM_I2S1_FRAME 11
30−#define IRQ_U300_PCM_I2S1_FIFO 12
31−#define IRQ_U300_XGAM_GAMCON 13
32−#define IRQ_U300_XGAM_CDI 14
33−#define IRQ_U300_XGAM_CDICON 15
18+#define IRQ_U300_IRQ0_EXT 1
19+#define IRQ_U300_IRQ1_EXT 2
20+#define IRQ_U300_DMA 3
21+#define IRQ_U300_VIDEO_ENC_0 4
22+#define IRQ_U300_VIDEO_ENC_1 5
23+#define IRQ_U300_AAIF_RX 6
24+#define IRQ_U300_AAIF_TX 7
25+#define IRQ_U300_AAIF_VGPIO 8
26+#define IRQ_U300_AAIF_WAKEUP 9
27+#define IRQ_U300_PCM_I2S0_FRAME 10
28+#define IRQ_U300_PCM_I2S0_FIFO 11
29+#define IRQ_U300_PCM_I2S1_FRAME 12
30+#define IRQ_U300_PCM_I2S1_FIFO 13
31+#define IRQ_U300_XGAM_GAMCON 14
32+#define IRQ_U300_XGAM_CDI 15
33+#define IRQ_U300_XGAM_CDICON 16
3434 #if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330)
3535 /* MMIACC not used on the DB3210 or DB3350 chips */
36−#define IRQ_U300_XGAM_MMIACC 16
36+#define IRQ_U300_XGAM_MMIACC 17
3737 #endif
38−#define IRQ_U300_XGAM_PDI 17
39−#define IRQ_U300_XGAM_PDICON 18
40−#define IRQ_U300_XGAM_GAMEACC 19
41−#define IRQ_U300_XGAM_MCIDCT 20
42−#define IRQ_U300_APEX 21
43−#define IRQ_U300_UART0 22
44−#define IRQ_U300_SPI 23
45−#define IRQ_U300_TIMER_APP_OS 24
46−#define IRQ_U300_TIMER_APP_DD 25
47−#define IRQ_U300_TIMER_APP_GP1 26
48−#define IRQ_U300_TIMER_APP_GP2 27
49−#define IRQ_U300_TIMER_OS 28
50−#define IRQ_U300_TIMER_MS 29
51−#define IRQ_U300_KEYPAD_KEYBF 30
52−#define IRQ_U300_KEYPAD_KEYBR 31
38+#define IRQ_U300_XGAM_PDI 18
39+#define IRQ_U300_XGAM_PDICON 19
40+#define IRQ_U300_XGAM_GAMEACC 20
41+#define IRQ_U300_XGAM_MCIDCT 21
42+#define IRQ_U300_APEX 22
43+#define IRQ_U300_UART0 23
44+#define IRQ_U300_SPI 24
45+#define IRQ_U300_TIMER_APP_OS 25
46+#define IRQ_U300_TIMER_APP_DD 26
47+#define IRQ_U300_TIMER_APP_GP1 27
48+#define IRQ_U300_TIMER_APP_GP2 28
49+#define IRQ_U300_TIMER_OS 29
50+#define IRQ_U300_TIMER_MS 30
51+#define IRQ_U300_KEYPAD_KEYBF 31
52+#define IRQ_U300_KEYPAD_KEYBR 32
5353 /* These are on INTCON1 - 32 lines */
54−#define IRQ_U300_GPIO_PORT0 32
55−#define IRQ_U300_GPIO_PORT1 33
56−#define IRQ_U300_GPIO_PORT2 34
54+#define IRQ_U300_GPIO_PORT0 33
55+#define IRQ_U300_GPIO_PORT1 34
56+#define IRQ_U300_GPIO_PORT2 35
5757
5858 #if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) || \
5959 defined(CONFIG_MACH_U300_BS335)
6060 /* These are for DB3150, DB3200 and DB3350 */
61−#define IRQ_U300_WDOG 35
62−#define IRQ_U300_EVHIST 36
63−#define IRQ_U300_MSPRO 37
64−#define IRQ_U300_MMCSD_MCIINTR0 38
65−#define IRQ_U300_MMCSD_MCIINTR1 39
66−#define IRQ_U300_I2C0 40
67−#define IRQ_U300_I2C1 41
68−#define IRQ_U300_RTC 42
69−#define IRQ_U300_NFIF 43
70−#define IRQ_U300_NFIF2 44
61+#define IRQ_U300_WDOG 36
62+#define IRQ_U300_EVHIST 37
63+#define IRQ_U300_MSPRO 38
64+#define IRQ_U300_MMCSD_MCIINTR0 39
65+#define IRQ_U300_MMCSD_MCIINTR1 40
66+#define IRQ_U300_I2C0 41
67+#define IRQ_U300_I2C1 42
68+#define IRQ_U300_RTC 43
69+#define IRQ_U300_NFIF 44
70+#define IRQ_U300_NFIF2 45
7171 #endif
7272
7373 /* DB3150 and DB3200 have only 45 IRQs */
7474 #if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330)
75−#define U300_VIC_IRQS_END 45
75+#define U300_VIC_IRQS_END 46
7676 #endif
7777
7878 /* The DB3350-specific interrupt lines */
7979 #ifdef CONFIG_MACH_U300_BS335
80−#define IRQ_U300_ISP_F0 45
81−#define IRQ_U300_ISP_F1 46
82−#define IRQ_U300_ISP_F2 47
83−#define IRQ_U300_ISP_F3 48
84−#define IRQ_U300_ISP_F4 49
85−#define IRQ_U300_GPIO_PORT3 50
86−#define IRQ_U300_SYSCON_PLL_LOCK 51
87−#define IRQ_U300_UART1 52
88−#define IRQ_U300_GPIO_PORT4 53
89−#define IRQ_U300_GPIO_PORT5 54
90−#define IRQ_U300_GPIO_PORT6 55
91−#define U300_VIC_IRQS_END 56
80+#define IRQ_U300_ISP_F0 46
81+#define IRQ_U300_ISP_F1 47
82+#define IRQ_U300_ISP_F2 48
83+#define IRQ_U300_ISP_F3 49
84+#define IRQ_U300_ISP_F4 50
85+#define IRQ_U300_GPIO_PORT3 51
86+#define IRQ_U300_SYSCON_PLL_LOCK 52
87+#define IRQ_U300_UART1 53
88+#define IRQ_U300_GPIO_PORT4 54
89+#define IRQ_U300_GPIO_PORT5 55
90+#define IRQ_U300_GPIO_PORT6 56
91+#define U300_VIC_IRQS_END 57
9292 #endif
9393
9494 /* The DB3210-specific interrupt lines */
9595 #ifdef CONFIG_MACH_U300_BS365
96−#define IRQ_U300_GPIO_PORT3 35
97−#define IRQ_U300_GPIO_PORT4 36
98−#define IRQ_U300_WDOG 37
99−#define IRQ_U300_EVHIST 38
100−#define IRQ_U300_MSPRO 39
101−#define IRQ_U300_MMCSD_MCIINTR0 40
102−#define IRQ_U300_MMCSD_MCIINTR1 41
103−#define IRQ_U300_I2C0 42
104−#define IRQ_U300_I2C1 43
105−#define IRQ_U300_RTC 44
106−#define IRQ_U300_NFIF 45
107−#define IRQ_U300_NFIF2 46
108−#define IRQ_U300_SYSCON_PLL_LOCK 47
109−#define U300_VIC_IRQS_END 48
96+#define IRQ_U300_GPIO_PORT3 36
97+#define IRQ_U300_GPIO_PORT4 37
98+#define IRQ_U300_WDOG 38
99+#define IRQ_U300_EVHIST 39
100+#define IRQ_U300_MSPRO 40
101+#define IRQ_U300_MMCSD_MCIINTR0 41
102+#define IRQ_U300_MMCSD_MCIINTR1 42
103+#define IRQ_U300_I2C0 43
104+#define IRQ_U300_I2C1 44
105+#define IRQ_U300_RTC 45
106+#define IRQ_U300_NFIF 46
107+#define IRQ_U300_NFIF2 47
108+#define IRQ_U300_SYSCON_PLL_LOCK 48
109+#define U300_VIC_IRQS_END 49
110110 #endif
111111
112112 /* Maximum 8*7 GPIO lines */
@@ -117,6 +117,6 @@ · 4 unmodified lines
117117 #define IRQ_U300_GPIO_END (U300_VIC_IRQS_END)
118118 #endif
119119
120−#define NR_IRQS (IRQ_U300_GPIO_END)
120+#define NR_IRQS (IRQ_U300_GPIO_END - IRQ_U300_INTCON0_START)
121121
122122 #endif
arch/arm/mach-ux500/Kconfig+1−0
@@ -17,6 +17,7 @@ config UX500_SOC_DB5500 · 16 unmodified lines
1717 config UX500_SOC_DB8500
1818 bool
1919 select MFD_DB8500_PRCMU
20+ select REGULATOR
2021 select REGULATOR_DB8500_PRCMU
2122 select CPU_FREQ_TABLE if CPU_FREQ
2223
arch/arm/mach-ux500/mbox-db5500.c+1−1
@@ -168,7 +168,7 @@ static ssize_t mbox_read_fifo(struct device *dev, · 167 unmodified lines
168168 return sprintf(buf, "0x%X\n", mbox_value);
169169 }
170170
171−static DEVICE_ATTR(fifo, S_IWUGO | S_IRUGO, mbox_read_fifo, mbox_write_fifo);
171+static DEVICE_ATTR(fifo, S_IWUSR | S_IRUGO, mbox_read_fifo, mbox_write_fifo);
172172
173173 static int mbox_show(struct seq_file *s, void *data)
174174 {
arch/arm/mach-ux500/platsmp.c+1−1
@@ -99,7 +99,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) · 98 unmodified lines
9999 */
100100 write_pen_release(cpu_logical_map(cpu));
101101
102− gic_raise_softirq(cpumask_of(cpu), 1);
102+ smp_send_reschedule(cpu);
103103
104104 timeout = jiffies + (1 * HZ);
105105 while (time_before(jiffies, timeout)) {
arch/arm/mm/Kconfig+1−1
@@ -723,7 +723,7 @@ config CPU_HIGH_VECTOR · 722 unmodified lines
723723 bool "Select the High exception vector"
724724 help
725725 Say Y here to select high exception vector(0xFFFF0000~).
726− The exception vector can be vary depending on the platform
726+ The exception vector can vary depending on the platform
727727 design in nommu mode. If your platform needs to select
728728 high exception vector, say Y.
729729 Otherwise or if you are unsure, say N, and the low exception
arch/arm/mm/fault.c+1−1
@@ -320,7 +320,7 @@ retry: · 319 unmodified lines
320320 */
321321
322322 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr);
323− if (flags & FAULT_FLAG_ALLOW_RETRY) {
323+ if (!(fault & VM_FAULT_ERROR) && flags & FAULT_FLAG_ALLOW_RETRY) {
324324 if (fault & VM_FAULT_MAJOR) {
325325 tsk->maj_flt++;
326326 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1,
arch/arm/mm/nommu.c+2−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <asm/sections.h>
1414 #include <asm/page.h>
1515 #include <asm/setup.h>
16+#include <asm/traps.h>
1617 #include <asm/mach/arch.h>
1718
1819 #include "mm.h"
@@ -39,6 +40,7 @@ void __init sanity_check_meminfo(void) · 20 unmodified lines
3940 */
4041 void __init paging_init(struct machine_desc *mdesc)
4142 {
43+ early_trap_init((void *)CONFIG_VECTORS_BASE);
4244 bootmem_init();
4345 }
4446
arch/arm/mm/proc-v7.S+12−0
@@ -254,6 +254,18 @@ __v7_setup: · 253 unmodified lines
254254 ldr r6, =NMRR @ NMRR
255255 mcr p15, 0, r5, c10, c2, 0 @ write PRRR
256256 mcr p15, 0, r6, c10, c2, 1 @ write NMRR
257+#endif
258+#ifndef CONFIG_ARM_THUMBEE
259+ mrc p15, 0, r0, c0, c1, 0 @ read ID_PFR0 for ThumbEE
260+ and r0, r0, #(0xf << 12) @ ThumbEE enabled field
261+ teq r0, #(1 << 12) @ check if ThumbEE is present
262+ bne 1f
263+ mov r5, #0
264+ mcr p14, 6, r5, c1, c0, 0 @ Initialize TEEHBR to 0
265+ mrc p14, 6, r0, c0, c0, 0 @ load TEECR
266+ orr r0, r0, #1 @ set the 1st bit in order to
267+ mcr p14, 6, r0, c0, c0, 0 @ stop userspace TEEHBR access
268+1:
257269 #endif
258270 adr r5, v7_crval
259271 ldmia r5, {r5, r6}
arch/arm/plat-omap/clock.c+0−26
@@ -398,32 +398,6 @@ struct clk dummy_ck = { · 397 unmodified lines
398398 .ops = &clkops_null,
399399 };
400400
401−#ifdef CONFIG_CPU_FREQ
402−void clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
403−{
404− unsigned long flags;
405−
406− if (!arch_clock || !arch_clock->clk_init_cpufreq_table)
407− return;
408−
409− spin_lock_irqsave(&clockfw_lock, flags);
410− arch_clock->clk_init_cpufreq_table(table);
411− spin_unlock_irqrestore(&clockfw_lock, flags);
412−}
413−
414−void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table)
415−{
416− unsigned long flags;
417−
418− if (!arch_clock || !arch_clock->clk_exit_cpufreq_table)
419− return;
420−
421− spin_lock_irqsave(&clockfw_lock, flags);
422− arch_clock->clk_exit_cpufreq_table(table);
423− spin_unlock_irqrestore(&clockfw_lock, flags);
424−}
425−#endif
426−
427401 /*
428402 *
429403 */
arch/arm/plat-omap/include/plat/clock.h+0−10
@@ -272,8 +272,6 @@ struct clk { · 271 unmodified lines
272272 #endif
273273 };
274274
275−struct cpufreq_frequency_table;
276−
277275 struct clk_functions {
278276 int (*clk_enable)(struct clk *clk);
279277 void (*clk_disable)(struct clk *clk);
@@ -283,10 +281,6 @@ struct clk_functions { · 3 unmodified lines
283281 void (*clk_allow_idle)(struct clk *clk);
284282 void (*clk_deny_idle)(struct clk *clk);
285283 void (*clk_disable_unused)(struct clk *clk);
286−#ifdef CONFIG_CPU_FREQ
287− void (*clk_init_cpufreq_table)(struct cpufreq_frequency_table **);
288− void (*clk_exit_cpufreq_table)(struct cpufreq_frequency_table **);
289−#endif
290284 };
291285
292286 extern int mpurate;
@@ -301,10 +295,6 @@ extern void recalculate_root_clocks(void); · 8 unmodified lines
301295 extern unsigned long followparent_recalc(struct clk *clk);
302296 extern void clk_enable_init_clocks(void);
303297 unsigned long omap_fixed_divisor_recalc(struct clk *clk);
304−#ifdef CONFIG_CPU_FREQ
305−extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
306−extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table);
307−#endif
308298 extern struct clk *omap_clk_get_by_name(const char *name);
309299 extern int omap_clk_enable_autoidle_all(void);
310300 extern int omap_clk_disable_autoidle_all(void);
arch/arm/plat-omap/include/plat/omap_hwmod.h+3−1
@@ -305,6 +305,7 @@ struct omap_hwmod_sysc_fields { · 304 unmodified lines
305305 * @rev_offs: IP block revision register offset (from module base addr)
306306 * @sysc_offs: OCP_SYSCONFIG register offset (from module base addr)
307307 * @syss_offs: OCP_SYSSTATUS register offset (from module base addr)
308+ * @srst_udelay: Delay needed after doing a softreset in usecs
308309 * @idlemodes: One or more of {SIDLE,MSTANDBY}_{OFF,FORCE,SMART}
309310 * @sysc_flags: SYS{C,S}_HAS* flags indicating SYSCONFIG bits supported
310311 * @clockact: the default value of the module CLOCKACTIVITY bits
@@ -330,9 +331,10 @@ struct omap_hwmod_class_sysconfig { · 19 unmodified lines
330331 u16 sysc_offs;
331332 u16 syss_offs;
332333 u16 sysc_flags;
334+ struct omap_hwmod_sysc_fields *sysc_fields;
335+ u8 srst_udelay;
333336 u8 idlemodes;
334337 u8 clockact;
335− struct omap_hwmod_sysc_fields *sysc_fields;
336338 };
337339
338340 /**
arch/arm/plat-omap/sram.c+6−6
@@ -348,7 +348,6 @@ u32 omap3_configure_core_dpll(u32 m2, u32 unlock_dll, u32 f, u32 inc, · 347 unmodified lines
348348 sdrc_actim_ctrl_b_1, sdrc_mr_1);
349349 }
350350
351−#ifdef CONFIG_PM
352351 void omap3_sram_restore_context(void)
353352 {
354353 omap_sram_ceil = omap_sram_base + omap_sram_size;
@@ -358,17 +357,18 @@ void omap3_sram_restore_context(void) · 3 unmodified lines
358357 omap3_sram_configure_core_dpll_sz);
359358 omap_push_sram_idle();
360359 }
361−#endif /* CONFIG_PM */
362−
363−#endif /* CONFIG_ARCH_OMAP3 */
364360
365361 static inline int omap34xx_sram_init(void)
366362 {
367−#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
368363 omap3_sram_restore_context();
369−#endif
370364 return 0;
371365 }
366+#else
367+static inline int omap34xx_sram_init(void)
368+{
369+ return 0;
370+}
371+#endif /* CONFIG_ARCH_OMAP3 */
372372
373373 static inline int am33xx_sram_init(void)
374374 {
arch/arm/plat-samsung/Kconfig+1−0
@@ -302,6 +302,7 @@ comment "Power management" · 301 unmodified lines
302302 config SAMSUNG_PM_DEBUG
303303 bool "S3C2410 PM Suspend debug"
304304 depends on PM
305+ select DEBUG_LL
305306 help
306307 Say Y here if you want verbose debugging from the PM Suspend and
307308 Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
arch/arm/plat-samsung/include/plat/sdhci.h+28−0
@@ -18,6 +18,8 @@ · 17 unmodified lines
1818 #ifndef __PLAT_S3C_SDHCI_H
1919 #define __PLAT_S3C_SDHCI_H __FILE__
2020
21+#include <plat/devs.h>
22+
2123 struct platform_device;
2224 struct mmc_host;
2325 struct mmc_card;
@@ -356,4 +358,30 @@ static inline void exynos4_default_sdhci3(void) { } · 332 unmodified lines
356358
357359 #endif /* CONFIG_EXYNOS4_SETUP_SDHCI */
358360
361+static inline void s3c_sdhci_setname(int id, char *name)
362+{
363+ switch (id) {
364+#ifdef CONFIG_S3C_DEV_HSMMC
365+ case 0:
366+ s3c_device_hsmmc0.name = name;
367+ break;
368+#endif
369+#ifdef CONFIG_S3C_DEV_HSMMC1
370+ case 1:
371+ s3c_device_hsmmc1.name = name;
372+ break;
373+#endif
374+#ifdef CONFIG_S3C_DEV_HSMMC2
375+ case 2:
376+ s3c_device_hsmmc2.name = name;
377+ break;
378+#endif
379+#ifdef CONFIG_S3C_DEV_HSMMC3
380+ case 3:
381+ s3c_device_hsmmc3.name = name;
382+ break;
383+#endif
384+ }
385+}
386+
359387 #endif /* __PLAT_S3C_SDHCI_H */
arch/blackfin/mach-bf538/boards/ezkit.c+26−27
@@ -38,7 +38,7 @@ static struct platform_device rtc_device = { · 37 unmodified lines
3838 .name = "rtc-bfin",
3939 .id = -1,
4040 };
41−#endif
41+#endif /* CONFIG_RTC_DRV_BFIN */
4242
4343 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
4444 #ifdef CONFIG_SERIAL_BFIN_UART0
@@ -100,7 +100,7 @@ static struct platform_device bfin_uart0_device = { · 55 unmodified lines
100100 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
101101 },
102102 };
103−#endif
103+#endif /* CONFIG_SERIAL_BFIN_UART0 */
104104 #ifdef CONFIG_SERIAL_BFIN_UART1
105105 static struct resource bfin_uart1_resources[] = {
106106 {
@@ -148,7 +148,7 @@ static struct platform_device bfin_uart1_device = { · 41 unmodified lines
148148 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
149149 },
150150 };
151−#endif
151+#endif /* CONFIG_SERIAL_BFIN_UART1 */
152152 #ifdef CONFIG_SERIAL_BFIN_UART2
153153 static struct resource bfin_uart2_resources[] = {
154154 {
@@ -196,8 +196,8 @@ static struct platform_device bfin_uart2_device = { · 41 unmodified lines
196196 .platform_data = &bfin_uart2_peripherals, /* Passed to driver */
197197 },
198198 };
199−#endif
200−#endif
199+#endif /* CONFIG_SERIAL_BFIN_UART2 */
200+#endif /* CONFIG_SERIAL_BFIN */
201201
202202 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
203203 #ifdef CONFIG_BFIN_SIR0
@@ -224,7 +224,7 @@ static struct platform_device bfin_sir0_device = { · 20 unmodified lines
224224 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
225225 .resource = bfin_sir0_resources,
226226 };
227−#endif
227+#endif /* CONFIG_BFIN_SIR0 */
228228 #ifdef CONFIG_BFIN_SIR1
229229 static struct resource bfin_sir1_resources[] = {
230230 {
@@ -249,7 +249,7 @@ static struct platform_device bfin_sir1_device = { · 18 unmodified lines
249249 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
250250 .resource = bfin_sir1_resources,
251251 };
252−#endif
252+#endif /* CONFIG_BFIN_SIR1 */
253253 #ifdef CONFIG_BFIN_SIR2
254254 static struct resource bfin_sir2_resources[] = {
255255 {
@@ -274,8 +274,8 @@ static struct platform_device bfin_sir2_device = { · 18 unmodified lines
274274 .num_resources = ARRAY_SIZE(bfin_sir2_resources),
275275 .resource = bfin_sir2_resources,
276276 };
277−#endif
278−#endif
277+#endif /* CONFIG_BFIN_SIR2 */
278+#endif /* CONFIG_BFIN_SIR */
279279
280280 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
281281 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
@@ -311,7 +311,7 @@ static struct platform_device bfin_sport0_uart_device = { · 29 unmodified lines
311311 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
312312 },
313313 };
314−#endif
314+#endif /* CONFIG_SERIAL_BFIN_SPORT0_UART */
315315 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
316316 static struct resource bfin_sport1_uart_resources[] = {
317317 {
@@ -345,7 +345,7 @@ static struct platform_device bfin_sport1_uart_device = { · 27 unmodified lines
345345 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
346346 },
347347 };
348−#endif
348+#endif /* CONFIG_SERIAL_BFIN_SPORT1_UART */
349349 #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
350350 static struct resource bfin_sport2_uart_resources[] = {
351351 {
@@ -379,7 +379,7 @@ static struct platform_device bfin_sport2_uart_device = { · 27 unmodified lines
379379 .platform_data = &bfin_sport2_peripherals, /* Passed to driver */
380380 },
381381 };
382−#endif
382+#endif /* CONFIG_SERIAL_BFIN_SPORT2_UART */
383383 #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
384384 static struct resource bfin_sport3_uart_resources[] = {
385385 {
@@ -413,8 +413,8 @@ static struct platform_device bfin_sport3_uart_device = { · 27 unmodified lines
413413 .platform_data = &bfin_sport3_peripherals, /* Passed to driver */
414414 },
415415 };
416−#endif
417−#endif
416+#endif /* CONFIG_SERIAL_BFIN_SPORT3_UART */
417+#endif /* CONFIG_SERIAL_BFIN_SPORT */
418418
419419 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
420420 static unsigned short bfin_can_peripherals[] = {
@@ -452,7 +452,7 @@ static struct platform_device bfin_can_device = { · 31 unmodified lines
452452 .platform_data = &bfin_can_peripherals, /* Passed to driver */
453453 },
454454 };
455−#endif
455+#endif /* CONFIG_CAN_BFIN */
456456
457457 /*
458458 * USB-LAN EzExtender board
@@ -488,7 +488,7 @@ static struct platform_device smc91x_device = { · 29 unmodified lines
488488 .platform_data = &smc91x_info,
489489 },
490490 };
491−#endif
491+#endif /* CONFIG_SMC91X */
492492
493493 #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
494494 /* all SPI peripherals info goes here */
@@ -518,7 +518,8 @@ static struct flash_platform_data bfin_spi_flash_data = { · 23 unmodified lines
518518 static struct bfin5xx_spi_chip spi_flash_chip_info = {
519519 .enable_dma = 0, /* use dma transfer with this chip*/
520520 };
521−#endif
521+#endif /* CONFIG_MTD_M25P80 */
522+#endif /* CONFIG_SPI_BFIN5XX */
522523
523524 #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
524525 #include <linux/spi/ad7879.h>
@@ -535,7 +536,7 @@ static const struct ad7879_platform_data bfin_ad7879_ts_info = { · 10 unmodified lines
535536 .gpio_export = 1, /* Export GPIO to gpiolib */
536537 .gpio_base = -1, /* Dynamic allocation */
537538 };
538−#endif
539+#endif /* CONFIG_TOUCHSCREEN_AD7879 */
539540
540541 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
541542 #include <asm/bfin-lq035q1.h>
@@ -564,7 +565,7 @@ static struct platform_device bfin_lq035q1_device = { · 22 unmodified lines
564565 .platform_data = &bfin_lq035q1_data,
565566 },
566567 };
567−#endif
568+#endif /* CONFIG_FB_BFIN_LQ035Q1 */
568569
569570 static struct spi_board_info bf538_spi_board_info[] __initdata = {
570571 #if defined(CONFIG_MTD_M25P80) \
@@ -579,7 +580,7 @@ static struct spi_board_info bf538_spi_board_info[] __initdata = { · 8 unmodified lines
579580 .controller_data = &spi_flash_chip_info,
580581 .mode = SPI_MODE_3,
581582 },
582−#endif
583+#endif /* CONFIG_MTD_M25P80 */
583584 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
584585 {
585586 .modalias = "ad7879",
@@ -590,7 +591,7 @@ static struct spi_board_info bf538_spi_board_info[] __initdata = { · 4 unmodified lines
590591 .chip_select = 1,
591592 .mode = SPI_CPHA | SPI_CPOL,
592593 },
593−#endif
594+#endif /* CONFIG_TOUCHSCREEN_AD7879_SPI */
594595 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
595596 {
596597 .modalias = "bfin-lq035q1-spi",
@@ -599,7 +600,7 @@ static struct spi_board_info bf538_spi_board_info[] __initdata = { · 2 unmodified lines
599600 .chip_select = 2,
600601 .mode = SPI_CPHA | SPI_CPOL,
601602 },
602−#endif
603+#endif /* CONFIG_FB_BFIN_LQ035Q1 */
603604 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
604605 {
605606 .modalias = "spidev",
@@ -607,7 +608,7 @@ static struct spi_board_info bf538_spi_board_info[] __initdata = { · 1 unmodified line
607608 .bus_num = 0,
608609 .chip_select = 1,
609610 },
610−#endif
611+#endif /* CONFIG_SPI_SPIDEV */
611612 };
612613
613614 /* SPI (0) */
@@ -716,8 +717,6 @@ static struct platform_device bf538_spi_master2 = { · 102 unmodified lines
716717 },
717718 };
718719
719−#endif /* spi master and devices */
720−
721720 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
722721 static struct resource bfin_twi0_resource[] = {
723722 [0] = {
@@ -759,8 +758,8 @@ static struct platform_device i2c_bfin_twi1_device = { · 35 unmodified lines
759758 .num_resources = ARRAY_SIZE(bfin_twi1_resource),
760759 .resource = bfin_twi1_resource,
761760 };
762−#endif
763−#endif
761+#endif /* CONFIG_BF542 */
762+#endif /* CONFIG_I2C_BLACKFIN_TWI */
764763
765764 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
766765 #include <linux/gpio_keys.h>
arch/c6x/include/asm/irq.h+0−4
@@ -42,10 +42,6 @@ · 41 unmodified lines
4242 /* This number is used when no interrupt has been assigned */
4343 #define NO_IRQ 0
4444
45−struct irq_data;
46−extern irq_hw_number_t irqd_to_hwirq(struct irq_data *d);
47−extern irq_hw_number_t virq_to_hw(unsigned int virq);
48−
4945 extern void __init init_pic_c64xplus(void);
5046
5147 extern void init_IRQ(void);
arch/c6x/kernel/irq.c+0−13
@@ -130,16 +130,3 @@ int arch_show_interrupts(struct seq_file *p, int prec) · 129 unmodified lines
130130 seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count);
131131 return 0;
132132 }
133−
134−irq_hw_number_t irqd_to_hwirq(struct irq_data *d)
135−{
136− return d->hwirq;
137−}
138−EXPORT_SYMBOL_GPL(irqd_to_hwirq);
139−
140−irq_hw_number_t virq_to_hw(unsigned int virq)
141−{
142− struct irq_data *irq_data = irq_get_irq_data(virq);
143− return WARN_ON(!irq_data) ? 0 : irq_data->hwirq;
144−}
145−EXPORT_SYMBOL_GPL(virq_to_hw);
arch/hexagon/kernel/dma.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <linux/bootmem.h>
2323 #include <linux/genalloc.h>
2424 #include <asm/dma-mapping.h>
25+#include <linux/module.h>
2526
2627 struct dma_map_ops *dma_ops;
2728 EXPORT_SYMBOL(dma_ops);
arch/hexagon/kernel/process.c+3−3
@@ -1,7 +1,7 @@
11 /*
22 * Process creation support for Hexagon
33 *
4− * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
4+ * Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
55 *
66 * This program is free software; you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License version 2 and
@@ -88,7 +88,7 @@ void (*idle_sleep)(void) = default_idle; · 80 unmodified lines
8888 void cpu_idle(void)
8989 {
9090 while (1) {
91− tick_nohz_stop_sched_tick(1);
91+ tick_nohz_idle_enter();
9292 local_irq_disable();
9393 while (!need_resched()) {
9494 idle_sleep();
@@ -97,7 +97,7 @@ void cpu_idle(void) · 2 unmodified lines
9797 local_irq_disable();
9898 }
9999 local_irq_enable();
100− tick_nohz_restart_sched_tick();
100+ tick_nohz_idle_exit();
101101 schedule();
102102 }
103103 }
arch/hexagon/kernel/ptrace.c+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <linux/ptrace.h>
2929 #include <linux/regset.h>
3030 #include <linux/user.h>
31+#include <linux/elf.h>
3132
3233 #include <asm/user.h>
3334
arch/hexagon/kernel/smp.c+7−1
@@ -1,7 +1,7 @@
11 /*
22 * SMP support for Hexagon
33 *
4− * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
4+ * Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
55 *
66 * This program is free software; you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License version 2 and
@@ -28,6 +28,7 @@ · 20 unmodified lines
2828 #include <linux/sched.h>
2929 #include <linux/smp.h>
3030 #include <linux/spinlock.h>
31+#include <linux/cpu.h>
3132
3233 #include <asm/time.h> /* timer_interrupt */
3334 #include <asm/hexagon_vm.h>
@@ -177,7 +178,12 @@ void __cpuinit start_secondary(void) · 143 unmodified lines
177178
178179 printk(KERN_INFO "%s cpu %d\n", __func__, current_thread_info()->cpu);
179180
181+ notify_cpu_starting(cpu);
182+
183+ ipi_call_lock();
180184 set_cpu_online(cpu, true);
185+ ipi_call_unlock();
186+
181187 local_irq_enable();
182188
183189 cpu_idle();
arch/hexagon/kernel/time.c+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <linux/of.h>
2929 #include <linux/of_address.h>
3030 #include <linux/of_irq.h>
31+#include <linux/module.h>
3132
3233 #include <asm/timer-regs.h>
3334 #include <asm/hexagon_vm.h>
arch/hexagon/kernel/vdso.c+1−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <linux/err.h>
2222 #include <linux/mm.h>
2323 #include <linux/vmalloc.h>
24+#include <linux/binfmts.h>
2425
2526 #include <asm/vdso.h>
2627
arch/ia64/include/asm/cmpxchg.h+147−1
@@ -1 +1,147 @@
1−#include <asm/intrinsics.h>
1+#ifndef _ASM_IA64_CMPXCHG_H
2+#define _ASM_IA64_CMPXCHG_H
3+
4+/*
5+ * Compare/Exchange, forked from asm/intrinsics.h
6+ * which was:
7+ *
8+ * Copyright (C) 2002-2003 Hewlett-Packard Co
9+ * David Mosberger-Tang <davidm@hpl.hp.com>
10+ */
11+
12+#ifndef __ASSEMBLY__
13+
14+#include <linux/types.h>
15+/* include compiler specific intrinsics */
16+#include <asm/ia64regs.h>
17+#ifdef __INTEL_COMPILER
18+# include <asm/intel_intrin.h>
19+#else
20+# include <asm/gcc_intrin.h>
21+#endif
22+
23+/*
24+ * This function doesn't exist, so you'll get a linker error if
25+ * something tries to do an invalid xchg().
26+ */
27+extern void ia64_xchg_called_with_bad_pointer(void);
28+
29+#define __xchg(x, ptr, size) \
30+({ \
31+ unsigned long __xchg_result; \
32+ \
33+ switch (size) { \
34+ case 1: \
35+ __xchg_result = ia64_xchg1((__u8 *)ptr, x); \
36+ break; \
37+ \
38+ case 2: \
39+ __xchg_result = ia64_xchg2((__u16 *)ptr, x); \
40+ break; \
41+ \
42+ case 4: \
43+ __xchg_result = ia64_xchg4((__u32 *)ptr, x); \
44+ break; \
45+ \
46+ case 8: \
47+ __xchg_result = ia64_xchg8((__u64 *)ptr, x); \
48+ break; \
49+ default: \
50+ ia64_xchg_called_with_bad_pointer(); \
51+ } \
52+ __xchg_result; \
53+})
54+
55+#define xchg(ptr, x) \
56+((__typeof__(*(ptr))) __xchg((unsigned long) (x), (ptr), sizeof(*(ptr))))
57+
58+/*
59+ * Atomic compare and exchange. Compare OLD with MEM, if identical,
60+ * store NEW in MEM. Return the initial value in MEM. Success is
61+ * indicated by comparing RETURN with OLD.
62+ */
63+
64+#define __HAVE_ARCH_CMPXCHG 1
65+
66+/*
67+ * This function doesn't exist, so you'll get a linker error
68+ * if something tries to do an invalid cmpxchg().
69+ */
70+extern long ia64_cmpxchg_called_with_bad_pointer(void);
71+
72+#define ia64_cmpxchg(sem, ptr, old, new, size) \
73+({ \
74+ __u64 _o_, _r_; \
75+ \
76+ switch (size) { \
77+ case 1: \
78+ _o_ = (__u8) (long) (old); \
79+ break; \
80+ case 2: \
81+ _o_ = (__u16) (long) (old); \
82+ break; \
83+ case 4: \
84+ _o_ = (__u32) (long) (old); \
85+ break; \
86+ case 8: \
87+ _o_ = (__u64) (long) (old); \
88+ break; \
89+ default: \
90+ break; \
91+ } \
92+ switch (size) { \
93+ case 1: \
94+ _r_ = ia64_cmpxchg1_##sem((__u8 *) ptr, new, _o_); \
95+ break; \
96+ \
97+ case 2: \
98+ _r_ = ia64_cmpxchg2_##sem((__u16 *) ptr, new, _o_); \
99+ break; \
100+ \
101+ case 4: \
102+ _r_ = ia64_cmpxchg4_##sem((__u32 *) ptr, new, _o_); \
103+ break; \
104+ \
105+ case 8: \
106+ _r_ = ia64_cmpxchg8_##sem((__u64 *) ptr, new, _o_); \
107+ break; \
108+ \
109+ default: \
110+ _r_ = ia64_cmpxchg_called_with_bad_pointer(); \
111+ break; \
112+ } \
113+ (__typeof__(old)) _r_; \
114+})
115+
116+#define cmpxchg_acq(ptr, o, n) \
117+ ia64_cmpxchg(acq, (ptr), (o), (n), sizeof(*(ptr)))
118+#define cmpxchg_rel(ptr, o, n) \
119+ ia64_cmpxchg(rel, (ptr), (o), (n), sizeof(*(ptr)))
120+
121+/* for compatibility with other platforms: */
122+#define cmpxchg(ptr, o, n) cmpxchg_acq((ptr), (o), (n))
123+#define cmpxchg64(ptr, o, n) cmpxchg_acq((ptr), (o), (n))
124+
125+#define cmpxchg_local cmpxchg
126+#define cmpxchg64_local cmpxchg64
127+
128+#ifdef CONFIG_IA64_DEBUG_CMPXCHG
129+# define CMPXCHG_BUGCHECK_DECL int _cmpxchg_bugcheck_count = 128;
130+# define CMPXCHG_BUGCHECK(v) \
131+do { \
132+ if (_cmpxchg_bugcheck_count-- <= 0) { \
133+ void *ip; \
134+ extern int printk(const char *fmt, ...); \
135+ ip = (void *) ia64_getreg(_IA64_REG_IP); \
136+ printk("CMPXCHG_BUGCHECK: stuck at %p on word %p\n", ip, (v));\
137+ break; \
138+ } \
139+} while (0)
140+#else /* !CONFIG_IA64_DEBUG_CMPXCHG */
141+# define CMPXCHG_BUGCHECK_DECL
142+# define CMPXCHG_BUGCHECK(v)
143+#endif /* !CONFIG_IA64_DEBUG_CMPXCHG */
144+
145+#endif /* !__ASSEMBLY__ */
146+
147+#endif /* _ASM_IA64_CMPXCHG_H */
arch/ia64/include/asm/futex.h+5−4
@@ -106,15 +106,16 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, · 105 unmodified lines
106106 return -EFAULT;
107107
108108 {
109− register unsigned long r8 __asm ("r8") = 0;
109+ register unsigned long r8 __asm ("r8");
110110 unsigned long prev;
111111 __asm__ __volatile__(
112112 " mf;; \n"
113− " mov ar.ccv=%3;; \n"
114− "[1:] cmpxchg4.acq %0=[%1],%2,ar.ccv \n"
113+ " mov %0=r0 \n"
114+ " mov ar.ccv=%4;; \n"
115+ "[1:] cmpxchg4.acq %1=[%2],%3,ar.ccv \n"
115116 " .xdata4 \"__ex_table\", 1b-., 2f-. \n"
116117 "[2:]"
117− : "=r" (prev)
118+ : "=r" (r8), "=r" (prev)
118119 : "r" (uaddr), "r" (newval),
119120 "rO" ((long) (unsigned) oldval)
120121 : "memory");
arch/ia64/include/asm/intrinsics.h+1−113
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #else
1919 # include <asm/gcc_intrin.h>
2020 #endif
21+#include <asm/cmpxchg.h>
2122
2223 #define ia64_native_get_psr_i() (ia64_native_getreg(_IA64_REG_PSR) & IA64_PSR_I)
2324
@@ -81,119 +82,6 @@ extern unsigned long __bad_increment_for_ia64_fetch_and_add (void); · 57 unmodified lines
8182
8283 #define ia64_fetch_and_add(i,v) (ia64_fetchadd(i, v, rel) + (i)) /* return new value */
8384
84−/*
85− * This function doesn't exist, so you'll get a linker error if
86− * something tries to do an invalid xchg().
87− */
88−extern void ia64_xchg_called_with_bad_pointer (void);
89−
90−#define __xchg(x,ptr,size) \
91−({ \
92− unsigned long __xchg_result; \
93− \
94− switch (size) { \
95− case 1: \
96− __xchg_result = ia64_xchg1((__u8 *)ptr, x); \
97− break; \
98− \
99− case 2: \
100− __xchg_result = ia64_xchg2((__u16 *)ptr, x); \
101− break; \
102− \
103− case 4: \
104− __xchg_result = ia64_xchg4((__u32 *)ptr, x); \
105− break; \
106− \
107− case 8: \
108− __xchg_result = ia64_xchg8((__u64 *)ptr, x); \
109− break; \
110− default: \
111− ia64_xchg_called_with_bad_pointer(); \
112− } \
113− __xchg_result; \
114−})
115−
116−#define xchg(ptr,x) \
117− ((__typeof__(*(ptr))) __xchg ((unsigned long) (x), (ptr), sizeof(*(ptr))))
118−
119−/*
120− * Atomic compare and exchange. Compare OLD with MEM, if identical,
121− * store NEW in MEM. Return the initial value in MEM. Success is
122− * indicated by comparing RETURN with OLD.
123− */
124−
125−#define __HAVE_ARCH_CMPXCHG 1
126−
127−/*
128− * This function doesn't exist, so you'll get a linker error
129− * if something tries to do an invalid cmpxchg().
130− */
131−extern long ia64_cmpxchg_called_with_bad_pointer (void);
132−
133−#define ia64_cmpxchg(sem,ptr,old,new,size) \
134−({ \
135− __u64 _o_, _r_; \
136− \
137− switch (size) { \
138− case 1: _o_ = (__u8 ) (long) (old); break; \
139− case 2: _o_ = (__u16) (long) (old); break; \
140− case 4: _o_ = (__u32) (long) (old); break; \
141− case 8: _o_ = (__u64) (long) (old); break; \
142− default: break; \
143− } \
144− switch (size) { \
145− case 1: \
146− _r_ = ia64_cmpxchg1_##sem((__u8 *) ptr, new, _o_); \
147− break; \
148− \
149− case 2: \
150− _r_ = ia64_cmpxchg2_##sem((__u16 *) ptr, new, _o_); \
151− break; \
152− \
153− case 4: \
154− _r_ = ia64_cmpxchg4_##sem((__u32 *) ptr, new, _o_); \
155− break; \
156− \
157− case 8: \
158− _r_ = ia64_cmpxchg8_##sem((__u64 *) ptr, new, _o_); \
159− break; \
160− \
161− default: \
162− _r_ = ia64_cmpxchg_called_with_bad_pointer(); \
163− break; \
164− } \
165− (__typeof__(old)) _r_; \
166−})
167−
168−#define cmpxchg_acq(ptr, o, n) \
169− ia64_cmpxchg(acq, (ptr), (o), (n), sizeof(*(ptr)))
170−#define cmpxchg_rel(ptr, o, n) \
171− ia64_cmpxchg(rel, (ptr), (o), (n), sizeof(*(ptr)))
172−
173−/* for compatibility with other platforms: */
174−#define cmpxchg(ptr, o, n) cmpxchg_acq((ptr), (o), (n))
175−#define cmpxchg64(ptr, o, n) cmpxchg_acq((ptr), (o), (n))
176−
177−#define cmpxchg_local cmpxchg
178−#define cmpxchg64_local cmpxchg64
179−
180−#ifdef CONFIG_IA64_DEBUG_CMPXCHG
181−# define CMPXCHG_BUGCHECK_DECL int _cmpxchg_bugcheck_count = 128;
182−# define CMPXCHG_BUGCHECK(v) \
183− do { \
184− if (_cmpxchg_bugcheck_count-- <= 0) { \
185− void *ip; \
186− extern int printk(const char *fmt, ...); \
187− ip = (void *) ia64_getreg(_IA64_REG_IP); \
188− printk("CMPXCHG_BUGCHECK: stuck at %p on word %p\n", ip, (v)); \
189− break; \
190− } \
191− } while (0)
192−#else /* !CONFIG_IA64_DEBUG_CMPXCHG */
193−# define CMPXCHG_BUGCHECK_DECL
194−# define CMPXCHG_BUGCHECK(v)
195−#endif /* !CONFIG_IA64_DEBUG_CMPXCHG */
196−
19785 #endif
19886
19987 #ifdef __KERNEL__
arch/ia64/kernel/perfmon.c+4−14
@@ -604,12 +604,6 @@ pfm_unprotect_ctx_ctxsw(pfm_context_t *x, unsigned long f) · 603 unmodified lines
604604 spin_unlock(&(x)->ctx_lock);
605605 }
606606
607−static inline unsigned int
608−pfm_do_munmap(struct mm_struct *mm, unsigned long addr, size_t len, int acct)
609−{
610− return do_munmap(mm, addr, len);
611−}
612−
613607 static inline unsigned long
614608 pfm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags, unsigned long exec)
615609 {
@@ -1458,8 +1452,9 @@ pfm_unreserve_session(pfm_context_t *ctx, int is_syswide, unsigned int cpu) · 842 unmodified lines
14581452 * a PROTECT_CTX() section.
14591453 */
14601454 static int
1461−pfm_remove_smpl_mapping(struct task_struct *task, void *vaddr, unsigned long size)
1455+pfm_remove_smpl_mapping(void *vaddr, unsigned long size)
14621456 {
1457+ struct task_struct *task = current;
14631458 int r;
14641459
14651460 /* sanity checks */
@@ -1473,13 +1468,8 @@ pfm_remove_smpl_mapping(struct task_struct *task, void *vaddr, unsigned long siz · 7 unmodified lines
14731468 /*
14741469 * does the actual unmapping
14751470 */
1476− down_write(&task->mm->mmap_sem);
1471+ r = vm_munmap((unsigned long)vaddr, size);
14771472
1478− DPRINT(("down_write done smpl_vaddr=%p size=%lu\n", vaddr, size));
1479−
1480− r = pfm_do_munmap(task->mm, (unsigned long)vaddr, size, 0);
1481−
1482− up_write(&task->mm->mmap_sem);
14831473 if (r !=0) {
14841474 printk(KERN_ERR "perfmon: [%d] unable to unmap sampling buffer @%p size=%lu\n", task_pid_nr(task), vaddr, size);
14851475 }
@@ -1945,7 +1935,7 @@ pfm_flush(struct file *filp, fl_owner_t id) · 459 unmodified lines
19451935 * because some VM function reenables interrupts.
19461936 *
19471937 */
1948− if (smpl_buf_vaddr) pfm_remove_smpl_mapping(current, smpl_buf_vaddr, smpl_buf_size);
1938+ if (smpl_buf_vaddr) pfm_remove_smpl_mapping(smpl_buf_vaddr, smpl_buf_size);
19491939
19501940 return 0;
19511941 }
arch/m68k/configs/m5275evb_defconfig+0−1
@@ -49,7 +49,6 @@ CONFIG_BLK_DEV_RAM=y · 48 unmodified lines
4949 CONFIG_NETDEVICES=y
5050 CONFIG_NET_ETHERNET=y
5151 CONFIG_FEC=y
52−CONFIG_FEC2=y
5352 # CONFIG_NETDEV_1000 is not set
5453 # CONFIG_NETDEV_10000 is not set
5554 CONFIG_PPP=y
arch/m68k/platform/527x/config.c+0−2
@@ -74,9 +74,7 @@ static void __init m527x_fec_init(void) · 73 unmodified lines
7474 writew(par | 0xf00, MCF_IPSBAR + 0x100082);
7575 v = readb(MCF_IPSBAR + 0x100078);
7676 writeb(v | 0xc0, MCF_IPSBAR + 0x100078);
77−#endif
7877
79−#ifdef CONFIG_FEC2
8078 /* Set multi-function pins to ethernet mode for fec1 */
8179 par = readw(MCF_IPSBAR + 0x100082);
8280 writew(par | 0xa0, MCF_IPSBAR + 0x100082);
arch/m68k/platform/68EZ328/Makefile+0−6
@@ -3,9 +3,3 @@ · 2 unmodified lines
33 #
44
55 obj-y := config.o
6−
7−extra-y := bootlogo.rh
8−
9−$(obj)/bootlogo.rh: $(src)/bootlogo.h
10− perl $(src)/../68328/bootlogo.pl < $(src)/bootlogo.h \
11− > $(obj)/bootlogo.rh
arch/m68k/platform/68VZ328/Makefile+2−7
@@ -3,14 +3,9 @@ · 2 unmodified lines
33 #
44
55 obj-y := config.o
6−logo-$(UCDIMM) := bootlogo.rh
7−logo-$(DRAGEN2) := screen.h
8−extra-y := $(logo-y)
9−
10−$(obj)/bootlogo.rh: $(src)/../68EZ328/bootlogo.h
11− perl $(src)/bootlogo.pl < $(src)/../68328/bootlogo.h > $(obj)/bootlogo.rh
6+extra-$(DRAGEN2):= screen.h
127
138 $(obj)/screen.h: $(src)/screen.xbm $(src)/xbm2lcd.pl
149 perl $(src)/xbm2lcd.pl < $(src)/screen.xbm > $(obj)/screen.h
1510
16−clean-files := $(obj)/screen.h $(obj)/bootlogo.rh
11+clean-files := $(obj)/screen.h
arch/m68k/platform/68VZ328/bootlogo.hrenamed from arch/m68k/platform/68EZ328/bootlogo.h+1−1
@@ -1,6 +1,6 @@
11 #define splash_width 640
22 #define splash_height 480
3−static unsigned char splash_bits[] = {
3+unsigned char __attribute__ ((aligned(16))) bootlogo_bits[] = {
44 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
55 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
66 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
arch/m68k/platform/coldfire/device.c+1−1
@@ -114,7 +114,7 @@ static struct resource mcf_fec1_resources[] = { · 113 unmodified lines
114114
115115 static struct platform_device mcf_fec1 = {
116116 .name = "fec",
117− .id = 0,
117+ .id = 1,
118118 .num_resources = ARRAY_SIZE(mcf_fec1_resources),
119119 .resource = mcf_fec1_resources,
120120 };
arch/powerpc/boot/dts/fsl/pq3-mpic-message-B.dtsi+43−0
@@ -0,0 +1,43 @@
1+/*
2+ * PQ3 MPIC Message (Group B) device tree stub [ controller @ offset 0x42400 ]
3+ *
4+ * Copyright 2012 Freescale Semiconductor Inc.
5+ *
6+ * Redistribution and use in source and binary forms, with or without
7+ * modification, are permitted provided that the following conditions are met:
8+ * * Redistributions of source code must retain the above copyright
9+ * notice, this list of conditions and the following disclaimer.
10+ * * Redistributions in binary form must reproduce the above copyright
11+ * notice, this list of conditions and the following disclaimer in the
12+ * documentation and/or other materials provided with the distribution.
13+ * * Neither the name of Freescale Semiconductor nor the
14+ * names of its contributors may be used to endorse or promote products
15+ * derived from this software without specific prior written permission.
16+ *
17+ *
18+ * ALTERNATIVELY, this software may be distributed under the terms of the
19+ * GNU General Public License ("GPL") as published by the Free Software
20+ * Foundation, either version 2 of that License or (at your option) any
21+ * later version.
22+ *
23+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33+ */
34+
35+message@42400 {
36+ compatible = "fsl,mpic-v3.1-msgr";
37+ reg = <0x42400 0x200>;
38+ interrupts = <
39+ 0xb4 2 0 0
40+ 0xb5 2 0 0
41+ 0xb6 2 0 0
42+ 0xb7 2 0 0>;
43+};
arch/powerpc/boot/dts/fsl/pq3-mpic.dtsi+10−0
@@ -53,6 +53,16 @@ timer@41100 { · 52 unmodified lines
5353 3 0 3 0>;
5454 };
5555
56+message@41400 {
57+ compatible = "fsl,mpic-v3.1-msgr";
58+ reg = <0x41400 0x200>;
59+ interrupts = <
60+ 0xb0 2 0 0
61+ 0xb1 2 0 0
62+ 0xb2 2 0 0
63+ 0xb3 2 0 0>;
64+};
65+
5666 msi@41600 {
5767 compatible = "fsl,mpic-msi";
5868 reg = <0x41600 0x80>;
arch/powerpc/include/asm/irq.h+0−2
@@ -33,8 +33,6 @@ extern atomic_t ppc_n_lost_interrupts; · 32 unmodified lines
3333 /* Same thing, used by the generic IRQ code */
3434 #define NR_IRQS_LEGACY NUM_ISA_INTERRUPTS
3535
36−struct irq_data;
37−extern irq_hw_number_t irqd_to_hwirq(struct irq_data *d);
3836 extern irq_hw_number_t virq_to_hw(unsigned int virq);
3937
4038 /**
arch/powerpc/include/asm/mpic.h+0−18
@@ -275,9 +275,6 @@ struct mpic · 274 unmodified lines
275275 unsigned int isu_mask;
276276 /* Number of sources */
277277 unsigned int num_sources;
278− /* default senses array */
279− unsigned char *senses;
280− unsigned int senses_count;
281278
282279 /* vector numbers used for internal sources (ipi/timers) */
283280 unsigned int ipi_vecs[4];
@@ -415,21 +412,6 @@ extern struct mpic *mpic_alloc(struct device_node *node, · 131 unmodified lines
415412 extern void mpic_assign_isu(struct mpic *mpic, unsigned int isu_num,
416413 phys_addr_t phys_addr);
417414
418−/* Set default sense codes
419− *
420− * @mpic: controller
421− * @senses: array of sense codes
422− * @count: size of above array
423− *
424− * Optionally provide an array (indexed on hardware interrupt numbers
425− * for this MPIC) of default sense codes for the chip. Those are linux
426− * sense codes IRQ_TYPE_*
427− *
428− * The driver gets ownership of the pointer, don't dispose of it or
429− * anything like that. __init only.
430− */
431−extern void mpic_set_default_senses(struct mpic *mpic, u8 *senses, int count);
432−
433415
434416 /* Initialize the controller. After this has been called, none of the above
435417 * should be called again for this mpic
arch/powerpc/include/asm/mpic_msgr.h+1−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313
1414 #include <linux/types.h>
1515 #include <linux/spinlock.h>
16+#include <asm/smp.h>
1617
1718 struct mpic_msgr {
1819 u32 __iomem *base;
arch/powerpc/include/asm/reg_booke.h+0−5
@@ -15,11 +15,6 @@ · 14 unmodified lines
1515 #ifndef __ASM_POWERPC_REG_BOOKE_H__
1616 #define __ASM_POWERPC_REG_BOOKE_H__
1717
18−#ifdef CONFIG_BOOKE_WDT
19−extern u32 booke_wdt_enabled;
20−extern u32 booke_wdt_period;
21−#endif /* CONFIG_BOOKE_WDT */
22−
2318 /* Machine State Register (MSR) Fields */
2419 #define MSR_GS (1<<28) /* Guest state */
2520 #define MSR_UCLE (1<<26) /* User-mode cache lock enable */
arch/powerpc/kernel/entry_32.S+21−18
@@ -206,40 +206,43 @@ reenable_mmu: /* re-enable mmu so we can */ · 205 unmodified lines
206206 andi. r10,r10,MSR_EE /* Did EE change? */
207207 beq 1f
208208
209− /* Save handler and return address into the 2 unused words
210− * of the STACK_FRAME_OVERHEAD (sneak sneak sneak). Everything
211− * else can be recovered from the pt_regs except r3 which for
212− * normal interrupts has been set to pt_regs and for syscalls
213− * is an argument, so we temporarily use ORIG_GPR3 to save it
214− */
215− stw r9,8(r1)
216− stw r11,12(r1)
217− stw r3,ORIG_GPR3(r1)
218209 /*
219210 * The trace_hardirqs_off will use CALLER_ADDR0 and CALLER_ADDR1.
220211 * If from user mode there is only one stack frame on the stack, and
221212 * accessing CALLER_ADDR1 will cause oops. So we need create a dummy
222213 * stack frame to make trace_hardirqs_off happy.
214+ *
215+ * This is handy because we also need to save a bunch of GPRs,
216+ * r3 can be different from GPR3(r1) at this point, r9 and r11
217+ * contains the old MSR and handler address respectively,
218+ * r4 & r5 can contain page fault arguments that need to be passed
219+ * along as well. r12, CCR, CTR, XER etc... are left clobbered as
220+ * they aren't useful past this point (aren't syscall arguments),
221+ * the rest is restored from the exception frame.
223222 */
223+ stwu r1,-32(r1)
224+ stw r9,8(r1)
225+ stw r11,12(r1)
226+ stw r3,16(r1)
227+ stw r4,20(r1)
228+ stw r5,24(r1)
224229 andi. r12,r12,MSR_PR
225− beq 11f
226− stwu r1,-16(r1)
230+ b 11f
227231 bl trace_hardirqs_off
228− addi r1,r1,16
229232 b 12f
230−
231233 11:
232234 bl trace_hardirqs_off
233235 12:
236+ lwz r5,24(r1)
237+ lwz r4,20(r1)
238+ lwz r3,16(r1)
239+ lwz r11,12(r1)
240+ lwz r9,8(r1)
241+ addi r1,r1,32
234242 lwz r0,GPR0(r1)
235− lwz r3,ORIG_GPR3(r1)
236− lwz r4,GPR4(r1)
237− lwz r5,GPR5(r1)
238243 lwz r6,GPR6(r1)
239244 lwz r7,GPR7(r1)
240245 lwz r8,GPR8(r1)
241− lwz r9,8(r1)
242− lwz r11,12(r1)
243246 1: mtctr r11
244247 mtlr r9
245248 bctr /* jump to handler */
arch/powerpc/kernel/irq.c+0−6
@@ -560,12 +560,6 @@ void do_softirq(void) · 559 unmodified lines
560560 local_irq_restore(flags);
561561 }
562562
563−irq_hw_number_t irqd_to_hwirq(struct irq_data *d)
564−{
565− return d->hwirq;
566−}
567−EXPORT_SYMBOL_GPL(irqd_to_hwirq);
568−
569563 irq_hw_number_t virq_to_hw(unsigned int virq)
570564 {
571565 struct irq_data *irq_data = irq_get_irq_data(virq);
arch/powerpc/kernel/process.c+2−2
@@ -1235,7 +1235,7 @@ void __ppc64_runlatch_on(void) · 1234 unmodified lines
12351235 ctrl |= CTRL_RUNLATCH;
12361236 mtspr(SPRN_CTRLT, ctrl);
12371237
1238− ti->local_flags |= TLF_RUNLATCH;
1238+ ti->local_flags |= _TLF_RUNLATCH;
12391239 }
12401240
12411241 /* Called with hard IRQs off */
@@ -1244,7 +1244,7 @@ void __ppc64_runlatch_off(void) · 2 unmodified lines
12441244 struct thread_info *ti = current_thread_info();
12451245 unsigned long ctrl;
12461246
1247− ti->local_flags &= ~TLF_RUNLATCH;
1247+ ti->local_flags &= ~_TLF_RUNLATCH;
12481248
12491249 ctrl = mfspr(SPRN_CTRLF);
12501250 ctrl &= ~CTRL_RUNLATCH;
arch/powerpc/kernel/setup_32.c+3−0
@@ -150,6 +150,9 @@ notrace void __init machine_init(u64 dt_ptr) · 149 unmodified lines
150150 }
151151
152152 #ifdef CONFIG_BOOKE_WDT
153+extern u32 booke_wdt_enabled;
154+extern u32 booke_wdt_period;
155+
153156 /* Checks wdt=x and wdt_period=xx command-line option */
154157 notrace int __init early_parse_wdt(char *p)
155158 {
arch/powerpc/platforms/85xx/common.c+6−0
@@ -21,6 +21,12 @@ static struct of_device_id __initdata mpc85xx_common_ids[] = { · 20 unmodified lines
2121 { .compatible = "fsl,qe", },
2222 { .compatible = "fsl,cpm2", },
2323 { .compatible = "fsl,srio", },
24+ /* So that the DMA channel nodes can be probed individually: */
25+ { .compatible = "fsl,eloplus-dma", },
26+ /* For the PMC driver */
27+ { .compatible = "fsl,mpc8548-guts", },
28+ /* Probably unnecessary? */
29+ { .compatible = "gpio-leds", },
2430 {},
2531 };
2632
arch/powerpc/platforms/85xx/mpc85xx_mds.c+1−10
@@ -399,12 +399,6 @@ static int __init board_fixups(void) · 398 unmodified lines
399399 machine_arch_initcall(mpc8568_mds, board_fixups);
400400 machine_arch_initcall(mpc8569_mds, board_fixups);
401401
402−static struct of_device_id mpc85xx_ids[] = {
403− { .compatible = "fsl,mpc8548-guts", },
404− { .compatible = "gpio-leds", },
405− {},
406−};
407−
408402 static int __init mpc85xx_publish_devices(void)
409403 {
410404 if (machine_is(mpc8568_mds))
@@ -412,10 +406,7 @@ static int __init mpc85xx_publish_devices(void) · 1 unmodified line
412406 if (machine_is(mpc8569_mds))
413407 simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio");
414408
415− mpc85xx_common_publish_devices();
416− of_platform_bus_probe(NULL, mpc85xx_ids, NULL);
417−
418− return 0;
409+ return mpc85xx_common_publish_devices();
419410 }
420411
421412 machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices);
arch/powerpc/platforms/85xx/p1022_ds.c+1−12
@@ -460,18 +460,7 @@ static void __init p1022_ds_setup_arch(void) · 459 unmodified lines
460460 pr_info("Freescale P1022 DS reference board\n");
461461 }
462462
463−static struct of_device_id __initdata p1022_ds_ids[] = {
464− /* So that the DMA channel nodes can be probed individually: */
465− { .compatible = "fsl,eloplus-dma", },
466− {},
467−};
468−
469−static int __init p1022_ds_publish_devices(void)
470−{
471− mpc85xx_common_publish_devices();
472− return of_platform_bus_probe(NULL, p1022_ds_ids, NULL);
473−}
474−machine_device_initcall(p1022_ds, p1022_ds_publish_devices);
463+machine_device_initcall(p1022_ds, mpc85xx_common_publish_devices);
475464
476465 machine_arch_initcall(p1022_ds, swiotlb_setup_bus_notifier);
477466
arch/powerpc/platforms/cell/axon_msi.c+1−1
@@ -392,7 +392,7 @@ static int axon_msi_probe(struct platform_device *device) · 391 unmodified lines
392392 }
393393 memset(msic->fifo_virt, 0xff, MSIC_FIFO_SIZE_BYTES);
394394
395− msic->irq_domain = irq_domain_add_nomap(dn, &msic_host_ops, msic);
395+ msic->irq_domain = irq_domain_add_nomap(dn, 0, &msic_host_ops, msic);
396396 if (!msic->irq_domain) {
397397 printk(KERN_ERR "axon_msi: couldn't allocate irq_domain for %s\n",
398398 dn->full_name);
arch/powerpc/platforms/cell/beat_interrupt.c+1−1
@@ -239,7 +239,7 @@ void __init beatic_init_IRQ(void) · 238 unmodified lines
239239 ppc_md.get_irq = beatic_get_irq;
240240
241241 /* Allocate an irq host */
242− beatic_host = irq_domain_add_nomap(NULL, &beatic_pic_host_ops, NULL);
242+ beatic_host = irq_domain_add_nomap(NULL, 0, &beatic_pic_host_ops, NULL);
243243 BUG_ON(beatic_host == NULL);
244244 irq_set_default_host(beatic_host);
245245 }
arch/powerpc/platforms/powermac/low_i2c.c+9−0
@@ -366,11 +366,20 @@ static void kw_i2c_timeout(unsigned long data) · 365 unmodified lines
366366 unsigned long flags;
367367
368368 spin_lock_irqsave(&host->lock, flags);
369+
370+ /*
371+ * If the timer is pending, that means we raced with the
372+ * irq, in which case we just return
373+ */
374+ if (timer_pending(&host->timeout_timer))
375+ goto skip;
376+
369377 kw_i2c_handle_interrupt(host, kw_read_reg(reg_isr));
370378 if (host->state != state_idle) {
371379 host->timeout_timer.expires = jiffies + KW_POLL_TIMEOUT;
372380 add_timer(&host->timeout_timer);
373381 }
382+ skip:
374383 spin_unlock_irqrestore(&host->lock, flags);
375384 }
376385
arch/powerpc/platforms/powermac/smp.c+1−1
@@ -192,7 +192,7 @@ static int psurge_secondary_ipi_init(void) · 191 unmodified lines
192192 {
193193 int rc = -ENOMEM;
194194
195− psurge_host = irq_domain_add_nomap(NULL, &psurge_host_ops, NULL);
195+ psurge_host = irq_domain_add_nomap(NULL, 0, &psurge_host_ops, NULL);
196196
197197 if (psurge_host)
198198 psurge_secondary_virq = irq_create_direct_mapping(psurge_host);
arch/powerpc/platforms/ps3/interrupt.c+1−2
@@ -753,9 +753,8 @@ void __init ps3_init_IRQ(void) · 752 unmodified lines
753753 unsigned cpu;
754754 struct irq_domain *host;
755755
756− host = irq_domain_add_nomap(NULL, &ps3_host_ops, NULL);
756+ host = irq_domain_add_nomap(NULL, PS3_PLUG_MAX + 1, &ps3_host_ops, NULL);
757757 irq_set_default_host(host);
758− irq_set_virq_count(PS3_PLUG_MAX + 1);
759758
760759 for_each_possible_cpu(cpu) {
761760 struct ps3_private *pd = &per_cpu(ps3_private, cpu);
arch/powerpc/platforms/pseries/eeh.c+1−1
@@ -1076,7 +1076,7 @@ static void eeh_add_device_late(struct pci_dev *dev) · 1075 unmodified lines
10761076 pr_debug("EEH: Adding device %s\n", pci_name(dev));
10771077
10781078 dn = pci_device_to_OF_node(dev);
1079− edev = pci_dev_to_eeh_dev(dev);
1079+ edev = of_node_to_eeh_dev(dn);
10801080 if (edev->pdev == dev) {
10811081 pr_debug("EEH: Already referenced !\n");
10821082 return;
arch/powerpc/sysdev/mpic.c+34−20
@@ -604,18 +604,14 @@ static struct mpic *mpic_find(unsigned int irq) · 603 unmodified lines
604604 }
605605
606606 /* Determine if the linux irq is an IPI */
607−static unsigned int mpic_is_ipi(struct mpic *mpic, unsigned int irq)
607+static unsigned int mpic_is_ipi(struct mpic *mpic, unsigned int src)
608608 {
609− unsigned int src = virq_to_hw(irq);
610−
611609 return (src >= mpic->ipi_vecs[0] && src <= mpic->ipi_vecs[3]);
612610 }
613611
614612 /* Determine if the linux irq is a timer */
615−static unsigned int mpic_is_tm(struct mpic *mpic, unsigned int irq)
613+static unsigned int mpic_is_tm(struct mpic *mpic, unsigned int src)
616614 {
617− unsigned int src = virq_to_hw(irq);
618−
619615 return (src >= mpic->timer_vecs[0] && src <= mpic->timer_vecs[7]);
620616 }
621617
@@ -876,21 +872,45 @@ int mpic_set_irq_type(struct irq_data *d, unsigned int flow_type) · 254 unmodified lines
876872 if (src >= mpic->num_sources)
877873 return -EINVAL;
878874
875+ vold = mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI));
876+
877+ /* We don't support "none" type */
879878 if (flow_type == IRQ_TYPE_NONE)
880− if (mpic->senses && src < mpic->senses_count)
881− flow_type = mpic->senses[src];
882− if (flow_type == IRQ_TYPE_NONE)
883− flow_type = IRQ_TYPE_LEVEL_LOW;
879+ flow_type = IRQ_TYPE_DEFAULT;
880+
881+ /* Default: read HW settings */
882+ if (flow_type == IRQ_TYPE_DEFAULT) {
883+ switch(vold & (MPIC_INFO(VECPRI_POLARITY_MASK) |
884+ MPIC_INFO(VECPRI_SENSE_MASK))) {
885+ case MPIC_INFO(VECPRI_SENSE_EDGE) |
886+ MPIC_INFO(VECPRI_POLARITY_POSITIVE):
887+ flow_type = IRQ_TYPE_EDGE_RISING;
888+ break;
889+ case MPIC_INFO(VECPRI_SENSE_EDGE) |
890+ MPIC_INFO(VECPRI_POLARITY_NEGATIVE):
891+ flow_type = IRQ_TYPE_EDGE_FALLING;
892+ break;
893+ case MPIC_INFO(VECPRI_SENSE_LEVEL) |
894+ MPIC_INFO(VECPRI_POLARITY_POSITIVE):
895+ flow_type = IRQ_TYPE_LEVEL_HIGH;
896+ break;
897+ case MPIC_INFO(VECPRI_SENSE_LEVEL) |
898+ MPIC_INFO(VECPRI_POLARITY_NEGATIVE):
899+ flow_type = IRQ_TYPE_LEVEL_LOW;
900+ break;
901+ }
902+ }
884903
904+ /* Apply to irq desc */
885905 irqd_set_trigger_type(d, flow_type);
886906
907+ /* Apply to HW */
887908 if (mpic_is_ht_interrupt(mpic, src))
888909 vecpri = MPIC_VECPRI_POLARITY_POSITIVE |
889910 MPIC_VECPRI_SENSE_EDGE;
890911 else
891912 vecpri = mpic_type_to_vecpri(mpic, flow_type);
892913
893− vold = mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI));
894914 vnew = vold & ~(MPIC_INFO(VECPRI_POLARITY_MASK) |
895915 MPIC_INFO(VECPRI_SENSE_MASK));
896916 vnew |= vecpri;
@@ -1026,7 +1046,7 @@ static int mpic_host_map(struct irq_domain *h, unsigned int virq, · 129 unmodified lines
10261046 irq_set_chip_and_handler(virq, chip, handle_fasteoi_irq);
10271047
10281048 /* Set default irq type */
1029− irq_set_irq_type(virq, IRQ_TYPE_NONE);
1049+ irq_set_irq_type(virq, IRQ_TYPE_DEFAULT);
10301050
10311051 /* If the MPIC was reset, then all vectors have already been
10321052 * initialized. Otherwise, a per source lazy initialization
@@ -1417,12 +1437,6 @@ void __init mpic_assign_isu(struct mpic *mpic, unsigned int isu_num, · 384 unmodified lines
14171437 mpic->num_sources = isu_first + mpic->isu_size;
14181438 }
14191439
1420−void __init mpic_set_default_senses(struct mpic *mpic, u8 *senses, int count)
1421−{
1422− mpic->senses = senses;
1423− mpic->senses_count = count;
1424−}
1425−
14261440 void __init mpic_init(struct mpic *mpic)
14271441 {
14281442 int i, cpu;
@@ -1555,12 +1569,12 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int pri) · 126 unmodified lines
15551569 return;
15561570
15571571 raw_spin_lock_irqsave(&mpic_lock, flags);
1558− if (mpic_is_ipi(mpic, irq)) {
1572+ if (mpic_is_ipi(mpic, src)) {
15591573 reg = mpic_ipi_read(src - mpic->ipi_vecs[0]) &
15601574 ~MPIC_VECPRI_PRIORITY_MASK;
15611575 mpic_ipi_write(src - mpic->ipi_vecs[0],
15621576 reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT));
1563− } else if (mpic_is_tm(mpic, irq)) {
1577+ } else if (mpic_is_tm(mpic, src)) {
15641578 reg = mpic_tm_read(src - mpic->timer_vecs[0]) &
15651579 ~MPIC_VECPRI_PRIORITY_MASK;
15661580 mpic_tm_write(src - mpic->timer_vecs[0],
arch/powerpc/sysdev/mpic_msgr.c+6−6
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727
2828 static struct mpic_msgr **mpic_msgrs;
2929 static unsigned int mpic_msgr_count;
30+static DEFINE_RAW_SPINLOCK(msgrs_lock);
3031
3132 static inline void _mpic_msgr_mer_write(struct mpic_msgr *msgr, u32 value)
3233 {
@@ -56,12 +57,11 @@ struct mpic_msgr *mpic_msgr_get(unsigned int reg_num) · 23 unmodified lines
5657 if (reg_num >= mpic_msgr_count)
5758 return ERR_PTR(-ENODEV);
5859
59− raw_spin_lock_irqsave(&msgr->lock, flags);
60− if (mpic_msgrs[reg_num]->in_use == MSGR_FREE) {
61− msgr = mpic_msgrs[reg_num];
60+ raw_spin_lock_irqsave(&msgrs_lock, flags);
61+ msgr = mpic_msgrs[reg_num];
62+ if (msgr->in_use == MSGR_FREE)
6263 msgr->in_use = MSGR_INUSE;
63− }
64− raw_spin_unlock_irqrestore(&msgr->lock, flags);
64+ raw_spin_unlock_irqrestore(&msgrs_lock, flags);
6565
6666 return msgr;
6767 }
@@ -228,7 +228,7 @@ static __devinit int mpic_msgr_probe(struct platform_device *dev) · 160 unmodified lines
228228
229229 reg_number = block_number * MPIC_MSGR_REGISTERS_PER_BLOCK + i;
230230 msgr->base = msgr_block_addr + i * MPIC_MSGR_STRIDE;
231− msgr->mer = msgr->base + MPIC_MSGR_MER_OFFSET;
231+ msgr->mer = (u32 *)((u8 *)msgr->base + MPIC_MSGR_MER_OFFSET);
232232 msgr->in_use = MSGR_FREE;
233233 msgr->num = i;
234234 raw_spin_lock_init(&msgr->lock);
arch/powerpc/sysdev/scom.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <linux/debugfs.h>
2323 #include <linux/slab.h>
2424 #include <linux/export.h>
25+#include <asm/debug.h>
2526 #include <asm/prom.h>
2627 #include <asm/scom.h>
2728
arch/s390/Kconfig+0−1
@@ -90,7 +90,6 @@ config S390 · 89 unmodified lines
9090 select HAVE_KERNEL_XZ
9191 select HAVE_ARCH_MUTEX_CPU_RELAX
9292 select HAVE_ARCH_JUMP_LABEL if !MARCH_G5
93− select HAVE_RCU_TABLE_FREE if SMP
9493 select ARCH_SAVE_PAGE_KEYS if HIBERNATION
9594 select HAVE_MEMBLOCK
9695 select HAVE_MEMBLOCK_NODE_MAP
arch/s390/defconfig+18−19
@@ -1,8 +1,12 @@
11 CONFIG_EXPERIMENTAL=y
22 CONFIG_SYSVIPC=y
33 CONFIG_POSIX_MQUEUE=y
4+CONFIG_FHANDLE=y
5+CONFIG_TASKSTATS=y
6+CONFIG_TASK_DELAY_ACCT=y
7+CONFIG_TASK_XACCT=y
8+CONFIG_TASK_IO_ACCOUNTING=y
49 CONFIG_AUDIT=y
5−CONFIG_RCU_TRACE=y
610 CONFIG_IKCONFIG=y
711 CONFIG_IKCONFIG_PROC=y
812 CONFIG_CGROUPS=y
@@ -14,16 +18,22 @@ CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y · 5 unmodified lines
1418 CONFIG_CGROUP_SCHED=y
1519 CONFIG_RT_GROUP_SCHED=y
1620 CONFIG_BLK_CGROUP=y
21+CONFIG_NAMESPACES=y
1722 CONFIG_BLK_DEV_INITRD=y
18−# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
23+CONFIG_RD_BZIP2=y
24+CONFIG_RD_LZMA=y
25+CONFIG_RD_XZ=y
26+CONFIG_RD_LZO=y
27+CONFIG_EXPERT=y
1928 # CONFIG_COMPAT_BRK is not set
20−CONFIG_SLAB=y
2129 CONFIG_PROFILING=y
2230 CONFIG_OPROFILE=y
2331 CONFIG_KPROBES=y
2432 CONFIG_MODULES=y
2533 CONFIG_MODULE_UNLOAD=y
2634 CONFIG_MODVERSIONS=y
35+CONFIG_PARTITION_ADVANCED=y
36+CONFIG_IBM_PARTITION=y
2737 CONFIG_DEFAULT_DEADLINE=y
2838 CONFIG_NO_HZ=y
2939 CONFIG_HIGH_RES_TIMERS=y
@@ -34,18 +44,15 @@ CONFIG_KSM=y · 4 unmodified lines
3444 CONFIG_BINFMT_MISC=m
3545 CONFIG_CMM=m
3646 CONFIG_HZ_100=y
37−CONFIG_KEXEC=y
38−CONFIG_PM=y
47+CONFIG_CRASH_DUMP=y
3948 CONFIG_HIBERNATION=y
4049 CONFIG_PACKET=y
4150 CONFIG_UNIX=y
4251 CONFIG_NET_KEY=y
43−CONFIG_AFIUCV=m
4452 CONFIG_INET=y
4553 CONFIG_IP_MULTICAST=y
4654 # CONFIG_INET_LRO is not set
4755 CONFIG_IPV6=y
48−CONFIG_NET_SCTPPROBE=m
4956 CONFIG_L2TP=m
5057 CONFIG_L2TP_DEBUGFS=m
5158 CONFIG_VLAN_8021Q=y
@@ -84,15 +91,14 @@ CONFIG_SCSI_CONSTANTS=y · 32 unmodified lines
8491 CONFIG_SCSI_LOGGING=y
8592 CONFIG_SCSI_SCAN_ASYNC=y
8693 CONFIG_ZFCP=y
87−CONFIG_ZFCP_DIF=y
8894 CONFIG_NETDEVICES=y
89−CONFIG_DUMMY=m
9095 CONFIG_BONDING=m
96+CONFIG_DUMMY=m
9197 CONFIG_EQUALIZER=m
9298 CONFIG_TUN=m
93−CONFIG_NET_ETHERNET=y
9499 CONFIG_VIRTIO_NET=y
95100 CONFIG_RAW_DRIVER=m
101+CONFIG_VIRTIO_BALLOON=y
96102 CONFIG_EXT2_FS=y
97103 CONFIG_EXT3_FS=y
98104 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
@@ -103,27 +109,21 @@ CONFIG_PROC_KCORE=y · 4 unmodified lines
103109 CONFIG_TMPFS=y
104110 CONFIG_TMPFS_POSIX_ACL=y
105111 # CONFIG_NETWORK_FILESYSTEMS is not set
106−CONFIG_PARTITION_ADVANCED=y
107−CONFIG_IBM_PARTITION=y
108−CONFIG_DLM=m
109112 CONFIG_MAGIC_SYSRQ=y
110−CONFIG_DEBUG_KERNEL=y
111113 CONFIG_TIMER_STATS=y
112114 CONFIG_PROVE_LOCKING=y
113115 CONFIG_PROVE_RCU=y
114116 CONFIG_LOCK_STAT=y
115117 CONFIG_DEBUG_LOCKDEP=y
116−CONFIG_DEBUG_SPINLOCK_SLEEP=y
117118 CONFIG_DEBUG_LIST=y
118119 CONFIG_DEBUG_NOTIFIERS=y
119−# CONFIG_RCU_CPU_STALL_DETECTOR is not set
120+CONFIG_RCU_TRACE=y
120121 CONFIG_KPROBES_SANITY_TEST=y
121122 CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
122123 CONFIG_CPU_NOTIFIER_ERROR_INJECT=m
123124 CONFIG_LATENCYTOP=y
124−CONFIG_SYSCTL_SYSCALL_CHECK=y
125125 CONFIG_DEBUG_PAGEALLOC=y
126−# CONFIG_FTRACE is not set
126+CONFIG_BLK_DEV_IO_TRACE=y
127127 # CONFIG_STRICT_DEVMEM is not set
128128 CONFIG_CRYPTO_NULL=m
129129 CONFIG_CRYPTO_CRYPTD=m
@@ -173,4 +173,3 @@ CONFIG_CRYPTO_SHA512_S390=m · 43 unmodified lines
173173 CONFIG_CRYPTO_DES_S390=m
174174 CONFIG_CRYPTO_AES_S390=m
175175 CONFIG_CRC7=m
176−CONFIG_VIRTIO_BALLOON=y
arch/s390/include/asm/facility.h+1−2
@@ -38,12 +38,11 @@ static inline void stfle(u64 *stfle_fac_list, int size) · 37 unmodified lines
3838 unsigned long nr;
3939
4040 preempt_disable();
41− S390_lowcore.stfl_fac_list = 0;
4241 asm volatile(
4342 " .insn s,0xb2b10000,0(0)\n" /* stfl */
4443 "0:\n"
4544 EX_TABLE(0b, 0b)
46− : "=m" (S390_lowcore.stfl_fac_list));
45+ : "+m" (S390_lowcore.stfl_fac_list));
4746 nr = 4; /* bytes stored by stfl */
4847 memcpy(stfle_fac_list, &S390_lowcore.stfl_fac_list, 4);
4948 if (S390_lowcore.stfl_fac_list & 0x01000000) {
arch/s390/include/asm/pgalloc.h+0−3
@@ -22,10 +22,7 @@ void crst_table_free(struct mm_struct *, unsigned long *); · 21 unmodified lines
2222
2323 unsigned long *page_table_alloc(struct mm_struct *, unsigned long);
2424 void page_table_free(struct mm_struct *, unsigned long *);
25−#ifdef CONFIG_HAVE_RCU_TABLE_FREE
2625 void page_table_free_rcu(struct mmu_gather *, unsigned long *);
27−void __tlb_remove_table(void *_table);
28−#endif
2926
3027 static inline void clear_table(unsigned long *s, unsigned long val, size_t n)
3128 {
arch/s390/include/asm/swab.h+1−1
@@ -77,7 +77,7 @@ static inline __u16 __arch_swab16p(const __u16 *x) · 76 unmodified lines
7777
7878 asm volatile(
7979 #ifndef __s390x__
80− " icm %0,2,%O+1(%R1)\n"
80+ " icm %0,2,%O1+1(%R1)\n"
8181 " ic %0,%1\n"
8282 : "=&d" (result) : "Q" (*x) : "cc");
8383 #else /* __s390x__ */
arch/s390/include/asm/tlb.h+1−21
@@ -30,14 +30,10 @@ · 29 unmodified lines
3030
3131 struct mmu_gather {
3232 struct mm_struct *mm;
33−#ifdef CONFIG_HAVE_RCU_TABLE_FREE
3433 struct mmu_table_batch *batch;
35−#endif
3634 unsigned int fullmm;
37− unsigned int need_flush;
3835 };
3936
40−#ifdef CONFIG_HAVE_RCU_TABLE_FREE
4137 struct mmu_table_batch {
4238 struct rcu_head rcu;
4339 unsigned int nr;
@@ -49,7 +45,6 @@ struct mmu_table_batch { · 5 unmodified lines
4945
5046 extern void tlb_table_flush(struct mmu_gather *tlb);
5147 extern void tlb_remove_table(struct mmu_gather *tlb, void *table);
52−#endif
5348
5449 static inline void tlb_gather_mmu(struct mmu_gather *tlb,
5550 struct mm_struct *mm,
@@ -57,29 +52,20 @@ static inline void tlb_gather_mmu(struct mmu_gather *tlb, · 1 unmodified line
5752 {
5853 tlb->mm = mm;
5954 tlb->fullmm = full_mm_flush;
60− tlb->need_flush = 0;
61−#ifdef CONFIG_HAVE_RCU_TABLE_FREE
6255 tlb->batch = NULL;
63−#endif
6456 if (tlb->fullmm)
6557 __tlb_flush_mm(mm);
6658 }
6759
6860 static inline void tlb_flush_mmu(struct mmu_gather *tlb)
6961 {
70− if (!tlb->need_flush)
71− return;
72− tlb->need_flush = 0;
73− __tlb_flush_mm(tlb->mm);
74−#ifdef CONFIG_HAVE_RCU_TABLE_FREE
7562 tlb_table_flush(tlb);
76−#endif
7763 }
7864
7965 static inline void tlb_finish_mmu(struct mmu_gather *tlb,
8066 unsigned long start, unsigned long end)
8167 {
82− tlb_flush_mmu(tlb);
68+ tlb_table_flush(tlb);
8369 }
8470
8571 /*
@@ -105,10 +91,8 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) · 19 unmodified lines
10591 static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
10692 unsigned long address)
10793 {
108−#ifdef CONFIG_HAVE_RCU_TABLE_FREE
10994 if (!tlb->fullmm)
11095 return page_table_free_rcu(tlb, (unsigned long *) pte);
111−#endif
11296 page_table_free(tlb->mm, (unsigned long *) pte);
11397 }
11498
@@ -125,10 +109,8 @@ static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd, · 10 unmodified lines
125109 #ifdef __s390x__
126110 if (tlb->mm->context.asce_limit <= (1UL << 31))
127111 return;
128−#ifdef CONFIG_HAVE_RCU_TABLE_FREE
129112 if (!tlb->fullmm)
130113 return tlb_remove_table(tlb, pmd);
131−#endif
132114 crst_table_free(tlb->mm, (unsigned long *) pmd);
133115 #endif
134116 }
@@ -146,10 +128,8 @@ static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud, · 11 unmodified lines
146128 #ifdef __s390x__
147129 if (tlb->mm->context.asce_limit <= (1UL << 42))
148130 return;
149−#ifdef CONFIG_HAVE_RCU_TABLE_FREE
150131 if (!tlb->fullmm)
151132 return tlb_remove_table(tlb, pud);
152−#endif
153133 crst_table_free(tlb->mm, (unsigned long *) pud);
154134 #endif
155135 }
arch/s390/kernel/head.S+1−1
@@ -474,9 +474,9 @@ ENTRY(startup_kdump) · 473 unmodified lines
474474 stck __LC_LAST_UPDATE_CLOCK
475475 spt 5f-.LPG0(%r13)
476476 mvc __LC_LAST_UPDATE_TIMER(8),5f-.LPG0(%r13)
477+ xc __LC_STFL_FAC_LIST(8),__LC_STFL_FAC_LIST
477478 #ifndef CONFIG_MARCH_G5
478479 # check capabilities against MARCH_{G5,Z900,Z990,Z9_109,Z10}
479− xc __LC_STFL_FAC_LIST(8),__LC_STFL_FAC_LIST
480480 .insn s,0xb2b10000,__LC_STFL_FAC_LIST # store facility list
481481 tm __LC_STFL_FAC_LIST,0x01 # stfle available ?
482482 jz 0f
arch/s390/kernel/irq.c+6−3
@@ -118,9 +118,10 @@ asmlinkage void do_softirq(void) · 117 unmodified lines
118118 "a" (__do_softirq)
119119 : "0", "1", "2", "3", "4", "5", "14",
120120 "cc", "memory" );
121− } else
121+ } else {
122122 /* We are already on the async stack. */
123123 __do_softirq();
124+ }
124125 }
125126
126127 local_irq_restore(flags);
@@ -192,11 +193,12 @@ int unregister_external_interrupt(u16 code, ext_int_handler_t handler) · 65 unmodified lines
192193 int index = ext_hash(code);
193194
194195 spin_lock_irqsave(&ext_int_hash_lock, flags);
195− list_for_each_entry_rcu(p, &ext_int_hash[index], entry)
196+ list_for_each_entry_rcu(p, &ext_int_hash[index], entry) {
196197 if (p->code == code && p->handler == handler) {
197198 list_del_rcu(&p->entry);
198199 kfree_rcu(p, rcu);
199200 }
201+ }
200202 spin_unlock_irqrestore(&ext_int_hash_lock, flags);
201203 return 0;
202204 }
@@ -211,9 +213,10 @@ void __irq_entry do_extint(struct pt_regs *regs, struct ext_code ext_code, · 8 unmodified lines
211213
212214 old_regs = set_irq_regs(regs);
213215 irq_enter();
214− if (S390_lowcore.int_clock >= S390_lowcore.clock_comparator)
216+ if (S390_lowcore.int_clock >= S390_lowcore.clock_comparator) {
215217 /* Serve timer interrupts first. */
216218 clock_comparator_work();
219+ }
217220 kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++;
218221 if (ext_code.code != 0x1004)
219222 __get_cpu_var(s390_idle).nohz_delay = 1;
arch/s390/kernel/perf_cpum_cf.c+2−2
@@ -178,7 +178,7 @@ static void cpumf_pmu_enable(struct pmu *pmu) · 177 unmodified lines
178178 err = lcctl(cpuhw->state);
179179 if (err) {
180180 pr_err("Enabling the performance measuring unit "
181− "failed with rc=%lx\n", err);
181+ "failed with rc=%x\n", err);
182182 return;
183183 }
184184
@@ -203,7 +203,7 @@ static void cpumf_pmu_disable(struct pmu *pmu) · 18 unmodified lines
203203 err = lcctl(inactive);
204204 if (err) {
205205 pr_err("Disabling the performance measuring unit "
206− "failed with rc=%lx\n", err);
206+ "failed with rc=%x\n", err);
207207 return;
208208 }
209209
arch/s390/mm/maccess.c+18−9
@@ -61,21 +61,14 @@ long probe_kernel_write(void *dst, const void *src, size_t size) · 60 unmodified lines
6161 return copied < 0 ? -EFAULT : 0;
6262 }
6363
64−/*
65− * Copy memory in real mode (kernel to kernel)
66− */
67−int memcpy_real(void *dest, void *src, size_t count)
64+static int __memcpy_real(void *dest, void *src, size_t count)
6865 {
6966 register unsigned long _dest asm("2") = (unsigned long) dest;
7067 register unsigned long _len1 asm("3") = (unsigned long) count;
7168 register unsigned long _src asm("4") = (unsigned long) src;
7269 register unsigned long _len2 asm("5") = (unsigned long) count;
73− unsigned long flags;
7470 int rc = -EFAULT;
7571
76− if (!count)
77− return 0;
78− flags = __arch_local_irq_stnsm(0xf8UL);
7972 asm volatile (
8073 "0: mvcle %1,%2,0x0\n"
8174 "1: jo 0b\n"
@@ -86,7 +79,23 @@ int memcpy_real(void *dest, void *src, size_t count) · 4 unmodified lines
8679 "+d" (_len2), "=m" (*((long *) dest))
8780 : "m" (*((long *) src))
8881 : "cc", "memory");
89− arch_local_irq_restore(flags);
82+ return rc;
83+}
84+
85+/*
86+ * Copy memory in real mode (kernel to kernel)
87+ */
88+int memcpy_real(void *dest, void *src, size_t count)
89+{
90+ unsigned long flags;
91+ int rc;
92+
93+ if (!count)
94+ return 0;
95+ local_irq_save(flags);
96+ __arch_local_irq_stnsm(0xfbUL);
97+ rc = __memcpy_real(dest, src, count);
98+ local_irq_restore(flags);
9099 return rc;
91100 }
92101
arch/s390/mm/pgtable.c+60−3
@@ -678,8 +678,6 @@ void page_table_free(struct mm_struct *mm, unsigned long *table) · 677 unmodified lines
678678 }
679679 }
680680
681−#ifdef CONFIG_HAVE_RCU_TABLE_FREE
682−
683681 static void __page_table_free_rcu(void *table, unsigned bit)
684682 {
685683 struct page *page;
@@ -733,7 +731,66 @@ void __tlb_remove_table(void *_table) · 47 unmodified lines
733731 free_pages((unsigned long) table, ALLOC_ORDER);
734732 }
735733
736−#endif
734+static void tlb_remove_table_smp_sync(void *arg)
735+{
736+ /* Simply deliver the interrupt */
737+}
738+
739+static void tlb_remove_table_one(void *table)
740+{
741+ /*
742+ * This isn't an RCU grace period and hence the page-tables cannot be
743+ * assumed to be actually RCU-freed.
744+ *
745+ * It is however sufficient for software page-table walkers that rely
746+ * on IRQ disabling. See the comment near struct mmu_table_batch.
747+ */
748+ smp_call_function(tlb_remove_table_smp_sync, NULL, 1);
749+ __tlb_remove_table(table);
750+}
751+
752+static void tlb_remove_table_rcu(struct rcu_head *head)
753+{
754+ struct mmu_table_batch *batch;
755+ int i;
756+
757+ batch = container_of(head, struct mmu_table_batch, rcu);
758+
759+ for (i = 0; i < batch->nr; i++)
760+ __tlb_remove_table(batch->tables[i]);
761+
762+ free_page((unsigned long)batch);
763+}
764+
765+void tlb_table_flush(struct mmu_gather *tlb)
766+{
767+ struct mmu_table_batch **batch = &tlb->batch;
768+
769+ if (*batch) {
770+ __tlb_flush_mm(tlb->mm);
771+ call_rcu_sched(&(*batch)->rcu, tlb_remove_table_rcu);
772+ *batch = NULL;
773+ }
774+}
775+
776+void tlb_remove_table(struct mmu_gather *tlb, void *table)
777+{
778+ struct mmu_table_batch **batch = &tlb->batch;
779+
780+ if (*batch == NULL) {
781+ *batch = (struct mmu_table_batch *)
782+ __get_free_page(GFP_NOWAIT | __GFP_NOWARN);
783+ if (*batch == NULL) {
784+ __tlb_flush_mm(tlb->mm);
785+ tlb_remove_table_one(table);
786+ return;
787+ }
788+ (*batch)->nr = 0;
789+ }
790+ (*batch)->tables[(*batch)->nr++] = table;
791+ if ((*batch)->nr == MAX_TABLE_BATCH)
792+ tlb_table_flush(tlb);
793+}
737794
738795 /*
739796 * switch on pgstes for its userspace process (for kvm)
arch/sh/include/asm/atomic.h+1−1
@@ -11,7 +11,7 @@ · 10 unmodified lines
1111 #include <linux/types.h>
1212 #include <asm/cmpxchg.h>
1313
14−#define ATOMIC_INIT(i) ( (atomic_t) { (i) } )
14+#define ATOMIC_INIT(i) { (i) }
1515
1616 #define atomic_read(v) (*(volatile int *)&(v)->counter)
1717 #define atomic_set(v,i) ((v)->counter = (i))
arch/sh/mm/fault_32.c+1−1
@@ -86,7 +86,7 @@ static noinline int vmalloc_fault(unsigned long address) · 85 unmodified lines
8686 pte_t *pte_k;
8787
8888 /* Make sure we are in vmalloc/module/P3 area: */
89− if (!(address >= VMALLOC_START && address < P3_ADDR_MAX))
89+ if (!(address >= P3SEG && address < P3_ADDR_MAX))
9090 return -1;
9191
9292 /*
arch/sparc/kernel/ds.c+1−1
@@ -1264,4 +1264,4 @@ static int __init ds_init(void) · 1263 unmodified lines
12641264 return vio_register_driver(&ds_driver);
12651265 }
12661266
1267−subsys_initcall(ds_init);
1267+fs_initcall(ds_init);
arch/sparc/kernel/leon_pci.c+0−13
@@ -45,7 +45,6 @@ void leon_pci_init(struct platform_device *ofdev, struct leon_pci_info *info) · 44 unmodified lines
4545
4646 void __devinit pcibios_fixup_bus(struct pci_bus *pbus)
4747 {
48− struct leon_pci_info *info = pbus->sysdata;
4948 struct pci_dev *dev;
5049 int i, has_io, has_mem;
5150 u16 cmd;
@@ -111,18 +110,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) · 59 unmodified lines
111110 return pci_enable_resources(dev, mask);
112111 }
113112
114−struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
115−{
116− /*
117− * Currently the OpenBoot nodes are not connected with the PCI device,
118− * this is because the LEON PROM does not create PCI nodes. Eventually
119− * this will change and the same approach as pcic.c can be used to
120− * match PROM nodes with pci devices.
121− */
122− return NULL;
123−}
124−EXPORT_SYMBOL(pci_device_to_OF_node);
125−
126113 void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
127114 {
128115 #ifdef CONFIG_PCI_DEBUG
arch/sparc/kernel/leon_smp.c+3−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <linux/pm.h>
2424 #include <linux/delay.h>
2525 #include <linux/gfp.h>
26+#include <linux/cpu.h>
2627
2728 #include <asm/cacheflush.h>
2829 #include <asm/tlbflush.h>
@@ -78,6 +79,8 @@ void __cpuinit leon_callin(void) · 49 unmodified lines
7879 local_flush_tlb_all();
7980 leon_configure_cache_smp();
8081
82+ notify_cpu_starting(cpuid);
83+
8184 /* Get our local ticker going. */
8285 smp_setup_percpu_timer();
8386
arch/sparc/kernel/rtrap_64.S+0−7
@@ -20,11 +20,6 @@ · 19 unmodified lines
2020
2121 .text
2222 .align 32
23−__handle_softirq:
24− call do_softirq
25− nop
26− ba,a,pt %xcc, __handle_softirq_continue
27− nop
2823 __handle_preemption:
2924 call schedule
3025 wrpr %g0, RTRAP_PSTATE, %pstate
@@ -89,9 +84,7 @@ rtrap: · 58 unmodified lines
8984 cmp %l1, 0
9085
9186 /* mm/ultra.S:xcall_report_regs KNOWS about this load. */
92− bne,pn %icc, __handle_softirq
9387 ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1
94−__handle_softirq_continue:
9588 rtrap_xcall:
9689 sethi %hi(0xf << 20), %l4
9790 and %l1, %l4, %l4
arch/sparc/kernel/sys_sparc_64.c+1−6
@@ -566,15 +566,10 @@ out: · 565 unmodified lines
566566
567567 SYSCALL_DEFINE2(64_munmap, unsigned long, addr, size_t, len)
568568 {
569− long ret;
570−
571569 if (invalid_64bit_range(addr, len))
572570 return -EINVAL;
573571
574− down_write(&current->mm->mmap_sem);
575− ret = do_munmap(current->mm, addr, len);
576− up_write(&current->mm->mmap_sem);
577− return ret;
572+ return vm_munmap(addr, len);
578573 }
579574
580575 extern unsigned long do_mremap(unsigned long addr,
arch/sparc/mm/fault_32.c+30−7
@@ -225,6 +225,8 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, · 224 unmodified lines
225225 unsigned long g2;
226226 int from_user = !(regs->psr & PSR_PS);
227227 int fault, code;
228+ unsigned int flags = (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
229+ (write ? FAULT_FLAG_WRITE : 0));
228230
229231 if(text_fault)
230232 address = regs->pc;
@@ -251,6 +253,7 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, · 20 unmodified lines
251253
252254 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
253255
256+retry:
254257 down_read(&mm->mmap_sem);
255258
256259 /*
@@ -289,7 +292,11 @@ good_area: · 32 unmodified lines
289292 * make sure we exit gracefully rather than endlessly redo
290293 * the fault.
291294 */
292− fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0);
295+ fault = handle_mm_fault(mm, vma, address, flags);
296+
297+ if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
298+ return;
299+
293300 if (unlikely(fault & VM_FAULT_ERROR)) {
294301 if (fault & VM_FAULT_OOM)
295302 goto out_of_memory;
@@ -297,13 +304,29 @@ good_area: · 1 unmodified line
297304 goto do_sigbus;
298305 BUG();
299306 }
300− if (fault & VM_FAULT_MAJOR) {
301− current->maj_flt++;
302− perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address);
303− } else {
304− current->min_flt++;
305− perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address);
307+
308+ if (flags & FAULT_FLAG_ALLOW_RETRY) {
309+ if (fault & VM_FAULT_MAJOR) {
310+ current->maj_flt++;
311+ perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ,
312+ 1, regs, address);
313+ } else {
314+ current->min_flt++;
315+ perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN,
316+ 1, regs, address);
317+ }
318+ if (fault & VM_FAULT_RETRY) {
319+ flags &= ~FAULT_FLAG_ALLOW_RETRY;
320+
321+ /* No need to up_read(&mm->mmap_sem) as we would
322+ * have already released it in __lock_page_or_retry
323+ * in mm/filemap.c.
324+ */
325+
326+ goto retry;
327+ }
306328 }
329+
307330 up_read(&mm->mmap_sem);
308331 return;
309332
arch/sparc/mm/fault_64.c+30−7
@@ -279,6 +279,7 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs) · 278 unmodified lines
279279 unsigned int insn = 0;
280280 int si_code, fault_code, fault;
281281 unsigned long address, mm_rss;
282+ unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
282283
283284 fault_code = get_thread_fault_code();
284285
@@ -333,6 +334,8 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs) · 48 unmodified lines
333334 insn = get_fault_insn(regs, insn);
334335 goto handle_kernel_fault;
335336 }
337+
338+retry:
336339 down_read(&mm->mmap_sem);
337340 }
338341
@@ -423,7 +426,12 @@ good_area: · 84 unmodified lines
423426 goto bad_area;
424427 }
425428
426− fault = handle_mm_fault(mm, vma, address, (fault_code & FAULT_CODE_WRITE) ? FAULT_FLAG_WRITE : 0);
429+ flags |= ((fault_code & FAULT_CODE_WRITE) ? FAULT_FLAG_WRITE : 0);
430+ fault = handle_mm_fault(mm, vma, address, flags);
431+
432+ if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
433+ return;
434+
427435 if (unlikely(fault & VM_FAULT_ERROR)) {
428436 if (fault & VM_FAULT_OOM)
429437 goto out_of_memory;
@@ -431,12 +439,27 @@ good_area: · 1 unmodified line
431439 goto do_sigbus;
432440 BUG();
433441 }
434− if (fault & VM_FAULT_MAJOR) {
435− current->maj_flt++;
436− perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address);
437− } else {
438− current->min_flt++;
439− perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address);
442+
443+ if (flags & FAULT_FLAG_ALLOW_RETRY) {
444+ if (fault & VM_FAULT_MAJOR) {
445+ current->maj_flt++;
446+ perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ,
447+ 1, regs, address);
448+ } else {
449+ current->min_flt++;
450+ perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN,
451+ 1, regs, address);
452+ }
453+ if (fault & VM_FAULT_RETRY) {
454+ flags &= ~FAULT_FLAG_ALLOW_RETRY;
455+
456+ /* No need to up_read(&mm->mmap_sem) as we would
457+ * have already released it in __lock_page_or_retry
458+ * in mm/filemap.c.
459+ */
460+
461+ goto retry;
462+ }
440463 }
441464 up_read(&mm->mmap_sem);
442465
arch/tile/include/asm/pci.h+2−2
@@ -47,8 +47,8 @@ struct pci_controller { · 46 unmodified lines
4747 */
4848 #define PCI_DMA_BUS_IS_PHYS 1
4949
50−int __devinit tile_pci_init(void);
51−int __devinit pcibios_init(void);
50+int __init tile_pci_init(void);
51+int __init pcibios_init(void);
5252
5353 static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) {}
5454
arch/tile/kernel/pci.c+2−2
@@ -141,7 +141,7 @@ static int __devinit tile_init_irqs(int controller_id, · 140 unmodified lines
141141 *
142142 * Returns the number of controllers discovered.
143143 */
144−int __devinit tile_pci_init(void)
144+int __init tile_pci_init(void)
145145 {
146146 int i;
147147
@@ -287,7 +287,7 @@ static void __devinit fixup_read_and_payload_sizes(void) · 139 unmodified lines
287287 * The controllers have been set up by the time we get here, by a call to
288288 * tile_pci_init.
289289 */
290−int __devinit pcibios_init(void)
290+int __init pcibios_init(void)
291291 {
292292 int i;
293293
arch/tile/kernel/proc.c+1−3
@@ -146,7 +146,6 @@ static ctl_table unaligned_table[] = { · 145 unmodified lines
146146 },
147147 {}
148148 };
149−#endif
150149
151150 static struct ctl_path tile_path[] = {
152151 { .procname = "tile" },
@@ -155,10 +154,9 @@ static struct ctl_path tile_path[] = { · 2 unmodified lines
155154
156155 static int __init proc_sys_tile_init(void)
157156 {
158−#ifndef __tilegx__ /* FIXME: GX: no support for unaligned access yet */
159157 register_sysctl_paths(tile_path, unaligned_table);
160−#endif
161158 return 0;
162159 }
163160
164161 arch_initcall(proc_sys_tile_init);
162+#endif
arch/tile/kernel/single_step.c+1−3
@@ -346,12 +346,10 @@ void single_step_once(struct pt_regs *regs) · 345 unmodified lines
346346 }
347347
348348 /* allocate a cache line of writable, executable memory */
349− down_write(&current->mm->mmap_sem);
350− buffer = (void __user *) do_mmap(NULL, 0, 64,
349+ buffer = (void __user *) vm_mmap(NULL, 0, 64,
351350 PROT_EXEC | PROT_READ | PROT_WRITE,
352351 MAP_PRIVATE | MAP_ANONYMOUS,
353352 0);
354− up_write(&current->mm->mmap_sem);
355353
356354 if (IS_ERR((void __force *)buffer)) {
357355 kfree(state);
arch/tile/kernel/smpboot.c+2−0
@@ -196,6 +196,8 @@ void __cpuinit online_secondary(void) · 195 unmodified lines
196196 /* This must be done before setting cpu_online_mask */
197197 wmb();
198198
199+ notify_cpu_starting(smp_processor_id());
200+
199201 /*
200202 * We need to hold call_lock, so there is no inconsistency
201203 * between the time smp_call_function() determines number of
arch/um/drivers/cow.h+0−35
@@ -3,41 +3,6 @@ · 2 unmodified lines
33
44 #include <asm/types.h>
55
6−#if defined(__KERNEL__)
7−
8−# include <asm/byteorder.h>
9−
10−# if defined(__BIG_ENDIAN)
11−# define ntohll(x) (x)
12−# define htonll(x) (x)
13−# elif defined(__LITTLE_ENDIAN)
14−# define ntohll(x) be64_to_cpu(x)
15−# define htonll(x) cpu_to_be64(x)
16−# else
17−# error "Could not determine byte order"
18−# endif
19−
20−#else
21−/* For the definition of ntohl, htonl and __BYTE_ORDER */
22−#include <endian.h>
23−#include <netinet/in.h>
24−#if defined(__BYTE_ORDER)
25−
26−# if __BYTE_ORDER == __BIG_ENDIAN
27−# define ntohll(x) (x)
28−# define htonll(x) (x)
29−# elif __BYTE_ORDER == __LITTLE_ENDIAN
30−# define ntohll(x) bswap_64(x)
31−# define htonll(x) bswap_64(x)
32−# else
33−# error "Could not determine byte order: __BYTE_ORDER uncorrectly defined"
34−# endif
35−
36−#else /* ! defined(__BYTE_ORDER) */
37−# error "Could not determine byte order: __BYTE_ORDER not defined"
38−#endif
39−#endif /* ! defined(__KERNEL__) */
40−
416 extern int init_cow_file(int fd, char *cow_file, char *backing_file,
427 int sectorsize, int alignment, int *bitmap_offset_out,
438 unsigned long *bitmap_len_out, int *data_offset_out);
arch/um/drivers/cow_user.c+21−22
@@ -8,11 +8,10 @@ · 7 unmodified lines
88 * that.
99 */
1010 #include <unistd.h>
11−#include <byteswap.h>
1211 #include <errno.h>
1312 #include <string.h>
1413 #include <arpa/inet.h>
15−#include <asm/types.h>
14+#include <endian.h>
1615 #include "cow.h"
1716 #include "cow_sys.h"
1817
@@ -214,8 +213,8 @@ int write_cow_header(char *cow_file, int fd, char *backing_file, · 195 unmodified lines
214213 "header\n");
215214 goto out;
216215 }
217− header->magic = htonl(COW_MAGIC);
218− header->version = htonl(COW_VERSION);
216+ header->magic = htobe32(COW_MAGIC);
217+ header->version = htobe32(COW_VERSION);
219218
220219 err = -EINVAL;
221220 if (strlen(backing_file) > sizeof(header->backing_file) - 1) {
@@ -246,10 +245,10 @@ int write_cow_header(char *cow_file, int fd, char *backing_file, · 24 unmodified lines
246245 goto out_free;
247246 }
248247
249− header->mtime = htonl(modtime);
250− header->size = htonll(*size);
251− header->sectorsize = htonl(sectorsize);
252− header->alignment = htonl(alignment);
248+ header->mtime = htobe32(modtime);
249+ header->size = htobe64(*size);
250+ header->sectorsize = htobe32(sectorsize);
251+ header->alignment = htobe32(alignment);
253252 header->cow_format = COW_BITMAP;
254253
255254 err = cow_write_file(fd, header, sizeof(*header));
@@ -301,8 +300,8 @@ int read_cow_header(int (*reader)(__u64, char *, int, void *), void *arg, · 45 unmodified lines
301300 magic = header->v1.magic;
302301 if (magic == COW_MAGIC)
303302 version = header->v1.version;
304− else if (magic == ntohl(COW_MAGIC))
305− version = ntohl(header->v1.version);
303+ else if (magic == be32toh(COW_MAGIC))
304+ version = be32toh(header->v1.version);
306305 /* No error printed because the non-COW case comes through here */
307306 else goto out;
308307
@@ -327,9 +326,9 @@ int read_cow_header(int (*reader)(__u64, char *, int, void *), void *arg, · 18 unmodified lines
327326 "header\n");
328327 goto out;
329328 }
330− *mtime_out = ntohl(header->v2.mtime);
331− *size_out = ntohll(header->v2.size);
332− *sectorsize_out = ntohl(header->v2.sectorsize);
329+ *mtime_out = be32toh(header->v2.mtime);
330+ *size_out = be64toh(header->v2.size);
331+ *sectorsize_out = be32toh(header->v2.sectorsize);
333332 *bitmap_offset_out = sizeof(header->v2);
334333 *align_out = *sectorsize_out;
335334 file = header->v2.backing_file;
@@ -341,10 +340,10 @@ int read_cow_header(int (*reader)(__u64, char *, int, void *), void *arg, · 5 unmodified lines
341340 "header\n");
342341 goto out;
343342 }
344− *mtime_out = ntohl(header->v3.mtime);
345− *size_out = ntohll(header->v3.size);
346− *sectorsize_out = ntohl(header->v3.sectorsize);
347− *align_out = ntohl(header->v3.alignment);
343+ *mtime_out = be32toh(header->v3.mtime);
344+ *size_out = be64toh(header->v3.size);
345+ *sectorsize_out = be32toh(header->v3.sectorsize);
346+ *align_out = be32toh(header->v3.alignment);
348347 if (*align_out == 0) {
349348 cow_printf("read_cow_header - invalid COW header, "
350349 "align == 0\n");
@@ -366,16 +365,16 @@ int read_cow_header(int (*reader)(__u64, char *, int, void *), void *arg, · 15 unmodified lines
366365 * this was used until Dec2005 - 64bits are needed to represent
367366 * 2038+. I.e. we can safely do this truncating cast.
368367 *
369− * Additionally, we must use ntohl() instead of ntohll(), since
368+ * Additionally, we must use be32toh() instead of be64toh(), since
370369 * the program used to use the former (tested - I got mtime
371370 * mismatch "0 vs whatever").
372371 *
373372 * Ever heard about bug-to-bug-compatibility ? ;-) */
374− *mtime_out = (time32_t) ntohl(header->v3_b.mtime);
373+ *mtime_out = (time32_t) be32toh(header->v3_b.mtime);
375374
376− *size_out = ntohll(header->v3_b.size);
377− *sectorsize_out = ntohl(header->v3_b.sectorsize);
378− *align_out = ntohl(header->v3_b.alignment);
375+ *size_out = be64toh(header->v3_b.size);
376+ *sectorsize_out = be32toh(header->v3_b.sectorsize);
377+ *align_out = be32toh(header->v3_b.alignment);
379378 if (*align_out == 0) {
380379 cow_printf("read_cow_header - invalid COW header, "
381380 "align == 0\n");
arch/um/drivers/mconsole_kern.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <linux/workqueue.h>
2323 #include <linux/mutex.h>
2424 #include <asm/uaccess.h>
25+#include <asm/switch_to.h>
2526
2627 #include "init.h"
2728 #include "irq_kern.h"
arch/um/include/asm/Kbuild+2−1
@@ -1,3 +1,4 @@
11 generic-y += bug.h cputime.h device.h emergency-restart.h futex.h hardirq.h
22 generic-y += hw_irq.h irq_regs.h kdebug.h percpu.h sections.h topology.h xor.h
3−generic-y += ftrace.h pci.h io.h param.h delay.h mutex.h current.h
3+generic-y += ftrace.h pci.h io.h param.h delay.h mutex.h current.h exec.h
4+generic-y += switch_to.h
arch/um/kernel/Makefile+4−3
@@ -3,9 +3,10 @@ · 2 unmodified lines
33 # Licensed under the GPL
44 #
55
6−CPPFLAGS_vmlinux.lds := -DSTART=$(LDS_START) \
7− -DELF_ARCH=$(LDS_ELF_ARCH) \
8− -DELF_FORMAT=$(LDS_ELF_FORMAT)
6+CPPFLAGS_vmlinux.lds := -DSTART=$(LDS_START) \
7+ -DELF_ARCH=$(LDS_ELF_ARCH) \
8+ -DELF_FORMAT=$(LDS_ELF_FORMAT) \
9+ $(LDS_EXTRA)
910 extra-y := vmlinux.lds
1011 clean-files :=
1112
arch/um/kernel/process.c+1−5
@@ -88,11 +88,8 @@ static inline void set_current(struct task_struct *task) · 87 unmodified lines
8888
8989 extern void arch_switch_to(struct task_struct *to);
9090
91−void *_switch_to(void *prev, void *next, void *last)
91+void *__switch_to(struct task_struct *from, struct task_struct *to)
9292 {
93− struct task_struct *from = prev;
94− struct task_struct *to = next;
95−
9693 to->thread.prev_sched = from;
9794 set_current(to);
9895
@@ -111,7 +108,6 @@ void *_switch_to(void *prev, void *next, void *last) · 12 unmodified lines
111108 } while (current->thread.saved_task);
112109
113110 return current->thread.prev_sched;
114−
115111 }
116112
117113 void interrupt_end(void)
arch/um/kernel/skas/mmu.c+0−1
@@ -103,7 +103,6 @@ int init_new_context(struct task_struct *task, struct mm_struct *mm) · 102 unmodified lines
103103
104104 void uml_setup_stubs(struct mm_struct *mm)
105105 {
106− struct page **pages;
107106 int err, ret;
108107
109108 if (!skas_needs_stub)
arch/x86/Makefile.um+3−0
@@ -14,6 +14,9 @@ LINK-y += $(call cc-option,-m32) · 13 unmodified lines
1414
1515 export LDFLAGS
1616
17+LDS_EXTRA := -Ui386
18+export LDS_EXTRA
19+
1720 # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y.
1821 include $(srctree)/arch/x86/Makefile_32.cpu
1922
arch/x86/boot/compressed/head_32.S+11−3
@@ -33,6 +33,9 @@ · 32 unmodified lines
3333 __HEAD
3434 ENTRY(startup_32)
3535 #ifdef CONFIG_EFI_STUB
36+ jmp preferred_addr
37+
38+ .balign 0x10
3639 /*
3740 * We don't need the return address, so set up the stack so
3841 * efi_main() can find its arugments.
@@ -41,12 +44,17 @@ ENTRY(startup_32) · 2 unmodified lines
4144
4245 call efi_main
4346 cmpl $0, %eax
44− je preferred_addr
4547 movl %eax, %esi
46− call 1f
48+ jne 2f
4749 1:
50+ /* EFI init failed, so hang. */
51+ hlt
52+ jmp 1b
53+2:
54+ call 3f
55+3:
4856 popl %eax
49− subl $1b, %eax
57+ subl $3b, %eax
5058 subl BP_pref_address(%esi), %eax
5159 add BP_code32_start(%esi), %eax
5260 leal preferred_addr(%eax), %eax
arch/x86/boot/compressed/head_64.S+16−6
@@ -200,18 +200,28 @@ ENTRY(startup_64) · 199 unmodified lines
200200 * entire text+data+bss and hopefully all of memory.
201201 */
202202 #ifdef CONFIG_EFI_STUB
203− pushq %rsi
203+ /*
204+ * The entry point for the PE/COFF executable is 0x210, so only
205+ * legacy boot loaders will execute this jmp.
206+ */
207+ jmp preferred_addr
208+
209+ .org 0x210
204210 mov %rcx, %rdi
205211 mov %rdx, %rsi
206212 call efi_main
207− popq %rsi
208− cmpq $0,%rax
209− je preferred_addr
210213 movq %rax,%rsi
211− call 1f
214+ cmpq $0,%rax
215+ jne 2f
212216 1:
217+ /* EFI init failed, so hang. */
218+ hlt
219+ jmp 1b
220+2:
221+ call 3f
222+3:
213223 popq %rax
214− subq $1b, %rax
224+ subq $3b, %rax
215225 subq BP_pref_address(%rsi), %rax
216226 add BP_code32_start(%esi), %eax
217227 leaq preferred_addr(%rax), %rax
arch/x86/boot/tools/build.c+11−4
@@ -205,8 +205,13 @@ int main(int argc, char ** argv) · 204 unmodified lines
205205 put_unaligned_le32(file_sz, &buf[pe_header + 0x50]);
206206
207207 #ifdef CONFIG_X86_32
208− /* Address of entry point */
209− put_unaligned_le32(i, &buf[pe_header + 0x28]);
208+ /*
209+ * Address of entry point.
210+ *
211+ * The EFI stub entry point is +16 bytes from the start of
212+ * the .text section.
213+ */
214+ put_unaligned_le32(i + 16, &buf[pe_header + 0x28]);
210215
211216 /* .text size */
212217 put_unaligned_le32(file_sz, &buf[pe_header + 0xb0]);
@@ -217,9 +222,11 @@ int main(int argc, char ** argv) · 4 unmodified lines
217222 /*
218223 * Address of entry point. startup_32 is at the beginning and
219224 * the 64-bit entry point (startup_64) is always 512 bytes
220− * after.
225+ * after. The EFI stub entry point is 16 bytes after that, as
226+ * the first instruction allows legacy loaders to jump over
227+ * the EFI stub initialisation
221228 */
222− put_unaligned_le32(i + 512, &buf[pe_header + 0x28]);
229+ put_unaligned_le32(i + 528, &buf[pe_header + 0x28]);
223230
224231 /* .text size */
225232 put_unaligned_le32(file_sz, &buf[pe_header + 0xc0]);
arch/x86/ia32/ia32_aout.c+8−24
@@ -119,9 +119,7 @@ static void set_brk(unsigned long start, unsigned long end) · 118 unmodified lines
119119 end = PAGE_ALIGN(end);
120120 if (end <= start)
121121 return;
122− down_write(&current->mm->mmap_sem);
123− do_brk(start, end - start);
124− up_write(&current->mm->mmap_sem);
122+ vm_brk(start, end - start);
125123 }
126124
127125 #ifdef CORE_DUMP
@@ -332,9 +330,7 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs) · 204 unmodified lines
332330 pos = 32;
333331 map_size = ex.a_text+ex.a_data;
334332
335− down_write(&current->mm->mmap_sem);
336− error = do_brk(text_addr & PAGE_MASK, map_size);
337− up_write(&current->mm->mmap_sem);
333+ error = vm_brk(text_addr & PAGE_MASK, map_size);
338334
339335 if (error != (text_addr & PAGE_MASK)) {
340336 send_sig(SIGKILL, current, 0);
@@ -373,9 +369,7 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs) · 32 unmodified lines
373369 if (!bprm->file->f_op->mmap || (fd_offset & ~PAGE_MASK) != 0) {
374370 loff_t pos = fd_offset;
375371
376− down_write(&current->mm->mmap_sem);
377− do_brk(N_TXTADDR(ex), ex.a_text+ex.a_data);
378− up_write(&current->mm->mmap_sem);
372+ vm_brk(N_TXTADDR(ex), ex.a_text+ex.a_data);
379373 bprm->file->f_op->read(bprm->file,
380374 (char __user *)N_TXTADDR(ex),
381375 ex.a_text+ex.a_data, &pos);
@@ -385,26 +379,22 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs) · 3 unmodified lines
385379 goto beyond_if;
386380 }
387381
388− down_write(&current->mm->mmap_sem);
389− error = do_mmap(bprm->file, N_TXTADDR(ex), ex.a_text,
382+ error = vm_mmap(bprm->file, N_TXTADDR(ex), ex.a_text,
390383 PROT_READ | PROT_EXEC,
391384 MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE |
392385 MAP_EXECUTABLE | MAP_32BIT,
393386 fd_offset);
394− up_write(&current->mm->mmap_sem);
395387
396388 if (error != N_TXTADDR(ex)) {
397389 send_sig(SIGKILL, current, 0);
398390 return error;
399391 }
400392
401− down_write(&current->mm->mmap_sem);
402− error = do_mmap(bprm->file, N_DATADDR(ex), ex.a_data,
393+ error = vm_mmap(bprm->file, N_DATADDR(ex), ex.a_data,
403394 PROT_READ | PROT_WRITE | PROT_EXEC,
404395 MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE |
405396 MAP_EXECUTABLE | MAP_32BIT,
406397 fd_offset + ex.a_text);
407− up_write(&current->mm->mmap_sem);
408398 if (error != N_DATADDR(ex)) {
409399 send_sig(SIGKILL, current, 0);
410400 return error;
@@ -476,9 +466,7 @@ static int load_aout_library(struct file *file) · 65 unmodified lines
476466 error_time = jiffies;
477467 }
478468 #endif
479− down_write(&current->mm->mmap_sem);
480− do_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss);
481− up_write(&current->mm->mmap_sem);
469+ vm_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss);
482470
483471 file->f_op->read(file, (char __user *)start_addr,
484472 ex.a_text + ex.a_data, &pos);
@@ -490,12 +478,10 @@ static int load_aout_library(struct file *file) · 5 unmodified lines
490478 goto out;
491479 }
492480 /* Now use mmap to map the library into memory. */
493− down_write(&current->mm->mmap_sem);
494− error = do_mmap(file, start_addr, ex.a_text + ex.a_data,
481+ error = vm_mmap(file, start_addr, ex.a_text + ex.a_data,
495482 PROT_READ | PROT_WRITE | PROT_EXEC,
496483 MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_32BIT,
497484 N_TXTOFF(ex));
498− up_write(&current->mm->mmap_sem);
499485 retval = error;
500486 if (error != start_addr)
501487 goto out;
@@ -503,9 +489,7 @@ static int load_aout_library(struct file *file) · 1 unmodified line
503489 len = PAGE_ALIGN(ex.a_text + ex.a_data);
504490 bss = ex.a_text + ex.a_data + ex.a_bss;
505491 if (bss > len) {
506− down_write(&current->mm->mmap_sem);
507− error = do_brk(start_addr + len, bss - len);
508− up_write(&current->mm->mmap_sem);
492+ error = vm_brk(start_addr + len, bss - len);
509493 retval = error;
510494 if (error != start_addr + len)
511495 goto out;
arch/x86/include/asm/cmpxchg.h+2−2
@@ -43,7 +43,7 @@ extern void __add_wrong_size(void) · 42 unmodified lines
4343 switch (sizeof(*(ptr))) { \
4444 case __X86_CASE_B: \
4545 asm volatile (lock #op "b %b0, %1\n" \
46− : "+r" (__ret), "+m" (*(ptr)) \
46+ : "+q" (__ret), "+m" (*(ptr)) \
4747 : : "memory", "cc"); \
4848 break; \
4949 case __X86_CASE_W: \
@@ -173,7 +173,7 @@ extern void __add_wrong_size(void) · 123 unmodified lines
173173 switch (sizeof(*(ptr))) { \
174174 case __X86_CASE_B: \
175175 asm volatile (lock "addb %b1, %0\n" \
176− : "+m" (*(ptr)) : "ri" (inc) \
176+ : "+m" (*(ptr)) : "qi" (inc) \
177177 : "memory", "cc"); \
178178 break; \
179179 case __X86_CASE_W: \
arch/x86/include/asm/posix_types.h+3−3
@@ -7,9 +7,9 @@ · 6 unmodified lines
77 #else
88 # ifdef __i386__
99 # include "posix_types_32.h"
10−# elif defined(__LP64__)
11−# include "posix_types_64.h"
12−# else
10+# elif defined(__ILP32__)
1311 # include "posix_types_x32.h"
12+# else
13+# include "posix_types_64.h"
1414 # endif
1515 #endif
arch/x86/include/asm/sigcontext.h+1−1
@@ -257,7 +257,7 @@ struct sigcontext { · 256 unmodified lines
257257 __u64 oldmask;
258258 __u64 cr2;
259259 struct _fpstate __user *fpstate; /* zero when no FPU context */
260−#ifndef __LP64__
260+#ifdef __ILP32__
261261 __u32 __fpstate_pad;
262262 #endif
263263 __u64 reserved1[8];
arch/x86/include/asm/siginfo.h+7−1
@@ -2,7 +2,13 @@ · 1 unmodified line
22 #define _ASM_X86_SIGINFO_H
33
44 #ifdef __x86_64__
5−# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
5+# ifdef __ILP32__ /* x32 */
6+typedef long long __kernel_si_clock_t __attribute__((aligned(4)));
7+# define __ARCH_SI_CLOCK_T __kernel_si_clock_t
8+# define __ARCH_SI_ATTRIBUTES __attribute__((aligned(8)))
9+# else /* x86-64 */
10+# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
11+# endif
612 #endif
713
814 #include <asm-generic/siginfo.h>
arch/x86/include/asm/uaccess.h+2−0
@@ -557,6 +557,8 @@ struct __large_struct { unsigned long buf[100]; }; · 556 unmodified lines
557557
558558 extern unsigned long
559559 copy_from_user_nmi(void *to, const void __user *from, unsigned long n);
560+extern __must_check long
561+strncpy_from_user(char *dst, const char __user *src, long count);
560562
561563 /*
562564 * movsl can be slow when source and dest are not both 8-byte aligned
arch/x86/include/asm/uaccess_32.h+0−5
@@ -213,11 +213,6 @@ static inline unsigned long __must_check copy_from_user(void *to, · 212 unmodified lines
213213 return n;
214214 }
215215
216−long __must_check strncpy_from_user(char *dst, const char __user *src,
217− long count);
218−long __must_check __strncpy_from_user(char *dst,
219− const char __user *src, long count);
220−
221216 /**
222217 * strlen_user: - Get the size of a string in user space.
223218 * @str: The string to measure.
arch/x86/include/asm/uaccess_64.h+0−4
@@ -208,10 +208,6 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) · 207 unmodified lines
208208 }
209209 }
210210
211−__must_check long
212−strncpy_from_user(char *dst, const char __user *src, long count);
213−__must_check long
214−__strncpy_from_user(char *dst, const char __user *src, long count);
215211 __must_check long strnlen_user(const char __user *str, long n);
216212 __must_check long __strnlen_user(const char __user *str, long n);
217213 __must_check long strlen_user(const char __user *str);
arch/x86/include/asm/unistd.h+3−3
@@ -63,10 +63,10 @@ · 62 unmodified lines
6363 #else
6464 # ifdef __i386__
6565 # include <asm/unistd_32.h>
66−# elif defined(__LP64__)
67−# include <asm/unistd_64.h>
68−# else
66+# elif defined(__ILP32__)
6967 # include <asm/unistd_x32.h>
68+# else
69+# include <asm/unistd_64.h>
7070 # endif
7171 #endif
7272
arch/x86/include/asm/x86_init.h+0−1
@@ -195,6 +195,5 @@ extern struct x86_msi_ops x86_msi; · 194 unmodified lines
195195
196196 extern void x86_init_noop(void);
197197 extern void x86_init_uint_noop(unsigned int unused);
198−extern void x86_default_fixup_cpu_id(struct cpuinfo_x86 *c, int node);
199198
200199 #endif
arch/x86/kernel/acpi/sleep.c+4−0
@@ -24,6 +24,10 @@ unsigned long acpi_realmode_flags; · 23 unmodified lines
2424 static char temp_stack[4096];
2525 #endif
2626
27+asmlinkage void acpi_enter_s3(void)
28+{
29+ acpi_enter_sleep_state(3, wake_sleep_flags);
30+}
2731 /**
2832 * acpi_suspend_lowlevel - save kernel state
2933 *
arch/x86/kernel/acpi/sleep.h+4−0
@@ -3,12 +3,16 @@ · 2 unmodified lines
33 */
44
55 #include <asm/trampoline.h>
6+#include <linux/linkage.h>
67
78 extern unsigned long saved_video_mode;
89 extern long saved_magic;
910
1011 extern int wakeup_pmode_return;
1112
13+extern u8 wake_sleep_flags;
14+extern asmlinkage void acpi_enter_s3(void);
15+
1216 extern unsigned long acpi_copy_wakeup_routine(unsigned long);
1317 extern void wakeup_long64(void);
1418
arch/x86/kernel/acpi/wakeup_32.S+1−3
@@ -74,9 +74,7 @@ restore_registers: · 73 unmodified lines
7474 ENTRY(do_suspend_lowlevel)
7575 call save_processor_state
7676 call save_registers
77− pushl $3
78− call acpi_enter_sleep_state
79− addl $4, %esp
77+ call acpi_enter_s3
8078
8179 # In case of S3 failure, we'll emerge here. Jump
8280 # to ret_point to recover
arch/x86/kernel/acpi/wakeup_64.S+1−3
@@ -71,9 +71,7 @@ ENTRY(do_suspend_lowlevel) · 70 unmodified lines
7171 movq %rsi, saved_rsi
7272
7373 addq $8, %rsp
74− movl $3, %edi
75− xorl %eax, %eax
76− call acpi_enter_sleep_state
74+ call acpi_enter_s3
7775 /* in case something went wrong, restore the machine status and go on */
7876 jmp resume_point
7977
arch/x86/kernel/apic/apic.c+20−14
@@ -1637,9 +1637,11 @@ static int __init apic_verify(void) · 1636 unmodified lines
16371637 mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
16381638
16391639 /* The BIOS may have set up the APIC at some other address */
1640− rdmsr(MSR_IA32_APICBASE, l, h);
1641− if (l & MSR_IA32_APICBASE_ENABLE)
1642− mp_lapic_addr = l & MSR_IA32_APICBASE_BASE;
1640+ if (boot_cpu_data.x86 >= 6) {
1641+ rdmsr(MSR_IA32_APICBASE, l, h);
1642+ if (l & MSR_IA32_APICBASE_ENABLE)
1643+ mp_lapic_addr = l & MSR_IA32_APICBASE_BASE;
1644+ }
16431645
16441646 pr_info("Found and enabled local APIC!\n");
16451647 return 0;
@@ -1657,13 +1659,15 @@ int __init apic_force_enable(unsigned long addr) · 11 unmodified lines
16571659 * MSR. This can only be done in software for Intel P6 or later
16581660 * and AMD K7 (Model > 1) or later.
16591661 */
1660− rdmsr(MSR_IA32_APICBASE, l, h);
1661− if (!(l & MSR_IA32_APICBASE_ENABLE)) {
1662− pr_info("Local APIC disabled by BIOS -- reenabling.\n");
1663− l &= ~MSR_IA32_APICBASE_BASE;
1664− l |= MSR_IA32_APICBASE_ENABLE | addr;
1665− wrmsr(MSR_IA32_APICBASE, l, h);
1666− enabled_via_apicbase = 1;
1662+ if (boot_cpu_data.x86 >= 6) {
1663+ rdmsr(MSR_IA32_APICBASE, l, h);
1664+ if (!(l & MSR_IA32_APICBASE_ENABLE)) {
1665+ pr_info("Local APIC disabled by BIOS -- reenabling.\n");
1666+ l &= ~MSR_IA32_APICBASE_BASE;
1667+ l |= MSR_IA32_APICBASE_ENABLE | addr;
1668+ wrmsr(MSR_IA32_APICBASE, l, h);
1669+ enabled_via_apicbase = 1;
1670+ }
16671671 }
16681672 return apic_verify();
16691673 }
@@ -2209,10 +2213,12 @@ static void lapic_resume(void) · 539 unmodified lines
22092213 * FIXME! This will be wrong if we ever support suspend on
22102214 * SMP! We'll need to do this as part of the CPU restore!
22112215 */
2212− rdmsr(MSR_IA32_APICBASE, l, h);
2213− l &= ~MSR_IA32_APICBASE_BASE;
2214− l |= MSR_IA32_APICBASE_ENABLE | mp_lapic_addr;
2215− wrmsr(MSR_IA32_APICBASE, l, h);
2216+ if (boot_cpu_data.x86 >= 6) {
2217+ rdmsr(MSR_IA32_APICBASE, l, h);
2218+ l &= ~MSR_IA32_APICBASE_BASE;
2219+ l |= MSR_IA32_APICBASE_ENABLE | mp_lapic_addr;
2220+ wrmsr(MSR_IA32_APICBASE, l, h);
2221+ }
22162222 }
22172223
22182224 maxlvt = lapic_get_maxlvt();
arch/x86/kernel/apic/apic_numachip.c+5−2
@@ -207,8 +207,11 @@ static void __init map_csrs(void) · 206 unmodified lines
207207
208208 static void fixup_cpu_id(struct cpuinfo_x86 *c, int node)
209209 {
210− c->phys_proc_id = node;
211− per_cpu(cpu_llc_id, smp_processor_id()) = node;
210+
211+ if (c->phys_proc_id != node) {
212+ c->phys_proc_id = node;
213+ per_cpu(cpu_llc_id, smp_processor_id()) = node;
214+ }
212215 }
213216
214217 static int __init numachip_system_init(void)
arch/x86/kernel/apic/x2apic_phys.c+6−0
@@ -24,6 +24,12 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) · 23 unmodified lines
2424 {
2525 if (x2apic_phys)
2626 return x2apic_enabled();
27+ else if ((acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) &&
28+ (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) &&
29+ x2apic_enabled()) {
30+ printk(KERN_DEBUG "System requires x2apic physical mode\n");
31+ return 1;
32+ }
2733 else
2834 return 0;
2935 }
arch/x86/kernel/cpu/amd.c+6−5
@@ -26,7 +26,8 @@ · 25 unmodified lines
2626 * contact AMD for precise details and a CPU swap.
2727 *
2828 * See http://www.multimania.com/poulot/k6bug.html
29− * http://www.amd.com/K6/k6docs/revgd.html
29+ * and section 2.6.2 of "AMD-K6 Processor Revision Guide - Model 6"
30+ * (Publication # 21266 Issue Date: August 1998)
3031 *
3132 * The following test is erm.. interesting. AMD neglected to up
3233 * the chip setting when fixing the bug but they also tweaked some
@@ -94,7 +95,6 @@ static void __cpuinit init_amd_k6(struct cpuinfo_x86 *c) · 61 unmodified lines
9495 "system stability may be impaired when more than 32 MB are used.\n");
9596 else
9697 printk(KERN_CONT "probably OK (after B9730xxxx).\n");
97− printk(KERN_INFO "Please see http://membres.lycos.fr/poulot/k6bug.html\n");
9898 }
9999
100100 /* K6 with old style WHCR */
@@ -353,10 +353,11 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c) · 252 unmodified lines
353353 node = per_cpu(cpu_llc_id, cpu);
354354
355355 /*
356− * If core numbers are inconsistent, it's likely a multi-fabric platform,
357− * so invoke platform-specific handler
356+ * On multi-fabric platform (e.g. Numascale NumaChip) a
357+ * platform-specific handler needs to be called to fixup some
358+ * IDs of the CPU.
358359 */
359− if (c->phys_proc_id != node)
360+ if (x86_cpuinit.fixup_cpu_id)
360361 x86_cpuinit.fixup_cpu_id(c, node);
361362
362363 if (!node_online(node)) {
arch/x86/kernel/cpu/common.c+0−9
@@ -1162,15 +1162,6 @@ static void dbg_restore_debug_regs(void) · 1161 unmodified lines
11621162 #define dbg_restore_debug_regs()
11631163 #endif /* ! CONFIG_KGDB */
11641164
1165−/*
1166− * Prints an error where the NUMA and configured core-number mismatch and the
1167− * platform didn't override this to fix it up
1168− */
1169−void __cpuinit x86_default_fixup_cpu_id(struct cpuinfo_x86 *c, int node)
1170−{
1171− pr_err("NUMA core number %d differs from configured core number %d\n", node, c->phys_proc_id);
1172−}
1173−
11741165 /*
11751166 * cpu_init() initializes state that is per-CPU. Some data is already
11761167 * initialized (naturally) in the bootstrap process, such as the GDT
arch/x86/kernel/cpu/intel_cacheinfo.c+4−4
@@ -433,14 +433,14 @@ int amd_set_l3_disable_slot(struct amd_northbridge *nb, int cpu, unsigned slot, · 432 unmodified lines
433433 /* check if @slot is already used or the index is already disabled */
434434 ret = amd_get_l3_disable_slot(nb, slot);
435435 if (ret >= 0)
436− return -EINVAL;
436+ return -EEXIST;
437437
438438 if (index > nb->l3_cache.indices)
439439 return -EINVAL;
440440
441441 /* check whether the other slot has disabled the same index already */
442442 if (index == amd_get_l3_disable_slot(nb, !slot))
443− return -EINVAL;
443+ return -EEXIST;
444444
445445 amd_l3_disable_index(nb, cpu, slot, index);
446446
@@ -468,8 +468,8 @@ static ssize_t store_cache_disable(struct _cpuid4_info *this_leaf, · 21 unmodified lines
468468 err = amd_set_l3_disable_slot(this_leaf->base.nb, cpu, slot, val);
469469 if (err) {
470470 if (err == -EEXIST)
471− printk(KERN_WARNING "L3 disable slot %d in use!\n",
472− slot);
471+ pr_warning("L3 slot %d in use/index already disabled!\n",
472+ slot);
473473 return err;
474474 }
475475 return count;
arch/x86/kernel/i387.c+1−0
@@ -235,6 +235,7 @@ int init_fpu(struct task_struct *tsk) · 234 unmodified lines
235235 if (tsk_used_math(tsk)) {
236236 if (HAVE_HWFP && tsk == current)
237237 unlazy_fpu(tsk);
238+ tsk->thread.fpu.last_cpu = ~0;
238239 return 0;
239240 }
240241
arch/x86/kernel/microcode_amd.c+7−5
@@ -82,11 +82,6 @@ static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig) · 81 unmodified lines
8282 {
8383 struct cpuinfo_x86 *c = &cpu_data(cpu);
8484
85− if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) {
86− pr_warning("CPU%d: family %d not supported\n", cpu, c->x86);
87− return -1;
88− }
89−
9085 csig->rev = c->microcode;
9186 pr_info("CPU%d: patch_level=0x%08x\n", cpu, csig->rev);
9287
@@ -380,6 +375,13 @@ static struct microcode_ops microcode_amd_ops = { · 287 unmodified lines
380375
381376 struct microcode_ops * __init init_amd_microcode(void)
382377 {
378+ struct cpuinfo_x86 *c = &cpu_data(0);
379+
380+ if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) {
381+ pr_warning("AMD CPU family 0x%x not supported\n", c->x86);
382+ return NULL;
383+ }
384+
383385 patch = (void *)get_zeroed_page(GFP_KERNEL);
384386 if (!patch)
385387 return NULL;
arch/x86/kernel/microcode_core.c+4−6
@@ -419,10 +419,8 @@ static int mc_device_add(struct device *dev, struct subsys_interface *sif) · 418 unmodified lines
419419 if (err)
420420 return err;
421421
422− if (microcode_init_cpu(cpu) == UCODE_ERROR) {
423− sysfs_remove_group(&dev->kobj, &mc_attr_group);
422+ if (microcode_init_cpu(cpu) == UCODE_ERROR)
424423 return -EINVAL;
425− }
426424
427425 return err;
428426 }
@@ -528,11 +526,11 @@ static int __init microcode_init(void) · 99 unmodified lines
528526 microcode_ops = init_intel_microcode();
529527 else if (c->x86_vendor == X86_VENDOR_AMD)
530528 microcode_ops = init_amd_microcode();
531−
532− if (!microcode_ops) {
529+ else
533530 pr_err("no support for this CPU vendor\n");
531+
532+ if (!microcode_ops)
534533 return -ENODEV;
535− }
536534
537535 microcode_pdev = platform_device_register_simple("microcode", -1,
538536 NULL, 0);
arch/x86/kernel/vsyscall_64.c+3−3
@@ -216,9 +216,9 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address) · 215 unmodified lines
216216 current_thread_info()->sig_on_uaccess_error = 1;
217217
218218 /*
219− * 0 is a valid user pointer (in the access_ok sense) on 32-bit and
219+ * NULL is a valid user pointer (in the access_ok sense) on 32-bit and
220220 * 64-bit, so we don't need to special-case it here. For all the
221− * vsyscalls, 0 means "don't write anything" not "write it at
221+ * vsyscalls, NULL means "don't write anything" not "write it at
222222 * address 0".
223223 */
224224 ret = -EFAULT;
@@ -247,7 +247,7 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address) · 22 unmodified lines
247247
248248 ret = sys_getcpu((unsigned __user *)regs->di,
249249 (unsigned __user *)regs->si,
250− 0);
250+ NULL);
251251 break;
252252 }
253253
arch/x86/kernel/x86_init.c+0−1
@@ -93,7 +93,6 @@ struct x86_init_ops x86_init __initdata = { · 92 unmodified lines
9393 struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = {
9494 .early_percpu_clock_init = x86_init_noop,
9595 .setup_percpu_clockev = setup_secondary_APIC_clock,
96− .fixup_cpu_id = x86_default_fixup_cpu_id,
9796 };
9897
9998 static void default_nmi_init(void) { };
arch/x86/kvm/pmu.c+9−9
@@ -459,17 +459,17 @@ void kvm_pmu_cpuid_update(struct kvm_vcpu *vcpu) · 458 unmodified lines
459459 pmu->available_event_types = ~entry->ebx & ((1ull << bitmap_len) - 1);
460460
461461 if (pmu->version == 1) {
462− pmu->global_ctrl = (1 << pmu->nr_arch_gp_counters) - 1;
463− return;
462+ pmu->nr_arch_fixed_counters = 0;
463+ } else {
464+ pmu->nr_arch_fixed_counters = min((int)(entry->edx & 0x1f),
465+ X86_PMC_MAX_FIXED);
466+ pmu->counter_bitmask[KVM_PMC_FIXED] =
467+ ((u64)1 << ((entry->edx >> 5) & 0xff)) - 1;
464468 }
465469
466− pmu->nr_arch_fixed_counters = min((int)(entry->edx & 0x1f),
467− X86_PMC_MAX_FIXED);
468− pmu->counter_bitmask[KVM_PMC_FIXED] =
469− ((u64)1 << ((entry->edx >> 5) & 0xff)) - 1;
470− pmu->global_ctrl_mask = ~(((1 << pmu->nr_arch_gp_counters) - 1)
471− | (((1ull << pmu->nr_arch_fixed_counters) - 1)
472− << X86_PMC_IDX_FIXED));
470+ pmu->global_ctrl = ((1 << pmu->nr_arch_gp_counters) - 1) |
471+ (((1ull << pmu->nr_arch_fixed_counters) - 1) << X86_PMC_IDX_FIXED);
472+ pmu->global_ctrl_mask = ~pmu->global_ctrl;
473473 }
474474
475475 void kvm_pmu_init(struct kvm_vcpu *vcpu)
arch/x86/kvm/vmx.c+4−1
@@ -2210,9 +2210,12 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data) · 2209 unmodified lines
22102210 msr = find_msr_entry(vmx, msr_index);
22112211 if (msr) {
22122212 msr->data = data;
2213− if (msr - vmx->guest_msrs < vmx->save_nmsrs)
2213+ if (msr - vmx->guest_msrs < vmx->save_nmsrs) {
2214+ preempt_disable();
22142215 kvm_set_shared_msr(msr->index, msr->data,
22152216 msr->mask);
2217+ preempt_enable();
2218+ }
22162219 break;
22172220 }
22182221 ret = kvm_set_msr_common(vcpu, msr_index, data);
arch/x86/kvm/x86.c+2−6
@@ -6336,13 +6336,11 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, · 6335 unmodified lines
63366336 if (npages && !old.rmap) {
63376337 unsigned long userspace_addr;
63386338
6339− down_write(&current->mm->mmap_sem);
6340− userspace_addr = do_mmap(NULL, 0,
6339+ userspace_addr = vm_mmap(NULL, 0,
63416340 npages * PAGE_SIZE,
63426341 PROT_READ | PROT_WRITE,
63436342 map_flags,
63446343 0);
6345− up_write(&current->mm->mmap_sem);
63466344
63476345 if (IS_ERR((void *)userspace_addr))
63486346 return PTR_ERR((void *)userspace_addr);
@@ -6366,10 +6364,8 @@ void kvm_arch_commit_memory_region(struct kvm *kvm, · 17 unmodified lines
63666364 if (!user_alloc && !old.user_alloc && old.rmap && !npages) {
63676365 int ret;
63686366
6369− down_write(&current->mm->mmap_sem);
6370− ret = do_munmap(current->mm, old.userspace_addr,
6367+ ret = vm_munmap(old.userspace_addr,
63716368 old.npages * PAGE_SIZE);
6372− up_write(&current->mm->mmap_sem);
63736369 if (ret < 0)
63746370 printk(KERN_WARNING
63756371 "kvm_vm_ioctl_set_memory_region: "
arch/x86/lib/insn.c+36−17
@@ -379,8 +379,8 @@ err_out: · 378 unmodified lines
379379 return;
380380 }
381381
382−/* Decode moffset16/32/64 */
383−static void __get_moffset(struct insn *insn)
382+/* Decode moffset16/32/64. Return 0 if failed */
383+static int __get_moffset(struct insn *insn)
384384 {
385385 switch (insn->addr_bytes) {
386386 case 2:
@@ -397,15 +397,19 @@ static void __get_moffset(struct insn *insn) · 10 unmodified lines
397397 insn->moffset2.value = get_next(int, insn);
398398 insn->moffset2.nbytes = 4;
399399 break;
400+ default: /* opnd_bytes must be modified manually */
401+ goto err_out;
400402 }
401403 insn->moffset1.got = insn->moffset2.got = 1;
402404
405+ return 1;
406+
403407 err_out:
404− return;
408+ return 0;
405409 }
406410
407−/* Decode imm v32(Iz) */
408−static void __get_immv32(struct insn *insn)
411+/* Decode imm v32(Iz). Return 0 if failed */
412+static int __get_immv32(struct insn *insn)
409413 {
410414 switch (insn->opnd_bytes) {
411415 case 2:
@@ -417,14 +421,18 @@ static void __get_immv32(struct insn *insn) · 5 unmodified lines
417421 insn->immediate.value = get_next(int, insn);
418422 insn->immediate.nbytes = 4;
419423 break;
424+ default: /* opnd_bytes must be modified manually */
425+ goto err_out;
420426 }
421427
428+ return 1;
429+
422430 err_out:
423− return;
431+ return 0;
424432 }
425433
426−/* Decode imm v64(Iv/Ov) */
427−static void __get_immv(struct insn *insn)
434+/* Decode imm v64(Iv/Ov), Return 0 if failed */
435+static int __get_immv(struct insn *insn)
428436 {
429437 switch (insn->opnd_bytes) {
430438 case 2:
@@ -441,15 +449,18 @@ static void __get_immv(struct insn *insn) · 10 unmodified lines
441449 insn->immediate2.value = get_next(int, insn);
442450 insn->immediate2.nbytes = 4;
443451 break;
452+ default: /* opnd_bytes must be modified manually */
453+ goto err_out;
444454 }
445455 insn->immediate1.got = insn->immediate2.got = 1;
446456
457+ return 1;
447458 err_out:
448− return;
459+ return 0;
449460 }
450461
451462 /* Decode ptr16:16/32(Ap) */
452−static void __get_immptr(struct insn *insn)
463+static int __get_immptr(struct insn *insn)
453464 {
454465 switch (insn->opnd_bytes) {
455466 case 2:
@@ -462,14 +473,17 @@ static void __get_immptr(struct insn *insn) · 6 unmodified lines
462473 break;
463474 case 8:
464475 /* ptr16:64 is not exist (no segment) */
465− return;
476+ return 0;
477+ default: /* opnd_bytes must be modified manually */
478+ goto err_out;
466479 }
467480 insn->immediate2.value = get_next(unsigned short, insn);
468481 insn->immediate2.nbytes = 2;
469482 insn->immediate1.got = insn->immediate2.got = 1;
470483
484+ return 1;
471485 err_out:
472− return;
486+ return 0;
473487 }
474488
475489 /**
@@ -489,7 +503,8 @@ void insn_get_immediate(struct insn *insn) · 13 unmodified lines
489503 insn_get_displacement(insn);
490504
491505 if (inat_has_moffset(insn->attr)) {
492− __get_moffset(insn);
506+ if (!__get_moffset(insn))
507+ goto err_out;
493508 goto done;
494509 }
495510
@@ -517,16 +532,20 @@ void insn_get_immediate(struct insn *insn) · 21 unmodified lines
517532 insn->immediate2.nbytes = 4;
518533 break;
519534 case INAT_IMM_PTR:
520− __get_immptr(insn);
535+ if (!__get_immptr(insn))
536+ goto err_out;
521537 break;
522538 case INAT_IMM_VWORD32:
523− __get_immv32(insn);
539+ if (!__get_immv32(insn))
540+ goto err_out;
524541 break;
525542 case INAT_IMM_VWORD:
526− __get_immv(insn);
543+ if (!__get_immv(insn))
544+ goto err_out;
527545 break;
528546 default:
529− break;
547+ /* Here, insn must have an immediate, but failed */
548+ goto err_out;
530549 }
531550 if (inat_has_second_immediate(insn->attr)) {
532551 insn->immediate2.value = get_next(char, insn);
arch/x86/lib/usercopy.c+103−0
@@ -7,6 +7,8 @@ · 6 unmodified lines
77 #include <linux/highmem.h>
88 #include <linux/module.h>
99
10+#include <asm/word-at-a-time.h>
11+
1012 /*
1113 * best effort, GUP based copy_from_user() that is NMI-safe
1214 */
@@ -41,3 +43,104 @@ copy_from_user_nmi(void *to, const void __user *from, unsigned long n) · 28 unmodified lines
4143 return len;
4244 }
4345 EXPORT_SYMBOL_GPL(copy_from_user_nmi);
46+
47+static inline unsigned long count_bytes(unsigned long mask)
48+{
49+ mask = (mask - 1) & ~mask;
50+ mask >>= 7;
51+ return count_masked_bytes(mask);
52+}
53+
54+/*
55+ * Do a strncpy, return length of string without final '\0'.
56+ * 'count' is the user-supplied count (return 'count' if we
57+ * hit it), 'max' is the address space maximum (and we return
58+ * -EFAULT if we hit it).
59+ */
60+static inline long do_strncpy_from_user(char *dst, const char __user *src, long count, unsigned long max)
61+{
62+ long res = 0;
63+
64+ /*
65+ * Truncate 'max' to the user-specified limit, so that
66+ * we only have one limit we need to check in the loop
67+ */
68+ if (max > count)
69+ max = count;
70+
71+ while (max >= sizeof(unsigned long)) {
72+ unsigned long c;
73+
74+ /* Fall back to byte-at-a-time if we get a page fault */
75+ if (unlikely(__get_user(c,(unsigned long __user *)(src+res))))
76+ break;
77+ /* This can write a few bytes past the NUL character, but that's ok */
78+ *(unsigned long *)(dst+res) = c;
79+ c = has_zero(c);
80+ if (c)
81+ return res + count_bytes(c);
82+ res += sizeof(unsigned long);
83+ max -= sizeof(unsigned long);
84+ }
85+
86+ while (max) {
87+ char c;
88+
89+ if (unlikely(__get_user(c,src+res)))
90+ return -EFAULT;
91+ dst[res] = c;
92+ if (!c)
93+ return res;
94+ res++;
95+ max--;
96+ }
97+
98+ /*
99+ * Uhhuh. We hit 'max'. But was that the user-specified maximum
100+ * too? If so, that's ok - we got as much as the user asked for.
101+ */
102+ if (res >= count)
103+ return res;
104+
105+ /*
106+ * Nope: we hit the address space limit, and we still had more
107+ * characters the caller would have wanted. That's an EFAULT.
108+ */
109+ return -EFAULT;
110+}
111+
112+/**
113+ * strncpy_from_user: - Copy a NUL terminated string from userspace.
114+ * @dst: Destination address, in kernel space. This buffer must be at
115+ * least @count bytes long.
116+ * @src: Source address, in user space.
117+ * @count: Maximum number of bytes to copy, including the trailing NUL.
118+ *
119+ * Copies a NUL-terminated string from userspace to kernel space.
120+ *
121+ * On success, returns the length of the string (not including the trailing
122+ * NUL).
123+ *
124+ * If access to userspace fails, returns -EFAULT (some data may have been
125+ * copied).
126+ *
127+ * If @count is smaller than the length of the string, copies @count bytes
128+ * and returns @count.
129+ */
130+long
131+strncpy_from_user(char *dst, const char __user *src, long count)
132+{
133+ unsigned long max_addr, src_addr;
134+
135+ if (unlikely(count <= 0))
136+ return 0;
137+
138+ max_addr = current_thread_info()->addr_limit.seg;
139+ src_addr = (unsigned long)src;
140+ if (likely(src_addr < max_addr)) {
141+ unsigned long max = max_addr - src_addr;
142+ return do_strncpy_from_user(dst, src, count, max);
143+ }
144+ return -EFAULT;
145+}
146+EXPORT_SYMBOL(strncpy_from_user);
arch/x86/lib/usercopy_32.c+0−87
@@ -32,93 +32,6 @@ static inline int __movsl_is_ok(unsigned long a1, unsigned long a2, unsigned lon · 31 unmodified lines
3232 #define movsl_is_ok(a1, a2, n) \
3333 __movsl_is_ok((unsigned long)(a1), (unsigned long)(a2), (n))
3434
35−/*
36− * Copy a null terminated string from userspace.
37− */
38−
39−#define __do_strncpy_from_user(dst, src, count, res) \
40−do { \
41− int __d0, __d1, __d2; \
42− might_fault(); \
43− __asm__ __volatile__( \
44− " testl %1,%1\n" \
45− " jz 2f\n" \
46− "0: lodsb\n" \
47− " stosb\n" \
48− " testb %%al,%%al\n" \
49− " jz 1f\n" \
50− " decl %1\n" \
51− " jnz 0b\n" \
52− "1: subl %1,%0\n" \
53− "2:\n" \
54− ".section .fixup,\"ax\"\n" \
55− "3: movl %5,%0\n" \
56− " jmp 2b\n" \
57− ".previous\n" \
58− _ASM_EXTABLE(0b,3b) \
59− : "=&d"(res), "=&c"(count), "=&a" (__d0), "=&S" (__d1), \
60− "=&D" (__d2) \
61− : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \
62− : "memory"); \
63−} while (0)
64−
65−/**
66− * __strncpy_from_user: - Copy a NUL terminated string from userspace, with less checking.
67− * @dst: Destination address, in kernel space. This buffer must be at
68− * least @count bytes long.
69− * @src: Source address, in user space.
70− * @count: Maximum number of bytes to copy, including the trailing NUL.
71− *
72− * Copies a NUL-terminated string from userspace to kernel space.
73− * Caller must check the specified block with access_ok() before calling
74− * this function.
75− *
76− * On success, returns the length of the string (not including the trailing
77− * NUL).
78− *
79− * If access to userspace fails, returns -EFAULT (some data may have been
80− * copied).
81− *
82− * If @count is smaller than the length of the string, copies @count bytes
83− * and returns @count.
84− */
85−long
86−__strncpy_from_user(char *dst, const char __user *src, long count)
87−{
88− long res;
89− __do_strncpy_from_user(dst, src, count, res);
90− return res;
91−}
92−EXPORT_SYMBOL(__strncpy_from_user);
93−
94−/**
95− * strncpy_from_user: - Copy a NUL terminated string from userspace.
96− * @dst: Destination address, in kernel space. This buffer must be at
97− * least @count bytes long.
98− * @src: Source address, in user space.
99− * @count: Maximum number of bytes to copy, including the trailing NUL.
100− *
101− * Copies a NUL-terminated string from userspace to kernel space.
102− *
103− * On success, returns the length of the string (not including the trailing
104− * NUL).
105− *
106− * If access to userspace fails, returns -EFAULT (some data may have been
107− * copied).
108− *
109− * If @count is smaller than the length of the string, copies @count bytes
110− * and returns @count.
111− */
112−long
113−strncpy_from_user(char *dst, const char __user *src, long count)
114−{
115− long res = -EFAULT;
116− if (access_ok(VERIFY_READ, src, 1))
117− __do_strncpy_from_user(dst, src, count, res);
118− return res;
119−}
120−EXPORT_SYMBOL(strncpy_from_user);
121−
12235 /*
12336 * Zero Userspace
12437 */
arch/x86/lib/usercopy_64.c+0−49
@@ -8,55 +8,6 @@ · 7 unmodified lines
88 #include <linux/module.h>
99 #include <asm/uaccess.h>
1010
11−/*
12− * Copy a null terminated string from userspace.
13− */
14−
15−#define __do_strncpy_from_user(dst,src,count,res) \
16−do { \
17− long __d0, __d1, __d2; \
18− might_fault(); \
19− __asm__ __volatile__( \
20− " testq %1,%1\n" \
21− " jz 2f\n" \
22− "0: lodsb\n" \
23− " stosb\n" \
24− " testb %%al,%%al\n" \
25− " jz 1f\n" \
26− " decq %1\n" \
27− " jnz 0b\n" \
28− "1: subq %1,%0\n" \
29− "2:\n" \
30− ".section .fixup,\"ax\"\n" \
31− "3: movq %5,%0\n" \
32− " jmp 2b\n" \
33− ".previous\n" \
34− _ASM_EXTABLE(0b,3b) \
35− : "=&r"(res), "=&c"(count), "=&a" (__d0), "=&S" (__d1), \
36− "=&D" (__d2) \
37− : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \
38− : "memory"); \
39−} while (0)
40−
41−long
42−__strncpy_from_user(char *dst, const char __user *src, long count)
43−{
44− long res;
45− __do_strncpy_from_user(dst, src, count, res);
46− return res;
47−}
48−EXPORT_SYMBOL(__strncpy_from_user);
49−
50−long
51−strncpy_from_user(char *dst, const char __user *src, long count)
52−{
53− long res = -EFAULT;
54− if (access_ok(VERIFY_READ, src, 1))
55− return __strncpy_from_user(dst, src, count);
56− return res;
57−}
58−EXPORT_SYMBOL(strncpy_from_user);
59−
6011 /*
6112 * Zero Userspace
6213 */
arch/x86/platform/mrst/mrst.c+2−2
@@ -805,7 +805,7 @@ void intel_scu_devices_create(void) · 804 unmodified lines
805805 } else
806806 i2c_register_board_info(i2c_bus[i], i2c_devs[i], 1);
807807 }
808− intel_scu_notifier_post(SCU_AVAILABLE, 0L);
808+ intel_scu_notifier_post(SCU_AVAILABLE, NULL);
809809 }
810810 EXPORT_SYMBOL_GPL(intel_scu_devices_create);
811811
@@ -814,7 +814,7 @@ void intel_scu_devices_destroy(void) · 2 unmodified lines
814814 {
815815 int i;
816816
817− intel_scu_notifier_post(SCU_DOWN, 0L);
817+ intel_scu_notifier_post(SCU_DOWN, NULL);
818818
819819 for (i = 0; i < ipc_next_dev; i++)
820820 platform_device_del(ipc_devs[i]);
arch/x86/um/asm/barrier.h+75−0
@@ -0,0 +1,75 @@
1+#ifndef _ASM_UM_BARRIER_H_
2+#define _ASM_UM_BARRIER_H_
3+
4+#include <asm/asm.h>
5+#include <asm/segment.h>
6+#include <asm/cpufeature.h>
7+#include <asm/cmpxchg.h>
8+#include <asm/nops.h>
9+
10+#include <linux/kernel.h>
11+#include <linux/irqflags.h>
12+
13+/*
14+ * Force strict CPU ordering.
15+ * And yes, this is required on UP too when we're talking
16+ * to devices.
17+ */
18+#ifdef CONFIG_X86_32
19+
20+#define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2)
21+#define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2)
22+#define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM)
23+
24+#else /* CONFIG_X86_32 */
25+
26+#define mb() asm volatile("mfence" : : : "memory")
27+#define rmb() asm volatile("lfence" : : : "memory")
28+#define wmb() asm volatile("sfence" : : : "memory")
29+
30+#endif /* CONFIG_X86_32 */
31+
32+#define read_barrier_depends() do { } while (0)
33+
34+#ifdef CONFIG_SMP
35+
36+#define smp_mb() mb()
37+#ifdef CONFIG_X86_PPRO_FENCE
38+#define smp_rmb() rmb()
39+#else /* CONFIG_X86_PPRO_FENCE */
40+#define smp_rmb() barrier()
41+#endif /* CONFIG_X86_PPRO_FENCE */
42+
43+#ifdef CONFIG_X86_OOSTORE
44+#define smp_wmb() wmb()
45+#else /* CONFIG_X86_OOSTORE */
46+#define smp_wmb() barrier()
47+#endif /* CONFIG_X86_OOSTORE */
48+
49+#define smp_read_barrier_depends() read_barrier_depends()
50+#define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
51+
52+#else /* CONFIG_SMP */
53+
54+#define smp_mb() barrier()
55+#define smp_rmb() barrier()
56+#define smp_wmb() barrier()
57+#define smp_read_barrier_depends() do { } while (0)
58+#define set_mb(var, value) do { var = value; barrier(); } while (0)
59+
60+#endif /* CONFIG_SMP */
61+
62+/*
63+ * Stop RDTSC speculation. This is needed when you need to use RDTSC
64+ * (or get_cycles or vread that possibly accesses the TSC) in a defined
65+ * code region.
66+ *
67+ * (Could use an alternative three way for this if there was one.)
68+ */
69+static inline void rdtsc_barrier(void)
70+{
71+ alternative(ASM_NOP3, "mfence", X86_FEATURE_MFENCE_RDTSC);
72+ alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC);
73+}
74+
75+#endif
arch/x86/um/asm/system.h+0−135
@@ -1,135 +0,0 @@
1−#ifndef _ASM_X86_SYSTEM_H_
2−#define _ASM_X86_SYSTEM_H_
3−
4−#include <asm/asm.h>
5−#include <asm/segment.h>
6−#include <asm/cpufeature.h>
7−#include <asm/cmpxchg.h>
8−#include <asm/nops.h>
9−
10−#include <linux/kernel.h>
11−#include <linux/irqflags.h>
12−
13−/* entries in ARCH_DLINFO: */
14−#ifdef CONFIG_IA32_EMULATION
15−# define AT_VECTOR_SIZE_ARCH 2
16−#else
17−# define AT_VECTOR_SIZE_ARCH 1
18−#endif
19−
20−extern unsigned long arch_align_stack(unsigned long sp);
21−
22−void default_idle(void);
23−
24−/*
25− * Force strict CPU ordering.
26− * And yes, this is required on UP too when we're talking
27− * to devices.
28− */
29−#ifdef CONFIG_X86_32
30−/*
31− * Some non-Intel clones support out of order store. wmb() ceases to be a
32− * nop for these.
33− */
34−#define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2)
35−#define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2)
36−#define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM)
37−#else
38−#define mb() asm volatile("mfence":::"memory")
39−#define rmb() asm volatile("lfence":::"memory")
40−#define wmb() asm volatile("sfence" ::: "memory")
41−#endif
42−
43−/**
44− * read_barrier_depends - Flush all pending reads that subsequents reads
45− * depend on.
46− *
47− * No data-dependent reads from memory-like regions are ever reordered
48− * over this barrier. All reads preceding this primitive are guaranteed
49− * to access memory (but not necessarily other CPUs' caches) before any
50− * reads following this primitive that depend on the data return by
51− * any of the preceding reads. This primitive is much lighter weight than
52− * rmb() on most CPUs, and is never heavier weight than is
53− * rmb().
54− *
55− * These ordering constraints are respected by both the local CPU
56− * and the compiler.
57− *
58− * Ordering is not guaranteed by anything other than these primitives,
59− * not even by data dependencies. See the documentation for
60− * memory_barrier() for examples and URLs to more information.
61− *
62− * For example, the following code would force ordering (the initial
63− * value of "a" is zero, "b" is one, and "p" is "&a"):
64− *
65− * <programlisting>
66− * CPU 0 CPU 1
67− *
68− * b = 2;
69− * memory_barrier();
70− * p = &b; q = p;
71− * read_barrier_depends();
72− * d = *q;
73− * </programlisting>
74− *
75− * because the read of "*q" depends on the read of "p" and these
76− * two reads are separated by a read_barrier_depends(). However,
77− * the following code, with the same initial values for "a" and "b":
78− *
79− * <programlisting>
80− * CPU 0 CPU 1
81− *
82− * a = 2;
83− * memory_barrier();
84− * b = 3; y = b;
85− * read_barrier_depends();
86− * x = a;
87− * </programlisting>
88− *
89− * does not enforce ordering, since there is no data dependency between
90− * the read of "a" and the read of "b". Therefore, on some CPUs, such
91− * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb()
92− * in cases like this where there are no data dependencies.
93− **/
94−
95−#define read_barrier_depends() do { } while (0)
96−
97−#ifdef CONFIG_SMP
98−#define smp_mb() mb()
99−#ifdef CONFIG_X86_PPRO_FENCE
100−# define smp_rmb() rmb()
101−#else
102−# define smp_rmb() barrier()
103−#endif
104−#ifdef CONFIG_X86_OOSTORE
105−# define smp_wmb() wmb()
106−#else
107−# define smp_wmb() barrier()
108−#endif
109−#define smp_read_barrier_depends() read_barrier_depends()
110−#define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
111−#else
112−#define smp_mb() barrier()
113−#define smp_rmb() barrier()
114−#define smp_wmb() barrier()
115−#define smp_read_barrier_depends() do { } while (0)
116−#define set_mb(var, value) do { var = value; barrier(); } while (0)
117−#endif
118−
119−/*
120− * Stop RDTSC speculation. This is needed when you need to use RDTSC
121− * (or get_cycles or vread that possibly accesses the TSC) in a defined
122− * code region.
123− *
124− * (Could use an alternative three way for this if there was one.)
125− */
126−static inline void rdtsc_barrier(void)
127−{
128− alternative(ASM_NOP3, "mfence", X86_FEATURE_MFENCE_RDTSC);
129− alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC);
130−}
131−
132−extern void *_switch_to(void *prev, void *next, void *last);
133−#define switch_to(prev, next, last) prev = _switch_to(prev, next, last)
134−
135−#endif
arch/x86/xen/enlighten.c+2−2
@@ -261,7 +261,8 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx, · 260 unmodified lines
261261
262262 static bool __init xen_check_mwait(void)
263263 {
264−#ifdef CONFIG_ACPI
264+#if defined(CONFIG_ACPI) && !defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) && \
265+ !defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE)
265266 struct xen_platform_op op = {
266267 .cmd = XENPF_set_processor_pminfo,
267268 .u.set_pminfo.id = -1,
@@ -349,7 +350,6 @@ static void __init xen_init_cpuid_mask(void) · 81 unmodified lines
349350 /* Xen will set CR4.OSXSAVE if supported and not disabled by force */
350351 if ((cx & xsave_mask) != xsave_mask)
351352 cpuid_leaf1_ecx_mask &= ~xsave_mask; /* disable XSAVE & OSXSAVE */
352−
353353 if (xen_check_mwait())
354354 cpuid_leaf1_ecx_set_mask = (1 << (X86_FEATURE_MWAIT % 32));
355355 }
arch/x86/xen/smp.c+15−0
@@ -178,6 +178,7 @@ static void __init xen_fill_possible_map(void) · 177 unmodified lines
178178 static void __init xen_filter_cpu_maps(void)
179179 {
180180 int i, rc;
181+ unsigned int subtract = 0;
181182
182183 if (!xen_initial_domain())
183184 return;
@@ -192,8 +193,22 @@ static void __init xen_filter_cpu_maps(void) · 8 unmodified lines
192193 } else {
193194 set_cpu_possible(i, false);
194195 set_cpu_present(i, false);
196+ subtract++;
195197 }
196198 }
199+#ifdef CONFIG_HOTPLUG_CPU
200+ /* This is akin to using 'nr_cpus' on the Linux command line.
201+ * Which is OK as when we use 'dom0_max_vcpus=X' we can only
202+ * have up to X, while nr_cpu_ids is greater than X. This
203+ * normally is not a problem, except when CPU hotplugging
204+ * is involved and then there might be more than X CPUs
205+ * in the guest - which will not work as there is no
206+ * hypercall to expand the max number of VCPUs an already
207+ * running guest has. So cap it up to X. */
208+ if (subtract)
209+ nr_cpu_ids = nr_cpu_ids - subtract;
210+#endif
211+
197212 }
198213
199214 static void __init xen_smp_prepare_boot_cpu(void)
arch/x86/xen/xen-asm.S+1−1
@@ -96,7 +96,7 @@ ENTRY(xen_restore_fl_direct) · 95 unmodified lines
9696
9797 /* check for unmasked and pending */
9898 cmpw $0x0001, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_pending
99− jz 1f
99+ jnz 1f
100100 2: call check_events
101101 1:
102102 ENDPATCH(xen_restore_fl_direct)
arch/xtensa/include/asm/hardirq.h+0−3
@@ -11,9 +11,6 @@ · 10 unmodified lines
1111 #ifndef _XTENSA_HARDIRQ_H
1212 #define _XTENSA_HARDIRQ_H
1313
14−void ack_bad_irq(unsigned int irq);
15−#define ack_bad_irq ack_bad_irq
16−
1714 #include <asm-generic/hardirq.h>
1815
1916 #endif /* _XTENSA_HARDIRQ_H */
arch/xtensa/include/asm/io.h+1−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #ifdef __KERNEL__
1515 #include <asm/byteorder.h>
1616 #include <asm/page.h>
17+#include <linux/bug.h>
1718 #include <linux/kernel.h>
1819
1920 #include <linux/types.h>
arch/xtensa/kernel/signal.c+1−0
@@ -496,6 +496,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) · 495 unmodified lines
496496 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
497497
498498 if (signr > 0) {
499+ int ret;
499500
500501 /* Are we from a system call? */
501502
block/blk-core.c+3−2
@@ -483,7 +483,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) · 482 unmodified lines
483483 if (!q)
484484 return NULL;
485485
486− q->id = ida_simple_get(&blk_queue_ida, 0, 0, GFP_KERNEL);
486+ q->id = ida_simple_get(&blk_queue_ida, 0, 0, gfp_mask);
487487 if (q->id < 0)
488488 goto fail_q;
489489
@@ -1277,7 +1277,8 @@ static bool attempt_plug_merge(struct request_queue *q, struct bio *bio, · 787 unmodified lines
12771277 list_for_each_entry_reverse(rq, &plug->list, queuelist) {
12781278 int el_ret;
12791279
1280− (*request_count)++;
1280+ if (rq->q == q)
1281+ (*request_count)++;
12811282
12821283 if (rq->q != q || !blk_rq_merge_ok(rq, bio))
12831284 continue;
block/blk-throttle.c+1−1
@@ -1218,7 +1218,7 @@ void blk_throtl_drain(struct request_queue *q) · 1217 unmodified lines
12181218 struct bio_list bl;
12191219 struct bio *bio;
12201220
1221− WARN_ON_ONCE(!queue_is_locked(q));
1221+ queue_lockdep_assert_held(q);
12221222
12231223 bio_list_init(&bl);
12241224
block/cfq-iosched.c+8−2
@@ -295,6 +295,7 @@ struct cfq_data { · 294 unmodified lines
295295 unsigned int cfq_slice_idle;
296296 unsigned int cfq_group_idle;
297297 unsigned int cfq_latency;
298+ unsigned int cfq_target_latency;
298299
299300 /*
300301 * Fallback dummy cfqq for extreme OOM conditions
@@ -604,7 +605,7 @@ cfq_group_slice(struct cfq_data *cfqd, struct cfq_group *cfqg) · 303 unmodified lines
604605 {
605606 struct cfq_rb_root *st = &cfqd->grp_service_tree;
606607
607− return cfq_target_latency * cfqg->weight / st->total_weight;
608+ return cfqd->cfq_target_latency * cfqg->weight / st->total_weight;
608609 }
609610
610611 static inline unsigned
@@ -2271,7 +2272,8 @@ new_workload: · 1660 unmodified lines
22712272 * to have higher weight. A more accurate thing would be to
22722273 * calculate system wide asnc/sync ratio.
22732274 */
2274− tmp = cfq_target_latency * cfqg_busy_async_queues(cfqd, cfqg);
2275+ tmp = cfqd->cfq_target_latency *
2276+ cfqg_busy_async_queues(cfqd, cfqg);
22752277 tmp = tmp/cfqd->busy_queues;
22762278 slice = min_t(unsigned, slice, tmp);
22772279
@@ -3737,6 +3739,7 @@ static void *cfq_init_queue(struct request_queue *q) · 1459 unmodified lines
37373739 cfqd->cfq_back_penalty = cfq_back_penalty;
37383740 cfqd->cfq_slice[0] = cfq_slice_async;
37393741 cfqd->cfq_slice[1] = cfq_slice_sync;
3742+ cfqd->cfq_target_latency = cfq_target_latency;
37403743 cfqd->cfq_slice_async_rq = cfq_slice_async_rq;
37413744 cfqd->cfq_slice_idle = cfq_slice_idle;
37423745 cfqd->cfq_group_idle = cfq_group_idle;
@@ -3788,6 +3791,7 @@ SHOW_FUNCTION(cfq_slice_sync_show, cfqd->cfq_slice[1], 1); · 45 unmodified lines
37883791 SHOW_FUNCTION(cfq_slice_async_show, cfqd->cfq_slice[0], 1);
37893792 SHOW_FUNCTION(cfq_slice_async_rq_show, cfqd->cfq_slice_async_rq, 0);
37903793 SHOW_FUNCTION(cfq_low_latency_show, cfqd->cfq_latency, 0);
3794+SHOW_FUNCTION(cfq_target_latency_show, cfqd->cfq_target_latency, 1);
37913795 #undef SHOW_FUNCTION
37923796
37933797 #define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, __CONV) \
@@ -3821,6 +3825,7 @@ STORE_FUNCTION(cfq_slice_async_store, &cfqd->cfq_slice[0], 1, UINT_MAX, 1); · 27 unmodified lines
38213825 STORE_FUNCTION(cfq_slice_async_rq_store, &cfqd->cfq_slice_async_rq, 1,
38223826 UINT_MAX, 0);
38233827 STORE_FUNCTION(cfq_low_latency_store, &cfqd->cfq_latency, 0, 1, 0);
3828+STORE_FUNCTION(cfq_target_latency_store, &cfqd->cfq_target_latency, 1, UINT_MAX, 1);
38243829 #undef STORE_FUNCTION
38253830
38263831 #define CFQ_ATTR(name) \
@@ -3838,6 +3843,7 @@ static struct elv_fs_entry cfq_attrs[] = { · 11 unmodified lines
38383843 CFQ_ATTR(slice_idle),
38393844 CFQ_ATTR(group_idle),
38403845 CFQ_ATTR(low_latency),
3846+ CFQ_ATTR(target_latency),
38413847 __ATTR_NULL
38423848 };
38433849
crypto/Kconfig+3−3
@@ -627,7 +627,7 @@ config CRYPTO_BLOWFISH_COMMON · 626 unmodified lines
627627
628628 config CRYPTO_BLOWFISH_X86_64
629629 tristate "Blowfish cipher algorithm (x86_64)"
630− depends on (X86 || UML_X86) && 64BIT
630+ depends on X86 && 64BIT
631631 select CRYPTO_ALGAPI
632632 select CRYPTO_BLOWFISH_COMMON
633633 help
@@ -657,7 +657,7 @@ config CRYPTO_CAMELLIA · 23 unmodified lines
657657
658658 config CRYPTO_CAMELLIA_X86_64
659659 tristate "Camellia cipher algorithm (x86_64)"
660− depends on (X86 || UML_X86) && 64BIT
660+ depends on X86 && 64BIT
661661 depends on CRYPTO
662662 select CRYPTO_ALGAPI
663663 select CRYPTO_LRW
@@ -893,7 +893,7 @@ config CRYPTO_TWOFISH_X86_64 · 229 unmodified lines
893893
894894 config CRYPTO_TWOFISH_X86_64_3WAY
895895 tristate "Twofish cipher algorithm (x86_64, 3-way parallel)"
896− depends on (X86 || UML_X86) && 64BIT
896+ depends on X86 && 64BIT
897897 select CRYPTO_ALGAPI
898898 select CRYPTO_TWOFISH_COMMON
899899 select CRYPTO_TWOFISH_X86_64
crypto/sha512_generic.c+1−1
@@ -174,7 +174,7 @@ sha512_update(struct shash_desc *desc, const u8 *data, unsigned int len) · 173 unmodified lines
174174 index = sctx->count[0] & 0x7f;
175175
176176 /* Update number of bytes */
177− if (!(sctx->count[0] += len))
177+ if ((sctx->count[0] += len) < len)
178178 sctx->count[1]++;
179179
180180 part_len = 128 - index;
drivers/acpi/acpica/hwxface.c+2−1
@@ -74,7 +74,8 @@ acpi_status acpi_reset(void) · 73 unmodified lines
7474
7575 /* Check if the reset register is supported */
7676
77− if (!reset_reg->address) {
77+ if (!(acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER) ||
78+ !reset_reg->address) {
7879 return_ACPI_STATUS(AE_NOT_EXIST);
7980 }
8081
drivers/acpi/osl.c+1−2
@@ -607,8 +607,7 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler, · 606 unmodified lines
607607
608608 acpi_irq_handler = handler;
609609 acpi_irq_context = context;
610− if (request_threaded_irq(irq, NULL, acpi_irq, IRQF_SHARED, "acpi",
611− acpi_irq)) {
610+ if (request_irq(irq, acpi_irq, IRQF_SHARED, "acpi", acpi_irq)) {
612611 printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq);
613612 acpi_irq_handler = NULL;
614613 return AE_NOT_ACQUIRED;
drivers/acpi/reboot.c+2−1
@@ -23,7 +23,8 @@ void acpi_reboot(void) · 22 unmodified lines
2323 /* Is the reset register supported? The spec says we should be
2424 * checking the bit width and bit offset, but Windows ignores
2525 * these fields */
26− /* Ignore also acpi_gbl_FADT.flags.ACPI_FADT_RESET_REGISTER */
26+ if (!(acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER))
27+ return;
2728
2829 reset_value = acpi_gbl_FADT.reset_value;
2930
drivers/acpi/sleep.c+28−24
@@ -28,23 +28,33 @@ · 27 unmodified lines
2828 #include "internal.h"
2929 #include "sleep.h"
3030
31+u8 wake_sleep_flags = ACPI_NO_OPTIONAL_METHODS;
3132 static unsigned int gts, bfs;
32−module_param(gts, uint, 0644);
33−module_param(bfs, uint, 0644);
34−MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend.");
35−MODULE_PARM_DESC(bfs, "Enable evaluation of _BFS on resume".);
36−
37−static u8 wake_sleep_flags(void)
33+static int set_param_wake_flag(const char *val, struct kernel_param *kp)
3834 {
39− u8 flags = ACPI_NO_OPTIONAL_METHODS;
35+ int ret = param_set_int(val, kp);
4036
41− if (gts)
42− flags |= ACPI_EXECUTE_GTS;
43− if (bfs)
44− flags |= ACPI_EXECUTE_BFS;
37+ if (ret)
38+ return ret;
4539
46− return flags;
40+ if (kp->arg == (const char *)&gts) {
41+ if (gts)
42+ wake_sleep_flags |= ACPI_EXECUTE_GTS;
43+ else
44+ wake_sleep_flags &= ~ACPI_EXECUTE_GTS;
45+ }
46+ if (kp->arg == (const char *)&bfs) {
47+ if (bfs)
48+ wake_sleep_flags |= ACPI_EXECUTE_BFS;
49+ else
50+ wake_sleep_flags &= ~ACPI_EXECUTE_BFS;
51+ }
52+ return ret;
4753 }
54+module_param_call(gts, set_param_wake_flag, param_get_int, &gts, 0644);
55+module_param_call(bfs, set_param_wake_flag, param_get_int, &bfs, 0644);
56+MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend.");
57+MODULE_PARM_DESC(bfs, "Enable evaluation of _BFS on resume".);
4858
4959 static u8 sleep_states[ACPI_S_STATE_COUNT];
5060
@@ -263,7 +273,6 @@ static int acpi_suspend_enter(suspend_state_t pm_state) · 212 unmodified lines
263273 {
264274 acpi_status status = AE_OK;
265275 u32 acpi_state = acpi_target_sleep_state;
266− u8 flags = wake_sleep_flags();
267276 int error;
268277
269278 ACPI_FLUSH_CPU_CACHE();
@@ -271,7 +280,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state) · 1 unmodified line
271280 switch (acpi_state) {
272281 case ACPI_STATE_S1:
273282 barrier();
274− status = acpi_enter_sleep_state(acpi_state, flags);
283+ status = acpi_enter_sleep_state(acpi_state, wake_sleep_flags);
275284 break;
276285
277286 case ACPI_STATE_S3:
@@ -286,7 +295,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state) · 8 unmodified lines
286295 acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1);
287296
288297 /* Reprogram control registers and execute _BFS */
289− acpi_leave_sleep_state_prep(acpi_state, flags);
298+ acpi_leave_sleep_state_prep(acpi_state, wake_sleep_flags);
290299
291300 /* ACPI 3.0 specs (P62) says that it's the responsibility
292301 * of the OSPM to clear the status bit [ implying that the
@@ -550,30 +559,27 @@ static int acpi_hibernation_begin(void) · 257 unmodified lines
550559
551560 static int acpi_hibernation_enter(void)
552561 {
553− u8 flags = wake_sleep_flags();
554562 acpi_status status = AE_OK;
555563
556564 ACPI_FLUSH_CPU_CACHE();
557565
558566 /* This shouldn't return. If it returns, we have a problem */
559− status = acpi_enter_sleep_state(ACPI_STATE_S4, flags);
567+ status = acpi_enter_sleep_state(ACPI_STATE_S4, wake_sleep_flags);
560568 /* Reprogram control registers and execute _BFS */
561− acpi_leave_sleep_state_prep(ACPI_STATE_S4, flags);
569+ acpi_leave_sleep_state_prep(ACPI_STATE_S4, wake_sleep_flags);
562570
563571 return ACPI_SUCCESS(status) ? 0 : -EFAULT;
564572 }
565573
566574 static void acpi_hibernation_leave(void)
567575 {
568− u8 flags = wake_sleep_flags();
569−
570576 /*
571577 * If ACPI is not enabled by the BIOS and the boot kernel, we need to
572578 * enable it here.
573579 */
574580 acpi_enable();
575581 /* Reprogram control registers and execute _BFS */
576− acpi_leave_sleep_state_prep(ACPI_STATE_S4, flags);
582+ acpi_leave_sleep_state_prep(ACPI_STATE_S4, wake_sleep_flags);
577583 /* Check the hardware signature */
578584 if (facs && s4_hardware_signature != facs->hardware_signature) {
579585 printk(KERN_EMERG "ACPI: Hardware changed while hibernated, "
@@ -828,12 +834,10 @@ static void acpi_power_off_prepare(void) · 248 unmodified lines
828834
829835 static void acpi_power_off(void)
830836 {
831− u8 flags = wake_sleep_flags();
832−
833837 /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
834838 printk(KERN_DEBUG "%s called\n", __func__);
835839 local_irq_disable();
836− acpi_enter_sleep_state(ACPI_STATE_S5, flags);
840+ acpi_enter_sleep_state(ACPI_STATE_S5, wake_sleep_flags);
837841 }
838842
839843 /*
drivers/amba/bus.c+1−41
@@ -247,8 +247,7 @@ static int amba_pm_restore(struct device *dev) · 246 unmodified lines
247247 /*
248248 * Hooks to provide runtime PM of the pclk (bus clock). It is safe to
249249 * enable/disable the bus clock at runtime PM suspend/resume as this
250− * does not result in loss of context. However, disabling vcore power
251− * would do, so we leave that to the driver.
250+ * does not result in loss of context.
252251 */
253252 static int amba_pm_runtime_suspend(struct device *dev)
254253 {
@@ -354,39 +353,6 @@ static void amba_put_disable_pclk(struct amba_device *pcdev) · 99 unmodified lines
354353 clk_put(pclk);
355354 }
356355
357−static int amba_get_enable_vcore(struct amba_device *pcdev)
358−{
359− struct regulator *vcore = regulator_get(&pcdev->dev, "vcore");
360− int ret;
361−
362− pcdev->vcore = vcore;
363−
364− if (IS_ERR(vcore)) {
365− /* It is OK not to supply a vcore regulator */
366− if (PTR_ERR(vcore) == -ENODEV)
367− return 0;
368− return PTR_ERR(vcore);
369− }
370−
371− ret = regulator_enable(vcore);
372− if (ret) {
373− regulator_put(vcore);
374− pcdev->vcore = ERR_PTR(-ENODEV);
375− }
376−
377− return ret;
378−}
379−
380−static void amba_put_disable_vcore(struct amba_device *pcdev)
381−{
382− struct regulator *vcore = pcdev->vcore;
383−
384− if (!IS_ERR(vcore)) {
385− regulator_disable(vcore);
386− regulator_put(vcore);
387− }
388−}
389−
390356 /*
391357 * These are the device model conversion veneers; they convert the
392358 * device model structures to our more specific structures.
@@ -399,10 +365,6 @@ static int amba_probe(struct device *dev) · 6 unmodified lines
399365 int ret;
400366
401367 do {
402− ret = amba_get_enable_vcore(pcdev);
403− if (ret)
404− break;
405−
406368 ret = amba_get_enable_pclk(pcdev);
407369 if (ret)
408370 break;
@@ -420,7 +382,6 @@ static int amba_probe(struct device *dev) · 11 unmodified lines
420382 pm_runtime_put_noidle(dev);
421383
422384 amba_put_disable_pclk(pcdev);
423− amba_put_disable_vcore(pcdev);
424385 } while (0);
425386
426387 return ret;
@@ -442,7 +403,6 @@ static int amba_remove(struct device *dev) · 15 unmodified lines
442403 pm_runtime_put_noidle(dev);
443404
444405 amba_put_disable_pclk(pcdev);
445− amba_put_disable_vcore(pcdev);
446406
447407 return ret;
448408 }
drivers/ata/ata_piix.c+2−0
@@ -329,6 +329,8 @@ static const struct pci_device_id piix_pci_tbl[] = { · 328 unmodified lines
329329 { 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
330330 /* SATA Controller IDE (Lynx Point) */
331331 { 0x8086, 0x8c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
332+ /* SATA Controller IDE (DH89xxCC) */
333+ { 0x8086, 0x2326, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
332334 { } /* terminate list */
333335 };
334336
drivers/ata/libata-core.c+2−2
@@ -95,7 +95,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev); · 94 unmodified lines
9595 static void ata_dev_xfermask(struct ata_device *dev);
9696 static unsigned long ata_dev_blacklisted(const struct ata_device *dev);
9797
98−unsigned int ata_print_id = 1;
98+atomic_t ata_print_id = ATOMIC_INIT(1);
9999
100100 struct ata_force_param {
101101 const char *name;
@@ -6029,7 +6029,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) · 5927 unmodified lines
60296029
60306030 /* give ports names and add SCSI hosts */
60316031 for (i = 0; i < host->n_ports; i++)
6032− host->ports[i]->print_id = ata_print_id++;
6032+ host->ports[i]->print_id = atomic_inc_return(&ata_print_id);
60336033
60346034
60356035 /* Create associated sysfs transport objects */
drivers/ata/libata-scsi.c+2−2
@@ -3843,7 +3843,7 @@ int ata_sas_async_port_init(struct ata_port *ap) · 3842 unmodified lines
38433843 int rc = ap->ops->port_start(ap);
38443844
38453845 if (!rc) {
3846− ap->print_id = ata_print_id++;
3846+ ap->print_id = atomic_inc_return(&ata_print_id);
38473847 __ata_port_probe(ap);
38483848 }
38493849
@@ -3867,7 +3867,7 @@ int ata_sas_port_init(struct ata_port *ap) · 17 unmodified lines
38673867 int rc = ap->ops->port_start(ap);
38683868
38693869 if (!rc) {
3870− ap->print_id = ata_print_id++;
3870+ ap->print_id = atomic_inc_return(&ata_print_id);
38713871 rc = ata_port_probe(ap);
38723872 }
38733873
drivers/ata/libata-transport.c+1−0
@@ -294,6 +294,7 @@ int ata_tport_add(struct device *parent, · 293 unmodified lines
294294 device_enable_async_suspend(dev);
295295 pm_runtime_set_active(dev);
296296 pm_runtime_enable(dev);
297+ pm_runtime_forbid(dev);
297298
298299 transport_add_device(dev);
299300 transport_configure_device(dev);
drivers/ata/libata.h+1−1
@@ -53,7 +53,7 @@ enum { · 52 unmodified lines
5353 ATA_DNXFER_QUIET = (1 << 31),
5454 };
5555
56−extern unsigned int ata_print_id;
56+extern atomic_t ata_print_id;
5757 extern int atapi_passthru16;
5858 extern int libata_fua;
5959 extern int libata_noacpi;
drivers/ata/sata_mv.c+2−1
@@ -4025,7 +4025,8 @@ static int mv_platform_probe(struct platform_device *pdev) · 4024 unmodified lines
40254025 struct ata_host *host;
40264026 struct mv_host_priv *hpriv;
40274027 struct resource *res;
4028− int n_ports, rc;
4028+ int n_ports = 0;
4029+ int rc;
40294030
40304031 ata_print_version_once(&pdev->dev, DRV_VERSION);
40314032
drivers/base/soc.c+1−3
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515 #include <linux/sys_soc.h>
1616 #include <linux/err.h>
1717
18−static DEFINE_IDR(soc_ida);
18+static DEFINE_IDA(soc_ida);
1919 static DEFINE_SPINLOCK(soc_lock);
2020
2121 static ssize_t soc_info_get(struct device *dev,
@@ -168,8 +168,6 @@ void soc_device_unregister(struct soc_device *soc_dev) · 146 unmodified lines
168168
169169 static int __init soc_bus_register(void)
170170 {
171− spin_lock_init(&soc_lock);
172−
173171 return bus_register(&soc_bus_type);
174172 }
175173 core_initcall(soc_bus_register);
drivers/bcma/Kconfig+1−1
@@ -29,7 +29,7 @@ config BCMA_HOST_PCI · 28 unmodified lines
2929
3030 config BCMA_DRIVER_PCI_HOSTMODE
3131 bool "Driver for PCI core working in hostmode"
32− depends on BCMA && MIPS
32+ depends on BCMA && MIPS && BCMA_HOST_PCI
3333 help
3434 PCI core hostmode operation (external PCI bus).
3535
drivers/bcma/driver_pci_host.c+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 */
1111
1212 #include "bcma_private.h"
13+#include <linux/pci.h>
1314 #include <linux/export.h>
1415 #include <linux/bcma/bcma.h>
1516 #include <asm/paccess.h>
drivers/bcma/sprom.c+5−2
@@ -404,16 +404,19 @@ int bcma_sprom_get(struct bcma_bus *bus) · 403 unmodified lines
404404 return -EOPNOTSUPP;
405405
406406 if (!bcma_sprom_ext_available(bus)) {
407+ bool sprom_onchip;
408+
407409 /*
408410 * External SPROM takes precedence so check
409411 * on-chip OTP only when no external SPROM
410412 * is present.
411413 */
412− if (bcma_sprom_onchip_available(bus)) {
414+ sprom_onchip = bcma_sprom_onchip_available(bus);
415+ if (sprom_onchip) {
413416 /* determine offset */
414417 offset = bcma_sprom_onchip_offset(bus);
415418 }
416− if (!offset) {
419+ if (!offset || !sprom_onchip) {
417420 /*
418421 * Maybe there is no SPROM on the device?
419422 * Now we ask the arch code if there is some sprom
drivers/block/cciss_scsi.c+2−1
@@ -866,6 +866,7 @@ cciss_scsi_detect(ctlr_info_t *h) · 865 unmodified lines
866866 sh->can_queue = cciss_tape_cmds;
867867 sh->sg_tablesize = h->maxsgentries;
868868 sh->max_cmd_len = MAX_COMMAND_SIZE;
869+ sh->max_sectors = h->cciss_max_sectors;
869870
870871 ((struct cciss_scsi_adapter_data_t *)
871872 h->scsi_ctlr)->scsi_host = sh;
@@ -1410,7 +1411,7 @@ static void cciss_scatter_gather(ctlr_info_t *h, CommandList_struct *c, · 538 unmodified lines
14101411 /* track how many SG entries we are using */
14111412 if (request_nsgs > h->maxSG)
14121413 h->maxSG = request_nsgs;
1413− c->Header.SGTotal = (__u8) request_nsgs + chained;
1414+ c->Header.SGTotal = (u16) request_nsgs + chained;
14141415 if (request_nsgs > h->max_cmd_sgentries)
14151416 c->Header.SGList = h->max_cmd_sgentries;
14161417 else
drivers/block/mtip32xx/Kconfig+1−1
@@ -4,6 +4,6 @@ · 3 unmodified lines
44
55 config BLK_DEV_PCIESSD_MTIP32XX
66 tristate "Block Device Driver for Micron PCIe SSDs"
7− depends on HOTPLUG_PCI_PCIE
7+ depends on PCI
88 help
99 This enables the block driver for Micron PCIe SSDs.
drivers/block/mtip32xx/mtip32xx.c+664−196
@@ -36,6 +36,7 @@ · 35 unmodified lines
3636 #include <linux/idr.h>
3737 #include <linux/kthread.h>
3838 #include <../drivers/ata/ahci.h>
39+#include <linux/export.h>
3940 #include "mtip32xx.h"
4041
4142 #define HW_CMD_SLOT_SZ (MTIP_MAX_COMMAND_SLOTS * 32)
@@ -44,6 +45,7 @@ · 2 unmodified lines
4445 #define HW_PORT_PRIV_DMA_SZ \
4546 (HW_CMD_SLOT_SZ + HW_CMD_TBL_AR_SZ + AHCI_RX_FIS_SZ)
4647
48+#define HOST_CAP_NZDMA (1 << 19)
4749 #define HOST_HSORG 0xFC
4850 #define HSORG_DISABLE_SLOTGRP_INTR (1<<24)
4951 #define HSORG_DISABLE_SLOTGRP_PXIS (1<<16)
@@ -139,6 +141,12 @@ static void mtip_command_cleanup(struct driver_data *dd) · 89 unmodified lines
139141 int group = 0, commandslot = 0, commandindex = 0;
140142 struct mtip_cmd *command;
141143 struct mtip_port *port = dd->port;
144+ static int in_progress;
145+
146+ if (in_progress)
147+ return;
148+
149+ in_progress = 1;
142150
143151 for (group = 0; group < 4; group++) {
144152 for (commandslot = 0; commandslot < 32; commandslot++) {
@@ -165,7 +173,8 @@ static void mtip_command_cleanup(struct driver_data *dd) · 20 unmodified lines
165173
166174 up(&port->cmd_slot);
167175
168− atomic_set(&dd->drv_cleanup_done, true);
176+ set_bit(MTIP_DDF_CLEANUP_BIT, &dd->dd_flag);
177+ in_progress = 0;
169178 }
170179
171180 /*
@@ -262,6 +271,9 @@ static int hba_reset_nosleep(struct driver_data *dd) · 90 unmodified lines
262271 && time_before(jiffies, timeout))
263272 mdelay(1);
264273
274+ if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag))
275+ return -1;
276+
265277 if (readl(dd->mmio + HOST_CTL) & HOST_RESET)
266278 return -1;
267279
@@ -294,6 +306,10 @@ static inline void mtip_issue_ncq_command(struct mtip_port *port, int tag) · 26 unmodified lines
294306 port->cmd_issue[MTIP_TAG_INDEX(tag)]);
295307
296308 spin_unlock_irqrestore(&port->cmd_issue_lock, flags);
309+
310+ /* Set the command's timeout value.*/
311+ port->commands[tag].comp_time = jiffies + msecs_to_jiffies(
312+ MTIP_NCQ_COMMAND_TIMEOUT_MS);
297313 }
298314
299315 /*
@@ -420,7 +436,12 @@ static void mtip_init_port(struct mtip_port *port) · 120 unmodified lines
420436 writel(0xFFFFFFFF, port->completed[i]);
421437
422438 /* Clear any pending interrupts for this port */
423− writel(readl(port->mmio + PORT_IRQ_STAT), port->mmio + PORT_IRQ_STAT);
439+ writel(readl(port->dd->mmio + PORT_IRQ_STAT),
440+ port->dd->mmio + PORT_IRQ_STAT);
441+
442+ /* Clear any pending interrupts on the HBA. */
443+ writel(readl(port->dd->mmio + HOST_IRQ_STAT),
444+ port->dd->mmio + HOST_IRQ_STAT);
424445
425446 /* Enable port interrupts */
426447 writel(DEF_PORT_IRQ, port->mmio + PORT_IRQ_MASK);
@@ -447,6 +468,9 @@ static void mtip_restart_port(struct mtip_port *port) · 20 unmodified lines
447468 && time_before(jiffies, timeout))
448469 ;
449470
471+ if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &port->dd->dd_flag))
472+ return;
473+
450474 /*
451475 * Chip quirk: escalate to hba reset if
452476 * PxCMD.CR not clear after 500 ms
@@ -475,6 +499,9 @@ static void mtip_restart_port(struct mtip_port *port) · 22 unmodified lines
475499 while (time_before(jiffies, timeout))
476500 ;
477501
502+ if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &port->dd->dd_flag))
503+ return;
504+
478505 /* Clear PxSCTL.DET */
479506 writel(readl(port->mmio + PORT_SCR_CTL) & ~1,
480507 port->mmio + PORT_SCR_CTL);
@@ -486,15 +513,35 @@ static void mtip_restart_port(struct mtip_port *port) · 5 unmodified lines
486513 && time_before(jiffies, timeout))
487514 ;
488515
516+ if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &port->dd->dd_flag))
517+ return;
518+
489519 if ((readl(port->mmio + PORT_SCR_STAT) & 0x01) == 0)
490520 dev_warn(&port->dd->pdev->dev,
491521 "COM reset failed\n");
492522
493− /* Clear SError, the PxSERR.DIAG.x should be set so clear it */
494− writel(readl(port->mmio + PORT_SCR_ERR), port->mmio + PORT_SCR_ERR);
523+ mtip_init_port(port);
524+ mtip_start_port(port);
495525
496− /* Enable the DMA engine */
497− mtip_enable_engine(port, 1);
526+}
527+
528+/*
529+ * Helper function for tag logging
530+ */
531+static void print_tags(struct driver_data *dd,
532+ char *msg,
533+ unsigned long *tagbits,
534+ int cnt)
535+{
536+ unsigned char tagmap[128];
537+ int group, tagmap_len = 0;
538+
539+ memset(tagmap, 0, sizeof(tagmap));
540+ for (group = SLOTBITS_IN_LONGS; group > 0; group--)
541+ tagmap_len = sprintf(tagmap + tagmap_len, "%016lX ",
542+ tagbits[group-1]);
543+ dev_warn(&dd->pdev->dev,
544+ "%d command(s) %s: tagmap [%s]", cnt, msg, tagmap);
498545 }
499546
500547 /*
@@ -514,15 +561,18 @@ static void mtip_timeout_function(unsigned long int data) · 13 unmodified lines
514561 int tag, cmdto_cnt = 0;
515562 unsigned int bit, group;
516563 unsigned int num_command_slots = port->dd->slot_groups * 32;
564+ unsigned long to, tagaccum[SLOTBITS_IN_LONGS];
517565
518566 if (unlikely(!port))
519567 return;
520568
521− if (atomic_read(&port->dd->resumeflag) == true) {
569+ if (test_bit(MTIP_DDF_RESUME_BIT, &port->dd->dd_flag)) {
522570 mod_timer(&port->cmd_timer,
523571 jiffies + msecs_to_jiffies(30000));
524572 return;
525573 }
574+ /* clear the tag accumulator */
575+ memset(tagaccum, 0, SLOTBITS_IN_LONGS * sizeof(long));
526576
527577 for (tag = 0; tag < num_command_slots; tag++) {
528578 /*
@@ -540,12 +590,10 @@ static void mtip_timeout_function(unsigned long int data) · 11 unmodified lines
540590 command = &port->commands[tag];
541591 fis = (struct host_to_dev_fis *) command->command;
542592
543− dev_warn(&port->dd->pdev->dev,
544− "Timeout for command tag %d\n", tag);
545−
593+ set_bit(tag, tagaccum);
546594 cmdto_cnt++;
547595 if (cmdto_cnt == 1)
548− set_bit(MTIP_FLAG_EH_ACTIVE_BIT, &port->flags);
596+ set_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags);
549597
550598 /*
551599 * Clear the completed bit. This should prevent
@@ -578,15 +626,29 @@ static void mtip_timeout_function(unsigned long int data) · 26 unmodified lines
578626 }
579627 }
580628
581− if (cmdto_cnt) {
582− dev_warn(&port->dd->pdev->dev,
583− "%d commands timed out: restarting port",
584− cmdto_cnt);
629+ if (cmdto_cnt && !test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags)) {
630+ print_tags(port->dd, "timed out", tagaccum, cmdto_cnt);
631+
585632 mtip_restart_port(port);
586− clear_bit(MTIP_FLAG_EH_ACTIVE_BIT, &port->flags);
633+ clear_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags);
587634 wake_up_interruptible(&port->svc_wait);
588635 }
589636
637+ if (port->ic_pause_timer) {
638+ to = port->ic_pause_timer + msecs_to_jiffies(1000);
639+ if (time_after(jiffies, to)) {
640+ if (!test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags)) {
641+ port->ic_pause_timer = 0;
642+ clear_bit(MTIP_PF_SE_ACTIVE_BIT, &port->flags);
643+ clear_bit(MTIP_PF_DM_ACTIVE_BIT, &port->flags);
644+ clear_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags);
645+ wake_up_interruptible(&port->svc_wait);
646+ }
647+
648+
649+ }
650+ }
651+
590652 /* Restart the timer */
591653 mod_timer(&port->cmd_timer,
592654 jiffies + msecs_to_jiffies(MTIP_TIMEOUT_CHECK_PERIOD));
@@ -681,23 +743,18 @@ static void mtip_completion(struct mtip_port *port, · 88 unmodified lines
681743 complete(waiting);
682744 }
683745
684−/*
685− * Helper function for tag logging
686− */
687−static void print_tags(struct driver_data *dd,
688− char *msg,
689− unsigned long *tagbits)
746+static void mtip_null_completion(struct mtip_port *port,
747+ int tag,
748+ void *data,
749+ int status)
690750 {
691− unsigned int tag, count = 0;
692−
693− for (tag = 0; tag < (dd->slot_groups) * 32; tag++) {
694− if (test_bit(tag, tagbits))
695− count++;
696− }
697− if (count)
698− dev_info(&dd->pdev->dev, "%s [%i tags]\n", msg, count);
751+ return;
699752 }
700753
754+static int mtip_read_log_page(struct mtip_port *port, u8 page, u16 *buffer,
755+ dma_addr_t buffer_dma, unsigned int sectors);
756+static int mtip_get_smart_attr(struct mtip_port *port, unsigned int id,
757+ struct smart_attr *attrib);
701758 /*
702759 * Handle an error.
703760 *
@@ -708,12 +765,16 @@ static void print_tags(struct driver_data *dd, · 4 unmodified lines
708765 */
709766 static void mtip_handle_tfe(struct driver_data *dd)
710767 {
711− int group, tag, bit, reissue;
768+ int group, tag, bit, reissue, rv;
712769 struct mtip_port *port;
713− struct mtip_cmd *command;
770+ struct mtip_cmd *cmd;
714771 u32 completed;
715772 struct host_to_dev_fis *fis;
716773 unsigned long tagaccum[SLOTBITS_IN_LONGS];
774+ unsigned int cmd_cnt = 0;
775+ unsigned char *buf;
776+ char *fail_reason = NULL;
777+ int fail_all_ncq_write = 0, fail_all_ncq_cmds = 0;
717778
718779 dev_warn(&dd->pdev->dev, "Taskfile error\n");
719780
@@ -722,8 +783,11 @@ static void mtip_handle_tfe(struct driver_data *dd) · 2 unmodified lines
722783 /* Stop the timer to prevent command timeouts. */
723784 del_timer(&port->cmd_timer);
724785
786+ /* clear the tag accumulator */
787+ memset(tagaccum, 0, SLOTBITS_IN_LONGS * sizeof(long));
788+
725789 /* Set eh_active */
726− set_bit(MTIP_FLAG_EH_ACTIVE_BIT, &port->flags);
790+ set_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags);
727791
728792 /* Loop through all the groups */
729793 for (group = 0; group < dd->slot_groups; group++) {
@@ -732,9 +796,6 @@ static void mtip_handle_tfe(struct driver_data *dd) · 2 unmodified lines
732796 /* clear completed status register in the hardware.*/
733797 writel(completed, port->completed[group]);
734798
735− /* clear the tag accumulator */
736− memset(tagaccum, 0, SLOTBITS_IN_LONGS * sizeof(long));
737−
738799 /* Process successfully completed commands */
739800 for (bit = 0; bit < 32 && completed; bit++) {
740801 if (!(completed & (1<<bit)))
@@ -745,13 +806,14 @@ static void mtip_handle_tfe(struct driver_data *dd) · 4 unmodified lines
745806 if (tag == MTIP_TAG_INTERNAL)
746807 continue;
747808
748− command = &port->commands[tag];
749− if (likely(command->comp_func)) {
809+ cmd = &port->commands[tag];
810+ if (likely(cmd->comp_func)) {
750811 set_bit(tag, tagaccum);
751− atomic_set(&port->commands[tag].active, 0);
752− command->comp_func(port,
812+ cmd_cnt++;
813+ atomic_set(&cmd->active, 0);
814+ cmd->comp_func(port,
753815 tag,
754− command->comp_data,
816+ cmd->comp_data,
755817 0);
756818 } else {
757819 dev_err(&port->dd->pdev->dev,
@@ -765,12 +827,45 @@ static void mtip_handle_tfe(struct driver_data *dd) · 7 unmodified lines
765827 }
766828 }
767829 }
768− print_tags(dd, "TFE tags completed:", tagaccum);
830+
831+ print_tags(dd, "completed (TFE)", tagaccum, cmd_cnt);
769832
770833 /* Restart the port */
771834 mdelay(20);
772835 mtip_restart_port(port);
773836
837+ /* Trying to determine the cause of the error */
838+ rv = mtip_read_log_page(dd->port, ATA_LOG_SATA_NCQ,
839+ dd->port->log_buf,
840+ dd->port->log_buf_dma, 1);
841+ if (rv) {
842+ dev_warn(&dd->pdev->dev,
843+ "Error in READ LOG EXT (10h) command\n");
844+ /* non-critical error, don't fail the load */
845+ } else {
846+ buf = (unsigned char *)dd->port->log_buf;
847+ if (buf[259] & 0x1) {
848+ dev_info(&dd->pdev->dev,
849+ "Write protect bit is set.\n");
850+ set_bit(MTIP_DDF_WRITE_PROTECT_BIT, &dd->dd_flag);
851+ fail_all_ncq_write = 1;
852+ fail_reason = "write protect";
853+ }
854+ if (buf[288] == 0xF7) {
855+ dev_info(&dd->pdev->dev,
856+ "Exceeded Tmax, drive in thermal shutdown.\n");
857+ set_bit(MTIP_DDF_OVER_TEMP_BIT, &dd->dd_flag);
858+ fail_all_ncq_cmds = 1;
859+ fail_reason = "thermal shutdown";
860+ }
861+ if (buf[288] == 0xBF) {
862+ dev_info(&dd->pdev->dev,
863+ "Drive indicates rebuild has failed.\n");
864+ fail_all_ncq_cmds = 1;
865+ fail_reason = "rebuild failed";
866+ }
867+ }
868+
774869 /* clear the tag accumulator */
775870 memset(tagaccum, 0, SLOTBITS_IN_LONGS * sizeof(long));
776871
@@ -779,32 +874,47 @@ static void mtip_handle_tfe(struct driver_data *dd) · 2 unmodified lines
779874 for (bit = 0; bit < 32; bit++) {
780875 reissue = 1;
781876 tag = (group << 5) + bit;
877+ cmd = &port->commands[tag];
782878
783879 /* If the active bit is set re-issue the command */
784− if (atomic_read(&port->commands[tag].active) == 0)
880+ if (atomic_read(&cmd->active) == 0)
785881 continue;
786882
787− fis = (struct host_to_dev_fis *)
788− port->commands[tag].command;
883+ fis = (struct host_to_dev_fis *)cmd->command;
789884
790885 /* Should re-issue? */
791886 if (tag == MTIP_TAG_INTERNAL ||
792887 fis->command == ATA_CMD_SET_FEATURES)
793888 reissue = 0;
889+ else {
890+ if (fail_all_ncq_cmds ||
891+ (fail_all_ncq_write &&
892+ fis->command == ATA_CMD_FPDMA_WRITE)) {
893+ dev_warn(&dd->pdev->dev,
894+ " Fail: %s w/tag %d [%s].\n",
895+ fis->command == ATA_CMD_FPDMA_WRITE ?
896+ "write" : "read",
897+ tag,
898+ fail_reason != NULL ?
899+ fail_reason : "unknown");
900+ atomic_set(&cmd->active, 0);
901+ if (cmd->comp_func) {
902+ cmd->comp_func(port, tag,
903+ cmd->comp_data,
904+ -ENODATA);
905+ }
906+ continue;
907+ }
908+ }
794909
795910 /*
796911 * First check if this command has
797912 * exceeded its retries.
798913 */
799− if (reissue &&
800− (port->commands[tag].retries-- > 0)) {
914+ if (reissue && (cmd->retries-- > 0)) {
801915
802916 set_bit(tag, tagaccum);
803917
804− /* Update the timeout value. */
805− port->commands[tag].comp_time =
806− jiffies + msecs_to_jiffies(
807− MTIP_NCQ_COMMAND_TIMEOUT_MS);
808918 /* Re-issue the command. */
809919 mtip_issue_ncq_command(port, tag);
810920
@@ -814,13 +924,13 @@ static void mtip_handle_tfe(struct driver_data *dd) · 3 unmodified lines
814924 /* Retire a command that will not be reissued */
815925 dev_warn(&port->dd->pdev->dev,
816926 "retiring tag %d\n", tag);
817− atomic_set(&port->commands[tag].active, 0);
927+ atomic_set(&cmd->active, 0);
818928
819− if (port->commands[tag].comp_func)
820− port->commands[tag].comp_func(
929+ if (cmd->comp_func)
930+ cmd->comp_func(
821931 port,
822932 tag,
823− port->commands[tag].comp_data,
933+ cmd->comp_data,
824934 PORT_IRQ_TF_ERR);
825935 else
826936 dev_warn(&port->dd->pdev->dev,
@@ -828,10 +938,10 @@ static void mtip_handle_tfe(struct driver_data *dd) · 1 unmodified line
828938 tag);
829939 }
830940 }
831− print_tags(dd, "TFE tags reissued:", tagaccum);
941+ print_tags(dd, "reissued (TFE)", tagaccum, cmd_cnt);
832942
833943 /* clear eh_active */
834− clear_bit(MTIP_FLAG_EH_ACTIVE_BIT, &port->flags);
944+ clear_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags);
835945 wake_up_interruptible(&port->svc_wait);
836946
837947 mod_timer(&port->cmd_timer,
@@ -899,7 +1009,7 @@ static inline void mtip_process_legacy(struct driver_data *dd, u32 port_stat) · 61 unmodified lines
8991009 struct mtip_port *port = dd->port;
9001010 struct mtip_cmd *cmd = &port->commands[MTIP_TAG_INTERNAL];
9011011
902− if (test_bit(MTIP_FLAG_IC_ACTIVE_BIT, &port->flags) &&
1012+ if (test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags) &&
9031013 (cmd != NULL) && !(readl(port->cmd_issue[MTIP_TAG_INTERNAL])
9041014 & (1 << MTIP_TAG_INTERNAL))) {
9051015 if (cmd->comp_func) {
@@ -911,8 +1021,6 @@ static inline void mtip_process_legacy(struct driver_data *dd, u32 port_stat) · 5 unmodified lines
9111021 }
9121022 }
9131023
914− dev_warn(&dd->pdev->dev, "IRQ status 0x%x ignored.\n", port_stat);
915−
9161024 return;
9171025 }
9181026
@@ -968,6 +1076,9 @@ static inline irqreturn_t mtip_handle_irq(struct driver_data *data) · 49 unmodified lines
9681076 /* don't proceed further */
9691077 return IRQ_HANDLED;
9701078 }
1079+ if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
1080+ &dd->dd_flag))
1081+ return rv;
9711082
9721083 mtip_process_errors(dd, port_stat & PORT_IRQ_ERR);
9731084 }
@@ -1015,6 +1126,39 @@ static void mtip_issue_non_ncq_command(struct mtip_port *port, int tag) · 41 unmodified lines
10151126 port->cmd_issue[MTIP_TAG_INDEX(tag)]);
10161127 }
10171128
1129+static bool mtip_pause_ncq(struct mtip_port *port,
1130+ struct host_to_dev_fis *fis)
1131+{
1132+ struct host_to_dev_fis *reply;
1133+ unsigned long task_file_data;
1134+
1135+ reply = port->rxfis + RX_FIS_D2H_REG;
1136+ task_file_data = readl(port->mmio+PORT_TFDATA);
1137+
1138+ if ((task_file_data & 1) || (fis->command == ATA_CMD_SEC_ERASE_UNIT))
1139+ return false;
1140+
1141+ if (fis->command == ATA_CMD_SEC_ERASE_PREP) {
1142+ set_bit(MTIP_PF_SE_ACTIVE_BIT, &port->flags);
1143+ port->ic_pause_timer = jiffies;
1144+ return true;
1145+ } else if ((fis->command == ATA_CMD_DOWNLOAD_MICRO) &&
1146+ (fis->features == 0x03)) {
1147+ set_bit(MTIP_PF_DM_ACTIVE_BIT, &port->flags);
1148+ port->ic_pause_timer = jiffies;
1149+ return true;
1150+ } else if ((fis->command == ATA_CMD_SEC_ERASE_UNIT) ||
1151+ ((fis->command == 0xFC) &&
1152+ (fis->features == 0x27 || fis->features == 0x72 ||
1153+ fis->features == 0x62 || fis->features == 0x26))) {
1154+ /* Com reset after secure erase or lowlevel format */
1155+ mtip_restart_port(port);
1156+ return false;
1157+ }
1158+
1159+ return false;
1160+}
1161+
10181162 /*
10191163 * Wait for port to quiesce
10201164 *
@@ -1033,11 +1177,13 @@ static int mtip_quiesce_io(struct mtip_port *port, unsigned long timeout) · 12 unmodified lines
10331177
10341178 to = jiffies + msecs_to_jiffies(timeout);
10351179 do {
1036− if (test_bit(MTIP_FLAG_SVC_THD_ACTIVE_BIT, &port->flags) &&
1037− test_bit(MTIP_FLAG_ISSUE_CMDS_BIT, &port->flags)) {
1180+ if (test_bit(MTIP_PF_SVC_THD_ACTIVE_BIT, &port->flags) &&
1181+ test_bit(MTIP_PF_ISSUE_CMDS_BIT, &port->flags)) {
10381182 msleep(20);
10391183 continue; /* svc thd is actively issuing commands */
10401184 }
1185+ if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &port->dd->dd_flag))
1186+ return -EFAULT;
10411187 /*
10421188 * Ignore s_active bit 0 of array element 0.
10431189 * This bit will always be set
@@ -1074,7 +1220,7 @@ static int mtip_quiesce_io(struct mtip_port *port, unsigned long timeout) · 30 unmodified lines
10741220 * -EAGAIN Time out waiting for command to complete.
10751221 */
10761222 static int mtip_exec_internal_command(struct mtip_port *port,
1077− void *fis,
1223+ struct host_to_dev_fis *fis,
10781224 int fis_len,
10791225 dma_addr_t buffer,
10801226 int buf_len,
@@ -1084,8 +1230,9 @@ static int mtip_exec_internal_command(struct mtip_port *port, · 3 unmodified lines
10841230 {
10851231 struct mtip_cmd_sg *command_sg;
10861232 DECLARE_COMPLETION_ONSTACK(wait);
1087− int rv = 0;
1233+ int rv = 0, ready2go = 1;
10881234 struct mtip_cmd *int_cmd = &port->commands[MTIP_TAG_INTERNAL];
1235+ unsigned long to;
10891236
10901237 /* Make sure the buffer is 8 byte aligned. This is asic specific. */
10911238 if (buffer & 0x00000007) {
@@ -1094,23 +1241,38 @@ static int mtip_exec_internal_command(struct mtip_port *port, · 2 unmodified lines
10941241 return -EFAULT;
10951242 }
10961243
1097− /* Only one internal command should be running at a time */
1098− if (test_and_set_bit(MTIP_TAG_INTERNAL, port->allocated)) {
1244+ to = jiffies + msecs_to_jiffies(timeout);
1245+ do {
1246+ ready2go = !test_and_set_bit(MTIP_TAG_INTERNAL,
1247+ port->allocated);
1248+ if (ready2go)
1249+ break;
1250+ mdelay(100);
1251+ } while (time_before(jiffies, to));
1252+ if (!ready2go) {
10991253 dev_warn(&port->dd->pdev->dev,
1100− "Internal command already active\n");
1254+ "Internal cmd active. new cmd [%02X]\n", fis->command);
11011255 return -EBUSY;
11021256 }
1103− set_bit(MTIP_FLAG_IC_ACTIVE_BIT, &port->flags);
1257+ set_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags);
1258+ port->ic_pause_timer = 0;
1259+
1260+ if (fis->command == ATA_CMD_SEC_ERASE_UNIT)
1261+ clear_bit(MTIP_PF_SE_ACTIVE_BIT, &port->flags);
1262+ else if (fis->command == ATA_CMD_DOWNLOAD_MICRO)
1263+ clear_bit(MTIP_PF_DM_ACTIVE_BIT, &port->flags);
11041264
11051265 if (atomic == GFP_KERNEL) {
1106− /* wait for io to complete if non atomic */
1107− if (mtip_quiesce_io(port, 5000) < 0) {
1108− dev_warn(&port->dd->pdev->dev,
1109− "Failed to quiesce IO\n");
1110− release_slot(port, MTIP_TAG_INTERNAL);
1111− clear_bit(MTIP_FLAG_IC_ACTIVE_BIT, &port->flags);
1112− wake_up_interruptible(&port->svc_wait);
1113− return -EBUSY;
1266+ if (fis->command != ATA_CMD_STANDBYNOW1) {
1267+ /* wait for io to complete if non atomic */
1268+ if (mtip_quiesce_io(port, 5000) < 0) {
1269+ dev_warn(&port->dd->pdev->dev,
1270+ "Failed to quiesce IO\n");
1271+ release_slot(port, MTIP_TAG_INTERNAL);
1272+ clear_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags);
1273+ wake_up_interruptible(&port->svc_wait);
1274+ return -EBUSY;
1275+ }
11141276 }
11151277
11161278 /* Set the completion function and data for the command. */
@@ -1120,7 +1282,7 @@ static int mtip_exec_internal_command(struct mtip_port *port, · 3 unmodified lines
11201282 } else {
11211283 /* Clear completion - we're going to poll */
11221284 int_cmd->comp_data = NULL;
1123− int_cmd->comp_func = NULL;
1285+ int_cmd->comp_func = mtip_null_completion;
11241286 }
11251287
11261288 /* Copy the command to the command table */
@@ -1159,6 +1321,12 @@ static int mtip_exec_internal_command(struct mtip_port *port, · 32 unmodified lines
11591321 "Internal command did not complete [%d] "
11601322 "within timeout of %lu ms\n",
11611323 atomic, timeout);
1324+ if (mtip_check_surprise_removal(port->dd->pdev) ||
1325+ test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
1326+ &port->dd->dd_flag)) {
1327+ rv = -ENXIO;
1328+ goto exec_ic_exit;
1329+ }
11621330 rv = -EAGAIN;
11631331 }
11641332
@@ -1166,31 +1334,59 @@ static int mtip_exec_internal_command(struct mtip_port *port, · 1 unmodified line
11661334 & (1 << MTIP_TAG_INTERNAL)) {
11671335 dev_warn(&port->dd->pdev->dev,
11681336 "Retiring internal command but CI is 1.\n");
1337+ if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
1338+ &port->dd->dd_flag)) {
1339+ hba_reset_nosleep(port->dd);
1340+ rv = -ENXIO;
1341+ } else {
1342+ mtip_restart_port(port);
1343+ rv = -EAGAIN;
1344+ }
1345+ goto exec_ic_exit;
11691346 }
11701347
11711348 } else {
11721349 /* Spin for <timeout> checking if command still outstanding */
11731350 timeout = jiffies + msecs_to_jiffies(timeout);
1174−
1175− while ((readl(
1176− port->cmd_issue[MTIP_TAG_INTERNAL])
1177− & (1 << MTIP_TAG_INTERNAL))
1178− && time_before(jiffies, timeout))
1179− ;
1351+ while ((readl(port->cmd_issue[MTIP_TAG_INTERNAL])
1352+ & (1 << MTIP_TAG_INTERNAL))
1353+ && time_before(jiffies, timeout)) {
1354+ if (mtip_check_surprise_removal(port->dd->pdev)) {
1355+ rv = -ENXIO;
1356+ goto exec_ic_exit;
1357+ }
1358+ if ((fis->command != ATA_CMD_STANDBYNOW1) &&
1359+ test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
1360+ &port->dd->dd_flag)) {
1361+ rv = -ENXIO;
1362+ goto exec_ic_exit;
1363+ }
1364+ }
11801365
11811366 if (readl(port->cmd_issue[MTIP_TAG_INTERNAL])
11821367 & (1 << MTIP_TAG_INTERNAL)) {
11831368 dev_err(&port->dd->pdev->dev,
1184− "Internal command did not complete [%d]\n",
1185− atomic);
1369+ "Internal command did not complete [atomic]\n");
11861370 rv = -EAGAIN;
1371+ if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
1372+ &port->dd->dd_flag)) {
1373+ hba_reset_nosleep(port->dd);
1374+ rv = -ENXIO;
1375+ } else {
1376+ mtip_restart_port(port);
1377+ rv = -EAGAIN;
1378+ }
11871379 }
11881380 }
1189−
1381+exec_ic_exit:
11901382 /* Clear the allocated and active bits for the internal command. */
11911383 atomic_set(&int_cmd->active, 0);
11921384 release_slot(port, MTIP_TAG_INTERNAL);
1193− clear_bit(MTIP_FLAG_IC_ACTIVE_BIT, &port->flags);
1385+ if (rv >= 0 && mtip_pause_ncq(port, fis)) {
1386+ /* NCQ paused */
1387+ return rv;
1388+ }
1389+ clear_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags);
11941390 wake_up_interruptible(&port->svc_wait);
11951391
11961392 return rv;
@@ -1240,6 +1436,9 @@ static int mtip_get_identify(struct mtip_port *port, void __user *user_buffer) · 43 unmodified lines
12401436 int rv = 0;
12411437 struct host_to_dev_fis fis;
12421438
1439+ if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &port->dd->dd_flag))
1440+ return -EFAULT;
1441+
12431442 /* Build the FIS. */
12441443 memset(&fis, 0, sizeof(struct host_to_dev_fis));
12451444 fis.type = 0x27;
@@ -1313,6 +1512,7 @@ static int mtip_standby_immediate(struct mtip_port *port) · 67 unmodified lines
13131512 {
13141513 int rv;
13151514 struct host_to_dev_fis fis;
1515+ unsigned long start;
13161516
13171517 /* Build the FIS. */
13181518 memset(&fis, 0, sizeof(struct host_to_dev_fis));
@@ -1320,15 +1520,150 @@ static int mtip_standby_immediate(struct mtip_port *port) · 1 unmodified line
13201520 fis.opts = 1 << 7;
13211521 fis.command = ATA_CMD_STANDBYNOW1;
13221522
1323− /* Execute the command. Use a 15-second timeout for large drives. */
1523+ start = jiffies;
13241524 rv = mtip_exec_internal_command(port,
13251525 &fis,
13261526 5,
13271527 0,
13281528 0,
13291529 0,
1330− GFP_KERNEL,
1530+ GFP_ATOMIC,
13311531 15000);
1532+ dbg_printk(MTIP_DRV_NAME "Time taken to complete standby cmd: %d ms\n",
1533+ jiffies_to_msecs(jiffies - start));
1534+ if (rv)
1535+ dev_warn(&port->dd->pdev->dev,
1536+ "STANDBY IMMEDIATE command failed.\n");
1537+
1538+ return rv;
1539+}
1540+
1541+/*
1542+ * Issue a READ LOG EXT command to the device.
1543+ *
1544+ * @port pointer to the port structure.
1545+ * @page page number to fetch
1546+ * @buffer pointer to buffer
1547+ * @buffer_dma dma address corresponding to @buffer
1548+ * @sectors page length to fetch, in sectors
1549+ *
1550+ * return value
1551+ * @rv return value from mtip_exec_internal_command()
1552+ */
1553+static int mtip_read_log_page(struct mtip_port *port, u8 page, u16 *buffer,
1554+ dma_addr_t buffer_dma, unsigned int sectors)
1555+{
1556+ struct host_to_dev_fis fis;
1557+
1558+ memset(&fis, 0, sizeof(struct host_to_dev_fis));
1559+ fis.type = 0x27;
1560+ fis.opts = 1 << 7;
1561+ fis.command = ATA_CMD_READ_LOG_EXT;
1562+ fis.sect_count = sectors & 0xFF;
1563+ fis.sect_cnt_ex = (sectors >> 8) & 0xFF;
1564+ fis.lba_low = page;
1565+ fis.lba_mid = 0;
1566+ fis.device = ATA_DEVICE_OBS;
1567+
1568+ memset(buffer, 0, sectors * ATA_SECT_SIZE);
1569+
1570+ return mtip_exec_internal_command(port,
1571+ &fis,
1572+ 5,
1573+ buffer_dma,
1574+ sectors * ATA_SECT_SIZE,
1575+ 0,
1576+ GFP_ATOMIC,
1577+ MTIP_INTERNAL_COMMAND_TIMEOUT_MS);
1578+}
1579+
1580+/*
1581+ * Issue a SMART READ DATA command to the device.
1582+ *
1583+ * @port pointer to the port structure.
1584+ * @buffer pointer to buffer
1585+ * @buffer_dma dma address corresponding to @buffer
1586+ *
1587+ * return value
1588+ * @rv return value from mtip_exec_internal_command()
1589+ */
1590+static int mtip_get_smart_data(struct mtip_port *port, u8 *buffer,
1591+ dma_addr_t buffer_dma)
1592+{
1593+ struct host_to_dev_fis fis;
1594+
1595+ memset(&fis, 0, sizeof(struct host_to_dev_fis));
1596+ fis.type = 0x27;
1597+ fis.opts = 1 << 7;
1598+ fis.command = ATA_CMD_SMART;
1599+ fis.features = 0xD0;
1600+ fis.sect_count = 1;
1601+ fis.lba_mid = 0x4F;
1602+ fis.lba_hi = 0xC2;
1603+ fis.device = ATA_DEVICE_OBS;
1604+
1605+ return mtip_exec_internal_command(port,
1606+ &fis,
1607+ 5,
1608+ buffer_dma,
1609+ ATA_SECT_SIZE,
1610+ 0,
1611+ GFP_ATOMIC,
1612+ 15000);
1613+}
1614+
1615+/*
1616+ * Get the value of a smart attribute
1617+ *
1618+ * @port pointer to the port structure
1619+ * @id attribute number
1620+ * @attrib pointer to return attrib information corresponding to @id
1621+ *
1622+ * return value
1623+ * -EINVAL NULL buffer passed or unsupported attribute @id.
1624+ * -EPERM Identify data not valid, SMART not supported or not enabled
1625+ */
1626+static int mtip_get_smart_attr(struct mtip_port *port, unsigned int id,
1627+ struct smart_attr *attrib)
1628+{
1629+ int rv, i;
1630+ struct smart_attr *pattr;
1631+
1632+ if (!attrib)
1633+ return -EINVAL;
1634+
1635+ if (!port->identify_valid) {
1636+ dev_warn(&port->dd->pdev->dev, "IDENTIFY DATA not valid\n");
1637+ return -EPERM;
1638+ }
1639+ if (!(port->identify[82] & 0x1)) {
1640+ dev_warn(&port->dd->pdev->dev, "SMART not supported\n");
1641+ return -EPERM;
1642+ }
1643+ if (!(port->identify[85] & 0x1)) {
1644+ dev_warn(&port->dd->pdev->dev, "SMART not enabled\n");
1645+ return -EPERM;
1646+ }
1647+
1648+ memset(port->smart_buf, 0, ATA_SECT_SIZE);
1649+ rv = mtip_get_smart_data(port, port->smart_buf, port->smart_buf_dma);
1650+ if (rv) {
1651+ dev_warn(&port->dd->pdev->dev, "Failed to ge SMART data\n");
1652+ return rv;
1653+ }
1654+
1655+ pattr = (struct smart_attr *)(port->smart_buf + 2);
1656+ for (i = 0; i < 29; i++, pattr++)
1657+ if (pattr->attr_id == id) {
1658+ memcpy(attrib, pattr, sizeof(struct smart_attr));
1659+ break;
1660+ }
1661+
1662+ if (i == 29) {
1663+ dev_warn(&port->dd->pdev->dev,
1664+ "Query for invalid SMART attribute ID\n");
1665+ rv = -EINVAL;
1666+ }
13321667
13331668 return rv;
13341669 }
@@ -1504,10 +1839,7 @@ static int exec_drive_task(struct mtip_port *port, u8 *command) · 169 unmodified lines
15041839 fis.cyl_hi = command[5];
15051840 fis.device = command[6] & ~0x10; /* Clear the dev bit*/
15061841
1507−
1508− dbg_printk(MTIP_DRV_NAME "%s: User Command: cmd %x, feat %x, "
1509− "nsect %x, sect %x, lcyl %x, "
1510− "hcyl %x, sel %x\n",
1842+ dbg_printk(MTIP_DRV_NAME " %s: User Command: cmd %x, feat %x, nsect %x, sect %x, lcyl %x, hcyl %x, sel %x\n",
15111843 __func__,
15121844 command[0],
15131845 command[1],
@@ -1534,8 +1866,7 @@ static int exec_drive_task(struct mtip_port *port, u8 *command) · 20 unmodified lines
15341866 command[4] = reply->cyl_low;
15351867 command[5] = reply->cyl_hi;
15361868
1537− dbg_printk(MTIP_DRV_NAME "%s: Completion Status: stat %x, "
1538− "err %x , cyl_lo %x cyl_hi %x\n",
1869+ dbg_printk(MTIP_DRV_NAME " %s: Completion Status: stat %x, err %x , cyl_lo %x cyl_hi %x\n",
15391870 __func__,
15401871 command[0],
15411872 command[1],
@@ -1578,7 +1909,7 @@ static int exec_drive_command(struct mtip_port *port, u8 *command, · 36 unmodified lines
15781909 }
15791910
15801911 dbg_printk(MTIP_DRV_NAME
1581− "%s: User Command: cmd %x, sect %x, "
1912+ " %s: User Command: cmd %x, sect %x, "
15821913 "feat %x, sectcnt %x\n",
15831914 __func__,
15841915 command[0],
@@ -1607,7 +1938,7 @@ static int exec_drive_command(struct mtip_port *port, u8 *command, · 22 unmodified lines
16071938 command[2] = command[3];
16081939
16091940 dbg_printk(MTIP_DRV_NAME
1610− "%s: Completion Status: stat %x, "
1941+ " %s: Completion Status: stat %x, "
16111942 "err %x, cmd %x\n",
16121943 __func__,
16131944 command[0],
@@ -1810,9 +2141,10 @@ static int exec_drive_taskfile(struct driver_data *dd, · 196 unmodified lines
18102141 }
18112142
18122143 dbg_printk(MTIP_DRV_NAME
1813− "taskfile: cmd %x, feat %x, nsect %x,"
2144+ " %s: cmd %x, feat %x, nsect %x,"
18142145 " sect/lbal %x, lcyl/lbam %x, hcyl/lbah %x,"
18152146 " head/dev %x\n",
2147+ __func__,
18162148 fis.command,
18172149 fis.features,
18182150 fis.sect_count,
@@ -1823,8 +2155,8 @@ static int exec_drive_taskfile(struct driver_data *dd, · 4 unmodified lines
18232155
18242156 switch (fis.command) {
18252157 case ATA_CMD_DOWNLOAD_MICRO:
1826− /* Change timeout for Download Microcode to 60 seconds.*/
1827− timeout = 60000;
2158+ /* Change timeout for Download Microcode to 2 minutes */
2159+ timeout = 120000;
18282160 break;
18292161 case ATA_CMD_SEC_ERASE_UNIT:
18302162 /* Change timeout for Security Erase Unit to 4 minutes.*/
@@ -1840,8 +2172,8 @@ static int exec_drive_taskfile(struct driver_data *dd, · 9 unmodified lines
18402172 timeout = 10000;
18412173 break;
18422174 case ATA_CMD_SMART:
1843− /* Change timeout for vendor unique command to 10 secs */
1844− timeout = 10000;
2175+ /* Change timeout for vendor unique command to 15 secs */
2176+ timeout = 15000;
18452177 break;
18462178 default:
18472179 timeout = MTIP_IOCTL_COMMAND_TIMEOUT_MS;
@@ -1903,18 +2235,8 @@ static int exec_drive_taskfile(struct driver_data *dd, · 55 unmodified lines
19032235 req_task->hob_ports[1] = reply->features_ex;
19042236 req_task->hob_ports[2] = reply->sect_cnt_ex;
19052237 }
1906−
1907− /* Com rest after secure erase or lowlevel format */
1908− if (((fis.command == ATA_CMD_SEC_ERASE_UNIT) ||
1909− ((fis.command == 0xFC) &&
1910− (fis.features == 0x27 || fis.features == 0x72 ||
1911− fis.features == 0x62 || fis.features == 0x26))) &&
1912− !(reply->command & 1)) {
1913− mtip_restart_port(dd->port);
1914− }
1915−
19162238 dbg_printk(MTIP_DRV_NAME
1917− "%s: Completion: stat %x,"
2239+ " %s: Completion: stat %x,"
19182240 "err %x, sect_cnt %x, lbalo %x,"
19192241 "lbamid %x, lbahi %x, dev %x\n",
19202242 __func__,
@@ -2080,14 +2402,10 @@ static void mtip_hw_submit_io(struct driver_data *dd, sector_t start, · 159 unmodified lines
20802402 struct host_to_dev_fis *fis;
20812403 struct mtip_port *port = dd->port;
20822404 struct mtip_cmd *command = &port->commands[tag];
2405+ int dma_dir = (dir == READ) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
20832406
20842407 /* Map the scatter list for DMA access */
2085− if (dir == READ)
2086− nents = dma_map_sg(&dd->pdev->dev, command->sg,
2087− nents, DMA_FROM_DEVICE);
2088− else
2089− nents = dma_map_sg(&dd->pdev->dev, command->sg,
2090− nents, DMA_TO_DEVICE);
2408+ nents = dma_map_sg(&dd->pdev->dev, command->sg, nents, dma_dir);
20912409
20922410 command->scatter_ents = nents;
20932411
@@ -2127,7 +2445,7 @@ static void mtip_hw_submit_io(struct driver_data *dd, sector_t start, · 33 unmodified lines
21272445 */
21282446 command->comp_data = dd;
21292447 command->comp_func = mtip_async_complete;
2130− command->direction = (dir == READ ? DMA_FROM_DEVICE : DMA_TO_DEVICE);
2448+ command->direction = dma_dir;
21312449
21322450 /*
21332451 * Set the completion function and data for the command passed
@@ -2140,19 +2458,16 @@ static void mtip_hw_submit_io(struct driver_data *dd, sector_t start, · 6 unmodified lines
21402458 * To prevent this command from being issued
21412459 * if an internal command is in progress or error handling is active.
21422460 */
2143− if (unlikely(test_bit(MTIP_FLAG_IC_ACTIVE_BIT, &port->flags) ||
2144− test_bit(MTIP_FLAG_EH_ACTIVE_BIT, &port->flags))) {
2461+ if (port->flags & MTIP_PF_PAUSE_IO) {
21452462 set_bit(tag, port->cmds_to_issue);
2146− set_bit(MTIP_FLAG_ISSUE_CMDS_BIT, &port->flags);
2463+ set_bit(MTIP_PF_ISSUE_CMDS_BIT, &port->flags);
21472464 return;
21482465 }
21492466
21502467 /* Issue the command to the hardware */
21512468 mtip_issue_ncq_command(port, tag);
21522469
2153− /* Set the command's timeout value.*/
2154− port->commands[tag].comp_time = jiffies + msecs_to_jiffies(
2155− MTIP_NCQ_COMMAND_TIMEOUT_MS);
2470+ return;
21562471 }
21572472
21582473 /*
@@ -2191,6 +2506,10 @@ static struct scatterlist *mtip_hw_get_scatterlist(struct driver_data *dd, · 32 unmodified lines
21912506 down(&dd->port->cmd_slot);
21922507 *tag = get_slot(dd->port);
21932508
2509+ if (unlikely(test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag))) {
2510+ up(&dd->port->cmd_slot);
2511+ return NULL;
2512+ }
21942513 if (unlikely(*tag < 0))
21952514 return NULL;
21962515
@@ -2207,7 +2526,7 @@ static struct scatterlist *mtip_hw_get_scatterlist(struct driver_data *dd, · 10 unmodified lines
22072526 * return value
22082527 * The size, in bytes, of the data copied into buf.
22092528 */
2210−static ssize_t hw_show_registers(struct device *dev,
2529+static ssize_t mtip_hw_show_registers(struct device *dev,
22112530 struct device_attribute *attr,
22122531 char *buf)
22132532 {
@@ -2216,7 +2535,7 @@ static ssize_t hw_show_registers(struct device *dev, · 2 unmodified lines
22162535 int size = 0;
22172536 int n;
22182537
2219− size += sprintf(&buf[size], "%s:\ns_active:\n", __func__);
2538+ size += sprintf(&buf[size], "S ACTive:\n");
22202539
22212540 for (n = 0; n < dd->slot_groups; n++)
22222541 size += sprintf(&buf[size], "0x%08x\n",
@@ -2240,20 +2559,39 @@ static ssize_t hw_show_registers(struct device *dev, · 17 unmodified lines
22402559 group_allocated);
22412560 }
22422561
2243− size += sprintf(&buf[size], "completed:\n");
2562+ size += sprintf(&buf[size], "Completed:\n");
22442563
22452564 for (n = 0; n < dd->slot_groups; n++)
22462565 size += sprintf(&buf[size], "0x%08x\n",
22472566 readl(dd->port->completed[n]));
22482567
2249− size += sprintf(&buf[size], "PORT_IRQ_STAT 0x%08x\n",
2568+ size += sprintf(&buf[size], "PORT IRQ STAT : 0x%08x\n",
22502569 readl(dd->port->mmio + PORT_IRQ_STAT));
2251− size += sprintf(&buf[size], "HOST_IRQ_STAT 0x%08x\n",
2570+ size += sprintf(&buf[size], "HOST IRQ STAT : 0x%08x\n",
22522571 readl(dd->mmio + HOST_IRQ_STAT));
22532572
22542573 return size;
22552574 }
2256−static DEVICE_ATTR(registers, S_IRUGO, hw_show_registers, NULL);
2575+
2576+static ssize_t mtip_hw_show_status(struct device *dev,
2577+ struct device_attribute *attr,
2578+ char *buf)
2579+{
2580+ struct driver_data *dd = dev_to_disk(dev)->private_data;
2581+ int size = 0;
2582+
2583+ if (test_bit(MTIP_DDF_OVER_TEMP_BIT, &dd->dd_flag))
2584+ size += sprintf(buf, "%s", "thermal_shutdown\n");
2585+ else if (test_bit(MTIP_DDF_WRITE_PROTECT_BIT, &dd->dd_flag))
2586+ size += sprintf(buf, "%s", "write_protect\n");
2587+ else
2588+ size += sprintf(buf, "%s", "online\n");
2589+
2590+ return size;
2591+}
2592+
2593+static DEVICE_ATTR(registers, S_IRUGO, mtip_hw_show_registers, NULL);
2594+static DEVICE_ATTR(status, S_IRUGO, mtip_hw_show_status, NULL);
22572595
22582596 /*
22592597 * Create the sysfs related attributes.
@@ -2272,7 +2610,10 @@ static int mtip_hw_sysfs_init(struct driver_data *dd, struct kobject *kobj) · 12 unmodified lines
22722610
22732611 if (sysfs_create_file(kobj, &dev_attr_registers.attr))
22742612 dev_warn(&dd->pdev->dev,
2275− "Error creating registers sysfs entry\n");
2613+ "Error creating 'registers' sysfs entry\n");
2614+ if (sysfs_create_file(kobj, &dev_attr_status.attr))
2615+ dev_warn(&dd->pdev->dev,
2616+ "Error creating 'status' sysfs entry\n");
22762617 return 0;
22772618 }
22782619
@@ -2292,6 +2633,7 @@ static int mtip_hw_sysfs_exit(struct driver_data *dd, struct kobject *kobj) · 13 unmodified lines
22922633 return -EINVAL;
22932634
22942635 sysfs_remove_file(kobj, &dev_attr_registers.attr);
2636+ sysfs_remove_file(kobj, &dev_attr_status.attr);
22952637
22962638 return 0;
22972639 }
@@ -2384,10 +2726,12 @@ static int mtip_ftl_rebuild_poll(struct driver_data *dd) · 86 unmodified lines
23842726 "FTL rebuild in progress. Polling for completion.\n");
23852727
23862728 start = jiffies;
2387− dd->ftlrebuildflag = 1;
23882729 timeout = jiffies + msecs_to_jiffies(MTIP_FTL_REBUILD_TIMEOUT_MS);
23892730
23902731 do {
2732+ if (unlikely(test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
2733+ &dd->dd_flag)))
2734+ return -EFAULT;
23912735 if (mtip_check_surprise_removal(dd->pdev))
23922736 return -EFAULT;
23932737
@@ -2408,22 +2752,17 @@ static int mtip_ftl_rebuild_poll(struct driver_data *dd) · 14 unmodified lines
24082752 dev_warn(&dd->pdev->dev,
24092753 "FTL rebuild complete (%d secs).\n",
24102754 jiffies_to_msecs(jiffies - start) / 1000);
2411− dd->ftlrebuildflag = 0;
24122755 mtip_block_initialize(dd);
2413− break;
2756+ return 0;
24142757 }
24152758 ssleep(10);
24162759 } while (time_before(jiffies, timeout));
24172760
24182761 /* Check for timeout */
2419− if (dd->ftlrebuildflag) {
2420− dev_err(&dd->pdev->dev,
2762+ dev_err(&dd->pdev->dev,
24212763 "Timed out waiting for FTL rebuild to complete (%d secs).\n",
24222764 jiffies_to_msecs(jiffies - start) / 1000);
2423− return -EFAULT;
2424− }
2425−
2426− return 0;
2765+ return -EFAULT;
24272766 }
24282767
24292768 /*
@@ -2448,14 +2787,17 @@ static int mtip_service_thread(void *data) · 18 unmodified lines
24482787 * is in progress nor error handling is active
24492788 */
24502789 wait_event_interruptible(port->svc_wait, (port->flags) &&
2451− !test_bit(MTIP_FLAG_IC_ACTIVE_BIT, &port->flags) &&
2452− !test_bit(MTIP_FLAG_EH_ACTIVE_BIT, &port->flags));
2790+ !(port->flags & MTIP_PF_PAUSE_IO));
24532791
24542792 if (kthread_should_stop())
24552793 break;
24562794
2457− set_bit(MTIP_FLAG_SVC_THD_ACTIVE_BIT, &port->flags);
2458− if (test_bit(MTIP_FLAG_ISSUE_CMDS_BIT, &port->flags)) {
2795+ if (unlikely(test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
2796+ &dd->dd_flag)))
2797+ break;
2798+
2799+ set_bit(MTIP_PF_SVC_THD_ACTIVE_BIT, &port->flags);
2800+ if (test_bit(MTIP_PF_ISSUE_CMDS_BIT, &port->flags)) {
24592801 slot = 1;
24602802 /* used to restrict the loop to one iteration */
24612803 slot_start = num_cmd_slots;
@@ -2480,21 +2822,19 @@ static int mtip_service_thread(void *data) · 18 unmodified lines
24802822 /* Issue the command to the hardware */
24812823 mtip_issue_ncq_command(port, slot);
24822824
2483− /* Set the command's timeout value.*/
2484− port->commands[slot].comp_time = jiffies +
2485− msecs_to_jiffies(MTIP_NCQ_COMMAND_TIMEOUT_MS);
2486−
24872825 clear_bit(slot, port->cmds_to_issue);
24882826 }
24892827
2490− clear_bit(MTIP_FLAG_ISSUE_CMDS_BIT, &port->flags);
2491− } else if (test_bit(MTIP_FLAG_REBUILD_BIT, &port->flags)) {
2492− mtip_ftl_rebuild_poll(dd);
2493− clear_bit(MTIP_FLAG_REBUILD_BIT, &port->flags);
2828+ clear_bit(MTIP_PF_ISSUE_CMDS_BIT, &port->flags);
2829+ } else if (test_bit(MTIP_PF_REBUILD_BIT, &port->flags)) {
2830+ if (!mtip_ftl_rebuild_poll(dd))
2831+ set_bit(MTIP_DDF_REBUILD_FAILED_BIT,
2832+ &dd->dd_flag);
2833+ clear_bit(MTIP_PF_REBUILD_BIT, &port->flags);
24942834 }
2495− clear_bit(MTIP_FLAG_SVC_THD_ACTIVE_BIT, &port->flags);
2835+ clear_bit(MTIP_PF_SVC_THD_ACTIVE_BIT, &port->flags);
24962836
2497− if (test_bit(MTIP_FLAG_SVC_THD_SHOULD_STOP_BIT, &port->flags))
2837+ if (test_bit(MTIP_PF_SVC_THD_STOP_BIT, &port->flags))
24982838 break;
24992839 }
25002840 return 0;
@@ -2513,6 +2853,9 @@ static int mtip_hw_init(struct driver_data *dd) · 12 unmodified lines
25132853 int i;
25142854 int rv;
25152855 unsigned int num_command_slots;
2856+ unsigned long timeout, timetaken;
2857+ unsigned char *buf;
2858+ struct smart_attr attr242;
25162859
25172860 dd->mmio = pcim_iomap_table(dd->pdev)[MTIP_ABAR];
25182861
@@ -2547,7 +2890,7 @@ static int mtip_hw_init(struct driver_data *dd) · 28 unmodified lines
25472890 /* Allocate memory for the command list. */
25482891 dd->port->command_list =
25492892 dmam_alloc_coherent(&dd->pdev->dev,
2550− HW_PORT_PRIV_DMA_SZ + (ATA_SECT_SIZE * 2),
2893+ HW_PORT_PRIV_DMA_SZ + (ATA_SECT_SIZE * 4),
25512894 &dd->port->command_list_dma,
25522895 GFP_KERNEL);
25532896 if (!dd->port->command_list) {
@@ -2560,7 +2903,7 @@ static int mtip_hw_init(struct driver_data *dd) · 6 unmodified lines
25602903 /* Clear the memory we have allocated. */
25612904 memset(dd->port->command_list,
25622905 0,
2563− HW_PORT_PRIV_DMA_SZ + (ATA_SECT_SIZE * 2));
2906+ HW_PORT_PRIV_DMA_SZ + (ATA_SECT_SIZE * 4));
25642907
25652908 /* Setup the addresse of the RX FIS. */
25662909 dd->port->rxfis = dd->port->command_list + HW_CMD_SLOT_SZ;
@@ -2576,10 +2919,19 @@ static int mtip_hw_init(struct driver_data *dd) · 9 unmodified lines
25762919 dd->port->identify_dma = dd->port->command_tbl_dma +
25772920 HW_CMD_TBL_AR_SZ;
25782921
2579− /* Setup the address of the sector buffer. */
2922+ /* Setup the address of the sector buffer - for some non-ncq cmds */
25802923 dd->port->sector_buffer = (void *) dd->port->identify + ATA_SECT_SIZE;
25812924 dd->port->sector_buffer_dma = dd->port->identify_dma + ATA_SECT_SIZE;
25822925
2926+ /* Setup the address of the log buf - for read log command */
2927+ dd->port->log_buf = (void *)dd->port->sector_buffer + ATA_SECT_SIZE;
2928+ dd->port->log_buf_dma = dd->port->sector_buffer_dma + ATA_SECT_SIZE;
2929+
2930+ /* Setup the address of the smart buf - for smart read data command */
2931+ dd->port->smart_buf = (void *)dd->port->log_buf + ATA_SECT_SIZE;
2932+ dd->port->smart_buf_dma = dd->port->log_buf_dma + ATA_SECT_SIZE;
2933+
2934+
25832935 /* Point the command headers at the command tables. */
25842936 for (i = 0; i < num_command_slots; i++) {
25852937 dd->port->commands[i].command_header =
@@ -2623,14 +2975,43 @@ static int mtip_hw_init(struct driver_data *dd) · 37 unmodified lines
26232975 dd->port->mmio + i*0x80 + PORT_SDBV;
26242976 }
26252977
2626− /* Reset the HBA. */
2627− if (mtip_hba_reset(dd) < 0) {
2628− dev_err(&dd->pdev->dev,
2629− "Card did not reset within timeout\n");
2630− rv = -EIO;
2978+ timetaken = jiffies;
2979+ timeout = jiffies + msecs_to_jiffies(30000);
2980+ while (((readl(dd->port->mmio + PORT_SCR_STAT) & 0x0F) != 0x03) &&
2981+ time_before(jiffies, timeout)) {
2982+ mdelay(100);
2983+ }
2984+ if (unlikely(mtip_check_surprise_removal(dd->pdev))) {
2985+ timetaken = jiffies - timetaken;
2986+ dev_warn(&dd->pdev->dev,
2987+ "Surprise removal detected at %u ms\n",
2988+ jiffies_to_msecs(timetaken));
2989+ rv = -ENODEV;
2990+ goto out2 ;
2991+ }
2992+ if (unlikely(test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag))) {
2993+ timetaken = jiffies - timetaken;
2994+ dev_warn(&dd->pdev->dev,
2995+ "Removal detected at %u ms\n",
2996+ jiffies_to_msecs(timetaken));
2997+ rv = -EFAULT;
26312998 goto out2;
26322999 }
26333000
3001+ /* Conditionally reset the HBA. */
3002+ if (!(readl(dd->mmio + HOST_CAP) & HOST_CAP_NZDMA)) {
3003+ if (mtip_hba_reset(dd) < 0) {
3004+ dev_err(&dd->pdev->dev,
3005+ "Card did not reset within timeout\n");
3006+ rv = -EIO;
3007+ goto out2;
3008+ }
3009+ } else {
3010+ /* Clear any pending interrupts on the HBA */
3011+ writel(readl(dd->mmio + HOST_IRQ_STAT),
3012+ dd->mmio + HOST_IRQ_STAT);
3013+ }
3014+
26343015 mtip_init_port(dd->port);
26353016 mtip_start_port(dd->port);
26363017
@@ -2660,6 +3041,12 @@ static int mtip_hw_init(struct driver_data *dd) · 23 unmodified lines
26603041 mod_timer(&dd->port->cmd_timer,
26613042 jiffies + msecs_to_jiffies(MTIP_TIMEOUT_CHECK_PERIOD));
26623043
3044+
3045+ if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag)) {
3046+ rv = -EFAULT;
3047+ goto out3;
3048+ }
3049+
26633050 if (mtip_get_identify(dd->port, NULL) < 0) {
26643051 rv = -EFAULT;
26653052 goto out3;
@@ -2667,10 +3054,47 @@ static int mtip_hw_init(struct driver_data *dd) · 1 unmodified line
26673054
26683055 if (*(dd->port->identify + MTIP_FTL_REBUILD_OFFSET) ==
26693056 MTIP_FTL_REBUILD_MAGIC) {
2670− set_bit(MTIP_FLAG_REBUILD_BIT, &dd->port->flags);
3057+ set_bit(MTIP_PF_REBUILD_BIT, &dd->port->flags);
26713058 return MTIP_FTL_REBUILD_MAGIC;
26723059 }
26733060 mtip_dump_identify(dd->port);
3061+
3062+ /* check write protect, over temp and rebuild statuses */
3063+ rv = mtip_read_log_page(dd->port, ATA_LOG_SATA_NCQ,
3064+ dd->port->log_buf,
3065+ dd->port->log_buf_dma, 1);
3066+ if (rv) {
3067+ dev_warn(&dd->pdev->dev,
3068+ "Error in READ LOG EXT (10h) command\n");
3069+ /* non-critical error, don't fail the load */
3070+ } else {
3071+ buf = (unsigned char *)dd->port->log_buf;
3072+ if (buf[259] & 0x1) {
3073+ dev_info(&dd->pdev->dev,
3074+ "Write protect bit is set.\n");
3075+ set_bit(MTIP_DDF_WRITE_PROTECT_BIT, &dd->dd_flag);
3076+ }
3077+ if (buf[288] == 0xF7) {
3078+ dev_info(&dd->pdev->dev,
3079+ "Exceeded Tmax, drive in thermal shutdown.\n");
3080+ set_bit(MTIP_DDF_OVER_TEMP_BIT, &dd->dd_flag);
3081+ }
3082+ if (buf[288] == 0xBF) {
3083+ dev_info(&dd->pdev->dev,
3084+ "Drive indicates rebuild has failed.\n");
3085+ /* TODO */
3086+ }
3087+ }
3088+
3089+ /* get write protect progess */
3090+ memset(&attr242, 0, sizeof(struct smart_attr));
3091+ if (mtip_get_smart_attr(dd->port, 242, &attr242))
3092+ dev_warn(&dd->pdev->dev,
3093+ "Unable to check write protect progress\n");
3094+ else
3095+ dev_info(&dd->pdev->dev,
3096+ "Write protect progress: %d%% (%d blocks)\n",
3097+ attr242.cur, attr242.data);
26743098 return rv;
26753099
26763100 out3:
@@ -2688,7 +3112,7 @@ out2: · 11 unmodified lines
26883112
26893113 /* Free the command/command header memory. */
26903114 dmam_free_coherent(&dd->pdev->dev,
2691− HW_PORT_PRIV_DMA_SZ + (ATA_SECT_SIZE * 2),
3115+ HW_PORT_PRIV_DMA_SZ + (ATA_SECT_SIZE * 4),
26923116 dd->port->command_list,
26933117 dd->port->command_list_dma);
26943118 out1:
@@ -2712,9 +3136,12 @@ static int mtip_hw_exit(struct driver_data *dd) · 17 unmodified lines
27123136 * Send standby immediate (E0h) to the drive so that it
27133137 * saves its state.
27143138 */
2715− if (atomic_read(&dd->drv_cleanup_done) != true) {
3139+ if (!test_bit(MTIP_DDF_CLEANUP_BIT, &dd->dd_flag)) {
27163140
2717− mtip_standby_immediate(dd->port);
3141+ if (!test_bit(MTIP_PF_REBUILD_BIT, &dd->port->flags))
3142+ if (mtip_standby_immediate(dd->port))
3143+ dev_warn(&dd->pdev->dev,
3144+ "STANDBY IMMEDIATE failed\n");
27183145
27193146 /* de-initialize the port. */
27203147 mtip_deinit_port(dd->port);
@@ -2734,7 +3161,7 @@ static int mtip_hw_exit(struct driver_data *dd) · 13 unmodified lines
27343161
27353162 /* Free the command/command header memory. */
27363163 dmam_free_coherent(&dd->pdev->dev,
2737− HW_PORT_PRIV_DMA_SZ + (ATA_SECT_SIZE * 2),
3164+ HW_PORT_PRIV_DMA_SZ + (ATA_SECT_SIZE * 4),
27383165 dd->port->command_list,
27393166 dd->port->command_list_dma);
27403167 /* Free the memory allocated for the for structure. */
@@ -2892,6 +3319,9 @@ static int mtip_block_ioctl(struct block_device *dev, · 151 unmodified lines
28923319 if (!dd)
28933320 return -ENOTTY;
28943321
3322+ if (unlikely(test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag)))
3323+ return -ENOTTY;
3324+
28953325 switch (cmd) {
28963326 case BLKFLSBUF:
28973327 return -ENOTTY;
@@ -2927,6 +3357,9 @@ static int mtip_block_compat_ioctl(struct block_device *dev, · 29 unmodified lines
29273357 if (!dd)
29283358 return -ENOTTY;
29293359
3360+ if (unlikely(test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag)))
3361+ return -ENOTTY;
3362+
29303363 switch (cmd) {
29313364 case BLKFLSBUF:
29323365 return -ENOTTY;
@@ -3049,6 +3482,24 @@ static void mtip_make_request(struct request_queue *queue, struct bio *bio) · 116 unmodified lines
30493482 int nents = 0;
30503483 int tag = 0;
30513484
3485+ if (unlikely(dd->dd_flag & MTIP_DDF_STOP_IO)) {
3486+ if (unlikely(test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
3487+ &dd->dd_flag))) {
3488+ bio_endio(bio, -ENXIO);
3489+ return;
3490+ }
3491+ if (unlikely(test_bit(MTIP_DDF_OVER_TEMP_BIT, &dd->dd_flag))) {
3492+ bio_endio(bio, -ENODATA);
3493+ return;
3494+ }
3495+ if (unlikely(test_bit(MTIP_DDF_WRITE_PROTECT_BIT,
3496+ &dd->dd_flag) &&
3497+ bio_data_dir(bio))) {
3498+ bio_endio(bio, -ENODATA);
3499+ return;
3500+ }
3501+ }
3502+
30523503 if (unlikely(!bio_has_data(bio))) {
30533504 blk_queue_flush(queue, 0);
30543505 bio_endio(bio, 0);
@@ -3061,7 +3512,7 @@ static void mtip_make_request(struct request_queue *queue, struct bio *bio) · 6 unmodified lines
30613512
30623513 if (unlikely((bio)->bi_vcnt > MTIP_MAX_SG)) {
30633514 dev_warn(&dd->pdev->dev,
3064− "Maximum number of SGL entries exceeded");
3515+ "Maximum number of SGL entries exceeded\n");
30653516 bio_io_error(bio);
30663517 mtip_hw_release_scatterlist(dd, tag);
30673518 return;
@@ -3210,8 +3661,10 @@ skip_create_disk: · 142 unmodified lines
32103661 kobject_put(kobj);
32113662 }
32123663
3213− if (dd->mtip_svc_handler)
3664+ if (dd->mtip_svc_handler) {
3665+ set_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag);
32143666 return rv; /* service thread created for handling rebuild */
3667+ }
32153668
32163669 start_service_thread:
32173670 sprintf(thd_name, "mtip_svc_thd_%02d", index);
@@ -3220,12 +3673,15 @@ start_service_thread: · 2 unmodified lines
32203673 dd, thd_name);
32213674
32223675 if (IS_ERR(dd->mtip_svc_handler)) {
3223− printk(KERN_ERR "mtip32xx: service thread failed to start\n");
3676+ dev_err(&dd->pdev->dev, "service thread failed to start\n");
32243677 dd->mtip_svc_handler = NULL;
32253678 rv = -EFAULT;
32263679 goto kthread_run_error;
32273680 }
32283681
3682+ if (wait_for_rebuild == MTIP_FTL_REBUILD_MAGIC)
3683+ rv = wait_for_rebuild;
3684+
32293685 return rv;
32303686
32313687 kthread_run_error:
@@ -3266,16 +3722,18 @@ static int mtip_block_remove(struct driver_data *dd) · 34 unmodified lines
32663722 struct kobject *kobj;
32673723
32683724 if (dd->mtip_svc_handler) {
3269− set_bit(MTIP_FLAG_SVC_THD_SHOULD_STOP_BIT, &dd->port->flags);
3725+ set_bit(MTIP_PF_SVC_THD_STOP_BIT, &dd->port->flags);
32703726 wake_up_interruptible(&dd->port->svc_wait);
32713727 kthread_stop(dd->mtip_svc_handler);
32723728 }
32733729
3274− /* Clean up the sysfs attributes managed by the protocol layer. */
3275− kobj = kobject_get(&disk_to_dev(dd->disk)->kobj);
3276− if (kobj) {
3277− mtip_hw_sysfs_exit(dd, kobj);
3278− kobject_put(kobj);
3730+ /* Clean up the sysfs attributes, if created */
3731+ if (test_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag)) {
3732+ kobj = kobject_get(&disk_to_dev(dd->disk)->kobj);
3733+ if (kobj) {
3734+ mtip_hw_sysfs_exit(dd, kobj);
3735+ kobject_put(kobj);
3736+ }
32793737 }
32803738
32813739 /*
@@ -3283,6 +3741,11 @@ static int mtip_block_remove(struct driver_data *dd) · 1 unmodified line
32833741 * from /dev
32843742 */
32853743 del_gendisk(dd->disk);
3744+
3745+ spin_lock(&rssd_index_lock);
3746+ ida_remove(&rssd_index_ida, dd->index);
3747+ spin_unlock(&rssd_index_lock);
3748+
32863749 blk_cleanup_queue(dd->queue);
32873750 dd->disk = NULL;
32883751 dd->queue = NULL;
@@ -3312,6 +3775,11 @@ static int mtip_block_shutdown(struct driver_data *dd) · 23 unmodified lines
33123775
33133776 /* Delete our gendisk structure, and cleanup the blk queue. */
33143777 del_gendisk(dd->disk);
3778+
3779+ spin_lock(&rssd_index_lock);
3780+ ida_remove(&rssd_index_ida, dd->index);
3781+ spin_unlock(&rssd_index_lock);
3782+
33153783 blk_cleanup_queue(dd->queue);
33163784 dd->disk = NULL;
33173785 dd->queue = NULL;
@@ -3359,11 +3827,6 @@ static int mtip_pci_probe(struct pci_dev *pdev, · 41 unmodified lines
33593827 return -ENOMEM;
33603828 }
33613829
3362− /* Set the atomic variable as 1 in case of SRSI */
3363− atomic_set(&dd->drv_cleanup_done, true);
3364−
3365− atomic_set(&dd->resumeflag, false);
3366−
33673830 /* Attach the private data to this PCI device. */
33683831 pci_set_drvdata(pdev, dd);
33693832
@@ -3420,7 +3883,8 @@ static int mtip_pci_probe(struct pci_dev *pdev, · 50 unmodified lines
34203883 * instance number.
34213884 */
34223885 instance++;
3423−
3886+ if (rv != MTIP_FTL_REBUILD_MAGIC)
3887+ set_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag);
34243888 goto done;
34253889
34263890 block_initialize_err:
@@ -3434,9 +3898,6 @@ iomap_err: · 7 unmodified lines
34343898 pci_set_drvdata(pdev, NULL);
34353899 return rv;
34363900 done:
3437− /* Set the atomic variable as 0 in case of SRSI */
3438− atomic_set(&dd->drv_cleanup_done, true);
3439−
34403901 return rv;
34413902 }
34423903
@@ -3452,8 +3913,10 @@ static void mtip_pci_remove(struct pci_dev *pdev) · 9 unmodified lines
34523913 struct driver_data *dd = pci_get_drvdata(pdev);
34533914 int counter = 0;
34543915
3916+ set_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag);
3917+
34553918 if (mtip_check_surprise_removal(pdev)) {
3456− while (atomic_read(&dd->drv_cleanup_done) == false) {
3919+ while (!test_bit(MTIP_DDF_CLEANUP_BIT, &dd->dd_flag)) {
34573920 counter++;
34583921 msleep(20);
34593922 if (counter == 10) {
@@ -3463,8 +3926,6 @@ static void mtip_pci_remove(struct pci_dev *pdev) · 3 unmodified lines
34633926 }
34643927 }
34653928 }
3466− /* Set the atomic variable as 1 in case of SRSI */
3467− atomic_set(&dd->drv_cleanup_done, true);
34683929
34693930 /* Clean up the block layer. */
34703931 mtip_block_remove(dd);
@@ -3493,7 +3954,7 @@ static int mtip_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) · 22 unmodified lines
34933954 return -EFAULT;
34943955 }
34953956
3496− atomic_set(&dd->resumeflag, true);
3957+ set_bit(MTIP_DDF_RESUME_BIT, &dd->dd_flag);
34973958
34983959 /* Disable ports & interrupts then send standby immediate */
34993960 rv = mtip_block_suspend(dd);
@@ -3559,7 +4020,7 @@ static int mtip_pci_resume(struct pci_dev *pdev) · 59 unmodified lines
35594020 dev_err(&pdev->dev, "Unable to resume\n");
35604021
35614022 err:
3562− atomic_set(&dd->resumeflag, false);
4023+ clear_bit(MTIP_DDF_RESUME_BIT, &dd->dd_flag);
35634024
35644025 return rv;
35654026 }
@@ -3608,18 +4069,25 @@ MODULE_DEVICE_TABLE(pci, mtip_pci_tbl); · 42 unmodified lines
36084069 */
36094070 static int __init mtip_init(void)
36104071 {
4072+ int error;
4073+
36114074 printk(KERN_INFO MTIP_DRV_NAME " Version " MTIP_DRV_VERSION "\n");
36124075
36134076 /* Allocate a major block device number to use with this driver. */
3614− mtip_major = register_blkdev(0, MTIP_DRV_NAME);
3615− if (mtip_major < 0) {
4077+ error = register_blkdev(0, MTIP_DRV_NAME);
4078+ if (error <= 0) {
36164079 printk(KERN_ERR "Unable to register block device (%d)\n",
3617− mtip_major);
4080+ error);
36184081 return -EBUSY;
36194082 }
4083+ mtip_major = error;
36204084
36214085 /* Register our PCI operations. */
3622− return pci_register_driver(&mtip_pci_driver);
4086+ error = pci_register_driver(&mtip_pci_driver);
4087+ if (error)
4088+ unregister_blkdev(mtip_major, MTIP_DRV_NAME);
4089+
4090+ return error;
36234091 }
36244092
36254093 /*
drivers/block/mtip32xx/mtip32xx.h+45−13
@@ -34,8 +34,8 @@ · 33 unmodified lines
3434 /* offset of Device Control register in PCIe extended capabilites space */
3535 #define PCIE_CONFIG_EXT_DEVICE_CONTROL_OFFSET 0x48
3636
37−/* # of times to retry timed out IOs */
38−#define MTIP_MAX_RETRIES 5
37+/* # of times to retry timed out/failed IOs */
38+#define MTIP_MAX_RETRIES 2
3939
4040 /* Various timeout values in ms */
4141 #define MTIP_NCQ_COMMAND_TIMEOUT_MS 5000
@@ -114,12 +114,41 @@ · 72 unmodified lines
114114 #define __force_bit2int (unsigned int __force)
115115
116116 /* below are bit numbers in 'flags' defined in mtip_port */
117−#define MTIP_FLAG_IC_ACTIVE_BIT 0
118−#define MTIP_FLAG_EH_ACTIVE_BIT 1
119−#define MTIP_FLAG_SVC_THD_ACTIVE_BIT 2
120−#define MTIP_FLAG_ISSUE_CMDS_BIT 4
121−#define MTIP_FLAG_REBUILD_BIT 5
122−#define MTIP_FLAG_SVC_THD_SHOULD_STOP_BIT 8
117+#define MTIP_PF_IC_ACTIVE_BIT 0 /* pio/ioctl */
118+#define MTIP_PF_EH_ACTIVE_BIT 1 /* error handling */
119+#define MTIP_PF_SE_ACTIVE_BIT 2 /* secure erase */
120+#define MTIP_PF_DM_ACTIVE_BIT 3 /* download microcde */
121+#define MTIP_PF_PAUSE_IO ((1 << MTIP_PF_IC_ACTIVE_BIT) | \
122+ (1 << MTIP_PF_EH_ACTIVE_BIT) | \
123+ (1 << MTIP_PF_SE_ACTIVE_BIT) | \
124+ (1 << MTIP_PF_DM_ACTIVE_BIT))
125+
126+#define MTIP_PF_SVC_THD_ACTIVE_BIT 4
127+#define MTIP_PF_ISSUE_CMDS_BIT 5
128+#define MTIP_PF_REBUILD_BIT 6
129+#define MTIP_PF_SVC_THD_STOP_BIT 8
130+
131+/* below are bit numbers in 'dd_flag' defined in driver_data */
132+#define MTIP_DDF_REMOVE_PENDING_BIT 1
133+#define MTIP_DDF_OVER_TEMP_BIT 2
134+#define MTIP_DDF_WRITE_PROTECT_BIT 3
135+#define MTIP_DDF_STOP_IO ((1 << MTIP_DDF_REMOVE_PENDING_BIT) | \
136+ (1 << MTIP_DDF_OVER_TEMP_BIT) | \
137+ (1 << MTIP_DDF_WRITE_PROTECT_BIT))
138+
139+#define MTIP_DDF_CLEANUP_BIT 5
140+#define MTIP_DDF_RESUME_BIT 6
141+#define MTIP_DDF_INIT_DONE_BIT 7
142+#define MTIP_DDF_REBUILD_FAILED_BIT 8
143+
144+__packed struct smart_attr{
145+ u8 attr_id;
146+ u16 flags;
147+ u8 cur;
148+ u8 worst;
149+ u32 data;
150+ u8 res[3];
151+};
123152
124153 /* Register Frame Information Structure (FIS), host to device. */
125154 struct host_to_dev_fis {
@@ -345,6 +374,12 @@ struct mtip_port { · 219 unmodified lines
345374 * when the command slot and all associated data structures
346375 * are no longer needed.
347376 */
377+ u16 *log_buf;
378+ dma_addr_t log_buf_dma;
379+
380+ u8 *smart_buf;
381+ dma_addr_t smart_buf_dma;
382+
348383 unsigned long allocated[SLOTBITS_IN_LONGS];
349384 /*
350385 * used to queue commands when an internal command is in progress
@@ -368,6 +403,7 @@ struct mtip_port { · 17 unmodified lines
368403 * Timer used to complete commands that have been active for too long.
369404 */
370405 struct timer_list cmd_timer;
406+ unsigned long ic_pause_timer;
371407 /*
372408 * Semaphore used to block threads if there are no
373409 * command slots available.
@@ -404,13 +440,9 @@ struct driver_data { · 30 unmodified lines
404440
405441 unsigned slot_groups; /* number of slot groups the product supports */
406442
407− atomic_t drv_cleanup_done; /* Atomic variable for SRSI */
408−
409443 unsigned long index; /* Index to determine the disk name */
410444
411− unsigned int ftlrebuildflag; /* FTL rebuild flag */
412−
413− atomic_t resumeflag; /* Atomic variable to track suspend/resume */
445+ unsigned long dd_flag; /* NOTE: use atomic bit operations on this */
414446
415447 struct task_struct *mtip_svc_handler; /* task_struct of svc thd */
416448 };
drivers/block/virtio_blk.c+30−12
@@ -351,6 +351,7 @@ static void virtblk_config_changed_work(struct work_struct *work) · 350 unmodified lines
351351 cap_str_10, cap_str_2);
352352
353353 set_capacity(vblk->disk, capacity);
354+ revalidate_disk(vblk->disk);
354355 done:
355356 mutex_unlock(&vblk->config_lock);
356357 }
@@ -374,6 +375,34 @@ static int init_vq(struct virtio_blk *vblk) · 17 unmodified lines
374375 return err;
375376 }
376377
378+/*
379+ * Legacy naming scheme used for virtio devices. We are stuck with it for
380+ * virtio blk but don't ever use it for any new driver.
381+ */
382+static int virtblk_name_format(char *prefix, int index, char *buf, int buflen)
383+{
384+ const int base = 'z' - 'a' + 1;
385+ char *begin = buf + strlen(prefix);
386+ char *end = buf + buflen;
387+ char *p;
388+ int unit;
389+
390+ p = end - 1;
391+ *p = '\0';
392+ unit = base;
393+ do {
394+ if (p == begin)
395+ return -EINVAL;
396+ *--p = 'a' + (index % unit);
397+ index = (index / unit) - 1;
398+ } while (index >= 0);
399+
400+ memmove(begin, p, end - p);
401+ memcpy(buf, prefix, strlen(prefix));
402+
403+ return 0;
404+}
405+
377406 static int __devinit virtblk_probe(struct virtio_device *vdev)
378407 {
379408 struct virtio_blk *vblk;
@@ -442,18 +471,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev) · 62 unmodified lines
442471
443472 q->queuedata = vblk;
444473
445− if (index < 26) {
446− sprintf(vblk->disk->disk_name, "vd%c", 'a' + index % 26);
447− } else if (index < (26 + 1) * 26) {
448− sprintf(vblk->disk->disk_name, "vd%c%c",
449− 'a' + index / 26 - 1, 'a' + index % 26);
450− } else {
451− const unsigned int m1 = (index / 26 - 1) / 26 - 1;
452− const unsigned int m2 = (index / 26 - 1) % 26;
453− const unsigned int m3 = index % 26;
454− sprintf(vblk->disk->disk_name, "vd%c%c%c",
455− 'a' + m1, 'a' + m2, 'a' + m3);
456− }
474+ virtblk_name_format("vd", index, vblk->disk->disk_name, DISK_NAME_LEN);
457475
458476 vblk->disk->major = major;
459477 vblk->disk->first_minor = index_to_minor(index);
drivers/block/xen-blkback/blkback.c+13−37
@@ -321,6 +321,7 @@ struct seg_buf { · 320 unmodified lines
321321 static void xen_blkbk_unmap(struct pending_req *req)
322322 {
323323 struct gnttab_unmap_grant_ref unmap[BLKIF_MAX_SEGMENTS_PER_REQUEST];
324+ struct page *pages[BLKIF_MAX_SEGMENTS_PER_REQUEST];
324325 unsigned int i, invcount = 0;
325326 grant_handle_t handle;
326327 int ret;
@@ -332,25 +333,12 @@ static void xen_blkbk_unmap(struct pending_req *req) · 5 unmodified lines
332333 gnttab_set_unmap_op(&unmap[invcount], vaddr(req, i),
333334 GNTMAP_host_map, handle);
334335 pending_handle(req, i) = BLKBACK_INVALID_HANDLE;
336+ pages[invcount] = virt_to_page(vaddr(req, i));
335337 invcount++;
336338 }
337339
338− ret = HYPERVISOR_grant_table_op(
339− GNTTABOP_unmap_grant_ref, unmap, invcount);
340+ ret = gnttab_unmap_refs(unmap, pages, invcount, false);
340341 BUG_ON(ret);
341− /*
342− * Note, we use invcount, so nr->pages, so we can't index
343− * using vaddr(req, i).
344− */
345− for (i = 0; i < invcount; i++) {
346− ret = m2p_remove_override(
347− virt_to_page(unmap[i].host_addr), false);
348− if (ret) {
349− pr_alert(DRV_PFX "Failed to remove M2P override for %lx\n",
350− (unsigned long)unmap[i].host_addr);
351− continue;
352− }
353− }
354342 }
355343
356344 static int xen_blkbk_map(struct blkif_request *req,
@@ -378,7 +366,7 @@ static int xen_blkbk_map(struct blkif_request *req, · 21 unmodified lines
378366 pending_req->blkif->domid);
379367 }
380368
381− ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, map, nseg);
369+ ret = gnttab_map_refs(map, NULL, &blkbk->pending_page(pending_req, 0), nseg);
382370 BUG_ON(ret);
383371
384372 /*
@@ -398,15 +386,6 @@ static int xen_blkbk_map(struct blkif_request *req, · 13 unmodified lines
398386 if (ret)
399387 continue;
400388
401− ret = m2p_add_override(PFN_DOWN(map[i].dev_bus_addr),
402− blkbk->pending_page(pending_req, i), NULL);
403− if (ret) {
404− pr_alert(DRV_PFX "Failed to install M2P override for %lx (ret: %d)\n",
405− (unsigned long)map[i].dev_bus_addr, ret);
406− /* We could switch over to GNTTABOP_copy */
407− continue;
408− }
409−
410389 seg[i].buf = map[i].dev_bus_addr |
411390 (req->u.rw.seg[i].first_sect << 9);
412391 }
@@ -419,21 +398,18 @@ static int dispatch_discard_io(struct xen_blkif *blkif, · 6 unmodified lines
419398 int err = 0;
420399 int status = BLKIF_RSP_OKAY;
421400 struct block_device *bdev = blkif->vbd.bdev;
401+ unsigned long secure;
422402
423403 blkif->st_ds_req++;
424404
425405 xen_blkif_get(blkif);
426− if (blkif->blk_backend_type == BLKIF_BACKEND_PHY ||
427− blkif->blk_backend_type == BLKIF_BACKEND_FILE) {
428− unsigned long secure = (blkif->vbd.discard_secure &&
429− (req->u.discard.flag & BLKIF_DISCARD_SECURE)) ?
430− BLKDEV_DISCARD_SECURE : 0;
431− err = blkdev_issue_discard(bdev,
432− req->u.discard.sector_number,
433− req->u.discard.nr_sectors,
434− GFP_KERNEL, secure);
435− } else
436− err = -EOPNOTSUPP;
406+ secure = (blkif->vbd.discard_secure &&
407+ (req->u.discard.flag & BLKIF_DISCARD_SECURE)) ?
408+ BLKDEV_DISCARD_SECURE : 0;
409+
410+ err = blkdev_issue_discard(bdev, req->u.discard.sector_number,
411+ req->u.discard.nr_sectors,
412+ GFP_KERNEL, secure);
437413
438414 if (err == -EOPNOTSUPP) {
439415 pr_debug(DRV_PFX "discard op failed, not supported\n");
@@ -830,7 +806,7 @@ static int __init xen_blkif_init(void) · 390 unmodified lines
830806 int i, mmap_pages;
831807 int rc = 0;
832808
833− if (!xen_pv_domain())
809+ if (!xen_domain())
834810 return -ENODEV;
835811
836812 blkbk = kzalloc(sizeof(struct xen_blkbk), GFP_KERNEL);
drivers/block/xen-blkback/common.h+0−6
@@ -146,11 +146,6 @@ enum blkif_protocol { · 145 unmodified lines
146146 BLKIF_PROTOCOL_X86_64 = 3,
147147 };
148148
149−enum blkif_backend_type {
150− BLKIF_BACKEND_PHY = 1,
151− BLKIF_BACKEND_FILE = 2,
152−};
153−
154149 struct xen_vbd {
155150 /* What the domain refers to this vbd as. */
156151 blkif_vdev_t handle;
@@ -177,7 +172,6 @@ struct xen_blkif { · 20 unmodified lines
177172 unsigned int irq;
178173 /* Comms information. */
179174 enum blkif_protocol blk_protocol;
180− enum blkif_backend_type blk_backend_type;
181175 union blkif_back_rings blk_rings;
182176 void *blk_ring;
183177 /* The VBD attached to this interface. */
drivers/block/xen-blkback/xenbus.c+32−57
@@ -381,72 +381,49 @@ int xen_blkbk_flush_diskcache(struct xenbus_transaction xbt, · 380 unmodified lines
381381 err = xenbus_printf(xbt, dev->nodename, "feature-flush-cache",
382382 "%d", state);
383383 if (err)
384− xenbus_dev_fatal(dev, err, "writing feature-flush-cache");
384+ dev_warn(&dev->dev, "writing feature-flush-cache (%d)", err);
385385
386386 return err;
387387 }
388388
389−int xen_blkbk_discard(struct xenbus_transaction xbt, struct backend_info *be)
389+static void xen_blkbk_discard(struct xenbus_transaction xbt, struct backend_info *be)
390390 {
391391 struct xenbus_device *dev = be->dev;
392392 struct xen_blkif *blkif = be->blkif;
393− char *type;
394393 int err;
395394 int state = 0;
395+ struct block_device *bdev = be->blkif->vbd.bdev;
396+ struct request_queue *q = bdev_get_queue(bdev);
396397
397− type = xenbus_read(XBT_NIL, dev->nodename, "type", NULL);
398− if (!IS_ERR(type)) {
399− if (strncmp(type, "file", 4) == 0) {
400− state = 1;
401− blkif->blk_backend_type = BLKIF_BACKEND_FILE;
398+ if (blk_queue_discard(q)) {
399+ err = xenbus_printf(xbt, dev->nodename,
400+ "discard-granularity", "%u",
401+ q->limits.discard_granularity);
402+ if (err) {
403+ dev_warn(&dev->dev, "writing discard-granularity (%d)", err);
404+ return;
402405 }
403− if (strncmp(type, "phy", 3) == 0) {
404− struct block_device *bdev = be->blkif->vbd.bdev;
405− struct request_queue *q = bdev_get_queue(bdev);
406− if (blk_queue_discard(q)) {
407− err = xenbus_printf(xbt, dev->nodename,
408− "discard-granularity", "%u",
409− q->limits.discard_granularity);
410− if (err) {
411− xenbus_dev_fatal(dev, err,
412− "writing discard-granularity");
413− goto kfree;
414− }
415− err = xenbus_printf(xbt, dev->nodename,
416− "discard-alignment", "%u",
417− q->limits.discard_alignment);
418− if (err) {
419− xenbus_dev_fatal(dev, err,
420− "writing discard-alignment");
421− goto kfree;
422− }
423− state = 1;
424− blkif->blk_backend_type = BLKIF_BACKEND_PHY;
425− }
426− /* Optional. */
427− err = xenbus_printf(xbt, dev->nodename,
428− "discard-secure", "%d",
429− blkif->vbd.discard_secure);
430− if (err) {
431− xenbus_dev_fatal(dev, err,
432− "writting discard-secure");
433− goto kfree;
434− }
406+ err = xenbus_printf(xbt, dev->nodename,
407+ "discard-alignment", "%u",
408+ q->limits.discard_alignment);
409+ if (err) {
410+ dev_warn(&dev->dev, "writing discard-alignment (%d)", err);
411+ return;
412+ }
413+ state = 1;
414+ /* Optional. */
415+ err = xenbus_printf(xbt, dev->nodename,
416+ "discard-secure", "%d",
417+ blkif->vbd.discard_secure);
418+ if (err) {
419+ dev_warn(&dev->dev, "writing discard-secure (%d)", err);
420+ return;
435421 }
436− } else {
437− err = PTR_ERR(type);
438− xenbus_dev_fatal(dev, err, "reading type");
439− goto out;
440422 }
441−
442423 err = xenbus_printf(xbt, dev->nodename, "feature-discard",
443424 "%d", state);
444425 if (err)
445− xenbus_dev_fatal(dev, err, "writing feature-discard");
446−kfree:
447− kfree(type);
448−out:
449− return err;
426+ dev_warn(&dev->dev, "writing feature-discard (%d)", err);
450427 }
451428 int xen_blkbk_barrier(struct xenbus_transaction xbt,
452429 struct backend_info *be, int state)
@@ -457,7 +434,7 @@ int xen_blkbk_barrier(struct xenbus_transaction xbt, · 4 unmodified lines
457434 err = xenbus_printf(xbt, dev->nodename, "feature-barrier",
458435 "%d", state);
459436 if (err)
460− xenbus_dev_fatal(dev, err, "writing feature-barrier");
437+ dev_warn(&dev->dev, "writing feature-barrier (%d)", err);
461438
462439 return err;
463440 }
@@ -689,14 +666,12 @@ again: · 225 unmodified lines
689666 return;
690667 }
691668
692− err = xen_blkbk_flush_diskcache(xbt, be, be->blkif->vbd.flush_support);
693− if (err)
694− goto abort;
669+ /* If we can't advertise it is OK. */
670+ xen_blkbk_flush_diskcache(xbt, be, be->blkif->vbd.flush_support);
695671
696− err = xen_blkbk_discard(xbt, be);
672+ xen_blkbk_discard(xbt, be);
697673
698− /* If we can't advertise it is OK. */
699− err = xen_blkbk_barrier(xbt, be, be->blkif->vbd.flush_support);
674+ xen_blkbk_barrier(xbt, be, be->blkif->vbd.flush_support);
700675
701676 err = xenbus_printf(xbt, dev->nodename, "sectors", "%llu",
702677 (unsigned long long)vbd_sz(&be->blkif->vbd));
drivers/block/xen-blkfront.c+20−21
@@ -43,6 +43,7 @@ · 42 unmodified lines
4343 #include <linux/slab.h>
4444 #include <linux/mutex.h>
4545 #include <linux/scatterlist.h>
46+#include <linux/bitmap.h>
4647
4748 #include <xen/xen.h>
4849 #include <xen/xenbus.h>
@@ -81,6 +82,7 @@ static const struct block_device_operations xlvbd_block_fops; · 32 unmodified lines
8182 */
8283 struct blkfront_info
8384 {
85+ spinlock_t io_lock;
8486 struct mutex mutex;
8587 struct xenbus_device *xbdev;
8688 struct gendisk *gd;
@@ -105,8 +107,6 @@ struct blkfront_info · 18 unmodified lines
105107 int is_ready;
106108 };
107109
108−static DEFINE_SPINLOCK(blkif_io_lock);
109−
110110 static unsigned int nr_minors;
111111 static unsigned long *minors;
112112 static DEFINE_SPINLOCK(minor_lock);
@@ -177,8 +177,7 @@ static int xlbd_reserve_minors(unsigned int minor, unsigned int nr) · 64 unmodified lines
177177
178178 spin_lock(&minor_lock);
179179 if (find_next_bit(minors, end, minor) >= end) {
180− for (; minor < end; ++minor)
181− __set_bit(minor, minors);
180+ bitmap_set(minors, minor, nr);
182181 rc = 0;
183182 } else
184183 rc = -EBUSY;
@@ -193,8 +192,7 @@ static void xlbd_release_minors(unsigned int minor, unsigned int nr) · 8 unmodified lines
193192
194193 BUG_ON(end > nr_minors);
195194 spin_lock(&minor_lock);
196− for (; minor < end; ++minor)
197− __clear_bit(minor, minors);
195+ bitmap_clear(minors, minor, nr);
198196 spin_unlock(&minor_lock);
199197 }
200198
@@ -419,7 +417,7 @@ static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size) · 218 unmodified lines
419417 struct request_queue *rq;
420418 struct blkfront_info *info = gd->private_data;
421419
422− rq = blk_init_queue(do_blkif_request, &blkif_io_lock);
420+ rq = blk_init_queue(do_blkif_request, &info->io_lock);
423421 if (rq == NULL)
424422 return -1;
425423
@@ -636,14 +634,14 @@ static void xlvbd_release_gendisk(struct blkfront_info *info) · 210 unmodified lines
636634 if (info->rq == NULL)
637635 return;
638636
639− spin_lock_irqsave(&blkif_io_lock, flags);
637+ spin_lock_irqsave(&info->io_lock, flags);
640638
641639 /* No more blkif_request(). */
642640 blk_stop_queue(info->rq);
643641
644642 /* No more gnttab callback work. */
645643 gnttab_cancel_free_callback(&info->callback);
646− spin_unlock_irqrestore(&blkif_io_lock, flags);
644+ spin_unlock_irqrestore(&info->io_lock, flags);
647645
648646 /* Flush gnttab callback work. Must be done with no locks held. */
649647 flush_work_sync(&info->work);
@@ -675,16 +673,16 @@ static void blkif_restart_queue(struct work_struct *work) · 25 unmodified lines
675673 {
676674 struct blkfront_info *info = container_of(work, struct blkfront_info, work);
677675
678− spin_lock_irq(&blkif_io_lock);
676+ spin_lock_irq(&info->io_lock);
679677 if (info->connected == BLKIF_STATE_CONNECTED)
680678 kick_pending_request_queues(info);
681− spin_unlock_irq(&blkif_io_lock);
679+ spin_unlock_irq(&info->io_lock);
682680 }
683681
684682 static void blkif_free(struct blkfront_info *info, int suspend)
685683 {
686684 /* Prevent new requests being issued until we fix things up. */
687− spin_lock_irq(&blkif_io_lock);
685+ spin_lock_irq(&info->io_lock);
688686 info->connected = suspend ?
689687 BLKIF_STATE_SUSPENDED : BLKIF_STATE_DISCONNECTED;
690688 /* No more blkif_request(). */
@@ -692,7 +690,7 @@ static void blkif_free(struct blkfront_info *info, int suspend) · 1 unmodified line
692690 blk_stop_queue(info->rq);
693691 /* No more gnttab callback work. */
694692 gnttab_cancel_free_callback(&info->callback);
695− spin_unlock_irq(&blkif_io_lock);
693+ spin_unlock_irq(&info->io_lock);
696694
697695 /* Flush gnttab callback work. Must be done with no locks held. */
698696 flush_work_sync(&info->work);
@@ -728,10 +726,10 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) · 29 unmodified lines
728726 struct blkfront_info *info = (struct blkfront_info *)dev_id;
729727 int error;
730728
731− spin_lock_irqsave(&blkif_io_lock, flags);
729+ spin_lock_irqsave(&info->io_lock, flags);
732730
733731 if (unlikely(info->connected != BLKIF_STATE_CONNECTED)) {
734− spin_unlock_irqrestore(&blkif_io_lock, flags);
732+ spin_unlock_irqrestore(&info->io_lock, flags);
735733 return IRQ_HANDLED;
736734 }
737735
@@ -816,7 +814,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) · 78 unmodified lines
816814
817815 kick_pending_request_queues(info);
818816
819− spin_unlock_irqrestore(&blkif_io_lock, flags);
817+ spin_unlock_irqrestore(&info->io_lock, flags);
820818
821819 return IRQ_HANDLED;
822820 }
@@ -991,6 +989,7 @@ static int blkfront_probe(struct xenbus_device *dev, · 168 unmodified lines
991989 }
992990
993991 mutex_init(&info->mutex);
992+ spin_lock_init(&info->io_lock);
994993 info->xbdev = dev;
995994 info->vdevice = vdevice;
996995 info->connected = BLKIF_STATE_DISCONNECTED;
@@ -1068,7 +1067,7 @@ static int blkif_recover(struct blkfront_info *info) · 71 unmodified lines
10681067
10691068 xenbus_switch_state(info->xbdev, XenbusStateConnected);
10701069
1071− spin_lock_irq(&blkif_io_lock);
1070+ spin_lock_irq(&info->io_lock);
10721071
10731072 /* Now safe for us to use the shared ring */
10741073 info->connected = BLKIF_STATE_CONNECTED;
@@ -1079,7 +1078,7 @@ static int blkif_recover(struct blkfront_info *info) · 4 unmodified lines
10791078 /* Kick any other new requests queued since we resumed */
10801079 kick_pending_request_queues(info);
10811080
1082− spin_unlock_irq(&blkif_io_lock);
1081+ spin_unlock_irq(&info->io_lock);
10831082
10841083 return 0;
10851084 }
@@ -1277,10 +1276,10 @@ static void blkfront_connect(struct blkfront_info *info) · 191 unmodified lines
12771276 xenbus_switch_state(info->xbdev, XenbusStateConnected);
12781277
12791278 /* Kick pending requests. */
1280− spin_lock_irq(&blkif_io_lock);
1279+ spin_lock_irq(&info->io_lock);
12811280 info->connected = BLKIF_STATE_CONNECTED;
12821281 kick_pending_request_queues(info);
1283− spin_unlock_irq(&blkif_io_lock);
1282+ spin_unlock_irq(&info->io_lock);
12841283
12851284 add_disk(info->gd);
12861285
@@ -1410,7 +1409,6 @@ static int blkif_release(struct gendisk *disk, fmode_t mode) · 123 unmodified lines
14101409 mutex_lock(&blkfront_mutex);
14111410
14121411 bdev = bdget_disk(disk, 0);
1413− bdput(bdev);
14141412
14151413 if (bdev->bd_openers)
14161414 goto out;
@@ -1441,6 +1439,7 @@ static int blkif_release(struct gendisk *disk, fmode_t mode) · 24 unmodified lines
14411439 }
14421440
14431441 out:
1442+ bdput(bdev);
14441443 mutex_unlock(&blkfront_mutex);
14451444 return 0;
14461445 }
drivers/bluetooth/ath3k.c+4−0
@@ -72,7 +72,9 @@ static struct usb_device_id ath3k_table[] = { · 71 unmodified lines
7272
7373 /* Atheros AR3012 with sflash firmware*/
7474 { USB_DEVICE(0x0CF3, 0x3004) },
75+ { USB_DEVICE(0x0CF3, 0x311D) },
7576 { USB_DEVICE(0x13d3, 0x3375) },
77+ { USB_DEVICE(0x04CA, 0x3005) },
7678
7779 /* Atheros AR5BBU12 with sflash firmware */
7880 { USB_DEVICE(0x0489, 0xE02C) },
@@ -89,7 +91,9 @@ static struct usb_device_id ath3k_blist_tbl[] = { · 10 unmodified lines
8991
9092 /* Atheros AR3012 with sflash firmware*/
9193 { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
94+ { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
9295 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
96+ { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
9397
9498 { } /* Terminating entry */
9599 };
drivers/bluetooth/btusb.c+4−1
@@ -61,7 +61,7 @@ static struct usb_device_id btusb_table[] = { · 60 unmodified lines
6161 { USB_DEVICE_INFO(0xe0, 0x01, 0x01) },
6262
6363 /* Broadcom SoftSailing reporting vendor specific */
64− { USB_DEVICE(0x05ac, 0x21e1) },
64+ { USB_DEVICE(0x0a5c, 0x21e1) },
6565
6666 /* Apple MacBookPro 7,1 */
6767 { USB_DEVICE(0x05ac, 0x8213) },
@@ -103,6 +103,7 @@ static struct usb_device_id btusb_table[] = { · 35 unmodified lines
103103 /* Broadcom BCM20702A0 */
104104 { USB_DEVICE(0x0a5c, 0x21e3) },
105105 { USB_DEVICE(0x0a5c, 0x21e6) },
106+ { USB_DEVICE(0x0a5c, 0x21e8) },
106107 { USB_DEVICE(0x0a5c, 0x21f3) },
107108 { USB_DEVICE(0x413c, 0x8197) },
108109
@@ -129,7 +130,9 @@ static struct usb_device_id blacklist_table[] = { · 20 unmodified lines
129130
130131 /* Atheros 3012 with sflash firmware */
131132 { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
133+ { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
132134 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
135+ { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
133136
134137 /* Atheros AR5BBU12 with sflash firmware */
135138 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
drivers/bluetooth/hci_ldisc.c+1−1
@@ -299,11 +299,11 @@ static void hci_uart_tty_close(struct tty_struct *tty) · 298 unmodified lines
299299 hci_uart_close(hdev);
300300
301301 if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {
302− hu->proto->close(hu);
303302 if (hdev) {
304303 hci_unregister_dev(hdev);
305304 hci_free_dev(hdev);
306305 }
306+ hu->proto->close(hu);
307307 }
308308
309309 kfree(hu);
drivers/char/hpet.c+2−2
@@ -906,8 +906,8 @@ int hpet_alloc(struct hpet_data *hdp) · 905 unmodified lines
906906 hpetp->hp_which, hdp->hd_phys_address,
907907 hpetp->hp_ntimer > 1 ? "s" : "");
908908 for (i = 0; i < hpetp->hp_ntimer; i++)
909− printk("%s %d", i > 0 ? "," : "", hdp->hd_irq[i]);
910− printk("\n");
909+ printk(KERN_CONT "%s %d", i > 0 ? "," : "", hdp->hd_irq[i]);
910+ printk(KERN_CONT "\n");
911911
912912 temp = hpetp->hp_tick_freq;
913913 remainder = do_div(temp, 1000000);
drivers/char/random.c+8−3
@@ -1260,10 +1260,15 @@ static int proc_do_uuid(ctl_table *table, int write, · 1259 unmodified lines
12601260 uuid = table->data;
12611261 if (!uuid) {
12621262 uuid = tmp_uuid;
1263− uuid[8] = 0;
1264− }
1265− if (uuid[8] == 0)
12661263 generate_random_uuid(uuid);
1264+ } else {
1265+ static DEFINE_SPINLOCK(bootid_spinlock);
1266+
1267+ spin_lock(&bootid_spinlock);
1268+ if (!uuid[8])
1269+ generate_random_uuid(uuid);
1270+ spin_unlock(&bootid_spinlock);
1271+ }
12671272
12681273 sprintf(buf, "%pU", uuid);
12691274
drivers/clocksource/acpi_pm.c+8−16
@@ -23,7 +23,6 @@ · 22 unmodified lines
2323 #include <linux/init.h>
2424 #include <linux/pci.h>
2525 #include <linux/delay.h>
26−#include <linux/async.h>
2726 #include <asm/io.h>
2827
2928 /*
@@ -180,15 +179,17 @@ static int verify_pmtmr_rate(void) · 150 unmodified lines
180179 /* Number of reads we try to get two different values */
181180 #define ACPI_PM_READ_CHECKS 10000
182181
183−static void __init acpi_pm_clocksource_async(void *unused, async_cookie_t cookie)
182+static int __init init_acpi_pm_clocksource(void)
184183 {
185184 cycle_t value1, value2;
186185 unsigned int i, j = 0;
187186
187+ if (!pmtmr_ioport)
188+ return -ENODEV;
188189
189190 /* "verify" this timing source: */
190191 for (j = 0; j < ACPI_PM_MONOTONICITY_CHECKS; j++) {
191− usleep_range(100 * j, 100 * j + 100);
192+ udelay(100 * j);
192193 value1 = clocksource_acpi_pm.read(&clocksource_acpi_pm);
193194 for (i = 0; i < ACPI_PM_READ_CHECKS; i++) {
194195 value2 = clocksource_acpi_pm.read(&clocksource_acpi_pm);
@@ -202,34 +203,25 @@ static void __init acpi_pm_clocksource_async(void *unused, async_cookie_t cookie · 7 unmodified lines
202203 " 0x%#llx, 0x%#llx - aborting.\n",
203204 value1, value2);
204205 pmtmr_ioport = 0;
205− return;
206+ return -EINVAL;
206207 }
207208 if (i == ACPI_PM_READ_CHECKS) {
208209 printk(KERN_INFO "PM-Timer failed consistency check "
209210 " (0x%#llx) - aborting.\n", value1);
210211 pmtmr_ioport = 0;
211− return;
212+ return -ENODEV;
212213 }
213214 }
214215
215216 if (verify_pmtmr_rate() != 0){
216217 pmtmr_ioport = 0;
217− return;
218+ return -ENODEV;
218219 }
219220
220− clocksource_register_hz(&clocksource_acpi_pm,
221+ return clocksource_register_hz(&clocksource_acpi_pm,
221222 PMTMR_TICKS_PER_SEC);
222223 }
223224
224−static int __init init_acpi_pm_clocksource(void)
225−{
226− if (!pmtmr_ioport)
227− return -ENODEV;
228−
229− async_schedule(acpi_pm_clocksource_async, NULL);
230− return 0;
231−}
232−
233225 /* We use fs_initcall because we want the PCI fixups to have run
234226 * but we still need to load before device_initcall
235227 */
drivers/cpufreq/Kconfig.arm+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44
55 config ARM_OMAP2PLUS_CPUFREQ
66 bool "TI OMAP2+"
7+ depends on ARCH_OMAP2PLUS
78 default ARCH_OMAP2PLUS
89 select CPU_FREQ_TABLE
910
drivers/crypto/ixp4xx_crypto.c+1−0
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include <linux/interrupt.h>
1919 #include <linux/spinlock.h>
2020 #include <linux/gfp.h>
21+#include <linux/module.h>
2122
2223 #include <crypto/ctr.h>
2324 #include <crypto/des.h>
drivers/crypto/talitos.c+17−3
@@ -124,6 +124,9 @@ struct talitos_private { · 123 unmodified lines
124124 void __iomem *reg;
125125 int irq[2];
126126
127+ /* SEC global registers lock */
128+ spinlock_t reg_lock ____cacheline_aligned;
129+
127130 /* SEC version geometry (from device tree node) */
128131 unsigned int num_channels;
129132 unsigned int chfifo_len;
@@ -412,6 +415,7 @@ static void talitos_done_##name(unsigned long data) \ · 282 unmodified lines
412415 { \
413416 struct device *dev = (struct device *)data; \
414417 struct talitos_private *priv = dev_get_drvdata(dev); \
418+ unsigned long flags; \
415419 \
416420 if (ch_done_mask & 1) \
417421 flush_channel(dev, 0, 0, 0); \
@@ -427,8 +431,10 @@ static void talitos_done_##name(unsigned long data) \ · 9 unmodified lines
427431 out: \
428432 /* At this point, all completed channels have been processed */ \
429433 /* Unmask done interrupts for channels completed later on. */ \
434+ spin_lock_irqsave(&priv->reg_lock, flags); \
430435 setbits32(priv->reg + TALITOS_IMR, ch_done_mask); \
431436 setbits32(priv->reg + TALITOS_IMR_LO, TALITOS_IMR_LO_INIT); \
437+ spin_unlock_irqrestore(&priv->reg_lock, flags); \
432438 }
433439 DEF_TALITOS_DONE(4ch, TALITOS_ISR_4CHDONE)
434440 DEF_TALITOS_DONE(ch0_2, TALITOS_ISR_CH_0_2_DONE)
@@ -619,22 +625,28 @@ static irqreturn_t talitos_interrupt_##name(int irq, void *data) \ · 184 unmodified lines
619625 struct device *dev = data; \
620626 struct talitos_private *priv = dev_get_drvdata(dev); \
621627 u32 isr, isr_lo; \
628+ unsigned long flags; \
622629 \
630+ spin_lock_irqsave(&priv->reg_lock, flags); \
623631 isr = in_be32(priv->reg + TALITOS_ISR); \
624632 isr_lo = in_be32(priv->reg + TALITOS_ISR_LO); \
625633 /* Acknowledge interrupt */ \
626634 out_be32(priv->reg + TALITOS_ICR, isr & (ch_done_mask | ch_err_mask)); \
627635 out_be32(priv->reg + TALITOS_ICR_LO, isr_lo); \
628636 \
629− if (unlikely((isr & ~TALITOS_ISR_4CHDONE) & ch_err_mask || isr_lo)) \
630− talitos_error(dev, isr, isr_lo); \
631− else \
637+ if (unlikely(isr & ch_err_mask || isr_lo)) { \
638+ spin_unlock_irqrestore(&priv->reg_lock, flags); \
639+ talitos_error(dev, isr & ch_err_mask, isr_lo); \
640+ } \
641+ else { \
632642 if (likely(isr & ch_done_mask)) { \
633643 /* mask further done interrupts. */ \
634644 clrbits32(priv->reg + TALITOS_IMR, ch_done_mask); \
635645 /* done_task will unmask done interrupts at exit */ \
636646 tasklet_schedule(&priv->done_task[tlet]); \
637647 } \
648+ spin_unlock_irqrestore(&priv->reg_lock, flags); \
649+ } \
638650 \
639651 return (isr & (ch_done_mask | ch_err_mask) || isr_lo) ? IRQ_HANDLED : \
640652 IRQ_NONE; \
@@ -2719,6 +2731,8 @@ static int talitos_probe(struct platform_device *ofdev) · 2078 unmodified lines
27192731
27202732 priv->ofdev = ofdev;
27212733
2734+ spin_lock_init(&priv->reg_lock);
2735+
27222736 err = talitos_probe_irq(ofdev);
27232737 if (err)
27242738 goto err_out;
drivers/dma/Kconfig+2−3
@@ -91,11 +91,10 @@ config DW_DMAC · 90 unmodified lines
9191
9292 config AT_HDMAC
9393 tristate "Atmel AHB DMA support"
94− depends on ARCH_AT91SAM9RL || ARCH_AT91SAM9G45
94+ depends on ARCH_AT91
9595 select DMA_ENGINE
9696 help
97− Support the Atmel AHB DMA controller. This can be integrated in
98− chips such as the Atmel AT91SAM9RL.
97+ Support the Atmel AHB DMA controller.
9998
10099 config FSL_DMA
101100 tristate "Freescale Elo and Elo Plus DMA support"
drivers/dma/amba-pl08x.c+1−0
@@ -1429,6 +1429,7 @@ static int pl08x_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, · 1428 unmodified lines
14291429 * signal
14301430 */
14311431 release_phy_channel(plchan);
1432+ plchan->phychan_hold = 0;
14321433 }
14331434 /* Dequeue jobs and free LLIs */
14341435 if (plchan->at) {
drivers/dma/at_hdmac.c+0−4
@@ -221,10 +221,6 @@ static void atc_dostart(struct at_dma_chan *atchan, struct at_desc *first) · 220 unmodified lines
221221
222222 vdbg_dump_regs(atchan);
223223
224− /* clear any pending interrupt */
225− while (dma_readl(atdma, EBCISR))
226− cpu_relax();
227−
228224 channel_writel(atchan, SADDR, 0);
229225 channel_writel(atchan, DADDR, 0);
230226 channel_writel(atchan, CTRLA, 0);
drivers/dma/dmaengine.c+14−0
@@ -332,6 +332,20 @@ struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type) · 331 unmodified lines
332332 }
333333 EXPORT_SYMBOL(dma_find_channel);
334334
335+/*
336+ * net_dma_find_channel - find a channel for net_dma
337+ * net_dma has alignment requirements
338+ */
339+struct dma_chan *net_dma_find_channel(void)
340+{
341+ struct dma_chan *chan = dma_find_channel(DMA_MEMCPY);
342+ if (chan && !is_dma_copy_aligned(chan->device, 1, 1, 1))
343+ return NULL;
344+
345+ return chan;
346+}
347+EXPORT_SYMBOL(net_dma_find_channel);
348+
335349 /**
336350 * dma_issue_pending_all - flush all pending operations across all channels
337351 */
drivers/dma/imx-dma.c+6−3
@@ -571,11 +571,14 @@ static void imxdma_tasklet(unsigned long data) · 570 unmodified lines
571571 if (desc->desc.callback)
572572 desc->desc.callback(desc->desc.callback_param);
573573
574− dma_cookie_complete(&desc->desc);
575−
576− /* If we are dealing with a cyclic descriptor keep it on ld_active */
574+ /* If we are dealing with a cyclic descriptor keep it on ld_active
575+ * and dont mark the descripor as complete.
576+ * Only in non-cyclic cases it would be marked as complete
577+ */
577578 if (imxdma_chan_is_doing_cyclic(imxdmac))
578579 goto out;
580+ else
581+ dma_cookie_complete(&desc->desc);
579582
580583 /* Free 2D slot if it was an interleaved transfer */
581584 if (imxdmac->enabled_2d) {
drivers/dma/ioat/dma.c+8−8
@@ -546,9 +546,9 @@ void ioat_dma_unmap(struct ioat_chan_common *chan, enum dma_ctrl_flags flags, · 545 unmodified lines
546546 PCI_DMA_TODEVICE, flags, 0);
547547 }
548548
549−unsigned long ioat_get_current_completion(struct ioat_chan_common *chan)
549+dma_addr_t ioat_get_current_completion(struct ioat_chan_common *chan)
550550 {
551− unsigned long phys_complete;
551+ dma_addr_t phys_complete;
552552 u64 completion;
553553
554554 completion = *chan->completion;
@@ -569,7 +569,7 @@ unsigned long ioat_get_current_completion(struct ioat_chan_common *chan) · 14 unmodified lines
569569 }
570570
571571 bool ioat_cleanup_preamble(struct ioat_chan_common *chan,
572− unsigned long *phys_complete)
572+ dma_addr_t *phys_complete)
573573 {
574574 *phys_complete = ioat_get_current_completion(chan);
575575 if (*phys_complete == chan->last_completion)
@@ -580,14 +580,14 @@ bool ioat_cleanup_preamble(struct ioat_chan_common *chan, · 4 unmodified lines
580580 return true;
581581 }
582582
583−static void __cleanup(struct ioat_dma_chan *ioat, unsigned long phys_complete)
583+static void __cleanup(struct ioat_dma_chan *ioat, dma_addr_t phys_complete)
584584 {
585585 struct ioat_chan_common *chan = &ioat->base;
586586 struct list_head *_desc, *n;
587587 struct dma_async_tx_descriptor *tx;
588588
589− dev_dbg(to_dev(chan), "%s: phys_complete: %lx\n",
590− __func__, phys_complete);
589+ dev_dbg(to_dev(chan), "%s: phys_complete: %llx\n",
590+ __func__, (unsigned long long) phys_complete);
591591 list_for_each_safe(_desc, n, &ioat->used_desc) {
592592 struct ioat_desc_sw *desc;
593593
@@ -652,7 +652,7 @@ static void __cleanup(struct ioat_dma_chan *ioat, unsigned long phys_complete) · 58 unmodified lines
652652 static void ioat1_cleanup(struct ioat_dma_chan *ioat)
653653 {
654654 struct ioat_chan_common *chan = &ioat->base;
655− unsigned long phys_complete;
655+ dma_addr_t phys_complete;
656656
657657 prefetch(chan->completion);
658658
@@ -698,7 +698,7 @@ static void ioat1_timer_event(unsigned long data) · 39 unmodified lines
698698 mod_timer(&chan->timer, jiffies + COMPLETION_TIMEOUT);
699699 spin_unlock_bh(&ioat->desc_lock);
700700 } else if (test_bit(IOAT_COMPLETION_PENDING, &chan->state)) {
701− unsigned long phys_complete;
701+ dma_addr_t phys_complete;
702702
703703 spin_lock_bh(&ioat->desc_lock);
704704 /* if we haven't made progress and we have already
drivers/dma/ioat/dma.h+3−3
@@ -88,7 +88,7 @@ struct ioatdma_device { · 87 unmodified lines
8888 struct ioat_chan_common {
8989 struct dma_chan common;
9090 void __iomem *reg_base;
91− unsigned long last_completion;
91+ dma_addr_t last_completion;
9292 spinlock_t cleanup_lock;
9393 unsigned long state;
9494 #define IOAT_COMPLETION_PENDING 0
@@ -310,7 +310,7 @@ int __devinit ioat_dma_self_test(struct ioatdma_device *device); · 215 unmodified lines
310310 void __devexit ioat_dma_remove(struct ioatdma_device *device);
311311 struct dca_provider * __devinit ioat_dca_init(struct pci_dev *pdev,
312312 void __iomem *iobase);
313−unsigned long ioat_get_current_completion(struct ioat_chan_common *chan);
313+dma_addr_t ioat_get_current_completion(struct ioat_chan_common *chan);
314314 void ioat_init_channel(struct ioatdma_device *device,
315315 struct ioat_chan_common *chan, int idx);
316316 enum dma_status ioat_dma_tx_status(struct dma_chan *c, dma_cookie_t cookie,
@@ -318,7 +318,7 @@ enum dma_status ioat_dma_tx_status(struct dma_chan *c, dma_cookie_t cookie, · 1 unmodified line
318318 void ioat_dma_unmap(struct ioat_chan_common *chan, enum dma_ctrl_flags flags,
319319 size_t len, struct ioat_dma_descriptor *hw);
320320 bool ioat_cleanup_preamble(struct ioat_chan_common *chan,
321− unsigned long *phys_complete);
321+ dma_addr_t *phys_complete);
322322 void ioat_kobject_add(struct ioatdma_device *device, struct kobj_type *type);
323323 void ioat_kobject_del(struct ioatdma_device *device);
324324 extern const struct sysfs_ops ioat_sysfs_ops;
drivers/dma/ioat/dma_v2.c+6−6
@@ -128,7 +128,7 @@ static void ioat2_start_null_desc(struct ioat2_dma_chan *ioat) · 127 unmodified lines
128128 spin_unlock_bh(&ioat->prep_lock);
129129 }
130130
131−static void __cleanup(struct ioat2_dma_chan *ioat, unsigned long phys_complete)
131+static void __cleanup(struct ioat2_dma_chan *ioat, dma_addr_t phys_complete)
132132 {
133133 struct ioat_chan_common *chan = &ioat->base;
134134 struct dma_async_tx_descriptor *tx;
@@ -179,7 +179,7 @@ static void __cleanup(struct ioat2_dma_chan *ioat, unsigned long phys_complete) · 44 unmodified lines
179179 static void ioat2_cleanup(struct ioat2_dma_chan *ioat)
180180 {
181181 struct ioat_chan_common *chan = &ioat->base;
182− unsigned long phys_complete;
182+ dma_addr_t phys_complete;
183183
184184 spin_lock_bh(&chan->cleanup_lock);
185185 if (ioat_cleanup_preamble(chan, &phys_complete))
@@ -260,7 +260,7 @@ int ioat2_reset_sync(struct ioat_chan_common *chan, unsigned long tmo) · 74 unmodified lines
260260 static void ioat2_restart_channel(struct ioat2_dma_chan *ioat)
261261 {
262262 struct ioat_chan_common *chan = &ioat->base;
263− unsigned long phys_complete;
263+ dma_addr_t phys_complete;
264264
265265 ioat2_quiesce(chan, 0);
266266 if (ioat_cleanup_preamble(chan, &phys_complete))
@@ -275,7 +275,7 @@ void ioat2_timer_event(unsigned long data) · 8 unmodified lines
275275 struct ioat_chan_common *chan = &ioat->base;
276276
277277 if (test_bit(IOAT_COMPLETION_PENDING, &chan->state)) {
278− unsigned long phys_complete;
278+ dma_addr_t phys_complete;
279279 u64 status;
280280
281281 status = ioat_chansts(chan);
@@ -572,9 +572,9 @@ bool reshape_ring(struct ioat2_dma_chan *ioat, int order) · 290 unmodified lines
572572 */
573573 struct ioat_chan_common *chan = &ioat->base;
574574 struct dma_chan *c = &chan->common;
575− const u16 curr_size = ioat2_ring_size(ioat);
575+ const u32 curr_size = ioat2_ring_size(ioat);
576576 const u16 active = ioat2_ring_active(ioat);
577− const u16 new_size = 1 << order;
577+ const u32 new_size = 1 << order;
578578 struct ioat_ring_ent **ring;
579579 u16 i;
580580
drivers/dma/ioat/dma_v2.h+2−2
@@ -74,7 +74,7 @@ static inline struct ioat2_dma_chan *to_ioat2_chan(struct dma_chan *c) · 73 unmodified lines
7474 return container_of(chan, struct ioat2_dma_chan, base);
7575 }
7676
77−static inline u16 ioat2_ring_size(struct ioat2_dma_chan *ioat)
77+static inline u32 ioat2_ring_size(struct ioat2_dma_chan *ioat)
7878 {
7979 return 1 << ioat->alloc_order;
8080 }
@@ -91,7 +91,7 @@ static inline u16 ioat2_ring_pending(struct ioat2_dma_chan *ioat) · 10 unmodified lines
9191 return CIRC_CNT(ioat->head, ioat->issued, ioat2_ring_size(ioat));
9292 }
9393
94−static inline u16 ioat2_ring_space(struct ioat2_dma_chan *ioat)
94+static inline u32 ioat2_ring_space(struct ioat2_dma_chan *ioat)
9595 {
9696 return ioat2_ring_size(ioat) - ioat2_ring_active(ioat);
9797 }
drivers/dma/ioat/dma_v3.c+45−4
@@ -257,7 +257,7 @@ static bool desc_has_ext(struct ioat_ring_ent *desc) · 256 unmodified lines
257257 * The difference from the dma_v2.c __cleanup() is that this routine
258258 * handles extended descriptors and dma-unmapping raid operations.
259259 */
260−static void __cleanup(struct ioat2_dma_chan *ioat, unsigned long phys_complete)
260+static void __cleanup(struct ioat2_dma_chan *ioat, dma_addr_t phys_complete)
261261 {
262262 struct ioat_chan_common *chan = &ioat->base;
263263 struct ioat_ring_ent *desc;
@@ -314,7 +314,7 @@ static void __cleanup(struct ioat2_dma_chan *ioat, unsigned long phys_complete) · 50 unmodified lines
314314 static void ioat3_cleanup(struct ioat2_dma_chan *ioat)
315315 {
316316 struct ioat_chan_common *chan = &ioat->base;
317− unsigned long phys_complete;
317+ dma_addr_t phys_complete;
318318
319319 spin_lock_bh(&chan->cleanup_lock);
320320 if (ioat_cleanup_preamble(chan, &phys_complete))
@@ -333,7 +333,7 @@ static void ioat3_cleanup_event(unsigned long data) · 12 unmodified lines
333333 static void ioat3_restart_channel(struct ioat2_dma_chan *ioat)
334334 {
335335 struct ioat_chan_common *chan = &ioat->base;
336− unsigned long phys_complete;
336+ dma_addr_t phys_complete;
337337
338338 ioat2_quiesce(chan, 0);
339339 if (ioat_cleanup_preamble(chan, &phys_complete))
@@ -348,7 +348,7 @@ static void ioat3_timer_event(unsigned long data) · 8 unmodified lines
348348 struct ioat_chan_common *chan = &ioat->base;
349349
350350 if (test_bit(IOAT_COMPLETION_PENDING, &chan->state)) {
351− unsigned long phys_complete;
351+ dma_addr_t phys_complete;
352352 u64 status;
353353
354354 status = ioat_chansts(chan);
@@ -1149,6 +1149,44 @@ static int ioat3_reset_hw(struct ioat_chan_common *chan) · 794 unmodified lines
11491149 return ioat2_reset_sync(chan, msecs_to_jiffies(200));
11501150 }
11511151
1152+static bool is_jf_ioat(struct pci_dev *pdev)
1153+{
1154+ switch (pdev->device) {
1155+ case PCI_DEVICE_ID_INTEL_IOAT_JSF0:
1156+ case PCI_DEVICE_ID_INTEL_IOAT_JSF1:
1157+ case PCI_DEVICE_ID_INTEL_IOAT_JSF2:
1158+ case PCI_DEVICE_ID_INTEL_IOAT_JSF3:
1159+ case PCI_DEVICE_ID_INTEL_IOAT_JSF4:
1160+ case PCI_DEVICE_ID_INTEL_IOAT_JSF5:
1161+ case PCI_DEVICE_ID_INTEL_IOAT_JSF6:
1162+ case PCI_DEVICE_ID_INTEL_IOAT_JSF7:
1163+ case PCI_DEVICE_ID_INTEL_IOAT_JSF8:
1164+ case PCI_DEVICE_ID_INTEL_IOAT_JSF9:
1165+ return true;
1166+ default:
1167+ return false;
1168+ }
1169+}
1170+
1171+static bool is_snb_ioat(struct pci_dev *pdev)
1172+{
1173+ switch (pdev->device) {
1174+ case PCI_DEVICE_ID_INTEL_IOAT_SNB0:
1175+ case PCI_DEVICE_ID_INTEL_IOAT_SNB1:
1176+ case PCI_DEVICE_ID_INTEL_IOAT_SNB2:
1177+ case PCI_DEVICE_ID_INTEL_IOAT_SNB3:
1178+ case PCI_DEVICE_ID_INTEL_IOAT_SNB4:
1179+ case PCI_DEVICE_ID_INTEL_IOAT_SNB5:
1180+ case PCI_DEVICE_ID_INTEL_IOAT_SNB6:
1181+ case PCI_DEVICE_ID_INTEL_IOAT_SNB7:
1182+ case PCI_DEVICE_ID_INTEL_IOAT_SNB8:
1183+ case PCI_DEVICE_ID_INTEL_IOAT_SNB9:
1184+ return true;
1185+ default:
1186+ return false;
1187+ }
1188+}
1189+
11521190 int __devinit ioat3_dma_probe(struct ioatdma_device *device, int dca)
11531191 {
11541192 struct pci_dev *pdev = device->pdev;
@@ -1169,6 +1207,9 @@ int __devinit ioat3_dma_probe(struct ioatdma_device *device, int dca) · 14 unmodified lines
11691207 dma->device_alloc_chan_resources = ioat2_alloc_chan_resources;
11701208 dma->device_free_chan_resources = ioat2_free_chan_resources;
11711209
1210+ if (is_jf_ioat(pdev) || is_snb_ioat(pdev))
1211+ dma->copy_align = 6;
1212+
11721213 dma_cap_set(DMA_INTERRUPT, dma->cap_mask);
11731214 dma->device_prep_dma_interrupt = ioat3_prep_interrupt_lock;
11741215
drivers/dma/iop-adma.c+2−2
@@ -1252,8 +1252,8 @@ iop_adma_pq_zero_sum_self_test(struct iop_adma_device *device) · 1251 unmodified lines
12521252 struct page **pq_hw = &pq[IOP_ADMA_NUM_SRC_TEST+2];
12531253 /* address conversion buffers (dma_map / page_address) */
12541254 void *pq_sw[IOP_ADMA_NUM_SRC_TEST+2];
1255− dma_addr_t pq_src[IOP_ADMA_NUM_SRC_TEST];
1256− dma_addr_t pq_dest[2];
1255+ dma_addr_t pq_src[IOP_ADMA_NUM_SRC_TEST+2];
1256+ dma_addr_t *pq_dest = &pq_src[IOP_ADMA_NUM_SRC_TEST];
12571257
12581258 int i;
12591259 struct dma_async_tx_descriptor *tx;
drivers/dma/mxs-dma.c+3−7
@@ -201,10 +201,6 @@ static struct mxs_dma_chan *to_mxs_dma_chan(struct dma_chan *chan) · 200 unmodified lines
201201
202202 static dma_cookie_t mxs_dma_tx_submit(struct dma_async_tx_descriptor *tx)
203203 {
204− struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(tx->chan);
205−
206− mxs_dma_enable_chan(mxs_chan);
207−
208204 return dma_cookie_assign(tx);
209205 }
210206
@@ -558,9 +554,9 @@ static enum dma_status mxs_dma_tx_status(struct dma_chan *chan, · 347 unmodified lines
558554
559555 static void mxs_dma_issue_pending(struct dma_chan *chan)
560556 {
561− /*
562− * Nothing to do. We only have a single descriptor.
563− */
557+ struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
558+
559+ mxs_dma_enable_chan(mxs_chan);
564560 }
565561
566562 static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma)
drivers/dma/pl330.c+15−10
@@ -2225,12 +2225,9 @@ static inline void free_desc_list(struct list_head *list) · 2224 unmodified lines
22252225 {
22262226 struct dma_pl330_dmac *pdmac;
22272227 struct dma_pl330_desc *desc;
2228− struct dma_pl330_chan *pch;
2228+ struct dma_pl330_chan *pch = NULL;
22292229 unsigned long flags;
22302230
2231− if (list_empty(list))
2232− return;
2233−
22342231 /* Finish off the work list */
22352232 list_for_each_entry(desc, list, node) {
22362233 dma_async_tx_callback callback;
@@ -2247,6 +2244,10 @@ static inline void free_desc_list(struct list_head *list) · 10 unmodified lines
22472244 desc->pchan = NULL;
22482245 }
22492246
2247+ /* pch will be unset if list was empty */
2248+ if (!pch)
2249+ return;
2250+
22502251 pdmac = pch->dmac;
22512252
22522253 spin_lock_irqsave(&pdmac->pool_lock, flags);
@@ -2257,12 +2258,9 @@ static inline void free_desc_list(struct list_head *list) · 4 unmodified lines
22572258 static inline void handle_cyclic_desc_list(struct list_head *list)
22582259 {
22592260 struct dma_pl330_desc *desc;
2260− struct dma_pl330_chan *pch;
2261+ struct dma_pl330_chan *pch = NULL;
22612262 unsigned long flags;
22622263
2263− if (list_empty(list))
2264− return;
2265−
22662264 list_for_each_entry(desc, list, node) {
22672265 dma_async_tx_callback callback;
22682266
@@ -2274,6 +2272,10 @@ static inline void handle_cyclic_desc_list(struct list_head *list) · 5 unmodified lines
22742272 callback(desc->txd.callback_param);
22752273 }
22762274
2275+ /* pch will be unset if list was empty */
2276+ if (!pch)
2277+ return;
2278+
22772279 spin_lock_irqsave(&pch->lock, flags);
22782280 list_splice_tail_init(list, &pch->work_list);
22792281 spin_unlock_irqrestore(&pch->lock, flags);
@@ -2926,8 +2928,11 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) · 646 unmodified lines
29262928 INIT_LIST_HEAD(&pd->channels);
29272929
29282930 /* Initialize channel parameters */
2929− num_chan = max(pdat ? pdat->nr_valid_peri : (u8)pi->pcfg.num_peri,
2930− (u8)pi->pcfg.num_chan);
2931+ if (pdat)
2932+ num_chan = max_t(int, pdat->nr_valid_peri, pi->pcfg.num_chan);
2933+ else
2934+ num_chan = max_t(int, pi->pcfg.num_peri, pi->pcfg.num_chan);
2935+
29312936 pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL);
29322937
29332938 for (i = 0; i < num_chan; i++) {
drivers/dma/ste_dma40.c+201−122
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include <linux/pm_runtime.h>
1919 #include <linux/err.h>
2020 #include <linux/amba/bus.h>
21+#include <linux/regulator/consumer.h>
2122
2223 #include <plat/ste_dma40.h>
2324
@@ -68,6 +69,22 @@ enum d40_command { · 44 unmodified lines
6869 D40_DMA_SUSPENDED = 3
6970 };
7071
72+/*
73+ * enum d40_events - The different Event Enables for the event lines.
74+ *
75+ * @D40_DEACTIVATE_EVENTLINE: De-activate Event line, stopping the logical chan.
76+ * @D40_ACTIVATE_EVENTLINE: Activate the Event line, to start a logical chan.
77+ * @D40_SUSPEND_REQ_EVENTLINE: Requesting for suspending a event line.
78+ * @D40_ROUND_EVENTLINE: Status check for event line.
79+ */
80+
81+enum d40_events {
82+ D40_DEACTIVATE_EVENTLINE = 0,
83+ D40_ACTIVATE_EVENTLINE = 1,
84+ D40_SUSPEND_REQ_EVENTLINE = 2,
85+ D40_ROUND_EVENTLINE = 3
86+};
87+
7188 /*
7289 * These are the registers that has to be saved and later restored
7390 * when the DMA hw is powered off.
@@ -870,8 +887,8 @@ static void d40_save_restore_registers(struct d40_base *base, bool save) · 796 unmodified lines
870887 }
871888 #endif
872889
873−static int d40_channel_execute_command(struct d40_chan *d40c,
874− enum d40_command command)
890+static int __d40_execute_command_phy(struct d40_chan *d40c,
891+ enum d40_command command)
875892 {
876893 u32 status;
877894 int i;
@@ -880,6 +897,12 @@ static int d40_channel_execute_command(struct d40_chan *d40c, · 2 unmodified lines
880897 unsigned long flags;
881898 u32 wmask;
882899
900+ if (command == D40_DMA_STOP) {
901+ ret = __d40_execute_command_phy(d40c, D40_DMA_SUSPEND_REQ);
902+ if (ret)
903+ return ret;
904+ }
905+
883906 spin_lock_irqsave(&d40c->base->execmd_lock, flags);
884907
885908 if (d40c->phy_chan->num % 2 == 0)
@@ -973,67 +996,109 @@ static void d40_term_all(struct d40_chan *d40c) · 87 unmodified lines
973996 }
974997
975998 d40c->pending_tx = 0;
976− d40c->busy = false;
977999 }
9781000
979−static void __d40_config_set_event(struct d40_chan *d40c, bool enable,
980− u32 event, int reg)
1001+static void __d40_config_set_event(struct d40_chan *d40c,
1002+ enum d40_events event_type, u32 event,
1003+ int reg)
9811004 {
9821005 void __iomem *addr = chan_base(d40c) + reg;
9831006 int tries;
1007+ u32 status;
1008+
1009+ switch (event_type) {
1010+
1011+ case D40_DEACTIVATE_EVENTLINE:
9841012
985− if (!enable) {
9861013 writel((D40_DEACTIVATE_EVENTLINE << D40_EVENTLINE_POS(event))
9871014 | ~D40_EVENTLINE_MASK(event), addr);
988− return;
989− }
1015+ break;
1016+
1017+ case D40_SUSPEND_REQ_EVENTLINE:
1018+ status = (readl(addr) & D40_EVENTLINE_MASK(event)) >>
1019+ D40_EVENTLINE_POS(event);
1020+
1021+ if (status == D40_DEACTIVATE_EVENTLINE ||
1022+ status == D40_SUSPEND_REQ_EVENTLINE)
1023+ break;
9901024
1025+ writel((D40_SUSPEND_REQ_EVENTLINE << D40_EVENTLINE_POS(event))
1026+ | ~D40_EVENTLINE_MASK(event), addr);
1027+
1028+ for (tries = 0 ; tries < D40_SUSPEND_MAX_IT; tries++) {
1029+
1030+ status = (readl(addr) & D40_EVENTLINE_MASK(event)) >>
1031+ D40_EVENTLINE_POS(event);
1032+
1033+ cpu_relax();
1034+ /*
1035+ * Reduce the number of bus accesses while
1036+ * waiting for the DMA to suspend.
1037+ */
1038+ udelay(3);
1039+
1040+ if (status == D40_DEACTIVATE_EVENTLINE)
1041+ break;
1042+ }
1043+
1044+ if (tries == D40_SUSPEND_MAX_IT) {
1045+ chan_err(d40c,
1046+ "unable to stop the event_line chl %d (log: %d)"
1047+ "status %x\n", d40c->phy_chan->num,
1048+ d40c->log_num, status);
1049+ }
1050+ break;
1051+
1052+ case D40_ACTIVATE_EVENTLINE:
9911053 /*
9921054 * The hardware sometimes doesn't register the enable when src and dst
9931055 * event lines are active on the same logical channel. Retry to ensure
9941056 * it does. Usually only one retry is sufficient.
9951057 */
996− tries = 100;
997− while (--tries) {
998− writel((D40_ACTIVATE_EVENTLINE << D40_EVENTLINE_POS(event))
999− | ~D40_EVENTLINE_MASK(event), addr);
1058+ tries = 100;
1059+ while (--tries) {
1060+ writel((D40_ACTIVATE_EVENTLINE <<
1061+ D40_EVENTLINE_POS(event)) |
1062+ ~D40_EVENTLINE_MASK(event), addr);
10001063
1001− if (readl(addr) & D40_EVENTLINE_MASK(event))
1002− break;
1003− }
1064+ if (readl(addr) & D40_EVENTLINE_MASK(event))
1065+ break;
1066+ }
10041067
1005− if (tries != 99)
1006− dev_dbg(chan2dev(d40c),
1007− "[%s] workaround enable S%cLNK (%d tries)\n",
1008− __func__, reg == D40_CHAN_REG_SSLNK ? 'S' : 'D',
1009− 100 - tries);
1068+ if (tries != 99)
1069+ dev_dbg(chan2dev(d40c),
1070+ "[%s] workaround enable S%cLNK (%d tries)\n",
1071+ __func__, reg == D40_CHAN_REG_SSLNK ? 'S' : 'D',
1072+ 100 - tries);
10101073
1011− WARN_ON(!tries);
1012−}
1074+ WARN_ON(!tries);
1075+ break;
10131076
1014−static void d40_config_set_event(struct d40_chan *d40c, bool do_enable)
1015−{
1016− unsigned long flags;
1077+ case D40_ROUND_EVENTLINE:
1078+ BUG();
1079+ break;
10171080
1018− spin_lock_irqsave(&d40c->phy_chan->lock, flags);
1081+ }
1082+}
10191083
1084+static void d40_config_set_event(struct d40_chan *d40c,
1085+ enum d40_events event_type)
1086+{
10201087 /* Enable event line connected to device (or memcpy) */
10211088 if ((d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) ||
10221089 (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_PERIPH)) {
10231090 u32 event = D40_TYPE_TO_EVENT(d40c->dma_cfg.src_dev_type);
10241091
1025− __d40_config_set_event(d40c, do_enable, event,
1092+ __d40_config_set_event(d40c, event_type, event,
10261093 D40_CHAN_REG_SSLNK);
10271094 }
10281095
10291096 if (d40c->dma_cfg.dir != STEDMA40_PERIPH_TO_MEM) {
10301097 u32 event = D40_TYPE_TO_EVENT(d40c->dma_cfg.dst_dev_type);
10311098
1032− __d40_config_set_event(d40c, do_enable, event,
1099+ __d40_config_set_event(d40c, event_type, event,
10331100 D40_CHAN_REG_SDLNK);
10341101 }
1035−
1036− spin_unlock_irqrestore(&d40c->phy_chan->lock, flags);
10371102 }
10381103
10391104 static u32 d40_chan_has_events(struct d40_chan *d40c)
@@ -1047,6 +1112,64 @@ static u32 d40_chan_has_events(struct d40_chan *d40c) · 7 unmodified lines
10471112 return val;
10481113 }
10491114
1115+static int
1116+__d40_execute_command_log(struct d40_chan *d40c, enum d40_command command)
1117+{
1118+ unsigned long flags;
1119+ int ret = 0;
1120+ u32 active_status;
1121+ void __iomem *active_reg;
1122+
1123+ if (d40c->phy_chan->num % 2 == 0)
1124+ active_reg = d40c->base->virtbase + D40_DREG_ACTIVE;
1125+ else
1126+ active_reg = d40c->base->virtbase + D40_DREG_ACTIVO;
1127+
1128+
1129+ spin_lock_irqsave(&d40c->phy_chan->lock, flags);
1130+
1131+ switch (command) {
1132+ case D40_DMA_STOP:
1133+ case D40_DMA_SUSPEND_REQ:
1134+
1135+ active_status = (readl(active_reg) &
1136+ D40_CHAN_POS_MASK(d40c->phy_chan->num)) >>
1137+ D40_CHAN_POS(d40c->phy_chan->num);
1138+
1139+ if (active_status == D40_DMA_RUN)
1140+ d40_config_set_event(d40c, D40_SUSPEND_REQ_EVENTLINE);
1141+ else
1142+ d40_config_set_event(d40c, D40_DEACTIVATE_EVENTLINE);
1143+
1144+ if (!d40_chan_has_events(d40c) && (command == D40_DMA_STOP))
1145+ ret = __d40_execute_command_phy(d40c, command);
1146+
1147+ break;
1148+
1149+ case D40_DMA_RUN:
1150+
1151+ d40_config_set_event(d40c, D40_ACTIVATE_EVENTLINE);
1152+ ret = __d40_execute_command_phy(d40c, command);
1153+ break;
1154+
1155+ case D40_DMA_SUSPENDED:
1156+ BUG();
1157+ break;
1158+ }
1159+
1160+ spin_unlock_irqrestore(&d40c->phy_chan->lock, flags);
1161+ return ret;
1162+}
1163+
1164+static int d40_channel_execute_command(struct d40_chan *d40c,
1165+ enum d40_command command)
1166+{
1167+ if (chan_is_logical(d40c))
1168+ return __d40_execute_command_log(d40c, command);
1169+ else
1170+ return __d40_execute_command_phy(d40c, command);
1171+}
1172+
10501173 static u32 d40_get_prmo(struct d40_chan *d40c)
10511174 {
10521175 static const unsigned int phy_map[] = {
@@ -1149,15 +1272,7 @@ static int d40_pause(struct d40_chan *d40c) · 96 unmodified lines
11491272 spin_lock_irqsave(&d40c->lock, flags);
11501273
11511274 res = d40_channel_execute_command(d40c, D40_DMA_SUSPEND_REQ);
1152− if (res == 0) {
1153− if (chan_is_logical(d40c)) {
1154− d40_config_set_event(d40c, false);
1155− /* Resume the other logical channels if any */
1156− if (d40_chan_has_events(d40c))
1157− res = d40_channel_execute_command(d40c,
1158− D40_DMA_RUN);
1159− }
1160− }
1275+
11611276 pm_runtime_mark_last_busy(d40c->base->dev);
11621277 pm_runtime_put_autosuspend(d40c->base->dev);
11631278 spin_unlock_irqrestore(&d40c->lock, flags);
@@ -1174,45 +1289,17 @@ static int d40_resume(struct d40_chan *d40c) · 10 unmodified lines
11741289
11751290 spin_lock_irqsave(&d40c->lock, flags);
11761291 pm_runtime_get_sync(d40c->base->dev);
1177− if (d40c->base->rev == 0)
1178− if (chan_is_logical(d40c)) {
1179− res = d40_channel_execute_command(d40c,
1180− D40_DMA_SUSPEND_REQ);
1181− goto no_suspend;
1182− }
11831292
11841293 /* If bytes left to transfer or linked tx resume job */
1185− if (d40_residue(d40c) || d40_tx_is_linked(d40c)) {
1186−
1187− if (chan_is_logical(d40c))
1188− d40_config_set_event(d40c, true);
1189−
1294+ if (d40_residue(d40c) || d40_tx_is_linked(d40c))
11901295 res = d40_channel_execute_command(d40c, D40_DMA_RUN);
1191− }
11921296
1193−no_suspend:
11941297 pm_runtime_mark_last_busy(d40c->base->dev);
11951298 pm_runtime_put_autosuspend(d40c->base->dev);
11961299 spin_unlock_irqrestore(&d40c->lock, flags);
11971300 return res;
11981301 }
11991302
1200−static int d40_terminate_all(struct d40_chan *chan)
1201−{
1202− unsigned long flags;
1203− int ret = 0;
1204−
1205− ret = d40_pause(chan);
1206− if (!ret && chan_is_physical(chan))
1207− ret = d40_channel_execute_command(chan, D40_DMA_STOP);
1208−
1209− spin_lock_irqsave(&chan->lock, flags);
1210− d40_term_all(chan);
1211− spin_unlock_irqrestore(&chan->lock, flags);
1212−
1213− return ret;
1214−}
1215−
12161303 static dma_cookie_t d40_tx_submit(struct dma_async_tx_descriptor *tx)
12171304 {
12181305 struct d40_chan *d40c = container_of(tx->chan,
@@ -1232,20 +1319,6 @@ static dma_cookie_t d40_tx_submit(struct dma_async_tx_descriptor *tx) · 13 unmodified lines
12321319
12331320 static int d40_start(struct d40_chan *d40c)
12341321 {
1235− if (d40c->base->rev == 0) {
1236− int err;
1237−
1238− if (chan_is_logical(d40c)) {
1239− err = d40_channel_execute_command(d40c,
1240− D40_DMA_SUSPEND_REQ);
1241− if (err)
1242− return err;
1243− }
1244− }
1245−
1246− if (chan_is_logical(d40c))
1247− d40_config_set_event(d40c, true);
1248−
12491322 return d40_channel_execute_command(d40c, D40_DMA_RUN);
12501323 }
12511324
@@ -1258,10 +1331,10 @@ static struct d40_desc *d40_queue_start(struct d40_chan *d40c) · 6 unmodified lines
12581331 d40d = d40_first_queued(d40c);
12591332
12601333 if (d40d != NULL) {
1261− if (!d40c->busy)
1334+ if (!d40c->busy) {
12621335 d40c->busy = true;
1263−
1264− pm_runtime_get_sync(d40c->base->dev);
1336+ pm_runtime_get_sync(d40c->base->dev);
1337+ }
12651338
12661339 /* Remove from queue */
12671340 d40_desc_remove(d40d);
@@ -1388,8 +1461,8 @@ static void dma_tasklet(unsigned long data) · 120 unmodified lines
13881461
13891462 return;
13901463
1391− err:
1392− /* Rescue manoeuvre if receiving double interrupts */
1464+err:
1465+ /* Rescue manouver if receiving double interrupts */
13931466 if (d40c->pending_tx > 0)
13941467 d40c->pending_tx--;
13951468 spin_unlock_irqrestore(&d40c->lock, flags);
@@ -1770,7 +1843,6 @@ static int d40_config_memcpy(struct d40_chan *d40c) · 374 unmodified lines
17701843 return 0;
17711844 }
17721845
1773−
17741846 static int d40_free_dma(struct d40_chan *d40c)
17751847 {
17761848
@@ -1806,43 +1878,18 @@ static int d40_free_dma(struct d40_chan *d40c) · 29 unmodified lines
18061878 }
18071879
18081880 pm_runtime_get_sync(d40c->base->dev);
1809− res = d40_channel_execute_command(d40c, D40_DMA_SUSPEND_REQ);
1881+ res = d40_channel_execute_command(d40c, D40_DMA_STOP);
18101882 if (res) {
1811− chan_err(d40c, "suspend failed\n");
1883+ chan_err(d40c, "stop failed\n");
18121884 goto out;
18131885 }
18141886
1815− if (chan_is_logical(d40c)) {
1816− /* Release logical channel, deactivate the event line */
1887+ d40_alloc_mask_free(phy, is_src, chan_is_logical(d40c) ? event : 0);
18171888
1818− d40_config_set_event(d40c, false);
1889+ if (chan_is_logical(d40c))
18191890 d40c->base->lookup_log_chans[d40c->log_num] = NULL;
1820−
1821− /*
1822− * Check if there are more logical allocation
1823− * on this phy channel.
1824− */
1825− if (!d40_alloc_mask_free(phy, is_src, event)) {
1826− /* Resume the other logical channels if any */
1827− if (d40_chan_has_events(d40c)) {
1828− res = d40_channel_execute_command(d40c,
1829− D40_DMA_RUN);
1830− if (res)
1831− chan_err(d40c,
1832− "Executing RUN command\n");
1833− }
1834− goto out;
1835− }
1836− } else {
1837− (void) d40_alloc_mask_free(phy, is_src, 0);
1838− }
1839−
1840− /* Release physical channel */
1841− res = d40_channel_execute_command(d40c, D40_DMA_STOP);
1842− if (res) {
1843− chan_err(d40c, "Failed to stop channel\n");
1844− goto out;
1845− }
1891+ else
1892+ d40c->base->lookup_phy_chans[phy->num] = NULL;
18461893
18471894 if (d40c->busy) {
18481895 pm_runtime_mark_last_busy(d40c->base->dev);
@@ -1852,7 +1899,6 @@ static int d40_free_dma(struct d40_chan *d40c) · 3 unmodified lines
18521899 d40c->busy = false;
18531900 d40c->phy_chan = NULL;
18541901 d40c->configured = false;
1855− d40c->base->lookup_phy_chans[phy->num] = NULL;
18561902 out:
18571903
18581904 pm_runtime_mark_last_busy(d40c->base->dev);
@@ -2070,7 +2116,7 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src, · 211 unmodified lines
20702116 if (sg_next(&sg_src[sg_len - 1]) == sg_src)
20712117 desc->cyclic = true;
20722118
2073− if (direction != DMA_NONE) {
2119+ if (direction != DMA_TRANS_NONE) {
20742120 dma_addr_t dev_addr = d40_get_dev_addr(chan, direction);
20752121
20762122 if (direction == DMA_DEV_TO_MEM)
@@ -2371,6 +2417,31 @@ static void d40_issue_pending(struct dma_chan *chan) · 294 unmodified lines
23712417 spin_unlock_irqrestore(&d40c->lock, flags);
23722418 }
23732419
2420+static void d40_terminate_all(struct dma_chan *chan)
2421+{
2422+ unsigned long flags;
2423+ struct d40_chan *d40c = container_of(chan, struct d40_chan, chan);
2424+ int ret;
2425+
2426+ spin_lock_irqsave(&d40c->lock, flags);
2427+
2428+ pm_runtime_get_sync(d40c->base->dev);
2429+ ret = d40_channel_execute_command(d40c, D40_DMA_STOP);
2430+ if (ret)
2431+ chan_err(d40c, "Failed to stop channel\n");
2432+
2433+ d40_term_all(d40c);
2434+ pm_runtime_mark_last_busy(d40c->base->dev);
2435+ pm_runtime_put_autosuspend(d40c->base->dev);
2436+ if (d40c->busy) {
2437+ pm_runtime_mark_last_busy(d40c->base->dev);
2438+ pm_runtime_put_autosuspend(d40c->base->dev);
2439+ }
2440+ d40c->busy = false;
2441+
2442+ spin_unlock_irqrestore(&d40c->lock, flags);
2443+}
2444+
23742445 static int
23752446 dma40_config_to_halfchannel(struct d40_chan *d40c,
23762447 struct stedma40_half_channel_info *info,
@@ -2551,7 +2622,8 @@ static int d40_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, · 174 unmodified lines
25512622
25522623 switch (cmd) {
25532624 case DMA_TERMINATE_ALL:
2554− return d40_terminate_all(d40c);
2625+ d40_terminate_all(chan);
2626+ return 0;
25552627 case DMA_PAUSE:
25562628 return d40_pause(d40c);
25572629 case DMA_RESUME:
@@ -2908,6 +2980,12 @@ static struct d40_base * __init d40_hw_detect_init(struct platform_device *pdev) · 350 unmodified lines
29082980 dev_info(&pdev->dev, "hardware revision: %d @ 0x%x\n",
29092981 rev, res->start);
29102982
2983+ if (rev < 2) {
2984+ d40_err(&pdev->dev, "hardware revision: %d is not supported",
2985+ rev);
2986+ goto failure;
2987+ }
2988+
29112989 plat_data = pdev->dev.platform_data;
29122990
29132991 /* Count the number of logical channels in use */
@@ -2998,6 +3076,7 @@ failure: · 84 unmodified lines
29983076
29993077 if (base) {
30003078 kfree(base->lcla_pool.alloc_map);
3079+ kfree(base->reg_val_backup_chan);
30013080 kfree(base->lookup_log_chans);
30023081 kfree(base->lookup_phy_chans);
30033082 kfree(base->phy_res);
drivers/dma/ste_dma40_ll.h+0−2
@@ -62,8 +62,6 @@ · 61 unmodified lines
6262 #define D40_SREG_ELEM_LOG_LIDX_MASK (0xFF << D40_SREG_ELEM_LOG_LIDX_POS)
6363
6464 /* Link register */
65−#define D40_DEACTIVATE_EVENTLINE 0x0
66−#define D40_ACTIVATE_EVENTLINE 0x1
6765 #define D40_EVENTLINE_POS(i) (2 * i)
6866 #define D40_EVENTLINE_MASK(i) (0x3 << D40_EVENTLINE_POS(i))
6967
drivers/gpio/Kconfig+1−1
@@ -430,7 +430,7 @@ config GPIO_ML_IOH · 429 unmodified lines
430430
431431 config GPIO_SODAVILLE
432432 bool "Intel Sodaville GPIO support"
433− depends on X86 && PCI && OF && BROKEN
433+ depends on X86 && PCI && OF
434434 select GPIO_GENERIC
435435 select GENERIC_IRQ_CHIP
436436 help
drivers/gpio/gpio-adp5588.c+1−1
@@ -252,7 +252,7 @@ static irqreturn_t adp5588_irq_handler(int irq, void *devid) · 251 unmodified lines
252252 if (ret < 0)
253253 memset(dev->irq_stat, 0, ARRAY_SIZE(dev->irq_stat));
254254
255− for (bank = 0; bank <= ADP5588_BANK(ADP5588_MAXGPIO);
255+ for (bank = 0, bit = 0; bank <= ADP5588_BANK(ADP5588_MAXGPIO);
256256 bank++, bit = 0) {
257257 pending = dev->irq_stat[bank] & dev->irq_mask[bank];
258258
drivers/gpio/gpio-pxa.c+19−2
@@ -64,6 +64,7 @@ struct pxa_gpio_chip { · 63 unmodified lines
6464 unsigned long irq_mask;
6565 unsigned long irq_edge_rise;
6666 unsigned long irq_edge_fall;
67+ int (*set_wake)(unsigned int gpio, unsigned int on);
6768
6869 #ifdef CONFIG_PM
6970 unsigned long saved_gplr;
@@ -269,7 +270,8 @@ static void pxa_gpio_set(struct gpio_chip *chip, unsigned offset, int value) · 199 unmodified lines
269270 (value ? GPSR_OFFSET : GPCR_OFFSET));
270271 }
271272
272−static int __devinit pxa_init_gpio_chip(int gpio_end)
273+static int __devinit pxa_init_gpio_chip(int gpio_end,
274+ int (*set_wake)(unsigned int, unsigned int))
273275 {
274276 int i, gpio, nbanks = gpio_to_bank(gpio_end) + 1;
275277 struct pxa_gpio_chip *chips;
@@ -285,6 +287,7 @@ static int __devinit pxa_init_gpio_chip(int gpio_end) · 9 unmodified lines
285287
286288 sprintf(chips[i].label, "gpio-%d", i);
287289 chips[i].regbase = gpio_reg_base + BANK_OFF(i);
290+ chips[i].set_wake = set_wake;
288291
289292 c->base = gpio;
290293 c->label = chips[i].label;
@@ -412,6 +415,17 @@ static void pxa_mask_muxed_gpio(struct irq_data *d) · 121 unmodified lines
412415 writel_relaxed(gfer, c->regbase + GFER_OFFSET);
413416 }
414417
418+static int pxa_gpio_set_wake(struct irq_data *d, unsigned int on)
419+{
420+ int gpio = pxa_irq_to_gpio(d->irq);
421+ struct pxa_gpio_chip *c = gpio_to_pxachip(gpio);
422+
423+ if (c->set_wake)
424+ return c->set_wake(gpio, on);
425+ else
426+ return 0;
427+}
428+
415429 static void pxa_unmask_muxed_gpio(struct irq_data *d)
416430 {
417431 int gpio = pxa_irq_to_gpio(d->irq);
@@ -427,6 +441,7 @@ static struct irq_chip pxa_muxed_gpio_chip = { · 9 unmodified lines
427441 .irq_mask = pxa_mask_muxed_gpio,
428442 .irq_unmask = pxa_unmask_muxed_gpio,
429443 .irq_set_type = pxa_gpio_irq_type,
444+ .irq_set_wake = pxa_gpio_set_wake,
430445 };
431446
432447 static int pxa_gpio_nums(void)
@@ -471,6 +486,7 @@ static int __devinit pxa_gpio_probe(struct platform_device *pdev) · 38 unmodified lines
471486 struct pxa_gpio_chip *c;
472487 struct resource *res;
473488 struct clk *clk;
489+ struct pxa_gpio_platform_data *info;
474490 int gpio, irq, ret;
475491 int irq0 = 0, irq1 = 0, irq_mux, gpio_offset = 0;
476492
@@ -516,7 +532,8 @@ static int __devinit pxa_gpio_probe(struct platform_device *pdev) · 39 unmodified lines
516532 }
517533
518534 /* Initialize GPIO chips */
519− pxa_init_gpio_chip(pxa_last_gpio);
535+ info = dev_get_platdata(&pdev->dev);
536+ pxa_init_gpio_chip(pxa_last_gpio, info ? info->gpio_set_wake : NULL);
520537
521538 /* clear all GPIO edge detects */
522539 for_each_gpio_chip(gpio, c) {
drivers/gpio/gpio-samsung.c+8−8
@@ -2382,8 +2382,8 @@ static struct samsung_gpio_chip exynos4_gpios_3[] = { · 2381 unmodified lines
23822382 #endif
23832383 };
23842384
2385−static struct samsung_gpio_chip exynos5_gpios_1[] = {
23862385 #ifdef CONFIG_ARCH_EXYNOS5
2386+static struct samsung_gpio_chip exynos5_gpios_1[] = {
23872387 {
23882388 .chip = {
23892389 .base = EXYNOS5_GPA0(0),
@@ -2541,11 +2541,11 @@ static struct samsung_gpio_chip exynos5_gpios_1[] = { · 151 unmodified lines
25412541 .to_irq = samsung_gpiolib_to_irq,
25422542 },
25432543 },
2544−#endif
25452544 };
2545+#endif
25462546
2547−static struct samsung_gpio_chip exynos5_gpios_2[] = {
25482547 #ifdef CONFIG_ARCH_EXYNOS5
2548+static struct samsung_gpio_chip exynos5_gpios_2[] = {
25492549 {
25502550 .chip = {
25512551 .base = EXYNOS5_GPE0(0),
@@ -2602,11 +2602,11 @@ static struct samsung_gpio_chip exynos5_gpios_2[] = { · 50 unmodified lines
26022602
26032603 },
26042604 },
2605−#endif
26062605 };
2606+#endif
26072607
2608−static struct samsung_gpio_chip exynos5_gpios_3[] = {
26092608 #ifdef CONFIG_ARCH_EXYNOS5
2609+static struct samsung_gpio_chip exynos5_gpios_3[] = {
26102610 {
26112611 .chip = {
26122612 .base = EXYNOS5_GPV0(0),
@@ -2638,11 +2638,11 @@ static struct samsung_gpio_chip exynos5_gpios_3[] = { · 25 unmodified lines
26382638 .label = "GPV4",
26392639 },
26402640 },
2641−#endif
26422641 };
2642+#endif
26432643
2644−static struct samsung_gpio_chip exynos5_gpios_4[] = {
26452644 #ifdef CONFIG_ARCH_EXYNOS5
2645+static struct samsung_gpio_chip exynos5_gpios_4[] = {
26462646 {
26472647 .chip = {
26482648 .base = EXYNOS5_GPZ(0),
@@ -2650,8 +2650,8 @@ static struct samsung_gpio_chip exynos5_gpios_4[] = { · 1 unmodified line
26502650 .label = "GPZ",
26512651 },
26522652 },
2653−#endif
26542653 };
2654+#endif
26552655
26562656
26572657 #if defined(CONFIG_ARCH_EXYNOS) && defined(CONFIG_OF)
drivers/gpio/gpio-sodaville.c+10−13
@@ -41,7 +41,7 @@ · 40 unmodified lines
4141 struct sdv_gpio_chip_data {
4242 int irq_base;
4343 void __iomem *gpio_pub_base;
44− struct irq_domain id;
44+ struct irq_domain *id;
4545 struct irq_chip_generic *gc;
4646 struct bgpio_chip bgpio;
4747 };
@@ -51,10 +51,9 @@ static int sdv_gpio_pub_set_type(struct irq_data *d, unsigned int type) · 3 unmodified lines
5151 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
5252 struct sdv_gpio_chip_data *sd = gc->private;
5353 void __iomem *type_reg;
54− u32 irq_offs = d->irq - sd->irq_base;
5554 u32 reg;
5655
57− if (irq_offs < 8)
56+ if (d->hwirq < 8)
5857 type_reg = sd->gpio_pub_base + GPIT1R0;
5958 else
6059 type_reg = sd->gpio_pub_base + GPIT1R1;
@@ -63,11 +62,11 @@ static int sdv_gpio_pub_set_type(struct irq_data *d, unsigned int type) · 2 unmodified lines
6362
6463 switch (type) {
6564 case IRQ_TYPE_LEVEL_HIGH:
66− reg &= ~BIT(4 * (irq_offs % 8));
65+ reg &= ~BIT(4 * (d->hwirq % 8));
6766 break;
6867
6968 case IRQ_TYPE_LEVEL_LOW:
70− reg |= BIT(4 * (irq_offs % 8));
69+ reg |= BIT(4 * (d->hwirq % 8));
7170 break;
7271
7372 default:
@@ -91,7 +90,7 @@ static irqreturn_t sdv_gpio_pub_irq_handler(int irq, void *data) · 17 unmodified lines
9190 u32 irq_bit = __fls(irq_stat);
9291
9392 irq_stat &= ~BIT(irq_bit);
94− generic_handle_irq(sd->irq_base + irq_bit);
93+ generic_handle_irq(irq_find_mapping(sd->id, irq_bit));
9594 }
9695
9796 return IRQ_HANDLED;
@@ -127,7 +126,7 @@ static int sdv_xlate(struct irq_domain *h, struct device_node *node, · 29 unmodified lines
127126 }
128127
129128 static struct irq_domain_ops irq_domain_sdv_ops = {
130− .dt_translate = sdv_xlate,
129+ .xlate = sdv_xlate,
131130 };
132131
133132 static __devinit int sdv_register_irqsupport(struct sdv_gpio_chip_data *sd,
@@ -149,10 +148,6 @@ static __devinit int sdv_register_irqsupport(struct sdv_gpio_chip_data *sd, · 15 unmodified lines
149148 if (ret)
150149 goto out_free_desc;
151150
152− sd->id.irq_base = sd->irq_base;
153− sd->id.of_node = of_node_get(pdev->dev.of_node);
154− sd->id.ops = &irq_domain_sdv_ops;
155−
156151 /*
157152 * This gpio irq controller latches level irqs. Testing shows that if
158153 * we unmask & ACK the IRQ before the source of the interrupt is gone
@@ -179,7 +174,10 @@ static __devinit int sdv_register_irqsupport(struct sdv_gpio_chip_data *sd, · 20 unmodified lines
179174 IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST,
180175 IRQ_LEVEL | IRQ_NOPROBE);
181176
182− irq_domain_add(&sd->id);
177+ sd->id = irq_domain_add_legacy(pdev->dev.of_node, SDV_NUM_PUB_GPIOS,
178+ sd->irq_base, 0, &irq_domain_sdv_ops, sd);
179+ if (!sd->id)
180+ goto out_free_irq;
183181 return 0;
184182 out_free_irq:
185183 free_irq(pdev->irq, sd);
@@ -260,7 +258,6 @@ static void sdv_gpio_remove(struct pci_dev *pdev) · 74 unmodified lines
260258 {
261259 struct sdv_gpio_chip_data *sd = pci_get_drvdata(pdev);
262260
263− irq_domain_del(&sd->id);
264261 free_irq(pdev->irq, sd);
265262 irq_free_descs(sd->irq_base, SDV_NUM_PUB_GPIOS);
266263
drivers/gpu/drm/drm_bufs.c+4−8
@@ -1510,8 +1510,8 @@ int drm_freebufs(struct drm_device *dev, void *data, · 1509 unmodified lines
15101510 * \param arg pointer to a drm_buf_map structure.
15111511 * \return zero on success or a negative number on failure.
15121512 *
1513− * Maps the AGP, SG or PCI buffer region with do_mmap(), and copies information
1514− * about each buffer into user space. For PCI buffers, it calls do_mmap() with
1513+ * Maps the AGP, SG or PCI buffer region with vm_mmap(), and copies information
1514+ * about each buffer into user space. For PCI buffers, it calls vm_mmap() with
15151515 * offset equal to 0, which drm_mmap() interpretes as PCI buffers and calls
15161516 * drm_mmap_dma().
15171517 */
@@ -1553,18 +1553,14 @@ int drm_mapbufs(struct drm_device *dev, void *data, · 35 unmodified lines
15531553 retcode = -EINVAL;
15541554 goto done;
15551555 }
1556− down_write(&current->mm->mmap_sem);
1557− virtual = do_mmap(file_priv->filp, 0, map->size,
1556+ virtual = vm_mmap(file_priv->filp, 0, map->size,
15581557 PROT_READ | PROT_WRITE,
15591558 MAP_SHARED,
15601559 token);
1561− up_write(&current->mm->mmap_sem);
15621560 } else {
1563− down_write(&current->mm->mmap_sem);
1564− virtual = do_mmap(file_priv->filp, 0, dma->byte_count,
1561+ virtual = vm_mmap(file_priv->filp, 0, dma->byte_count,
15651562 PROT_READ | PROT_WRITE,
15661563 MAP_SHARED, 0);
1567− up_write(&current->mm->mmap_sem);
15681564 }
15691565 if (virtual > -1024UL) {
15701566 /* Real error */
drivers/gpu/drm/drm_crtc.c+6−4
@@ -3335,10 +3335,12 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, · 3334 unmodified lines
33353335
33363336 ret = crtc->funcs->page_flip(crtc, fb, e);
33373337 if (ret) {
3338− spin_lock_irqsave(&dev->event_lock, flags);
3339− file_priv->event_space += sizeof e->event;
3340− spin_unlock_irqrestore(&dev->event_lock, flags);
3341− kfree(e);
3338+ if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) {
3339+ spin_lock_irqsave(&dev->event_lock, flags);
3340+ file_priv->event_space += sizeof e->event;
3341+ spin_unlock_irqrestore(&dev->event_lock, flags);
3342+ kfree(e);
3343+ }
33423344 }
33433345
33443346 out:
drivers/gpu/drm/drm_fops.c+3−3
@@ -507,12 +507,12 @@ int drm_release(struct inode *inode, struct file *filp) · 506 unmodified lines
507507
508508 drm_events_release(file_priv);
509509
510− if (dev->driver->driver_features & DRIVER_GEM)
511− drm_gem_release(dev, file_priv);
512−
513510 if (dev->driver->driver_features & DRIVER_MODESET)
514511 drm_fb_release(file_priv);
515512
513+ if (dev->driver->driver_features & DRIVER_GEM)
514+ drm_gem_release(dev, file_priv);
515+
516516 mutex_lock(&dev->ctxlist_mutex);
517517 if (!list_empty(&dev->ctxlist)) {
518518 struct drm_ctx_list *pos, *n;
drivers/gpu/drm/drm_usb.c+5−1
@@ -1,6 +1,6 @@
11 #include "drmP.h"
22 #include <linux/usb.h>
3−#include <linux/export.h>
3+#include <linux/module.h>
44
55 int drm_get_usb_dev(struct usb_interface *interface,
66 const struct usb_device_id *id,
@@ -114,3 +114,7 @@ void drm_usb_exit(struct drm_driver *driver, · 107 unmodified lines
114114 usb_deregister(udriver);
115115 }
116116 EXPORT_SYMBOL(drm_usb_exit);
117+
118+MODULE_AUTHOR("David Airlie");
119+MODULE_DESCRIPTION("USB DRM support");
120+MODULE_LICENSE("GPL and additional rights");
drivers/gpu/drm/exynos/exynos_drm_buf.c+14−33
@@ -34,14 +34,14 @@ · 33 unmodified lines
3434 static int lowlevel_buffer_allocate(struct drm_device *dev,
3535 unsigned int flags, struct exynos_drm_gem_buf *buf)
3636 {
37− dma_addr_t start_addr, end_addr;
37+ dma_addr_t start_addr;
3838 unsigned int npages, page_size, i = 0;
3939 struct scatterlist *sgl;
4040 int ret = 0;
4141
4242 DRM_DEBUG_KMS("%s\n", __FILE__);
4343
44− if (flags & EXYNOS_BO_NONCONTIG) {
44+ if (IS_NONCONTIG_BUFFER(flags)) {
4545 DRM_DEBUG_KMS("not support allocation type.\n");
4646 return -EINVAL;
4747 }
@@ -52,13 +52,13 @@ static int lowlevel_buffer_allocate(struct drm_device *dev, · 4 unmodified lines
5252 }
5353
5454 if (buf->size >= SZ_1M) {
55− npages = (buf->size >> SECTION_SHIFT) + 1;
55+ npages = buf->size >> SECTION_SHIFT;
5656 page_size = SECTION_SIZE;
5757 } else if (buf->size >= SZ_64K) {
58− npages = (buf->size >> 16) + 1;
58+ npages = buf->size >> 16;
5959 page_size = SZ_64K;
6060 } else {
61− npages = (buf->size >> PAGE_SHIFT) + 1;
61+ npages = buf->size >> PAGE_SHIFT;
6262 page_size = PAGE_SIZE;
6363 }
6464
@@ -76,26 +76,13 @@ static int lowlevel_buffer_allocate(struct drm_device *dev, · 11 unmodified lines
7676 return -ENOMEM;
7777 }
7878
79− buf->kvaddr = dma_alloc_writecombine(dev->dev, buf->size,
80− &buf->dma_addr, GFP_KERNEL);
81− if (!buf->kvaddr) {
82− DRM_ERROR("failed to allocate buffer.\n");
83− ret = -ENOMEM;
84− goto err1;
85− }
86−
87− start_addr = buf->dma_addr;
88− end_addr = buf->dma_addr + buf->size;
89−
90− buf->pages = kzalloc(sizeof(struct page) * npages, GFP_KERNEL);
91− if (!buf->pages) {
92− DRM_ERROR("failed to allocate pages.\n");
93− ret = -ENOMEM;
94− goto err2;
95− }
96−
97− start_addr = buf->dma_addr;
98− end_addr = buf->dma_addr + buf->size;
79+ buf->kvaddr = dma_alloc_writecombine(dev->dev, buf->size,
80+ &buf->dma_addr, GFP_KERNEL);
81+ if (!buf->kvaddr) {
82+ DRM_ERROR("failed to allocate buffer.\n");
83+ ret = -ENOMEM;
84+ goto err1;
85+ }
9986
10087 buf->pages = kzalloc(sizeof(struct page) * npages, GFP_KERNEL);
10188 if (!buf->pages) {
@@ -105,23 +92,17 @@ static int lowlevel_buffer_allocate(struct drm_device *dev, · 3 unmodified lines
10592 }
10693
10794 sgl = buf->sgt->sgl;
95+ start_addr = buf->dma_addr;
10896
10997 while (i < npages) {
11098 buf->pages[i] = phys_to_page(start_addr);
11199 sg_set_page(sgl, buf->pages[i], page_size, 0);
112100 sg_dma_address(sgl) = start_addr;
113101 start_addr += page_size;
114− if (end_addr - start_addr < page_size)
115− break;
116102 sgl = sg_next(sgl);
117103 i++;
118104 }
119105
120− buf->pages[i] = phys_to_page(start_addr);
121−
122− sgl = sg_next(sgl);
123− sg_set_page(sgl, buf->pages[i+1], end_addr - start_addr, 0);
124−
125106 DRM_DEBUG_KMS("vaddr(0x%lx), dma_addr(0x%lx), size(0x%lx)\n",
126107 (unsigned long)buf->kvaddr,
127108 (unsigned long)buf->dma_addr,
@@ -150,7 +131,7 @@ static void lowlevel_buffer_deallocate(struct drm_device *dev, · 22 unmodified lines
150131 * non-continuous memory would be released by exynos
151132 * gem framework.
152133 */
153− if (flags & EXYNOS_BO_NONCONTIG) {
134+ if (IS_NONCONTIG_BUFFER(flags)) {
154135 DRM_DEBUG_KMS("not support allocation type.\n");
155136 return;
156137 }
drivers/gpu/drm/exynos/exynos_drm_core.c+8−6
@@ -54,16 +54,18 @@ static int exynos_drm_subdrv_probe(struct drm_device *dev, · 53 unmodified lines
5454 *
5555 * P.S. note that this driver is considered for modularization.
5656 */
57− ret = subdrv->probe(dev, subdrv->manager.dev);
57+ ret = subdrv->probe(dev, subdrv->dev);
5858 if (ret)
5959 return ret;
6060 }
6161
62− if (subdrv->is_local)
62+ if (!subdrv->manager)
6363 return 0;
6464
65+ subdrv->manager->dev = subdrv->dev;
66+
6567 /* create and initialize a encoder for this sub driver. */
66− encoder = exynos_drm_encoder_create(dev, &subdrv->manager,
68+ encoder = exynos_drm_encoder_create(dev, subdrv->manager,
6769 (1 << MAX_CRTC) - 1);
6870 if (!encoder) {
6971 DRM_ERROR("failed to create encoder\n");
@@ -186,7 +188,7 @@ int exynos_drm_subdrv_open(struct drm_device *dev, struct drm_file *file) · 116 unmodified lines
186188
187189 list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list) {
188190 if (subdrv->open) {
189− ret = subdrv->open(dev, subdrv->manager.dev, file);
191+ ret = subdrv->open(dev, subdrv->dev, file);
190192 if (ret)
191193 goto err;
192194 }
@@ -197,7 +199,7 @@ int exynos_drm_subdrv_open(struct drm_device *dev, struct drm_file *file) · 4 unmodified lines
197199 err:
198200 list_for_each_entry_reverse(subdrv, &subdrv->list, list) {
199201 if (subdrv->close)
200− subdrv->close(dev, subdrv->manager.dev, file);
202+ subdrv->close(dev, subdrv->dev, file);
201203 }
202204 return ret;
203205 }
@@ -209,7 +211,7 @@ void exynos_drm_subdrv_close(struct drm_device *dev, struct drm_file *file) · 5 unmodified lines
209211
210212 list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list) {
211213 if (subdrv->close)
212− subdrv->close(dev, subdrv->manager.dev, file);
214+ subdrv->close(dev, subdrv->dev, file);
213215 }
214216 }
215217 EXPORT_SYMBOL_GPL(exynos_drm_subdrv_close);
drivers/gpu/drm/exynos/exynos_drm_drv.h+5−5
@@ -225,24 +225,25 @@ struct exynos_drm_private { · 224 unmodified lines
225225 * Exynos drm sub driver structure.
226226 *
227227 * @list: sub driver has its own list object to register to exynos drm driver.
228+ * @dev: pointer to device object for subdrv device driver.
228229 * @drm_dev: pointer to drm_device and this pointer would be set
229230 * when sub driver calls exynos_drm_subdrv_register().
230− * @is_local: appear encoder and connector disrelated device.
231+ * @manager: subdrv has its own manager to control a hardware appropriately
232+ * and we can access a hardware drawing on this manager.
231233 * @probe: this callback would be called by exynos drm driver after
232234 * subdrv is registered to it.
233235 * @remove: this callback is used to release resources created
234236 * by probe callback.
235237 * @open: this would be called with drm device file open.
236238 * @close: this would be called with drm device file close.
237− * @manager: subdrv has its own manager to control a hardware appropriately
238− * and we can access a hardware drawing on this manager.
239239 * @encoder: encoder object owned by this sub driver.
240240 * @connector: connector object owned by this sub driver.
241241 */
242242 struct exynos_drm_subdrv {
243243 struct list_head list;
244+ struct device *dev;
244245 struct drm_device *drm_dev;
245− bool is_local;
246+ struct exynos_drm_manager *manager;
246247
247248 int (*probe)(struct drm_device *drm_dev, struct device *dev);
248249 void (*remove)(struct drm_device *dev);
@@ -251,7 +252,6 @@ struct exynos_drm_subdrv { · 2 unmodified lines
251252 void (*close)(struct drm_device *drm_dev, struct device *dev,
252253 struct drm_file *file);
253254
254− struct exynos_drm_manager manager;
255255 struct drm_encoder *encoder;
256256 struct drm_connector *connector;
257257 };
drivers/gpu/drm/exynos/exynos_drm_fimd.c+12−8
@@ -172,7 +172,7 @@ static void fimd_dpms(struct device *subdrv_dev, int mode) · 171 unmodified lines
172172 static void fimd_apply(struct device *subdrv_dev)
173173 {
174174 struct fimd_context *ctx = get_fimd_context(subdrv_dev);
175− struct exynos_drm_manager *mgr = &ctx->subdrv.manager;
175+ struct exynos_drm_manager *mgr = ctx->subdrv.manager;
176176 struct exynos_drm_manager_ops *mgr_ops = mgr->ops;
177177 struct exynos_drm_overlay_ops *ovl_ops = mgr->overlay_ops;
178178 struct fimd_win_data *win_data;
@@ -577,6 +577,13 @@ static struct exynos_drm_overlay_ops fimd_overlay_ops = { · 398 unmodified lines
577577 .disable = fimd_win_disable,
578578 };
579579
580+static struct exynos_drm_manager fimd_manager = {
581+ .pipe = -1,
582+ .ops = &fimd_manager_ops,
583+ .overlay_ops = &fimd_overlay_ops,
584+ .display_ops = &fimd_display_ops,
585+};
586+
580587 static void fimd_finish_pageflip(struct drm_device *drm_dev, int crtc)
581588 {
582589 struct exynos_drm_private *dev_priv = drm_dev->dev_private;
@@ -628,7 +635,7 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id) · 45 unmodified lines
628635 struct fimd_context *ctx = (struct fimd_context *)dev_id;
629636 struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
630637 struct drm_device *drm_dev = subdrv->drm_dev;
631− struct exynos_drm_manager *manager = &subdrv->manager;
638+ struct exynos_drm_manager *manager = subdrv->manager;
632639 u32 val;
633640
634641 val = readl(ctx->regs + VIDINTCON1);
@@ -744,7 +751,7 @@ static void fimd_clear_win(struct fimd_context *ctx, int win) · 109 unmodified lines
744751 static int fimd_power_on(struct fimd_context *ctx, bool enable)
745752 {
746753 struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
747− struct device *dev = subdrv->manager.dev;
754+ struct device *dev = subdrv->dev;
748755
749756 DRM_DEBUG_KMS("%s\n", __FILE__);
750757
@@ -867,13 +874,10 @@ static int __devinit fimd_probe(struct platform_device *pdev) · 116 unmodified lines
867874
868875 subdrv = &ctx->subdrv;
869876
877+ subdrv->dev = dev;
878+ subdrv->manager = &fimd_manager;
870879 subdrv->probe = fimd_subdrv_probe;
871880 subdrv->remove = fimd_subdrv_remove;
872− subdrv->manager.pipe = -1;
873− subdrv->manager.ops = &fimd_manager_ops;
874− subdrv->manager.overlay_ops = &fimd_overlay_ops;
875− subdrv->manager.display_ops = &fimd_display_ops;
876− subdrv->manager.dev = dev;
877881
878882 mutex_init(&ctx->lock);
879883
drivers/gpu/drm/exynos/exynos_drm_gem.c+42−37
@@ -56,9 +56,28 @@ static unsigned int convert_to_vm_err_msg(int msg) · 55 unmodified lines
5656 return out_msg;
5757 }
5858
59−static unsigned int mask_gem_flags(unsigned int flags)
59+static int check_gem_flags(unsigned int flags)
6060 {
61− return flags &= EXYNOS_BO_NONCONTIG;
61+ if (flags & ~(EXYNOS_BO_MASK)) {
62+ DRM_ERROR("invalid flags.\n");
63+ return -EINVAL;
64+ }
65+
66+ return 0;
67+}
68+
69+static unsigned long roundup_gem_size(unsigned long size, unsigned int flags)
70+{
71+ if (!IS_NONCONTIG_BUFFER(flags)) {
72+ if (size >= SZ_1M)
73+ return roundup(size, SECTION_SIZE);
74+ else if (size >= SZ_64K)
75+ return roundup(size, SZ_64K);
76+ else
77+ goto out;
78+ }
79+out:
80+ return roundup(size, PAGE_SIZE);
6281 }
6382
6483 static struct page **exynos_gem_get_pages(struct drm_gem_object *obj,
@@ -130,22 +149,12 @@ static int exynos_drm_gem_map_pages(struct drm_gem_object *obj, · 65 unmodified lines
130149 unsigned long pfn;
131150
132151 if (exynos_gem_obj->flags & EXYNOS_BO_NONCONTIG) {
133− unsigned long usize = buf->size;
134−
135152 if (!buf->pages)
136153 return -EINTR;
137154
138− while (usize > 0) {
139− pfn = page_to_pfn(buf->pages[page_offset++]);
140− vm_insert_mixed(vma, f_vaddr, pfn);
141− f_vaddr += PAGE_SIZE;
142− usize -= PAGE_SIZE;
143− }
144−
145− return 0;
146− }
147−
148− pfn = (buf->dma_addr >> PAGE_SHIFT) + page_offset;
155+ pfn = page_to_pfn(buf->pages[page_offset++]);
156+ } else
157+ pfn = (buf->dma_addr >> PAGE_SHIFT) + page_offset;
149158
150159 return vm_insert_mixed(vma, f_vaddr, pfn);
151160 }
@@ -319,10 +328,17 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev, · 167 unmodified lines
319328 struct exynos_drm_gem_buf *buf;
320329 int ret;
321330
322− size = roundup(size, PAGE_SIZE);
323− DRM_DEBUG_KMS("%s: size = 0x%lx\n", __FILE__, size);
331+ if (!size) {
332+ DRM_ERROR("invalid size.\n");
333+ return ERR_PTR(-EINVAL);
334+ }
335+
336+ size = roundup_gem_size(size, flags);
337+ DRM_DEBUG_KMS("%s\n", __FILE__);
324338
325− flags = mask_gem_flags(flags);
339+ ret = check_gem_flags(flags);
340+ if (ret)
341+ return ERR_PTR(ret);
326342
327343 buf = exynos_drm_init_buf(dev, size);
328344 if (!buf)
@@ -331,7 +347,7 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev, · 2 unmodified lines
331347 exynos_gem_obj = exynos_drm_gem_init(dev, size);
332348 if (!exynos_gem_obj) {
333349 ret = -ENOMEM;
334− goto err;
350+ goto err_fini_buf;
335351 }
336352
337353 exynos_gem_obj->buffer = buf;
@@ -347,18 +363,19 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev, · 9 unmodified lines
347363 ret = exynos_drm_gem_get_pages(&exynos_gem_obj->base);
348364 if (ret < 0) {
349365 drm_gem_object_release(&exynos_gem_obj->base);
350− goto err;
366+ goto err_fini_buf;
351367 }
352368 } else {
353369 ret = exynos_drm_alloc_buf(dev, buf, flags);
354370 if (ret < 0) {
355371 drm_gem_object_release(&exynos_gem_obj->base);
356− goto err;
372+ goto err_fini_buf;
357373 }
358374 }
359375
360376 return exynos_gem_obj;
361−err:
377+
378+err_fini_buf:
362379 exynos_drm_fini_buf(dev, buf);
363380 return ERR_PTR(ret);
364381 }
@@ -497,6 +514,8 @@ static int exynos_drm_gem_mmap_buffer(struct file *filp, · 132 unmodified lines
497514 if (!buffer->pages)
498515 return -EINVAL;
499516
517+ vma->vm_flags |= VM_MIXEDMAP;
518+
500519 do {
501520 ret = vm_insert_page(vma, uaddr, buffer->pages[i++]);
502521 if (ret) {
@@ -554,10 +573,8 @@ int exynos_drm_gem_mmap_ioctl(struct drm_device *dev, void *data, · 51 unmodified lines
554573 obj->filp->f_op = &exynos_drm_gem_fops;
555574 obj->filp->private_data = obj;
556575
557− down_write(&current->mm->mmap_sem);
558− addr = do_mmap(obj->filp, 0, args->size,
576+ addr = vm_mmap(obj->filp, 0, args->size,
559577 PROT_READ | PROT_WRITE, MAP_SHARED, 0);
560− up_write(&current->mm->mmap_sem);
561578
562579 drm_gem_object_unreference_unlocked(obj);
563580
@@ -685,7 +702,6 @@ int exynos_drm_gem_dumb_destroy(struct drm_file *file_priv, · 121 unmodified lines
685702 int exynos_drm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
686703 {
687704 struct drm_gem_object *obj = vma->vm_private_data;
688− struct exynos_drm_gem_obj *exynos_gem_obj = to_exynos_gem_obj(obj);
689705 struct drm_device *dev = obj->dev;
690706 unsigned long f_vaddr;
691707 pgoff_t page_offset;
@@ -697,21 +713,10 @@ int exynos_drm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) · 5 unmodified lines
697713
698714 mutex_lock(&dev->struct_mutex);
699715
700− /*
701− * allocate all pages as desired size if user wants to allocate
702− * physically non-continuous memory.
703− */
704− if (exynos_gem_obj->flags & EXYNOS_BO_NONCONTIG) {
705− ret = exynos_drm_gem_get_pages(obj);
706− if (ret < 0)
707− goto err;
708− }
709−
710716 ret = exynos_drm_gem_map_pages(obj, vma, f_vaddr, page_offset);
711717 if (ret < 0)
712718 DRM_ERROR("failed to map pages.\n");
713719
714−err:
715720 mutex_unlock(&dev->struct_mutex);
716721
717722 return convert_to_vm_err_msg(ret);
drivers/gpu/drm/exynos/exynos_drm_gem.h+2−0
@@ -29,6 +29,8 @@ · 28 unmodified lines
2929 #define to_exynos_gem_obj(x) container_of(x,\
3030 struct exynos_drm_gem_obj, base)
3131
32+#define IS_NONCONTIG_BUFFER(f) (f & EXYNOS_BO_NONCONTIG)
33+
3234 /*
3335 * exynos drm gem buffer structure.
3436 *
drivers/gpu/drm/exynos/exynos_drm_hdmi.c+48−59
@@ -30,9 +30,8 @@ · 29 unmodified lines
3030 struct drm_hdmi_context, subdrv);
3131
3232 /* these callback points shoud be set by specific drivers. */
33−static struct exynos_hdmi_display_ops *hdmi_display_ops;
34−static struct exynos_hdmi_manager_ops *hdmi_manager_ops;
35−static struct exynos_hdmi_overlay_ops *hdmi_overlay_ops;
33+static struct exynos_hdmi_ops *hdmi_ops;
34+static struct exynos_mixer_ops *mixer_ops;
3635
3736 struct drm_hdmi_context {
3837 struct exynos_drm_subdrv subdrv;
@@ -40,31 +39,20 @@ struct drm_hdmi_context { · 1 unmodified line
4039 struct exynos_drm_hdmi_context *mixer_ctx;
4140 };
4241
43−void exynos_drm_display_ops_register(struct exynos_hdmi_display_ops
44− *display_ops)
42+void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops)
4543 {
4644 DRM_DEBUG_KMS("%s\n", __FILE__);
4745
48− if (display_ops)
49− hdmi_display_ops = display_ops;
46+ if (ops)
47+ hdmi_ops = ops;
5048 }
5149
52−void exynos_drm_manager_ops_register(struct exynos_hdmi_manager_ops
53− *manager_ops)
50+void exynos_mixer_ops_register(struct exynos_mixer_ops *ops)
5451 {
5552 DRM_DEBUG_KMS("%s\n", __FILE__);
5653
57− if (manager_ops)
58− hdmi_manager_ops = manager_ops;
59−}
60−
61−void exynos_drm_overlay_ops_register(struct exynos_hdmi_overlay_ops
62− *overlay_ops)
63−{
64− DRM_DEBUG_KMS("%s\n", __FILE__);
65−
66− if (overlay_ops)
67− hdmi_overlay_ops = overlay_ops;
54+ if (ops)
55+ mixer_ops = ops;
6856 }
6957
7058 static bool drm_hdmi_is_connected(struct device *dev)
@@ -73,8 +61,8 @@ static bool drm_hdmi_is_connected(struct device *dev) · 2 unmodified lines
7361
7462 DRM_DEBUG_KMS("%s\n", __FILE__);
7563
76− if (hdmi_display_ops && hdmi_display_ops->is_connected)
77− return hdmi_display_ops->is_connected(ctx->hdmi_ctx->ctx);
64+ if (hdmi_ops && hdmi_ops->is_connected)
65+ return hdmi_ops->is_connected(ctx->hdmi_ctx->ctx);
7866
7967 return false;
8068 }
@@ -86,9 +74,9 @@ static int drm_hdmi_get_edid(struct device *dev, · 5 unmodified lines
8674
8775 DRM_DEBUG_KMS("%s\n", __FILE__);
8876
89− if (hdmi_display_ops && hdmi_display_ops->get_edid)
90− return hdmi_display_ops->get_edid(ctx->hdmi_ctx->ctx,
91− connector, edid, len);
77+ if (hdmi_ops && hdmi_ops->get_edid)
78+ return hdmi_ops->get_edid(ctx->hdmi_ctx->ctx, connector, edid,
79+ len);
9280
9381 return 0;
9482 }
@@ -99,9 +87,8 @@ static int drm_hdmi_check_timing(struct device *dev, void *timing) · 4 unmodified lines
9987
10088 DRM_DEBUG_KMS("%s\n", __FILE__);
10189
102− if (hdmi_display_ops && hdmi_display_ops->check_timing)
103− return hdmi_display_ops->check_timing(ctx->hdmi_ctx->ctx,
104− timing);
90+ if (hdmi_ops && hdmi_ops->check_timing)
91+ return hdmi_ops->check_timing(ctx->hdmi_ctx->ctx, timing);
10592
10693 return 0;
10794 }
@@ -112,8 +99,8 @@ static int drm_hdmi_power_on(struct device *dev, int mode) · 4 unmodified lines
11299
113100 DRM_DEBUG_KMS("%s\n", __FILE__);
114101
115− if (hdmi_display_ops && hdmi_display_ops->power_on)
116− return hdmi_display_ops->power_on(ctx->hdmi_ctx->ctx, mode);
102+ if (hdmi_ops && hdmi_ops->power_on)
103+ return hdmi_ops->power_on(ctx->hdmi_ctx->ctx, mode);
117104
118105 return 0;
119106 }
@@ -130,13 +117,13 @@ static int drm_hdmi_enable_vblank(struct device *subdrv_dev) · 10 unmodified lines
130117 {
131118 struct drm_hdmi_context *ctx = to_context(subdrv_dev);
132119 struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
133− struct exynos_drm_manager *manager = &subdrv->manager;
120+ struct exynos_drm_manager *manager = subdrv->manager;
134121
135122 DRM_DEBUG_KMS("%s\n", __FILE__);
136123
137− if (hdmi_overlay_ops && hdmi_overlay_ops->enable_vblank)
138− return hdmi_overlay_ops->enable_vblank(ctx->mixer_ctx->ctx,
139− manager->pipe);
124+ if (mixer_ops && mixer_ops->enable_vblank)
125+ return mixer_ops->enable_vblank(ctx->mixer_ctx->ctx,
126+ manager->pipe);
140127
141128 return 0;
142129 }
@@ -147,8 +134,8 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev) · 4 unmodified lines
147134
148135 DRM_DEBUG_KMS("%s\n", __FILE__);
149136
150− if (hdmi_overlay_ops && hdmi_overlay_ops->disable_vblank)
151− return hdmi_overlay_ops->disable_vblank(ctx->mixer_ctx->ctx);
137+ if (mixer_ops && mixer_ops->disable_vblank)
138+ return mixer_ops->disable_vblank(ctx->mixer_ctx->ctx);
152139 }
153140
154141 static void drm_hdmi_mode_fixup(struct device *subdrv_dev,
@@ -160,9 +147,9 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev, · 5 unmodified lines
160147
161148 DRM_DEBUG_KMS("%s\n", __FILE__);
162149
163− if (hdmi_manager_ops && hdmi_manager_ops->mode_fixup)
164− hdmi_manager_ops->mode_fixup(ctx->hdmi_ctx->ctx, connector,
165− mode, adjusted_mode);
150+ if (hdmi_ops && hdmi_ops->mode_fixup)
151+ hdmi_ops->mode_fixup(ctx->hdmi_ctx->ctx, connector, mode,
152+ adjusted_mode);
166153 }
167154
168155 static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode)
@@ -171,8 +158,8 @@ static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode) · 2 unmodified lines
171158
172159 DRM_DEBUG_KMS("%s\n", __FILE__);
173160
174− if (hdmi_manager_ops && hdmi_manager_ops->mode_set)
175− hdmi_manager_ops->mode_set(ctx->hdmi_ctx->ctx, mode);
161+ if (hdmi_ops && hdmi_ops->mode_set)
162+ hdmi_ops->mode_set(ctx->hdmi_ctx->ctx, mode);
176163 }
177164
178165 static void drm_hdmi_get_max_resol(struct device *subdrv_dev,
@@ -182,9 +169,8 @@ static void drm_hdmi_get_max_resol(struct device *subdrv_dev, · 3 unmodified lines
182169
183170 DRM_DEBUG_KMS("%s\n", __FILE__);
184171
185− if (hdmi_manager_ops && hdmi_manager_ops->get_max_resol)
186− hdmi_manager_ops->get_max_resol(ctx->hdmi_ctx->ctx, width,
187− height);
172+ if (hdmi_ops && hdmi_ops->get_max_resol)
173+ hdmi_ops->get_max_resol(ctx->hdmi_ctx->ctx, width, height);
188174 }
189175
190176 static void drm_hdmi_commit(struct device *subdrv_dev)
@@ -193,8 +179,8 @@ static void drm_hdmi_commit(struct device *subdrv_dev) · 2 unmodified lines
193179
194180 DRM_DEBUG_KMS("%s\n", __FILE__);
195181
196− if (hdmi_manager_ops && hdmi_manager_ops->commit)
197− hdmi_manager_ops->commit(ctx->hdmi_ctx->ctx);
182+ if (hdmi_ops && hdmi_ops->commit)
183+ hdmi_ops->commit(ctx->hdmi_ctx->ctx);
198184 }
199185
200186 static void drm_hdmi_dpms(struct device *subdrv_dev, int mode)
@@ -209,8 +195,8 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode) · 8 unmodified lines
209195 case DRM_MODE_DPMS_STANDBY:
210196 case DRM_MODE_DPMS_SUSPEND:
211197 case DRM_MODE_DPMS_OFF:
212− if (hdmi_manager_ops && hdmi_manager_ops->disable)
213− hdmi_manager_ops->disable(ctx->hdmi_ctx->ctx);
198+ if (hdmi_ops && hdmi_ops->disable)
199+ hdmi_ops->disable(ctx->hdmi_ctx->ctx);
214200 break;
215201 default:
216202 DRM_DEBUG_KMS("unkown dps mode: %d\n", mode);
@@ -235,8 +221,8 @@ static void drm_mixer_mode_set(struct device *subdrv_dev, · 18 unmodified lines
235221
236222 DRM_DEBUG_KMS("%s\n", __FILE__);
237223
238− if (hdmi_overlay_ops && hdmi_overlay_ops->win_mode_set)
239− hdmi_overlay_ops->win_mode_set(ctx->mixer_ctx->ctx, overlay);
224+ if (mixer_ops && mixer_ops->win_mode_set)
225+ mixer_ops->win_mode_set(ctx->mixer_ctx->ctx, overlay);
240226 }
241227
242228 static void drm_mixer_commit(struct device *subdrv_dev, int zpos)
@@ -245,8 +231,8 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos) · 2 unmodified lines
245231
246232 DRM_DEBUG_KMS("%s\n", __FILE__);
247233
248− if (hdmi_overlay_ops && hdmi_overlay_ops->win_commit)
249− hdmi_overlay_ops->win_commit(ctx->mixer_ctx->ctx, zpos);
234+ if (mixer_ops && mixer_ops->win_commit)
235+ mixer_ops->win_commit(ctx->mixer_ctx->ctx, zpos);
250236 }
251237
252238 static void drm_mixer_disable(struct device *subdrv_dev, int zpos)
@@ -255,8 +241,8 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) · 2 unmodified lines
255241
256242 DRM_DEBUG_KMS("%s\n", __FILE__);
257243
258− if (hdmi_overlay_ops && hdmi_overlay_ops->win_disable)
259− hdmi_overlay_ops->win_disable(ctx->mixer_ctx->ctx, zpos);
244+ if (mixer_ops && mixer_ops->win_disable)
245+ mixer_ops->win_disable(ctx->mixer_ctx->ctx, zpos);
260246 }
261247
262248 static struct exynos_drm_overlay_ops drm_hdmi_overlay_ops = {
@@ -265,6 +251,12 @@ static struct exynos_drm_overlay_ops drm_hdmi_overlay_ops = { · 2 unmodified lines
265251 .disable = drm_mixer_disable,
266252 };
267253
254+static struct exynos_drm_manager hdmi_manager = {
255+ .pipe = -1,
256+ .ops = &drm_hdmi_manager_ops,
257+ .overlay_ops = &drm_hdmi_overlay_ops,
258+ .display_ops = &drm_hdmi_display_ops,
259+};
268260
269261 static int hdmi_subdrv_probe(struct drm_device *drm_dev,
270262 struct device *dev)
@@ -332,12 +324,9 @@ static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev) · 61 unmodified lines
332324
333325 subdrv = &ctx->subdrv;
334326
327+ subdrv->dev = dev;
328+ subdrv->manager = &hdmi_manager;
335329 subdrv->probe = hdmi_subdrv_probe;
336− subdrv->manager.pipe = -1;
337− subdrv->manager.ops = &drm_hdmi_manager_ops;
338− subdrv->manager.overlay_ops = &drm_hdmi_overlay_ops;
339− subdrv->manager.display_ops = &drm_hdmi_display_ops;
340− subdrv->manager.dev = dev;
341330
342331 platform_set_drvdata(pdev, subdrv);
343332
drivers/gpu/drm/exynos/exynos_drm_hdmi.h+9−14
@@ -38,15 +38,15 @@ struct exynos_drm_hdmi_context { · 37 unmodified lines
3838 void *ctx;
3939 };
4040
41−struct exynos_hdmi_display_ops {
41+struct exynos_hdmi_ops {
42+ /* display */
4243 bool (*is_connected)(void *ctx);
4344 int (*get_edid)(void *ctx, struct drm_connector *connector,
4445 u8 *edid, int len);
4546 int (*check_timing)(void *ctx, void *timing);
4647 int (*power_on)(void *ctx, int mode);
47−};
4848
49−struct exynos_hdmi_manager_ops {
49+ /* manager */
5050 void (*mode_fixup)(void *ctx, struct drm_connector *connector,
5151 struct drm_display_mode *mode,
5252 struct drm_display_mode *adjusted_mode);
@@ -57,22 +57,17 @@ struct exynos_hdmi_manager_ops { · 4 unmodified lines
5757 void (*disable)(void *ctx);
5858 };
5959
60−struct exynos_hdmi_overlay_ops {
60+struct exynos_mixer_ops {
61+ /* manager */
6162 int (*enable_vblank)(void *ctx, int pipe);
6263 void (*disable_vblank)(void *ctx);
64+
65+ /* overlay */
6366 void (*win_mode_set)(void *ctx, struct exynos_drm_overlay *overlay);
6467 void (*win_commit)(void *ctx, int zpos);
6568 void (*win_disable)(void *ctx, int zpos);
6669 };
6770
68−extern struct platform_driver hdmi_driver;
69−extern struct platform_driver mixer_driver;
70−
71−void exynos_drm_display_ops_register(struct exynos_hdmi_display_ops
72− *display_ops);
73−void exynos_drm_manager_ops_register(struct exynos_hdmi_manager_ops
74− *manager_ops);
75−void exynos_drm_overlay_ops_register(struct exynos_hdmi_overlay_ops
76− *overlay_ops);
77−
71+void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops);
72+void exynos_mixer_ops_register(struct exynos_mixer_ops *ops);
7873 #endif
drivers/gpu/drm/exynos/exynos_drm_plane.c+4−0
@@ -24,6 +24,10 @@ struct exynos_plane { · 23 unmodified lines
2424
2525 static const uint32_t formats[] = {
2626 DRM_FORMAT_XRGB8888,
27+ DRM_FORMAT_ARGB8888,
28+ DRM_FORMAT_NV12,
29+ DRM_FORMAT_NV12M,
30+ DRM_FORMAT_NV12MT,
2731 };
2832
2933 static int
drivers/gpu/drm/exynos/exynos_drm_vidi.c+12−8
@@ -199,7 +199,7 @@ static void vidi_dpms(struct device *subdrv_dev, int mode) · 198 unmodified lines
199199 static void vidi_apply(struct device *subdrv_dev)
200200 {
201201 struct vidi_context *ctx = get_vidi_context(subdrv_dev);
202− struct exynos_drm_manager *mgr = &ctx->subdrv.manager;
202+ struct exynos_drm_manager *mgr = ctx->subdrv.manager;
203203 struct exynos_drm_manager_ops *mgr_ops = mgr->ops;
204204 struct exynos_drm_overlay_ops *ovl_ops = mgr->overlay_ops;
205205 struct vidi_win_data *win_data;
@@ -374,6 +374,13 @@ static struct exynos_drm_overlay_ops vidi_overlay_ops = { · 168 unmodified lines
374374 .disable = vidi_win_disable,
375375 };
376376
377+static struct exynos_drm_manager vidi_manager = {
378+ .pipe = -1,
379+ .ops = &vidi_manager_ops,
380+ .overlay_ops = &vidi_overlay_ops,
381+ .display_ops = &vidi_display_ops,
382+};
383+
377384 static void vidi_finish_pageflip(struct drm_device *drm_dev, int crtc)
378385 {
379386 struct exynos_drm_private *dev_priv = drm_dev->dev_private;
@@ -425,7 +432,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work) · 45 unmodified lines
425432 struct vidi_context *ctx = container_of(work, struct vidi_context,
426433 work);
427434 struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
428− struct exynos_drm_manager *manager = &subdrv->manager;
435+ struct exynos_drm_manager *manager = subdrv->manager;
429436
430437 if (manager->pipe < 0)
431438 return;
@@ -471,7 +478,7 @@ static void vidi_subdrv_remove(struct drm_device *drm_dev) · 39 unmodified lines
471478 static int vidi_power_on(struct vidi_context *ctx, bool enable)
472479 {
473480 struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
474− struct device *dev = subdrv->manager.dev;
481+ struct device *dev = subdrv->dev;
475482
476483 DRM_DEBUG_KMS("%s\n", __FILE__);
477484
@@ -611,13 +618,10 @@ static int __devinit vidi_probe(struct platform_device *pdev) · 133 unmodified lines
611618 ctx->raw_edid = (struct edid *)fake_edid_info;
612619
613620 subdrv = &ctx->subdrv;
621+ subdrv->dev = dev;
622+ subdrv->manager = &vidi_manager;
614623 subdrv->probe = vidi_subdrv_probe;
615624 subdrv->remove = vidi_subdrv_remove;
616− subdrv->manager.pipe = -1;
617− subdrv->manager.ops = &vidi_manager_ops;
618− subdrv->manager.overlay_ops = &vidi_overlay_ops;
619− subdrv->manager.display_ops = &vidi_display_ops;
620− subdrv->manager.dev = dev;
621625
622626 mutex_init(&ctx->lock);
623627
drivers/gpu/drm/exynos/exynos_hdmi.c+20−22
@@ -40,7 +40,6 @@ · 39 unmodified lines
4040
4141 #include "exynos_hdmi.h"
4242
43−#define HDMI_OVERLAY_NUMBER 3
4443 #define MAX_WIDTH 1920
4544 #define MAX_HEIGHT 1080
4645 #define get_hdmi_context(dev) platform_get_drvdata(to_platform_device(dev))
@@ -1194,7 +1193,7 @@ static int hdmi_conf_index(struct hdmi_context *hdata, · 1147 unmodified lines
11941193
11951194 static bool hdmi_is_connected(void *ctx)
11961195 {
1197− struct hdmi_context *hdata = (struct hdmi_context *)ctx;
1196+ struct hdmi_context *hdata = ctx;
11981197 u32 val = hdmi_reg_read(hdata, HDMI_HPD_STATUS);
11991198
12001199 if (val)
@@ -1207,7 +1206,7 @@ static int hdmi_get_edid(void *ctx, struct drm_connector *connector, · 6 unmodified lines
12071206 u8 *edid, int len)
12081207 {
12091208 struct edid *raw_edid;
1210− struct hdmi_context *hdata = (struct hdmi_context *)ctx;
1209+ struct hdmi_context *hdata = ctx;
12111210
12121211 DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
12131212
@@ -1275,7 +1274,7 @@ static int hdmi_v14_check_timing(struct fb_videomode *check_timing) · 61 unmodified lines
12751274
12761275 static int hdmi_check_timing(void *ctx, void *timing)
12771276 {
1278− struct hdmi_context *hdata = (struct hdmi_context *)ctx;
1277+ struct hdmi_context *hdata = ctx;
12791278 struct fb_videomode *check_timing = timing;
12801279
12811280 DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
@@ -1312,13 +1311,6 @@ static int hdmi_display_power_on(void *ctx, int mode) · 30 unmodified lines
13121311 return 0;
13131312 }
13141313
1315−static struct exynos_hdmi_display_ops display_ops = {
1316− .is_connected = hdmi_is_connected,
1317− .get_edid = hdmi_get_edid,
1318− .check_timing = hdmi_check_timing,
1319− .power_on = hdmi_display_power_on,
1320−};
1321−
13221314 static void hdmi_set_acr(u32 freq, u8 *acr)
13231315 {
13241316 u32 n, cts;
@@ -1914,7 +1906,7 @@ static void hdmi_mode_fixup(void *ctx, struct drm_connector *connector, · 589 unmodified lines
19141906 struct drm_display_mode *adjusted_mode)
19151907 {
19161908 struct drm_display_mode *m;
1917− struct hdmi_context *hdata = (struct hdmi_context *)ctx;
1909+ struct hdmi_context *hdata = ctx;
19181910 int index;
19191911
19201912 DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
@@ -1951,7 +1943,7 @@ static void hdmi_mode_fixup(void *ctx, struct drm_connector *connector, · 30 unmodified lines
19511943
19521944 static void hdmi_mode_set(void *ctx, void *mode)
19531945 {
1954− struct hdmi_context *hdata = (struct hdmi_context *)ctx;
1946+ struct hdmi_context *hdata = ctx;
19551947 int conf_idx;
19561948
19571949 DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
@@ -1974,7 +1966,7 @@ static void hdmi_get_max_resol(void *ctx, unsigned int *width, · 16 unmodified lines
19741966
19751967 static void hdmi_commit(void *ctx)
19761968 {
1977− struct hdmi_context *hdata = (struct hdmi_context *)ctx;
1969+ struct hdmi_context *hdata = ctx;
19781970
19791971 DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
19801972
@@ -1985,7 +1977,7 @@ static void hdmi_commit(void *ctx) · 4 unmodified lines
19851977
19861978 static void hdmi_disable(void *ctx)
19871979 {
1988− struct hdmi_context *hdata = (struct hdmi_context *)ctx;
1980+ struct hdmi_context *hdata = ctx;
19891981
19901982 DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
19911983
@@ -1996,7 +1988,14 @@ static void hdmi_disable(void *ctx) · 4 unmodified lines
19961988 }
19971989 }
19981990
1999−static struct exynos_hdmi_manager_ops manager_ops = {
1991+static struct exynos_hdmi_ops hdmi_ops = {
1992+ /* display */
1993+ .is_connected = hdmi_is_connected,
1994+ .get_edid = hdmi_get_edid,
1995+ .check_timing = hdmi_check_timing,
1996+ .power_on = hdmi_display_power_on,
1997+
1998+ /* manager */
20001999 .mode_fixup = hdmi_mode_fixup,
20012000 .mode_set = hdmi_mode_set,
20022001 .get_max_resol = hdmi_get_max_resol,
@@ -2020,7 +2019,7 @@ static void hdmi_hotplug_func(struct work_struct *work) · 17 unmodified lines
20202019 static irqreturn_t hdmi_irq_handler(int irq, void *arg)
20212020 {
20222021 struct exynos_drm_hdmi_context *ctx = arg;
2023− struct hdmi_context *hdata = (struct hdmi_context *)ctx->ctx;
2022+ struct hdmi_context *hdata = ctx->ctx;
20242023 u32 intc_flag;
20252024
20262025 intc_flag = hdmi_reg_read(hdata, HDMI_INTC_FLAG);
@@ -2173,7 +2172,7 @@ static int hdmi_runtime_suspend(struct device *dev) · 146 unmodified lines
21732172
21742173 DRM_DEBUG_KMS("%s\n", __func__);
21752174
2176− hdmi_resource_poweroff((struct hdmi_context *)ctx->ctx);
2175+ hdmi_resource_poweroff(ctx->ctx);
21772176
21782177 return 0;
21792178 }
@@ -2184,7 +2183,7 @@ static int hdmi_runtime_resume(struct device *dev) · 4 unmodified lines
21842183
21852184 DRM_DEBUG_KMS("%s\n", __func__);
21862185
2187− hdmi_resource_poweron((struct hdmi_context *)ctx->ctx);
2186+ hdmi_resource_poweron(ctx->ctx);
21882187
21892188 return 0;
21902189 }
@@ -2322,8 +2321,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev) · 131 unmodified lines
23222321 hdata->irq = res->start;
23232322
23242323 /* register specific callbacks to common hdmi. */
2325− exynos_drm_display_ops_register(&display_ops);
2326− exynos_drm_manager_ops_register(&manager_ops);
2324+ exynos_hdmi_ops_register(&hdmi_ops);
23272325
23282326 hdmi_resource_poweron(hdata);
23292327
@@ -2351,7 +2349,7 @@ err_data: · 21 unmodified lines
23512349 static int __devexit hdmi_remove(struct platform_device *pdev)
23522350 {
23532351 struct exynos_drm_hdmi_context *ctx = platform_get_drvdata(pdev);
2354− struct hdmi_context *hdata = (struct hdmi_context *)ctx->ctx;
2352+ struct hdmi_context *hdata = ctx->ctx;
23552353
23562354 DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
23572355
drivers/gpu/drm/exynos/exynos_mixer.c+19−21
@@ -37,7 +37,8 @@ · 36 unmodified lines
3737 #include "exynos_drm_drv.h"
3838 #include "exynos_drm_hdmi.h"
3939
40−#define HDMI_OVERLAY_NUMBER 3
40+#define MIXER_WIN_NR 3
41+#define MIXER_DEFAULT_WIN 0
4142
4243 #define get_mixer_context(dev) platform_get_drvdata(to_platform_device(dev))
4344
@@ -75,16 +76,12 @@ struct mixer_resources { · 31 unmodified lines
7576 };
7677
7778 struct mixer_context {
78− struct fb_videomode *default_timing;
79− unsigned int default_win;
80− unsigned int default_bpp;
8179 unsigned int irq;
8280 int pipe;
8381 bool interlace;
84− bool vp_enabled;
8582
8683 struct mixer_resources mixer_res;
87− struct hdmi_win_data win_data[HDMI_OVERLAY_NUMBER];
84+ struct hdmi_win_data win_data[MIXER_WIN_NR];
8885 };
8986
9087 static const u8 filter_y_horiz_tap8[] = {
@@ -643,9 +640,9 @@ static void mixer_win_mode_set(void *ctx, · 552 unmodified lines
643640
644641 win = overlay->zpos;
645642 if (win == DEFAULT_ZPOS)
646− win = mixer_ctx->default_win;
643+ win = MIXER_DEFAULT_WIN;
647644
648− if (win < 0 || win > HDMI_OVERLAY_NUMBER) {
645+ if (win < 0 || win > MIXER_WIN_NR) {
649646 DRM_ERROR("overlay plane[%d] is wrong\n", win);
650647 return;
651648 }
@@ -683,9 +680,9 @@ static void mixer_win_commit(void *ctx, int zpos) · 31 unmodified lines
683680 DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win);
684681
685682 if (win == DEFAULT_ZPOS)
686− win = mixer_ctx->default_win;
683+ win = MIXER_DEFAULT_WIN;
687684
688− if (win < 0 || win > HDMI_OVERLAY_NUMBER) {
685+ if (win < 0 || win > MIXER_WIN_NR) {
689686 DRM_ERROR("overlay plane[%d] is wrong\n", win);
690687 return;
691688 }
@@ -706,9 +703,9 @@ static void mixer_win_disable(void *ctx, int zpos) · 14 unmodified lines
706703 DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win);
707704
708705 if (win == DEFAULT_ZPOS)
709− win = mixer_ctx->default_win;
706+ win = MIXER_DEFAULT_WIN;
710707
711− if (win < 0 || win > HDMI_OVERLAY_NUMBER) {
708+ if (win < 0 || win > MIXER_WIN_NR) {
712709 DRM_ERROR("overlay plane[%d] is wrong\n", win);
713710 return;
714711 }
@@ -722,9 +719,12 @@ static void mixer_win_disable(void *ctx, int zpos) · 7 unmodified lines
722719 spin_unlock_irqrestore(&res->reg_slock, flags);
723720 }
724721
725−static struct exynos_hdmi_overlay_ops overlay_ops = {
722+static struct exynos_mixer_ops mixer_ops = {
723+ /* manager */
726724 .enable_vblank = mixer_enable_vblank,
727725 .disable_vblank = mixer_disable_vblank,
726+
727+ /* overlay */
728728 .win_mode_set = mixer_win_mode_set,
729729 .win_commit = mixer_win_commit,
730730 .win_disable = mixer_win_disable,
@@ -771,8 +771,7 @@ static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc) · 40 unmodified lines
771771 static irqreturn_t mixer_irq_handler(int irq, void *arg)
772772 {
773773 struct exynos_drm_hdmi_context *drm_hdmi_ctx = arg;
774− struct mixer_context *ctx =
775− (struct mixer_context *)drm_hdmi_ctx->ctx;
774+ struct mixer_context *ctx = drm_hdmi_ctx->ctx;
776775 struct mixer_resources *res = &ctx->mixer_res;
777776 u32 val, val_base;
778777
@@ -902,7 +901,7 @@ static int mixer_runtime_resume(struct device *dev) · 123 unmodified lines
902901
903902 DRM_DEBUG_KMS("resume - start\n");
904903
905− mixer_resource_poweron((struct mixer_context *)ctx->ctx);
904+ mixer_resource_poweron(ctx->ctx);
906905
907906 return 0;
908907 }
@@ -913,7 +912,7 @@ static int mixer_runtime_suspend(struct device *dev) · 4 unmodified lines
913912
914913 DRM_DEBUG_KMS("suspend - start\n");
915914
916− mixer_resource_poweroff((struct mixer_context *)ctx->ctx);
915+ mixer_resource_poweroff(ctx->ctx);
917916
918917 return 0;
919918 }
@@ -926,8 +925,7 @@ static const struct dev_pm_ops mixer_pm_ops = { · 6 unmodified lines
926925 static int __devinit mixer_resources_init(struct exynos_drm_hdmi_context *ctx,
927926 struct platform_device *pdev)
928927 {
929− struct mixer_context *mixer_ctx =
930− (struct mixer_context *)ctx->ctx;
928+ struct mixer_context *mixer_ctx = ctx->ctx;
931929 struct device *dev = &pdev->dev;
932930 struct mixer_resources *mixer_res = &mixer_ctx->mixer_res;
933931 struct resource *res;
@@ -1076,7 +1074,7 @@ static int __devinit mixer_probe(struct platform_device *pdev) · 142 unmodified lines
10761074 goto fail;
10771075
10781076 /* register specific callback point to common hdmi. */
1079− exynos_drm_overlay_ops_register(&overlay_ops);
1077+ exynos_mixer_ops_register(&mixer_ops);
10801078
10811079 mixer_resource_poweron(ctx);
10821080
@@ -1093,7 +1091,7 @@ static int mixer_remove(struct platform_device *pdev) · 10 unmodified lines
10931091 struct device *dev = &pdev->dev;
10941092 struct exynos_drm_hdmi_context *drm_hdmi_ctx =
10951093 platform_get_drvdata(pdev);
1096− struct mixer_context *ctx = (struct mixer_context *)drm_hdmi_ctx->ctx;
1094+ struct mixer_context *ctx = drm_hdmi_ctx->ctx;
10971095
10981096 dev_info(dev, "remove successful\n");
10991097
drivers/gpu/drm/gma500/mdfld_dsi_output.h+0−1
@@ -29,7 +29,6 @@ · 28 unmodified lines
2929 #define __MDFLD_DSI_OUTPUT_H__
3030
3131 #include <linux/backlight.h>
32−#include <linux/version.h>
3332 #include <drm/drmP.h>
3433 #include <drm/drm.h>
3534 #include <drm/drm_crtc.h>
drivers/gpu/drm/i810/i810_dma.c+2−4
@@ -129,6 +129,7 @@ static int i810_map_buffer(struct drm_buf *buf, struct drm_file *file_priv) · 128 unmodified lines
129129 if (buf_priv->currently_mapped == I810_BUF_MAPPED)
130130 return -EINVAL;
131131
132+ /* This is all entirely broken */
132133 down_write(&current->mm->mmap_sem);
133134 old_fops = file_priv->filp->f_op;
134135 file_priv->filp->f_op = &i810_buffer_fops;
@@ -157,11 +158,8 @@ static int i810_unmap_buffer(struct drm_buf *buf) · 22 unmodified lines
157158 if (buf_priv->currently_mapped != I810_BUF_MAPPED)
158159 return -EINVAL;
159160
160− down_write(&current->mm->mmap_sem);
161− retcode = do_munmap(current->mm,
162− (unsigned long)buf_priv->virtual,
161+ retcode = vm_munmap((unsigned long)buf_priv->virtual,
163162 (size_t) buf->total);
164− up_write(&current->mm->mmap_sem);
165163
166164 buf_priv->currently_mapped = I810_BUF_UNMAPPED;
167165 buf_priv->virtual = NULL;
drivers/gpu/drm/i915/i915_drv.c+1−1
@@ -64,7 +64,7 @@ MODULE_PARM_DESC(semaphores, · 63 unmodified lines
6464 "Use semaphores for inter-ring sync (default: -1 (use per-chip defaults))");
6565
6666 int i915_enable_rc6 __read_mostly = -1;
67−module_param_named(i915_enable_rc6, i915_enable_rc6, int, 0600);
67+module_param_named(i915_enable_rc6, i915_enable_rc6, int, 0400);
6868 MODULE_PARM_DESC(i915_enable_rc6,
6969 "Enable power-saving render C-state 6. "
7070 "Different stages can be selected via bitmask values "
drivers/gpu/drm/i915/i915_gem.c+3−3
@@ -1087,11 +1087,9 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data, · 1086 unmodified lines
10871087 if (obj == NULL)
10881088 return -ENOENT;
10891089
1090− down_write(&current->mm->mmap_sem);
1091− addr = do_mmap(obj->filp, 0, args->size,
1090+ addr = vm_mmap(obj->filp, 0, args->size,
10921091 PROT_READ | PROT_WRITE, MAP_SHARED,
10931092 args->offset);
1094− up_write(&current->mm->mmap_sem);
10951093 drm_gem_object_unreference_unlocked(obj);
10961094 if (IS_ERR((void *)addr))
10971095 return addr;
@@ -1493,6 +1491,7 @@ i915_gem_object_move_off_active(struct drm_i915_gem_object *obj) · 395 unmodified lines
14931491 {
14941492 list_del_init(&obj->ring_list);
14951493 obj->last_rendering_seqno = 0;
1494+ obj->last_fenced_seqno = 0;
14961495 }
14971496
14981497 static void
@@ -1521,6 +1520,7 @@ i915_gem_object_move_to_inactive(struct drm_i915_gem_object *obj) · 22 unmodified lines
15211520 BUG_ON(!list_empty(&obj->gpu_write_list));
15221521 BUG_ON(!obj->active);
15231522 obj->ring = NULL;
1523+ obj->last_fenced_ring = NULL;
15241524
15251525 i915_gem_object_move_off_active(obj);
15261526 obj->fenced_gpu_access = false;
drivers/gpu/drm/i915/i915_gem_execbuffer.c+7−1
@@ -1133,6 +1133,11 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, · 1132 unmodified lines
11331133 return -EINVAL;
11341134 }
11351135
1136+ if (args->num_cliprects > UINT_MAX / sizeof(*cliprects)) {
1137+ DRM_DEBUG("execbuf with %u cliprects\n",
1138+ args->num_cliprects);
1139+ return -EINVAL;
1140+ }
11361141 cliprects = kmalloc(args->num_cliprects * sizeof(*cliprects),
11371142 GFP_KERNEL);
11381143 if (cliprects == NULL) {
@@ -1404,7 +1409,8 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data, · 265 unmodified lines
14041409 struct drm_i915_gem_exec_object2 *exec2_list = NULL;
14051410 int ret;
14061411
1407− if (args->buffer_count < 1) {
1412+ if (args->buffer_count < 1 ||
1413+ args->buffer_count > UINT_MAX / sizeof(*exec2_list)) {
14081414 DRM_DEBUG("execbuf2 with %d buffers\n", args->buffer_count);
14091415 return -EINVAL;
14101416 }
drivers/gpu/drm/i915/i915_reg.h+4−0
@@ -568,6 +568,7 @@ · 567 unmodified lines
568568 #define CM0_MASK_SHIFT 16
569569 #define CM0_IZ_OPT_DISABLE (1<<6)
570570 #define CM0_ZR_OPT_DISABLE (1<<5)
571+#define CM0_STC_EVICT_DISABLE_LRA_SNB (1<<5)
571572 #define CM0_DEPTH_EVICT_DISABLE (1<<4)
572573 #define CM0_COLOR_EVICT_DISABLE (1<<3)
573574 #define CM0_DEPTH_WRITE_DISABLE (1<<1)
@@ -3728,6 +3729,9 @@ · 3154 unmodified lines
37283729 #define GT_FIFO_FREE_ENTRIES 0x120008
37293730 #define GT_FIFO_NUM_RESERVED_ENTRIES 20
37303731
3732+#define GEN6_UCGCTL1 0x9400
3733+# define GEN6_BLBUNIT_CLOCK_GATE_DISABLE (1 << 5)
3734+
37313735 #define GEN6_UCGCTL2 0x9404
37323736 # define GEN6_RCZUNIT_CLOCK_GATE_DISABLE (1 << 13)
37333737 # define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12)
drivers/gpu/drm/i915/intel_crt.c+11−18
@@ -430,8 +430,8 @@ intel_crt_detect(struct drm_connector *connector, bool force) · 429 unmodified lines
430430 {
431431 struct drm_device *dev = connector->dev;
432432 struct intel_crt *crt = intel_attached_crt(connector);
433− struct drm_crtc *crtc;
434433 enum drm_connector_status status;
434+ struct intel_load_detect_pipe tmp;
435435
436436 if (I915_HAS_HOTPLUG(dev)) {
437437 if (intel_crt_detect_hotplug(connector)) {
@@ -450,23 +450,16 @@ intel_crt_detect(struct drm_connector *connector, bool force) · 12 unmodified lines
450450 return connector->status;
451451
452452 /* for pre-945g platforms use load detect */
453− crtc = crt->base.base.crtc;
454− if (crtc && crtc->enabled) {
455− status = intel_crt_load_detect(crt);
456− } else {
457− struct intel_load_detect_pipe tmp;
458−
459− if (intel_get_load_detect_pipe(&crt->base, connector, NULL,
460− &tmp)) {
461− if (intel_crt_detect_ddc(connector))
462− status = connector_status_connected;
463− else
464− status = intel_crt_load_detect(crt);
465− intel_release_load_detect_pipe(&crt->base, connector,
466− &tmp);
467− } else
468− status = connector_status_unknown;
469− }
453+ if (intel_get_load_detect_pipe(&crt->base, connector, NULL,
454+ &tmp)) {
455+ if (intel_crt_detect_ddc(connector))
456+ status = connector_status_connected;
457+ else
458+ status = intel_crt_load_detect(crt);
459+ intel_release_load_detect_pipe(&crt->base, connector,
460+ &tmp);
461+ } else
462+ status = connector_status_unknown;
470463
471464 return status;
472465 }
drivers/gpu/drm/i915/intel_display.c+62−22
@@ -2244,6 +2244,33 @@ intel_pipe_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb, · 2243 unmodified lines
22442244 return 0;
22452245 }
22462246
2247+static int
2248+intel_finish_fb(struct drm_framebuffer *old_fb)
2249+{
2250+ struct drm_i915_gem_object *obj = to_intel_framebuffer(old_fb)->obj;
2251+ struct drm_i915_private *dev_priv = obj->base.dev->dev_private;
2252+ bool was_interruptible = dev_priv->mm.interruptible;
2253+ int ret;
2254+
2255+ wait_event(dev_priv->pending_flip_queue,
2256+ atomic_read(&dev_priv->mm.wedged) ||
2257+ atomic_read(&obj->pending_flip) == 0);
2258+
2259+ /* Big Hammer, we also need to ensure that any pending
2260+ * MI_WAIT_FOR_EVENT inside a user batch buffer on the
2261+ * current scanout is retired before unpinning the old
2262+ * framebuffer.
2263+ *
2264+ * This should only fail upon a hung GPU, in which case we
2265+ * can safely continue.
2266+ */
2267+ dev_priv->mm.interruptible = false;
2268+ ret = i915_gem_object_finish_gpu(obj);
2269+ dev_priv->mm.interruptible = was_interruptible;
2270+
2271+ return ret;
2272+}
2273+
22472274 static int
22482275 intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
22492276 struct drm_framebuffer *old_fb)
@@ -2282,25 +2309,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, · 32 unmodified lines
22822309 return ret;
22832310 }
22842311
2285− if (old_fb) {
2286− struct drm_i915_private *dev_priv = dev->dev_private;
2287− struct drm_i915_gem_object *obj = to_intel_framebuffer(old_fb)->obj;
2288−
2289− wait_event(dev_priv->pending_flip_queue,
2290− atomic_read(&dev_priv->mm.wedged) ||
2291− atomic_read(&obj->pending_flip) == 0);
2292−
2293− /* Big Hammer, we also need to ensure that any pending
2294− * MI_WAIT_FOR_EVENT inside a user batch buffer on the
2295− * current scanout is retired before unpinning the old
2296− * framebuffer.
2297− *
2298− * This should only fail upon a hung GPU, in which case we
2299− * can safely continue.
2300− */
2301− ret = i915_gem_object_finish_gpu(obj);
2302− (void) ret;
2303− }
2312+ if (old_fb)
2313+ intel_finish_fb(old_fb);
23042314
23052315 ret = intel_pipe_set_base_atomic(crtc, crtc->fb, x, y,
23062316 LEAVE_ATOMIC_MODE_SET);
@@ -3371,6 +3381,23 @@ static void intel_crtc_disable(struct drm_crtc *crtc) · 1064 unmodified lines
33713381 struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
33723382 struct drm_device *dev = crtc->dev;
33733383
3384+ /* Flush any pending WAITs before we disable the pipe. Note that
3385+ * we need to drop the struct_mutex in order to acquire it again
3386+ * during the lowlevel dpms routines around a couple of the
3387+ * operations. It does not look trivial nor desirable to move
3388+ * that locking higher. So instead we leave a window for the
3389+ * submission of further commands on the fb before we can actually
3390+ * disable it. This race with userspace exists anyway, and we can
3391+ * only rely on the pipe being disabled by userspace after it
3392+ * receives the hotplug notification and has flushed any pending
3393+ * batches.
3394+ */
3395+ if (crtc->fb) {
3396+ mutex_lock(&dev->struct_mutex);
3397+ intel_finish_fb(crtc->fb);
3398+ mutex_unlock(&dev->struct_mutex);
3399+ }
3400+
33743401 crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
33753402 assert_plane_disabled(dev->dev_private, to_intel_crtc(crtc)->plane);
33763403 assert_pipe_disabled(dev->dev_private, to_intel_crtc(crtc)->pipe);
@@ -3451,8 +3478,11 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc, · 74 unmodified lines
34513478 return false;
34523479 }
34533480
3454− /* All interlaced capable intel hw wants timings in frames. */
3455− drm_mode_set_crtcinfo(adjusted_mode, 0);
3481+ /* All interlaced capable intel hw wants timings in frames. Note though
3482+ * that intel_lvds_mode_fixup does some funny tricks with the crtc
3483+ * timings, so we need to be careful not to clobber these.*/
3484+ if (!(adjusted_mode->private_flags & INTEL_MODE_CRTC_TIMINGS_SET))
3485+ drm_mode_set_crtcinfo(adjusted_mode, 0);
34563486
34573487 return true;
34583488 }
@@ -7438,7 +7468,13 @@ static int intel_gen6_queue_flip(struct drm_device *dev, · 3979 unmodified lines
74387468 OUT_RING(fb->pitches[0] | obj->tiling_mode);
74397469 OUT_RING(obj->gtt_offset);
74407470
7441− pf = I915_READ(PF_CTL(intel_crtc->pipe)) & PF_ENABLE;
7471+ /* Contrary to the suggestions in the documentation,
7472+ * "Enable Panel Fitter" does not seem to be required when page
7473+ * flipping with a non-native mode, and worse causes a normal
7474+ * modeset to fail.
7475+ * pf = I915_READ(PF_CTL(intel_crtc->pipe)) & PF_ENABLE;
7476+ */
7477+ pf = 0;
74427478 pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff;
74437479 OUT_RING(pf | pipesrc);
74447480 ADVANCE_LP_RING();
@@ -8529,6 +8565,10 @@ static void gen6_init_clock_gating(struct drm_device *dev) · 1084 unmodified lines
85298565 I915_WRITE(WM2_LP_ILK, 0);
85308566 I915_WRITE(WM1_LP_ILK, 0);
85318567
8568+ I915_WRITE(GEN6_UCGCTL1,
8569+ I915_READ(GEN6_UCGCTL1) |
8570+ GEN6_BLBUNIT_CLOCK_GATE_DISABLE);
8571+
85328572 /* According to the BSpec vol1g, bit 12 (RCPBUNIT) clock
85338573 * gating disable must be set. Failure to set it results in
85348574 * flickering pixels due to Z write ordering failures after
drivers/gpu/drm/i915/intel_dp.c+35−14
@@ -219,14 +219,38 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes) · 218 unmodified lines
219219 return (max_link_clock * max_lanes * 8) / 10;
220220 }
221221
222+static bool
223+intel_dp_adjust_dithering(struct intel_dp *intel_dp,
224+ struct drm_display_mode *mode,
225+ struct drm_display_mode *adjusted_mode)
226+{
227+ int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_dp));
228+ int max_lanes = intel_dp_max_lane_count(intel_dp);
229+ int max_rate, mode_rate;
230+
231+ mode_rate = intel_dp_link_required(mode->clock, 24);
232+ max_rate = intel_dp_max_data_rate(max_link_clock, max_lanes);
233+
234+ if (mode_rate > max_rate) {
235+ mode_rate = intel_dp_link_required(mode->clock, 18);
236+ if (mode_rate > max_rate)
237+ return false;
238+
239+ if (adjusted_mode)
240+ adjusted_mode->private_flags
241+ |= INTEL_MODE_DP_FORCE_6BPC;
242+
243+ return true;
244+ }
245+
246+ return true;
247+}
248+
222249 static int
223250 intel_dp_mode_valid(struct drm_connector *connector,
224251 struct drm_display_mode *mode)
225252 {
226253 struct intel_dp *intel_dp = intel_attached_dp(connector);
227− int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_dp));
228− int max_lanes = intel_dp_max_lane_count(intel_dp);
229− int max_rate, mode_rate;
230254
231255 if (is_edp(intel_dp) && intel_dp->panel_fixed_mode) {
232256 if (mode->hdisplay > intel_dp->panel_fixed_mode->hdisplay)
@@ -236,16 +260,8 @@ intel_dp_mode_valid(struct drm_connector *connector, · 3 unmodified lines
236260 return MODE_PANEL;
237261 }
238262
239− mode_rate = intel_dp_link_required(mode->clock, 24);
240− max_rate = intel_dp_max_data_rate(max_link_clock, max_lanes);
241−
242− if (mode_rate > max_rate) {
243− mode_rate = intel_dp_link_required(mode->clock, 18);
244− if (mode_rate > max_rate)
245− return MODE_CLOCK_HIGH;
246− else
247− mode->private_flags |= INTEL_MODE_DP_FORCE_6BPC;
248− }
263+ if (!intel_dp_adjust_dithering(intel_dp, mode, NULL))
264+ return MODE_CLOCK_HIGH;
249265
250266 if (mode->clock < 10000)
251267 return MODE_CLOCK_LOW;
@@ -672,7 +688,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, · 420 unmodified lines
672688 int lane_count, clock;
673689 int max_lane_count = intel_dp_max_lane_count(intel_dp);
674690 int max_clock = intel_dp_max_link_bw(intel_dp) == DP_LINK_BW_2_7 ? 1 : 0;
675− int bpp = mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 24;
691+ int bpp;
676692 static int bws[2] = { DP_LINK_BW_1_62, DP_LINK_BW_2_7 };
677693
678694 if (is_edp(intel_dp) && intel_dp->panel_fixed_mode) {
@@ -686,6 +702,11 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, · 7 unmodified lines
686702 mode->clock = intel_dp->panel_fixed_mode->clock;
687703 }
688704
705+ if (!intel_dp_adjust_dithering(intel_dp, mode, adjusted_mode))
706+ return false;
707+
708+ bpp = adjusted_mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 24;
709+
689710 for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) {
690711 for (clock = 0; clock <= max_clock; clock++) {
691712 int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count);
drivers/gpu/drm/i915/intel_drv.h+4−0
@@ -105,6 +105,10 @@ · 104 unmodified lines
105105 #define INTEL_MODE_PIXEL_MULTIPLIER_SHIFT (0x0)
106106 #define INTEL_MODE_PIXEL_MULTIPLIER_MASK (0xf << INTEL_MODE_PIXEL_MULTIPLIER_SHIFT)
107107 #define INTEL_MODE_DP_FORCE_6BPC (0x10)
108+/* This flag must be set by the encoder's mode_fixup if it changes the crtc
109+ * timings in the mode to prevent the crtc fixup from overwriting them.
110+ * Currently only lvds needs that. */
111+#define INTEL_MODE_CRTC_TIMINGS_SET (0x20)
108112
109113 static inline void
110114 intel_mode_set_pixel_multiplier(struct drm_display_mode *mode,
drivers/gpu/drm/i915/intel_fb.c+4−0
@@ -279,6 +279,8 @@ void intel_fb_restore_mode(struct drm_device *dev) · 278 unmodified lines
279279 struct drm_mode_config *config = &dev->mode_config;
280280 struct drm_plane *plane;
281281
282+ mutex_lock(&dev->mode_config.mutex);
283+
282284 ret = drm_fb_helper_restore_fbdev_mode(&dev_priv->fbdev->helper);
283285 if (ret)
284286 DRM_DEBUG("failed to restore crtc mode\n");
@@ -286,4 +288,6 @@ void intel_fb_restore_mode(struct drm_device *dev) · 1 unmodified line
286288 /* Be sure to shut off any planes that may be active */
287289 list_for_each_entry(plane, &config->plane_list, head)
288290 plane->funcs->disable_plane(plane);
291+
292+ mutex_unlock(&dev->mode_config.mutex);
289293 }
drivers/gpu/drm/i915/intel_i2c.c+1−1
@@ -390,7 +390,7 @@ int intel_setup_gmbus(struct drm_device *dev) · 389 unmodified lines
390390 bus->has_gpio = intel_gpio_setup(bus, i);
391391
392392 /* XXX force bit banging until GMBUS is fully debugged */
393− if (bus->has_gpio && IS_GEN2(dev))
393+ if (bus->has_gpio)
394394 bus->force_bit = true;
395395 }
396396
drivers/gpu/drm/i915/intel_lvds.c+6−0
@@ -187,6 +187,8 @@ centre_horizontally(struct drm_display_mode *mode, · 186 unmodified lines
187187
188188 mode->crtc_hsync_start = mode->crtc_hblank_start + sync_pos;
189189 mode->crtc_hsync_end = mode->crtc_hsync_start + sync_width;
190+
191+ mode->private_flags |= INTEL_MODE_CRTC_TIMINGS_SET;
190192 }
191193
192194 static void
@@ -208,6 +210,8 @@ centre_vertically(struct drm_display_mode *mode, · 15 unmodified lines
208210
209211 mode->crtc_vsync_start = mode->crtc_vblank_start + sync_pos;
210212 mode->crtc_vsync_end = mode->crtc_vsync_start + sync_width;
213+
214+ mode->private_flags |= INTEL_MODE_CRTC_TIMINGS_SET;
211215 }
212216
213217 static inline u32 panel_fitter_scaling(u32 source, u32 target)
@@ -283,6 +287,8 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder, · 69 unmodified lines
283287 for_each_pipe(pipe)
284288 I915_WRITE(BCLRPAT(pipe), 0);
285289
290+ drm_mode_set_crtcinfo(adjusted_mode, 0);
291+
286292 switch (intel_lvds->fitting_mode) {
287293 case DRM_MODE_SCALE_CENTER:
288294 /*
drivers/gpu/drm/i915/intel_panel.c+0−2
@@ -47,8 +47,6 @@ intel_fixed_panel_mode(struct drm_display_mode *fixed_mode, · 46 unmodified lines
4747 adjusted_mode->vtotal = fixed_mode->vtotal;
4848
4949 adjusted_mode->clock = fixed_mode->clock;
50−
51− drm_mode_set_crtcinfo(adjusted_mode, 0);
5250 }
5351
5452 /* adjusted_mode has been preset to be the panel's fixed mode */
drivers/gpu/drm/i915/intel_ringbuffer.c+9−1
@@ -401,6 +401,14 @@ static int init_render_ring(struct intel_ring_buffer *ring) · 400 unmodified lines
401401 if (INTEL_INFO(dev)->gen >= 6) {
402402 I915_WRITE(INSTPM,
403403 INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING);
404+
405+ /* From the Sandybridge PRM, volume 1 part 3, page 24:
406+ * "If this bit is set, STCunit will have LRA as replacement
407+ * policy. [...] This bit must be reset. LRA replacement
408+ * policy is not supported."
409+ */
410+ I915_WRITE(CACHE_MODE_0,
411+ CM0_STC_EVICT_DISABLE_LRA_SNB << CM0_MASK_SHIFT);
404412 }
405413
406414 return ret;
@@ -1038,7 +1046,7 @@ int intel_init_ring_buffer(struct drm_device *dev, · 631 unmodified lines
10381046 * of the buffer.
10391047 */
10401048 ring->effective_size = ring->size;
1041− if (IS_I830(ring->dev))
1049+ if (IS_I830(ring->dev) || IS_845G(ring->dev))
10421050 ring->effective_size -= 128;
10431051
10441052 return 0;
drivers/gpu/drm/i915/intel_sdvo.c+18−16
@@ -731,6 +731,7 @@ static void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd, · 730 unmodified lines
731731 uint16_t width, height;
732732 uint16_t h_blank_len, h_sync_len, v_blank_len, v_sync_len;
733733 uint16_t h_sync_offset, v_sync_offset;
734+ int mode_clock;
734735
735736 width = mode->crtc_hdisplay;
736737 height = mode->crtc_vdisplay;
@@ -745,7 +746,11 @@ static void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd, · 8 unmodified lines
745746 h_sync_offset = mode->crtc_hsync_start - mode->crtc_hblank_start;
746747 v_sync_offset = mode->crtc_vsync_start - mode->crtc_vblank_start;
747748
748− dtd->part1.clock = mode->clock / 10;
749+ mode_clock = mode->clock;
750+ mode_clock /= intel_mode_get_pixel_multiplier(mode) ?: 1;
751+ mode_clock /= 10;
752+ dtd->part1.clock = mode_clock;
753+
749754 dtd->part1.h_active = width & 0xff;
750755 dtd->part1.h_blank = h_blank_len & 0xff;
751756 dtd->part1.h_high = (((width >> 8) & 0xf) << 4) |
@@ -996,7 +1001,7 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, · 244 unmodified lines
9961001 struct intel_sdvo *intel_sdvo = to_intel_sdvo(encoder);
9971002 u32 sdvox;
9981003 struct intel_sdvo_in_out_map in_out;
999− struct intel_sdvo_dtd input_dtd;
1004+ struct intel_sdvo_dtd input_dtd, output_dtd;
10001005 int pixel_multiplier = intel_mode_get_pixel_multiplier(adjusted_mode);
10011006 int rate;
10021007
@@ -1021,20 +1026,13 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, · 18 unmodified lines
10211026 intel_sdvo->attached_output))
10221027 return;
10231028
1024− /* We have tried to get input timing in mode_fixup, and filled into
1025− * adjusted_mode.
1026− */
1027− if (intel_sdvo->is_tv || intel_sdvo->is_lvds) {
1028− input_dtd = intel_sdvo->input_dtd;
1029− } else {
1030− /* Set the output timing to the screen */
1031− if (!intel_sdvo_set_target_output(intel_sdvo,
1032− intel_sdvo->attached_output))
1033− return;
1034−
1035− intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode);
1036− (void) intel_sdvo_set_output_timing(intel_sdvo, &input_dtd);
1037− }
1029+ /* lvds has a special fixed output timing. */
1030+ if (intel_sdvo->is_lvds)
1031+ intel_sdvo_get_dtd_from_mode(&output_dtd,
1032+ intel_sdvo->sdvo_lvds_fixed_mode);
1033+ else
1034+ intel_sdvo_get_dtd_from_mode(&output_dtd, mode);
1035+ (void) intel_sdvo_set_output_timing(intel_sdvo, &output_dtd);
10381036
10391037 /* Set the input timing to the screen. Assume always input 0. */
10401038 if (!intel_sdvo_set_target_input(intel_sdvo))
@@ -1052,6 +1050,10 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, · 11 unmodified lines
10521050 !intel_sdvo_set_tv_format(intel_sdvo))
10531051 return;
10541052
1053+ /* We have tried to get input timing in mode_fixup, and filled into
1054+ * adjusted_mode.
1055+ */
1056+ intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode);
10551057 (void) intel_sdvo_set_input_timing(intel_sdvo, &input_dtd);
10561058
10571059 switch (pixel_multiplier) {
drivers/gpu/drm/i915/intel_sprite.c+0−1
@@ -95,7 +95,6 @@ ivb_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb, · 94 unmodified lines
9595 /* must disable */
9696 sprctl |= SPRITE_TRICKLE_FEED_DISABLE;
9797 sprctl |= SPRITE_ENABLE;
98− sprctl |= SPRITE_DEST_KEY;
9998
10099 /* Sizes are 0 based */
101100 src_w--;
drivers/gpu/drm/nouveau/nouveau_pm.c+1−0
@@ -235,6 +235,7 @@ nouveau_pm_profile_set(struct drm_device *dev, const char *profile) · 234 unmodified lines
235235 return -EPERM;
236236
237237 strncpy(string, profile, sizeof(string));
238+ string[sizeof(string) - 1] = 0;
238239 if ((ptr = strchr(string, '\n')))
239240 *ptr = '\0';
240241
drivers/gpu/drm/nouveau/nv50_sor.c+1−1
@@ -42,7 +42,7 @@ nv50_sor_dp_lane_map(struct drm_device *dev, struct dcb_entry *dcb, u8 lane) · 41 unmodified lines
4242 struct drm_nouveau_private *dev_priv = dev->dev_private;
4343 static const u8 nvaf[] = { 24, 16, 8, 0 }; /* thanks, apple.. */
4444 static const u8 nv50[] = { 16, 8, 0, 24 };
45− if (dev_priv->card_type == 0xaf)
45+ if (dev_priv->chipset == 0xaf)
4646 return nvaf[lane];
4747 return nv50[lane];
4848 }
drivers/gpu/drm/radeon/atombios_crtc.c+5−2
@@ -575,6 +575,9 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, · 574 unmodified lines
575575
576576 if (rdev->family < CHIP_RV770)
577577 pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;
578+ /* use frac fb div on APUs */
579+ if (ASIC_IS_DCE41(rdev) || ASIC_IS_DCE61(rdev))
580+ pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV;
578581 } else {
579582 pll->flags |= RADEON_PLL_LEGACY;
580583
@@ -955,8 +958,8 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode · 374 unmodified lines
955958 break;
956959 }
957960
958− if (radeon_encoder->active_device &
959− (ATOM_DEVICE_LCD_SUPPORT | ATOM_DEVICE_DFP_SUPPORT)) {
961+ if ((radeon_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT | ATOM_DEVICE_DFP_SUPPORT)) ||
962+ (radeon_encoder_get_dp_bridge_encoder_id(encoder) != ENCODER_OBJECT_ID_NONE)) {
960963 struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
961964 struct drm_connector *connector =
962965 radeon_get_connector_for_encoder(encoder);
drivers/gpu/drm/radeon/atombios_encoders.c+4−0
@@ -230,6 +230,10 @@ atombios_dvo_setup(struct drm_encoder *encoder, int action) · 229 unmodified lines
230230 if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev))
231231 return;
232232
233+ /* some R4xx chips have the wrong frev */
234+ if (rdev->family <= CHIP_RV410)
235+ frev = 1;
236+
233237 switch (frev) {
234238 case 1:
235239 switch (crev) {
drivers/gpu/drm/radeon/r100.c+1−1
@@ -2553,7 +2553,7 @@ static void r100_pll_errata_after_data(struct radeon_device *rdev) · 2552 unmodified lines
25532553 * or the chip could hang on a subsequent access
25542554 */
25552555 if (rdev->pll_errata & CHIP_ERRATA_PLL_DELAY) {
2556− udelay(5000);
2556+ mdelay(5);
25572557 }
25582558
25592559 /* This function is required to workaround a hardware bug in some (all?)
drivers/gpu/drm/radeon/r600.c+3−3
@@ -1135,7 +1135,7 @@ static void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc · 1134 unmodified lines
11351135 }
11361136 if (rdev->flags & RADEON_IS_AGP) {
11371137 size_bf = mc->gtt_start;
1138− size_af = 0xFFFFFFFF - mc->gtt_end + 1;
1138+ size_af = 0xFFFFFFFF - mc->gtt_end;
11391139 if (size_bf > size_af) {
11401140 if (mc->mc_vram_size > size_bf) {
11411141 dev_warn(rdev->dev, "limiting VRAM\n");
@@ -1149,7 +1149,7 @@ static void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc · 7 unmodified lines
11491149 mc->real_vram_size = size_af;
11501150 mc->mc_vram_size = size_af;
11511151 }
1152− mc->vram_start = mc->gtt_end;
1152+ mc->vram_start = mc->gtt_end + 1;
11531153 }
11541154 mc->vram_end = mc->vram_start + mc->mc_vram_size - 1;
11551155 dev_info(rdev->dev, "VRAM: %lluM 0x%08llX - 0x%08llX (%lluM used)\n",
@@ -2839,7 +2839,7 @@ void r600_rlc_stop(struct radeon_device *rdev) · 1683 unmodified lines
28392839 /* r7xx asics need to soft reset RLC before halting */
28402840 WREG32(SRBM_SOFT_RESET, SOFT_RESET_RLC);
28412841 RREG32(SRBM_SOFT_RESET);
2842− udelay(15000);
2842+ mdelay(15);
28432843 WREG32(SRBM_SOFT_RESET, 0);
28442844 RREG32(SRBM_SOFT_RESET);
28452845 }
drivers/gpu/drm/radeon/r600_cp.c+3−3
@@ -407,7 +407,7 @@ static void r600_cp_load_microcode(drm_radeon_private_t *dev_priv) · 406 unmodified lines
407407
408408 RADEON_WRITE(R600_GRBM_SOFT_RESET, R600_SOFT_RESET_CP);
409409 RADEON_READ(R600_GRBM_SOFT_RESET);
410− DRM_UDELAY(15000);
410+ mdelay(15);
411411 RADEON_WRITE(R600_GRBM_SOFT_RESET, 0);
412412
413413 fw_data = (const __be32 *)dev_priv->me_fw->data;
@@ -500,7 +500,7 @@ static void r700_cp_load_microcode(drm_radeon_private_t *dev_priv) · 86 unmodified lines
500500
501501 RADEON_WRITE(R600_GRBM_SOFT_RESET, R600_SOFT_RESET_CP);
502502 RADEON_READ(R600_GRBM_SOFT_RESET);
503− DRM_UDELAY(15000);
503+ mdelay(15);
504504 RADEON_WRITE(R600_GRBM_SOFT_RESET, 0);
505505
506506 fw_data = (const __be32 *)dev_priv->pfp_fw->data;
@@ -1797,7 +1797,7 @@ static void r600_cp_init_ring_buffer(struct drm_device *dev, · 1290 unmodified lines
17971797
17981798 RADEON_WRITE(R600_GRBM_SOFT_RESET, R600_SOFT_RESET_CP);
17991799 RADEON_READ(R600_GRBM_SOFT_RESET);
1800− DRM_UDELAY(15000);
1800+ mdelay(15);
18011801 RADEON_WRITE(R600_GRBM_SOFT_RESET, 0);
18021802
18031803
drivers/gpu/drm/radeon/radeon_clocks.c+12−12
@@ -633,7 +633,7 @@ void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable) · 632 unmodified lines
633633 tmp &= ~(R300_SCLK_FORCE_VAP);
634634 tmp |= RADEON_SCLK_FORCE_CP;
635635 WREG32_PLL(RADEON_SCLK_CNTL, tmp);
636− udelay(15000);
636+ mdelay(15);
637637
638638 tmp = RREG32_PLL(R300_SCLK_CNTL2);
639639 tmp &= ~(R300_SCLK_FORCE_TCL |
@@ -651,12 +651,12 @@ void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable) · 11 unmodified lines
651651 tmp |= (RADEON_ENGIN_DYNCLK_MODE |
652652 (0x01 << RADEON_ACTIVE_HILO_LAT_SHIFT));
653653 WREG32_PLL(RADEON_CLK_PWRMGT_CNTL, tmp);
654− udelay(15000);
654+ mdelay(15);
655655
656656 tmp = RREG32_PLL(RADEON_CLK_PIN_CNTL);
657657 tmp |= RADEON_SCLK_DYN_START_CNTL;
658658 WREG32_PLL(RADEON_CLK_PIN_CNTL, tmp);
659− udelay(15000);
659+ mdelay(15);
660660
661661 /* When DRI is enabled, setting DYN_STOP_LAT to zero can cause some R200
662662 to lockup randomly, leave them as set by BIOS.
@@ -696,7 +696,7 @@ void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable) · 33 unmodified lines
696696 tmp |= RADEON_SCLK_MORE_FORCEON;
697697 }
698698 WREG32_PLL(RADEON_SCLK_MORE_CNTL, tmp);
699− udelay(15000);
699+ mdelay(15);
700700 }
701701
702702 /* RV200::A11 A12, RV250::A11 A12 */
@@ -709,7 +709,7 @@ void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable) · 6 unmodified lines
709709 tmp |= RADEON_TCL_BYPASS_DISABLE;
710710 WREG32_PLL(RADEON_PLL_PWRMGT_CNTL, tmp);
711711 }
712− udelay(15000);
712+ mdelay(15);
713713
714714 /*enable dynamic mode for display clocks (PIXCLK and PIX2CLK) */
715715 tmp = RREG32_PLL(RADEON_PIXCLKS_CNTL);
@@ -722,14 +722,14 @@ void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable) · 6 unmodified lines
722722 RADEON_PIXCLK_TMDS_ALWAYS_ONb);
723723
724724 WREG32_PLL(RADEON_PIXCLKS_CNTL, tmp);
725− udelay(15000);
725+ mdelay(15);
726726
727727 tmp = RREG32_PLL(RADEON_VCLK_ECP_CNTL);
728728 tmp |= (RADEON_PIXCLK_ALWAYS_ONb |
729729 RADEON_PIXCLK_DAC_ALWAYS_ONb);
730730
731731 WREG32_PLL(RADEON_VCLK_ECP_CNTL, tmp);
732− udelay(15000);
732+ mdelay(15);
733733 }
734734 } else {
735735 /* Turn everything OFF (ForceON to everything) */
@@ -861,7 +861,7 @@ void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable) · 125 unmodified lines
861861 }
862862 WREG32_PLL(RADEON_SCLK_CNTL, tmp);
863863
864− udelay(16000);
864+ mdelay(16);
865865
866866 if ((rdev->family == CHIP_R300) ||
867867 (rdev->family == CHIP_R350)) {
@@ -870,7 +870,7 @@ void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable) · 2 unmodified lines
870870 R300_SCLK_FORCE_GA |
871871 R300_SCLK_FORCE_CBA);
872872 WREG32_PLL(R300_SCLK_CNTL2, tmp);
873− udelay(16000);
873+ mdelay(16);
874874 }
875875
876876 if (rdev->flags & RADEON_IS_IGP) {
@@ -878,7 +878,7 @@ void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable) · 1 unmodified line
878878 tmp &= ~(RADEON_FORCEON_MCLKA |
879879 RADEON_FORCEON_YCLKA);
880880 WREG32_PLL(RADEON_MCLK_CNTL, tmp);
881− udelay(16000);
881+ mdelay(16);
882882 }
883883
884884 if ((rdev->family == CHIP_RV200) ||
@@ -887,7 +887,7 @@ void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable) · 2 unmodified lines
887887 tmp = RREG32_PLL(RADEON_SCLK_MORE_CNTL);
888888 tmp |= RADEON_SCLK_MORE_FORCEON;
889889 WREG32_PLL(RADEON_SCLK_MORE_CNTL, tmp);
890− udelay(16000);
890+ mdelay(16);
891891 }
892892
893893 tmp = RREG32_PLL(RADEON_PIXCLKS_CNTL);
@@ -900,7 +900,7 @@ void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable) · 6 unmodified lines
900900 RADEON_PIXCLK_TMDS_ALWAYS_ONb);
901901
902902 WREG32_PLL(RADEON_PIXCLKS_CNTL, tmp);
903− udelay(16000);
903+ mdelay(16);
904904
905905 tmp = RREG32_PLL(RADEON_VCLK_ECP_CNTL);
906906 tmp &= ~(RADEON_PIXCLK_ALWAYS_ONb |
drivers/gpu/drm/radeon/radeon_combios.c+4−4
@@ -2845,7 +2845,7 @@ bool radeon_combios_external_tmds_setup(struct drm_encoder *encoder) · 2844 unmodified lines
28452845 case 4:
28462846 val = RBIOS16(index);
28472847 index += 2;
2848− udelay(val * 1000);
2848+ mdelay(val);
28492849 break;
28502850 case 6:
28512851 slave_addr = id & 0xff;
@@ -3044,7 +3044,7 @@ static void combios_parse_pll_table(struct drm_device *dev, uint16_t offset) · 192 unmodified lines
30443044 udelay(150);
30453045 break;
30463046 case 2:
3047− udelay(1000);
3047+ mdelay(1);
30483048 break;
30493049 case 3:
30503050 while (tmp--) {
@@ -3075,13 +3075,13 @@ static void combios_parse_pll_table(struct drm_device *dev, uint16_t offset) · 24 unmodified lines
30753075 /*mclk_cntl |= 0x00001111;*//* ??? */
30763076 WREG32_PLL(RADEON_MCLK_CNTL,
30773077 mclk_cntl);
3078− udelay(10000);
3078+ mdelay(10);
30793079 #endif
30803080 WREG32_PLL
30813081 (RADEON_CLK_PWRMGT_CNTL,
30823082 tmp &
30833083 ~RADEON_CG_NO1_DEBUG_0);
3084− udelay(10000);
3084+ mdelay(10);
30853085 }
30863086 break;
30873087 default:
drivers/gpu/drm/radeon/radeon_connectors.c+2−2
@@ -970,7 +970,7 @@ radeon_dvi_detect(struct drm_connector *connector, bool force) · 969 unmodified lines
970970
971971 encoder = obj_to_encoder(obj);
972972
973− if (encoder->encoder_type != DRM_MODE_ENCODER_DAC ||
973+ if (encoder->encoder_type != DRM_MODE_ENCODER_DAC &&
974974 encoder->encoder_type != DRM_MODE_ENCODER_TVDAC)
975975 continue;
976976
@@ -1000,6 +1000,7 @@ radeon_dvi_detect(struct drm_connector *connector, bool force) · 23 unmodified lines
10001000 * cases the DVI port is actually a virtual KVM port connected to the service
10011001 * processor.
10021002 */
1003+out:
10031004 if ((!rdev->is_atom_bios) &&
10041005 (ret == connector_status_disconnected) &&
10051006 rdev->mode_info.bios_hardcoded_edid_size) {
@@ -1007,7 +1008,6 @@ radeon_dvi_detect(struct drm_connector *connector, bool force) · 1 unmodified line
10071008 ret = connector_status_connected;
10081009 }
10091010
1010−out:
10111011 /* updated in get modes as well since we need to know if it's analog or digital */
10121012 radeon_connector_update_scratch_regs(connector, ret);
10131013 return ret;
drivers/gpu/drm/radeon/radeon_display.c+2−1
@@ -533,7 +533,7 @@ static void radeon_crtc_init(struct drm_device *dev, int index) · 532 unmodified lines
533533 radeon_legacy_init_crtc(dev, radeon_crtc);
534534 }
535535
536−static const char *encoder_names[36] = {
536+static const char *encoder_names[37] = {
537537 "NONE",
538538 "INTERNAL_LVDS",
539539 "INTERNAL_TMDS1",
@@ -570,6 +570,7 @@ static const char *encoder_names[36] = { · 30 unmodified lines
570570 "INTERNAL_UNIPHY2",
571571 "NUTMEG",
572572 "TRAVIS",
573+ "INTERNAL_VCE"
573574 };
574575
575576 static const char *connector_names[15] = {
drivers/gpu/drm/radeon/radeon_i2c.c+4−0
@@ -900,6 +900,10 @@ struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev, · 899 unmodified lines
900900 struct radeon_i2c_chan *i2c;
901901 int ret;
902902
903+ /* don't add the mm_i2c bus unless hw_i2c is enabled */
904+ if (rec->mm_i2c && (radeon_hw_i2c == 0))
905+ return NULL;
906+
903907 i2c = kzalloc(sizeof(struct radeon_i2c_chan), GFP_KERNEL);
904908 if (i2c == NULL)
905909 return NULL;
drivers/gpu/drm/radeon/radeon_irq_kms.c+6−0
@@ -147,6 +147,12 @@ static bool radeon_msi_ok(struct radeon_device *rdev) · 146 unmodified lines
147147 (rdev->pdev->subsystem_device == 0x01fd))
148148 return true;
149149
150+ /* RV515 seems to have MSI issues where it loses
151+ * MSI rearms occasionally. This leads to lockups and freezes.
152+ * disable it by default.
153+ */
154+ if (rdev->family == CHIP_RV515)
155+ return false;
150156 if (rdev->flags & RADEON_IS_IGP) {
151157 /* APUs work fine with MSIs */
152158 if (rdev->family >= CHIP_PALM)
drivers/gpu/drm/radeon/radeon_legacy_encoders.c+6−6
@@ -88,7 +88,7 @@ static void radeon_legacy_lvds_update(struct drm_encoder *encoder, int mode) · 87 unmodified lines
8888 lvds_pll_cntl = RREG32(RADEON_LVDS_PLL_CNTL);
8989 lvds_pll_cntl |= RADEON_LVDS_PLL_EN;
9090 WREG32(RADEON_LVDS_PLL_CNTL, lvds_pll_cntl);
91− udelay(1000);
91+ mdelay(1);
9292
9393 lvds_pll_cntl = RREG32(RADEON_LVDS_PLL_CNTL);
9494 lvds_pll_cntl &= ~RADEON_LVDS_PLL_RESET;
@@ -101,7 +101,7 @@ static void radeon_legacy_lvds_update(struct drm_encoder *encoder, int mode) · 6 unmodified lines
101101 (backlight_level << RADEON_LVDS_BL_MOD_LEVEL_SHIFT));
102102 if (is_mac)
103103 lvds_gen_cntl |= RADEON_LVDS_BL_MOD_EN;
104− udelay(panel_pwr_delay * 1000);
104+ mdelay(panel_pwr_delay);
105105 WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl);
106106 break;
107107 case DRM_MODE_DPMS_STANDBY:
@@ -118,10 +118,10 @@ static void radeon_legacy_lvds_update(struct drm_encoder *encoder, int mode) · 10 unmodified lines
118118 WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl);
119119 lvds_gen_cntl &= ~(RADEON_LVDS_ON | RADEON_LVDS_BLON | RADEON_LVDS_EN | RADEON_LVDS_DIGON);
120120 }
121− udelay(panel_pwr_delay * 1000);
121+ mdelay(panel_pwr_delay);
122122 WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl);
123123 WREG32_PLL(RADEON_PIXCLKS_CNTL, pixclks_cntl);
124− udelay(panel_pwr_delay * 1000);
124+ mdelay(panel_pwr_delay);
125125 break;
126126 }
127127
@@ -656,7 +656,7 @@ static enum drm_connector_status radeon_legacy_primary_dac_detect(struct drm_enc · 528 unmodified lines
656656
657657 WREG32(RADEON_DAC_MACRO_CNTL, tmp);
658658
659− udelay(2000);
659+ mdelay(2);
660660
661661 if (RREG32(RADEON_DAC_CNTL) & RADEON_DAC_CMP_OUTPUT)
662662 found = connector_status_connected;
@@ -1499,7 +1499,7 @@ static enum drm_connector_status radeon_legacy_tv_dac_detect(struct drm_encoder · 836 unmodified lines
14991499 tmp = dac_cntl2 | RADEON_DAC2_DAC2_CLK_SEL | RADEON_DAC2_CMP_EN;
15001500 WREG32(RADEON_DAC_CNTL2, tmp);
15011501
1502− udelay(10000);
1502+ mdelay(10);
15031503
15041504 if (ASIC_IS_R300(rdev)) {
15051505 if (RREG32(RADEON_DAC_CNTL2) & RADEON_DAC2_CMP_OUT_B)
drivers/gpu/drm/radeon/rv770.c+2−2
@@ -969,7 +969,7 @@ void r700_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) · 968 unmodified lines
969969 }
970970 if (rdev->flags & RADEON_IS_AGP) {
971971 size_bf = mc->gtt_start;
972− size_af = 0xFFFFFFFF - mc->gtt_end + 1;
972+ size_af = 0xFFFFFFFF - mc->gtt_end;
973973 if (size_bf > size_af) {
974974 if (mc->mc_vram_size > size_bf) {
975975 dev_warn(rdev->dev, "limiting VRAM\n");
@@ -983,7 +983,7 @@ void r700_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) · 7 unmodified lines
983983 mc->real_vram_size = size_af;
984984 mc->mc_vram_size = size_af;
985985 }
986− mc->vram_start = mc->gtt_end;
986+ mc->vram_start = mc->gtt_end + 1;
987987 }
988988 mc->vram_end = mc->vram_start + mc->mc_vram_size - 1;
989989 dev_info(rdev->dev, "VRAM: %lluM 0x%08llX - 0x%08llX (%lluM used)\n",
drivers/gpu/drm/radeon/si.c+2−3
@@ -2999,8 +2999,8 @@ int si_rlc_init(struct radeon_device *rdev) · 2998 unmodified lines
29992999 }
30003000 r = radeon_bo_pin(rdev->rlc.save_restore_obj, RADEON_GEM_DOMAIN_VRAM,
30013001 &rdev->rlc.save_restore_gpu_addr);
3002+ radeon_bo_unreserve(rdev->rlc.save_restore_obj);
30023003 if (r) {
3003− radeon_bo_unreserve(rdev->rlc.save_restore_obj);
30043004 dev_warn(rdev->dev, "(%d) pin RLC sr bo failed\n", r);
30053005 si_rlc_fini(rdev);
30063006 return r;
@@ -3023,9 +3023,8 @@ int si_rlc_init(struct radeon_device *rdev) · 16 unmodified lines
30233023 }
30243024 r = radeon_bo_pin(rdev->rlc.clear_state_obj, RADEON_GEM_DOMAIN_VRAM,
30253025 &rdev->rlc.clear_state_gpu_addr);
3026+ radeon_bo_unreserve(rdev->rlc.clear_state_obj);
30263027 if (r) {
3027−
3028− radeon_bo_unreserve(rdev->rlc.clear_state_obj);
30293028 dev_warn(rdev->dev, "(%d) pin RLC c bo failed\n", r);
30303029 si_rlc_fini(rdev);
30313030 return r;
drivers/gpu/drm/savage/savage_state.c+3−3
@@ -988,7 +988,7 @@ int savage_bci_cmdbuf(struct drm_device *dev, void *data, struct drm_file *file_ · 987 unmodified lines
988988 * for locking on FreeBSD.
989989 */
990990 if (cmdbuf->size) {
991− kcmd_addr = kmalloc(cmdbuf->size * 8, GFP_KERNEL);
991+ kcmd_addr = kmalloc_array(cmdbuf->size, 8, GFP_KERNEL);
992992 if (kcmd_addr == NULL)
993993 return -ENOMEM;
994994
@@ -1015,8 +1015,8 @@ int savage_bci_cmdbuf(struct drm_device *dev, void *data, struct drm_file *file_ · 20 unmodified lines
10151015 cmdbuf->vb_addr = kvb_addr;
10161016 }
10171017 if (cmdbuf->nbox) {
1018− kbox_addr = kmalloc(cmdbuf->nbox * sizeof(struct drm_clip_rect),
1019− GFP_KERNEL);
1018+ kbox_addr = kmalloc_array(cmdbuf->nbox, sizeof(struct drm_clip_rect),
1019+ GFP_KERNEL);
10201020 if (kbox_addr == NULL) {
10211021 ret = -ENOMEM;
10221022 goto done;
drivers/hid/Kconfig+1−1
@@ -34,7 +34,7 @@ config HID · 33 unmodified lines
3434 config HID_BATTERY_STRENGTH
3535 bool
3636 depends on HID && POWER_SUPPLY && HID = POWER_SUPPLY
37− default y
37+ default n
3838
3939 config HIDRAW
4040 bool "/dev/hidraw raw HID device support"
drivers/hid/hid-tivo.c+1−1
@@ -62,7 +62,7 @@ static int tivo_input_mapping(struct hid_device *hdev, struct hid_input *hi, · 61 unmodified lines
6262
6363 static const struct hid_device_id tivo_devices[] = {
6464 /* TiVo Slide Bluetooth remote, pairs with a Broadcom dongle */
65− { HID_USB_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE_BT) },
65+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE_BT) },
6666 { HID_USB_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE) },
6767 { }
6868 };
drivers/hsi/clients/hsi_char.c+1−1
@@ -123,7 +123,7 @@ struct hsc_client_data { · 122 unmodified lines
123123 static unsigned int hsc_major;
124124 /* Maximum buffer size that hsi_char will accept from userspace */
125125 static unsigned int max_data_size = 0x1000;
126−module_param(max_data_size, uint, S_IRUSR | S_IWUSR);
126+module_param(max_data_size, uint, 0);
127127 MODULE_PARM_DESC(max_data_size, "max read/write data size [4,8..65536] (^2)");
128128
129129 static void hsc_add_tail(struct hsc_channel *channel, struct hsi_msg *msg,
drivers/hsi/hsi.c+118−105
@@ -21,26 +21,13 @@ · 20 unmodified lines
2121 */
2222 #include <linux/hsi/hsi.h>
2323 #include <linux/compiler.h>
24−#include <linux/rwsem.h>
2524 #include <linux/list.h>
26−#include <linux/spinlock.h>
2725 #include <linux/kobject.h>
2826 #include <linux/slab.h>
2927 #include <linux/string.h>
28+#include <linux/notifier.h>
3029 #include "hsi_core.h"
3130
32−static struct device_type hsi_ctrl = {
33− .name = "hsi_controller",
34−};
35−
36−static struct device_type hsi_cl = {
37− .name = "hsi_client",
38−};
39−
40−static struct device_type hsi_port = {
41− .name = "hsi_port",
42−};
43−
4431 static ssize_t modalias_show(struct device *dev,
4532 struct device_attribute *a __maybe_unused, char *buf)
4633 {
@@ -54,8 +41,7 @@ static struct device_attribute hsi_bus_dev_attrs[] = { · 7 unmodified lines
5441
5542 static int hsi_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
5643 {
57− if (dev->type == &hsi_cl)
58− add_uevent_var(env, "MODALIAS=hsi:%s", dev_name(dev));
44+ add_uevent_var(env, "MODALIAS=hsi:%s", dev_name(dev));
5945
6046 return 0;
6147 }
@@ -80,12 +66,10 @@ static void hsi_client_release(struct device *dev) · 18 unmodified lines
8066 static void hsi_new_client(struct hsi_port *port, struct hsi_board_info *info)
8167 {
8268 struct hsi_client *cl;
83− unsigned long flags;
8469
8570 cl = kzalloc(sizeof(*cl), GFP_KERNEL);
8671 if (!cl)
8772 return;
88− cl->device.type = &hsi_cl;
8973 cl->tx_cfg = info->tx_cfg;
9074 cl->rx_cfg = info->rx_cfg;
9175 cl->device.bus = &hsi_bus_type;
@@ -93,14 +77,11 @@ static void hsi_new_client(struct hsi_port *port, struct hsi_board_info *info) · 1 unmodified line
9377 cl->device.release = hsi_client_release;
9478 dev_set_name(&cl->device, info->name);
9579 cl->device.platform_data = info->platform_data;
96− spin_lock_irqsave(&port->clock, flags);
97− list_add_tail(&cl->link, &port->clients);
98− spin_unlock_irqrestore(&port->clock, flags);
9980 if (info->archdata)
10081 cl->device.archdata = *info->archdata;
10182 if (device_register(&cl->device) < 0) {
10283 pr_err("hsi: failed to register client: %s\n", info->name);
103− kfree(cl);
84+ put_device(&cl->device);
10485 }
10586 }
10687
@@ -120,13 +101,6 @@ static void hsi_scan_board_info(struct hsi_controller *hsi) · 13 unmodified lines
120101
121102 static int hsi_remove_client(struct device *dev, void *data __maybe_unused)
122103 {
123− struct hsi_client *cl = to_hsi_client(dev);
124− struct hsi_port *port = to_hsi_port(dev->parent);
125− unsigned long flags;
126−
127− spin_lock_irqsave(&port->clock, flags);
128− list_del(&cl->link);
129− spin_unlock_irqrestore(&port->clock, flags);
130104 device_unregister(dev);
131105
132106 return 0;
@@ -140,12 +114,17 @@ static int hsi_remove_port(struct device *dev, void *data __maybe_unused) · 7 unmodified lines
140114 return 0;
141115 }
142116
143−static void hsi_controller_release(struct device *dev __maybe_unused)
117+static void hsi_controller_release(struct device *dev)
144118 {
119+ struct hsi_controller *hsi = to_hsi_controller(dev);
120+
121+ kfree(hsi->port);
122+ kfree(hsi);
145123 }
146124
147−static void hsi_port_release(struct device *dev __maybe_unused)
125+static void hsi_port_release(struct device *dev)
148126 {
127+ kfree(to_hsi_port(dev));
149128 }
150129
151130 /**
@@ -170,20 +149,12 @@ int hsi_register_controller(struct hsi_controller *hsi) · 18 unmodified lines
170149 unsigned int i;
171150 int err;
172151
173− hsi->device.type = &hsi_ctrl;
174− hsi->device.bus = &hsi_bus_type;
175− hsi->device.release = hsi_controller_release;
176− err = device_register(&hsi->device);
152+ err = device_add(&hsi->device);
177153 if (err < 0)
178154 return err;
179155 for (i = 0; i < hsi->num_ports; i++) {
180− hsi->port[i].device.parent = &hsi->device;
181− hsi->port[i].device.bus = &hsi_bus_type;
182− hsi->port[i].device.release = hsi_port_release;
183− hsi->port[i].device.type = &hsi_port;
184− INIT_LIST_HEAD(&hsi->port[i].clients);
185− spin_lock_init(&hsi->port[i].clock);
186− err = device_register(&hsi->port[i].device);
156+ hsi->port[i]->device.parent = &hsi->device;
157+ err = device_add(&hsi->port[i]->device);
187158 if (err < 0)
188159 goto out;
189160 }
@@ -192,7 +163,9 @@ int hsi_register_controller(struct hsi_controller *hsi) · 2 unmodified lines
192163
193164 return 0;
194165 out:
195− hsi_unregister_controller(hsi);
166+ while (i-- > 0)
167+ device_del(&hsi->port[i]->device);
168+ device_del(&hsi->device);
196169
197170 return err;
198171 }
@@ -222,6 +195,29 @@ static inline int hsi_dummy_cl(struct hsi_client *cl __maybe_unused) · 23 unmodified lines
222195 return 0;
223196 }
224197
198+/**
199+ * hsi_put_controller - Free an HSI controller
200+ *
201+ * @hsi: Pointer to the HSI controller to freed
202+ *
203+ * HSI controller drivers should only use this function if they need
204+ * to free their allocated hsi_controller structures before a successful
205+ * call to hsi_register_controller. Other use is not allowed.
206+ */
207+void hsi_put_controller(struct hsi_controller *hsi)
208+{
209+ unsigned int i;
210+
211+ if (!hsi)
212+ return;
213+
214+ for (i = 0; i < hsi->num_ports; i++)
215+ if (hsi->port && hsi->port[i])
216+ put_device(&hsi->port[i]->device);
217+ put_device(&hsi->device);
218+}
219+EXPORT_SYMBOL_GPL(hsi_put_controller);
220+
225221 /**
226222 * hsi_alloc_controller - Allocate an HSI controller and its ports
227223 * @n_ports: Number of ports on the HSI controller
@@ -232,54 +228,51 @@ static inline int hsi_dummy_cl(struct hsi_client *cl __maybe_unused) · 4 unmodified lines
232228 struct hsi_controller *hsi_alloc_controller(unsigned int n_ports, gfp_t flags)
233229 {
234230 struct hsi_controller *hsi;
235− struct hsi_port *port;
231+ struct hsi_port **port;
236232 unsigned int i;
237233
238234 if (!n_ports)
239235 return NULL;
240236
241− port = kzalloc(sizeof(*port)*n_ports, flags);
242− if (!port)
243− return NULL;
244237 hsi = kzalloc(sizeof(*hsi), flags);
245238 if (!hsi)
246− goto out;
247− for (i = 0; i < n_ports; i++) {
248− dev_set_name(&port[i].device, "port%d", i);
249− port[i].num = i;
250− port[i].async = hsi_dummy_msg;
251− port[i].setup = hsi_dummy_cl;
252− port[i].flush = hsi_dummy_cl;
253− port[i].start_tx = hsi_dummy_cl;
254− port[i].stop_tx = hsi_dummy_cl;
255− port[i].release = hsi_dummy_cl;
256− mutex_init(&port[i].lock);
239+ return NULL;
240+ port = kzalloc(sizeof(*port)*n_ports, flags);
241+ if (!port) {
242+ kfree(hsi);
243+ return NULL;
257244 }
258245 hsi->num_ports = n_ports;
259246 hsi->port = port;
247+ hsi->device.release = hsi_controller_release;
248+ device_initialize(&hsi->device);
249+
250+ for (i = 0; i < n_ports; i++) {
251+ port[i] = kzalloc(sizeof(**port), flags);
252+ if (port[i] == NULL)
253+ goto out;
254+ port[i]->num = i;
255+ port[i]->async = hsi_dummy_msg;
256+ port[i]->setup = hsi_dummy_cl;
257+ port[i]->flush = hsi_dummy_cl;
258+ port[i]->start_tx = hsi_dummy_cl;
259+ port[i]->stop_tx = hsi_dummy_cl;
260+ port[i]->release = hsi_dummy_cl;
261+ mutex_init(&port[i]->lock);
262+ ATOMIC_INIT_NOTIFIER_HEAD(&port[i]->n_head);
263+ dev_set_name(&port[i]->device, "port%d", i);
264+ hsi->port[i]->device.release = hsi_port_release;
265+ device_initialize(&hsi->port[i]->device);
266+ }
260267
261268 return hsi;
262269 out:
263− kfree(port);
270+ hsi_put_controller(hsi);
264271
265272 return NULL;
266273 }
267274 EXPORT_SYMBOL_GPL(hsi_alloc_controller);
268275
269−/**
270− * hsi_free_controller - Free an HSI controller
271− * @hsi: Pointer to HSI controller
272− */
273−void hsi_free_controller(struct hsi_controller *hsi)
274−{
275− if (!hsi)
276− return;
277−
278− kfree(hsi->port);
279− kfree(hsi);
280−}
281−EXPORT_SYMBOL_GPL(hsi_free_controller);
282−
283276 /**
284277 * hsi_free_msg - Free an HSI message
285278 * @msg: Pointer to the HSI message
@@ -414,37 +407,67 @@ void hsi_release_port(struct hsi_client *cl) · 128 unmodified lines
414407 }
415408 EXPORT_SYMBOL_GPL(hsi_release_port);
416409
417−static int hsi_start_rx(struct hsi_client *cl, void *data __maybe_unused)
410+static int hsi_event_notifier_call(struct notifier_block *nb,
411+ unsigned long event, void *data __maybe_unused)
418412 {
419− if (cl->hsi_start_rx)
420− (*cl->hsi_start_rx)(cl);
413+ struct hsi_client *cl = container_of(nb, struct hsi_client, nb);
414+
415+ (*cl->ehandler)(cl, event);
421416
422417 return 0;
423418 }
424419
425−static int hsi_stop_rx(struct hsi_client *cl, void *data __maybe_unused)
420+/**
421+ * hsi_register_port_event - Register a client to receive port events
422+ * @cl: HSI client that wants to receive port events
423+ * @cb: Event handler callback
424+ *
425+ * Clients should register a callback to be able to receive
426+ * events from the ports. Registration should happen after
427+ * claiming the port.
428+ * The handler can be called in interrupt context.
429+ *
430+ * Returns -errno on error, or 0 on success.
431+ */
432+int hsi_register_port_event(struct hsi_client *cl,
433+ void (*handler)(struct hsi_client *, unsigned long))
426434 {
427− if (cl->hsi_stop_rx)
428− (*cl->hsi_stop_rx)(cl);
435+ struct hsi_port *port = hsi_get_port(cl);
429436
430− return 0;
437+ if (!handler || cl->ehandler)
438+ return -EINVAL;
439+ if (!hsi_port_claimed(cl))
440+ return -EACCES;
441+ cl->ehandler = handler;
442+ cl->nb.notifier_call = hsi_event_notifier_call;
443+
444+ return atomic_notifier_chain_register(&port->n_head, &cl->nb);
431445 }
446+EXPORT_SYMBOL_GPL(hsi_register_port_event);
432447
433−static int hsi_port_for_each_client(struct hsi_port *port, void *data,
434− int (*fn)(struct hsi_client *cl, void *data))
448+/**
449+ * hsi_unregister_port_event - Stop receiving port events for a client
450+ * @cl: HSI client that wants to stop receiving port events
451+ *
452+ * Clients should call this function before releasing their associated
453+ * port.
454+ *
455+ * Returns -errno on error, or 0 on success.
456+ */
457+int hsi_unregister_port_event(struct hsi_client *cl)
435458 {
436− struct hsi_client *cl;
459+ struct hsi_port *port = hsi_get_port(cl);
460+ int err;
437461
438− spin_lock(&port->clock);
439− list_for_each_entry(cl, &port->clients, link) {
440− spin_unlock(&port->clock);
441− (*fn)(cl, data);
442− spin_lock(&port->clock);
443− }
444− spin_unlock(&port->clock);
462+ WARN_ON(!hsi_port_claimed(cl));
445463
446− return 0;
464+ err = atomic_notifier_chain_unregister(&port->n_head, &cl->nb);
465+ if (!err)
466+ cl->ehandler = NULL;
467+
468+ return err;
447469 }
470+EXPORT_SYMBOL_GPL(hsi_unregister_port_event);
448471
449472 /**
450473 * hsi_event -Notifies clients about port events
@@ -458,22 +481,12 @@ static int hsi_port_for_each_client(struct hsi_port *port, void *data, · 7 unmodified lines
458481 * Events:
459482 * HSI_EVENT_START_RX - Incoming wake line high
460483 * HSI_EVENT_STOP_RX - Incoming wake line down
484+ *
485+ * Returns -errno on error, or 0 on success.
461486 */
462−void hsi_event(struct hsi_port *port, unsigned int event)
487+int hsi_event(struct hsi_port *port, unsigned long event)
463488 {
464− int (*fn)(struct hsi_client *cl, void *data);
465−
466− switch (event) {
467− case HSI_EVENT_START_RX:
468− fn = hsi_start_rx;
469− break;
470− case HSI_EVENT_STOP_RX:
471− fn = hsi_stop_rx;
472− break;
473− default:
474− return;
475− }
476− hsi_port_for_each_client(port, NULL, fn);
489+ return atomic_notifier_call_chain(&port->n_head, event, NULL);
477490 }
478491 EXPORT_SYMBOL_GPL(hsi_event);
479492
drivers/hwmon/acpi_power_meter.c+1−0
@@ -391,6 +391,7 @@ static ssize_t show_str(struct device *dev, · 390 unmodified lines
391391 break;
392392 default:
393393 BUG();
394+ val = "";
394395 }
395396
396397 return sprintf(buf, "%s\n", val);
drivers/hwmon/ad7314.c+5−7
@@ -47,7 +47,7 @@ struct ad7314_data { · 46 unmodified lines
4747 u16 rx ____cacheline_aligned;
4848 };
4949
50−static int ad7314_spi_read(struct ad7314_data *chip, s16 *data)
50+static int ad7314_spi_read(struct ad7314_data *chip)
5151 {
5252 int ret;
5353
@@ -57,9 +57,7 @@ static int ad7314_spi_read(struct ad7314_data *chip, s16 *data) · 3 unmodified lines
5757 return ret;
5858 }
5959
60− *data = be16_to_cpu(chip->rx);
61−
62− return ret;
60+ return be16_to_cpu(chip->rx);
6361 }
6462
6563 static ssize_t ad7314_show_temperature(struct device *dev,
@@ -70,12 +68,12 @@ static ssize_t ad7314_show_temperature(struct device *dev, · 4 unmodified lines
7068 s16 data;
7169 int ret;
7270
73− ret = ad7314_spi_read(chip, &data);
71+ ret = ad7314_spi_read(chip);
7472 if (ret < 0)
7573 return ret;
7674 switch (spi_get_device_id(chip->spi_dev)->driver_data) {
7775 case ad7314:
78− data = (data & AD7314_TEMP_MASK) >> AD7314_TEMP_OFFSET;
76+ data = (ret & AD7314_TEMP_MASK) >> AD7314_TEMP_OFFSET;
7977 data = (data << 6) >> 6;
8078
8179 return sprintf(buf, "%d\n", 250 * data);
@@ -86,7 +84,7 @@ static ssize_t ad7314_show_temperature(struct device *dev, · 4 unmodified lines
8684 * with a sign bit - which is a 14 bit 2's complement
8785 * register. 1lsb - 31.25 milli degrees centigrade
8886 */
89− data &= ADT7301_TEMP_MASK;
87+ data = ret & ADT7301_TEMP_MASK;
9088 data = (data << 2) >> 2;
9189
9290 return sprintf(buf, "%d\n",
drivers/hwmon/ads1015.c+16−17
@@ -59,14 +59,11 @@ struct ads1015_data { · 58 unmodified lines
5959 struct ads1015_channel_data channel_data[ADS1015_CHANNELS];
6060 };
6161
62−static int ads1015_read_value(struct i2c_client *client, unsigned int channel,
63− int *value)
62+static int ads1015_read_adc(struct i2c_client *client, unsigned int channel)
6463 {
6564 u16 config;
66− s16 conversion;
6765 struct ads1015_data *data = i2c_get_clientdata(client);
6866 unsigned int pga = data->channel_data[channel].pga;
69− int fullscale;
7067 unsigned int data_rate = data->channel_data[channel].data_rate;
7168 unsigned int conversion_time_ms;
7269 int res;
@@ -78,7 +75,6 @@ static int ads1015_read_value(struct i2c_client *client, unsigned int channel, · 5 unmodified lines
7875 if (res < 0)
7976 goto err_unlock;
8077 config = res;
81− fullscale = fullscale_table[pga];
8278 conversion_time_ms = DIV_ROUND_UP(1000, data_rate_table[data_rate]);
8379
8480 /* setup and start single conversion */
@@ -105,33 +101,36 @@ static int ads1015_read_value(struct i2c_client *client, unsigned int channel, · 20 unmodified lines
105101 }
106102
107103 res = i2c_smbus_read_word_swapped(client, ADS1015_CONVERSION);
108− if (res < 0)
109− goto err_unlock;
110− conversion = res;
111−
112− mutex_unlock(&data->update_lock);
113−
114− *value = DIV_ROUND_CLOSEST(conversion * fullscale, 0x7ff0);
115−
116− return 0;
117104
118105 err_unlock:
119106 mutex_unlock(&data->update_lock);
120107 return res;
121108 }
122109
110+static int ads1015_reg_to_mv(struct i2c_client *client, unsigned int channel,
111+ s16 reg)
112+{
113+ struct ads1015_data *data = i2c_get_clientdata(client);
114+ unsigned int pga = data->channel_data[channel].pga;
115+ int fullscale = fullscale_table[pga];
116+
117+ return DIV_ROUND_CLOSEST(reg * fullscale, 0x7ff0);
118+}
119+
123120 /* sysfs callback function */
124121 static ssize_t show_in(struct device *dev, struct device_attribute *da,
125122 char *buf)
126123 {
127124 struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
128125 struct i2c_client *client = to_i2c_client(dev);
129− int in;
130126 int res;
127+ int index = attr->index;
131128
132− res = ads1015_read_value(client, attr->index, &in);
129+ res = ads1015_read_adc(client, index);
130+ if (res < 0)
131+ return res;
133132
134− return (res < 0) ? res : sprintf(buf, "%d\n", in);
133+ return sprintf(buf, "%d\n", ads1015_reg_to_mv(client, index, res));
135134 }
136135
137136 static const struct sensor_device_attribute ads1015_in[] = {
drivers/hwmon/fam15h_power.c+42−0
@@ -122,6 +122,41 @@ static bool __devinit fam15h_power_is_internal_node0(struct pci_dev *f4) · 121 unmodified lines
122122 return true;
123123 }
124124
125+/*
126+ * Newer BKDG versions have an updated recommendation on how to properly
127+ * initialize the running average range (was: 0xE, now: 0x9). This avoids
128+ * counter saturations resulting in bogus power readings.
129+ * We correct this value ourselves to cope with older BIOSes.
130+ */
131+static DEFINE_PCI_DEVICE_TABLE(affected_device) = {
132+ { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) },
133+ { 0 }
134+};
135+
136+static void __devinit tweak_runavg_range(struct pci_dev *pdev)
137+{
138+ u32 val;
139+
140+ /*
141+ * let this quirk apply only to the current version of the
142+ * northbridge, since future versions may change the behavior
143+ */
144+ if (!pci_match_id(affected_device, pdev))
145+ return;
146+
147+ pci_bus_read_config_dword(pdev->bus,
148+ PCI_DEVFN(PCI_SLOT(pdev->devfn), 5),
149+ REG_TDP_RUNNING_AVERAGE, &val);
150+ if ((val & 0xf) != 0xe)
151+ return;
152+
153+ val &= ~0xf;
154+ val |= 0x9;
155+ pci_bus_write_config_dword(pdev->bus,
156+ PCI_DEVFN(PCI_SLOT(pdev->devfn), 5),
157+ REG_TDP_RUNNING_AVERAGE, val);
158+}
159+
125160 static void __devinit fam15h_power_init_data(struct pci_dev *f4,
126161 struct fam15h_power_data *data)
127162 {
@@ -155,6 +190,13 @@ static int __devinit fam15h_power_probe(struct pci_dev *pdev, · 27 unmodified lines
155190 struct device *dev;
156191 int err;
157192
193+ /*
194+ * though we ignore every other northbridge, we still have to
195+ * do the tweaking on _each_ node in MCM processors as the counters
196+ * are working hand-in-hand
197+ */
198+ tweak_runavg_range(pdev);
199+
158200 if (!fam15h_power_is_internal_node0(pdev)) {
159201 err = -ENODEV;
160202 goto exit;
drivers/hwmon/pmbus/pmbus_core.c+8−9
@@ -710,13 +710,13 @@ static u16 pmbus_data2reg(struct pmbus_data *data, · 709 unmodified lines
710710 * If a negative value is stored in any of the referenced registers, this value
711711 * reflects an error code which will be returned.
712712 */
713−static int pmbus_get_boolean(struct pmbus_data *data, int index, int *val)
713+static int pmbus_get_boolean(struct pmbus_data *data, int index)
714714 {
715715 u8 s1 = (index >> 24) & 0xff;
716716 u8 s2 = (index >> 16) & 0xff;
717717 u8 reg = (index >> 8) & 0xff;
718718 u8 mask = index & 0xff;
719− int status;
719+ int ret, status;
720720 u8 regval;
721721
722722 status = data->status[reg];
@@ -725,7 +725,7 @@ static int pmbus_get_boolean(struct pmbus_data *data, int index, int *val) · 2 unmodified lines
725725
726726 regval = status & mask;
727727 if (!s1 && !s2)
728− *val = !!regval;
728+ ret = !!regval;
729729 else {
730730 long v1, v2;
731731 struct pmbus_sensor *sensor1, *sensor2;
@@ -739,9 +739,9 @@ static int pmbus_get_boolean(struct pmbus_data *data, int index, int *val) · 7 unmodified lines
739739
740740 v1 = pmbus_reg2data(data, sensor1);
741741 v2 = pmbus_reg2data(data, sensor2);
742− *val = !!(regval && v1 >= v2);
742+ ret = !!(regval && v1 >= v2);
743743 }
744− return 0;
744+ return ret;
745745 }
746746
747747 static ssize_t pmbus_show_boolean(struct device *dev,
@@ -750,11 +750,10 @@ static ssize_t pmbus_show_boolean(struct device *dev, · 2 unmodified lines
750750 struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
751751 struct pmbus_data *data = pmbus_update_device(dev);
752752 int val;
753− int err;
754753
755− err = pmbus_get_boolean(data, attr->index, &val);
756− if (err)
757− return err;
754+ val = pmbus_get_boolean(data, attr->index);
755+ if (val < 0)
756+ return val;
758757 return snprintf(buf, PAGE_SIZE, "%d\n", val);
759758 }
760759
drivers/hwmon/smsc47b397.c+8−6
@@ -343,10 +343,11 @@ exit: · 342 unmodified lines
343343 return err;
344344 }
345345
346−static int __init smsc47b397_find(unsigned short *addr)
346+static int __init smsc47b397_find(void)
347347 {
348348 u8 id, rev;
349349 char *name;
350+ unsigned short addr;
350351
351352 superio_enter();
352353 id = force_id ? force_id : superio_inb(SUPERIO_REG_DEVID);
@@ -370,14 +371,14 @@ static int __init smsc47b397_find(unsigned short *addr) · 17 unmodified lines
370371 rev = superio_inb(SUPERIO_REG_DEVREV);
371372
372373 superio_select(SUPERIO_REG_LD8);
373− *addr = (superio_inb(SUPERIO_REG_BASE_MSB) << 8)
374+ addr = (superio_inb(SUPERIO_REG_BASE_MSB) << 8)
374375 | superio_inb(SUPERIO_REG_BASE_LSB);
375376
376377 pr_info("found SMSC %s (base address 0x%04x, revision %u)\n",
377− name, *addr, rev);
378+ name, addr, rev);
378379
379380 superio_exit();
380− return 0;
381+ return addr;
381382 }
382383
383384 static int __init smsc47b397_init(void)
@@ -385,9 +386,10 @@ static int __init smsc47b397_init(void) · 1 unmodified line
385386 unsigned short address;
386387 int ret;
387388
388− ret = smsc47b397_find(&address);
389− if (ret)
389+ ret = smsc47b397_find();
390+ if (ret < 0)
390391 return ret;
392+ address = ret;
391393
392394 ret = platform_driver_register(&smsc47b397_driver);
393395 if (ret)
drivers/hwmon/smsc47m1.c+10−9
@@ -491,10 +491,10 @@ static const struct attribute_group smsc47m1_group = { · 490 unmodified lines
491491 .attrs = smsc47m1_attributes,
492492 };
493493
494−static int __init smsc47m1_find(unsigned short *addr,
495− struct smsc47m1_sio_data *sio_data)
494+static int __init smsc47m1_find(struct smsc47m1_sio_data *sio_data)
496495 {
497496 u8 val;
497+ unsigned short addr;
498498
499499 superio_enter();
500500 val = force_id ? force_id : superio_inb(SUPERIO_REG_DEVID);
@@ -546,9 +546,9 @@ static int __init smsc47m1_find(unsigned short *addr, · 45 unmodified lines
546546 }
547547
548548 superio_select();
549− *addr = (superio_inb(SUPERIO_REG_BASE) << 8)
549+ addr = (superio_inb(SUPERIO_REG_BASE) << 8)
550550 | superio_inb(SUPERIO_REG_BASE + 1);
551− if (*addr == 0) {
551+ if (addr == 0) {
552552 pr_info("Device address not set, will not use\n");
553553 superio_exit();
554554 return -ENODEV;
@@ -565,7 +565,7 @@ static int __init smsc47m1_find(unsigned short *addr, · 10 unmodified lines
565565 }
566566
567567 superio_exit();
568− return 0;
568+ return addr;
569569 }
570570
571571 /* Restore device to its initial state */
@@ -938,13 +938,15 @@ static int __init sm_smsc47m1_init(void) · 366 unmodified lines
938938 unsigned short address;
939939 struct smsc47m1_sio_data sio_data;
940940
941− if (smsc47m1_find(&address, &sio_data))
942− return -ENODEV;
941+ err = smsc47m1_find(&sio_data);
942+ if (err < 0)
943+ return err;
944+ address = err;
943945
944946 /* Sets global pdev as a side effect */
945947 err = smsc47m1_device_add(address, &sio_data);
946948 if (err)
947− goto exit;
949+ return err;
948950
949951 err = platform_driver_probe(&smsc47m1_driver, smsc47m1_probe);
950952 if (err)
@@ -955,7 +957,6 @@ static int __init sm_smsc47m1_init(void) · 4 unmodified lines
955957 exit_device:
956958 platform_device_unregister(pdev);
957959 smsc47m1_restore(&sio_data);
958−exit:
959960 return err;
960961 }
961962
drivers/i2c/busses/i2c-designware-pcidrv.c+0−1
@@ -182,7 +182,6 @@ static int i2c_dw_pci_resume(struct device *dev) · 181 unmodified lines
182182 pci_restore_state(pdev);
183183
184184 i2c_dw_init(i2c);
185− i2c_dw_enable(i2c);
186185 return 0;
187186 }
188187
drivers/infiniband/core/mad.c+5−3
@@ -1854,6 +1854,8 @@ static bool generate_unmatched_resp(struct ib_mad_private *recv, · 1853 unmodified lines
18541854 response->mad.mad.mad_hdr.method = IB_MGMT_METHOD_GET_RESP;
18551855 response->mad.mad.mad_hdr.status =
18561856 cpu_to_be16(IB_MGMT_MAD_STATUS_UNSUPPORTED_METHOD_ATTRIB);
1857+ if (recv->mad.mad.mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE)
1858+ response->mad.mad.mad_hdr.status |= IB_SMP_DIRECTION;
18571859
18581860 return true;
18591861 } else {
@@ -1869,6 +1871,7 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv, · 9 unmodified lines
18691871 struct ib_mad_list_head *mad_list;
18701872 struct ib_mad_agent_private *mad_agent;
18711873 int port_num;
1874+ int ret = IB_MAD_RESULT_SUCCESS;
18721875
18731876 mad_list = (struct ib_mad_list_head *)(unsigned long)wc->wr_id;
18741877 qp_info = mad_list->mad_queue->qp_info;
@@ -1952,8 +1955,6 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv, · 77 unmodified lines
19521955 local:
19531956 /* Give driver "right of first refusal" on incoming MAD */
19541957 if (port_priv->device->process_mad) {
1955− int ret;
1956−
19571958 ret = port_priv->device->process_mad(port_priv->device, 0,
19581959 port_priv->port_num,
19591960 wc, &recv->grh,
@@ -1981,7 +1982,8 @@ local: · 21 unmodified lines
19811982 * or via recv_handler in ib_mad_complete_recv()
19821983 */
19831984 recv = NULL;
1984− } else if (generate_unmatched_resp(recv, response)) {
1985+ } else if ((ret & IB_MAD_RESULT_SUCCESS) &&
1986+ generate_unmatched_resp(recv, response)) {
19851987 agent_send_response(&response->mad.mad, &recv->grh, wc,
19861988 port_priv->device, port_num, qp_info->qp->qp_num);
19871989 }
drivers/infiniband/core/sysfs.c+5−4
@@ -179,7 +179,7 @@ static ssize_t rate_show(struct ib_port *p, struct port_attribute *unused, · 178 unmodified lines
179179 {
180180 struct ib_port_attr attr;
181181 char *speed = "";
182− int rate = -1; /* in deci-Gb/sec */
182+ int rate; /* in deci-Gb/sec */
183183 ssize_t ret;
184184
185185 ret = ib_query_port(p->ibdev, p->port_num, &attr);
@@ -187,9 +187,6 @@ static ssize_t rate_show(struct ib_port *p, struct port_attribute *unused, · 1 unmodified line
187187 return ret;
188188
189189 switch (attr.active_speed) {
190− case IB_SPEED_SDR:
191− rate = 25;
192− break;
193190 case IB_SPEED_DDR:
194191 speed = " DDR";
195192 rate = 50;
@@ -210,6 +207,10 @@ static ssize_t rate_show(struct ib_port *p, struct port_attribute *unused, · 14 unmodified lines
210207 speed = " EDR";
211208 rate = 250;
212209 break;
210+ case IB_SPEED_SDR:
211+ default: /* default to SDR for invalid rates */
212+ rate = 25;
213+ break;
213214 }
214215
215216 rate *= ib_width_enum_to_int(attr.active_width);
drivers/infiniband/hw/mlx4/main.c+6−1
@@ -247,12 +247,17 @@ static int ib_link_query_port(struct ib_device *ibdev, u8 port, · 246 unmodified lines
247247 err = mlx4_MAD_IFC(to_mdev(ibdev), 1, 1, port,
248248 NULL, NULL, in_mad, out_mad);
249249 if (err)
250− return err;
250+ goto out;
251251
252252 /* Checking LinkSpeedActive for FDR-10 */
253253 if (out_mad->data[15] & 0x1)
254254 props->active_speed = IB_SPEED_FDR10;
255255 }
256+
257+ /* Avoid wrong speed value returned by FW if the IB link is down. */
258+ if (props->state == IB_PORT_DOWN)
259+ props->active_speed = IB_SPEED_SDR;
260+
256261 out:
257262 kfree(in_mad);
258263 kfree(out_mad);
drivers/infiniband/ulp/srpt/ib_srpt.c+1−0
@@ -3232,6 +3232,7 @@ static void srpt_add_one(struct ib_device *device) · 3231 unmodified lines
32323232 srq_attr.attr.max_wr = sdev->srq_size;
32333233 srq_attr.attr.max_sge = 1;
32343234 srq_attr.attr.srq_limit = 0;
3235+ srq_attr.srq_type = IB_SRQT_BASIC;
32353236
32363237 sdev->srq = ib_create_srq(sdev->pd, &srq_attr);
32373238 if (IS_ERR(sdev->srq))
drivers/input/misc/Kconfig+1−2
@@ -380,8 +380,7 @@ config INPUT_TWL4030_VIBRA · 379 unmodified lines
380380
381381 config INPUT_TWL6040_VIBRA
382382 tristate "Support for TWL6040 Vibrator"
383− depends on TWL4030_CORE
384− select TWL6040_CORE
383+ depends on TWL6040_CORE
385384 select INPUT_FF_MEMLESS
386385 help
387386 This option enables support for TWL6040 Vibrator Driver.
drivers/input/misc/da9052_onkey.c+2−1
@@ -95,7 +95,8 @@ static int __devinit da9052_onkey_probe(struct platform_device *pdev) · 94 unmodified lines
9595 input_dev = input_allocate_device();
9696 if (!onkey || !input_dev) {
9797 dev_err(&pdev->dev, "Failed to allocate memory\n");
98− return -ENOMEM;
98+ error = -ENOMEM;
99+ goto err_free_mem;
99100 }
100101
101102 onkey->input = input_dev;
drivers/input/misc/twl6040-vibra.c+2−2
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828 #include <linux/module.h>
2929 #include <linux/platform_device.h>
3030 #include <linux/workqueue.h>
31−#include <linux/i2c/twl.h>
31+#include <linux/input.h>
3232 #include <linux/mfd/twl6040.h>
3333 #include <linux/slab.h>
3434 #include <linux/delay.h>
@@ -257,7 +257,7 @@ static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL); · 222 unmodified lines
257257
258258 static int __devinit twl6040_vibra_probe(struct platform_device *pdev)
259259 {
260− struct twl4030_vibra_data *pdata = pdev->dev.platform_data;
260+ struct twl6040_vibra_data *pdata = pdev->dev.platform_data;
261261 struct vibra_info *info;
262262 int ret;
263263
drivers/input/mouse/elantech.c+8−2
@@ -486,7 +486,6 @@ static void elantech_input_sync_v4(struct psmouse *psmouse) · 485 unmodified lines
486486 unsigned char *packet = psmouse->packet;
487487
488488 input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
489− input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
490489 input_mt_report_pointer_emulation(dev, true);
491490 input_sync(dev);
492491 }
@@ -967,6 +966,7 @@ static int elantech_set_input_params(struct psmouse *psmouse) · 474 unmodified lines
967966 if (elantech_set_range(psmouse, &x_min, &y_min, &x_max, &y_max, &width))
968967 return -1;
969968
969+ __set_bit(INPUT_PROP_POINTER, dev->propbit);
970970 __set_bit(EV_KEY, dev->evbit);
971971 __set_bit(EV_ABS, dev->evbit);
972972 __clear_bit(EV_REL, dev->evbit);
@@ -1017,7 +1017,9 @@ static int elantech_set_input_params(struct psmouse *psmouse) · 44 unmodified lines
10171017 */
10181018 psmouse_warn(psmouse, "couldn't query resolution data.\n");
10191019 }
1020−
1020+ /* v4 is clickpad, with only one button. */
1021+ __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);
1022+ __clear_bit(BTN_RIGHT, dev->keybit);
10211023 __set_bit(BTN_TOOL_QUADTAP, dev->keybit);
10221024 /* For X to recognize me as touchpad. */
10231025 input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0);
@@ -1245,6 +1247,8 @@ static void elantech_disconnect(struct psmouse *psmouse) · 221 unmodified lines
12451247 */
12461248 static int elantech_reconnect(struct psmouse *psmouse)
12471249 {
1250+ psmouse_reset(psmouse);
1251+
12481252 if (elantech_detect(psmouse, 0))
12491253 return -1;
12501254
@@ -1324,6 +1328,8 @@ int elantech_init(struct psmouse *psmouse) · 73 unmodified lines
13241328 if (!etd)
13251329 return -ENOMEM;
13261330
1331+ psmouse_reset(psmouse);
1332+
13271333 etd->parity[0] = 1;
13281334 for (i = 1; i < 256; i++)
13291335 etd->parity[i] = etd->parity[i & (i - 1)] ^ 1;
drivers/input/mouse/gpio_mouse.c+1−1
@@ -12,9 +12,9 @@ · 11 unmodified lines
1212 #include <linux/module.h>
1313 #include <linux/platform_device.h>
1414 #include <linux/input-polldev.h>
15+#include <linux/gpio.h>
1516 #include <linux/gpio_mouse.h>
1617
17−#include <asm/gpio.h>
1818
1919 /*
2020 * Timer function which is run every scan_ms ms when the device is opened.
drivers/input/mouse/sentelic.c+8−0
@@ -741,6 +741,14 @@ static psmouse_ret_t fsp_process_byte(struct psmouse *psmouse) · 740 unmodified lines
741741 }
742742 } else {
743743 /* SFAC packet */
744+ if ((packet[0] & (FSP_PB0_LBTN|FSP_PB0_PHY_BTN)) ==
745+ FSP_PB0_LBTN) {
746+ /* On-pad click in SFAC mode should be handled
747+ * by userspace. On-pad clicks in MFMC mode
748+ * are real clickpad clicks, and not ignored.
749+ */
750+ packet[0] &= ~FSP_PB0_LBTN;
751+ }
744752
745753 /* no multi-finger information */
746754 ad->last_mt_fgr = 0;
drivers/input/mouse/trackpoint.c+8−6
@@ -304,7 +304,7 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties) · 303 unmodified lines
304304 return 0;
305305
306306 if (trackpoint_read(&psmouse->ps2dev, TP_EXT_BTN, &button_info)) {
307− printk(KERN_WARNING "trackpoint.c: failed to get extended button data\n");
307+ psmouse_warn(psmouse, "failed to get extended button data\n");
308308 button_info = 0;
309309 }
310310
@@ -326,16 +326,18 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties) · 15 unmodified lines
326326
327327 error = sysfs_create_group(&ps2dev->serio->dev.kobj, &trackpoint_attr_group);
328328 if (error) {
329− printk(KERN_ERR
330− "trackpoint.c: failed to create sysfs attributes, error: %d\n",
331− error);
329+ psmouse_err(psmouse,
330+ "failed to create sysfs attributes, error: %d\n",
331+ error);
332332 kfree(psmouse->private);
333333 psmouse->private = NULL;
334334 return -1;
335335 }
336336
337− printk(KERN_INFO "IBM TrackPoint firmware: 0x%02x, buttons: %d/%d\n",
338− firmware_id, (button_info & 0xf0) >> 4, button_info & 0x0f);
337+ psmouse_info(psmouse,
338+ "IBM TrackPoint firmware: 0x%02x, buttons: %d/%d\n",
339+ firmware_id,
340+ (button_info & 0xf0) >> 4, button_info & 0x0f);
339341
340342 return 0;
341343 }
drivers/input/touchscreen/tps6507x-ts.c+1−3
@@ -1,6 +1,4 @@
11 /*
2− * drivers/input/touchscreen/tps6507x_ts.c
3− *
42 * Touchscreen driver for the tps6507x chip.
53 *
64 * Copyright (c) 2009 RidgeRun (todd.fischer@ridgerun.com)
@@ -376,4 +374,4 @@ module_platform_driver(tps6507x_ts_driver); · 369 unmodified lines
376374 MODULE_AUTHOR("Todd Fischer <todd.fischer@ridgerun.com>");
377375 MODULE_DESCRIPTION("TPS6507x - TouchScreen driver");
378376 MODULE_LICENSE("GPL v2");
379−MODULE_ALIAS("platform:tps6507x-tsc");
377+MODULE_ALIAS("platform:tps6507x-ts");
drivers/isdn/gigaset/interface.c+1−1
@@ -176,7 +176,7 @@ static void if_close(struct tty_struct *tty, struct file *filp) · 175 unmodified lines
176176 struct cardstate *cs = tty->driver_data;
177177
178178 if (!cs) { /* happens if we didn't find cs in open */
179− printk(KERN_DEBUG "%s: no cardstate\n", __func__);
179+ gig_dbg(DEBUG_IF, "%s: no cardstate", __func__);
180180 return;
181181 }
182182
drivers/leds/leds-atmel-pwm.c+1−1
@@ -35,7 +35,7 @@ static void pwmled_brightness(struct led_classdev *cdev, enum led_brightness b) · 34 unmodified lines
3535 * NOTE: we reuse the platform_data structure of GPIO leds,
3636 * but repurpose its "gpio" number as a PWM channel number.
3737 */
38−static int __init pwmled_probe(struct platform_device *pdev)
38+static int __devinit pwmled_probe(struct platform_device *pdev)
3939 {
4040 const struct gpio_led_platform_data *pdata;
4141 struct pwmled *leds;
drivers/md/bitmap.c+2−3
@@ -539,9 +539,6 @@ static int bitmap_new_disk_sb(struct bitmap *bitmap) · 538 unmodified lines
539539 bitmap->events_cleared = bitmap->mddev->events;
540540 sb->events_cleared = cpu_to_le64(bitmap->mddev->events);
541541
542− bitmap->flags |= BITMAP_HOSTENDIAN;
543− sb->version = cpu_to_le32(BITMAP_MAJOR_HOSTENDIAN);
544−
545542 kunmap_atomic(sb);
546543
547544 return 0;
@@ -1788,7 +1785,9 @@ int bitmap_load(struct mddev *mddev) · 1240 unmodified lines
17881785 * re-add of a missing device */
17891786 start = mddev->recovery_cp;
17901787
1788+ mutex_lock(&mddev->bitmap_info.mutex);
17911789 err = bitmap_init_from_disk(bitmap, start);
1790+ mutex_unlock(&mddev->bitmap_info.mutex);
17921791
17931792 if (err)
17941793 goto out;
drivers/md/dm-raid.c+2−2
@@ -859,7 +859,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs) · 858 unmodified lines
859859 int ret;
860860 unsigned redundancy = 0;
861861 struct raid_dev *dev;
862− struct md_rdev *rdev, *freshest;
862+ struct md_rdev *rdev, *tmp, *freshest;
863863 struct mddev *mddev = &rs->md;
864864
865865 switch (rs->raid_type->level) {
@@ -877,7 +877,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs) · 11 unmodified lines
877877 }
878878
879879 freshest = NULL;
880− rdev_for_each(rdev, mddev) {
880+ rdev_for_each_safe(rdev, tmp, mddev) {
881881 if (!rdev->meta_bdev)
882882 continue;
883883
drivers/md/md.c+4−3
@@ -7560,14 +7560,14 @@ void md_check_recovery(struct mddev *mddev) · 7559 unmodified lines
75607560 * any transients in the value of "sync_action".
75617561 */
75627562 set_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
7563− clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
75647563 /* Clear some bits that don't mean anything, but
75657564 * might be left set
75667565 */
75677566 clear_bit(MD_RECOVERY_INTR, &mddev->recovery);
75687567 clear_bit(MD_RECOVERY_DONE, &mddev->recovery);
75697568
7570− if (test_bit(MD_RECOVERY_FROZEN, &mddev->recovery))
7569+ if (!test_and_clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery) ||
7570+ test_bit(MD_RECOVERY_FROZEN, &mddev->recovery))
75717571 goto unlock;
75727572 /* no recovery is running.
75737573 * remove any failed drives, then
@@ -8140,7 +8140,8 @@ static int md_notify_reboot(struct notifier_block *this, · 566 unmodified lines
81408140
81418141 for_each_mddev(mddev, tmp) {
81428142 if (mddev_trylock(mddev)) {
8143− __md_stop_writes(mddev);
8143+ if (mddev->pers)
8144+ __md_stop_writes(mddev);
81448145 mddev->safemode = 2;
81458146 mddev_unlock(mddev);
81468147 }
drivers/md/raid1.c+2−1
@@ -1712,6 +1712,7 @@ static int process_checks(struct r1bio *r1_bio) · 1711 unmodified lines
17121712 struct r1conf *conf = mddev->private;
17131713 int primary;
17141714 int i;
1715+ int vcnt;
17151716
17161717 for (primary = 0; primary < conf->raid_disks * 2; primary++)
17171718 if (r1_bio->bios[primary]->bi_end_io == end_sync_read &&
@@ -1721,9 +1722,9 @@ static int process_checks(struct r1bio *r1_bio) · 3 unmodified lines
17211722 break;
17221723 }
17231724 r1_bio->read_disk = primary;
1725+ vcnt = (r1_bio->sectors + PAGE_SIZE / 512 - 1) >> (PAGE_SHIFT - 9);
17241726 for (i = 0; i < conf->raid_disks * 2; i++) {
17251727 int j;
1726− int vcnt = r1_bio->sectors >> (PAGE_SHIFT- 9);
17271728 struct bio *pbio = r1_bio->bios[primary];
17281729 struct bio *sbio = r1_bio->bios[i];
17291730 int size;
drivers/md/raid10.c+2−2
@@ -1788,6 +1788,7 @@ static void sync_request_write(struct mddev *mddev, struct r10bio *r10_bio) · 1787 unmodified lines
17881788 struct r10conf *conf = mddev->private;
17891789 int i, first;
17901790 struct bio *tbio, *fbio;
1791+ int vcnt;
17911792
17921793 atomic_set(&r10_bio->remaining, 1);
17931794
@@ -1802,10 +1803,10 @@ static void sync_request_write(struct mddev *mddev, struct r10bio *r10_bio) · 8 unmodified lines
18021803 first = i;
18031804 fbio = r10_bio->devs[i].bio;
18041805
1806+ vcnt = (r10_bio->sectors + (PAGE_SIZE >> 9) - 1) >> (PAGE_SHIFT - 9);
18051807 /* now find blocks with errors */
18061808 for (i=0 ; i < conf->copies ; i++) {
18071809 int j, d;
1808− int vcnt = r10_bio->sectors >> (PAGE_SHIFT-9);
18091810
18101811 tbio = r10_bio->devs[i].bio;
18111812
@@ -1871,7 +1872,6 @@ static void sync_request_write(struct mddev *mddev, struct r10bio *r10_bio) · 59 unmodified lines
18711872 */
18721873 for (i = 0; i < conf->copies; i++) {
18731874 int j, d;
1874− int vcnt = r10_bio->sectors >> (PAGE_SHIFT-9);
18751875
18761876 tbio = r10_bio->devs[i].repl_bio;
18771877 if (!tbio || !tbio->bi_end_io)
drivers/media/common/tuners/xc5000.c+35−4
@@ -54,6 +54,7 @@ struct xc5000_priv { · 53 unmodified lines
5454 struct list_head hybrid_tuner_instance_list;
5555
5656 u32 if_khz;
57+ u32 xtal_khz;
5758 u32 freq_hz;
5859 u32 bandwidth;
5960 u8 video_standard;
@@ -214,9 +215,9 @@ static const struct xc5000_fw_cfg xc5000a_1_6_114 = { · 154 unmodified lines
214215 .size = 12401,
215216 };
216217
217−static const struct xc5000_fw_cfg xc5000c_41_024_5_31875 = {
218− .name = "dvb-fe-xc5000c-41.024.5-31875.fw",
219− .size = 16503,
218+static const struct xc5000_fw_cfg xc5000c_41_024_5 = {
219+ .name = "dvb-fe-xc5000c-41.024.5.fw",
220+ .size = 16497,
220221 };
221222
222223 static inline const struct xc5000_fw_cfg *xc5000_assign_firmware(int chip_id)
@@ -226,7 +227,7 @@ static inline const struct xc5000_fw_cfg *xc5000_assign_firmware(int chip_id) · 3 unmodified lines
226227 case XC5000A:
227228 return &xc5000a_1_6_114;
228229 case XC5000C:
229− return &xc5000c_41_024_5_31875;
230+ return &xc5000c_41_024_5;
230231 }
231232 }
232233
@@ -572,6 +573,31 @@ static int xc_tune_channel(struct xc5000_priv *priv, u32 freq_hz, int mode) · 339 unmodified lines
572573 return found;
573574 }
574575
576+static int xc_set_xtal(struct dvb_frontend *fe)
577+{
578+ struct xc5000_priv *priv = fe->tuner_priv;
579+ int ret = XC_RESULT_SUCCESS;
580+
581+ switch (priv->chip_id) {
582+ default:
583+ case XC5000A:
584+ /* 32.000 MHz xtal is default */
585+ break;
586+ case XC5000C:
587+ switch (priv->xtal_khz) {
588+ default:
589+ case 32000:
590+ /* 32.000 MHz xtal is default */
591+ break;
592+ case 31875:
593+ /* 31.875 MHz xtal configuration */
594+ ret = xc_write_reg(priv, 0x000f, 0x8081);
595+ break;
596+ }
597+ break;
598+ }
599+ return ret;
600+}
575601
576602 static int xc5000_fwupload(struct dvb_frontend *fe)
577603 {
@@ -603,6 +629,8 @@ static int xc5000_fwupload(struct dvb_frontend *fe) · 25 unmodified lines
603629 } else {
604630 printk(KERN_INFO "xc5000: firmware uploading...\n");
605631 ret = xc_load_i2c_sequence(fe, fw->data);
632+ if (XC_RESULT_SUCCESS == ret)
633+ ret = xc_set_xtal(fe);
606634 printk(KERN_INFO "xc5000: firmware upload complete...\n");
607635 }
608636
@@ -1164,6 +1192,9 @@ struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe, · 555 unmodified lines
11641192 priv->if_khz = cfg->if_khz;
11651193 }
11661194
1195+ if (priv->xtal_khz == 0)
1196+ priv->xtal_khz = cfg->xtal_khz;
1197+
11671198 if (priv->radio_input == 0)
11681199 priv->radio_input = cfg->radio_input;
11691200
drivers/media/common/tuners/xc5000.h+1−0
@@ -34,6 +34,7 @@ struct xc5000_config { · 33 unmodified lines
3434 u8 i2c_address;
3535 u32 if_khz;
3636 u8 radio_input;
37+ u32 xtal_khz;
3738
3839 int chip_id;
3940 };
drivers/media/dvb/dvb-core/dvb_frontend.c+35−2
@@ -143,10 +143,12 @@ struct dvb_frontend_private { · 142 unmodified lines
143143 static void dvb_frontend_wakeup(struct dvb_frontend *fe);
144144 static int dtv_get_frontend(struct dvb_frontend *fe,
145145 struct dvb_frontend_parameters *p_out);
146+static int dtv_property_legacy_params_sync(struct dvb_frontend *fe,
147+ struct dvb_frontend_parameters *p);
146148
147149 static bool has_get_frontend(struct dvb_frontend *fe)
148150 {
149− return fe->ops.get_frontend;
151+ return fe->ops.get_frontend != NULL;
150152 }
151153
152154 /*
@@ -697,6 +699,7 @@ restart: · 544 unmodified lines
697699 fepriv->algo_status |= DVBFE_ALGO_SEARCH_AGAIN;
698700 fepriv->delay = HZ / 2;
699701 }
702+ dtv_property_legacy_params_sync(fe, &fepriv->parameters_out);
700703 fe->ops.read_status(fe, &s);
701704 if (s != fepriv->status) {
702705 dvb_frontend_add_event(fe, s); /* update event list */
@@ -1443,6 +1446,28 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system) · 740 unmodified lines
14431446 __func__);
14441447 return -EINVAL;
14451448 }
1449+ /*
1450+ * Get a delivery system that is compatible with DVBv3
1451+ * NOTE: in order for this to work with softwares like Kaffeine that
1452+ * uses a DVBv5 call for DVB-S2 and a DVBv3 call to go back to
1453+ * DVB-S, drivers that support both should put the SYS_DVBS entry
1454+ * before the SYS_DVBS2, otherwise it won't switch back to DVB-S.
1455+ * The real fix is that userspace applications should not use DVBv3
1456+ * and not trust on calling FE_SET_FRONTEND to switch the delivery
1457+ * system.
1458+ */
1459+ ncaps = 0;
1460+ while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) {
1461+ if (fe->ops.delsys[ncaps] == desired_system) {
1462+ delsys = desired_system;
1463+ break;
1464+ }
1465+ ncaps++;
1466+ }
1467+ if (delsys == SYS_UNDEFINED) {
1468+ dprintk("%s() Couldn't find a delivery system that matches %d\n",
1469+ __func__, desired_system);
1470+ }
14461471 } else {
14471472 /*
14481473 * This is a DVBv5 call. So, it likely knows the supported
@@ -1491,9 +1516,10 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system) · 42 unmodified lines
14911516 __func__);
14921517 return -EINVAL;
14931518 }
1494− c->delivery_system = delsys;
14951519 }
14961520
1521+ c->delivery_system = delsys;
1522+
14971523 /*
14981524 * The DVBv3 or DVBv5 call is requesting a different system. So,
14991525 * emulation is needed.
@@ -1832,6 +1858,13 @@ static int dtv_set_frontend(struct dvb_frontend *fe) · 332 unmodified lines
18321858 if (dvb_frontend_check_parameters(fe) < 0)
18331859 return -EINVAL;
18341860
1861+ /*
1862+ * Initialize output parameters to match the values given by
1863+ * the user. FE_SET_FRONTEND triggers an initial frontend event
1864+ * with status = 0, which copies output parameters to userspace.
1865+ */
1866+ dtv_property_legacy_params_sync(fe, &fepriv->parameters_out);
1867+
18351868 /*
18361869 * Be sure that the bandwidth will be filled for all
18371870 * non-satellite systems, as tuners need to know what
drivers/media/dvb/dvb-usb/it913x.c+40−14
@@ -238,12 +238,27 @@ static int it913x_read_reg(struct usb_device *udev, u32 reg) · 237 unmodified lines
238238
239239 static u32 it913x_query(struct usb_device *udev, u8 pro)
240240 {
241− int ret;
241+ int ret, i;
242242 u8 data[4];
243− ret = it913x_io(udev, READ_LONG, pro, CMD_DEMOD_READ,
244− 0x1222, 0, &data[0], 3);
243+ u8 ver;
244+
245+ for (i = 0; i < 5; i++) {
246+ ret = it913x_io(udev, READ_LONG, pro, CMD_DEMOD_READ,
247+ 0x1222, 0, &data[0], 3);
248+ ver = data[0];
249+ if (ver > 0 && ver < 3)
250+ break;
251+ msleep(100);
252+ }
245253
246− it913x_config.chip_ver = data[0];
254+ if (ver < 1 || ver > 2) {
255+ info("Failed to identify chip version applying 1");
256+ it913x_config.chip_ver = 0x1;
257+ it913x_config.chip_type = 0x9135;
258+ return 0;
259+ }
260+
261+ it913x_config.chip_ver = ver;
247262 it913x_config.chip_type = (u16)(data[2] << 8) + data[1];
248263
249264 info("Chip Version=%02x Chip Type=%04x", it913x_config.chip_ver,
@@ -660,30 +675,41 @@ static int it913x_download_firmware(struct usb_device *udev, · 410 unmodified lines
660675 if ((packet_size > min_pkt) || (i == fw->size)) {
661676 fw_data = (u8 *)(fw->data + pos);
662677 pos += packet_size;
663− if (packet_size > 0)
664− ret |= it913x_io(udev, WRITE_DATA,
678+ if (packet_size > 0) {
679+ ret = it913x_io(udev, WRITE_DATA,
665680 DEV_0, CMD_SCATTER_WRITE, 0,
666681 0, fw_data, packet_size);
682+ if (ret < 0)
683+ break;
684+ }
667685 udelay(1000);
668686 }
669687 }
670688 i++;
671689 }
672690
673− ret |= it913x_io(udev, WRITE_CMD, DEV_0, CMD_BOOT, 0, 0, NULL, 0);
674−
675− msleep(100);
676−
677691 if (ret < 0)
678− info("FRM Firmware Download Failed (%04x)" , ret);
692+ info("FRM Firmware Download Failed (%d)" , ret);
679693 else
680694 info("FRM Firmware Download Completed - Resetting Device");
681695
682− ret |= it913x_return_status(udev);
696+ msleep(30);
697+
698+ ret = it913x_io(udev, WRITE_CMD, DEV_0, CMD_BOOT, 0, 0, NULL, 0);
699+ if (ret < 0)
700+ info("FRM Device not responding to reboot");
701+
702+ ret = it913x_return_status(udev);
703+ if (ret == 0) {
704+ info("FRM Failed to reboot device");
705+ return -ENODEV;
706+ }
683707
684708 msleep(30);
685709
686− ret |= it913x_wr_reg(udev, DEV_0, I2C_CLK, I2C_CLK_400);
710+ ret = it913x_wr_reg(udev, DEV_0, I2C_CLK, I2C_CLK_400);
711+
712+ msleep(30);
687713
688714 /* Tuner function */
689715 if (it913x_config.dual_mode)
@@ -901,5 +927,5 @@ module_usb_driver(it913x_driver); · 211 unmodified lines
901927
902928 MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>");
903929 MODULE_DESCRIPTION("it913x USB 2 Driver");
904−MODULE_VERSION("1.27");
930+MODULE_VERSION("1.28");
905931 MODULE_LICENSE("GPL");
drivers/media/dvb/frontends/drxk_hard.c+4−2
@@ -1520,8 +1520,10 @@ static int scu_command(struct drxk_state *state, · 1519 unmodified lines
15201520 dprintk(1, "\n");
15211521
15221522 if ((cmd == 0) || ((parameterLen > 0) && (parameter == NULL)) ||
1523− ((resultLen > 0) && (result == NULL)))
1524− goto error;
1523+ ((resultLen > 0) && (result == NULL))) {
1524+ printk(KERN_ERR "drxk: Error %d on %s\n", status, __func__);
1525+ return status;
1526+ }
15251527
15261528 mutex_lock(&state->mutex);
15271529
drivers/media/rc/winbond-cir.c+1−0
@@ -1046,6 +1046,7 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) · 1045 unmodified lines
10461046 goto exit_unregister_led;
10471047 }
10481048
1049+ data->dev->driver_type = RC_DRIVER_IR_RAW;
10491050 data->dev->driver_name = WBCIR_NAME;
10501051 data->dev->input_name = WBCIR_NAME;
10511052 data->dev->input_phys = "wbcir/cir0";
drivers/media/video/Kconfig+1−1
@@ -492,7 +492,7 @@ config VIDEO_VS6624 · 491 unmodified lines
492492
493493 config VIDEO_MT9M032
494494 tristate "MT9M032 camera sensor support"
495− depends on I2C && VIDEO_V4L2
495+ depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
496496 select VIDEO_APTINA_PLL
497497 ---help---
498498 This driver supports MT9M032 camera sensors from Aptina, monochrome
drivers/media/video/ivtv/ivtv-ioctl.c+2−2
@@ -1763,13 +1763,13 @@ static int ivtv_decoder_ioctls(struct file *filp, unsigned int cmd, void *arg) · 1762 unmodified lines
17631763 IVTV_DEBUG_IOCTL("AUDIO_CHANNEL_SELECT\n");
17641764 if (iarg > AUDIO_STEREO_SWAPPED)
17651765 return -EINVAL;
1766− return v4l2_ctrl_s_ctrl(itv->ctrl_audio_playback, iarg);
1766+ return v4l2_ctrl_s_ctrl(itv->ctrl_audio_playback, iarg + 1);
17671767
17681768 case AUDIO_BILINGUAL_CHANNEL_SELECT:
17691769 IVTV_DEBUG_IOCTL("AUDIO_BILINGUAL_CHANNEL_SELECT\n");
17701770 if (iarg > AUDIO_STEREO_SWAPPED)
17711771 return -EINVAL;
1772− return v4l2_ctrl_s_ctrl(itv->ctrl_audio_multilingual_playback, iarg);
1772+ return v4l2_ctrl_s_ctrl(itv->ctrl_audio_multilingual_playback, iarg + 1);
17731773
17741774 default:
17751775 return -EINVAL;
drivers/media/video/mt9m032.c+3−2
@@ -392,10 +392,11 @@ static int mt9m032_set_pad_format(struct v4l2_subdev *subdev, · 391 unmodified lines
392392 }
393393
394394 /* Scaling is not supported, the format is thus fixed. */
395− ret = mt9m032_get_pad_format(subdev, fh, fmt);
395+ fmt->format = *__mt9m032_get_pad_format(sensor, fh, fmt->which);
396+ ret = 0;
396397
397398 done:
398− mutex_lock(&sensor->lock);
399+ mutex_unlock(&sensor->lock);
399400 return ret;
400401 }
401402
drivers/media/video/uvc/uvc_video.c+32−18
@@ -468,22 +468,30 @@ uvc_video_clock_decode(struct uvc_streaming *stream, struct uvc_buffer *buf, · 467 unmodified lines
468468 spin_unlock_irqrestore(&stream->clock.lock, flags);
469469 }
470470
471−static int uvc_video_clock_init(struct uvc_streaming *stream)
471+static void uvc_video_clock_reset(struct uvc_streaming *stream)
472472 {
473473 struct uvc_clock *clock = &stream->clock;
474474
475− spin_lock_init(&clock->lock);
476475 clock->head = 0;
477476 clock->count = 0;
478− clock->size = 32;
479477 clock->last_sof = -1;
480478 clock->sof_offset = -1;
479+}
480+
481+static int uvc_video_clock_init(struct uvc_streaming *stream)
482+{
483+ struct uvc_clock *clock = &stream->clock;
484+
485+ spin_lock_init(&clock->lock);
486+ clock->size = 32;
481487
482488 clock->samples = kmalloc(clock->size * sizeof(*clock->samples),
483489 GFP_KERNEL);
484490 if (clock->samples == NULL)
485491 return -ENOMEM;
486492
493+ uvc_video_clock_reset(stream);
494+
487495 return 0;
488496 }
489497
@@ -1424,8 +1432,6 @@ static void uvc_uninit_video(struct uvc_streaming *stream, int free_buffers) · 934 unmodified lines
14241432
14251433 if (free_buffers)
14261434 uvc_free_urb_buffers(stream);
1427−
1428− uvc_video_clock_cleanup(stream);
14291435 }
14301436
14311437 /*
@@ -1555,10 +1561,6 @@ static int uvc_init_video(struct uvc_streaming *stream, gfp_t gfp_flags) · 123 unmodified lines
15551561
15561562 uvc_video_stats_start(stream);
15571563
1558− ret = uvc_video_clock_init(stream);
1559− if (ret < 0)
1560− return ret;
1561−
15621564 if (intf->num_altsetting > 1) {
15631565 struct usb_host_endpoint *best_ep = NULL;
15641566 unsigned int best_psize = 3 * 1024;
@@ -1683,6 +1685,8 @@ int uvc_video_resume(struct uvc_streaming *stream, int reset) · 118 unmodified lines
16831685
16841686 stream->frozen = 0;
16851687
1688+ uvc_video_clock_reset(stream);
1689+
16861690 ret = uvc_commit_video(stream, &stream->ctrl);
16871691 if (ret < 0) {
16881692 uvc_queue_enable(&stream->queue, 0);
@@ -1819,25 +1823,35 @@ int uvc_video_enable(struct uvc_streaming *stream, int enable) · 130 unmodified lines
18191823 uvc_uninit_video(stream, 1);
18201824 usb_set_interface(stream->dev->udev, stream->intfnum, 0);
18211825 uvc_queue_enable(&stream->queue, 0);
1826+ uvc_video_clock_cleanup(stream);
18221827 return 0;
18231828 }
18241829
1825− ret = uvc_queue_enable(&stream->queue, 1);
1830+ ret = uvc_video_clock_init(stream);
18261831 if (ret < 0)
18271832 return ret;
18281833
1834+ ret = uvc_queue_enable(&stream->queue, 1);
1835+ if (ret < 0)
1836+ goto error_queue;
1837+
18291838 /* Commit the streaming parameters. */
18301839 ret = uvc_commit_video(stream, &stream->ctrl);
1831− if (ret < 0) {
1832− uvc_queue_enable(&stream->queue, 0);
1833− return ret;
1834− }
1840+ if (ret < 0)
1841+ goto error_commit;
18351842
18361843 ret = uvc_init_video(stream, GFP_KERNEL);
1837− if (ret < 0) {
1838− usb_set_interface(stream->dev->udev, stream->intfnum, 0);
1839− uvc_queue_enable(&stream->queue, 0);
1840− }
1844+ if (ret < 0)
1845+ goto error_video;
1846+
1847+ return 0;
1848+
1849+error_video:
1850+ usb_set_interface(stream->dev->udev, stream->intfnum, 0);
1851+error_commit:
1852+ uvc_queue_enable(&stream->queue, 0);
1853+error_queue:
1854+ uvc_video_clock_cleanup(stream);
18411855
18421856 return ret;
18431857 }
drivers/mfd/Kconfig+9−2
@@ -268,10 +268,17 @@ config TWL6030_PWM · 267 unmodified lines
268268 This is used to control charging LED brightness.
269269
270270 config TWL6040_CORE
271− bool
272− depends on TWL4030_CORE && GENERIC_HARDIRQS
271+ bool "Support for TWL6040 audio codec"
272+ depends on I2C=y && GENERIC_HARDIRQS
273273 select MFD_CORE
274+ select REGMAP_I2C
274275 default n
276+ help
277+ Say yes here if you want support for Texas Instruments TWL6040 audio
278+ codec.
279+ This driver provides common support for accessing the device,
280+ additional drivers must be enabled in order to use the
281+ functionality of the device (audio, vibra).
275282
276283 config MFD_STMPE
277284 bool "Support STMicroelectronics STMPE"
drivers/mfd/asic3.c+3−1
@@ -527,7 +527,9 @@ static void asic3_gpio_set(struct gpio_chip *chip, · 526 unmodified lines
527527
528528 static int asic3_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
529529 {
530− return (offset < ASIC3_NUM_GPIOS) ? IRQ_BOARD_START + offset : -ENXIO;
530+ struct asic3 *asic = container_of(chip, struct asic3, gpio);
531+
532+ return (offset < ASIC3_NUM_GPIOS) ? asic->irq_base + offset : -ENXIO;
531533 }
532534
533535 static __init int asic3_gpio_probe(struct platform_device *pdev,
drivers/mfd/db8500-prcmu.c+1−0
@@ -2788,6 +2788,7 @@ static struct regulator_init_data db8500_regulators[DB8500_NUM_REGULATORS] = { · 2787 unmodified lines
27882788 .constraints = {
27892789 .name = "db8500-vape",
27902790 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
2791+ .always_on = true,
27912792 },
27922793 .consumer_supplies = db8500_vape_consumers,
27932794 .num_consumer_supplies = ARRAY_SIZE(db8500_vape_consumers),
drivers/mfd/omap-usb-host.c+0−44
@@ -25,7 +25,6 @@ · 24 unmodified lines
2525 #include <linux/clk.h>
2626 #include <linux/dma-mapping.h>
2727 #include <linux/spinlock.h>
28−#include <linux/gpio.h>
2928 #include <plat/usb.h>
3029 #include <linux/pm_runtime.h>
3130
@@ -502,19 +501,6 @@ static void omap_usbhs_init(struct device *dev) · 470 unmodified lines
502501 pm_runtime_get_sync(dev);
503502 spin_lock_irqsave(&omap->lock, flags);
504503
505− if (pdata->ehci_data->phy_reset) {
506− if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0]))
507− gpio_request_one(pdata->ehci_data->reset_gpio_port[0],
508− GPIOF_OUT_INIT_LOW, "USB1 PHY reset");
509−
510− if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1]))
511− gpio_request_one(pdata->ehci_data->reset_gpio_port[1],
512− GPIOF_OUT_INIT_LOW, "USB2 PHY reset");
513−
514− /* Hold the PHY in RESET for enough time till DIR is high */
515− udelay(10);
516− }
517−
518504 omap->usbhs_rev = usbhs_read(omap->uhh_base, OMAP_UHH_REVISION);
519505 dev_dbg(dev, "OMAP UHH_REVISION 0x%x\n", omap->usbhs_rev);
520506
@@ -593,39 +579,10 @@ static void omap_usbhs_init(struct device *dev) · 72 unmodified lines
593579 usbhs_omap_tll_init(dev, OMAP_TLL_CHANNEL_COUNT);
594580 }
595581
596− if (pdata->ehci_data->phy_reset) {
597− /* Hold the PHY in RESET for enough time till
598− * PHY is settled and ready
599− */
600− udelay(10);
601−
602− if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0]))
603− gpio_set_value
604− (pdata->ehci_data->reset_gpio_port[0], 1);
605−
606− if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1]))
607− gpio_set_value
608− (pdata->ehci_data->reset_gpio_port[1], 1);
609− }
610−
611582 spin_unlock_irqrestore(&omap->lock, flags);
612583 pm_runtime_put_sync(dev);
613584 }
614585
615−static void omap_usbhs_deinit(struct device *dev)
616−{
617− struct usbhs_hcd_omap *omap = dev_get_drvdata(dev);
618− struct usbhs_omap_platform_data *pdata = &omap->platdata;
619−
620− if (pdata->ehci_data->phy_reset) {
621− if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0]))
622− gpio_free(pdata->ehci_data->reset_gpio_port[0]);
623−
624− if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1]))
625− gpio_free(pdata->ehci_data->reset_gpio_port[1]);
626− }
627−}
628−
629586
630587 /**
631588 * usbhs_omap_probe - initialize TI-based HCDs
@@ -860,7 +817,6 @@ static int __devexit usbhs_omap_remove(struct platform_device *pdev) · 228 unmodified lines
860817 {
861818 struct usbhs_hcd_omap *omap = platform_get_drvdata(pdev);
862819
863− omap_usbhs_deinit(&pdev->dev);
864820 iounmap(omap->tll_base);
865821 iounmap(omap->uhh_base);
866822 clk_put(omap->init_60m_fclk);
drivers/mfd/rc5t583.c+1−38
@@ -80,44 +80,6 @@ static struct mfd_cell rc5t583_subdevs[] = { · 79 unmodified lines
8080 {.name = "rc5t583-key", }
8181 };
8282
83−int rc5t583_write(struct device *dev, uint8_t reg, uint8_t val)
84−{
85− struct rc5t583 *rc5t583 = dev_get_drvdata(dev);
86− return regmap_write(rc5t583->regmap, reg, val);
87−}
88−
89−int rc5t583_read(struct device *dev, uint8_t reg, uint8_t *val)
90−{
91− struct rc5t583 *rc5t583 = dev_get_drvdata(dev);
92− unsigned int ival;
93− int ret;
94− ret = regmap_read(rc5t583->regmap, reg, &ival);
95− if (!ret)
96− *val = (uint8_t)ival;
97− return ret;
98−}
99−
100−int rc5t583_set_bits(struct device *dev, unsigned int reg,
101− unsigned int bit_mask)
102−{
103− struct rc5t583 *rc5t583 = dev_get_drvdata(dev);
104− return regmap_update_bits(rc5t583->regmap, reg, bit_mask, bit_mask);
105−}
106−
107−int rc5t583_clear_bits(struct device *dev, unsigned int reg,
108− unsigned int bit_mask)
109−{
110− struct rc5t583 *rc5t583 = dev_get_drvdata(dev);
111− return regmap_update_bits(rc5t583->regmap, reg, bit_mask, 0);
112−}
113−
114−int rc5t583_update(struct device *dev, unsigned int reg,
115− unsigned int val, unsigned int mask)
116−{
117− struct rc5t583 *rc5t583 = dev_get_drvdata(dev);
118− return regmap_update_bits(rc5t583->regmap, reg, mask, val);
119−}
120−
12183 static int __rc5t583_set_ext_pwrreq1_control(struct device *dev,
12284 int id, int ext_pwr, int slots)
12385 {
@@ -197,6 +159,7 @@ int rc5t583_ext_power_req_config(struct device *dev, int ds_id, · 73 unmodified lines
197159 ds_id, ext_pwr_req);
198160 return 0;
199161 }
162+EXPORT_SYMBOL(rc5t583_ext_power_req_config);
200163
201164 static int rc5t583_clear_ext_power_req(struct rc5t583 *rc5t583,
202165 struct rc5t583_platform_data *pdata)
drivers/mfd/twl6040-core.c+68−46
@@ -30,7 +30,9 @@ · 29 unmodified lines
3030 #include <linux/platform_device.h>
3131 #include <linux/gpio.h>
3232 #include <linux/delay.h>
33−#include <linux/i2c/twl.h>
33+#include <linux/i2c.h>
34+#include <linux/regmap.h>
35+#include <linux/err.h>
3436 #include <linux/mfd/core.h>
3537 #include <linux/mfd/twl6040.h>
3638
@@ -39,7 +41,7 @@ · 2 unmodified lines
3941 int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg)
4042 {
4143 int ret;
42− u8 val = 0;
44+ unsigned int val;
4345
4446 mutex_lock(&twl6040->io_mutex);
4547 /* Vibra control registers from cache */
@@ -47,7 +49,7 @@ int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg) · 1 unmodified line
4749 reg == TWL6040_REG_VIBCTLR)) {
4850 val = twl6040->vibra_ctrl_cache[VIBRACTRL_MEMBER(reg)];
4951 } else {
50− ret = twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &val, reg);
52+ ret = regmap_read(twl6040->regmap, reg, &val);
5153 if (ret < 0) {
5254 mutex_unlock(&twl6040->io_mutex);
5355 return ret;
@@ -64,7 +66,7 @@ int twl6040_reg_write(struct twl6040 *twl6040, unsigned int reg, u8 val) · 10 unmodified lines
6466 int ret;
6567
6668 mutex_lock(&twl6040->io_mutex);
67− ret = twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, val, reg);
69+ ret = regmap_write(twl6040->regmap, reg, val);
6870 /* Cache the vibra control registers */
6971 if (reg == TWL6040_REG_VIBCTLL || reg == TWL6040_REG_VIBCTLR)
7072 twl6040->vibra_ctrl_cache[VIBRACTRL_MEMBER(reg)] = val;
@@ -77,16 +79,9 @@ EXPORT_SYMBOL(twl6040_reg_write); · 6 unmodified lines
7779 int twl6040_set_bits(struct twl6040 *twl6040, unsigned int reg, u8 mask)
7880 {
7981 int ret;
80− u8 val;
8182
8283 mutex_lock(&twl6040->io_mutex);
83− ret = twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &val, reg);
84− if (ret)
85− goto out;
86−
87− val |= mask;
88− ret = twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, val, reg);
89−out:
84+ ret = regmap_update_bits(twl6040->regmap, reg, mask, mask);
9085 mutex_unlock(&twl6040->io_mutex);
9186 return ret;
9287 }
@@ -95,16 +90,9 @@ EXPORT_SYMBOL(twl6040_set_bits); · 2 unmodified lines
9590 int twl6040_clear_bits(struct twl6040 *twl6040, unsigned int reg, u8 mask)
9691 {
9792 int ret;
98− u8 val;
9993
10094 mutex_lock(&twl6040->io_mutex);
101− ret = twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &val, reg);
102− if (ret)
103− goto out;
104−
105− val &= ~mask;
106− ret = twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, val, reg);
107−out:
95+ ret = regmap_update_bits(twl6040->regmap, reg, mask, 0);
10896 mutex_unlock(&twl6040->io_mutex);
10997 return ret;
11098 }
@@ -494,32 +482,58 @@ static struct resource twl6040_codec_rsrc[] = { · 383 unmodified lines
494482 },
495483 };
496484
497−static int __devinit twl6040_probe(struct platform_device *pdev)
485+static bool twl6040_readable_reg(struct device *dev, unsigned int reg)
498486 {
499− struct twl4030_audio_data *pdata = pdev->dev.platform_data;
487+ /* Register 0 is not readable */
488+ if (!reg)
489+ return false;
490+ return true;
491+}
492+
493+static struct regmap_config twl6040_regmap_config = {
494+ .reg_bits = 8,
495+ .val_bits = 8,
496+ .max_register = TWL6040_REG_STATUS, /* 0x2e */
497+
498+ .readable_reg = twl6040_readable_reg,
499+};
500+
501+static int __devinit twl6040_probe(struct i2c_client *client,
502+ const struct i2c_device_id *id)
503+{
504+ struct twl6040_platform_data *pdata = client->dev.platform_data;
500505 struct twl6040 *twl6040;
501506 struct mfd_cell *cell = NULL;
502507 int ret, children = 0;
503508
504509 if (!pdata) {
505− dev_err(&pdev->dev, "Platform data is missing\n");
510+ dev_err(&client->dev, "Platform data is missing\n");
506511 return -EINVAL;
507512 }
508513
509514 /* In order to operate correctly we need valid interrupt config */
510− if (!pdata->naudint_irq || !pdata->irq_base) {
511− dev_err(&pdev->dev, "Invalid IRQ configuration\n");
515+ if (!client->irq || !pdata->irq_base) {
516+ dev_err(&client->dev, "Invalid IRQ configuration\n");
512517 return -EINVAL;
513518 }
514519
515− twl6040 = kzalloc(sizeof(struct twl6040), GFP_KERNEL);
516− if (!twl6040)
517− return -ENOMEM;
520+ twl6040 = devm_kzalloc(&client->dev, sizeof(struct twl6040),
521+ GFP_KERNEL);
522+ if (!twl6040) {
523+ ret = -ENOMEM;
524+ goto err;
525+ }
526+
527+ twl6040->regmap = regmap_init_i2c(client, &twl6040_regmap_config);
528+ if (IS_ERR(twl6040->regmap)) {
529+ ret = PTR_ERR(twl6040->regmap);
530+ goto err;
531+ }
518532
519− platform_set_drvdata(pdev, twl6040);
533+ i2c_set_clientdata(client, twl6040);
520534
521− twl6040->dev = &pdev->dev;
522− twl6040->irq = pdata->naudint_irq;
535+ twl6040->dev = &client->dev;
536+ twl6040->irq = client->irq;
523537 twl6040->irq_base = pdata->irq_base;
524538
525539 mutex_init(&twl6040->mutex);
@@ -588,12 +602,12 @@ static int __devinit twl6040_probe(struct platform_device *pdev) · 62 unmodified lines
588602 }
589603
590604 if (children) {
591− ret = mfd_add_devices(&pdev->dev, pdev->id, twl6040->cells,
605+ ret = mfd_add_devices(&client->dev, -1, twl6040->cells,
592606 children, NULL, 0);
593607 if (ret)
594608 goto mfd_err;
595609 } else {
596− dev_err(&pdev->dev, "No platform data found for children\n");
610+ dev_err(&client->dev, "No platform data found for children\n");
597611 ret = -ENODEV;
598612 goto mfd_err;
599613 }
@@ -608,14 +622,15 @@ gpio2_err: · 8 unmodified lines
608622 if (gpio_is_valid(twl6040->audpwron))
609623 gpio_free(twl6040->audpwron);
610624 gpio1_err:
611− platform_set_drvdata(pdev, NULL);
612− kfree(twl6040);
625+ i2c_set_clientdata(client, NULL);
626+ regmap_exit(twl6040->regmap);
627+err:
613628 return ret;
614629 }
615630
616−static int __devexit twl6040_remove(struct platform_device *pdev)
631+static int __devexit twl6040_remove(struct i2c_client *client)
617632 {
618− struct twl6040 *twl6040 = platform_get_drvdata(pdev);
633+ struct twl6040 *twl6040 = i2c_get_clientdata(client);
619634
620635 if (twl6040->power_count)
621636 twl6040_power(twl6040, 0);
@@ -626,23 +641,30 @@ static int __devexit twl6040_remove(struct platform_device *pdev) · 4 unmodified lines
626641 free_irq(twl6040->irq_base + TWL6040_IRQ_READY, twl6040);
627642 twl6040_irq_exit(twl6040);
628643
629− mfd_remove_devices(&pdev->dev);
630− platform_set_drvdata(pdev, NULL);
631− kfree(twl6040);
644+ mfd_remove_devices(&client->dev);
645+ i2c_set_clientdata(client, NULL);
646+ regmap_exit(twl6040->regmap);
632647
633648 return 0;
634649 }
635650
636−static struct platform_driver twl6040_driver = {
651+static const struct i2c_device_id twl6040_i2c_id[] = {
652+ { "twl6040", 0, },
653+ { },
654+};
655+MODULE_DEVICE_TABLE(i2c, twl6040_i2c_id);
656+
657+static struct i2c_driver twl6040_driver = {
658+ .driver = {
659+ .name = "twl6040",
660+ .owner = THIS_MODULE,
661+ },
637662 .probe = twl6040_probe,
638663 .remove = __devexit_p(twl6040_remove),
639− .driver = {
640− .owner = THIS_MODULE,
641− .name = "twl6040",
642− },
664+ .id_table = twl6040_i2c_id,
643665 };
644666
645−module_platform_driver(twl6040_driver);
667+module_i2c_driver(twl6040_driver);
646668
647669 MODULE_DESCRIPTION("TWL6040 MFD");
648670 MODULE_AUTHOR("Misael Lopez Cruz <misael.lopez@ti.com>");
drivers/mmc/card/block.c+39−17
@@ -873,7 +873,7 @@ static int mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq, · 872 unmodified lines
873873 {
874874 struct mmc_blk_data *md = mq->data;
875875 struct mmc_card *card = md->queue.card;
876− unsigned int from, nr, arg;
876+ unsigned int from, nr, arg, trim_arg, erase_arg;
877877 int err = 0, type = MMC_BLK_SECDISCARD;
878878
879879 if (!(mmc_can_secure_erase_trim(card) || mmc_can_sanitize(card))) {
@@ -881,20 +881,26 @@ static int mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq, · 1 unmodified line
881881 goto out;
882882 }
883883
884+ from = blk_rq_pos(req);
885+ nr = blk_rq_sectors(req);
886+
884887 /* The sanitize operation is supported at v4.5 only */
885888 if (mmc_can_sanitize(card)) {
886− err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
887− EXT_CSD_SANITIZE_START, 1, 0);
888− goto out;
889+ erase_arg = MMC_ERASE_ARG;
890+ trim_arg = MMC_TRIM_ARG;
891+ } else {
892+ erase_arg = MMC_SECURE_ERASE_ARG;
893+ trim_arg = MMC_SECURE_TRIM1_ARG;
889894 }
890895
891− from = blk_rq_pos(req);
892− nr = blk_rq_sectors(req);
893−
894− if (mmc_can_trim(card) && !mmc_erase_group_aligned(card, from, nr))
895− arg = MMC_SECURE_TRIM1_ARG;
896− else
897− arg = MMC_SECURE_ERASE_ARG;
896+ if (mmc_erase_group_aligned(card, from, nr))
897+ arg = erase_arg;
898+ else if (mmc_can_trim(card))
899+ arg = trim_arg;
900+ else {
901+ err = -EINVAL;
902+ goto out;
903+ }
898904 retry:
899905 if (card->quirks & MMC_QUIRK_INAND_CMD38) {
900906 err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
@@ -904,25 +910,41 @@ retry: · 3 unmodified lines
904910 INAND_CMD38_ARG_SECERASE,
905911 0);
906912 if (err)
907− goto out;
913+ goto out_retry;
908914 }
915+
909916 err = mmc_erase(card, from, nr, arg);
910− if (!err && arg == MMC_SECURE_TRIM1_ARG) {
917+ if (err == -EIO)
918+ goto out_retry;
919+ if (err)
920+ goto out;
921+
922+ if (arg == MMC_SECURE_TRIM1_ARG) {
911923 if (card->quirks & MMC_QUIRK_INAND_CMD38) {
912924 err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
913925 INAND_CMD38_ARG_EXT_CSD,
914926 INAND_CMD38_ARG_SECTRIM2,
915927 0);
916928 if (err)
917− goto out;
929+ goto out_retry;
918930 }
931+
919932 err = mmc_erase(card, from, nr, MMC_SECURE_TRIM2_ARG);
933+ if (err == -EIO)
934+ goto out_retry;
935+ if (err)
936+ goto out;
920937 }
921−out:
922− if (err == -EIO && !mmc_blk_reset(md, card->host, type))
938+
939+ if (mmc_can_sanitize(card))
940+ err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
941+ EXT_CSD_SANITIZE_START, 1, 0);
942+out_retry:
943+ if (err && !mmc_blk_reset(md, card->host, type))
923944 goto retry;
924945 if (!err)
925946 mmc_blk_reset_success(md, type);
947+out:
926948 spin_lock_irq(&md->lock);
927949 __blk_end_request(req, err, blk_rq_bytes(req));
928950 spin_unlock_irq(&md->lock);
@@ -1802,7 +1824,7 @@ static void mmc_blk_remove(struct mmc_card *card) · 873 unmodified lines
18021824 }
18031825
18041826 #ifdef CONFIG_PM
1805−static int mmc_blk_suspend(struct mmc_card *card, pm_message_t state)
1827+static int mmc_blk_suspend(struct mmc_card *card)
18061828 {
18071829 struct mmc_blk_data *part_md;
18081830 struct mmc_blk_data *md = mmc_get_drvdata(card);
drivers/mmc/card/queue.c+1−1
@@ -139,7 +139,7 @@ static void mmc_queue_setup_discard(struct request_queue *q, · 138 unmodified lines
139139
140140 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q);
141141 q->limits.max_discard_sectors = max_discard;
142− if (card->erased_byte == 0)
142+ if (card->erased_byte == 0 && !mmc_can_discard(card))
143143 q->limits.discard_zeroes_data = 1;
144144 q->limits.discard_granularity = card->pref_erase << 9;
145145 /* granularity must not be greater than max. discard */
drivers/mmc/core/bus.c+8−16
@@ -122,14 +122,14 @@ static int mmc_bus_remove(struct device *dev) · 121 unmodified lines
122122 return 0;
123123 }
124124
125−static int mmc_bus_suspend(struct device *dev, pm_message_t state)
125+static int mmc_bus_suspend(struct device *dev)
126126 {
127127 struct mmc_driver *drv = to_mmc_driver(dev->driver);
128128 struct mmc_card *card = mmc_dev_to_card(dev);
129129 int ret = 0;
130130
131131 if (dev->driver && drv->suspend)
132− ret = drv->suspend(card, state);
132+ ret = drv->suspend(card);
133133 return ret;
134134 }
135135
@@ -165,20 +165,14 @@ static int mmc_runtime_idle(struct device *dev) · 29 unmodified lines
165165 return pm_runtime_suspend(dev);
166166 }
167167
168+#endif /* !CONFIG_PM_RUNTIME */
169+
168170 static const struct dev_pm_ops mmc_bus_pm_ops = {
169− .runtime_suspend = mmc_runtime_suspend,
170− .runtime_resume = mmc_runtime_resume,
171− .runtime_idle = mmc_runtime_idle,
171+ SET_RUNTIME_PM_OPS(mmc_runtime_suspend, mmc_runtime_resume,
172+ mmc_runtime_idle)
173+ SET_SYSTEM_SLEEP_PM_OPS(mmc_bus_suspend, mmc_bus_resume)
172174 };
173175
174−#define MMC_PM_OPS_PTR (&mmc_bus_pm_ops)
175−
176−#else /* !CONFIG_PM_RUNTIME */
177−
178−#define MMC_PM_OPS_PTR NULL
179−
180−#endif /* !CONFIG_PM_RUNTIME */
181−
182176 static struct bus_type mmc_bus_type = {
183177 .name = "mmc",
184178 .dev_attrs = mmc_dev_attrs,
@@ -186,9 +180,7 @@ static struct bus_type mmc_bus_type = { · 1 unmodified line
186180 .uevent = mmc_bus_uevent,
187181 .probe = mmc_bus_probe,
188182 .remove = mmc_bus_remove,
189− .suspend = mmc_bus_suspend,
190− .resume = mmc_bus_resume,
191− .pm = MMC_PM_OPS_PTR,
183+ .pm = &mmc_bus_pm_ops,
192184 };
193185
194186 int mmc_register_bus(void)
drivers/mmc/core/cd-gpio.c+1−0
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/gpio.h>
1313 #include <linux/interrupt.h>
1414 #include <linux/jiffies.h>
15+#include <linux/mmc/cd-gpio.h>
1516 #include <linux/mmc/host.h>
1617 #include <linux/module.h>
1718 #include <linux/slab.h>
drivers/mmc/core/core.c+26−38
@@ -1409,7 +1409,10 @@ static unsigned int mmc_mmc_erase_timeout(struct mmc_card *card, · 1408 unmodified lines
14091409 {
14101410 unsigned int erase_timeout;
14111411
1412− if (card->ext_csd.erase_group_def & 1) {
1412+ if (arg == MMC_DISCARD_ARG ||
1413+ (arg == MMC_TRIM_ARG && card->ext_csd.rev >= 6)) {
1414+ erase_timeout = card->ext_csd.trim_timeout;
1415+ } else if (card->ext_csd.erase_group_def & 1) {
14131416 /* High Capacity Erase Group Size uses HC timeouts */
14141417 if (arg == MMC_TRIM_ARG)
14151418 erase_timeout = card->ext_csd.trim_timeout;
@@ -1681,8 +1684,6 @@ int mmc_can_trim(struct mmc_card *card) · 265 unmodified lines
16811684 {
16821685 if (card->ext_csd.sec_feature_support & EXT_CSD_SEC_GB_CL_EN)
16831686 return 1;
1684− if (mmc_can_discard(card))
1685− return 1;
16861687 return 0;
16871688 }
16881689 EXPORT_SYMBOL(mmc_can_trim);
@@ -1701,6 +1702,8 @@ EXPORT_SYMBOL(mmc_can_discard); · 12 unmodified lines
17011702
17021703 int mmc_can_sanitize(struct mmc_card *card)
17031704 {
1705+ if (!mmc_can_trim(card) && !mmc_can_erase(card))
1706+ return 0;
17041707 if (card->ext_csd.sec_feature_support & EXT_CSD_SEC_SANITIZE)
17051708 return 1;
17061709 return 0;
@@ -2235,6 +2238,7 @@ int mmc_cache_ctrl(struct mmc_host *host, u8 enable) · 528 unmodified lines
22352238 mmc_card_is_removable(host))
22362239 return err;
22372240
2241+ mmc_claim_host(host);
22382242 if (card && mmc_card_mmc(card) &&
22392243 (card->ext_csd.cache_size > 0)) {
22402244 enable = !!enable;
@@ -2252,6 +2256,7 @@ int mmc_cache_ctrl(struct mmc_host *host, u8 enable) · 11 unmodified lines
22522256 card->ext_csd.cache_ctrl = enable;
22532257 }
22542258 }
2259+ mmc_release_host(host);
22552260
22562261 return err;
22572262 }
@@ -2269,49 +2274,32 @@ int mmc_suspend_host(struct mmc_host *host) · 11 unmodified lines
22692274
22702275 cancel_delayed_work(&host->detect);
22712276 mmc_flush_scheduled_work();
2272− if (mmc_try_claim_host(host)) {
2273− err = mmc_cache_ctrl(host, 0);
2274− mmc_release_host(host);
2275− } else {
2276− err = -EBUSY;
2277− }
22782277
2278+ err = mmc_cache_ctrl(host, 0);
22792279 if (err)
22802280 goto out;
22812281
22822282 mmc_bus_get(host);
22832283 if (host->bus_ops && !host->bus_dead) {
22842284
2285− /*
2286− * A long response time is not acceptable for device drivers
2287− * when doing suspend. Prevent mmc_claim_host in the suspend
2288− * sequence, to potentially wait "forever" by trying to
2289− * pre-claim the host.
2290− */
2291− if (mmc_try_claim_host(host)) {
2292− if (host->bus_ops->suspend) {
2293− err = host->bus_ops->suspend(host);
2294− }
2295− mmc_release_host(host);
2285+ if (host->bus_ops->suspend)
2286+ err = host->bus_ops->suspend(host);
22962287
2297− if (err == -ENOSYS || !host->bus_ops->resume) {
2298− /*
2299− * We simply "remove" the card in this case.
2300− * It will be redetected on resume. (Calling
2301− * bus_ops->remove() with a claimed host can
2302− * deadlock.)
2303− */
2304− if (host->bus_ops->remove)
2305− host->bus_ops->remove(host);
2306− mmc_claim_host(host);
2307− mmc_detach_bus(host);
2308− mmc_power_off(host);
2309− mmc_release_host(host);
2310− host->pm_flags = 0;
2311− err = 0;
2312− }
2313− } else {
2314− err = -EBUSY;
2288+ if (err == -ENOSYS || !host->bus_ops->resume) {
2289+ /*
2290+ * We simply "remove" the card in this case.
2291+ * It will be redetected on resume. (Calling
2292+ * bus_ops->remove() with a claimed host can
2293+ * deadlock.)
2294+ */
2295+ if (host->bus_ops->remove)
2296+ host->bus_ops->remove(host);
2297+ mmc_claim_host(host);
2298+ mmc_detach_bus(host);
2299+ mmc_power_off(host);
2300+ mmc_release_host(host);
2301+ host->pm_flags = 0;
2302+ err = 0;
23152303 }
23162304 }
23172305 mmc_bus_put(host);
drivers/mmc/host/dw_mmc.c+5−2
@@ -526,8 +526,10 @@ static int dw_mci_submit_data_dma(struct dw_mci *host, struct mmc_data *data) · 525 unmodified lines
526526 return -ENODEV;
527527
528528 sg_len = dw_mci_pre_dma_transfer(host, data, 0);
529− if (sg_len < 0)
529+ if (sg_len < 0) {
530+ host->dma_ops->stop(host);
530531 return sg_len;
532+ }
531533
532534 host->using_dma = 1;
533535
@@ -1879,7 +1881,8 @@ static void dw_mci_init_dma(struct dw_mci *host) · 1345 unmodified lines
18791881 if (!host->dma_ops)
18801882 goto no_dma;
18811883
1882− if (host->dma_ops->init) {
1884+ if (host->dma_ops->init && host->dma_ops->start &&
1885+ host->dma_ops->stop && host->dma_ops->cleanup) {
18831886 if (host->dma_ops->init(host)) {
18841887 dev_err(&host->dev, "%s: Unable to initialize "
18851888 "DMA Controller.\n", __func__);
drivers/mmc/host/mxs-mmc.c+3−0
@@ -363,6 +363,7 @@ static void mxs_mmc_bc(struct mxs_mmc_host *host) · 362 unmodified lines
363363 goto out;
364364
365365 dmaengine_submit(desc);
366+ dma_async_issue_pending(host->dmach);
366367 return;
367368
368369 out:
@@ -403,6 +404,7 @@ static void mxs_mmc_ac(struct mxs_mmc_host *host) · 34 unmodified lines
403404 goto out;
404405
405406 dmaengine_submit(desc);
407+ dma_async_issue_pending(host->dmach);
406408 return;
407409
408410 out:
@@ -531,6 +533,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host) · 122 unmodified lines
531533 goto out;
532534
533535 dmaengine_submit(desc);
536+ dma_async_issue_pending(host->dmach);
534537 return;
535538 out:
536539 dev_warn(mmc_dev(host->mmc),
drivers/mmc/host/omap_hsmmc.c+3−3
@@ -249,7 +249,7 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on, · 248 unmodified lines
249249 * the pbias cell programming support is still missing when
250250 * booting with Device tree
251251 */
252− if (of_have_populated_dt() && !vdd)
252+ if (dev->of_node && !vdd)
253253 return 0;
254254
255255 if (mmc_slot(host).before_set_reg)
@@ -1549,7 +1549,7 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) · 1293 unmodified lines
15491549 * can't be allowed when booting with device
15501550 * tree.
15511551 */
1552− (!of_have_populated_dt())) {
1552+ !host->dev->of_node) {
15531553 /*
15541554 * The mmc_select_voltage fn of the core does
15551555 * not seem to set the power_mode to
@@ -1741,7 +1741,7 @@ static const struct of_device_id omap_mmc_of_match[] = { · 185 unmodified lines
17411741 .data = &omap4_reg_offset,
17421742 },
17431743 {},
1744−}
1744+};
17451745 MODULE_DEVICE_TABLE(of, omap_mmc_of_match);
17461746
17471747 static struct omap_mmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
drivers/mmc/host/sdhci-esdhc-imx.c+1−2
@@ -467,8 +467,7 @@ static int __devinit sdhci_esdhc_imx_probe(struct platform_device *pdev) · 466 unmodified lines
467467 clk_prepare_enable(clk);
468468 pltfm_host->clk = clk;
469469
470− if (!is_imx25_esdhc(imx_data))
471− host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
470+ host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
472471
473472 if (is_imx25_esdhc(imx_data) || is_imx35_esdhc(imx_data))
474473 /* Fix errata ENGcm07207 present on i.MX25 and i.MX35 */
drivers/mmc/host/sdhci.c+1−1
@@ -147,7 +147,7 @@ static void sdhci_set_card_detection(struct sdhci_host *host, bool enable) · 146 unmodified lines
147147 u32 present, irqs;
148148
149149 if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) ||
150− !mmc_card_is_removable(host->mmc))
150+ (host->mmc->caps & MMC_CAP_NONREMOVABLE))
151151 return;
152152
153153 present = sdhci_readl(host, SDHCI_PRESENT_STATE) &
drivers/mtd/mtdchar.c+10−10
@@ -106,16 +106,14 @@ static int mtdchar_open(struct inode *inode, struct file *file) · 105 unmodified lines
106106 }
107107
108108 if (mtd->type == MTD_ABSENT) {
109− put_mtd_device(mtd);
110109 ret = -ENODEV;
111− goto out;
110+ goto out1;
112111 }
113112
114113 mtd_ino = iget_locked(mnt->mnt_sb, devnum);
115114 if (!mtd_ino) {
116− put_mtd_device(mtd);
117115 ret = -ENOMEM;
118− goto out;
116+ goto out1;
119117 }
120118 if (mtd_ino->i_state & I_NEW) {
121119 mtd_ino->i_private = mtd;
@@ -127,23 +125,25 @@ static int mtdchar_open(struct inode *inode, struct file *file) · 5 unmodified lines
127125
128126 /* You can't open it RW if it's not a writeable device */
129127 if ((file->f_mode & FMODE_WRITE) && !(mtd->flags & MTD_WRITEABLE)) {
130− iput(mtd_ino);
131− put_mtd_device(mtd);
132128 ret = -EACCES;
133− goto out;
129+ goto out2;
134130 }
135131
136132 mfi = kzalloc(sizeof(*mfi), GFP_KERNEL);
137133 if (!mfi) {
138− iput(mtd_ino);
139− put_mtd_device(mtd);
140134 ret = -ENOMEM;
141− goto out;
135+ goto out2;
142136 }
143137 mfi->ino = mtd_ino;
144138 mfi->mtd = mtd;
145139 file->private_data = mfi;
140+ mutex_unlock(&mtd_mutex);
141+ return 0;
146142
143+out2:
144+ iput(mtd_ino);
145+out1:
146+ put_mtd_device(mtd);
147147 out:
148148 mutex_unlock(&mtd_mutex);
149149 simple_release_fs(&mnt, &count);
drivers/mtd/nand/gpmi-nand/gpmi-nand.c+1−0
@@ -266,6 +266,7 @@ int start_dma_without_bch_irq(struct gpmi_nand_data *this, · 265 unmodified lines
266266 desc->callback = dma_irq_callback;
267267 desc->callback_param = this;
268268 dmaengine_submit(desc);
269+ dma_async_issue_pending(get_dma_chan(this));
269270
270271 /* Wait for the interrupt from the DMA block. */
271272 err = wait_for_completion_timeout(dma_c, msecs_to_jiffies(1000));
drivers/net/arcnet/arc-rimi.c+4−4
@@ -89,16 +89,16 @@ static int __init arcrimi_probe(struct net_device *dev) · 88 unmodified lines
8989 BUGLVL(D_NORMAL) printk(VERSION);
9090 BUGLVL(D_NORMAL) printk("E-mail me if you actually test the RIM I driver, please!\n");
9191
92− BUGMSG(D_NORMAL, "Given: node %02Xh, shmem %lXh, irq %d\n",
92+ BUGLVL(D_NORMAL) printk("Given: node %02Xh, shmem %lXh, irq %d\n",
9393 dev->dev_addr[0], dev->mem_start, dev->irq);
9494
9595 if (dev->mem_start <= 0 || dev->irq <= 0) {
96− BUGMSG(D_NORMAL, "No autoprobe for RIM I; you "
96+ BUGLVL(D_NORMAL) printk("No autoprobe for RIM I; you "
9797 "must specify the shmem and irq!\n");
9898 return -ENODEV;
9999 }
100100 if (dev->dev_addr[0] == 0) {
101− BUGMSG(D_NORMAL, "You need to specify your card's station "
101+ BUGLVL(D_NORMAL) printk("You need to specify your card's station "
102102 "ID!\n");
103103 return -ENODEV;
104104 }
@@ -109,7 +109,7 @@ static int __init arcrimi_probe(struct net_device *dev) · 4 unmodified lines
109109 * will be taken.
110110 */
111111 if (!request_mem_region(dev->mem_start, MIRROR_SIZE, "arcnet (90xx)")) {
112− BUGMSG(D_NORMAL, "Card memory already allocated\n");
112+ BUGLVL(D_NORMAL) printk("Card memory already allocated\n");
113113 return -ENODEV;
114114 }
115115 return arcrimi_found(dev);
drivers/net/caif/caif_hsi.c+5−4
@@ -744,14 +744,14 @@ static void cfhsi_wake_up(struct work_struct *work) · 743 unmodified lines
744744 size_t fifo_occupancy = 0;
745745
746746 /* Wakeup timeout */
747− dev_err(&cfhsi->ndev->dev, "%s: Timeout.\n",
747+ dev_dbg(&cfhsi->ndev->dev, "%s: Timeout.\n",
748748 __func__);
749749
750750 /* Check FIFO to check if modem has sent something. */
751751 WARN_ON(cfhsi->dev->cfhsi_fifo_occupancy(cfhsi->dev,
752752 &fifo_occupancy));
753753
754− dev_err(&cfhsi->ndev->dev, "%s: Bytes in FIFO: %u.\n",
754+ dev_dbg(&cfhsi->ndev->dev, "%s: Bytes in FIFO: %u.\n",
755755 __func__, (unsigned) fifo_occupancy);
756756
757757 /* Check if we misssed the interrupt. */
@@ -1210,7 +1210,7 @@ int cfhsi_probe(struct platform_device *pdev) · 452 unmodified lines
12101210
12111211 static void cfhsi_shutdown(struct cfhsi *cfhsi)
12121212 {
1213− u8 *tx_buf, *rx_buf;
1213+ u8 *tx_buf, *rx_buf, *flip_buf;
12141214
12151215 /* Stop TXing */
12161216 netif_tx_stop_all_queues(cfhsi->ndev);
@@ -1234,7 +1234,7 @@ static void cfhsi_shutdown(struct cfhsi *cfhsi) · 17 unmodified lines
12341234 /* Store bufferes: will be freed later. */
12351235 tx_buf = cfhsi->tx_buf;
12361236 rx_buf = cfhsi->rx_buf;
1237−
1237+ flip_buf = cfhsi->rx_flip_buf;
12381238 /* Flush transmit queues. */
12391239 cfhsi_abort_tx(cfhsi);
12401240
@@ -1247,6 +1247,7 @@ static void cfhsi_shutdown(struct cfhsi *cfhsi) · 6 unmodified lines
12471247 /* Free buffers. */
12481248 kfree(tx_buf);
12491249 kfree(rx_buf);
1250+ kfree(flip_buf);
12501251 }
12511252
12521253 int cfhsi_remove(struct platform_device *pdev)
drivers/net/can/usb/peak_usb/pcan_usb_pro.c+2−0
@@ -875,6 +875,7 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev) · 874 unmodified lines
875875 PCAN_USBPRO_INFO_FW,
876876 &fi, sizeof(fi));
877877 if (err) {
878+ kfree(usb_if);
878879 dev_err(dev->netdev->dev.parent,
879880 "unable to read %s firmware info (err %d)\n",
880881 pcan_usb_pro.name, err);
@@ -885,6 +886,7 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev) · 4 unmodified lines
885886 PCAN_USBPRO_INFO_BL,
886887 &bi, sizeof(bi));
887888 if (err) {
889+ kfree(usb_if);
888890 dev_err(dev->netdev->dev.parent,
889891 "unable to read %s bootloader info (err %d)\n",
890892 pcan_usb_pro.name, err);
drivers/net/dummy.c+3−3
@@ -107,14 +107,14 @@ static int dummy_dev_init(struct net_device *dev) · 106 unmodified lines
107107 return 0;
108108 }
109109
110−static void dummy_dev_free(struct net_device *dev)
110+static void dummy_dev_uninit(struct net_device *dev)
111111 {
112112 free_percpu(dev->dstats);
113− free_netdev(dev);
114113 }
115114
116115 static const struct net_device_ops dummy_netdev_ops = {
117116 .ndo_init = dummy_dev_init,
117+ .ndo_uninit = dummy_dev_uninit,
118118 .ndo_start_xmit = dummy_xmit,
119119 .ndo_validate_addr = eth_validate_addr,
120120 .ndo_set_rx_mode = set_multicast_list,
@@ -128,7 +128,7 @@ static void dummy_setup(struct net_device *dev) · 7 unmodified lines
128128
129129 /* Initialize the device structure. */
130130 dev->netdev_ops = &dummy_netdev_ops;
131− dev->destructor = dummy_dev_free;
131+ dev->destructor = free_netdev;
132132
133133 /* Fill in device structure with ethernet-generic values. */
134134 dev->tx_queue_len = 0;
drivers/net/ethernet/atheros/atlx/atl1.c+5−7
@@ -2476,7 +2476,7 @@ static irqreturn_t atl1_intr(int irq, void *data) · 2475 unmodified lines
24762476 "pcie phy link down %x\n", status);
24772477 if (netif_running(adapter->netdev)) { /* reset MAC */
24782478 iowrite32(0, adapter->hw.hw_addr + REG_IMR);
2479− schedule_work(&adapter->pcie_dma_to_rst_task);
2479+ schedule_work(&adapter->reset_dev_task);
24802480 return IRQ_HANDLED;
24812481 }
24822482 }
@@ -2488,7 +2488,7 @@ static irqreturn_t atl1_intr(int irq, void *data) · 5 unmodified lines
24882488 "pcie DMA r/w error (status = 0x%x)\n",
24892489 status);
24902490 iowrite32(0, adapter->hw.hw_addr + REG_IMR);
2491− schedule_work(&adapter->pcie_dma_to_rst_task);
2491+ schedule_work(&adapter->reset_dev_task);
24922492 return IRQ_HANDLED;
24932493 }
24942494
@@ -2633,10 +2633,10 @@ static void atl1_down(struct atl1_adapter *adapter) · 138 unmodified lines
26332633 atl1_clean_rx_ring(adapter);
26342634 }
26352635
2636−static void atl1_tx_timeout_task(struct work_struct *work)
2636+static void atl1_reset_dev_task(struct work_struct *work)
26372637 {
26382638 struct atl1_adapter *adapter =
2639− container_of(work, struct atl1_adapter, tx_timeout_task);
2639+ container_of(work, struct atl1_adapter, reset_dev_task);
26402640 struct net_device *netdev = adapter->netdev;
26412641
26422642 netif_device_detach(netdev);
@@ -3038,12 +3038,10 @@ static int __devinit atl1_probe(struct pci_dev *pdev, · 395 unmodified lines
30383038 (unsigned long)adapter);
30393039 adapter->phy_timer_pending = false;
30403040
3041− INIT_WORK(&adapter->tx_timeout_task, atl1_tx_timeout_task);
3041+ INIT_WORK(&adapter->reset_dev_task, atl1_reset_dev_task);
30423042
30433043 INIT_WORK(&adapter->link_chg_task, atlx_link_chg_task);
30443044
3045− INIT_WORK(&adapter->pcie_dma_to_rst_task, atl1_tx_timeout_task);
3046−
30473045 err = register_netdev(netdev);
30483046 if (err)
30493047 goto err_common;
drivers/net/ethernet/atheros/atlx/atl1.h+1−2
@@ -758,9 +758,8 @@ struct atl1_adapter { · 757 unmodified lines
758758 u16 link_speed;
759759 u16 link_duplex;
760760 spinlock_t lock;
761− struct work_struct tx_timeout_task;
761+ struct work_struct reset_dev_task;
762762 struct work_struct link_chg_task;
763− struct work_struct pcie_dma_to_rst_task;
764763
765764 struct timer_list phy_config_timer;
766765 bool phy_timer_pending;
drivers/net/ethernet/atheros/atlx/atlx.c+1−1
@@ -194,7 +194,7 @@ static void atlx_tx_timeout(struct net_device *netdev) · 193 unmodified lines
194194 {
195195 struct atlx_adapter *adapter = netdev_priv(netdev);
196196 /* Do the reset outside of interrupt context */
197− schedule_work(&adapter->tx_timeout_task);
197+ schedule_work(&adapter->reset_dev_task);
198198 }
199199
200200 /*
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c+6−6
@@ -942,6 +942,12 @@ static int bnx2x_ets_e3b0_sp_pri_to_cos_set(const struct link_params *params, · 941 unmodified lines
942942 const u8 max_num_of_cos = (port) ? DCBX_E3B0_MAX_NUM_COS_PORT1 :
943943 DCBX_E3B0_MAX_NUM_COS_PORT0;
944944
945+ if (pri >= max_num_of_cos) {
946+ DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid "
947+ "parameter Illegal strict priority\n");
948+ return -EINVAL;
949+ }
950+
945951 if (sp_pri_to_cos[pri] != DCBX_INVALID_COS) {
946952 DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid "
947953 "parameter There can't be two COS's with "
@@ -949,12 +955,6 @@ static int bnx2x_ets_e3b0_sp_pri_to_cos_set(const struct link_params *params, · 1 unmodified line
949955 return -EINVAL;
950956 }
951957
952− if (pri > max_num_of_cos) {
953− DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid "
954− "parameter Illegal strict priority\n");
955− return -EINVAL;
956− }
957−
958958 sp_pri_to_cos[pri] = cos_entry;
959959 return 0;
960960
drivers/net/ethernet/intel/e1000e/ich8lan.c+10−5
@@ -1310,10 +1310,6 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state) · 1309 unmodified lines
13101310
13111311 if (mac_reg & E1000_PHY_CTRL_D0A_LPLU)
13121312 oem_reg |= HV_OEM_BITS_LPLU;
1313−
1314− /* Set Restart auto-neg to activate the bits */
1315− if (!hw->phy.ops.check_reset_block(hw))
1316− oem_reg |= HV_OEM_BITS_RESTART_AN;
13171313 } else {
13181314 if (mac_reg & (E1000_PHY_CTRL_GBE_DISABLE |
13191315 E1000_PHY_CTRL_NOND0A_GBE_DISABLE))
@@ -1324,6 +1320,11 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state) · 4 unmodified lines
13241320 oem_reg |= HV_OEM_BITS_LPLU;
13251321 }
13261322
1323+ /* Set Restart auto-neg to activate the bits */
1324+ if ((d0_state || (hw->mac.type != e1000_pchlan)) &&
1325+ !hw->phy.ops.check_reset_block(hw))
1326+ oem_reg |= HV_OEM_BITS_RESTART_AN;
1327+
13271328 ret_val = hw->phy.ops.write_reg_locked(hw, HV_OEM_BITS, oem_reg);
13281329
13291330 release:
@@ -3682,7 +3683,11 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw) · 2352 unmodified lines
36823683
36833684 if (hw->mac.type >= e1000_pchlan) {
36843685 e1000_oem_bits_config_ich8lan(hw, false);
3685− e1000_phy_hw_reset_ich8lan(hw);
3686+
3687+ /* Reset PHY to activate OEM bits on 82577/8 */
3688+ if (hw->mac.type == e1000_pchlan)
3689+ e1000e_phy_hw_reset_generic(hw);
3690+
36863691 ret_val = hw->phy.ops.acquire(hw);
36873692 if (ret_val)
36883693 return;
drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c+10−0
@@ -622,6 +622,16 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter, int v_idx, · 621 unmodified lines
622622 if (adapter->hw.mac.type == ixgbe_mac_82599EB)
623623 set_bit(__IXGBE_RX_CSUM_UDP_ZERO_ERR, &ring->state);
624624
625+#ifdef IXGBE_FCOE
626+ if (adapter->netdev->features & NETIF_F_FCOE_MTU) {
627+ struct ixgbe_ring_feature *f;
628+ f = &adapter->ring_feature[RING_F_FCOE];
629+ if ((rxr_idx >= f->mask) &&
630+ (rxr_idx < f->mask + f->indices))
631+ set_bit(__IXGBE_RX_FCOE_BUFSZ, &ring->state);
632+ }
633+
634+#endif /* IXGBE_FCOE */
625635 /* apply Rx specific ring traits */
626636 ring->count = adapter->rx_ring_count;
627637 ring->queue_index = rxr_idx;
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+12−8
@@ -3154,14 +3154,6 @@ static void ixgbe_set_rx_buffer_len(struct ixgbe_adapter *adapter) · 3153 unmodified lines
31543154 set_ring_rsc_enabled(rx_ring);
31553155 else
31563156 clear_ring_rsc_enabled(rx_ring);
3157−#ifdef IXGBE_FCOE
3158− if (netdev->features & NETIF_F_FCOE_MTU) {
3159− struct ixgbe_ring_feature *f;
3160− f = &adapter->ring_feature[RING_F_FCOE];
3161− if ((i >= f->mask) && (i < f->mask + f->indices))
3162− set_bit(__IXGBE_RX_FCOE_BUFSZ, &rx_ring->state);
3163− }
3164−#endif /* IXGBE_FCOE */
31653157 }
31663158 }
31673159
@@ -4836,7 +4828,9 @@ static int ixgbe_resume(struct pci_dev *pdev) · 1668 unmodified lines
48364828
48374829 pci_wake_from_d3(pdev, false);
48384830
4831+ rtnl_lock();
48394832 err = ixgbe_init_interrupt_scheme(adapter);
4833+ rtnl_unlock();
48404834 if (err) {
48414835 e_dev_err("Cannot initialize interrupts for device\n");
48424836 return err;
@@ -4893,6 +4887,16 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake) · 50 unmodified lines
48934887 if (wufc) {
48944888 ixgbe_set_rx_mode(netdev);
48954889
4890+ /*
4891+ * enable the optics for both mult-speed fiber and
4892+ * 82599 SFP+ fiber as we can WoL.
4893+ */
4894+ if (hw->mac.ops.enable_tx_laser &&
4895+ (hw->phy.multispeed_fiber ||
4896+ (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber &&
4897+ hw->mac.type == ixgbe_mac_82599EB)))
4898+ hw->mac.ops.enable_tx_laser(hw);
4899+
48964900 /* turn on all-multi mode if wake on multicast is enabled */
48974901 if (wufc & IXGBE_WUFC_MC) {
48984902 fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
drivers/net/ethernet/micrel/ks8851.c+11−10
@@ -889,16 +889,17 @@ static int ks8851_net_stop(struct net_device *dev) · 888 unmodified lines
889889 netif_stop_queue(dev);
890890
891891 mutex_lock(&ks->lock);
892+ /* turn off the IRQs and ack any outstanding */
893+ ks8851_wrreg16(ks, KS_IER, 0x0000);
894+ ks8851_wrreg16(ks, KS_ISR, 0xffff);
895+ mutex_unlock(&ks->lock);
892896
893897 /* stop any outstanding work */
894898 flush_work(&ks->irq_work);
895899 flush_work(&ks->tx_work);
896900 flush_work(&ks->rxctrl_work);
897901
898− /* turn off the IRQs and ack any outstanding */
899− ks8851_wrreg16(ks, KS_IER, 0x0000);
900− ks8851_wrreg16(ks, KS_ISR, 0xffff);
901−
902+ mutex_lock(&ks->lock);
902903 /* shutdown RX process */
903904 ks8851_wrreg16(ks, KS_RXCR1, 0x0000);
904905
@@ -907,6 +908,7 @@ static int ks8851_net_stop(struct net_device *dev) · 2 unmodified lines
907908
908909 /* set powermode to soft power down to save power */
909910 ks8851_set_powermode(ks, PMECR_PM_SOFTDOWN);
911+ mutex_unlock(&ks->lock);
910912
911913 /* ensure any queued tx buffers are dumped */
912914 while (!skb_queue_empty(&ks->txq)) {
@@ -918,7 +920,6 @@ static int ks8851_net_stop(struct net_device *dev) · 5 unmodified lines
918920 dev_kfree_skb(txb);
919921 }
920922
921− mutex_unlock(&ks->lock);
922923 return 0;
923924 }
924925
@@ -1418,6 +1419,7 @@ static int __devinit ks8851_probe(struct spi_device *spi) · 493 unmodified lines
14181419 struct net_device *ndev;
14191420 struct ks8851_net *ks;
14201421 int ret;
1422+ unsigned cider;
14211423
14221424 ndev = alloc_etherdev(sizeof(struct ks8851_net));
14231425 if (!ndev)
@@ -1484,8 +1486,8 @@ static int __devinit ks8851_probe(struct spi_device *spi) · 60 unmodified lines
14841486 ks8851_soft_reset(ks, GRR_GSR);
14851487
14861488 /* simple check for a valid chip being connected to the bus */
1487−
1488− if ((ks8851_rdreg16(ks, KS_CIDER) & ~CIDER_REV_MASK) != CIDER_ID) {
1489+ cider = ks8851_rdreg16(ks, KS_CIDER);
1490+ if ((cider & ~CIDER_REV_MASK) != CIDER_ID) {
14891491 dev_err(&spi->dev, "failed to read device ID\n");
14901492 ret = -ENODEV;
14911493 goto err_id;
@@ -1516,15 +1518,14 @@ static int __devinit ks8851_probe(struct spi_device *spi) · 24 unmodified lines
15161518 }
15171519
15181520 netdev_info(ndev, "revision %d, MAC %pM, IRQ %d, %s EEPROM\n",
1519− CIDER_REV_GET(ks8851_rdreg16(ks, KS_CIDER)),
1520− ndev->dev_addr, ndev->irq,
1521+ CIDER_REV_GET(cider), ndev->dev_addr, ndev->irq,
15211522 ks->rc_ccr & CCR_EEPROM ? "has" : "no");
15221523
15231524 return 0;
15241525
15251526
15261527 err_netdev:
1527− free_irq(ndev->irq, ndev);
1528+ free_irq(ndev->irq, ks);
15281529
15291530 err_id:
15301531 err_irq:
drivers/net/ethernet/micrel/ks8851_mll.c+1−1
@@ -40,7 +40,7 @@ · 39 unmodified lines
4040 #define DRV_NAME "ks8851_mll"
4141
4242 static u8 KS_DEFAULT_MAC_ADDRESS[] = { 0x00, 0x10, 0xA1, 0x86, 0x95, 0x11 };
43−#define MAX_RECV_FRAMES 32
43+#define MAX_RECV_FRAMES 255
4444 #define MAX_BUF_SIZE 2048
4545 #define TX_BUF_SIZE 2000
4646 #define RX_BUF_SIZE 2000
drivers/net/ethernet/micrel/ksz884x.c+1−1
@@ -5675,7 +5675,7 @@ static int netdev_set_mac_address(struct net_device *dev, void *addr) · 5674 unmodified lines
56755675 memcpy(hw->override_addr, mac->sa_data, ETH_ALEN);
56765676 }
56775677
5678− memcpy(dev->dev_addr, mac->sa_data, MAX_ADDR_LEN);
5678+ memcpy(dev->dev_addr, mac->sa_data, ETH_ALEN);
56795679
56805680 interrupt = hw_block_intr(hw);
56815681
drivers/net/ethernet/realtek/8139cp.c+8−2
@@ -958,6 +958,11 @@ static inline void cp_start_hw (struct cp_private *cp) · 957 unmodified lines
958958 cpw8(Cmd, RxOn | TxOn);
959959 }
960960
961+static void cp_enable_irq(struct cp_private *cp)
962+{
963+ cpw16_f(IntrMask, cp_intr_mask);
964+}
965+
961966 static void cp_init_hw (struct cp_private *cp)
962967 {
963968 struct net_device *dev = cp->dev;
@@ -997,8 +1002,6 @@ static void cp_init_hw (struct cp_private *cp) · 33 unmodified lines
9971002
9981003 cpw16(MultiIntr, 0);
9991004
1000− cpw16_f(IntrMask, cp_intr_mask);
1001−
10021005 cpw8_f(Cfg9346, Cfg9346_Lock);
10031006 }
10041007
@@ -1130,6 +1133,8 @@ static int cp_open (struct net_device *dev) · 125 unmodified lines
11301133 if (rc)
11311134 goto err_out_hw;
11321135
1136+ cp_enable_irq(cp);
1137+
11331138 netif_carrier_off(dev);
11341139 mii_check_media(&cp->mii_if, netif_msg_link(cp), true);
11351140 netif_start_queue(dev);
@@ -2031,6 +2036,7 @@ static int cp_resume (struct pci_dev *pdev) · 895 unmodified lines
20312036 /* FIXME: sh*t may happen if the Rx ring buffer is depleted */
20322037 cp_init_rings_index (cp);
20332038 cp_init_hw (cp);
2039+ cp_enable_irq(cp);
20342040 netif_start_queue (dev);
20352041
20362042 spin_lock_irqsave (&cp->lock, flags);
drivers/net/ethernet/smsc/smsc911x.c+6−11
@@ -1166,10 +1166,8 @@ smsc911x_rx_counterrors(struct net_device *dev, unsigned int rxstat) · 1165 unmodified lines
11661166
11671167 /* Quickly dumps bad packets */
11681168 static void
1169−smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktbytes)
1169+smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktwords)
11701170 {
1171− unsigned int pktwords = (pktbytes + NET_IP_ALIGN + 3) >> 2;
1172−
11731171 if (likely(pktwords >= 4)) {
11741172 unsigned int timeout = 500;
11751173 unsigned int val;
@@ -1233,7 +1231,7 @@ static int smsc911x_poll(struct napi_struct *napi, int budget) · 57 unmodified lines
12331231 continue;
12341232 }
12351233
1236− skb = netdev_alloc_skb(dev, pktlength + NET_IP_ALIGN);
1234+ skb = netdev_alloc_skb(dev, pktwords << 2);
12371235 if (unlikely(!skb)) {
12381236 SMSC_WARN(pdata, rx_err,
12391237 "Unable to allocate skb for rx packet");
@@ -1243,14 +1241,12 @@ static int smsc911x_poll(struct napi_struct *napi, int budget) · 3 unmodified lines
12431241 break;
12441242 }
12451243
1246− skb->data = skb->head;
1247− skb_reset_tail_pointer(skb);
1244+ pdata->ops->rx_readfifo(pdata,
1245+ (unsigned int *)skb->data, pktwords);
12481246
12491247 /* Align IP on 16B boundary */
12501248 skb_reserve(skb, NET_IP_ALIGN);
12511249 skb_put(skb, pktlength - 4);
1252− pdata->ops->rx_readfifo(pdata,
1253− (unsigned int *)skb->head, pktwords);
12541250 skb->protocol = eth_type_trans(skb, dev);
12551251 skb_checksum_none_assert(skb);
12561252 netif_receive_skb(skb);
@@ -1565,7 +1561,7 @@ static int smsc911x_open(struct net_device *dev) · 308 unmodified lines
15651561 smsc911x_reg_write(pdata, FIFO_INT, temp);
15661562
15671563 /* set RX Data offset to 2 bytes for alignment */
1568− smsc911x_reg_write(pdata, RX_CFG, (2 << 8));
1564+ smsc911x_reg_write(pdata, RX_CFG, (NET_IP_ALIGN << 8));
15691565
15701566 /* enable NAPI polling before enabling RX interrupts */
15711567 napi_enable(&pdata->napi);
@@ -2382,7 +2378,6 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) · 810 unmodified lines
23822378 SET_NETDEV_DEV(dev, &pdev->dev);
23832379
23842380 pdata = netdev_priv(dev);
2385−
23862381 dev->irq = irq_res->start;
23872382 irq_flags = irq_res->flags & IRQF_TRIGGER_MASK;
23882383 pdata->ioaddr = ioremap_nocache(res->start, res_size);
@@ -2446,7 +2441,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) · 57 unmodified lines
24462441 if (retval) {
24472442 SMSC_WARN(pdata, probe,
24482443 "Unable to claim requested irq: %d", dev->irq);
2449− goto out_free_irq;
2444+ goto out_disable_resources;
24502445 }
24512446
24522447 retval = register_netdev(dev);
drivers/net/ethernet/ti/davinci_mdio.c+5−0
@@ -181,6 +181,11 @@ static inline int wait_for_user_access(struct davinci_mdio_data *data) · 180 unmodified lines
181181 __davinci_mdio_reset(data);
182182 return -EAGAIN;
183183 }
184+
185+ reg = __raw_readl(&regs->user[0].access);
186+ if ((reg & USERACCESS_GO) == 0)
187+ return 0;
188+
184189 dev_err(data->dev, "timed out waiting for user access\n");
185190 return -ETIMEDOUT;
186191 }
drivers/net/ethernet/xilinx/xilinx_axienet.h+1−3
@@ -2,9 +2,7 @@ · 1 unmodified line
22 * Definitions for Xilinx Axi Ethernet device driver.
33 *
44 * Copyright (c) 2009 Secret Lab Technologies, Ltd.
5− * Copyright (c) 2010 Xilinx, Inc. All rights reserved.
6− * Copyright (c) 2012 Daniel Borkmann, <daniel.borkmann@tik.ee.ethz.ch>
7− * Copyright (c) 2012 Ariane Keller, <ariane.keller@tik.ee.ethz.ch>
5+ * Copyright (c) 2010 - 2012 Xilinx, Inc. All rights reserved.
86 */
97
108 #ifndef XILINX_AXIENET_H
drivers/net/ethernet/xilinx/xilinx_axienet_main.c+3−3
@@ -4,9 +4,9 @@ · 3 unmodified lines
44 * Copyright (c) 2008 Nissin Systems Co., Ltd., Yoshio Kashiwagi
55 * Copyright (c) 2005-2008 DLA Systems, David H. Lynch Jr. <dhlii@dlasys.net>
66 * Copyright (c) 2008-2009 Secret Lab Technologies Ltd.
7− * Copyright (c) 2010 Xilinx, Inc. All rights reserved.
8− * Copyright (c) 2012 Daniel Borkmann, <daniel.borkmann@tik.ee.ethz.ch>
9− * Copyright (c) 2012 Ariane Keller, <ariane.keller@tik.ee.ethz.ch>
7+ * Copyright (c) 2010 - 2011 Michal Simek <monstr@monstr.eu>
8+ * Copyright (c) 2010 - 2011 PetaLogix
9+ * Copyright (c) 2010 - 2012 Xilinx, Inc. All rights reserved.
1010 *
1111 * This is a driver for the Xilinx Axi Ethernet which is used in the Virtex6
1212 * and Spartan6.
drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c+3−3
@@ -2,9 +2,9 @@ · 1 unmodified line
22 * MDIO bus driver for the Xilinx Axi Ethernet device
33 *
44 * Copyright (c) 2009 Secret Lab Technologies, Ltd.
5− * Copyright (c) 2010 Xilinx, Inc. All rights reserved.
6− * Copyright (c) 2012 Daniel Borkmann, <daniel.borkmann@tik.ee.ethz.ch>
7− * Copyright (c) 2012 Ariane Keller, <ariane.keller@tik.ee.ethz.ch>
5+ * Copyright (c) 2010 - 2011 Michal Simek <monstr@monstr.eu>
6+ * Copyright (c) 2010 - 2011 PetaLogix
7+ * Copyright (c) 2010 - 2012 Xilinx, Inc. All rights reserved.
88 */
99
1010 #include <linux/of_address.h>
drivers/net/hyperv/netvsc_drv.c+14−24
@@ -44,6 +44,7 @@ struct net_device_context { · 43 unmodified lines
4444 /* point back to our device context */
4545 struct hv_device *device_ctx;
4646 struct delayed_work dwork;
47+ struct work_struct work;
4748 };
4849
4950
@@ -51,30 +52,22 @@ static int ring_size = 128; · 1 unmodified line
5152 module_param(ring_size, int, S_IRUGO);
5253 MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
5354
54−struct set_multicast_work {
55− struct work_struct work;
56− struct net_device *net;
57−};
58−
5955 static void do_set_multicast(struct work_struct *w)
6056 {
61− struct set_multicast_work *swk =
62− container_of(w, struct set_multicast_work, work);
63− struct net_device *net = swk->net;
64−
65− struct net_device_context *ndevctx = netdev_priv(net);
57+ struct net_device_context *ndevctx =
58+ container_of(w, struct net_device_context, work);
6659 struct netvsc_device *nvdev;
6760 struct rndis_device *rdev;
6861
6962 nvdev = hv_get_drvdata(ndevctx->device_ctx);
70− if (nvdev == NULL)
71− goto out;
63+ if (nvdev == NULL || nvdev->ndev == NULL)
64+ return;
7265
7366 rdev = nvdev->extension;
7467 if (rdev == NULL)
75− goto out;
68+ return;
7669
77− if (net->flags & IFF_PROMISC)
70+ if (nvdev->ndev->flags & IFF_PROMISC)
7871 rndis_filter_set_packet_filter(rdev,
7972 NDIS_PACKET_TYPE_PROMISCUOUS);
8073 else
@@ -82,21 +75,13 @@ static void do_set_multicast(struct work_struct *w) · 1 unmodified line
8275 NDIS_PACKET_TYPE_BROADCAST |
8376 NDIS_PACKET_TYPE_ALL_MULTICAST |
8477 NDIS_PACKET_TYPE_DIRECTED);
85−
86−out:
87− kfree(w);
8878 }
8979
9080 static void netvsc_set_multicast_list(struct net_device *net)
9181 {
92− struct set_multicast_work *swk =
93− kmalloc(sizeof(struct set_multicast_work), GFP_ATOMIC);
94− if (swk == NULL)
95− return;
82+ struct net_device_context *net_device_ctx = netdev_priv(net);
9683
97− swk->net = net;
98− INIT_WORK(&swk->work, do_set_multicast);
99− schedule_work(&swk->work);
84+ schedule_work(&net_device_ctx->work);
10085 }
10186
10287 static int netvsc_open(struct net_device *net)
@@ -125,6 +110,8 @@ static int netvsc_close(struct net_device *net) · 22 unmodified lines
125110
126111 netif_tx_disable(net);
127112
113+ /* Make sure netvsc_set_multicast_list doesn't re-enable filter! */
114+ cancel_work_sync(&net_device_ctx->work);
128115 ret = rndis_filter_close(device_obj);
129116 if (ret != 0)
130117 netdev_err(net, "unable to close device (ret %d).\n", ret);
@@ -335,6 +322,7 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu) · 204 unmodified lines
335322
336323 nvdev->start_remove = true;
337324 cancel_delayed_work_sync(&ndevctx->dwork);
325+ cancel_work_sync(&ndevctx->work);
338326 netif_tx_disable(ndev);
339327 rndis_filter_device_remove(hdev);
340328
@@ -403,6 +391,7 @@ static int netvsc_probe(struct hv_device *dev, · 62 unmodified lines
403391 net_device_ctx->device_ctx = dev;
404392 hv_set_drvdata(dev, net);
405393 INIT_DELAYED_WORK(&net_device_ctx->dwork, netvsc_send_garp);
394+ INIT_WORK(&net_device_ctx->work, do_set_multicast);
406395
407396 net->netdev_ops = &device_ops;
408397
@@ -456,6 +445,7 @@ static int netvsc_remove(struct hv_device *dev) · 47 unmodified lines
456445
457446 ndev_ctx = netdev_priv(net);
458447 cancel_delayed_work_sync(&ndev_ctx->dwork);
448+ cancel_work_sync(&ndev_ctx->work);
459449
460450 /* Stop outbound asap */
461451 netif_tx_disable(net);
drivers/net/phy/icplus.c+11−1
@@ -40,6 +40,7 @@ MODULE_LICENSE("GPL"); · 39 unmodified lines
4040 #define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */
4141 #define IP1001_APS_ON 11 /* IP1001 APS Mode bit */
4242 #define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */
43+#define IP101A_G_IRQ_CONF_STATUS 0x11 /* Conf Info IRQ & Status Reg */
4344
4445 static int ip175c_config_init(struct phy_device *phydev)
4546 {
@@ -185,6 +186,15 @@ static int ip175c_config_aneg(struct phy_device *phydev) · 139 unmodified lines
185186 return 0;
186187 }
187188
189+static int ip101a_g_ack_interrupt(struct phy_device *phydev)
190+{
191+ int err = phy_read(phydev, IP101A_G_IRQ_CONF_STATUS);
192+ if (err < 0)
193+ return err;
194+
195+ return 0;
196+}
197+
188198 static struct phy_driver ip175c_driver = {
189199 .phy_id = 0x02430d80,
190200 .name = "ICPlus IP175C",
@@ -204,7 +214,6 @@ static struct phy_driver ip1001_driver = { · 13 unmodified lines
204214 .phy_id_mask = 0x0ffffff0,
205215 .features = PHY_GBIT_FEATURES | SUPPORTED_Pause |
206216 SUPPORTED_Asym_Pause,
207− .flags = PHY_HAS_INTERRUPT,
208217 .config_init = &ip1001_config_init,
209218 .config_aneg = &genphy_config_aneg,
210219 .read_status = &genphy_read_status,
@@ -220,6 +229,7 @@ static struct phy_driver ip101a_g_driver = { · 9 unmodified lines
220229 .features = PHY_BASIC_FEATURES | SUPPORTED_Pause |
221230 SUPPORTED_Asym_Pause,
222231 .flags = PHY_HAS_INTERRUPT,
232+ .ack_interrupt = ip101a_g_ack_interrupt,
223233 .config_init = &ip101a_g_config_init,
224234 .config_aneg = &genphy_config_aneg,
225235 .read_status = &genphy_read_status,
drivers/net/ppp/ppp_generic.c+6−9
@@ -235,7 +235,7 @@ struct ppp_net { · 234 unmodified lines
235235 /* Prototypes. */
236236 static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf,
237237 struct file *file, unsigned int cmd, unsigned long arg);
238−static int ppp_xmit_process(struct ppp *ppp);
238+static void ppp_xmit_process(struct ppp *ppp);
239239 static void ppp_send_frame(struct ppp *ppp, struct sk_buff *skb);
240240 static void ppp_push(struct ppp *ppp);
241241 static void ppp_channel_push(struct channel *pch);
@@ -969,8 +969,7 @@ ppp_start_xmit(struct sk_buff *skb, struct net_device *dev) · 727 unmodified lines
969969 put_unaligned_be16(proto, pp);
970970
971971 skb_queue_tail(&ppp->file.xq, skb);
972− if (!ppp_xmit_process(ppp))
973− netif_stop_queue(dev);
972+ ppp_xmit_process(ppp);
974973 return NETDEV_TX_OK;
975974
976975 outf:
@@ -1048,11 +1047,10 @@ static void ppp_setup(struct net_device *dev) · 71 unmodified lines
10481047 * Called to do any work queued up on the transmit side
10491048 * that can now be done.
10501049 */
1051−static int
1050+static void
10521051 ppp_xmit_process(struct ppp *ppp)
10531052 {
10541053 struct sk_buff *skb;
1055− int ret = 0;
10561054
10571055 ppp_xmit_lock(ppp);
10581056 if (!ppp->closing) {
@@ -1062,13 +1060,12 @@ ppp_xmit_process(struct ppp *ppp) · 3 unmodified lines
10621060 ppp_send_frame(ppp, skb);
10631061 /* If there's no work left to do, tell the core net
10641062 code that we can accept some more. */
1065− if (!ppp->xmit_pending && !skb_peek(&ppp->file.xq)) {
1063+ if (!ppp->xmit_pending && !skb_peek(&ppp->file.xq))
10661064 netif_wake_queue(ppp->dev);
1067− ret = 1;
1068− }
1065+ else
1066+ netif_stop_queue(ppp->dev);
10691067 }
10701068 ppp_xmit_unlock(ppp);
1071− return ret;
10721069 }
10731070
10741071 static inline struct sk_buff *
drivers/net/usb/qmi_wwan.c+30−0
@@ -365,6 +365,27 @@ static const struct driver_info qmi_wwan_force_int4 = { · 364 unmodified lines
365365 .data = BIT(4), /* interface whitelist bitmap */
366366 };
367367
368+/* Sierra Wireless provide equally useless interface descriptors
369+ * Devices in QMI mode can be switched between two different
370+ * configurations:
371+ * a) USB interface #8 is QMI/wwan
372+ * b) USB interfaces #8, #19 and #20 are QMI/wwan
373+ *
374+ * Both configurations provide a number of other interfaces (serial++),
375+ * some of which have the same endpoint configuration as we expect, so
376+ * a whitelist or blacklist is necessary.
377+ *
378+ * FIXME: The below whitelist should include BIT(20). It does not
379+ * because I cannot get it to work...
380+ */
381+static const struct driver_info qmi_wwan_sierra = {
382+ .description = "Sierra Wireless wwan/QMI device",
383+ .flags = FLAG_WWAN,
384+ .bind = qmi_wwan_bind_gobi,
385+ .unbind = qmi_wwan_unbind_shared,
386+ .manage_power = qmi_wwan_manage_power,
387+ .data = BIT(8) | BIT(19), /* interface whitelist bitmap */
388+};
368389
369390 #define HUAWEI_VENDOR_ID 0x12D1
370391 #define QMI_GOBI_DEVICE(vend, prod) \
@@ -445,6 +466,15 @@ static const struct usb_device_id products[] = { · 74 unmodified lines
445466 .bInterfaceProtocol = 0xff,
446467 .driver_info = (unsigned long)&qmi_wwan_force_int4,
447468 },
469+ { /* Sierra Wireless MC77xx in QMI mode */
470+ .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
471+ .idVendor = 0x1199,
472+ .idProduct = 0x68a2,
473+ .bInterfaceClass = 0xff,
474+ .bInterfaceSubClass = 0xff,
475+ .bInterfaceProtocol = 0xff,
476+ .driver_info = (unsigned long)&qmi_wwan_sierra,
477+ },
448478 {QMI_GOBI_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
449479 {QMI_GOBI_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */
450480 {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */
drivers/net/usb/smsc75xx.c+1−0
@@ -1051,6 +1051,7 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf) · 1050 unmodified lines
10511051 dev->net->ethtool_ops = &smsc75xx_ethtool_ops;
10521052 dev->net->flags |= IFF_MULTICAST;
10531053 dev->net->hard_header_len += SMSC75XX_TX_OVERHEAD;
1054+ dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
10541055 return 0;
10551056 }
10561057
drivers/net/virtio_net.c+2−3
@@ -626,16 +626,15 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev) · 625 unmodified lines
626626 /* This can happen with OOM and indirect buffers. */
627627 if (unlikely(capacity < 0)) {
628628 if (likely(capacity == -ENOMEM)) {
629− if (net_ratelimit()) {
629+ if (net_ratelimit())
630630 dev_warn(&dev->dev,
631631 "TX queue failure: out of memory\n");
632− } else {
632+ } else {
633633 dev->stats.tx_fifo_errors++;
634634 if (net_ratelimit())
635635 dev_warn(&dev->dev,
636636 "Unexpected TX queue failure: %d\n",
637637 capacity);
638− }
639638 }
640639 dev->stats.tx_dropped++;
641640 kfree_skb(skb);
drivers/net/wan/farsync.c+1−0
@@ -2483,6 +2483,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 2482 unmodified lines
24832483 pr_err("Control memory remap failed\n");
24842484 pci_release_regions(pdev);
24852485 pci_disable_device(pdev);
2486+ iounmap(card->mem);
24862487 kfree(card);
24872488 return -ENODEV;
24882489 }
drivers/net/wireless/ath/ath5k/ahb.c+5−2
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/nl80211.h>
2020 #include <linux/platform_device.h>
2121 #include <linux/etherdevice.h>
22+#include <linux/export.h>
2223 #include <ar231x_platform.h>
2324 #include "ath5k.h"
2425 #include "debug.h"
@@ -119,7 +120,7 @@ static int ath_ahb_probe(struct platform_device *pdev) · 94 unmodified lines
119120 if (res == NULL) {
120121 dev_err(&pdev->dev, "no IRQ resource found\n");
121122 ret = -ENXIO;
122− goto err_out;
123+ goto err_iounmap;
123124 }
124125
125126 irq = res->start;
@@ -128,7 +129,7 @@ static int ath_ahb_probe(struct platform_device *pdev) · 2 unmodified lines
128129 if (hw == NULL) {
129130 dev_err(&pdev->dev, "no memory for ieee80211_hw\n");
130131 ret = -ENOMEM;
131− goto err_out;
132+ goto err_iounmap;
132133 }
133134
134135 ah = hw->priv;
@@ -185,6 +186,8 @@ static int ath_ahb_probe(struct platform_device *pdev) · 50 unmodified lines
185186 err_free_hw:
186187 ieee80211_free_hw(hw);
187188 platform_set_drvdata(pdev, NULL);
189+ err_iounmap:
190+ iounmap(mem);
188191 err_out:
189192 return ret;
190193 }
drivers/net/wireless/ath/ath9k/main.c+11−6
@@ -118,15 +118,13 @@ void ath9k_ps_restore(struct ath_softc *sc) · 117 unmodified lines
118118 if (--sc->ps_usecount != 0)
119119 goto unlock;
120120
121− if (sc->ps_flags & PS_WAIT_FOR_TX_ACK)
122− goto unlock;
123−
124− if (sc->ps_idle)
121+ if (sc->ps_idle && (sc->ps_flags & PS_WAIT_FOR_TX_ACK))
125122 mode = ATH9K_PM_FULL_SLEEP;
126123 else if (sc->ps_enabled &&
127124 !(sc->ps_flags & (PS_WAIT_FOR_BEACON |
128125 PS_WAIT_FOR_CAB |
129− PS_WAIT_FOR_PSPOLL_DATA)))
126+ PS_WAIT_FOR_PSPOLL_DATA |
127+ PS_WAIT_FOR_TX_ACK)))
130128 mode = ATH9K_PM_NETWORK_SLEEP;
131129 else
132130 goto unlock;
@@ -1550,6 +1548,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) · 1417 unmodified lines
15501548 struct ath_hw *ah = sc->sc_ah;
15511549 struct ath_common *common = ath9k_hw_common(ah);
15521550 struct ieee80211_conf *conf = &hw->conf;
1551+ bool reset_channel = false;
15531552
15541553 ath9k_ps_wakeup(sc);
15551554 mutex_lock(&sc->mutex);
@@ -1558,6 +1557,12 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) · 2 unmodified lines
15581557 sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE);
15591558 if (sc->ps_idle)
15601559 ath_cancel_work(sc);
1560+ else
1561+ /*
1562+ * The chip needs a reset to properly wake up from
1563+ * full sleep
1564+ */
1565+ reset_channel = ah->chip_fullsleep;
15611566 }
15621567
15631568 /*
@@ -1586,7 +1591,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) · 22 unmodified lines
15861591 }
15871592 }
15881593
1589− if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
1594+ if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || reset_channel) {
15901595 struct ieee80211_channel *curchan = hw->conf.channel;
15911596 int pos = curchan->hw_value;
15921597 int old_pos = -1;
drivers/net/wireless/ath/ath9k/xmit.c+9−1
@@ -1820,6 +1820,7 @@ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, · 1819 unmodified lines
18201820 struct ath_frame_info *fi = get_frame_info(skb);
18211821 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
18221822 struct ath_buf *bf;
1823+ int fragno;
18231824 u16 seqno;
18241825
18251826 bf = ath_tx_get_buffer(sc);
@@ -1831,9 +1832,16 @@ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, · 5 unmodified lines
18311832 ATH_TXBUF_RESET(bf);
18321833
18331834 if (tid) {
1835+ fragno = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG;
18341836 seqno = tid->seq_next;
18351837 hdr->seq_ctrl = cpu_to_le16(tid->seq_next << IEEE80211_SEQ_SEQ_SHIFT);
1836− INCR(tid->seq_next, IEEE80211_SEQ_MAX);
1838+
1839+ if (fragno)
1840+ hdr->seq_ctrl |= cpu_to_le16(fragno);
1841+
1842+ if (!ieee80211_has_morefrags(hdr->frame_control))
1843+ INCR(tid->seq_next, IEEE80211_SEQ_MAX);
1844+
18371845 bf->bf_state.seqno = seqno;
18381846 }
18391847
drivers/net/wireless/brcm80211/brcmsmac/main.c+8−0
@@ -7614,6 +7614,7 @@ brcms_c_recvctl(struct brcms_c_info *wlc, struct d11rxhdr *rxh, · 7613 unmodified lines
76147614 {
76157615 int len_mpdu;
76167616 struct ieee80211_rx_status rx_status;
7617+ struct ieee80211_hdr *hdr;
76177618
76187619 memset(&rx_status, 0, sizeof(rx_status));
76197620 prep_mac80211_status(wlc, rxh, p, &rx_status);
@@ -7623,6 +7624,13 @@ brcms_c_recvctl(struct brcms_c_info *wlc, struct d11rxhdr *rxh, · 3 unmodified lines
76237624 skb_pull(p, D11_PHY_HDR_LEN);
76247625 __skb_trim(p, len_mpdu);
76257626
7627+ /* unmute transmit */
7628+ if (wlc->hw->suspended_fifos) {
7629+ hdr = (struct ieee80211_hdr *)p->data;
7630+ if (ieee80211_is_beacon(hdr->frame_control))
7631+ brcms_b_mute(wlc->hw, false);
7632+ }
7633+
76267634 memcpy(IEEE80211_SKB_RXCB(p), &rx_status, sizeof(rx_status));
76277635 ieee80211_rx_irqsafe(wlc->pub->ieee_hw, p);
76287636 }
drivers/net/wireless/libertas/cfg.c+7−2
@@ -103,7 +103,7 @@ static const u32 cipher_suites[] = { · 102 unmodified lines
103103 * Convert NL80211's auth_type to the one from Libertas, see chapter 5.9.1
104104 * in the firmware spec
105105 */
106−static u8 lbs_auth_to_authtype(enum nl80211_auth_type auth_type)
106+static int lbs_auth_to_authtype(enum nl80211_auth_type auth_type)
107107 {
108108 int ret = -ENOTSUPP;
109109
@@ -1411,7 +1411,12 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev, · 1301 unmodified lines
14111411 goto done;
14121412 }
14131413
1414− lbs_set_authtype(priv, sme);
1414+ ret = lbs_set_authtype(priv, sme);
1415+ if (ret == -ENOTSUPP) {
1416+ wiphy_err(wiphy, "unsupported authtype 0x%x\n", sme->auth_type);
1417+ goto done;
1418+ }
1419+
14151420 lbs_set_radio(priv, preamble, 1);
14161421
14171422 /* Do the actual association */
drivers/net/wireless/mwifiex/pcie.h+9−9
@@ -48,15 +48,15 @@ · 47 unmodified lines
4848 #define PCIE_HOST_INT_STATUS_MASK 0xC3C
4949 #define PCIE_SCRATCH_2_REG 0xC40
5050 #define PCIE_SCRATCH_3_REG 0xC44
51−#define PCIE_SCRATCH_4_REG 0xCC0
52−#define PCIE_SCRATCH_5_REG 0xCC4
53−#define PCIE_SCRATCH_6_REG 0xCC8
54−#define PCIE_SCRATCH_7_REG 0xCCC
55−#define PCIE_SCRATCH_8_REG 0xCD0
56−#define PCIE_SCRATCH_9_REG 0xCD4
57−#define PCIE_SCRATCH_10_REG 0xCD8
58−#define PCIE_SCRATCH_11_REG 0xCDC
59−#define PCIE_SCRATCH_12_REG 0xCE0
51+#define PCIE_SCRATCH_4_REG 0xCD0
52+#define PCIE_SCRATCH_5_REG 0xCD4
53+#define PCIE_SCRATCH_6_REG 0xCD8
54+#define PCIE_SCRATCH_7_REG 0xCDC
55+#define PCIE_SCRATCH_8_REG 0xCE0
56+#define PCIE_SCRATCH_9_REG 0xCE4
57+#define PCIE_SCRATCH_10_REG 0xCE8
58+#define PCIE_SCRATCH_11_REG 0xCEC
59+#define PCIE_SCRATCH_12_REG 0xCF0
6060
6161 #define CPU_INTR_DNLD_RDY BIT(0)
6262 #define CPU_INTR_DOOR_BELL BIT(1)
drivers/net/wireless/rt2x00/rt2x00dev.c+1−5
@@ -1062,11 +1062,6 @@ static int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev) · 1061 unmodified lines
10621062
10631063 set_bit(DEVICE_STATE_INITIALIZED, &rt2x00dev->flags);
10641064
1065− /*
1066− * Register the extra components.
1067− */
1068− rt2x00rfkill_register(rt2x00dev);
1069−
10701065 return 0;
10711066 }
10721067
@@ -1210,6 +1205,7 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) · 137 unmodified lines
12101205 rt2x00link_register(rt2x00dev);
12111206 rt2x00leds_register(rt2x00dev);
12121207 rt2x00debug_register(rt2x00dev);
1208+ rt2x00rfkill_register(rt2x00dev);
12131209
12141210 return 0;
12151211
drivers/net/wireless/rtlwifi/base.c+4−1
@@ -838,7 +838,10 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw, · 837 unmodified lines
838838 __le16 fc = hdr->frame_control;
839839
840840 txrate = ieee80211_get_tx_rate(hw, info);
841− tcb_desc->hw_rate = txrate->hw_value;
841+ if (txrate)
842+ tcb_desc->hw_rate = txrate->hw_value;
843+ else
844+ tcb_desc->hw_rate = 0;
842845
843846 if (ieee80211_is_data(fc)) {
844847 /*
drivers/net/wireless/rtlwifi/pci.c+6−1
@@ -912,8 +912,13 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw) · 911 unmodified lines
912912 memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc));
913913 ring = &rtlpci->tx_ring[BEACON_QUEUE];
914914 pskb = __skb_dequeue(&ring->queue);
915− if (pskb)
915+ if (pskb) {
916+ struct rtl_tx_desc *entry = &ring->desc[ring->idx];
917+ pci_unmap_single(rtlpci->pdev, rtlpriv->cfg->ops->get_desc(
918+ (u8 *) entry, true, HW_DESC_TXBUFF_ADDR),
919+ pskb->len, PCI_DMA_TODEVICE);
916920 kfree_skb(pskb);
921+ }
917922
918923 /*NB: the beacon data buffer must be 32-bit aligned. */
919924 pskb = ieee80211_beacon_get(hw, mac->vif);
drivers/net/wireless/rtlwifi/rtl8192de/sw.c+0−6
@@ -91,7 +91,6 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) · 90 unmodified lines
9191 u8 tid;
9292 struct rtl_priv *rtlpriv = rtl_priv(hw);
9393 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
94− static int header_print;
9594
9695 rtlpriv->dm.dm_initialgain_enable = true;
9796 rtlpriv->dm.dm_flag = 0;
@@ -171,10 +170,6 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) · 73 unmodified lines
171170 for (tid = 0; tid < 8; tid++)
172171 skb_queue_head_init(&rtlpriv->mac80211.skb_waitq[tid]);
173172
174− /* Only load firmware for first MAC */
175− if (header_print)
176− return 0;
177−
178173 /* for firmware buf */
179174 rtlpriv->rtlhal.pfirmware = vzalloc(0x8000);
180175 if (!rtlpriv->rtlhal.pfirmware) {
@@ -186,7 +181,6 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) · 5 unmodified lines
186181 rtlpriv->max_fw_size = 0x8000;
187182 pr_info("Driver for Realtek RTL8192DE WLAN interface\n");
188183 pr_info("Loading firmware file %s\n", rtlpriv->cfg->fw_name);
189− header_print++;
190184
191185 /* request fw */
192186 err = request_firmware_nowait(THIS_MODULE, 1, rtlpriv->cfg->fw_name,
drivers/net/wireless/rtlwifi/usb.c+16−18
@@ -124,46 +124,38 @@ static int _usbctrl_vendorreq_sync_read(struct usb_device *udev, u8 request, · 123 unmodified lines
124124 return status;
125125 }
126126
127−static u32 _usb_read_sync(struct usb_device *udev, u32 addr, u16 len)
127+static u32 _usb_read_sync(struct rtl_priv *rtlpriv, u32 addr, u16 len)
128128 {
129+ struct device *dev = rtlpriv->io.dev;
130+ struct usb_device *udev = to_usb_device(dev);
129131 u8 request;
130132 u16 wvalue;
131133 u16 index;
132− u32 *data;
133− u32 ret;
134+ __le32 *data = &rtlpriv->usb_data[rtlpriv->usb_data_index];
134135
135− data = kmalloc(sizeof(u32), GFP_KERNEL);
136− if (!data)
137− return -ENOMEM;
138136 request = REALTEK_USB_VENQT_CMD_REQ;
139137 index = REALTEK_USB_VENQT_CMD_IDX; /* n/a */
140138
141139 wvalue = (u16)addr;
142140 _usbctrl_vendorreq_sync_read(udev, request, wvalue, index, data, len);
143− ret = le32_to_cpu(*data);
144− kfree(data);
145− return ret;
141+ if (++rtlpriv->usb_data_index >= RTL_USB_MAX_RX_COUNT)
142+ rtlpriv->usb_data_index = 0;
143+ return le32_to_cpu(*data);
146144 }
147145
148146 static u8 _usb_read8_sync(struct rtl_priv *rtlpriv, u32 addr)
149147 {
150− struct device *dev = rtlpriv->io.dev;
151−
152− return (u8)_usb_read_sync(to_usb_device(dev), addr, 1);
148+ return (u8)_usb_read_sync(rtlpriv, addr, 1);
153149 }
154150
155151 static u16 _usb_read16_sync(struct rtl_priv *rtlpriv, u32 addr)
156152 {
157− struct device *dev = rtlpriv->io.dev;
158−
159− return (u16)_usb_read_sync(to_usb_device(dev), addr, 2);
153+ return (u16)_usb_read_sync(rtlpriv, addr, 2);
160154 }
161155
162156 static u32 _usb_read32_sync(struct rtl_priv *rtlpriv, u32 addr)
163157 {
164− struct device *dev = rtlpriv->io.dev;
165−
166− return _usb_read_sync(to_usb_device(dev), addr, 4);
158+ return _usb_read_sync(rtlpriv, addr, 4);
167159 }
168160
169161 static void _usb_write_async(struct usb_device *udev, u32 addr, u32 val,
@@ -955,6 +947,11 @@ int __devinit rtl_usb_probe(struct usb_interface *intf, · 785 unmodified lines
955947 return -ENOMEM;
956948 }
957949 rtlpriv = hw->priv;
950+ rtlpriv->usb_data = kzalloc(RTL_USB_MAX_RX_COUNT * sizeof(u32),
951+ GFP_KERNEL);
952+ if (!rtlpriv->usb_data)
953+ return -ENOMEM;
954+ rtlpriv->usb_data_index = 0;
958955 init_completion(&rtlpriv->firmware_loading_complete);
959956 SET_IEEE80211_DEV(hw, &intf->dev);
960957 udev = interface_to_usbdev(intf);
@@ -1025,6 +1022,7 @@ void rtl_usb_disconnect(struct usb_interface *intf) · 64 unmodified lines
10251022 /* rtl_deinit_rfkill(hw); */
10261023 rtl_usb_deinit(hw);
10271024 rtl_deinit_core(hw);
1025+ kfree(rtlpriv->usb_data);
10281026 rtlpriv->cfg->ops->deinit_sw_leds(hw);
10291027 rtlpriv->cfg->ops->deinit_sw_vars(hw);
10301028 _rtl_usb_io_handler_release(hw);
drivers/net/wireless/rtlwifi/wifi.h+5−1
@@ -67,7 +67,7 @@ · 66 unmodified lines
6767 #define QOS_QUEUE_NUM 4
6868 #define RTL_MAC80211_NUM_QUEUE 5
6969 #define REALTEK_USB_VENQT_MAX_BUF_SIZE 254
70−
70+#define RTL_USB_MAX_RX_COUNT 100
7171 #define QBSS_LOAD_SIZE 5
7272 #define MAX_WMMELE_LENGTH 64
7373
@@ -1629,6 +1629,10 @@ struct rtl_priv { · 1555 unmodified lines
16291629 interface or hardware */
16301630 unsigned long status;
16311631
1632+ /* data buffer pointer for USB reads */
1633+ __le32 *usb_data;
1634+ int usb_data_index;
1635+
16321636 /*This must be the last item so
16331637 that it points to the data allocated
16341638 beyond this structure like:
drivers/of/gpio.c+1−1
@@ -140,7 +140,7 @@ int of_gpio_simple_xlate(struct gpio_chip *gc, · 139 unmodified lines
140140 if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
141141 return -EINVAL;
142142
143− if (gpiospec->args[0] > gc->ngpio)
143+ if (gpiospec->args[0] >= gc->ngpio)
144144 return -EINVAL;
145145
146146 if (flags)
drivers/pci/Makefile+1−0
@@ -42,6 +42,7 @@ obj-$(CONFIG_UNICORE32) += setup-bus.o setup-irq.o · 41 unmodified lines
4242 obj-$(CONFIG_PARISC) += setup-bus.o
4343 obj-$(CONFIG_SUPERH) += setup-bus.o setup-irq.o
4444 obj-$(CONFIG_PPC) += setup-bus.o
45+obj-$(CONFIG_FRV) += setup-bus.o
4546 obj-$(CONFIG_MIPS) += setup-bus.o setup-irq.o
4647 obj-$(CONFIG_X86_VISWS) += setup-irq.o
4748 obj-$(CONFIG_MN10300) += setup-bus.o
drivers/pci/pci.c+49−22
@@ -967,16 +967,59 @@ pci_save_state(struct pci_dev *dev) · 966 unmodified lines
967967 return 0;
968968 }
969969
970+static void pci_restore_config_dword(struct pci_dev *pdev, int offset,
971+ u32 saved_val, int retry)
972+{
973+ u32 val;
974+
975+ pci_read_config_dword(pdev, offset, &val);
976+ if (val == saved_val)
977+ return;
978+
979+ for (;;) {
980+ dev_dbg(&pdev->dev, "restoring config space at offset "
981+ "%#x (was %#x, writing %#x)\n", offset, val, saved_val);
982+ pci_write_config_dword(pdev, offset, saved_val);
983+ if (retry-- <= 0)
984+ return;
985+
986+ pci_read_config_dword(pdev, offset, &val);
987+ if (val == saved_val)
988+ return;
989+
990+ mdelay(1);
991+ }
992+}
993+
994+static void pci_restore_config_space_range(struct pci_dev *pdev,
995+ int start, int end, int retry)
996+{
997+ int index;
998+
999+ for (index = end; index >= start; index--)
1000+ pci_restore_config_dword(pdev, 4 * index,
1001+ pdev->saved_config_space[index],
1002+ retry);
1003+}
1004+
1005+static void pci_restore_config_space(struct pci_dev *pdev)
1006+{
1007+ if (pdev->hdr_type == PCI_HEADER_TYPE_NORMAL) {
1008+ pci_restore_config_space_range(pdev, 10, 15, 0);
1009+ /* Restore BARs before the command register. */
1010+ pci_restore_config_space_range(pdev, 4, 9, 10);
1011+ pci_restore_config_space_range(pdev, 0, 3, 0);
1012+ } else {
1013+ pci_restore_config_space_range(pdev, 0, 15, 0);
1014+ }
1015+}
1016+
9701017 /**
9711018 * pci_restore_state - Restore the saved state of a PCI device
9721019 * @dev: - PCI device that we're dealing with
9731020 */
9741021 void pci_restore_state(struct pci_dev *dev)
9751022 {
976− int i;
977− u32 val;
978− int tries;
979−
9801023 if (!dev->state_saved)
9811024 return;
9821025
@@ -984,24 +1027,8 @@ void pci_restore_state(struct pci_dev *dev) · 1 unmodified line
9841027 pci_restore_pcie_state(dev);
9851028 pci_restore_ats_state(dev);
9861029
987− /*
988− * The Base Address register should be programmed before the command
989− * register(s)
990− */
991− for (i = 15; i >= 0; i--) {
992− pci_read_config_dword(dev, i * 4, &val);
993− tries = 10;
994− while (tries && val != dev->saved_config_space[i]) {
995− dev_dbg(&dev->dev, "restoring config "
996− "space at offset %#x (was %#x, writing %#x)\n",
997− i, val, (int)dev->saved_config_space[i]);
998− pci_write_config_dword(dev,i * 4,
999− dev->saved_config_space[i]);
1000− pci_read_config_dword(dev, i * 4, &val);
1001− mdelay(10);
1002− tries--;
1003− }
1004− }
1030+ pci_restore_config_space(dev);
1031+
10051032 pci_restore_pcix_state(dev);
10061033 pci_restore_msi_state(dev);
10071034 pci_restore_iov_state(dev);
drivers/pinctrl/core.c+21−4
@@ -908,10 +908,6 @@ static int pinctrl_groups_show(struct seq_file *s, void *what) · 907 unmodified lines
908908 const struct pinctrl_ops *ops = pctldev->desc->pctlops;
909909 unsigned selector = 0;
910910
911− /* No grouping */
912− if (!ops)
913− return 0;
914−
915911 mutex_lock(&pinctrl_mutex);
916912
917913 seq_puts(s, "registered pin groups:\n");
@@ -1225,6 +1221,19 @@ static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev) · 307 unmodified lines
12251221
12261222 #endif
12271223
1224+static int pinctrl_check_ops(struct pinctrl_dev *pctldev)
1225+{
1226+ const struct pinctrl_ops *ops = pctldev->desc->pctlops;
1227+
1228+ if (!ops ||
1229+ !ops->list_groups ||
1230+ !ops->get_group_name ||
1231+ !ops->get_group_pins)
1232+ return -EINVAL;
1233+
1234+ return 0;
1235+}
1236+
12281237 /**
12291238 * pinctrl_register() - register a pin controller device
12301239 * @pctldesc: descriptor for this pin controller
@@ -1256,6 +1265,14 @@ struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc, · 25 unmodified lines
12561265 INIT_LIST_HEAD(&pctldev->gpio_ranges);
12571266 pctldev->dev = dev;
12581267
1268+ /* check core ops for sanity */
1269+ ret = pinctrl_check_ops(pctldev);
1270+ if (ret) {
1271+ pr_err("%s pinctrl ops lacks necessary functions\n",
1272+ pctldesc->name);
1273+ goto out_err;
1274+ }
1275+
12591276 /* If we're implementing pinmuxing, check the ops for sanity */
12601277 if (pctldesc->pmxops) {
12611278 ret = pinmux_check_ops(pctldev);
drivers/platform/x86/acerhdf.c+45−22
@@ -50,7 +50,7 @@ · 49 unmodified lines
5050 */
5151 #undef START_IN_KERNEL_MODE
5252
53−#define DRV_VER "0.5.24"
53+#define DRV_VER "0.5.26"
5454
5555 /*
5656 * According to the Atom N270 datasheet,
@@ -83,8 +83,8 @@ static int kernelmode; · 26 unmodified lines
8383 #endif
8484
8585 static unsigned int interval = 10;
86−static unsigned int fanon = 63000;
87−static unsigned int fanoff = 58000;
86+static unsigned int fanon = 60000;
87+static unsigned int fanoff = 53000;
8888 static unsigned int verbose;
8989 static unsigned int fanstate = ACERHDF_FAN_AUTO;
9090 static char force_bios[16];
@@ -150,6 +150,8 @@ static const struct bios_settings_t bios_tbl[] = { · 59 unmodified lines
150150 {"Acer", "AOA150", "v0.3308", 0x55, 0x58, {0x20, 0x00} },
151151 {"Acer", "AOA150", "v0.3309", 0x55, 0x58, {0x20, 0x00} },
152152 {"Acer", "AOA150", "v0.3310", 0x55, 0x58, {0x20, 0x00} },
153+ /* LT1005u */
154+ {"Acer", "LT-10Q", "v0.3310", 0x55, 0x58, {0x20, 0x00} },
153155 /* Acer 1410 */
154156 {"Acer", "Aspire 1410", "v0.3108", 0x55, 0x58, {0x9e, 0x00} },
155157 {"Acer", "Aspire 1410", "v0.3113", 0x55, 0x58, {0x9e, 0x00} },
@@ -161,6 +163,7 @@ static const struct bios_settings_t bios_tbl[] = { · 5 unmodified lines
161163 {"Acer", "Aspire 1410", "v1.3303", 0x55, 0x58, {0x9e, 0x00} },
162164 {"Acer", "Aspire 1410", "v1.3308", 0x55, 0x58, {0x9e, 0x00} },
163165 {"Acer", "Aspire 1410", "v1.3310", 0x55, 0x58, {0x9e, 0x00} },
166+ {"Acer", "Aspire 1410", "v1.3314", 0x55, 0x58, {0x9e, 0x00} },
164167 /* Acer 1810xx */
165168 {"Acer", "Aspire 1810TZ", "v0.3108", 0x55, 0x58, {0x9e, 0x00} },
166169 {"Acer", "Aspire 1810T", "v0.3108", 0x55, 0x58, {0x9e, 0x00} },
@@ -183,29 +186,44 @@ static const struct bios_settings_t bios_tbl[] = { · 16 unmodified lines
183186 {"Acer", "Aspire 1810TZ", "v1.3310", 0x55, 0x58, {0x9e, 0x00} },
184187 {"Acer", "Aspire 1810T", "v1.3310", 0x55, 0x58, {0x9e, 0x00} },
185188 {"Acer", "Aspire 1810TZ", "v1.3314", 0x55, 0x58, {0x9e, 0x00} },
189+ {"Acer", "Aspire 1810T", "v1.3314", 0x55, 0x58, {0x9e, 0x00} },
186190 /* Acer 531 */
191+ {"Acer", "AO531h", "v0.3104", 0x55, 0x58, {0x20, 0x00} },
187192 {"Acer", "AO531h", "v0.3201", 0x55, 0x58, {0x20, 0x00} },
193+ {"Acer", "AO531h", "v0.3304", 0x55, 0x58, {0x20, 0x00} },
194+ /* Acer 751 */
195+ {"Acer", "AO751h", "V0.3212", 0x55, 0x58, {0x21, 0x00} },
196+ /* Acer 1825 */
197+ {"Acer", "Aspire 1825PTZ", "V1.3118", 0x55, 0x58, {0x9e, 0x00} },
198+ {"Acer", "Aspire 1825PTZ", "V1.3127", 0x55, 0x58, {0x9e, 0x00} },
199+ /* Acer TravelMate 7730 */
200+ {"Acer", "TravelMate 7730G", "v0.3509", 0x55, 0x58, {0xaf, 0x00} },
188201 /* Gateway */
189− {"Gateway", "AOA110", "v0.3103", 0x55, 0x58, {0x21, 0x00} },
190− {"Gateway", "AOA150", "v0.3103", 0x55, 0x58, {0x20, 0x00} },
191− {"Gateway", "LT31", "v1.3103", 0x55, 0x58, {0x9e, 0x00} },
192− {"Gateway", "LT31", "v1.3201", 0x55, 0x58, {0x9e, 0x00} },
193− {"Gateway", "LT31", "v1.3302", 0x55, 0x58, {0x9e, 0x00} },
202+ {"Gateway", "AOA110", "v0.3103", 0x55, 0x58, {0x21, 0x00} },
203+ {"Gateway", "AOA150", "v0.3103", 0x55, 0x58, {0x20, 0x00} },
204+ {"Gateway", "LT31", "v1.3103", 0x55, 0x58, {0x9e, 0x00} },
205+ {"Gateway", "LT31", "v1.3201", 0x55, 0x58, {0x9e, 0x00} },
206+ {"Gateway", "LT31", "v1.3302", 0x55, 0x58, {0x9e, 0x00} },
207+ {"Gateway", "LT31", "v1.3303t", 0x55, 0x58, {0x9e, 0x00} },
194208 /* Packard Bell */
195− {"Packard Bell", "DOA150", "v0.3104", 0x55, 0x58, {0x21, 0x00} },
196− {"Packard Bell", "DOA150", "v0.3105", 0x55, 0x58, {0x20, 0x00} },
197− {"Packard Bell", "AOA110", "v0.3105", 0x55, 0x58, {0x21, 0x00} },
198− {"Packard Bell", "AOA150", "v0.3105", 0x55, 0x58, {0x20, 0x00} },
199− {"Packard Bell", "DOTMU", "v1.3303", 0x55, 0x58, {0x9e, 0x00} },
200− {"Packard Bell", "DOTMU", "v0.3120", 0x55, 0x58, {0x9e, 0x00} },
201− {"Packard Bell", "DOTMU", "v0.3108", 0x55, 0x58, {0x9e, 0x00} },
202− {"Packard Bell", "DOTMU", "v0.3113", 0x55, 0x58, {0x9e, 0x00} },
203− {"Packard Bell", "DOTMU", "v0.3115", 0x55, 0x58, {0x9e, 0x00} },
204− {"Packard Bell", "DOTMU", "v0.3117", 0x55, 0x58, {0x9e, 0x00} },
205− {"Packard Bell", "DOTMU", "v0.3119", 0x55, 0x58, {0x9e, 0x00} },
206− {"Packard Bell", "DOTMU", "v1.3204", 0x55, 0x58, {0x9e, 0x00} },
207− {"Packard Bell", "DOTMA", "v1.3201", 0x55, 0x58, {0x9e, 0x00} },
208− {"Packard Bell", "DOTMA", "v1.3302", 0x55, 0x58, {0x9e, 0x00} },
209+ {"Packard Bell", "DOA150", "v0.3104", 0x55, 0x58, {0x21, 0x00} },
210+ {"Packard Bell", "DOA150", "v0.3105", 0x55, 0x58, {0x20, 0x00} },
211+ {"Packard Bell", "AOA110", "v0.3105", 0x55, 0x58, {0x21, 0x00} },
212+ {"Packard Bell", "AOA150", "v0.3105", 0x55, 0x58, {0x20, 0x00} },
213+ {"Packard Bell", "ENBFT", "V1.3118", 0x55, 0x58, {0x9e, 0x00} },
214+ {"Packard Bell", "ENBFT", "V1.3127", 0x55, 0x58, {0x9e, 0x00} },
215+ {"Packard Bell", "DOTMU", "v1.3303", 0x55, 0x58, {0x9e, 0x00} },
216+ {"Packard Bell", "DOTMU", "v0.3120", 0x55, 0x58, {0x9e, 0x00} },
217+ {"Packard Bell", "DOTMU", "v0.3108", 0x55, 0x58, {0x9e, 0x00} },
218+ {"Packard Bell", "DOTMU", "v0.3113", 0x55, 0x58, {0x9e, 0x00} },
219+ {"Packard Bell", "DOTMU", "v0.3115", 0x55, 0x58, {0x9e, 0x00} },
220+ {"Packard Bell", "DOTMU", "v0.3117", 0x55, 0x58, {0x9e, 0x00} },
221+ {"Packard Bell", "DOTMU", "v0.3119", 0x55, 0x58, {0x9e, 0x00} },
222+ {"Packard Bell", "DOTMU", "v1.3204", 0x55, 0x58, {0x9e, 0x00} },
223+ {"Packard Bell", "DOTMA", "v1.3201", 0x55, 0x58, {0x9e, 0x00} },
224+ {"Packard Bell", "DOTMA", "v1.3302", 0x55, 0x58, {0x9e, 0x00} },
225+ {"Packard Bell", "DOTMA", "v1.3303t", 0x55, 0x58, {0x9e, 0x00} },
226+ {"Packard Bell", "DOTVR46", "v1.3308", 0x55, 0x58, {0x9e, 0x00} },
209227 /* pewpew-terminator */
210228 {"", "", "", 0, 0, {0, 0} }
211229 };
@@ -701,15 +719,20 @@ MODULE_LICENSE("GPL"); · 489 unmodified lines
701719 MODULE_AUTHOR("Peter Feuerer");
702720 MODULE_DESCRIPTION("Aspire One temperature and fan driver");
703721 MODULE_ALIAS("dmi:*:*Acer*:pnAOA*:");
722+MODULE_ALIAS("dmi:*:*Acer*:pnAO751h*:");
704723 MODULE_ALIAS("dmi:*:*Acer*:pnAspire*1410*:");
705724 MODULE_ALIAS("dmi:*:*Acer*:pnAspire*1810*:");
725+MODULE_ALIAS("dmi:*:*Acer*:pnAspire*1825PTZ:");
706726 MODULE_ALIAS("dmi:*:*Acer*:pnAO531*:");
727+MODULE_ALIAS("dmi:*:*Acer*:TravelMate*7730G:");
707728 MODULE_ALIAS("dmi:*:*Gateway*:pnAOA*:");
708729 MODULE_ALIAS("dmi:*:*Gateway*:pnLT31*:");
709730 MODULE_ALIAS("dmi:*:*Packard*Bell*:pnAOA*:");
710731 MODULE_ALIAS("dmi:*:*Packard*Bell*:pnDOA*:");
711732 MODULE_ALIAS("dmi:*:*Packard*Bell*:pnDOTMU*:");
733+MODULE_ALIAS("dmi:*:*Packard*Bell*:pnENBFT*:");
712734 MODULE_ALIAS("dmi:*:*Packard*Bell*:pnDOTMA*:");
735+MODULE_ALIAS("dmi:*:*Packard*Bell*:pnDOTVR46*:");
713736
714737 module_init(acerhdf_init);
715738 module_exit(acerhdf_exit);
drivers/platform/x86/dell-laptop.c+1−0
@@ -212,6 +212,7 @@ static struct dmi_system_id __devinitdata dell_quirks[] = { · 211 unmodified lines
212212 },
213213 .driver_data = &quirk_dell_vostro_v130,
214214 },
215+ { }
215216 };
216217
217218 static struct calling_interface_buffer *buffer;
drivers/platform/x86/intel_ips.c+1−1
@@ -1565,7 +1565,7 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id) · 1564 unmodified lines
15651565 ips->poll_turbo_status = true;
15661566
15671567 if (!ips_get_i915_syms(ips)) {
1568− dev_err(&dev->dev, "failed to get i915 symbols, graphics turbo disabled\n");
1568+ dev_info(&dev->dev, "failed to get i915 symbols, graphics turbo disabled until i915 loads\n");
15691569 ips->gpu_turbo_enabled = false;
15701570 } else {
15711571 dev_dbg(&dev->dev, "graphics turbo enabled\n");
drivers/regulator/anatop-regulator.c+3−3
@@ -214,7 +214,7 @@ static struct of_device_id __devinitdata of_anatop_regulator_match_tbl[] = { · 213 unmodified lines
214214 { /* end */ }
215215 };
216216
217−static struct platform_driver anatop_regulator = {
217+static struct platform_driver anatop_regulator_driver = {
218218 .driver = {
219219 .name = "anatop_regulator",
220220 .owner = THIS_MODULE,
@@ -226,13 +226,13 @@ static struct platform_driver anatop_regulator = { · 5 unmodified lines
226226
227227 static int __init anatop_regulator_init(void)
228228 {
229− return platform_driver_register(&anatop_regulator);
229+ return platform_driver_register(&anatop_regulator_driver);
230230 }
231231 postcore_initcall(anatop_regulator_init);
232232
233233 static void __exit anatop_regulator_exit(void)
234234 {
235− platform_driver_unregister(&anatop_regulator);
235+ platform_driver_unregister(&anatop_regulator_driver);
236236 }
237237 module_exit(anatop_regulator_exit);
238238
drivers/rtc/rtc-ds1307.c+1−0
@@ -902,6 +902,7 @@ read_rtc: · 901 unmodified lines
902902 }
903903 ds1307->nvram->attr.name = "nvram";
904904 ds1307->nvram->attr.mode = S_IRUGO | S_IWUSR;
905+ sysfs_bin_attr_init(ds1307->nvram);
905906 ds1307->nvram->read = ds1307_nvram_read,
906907 ds1307->nvram->write = ds1307_nvram_write,
907908 ds1307->nvram->size = chip->nvram_size;
drivers/rtc/rtc-efi.c+0−1
@@ -213,7 +213,6 @@ static struct platform_driver efi_rtc_driver = { · 212 unmodified lines
213213 .name = "rtc-efi",
214214 .owner = THIS_MODULE,
215215 },
216− .probe = efi_rtc_probe,
217216 .remove = __exit_p(efi_rtc_remove),
218217 };
219218
drivers/rtc/rtc-pl031.c+1−2
@@ -339,8 +339,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) · 338 unmodified lines
339339 dev_dbg(&adev->dev, "revision = 0x%01x\n", ldata->hw_revision);
340340
341341 /* Enable the clockwatch on ST Variants */
342− if ((ldata->hw_designer == AMBA_VENDOR_ST) &&
343− (ldata->hw_revision > 1))
342+ if (ldata->hw_designer == AMBA_VENDOR_ST)
344343 writel(readl(ldata->base + RTC_CR) | RTC_CR_CWEN,
345344 ldata->base + RTC_CR);
346345
drivers/rtc/rtc-r9701.c+22−0
@@ -122,6 +122,7 @@ static const struct rtc_class_ops r9701_rtc_ops = { · 121 unmodified lines
122122 static int __devinit r9701_probe(struct spi_device *spi)
123123 {
124124 struct rtc_device *rtc;
125+ struct rtc_time dt;
125126 unsigned char tmp;
126127 int res;
127128
@@ -132,6 +133,27 @@ static int __devinit r9701_probe(struct spi_device *spi) · 4 unmodified lines
132133 return -ENODEV;
133134 }
134135
136+ /*
137+ * The device seems to be present. Now check if the registers
138+ * contain invalid values. If so, try to write a default date:
139+ * 2000/1/1 00:00:00
140+ */
141+ r9701_get_datetime(&spi->dev, &dt);
142+ if (rtc_valid_tm(&dt)) {
143+ dev_info(&spi->dev, "trying to repair invalid date/time\n");
144+ dt.tm_sec = 0;
145+ dt.tm_min = 0;
146+ dt.tm_hour = 0;
147+ dt.tm_mday = 1;
148+ dt.tm_mon = 0;
149+ dt.tm_year = 100;
150+
151+ if (r9701_set_datetime(&spi->dev, &dt)) {
152+ dev_err(&spi->dev, "cannot repair RTC register\n");
153+ return -ENODEV;
154+ }
155+ }
156+
135157 rtc = rtc_device_register("r9701",
136158 &spi->dev, &r9701_rtc_ops, THIS_MODULE);
137159 if (IS_ERR(rtc))
drivers/rtc/rtc-s3c.c+22−9
@@ -40,6 +40,10 @@ enum s3c_cpu_type { · 39 unmodified lines
4040 TYPE_S3C64XX,
4141 };
4242
43+struct s3c_rtc_drv_data {
44+ int cpu_type;
45+};
46+
4347 /* I have yet to find an S3C implementation with more than one
4448 * of these rtc blocks in */
4549
@@ -446,10 +450,12 @@ static const struct of_device_id s3c_rtc_dt_match[]; · 400 unmodified lines
446450 static inline int s3c_rtc_get_driver_data(struct platform_device *pdev)
447451 {
448452 #ifdef CONFIG_OF
453+ struct s3c_rtc_drv_data *data;
449454 if (pdev->dev.of_node) {
450455 const struct of_device_id *match;
451456 match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node);
452− return match->data;
457+ data = (struct s3c_rtc_drv_data *) match->data;
458+ return data->cpu_type;
453459 }
454460 #endif
455461 return platform_get_device_id(pdev)->driver_data;
@@ -664,20 +670,27 @@ static int s3c_rtc_resume(struct platform_device *pdev) · 208 unmodified lines
664670 #define s3c_rtc_resume NULL
665671 #endif
666672
673+static struct s3c_rtc_drv_data s3c_rtc_drv_data_array[] = {
674+ [TYPE_S3C2410] = { TYPE_S3C2410 },
675+ [TYPE_S3C2416] = { TYPE_S3C2416 },
676+ [TYPE_S3C2443] = { TYPE_S3C2443 },
677+ [TYPE_S3C64XX] = { TYPE_S3C64XX },
678+};
679+
667680 #ifdef CONFIG_OF
668681 static const struct of_device_id s3c_rtc_dt_match[] = {
669682 {
670− .compatible = "samsung,s3c2410-rtc"
671− .data = TYPE_S3C2410,
683+ .compatible = "samsung,s3c2410-rtc",
684+ .data = &s3c_rtc_drv_data_array[TYPE_S3C2410],
672685 }, {
673− .compatible = "samsung,s3c2416-rtc"
674− .data = TYPE_S3C2416,
686+ .compatible = "samsung,s3c2416-rtc",
687+ .data = &s3c_rtc_drv_data_array[TYPE_S3C2416],
675688 }, {
676− .compatible = "samsung,s3c2443-rtc"
677− .data = TYPE_S3C2443,
689+ .compatible = "samsung,s3c2443-rtc",
690+ .data = &s3c_rtc_drv_data_array[TYPE_S3C2443],
678691 }, {
679− .compatible = "samsung,s3c6410-rtc"
680− .data = TYPE_S3C64XX,
692+ .compatible = "samsung,s3c6410-rtc",
693+ .data = &s3c_rtc_drv_data_array[TYPE_S3C64XX],
681694 },
682695 {},
683696 };
drivers/rtc/rtc-twl.c+38−5
@@ -112,6 +112,7 @@ static const u8 twl6030_rtc_reg_map[] = { · 111 unmodified lines
112112 #define BIT_RTC_CTRL_REG_TEST_MODE_M 0x10
113113 #define BIT_RTC_CTRL_REG_SET_32_COUNTER_M 0x20
114114 #define BIT_RTC_CTRL_REG_GET_TIME_M 0x40
115+#define BIT_RTC_CTRL_REG_RTC_V_OPT 0x80
115116
116117 /* RTC_STATUS_REG bitfields */
117118 #define BIT_RTC_STATUS_REG_RUN_M 0x02
@@ -235,25 +236,57 @@ static int twl_rtc_read_time(struct device *dev, struct rtc_time *tm) · 117 unmodified lines
235236 unsigned char rtc_data[ALL_TIME_REGS + 1];
236237 int ret;
237238 u8 save_control;
239+ u8 rtc_control;
238240
239241 ret = twl_rtc_read_u8(&save_control, REG_RTC_CTRL_REG);
240− if (ret < 0)
242+ if (ret < 0) {
243+ dev_err(dev, "%s: reading CTRL_REG, error %d\n", __func__, ret);
241244 return ret;
245+ }
246+ /* for twl6030/32 make sure BIT_RTC_CTRL_REG_GET_TIME_M is clear */
247+ if (twl_class_is_6030()) {
248+ if (save_control & BIT_RTC_CTRL_REG_GET_TIME_M) {
249+ save_control &= ~BIT_RTC_CTRL_REG_GET_TIME_M;
250+ ret = twl_rtc_write_u8(save_control, REG_RTC_CTRL_REG);
251+ if (ret < 0) {
252+ dev_err(dev, "%s clr GET_TIME, error %d\n",
253+ __func__, ret);
254+ return ret;
255+ }
256+ }
257+ }
242258
243− save_control |= BIT_RTC_CTRL_REG_GET_TIME_M;
259+ /* Copy RTC counting registers to static registers or latches */
260+ rtc_control = save_control | BIT_RTC_CTRL_REG_GET_TIME_M;
244261
245− ret = twl_rtc_write_u8(save_control, REG_RTC_CTRL_REG);
246− if (ret < 0)
262+ /* for twl6030/32 enable read access to static shadowed registers */
263+ if (twl_class_is_6030())
264+ rtc_control |= BIT_RTC_CTRL_REG_RTC_V_OPT;
265+
266+ ret = twl_rtc_write_u8(rtc_control, REG_RTC_CTRL_REG);
267+ if (ret < 0) {
268+ dev_err(dev, "%s: writing CTRL_REG, error %d\n", __func__, ret);
247269 return ret;
270+ }
248271
249272 ret = twl_i2c_read(TWL_MODULE_RTC, rtc_data,
250273 (rtc_reg_map[REG_SECONDS_REG]), ALL_TIME_REGS);
251274
252275 if (ret < 0) {
253− dev_err(dev, "rtc_read_time error %d\n", ret);
276+ dev_err(dev, "%s: reading data, error %d\n", __func__, ret);
254277 return ret;
255278 }
256279
280+ /* for twl6030 restore original state of rtc control register */
281+ if (twl_class_is_6030()) {
282+ ret = twl_rtc_write_u8(save_control, REG_RTC_CTRL_REG);
283+ if (ret < 0) {
284+ dev_err(dev, "%s: restore CTRL_REG, error %d\n",
285+ __func__, ret);
286+ return ret;
287+ }
288+ }
289+
257290 tm->tm_sec = bcd2bin(rtc_data[0]);
258291 tm->tm_min = bcd2bin(rtc_data[1]);
259292 tm->tm_hour = bcd2bin(rtc_data[2]);
drivers/s390/block/dasd_eckd.c+16−8
@@ -2844,6 +2844,7 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track( · 2843 unmodified lines
28442844 sector_t recid, trkid;
28452845 unsigned int offs;
28462846 unsigned int count, count_to_trk_end;
2847+ int ret;
28472848
28482849 basedev = block->base;
28492850 if (rq_data_dir(req) == READ) {
@@ -2884,8 +2885,8 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track( · 34 unmodified lines
28842885
28852886 itcw = itcw_init(cqr->data, itcw_size, itcw_op, 0, ctidaw, 0);
28862887 if (IS_ERR(itcw)) {
2887− dasd_sfree_request(cqr, startdev);
2888− return ERR_PTR(-EINVAL);
2888+ ret = -EINVAL;
2889+ goto out_error;
28892890 }
28902891 cqr->cpaddr = itcw_get_tcw(itcw);
28912892 if (prepare_itcw(itcw, first_trk, last_trk,
@@ -2897,8 +2898,8 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track( · 5 unmodified lines
28972898 /* Clock not in sync and XRC is enabled.
28982899 * Try again later.
28992900 */
2900− dasd_sfree_request(cqr, startdev);
2901− return ERR_PTR(-EAGAIN);
2901+ ret = -EAGAIN;
2902+ goto out_error;
29022903 }
29032904 len_to_track_end = 0;
29042905 /*
@@ -2937,8 +2938,10 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track( · 32 unmodified lines
29372938 tidaw_flags = 0;
29382939 last_tidaw = itcw_add_tidaw(itcw, tidaw_flags,
29392940 dst, part_len);
2940− if (IS_ERR(last_tidaw))
2941− return ERR_PTR(-EINVAL);
2941+ if (IS_ERR(last_tidaw)) {
2942+ ret = -EINVAL;
2943+ goto out_error;
2944+ }
29422945 dst += part_len;
29432946 }
29442947 }
@@ -2947,8 +2950,10 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track( · 2 unmodified lines
29472950 dst = page_address(bv->bv_page) + bv->bv_offset;
29482951 last_tidaw = itcw_add_tidaw(itcw, 0x00,
29492952 dst, bv->bv_len);
2950− if (IS_ERR(last_tidaw))
2951− return ERR_PTR(-EINVAL);
2953+ if (IS_ERR(last_tidaw)) {
2954+ ret = -EINVAL;
2955+ goto out_error;
2956+ }
29522957 }
29532958 }
29542959 last_tidaw->flags |= TIDAW_FLAGS_LAST;
@@ -2968,6 +2973,9 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track( · 13 unmodified lines
29682973 cqr->buildclk = get_clock();
29692974 cqr->status = DASD_CQR_FILLED;
29702975 return cqr;
2976+out_error:
2977+ dasd_sfree_request(cqr, startdev);
2978+ return ERR_PTR(ret);
29712979 }
29722980
29732981 static struct dasd_ccw_req *dasd_eckd_build_cp(struct dasd_device *startdev,
drivers/s390/char/vmur.c+1−1
@@ -903,7 +903,7 @@ static int ur_set_online(struct ccw_device *cdev) · 902 unmodified lines
903903 goto fail_urdev_put;
904904 }
905905
906− cdev_init(urd->char_device, &ur_fops);
906+ urd->char_device->ops = &ur_fops;
907907 urd->char_device->dev = MKDEV(major, minor);
908908 urd->char_device->owner = ur_fops.owner;
909909
drivers/scsi/scsi_error.c+1−1
@@ -835,7 +835,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd, · 834 unmodified lines
835835
836836 scsi_eh_restore_cmnd(scmd, &ses);
837837
838− if (sdrv->eh_action)
838+ if (sdrv && sdrv->eh_action)
839839 rtn = sdrv->eh_action(scmd, cmnd, cmnd_size, rtn);
840840
841841 return rtn;
drivers/spi/Kconfig+1−1
@@ -74,7 +74,7 @@ config SPI_ATMEL · 73 unmodified lines
7474 This selects a driver for the Atmel SPI Controller, present on
7575 many AT32 (AVR32) and AT91 (ARM) chips.
7676
77−config SPI_BFIN
77+config SPI_BFIN5XX
7878 tristate "SPI controller driver for ADI Blackfin5xx"
7979 depends on BLACKFIN
8080 help
drivers/spi/Makefile+1−1
@@ -15,7 +15,7 @@ obj-$(CONFIG_SPI_ATMEL) += spi-atmel.o · 14 unmodified lines
1515 obj-$(CONFIG_SPI_ATH79) += spi-ath79.o
1616 obj-$(CONFIG_SPI_AU1550) += spi-au1550.o
1717 obj-$(CONFIG_SPI_BCM63XX) += spi-bcm63xx.o
18−obj-$(CONFIG_SPI_BFIN) += spi-bfin5xx.o
18+obj-$(CONFIG_SPI_BFIN5XX) += spi-bfin5xx.o
1919 obj-$(CONFIG_SPI_BFIN_SPORT) += spi-bfin-sport.o
2020 obj-$(CONFIG_SPI_BITBANG) += spi-bitbang.o
2121 obj-$(CONFIG_SPI_BUTTERFLY) += spi-butterfly.o
drivers/spi/spi-bcm63xx.c+92−71
@@ -1,7 +1,7 @@
11 /*
22 * Broadcom BCM63xx SPI controller support
33 *
4− * Copyright (C) 2009-2011 Florian Fainelli <florian@openwrt.org>
4+ * Copyright (C) 2009-2012 Florian Fainelli <florian@openwrt.org>
55 * Copyright (C) 2010 Tanguy Bouzeloc <tanguy.bouzeloc@efixo.com>
66 *
77 * This program is free software; you can redistribute it and/or
@@ -30,6 +30,8 @@ · 22 unmodified lines
3030 #include <linux/spi/spi.h>
3131 #include <linux/completion.h>
3232 #include <linux/err.h>
33+#include <linux/workqueue.h>
34+#include <linux/pm_runtime.h>
3335
3436 #include <bcm63xx_dev_spi.h>
3537
@@ -37,8 +39,6 @@ · 1 unmodified line
3739 #define DRV_VER "0.1.2"
3840
3941 struct bcm63xx_spi {
40− spinlock_t lock;
41− int stopping;
4242 struct completion done;
4343
4444 void __iomem *regs;
@@ -96,17 +96,12 @@ static const unsigned bcm63xx_spi_freq_table[SPI_CLK_MASK][2] = { · 51 unmodified lines
9696 { 391000, SPI_CLK_0_391MHZ }
9797 };
9898
99−static int bcm63xx_spi_setup_transfer(struct spi_device *spi,
100− struct spi_transfer *t)
99+static int bcm63xx_spi_check_transfer(struct spi_device *spi,
100+ struct spi_transfer *t)
101101 {
102− struct bcm63xx_spi *bs = spi_master_get_devdata(spi->master);
103102 u8 bits_per_word;
104− u8 clk_cfg, reg;
105− u32 hz;
106− int i;
107103
108104 bits_per_word = (t) ? t->bits_per_word : spi->bits_per_word;
109− hz = (t) ? t->speed_hz : spi->max_speed_hz;
110105 if (bits_per_word != 8) {
111106 dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n",
112107 __func__, bits_per_word);
@@ -119,6 +114,19 @@ static int bcm63xx_spi_setup_transfer(struct spi_device *spi, · 6 unmodified lines
119114 return -EINVAL;
120115 }
121116
117+ return 0;
118+}
119+
120+static void bcm63xx_spi_setup_transfer(struct spi_device *spi,
121+ struct spi_transfer *t)
122+{
123+ struct bcm63xx_spi *bs = spi_master_get_devdata(spi->master);
124+ u32 hz;
125+ u8 clk_cfg, reg;
126+ int i;
127+
128+ hz = (t) ? t->speed_hz : spi->max_speed_hz;
129+
122130 /* Find the closest clock configuration */
123131 for (i = 0; i < SPI_CLK_MASK; i++) {
124132 if (hz <= bcm63xx_spi_freq_table[i][0]) {
@@ -139,8 +147,6 @@ static int bcm63xx_spi_setup_transfer(struct spi_device *spi, · 14 unmodified lines
139147 bcm_spi_writeb(bs, reg, SPI_CLK_CFG);
140148 dev_dbg(&spi->dev, "Setting clock register to %02x (hz %d)\n",
141149 clk_cfg, hz);
142−
143− return 0;
144150 }
145151
146152 /* the spi->mode bits understood by this driver: */
@@ -153,9 +159,6 @@ static int bcm63xx_spi_setup(struct spi_device *spi) · 6 unmodified lines
153159
154160 bs = spi_master_get_devdata(spi->master);
155161
156− if (bs->stopping)
157− return -ESHUTDOWN;
158−
159162 if (!spi->bits_per_word)
160163 spi->bits_per_word = 8;
161164
@@ -165,7 +168,7 @@ static int bcm63xx_spi_setup(struct spi_device *spi) · 3 unmodified lines
165168 return -EINVAL;
166169 }
167170
168− ret = bcm63xx_spi_setup_transfer(spi, NULL);
171+ ret = bcm63xx_spi_check_transfer(spi, NULL);
169172 if (ret < 0) {
170173 dev_err(&spi->dev, "setup: unsupported mode bits %x\n",
171174 spi->mode & ~MODEBITS);
@@ -190,28 +193,29 @@ static void bcm63xx_spi_fill_tx_fifo(struct bcm63xx_spi *bs) · 18 unmodified lines
190193 bs->remaining_bytes -= size;
191194 }
192195
193−static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
196+static unsigned int bcm63xx_txrx_bufs(struct spi_device *spi,
197+ struct spi_transfer *t)
194198 {
195199 struct bcm63xx_spi *bs = spi_master_get_devdata(spi->master);
196200 u16 msg_ctl;
197201 u16 cmd;
198202
203+ /* Disable the CMD_DONE interrupt */
204+ bcm_spi_writeb(bs, 0, SPI_INT_MASK);
205+
199206 dev_dbg(&spi->dev, "txrx: tx %p, rx %p, len %d\n",
200207 t->tx_buf, t->rx_buf, t->len);
201208
202209 /* Transmitter is inhibited */
203210 bs->tx_ptr = t->tx_buf;
204211 bs->rx_ptr = t->rx_buf;
205− init_completion(&bs->done);
206212
207213 if (t->tx_buf) {
208214 bs->remaining_bytes = t->len;
209215 bcm63xx_spi_fill_tx_fifo(bs);
210216 }
211217
212− /* Enable the command done interrupt which
213− * we use to determine completion of a command */
214− bcm_spi_writeb(bs, SPI_INTR_CMD_DONE, SPI_INT_MASK);
218+ init_completion(&bs->done);
215219
216220 /* Fill in the Message control register */
217221 msg_ctl = (t->len << SPI_BYTE_CNT_SHIFT);
@@ -230,33 +234,76 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *t) · 12 unmodified lines
230234 cmd |= (0 << SPI_CMD_PREPEND_BYTE_CNT_SHIFT);
231235 cmd |= (spi->chip_select << SPI_CMD_DEVICE_ID_SHIFT);
232236 bcm_spi_writew(bs, cmd, SPI_CMD);
233− wait_for_completion(&bs->done);
234237
235− /* Disable the CMD_DONE interrupt */
236− bcm_spi_writeb(bs, 0, SPI_INT_MASK);
238+ /* Enable the CMD_DONE interrupt */
239+ bcm_spi_writeb(bs, SPI_INTR_CMD_DONE, SPI_INT_MASK);
237240
238241 return t->len - bs->remaining_bytes;
239242 }
240243
241−static int bcm63xx_transfer(struct spi_device *spi, struct spi_message *m)
244+static int bcm63xx_spi_prepare_transfer(struct spi_master *master)
242245 {
243− struct bcm63xx_spi *bs = spi_master_get_devdata(spi->master);
244− struct spi_transfer *t;
245− int ret = 0;
246+ struct bcm63xx_spi *bs = spi_master_get_devdata(master);
246247
247− if (unlikely(list_empty(&m->transfers)))
248− return -EINVAL;
248+ pm_runtime_get_sync(&bs->pdev->dev);
249249
250− if (bs->stopping)
251− return -ESHUTDOWN;
250+ return 0;
251+}
252+
253+static int bcm63xx_spi_unprepare_transfer(struct spi_master *master)
254+{
255+ struct bcm63xx_spi *bs = spi_master_get_devdata(master);
256+
257+ pm_runtime_put(&bs->pdev->dev);
258+
259+ return 0;
260+}
261+
262+static int bcm63xx_spi_transfer_one(struct spi_master *master,
263+ struct spi_message *m)
264+{
265+ struct bcm63xx_spi *bs = spi_master_get_devdata(master);
266+ struct spi_transfer *t;
267+ struct spi_device *spi = m->spi;
268+ int status = 0;
269+ unsigned int timeout = 0;
252270
253271 list_for_each_entry(t, &m->transfers, transfer_list) {
254− ret += bcm63xx_txrx_bufs(spi, t);
255− }
272+ unsigned int len = t->len;
273+ u8 rx_tail;
256274
257− m->complete(m->context);
275+ status = bcm63xx_spi_check_transfer(spi, t);
276+ if (status < 0)
277+ goto exit;
258278
259− return ret;
279+ /* configure adapter for a new transfer */
280+ bcm63xx_spi_setup_transfer(spi, t);
281+
282+ while (len) {
283+ /* send the data */
284+ len -= bcm63xx_txrx_bufs(spi, t);
285+
286+ timeout = wait_for_completion_timeout(&bs->done, HZ);
287+ if (!timeout) {
288+ status = -ETIMEDOUT;
289+ goto exit;
290+ }
291+
292+ /* read out all data */
293+ rx_tail = bcm_spi_readb(bs, SPI_RX_TAIL);
294+
295+ /* Read out all the data */
296+ if (rx_tail)
297+ memcpy_fromio(bs->rx_ptr, bs->rx_io, rx_tail);
298+ }
299+
300+ m->actual_length += t->len;
301+ }
302+exit:
303+ m->status = status;
304+ spi_finalize_current_message(master);
305+
306+ return 0;
260307 }
261308
262309 /* This driver supports single master mode only. Hence
@@ -267,39 +314,15 @@ static irqreturn_t bcm63xx_spi_interrupt(int irq, void *dev_id) · 4 unmodified lines
267314 struct spi_master *master = (struct spi_master *)dev_id;
268315 struct bcm63xx_spi *bs = spi_master_get_devdata(master);
269316 u8 intr;
270− u16 cmd;
271317
272318 /* Read interupts and clear them immediately */
273319 intr = bcm_spi_readb(bs, SPI_INT_STATUS);
274320 bcm_spi_writeb(bs, SPI_INTR_CLEAR_ALL, SPI_INT_STATUS);
275321 bcm_spi_writeb(bs, 0, SPI_INT_MASK);
276322
277− /* A tansfer completed */
278− if (intr & SPI_INTR_CMD_DONE) {
279− u8 rx_tail;
280−
281− rx_tail = bcm_spi_readb(bs, SPI_RX_TAIL);
282−
283− /* Read out all the data */
284− if (rx_tail)
285− memcpy_fromio(bs->rx_ptr, bs->rx_io, rx_tail);
286−
287− /* See if there is more data to send */
288− if (bs->remaining_bytes > 0) {
289− bcm63xx_spi_fill_tx_fifo(bs);
290−
291− /* Start the transfer */
292− bcm_spi_writew(bs, SPI_HD_W << SPI_MSG_TYPE_SHIFT,
293− SPI_MSG_CTL);
294− cmd = bcm_spi_readw(bs, SPI_CMD);
295− cmd |= SPI_CMD_START_IMMEDIATE;
296− cmd |= (0 << SPI_CMD_PREPEND_BYTE_CNT_SHIFT);
297− bcm_spi_writeb(bs, SPI_INTR_CMD_DONE, SPI_INT_MASK);
298− bcm_spi_writew(bs, cmd, SPI_CMD);
299− } else {
300− complete(&bs->done);
301− }
302− }
323+ /* A transfer completed */
324+ if (intr & SPI_INTR_CMD_DONE)
325+ complete(&bs->done);
303326
304327 return IRQ_HANDLED;
305328 }
@@ -345,7 +368,6 @@ static int __devinit bcm63xx_spi_probe(struct platform_device *pdev) · 39 unmodified lines
345368 }
346369
347370 bs = spi_master_get_devdata(master);
348− init_completion(&bs->done);
349371
350372 platform_set_drvdata(pdev, master);
351373 bs->pdev = pdev;
@@ -379,12 +401,13 @@ static int __devinit bcm63xx_spi_probe(struct platform_device *pdev) · 27 unmodified lines
379401 master->bus_num = pdata->bus_num;
380402 master->num_chipselect = pdata->num_chipselect;
381403 master->setup = bcm63xx_spi_setup;
382− master->transfer = bcm63xx_transfer;
404+ master->prepare_transfer_hardware = bcm63xx_spi_prepare_transfer;
405+ master->unprepare_transfer_hardware = bcm63xx_spi_unprepare_transfer;
406+ master->transfer_one_message = bcm63xx_spi_transfer_one;
407+ master->mode_bits = MODEBITS;
383408 bs->speed_hz = pdata->speed_hz;
384− bs->stopping = 0;
385409 bs->tx_io = (u8 *)(bs->regs + bcm63xx_spireg(SPI_MSG_DATA));
386410 bs->rx_io = (const u8 *)(bs->regs + bcm63xx_spireg(SPI_RX_DATA));
387− spin_lock_init(&bs->lock);
388411
389412 /* Initialize hardware */
390413 clk_enable(bs->clk);
@@ -418,18 +441,16 @@ static int __devexit bcm63xx_spi_remove(struct platform_device *pdev) · 27 unmodified lines
418441 struct spi_master *master = platform_get_drvdata(pdev);
419442 struct bcm63xx_spi *bs = spi_master_get_devdata(master);
420443
444+ spi_unregister_master(master);
445+
421446 /* reset spi block */
422447 bcm_spi_writeb(bs, 0, SPI_INT_MASK);
423− spin_lock(&bs->lock);
424− bs->stopping = 1;
425448
426449 /* HW shutdown */
427450 clk_disable(bs->clk);
428451 clk_put(bs->clk);
429452
430− spin_unlock(&bs->lock);
431453 platform_set_drvdata(pdev, 0);
432− spi_unregister_master(master);
433454
434455 return 0;
435456 }
drivers/spi/spi-bfin-sport.c+11−10
@@ -252,19 +252,15 @@ static void · 251 unmodified lines
252252 bfin_sport_spi_restore_state(struct bfin_sport_spi_master_data *drv_data)
253253 {
254254 struct bfin_sport_spi_slave_data *chip = drv_data->cur_chip;
255− unsigned int bits = (drv_data->ops == &bfin_sport_transfer_ops_u8 ? 7 : 15);
256255
257256 bfin_sport_spi_disable(drv_data);
258257 dev_dbg(drv_data->dev, "restoring spi ctl state\n");
259258
260259 bfin_write(&drv_data->regs->tcr1, chip->ctl_reg);
261− bfin_write(&drv_data->regs->tcr2, bits);
262260 bfin_write(&drv_data->regs->tclkdiv, chip->baud);
263− bfin_write(&drv_data->regs->tfsdiv, bits);
264261 SSYNC();
265262
266263 bfin_write(&drv_data->regs->rcr1, chip->ctl_reg & ~(ITCLK | ITFS));
267− bfin_write(&drv_data->regs->rcr2, bits);
268264 SSYNC();
269265
270266 bfin_sport_spi_cs_active(chip);
@@ -420,11 +416,15 @@ bfin_sport_spi_pump_transfers(unsigned long data) · 149 unmodified lines
420416 drv_data->cs_change = transfer->cs_change;
421417
422418 /* Bits per word setup */
423− bits_per_word = transfer->bits_per_word ? : message->spi->bits_per_word;
424− if (bits_per_word == 8)
425− drv_data->ops = &bfin_sport_transfer_ops_u8;
426− else
419+ bits_per_word = transfer->bits_per_word ? :
420+ message->spi->bits_per_word ? : 8;
421+ if (bits_per_word % 16 == 0)
427422 drv_data->ops = &bfin_sport_transfer_ops_u16;
423+ else
424+ drv_data->ops = &bfin_sport_transfer_ops_u8;
425+ bfin_write(&drv_data->regs->tcr2, bits_per_word - 1);
426+ bfin_write(&drv_data->regs->tfsdiv, bits_per_word - 1);
427+ bfin_write(&drv_data->regs->rcr2, bits_per_word - 1);
428428
429429 drv_data->state = RUNNING_STATE;
430430
@@ -598,11 +598,12 @@ bfin_sport_spi_setup(struct spi_device *spi) · 167 unmodified lines
598598 }
599599 chip->cs_chg_udelay = chip_info->cs_chg_udelay;
600600 chip->idle_tx_val = chip_info->idle_tx_val;
601− spi->bits_per_word = chip_info->bits_per_word;
602601 }
603602 }
604603
605− if (spi->bits_per_word != 8 && spi->bits_per_word != 16) {
604+ if (spi->bits_per_word % 8) {
605+ dev_err(&spi->dev, "%d bits_per_word is not supported\n",
606+ spi->bits_per_word);
606607 ret = -EINVAL;
607608 goto error;
608609 }
drivers/spi/spi-bfin5xx.c+8−6
@@ -396,7 +396,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id) · 395 unmodified lines
396396 /* last read */
397397 if (drv_data->rx) {
398398 dev_dbg(&drv_data->pdev->dev, "last read\n");
399− if (n_bytes % 2) {
399+ if (!(n_bytes % 2)) {
400400 u16 *buf = (u16 *)drv_data->rx;
401401 for (loop = 0; loop < n_bytes / 2; loop++)
402402 *buf++ = bfin_read(&drv_data->regs->rdbr);
@@ -424,7 +424,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id) · 21 unmodified lines
424424 if (drv_data->rx && drv_data->tx) {
425425 /* duplex */
426426 dev_dbg(&drv_data->pdev->dev, "duplex: write_TDBR\n");
427− if (n_bytes % 2) {
427+ if (!(n_bytes % 2)) {
428428 u16 *buf = (u16 *)drv_data->rx;
429429 u16 *buf2 = (u16 *)drv_data->tx;
430430 for (loop = 0; loop < n_bytes / 2; loop++) {
@@ -442,7 +442,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id) · 11 unmodified lines
442442 } else if (drv_data->rx) {
443443 /* read */
444444 dev_dbg(&drv_data->pdev->dev, "read: write_TDBR\n");
445− if (n_bytes % 2) {
445+ if (!(n_bytes % 2)) {
446446 u16 *buf = (u16 *)drv_data->rx;
447447 for (loop = 0; loop < n_bytes / 2; loop++) {
448448 *buf++ = bfin_read(&drv_data->regs->rdbr);
@@ -458,7 +458,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id) · 9 unmodified lines
458458 } else if (drv_data->tx) {
459459 /* write */
460460 dev_dbg(&drv_data->pdev->dev, "write: write_TDBR\n");
461− if (n_bytes % 2) {
461+ if (!(n_bytes % 2)) {
462462 u16 *buf = (u16 *)drv_data->tx;
463463 for (loop = 0; loop < n_bytes / 2; loop++) {
464464 bfin_read(&drv_data->regs->rdbr);
@@ -587,6 +587,7 @@ static void bfin_spi_pump_transfers(unsigned long data) · 122 unmodified lines
587587 if (message->state == DONE_STATE) {
588588 dev_dbg(&drv_data->pdev->dev, "transfer: all done!\n");
589589 message->status = 0;
590+ bfin_spi_flush(drv_data);
590591 bfin_spi_giveback(drv_data);
591592 return;
592593 }
@@ -870,8 +871,10 @@ static void bfin_spi_pump_transfers(unsigned long data) · 277 unmodified lines
870871 message->actual_length += drv_data->len_in_bytes;
871872 /* Move to next transfer of this msg */
872873 message->state = bfin_spi_next_transfer(drv_data);
873− if (drv_data->cs_change)
874+ if (drv_data->cs_change && message->state != DONE_STATE) {
875+ bfin_spi_flush(drv_data);
874876 bfin_spi_cs_deactive(drv_data, chip);
877+ }
875878 }
876879
877880 /* Schedule next transfer tasklet */
@@ -1026,7 +1029,6 @@ static int bfin_spi_setup(struct spi_device *spi) · 148 unmodified lines
10261029 chip->cs_chg_udelay = chip_info->cs_chg_udelay;
10271030 chip->idle_tx_val = chip_info->idle_tx_val;
10281031 chip->pio_interrupt = chip_info->pio_interrupt;
1029− spi->bits_per_word = chip_info->bits_per_word;
10301032 } else {
10311033 /* force a default base state */
10321034 chip->ctl_reg &= bfin_ctl_reg;
drivers/spi/spi-davinci.c+3−3
@@ -653,7 +653,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t) · 652 unmodified lines
653653 dev_dbg(sdev, "Couldn't DMA map a %d bytes RX buffer\n",
654654 rx_buf_count);
655655 if (t->tx_buf)
656− dma_unmap_single(NULL, t->tx_dma, t->len,
656+ dma_unmap_single(&spi->dev, t->tx_dma, t->len,
657657 DMA_TO_DEVICE);
658658 return -ENOMEM;
659659 }
@@ -692,10 +692,10 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t) · 32 unmodified lines
692692 if (spicfg->io_type == SPI_IO_TYPE_DMA) {
693693
694694 if (t->tx_buf)
695− dma_unmap_single(NULL, t->tx_dma, t->len,
695+ dma_unmap_single(&spi->dev, t->tx_dma, t->len,
696696 DMA_TO_DEVICE);
697697
698− dma_unmap_single(NULL, t->rx_dma, rx_buf_count,
698+ dma_unmap_single(&spi->dev, t->rx_dma, rx_buf_count,
699699 DMA_FROM_DEVICE);
700700
701701 clear_io_bits(dspi->base + SPIINT, SPIINT_DMA_REQ_EN);
drivers/spi/spi-ep93xx.c+10−14
@@ -545,13 +545,12 @@ static void ep93xx_spi_pio_transfer(struct ep93xx_spi *espi) · 544 unmodified lines
545545 * in case of failure.
546546 */
547547 static struct dma_async_tx_descriptor *
548−ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
548+ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_transfer_direction dir)
549549 {
550550 struct spi_transfer *t = espi->current_msg->state;
551551 struct dma_async_tx_descriptor *txd;
552552 enum dma_slave_buswidth buswidth;
553553 struct dma_slave_config conf;
554− enum dma_transfer_direction slave_dirn;
555554 struct scatterlist *sg;
556555 struct sg_table *sgt;
557556 struct dma_chan *chan;
@@ -567,14 +566,13 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir) · 9 unmodified lines
567566 memset(&conf, 0, sizeof(conf));
568567 conf.direction = dir;
569568
570− if (dir == DMA_FROM_DEVICE) {
569+ if (dir == DMA_DEV_TO_MEM) {
571570 chan = espi->dma_rx;
572571 buf = t->rx_buf;
573572 sgt = &espi->rx_sgt;
574573
575574 conf.src_addr = espi->sspdr_phys;
576575 conf.src_addr_width = buswidth;
577− slave_dirn = DMA_DEV_TO_MEM;
578576 } else {
579577 chan = espi->dma_tx;
580578 buf = t->tx_buf;
@@ -582,7 +580,6 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir) · 1 unmodified line
582580
583581 conf.dst_addr = espi->sspdr_phys;
584582 conf.dst_addr_width = buswidth;
585− slave_dirn = DMA_MEM_TO_DEV;
586583 }
587584
588585 ret = dmaengine_slave_config(chan, &conf);
@@ -633,8 +630,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir) · 44 unmodified lines
633630 if (!nents)
634631 return ERR_PTR(-ENOMEM);
635632
636− txd = dmaengine_prep_slave_sg(chan, sgt->sgl, nents,
637− slave_dirn, DMA_CTRL_ACK);
633+ txd = dmaengine_prep_slave_sg(chan, sgt->sgl, nents, dir, DMA_CTRL_ACK);
638634 if (!txd) {
639635 dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir);
640636 return ERR_PTR(-ENOMEM);
@@ -651,12 +647,12 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir) · 10 unmodified lines
651647 * unmapped.
652648 */
653649 static void ep93xx_spi_dma_finish(struct ep93xx_spi *espi,
654− enum dma_data_direction dir)
650+ enum dma_transfer_direction dir)
655651 {
656652 struct dma_chan *chan;
657653 struct sg_table *sgt;
658654
659− if (dir == DMA_FROM_DEVICE) {
655+ if (dir == DMA_DEV_TO_MEM) {
660656 chan = espi->dma_rx;
661657 sgt = &espi->rx_sgt;
662658 } else {
@@ -677,16 +673,16 @@ static void ep93xx_spi_dma_transfer(struct ep93xx_spi *espi) · 14 unmodified lines
677673 struct spi_message *msg = espi->current_msg;
678674 struct dma_async_tx_descriptor *rxd, *txd;
679675
680− rxd = ep93xx_spi_dma_prepare(espi, DMA_FROM_DEVICE);
676+ rxd = ep93xx_spi_dma_prepare(espi, DMA_DEV_TO_MEM);
681677 if (IS_ERR(rxd)) {
682678 dev_err(&espi->pdev->dev, "DMA RX failed: %ld\n", PTR_ERR(rxd));
683679 msg->status = PTR_ERR(rxd);
684680 return;
685681 }
686682
687− txd = ep93xx_spi_dma_prepare(espi, DMA_TO_DEVICE);
683+ txd = ep93xx_spi_dma_prepare(espi, DMA_MEM_TO_DEV);
688684 if (IS_ERR(txd)) {
689− ep93xx_spi_dma_finish(espi, DMA_FROM_DEVICE);
685+ ep93xx_spi_dma_finish(espi, DMA_DEV_TO_MEM);
690686 dev_err(&espi->pdev->dev, "DMA TX failed: %ld\n", PTR_ERR(rxd));
691687 msg->status = PTR_ERR(txd);
692688 return;
@@ -705,8 +701,8 @@ static void ep93xx_spi_dma_transfer(struct ep93xx_spi *espi) · 12 unmodified lines
705701
706702 wait_for_completion(&espi->wait);
707703
708− ep93xx_spi_dma_finish(espi, DMA_TO_DEVICE);
709− ep93xx_spi_dma_finish(espi, DMA_FROM_DEVICE);
704+ ep93xx_spi_dma_finish(espi, DMA_MEM_TO_DEV);
705+ ep93xx_spi_dma_finish(espi, DMA_DEV_TO_MEM);
710706 }
711707
712708 /**
drivers/spi/spi-fsl-spi.c+3−1
@@ -139,10 +139,12 @@ static void fsl_spi_change_mode(struct spi_device *spi) · 138 unmodified lines
139139 static void fsl_spi_chipselect(struct spi_device *spi, int value)
140140 {
141141 struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
142− struct fsl_spi_platform_data *pdata = spi->dev.parent->platform_data;
142+ struct fsl_spi_platform_data *pdata;
143143 bool pol = spi->mode & SPI_CS_HIGH;
144144 struct spi_mpc8xxx_cs *cs = spi->controller_state;
145145
146+ pdata = spi->dev.parent->parent->platform_data;
147+
146148 if (value == BITBANG_CS_INACTIVE) {
147149 if (pdata->cs_control)
148150 pdata->cs_control(spi, !pol);
drivers/spi/spi-imx.c+8−4
@@ -83,7 +83,7 @@ struct spi_imx_data { · 82 unmodified lines
8383 struct spi_bitbang bitbang;
8484
8585 struct completion xfer_done;
86− void *base;
86+ void __iomem *base;
8787 int irq;
8888 struct clk *clk;
8989 unsigned long spi_clk;
@@ -766,8 +766,12 @@ static int __devinit spi_imx_probe(struct platform_device *pdev) · 676 unmodified lines
766766 }
767767
768768 ret = of_property_read_u32(np, "fsl,spi-num-chipselects", &num_cs);
769− if (ret < 0)
770− num_cs = mxc_platform_info->num_chipselect;
769+ if (ret < 0) {
770+ if (mxc_platform_info)
771+ num_cs = mxc_platform_info->num_chipselect;
772+ else
773+ return ret;
774+ }
771775
772776 master = spi_alloc_master(&pdev->dev,
773777 sizeof(struct spi_imx_data) + sizeof(int) * num_cs);
@@ -784,7 +788,7 @@ static int __devinit spi_imx_probe(struct platform_device *pdev) · 10 unmodified lines
784788
785789 for (i = 0; i < master->num_chipselect; i++) {
786790 int cs_gpio = of_get_named_gpio(np, "cs-gpios", i);
787− if (cs_gpio < 0)
791+ if (cs_gpio < 0 && mxc_platform_info)
788792 cs_gpio = mxc_platform_info->chipselect[i];
789793
790794 spi_imx->chipselect[i] = cs_gpio;
drivers/spi/spi-pl022.c+34−26
@@ -1667,9 +1667,15 @@ static int calculate_effective_freq(struct pl022 *pl022, int freq, struct · 1666 unmodified lines
16671667 /* cpsdvsr = 254 & scr = 255 */
16681668 min_tclk = spi_rate(rate, CPSDVR_MAX, SCR_MAX);
16691669
1670− if (!((freq <= max_tclk) && (freq >= min_tclk))) {
1670+ if (freq > max_tclk)
1671+ dev_warn(&pl022->adev->dev,
1672+ "Max speed that can be programmed is %d Hz, you requested %d\n",
1673+ max_tclk, freq);
1674+
1675+ if (freq < min_tclk) {
16711676 dev_err(&pl022->adev->dev,
1672− "controller data is incorrect: out of range frequency");
1677+ "Requested frequency: %d Hz is less than minimum possible %d Hz\n",
1678+ freq, min_tclk);
16731679 return -EINVAL;
16741680 }
16751681
@@ -1681,26 +1687,37 @@ static int calculate_effective_freq(struct pl022 *pl022, int freq, struct · 5 unmodified lines
16811687 while (scr <= SCR_MAX) {
16821688 tmp = spi_rate(rate, cpsdvsr, scr);
16831689
1684− if (tmp > freq)
1690+ if (tmp > freq) {
1691+ /* we need lower freq */
16851692 scr++;
1693+ continue;
1694+ }
1695+
16861696 /*
1687− * If found exact value, update and break.
1688− * If found more closer value, update and continue.
1697+ * If found exact value, mark found and break.
1698+ * If found more closer value, update and break.
16891699 */
1690− else if ((tmp == freq) || (tmp > best_freq)) {
1700+ if (tmp > best_freq) {
16911701 best_freq = tmp;
16921702 best_cpsdvsr = cpsdvsr;
16931703 best_scr = scr;
16941704
16951705 if (tmp == freq)
1696− break;
1706+ found = 1;
16971707 }
1698− scr++;
1708+ /*
1709+ * increased scr will give lower rates, which are not
1710+ * required
1711+ */
1712+ break;
16991713 }
17001714 cpsdvsr += 2;
17011715 scr = SCR_MIN;
17021716 }
17031717
1718+ WARN(!best_freq, "pl022: Matching cpsdvsr and scr not found for %d Hz rate \n",
1719+ freq);
1720+
17041721 clk_freq->cpsdvsr = (u8) (best_cpsdvsr & 0xFF);
17051722 clk_freq->scr = (u8) (best_scr & 0xFF);
17061723 dev_dbg(&pl022->adev->dev,
@@ -1823,9 +1840,12 @@ static int pl022_setup(struct spi_device *spi) · 116 unmodified lines
18231840 } else
18241841 chip->cs_control = chip_info->cs_control;
18251842
1826− if (bits <= 3) {
1827− /* PL022 doesn't support less than 4-bits */
1843+ /* Check bits per word with vendor specific range */
1844+ if ((bits <= 3) || (bits > pl022->vendor->max_bpw)) {
18281845 status = -ENOTSUPP;
1846+ dev_err(&spi->dev, "illegal data size for this controller!\n");
1847+ dev_err(&spi->dev, "This controller can only handle 4 <= n <= %d bit words\n",
1848+ pl022->vendor->max_bpw);
18291849 goto err_config_params;
18301850 } else if (bits <= 8) {
18311851 dev_dbg(&spi->dev, "4 <= n <=8 bits per word\n");
@@ -1838,20 +1858,10 @@ static int pl022_setup(struct spi_device *spi) · 6 unmodified lines
18381858 chip->read = READING_U16;
18391859 chip->write = WRITING_U16;
18401860 } else {
1841− if (pl022->vendor->max_bpw >= 32) {
1842− dev_dbg(&spi->dev, "17 <= n <= 32 bits per word\n");
1843− chip->n_bytes = 4;
1844− chip->read = READING_U32;
1845− chip->write = WRITING_U32;
1846− } else {
1847− dev_err(&spi->dev,
1848− "illegal data size for this controller!\n");
1849− dev_err(&spi->dev,
1850− "a standard pl022 can only handle "
1851− "1 <= n <= 16 bit words\n");
1852− status = -ENOTSUPP;
1853− goto err_config_params;
1854− }
1861+ dev_dbg(&spi->dev, "17 <= n <= 32 bits per word\n");
1862+ chip->n_bytes = 4;
1863+ chip->read = READING_U32;
1864+ chip->write = WRITING_U32;
18551865 }
18561866
18571867 /* Now Initialize all register settings required for this chip */
@@ -2195,7 +2205,6 @@ static int pl022_runtime_suspend(struct device *dev) · 337 unmodified lines
21952205 struct pl022 *pl022 = dev_get_drvdata(dev);
21962206
21972207 clk_disable(pl022->clk);
2198− amba_vcore_disable(pl022->adev);
21992208
22002209 return 0;
22012210 }
@@ -2204,7 +2213,6 @@ static int pl022_runtime_resume(struct device *dev) · 2 unmodified lines
22042213 {
22052214 struct pl022 *pl022 = dev_get_drvdata(dev);
22062215
2207− amba_vcore_enable(pl022->adev);
22082216 clk_enable(pl022->clk);
22092217
22102218 return 0;
drivers/staging/android/Kconfig+2−1
@@ -27,13 +27,14 @@ config ANDROID_LOGGER · 26 unmodified lines
2727
2828 config ANDROID_PERSISTENT_RAM
2929 bool
30+ depends on HAVE_MEMBLOCK
3031 select REED_SOLOMON
3132 select REED_SOLOMON_ENC8
3233 select REED_SOLOMON_DEC8
3334
3435 config ANDROID_RAM_CONSOLE
3536 bool "Android RAM buffer console"
36− depends on !S390 && !UML
37+ depends on !S390 && !UML && HAVE_MEMBLOCK
3738 select ANDROID_PERSISTENT_RAM
3839 default n
3940
drivers/staging/android/lowmemorykiller.c+7−41
@@ -55,7 +55,6 @@ static int lowmem_minfree[6] = { · 54 unmodified lines
5555 };
5656 static int lowmem_minfree_size = 4;
5757
58−static struct task_struct *lowmem_deathpending;
5958 static unsigned long lowmem_deathpending_timeout;
6059
6160 #define lowmem_print(level, x...) \
@@ -64,24 +63,6 @@ static unsigned long lowmem_deathpending_timeout; · 2 unmodified lines
6463 printk(x); \
6564 } while (0)
6665
67−static int
68−task_notify_func(struct notifier_block *self, unsigned long val, void *data);
69−
70−static struct notifier_block task_nb = {
71− .notifier_call = task_notify_func,
72−};
73−
74−static int
75−task_notify_func(struct notifier_block *self, unsigned long val, void *data)
76−{
77− struct task_struct *task = data;
78−
79− if (task == lowmem_deathpending)
80− lowmem_deathpending = NULL;
81−
82− return NOTIFY_OK;
83−}
84−
8566 static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
8667 {
8768 struct task_struct *tsk;
@@ -97,19 +78,6 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) · 9 unmodified lines
9778 int other_file = global_page_state(NR_FILE_PAGES) -
9879 global_page_state(NR_SHMEM);
9980
100− /*
101− * If we already have a death outstanding, then
102− * bail out right away; indicating to vmscan
103− * that we have nothing further to offer on
104− * this pass.
105− *
106− * Note: Currently you need CONFIG_PROFILING
107− * for this to work correctly.
108− */
109− if (lowmem_deathpending &&
110− time_before_eq(jiffies, lowmem_deathpending_timeout))
111− return 0;
112−
11381 if (lowmem_adj_size < array_size)
11482 array_size = lowmem_adj_size;
11583 if (lowmem_minfree_size < array_size)
@@ -148,6 +116,12 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) · 32 unmodified lines
148116 if (!p)
149117 continue;
150118
119+ if (test_tsk_thread_flag(p, TIF_MEMDIE) &&
120+ time_before_eq(jiffies, lowmem_deathpending_timeout)) {
121+ task_unlock(p);
122+ rcu_read_unlock();
123+ return 0;
124+ }
151125 oom_score_adj = p->signal->oom_score_adj;
152126 if (oom_score_adj < min_score_adj) {
153127 task_unlock(p);
@@ -174,15 +148,9 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) · 20 unmodified lines
174148 lowmem_print(1, "send sigkill to %d (%s), adj %d, size %d\n",
175149 selected->pid, selected->comm,
176150 selected_oom_score_adj, selected_tasksize);
177− /*
178− * If CONFIG_PROFILING is off, then we don't want to stall
179− * the killer by setting lowmem_deathpending.
180− */
181−#ifdef CONFIG_PROFILING
182− lowmem_deathpending = selected;
183151 lowmem_deathpending_timeout = jiffies + HZ;
184−#endif
185152 send_sig(SIGKILL, selected, 0);
153+ set_tsk_thread_flag(selected, TIF_MEMDIE);
186154 rem -= selected_tasksize;
187155 }
188156 lowmem_print(4, "lowmem_shrink %lu, %x, return %d\n",
@@ -198,7 +166,6 @@ static struct shrinker lowmem_shrinker = { · 9 unmodified lines
198166
199167 static int __init lowmem_init(void)
200168 {
201− task_handoff_register(&task_nb);
202169 register_shrinker(&lowmem_shrinker);
203170 return 0;
204171 }
@@ -206,7 +173,6 @@ static int __init lowmem_init(void) · 1 unmodified line
206173 static void __exit lowmem_exit(void)
207174 {
208175 unregister_shrinker(&lowmem_shrinker);
209− task_handoff_unregister(&task_nb);
210176 }
211177
212178 module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR);
drivers/staging/android/persistent_ram.c+7−4
@@ -399,12 +399,12 @@ static __init · 398 unmodified lines
399399 struct persistent_ram_zone *__persistent_ram_init(struct device *dev, bool ecc)
400400 {
401401 struct persistent_ram_zone *prz;
402− int ret;
402+ int ret = -ENOMEM;
403403
404404 prz = kzalloc(sizeof(struct persistent_ram_zone), GFP_KERNEL);
405405 if (!prz) {
406406 pr_err("persistent_ram: failed to allocate persistent ram zone\n");
407− return ERR_PTR(-ENOMEM);
407+ goto err;
408408 }
409409
410410 INIT_LIST_HEAD(&prz->node);
@@ -412,13 +412,13 @@ struct persistent_ram_zone *__persistent_ram_init(struct device *dev, bool ecc) · 1 unmodified line
412412 ret = persistent_ram_buffer_init(dev_name(dev), prz);
413413 if (ret) {
414414 pr_err("persistent_ram: failed to initialize buffer\n");
415− return ERR_PTR(ret);
415+ goto err;
416416 }
417417
418418 prz->ecc = ecc;
419419 ret = persistent_ram_init_ecc(prz, prz->buffer_size);
420420 if (ret)
421− return ERR_PTR(ret);
421+ goto err;
422422
423423 if (prz->buffer->sig == PERSISTENT_RAM_SIG) {
424424 if (buffer_size(prz) > prz->buffer_size ||
@@ -442,6 +442,9 @@ struct persistent_ram_zone *__persistent_ram_init(struct device *dev, bool ecc) · 17 unmodified lines
442442 atomic_set(&prz->buffer->size, 0);
443443
444444 return prz;
445+err:
446+ kfree(prz);
447+ return ERR_PTR(ret);
445448 }
446449
447450 struct persistent_ram_zone * __init
drivers/staging/android/timed_gpio.c+15−12
@@ -85,7 +85,7 @@ static int timed_gpio_probe(struct platform_device *pdev) · 84 unmodified lines
8585 struct timed_gpio_platform_data *pdata = pdev->dev.platform_data;
8686 struct timed_gpio *cur_gpio;
8787 struct timed_gpio_data *gpio_data, *gpio_dat;
88− int i, j, ret = 0;
88+ int i, ret;
8989
9090 if (!pdata)
9191 return -EBUSY;
@@ -108,18 +108,12 @@ static int timed_gpio_probe(struct platform_device *pdev) · 16 unmodified lines
108108 gpio_dat->dev.get_time = gpio_get_time;
109109 gpio_dat->dev.enable = gpio_enable;
110110 ret = gpio_request(cur_gpio->gpio, cur_gpio->name);
111− if (ret >= 0) {
112− ret = timed_output_dev_register(&gpio_dat->dev);
113− if (ret < 0)
114− gpio_free(cur_gpio->gpio);
115− }
111+ if (ret < 0)
112+ goto err_out;
113+ ret = timed_output_dev_register(&gpio_dat->dev);
116114 if (ret < 0) {
117− for (j = 0; j < i; j++) {
118− timed_output_dev_unregister(&gpio_data[i].dev);
119− gpio_free(gpio_data[i].gpio);
120− }
121− kfree(gpio_data);
122− return ret;
115+ gpio_free(cur_gpio->gpio);
116+ goto err_out;
123117 }
124118
125119 gpio_dat->gpio = cur_gpio->gpio;
@@ -131,6 +125,15 @@ static int timed_gpio_probe(struct platform_device *pdev) · 5 unmodified lines
131125 platform_set_drvdata(pdev, gpio_data);
132126
133127 return 0;
128+
129+err_out:
130+ while (--i >= 0) {
131+ timed_output_dev_unregister(&gpio_data[i].dev);
132+ gpio_free(gpio_data[i].gpio);
133+ }
134+ kfree(gpio_data);
135+
136+ return ret;
134137 }
135138
136139 static int timed_gpio_remove(struct platform_device *pdev)
drivers/staging/iio/inkern.c+1−0
@@ -82,6 +82,7 @@ int iio_map_array_unregister(struct iio_dev *indio_dev, · 81 unmodified lines
8282 ret = -ENODEV;
8383 goto error_ret;
8484 }
85+ i++;
8586 }
8687 error_ret:
8788 mutex_unlock(&iio_map_list_lock);
drivers/staging/iio/magnetometer/ak8975.c+5−3
@@ -108,7 +108,8 @@ static const int ak8975_index_to_reg[] = { · 107 unmodified lines
108108 static int ak8975_write_data(struct i2c_client *client,
109109 u8 reg, u8 val, u8 mask, u8 shift)
110110 {
111− struct ak8975_data *data = i2c_get_clientdata(client);
111+ struct iio_dev *indio_dev = i2c_get_clientdata(client);
112+ struct ak8975_data *data = iio_priv(indio_dev);
112113 u8 regval;
113114 int ret;
114115
@@ -159,7 +160,8 @@ static int ak8975_read_data(struct i2c_client *client, · 44 unmodified lines
159160 */
160161 static int ak8975_setup(struct i2c_client *client)
161162 {
162− struct ak8975_data *data = i2c_get_clientdata(client);
163+ struct iio_dev *indio_dev = i2c_get_clientdata(client);
164+ struct ak8975_data *data = iio_priv(indio_dev);
163165 u8 device_id;
164166 int ret;
165167
@@ -509,6 +511,7 @@ static int ak8975_probe(struct i2c_client *client, · 343 unmodified lines
509511 goto exit_gpio;
510512 }
511513 data = iio_priv(indio_dev);
514+ i2c_set_clientdata(client, indio_dev);
512515 /* Perform some basic start-of-day setup of the device. */
513516 err = ak8975_setup(client);
514517 if (err < 0) {
@@ -516,7 +519,6 @@ static int ak8975_probe(struct i2c_client *client, · 1 unmodified line
516519 goto exit_free_iio;
517520 }
518521
519− i2c_set_clientdata(client, indio_dev);
520522 data->client = client;
521523 mutex_init(&data->lock);
522524 data->eoc_irq = client->irq;
drivers/staging/iio/magnetometer/hmc5843.c+3−1
@@ -521,7 +521,9 @@ static int hmc5843_detect(struct i2c_client *client, · 520 unmodified lines
521521 /* Called when we have found a new HMC5843. */
522522 static void hmc5843_init_client(struct i2c_client *client)
523523 {
524− struct hmc5843_data *data = i2c_get_clientdata(client);
524+ struct iio_dev *indio_dev = i2c_get_clientdata(client);
525+ struct hmc5843_data *data = iio_priv(indio_dev);
526+
525527 hmc5843_set_meas_conf(client, data->meas_conf);
526528 hmc5843_set_rate(client, data->rate);
527529 hmc5843_configure(client, data->operating_mode);
drivers/staging/media/as102/as102_fw.c+1−1
@@ -165,7 +165,7 @@ error: · 164 unmodified lines
165165 int as102_fw_upload(struct as10x_bus_adapter_t *bus_adap)
166166 {
167167 int errno = -EFAULT;
168− const struct firmware *firmware;
168+ const struct firmware *firmware = NULL;
169169 unsigned char *cmd_buf = NULL;
170170 char *fw1, *fw2;
171171 struct usb_device *dev = bus_adap->usb_dev;
drivers/staging/octeon/ethernet-rx.c+1−0
@@ -36,6 +36,7 @@ · 35 unmodified lines
3636 #include <linux/prefetch.h>
3737 #include <linux/ratelimit.h>
3838 #include <linux/smp.h>
39+#include <linux/interrupt.h>
3940 #include <net/dst.h>
4041 #ifdef CONFIG_XFRM
4142 #include <linux/xfrm.h>
drivers/staging/octeon/ethernet-tx.c+1−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include <linux/ip.h>
3333 #include <linux/ratelimit.h>
3434 #include <linux/string.h>
35+#include <linux/interrupt.h>
3536 #include <net/dst.h>
3637 #ifdef CONFIG_XFRM
3738 #include <linux/xfrm.h>
drivers/staging/octeon/ethernet.c+1−0
@@ -31,6 +31,7 @@ · 30 unmodified lines
3131 #include <linux/etherdevice.h>
3232 #include <linux/phy.h>
3333 #include <linux/slab.h>
34+#include <linux/interrupt.h>
3435
3536 #include <net/dst.h>
3637
drivers/staging/omapdrm/omap_drv.c+4−3
@@ -803,9 +803,6 @@ static void pdev_shutdown(struct platform_device *device) · 802 unmodified lines
803803 static int pdev_probe(struct platform_device *device)
804804 {
805805 DBG("%s", device->name);
806− if (platform_driver_register(&omap_dmm_driver))
807− dev_err(&device->dev, "DMM registration failed\n");
808−
809806 return drm_platform_init(&omap_drm_driver, device);
810807 }
811808
@@ -833,6 +830,10 @@ struct platform_driver pdev = { · 21 unmodified lines
833830 static int __init omap_drm_init(void)
834831 {
835832 DBG("init");
833+ if (platform_driver_register(&omap_dmm_driver)) {
834+ /* we can continue on without DMM.. so not fatal */
835+ dev_err(NULL, "DMM registration failed\n");
836+ }
836837 return platform_driver_register(&pdev);
837838 }
838839
drivers/staging/ozwpan/TODO+3−1
@@ -8,5 +8,7 @@ TODO: · 7 unmodified lines
88 - code review by USB developer community.
99 - testing with as many devices as possible.
1010
11−Please send any patches for this driver to Chris Kelly <ckelly@ozmodevices.com>
11+Please send any patches for this driver to
12+Rupesh Gujare <rgujare@ozmodevices.com>
13+Chris Kelly <ckelly@ozmodevices.com>
1214 and Greg Kroah-Hartman <gregkh@linuxfoundation.org>.
drivers/staging/ozwpan/ozpd.c+0−2
@@ -383,8 +383,6 @@ static void oz_tx_frame_free(struct oz_pd *pd, struct oz_tx_frame *f) · 382 unmodified lines
383383 pd->tx_pool = &f->link;
384384 pd->tx_pool_count++;
385385 f = 0;
386− } else {
387− kfree(f);
388386 }
389387 spin_unlock_bh(&pd->tx_frame_lock);
390388 if (f)
drivers/staging/ramster/Kconfig+1−5
@@ -1,10 +1,6 @@
1−# Dependency on CONFIG_BROKEN is because there is a commit dependency
2−# on a cleancache naming change to be submitted by Konrad Wilk
3−# a39c00ded70339603ffe1b0ffdf3ade85bcf009a "Merge branch 'stable/cleancache.v13'
4−# into linux-next. Once this commit is present, BROKEN can be removed
51 config RAMSTER
62 bool "Cross-machine RAM capacity sharing, aka peer-to-peer tmem"
7− depends on (CLEANCACHE || FRONTSWAP) && CONFIGFS_FS=y && !ZCACHE && !XVMALLOC && !HIGHMEM && BROKEN
3+ depends on (CLEANCACHE || FRONTSWAP) && CONFIGFS_FS=y && !ZCACHE && !XVMALLOC && !HIGHMEM
84 select LZO_COMPRESS
95 select LZO_DECOMPRESS
106 default n
drivers/staging/rts_pstor/ms.c+2−1
@@ -3498,7 +3498,8 @@ static int ms_rw_multi_sector(struct scsi_cmnd *srb, struct rtsx_chip *chip, u32 · 3497 unmodified lines
34983498
34993499 log_blk++;
35003500
3501− for (seg_no = 0; seg_no < sizeof(ms_start_idx)/2; seg_no++) {
3501+ for (seg_no = 0; seg_no < ARRAY_SIZE(ms_start_idx) - 1;
3502+ seg_no++) {
35023503 if (log_blk < ms_start_idx[seg_no+1])
35033504 break;
35043505 }
drivers/staging/rts_pstor/rtsx.c+5−0
@@ -1000,6 +1000,11 @@ static int __devinit rtsx_probe(struct pci_dev *pci, · 999 unmodified lines
10001000
10011001 rtsx_init_chip(dev->chip);
10021002
1003+ /* set the supported max_lun and max_id for the scsi host
1004+ * NOTE: the minimal value of max_id is 1 */
1005+ host->max_id = 1;
1006+ host->max_lun = dev->chip->max_lun;
1007+
10031008 /* Start up our control thread */
10041009 th = kthread_run(rtsx_control_thread, dev, CR_DRIVER_NAME);
10051010 if (IS_ERR(th)) {
drivers/staging/rts_pstor/rtsx_transport.c+6−5
@@ -335,6 +335,7 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card, · 334 unmodified lines
335335 int sg_cnt, i, resid;
336336 int err = 0;
337337 long timeleft;
338+ struct scatterlist *sg_ptr;
338339 u32 val = TRIG_DMA;
339340
340341 if ((sg == NULL) || (num_sg <= 0) || !offset || !index)
@@ -371,7 +372,7 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card, · 30 unmodified lines
371372 sg_cnt = dma_map_sg(&(rtsx->pci->dev), sg, num_sg, dma_dir);
372373
373374 resid = size;
374−
375+ sg_ptr = sg;
375376 chip->sgi = 0;
376377 /* Usually the next entry will be @sg@ + 1, but if this sg element
377378 * is part of a chained scatterlist, it could jump to the start of
@@ -379,14 +380,14 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card, · 1 unmodified line
379380 * the proper sg
380381 */
381382 for (i = 0; i < *index; i++)
382− sg = sg_next(sg);
383+ sg_ptr = sg_next(sg_ptr);
383384 for (i = *index; i < sg_cnt; i++) {
384385 dma_addr_t addr;
385386 unsigned int len;
386387 u8 option;
387388
388− addr = sg_dma_address(sg);
389− len = sg_dma_len(sg);
389+ addr = sg_dma_address(sg_ptr);
390+ len = sg_dma_len(sg_ptr);
390391
391392 RTSX_DEBUGP("DMA addr: 0x%x, Len: 0x%x\n",
392393 (unsigned int)addr, len);
@@ -415,7 +416,7 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card, · 22 unmodified lines
415416 if (!resid)
416417 break;
417418
418− sg = sg_next(sg);
419+ sg_ptr = sg_next(sg_ptr);
419420 }
420421
421422 RTSX_DEBUGP("SG table count = %d\n", chip->sgi);
drivers/staging/sep/sep_main.c+3−3
@@ -3114,7 +3114,7 @@ static long sep_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) · 3113 unmodified lines
31143114 current->pid);
31153115 if (1 == test_bit(SEP_LEGACY_SENDMSG_DONE_OFFSET,
31163116 &call_status->status)) {
3117− dev_warn(&sep->pdev->dev,
3117+ dev_dbg(&sep->pdev->dev,
31183118 "[PID%d] dcb prep needed before send msg\n",
31193119 current->pid);
31203120 error = -EPROTO;
@@ -3122,9 +3122,9 @@ static long sep_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) · 1 unmodified line
31223122 }
31233123
31243124 if (!arg) {
3125− dev_warn(&sep->pdev->dev,
3125+ dev_dbg(&sep->pdev->dev,
31263126 "[PID%d] dcb null arg\n", current->pid);
3127− error = EINVAL;
3127+ error = -EINVAL;
31283128 goto end_function;
31293129 }
31303130
drivers/staging/tidspbridge/core/tiomap3430.c+12−8
@@ -79,10 +79,6 @@ · 78 unmodified lines
7979 #define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190)
8080 #define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194)
8181
82−#define OMAP343X_CTRL_REGADDR(reg) \
83− OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg))
84−
85−
8682 /* Forward Declarations: */
8783 static int bridge_brd_monitor(struct bridge_dev_context *dev_ctxt);
8884 static int bridge_brd_read(struct bridge_dev_context *dev_ctxt,
@@ -418,19 +414,27 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, · 329 unmodified lines
418414
419415 /* Assert RST1 i.e only the RST only for DSP megacell */
420416 if (!status) {
417+ /*
418+ * XXX: ioremapping MUST be removed once ctrl
419+ * function is made available.
420+ */
421+ void __iomem *ctrl = ioremap(OMAP343X_CTRL_BASE, SZ_4K);
422+ if (!ctrl)
423+ return -ENOMEM;
424+
421425 (*pdata->dsp_prm_rmw_bits)(OMAP3430_RST1_IVA2_MASK,
422426 OMAP3430_RST1_IVA2_MASK, OMAP3430_IVA2_MOD,
423427 OMAP2_RM_RSTCTRL);
424428 /* Mask address with 1K for compatibility */
425429 __raw_writel(dsp_addr & OMAP3_IVA2_BOOTADDR_MASK,
426− OMAP343X_CTRL_REGADDR(
427− OMAP343X_CONTROL_IVA2_BOOTADDR));
430+ ctrl + OMAP343X_CONTROL_IVA2_BOOTADDR);
428431 /*
429432 * Set bootmode to self loop if dsp_debug flag is true
430433 */
431434 __raw_writel((dsp_debug) ? OMAP3_IVA2_BOOTMOD_IDLE : 0,
432− OMAP343X_CTRL_REGADDR(
433− OMAP343X_CONTROL_IVA2_BOOTMOD));
435+ ctrl + OMAP343X_CONTROL_IVA2_BOOTMOD);
436+
437+ iounmap(ctrl);
434438 }
435439 }
436440 if (!status) {
drivers/staging/tidspbridge/core/wdt.c+7−1
@@ -53,7 +53,10 @@ int dsp_wdt_init(void) · 52 unmodified lines
5353 int ret = 0;
5454
5555 dsp_wdt.sm_wdt = NULL;
56− dsp_wdt.reg_base = OMAP2_L4_IO_ADDRESS(OMAP34XX_WDT3_BASE);
56+ dsp_wdt.reg_base = ioremap(OMAP34XX_WDT3_BASE, SZ_4K);
57+ if (!dsp_wdt.reg_base)
58+ return -ENOMEM;
59+
5760 tasklet_init(&dsp_wdt.wdt3_tasklet, dsp_wdt_dpc, 0);
5861
5962 dsp_wdt.fclk = clk_get(NULL, "wdt3_fck");
@@ -99,6 +102,9 @@ void dsp_wdt_exit(void) · 39 unmodified lines
99102 dsp_wdt.fclk = NULL;
100103 dsp_wdt.iclk = NULL;
101104 dsp_wdt.sm_wdt = NULL;
105+
106+ if (dsp_wdt.reg_base)
107+ iounmap(dsp_wdt.reg_base);
102108 dsp_wdt.reg_base = NULL;
103109 }
104110
drivers/staging/vme/devices/vme_pio2_core.c+2−2
@@ -35,10 +35,10 @@ static int vector[PIO2_CARDS_MAX]; · 34 unmodified lines
3535 static int vector_num;
3636 static int level[PIO2_CARDS_MAX];
3737 static int level_num;
38−static const char *variant[PIO2_CARDS_MAX];
38+static char *variant[PIO2_CARDS_MAX];
3939 static int variant_num;
4040
41−static int loopback;
41+static bool loopback;
4242
4343 static int pio2_match(struct vme_dev *);
4444 static int __devinit pio2_probe(struct vme_dev *);
drivers/staging/vt6655/key.c+3−0
@@ -655,6 +655,9 @@ bool KeybSetDefaultKey ( · 654 unmodified lines
655655 return (false);
656656 }
657657
658+ if (uKeyLength > MAX_KEY_LEN)
659+ return false;
660+
658661 pTable->KeyTable[MAX_KEY_TABLE-1].bInUse = true;
659662 for(ii=0;ii<ETH_ALEN;ii++)
660663 pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID[ii] = 0xFF;
drivers/staging/vt6656/ioctl.c+2−1
@@ -565,7 +565,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) · 564 unmodified lines
565565 result = -ENOMEM;
566566 break;
567567 }
568− pNodeList = (PSNodeList)kmalloc(sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)), (int)GFP_ATOMIC);
568+ pNodeList = kmalloc(sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)), (int)GFP_ATOMIC);
569569 if (pNodeList == NULL) {
570570 result = -ENOMEM;
571571 break;
@@ -601,6 +601,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) · 29 unmodified lines
601601 }
602602 }
603603 if (copy_to_user(pReq->data, pNodeList, sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)))) {
604+ kfree(pNodeList);
604605 result = -EFAULT;
605606 break;
606607 }
drivers/staging/vt6656/key.c+3−0
@@ -684,6 +684,9 @@ BOOL KeybSetDefaultKey( · 683 unmodified lines
684684 return (FALSE);
685685 }
686686
687+ if (uKeyLength > MAX_KEY_LEN)
688+ return false;
689+
687690 pTable->KeyTable[MAX_KEY_TABLE-1].bInUse = TRUE;
688691 for (ii = 0; ii < ETH_ALEN; ii++)
689692 pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID[ii] = 0xFF;
drivers/staging/xgifb/vb_init.c+1−1
@@ -61,7 +61,7 @@ XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceExtension, · 60 unmodified lines
6161 }
6262 temp = xgifb_reg_get(pVBInfo->P3c4, 0x3B);
6363 /* SR3B[7][3]MAA15 MAA11 (Power on Trapping) */
64− if ((temp & 0x88) == 0x80)
64+ if (((temp & 0x88) == 0x80) || ((temp & 0x88) == 0x08))
6565 data = 0; /* DDR */
6666 else
6767 data = 1; /* DDRII */
drivers/staging/xgifb/vb_setmode.c+7−0
@@ -152,6 +152,7 @@ void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo) · 151 unmodified lines
152152 pVBInfo->pXGINew_CR97 = &XG20_CR97;
153153
154154 if (ChipType == XG27) {
155+ unsigned char temp;
155156 pVBInfo->MCLKData
156157 = (struct SiS_MCLKData *) XGI27New_MCLKData;
157158 pVBInfo->CR40 = XGI27_cr41;
@@ -162,7 +163,13 @@ void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo) · 4 unmodified lines
162163 pVBInfo->pCRDE = XG27_CRDE;
163164 pVBInfo->pSR40 = &XG27_SR40;
164165 pVBInfo->pSR41 = &XG27_SR41;
166+ pVBInfo->SR15 = XG27_SR13;
165167
168+ /*Z11m DDR*/
169+ temp = xgifb_reg_get(pVBInfo->P3c4, 0x3B);
170+ /* SR3B[7][3]MAA15 MAA11 (Power on Trapping) */
171+ if (((temp & 0x88) == 0x80) || ((temp & 0x88) == 0x08))
172+ pVBInfo->pXGINew_CR97 = &Z11m_CR97;
166173 }
167174
168175 if (ChipType >= XG20) {
drivers/staging/xgifb/vb_table.h+10−1
@@ -33,6 +33,13 @@ static struct XGI_ECLKDataStruct XGI340_ECLKData[] = { · 32 unmodified lines
3333 {0x5c, 0x23, 0x01, 166}
3434 };
3535
36+static unsigned char XG27_SR13[4][8] = {
37+ {0x35, 0x45, 0xb1, 0x00, 0x00, 0x00, 0x00, 0x00}, /* SR13 */
38+ {0x41, 0x51, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00}, /* SR14 */
39+ {0x32, 0x32, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00}, /* SR18 */
40+ {0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00} /* SR1B */
41+};
42+
3643 static unsigned char XGI340_SR13[4][8] = {
3744 {0x35, 0x45, 0xb1, 0x00, 0x00, 0x00, 0x00, 0x00}, /* SR13 */
3845 {0x41, 0x51, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00}, /* SR14 */
@@ -71,7 +78,7 @@ static unsigned char XGI27_cr41[24][8] = { · 32 unmodified lines
7178 {0x20, 0x40, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0 CR41 */
7279 {0xC4, 0x40, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 1 CR8A */
7380 {0xC4, 0x40, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 2 CR8B */
74− {0xB5, 0x13, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 3 CR40[7],
81+ {0xB3, 0x13, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 3 CR40[7],
7582 CR99[2:0],
7683 CR45[3:0]*/
7784 {0xf0, 0xf5, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 4 CR59 */
@@ -2803,6 +2810,8 @@ static unsigned char XG27_CRDE[2]; · 2725 unmodified lines
28032810 static unsigned char XG27_SR40 = 0x04 ;
28042811 static unsigned char XG27_SR41 = 0x00 ;
28052812
2813+static unsigned char Z11m_CR97 = 0x80 ;
2814+
28062815 static struct XGI330_VCLKDataStruct XGI_VCLKData[] = {
28072816 /* SR2B,SR2C,SR2D */
28082817 {0x1B, 0xE1, 25}, /* 00 (25.175MHz) */
drivers/staging/zcache/Kconfig+1−1
@@ -2,7 +2,7 @@ config ZCACHE · 1 unmodified line
22 bool "Dynamic compression of swap pages and clean pagecache pages"
33 # X86 dependency is because zsmalloc uses non-portable pte/tlb
44 # functions
5− depends on (CLEANCACHE || FRONTSWAP) && CRYPTO && X86
5+ depends on (CLEANCACHE || FRONTSWAP) && CRYPTO=y && X86
66 select ZSMALLOC
77 select CRYPTO_LZO
88 default n
drivers/staging/zsmalloc/zsmalloc-main.c+18−12
@@ -267,33 +267,39 @@ static unsigned long obj_idx_to_offset(struct page *page, · 266 unmodified lines
267267 return off + obj_idx * class_size;
268268 }
269269
270+static void reset_page(struct page *page)
271+{
272+ clear_bit(PG_private, &page->flags);
273+ clear_bit(PG_private_2, &page->flags);
274+ set_page_private(page, 0);
275+ page->mapping = NULL;
276+ page->freelist = NULL;
277+ reset_page_mapcount(page);
278+}
279+
270280 static void free_zspage(struct page *first_page)
271281 {
272− struct page *nextp, *tmp;
282+ struct page *nextp, *tmp, *head_extra;
273283
274284 BUG_ON(!is_first_page(first_page));
275285 BUG_ON(first_page->inuse);
276286
277− nextp = (struct page *)page_private(first_page);
287+ head_extra = (struct page *)page_private(first_page);
278288
279− clear_bit(PG_private, &first_page->flags);
280− clear_bit(PG_private_2, &first_page->flags);
281− set_page_private(first_page, 0);
282− first_page->mapping = NULL;
283− first_page->freelist = NULL;
284− reset_page_mapcount(first_page);
289+ reset_page(first_page);
285290 __free_page(first_page);
286291
287292 /* zspage with only 1 system page */
288− if (!nextp)
293+ if (!head_extra)
289294 return;
290295
291− list_for_each_entry_safe(nextp, tmp, &nextp->lru, lru) {
296+ list_for_each_entry_safe(nextp, tmp, &head_extra->lru, lru) {
292297 list_del(&nextp->lru);
293− clear_bit(PG_private_2, &nextp->flags);
294− nextp->index = 0;
298+ reset_page(nextp);
295299 __free_page(nextp);
296300 }
301+ reset_page(head_extra);
302+ __free_page(head_extra);
297303 }
298304
299305 /* Initialize a newly allocated zspage */
drivers/tty/amiserial.c+3−1
@@ -1073,8 +1073,10 @@ static int set_serial_info(struct tty_struct *tty, struct serial_state *state, · 1072 unmodified lines
10731073 (new_serial.close_delay != port->close_delay) ||
10741074 (new_serial.xmit_fifo_size != state->xmit_fifo_size) ||
10751075 ((new_serial.flags & ~ASYNC_USR_MASK) !=
1076− (port->flags & ~ASYNC_USR_MASK)))
1076+ (port->flags & ~ASYNC_USR_MASK))) {
1077+ tty_unlock();
10771078 return -EPERM;
1079+ }
10781080 port->flags = ((port->flags & ~ASYNC_USR_MASK) |
10791081 (new_serial.flags & ASYNC_USR_MASK));
10801082 state->custom_divisor = new_serial.custom_divisor;
drivers/tty/serial/8250/8250.c+6−6
@@ -1572,13 +1572,11 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id) · 1571 unmodified lines
15721572 do {
15731573 struct uart_8250_port *up;
15741574 struct uart_port *port;
1575− bool skip;
15761575
15771576 up = list_entry(l, struct uart_8250_port, list);
15781577 port = &up->port;
1579− skip = pass_counter && up->port.flags & UPF_IIR_ONCE;
15801578
1581− if (!skip && port->handle_irq(port)) {
1579+ if (port->handle_irq(port)) {
15821580 handled = 1;
15831581 end = NULL;
15841582 } else if (end == NULL)
@@ -2037,10 +2035,12 @@ static int serial8250_startup(struct uart_port *port) · 452 unmodified lines
20372035 spin_unlock_irqrestore(&port->lock, flags);
20382036
20392037 /*
2040− * If the interrupt is not reasserted, setup a timer to
2041− * kick the UART on a regular basis.
2038+ * If the interrupt is not reasserted, or we otherwise
2039+ * don't trust the iir, setup a timer to kick the UART
2040+ * on a regular basis.
20422041 */
2043− if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) {
2042+ if ((!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) ||
2043+ up->port.flags & UPF_BUG_THRE) {
20442044 up->bugs |= UART_BUG_THRE;
20452045 pr_debug("ttyS%d - using backup timer\n",
20462046 serial_index(port));
drivers/tty/serial/8250/8250_pci.c+1−15
@@ -1096,7 +1096,7 @@ static int kt_serial_setup(struct serial_private *priv, · 1095 unmodified lines
10961096 const struct pciserial_board *board,
10971097 struct uart_port *port, int idx)
10981098 {
1099− port->flags |= UPF_IIR_ONCE;
1099+ port->flags |= UPF_BUG_THRE;
11001100 return skip_tx_en_setup(priv, board, port, idx);
11011101 }
11021102
@@ -1118,18 +1118,6 @@ pci_xr17c154_setup(struct serial_private *priv, · 15 unmodified lines
11181118 return pci_default_setup(priv, board, port, idx);
11191119 }
11201120
1121−static int try_enable_msi(struct pci_dev *dev)
1122−{
1123− /* use msi if available, but fallback to legacy otherwise */
1124− pci_enable_msi(dev);
1125− return 0;
1126−}
1127−
1128−static void disable_msi(struct pci_dev *dev)
1129−{
1130− pci_disable_msi(dev);
1131−}
1132−
11331121 #define PCI_VENDOR_ID_SBSMODULARIO 0x124B
11341122 #define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
11351123 #define PCI_DEVICE_ID_OCTPRO 0x0001
@@ -1249,9 +1237,7 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = { · 113 unmodified lines
12491237 .device = PCI_DEVICE_ID_INTEL_PATSBURG_KT,
12501238 .subvendor = PCI_ANY_ID,
12511239 .subdevice = PCI_ANY_ID,
1252− .init = try_enable_msi,
12531240 .setup = kt_serial_setup,
1254− .exit = disable_msi,
12551241 },
12561242 /*
12571243 * ITE
drivers/tty/serial/Kconfig+1−1
@@ -1041,7 +1041,7 @@ config SERIAL_OMAP · 1040 unmodified lines
10411041
10421042 config SERIAL_OMAP_CONSOLE
10431043 bool "Console on OMAP serial port"
1044− depends on SERIAL_OMAP
1044+ depends on SERIAL_OMAP=y
10451045 select SERIAL_CORE_CONSOLE
10461046 help
10471047 Select this option if you would like to use omap serial port as
drivers/tty/serial/altera_uart.c+2−2
@@ -556,7 +556,7 @@ static int __devinit altera_uart_probe(struct platform_device *pdev) · 555 unmodified lines
556556 res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
557557 if (res_mem)
558558 port->mapbase = res_mem->start;
559− else if (platp->mapbase)
559+ else if (platp)
560560 port->mapbase = platp->mapbase;
561561 else
562562 return -EINVAL;
@@ -564,7 +564,7 @@ static int __devinit altera_uart_probe(struct platform_device *pdev) · 1 unmodified line
564564 res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
565565 if (res_irq)
566566 port->irq = res_irq->start;
567− else if (platp->irq)
567+ else if (platp)
568568 port->irq = platp->irq;
569569
570570 /* Check platform data first so we can override device node data */
drivers/tty/serial/amba-pl011.c+4−4
@@ -1946,10 +1946,6 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) · 1945 unmodified lines
19461946 goto unmap;
19471947 }
19481948
1949− /* Ensure interrupts from this UART are masked and cleared */
1950− writew(0, uap->port.membase + UART011_IMSC);
1951− writew(0xffff, uap->port.membase + UART011_ICR);
1952−
19531949 uap->vendor = vendor;
19541950 uap->lcrh_rx = vendor->lcrh_rx;
19551951 uap->lcrh_tx = vendor->lcrh_tx;
@@ -1967,6 +1963,10 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) · 11 unmodified lines
19671963 uap->port.line = i;
19681964 pl011_dma_probe(uap);
19691965
1966+ /* Ensure interrupts from this UART are masked and cleared */
1967+ writew(0, uap->port.membase + UART011_IMSC);
1968+ writew(0xffff, uap->port.membase + UART011_ICR);
1969+
19701970 snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", amba_rev(dev));
19711971
19721972 amba_ports[i] = uap;
drivers/tty/serial/atmel_serial.c+4−0
@@ -389,6 +389,8 @@ static void atmel_start_rx(struct uart_port *port) · 388 unmodified lines
389389 {
390390 UART_PUT_CR(port, ATMEL_US_RSTSTA); /* reset status and receiver */
391391
392+ UART_PUT_CR(port, ATMEL_US_RXEN);
393+
392394 if (atmel_use_dma_rx(port)) {
393395 /* enable PDC controller */
394396 UART_PUT_IER(port, ATMEL_US_ENDRX | ATMEL_US_TIMEOUT |
@@ -404,6 +406,8 @@ static void atmel_start_rx(struct uart_port *port) · 9 unmodified lines
404406 */
405407 static void atmel_stop_rx(struct uart_port *port)
406408 {
409+ UART_PUT_CR(port, ATMEL_US_RXDIS);
410+
407411 if (atmel_use_dma_rx(port)) {
408412 /* disable PDC receive */
409413 UART_PUT_PTCR(port, ATMEL_PDC_RXTDIS);
drivers/tty/serial/clps711x.c+8−6
@@ -154,10 +154,9 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id) · 153 unmodified lines
154154 port->x_char = 0;
155155 return IRQ_HANDLED;
156156 }
157− if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
158− clps711xuart_stop_tx(port);
159− return IRQ_HANDLED;
160− }
157+
158+ if (uart_circ_empty(xmit) || uart_tx_stopped(port))
159+ goto disable_tx_irq;
161160
162161 count = port->fifosize >> 1;
163162 do {
@@ -171,8 +170,11 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id) · 7 unmodified lines
171170 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
172171 uart_write_wakeup(port);
173172
174− if (uart_circ_empty(xmit))
175− clps711xuart_stop_tx(port);
173+ if (uart_circ_empty(xmit)) {
174+ disable_tx_irq:
175+ disable_irq_nosync(TX_IRQ(port));
176+ tx_enabled(port) = 0;
177+ }
176178
177179 return IRQ_HANDLED;
178180 }
drivers/tty/serial/omap-serial.c+20−23
@@ -1381,29 +1381,24 @@ static int serial_omap_probe(struct platform_device *pdev) · 1380 unmodified lines
13811381 return -ENODEV;
13821382 }
13831383
1384− if (!request_mem_region(mem->start, resource_size(mem),
1384+ if (!devm_request_mem_region(&pdev->dev, mem->start, resource_size(mem),
13851385 pdev->dev.driver->name)) {
13861386 dev_err(&pdev->dev, "memory region already claimed\n");
13871387 return -EBUSY;
13881388 }
13891389
13901390 dma_rx = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
1391− if (!dma_rx) {
1392− ret = -EINVAL;
1393− goto err;
1394− }
1391+ if (!dma_rx)
1392+ return -ENXIO;
13951393
13961394 dma_tx = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
1397− if (!dma_tx) {
1398− ret = -EINVAL;
1399− goto err;
1400− }
1395+ if (!dma_tx)
1396+ return -ENXIO;
1397+
1398+ up = devm_kzalloc(&pdev->dev, sizeof(*up), GFP_KERNEL);
1399+ if (!up)
1400+ return -ENOMEM;
14011401
1402− up = kzalloc(sizeof(*up), GFP_KERNEL);
1403− if (up == NULL) {
1404− ret = -ENOMEM;
1405− goto do_release_region;
1406− }
14071402 up->pdev = pdev;
14081403 up->port.dev = &pdev->dev;
14091404 up->port.type = PORT_OMAP;
@@ -1423,16 +1418,17 @@ static int serial_omap_probe(struct platform_device *pdev) · 13 unmodified lines
14231418 dev_err(&pdev->dev, "failed to get alias/pdev id, errno %d\n",
14241419 up->port.line);
14251420 ret = -ENODEV;
1426− goto err;
1421+ goto err_port_line;
14271422 }
14281423
14291424 sprintf(up->name, "OMAP UART%d", up->port.line);
14301425 up->port.mapbase = mem->start;
1431− up->port.membase = ioremap(mem->start, resource_size(mem));
1426+ up->port.membase = devm_ioremap(&pdev->dev, mem->start,
1427+ resource_size(mem));
14321428 if (!up->port.membase) {
14331429 dev_err(&pdev->dev, "can't ioremap UART\n");
14341430 ret = -ENOMEM;
1435− goto err;
1431+ goto err_ioremap;
14361432 }
14371433
14381434 up->port.flags = omap_up_info->flags;
@@ -1478,16 +1474,19 @@ static int serial_omap_probe(struct platform_device *pdev) · 39 unmodified lines
14781474
14791475 ret = uart_add_one_port(&serial_omap_reg, &up->port);
14801476 if (ret != 0)
1481− goto do_release_region;
1477+ goto err_add_port;
14821478
14831479 pm_runtime_put(&pdev->dev);
14841480 platform_set_drvdata(pdev, up);
14851481 return 0;
1486−err:
1482+
1483+err_add_port:
1484+ pm_runtime_put(&pdev->dev);
1485+ pm_runtime_disable(&pdev->dev);
1486+err_ioremap:
1487+err_port_line:
14871488 dev_err(&pdev->dev, "[UART%d]: failure [%s]: %d\n",
14881489 pdev->id, __func__, ret);
1489−do_release_region:
1490− release_mem_region(mem->start, resource_size(mem));
14911490 return ret;
14921491 }
14931492
@@ -1499,8 +1498,6 @@ static int serial_omap_remove(struct platform_device *dev) · 5 unmodified lines
14991498 pm_runtime_disable(&up->pdev->dev);
15001499 uart_remove_one_port(&serial_omap_reg, &up->port);
15011500 pm_qos_remove_request(&up->pm_qos_request);
1502−
1503− kfree(up);
15041501 }
15051502
15061503 platform_set_drvdata(dev, NULL);
drivers/tty/serial/pch_uart.c+11−1
@@ -210,6 +210,7 @@ enum { · 209 unmodified lines
210210 #define CMITC_UARTCLK 192000000 /* 192.0000 MHz */
211211 #define FRI2_64_UARTCLK 64000000 /* 64.0000 MHz */
212212 #define FRI2_48_UARTCLK 48000000 /* 48.0000 MHz */
213+#define NTC1_UARTCLK 64000000 /* 64.0000 MHz */
213214
214215 struct pch_uart_buffer {
215216 unsigned char *buf;
@@ -384,6 +385,12 @@ static int pch_uart_get_uartclk(void) · 168 unmodified lines
384385 if (cmp && strstr(cmp, "Fish River Island II"))
385386 return FRI2_48_UARTCLK;
386387
388+ /* Kontron COMe-mTT10 (nanoETXexpress-TT) */
389+ cmp = dmi_get_system_info(DMI_BOARD_NAME);
390+ if (cmp && (strstr(cmp, "COMe-mTT") ||
391+ strstr(cmp, "nanoETXexpress-TT")))
392+ return NTC1_UARTCLK;
393+
387394 return DEFAULT_UARTCLK;
388395 }
389396
@@ -1440,9 +1447,11 @@ static int pch_uart_verify_port(struct uart_port *port, · 1050 unmodified lines
14401447 __func__);
14411448 return -EOPNOTSUPP;
14421449 #endif
1443− priv->use_dma = 1;
14441450 priv->use_dma_flag = 1;
14451451 dev_info(priv->port.dev, "PCH UART : Use DMA Mode\n");
1452+ if (!priv->use_dma)
1453+ pch_request_dma(port);
1454+ priv->use_dma = 1;
14461455 }
14471456
14481457 return 0;
@@ -1651,6 +1660,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev, · 202 unmodified lines
16511660 }
16521661
16531662 pci_enable_msi(pdev);
1663+ pci_set_master(pdev);
16541664
16551665 iobase = pci_resource_start(pdev, 0);
16561666 mapbase = pci_resource_start(pdev, 1);
drivers/tty/serial/samsung.c+1−0
@@ -982,6 +982,7 @@ static void s3c24xx_serial_resetport(struct uart_port *port, · 981 unmodified lines
982982
983983 ucon &= ucon_mask;
984984 wr_regl(port, S3C2410_UCON, ucon | cfg->ucon);
985+ wr_regl(port, S3C2410_ULCON, cfg->ulcon);
985986
986987 /* reset both fifos */
987988 wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
drivers/tty/vt/vt.c+1−2
@@ -2932,11 +2932,10 @@ static int __init con_init(void) · 2931 unmodified lines
29322932 gotoxy(vc, vc->vc_x, vc->vc_y);
29332933 csi_J(vc, 0);
29342934 update_screen(vc);
2935− pr_info("Console: %s %s %dx%d",
2935+ pr_info("Console: %s %s %dx%d\n",
29362936 vc->vc_can_do_color ? "colour" : "mono",
29372937 display_desc, vc->vc_cols, vc->vc_rows);
29382938 printable = 1;
2939− printk("\n");
29402939
29412940 console_unlock();
29422941
drivers/usb/Kconfig+8−8
@@ -2,14 +2,6 @@ · 1 unmodified line
22 # USB device configuration
33 #
44
5−menuconfig USB_SUPPORT
6− bool "USB support"
7− depends on HAS_IOMEM
8− default y
9− ---help---
10− This option adds core support for Universal Serial Bus (USB).
11− You will also need drivers from the following menu to make use of it.
12−
135 # many non-PCI SOC chips embed OHCI
146 config USB_ARCH_HAS_OHCI
157 boolean
@@ -63,6 +55,14 @@ config USB_ARCH_HAS_XHCI · 47 unmodified lines
6355 boolean
6456 default PCI
6557
58+menuconfig USB_SUPPORT
59+ bool "USB support"
60+ depends on HAS_IOMEM
61+ default y
62+ ---help---
63+ This option adds core support for Universal Serial Bus (USB).
64+ You will also need drivers from the following menu to make use of it.
65+
6666 if USB_SUPPORT
6767
6868 config USB_COMMON
drivers/usb/class/cdc-wdm.c+5−2
@@ -157,8 +157,9 @@ static void wdm_out_callback(struct urb *urb) · 156 unmodified lines
157157 spin_lock(&desc->iuspin);
158158 desc->werr = urb->status;
159159 spin_unlock(&desc->iuspin);
160− clear_bit(WDM_IN_USE, &desc->flags);
161160 kfree(desc->outbuf);
161+ desc->outbuf = NULL;
162+ clear_bit(WDM_IN_USE, &desc->flags);
162163 wake_up(&desc->wait);
163164 }
164165
@@ -338,7 +339,7 @@ static ssize_t wdm_write · 173 unmodified lines
338339 if (we < 0)
339340 return -EIO;
340341
341− desc->outbuf = buf = kmalloc(count, GFP_KERNEL);
342+ buf = kmalloc(count, GFP_KERNEL);
342343 if (!buf) {
343344 rv = -ENOMEM;
344345 goto outnl;
@@ -406,10 +407,12 @@ static ssize_t wdm_write · 61 unmodified lines
406407 req->wIndex = desc->inum;
407408 req->wLength = cpu_to_le16(count);
408409 set_bit(WDM_IN_USE, &desc->flags);
410+ desc->outbuf = buf;
409411
410412 rv = usb_submit_urb(desc->command, GFP_KERNEL);
411413 if (rv < 0) {
412414 kfree(buf);
415+ desc->outbuf = NULL;
413416 clear_bit(WDM_IN_USE, &desc->flags);
414417 dev_err(&desc->intf->dev, "Tx URB error: %d\n", rv);
415418 } else {
drivers/usb/core/driver.c+7−2
@@ -1189,8 +1189,13 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) · 1188 unmodified lines
11891189 if (status == 0) {
11901190 status = usb_suspend_device(udev, msg);
11911191
1192− /* Again, ignore errors during system sleep transitions */
1193− if (!PMSG_IS_AUTO(msg))
1192+ /*
1193+ * Ignore errors from non-root-hub devices during
1194+ * system sleep transitions. For the most part,
1195+ * these devices should go to low power anyway when
1196+ * the entire bus is suspended.
1197+ */
1198+ if (udev->parent && !PMSG_IS_AUTO(msg))
11941199 status = 0;
11951200 }
11961201
drivers/usb/core/hcd-pci.c+9−0
@@ -493,6 +493,15 @@ static int hcd_pci_suspend_noirq(struct device *dev) · 492 unmodified lines
493493
494494 pci_save_state(pci_dev);
495495
496+ /*
497+ * Some systems crash if an EHCI controller is in D3 during
498+ * a sleep transition. We have to leave such controllers in D0.
499+ */
500+ if (hcd->broken_pci_sleep) {
501+ dev_dbg(dev, "Staying in PCI D0\n");
502+ return retval;
503+ }
504+
496505 /* If the root hub is dead rather than suspended, disallow remote
497506 * wakeup. usb_hc_died() should ensure that both hosts are marked as
498507 * dying, so we only need to check the primary roothub.
drivers/usb/core/hcd.c+12−0
@@ -1978,6 +1978,18 @@ int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg) · 1977 unmodified lines
19781978 if (status == 0) {
19791979 usb_set_device_state(rhdev, USB_STATE_SUSPENDED);
19801980 hcd->state = HC_STATE_SUSPENDED;
1981+
1982+ /* Did we race with a root-hub wakeup event? */
1983+ if (rhdev->do_remote_wakeup) {
1984+ char buffer[6];
1985+
1986+ status = hcd->driver->hub_status_data(hcd, buffer);
1987+ if (status != 0) {
1988+ dev_dbg(&rhdev->dev, "suspend raced with wakeup event\n");
1989+ hcd_bus_resume(rhdev, PMSG_AUTO_RESUME);
1990+ status = -EBUSY;
1991+ }
1992+ }
19811993 } else {
19821994 spin_lock_irq(&hcd_root_hub_lock);
19831995 if (!HCD_DEAD(hcd)) {
drivers/usb/core/hub.c+16−3
@@ -1667,7 +1667,6 @@ void usb_disconnect(struct usb_device **pdev) · 1666 unmodified lines
16671667 {
16681668 struct usb_device *udev = *pdev;
16691669 int i;
1670− struct usb_hcd *hcd = bus_to_hcd(udev->bus);
16711670
16721671 /* mark the device as inactive, so any further urb submissions for
16731672 * this device (and any of its children) will fail immediately.
@@ -1690,9 +1689,7 @@ void usb_disconnect(struct usb_device **pdev) · 16 unmodified lines
16901689 * so that the hardware is now fully quiesced.
16911690 */
16921691 dev_dbg (&udev->dev, "unregistering device\n");
1693− mutex_lock(hcd->bandwidth_mutex);
16941692 usb_disable_device(udev, 0);
1695− mutex_unlock(hcd->bandwidth_mutex);
16961693 usb_hcd_synchronize_unlinks(udev);
16971694
16981695 usb_remove_ep_devs(&udev->ep0);
@@ -3163,6 +3160,22 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, · 1464 unmodified lines
31633160 if (retval)
31643161 goto fail;
31653162
3163+ /*
3164+ * Some superspeed devices have finished the link training process
3165+ * and attached to a superspeed hub port, but the device descriptor
3166+ * got from those devices show they aren't superspeed devices. Warm
3167+ * reset the port attached by the devices can fix them.
3168+ */
3169+ if ((udev->speed == USB_SPEED_SUPER) &&
3170+ (le16_to_cpu(udev->descriptor.bcdUSB) < 0x0300)) {
3171+ dev_err(&udev->dev, "got a wrong device descriptor, "
3172+ "warm reset device\n");
3173+ hub_port_reset(hub, port1, udev,
3174+ HUB_BH_RESET_TIME, true);
3175+ retval = -EINVAL;
3176+ goto fail;
3177+ }
3178+
31663179 if (udev->descriptor.bMaxPacketSize0 == 0xff ||
31673180 udev->speed == USB_SPEED_SUPER)
31683181 i = 512;
drivers/usb/core/message.c+9−8
@@ -308,7 +308,8 @@ static void sg_complete(struct urb *urb) · 307 unmodified lines
308308 retval = usb_unlink_urb(io->urbs [i]);
309309 if (retval != -EINPROGRESS &&
310310 retval != -ENODEV &&
311− retval != -EBUSY)
311+ retval != -EBUSY &&
312+ retval != -EIDRM)
312313 dev_err(&io->dev->dev,
313314 "%s, unlink --> %d\n",
314315 __func__, retval);
@@ -317,7 +318,6 @@ static void sg_complete(struct urb *urb) · 2 unmodified lines
317318 }
318319 spin_lock(&io->lock);
319320 }
320− urb->dev = NULL;
321321
322322 /* on the last completion, signal usb_sg_wait() */
323323 io->bytes += urb->actual_length;
@@ -524,7 +524,6 @@ void usb_sg_wait(struct usb_sg_request *io) · 200 unmodified lines
524524 case -ENXIO: /* hc didn't queue this one */
525525 case -EAGAIN:
526526 case -ENOMEM:
527− io->urbs[i]->dev = NULL;
528527 retval = 0;
529528 yield();
530529 break;
@@ -542,7 +541,6 @@ void usb_sg_wait(struct usb_sg_request *io) · 11 unmodified lines
542541
543542 /* fail any uncompleted urbs */
544543 default:
545− io->urbs[i]->dev = NULL;
546544 io->urbs[i]->status = retval;
547545 dev_dbg(&io->dev->dev, "%s, submit --> %d\n",
548546 __func__, retval);
@@ -593,7 +591,10 @@ void usb_sg_cancel(struct usb_sg_request *io) · 44 unmodified lines
593591 if (!io->urbs [i]->dev)
594592 continue;
595593 retval = usb_unlink_urb(io->urbs [i]);
596− if (retval != -EINPROGRESS && retval != -EBUSY)
594+ if (retval != -EINPROGRESS
595+ && retval != -ENODEV
596+ && retval != -EBUSY
597+ && retval != -EIDRM)
597598 dev_warn(&io->dev->dev, "%s, unlink --> %d\n",
598599 __func__, retval);
599600 }
@@ -1135,8 +1136,6 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf, · 535 unmodified lines
11351136 * Deallocates hcd/hardware state for the endpoints (nuking all or most
11361137 * pending urbs) and usbcore state for the interfaces, so that usbcore
11371138 * must usb_set_configuration() before any interfaces could be used.
1138− *
1139− * Must be called with hcd->bandwidth_mutex held.
11401139 */
11411140 void usb_disable_device(struct usb_device *dev, int skip_ep0)
11421141 {
@@ -1189,7 +1188,9 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0) · 46 unmodified lines
11891188 usb_disable_endpoint(dev, i + USB_DIR_IN, false);
11901189 }
11911190 /* Remove endpoints from the host controller internal state */
1191+ mutex_lock(hcd->bandwidth_mutex);
11921192 usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL);
1193+ mutex_unlock(hcd->bandwidth_mutex);
11931194 /* Second pass: remove endpoint pointers */
11941195 }
11951196 for (i = skip_ep0; i < 16; ++i) {
@@ -1749,7 +1750,6 @@ free_interfaces: · 553 unmodified lines
17491750 /* if it's already configured, clear out old state first.
17501751 * getting rid of old interfaces means unbinding their drivers.
17511752 */
1752− mutex_lock(hcd->bandwidth_mutex);
17531753 if (dev->state != USB_STATE_ADDRESS)
17541754 usb_disable_device(dev, 1); /* Skip ep0 */
17551755
@@ -1762,6 +1762,7 @@ free_interfaces: · 6 unmodified lines
17621762 * host controller will not allow submissions to dropped endpoints. If
17631763 * this call fails, the device state is unchanged.
17641764 */
1765+ mutex_lock(hcd->bandwidth_mutex);
17651766 ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL);
17661767 if (ret < 0) {
17671768 mutex_unlock(hcd->bandwidth_mutex);
drivers/usb/core/urb.c+12−0
@@ -539,6 +539,10 @@ EXPORT_SYMBOL_GPL(usb_submit_urb); · 538 unmodified lines
539539 * never submitted, or it was unlinked before, or the hardware is already
540540 * finished with it), even if the completion handler has not yet run.
541541 *
542+ * The URB must not be deallocated while this routine is running. In
543+ * particular, when a driver calls this routine, it must insure that the
544+ * completion handler cannot deallocate the URB.
545+ *
542546 * Unlinking and Endpoint Queues:
543547 *
544548 * [The behaviors and guarantees described below do not apply to virtual
@@ -603,6 +607,10 @@ EXPORT_SYMBOL_GPL(usb_unlink_urb); · 58 unmodified lines
603607 * with error -EPERM. Thus even if the URB's completion handler always
604608 * tries to resubmit, it will not succeed and the URB will become idle.
605609 *
610+ * The URB must not be deallocated while this routine is running. In
611+ * particular, when a driver calls this routine, it must insure that the
612+ * completion handler cannot deallocate the URB.
613+ *
606614 * This routine may not be used in an interrupt context (such as a bottom
607615 * half or a completion handler), or when holding a spinlock, or in other
608616 * situations where the caller can't schedule().
@@ -640,6 +648,10 @@ EXPORT_SYMBOL_GPL(usb_kill_urb); · 31 unmodified lines
640648 * with error -EPERM. Thus even if the URB's completion handler always
641649 * tries to resubmit, it will not succeed and the URB will become idle.
642650 *
651+ * The URB must not be deallocated while this routine is running. In
652+ * particular, when a driver calls this routine, it must insure that the
653+ * completion handler cannot deallocate the URB.
654+ *
643655 * This routine may not be used in an interrupt context (such as a bottom
644656 * half or a completion handler), or when holding a spinlock, or in other
645657 * situations where the caller can't schedule().
drivers/usb/dwc3/core.c+3−3
@@ -206,11 +206,11 @@ static void dwc3_free_event_buffers(struct dwc3 *dwc) · 205 unmodified lines
206206
207207 for (i = 0; i < dwc->num_event_buffers; i++) {
208208 evt = dwc->ev_buffs[i];
209− if (evt) {
209+ if (evt)
210210 dwc3_free_one_event_buffer(dwc, evt);
211− dwc->ev_buffs[i] = NULL;
212− }
213211 }
212+
213+ kfree(dwc->ev_buffs);
214214 }
215215
216216 /**
drivers/usb/dwc3/ep0.c+10−2
@@ -353,6 +353,9 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc, · 352 unmodified lines
353353
354354 dwc->test_mode_nr = wIndex >> 8;
355355 dwc->test_mode = true;
356+ break;
357+ default:
358+ return -EINVAL;
356359 }
357360 break;
358361
@@ -559,15 +562,20 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc, · 200 unmodified lines
559562 length = trb->size & DWC3_TRB_SIZE_MASK;
560563
561564 if (dwc->ep0_bounced) {
565+ unsigned transfer_size = ur->length;
566+ unsigned maxp = ep0->endpoint.maxpacket;
567+
568+ transfer_size += (maxp - (transfer_size % maxp));
562569 transferred = min_t(u32, ur->length,
563− ep0->endpoint.maxpacket - length);
570+ transfer_size - length);
564571 memcpy(ur->buf, dwc->ep0_bounce, transferred);
565572 dwc->ep0_bounced = false;
566573 } else {
567574 transferred = ur->length - length;
568− ur->actual += transferred;
569575 }
570576
577+ ur->actual += transferred;
578+
571579 if ((epnum & 1) && ur->actual < ur->length) {
572580 /* for some reason we did not get everything out */
573581
drivers/usb/gadget/at91_udc.c+4−4
@@ -1863,8 +1863,8 @@ static int __devinit at91udc_probe(struct platform_device *pdev) · 1862 unmodified lines
18631863 mod_timer(&udc->vbus_timer,
18641864 jiffies + VBUS_POLL_TIMEOUT);
18651865 } else {
1866− if (request_irq(udc->board.vbus_pin, at91_vbus_irq,
1867− 0, driver_name, udc)) {
1866+ if (request_irq(gpio_to_irq(udc->board.vbus_pin),
1867+ at91_vbus_irq, 0, driver_name, udc)) {
18681868 DBG("request vbus irq %d failed\n",
18691869 udc->board.vbus_pin);
18701870 retval = -EBUSY;
@@ -1886,7 +1886,7 @@ static int __devinit at91udc_probe(struct platform_device *pdev) · 15 unmodified lines
18861886 return 0;
18871887 fail4:
18881888 if (gpio_is_valid(udc->board.vbus_pin) && !udc->board.vbus_polled)
1889− free_irq(udc->board.vbus_pin, udc);
1889+ free_irq(gpio_to_irq(udc->board.vbus_pin), udc);
18901890 fail3:
18911891 if (gpio_is_valid(udc->board.vbus_pin))
18921892 gpio_free(udc->board.vbus_pin);
@@ -1924,7 +1924,7 @@ static int __exit at91udc_remove(struct platform_device *pdev) · 31 unmodified lines
19241924 device_init_wakeup(&pdev->dev, 0);
19251925 remove_debug_file(udc);
19261926 if (gpio_is_valid(udc->board.vbus_pin)) {
1927− free_irq(udc->board.vbus_pin, udc);
1927+ free_irq(gpio_to_irq(udc->board.vbus_pin), udc);
19281928 gpio_free(udc->board.vbus_pin);
19291929 }
19301930 free_irq(udc->udp_irq, udc);
drivers/usb/gadget/dummy_hcd.c+0−1
@@ -927,7 +927,6 @@ static int dummy_udc_stop(struct usb_gadget *g, · 926 unmodified lines
927927
928928 dum->driver = NULL;
929929
930− dummy_pullup(&dum->gadget, 0);
931930 return 0;
932931 }
933932
drivers/usb/gadget/f_fs.c+2−1
@@ -712,7 +712,7 @@ static long ffs_ep0_ioctl(struct file *file, unsigned code, unsigned long value) · 711 unmodified lines
712712 if (code == FUNCTIONFS_INTERFACE_REVMAP) {
713713 struct ffs_function *func = ffs->func;
714714 ret = func ? ffs_func_revmap_intf(func, value) : -ENODEV;
715− } else if (gadget->ops->ioctl) {
715+ } else if (gadget && gadget->ops->ioctl) {
716716 ret = gadget->ops->ioctl(gadget, code, value);
717717 } else {
718718 ret = -ENOTTY;
@@ -1382,6 +1382,7 @@ static void functionfs_unbind(struct ffs_data *ffs) · 663 unmodified lines
13821382 ffs->ep0req = NULL;
13831383 ffs->gadget = NULL;
13841384 ffs_data_put(ffs);
1385+ clear_bit(FFS_FL_BOUND, &ffs->flags);
13851386 }
13861387 }
13871388
drivers/usb/gadget/f_mass_storage.c+1−1
@@ -2189,7 +2189,7 @@ unknown_cmnd: · 2188 unmodified lines
21892189 common->data_size_from_cmnd = 0;
21902190 sprintf(unknown, "Unknown x%02x", common->cmnd[0]);
21912191 reply = check_command(common, common->cmnd_size,
2192− DATA_DIR_UNKNOWN, 0xff, 0, unknown);
2192+ DATA_DIR_UNKNOWN, ~0, 0, unknown);
21932193 if (reply == 0) {
21942194 common->curlun->sense_data = SS_INVALID_COMMAND;
21952195 reply = -EINVAL;
drivers/usb/gadget/f_rndis.c+1−0
@@ -500,6 +500,7 @@ rndis_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl) · 499 unmodified lines
500500 if (buf) {
501501 memcpy(req->buf, buf, n);
502502 req->complete = rndis_response_complete;
503+ req->context = rndis;
503504 rndis_free_response(rndis->config, buf);
504505 value = n;
505506 }
drivers/usb/gadget/file_storage.c+1−1
@@ -2579,7 +2579,7 @@ static int do_scsi_command(struct fsg_dev *fsg) · 2578 unmodified lines
25792579 fsg->data_size_from_cmnd = 0;
25802580 sprintf(unknown, "Unknown x%02x", fsg->cmnd[0]);
25812581 if ((reply = check_command(fsg, fsg->cmnd_size,
2582− DATA_DIR_UNKNOWN, 0xff, 0, unknown)) == 0) {
2582+ DATA_DIR_UNKNOWN, ~0, 0, unknown)) == 0) {
25832583 fsg->curlun->sense_data = SS_INVALID_COMMAND;
25842584 reply = -EINVAL;
25852585 }
drivers/usb/gadget/fsl_udc_core.c+16−9
@@ -730,7 +730,7 @@ static void fsl_queue_td(struct fsl_ep *ep, struct fsl_req *req) · 729 unmodified lines
730730 : (1 << (ep_index(ep)));
731731
732732 /* check if the pipe is empty */
733− if (!(list_empty(&ep->queue))) {
733+ if (!(list_empty(&ep->queue)) && !(ep_index(ep) == 0)) {
734734 /* Add td to the end */
735735 struct fsl_req *lastreq;
736736 lastreq = list_entry(ep->queue.prev, struct fsl_req, queue);
@@ -918,10 +918,6 @@ fsl_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags) · 181 unmodified lines
918918 return -ENOMEM;
919919 }
920920
921− /* Update ep0 state */
922− if ((ep_index(ep) == 0))
923− udc->ep0_state = DATA_STATE_XMIT;
924−
925921 /* irq handler advances the queue */
926922 if (req != NULL)
927923 list_add_tail(&req->queue, &ep->queue);
@@ -1279,7 +1275,8 @@ static int ep0_prime_status(struct fsl_udc *udc, int direction) · 351 unmodified lines
12791275 udc->ep0_dir = USB_DIR_OUT;
12801276
12811277 ep = &udc->eps[0];
1282− udc->ep0_state = WAIT_FOR_OUT_STATUS;
1278+ if (udc->ep0_state != DATA_STATE_XMIT)
1279+ udc->ep0_state = WAIT_FOR_OUT_STATUS;
12831280
12841281 req->ep = ep;
12851282 req->req.length = 0;
@@ -1384,6 +1381,9 @@ static void ch9getstatus(struct fsl_udc *udc, u8 request_type, u16 value, · 98 unmodified lines
13841381
13851382 list_add_tail(&req->queue, &ep->queue);
13861383 udc->ep0_state = DATA_STATE_XMIT;
1384+ if (ep0_prime_status(udc, EP_DIR_OUT))
1385+ ep0stall(udc);
1386+
13871387 return;
13881388 stall:
13891389 ep0stall(udc);
@@ -1492,6 +1492,14 @@ static void setup_received_irq(struct fsl_udc *udc, · 102 unmodified lines
14921492 spin_lock(&udc->lock);
14931493 udc->ep0_state = (setup->bRequestType & USB_DIR_IN)
14941494 ? DATA_STATE_XMIT : DATA_STATE_RECV;
1495+ /*
1496+ * If the data stage is IN, send status prime immediately.
1497+ * See 2.0 Spec chapter 8.5.3.3 for detail.
1498+ */
1499+ if (udc->ep0_state == DATA_STATE_XMIT)
1500+ if (ep0_prime_status(udc, EP_DIR_OUT))
1501+ ep0stall(udc);
1502+
14951503 } else {
14961504 /* No data phase, IN status from gadget */
14971505 udc->ep0_dir = USB_DIR_IN;
@@ -1520,9 +1528,8 @@ static void ep0_req_complete(struct fsl_udc *udc, struct fsl_ep *ep0, · 22 unmodified lines
15201528
15211529 switch (udc->ep0_state) {
15221530 case DATA_STATE_XMIT:
1523− /* receive status phase */
1524− if (ep0_prime_status(udc, EP_DIR_OUT))
1525− ep0stall(udc);
1531+ /* already primed at setup_received_irq */
1532+ udc->ep0_state = WAIT_FOR_OUT_STATUS;
15261533 break;
15271534 case DATA_STATE_RECV:
15281535 /* send status phase */
drivers/usb/gadget/g_ffs.c+2−2
@@ -161,7 +161,7 @@ static struct usb_composite_driver gfs_driver = { · 160 unmodified lines
161161 static struct ffs_data *gfs_ffs_data;
162162 static unsigned long gfs_registered;
163163
164−static int gfs_init(void)
164+static int __init gfs_init(void)
165165 {
166166 ENTER();
167167
@@ -169,7 +169,7 @@ static int gfs_init(void) · 1 unmodified line
169169 }
170170 module_init(gfs_init);
171171
172−static void gfs_exit(void)
172+static void __exit gfs_exit(void)
173173 {
174174 ENTER();
175175
drivers/usb/gadget/inode.c+0−1
@@ -1574,7 +1574,6 @@ static void destroy_ep_files (struct dev_data *dev) · 1573 unmodified lines
15741574 DBG (dev, "%s %d\n", __func__, dev->state);
15751575
15761576 /* dev->state must prevent interference */
1577−restart:
15781577 spin_lock_irq (&dev->lock);
15791578 while (!list_empty(&dev->epfiles)) {
15801579 struct ep_data *ep;
drivers/usb/gadget/s3c-hsotg.c+10−7
@@ -340,7 +340,7 @@ static void s3c_hsotg_init_fifo(struct s3c_hsotg *hsotg) · 339 unmodified lines
340340 /* currently we allocate TX FIFOs for all possible endpoints,
341341 * and assume that they are all the same size. */
342342
343− for (ep = 0; ep <= 15; ep++) {
343+ for (ep = 1; ep <= 15; ep++) {
344344 val = addr;
345345 val |= size << S3C_DPTXFSIZn_DPTxFSize_SHIFT;
346346 addr += size;
@@ -741,7 +741,7 @@ static void s3c_hsotg_start_req(struct s3c_hsotg *hsotg, · 394 unmodified lines
741741 /* write size / packets */
742742 writel(epsize, hsotg->regs + epsize_reg);
743743
744− if (using_dma(hsotg)) {
744+ if (using_dma(hsotg) && !continuing) {
745745 unsigned int dma_reg;
746746
747747 /* write DMA address to control register, buffer already
@@ -1696,10 +1696,12 @@ static void s3c_hsotg_set_ep_maxpacket(struct s3c_hsotg *hsotg, · 948 unmodified lines
16961696 reg |= mpsval;
16971697 writel(reg, regs + S3C_DIEPCTL(ep));
16981698
1699− reg = readl(regs + S3C_DOEPCTL(ep));
1700− reg &= ~S3C_DxEPCTL_MPS_MASK;
1701− reg |= mpsval;
1702− writel(reg, regs + S3C_DOEPCTL(ep));
1699+ if (ep) {
1700+ reg = readl(regs + S3C_DOEPCTL(ep));
1701+ reg &= ~S3C_DxEPCTL_MPS_MASK;
1702+ reg |= mpsval;
1703+ writel(reg, regs + S3C_DOEPCTL(ep));
1704+ }
17031705
17041706 return;
17051707
@@ -1919,7 +1921,8 @@ static void s3c_hsotg_epint(struct s3c_hsotg *hsotg, unsigned int idx, · 213 unmodified lines
19191921 ints & S3C_DIEPMSK_TxFIFOEmpty) {
19201922 dev_dbg(hsotg->dev, "%s: ep%d: TxFIFOEmpty\n",
19211923 __func__, idx);
1922− s3c_hsotg_trytx(hsotg, hs_ep);
1924+ if (!using_dma(hsotg))
1925+ s3c_hsotg_trytx(hsotg, hs_ep);
19231926 }
19241927 }
19251928 }
drivers/usb/gadget/udc-core.c+5−1
@@ -263,9 +263,9 @@ static void usb_gadget_remove_driver(struct usb_udc *udc) · 262 unmodified lines
263263
264264 if (udc_is_newstyle(udc)) {
265265 udc->driver->disconnect(udc->gadget);
266+ usb_gadget_disconnect(udc->gadget);
266267 udc->driver->unbind(udc->gadget);
267268 usb_gadget_udc_stop(udc->gadget, udc->driver);
268− usb_gadget_disconnect(udc->gadget);
269269 } else {
270270 usb_gadget_stop(udc->gadget, udc->driver);
271271 }
@@ -411,9 +411,13 @@ static ssize_t usb_udc_softconn_store(struct device *dev, · 139 unmodified lines
411411 struct usb_udc *udc = container_of(dev, struct usb_udc, dev);
412412
413413 if (sysfs_streq(buf, "connect")) {
414+ if (udc_is_newstyle(udc))
415+ usb_gadget_udc_start(udc->gadget, udc->driver);
414416 usb_gadget_connect(udc->gadget);
415417 } else if (sysfs_streq(buf, "disconnect")) {
416418 usb_gadget_disconnect(udc->gadget);
419+ if (udc_is_newstyle(udc))
420+ usb_gadget_udc_stop(udc->gadget, udc->driver);
417421 } else {
418422 dev_err(dev, "unsupported command '%s'\n", buf);
419423 return -EINVAL;
drivers/usb/gadget/uvc.h+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828
2929 struct uvc_request_data
3030 {
31− unsigned int length;
31+ __s32 length;
3232 __u8 data[60];
3333 };
3434
drivers/usb/gadget/uvc_queue.c+1−3
@@ -543,11 +543,11 @@ done: · 542 unmodified lines
543543 return ret;
544544 }
545545
546+/* called with queue->irqlock held.. */
546547 static struct uvc_buffer *
547548 uvc_queue_next_buffer(struct uvc_video_queue *queue, struct uvc_buffer *buf)
548549 {
549550 struct uvc_buffer *nextbuf;
550− unsigned long flags;
551551
552552 if ((queue->flags & UVC_QUEUE_DROP_INCOMPLETE) &&
553553 buf->buf.length != buf->buf.bytesused) {
@@ -556,14 +556,12 @@ uvc_queue_next_buffer(struct uvc_video_queue *queue, struct uvc_buffer *buf) · 2 unmodified lines
556556 return buf;
557557 }
558558
559− spin_lock_irqsave(&queue->irqlock, flags);
560559 list_del(&buf->queue);
561560 if (!list_empty(&queue->irqqueue))
562561 nextbuf = list_first_entry(&queue->irqqueue, struct uvc_buffer,
563562 queue);
564563 else
565564 nextbuf = NULL;
566− spin_unlock_irqrestore(&queue->irqlock, flags);
567565
568566 buf->buf.sequence = queue->sequence++;
569567 do_gettimeofday(&buf->buf.timestamp);
drivers/usb/gadget/uvc_v4l2.c+1−1
@@ -39,7 +39,7 @@ uvc_send_response(struct uvc_device *uvc, struct uvc_request_data *data) · 38 unmodified lines
3939 if (data->length < 0)
4040 return usb_ep_set_halt(cdev->gadget->ep0);
4141
42− req->length = min(uvc->event_length, data->length);
42+ req->length = min_t(unsigned int, uvc->event_length, data->length);
4343 req->zero = data->length < uvc->event_length;
4444 req->dma = DMA_ADDR_INVALID;
4545
drivers/usb/host/ehci-fsl.c+6−1
@@ -218,6 +218,9 @@ static void ehci_fsl_setup_phy(struct ehci_hcd *ehci, · 217 unmodified lines
218218 u32 portsc;
219219 struct usb_hcd *hcd = ehci_to_hcd(ehci);
220220 void __iomem *non_ehci = hcd->regs;
221+ struct fsl_usb2_platform_data *pdata;
222+
223+ pdata = hcd->self.controller->platform_data;
221224
222225 portsc = ehci_readl(ehci, &ehci->regs->port_status[port_offset]);
223226 portsc &= ~(PORT_PTS_MSK | PORT_PTS_PTW);
@@ -234,7 +237,9 @@ static void ehci_fsl_setup_phy(struct ehci_hcd *ehci, · 10 unmodified lines
234237 /* fall through */
235238 case FSL_USB2_PHY_UTMI:
236239 /* enable UTMI PHY */
237− setbits32(non_ehci + FSL_SOC_USB_CTRL, CTRL_UTMI_PHY_EN);
240+ if (pdata->have_sysif_regs)
241+ setbits32(non_ehci + FSL_SOC_USB_CTRL,
242+ CTRL_UTMI_PHY_EN);
238243 portsc |= PORT_PTS_UTMI;
239244 break;
240245 case FSL_USB2_PHY_NONE:
drivers/usb/host/ehci-hcd.c+10−2
@@ -347,6 +347,8 @@ static int ehci_reset (struct ehci_hcd *ehci) · 346 unmodified lines
347347 if (ehci->debug)
348348 dbgp_external_startup();
349349
350+ ehci->port_c_suspend = ehci->suspended_ports =
351+ ehci->resuming_ports = 0;
350352 return retval;
351353 }
352354
@@ -856,8 +858,13 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd) · 503 unmodified lines
856858 goto dead;
857859 }
858860
861+ /*
862+ * We don't use STS_FLR, but some controllers don't like it to
863+ * remain on, so mask it out along with the other status bits.
864+ */
865+ masked_status = status & (INTR_MASK | STS_FLR);
866+
859867 /* Shared IRQ? */
860− masked_status = status & INTR_MASK;
861868 if (!masked_status || unlikely(ehci->rh_state == EHCI_RH_HALTED)) {
862869 spin_unlock(&ehci->lock);
863870 return IRQ_NONE;
@@ -908,7 +915,7 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd) · 44 unmodified lines
908915 pcd_status = status;
909916
910917 /* resume root hub? */
911− if (!(cmd & CMD_RUN))
918+ if (ehci->rh_state == EHCI_RH_SUSPENDED)
912919 usb_hcd_resume_root_hub(hcd);
913920
914921 /* get per-port change detect bits */
@@ -939,6 +946,7 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd) · 24 unmodified lines
939946 * like usb_port_resume() does.
940947 */
941948 ehci->reset_done[i] = jiffies + msecs_to_jiffies(25);
949+ set_bit(i, &ehci->resuming_ports);
942950 ehci_dbg (ehci, "port %d remote wakeup\n", i + 1);
943951 mod_timer(&hcd->rh_timer, ehci->reset_done[i]);
944952 }
drivers/usb/host/ehci-hub.c+16−15
@@ -223,15 +223,10 @@ static int ehci_bus_suspend (struct usb_hcd *hcd) · 222 unmodified lines
223223 * remote wakeup, we must fail the suspend.
224224 */
225225 if (hcd->self.root_hub->do_remote_wakeup) {
226− port = HCS_N_PORTS(ehci->hcs_params);
227− while (port--) {
228− if (ehci->reset_done[port] != 0) {
229− spin_unlock_irq(&ehci->lock);
230− ehci_dbg(ehci, "suspend failed because "
231− "port %d is resuming\n",
232− port + 1);
233− return -EBUSY;
234− }
226+ if (ehci->resuming_ports) {
227+ spin_unlock_irq(&ehci->lock);
228+ ehci_dbg(ehci, "suspend failed because a port is resuming\n");
229+ return -EBUSY;
235230 }
236231 }
237232
@@ -554,16 +549,12 @@ static int · 316 unmodified lines
554549 ehci_hub_status_data (struct usb_hcd *hcd, char *buf)
555550 {
556551 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
557− u32 temp, status = 0;
552+ u32 temp, status;
558553 u32 mask;
559554 int ports, i, retval = 1;
560555 unsigned long flags;
561556 u32 ppcd = 0;
562557
563− /* if !USB_SUSPEND, root hub timers won't get shut down ... */
564− if (ehci->rh_state != EHCI_RH_RUNNING)
565− return 0;
566−
567558 /* init status to no-changes */
568559 buf [0] = 0;
569560 ports = HCS_N_PORTS (ehci->hcs_params);
@@ -572,6 +563,11 @@ ehci_hub_status_data (struct usb_hcd *hcd, char *buf) · 2 unmodified lines
572563 retval++;
573564 }
574565
566+ /* Inform the core about resumes-in-progress by returning
567+ * a non-zero value even if there are no status changes.
568+ */
569+ status = ehci->resuming_ports;
570+
575571 /* Some boards (mostly VIA?) report bogus overcurrent indications,
576572 * causing massive log spam unless we completely ignore them. It
577573 * may be relevant that VIA VT8235 controllers, where PORT_POWER is
@@ -846,6 +842,7 @@ static int ehci_hub_control ( · 268 unmodified lines
846842 ehci_writel(ehci,
847843 temp & ~(PORT_RWC_BITS | PORT_RESUME),
848844 status_reg);
845+ clear_bit(wIndex, &ehci->resuming_ports);
849846 retval = handshake(ehci, status_reg,
850847 PORT_RESUME, 0, 2000 /* 2msec */);
851848 if (retval != 0) {
@@ -864,6 +861,7 @@ static int ehci_hub_control ( · 12 unmodified lines
864861 ehci->reset_done[wIndex])) {
865862 status |= USB_PORT_STAT_C_RESET << 16;
866863 ehci->reset_done [wIndex] = 0;
864+ clear_bit(wIndex, &ehci->resuming_ports);
867865
868866 /* force reset to complete */
869867 ehci_writel(ehci, temp & ~(PORT_RWC_BITS | PORT_RESET),
@@ -884,8 +882,10 @@ static int ehci_hub_control ( · 14 unmodified lines
884882 ehci_readl(ehci, status_reg));
885883 }
886884
887− if (!(temp & (PORT_RESUME|PORT_RESET)))
885+ if (!(temp & (PORT_RESUME|PORT_RESET))) {
888886 ehci->reset_done[wIndex] = 0;
887+ clear_bit(wIndex, &ehci->resuming_ports);
888+ }
889889
890890 /* transfer dedicated ports to the companion hc */
891891 if ((temp & PORT_CONNECT) &&
@@ -920,6 +920,7 @@ static int ehci_hub_control ( · 28 unmodified lines
920920 status |= USB_PORT_STAT_SUSPEND;
921921 } else if (test_bit(wIndex, &ehci->suspended_ports)) {
922922 clear_bit(wIndex, &ehci->suspended_ports);
923+ clear_bit(wIndex, &ehci->resuming_ports);
923924 ehci->reset_done[wIndex] = 0;
924925 if (temp & PORT_PE)
925926 set_bit(wIndex, &ehci->port_c_suspend);
drivers/usb/host/ehci-omap.c+37−2
@@ -42,6 +42,7 @@ · 41 unmodified lines
4242 #include <plat/usb.h>
4343 #include <linux/regulator/consumer.h>
4444 #include <linux/pm_runtime.h>
45+#include <linux/gpio.h>
4546
4647 /* EHCI Register Set */
4748 #define EHCI_INSNREG04 (0xA0)
@@ -191,6 +192,19 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) · 143 unmodified lines
191192 }
192193 }
193194
195+ if (pdata->phy_reset) {
196+ if (gpio_is_valid(pdata->reset_gpio_port[0]))
197+ gpio_request_one(pdata->reset_gpio_port[0],
198+ GPIOF_OUT_INIT_LOW, "USB1 PHY reset");
199+
200+ if (gpio_is_valid(pdata->reset_gpio_port[1]))
201+ gpio_request_one(pdata->reset_gpio_port[1],
202+ GPIOF_OUT_INIT_LOW, "USB2 PHY reset");
203+
204+ /* Hold the PHY in RESET for enough time till DIR is high */
205+ udelay(10);
206+ }
207+
194208 pm_runtime_enable(dev);
195209 pm_runtime_get_sync(dev);
196210
@@ -237,6 +251,19 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) · 40 unmodified lines
237251 /* root ports should always stay powered */
238252 ehci_port_power(omap_ehci, 1);
239253
254+ if (pdata->phy_reset) {
255+ /* Hold the PHY in RESET for enough time till
256+ * PHY is settled and ready
257+ */
258+ udelay(10);
259+
260+ if (gpio_is_valid(pdata->reset_gpio_port[0]))
261+ gpio_set_value(pdata->reset_gpio_port[0], 1);
262+
263+ if (gpio_is_valid(pdata->reset_gpio_port[1]))
264+ gpio_set_value(pdata->reset_gpio_port[1], 1);
265+ }
266+
240267 return 0;
241268
242269 err_add_hcd:
@@ -259,8 +286,9 @@ err_io: · 16 unmodified lines
259286 */
260287 static int ehci_hcd_omap_remove(struct platform_device *pdev)
261288 {
262− struct device *dev = &pdev->dev;
263− struct usb_hcd *hcd = dev_get_drvdata(dev);
289+ struct device *dev = &pdev->dev;
290+ struct usb_hcd *hcd = dev_get_drvdata(dev);
291+ struct ehci_hcd_omap_platform_data *pdata = dev->platform_data;
264292
265293 usb_remove_hcd(hcd);
266294 disable_put_regulator(dev->platform_data);
@@ -269,6 +297,13 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev) · 2 unmodified lines
269297 pm_runtime_put_sync(dev);
270298 pm_runtime_disable(dev);
271299
300+ if (pdata->phy_reset) {
301+ if (gpio_is_valid(pdata->reset_gpio_port[0]))
302+ gpio_free(pdata->reset_gpio_port[0]);
303+
304+ if (gpio_is_valid(pdata->reset_gpio_port[1]))
305+ gpio_free(pdata->reset_gpio_port[1]);
306+ }
272307 return 0;
273308 }
274309
drivers/usb/host/ehci-pci.c+8−0
@@ -144,6 +144,14 @@ static int ehci_pci_setup(struct usb_hcd *hcd) · 143 unmodified lines
144144 hcd->has_tt = 1;
145145 tdi_reset(ehci);
146146 }
147+ if (pdev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK) {
148+ /* EHCI #1 or #2 on 6 Series/C200 Series chipset */
149+ if (pdev->device == 0x1c26 || pdev->device == 0x1c2d) {
150+ ehci_info(ehci, "broken D3 during system sleep on ASUS\n");
151+ hcd->broken_pci_sleep = 1;
152+ device_set_wakeup_capable(&pdev->dev, false);
153+ }
154+ }
147155 break;
148156 case PCI_VENDOR_ID_TDI:
149157 if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
drivers/usb/host/ehci-tegra.c+2−1
@@ -224,6 +224,7 @@ static int tegra_ehci_hub_control( · 223 unmodified lines
224224 temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS);
225225 /* start resume signalling */
226226 ehci_writel(ehci, temp | PORT_RESUME, status_reg);
227+ set_bit(wIndex-1, &ehci->resuming_ports);
227228
228229 spin_unlock_irqrestore(&ehci->lock, flags);
229230 msleep(20);
@@ -236,6 +237,7 @@ static int tegra_ehci_hub_control( · 6 unmodified lines
236237 pr_err("%s: timeout waiting for SUSPEND\n", __func__);
237238
238239 ehci->reset_done[wIndex-1] = 0;
240+ clear_bit(wIndex-1, &ehci->resuming_ports);
239241
240242 tegra->port_resuming = 1;
241243 goto done;
@@ -729,7 +731,6 @@ static int tegra_ehci_probe(struct platform_device *pdev) · 487 unmodified lines
729731 err = -ENODEV;
730732 goto fail;
731733 }
732− set_irq_flags(irq, IRQF_VALID);
733734
734735 #ifdef CONFIG_USB_OTG_UTILS
735736 if (pdata->operating_mode == TEGRA_USB_OTG) {
drivers/usb/host/ehci.h+2−0
@@ -117,6 +117,8 @@ struct ehci_hcd { /* one per controller */ · 116 unmodified lines
117117 the change-suspend feature turned on */
118118 unsigned long suspended_ports; /* which ports are
119119 suspended */
120+ unsigned long resuming_ports; /* which ports have
121+ started to resume */
120122
121123 /* per-HC memory pools (could be per-bus, but ...) */
122124 struct dma_pool *qh_pool; /* qh per active urb */
drivers/usb/host/ohci-at91.c+6−6
@@ -94,7 +94,7 @@ static void at91_stop_hc(struct platform_device *pdev) · 93 unmodified lines
9494
9595 /*-------------------------------------------------------------------------*/
9696
97−static void usb_hcd_at91_remove (struct usb_hcd *, struct platform_device *);
97+static void __devexit usb_hcd_at91_remove (struct usb_hcd *, struct platform_device *);
9898
9999 /* configure so an HC device and id are always provided */
100100 /* always called with process context; sleeping is OK */
@@ -108,7 +108,7 @@ static void usb_hcd_at91_remove (struct usb_hcd *, struct platform_device *); · 7 unmodified lines
108108 * then invokes the start() method for the HCD associated with it
109109 * through the hotplug entry's driver_data.
110110 */
111−static int usb_hcd_at91_probe(const struct hc_driver *driver,
111+static int __devinit usb_hcd_at91_probe(const struct hc_driver *driver,
112112 struct platform_device *pdev)
113113 {
114114 int retval;
@@ -203,7 +203,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, · 88 unmodified lines
203203 * context, "rmmod" or something similar.
204204 *
205205 */
206−static void usb_hcd_at91_remove(struct usb_hcd *hcd,
206+static void __devexit usb_hcd_at91_remove(struct usb_hcd *hcd,
207207 struct platform_device *pdev)
208208 {
209209 usb_remove_hcd(hcd);
@@ -545,7 +545,7 @@ static int __devinit ohci_at91_of_init(struct platform_device *pdev) · 335 unmodified lines
545545
546546 /*-------------------------------------------------------------------------*/
547547
548−static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
548+static int __devinit ohci_hcd_at91_drv_probe(struct platform_device *pdev)
549549 {
550550 struct at91_usbh_data *pdata;
551551 int i;
@@ -620,7 +620,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) · 68 unmodified lines
620620 return usb_hcd_at91_probe(&ohci_at91_hc_driver, pdev);
621621 }
622622
623−static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)
623+static int __devexit ohci_hcd_at91_drv_remove(struct platform_device *pdev)
624624 {
625625 struct at91_usbh_data *pdata = pdev->dev.platform_data;
626626 int i;
@@ -696,7 +696,7 @@ MODULE_ALIAS("platform:at91_ohci"); · 69 unmodified lines
696696
697697 static struct platform_driver ohci_hcd_at91_driver = {
698698 .probe = ohci_hcd_at91_drv_probe,
699− .remove = ohci_hcd_at91_drv_remove,
699+ .remove = __devexit_p(ohci_hcd_at91_drv_remove),
700700 .shutdown = usb_hcd_platform_shutdown,
701701 .suspend = ohci_hcd_at91_drv_suspend,
702702 .resume = ohci_hcd_at91_drv_resume,
drivers/usb/host/pci-quirks.c+7−3
@@ -825,9 +825,13 @@ static void __devinit quirk_usb_handoff_xhci(struct pci_dev *pdev) · 824 unmodified lines
825825 }
826826 }
827827
828− /* Disable any BIOS SMIs */
829− writel(XHCI_LEGACY_DISABLE_SMI,
830− base + ext_cap_offset + XHCI_LEGACY_CONTROL_OFFSET);
828+ val = readl(base + ext_cap_offset + XHCI_LEGACY_CONTROL_OFFSET);
829+ /* Mask off (turn off) any enabled SMIs */
830+ val &= XHCI_LEGACY_DISABLE_SMI;
831+ /* Mask all SMI events bits, RW1C */
832+ val |= XHCI_LEGACY_SMI_EVENTS;
833+ /* Disable any BIOS SMIs and clear all SMI events*/
834+ writel(val, base + ext_cap_offset + XHCI_LEGACY_CONTROL_OFFSET);
831835
832836 if (usb_is_intel_switchable_xhci(pdev))
833837 usb_enable_xhci_ports(pdev);
drivers/usb/host/uhci-hub.c+3−2
@@ -196,11 +196,12 @@ static int uhci_hub_status_data(struct usb_hcd *hcd, char *buf) · 195 unmodified lines
196196 status = get_hub_status_data(uhci, buf);
197197
198198 switch (uhci->rh_state) {
199− case UHCI_RH_SUSPENDING:
200199 case UHCI_RH_SUSPENDED:
201200 /* if port change, ask to be resumed */
202− if (status || uhci->resuming_ports)
201+ if (status || uhci->resuming_ports) {
202+ status = 1;
203203 usb_hcd_resume_root_hub(hcd);
204+ }
204205 break;
205206
206207 case UHCI_RH_AUTO_STOPPED:
drivers/usb/host/xhci-dbg.c+1−1
@@ -119,7 +119,7 @@ static void xhci_print_command_reg(struct xhci_hcd *xhci) · 118 unmodified lines
119119 xhci_dbg(xhci, " Event Interrupts %s\n",
120120 (temp & CMD_EIE) ? "enabled " : "disabled");
121121 xhci_dbg(xhci, " Host System Error Interrupts %s\n",
122− (temp & CMD_EIE) ? "enabled " : "disabled");
122+ (temp & CMD_HSEIE) ? "enabled " : "disabled");
123123 xhci_dbg(xhci, " HC has %sfinished light reset\n",
124124 (temp & CMD_LRESET) ? "not " : "");
125125 }
drivers/usb/host/xhci-ext-caps.h+3−2
@@ -62,8 +62,9 @@ · 61 unmodified lines
6262 /* USB Legacy Support Control and Status Register - section 7.1.2 */
6363 /* Add this offset, plus the value of xECP in HCCPARAMS to the base address */
6464 #define XHCI_LEGACY_CONTROL_OFFSET (0x04)
65−/* bits 1:2, 5:12, and 17:19 need to be preserved; bits 21:28 should be zero */
66−#define XHCI_LEGACY_DISABLE_SMI ((0x3 << 1) + (0xff << 5) + (0x7 << 17))
65+/* bits 1:3, 5:12, and 17:19 need to be preserved; bits 21:28 should be zero */
66+#define XHCI_LEGACY_DISABLE_SMI ((0x7 << 1) + (0xff << 5) + (0x7 << 17))
67+#define XHCI_LEGACY_SMI_EVENTS (0x7 << 29)
6768
6869 /* USB 2.0 xHCI 0.96 L1C capability - section 7.2.2.1.3.2 */
6970 #define XHCI_L1C (1 << 16)
drivers/usb/host/xhci-mem.c+2−7
@@ -1796,11 +1796,6 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) · 1795 unmodified lines
17961796 int i;
17971797
17981798 /* Free the Event Ring Segment Table and the actual Event Ring */
1799− if (xhci->ir_set) {
1800− xhci_writel(xhci, 0, &xhci->ir_set->erst_size);
1801− xhci_write_64(xhci, 0, &xhci->ir_set->erst_base);
1802− xhci_write_64(xhci, 0, &xhci->ir_set->erst_dequeue);
1803− }
18041799 size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries);
18051800 if (xhci->erst.entries)
18061801 dma_free_coherent(&pdev->dev, size,
@@ -1812,7 +1807,6 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) · 5 unmodified lines
18121807 xhci->event_ring = NULL;
18131808 xhci_dbg(xhci, "Freed event ring\n");
18141809
1815− xhci_write_64(xhci, 0, &xhci->op_regs->cmd_ring);
18161810 if (xhci->cmd_ring)
18171811 xhci_ring_free(xhci, xhci->cmd_ring);
18181812 xhci->cmd_ring = NULL;
@@ -1841,7 +1835,6 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) · 22 unmodified lines
18411835 xhci->medium_streams_pool = NULL;
18421836 xhci_dbg(xhci, "Freed medium stream array pool\n");
18431837
1844− xhci_write_64(xhci, 0, &xhci->op_regs->dcbaa_ptr);
18451838 if (xhci->dcbaa)
18461839 dma_free_coherent(&pdev->dev, sizeof(*xhci->dcbaa),
18471840 xhci->dcbaa, xhci->dcbaa->dma);
@@ -2459,6 +2452,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) · 611 unmodified lines
24592452
24602453 fail:
24612454 xhci_warn(xhci, "Couldn't initialize memory\n");
2455+ xhci_halt(xhci);
2456+ xhci_reset(xhci);
24622457 xhci_mem_cleanup(xhci);
24632458 return -ENOMEM;
24642459 }
drivers/usb/host/xhci-pci.c+3−1
@@ -95,6 +95,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) · 94 unmodified lines
9595 xhci->quirks |= XHCI_RESET_ON_RESUME;
9696 xhci_dbg(xhci, "QUIRK: Resetting on resume\n");
9797 }
98+ if (pdev->vendor == PCI_VENDOR_ID_VIA)
99+ xhci->quirks |= XHCI_RESET_ON_RESUME;
98100 }
99101
100102 /* called during probe() after chip reset completes */
@@ -326,7 +328,7 @@ int __init xhci_register_pci(void) · 225 unmodified lines
326328 return pci_register_driver(&xhci_pci_driver);
327329 }
328330
329−void __exit xhci_unregister_pci(void)
331+void xhci_unregister_pci(void)
330332 {
331333 pci_unregister_driver(&xhci_pci_driver);
332334 }
drivers/usb/host/xhci-ring.c+3−3
@@ -2417,7 +2417,7 @@ hw_died: · 2416 unmodified lines
24172417 u32 irq_pending;
24182418 /* Acknowledge the PCI interrupt */
24192419 irq_pending = xhci_readl(xhci, &xhci->ir_set->irq_pending);
2420− irq_pending |= 0x3;
2420+ irq_pending |= IMAN_IP;
24212421 xhci_writel(xhci, irq_pending, &xhci->ir_set->irq_pending);
24222422 }
24232423
@@ -2734,7 +2734,7 @@ int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags, · 310 unmodified lines
27342734 urb->dev->speed == USB_SPEED_FULL)
27352735 urb->interval /= 8;
27362736 }
2737− return xhci_queue_bulk_tx(xhci, GFP_ATOMIC, urb, slot_id, ep_index);
2737+ return xhci_queue_bulk_tx(xhci, mem_flags, urb, slot_id, ep_index);
27382738 }
27392739
27402740 /*
@@ -3514,7 +3514,7 @@ int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags, · 773 unmodified lines
35143514 }
35153515 ep_ring->num_trbs_free_temp = ep_ring->num_trbs_free;
35163516
3517− return xhci_queue_isoc_tx(xhci, GFP_ATOMIC, urb, slot_id, ep_index);
3517+ return xhci_queue_isoc_tx(xhci, mem_flags, urb, slot_id, ep_index);
35183518 }
35193519
35203520 /**** Command Ring Operations ****/
drivers/usb/host/xhci.c+8−4
@@ -106,6 +106,9 @@ int xhci_halt(struct xhci_hcd *xhci) · 105 unmodified lines
106106 STS_HALT, STS_HALT, XHCI_MAX_HALT_USEC);
107107 if (!ret)
108108 xhci->xhc_state |= XHCI_STATE_HALTED;
109+ else
110+ xhci_warn(xhci, "Host not halted after %u microseconds.\n",
111+ XHCI_MAX_HALT_USEC);
109112 return ret;
110113 }
111114
@@ -664,11 +667,11 @@ static void xhci_save_registers(struct xhci_hcd *xhci) · 552 unmodified lines
664667 xhci->s3.dev_nt = xhci_readl(xhci, &xhci->op_regs->dev_notification);
665668 xhci->s3.dcbaa_ptr = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr);
666669 xhci->s3.config_reg = xhci_readl(xhci, &xhci->op_regs->config_reg);
667− xhci->s3.irq_pending = xhci_readl(xhci, &xhci->ir_set->irq_pending);
668− xhci->s3.irq_control = xhci_readl(xhci, &xhci->ir_set->irq_control);
669670 xhci->s3.erst_size = xhci_readl(xhci, &xhci->ir_set->erst_size);
670671 xhci->s3.erst_base = xhci_read_64(xhci, &xhci->ir_set->erst_base);
671672 xhci->s3.erst_dequeue = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
673+ xhci->s3.irq_pending = xhci_readl(xhci, &xhci->ir_set->irq_pending);
674+ xhci->s3.irq_control = xhci_readl(xhci, &xhci->ir_set->irq_control);
672675 }
673676
674677 static void xhci_restore_registers(struct xhci_hcd *xhci)
@@ -677,10 +680,11 @@ static void xhci_restore_registers(struct xhci_hcd *xhci) · 2 unmodified lines
677680 xhci_writel(xhci, xhci->s3.dev_nt, &xhci->op_regs->dev_notification);
678681 xhci_write_64(xhci, xhci->s3.dcbaa_ptr, &xhci->op_regs->dcbaa_ptr);
679682 xhci_writel(xhci, xhci->s3.config_reg, &xhci->op_regs->config_reg);
680− xhci_writel(xhci, xhci->s3.irq_pending, &xhci->ir_set->irq_pending);
681− xhci_writel(xhci, xhci->s3.irq_control, &xhci->ir_set->irq_control);
682683 xhci_writel(xhci, xhci->s3.erst_size, &xhci->ir_set->erst_size);
683684 xhci_write_64(xhci, xhci->s3.erst_base, &xhci->ir_set->erst_base);
685+ xhci_write_64(xhci, xhci->s3.erst_dequeue, &xhci->ir_set->erst_dequeue);
686+ xhci_writel(xhci, xhci->s3.irq_pending, &xhci->ir_set->irq_pending);
687+ xhci_writel(xhci, xhci->s3.irq_control, &xhci->ir_set->irq_control);
684688 }
685689
686690 static void xhci_set_cmd_ring_deq(struct xhci_hcd *xhci)
drivers/usb/host/xhci.h+4−0
@@ -205,6 +205,10 @@ struct xhci_op_regs { · 204 unmodified lines
205205 #define CMD_PM_INDEX (1 << 11)
206206 /* bits 12:31 are reserved (and should be preserved on writes). */
207207
208+/* IMAN - Interrupt Management Register */
209+#define IMAN_IP (1 << 1)
210+#define IMAN_IE (1 << 0)
211+
208212 /* USBSTS - USB status - status bitmasks */
209213 /* HC not running - set to 1 when run/stop bit is cleared. */
210214 #define STS_HALT XHCI_STS_HALT
drivers/usb/misc/usbtest.c+6−3
@@ -423,7 +423,7 @@ alloc_sglist(int nents, int max, int vary) · 422 unmodified lines
423423 unsigned i;
424424 unsigned size = max;
425425
426− sg = kmalloc(nents * sizeof *sg, GFP_KERNEL);
426+ sg = kmalloc_array(nents, sizeof *sg, GFP_KERNEL);
427427 if (!sg)
428428 return NULL;
429429 sg_init_table(sg, nents);
@@ -904,6 +904,9 @@ test_ctrl_queue(struct usbtest_dev *dev, struct usbtest_param *param) · 474 unmodified lines
904904 struct ctrl_ctx context;
905905 int i;
906906
907+ if (param->sglen == 0 || param->iterations > UINT_MAX / param->sglen)
908+ return -EOPNOTSUPP;
909+
907910 spin_lock_init(&context.lock);
908911 context.dev = dev;
909912 init_completion(&context.complete);
@@ -1981,8 +1984,6 @@ usbtest_ioctl(struct usb_interface *intf, unsigned int code, void *buf) · 1071 unmodified lines
19811984
19821985 /* queued control messaging */
19831986 case 10:
1984− if (param->sglen == 0)
1985− break;
19861987 retval = 0;
19871988 dev_info(&intf->dev,
19881989 "TEST 10: queue %d control calls, %d times\n",
@@ -2276,6 +2277,8 @@ usbtest_probe(struct usb_interface *intf, const struct usb_device_id *id) · 287 unmodified lines
22762277 if (status < 0) {
22772278 WARNING(dev, "couldn't get endpoints, %d\n",
22782279 status);
2280+ kfree(dev->buf);
2281+ kfree(dev);
22792282 return status;
22802283 }
22812284 /* may find bulk or ISO pipes */
drivers/usb/misc/yurex.c+3−7
@@ -99,9 +99,7 @@ static void yurex_delete(struct kref *kref) · 98 unmodified lines
9999 usb_put_dev(dev->udev);
100100 if (dev->cntl_urb) {
101101 usb_kill_urb(dev->cntl_urb);
102− if (dev->cntl_req)
103− usb_free_coherent(dev->udev, YUREX_BUF_SIZE,
104− dev->cntl_req, dev->cntl_urb->setup_dma);
102+ kfree(dev->cntl_req);
105103 if (dev->cntl_buffer)
106104 usb_free_coherent(dev->udev, YUREX_BUF_SIZE,
107105 dev->cntl_buffer, dev->cntl_urb->transfer_dma);
@@ -234,9 +232,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ · 126 unmodified lines
234232 }
235233
236234 /* allocate buffer for control req */
237− dev->cntl_req = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE,
238− GFP_KERNEL,
239− &dev->cntl_urb->setup_dma);
235+ dev->cntl_req = kmalloc(YUREX_BUF_SIZE, GFP_KERNEL);
240236 if (!dev->cntl_req) {
241237 err("Could not allocate cntl_req");
242238 goto error;
@@ -286,7 +282,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ · 43 unmodified lines
286282 usb_rcvintpipe(dev->udev, dev->int_in_endpointAddr),
287283 dev->int_buffer, YUREX_BUF_SIZE, yurex_interrupt,
288284 dev, 1);
289− dev->cntl_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
285+ dev->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
290286 if (usb_submit_urb(dev->urb, GFP_KERNEL)) {
291287 retval = -EIO;
292288 err("Could not submitting URB");
drivers/usb/musb/davinci.c+2−1
@@ -386,7 +386,7 @@ static int davinci_musb_init(struct musb *musb) · 385 unmodified lines
386386 usb_nop_xceiv_register();
387387 musb->xceiv = usb_get_transceiver();
388388 if (!musb->xceiv)
389− return -ENODEV;
389+ goto unregister;
390390
391391 musb->mregs += DAVINCI_BASE_OFFSET;
392392
@@ -444,6 +444,7 @@ static int davinci_musb_init(struct musb *musb) · 51 unmodified lines
444444
445445 fail:
446446 usb_put_transceiver(musb->xceiv);
447+unregister:
447448 usb_nop_xceiv_unregister();
448449 return -ENODEV;
449450 }
drivers/usb/musb/musb_core.c+33−7
@@ -137,6 +137,9 @@ static int musb_ulpi_read(struct usb_phy *phy, u32 offset) · 136 unmodified lines
137137 int i = 0;
138138 u8 r;
139139 u8 power;
140+ int ret;
141+
142+ pm_runtime_get_sync(phy->io_dev);
140143
141144 /* Make sure the transceiver is not in low power mode */
142145 power = musb_readb(addr, MUSB_POWER);
@@ -154,15 +157,22 @@ static int musb_ulpi_read(struct usb_phy *phy, u32 offset) · 11 unmodified lines
154157 while (!(musb_readb(addr, MUSB_ULPI_REG_CONTROL)
155158 & MUSB_ULPI_REG_CMPLT)) {
156159 i++;
157− if (i == 10000)
158− return -ETIMEDOUT;
160+ if (i == 10000) {
161+ ret = -ETIMEDOUT;
162+ goto out;
163+ }
159164
160165 }
161166 r = musb_readb(addr, MUSB_ULPI_REG_CONTROL);
162167 r &= ~MUSB_ULPI_REG_CMPLT;
163168 musb_writeb(addr, MUSB_ULPI_REG_CONTROL, r);
164169
165− return musb_readb(addr, MUSB_ULPI_REG_DATA);
170+ ret = musb_readb(addr, MUSB_ULPI_REG_DATA);
171+
172+out:
173+ pm_runtime_put(phy->io_dev);
174+
175+ return ret;
166176 }
167177
168178 static int musb_ulpi_write(struct usb_phy *phy, u32 offset, u32 data)
@@ -171,6 +181,9 @@ static int musb_ulpi_write(struct usb_phy *phy, u32 offset, u32 data) · 2 unmodified lines
171181 int i = 0;
172182 u8 r = 0;
173183 u8 power;
184+ int ret = 0;
185+
186+ pm_runtime_get_sync(phy->io_dev);
174187
175188 /* Make sure the transceiver is not in low power mode */
176189 power = musb_readb(addr, MUSB_POWER);
@@ -184,15 +197,20 @@ static int musb_ulpi_write(struct usb_phy *phy, u32 offset, u32 data) · 7 unmodified lines
184197 while (!(musb_readb(addr, MUSB_ULPI_REG_CONTROL)
185198 & MUSB_ULPI_REG_CMPLT)) {
186199 i++;
187− if (i == 10000)
188− return -ETIMEDOUT;
200+ if (i == 10000) {
201+ ret = -ETIMEDOUT;
202+ goto out;
203+ }
189204 }
190205
191206 r = musb_readb(addr, MUSB_ULPI_REG_CONTROL);
192207 r &= ~MUSB_ULPI_REG_CMPLT;
193208 musb_writeb(addr, MUSB_ULPI_REG_CONTROL, r);
194209
195− return 0;
210+out:
211+ pm_runtime_put(phy->io_dev);
212+
213+ return ret;
196214 }
197215 #else
198216 #define musb_ulpi_read NULL
@@ -1904,14 +1922,17 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) · 1705 unmodified lines
19041922
19051923 if (!musb->isr) {
19061924 status = -ENODEV;
1907− goto fail3;
1925+ goto fail2;
19081926 }
19091927
19101928 if (!musb->xceiv->io_ops) {
1929+ musb->xceiv->io_dev = musb->controller;
19111930 musb->xceiv->io_priv = musb->mregs;
19121931 musb->xceiv->io_ops = &musb_ulpi_access;
19131932 }
19141933
1934+ pm_runtime_get_sync(musb->controller);
1935+
19151936 #ifndef CONFIG_MUSB_PIO_ONLY
19161937 if (use_dma && dev->dma_mask) {
19171938 struct dma_controller *c;
@@ -2023,6 +2044,8 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) · 105 unmodified lines
20232044 goto fail5;
20242045 #endif
20252046
2047+ pm_runtime_put(musb->controller);
2048+
20262049 dev_info(dev, "USB %s mode controller at %p using %s, IRQ %d\n",
20272050 ({char *s;
20282051 switch (musb->board_mode) {
@@ -2047,6 +2070,9 @@ fail4: · 18 unmodified lines
20472070 musb_gadget_cleanup(musb);
20482071
20492072 fail3:
2073+ pm_runtime_put_sync(musb->controller);
2074+
2075+fail2:
20502076 if (musb->irq_wake)
20512077 device_init_wakeup(dev, 0);
20522078 musb_platform_exit(musb);
drivers/usb/musb/musb_core.h+1−1
@@ -449,7 +449,7 @@ struct musb { · 448 unmodified lines
449449 * We added this flag to forcefully disable double
450450 * buffering until we get it working.
451451 */
452− unsigned double_buffer_not_ok:1 __deprecated;
452+ unsigned double_buffer_not_ok:1;
453453
454454 struct musb_hdrc_config *config;
455455
drivers/usb/musb/musb_host.c+1−1
@@ -2098,7 +2098,7 @@ static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh) · 2097 unmodified lines
20982098 }
20992099
21002100 /* turn off DMA requests, discard state, stop polling ... */
2101− if (is_in) {
2101+ if (ep->epnum && is_in) {
21022102 /* giveback saves bulk toggle */
21032103 csr = musb_h_flush_rxfifo(ep, 0);
21042104
drivers/usb/musb/omap2430.c+18−13
@@ -282,7 +282,8 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work) · 281 unmodified lines
282282
283283 static int omap2430_musb_init(struct musb *musb)
284284 {
285− u32 l, status = 0;
285+ u32 l;
286+ int status = 0;
286287 struct device *dev = musb->controller;
287288 struct musb_hdrc_platform_data *plat = dev->platform_data;
288289 struct omap_musb_board_data *data = plat->board_data;
@@ -301,7 +302,7 @@ static int omap2430_musb_init(struct musb *musb) · 12 unmodified lines
301302
302303 status = pm_runtime_get_sync(dev);
303304 if (status < 0) {
304− dev_err(dev, "pm_runtime_get_sync FAILED");
305+ dev_err(dev, "pm_runtime_get_sync FAILED %d\n", status);
305306 goto err1;
306307 }
307308
@@ -333,6 +334,7 @@ static int omap2430_musb_init(struct musb *musb) · 25 unmodified lines
333334
334335 setup_timer(&musb_idle_timer, musb_do_idle, (unsigned long) musb);
335336
337+ pm_runtime_put_noidle(musb->controller);
336338 return 0;
337339
338340 err1:
@@ -452,14 +454,14 @@ static int __devinit omap2430_probe(struct platform_device *pdev) · 113 unmodified lines
452454 goto err2;
453455 }
454456
457+ pm_runtime_enable(&pdev->dev);
458+
455459 ret = platform_device_add(musb);
456460 if (ret) {
457461 dev_err(&pdev->dev, "failed to register musb device\n");
458462 goto err2;
459463 }
460464
461− pm_runtime_enable(&pdev->dev);
462−
463465 return 0;
464466
465467 err2:
@@ -478,7 +480,6 @@ static int __devexit omap2430_remove(struct platform_device *pdev) · 12 unmodified lines
478480
479481 platform_device_del(glue->musb);
480482 platform_device_put(glue->musb);
481− pm_runtime_put(&pdev->dev);
482483 kfree(glue);
483484
484485 return 0;
@@ -491,11 +492,13 @@ static int omap2430_runtime_suspend(struct device *dev) · 6 unmodified lines
491492 struct omap2430_glue *glue = dev_get_drvdata(dev);
492493 struct musb *musb = glue_to_musb(glue);
493494
494− musb->context.otg_interfsel = musb_readl(musb->mregs,
495− OTG_INTERFSEL);
495+ if (musb) {
496+ musb->context.otg_interfsel = musb_readl(musb->mregs,
497+ OTG_INTERFSEL);
496498
497− omap2430_low_level_exit(musb);
498− usb_phy_set_suspend(musb->xceiv, 1);
499+ omap2430_low_level_exit(musb);
500+ usb_phy_set_suspend(musb->xceiv, 1);
501+ }
499502
500503 return 0;
501504 }
@@ -505,11 +508,13 @@ static int omap2430_runtime_resume(struct device *dev) · 3 unmodified lines
505508 struct omap2430_glue *glue = dev_get_drvdata(dev);
506509 struct musb *musb = glue_to_musb(glue);
507510
508− omap2430_low_level_init(musb);
509− musb_writel(musb->mregs, OTG_INTERFSEL,
510− musb->context.otg_interfsel);
511+ if (musb) {
512+ omap2430_low_level_init(musb);
513+ musb_writel(musb->mregs, OTG_INTERFSEL,
514+ musb->context.otg_interfsel);
511515
512− usb_phy_set_suspend(musb->xceiv, 0);
516+ usb_phy_set_suspend(musb->xceiv, 0);
517+ }
513518
514519 return 0;
515520 }
drivers/usb/otg/gpio_vbus.c+14−1
@@ -96,7 +96,7 @@ static void gpio_vbus_work(struct work_struct *work) · 95 unmodified lines
9696 struct gpio_vbus_data *gpio_vbus =
9797 container_of(work, struct gpio_vbus_data, work);
9898 struct gpio_vbus_mach_info *pdata = gpio_vbus->dev->platform_data;
99− int gpio;
99+ int gpio, status;
100100
101101 if (!gpio_vbus->phy.otg->gadget)
102102 return;
@@ -108,7 +108,9 @@ static void gpio_vbus_work(struct work_struct *work) · 5 unmodified lines
108108 */
109109 gpio = pdata->gpio_pullup;
110110 if (is_vbus_powered(pdata)) {
111+ status = USB_EVENT_VBUS;
111112 gpio_vbus->phy.state = OTG_STATE_B_PERIPHERAL;
113+ gpio_vbus->phy.last_event = status;
112114 usb_gadget_vbus_connect(gpio_vbus->phy.otg->gadget);
113115
114116 /* drawing a "unit load" is *always* OK, except for OTG */
@@ -117,6 +119,9 @@ static void gpio_vbus_work(struct work_struct *work) · 2 unmodified lines
117119 /* optionally enable D+ pullup */
118120 if (gpio_is_valid(gpio))
119121 gpio_set_value(gpio, !pdata->gpio_pullup_inverted);
122+
123+ atomic_notifier_call_chain(&gpio_vbus->phy.notifier,
124+ status, gpio_vbus->phy.otg->gadget);
120125 } else {
121126 /* optionally disable D+ pullup */
122127 if (gpio_is_valid(gpio))
@@ -125,7 +130,12 @@ static void gpio_vbus_work(struct work_struct *work) · 2 unmodified lines
125130 set_vbus_draw(gpio_vbus, 0);
126131
127132 usb_gadget_vbus_disconnect(gpio_vbus->phy.otg->gadget);
133+ status = USB_EVENT_NONE;
128134 gpio_vbus->phy.state = OTG_STATE_B_IDLE;
135+ gpio_vbus->phy.last_event = status;
136+
137+ atomic_notifier_call_chain(&gpio_vbus->phy.notifier,
138+ status, gpio_vbus->phy.otg->gadget);
129139 }
130140 }
131141
@@ -287,6 +297,9 @@ static int __init gpio_vbus_probe(struct platform_device *pdev) · 155 unmodified lines
287297 irq, err);
288298 goto err_irq;
289299 }
300+
301+ ATOMIC_INIT_NOTIFIER_HEAD(&gpio_vbus->phy.notifier);
302+
290303 INIT_WORK(&gpio_vbus->work, gpio_vbus_work);
291304
292305 gpio_vbus->vbus_draw = regulator_get(&pdev->dev, "vbus_draw");
drivers/usb/serial/bus.c+0−5
@@ -60,8 +60,6 @@ static int usb_serial_device_probe(struct device *dev) · 59 unmodified lines
6060 retval = -ENODEV;
6161 goto exit;
6262 }
63− if (port->dev_state != PORT_REGISTERING)
64− goto exit;
6563
6664 driver = port->serial->type;
6765 if (driver->port_probe) {
@@ -98,9 +96,6 @@ static int usb_serial_device_remove(struct device *dev) · 30 unmodified lines
9896 if (!port)
9997 return -ENODEV;
10098
101− if (port->dev_state != PORT_UNREGISTERING)
102− return retval;
103−
10499 device_remove_file(&port->dev, &dev_attr_port_number);
105100
106101 driver = port->serial->type;
drivers/usb/serial/cp210x.c+6−3
@@ -287,7 +287,8 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request, · 286 unmodified lines
287287 /* Issue the request, attempting to read 'size' bytes */
288288 result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
289289 request, REQTYPE_DEVICE_TO_HOST, 0x0000,
290− port_priv->bInterfaceNumber, buf, size, 300);
290+ port_priv->bInterfaceNumber, buf, size,
291+ USB_CTRL_GET_TIMEOUT);
291292
292293 /* Convert data into an array of integers */
293294 for (i = 0; i < length; i++)
@@ -340,12 +341,14 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request, · 46 unmodified lines
340341 result = usb_control_msg(serial->dev,
341342 usb_sndctrlpipe(serial->dev, 0),
342343 request, REQTYPE_HOST_TO_DEVICE, 0x0000,
343− port_priv->bInterfaceNumber, buf, size, 300);
344+ port_priv->bInterfaceNumber, buf, size,
345+ USB_CTRL_SET_TIMEOUT);
344346 } else {
345347 result = usb_control_msg(serial->dev,
346348 usb_sndctrlpipe(serial->dev, 0),
347349 request, REQTYPE_HOST_TO_DEVICE, data[0],
348− port_priv->bInterfaceNumber, NULL, 0, 300);
350+ port_priv->bInterfaceNumber, NULL, 0,
351+ USB_CTRL_SET_TIMEOUT);
349352 }
350353
351354 kfree(buf);
drivers/usb/serial/ftdi_sio.c+20−16
@@ -75,7 +75,8 @@ struct ftdi_private { · 74 unmodified lines
7575 unsigned long last_dtr_rts; /* saved modem control outputs */
7676 struct async_icount icount;
7777 wait_queue_head_t delta_msr_wait; /* Used for TIOCMIWAIT */
78− char prev_status, diff_status; /* Used for TIOCMIWAIT */
78+ char prev_status; /* Used for TIOCMIWAIT */
79+ bool dev_gone; /* Used to abort TIOCMIWAIT */
7980 char transmit_empty; /* If transmitter is empty or not */
8081 struct usb_serial_port *port;
8182 __u16 interface; /* FT2232C, FT2232H or FT4232H port interface
@@ -1681,6 +1682,7 @@ static int ftdi_sio_port_probe(struct usb_serial_port *port) · 1599 unmodified lines
16811682 init_waitqueue_head(&priv->delta_msr_wait);
16821683
16831684 priv->flags = ASYNC_LOW_LATENCY;
1685+ priv->dev_gone = false;
16841686
16851687 if (quirk && quirk->port_probe)
16861688 quirk->port_probe(priv);
@@ -1839,6 +1841,9 @@ static int ftdi_sio_port_remove(struct usb_serial_port *port) · 152 unmodified lines
18391841
18401842 dbg("%s", __func__);
18411843
1844+ priv->dev_gone = true;
1845+ wake_up_interruptible_all(&priv->delta_msr_wait);
1846+
18421847 remove_sysfs_attrs(port);
18431848
18441849 kref_put(&priv->kref, ftdi_sio_priv_release);
@@ -1982,17 +1987,19 @@ static int ftdi_process_packet(struct tty_struct *tty, · 137 unmodified lines
19821987 N.B. packet may be processed more than once, but differences
19831988 are only processed once. */
19841989 status = packet[0] & FTDI_STATUS_B0_MASK;
1985− if (status & FTDI_RS0_CTS)
1986− priv->icount.cts++;
1987− if (status & FTDI_RS0_DSR)
1988− priv->icount.dsr++;
1989− if (status & FTDI_RS0_RI)
1990− priv->icount.rng++;
1991− if (status & FTDI_RS0_RLSD)
1992− priv->icount.dcd++;
19931990 if (status != priv->prev_status) {
1994− priv->diff_status |= status ^ priv->prev_status;
1995− wake_up_interruptible(&priv->delta_msr_wait);
1991+ char diff_status = status ^ priv->prev_status;
1992+
1993+ if (diff_status & FTDI_RS0_CTS)
1994+ priv->icount.cts++;
1995+ if (diff_status & FTDI_RS0_DSR)
1996+ priv->icount.dsr++;
1997+ if (diff_status & FTDI_RS0_RI)
1998+ priv->icount.rng++;
1999+ if (diff_status & FTDI_RS0_RLSD)
2000+ priv->icount.dcd++;
2001+
2002+ wake_up_interruptible_all(&priv->delta_msr_wait);
19962003 priv->prev_status = status;
19972004 }
19982005
@@ -2395,15 +2402,12 @@ static int ftdi_ioctl(struct tty_struct *tty, · 396 unmodified lines
23952402 */
23962403 case TIOCMIWAIT:
23972404 cprev = priv->icount;
2398− while (1) {
2405+ while (!priv->dev_gone) {
23992406 interruptible_sleep_on(&priv->delta_msr_wait);
24002407 /* see if a signal did it */
24012408 if (signal_pending(current))
24022409 return -ERESTARTSYS;
24032410 cnow = priv->icount;
2404− if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr &&
2405− cnow.dcd == cprev.dcd && cnow.cts == cprev.cts)
2406− return -EIO; /* no change => error */
24072411 if (((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) ||
24082412 ((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) ||
24092413 ((arg & TIOCM_CD) && (cnow.dcd != cprev.dcd)) ||
@@ -2412,7 +2416,7 @@ static int ftdi_ioctl(struct tty_struct *tty, · 2 unmodified lines
24122416 }
24132417 cprev = cnow;
24142418 }
2415− /* not reached */
2419+ return -EIO;
24162420 break;
24172421 case TIOCSERGETLSR:
24182422 return get_lsr_info(port, (struct serial_struct __user *)arg);
drivers/usb/serial/metro-usb.c+3−3
@@ -27,8 +27,8 @@ · 26 unmodified lines
2727
2828 /* Product information. */
2929 #define FOCUS_VENDOR_ID 0x0C2E
30−#define FOCUS_PRODUCT_ID 0x0720
31−#define FOCUS_PRODUCT_ID_UNI 0x0710
30+#define FOCUS_PRODUCT_ID_BI 0x0720
31+#define FOCUS_PRODUCT_ID_UNI 0x0700
3232
3333 #define METROUSB_SET_REQUEST_TYPE 0x40
3434 #define METROUSB_SET_MODEM_CTRL_REQUEST 10
@@ -47,7 +47,7 @@ struct metrousb_private { · 12 unmodified lines
4747
4848 /* Device table list. */
4949 static struct usb_device_id id_table[] = {
50− { USB_DEVICE(FOCUS_VENDOR_ID, FOCUS_PRODUCT_ID) },
50+ { USB_DEVICE(FOCUS_VENDOR_ID, FOCUS_PRODUCT_ID_BI) },
5151 { USB_DEVICE(FOCUS_VENDOR_ID, FOCUS_PRODUCT_ID_UNI) },
5252 { }, /* Terminating entry. */
5353 };
drivers/usb/serial/option.c+1−0
@@ -708,6 +708,7 @@ static const struct usb_device_id option_ids[] = { · 707 unmodified lines
708708 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) },
709709 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) },
710710 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED) },
711+ { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED) },
711712 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED3) },
712713 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED4) },
713714 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED5) },
drivers/usb/serial/pl2303.c+1−1
@@ -420,7 +420,7 @@ static void pl2303_set_termios(struct tty_struct *tty, · 419 unmodified lines
420420 control = priv->line_control;
421421 if ((cflag & CBAUD) == B0)
422422 priv->line_control &= ~(CONTROL_DTR | CONTROL_RTS);
423− else
423+ else if ((old_termios->c_cflag & CBAUD) == B0)
424424 priv->line_control |= (CONTROL_DTR | CONTROL_RTS);
425425 if (control != priv->line_control) {
426426 control = priv->line_control;
drivers/usb/serial/sierra.c+4−1
@@ -221,7 +221,7 @@ static const struct sierra_iface_info typeB_interface_list = { · 220 unmodified lines
221221 };
222222
223223 /* 'blacklist' of interfaces not served by this driver */
224−static const u8 direct_ip_non_serial_ifaces[] = { 7, 8, 9, 10, 11 };
224+static const u8 direct_ip_non_serial_ifaces[] = { 7, 8, 9, 10, 11, 19, 20 };
225225 static const struct sierra_iface_info direct_ip_interface_blacklist = {
226226 .infolen = ARRAY_SIZE(direct_ip_non_serial_ifaces),
227227 .ifaceinfo = direct_ip_non_serial_ifaces,
@@ -298,6 +298,9 @@ static const struct usb_device_id id_table[] = { · 70 unmodified lines
298298 /* Sierra Wireless HSPA Non-Composite Device */
299299 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6892, 0xFF, 0xFF, 0xFF)},
300300 { USB_DEVICE(0x1199, 0x6893) }, /* Sierra Wireless Device */
301+ { USB_DEVICE(0x1199, 0x68A2), /* Sierra Wireless MC77xx in QMI mode */
302+ .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
303+ },
301304 { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */
302305 .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
303306 },
drivers/usb/serial/usb-serial.c+10−21
@@ -1059,6 +1059,12 @@ int usb_serial_probe(struct usb_interface *interface, · 1058 unmodified lines
10591059 serial->attached = 1;
10601060 }
10611061
1062+ /* Avoid race with tty_open and serial_install by setting the
1063+ * disconnected flag and not clearing it until all ports have been
1064+ * registered.
1065+ */
1066+ serial->disconnected = 1;
1067+
10621068 if (get_free_serial(serial, num_ports, &minor) == NULL) {
10631069 dev_err(&interface->dev, "No more free serial devices\n");
10641070 goto probe_error;
@@ -1070,19 +1076,16 @@ int usb_serial_probe(struct usb_interface *interface, · 5 unmodified lines
10701076 port = serial->port[i];
10711077 dev_set_name(&port->dev, "ttyUSB%d", port->number);
10721078 dbg ("%s - registering %s", __func__, dev_name(&port->dev));
1073− port->dev_state = PORT_REGISTERING;
10741079 device_enable_async_suspend(&port->dev);
10751080
10761081 retval = device_add(&port->dev);
1077− if (retval) {
1082+ if (retval)
10781083 dev_err(&port->dev, "Error registering port device, "
10791084 "continuing\n");
1080− port->dev_state = PORT_UNREGISTERED;
1081− } else {
1082− port->dev_state = PORT_REGISTERED;
1083− }
10841085 }
10851086
1087+ serial->disconnected = 0;
1088+
10861089 usb_serial_console_init(debug, minor);
10871090
10881091 exit:
@@ -1124,22 +1127,8 @@ void usb_serial_disconnect(struct usb_interface *interface) · 35 unmodified lines
11241127 }
11251128 kill_traffic(port);
11261129 cancel_work_sync(&port->work);
1127− if (port->dev_state == PORT_REGISTERED) {
1128−
1129− /* Make sure the port is bound so that the
1130− * driver's port_remove method is called.
1131− */
1132− if (!port->dev.driver) {
1133− int rc;
1134−
1135− port->dev.driver =
1136− &serial->type->driver;
1137− rc = device_bind_driver(&port->dev);
1138− }
1139− port->dev_state = PORT_UNREGISTERING;
1130+ if (device_is_registered(&port->dev))
11401131 device_del(&port->dev);
1141− port->dev_state = PORT_UNREGISTERED;
1142− }
11431132 }
11441133 }
11451134 serial->type->disconnect(serial);
drivers/usb/storage/usb.c+30−0
@@ -132,6 +132,35 @@ static struct us_unusual_dev for_dynamic_ids = · 131 unmodified lines
132132 #undef COMPLIANT_DEV
133133 #undef USUAL_DEV
134134
135+#ifdef CONFIG_LOCKDEP
136+
137+static struct lock_class_key us_interface_key[USB_MAXINTERFACES];
138+
139+static void us_set_lock_class(struct mutex *mutex,
140+ struct usb_interface *intf)
141+{
142+ struct usb_device *udev = interface_to_usbdev(intf);
143+ struct usb_host_config *config = udev->actconfig;
144+ int i;
145+
146+ for (i = 0; i < config->desc.bNumInterfaces; i++) {
147+ if (config->interface[i] == intf)
148+ break;
149+ }
150+
151+ BUG_ON(i == config->desc.bNumInterfaces);
152+
153+ lockdep_set_class(mutex, &us_interface_key[i]);
154+}
155+
156+#else
157+
158+static void us_set_lock_class(struct mutex *mutex,
159+ struct usb_interface *intf)
160+{
161+}
162+
163+#endif
135164
136165 #ifdef CONFIG_PM /* Minimal support for suspend and resume */
137166
@@ -895,6 +924,7 @@ int usb_stor_probe1(struct us_data **pus, · 757 unmodified lines
895924 *pus = us = host_to_us(host);
896925 memset(us, 0, sizeof(struct us_data));
897926 mutex_init(&(us->dev_mutex));
927+ us_set_lock_class(&us->dev_mutex, intf);
898928 init_completion(&us->cmnd_ready);
899929 init_completion(&(us->notify));
900930 init_waitqueue_head(&us->delay_wait);
drivers/uwb/hwa-rc.c+2−1
@@ -645,7 +645,8 @@ void hwarc_neep_cb(struct urb *urb) · 644 unmodified lines
645645 dev_err(dev, "NEEP: URB error %d\n", urb->status);
646646 }
647647 result = usb_submit_urb(urb, GFP_ATOMIC);
648− if (result < 0) {
648+ if (result < 0 && result != -ENODEV && result != -EPERM) {
649+ /* ignoring unrecoverable errors */
649650 dev_err(dev, "NEEP: Can't resubmit URB (%d) resetting device\n",
650651 result);
651652 goto error;
drivers/uwb/neh.c+11−1
@@ -107,6 +107,7 @@ struct uwb_rc_neh { · 106 unmodified lines
107107 u8 evt_type;
108108 __le16 evt;
109109 u8 context;
110+ u8 completed;
110111 uwb_rc_cmd_cb_f cb;
111112 void *arg;
112113
@@ -409,6 +410,7 @@ static void uwb_rc_neh_grok_event(struct uwb_rc *rc, struct uwb_rceb *rceb, size · 296 unmodified lines
409410 struct device *dev = &rc->uwb_dev.dev;
410411 struct uwb_rc_neh *neh;
411412 struct uwb_rceb *notif;
413+ unsigned long flags;
412414
413415 if (rceb->bEventContext == 0) {
414416 notif = kmalloc(size, GFP_ATOMIC);
@@ -422,7 +424,11 @@ static void uwb_rc_neh_grok_event(struct uwb_rc *rc, struct uwb_rceb *rceb, size · 7 unmodified lines
422424 } else {
423425 neh = uwb_rc_neh_lookup(rc, rceb);
424426 if (neh) {
425− del_timer_sync(&neh->timer);
427+ spin_lock_irqsave(&rc->neh_lock, flags);
428+ /* to guard against a timeout */
429+ neh->completed = 1;
430+ del_timer(&neh->timer);
431+ spin_unlock_irqrestore(&rc->neh_lock, flags);
426432 uwb_rc_neh_cb(neh, rceb, size);
427433 } else
428434 dev_warn(dev, "event 0x%02x/%04x/%02x (%zu bytes): nobody cared\n",
@@ -568,6 +574,10 @@ static void uwb_rc_neh_timer(unsigned long arg) · 139 unmodified lines
568574 unsigned long flags;
569575
570576 spin_lock_irqsave(&rc->neh_lock, flags);
577+ if (neh->completed) {
578+ spin_unlock_irqrestore(&rc->neh_lock, flags);
579+ return;
580+ }
571581 if (neh->context)
572582 __uwb_rc_neh_rm(rc, neh);
573583 else
drivers/vhost/net.c+1−1
@@ -238,7 +238,7 @@ static void handle_tx(struct vhost_net *net) · 237 unmodified lines
238238
239239 vq->heads[vq->upend_idx].len = len;
240240 ubuf->callback = vhost_zerocopy_callback;
241− ubuf->arg = vq->ubufs;
241+ ubuf->ctx = vq->ubufs;
242242 ubuf->desc = vq->upend_idx;
243243 msg.msg_control = ubuf;
244244 msg.msg_controllen = sizeof(ubuf);
drivers/vhost/test.c+1−1
@@ -155,7 +155,7 @@ static int vhost_test_release(struct inode *inode, struct file *f) · 154 unmodified lines
155155
156156 vhost_test_stop(n, &private);
157157 vhost_test_flush(n);
158− vhost_dev_cleanup(&n->dev);
158+ vhost_dev_cleanup(&n->dev, false);
159159 /* We do an extra flush before freeing memory,
160160 * since jobs can re-queue themselves. */
161161 vhost_test_flush(n);
drivers/vhost/vhost.c+2−3
@@ -1598,10 +1598,9 @@ void vhost_ubuf_put_and_wait(struct vhost_ubuf_ref *ubufs) · 1597 unmodified lines
15981598 kfree(ubufs);
15991599 }
16001600
1601−void vhost_zerocopy_callback(void *arg)
1601+void vhost_zerocopy_callback(struct ubuf_info *ubuf)
16021602 {
1603− struct ubuf_info *ubuf = arg;
1604− struct vhost_ubuf_ref *ubufs = ubuf->arg;
1603+ struct vhost_ubuf_ref *ubufs = ubuf->ctx;
16051604 struct vhost_virtqueue *vq = ubufs->vq;
16061605
16071606 /* set len = 1 to mark this desc buffers done DMA */
drivers/vhost/vhost.h+1−1
@@ -188,7 +188,7 @@ bool vhost_enable_notify(struct vhost_dev *, struct vhost_virtqueue *); · 187 unmodified lines
188188
189189 int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log,
190190 unsigned int log_num, u64 len);
191−void vhost_zerocopy_callback(void *arg);
191+void vhost_zerocopy_callback(struct ubuf_info *);

3 more lines aren’t shown here.

drivers/video/au1100fb.c+3−2

This diff is large: its 19 lines aren’t shown here.

drivers/video/au1200fb.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/video/bfin-lq035q1-fb.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/video/kyro/STG4000Reg.h+188−188

This diff is large: its 399 lines aren’t shown here.

drivers/video/msm/mddi.c+4−4

This diff is large: its 22 lines aren’t shown here.

drivers/video/uvesafb.c+9−2

This diff is large: its 18 lines aren’t shown here.

drivers/virtio/virtio_balloon.c+46−12

This diff is large: its 126 lines aren’t shown here.

drivers/watchdog/hpwdt.c+3−3

This diff is large: its 20 lines aren’t shown here.

drivers/xen/events.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/xen/gntdev.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/xen/grant-table.c+9−4

This diff is large: its 37 lines aren’t shown here.

drivers/xen/manage.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/xen/xen-acpi-processor.c+4−1

This diff is large: its 12 lines aren’t shown here.

drivers/xen/xenbus/xenbus_probe_frontend.c+53−16

This diff is large: its 105 lines aren’t shown here.

fs/aio.c+13−3

This diff is large: its 30 lines aren’t shown here.

fs/autofs4/autofs_i.h+11−1

This diff is large: its 26 lines aren’t shown here.

fs/autofs4/dev-ioctl.c+1−2

This diff is large: its 17 lines aren’t shown here.

fs/autofs4/inode.c+1−3

This diff is large: its 25 lines aren’t shown here.

fs/autofs4/waitq.c+3−19

This diff is large: its 36 lines aren’t shown here.

fs/binfmt_aout.c+8−24

This diff is large: its 96 lines aren’t shown here.

fs/binfmt_elf.c+6−17

This diff is large: its 66 lines aren’t shown here.

fs/binfmt_elf_fdpic.c+4−14

This diff is large: its 59 lines aren’t shown here.

fs/binfmt_flat.c+3−9

This diff is large: its 36 lines aren’t shown here.

fs/binfmt_som.c+3−9

This diff is large: its 35 lines aren’t shown here.

fs/btrfs/backref.c+20−7

This diff is large: its 106 lines aren’t shown here.

fs/btrfs/compression.c+2−0

This diff is large: its 16 lines aren’t shown here.

fs/btrfs/ctree.h+2−2

This diff is large: its 18 lines aren’t shown here.

fs/btrfs/disk-io.c+11−11

This diff is large: its 62 lines aren’t shown here.

fs/btrfs/extent-tree.c+11−15

This diff is large: its 91 lines aren’t shown here.

fs/btrfs/extent_io.c+33−29

This diff is large: its 171 lines aren’t shown here.

fs/btrfs/extent_io.h+2−2

This diff is large: its 18 lines aren’t shown here.

fs/btrfs/file.c+7−2

This diff is large: its 33 lines aren’t shown here.

fs/btrfs/free-space-cache.c+2−7

This diff is large: its 23 lines aren’t shown here.

fs/btrfs/inode.c+18−36

This diff is large: its 101 lines aren’t shown here.

fs/btrfs/ioctl.c+4−1

This diff is large: its 12 lines aren’t shown here.

fs/btrfs/reada.c+29−19

This diff is large: its 122 lines aren’t shown here.

fs/btrfs/relocation.c+3−1

This diff is large: its 19 lines aren’t shown here.

fs/btrfs/scrub.c+4−15

This diff is large: its 47 lines aren’t shown here.

fs/btrfs/super.c+4−3

This diff is large: its 26 lines aren’t shown here.

fs/btrfs/transaction.c+10−5

This diff is large: its 59 lines aren’t shown here.

fs/btrfs/volumes.c+27−6

This diff is large: its 91 lines aren’t shown here.

fs/buffer.c+0−1

This diff is large: its 8 lines aren’t shown here.

fs/cifs/cifsfs.c+8−4

This diff is large: its 32 lines aren’t shown here.

fs/cifs/connect.c+26−68

This diff is large: its 230 lines aren’t shown here.

fs/cifs/file.c+2−1

This diff is large: its 17 lines aren’t shown here.

fs/dlm/lock.c+12−0

This diff is large: its 19 lines aren’t shown here.

fs/eventpoll.c+3−1

This diff is large: its 12 lines aren’t shown here.

fs/ext4/ext4.h+0−3

This diff is large: its 10 lines aren’t shown here.

fs/ext4/extents.c+1−5

This diff is large: its 20 lines aren’t shown here.

fs/ext4/super.c+17−33

This diff is large: its 125 lines aren’t shown here.

fs/fuse/dir.c+15−10

This diff is large: its 48 lines aren’t shown here.

fs/fuse/file.c+112−17

This diff is large: its 198 lines aren’t shown here.

fs/fuse/inode.c+1−0

This diff is large: its 8 lines aren’t shown here.

fs/gfs2/Kconfig+2−5

This diff is large: its 21 lines aren’t shown here.

fs/gfs2/aops.c+2−2

This diff is large: its 18 lines aren’t shown here.

fs/gfs2/bmap.c+5−1

This diff is large: its 13 lines aren’t shown here.

fs/gfs2/dir.c+4−0

This diff is large: its 11 lines aren’t shown here.

fs/gfs2/inode.c+11−2

This diff is large: its 34 lines aren’t shown here.

fs/gfs2/lock_dlm.c+7−3

This diff is large: its 35 lines aren’t shown here.

fs/gfs2/rgrp.c+5−3

This diff is large: its 29 lines aren’t shown here.

fs/gfs2/xattr.c+12−0

This diff is large: its 33 lines aren’t shown here.

fs/hugetlbfs/inode.c+1−0

This diff is large: its 8 lines aren’t shown here.

fs/jbd2/commit.c+2−2

This diff is large: its 18 lines aren’t shown here.

fs/libfs.c+1−0

This diff is large: its 8 lines aren’t shown here.

fs/lockd/clnt4xdr.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/lockd/clntxdr.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/nfs/dir.c+2−2

This diff is large: its 18 lines aren’t shown here.

fs/nfs/nfs4_fs.h+1−0

This diff is large: its 8 lines aren’t shown here.

fs/nfs/nfs4proc.c+36−8

This diff is large: its 94 lines aren’t shown here.

fs/nfs/nfs4state.c+19−12

This diff is large: its 63 lines aren’t shown here.

fs/nfs/nfs4xdr.c+5−4

This diff is large: its 26 lines aren’t shown here.

fs/nfs/read.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/nfs/super.c+6−2

This diff is large: its 18 lines aren’t shown here.

fs/nfs/write.c+3−2

This diff is large: its 19 lines aren’t shown here.

fs/nfsd/nfs3xdr.c+8−14

This diff is large: its 57 lines aren’t shown here.

fs/nfsd/nfs4proc.c+8−7

This diff is large: its 41 lines aren’t shown here.

fs/nfsd/nfs4state.c+9−14

This diff is large: its 47 lines aren’t shown here.

fs/nfsd/nfs4xdr.c+2−2

This diff is large: its 18 lines aren’t shown here.

fs/nfsd/vfs.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/ocfs2/alloc.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/ocfs2/refcounttree.c+6−6

This diff is large: its 53 lines aren’t shown here.

fs/ocfs2/suballoc.c+2−2

This diff is large: its 18 lines aren’t shown here.

fs/pipe.c+29−2

This diff is large: its 73 lines aren’t shown here.

fs/proc/stat.c+28−6

This diff is large: its 55 lines aren’t shown here.

fs/proc/task_mmu.c+0−3

This diff is large: its 10 lines aren’t shown here.

fs/sysfs/dir.c+4−1

This diff is large: its 26 lines aren’t shown here.

fs/sysfs/group.c+5−1

This diff is large: its 13 lines aren’t shown here.

include/asm-generic/siginfo.h+11−3

This diff is large: its 35 lines aren’t shown here.

include/drm/exynos_drm.h+3−2

This diff is large: its 19 lines aren’t shown here.

include/linux/amba/bus.h+0−7

This diff is large: its 21 lines aren’t shown here.

include/linux/amba/pl022.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/linux/blkdev.h+7−11

This diff is large: its 54 lines aren’t shown here.

include/linux/dmaengine.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/fuse.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/gpio-pxa.h+4−0

This diff is large: its 9 lines aren’t shown here.

include/linux/hsi/hsi.h+17−14

This diff is large: its 99 lines aren’t shown here.

include/linux/i2c/twl.h+0−12

This diff is large: its 24 lines aren’t shown here.

include/linux/irq.h+12−0

This diff is large: its 33 lines aren’t shown here.

include/linux/irqdomain.h+4−8

This diff is large: its 47 lines aren’t shown here.

include/linux/kconfig.h+18−4

This diff is large: its 48 lines aren’t shown here.

include/linux/kvm_host.h+6−0

This diff is large: its 20 lines aren’t shown here.

include/linux/mfd/db5500-prcmu.h+37−51

This diff is large: its 149 lines aren’t shown here.

include/linux/mfd/rc5t583.h+39−8

This diff is large: its 61 lines aren’t shown here.

include/linux/mfd/twl6040.h+27−0

This diff is large: its 36 lines aren’t shown here.

include/linux/mm.h+9−18

This diff is large: its 39 lines aren’t shown here.

include/linux/mmc/card.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/netfilter_ipv6/ip6_tables.h+11−1

This diff is large: its 19 lines aren’t shown here.

include/linux/nfs_xdr.h+6−1

This diff is large: its 21 lines aren’t shown here.

include/linux/nfsd/Kbuild+1−0

This diff is large: its 5 lines aren’t shown here.

include/linux/pinctrl/machine.h+3−1

This diff is large: its 18 lines aren’t shown here.

include/linux/pipe_fs_i.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/serial_core.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/skbuff.h+17−3

This diff is large: its 43 lines aren’t shown here.

include/linux/spi/spi.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/stddef.h+2−6

This diff is large: its 17 lines aren’t shown here.

include/linux/types.h+6−0

This diff is large: its 13 lines aren’t shown here.

include/linux/usb/hcd.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/linux/usb/otg.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/usb/serial.h+0−8

This diff is large: its 22 lines aren’t shown here.

include/linux/vgaarb.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/linux/vm_event_item.h+3−2

This diff is large: its 17 lines aren’t shown here.

include/net/bluetooth/hci.h+2−1

This diff is large: its 18 lines aren’t shown here.

include/net/bluetooth/hci_core.h+7−5

This diff is large: its 27 lines aren’t shown here.

include/net/bluetooth/mgmt.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/net/dst.h+5−1

This diff is large: its 13 lines aren’t shown here.

include/net/ip6_fib.h+48−0

This diff is large: its 55 lines aren’t shown here.

include/net/mac80211.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/net/red.h+3−3

This diff is large: its 27 lines aren’t shown here.

include/net/sock.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/scsi/scsi_cmnd.h+3−0

This diff is large: its 10 lines aren’t shown here.

include/sound/core.h+10−0

This diff is large: its 31 lines aren’t shown here.

init/main.c+13−12

This diff is large: its 54 lines aren’t shown here.

kernel/cred.c+2−0

This diff is large: its 9 lines aren’t shown here.

kernel/events/core.c+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/irq/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/irq/debug.h+19−19

This diff is large: its 54 lines aren’t shown here.

kernel/irq/irqdomain.c+17−30

This diff is large: its 131 lines aren’t shown here.

kernel/irq_work.c+1−0

This diff is large: its 8 lines aren’t shown here.

kernel/itimer.c+6−2

This diff is large: its 15 lines aren’t shown here.

kernel/panic.c+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/power/swap.c+22−6

This diff is large: its 66 lines aren’t shown here.

kernel/rcutree.c+0−1

This diff is large: its 8 lines aren’t shown here.

kernel/sched/core.c+16−6

This diff is large: its 33 lines aren’t shown here.

kernel/sched/fair.c+10−8

This diff is large: its 60 lines aren’t shown here.

kernel/sched/features.h+1−0

This diff is large: its 5 lines aren’t shown here.

kernel/time/Kconfig+4−0

This diff is large: its 11 lines aren’t shown here.

kernel/time/tick-broadcast.c+6−5

This diff is large: its 52 lines aren’t shown here.

kernel/time/tick-sched.c+2−2

This diff is large: its 12 lines aren’t shown here.

kernel/trace/trace.c+5−3

This diff is large: its 29 lines aren’t shown here.

kernel/trace/trace.h+2−2

This diff is large: its 14 lines aren’t shown here.

kernel/trace/trace_output.c+5−0

This diff is large: its 19 lines aren’t shown here.

lib/kobject.c+7−7

This diff is large: its 22 lines aren’t shown here.

lib/mpi/mpi-bit.c+3−2

This diff is large: its 19 lines aren’t shown here.

mm/hugetlb.c+3−1

This diff is large: its 25 lines aren’t shown here.

mm/memblock.c+6−1

This diff is large: its 28 lines aren’t shown here.

mm/memcontrol.c+8−14

This diff is large: its 103 lines aren’t shown here.

mm/mempolicy.c+7−4

This diff is large: its 19 lines aren’t shown here.

mm/migrate.c+8−8

This diff is large: its 23 lines aren’t shown here.

mm/mmap.c+50−9

This diff is large: its 111 lines aren’t shown here.

mm/nobootmem.c+8−2

This diff is large: its 22 lines aren’t shown here.

mm/nommu.c+36−5

This diff is large: its 77 lines aren’t shown here.

mm/swap_state.c+1−1

This diff is large: its 9 lines aren’t shown here.

mm/vmscan.c+9−9

This diff is large: its 32 lines aren’t shown here.

mm/vmstat.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/ax25/af_ax25.c+5−4

This diff is large: its 22 lines aren’t shown here.

net/bluetooth/hci_core.c+7−0

This diff is large: its 21 lines aren’t shown here.

net/bluetooth/l2cap_core.c+3−0

This diff is large: its 24 lines aren’t shown here.

net/bluetooth/l2cap_sock.c+3−2

This diff is large: its 19 lines aren’t shown here.

net/bluetooth/mgmt.c+9−4

This diff is large: its 31 lines aren’t shown here.

net/bridge/br_multicast.c+0−81

This diff is large: its 137 lines aren’t shown here.

net/bridge/br_private.h+0−4

This diff is large: its 21 lines aren’t shown here.

net/caif/chnl_net.c+6−3

This diff is large: its 36 lines aren’t shown here.

net/core/dev.c+20−0

This diff is large: its 35 lines aren’t shown here.

net/core/drop_monitor.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/core/net_namespace.c+18−15

This diff is large: its 53 lines aren’t shown here.

net/core/skbuff.c+3−1

This diff is large: its 13 lines aren’t shown here.

net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c+10−2

This diff is large: its 27 lines aren’t shown here.

net/ipv4/tcp.c+7−8

This diff is large: its 55 lines aren’t shown here.

net/ipv4/tcp_input.c+7−3

This diff is large: its 31 lines aren’t shown here.

net/ipv4/tcp_ipv4.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/tcp_output.c+2−1

This diff is large: its 17 lines aren’t shown here.

net/ipv6/addrconf.c+3−6

This diff is large: its 24 lines aren’t shown here.

net/ipv6/ip6_fib.c+4−5

This diff is large: its 16 lines aren’t shown here.

net/ipv6/ndisc.c+1−2

This diff is large: its 10 lines aren’t shown here.

net/ipv6/netfilter/ip6_tables.c+0−14

This diff is large: its 28 lines aren’t shown here.

net/ipv6/route.c+44−27

This diff is large: its 159 lines aren’t shown here.

net/ipv6/tcp_ipv6.c+5−1

This diff is large: its 20 lines aren’t shown here.

net/key/af_key.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/l2tp/l2tp_ip.c+3−2

This diff is large: its 19 lines aren’t shown here.

net/mac80211/ibss.c+2−2

This diff is large: its 11 lines aren’t shown here.

net/mac80211/mlme.c+1−2

This diff is large: its 10 lines aren’t shown here.

net/mac80211/rx.c+6−4

This diff is large: its 38 lines aren’t shown here.

net/netfilter/nf_conntrack_core.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/nf_conntrack_proto_tcp.c+2−2

This diff is large: its 11 lines aren’t shown here.

net/nfc/llcp/commands.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/phonet/pn_dev.c+2−19

This diff is large: its 42 lines aren’t shown here.

net/sched/sch_gred.c+2−5

This diff is large: its 14 lines aren’t shown here.

net/sunrpc/sunrpc_syms.c+9−8

This diff is large: its 41 lines aren’t shown here.

net/wireless/nl80211.c+18−13

This diff is large: its 129 lines aren’t shown here.

net/wireless/util.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/wireless/wext-core.c+4−2

This diff is large: its 13 lines aren’t shown here.

scripts/checkpatch.pl+0−6

This diff is large: its 13 lines aren’t shown here.

scripts/kconfig/confdata.c+2−36

This diff is large: its 55 lines aren’t shown here.

scripts/mod/file2alias.c+4−0

This diff is large: its 11 lines aren’t shown here.

scripts/mod/modpost.c+5−2

This diff is large: its 22 lines aren’t shown here.

scripts/mod/modpost.h+1−0

This diff is large: its 8 lines aren’t shown here.

scripts/xz_wrap.sh+2−2

This diff is large: its 11 lines aren’t shown here.

security/commoncap.c+6−0

This diff is large: its 20 lines aren’t shown here.

security/smack/smack_lsm.c+48−15

This diff is large: its 133 lines aren’t shown here.

security/smack/smackfs.c+0−14

This diff is large: its 21 lines aren’t shown here.

sound/core/vmaster.c+1−0

This diff is large: its 8 lines aren’t shown here.

sound/isa/sscape.c+4−2

This diff is large: its 18 lines aren’t shown here.

sound/last.c+1−1

This diff is large: its 6 lines aren’t shown here.

sound/oss/msnd_pinnacle.c+6−2

This diff is large: its 34 lines aren’t shown here.

sound/pci/Kconfig+2−2

This diff is large: its 11 lines aren’t shown here.

sound/pci/asihpi/hpi_internal.h+2−2

This diff is large: its 18 lines aren’t shown here.

sound/pci/asihpi/hpios.c+5−5

This diff is large: its 33 lines aren’t shown here.

sound/pci/hda/hda_codec.h+3−0

This diff is large: its 10 lines aren’t shown here.

sound/pci/hda/hda_eld.c+3−3

This diff is large: its 26 lines aren’t shown here.

sound/pci/hda/hda_proc.c+10−3

This diff is large: its 20 lines aren’t shown here.

sound/pci/hda/patch_conexant.c+71−72

This diff is large: its 293 lines aren’t shown here.

sound/pci/hda/patch_hdmi.c+4−5

This diff is large: its 31 lines aren’t shown here.

sound/pci/hda/patch_realtek.c+72−14

This diff is large: its 227 lines aren’t shown here.

sound/pci/hda/patch_sigmatel.c+2−3

This diff is large: its 15 lines aren’t shown here.

sound/soc/codecs/Kconfig+1−2

This diff is large: its 17 lines aren’t shown here.

sound/soc/codecs/ak4642.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/codecs/cs42l73.c+2−0

This diff is large: its 9 lines aren’t shown here.

sound/soc/codecs/sgtl5000.c+13−12

This diff is large: its 65 lines aren’t shown here.

sound/soc/codecs/twl6040.c+1−2

This diff is large: its 17 lines aren’t shown here.

sound/soc/codecs/wm8994.c+222−54

This diff is large: its 365 lines aren’t shown here.

sound/soc/imx/imx-audmux.c+4−1

This diff is large: its 19 lines aren’t shown here.

sound/soc/omap/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/pxa/pxa2xx-i2s.c+1−0

This diff is large: its 8 lines aren’t shown here.

sound/soc/sh/fsi.c+3−4

This diff is large: its 15 lines aren’t shown here.

sound/soc/soc-core.c+3−0

This diff is large: its 17 lines aren’t shown here.

sound/soc/soc-dapm.c+2−0

This diff is large: its 16 lines aren’t shown here.

sound/soc/tegra/tegra_i2s.c+5−1

This diff is large: its 25 lines aren’t shown here.

sound/soc/tegra/tegra_spdif.c+4−0

This diff is large: its 16 lines aren’t shown here.

tools/perf/.gitignore+2−0

This diff is large: its 6 lines aren’t shown here.

tools/perf/Makefile+11−14

This diff is large: its 53 lines aren’t shown here.

tools/perf/builtin-report.c+12−5

This diff is large: its 29 lines aren’t shown here.

tools/perf/builtin-sched.c+1−0

This diff is large: its 8 lines aren’t shown here.

tools/perf/builtin-test.c+30−0

This diff is large: its 44 lines aren’t shown here.

tools/perf/builtin-top.c+35−1

This diff is large: its 79 lines aren’t shown here.

tools/perf/perf-archive.sh+2−1

This diff is large: its 16 lines aren’t shown here.

tools/perf/util/annotate.c+6−10

This diff is large: its 32 lines aren’t shown here.

tools/perf/util/hist.c+12−0

This diff is large: its 19 lines aren’t shown here.

tools/perf/util/map.c+1−0

This diff is large: its 8 lines aren’t shown here.

tools/perf/util/map.h+1−0

This diff is large: its 8 lines aren’t shown here.

tools/perf/util/parse-events.l+1−1

This diff is large: its 9 lines aren’t shown here.

tools/perf/util/session.c+12−4

This diff is large: its 33 lines aren’t shown here.

tools/perf/util/symbol.c+6−7

This diff is large: its 35 lines aren’t shown here.

tools/perf/util/ui/browsers/hists.c+3−0

This diff is large: its 10 lines aren’t shown here.

virt/kvm/iommu.c+21−9

This diff is large: its 72 lines aren’t shown here.

virt/kvm/kvm_main.c+3−2

This diff is large: its 16 lines aren’t shown here.