History

Merge tags 'omap-devel-gpmc-fixed-for-v3.7' and 'cleanup-omap-tags-for-v3.7' into cleanup-sparseirq

Changes for GPMC (General Purpose Memory Controller) that take it closer for being just a regular device driver. Remove the ancient omap specific atags that are no longer needed. At some point we were planning to pass the bootloader information with custom atags that did not work out too well. There's no need for these any longer as the kernel has been booting fine without them for quite some time. And Now we have device tree support that can be used instead.

Tony Lindgren committed 14 years ago

Commit a1e01703 parents cdd86b2 5c46845 cf3a6ec434 files · +3308 −2198Browse files

Unified · Split

434 files
  1. Documentation/ABI/testing/sysfs-bus-pci +12 −0
  2. Documentation/block/00-INDEX +8 −2
  3. Documentation/block/cfq-iosched.txt +77 −0
  4. Documentation/block/queue-sysfs.txt +64 −0
  5. Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt +4 −4
  6. Documentation/feature-removal-schedule.txt +1 −1
  7. Documentation/watchdog/src/watchdog-test.c +1 −1
  8. Makefile +1 −1
  9. arch/arm/Kconfig +2 −1
  10. arch/arm/boot/dts/am33xx.dtsi +5 −0
  11. arch/arm/boot/dts/at91sam9g25ek.dts +1 −1
  12. arch/arm/boot/dts/imx51-babbage.dts +2 −2
  13. arch/arm/boot/dts/kirkwood-iconnect.dts +5 −1
  14. arch/arm/boot/dts/twl6030.dtsi +3 −0
  15. arch/arm/configs/armadillo800eva_defconfig +1 −1
  16. arch/arm/configs/u8500_defconfig +1 −0
  17. arch/arm/include/asm/dma-mapping.h +7 −0
  18. arch/arm/mach-at91/at91rm9200_time.c +1 −1
  19. arch/arm/mach-at91/at91sam9260_devices.c +5 −1
  20. arch/arm/mach-at91/at91sam9261_devices.c +5 −1
  21. arch/arm/mach-at91/at91sam9263_devices.c +8 −2
  22. arch/arm/mach-at91/at91sam9g45_devices.c +5 −1
  23. arch/arm/mach-at91/at91sam9rl_devices.c +5 −1
  24. arch/arm/mach-at91/clock.c +12 −0
  25. arch/arm/mach-dove/common.c +2 −1
  26. arch/arm/mach-exynos/mach-origen.c +7 −0
  27. arch/arm/mach-exynos/mach-smdkv310.c +7 −0
  28. arch/arm/mach-gemini/irq.c +1 −0
  29. arch/arm/mach-imx/Makefile +5 −5
  30. arch/arm/mach-imx/clk-imx6q.c +5 −3
  31. arch/arm/mach-imx/headsmp.S +0 −0
  32. arch/arm/mach-imx/hotplug.c +3 −20
  33. arch/arm/mach-imx/mach-imx6q.c +2 −2
  34. arch/arm/mach-kirkwood/Makefile.boot +2 −1
  35. arch/arm/mach-kirkwood/common.c +9 −2
  36. arch/arm/mach-kirkwood/db88f6281-bp-setup.c +1 −0
  37. arch/arm/mach-mmp/sram.c +1 −1
  38. arch/arm/mach-mv78xx0/addr-map.c +1 −1
  39. arch/arm/mach-mv78xx0/common.c +4 −2
  40. arch/arm/mach-omap1/board-ams-delta.c +0 −1
  41. arch/arm/mach-omap1/board-fsample.c +0 −1
  42. arch/arm/mach-omap1/board-generic.c +0 −6
  43. arch/arm/mach-omap1/board-htcherald.c +0 −1
  44. arch/arm/mach-omap1/board-nokia770.c +0 −1
  45. arch/arm/mach-omap1/board-osk.c +1 −0
  46. arch/arm/mach-omap1/board-palmte.c +1 −1
  47. arch/arm/mach-omap1/board-palmtt.c +1 −1
  48. arch/arm/mach-omap1/board-palmz71.c +1 −1
  49. arch/arm/mach-omap1/board-perseus2.c +0 −1
  50. arch/arm/mach-omap1/board-sx1.c +0 −1
  51. arch/arm/mach-omap1/board-voiceblue.c +0 −6
  52. arch/arm/mach-omap1/clock_data.c +0 −8
  53. arch/arm/mach-omap1/devices.c +0 −1
  54. arch/arm/mach-omap1/serial.c +0 −1
  55. arch/arm/mach-omap2/Kconfig +2 −1
  56. arch/arm/mach-omap2/board-2430sdp.c +0 −1
  57. arch/arm/mach-omap2/board-3430sdp.c +0 −6
  58. arch/arm/mach-omap2/board-3630sdp.c +0 −6
  59. arch/arm/mach-omap2/board-4430sdp.c +0 −1
  60. arch/arm/mach-omap2/board-am3517crane.c +0 −9
  61. arch/arm/mach-omap2/board-am3517evm.c +0 −6
  62. arch/arm/mach-omap2/board-apollon.c +0 −1
  63. arch/arm/mach-omap2/board-cm-t35.c +0 −6
  64. arch/arm/mach-omap2/board-cm-t3517.c +0 −6
  65. arch/arm/mach-omap2/board-devkit8000.c +0 −1
  66. arch/arm/mach-omap2/board-generic.c +0 −1
  67. arch/arm/mach-omap2/board-h4.c +1 −1
  68. arch/arm/mach-omap2/board-igep0020.c +2 −1
  69. arch/arm/mach-omap2/board-ldp.c +0 −1
  70. arch/arm/mach-omap2/board-n8x0.c +0 −1
  71. arch/arm/mach-omap2/board-omap3beagle.c +0 −1
  72. arch/arm/mach-omap2/board-omap3evm.c +13 −7
  73. arch/arm/mach-omap2/board-omap3logic.c +0 −1
  74. arch/arm/mach-omap2/board-omap3pandora.c +0 −1
  75. arch/arm/mach-omap2/board-omap3stalker.c +0 −6
  76. arch/arm/mach-omap2/board-omap3touchbook.c +0 −1
  77. arch/arm/mach-omap2/board-omap4panda.c +0 −1
  78. arch/arm/mach-omap2/board-overo.c +0 −1
  79. arch/arm/mach-omap2/board-rx51-peripherals.c +0 −1
  80. arch/arm/mach-omap2/board-rx51.c +0 −1
  81. arch/arm/mach-omap2/board-ti8168evm.c +0 −6
  82. arch/arm/mach-omap2/board-zoom.c +0 −1
  83. arch/arm/mach-omap2/common-board-devices.c +0 −11
  84. arch/arm/mach-omap2/common-board-devices.h +0 −1
  85. arch/arm/mach-omap2/common.c +0 −1
  86. arch/arm/mach-omap2/cpuidle44xx.c +2 −1
  87. arch/arm/mach-omap2/devices.c +0 −1
  88. arch/arm/mach-omap2/gpmc-nand.c +23 −6
  89. arch/arm/mach-omap2/gpmc-onenand.c +22 −2
  90. arch/arm/mach-omap2/gpmc-smc91x.c +0 −1
  91. arch/arm/mach-omap2/gpmc-smsc911x.c +0 −1
  92. arch/arm/mach-omap2/gpmc.c +139 −17
  93. arch/arm/mach-omap2/mux.h +0 −1
  94. arch/arm/mach-omap2/opp4xxx_data.c +1 −1
  95. arch/arm/mach-omap2/pm-debug.c +0 −1
  96. arch/arm/mach-omap2/pm24xx.c +0 −11
  97. arch/arm/mach-omap2/pm34xx.c +4 −15
  98. arch/arm/mach-omap2/serial.c +0 −1
  99. arch/arm/mach-omap2/sleep44xx.S +6 −2
  100. arch/arm/mach-omap2/twl-common.c +1 −0
  101. arch/arm/mach-orion5x/common.c +2 −1
  102. arch/arm/mach-s3c24xx/include/mach/dma.h +2 −1
  103. arch/arm/mach-shmobile/board-armadillo800eva.c +7 −6
  104. arch/arm/mach-shmobile/board-mackerel.c +2 −1
  105. arch/arm/mach-shmobile/board-marzen.c +1 −1
  106. arch/arm/mach-shmobile/intc-sh73a0.c +2 −2
  107. arch/arm/mach-ux500/Kconfig +0 −1
  108. arch/arm/mach-ux500/board-mop500-msp.c +5 −5
  109. arch/arm/mach-ux500/board-mop500.c +4 −0
  110. arch/arm/mm/dma-mapping.c +104 −10
  111. arch/arm/plat-omap/common.c +0 −40
  112. arch/arm/plat-omap/counter_32k.c +0 −1
  113. arch/arm/plat-omap/debug-devices.c +0 −3
  114. arch/arm/plat-omap/devices.c +0 −1
  115. arch/arm/plat-omap/dmtimer.c +3 −3
  116. arch/arm/plat-omap/fb.c +0 −2
  117. arch/arm/plat-omap/include/plat/board.h +0 −138
  118. arch/arm/plat-omap/include/plat/cpu.h +2 −1
  119. arch/arm/plat-omap/include/plat/debug-devices.h +9 −0
  120. arch/arm/plat-omap/include/plat/gpmc.h +19 −0
  121. arch/arm/plat-omap/include/plat/mmc.h +0 −1
  122. arch/arm/plat-omap/include/plat/multi.h +9 −0
  123. arch/arm/plat-omap/include/plat/nand.h +1 −1
  124. arch/arm/plat-omap/include/plat/uncompress.h +1 −3
  125. arch/arm/plat-omap/include/plat/usb.h +0 −1
  126. arch/arm/plat-omap/sram.c +0 −1
  127. arch/arm/plat-orion/common.c +6 −2
  128. arch/arm/plat-orion/include/plat/common.h +4 −2
  129. arch/arm/plat-s3c24xx/dma.c +1 −1
  130. arch/arm/plat-samsung/devs.c +28 −1
  131. arch/arm/plat-samsung/include/plat/hdmi.h +16 −0
  132. arch/arm/plat-samsung/pm.c +1 −1
  133. arch/mips/Kconfig +1 −0
  134. arch/mips/alchemy/board-mtx1.c +2 −0
  135. arch/mips/ath79/dev-usb.c +2 −0
  136. arch/mips/ath79/gpio.c +4 −2
  137. arch/mips/bcm63xx/dev-spi.c +4 −0
  138. arch/mips/cavium-octeon/octeon-irq.c +43 −46
  139. arch/mips/include/asm/mach-ath79/ar71xx_regs.h +2 −1
  140. arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h +0 −1
  141. arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h +2 −0
  142. arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h +10 −3
  143. arch/mips/include/asm/mach-cavium-octeon/irq.h +1 −9
  144. arch/mips/include/asm/module.h +1 −0
  145. arch/mips/include/asm/r4k-timer.h +4 −4
  146. arch/mips/kernel/module.c +34 −9
  147. arch/mips/kernel/smp.c +2 −2
  148. arch/mips/kernel/sync-r4k.c +11 −15
  149. arch/mips/mti-malta/malta-pci.c +0 −13
  150. arch/mips/pci/pci-ar724x.c +22 −0
  151. arch/parisc/include/asm/atomic.h +2 −2
  152. arch/parisc/kernel/process.c +1 −1
  153. arch/parisc/kernel/sys_parisc.c +4 −4
  154. arch/powerpc/boot/dts/fsl/p4080si-post.dtsi +7 −0
  155. arch/powerpc/configs/85xx/p1023rds_defconfig +10 −21
  156. arch/powerpc/configs/corenet32_smp_defconfig +9 −20
  157. arch/powerpc/configs/corenet64_smp_defconfig +1 −0
  158. arch/powerpc/configs/g5_defconfig +73 −30
  159. arch/powerpc/configs/mpc83xx_defconfig +5 −13
  160. arch/powerpc/configs/mpc85xx_defconfig +9 −24
  161. arch/powerpc/configs/mpc85xx_smp_defconfig +8 −24
  162. arch/powerpc/include/asm/cputable.h +0 −2
  163. arch/powerpc/include/asm/kvm_host.h +1 −0
  164. arch/powerpc/include/asm/kvm_ppc.h +12 −0
  165. arch/powerpc/include/asm/mpic_msgr.h +1 −0
  166. arch/powerpc/include/asm/processor.h +1 −0
  167. arch/powerpc/kernel/asm-offsets.c +1 −0
  168. arch/powerpc/kernel/dbell.c +2 −0
  169. arch/powerpc/kernel/dma-iommu.c +4 −5
  170. arch/powerpc/kernel/entry_64.S +17 −6
  171. arch/powerpc/kernel/exceptions-64s.S +2 −1
  172. arch/powerpc/kernel/hw_breakpoint.c +1 −1
  173. arch/powerpc/kernel/idle_power7.S +2 −0
  174. arch/powerpc/kernel/kgdb.c +24 −3
  175. arch/powerpc/kernel/process.c +2 −10
  176. arch/powerpc/kernel/smp.c +9 −2
  177. arch/powerpc/kernel/syscalls.c +4 −4
  178. arch/powerpc/kernel/sysfs.c +10 −0
  179. arch/powerpc/kernel/time.c +9 −0
  180. arch/powerpc/kernel/traps.c +2 −1
  181. arch/powerpc/kvm/book3s_32_mmu_host.c +3 −0
  182. arch/powerpc/kvm/book3s_64_mmu_host.c +2 −0
  183. arch/powerpc/kvm/book3s_hv_rmhandlers.S +7 −5
  184. arch/powerpc/kvm/e500_tlb.c +7 −4
  185. arch/powerpc/lib/code-patching.c +1 −1
  186. arch/powerpc/lib/copyuser_power7.S +2 −33
  187. arch/powerpc/lib/memcpy_power7.S +2 −2
  188. arch/powerpc/mm/mem.c +1 −0
  189. arch/powerpc/mm/numa.c +4 −3
  190. arch/powerpc/perf/core-book3s.c +1 −1
  191. arch/powerpc/platforms/powernv/smp.c +1 −9
  192. arch/powerpc/sysdev/fsl_pci.c +8 −5
  193. arch/powerpc/sysdev/mpic_msgr.c +3 −0
  194. arch/powerpc/sysdev/xics/icp-hv.c +5 −1
  195. arch/powerpc/xmon/xmon.c +34 −50
  196. arch/s390/include/asm/elf.h +2 −1
  197. arch/s390/include/asm/posix_types.h +1 −2
  198. arch/s390/include/asm/smp.h +1 −0
  199. arch/um/os-Linux/time.c +1 −1
  200. arch/x86/include/asm/spinlock.h +1 −2
  201. arch/x86/kernel/alternative.c +1 −1
  202. arch/x86/kernel/irq.c +1 −1
  203. arch/x86/kernel/microcode_amd.c +4 −3
  204. arch/x86/kvm/emulate.c +21 −9
  205. arch/x86/kvm/mmu.c +9 −4
  206. arch/x86/kvm/x86.c +4 −1
  207. arch/x86/xen/enlighten.c +11 −107
  208. arch/x86/xen/mmu.c +1 −1
  209. arch/x86/xen/p2m.c +92 −3
  210. arch/x86/xen/setup.c +8 −1
  211. arch/x86/xen/suspend.c +1 −1
  212. arch/x86/xen/xen-ops.h +1 −1
  213. block/blk-lib.c +28 −13
  214. block/blk-merge.c +82 −35
  215. block/genhd.c +1 −1
  216. drivers/ata/Kconfig +1 −1
  217. drivers/ata/ahci.c +8 −0
  218. drivers/ata/ahci.h +1 −0
  219. drivers/ata/ata_piix.c +8 −0
  220. drivers/ata/libahci.c +2 −1
  221. drivers/ata/libata-acpi.c +4 −11
  222. drivers/ata/libata-core.c +2 −1
  223. drivers/ata/pata_atiixp.c +16 −0
  224. drivers/base/dma-contiguous.c +1 −1
  225. drivers/block/drbd/drbd_bitmap.c +14 −1
  226. drivers/block/drbd/drbd_int.h +1 −0
  227. drivers/block/drbd/drbd_main.c +12 −16
  228. drivers/block/drbd/drbd_nl.c +2 −2
  229. drivers/block/drbd/drbd_req.c +32 −4
  230. drivers/cpufreq/omap-cpufreq.c +3 −1
  231. drivers/crypto/caam/jr.c +5 −5
  232. drivers/crypto/hifn_795x.c +2 −2
  233. drivers/gpio/Kconfig +1 −1
  234. drivers/gpio/gpio-em.c +2 −2
  235. drivers/gpio/gpio-rdc321x.c +1 −0
  236. drivers/gpio/gpiolib-of.c +1 −1
  237. drivers/gpu/drm/drm_crtc.c +1 −1
  238. drivers/gpu/drm/drm_edid.c +3 −0
  239. drivers/gpu/drm/gma500/psb_intel_display.c +3 −0
  240. drivers/gpu/drm/i915/i915_gem_gtt.c +1 −1
  241. drivers/gpu/drm/i915/intel_display.c +6 −6
  242. drivers/gpu/drm/i915/intel_lvds.c +8 −0
  243. drivers/gpu/drm/i915/intel_sprite.c +2 −2
  244. drivers/gpu/drm/nouveau/nouveau_state.c +4 −2
  245. drivers/gpu/drm/radeon/atombios_crtc.c +16 −20
  246. drivers/gpu/drm/radeon/atombios_dp.c +12 −17
  247. drivers/gpu/drm/radeon/atombios_encoders.c +73 −67
  248. drivers/gpu/drm/radeon/r600_cs.c +26 −4
  249. drivers/gpu/drm/radeon/r600d.h +8 −0
  250. drivers/gpu/drm/radeon/radeon_device.c +4 −1
  251. drivers/gpu/drm/radeon/radeon_drv.c +2 −1
  252. drivers/gpu/drm/radeon/reg_srcs/r600 +0 −1
  253. drivers/hid/hid-core.c +5 −3
  254. drivers/hid/hid-logitech-dj.c +2 −2
  255. drivers/hid/usbhid/hid-quirks.c +1 −0
  256. drivers/hwmon/asus_atk0110.c +6 −0
  257. drivers/ide/ide-pm.c +2 −2
  258. drivers/input/keyboard/imx_keypad.c +3 −0
  259. drivers/input/serio/i8042-x86ia64io.h +14 −0
  260. drivers/input/tablet/wacom_wac.c +5 −1
  261. drivers/input/touchscreen/edt-ft5x06.c +1 −1
  262. drivers/mmc/card/block.c +25 −1
  263. drivers/mmc/host/atmel-mci.c +5 −1
  264. drivers/mmc/host/bfin_sdh.c +0 −7
  265. drivers/mmc/host/dw_mmc.c +46 −39
  266. drivers/mmc/host/mxs-mmc.c +7 −7
  267. drivers/mmc/host/omap.c +11 −4
  268. drivers/mmc/host/omap_hsmmc.c +0 −1
  269. drivers/mmc/host/sdhci-esdhc.h +3 −3
  270. drivers/mtd/nand/omap2.c +225 −76
  271. drivers/mtd/onenand/omap2.c +16 −15
  272. drivers/mtd/ubi/vtbl.c +2 −2
  273. drivers/net/can/sja1000/sja1000_platform.c +3 −1
  274. drivers/net/can/softing/softing_fw.c +4 −3
  275. drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +0 −3
  276. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +4 −0
  277. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +2 −2
  278. drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +0 −2
  279. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +9 −9
  280. drivers/net/ethernet/cirrus/cs89x0.c +5 −5
  281. drivers/net/ethernet/emulex/benet/be_cmds.c +4 −2
  282. drivers/net/ethernet/emulex/benet/be_main.c +2 −0
  283. drivers/net/ethernet/freescale/gianfar.c +1 −1
  284. drivers/net/ethernet/intel/e1000e/e1000.h +1 −0
  285. drivers/net/ethernet/intel/e1000e/netdev.c +23 −25
  286. drivers/net/ethernet/sfc/ethtool.c +2 −2
  287. drivers/net/ethernet/stmicro/stmmac/common.h +5 −0
  288. drivers/net/ethernet/stmicro/stmmac/descs.h +6 −0
  289. drivers/net/ethernet/stmicro/stmmac/descs_com.h +5 −0
  290. drivers/net/ethernet/stmicro/stmmac/dwmac100.h +5 −0
  291. drivers/net/ethernet/stmicro/stmmac/dwmac1000.h +4 −1
  292. drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h +5 −0
  293. drivers/net/ethernet/stmicro/stmmac/mmc.h +5 −0
  294. drivers/net/ethernet/stmicro/stmmac/mmc_core.c +3 −3
  295. drivers/net/ethernet/stmicro/stmmac/stmmac.h +5 −0
  296. drivers/net/ethernet/stmicro/stmmac/stmmac_timer.h +4 −0
  297. drivers/net/ethernet/ti/davinci_mdio.c +3 −1
  298. drivers/net/fddi/skfp/pmf.c +1 −1
  299. drivers/net/usb/qmi_wwan.c +4 −0
  300. drivers/net/usb/usbnet.c +1 −1
  301. drivers/net/wireless/ath/ath5k/eeprom.c +1 −1
  302. drivers/net/wireless/ath/ath5k/eeprom.h +1 −0
  303. drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +3 −0
  304. drivers/net/wireless/ipw2x00/ipw2100.c +2 −1
  305. drivers/net/wireless/iwlwifi/dvm/debugfs.c +3 −0
  306. drivers/net/wireless/iwlwifi/pcie/internal.h +1 −1
  307. drivers/net/wireless/iwlwifi/pcie/rx.c +1 −1
  308. drivers/net/wireless/iwlwifi/pcie/trans.c +16 −14
  309. drivers/net/xen-netfront.c +10 −29
  310. drivers/pci/pci-driver.c +6 −0
  311. drivers/pci/pci-sysfs.c +42 −0
  312. drivers/pci/pci.c +1 −0
  313. drivers/pci/pcie/portdrv_pci.c +14 −0
  314. drivers/pci/probe.c +17 −14
  315. drivers/rtc/rtc-at91sam9.c +15 −7
  316. drivers/s390/block/dasd_eckd.c +1 −1
  317. drivers/s390/block/dasd_ioctl.c +2 −5
  318. drivers/spi/spi-bcm63xx.c +26 −5
  319. drivers/video/auo_k190x.c +0 −2
  320. drivers/video/backlight/omap1_bl.c +1 −1
  321. drivers/video/console/bitblit.c +1 −1
  322. drivers/video/console/fbcon.c +1 −1
  323. drivers/video/mb862xx/mb862xxfbdrv.c +2 −0
  324. drivers/video/omap2/dss/sdi.c +14 −0
  325. drivers/video/omap2/omapfb/omapfb-main.c +1 −1
  326. drivers/watchdog/booke_wdt.c +3 −4
  327. drivers/watchdog/da9052_wdt.c +0 −1
  328. drivers/xen/platform-pci.c +0 −15
  329. drivers/xen/swiotlb-xen.c +1 −1
  330. drivers/xen/xen-pciback/pci_stub.c +4 −4
  331. fs/bio.c +6 −5
  332. fs/block_dev.c +3 −0
  333. fs/btrfs/backref.c +2 −2
  334. fs/btrfs/compression.c +1 −0
  335. fs/btrfs/ctree.c +3 −6
  336. fs/btrfs/ctree.h +1 −2
  337. fs/btrfs/delayed-inode.c +6 −6
  338. fs/btrfs/delayed-ref.c +128 −35
  339. fs/btrfs/delayed-ref.h +4 −0
  340. fs/btrfs/disk-io.c +14 −39
  341. fs/btrfs/disk-io.h +1 −1
  342. fs/btrfs/extent-tree.c +58 −65
  343. fs/btrfs/extent_io.c +2 −15
  344. fs/btrfs/file-item.c +2 −2
  345. fs/btrfs/inode.c +164 −162
  346. fs/btrfs/ioctl.c +1 −1
  347. fs/btrfs/locking.c +1 −1
  348. fs/btrfs/qgroup.c +9 −3
  349. fs/btrfs/root-tree.c +2 −2
  350. fs/btrfs/super.c +11 −4
  351. fs/btrfs/transaction.c +2 −1
  352. fs/btrfs/volumes.c +6 −27
  353. fs/btrfs/volumes.h +0 −2
  354. fs/buffer.c +30 −36
  355. fs/cifs/cifssmb.c +8 −3
  356. fs/cifs/dir.c +1 −8
  357. fs/cifs/inode.c +16 −8
  358. fs/cifs/link.c +2 −0
  359. fs/cifs/smb2misc.c +9 −7
  360. fs/cifs/smb2pdu.h +6 −4
  361. fs/cifs/transport.c +6 −3
  362. fs/direct-io.c +5 −0
  363. fs/jbd/journal.c +5 −0
  364. fs/logfs/dev_bdev.c +7 −8
  365. fs/logfs/inode.c +17 −1
  366. fs/logfs/journal.c +1 −1
  367. fs/logfs/readwrite.c +0 −1
  368. fs/logfs/segment.c +1 −1
  369. fs/nfsd/nfs4callback.c +2 −2
  370. fs/nfsd/state.h +0 −1
  371. fs/quota/dquot.c +1 −1
  372. fs/reiserfs/bitmap.c +0 −2
  373. fs/reiserfs/inode.c +1 −1
  374. fs/ubifs/debug.h +1 −1
  375. fs/ubifs/lpt.c +4 −1
  376. fs/ubifs/recovery.c +1 −1
  377. fs/ubifs/replay.c +1 −2
  378. fs/ubifs/super.c +0 −3
  379. fs/udf/inode.c +4 −1
  380. fs/udf/super.c +6 −1
  381. fs/xfs/xfs_discard.c +4 −2
  382. fs/xfs/xfs_ialloc.c +9 −8
  383. fs/xfs/xfs_rtalloc.c +1 −1
  384. include/drm/drm_crtc.h +2 −1
  385. include/drm/drm_mode.h +3 −2
  386. include/linux/blkdev.h +13 −1
  387. include/linux/cpuidle.h +4 −0
  388. include/linux/kernel.h +10 −2
  389. include/linux/ktime.h +0 −7
  390. include/linux/mmc/card.h +1 −0
  391. include/linux/mv643xx_eth.h +2 −0
  392. include/linux/omapfb.h +6 −1
  393. include/linux/pci_ids.h +1 −1
  394. include/linux/platform_data/omap1_bl.h +11 −0
  395. include/linux/time.h +27 −2
  396. include/net/netfilter/nf_conntrack_ecache.h +1 −0
  397. include/xen/events.h +0 −2
  398. kernel/fork.c +2 −2
  399. kernel/time/timekeeping.c +33 −6
  400. kernel/trace/trace_syscalls.c +4 −0
  401. mm/filemap.c +0 −7
  402. mm/mempolicy.c +1 −1
  403. mm/mmap.c +2 −3
  404. mm/slab.c +1 −0
  405. net/core/netpoll.c +1 −9
  406. net/ipv4/ipmr.c +12 −2
  407. net/ipv4/netfilter/nf_nat_sip.c +4 −1
  408. net/ipv4/route.c +4 −2
  409. net/ipv4/tcp_input.c +7 −8
  410. net/ipv6/esp6.c +3 −3
  411. net/l2tp/l2tp_core.c +1 −2
  412. net/l2tp/l2tp_core.h +1 −0
  413. net/mac80211/tx.c +16 −22
  414. net/netfilter/ipvs/ip_vs_ctl.c +3 −1
  415. net/netfilter/nf_conntrack_core.c +11 −5
  416. net/netfilter/nf_conntrack_netlink.c +2 −1
  417. net/netfilter/nfnetlink_log.c +4 −2
  418. net/netlink/af_netlink.c +3 −1
  419. net/packet/af_packet.c +1 −1
  420. net/socket.c +2 −2
  421. net/sunrpc/svc_xprt.c +4 −6
  422. net/sunrpc/svcsock.c +1 −1
  423. net/xfrm/xfrm_state.c +3 −1
  424. scripts/Makefile.fwinst +1 −1
  425. scripts/link-vmlinux.sh +1 −1
  426. sound/pci/hda/hda_codec.c +8 −2
  427. sound/pci/hda/hda_codec.h +1 −0
  428. sound/pci/hda/patch_sigmatel.c +4 −0
  429. sound/usb/card.c +2 −2
  430. sound/usb/endpoint.c +10 −14
  431. sound/usb/endpoint.h +2 −1
  432. sound/usb/pcm.c +52 −12
  433. tools/perf/util/python-ext-sources +2 −0
  434. virt/kvm/kvm_main.c +4 −3
Documentation/ABI/testing/sysfs-bus-pci+12−0
@@ -210,3 +210,15 @@ Users: · 209 unmodified lines
210210 firmware assigned instance number of the PCI
211211 device that can help in understanding the firmware
212212 intended order of the PCI device.
213+
214+What: /sys/bus/pci/devices/.../d3cold_allowed
215+Date: July 2012
216+Contact: Huang Ying <ying.huang@intel.com>
217+Description:
218+ d3cold_allowed is bit to control whether the corresponding PCI
219+ device can be put into D3Cold state. If it is cleared, the
220+ device will never be put into D3Cold state. If it is set, the
221+ device may be put into D3Cold state if other requirements are
222+ satisfied too. Reading this attribute will show the current
223+ value of d3cold_allowed bit. Writing this attribute will set
224+ the value of d3cold_allowed bit.
Documentation/block/00-INDEX+8−2
@@ -3,15 +3,21 @@ · 2 unmodified lines
33 biodoc.txt
44 - Notes on the Generic Block Layer Rewrite in Linux 2.5
55 capability.txt
6− - Generic Block Device Capability (/sys/block/<disk>/capability)
6+ - Generic Block Device Capability (/sys/block/<device>/capability)
7+cfq-iosched.txt
8+ - CFQ IO scheduler tunables
9+data-integrity.txt
10+ - Block data integrity
711 deadline-iosched.txt
812 - Deadline IO scheduler tunables
913 ioprio.txt
1014 - Block io priorities (in CFQ scheduler)
15+queue-sysfs.txt
16+ - Queue's sysfs entries
1117 request.txt
1218 - The members of struct request (in include/linux/blkdev.h)
1319 stat.txt
14− - Block layer statistics in /sys/block/<dev>/stat
20+ - Block layer statistics in /sys/block/<device>/stat
1521 switching-sched.txt
1622 - Switching I/O schedulers at runtime
1723 writeback_cache_control.txt
Documentation/block/cfq-iosched.txt+77−0
@@ -1,3 +1,14 @@
1+CFQ (Complete Fairness Queueing)
2+===============================
3+
4+The main aim of CFQ scheduler is to provide a fair allocation of the disk
5+I/O bandwidth for all the processes which requests an I/O operation.
6+
7+CFQ maintains the per process queue for the processes which request I/O
8+operation(syncronous requests). In case of asynchronous requests, all the
9+requests from all the processes are batched together according to their
10+process's I/O priority.
11+
112 CFQ ioscheduler tunables
213 ========================
314
@@ -25,6 +36,72 @@ there are multiple spindles behind single LUN (Host based hardware RAID · 21 unmodified lines
2536 controller or for storage arrays), setting slice_idle=0 might end up in better
2637 throughput and acceptable latencies.
2738
39+back_seek_max
40+-------------
41+This specifies, given in Kbytes, the maximum "distance" for backward seeking.
42+The distance is the amount of space from the current head location to the
43+sectors that are backward in terms of distance.
44+
45+This parameter allows the scheduler to anticipate requests in the "backward"
46+direction and consider them as being the "next" if they are within this
47+distance from the current head location.
48+
49+back_seek_penalty
50+-----------------
51+This parameter is used to compute the cost of backward seeking. If the
52+backward distance of request is just 1/back_seek_penalty from a "front"
53+request, then the seeking cost of two requests is considered equivalent.
54+
55+So scheduler will not bias toward one or the other request (otherwise scheduler
56+will bias toward front request). Default value of back_seek_penalty is 2.
57+
58+fifo_expire_async
59+-----------------
60+This parameter is used to set the timeout of asynchronous requests. Default
61+value of this is 248ms.
62+
63+fifo_expire_sync
64+----------------
65+This parameter is used to set the timeout of synchronous requests. Default
66+value of this is 124ms. In case to favor synchronous requests over asynchronous
67+one, this value should be decreased relative to fifo_expire_async.
68+
69+slice_async
70+-----------
71+This parameter is same as of slice_sync but for asynchronous queue. The
72+default value is 40ms.
73+
74+slice_async_rq
75+--------------
76+This parameter is used to limit the dispatching of asynchronous request to
77+device request queue in queue's slice time. The maximum number of request that
78+are allowed to be dispatched also depends upon the io priority. Default value
79+for this is 2.
80+
81+slice_sync
82+----------
83+When a queue is selected for execution, the queues IO requests are only
84+executed for a certain amount of time(time_slice) before switching to another
85+queue. This parameter is used to calculate the time slice of synchronous
86+queue.
87+
88+time_slice is computed using the below equation:-
89+time_slice = slice_sync + (slice_sync/5 * (4 - prio)). To increase the
90+time_slice of synchronous queue, increase the value of slice_sync. Default
91+value is 100ms.
92+
93+quantum
94+-------
95+This specifies the number of request dispatched to the device queue. In a
96+queue's time slice, a request will not be dispatched if the number of request
97+in the device exceeds this parameter. This parameter is used for synchronous
98+request.
99+
100+In case of storage with several disk, this setting can limit the parallel
101+processing of request. Therefore, increasing the value can imporve the
102+performace although this can cause the latency of some I/O to increase due
103+to more number of requests.
104+
28105 CFQ IOPS Mode for group scheduling
29106 ===================================
30107 Basic CFQ design is to provide priority based time slices. Higher priority
Documentation/block/queue-sysfs.txt+64−0
@@ -9,20 +9,71 @@ These files are the ones found in the /sys/block/xxx/queue/ directory. · 8 unmodified lines
99 Files denoted with a RO postfix are readonly and the RW postfix means
1010 read-write.
1111
12+add_random (RW)
13+----------------
14+This file allows to trun off the disk entropy contribution. Default
15+value of this file is '1'(on).
16+
17+discard_granularity (RO)
18+-----------------------
19+This shows the size of internal allocation of the device in bytes, if
20+reported by the device. A value of '0' means device does not support
21+the discard functionality.
22+
23+discard_max_bytes (RO)
24+----------------------
25+Devices that support discard functionality may have internal limits on
26+the number of bytes that can be trimmed or unmapped in a single operation.
27+The discard_max_bytes parameter is set by the device driver to the maximum
28+number of bytes that can be discarded in a single operation. Discard
29+requests issued to the device must not exceed this limit. A discard_max_bytes
30+value of 0 means that the device does not support discard functionality.
31+
32+discard_zeroes_data (RO)
33+------------------------
34+When read, this file will show if the discarded block are zeroed by the
35+device or not. If its value is '1' the blocks are zeroed otherwise not.
36+
1237 hw_sector_size (RO)
1338 -------------------
1439 This is the hardware sector size of the device, in bytes.
1540
41+iostats (RW)
42+-------------
43+This file is used to control (on/off) the iostats accounting of the
44+disk.
45+
46+logical_block_size (RO)
47+-----------------------
48+This is the logcal block size of the device, in bytes.
49+
1650 max_hw_sectors_kb (RO)
1751 ----------------------
1852 This is the maximum number of kilobytes supported in a single data transfer.
1953
54+max_integrity_segments (RO)
55+---------------------------
56+When read, this file shows the max limit of integrity segments as
57+set by block layer which a hardware controller can handle.
58+
2059 max_sectors_kb (RW)
2160 -------------------
2261 This is the maximum number of kilobytes that the block layer will allow
2362 for a filesystem request. Must be smaller than or equal to the maximum
2463 size allowed by the hardware.
2564
65+max_segments (RO)
66+-----------------
67+Maximum number of segments of the device.
68+
69+max_segment_size (RO)
70+---------------------
71+Maximum segment size of the device.
72+
73+minimum_io_size (RO)
74+--------------------
75+This is the smallest preferred io size reported by the device.
76+
2677 nomerges (RW)
2778 -------------
2879 This enables the user to disable the lookup logic involved with IO
@@ -45,11 +96,24 @@ per-block-cgroup request pool. IOW, if there are N block cgroups, · 16 unmodified lines
4596 each request queue may have upto N request pools, each independently
4697 regulated by nr_requests.
4798
99+optimal_io_size (RO)
100+--------------------
101+This is the optimal io size reported by the device.
102+
103+physical_block_size (RO)
104+------------------------
105+This is the physical block size of device, in bytes.
106+
48107 read_ahead_kb (RW)
49108 ------------------
50109 Maximum number of kilobytes to read-ahead for filesystems on this block
51110 device.
52111
112+rotational (RW)
113+---------------
114+This file is used to stat if the device is of rotational type or
115+non-rotational type.
116+
53117 rq_affinity (RW)
54118 ----------------
55119 If this option is '1', the block layer will migrate request completions to the
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt+4−4
@@ -10,8 +10,8 @@ Required properties: · 9 unmodified lines
1010 - compatible : Should be "fsl,<chip>-esdhc"
1111
1212 Optional properties:
13−- fsl,cd-internal : Indicate to use controller internal card detection
14−- fsl,wp-internal : Indicate to use controller internal write protection
13+- fsl,cd-controller : Indicate to use controller internal card detection
14+- fsl,wp-controller : Indicate to use controller internal write protection
1515
1616 Examples:
1717
@@ -19,8 +19,8 @@ esdhc@70004000 { · 1 unmodified line
1919 compatible = "fsl,imx51-esdhc";
2020 reg = <0x70004000 0x4000>;
2121 interrupts = <1>;
22− fsl,cd-internal;
23− fsl,wp-internal;
22+ fsl,cd-controller;
23+ fsl,wp-controller;
2424 };
2525
2626 esdhc@70008000 {
Documentation/feature-removal-schedule.txt+1−1
@@ -579,7 +579,7 @@ Why: KVM tracepoints provide mostly equivalent information in a much more · 578 unmodified lines
579579 ----------------------------
580580
581581 What: at91-mci driver ("CONFIG_MMC_AT91")
582−When: 3.7
582+When: 3.8
583583 Why: There are two mci drivers: at91-mci and atmel-mci. The PDC support
584584 was added to atmel-mci as a first step to support more chips.
585585 Then at91-mci was kept only for old IP versions (on at91rm9200 and
Documentation/watchdog/src/watchdog-test.c+1−1
@@ -31,7 +31,7 @@ static void keep_alive(void) · 30 unmodified lines
3131 * or "-e" to enable the card.
3232 */
3333
34−void term(int sig)
34+static void term(int sig)
3535 {
3636 close(fd);
3737 fprintf(stderr, "Stopping watchdog ticks...\n");
Makefile+1−1
@@ -1,7 +1,7 @@
11 VERSION = 3
22 PATCHLEVEL = 6
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc3
4+EXTRAVERSION = -rc5
55 NAME = Saber-toothed Squirrel
66
77 # *DOCUMENTATION*
arch/arm/Kconfig+2−1
@@ -6,7 +6,7 @@ config ARM · 5 unmodified lines
66 select HAVE_DMA_API_DEBUG
77 select HAVE_IDE if PCI || ISA || PCMCIA
88 select HAVE_DMA_ATTRS
9− select HAVE_DMA_CONTIGUOUS if (CPU_V6 || CPU_V6K || CPU_V7)
9+ select HAVE_DMA_CONTIGUOUS if MMU
1010 select HAVE_MEMBLOCK
1111 select RTC_LIB
1212 select SYS_SUPPORTS_APM_EMULATION
@@ -2144,6 +2144,7 @@ source "drivers/cpufreq/Kconfig" · 2131 unmodified lines
21442144 config CPU_FREQ_IMX
21452145 tristate "CPUfreq driver for i.MX CPUs"
21462146 depends on ARCH_MXC && CPU_FREQ
2147+ select CPU_FREQ_TABLE
21472148 help
21482149 This enables the CPUfreq driver for i.MX CPUs.
21492150
arch/arm/boot/dts/am33xx.dtsi+5−0
@@ -154,5 +154,10 @@ · 153 unmodified lines
154154 #size-cells = <0>;
155155 ti,hwmods = "i2c3";
156156 };
157+
158+ wdt2: wdt@44e35000 {
159+ compatible = "ti,omap3-wdt";
160+ ti,hwmods = "wd_timer2";
161+ };
157162 };
158163 };
arch/arm/boot/dts/at91sam9g25ek.dts+1−1
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515 compatible = "atmel,at91sam9g25ek", "atmel,at91sam9x5ek", "atmel,at91sam9x5", "atmel,at91sam9";
1616
1717 chosen {
18− bootargs = "128M console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs";
18+ bootargs = "console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs";
1919 };
2020
2121 ahb {
arch/arm/boot/dts/imx51-babbage.dts+2−2
@@ -25,8 +25,8 @@ · 24 unmodified lines
2525 aips@70000000 { /* aips-1 */
2626 spba@70000000 {
2727 esdhc@70004000 { /* ESDHC1 */
28− fsl,cd-internal;
29− fsl,wp-internal;
28+ fsl,cd-controller;
29+ fsl,wp-controller;
3030 status = "okay";
3131 };
3232
arch/arm/boot/dts/kirkwood-iconnect.dts+5−1
@@ -41,9 +41,13 @@ · 40 unmodified lines
4141 };
4242 power-blue {
4343 label = "power:blue";
44− gpios = <&gpio1 11 0>;
44+ gpios = <&gpio1 10 0>;
4545 linux,default-trigger = "timer";
4646 };
47+ power-red {
48+ label = "power:red";
49+ gpios = <&gpio1 11 0>;
50+ };
4751 usb1 {
4852 label = "usb1:blue";
4953 gpios = <&gpio1 12 0>;
arch/arm/boot/dts/twl6030.dtsi+3−0
@@ -66,6 +66,7 @@ · 65 unmodified lines
6666
6767 vcxio: regulator@8 {
6868 compatible = "ti,twl6030-vcxio";
69+ regulator-always-on;
6970 };
7071
7172 vusb: regulator@9 {
@@ -74,10 +75,12 @@ · 2 unmodified lines
7475
7576 v1v8: regulator@10 {
7677 compatible = "ti,twl6030-v1v8";
78+ regulator-always-on;
7779 };
7880
7981 v2v1: regulator@11 {
8082 compatible = "ti,twl6030-v2v1";
83+ regulator-always-on;
8184 };
8285
8386 clk32kg: regulator@12 {
arch/arm/configs/armadillo800eva_defconfig+1−1
@@ -33,7 +33,7 @@ CONFIG_AEABI=y · 32 unmodified lines
3333 CONFIG_FORCE_MAX_ZONEORDER=13
3434 CONFIG_ZBOOT_ROM_TEXT=0x0
3535 CONFIG_ZBOOT_ROM_BSS=0x0
36−CONFIG_CMDLINE="console=tty0 console=ttySC1,115200 earlyprintk=sh-sci.1,115200 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096"
36+CONFIG_CMDLINE="console=tty0 console=ttySC1,115200 earlyprintk=sh-sci.1,115200 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096 rw"
3737 CONFIG_CMDLINE_FORCE=y
3838 CONFIG_KEXEC=y
3939 CONFIG_VFP=y
arch/arm/configs/u8500_defconfig+1−0
@@ -86,6 +86,7 @@ CONFIG_NEW_LEDS=y · 85 unmodified lines
8686 CONFIG_LEDS_CLASS=y
8787 CONFIG_LEDS_LM3530=y
8888 CONFIG_LEDS_LP5521=y
89+CONFIG_LEDS_GPIO=y
8990 CONFIG_RTC_CLASS=y
9091 CONFIG_RTC_DRV_AB8500=y
9192 CONFIG_RTC_DRV_PL031=y
arch/arm/include/asm/dma-mapping.h+7−0
@@ -202,6 +202,13 @@ static inline void dma_free_writecombine(struct device *dev, size_t size, · 201 unmodified lines
202202 return dma_free_attrs(dev, size, cpu_addr, dma_handle, &attrs);
203203 }
204204
205+/*
206+ * This can be called during early boot to increase the size of the atomic
207+ * coherent DMA pool above the default value of 256KiB. It must be called
208+ * before postcore_initcall.
209+ */
210+extern void __init init_dma_coherent_pool_size(unsigned long size);
211+
205212 /*
206213 * This can be called during boot to increase the size of the consistent
207214 * DMA region above it's default value of 2MB. It must be called before the
arch/arm/mach-at91/at91rm9200_time.c+1−1
@@ -197,7 +197,7 @@ void __init at91rm9200_timer_init(void) · 196 unmodified lines
197197 at91_st_read(AT91_ST_SR);
198198
199199 /* Make IRQs happen for the system timer */
200− setup_irq(AT91_ID_SYS, &at91rm9200_timer_irq);
200+ setup_irq(NR_IRQS_LEGACY + AT91_ID_SYS, &at91rm9200_timer_irq);
201201
202202 /* The 32KiHz "Slow Clock" (tick every 30517.58 nanoseconds) is used
203203 * directly for the clocksource and all clockevents, after adjusting
arch/arm/mach-at91/at91sam9260_devices.c+5−1
@@ -726,6 +726,8 @@ static struct resource rtt_resources[] = { · 725 unmodified lines
726726 .flags = IORESOURCE_MEM,
727727 }, {
728728 .flags = IORESOURCE_MEM,
729+ }, {
730+ .flags = IORESOURCE_IRQ,
729731 },
730732 };
731733
@@ -744,10 +746,12 @@ static void __init at91_add_device_rtt_rtc(void) · 12 unmodified lines
744746 * The second resource is needed:
745747 * GPBR will serve as the storage for RTC time offset
746748 */
747− at91sam9260_rtt_device.num_resources = 2;
749+ at91sam9260_rtt_device.num_resources = 3;
748750 rtt_resources[1].start = AT91SAM9260_BASE_GPBR +
749751 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR;
750752 rtt_resources[1].end = rtt_resources[1].start + 3;
753+ rtt_resources[2].start = NR_IRQS_LEGACY + AT91_ID_SYS;
754+ rtt_resources[2].end = NR_IRQS_LEGACY + AT91_ID_SYS;
751755 }
752756 #else
753757 static void __init at91_add_device_rtt_rtc(void)
arch/arm/mach-at91/at91sam9261_devices.c+5−1
@@ -609,6 +609,8 @@ static struct resource rtt_resources[] = { · 608 unmodified lines
609609 .flags = IORESOURCE_MEM,
610610 }, {
611611 .flags = IORESOURCE_MEM,
612+ }, {
613+ .flags = IORESOURCE_IRQ,
612614 }
613615 };
614616
@@ -626,10 +628,12 @@ static void __init at91_add_device_rtt_rtc(void) · 11 unmodified lines
626628 * The second resource is needed:
627629 * GPBR will serve as the storage for RTC time offset
628630 */
629− at91sam9261_rtt_device.num_resources = 2;
631+ at91sam9261_rtt_device.num_resources = 3;
630632 rtt_resources[1].start = AT91SAM9261_BASE_GPBR +
631633 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR;
632634 rtt_resources[1].end = rtt_resources[1].start + 3;
635+ rtt_resources[2].start = NR_IRQS_LEGACY + AT91_ID_SYS;
636+ rtt_resources[2].end = NR_IRQS_LEGACY + AT91_ID_SYS;
633637 }
634638 #else
635639 static void __init at91_add_device_rtt_rtc(void)
arch/arm/mach-at91/at91sam9263_devices.c+8−2
@@ -990,6 +990,8 @@ static struct resource rtt0_resources[] = { · 989 unmodified lines
990990 .flags = IORESOURCE_MEM,
991991 }, {
992992 .flags = IORESOURCE_MEM,
993+ }, {
994+ .flags = IORESOURCE_IRQ,
993995 }
994996 };
995997
@@ -1006,6 +1008,8 @@ static struct resource rtt1_resources[] = { · 10 unmodified lines
10061008 .flags = IORESOURCE_MEM,
10071009 }, {
10081010 .flags = IORESOURCE_MEM,
1011+ }, {
1012+ .flags = IORESOURCE_IRQ,
10091013 }
10101014 };
10111015
@@ -1027,14 +1031,14 @@ static void __init at91_add_device_rtt_rtc(void) · 15 unmodified lines
10271031 * The second resource is needed only for the chosen RTT:
10281032 * GPBR will serve as the storage for RTC time offset
10291033 */
1030− at91sam9263_rtt0_device.num_resources = 2;
1034+ at91sam9263_rtt0_device.num_resources = 3;
10311035 at91sam9263_rtt1_device.num_resources = 1;
10321036 pdev = &at91sam9263_rtt0_device;
10331037 r = rtt0_resources;
10341038 break;
10351039 case 1:
10361040 at91sam9263_rtt0_device.num_resources = 1;
1037− at91sam9263_rtt1_device.num_resources = 2;
1041+ at91sam9263_rtt1_device.num_resources = 3;
10381042 pdev = &at91sam9263_rtt1_device;
10391043 r = rtt1_resources;
10401044 break;
@@ -1047,6 +1051,8 @@ static void __init at91_add_device_rtt_rtc(void) · 6 unmodified lines
10471051 pdev->name = "rtc-at91sam9";
10481052 r[1].start = AT91SAM9263_BASE_GPBR + 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR;
10491053 r[1].end = r[1].start + 3;
1054+ r[2].start = NR_IRQS_LEGACY + AT91_ID_SYS;
1055+ r[2].end = NR_IRQS_LEGACY + AT91_ID_SYS;
10501056 }
10511057 #else
10521058 static void __init at91_add_device_rtt_rtc(void)
arch/arm/mach-at91/at91sam9g45_devices.c+5−1
@@ -1293,6 +1293,8 @@ static struct resource rtt_resources[] = { · 1292 unmodified lines
12931293 .flags = IORESOURCE_MEM,
12941294 }, {
12951295 .flags = IORESOURCE_MEM,
1296+ }, {
1297+ .flags = IORESOURCE_IRQ,
12961298 }
12971299 };
12981300
@@ -1310,10 +1312,12 @@ static void __init at91_add_device_rtt_rtc(void) · 11 unmodified lines
13101312 * The second resource is needed:
13111313 * GPBR will serve as the storage for RTC time offset
13121314 */
1313− at91sam9g45_rtt_device.num_resources = 2;
1315+ at91sam9g45_rtt_device.num_resources = 3;
13141316 rtt_resources[1].start = AT91SAM9G45_BASE_GPBR +
13151317 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR;
13161318 rtt_resources[1].end = rtt_resources[1].start + 3;
1319+ rtt_resources[2].start = NR_IRQS_LEGACY + AT91_ID_SYS;
1320+ rtt_resources[2].end = NR_IRQS_LEGACY + AT91_ID_SYS;
13171321 }
13181322 #else
13191323 static void __init at91_add_device_rtt_rtc(void)
arch/arm/mach-at91/at91sam9rl_devices.c+5−1
@@ -688,6 +688,8 @@ static struct resource rtt_resources[] = { · 687 unmodified lines
688688 .flags = IORESOURCE_MEM,
689689 }, {
690690 .flags = IORESOURCE_MEM,
691+ }, {
692+ .flags = IORESOURCE_IRQ,
691693 }
692694 };
693695
@@ -705,10 +707,12 @@ static void __init at91_add_device_rtt_rtc(void) · 11 unmodified lines
705707 * The second resource is needed:
706708 * GPBR will serve as the storage for RTC time offset
707709 */
708− at91sam9rl_rtt_device.num_resources = 2;
710+ at91sam9rl_rtt_device.num_resources = 3;
709711 rtt_resources[1].start = AT91SAM9RL_BASE_GPBR +
710712 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR;
711713 rtt_resources[1].end = rtt_resources[1].start + 3;
714+ rtt_resources[2].start = NR_IRQS_LEGACY + AT91_ID_SYS;
715+ rtt_resources[2].end = NR_IRQS_LEGACY + AT91_ID_SYS;
712716 }
713717 #else
714718 static void __init at91_add_device_rtt_rtc(void)
arch/arm/mach-at91/clock.c+12−0
@@ -63,6 +63,12 @@ EXPORT_SYMBOL_GPL(at91_pmc_base); · 62 unmodified lines
6363
6464 #define cpu_has_300M_plla() (cpu_is_at91sam9g10())
6565
66+#define cpu_has_240M_plla() (cpu_is_at91sam9261() \
67+ || cpu_is_at91sam9263() \
68+ || cpu_is_at91sam9rl())
69+
70+#define cpu_has_210M_plla() (cpu_is_at91sam9260())
71+
6672 #define cpu_has_pllb() (!(cpu_is_at91sam9rl() \
6773 || cpu_is_at91sam9g45() \
6874 || cpu_is_at91sam9x5() \
@@ -706,6 +712,12 @@ static int __init at91_pmc_init(unsigned long main_clock) · 637 unmodified lines
706712 } else if (cpu_has_800M_plla()) {
707713 if (plla.rate_hz > 800000000)
708714 pll_overclock = true;
715+ } else if (cpu_has_240M_plla()) {
716+ if (plla.rate_hz > 240000000)
717+ pll_overclock = true;
718+ } else if (cpu_has_210M_plla()) {
719+ if (plla.rate_hz > 210000000)
720+ pll_overclock = true;
709721 } else {
710722 if (plla.rate_hz > 209000000)
711723 pll_overclock = true;
arch/arm/mach-dove/common.c+2−1
@@ -102,7 +102,8 @@ void __init dove_ehci1_init(void) · 101 unmodified lines
102102 void __init dove_ge00_init(struct mv643xx_eth_platform_data *eth_data)
103103 {
104104 orion_ge00_init(eth_data, DOVE_GE00_PHYS_BASE,
105− IRQ_DOVE_GE00_SUM, IRQ_DOVE_GE00_ERR);
105+ IRQ_DOVE_GE00_SUM, IRQ_DOVE_GE00_ERR,
106+ 1600);
106107 }
107108
108109 /*****************************************************************************
arch/arm/mach-exynos/mach-origen.c+7−0
@@ -42,6 +42,7 @@ · 41 unmodified lines
4242 #include <plat/backlight.h>
4343 #include <plat/fb.h>
4444 #include <plat/mfc.h>
45+#include <plat/hdmi.h>
4546
4647 #include <mach/ohci.h>
4748 #include <mach/map.h>
@@ -734,6 +735,11 @@ static void __init origen_bt_setup(void) · 686 unmodified lines
734735 s3c_gpio_setpull(EXYNOS4_GPX2(2), S3C_GPIO_PULL_NONE);
735736 }
736737
738+/* I2C module and id for HDMIPHY */
739+static struct i2c_board_info hdmiphy_info = {
740+ I2C_BOARD_INFO("hdmiphy-exynos4210", 0x38),
741+};
742+
737743 static void s5p_tv_setup(void)
738744 {
739745 /* Direct HPD to HDMI chip */
@@ -781,6 +787,7 @@ static void __init origen_machine_init(void) · 41 unmodified lines
781787
782788 s5p_tv_setup();
783789 s5p_i2c_hdmiphy_set_platdata(NULL);
790+ s5p_hdmi_set_platdata(&hdmiphy_info, NULL, 0);
784791
785792 #ifdef CONFIG_DRM_EXYNOS
786793 s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata;
arch/arm/mach-exynos/mach-smdkv310.c+7−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
4040 #include <plat/mfc.h>
4141 #include <plat/ehci.h>
4242 #include <plat/clock.h>
43+#include <plat/hdmi.h>
4344
4445 #include <mach/map.h>
4546 #include <mach/ohci.h>
@@ -354,6 +355,11 @@ static struct platform_pwm_backlight_data smdkv310_bl_data = { · 308 unmodified lines
354355 .pwm_period_ns = 1000,
355356 };
356357
358+/* I2C module and id for HDMIPHY */
359+static struct i2c_board_info hdmiphy_info = {
360+ I2C_BOARD_INFO("hdmiphy-exynos4210", 0x38),
361+};
362+
357363 static void s5p_tv_setup(void)
358364 {
359365 /* direct HPD to HDMI chip */
@@ -388,6 +394,7 @@ static void __init smdkv310_machine_init(void) · 28 unmodified lines
388394
389395 s5p_tv_setup();
390396 s5p_i2c_hdmiphy_set_platdata(NULL);
397+ s5p_hdmi_set_platdata(&hdmiphy_info, NULL, 0);
391398
392399 samsung_keypad_set_platdata(&smdkv310_keypad_data);
393400
arch/arm/mach-gemini/irq.c+1−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <linux/sched.h>
1818 #include <asm/irq.h>
1919 #include <asm/mach/irq.h>
20+#include <asm/system_misc.h>
2021 #include <mach/hardware.h>
2122
2223 #define IRQ_SOURCE(base_addr) (base_addr + 0x00)
arch/arm/mach-imx/Makefile+5−5
@@ -9,7 +9,8 @@ obj-$(CONFIG_SOC_IMX27) += clk-imx27.o mm-imx27.o ehci-imx27.o · 8 unmodified lines
99 obj-$(CONFIG_SOC_IMX31) += mm-imx3.o cpu-imx31.o clk-imx31.o iomux-imx31.o ehci-imx31.o pm-imx3.o
1010 obj-$(CONFIG_SOC_IMX35) += mm-imx3.o cpu-imx35.o clk-imx35.o ehci-imx35.o pm-imx3.o
1111
12−obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o mm-imx5.o clk-imx51-imx53.o ehci-imx5.o pm-imx5.o cpu_op-mx51.o
12+imx5-pm-$(CONFIG_PM) += pm-imx5.o
13+obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o mm-imx5.o clk-imx51-imx53.o ehci-imx5.o $(imx5-pm-y) cpu_op-mx51.o
1314
1415 obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-gate2.o \
1516 clk-pfd.o clk-busy.o
@@ -70,14 +71,13 @@ obj-$(CONFIG_DEBUG_LL) += lluart.o · 54 unmodified lines
7071 obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o
7172 obj-$(CONFIG_HAVE_IMX_MMDC) += mmdc.o
7273 obj-$(CONFIG_HAVE_IMX_SRC) += src.o
73−obj-$(CONFIG_CPU_V7) += head-v7.o
74−AFLAGS_head-v7.o :=-Wa,-march=armv7-a
75−obj-$(CONFIG_SMP) += platsmp.o
74+AFLAGS_headsmp.o :=-Wa,-march=armv7-a
75+obj-$(CONFIG_SMP) += headsmp.o platsmp.o
7676 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
7777 obj-$(CONFIG_SOC_IMX6Q) += clk-imx6q.o mach-imx6q.o
7878
7979 ifeq ($(CONFIG_PM),y)
80−obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.o
80+obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.o headsmp.o
8181 endif
8282
8383 # i.MX5 based machines
arch/arm/mach-imx/clk-imx6q.c+5−3
@@ -152,7 +152,7 @@ enum mx6q_clks { · 151 unmodified lines
152152 ssi2, ssi3, uart_ipg, uart_serial, usboh3, usdhc1, usdhc2, usdhc3,
153153 usdhc4, vdo_axi, vpu_axi, cko1, pll1_sys, pll2_bus, pll3_usb_otg,
154154 pll4_audio, pll5_video, pll6_mlb, pll7_usb_host, pll8_enet, ssi1_ipg,
155− ssi2_ipg, ssi3_ipg, rom, usbphy1, usbphy2,
155+ ssi2_ipg, ssi3_ipg, rom, usbphy1, usbphy2, ldb_di0_div_3_5, ldb_di1_div_3_5,
156156 clk_max
157157 };
158158
@@ -288,8 +288,10 @@ int __init mx6q_clocks_init(void) · 129 unmodified lines
288288 clk[gpu3d_shader] = imx_clk_divider("gpu3d_shader", "gpu3d_shader_sel", base + 0x18, 29, 3);
289289 clk[ipu1_podf] = imx_clk_divider("ipu1_podf", "ipu1_sel", base + 0x3c, 11, 3);
290290 clk[ipu2_podf] = imx_clk_divider("ipu2_podf", "ipu2_sel", base + 0x3c, 16, 3);
291− clk[ldb_di0_podf] = imx_clk_divider("ldb_di0_podf", "ldb_di0_sel", base + 0x20, 10, 1);
292− clk[ldb_di1_podf] = imx_clk_divider("ldb_di1_podf", "ldb_di1_sel", base + 0x20, 11, 1);
291+ clk[ldb_di0_div_3_5] = imx_clk_fixed_factor("ldb_di0_div_3_5", "ldb_di0_sel", 2, 7);
292+ clk[ldb_di0_podf] = imx_clk_divider("ldb_di0_podf", "ldb_di0_div_3_5", base + 0x20, 10, 1);
293+ clk[ldb_di1_div_3_5] = imx_clk_fixed_factor("ldb_di1_div_3_5", "ldb_di1_sel", 2, 7);
294+ clk[ldb_di1_podf] = imx_clk_divider("ldb_di1_podf", "ldb_di1_div_3_5", base + 0x20, 11, 1);
293295 clk[ipu1_di0_pre] = imx_clk_divider("ipu1_di0_pre", "ipu1_di0_pre_sel", base + 0x34, 3, 3);
294296 clk[ipu1_di1_pre] = imx_clk_divider("ipu1_di1_pre", "ipu1_di1_pre_sel", base + 0x34, 12, 3);
295297 clk[ipu2_di0_pre] = imx_clk_divider("ipu2_di0_pre", "ipu2_di0_pre_sel", base + 0x38, 3, 3);
arch/arm/mach-imx/headsmp.Srenamed from arch/arm/mach-imx/head-v7.S+0−0

File renamed without changes.

arch/arm/mach-imx/hotplug.c+3−20
@@ -42,22 +42,6 @@ static inline void cpu_enter_lowpower(void) · 41 unmodified lines
4242 : "cc");
4343 }
4444
45−static inline void cpu_leave_lowpower(void)
46−{
47− unsigned int v;
48−
49− asm volatile(
50− "mrc p15, 0, %0, c1, c0, 0\n"
51− " orr %0, %0, %1\n"
52− " mcr p15, 0, %0, c1, c0, 0\n"
53− " mrc p15, 0, %0, c1, c0, 1\n"
54− " orr %0, %0, %2\n"
55− " mcr p15, 0, %0, c1, c0, 1\n"
56− : "=&r" (v)
57− : "Ir" (CR_C), "Ir" (0x40)
58− : "cc");
59−}
60−
6145 /*
6246 * platform-specific code to shutdown a CPU
6347 *
@@ -67,11 +51,10 @@ void platform_cpu_die(unsigned int cpu) · 3 unmodified lines
6751 {
6852 cpu_enter_lowpower();
6953 imx_enable_cpu(cpu, false);
70− cpu_do_idle();
71− cpu_leave_lowpower();
7254
73− /* We should never return from idle */
74− panic("cpu %d unexpectedly exit from shutdown\n", cpu);
55+ /* spin here until hardware takes it down */
56+ while (1)
57+ ;
7558 }
7659
7760 int platform_cpu_disable(unsigned int cpu)
arch/arm/mach-imx/mach-imx6q.c+2−2
@@ -71,7 +71,7 @@ soft: · 70 unmodified lines
7171 /* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */
7272 static int ksz9021rn_phy_fixup(struct phy_device *phydev)
7373 {
74− if (IS_ENABLED(CONFIG_PHYLIB)) {
74+ if (IS_BUILTIN(CONFIG_PHYLIB)) {
7575 /* min rx data delay */
7676 phy_write(phydev, 0x0b, 0x8105);
7777 phy_write(phydev, 0x0c, 0x0000);
@@ -112,7 +112,7 @@ put_clk: · 34 unmodified lines
112112
113113 static void __init imx6q_sabrelite_init(void)
114114 {
115− if (IS_ENABLED(CONFIG_PHYLIB))
115+ if (IS_BUILTIN(CONFIG_PHYLIB))
116116 phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
117117 ksz9021rn_phy_fixup);
118118 imx6q_sabrelite_cko1_setup();
arch/arm/mach-kirkwood/Makefile.boot+2−1
@@ -7,7 +7,8 @@ dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns320.dtb · 6 unmodified lines
77 dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns325.dtb
88 dtb-$(CONFIG_MACH_ICONNECT_DT) += kirkwood-iconnect.dtb
99 dtb-$(CONFIG_MACH_IB62X0_DT) += kirkwood-ib62x0.dtb
10−dtb-$(CONFIG_MACH_TS219_DT) += kirkwood-qnap-ts219.dtb
10+dtb-$(CONFIG_MACH_TS219_DT) += kirkwood-ts219-6281.dtb
11+dtb-$(CONFIG_MACH_TS219_DT) += kirkwood-ts219-6282.dtb
1112 dtb-$(CONFIG_MACH_GOFLEXNET_DT) += kirkwood-goflexnet.dtb
1213 dtb-$(CONFIG_MACH_LSXL_DT) += kirkwood-lschlv2.dtb
1314 dtb-$(CONFIG_MACH_LSXL_DT) += kirkwood-lsxhl.dtb
arch/arm/mach-kirkwood/common.c+9−2
@@ -301,7 +301,7 @@ void __init kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data) · 300 unmodified lines
301301 {
302302 orion_ge00_init(eth_data,
303303 GE00_PHYS_BASE, IRQ_KIRKWOOD_GE00_SUM,
304− IRQ_KIRKWOOD_GE00_ERR);
304+ IRQ_KIRKWOOD_GE00_ERR, 1600);
305305 /* The interface forgets the MAC address assigned by u-boot if
306306 the clock is turned off, so claim the clk now. */
307307 clk_prepare_enable(ge0);
@@ -315,7 +315,7 @@ void __init kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data) · 7 unmodified lines
315315 {
316316 orion_ge01_init(eth_data,
317317 GE01_PHYS_BASE, IRQ_KIRKWOOD_GE01_SUM,
318− IRQ_KIRKWOOD_GE01_ERR);
318+ IRQ_KIRKWOOD_GE01_ERR, 1600);
319319 clk_prepare_enable(ge1);
320320 }
321321
@@ -517,6 +517,13 @@ void __init kirkwood_wdt_init(void) · 195 unmodified lines
517517 void __init kirkwood_init_early(void)
518518 {
519519 orion_time_set_base(TIMER_VIRT_BASE);
520+
521+ /*
522+ * Some Kirkwood devices allocate their coherent buffers from atomic
523+ * context. Increase size of atomic coherent pool to make sure such
524+ * the allocations won't fail.
525+ */
526+ init_dma_coherent_pool_size(SZ_1M);
520527 }
521528
522529 int kirkwood_tclk;
arch/arm/mach-kirkwood/db88f6281-bp-setup.c+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010
1111 #include <linux/kernel.h>
1212 #include <linux/init.h>
13+#include <linux/sizes.h>
1314 #include <linux/platform_device.h>
1415 #include <linux/mtd/partitions.h>
1516 #include <linux/ata_platform.h>
arch/arm/mach-mmp/sram.c+1−1
@@ -68,7 +68,7 @@ static int __devinit sram_probe(struct platform_device *pdev) · 67 unmodified lines
6868 struct resource *res;
6969 int ret = 0;
7070
71− if (!pdata && !pdata->pool_name)
71+ if (!pdata || !pdata->pool_name)
7272 return -ENODEV;
7373
7474 info = kzalloc(sizeof(*info), GFP_KERNEL);
arch/arm/mach-mv78xx0/addr-map.c+1−1
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737 #define WIN0_OFF(n) (BRIDGE_VIRT_BASE + 0x0000 + ((n) << 4))
3838 #define WIN8_OFF(n) (BRIDGE_VIRT_BASE + 0x0900 + (((n) - 8) << 4))
3939
40−static void __init __iomem *win_cfg_base(int win)
40+static void __init __iomem *win_cfg_base(const struct orion_addr_map_cfg *cfg, int win)
4141 {
4242 /*
4343 * Find the control register base address for this window.
arch/arm/mach-mv78xx0/common.c+4−2
@@ -213,7 +213,8 @@ void __init mv78xx0_ge00_init(struct mv643xx_eth_platform_data *eth_data) · 212 unmodified lines
213213 {
214214 orion_ge00_init(eth_data,
215215 GE00_PHYS_BASE, IRQ_MV78XX0_GE00_SUM,
216− IRQ_MV78XX0_GE_ERR);
216+ IRQ_MV78XX0_GE_ERR,
217+ MV643XX_TX_CSUM_DEFAULT_LIMIT);
217218 }
218219
219220
@@ -224,7 +225,8 @@ void __init mv78xx0_ge01_init(struct mv643xx_eth_platform_data *eth_data) · 4 unmodified lines
224225 {
225226 orion_ge01_init(eth_data,
226227 GE01_PHYS_BASE, IRQ_MV78XX0_GE01_SUM,
227− NO_IRQ);
228+ NO_IRQ,
229+ MV643XX_TX_CSUM_DEFAULT_LIMIT);
228230 }
229231
230232
arch/arm/mach-omap1/board-ams-delta.c+0−1
@@ -37,7 +37,6 @@ · 36 unmodified lines
3737 #include <plat/board-ams-delta.h>
3838 #include <plat/keypad.h>
3939 #include <plat/mux.h>
40−#include <plat/board.h>
4140
4241 #include <mach/hardware.h>
4342 #include <mach/ams-delta-fiq.h>
arch/arm/mach-omap1/board-fsample.c+0−1
@@ -32,7 +32,6 @@ · 31 unmodified lines
3232 #include <plat/flash.h>
3333 #include <plat/fpga.h>
3434 #include <plat/keypad.h>
35−#include <plat/board.h>
3635
3736 #include <mach/hardware.h>
3837
arch/arm/mach-omap1/board-generic.c+0−6
@@ -23,7 +23,6 @@ · 22 unmodified lines
2323 #include <asm/mach/map.h>
2424
2525 #include <plat/mux.h>
26−#include <plat/board.h>
2726
2827 #include <mach/usb.h>
2928
@@ -52,9 +51,6 @@ static struct omap_usb_config generic1610_usb_config __initdata = { · 22 unmodified lines
5251 };
5352 #endif
5453
55−static struct omap_board_config_kernel generic_config[] __initdata = {
56−};
57−
5854 static void __init omap_generic_init(void)
5955 {
6056 #ifdef CONFIG_ARCH_OMAP15XX
@@ -76,8 +72,6 @@ static void __init omap_generic_init(void) · 15 unmodified lines
7672 }
7773 #endif
7874
79− omap_board_config = generic_config;
80− omap_board_config_size = ARRAY_SIZE(generic_config);
8175 omap_serial_init();
8276 omap_register_i2c_bus(1, 100, NULL, 0);
8377 }
arch/arm/mach-omap1/board-htcherald.c+0−1
@@ -42,7 +42,6 @@ · 41 unmodified lines
4242 #include <asm/mach/arch.h>
4343
4444 #include <plat/omap7xx.h>
45−#include <plat/board.h>
4645 #include <plat/keypad.h>
4746 #include <plat/mmc.h>
4847
arch/arm/mach-omap1/board-nokia770.c+0−1
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626 #include <asm/mach/map.h>
2727
2828 #include <plat/mux.h>
29−#include <plat/board.h>
3029 #include <plat/keypad.h>
3130 #include <plat/lcd_mipid.h>
3231 #include <plat/mmc.h>
arch/arm/mach-omap1/board-osk.c+1−0
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 #include <linux/mtd/partitions.h>
4040 #include <linux/mtd/physmap.h>
4141 #include <linux/i2c/tps65010.h>
42+#include <linux/platform_data/omap1_bl.h>
4243
4344 #include <asm/mach-types.h>
4445 #include <asm/mach/arch.h>
arch/arm/mach-omap1/board-palmte.c+1−1
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <linux/interrupt.h>
2929 #include <linux/apm-emulation.h>
3030 #include <linux/omapfb.h>
31+#include <linux/platform_data/omap1_bl.h>
3132
3233 #include <asm/mach-types.h>
3334 #include <asm/mach/arch.h>
@@ -37,7 +38,6 @@ · 3 unmodified lines
3738 #include <plat/mux.h>
3839 #include <plat/tc.h>
3940 #include <plat/dma.h>
40−#include <plat/board.h>
4141 #include <plat/irda.h>
4242 #include <plat/keypad.h>
4343
arch/arm/mach-omap1/board-palmtt.c+1−1
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 #include <linux/omapfb.h>
2828 #include <linux/spi/spi.h>
2929 #include <linux/spi/ads7846.h>
30+#include <linux/platform_data/omap1_bl.h>
3031
3132 #include <asm/mach-types.h>
3233 #include <asm/mach/arch.h>
@@ -37,7 +38,6 @@ · 4 unmodified lines
3738 #include <plat/mux.h>
3839 #include <plat/dma.h>
3940 #include <plat/tc.h>
40−#include <plat/board.h>
4141 #include <plat/irda.h>
4242 #include <plat/keypad.h>
4343
arch/arm/mach-omap1/board-palmz71.c+1−1
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 #include <linux/omapfb.h>
3131 #include <linux/spi/spi.h>
3232 #include <linux/spi/ads7846.h>
33+#include <linux/platform_data/omap1_bl.h>
3334
3435 #include <asm/mach-types.h>
3536 #include <asm/mach/arch.h>
@@ -39,7 +40,6 @@ · 3 unmodified lines
3940 #include <plat/mux.h>
4041 #include <plat/dma.h>
4142 #include <plat/tc.h>
42−#include <plat/board.h>
4343 #include <plat/irda.h>
4444 #include <plat/keypad.h>
4545
arch/arm/mach-omap1/board-perseus2.c+0−1
@@ -32,7 +32,6 @@ · 31 unmodified lines
3232 #include <plat/fpga.h>
3333 #include <plat/flash.h>
3434 #include <plat/keypad.h>
35−#include <plat/board.h>
3635
3736 #include <mach/hardware.h>
3837
arch/arm/mach-omap1/board-sx1.c+0−1
@@ -38,7 +38,6 @@ · 37 unmodified lines
3838 #include <plat/dma.h>
3939 #include <plat/irda.h>
4040 #include <plat/tc.h>
41−#include <plat/board.h>
4241 #include <plat/keypad.h>
4342 #include <plat/board-sx1.h>
4443
arch/arm/mach-omap1/board-voiceblue.c+0−6
@@ -35,7 +35,6 @@ · 34 unmodified lines
3535 #include <plat/flash.h>
3636 #include <plat/mux.h>
3737 #include <plat/tc.h>
38−#include <plat/board.h>
3938
4039 #include <mach/hardware.h>
4140 #include <mach/usb.h>
@@ -155,9 +154,6 @@ static struct omap_usb_config voiceblue_usb_config __initdata = { · 113 unmodified lines
155154 .pins[2] = 6,
156155 };
157156
158−static struct omap_board_config_kernel voiceblue_config[] = {
159−};
160−
161157 #define MACHINE_PANICED 1
162158 #define MACHINE_REBOOTING 2
163159 #define MACHINE_REBOOT 4
@@ -275,8 +271,6 @@ static void __init voiceblue_init(void) · 111 unmodified lines
275271 voiceblue_smc91x_resources[1].start = gpio_to_irq(8);
276272 voiceblue_smc91x_resources[1].end = gpio_to_irq(8);
277273 platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices));
278− omap_board_config = voiceblue_config;
279− omap_board_config_size = ARRAY_SIZE(voiceblue_config);
280274 omap_serial_init();
281275 omap1_usb_init(&voiceblue_usb_config);
282276 omap_register_i2c_bus(1, 100, NULL, 0);
arch/arm/mach-omap1/clock_data.c+0−8
@@ -25,7 +25,6 @@ · 24 unmodified lines
2525 #include <plat/clock.h>
2626 #include <plat/cpu.h>
2727 #include <plat/clkdev_omap.h>
28−#include <plat/board.h>
2928 #include <plat/sram.h> /* for omap_sram_reprogram_clock() */
3029
3130 #include <mach/hardware.h>
@@ -788,7 +787,6 @@ u32 cpu_mask; · 756 unmodified lines
788787 int __init omap1_clk_init(void)
789788 {
790789 struct omap_clk *c;
791− const struct omap_clock_config *info;
792790 int crystal_type = 0; /* Default 12 MHz */
793791 u32 reg;
794792
@@ -837,12 +835,6 @@ int __init omap1_clk_init(void) · 42 unmodified lines
837835 ck_dpll1_p = clk_get(NULL, "ck_dpll1");
838836 ck_ref_p = clk_get(NULL, "ck_ref");
839837
840− info = omap_get_config(OMAP_TAG_CLOCK, struct omap_clock_config);
841− if (info != NULL) {
842− if (!cpu_is_omap15xx())
843− crystal_type = info->system_clock_type;
844− }
845−
846838 if (cpu_is_omap7xx())
847839 ck_ref.rate = 13000000;
848840 if (cpu_is_omap16xx() && crystal_type == 2)
arch/arm/mach-omap1/devices.c+0−1
@@ -20,7 +20,6 @@ · 19 unmodified lines
2020 #include <asm/mach/map.h>
2121
2222 #include <plat/tc.h>
23−#include <plat/board.h>
2423 #include <plat/mux.h>
2524 #include <plat/dma.h>
2625 #include <plat/mmc.h>
arch/arm/mach-omap1/serial.c+0−1
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222
2323 #include <asm/mach-types.h>
2424
25−#include <plat/board.h>
2625 #include <plat/mux.h>
2726 #include <plat/fpga.h>
2827
arch/arm/mach-omap2/Kconfig+2−1
@@ -62,13 +62,14 @@ config ARCH_OMAP4 · 61 unmodified lines
6262 select PM_OPP if PM
6363 select USB_ARCH_HAS_EHCI if USB_SUPPORT
6464 select ARM_CPU_SUSPEND if PM
65− select ARCH_NEEDS_CPU_IDLE_COUPLED
65+ select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
6666
6767 config SOC_OMAP5
6868 bool "TI OMAP5"
6969 select CPU_V7
7070 select ARM_GIC
7171 select HAVE_SMP
72+ select ARM_CPU_SUSPEND if PM
7273
7374 comment "OMAP Core Type"
7475 depends on ARCH_OMAP2
arch/arm/mach-omap2/board-2430sdp.c+0−1
@@ -33,7 +33,6 @@ · 32 unmodified lines
3333 #include <asm/mach/arch.h>
3434 #include <asm/mach/map.h>
3535
36−#include <plat/board.h>
3736 #include "common.h"
3837 #include <plat/gpmc.h>
3938 #include <plat/usb.h>
arch/arm/mach-omap2/board-3430sdp.c+0−6
@@ -31,7 +31,6 @@ · 30 unmodified lines
3131 #include <asm/mach/map.h>
3232
3333 #include <plat/mcspi.h>
34−#include <plat/board.h>
3534 #include <plat/usb.h>
3635 #include "common.h"
3736 #include <plat/dma.h>
@@ -191,9 +190,6 @@ static struct omap_dss_board_info sdp3430_dss_data = { · 153 unmodified lines
191190 .default_device = &sdp3430_lcd_device,
192191 };
193192
194−static struct omap_board_config_kernel sdp3430_config[] __initdata = {
195−};
196−
197193 static struct omap2_hsmmc_info mmc[] = {
198194 {
199195 .mmc = 1,
@@ -576,8 +572,6 @@ static void __init omap_3430sdp_init(void) · 376 unmodified lines
576572 int gpio_pendown;
577573
578574 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
579− omap_board_config = sdp3430_config;
580− omap_board_config_size = ARRAY_SIZE(sdp3430_config);
581575 omap_hsmmc_init(mmc);
582576 omap3430_i2c_init();
583577 omap_display_init(&sdp3430_dss_data);
arch/arm/mach-omap2/board-3630sdp.c+0−6
@@ -17,7 +17,6 @@ · 16 unmodified lines
1717 #include <asm/mach/arch.h>
1818
1919 #include "common.h"
20−#include <plat/board.h>
2120 #include <plat/gpmc-smc91x.h>
2221 #include <plat/usb.h>
2322
@@ -67,9 +66,6 @@ static const struct usbhs_omap_board_data usbhs_bdata __initconst = { · 43 unmodified lines
6766 .reset_gpio_port[2] = -EINVAL
6867 };
6968
70−static struct omap_board_config_kernel sdp_config[] __initdata = {
71−};
72−
7369 #ifdef CONFIG_OMAP_MUX
7470 static struct omap_board_mux board_mux[] __initdata = {
7571 { .reg_offset = OMAP_MUX_TERMINATOR },
@@ -197,8 +193,6 @@ static struct flash_partitions sdp_flash_partitions[] = { · 121 unmodified lines
197193 static void __init omap_sdp_init(void)
198194 {
199195 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
200− omap_board_config = sdp_config;
201− omap_board_config_size = ARRAY_SIZE(sdp_config);
202196 zoom_peripherals_init();
203197 omap_sdrc_init(h8mbx00u0mer0em_sdrc_params,
204198 h8mbx00u0mer0em_sdrc_params);
arch/arm/mach-omap2/board-4430sdp.c+0−1
@@ -34,7 +34,6 @@ · 33 unmodified lines
3434 #include <asm/mach/arch.h>
3535 #include <asm/mach/map.h>
3636
37−#include <plat/board.h>
3837 #include "common.h"
3938 #include <plat/usb.h>
4039 #include <plat/mmc.h>
arch/arm/mach-omap2/board-am3517crane.c+0−9
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626 #include <asm/mach/arch.h>
2727 #include <asm/mach/map.h>
2828
29−#include <plat/board.h>
3029 #include "common.h"
3130 #include <plat/usb.h>
3231
@@ -37,11 +36,6 @@ · 4 unmodified lines
3736 #define GPIO_USB_POWER 35
3837 #define GPIO_USB_NRESET 38
3938
40−
41−/* Board initialization */
42−static struct omap_board_config_kernel am3517_crane_config[] __initdata = {
43−};
44−
4539 #ifdef CONFIG_OMAP_MUX
4640 static struct omap_board_mux board_mux[] __initdata = {
4741 { .reg_offset = OMAP_MUX_TERMINATOR },
@@ -67,9 +61,6 @@ static void __init am3517_crane_init(void) · 19 unmodified lines
6761 omap_serial_init();
6862 omap_sdrc_init(NULL, NULL);
6963
70− omap_board_config = am3517_crane_config;
71− omap_board_config_size = ARRAY_SIZE(am3517_crane_config);
72−
7364 /* Configure GPIO for EHCI port */
7465 if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) {
7566 pr_err("Can not configure mux for GPIO_USB_NRESET %d\n",
arch/arm/mach-omap2/board-am3517evm.c+0−6
@@ -32,7 +32,6 @@ · 31 unmodified lines
3232 #include <asm/mach/arch.h>
3333 #include <asm/mach/map.h>
3434
35−#include <plat/board.h>
3635 #include "common.h"
3736 #include <plat/usb.h>
3837 #include <video/omapdss.h>
@@ -324,9 +323,6 @@ static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata) · 285 unmodified lines
324323 platform_device_register(&am3517_hecc_device);
325324 }
326325
327−static struct omap_board_config_kernel am3517_evm_config[] __initdata = {
328−};
329−
330326 static struct omap2_hsmmc_info mmc[] = {
331327 {
332328 .mmc = 1,
@@ -346,8 +342,6 @@ static struct omap2_hsmmc_info mmc[] = { · 13 unmodified lines
346342
347343 static void __init am3517_evm_init(void)
348344 {
349− omap_board_config = am3517_evm_config;
350− omap_board_config_size = ARRAY_SIZE(am3517_evm_config);
351345 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
352346
353347 am3517_evm_i2c_init();
arch/arm/mach-omap2/board-apollon.c+0−1
@@ -35,7 +35,6 @@ · 34 unmodified lines
3535 #include <asm/mach/flash.h>
3636
3737 #include <plat/led.h>
38−#include <plat/board.h>
3938 #include "common.h"
4039 #include <plat/gpmc.h>
4140
arch/arm/mach-omap2/board-cm-t35.c+0−6
@@ -37,7 +37,6 @@ · 36 unmodified lines
3737 #include <asm/mach/arch.h>
3838 #include <asm/mach/map.h>
3939
40−#include <plat/board.h>
4140 #include "common.h"
4241 #include <plat/nand.h>
4342 #include <plat/gpmc.h>
@@ -714,13 +713,8 @@ static inline void cm_t35_init_mux(void) {} · 670 unmodified lines
714713 static inline void cm_t3730_init_mux(void) {}
715714 #endif
716715
717−static struct omap_board_config_kernel cm_t35_config[] __initdata = {
718−};
719−
720716 static void __init cm_t3x_common_init(void)
721717 {
722− omap_board_config = cm_t35_config;
723− omap_board_config_size = ARRAY_SIZE(cm_t35_config);
724718 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
725719 omap_serial_init();
726720 omap_sdrc_init(mt46h32m32lf6_sdrc_params,
arch/arm/mach-omap2/board-cm-t3517.c+0−6
@@ -38,7 +38,6 @@ · 37 unmodified lines
3838 #include <asm/mach/arch.h>
3939 #include <asm/mach/map.h>
4040
41−#include <plat/board.h>
4241 #include "common.h"
4342 #include <plat/usb.h>
4443 #include <plat/nand.h>
@@ -249,9 +248,6 @@ static void __init cm_t3517_init_nand(void) · 204 unmodified lines
249248 static inline void cm_t3517_init_nand(void) {}
250249 #endif
251250
252−static struct omap_board_config_kernel cm_t3517_config[] __initdata = {
253−};
254−
255251 #ifdef CONFIG_OMAP_MUX
256252 static struct omap_board_mux board_mux[] __initdata = {
257253 /* GPIO186 - Green LED */
@@ -285,8 +281,6 @@ static void __init cm_t3517_init(void) · 27 unmodified lines
285281 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
286282 omap_serial_init();
287283 omap_sdrc_init(NULL, NULL);
288− omap_board_config = cm_t3517_config;
289− omap_board_config_size = ARRAY_SIZE(cm_t3517_config);
290284 cm_t3517_init_leds();
291285 cm_t3517_init_nand();
292286 cm_t3517_init_rtc();
arch/arm/mach-omap2/board-devkit8000.c+0−1
@@ -40,7 +40,6 @@ · 39 unmodified lines
4040 #include <asm/mach/map.h>
4141 #include <asm/mach/flash.h>
4242
43−#include <plat/board.h>
4443 #include "common.h"
4544 #include <plat/gpmc.h>
4645 #include <plat/nand.h>
arch/arm/mach-omap2/board-generic.c+0−1
@@ -20,7 +20,6 @@ · 19 unmodified lines
2020 #include <asm/hardware/gic.h>
2121 #include <asm/mach/arch.h>
2222
23−#include <plat/board.h>
2423 #include "common.h"
2524 #include "common-board-devices.h"
2625
arch/arm/mach-omap2/board-h4.c+1−1
@@ -32,11 +32,11 @@ · 31 unmodified lines
3232 #include <asm/mach/arch.h>
3333 #include <asm/mach/map.h>
3434
35−#include <plat/board.h>
3635 #include "common.h"
3736 #include <plat/menelaus.h>
3837 #include <plat/dma.h>
3938 #include <plat/gpmc.h>
39+#include <plat/debug-devices.h>
4040
4141 #include <video/omapdss.h>
4242 #include <video/omap-panel-generic-dpi.h>
arch/arm/mach-omap2/board-igep0020.c+2−1
@@ -29,7 +29,6 @@ · 28 unmodified lines
2929 #include <asm/mach-types.h>
3030 #include <asm/mach/arch.h>
3131
32−#include <plat/board.h>
3332 #include "common.h"
3433 #include <plat/gpmc.h>
3534 #include <plat/usb.h>
@@ -554,6 +553,8 @@ static const struct usbhs_omap_board_data igep3_usbhs_bdata __initconst = { · 518 unmodified lines
554553
555554 #ifdef CONFIG_OMAP_MUX
556555 static struct omap_board_mux board_mux[] __initdata = {
556+ /* SMSC9221 LAN Controller ETH IRQ (GPIO_176) */
557+ OMAP3_MUX(MCSPI1_CS2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
557558 { .reg_offset = OMAP_MUX_TERMINATOR },
558559 };
559560 #endif
arch/arm/mach-omap2/board-ldp.c+0−1
@@ -35,7 +35,6 @@ · 34 unmodified lines
3535 #include <asm/mach/map.h>
3636
3737 #include <plat/mcspi.h>
38−#include <plat/board.h>
3938 #include "common.h"
4039 #include <plat/gpmc.h>
4140 #include <mach/board-zoom.h>
arch/arm/mach-omap2/board-n8x0.c+0−1
@@ -25,7 +25,6 @@ · 24 unmodified lines
2525 #include <asm/mach/arch.h>
2626 #include <asm/mach-types.h>
2727
28−#include <plat/board.h>
2928 #include "common.h"
3029 #include <plat/menelaus.h>
3130 #include <mach/irqs.h>
arch/arm/mach-omap2/board-omap3beagle.c+0−1
@@ -39,7 +39,6 @@ · 38 unmodified lines
3939 #include <asm/mach/map.h>
4040 #include <asm/mach/flash.h>
4141
42−#include <plat/board.h>
4342 #include "common.h"
4443 #include <video/omapdss.h>
4544 #include <video/omap-panel-tfp410.h>
arch/arm/mach-omap2/board-omap3evm.c+13−7
@@ -45,7 +45,6 @@ · 44 unmodified lines
4545 #include <asm/mach/arch.h>
4646 #include <asm/mach/map.h>
4747
48−#include <plat/board.h>
4948 #include <plat/usb.h>
5049 #include <plat/nand.h>
5150 #include "common.h"
@@ -58,6 +57,7 @@ · 6 unmodified lines
5857 #include "hsmmc.h"
5958 #include "common-board-devices.h"
6059
60+#define OMAP3_EVM_TS_GPIO 175
6161 #define OMAP3_EVM_EHCI_VBUS 22
6262 #define OMAP3_EVM_EHCI_SELECT 61
6363
@@ -74,6 +74,18 @@ · 10 unmodified lines
7474 #define OMAP3EVM_GEN1_ETHR_GPIO_RST 64
7575 #define OMAP3EVM_GEN2_ETHR_GPIO_RST 7
7676
77+/*
78+ * OMAP35x EVM revision
79+ * Run time detection of EVM revision is done by reading Ethernet
80+ * PHY ID -
81+ * GEN_1 = 0x01150000
82+ * GEN_2 = 0x92200000
83+ */
84+enum {
85+ OMAP3EVM_BOARD_GEN_1 = 0, /* EVM Rev between A - D */
86+ OMAP3EVM_BOARD_GEN_2, /* EVM Rev >= Rev E */
87+};
88+
7789 static u8 omap3_evm_version;
7890
7991 u8 get_omap3_evm_rev(void)
@@ -525,9 +537,6 @@ static int __init omap3_evm_i2c_init(void) · 445 unmodified lines
525537 return 0;
526538 }
527539
528−static struct omap_board_config_kernel omap3_evm_config[] __initdata = {
529−};
530−
531540 static struct usbhs_omap_board_data usbhs_bdata __initdata = {
532541
533542 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
@@ -687,9 +696,6 @@ static void __init omap3_evm_init(void) · 153 unmodified lines
687696 obm = (cpu_is_omap3630()) ? omap36x_board_mux : omap35x_board_mux;
688697 omap3_mux_init(obm, OMAP_PACKAGE_CBB);
689698
690− omap_board_config = omap3_evm_config;
691− omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
692−
693699 omap_mux_init_gpio(63, OMAP_PIN_INPUT);
694700 omap_hsmmc_init(mmc);
695701
arch/arm/mach-omap2/board-omap3logic.c+0−1
@@ -41,7 +41,6 @@ · 40 unmodified lines
4141 #include "common-board-devices.h"
4242
4343 #include <plat/mux.h>
44−#include <plat/board.h>
4544 #include "common.h"
4645 #include <plat/gpmc-smsc911x.h>
4746 #include <plat/gpmc.h>
arch/arm/mach-omap2/board-omap3pandora.c+0−1
@@ -40,7 +40,6 @@ · 39 unmodified lines
4040 #include <asm/mach/arch.h>
4141 #include <asm/mach/map.h>
4242
43−#include <plat/board.h>
4443 #include "common.h"
4544 #include <mach/hardware.h>
4645 #include <plat/mcspi.h>
arch/arm/mach-omap2/board-omap3stalker.c+0−6
@@ -35,7 +35,6 @@ · 34 unmodified lines
3535 #include <asm/mach/map.h>
3636 #include <asm/mach/flash.h>
3737
38−#include <plat/board.h>
3938 #include "common.h"
4039 #include <plat/gpmc.h>
4140 #include <plat/nand.h>
@@ -362,9 +361,6 @@ static int __init omap3_stalker_i2c_init(void) · 320 unmodified lines
362361
363362 #define OMAP3_STALKER_TS_GPIO 175
364363
365−static struct omap_board_config_kernel omap3_stalker_config[] __initdata = {
366−};
367−
368364 static struct platform_device *omap3_stalker_devices[] __initdata = {
369365 &keys_gpio,
370366 };
@@ -399,8 +395,6 @@ static void __init omap3_stalker_init(void) · 28 unmodified lines
399395 {
400396 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
401397 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
402− omap_board_config = omap3_stalker_config;
403− omap_board_config_size = ARRAY_SIZE(omap3_stalker_config);
404398
405399 omap_mux_init_gpio(23, OMAP_PIN_INPUT);
406400 omap_hsmmc_init(mmc);
arch/arm/mach-omap2/board-omap3touchbook.c+0−1
@@ -44,7 +44,6 @@ · 43 unmodified lines
4444 #include <asm/mach/flash.h>
4545 #include <asm/system_info.h>
4646
47−#include <plat/board.h>
4847 #include "common.h"
4948 #include <plat/gpmc.h>
5049 #include <plat/nand.h>
arch/arm/mach-omap2/board-omap4panda.c+0−1
@@ -39,7 +39,6 @@ · 38 unmodified lines
3939 #include <asm/mach/map.h>
4040 #include <video/omapdss.h>
4141
42−#include <plat/board.h>
4342 #include "common.h"
4443 #include <plat/usb.h>
4544 #include <plat/mmc.h>
arch/arm/mach-omap2/board-overo.c+0−1
@@ -42,7 +42,6 @@ · 41 unmodified lines
4242 #include <asm/mach/flash.h>
4343 #include <asm/mach/map.h>
4444
45−#include <plat/board.h>
4645 #include "common.h"
4746 #include <video/omapdss.h>
4847 #include <video/omap-panel-generic-dpi.h>
arch/arm/mach-omap2/board-rx51-peripherals.c+0−1
@@ -28,7 +28,6 @@ · 27 unmodified lines
2828 #include <asm/system_info.h>
2929
3030 #include <plat/mcspi.h>
31−#include <plat/board.h>
3231 #include "common.h"
3332 #include <plat/dma.h>
3433 #include <plat/gpmc.h>
arch/arm/mach-omap2/board-rx51.c+0−1
@@ -24,7 +24,6 @@ · 23 unmodified lines
2424 #include <asm/mach/map.h>
2525
2626 #include <plat/mcspi.h>
27−#include <plat/board.h>
2827 #include "common.h"
2928 #include <plat/dma.h>
3029 #include <plat/gpmc.h>
arch/arm/mach-omap2/board-ti8168evm.c+0−6
@@ -21,7 +21,6 @@ · 20 unmodified lines
2121 #include <asm/mach/map.h>
2222
2323 #include <plat/irqs.h>
24−#include <plat/board.h>
2524 #include "common.h"
2625 #include <plat/usb.h>
2726
@@ -32,15 +31,10 @@ static struct omap_musb_board_data musb_board_data = { · 4 unmodified lines
3231 .power = 500,
3332 };
3433
35−static struct omap_board_config_kernel ti81xx_evm_config[] __initdata = {
36−};
37−
3834 static void __init ti81xx_evm_init(void)
3935 {
4036 omap_serial_init();
4137 omap_sdrc_init(NULL, NULL);
42− omap_board_config = ti81xx_evm_config;
43− omap_board_config_size = ARRAY_SIZE(ti81xx_evm_config);
4438 usb_musb_init(&musb_board_data);
4539 }
4640
arch/arm/mach-omap2/board-zoom.c+0−1
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222 #include <asm/mach/arch.h>
2323
2424 #include "common.h"
25−#include <plat/board.h>
2625 #include <plat/usb.h>
2726
2827 #include <mach/board-zoom.h>
arch/arm/mach-omap2/common-board-devices.c+0−11
@@ -35,16 +35,6 @@ static struct omap2_mcspi_device_config ads7846_mcspi_config = { · 34 unmodified lines
3535 .turbo_mode = 0,
3636 };
3737
38−/*
39− * ADS7846 driver maybe request a gpio according to the value
40− * of pdata->get_pendown_state, but we have done this. So set
41− * get_pendown_state to avoid twice gpio requesting.
42− */
43−static int omap3_get_pendown_state(void)
44−{
45− return !gpio_get_value(OMAP3_EVM_TS_GPIO);
46−}
47−
4838 static struct ads7846_platform_data ads7846_config = {
4939 .x_max = 0x0fff,
5040 .y_max = 0x0fff,
@@ -55,7 +45,6 @@ static struct ads7846_platform_data ads7846_config = { · 4 unmodified lines
5545 .debounce_rep = 1,
5646 .gpio_pendown = -EINVAL,
5747 .keep_vref_on = 1,
58− .get_pendown_state = &omap3_get_pendown_state,
5948 };
6049
6150 static struct spi_board_info ads7846_spi_board_info __initdata = {
arch/arm/mach-omap2/common-board-devices.h+0−1
@@ -4,7 +4,6 @@ · 3 unmodified lines
44 #include "twl-common.h"
55
66 #define NAND_BLOCK_SIZE SZ_128K
7−#define OMAP3_EVM_TS_GPIO 175
87
98 struct mtd_partition;
109 struct ads7846_platform_data;
arch/arm/mach-omap2/common.c+0−1
@@ -18,7 +18,6 @@ · 17 unmodified lines
1818 #include <linux/io.h>
1919
2020 #include <plat/hardware.h>
21−#include <plat/board.h>
2221 #include <plat/mux.h>
2322 #include <plat/clock.h>
2423
arch/arm/mach-omap2/cpuidle44xx.c+2−1
@@ -238,8 +238,9 @@ int __init omap4_idle_init(void) · 237 unmodified lines
238238 for_each_cpu(cpu_id, cpu_online_mask) {
239239 dev = &per_cpu(omap4_idle_dev, cpu_id);
240240 dev->cpu = cpu_id;
241+#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
241242 dev->coupled_cpus = *cpu_online_mask;
242−
243+#endif
243244 cpuidle_register_driver(&omap4_idle_driver);
244245
245246 if (cpuidle_register_device(dev)) {
arch/arm/mach-omap2/devices.c+0−1
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626 #include <asm/pmu.h>
2727
2828 #include "iomap.h"
29−#include <plat/board.h>
3029 #include <plat/dma.h>
3130 #include <plat/omap_hwmod.h>
3231 #include <plat/omap_device.h>
arch/arm/mach-omap2/gpmc-nand.c+23−6
@@ -18,18 +18,25 @@ · 17 unmodified lines
1818
1919 #include <plat/cpu.h>
2020 #include <plat/nand.h>
21−#include <plat/board.h>
2221 #include <plat/gpmc.h>
2322
24−static struct resource gpmc_nand_resource = {
25− .flags = IORESOURCE_MEM,
23+static struct resource gpmc_nand_resource[] = {
24+ {
25+ .flags = IORESOURCE_MEM,
26+ },
27+ {
28+ .flags = IORESOURCE_IRQ,
29+ },
30+ {
31+ .flags = IORESOURCE_IRQ,
32+ },
2633 };
2734
2835 static struct platform_device gpmc_nand_device = {
2936 .name = "omap2-nand",
3037 .id = 0,
31− .num_resources = 1,
32− .resource = &gpmc_nand_resource,
38+ .num_resources = ARRAY_SIZE(gpmc_nand_resource),
39+ .resource = gpmc_nand_resource,
3340 };
3441
3542 static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data)
@@ -75,6 +82,7 @@ static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data · 39 unmodified lines
7582 gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0);
7683 gpmc_cs_configure(gpmc_nand_data->cs,
7784 GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND);
85+ gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_WP, 0);
7886 err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t);
7987 if (err)
8088 return err;
@@ -90,12 +98,19 @@ int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data) · 9 unmodified lines
9098 gpmc_nand_device.dev.platform_data = gpmc_nand_data;
9199
92100 err = gpmc_cs_request(gpmc_nand_data->cs, NAND_IO_SIZE,
93− &gpmc_nand_data->phys_base);
101+ (unsigned long *)&gpmc_nand_resource[0].start);
94102 if (err < 0) {
95103 dev_err(dev, "Cannot request GPMC CS\n");
96104 return err;
97105 }
98106
107+ gpmc_nand_resource[0].end = gpmc_nand_resource[0].start +
108+ NAND_IO_SIZE - 1;
109+
110+ gpmc_nand_resource[1].start =
111+ gpmc_get_client_irq(GPMC_IRQ_FIFOEVENTENABLE);
112+ gpmc_nand_resource[2].start =
113+ gpmc_get_client_irq(GPMC_IRQ_COUNT_EVENT);
99114 /* Set timings in GPMC */
100115 err = omap2_nand_gpmc_retime(gpmc_nand_data);
101116 if (err < 0) {
@@ -108,6 +123,8 @@ int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data) · 6 unmodified lines
108123 gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_RDY_BSY, 1);
109124 }
110125
126+ gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs);
127+
111128 err = platform_device_register(&gpmc_nand_device);
112129 if (err < 0) {
113130 dev_err(dev, "Unable to register NAND device\n");
arch/arm/mach-omap2/gpmc-onenand.c+22−2
@@ -20,14 +20,21 @@ · 19 unmodified lines
2020
2121 #include <plat/cpu.h>
2222 #include <plat/onenand.h>
23−#include <plat/board.h>
2423 #include <plat/gpmc.h>
2524
25+#define ONENAND_IO_SIZE SZ_128K
26+
2627 static struct omap_onenand_platform_data *gpmc_onenand_data;
2728
29+static struct resource gpmc_onenand_resource = {
30+ .flags = IORESOURCE_MEM,
31+};
32+
2833 static struct platform_device gpmc_onenand_device = {
2934 .name = "omap2-onenand",
3035 .id = -1,
36+ .num_resources = 1,
37+ .resource = &gpmc_onenand_resource,
3138 };
3239
3340 static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
@@ -390,6 +397,8 @@ static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr) · 356 unmodified lines
390397
391398 void __init gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
392399 {
400+ int err;
401+
393402 gpmc_onenand_data = _onenand_data;
394403 gpmc_onenand_data->onenand_setup = gpmc_onenand_setup;
395404 gpmc_onenand_device.dev.platform_data = gpmc_onenand_data;
@@ -401,8 +410,19 @@ void __init gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data) · 5 unmodified lines
401410 gpmc_onenand_data->flags |= ONENAND_SYNC_READ;
402411 }
403412
413+ err = gpmc_cs_request(gpmc_onenand_data->cs, ONENAND_IO_SIZE,
414+ (unsigned long *)&gpmc_onenand_resource.start);
415+ if (err < 0) {
416+ pr_err("%s: Cannot request GPMC CS\n", __func__);
417+ return;
418+ }
419+
420+ gpmc_onenand_resource.end = gpmc_onenand_resource.start +
421+ ONENAND_IO_SIZE - 1;
422+
404423 if (platform_device_register(&gpmc_onenand_device) < 0) {
405− printk(KERN_ERR "Unable to register OneNAND device\n");
424+ pr_err("%s: Unable to register OneNAND device\n", __func__);
425+ gpmc_cs_free(gpmc_onenand_data->cs);
406426 return;
407427 }
408428 }
arch/arm/mach-omap2/gpmc-smc91x.c+0−1
@@ -17,7 +17,6 @@ · 16 unmodified lines
1717 #include <linux/io.h>
1818 #include <linux/smc91x.h>
1919
20−#include <plat/board.h>
2120 #include <plat/gpmc.h>
2221 #include <plat/gpmc-smc91x.h>
2322
arch/arm/mach-omap2/gpmc-smsc911x.c+0−1
@@ -20,7 +20,6 @@ · 19 unmodified lines
2020 #include <linux/io.h>
2121 #include <linux/smsc911x.h>
2222
23−#include <plat/board.h>
2423 #include <plat/gpmc.h>
2524 #include <plat/gpmc-smsc911x.h>
2625
arch/arm/mach-omap2/gpmc.c+139−17
@@ -78,6 +78,15 @@ · 77 unmodified lines
7878 #define ENABLE_PREFETCH (0x1 << 7)
7979 #define DMA_MPU_MODE 2
8080
81+/* XXX: Only NAND irq has been considered,currently these are the only ones used
82+ */
83+#define GPMC_NR_IRQ 2
84+
85+struct gpmc_client_irq {
86+ unsigned irq;
87+ u32 bitmask;
88+};
89+
8190 /* Structure to save gpmc cs context */
8291 struct gpmc_cs_config {
8392 u32 config1;
@@ -105,6 +114,10 @@ struct omap3_gpmc_regs { · 21 unmodified lines
105114 struct gpmc_cs_config cs_context[GPMC_CS_NUM];
106115 };
107116
117+static struct gpmc_client_irq gpmc_client_irq[GPMC_NR_IRQ];
118+static struct irq_chip gpmc_irq_chip;
119+static unsigned gpmc_irq_start;
120+
108121 static struct resource gpmc_mem_root;
109122 static struct resource gpmc_cs_mem[GPMC_CS_NUM];
110123 static DEFINE_SPINLOCK(gpmc_mem_lock);
@@ -682,6 +695,117 @@ int gpmc_prefetch_reset(int cs) · 571 unmodified lines
682695 }
683696 EXPORT_SYMBOL(gpmc_prefetch_reset);
684697
698+void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs)
699+{
700+ reg->gpmc_status = gpmc_base + GPMC_STATUS;
701+ reg->gpmc_nand_command = gpmc_base + GPMC_CS0_OFFSET +
702+ GPMC_CS_NAND_COMMAND + GPMC_CS_SIZE * cs;
703+ reg->gpmc_nand_address = gpmc_base + GPMC_CS0_OFFSET +
704+ GPMC_CS_NAND_ADDRESS + GPMC_CS_SIZE * cs;
705+ reg->gpmc_nand_data = gpmc_base + GPMC_CS0_OFFSET +
706+ GPMC_CS_NAND_DATA + GPMC_CS_SIZE * cs;
707+ reg->gpmc_prefetch_config1 = gpmc_base + GPMC_PREFETCH_CONFIG1;
708+ reg->gpmc_prefetch_config2 = gpmc_base + GPMC_PREFETCH_CONFIG2;
709+ reg->gpmc_prefetch_control = gpmc_base + GPMC_PREFETCH_CONTROL;
710+ reg->gpmc_prefetch_status = gpmc_base + GPMC_PREFETCH_STATUS;
711+ reg->gpmc_ecc_config = gpmc_base + GPMC_ECC_CONFIG;
712+ reg->gpmc_ecc_control = gpmc_base + GPMC_ECC_CONTROL;
713+ reg->gpmc_ecc_size_config = gpmc_base + GPMC_ECC_SIZE_CONFIG;
714+ reg->gpmc_ecc1_result = gpmc_base + GPMC_ECC1_RESULT;
715+ reg->gpmc_bch_result0 = gpmc_base + GPMC_ECC_BCH_RESULT_0;
716+}
717+
718+int gpmc_get_client_irq(unsigned irq_config)
719+{
720+ int i;
721+
722+ if (hweight32(irq_config) > 1)
723+ return 0;
724+
725+ for (i = 0; i < GPMC_NR_IRQ; i++)
726+ if (gpmc_client_irq[i].bitmask & irq_config)
727+ return gpmc_client_irq[i].irq;
728+
729+ return 0;
730+}
731+
732+static int gpmc_irq_endis(unsigned irq, bool endis)
733+{
734+ int i;
735+ u32 regval;
736+
737+ for (i = 0; i < GPMC_NR_IRQ; i++)
738+ if (irq == gpmc_client_irq[i].irq) {
739+ regval = gpmc_read_reg(GPMC_IRQENABLE);
740+ if (endis)
741+ regval |= gpmc_client_irq[i].bitmask;
742+ else
743+ regval &= ~gpmc_client_irq[i].bitmask;
744+ gpmc_write_reg(GPMC_IRQENABLE, regval);
745+ break;
746+ }
747+
748+ return 0;
749+}
750+
751+static void gpmc_irq_disable(struct irq_data *p)
752+{
753+ gpmc_irq_endis(p->irq, false);
754+}
755+
756+static void gpmc_irq_enable(struct irq_data *p)
757+{
758+ gpmc_irq_endis(p->irq, true);
759+}
760+
761+static void gpmc_irq_noop(struct irq_data *data) { }
762+
763+static unsigned int gpmc_irq_noop_ret(struct irq_data *data) { return 0; }
764+
765+static int gpmc_setup_irq(int gpmc_irq)
766+{
767+ int i;
768+ u32 regval;
769+
770+ if (!gpmc_irq)
771+ return -EINVAL;
772+
773+ gpmc_irq_start = irq_alloc_descs(-1, 0, GPMC_NR_IRQ, 0);
774+ if (IS_ERR_VALUE(gpmc_irq_start)) {
775+ pr_err("irq_alloc_descs failed\n");
776+ return gpmc_irq_start;
777+ }
778+
779+ gpmc_irq_chip.name = "gpmc";
780+ gpmc_irq_chip.irq_startup = gpmc_irq_noop_ret;
781+ gpmc_irq_chip.irq_enable = gpmc_irq_enable;
782+ gpmc_irq_chip.irq_disable = gpmc_irq_disable;
783+ gpmc_irq_chip.irq_shutdown = gpmc_irq_noop;
784+ gpmc_irq_chip.irq_ack = gpmc_irq_noop;
785+ gpmc_irq_chip.irq_mask = gpmc_irq_noop;
786+ gpmc_irq_chip.irq_unmask = gpmc_irq_noop;
787+
788+ gpmc_client_irq[0].bitmask = GPMC_IRQ_FIFOEVENTENABLE;
789+ gpmc_client_irq[1].bitmask = GPMC_IRQ_COUNT_EVENT;
790+
791+ for (i = 0; i < GPMC_NR_IRQ; i++) {
792+ gpmc_client_irq[i].irq = gpmc_irq_start + i;
793+ irq_set_chip_and_handler(gpmc_client_irq[i].irq,
794+ &gpmc_irq_chip, handle_simple_irq);
795+ set_irq_flags(gpmc_client_irq[i].irq,
796+ IRQF_VALID | IRQF_NOAUTOEN);
797+ }
798+
799+ /* Disable interrupts */
800+ gpmc_write_reg(GPMC_IRQENABLE, 0);
801+
802+ /* clear interrupts */
803+ regval = gpmc_read_reg(GPMC_IRQSTATUS);
804+ gpmc_write_reg(GPMC_IRQSTATUS, regval);
805+
806+ return request_irq(gpmc_irq, gpmc_handle_irq, 0, "gpmc", NULL);
807+}
808+
685809 static void __init gpmc_mem_init(void)
686810 {
687811 int cs;
@@ -711,8 +835,8 @@ static void __init gpmc_mem_init(void) · 23 unmodified lines
711835
712836 static int __init gpmc_init(void)
713837 {
714− u32 l, irq;
715− int cs, ret = -EINVAL;
838+ u32 l;
839+ int ret = -EINVAL;
716840 int gpmc_irq;
717841 char *ck = NULL;
718842
@@ -761,16 +885,7 @@ static int __init gpmc_init(void) · 42 unmodified lines
761885 gpmc_write_reg(GPMC_SYSCONFIG, l);
762886 gpmc_mem_init();
763887
764− /* initalize the irq_chained */
765− irq = OMAP_GPMC_IRQ_BASE;
766− for (cs = 0; cs < GPMC_CS_NUM; cs++) {
767− irq_set_chip_and_handler(irq, &dummy_irq_chip,
768− handle_simple_irq);
769− set_irq_flags(irq, IRQF_VALID);
770− irq++;
771− }
772−
773− ret = request_irq(gpmc_irq, gpmc_handle_irq, IRQF_SHARED, "gpmc", NULL);
888+ ret = gpmc_setup_irq(gpmc_irq);
774889 if (ret)
775890 pr_err("gpmc: irq-%d could not claim: err %d\n",
776891 gpmc_irq, ret);
@@ -780,12 +895,19 @@ postcore_initcall(gpmc_init); · 3 unmodified lines
780895
781896 static irqreturn_t gpmc_handle_irq(int irq, void *dev)
782897 {
783− u8 cs;
898+ int i;
899+ u32 regval;
900+
901+ regval = gpmc_read_reg(GPMC_IRQSTATUS);
902+
903+ if (!regval)
904+ return IRQ_NONE;
905+
906+ for (i = 0; i < GPMC_NR_IRQ; i++)
907+ if (regval & gpmc_client_irq[i].bitmask)
908+ generic_handle_irq(gpmc_client_irq[i].irq);
784909
785− /* check cs to invoke the irq */
786− cs = ((gpmc_read_reg(GPMC_PREFETCH_CONFIG1)) >> CS_NUM_SHIFT) & 0x7;
787− if (OMAP_GPMC_IRQ_BASE+cs <= OMAP_GPMC_IRQ_END)
788− generic_handle_irq(OMAP_GPMC_IRQ_BASE+cs);
910+ gpmc_write_reg(GPMC_IRQSTATUS, regval);
789911
790912 return IRQ_HANDLED;
791913 }
arch/arm/mach-omap2/mux.h+0−1
@@ -127,7 +127,6 @@ struct omap_mux_partition { · 126 unmodified lines
127127 * @gpio: GPIO number
128128 * @muxnames: available signal modes for a ball
129129 * @balls: available balls on the package
130− * @partition: mux partition
131130 */
132131 struct omap_mux {
133132 u16 reg_offset;
arch/arm/mach-omap2/opp4xxx_data.c+1−1
@@ -94,7 +94,7 @@ int __init omap4_opp_init(void) · 93 unmodified lines
9494 {
9595 int r = -ENODEV;
9696
97− if (!cpu_is_omap44xx())
97+ if (!cpu_is_omap443x())
9898 return r;
9999
100100 r = omap_init_opp_table(omap44xx_opp_def_list,
arch/arm/mach-omap2/pm-debug.c+0−1
@@ -28,7 +28,6 @@ · 27 unmodified lines
2828 #include <linux/slab.h>
2929
3030 #include <plat/clock.h>
31−#include <plat/board.h>
3231 #include "powerdomain.h"
3332 #include "clockdomain.h"
3433 #include <plat/dmtimer.h>
arch/arm/mach-omap2/pm24xx.c+0−11
@@ -38,7 +38,6 @@ · 37 unmodified lines
3838 #include <plat/clock.h>
3939 #include <plat/sram.h>
4040 #include <plat/dma.h>
41−#include <plat/board.h>
4241
4342 #include <mach/irqs.h>
4443
@@ -352,16 +351,6 @@ int __init omap2_pm_init(void) · 307 unmodified lines
352351
353352 prcm_setup_regs();
354353
355− /* Hack to prevent MPU retention when STI console is enabled. */
356− {
357− const struct omap_sti_console_config *sti;
358−
359− sti = omap_get_config(OMAP_TAG_STI_CONSOLE,
360− struct omap_sti_console_config);
361− if (sti != NULL && sti->enable)
362− sti_console_enabled = 1;
363− }
364−
365354 /*
366355 * We copy the assembler sleep/wakeup routines to SRAM.
367356 * These routines need to be in SRAM as that's the only
arch/arm/mach-omap2/pm34xx.c+4−15
@@ -272,21 +272,16 @@ void omap_sram_idle(void) · 271 unmodified lines
272272 per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
273273 core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
274274
275− if (mpu_next_state < PWRDM_POWER_ON) {
276− pwrdm_pre_transition(mpu_pwrdm);
277− pwrdm_pre_transition(neon_pwrdm);
278− }
275+ pwrdm_pre_transition(NULL);
279276
280277 /* PER */
281278 if (per_next_state < PWRDM_POWER_ON) {
282− pwrdm_pre_transition(per_pwrdm);
283279 per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0;
284280 omap2_gpio_prepare_for_idle(per_going_off);
285281 }
286282
287283 /* CORE */
288284 if (core_next_state < PWRDM_POWER_ON) {
289− pwrdm_pre_transition(core_pwrdm);
290285 if (core_next_state == PWRDM_POWER_OFF) {
291286 omap3_core_save_context();
292287 omap3_cm_save_context();
@@ -339,20 +334,14 @@ void omap_sram_idle(void) · 46 unmodified lines
339334 omap2_prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF_MASK,
340335 OMAP3430_GR_MOD,
341336 OMAP3_PRM_VOLTCTRL_OFFSET);
342− pwrdm_post_transition(core_pwrdm);
343337 }
344338 omap3_intc_resume_idle();
345339
340+ pwrdm_post_transition(NULL);
341+
346342 /* PER */
347− if (per_next_state < PWRDM_POWER_ON) {
343+ if (per_next_state < PWRDM_POWER_ON)
348344 omap2_gpio_resume_after_idle();
349− pwrdm_post_transition(per_pwrdm);
350− }
351−
352− if (mpu_next_state < PWRDM_POWER_ON) {
353− pwrdm_post_transition(mpu_pwrdm);
354− pwrdm_post_transition(neon_pwrdm);
355− }
356345 }
357346
358347 static void omap3_pm_idle(void)
arch/arm/mach-omap2/serial.c+0−1
@@ -29,7 +29,6 @@ · 28 unmodified lines
2929
3030 #include <plat/omap-serial.h>
3131 #include "common.h"
32−#include <plat/board.h>
3332 #include <plat/dma.h>
3433 #include <plat/omap_hwmod.h>
3534 #include <plat/omap_device.h>
arch/arm/mach-omap2/sleep44xx.S+6−2
@@ -56,9 +56,13 @@ ppa_por_params: · 55 unmodified lines
5656 * The restore function pointer is stored at CPUx_WAKEUP_NS_PA_ADDR_OFFSET.
5757 * It returns to the caller for CPU INACTIVE and ON power states or in case
5858 * CPU failed to transition to targeted OFF/DORMANT state.
59+ *
60+ * omap4_finish_suspend() calls v7_flush_dcache_all() which doesn't save
61+ * stack frame and it expects the caller to take care of it. Hence the entire
62+ * stack frame is saved to avoid possible stack corruption.
5963 */
6064 ENTRY(omap4_finish_suspend)
61− stmfd sp!, {lr}
65+ stmfd sp!, {r4-r12, lr}
6266 cmp r0, #0x0
6367 beq do_WFI @ No lowpower state, jump to WFI
6468
@@ -226,7 +230,7 @@ scu_gp_clear: · 161 unmodified lines
226230 skip_scu_gp_clear:
227231 isb
228232 dsb
229− ldmfd sp!, {pc}
233+ ldmfd sp!, {r4-r12, pc}
230234 ENDPROC(omap4_finish_suspend)
231235
232236 /*
arch/arm/mach-omap2/twl-common.c+1−0
@@ -67,6 +67,7 @@ void __init omap_pmic_init(int bus, u32 clkrate, · 66 unmodified lines
6767 const char *pmic_type, int pmic_irq,
6868 struct twl4030_platform_data *pmic_data)
6969 {
70+ omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
7071 strncpy(pmic_i2c_board_info.type, pmic_type,
7172 sizeof(pmic_i2c_board_info.type));
7273 pmic_i2c_board_info.irq = pmic_irq;
arch/arm/mach-orion5x/common.c+2−1
@@ -109,7 +109,8 @@ void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data) · 108 unmodified lines
109109 {
110110 orion_ge00_init(eth_data,
111111 ORION5X_ETH_PHYS_BASE, IRQ_ORION5X_ETH_SUM,
112− IRQ_ORION5X_ETH_ERR);
112+ IRQ_ORION5X_ETH_ERR,
113+ MV643XX_TX_CSUM_DEFAULT_LIMIT);
113114 }
114115
115116
arch/arm/mach-s3c24xx/include/mach/dma.h+2−1
@@ -24,7 +24,8 @@ · 23 unmodified lines
2424 */
2525
2626 enum dma_ch {
27− DMACH_XD0,
27+ DMACH_DT_PROP = -1, /* not yet supported, do not use */
28+ DMACH_XD0 = 0,
2829 DMACH_XD1,
2930 DMACH_SDI,
3031 DMACH_SPI0,
arch/arm/mach-shmobile/board-armadillo800eva.c+7−6
@@ -520,13 +520,14 @@ static struct platform_device hdmi_lcdc_device = { · 519 unmodified lines
520520 };
521521
522522 /* GPIO KEY */
523−#define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
523+#define GPIO_KEY(c, g, d, ...) \
524+ { .code = c, .gpio = g, .desc = d, .active_low = 1, __VA_ARGS__ }
524525
525526 static struct gpio_keys_button gpio_buttons[] = {
526− GPIO_KEY(KEY_POWER, GPIO_PORT99, "SW1"),
527− GPIO_KEY(KEY_BACK, GPIO_PORT100, "SW2"),
528− GPIO_KEY(KEY_MENU, GPIO_PORT97, "SW3"),
529− GPIO_KEY(KEY_HOME, GPIO_PORT98, "SW4"),
527+ GPIO_KEY(KEY_POWER, GPIO_PORT99, "SW3", .wakeup = 1),
528+ GPIO_KEY(KEY_BACK, GPIO_PORT100, "SW4"),
529+ GPIO_KEY(KEY_MENU, GPIO_PORT97, "SW5"),
530+ GPIO_KEY(KEY_HOME, GPIO_PORT98, "SW6"),
530531 };
531532
532533 static struct gpio_keys_platform_data gpio_key_info = {
@@ -901,8 +902,8 @@ static struct platform_device *eva_devices[] __initdata = { · 368 unmodified lines
901902 &camera_device,
902903 &ceu0_device,
903904 &fsi_device,
904− &fsi_hdmi_device,
905905 &fsi_wm8978_device,
906+ &fsi_hdmi_device,
906907 };
907908
908909 static void __init eva_clock_init(void)
arch/arm/mach-shmobile/board-mackerel.c+2−1
@@ -695,6 +695,7 @@ static struct platform_device usbhs0_device = { · 694 unmodified lines
695695 * - J30 "open"
696696 * - modify usbhs1_get_id() USBHS_HOST -> USBHS_GADGET
697697 * - add .get_vbus = usbhs_get_vbus in usbhs1_private
698+ * - check usbhs0_device(pio)/usbhs1_device(irq) order in mackerel_devices.
698699 */
699700 #define IRQ8 evt2irq(0x0300)
700701 #define USB_PHY_MODE (1 << 4)
@@ -1325,8 +1326,8 @@ static struct platform_device *mackerel_devices[] __initdata = { · 624 unmodified lines
13251326 &nor_flash_device,
13261327 &smc911x_device,
13271328 &lcdc_device,
1328− &usbhs1_device,
13291329 &usbhs0_device,
1330+ &usbhs1_device,
13301331 &leds_device,
13311332 &fsi_device,
13321333 &fsi_ak4643_device,
arch/arm/mach-shmobile/board-marzen.c+1−1
@@ -67,7 +67,7 @@ static struct smsc911x_platform_config smsc911x_platdata = { · 66 unmodified lines
6767
6868 static struct platform_device eth_device = {
6969 .name = "smsc911x",
70− .id = 0,
70+ .id = -1,
7171 .dev = {
7272 .platform_data = &smsc911x_platdata,
7373 },
arch/arm/mach-shmobile/intc-sh73a0.c+2−2
@@ -259,9 +259,9 @@ static int sh73a0_set_wake(struct irq_data *data, unsigned int on) · 258 unmodified lines
259259 return 0; /* always allow wakeup */
260260 }
261261
262−#define RELOC_BASE 0x1000
262+#define RELOC_BASE 0x1200
263263
264−/* INTCA IRQ pins at INTCS + 0x1000 to make space for GIC+INTC handling */
264+/* INTCA IRQ pins at INTCS + RELOC_BASE to make space for GIC+INTC handling */
265265 #define INTCS_VECT_RELOC(n, vect) INTCS_VECT((n), (vect) + RELOC_BASE)
266266
267267 INTC_IRQ_PINS_32(intca_irq_pins, 0xe6900000,
arch/arm/mach-ux500/Kconfig+0−1
@@ -41,7 +41,6 @@ config MACH_HREFV60 · 40 unmodified lines
4141 config MACH_SNOWBALL
4242 bool "U8500 Snowball platform"
4343 select MACH_MOP500
44− select LEDS_GPIO
4544 help
4645 Include support for the snowball development platform.
4746
arch/arm/mach-ux500/board-mop500-msp.c+5−5
@@ -191,9 +191,9 @@ static struct platform_device *db8500_add_msp_i2s(struct device *parent, · 190 unmodified lines
191191 return pdev;
192192 }
193193
194−/* Platform device for ASoC U8500 machine */
195−static struct platform_device snd_soc_u8500 = {
196− .name = "snd-soc-u8500",
194+/* Platform device for ASoC MOP500 machine */
195+static struct platform_device snd_soc_mop500 = {
196+ .name = "snd-soc-mop500",
197197 .id = 0,
198198 .dev = {
199199 .platform_data = NULL,
@@ -227,8 +227,8 @@ int mop500_msp_init(struct device *parent) · 27 unmodified lines
227227 {
228228 struct platform_device *msp1;
229229
230− pr_info("%s: Register platform-device 'snd-soc-u8500'.\n", __func__);
231− platform_device_register(&snd_soc_u8500);
230+ pr_info("%s: Register platform-device 'snd-soc-mop500'.\n", __func__);
231+ platform_device_register(&snd_soc_mop500);
232232
233233 pr_info("Initialize MSP I2S-devices.\n");
234234 db8500_add_msp_i2s(parent, 0, U8500_MSP0_BASE, IRQ_DB8500_MSP0,
arch/arm/mach-ux500/board-mop500.c+4−0
@@ -776,6 +776,7 @@ static void __init u8500_init_machine(void) · 775 unmodified lines
776776 ARRAY_SIZE(mop500_platform_devs));
777777
778778 mop500_sdi_init(parent);
779+ mop500_msp_init(parent);
779780 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
780781 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
781782 i2c_register_board_info(2, mop500_i2c2_devices,
@@ -783,6 +784,8 @@ static void __init u8500_init_machine(void) · 1 unmodified line
783784
784785 mop500_uib_init();
785786
787+ } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {
788+ mop500_msp_init(parent);
786789 } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) {
787790 /*
788791 * The HREFv60 board removed a GPIO expander and routed
@@ -794,6 +797,7 @@ static void __init u8500_init_machine(void) · 5 unmodified lines
794797 ARRAY_SIZE(mop500_platform_devs));
795798
796799 hrefv60_sdi_init(parent);
800+ mop500_msp_init(parent);
797801
798802 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
799803 i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;
arch/arm/mm/dma-mapping.c+104−10
@@ -267,17 +267,19 @@ static void __dma_free_remap(void *cpu_addr, size_t size) · 266 unmodified lines
267267 vunmap(cpu_addr);
268268 }
269269
270+#define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_256K
271+
270272 struct dma_pool {
271273 size_t size;
272274 spinlock_t lock;
273275 unsigned long *bitmap;
274276 unsigned long nr_pages;
275277 void *vaddr;
276− struct page *page;
278+ struct page **pages;
277279 };
278280
279281 static struct dma_pool atomic_pool = {
280− .size = SZ_256K,
282+ .size = DEFAULT_DMA_COHERENT_POOL_SIZE,
281283 };
282284
283285 static int __init early_coherent_pool(char *p)
@@ -287,6 +289,21 @@ static int __init early_coherent_pool(char *p) · 3 unmodified lines
287289 }
288290 early_param("coherent_pool", early_coherent_pool);
289291
292+void __init init_dma_coherent_pool_size(unsigned long size)
293+{
294+ /*
295+ * Catch any attempt to set the pool size too late.
296+ */
297+ BUG_ON(atomic_pool.vaddr);
298+
299+ /*
300+ * Set architecture specific coherent pool size only if
301+ * it has not been changed by kernel command line parameter.
302+ */
303+ if (atomic_pool.size == DEFAULT_DMA_COHERENT_POOL_SIZE)
304+ atomic_pool.size = size;
305+}
306+
290307 /*
291308 * Initialise the coherent pool for atomic allocations.
292309 */
@@ -297,6 +314,7 @@ static int __init atomic_pool_init(void) · 4 unmodified lines
297314 unsigned long nr_pages = pool->size >> PAGE_SHIFT;
298315 unsigned long *bitmap;
299316 struct page *page;
317+ struct page **pages;
300318 void *ptr;
301319 int bitmap_size = BITS_TO_LONGS(nr_pages) * sizeof(long);
302320
@@ -304,21 +322,31 @@ static int __init atomic_pool_init(void) · 1 unmodified line
304322 if (!bitmap)
305323 goto no_bitmap;
306324
325+ pages = kzalloc(nr_pages * sizeof(struct page *), GFP_KERNEL);
326+ if (!pages)
327+ goto no_pages;
328+
307329 if (IS_ENABLED(CONFIG_CMA))
308330 ptr = __alloc_from_contiguous(NULL, pool->size, prot, &page);
309331 else
310332 ptr = __alloc_remap_buffer(NULL, pool->size, GFP_KERNEL, prot,
311333 &page, NULL);
312334 if (ptr) {
335+ int i;
336+
337+ for (i = 0; i < nr_pages; i++)
338+ pages[i] = page + i;
339+
313340 spin_lock_init(&pool->lock);
314341 pool->vaddr = ptr;
315− pool->page = page;
342+ pool->pages = pages;
316343 pool->bitmap = bitmap;
317344 pool->nr_pages = nr_pages;
318345 pr_info("DMA: preallocated %u KiB pool for atomic coherent allocations\n",
319346 (unsigned)pool->size / 1024);
320347 return 0;
321348 }
349+no_pages:
322350 kfree(bitmap);
323351 no_bitmap:
324352 pr_err("DMA: failed to allocate %u KiB pool for atomic coherent allocation\n",
@@ -443,27 +471,45 @@ static void *__alloc_from_pool(size_t size, struct page **ret_page) · 118 unmodified lines
443471 if (pageno < pool->nr_pages) {
444472 bitmap_set(pool->bitmap, pageno, count);
445473 ptr = pool->vaddr + PAGE_SIZE * pageno;
446− *ret_page = pool->page + pageno;
474+ *ret_page = pool->pages[pageno];
475+ } else {
476+ pr_err_once("ERROR: %u KiB atomic DMA coherent pool is too small!\n"
477+ "Please increase it with coherent_pool= kernel parameter!\n",
478+ (unsigned)pool->size / 1024);
447479 }
448480 spin_unlock_irqrestore(&pool->lock, flags);
449481
450482 return ptr;
451483 }
452484
485+static bool __in_atomic_pool(void *start, size_t size)
486+{
487+ struct dma_pool *pool = &atomic_pool;
488+ void *end = start + size;
489+ void *pool_start = pool->vaddr;
490+ void *pool_end = pool->vaddr + pool->size;
491+
492+ if (start < pool_start || start > pool_end)
493+ return false;
494+
495+ if (end <= pool_end)
496+ return true;
497+
498+ WARN(1, "Wrong coherent size(%p-%p) from atomic pool(%p-%p)\n",
499+ start, end - 1, pool_start, pool_end - 1);
500+
501+ return false;
502+}
503+
453504 static int __free_from_pool(void *start, size_t size)
454505 {
455506 struct dma_pool *pool = &atomic_pool;
456507 unsigned long pageno, count;
457508 unsigned long flags;
458509
459− if (start < pool->vaddr || start > pool->vaddr + pool->size)
510+ if (!__in_atomic_pool(start, size))
460511 return 0;
461512
462− if (start + size > pool->vaddr + pool->size) {
463− WARN(1, "freeing wrong coherent size from pool\n");
464− return 0;
465− }
466−
467513 pageno = (start - pool->vaddr) >> PAGE_SHIFT;
468514 count = size >> PAGE_SHIFT;
469515
@@ -1090,10 +1136,22 @@ static int __iommu_remove_mapping(struct device *dev, dma_addr_t iova, size_t si · 620 unmodified lines
10901136 return 0;
10911137 }
10921138
1139+static struct page **__atomic_get_pages(void *addr)
1140+{
1141+ struct dma_pool *pool = &atomic_pool;
1142+ struct page **pages = pool->pages;
1143+ int offs = (addr - pool->vaddr) >> PAGE_SHIFT;
1144+
1145+ return pages + offs;
1146+}
1147+
10931148 static struct page **__iommu_get_pages(void *cpu_addr, struct dma_attrs *attrs)
10941149 {
10951150 struct vm_struct *area;
10961151
1152+ if (__in_atomic_pool(cpu_addr, PAGE_SIZE))
1153+ return __atomic_get_pages(cpu_addr);
1154+
10971155 if (dma_get_attr(DMA_ATTR_NO_KERNEL_MAPPING, attrs))
10981156 return cpu_addr;
10991157
@@ -1103,6 +1161,34 @@ static struct page **__iommu_get_pages(void *cpu_addr, struct dma_attrs *attrs) · 3 unmodified lines
11031161 return NULL;
11041162 }
11051163
1164+static void *__iommu_alloc_atomic(struct device *dev, size_t size,
1165+ dma_addr_t *handle)
1166+{
1167+ struct page *page;
1168+ void *addr;
1169+
1170+ addr = __alloc_from_pool(size, &page);
1171+ if (!addr)
1172+ return NULL;
1173+
1174+ *handle = __iommu_create_mapping(dev, &page, size);
1175+ if (*handle == DMA_ERROR_CODE)
1176+ goto err_mapping;
1177+
1178+ return addr;
1179+
1180+err_mapping:
1181+ __free_from_pool(addr, size);
1182+ return NULL;
1183+}
1184+
1185+static void __iommu_free_atomic(struct device *dev, struct page **pages,
1186+ dma_addr_t handle, size_t size)
1187+{
1188+ __iommu_remove_mapping(dev, handle, size);
1189+ __free_from_pool(page_address(pages[0]), size);
1190+}
1191+
11061192 static void *arm_iommu_alloc_attrs(struct device *dev, size_t size,
11071193 dma_addr_t *handle, gfp_t gfp, struct dma_attrs *attrs)
11081194 {
@@ -1113,6 +1199,9 @@ static void *arm_iommu_alloc_attrs(struct device *dev, size_t size, · 4 unmodified lines
11131199 *handle = DMA_ERROR_CODE;
11141200 size = PAGE_ALIGN(size);
11151201
1202+ if (gfp & GFP_ATOMIC)
1203+ return __iommu_alloc_atomic(dev, size, handle);
1204+
11161205 pages = __iommu_alloc_buffer(dev, size, gfp);
11171206 if (!pages)
11181207 return NULL;
@@ -1179,6 +1268,11 @@ void arm_iommu_free_attrs(struct device *dev, size_t size, void *cpu_addr, · 60 unmodified lines
11791268 return;
11801269 }
11811270
1271+ if (__in_atomic_pool(cpu_addr, size)) {
1272+ __iommu_free_atomic(dev, pages, handle, size);
1273+ return;
1274+ }
1275+
11821276 if (!dma_get_attr(DMA_ATTR_NO_KERNEL_MAPPING, attrs)) {
11831277 unmap_kernel_range((unsigned long)cpu_addr, size);
11841278 vunmap(cpu_addr);
arch/arm/plat-omap/common.c+0−40
@@ -17,52 +17,12 @@ · 16 unmodified lines
1717 #include <linux/dma-mapping.h>
1818
1919 #include <plat/common.h>
20−#include <plat/board.h>
2120 #include <plat/vram.h>
2221 #include <plat/dsp.h>
2322 #include <plat/dma.h>
2423
2524 #include <plat/omap-secure.h>
2625
27−
28−#define NO_LENGTH_CHECK 0xffffffff
29−
30−struct omap_board_config_kernel *omap_board_config __initdata;
31−int omap_board_config_size;
32−
33−static const void *__init get_config(u16 tag, size_t len,
34− int skip, size_t *len_out)
35−{
36− struct omap_board_config_kernel *kinfo = NULL;
37− int i;
38−
39− /* Try to find the config from the board-specific structures
40− * in the kernel. */
41− for (i = 0; i < omap_board_config_size; i++) {
42− if (omap_board_config[i].tag == tag) {
43− if (skip == 0) {
44− kinfo = &omap_board_config[i];
45− break;
46− } else {
47− skip--;
48− }
49− }
50− }
51− if (kinfo == NULL)
52− return NULL;
53− return kinfo->data;
54−}
55−
56−const void *__init __omap_get_config(u16 tag, size_t len, int nr)
57−{
58− return get_config(tag, len, nr, NULL);
59−}
60−
61−const void *__init omap_get_var_config(u16 tag, size_t *len)
62−{
63− return get_config(tag, NO_LENGTH_CHECK, 0, len);
64−}
65−
6626 void __init omap_reserve(void)
6727 {
6828 omap_vram_reserve_sdram_memblock();
arch/arm/plat-omap/counter_32k.c+0−1
@@ -24,7 +24,6 @@ · 23 unmodified lines
2424
2525 #include <plat/hardware.h>
2626 #include <plat/common.h>
27−#include <plat/board.h>
2827
2928 #include <plat/clock.h>
3029
arch/arm/plat-omap/debug-devices.c+0−3
@@ -17,9 +17,6 @@ · 16 unmodified lines
1717
1818 #include <mach/hardware.h>
1919
20−#include <plat/board.h>
21−
22−
2320 /* Many OMAP development platforms reuse the same "debug board"; these
2421 * platforms include H2, H3, H4, and Perseus2.
2522 */
arch/arm/plat-omap/devices.c+0−1
@@ -23,7 +23,6 @@ · 22 unmodified lines
2323 #include <asm/memblock.h>
2424
2525 #include <plat/tc.h>
26−#include <plat/board.h>
2726 #include <plat/mmc.h>
2827 #include <plat/menelaus.h>
2928 #include <plat/omap44xx.h>
arch/arm/plat-omap/dmtimer.c+3−3
@@ -189,6 +189,7 @@ struct omap_dm_timer *omap_dm_timer_request(void) · 188 unmodified lines
189189 timer->reserved = 1;
190190 break;
191191 }
192+ spin_unlock_irqrestore(&dm_timer_lock, flags);
192193
193194 if (timer) {
194195 ret = omap_dm_timer_prepare(timer);
@@ -197,7 +198,6 @@ struct omap_dm_timer *omap_dm_timer_request(void) · 2 unmodified lines
197198 timer = NULL;
198199 }
199200 }
200− spin_unlock_irqrestore(&dm_timer_lock, flags);
201201
202202 if (!timer)
203203 pr_debug("%s: timer request failed!\n", __func__);
@@ -220,6 +220,7 @@ struct omap_dm_timer *omap_dm_timer_request_specific(int id) · 16 unmodified lines
220220 break;
221221 }
222222 }
223+ spin_unlock_irqrestore(&dm_timer_lock, flags);
223224
224225 if (timer) {
225226 ret = omap_dm_timer_prepare(timer);
@@ -228,7 +229,6 @@ struct omap_dm_timer *omap_dm_timer_request_specific(int id) · 2 unmodified lines
228229 timer = NULL;
229230 }
230231 }
231− spin_unlock_irqrestore(&dm_timer_lock, flags);
232232
233233 if (!timer)
234234 pr_debug("%s: timer%d request failed!\n", __func__, id);
@@ -258,7 +258,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_enable); · 23 unmodified lines
258258
259259 void omap_dm_timer_disable(struct omap_dm_timer *timer)
260260 {
261− pm_runtime_put(&timer->pdev->dev);
261+ pm_runtime_put_sync(&timer->pdev->dev);
262262 }
263263 EXPORT_SYMBOL_GPL(omap_dm_timer_disable);
264264
arch/arm/plat-omap/fb.c+0−2
@@ -33,8 +33,6 @@ · 32 unmodified lines
3333 #include <mach/hardware.h>
3434 #include <asm/mach/map.h>
3535
36−#include <plat/board.h>
37−
3836 #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
3937
4038 static bool omapfb_lcd_configured;
arch/arm/plat-omap/include/plat/board.h+0−138
@@ -1,138 +0,0 @@
1−/*
2− * arch/arm/plat-omap/include/mach/board.h
3− *
4− * Information structures for board-specific data
5− *
6− * Copyright (C) 2004 Nokia Corporation
7− * Written by Juha Yrjölä <juha.yrjola@nokia.com>
8− */
9−
10−#ifndef _OMAP_BOARD_H
11−#define _OMAP_BOARD_H
12−
13−#include <linux/types.h>
14−
15−#include <plat/gpio-switch.h>
16−
17−/*
18− * OMAP35x EVM revision
19− * Run time detection of EVM revision is done by reading Ethernet
20− * PHY ID -
21− * GEN_1 = 0x01150000
22− * GEN_2 = 0x92200000
23− */
24−enum {
25− OMAP3EVM_BOARD_GEN_1 = 0, /* EVM Rev between A - D */
26− OMAP3EVM_BOARD_GEN_2, /* EVM Rev >= Rev E */
27−};
28−
29−/* Different peripheral ids */
30−#define OMAP_TAG_CLOCK 0x4f01
31−#define OMAP_TAG_GPIO_SWITCH 0x4f06
32−#define OMAP_TAG_STI_CONSOLE 0x4f09
33−#define OMAP_TAG_CAMERA_SENSOR 0x4f0a
34−
35−#define OMAP_TAG_BOOT_REASON 0x4f80
36−#define OMAP_TAG_FLASH_PART 0x4f81
37−#define OMAP_TAG_VERSION_STR 0x4f82
38−
39−struct omap_clock_config {
40− /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */
41− u8 system_clock_type;
42−};
43−
44−struct omap_serial_console_config {
45− u8 console_uart;
46− u32 console_speed;
47−};
48−
49−struct omap_sti_console_config {
50− unsigned enable:1;
51− u8 channel;
52−};
53−
54−struct omap_camera_sensor_config {
55− u16 reset_gpio;
56− int (*power_on)(void * data);
57− int (*power_off)(void * data);
58−};
59−
60−struct omap_lcd_config {
61− char panel_name[16];
62− char ctrl_name[16];
63− s16 nreset_gpio;
64− u8 data_lines;
65−};
66−
67−struct device;
68−struct fb_info;
69−struct omap_backlight_config {
70− int default_intensity;
71− int (*set_power)(struct device *dev, int state);
72−};
73−
74−struct omap_fbmem_config {
75− u32 start;
76− u32 size;
77−};
78−
79−struct omap_pwm_led_platform_data {
80− const char *name;
81− int intensity_timer;
82− int blink_timer;
83− void (*set_power)(struct omap_pwm_led_platform_data *self, int on_off);
84−};
85−
86−struct omap_uart_config {
87− /* Bit field of UARTs present; bit 0 --> UART1 */
88− unsigned int enabled_uarts;
89−};
90−
91−
92−struct omap_flash_part_config {
93− char part_table[0];
94−};
95−
96−struct omap_boot_reason_config {
97− char reason_str[12];
98−};
99−
100−struct omap_version_config {
101− char component[12];
102− char version[12];
103−};
104−
105−struct omap_board_config_entry {
106− u16 tag;
107− u16 len;
108− u8 data[0];
109−};
110−
111−struct omap_board_config_kernel {
112− u16 tag;
113− const void *data;
114−};
115−
116−extern const void *__init __omap_get_config(u16 tag, size_t len, int nr);
117−
118−#define omap_get_config(tag, type) \
119− ((const type *) __omap_get_config((tag), sizeof(type), 0))
120−#define omap_get_nr_config(tag, type, nr) \
121− ((const type *) __omap_get_config((tag), sizeof(type), (nr)))
122−
123−extern const void *__init omap_get_var_config(u16 tag, size_t *len);
124−
125−extern struct omap_board_config_kernel *omap_board_config;
126−extern int omap_board_config_size;
127−
128−
129−/* for TI reference platforms sharing the same debug card */
130−extern int debug_card_init(u32 addr, unsigned gpio);
131−
132−/* OMAP3EVM revision */
133−#if defined(CONFIG_MACH_OMAP3EVM)
134−u8 get_omap3_evm_rev(void);
135−#else
136−#define get_omap3_evm_rev() (-EINVAL)
137−#endif
138−#endif
arch/arm/plat-omap/include/plat/cpu.h+2−1
@@ -372,7 +372,8 @@ IS_OMAP_TYPE(3430, 0x3430) · 371 unmodified lines
372372 #define cpu_class_is_omap1() (cpu_is_omap7xx() || cpu_is_omap15xx() || \
373373 cpu_is_omap16xx())
374374 #define cpu_class_is_omap2() (cpu_is_omap24xx() || cpu_is_omap34xx() || \
375− cpu_is_omap44xx() || soc_is_omap54xx())
375+ cpu_is_omap44xx() || soc_is_omap54xx() || \
376+ soc_is_am33xx())
376377
377378 /* Various silicon revisions for omap2 */
378379 #define OMAP242X_CLASS 0x24200024
arch/arm/plat-omap/include/plat/debug-devices.h+9−0
@@ -0,0 +1,9 @@
1+#ifndef _OMAP_DEBUG_DEVICES_H
2+#define _OMAP_DEBUG_DEVICES_H
3+
4+#include <linux/types.h>
5+
6+/* for TI reference platforms sharing the same debug card */
7+extern int debug_card_init(u32 addr, unsigned gpio);
8+
9+#endif
arch/arm/plat-omap/include/plat/gpmc.h+19−0
@@ -133,6 +133,25 @@ struct gpmc_timings { · 132 unmodified lines
133133 u16 wr_data_mux_bus; /* WRDATAONADMUXBUS */
134134 };
135135
136+struct gpmc_nand_regs {
137+ void __iomem *gpmc_status;
138+ void __iomem *gpmc_nand_command;
139+ void __iomem *gpmc_nand_address;
140+ void __iomem *gpmc_nand_data;
141+ void __iomem *gpmc_prefetch_config1;
142+ void __iomem *gpmc_prefetch_config2;
143+ void __iomem *gpmc_prefetch_control;
144+ void __iomem *gpmc_prefetch_status;
145+ void __iomem *gpmc_ecc_config;
146+ void __iomem *gpmc_ecc_control;
147+ void __iomem *gpmc_ecc_size_config;
148+ void __iomem *gpmc_ecc1_result;
149+ void __iomem *gpmc_bch_result0;
150+};
151+
152+extern void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs);
153+extern int gpmc_get_client_irq(unsigned irq_config);
154+
136155 extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns);
137156 extern unsigned int gpmc_ps_to_ticks(unsigned int time_ps);
138157 extern unsigned int gpmc_ticks_to_ns(unsigned int ticks);
arch/arm/plat-omap/include/plat/mmc.h+0−1
@@ -15,7 +15,6 @@ · 14 unmodified lines
1515 #include <linux/device.h>
1616 #include <linux/mmc/host.h>
1717
18−#include <plat/board.h>
1918 #include <plat/omap_hwmod.h>
2019
2120 #define OMAP15XX_NR_MMC 1
arch/arm/plat-omap/include/plat/multi.h+9−0
@@ -108,4 +108,13 @@ · 107 unmodified lines
108108 # endif
109109 #endif
110110
111+#ifdef CONFIG_SOC_AM33XX
112+# ifdef OMAP_NAME
113+# undef MULTI_OMAP2
114+# define MULTI_OMAP2
115+# else
116+# define OMAP_NAME am33xx
117+# endif
118+#endif
119+
111120 #endif /* __PLAT_OMAP_MULTI_H */
arch/arm/plat-omap/include/plat/nand.h+1−1
@@ -26,9 +26,9 @@ struct omap_nand_platform_data { · 25 unmodified lines
2626 bool dev_ready;
2727 int gpmc_irq;
2828 enum nand_io xfer_type;
29− unsigned long phys_base;
3029 int devsize;
3130 enum omap_ecc ecc_opt;
31+ struct gpmc_nand_regs reg;
3232 };
3333
3434 /* minimum size for IO mapping */
arch/arm/plat-omap/include/plat/uncompress.h+1−3
@@ -110,7 +110,7 @@ static inline void flush(void) · 109 unmodified lines
110110 _DEBUG_LL_ENTRY(mach, AM33XX_UART##p##_BASE, OMAP_PORT_SHIFT, \
111111 AM33XXUART##p)
112112
113−static inline void __arch_decomp_setup(unsigned long arch_id)
113+static inline void arch_decomp_setup(void)
114114 {
115115 int port = 0;
116116
@@ -198,8 +198,6 @@ static inline void __arch_decomp_setup(unsigned long arch_id) · 81 unmodified lines
198198 } while (0);
199199 }
200200
201−#define arch_decomp_setup() __arch_decomp_setup(arch_id)
202−
203201 /*
204202 * nothing to do
205203 */
arch/arm/plat-omap/include/plat/usb.h+0−1
@@ -5,7 +5,6 @@ · 4 unmodified lines
55
66 #include <linux/io.h>
77 #include <linux/usb/musb.h>
8−#include <plat/board.h>
98
109 #define OMAP3_HS_USB_PORTS 3
1110
arch/arm/plat-omap/sram.c+0−1
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626 #include <asm/mach/map.h>
2727
2828 #include <plat/sram.h>
29−#include <plat/board.h>
3029 #include <plat/cpu.h>
3130
3231 #include "sram.h"
arch/arm/plat-orion/common.c+6−2
@@ -291,10 +291,12 @@ static struct platform_device orion_ge00 = { · 290 unmodified lines
291291 void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data,
292292 unsigned long mapbase,
293293 unsigned long irq,
294− unsigned long irq_err)
294+ unsigned long irq_err,
295+ unsigned int tx_csum_limit)
295296 {
296297 fill_resources(&orion_ge00_shared, orion_ge00_shared_resources,
297298 mapbase + 0x2000, SZ_16K - 1, irq_err);
299+ orion_ge00_shared_data.tx_csum_limit = tx_csum_limit;
298300 ge_complete(&orion_ge00_shared_data,
299301 orion_ge00_resources, irq, &orion_ge00_shared,
300302 eth_data, &orion_ge00);
@@ -343,10 +345,12 @@ static struct platform_device orion_ge01 = { · 42 unmodified lines
343345 void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
344346 unsigned long mapbase,
345347 unsigned long irq,
346− unsigned long irq_err)
348+ unsigned long irq_err,
349+ unsigned int tx_csum_limit)
347350 {
348351 fill_resources(&orion_ge01_shared, orion_ge01_shared_resources,
349352 mapbase + 0x2000, SZ_16K - 1, irq_err);
353+ orion_ge01_shared_data.tx_csum_limit = tx_csum_limit;
350354 ge_complete(&orion_ge01_shared_data,
351355 orion_ge01_resources, irq, &orion_ge01_shared,
352356 eth_data, &orion_ge01);
arch/arm/plat-orion/include/plat/common.h+4−2
@@ -39,12 +39,14 @@ void __init orion_rtc_init(unsigned long mapbase, · 38 unmodified lines
3939 void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data,
4040 unsigned long mapbase,
4141 unsigned long irq,
42− unsigned long irq_err);
42+ unsigned long irq_err,
43+ unsigned int tx_csum_limit);
4344
4445 void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
4546 unsigned long mapbase,
4647 unsigned long irq,
47− unsigned long irq_err);
48+ unsigned long irq_err,
49+ unsigned int tx_csum_limit);
4850
4951 void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data,
5052 unsigned long mapbase,
arch/arm/plat-s3c24xx/dma.c+1−1
@@ -430,7 +430,7 @@ s3c2410_dma_canload(struct s3c2410_dma_chan *chan) · 429 unmodified lines
430430 * when necessary.
431431 */
432432
433−int s3c2410_dma_enqueue(unsigned int channel, void *id,
433+int s3c2410_dma_enqueue(enum dma_ch channel, void *id,
434434 dma_addr_t data, int size)
435435 {
436436 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
arch/arm/plat-samsung/devs.c+28−1
@@ -32,6 +32,8 @@ · 31 unmodified lines
3232 #include <linux/platform_data/s3c-hsudc.h>
3333 #include <linux/platform_data/s3c-hsotg.h>
3434
35+#include <media/s5p_hdmi.h>
36+
3537 #include <asm/irq.h>
3638 #include <asm/pmu.h>
3739 #include <asm/mach/arch.h>
@@ -748,7 +750,8 @@ void __init s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *pd) · 710 unmodified lines
748750 if (!pd) {
749751 pd = &default_i2c_data;
750752
751− if (soc_is_exynos4210())
753+ if (soc_is_exynos4210() ||
754+ soc_is_exynos4212() || soc_is_exynos4412())
752755 pd->bus_num = 8;
753756 else if (soc_is_s5pv210())
754757 pd->bus_num = 3;
@@ -759,6 +762,30 @@ void __init s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *pd) · 4 unmodified lines
759762 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
760763 &s5p_device_i2c_hdmiphy);
761764 }
765+
766+struct s5p_hdmi_platform_data s5p_hdmi_def_platdata;
767+
768+void __init s5p_hdmi_set_platdata(struct i2c_board_info *hdmiphy_info,
769+ struct i2c_board_info *mhl_info, int mhl_bus)
770+{
771+ struct s5p_hdmi_platform_data *pd = &s5p_hdmi_def_platdata;
772+
773+ if (soc_is_exynos4210() ||
774+ soc_is_exynos4212() || soc_is_exynos4412())
775+ pd->hdmiphy_bus = 8;
776+ else if (soc_is_s5pv210())
777+ pd->hdmiphy_bus = 3;
778+ else
779+ pd->hdmiphy_bus = 0;
780+
781+ pd->hdmiphy_info = hdmiphy_info;
782+ pd->mhl_info = mhl_info;
783+ pd->mhl_bus = mhl_bus;
784+
785+ s3c_set_platdata(pd, sizeof(struct s5p_hdmi_platform_data),
786+ &s5p_device_hdmi);
787+}
788+
762789 #endif /* CONFIG_S5P_DEV_I2C_HDMIPHY */
763790
764791 /* I2S */
arch/arm/plat-samsung/include/plat/hdmi.h+16−0
@@ -0,0 +1,16 @@
1+/*
2+ * Copyright (C) 2012 Samsung Electronics Co.Ltd
3+ *
4+ * This program is free software; you can redistribute it and/or modify it
5+ * under the terms of the GNU General Public License as published by the
6+ * Free Software Foundation; either version 2 of the License, or (at your
7+ * option) any later version.
8+ */
9+
10+#ifndef __PLAT_SAMSUNG_HDMI_H
11+#define __PLAT_SAMSUNG_HDMI_H __FILE__
12+
13+extern void s5p_hdmi_set_platdata(struct i2c_board_info *hdmiphy_info,
14+ struct i2c_board_info *mhl_info, int mhl_bus);
15+
16+#endif /* __PLAT_SAMSUNG_HDMI_H */
arch/arm/plat-samsung/pm.c+1−1
@@ -74,7 +74,7 @@ unsigned char pm_uart_udivslot; · 73 unmodified lines
7474
7575 #ifdef CONFIG_SAMSUNG_PM_DEBUG
7676
77−struct pm_uart_save uart_save[CONFIG_SERIAL_SAMSUNG_UARTS];
77+static struct pm_uart_save uart_save[CONFIG_SERIAL_SAMSUNG_UARTS];
7878
7979 static void s3c_pm_save_uart(unsigned int uart, struct pm_uart_save *save)
8080 {
arch/mips/Kconfig+1−0
@@ -89,6 +89,7 @@ config ATH79 · 88 unmodified lines
8989 select CEVT_R4K
9090 select CSRC_R4K
9191 select DMA_NONCOHERENT
92+ select HAVE_CLK
9293 select IRQ_CPU
9394 select MIPS_MACHINE
9495 select SYS_HAS_CPU_MIPS32_R2
arch/mips/alchemy/board-mtx1.c+2−0
@@ -228,6 +228,8 @@ static int mtx1_pci_idsel(unsigned int devsel, int assert) · 227 unmodified lines
228228 * adapter on the mtx-1 "singleboard" variant. It triggers a custom
229229 * logic chip connected to EXT_IO3 (GPIO1) to suppress IDSEL signals.
230230 */
231+ udelay(1);
232+
231233 if (assert && devsel != 0)
232234 /* Suppress signal to Cardbus */
233235 alchemy_gpio_set_value(1, 0); /* set EXT_IO3 OFF */
arch/mips/ath79/dev-usb.c+2−0
@@ -145,6 +145,8 @@ static void __init ar7240_usb_setup(void) · 144 unmodified lines
145145
146146 ath79_ohci_resources[0].start = AR7240_OHCI_BASE;
147147 ath79_ohci_resources[0].end = AR7240_OHCI_BASE + AR7240_OHCI_SIZE - 1;
148+ ath79_ohci_resources[1].start = ATH79_CPU_IRQ_USB;
149+ ath79_ohci_resources[1].end = ATH79_CPU_IRQ_USB;
148150 platform_device_register(&ath79_ohci_device);
149151 }
150152
arch/mips/ath79/gpio.c+4−2
@@ -188,8 +188,10 @@ void __init ath79_gpio_init(void) · 187 unmodified lines
188188
189189 if (soc_is_ar71xx())
190190 ath79_gpio_count = AR71XX_GPIO_COUNT;
191− else if (soc_is_ar724x())
192− ath79_gpio_count = AR724X_GPIO_COUNT;
191+ else if (soc_is_ar7240())
192+ ath79_gpio_count = AR7240_GPIO_COUNT;
193+ else if (soc_is_ar7241() || soc_is_ar7242())
194+ ath79_gpio_count = AR7241_GPIO_COUNT;
193195 else if (soc_is_ar913x())
194196 ath79_gpio_count = AR913X_GPIO_COUNT;
195197 else if (soc_is_ar933x())
arch/mips/bcm63xx/dev-spi.c+4−0
@@ -106,11 +106,15 @@ int __init bcm63xx_spi_register(void) · 105 unmodified lines
106106 if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) {
107107 spi_resources[0].end += BCM_6338_RSET_SPI_SIZE - 1;
108108 spi_pdata.fifo_size = SPI_6338_MSG_DATA_SIZE;
109+ spi_pdata.msg_type_shift = SPI_6338_MSG_TYPE_SHIFT;
110+ spi_pdata.msg_ctl_width = SPI_6338_MSG_CTL_WIDTH;
109111 }
110112
111113 if (BCMCPU_IS_6358() || BCMCPU_IS_6368()) {
112114 spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1;
113115 spi_pdata.fifo_size = SPI_6358_MSG_DATA_SIZE;
116+ spi_pdata.msg_type_shift = SPI_6358_MSG_TYPE_SHIFT;
117+ spi_pdata.msg_ctl_width = SPI_6358_MSG_CTL_WIDTH;
114118 }
115119
116120 bcm63xx_spi_regs_init();
arch/mips/cavium-octeon/octeon-irq.c+43−46
@@ -61,6 +61,12 @@ static void octeon_irq_set_ciu_mapping(int irq, int line, int bit, · 60 unmodified lines
6161 octeon_irq_ciu_to_irq[line][bit] = irq;
6262 }
6363
64+static void octeon_irq_force_ciu_mapping(struct irq_domain *domain,
65+ int irq, int line, int bit)
66+{
67+ irq_domain_associate(domain, irq, line << 6 | bit);
68+}
69+
6470 static int octeon_coreid_for_cpu(int cpu)
6571 {
6672 #ifdef CONFIG_SMP
@@ -183,19 +189,9 @@ static void __init octeon_irq_init_core(void) · 116 unmodified lines
183189 mutex_init(&cd->core_irq_mutex);
184190
185191 irq = OCTEON_IRQ_SW0 + i;
186− switch (irq) {
187− case OCTEON_IRQ_TIMER:
188− case OCTEON_IRQ_SW0:
189− case OCTEON_IRQ_SW1:
190− case OCTEON_IRQ_5:
191− case OCTEON_IRQ_PERF:
192− irq_set_chip_data(irq, cd);
193− irq_set_chip_and_handler(irq, &octeon_irq_chip_core,
194− handle_percpu_irq);
195− break;
196− default:
197− break;
198− }
192+ irq_set_chip_data(irq, cd);
193+ irq_set_chip_and_handler(irq, &octeon_irq_chip_core,
194+ handle_percpu_irq);
199195 }
200196 }
201197
@@ -890,7 +886,6 @@ static int octeon_irq_gpio_xlat(struct irq_domain *d, · 688 unmodified lines
890886 unsigned int type;
891887 unsigned int pin;
892888 unsigned int trigger;
893− struct octeon_irq_gpio_domain_data *gpiod;
894889
895890 if (d->of_node != node)
896891 return -EINVAL;
@@ -925,8 +920,7 @@ static int octeon_irq_gpio_xlat(struct irq_domain *d, · 28 unmodified lines
925920 break;
926921 }
927922 *out_type = type;
928− gpiod = d->host_data;
929− *out_hwirq = gpiod->base_hwirq + pin;
923+ *out_hwirq = pin;
930924
931925 return 0;
932926 }
@@ -996,19 +990,21 @@ static int octeon_irq_ciu_map(struct irq_domain *d, · 63 unmodified lines
996990 static int octeon_irq_gpio_map(struct irq_domain *d,
997991 unsigned int virq, irq_hw_number_t hw)
998992 {
999− unsigned int line = hw >> 6;
1000− unsigned int bit = hw & 63;
993+ struct octeon_irq_gpio_domain_data *gpiod = d->host_data;
994+ unsigned int line, bit;
1001995
1002996 if (!octeon_irq_virq_in_range(virq))
1003997 return -EINVAL;
1004998
999+ hw += gpiod->base_hwirq;
1000+ line = hw >> 6;
1001+ bit = hw & 63;
10051002 if (line > 1 || octeon_irq_ciu_to_irq[line][bit] != 0)
10061003 return -EINVAL;
10071004
10081005 octeon_irq_set_ciu_mapping(virq, line, bit,
10091006 octeon_irq_gpio_chip,
10101007 octeon_irq_handle_gpio);
1011−
10121008 return 0;
10131009 }
10141010
@@ -1149,6 +1145,7 @@ static void __init octeon_irq_init_ciu(void) · 134 unmodified lines
11491145 struct irq_chip *chip_wd;
11501146 struct device_node *gpio_node;
11511147 struct device_node *ciu_node;
1148+ struct irq_domain *ciu_domain = NULL;
11521149
11531150 octeon_irq_init_ciu_percpu();
11541151 octeon_irq_setup_secondary = octeon_irq_setup_secondary_ciu;
@@ -1177,31 +1174,6 @@ static void __init octeon_irq_init_ciu(void) · 22 unmodified lines
11771174 /* Mips internal */
11781175 octeon_irq_init_core();
11791176
1180− /* CIU_0 */
1181− for (i = 0; i < 16; i++)
1182− octeon_irq_set_ciu_mapping(i + OCTEON_IRQ_WORKQ0, 0, i + 0, chip, handle_level_irq);
1183−
1184− octeon_irq_set_ciu_mapping(OCTEON_IRQ_MBOX0, 0, 32, chip_mbox, handle_percpu_irq);
1185− octeon_irq_set_ciu_mapping(OCTEON_IRQ_MBOX1, 0, 33, chip_mbox, handle_percpu_irq);
1186−
1187− for (i = 0; i < 4; i++)
1188− octeon_irq_set_ciu_mapping(i + OCTEON_IRQ_PCI_INT0, 0, i + 36, chip, handle_level_irq);
1189− for (i = 0; i < 4; i++)
1190− octeon_irq_set_ciu_mapping(i + OCTEON_IRQ_PCI_MSI0, 0, i + 40, chip, handle_level_irq);
1191−
1192− octeon_irq_set_ciu_mapping(OCTEON_IRQ_RML, 0, 46, chip, handle_level_irq);
1193− for (i = 0; i < 4; i++)
1194− octeon_irq_set_ciu_mapping(i + OCTEON_IRQ_TIMER0, 0, i + 52, chip, handle_edge_irq);
1195−
1196− octeon_irq_set_ciu_mapping(OCTEON_IRQ_USB0, 0, 56, chip, handle_level_irq);
1197− octeon_irq_set_ciu_mapping(OCTEON_IRQ_BOOTDMA, 0, 63, chip, handle_level_irq);
1198−
1199− /* CIU_1 */
1200− for (i = 0; i < 16; i++)
1201− octeon_irq_set_ciu_mapping(i + OCTEON_IRQ_WDOG0, 1, i + 0, chip_wd, handle_level_irq);
1202−
1203− octeon_irq_set_ciu_mapping(OCTEON_IRQ_USB1, 1, 17, chip, handle_level_irq);
1204−
12051177 gpio_node = of_find_compatible_node(NULL, NULL, "cavium,octeon-3860-gpio");
12061178 if (gpio_node) {
12071179 struct octeon_irq_gpio_domain_data *gpiod;
@@ -1219,10 +1191,35 @@ static void __init octeon_irq_init_ciu(void) · 11 unmodified lines
12191191
12201192 ciu_node = of_find_compatible_node(NULL, NULL, "cavium,octeon-3860-ciu");
12211193 if (ciu_node) {
1222− irq_domain_add_tree(ciu_node, &octeon_irq_domain_ciu_ops, NULL);
1194+ ciu_domain = irq_domain_add_tree(ciu_node, &octeon_irq_domain_ciu_ops, NULL);
12231195 of_node_put(ciu_node);
12241196 } else
1225− pr_warn("Cannot find device node for cavium,octeon-3860-ciu.\n");
1197+ panic("Cannot find device node for cavium,octeon-3860-ciu.");
1198+
1199+ /* CIU_0 */
1200+ for (i = 0; i < 16; i++)
1201+ octeon_irq_force_ciu_mapping(ciu_domain, i + OCTEON_IRQ_WORKQ0, 0, i + 0);
1202+
1203+ octeon_irq_set_ciu_mapping(OCTEON_IRQ_MBOX0, 0, 32, chip_mbox, handle_percpu_irq);
1204+ octeon_irq_set_ciu_mapping(OCTEON_IRQ_MBOX1, 0, 33, chip_mbox, handle_percpu_irq);
1205+
1206+ for (i = 0; i < 4; i++)
1207+ octeon_irq_force_ciu_mapping(ciu_domain, i + OCTEON_IRQ_PCI_INT0, 0, i + 36);
1208+ for (i = 0; i < 4; i++)
1209+ octeon_irq_force_ciu_mapping(ciu_domain, i + OCTEON_IRQ_PCI_MSI0, 0, i + 40);
1210+
1211+ octeon_irq_force_ciu_mapping(ciu_domain, OCTEON_IRQ_RML, 0, 46);
1212+ for (i = 0; i < 4; i++)
1213+ octeon_irq_force_ciu_mapping(ciu_domain, i + OCTEON_IRQ_TIMER0, 0, i + 52);
1214+
1215+ octeon_irq_force_ciu_mapping(ciu_domain, OCTEON_IRQ_USB0, 0, 56);
1216+ octeon_irq_force_ciu_mapping(ciu_domain, OCTEON_IRQ_BOOTDMA, 0, 63);
1217+
1218+ /* CIU_1 */
1219+ for (i = 0; i < 16; i++)
1220+ octeon_irq_set_ciu_mapping(i + OCTEON_IRQ_WDOG0, 1, i + 0, chip_wd, handle_level_irq);
1221+
1222+ octeon_irq_force_ciu_mapping(ciu_domain, OCTEON_IRQ_USB1, 1, 17);
12261223
12271224 /* Enable the CIU lines */
12281225 set_c0_status(STATUSF_IP3 | STATUSF_IP2);
arch/mips/include/asm/mach-ath79/ar71xx_regs.h+2−1
@@ -393,7 +393,8 @@ · 392 unmodified lines
393393 #define AR71XX_GPIO_REG_FUNC 0x28
394394
395395 #define AR71XX_GPIO_COUNT 16
396−#define AR724X_GPIO_COUNT 18
396+#define AR7240_GPIO_COUNT 18
397+#define AR7241_GPIO_COUNT 20
397398 #define AR913X_GPIO_COUNT 22
398399 #define AR933X_GPIO_COUNT 30
399400 #define AR934X_GPIO_COUNT 23
arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h+0−1
@@ -42,7 +42,6 @@ · 41 unmodified lines
4242 #define cpu_has_mips64r1 0
4343 #define cpu_has_mips64r2 0
4444
45−#define cpu_has_dsp 0
4645 #define cpu_has_mipsmt 0
4746
4847 #define cpu_has_64bits 0
arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h+2−0
@@ -9,6 +9,8 @@ int __init bcm63xx_spi_register(void); · 8 unmodified lines
99
1010 struct bcm63xx_spi_pdata {
1111 unsigned int fifo_size;
12+ unsigned int msg_type_shift;
13+ unsigned int msg_ctl_width;
1214 int bus_num;
1315 int num_chipselect;
1416 u32 speed_hz;
arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h+10−3
@@ -1054,7 +1054,8 @@ · 1053 unmodified lines
10541054 #define SPI_6338_FILL_BYTE 0x07
10551055 #define SPI_6338_MSG_TAIL 0x09
10561056 #define SPI_6338_RX_TAIL 0x0b
1057−#define SPI_6338_MSG_CTL 0x40
1057+#define SPI_6338_MSG_CTL 0x40 /* 8-bits register */
1058+#define SPI_6338_MSG_CTL_WIDTH 8
10581059 #define SPI_6338_MSG_DATA 0x41
10591060 #define SPI_6338_MSG_DATA_SIZE 0x3f
10601061 #define SPI_6338_RX_DATA 0x80
@@ -1070,7 +1071,8 @@ · 9 unmodified lines
10701071 #define SPI_6348_FILL_BYTE 0x07
10711072 #define SPI_6348_MSG_TAIL 0x09
10721073 #define SPI_6348_RX_TAIL 0x0b
1073−#define SPI_6348_MSG_CTL 0x40
1074+#define SPI_6348_MSG_CTL 0x40 /* 8-bits register */
1075+#define SPI_6348_MSG_CTL_WIDTH 8
10741076 #define SPI_6348_MSG_DATA 0x41
10751077 #define SPI_6348_MSG_DATA_SIZE 0x3f
10761078 #define SPI_6348_RX_DATA 0x80
@@ -1078,6 +1080,7 @@ · 1 unmodified line
10781080
10791081 /* BCM 6358 SPI core */
10801082 #define SPI_6358_MSG_CTL 0x00 /* 16-bits register */
1083+#define SPI_6358_MSG_CTL_WIDTH 16
10811084 #define SPI_6358_MSG_DATA 0x02
10821085 #define SPI_6358_MSG_DATA_SIZE 0x21e
10831086 #define SPI_6358_RX_DATA 0x400
@@ -1094,6 +1097,7 @@ · 10 unmodified lines
10941097
10951098 /* BCM 6358 SPI core */
10961099 #define SPI_6368_MSG_CTL 0x00 /* 16-bits register */
1100+#define SPI_6368_MSG_CTL_WIDTH 16
10971101 #define SPI_6368_MSG_DATA 0x02
10981102 #define SPI_6368_MSG_DATA_SIZE 0x21e
10991103 #define SPI_6368_RX_DATA 0x400
@@ -1115,7 +1119,10 @@ · 15 unmodified lines
11151119 #define SPI_HD_W 0x01
11161120 #define SPI_HD_R 0x02
11171121 #define SPI_BYTE_CNT_SHIFT 0
1118−#define SPI_MSG_TYPE_SHIFT 14
1122+#define SPI_6338_MSG_TYPE_SHIFT 6
1123+#define SPI_6348_MSG_TYPE_SHIFT 6
1124+#define SPI_6358_MSG_TYPE_SHIFT 14
1125+#define SPI_6368_MSG_TYPE_SHIFT 14
11191126
11201127 /* Command */
11211128 #define SPI_CMD_NOOP 0x00
arch/mips/include/asm/mach-cavium-octeon/irq.h+1−9
@@ -21,14 +21,10 @@ enum octeon_irq { · 20 unmodified lines
2121 OCTEON_IRQ_TIMER,
2222 /* sources in CIU_INTX_EN0 */
2323 OCTEON_IRQ_WORKQ0,
24− OCTEON_IRQ_GPIO0 = OCTEON_IRQ_WORKQ0 + 16,
25− OCTEON_IRQ_WDOG0 = OCTEON_IRQ_GPIO0 + 16,
24+ OCTEON_IRQ_WDOG0 = OCTEON_IRQ_WORKQ0 + 16,
2625 OCTEON_IRQ_WDOG15 = OCTEON_IRQ_WDOG0 + 15,
2726 OCTEON_IRQ_MBOX0 = OCTEON_IRQ_WDOG0 + 16,
2827 OCTEON_IRQ_MBOX1,
29− OCTEON_IRQ_UART0,
30− OCTEON_IRQ_UART1,
31− OCTEON_IRQ_UART2,
3228 OCTEON_IRQ_PCI_INT0,
3329 OCTEON_IRQ_PCI_INT1,
3430 OCTEON_IRQ_PCI_INT2,
@@ -38,8 +34,6 @@ enum octeon_irq { · 3 unmodified lines
3834 OCTEON_IRQ_PCI_MSI2,
3935 OCTEON_IRQ_PCI_MSI3,
4036
41− OCTEON_IRQ_TWSI,
42− OCTEON_IRQ_TWSI2,
4337 OCTEON_IRQ_RML,
4438 OCTEON_IRQ_TIMER0,
4539 OCTEON_IRQ_TIMER1,
@@ -47,8 +41,6 @@ enum octeon_irq { · 1 unmodified line
4741 OCTEON_IRQ_TIMER3,
4842 OCTEON_IRQ_USB0,
4943 OCTEON_IRQ_USB1,
50− OCTEON_IRQ_MII0,
51− OCTEON_IRQ_MII1,
5244 OCTEON_IRQ_BOOTDMA,
5345 #ifndef CONFIG_PCI_MSI
5446 OCTEON_IRQ_LAST = 127
arch/mips/include/asm/module.h+1−0
@@ -10,6 +10,7 @@ struct mod_arch_specific { · 9 unmodified lines
1010 struct list_head dbe_list;
1111 const struct exception_table_entry *dbe_start;
1212 const struct exception_table_entry *dbe_end;
13+ struct mips_hi16 *r_mips_hi16_list;
1314 };
1415
1516 typedef uint8_t Elf64_Byte; /* Type for a 8-bit quantity. */
arch/mips/include/asm/r4k-timer.h+4−4
@@ -12,16 +12,16 @@ · 11 unmodified lines
1212
1313 #ifdef CONFIG_SYNC_R4K
1414
15−extern void synchronise_count_master(void);
16−extern void synchronise_count_slave(void);
15+extern void synchronise_count_master(int cpu);
16+extern void synchronise_count_slave(int cpu);
1717
1818 #else
1919
20−static inline void synchronise_count_master(void)
20+static inline void synchronise_count_master(int cpu)
2121 {
2222 }
2323
24−static inline void synchronise_count_slave(void)
24+static inline void synchronise_count_slave(int cpu)
2525 {
2626 }
2727
arch/mips/kernel/module.c+34−9
@@ -39,8 +39,6 @@ struct mips_hi16 { · 38 unmodified lines
3939 Elf_Addr value;
4040 };
4141
42−static struct mips_hi16 *mips_hi16_list;
43−
4442 static LIST_HEAD(dbe_list);
4543 static DEFINE_SPINLOCK(dbe_lock);
4644
@@ -128,8 +126,8 @@ static int apply_r_mips_hi16_rel(struct module *me, u32 *location, Elf_Addr v) · 81 unmodified lines
128126
129127 n->addr = (Elf_Addr *)location;
130128 n->value = v;
131− n->next = mips_hi16_list;
132− mips_hi16_list = n;
129+ n->next = me->arch.r_mips_hi16_list;
130+ me->arch.r_mips_hi16_list = n;
133131
134132 return 0;
135133 }
@@ -142,18 +140,28 @@ static int apply_r_mips_hi16_rela(struct module *me, u32 *location, Elf_Addr v) · 6 unmodified lines
142140 return 0;
143141 }
144142
143+static void free_relocation_chain(struct mips_hi16 *l)
144+{
145+ struct mips_hi16 *next;
146+
147+ while (l) {
148+ next = l->next;
149+ kfree(l);
150+ l = next;
151+ }
152+}
153+
145154 static int apply_r_mips_lo16_rel(struct module *me, u32 *location, Elf_Addr v)
146155 {
147156 unsigned long insnlo = *location;
157+ struct mips_hi16 *l;
148158 Elf_Addr val, vallo;
149159
150160 /* Sign extend the addend we extract from the lo insn. */
151161 vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000;
152162
153− if (mips_hi16_list != NULL) {
154− struct mips_hi16 *l;
155−
156− l = mips_hi16_list;
163+ if (me->arch.r_mips_hi16_list != NULL) {
164+ l = me->arch.r_mips_hi16_list;
157165 while (l != NULL) {
158166 struct mips_hi16 *next;
159167 unsigned long insn;
@@ -188,7 +196,7 @@ static int apply_r_mips_lo16_rel(struct module *me, u32 *location, Elf_Addr v) · 28 unmodified lines
188196 l = next;
189197 }
190198
191− mips_hi16_list = NULL;
199+ me->arch.r_mips_hi16_list = NULL;
192200 }
193201
194202 /*
@@ -201,6 +209,9 @@ static int apply_r_mips_lo16_rel(struct module *me, u32 *location, Elf_Addr v) · 6 unmodified lines
201209 return 0;
202210
203211 out_danger:
212+ free_relocation_chain(l);
213+ me->arch.r_mips_hi16_list = NULL;
214+
204215 pr_err("module %s: dangerous R_MIPS_LO16 REL relocation\n", me->name);
205216
206217 return -ENOEXEC;
@@ -273,6 +284,7 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab, · 66 unmodified lines
273284 pr_debug("Applying relocate section %u to %u\n", relsec,
274285 sechdrs[relsec].sh_info);
275286
287+ me->arch.r_mips_hi16_list = NULL;
276288 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
277289 /* This is where to make the change */
278290 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
@@ -296,6 +308,19 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab, · 17 unmodified lines
296308 return res;
297309 }
298310
311+ /*
312+ * Normally the hi16 list should be deallocated at this point. A
313+ * malformed binary however could contain a series of R_MIPS_HI16
314+ * relocations not followed by a R_MIPS_LO16 relocation. In that
315+ * case, free up the list and return an error.
316+ */
317+ if (me->arch.r_mips_hi16_list) {
318+ free_relocation_chain(me->arch.r_mips_hi16_list);
319+ me->arch.r_mips_hi16_list = NULL;
320+
321+ return -ENOEXEC;
322+ }
323+
299324 return 0;
300325 }
301326
arch/mips/kernel/smp.c+2−2
@@ -130,7 +130,7 @@ asmlinkage __cpuinit void start_secondary(void) · 129 unmodified lines
130130
131131 cpu_set(cpu, cpu_callin_map);
132132
133− synchronise_count_slave();
133+ synchronise_count_slave(cpu);
134134
135135 /*
136136 * irq will be enabled in ->smp_finish(), enabling it too early
@@ -173,7 +173,6 @@ void smp_send_stop(void) · 36 unmodified lines
173173 void __init smp_cpus_done(unsigned int max_cpus)
174174 {
175175 mp_ops->cpus_done();
176− synchronise_count_master();
177176 }
178177
179178 /* called from main before smp_init() */
@@ -206,6 +205,7 @@ int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) · 26 unmodified lines
206205 while (!cpu_isset(cpu, cpu_callin_map))
207206 udelay(100);
208207
208+ synchronise_count_master(cpu);
209209 return 0;
210210 }
211211
arch/mips/kernel/sync-r4k.c+11−15
@@ -28,12 +28,11 @@ static atomic_t __cpuinitdata count_reference = ATOMIC_INIT(0); · 27 unmodified lines
2828 #define COUNTON 100
2929 #define NR_LOOPS 5
3030
31−void __cpuinit synchronise_count_master(void)
31+void __cpuinit synchronise_count_master(int cpu)
3232 {
3333 int i;
3434 unsigned long flags;
3535 unsigned int initcount;
36− int nslaves;
3736
3837 #ifdef CONFIG_MIPS_MT_SMTC
3938 /*
@@ -43,8 +42,7 @@ void __cpuinit synchronise_count_master(void) · 3 unmodified lines
4342 return;
4443 #endif
4544
46− printk(KERN_INFO "Synchronize counters across %u CPUs: ",
47− num_online_cpus());
45+ printk(KERN_INFO "Synchronize counters for CPU %u: ", cpu);
4846
4947 local_irq_save(flags);
5048
@@ -52,7 +50,7 @@ void __cpuinit synchronise_count_master(void) · 1 unmodified line
5250 * Notify the slaves that it's time to start
5351 */
5452 atomic_set(&count_reference, read_c0_count());
55− atomic_set(&count_start_flag, 1);
53+ atomic_set(&count_start_flag, cpu);
5654 smp_wmb();
5755
5856 /* Count will be initialised to current timer for all CPU's */
@@ -69,10 +67,9 @@ void __cpuinit synchronise_count_master(void) · 10 unmodified lines
6967 * two CPUs.
7068 */
7169
72− nslaves = num_online_cpus()-1;
7370 for (i = 0; i < NR_LOOPS; i++) {
74− /* slaves loop on '!= ncpus' */
75− while (atomic_read(&count_count_start) != nslaves)
71+ /* slaves loop on '!= 2' */
72+ while (atomic_read(&count_count_start) != 1)
7673 mb();
7774 atomic_set(&count_count_stop, 0);
7875 smp_wmb();
@@ -89,7 +86,7 @@ void __cpuinit synchronise_count_master(void) · 10 unmodified lines
8986 /*
9087 * Wait for all slaves to leave the synchronization point:
9188 */
92− while (atomic_read(&count_count_stop) != nslaves)
89+ while (atomic_read(&count_count_stop) != 1)
9390 mb();
9491 atomic_set(&count_count_start, 0);
9592 smp_wmb();
@@ -97,6 +94,7 @@ void __cpuinit synchronise_count_master(void) · 1 unmodified line
9794 }
9895 /* Arrange for an interrupt in a short while */
9996 write_c0_compare(read_c0_count() + COUNTON);
97+ atomic_set(&count_start_flag, 0);
10098
10199 local_irq_restore(flags);
102100
@@ -108,11 +106,10 @@ void __cpuinit synchronise_count_master(void) · 5 unmodified lines
108106 printk("done.\n");
109107 }
110108
111−void __cpuinit synchronise_count_slave(void)
109+void __cpuinit synchronise_count_slave(int cpu)
112110 {
113111 int i;
114112 unsigned int initcount;
115− int ncpus;
116113
117114 #ifdef CONFIG_MIPS_MT_SMTC
118115 /*
@@ -127,16 +124,15 @@ void __cpuinit synchronise_count_slave(void) · 8 unmodified lines
127124 * so we first wait for the master to say everyone is ready
128125 */
129126
130− while (!atomic_read(&count_start_flag))
127+ while (atomic_read(&count_start_flag) != cpu)
131128 mb();
132129
133130 /* Count will be initialised to next expire for all CPU's */
134131 initcount = atomic_read(&count_reference);
135132
136− ncpus = num_online_cpus();
137133 for (i = 0; i < NR_LOOPS; i++) {
138134 atomic_inc(&count_count_start);
139− while (atomic_read(&count_count_start) != ncpus)
135+ while (atomic_read(&count_count_start) != 2)
140136 mb();
141137
142138 /*
@@ -146,7 +142,7 @@ void __cpuinit synchronise_count_slave(void) · 3 unmodified lines
146142 write_c0_count(initcount);
147143
148144 atomic_inc(&count_count_stop);
149− while (atomic_read(&count_count_stop) != ncpus)
145+ while (atomic_read(&count_count_stop) != 2)
150146 mb();
151147 }
152148 /* Arrange for an interrupt in a short while */
arch/mips/mti-malta/malta-pci.c+0−13
@@ -252,16 +252,3 @@ void __init mips_pcibios_init(void) · 251 unmodified lines
252252
253253 register_pci_controller(controller);
254254 }
255−
256−/* Enable PCI 2.1 compatibility in PIIX4 */
257−static void __devinit quirk_dlcsetup(struct pci_dev *dev)
258−{
259− u8 odlc, ndlc;
260− (void) pci_read_config_byte(dev, 0x82, &odlc);
261− /* Enable passive releases and delayed transaction */
262− ndlc = odlc | 7;
263− (void) pci_write_config_byte(dev, 0x82, ndlc);
264−}
265−
266−DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_0,
267− quirk_dlcsetup);
arch/mips/pci/pci-ar724x.c+22−0
@@ -23,9 +23,12 @@ · 22 unmodified lines
2323 #define AR724X_PCI_MEM_BASE 0x10000000
2424 #define AR724X_PCI_MEM_SIZE 0x08000000
2525
26+#define AR724X_PCI_REG_RESET 0x18
2627 #define AR724X_PCI_REG_INT_STATUS 0x4c
2728 #define AR724X_PCI_REG_INT_MASK 0x50
2829
30+#define AR724X_PCI_RESET_LINK_UP BIT(0)
31+
2932 #define AR724X_PCI_INT_DEV0 BIT(14)
3033
3134 #define AR724X_PCI_IRQ_COUNT 1
@@ -38,6 +41,15 @@ static void __iomem *ar724x_pci_ctrl_base; · 6 unmodified lines
3841
3942 static u32 ar724x_pci_bar0_value;
4043 static bool ar724x_pci_bar0_is_cached;
44+static bool ar724x_pci_link_up;
45+
46+static inline bool ar724x_pci_check_link(void)
47+{
48+ u32 reset;
49+
50+ reset = __raw_readl(ar724x_pci_ctrl_base + AR724X_PCI_REG_RESET);
51+ return reset & AR724X_PCI_RESET_LINK_UP;
52+}
4153
4254 static int ar724x_pci_read(struct pci_bus *bus, unsigned int devfn, int where,
4355 int size, uint32_t *value)
@@ -46,6 +58,9 @@ static int ar724x_pci_read(struct pci_bus *bus, unsigned int devfn, int where, · 2 unmodified lines
4658 void __iomem *base;
4759 u32 data;
4860
61+ if (!ar724x_pci_link_up)
62+ return PCIBIOS_DEVICE_NOT_FOUND;
63+
4964 if (devfn)
5065 return PCIBIOS_DEVICE_NOT_FOUND;
5166
@@ -96,6 +111,9 @@ static int ar724x_pci_write(struct pci_bus *bus, unsigned int devfn, int where, · 44 unmodified lines
96111 u32 data;
97112 int s;
98113
114+ if (!ar724x_pci_link_up)
115+ return PCIBIOS_DEVICE_NOT_FOUND;
116+
99117 if (devfn)
100118 return PCIBIOS_DEVICE_NOT_FOUND;
101119
@@ -280,6 +298,10 @@ int __init ar724x_pcibios_init(int irq) · 178 unmodified lines
280298 if (ar724x_pci_ctrl_base == NULL)
281299 goto err_unmap_devcfg;
282300
301+ ar724x_pci_link_up = ar724x_pci_check_link();
302+ if (!ar724x_pci_link_up)
303+ pr_warn("ar724x: PCIe link is down\n");
304+
283305 ar724x_pci_irq_init(irq);
284306 register_pci_controller(&ar724x_pci_controller);
285307
arch/parisc/include/asm/atomic.h+2−2
@@ -141,7 +141,7 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u) · 140 unmodified lines
141141
142142 #define atomic_sub_and_test(i,v) (atomic_sub_return((i),(v)) == 0)
143143
144−#define ATOMIC_INIT(i) ((atomic_t) { (i) })
144+#define ATOMIC_INIT(i) { (i) }
145145
146146 #define smp_mb__before_atomic_dec() smp_mb()
147147 #define smp_mb__after_atomic_dec() smp_mb()
@@ -150,7 +150,7 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u) · 2 unmodified lines
150150
151151 #ifdef CONFIG_64BIT
152152
153−#define ATOMIC64_INIT(i) ((atomic64_t) { (i) })
153+#define ATOMIC64_INIT(i) { (i) }
154154
155155 static __inline__ s64
156156 __atomic64_add_return(s64 i, atomic64_t *v)
arch/parisc/kernel/process.c+1−1
@@ -309,7 +309,7 @@ copy_thread(unsigned long clone_flags, unsigned long usp, · 308 unmodified lines
309309 cregs->ksp = (unsigned long)stack
310310 + (pregs->gr[21] & (THREAD_SIZE - 1));
311311 cregs->gr[30] = usp;
312− if (p->personality == PER_HPUX) {
312+ if (personality(p->personality) == PER_HPUX) {
313313 #ifdef CONFIG_HPUX
314314 cregs->kpc = (unsigned long) &hpux_child_return;
315315 #else
arch/parisc/kernel/sys_parisc.c+4−4
@@ -225,12 +225,12 @@ long parisc_personality(unsigned long personality) · 224 unmodified lines
225225 long err;
226226
227227 if (personality(current->personality) == PER_LINUX32
228− && personality == PER_LINUX)
229− personality = PER_LINUX32;
228+ && personality(personality) == PER_LINUX)
229+ personality = (personality & ~PER_MASK) | PER_LINUX32;
230230
231231 err = sys_personality(personality);
232− if (err == PER_LINUX32)
233− err = PER_LINUX;
232+ if (personality(err) == PER_LINUX32)
233+ err = (err & ~PER_MASK) | PER_LINUX;
234234
235235 return err;
236236 }
arch/powerpc/boot/dts/fsl/p4080si-post.dtsi+7−0
@@ -345,6 +345,13 @@ · 344 unmodified lines
345345 /include/ "qoriq-duart-1.dtsi"
346346 /include/ "qoriq-gpio-0.dtsi"
347347 /include/ "qoriq-usb2-mph-0.dtsi"
348+ usb@210000 {
349+ compatible = "fsl-usb2-mph-v1.6", "fsl,mpc85xx-usb2-mph", "fsl-usb2-mph";
350+ port0;
351+ };
348352 /include/ "qoriq-usb2-dr-0.dtsi"
353+ usb@211000 {
354+ compatible = "fsl-usb2-dr-v1.6", "fsl,mpc85xx-usb2-dr", "fsl-usb2-dr";
355+ };
349356 /include/ "qoriq-sec4.0-0.dtsi"
350357 };
arch/powerpc/configs/85xx/p1023rds_defconfig+10−21
@@ -6,28 +6,27 @@ CONFIG_SYSVIPC=y · 5 unmodified lines
66 CONFIG_POSIX_MQUEUE=y
77 CONFIG_BSD_PROCESS_ACCT=y
88 CONFIG_AUDIT=y
9−CONFIG_SPARSE_IRQ=y
9+CONFIG_IRQ_DOMAIN_DEBUG=y
10+CONFIG_NO_HZ=y
11+CONFIG_HIGH_RES_TIMERS=y
1012 CONFIG_IKCONFIG=y
1113 CONFIG_IKCONFIG_PROC=y
1214 CONFIG_LOG_BUF_SHIFT=14
1315 CONFIG_BLK_DEV_INITRD=y
14−# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
1516 CONFIG_KALLSYMS_ALL=y
16−CONFIG_KALLSYMS_EXTRA_PASS=y
1717 CONFIG_EMBEDDED=y
1818 CONFIG_MODULES=y
1919 CONFIG_MODULE_UNLOAD=y
2020 CONFIG_MODULE_FORCE_UNLOAD=y
2121 CONFIG_MODVERSIONS=y
2222 # CONFIG_BLK_DEV_BSG is not set
23+CONFIG_PARTITION_ADVANCED=y
24+CONFIG_MAC_PARTITION=y
2325 CONFIG_P1023_RDS=y
2426 CONFIG_QUICC_ENGINE=y
2527 CONFIG_QE_GPIO=y
2628 CONFIG_CPM2=y
27−CONFIG_GPIO_MPC8XXX=y
2829 CONFIG_HIGHMEM=y
29−CONFIG_NO_HZ=y
30−CONFIG_HIGH_RES_TIMERS=y
3130 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
3231 CONFIG_BINFMT_MISC=m
3332 CONFIG_MATH_EMULATION=y
@@ -63,11 +62,11 @@ CONFIG_INET_ESP=y · 29 unmodified lines
6362 CONFIG_IPV6=y
6463 CONFIG_IP_SCTP=m
6564 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
65+CONFIG_DEVTMPFS=y
6666 CONFIG_PROC_DEVICETREE=y
6767 CONFIG_BLK_DEV_LOOP=y
6868 CONFIG_BLK_DEV_RAM=y
6969 CONFIG_BLK_DEV_RAM_SIZE=131072
70−CONFIG_MISC_DEVICES=y
7170 CONFIG_EEPROM_LEGACY=y
7271 CONFIG_BLK_DEV_SD=y
7372 CONFIG_CHR_DEV_ST=y
@@ -80,15 +79,14 @@ CONFIG_SATA_FSL=y · 6 unmodified lines
8079 CONFIG_SATA_SIL24=y
8180 CONFIG_NETDEVICES=y
8281 CONFIG_DUMMY=y
82+CONFIG_FS_ENET=y
83+CONFIG_FSL_PQ_MDIO=y
84+CONFIG_E1000E=y
8385 CONFIG_MARVELL_PHY=y
8486 CONFIG_DAVICOM_PHY=y
8587 CONFIG_CICADA_PHY=y
8688 CONFIG_VITESSE_PHY=y
8789 CONFIG_FIXED_PHY=y
88−CONFIG_NET_ETHERNET=y
89−CONFIG_FS_ENET=y
90−CONFIG_E1000E=y
91−CONFIG_FSL_PQ_MDIO=y
9290 CONFIG_INPUT_FF_MEMLESS=m
9391 # CONFIG_INPUT_MOUSEDEV is not set
9492 # CONFIG_INPUT_KEYBOARD is not set
@@ -98,16 +96,15 @@ CONFIG_SERIAL_8250=y · 3 unmodified lines
9896 CONFIG_SERIAL_8250_CONSOLE=y
9997 CONFIG_SERIAL_8250_NR_UARTS=2
10098 CONFIG_SERIAL_8250_RUNTIME_UARTS=2
101−CONFIG_SERIAL_8250_EXTENDED=y
10299 CONFIG_SERIAL_8250_MANY_PORTS=y
103100 CONFIG_SERIAL_8250_DETECT_IRQ=y
104101 CONFIG_SERIAL_8250_RSA=y
105102 CONFIG_SERIAL_QE=m
106−CONFIG_HW_RANDOM=y
107103 CONFIG_NVRAM=y
108104 CONFIG_I2C=y
109105 CONFIG_I2C_CPM=m
110106 CONFIG_I2C_MPC=y
107+CONFIG_GPIO_MPC8XXX=y
111108 # CONFIG_HWMON is not set
112109 CONFIG_VIDEO_OUTPUT_CONTROL=y
113110 CONFIG_SOUND=y
@@ -123,7 +120,6 @@ CONFIG_DMADEVICES=y · 9 unmodified lines
123120 CONFIG_FSL_DMA=y
124121 # CONFIG_NET_DMA is not set
125122 CONFIG_STAGING=y
126−# CONFIG_STAGING_EXCLUDE_BUILD is not set
127123 CONFIG_EXT2_FS=y
128124 CONFIG_EXT3_FS=y
129125 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
@@ -150,22 +146,15 @@ CONFIG_QNX4FS_FS=m · 20 unmodified lines
150146 CONFIG_SYSV_FS=m
151147 CONFIG_UFS_FS=m
152148 CONFIG_NFS_FS=y
153−CONFIG_NFS_V3=y
154149 CONFIG_NFS_V4=y
155150 CONFIG_ROOT_NFS=y
156151 CONFIG_NFSD=y
157−CONFIG_PARTITION_ADVANCED=y
158−CONFIG_MAC_PARTITION=y
159152 CONFIG_CRC_T10DIF=y
160153 CONFIG_FRAME_WARN=8092
161154 CONFIG_DEBUG_FS=y
162−CONFIG_DEBUG_KERNEL=y
163155 CONFIG_DETECT_HUNG_TASK=y
164156 # CONFIG_DEBUG_BUGVERBOSE is not set
165157 CONFIG_DEBUG_INFO=y
166−# CONFIG_RCU_CPU_STALL_DETECTOR is not set
167−CONFIG_SYSCTL_SYSCALL_CHECK=y
168−CONFIG_IRQ_DOMAIN_DEBUG=y
169158 CONFIG_CRYPTO_PCBC=m
170159 CONFIG_CRYPTO_SHA256=y
171160 CONFIG_CRYPTO_SHA512=y
arch/powerpc/configs/corenet32_smp_defconfig+9−20
@@ -6,8 +6,8 @@ CONFIG_SYSVIPC=y · 5 unmodified lines
66 CONFIG_POSIX_MQUEUE=y
77 CONFIG_BSD_PROCESS_ACCT=y
88 CONFIG_AUDIT=y
9−CONFIG_SPARSE_IRQ=y
10−CONFIG_RCU_TRACE=y
9+CONFIG_NO_HZ=y
10+CONFIG_HIGH_RES_TIMERS=y
1111 CONFIG_IKCONFIG=y
1212 CONFIG_IKCONFIG_PROC=y
1313 CONFIG_LOG_BUF_SHIFT=14
@@ -21,23 +21,22 @@ CONFIG_MODULE_UNLOAD=y · 7 unmodified lines
2121 CONFIG_MODULE_FORCE_UNLOAD=y
2222 CONFIG_MODVERSIONS=y
2323 # CONFIG_BLK_DEV_BSG is not set
24+CONFIG_PARTITION_ADVANCED=y
25+CONFIG_MAC_PARTITION=y
2426 CONFIG_P2041_RDB=y
2527 CONFIG_P3041_DS=y
2628 CONFIG_P4080_DS=y
2729 CONFIG_P5020_DS=y
2830 CONFIG_HIGHMEM=y
29−CONFIG_NO_HZ=y
30−CONFIG_HIGH_RES_TIMERS=y
3131 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
3232 CONFIG_BINFMT_MISC=m
3333 CONFIG_KEXEC=y
3434 CONFIG_IRQ_ALL_CPUS=y
3535 CONFIG_FORCE_MAX_ZONEORDER=13
36−CONFIG_FSL_LBC=y
3736 CONFIG_PCI=y
3837 CONFIG_PCIEPORTBUS=y
39−CONFIG_PCI_MSI=y
4038 # CONFIG_PCIEASPM is not set
39+CONFIG_PCI_MSI=y
4140 CONFIG_RAPIDIO=y
4241 CONFIG_FSL_RIO=y
4342 CONFIG_NET=y
@@ -70,6 +69,7 @@ CONFIG_INET_IPCOMP=y · 26 unmodified lines
7069 CONFIG_IPV6=y
7170 CONFIG_IP_SCTP=m
7271 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
72+CONFIG_DEVTMPFS=y
7373 CONFIG_MTD=y
7474 CONFIG_MTD_CMDLINE_PARTS=y
7575 CONFIG_MTD_CHAR=y
@@ -77,17 +77,14 @@ CONFIG_MTD_BLOCK=y · 1 unmodified line
7777 CONFIG_MTD_CFI=y
7878 CONFIG_MTD_CFI_AMDSTD=y
7979 CONFIG_MTD_PHYSMAP_OF=y
80+CONFIG_MTD_M25P80=y
8081 CONFIG_MTD_NAND=y
81−CONFIG_MTD_NAND_ECC=y
82−CONFIG_MTD_NAND_IDS=y
83−CONFIG_MTD_NAND_FSL_IFC=y
8482 CONFIG_MTD_NAND_FSL_ELBC=y
85−CONFIG_MTD_M25P80=y
83+CONFIG_MTD_NAND_FSL_IFC=y
8684 CONFIG_PROC_DEVICETREE=y
8785 CONFIG_BLK_DEV_LOOP=y
8886 CONFIG_BLK_DEV_RAM=y
8987 CONFIG_BLK_DEV_RAM_SIZE=131072
90−CONFIG_MISC_DEVICES=y
9188 CONFIG_BLK_DEV_SD=y
9289 CONFIG_CHR_DEV_ST=y
9390 CONFIG_BLK_DEV_SR=y
@@ -115,11 +112,9 @@ CONFIG_SERIO_LIBPS2=y · 21 unmodified lines
115112 CONFIG_PPC_EPAPR_HV_BYTECHAN=y
116113 CONFIG_SERIAL_8250=y
117114 CONFIG_SERIAL_8250_CONSOLE=y
118−CONFIG_SERIAL_8250_EXTENDED=y
119115 CONFIG_SERIAL_8250_MANY_PORTS=y
120116 CONFIG_SERIAL_8250_DETECT_IRQ=y
121117 CONFIG_SERIAL_8250_RSA=y
122−CONFIG_HW_RANDOM=y
123118 CONFIG_NVRAM=y
124119 CONFIG_I2C=y
125120 CONFIG_I2C_CHARDEV=y
@@ -132,7 +127,6 @@ CONFIG_SPI_FSL_ESPI=y · 6 unmodified lines
132127 CONFIG_VIDEO_OUTPUT_CONTROL=y
133128 CONFIG_USB_HID=m
134129 CONFIG_USB=y
135−CONFIG_USB_DEVICEFS=y
136130 CONFIG_USB_MON=y
137131 CONFIG_USB_EHCI_HCD=y
138132 CONFIG_USB_EHCI_FSL=y
@@ -142,8 +136,6 @@ CONFIG_USB_OHCI_HCD_PPC_OF_LE=y · 3 unmodified lines
142136 CONFIG_USB_STORAGE=y
143137 CONFIG_MMC=y
144138 CONFIG_MMC_SDHCI=y
145−CONFIG_MMC_SDHCI_OF=y
146−CONFIG_MMC_SDHCI_OF_ESDHC=y
147139 CONFIG_EDAC=y
148140 CONFIG_EDAC_MM_EDAC=y
149141 CONFIG_EDAC_MPC85XX=y
@@ -170,19 +162,16 @@ CONFIG_HUGETLBFS=y · 20 unmodified lines
170162 CONFIG_JFFS2_FS=y
171163 CONFIG_CRAMFS=y
172164 CONFIG_NFS_FS=y
173−CONFIG_NFS_V3=y
174165 CONFIG_NFS_V4=y
175166 CONFIG_ROOT_NFS=y
176167 CONFIG_NFSD=m
177−CONFIG_PARTITION_ADVANCED=y
178−CONFIG_MAC_PARTITION=y
179168 CONFIG_NLS_ISO8859_1=y
180169 CONFIG_NLS_UTF8=m
181170 CONFIG_MAGIC_SYSRQ=y
182171 CONFIG_DEBUG_SHIRQ=y
183172 CONFIG_DETECT_HUNG_TASK=y
184173 CONFIG_DEBUG_INFO=y
185−CONFIG_SYSCTL_SYSCALL_CHECK=y
174+CONFIG_RCU_TRACE=y
186175 CONFIG_CRYPTO_NULL=y
187176 CONFIG_CRYPTO_PCBC=m
188177 CONFIG_CRYPTO_MD4=y
arch/powerpc/configs/corenet64_smp_defconfig+1−0
@@ -56,6 +56,7 @@ CONFIG_INET_ESP=y · 55 unmodified lines
5656 CONFIG_IPV6=y
5757 CONFIG_IP_SCTP=m
5858 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
59+CONFIG_DEVTMPFS=y
5960 CONFIG_MTD=y
6061 CONFIG_MTD_CMDLINE_PARTS=y
6162 CONFIG_MTD_CHAR=y
arch/powerpc/configs/g5_defconfig+73−30
@@ -1,8 +1,10 @@
1+CONFIG_PPC64=y
2+CONFIG_ALTIVEC=y
3+CONFIG_SMP=y
4+CONFIG_NR_CPUS=4
15 CONFIG_EXPERIMENTAL=y
26 CONFIG_SYSVIPC=y
37 CONFIG_POSIX_MQUEUE=y
4−CONFIG_NO_HZ=y
5−CONFIG_HIGH_RES_TIMERS=y
68 CONFIG_IKCONFIG=y
79 CONFIG_IKCONFIG_PROC=y
810 CONFIG_BLK_DEV_INITRD=y
@@ -13,15 +15,16 @@ CONFIG_MODULES=y · 4 unmodified lines
1315 CONFIG_MODULE_UNLOAD=y
1416 CONFIG_MODVERSIONS=y
1517 CONFIG_MODULE_SRCVERSION_ALL=y
16−CONFIG_PARTITION_ADVANCED=y
17−CONFIG_MAC_PARTITION=y
18−CONFIG_SMP=y
19−CONFIG_NR_CPUS=4
20−CONFIG_KEXEC=y
21−# CONFIG_RELOCATABLE is not set
18+# CONFIG_PPC_PSERIES is not set
2219 CONFIG_CPU_FREQ=y
2320 CONFIG_CPU_FREQ_GOV_POWERSAVE=y
2421 CONFIG_CPU_FREQ_GOV_USERSPACE=y
22+CONFIG_CPU_FREQ_PMAC64=y
23+CONFIG_NO_HZ=y
24+CONFIG_HIGH_RES_TIMERS=y
25+CONFIG_KEXEC=y
26+CONFIG_IRQ_ALL_CPUS=y
27+# CONFIG_MIGRATION is not set
2528 CONFIG_PCI_MSI=y
2629 CONFIG_NET=y
2730 CONFIG_PACKET=y
@@ -49,6 +52,7 @@ CONFIG_NF_CT_NETLINK=m · 21 unmodified lines
4952 CONFIG_NF_CONNTRACK_IPV4=m
5053 CONFIG_IP_NF_QUEUE=m
5154 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
55+CONFIG_PROC_DEVICETREE=y
5256 CONFIG_BLK_DEV_LOOP=y
5357 CONFIG_BLK_DEV_NBD=m
5458 CONFIG_BLK_DEV_RAM=y
@@ -56,6 +60,8 @@ CONFIG_BLK_DEV_RAM_SIZE=65536 · 1 unmodified line
5660 CONFIG_CDROM_PKTCDVD=m
5761 CONFIG_IDE=y
5862 CONFIG_BLK_DEV_IDECD=y
63+CONFIG_BLK_DEV_IDE_PMAC=y
64+CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
5965 CONFIG_BLK_DEV_SD=y
6066 CONFIG_CHR_DEV_ST=y
6167 CONFIG_BLK_DEV_SR=y
@@ -79,24 +85,33 @@ CONFIG_DM_CRYPT=m · 17 unmodified lines
7985 CONFIG_DM_SNAPSHOT=m
8086 CONFIG_DM_MIRROR=m
8187 CONFIG_DM_ZERO=m
82−CONFIG_MACINTOSH_DRIVERS=y
88+CONFIG_IEEE1394=y
89+CONFIG_IEEE1394_OHCI1394=y
90+CONFIG_IEEE1394_SBP2=m
91+CONFIG_IEEE1394_ETH1394=m
92+CONFIG_IEEE1394_RAWIO=y
93+CONFIG_IEEE1394_VIDEO1394=m
94+CONFIG_IEEE1394_DV1394=m
95+CONFIG_ADB_PMU=y
96+CONFIG_PMAC_SMU=y
8397 CONFIG_MAC_EMUMOUSEBTN=y
98+CONFIG_THERM_PM72=y
99+CONFIG_WINDFARM=y
100+CONFIG_WINDFARM_PM81=y
101+CONFIG_WINDFARM_PM91=y
102+CONFIG_WINDFARM_PM112=y
103+CONFIG_WINDFARM_PM121=y
84104 CONFIG_NETDEVICES=y
85−CONFIG_BONDING=m
86105 CONFIG_DUMMY=m
87−CONFIG_MII=y
106+CONFIG_BONDING=m
88107 CONFIG_TUN=m
108+CONFIG_NET_ETHERNET=y
109+CONFIG_MII=y
110+CONFIG_SUNGEM=y
89111 CONFIG_ACENIC=m
90112 CONFIG_ACENIC_OMIT_TIGON_I=y
91−CONFIG_TIGON3=y
92113 CONFIG_E1000=y
93−CONFIG_SUNGEM=y
94−CONFIG_PPP=m
95−CONFIG_PPP_BSDCOMP=m
96−CONFIG_PPP_DEFLATE=m
97−CONFIG_PPPOE=m
98−CONFIG_PPP_ASYNC=m
99−CONFIG_PPP_SYNC_TTY=m
114+CONFIG_TIGON3=y
100115 CONFIG_USB_CATC=m
101116 CONFIG_USB_KAWETH=m
102117 CONFIG_USB_PEGASUS=m
@@ -106,24 +121,36 @@ CONFIG_USB_USBNET=m · 3 unmodified lines
106121 # CONFIG_USB_NET_NET1080 is not set
107122 # CONFIG_USB_NET_CDC_SUBSET is not set
108123 # CONFIG_USB_NET_ZAURUS is not set
124+CONFIG_PPP=m
125+CONFIG_PPP_ASYNC=m
126+CONFIG_PPP_SYNC_TTY=m
127+CONFIG_PPP_DEFLATE=m
128+CONFIG_PPP_BSDCOMP=m
129+CONFIG_PPPOE=m
109130 # CONFIG_INPUT_MOUSEDEV_PSAUX is not set
110131 CONFIG_INPUT_JOYDEV=m
111132 CONFIG_INPUT_EVDEV=y
133+# CONFIG_KEYBOARD_ATKBD is not set
112134 # CONFIG_MOUSE_PS2 is not set
135+# CONFIG_SERIO_I8042 is not set
113136 # CONFIG_SERIO_SERPORT is not set
114−CONFIG_VT_HW_CONSOLE_BINDING=y
115137 # CONFIG_HW_RANDOM is not set
116138 CONFIG_GEN_RTC=y
117139 CONFIG_RAW_DRIVER=y
118140 CONFIG_I2C_CHARDEV=y
119141 # CONFIG_HWMON is not set
120−CONFIG_AGP=y
121−CONFIG_DRM=y
122−CONFIG_DRM_NOUVEAU=y
142+CONFIG_AGP=m
143+CONFIG_AGP_UNINORTH=m
123144 CONFIG_VIDEO_OUTPUT_CONTROL=m
145+CONFIG_FB=y
124146 CONFIG_FIRMWARE_EDID=y
125147 CONFIG_FB_TILEBLITTING=y
148+CONFIG_FB_OF=y
149+CONFIG_FB_NVIDIA=y
150+CONFIG_FB_NVIDIA_I2C=y
126151 CONFIG_FB_RADEON=y
152+# CONFIG_VGA_CONSOLE is not set
153+CONFIG_FRAMEBUFFER_CONSOLE=y
127154 CONFIG_LOGO=y
128155 CONFIG_SOUND=m
129156 CONFIG_SND=m
@@ -131,7 +158,15 @@ CONFIG_SND_SEQUENCER=m · 1 unmodified line
131158 CONFIG_SND_MIXER_OSS=m
132159 CONFIG_SND_PCM_OSS=m
133160 CONFIG_SND_SEQUENCER_OSS=y
161+CONFIG_SND_POWERMAC=m
162+CONFIG_SND_AOA=m
163+CONFIG_SND_AOA_FABRIC_LAYOUT=m
164+CONFIG_SND_AOA_ONYX=m
165+CONFIG_SND_AOA_TAS=m
166+CONFIG_SND_AOA_TOONIE=m
134167 CONFIG_SND_USB_AUDIO=m
168+CONFIG_HID_PID=y
169+CONFIG_USB_HIDDEV=y
135170 CONFIG_HID_GYRATION=y
136171 CONFIG_LOGITECH_FF=y
137172 CONFIG_HID_PANTHERLORD=y
@@ -139,12 +174,13 @@ CONFIG_HID_PETALYNX=y · 1 unmodified line
139174 CONFIG_HID_SAMSUNG=y
140175 CONFIG_HID_SONY=y
141176 CONFIG_HID_SUNPLUS=y
142−CONFIG_HID_PID=y
143−CONFIG_USB_HIDDEV=y
144177 CONFIG_USB=y
178+CONFIG_USB_DEVICEFS=y
145179 CONFIG_USB_MON=y
146180 CONFIG_USB_EHCI_HCD=y
181+# CONFIG_USB_EHCI_HCD_PPC_OF is not set
147182 CONFIG_USB_OHCI_HCD=y
183+CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
148184 CONFIG_USB_ACM=m
149185 CONFIG_USB_PRINTER=y
150186 CONFIG_USB_STORAGE=y
@@ -208,6 +244,8 @@ CONFIG_REISERFS_FS_POSIX_ACL=y · 57 unmodified lines
208244 CONFIG_REISERFS_FS_SECURITY=y
209245 CONFIG_XFS_FS=m
210246 CONFIG_XFS_POSIX_ACL=y
247+CONFIG_INOTIFY=y
248+CONFIG_AUTOFS_FS=m
211249 CONFIG_ISO9660_FS=y
212250 CONFIG_JOLIET=y
213251 CONFIG_ZISOFS=y
@@ -221,12 +259,14 @@ CONFIG_HFS_FS=m · 7 unmodified lines
221259 CONFIG_HFSPLUS_FS=m
222260 CONFIG_CRAMFS=y
223261 CONFIG_NFS_FS=y
262+CONFIG_NFS_V3=y
224263 CONFIG_NFS_V3_ACL=y
225264 CONFIG_NFS_V4=y
226265 CONFIG_NFSD=y
227266 CONFIG_NFSD_V3_ACL=y
228267 CONFIG_NFSD_V4=y
229268 CONFIG_CIFS=m
269+CONFIG_PARTITION_ADVANCED=y
230270 CONFIG_NLS_CODEPAGE_437=y
231271 CONFIG_NLS_CODEPAGE_1250=y
232272 CONFIG_NLS_CODEPAGE_1251=y
@@ -234,23 +274,29 @@ CONFIG_NLS_ASCII=y · 1 unmodified line
234274 CONFIG_NLS_ISO8859_1=y
235275 CONFIG_NLS_ISO8859_15=y
236276 CONFIG_NLS_UTF8=y
277+CONFIG_CRC_T10DIF=y
278+CONFIG_LIBCRC32C=m
237279 CONFIG_MAGIC_SYSRQ=y
238−# CONFIG_UNUSED_SYMBOLS is not set
239280 CONFIG_DEBUG_FS=y
240281 CONFIG_DEBUG_KERNEL=y
241282 CONFIG_DEBUG_MUTEXES=y
283+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
242284 CONFIG_LATENCYTOP=y
243−CONFIG_STRICT_DEVMEM=y
285+CONFIG_SYSCTL_SYSCALL_CHECK=y
286+CONFIG_BOOTX_TEXT=y
244287 CONFIG_CRYPTO_NULL=m
245288 CONFIG_CRYPTO_TEST=m
289+CONFIG_CRYPTO_ECB=m
246290 CONFIG_CRYPTO_PCBC=m
247291 CONFIG_CRYPTO_HMAC=y
292+CONFIG_CRYPTO_MD4=m
248293 CONFIG_CRYPTO_MICHAEL_MIC=m
249294 CONFIG_CRYPTO_SHA256=m
250295 CONFIG_CRYPTO_SHA512=m
251296 CONFIG_CRYPTO_WP512=m
252297 CONFIG_CRYPTO_AES=m
253298 CONFIG_CRYPTO_ANUBIS=m
299+CONFIG_CRYPTO_ARC4=m
254300 CONFIG_CRYPTO_BLOWFISH=m
255301 CONFIG_CRYPTO_CAST5=m
256302 CONFIG_CRYPTO_CAST6=m
@@ -260,6 +306,3 @@ CONFIG_CRYPTO_TEA=m · 3 unmodified lines
260306 CONFIG_CRYPTO_TWOFISH=m
261307 # CONFIG_CRYPTO_ANSI_CPRNG is not set
262308 # CONFIG_CRYPTO_HW is not set
263−# CONFIG_VIRTUALIZATION is not set
264−CONFIG_CRC_T10DIF=y
265−CONFIG_LIBCRC32C=m
arch/powerpc/configs/mpc83xx_defconfig+5−13
@@ -2,12 +2,12 @@ CONFIG_EXPERIMENTAL=y · 1 unmodified line
22 CONFIG_SYSVIPC=y
33 CONFIG_LOG_BUF_SHIFT=14
44 CONFIG_BLK_DEV_INITRD=y
5−# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
65 CONFIG_EXPERT=y
76 CONFIG_SLAB=y
87 CONFIG_MODULES=y
98 CONFIG_MODULE_UNLOAD=y
109 # CONFIG_BLK_DEV_BSG is not set
10+CONFIG_PARTITION_ADVANCED=y
1111 # CONFIG_PPC_CHRP is not set
1212 # CONFIG_PPC_PMAC is not set
1313 CONFIG_PPC_83xx=y
@@ -25,7 +25,6 @@ CONFIG_ASP834x=y · 11 unmodified lines
2525 CONFIG_QUICC_ENGINE=y
2626 CONFIG_QE_GPIO=y
2727 CONFIG_MATH_EMULATION=y
28−CONFIG_SPARSE_IRQ=y
2928 CONFIG_PCI=y
3029 CONFIG_NET=y
3130 CONFIG_PACKET=y
@@ -42,10 +41,9 @@ CONFIG_INET_ESP=y · 10 unmodified lines
4241 # CONFIG_INET_LRO is not set
4342 # CONFIG_IPV6 is not set
4443 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
44+CONFIG_DEVTMPFS=y
4545 # CONFIG_FW_LOADER is not set
4646 CONFIG_MTD=y
47−CONFIG_MTD_PARTITIONS=y
48−CONFIG_MTD_OF_PARTS=y
4947 CONFIG_MTD_CHAR=y
5048 CONFIG_MTD_BLOCK=y
5149 CONFIG_MTD_CFI=y
@@ -64,15 +62,14 @@ CONFIG_ATA=y · 12 unmodified lines
6462 CONFIG_SATA_FSL=y
6563 CONFIG_SATA_SIL=y
6664 CONFIG_NETDEVICES=y
65+CONFIG_MII=y
66+CONFIG_UCC_GETH=y
67+CONFIG_GIANFAR=y
6768 CONFIG_MARVELL_PHY=y
6869 CONFIG_DAVICOM_PHY=y
6970 CONFIG_VITESSE_PHY=y
7071 CONFIG_ICPLUS_PHY=y
7172 CONFIG_FIXED_PHY=y
72−CONFIG_NET_ETHERNET=y
73−CONFIG_MII=y
74−CONFIG_GIANFAR=y
75−CONFIG_UCC_GETH=y
7673 CONFIG_INPUT_FF_MEMLESS=m
7774 # CONFIG_INPUT_MOUSEDEV is not set
7875 # CONFIG_INPUT_KEYBOARD is not set
@@ -112,17 +109,12 @@ CONFIG_RTC_DRV_DS1374=y · 33 unmodified lines
112109 CONFIG_EXT2_FS=y
113110 CONFIG_EXT3_FS=y
114111 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
115−CONFIG_INOTIFY=y
116112 CONFIG_PROC_KCORE=y
117113 CONFIG_TMPFS=y
118114 CONFIG_NFS_FS=y
119−CONFIG_NFS_V3=y
120115 CONFIG_NFS_V4=y
121116 CONFIG_ROOT_NFS=y
122−CONFIG_PARTITION_ADVANCED=y
123117 CONFIG_CRC_T10DIF=y
124−# CONFIG_RCU_CPU_STALL_DETECTOR is not set
125−CONFIG_SYSCTL_SYSCALL_CHECK=y
126118 CONFIG_CRYPTO_ECB=m
127119 CONFIG_CRYPTO_PCBC=m
128120 CONFIG_CRYPTO_SHA256=y
arch/powerpc/configs/mpc85xx_defconfig+9−24
@@ -5,7 +5,9 @@ CONFIG_SYSVIPC=y · 4 unmodified lines
55 CONFIG_POSIX_MQUEUE=y
66 CONFIG_BSD_PROCESS_ACCT=y
77 CONFIG_AUDIT=y
8−CONFIG_SPARSE_IRQ=y
8+CONFIG_IRQ_DOMAIN_DEBUG=y
9+CONFIG_NO_HZ=y
10+CONFIG_HIGH_RES_TIMERS=y
911 CONFIG_IKCONFIG=y
1012 CONFIG_IKCONFIG_PROC=y
1113 CONFIG_LOG_BUF_SHIFT=14
@@ -17,6 +19,8 @@ CONFIG_MODULE_UNLOAD=y · 5 unmodified lines
1719 CONFIG_MODULE_FORCE_UNLOAD=y
1820 CONFIG_MODVERSIONS=y
1921 # CONFIG_BLK_DEV_BSG is not set
22+CONFIG_PARTITION_ADVANCED=y
23+CONFIG_MAC_PARTITION=y
2024 CONFIG_MPC8540_ADS=y
2125 CONFIG_MPC8560_ADS=y
2226 CONFIG_MPC85xx_CDS=y
@@ -40,8 +44,6 @@ CONFIG_SBC8548=y · 17 unmodified lines
4044 CONFIG_QUICC_ENGINE=y
4145 CONFIG_QE_GPIO=y
4246 CONFIG_HIGHMEM=y
43−CONFIG_NO_HZ=y
44−CONFIG_HIGH_RES_TIMERS=y
4547 CONFIG_BINFMT_MISC=m
4648 CONFIG_MATH_EMULATION=y
4749 CONFIG_FORCE_MAX_ZONEORDER=12
@@ -74,36 +76,25 @@ CONFIG_INET_ESP=y · 26 unmodified lines
7476 CONFIG_IPV6=y
7577 CONFIG_IP_SCTP=m
7678 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
79+CONFIG_DEVTMPFS=y
7780 CONFIG_MTD=y
7881 CONFIG_MTD_CMDLINE_PARTS=y
7982 CONFIG_MTD_CHAR=y
8083 CONFIG_MTD_BLOCK=y
81−CONFIG_MTD_CFI=y
8284 CONFIG_FTL=y
83−CONFIG_MTD_GEN_PROBE=y
84−CONFIG_MTD_MAP_BANK_WIDTH_1=y
85−CONFIG_MTD_MAP_BANK_WIDTH_2=y
86−CONFIG_MTD_MAP_BANK_WIDTH_4=y
87−CONFIG_MTD_CFI_I1=y
88−CONFIG_MTD_CFI_I2=y
85+CONFIG_MTD_CFI=y
8986 CONFIG_MTD_CFI_INTELEXT=y
9087 CONFIG_MTD_CFI_AMDSTD=y
91−CONFIG_MTD_CFI_UTIL=y
9288 CONFIG_MTD_PHYSMAP_OF=y
93−CONFIG_MTD_PARTITIONS=y
94−CONFIG_MTD_OF_PARTS=y
89+CONFIG_MTD_M25P80=y
9590 CONFIG_MTD_NAND=y
9691 CONFIG_MTD_NAND_FSL_ELBC=y
9792 CONFIG_MTD_NAND_FSL_IFC=y
98−CONFIG_MTD_NAND_IDS=y
99−CONFIG_MTD_NAND_ECC=y
100−CONFIG_MTD_M25P80=y
10193 CONFIG_PROC_DEVICETREE=y
10294 CONFIG_BLK_DEV_LOOP=y
10395 CONFIG_BLK_DEV_NBD=y
10496 CONFIG_BLK_DEV_RAM=y
10597 CONFIG_BLK_DEV_RAM_SIZE=131072
106−CONFIG_MISC_DEVICES=y
10798 CONFIG_EEPROM_LEGACY=y
10899 CONFIG_BLK_DEV_SD=y
109100 CONFIG_CHR_DEV_ST=y
@@ -115,6 +106,7 @@ CONFIG_ATA=y · 5 unmodified lines
115106 CONFIG_SATA_AHCI=y
116107 CONFIG_SATA_FSL=y
117108 CONFIG_PATA_ALI=y
109+CONFIG_PATA_VIA=y
118110 CONFIG_NETDEVICES=y
119111 CONFIG_DUMMY=y
120112 CONFIG_FS_ENET=y
@@ -134,7 +126,6 @@ CONFIG_SERIAL_8250=y · 13 unmodified lines
134126 CONFIG_SERIAL_8250_CONSOLE=y
135127 CONFIG_SERIAL_8250_NR_UARTS=2
136128 CONFIG_SERIAL_8250_RUNTIME_UARTS=2
137−CONFIG_SERIAL_8250_EXTENDED=y
138129 CONFIG_SERIAL_8250_MANY_PORTS=y
139130 CONFIG_SERIAL_8250_DETECT_IRQ=y
140131 CONFIG_SERIAL_8250_RSA=y
@@ -183,7 +174,6 @@ CONFIG_HID_SAMSUNG=y · 42 unmodified lines
183174 CONFIG_HID_SONY=y
184175 CONFIG_HID_SUNPLUS=y
185176 CONFIG_USB=y
186−CONFIG_USB_DEVICEFS=y
187177 CONFIG_USB_MON=y
188178 CONFIG_USB_EHCI_HCD=y
189179 CONFIG_USB_EHCI_FSL=y
@@ -229,18 +219,13 @@ CONFIG_QNX4FS_FS=m · 39 unmodified lines
229219 CONFIG_SYSV_FS=m
230220 CONFIG_UFS_FS=m
231221 CONFIG_NFS_FS=y
232−CONFIG_NFS_V3=y
233222 CONFIG_NFS_V4=y
234223 CONFIG_ROOT_NFS=y
235224 CONFIG_NFSD=y
236−CONFIG_PARTITION_ADVANCED=y
237−CONFIG_MAC_PARTITION=y
238225 CONFIG_CRC_T10DIF=y
239226 CONFIG_DEBUG_FS=y
240227 CONFIG_DETECT_HUNG_TASK=y
241228 CONFIG_DEBUG_INFO=y
242−CONFIG_SYSCTL_SYSCALL_CHECK=y
243−CONFIG_IRQ_DOMAIN_DEBUG=y
244229 CONFIG_CRYPTO_PCBC=m
245230 CONFIG_CRYPTO_SHA256=y
246231 CONFIG_CRYPTO_SHA512=y
arch/powerpc/configs/mpc85xx_smp_defconfig+8−24
@@ -7,7 +7,9 @@ CONFIG_SYSVIPC=y · 6 unmodified lines
77 CONFIG_POSIX_MQUEUE=y
88 CONFIG_BSD_PROCESS_ACCT=y
99 CONFIG_AUDIT=y
10−CONFIG_SPARSE_IRQ=y
10+CONFIG_IRQ_DOMAIN_DEBUG=y
11+CONFIG_NO_HZ=y
12+CONFIG_HIGH_RES_TIMERS=y
1113 CONFIG_IKCONFIG=y
1214 CONFIG_IKCONFIG_PROC=y
1315 CONFIG_LOG_BUF_SHIFT=14
@@ -19,6 +21,8 @@ CONFIG_MODULE_UNLOAD=y · 5 unmodified lines
1921 CONFIG_MODULE_FORCE_UNLOAD=y
2022 CONFIG_MODVERSIONS=y
2123 # CONFIG_BLK_DEV_BSG is not set
24+CONFIG_PARTITION_ADVANCED=y
25+CONFIG_MAC_PARTITION=y
2226 CONFIG_MPC8540_ADS=y
2327 CONFIG_MPC8560_ADS=y
2428 CONFIG_MPC85xx_CDS=y
@@ -42,8 +46,6 @@ CONFIG_SBC8548=y · 17 unmodified lines
4246 CONFIG_QUICC_ENGINE=y
4347 CONFIG_QE_GPIO=y
4448 CONFIG_HIGHMEM=y
45−CONFIG_NO_HZ=y
46−CONFIG_HIGH_RES_TIMERS=y
4749 CONFIG_BINFMT_MISC=m
4850 CONFIG_MATH_EMULATION=y
4951 CONFIG_IRQ_ALL_CPUS=y
@@ -77,36 +79,25 @@ CONFIG_INET_ESP=y · 27 unmodified lines
7779 CONFIG_IPV6=y
7880 CONFIG_IP_SCTP=m
7981 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
82+CONFIG_DEVTMPFS=y
8083 CONFIG_MTD=y
8184 CONFIG_MTD_CMDLINE_PARTS=y
8285 CONFIG_MTD_CHAR=y
8386 CONFIG_MTD_BLOCK=y
84−CONFIG_MTD_CFI=y
8587 CONFIG_FTL=y
86−CONFIG_MTD_GEN_PROBE=y
87−CONFIG_MTD_MAP_BANK_WIDTH_1=y
88−CONFIG_MTD_MAP_BANK_WIDTH_2=y
89−CONFIG_MTD_MAP_BANK_WIDTH_4=y
90−CONFIG_MTD_CFI_I1=y
91−CONFIG_MTD_CFI_I2=y
88+CONFIG_MTD_CFI=y
9289 CONFIG_MTD_CFI_INTELEXT=y
9390 CONFIG_MTD_CFI_AMDSTD=y
94−CONFIG_MTD_CFI_UTIL=y
9591 CONFIG_MTD_PHYSMAP_OF=y
96−CONFIG_MTD_PARTITIONS=y
97−CONFIG_MTD_OF_PARTS=y
92+CONFIG_MTD_M25P80=y
9893 CONFIG_MTD_NAND=y
9994 CONFIG_MTD_NAND_FSL_ELBC=y
10095 CONFIG_MTD_NAND_FSL_IFC=y
101−CONFIG_MTD_NAND_IDS=y
102−CONFIG_MTD_NAND_ECC=y
103−CONFIG_MTD_M25P80=y
10496 CONFIG_PROC_DEVICETREE=y
10597 CONFIG_BLK_DEV_LOOP=y
10698 CONFIG_BLK_DEV_NBD=y
10799 CONFIG_BLK_DEV_RAM=y
108100 CONFIG_BLK_DEV_RAM_SIZE=131072
109−CONFIG_MISC_DEVICES=y
110101 CONFIG_EEPROM_LEGACY=y
111102 CONFIG_BLK_DEV_SD=y
112103 CONFIG_CHR_DEV_ST=y
@@ -137,7 +128,6 @@ CONFIG_SERIAL_8250=y · 24 unmodified lines
137128 CONFIG_SERIAL_8250_CONSOLE=y
138129 CONFIG_SERIAL_8250_NR_UARTS=2
139130 CONFIG_SERIAL_8250_RUNTIME_UARTS=2
140−CONFIG_SERIAL_8250_EXTENDED=y
141131 CONFIG_SERIAL_8250_MANY_PORTS=y
142132 CONFIG_SERIAL_8250_DETECT_IRQ=y
143133 CONFIG_SERIAL_8250_RSA=y
@@ -186,7 +176,6 @@ CONFIG_HID_SAMSUNG=y · 42 unmodified lines
186176 CONFIG_HID_SONY=y
187177 CONFIG_HID_SUNPLUS=y
188178 CONFIG_USB=y
189−CONFIG_USB_DEVICEFS=y
190179 CONFIG_USB_MON=y
191180 CONFIG_USB_EHCI_HCD=y
192181 CONFIG_USB_EHCI_FSL=y
@@ -232,18 +221,13 @@ CONFIG_QNX4FS_FS=m · 39 unmodified lines
232221 CONFIG_SYSV_FS=m
233222 CONFIG_UFS_FS=m
234223 CONFIG_NFS_FS=y
235−CONFIG_NFS_V3=y
236224 CONFIG_NFS_V4=y
237225 CONFIG_ROOT_NFS=y
238226 CONFIG_NFSD=y
239−CONFIG_PARTITION_ADVANCED=y
240−CONFIG_MAC_PARTITION=y
241227 CONFIG_CRC_T10DIF=y
242228 CONFIG_DEBUG_FS=y
243229 CONFIG_DETECT_HUNG_TASK=y
244230 CONFIG_DEBUG_INFO=y
245−CONFIG_SYSCTL_SYSCALL_CHECK=y
246−CONFIG_IRQ_DOMAIN_DEBUG=y
247231 CONFIG_CRYPTO_PCBC=m
248232 CONFIG_CRYPTO_SHA256=y
249233 CONFIG_CRYPTO_SHA512=y
arch/powerpc/include/asm/cputable.h+0−2
@@ -553,9 +553,7 @@ static inline int cpu_has_feature(unsigned long feature) · 552 unmodified lines
553553 & feature);
554554 }
555555
556−#ifdef CONFIG_HAVE_HW_BREAKPOINT
557556 #define HBP_NUM 1
558−#endif /* CONFIG_HAVE_HW_BREAKPOINT */
559557
560558 #endif /* !__ASSEMBLY__ */
561559
arch/powerpc/include/asm/kvm_host.h+1−0
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333 #include <asm/kvm_asm.h>
3434 #include <asm/processor.h>
3535 #include <asm/page.h>
36+#include <asm/cacheflush.h>
3637
3738 #define KVM_MAX_VCPUS NR_CPUS
3839 #define KVM_MAX_VCORES NR_CPUS
arch/powerpc/include/asm/kvm_ppc.h+12−0
@@ -219,4 +219,16 @@ void kvmppc_claim_lpid(long lpid); · 218 unmodified lines
219219 void kvmppc_free_lpid(long lpid);
220220 void kvmppc_init_lpid(unsigned long nr_lpids);
221221
222+static inline void kvmppc_mmu_flush_icache(pfn_t pfn)
223+{
224+ /* Clear i-cache for new pages */
225+ struct page *page;
226+ page = pfn_to_page(pfn);
227+ if (!test_bit(PG_arch_1, &page->flags)) {
228+ flush_dcache_icache_page(page);
229+ set_bit(PG_arch_1, &page->flags);
230+ }
231+}
232+
233+
222234 #endif /* __POWERPC_KVM_PPC_H__ */
arch/powerpc/include/asm/mpic_msgr.h+1−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <linux/types.h>
1515 #include <linux/spinlock.h>
1616 #include <asm/smp.h>
17+#include <asm/io.h>
1718
1819 struct mpic_msgr {
1920 u32 __iomem *base;
arch/powerpc/include/asm/processor.h+1−0
@@ -386,6 +386,7 @@ extern unsigned long cpuidle_disable; · 385 unmodified lines
386386 enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF};
387387
388388 extern int powersave_nap; /* set if nap mode can be used in idle loop */
389+extern void power7_nap(void);
389390
390391 #ifdef CONFIG_PSERIES_IDLE
391392 extern void update_smt_snooze_delay(int snooze);
arch/powerpc/kernel/asm-offsets.c+1−0
@@ -76,6 +76,7 @@ int main(void) · 75 unmodified lines
7676 DEFINE(SIGSEGV, SIGSEGV);
7777 DEFINE(NMI_MASK, NMI_MASK);
7878 DEFINE(THREAD_DSCR, offsetof(struct thread_struct, dscr));
79+ DEFINE(THREAD_DSCR_INHERIT, offsetof(struct thread_struct, dscr_inherit));
7980 #else
8081 DEFINE(THREAD_INFO, offsetof(struct task_struct, stack));
8182 #endif /* CONFIG_PPC64 */
arch/powerpc/kernel/dbell.c+2−0
@@ -28,6 +28,8 @@ void doorbell_setup_this_cpu(void) · 27 unmodified lines
2828
2929 void doorbell_cause_ipi(int cpu, unsigned long data)
3030 {
31+ /* Order previous accesses vs. msgsnd, which is treated as a store */
32+ mb();
3133 ppc_msgsnd(PPC_DBELL, 0, data);
3234 }
3335
arch/powerpc/kernel/dma-iommu.c+4−5
@@ -83,11 +83,10 @@ static int dma_iommu_dma_supported(struct device *dev, u64 mask) · 82 unmodified lines
8383 return 0;
8484 }
8585
86− if ((tbl->it_offset + tbl->it_size) > (mask >> IOMMU_PAGE_SHIFT)) {
87− dev_info(dev, "Warning: IOMMU window too big for device mask\n");
88− dev_info(dev, "mask: 0x%08llx, table end: 0x%08lx\n",
89− mask, (tbl->it_offset + tbl->it_size) <<
90− IOMMU_PAGE_SHIFT);
86+ if (tbl->it_offset > (mask >> IOMMU_PAGE_SHIFT)) {
87+ dev_info(dev, "Warning: IOMMU offset too big for device mask\n");
88+ dev_info(dev, "mask: 0x%08llx, table offset: 0x%08lx\n",
89+ mask, tbl->it_offset << IOMMU_PAGE_SHIFT);
9190 return 0;
9291 } else
9392 return 1;
arch/powerpc/kernel/entry_64.S+17−6
@@ -370,6 +370,12 @@ _GLOBAL(ret_from_fork) · 369 unmodified lines
370370 li r3,0
371371 b syscall_exit
372372
373+ .section ".toc","aw"
374+DSCR_DEFAULT:
375+ .tc dscr_default[TC],dscr_default
376+
377+ .section ".text"
378+
373379 /*
374380 * This routine switches between two different tasks. The process
375381 * state of one is saved on its kernel stack. Then the state
@@ -509,9 +515,6 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEGMENT) · 133 unmodified lines
509515 mr r1,r8 /* start using new stack pointer */
510516 std r7,PACAKSAVE(r13)
511517
512− ld r6,_CCR(r1)
513− mtcrf 0xFF,r6
514−
515518 #ifdef CONFIG_ALTIVEC
516519 BEGIN_FTR_SECTION
517520 ld r0,THREAD_VRSAVE(r4)
@@ -520,14 +523,22 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) · 2 unmodified lines
520523 #endif /* CONFIG_ALTIVEC */
521524 #ifdef CONFIG_PPC64
522525 BEGIN_FTR_SECTION
526+ lwz r6,THREAD_DSCR_INHERIT(r4)
527+ ld r7,DSCR_DEFAULT@toc(2)
523528 ld r0,THREAD_DSCR(r4)
524− cmpd r0,r25
525− beq 1f
529+ cmpwi r6,0
530+ bne 1f
531+ ld r0,0(r7)
532+1: cmpd r0,r25
533+ beq 2f
526534 mtspr SPRN_DSCR,r0
527−1:
535+2:
528536 END_FTR_SECTION_IFSET(CPU_FTR_DSCR)
529537 #endif
530538
539+ ld r6,_CCR(r1)
540+ mtcrf 0xFF,r6
541+
531542 /* r3-r13 are destroyed -- Cort */
532543 REST_8GPRS(14, r1)
533544 REST_10GPRS(22, r1)
arch/powerpc/kernel/exceptions-64s.S+2−1
@@ -186,7 +186,7 @@ hardware_interrupt_hv: · 185 unmodified lines
186186 KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x800)
187187
188188 MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer)
189− MASKABLE_EXCEPTION_HV(0x980, 0x982, decrementer)
189+ STD_EXCEPTION_HV(0x980, 0x982, hdecrementer)
190190
191191 STD_EXCEPTION_PSERIES(0xa00, 0xa00, trap_0a)
192192 KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xa00)
@@ -486,6 +486,7 @@ machine_check_common: · 293 unmodified lines
486486
487487 STD_EXCEPTION_COMMON_ASYNC(0x500, hardware_interrupt, do_IRQ)
488488 STD_EXCEPTION_COMMON_ASYNC(0x900, decrementer, .timer_interrupt)
489+ STD_EXCEPTION_COMMON(0x980, hdecrementer, .hdec_interrupt)
489490 STD_EXCEPTION_COMMON(0xa00, trap_0a, .unknown_exception)
490491 STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception)
491492 STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception)
arch/powerpc/kernel/hw_breakpoint.c+1−1
@@ -253,7 +253,7 @@ int __kprobes hw_breakpoint_handler(struct die_args *args) · 252 unmodified lines
253253
254254 /* Do not emulate user-space instructions, instead single-step them */
255255 if (user_mode(regs)) {
256− bp->ctx->task->thread.last_hit_ubp = bp;
256+ current->thread.last_hit_ubp = bp;
257257 regs->msr |= MSR_SE;
258258 goto out;
259259 }
arch/powerpc/kernel/idle_power7.S+2−0
@@ -28,7 +28,9 @@ _GLOBAL(power7_idle) · 27 unmodified lines
2828 lwz r4,ADDROFF(powersave_nap)(r3)
2929 cmpwi 0,r4,0
3030 beqlr
31+ /* fall through */
3132
33+_GLOBAL(power7_nap)
3234 /* NAP is a state loss, we create a regs frame on the
3335 * stack, fill it up with the state we care about and
3436 * stick a pointer to it in PACAR1. We really only
arch/powerpc/kernel/kgdb.c+24−3
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <asm/processor.h>
2626 #include <asm/machdep.h>
2727 #include <asm/debug.h>
28+#include <linux/slab.h>
2829
2930 /*
3031 * This table contains the mapping between PowerPC hardware trap types, and
@@ -101,6 +102,21 @@ static int computeSignal(unsigned int tt) · 70 unmodified lines
101102 return SIGHUP; /* default for things we don't know about */
102103 }
103104
105+/**
106+ *
107+ * kgdb_skipexception - Bail out of KGDB when we've been triggered.
108+ * @exception: Exception vector number
109+ * @regs: Current &struct pt_regs.
110+ *
111+ * On some architectures we need to skip a breakpoint exception when
112+ * it occurs after a breakpoint has been removed.
113+ *
114+ */
115+int kgdb_skipexception(int exception, struct pt_regs *regs)
116+{
117+ return kgdb_isremovedbreak(regs->nip);
118+}
119+
104120 static int kgdb_call_nmi_hook(struct pt_regs *regs)
105121 {
106122 kgdb_nmicallback(raw_smp_processor_id(), regs);
@@ -138,6 +154,8 @@ static int kgdb_handle_breakpoint(struct pt_regs *regs) · 31 unmodified lines
138154 static int kgdb_singlestep(struct pt_regs *regs)
139155 {
140156 struct thread_info *thread_info, *exception_thread_info;
157+ struct thread_info *backup_current_thread_info = \
158+ (struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL);
141159
142160 if (user_mode(regs))
143161 return 0;
@@ -155,13 +173,17 @@ static int kgdb_singlestep(struct pt_regs *regs) · 11 unmodified lines
155173 thread_info = (struct thread_info *)(regs->gpr[1] & ~(THREAD_SIZE-1));
156174 exception_thread_info = current_thread_info();
157175
158− if (thread_info != exception_thread_info)
176+ if (thread_info != exception_thread_info) {
177+ /* Save the original current_thread_info. */
178+ memcpy(backup_current_thread_info, exception_thread_info, sizeof *thread_info);
159179 memcpy(exception_thread_info, thread_info, sizeof *thread_info);
180+ }
160181
161182 kgdb_handle_exception(0, SIGTRAP, 0, regs);
162183
163184 if (thread_info != exception_thread_info)
164− memcpy(thread_info, exception_thread_info, sizeof *thread_info);
185+ /* Restore current_thread_info lastly. */
186+ memcpy(exception_thread_info, backup_current_thread_info, sizeof *thread_info);
165187
166188 return 1;
167189 }
@@ -410,7 +432,6 @@ int kgdb_arch_handle_exception(int vector, int signo, int err_code, · 242 unmodified lines
410432 #else
411433 linux_regs->msr |= MSR_SE;
412434 #endif
413− kgdb_single_step = 1;
414435 atomic_set(&kgdb_cpu_doing_single_step,
415436 raw_smp_processor_id());
416437 }
arch/powerpc/kernel/process.c+2−10
@@ -802,16 +802,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, · 801 unmodified lines
802802 #endif /* CONFIG_PPC_STD_MMU_64 */
803803 #ifdef CONFIG_PPC64
804804 if (cpu_has_feature(CPU_FTR_DSCR)) {
805− if (current->thread.dscr_inherit) {
806− p->thread.dscr_inherit = 1;
807− p->thread.dscr = current->thread.dscr;
808− } else if (0 != dscr_default) {
809− p->thread.dscr_inherit = 1;
810− p->thread.dscr = dscr_default;
811− } else {
812− p->thread.dscr_inherit = 0;
813− p->thread.dscr = 0;
814− }
805+ p->thread.dscr_inherit = current->thread.dscr_inherit;
806+ p->thread.dscr = current->thread.dscr;
815807 }
816808 #endif
817809
arch/powerpc/kernel/smp.c+9−2
@@ -198,8 +198,15 @@ void smp_muxed_ipi_message_pass(int cpu, int msg) · 197 unmodified lines
198198 struct cpu_messages *info = &per_cpu(ipi_message, cpu);
199199 char *message = (char *)&info->messages;
200200
201+ /*
202+ * Order previous accesses before accesses in the IPI handler.
203+ */
204+ smp_mb();
201205 message[msg] = 1;
202− mb();
206+ /*
207+ * cause_ipi functions are required to include a full barrier
208+ * before doing whatever causes the IPI.
209+ */
203210 smp_ops->cause_ipi(cpu, info->data);
204211 }
205212
@@ -211,7 +218,7 @@ irqreturn_t smp_ipi_demux(void) · 5 unmodified lines
211218 mb(); /* order any irq clear */
212219
213220 do {
214− all = xchg_local(&info->messages, 0);
221+ all = xchg(&info->messages, 0);
215222
216223 #ifdef __BIG_ENDIAN
217224 if (all & (1 << (24 - 8 * PPC_MSG_CALL_FUNCTION)))
arch/powerpc/kernel/syscalls.c+4−4
@@ -107,11 +107,11 @@ long ppc64_personality(unsigned long personality) · 106 unmodified lines
107107 long ret;
108108
109109 if (personality(current->personality) == PER_LINUX32
110− && personality == PER_LINUX)
111− personality = PER_LINUX32;
110+ && personality(personality) == PER_LINUX)
111+ personality = (personality & ~PER_MASK) | PER_LINUX32;
112112 ret = sys_personality(personality);
113− if (ret == PER_LINUX32)
114− ret = PER_LINUX;
113+ if (personality(ret) == PER_LINUX32)
114+ ret = (ret & ~PER_MASK) | PER_LINUX;
115115 return ret;
116116 }
117117 #endif
arch/powerpc/kernel/sysfs.c+10−0
@@ -194,6 +194,14 @@ static ssize_t show_dscr_default(struct device *dev, · 193 unmodified lines
194194 return sprintf(buf, "%lx\n", dscr_default);
195195 }
196196
197+static void update_dscr(void *dummy)
198+{
199+ if (!current->thread.dscr_inherit) {
200+ current->thread.dscr = dscr_default;
201+ mtspr(SPRN_DSCR, dscr_default);
202+ }
203+}
204+
197205 static ssize_t __used store_dscr_default(struct device *dev,
198206 struct device_attribute *attr, const char *buf,
199207 size_t count)
@@ -206,6 +214,8 @@ static ssize_t __used store_dscr_default(struct device *dev, · 6 unmodified lines
206214 return -EINVAL;
207215 dscr_default = val;
208216
217+ on_each_cpu(update_dscr, NULL, 1);
218+
209219 return count;
210220 }
211221
arch/powerpc/kernel/time.c+9−0
@@ -535,6 +535,15 @@ void timer_interrupt(struct pt_regs * regs) · 534 unmodified lines
535535 trace_timer_interrupt_exit(regs);
536536 }
537537
538+/*
539+ * Hypervisor decrementer interrupts shouldn't occur but are sometimes
540+ * left pending on exit from a KVM guest. We don't need to do anything
541+ * to clear them, as they are edge-triggered.
542+ */
543+void hdec_interrupt(struct pt_regs *regs)
544+{
545+}
546+
538547 #ifdef CONFIG_SUSPEND
539548 static void generic_suspend_disable_irqs(void)
540549 {
arch/powerpc/kernel/traps.c+2−1
@@ -972,8 +972,9 @@ static int emulate_instruction(struct pt_regs *regs) · 971 unmodified lines
972972 cpu_has_feature(CPU_FTR_DSCR)) {
973973 PPC_WARN_EMULATED(mtdscr, regs);
974974 rd = (instword >> 21) & 0x1f;
975− mtspr(SPRN_DSCR, regs->gpr[rd]);
975+ current->thread.dscr = regs->gpr[rd];
976976 current->thread.dscr_inherit = 1;
977+ mtspr(SPRN_DSCR, current->thread.dscr);
977978 return 0;
978979 }
979980 #endif
arch/powerpc/kvm/book3s_32_mmu_host.c+3−0
@@ -211,6 +211,9 @@ next_pteg: · 210 unmodified lines
211211 pteg1 |= PP_RWRX;
212212 }
213213
214+ if (orig_pte->may_execute)
215+ kvmppc_mmu_flush_icache(hpaddr >> PAGE_SHIFT);
216+
214217 local_irq_disable();
215218
216219 if (pteg[rr]) {
arch/powerpc/kvm/book3s_64_mmu_host.c+2−0
@@ -126,6 +126,8 @@ int kvmppc_mmu_map_page(struct kvm_vcpu *vcpu, struct kvmppc_pte *orig_pte) · 125 unmodified lines
126126
127127 if (!orig_pte->may_execute)
128128 rflags |= HPTE_R_N;
129+ else
130+ kvmppc_mmu_flush_icache(hpaddr >> PAGE_SHIFT);
129131
130132 hash = hpt_hash(va, PTE_SIZE, MMU_SEGSIZE_256M);
131133
arch/powerpc/kvm/book3s_hv_rmhandlers.S+7−5
@@ -1421,13 +1421,13 @@ _GLOBAL(kvmppc_h_cede) · 1420 unmodified lines
14211421 sync /* order setting ceded vs. testing prodded */
14221422 lbz r5,VCPU_PRODDED(r3)
14231423 cmpwi r5,0
1424− bne 1f
1424+ bne kvm_cede_prodded
14251425 li r0,0 /* set trap to 0 to say hcall is handled */
14261426 stw r0,VCPU_TRAP(r3)
14271427 li r0,H_SUCCESS
14281428 std r0,VCPU_GPR(R3)(r3)
14291429 BEGIN_FTR_SECTION
1430− b 2f /* just send it up to host on 970 */
1430+ b kvm_cede_exit /* just send it up to host on 970 */
14311431 END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_206)
14321432
14331433 /*
@@ -1446,7 +1446,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_206) · 12 unmodified lines
14461446 or r4,r4,r0
14471447 PPC_POPCNTW(R7,R4)
14481448 cmpw r7,r8
1449− bge 2f
1449+ bge kvm_cede_exit
14501450 stwcx. r4,0,r6
14511451 bne 31b
14521452 li r0,1
@@ -1555,7 +1555,8 @@ kvm_end_cede: · 102 unmodified lines
15551555 b hcall_real_fallback
15561556
15571557 /* cede when already previously prodded case */
1558−1: li r0,0
1558+kvm_cede_prodded:
1559+ li r0,0
15591560 stb r0,VCPU_PRODDED(r3)
15601561 sync /* order testing prodded vs. clearing ceded */
15611562 stb r0,VCPU_CEDED(r3)
@@ -1563,7 +1564,8 @@ kvm_end_cede: · 1 unmodified line
15631564 blr
15641565
15651566 /* we've ceded but we want to give control to the host */
1566−2: li r3,H_TOO_HARD
1567+kvm_cede_exit:
1568+ li r3,H_TOO_HARD
15671569 blr
15681570
15691571 secondary_too_late:
arch/powerpc/kvm/e500_tlb.c+7−4
@@ -322,11 +322,11 @@ static inline void kvmppc_e500_ref_release(struct tlbe_ref *ref) · 321 unmodified lines
322322 static void clear_tlb1_bitmap(struct kvmppc_vcpu_e500 *vcpu_e500)
323323 {
324324 if (vcpu_e500->g2h_tlb1_map)
325− memset(vcpu_e500->g2h_tlb1_map,
326− sizeof(u64) * vcpu_e500->gtlb_params[1].entries, 0);
325+ memset(vcpu_e500->g2h_tlb1_map, 0,
326+ sizeof(u64) * vcpu_e500->gtlb_params[1].entries);
327327 if (vcpu_e500->h2g_tlb1_rmap)
328− memset(vcpu_e500->h2g_tlb1_rmap,
329− sizeof(unsigned int) * host_tlb_params[1].entries, 0);
328+ memset(vcpu_e500->h2g_tlb1_rmap, 0,
329+ sizeof(unsigned int) * host_tlb_params[1].entries);
330330 }
331331
332332 static void clear_tlb_privs(struct kvmppc_vcpu_e500 *vcpu_e500)
@@ -539,6 +539,9 @@ static inline void kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, · 206 unmodified lines
539539
540540 kvmppc_e500_setup_stlbe(&vcpu_e500->vcpu, gtlbe, tsize,
541541 ref, gvaddr, stlbe);
542+
543+ /* Clear i-cache for new pages */
544+ kvmppc_mmu_flush_icache(pfn);
542545 }
543546
544547 /* XXX only map the one-one case, for now use TLB0 */
arch/powerpc/lib/code-patching.c+1−1
@@ -20,7 +20,7 @@ int patch_instruction(unsigned int *addr, unsigned int instr) · 19 unmodified lines
2020 {
2121 int err;
2222
23− err = __put_user(instr, addr);
23+ __put_user_size(instr, addr, 4, err);
2424 if (err)
2525 return err;
2626 asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (addr));
arch/powerpc/lib/copyuser_power7.S+2−33
@@ -288,7 +288,7 @@ err1; stb r0,0(r3) · 287 unmodified lines
288288 std r0,16(r1)
289289 stdu r1,-STACKFRAMESIZE(r1)
290290 bl .enter_vmx_usercopy
291− cmpwi r3,0
291+ cmpwi cr1,r3,0
292292 ld r0,STACKFRAMESIZE+16(r1)
293293 ld r3,STACKFRAMESIZE+48(r1)
294294 ld r4,STACKFRAMESIZE+56(r1)
@@ -326,38 +326,7 @@ err1; stb r0,0(r3) · 31 unmodified lines
326326 dcbt r0,r8,0b01010 /* GO */
327327 .machine pop
328328
329− /*
330− * We prefetch both the source and destination using enhanced touch
331− * instructions. We use a stream ID of 0 for the load side and
332− * 1 for the store side.
333− */
334− clrrdi r6,r4,7
335− clrrdi r9,r3,7
336− ori r9,r9,1 /* stream=1 */
337−
338− srdi r7,r5,7 /* length in cachelines, capped at 0x3FF */
339− cmpldi cr1,r7,0x3FF
340− ble cr1,1f
341− li r7,0x3FF
342−1: lis r0,0x0E00 /* depth=7 */
343− sldi r7,r7,7
344− or r7,r7,r0
345− ori r10,r7,1 /* stream=1 */
346−
347− lis r8,0x8000 /* GO=1 */
348− clrldi r8,r8,32
349−
350−.machine push
351−.machine "power4"
352− dcbt r0,r6,0b01000
353− dcbt r0,r7,0b01010
354− dcbtst r0,r9,0b01000
355− dcbtst r0,r10,0b01010
356− eieio
357− dcbt r0,r8,0b01010 /* GO */
358−.machine pop
359−
360− beq .Lunwind_stack_nonvmx_copy
329+ beq cr1,.Lunwind_stack_nonvmx_copy
361330
362331 /*
363332 * If source and destination are not relatively aligned we use a
arch/powerpc/lib/memcpy_power7.S+2−2
@@ -222,7 +222,7 @@ _GLOBAL(memcpy_power7) · 221 unmodified lines
222222 std r0,16(r1)
223223 stdu r1,-STACKFRAMESIZE(r1)
224224 bl .enter_vmx_copy
225− cmpwi r3,0
225+ cmpwi cr1,r3,0
226226 ld r0,STACKFRAMESIZE+16(r1)
227227 ld r3,STACKFRAMESIZE+48(r1)
228228 ld r4,STACKFRAMESIZE+56(r1)
@@ -260,7 +260,7 @@ _GLOBAL(memcpy_power7) · 31 unmodified lines
260260 dcbt r0,r8,0b01010 /* GO */
261261 .machine pop
262262
263− beq .Lunwind_stack_nonvmx_copy
263+ beq cr1,.Lunwind_stack_nonvmx_copy
264264
265265 /*
266266 * If source and destination are not relatively aligned we use a
arch/powerpc/mm/mem.c+1−0
@@ -469,6 +469,7 @@ void flush_dcache_icache_page(struct page *page) · 468 unmodified lines
469469 __flush_dcache_icache_phys(page_to_pfn(page) << PAGE_SHIFT);
470470 #endif
471471 }
472+EXPORT_SYMBOL(flush_dcache_icache_page);
472473
473474 void clear_user_page(void *page, unsigned long vaddr, struct page *pg)
474475 {
arch/powerpc/mm/numa.c+4−3
@@ -1436,11 +1436,11 @@ static long vphn_get_associativity(unsigned long cpu, · 1435 unmodified lines
14361436
14371437 /*
14381438 * Update the node maps and sysfs entries for each cpu whose home node
1439− * has changed.
1439+ * has changed. Returns 1 when the topology has changed, and 0 otherwise.
14401440 */
14411441 int arch_update_cpu_topology(void)
14421442 {
1443− int cpu, nid, old_nid;
1443+ int cpu, nid, old_nid, changed = 0;
14441444 unsigned int associativity[VPHN_ASSOC_BUFSIZE] = {0};
14451445 struct device *dev;
14461446
@@ -1466,9 +1466,10 @@ int arch_update_cpu_topology(void) · 19 unmodified lines
14661466 dev = get_cpu_device(cpu);
14671467 if (dev)
14681468 kobject_uevent(&dev->kobj, KOBJ_CHANGE);
1469+ changed = 1;
14691470 }
14701471
1471− return 1;
1472+ return changed;
14721473 }
14731474
14741475 static void topology_work_fn(struct work_struct *work)
arch/powerpc/perf/core-book3s.c+1−1
@@ -1431,7 +1431,7 @@ static void perf_event_interrupt(struct pt_regs *regs) · 1430 unmodified lines
14311431 if (!event->hw.idx || is_limited_pmc(event->hw.idx))
14321432 continue;
14331433 val = read_pmc(event->hw.idx);
1434− if ((int)val < 0) {
1434+ if (pmc_overflow(val)) {
14351435 /* event has overflowed */
14361436 found = 1;
14371437 record_and_restart(event, val, regs);
arch/powerpc/platforms/powernv/smp.c+1−9
@@ -106,14 +106,6 @@ static void pnv_smp_cpu_kill_self(void) · 105 unmodified lines
106106 {
107107 unsigned int cpu;
108108
109− /* If powersave_nap is enabled, use NAP mode, else just
110− * spin aimlessly
111− */
112− if (!powersave_nap) {
113− generic_mach_cpu_die();
114− return;
115− }
116−
117109 /* Standard hot unplug procedure */
118110 local_irq_disable();
119111 idle_task_exit();
@@ -128,7 +120,7 @@ static void pnv_smp_cpu_kill_self(void) · 8 unmodified lines
128120 */
129121 mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1);
130122 while (!generic_check_cpu_restart(cpu)) {
131− power7_idle();
123+ power7_nap();
132124 if (!generic_check_cpu_restart(cpu)) {
133125 DBG("CPU%d Unexpected exit while offline !\n", cpu);
134126 /* We may be getting an IPI, so we re-enable
arch/powerpc/sysdev/fsl_pci.c+8−5
@@ -465,7 +465,7 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary) · 464 unmodified lines
465465 iounmap(hose->cfg_data);
466466 iounmap(hose->cfg_addr);
467467 pcibios_free_controller(hose);
468− return 0;
468+ return -ENODEV;
469469 }
470470
471471 setup_pci_cmd(hose);
@@ -827,6 +827,7 @@ struct device_node *fsl_pci_primary; · 355 unmodified lines
827827
828828 void __devinit fsl_pci_init(void)
829829 {
830+ int ret;
830831 struct device_node *node;
831832 struct pci_controller *hose;
832833 dma_addr_t max = 0xffffffff;
@@ -855,10 +856,12 @@ void __devinit fsl_pci_init(void) · 22 unmodified lines
855856 if (!fsl_pci_primary)
856857 fsl_pci_primary = node;
857858
858− fsl_add_bridge(node, fsl_pci_primary == node);
859− hose = pci_find_hose_for_OF_device(node);
860− max = min(max, hose->dma_window_base_cur +
861− hose->dma_window_size);
859+ ret = fsl_add_bridge(node, fsl_pci_primary == node);
860+ if (ret == 0) {
861+ hose = pci_find_hose_for_OF_device(node);
862+ max = min(max, hose->dma_window_base_cur +
863+ hose->dma_window_size);
864+ }
862865 }
863866 }
864867
arch/powerpc/sysdev/mpic_msgr.c+3−0
@@ -14,6 +14,9 @@ · 13 unmodified lines
1414 #include <linux/list.h>
1515 #include <linux/of_platform.h>
1616 #include <linux/errno.h>
17+#include <linux/err.h>
18+#include <linux/export.h>
19+#include <linux/slab.h>
1720 #include <asm/prom.h>
1821 #include <asm/hw_irq.h>
1922 #include <asm/ppc-pci.h>
arch/powerpc/sysdev/xics/icp-hv.c+5−1
@@ -65,7 +65,11 @@ static inline void icp_hv_set_xirr(unsigned int value) · 64 unmodified lines
6565 static inline void icp_hv_set_qirr(int n_cpu , u8 value)
6666 {
6767 int hw_cpu = get_hard_smp_processor_id(n_cpu);
68− long rc = plpar_hcall_norets(H_IPI, hw_cpu, value);
68+ long rc;
69+
70+ /* Make sure all previous accesses are ordered before IPI sending */
71+ mb();
72+ rc = plpar_hcall_norets(H_IPI, hw_cpu, value);
6973 if (rc != H_SUCCESS) {
7074 pr_err("%s: bad return code qirr cpu=%d hw_cpu=%d mfrr=0x%x "
7175 "returned %ld\n", __func__, n_cpu, hw_cpu, value, rc);
arch/powerpc/xmon/xmon.c+34−50
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <linux/reboot.h>
1818 #include <linux/delay.h>
1919 #include <linux/kallsyms.h>
20+#include <linux/kmsg_dump.h>
2021 #include <linux/cpumask.h>
2122 #include <linux/export.h>
2223 #include <linux/sysrq.h>
@@ -894,13 +895,13 @@ cmds(struct pt_regs *excp) · 871 unmodified lines
894895 #endif
895896 default:
896897 printf("Unrecognized command: ");
897− do {
898+ do {
898899 if (' ' < cmd && cmd <= '~')
899900 putchar(cmd);
900901 else
901902 printf("\\x%x", cmd);
902903 cmd = inchar();
903− } while (cmd != '\n');
904+ } while (cmd != '\n');
904905 printf(" (type ? for help)\n");
905906 break;
906907 }
@@ -1097,7 +1098,7 @@ static long check_bp_loc(unsigned long addr) · 190 unmodified lines
10971098 return 1;
10981099 }
10991100
1100−static char *breakpoint_help_string =
1101+static char *breakpoint_help_string =
11011102 "Breakpoint command usage:\n"
11021103 "b show breakpoints\n"
11031104 "b <addr> [cnt] set breakpoint at given instr addr\n"
@@ -1193,7 +1194,7 @@ bpt_cmds(void) · 89 unmodified lines
11931194
11941195 default:
11951196 termch = cmd;
1196− cmd = skipbl();
1197+ cmd = skipbl();
11971198 if (cmd == '?') {
11981199 printf(breakpoint_help_string);
11991200 break;
@@ -1359,7 +1360,7 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr, · 159 unmodified lines
13591360 sp + REGS_OFFSET);
13601361 break;
13611362 }
1362− printf("--- Exception: %lx %s at ", regs.trap,
1363+ printf("--- Exception: %lx %s at ", regs.trap,
13631364 getvecname(TRAP(&regs)));
13641365 pc = regs.nip;
13651366 lr = regs.link;
@@ -1623,14 +1624,14 @@ static void super_regs(void) · 257 unmodified lines
16231624
16241625 cmd = skipbl();
16251626 if (cmd == '\n') {
1626− unsigned long sp, toc;
1627+ unsigned long sp, toc;
16271628 asm("mr %0,1" : "=r" (sp) :);
16281629 asm("mr %0,2" : "=r" (toc) :);
16291630
16301631 printf("msr = "REG" sprg0= "REG"\n",
16311632 mfmsr(), mfspr(SPRN_SPRG0));
16321633 printf("pvr = "REG" sprg1= "REG"\n",
1633− mfspr(SPRN_PVR), mfspr(SPRN_SPRG1));
1634+ mfspr(SPRN_PVR), mfspr(SPRN_SPRG1));
16341635 printf("dec = "REG" sprg2= "REG"\n",
16351636 mfspr(SPRN_DEC), mfspr(SPRN_SPRG2));
16361637 printf("sp = "REG" sprg3= "REG"\n", sp, mfspr(SPRN_SPRG3));
@@ -1783,7 +1784,7 @@ byterev(unsigned char *val, int size) · 146 unmodified lines
17831784 static int brev;
17841785 static int mnoread;
17851786
1786−static char *memex_help_string =
1787+static char *memex_help_string =
17871788 "Memory examine command usage:\n"
17881789 "m [addr] [flags] examine/change memory\n"
17891790 " addr is optional. will start where left off.\n"
@@ -1798,7 +1799,7 @@ static char *memex_help_string = · 8 unmodified lines
17981799 "NOTE: flags are saved as defaults\n"
17991800 "";
18001801
1801−static char *memex_subcmd_help_string =
1802+static char *memex_subcmd_help_string =
18021803 "Memory examine subcommands:\n"
18031804 " hexval write this val to current location\n"
18041805 " 'string' write chars from string to this location\n"
@@ -2064,7 +2065,7 @@ prdump(unsigned long adrs, long ndump) · 259 unmodified lines
20642065 nr = mread(adrs, temp, r);
20652066 adrs += nr;
20662067 for (m = 0; m < r; ++m) {
2067− if ((m & (sizeof(long) - 1)) == 0 && m > 0)
2068+ if ((m & (sizeof(long) - 1)) == 0 && m > 0)
20682069 putchar(' ');
20692070 if (m < nr)
20702071 printf("%.2x", temp[m]);
@@ -2072,7 +2073,7 @@ prdump(unsigned long adrs, long ndump) · 1 unmodified line
20722073 printf("%s", fault_chars[fault_type]);
20732074 }
20742075 for (; m < 16; ++m) {
2075− if ((m & (sizeof(long) - 1)) == 0)
2076+ if ((m & (sizeof(long) - 1)) == 0)
20762077 putchar(' ');
20772078 printf(" ");
20782079 }
@@ -2148,45 +2149,28 @@ print_address(unsigned long addr) · 69 unmodified lines
21482149 void
21492150 dump_log_buf(void)
21502151 {
2151− const unsigned long size = 128;
2152− unsigned long end, addr;
2153− unsigned char buf[size + 1];
2154−
2155− addr = 0;
2156− buf[size] = '\0';
2157−
2158− if (setjmp(bus_error_jmp) != 0) {
2159− printf("Unable to lookup symbol __log_buf!\n");
2160− return;
2161− }
2162−
2163− catch_memory_errors = 1;
2164− sync();
2165− addr = kallsyms_lookup_name("__log_buf");
2166−
2167− if (! addr)
2168− printf("Symbol __log_buf not found!\n");
2169− else {
2170− end = addr + (1 << CONFIG_LOG_BUF_SHIFT);
2171− while (addr < end) {
2172− if (! mread(addr, buf, size)) {
2173− printf("Can't read memory at address 0x%lx\n", addr);
2174− break;
2175− }
2176−
2177− printf("%s", buf);
2178−
2179− if (strlen(buf) < size)
2180− break;
2181−
2182− addr += size;
2183− }
2184− }
2185−
2186− sync();
2187− /* wait a little while to see if we get a machine check */
2188− __delay(200);
2189− catch_memory_errors = 0;
2152+ struct kmsg_dumper dumper = { .active = 1 };
2153+ unsigned char buf[128];
2154+ size_t len;
2155+
2156+ if (setjmp(bus_error_jmp) != 0) {
2157+ printf("Error dumping printk buffer!\n");
2158+ return;
2159+ }
2160+
2161+ catch_memory_errors = 1;
2162+ sync();
2163+
2164+ kmsg_dump_rewind_nolock(&dumper);
2165+ while (kmsg_dump_get_line_nolock(&dumper, false, buf, sizeof(buf), &len)) {
2166+ buf[len] = '\0';
2167+ printf("%s", buf);
2168+ }
2169+
2170+ sync();
2171+ /* wait a little while to see if we get a machine check */
2172+ __delay(200);
2173+ catch_memory_errors = 0;
21902174 }
21912175
21922176 /*
arch/s390/include/asm/elf.h+2−1
@@ -180,7 +180,8 @@ extern char elf_platform[]; · 179 unmodified lines
180180 #define ELF_PLATFORM (elf_platform)
181181
182182 #ifndef CONFIG_64BIT
183−#define SET_PERSONALITY(ex) set_personality(PER_LINUX)
183+#define SET_PERSONALITY(ex) \
184+ set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
184185 #else /* CONFIG_64BIT */
185186 #define SET_PERSONALITY(ex) \
186187 do { \
arch/s390/include/asm/posix_types.h+1−2
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 */
1414
1515 typedef unsigned long __kernel_size_t;
16+typedef long __kernel_ssize_t;
1617 #define __kernel_size_t __kernel_size_t
1718
1819 typedef unsigned short __kernel_old_dev_t;
@@ -25,7 +26,6 @@ typedef unsigned short __kernel_mode_t; · 6 unmodified lines
2526 typedef unsigned short __kernel_ipc_pid_t;
2627 typedef unsigned short __kernel_uid_t;
2728 typedef unsigned short __kernel_gid_t;
28−typedef int __kernel_ssize_t;
2929 typedef int __kernel_ptrdiff_t;
3030
3131 #else /* __s390x__ */
@@ -35,7 +35,6 @@ typedef unsigned int __kernel_mode_t; · 3 unmodified lines
3535 typedef int __kernel_ipc_pid_t;
3636 typedef unsigned int __kernel_uid_t;
3737 typedef unsigned int __kernel_gid_t;
38−typedef long __kernel_ssize_t;
3938 typedef long __kernel_ptrdiff_t;
4039 typedef unsigned long __kernel_sigset_t; /* at least 32 bits */
4140
arch/s390/include/asm/smp.h+1−0
@@ -44,6 +44,7 @@ static inline void smp_call_online_cpu(void (*func)(void *), void *data) · 43 unmodified lines
4444 }
4545
4646 static inline int smp_find_processor_id(int address) { return 0; }
47+static inline int smp_store_status(int cpu) { return 0; }
4748 static inline int smp_vcpu_scheduled(int cpu) { return 1; }
4849 static inline void smp_yield_cpu(int cpu) { }
4950 static inline void smp_yield(void) { }
arch/um/os-Linux/time.c+1−1
@@ -114,7 +114,7 @@ static void deliver_alarm(void) · 113 unmodified lines
114114 skew += this_tick - last_tick;
115115
116116 while (skew >= one_tick) {
117− alarm_handler(SIGVTALRM, NULL);
117+ alarm_handler(SIGVTALRM, NULL, NULL);
118118 skew -= one_tick;
119119 }
120120
arch/x86/include/asm/spinlock.h+1−2
@@ -12,8 +12,7 @@ · 11 unmodified lines
1212 * Simple spin lock operations. There are two variants, one clears IRQ's
1313 * on the local processor, one does not.
1414 *
15− * These are fair FIFO ticket locks, which are currently limited to 256
16− * CPUs.
15+ * These are fair FIFO ticket locks, which support up to 2^16 CPUs.
1716 *
1817 * (the type definitions are in asm/spinlock_types.h)
1918 */
arch/x86/kernel/alternative.c+1−1
@@ -165,7 +165,7 @@ static const unsigned char * const k7_nops[ASM_NOP_MAX+2] = · 164 unmodified lines
165165 #endif
166166
167167 #ifdef P6_NOP1
168−static const unsigned char __initconst_or_module p6nops[] =
168+static const unsigned char p6nops[] =
169169 {
170170 P6_NOP1,
171171 P6_NOP2,
arch/x86/kernel/irq.c+1−1
@@ -270,7 +270,7 @@ void fixup_irqs(void) · 269 unmodified lines
270270
271271 if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
272272 break_affinity = 1;
273− affinity = cpu_all_mask;
273+ affinity = cpu_online_mask;
274274 }
275275
276276 chip = irq_data_get_irq_chip(data);
arch/x86/kernel/microcode_amd.c+4−3
@@ -143,11 +143,12 @@ static int get_matching_microcode(int cpu, const u8 *ucode_ptr, · 142 unmodified lines
143143 unsigned int *current_size)
144144 {
145145 struct microcode_header_amd *mc_hdr;
146− unsigned int actual_size;
146+ unsigned int actual_size, patch_size;
147147 u16 equiv_cpu_id;
148148
149149 /* size of the current patch we're staring at */
150− *current_size = *(u32 *)(ucode_ptr + 4) + SECTION_HDR_SIZE;
150+ patch_size = *(u32 *)(ucode_ptr + 4);
151+ *current_size = patch_size + SECTION_HDR_SIZE;
151152
152153 equiv_cpu_id = find_equiv_id();
153154 if (!equiv_cpu_id)
@@ -174,7 +175,7 @@ static int get_matching_microcode(int cpu, const u8 *ucode_ptr, · 20 unmodified lines
174175 /*
175176 * now that the header looks sane, verify its size
176177 */
177− actual_size = verify_ucode_size(cpu, *current_size, leftover_size);
178+ actual_size = verify_ucode_size(cpu, patch_size, leftover_size);
178179 if (!actual_size)
179180 return 0;
180181
arch/x86/kvm/emulate.c+21−9
@@ -475,13 +475,26 @@ register_address(struct x86_emulate_ctxt *ctxt, unsigned long reg) · 474 unmodified lines
475475 return address_mask(ctxt, reg);
476476 }
477477
478+static void masked_increment(ulong *reg, ulong mask, int inc)
479+{
480+ assign_masked(reg, *reg + inc, mask);
481+}
482+
478483 static inline void
479484 register_address_increment(struct x86_emulate_ctxt *ctxt, unsigned long *reg, int inc)
480485 {
486+ ulong mask;
487+
481488 if (ctxt->ad_bytes == sizeof(unsigned long))
482− *reg += inc;
489+ mask = ~0UL;
483490 else
484− *reg = (*reg & ~ad_mask(ctxt)) | ((*reg + inc) & ad_mask(ctxt));
491+ mask = ad_mask(ctxt);
492+ masked_increment(reg, mask, inc);
493+}
494+
495+static void rsp_increment(struct x86_emulate_ctxt *ctxt, int inc)
496+{
497+ masked_increment(&ctxt->regs[VCPU_REGS_RSP], stack_mask(ctxt), inc);
485498 }
486499
487500 static inline void jmp_rel(struct x86_emulate_ctxt *ctxt, int rel)
@@ -1522,8 +1535,8 @@ static int push(struct x86_emulate_ctxt *ctxt, void *data, int bytes) · 1034 unmodified lines
15221535 {
15231536 struct segmented_address addr;
15241537
1525− register_address_increment(ctxt, &ctxt->regs[VCPU_REGS_RSP], -bytes);
1526− addr.ea = register_address(ctxt, ctxt->regs[VCPU_REGS_RSP]);
1538+ rsp_increment(ctxt, -bytes);
1539+ addr.ea = ctxt->regs[VCPU_REGS_RSP] & stack_mask(ctxt);
15271540 addr.seg = VCPU_SREG_SS;
15281541
15291542 return segmented_write(ctxt, addr, data, bytes);
@@ -1542,13 +1555,13 @@ static int emulate_pop(struct x86_emulate_ctxt *ctxt, · 12 unmodified lines
15421555 int rc;
15431556 struct segmented_address addr;
15441557
1545− addr.ea = register_address(ctxt, ctxt->regs[VCPU_REGS_RSP]);
1558+ addr.ea = ctxt->regs[VCPU_REGS_RSP] & stack_mask(ctxt);
15461559 addr.seg = VCPU_SREG_SS;
15471560 rc = segmented_read(ctxt, addr, dest, len);
15481561 if (rc != X86EMUL_CONTINUE)
15491562 return rc;
15501563
1551− register_address_increment(ctxt, &ctxt->regs[VCPU_REGS_RSP], len);
1564+ rsp_increment(ctxt, len);
15521565 return rc;
15531566 }
15541567
@@ -1688,8 +1701,7 @@ static int em_popa(struct x86_emulate_ctxt *ctxt) · 133 unmodified lines
16881701
16891702 while (reg >= VCPU_REGS_RAX) {
16901703 if (reg == VCPU_REGS_RSP) {
1691− register_address_increment(ctxt, &ctxt->regs[VCPU_REGS_RSP],
1692− ctxt->op_bytes);
1704+ rsp_increment(ctxt, ctxt->op_bytes);
16931705 --reg;
16941706 }
16951707
@@ -2825,7 +2837,7 @@ static int em_ret_near_imm(struct x86_emulate_ctxt *ctxt) · 1129 unmodified lines
28252837 rc = emulate_pop(ctxt, &ctxt->dst.val, ctxt->op_bytes);
28262838 if (rc != X86EMUL_CONTINUE)
28272839 return rc;
2828− register_address_increment(ctxt, &ctxt->regs[VCPU_REGS_RSP], ctxt->src.val);
2840+ rsp_increment(ctxt, ctxt->src.val);
28292841 return X86EMUL_CONTINUE;
28302842 }
28312843
arch/x86/kvm/mmu.c+9−4
@@ -4112,17 +4112,22 @@ static int mmu_shrink(struct shrinker *shrink, struct shrink_control *sc) · 4111 unmodified lines
41124112 int idx;
41134113 LIST_HEAD(invalid_list);
41144114
4115+ /*
4116+ * Never scan more than sc->nr_to_scan VM instances.
4117+ * Will not hit this condition practically since we do not try
4118+ * to shrink more than one VM and it is very unlikely to see
4119+ * !n_used_mmu_pages so many times.
4120+ */
4121+ if (!nr_to_scan--)
4122+ break;
41154123 /*
41164124 * n_used_mmu_pages is accessed without holding kvm->mmu_lock
41174125 * here. We may skip a VM instance errorneosly, but we do not
41184126 * want to shrink a VM that only started to populate its MMU
41194127 * anyway.
41204128 */
4121− if (kvm->arch.n_used_mmu_pages > 0) {
4122− if (!nr_to_scan--)
4123− break;
4129+ if (!kvm->arch.n_used_mmu_pages)
41244130 continue;
4125− }
41264131
41274132 idx = srcu_read_lock(&kvm->srcu);
41284133 spin_lock(&kvm->mmu_lock);
arch/x86/kvm/x86.c+4−1
@@ -806,7 +806,7 @@ EXPORT_SYMBOL_GPL(kvm_rdpmc); · 805 unmodified lines
806806 * kvm-specific. Those are put in the beginning of the list.
807807 */
808808
809−#define KVM_SAVE_MSRS_BEGIN 9
809+#define KVM_SAVE_MSRS_BEGIN 10
810810 static u32 msrs_to_save[] = {
811811 MSR_KVM_SYSTEM_TIME, MSR_KVM_WALL_CLOCK,
812812 MSR_KVM_SYSTEM_TIME_NEW, MSR_KVM_WALL_CLOCK_NEW,
@@ -2000,6 +2000,9 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata) · 1187 unmodified lines
20002000 case MSR_KVM_STEAL_TIME:
20012001 data = vcpu->arch.st.msr_val;
20022002 break;
2003+ case MSR_KVM_PV_EOI_EN:
2004+ data = vcpu->arch.pv_eoi.msr_val;
2005+ break;
20032006 case MSR_IA32_P5_MC_ADDR:
20042007 case MSR_IA32_P5_MC_TYPE:
20052008 case MSR_IA32_MCG_CAP:
arch/x86/xen/enlighten.c+11−107
@@ -31,7 +31,6 @@ · 30 unmodified lines
3131 #include <linux/pci.h>
3232 #include <linux/gfp.h>
3333 #include <linux/memblock.h>
34−#include <linux/syscore_ops.h>
3534
3635 #include <xen/xen.h>
3736 #include <xen/interface/xen.h>
@@ -1470,130 +1469,38 @@ asmlinkage void __init xen_start_kernel(void) · 1432 unmodified lines
14701469 #endif
14711470 }
14721471
1473−#ifdef CONFIG_XEN_PVHVM
1474−/*
1475− * The pfn containing the shared_info is located somewhere in RAM. This
1476− * will cause trouble if the current kernel is doing a kexec boot into a
1477− * new kernel. The new kernel (and its startup code) can not know where
1478− * the pfn is, so it can not reserve the page. The hypervisor will
1479− * continue to update the pfn, and as a result memory corruption occours
1480− * in the new kernel.
1481− *
1482− * One way to work around this issue is to allocate a page in the
1483− * xen-platform pci device's BAR memory range. But pci init is done very
1484− * late and the shared_info page is already in use very early to read
1485− * the pvclock. So moving the pfn from RAM to MMIO is racy because some
1486− * code paths on other vcpus could access the pfn during the small
1487− * window when the old pfn is moved to the new pfn. There is even a
1488− * small window were the old pfn is not backed by a mfn, and during that
1489− * time all reads return -1.
1490− *
1491− * Because it is not known upfront where the MMIO region is located it
1492− * can not be used right from the start in xen_hvm_init_shared_info.
1493− *
1494− * To minimise trouble the move of the pfn is done shortly before kexec.
1495− * This does not eliminate the race because all vcpus are still online
1496− * when the syscore_ops will be called. But hopefully there is no work
1497− * pending at this point in time. Also the syscore_op is run last which
1498− * reduces the risk further.
1499− */
1500−
1501−static struct shared_info *xen_hvm_shared_info;
1502−
1503−static void xen_hvm_connect_shared_info(unsigned long pfn)
1472+void __ref xen_hvm_init_shared_info(void)
15041473 {
1474+ int cpu;
15051475 struct xen_add_to_physmap xatp;
1476+ static struct shared_info *shared_info_page = 0;
15061477
1478+ if (!shared_info_page)
1479+ shared_info_page = (struct shared_info *)
1480+ extend_brk(PAGE_SIZE, PAGE_SIZE);
15071481 xatp.domid = DOMID_SELF;
15081482 xatp.idx = 0;
15091483 xatp.space = XENMAPSPACE_shared_info;
1510− xatp.gpfn = pfn;
1484+ xatp.gpfn = __pa(shared_info_page) >> PAGE_SHIFT;
15111485 if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp))
15121486 BUG();
15131487
1514−}
1515−static void xen_hvm_set_shared_info(struct shared_info *sip)
1516−{
1517− int cpu;
1518−
1519− HYPERVISOR_shared_info = sip;
1488+ HYPERVISOR_shared_info = (struct shared_info *)shared_info_page;
15201489
15211490 /* xen_vcpu is a pointer to the vcpu_info struct in the shared_info
15221491 * page, we use it in the event channel upcall and in some pvclock
15231492 * related functions. We don't need the vcpu_info placement
15241493 * optimizations because we don't use any pv_mmu or pv_irq op on
15251494 * HVM.
1526− * When xen_hvm_set_shared_info is run at boot time only vcpu 0 is
1527− * online but xen_hvm_set_shared_info is run at resume time too and
1495+ * When xen_hvm_init_shared_info is run at boot time only vcpu 0 is
1496+ * online but xen_hvm_init_shared_info is run at resume time too and
15281497 * in that case multiple vcpus might be online. */
15291498 for_each_online_cpu(cpu) {
15301499 per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu];
15311500 }
15321501 }
15331502
1534−/* Reconnect the shared_info pfn to a mfn */
1535−void xen_hvm_resume_shared_info(void)
1536−{
1537− xen_hvm_connect_shared_info(__pa(xen_hvm_shared_info) >> PAGE_SHIFT);
1538−}
1539−
1540−#ifdef CONFIG_KEXEC
1541−static struct shared_info *xen_hvm_shared_info_kexec;
1542−static unsigned long xen_hvm_shared_info_pfn_kexec;
1543−
1544−/* Remember a pfn in MMIO space for kexec reboot */
1545−void __devinit xen_hvm_prepare_kexec(struct shared_info *sip, unsigned long pfn)
1546−{
1547− xen_hvm_shared_info_kexec = sip;
1548− xen_hvm_shared_info_pfn_kexec = pfn;
1549−}
1550−
1551−static void xen_hvm_syscore_shutdown(void)
1552−{
1553− struct xen_memory_reservation reservation = {
1554− .domid = DOMID_SELF,
1555− .nr_extents = 1,
1556− };
1557− unsigned long prev_pfn;
1558− int rc;
1559−
1560− if (!xen_hvm_shared_info_kexec)
1561− return;
1562−
1563− prev_pfn = __pa(xen_hvm_shared_info) >> PAGE_SHIFT;
1564− set_xen_guest_handle(reservation.extent_start, &prev_pfn);
1565−
1566− /* Move pfn to MMIO, disconnects previous pfn from mfn */
1567− xen_hvm_connect_shared_info(xen_hvm_shared_info_pfn_kexec);
1568−
1569− /* Update pointers, following hypercall is also a memory barrier */
1570− xen_hvm_set_shared_info(xen_hvm_shared_info_kexec);
1571−
1572− /* Allocate new mfn for previous pfn */
1573− do {
1574− rc = HYPERVISOR_memory_op(XENMEM_populate_physmap, &reservation);
1575− if (rc == 0)
1576− msleep(123);
1577− } while (rc == 0);
1578−
1579− /* Make sure the previous pfn is really connected to a (new) mfn */
1580− BUG_ON(rc != 1);
1581−}
1582−
1583−static struct syscore_ops xen_hvm_syscore_ops = {
1584− .shutdown = xen_hvm_syscore_shutdown,
1585−};
1586−#endif
1587−
1588−/* Use a pfn in RAM, may move to MMIO before kexec. */
1589−static void __init xen_hvm_init_shared_info(void)
1590−{
1591− /* Remember pointer for resume */
1592− xen_hvm_shared_info = extend_brk(PAGE_SIZE, PAGE_SIZE);
1593− xen_hvm_connect_shared_info(__pa(xen_hvm_shared_info) >> PAGE_SHIFT);
1594− xen_hvm_set_shared_info(xen_hvm_shared_info);
1595−}
1596−
1503+#ifdef CONFIG_XEN_PVHVM
15971504 static void __init init_hvm_pv_info(void)
15981505 {
15991506 int major, minor;
@@ -1644,9 +1551,6 @@ static void __init xen_hvm_guest_init(void) · 44 unmodified lines
16441551 init_hvm_pv_info();
16451552
16461553 xen_hvm_init_shared_info();
1647−#ifdef CONFIG_KEXEC
1648− register_syscore_ops(&xen_hvm_syscore_ops);
1649−#endif
16501554
16511555 if (xen_feature(XENFEAT_hvm_callback_vector))
16521556 xen_have_vector_callback = 1;
arch/x86/xen/mmu.c+1−1
@@ -1283,7 +1283,7 @@ static void xen_flush_tlb_others(const struct cpumask *cpus, · 1282 unmodified lines
12831283 cpumask_clear_cpu(smp_processor_id(), to_cpumask(args->mask));
12841284
12851285 args->op.cmd = MMUEXT_TLB_FLUSH_MULTI;
1286− if (start != TLB_FLUSH_ALL && (end - start) <= PAGE_SIZE) {
1286+ if (end != TLB_FLUSH_ALL && (end - start) <= PAGE_SIZE) {
12871287 args->op.cmd = MMUEXT_INVLPG_MULTI;
12881288 args->op.arg1.linear_addr = start;
12891289 }
arch/x86/xen/p2m.c+92−3
@@ -196,9 +196,11 @@ RESERVE_BRK(p2m_mid_identity, PAGE_SIZE * 2 * 3); · 195 unmodified lines
196196
197197 /* When we populate back during bootup, the amount of pages can vary. The
198198 * max we have is seen is 395979, but that does not mean it can't be more.
199− * But some machines can have 3GB I/O holes even. So lets reserve enough
200− * for 4GB of I/O and E820 holes. */
201−RESERVE_BRK(p2m_populated, PMD_SIZE * 4);
199+ * Some machines can have 3GB I/O holes even. With early_can_reuse_p2m_middle
200+ * it can re-use Xen provided mfn_list array, so we only need to allocate at
201+ * most three P2M top nodes. */
202+RESERVE_BRK(p2m_populated, PAGE_SIZE * 3);
203+
202204 static inline unsigned p2m_top_index(unsigned long pfn)
203205 {
204206 BUG_ON(pfn >= MAX_P2M_PFN);
@@ -575,12 +577,99 @@ static bool __init early_alloc_p2m(unsigned long pfn) · 370 unmodified lines
575577 }
576578 return true;
577579 }
580+
581+/*
582+ * Skim over the P2M tree looking at pages that are either filled with
583+ * INVALID_P2M_ENTRY or with 1:1 PFNs. If found, re-use that page and
584+ * replace the P2M leaf with a p2m_missing or p2m_identity.
585+ * Stick the old page in the new P2M tree location.
586+ */
587+bool __init early_can_reuse_p2m_middle(unsigned long set_pfn, unsigned long set_mfn)
588+{
589+ unsigned topidx;
590+ unsigned mididx;
591+ unsigned ident_pfns;
592+ unsigned inv_pfns;
593+ unsigned long *p2m;
594+ unsigned long *mid_mfn_p;
595+ unsigned idx;
596+ unsigned long pfn;
597+
598+ /* We only look when this entails a P2M middle layer */
599+ if (p2m_index(set_pfn))
600+ return false;
601+
602+ for (pfn = 0; pfn < MAX_DOMAIN_PAGES; pfn += P2M_PER_PAGE) {
603+ topidx = p2m_top_index(pfn);
604+
605+ if (!p2m_top[topidx])
606+ continue;
607+
608+ if (p2m_top[topidx] == p2m_mid_missing)
609+ continue;
610+
611+ mididx = p2m_mid_index(pfn);
612+ p2m = p2m_top[topidx][mididx];
613+ if (!p2m)
614+ continue;
615+
616+ if ((p2m == p2m_missing) || (p2m == p2m_identity))
617+ continue;
618+
619+ if ((unsigned long)p2m == INVALID_P2M_ENTRY)
620+ continue;
621+
622+ ident_pfns = 0;
623+ inv_pfns = 0;
624+ for (idx = 0; idx < P2M_PER_PAGE; idx++) {
625+ /* IDENTITY_PFNs are 1:1 */
626+ if (p2m[idx] == IDENTITY_FRAME(pfn + idx))
627+ ident_pfns++;
628+ else if (p2m[idx] == INVALID_P2M_ENTRY)
629+ inv_pfns++;
630+ else
631+ break;
632+ }
633+ if ((ident_pfns == P2M_PER_PAGE) || (inv_pfns == P2M_PER_PAGE))
634+ goto found;
635+ }
636+ return false;
637+found:
638+ /* Found one, replace old with p2m_identity or p2m_missing */
639+ p2m_top[topidx][mididx] = (ident_pfns ? p2m_identity : p2m_missing);
640+ /* And the other for save/restore.. */
641+ mid_mfn_p = p2m_top_mfn_p[topidx];
642+ /* NOTE: Even if it is a p2m_identity it should still be point to
643+ * a page filled with INVALID_P2M_ENTRY entries. */
644+ mid_mfn_p[mididx] = virt_to_mfn(p2m_missing);
645+
646+ /* Reset where we want to stick the old page in. */
647+ topidx = p2m_top_index(set_pfn);
648+ mididx = p2m_mid_index(set_pfn);
649+
650+ /* This shouldn't happen */
651+ if (WARN_ON(p2m_top[topidx] == p2m_mid_missing))
652+ early_alloc_p2m(set_pfn);
653+
654+ if (WARN_ON(p2m_top[topidx][mididx] != p2m_missing))
655+ return false;
656+
657+ p2m_init(p2m);
658+ p2m_top[topidx][mididx] = p2m;
659+ mid_mfn_p = p2m_top_mfn_p[topidx];
660+ mid_mfn_p[mididx] = virt_to_mfn(p2m);
661+
662+ return true;
663+}
578664 bool __init early_set_phys_to_machine(unsigned long pfn, unsigned long mfn)
579665 {
580666 if (unlikely(!__set_phys_to_machine(pfn, mfn))) {
581667 if (!early_alloc_p2m(pfn))
582668 return false;
583669
670+ if (early_can_reuse_p2m_middle(pfn, mfn))
671+ return __set_phys_to_machine(pfn, mfn);
672+
584673 if (!early_alloc_p2m_middle(pfn, false /* boundary crossover OK!*/))
585674 return false;
586675
arch/x86/xen/setup.c+8−1
@@ -78,9 +78,16 @@ static void __init xen_add_extra_mem(u64 start, u64 size) · 77 unmodified lines
7878 memblock_reserve(start, size);
7979
8080 xen_max_p2m_pfn = PFN_DOWN(start + size);
81+ for (pfn = PFN_DOWN(start); pfn < xen_max_p2m_pfn; pfn++) {
82+ unsigned long mfn = pfn_to_mfn(pfn);
83+
84+ if (WARN(mfn == pfn, "Trying to over-write 1-1 mapping (pfn: %lx)\n", pfn))
85+ continue;
86+ WARN(mfn != INVALID_P2M_ENTRY, "Trying to remove %lx which has %lx mfn!\n",
87+ pfn, mfn);
8188
82− for (pfn = PFN_DOWN(start); pfn <= xen_max_p2m_pfn; pfn++)
8389 __set_phys_to_machine(pfn, INVALID_P2M_ENTRY);
90+ }
8491 }
8592
8693 static unsigned long __init xen_do_chunk(unsigned long start,
arch/x86/xen/suspend.c+1−1
@@ -30,7 +30,7 @@ void xen_arch_hvm_post_suspend(int suspend_cancelled) · 29 unmodified lines
3030 {
3131 #ifdef CONFIG_XEN_PVHVM
3232 int cpu;
33− xen_hvm_resume_shared_info();
33+ xen_hvm_init_shared_info();
3434 xen_callback_vector();
3535 xen_unplug_emulated_devices();
3636 if (xen_feature(XENFEAT_hvm_safe_pvclock)) {
arch/x86/xen/xen-ops.h+1−1
@@ -41,7 +41,7 @@ void xen_enable_syscall(void); · 40 unmodified lines
4141 void xen_vcpu_restore(void);
4242
4343 void xen_callback_vector(void);
44−void xen_hvm_resume_shared_info(void);
44+void xen_hvm_init_shared_info(void);
4545 void xen_unplug_emulated_devices(void);
4646
4747 void __init xen_build_dynamic_phys_to_machine(void);
block/blk-lib.c+28−13
@@ -44,6 +44,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector, · 43 unmodified lines
4444 struct request_queue *q = bdev_get_queue(bdev);
4545 int type = REQ_WRITE | REQ_DISCARD;
4646 unsigned int max_discard_sectors;
47+ unsigned int granularity, alignment, mask;
4748 struct bio_batch bb;
4849 struct bio *bio;
4950 int ret = 0;
@@ -54,18 +55,20 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector, · 4 unmodified lines
5455 if (!blk_queue_discard(q))
5556 return -EOPNOTSUPP;
5657
58+ /* Zero-sector (unknown) and one-sector granularities are the same. */
59+ granularity = max(q->limits.discard_granularity >> 9, 1U);
60+ mask = granularity - 1;
61+ alignment = (bdev_discard_alignment(bdev) >> 9) & mask;
62+
5763 /*
5864 * Ensure that max_discard_sectors is of the proper
59− * granularity
65+ * granularity, so that requests stay aligned after a split.
6066 */
6167 max_discard_sectors = min(q->limits.max_discard_sectors, UINT_MAX >> 9);
68+ max_discard_sectors = round_down(max_discard_sectors, granularity);
6269 if (unlikely(!max_discard_sectors)) {
6370 /* Avoid infinite loop below. Being cautious never hurts. */
6471 return -EOPNOTSUPP;
65− } else if (q->limits.discard_granularity) {
66− unsigned int disc_sects = q->limits.discard_granularity >> 9;
67−
68− max_discard_sectors &= ~(disc_sects - 1);
6972 }
7073
7174 if (flags & BLKDEV_DISCARD_SECURE) {
@@ -79,25 +82,37 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector, · 7 unmodified lines
7982 bb.wait = &wait;
8083
8184 while (nr_sects) {
85+ unsigned int req_sects;
86+ sector_t end_sect;
87+
8288 bio = bio_alloc(gfp_mask, 1);
8389 if (!bio) {
8490 ret = -ENOMEM;
8591 break;
8692 }
8793
94+ req_sects = min_t(sector_t, nr_sects, max_discard_sectors);
95+
96+ /*
97+ * If splitting a request, and the next starting sector would be
98+ * misaligned, stop the discard at the previous aligned sector.
99+ */
100+ end_sect = sector + req_sects;
101+ if (req_sects < nr_sects && (end_sect & mask) != alignment) {
102+ end_sect =
103+ round_down(end_sect - alignment, granularity)
104+ + alignment;
105+ req_sects = end_sect - sector;
106+ }
107+
88108 bio->bi_sector = sector;
89109 bio->bi_end_io = bio_batch_end_io;
90110 bio->bi_bdev = bdev;
91111 bio->bi_private = &bb;
92112
93− if (nr_sects > max_discard_sectors) {
94− bio->bi_size = max_discard_sectors << 9;
95− nr_sects -= max_discard_sectors;
96− sector += max_discard_sectors;
97− } else {
98− bio->bi_size = nr_sects << 9;
99− nr_sects = 0;
100− }
113+ bio->bi_size = req_sects << 9;
114+ nr_sects -= req_sects;
115+ sector = end_sect;
101116
102117 atomic_inc(&bb.done);
103118 submit_bio(type, bio);
block/blk-merge.c+82−35
@@ -110,6 +110,49 @@ static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio, · 109 unmodified lines
110110 return 0;
111111 }
112112
113+static void
114+__blk_segment_map_sg(struct request_queue *q, struct bio_vec *bvec,
115+ struct scatterlist *sglist, struct bio_vec **bvprv,
116+ struct scatterlist **sg, int *nsegs, int *cluster)
117+{
118+
119+ int nbytes = bvec->bv_len;
120+
121+ if (*bvprv && *cluster) {
122+ if ((*sg)->length + nbytes > queue_max_segment_size(q))
123+ goto new_segment;
124+
125+ if (!BIOVEC_PHYS_MERGEABLE(*bvprv, bvec))
126+ goto new_segment;
127+ if (!BIOVEC_SEG_BOUNDARY(q, *bvprv, bvec))
128+ goto new_segment;
129+
130+ (*sg)->length += nbytes;
131+ } else {
132+new_segment:
133+ if (!*sg)
134+ *sg = sglist;
135+ else {
136+ /*
137+ * If the driver previously mapped a shorter
138+ * list, we could see a termination bit
139+ * prematurely unless it fully inits the sg
140+ * table on each mapping. We KNOW that there
141+ * must be more entries here or the driver
142+ * would be buggy, so force clear the
143+ * termination bit to avoid doing a full
144+ * sg_init_table() in drivers for each command.
145+ */
146+ (*sg)->page_link &= ~0x02;
147+ *sg = sg_next(*sg);
148+ }
149+
150+ sg_set_page(*sg, bvec->bv_page, nbytes, bvec->bv_offset);
151+ (*nsegs)++;
152+ }
153+ *bvprv = bvec;
154+}
155+
113156 /*
114157 * map a request to scatterlist, return number of sg entries setup. Caller
115158 * must make sure sg can hold rq->nr_phys_segments entries
@@ -131,41 +174,8 @@ int blk_rq_map_sg(struct request_queue *q, struct request *rq, · 15 unmodified lines
131174 bvprv = NULL;
132175 sg = NULL;
133176 rq_for_each_segment(bvec, rq, iter) {
134− int nbytes = bvec->bv_len;
135−
136− if (bvprv && cluster) {
137− if (sg->length + nbytes > queue_max_segment_size(q))
138− goto new_segment;
139−
140− if (!BIOVEC_PHYS_MERGEABLE(bvprv, bvec))
141− goto new_segment;
142− if (!BIOVEC_SEG_BOUNDARY(q, bvprv, bvec))
143− goto new_segment;
144−
145− sg->length += nbytes;
146− } else {
147−new_segment:
148− if (!sg)
149− sg = sglist;
150− else {
151− /*
152− * If the driver previously mapped a shorter
153− * list, we could see a termination bit
154− * prematurely unless it fully inits the sg
155− * table on each mapping. We KNOW that there
156− * must be more entries here or the driver
157− * would be buggy, so force clear the
158− * termination bit to avoid doing a full
159− * sg_init_table() in drivers for each command.
160− */
161− sg->page_link &= ~0x02;
162− sg = sg_next(sg);
163− }
164−
165− sg_set_page(sg, bvec->bv_page, nbytes, bvec->bv_offset);
166− nsegs++;
167− }
168− bvprv = bvec;
177+ __blk_segment_map_sg(q, bvec, sglist, &bvprv, &sg,
178+ &nsegs, &cluster);
169179 } /* segments in rq */
170180
171181
@@ -199,6 +209,43 @@ new_segment: · 27 unmodified lines
199209 }
200210 EXPORT_SYMBOL(blk_rq_map_sg);
201211
212+/**
213+ * blk_bio_map_sg - map a bio to a scatterlist
214+ * @q: request_queue in question
215+ * @bio: bio being mapped
216+ * @sglist: scatterlist being mapped
217+ *
218+ * Note:
219+ * Caller must make sure sg can hold bio->bi_phys_segments entries
220+ *
221+ * Will return the number of sg entries setup
222+ */
223+int blk_bio_map_sg(struct request_queue *q, struct bio *bio,
224+ struct scatterlist *sglist)
225+{
226+ struct bio_vec *bvec, *bvprv;
227+ struct scatterlist *sg;
228+ int nsegs, cluster;
229+ unsigned long i;
230+
231+ nsegs = 0;
232+ cluster = blk_queue_cluster(q);
233+
234+ bvprv = NULL;
235+ sg = NULL;
236+ bio_for_each_segment(bvec, bio, i) {
237+ __blk_segment_map_sg(q, bvec, sglist, &bvprv, &sg,
238+ &nsegs, &cluster);
239+ } /* segments in bio */
240+
241+ if (sg)
242+ sg_mark_end(sg);
243+
244+ BUG_ON(bio->bi_phys_segments && nsegs > bio->bi_phys_segments);
245+ return nsegs;
246+}
247+EXPORT_SYMBOL(blk_bio_map_sg);
248+
202249 static inline int ll_new_hw_segment(struct request_queue *q,
203250 struct request *req,
204251 struct bio *bio)
block/genhd.c+1−1
@@ -835,7 +835,7 @@ static void disk_seqf_stop(struct seq_file *seqf, void *v) · 834 unmodified lines
835835
836836 static void *show_partition_start(struct seq_file *seqf, loff_t *pos)
837837 {
838− static void *p;
838+ void *p;
839839
840840 p = disk_seqf_start(seqf, pos);
841841 if (!IS_ERR_OR_NULL(p) && !*pos)
drivers/ata/Kconfig+1−1
@@ -115,7 +115,7 @@ config SATA_SIL24 · 114 unmodified lines
115115 If unsure, say N.
116116
117117 config ATA_SFF
118− bool "ATA SFF support"
118+ bool "ATA SFF support (for legacy IDE and PATA)"
119119 default y
120120 help
121121 This option adds support for ATA controllers with SFF
drivers/ata/ahci.c+8−0
@@ -256,6 +256,14 @@ static const struct pci_device_id ahci_pci_tbl[] = { · 255 unmodified lines
256256 { PCI_VDEVICE(INTEL, 0x8c07), board_ahci }, /* Lynx Point RAID */
257257 { PCI_VDEVICE(INTEL, 0x8c0e), board_ahci }, /* Lynx Point RAID */
258258 { PCI_VDEVICE(INTEL, 0x8c0f), board_ahci }, /* Lynx Point RAID */
259+ { PCI_VDEVICE(INTEL, 0x9c02), board_ahci }, /* Lynx Point-LP AHCI */
260+ { PCI_VDEVICE(INTEL, 0x9c03), board_ahci }, /* Lynx Point-LP AHCI */
261+ { PCI_VDEVICE(INTEL, 0x9c04), board_ahci }, /* Lynx Point-LP RAID */
262+ { PCI_VDEVICE(INTEL, 0x9c05), board_ahci }, /* Lynx Point-LP RAID */
263+ { PCI_VDEVICE(INTEL, 0x9c06), board_ahci }, /* Lynx Point-LP RAID */
264+ { PCI_VDEVICE(INTEL, 0x9c07), board_ahci }, /* Lynx Point-LP RAID */
265+ { PCI_VDEVICE(INTEL, 0x9c0e), board_ahci }, /* Lynx Point-LP RAID */
266+ { PCI_VDEVICE(INTEL, 0x9c0f), board_ahci }, /* Lynx Point-LP RAID */
259267
260268 /* JMicron 360/1/3/5/6, match class to avoid IDE function */
261269 { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
drivers/ata/ahci.h+1−0
@@ -320,6 +320,7 @@ extern struct device_attribute *ahci_sdev_attrs[]; · 319 unmodified lines
320320 extern struct ata_port_operations ahci_ops;
321321 extern struct ata_port_operations ahci_pmp_retry_srst_ops;
322322
323+unsigned int ahci_dev_classify(struct ata_port *ap);
323324 void ahci_fill_cmd_slot(struct ahci_port_priv *pp, unsigned int tag,
324325 u32 opts);
325326 void ahci_save_initial_config(struct device *dev,
drivers/ata/ata_piix.c+8−0
@@ -329,6 +329,14 @@ 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 (Lynx Point-LP) */
333+ { 0x8086, 0x9c00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb },
334+ /* SATA Controller IDE (Lynx Point-LP) */
335+ { 0x8086, 0x9c01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb },
336+ /* SATA Controller IDE (Lynx Point-LP) */
337+ { 0x8086, 0x9c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
338+ /* SATA Controller IDE (Lynx Point-LP) */
339+ { 0x8086, 0x9c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
332340 /* SATA Controller IDE (DH89xxCC) */
333341 { 0x8086, 0x2326, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
334342 { } /* terminate list */
drivers/ata/libahci.c+2−1
@@ -1139,7 +1139,7 @@ static void ahci_dev_config(struct ata_device *dev) · 1138 unmodified lines
11391139 }
11401140 }
11411141
1142−static unsigned int ahci_dev_classify(struct ata_port *ap)
1142+unsigned int ahci_dev_classify(struct ata_port *ap)
11431143 {
11441144 void __iomem *port_mmio = ahci_port_base(ap);
11451145 struct ata_taskfile tf;
@@ -1153,6 +1153,7 @@ static unsigned int ahci_dev_classify(struct ata_port *ap) · 7 unmodified lines
11531153
11541154 return ata_dev_classify(&tf);
11551155 }
1156+EXPORT_SYMBOL_GPL(ahci_dev_classify);
11561157
11571158 void ahci_fill_cmd_slot(struct ahci_port_priv *pp, unsigned int tag,
11581159 u32 opts)
drivers/ata/libata-acpi.c+4−11
@@ -60,17 +60,7 @@ acpi_handle ata_ap_acpi_handle(struct ata_port *ap) · 59 unmodified lines
6060 if (ap->flags & ATA_FLAG_ACPI_SATA)
6161 return NULL;
6262
63− /*
64− * If acpi bind operation has already happened, we can get the handle
65− * for the port by checking the corresponding scsi_host device's
66− * firmware node, otherwise we will need to find out the handle from
67− * its parent's acpi node.
68− */
69− if (ap->scsi_host)
70− return DEVICE_ACPI_HANDLE(&ap->scsi_host->shost_gendev);
71− else
72− return acpi_get_child(DEVICE_ACPI_HANDLE(ap->host->dev),
73− ap->port_no);
63+ return acpi_get_child(DEVICE_ACPI_HANDLE(ap->host->dev), ap->port_no);
7464 }
7565 EXPORT_SYMBOL(ata_ap_acpi_handle);
7666
@@ -1101,6 +1091,9 @@ static int ata_acpi_bind_host(struct ata_port *ap, acpi_handle *handle) · 1024 unmodified lines
11011091 if (!*handle)
11021092 return -ENODEV;
11031093
1094+ if (ata_acpi_gtm(ap, &ap->__acpi_init_gtm) == 0)
1095+ ap->pflags |= ATA_PFLAG_INIT_GTM_VALID;
1096+
11041097 return 0;
11051098 }
11061099
drivers/ata/libata-core.c+2−1
@@ -4062,7 +4062,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { · 4061 unmodified lines
40624062 { "_NEC DV5800A", NULL, ATA_HORKAGE_NODMA },
40634063 { "SAMSUNG CD-ROM SN-124", "N001", ATA_HORKAGE_NODMA },
40644064 { "Seagate STT20000A", NULL, ATA_HORKAGE_NODMA },
4065− { "2GB ATA Flash Disk", "ADMA428M", ATA_HORKAGE_NODMA },
4065+ { " 2GB ATA Flash Disk", "ADMA428M", ATA_HORKAGE_NODMA },
40664066 /* Odd clown on sil3726/4726 PMPs */
40674067 { "Config Disk", NULL, ATA_HORKAGE_DISABLE },
40684068
@@ -4128,6 +4128,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { · 59 unmodified lines
41284128
41294129 /* Devices that do not need bridging limits applied */
41304130 { "MTRON MSP-SATA*", NULL, ATA_HORKAGE_BRIDGE_OK, },
4131+ { "BUFFALO HD-QSU2/R5", NULL, ATA_HORKAGE_BRIDGE_OK, },
41314132
41324133 /* Devices which aren't very happy with higher link speeds */
41334134 { "WD My Book", NULL, ATA_HORKAGE_1_5_GBPS, },
drivers/ata/pata_atiixp.c+16−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 #include <linux/delay.h>
2121 #include <scsi/scsi_host.h>
2222 #include <linux/libata.h>
23+#include <linux/dmi.h>
2324
2425 #define DRV_NAME "pata_atiixp"
2526 #define DRV_VERSION "0.4.6"
@@ -33,11 +34,26 @@ enum { · 7 unmodified lines
3334 ATIIXP_IDE_UDMA_MODE = 0x56
3435 };
3536
37+static const struct dmi_system_id attixp_cable_override_dmi_table[] = {
38+ {
39+ /* Board has onboard PATA<->SATA converters */
40+ .ident = "MSI E350DM-E33",
41+ .matches = {
42+ DMI_MATCH(DMI_BOARD_VENDOR, "MSI"),
43+ DMI_MATCH(DMI_BOARD_NAME, "E350DM-E33(MS-7720)"),
44+ },
45+ },
46+ { }
47+};
48+
3649 static int atiixp_cable_detect(struct ata_port *ap)
3750 {
3851 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
3952 u8 udma;
4053
54+ if (dmi_check_system(attixp_cable_override_dmi_table))
55+ return ATA_CBL_PATA40_SHORT;
56+
4157 /* Hack from drivers/ide/pci. Really we want to know how to do the
4258 raw detection not play follow the bios mode guess */
4359 pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ap->port_no, &udma);
drivers/base/dma-contiguous.c+1−1
@@ -250,7 +250,7 @@ int __init dma_declare_contiguous(struct device *dev, unsigned long size, · 249 unmodified lines
250250 return -EINVAL;
251251
252252 /* Sanitise input arguments */
253− alignment = PAGE_SIZE << max(MAX_ORDER, pageblock_order);
253+ alignment = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order);
254254 base = ALIGN(base, alignment);
255255 size = ALIGN(size, alignment);
256256 limit &= ~(alignment - 1);
drivers/block/drbd/drbd_bitmap.c+14−1
@@ -889,6 +889,7 @@ struct bm_aio_ctx { · 888 unmodified lines
889889 unsigned int done;
890890 unsigned flags;
891891 #define BM_AIO_COPY_PAGES 1
892+#define BM_WRITE_ALL_PAGES 2
892893 int error;
893894 struct kref kref;
894895 };
@@ -1059,7 +1060,8 @@ static int bm_rw(struct drbd_conf *mdev, int rw, unsigned flags, unsigned lazy_w · 164 unmodified lines
10591060 if (lazy_writeout_upper_idx && i == lazy_writeout_upper_idx)
10601061 break;
10611062 if (rw & WRITE) {
1062− if (bm_test_page_unchanged(b->bm_pages[i])) {
1063+ if (!(flags & BM_WRITE_ALL_PAGES) &&
1064+ bm_test_page_unchanged(b->bm_pages[i])) {
10631065 dynamic_dev_dbg(DEV, "skipped bm write for idx %u\n", i);
10641066 continue;
10651067 }
@@ -1140,6 +1142,17 @@ int drbd_bm_write(struct drbd_conf *mdev) __must_hold(local) · 74 unmodified lines
11401142 return bm_rw(mdev, WRITE, 0, 0);
11411143 }
11421144
1145+/**
1146+ * drbd_bm_write_all() - Write the whole bitmap to its on disk location.
1147+ * @mdev: DRBD device.
1148+ *
1149+ * Will write all pages.
1150+ */
1151+int drbd_bm_write_all(struct drbd_conf *mdev) __must_hold(local)
1152+{
1153+ return bm_rw(mdev, WRITE, BM_WRITE_ALL_PAGES, 0);
1154+}
1155+
11431156 /**
11441157 * drbd_bm_lazy_write_out() - Write bitmap pages 0 to @upper_idx-1, if they have changed.
11451158 * @mdev: DRBD device.
drivers/block/drbd/drbd_int.h+1−0
@@ -1469,6 +1469,7 @@ extern int drbd_bm_e_weight(struct drbd_conf *mdev, unsigned long enr); · 1468 unmodified lines
14691469 extern int drbd_bm_write_page(struct drbd_conf *mdev, unsigned int idx) __must_hold(local);
14701470 extern int drbd_bm_read(struct drbd_conf *mdev) __must_hold(local);
14711471 extern int drbd_bm_write(struct drbd_conf *mdev) __must_hold(local);
1472+extern int drbd_bm_write_all(struct drbd_conf *mdev) __must_hold(local);
14721473 extern int drbd_bm_write_copy_pages(struct drbd_conf *mdev) __must_hold(local);
14731474 extern unsigned long drbd_bm_ALe_set_all(struct drbd_conf *mdev,
14741475 unsigned long al_enr);
drivers/block/drbd/drbd_main.c+12−16
@@ -79,6 +79,7 @@ static int w_md_sync(struct drbd_conf *mdev, struct drbd_work *w, int unused); · 78 unmodified lines
7979 static void md_sync_timer_fn(unsigned long data);
8080 static int w_bitmap_io(struct drbd_conf *mdev, struct drbd_work *w, int unused);
8181 static int w_go_diskless(struct drbd_conf *mdev, struct drbd_work *w, int unused);
82+static void _tl_clear(struct drbd_conf *mdev);
8283
8384 MODULE_AUTHOR("Philipp Reisner <phil@linbit.com>, "
8485 "Lars Ellenberg <lars@linbit.com>");
@@ -432,19 +433,10 @@ static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what) · 347 unmodified lines
432433
433434 /* Actions operating on the disk state, also want to work on
434435 requests that got barrier acked. */
435− switch (what) {
436− case fail_frozen_disk_io:
437− case restart_frozen_disk_io:
438− list_for_each_safe(le, tle, &mdev->barrier_acked_requests) {
439− req = list_entry(le, struct drbd_request, tl_requests);
440− _req_mod(req, what);
441− }
442436
443− case connection_lost_while_pending:
444− case resend:
445− break;
446− default:
447− dev_err(DEV, "what = %d in _tl_restart()\n", what);
437+ list_for_each_safe(le, tle, &mdev->barrier_acked_requests) {
438+ req = list_entry(le, struct drbd_request, tl_requests);
439+ _req_mod(req, what);
448440 }
449441 }
450442
@@ -458,12 +450,17 @@ static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what) · 7 unmodified lines
458450 * receiver thread and the worker thread.
459451 */
460452 void tl_clear(struct drbd_conf *mdev)
453+{
454+ spin_lock_irq(&mdev->req_lock);
455+ _tl_clear(mdev);
456+ spin_unlock_irq(&mdev->req_lock);
457+}
458+
459+static void _tl_clear(struct drbd_conf *mdev)
461460 {
462461 struct list_head *le, *tle;
463462 struct drbd_request *r;
464463
465− spin_lock_irq(&mdev->req_lock);
466−
467464 _tl_restart(mdev, connection_lost_while_pending);
468465
469466 /* we expect this list to be empty. */
@@ -482,7 +479,6 @@ void tl_clear(struct drbd_conf *mdev) · 12 unmodified lines
482479
483480 memset(mdev->app_reads_hash, 0, APP_R_HSIZE*sizeof(void *));
484481
485− spin_unlock_irq(&mdev->req_lock);
486482 }
487483
488484 void tl_restart(struct drbd_conf *mdev, enum drbd_req_event what)
@@ -1476,12 +1472,12 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, · 987 unmodified lines
14761472 if (ns.susp_fen) {
14771473 /* case1: The outdate peer handler is successful: */
14781474 if (os.pdsk > D_OUTDATED && ns.pdsk <= D_OUTDATED) {
1479− tl_clear(mdev);
14801475 if (test_bit(NEW_CUR_UUID, &mdev->flags)) {
14811476 drbd_uuid_new_current(mdev);
14821477 clear_bit(NEW_CUR_UUID, &mdev->flags);
14831478 }
14841479 spin_lock_irq(&mdev->req_lock);
1480+ _tl_clear(mdev);
14851481 _drbd_set_state(_NS(mdev, susp_fen, 0), CS_VERBOSE, NULL);
14861482 spin_unlock_irq(&mdev->req_lock);
14871483 }
drivers/block/drbd/drbd_nl.c+2−2
@@ -674,8 +674,8 @@ enum determine_dev_size drbd_determine_dev_size(struct drbd_conf *mdev, enum dds · 673 unmodified lines
674674 la_size_changed && md_moved ? "size changed and md moved" :
675675 la_size_changed ? "size changed" : "md moved");
676676 /* next line implicitly does drbd_suspend_io()+drbd_resume_io() */
677− err = drbd_bitmap_io(mdev, &drbd_bm_write,
678− "size changed", BM_LOCKED_MASK);
677+ err = drbd_bitmap_io(mdev, md_moved ? &drbd_bm_write_all : &drbd_bm_write,
678+ "size changed", BM_LOCKED_MASK);
679679 if (err) {
680680 rv = dev_size_error;
681681 goto out;
drivers/block/drbd/drbd_req.c+32−4
@@ -695,6 +695,12 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, · 694 unmodified lines
695695 break;
696696
697697 case resend:
698+ /* Simply complete (local only) READs. */
699+ if (!(req->rq_state & RQ_WRITE) && !req->w.cb) {
700+ _req_may_be_done(req, m);
701+ break;
702+ }
703+
698704 /* If RQ_NET_OK is already set, we got a P_WRITE_ACK or P_RECV_ACK
699705 before the connection loss (B&C only); only P_BARRIER_ACK was missing.
700706 Trowing them out of the TL here by pretending we got a BARRIER_ACK
@@ -834,7 +840,15 @@ static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio, uns · 133 unmodified lines
834840 req->private_bio = NULL;
835841 }
836842 if (rw == WRITE) {
837− remote = 1;
843+ /* Need to replicate writes. Unless it is an empty flush,
844+ * which is better mapped to a DRBD P_BARRIER packet,
845+ * also for drbd wire protocol compatibility reasons. */
846+ if (unlikely(size == 0)) {
847+ /* The only size==0 bios we expect are empty flushes. */
848+ D_ASSERT(bio->bi_rw & REQ_FLUSH);
849+ remote = 0;
850+ } else
851+ remote = 1;
838852 } else {
839853 /* READ || READA */
840854 if (local) {
@@ -870,8 +884,11 @@ static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio, uns · 29 unmodified lines
870884 * extent. This waits for any resync activity in the corresponding
871885 * resync extent to finish, and, if necessary, pulls in the target
872886 * extent into the activity log, which involves further disk io because
873− * of transactional on-disk meta data updates. */
874− if (rw == WRITE && local && !test_bit(AL_SUSPENDED, &mdev->flags)) {
887+ * of transactional on-disk meta data updates.
888+ * Empty flushes don't need to go into the activity log, they can only
889+ * flush data for pending writes which are already in there. */
890+ if (rw == WRITE && local && size
891+ && !test_bit(AL_SUSPENDED, &mdev->flags)) {
875892 req->rq_state |= RQ_IN_ACT_LOG;
876893 drbd_al_begin_io(mdev, sector);
877894 }
@@ -994,7 +1011,10 @@ allocate_barrier: · 116 unmodified lines
9941011 if (rw == WRITE && _req_conflicts(req))
9951012 goto fail_conflicting;
9961013
997− list_add_tail(&req->tl_requests, &mdev->newest_tle->requests);
1014+ /* no point in adding empty flushes to the transfer log,
1015+ * they are mapped to drbd barriers already. */
1016+ if (likely(size!=0))
1017+ list_add_tail(&req->tl_requests, &mdev->newest_tle->requests);
9981018
9991019 /* NOTE remote first: to get the concurrent write detection right,
10001020 * we must register the request before start of local IO. */
@@ -1014,6 +1034,14 @@ allocate_barrier: · 13 unmodified lines
10141034 mdev->net_conf->on_congestion != OC_BLOCK && mdev->agreed_pro_version >= 96)
10151035 maybe_pull_ahead(mdev);
10161036
1037+ /* If this was a flush, queue a drbd barrier/start a new epoch.
1038+ * Unless the current epoch was empty anyways, or we are not currently
1039+ * replicating, in which case there is no point. */
1040+ if (unlikely(bio->bi_rw & REQ_FLUSH)
1041+ && mdev->newest_tle->n_writes
1042+ && drbd_should_do_remote(mdev->state))
1043+ queue_barrier(mdev);
1044+
10171045 spin_unlock_irq(&mdev->req_lock);
10181046 kfree(b); /* if someone else has beaten us to it... */
10191047
drivers/cpufreq/omap-cpufreq.c+3−1
@@ -218,7 +218,7 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy) · 217 unmodified lines
218218
219219 policy->cur = policy->min = policy->max = omap_getspeed(policy->cpu);
220220
221− if (atomic_inc_return(&freq_table_users) == 1)
221+ if (!freq_table)
222222 result = opp_init_cpufreq_table(mpu_dev, &freq_table);
223223
224224 if (result) {
@@ -227,6 +227,8 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy) · 2 unmodified lines
227227 goto fail_ck;
228228 }
229229
230+ atomic_inc_return(&freq_table_users);
231+
230232 result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
231233 if (result)
232234 goto fail_table;
drivers/crypto/caam/jr.c+5−5
@@ -63,7 +63,7 @@ static void caam_jr_dequeue(unsigned long devarg) · 62 unmodified lines
6363
6464 head = ACCESS_ONCE(jrp->head);
6565
66− spin_lock_bh(&jrp->outlock);
66+ spin_lock(&jrp->outlock);
6767
6868 sw_idx = tail = jrp->tail;
6969 hw_idx = jrp->out_ring_read_index;
@@ -115,7 +115,7 @@ static void caam_jr_dequeue(unsigned long devarg) · 45 unmodified lines
115115 jrp->tail = tail;
116116 }
117117
118− spin_unlock_bh(&jrp->outlock);
118+ spin_unlock(&jrp->outlock);
119119
120120 /* Finally, execute user's callback */
121121 usercall(dev, userdesc, userstatus, userarg);
@@ -236,14 +236,14 @@ int caam_jr_enqueue(struct device *dev, u32 *desc, · 114 unmodified lines
236236 return -EIO;
237237 }
238238
239− spin_lock(&jrp->inplock);
239+ spin_lock_bh(&jrp->inplock);
240240
241241 head = jrp->head;
242242 tail = ACCESS_ONCE(jrp->tail);
243243
244244 if (!rd_reg32(&jrp->rregs->inpring_avail) ||
245245 CIRC_SPACE(head, tail, JOBR_DEPTH) <= 0) {
246− spin_unlock(&jrp->inplock);
246+ spin_unlock_bh(&jrp->inplock);
247247 dma_unmap_single(dev, desc_dma, desc_size, DMA_TO_DEVICE);
248248 return -EBUSY;
249249 }
@@ -265,7 +265,7 @@ int caam_jr_enqueue(struct device *dev, u32 *desc, · 15 unmodified lines
265265
266266 wr_reg32(&jrp->rregs->inpring_jobadd, 1);
267267
268− spin_unlock(&jrp->inplock);
268+ spin_unlock_bh(&jrp->inplock);
269269
270270 return 0;
271271 }
drivers/crypto/hifn_795x.c+2−2
@@ -821,8 +821,8 @@ static int hifn_register_rng(struct hifn_device *dev) · 820 unmodified lines
821821 /*
822822 * We must wait at least 256 Pk_clk cycles between two reads of the rng.
823823 */
824− dev->rng_wait_time = DIV_ROUND_UP(NSEC_PER_SEC, dev->pk_clk_freq) *
825− 256;
824+ dev->rng_wait_time = DIV_ROUND_UP_ULL(NSEC_PER_SEC,
825+ dev->pk_clk_freq) * 256;
826826
827827 dev->rng.name = dev->name;
828828 dev->rng.data_present = hifn_rng_data_present,
drivers/gpio/Kconfig+1−1
@@ -294,7 +294,7 @@ config GPIO_MAX732X_IRQ · 293 unmodified lines
294294
295295 config GPIO_MC9S08DZ60
296296 bool "MX35 3DS BOARD MC9S08DZ60 GPIO functions"
297− depends on I2C && MACH_MX35_3DS
297+ depends on I2C=y && MACH_MX35_3DS
298298 help
299299 Select this to enable the MC9S08DZ60 GPIO driver
300300
drivers/gpio/gpio-em.c+2−2
@@ -247,9 +247,9 @@ static int __devinit em_gio_irq_domain_init(struct em_gio_priv *p) · 246 unmodified lines
247247
248248 p->irq_base = irq_alloc_descs(pdata->irq_base, 0,
249249 pdata->number_of_pins, numa_node_id());
250− if (IS_ERR_VALUE(p->irq_base)) {
250+ if (p->irq_base < 0) {
251251 dev_err(&pdev->dev, "cannot get irq_desc\n");
252− return -ENXIO;
252+ return p->irq_base;
253253 }
254254 pr_debug("gio: hw base = %d, nr = %d, sw base = %d\n",
255255 pdata->gpio_base, pdata->number_of_pins, p->irq_base);
drivers/gpio/gpio-rdc321x.c+1−0
@@ -170,6 +170,7 @@ static int __devinit rdc321x_gpio_probe(struct platform_device *pdev) · 169 unmodified lines
170170 rdc321x_gpio_dev->reg2_data_base = r->start + 0x4;
171171
172172 rdc321x_gpio_dev->chip.label = "rdc321x-gpio";
173+ rdc321x_gpio_dev->chip.owner = THIS_MODULE;
173174 rdc321x_gpio_dev->chip.direction_input = rdc_gpio_direction_input;
174175 rdc321x_gpio_dev->chip.direction_output = rdc_gpio_config;
175176 rdc321x_gpio_dev->chip.get = rdc_gpio_get_value;
drivers/gpio/gpiolib-of.c+1−1
@@ -82,7 +82,7 @@ int of_get_named_gpio_flags(struct device_node *np, const char *propname, · 81 unmodified lines
8282 gpiochip_find(&gg_data, of_gpiochip_find_and_xlate);
8383
8484 of_node_put(gg_data.gpiospec.np);
85− pr_debug("%s exited with status %d\n", __func__, ret);
85+ pr_debug("%s exited with status %d\n", __func__, gg_data.out_gpio);
8686 return gg_data.out_gpio;
8787 }
8888 EXPORT_SYMBOL(of_get_named_gpio_flags);
drivers/gpu/drm/drm_crtc.c+1−1
@@ -1981,7 +1981,7 @@ int drm_mode_cursor_ioctl(struct drm_device *dev, · 1980 unmodified lines
19811981 if (!drm_core_check_feature(dev, DRIVER_MODESET))
19821982 return -EINVAL;
19831983
1984− if (!req->flags)
1984+ if (!req->flags || (~DRM_MODE_CURSOR_FLAGS & req->flags))
19851985 return -EINVAL;
19861986
19871987 mutex_lock(&dev->mode_config.mutex);
drivers/gpu/drm/drm_edid.c+3−0
@@ -87,6 +87,9 @@ static struct edid_quirk { · 86 unmodified lines
8787 int product_id;
8888 u32 quirks;
8989 } edid_quirk_list[] = {
90+ /* ASUS VW222S */
91+ { "ACI", 0x22a2, EDID_QUIRK_FORCE_REDUCED_BLANKING },
92+
9093 /* Acer AL1706 */
9194 { "ACR", 44358, EDID_QUIRK_PREFER_LARGE_60 },
9295 /* Acer F51 */
drivers/gpu/drm/gma500/psb_intel_display.c+3−0
@@ -1362,6 +1362,9 @@ void psb_intel_crtc_init(struct drm_device *dev, int pipe, · 1361 unmodified lines
13621362 (struct drm_connector **) (psb_intel_crtc + 1);
13631363 psb_intel_crtc->mode_set.num_connectors = 0;
13641364 psb_intel_cursor_init(dev, psb_intel_crtc);
1365+
1366+ /* Set to true so that the pipe is forced off on initial config. */
1367+ psb_intel_crtc->active = true;
13651368 }
13661369
13671370 int psb_intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
drivers/gpu/drm/i915/i915_gem_gtt.c+1−1
@@ -72,7 +72,7 @@ int i915_gem_init_aliasing_ppgtt(struct drm_device *dev) · 71 unmodified lines
7272 /* ppgtt PDEs reside in the global gtt pagetable, which has 512*1024
7373 * entries. For aliasing ppgtt support we just steal them at the end for
7474 * now. */
75− first_pd_entry_in_global_pt = 512*1024 - I915_PPGTT_PD_ENTRIES;
75+ first_pd_entry_in_global_pt = dev_priv->mm.gtt->gtt_total_entries - I915_PPGTT_PD_ENTRIES;
7676
7777 ppgtt = kzalloc(sizeof(*ppgtt), GFP_KERNEL);
7878 if (!ppgtt)
drivers/gpu/drm/i915/intel_display.c+6−6
@@ -1384,7 +1384,7 @@ static void assert_pch_hdmi_disabled(struct drm_i915_private *dev_priv, · 1383 unmodified lines
13841384 enum pipe pipe, int reg)
13851385 {
13861386 u32 val = I915_READ(reg);
1387− WARN(hdmi_pipe_enabled(dev_priv, val, pipe),
1387+ WARN(hdmi_pipe_enabled(dev_priv, pipe, val),
13881388 "PCH HDMI (0x%08x) enabled on transcoder %c, should be disabled\n",
13891389 reg, pipe_name(pipe));
13901390
@@ -1404,13 +1404,13 @@ static void assert_pch_ports_disabled(struct drm_i915_private *dev_priv, · 13 unmodified lines
14041404
14051405 reg = PCH_ADPA;
14061406 val = I915_READ(reg);
1407− WARN(adpa_pipe_enabled(dev_priv, val, pipe),
1407+ WARN(adpa_pipe_enabled(dev_priv, pipe, val),
14081408 "PCH VGA enabled on transcoder %c, should be disabled\n",
14091409 pipe_name(pipe));
14101410
14111411 reg = PCH_LVDS;
14121412 val = I915_READ(reg);
1413− WARN(lvds_pipe_enabled(dev_priv, val, pipe),
1413+ WARN(lvds_pipe_enabled(dev_priv, pipe, val),
14141414 "PCH LVDS enabled on transcoder %c, should be disabled\n",
14151415 pipe_name(pipe));
14161416
@@ -1872,7 +1872,7 @@ static void disable_pch_hdmi(struct drm_i915_private *dev_priv, · 455 unmodified lines
18721872 enum pipe pipe, int reg)
18731873 {
18741874 u32 val = I915_READ(reg);
1875− if (hdmi_pipe_enabled(dev_priv, val, pipe)) {
1875+ if (hdmi_pipe_enabled(dev_priv, pipe, val)) {
18761876 DRM_DEBUG_KMS("Disabling pch HDMI %x on pipe %d\n",
18771877 reg, pipe);
18781878 I915_WRITE(reg, val & ~PORT_ENABLE);
@@ -1894,12 +1894,12 @@ static void intel_disable_pch_ports(struct drm_i915_private *dev_priv, · 15 unmodified lines
18941894
18951895 reg = PCH_ADPA;
18961896 val = I915_READ(reg);
1897− if (adpa_pipe_enabled(dev_priv, val, pipe))
1897+ if (adpa_pipe_enabled(dev_priv, pipe, val))
18981898 I915_WRITE(reg, val & ~ADPA_DAC_ENABLE);
18991899
19001900 reg = PCH_LVDS;
19011901 val = I915_READ(reg);
1902− if (lvds_pipe_enabled(dev_priv, val, pipe)) {
1902+ if (lvds_pipe_enabled(dev_priv, pipe, val)) {
19031903 DRM_DEBUG_KMS("disable lvds on pipe %d val 0x%08x\n", pipe, val);
19041904 I915_WRITE(reg, val & ~LVDS_PORT_EN);
19051905 POSTING_READ(reg);
drivers/gpu/drm/i915/intel_lvds.c+8−0
@@ -780,6 +780,14 @@ static const struct dmi_system_id intel_no_lvds[] = { · 779 unmodified lines
780780 DMI_MATCH(DMI_BOARD_NAME, "ZBOXSD-ID12/ID13"),
781781 },
782782 },
783+ {
784+ .callback = intel_no_lvds_dmi_callback,
785+ .ident = "Gigabyte GA-D525TUD",
786+ .matches = {
787+ DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."),
788+ DMI_MATCH(DMI_BOARD_NAME, "D525TUD"),
789+ },
790+ },
783791
784792 { } /* terminating entry */
785793 };
drivers/gpu/drm/i915/intel_sprite.c+2−2
@@ -60,11 +60,11 @@ ivb_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb, · 59 unmodified lines
6060
6161 switch (fb->pixel_format) {
6262 case DRM_FORMAT_XBGR8888:
63− sprctl |= SPRITE_FORMAT_RGBX888;
63+ sprctl |= SPRITE_FORMAT_RGBX888 | SPRITE_RGB_ORDER_RGBX;
6464 pixel_size = 4;
6565 break;
6666 case DRM_FORMAT_XRGB8888:
67− sprctl |= SPRITE_FORMAT_RGBX888 | SPRITE_RGB_ORDER_RGBX;
67+ sprctl |= SPRITE_FORMAT_RGBX888;
6868 pixel_size = 4;
6969 break;
7070 case DRM_FORMAT_YUYV:
drivers/gpu/drm/nouveau/nouveau_state.c+4−2
@@ -736,9 +736,11 @@ nouveau_card_init(struct drm_device *dev) · 735 unmodified lines
736736 }
737737 break;
738738 case NV_C0:
739− nvc0_copy_create(dev, 1);
739+ if (!(nv_rd32(dev, 0x022500) & 0x00000200))
740+ nvc0_copy_create(dev, 1);
740741 case NV_D0:
741− nvc0_copy_create(dev, 0);
742+ if (!(nv_rd32(dev, 0x022500) & 0x00000100))
743+ nvc0_copy_create(dev, 0);
742744 break;
743745 default:
744746 break;
drivers/gpu/drm/radeon/atombios_crtc.c+16−20
@@ -258,7 +258,6 @@ void atombios_crtc_dpms(struct drm_crtc *crtc, int mode) · 257 unmodified lines
258258 radeon_crtc->enabled = true;
259259 /* adjust pm to dpms changes BEFORE enabling crtcs */
260260 radeon_pm_compute_clocks(rdev);
261− /* disable crtc pair power gating before programming */
262261 if (ASIC_IS_DCE6(rdev) && !radeon_crtc->in_mode_set)
263262 atombios_powergate_crtc(crtc, ATOM_DISABLE);
264263 atombios_enable_crtc(crtc, ATOM_ENABLE);
@@ -278,25 +277,8 @@ void atombios_crtc_dpms(struct drm_crtc *crtc, int mode) · 13 unmodified lines
278277 atombios_enable_crtc_memreq(crtc, ATOM_DISABLE);
279278 atombios_enable_crtc(crtc, ATOM_DISABLE);
280279 radeon_crtc->enabled = false;
281− /* power gating is per-pair */
282− if (ASIC_IS_DCE6(rdev) && !radeon_crtc->in_mode_set) {
283− struct drm_crtc *other_crtc;
284− struct radeon_crtc *other_radeon_crtc;
285− list_for_each_entry(other_crtc, &rdev->ddev->mode_config.crtc_list, head) {
286− other_radeon_crtc = to_radeon_crtc(other_crtc);
287− if (((radeon_crtc->crtc_id == 0) && (other_radeon_crtc->crtc_id == 1)) ||
288− ((radeon_crtc->crtc_id == 1) && (other_radeon_crtc->crtc_id == 0)) ||
289− ((radeon_crtc->crtc_id == 2) && (other_radeon_crtc->crtc_id == 3)) ||
290− ((radeon_crtc->crtc_id == 3) && (other_radeon_crtc->crtc_id == 2)) ||
291− ((radeon_crtc->crtc_id == 4) && (other_radeon_crtc->crtc_id == 5)) ||
292− ((radeon_crtc->crtc_id == 5) && (other_radeon_crtc->crtc_id == 4))) {
293− /* if both crtcs in the pair are off, enable power gating */
294− if (other_radeon_crtc->enabled == false)
295− atombios_powergate_crtc(crtc, ATOM_ENABLE);
296− break;
297− }
298− }
299− }
280+ if (ASIC_IS_DCE6(rdev) && !radeon_crtc->in_mode_set)
281+ atombios_powergate_crtc(crtc, ATOM_ENABLE);
300282 /* adjust pm to dpms changes AFTER disabling crtcs */
301283 radeon_pm_compute_clocks(rdev);
302284 break;
@@ -1682,9 +1664,22 @@ static void atombios_crtc_disable(struct drm_crtc *crtc) · 1379 unmodified lines
16821664 struct drm_device *dev = crtc->dev;
16831665 struct radeon_device *rdev = dev->dev_private;
16841666 struct radeon_atom_ss ss;
1667+ int i;
16851668
16861669 atombios_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
16871670
1671+ for (i = 0; i < rdev->num_crtc; i++) {
1672+ if (rdev->mode_info.crtcs[i] &&
1673+ rdev->mode_info.crtcs[i]->enabled &&
1674+ i != radeon_crtc->crtc_id &&
1675+ radeon_crtc->pll_id == rdev->mode_info.crtcs[i]->pll_id) {
1676+ /* one other crtc is using this pll don't turn
1677+ * off the pll
1678+ */
1679+ goto done;
1680+ }
1681+ }
1682+
16881683 switch (radeon_crtc->pll_id) {
16891684 case ATOM_PPLL1:
16901685 case ATOM_PPLL2:
@@ -1701,6 +1696,7 @@ static void atombios_crtc_disable(struct drm_crtc *crtc) · 10 unmodified lines
17011696 default:
17021697 break;
17031698 }
1699+done:
17041700 radeon_crtc->pll_id = -1;
17051701 }
17061702
drivers/gpu/drm/radeon/atombios_dp.c+12−17
@@ -577,30 +577,25 @@ int radeon_dp_get_panel_mode(struct drm_encoder *encoder, · 576 unmodified lines
577577 struct radeon_device *rdev = dev->dev_private;
578578 struct radeon_connector *radeon_connector = to_radeon_connector(connector);
579579 int panel_mode = DP_PANEL_MODE_EXTERNAL_DP_MODE;
580+ u16 dp_bridge = radeon_connector_encoder_get_dp_bridge_encoder_id(connector);
581+ u8 tmp;
580582
581583 if (!ASIC_IS_DCE4(rdev))
582584 return panel_mode;
583585
584− if (radeon_connector_encoder_get_dp_bridge_encoder_id(connector) ==
585− ENCODER_OBJECT_ID_NUTMEG)
586− panel_mode = DP_PANEL_MODE_INTERNAL_DP1_MODE;
587− else if (radeon_connector_encoder_get_dp_bridge_encoder_id(connector) ==
588− ENCODER_OBJECT_ID_TRAVIS) {
589− u8 id[6];
590− int i;
591− for (i = 0; i < 6; i++)
592− id[i] = radeon_read_dpcd_reg(radeon_connector, 0x503 + i);
593− if (id[0] == 0x73 &&
594− id[1] == 0x69 &&
595− id[2] == 0x76 &&
596− id[3] == 0x61 &&
597− id[4] == 0x72 &&
598− id[5] == 0x54)
586+ if (dp_bridge != ENCODER_OBJECT_ID_NONE) {
587+ /* DP bridge chips */
588+ tmp = radeon_read_dpcd_reg(radeon_connector, DP_EDP_CONFIGURATION_CAP);
589+ if (tmp & 1)
590+ panel_mode = DP_PANEL_MODE_INTERNAL_DP2_MODE;
591+ else if ((dp_bridge == ENCODER_OBJECT_ID_NUTMEG) ||
592+ (dp_bridge == ENCODER_OBJECT_ID_TRAVIS))
599593 panel_mode = DP_PANEL_MODE_INTERNAL_DP1_MODE;
600594 else
601− panel_mode = DP_PANEL_MODE_INTERNAL_DP2_MODE;
595+ panel_mode = DP_PANEL_MODE_EXTERNAL_DP_MODE;
602596 } else if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
603− u8 tmp = radeon_read_dpcd_reg(radeon_connector, DP_EDP_CONFIGURATION_CAP);
597+ /* eDP */
598+ tmp = radeon_read_dpcd_reg(radeon_connector, DP_EDP_CONFIGURATION_CAP);
604599 if (tmp & 1)
605600 panel_mode = DP_PANEL_MODE_INTERNAL_DP2_MODE;
606601 }
drivers/gpu/drm/radeon/atombios_encoders.c+73−67
@@ -1379,6 +1379,8 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode) · 1378 unmodified lines
13791379 struct drm_device *dev = encoder->dev;
13801380 struct radeon_device *rdev = dev->dev_private;
13811381 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
1382+ struct drm_encoder *ext_encoder = radeon_get_external_encoder(encoder);
1383+ struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
13821384 struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
13831385 struct radeon_connector *radeon_connector = NULL;
13841386 struct radeon_connector_atom_dig *radeon_dig_connector = NULL;
@@ -1390,19 +1392,37 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode) · 5 unmodified lines
13901392
13911393 switch (mode) {
13921394 case DRM_MODE_DPMS_ON:
1393− /* some early dce3.2 boards have a bug in their transmitter control table */
1394− if ((rdev->family == CHIP_RV710) || (rdev->family == CHIP_RV730) ||
1395− ASIC_IS_DCE41(rdev) || ASIC_IS_DCE5(rdev)) {
1396− if (ASIC_IS_DCE6(rdev)) {
1397− /* It seems we need to call ATOM_ENCODER_CMD_SETUP again
1398− * before reenabling encoder on DPMS ON, otherwise we never
1399− * get picture
1400− */
1401− atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_SETUP, 0);
1395+ if (ASIC_IS_DCE41(rdev) || ASIC_IS_DCE5(rdev)) {
1396+ if (!connector)
1397+ dig->panel_mode = DP_PANEL_MODE_EXTERNAL_DP_MODE;
1398+ else
1399+ dig->panel_mode = radeon_dp_get_panel_mode(encoder, connector);
1400+
1401+ /* setup and enable the encoder */
1402+ atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_SETUP, 0);
1403+ atombios_dig_encoder_setup(encoder,
1404+ ATOM_ENCODER_CMD_SETUP_PANEL_MODE,
1405+ dig->panel_mode);
1406+ if (ext_encoder) {
1407+ if (ASIC_IS_DCE41(rdev) || ASIC_IS_DCE61(rdev))
1408+ atombios_external_encoder_setup(encoder, ext_encoder,
1409+ EXTERNAL_ENCODER_ACTION_V3_ENCODER_SETUP);
14021410 }
14031411 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);
1404− } else {
1412+ } else if (ASIC_IS_DCE4(rdev)) {
1413+ /* setup and enable the encoder */
1414+ atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_SETUP, 0);
1415+ /* enable the transmitter */
1416+ atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);
14051417 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0);
1418+ } else {
1419+ /* setup and enable the encoder and transmitter */
1420+ atombios_dig_encoder_setup(encoder, ATOM_ENABLE, 0);
1421+ atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP, 0, 0);
1422+ atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);
1423+ /* some early dce3.2 boards have a bug in their transmitter control table */
1424+ if ((rdev->family != CHIP_RV710) || (rdev->family != CHIP_RV730))
1425+ atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0);
14061426 }
14071427 if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) {
14081428 if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
@@ -1420,10 +1440,19 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode) · 11 unmodified lines
14201440 case DRM_MODE_DPMS_STANDBY:
14211441 case DRM_MODE_DPMS_SUSPEND:
14221442 case DRM_MODE_DPMS_OFF:
1423− if (ASIC_IS_DCE41(rdev) || ASIC_IS_DCE5(rdev))
1443+ if (ASIC_IS_DCE41(rdev) || ASIC_IS_DCE5(rdev)) {
1444+ /* disable the transmitter */
14241445 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_DISABLE, 0, 0);
1425− else
1446+ } else if (ASIC_IS_DCE4(rdev)) {
1447+ /* disable the transmitter */
1448+ atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_DISABLE_OUTPUT, 0, 0);
1449+ atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_DISABLE, 0, 0);
1450+ } else {
1451+ /* disable the encoder and transmitter */
14261452 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_DISABLE_OUTPUT, 0, 0);
1453+ atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_DISABLE, 0, 0);
1454+ atombios_dig_encoder_setup(encoder, ATOM_DISABLE, 0);
1455+ }
14271456 if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) {
14281457 if (ASIC_IS_DCE4(rdev))
14291458 atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_OFF, 0);
@@ -1740,13 +1769,34 @@ static int radeon_atom_pick_dig_encoder(struct drm_encoder *encoder) · 310 unmodified lines
17401769 struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc);
17411770 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
17421771 struct drm_encoder *test_encoder;
1743− struct radeon_encoder_atom_dig *dig;
1772+ struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
17441773 uint32_t dig_enc_in_use = 0;
17451774
1746− /* DCE4/5 */
1747− if (ASIC_IS_DCE4(rdev)) {
1748− dig = radeon_encoder->enc_priv;
1749− if (ASIC_IS_DCE41(rdev)) {
1775+ if (ASIC_IS_DCE6(rdev)) {
1776+ /* DCE6 */
1777+ switch (radeon_encoder->encoder_id) {
1778+ case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
1779+ if (dig->linkb)
1780+ return 1;
1781+ else
1782+ return 0;
1783+ break;
1784+ case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
1785+ if (dig->linkb)
1786+ return 3;
1787+ else
1788+ return 2;
1789+ break;
1790+ case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
1791+ if (dig->linkb)
1792+ return 5;
1793+ else
1794+ return 4;
1795+ break;
1796+ }
1797+ } else if (ASIC_IS_DCE4(rdev)) {
1798+ /* DCE4/5 */
1799+ if (ASIC_IS_DCE41(rdev) && !ASIC_IS_DCE61(rdev)) {
17501800 /* ontario follows DCE4 */
17511801 if (rdev->family == CHIP_PALM) {
17521802 if (dig->linkb)
@@ -1848,10 +1898,12 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder, · 95 unmodified lines
18481898 struct drm_device *dev = encoder->dev;
18491899 struct radeon_device *rdev = dev->dev_private;
18501900 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
1851− struct drm_encoder *ext_encoder = radeon_get_external_encoder(encoder);
18521901
18531902 radeon_encoder->pixel_clock = adjusted_mode->clock;
18541903
1904+ /* need to call this here rather than in prepare() since we need some crtc info */
1905+ radeon_atom_encoder_dpms(encoder, DRM_MODE_DPMS_OFF);
1906+
18551907 if (ASIC_IS_AVIVO(rdev) && !ASIC_IS_DCE4(rdev)) {
18561908 if (radeon_encoder->active_device & (ATOM_DEVICE_CV_SUPPORT | ATOM_DEVICE_TV_SUPPORT))
18571909 atombios_yuv_setup(encoder, true);
@@ -1870,38 +1922,7 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder, · 12 unmodified lines
18701922 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
18711923 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
18721924 case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA:
1873− if (ASIC_IS_DCE41(rdev) || ASIC_IS_DCE5(rdev)) {
1874− struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
1875− struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
1876−
1877− if (!connector)
1878− dig->panel_mode = DP_PANEL_MODE_EXTERNAL_DP_MODE;
1879− else
1880− dig->panel_mode = radeon_dp_get_panel_mode(encoder, connector);
1881−
1882− /* setup and enable the encoder */
1883− atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_SETUP, 0);
1884− atombios_dig_encoder_setup(encoder,
1885− ATOM_ENCODER_CMD_SETUP_PANEL_MODE,
1886− dig->panel_mode);
1887− } else if (ASIC_IS_DCE4(rdev)) {
1888− /* disable the transmitter */
1889− atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_DISABLE, 0, 0);
1890− /* setup and enable the encoder */
1891− atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_SETUP, 0);
1892−
1893− /* enable the transmitter */
1894− atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);
1895− } else {
1896− /* disable the encoder and transmitter */
1897− atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_DISABLE, 0, 0);
1898− atombios_dig_encoder_setup(encoder, ATOM_DISABLE, 0);
1899−
1900− /* setup and enable the encoder and transmitter */
1901− atombios_dig_encoder_setup(encoder, ATOM_ENABLE, 0);
1902− atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP, 0, 0);
1903− atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);
1904− }
1925+ /* handled in dpms */
19051926 break;
19061927 case ENCODER_OBJECT_ID_INTERNAL_DDI:
19071928 case ENCODER_OBJECT_ID_INTERNAL_DVO1:
@@ -1922,14 +1943,6 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder, · 14 unmodified lines
19221943 break;
19231944 }
19241945
1925− if (ext_encoder) {
1926− if (ASIC_IS_DCE41(rdev) || ASIC_IS_DCE61(rdev))
1927− atombios_external_encoder_setup(encoder, ext_encoder,
1928− EXTERNAL_ENCODER_ACTION_V3_ENCODER_SETUP);
1929− else
1930− atombios_external_encoder_setup(encoder, ext_encoder, ATOM_ENABLE);
1931− }
1932−
19331946 atombios_apply_encoder_quirks(encoder, adjusted_mode);
19341947
19351948 if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_HDMI) {
@@ -2116,7 +2129,6 @@ static void radeon_atom_encoder_prepare(struct drm_encoder *encoder) · 180 unmodified lines
21162129 }
21172130
21182131 radeon_atom_output_lock(encoder, true);
2119− radeon_atom_encoder_dpms(encoder, DRM_MODE_DPMS_OFF);
21202132
21212133 if (connector) {
21222134 struct radeon_connector *radeon_connector = to_radeon_connector(connector);
@@ -2137,6 +2149,7 @@ static void radeon_atom_encoder_prepare(struct drm_encoder *encoder) · 14 unmodified lines
21372149
21382150 static void radeon_atom_encoder_commit(struct drm_encoder *encoder)
21392151 {
2152+ /* need to call this here as we need the crtc set up */
21402153 radeon_atom_encoder_dpms(encoder, DRM_MODE_DPMS_ON);
21412154 radeon_atom_output_lock(encoder, false);
21422155 }
@@ -2177,14 +2190,7 @@ static void radeon_atom_encoder_disable(struct drm_encoder *encoder) · 34 unmodified lines
21772190 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
21782191 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
21792192 case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA:
2180− if (ASIC_IS_DCE4(rdev))
2181− /* disable the transmitter */
2182− atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_DISABLE, 0, 0);
2183− else {
2184− /* disable the encoder and transmitter */
2185− atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_DISABLE, 0, 0);
2186− atombios_dig_encoder_setup(encoder, ATOM_DISABLE, 0);
2187− }
2193+ /* handled in dpms */
21882194 break;
21892195 case ENCODER_OBJECT_ID_INTERNAL_DDI:
21902196 case ENCODER_OBJECT_ID_INTERNAL_DVO1:
drivers/gpu/drm/radeon/r600_cs.c+26−4
@@ -63,6 +63,7 @@ struct r600_cs_track { · 62 unmodified lines
6363 u32 cb_color_size_idx[8]; /* unused */
6464 u32 cb_target_mask;
6565 u32 cb_shader_mask; /* unused */
66+ bool is_resolve;
6667 u32 cb_color_size[8];
6768 u32 vgt_strmout_en;
6869 u32 vgt_strmout_buffer_en;
@@ -315,7 +316,15 @@ static void r600_cs_track_init(struct r600_cs_track *track) · 246 unmodified lines
315316 track->cb_color_bo[i] = NULL;
316317 track->cb_color_bo_offset[i] = 0xFFFFFFFF;
317318 track->cb_color_bo_mc[i] = 0xFFFFFFFF;
318− }
319+ track->cb_color_frag_bo[i] = NULL;
320+ track->cb_color_frag_offset[i] = 0xFFFFFFFF;
321+ track->cb_color_tile_bo[i] = NULL;
322+ track->cb_color_tile_offset[i] = 0xFFFFFFFF;
323+ track->cb_color_mask[i] = 0xFFFFFFFF;
324+ }
325+ track->is_resolve = false;
326+ track->nsamples = 16;
327+ track->log_nsamples = 4;
319328 track->cb_target_mask = 0xFFFFFFFF;
320329 track->cb_shader_mask = 0xFFFFFFFF;
321330 track->cb_dirty = true;
@@ -352,6 +361,8 @@ static int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i) · 30 unmodified lines
352361 volatile u32 *ib = p->ib.ptr;
353362 unsigned array_mode;
354363 u32 format;
364+ /* When resolve is used, the second colorbuffer has always 1 sample. */
365+ unsigned nsamples = track->is_resolve && i == 1 ? 1 : track->nsamples;
355366
356367 size = radeon_bo_size(track->cb_color_bo[i]) - track->cb_color_bo_offset[i];
357368 format = G_0280A0_FORMAT(track->cb_color_info[i]);
@@ -375,7 +386,7 @@ static int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i) · 17 unmodified lines
375386 array_check.group_size = track->group_size;
376387 array_check.nbanks = track->nbanks;
377388 array_check.npipes = track->npipes;
378− array_check.nsamples = track->nsamples;
389+ array_check.nsamples = nsamples;
379390 array_check.blocksize = r600_fmt_get_blocksize(format);
380391 if (r600_get_array_mode_alignment(&array_check,
381392 &pitch_align, &height_align, &depth_align, &base_align)) {
@@ -421,7 +432,7 @@ static int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i) · 39 unmodified lines
421432
422433 /* check offset */
423434 tmp = r600_fmt_get_nblocksy(format, height) * r600_fmt_get_nblocksx(format, pitch) *
424− r600_fmt_get_blocksize(format) * track->nsamples;
435+ r600_fmt_get_blocksize(format) * nsamples;
425436 switch (array_mode) {
426437 default:
427438 case V_0280A0_ARRAY_LINEAR_GENERAL:
@@ -792,6 +803,12 @@ static int r600_cs_track_check(struct radeon_cs_parser *p) · 364 unmodified lines
792803 */
793804 if (track->cb_dirty) {
794805 tmp = track->cb_target_mask;
806+
807+ /* We must check both colorbuffers for RESOLVE. */
808+ if (track->is_resolve) {
809+ tmp |= 0xff;
810+ }
811+
795812 for (i = 0; i < 8; i++) {
796813 if ((tmp >> (i * 4)) & 0xF) {
797814 /* at least one component is enabled */
@@ -1281,6 +1298,11 @@ static int r600_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx) · 483 unmodified lines
12811298 track->nsamples = 1 << tmp;
12821299 track->cb_dirty = true;
12831300 break;
1301+ case R_028808_CB_COLOR_CONTROL:
1302+ tmp = G_028808_SPECIAL_OP(radeon_get_ib_value(p, idx));
1303+ track->is_resolve = tmp == V_028808_SPECIAL_RESOLVE_BOX;
1304+ track->cb_dirty = true;
1305+ break;
12841306 case R_0280A0_CB_COLOR0_INFO:
12851307 case R_0280A4_CB_COLOR1_INFO:
12861308 case R_0280A8_CB_COLOR2_INFO:
@@ -1416,7 +1438,7 @@ static int r600_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx) · 129 unmodified lines
14161438 case R_028118_CB_COLOR6_MASK:
14171439 case R_02811C_CB_COLOR7_MASK:
14181440 tmp = (reg - R_028100_CB_COLOR0_MASK) / 4;
1419− track->cb_color_mask[tmp] = ib[idx];
1441+ track->cb_color_mask[tmp] = radeon_get_ib_value(p, idx);
14201442 if (G_0280A0_TILE_MODE(track->cb_color_info[tmp])) {
14211443 track->cb_dirty = true;
14221444 }
drivers/gpu/drm/radeon/r600d.h+8−0
@@ -66,6 +66,14 @@ · 65 unmodified lines
6666 #define CC_RB_BACKEND_DISABLE 0x98F4
6767 #define BACKEND_DISABLE(x) ((x) << 16)
6868
69+#define R_028808_CB_COLOR_CONTROL 0x28808
70+#define S_028808_SPECIAL_OP(x) (((x) & 0x7) << 4)
71+#define G_028808_SPECIAL_OP(x) (((x) >> 4) & 0x7)
72+#define C_028808_SPECIAL_OP 0xFFFFFF8F
73+#define V_028808_SPECIAL_NORMAL 0x00
74+#define V_028808_SPECIAL_DISABLE 0x01
75+#define V_028808_SPECIAL_RESOLVE_BOX 0x07
76+
6977 #define CB_COLOR0_BASE 0x28040
7078 #define CB_COLOR1_BASE 0x28044
7179 #define CB_COLOR2_BASE 0x28048
drivers/gpu/drm/radeon/radeon_device.c+4−1
@@ -1051,7 +1051,7 @@ int radeon_device_init(struct radeon_device *rdev, · 1050 unmodified lines
10511051 if (rdev->flags & RADEON_IS_AGP)
10521052 rdev->need_dma32 = true;
10531053 if ((rdev->flags & RADEON_IS_PCI) &&
1054− (rdev->family < CHIP_RS400))
1054+ (rdev->family <= CHIP_RS740))
10551055 rdev->need_dma32 = true;
10561056
10571057 dma_bits = rdev->need_dma32 ? 32 : 40;
@@ -1346,12 +1346,15 @@ retry: · 288 unmodified lines
13461346 for (i = 0; i < RADEON_NUM_RINGS; ++i) {
13471347 radeon_ring_restore(rdev, &rdev->ring[i],
13481348 ring_sizes[i], ring_data[i]);
1349+ ring_sizes[i] = 0;
1350+ ring_data[i] = NULL;
13491351 }
13501352
13511353 r = radeon_ib_ring_tests(rdev);
13521354 if (r) {
13531355 dev_err(rdev->dev, "ib ring test failed (%d).\n", r);
13541356 if (saved) {
1357+ saved = false;
13551358 radeon_suspend(rdev);
13561359 goto retry;
13571360 }
drivers/gpu/drm/radeon/radeon_drv.c+2−1
@@ -63,9 +63,10 @@ · 62 unmodified lines
6363 * 2.19.0 - r600-eg: MSAA textures
6464 * 2.20.0 - r600-si: RADEON_INFO_TIMESTAMP query
6565 * 2.21.0 - r600-r700: FMASK and CMASK
66+ * 2.22.0 - r600 only: RESOLVE_BOX allowed
6667 */
6768 #define KMS_DRIVER_MAJOR 2
68−#define KMS_DRIVER_MINOR 21
69+#define KMS_DRIVER_MINOR 22
6970 #define KMS_DRIVER_PATCHLEVEL 0
7071 int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
7172 int radeon_driver_unload_kms(struct drm_device *dev);
drivers/gpu/drm/radeon/reg_srcs/r600+0−1
@@ -744,7 +744,6 @@ r600 0x9400 · 743 unmodified lines
744744 0x00028C38 CB_CLRCMP_DST
745745 0x00028C3C CB_CLRCMP_MSK
746746 0x00028C34 CB_CLRCMP_SRC
747−0x00028808 CB_COLOR_CONTROL
748747 0x0002842C CB_FOG_BLUE
749748 0x00028428 CB_FOG_GREEN
750749 0x00028424 CB_FOG_RED
drivers/hid/hid-core.c+5−3
@@ -996,7 +996,8 @@ static void hid_process_event(struct hid_device *hid, struct hid_field *field, · 995 unmodified lines
996996 struct hid_driver *hdrv = hid->driver;
997997 int ret;
998998
999− hid_dump_input(hid, usage, value);
999+ if (!list_empty(&hid->debug_list))
1000+ hid_dump_input(hid, usage, value);
10001001
10011002 if (hdrv && hdrv->event && hid_match_usage(hid, usage)) {
10021003 ret = hdrv->event(hid, field, usage, value);
@@ -1558,7 +1559,9 @@ static const struct hid_device_id hid_have_special_driver[] = { · 555 unmodified lines
15581559 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X) },
15591560 { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) },
15601561 { HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) },
1561− { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_TPKBD) },
1562+#if IS_ENABLED(CONFIG_HID_LENOVO_TPKBD)
1563+ { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_TPKBD) },
1564+#endif
15621565 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) },
15631566 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER) },
15641567 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER_2) },
@@ -1624,7 +1627,6 @@ static const struct hid_device_id hid_have_special_driver[] = { · 59 unmodified lines
16241627 { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },
16251628 { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) },
16261629 { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
1627− { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_PIXART_IMAGING_INC_OPTICAL_TOUCH_SCREEN) },
16281630 { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONE) },
16291631 { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ARVO) },
16301632 { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ISKU) },
drivers/hid/hid-logitech-dj.c+2−2
@@ -439,7 +439,7 @@ static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) · 438 unmodified lines
439439 struct dj_report *dj_report;
440440 int retval;
441441
442− dj_report = kzalloc(sizeof(dj_report), GFP_KERNEL);
442+ dj_report = kzalloc(sizeof(struct dj_report), GFP_KERNEL);
443443 if (!dj_report)
444444 return -ENOMEM;
445445 dj_report->report_id = REPORT_ID_DJ_SHORT;
@@ -456,7 +456,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, · 10 unmodified lines
456456 struct dj_report *dj_report;
457457 int retval;
458458
459− dj_report = kzalloc(sizeof(dj_report), GFP_KERNEL);
459+ dj_report = kzalloc(sizeof(struct dj_report), GFP_KERNEL);
460460 if (!dj_report)
461461 return -ENOMEM;
462462 dj_report->report_id = REPORT_ID_DJ_SHORT;
drivers/hid/usbhid/hid-quirks.c+1−0
@@ -70,6 +70,7 @@ static const struct hid_blacklist { · 69 unmodified lines
7070 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET },
7171 { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET },
7272 { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
73+ { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET },
7374 { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS },
7475 { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1, HID_QUIRK_NO_INIT_REPORTS },
7576 { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN2, HID_QUIRK_NO_INIT_REPORTS },
drivers/hwmon/asus_atk0110.c+6−0
@@ -34,6 +34,12 @@ static const struct dmi_system_id __initconst atk_force_new_if[] = { · 33 unmodified lines
3434 .matches = {
3535 DMI_MATCH(DMI_BOARD_NAME, "SABERTOOTH X58")
3636 }
37+ }, {
38+ /* Old interface reads the same sensor for fan0 and fan1 */
39+ .ident = "Asus M5A78L",
40+ .matches = {
41+ DMI_MATCH(DMI_BOARD_NAME, "M5A78L")
42+ }
3743 },
3844 { }
3945 };
drivers/ide/ide-pm.c+2−2
@@ -4,7 +4,7 @@ · 3 unmodified lines
44
55 int generic_ide_suspend(struct device *dev, pm_message_t mesg)
66 {
7− ide_drive_t *drive = dev_get_drvdata(dev);
7+ ide_drive_t *drive = to_ide_device(dev);
88 ide_drive_t *pair = ide_get_pair_dev(drive);
99 ide_hwif_t *hwif = drive->hwif;
1010 struct request *rq;
@@ -40,7 +40,7 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg) · 29 unmodified lines
4040
4141 int generic_ide_resume(struct device *dev)
4242 {
43− ide_drive_t *drive = dev_get_drvdata(dev);
43+ ide_drive_t *drive = to_ide_device(dev);
4444 ide_drive_t *pair = ide_get_pair_dev(drive);
4545 ide_hwif_t *hwif = drive->hwif;
4646 struct request *rq;
drivers/input/keyboard/imx_keypad.c+3−0
@@ -358,6 +358,7 @@ static void imx_keypad_inhibit(struct imx_keypad *keypad) · 357 unmodified lines
358358 /* Inhibit KDI and KRI interrupts. */
359359 reg_val = readw(keypad->mmio_base + KPSR);
360360 reg_val &= ~(KBD_STAT_KRIE | KBD_STAT_KDIE);
361+ reg_val |= KBD_STAT_KPKR | KBD_STAT_KPKD;
361362 writew(reg_val, keypad->mmio_base + KPSR);
362363
363364 /* Colums as open drain and disable all rows */
@@ -515,7 +516,9 @@ static int __devinit imx_keypad_probe(struct platform_device *pdev) · 151 unmodified lines
515516 input_set_drvdata(input_dev, keypad);
516517
517518 /* Ensure that the keypad will stay dormant until opened */
519+ clk_enable(keypad->clk);
518520 imx_keypad_inhibit(keypad);
521+ clk_disable(keypad->clk);
519522
520523 error = request_irq(irq, imx_keypad_irq_handler, 0,
521524 pdev->name, keypad);
drivers/input/serio/i8042-x86ia64io.h+14−0
@@ -176,6 +176,20 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = { · 175 unmodified lines
176176 DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"),
177177 },
178178 },
179+ {
180+ /* Gigabyte T1005 - defines wrong chassis type ("Other") */
181+ .matches = {
182+ DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
183+ DMI_MATCH(DMI_PRODUCT_NAME, "T1005"),
184+ },
185+ },
186+ {
187+ /* Gigabyte T1005M/P - defines wrong chassis type ("Other") */
188+ .matches = {
189+ DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
190+ DMI_MATCH(DMI_PRODUCT_NAME, "T1005M/P"),
191+ },
192+ },
179193 {
180194 .matches = {
181195 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
drivers/input/tablet/wacom_wac.c+5−1
@@ -1848,7 +1848,10 @@ static const struct wacom_features wacom_features_0x2A = · 1847 unmodified lines
18481848 { "Wacom Intuos5 M", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047,
18491849 63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
18501850 static const struct wacom_features wacom_features_0xF4 =
1851− { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047,
1851+ { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047,
1852+ 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1853+static const struct wacom_features wacom_features_0xF8 =
1854+ { "Wacom Cintiq 24HD touch", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047,
18521855 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
18531856 static const struct wacom_features wacom_features_0x3F =
18541857 { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023,
@@ -2091,6 +2094,7 @@ const struct usb_device_id wacom_ids[] = { · 236 unmodified lines
20912094 { USB_DEVICE_WACOM(0xEF) },
20922095 { USB_DEVICE_WACOM(0x47) },
20932096 { USB_DEVICE_WACOM(0xF4) },
2097+ { USB_DEVICE_WACOM(0xF8) },
20942098 { USB_DEVICE_WACOM(0xFA) },
20952099 { USB_DEVICE_LENOVO(0x6004) },
20962100 { }
drivers/input/touchscreen/edt-ft5x06.c+1−1
@@ -602,6 +602,7 @@ edt_ft5x06_ts_teardown_debugfs(struct edt_ft5x06_ts_data *tsdata) · 601 unmodified lines
602602 {
603603 if (tsdata->debug_dir)
604604 debugfs_remove_recursive(tsdata->debug_dir);
605+ kfree(tsdata->raw_buffer);
605606 }
606607
607608 #else
@@ -843,7 +844,6 @@ static int __devexit edt_ft5x06_ts_remove(struct i2c_client *client) · 235 unmodified lines
843844 if (gpio_is_valid(pdata->reset_pin))
844845 gpio_free(pdata->reset_pin);
845846
846− kfree(tsdata->raw_buffer);
847847 kfree(tsdata);
848848
849849 return 0;
drivers/mmc/card/block.c+25−1
@@ -1411,7 +1411,8 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) · 1410 unmodified lines
14111411 /* complete ongoing async transfer before issuing discard */
14121412 if (card->host->areq)
14131413 mmc_blk_issue_rw_rq(mq, NULL);
1414− if (req->cmd_flags & REQ_SECURE)
1414+ if (req->cmd_flags & REQ_SECURE &&
1415+ !(card->quirks & MMC_QUIRK_SEC_ERASE_TRIM_BROKEN))
14151416 ret = mmc_blk_issue_secdiscard_rq(mq, req);
14161417 else
14171418 ret = mmc_blk_issue_discard_rq(mq, req);
@@ -1716,6 +1717,7 @@ force_ro_fail: · 298 unmodified lines
17161717 #define CID_MANFID_SANDISK 0x2
17171718 #define CID_MANFID_TOSHIBA 0x11
17181719 #define CID_MANFID_MICRON 0x13
1720+#define CID_MANFID_SAMSUNG 0x15
17191721
17201722 static const struct mmc_fixup blk_fixups[] =
17211723 {
@@ -1752,6 +1754,28 @@ static const struct mmc_fixup blk_fixups[] = · 30 unmodified lines
17521754 MMC_FIXUP(CID_NAME_ANY, CID_MANFID_MICRON, 0x200, add_quirk_mmc,
17531755 MMC_QUIRK_LONG_READ_TIME),
17541756
1757+ /*
1758+ * On these Samsung MoviNAND parts, performing secure erase or
1759+ * secure trim can result in unrecoverable corruption due to a
1760+ * firmware bug.
1761+ */
1762+ MMC_FIXUP("M8G2FA", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
1763+ MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
1764+ MMC_FIXUP("MAG4FA", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
1765+ MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
1766+ MMC_FIXUP("MBG8FA", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
1767+ MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
1768+ MMC_FIXUP("MCGAFA", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
1769+ MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
1770+ MMC_FIXUP("VAL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
1771+ MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
1772+ MMC_FIXUP("VYL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
1773+ MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
1774+ MMC_FIXUP("KYL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
1775+ MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
1776+ MMC_FIXUP("VZL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
1777+ MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
1778+
17551779 END_FIXUP
17561780 };
17571781
drivers/mmc/host/atmel-mci.c+5−1
@@ -81,6 +81,7 @@ struct atmel_mci_caps { · 80 unmodified lines
8181 bool has_bad_data_ordering;
8282 bool need_reset_after_xfer;
8383 bool need_blksz_mul_4;
84+ bool need_notbusy_for_read_ops;
8485 };
8586
8687 struct atmel_mci_dma {
@@ -1625,7 +1626,8 @@ static void atmci_tasklet_func(unsigned long priv) · 1538 unmodified lines
16251626 __func__);
16261627 atmci_set_completed(host, EVENT_XFER_COMPLETE);
16271628
1628− if (host->data->flags & MMC_DATA_WRITE) {
1629+ if (host->caps.need_notbusy_for_read_ops ||
1630+ (host->data->flags & MMC_DATA_WRITE)) {
16291631 atmci_writel(host, ATMCI_IER, ATMCI_NOTBUSY);
16301632 state = STATE_WAITING_NOTBUSY;
16311633 } else if (host->mrq->stop) {
@@ -2218,6 +2220,7 @@ static void __init atmci_get_cap(struct atmel_mci *host) · 586 unmodified lines
22182220 host->caps.has_bad_data_ordering = 1;
22192221 host->caps.need_reset_after_xfer = 1;
22202222 host->caps.need_blksz_mul_4 = 1;
2223+ host->caps.need_notbusy_for_read_ops = 0;
22212224
22222225 /* keep only major version number */
22232226 switch (version & 0xf00) {
@@ -2238,6 +2241,7 @@ static void __init atmci_get_cap(struct atmel_mci *host) · 14 unmodified lines
22382241 case 0x200:
22392242 host->caps.has_rwproof = 1;
22402243 host->caps.need_blksz_mul_4 = 0;
2244+ host->caps.need_notbusy_for_read_ops = 1;
22412245 case 0x100:
22422246 host->caps.has_bad_data_ordering = 0;
22432247 host->caps.need_reset_after_xfer = 0;
drivers/mmc/host/bfin_sdh.c+0−7
@@ -49,13 +49,6 @@ · 48 unmodified lines
4949 #define bfin_write_SDH_CFG bfin_write_RSI_CFG
5050 #endif
5151
52−struct dma_desc_array {
53− unsigned long start_addr;
54− unsigned short cfg;
55− unsigned short x_count;
56− short x_modify;
57−} __packed;
58−
5952 struct sdh_host {
6053 struct mmc_host *mmc;
6154 spinlock_t lock;
drivers/mmc/host/dw_mmc.c+46−39
@@ -627,6 +627,7 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot) · 626 unmodified lines
627627 {
628628 struct dw_mci *host = slot->host;
629629 u32 div;
630+ u32 clk_en_a;
630631
631632 if (slot->clock != host->current_speed) {
632633 div = host->bus_hz / slot->clock;
@@ -659,9 +660,11 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot) · 26 unmodified lines
659660 mci_send_cmd(slot,
660661 SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
661662
662− /* enable clock */
663− mci_writel(host, CLKENA, ((SDMMC_CLKEN_ENABLE |
664− SDMMC_CLKEN_LOW_PWR) << slot->id));
663+ /* enable clock; only low power if no SDIO */
664+ clk_en_a = SDMMC_CLKEN_ENABLE << slot->id;
665+ if (!(mci_readl(host, INTMASK) & SDMMC_INT_SDIO(slot->id)))
666+ clk_en_a |= SDMMC_CLKEN_LOW_PWR << slot->id;
667+ mci_writel(host, CLKENA, clk_en_a);
665668
666669 /* inform CIU */
667670 mci_send_cmd(slot,
@@ -862,6 +865,30 @@ static int dw_mci_get_cd(struct mmc_host *mmc) · 194 unmodified lines
862865 return present;
863866 }
864867
868+/*
869+ * Disable lower power mode.
870+ *
871+ * Low power mode will stop the card clock when idle. According to the
872+ * description of the CLKENA register we should disable low power mode
873+ * for SDIO cards if we need SDIO interrupts to work.
874+ *
875+ * This function is fast if low power mode is already disabled.
876+ */
877+static void dw_mci_disable_low_power(struct dw_mci_slot *slot)
878+{
879+ struct dw_mci *host = slot->host;
880+ u32 clk_en_a;
881+ const u32 clken_low_pwr = SDMMC_CLKEN_LOW_PWR << slot->id;
882+
883+ clk_en_a = mci_readl(host, CLKENA);
884+
885+ if (clk_en_a & clken_low_pwr) {
886+ mci_writel(host, CLKENA, clk_en_a & ~clken_low_pwr);
887+ mci_send_cmd(slot, SDMMC_CMD_UPD_CLK |
888+ SDMMC_CMD_PRV_DAT_WAIT, 0);
889+ }
890+}
891+
865892 static void dw_mci_enable_sdio_irq(struct mmc_host *mmc, int enb)
866893 {
867894 struct dw_mci_slot *slot = mmc_priv(mmc);
@@ -871,6 +898,14 @@ static void dw_mci_enable_sdio_irq(struct mmc_host *mmc, int enb) · 3 unmodified lines
871898 /* Enable/disable Slot Specific SDIO interrupt */
872899 int_mask = mci_readl(host, INTMASK);
873900 if (enb) {
901+ /*
902+ * Turn off low power mode if it was enabled. This is a bit of
903+ * a heavy operation and we disable / enable IRQs a lot, so
904+ * we'll leave low power mode disabled and it will get
905+ * re-enabled again in dw_mci_setup_bus().
906+ */
907+ dw_mci_disable_low_power(slot);
908+
874909 mci_writel(host, INTMASK,
875910 (int_mask | SDMMC_INT_SDIO(slot->id)));
876911 } else {
@@ -1429,22 +1464,10 @@ static void dw_mci_read_data_pio(struct dw_mci *host) · 552 unmodified lines
14291464 nbytes += len;
14301465 remain -= len;
14311466 } while (remain);
1432− sg_miter->consumed = offset;
14331467
1468+ sg_miter->consumed = offset;
14341469 status = mci_readl(host, MINTSTS);
14351470 mci_writel(host, RINTSTS, SDMMC_INT_RXDR);
1436− if (status & DW_MCI_DATA_ERROR_FLAGS) {
1437− host->data_status = status;
1438− data->bytes_xfered += nbytes;
1439− sg_miter_stop(sg_miter);
1440− host->sg = NULL;
1441− smp_wmb();
1442−
1443− set_bit(EVENT_DATA_ERROR, &host->pending_events);
1444−
1445− tasklet_schedule(&host->tasklet);
1446− return;
1447− }
14481471 } while (status & SDMMC_INT_RXDR); /*if the RXDR is ready read again*/
14491472 data->bytes_xfered += nbytes;
14501473
@@ -1497,23 +1520,10 @@ static void dw_mci_write_data_pio(struct dw_mci *host) · 46 unmodified lines
14971520 nbytes += len;
14981521 remain -= len;
14991522 } while (remain);
1500− sg_miter->consumed = offset;
15011523
1524+ sg_miter->consumed = offset;
15021525 status = mci_readl(host, MINTSTS);
15031526 mci_writel(host, RINTSTS, SDMMC_INT_TXDR);
1504− if (status & DW_MCI_DATA_ERROR_FLAGS) {
1505− host->data_status = status;
1506− data->bytes_xfered += nbytes;
1507− sg_miter_stop(sg_miter);
1508− host->sg = NULL;
1509−
1510− smp_wmb();
1511−
1512− set_bit(EVENT_DATA_ERROR, &host->pending_events);
1513−
1514− tasklet_schedule(&host->tasklet);
1515− return;
1516− }
15171527 } while (status & SDMMC_INT_TXDR); /* if TXDR write again */
15181528 data->bytes_xfered += nbytes;
15191529
@@ -1547,12 +1557,11 @@ static void dw_mci_cmd_interrupt(struct dw_mci *host, u32 status) · 27 unmodified lines
15471557 static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
15481558 {
15491559 struct dw_mci *host = dev_id;
1550− u32 status, pending;
1560+ u32 pending;
15511561 unsigned int pass_count = 0;
15521562 int i;
15531563
15541564 do {
1555− status = mci_readl(host, RINTSTS);
15561565 pending = mci_readl(host, MINTSTS); /* read-only mask reg */
15571566
15581567 /*
@@ -1570,7 +1579,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) · 11 unmodified lines
15701579
15711580 if (pending & DW_MCI_CMD_ERROR_FLAGS) {
15721581 mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS);
1573− host->cmd_status = status;
1582+ host->cmd_status = pending;
15741583 smp_wmb();
15751584 set_bit(EVENT_CMD_COMPLETE, &host->pending_events);
15761585 }
@@ -1578,18 +1587,16 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) · 1 unmodified line
15781587 if (pending & DW_MCI_DATA_ERROR_FLAGS) {
15791588 /* if there is an error report DATA_ERROR */
15801589 mci_writel(host, RINTSTS, DW_MCI_DATA_ERROR_FLAGS);
1581− host->data_status = status;
1590+ host->data_status = pending;
15821591 smp_wmb();
15831592 set_bit(EVENT_DATA_ERROR, &host->pending_events);
1584− if (!(pending & (SDMMC_INT_DTO | SDMMC_INT_DCRC |
1585− SDMMC_INT_SBE | SDMMC_INT_EBE)))
1586− tasklet_schedule(&host->tasklet);
1593+ tasklet_schedule(&host->tasklet);
15871594 }
15881595
15891596 if (pending & SDMMC_INT_DATA_OVER) {
15901597 mci_writel(host, RINTSTS, SDMMC_INT_DATA_OVER);
15911598 if (!host->data_status)
1592− host->data_status = status;
1599+ host->data_status = pending;
15931600 smp_wmb();
15941601 if (host->dir_status == DW_MCI_RECV_STATUS) {
15951602 if (host->sg != NULL)
@@ -1613,7 +1620,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) · 17 unmodified lines
16131620
16141621 if (pending & SDMMC_INT_CMD_DONE) {
16151622 mci_writel(host, RINTSTS, SDMMC_INT_CMD_DONE);
1616− dw_mci_cmd_interrupt(host, status);
1623+ dw_mci_cmd_interrupt(host, pending);
16171624 }
16181625
16191626 if (pending & SDMMC_INT_CD) {
drivers/mmc/host/mxs-mmc.c+7−7
@@ -285,11 +285,11 @@ static irqreturn_t mxs_mmc_irq_handler(int irq, void *dev_id) · 284 unmodified lines
285285 writel(stat & MXS_MMC_IRQ_BITS,
286286 host->base + HW_SSP_CTRL1(host) + STMP_OFFSET_REG_CLR);
287287
288+ spin_unlock(&host->lock);
289+
288290 if ((stat & BM_SSP_CTRL1_SDIO_IRQ) && (stat & BM_SSP_CTRL1_SDIO_IRQ_EN))
289291 mmc_signal_sdio_irq(host->mmc);
290292
291− spin_unlock(&host->lock);
292−
293293 if (stat & BM_SSP_CTRL1_RESP_TIMEOUT_IRQ)
294294 cmd->error = -ETIMEDOUT;
295295 else if (stat & BM_SSP_CTRL1_RESP_ERR_IRQ)
@@ -644,11 +644,6 @@ static void mxs_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable) · 348 unmodified lines
644644 host->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_SET);
645645 writel(BM_SSP_CTRL1_SDIO_IRQ_EN,
646646 host->base + HW_SSP_CTRL1(host) + STMP_OFFSET_REG_SET);
647−
648− if (readl(host->base + HW_SSP_STATUS(host)) &
649− BM_SSP_STATUS_SDIO_IRQ)
650− mmc_signal_sdio_irq(host->mmc);
651−
652647 } else {
653648 writel(BM_SSP_CTRL0_SDIO_IRQ_CHECK,
654649 host->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_CLR);
@@ -657,6 +652,11 @@ static void mxs_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable) · 2 unmodified lines
657652 }
658653
659654 spin_unlock_irqrestore(&host->lock, flags);
655+
656+ if (enable && readl(host->base + HW_SSP_STATUS(host)) &
657+ BM_SSP_STATUS_SDIO_IRQ)
658+ mmc_signal_sdio_irq(host->mmc);
659+
660660 }
661661
662662 static const struct mmc_host_ops mxs_mmc_ops = {
drivers/mmc/host/omap.c+11−4
@@ -33,7 +33,6 @@ · 32 unmodified lines
3333 #include <asm/io.h>
3434 #include <asm/irq.h>
3535
36−#include <plat/board.h>
3736 #include <plat/mmc.h>
3837 #include <asm/gpio.h>
3938 #include <plat/dma.h>
@@ -668,7 +667,7 @@ mmc_omap_clk_timer(unsigned long data) · 628 unmodified lines
668667 static void
669668 mmc_omap_xfer_data(struct mmc_omap_host *host, int write)
670669 {
671− int n;
670+ int n, nwords;
672671
673672 if (host->buffer_bytes_left == 0) {
674673 host->sg_idx++;
@@ -678,15 +677,23 @@ mmc_omap_xfer_data(struct mmc_omap_host *host, int write) · 3 unmodified lines
678677 n = 64;
679678 if (n > host->buffer_bytes_left)
680679 n = host->buffer_bytes_left;
680+
681+ nwords = n / 2;
682+ nwords += n & 1; /* handle odd number of bytes to transfer */
683+
681684 host->buffer_bytes_left -= n;
682685 host->total_bytes_left -= n;
683686 host->data->bytes_xfered += n;
684687
685688 if (write) {
686− __raw_writesw(host->virt_base + OMAP_MMC_REG(host, DATA), host->buffer, n);
689+ __raw_writesw(host->virt_base + OMAP_MMC_REG(host, DATA),
690+ host->buffer, nwords);
687691 } else {
688− __raw_readsw(host->virt_base + OMAP_MMC_REG(host, DATA), host->buffer, n);
692+ __raw_readsw(host->virt_base + OMAP_MMC_REG(host, DATA),
693+ host->buffer, nwords);
689694 }
695+
696+ host->buffer += nwords;
690697 }
691698
692699 static inline void mmc_omap_report_irq(u16 status)
drivers/mmc/host/omap_hsmmc.c+0−1
@@ -40,7 +40,6 @@ · 39 unmodified lines
4040 #include <linux/regulator/consumer.h>
4141 #include <linux/pm_runtime.h>
4242 #include <mach/hardware.h>
43−#include <plat/board.h>
4443 #include <plat/mmc.h>
4544 #include <plat/cpu.h>
4645
drivers/mmc/host/sdhci-esdhc.h+3−3
@@ -48,14 +48,14 @@ static inline void esdhc_set_clock(struct sdhci_host *host, unsigned int clock) · 47 unmodified lines
4848 int div = 1;
4949 u32 temp;
5050
51+ if (clock == 0)
52+ goto out;
53+
5154 temp = sdhci_readl(host, ESDHC_SYSTEM_CONTROL);
5255 temp &= ~(ESDHC_CLOCK_IPGEN | ESDHC_CLOCK_HCKEN | ESDHC_CLOCK_PEREN
5356 | ESDHC_CLOCK_MASK);
5457 sdhci_writel(host, temp, ESDHC_SYSTEM_CONTROL);
5558
56− if (clock == 0)
57− goto out;
58−
5959 while (host->max_clk / pre_div / 16 > clock && pre_div < 256)
6060 pre_div *= 2;
6161
drivers/mtd/nand/omap2.c+225−76
@@ -101,6 +101,16 @@ · 100 unmodified lines
101101 #define P4e_s(a) (TF(a & NAND_Ecc_P4e) << 0)
102102 #define P4o_s(a) (TF(a & NAND_Ecc_P4o) << 1)
103103
104+#define PREFETCH_CONFIG1_CS_SHIFT 24
105+#define ECC_CONFIG_CS_SHIFT 1
106+#define CS_MASK 0x7
107+#define ENABLE_PREFETCH (0x1 << 7)
108+#define DMA_MPU_MODE_SHIFT 2
109+#define ECCSIZE1_SHIFT 22
110+#define ECC1RESULTSIZE 0x1
111+#define ECCCLEAR 0x100
112+#define ECC1 0x1
113+
104114 /* oob info generated runtime depending on ecc algorithm and layout selected */
105115 static struct nand_ecclayout omap_oobinfo;
106116 /* Define some generic bad / good block scan pattern which are used
@@ -124,15 +134,18 @@ struct omap_nand_info { · 17 unmodified lines
124134
125135 int gpmc_cs;
126136 unsigned long phys_base;
137+ unsigned long mem_size;
127138 struct completion comp;
128139 struct dma_chan *dma;
129− int gpmc_irq;
140+ int gpmc_irq_fifo;
141+ int gpmc_irq_count;
130142 enum {
131143 OMAP_NAND_IO_READ = 0, /* read */
132144 OMAP_NAND_IO_WRITE, /* write */
133145 } iomode;
134146 u_char *buf;
135147 int buf_len;
148+ struct gpmc_nand_regs reg;
136149
137150 #ifdef CONFIG_MTD_NAND_OMAP_BCH
138151 struct bch_control *bch;
@@ -140,6 +153,63 @@ struct omap_nand_info { · 1 unmodified line
140153 #endif
141154 };
142155
156+/**
157+ * omap_prefetch_enable - configures and starts prefetch transfer
158+ * @cs: cs (chip select) number
159+ * @fifo_th: fifo threshold to be used for read/ write
160+ * @dma_mode: dma mode enable (1) or disable (0)
161+ * @u32_count: number of bytes to be transferred
162+ * @is_write: prefetch read(0) or write post(1) mode
163+ */
164+static int omap_prefetch_enable(int cs, int fifo_th, int dma_mode,
165+ unsigned int u32_count, int is_write, struct omap_nand_info *info)
166+{
167+ u32 val;
168+
169+ if (fifo_th > PREFETCH_FIFOTHRESHOLD_MAX)
170+ return -1;
171+
172+ if (readl(info->reg.gpmc_prefetch_control))
173+ return -EBUSY;
174+
175+ /* Set the amount of bytes to be prefetched */
176+ writel(u32_count, info->reg.gpmc_prefetch_config2);
177+
178+ /* Set dma/mpu mode, the prefetch read / post write and
179+ * enable the engine. Set which cs is has requested for.
180+ */
181+ val = ((cs << PREFETCH_CONFIG1_CS_SHIFT) |
182+ PREFETCH_FIFOTHRESHOLD(fifo_th) | ENABLE_PREFETCH |
183+ (dma_mode << DMA_MPU_MODE_SHIFT) | (0x1 & is_write));
184+ writel(val, info->reg.gpmc_prefetch_config1);
185+
186+ /* Start the prefetch engine */
187+ writel(0x1, info->reg.gpmc_prefetch_control);
188+
189+ return 0;
190+}
191+
192+/**
193+ * omap_prefetch_reset - disables and stops the prefetch engine
194+ */
195+static int omap_prefetch_reset(int cs, struct omap_nand_info *info)
196+{
197+ u32 config1;
198+
199+ /* check if the same module/cs is trying to reset */
200+ config1 = readl(info->reg.gpmc_prefetch_config1);
201+ if (((config1 >> PREFETCH_CONFIG1_CS_SHIFT) & CS_MASK) != cs)
202+ return -EINVAL;
203+
204+ /* Stop the PFPW engine */
205+ writel(0x0, info->reg.gpmc_prefetch_control);
206+
207+ /* Reset/disable the PFPW engine */
208+ writel(0x0, info->reg.gpmc_prefetch_config1);
209+
210+ return 0;
211+}
212+
143213 /**
144214 * omap_hwcontrol - hardware specific access to control-lines
145215 * @mtd: MTD device structure
@@ -158,13 +228,13 @@ static void omap_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) · 12 unmodified lines
158228
159229 if (cmd != NAND_CMD_NONE) {
160230 if (ctrl & NAND_CLE)
161− gpmc_nand_write(info->gpmc_cs, GPMC_NAND_COMMAND, cmd);
231+ writeb(cmd, info->reg.gpmc_nand_command);
162232
163233 else if (ctrl & NAND_ALE)
164− gpmc_nand_write(info->gpmc_cs, GPMC_NAND_ADDRESS, cmd);
234+ writeb(cmd, info->reg.gpmc_nand_address);
165235
166236 else /* NAND_NCE */
167− gpmc_nand_write(info->gpmc_cs, GPMC_NAND_DATA, cmd);
237+ writeb(cmd, info->reg.gpmc_nand_data);
168238 }
169239 }
170240
@@ -198,7 +268,8 @@ static void omap_write_buf8(struct mtd_info *mtd, const u_char *buf, int len) · 27 unmodified lines
198268 iowrite8(*p++, info->nand.IO_ADDR_W);
199269 /* wait until buffer is available for write */
200270 do {
201− status = gpmc_read_status(GPMC_STATUS_BUFFER);
271+ status = readl(info->reg.gpmc_status) &
272+ GPMC_STATUS_BUFF_EMPTY;
202273 } while (!status);
203274 }
204275 }
@@ -235,7 +306,8 @@ static void omap_write_buf16(struct mtd_info *mtd, const u_char * buf, int len) · 30 unmodified lines
235306 iowrite16(*p++, info->nand.IO_ADDR_W);
236307 /* wait until buffer is available for write */
237308 do {
238− status = gpmc_read_status(GPMC_STATUS_BUFFER);
309+ status = readl(info->reg.gpmc_status) &
310+ GPMC_STATUS_BUFF_EMPTY;
239311 } while (!status);
240312 }
241313 }
@@ -265,8 +337,8 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len) · 23 unmodified lines
265337 }
266338
267339 /* configure and start prefetch transfer */
268− ret = gpmc_prefetch_enable(info->gpmc_cs,
269− PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x0);
340+ ret = omap_prefetch_enable(info->gpmc_cs,
341+ PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x0, info);
270342 if (ret) {
271343 /* PFPW engine is busy, use cpu copy method */
272344 if (info->nand.options & NAND_BUSWIDTH_16)
@@ -275,14 +347,15 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len) · 2 unmodified lines
275347 omap_read_buf8(mtd, (u_char *)p, len);
276348 } else {
277349 do {
278− r_count = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT);
350+ r_count = readl(info->reg.gpmc_prefetch_status);
351+ r_count = GPMC_PREFETCH_STATUS_FIFO_CNT(r_count);
279352 r_count = r_count >> 2;
280353 ioread32_rep(info->nand.IO_ADDR_R, p, r_count);
281354 p += r_count;
282355 len -= r_count << 2;
283356 } while (len);
284357 /* disable and stop the PFPW engine */
285− gpmc_prefetch_reset(info->gpmc_cs);
358+ omap_prefetch_reset(info->gpmc_cs, info);
286359 }
287360 }
288361
@@ -301,6 +374,7 @@ static void omap_write_buf_pref(struct mtd_info *mtd, · 12 unmodified lines
301374 int i = 0, ret = 0;
302375 u16 *p = (u16 *)buf;
303376 unsigned long tim, limit;
377+ u32 val;
304378
305379 /* take care of subpage writes */
306380 if (len % 2 != 0) {
@@ -310,8 +384,8 @@ static void omap_write_buf_pref(struct mtd_info *mtd, · 3 unmodified lines
310384 }
311385
312386 /* configure and start prefetch transfer */
313− ret = gpmc_prefetch_enable(info->gpmc_cs,
314− PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x1);
387+ ret = omap_prefetch_enable(info->gpmc_cs,
388+ PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x1, info);
315389 if (ret) {
316390 /* PFPW engine is busy, use cpu copy method */
317391 if (info->nand.options & NAND_BUSWIDTH_16)
@@ -320,7 +394,8 @@ static void omap_write_buf_pref(struct mtd_info *mtd, · 2 unmodified lines
320394 omap_write_buf8(mtd, (u_char *)p, len);
321395 } else {
322396 while (len) {
323− w_count = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT);
397+ w_count = readl(info->reg.gpmc_prefetch_status);
398+ w_count = GPMC_PREFETCH_STATUS_FIFO_CNT(w_count);
324399 w_count = w_count >> 1;
325400 for (i = 0; (i < w_count) && len; i++, len -= 2)
326401 iowrite16(*p++, info->nand.IO_ADDR_W);
@@ -329,11 +404,14 @@ static void omap_write_buf_pref(struct mtd_info *mtd, · 2 unmodified lines
329404 tim = 0;
330405 limit = (loops_per_jiffy *
331406 msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS));
332− while (gpmc_read_status(GPMC_PREFETCH_COUNT) && (tim++ < limit))
407+ do {
333408 cpu_relax();
409+ val = readl(info->reg.gpmc_prefetch_status);
410+ val = GPMC_PREFETCH_STATUS_COUNT(val);
411+ } while (val && (tim++ < limit));
334412
335413 /* disable and stop the PFPW engine */
336− gpmc_prefetch_reset(info->gpmc_cs);
414+ omap_prefetch_reset(info->gpmc_cs, info);
337415 }
338416 }
339417
@@ -365,6 +443,7 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, · 25 unmodified lines
365443 unsigned long tim, limit;
366444 unsigned n;
367445 int ret;
446+ u32 val;
368447
369448 if (addr >= high_memory) {
370449 struct page *p1;
@@ -396,9 +475,9 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, · 25 unmodified lines
396475 tx->callback_param = &info->comp;
397476 dmaengine_submit(tx);
398477
399− /* configure and start prefetch transfer */
400− ret = gpmc_prefetch_enable(info->gpmc_cs,
401− PREFETCH_FIFOTHRESHOLD_MAX, 0x1, len, is_write);
478+ /* configure and start prefetch transfer */
479+ ret = omap_prefetch_enable(info->gpmc_cs,
480+ PREFETCH_FIFOTHRESHOLD_MAX, 0x1, len, is_write, info);
402481 if (ret)
403482 /* PFPW engine is busy, use cpu copy method */
404483 goto out_copy_unmap;
@@ -410,11 +489,15 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, · 5 unmodified lines
410489 wait_for_completion(&info->comp);
411490 tim = 0;
412491 limit = (loops_per_jiffy * msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS));
413− while (gpmc_read_status(GPMC_PREFETCH_COUNT) && (tim++ < limit))
492+
493+ do {
414494 cpu_relax();
495+ val = readl(info->reg.gpmc_prefetch_status);
496+ val = GPMC_PREFETCH_STATUS_COUNT(val);
497+ } while (val && (tim++ < limit));
415498
416499 /* disable and stop the PFPW engine */
417− gpmc_prefetch_reset(info->gpmc_cs);
500+ omap_prefetch_reset(info->gpmc_cs, info);
418501
419502 dma_unmap_sg(info->dma->device->dev, &sg, 1, dir);
420503 return 0;
@@ -471,13 +554,12 @@ static irqreturn_t omap_nand_irq(int this_irq, void *dev) · 50 unmodified lines
471554 {
472555 struct omap_nand_info *info = (struct omap_nand_info *) dev;
473556 u32 bytes;
474− u32 irq_stat;
475557
476− irq_stat = gpmc_read_status(GPMC_GET_IRQ_STATUS);
477− bytes = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT);
558+ bytes = readl(info->reg.gpmc_prefetch_status);
559+ bytes = GPMC_PREFETCH_STATUS_FIFO_CNT(bytes);
478560 bytes = bytes & 0xFFFC; /* io in multiple of 4 bytes */
479561 if (info->iomode == OMAP_NAND_IO_WRITE) { /* checks for write io */
480− if (irq_stat & 0x2)
562+ if (this_irq == info->gpmc_irq_count)
481563 goto done;
482564
483565 if (info->buf_len && (info->buf_len < bytes))
@@ -494,20 +576,17 @@ static irqreturn_t omap_nand_irq(int this_irq, void *dev) · 10 unmodified lines
494576 (u32 *)info->buf, bytes >> 2);
495577 info->buf = info->buf + bytes;
496578
497− if (irq_stat & 0x2)
579+ if (this_irq == info->gpmc_irq_count)
498580 goto done;
499581 }
500− gpmc_cs_configure(info->gpmc_cs, GPMC_SET_IRQ_STATUS, irq_stat);
501582
502583 return IRQ_HANDLED;
503584
504585 done:
505586 complete(&info->comp);
506− /* disable irq */
507− gpmc_cs_configure(info->gpmc_cs, GPMC_ENABLE_IRQ, 0);
508587
509− /* clear status */
510− gpmc_cs_configure(info->gpmc_cs, GPMC_SET_IRQ_STATUS, irq_stat);
588+ disable_irq_nosync(info->gpmc_irq_fifo);
589+ disable_irq_nosync(info->gpmc_irq_count);
511590
512591 return IRQ_HANDLED;
513592 }
@@ -534,22 +613,22 @@ static void omap_read_buf_irq_pref(struct mtd_info *mtd, u_char *buf, int len) · 20 unmodified lines
534613 init_completion(&info->comp);
535614
536615 /* configure and start prefetch transfer */
537− ret = gpmc_prefetch_enable(info->gpmc_cs,
538− PREFETCH_FIFOTHRESHOLD_MAX/2, 0x0, len, 0x0);
616+ ret = omap_prefetch_enable(info->gpmc_cs,
617+ PREFETCH_FIFOTHRESHOLD_MAX/2, 0x0, len, 0x0, info);
539618 if (ret)
540619 /* PFPW engine is busy, use cpu copy method */
541620 goto out_copy;
542621
543622 info->buf_len = len;
544− /* enable irq */
545− gpmc_cs_configure(info->gpmc_cs, GPMC_ENABLE_IRQ,
546− (GPMC_IRQ_FIFOEVENTENABLE | GPMC_IRQ_COUNT_EVENT));
623+
624+ enable_irq(info->gpmc_irq_count);
625+ enable_irq(info->gpmc_irq_fifo);
547626
548627 /* waiting for read to complete */
549628 wait_for_completion(&info->comp);
550629
551630 /* disable and stop the PFPW engine */
552− gpmc_prefetch_reset(info->gpmc_cs);
631+ omap_prefetch_reset(info->gpmc_cs, info);
553632 return;
554633
555634 out_copy:
@@ -572,6 +651,7 @@ static void omap_write_buf_irq_pref(struct mtd_info *mtd, · 16 unmodified lines
572651 struct omap_nand_info, mtd);
573652 int ret = 0;
574653 unsigned long tim, limit;
654+ u32 val;
575655
576656 if (len <= mtd->oobsize) {
577657 omap_write_buf_pref(mtd, buf, len);
@@ -583,27 +663,31 @@ static void omap_write_buf_irq_pref(struct mtd_info *mtd, · 5 unmodified lines
583663 init_completion(&info->comp);
584664
585665 /* configure and start prefetch transfer : size=24 */
586− ret = gpmc_prefetch_enable(info->gpmc_cs,
587− (PREFETCH_FIFOTHRESHOLD_MAX * 3) / 8, 0x0, len, 0x1);
666+ ret = omap_prefetch_enable(info->gpmc_cs,
667+ (PREFETCH_FIFOTHRESHOLD_MAX * 3) / 8, 0x0, len, 0x1, info);
588668 if (ret)
589669 /* PFPW engine is busy, use cpu copy method */
590670 goto out_copy;
591671
592672 info->buf_len = len;
593− /* enable irq */
594− gpmc_cs_configure(info->gpmc_cs, GPMC_ENABLE_IRQ,
595− (GPMC_IRQ_FIFOEVENTENABLE | GPMC_IRQ_COUNT_EVENT));
673+
674+ enable_irq(info->gpmc_irq_count);
675+ enable_irq(info->gpmc_irq_fifo);
596676
597677 /* waiting for write to complete */
598678 wait_for_completion(&info->comp);
679+
599680 /* wait for data to flushed-out before reset the prefetch */
600681 tim = 0;
601682 limit = (loops_per_jiffy * msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS));
602− while (gpmc_read_status(GPMC_PREFETCH_COUNT) && (tim++ < limit))
683+ do {
684+ val = readl(info->reg.gpmc_prefetch_status);
685+ val = GPMC_PREFETCH_STATUS_COUNT(val);
603686 cpu_relax();
687+ } while (val && (tim++ < limit));
604688
605689 /* disable and stop the PFPW engine */
606− gpmc_prefetch_reset(info->gpmc_cs);
690+ omap_prefetch_reset(info->gpmc_cs, info);
607691 return;
608692
609693 out_copy:
@@ -843,7 +927,20 @@ static int omap_calculate_ecc(struct mtd_info *mtd, const u_char *dat, · 233 unmodified lines
843927 {
844928 struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
845929 mtd);
846− return gpmc_calculate_ecc(info->gpmc_cs, dat, ecc_code);
930+ u32 val;
931+
932+ val = readl(info->reg.gpmc_ecc_config);
933+ if (((val >> ECC_CONFIG_CS_SHIFT) & ~CS_MASK) != info->gpmc_cs)
934+ return -EINVAL;
935+
936+ /* read ecc result */
937+ val = readl(info->reg.gpmc_ecc1_result);
938+ *ecc_code++ = val; /* P128e, ..., P1e */
939+ *ecc_code++ = val >> 16; /* P128o, ..., P1o */
940+ /* P2048o, P1024o, P512o, P256o, P2048e, P1024e, P512e, P256e */
941+ *ecc_code++ = ((val >> 8) & 0x0f) | ((val >> 20) & 0xf0);
942+
943+ return 0;
847944 }
848945
849946 /**
@@ -857,8 +954,34 @@ static void omap_enable_hwecc(struct mtd_info *mtd, int mode) · 7 unmodified lines
857954 mtd);
858955 struct nand_chip *chip = mtd->priv;
859956 unsigned int dev_width = (chip->options & NAND_BUSWIDTH_16) ? 1 : 0;
957+ u32 val;
958+
959+ /* clear ecc and enable bits */
960+ val = ECCCLEAR | ECC1;
961+ writel(val, info->reg.gpmc_ecc_control);
962+
963+ /* program ecc and result sizes */
964+ val = ((((info->nand.ecc.size >> 1) - 1) << ECCSIZE1_SHIFT) |
965+ ECC1RESULTSIZE);
966+ writel(val, info->reg.gpmc_ecc_size_config);
860967
861− gpmc_enable_hwecc(info->gpmc_cs, mode, dev_width, info->nand.ecc.size);
968+ switch (mode) {
969+ case NAND_ECC_READ:
970+ case NAND_ECC_WRITE:
971+ writel(ECCCLEAR | ECC1, info->reg.gpmc_ecc_control);
972+ break;
973+ case NAND_ECC_READSYN:
974+ writel(ECCCLEAR, info->reg.gpmc_ecc_control);
975+ break;
976+ default:
977+ dev_info(&info->pdev->dev,
978+ "error: unrecognized Mode[%d]!\n", mode);
979+ break;
980+ }
981+
982+ /* (ECC 16 or 8 bit col) | ( CS ) | ECC Enable */
983+ val = (dev_width << 7) | (info->gpmc_cs << 1) | (0x1);
984+ writel(val, info->reg.gpmc_ecc_config);
862985 }
863986
864987 /**
@@ -886,10 +1009,9 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip *chip) · 21 unmodified lines
8861009 else
8871010 timeo += (HZ * 20) / 1000;
8881011
889− gpmc_nand_write(info->gpmc_cs,
890− GPMC_NAND_COMMAND, (NAND_CMD_STATUS & 0xFF));
1012+ writeb(NAND_CMD_STATUS & 0xFF, info->reg.gpmc_nand_command);
8911013 while (time_before(jiffies, timeo)) {
892− status = gpmc_nand_read(info->gpmc_cs, GPMC_NAND_DATA);
1014+ status = readb(info->reg.gpmc_nand_data);
8931015 if (status & NAND_STATUS_READY)
8941016 break;
8951017 cond_resched();
@@ -909,22 +1031,13 @@ static int omap_dev_ready(struct mtd_info *mtd) · 13 unmodified lines
9091031 struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
9101032 mtd);
9111033
912− val = gpmc_read_status(GPMC_GET_IRQ_STATUS);
1034+ val = readl(info->reg.gpmc_status);
1035+
9131036 if ((val & 0x100) == 0x100) {
914− /* Clear IRQ Interrupt */
915− val |= 0x100;
916− val &= ~(0x0);
917− gpmc_cs_configure(info->gpmc_cs, GPMC_SET_IRQ_STATUS, val);
1037+ return 1;
9181038 } else {
919− unsigned int cnt = 0;
920− while (cnt++ < 0x1FF) {
921− if ((val & 0x100) == 0x100)
922− return 0;
923− val = gpmc_read_status(GPMC_GET_IRQ_STATUS);
924− }
1039+ return 0;
9251040 }
926−
927− return 1;
9281041 }
9291042
9301043 #ifdef CONFIG_MTD_NAND_OMAP_BCH
@@ -1155,6 +1268,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) · 224 unmodified lines
11551268 int i, offset;
11561269 dma_cap_mask_t mask;
11571270 unsigned sig;
1271+ struct resource *res;
11581272
11591273 pdata = pdev->dev.platform_data;
11601274 if (pdata == NULL) {
@@ -1174,7 +1288,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) · 13 unmodified lines
11741288 info->pdev = pdev;
11751289
11761290 info->gpmc_cs = pdata->cs;
1177− info->phys_base = pdata->phys_base;
1291+ info->reg = pdata->reg;
11781292
11791293 info->mtd.priv = &info->nand;
11801294 info->mtd.name = dev_name(&pdev->dev);
@@ -1183,16 +1297,23 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) · 2 unmodified lines
11831297 info->nand.options = pdata->devsize;
11841298 info->nand.options |= NAND_SKIP_BBTSCAN;
11851299
1186− /* NAND write protect off */
1187− gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_WP, 0);
1300+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1301+ if (res == NULL) {
1302+ err = -EINVAL;
1303+ dev_err(&pdev->dev, "error getting memory resource\n");
1304+ goto out_free_info;
1305+ }
1306+
1307+ info->phys_base = res->start;
1308+ info->mem_size = resource_size(res);
11881309
1189− if (!request_mem_region(info->phys_base, NAND_IO_SIZE,
1310+ if (!request_mem_region(info->phys_base, info->mem_size,
11901311 pdev->dev.driver->name)) {
11911312 err = -EBUSY;
11921313 goto out_free_info;
11931314 }
11941315
1195− info->nand.IO_ADDR_R = ioremap(info->phys_base, NAND_IO_SIZE);
1316+ info->nand.IO_ADDR_R = ioremap(info->phys_base, info->mem_size);
11961317 if (!info->nand.IO_ADDR_R) {
11971318 err = -ENOMEM;
11981319 goto out_release_mem_region;
@@ -1265,17 +1386,39 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) · 66 unmodified lines
12651386 break;
12661387
12671388 case NAND_OMAP_PREFETCH_IRQ:
1268− err = request_irq(pdata->gpmc_irq,
1269− omap_nand_irq, IRQF_SHARED, "gpmc-nand", info);
1389+ info->gpmc_irq_fifo = platform_get_irq(pdev, 0);
1390+ if (info->gpmc_irq_fifo <= 0) {
1391+ dev_err(&pdev->dev, "error getting fifo irq\n");
1392+ err = -ENODEV;
1393+ goto out_release_mem_region;
1394+ }
1395+ err = request_irq(info->gpmc_irq_fifo, omap_nand_irq,
1396+ IRQF_SHARED, "gpmc-nand-fifo", info);
12701397 if (err) {
12711398 dev_err(&pdev->dev, "requesting irq(%d) error:%d",
1272− pdata->gpmc_irq, err);
1399+ info->gpmc_irq_fifo, err);
1400+ info->gpmc_irq_fifo = 0;
1401+ goto out_release_mem_region;
1402+ }
1403+
1404+ info->gpmc_irq_count = platform_get_irq(pdev, 1);
1405+ if (info->gpmc_irq_count <= 0) {
1406+ dev_err(&pdev->dev, "error getting count irq\n");
1407+ err = -ENODEV;
1408+ goto out_release_mem_region;
1409+ }
1410+ err = request_irq(info->gpmc_irq_count, omap_nand_irq,
1411+ IRQF_SHARED, "gpmc-nand-count", info);
1412+ if (err) {
1413+ dev_err(&pdev->dev, "requesting irq(%d) error:%d",
1414+ info->gpmc_irq_count, err);
1415+ info->gpmc_irq_count = 0;
12731416 goto out_release_mem_region;
1274− } else {
1275− info->gpmc_irq = pdata->gpmc_irq;
1276− info->nand.read_buf = omap_read_buf_irq_pref;
1277− info->nand.write_buf = omap_write_buf_irq_pref;
12781417 }
1418+
1419+ info->nand.read_buf = omap_read_buf_irq_pref;
1420+ info->nand.write_buf = omap_write_buf_irq_pref;
1421+
12791422 break;
12801423
12811424 default:
@@ -1363,7 +1506,11 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) · 81 unmodified lines
13631506 out_release_mem_region:
13641507 if (info->dma)
13651508 dma_release_channel(info->dma);
1366− release_mem_region(info->phys_base, NAND_IO_SIZE);
1509+ if (info->gpmc_irq_count > 0)
1510+ free_irq(info->gpmc_irq_count, info);
1511+ if (info->gpmc_irq_fifo > 0)
1512+ free_irq(info->gpmc_irq_fifo, info);
1513+ release_mem_region(info->phys_base, info->mem_size);
13671514 out_free_info:
13681515 kfree(info);
13691516
@@ -1381,8 +1528,10 @@ static int omap_nand_remove(struct platform_device *pdev) · 11 unmodified lines
13811528 if (info->dma)
13821529 dma_release_channel(info->dma);
13831530
1384− if (info->gpmc_irq)
1385− free_irq(info->gpmc_irq, info);
1531+ if (info->gpmc_irq_count > 0)
1532+ free_irq(info->gpmc_irq_count, info);
1533+ if (info->gpmc_irq_fifo > 0)
1534+ free_irq(info->gpmc_irq_fifo, info);
13861535
13871536 /* Release NAND device, its internal structures and partitions */
13881537 nand_release(&info->mtd);
drivers/mtd/onenand/omap2.c+16−15
@@ -44,17 +44,15 @@ · 43 unmodified lines
4444
4545 #include <plat/dma.h>
4646
47−#include <plat/board.h>
48−
4947 #define DRIVER_NAME "omap2-onenand"
5048
51−#define ONENAND_IO_SIZE SZ_128K
5249 #define ONENAND_BUFRAM_SIZE (1024 * 5)
5350
5451 struct omap2_onenand {
5552 struct platform_device *pdev;
5653 int gpmc_cs;
5754 unsigned long phys_base;
55+ unsigned int mem_size;
5856 int gpio_irq;
5957 struct mtd_info mtd;
6058 struct onenand_chip onenand;
@@ -626,6 +624,7 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev) · 565 unmodified lines
626624 struct omap2_onenand *c;
627625 struct onenand_chip *this;
628626 int r;
627+ struct resource *res;
629628
630629 pdata = pdev->dev.platform_data;
631630 if (pdata == NULL) {
@@ -647,20 +646,24 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev) · 15 unmodified lines
647646 c->gpio_irq = 0;
648647 }
649648
650− r = gpmc_cs_request(c->gpmc_cs, ONENAND_IO_SIZE, &c->phys_base);
651− if (r < 0) {
652− dev_err(&pdev->dev, "Cannot request GPMC CS\n");
649+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
650+ if (res == NULL) {
651+ r = -EINVAL;
652+ dev_err(&pdev->dev, "error getting memory resource\n");
653653 goto err_kfree;
654654 }
655655
656− if (request_mem_region(c->phys_base, ONENAND_IO_SIZE,
656+ c->phys_base = res->start;
657+ c->mem_size = resource_size(res);
658+
659+ if (request_mem_region(c->phys_base, c->mem_size,
657660 pdev->dev.driver->name) == NULL) {
658− dev_err(&pdev->dev, "Cannot reserve memory region at 0x%08lx, "
659− "size: 0x%x\n", c->phys_base, ONENAND_IO_SIZE);
661+ dev_err(&pdev->dev, "Cannot reserve memory region at 0x%08lx, size: 0x%x\n",
662+ c->phys_base, c->mem_size);
660663 r = -EBUSY;
661− goto err_free_cs;
664+ goto err_kfree;
662665 }
663− c->onenand.base = ioremap(c->phys_base, ONENAND_IO_SIZE);
666+ c->onenand.base = ioremap(c->phys_base, c->mem_size);
664667 if (c->onenand.base == NULL) {
665668 r = -ENOMEM;
666669 goto err_release_mem_region;
@@ -776,9 +779,7 @@ err_release_gpio: · 109 unmodified lines
776779 err_iounmap:
777780 iounmap(c->onenand.base);
778781 err_release_mem_region:
779− release_mem_region(c->phys_base, ONENAND_IO_SIZE);
780−err_free_cs:
781− gpmc_cs_free(c->gpmc_cs);
782+ release_mem_region(c->phys_base, c->mem_size);
782783 err_kfree:
783784 kfree(c);
784785
@@ -800,7 +801,7 @@ static int __devexit omap2_onenand_remove(struct platform_device *pdev) · 15 unmodified lines
800801 gpio_free(c->gpio_irq);
801802 }
802803 iounmap(c->onenand.base);
803− release_mem_region(c->phys_base, ONENAND_IO_SIZE);
804+ release_mem_region(c->phys_base, c->mem_size);
804805 gpmc_cs_free(c->gpmc_cs);
805806 kfree(c);
806807
drivers/mtd/ubi/vtbl.c+2−2
@@ -340,7 +340,7 @@ retry: · 339 unmodified lines
340340 * of this LEB as it will be deleted and freed in 'ubi_add_to_av()'.
341341 */
342342 err = ubi_add_to_av(ubi, ai, new_aeb->pnum, new_aeb->ec, vid_hdr, 0);
343− kfree(new_aeb);
343+ kmem_cache_free(ai->aeb_slab_cache, new_aeb);
344344 ubi_free_vid_hdr(ubi, vid_hdr);
345345 return err;
346346
@@ -353,7 +353,7 @@ write_error: · 6 unmodified lines
353353 list_add(&new_aeb->u.list, &ai->erase);
354354 goto retry;
355355 }
356− kfree(new_aeb);
356+ kmem_cache_free(ai->aeb_slab_cache, new_aeb);
357357 out_free:
358358 ubi_free_vid_hdr(ubi, vid_hdr);
359359 return err;
drivers/net/can/sja1000/sja1000_platform.c+3−1
@@ -109,7 +109,9 @@ static int sp_probe(struct platform_device *pdev) · 108 unmodified lines
109109 priv = netdev_priv(dev);
110110
111111 dev->irq = res_irq->start;
112− priv->irq_flags = res_irq->flags & (IRQF_TRIGGER_MASK | IRQF_SHARED);
112+ priv->irq_flags = res_irq->flags & IRQF_TRIGGER_MASK;
113+ if (res_irq->flags & IORESOURCE_IRQ_SHAREABLE)
114+ priv->irq_flags |= IRQF_SHARED;
113115 priv->reg_base = addr;
114116 /* The CAN clock frequency is half the oscillator clock frequency */
115117 priv->can.clock.freq = pdata->osc_freq / 2;
drivers/net/can/softing/softing_fw.c+4−3
@@ -150,7 +150,7 @@ int softing_load_fw(const char *file, struct softing *card, · 149 unmodified lines
150150 const uint8_t *mem, *end, *dat;
151151 uint16_t type, len;
152152 uint32_t addr;
153− uint8_t *buf = NULL;
153+ uint8_t *buf = NULL, *new_buf;
154154 int buflen = 0;
155155 int8_t type_end = 0;
156156
@@ -199,11 +199,12 @@ int softing_load_fw(const char *file, struct softing *card, · 42 unmodified lines
199199 if (len > buflen) {
200200 /* align buflen */
201201 buflen = (len + (1024-1)) & ~(1024-1);
202− buf = krealloc(buf, buflen, GFP_KERNEL);
203− if (!buf) {
202+ new_buf = krealloc(buf, buflen, GFP_KERNEL);
203+ if (!new_buf) {
204204 ret = -ENOMEM;
205205 goto failed;
206206 }
207+ buf = new_buf;
207208 }
208209 /* verify record data */
209210 memcpy_fromio(buf, &dpram[addr + offset], len);
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h+0−3
@@ -1708,9 +1708,6 @@ struct bnx2x_func_init_params { · 1707 unmodified lines
17081708 continue; \
17091709 else
17101710
1711−#define for_each_napi_rx_queue(bp, var) \
1712− for ((var) = 0; (var) < bp->num_napi_queues; (var)++)
1713−
17141711 /* Skip OOO FP */
17151712 #define for_each_tx_queue(bp, var) \
17161713 for ((var) = 0; (var) < BNX2X_NUM_QUEUES(bp); (var)++) \
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c+4−0
@@ -2046,6 +2046,8 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 2045 unmodified lines
20462046 */
20472047 bnx2x_setup_tc(bp->dev, bp->max_cos);
20482048
2049+ /* Add all NAPI objects */
2050+ bnx2x_add_all_napi(bp);
20492051 bnx2x_napi_enable(bp);
20502052
20512053 /* set pf load just before approaching the MCP */
@@ -2408,6 +2410,8 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode) · 356 unmodified lines
24082410
24092411 /* Disable HW interrupts, NAPI */
24102412 bnx2x_netif_stop(bp, 1);
2413+ /* Delete all NAPI objects */
2414+ bnx2x_del_all_napi(bp);
24112415
24122416 /* Release IRQs */
24132417 bnx2x_free_irq(bp);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h+2−2
@@ -792,7 +792,7 @@ static inline void bnx2x_add_all_napi(struct bnx2x *bp) · 791 unmodified lines
792792 bp->num_napi_queues = bp->num_queues;
793793
794794 /* Add NAPI objects */
795− for_each_napi_rx_queue(bp, i)
795+ for_each_rx_queue(bp, i)
796796 netif_napi_add(bp->dev, &bnx2x_fp(bp, i, napi),
797797 bnx2x_poll, BNX2X_NAPI_WEIGHT);
798798 }
@@ -801,7 +801,7 @@ static inline void bnx2x_del_all_napi(struct bnx2x *bp) · 2 unmodified lines
801801 {
802802 int i;
803803
804− for_each_napi_rx_queue(bp, i)
804+ for_each_rx_queue(bp, i)
805805 netif_napi_del(&bnx2x_fp(bp, i, napi));
806806 }
807807
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c+0−2
@@ -2888,11 +2888,9 @@ static void bnx2x_get_channels(struct net_device *dev, · 2887 unmodified lines
28882888 */
28892889 static void bnx2x_change_num_queues(struct bnx2x *bp, int num_rss)
28902890 {
2891− bnx2x_del_all_napi(bp);
28922891 bnx2x_disable_msi(bp);
28932892 BNX2X_NUM_QUEUES(bp) = num_rss + NON_ETH_CONTEXT_USE;
28942893 bnx2x_set_int_mode(bp);
2895− bnx2x_add_all_napi(bp);
28962894 }
28972895
28982896 /**
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+9−9
@@ -8427,6 +8427,8 @@ unload_error: · 8426 unmodified lines
84278427
84288428 /* Disable HW interrupts, NAPI */
84298429 bnx2x_netif_stop(bp, 1);
8430+ /* Delete all NAPI objects */
8431+ bnx2x_del_all_napi(bp);
84308432
84318433 /* Release IRQs */
84328434 bnx2x_free_irq(bp);
@@ -11229,10 +11231,12 @@ static int bnx2x_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) · 2796 unmodified lines
1122911231 static void poll_bnx2x(struct net_device *dev)
1123011232 {
1123111233 struct bnx2x *bp = netdev_priv(dev);
11234+ int i;
1123211235
11233− disable_irq(bp->pdev->irq);
11234− bnx2x_interrupt(bp->pdev->irq, dev);
11235− enable_irq(bp->pdev->irq);
11236+ for_each_eth_queue(bp, i) {
11237+ struct bnx2x_fastpath *fp = &bp->fp[i];
11238+ napi_schedule(&bnx2x_fp(bp, fp->index, napi));
11239+ }
1123611240 }
1123711241 #endif
1123811242
@@ -11899,9 +11903,6 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, · 660 unmodified lines
1189911903 */
1190011904 bnx2x_set_int_mode(bp);
1190111905
11902− /* Add all NAPI objects */
11903− bnx2x_add_all_napi(bp);
11904−
1190511906 rc = register_netdev(dev);
1190611907 if (rc) {
1190711908 dev_err(&pdev->dev, "Cannot register net device\n");
@@ -11976,9 +11977,6 @@ static void __devexit bnx2x_remove_one(struct pci_dev *pdev) · 68 unmodified lines
1197611977
1197711978 unregister_netdev(dev);
1197811979
11979− /* Delete all NAPI objects */
11980− bnx2x_del_all_napi(bp);
11981−
1198211980 /* Power on: we can't let PCI layer write to us while we are in D3 */
1198311981 bnx2x_set_power_state(bp, PCI_D0);
1198411982
@@ -12025,6 +12023,8 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp) · 40 unmodified lines
1202512023 bnx2x_tx_disable(bp);
1202612024
1202712025 bnx2x_netif_stop(bp, 0);
12026+ /* Delete all NAPI objects */
12027+ bnx2x_del_all_napi(bp);
1202812028
1202912029 del_timer_sync(&bp->timer);
1203012030
drivers/net/ethernet/cirrus/cs89x0.c+5−5
@@ -1243,6 +1243,7 @@ static void set_multicast_list(struct net_device *dev) · 1242 unmodified lines
12431243 {
12441244 struct net_local *lp = netdev_priv(dev);
12451245 unsigned long flags;
1246+ u16 cfg;
12461247
12471248 spin_lock_irqsave(&lp->lock, flags);
12481249 if (dev->flags & IFF_PROMISC)
@@ -1260,11 +1261,10 @@ static void set_multicast_list(struct net_device *dev) · 11 unmodified lines
12601261 /* in promiscuous mode, we accept errored packets,
12611262 * so we have to enable interrupts on them also
12621263 */
1263− writereg(dev, PP_RxCFG,
1264− (lp->curr_rx_cfg |
1265− (lp->rx_mode == RX_ALL_ACCEPT)
1266− ? (RX_CRC_ERROR_ENBL | RX_RUNT_ENBL | RX_EXTRA_DATA_ENBL)
1267− : 0));
1264+ cfg = lp->curr_rx_cfg;
1265+ if (lp->rx_mode == RX_ALL_ACCEPT)
1266+ cfg |= RX_CRC_ERROR_ENBL | RX_RUNT_ENBL | RX_EXTRA_DATA_ENBL;
1267+ writereg(dev, PP_RxCFG, cfg);
12681268 spin_unlock_irqrestore(&lp->lock, flags);
12691269 }
12701270
drivers/net/ethernet/emulex/benet/be_cmds.c+4−2
@@ -259,7 +259,7 @@ int be_process_mcc(struct be_adapter *adapter) · 258 unmodified lines
259259 int num = 0, status = 0;
260260 struct be_mcc_obj *mcc_obj = &adapter->mcc_obj;
261261
262− spin_lock_bh(&adapter->mcc_cq_lock);
262+ spin_lock(&adapter->mcc_cq_lock);
263263 while ((compl = be_mcc_compl_get(adapter))) {
264264 if (compl->flags & CQE_FLAGS_ASYNC_MASK) {
265265 /* Interpret flags as an async trailer */
@@ -280,7 +280,7 @@ int be_process_mcc(struct be_adapter *adapter) · 14 unmodified lines
280280 if (num)
281281 be_cq_notify(adapter, mcc_obj->cq.id, mcc_obj->rearm_cq, num);
282282
283− spin_unlock_bh(&adapter->mcc_cq_lock);
283+ spin_unlock(&adapter->mcc_cq_lock);
284284 return status;
285285 }
286286
@@ -295,7 +295,9 @@ static int be_mcc_wait_compl(struct be_adapter *adapter) · 8 unmodified lines
295295 if (be_error(adapter))
296296 return -EIO;
297297
298+ local_bh_disable();
298299 status = be_process_mcc(adapter);
300+ local_bh_enable();
299301
300302 if (atomic_read(&mcc_obj->q.used) == 0)
301303 break;
drivers/net/ethernet/emulex/benet/be_main.c+2−0
@@ -3763,7 +3763,9 @@ static void be_worker(struct work_struct *work) · 3762 unmodified lines
37633763 /* when interrupts are not yet enabled, just reap any pending
37643764 * mcc completions */
37653765 if (!netif_running(adapter->netdev)) {
3766+ local_bh_disable();
37663767 be_process_mcc(adapter);
3768+ local_bh_enable();
37673769 goto reschedule;
37683770 }
37693771
drivers/net/ethernet/freescale/gianfar.c+1−1
@@ -1041,7 +1041,7 @@ static int gfar_probe(struct platform_device *ofdev) · 1040 unmodified lines
10411041
10421042 if (priv->device_flags & FSL_GIANFAR_DEV_HAS_VLAN) {
10431043 dev->hw_features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
1044− dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
1044+ dev->features |= NETIF_F_HW_VLAN_RX;
10451045 }
10461046
10471047 if (priv->device_flags & FSL_GIANFAR_DEV_HAS_EXTENDED_HASH) {
drivers/net/ethernet/intel/e1000e/e1000.h+1−0
@@ -310,6 +310,7 @@ struct e1000_adapter { · 309 unmodified lines
310310 */
311311 struct e1000_ring *tx_ring /* One per active queue */
312312 ____cacheline_aligned_in_smp;
313+ u32 tx_fifo_limit;
313314
314315 struct napi_struct napi;
315316
drivers/net/ethernet/intel/e1000e/netdev.c+23−25
@@ -3516,6 +3516,15 @@ void e1000e_reset(struct e1000_adapter *adapter) · 3515 unmodified lines
35163516 break;
35173517 }
35183518
3519+ /*
3520+ * Alignment of Tx data is on an arbitrary byte boundary with the
3521+ * maximum size per Tx descriptor limited only to the transmit
3522+ * allocation of the packet buffer minus 96 bytes with an upper
3523+ * limit of 24KB due to receive synchronization limitations.
3524+ */
3525+ adapter->tx_fifo_limit = min_t(u32, ((er32(PBA) >> 16) << 10) - 96,
3526+ 24 << 10);
3527+
35193528 /*
35203529 * Disable Adaptive Interrupt Moderation if 2 full packets cannot
35213530 * fit in receive buffer.
@@ -4785,12 +4794,9 @@ static bool e1000_tx_csum(struct e1000_ring *tx_ring, struct sk_buff *skb) · 1263 unmodified lines
47854794 return 1;
47864795 }
47874796
4788−#define E1000_MAX_PER_TXD 8192
4789−#define E1000_MAX_TXD_PWR 12
4790−
47914797 static int e1000_tx_map(struct e1000_ring *tx_ring, struct sk_buff *skb,
47924798 unsigned int first, unsigned int max_per_txd,
4793− unsigned int nr_frags, unsigned int mss)
4799+ unsigned int nr_frags)
47944800 {
47954801 struct e1000_adapter *adapter = tx_ring->adapter;
47964802 struct pci_dev *pdev = adapter->pdev;
@@ -5023,20 +5029,19 @@ static int __e1000_maybe_stop_tx(struct e1000_ring *tx_ring, int size) · 226 unmodified lines
50235029
50245030 static int e1000_maybe_stop_tx(struct e1000_ring *tx_ring, int size)
50255031 {
5032+ BUG_ON(size > tx_ring->count);
5033+
50265034 if (e1000_desc_unused(tx_ring) >= size)
50275035 return 0;
50285036 return __e1000_maybe_stop_tx(tx_ring, size);
50295037 }
50305038
5031−#define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1)
50325039 static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
50335040 struct net_device *netdev)
50345041 {
50355042 struct e1000_adapter *adapter = netdev_priv(netdev);
50365043 struct e1000_ring *tx_ring = adapter->tx_ring;
50375044 unsigned int first;
5038− unsigned int max_per_txd = E1000_MAX_PER_TXD;
5039− unsigned int max_txd_pwr = E1000_MAX_TXD_PWR;
50405045 unsigned int tx_flags = 0;
50415046 unsigned int len = skb_headlen(skb);
50425047 unsigned int nr_frags;
@@ -5056,18 +5061,8 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, · 13 unmodified lines
50565061 }
50575062
50585063 mss = skb_shinfo(skb)->gso_size;
5059− /*
5060− * The controller does a simple calculation to
5061− * make sure there is enough room in the FIFO before
5062− * initiating the DMA for each buffer. The calc is:
5063− * 4 = ceil(buffer len/mss). To make sure we don't
5064− * overrun the FIFO, adjust the max buffer len if mss
5065− * drops.
5066− */
50675064 if (mss) {
50685065 u8 hdr_len;
5069− max_per_txd = min(mss << 2, max_per_txd);
5070− max_txd_pwr = fls(max_per_txd) - 1;
50715066
50725067 /*
50735068 * TSO Workaround for 82571/2/3 Controllers -- if skb->data
@@ -5097,12 +5092,12 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, · 23 unmodified lines
50975092 count++;
50985093 count++;
50995094
5100− count += TXD_USE_COUNT(len, max_txd_pwr);
5095+ count += DIV_ROUND_UP(len, adapter->tx_fifo_limit);
51015096
51025097 nr_frags = skb_shinfo(skb)->nr_frags;
51035098 for (f = 0; f < nr_frags; f++)
5104− count += TXD_USE_COUNT(skb_frag_size(&skb_shinfo(skb)->frags[f]),
5105− max_txd_pwr);
5099+ count += DIV_ROUND_UP(skb_frag_size(&skb_shinfo(skb)->frags[f]),
5100+ adapter->tx_fifo_limit);
51065101
51075102 if (adapter->hw.mac.tx_pkt_filtering)
51085103 e1000_transfer_dhcp_info(adapter, skb);
@@ -5144,15 +5139,18 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, · 35 unmodified lines
51445139 tx_flags |= E1000_TX_FLAGS_NO_FCS;
51455140
51465141 /* if count is 0 then mapping error has occurred */
5147− count = e1000_tx_map(tx_ring, skb, first, max_per_txd, nr_frags, mss);
5142+ count = e1000_tx_map(tx_ring, skb, first, adapter->tx_fifo_limit,
5143+ nr_frags);
51485144 if (count) {
51495145 skb_tx_timestamp(skb);
51505146
51515147 netdev_sent_queue(netdev, skb->len);
51525148 e1000_tx_queue(tx_ring, tx_flags, count);
51535149 /* Make sure there is space in the ring for the next send. */
5154− e1000_maybe_stop_tx(tx_ring, MAX_SKB_FRAGS + 2);
5155−
5150+ e1000_maybe_stop_tx(tx_ring,
5151+ (MAX_SKB_FRAGS *
5152+ DIV_ROUND_UP(PAGE_SIZE,
5153+ adapter->tx_fifo_limit) + 2));
51565154 } else {
51575155 dev_kfree_skb_any(skb);
51585156 tx_ring->buffer_info[first].time_stamp = 0;
@@ -6327,8 +6325,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, · 1168 unmodified lines
63276325 adapter->hw.phy.autoneg_advertised = 0x2f;
63286326
63296327 /* ring size defaults */
6330− adapter->rx_ring->count = 256;
6331− adapter->tx_ring->count = 256;
6328+ adapter->rx_ring->count = E1000_DEFAULT_RXD;
6329+ adapter->tx_ring->count = E1000_DEFAULT_TXD;
63326330
63336331 /*
63346332 * Initial Wake on LAN setting - If APM wake is enabled in
drivers/net/ethernet/sfc/ethtool.c+2−2
@@ -863,8 +863,8 @@ static int efx_ethtool_get_class_rule(struct efx_nic *efx, · 862 unmodified lines
863863 &ip_entry->ip4dst, &ip_entry->pdst);
864864 if (rc != 0) {
865865 rc = efx_filter_get_ipv4_full(
866− &spec, &proto, &ip_entry->ip4src, &ip_entry->psrc,
867− &ip_entry->ip4dst, &ip_entry->pdst);
866+ &spec, &proto, &ip_entry->ip4dst, &ip_entry->pdst,
867+ &ip_entry->ip4src, &ip_entry->psrc);
868868 EFX_WARN_ON_PARANOID(rc);
869869 ip_mask->ip4src = ~0;
870870 ip_mask->psrc = ~0;
drivers/net/ethernet/stmicro/stmmac/common.h+5−0
@@ -22,6 +22,9 @@ · 21 unmodified lines
2222 Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
2323 *******************************************************************************/
2424
25+#ifndef __COMMON_H__
26+#define __COMMON_H__
27+
2528 #include <linux/etherdevice.h>
2629 #include <linux/netdevice.h>
2730 #include <linux/phy.h>
@@ -366,3 +369,5 @@ extern void stmmac_set_mac(void __iomem *ioaddr, bool enable); · 338 unmodified lines
366369
367370 extern void dwmac_dma_flush_tx_fifo(void __iomem *ioaddr);
368371 extern const struct stmmac_ring_mode_ops ring_mode_ops;
372+
373+#endif /* __COMMON_H__ */
drivers/net/ethernet/stmicro/stmmac/descs.h+6−0
@@ -20,6 +20,10 @@ · 19 unmodified lines
2020
2121 Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
2222 *******************************************************************************/
23+
24+#ifndef __DESCS_H__
25+#define __DESCS_H__
26+
2327 struct dma_desc {
2428 /* Receive descriptor */
2529 union {
@@ -166,3 +170,5 @@ enum tdes_csum_insertion { · 140 unmodified lines
166170 * is not calculated */
167171 cic_full = 3, /* IP header and pseudoheader */
168172 };
173+
174+#endif /* __DESCS_H__ */
drivers/net/ethernet/stmicro/stmmac/descs_com.h+5−0
@@ -27,6 +27,9 @@ · 26 unmodified lines
2727 Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
2828 *******************************************************************************/
2929
30+#ifndef __DESC_COM_H__
31+#define __DESC_COM_H__
32+
3033 #if defined(CONFIG_STMMAC_RING)
3134 static inline void ehn_desc_rx_set_on_ring_chain(struct dma_desc *p, int end)
3235 {
@@ -124,3 +127,5 @@ static inline void norm_set_tx_desc_len(struct dma_desc *p, int len) · 91 unmodified lines
124127 p->des01.tx.buffer1_size = len;
125128 }
126129 #endif
130+
131+#endif /* __DESC_COM_H__ */
drivers/net/ethernet/stmicro/stmmac/dwmac100.h+5−0
@@ -22,6 +22,9 @@ · 21 unmodified lines
2222 Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
2323 *******************************************************************************/
2424
25+#ifndef __DWMAC100_H__
26+#define __DWMAC100_H__
27+
2528 #include <linux/phy.h>
2629 #include "common.h"
2730
@@ -119,3 +122,5 @@ enum ttc_control { · 91 unmodified lines
119122 #define DMA_MISSED_FRAME_M_CNTR 0x0000ffff /* Missed Frame Couinter */
120123
121124 extern const struct stmmac_dma_ops dwmac100_dma_ops;
125+
126+#endif /* __DWMAC100_H__ */
drivers/net/ethernet/stmicro/stmmac/dwmac1000.h+4−1
@@ -19,6 +19,8 @@ · 18 unmodified lines
1919
2020 Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
2121 *******************************************************************************/
22+#ifndef __DWMAC1000_H__
23+#define __DWMAC1000_H__
2224
2325 #include <linux/phy.h>
2426 #include "common.h"
@@ -229,6 +231,7 @@ enum rtc_control { · 204 unmodified lines
229231 #define GMAC_MMC_RX_CSUM_OFFLOAD 0x208
230232
231233 /* Synopsys Core versions */
232−#define DWMAC_CORE_3_40 34
234+#define DWMAC_CORE_3_40 0x34
233235
234236 extern const struct stmmac_dma_ops dwmac1000_dma_ops;
237+#endif /* __DWMAC1000_H__ */
drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h+5−0
@@ -22,6 +22,9 @@ · 21 unmodified lines
2222 Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
2323 *******************************************************************************/
2424
25+#ifndef __DWMAC_DMA_H__
26+#define __DWMAC_DMA_H__
27+
2528 /* DMA CRS Control and Status Register Mapping */
2629 #define DMA_BUS_MODE 0x00001000 /* Bus Mode */
2730 #define DMA_XMT_POLL_DEMAND 0x00001004 /* Transmit Poll Demand */
@@ -109,3 +112,5 @@ extern void dwmac_dma_start_rx(void __iomem *ioaddr); · 81 unmodified lines
109112 extern void dwmac_dma_stop_rx(void __iomem *ioaddr);
110113 extern int dwmac_dma_interrupt(void __iomem *ioaddr,
111114 struct stmmac_extra_stats *x);
115+
116+#endif /* __DWMAC_DMA_H__ */
drivers/net/ethernet/stmicro/stmmac/mmc.h+5−0
@@ -22,6 +22,9 @@ · 21 unmodified lines
2222 Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
2323 *******************************************************************************/
2424
25+#ifndef __MMC_H__
26+#define __MMC_H__
27+
2528 /* MMC control register */
2629 /* When set, all counter are reset */
2730 #define MMC_CNTRL_COUNTER_RESET 0x1
@@ -129,3 +132,5 @@ struct stmmac_counters { · 101 unmodified lines
129132 extern void dwmac_mmc_ctrl(void __iomem *ioaddr, unsigned int mode);
130133 extern void dwmac_mmc_intr_all_mask(void __iomem *ioaddr);
131134 extern void dwmac_mmc_read(void __iomem *ioaddr, struct stmmac_counters *mmc);
135+
136+#endif /* __MMC_H__ */
drivers/net/ethernet/stmicro/stmmac/mmc_core.c+3−3
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333 #define MMC_TX_INTR 0x00000108 /* MMC TX Interrupt */
3434 #define MMC_RX_INTR_MASK 0x0000010c /* MMC Interrupt Mask */
3535 #define MMC_TX_INTR_MASK 0x00000110 /* MMC Interrupt Mask */
36−#define MMC_DEFAUL_MASK 0xffffffff
36+#define MMC_DEFAULT_MASK 0xffffffff
3737
3838 /* MMC TX counter registers */
3939
@@ -147,8 +147,8 @@ void dwmac_mmc_ctrl(void __iomem *ioaddr, unsigned int mode) · 107 unmodified lines
147147 /* To mask all all interrupts.*/
148148 void dwmac_mmc_intr_all_mask(void __iomem *ioaddr)
149149 {
150− writel(MMC_DEFAUL_MASK, ioaddr + MMC_RX_INTR_MASK);
151− writel(MMC_DEFAUL_MASK, ioaddr + MMC_TX_INTR_MASK);
150+ writel(MMC_DEFAULT_MASK, ioaddr + MMC_RX_INTR_MASK);
151+ writel(MMC_DEFAULT_MASK, ioaddr + MMC_TX_INTR_MASK);
152152 }
153153
154154 /* This reads the MAC core counters (if actaully supported).
drivers/net/ethernet/stmicro/stmmac/stmmac.h+5−0
@@ -20,6 +20,9 @@ · 19 unmodified lines
2020 Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
2121 *******************************************************************************/
2222
23+#ifndef __STMMAC_H__
24+#define __STMMAC_H__
25+
2326 #define STMMAC_RESOURCE_NAME "stmmaceth"
2427 #define DRV_MODULE_VERSION "March_2012"
2528
@@ -166,3 +169,5 @@ static inline void stmmac_unregister_pci(void) · 140 unmodified lines
166169 {
167170 }
168171 #endif /* CONFIG_STMMAC_PCI */
172+
173+#endif /* __STMMAC_H__ */
drivers/net/ethernet/stmicro/stmmac/stmmac_timer.h+4−0
@@ -21,6 +21,8 @@ · 20 unmodified lines
2121
2222 Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
2323 *******************************************************************************/
24+#ifndef __STMMAC_TIMER_H__
25+#define __STMMAC_TIMER_H__
2426
2527 struct stmmac_timer {
2628 void (*timer_start) (unsigned int new_freq);
@@ -40,3 +42,5 @@ void stmmac_schedule(struct net_device *dev); · 13 unmodified lines
4042 extern int tmu2_register_user(void *fnt, void *data);
4143 extern void tmu2_unregister_user(void);
4244 #endif
45+
46+#endif /* __STMMAC_TIMER_H__ */
drivers/net/ethernet/ti/davinci_mdio.c+3−1
@@ -394,8 +394,10 @@ static int __devexit davinci_mdio_remove(struct platform_device *pdev) · 393 unmodified lines
394394 struct device *dev = &pdev->dev;
395395 struct davinci_mdio_data *data = dev_get_drvdata(dev);
396396
397− if (data->bus)
397+ if (data->bus) {
398+ mdiobus_unregister(data->bus);
398399 mdiobus_free(data->bus);
400+ }
399401
400402 if (data->clk)
401403 clk_put(data->clk);
drivers/net/fddi/skfp/pmf.c+1−1
@@ -673,7 +673,7 @@ void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para, · 672 unmodified lines
673673 sm_pm_get_ls(smc,port_to_mib(smc,port))) ;
674674 break ;
675675 case SMT_P_REASON :
676− * (u_long *) to = 0 ;
676+ *(u32 *)to = 0 ;
677677 sp_len = 4 ;
678678 goto sp_done ;
679679 case SMT_P1033 : /* time stamp */
drivers/net/usb/qmi_wwan.c+4−0
@@ -413,7 +413,9 @@ static const struct usb_device_id products[] = { · 412 unmodified lines
413413
414414 /* 5. Gobi 2000 and 3000 devices */
415415 {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */
416+ {QMI_GOBI_DEVICE(0x413c, 0x8194)}, /* Dell Gobi 3000 Composite */
416417 {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */
418+ {QMI_GOBI_DEVICE(0x05c6, 0x920d)}, /* Gobi 3000 Composite */
417419 {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */
418420 {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */
419421 {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */
@@ -441,6 +443,8 @@ static const struct usb_device_id products[] = { · 21 unmodified lines
441443 {QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */
442444 {QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */
443445 {QMI_GOBI_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */
446+ {QMI_GOBI_DEVICE(0x12d1, 0x14f1)}, /* Sony Gobi 3000 Composite */
447+ {QMI_GOBI_DEVICE(0x1410, 0xa021)}, /* Foxconn Gobi 3000 Modem device (Novatel E396) */
444448
445449 { } /* END */
446450 };
drivers/net/usb/usbnet.c+1−1
@@ -1573,7 +1573,7 @@ int usbnet_resume (struct usb_interface *intf) · 1572 unmodified lines
15731573 netif_device_present(dev->net) &&
15741574 !timer_pending(&dev->delay) &&
15751575 !test_bit(EVENT_RX_HALT, &dev->flags))
1576− rx_alloc_submit(dev, GFP_KERNEL);
1576+ rx_alloc_submit(dev, GFP_NOIO);
15771577
15781578 if (!(dev->txq.qlen >= TX_QLEN(dev)))
15791579 netif_tx_wake_all_queues(dev->net);
drivers/net/wireless/ath/ath5k/eeprom.c+1−1
@@ -1482,7 +1482,7 @@ ath5k_eeprom_read_target_rate_pwr_info(struct ath5k_hw *ah, unsigned int mode) · 1481 unmodified lines
14821482 case AR5K_EEPROM_MODE_11A:
14831483 offset += AR5K_EEPROM_TARGET_PWR_OFF_11A(ee->ee_version);
14841484 rate_pcal_info = ee->ee_rate_tpwr_a;
1485− ee->ee_rate_target_pwr_num[mode] = AR5K_EEPROM_N_5GHZ_CHAN;
1485+ ee->ee_rate_target_pwr_num[mode] = AR5K_EEPROM_N_5GHZ_RATE_CHAN;
14861486 break;
14871487 case AR5K_EEPROM_MODE_11B:
14881488 offset += AR5K_EEPROM_TARGET_PWR_OFF_11B(ee->ee_version);
drivers/net/wireless/ath/ath5k/eeprom.h+1−0
@@ -182,6 +182,7 @@ · 181 unmodified lines
182182 #define AR5K_EEPROM_EEP_DELTA 10
183183 #define AR5K_EEPROM_N_MODES 3
184184 #define AR5K_EEPROM_N_5GHZ_CHAN 10
185+#define AR5K_EEPROM_N_5GHZ_RATE_CHAN 8
185186 #define AR5K_EEPROM_N_2GHZ_CHAN 3
186187 #define AR5K_EEPROM_N_2GHZ_CHAN_2413 4
187188 #define AR5K_EEPROM_N_2GHZ_CHAN_MAX 4
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c+3−0
@@ -1233,6 +1233,9 @@ uint brcms_reset(struct brcms_info *wl) · 1232 unmodified lines
12331233 /* dpc will not be rescheduled */
12341234 wl->resched = false;
12351235
1236+ /* inform publicly that interface is down */
1237+ wl->pub->up = false;
1238+
12361239 return 0;
12371240 }
12381241
drivers/net/wireless/ipw2x00/ipw2100.c+2−1
@@ -2042,7 +2042,8 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status) · 2041 unmodified lines
20422042 return;
20432043 }
20442044 len = ETH_ALEN;
2045− ipw2100_get_ordinal(priv, IPW_ORD_STAT_ASSN_AP_BSSID, &bssid, &len);
2045+ ret = ipw2100_get_ordinal(priv, IPW_ORD_STAT_ASSN_AP_BSSID, bssid,
2046+ &len);
20462047 if (ret) {
20472048 IPW_DEBUG_INFO("failed querying ordinals at line %d\n",
20482049 __LINE__);
drivers/net/wireless/iwlwifi/dvm/debugfs.c+3−0
@@ -124,6 +124,9 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file, · 123 unmodified lines
124124 const struct fw_img *img;
125125 size_t bufsz;
126126
127+ if (!iwl_is_ready_rf(priv))
128+ return -EAGAIN;
129+
127130 /* default is to dump the entire data segment */
128131 if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) {
129132 priv->dbgfs_sram_offset = 0x800000;
drivers/net/wireless/iwlwifi/pcie/internal.h+1−1
@@ -350,7 +350,7 @@ int iwl_queue_space(const struct iwl_queue *q); · 349 unmodified lines
350350 /*****************************************************
351351 * Error handling
352352 ******************************************************/
353−int iwl_dump_fh(struct iwl_trans *trans, char **buf, bool display);
353+int iwl_dump_fh(struct iwl_trans *trans, char **buf);
354354 void iwl_dump_csr(struct iwl_trans *trans);
355355
356356 /*****************************************************
drivers/net/wireless/iwlwifi/pcie/rx.c+1−1
@@ -555,7 +555,7 @@ static void iwl_irq_handle_error(struct iwl_trans *trans) · 554 unmodified lines
555555 }
556556
557557 iwl_dump_csr(trans);
558− iwl_dump_fh(trans, NULL, false);
558+ iwl_dump_fh(trans, NULL);
559559
560560 iwl_op_mode_nic_error(trans->op_mode);
561561 }
drivers/net/wireless/iwlwifi/pcie/trans.c+16−14
@@ -1649,13 +1649,9 @@ static const char *get_fh_string(int cmd) · 1648 unmodified lines
16491649 #undef IWL_CMD
16501650 }
16511651
1652−int iwl_dump_fh(struct iwl_trans *trans, char **buf, bool display)
1652+int iwl_dump_fh(struct iwl_trans *trans, char **buf)
16531653 {
16541654 int i;
1655−#ifdef CONFIG_IWLWIFI_DEBUG
1656− int pos = 0;
1657− size_t bufsz = 0;
1658−#endif
16591655 static const u32 fh_tbl[] = {
16601656 FH_RSCSR_CHNL0_STTS_WPTR_REG,
16611657 FH_RSCSR_CHNL0_RBDCB_BASE_REG,
@@ -1667,29 +1663,35 @@ int iwl_dump_fh(struct iwl_trans *trans, char **buf, bool display) · 5 unmodified lines
16671663 FH_TSSR_TX_STATUS_REG,
16681664 FH_TSSR_TX_ERROR_REG
16691665 };
1670−#ifdef CONFIG_IWLWIFI_DEBUG
1671− if (display) {
1672− bufsz = ARRAY_SIZE(fh_tbl) * 48 + 40;
1666+
1667+#ifdef CONFIG_IWLWIFI_DEBUGFS
1668+ if (buf) {
1669+ int pos = 0;
1670+ size_t bufsz = ARRAY_SIZE(fh_tbl) * 48 + 40;
1671+
16731672 *buf = kmalloc(bufsz, GFP_KERNEL);
16741673 if (!*buf)
16751674 return -ENOMEM;
1675+
16761676 pos += scnprintf(*buf + pos, bufsz - pos,
16771677 "FH register values:\n");
1678− for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) {
1678+
1679+ for (i = 0; i < ARRAY_SIZE(fh_tbl); i++)
16791680 pos += scnprintf(*buf + pos, bufsz - pos,
16801681 " %34s: 0X%08x\n",
16811682 get_fh_string(fh_tbl[i]),
16821683 iwl_read_direct32(trans, fh_tbl[i]));
1683− }
1684+
16841685 return pos;
16851686 }
16861687 #endif
1688+
16871689 IWL_ERR(trans, "FH register values:\n");
1688− for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) {
1690+ for (i = 0; i < ARRAY_SIZE(fh_tbl); i++)
16891691 IWL_ERR(trans, " %34s: 0X%08x\n",
16901692 get_fh_string(fh_tbl[i]),
16911693 iwl_read_direct32(trans, fh_tbl[i]));
1692− }
1694+
16931695 return 0;
16941696 }
16951697
@@ -1982,11 +1984,11 @@ static ssize_t iwl_dbgfs_fh_reg_read(struct file *file, · 286 unmodified lines
19821984 size_t count, loff_t *ppos)
19831985 {
19841986 struct iwl_trans *trans = file->private_data;
1985− char *buf;
1987+ char *buf = NULL;
19861988 int pos = 0;
19871989 ssize_t ret = -EFAULT;
19881990
1989− ret = pos = iwl_dump_fh(trans, &buf, true);
1991+ ret = pos = iwl_dump_fh(trans, &buf);
19901992 if (buf) {
19911993 ret = simple_read_from_buffer(user_buf,
19921994 count, ppos, buf, pos);
drivers/net/xen-netfront.c+10−29
@@ -57,8 +57,7 @@ · 56 unmodified lines
5757 static const struct ethtool_ops xennet_ethtool_ops;
5858
5959 struct netfront_cb {
60− struct page *page;
61− unsigned offset;
60+ int pull_to;
6261 };
6362
6463 #define NETFRONT_SKB_CB(skb) ((struct netfront_cb *)((skb)->cb))
@@ -867,15 +866,9 @@ static int handle_incoming_queue(struct net_device *dev, · 802 unmodified lines
867866 struct sk_buff *skb;
868867
869868 while ((skb = __skb_dequeue(rxq)) != NULL) {
870− struct page *page = NETFRONT_SKB_CB(skb)->page;
871− void *vaddr = page_address(page);
872− unsigned offset = NETFRONT_SKB_CB(skb)->offset;
873−
874− memcpy(skb->data, vaddr + offset,
875− skb_headlen(skb));
869+ int pull_to = NETFRONT_SKB_CB(skb)->pull_to;
876870
877− if (page != skb_frag_page(&skb_shinfo(skb)->frags[0]))
878− __free_page(page);
871+ __pskb_pull_tail(skb, pull_to - skb_headlen(skb));
879872
880873 /* Ethernet work: Delayed to here as it peeks the header. */
881874 skb->protocol = eth_type_trans(skb, dev);
@@ -913,7 +906,6 @@ static int xennet_poll(struct napi_struct *napi, int budget) · 31 unmodified lines
913906 struct sk_buff_head errq;
914907 struct sk_buff_head tmpq;
915908 unsigned long flags;
916− unsigned int len;
917909 int err;
918910
919911 spin_lock(&np->rx_lock);
@@ -955,24 +947,13 @@ err: · 35 unmodified lines
955947 }
956948 }
957949
958− NETFRONT_SKB_CB(skb)->page =
959− skb_frag_page(&skb_shinfo(skb)->frags[0]);
960− NETFRONT_SKB_CB(skb)->offset = rx->offset;
961−
962− len = rx->status;
963− if (len > RX_COPY_THRESHOLD)
964− len = RX_COPY_THRESHOLD;
965− skb_put(skb, len);
950+ NETFRONT_SKB_CB(skb)->pull_to = rx->status;
951+ if (NETFRONT_SKB_CB(skb)->pull_to > RX_COPY_THRESHOLD)
952+ NETFRONT_SKB_CB(skb)->pull_to = RX_COPY_THRESHOLD;
966953
967− if (rx->status > len) {
968− skb_shinfo(skb)->frags[0].page_offset =
969− rx->offset + len;
970− skb_frag_size_set(&skb_shinfo(skb)->frags[0], rx->status - len);
971− skb->data_len = rx->status - len;
972− } else {
973− __skb_fill_page_desc(skb, 0, NULL, 0, 0);
974− skb_shinfo(skb)->nr_frags = 0;
975− }
954+ skb_shinfo(skb)->frags[0].page_offset = rx->offset;
955+ skb_frag_size_set(&skb_shinfo(skb)->frags[0], rx->status);
956+ skb->data_len = rx->status;
976957
977958 i = xennet_fill_frags(np, skb, &tmpq);
978959
@@ -999,7 +980,7 @@ err: · 20 unmodified lines
999980 * receive throughout using the standard receive
1000981 * buffer size was cut by 25%(!!!).
1001982 */
1002− skb->truesize += skb->data_len - (RX_COPY_THRESHOLD - len);
983+ skb->truesize += skb->data_len - RX_COPY_THRESHOLD;
1003984 skb->len += skb->data_len;
1004985
1005986 if (rx->flags & XEN_NETRXF_csum_blank)
drivers/pci/pci-driver.c+6−0
@@ -280,8 +280,12 @@ static long local_pci_probe(void *_ddi) · 279 unmodified lines
280280 {
281281 struct drv_dev_and_id *ddi = _ddi;
282282 struct device *dev = &ddi->dev->dev;
283+ struct device *parent = dev->parent;
283284 int rc;
284285
286+ /* The parent bridge must be in active state when probing */
287+ if (parent)
288+ pm_runtime_get_sync(parent);
285289 /* Unbound PCI devices are always set to disabled and suspended.
286290 * During probe, the device is set to enabled and active and the
287291 * usage count is incremented. If the driver supports runtime PM,
@@ -298,6 +302,8 @@ static long local_pci_probe(void *_ddi) · 10 unmodified lines
298302 pm_runtime_set_suspended(dev);
299303 pm_runtime_put_noidle(dev);
300304 }
305+ if (parent)
306+ pm_runtime_put(parent);
301307 return rc;
302308 }
303309
drivers/pci/pci-sysfs.c+42−0
@@ -458,6 +458,40 @@ boot_vga_show(struct device *dev, struct device_attribute *attr, char *buf) · 457 unmodified lines
458458 }
459459 struct device_attribute vga_attr = __ATTR_RO(boot_vga);
460460
461+static void
462+pci_config_pm_runtime_get(struct pci_dev *pdev)
463+{
464+ struct device *dev = &pdev->dev;
465+ struct device *parent = dev->parent;
466+
467+ if (parent)
468+ pm_runtime_get_sync(parent);
469+ pm_runtime_get_noresume(dev);
470+ /*
471+ * pdev->current_state is set to PCI_D3cold during suspending,
472+ * so wait until suspending completes
473+ */
474+ pm_runtime_barrier(dev);
475+ /*
476+ * Only need to resume devices in D3cold, because config
477+ * registers are still accessible for devices suspended but
478+ * not in D3cold.
479+ */
480+ if (pdev->current_state == PCI_D3cold)
481+ pm_runtime_resume(dev);
482+}
483+
484+static void
485+pci_config_pm_runtime_put(struct pci_dev *pdev)
486+{
487+ struct device *dev = &pdev->dev;
488+ struct device *parent = dev->parent;
489+
490+ pm_runtime_put(dev);
491+ if (parent)
492+ pm_runtime_put_sync(parent);
493+}
494+
461495 static ssize_t
462496 pci_read_config(struct file *filp, struct kobject *kobj,
463497 struct bin_attribute *bin_attr,
@@ -484,6 +518,8 @@ pci_read_config(struct file *filp, struct kobject *kobj, · 20 unmodified lines
484518 size = count;
485519 }
486520
521+ pci_config_pm_runtime_get(dev);
522+
487523 if ((off & 1) && size) {
488524 u8 val;
489525 pci_user_read_config_byte(dev, off, &val);
@@ -529,6 +565,8 @@ pci_read_config(struct file *filp, struct kobject *kobj, · 39 unmodified lines
529565 --size;
530566 }
531567
568+ pci_config_pm_runtime_put(dev);
569+
532570 return count;
533571 }
534572
@@ -549,6 +587,8 @@ pci_write_config(struct file* filp, struct kobject *kobj, · 14 unmodified lines
549587 count = size;
550588 }
551589
590+ pci_config_pm_runtime_get(dev);
591+
552592 if ((off & 1) && size) {
553593 pci_user_write_config_byte(dev, off, data[off - init_off]);
554594 off++;
@@ -587,6 +627,8 @@ pci_write_config(struct file* filp, struct kobject *kobj, · 32 unmodified lines
587627 --size;
588628 }
589629
630+ pci_config_pm_runtime_put(dev);
631+
590632 return count;
591633 }
592634
drivers/pci/pci.c+1−0
@@ -1941,6 +1941,7 @@ void pci_pm_init(struct pci_dev *dev) · 1940 unmodified lines
19411941 dev->pm_cap = pm;
19421942 dev->d3_delay = PCI_PM_D3_WAIT;
19431943 dev->d3cold_delay = PCI_PM_D3COLD_WAIT;
1944+ dev->d3cold_allowed = true;
19441945
19451946 dev->d1_support = false;
19461947 dev->d2_support = false;
drivers/pci/pcie/portdrv_pci.c+14−0
@@ -140,9 +140,17 @@ static int pcie_port_runtime_resume(struct device *dev) · 139 unmodified lines
140140 {
141141 return 0;
142142 }
143+
144+static int pcie_port_runtime_idle(struct device *dev)
145+{
146+ /* Delay for a short while to prevent too frequent suspend/resume */
147+ pm_schedule_suspend(dev, 10);
148+ return -EBUSY;
149+}
143150 #else
144151 #define pcie_port_runtime_suspend NULL
145152 #define pcie_port_runtime_resume NULL
153+#define pcie_port_runtime_idle NULL
146154 #endif
147155
148156 static const struct dev_pm_ops pcie_portdrv_pm_ops = {
@@ -155,6 +163,7 @@ static const struct dev_pm_ops pcie_portdrv_pm_ops = { · 6 unmodified lines
155163 .resume_noirq = pcie_port_resume_noirq,
156164 .runtime_suspend = pcie_port_runtime_suspend,
157165 .runtime_resume = pcie_port_runtime_resume,
166+ .runtime_idle = pcie_port_runtime_idle,
158167 };
159168
160169 #define PCIE_PORTDRV_PM_OPS (&pcie_portdrv_pm_ops)
@@ -200,6 +209,11 @@ static int __devinit pcie_portdrv_probe(struct pci_dev *dev, · 39 unmodified lines
200209 return status;
201210
202211 pci_save_state(dev);
212+ /*
213+ * D3cold may not work properly on some PCIe port, so disable
214+ * it by default.
215+ */
216+ dev->d3cold_allowed = false;
203217 if (!pci_match_id(port_runtime_pm_black_list, dev))
204218 pm_runtime_put_noidle(&dev->dev);
205219
drivers/pci/probe.c+17−14
@@ -144,15 +144,13 @@ static inline unsigned long decode_bar(struct pci_dev *dev, u32 bar) · 143 unmodified lines
144144 case PCI_BASE_ADDRESS_MEM_TYPE_32:
145145 break;
146146 case PCI_BASE_ADDRESS_MEM_TYPE_1M:
147− dev_info(&dev->dev, "1M mem BAR treated as 32-bit BAR\n");
147+ /* 1M mem BAR treated as 32-bit BAR */
148148 break;
149149 case PCI_BASE_ADDRESS_MEM_TYPE_64:
150150 flags |= IORESOURCE_MEM_64;
151151 break;
152152 default:
153− dev_warn(&dev->dev,
154− "mem unknown type %x treated as 32-bit BAR\n",
155− mem_type);
153+ /* mem unknown type treated as 32-bit BAR */
156154 break;
157155 }
158156 return flags;
@@ -173,9 +171,11 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, · 14 unmodified lines
173171 u32 l, sz, mask;
174172 u16 orig_cmd;
175173 struct pci_bus_region region;
174+ bool bar_too_big = false, bar_disabled = false;
176175
177176 mask = type ? PCI_ROM_ADDRESS_MASK : ~0;
178177
178+ /* No printks while decoding is disabled! */
179179 if (!dev->mmio_always_on) {
180180 pci_read_config_word(dev, PCI_COMMAND, &orig_cmd);
181181 pci_write_config_word(dev, PCI_COMMAND,
@@ -240,8 +240,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, · 58 unmodified lines
240240 goto fail;
241241
242242 if ((sizeof(resource_size_t) < 8) && (sz64 > 0x100000000ULL)) {
243− dev_err(&dev->dev, "reg %x: can't handle 64-bit BAR\n",
244− pos);
243+ bar_too_big = true;
245244 goto fail;
246245 }
247246
@@ -252,12 +251,11 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, · 4 unmodified lines
252251 region.start = 0;
253252 region.end = sz64;
254253 pcibios_bus_to_resource(dev, res, &region);
254+ bar_disabled = true;
255255 } else {
256256 region.start = l64;
257257 region.end = l64 + sz64;
258258 pcibios_bus_to_resource(dev, res, &region);
259− dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n",
260− pos, res);
261259 }
262260 } else {
263261 sz = pci_size(l, sz, mask);
@@ -268,18 +266,23 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, · 4 unmodified lines
268266 region.start = l;
269267 region.end = l + sz;
270268 pcibios_bus_to_resource(dev, res, &region);
271−
272− dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", pos, res);
273269 }
274270
275− out:
271+ goto out;
272+
273+
274+fail:
275+ res->flags = 0;
276+out:
276277 if (!dev->mmio_always_on)
277278 pci_write_config_word(dev, PCI_COMMAND, orig_cmd);
278279
280+ if (bar_too_big)
281+ dev_err(&dev->dev, "reg %x: can't handle 64-bit BAR\n", pos);
282+ if (res->flags && !bar_disabled)
283+ dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", pos, res);
284+
279285 return (res->flags & IORESOURCE_MEM_64) ? 1 : 0;
280− fail:
281− res->flags = 0;
282− goto out;
283286 }
284287
285288 static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
drivers/rtc/rtc-at91sam9.c+15−7
@@ -58,6 +58,7 @@ struct sam9_rtc { · 57 unmodified lines
5858 struct rtc_device *rtcdev;
5959 u32 imr;
6060 void __iomem *gpbr;
61+ int irq;
6162 };
6263
6364 #define rtt_readl(rtc, field) \
@@ -292,7 +293,7 @@ static int __devinit at91_rtc_probe(struct platform_device *pdev) · 228 unmodified lines
292293 {
293294 struct resource *r, *r_gpbr;
294295 struct sam9_rtc *rtc;
295− int ret;
296+ int ret, irq;
296297 u32 mr;
297298
298299 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -302,10 +303,18 @@ static int __devinit at91_rtc_probe(struct platform_device *pdev) · 3 unmodified lines
302303 return -ENODEV;
303304 }
304305
306+ irq = platform_get_irq(pdev, 0);
307+ if (irq < 0) {
308+ dev_err(&pdev->dev, "failed to get interrupt resource\n");
309+ return irq;
310+ }
311+
305312 rtc = kzalloc(sizeof *rtc, GFP_KERNEL);
306313 if (!rtc)
307314 return -ENOMEM;
308315
316+ rtc->irq = irq;
317+
309318 /* platform setup code should have handled this; sigh */
310319 if (!device_can_wakeup(&pdev->dev))
311320 device_init_wakeup(&pdev->dev, 1);
@@ -345,11 +354,10 @@ static int __devinit at91_rtc_probe(struct platform_device *pdev) · 33 unmodified lines
345354 }
346355
347356 /* register irq handler after we know what name we'll use */
348− ret = request_irq(AT91_ID_SYS, at91_rtc_interrupt,
349− IRQF_SHARED,
357+ ret = request_irq(rtc->irq, at91_rtc_interrupt, IRQF_SHARED,
350358 dev_name(&rtc->rtcdev->dev), rtc);
351359 if (ret) {
352− dev_dbg(&pdev->dev, "can't share IRQ %d?\n", AT91_ID_SYS);
360+ dev_dbg(&pdev->dev, "can't share IRQ %d?\n", rtc->irq);
353361 rtc_device_unregister(rtc->rtcdev);
354362 goto fail_register;
355363 }
@@ -386,7 +394,7 @@ static int __devexit at91_rtc_remove(struct platform_device *pdev) · 30 unmodified lines
386394
387395 /* disable all interrupts */
388396 rtt_writel(rtc, MR, mr & ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN));
389− free_irq(AT91_ID_SYS, rtc);
397+ free_irq(rtc->irq, rtc);
390398
391399 rtc_device_unregister(rtc->rtcdev);
392400
@@ -423,7 +431,7 @@ static int at91_rtc_suspend(struct platform_device *pdev, · 30 unmodified lines
423431 rtc->imr = mr & (AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN);
424432 if (rtc->imr) {
425433 if (device_may_wakeup(&pdev->dev) && (mr & AT91_RTT_ALMIEN)) {
426− enable_irq_wake(AT91_ID_SYS);
434+ enable_irq_wake(rtc->irq);
427435 /* don't let RTTINC cause wakeups */
428436 if (mr & AT91_RTT_RTTINCIEN)
429437 rtt_writel(rtc, MR, mr & ~AT91_RTT_RTTINCIEN);
@@ -441,7 +449,7 @@ static int at91_rtc_resume(struct platform_device *pdev) · 11 unmodified lines
441449
442450 if (rtc->imr) {
443451 if (device_may_wakeup(&pdev->dev))
444− disable_irq_wake(AT91_ID_SYS);
452+ disable_irq_wake(rtc->irq);
445453 mr = rtt_readl(rtc, MR);
446454 rtt_writel(rtc, MR, mr | rtc->imr);
447455 }
drivers/s390/block/dasd_eckd.c+1−1
@@ -3804,7 +3804,7 @@ dasd_eckd_ioctl(struct dasd_block *block, unsigned int cmd, void __user *argp) · 3803 unmodified lines
38043804 case BIODASDSYMMIO:
38053805 return dasd_symm_io(device, argp);
38063806 default:
3807− return -ENOIOCTLCMD;
3807+ return -ENOTTY;
38083808 }
38093809 }
38103810
drivers/s390/block/dasd_ioctl.c+2−5
@@ -498,12 +498,9 @@ int dasd_ioctl(struct block_device *bdev, fmode_t mode, · 497 unmodified lines
498498 break;
499499 default:
500500 /* if the discipline has an ioctl method try it. */
501− if (base->discipline->ioctl) {
501+ rc = -ENOTTY;
502+ if (base->discipline->ioctl)
502503 rc = base->discipline->ioctl(block, cmd, argp);
503− if (rc == -ENOIOCTLCMD)
504− rc = -EINVAL;
505− } else
506− rc = -EINVAL;
507504 }
508505 dasd_put_device(base);
509506 return rc;
drivers/spi/spi-bcm63xx.c+26−5
@@ -47,6 +47,8 @@ struct bcm63xx_spi { · 46 unmodified lines
4747 /* Platform data */
4848 u32 speed_hz;
4949 unsigned fifo_size;
50+ unsigned int msg_type_shift;
51+ unsigned int msg_ctl_width;
5052
5153 /* Data buffers */
5254 const unsigned char *tx_ptr;
@@ -221,13 +223,20 @@ static unsigned int bcm63xx_txrx_bufs(struct spi_device *spi, · 168 unmodified lines
221223 msg_ctl = (t->len << SPI_BYTE_CNT_SHIFT);
222224
223225 if (t->rx_buf && t->tx_buf)
224− msg_ctl |= (SPI_FD_RW << SPI_MSG_TYPE_SHIFT);
226+ msg_ctl |= (SPI_FD_RW << bs->msg_type_shift);
225227 else if (t->rx_buf)
226− msg_ctl |= (SPI_HD_R << SPI_MSG_TYPE_SHIFT);
228+ msg_ctl |= (SPI_HD_R << bs->msg_type_shift);
227229 else if (t->tx_buf)
228− msg_ctl |= (SPI_HD_W << SPI_MSG_TYPE_SHIFT);
229−
230− bcm_spi_writew(bs, msg_ctl, SPI_MSG_CTL);
230+ msg_ctl |= (SPI_HD_W << bs->msg_type_shift);
231+
232+ switch (bs->msg_ctl_width) {
233+ case 8:
234+ bcm_spi_writeb(bs, msg_ctl, SPI_MSG_CTL);
235+ break;
236+ case 16:
237+ bcm_spi_writew(bs, msg_ctl, SPI_MSG_CTL);
238+ break;
239+ }
231240
232241 /* Issue the transfer */
233242 cmd = SPI_CMD_START_IMMEDIATE;
@@ -406,9 +415,21 @@ static int __devinit bcm63xx_spi_probe(struct platform_device *pdev) · 172 unmodified lines
406415 master->transfer_one_message = bcm63xx_spi_transfer_one;
407416 master->mode_bits = MODEBITS;
408417 bs->speed_hz = pdata->speed_hz;
418+ bs->msg_type_shift = pdata->msg_type_shift;
419+ bs->msg_ctl_width = pdata->msg_ctl_width;
409420 bs->tx_io = (u8 *)(bs->regs + bcm63xx_spireg(SPI_MSG_DATA));
410421 bs->rx_io = (const u8 *)(bs->regs + bcm63xx_spireg(SPI_RX_DATA));
411422
423+ switch (bs->msg_ctl_width) {
424+ case 8:
425+ case 16:
426+ break;
427+ default:
428+ dev_err(dev, "unsupported MSG_CTL width: %d\n",
429+ bs->msg_ctl_width);
430+ goto out_clk_disable;
431+ }
432+
412433 /* Initialize hardware */
413434 clk_enable(bs->clk);
414435 bcm_spi_writeb(bs, SPI_INTR_CLEAR_ALL, SPI_INT_STATUS);
drivers/video/auo_k190x.c+0−2
@@ -987,7 +987,6 @@ err_regfb: · 986 unmodified lines
987987 fb_dealloc_cmap(&info->cmap);
988988 err_cmap:
989989 fb_deferred_io_cleanup(info);
990− kfree(info->fbdefio);
991990 err_defio:
992991 vfree((void *)info->screen_base);
993992 err_irq:
@@ -1022,7 +1021,6 @@ int __devexit auok190x_common_remove(struct platform_device *pdev) · 28 unmodified lines
10221021 fb_dealloc_cmap(&info->cmap);
10231022
10241023 fb_deferred_io_cleanup(info);
1025− kfree(info->fbdefio);
10261024
10271025 vfree((void *)info->screen_base);
10281026
drivers/video/backlight/omap1_bl.c+1−1
@@ -27,9 +27,9 @@ · 26 unmodified lines
2727 #include <linux/fb.h>
2828 #include <linux/backlight.h>
2929 #include <linux/slab.h>
30+#include <linux/platform_data/omap1_bl.h>
3031
3132 #include <mach/hardware.h>
32−#include <plat/board.h>
3333 #include <plat/mux.h>
3434
3535 #define OMAPBL_MAX_INTENSITY 0xff
drivers/video/console/bitblit.c+1−1
@@ -162,7 +162,7 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info, · 161 unmodified lines
162162 image.depth = 1;
163163
164164 if (attribute) {
165− buf = kmalloc(cellsize, GFP_KERNEL);
165+ buf = kmalloc(cellsize, GFP_ATOMIC);
166166 if (!buf)
167167 return;
168168 }
drivers/video/console/fbcon.c+1−1
@@ -449,7 +449,7 @@ static int __init fb_console_setup(char *this_opt) · 448 unmodified lines
449449
450450 while ((options = strsep(&this_opt, ",")) != NULL) {
451451 if (!strncmp(options, "font:", 5))
452− strcpy(fontname, options + 5);
452+ strlcpy(fontname, options + 5, sizeof(fontname));
453453
454454 if (!strncmp(options, "scrollback:", 11)) {
455455 options += 11;
drivers/video/mb862xx/mb862xxfbdrv.c+2−0
@@ -328,6 +328,8 @@ static int mb862xxfb_ioctl(struct fb_info *fbi, unsigned int cmd, · 327 unmodified lines
328328 case MB862XX_L1_SET_CFG:
329329 if (copy_from_user(l1_cfg, argp, sizeof(*l1_cfg)))
330330 return -EFAULT;
331+ if (l1_cfg->dh == 0 || l1_cfg->dw == 0)
332+ return -EINVAL;
331333 if ((l1_cfg->sw >= l1_cfg->dw) && (l1_cfg->sh >= l1_cfg->dh)) {
332334 /* downscaling */
333335 outreg(cap, GC_CAP_CSC,
drivers/video/omap2/dss/sdi.c+14−0
@@ -105,6 +105,20 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) · 104 unmodified lines
105105
106106 sdi_config_lcd_manager(dssdev);
107107
108+ /*
109+ * LCLK and PCLK divisors are located in shadow registers, and we
110+ * normally write them to DISPC registers when enabling the output.
111+ * However, SDI uses pck-free as source clock for its PLL, and pck-free
112+ * is affected by the divisors. And as we need the PLL before enabling
113+ * the output, we need to write the divisors early.
114+ *
115+ * It seems just writing to the DISPC register is enough, and we don't
116+ * need to care about the shadow register mechanism for pck-free. The
117+ * exact reason for this is unknown.
118+ */
119+ dispc_mgr_set_clock_div(dssdev->manager->id,
120+ &sdi.mgr_config.clock_info);
121+
108122 dss_sdi_init(dssdev->phy.sdi.datapairs);
109123 r = dss_sdi_enable();
110124 if (r)
drivers/video/omap2/omapfb/omapfb-main.c+1−1
@@ -1192,7 +1192,7 @@ static int _setcolreg(struct fb_info *fbi, u_int regno, u_int red, u_int green, · 1191 unmodified lines
11921192 break;
11931193
11941194 if (regno < 16) {
1195− u16 pal;
1195+ u32 pal;
11961196 pal = ((red >> (16 - var->red.length)) <<
11971197 var->red.offset) |
11981198 ((green >> (16 - var->green.length)) <<
drivers/watchdog/booke_wdt.c+3−4
@@ -166,18 +166,17 @@ static long booke_wdt_ioctl(struct file *file, · 165 unmodified lines
166166
167167 switch (cmd) {
168168 case WDIOC_GETSUPPORT:
169− if (copy_to_user((void *)arg, &ident, sizeof(ident)))
170− return -EFAULT;
169+ return copy_to_user(p, &ident, sizeof(ident)) ? -EFAULT : 0;
171170 case WDIOC_GETSTATUS:
172171 return put_user(0, p);
173172 case WDIOC_GETBOOTSTATUS:
174173 /* XXX: something is clearing TSR */
175174 tmp = mfspr(SPRN_TSR) & TSR_WRS(3);
176175 /* returns CARDRESET if last reset was caused by the WDT */
177− return (tmp ? WDIOF_CARDRESET : 0);
176+ return put_user((tmp ? WDIOF_CARDRESET : 0), p);
178177 case WDIOC_SETOPTIONS:
179178 if (get_user(tmp, p))
180− return -EINVAL;
179+ return -EFAULT;
181180 if (tmp == WDIOS_ENABLECARD) {
182181 booke_wdt_ping();
183182 break;
drivers/watchdog/da9052_wdt.c+0−1
@@ -21,7 +21,6 @@ · 20 unmodified lines
2121 #include <linux/types.h>
2222 #include <linux/kernel.h>
2323 #include <linux/jiffies.h>
24−#include <linux/delay.h>
2524
2625 #include <linux/mfd/da9052/reg.h>
2726 #include <linux/mfd/da9052/da9052.h>
drivers/xen/platform-pci.c+0−15
@@ -101,19 +101,6 @@ static int platform_pci_resume(struct pci_dev *pdev) · 100 unmodified lines
101101 return 0;
102102 }
103103
104−static void __devinit prepare_shared_info(void)
105−{
106−#ifdef CONFIG_KEXEC
107− unsigned long addr;
108− struct shared_info *hvm_shared_info;
109−
110− addr = alloc_xen_mmio(PAGE_SIZE);
111− hvm_shared_info = ioremap(addr, PAGE_SIZE);
112− memset(hvm_shared_info, 0, PAGE_SIZE);
113− xen_hvm_prepare_kexec(hvm_shared_info, addr >> PAGE_SHIFT);
114−#endif
115−}
116−
117104 static int __devinit platform_pci_init(struct pci_dev *pdev,
118105 const struct pci_device_id *ent)
119106 {
@@ -151,8 +138,6 @@ static int __devinit platform_pci_init(struct pci_dev *pdev, · 31 unmodified lines
151138 platform_mmio = mmio_addr;
152139 platform_mmiolen = mmio_len;
153140
154− prepare_shared_info();
155−
156141 if (!xen_have_vector_callback) {
157142 ret = xen_allocate_irq(pdev);
158143 if (ret) {
drivers/xen/swiotlb-xen.c+1−1
@@ -232,7 +232,7 @@ xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size, · 231 unmodified lines
232232 return ret;
233233
234234 if (hwdev && hwdev->coherent_dma_mask)
235− dma_mask = hwdev->coherent_dma_mask;
235+ dma_mask = dma_alloc_coherent_mask(hwdev, flags);
236236
237237 phys = virt_to_phys(ret);
238238 dev_addr = xen_phys_to_bus(phys);
drivers/xen/xen-pciback/pci_stub.c+4−4
@@ -353,16 +353,16 @@ static int __devinit pcistub_init_device(struct pci_dev *dev) · 352 unmodified lines
353353 if (err)
354354 goto config_release;
355355
356− dev_dbg(&dev->dev, "reseting (FLR, D3, etc) the device\n");
357− __pci_reset_function_locked(dev);
358−
359356 /* We need the device active to save the state. */
360357 dev_dbg(&dev->dev, "save state of device\n");
361358 pci_save_state(dev);
362359 dev_data->pci_saved_state = pci_store_saved_state(dev);
363360 if (!dev_data->pci_saved_state)
364361 dev_err(&dev->dev, "Could not store PCI conf saved state!\n");
365−
362+ else {
363+ dev_dbg(&dev->dev, "reseting (FLR, D3, etc) the device\n");
364+ __pci_reset_function_locked(dev);
365+ }
366366 /* Now disable the device (this also ensures some private device
367367 * data is setup before we export)
368368 */
fs/bio.c+6−5
@@ -73,7 +73,7 @@ static struct kmem_cache *bio_find_or_create_slab(unsigned int extra_size) · 72 unmodified lines
7373 {
7474 unsigned int sz = sizeof(struct bio) + extra_size;
7575 struct kmem_cache *slab = NULL;
76− struct bio_slab *bslab;
76+ struct bio_slab *bslab, *new_bio_slabs;
7777 unsigned int i, entry = -1;
7878
7979 mutex_lock(&bio_slab_lock);
@@ -97,11 +97,12 @@ static struct kmem_cache *bio_find_or_create_slab(unsigned int extra_size) · 17 unmodified lines
9797
9898 if (bio_slab_nr == bio_slab_max && entry == -1) {
9999 bio_slab_max <<= 1;
100− bio_slabs = krealloc(bio_slabs,
101− bio_slab_max * sizeof(struct bio_slab),
102− GFP_KERNEL);
103− if (!bio_slabs)
100+ new_bio_slabs = krealloc(bio_slabs,
101+ bio_slab_max * sizeof(struct bio_slab),
102+ GFP_KERNEL);
103+ if (!new_bio_slabs)
104104 goto out_unlock;
105+ bio_slabs = new_bio_slabs;
105106 }
106107 if (entry == -1)
107108 entry = bio_slab_nr++;
fs/block_dev.c+3−0
@@ -1578,10 +1578,12 @@ ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, · 1577 unmodified lines
15781578 unsigned long nr_segs, loff_t pos)
15791579 {
15801580 struct file *file = iocb->ki_filp;
1581+ struct blk_plug plug;
15811582 ssize_t ret;
15821583
15831584 BUG_ON(iocb->ki_pos != pos);
15841585
1586+ blk_start_plug(&plug);
15851587 ret = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos);
15861588 if (ret > 0 || ret == -EIOCBQUEUED) {
15871589 ssize_t err;
@@ -1590,6 +1592,7 @@ ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, · 2 unmodified lines
15901592 if (err < 0 && ret > 0)
15911593 ret = err;
15921594 }
1595+ blk_finish_plug(&plug);
15931596 return ret;
15941597 }
15951598 EXPORT_SYMBOL_GPL(blkdev_aio_write);
fs/btrfs/backref.c+2−2
@@ -1438,10 +1438,10 @@ int iterate_inodes_from_logical(u64 logical, struct btrfs_fs_info *fs_info, · 1437 unmodified lines
14381438 ret = extent_from_logical(fs_info, logical, path,
14391439 &found_key);
14401440 btrfs_release_path(path);
1441− if (ret & BTRFS_EXTENT_FLAG_TREE_BLOCK)
1442− ret = -EINVAL;
14431441 if (ret < 0)
14441442 return ret;
1443+ if (ret & BTRFS_EXTENT_FLAG_TREE_BLOCK)
1444+ return -EINVAL;
14451445
14461446 extent_item_pos = logical - found_key.objectid;
14471447 ret = iterate_extent_inodes(fs_info, found_key.objectid,
fs/btrfs/compression.c+1−0
@@ -818,6 +818,7 @@ static void free_workspace(int type, struct list_head *workspace) · 817 unmodified lines
818818 btrfs_compress_op[idx]->free_workspace(workspace);
819819 atomic_dec(alloc_workspace);
820820 wake:
821+ smp_mb();
821822 if (waitqueue_active(workspace_wait))
822823 wake_up(workspace_wait);
823824 }
fs/btrfs/ctree.c+3−6
@@ -420,12 +420,6 @@ void btrfs_put_tree_mod_seq(struct btrfs_fs_info *fs_info, · 419 unmodified lines
420420 }
421421 spin_unlock(&fs_info->tree_mod_seq_lock);
422422
423− /*
424− * we removed the lowest blocker from the blocker list, so there may be
425− * more processible delayed refs.
426− */
427− wake_up(&fs_info->tree_mod_seq_wait);
428−
429423 /*
430424 * anything that's lower than the lowest existing (read: blocked)
431425 * sequence number can be removed from the tree.
@@ -631,6 +625,9 @@ __tree_mod_log_free_eb(struct btrfs_fs_info *fs_info, struct extent_buffer *eb) · 199 unmodified lines
631625 u32 nritems;
632626 int ret;
633627
628+ if (btrfs_header_level(eb) == 0)
629+ return;
630+
634631 nritems = btrfs_header_nritems(eb);
635632 for (i = nritems - 1; i >= 0; i--) {
636633 ret = tree_mod_log_insert_key_locked(fs_info, eb, i,
fs/btrfs/ctree.h+1−2
@@ -1252,7 +1252,6 @@ struct btrfs_fs_info { · 1251 unmodified lines
12521252 atomic_t tree_mod_seq;
12531253 struct list_head tree_mod_seq_list;
12541254 struct seq_list tree_mod_seq_elem;
1255− wait_queue_head_t tree_mod_seq_wait;
12561255
12571256 /* this protects tree_mod_log */
12581257 rwlock_t tree_mod_log_lock;
@@ -3192,7 +3191,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans, · 1933 unmodified lines
31923191 int btrfs_lookup_bio_sums(struct btrfs_root *root, struct inode *inode,
31933192 struct bio *bio, u32 *dst);
31943193 int btrfs_lookup_bio_sums_dio(struct btrfs_root *root, struct inode *inode,
3195− struct bio *bio, u64 logical_offset, u32 *dst);
3194+ struct bio *bio, u64 logical_offset);
31963195 int btrfs_insert_file_extent(struct btrfs_trans_handle *trans,
31973196 struct btrfs_root *root,
31983197 u64 objectid, u64 pos,
fs/btrfs/delayed-inode.c+6−6
@@ -512,8 +512,8 @@ static void __btrfs_remove_delayed_item(struct btrfs_delayed_item *delayed_item) · 511 unmodified lines
512512
513513 rb_erase(&delayed_item->rb_node, root);
514514 delayed_item->delayed_node->count--;
515− atomic_dec(&delayed_root->items);
516− if (atomic_read(&delayed_root->items) < BTRFS_DELAYED_BACKGROUND &&
515+ if (atomic_dec_return(&delayed_root->items) <
516+ BTRFS_DELAYED_BACKGROUND &&
517517 waitqueue_active(&delayed_root->wait))
518518 wake_up(&delayed_root->wait);
519519 }
@@ -1028,9 +1028,10 @@ do_again: · 508 unmodified lines
10281028 btrfs_release_delayed_item(prev);
10291029 ret = 0;
10301030 btrfs_release_path(path);
1031− if (curr)
1031+ if (curr) {
1032+ mutex_unlock(&node->mutex);
10321033 goto do_again;
1033− else
1034+ } else
10341035 goto delete_fail;
10351036 }
10361037
@@ -1055,8 +1056,7 @@ static void btrfs_release_delayed_inode(struct btrfs_delayed_node *delayed_node) · 18 unmodified lines
10551056 delayed_node->count--;
10561057
10571058 delayed_root = delayed_node->root->fs_info->delayed_root;
1058− atomic_dec(&delayed_root->items);
1059− if (atomic_read(&delayed_root->items) <
1059+ if (atomic_dec_return(&delayed_root->items) <
10601060 BTRFS_DELAYED_BACKGROUND &&
10611061 waitqueue_active(&delayed_root->wait))
10621062 wake_up(&delayed_root->wait);
fs/btrfs/delayed-ref.c+128−35
@@ -38,17 +38,14 @@ · 37 unmodified lines
3838 static int comp_tree_refs(struct btrfs_delayed_tree_ref *ref2,
3939 struct btrfs_delayed_tree_ref *ref1)
4040 {
41− if (ref1->node.type == BTRFS_TREE_BLOCK_REF_KEY) {
42− if (ref1->root < ref2->root)
43− return -1;
44− if (ref1->root > ref2->root)
45− return 1;
46− } else {
47− if (ref1->parent < ref2->parent)
48− return -1;
49− if (ref1->parent > ref2->parent)
50− return 1;
51− }
41+ if (ref1->root < ref2->root)
42+ return -1;
43+ if (ref1->root > ref2->root)
44+ return 1;
45+ if (ref1->parent < ref2->parent)
46+ return -1;
47+ if (ref1->parent > ref2->parent)
48+ return 1;
5249 return 0;
5350 }
5451
@@ -85,7 +82,8 @@ static int comp_data_refs(struct btrfs_delayed_data_ref *ref2, · 30 unmodified lines
8582 * type of the delayed backrefs and content of delayed backrefs.
8683 */
8784 static int comp_entry(struct btrfs_delayed_ref_node *ref2,
88− struct btrfs_delayed_ref_node *ref1)
85+ struct btrfs_delayed_ref_node *ref1,
86+ bool compare_seq)
8987 {
9088 if (ref1->bytenr < ref2->bytenr)
9189 return -1;
@@ -102,10 +100,12 @@ static int comp_entry(struct btrfs_delayed_ref_node *ref2, · 10 unmodified lines
102100 if (ref1->type > ref2->type)
103101 return 1;
104102 /* merging of sequenced refs is not allowed */
105− if (ref1->seq < ref2->seq)
106− return -1;
107− if (ref1->seq > ref2->seq)
108− return 1;
103+ if (compare_seq) {
104+ if (ref1->seq < ref2->seq)
105+ return -1;
106+ if (ref1->seq > ref2->seq)
107+ return 1;
108+ }
109109 if (ref1->type == BTRFS_TREE_BLOCK_REF_KEY ||
110110 ref1->type == BTRFS_SHARED_BLOCK_REF_KEY) {
111111 return comp_tree_refs(btrfs_delayed_node_to_tree_ref(ref2),
@@ -139,7 +139,7 @@ static struct btrfs_delayed_ref_node *tree_insert(struct rb_root *root, · 27 unmodified lines
139139 entry = rb_entry(parent_node, struct btrfs_delayed_ref_node,
140140 rb_node);
141141
142− cmp = comp_entry(entry, ins);
142+ cmp = comp_entry(entry, ins, 1);
143143 if (cmp < 0)
144144 p = &(*p)->rb_left;
145145 else if (cmp > 0)
@@ -233,6 +233,114 @@ int btrfs_delayed_ref_lock(struct btrfs_trans_handle *trans, · 87 unmodified lines
233233 return 0;
234234 }
235235
236+static void inline drop_delayed_ref(struct btrfs_trans_handle *trans,
237+ struct btrfs_delayed_ref_root *delayed_refs,
238+ struct btrfs_delayed_ref_node *ref)
239+{
240+ rb_erase(&ref->rb_node, &delayed_refs->root);
241+ ref->in_tree = 0;
242+ btrfs_put_delayed_ref(ref);
243+ delayed_refs->num_entries--;
244+ if (trans->delayed_ref_updates)
245+ trans->delayed_ref_updates--;
246+}
247+
248+static int merge_ref(struct btrfs_trans_handle *trans,
249+ struct btrfs_delayed_ref_root *delayed_refs,
250+ struct btrfs_delayed_ref_node *ref, u64 seq)
251+{
252+ struct rb_node *node;
253+ int merged = 0;
254+ int mod = 0;
255+ int done = 0;
256+
257+ node = rb_prev(&ref->rb_node);
258+ while (node) {
259+ struct btrfs_delayed_ref_node *next;
260+
261+ next = rb_entry(node, struct btrfs_delayed_ref_node, rb_node);
262+ node = rb_prev(node);
263+ if (next->bytenr != ref->bytenr)
264+ break;
265+ if (seq && next->seq >= seq)
266+ break;
267+ if (comp_entry(ref, next, 0))
268+ continue;
269+
270+ if (ref->action == next->action) {
271+ mod = next->ref_mod;
272+ } else {
273+ if (ref->ref_mod < next->ref_mod) {
274+ struct btrfs_delayed_ref_node *tmp;
275+
276+ tmp = ref;
277+ ref = next;
278+ next = tmp;
279+ done = 1;
280+ }
281+ mod = -next->ref_mod;
282+ }
283+
284+ merged++;
285+ drop_delayed_ref(trans, delayed_refs, next);
286+ ref->ref_mod += mod;
287+ if (ref->ref_mod == 0) {
288+ drop_delayed_ref(trans, delayed_refs, ref);
289+ break;
290+ } else {
291+ /*
292+ * You can't have multiples of the same ref on a tree
293+ * block.
294+ */
295+ WARN_ON(ref->type == BTRFS_TREE_BLOCK_REF_KEY ||
296+ ref->type == BTRFS_SHARED_BLOCK_REF_KEY);
297+ }
298+
299+ if (done)
300+ break;
301+ node = rb_prev(&ref->rb_node);
302+ }
303+
304+ return merged;
305+}
306+
307+void btrfs_merge_delayed_refs(struct btrfs_trans_handle *trans,
308+ struct btrfs_fs_info *fs_info,
309+ struct btrfs_delayed_ref_root *delayed_refs,
310+ struct btrfs_delayed_ref_head *head)
311+{
312+ struct rb_node *node;
313+ u64 seq = 0;
314+
315+ spin_lock(&fs_info->tree_mod_seq_lock);
316+ if (!list_empty(&fs_info->tree_mod_seq_list)) {
317+ struct seq_list *elem;
318+
319+ elem = list_first_entry(&fs_info->tree_mod_seq_list,
320+ struct seq_list, list);
321+ seq = elem->seq;
322+ }
323+ spin_unlock(&fs_info->tree_mod_seq_lock);
324+
325+ node = rb_prev(&head->node.rb_node);
326+ while (node) {
327+ struct btrfs_delayed_ref_node *ref;
328+
329+ ref = rb_entry(node, struct btrfs_delayed_ref_node,
330+ rb_node);
331+ if (ref->bytenr != head->node.bytenr)
332+ break;
333+
334+ /* We can't merge refs that are outside of our seq count */
335+ if (seq && ref->seq >= seq)
336+ break;
337+ if (merge_ref(trans, delayed_refs, ref, seq))
338+ node = rb_prev(&head->node.rb_node);
339+ else
340+ node = rb_prev(node);
341+ }
342+}
343+
236344 int btrfs_check_delayed_seq(struct btrfs_fs_info *fs_info,
237345 struct btrfs_delayed_ref_root *delayed_refs,
238346 u64 seq)
@@ -336,18 +444,11 @@ update_existing_ref(struct btrfs_trans_handle *trans, · 97 unmodified lines
336444 * every changing the extent allocation tree.
337445 */
338446 existing->ref_mod--;
339− if (existing->ref_mod == 0) {
340− rb_erase(&existing->rb_node,
341− &delayed_refs->root);
342− existing->in_tree = 0;
343− btrfs_put_delayed_ref(existing);
344− delayed_refs->num_entries--;
345− if (trans->delayed_ref_updates)
346− trans->delayed_ref_updates--;
347− } else {
447+ if (existing->ref_mod == 0)
448+ drop_delayed_ref(trans, delayed_refs, existing);
449+ else
348450 WARN_ON(existing->type == BTRFS_TREE_BLOCK_REF_KEY ||
349451 existing->type == BTRFS_SHARED_BLOCK_REF_KEY);
350− }
351452 } else {
352453 WARN_ON(existing->type == BTRFS_TREE_BLOCK_REF_KEY ||
353454 existing->type == BTRFS_SHARED_BLOCK_REF_KEY);
@@ -662,9 +763,6 @@ int btrfs_add_delayed_tree_ref(struct btrfs_fs_info *fs_info, · 308 unmodified lines
662763 add_delayed_tree_ref(fs_info, trans, &ref->node, bytenr,
663764 num_bytes, parent, ref_root, level, action,
664765 for_cow);
665− if (!need_ref_seq(for_cow, ref_root) &&
666− waitqueue_active(&fs_info->tree_mod_seq_wait))
667− wake_up(&fs_info->tree_mod_seq_wait);
668766 spin_unlock(&delayed_refs->lock);
669767 if (need_ref_seq(for_cow, ref_root))
670768 btrfs_qgroup_record_ref(trans, &ref->node, extent_op);
@@ -713,9 +811,6 @@ int btrfs_add_delayed_data_ref(struct btrfs_fs_info *fs_info, · 42 unmodified lines
713811 add_delayed_data_ref(fs_info, trans, &ref->node, bytenr,
714812 num_bytes, parent, ref_root, owner, offset,
715813 action, for_cow);
716− if (!need_ref_seq(for_cow, ref_root) &&
717− waitqueue_active(&fs_info->tree_mod_seq_wait))
718− wake_up(&fs_info->tree_mod_seq_wait);
719814 spin_unlock(&delayed_refs->lock);
720815 if (need_ref_seq(for_cow, ref_root))
721816 btrfs_qgroup_record_ref(trans, &ref->node, extent_op);
@@ -744,8 +839,6 @@ int btrfs_add_delayed_extent_op(struct btrfs_fs_info *fs_info, · 22 unmodified lines
744839 num_bytes, BTRFS_UPDATE_DELAYED_HEAD,
745840 extent_op->is_data);
746841
747− if (waitqueue_active(&fs_info->tree_mod_seq_wait))
748− wake_up(&fs_info->tree_mod_seq_wait);
749842 spin_unlock(&delayed_refs->lock);
750843 return 0;
751844 }
fs/btrfs/delayed-ref.h+4−0
@@ -167,6 +167,10 @@ int btrfs_add_delayed_extent_op(struct btrfs_fs_info *fs_info, · 166 unmodified lines
167167 struct btrfs_trans_handle *trans,
168168 u64 bytenr, u64 num_bytes,
169169 struct btrfs_delayed_extent_op *extent_op);
170+void btrfs_merge_delayed_refs(struct btrfs_trans_handle *trans,
171+ struct btrfs_fs_info *fs_info,
172+ struct btrfs_delayed_ref_root *delayed_refs,
173+ struct btrfs_delayed_ref_head *head);
170174
171175 struct btrfs_delayed_ref_head *
172176 btrfs_find_delayed_ref_head(struct btrfs_trans_handle *trans, u64 bytenr);
fs/btrfs/disk-io.c+14−39
@@ -377,9 +377,13 @@ static int btree_read_extent_buffer_pages(struct btrfs_root *root, · 376 unmodified lines
377377 ret = read_extent_buffer_pages(io_tree, eb, start,
378378 WAIT_COMPLETE,
379379 btree_get_extent, mirror_num);
380− if (!ret && !verify_parent_transid(io_tree, eb,
380+ if (!ret) {
381+ if (!verify_parent_transid(io_tree, eb,
381382 parent_transid, 0))
382− break;
383+ break;
384+ else
385+ ret = -EIO;
386+ }
383387
384388 /*
385389 * This buffer's crc is fine, but its contents are corrupted, so
@@ -754,9 +758,7 @@ static void run_one_async_done(struct btrfs_work *work) · 368 unmodified lines
754758 limit = btrfs_async_submit_limit(fs_info);
755759 limit = limit * 2 / 3;
756760
757− atomic_dec(&fs_info->nr_async_submits);
758−
759− if (atomic_read(&fs_info->nr_async_submits) < limit &&
761+ if (atomic_dec_return(&fs_info->nr_async_submits) < limit &&
760762 waitqueue_active(&fs_info->async_submit_wait))
761763 wake_up(&fs_info->async_submit_wait);
762764
@@ -2032,8 +2034,6 @@ int open_ctree(struct super_block *sb, · 1269 unmodified lines
20322034 fs_info->free_chunk_space = 0;
20332035 fs_info->tree_mod_log = RB_ROOT;
20342036
2035− init_waitqueue_head(&fs_info->tree_mod_seq_wait);
2036−
20372037 /* readahead state */
20382038 INIT_RADIX_TREE(&fs_info->reada_tree, GFP_NOFS & ~__GFP_WAIT);
20392039 spin_lock_init(&fs_info->reada_lock);
@@ -2528,8 +2528,7 @@ retry_root_backup: · 488 unmodified lines
25282528 goto fail_trans_kthread;
25292529
25302530 /* do not make disk changes in broken FS */
2531− if (btrfs_super_log_root(disk_super) != 0 &&
2532− !(fs_info->fs_state & BTRFS_SUPER_FLAG_ERROR)) {
2531+ if (btrfs_super_log_root(disk_super) != 0) {
25332532 u64 bytenr = btrfs_super_log_root(disk_super);
25342533
25352534 if (fs_devices->rw_devices == 0) {
@@ -3189,30 +3188,14 @@ int close_ctree(struct btrfs_root *root) · 653 unmodified lines
31893188 /* clear out the rbtree of defraggable inodes */
31903189 btrfs_run_defrag_inodes(fs_info);
31913190
3192− /*
3193− * Here come 2 situations when btrfs is broken to flip readonly:
3194− *
3195− * 1. when btrfs flips readonly somewhere else before
3196− * btrfs_commit_super, sb->s_flags has MS_RDONLY flag,
3197− * and btrfs will skip to write sb directly to keep
3198− * ERROR state on disk.
3199− *
3200− * 2. when btrfs flips readonly just in btrfs_commit_super,
3201− * and in such case, btrfs cannot write sb via btrfs_commit_super,
3202− * and since fs_state has been set BTRFS_SUPER_FLAG_ERROR flag,
3203− * btrfs will cleanup all FS resources first and write sb then.
3204− */
32053191 if (!(fs_info->sb->s_flags & MS_RDONLY)) {
32063192 ret = btrfs_commit_super(root);
32073193 if (ret)
32083194 printk(KERN_ERR "btrfs: commit super ret %d\n", ret);
32093195 }
32103196
3211− if (fs_info->fs_state & BTRFS_SUPER_FLAG_ERROR) {
3212− ret = btrfs_error_commit_super(root);
3213− if (ret)
3214− printk(KERN_ERR "btrfs: commit super ret %d\n", ret);
3215− }
3197+ if (fs_info->fs_state & BTRFS_SUPER_FLAG_ERROR)
3198+ btrfs_error_commit_super(root);
32163199
32173200 btrfs_put_block_group_cache(fs_info);
32183201
@@ -3434,18 +3417,11 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info, · 215 unmodified lines
34343417 if (read_only)
34353418 return 0;
34363419
3437− if (fs_info->fs_state & BTRFS_SUPER_FLAG_ERROR) {
3438− printk(KERN_WARNING "warning: mount fs with errors, "
3439− "running btrfsck is recommended\n");
3440− }
3441−
34423420 return 0;
34433421 }
34443422
3445−int btrfs_error_commit_super(struct btrfs_root *root)
3423+void btrfs_error_commit_super(struct btrfs_root *root)
34463424 {
3447− int ret;
3448−
34493425 mutex_lock(&root->fs_info->cleaner_mutex);
34503426 btrfs_run_delayed_iputs(root);
34513427 mutex_unlock(&root->fs_info->cleaner_mutex);
@@ -3455,10 +3431,6 @@ int btrfs_error_commit_super(struct btrfs_root *root) · 3 unmodified lines
34553431
34563432 /* cleanup FS via transaction */
34573433 btrfs_cleanup_transaction(root);
3458−
3459− ret = write_ctree_super(NULL, root, 0);
3460−
3461− return ret;
34623434 }
34633435
34643436 static void btrfs_destroy_ordered_operations(struct btrfs_root *root)
@@ -3782,14 +3754,17 @@ int btrfs_cleanup_transaction(struct btrfs_root *root) · 317 unmodified lines
37823754 /* FIXME: cleanup wait for commit */
37833755 t->in_commit = 1;
37843756 t->blocked = 1;
3757+ smp_mb();
37853758 if (waitqueue_active(&root->fs_info->transaction_blocked_wait))
37863759 wake_up(&root->fs_info->transaction_blocked_wait);
37873760
37883761 t->blocked = 0;
3762+ smp_mb();
37893763 if (waitqueue_active(&root->fs_info->transaction_wait))
37903764 wake_up(&root->fs_info->transaction_wait);
37913765
37923766 t->commit_done = 1;
3767+ smp_mb();
37933768 if (waitqueue_active(&t->commit_wait))
37943769 wake_up(&t->commit_wait);
37953770
fs/btrfs/disk-io.h+1−1
@@ -54,7 +54,7 @@ int write_ctree_super(struct btrfs_trans_handle *trans, · 53 unmodified lines
5454 struct btrfs_root *root, int max_mirrors);
5555 struct buffer_head *btrfs_read_dev_super(struct block_device *bdev);
5656 int btrfs_commit_super(struct btrfs_root *root);
57−int btrfs_error_commit_super(struct btrfs_root *root);
57+void btrfs_error_commit_super(struct btrfs_root *root);
5858 struct extent_buffer *btrfs_find_tree_block(struct btrfs_root *root,
5959 u64 bytenr, u32 blocksize);
6060 struct btrfs_root *btrfs_read_fs_root_no_radix(struct btrfs_root *tree_root,
fs/btrfs/extent-tree.c+58−65
@@ -2251,6 +2251,16 @@ static noinline int run_clustered_refs(struct btrfs_trans_handle *trans, · 2250 unmodified lines
22512251 }
22522252 }
22532253
2254+ /*
2255+ * We need to try and merge add/drops of the same ref since we
2256+ * can run into issues with relocate dropping the implicit ref
2257+ * and then it being added back again before the drop can
2258+ * finish. If we merged anything we need to re-loop so we can
2259+ * get a good ref.
2260+ */
2261+ btrfs_merge_delayed_refs(trans, fs_info, delayed_refs,
2262+ locked_ref);
2263+
22542264 /*
22552265 * locked_ref is the head node, so we have to go one
22562266 * node back for any delayed ref updates
@@ -2318,12 +2328,23 @@ static noinline int run_clustered_refs(struct btrfs_trans_handle *trans, · 61 unmodified lines
23182328 ref->in_tree = 0;
23192329 rb_erase(&ref->rb_node, &delayed_refs->root);
23202330 delayed_refs->num_entries--;
2321− /*
2322− * we modified num_entries, but as we're currently running
2323− * delayed refs, skip
2324− * wake_up(&delayed_refs->seq_wait);
2325− * here.
2326− */
2331+ if (locked_ref) {
2332+ /*
2333+ * when we play the delayed ref, also correct the
2334+ * ref_mod on head
2335+ */
2336+ switch (ref->action) {
2337+ case BTRFS_ADD_DELAYED_REF:
2338+ case BTRFS_ADD_DELAYED_EXTENT:
2339+ locked_ref->node.ref_mod -= ref->ref_mod;
2340+ break;
2341+ case BTRFS_DROP_DELAYED_REF:
2342+ locked_ref->node.ref_mod += ref->ref_mod;
2343+ break;
2344+ default:
2345+ WARN_ON(1);
2346+ }
2347+ }
23272348 spin_unlock(&delayed_refs->lock);
23282349
23292350 ret = run_one_delayed_ref(trans, root, ref, extent_op,
@@ -2350,22 +2371,6 @@ next: · 20 unmodified lines
23502371 return count;
23512372 }
23522373
2353−static void wait_for_more_refs(struct btrfs_fs_info *fs_info,
2354− struct btrfs_delayed_ref_root *delayed_refs,
2355− unsigned long num_refs,
2356− struct list_head *first_seq)
2357−{
2358− spin_unlock(&delayed_refs->lock);
2359− pr_debug("waiting for more refs (num %ld, first %p)\n",
2360− num_refs, first_seq);
2361− wait_event(fs_info->tree_mod_seq_wait,
2362− num_refs != delayed_refs->num_entries ||
2363− fs_info->tree_mod_seq_list.next != first_seq);
2364− pr_debug("done waiting for more refs (num %ld, first %p)\n",
2365− delayed_refs->num_entries, fs_info->tree_mod_seq_list.next);
2366− spin_lock(&delayed_refs->lock);
2367−}
2368−
23692374 #ifdef SCRAMBLE_DELAYED_REFS
23702375 /*
23712376 * Normally delayed refs get processed in ascending bytenr order. This
@@ -2460,13 +2465,11 @@ int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, · 88 unmodified lines
24602465 struct btrfs_delayed_ref_root *delayed_refs;
24612466 struct btrfs_delayed_ref_node *ref;
24622467 struct list_head cluster;
2463− struct list_head *first_seq = NULL;
24642468 int ret;
24652469 u64 delayed_start;
24662470 int run_all = count == (unsigned long)-1;
24672471 int run_most = 0;
2468− unsigned long num_refs = 0;
2469− int consider_waiting;
2472+ int loops;
24702473
24712474 /* We'll clean this up in btrfs_cleanup_transaction */
24722475 if (trans->aborted)
@@ -2484,7 +2487,7 @@ int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, · 11 unmodified lines
24842487 delayed_refs = &trans->transaction->delayed_refs;
24852488 INIT_LIST_HEAD(&cluster);
24862489 again:
2487− consider_waiting = 0;
2490+ loops = 0;
24882491 spin_lock(&delayed_refs->lock);
24892492
24902493 #ifdef SCRAMBLE_DELAYED_REFS
@@ -2512,31 +2515,6 @@ again: · 21 unmodified lines
25122515 if (ret)
25132516 break;
25142517
2515− if (delayed_start >= delayed_refs->run_delayed_start) {
2516− if (consider_waiting == 0) {
2517− /*
2518− * btrfs_find_ref_cluster looped. let's do one
2519− * more cycle. if we don't run any delayed ref
2520− * during that cycle (because we can't because
2521− * all of them are blocked) and if the number of
2522− * refs doesn't change, we avoid busy waiting.
2523− */
2524− consider_waiting = 1;
2525− num_refs = delayed_refs->num_entries;
2526− first_seq = root->fs_info->tree_mod_seq_list.next;
2527− } else {
2528− wait_for_more_refs(root->fs_info, delayed_refs,
2529− num_refs, first_seq);
2530− /*
2531− * after waiting, things have changed. we
2532− * dropped the lock and someone else might have
2533− * run some refs, built new clusters and so on.
2534− * therefore, we restart staleness detection.
2535− */
2536− consider_waiting = 0;
2537− }
2538− }
2539−
25402518 ret = run_clustered_refs(trans, root, &cluster);
25412519 if (ret < 0) {
25422520 spin_unlock(&delayed_refs->lock);
@@ -2549,9 +2527,26 @@ again: · 6 unmodified lines
25492527 if (count == 0)
25502528 break;
25512529
2552− if (ret || delayed_refs->run_delayed_start == 0) {
2530+ if (delayed_start >= delayed_refs->run_delayed_start) {
2531+ if (loops == 0) {
2532+ /*
2533+ * btrfs_find_ref_cluster looped. let's do one
2534+ * more cycle. if we don't run any delayed ref
2535+ * during that cycle (because we can't because
2536+ * all of them are blocked), bail out.
2537+ */
2538+ loops = 1;
2539+ } else {
2540+ /*
2541+ * no runnable refs left, stop trying
2542+ */
2543+ BUG_ON(run_all);
2544+ break;
2545+ }
2546+ }
2547+ if (ret) {
25532548 /* refs were run, let's reset staleness detection */
2554− consider_waiting = 0;
2549+ loops = 0;
25552550 }
25562551 }
25572552
@@ -3007,17 +3002,16 @@ again: · 449 unmodified lines
30073002 }
30083003 spin_unlock(&block_group->lock);
30093004
3010− num_pages = (int)div64_u64(block_group->key.offset, 1024 * 1024 * 1024);
3005+ /*
3006+ * Try to preallocate enough space based on how big the block group is.
3007+ * Keep in mind this has to include any pinned space which could end up
3008+ * taking up quite a bit since it's not folded into the other space
3009+ * cache.
3010+ */
3011+ num_pages = (int)div64_u64(block_group->key.offset, 256 * 1024 * 1024);
30113012 if (!num_pages)
30123013 num_pages = 1;
30133014
3014− /*
3015− * Just to make absolutely sure we have enough space, we're going to
3016− * preallocate 12 pages worth of space for each block group. In
3017− * practice we ought to use at most 8, but we need extra space so we can
3018− * add our header and have a terminator between the extents and the
3019− * bitmaps.
3020− */
30213015 num_pages *= 16;
30223016 num_pages *= PAGE_CACHE_SIZE;
30233017
@@ -4571,8 +4565,10 @@ int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes) · 1547 unmodified lines
45714565 if (root->fs_info->quota_enabled) {
45724566 ret = btrfs_qgroup_reserve(root, num_bytes +
45734567 nr_extents * root->leafsize);
4574− if (ret)
4568+ if (ret) {
4569+ mutex_unlock(&BTRFS_I(inode)->delalloc_mutex);
45754570 return ret;
4571+ }
45764572 }
45774573
45784574 ret = reserve_metadata_bytes(root, block_rsv, to_reserve, flush);
@@ -5294,9 +5290,6 @@ static noinline int check_ref_cleanup(struct btrfs_trans_handle *trans, · 715 unmodified lines
52945290 rb_erase(&head->node.rb_node, &delayed_refs->root);
52955291
52965292 delayed_refs->num_entries--;
5297− smp_mb();
5298− if (waitqueue_active(&root->fs_info->tree_mod_seq_wait))
5299− wake_up(&root->fs_info->tree_mod_seq_wait);
53005293
53015294 /*
53025295 * we don't take a ref on the node because we're removing it from the
fs/btrfs/extent_io.c+2−15
@@ -2330,23 +2330,10 @@ static void end_bio_extent_readpage(struct bio *bio, int err) · 2329 unmodified lines
23302330 if (uptodate && tree->ops && tree->ops->readpage_end_io_hook) {
23312331 ret = tree->ops->readpage_end_io_hook(page, start, end,
23322332 state, mirror);
2333− if (ret) {
2334− /* no IO indicated but software detected errors
2335− * in the block, either checksum errors or
2336− * issues with the contents */
2337− struct btrfs_root *root =
2338− BTRFS_I(page->mapping->host)->root;
2339− struct btrfs_device *device;
2340−
2333+ if (ret)
23412334 uptodate = 0;
2342− device = btrfs_find_device_for_logical(
2343− root, start, mirror);
2344− if (device)
2345− btrfs_dev_stat_inc_and_print(device,
2346− BTRFS_DEV_STAT_CORRUPTION_ERRS);
2347− } else {
2335+ else
23482336 clean_io_failure(start, page);
2349− }
23502337 }
23512338
23522339 if (!uptodate && tree->ops && tree->ops->readpage_io_failed_hook) {
fs/btrfs/file-item.c+2−2
@@ -272,9 +272,9 @@ int btrfs_lookup_bio_sums(struct btrfs_root *root, struct inode *inode, · 271 unmodified lines
272272 }
273273
274274 int btrfs_lookup_bio_sums_dio(struct btrfs_root *root, struct inode *inode,
275− struct bio *bio, u64 offset, u32 *dst)
275+ struct bio *bio, u64 offset)
276276 {
277− return __btrfs_lookup_bio_sums(root, inode, bio, offset, dst, 1);
277+ return __btrfs_lookup_bio_sums(root, inode, bio, offset, NULL, 1);
278278 }
279279
280280 int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,
fs/btrfs/inode.c+164−162
@@ -1008,9 +1008,7 @@ static noinline void async_cow_submit(struct btrfs_work *work) · 1007 unmodified lines
10081008 nr_pages = (async_cow->end - async_cow->start + PAGE_CACHE_SIZE) >>
10091009 PAGE_CACHE_SHIFT;
10101010
1011− atomic_sub(nr_pages, &root->fs_info->async_delalloc_pages);
1012−
1013− if (atomic_read(&root->fs_info->async_delalloc_pages) <
1011+ if (atomic_sub_return(nr_pages, &root->fs_info->async_delalloc_pages) <
10141012 5 * 1024 * 1024 &&
10151013 waitqueue_active(&root->fs_info->async_submit_wait))
10161014 wake_up(&root->fs_info->async_submit_wait);
@@ -1885,8 +1883,11 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent) · 868 unmodified lines
18851883 trans = btrfs_join_transaction_nolock(root);
18861884 else
18871885 trans = btrfs_join_transaction(root);
1888− if (IS_ERR(trans))
1889− return PTR_ERR(trans);
1886+ if (IS_ERR(trans)) {
1887+ ret = PTR_ERR(trans);
1888+ trans = NULL;
1889+ goto out;
1890+ }
18901891 trans->block_rsv = &root->fs_info->delalloc_block_rsv;
18911892 ret = btrfs_update_inode_fallback(trans, root, inode);
18921893 if (ret) /* -ENOMEM or corruption */
@@ -3174,7 +3175,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, · 1281 unmodified lines
31743175 btrfs_i_size_write(dir, dir->i_size - name_len * 2);
31753176 inode_inc_iversion(dir);
31763177 dir->i_mtime = dir->i_ctime = CURRENT_TIME;
3177− ret = btrfs_update_inode(trans, root, dir);
3178+ ret = btrfs_update_inode_fallback(trans, root, dir);
31783179 if (ret)
31793180 btrfs_abort_transaction(trans, root, ret);
31803181 out:
@@ -5774,18 +5775,112 @@ out: · 2593 unmodified lines
57745775 return ret;
57755776 }
57765777
5778+static int lock_extent_direct(struct inode *inode, u64 lockstart, u64 lockend,
5779+ struct extent_state **cached_state, int writing)
5780+{
5781+ struct btrfs_ordered_extent *ordered;
5782+ int ret = 0;
5783+
5784+ while (1) {
5785+ lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend,
5786+ 0, cached_state);
5787+ /*
5788+ * We're concerned with the entire range that we're going to be
5789+ * doing DIO to, so we need to make sure theres no ordered
5790+ * extents in this range.
5791+ */
5792+ ordered = btrfs_lookup_ordered_range(inode, lockstart,
5793+ lockend - lockstart + 1);
5794+
5795+ /*
5796+ * We need to make sure there are no buffered pages in this
5797+ * range either, we could have raced between the invalidate in
5798+ * generic_file_direct_write and locking the extent. The
5799+ * invalidate needs to happen so that reads after a write do not
5800+ * get stale data.
5801+ */
5802+ if (!ordered && (!writing ||
5803+ !test_range_bit(&BTRFS_I(inode)->io_tree,
5804+ lockstart, lockend, EXTENT_UPTODATE, 0,
5805+ *cached_state)))
5806+ break;
5807+
5808+ unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend,
5809+ cached_state, GFP_NOFS);
5810+
5811+ if (ordered) {
5812+ btrfs_start_ordered_extent(inode, ordered, 1);
5813+ btrfs_put_ordered_extent(ordered);
5814+ } else {
5815+ /* Screw you mmap */
5816+ ret = filemap_write_and_wait_range(inode->i_mapping,
5817+ lockstart,
5818+ lockend);
5819+ if (ret)
5820+ break;
5821+
5822+ /*
5823+ * If we found a page that couldn't be invalidated just
5824+ * fall back to buffered.
5825+ */
5826+ ret = invalidate_inode_pages2_range(inode->i_mapping,
5827+ lockstart >> PAGE_CACHE_SHIFT,
5828+ lockend >> PAGE_CACHE_SHIFT);
5829+ if (ret)
5830+ break;
5831+ }
5832+
5833+ cond_resched();
5834+ }
5835+
5836+ return ret;
5837+}
5838+
57775839 static int btrfs_get_blocks_direct(struct inode *inode, sector_t iblock,
57785840 struct buffer_head *bh_result, int create)
57795841 {
57805842 struct extent_map *em;
57815843 struct btrfs_root *root = BTRFS_I(inode)->root;
5844+ struct extent_state *cached_state = NULL;
57825845 u64 start = iblock << inode->i_blkbits;
5846+ u64 lockstart, lockend;
57835847 u64 len = bh_result->b_size;
57845848 struct btrfs_trans_handle *trans;
5849+ int unlock_bits = EXTENT_LOCKED;
5850+ int ret;
5851+
5852+ if (create) {
5853+ ret = btrfs_delalloc_reserve_space(inode, len);
5854+ if (ret)
5855+ return ret;
5856+ unlock_bits |= EXTENT_DELALLOC | EXTENT_DIRTY;
5857+ } else {
5858+ len = min_t(u64, len, root->sectorsize);
5859+ }
5860+
5861+ lockstart = start;
5862+ lockend = start + len - 1;
5863+
5864+ /*
5865+ * If this errors out it's because we couldn't invalidate pagecache for
5866+ * this range and we need to fallback to buffered.
5867+ */
5868+ if (lock_extent_direct(inode, lockstart, lockend, &cached_state, create))
5869+ return -ENOTBLK;
5870+
5871+ if (create) {
5872+ ret = set_extent_bit(&BTRFS_I(inode)->io_tree, lockstart,
5873+ lockend, EXTENT_DELALLOC, NULL,
5874+ &cached_state, GFP_NOFS);
5875+ if (ret)
5876+ goto unlock_err;
5877+ }
57855878
57865879 em = btrfs_get_extent(inode, NULL, 0, start, len, 0);
5787− if (IS_ERR(em))
5788− return PTR_ERR(em);
5880+ if (IS_ERR(em)) {
5881+ ret = PTR_ERR(em);
5882+ goto unlock_err;
5883+ }
57895884
57905885 /*
57915886 * Ok for INLINE and COMPRESSED extents we need to fallback on buffered
@@ -5804,17 +5899,16 @@ static int btrfs_get_blocks_direct(struct inode *inode, sector_t iblock, · 12 unmodified lines
58045899 if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags) ||
58055900 em->block_start == EXTENT_MAP_INLINE) {
58065901 free_extent_map(em);
5807− return -ENOTBLK;
5902+ ret = -ENOTBLK;
5903+ goto unlock_err;
58085904 }
58095905
58105906 /* Just a good old fashioned hole, return */
58115907 if (!create && (em->block_start == EXTENT_MAP_HOLE ||
58125908 test_bit(EXTENT_FLAG_PREALLOC, &em->flags))) {
58135909 free_extent_map(em);
5814− /* DIO will do one hole at a time, so just unlock a sector */
5815− unlock_extent(&BTRFS_I(inode)->io_tree, start,
5816− start + root->sectorsize - 1);
5817− return 0;
5910+ ret = 0;
5911+ goto unlock_err;
58185912 }
58195913
58205914 /*
@@ -5827,8 +5921,9 @@ static int btrfs_get_blocks_direct(struct inode *inode, sector_t iblock, · 6 unmodified lines
58275921 *
58285922 */
58295923 if (!create) {
5830− len = em->len - (start - em->start);
5831− goto map;
5924+ len = min(len, em->len - (start - em->start));
5925+ lockstart = start + len;
5926+ goto unlock;
58325927 }
58335928
58345929 if (test_bit(EXTENT_FLAG_PREALLOC, &em->flags) ||
@@ -5860,7 +5955,7 @@ static int btrfs_get_blocks_direct(struct inode *inode, sector_t iblock, · 25 unmodified lines
58605955 btrfs_end_transaction(trans, root);
58615956 if (ret) {
58625957 free_extent_map(em);
5863− return ret;
5958+ goto unlock_err;
58645959 }
58655960 goto unlock;
58665961 }
@@ -5873,14 +5968,12 @@ must_cow: · 6 unmodified lines
58735968 */
58745969 len = bh_result->b_size;
58755970 em = btrfs_new_extent_direct(inode, em, start, len);
5876− if (IS_ERR(em))
5877− return PTR_ERR(em);
5971+ if (IS_ERR(em)) {
5972+ ret = PTR_ERR(em);
5973+ goto unlock_err;
5974+ }
58785975 len = min(len, em->len - (start - em->start));
58795976 unlock:
5880− clear_extent_bit(&BTRFS_I(inode)->io_tree, start, start + len - 1,
5881− EXTENT_LOCKED | EXTENT_DELALLOC | EXTENT_DIRTY, 1,
5882− 0, NULL, GFP_NOFS);
5883−map:
58845977 bh_result->b_blocknr = (em->block_start + (start - em->start)) >>
58855978 inode->i_blkbits;
58865979 bh_result->b_size = len;
@@ -5898,9 +5991,44 @@ map: · 11 unmodified lines
58985991 i_size_write(inode, start + len);
58995992 }
59005993
5994+ /*
5995+ * In the case of write we need to clear and unlock the entire range,
5996+ * in the case of read we need to unlock only the end area that we
5997+ * aren't using if there is any left over space.
5998+ */
5999+ if (lockstart < lockend) {
6000+ if (create && len < lockend - lockstart) {
6001+ clear_extent_bit(&BTRFS_I(inode)->io_tree, lockstart,
6002+ lockstart + len - 1, unlock_bits, 1, 0,
6003+ &cached_state, GFP_NOFS);
6004+ /*
6005+ * Beside unlock, we also need to cleanup reserved space
6006+ * for the left range by attaching EXTENT_DO_ACCOUNTING.
6007+ */
6008+ clear_extent_bit(&BTRFS_I(inode)->io_tree,
6009+ lockstart + len, lockend,
6010+ unlock_bits | EXTENT_DO_ACCOUNTING,
6011+ 1, 0, NULL, GFP_NOFS);
6012+ } else {
6013+ clear_extent_bit(&BTRFS_I(inode)->io_tree, lockstart,
6014+ lockend, unlock_bits, 1, 0,
6015+ &cached_state, GFP_NOFS);
6016+ }
6017+ } else {
6018+ free_extent_state(cached_state);
6019+ }
6020+
59016021 free_extent_map(em);
59026022
59036023 return 0;
6024+
6025+unlock_err:
6026+ if (create)
6027+ unlock_bits |= EXTENT_DO_ACCOUNTING;
6028+
6029+ clear_extent_bit(&BTRFS_I(inode)->io_tree, lockstart, lockend,
6030+ unlock_bits, 1, 0, &cached_state, GFP_NOFS);
6031+ return ret;
59046032 }
59056033
59066034 struct btrfs_dio_private {
@@ -5908,7 +6036,6 @@ struct btrfs_dio_private { · 1 unmodified line
59086036 u64 logical_offset;
59096037 u64 disk_bytenr;
59106038 u64 bytes;
5911− u32 *csums;
59126039 void *private;
59136040
59146041 /* number of bios pending for this dio */
@@ -5928,7 +6055,6 @@ static void btrfs_endio_direct_read(struct bio *bio, int err) · 13 unmodified lines
59286055 struct inode *inode = dip->inode;
59296056 struct btrfs_root *root = BTRFS_I(inode)->root;
59306057 u64 start;
5931− u32 *private = dip->csums;
59326058
59336059 start = dip->logical_offset;
59346060 do {
@@ -5936,8 +6062,12 @@ static void btrfs_endio_direct_read(struct bio *bio, int err) · 1 unmodified line
59366062 struct page *page = bvec->bv_page;
59376063 char *kaddr;
59386064 u32 csum = ~(u32)0;
6065+ u64 private = ~(u32)0;
59396066 unsigned long flags;
59406067
6068+ if (get_state_private(&BTRFS_I(inode)->io_tree,
6069+ start, &private))
6070+ goto failed;
59416071 local_irq_save(flags);
59426072 kaddr = kmap_atomic(page);
59436073 csum = btrfs_csum_data(root, kaddr + bvec->bv_offset,
@@ -5947,18 +6077,18 @@ static void btrfs_endio_direct_read(struct bio *bio, int err) · 3 unmodified lines
59476077 local_irq_restore(flags);
59486078
59496079 flush_dcache_page(bvec->bv_page);
5950− if (csum != *private) {
6080+ if (csum != private) {
6081+failed:
59516082 printk(KERN_ERR "btrfs csum failed ino %llu off"
59526083 " %llu csum %u private %u\n",
59536084 (unsigned long long)btrfs_ino(inode),
59546085 (unsigned long long)start,
5955− csum, *private);
6086+ csum, (unsigned)private);
59566087 err = -EIO;
59576088 }
59586089 }
59596090
59606091 start += bvec->bv_len;
5961− private++;
59626092 bvec++;
59636093 } while (bvec <= bvec_end);
59646094
@@ -5966,7 +6096,6 @@ static void btrfs_endio_direct_read(struct bio *bio, int err) · 1 unmodified line
59666096 dip->logical_offset + dip->bytes - 1);
59676097 bio->bi_private = dip->private;
59686098
5969− kfree(dip->csums);
59706099 kfree(dip);
59716100
59726101 /* If we had a csum failure make sure to clear the uptodate flag */
@@ -6072,7 +6201,7 @@ static struct bio *btrfs_dio_bio_alloc(struct block_device *bdev, · 99 unmodified lines
60726201
60736202 static inline int __btrfs_submit_dio_bio(struct bio *bio, struct inode *inode,
60746203 int rw, u64 file_offset, int skip_sum,
6075− u32 *csums, int async_submit)
6204+ int async_submit)
60766205 {
60776206 int write = rw & REQ_WRITE;
60786207 struct btrfs_root *root = BTRFS_I(inode)->root;
@@ -6105,8 +6234,7 @@ static inline int __btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, · 26 unmodified lines
61056234 if (ret)
61066235 goto err;
61076236 } else if (!skip_sum) {
6108− ret = btrfs_lookup_bio_sums_dio(root, inode, bio,
6109− file_offset, csums);
6237+ ret = btrfs_lookup_bio_sums_dio(root, inode, bio, file_offset);
61106238 if (ret)
61116239 goto err;
61126240 }
@@ -6132,10 +6260,8 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip, · 19 unmodified lines
61326260 u64 submit_len = 0;
61336261 u64 map_length;
61346262 int nr_pages = 0;
6135− u32 *csums = dip->csums;
61366263 int ret = 0;
61376264 int async_submit = 0;
6138− int write = rw & REQ_WRITE;
61396265
61406266 map_length = orig_bio->bi_size;
61416267 ret = btrfs_map_block(map_tree, READ, start_sector << 9,
@@ -6171,16 +6297,13 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip, · 29 unmodified lines
61716297 atomic_inc(&dip->pending_bios);
61726298 ret = __btrfs_submit_dio_bio(bio, inode, rw,
61736299 file_offset, skip_sum,
6174− csums, async_submit);
6300+ async_submit);
61756301 if (ret) {
61766302 bio_put(bio);
61776303 atomic_dec(&dip->pending_bios);
61786304 goto out_err;
61796305 }
61806306
6181− /* Write's use the ordered csums */
6182− if (!write && !skip_sum)
6183− csums = csums + nr_pages;
61846307 start_sector += submit_len >> 9;
61856308 file_offset += submit_len;
61866309
@@ -6210,7 +6333,7 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip, · 23 unmodified lines
62106333
62116334 submit:
62126335 ret = __btrfs_submit_dio_bio(bio, inode, rw, file_offset, skip_sum,
6213− csums, async_submit);
6336+ async_submit);
62146337 if (!ret)
62156338 return 0;
62166339
@@ -6246,17 +6369,6 @@ static void btrfs_submit_direct(int rw, struct bio *bio, struct inode *inode, · 29 unmodified lines
62466369 ret = -ENOMEM;
62476370 goto free_ordered;
62486371 }
6249− dip->csums = NULL;
6250−
6251− /* Write's use the ordered csum stuff, so we don't need dip->csums */
6252− if (!write && !skip_sum) {
6253− dip->csums = kmalloc(sizeof(u32) * bio->bi_vcnt, GFP_NOFS);
6254− if (!dip->csums) {
6255− kfree(dip);
6256− ret = -ENOMEM;
6257− goto free_ordered;
6258− }
6259− }
62606372
62616373 dip->private = bio->bi_private;
62626374 dip->inode = inode;
@@ -6341,132 +6453,22 @@ static ssize_t check_direct_IO(struct btrfs_root *root, int rw, struct kiocb *io · 78 unmodified lines
63416453 out:
63426454 return retval;
63436455 }
6456+
63446457 static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb,
63456458 const struct iovec *iov, loff_t offset,
63466459 unsigned long nr_segs)
63476460 {
63486461 struct file *file = iocb->ki_filp;
63496462 struct inode *inode = file->f_mapping->host;
6350− struct btrfs_ordered_extent *ordered;
6351− struct extent_state *cached_state = NULL;
6352− u64 lockstart, lockend;
6353− ssize_t ret;
6354− int writing = rw & WRITE;
6355− int write_bits = 0;
6356− size_t count = iov_length(iov, nr_segs);
63576463
63586464 if (check_direct_IO(BTRFS_I(inode)->root, rw, iocb, iov,
6359− offset, nr_segs)) {
6465+ offset, nr_segs))
63606466 return 0;
6361− }
6362−
6363− lockstart = offset;
6364− lockend = offset + count - 1;
6365−
6366− if (writing) {
6367− ret = btrfs_delalloc_reserve_space(inode, count);
6368− if (ret)
6369− goto out;
6370− }
6371−
6372− while (1) {
6373− lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend,
6374− 0, &cached_state);
6375− /*
6376− * We're concerned with the entire range that we're going to be
6377− * doing DIO to, so we need to make sure theres no ordered
6378− * extents in this range.
6379− */
6380− ordered = btrfs_lookup_ordered_range(inode, lockstart,
6381− lockend - lockstart + 1);
6382−
6383− /*
6384− * We need to make sure there are no buffered pages in this
6385− * range either, we could have raced between the invalidate in
6386− * generic_file_direct_write and locking the extent. The
6387− * invalidate needs to happen so that reads after a write do not
6388− * get stale data.
6389− */
6390− if (!ordered && (!writing ||
6391− !test_range_bit(&BTRFS_I(inode)->io_tree,
6392− lockstart, lockend, EXTENT_UPTODATE, 0,
6393− cached_state)))
6394− break;
6395−
6396− unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend,
6397− &cached_state, GFP_NOFS);
6398−
6399− if (ordered) {
6400− btrfs_start_ordered_extent(inode, ordered, 1);
6401− btrfs_put_ordered_extent(ordered);
6402− } else {
6403− /* Screw you mmap */
6404− ret = filemap_write_and_wait_range(file->f_mapping,
6405− lockstart,
6406− lockend);
6407− if (ret)
6408− goto out;
6409−
6410− /*
6411− * If we found a page that couldn't be invalidated just
6412− * fall back to buffered.
6413− */
6414− ret = invalidate_inode_pages2_range(file->f_mapping,
6415− lockstart >> PAGE_CACHE_SHIFT,
6416− lockend >> PAGE_CACHE_SHIFT);
6417− if (ret) {
6418− if (ret == -EBUSY)
6419− ret = 0;
6420− goto out;
6421− }
6422− }
6423−
6424− cond_resched();
6425− }
64266467
6427− /*
6428− * we don't use btrfs_set_extent_delalloc because we don't want
6429− * the dirty or uptodate bits
6430− */
6431− if (writing) {
6432− write_bits = EXTENT_DELALLOC | EXTENT_DO_ACCOUNTING;
6433− ret = set_extent_bit(&BTRFS_I(inode)->io_tree, lockstart, lockend,
6434− EXTENT_DELALLOC, NULL, &cached_state,
6435− GFP_NOFS);
6436− if (ret) {
6437− clear_extent_bit(&BTRFS_I(inode)->io_tree, lockstart,
6438− lockend, EXTENT_LOCKED | write_bits,
6439− 1, 0, &cached_state, GFP_NOFS);
6440− goto out;
6441− }
6442− }
6443−
6444− free_extent_state(cached_state);
6445− cached_state = NULL;
6446−
6447− ret = __blockdev_direct_IO(rw, iocb, inode,
6468+ return __blockdev_direct_IO(rw, iocb, inode,
64486469 BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev,
64496470 iov, offset, nr_segs, btrfs_get_blocks_direct, NULL,
64506471 btrfs_submit_direct, 0);
6451−
6452− if (ret < 0 && ret != -EIOCBQUEUED) {
6453− clear_extent_bit(&BTRFS_I(inode)->io_tree, offset,
6454− offset + iov_length(iov, nr_segs) - 1,
6455− EXTENT_LOCKED | write_bits, 1, 0,
6456− &cached_state, GFP_NOFS);
6457− } else if (ret >= 0 && ret < iov_length(iov, nr_segs)) {
6458− /*
6459− * We're falling back to buffered, unlock the section we didn't
6460− * do IO on.
6461− */
6462− clear_extent_bit(&BTRFS_I(inode)->io_tree, offset + ret,
6463− offset + iov_length(iov, nr_segs) - 1,
6464− EXTENT_LOCKED | write_bits, 1, 0,
6465− &cached_state, GFP_NOFS);
6466− }
6467−out:
6468− free_extent_state(cached_state);
6469− return ret;
64706472 }
64716473
64726474 static int btrfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
fs/btrfs/ioctl.c+1−1
@@ -424,7 +424,7 @@ static noinline int create_subvol(struct btrfs_root *root, · 423 unmodified lines
424424 uuid_le_gen(&new_uuid);
425425 memcpy(root_item.uuid, new_uuid.b, BTRFS_UUID_SIZE);
426426 root_item.otime.sec = cpu_to_le64(cur_time.tv_sec);
427− root_item.otime.nsec = cpu_to_le64(cur_time.tv_nsec);
427+ root_item.otime.nsec = cpu_to_le32(cur_time.tv_nsec);
428428 root_item.ctime = root_item.otime;
429429 btrfs_set_root_ctransid(&root_item, trans->transid);
430430 btrfs_set_root_otransid(&root_item, trans->transid);
fs/btrfs/locking.c+1−1
@@ -67,7 +67,7 @@ void btrfs_clear_lock_blocking_rw(struct extent_buffer *eb, int rw) · 66 unmodified lines
6767 {
6868 if (eb->lock_nested) {
6969 read_lock(&eb->lock);
70− if (&eb->lock_nested && current->pid == eb->lock_owner) {
70+ if (eb->lock_nested && current->pid == eb->lock_owner) {
7171 read_unlock(&eb->lock);
7272 return;
7373 }
fs/btrfs/qgroup.c+9−3
@@ -1364,13 +1364,17 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, · 1363 unmodified lines
13641364 spin_lock(&fs_info->qgroup_lock);
13651365
13661366 dstgroup = add_qgroup_rb(fs_info, objectid);
1367− if (!dstgroup)
1367+ if (IS_ERR(dstgroup)) {
1368+ ret = PTR_ERR(dstgroup);
13681369 goto unlock;
1370+ }
13691371
13701372 if (srcid) {
13711373 srcgroup = find_qgroup_rb(fs_info, srcid);
1372− if (!srcgroup)
1374+ if (!srcgroup) {
1375+ ret = -EINVAL;
13731376 goto unlock;
1377+ }
13741378 dstgroup->rfer = srcgroup->rfer - level_size;
13751379 dstgroup->rfer_cmpr = srcgroup->rfer_cmpr - level_size;
13761380 srcgroup->excl = level_size;
@@ -1379,8 +1383,10 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, · 2 unmodified lines
13791383 qgroup_dirty(fs_info, srcgroup);
13801384 }
13811385
1382− if (!inherit)
1386+ if (!inherit) {
1387+ ret = -EINVAL;
13831388 goto unlock;
1389+ }
13841390
13851391 i_qgroups = (u64 *)(inherit + 1);
13861392 for (i = 0; i < inherit->num_qgroups; ++i) {
fs/btrfs/root-tree.c+2−2
@@ -544,8 +544,8 @@ void btrfs_update_root_times(struct btrfs_trans_handle *trans, · 543 unmodified lines
544544 struct timespec ct = CURRENT_TIME;
545545
546546 spin_lock(&root->root_times_lock);
547− item->ctransid = trans->transid;
547+ item->ctransid = cpu_to_le64(trans->transid);
548548 item->ctime.sec = cpu_to_le64(ct.tv_sec);
549− item->ctime.nsec = cpu_to_le64(ct.tv_nsec);
549+ item->ctime.nsec = cpu_to_le32(ct.tv_nsec);
550550 spin_unlock(&root->root_times_lock);
551551 }
fs/btrfs/super.c+11−4
@@ -838,7 +838,6 @@ int btrfs_sync_fs(struct super_block *sb, int wait) · 837 unmodified lines
838838 struct btrfs_trans_handle *trans;
839839 struct btrfs_fs_info *fs_info = btrfs_sb(sb);
840840 struct btrfs_root *root = fs_info->tree_root;
841− int ret;
842841
843842 trace_btrfs_sync_fs(wait);
844843
@@ -849,11 +848,17 @@ int btrfs_sync_fs(struct super_block *sb, int wait) · 4 unmodified lines
849848
850849 btrfs_wait_ordered_extents(root, 0, 0);
851850
852− trans = btrfs_start_transaction(root, 0);
851+ spin_lock(&fs_info->trans_lock);
852+ if (!fs_info->running_transaction) {
853+ spin_unlock(&fs_info->trans_lock);
854+ return 0;
855+ }
856+ spin_unlock(&fs_info->trans_lock);
857+
858+ trans = btrfs_join_transaction(root);
853859 if (IS_ERR(trans))
854860 return PTR_ERR(trans);
855− ret = btrfs_commit_transaction(trans, root);
856− return ret;
861+ return btrfs_commit_transaction(trans, root);
857862 }
858863
859864 static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry)
@@ -1530,6 +1535,8 @@ static int btrfs_show_devname(struct seq_file *m, struct dentry *root) · 670 unmodified lines
15301535 while (cur_devices) {
15311536 head = &cur_devices->devices;
15321537 list_for_each_entry(dev, head, dev_list) {
1538+ if (dev->missing)
1539+ continue;
15331540 if (!first_dev || dev->devid < first_dev->devid)
15341541 first_dev = dev;
15351542 }
fs/btrfs/transaction.c+2−1
@@ -1031,6 +1031,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, · 1030 unmodified lines
10311031
10321032 btrfs_i_size_write(parent_inode, parent_inode->i_size +
10331033 dentry->d_name.len * 2);
1034+ parent_inode->i_mtime = parent_inode->i_ctime = CURRENT_TIME;
10341035 ret = btrfs_update_inode(trans, parent_root, parent_inode);
10351036 if (ret)
10361037 goto abort_trans_dput;
@@ -1066,7 +1067,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, · 29 unmodified lines
10661067 memcpy(new_root_item->parent_uuid, root->root_item.uuid,
10671068 BTRFS_UUID_SIZE);
10681069 new_root_item->otime.sec = cpu_to_le64(cur_time.tv_sec);
1069− new_root_item->otime.nsec = cpu_to_le64(cur_time.tv_nsec);
1070+ new_root_item->otime.nsec = cpu_to_le32(cur_time.tv_nsec);
10701071 btrfs_set_root_otransid(new_root_item, trans->transid);
10711072 memset(&new_root_item->stime, 0, sizeof(new_root_item->stime));
10721073 memset(&new_root_item->rtime, 0, sizeof(new_root_item->rtime));
fs/btrfs/volumes.c+6−27
@@ -227,9 +227,8 @@ loop_lock: · 226 unmodified lines
227227 cur = pending;
228228 pending = pending->bi_next;
229229 cur->bi_next = NULL;
230− atomic_dec(&fs_info->nr_async_bios);
231230
232− if (atomic_read(&fs_info->nr_async_bios) < limit &&
231+ if (atomic_dec_return(&fs_info->nr_async_bios) < limit &&
233232 waitqueue_active(&fs_info->async_submit_wait))
234233 wake_up(&fs_info->async_submit_wait);
235234
@@ -569,9 +568,11 @@ static int __btrfs_close_devices(struct btrfs_fs_devices *fs_devices) · 333 unmodified lines
569568 memcpy(new_device, device, sizeof(*new_device));
570569
571570 /* Safe because we are under uuid_mutex */
572− name = rcu_string_strdup(device->name->str, GFP_NOFS);
573− BUG_ON(device->name && !name); /* -ENOMEM */
574− rcu_assign_pointer(new_device->name, name);
571+ if (device->name) {
572+ name = rcu_string_strdup(device->name->str, GFP_NOFS);
573+ BUG_ON(device->name && !name); /* -ENOMEM */
574+ rcu_assign_pointer(new_device->name, name);
575+ }
575576 new_device->bdev = NULL;
576577 new_device->writeable = 0;
577578 new_device->in_fs_metadata = 0;
@@ -4605,28 +4606,6 @@ int btrfs_read_sys_array(struct btrfs_root *root) · 4027 unmodified lines
46054606 return ret;
46064607 }
46074608
4608−struct btrfs_device *btrfs_find_device_for_logical(struct btrfs_root *root,
4609− u64 logical, int mirror_num)
4610−{
4611− struct btrfs_mapping_tree *map_tree = &root->fs_info->mapping_tree;
4612− int ret;
4613− u64 map_length = 0;
4614− struct btrfs_bio *bbio = NULL;
4615− struct btrfs_device *device;
4616−
4617− BUG_ON(mirror_num == 0);
4618− ret = btrfs_map_block(map_tree, WRITE, logical, &map_length, &bbio,
4619− mirror_num);
4620− if (ret) {
4621− BUG_ON(bbio != NULL);
4622− return NULL;
4623− }
4624− BUG_ON(mirror_num != bbio->mirror_num);
4625− device = bbio->stripes[mirror_num - 1].dev;
4626− kfree(bbio);
4627− return device;
4628−}
4629−
46304609 int btrfs_read_chunk_tree(struct btrfs_root *root)
46314610 {
46324611 struct btrfs_path *path;
fs/btrfs/volumes.h+0−2
@@ -289,8 +289,6 @@ int btrfs_cancel_balance(struct btrfs_fs_info *fs_info); · 288 unmodified lines
289289 int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset);
290290 int find_free_dev_extent(struct btrfs_device *device, u64 num_bytes,
291291 u64 *start, u64 *max_avail);
292−struct btrfs_device *btrfs_find_device_for_logical(struct btrfs_root *root,
293− u64 logical, int mirror_num);
294292 void btrfs_dev_stat_print_on_error(struct btrfs_device *device);
295293 void btrfs_dev_stat_inc_and_print(struct btrfs_device *dev, int index);
296294 int btrfs_get_dev_stats(struct btrfs_root *root,
fs/buffer.c+30−36
@@ -914,7 +914,7 @@ link_dev_buffers(struct page *page, struct buffer_head *head) · 913 unmodified lines
914914 /*
915915 * Initialise the state of a blockdev page's buffers.
916916 */
917−static void
917+static sector_t
918918 init_page_buffers(struct page *page, struct block_device *bdev,
919919 sector_t block, int size)
920920 {
@@ -936,33 +936,41 @@ init_page_buffers(struct page *page, struct block_device *bdev, · 15 unmodified lines
936936 block++;
937937 bh = bh->b_this_page;
938938 } while (bh != head);
939+
940+ /*
941+ * Caller needs to validate requested block against end of device.
942+ */
943+ return end_block;
939944 }
940945
941946 /*
942947 * Create the page-cache page that contains the requested block.
943948 *
944− * This is user purely for blockdev mappings.
949+ * This is used purely for blockdev mappings.
945950 */
946−static struct page *
951+static int
947952 grow_dev_page(struct block_device *bdev, sector_t block,
948− pgoff_t index, int size)
953+ pgoff_t index, int size, int sizebits)
949954 {
950955 struct inode *inode = bdev->bd_inode;
951956 struct page *page;
952957 struct buffer_head *bh;
958+ sector_t end_block;
959+ int ret = 0; /* Will call free_more_memory() */
953960
954961 page = find_or_create_page(inode->i_mapping, index,
955962 (mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS)|__GFP_MOVABLE);
956963 if (!page)
957− return NULL;
964+ return ret;
958965
959966 BUG_ON(!PageLocked(page));
960967
961968 if (page_has_buffers(page)) {
962969 bh = page_buffers(page);
963970 if (bh->b_size == size) {
964− init_page_buffers(page, bdev, block, size);
965− return page;
971+ end_block = init_page_buffers(page, bdev,
972+ index << sizebits, size);
973+ goto done;
966974 }
967975 if (!try_to_free_buffers(page))
968976 goto failed;
@@ -982,14 +990,14 @@ grow_dev_page(struct block_device *bdev, sector_t block, · 13 unmodified lines
982990 */
983991 spin_lock(&inode->i_mapping->private_lock);
984992 link_dev_buffers(page, bh);
985− init_page_buffers(page, bdev, block, size);
993+ end_block = init_page_buffers(page, bdev, index << sizebits, size);
986994 spin_unlock(&inode->i_mapping->private_lock);
987− return page;
988−
995+done:
996+ ret = (block < end_block) ? 1 : -ENXIO;
989997 failed:
990998 unlock_page(page);
991999 page_cache_release(page);
992− return NULL;
1000+ return ret;
9931001 }
9941002
9951003 /*
@@ -999,7 +1007,6 @@ failed: · 3 unmodified lines
9991007 static int
10001008 grow_buffers(struct block_device *bdev, sector_t block, int size)
10011009 {
1002− struct page *page;
10031010 pgoff_t index;
10041011 int sizebits;
10051012
@@ -1023,22 +1030,14 @@ grow_buffers(struct block_device *bdev, sector_t block, int size) · 17 unmodified lines
10231030 bdevname(bdev, b));
10241031 return -EIO;
10251032 }
1026− block = index << sizebits;
1033+
10271034 /* Create a page with the proper size buffers.. */
1028− page = grow_dev_page(bdev, block, index, size);
1029− if (!page)
1030− return 0;
1031− unlock_page(page);
1032− page_cache_release(page);
1033− return 1;
1035+ return grow_dev_page(bdev, block, index, size, sizebits);
10341036 }
10351037
10361038 static struct buffer_head *
10371039 __getblk_slow(struct block_device *bdev, sector_t block, int size)
10381040 {
1039− int ret;
1040− struct buffer_head *bh;
1041−
10421041 /* Size must be multiple of hard sectorsize */
10431042 if (unlikely(size & (bdev_logical_block_size(bdev)-1) ||
10441043 (size < 512 || size > PAGE_SIZE))) {
@@ -1051,21 +1050,20 @@ __getblk_slow(struct block_device *bdev, sector_t block, int size) · 6 unmodified lines
10511050 return NULL;
10521051 }
10531052
1054−retry:
1055− bh = __find_get_block(bdev, block, size);
1056− if (bh)
1057− return bh;
1053+ for (;;) {
1054+ struct buffer_head *bh;
1055+ int ret;
10581056
1059− ret = grow_buffers(bdev, block, size);
1060− if (ret == 0) {
1061− free_more_memory();
1062− goto retry;
1063− } else if (ret > 0) {
10641057 bh = __find_get_block(bdev, block, size);
10651058 if (bh)
10661059 return bh;
1060+
1061+ ret = grow_buffers(bdev, block, size);
1062+ if (ret < 0)
1063+ return NULL;
1064+ if (ret == 0)
1065+ free_more_memory();
10671066 }
1068− return NULL;
10691067 }
10701068
10711069 /*
@@ -1321,10 +1319,6 @@ EXPORT_SYMBOL(__find_get_block); · 249 unmodified lines
13211319 * which corresponds to the passed block_device, block and size. The
13221320 * returned buffer has its reference count incremented.
13231321 *
1324− * __getblk() cannot fail - it just keeps trying. If you pass it an
1325− * illegal block number, __getblk() will happily return a buffer_head
1326− * which represents the non-existent block. Very weird.
1327− *
13281322 * __getblk() will lock up the machine if grow_dev_page's try_to_free_buffers()
13291323 * attempt is failing. FIXME, perhaps?
13301324 */
fs/cifs/cifssmb.c+8−3
@@ -1576,9 +1576,14 @@ cifs_readv_callback(struct mid_q_entry *mid) · 1575 unmodified lines
15761576 /* result already set, check signature */
15771577 if (server->sec_mode &
15781578 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) {
1579− if (cifs_verify_signature(rdata->iov, rdata->nr_iov,
1580− server, mid->sequence_number + 1))
1581− cERROR(1, "Unexpected SMB signature");
1579+ int rc = 0;
1580+
1581+ rc = cifs_verify_signature(rdata->iov, rdata->nr_iov,
1582+ server,
1583+ mid->sequence_number + 1);
1584+ if (rc)
1585+ cERROR(1, "SMB signature verification returned "
1586+ "error = %d", rc);
15821587 }
15831588 /* FIXME: should this be counted toward the initiating task? */
15841589 task_io_account_read(rdata->bytes);
fs/cifs/dir.c+1−8
@@ -356,19 +356,12 @@ cifs_create_get_file_info: · 355 unmodified lines
356356 cifs_create_set_dentry:
357357 if (rc != 0) {
358358 cFYI(1, "Create worked, get_inode_info failed rc = %d", rc);
359+ CIFSSMBClose(xid, tcon, *fileHandle);
359360 goto out;
360361 }
361362 d_drop(direntry);
362363 d_add(direntry, newinode);
363364
364− /* ENOENT for create? How weird... */
365− rc = -ENOENT;
366− if (!newinode) {
367− CIFSSMBClose(xid, tcon, *fileHandle);
368− goto out;
369− }
370− rc = 0;
371−
372365 out:
373366 kfree(buf);
374367 kfree(full_path);
fs/cifs/inode.c+16−8
@@ -124,10 +124,10 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) · 123 unmodified lines
124124 {
125125 struct cifsInodeInfo *cifs_i = CIFS_I(inode);
126126 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
127− unsigned long oldtime = cifs_i->time;
128127
129128 cifs_revalidate_cache(inode, fattr);
130129
130+ spin_lock(&inode->i_lock);
131131 inode->i_atime = fattr->cf_atime;
132132 inode->i_mtime = fattr->cf_mtime;
133133 inode->i_ctime = fattr->cf_ctime;
@@ -148,9 +148,6 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) · 14 unmodified lines
148148 else
149149 cifs_i->time = jiffies;
150150
151− cFYI(1, "inode 0x%p old_time=%ld new_time=%ld", inode,
152− oldtime, cifs_i->time);
153−
154151 cifs_i->delete_pending = fattr->cf_flags & CIFS_FATTR_DELETE_PENDING;
155152
156153 cifs_i->server_eof = fattr->cf_eof;
@@ -158,7 +155,6 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) · 1 unmodified line
158155 * Can't safely change the file size here if the client is writing to
159156 * it due to potential races.
160157 */
161− spin_lock(&inode->i_lock);
162158 if (is_size_safe_to_change(cifs_i, fattr->cf_eof)) {
163159 i_size_write(inode, fattr->cf_eof);
164160
@@ -859,12 +855,14 @@ struct inode *cifs_root_iget(struct super_block *sb) · 694 unmodified lines
859855
860856 if (rc && tcon->ipc) {
861857 cFYI(1, "ipc connection - fake read inode");
858+ spin_lock(&inode->i_lock);
862859 inode->i_mode |= S_IFDIR;
863860 set_nlink(inode, 2);
864861 inode->i_op = &cifs_ipc_inode_ops;
865862 inode->i_fop = &simple_dir_operations;
866863 inode->i_uid = cifs_sb->mnt_uid;
867864 inode->i_gid = cifs_sb->mnt_gid;
865+ spin_unlock(&inode->i_lock);
868866 } else if (rc) {
869867 iget_failed(inode);
870868 inode = ERR_PTR(rc);
@@ -1110,6 +1108,15 @@ undo_setattr: · 239 unmodified lines
11101108 goto out_close;
11111109 }
11121110
1111+/* copied from fs/nfs/dir.c with small changes */
1112+static void
1113+cifs_drop_nlink(struct inode *inode)
1114+{
1115+ spin_lock(&inode->i_lock);
1116+ if (inode->i_nlink > 0)
1117+ drop_nlink(inode);
1118+ spin_unlock(&inode->i_lock);
1119+}
11131120
11141121 /*
11151122 * If dentry->d_inode is null (usually meaning the cached dentry
@@ -1166,13 +1173,13 @@ retry_std_delete: · 50 unmodified lines
11661173 psx_del_no_retry:
11671174 if (!rc) {
11681175 if (inode)
1169− drop_nlink(inode);
1176+ cifs_drop_nlink(inode);
11701177 } else if (rc == -ENOENT) {
11711178 d_drop(dentry);
11721179 } else if (rc == -ETXTBSY) {
11731180 rc = cifs_rename_pending_delete(full_path, dentry, xid);
11741181 if (rc == 0)
1175− drop_nlink(inode);
1182+ cifs_drop_nlink(inode);
11761183 } else if ((rc == -EACCES) && (dosattr == 0) && inode) {
11771184 attrs = kzalloc(sizeof(*attrs), GFP_KERNEL);
11781185 if (attrs == NULL) {
@@ -1241,9 +1248,10 @@ cifs_mkdir_qinfo(struct inode *inode, struct dentry *dentry, umode_t mode, · 62 unmodified lines
12411248 * setting nlink not necessary except in cases where we failed to get it
12421249 * from the server or was set bogus
12431250 */
1251+ spin_lock(&dentry->d_inode->i_lock);
12441252 if ((dentry->d_inode) && (dentry->d_inode->i_nlink < 2))
12451253 set_nlink(dentry->d_inode, 2);
1246−
1254+ spin_unlock(&dentry->d_inode->i_lock);
12471255 mode &= ~current_umask();
12481256 /* must turn on setgid bit if parent dir has it */
12491257 if (inode->i_mode & S_ISGID)
fs/cifs/link.c+2−0
@@ -433,7 +433,9 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode, · 432 unmodified lines
433433 if (old_file->d_inode) {
434434 cifsInode = CIFS_I(old_file->d_inode);
435435 if (rc == 0) {
436+ spin_lock(&old_file->d_inode->i_lock);
436437 inc_nlink(old_file->d_inode);
438+ spin_unlock(&old_file->d_inode->i_lock);
437439 /* BB should we make this contingent on superblock flag NOATIME? */
438440 /* old_file->d_inode->i_ctime = CURRENT_TIME;*/
439441 /* parent dir timestamps will update from srv
fs/cifs/smb2misc.c+9−7
@@ -52,7 +52,8 @@ check_smb2_hdr(struct smb2_hdr *hdr, __u64 mid) · 51 unmodified lines
5252 cERROR(1, "Bad protocol string signature header %x",
5353 *(unsigned int *) hdr->ProtocolId);
5454 if (mid != hdr->MessageId)
55− cERROR(1, "Mids do not match");
55+ cERROR(1, "Mids do not match: %llu and %llu", mid,
56+ hdr->MessageId);
5657 }
5758 cERROR(1, "Bad SMB detected. The Mid=%llu", hdr->MessageId);
5859 return 1;
@@ -107,7 +108,7 @@ smb2_check_message(char *buf, unsigned int length) · 48 unmodified lines
107108 * ie Validate the wct via smb2_struct_sizes table above
108109 */
109110
110− if (length < 2 + sizeof(struct smb2_hdr)) {
111+ if (length < sizeof(struct smb2_pdu)) {
111112 if ((length >= sizeof(struct smb2_hdr)) && (hdr->Status != 0)) {
112113 pdu->StructureSize2 = 0;
113114 /*
@@ -121,15 +122,15 @@ smb2_check_message(char *buf, unsigned int length) · 7 unmodified lines
121122 return 1;
122123 }
123124 if (len > CIFSMaxBufSize + MAX_SMB2_HDR_SIZE - 4) {
124− cERROR(1, "SMB length greater than maximum, mid=%lld", mid);
125+ cERROR(1, "SMB length greater than maximum, mid=%llu", mid);
125126 return 1;
126127 }
127128
128129 if (check_smb2_hdr(hdr, mid))
129130 return 1;
130131
131− if (hdr->StructureSize != SMB2_HEADER_SIZE) {
132− cERROR(1, "Illegal structure size %d",
132+ if (hdr->StructureSize != SMB2_HEADER_STRUCTURE_SIZE) {
133+ cERROR(1, "Illegal structure size %u",
133134 le16_to_cpu(hdr->StructureSize));
134135 return 1;
135136 }
@@ -161,8 +162,9 @@ smb2_check_message(char *buf, unsigned int length) · 25 unmodified lines
161162 if (4 + len != clc_len) {
162163 cFYI(1, "Calculated size %u length %u mismatch mid %llu",
163164 clc_len, 4 + len, mid);
164− if (clc_len == 4 + len + 1) /* BB FIXME (fix samba) */
165− return 0; /* BB workaround Samba 3 bug SessSetup rsp */
165+ /* server can return one byte more */
166+ if (clc_len == 4 + len + 1)
167+ return 0;
166168 return 1;
167169 }
168170 return 0;
fs/cifs/smb2pdu.h+6−4
@@ -87,10 +87,6 @@ · 86 unmodified lines
8787
8888 #define SMB2_PROTO_NUMBER __constant_cpu_to_le32(0x424d53fe)
8989
90−#define SMB2_HEADER_SIZE __constant_le16_to_cpu(64)
91−
92−#define SMB2_ERROR_STRUCTURE_SIZE2 __constant_le16_to_cpu(9)
93−
9490 /*
9591 * SMB2 Header Definition
9692 *
@@ -99,6 +95,9 @@ · 2 unmodified lines
9995 * "PDU" : "Protocol Data Unit" (ie a network "frame")
10096 *
10197 */
98+
99+#define SMB2_HEADER_STRUCTURE_SIZE __constant_le16_to_cpu(64)
100+
102101 struct smb2_hdr {
103102 __be32 smb2_buf_length; /* big endian on wire */
104103 /* length is only two or three bytes - with
@@ -140,6 +139,9 @@ struct smb2_pdu { · 35 unmodified lines
140139 * command code name for the struct. Note that structures must be packed.
141140 *
142141 */
142+
143+#define SMB2_ERROR_STRUCTURE_SIZE2 __constant_le16_to_cpu(9)
144+
143145 struct smb2_err_rsp {
144146 struct smb2_hdr hdr;
145147 __le16 StructureSize;
fs/cifs/transport.c+6−3
@@ -503,13 +503,16 @@ cifs_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server, · 502 unmodified lines
503503 /* convert the length into a more usable form */
504504 if (server->sec_mode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) {
505505 struct kvec iov;
506+ int rc = 0;
506507
507508 iov.iov_base = mid->resp_buf;
508509 iov.iov_len = len;
509510 /* FIXME: add code to kill session */
510− if (cifs_verify_signature(&iov, 1, server,
511− mid->sequence_number + 1) != 0)
512− cERROR(1, "Unexpected SMB signature");
511+ rc = cifs_verify_signature(&iov, 1, server,
512+ mid->sequence_number + 1);
513+ if (rc)
514+ cERROR(1, "SMB signature verification returned error = "
515+ "%d", rc);
513516 }
514517
515518 /* BB special case reconnect tid and uid here? */
fs/direct-io.c+5−0
@@ -1062,6 +1062,7 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, · 1061 unmodified lines
10621062 unsigned long user_addr;
10631063 size_t bytes;
10641064 struct buffer_head map_bh = { 0, };
1065+ struct blk_plug plug;
10651066
10661067 if (rw & WRITE)
10671068 rw = WRITE_ODIRECT;
@@ -1177,6 +1178,8 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, · 109 unmodified lines
11771178 PAGE_SIZE - user_addr / PAGE_SIZE);
11781179 }
11791180
1181+ blk_start_plug(&plug);
1182+
11801183 for (seg = 0; seg < nr_segs; seg++) {
11811184 user_addr = (unsigned long)iov[seg].iov_base;
11821185 sdio.size += bytes = iov[seg].iov_len;
@@ -1235,6 +1238,8 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, · 52 unmodified lines
12351238 if (sdio.bio)
12361239 dio_bio_submit(dio, &sdio);
12371240
1241+ blk_finish_plug(&plug);
1242+
12381243 /*
12391244 * It is possible that, we return short IO due to end of file.
12401245 * In that case, we need to release all the pages we got hold on.
fs/jbd/journal.c+5−0
@@ -1113,6 +1113,11 @@ static void mark_journal_empty(journal_t *journal) · 1112 unmodified lines
11131113
11141114 BUG_ON(!mutex_is_locked(&journal->j_checkpoint_mutex));
11151115 spin_lock(&journal->j_state_lock);
1116+ /* Is it already empty? */
1117+ if (sb->s_start == 0) {
1118+ spin_unlock(&journal->j_state_lock);
1119+ return;
1120+ }
11161121 jbd_debug(1, "JBD: Marking journal as empty (seq %d)\n",
11171122 journal->j_tail_sequence);
11181123
fs/logfs/dev_bdev.c+7−8
@@ -26,6 +26,7 @@ static int sync_request(struct page *page, struct block_device *bdev, int rw) · 25 unmodified lines
2626 struct completion complete;
2727
2828 bio_init(&bio);
29+ bio.bi_max_vecs = 1;
2930 bio.bi_io_vec = &bio_vec;
3031 bio_vec.bv_page = page;
3132 bio_vec.bv_len = PAGE_SIZE;
@@ -95,12 +96,11 @@ static int __bdev_writeseg(struct super_block *sb, u64 ofs, pgoff_t index, · 63 unmodified lines
9596 struct address_space *mapping = super->s_mapping_inode->i_mapping;
9697 struct bio *bio;
9798 struct page *page;
98− struct request_queue *q = bdev_get_queue(sb->s_bdev);
99− unsigned int max_pages = queue_max_hw_sectors(q) >> (PAGE_SHIFT - 9);
99+ unsigned int max_pages;
100100 int i;
101101
102− if (max_pages > BIO_MAX_PAGES)
103− max_pages = BIO_MAX_PAGES;
102+ max_pages = min(nr_pages, (size_t) bio_get_nr_vecs(super->s_bdev));
103+
104104 bio = bio_alloc(GFP_NOFS, max_pages);
105105 BUG_ON(!bio);
106106
@@ -190,12 +190,11 @@ static int do_erase(struct super_block *sb, u64 ofs, pgoff_t index, · 83 unmodified lines
190190 {
191191 struct logfs_super *super = logfs_super(sb);
192192 struct bio *bio;
193− struct request_queue *q = bdev_get_queue(sb->s_bdev);
194− unsigned int max_pages = queue_max_hw_sectors(q) >> (PAGE_SHIFT - 9);
193+ unsigned int max_pages;
195194 int i;
196195
197− if (max_pages > BIO_MAX_PAGES)
198− max_pages = BIO_MAX_PAGES;
196+ max_pages = min(nr_pages, (size_t) bio_get_nr_vecs(super->s_bdev));
197+
199198 bio = bio_alloc(GFP_NOFS, max_pages);
200199 BUG_ON(!bio);
201200
fs/logfs/inode.c+17−1
@@ -156,10 +156,26 @@ static void __logfs_destroy_inode(struct inode *inode) · 155 unmodified lines
156156 call_rcu(&inode->i_rcu, logfs_i_callback);
157157 }
158158
159+static void __logfs_destroy_meta_inode(struct inode *inode)
160+{
161+ struct logfs_inode *li = logfs_inode(inode);
162+ BUG_ON(li->li_block);
163+ call_rcu(&inode->i_rcu, logfs_i_callback);
164+}
165+
159166 static void logfs_destroy_inode(struct inode *inode)
160167 {
161168 struct logfs_inode *li = logfs_inode(inode);
162169
170+ if (inode->i_ino < LOGFS_RESERVED_INOS) {
171+ /*
172+ * The reserved inodes are never destroyed unless we are in
173+ * unmont path.
174+ */
175+ __logfs_destroy_meta_inode(inode);
176+ return;
177+ }
178+
163179 BUG_ON(list_empty(&li->li_freeing_list));
164180 spin_lock(&logfs_inode_lock);
165181 li->li_refcount--;
@@ -373,8 +389,8 @@ static void logfs_put_super(struct super_block *sb) · 207 unmodified lines
373389 {
374390 struct logfs_super *super = logfs_super(sb);
375391 /* kill the meta-inodes */
376− iput(super->s_master_inode);
377392 iput(super->s_segfile_inode);
393+ iput(super->s_master_inode);
378394 iput(super->s_mapping_inode);
379395 }
380396
fs/logfs/journal.c+1−1
@@ -565,7 +565,7 @@ static void write_wbuf(struct super_block *sb, struct logfs_area *area, · 564 unmodified lines
565565 index = ofs >> PAGE_SHIFT;
566566 page_ofs = ofs & (PAGE_SIZE - 1);
567567
568− page = find_lock_page(mapping, index);
568+ page = find_or_create_page(mapping, index, GFP_NOFS);
569569 BUG_ON(!page);
570570 memcpy(wbuf, page_address(page) + page_ofs, super->s_writesize);
571571 unlock_page(page);
fs/logfs/readwrite.c+0−1
@@ -2189,7 +2189,6 @@ void logfs_evict_inode(struct inode *inode) · 2188 unmodified lines
21892189 return;
21902190 }
21912191
2192− BUG_ON(inode->i_ino < LOGFS_RESERVED_INOS);
21932192 page = inode_to_page(inode);
21942193 BUG_ON(!page); /* FIXME: Use emergency page */
21952194 logfs_put_write_page(page);
fs/logfs/segment.c+1−1
@@ -886,7 +886,7 @@ static struct logfs_area *alloc_area(struct super_block *sb) · 885 unmodified lines
886886
887887 static void map_invalidatepage(struct page *page, unsigned long l)
888888 {
889− BUG();
889+ return;
890890 }
891891
892892 static int map_releasepage(struct page *page, gfp_t g)
fs/nfsd/nfs4callback.c+2−2
@@ -651,12 +651,12 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c · 650 unmodified lines
651651
652652 if (clp->cl_minorversion == 0) {
653653 if (!clp->cl_cred.cr_principal &&
654− (clp->cl_flavor >= RPC_AUTH_GSS_KRB5))
654+ (clp->cl_cred.cr_flavor >= RPC_AUTH_GSS_KRB5))
655655 return -EINVAL;
656656 args.client_name = clp->cl_cred.cr_principal;
657657 args.prognumber = conn->cb_prog,
658658 args.protocol = XPRT_TRANSPORT_TCP;
659− args.authflavor = clp->cl_flavor;
659+ args.authflavor = clp->cl_cred.cr_flavor;
660660 clp->cl_cb_ident = conn->cb_ident;
661661 } else {
662662 if (!conn->cb_xprt)
fs/nfsd/state.h+0−1
@@ -231,7 +231,6 @@ struct nfs4_client { · 230 unmodified lines
231231 nfs4_verifier cl_verifier; /* generated by client */
232232 time_t cl_time; /* time of last lease renewal */
233233 struct sockaddr_storage cl_addr; /* client ipaddress */
234− u32 cl_flavor; /* setclientid pseudoflavor */
235234 struct svc_cred cl_cred; /* setclientid principal */
236235 clientid_t cl_clientid; /* generated by server */
237236 nfs4_verifier cl_confirm; /* generated by server */
fs/quota/dquot.c+1−1
@@ -1589,10 +1589,10 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags) · 1588 unmodified lines
15891589 goto out;
15901590 }
15911591
1592− down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
15931592 for (cnt = 0; cnt < MAXQUOTAS; cnt++)
15941593 warn[cnt].w_type = QUOTA_NL_NOWARN;
15951594
1595+ down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
15961596 spin_lock(&dq_data_lock);
15971597 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
15981598 if (!dquots[cnt])
fs/reiserfs/bitmap.c+0−2
@@ -1334,9 +1334,7 @@ struct buffer_head *reiserfs_read_bitmap_block(struct super_block *sb, · 1333 unmodified lines
13341334 else if (bitmap == 0)
13351335 block = (REISERFS_DISK_OFFSET_IN_BYTES >> sb->s_blocksize_bits) + 1;
13361336
1337− reiserfs_write_unlock(sb);
13381337 bh = sb_bread(sb, block);
1339− reiserfs_write_lock(sb);
13401338 if (bh == NULL)
13411339 reiserfs_warning(sb, "sh-2029: %s: bitmap block (#%u) "
13421340 "reading failed", __func__, block);
fs/reiserfs/inode.c+1−1
@@ -76,10 +76,10 @@ void reiserfs_evict_inode(struct inode *inode) · 75 unmodified lines
7676 ;
7777 }
7878 out:
79+ reiserfs_write_unlock_once(inode->i_sb, depth);
7980 clear_inode(inode); /* note this must go after the journal_end to prevent deadlock */
8081 dquot_drop(inode);
8182 inode->i_blocks = 0;
82− reiserfs_write_unlock_once(inode->i_sb, depth);
8383 return;
8484
8585 no_delete:
fs/ubifs/debug.h+1−1
@@ -167,7 +167,7 @@ struct ubifs_global_debug_info { · 166 unmodified lines
167167 #define ubifs_dbg_msg(type, fmt, ...) \
168168 pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__)
169169
170−#define DBG_KEY_BUF_LEN 32
170+#define DBG_KEY_BUF_LEN 48
171171 #define ubifs_dbg_msg_key(type, key, fmt, ...) do { \
172172 char __tmp_key_buf[DBG_KEY_BUF_LEN]; \
173173 pr_debug("UBIFS DBG " type ": " fmt "%s\n", ##__VA_ARGS__, \
fs/ubifs/lpt.c+4−1
@@ -1749,7 +1749,10 @@ int ubifs_lpt_init(struct ubifs_info *c, int rd, int wr) · 1748 unmodified lines
17491749 return 0;
17501750
17511751 out_err:
1752− ubifs_lpt_free(c, 0);
1752+ if (wr)
1753+ ubifs_lpt_free(c, 1);
1754+ if (rd)
1755+ ubifs_lpt_free(c, 0);
17531756 return err;
17541757 }
17551758
fs/ubifs/recovery.c+1−1
@@ -788,7 +788,7 @@ struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum, · 787 unmodified lines
788788
789789 corrupted_rescan:
790790 /* Re-scan the corrupted data with verbose messages */
791− ubifs_err("corruptio %d", ret);
791+ ubifs_err("corruption %d", ret);
792792 ubifs_scan_a_node(c, buf, len, lnum, offs, 1);
793793 corrupted:
794794 ubifs_scanned_corruption(c, lnum, offs, buf);
fs/ubifs/replay.c+1−2
@@ -1026,7 +1026,6 @@ int ubifs_replay_journal(struct ubifs_info *c) · 1025 unmodified lines
10261026 c->replaying = 1;
10271027 lnum = c->ltail_lnum = c->lhead_lnum;
10281028
1029− lnum = UBIFS_LOG_LNUM;
10301029 do {
10311030 err = replay_log_leb(c, lnum, 0, c->sbuf);
10321031 if (err == 1)
@@ -1035,7 +1034,7 @@ int ubifs_replay_journal(struct ubifs_info *c) · 2 unmodified lines
10351034 if (err)
10361035 goto out;
10371036 lnum = ubifs_next_log_lnum(c, lnum);
1038− } while (lnum != UBIFS_LOG_LNUM);
1037+ } while (lnum != c->ltail_lnum);
10391038
10401039 err = replay_buds(c);
10411040 if (err)
fs/ubifs/super.c+0−3
@@ -1157,9 +1157,6 @@ static int check_free_space(struct ubifs_info *c) · 1156 unmodified lines
11571157 *
11581158 * This function mounts UBIFS file system. Returns zero in case of success and
11591159 * a negative error code in case of failure.
1160− *
1161− * Note, the function does not de-allocate resources it it fails half way
1162− * through, and the caller has to do this instead.
11631160 */
11641161 static int mount_ubifs(struct ubifs_info *c)
11651162 {
fs/udf/inode.c+4−1
@@ -1124,14 +1124,17 @@ int udf_setsize(struct inode *inode, loff_t newsize) · 1123 unmodified lines
11241124 if (err)
11251125 return err;
11261126 down_write(&iinfo->i_data_sem);
1127− } else
1127+ } else {
11281128 iinfo->i_lenAlloc = newsize;
1129+ goto set_size;
1130+ }
11291131 }
11301132 err = udf_extend_file(inode, newsize);
11311133 if (err) {
11321134 up_write(&iinfo->i_data_sem);
11331135 return err;
11341136 }
1137+set_size:
11351138 truncate_setsize(inode, newsize);
11361139 up_write(&iinfo->i_data_sem);
11371140 } else {
fs/udf/super.c+6−1
@@ -1344,6 +1344,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, · 1343 unmodified lines
13441344 udf_err(sb, "error loading logical volume descriptor: "
13451345 "Partition table too long (%u > %lu)\n", table_len,
13461346 sb->s_blocksize - sizeof(*lvd));
1347+ ret = 1;
13471348 goto out_bh;
13481349 }
13491350
@@ -1388,8 +1389,10 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, · 38 unmodified lines
13881389 UDF_ID_SPARABLE,
13891390 strlen(UDF_ID_SPARABLE))) {
13901391 if (udf_load_sparable_map(sb, map,
1391− (struct sparablePartitionMap *)gpm) < 0)
1392+ (struct sparablePartitionMap *)gpm) < 0) {
1393+ ret = 1;
13921394 goto out_bh;
1395+ }
13931396 } else if (!strncmp(upm2->partIdent.ident,
13941397 UDF_ID_METADATA,
13951398 strlen(UDF_ID_METADATA))) {
@@ -2000,6 +2003,8 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) · 604 unmodified lines
20002003 if (!silent)
20012004 pr_notice("Rescanning with blocksize %d\n",
20022005 UDF_DEFAULT_BLOCKSIZE);
2006+ brelse(sbi->s_lvid_bh);
2007+ sbi->s_lvid_bh = NULL;
20032008 uopt.blocksize = UDF_DEFAULT_BLOCKSIZE;
20042009 ret = udf_load_vrs(sb, &uopt, silent, &fileset);
20052010 }
fs/xfs/xfs_discard.c+4−2
@@ -179,12 +179,14 @@ xfs_ioc_trim( · 178 unmodified lines
179179 * used by the fstrim application. In the end it really doesn't
180180 * matter as trimming blocks is an advisory interface.
181181 */
182+ if (range.start >= XFS_FSB_TO_B(mp, mp->m_sb.sb_dblocks) ||
183+ range.minlen > XFS_FSB_TO_B(mp, XFS_ALLOC_AG_MAX_USABLE(mp)))
184+ return -XFS_ERROR(EINVAL);
185+
182186 start = BTOBB(range.start);
183187 end = start + BTOBBT(range.len) - 1;
184188 minlen = BTOBB(max_t(u64, granularity, range.minlen));
185189
186− if (XFS_BB_TO_FSB(mp, start) >= mp->m_sb.sb_dblocks)
187− return -XFS_ERROR(EINVAL);
188190 if (end > XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks) - 1)
189191 end = XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)- 1;
190192
fs/xfs/xfs_ialloc.c+9−8
@@ -962,23 +962,22 @@ xfs_dialloc( · 961 unmodified lines
962962 if (!pag->pagi_freecount && !okalloc)
963963 goto nextag;
964964
965+ /*
966+ * Then read in the AGI buffer and recheck with the AGI buffer
967+ * lock held.
968+ */
965969 error = xfs_ialloc_read_agi(mp, tp, agno, &agbp);
966970 if (error)
967971 goto out_error;
968972
969− /*
970− * Once the AGI has been read in we have to recheck
971− * pagi_freecount with the AGI buffer lock held.
972− */
973973 if (pag->pagi_freecount) {
974974 xfs_perag_put(pag);
975975 goto out_alloc;
976976 }
977977
978− if (!okalloc) {
979− xfs_trans_brelse(tp, agbp);
980− goto nextag;
981− }
978+ if (!okalloc)
979+ goto nextag_relse_buffer;
980+
982981
983982 error = xfs_ialloc_ag_alloc(tp, agbp, &ialloced);
984983 if (error) {
@@ -1007,6 +1006,8 @@ xfs_dialloc( · 22 unmodified lines
10071006 return 0;
10081007 }
10091008
1009+nextag_relse_buffer:
1010+ xfs_trans_brelse(tp, agbp);
10101011 nextag:
10111012 xfs_perag_put(pag);
10121013 if (++agno == mp->m_sb.sb_agcount)
fs/xfs/xfs_rtalloc.c+1−1
@@ -857,7 +857,7 @@ xfs_rtbuf_get( · 856 unmodified lines
857857 xfs_buf_t *bp; /* block buffer, result */
858858 xfs_inode_t *ip; /* bitmap or summary inode */
859859 xfs_bmbt_irec_t map;
860− int nmap;
860+ int nmap = 1;
861861 int error; /* error value */
862862
863863 ip = issum ? mp->m_rsumip : mp->m_rbmip;
include/drm/drm_crtc.h+2−1
@@ -118,7 +118,8 @@ enum drm_mode_status { · 117 unmodified lines
118118 .hdisplay = (hd), .hsync_start = (hss), .hsync_end = (hse), \
119119 .htotal = (ht), .hskew = (hsk), .vdisplay = (vd), \
120120 .vsync_start = (vss), .vsync_end = (vse), .vtotal = (vt), \
121− .vscan = (vs), .flags = (f), .vrefresh = 0
121+ .vscan = (vs), .flags = (f), .vrefresh = 0, \
122+ .base.type = DRM_MODE_OBJECT_MODE
122123
123124 #define CRTC_INTERLACE_HALVE_V 0x1 /* halve V values for interlacing */
124125
include/drm/drm_mode.h+3−2
@@ -359,8 +359,9 @@ struct drm_mode_mode_cmd { · 358 unmodified lines
359359 struct drm_mode_modeinfo mode;
360360 };
361361
362−#define DRM_MODE_CURSOR_BO (1<<0)
363−#define DRM_MODE_CURSOR_MOVE (1<<1)
362+#define DRM_MODE_CURSOR_BO 0x01
363+#define DRM_MODE_CURSOR_MOVE 0x02
364+#define DRM_MODE_CURSOR_FLAGS 0x03
364365
365366 /*
366367 * depending on the value in flags different members are used.
include/linux/blkdev.h+13−1
@@ -601,7 +601,7 @@ static inline void blk_clear_rl_full(struct request_list *rl, bool sync) · 600 unmodified lines
601601 * it already be started by driver.
602602 */
603603 #define RQ_NOMERGE_FLAGS \
604− (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA)
604+ (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA | REQ_DISCARD)
605605 #define rq_mergeable(rq) \
606606 (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \
607607 (((rq)->cmd_flags & REQ_DISCARD) || \
@@ -894,6 +894,8 @@ extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable); · 286 unmodified lines
894894 extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
895895
896896 extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *);
897+extern int blk_bio_map_sg(struct request_queue *q, struct bio *bio,
898+ struct scatterlist *sglist);
897899 extern void blk_dump_rq_flags(struct request *, char *);
898900 extern long nr_blockdev_pages(void);
899901
@@ -1139,6 +1141,16 @@ static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector · 239 unmodified lines
11391141 & (lim->discard_granularity - 1);
11401142 }
11411143
1144+static inline int bdev_discard_alignment(struct block_device *bdev)
1145+{
1146+ struct request_queue *q = bdev_get_queue(bdev);
1147+
1148+ if (bdev != bdev->bd_contains)
1149+ return bdev->bd_part->discard_alignment;
1150+
1151+ return q->limits.discard_alignment;
1152+}
1153+
11421154 static inline unsigned int queue_discard_zeroes_data(struct request_queue *q)
11431155 {
11441156 if (q->limits.max_discard_sectors && q->limits.discard_zeroes_data == 1)
include/linux/cpuidle.h+4−0
@@ -194,6 +194,10 @@ static inline int cpuidle_play_dead(void) {return -ENODEV; } · 193 unmodified lines
194194
195195 #ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
196196 void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a);
197+#else
198+static inline void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a)
199+{
200+}
197201 #endif
198202
199203 /******************************
include/linux/kernel.h+10−2
@@ -82,10 +82,18 @@ · 81 unmodified lines
8282 __x - (__x % (y)); \
8383 } \
8484 )
85+
86+/*
87+ * Divide positive or negative dividend by positive divisor and round
88+ * to closest integer. Result is undefined for negative divisors.
89+ */
8590 #define DIV_ROUND_CLOSEST(x, divisor)( \
8691 { \
87− typeof(divisor) __divisor = divisor; \
88− (((x) + ((__divisor) / 2)) / (__divisor)); \
92+ typeof(x) __x = x; \
93+ typeof(divisor) __d = divisor; \
94+ (((typeof(x))-1) >= 0 || (__x) >= 0) ? \
95+ (((__x) + ((__d) / 2)) / (__d)) : \
96+ (((__x) - ((__d) / 2)) / (__d)); \
8997 } \
9098 )
9199
include/linux/ktime.h+0−7
@@ -58,13 +58,6 @@ union ktime { · 57 unmodified lines
5858
5959 typedef union ktime ktime_t; /* Kill this */
6060
61−#define KTIME_MAX ((s64)~((u64)1 << 63))
62−#if (BITS_PER_LONG == 64)
63−# define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
64−#else
65−# define KTIME_SEC_MAX LONG_MAX
66−#endif
67−
6861 /*
6962 * ktime_t definitions when using the 64-bit scalar representation:
7063 */
include/linux/mmc/card.h+1−0
@@ -239,6 +239,7 @@ struct mmc_card { · 238 unmodified lines
239239 #define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */
240240 #define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8) /* Avoid sending 512 bytes in */
241241 #define MMC_QUIRK_LONG_READ_TIME (1<<9) /* Data read time > CSD says */
242+#define MMC_QUIRK_SEC_ERASE_TRIM_BROKEN (1<<10) /* Skip secure for erase/trim */
242243 /* byte mode */
243244 unsigned int poweroff_notify_state; /* eMMC4.5 notify feature */
244245 #define MMC_NO_POWER_NOTIFICATION 0
include/linux/mv643xx_eth.h+2−0
@@ -15,6 +15,8 @@ · 14 unmodified lines
1515 #define MV643XX_ETH_SIZE_REG_4 0x2224
1616 #define MV643XX_ETH_BASE_ADDR_ENABLE_REG 0x2290
1717
18+#define MV643XX_TX_CSUM_DEFAULT_LIMIT 0
19+
1820 struct mv643xx_eth_shared_platform_data {
1921 struct mbus_dram_target_info *dram;
2022 struct platform_device *shared_smi;
include/linux/omapfb.h+6−1
@@ -220,7 +220,12 @@ struct omapfb_display_info { · 219 unmodified lines
220220
221221 #ifdef __KERNEL__
222222
223−#include <plat/board.h>
223+struct omap_lcd_config {
224+ char panel_name[16];
225+ char ctrl_name[16];
226+ s16 nreset_gpio;
227+ u8 data_lines;
228+};
224229
225230 struct omapfb_platform_data {
226231 struct omap_lcd_config lcd;
include/linux/pci_ids.h+1−1
@@ -2149,7 +2149,7 @@ · 2148 unmodified lines
21492149 #define PCI_DEVICE_ID_TIGON3_5704S 0x16a8
21502150 #define PCI_DEVICE_ID_NX2_57800_VF 0x16a9
21512151 #define PCI_DEVICE_ID_NX2_5706S 0x16aa
2152−#define PCI_DEVICE_ID_NX2_57840_MF 0x16ab
2152+#define PCI_DEVICE_ID_NX2_57840_MF 0x16a4
21532153 #define PCI_DEVICE_ID_NX2_5708S 0x16ac
21542154 #define PCI_DEVICE_ID_NX2_57840_VF 0x16ad
21552155 #define PCI_DEVICE_ID_NX2_57810_MF 0x16ae
include/linux/platform_data/omap1_bl.h+11−0
@@ -0,0 +1,11 @@
1+#ifndef __OMAP1_BL_H__
2+#define __OMAP1_BL_H__
3+
4+#include <linux/device.h>
5+
6+struct omap_backlight_config {
7+ int default_intensity;
8+ int (*set_power)(struct device *dev, int state);
9+};
10+
11+#endif
include/linux/time.h+27−2
@@ -107,11 +107,36 @@ static inline struct timespec timespec_sub(struct timespec lhs, · 106 unmodified lines
107107 return ts_delta;
108108 }
109109
110+#define KTIME_MAX ((s64)~((u64)1 << 63))
111+#if (BITS_PER_LONG == 64)
112+# define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
113+#else
114+# define KTIME_SEC_MAX LONG_MAX
115+#endif
116+
110117 /*
111118 * Returns true if the timespec is norm, false if denorm:
112119 */
113−#define timespec_valid(ts) \
114− (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC))
120+static inline bool timespec_valid(const struct timespec *ts)
121+{
122+ /* Dates before 1970 are bogus */
123+ if (ts->tv_sec < 0)
124+ return false;
125+ /* Can't have more nanoseconds then a second */
126+ if ((unsigned long)ts->tv_nsec >= NSEC_PER_SEC)
127+ return false;
128+ return true;
129+}
130+
131+static inline bool timespec_valid_strict(const struct timespec *ts)
132+{
133+ if (!timespec_valid(ts))
134+ return false;
135+ /* Disallow values that could overflow ktime_t */
136+ if ((unsigned long long)ts->tv_sec >= KTIME_SEC_MAX)
137+ return false;
138+ return true;
139+}
115140
116141 extern void read_persistent_clock(struct timespec *ts);
117142 extern void read_boot_clock(struct timespec *ts);
include/net/netfilter/nf_conntrack_ecache.h+1−0
@@ -18,6 +18,7 @@ struct nf_conntrack_ecache { · 17 unmodified lines
1818 u16 ctmask; /* bitmask of ct events to be delivered */
1919 u16 expmask; /* bitmask of expect events to be delivered */
2020 u32 pid; /* netlink pid of destroyer */
21+ struct timer_list timeout;
2122 };
2223
2324 static inline struct nf_conntrack_ecache *
include/xen/events.h+0−2
@@ -58,8 +58,6 @@ void notify_remote_via_irq(int irq); · 57 unmodified lines
5858
5959 void xen_irq_resume(void);
6060
61−void xen_hvm_prepare_kexec(struct shared_info *sip, unsigned long pfn);
62−
6361 /* Clear an irq's pending state, in preparation for polling on it */
6462 void xen_clear_irq_pending(int irq);
6563 void xen_set_irq_pending(int irq);
kernel/fork.c+2−2
@@ -455,8 +455,8 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) · 454 unmodified lines
455455 if (retval)
456456 goto out;
457457
458− if (file && uprobe_mmap(tmp))
459− goto out;
458+ if (file)
459+ uprobe_mmap(tmp);
460460 }
461461 /* a new mm has just been created */
462462 arch_dup_mmap(oldmm, mm);
kernel/time/timekeeping.c+33−6
@@ -115,6 +115,7 @@ static void tk_xtime_add(struct timekeeper *tk, const struct timespec *ts) · 114 unmodified lines
115115 {
116116 tk->xtime_sec += ts->tv_sec;
117117 tk->xtime_nsec += (u64)ts->tv_nsec << tk->shift;
118+ tk_normalize_xtime(tk);
118119 }
119120
120121 static void tk_set_wall_to_mono(struct timekeeper *tk, struct timespec wtm)
@@ -276,7 +277,7 @@ static void timekeeping_forward_now(struct timekeeper *tk) · 155 unmodified lines
276277 tk->xtime_nsec += cycle_delta * tk->mult;
277278
278279 /* If arch requires, add in gettimeoffset() */
279− tk->xtime_nsec += arch_gettimeoffset() << tk->shift;
280+ tk->xtime_nsec += (u64)arch_gettimeoffset() << tk->shift;
280281
281282 tk_normalize_xtime(tk);
282283
@@ -427,7 +428,7 @@ int do_settimeofday(const struct timespec *tv) · 144 unmodified lines
427428 struct timespec ts_delta, xt;
428429 unsigned long flags;
429430
430− if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
431+ if (!timespec_valid_strict(tv))
431432 return -EINVAL;
432433
433434 write_seqlock_irqsave(&tk->lock, flags);
@@ -463,6 +464,8 @@ int timekeeping_inject_offset(struct timespec *ts) · 29 unmodified lines
463464 {
464465 struct timekeeper *tk = &timekeeper;
465466 unsigned long flags;
467+ struct timespec tmp;
468+ int ret = 0;
466469
467470 if ((unsigned long)ts->tv_nsec >= NSEC_PER_SEC)
468471 return -EINVAL;
@@ -471,10 +474,17 @@ int timekeeping_inject_offset(struct timespec *ts) · 2 unmodified lines
471474
472475 timekeeping_forward_now(tk);
473476
477+ /* Make sure the proposed value is valid */
478+ tmp = timespec_add(tk_xtime(tk), *ts);
479+ if (!timespec_valid_strict(&tmp)) {
480+ ret = -EINVAL;
481+ goto error;
482+ }
474483
475484 tk_xtime_add(tk, ts);
476485 tk_set_wall_to_mono(tk, timespec_sub(tk->wall_to_monotonic, *ts));
477486
487+error: /* even if we error out, we forwarded the time, so call update */
478488 timekeeping_update(tk, true);
479489
480490 write_sequnlock_irqrestore(&tk->lock, flags);
@@ -482,7 +492,7 @@ int timekeeping_inject_offset(struct timespec *ts) · 1 unmodified line
482492 /* signal hrtimers about time change */
483493 clock_was_set();
484494
485− return 0;
495+ return ret;
486496 }
487497 EXPORT_SYMBOL(timekeeping_inject_offset);
488498
@@ -649,7 +659,20 @@ void __init timekeeping_init(void) · 160 unmodified lines
649659 struct timespec now, boot, tmp;
650660
651661 read_persistent_clock(&now);
662+ if (!timespec_valid_strict(&now)) {
663+ pr_warn("WARNING: Persistent clock returned invalid value!\n"
664+ " Check your CMOS/BIOS settings.\n");
665+ now.tv_sec = 0;
666+ now.tv_nsec = 0;
667+ }
668+
652669 read_boot_clock(&boot);
670+ if (!timespec_valid_strict(&boot)) {
671+ pr_warn("WARNING: Boot clock returned invalid value!\n"
672+ " Check your CMOS/BIOS settings.\n");
673+ boot.tv_sec = 0;
674+ boot.tv_nsec = 0;
675+ }
653676
654677 seqlock_init(&tk->lock);
655678
@@ -690,7 +713,7 @@ static struct timespec timekeeping_suspend_time; · 34 unmodified lines
690713 static void __timekeeping_inject_sleeptime(struct timekeeper *tk,
691714 struct timespec *delta)
692715 {
693− if (!timespec_valid(delta)) {
716+ if (!timespec_valid_strict(delta)) {
694717 printk(KERN_WARNING "__timekeeping_inject_sleeptime: Invalid "
695718 "sleep delta value!\n");
696719 return;
@@ -1129,6 +1152,10 @@ static void update_wall_time(void) · 432 unmodified lines
11291152 offset = (clock->read(clock) - clock->cycle_last) & clock->mask;
11301153 #endif
11311154
1155+ /* Check if there's really nothing to do */
1156+ if (offset < tk->cycle_interval)
1157+ goto out;
1158+
11321159 /*
11331160 * With NO_HZ we may have to accumulate many cycle_intervals
11341161 * (think "ticks") worth of time at once. To do this efficiently,
@@ -1161,9 +1188,9 @@ static void update_wall_time(void) · 26 unmodified lines
11611188 * the vsyscall implementations are converted to use xtime_nsec
11621189 * (shifted nanoseconds), this can be killed.
11631190 */
1164− remainder = tk->xtime_nsec & ((1 << tk->shift) - 1);
1191+ remainder = tk->xtime_nsec & ((1ULL << tk->shift) - 1);
11651192 tk->xtime_nsec -= remainder;
1166− tk->xtime_nsec += 1 << tk->shift;
1193+ tk->xtime_nsec += 1ULL << tk->shift;
11671194 tk->ntp_error += remainder << tk->ntp_error_shift;
11681195
11691196 /*
kernel/trace/trace_syscalls.c+4−0
@@ -506,6 +506,8 @@ static void perf_syscall_enter(void *ignore, struct pt_regs *regs, long id) · 505 unmodified lines
506506 int size;
507507
508508 syscall_nr = syscall_get_nr(current, regs);
509+ if (syscall_nr < 0)
510+ return;
509511 if (!test_bit(syscall_nr, enabled_perf_enter_syscalls))
510512 return;
511513
@@ -580,6 +582,8 @@ static void perf_syscall_exit(void *ignore, struct pt_regs *regs, long ret) · 68 unmodified lines
580582 int size;
581583
582584 syscall_nr = syscall_get_nr(current, regs);
585+ if (syscall_nr < 0)
586+ return;
583587 if (!test_bit(syscall_nr, enabled_perf_exit_syscalls))
584588 return;
585589
mm/filemap.c+0−7
@@ -1412,12 +1412,8 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov, · 1411 unmodified lines
14121412 retval = filemap_write_and_wait_range(mapping, pos,
14131413 pos + iov_length(iov, nr_segs) - 1);
14141414 if (!retval) {
1415− struct blk_plug plug;
1416−
1417− blk_start_plug(&plug);
14181415 retval = mapping->a_ops->direct_IO(READ, iocb,
14191416 iov, pos, nr_segs);
1420− blk_finish_plug(&plug);
14211417 }
14221418 if (retval > 0) {
14231419 *ppos = pos + retval;
@@ -2527,14 +2523,12 @@ ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, · 1103 unmodified lines
25272523 {
25282524 struct file *file = iocb->ki_filp;
25292525 struct inode *inode = file->f_mapping->host;
2530− struct blk_plug plug;
25312526 ssize_t ret;
25322527
25332528 BUG_ON(iocb->ki_pos != pos);
25342529
25352530 sb_start_write(inode->i_sb);
25362531 mutex_lock(&inode->i_mutex);
2537− blk_start_plug(&plug);
25382532 ret = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos);
25392533 mutex_unlock(&inode->i_mutex);
25402534
@@ -2545,7 +2539,6 @@ ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, · 4 unmodified lines
25452539 if (err < 0 && ret > 0)
25462540 ret = err;
25472541 }
2548− blk_finish_plug(&plug);
25492542 sb_end_write(inode->i_sb);
25502543 return ret;
25512544 }
mm/mempolicy.c+1−1
@@ -2562,7 +2562,7 @@ int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, int no_context) · 2561 unmodified lines
25622562 break;
25632563
25642564 default:
2565− BUG();
2565+ return -EINVAL;
25662566 }
25672567
25682568 l = strlen(policy_modes[mode]);
mm/mmap.c+2−3
@@ -1356,9 +1356,8 @@ out: · 1355 unmodified lines
13561356 } else if ((flags & MAP_POPULATE) && !(flags & MAP_NONBLOCK))
13571357 make_pages_present(addr, addr + len);
13581358
1359− if (file && uprobe_mmap(vma))
1360− /* matching probes but cannot insert */
1361− goto unmap_and_free_vma;
1359+ if (file)
1360+ uprobe_mmap(vma);
13621361
13631362 return addr;
13641363
mm/slab.c+1−0
@@ -3260,6 +3260,7 @@ force_grow: · 3259 unmodified lines
32603260
32613261 /* cache_grow can reenable interrupts, then ac could change. */
32623262 ac = cpu_cache_get(cachep);
3263+ node = numa_mem_id();
32633264
32643265 /* no objects in sight? abort */
32653266 if (!x && (ac->avail == 0 || force_refill))
net/core/netpoll.c+1−9
@@ -168,24 +168,16 @@ static void poll_napi(struct net_device *dev) · 167 unmodified lines
168168 struct napi_struct *napi;
169169 int budget = 16;
170170
171− WARN_ON_ONCE(!irqs_disabled());
172−
173171 list_for_each_entry(napi, &dev->napi_list, dev_list) {
174− local_irq_enable();
175172 if (napi->poll_owner != smp_processor_id() &&
176173 spin_trylock(&napi->poll_lock)) {
177− rcu_read_lock_bh();
178174 budget = poll_one_napi(rcu_dereference_bh(dev->npinfo),
179175 napi, budget);
180− rcu_read_unlock_bh();
181176 spin_unlock(&napi->poll_lock);
182177
183− if (!budget) {
184− local_irq_disable();
178+ if (!budget)
185179 break;
186− }
187180 }
188− local_irq_disable();
189181 }
190182 }
191183
net/ipv4/ipmr.c+12−2
@@ -124,6 +124,8 @@ static DEFINE_SPINLOCK(mfc_unres_lock); · 123 unmodified lines
124124 static struct kmem_cache *mrt_cachep __read_mostly;
125125
126126 static struct mr_table *ipmr_new_table(struct net *net, u32 id);
127+static void ipmr_free_table(struct mr_table *mrt);
128+
127129 static int ip_mr_forward(struct net *net, struct mr_table *mrt,
128130 struct sk_buff *skb, struct mfc_cache *cache,
129131 int local);
@@ -131,6 +133,7 @@ static int ipmr_cache_report(struct mr_table *mrt, · 1 unmodified line
131133 struct sk_buff *pkt, vifi_t vifi, int assert);
132134 static int __ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,
133135 struct mfc_cache *c, struct rtmsg *rtm);
136+static void mroute_clean_tables(struct mr_table *mrt);
134137 static void ipmr_expire_process(unsigned long arg);
135138
136139 #ifdef CONFIG_IP_MROUTE_MULTIPLE_TABLES
@@ -271,7 +274,7 @@ static void __net_exit ipmr_rules_exit(struct net *net) · 134 unmodified lines
271274
272275 list_for_each_entry_safe(mrt, next, &net->ipv4.mr_tables, list) {
273276 list_del(&mrt->list);
274− kfree(mrt);
277+ ipmr_free_table(mrt);
275278 }
276279 fib_rules_unregister(net->ipv4.mr_rules_ops);
277280 }
@@ -299,7 +302,7 @@ static int __net_init ipmr_rules_init(struct net *net) · 21 unmodified lines
299302
300303 static void __net_exit ipmr_rules_exit(struct net *net)
301304 {
302− kfree(net->ipv4.mrt);
305+ ipmr_free_table(net->ipv4.mrt);
303306 }
304307 #endif
305308
@@ -336,6 +339,13 @@ static struct mr_table *ipmr_new_table(struct net *net, u32 id) · 30 unmodified lines
336339 return mrt;
337340 }
338341
342+static void ipmr_free_table(struct mr_table *mrt)
343+{
344+ del_timer_sync(&mrt->ipmr_expire_timer);
345+ mroute_clean_tables(mrt);
346+ kfree(mrt);
347+}
348+
339349 /* Service routines creating virtual interfaces: DVMRP tunnels and PIMREG */
340350
341351 static void ipmr_del_tunnel(struct net_device *dev, struct vifctl *v)
net/ipv4/netfilter/nf_nat_sip.c+4−1
@@ -502,7 +502,10 @@ static unsigned int ip_nat_sdp_media(struct sk_buff *skb, unsigned int dataoff, · 501 unmodified lines
502502 ret = nf_ct_expect_related(rtcp_exp);
503503 if (ret == 0)
504504 break;
505− else if (ret != -EBUSY) {
505+ else if (ret == -EBUSY) {
506+ nf_ct_unexpect_related(rtp_exp);
507+ continue;
508+ } else if (ret < 0) {
506509 nf_ct_unexpect_related(rtp_exp);
507510 port = 0;
508511 break;
net/ipv4/route.c+4−2
@@ -934,12 +934,14 @@ static u32 __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu) · 933 unmodified lines
934934 if (mtu < ip_rt_min_pmtu)
935935 mtu = ip_rt_min_pmtu;
936936
937+ rcu_read_lock();
937938 if (fib_lookup(dev_net(rt->dst.dev), fl4, &res) == 0) {
938939 struct fib_nh *nh = &FIB_RES_NH(res);
939940
940941 update_or_create_fnhe(nh, fl4->daddr, 0, mtu,
941942 jiffies + ip_rt_mtu_expires);
942943 }
944+ rcu_read_unlock();
943945 return mtu;
944946 }
945947
@@ -956,7 +958,7 @@ static void ip_rt_update_pmtu(struct dst_entry *dst, struct sock *sk, · 10 unmodified lines
956958 dst->obsolete = DST_OBSOLETE_KILL;
957959 } else {
958960 rt->rt_pmtu = mtu;
959− dst_set_expires(&rt->dst, ip_rt_mtu_expires);
961+ rt->dst.expires = max(1UL, jiffies + ip_rt_mtu_expires);
960962 }
961963 }
962964
@@ -1263,7 +1265,7 @@ static void ipv4_dst_destroy(struct dst_entry *dst) · 300 unmodified lines
12631265 {
12641266 struct rtable *rt = (struct rtable *) dst;
12651267
1266− if (dst->flags & DST_NOCACHE) {
1268+ if (!list_empty(&rt->rt_uncached)) {
12671269 spin_lock_bh(&rt_uncached_lock);
12681270 list_del(&rt->rt_uncached);
12691271 spin_unlock_bh(&rt_uncached_lock);
net/ipv4/tcp_input.c+7−8
@@ -2926,13 +2926,14 @@ static void tcp_enter_recovery(struct sock *sk, bool ece_ack) · 2925 unmodified lines
29262926 * tcp_xmit_retransmit_queue().
29272927 */
29282928 static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked,
2929− int newly_acked_sacked, bool is_dupack,
2929+ int prior_sacked, bool is_dupack,
29302930 int flag)
29312931 {
29322932 struct inet_connection_sock *icsk = inet_csk(sk);
29332933 struct tcp_sock *tp = tcp_sk(sk);
29342934 int do_lost = is_dupack || ((flag & FLAG_DATA_SACKED) &&
29352935 (tcp_fackets_out(tp) > tp->reordering));
2936+ int newly_acked_sacked = 0;
29362937 int fast_rexmit = 0;
29372938
29382939 if (WARN_ON(!tp->packets_out && tp->sacked_out))
@@ -2992,6 +2993,7 @@ static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked, · 53 unmodified lines
29922993 tcp_add_reno_sack(sk);
29932994 } else
29942995 do_lost = tcp_try_undo_partial(sk, pkts_acked);
2996+ newly_acked_sacked = pkts_acked + tp->sacked_out - prior_sacked;
29952997 break;
29962998 case TCP_CA_Loss:
29972999 if (flag & FLAG_DATA_ACKED)
@@ -3013,6 +3015,7 @@ static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked, · 15 unmodified lines
30133015 if (is_dupack)
30143016 tcp_add_reno_sack(sk);
30153017 }
3018+ newly_acked_sacked = pkts_acked + tp->sacked_out - prior_sacked;
30163019
30173020 if (icsk->icsk_ca_state <= TCP_CA_Disorder)
30183021 tcp_try_undo_dsack(sk);
@@ -3590,7 +3593,6 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) · 571 unmodified lines
35903593 int prior_packets;
35913594 int prior_sacked = tp->sacked_out;
35923595 int pkts_acked = 0;
3593− int newly_acked_sacked = 0;
35943596 bool frto_cwnd = false;
35953597
35963598 /* If the ack is older than previous acks
@@ -3666,8 +3668,6 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) · 69 unmodified lines
36663668 flag |= tcp_clean_rtx_queue(sk, prior_fackets, prior_snd_una);
36673669
36683670 pkts_acked = prior_packets - tp->packets_out;
3669− newly_acked_sacked = (prior_packets - prior_sacked) -
3670− (tp->packets_out - tp->sacked_out);
36713671
36723672 if (tp->frto_counter)
36733673 frto_cwnd = tcp_process_frto(sk, flag);
@@ -3681,7 +3681,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) · 7 unmodified lines
36813681 tcp_may_raise_cwnd(sk, flag))
36823682 tcp_cong_avoid(sk, ack, prior_in_flight);
36833683 is_dupack = !(flag & (FLAG_SND_UNA_ADVANCED | FLAG_NOT_DUP));
3684− tcp_fastretrans_alert(sk, pkts_acked, newly_acked_sacked,
3684+ tcp_fastretrans_alert(sk, pkts_acked, prior_sacked,
36853685 is_dupack, flag);
36863686 } else {
36873687 if ((flag & FLAG_DATA_ACKED) && !frto_cwnd)
@@ -3698,7 +3698,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) · 10 unmodified lines
36983698 no_queue:
36993699 /* If data was DSACKed, see if we can undo a cwnd reduction. */
37003700 if (flag & FLAG_DSACKING_ACK)
3701− tcp_fastretrans_alert(sk, pkts_acked, newly_acked_sacked,
3701+ tcp_fastretrans_alert(sk, pkts_acked, prior_sacked,
37023702 is_dupack, flag);
37033703 /* If this ack opens up a zero window, clear backoff. It was
37043704 * being used to time the probes, and is probably far higher than
@@ -3718,8 +3718,7 @@ old_ack: · 13 unmodified lines
37183718 */
37193719 if (TCP_SKB_CB(skb)->sacked) {
37203720 flag |= tcp_sacktag_write_queue(sk, skb, prior_snd_una);
3721− newly_acked_sacked = tp->sacked_out - prior_sacked;
3722− tcp_fastretrans_alert(sk, pkts_acked, newly_acked_sacked,
3721+ tcp_fastretrans_alert(sk, pkts_acked, prior_sacked,
37233722 is_dupack, flag);
37243723 }
37253724
net/ipv6/esp6.c+3−3
@@ -167,8 +167,6 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb) · 166 unmodified lines
167167 struct esp_data *esp = x->data;
168168
169169 /* skb is pure payload to encrypt */
170− err = -ENOMEM;
171−
172170 aead = esp->aead;
173171 alen = crypto_aead_authsize(aead);
174172
@@ -203,8 +201,10 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb) · 28 unmodified lines
203201 }
204202
205203 tmp = esp_alloc_tmp(aead, nfrags + sglists, seqhilen);
206− if (!tmp)
204+ if (!tmp) {
205+ err = -ENOMEM;
207206 goto error;
207+ }
208208
209209 seqhi = esp_tmp_seqhi(tmp);
210210 iv = esp_tmp_iv(aead, tmp, seqhilen);
net/l2tp/l2tp_core.c+1−2
@@ -1347,11 +1347,10 @@ static void l2tp_tunnel_free(struct l2tp_tunnel *tunnel) · 1346 unmodified lines
13471347 /* Remove from tunnel list */
13481348 spin_lock_bh(&pn->l2tp_tunnel_list_lock);
13491349 list_del_rcu(&tunnel->list);
1350+ kfree_rcu(tunnel, rcu);
13501351 spin_unlock_bh(&pn->l2tp_tunnel_list_lock);
1351− synchronize_rcu();
13521352
13531353 atomic_dec(&l2tp_tunnel_count);
1354− kfree(tunnel);
13551354 }
13561355
13571356 /* Create a socket for the tunnel, if one isn't set up by
net/l2tp/l2tp_core.h+1−0
@@ -163,6 +163,7 @@ struct l2tp_tunnel_cfg { · 162 unmodified lines
163163
164164 struct l2tp_tunnel {
165165 int magic; /* Should be L2TP_TUNNEL_MAGIC */
166+ struct rcu_head rcu;
166167 rwlock_t hlist_lock; /* protect session_hlist */
167168 struct hlist_head session_hlist[L2TP_HASH_SIZE];
168169 /* hashed list of sessions,
net/mac80211/tx.c+16−22
@@ -1811,37 +1811,31 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, · 1810 unmodified lines
18111811 meshhdrlen = ieee80211_new_mesh_header(&mesh_hdr,
18121812 sdata, NULL, NULL);
18131813 } else {
1814− int is_mesh_mcast = 1;
1815− const u8 *mesh_da;
1814+ /* DS -> MBSS (802.11-2012 13.11.3.3).
1815+ * For unicast with unknown forwarding information,
1816+ * destination might be in the MBSS or if that fails
1817+ * forwarded to another mesh gate. In either case
1818+ * resolution will be handled in ieee80211_xmit(), so
1819+ * leave the original DA. This also works for mcast */
1820+ const u8 *mesh_da = skb->data;
1821+
1822+ if (mppath)
1823+ mesh_da = mppath->mpp;
1824+ else if (mpath)
1825+ mesh_da = mpath->dst;
1826+ rcu_read_unlock();
18161827
1817− if (is_multicast_ether_addr(skb->data))
1818− /* DA TA mSA AE:SA */
1819− mesh_da = skb->data;
1820− else {
1821− static const u8 bcast[ETH_ALEN] =
1822− { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
1823− if (mppath) {
1824− /* RA TA mDA mSA AE:DA SA */
1825− mesh_da = mppath->mpp;
1826− is_mesh_mcast = 0;
1827− } else if (mpath) {
1828− mesh_da = mpath->dst;
1829− is_mesh_mcast = 0;
1830− } else {
1831− /* DA TA mSA AE:SA */
1832− mesh_da = bcast;
1833− }
1834− }
18351828 hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc,
18361829 mesh_da, sdata->vif.addr);
1837− rcu_read_unlock();
1838− if (is_mesh_mcast)
1830+ if (is_multicast_ether_addr(mesh_da))
1831+ /* DA TA mSA AE:SA */
18391832 meshhdrlen =
18401833 ieee80211_new_mesh_header(&mesh_hdr,
18411834 sdata,
18421835 skb->data + ETH_ALEN,
18431836 NULL);
18441837 else
1838+ /* RA TA mDA mSA AE:DA SA */
18451839 meshhdrlen =
18461840 ieee80211_new_mesh_header(&mesh_hdr,
18471841 sdata,
net/netfilter/ipvs/ip_vs_ctl.c+3−1
@@ -1171,8 +1171,10 @@ ip_vs_add_service(struct net *net, struct ip_vs_service_user_kern *u, · 1170 unmodified lines
11711171 goto out_err;
11721172 }
11731173 svc->stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats);
1174− if (!svc->stats.cpustats)
1174+ if (!svc->stats.cpustats) {
1175+ ret = -ENOMEM;
11751176 goto out_err;
1177+ }
11761178
11771179 /* I'm the first user of the service */
11781180 atomic_set(&svc->usecnt, 0);
net/netfilter/nf_conntrack_core.c+11−5
@@ -249,12 +249,15 @@ static void death_by_event(unsigned long ul_conntrack) · 248 unmodified lines
249249 {
250250 struct nf_conn *ct = (void *)ul_conntrack;
251251 struct net *net = nf_ct_net(ct);
252+ struct nf_conntrack_ecache *ecache = nf_ct_ecache_find(ct);
253+
254+ BUG_ON(ecache == NULL);
252255
253256 if (nf_conntrack_event(IPCT_DESTROY, ct) < 0) {
254257 /* bad luck, let's retry again */
255− ct->timeout.expires = jiffies +
258+ ecache->timeout.expires = jiffies +
256259 (random32() % net->ct.sysctl_events_retry_timeout);
257− add_timer(&ct->timeout);
260+ add_timer(&ecache->timeout);
258261 return;
259262 }
260263 /* we've got the event delivered, now it's dying */
@@ -268,6 +271,9 @@ static void death_by_event(unsigned long ul_conntrack) · 7 unmodified lines
268271 void nf_ct_insert_dying_list(struct nf_conn *ct)
269272 {
270273 struct net *net = nf_ct_net(ct);
274+ struct nf_conntrack_ecache *ecache = nf_ct_ecache_find(ct);
275+
276+ BUG_ON(ecache == NULL);
271277
272278 /* add this conntrack to the dying list */
273279 spin_lock_bh(&nf_conntrack_lock);
@@ -275,10 +281,10 @@ void nf_ct_insert_dying_list(struct nf_conn *ct) · 1 unmodified line
275281 &net->ct.dying);
276282 spin_unlock_bh(&nf_conntrack_lock);
277283 /* set a new timer to retry event delivery */
278− setup_timer(&ct->timeout, death_by_event, (unsigned long)ct);
279− ct->timeout.expires = jiffies +
284+ setup_timer(&ecache->timeout, death_by_event, (unsigned long)ct);
285+ ecache->timeout.expires = jiffies +
280286 (random32() % net->ct.sysctl_events_retry_timeout);
281− add_timer(&ct->timeout);
287+ add_timer(&ecache->timeout);
282288 }
283289 EXPORT_SYMBOL_GPL(nf_ct_insert_dying_list);
284290
net/netfilter/nf_conntrack_netlink.c+2−1
@@ -2790,7 +2790,8 @@ static int __init ctnetlink_init(void) · 2789 unmodified lines
27902790 goto err_unreg_subsys;
27912791 }
27922792
2793− if (register_pernet_subsys(&ctnetlink_net_ops)) {
2793+ ret = register_pernet_subsys(&ctnetlink_net_ops);
2794+ if (ret < 0) {
27942795 pr_err("ctnetlink_init: cannot register pernet operations\n");
27952796 goto err_unreg_exp_subsys;
27962797 }
net/netfilter/nfnetlink_log.c+4−2
@@ -480,7 +480,7 @@ __build_packet_message(struct nfulnl_instance *inst, · 479 unmodified lines
480480 }
481481
482482 if (indev && skb_mac_header_was_set(skb)) {
483− if (nla_put_be32(inst->skb, NFULA_HWTYPE, htons(skb->dev->type)) ||
483+ if (nla_put_be16(inst->skb, NFULA_HWTYPE, htons(skb->dev->type)) ||
484484 nla_put_be16(inst->skb, NFULA_HWLEN,
485485 htons(skb->dev->hard_header_len)) ||
486486 nla_put(inst->skb, NFULA_HWHEADER, skb->dev->hard_header_len,
@@ -996,8 +996,10 @@ static int __init nfnetlink_log_init(void) · 509 unmodified lines
996996
997997 #ifdef CONFIG_PROC_FS
998998 if (!proc_create("nfnetlink_log", 0440,
999− proc_net_netfilter, &nful_file_ops))
999+ proc_net_netfilter, &nful_file_ops)) {
1000+ status = -ENOMEM;
10001001 goto cleanup_logger;
1002+ }
10011003 #endif
10021004 return status;
10031005
net/netlink/af_netlink.c+3−1
@@ -1373,7 +1373,8 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock, · 1372 unmodified lines
13731373 dst_pid = addr->nl_pid;
13741374 dst_group = ffs(addr->nl_groups);
13751375 err = -EPERM;
1376− if (dst_group && !netlink_capable(sock, NL_NONROOT_SEND))
1376+ if ((dst_group || dst_pid) &&
1377+ !netlink_capable(sock, NL_NONROOT_SEND))
13771378 goto out;
13781379 } else {
13791380 dst_pid = nlk->dst_pid;
@@ -2147,6 +2148,7 @@ static void __init netlink_add_usersock_entry(void) · 767 unmodified lines
21472148 rcu_assign_pointer(nl_table[NETLINK_USERSOCK].listeners, listeners);
21482149 nl_table[NETLINK_USERSOCK].module = THIS_MODULE;
21492150 nl_table[NETLINK_USERSOCK].registered = 1;
2151+ nl_table[NETLINK_USERSOCK].nl_nonroot = NL_NONROOT_SEND;
21502152
21512153 netlink_table_ungrab();
21522154 }
net/packet/af_packet.c+1−1
@@ -1273,7 +1273,7 @@ static void __fanout_unlink(struct sock *sk, struct packet_sock *po) · 1272 unmodified lines
12731273 spin_unlock(&f->lock);
12741274 }
12751275
1276−bool match_fanout_group(struct packet_type *ptype, struct sock * sk)
1276+static bool match_fanout_group(struct packet_type *ptype, struct sock * sk)
12771277 {
12781278 if (ptype->af_packet_priv == (void*)((struct packet_sock *)sk)->fanout)
12791279 return true;
net/socket.c+2−2
@@ -2604,7 +2604,7 @@ static int do_siocgstamp(struct net *net, struct socket *sock, · 2603 unmodified lines
26042604 err = sock_do_ioctl(net, sock, cmd, (unsigned long)&ktv);
26052605 set_fs(old_fs);
26062606 if (!err)
2607− err = compat_put_timeval(up, &ktv);
2607+ err = compat_put_timeval(&ktv, up);
26082608
26092609 return err;
26102610 }
@@ -2620,7 +2620,7 @@ static int do_siocgstampns(struct net *net, struct socket *sock, · 9 unmodified lines
26202620 err = sock_do_ioctl(net, sock, cmd, (unsigned long)&kts);
26212621 set_fs(old_fs);
26222622 if (!err)
2623− err = compat_put_timespec(up, &kts);
2623+ err = compat_put_timespec(&kts, up);
26242624
26252625 return err;
26262626 }
net/sunrpc/svc_xprt.c+4−6
@@ -316,7 +316,6 @@ static bool svc_xprt_has_something_to_do(struct svc_xprt *xprt) · 315 unmodified lines
316316 */
317317 void svc_xprt_enqueue(struct svc_xprt *xprt)
318318 {
319− struct svc_serv *serv = xprt->xpt_server;
320319 struct svc_pool *pool;
321320 struct svc_rqst *rqstp;
322321 int cpu;
@@ -362,8 +361,6 @@ void svc_xprt_enqueue(struct svc_xprt *xprt) · 39 unmodified lines
362361 rqstp, rqstp->rq_xprt);
363362 rqstp->rq_xprt = xprt;
364363 svc_xprt_get(xprt);
365− rqstp->rq_reserved = serv->sv_max_mesg;
366− atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved);
367364 pool->sp_stats.threads_woken++;
368365 wake_up(&rqstp->rq_wait);
369366 } else {
@@ -640,8 +637,6 @@ int svc_recv(struct svc_rqst *rqstp, long timeout) · 270 unmodified lines
640637 if (xprt) {
641638 rqstp->rq_xprt = xprt;
642639 svc_xprt_get(xprt);
643− rqstp->rq_reserved = serv->sv_max_mesg;
644− atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved);
645640
646641 /* As there is a shortage of threads and this request
647642 * had to be queued, don't allow the thread to wait so
@@ -738,6 +733,8 @@ int svc_recv(struct svc_rqst *rqstp, long timeout) · 90 unmodified lines
738733 else
739734 len = xprt->xpt_ops->xpo_recvfrom(rqstp);
740735 dprintk("svc: got len=%d\n", len);
736+ rqstp->rq_reserved = serv->sv_max_mesg;
737+ atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved);
741738 }
742739 svc_xprt_received(xprt);
743740
@@ -794,7 +791,8 @@ int svc_send(struct svc_rqst *rqstp) · 50 unmodified lines
794791
795792 /* Grab mutex to serialize outgoing data. */
796793 mutex_lock(&xprt->xpt_mutex);
797− if (test_bit(XPT_DEAD, &xprt->xpt_flags))
794+ if (test_bit(XPT_DEAD, &xprt->xpt_flags)
795+ || test_bit(XPT_CLOSE, &xprt->xpt_flags))
798796 len = -ENOTCONN;
799797 else
800798 len = xprt->xpt_ops->xpo_sendto(rqstp);
net/sunrpc/svcsock.c+1−1
@@ -1129,9 +1129,9 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp) · 1128 unmodified lines
11291129 if (len >= 0)
11301130 svsk->sk_tcplen += len;
11311131 if (len != want) {
1132+ svc_tcp_save_pages(svsk, rqstp);
11321133 if (len < 0 && len != -EAGAIN)
11331134 goto err_other;
1134− svc_tcp_save_pages(svsk, rqstp);
11351135 dprintk("svc: incomplete TCP record (%d of %d)\n",
11361136 svsk->sk_tcplen, svsk->sk_reclen);
11371137 goto err_noclose;
net/xfrm/xfrm_state.c+3−1
@@ -1994,8 +1994,10 @@ int __xfrm_init_state(struct xfrm_state *x, bool init_replay) · 1993 unmodified lines
19941994 goto error;
19951995
19961996 x->outer_mode = xfrm_get_mode(x->props.mode, family);
1997− if (x->outer_mode == NULL)
1997+ if (x->outer_mode == NULL) {
1998+ err = -EPROTONOSUPPORT;
19981999 goto error;
2000+ }
19992001
20002002 if (init_replay) {
20012003 err = xfrm_init_replay(x);
scripts/Makefile.fwinst+1−1
@@ -42,7 +42,7 @@ quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@) · 41 unmodified lines
4242 $(installed-fw-dirs):
4343 $(call cmd,mkdir)
4444
45−$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %)
45+$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $$(dir $(INSTALL_FW_PATH)/%)
4646 $(call cmd,install)
4747
4848 PHONY += __fw_install __fw_modinst FORCE
scripts/link-vmlinux.sh+1−1
@@ -211,7 +211,7 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then · 210 unmodified lines
211211
212212 if ! cmp -s System.map .tmp_System.map; then
213213 echo >&2 Inconsistent kallsyms data
214− echo >&2 echo Try "make KALLSYMS_EXTRA_PASS=1" as a workaround
214+ echo >&2 Try "make KALLSYMS_EXTRA_PASS=1" as a workaround
215215 cleanup
216216 exit 1
217217 fi
sound/pci/hda/hda_codec.c+8−2
@@ -1209,6 +1209,9 @@ static void snd_hda_codec_free(struct hda_codec *codec) · 1208 unmodified lines
12091209 kfree(codec);
12101210 }
12111211
1212+static bool snd_hda_codec_get_supported_ps(struct hda_codec *codec,
1213+ hda_nid_t fg, unsigned int power_state);
1214+
12121215 static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
12131216 unsigned int power_state);
12141217
@@ -1317,6 +1320,10 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, · 102 unmodified lines
13171320 AC_VERB_GET_SUBSYSTEM_ID, 0);
13181321 }
13191322
1323+ codec->epss = snd_hda_codec_get_supported_ps(codec,
1324+ codec->afg ? codec->afg : codec->mfg,
1325+ AC_PWRST_EPSS);
1326+
13201327 /* power-up all before initialization */
13211328 hda_set_power_state(codec,
13221329 codec->afg ? codec->afg : codec->mfg,
@@ -3543,8 +3550,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, · 2220 unmodified lines
35433550 /* this delay seems necessary to avoid click noise at power-down */
35443551 if (power_state == AC_PWRST_D3) {
35453552 /* transition time less than 10ms for power down */
3546− bool epss = snd_hda_codec_get_supported_ps(codec, fg, AC_PWRST_EPSS);
3547− msleep(epss ? 10 : 100);
3553+ msleep(codec->epss ? 10 : 100);
35483554 }
35493555
35503556 /* repeat power states setting at most 10 times*/
sound/pci/hda/hda_codec.h+1−0
@@ -862,6 +862,7 @@ struct hda_codec { · 861 unmodified lines
862862 unsigned int ignore_misc_bit:1; /* ignore MISC_NO_PRESENCE bit */
863863 unsigned int no_jack_detect:1; /* Machine has no jack-detection */
864864 unsigned int pcm_format_first:1; /* PCM format must be set first */
865+ unsigned int epss:1; /* supporting EPSS? */
865866 #ifdef CONFIG_SND_HDA_POWER_SAVE
866867 unsigned int power_on :1; /* current (global) power-state */
867868 int power_transition; /* power-state in transition */
sound/pci/hda/patch_sigmatel.c+4−0
@@ -4543,6 +4543,9 @@ static void stac92xx_line_out_detect(struct hda_codec *codec, · 4542 unmodified lines
45434543 struct auto_pin_cfg *cfg = &spec->autocfg;
45444544 int i;
45454545
4546+ if (cfg->speaker_outs == 0)
4547+ return;
4548+
45464549 for (i = 0; i < cfg->line_outs; i++) {
45474550 if (presence)
45484551 break;
@@ -5531,6 +5534,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) · 982 unmodified lines
55315534 snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e);
55325535 }
55335536
5537+ codec->epss = 0; /* longer delay needed for D3 */
55345538 codec->no_trigger_sense = 1;
55355539 codec->spec = spec;
55365540
sound/usb/card.c+2−2
@@ -553,7 +553,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, · 552 unmodified lines
553553 struct snd_usb_audio *chip)
554554 {
555555 struct snd_card *card;
556− struct list_head *p;
556+ struct list_head *p, *n;
557557
558558 if (chip == (void *)-1L)
559559 return;
@@ -570,7 +570,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, · 10 unmodified lines
570570 snd_usb_stream_disconnect(p);
571571 }
572572 /* release the endpoint resources */
573− list_for_each(p, &chip->ep_list) {
573+ list_for_each_safe(p, n, &chip->ep_list) {
574574 snd_usb_endpoint_free(p);
575575 }
576576 /* release the midi resources */
sound/usb/endpoint.c+10−14
@@ -141,7 +141,7 @@ int snd_usb_endpoint_implict_feedback_sink(struct snd_usb_endpoint *ep) · 140 unmodified lines
141141 *
142142 * For implicit feedback, next_packet_size() is unused.
143143 */
144−static int next_packet_size(struct snd_usb_endpoint *ep)
144+int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep)
145145 {
146146 unsigned long flags;
147147 int ret;
@@ -177,15 +177,6 @@ static void retire_inbound_urb(struct snd_usb_endpoint *ep, · 29 unmodified lines
177177 ep->retire_data_urb(ep->data_subs, urb);
178178 }
179179
180−static void prepare_outbound_urb_sizes(struct snd_usb_endpoint *ep,
181− struct snd_urb_ctx *ctx)
182−{
183− int i;
184−
185− for (i = 0; i < ctx->packets; ++i)
186− ctx->packet_size[i] = next_packet_size(ep);
187−}
188−
189180 /*
190181 * Prepare a PLAYBACK urb for submission to the bus.
191182 */
@@ -370,7 +361,6 @@ static void snd_complete_urb(struct urb *urb) · 178 unmodified lines
370361 goto exit_clear;
371362 }
372363
373− prepare_outbound_urb_sizes(ep, ctx);
374364 prepare_outbound_urb(ep, ctx);
375365 } else {
376366 retire_inbound_urb(ep, ctx);
@@ -799,7 +789,9 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep, · 422 unmodified lines
799789 /**
800790 * snd_usb_endpoint_start: start an snd_usb_endpoint
801791 *
802− * @ep: the endpoint to start
792+ * @ep: the endpoint to start
793+ * @can_sleep: flag indicating whether the operation is executed in
794+ * non-atomic context
803795 *
804796 * A call to this function will increment the use count of the endpoint.
805797 * In case it is not already running, the URBs for this endpoint will be
@@ -809,7 +801,7 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep, · 3 unmodified lines
809801 *
810802 * Returns an error if the URB submission failed, 0 in all other cases.
811803 */
812−int snd_usb_endpoint_start(struct snd_usb_endpoint *ep)
804+int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, int can_sleep)
813805 {
814806 int err;
815807 unsigned int i;
@@ -821,6 +813,11 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep) · 5 unmodified lines
821813 if (++ep->use_count != 1)
822814 return 0;
823815
816+ /* just to be sure */
817+ deactivate_urbs(ep, 0, can_sleep);
818+ if (can_sleep)
819+ wait_clear_urbs(ep);
820+
824821 ep->active_mask = 0;
825822 ep->unlink_mask = 0;
826823 ep->phase = 0;
@@ -850,7 +847,6 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep) · 23 unmodified lines
850847 goto __error;
851848
852849 if (usb_pipeout(ep->pipe)) {
853− prepare_outbound_urb_sizes(ep, urb->context);
854850 prepare_outbound_urb(ep, urb->context);
855851 } else {
856852 prepare_inbound_urb(ep, urb->context);
sound/usb/endpoint.h+2−1
@@ -13,7 +13,7 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep, · 12 unmodified lines
1313 struct audioformat *fmt,
1414 struct snd_usb_endpoint *sync_ep);
1515
16−int snd_usb_endpoint_start(struct snd_usb_endpoint *ep);
16+int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, int can_sleep);
1717 void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep,
1818 int force, int can_sleep, int wait);
1919 int snd_usb_endpoint_activate(struct snd_usb_endpoint *ep);
@@ -21,6 +21,7 @@ int snd_usb_endpoint_deactivate(struct snd_usb_endpoint *ep); · 1 unmodified line
2121 void snd_usb_endpoint_free(struct list_head *head);
2222
2323 int snd_usb_endpoint_implict_feedback_sink(struct snd_usb_endpoint *ep);
24+int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep);
2425
2526 void snd_usb_handle_sync_urb(struct snd_usb_endpoint *ep,
2627 struct snd_usb_endpoint *sender,
sound/usb/pcm.c+52−12
@@ -212,7 +212,7 @@ int snd_usb_init_pitch(struct snd_usb_audio *chip, int iface, · 211 unmodified lines
212212 }
213213 }
214214
215−static int start_endpoints(struct snd_usb_substream *subs)
215+static int start_endpoints(struct snd_usb_substream *subs, int can_sleep)
216216 {
217217 int err;
218218
@@ -225,7 +225,7 @@ static int start_endpoints(struct snd_usb_substream *subs) · 6 unmodified lines
225225 snd_printdd(KERN_DEBUG "Starting data EP @%p\n", ep);
226226
227227 ep->data_subs = subs;
228− err = snd_usb_endpoint_start(ep);
228+ err = snd_usb_endpoint_start(ep, can_sleep);
229229 if (err < 0) {
230230 clear_bit(SUBSTREAM_FLAG_DATA_EP_STARTED, &subs->flags);
231231 return err;
@@ -236,10 +236,25 @@ static int start_endpoints(struct snd_usb_substream *subs) · 4 unmodified lines
236236 !test_and_set_bit(SUBSTREAM_FLAG_SYNC_EP_STARTED, &subs->flags)) {
237237 struct snd_usb_endpoint *ep = subs->sync_endpoint;
238238
239+ if (subs->data_endpoint->iface != subs->sync_endpoint->iface ||
240+ subs->data_endpoint->alt_idx != subs->sync_endpoint->alt_idx) {
241+ err = usb_set_interface(subs->dev,
242+ subs->sync_endpoint->iface,
243+ subs->sync_endpoint->alt_idx);
244+ if (err < 0) {
245+ snd_printk(KERN_ERR
246+ "%d:%d:%d: cannot set interface (%d)\n",
247+ subs->dev->devnum,
248+ subs->sync_endpoint->iface,
249+ subs->sync_endpoint->alt_idx, err);
250+ return -EIO;
251+ }
252+ }
253+
239254 snd_printdd(KERN_DEBUG "Starting sync EP @%p\n", ep);
240255
241256 ep->sync_slave = subs->data_endpoint;
242− err = snd_usb_endpoint_start(ep);
257+ err = snd_usb_endpoint_start(ep, can_sleep);
243258 if (err < 0) {
244259 clear_bit(SUBSTREAM_FLAG_SYNC_EP_STARTED, &subs->flags);
245260 return err;
@@ -544,13 +559,10 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream) · 298 unmodified lines
544559 subs->last_frame_number = 0;
545560 runtime->delay = 0;
546561
547− /* clear the pending deactivation on the target EPs */
548− deactivate_endpoints(subs);
549−
550562 /* for playback, submit the URBs now; otherwise, the first hwptr_done
551563 * updates for all URBs would happen at the same time when starting */
552564 if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK)
553− return start_endpoints(subs);
565+ return start_endpoints(subs, 1);
554566
555567 return 0;
556568 }
@@ -1032,6 +1044,7 @@ static void prepare_playback_urb(struct snd_usb_substream *subs, · 475 unmodified lines
10321044 struct urb *urb)
10331045 {
10341046 struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime;
1047+ struct snd_usb_endpoint *ep = subs->data_endpoint;
10351048 struct snd_urb_ctx *ctx = urb->context;
10361049 unsigned int counts, frames, bytes;
10371050 int i, stride, period_elapsed = 0;
@@ -1043,7 +1056,11 @@ static void prepare_playback_urb(struct snd_usb_substream *subs, · 5 unmodified lines
10431056 urb->number_of_packets = 0;
10441057 spin_lock_irqsave(&subs->lock, flags);
10451058 for (i = 0; i < ctx->packets; i++) {
1046− counts = ctx->packet_size[i];
1059+ if (ctx->packet_size[i])
1060+ counts = ctx->packet_size[i];
1061+ else
1062+ counts = snd_usb_endpoint_next_packet_size(ep);
1063+
10471064 /* set up descriptor */
10481065 urb->iso_frame_desc[i].offset = frames * stride;
10491066 urb->iso_frame_desc[i].length = counts * stride;
@@ -1094,7 +1111,16 @@ static void prepare_playback_urb(struct snd_usb_substream *subs, · 44 unmodified lines
10941111 subs->hwptr_done += bytes;
10951112 if (subs->hwptr_done >= runtime->buffer_size * stride)
10961113 subs->hwptr_done -= runtime->buffer_size * stride;
1114+
1115+ /* update delay with exact number of samples queued */
1116+ runtime->delay = subs->last_delay;
10971117 runtime->delay += frames;
1118+ subs->last_delay = runtime->delay;
1119+
1120+ /* realign last_frame_number */
1121+ subs->last_frame_number = usb_get_current_frame_number(subs->dev);
1122+ subs->last_frame_number &= 0xFF; /* keep 8 LSBs */
1123+
10981124 spin_unlock_irqrestore(&subs->lock, flags);
10991125 urb->transfer_buffer_length = bytes;
11001126 if (period_elapsed)
@@ -1112,12 +1138,26 @@ static void retire_playback_urb(struct snd_usb_substream *subs, · 11 unmodified lines
11121138 struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime;
11131139 int stride = runtime->frame_bits >> 3;
11141140 int processed = urb->transfer_buffer_length / stride;
1141+ int est_delay;
11151142
11161143 spin_lock_irqsave(&subs->lock, flags);
1117− if (processed > runtime->delay)
1118− runtime->delay = 0;
1144+ est_delay = snd_usb_pcm_delay(subs, runtime->rate);
1145+ /* update delay with exact number of samples played */
1146+ if (processed > subs->last_delay)
1147+ subs->last_delay = 0;
11191148 else
1120− runtime->delay -= processed;
1149+ subs->last_delay -= processed;
1150+ runtime->delay = subs->last_delay;
1151+
1152+ /*
1153+ * Report when delay estimate is off by more than 2ms.
1154+ * The error should be lower than 2ms since the estimate relies
1155+ * on two reads of a counter updated every ms.
1156+ */
1157+ if (abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2)
1158+ snd_printk(KERN_DEBUG "delay: estimated %d, actual %d\n",
1159+ est_delay, subs->last_delay);
1160+
11211161 spin_unlock_irqrestore(&subs->lock, flags);
11221162 }
11231163
@@ -1175,7 +1215,7 @@ static int snd_usb_substream_capture_trigger(struct snd_pcm_substream *substream · 51 unmodified lines
11751215
11761216 switch (cmd) {
11771217 case SNDRV_PCM_TRIGGER_START:
1178− err = start_endpoints(subs);
1218+ err = start_endpoints(subs, 0);
11791219 if (err < 0)
11801220 return err;
11811221
tools/perf/util/python-ext-sources+2−0
@@ -10,10 +10,12 @@ util/ctype.c · 9 unmodified lines
1010 util/evlist.c
1111 util/evsel.c
1212 util/cpumap.c
13+util/hweight.c
1314 util/thread_map.c
1415 util/util.c
1516 util/xyarray.c
1617 util/cgroup.c
1718 util/debugfs.c
19+util/rblist.c
1820 util/strlist.c
1921 ../../lib/rbtree.c
virt/kvm/kvm_main.c+4−3
@@ -1976,9 +1976,10 @@ static long kvm_vcpu_compat_ioctl(struct file *filp, · 1975 unmodified lines
19761976 if (copy_from_user(&csigset, sigmask_arg->sigset,
19771977 sizeof csigset))
19781978 goto out;
1979− }
1980− sigset_from_compat(&sigset, &csigset);
1981− r = kvm_vcpu_ioctl_set_sigmask(vcpu, &sigset);
1979+ sigset_from_compat(&sigset, &csigset);
1980+ r = kvm_vcpu_ioctl_set_sigmask(vcpu, &sigset);
1981+ } else
1982+ r = kvm_vcpu_ioctl_set_sigmask(vcpu, NULL);
19821983 break;
19831984 }
19841985 default: