History

Merge branch 'linus' into timers/core Reason: Get upstream fixes before adding conflicting code.

Thomas Gleixner committed 13 years ago

Commit 6402c7d2 parents 77c675b 60d509f1262 files · +13864 −7800Browse files

Unified · Split

1262 files
  1. CREDITS +8 −0
  2. Documentation/DocBook/device-drivers.tmpl +1 −1
  3. Documentation/devicetree/bindings/mfd/ab8500.txt +1 −5
  4. Documentation/devicetree/bindings/tty/serial/of-serial.txt +3 −0
  5. Documentation/hwmon/lm75 +1 −1
  6. Documentation/i2c/busses/i2c-diolan-u2c +1 −1
  7. Documentation/kernel-parameters.txt +26 −3
  8. Documentation/networking/ipvs-sysctl.txt +7 −0
  9. Documentation/scsi/LICENSE.qla2xxx +1 −1
  10. Documentation/sound/alsa/ALSA-Configuration.txt +3 −4
  11. Documentation/sound/alsa/seq_oss.html +1 −1
  12. MAINTAINERS +66 −34
  13. Makefile +3 −2
  14. arch/Kconfig +0 −7
  15. arch/alpha/Kconfig +1 −1
  16. arch/alpha/Makefile +1 −1
  17. arch/alpha/include/asm/floppy.h +1 −1
  18. arch/alpha/kernel/irq.c +0 −7
  19. arch/alpha/kernel/irq_alpha.c +8 −2
  20. arch/alpha/kernel/sys_nautilus.c +5 −0
  21. arch/alpha/kernel/sys_titan.c +7 −7
  22. arch/arc/include/asm/dma-mapping.h +1 −1
  23. arch/arc/include/asm/elf.h +0 −3
  24. arch/arc/include/asm/entry.h +1 −1
  25. arch/arc/include/asm/irqflags.h +8 −4
  26. arch/arc/include/asm/kgdb.h +2 −4
  27. arch/arc/include/asm/ptrace.h +1 −1
  28. arch/arc/include/asm/syscalls.h +0 −2
  29. arch/arc/include/uapi/asm/ptrace.h +2 −2
  30. arch/arc/kernel/entry.S +1 −26
  31. arch/arc/kernel/kgdb.c +1 −0
  32. arch/arc/kernel/setup.c +1 −3
  33. arch/arc/kernel/sys.c +0 −2
  34. arch/arm/Kconfig +23 −13
  35. arch/arm/Kconfig.debug +2 −1
  36. arch/arm/boot/Makefile +1 −1
  37. arch/arm/boot/dts/armada-370-mirabox.dts +1 −1
  38. arch/arm/boot/dts/armada-370-rd.dts +8 −0
  39. arch/arm/boot/dts/armada-370-xp.dtsi +2 −3
  40. arch/arm/boot/dts/armada-370.dtsi +6 −0
  41. arch/arm/boot/dts/armada-xp.dtsi +2 −2
  42. arch/arm/boot/dts/at91sam9x5.dtsi +26 −2
  43. arch/arm/boot/dts/bcm2835.dtsi +1 −1
  44. arch/arm/boot/dts/dbx5x0.dtsi +3 −4
  45. arch/arm/boot/dts/dove.dtsi +5 −0
  46. arch/arm/boot/dts/exynos4.dtsi +9 −0
  47. arch/arm/boot/dts/exynos5440.dtsi +6 −0
  48. arch/arm/boot/dts/href.dtsi +1 −1
  49. arch/arm/boot/dts/hrefv60plus.dts +1 −1
  50. arch/arm/boot/dts/imx28-m28evk.dts +0 −1
  51. arch/arm/boot/dts/imx28-sps1.dts +0 −1
  52. arch/arm/boot/dts/imx53-mba53.dts +1 −2
  53. arch/arm/boot/dts/imx6qdl.dtsi +1 −0
  54. arch/arm/boot/dts/kirkwood-dns320.dts +0 −2
  55. arch/arm/boot/dts/kirkwood-dns325.dts +0 −1
  56. arch/arm/boot/dts/kirkwood-dockstar.dts +0 −1
  57. arch/arm/boot/dts/kirkwood-dreamplug.dts +0 −1
  58. arch/arm/boot/dts/kirkwood-goflexnet.dts +1 −1
  59. arch/arm/boot/dts/kirkwood-ib62x0.dts +0 −1
  60. arch/arm/boot/dts/kirkwood-iconnect.dts +0 −1
  61. arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts +7 −8
  62. arch/arm/boot/dts/kirkwood-km_kirkwood.dts +0 −1
  63. arch/arm/boot/dts/kirkwood-lschlv2.dts +0 −1
  64. arch/arm/boot/dts/kirkwood-lsxhl.dts +0 −1
  65. arch/arm/boot/dts/kirkwood-mplcec4.dts +0 −1
  66. arch/arm/boot/dts/kirkwood-ns2-common.dtsi +0 −1
  67. arch/arm/boot/dts/kirkwood-nsa310.dts +0 −1
  68. arch/arm/boot/dts/kirkwood-openblocks_a6.dts +0 −2
  69. arch/arm/boot/dts/kirkwood-topkick.dts +0 −1
  70. arch/arm/boot/dts/kirkwood.dtsi +3 −2
  71. arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts +1 −1
  72. arch/arm/boot/dts/orion5x.dtsi +7 −2
  73. arch/arm/boot/dts/snowball.dts +1 −1
  74. arch/arm/boot/dts/socfpga.dtsi +3 −0
  75. arch/arm/boot/dts/tegra20.dtsi +2 −1
  76. arch/arm/boot/dts/tegra30.dtsi +2 −1
  77. arch/arm/configs/mxs_defconfig +1 −0
  78. arch/arm/configs/omap2plus_defconfig +2 −0
  79. arch/arm/include/asm/delay.h +1 −1
  80. arch/arm/include/asm/glue-cache.h +0 −8
  81. arch/arm/include/asm/hardware/iop3xx.h +1 −1
  82. arch/arm/include/asm/highmem.h +7 −0
  83. arch/arm/include/asm/mmu_context.h +2 −0
  84. arch/arm/include/asm/pgtable-3level.h +1 −1
  85. arch/arm/include/asm/tlbflush.h +17 −9
  86. arch/arm/include/asm/xen/events.h +4 −21
  87. arch/arm/kernel/entry-common.S +12 −0
  88. arch/arm/kernel/head.S +1 −1
  89. arch/arm/kernel/hw_breakpoint.c +4 −4
  90. arch/arm/kernel/perf_event.c +4 −1
  91. arch/arm/kernel/sched_clock.c +2 −2
  92. arch/arm/kernel/setup.c +22 −5
  93. arch/arm/kernel/smp.c +1 −4
  94. arch/arm/kernel/smp_tlb.c +66 −0
  95. arch/arm/kernel/tcm.c +0 −1
  96. arch/arm/kvm/arm.c +1 −0
  97. arch/arm/kvm/coproc.c +2 −2
  98. arch/arm/kvm/vgic.c +14 −21
  99. arch/arm/lib/delay.c +5 −3
  100. arch/arm/lib/memset.S +13 −20
  101. arch/arm/mach-at91/board-foxg20.c +1 −0
  102. arch/arm/mach-at91/board-stamp9g20.c +1 −0
  103. arch/arm/mach-at91/include/mach/gpio.h +8 −0
  104. arch/arm/mach-at91/irq.c +8 −12
  105. arch/arm/mach-at91/pm.c +8 −2
  106. arch/arm/mach-cns3xxx/core.c +3 −13
  107. arch/arm/mach-cns3xxx/include/mach/cns3xxx.h +8 −8
  108. arch/arm/mach-davinci/dma.c +3 −0
  109. arch/arm/mach-ep93xx/include/mach/uncompress.h +7 −3
  110. arch/arm/mach-footbridge/Kconfig +1 −0
  111. arch/arm/mach-highbank/hotplug.c +4 −6
  112. arch/arm/mach-imx/clk-imx35.c +3 −0
  113. arch/arm/mach-imx/clk-imx6q.c +2 −3
  114. arch/arm/mach-imx/common.h +2 −0
  115. arch/arm/mach-imx/headsmp.S +9 −9
  116. arch/arm/mach-imx/hotplug.c +12 −0
  117. arch/arm/mach-imx/imx25-dt.c +5 −0
  118. arch/arm/mach-imx/pm-imx6q.c +0 −15
  119. arch/arm/mach-imx/src.c +12 −0
  120. arch/arm/mach-ixp4xx/vulcan-setup.c +1 −0
  121. arch/arm/mach-kirkwood/board-dt.c +18 −7
  122. arch/arm/mach-kirkwood/board-iomega_ix2_200.c +6 −1
  123. arch/arm/mach-kirkwood/guruplug-setup.c +2 −0
  124. arch/arm/mach-kirkwood/openrd-setup.c +1 −0
  125. arch/arm/mach-kirkwood/rd88f6281-setup.c +1 −0
  126. arch/arm/mach-mmp/gplugd.c +1 −0
  127. arch/arm/mach-msm/timer.c +4 −1
  128. arch/arm/mach-mvebu/irq-armada-370-xp.c +10 −14
  129. arch/arm/mach-mxs/icoll.c +1 −1
  130. arch/arm/mach-mxs/mach-mxs.c +17 −17
  131. arch/arm/mach-mxs/mm.c +1 −0
  132. arch/arm/mach-mxs/ocotp.c +1 −0
  133. arch/arm/mach-omap1/clock_data.c +1 −11
  134. arch/arm/mach-omap1/common.h +2 −0
  135. arch/arm/mach-omap2/Kconfig +0 −6
  136. arch/arm/mach-omap2/board-generic.c +2 −0
  137. arch/arm/mach-omap2/board-rx51.c +2 −0
  138. arch/arm/mach-omap2/cclock44xx_data.c +20 −0
  139. arch/arm/mach-omap2/common.h +3 −1
  140. arch/arm/mach-omap2/gpmc.c +3 −3
  141. arch/arm/mach-omap2/io.c +12 −6
  142. arch/arm/mach-omap2/mux.c +5 −4
  143. arch/arm/mach-omap2/omap_hwmod.c +5 −2
  144. arch/arm/mach-omap2/omap_hwmod.h +7 −2
  145. arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +6 −1
  146. arch/arm/mach-omap2/omap_hwmod_44xx_data.c +6 −0
  147. arch/arm/mach-omap2/timer.c +4 −0
  148. arch/arm/mach-pxa/raumfeld.c +1 −0
  149. arch/arm/mach-s3c24xx/include/mach/irqs.h +1 −3
  150. arch/arm/mach-s3c24xx/irq.c +1 −1
  151. arch/arm/mach-s5pv210/clock.c +18 −18
  152. arch/arm/mach-s5pv210/mach-goni.c +1 −1
  153. arch/arm/mach-shmobile/board-marzen.c +1 −0
  154. arch/arm/mach-spear3xx/spear3xx.c +1 −1
  155. arch/arm/mach-ux500/board-mop500-sdi.c +0 −1
  156. arch/arm/mach-ux500/board-mop500.c +12 −0
  157. arch/arm/mach-ux500/board-mop500.h +1 −0
  158. arch/arm/mach-ux500/cpu-db8500.c +3 −2
  159. arch/arm/mm/Kconfig +1 −4
  160. arch/arm/mm/Makefile +0 −1
  161. arch/arm/mm/cache-feroceon-l2.c +1 −0
  162. arch/arm/mm/cache-l2x0.c +4 −7
  163. arch/arm/mm/cache-v3.S +0 −137
  164. arch/arm/mm/cache-v4.S +1 −1
  165. arch/arm/mm/context.c +2 −1
  166. arch/arm/mm/dma-mapping.c +3 −2
  167. arch/arm/mm/mmu.c +49 −26
  168. arch/arm/mm/proc-arm740.S +17 −13
  169. arch/arm/mm/proc-arm920.S +1 −1
  170. arch/arm/mm/proc-arm926.S +1 −1
  171. arch/arm/mm/proc-mohawk.S +1 −1
  172. arch/arm/mm/proc-sa1100.S +1 −1
  173. arch/arm/mm/proc-syms.c +2 −0
  174. arch/arm/mm/proc-v6.S +1 −1
  175. arch/arm/mm/proc-v7.S +17 −2
  176. arch/arm/mm/proc-xsc3.S +1 −1
  177. arch/arm/mm/proc-xscale.S +1 −1
  178. arch/arm/mm/tcm.h +0 −0
  179. arch/arm/net/bpf_jit_32.c +1 −1
  180. arch/arm/plat-orion/addr-map.c +5 −2
  181. arch/arm/plat-spear/Kconfig +1 −1
  182. arch/arm64/Kconfig +0 −1
  183. arch/arm64/Kconfig.debug +0 −11
  184. arch/arm64/configs/defconfig +0 −1
  185. arch/arm64/include/asm/ucontext.h +1 −1
  186. arch/arm64/kernel/arm64ksyms.c +2 −0
  187. arch/arm64/kernel/signal32.c +0 −1
  188. arch/arm64/mm/mmu.c +1 −1
  189. arch/avr32/Kconfig +1 −1
  190. arch/avr32/include/asm/io.h +4 −0
  191. arch/blackfin/Kconfig +1 −1
  192. arch/c6x/include/asm/irqflags.h +1 −1
  193. arch/cris/Kconfig +1 −1
  194. arch/frv/Kconfig +1 −1
  195. arch/h8300/Kconfig +1 −1
  196. arch/ia64/Kconfig +1 −1
  197. arch/ia64/kernel/palinfo.c +13 −64
  198. arch/ia64/kernel/process.c +1 −4
  199. arch/m32r/Kconfig +1 −1
  200. arch/m32r/include/uapi/asm/stat.h +2 −2
  201. arch/m68k/Kconfig +1 −1
  202. arch/m68k/Kconfig.machine +0 −1
  203. arch/m68k/include/asm/MC68328.h +5 −5
  204. arch/m68k/include/asm/gpio.h +20 −0
  205. arch/m68k/kernel/setup_no.c +3 −0
  206. arch/m68k/mm/init.c +1 −1
  207. arch/m68k/platform/coldfire/m528x.c +1 −1
  208. arch/microblaze/Kconfig +1 −1
  209. arch/mips/Kconfig +4 −5
  210. arch/mips/bcm63xx/boards/board_bcm963xx.c +1 −4
  211. arch/mips/bcm63xx/nvram.c +3 −4
  212. arch/mips/bcm63xx/setup.c +1 −1
  213. arch/mips/cavium-octeon/setup.c +4 −1
  214. arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h +1 −3
  215. arch/mips/include/asm/mach-sead3/cpu-feature-overrides.h +0 −4
  216. arch/mips/include/asm/mipsregs.h +190 −19
  217. arch/mips/include/asm/signal.h +1 −1
  218. arch/mips/include/uapi/asm/signal.h +6 −2
  219. arch/mips/kernel/Makefile +6 −19
  220. arch/mips/kernel/cpu-probe.c +6 −7
  221. arch/mips/kernel/linux32.c +1 −1
  222. arch/mips/kernel/mcount.S +7 −4
  223. arch/mips/kernel/proc.c +1 −1
  224. arch/mips/kernel/traps.c +1 −1
  225. arch/mips/lib/bitops.c +8 −8
  226. arch/mips/lib/csum_partial.S +2 −2
  227. arch/mips/mm/c-r4k.c +2 −4
  228. arch/mips/mm/sc-mips.c +2 −4
  229. arch/mips/pci/pci-alchemy.c +2 −2
  230. arch/mn10300/Kconfig +1 −1
  231. arch/openrisc/Kconfig +1 −2
  232. arch/parisc/Kconfig +1 −1
  233. arch/powerpc/Kconfig +2 −1
  234. arch/powerpc/include/asm/mmu-hash64.h +66 −62
  235. arch/powerpc/kernel/cputable.c +1 −1
  236. arch/powerpc/kernel/entry_64.S +2 −2
  237. arch/powerpc/kernel/epapr_paravirt.c +6 −0
  238. arch/powerpc/kernel/exceptions-64s.S +97 −81
  239. arch/powerpc/kernel/process.c +2 −0
  240. arch/powerpc/kernel/prom_init.c +7 −7
  241. arch/powerpc/kernel/ptrace.c +1 −0
  242. arch/powerpc/kernel/signal_32.c +2 −0
  243. arch/powerpc/kernel/signal_64.c +2 −0
  244. arch/powerpc/kernel/tm.S +2 −0
  245. arch/powerpc/kvm/book3s_64_mmu_host.c +2 −2
  246. arch/powerpc/kvm/e500.h +8 −16
  247. arch/powerpc/kvm/e500_mmu_host.c +27 −57
  248. arch/powerpc/kvm/e500mc.c +6 −1
  249. arch/powerpc/mm/hash_utils_64.c +17 −5
  250. arch/powerpc/mm/mmu_context_hash64.c +1 −10
  251. arch/powerpc/mm/pgtable_64.c +1 −1
  252. arch/powerpc/mm/slb_low.S +25 −25
  253. arch/powerpc/mm/tlb_hash64.c +1 −1
  254. arch/powerpc/perf/power7-pmu.c +13 −0
  255. arch/powerpc/platforms/85xx/sgy_cts1000.c +3 −3
  256. arch/powerpc/platforms/Kconfig.cputype +2 −4
  257. arch/powerpc/platforms/pseries/lpar.c +7 −1
  258. arch/s390/Kconfig +1 −1
  259. arch/s390/include/asm/eadm.h +5 −1
  260. arch/s390/include/asm/io.h +0 −4
  261. arch/s390/include/asm/pgtable.h +7 −1
  262. arch/s390/include/asm/tlbflush.h +0 −2
  263. arch/s390/kernel/entry.S +2 −1
  264. arch/s390/kernel/entry64.S +3 −2
  265. arch/s390/kernel/setup.c +2 −0
  266. arch/s390/lib/uaccess_pt.c +55 −28
  267. arch/score/Kconfig +1 −1
  268. arch/sparc/Kconfig +1 −7
  269. arch/sparc/include/asm/Kbuild +5 −0
  270. arch/sparc/include/asm/cputime.h +0 −6
  271. arch/sparc/include/asm/emergency-restart.h +0 −6
  272. arch/sparc/include/asm/mutex.h +0 −9
  273. arch/sparc/include/asm/pgtable_64.h +1 −0
  274. arch/sparc/include/asm/serial.h +0 −6
  275. arch/sparc/include/asm/smp_32.h +0 −5
  276. arch/sparc/include/asm/spitfire.h +1 −0
  277. arch/sparc/include/asm/switch_to_64.h +1 −2
  278. arch/sparc/include/asm/tlbflush_64.h +31 −6
  279. arch/sparc/include/uapi/asm/Kbuild +0 −1
  280. arch/sparc/include/uapi/asm/types.h +0 −17
  281. arch/sparc/kernel/cpu.c +6 −0
  282. arch/sparc/kernel/head_64.S +23 −2
  283. arch/sparc/kernel/leon_pci_grpci2.c +26 −15
  284. arch/sparc/kernel/smp_64.c +37 −4
  285. arch/sparc/lib/bitext.c +1 −5
  286. arch/sparc/mm/iommu.c +1 −1
  287. arch/sparc/mm/srmmu.c +3 −1
  288. arch/sparc/mm/tlb.c +34 −4
  289. arch/sparc/mm/tsb.c +42 −15
  290. arch/sparc/mm/ultra.S +95 −24
  291. arch/tile/Kconfig +1 −1
  292. arch/tile/configs/tilegx_defconfig +0 −1
  293. arch/tile/configs/tilepro_defconfig +0 −1
  294. arch/tile/include/asm/irqflags.h +9 −1
  295. arch/tile/kernel/setup.c +12 −13
  296. arch/unicore32/Kconfig +1 −1
  297. arch/x86/Kconfig +2 −1
  298. arch/x86/boot/compressed/Makefile +2 −3
  299. arch/x86/boot/compressed/eboot.c +47 −0
  300. arch/x86/include/asm/efi.h +7 −0
  301. arch/x86/include/asm/kprobes.h +1 −0
  302. arch/x86/include/asm/kvm_host.h +2 −2
  303. arch/x86/include/asm/paravirt.h +4 −1
  304. arch/x86/include/asm/paravirt_types.h +2 −0
  305. arch/x86/include/asm/syscall.h +2 −2
  306. arch/x86/include/asm/tlb.h +1 −1
  307. arch/x86/include/asm/xen/hypercall.h +2 −2
  308. arch/x86/include/uapi/asm/bootparam.h +1 −0
  309. arch/x86/include/uapi/asm/msr-index.h +1 −0
  310. arch/x86/kernel/cpu/mshyperv.c +5 −13
  311. arch/x86/kernel/cpu/perf_event_intel.c +20 −4
  312. arch/x86/kernel/cpu/perf_event_intel_ds.c +12 −1
  313. arch/x86/kernel/kprobes/core.c +4 −1
  314. arch/x86/kernel/microcode_core_early.c +31 −7
  315. arch/x86/kernel/microcode_intel_early.c +15 −15
  316. arch/x86/kernel/paravirt.c +13 −12
  317. arch/x86/kernel/setup.c +37 −8
  318. arch/x86/kvm/lapic.c +1 −1
  319. arch/x86/kvm/x86.c +33 −36
  320. arch/x86/lguest/boot.c +1 −0
  321. arch/x86/lib/usercopy_64.c +2 −2
  322. arch/x86/mm/fault.c +4 −2
  323. arch/x86/mm/pageattr-test.c +1 −1
  324. arch/x86/mm/pageattr.c +7 −5
  325. arch/x86/mm/pgtable.c +7 −0
  326. arch/x86/platform/efi/efi.c +163 −5
  327. arch/x86/power/cpu.c +2 −0
  328. arch/x86/xen/mmu.c +10 −6
  329. arch/xtensa/Kconfig +1 −1
  330. block/blk-core.c +1 −0
  331. block/blk-flush.c +1 −1
  332. block/blk-sysfs.c +2 −0
  333. crypto/gcm.c +14 −3
  334. drivers/acpi/Kconfig +1 −1
  335. drivers/acpi/acpi_i2c.c +1 −1
  336. drivers/acpi/apei/cper.c +1 −1
  337. drivers/acpi/pci_root.c +44 −41
  338. drivers/acpi/processor_idle.c +7 −6
  339. drivers/acpi/processor_perflib.c +2 −2
  340. drivers/acpi/sleep.c +8 −0
  341. drivers/amba/tegra-ahb.c +1 −1
  342. drivers/ata/Kconfig +7 −6
  343. drivers/ata/ahci.c +2 −0
  344. drivers/ata/ata_piix.c +17 −1
  345. drivers/ata/libata-acpi.c +1 −1
  346. drivers/ata/libata-core.c +5 −1
  347. drivers/ata/libata-scsi.c +4 −4
  348. drivers/ata/pata_samsung_cf.c +1 −12
  349. drivers/ata/sata_fsl.c +1 −2
  350. drivers/base/power/qos.c +47 −13
  351. drivers/base/regmap/regcache-rbtree.c +1 −1
  352. drivers/base/regmap/regmap.c +4 −2
  353. drivers/block/Kconfig +2 −2
  354. drivers/block/aoe/aoecmd.c +2 −1
  355. drivers/block/cciss.c +1 −1
  356. drivers/block/loop.c +9 −1
  357. drivers/block/mg_disk.c +3 −1
  358. drivers/block/mtip32xx/mtip32xx.c +235 −96
  359. drivers/block/mtip32xx/mtip32xx.h +11 −7
  360. drivers/block/nvme.c +24 −9
  361. drivers/block/rbd.c +32 −18
  362. drivers/block/rsxx/Makefile +1 −1
  363. drivers/block/rsxx/config.c +3 −5
  364. drivers/block/rsxx/core.c +224 −13
  365. drivers/block/rsxx/cregs.c +72 −40
  366. drivers/block/rsxx/dma.c +168 −71
  367. drivers/block/rsxx/rsxx.h +4 −2
  368. drivers/block/rsxx/rsxx_cfg.h +1 −1
  369. drivers/block/rsxx/rsxx_priv.h +27 −7
  370. drivers/block/xen-blkback/blkback.c +39 −29
  371. drivers/block/xen-blkback/common.h +32 −8
  372. drivers/block/xen-blkback/xenbus.c +7 −7
  373. drivers/block/xen-blkfront.c +91 −63
  374. drivers/bluetooth/ath3k.c +8 −0
  375. drivers/bluetooth/btusb.c +4 −0
  376. drivers/char/hpet.c +1 −13
  377. drivers/char/hw_random/core.c +9 −0
  378. drivers/char/hw_random/virtio-rng.c +11 −2
  379. drivers/char/virtio_console.c +30 −14
  380. drivers/clk/clk-vt8500.c +1 −1
  381. drivers/clk/tegra/clk-tegra20.c +1 −2
  382. drivers/clk/tegra/clk-tegra30.c +0 −1
  383. drivers/cpufreq/acpi-cpufreq.c +0 −2
  384. drivers/cpufreq/cpufreq-cpu0.c +8 −2
  385. drivers/cpufreq/cpufreq_governor.h +3 −3
  386. drivers/cpufreq/cpufreq_stats.c +8 −4
  387. drivers/cpufreq/intel_pstate.c +30 −5
  388. drivers/crypto/caam/caamalg.c +2 −25
  389. drivers/crypto/caam/compat.h +0 −1
  390. drivers/crypto/talitos.c +2 −28
  391. drivers/crypto/ux500/cryp/cryp_core.c +1 −1
  392. drivers/dma/Kconfig +1 −0
  393. drivers/dma/at_hdmac.c +4 −5
  394. drivers/dma/dw_dmac.c +19 −4
  395. drivers/dma/dw_dmac_regs.h +1 −0
  396. drivers/dma/omap-dma.c +14 −6
  397. drivers/dma/pl330.c +27 −11
  398. drivers/edac/amd64_edac.c +9 −6
  399. drivers/edac/edac_mc.c +3 −3
  400. drivers/edac/edac_mc_sysfs.c +5 −12
  401. drivers/eisa/pci_eisa.c +46 −21
  402. drivers/extcon/extcon-max77693.c +80 −23
  403. drivers/extcon/extcon-max8997.c +34 −22
  404. drivers/firmware/Kconfig +19 −0
  405. drivers/firmware/efivars.c +125 −123
  406. drivers/gpio/gpio-ich.c +1 −1
  407. drivers/gpio/gpio-mvebu.c +7 −0
  408. drivers/gpio/gpio-pca953x.c +1 −1
  409. drivers/gpio/gpio-stmpe.c +11 −4
  410. drivers/gpio/gpiolib-of.c +2 −3
  411. drivers/gpu/drm/drm_crtc.c +0 −2
  412. drivers/gpu/drm/drm_edid.c +2 −1
  413. drivers/gpu/drm/drm_fb_helper.c +5 −3
  414. drivers/gpu/drm/drm_fops.c +4 −2
  415. drivers/gpu/drm/exynos/exynos_drm_fimd.c +11 −10
  416. drivers/gpu/drm/exynos/exynos_drm_g2d.c +325 −45
  417. drivers/gpu/drm/exynos/exynos_drm_gem.c +21 −0
  418. drivers/gpu/drm/exynos/exynos_drm_gem.h +5 −0
  419. drivers/gpu/drm/exynos/exynos_drm_vidi.c +2 −4
  420. drivers/gpu/drm/exynos/exynos_mixer.c +1 −1
  421. drivers/gpu/drm/i915/i915_debugfs.c +1 −1
  422. drivers/gpu/drm/i915/i915_drv.c +5 −0
  423. drivers/gpu/drm/i915/i915_drv.h +1 −0
  424. drivers/gpu/drm/i915/i915_gem_execbuffer.c +9 −4
  425. drivers/gpu/drm/i915/intel_crt.c +17 −23
  426. drivers/gpu/drm/i915/intel_display.c +5 −5
  427. drivers/gpu/drm/i915/intel_dp.c +15 −2
  428. drivers/gpu/drm/i915/intel_i2c.c +10 −1
  429. drivers/gpu/drm/i915/intel_panel.c +5 −8
  430. drivers/gpu/drm/i915/intel_pm.c +3 −0
  431. drivers/gpu/drm/mgag200/mgag200_mode.c +8 −15
  432. drivers/gpu/drm/nouveau/core/core/object.c +1 −2
  433. drivers/gpu/drm/nouveau/core/engine/disp/nv50.c +2 −2
  434. drivers/gpu/drm/nouveau/core/include/subdev/therm.h +1 −1
  435. drivers/gpu/drm/nouveau/core/subdev/bios/base.c +17 −0
  436. drivers/gpu/drm/nouveau/core/subdev/therm/base.c +12 −6
  437. drivers/gpu/drm/nouveau/core/subdev/therm/ic.c +4 −2
  438. drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c +48 −19
  439. drivers/gpu/drm/nouveau/core/subdev/therm/priv.h +2 −1
  440. drivers/gpu/drm/nouveau/core/subdev/therm/temp.c +16 −14
  441. drivers/gpu/drm/nouveau/nouveau_abi16.c +15 −8
  442. drivers/gpu/drm/nouveau/nouveau_bo.c +2 −2
  443. drivers/gpu/drm/nouveau/nouveau_drm.c +20 −12
  444. drivers/gpu/drm/nouveau/nouveau_drm.h +1 −1
  445. drivers/gpu/drm/nouveau/nouveau_pm.c +31 −13
  446. drivers/gpu/drm/nouveau/nv50_display.c +4 −3
  447. drivers/gpu/drm/radeon/ni.c +27 −6
  448. drivers/gpu/drm/radeon/radeon_benchmark.c +10 −11
  449. drivers/gpu/drm/radeon/radeon_bios.c +26 −0
  450. drivers/gpu/drm/radeon/si.c +1 −0
  451. drivers/gpu/drm/udl/udl_connector.c +4 −0
  452. drivers/hid/hid-core.c +12 −1
  453. drivers/hid/hid-ids.h +8 −3
  454. drivers/hid/hid-magicmouse.c +20 −9
  455. drivers/hid/hid-multitouch.c +5 −1
  456. drivers/hid/usbhid/hid-quirks.c +2 −0
  457. drivers/hwmon/lineage-pem.c +2 −0
  458. drivers/hwmon/lm75.h +1 −1
  459. drivers/hwmon/pmbus/ltc2978.c +8 −6
  460. drivers/hwmon/pmbus/pmbus_core.c +7 −5
  461. drivers/hwspinlock/hwspinlock_core.c +2 −0
  462. drivers/i2c/Kconfig +1 −1
  463. drivers/i2c/busses/Kconfig +4 −2
  464. drivers/i2c/busses/i2c-designware-platdrv.c +0 −1
  465. drivers/i2c/busses/i2c-ismt.c +2 −0
  466. drivers/i2c/busses/i2c-tegra.c +11 −2
  467. drivers/i2c/muxes/i2c-mux-pca9541.c +1 −1
  468. drivers/idle/intel_idle.c +1 −0
  469. drivers/iio/common/st_sensors/st_sensors_core.c +4 −5
  470. drivers/iio/dac/ad5064.c +38 −26
  471. drivers/iio/imu/inv_mpu6050/Kconfig +1 −0
  472. drivers/infiniband/hw/cxgb4/cm.c +12 −0
  473. drivers/infiniband/hw/cxgb4/qp.c +3 −1
  474. drivers/infiniband/hw/ipath/ipath_verbs.c +1 −1
  475. drivers/infiniband/hw/mlx4/cm.c +0 −1
  476. drivers/infiniband/hw/qib/Kconfig +3 −3
  477. drivers/infiniband/hw/qib/qib_driver.c +3 −2
  478. drivers/infiniband/hw/qib/qib_iba6120.c +2 −1
  479. drivers/infiniband/hw/qib/qib_init.c +4 −4
  480. drivers/infiniband/hw/qib/qib_sd7220.c +1 −1
  481. drivers/infiniband/hw/qib/qib_verbs.c +2 −2
  482. drivers/infiniband/ulp/ipoib/ipoib_cm.c +6 −2
  483. drivers/input/joystick/analog.c +2 −6
  484. drivers/input/tablet/wacom_wac.c +4 −4
  485. drivers/iommu/Kconfig +1 −1
  486. drivers/iommu/amd_iommu.c +10 −12
  487. drivers/iommu/amd_iommu_init.c +1 −1
  488. drivers/iommu/irq_remapping.c +0 −1
  489. drivers/irqchip/irq-gic.c +3 −2
  490. drivers/isdn/hisax/Kconfig +4 −2
  491. drivers/md/dm-bufio.c +2 −0
  492. drivers/md/dm-cache-metadata.c +51 −13
  493. drivers/md/dm-cache-metadata.h +1 −1
  494. drivers/md/dm-cache-policy-cleaner.c +5 −2
  495. drivers/md/dm-cache-policy-internal.h +2 −0
  496. drivers/md/dm-cache-policy-mq.c +6 −2
  497. drivers/md/dm-cache-policy.c +8 −0
  498. drivers/md/dm-cache-policy.h +2 −0
  499. drivers/md/dm-cache-target.c +144 −70
  500. drivers/md/dm-thin.c +8 −3
  501. drivers/md/dm-verity.c +34 −5
  502. drivers/md/dm.c +1 −0
  503. drivers/md/md.c +2 −4
  504. drivers/md/md.h +2 −2
  505. drivers/md/persistent-data/dm-btree-remove.c +24 −22
  506. drivers/md/raid5.c +91 −36
  507. drivers/md/raid5.h +1 −4
  508. drivers/media/i2c/m5mols/m5mols_core.c +1 −1
  509. drivers/media/pci/bt8xx/bttv-driver.c +15 −5
  510. drivers/media/platform/Kconfig +1 −1
  511. drivers/media/platform/exynos-gsc/gsc-core.c +5 −3
  512. drivers/media/platform/s5p-fimc/fimc-core.c +4 −2
  513. drivers/media/platform/s5p-fimc/fimc-lite-reg.c +4 −4
  514. drivers/media/platform/s5p-fimc/fimc-lite.c +1 −0
  515. drivers/media/platform/s5p-fimc/fimc-mdevice.c +19 −20
  516. drivers/media/platform/s5p-mfc/s5p_mfc.c +1 −1
  517. drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +1 −0
  518. drivers/media/radio/radio-ma901.c +11 −0
  519. drivers/media/rc/Kconfig +1 −1
  520. drivers/media/v4l2-core/Makefile +1 −1
  521. drivers/mfd/Kconfig +1 −0
  522. drivers/mfd/ab8500-gpadc.c +13 −4
  523. drivers/mfd/omap-usb-host.c +3 −3
  524. drivers/mfd/palmas.c +33 −3
  525. drivers/mfd/tps65912-core.c +1 −0
  526. drivers/mfd/twl4030-audio.c +1 −1
  527. drivers/mfd/twl4030-madc.c +1 −1
  528. drivers/misc/mei/hw-me.c +20 −9
  529. drivers/misc/mei/init.c +18 −0
  530. drivers/misc/mei/mei_dev.h +1 −0
  531. drivers/misc/mei/pci-me.c +7 −45
  532. drivers/misc/vmw_vmci/Kconfig +1 −1
  533. drivers/misc/vmw_vmci/vmci_datagram.c +3 −1
  534. drivers/mtd/bcm47xxpart.c +33 −19
  535. drivers/mtd/mtdchar.c +2 −57
  536. drivers/mtd/nand/nand_base.c +16 −0
  537. drivers/mtd/nand/nand_ids.c +41 −39
  538. drivers/net/bonding/bond_main.c +75 −33
  539. drivers/net/bonding/bond_sysfs.c +53 −44
  540. drivers/net/can/mcp251x.c +8 −2
  541. drivers/net/can/sja1000/Kconfig +1 −0
  542. drivers/net/can/sja1000/plx_pci.c +2 −2
  543. drivers/net/can/sja1000/sja1000.c +3 −3
  544. drivers/net/can/sja1000/sja1000.h +1 −1
  545. drivers/net/can/sja1000/sja1000_of_platform.c +15 −16
  546. drivers/net/ethernet/8390/ax88796.c +1 −1
  547. drivers/net/ethernet/atheros/atl1e/atl1e.h +1 −2
  548. drivers/net/ethernet/atheros/atl1e/atl1e_main.c +3 −17
  549. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +6 −2
  550. drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c +9 −9
  551. drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +11 −7
  552. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +6 −1
  553. drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h +2 −1
  554. drivers/net/ethernet/broadcom/tg3.c +13 −2
  555. drivers/net/ethernet/calxeda/xgmac.c +8 −1
  556. drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +9 −3
  557. drivers/net/ethernet/davicom/dm9000.c +110 −104
  558. drivers/net/ethernet/davicom/dm9000.h +10 −1
  559. drivers/net/ethernet/dec/tulip/Kconfig +1 −0
  560. drivers/net/ethernet/emulex/benet/be_main.c +3 −2
  561. drivers/net/ethernet/freescale/fec.c +69 −45
  562. drivers/net/ethernet/freescale/fec.h +1 −0
  563. drivers/net/ethernet/freescale/fec_ptp.c +3 −0
  564. drivers/net/ethernet/intel/e100.c +25 −11
  565. drivers/net/ethernet/intel/e1000/e1000_ethtool.c +11 −3
  566. drivers/net/ethernet/intel/e1000e/netdev.c +6 −1
  567. drivers/net/ethernet/intel/igb/e1000_82575.c +19 −14
  568. drivers/net/ethernet/intel/igb/igb.h +0 −8
  569. drivers/net/ethernet/intel/igb/igb_hwmon.c +1 −1
  570. drivers/net/ethernet/intel/igb/igb_main.c +6 −108
  571. drivers/net/ethernet/intel/igb/igb_ptp.c +1 −1
  572. drivers/net/ethernet/intel/ixgb/ixgb_main.c +6 −1
  573. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +9 −2
  574. drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +6 −0
  575. drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +20 −4
  576. drivers/net/ethernet/lantiq_etop.c +1 −1
  577. drivers/net/ethernet/marvell/Kconfig +1 −1
  578. drivers/net/ethernet/marvell/mvneta.c +9 −9
  579. drivers/net/ethernet/marvell/sky2.c +1 −1
  580. drivers/net/ethernet/marvell/sky2.h +1 −1
  581. drivers/net/ethernet/mellanox/mlx4/en_netdev.c +13 −13
  582. drivers/net/ethernet/mellanox/mlx4/eq.c +1 −1
  583. drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +35 −10
  584. drivers/net/ethernet/micrel/ks8851.c +1 −1
  585. drivers/net/ethernet/nxp/lpc_eth.c +2 −1
  586. drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +2 −2
  587. drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +10 −5
  588. drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c +1 −2
  589. drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c +2 −2
  590. drivers/net/ethernet/qlogic/qlge/qlge.h +1 −1
  591. drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c +1 −1
  592. drivers/net/ethernet/qlogic/qlge/qlge_main.c +29 −7
  593. drivers/net/ethernet/realtek/r8169.c +25 −3
  594. drivers/net/ethernet/renesas/sh_eth.c +28 −10
  595. drivers/net/ethernet/renesas/sh_eth.h +2 −1
  596. drivers/net/ethernet/sfc/nic.c +2 −1
  597. drivers/net/ethernet/stmicro/stmmac/mmc_core.c +1 −0
  598. drivers/net/ethernet/ti/cpsw.c +4 −4
  599. drivers/net/ethernet/ti/davinci_emac.c +2 −2
  600. drivers/net/hyperv/netvsc.c +12 −5
  601. drivers/net/hyperv/netvsc_drv.c +0 −2
  602. drivers/net/hyperv/rndis_filter.c +1 −13
  603. drivers/net/netconsole.c +9 −6
  604. drivers/net/tun.c +1 −1
  605. drivers/net/usb/Kconfig +1 −1
  606. drivers/net/usb/cdc_mbim.c +2 −11
  607. drivers/net/usb/cdc_ncm.c +32 −17
  608. drivers/net/usb/qmi_wwan.c +120 −33
  609. drivers/net/usb/smsc75xx.c +8 −4
  610. drivers/net/wireless/ath/ath9k/ar9003_calib.c +4 −0
  611. drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h +1 −1
  612. drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c +2 −2
  613. drivers/net/wireless/ath/ath9k/dfs_pri_detector.c +2 −2
  614. drivers/net/wireless/ath/ath9k/htc_drv_init.c +1 −1
  615. drivers/net/wireless/ath/ath9k/link.c +15 −14
  616. drivers/net/wireless/ath/ath9k/main.c +4 −0
  617. drivers/net/wireless/b43/dma.c +53 −12
  618. drivers/net/wireless/b43/phy_n.c +6 −5
  619. drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +3 −3
  620. drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +26 −27
  621. drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +132 −132
  622. drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c +130 −239
  623. drivers/net/wireless/brcm80211/brcmsmac/phy/phytbl_lcn.c +32 −32
  624. drivers/net/wireless/iwlegacy/3945-mac.c +12 −10
  625. drivers/net/wireless/iwlegacy/4965-rs.c +2 −1
  626. drivers/net/wireless/iwlwifi/dvm/lib.c +9 −0
  627. drivers/net/wireless/iwlwifi/dvm/rxon.c +8 −10
  628. drivers/net/wireless/iwlwifi/dvm/tx.c +1 −1
  629. drivers/net/wireless/iwlwifi/dvm/ucode.c +2 −2
  630. drivers/net/wireless/iwlwifi/pcie/trans.c +13 −0
  631. drivers/net/wireless/iwlwifi/pcie/tx.c +1 −1
  632. drivers/net/wireless/mwifiex/cfg80211.c +2 −1
  633. drivers/net/wireless/mwifiex/cmdevt.c +16 −6
  634. drivers/net/wireless/mwifiex/init.c +8 −0
  635. drivers/net/wireless/mwifiex/join.c +3 −4
  636. drivers/net/wireless/mwifiex/main.h +2 −2
  637. drivers/net/wireless/mwifiex/pcie.c +1 −0
  638. drivers/net/wireless/mwifiex/scan.c +12 −5
  639. drivers/net/wireless/mwifiex/sta_ioctl.c +2 −8
  640. drivers/net/wireless/rt2x00/Kconfig +9 −2
  641. drivers/net/wireless/rt2x00/Makefile +1 −0
  642. drivers/net/wireless/rt2x00/rt2400pci.c +1 −0
  643. drivers/net/wireless/rt2x00/rt2500pci.c +1 −0
  644. drivers/net/wireless/rt2x00/rt2800pci.c +8 −7
  645. drivers/net/wireless/rt2x00/rt2x00mmio.c +216 −0
  646. drivers/net/wireless/rt2x00/rt2x00mmio.h +119 −0
  647. drivers/net/wireless/rt2x00/rt2x00pci.c +0 −176
  648. drivers/net/wireless/rt2x00/rt2x00pci.h +0 −88
  649. drivers/net/wireless/rt2x00/rt61pci.c +1 −0
  650. drivers/net/wireless/rtlwifi/rtl8192cu/hw.c +35 −54
  651. drivers/net/wireless/rtlwifi/usb.c +1 −0
  652. drivers/nfc/microread/mei.c +17 −21
  653. drivers/pci/pci-acpi.c +8 −7
  654. drivers/pci/pci-driver.c +3 −2
  655. drivers/pci/pcie/portdrv_pci.c +0 −13
  656. drivers/pci/rom.c +19 −9
  657. drivers/pinctrl/mvebu/pinctrl-mvebu.c +1 −1
  658. drivers/pinctrl/pinconf.c +1 −1
  659. drivers/pinctrl/pinconf.h +1 −1
  660. drivers/pinctrl/pinctrl-abx500.c +1 −1
  661. drivers/pinctrl/pinctrl-at91.c +60 −1
  662. drivers/pinctrl/pinmux.c +5 −0
  663. drivers/platform/x86/hp-wmi.c +0 −4
  664. drivers/platform/x86/thinkpad_acpi.c +0 −10
  665. drivers/remoteproc/Kconfig +1 −1
  666. drivers/remoteproc/remoteproc_core.c +4 −2
  667. drivers/remoteproc/ste_modem_rproc.c +6 −1
  668. drivers/rtc/rtc-da9052.c +3 −5
  669. drivers/rtc/rtc-mv.c +24 −4
  670. drivers/s390/block/scm_blk.c +67 −9
  671. drivers/s390/block/scm_blk.h +2 −0
  672. drivers/s390/block/scm_drv.c +17 −6
  673. drivers/s390/char/sclp_cmd.c +2 −0
  674. drivers/s390/char/tty3270.c +9 −7
  675. drivers/s390/cio/chsc.c +17 −0
  676. drivers/s390/cio/chsc.h +2 −0
  677. drivers/s390/cio/scm.c +17 −1
  678. drivers/s390/net/qeth_core.h +4 −0
  679. drivers/s390/net/qeth_core_main.c +57 −7
  680. drivers/s390/net/qeth_l2_main.c +2 −0
  681. drivers/s390/net/qeth_l3_main.c +17 −8
  682. drivers/s390/net/qeth_l3_sys.c +2 −0
  683. drivers/sbus/char/bbc_i2c.c +2 −2
  684. drivers/scsi/bnx2fc/bnx2fc_fcoe.c +3 −3
  685. drivers/scsi/fcoe/fcoe.c +11 −4
  686. drivers/scsi/fcoe/fcoe_ctlr.c +46 −14
  687. drivers/scsi/ibmvscsi/ibmvscsi.c +1 −1
  688. drivers/scsi/ipr.c +10 −3
  689. drivers/scsi/libfc/fc_disc.c +18 −8
  690. drivers/scsi/libsas/sas_expander.c +13 −1
  691. drivers/scsi/lpfc/lpfc_sli.c +2 −1
  692. drivers/scsi/qla2xxx/qla_attr.c +0 −5
  693. drivers/scsi/qla2xxx/qla_dbg.c +2 −1
  694. drivers/scsi/qla2xxx/qla_def.h +0 −1
  695. drivers/scsi/qla2xxx/qla_gbl.h +0 −3
  696. drivers/scsi/qla2xxx/qla_init.c +1 −3
  697. drivers/scsi/qla2xxx/qla_mbx.c +0 −58
  698. drivers/scsi/qla2xxx/qla_version.h +1 −1
  699. drivers/scsi/st.c +7 −1
  700. drivers/spi/Kconfig +2 −1
  701. drivers/spi/spi-bcm63xx.c +1 −2
  702. drivers/spi/spi-mpc512x-psc.c +1 −1
  703. drivers/spi/spi-pxa2xx.c +0 −1
  704. drivers/spi/spi-s3c64xx.c +25 −16
  705. drivers/spi/spi-tegra20-slink.c +8 −17
  706. drivers/spi/spi.c +8 −9
  707. drivers/ssb/driver_chipcommon_pmu.c +29 −0
  708. drivers/staging/comedi/drivers/dt9812.c +10 −6
  709. drivers/staging/comedi/drivers/s626.c +1 −1
  710. drivers/staging/comedi/drivers/usbdux.c +19 −12
  711. drivers/staging/comedi/drivers/usbduxfast.c +18 −12
  712. drivers/staging/comedi/drivers/usbduxsigma.c +17 −10
  713. drivers/staging/imx-drm/ipuv3-crtc.c +12 −11
  714. drivers/staging/tidspbridge/rmgr/drv.c +26 −44
  715. drivers/staging/vt6656/card.c +1 −1
  716. drivers/staging/vt6656/main_usb.c +0 −4
  717. drivers/staging/zcache/Kconfig +1 −1
  718. drivers/staging/zcache/ramster/tcp.c +10 −15
  719. drivers/target/iscsi/iscsi_target_auth.c +4 −1
  720. drivers/target/target_core_alua.c +3 −0
  721. drivers/target/target_core_file.h +1 −1
  722. drivers/target/target_core_pscsi.c +8 −3
  723. drivers/target/target_core_sbc.c +5 −2
  724. drivers/target/target_core_tpg.c +2 −1
  725. drivers/target/target_core_transport.c +3 −1
  726. drivers/thermal/dove_thermal.c +6 −10
  727. drivers/thermal/exynos_thermal.c +1 −1
  728. drivers/thermal/kirkwood_thermal.c +3 −5
  729. drivers/thermal/rcar_thermal.c +14 −15
  730. drivers/tty/mxser.c +4 −4
  731. drivers/tty/serial/8250/8250_core.c +53 −1
  732. drivers/tty/serial/8250/8250_pci.c +24 −10
  733. drivers/tty/serial/8250/Kconfig +17 −0
  734. drivers/tty/serial/8250/Makefile +4 −4
  735. drivers/tty/serial/Kconfig +2 −2
  736. drivers/tty/serial/atmel_serial.c +5 −6
  737. drivers/tty/serial/bcm63xx_uart.c +4 −4
  738. drivers/tty/serial/mpc52xx_uart.c +1 −1
  739. drivers/tty/serial/of_serial.c +6 −0
  740. drivers/tty/serial/omap-serial.c +11 −0
  741. drivers/tty/serial/sunsu.c +9 −12
  742. drivers/tty/serial/vt8500_serial.c +1 −8
  743. drivers/tty/serial/xilinx_uartps.c +2 −0
  744. drivers/tty/tty_buffer.c +1 −1
  745. drivers/tty/vt/vc_screen.c +4 −2
  746. drivers/usb/Makefile +1 −1
  747. drivers/usb/c67x00/c67x00-sched.c +2 −2
  748. drivers/usb/chipidea/udc.c +3 −3
  749. drivers/usb/class/cdc-acm.c +19 −3
  750. drivers/usb/class/cdc-wdm.c +20 −3
  751. drivers/usb/core/hcd-pci.c +14 −9
  752. drivers/usb/core/hcd.c +8 −0
  753. drivers/usb/core/port.c +0 −1
  754. drivers/usb/core/usb-acpi.c +7 −1
  755. drivers/usb/dwc3/core.c +1 −0
  756. drivers/usb/dwc3/dwc3-exynos.c +0 −2
  757. drivers/usb/dwc3/dwc3-omap.c +3 −5
  758. drivers/usb/dwc3/dwc3-pci.c +0 −2
  759. drivers/usb/dwc3/ep0.c +4 −3
  760. drivers/usb/dwc3/gadget.c +0 −3
  761. drivers/usb/gadget/Kconfig +1 −0
  762. drivers/usb/gadget/Makefile +6 −6
  763. drivers/usb/gadget/composite.c +1 −4
  764. drivers/usb/gadget/f_rndis.c +1 −2
  765. drivers/usb/gadget/f_uac1.c +1 −0
  766. drivers/usb/gadget/g_ffs.c +2 −2
  767. drivers/usb/gadget/imx_udc.c +8 −12
  768. drivers/usb/gadget/net2272.c +8 −1
  769. drivers/usb/gadget/net2280.c +7 −1
  770. drivers/usb/gadget/omap_udc.c +2 −1
  771. drivers/usb/gadget/pxa25x_udc.c +15 −9
  772. drivers/usb/gadget/pxa27x_udc.c +12 −6
  773. drivers/usb/gadget/s3c2410_udc.c +12 −16
  774. drivers/usb/gadget/u_serial.c +1 −1
  775. drivers/usb/gadget/u_uac1.c +3 −0
  776. drivers/usb/gadget/udc-core.c +1 −1
  777. drivers/usb/host/ehci-hcd.c +3 −4
  778. drivers/usb/host/ehci-hub.c +1 −1
  779. drivers/usb/host/ehci-q.c +40 −9
  780. drivers/usb/host/ehci-sched.c +2 −0
  781. drivers/usb/host/ehci-timer.c +1 −1
  782. drivers/usb/host/xhci-mem.c +8 −28
  783. drivers/usb/host/xhci-pci.c +1 −0
  784. drivers/usb/host/xhci-ring.c +35 −26
  785. drivers/usb/host/xhci.c +24 −1
  786. drivers/usb/host/xhci.h +7 −2
  787. drivers/usb/musb/Kconfig +0 −5
  788. drivers/usb/musb/da8xx.c +1 −1
  789. drivers/usb/musb/musb_core.c +0 −6
  790. drivers/usb/musb/musb_gadget.c +7 −2
  791. drivers/usb/musb/omap2430.c +8 −4
  792. drivers/usb/otg/otg.c +7 −3
  793. drivers/usb/phy/Kconfig +1 −0
  794. drivers/usb/phy/omap-control-usb.c +9 −15
  795. drivers/usb/phy/omap-usb3.c +3 −5
  796. drivers/usb/phy/samsung-usbphy.c +3 −5
  797. drivers/usb/serial/ark3116.c +6 −4
  798. drivers/usb/serial/ch341.c +6 −5
  799. drivers/usb/serial/cp210x.c +20 −0
  800. drivers/usb/serial/cypress_m8.c +8 −6
  801. drivers/usb/serial/f81232.c +5 −4
  802. drivers/usb/serial/ftdi_sio.c +9 −11
  803. drivers/usb/serial/ftdi_sio_ids.h +7 −0
  804. drivers/usb/serial/garmin_gps.c +1 −6
  805. drivers/usb/serial/io_edgeport.c +7 −5
  806. drivers/usb/serial/io_ti.c +7 −6
  807. drivers/usb/serial/mct_u232.c +7 −6
  808. drivers/usb/serial/mos7840.c +10 −6
  809. drivers/usb/serial/option.c +5 −0
  810. drivers/usb/serial/oti6858.c +6 −4
  811. drivers/usb/serial/pl2303.c +6 −5
  812. drivers/usb/serial/qcaux.c +1 −0
  813. drivers/usb/serial/qcserial.c +5 −2
  814. drivers/usb/serial/quatech2.c +12 −7
  815. drivers/usb/serial/spcp8x5.c +5 −4
  816. drivers/usb/serial/ssu100.c +7 −5
  817. drivers/usb/serial/ti_usb_3410_5052.c +6 −4
  818. drivers/usb/serial/usb-serial.c +3 −1
  819. drivers/usb/storage/initializers.c +2 −74
  820. drivers/usb/storage/initializers.h +2 −2
  821. drivers/usb/storage/unusual_devs.h +342 −2
  822. drivers/vfio/pci/vfio_pci.c +2 −1
  823. drivers/vfio/pci/vfio_pci_config.c +1 −0
  824. drivers/vfio/pci/vfio_pci_intrs.c +1 −0
  825. drivers/vhost/net.c +2 −1
  826. drivers/vhost/tcm_vhost.c +148 −72
  827. drivers/video/atmel_lcdfb.c +15 −7
  828. drivers/video/ep93xx-fb.c +1 −0
  829. drivers/video/fbmem.c +14 −25
  830. drivers/video/fbmon.c +1 −1
  831. drivers/video/mmp/core.c +0 −2
  832. drivers/video/mxsfb.c +5 −2
  833. drivers/video/omap/lcd_ams_delta.c +1 −0
  834. drivers/video/omap/lcd_osk.c +3 −0
  835. drivers/video/omap/omapfb_main.c +2 −0
  836. drivers/video/omap2/displays/panel-tpo-td043mtea1.c +11 −2
  837. drivers/video/omap2/dss/dss_features.c +2 −4
  838. drivers/video/sh_mobile_lcdcfb.c +1 −0
  839. drivers/video/uvesafb.c +2 −1
  840. drivers/w1/masters/w1-gpio.c +4 −2
  841. drivers/w1/w1.c +2 −1
  842. drivers/watchdog/Kconfig +1 −1
  843. drivers/watchdog/sp5100_tco.c +6 −120
  844. drivers/watchdog/sp5100_tco.h +1 −1
  845. drivers/xen/Kconfig +1 −1
  846. drivers/xen/events.c +30 −9
  847. drivers/xen/fallback.c +2 −1
  848. drivers/xen/xen-acpi-processor.c +7 −4
  849. drivers/xen/xen-pciback/pci_stub.c +44 −15
  850. drivers/xen/xen-pciback/pciback_ops.c +2 −1
  851. drivers/xen/xen-stub.c +0 −1
  852. fs/binfmt_elf.c +1 −0
  853. fs/bio.c +0 −2
  854. fs/block_dev.c +1 −0
  855. fs/btrfs/ctree.c +20 −10
  856. fs/btrfs/disk-io.c +10 −4
  857. fs/btrfs/extent-tree.c +76 −13
  858. fs/btrfs/extent_io.c +33 −0
  859. fs/btrfs/extent_io.h +2 −0
  860. fs/btrfs/file-item.c +3 −3
  861. fs/btrfs/file.c +10 −0
  862. fs/btrfs/inode.c +21 −4
  863. fs/btrfs/locking.h +0 −1
  864. fs/btrfs/ordered-data.c +2 −0
  865. fs/btrfs/qgroup.c +7 −6
  866. fs/btrfs/scrub.c +2 −1
  867. fs/btrfs/send.c +4 −6
  868. fs/btrfs/transaction.c +5 −6
  869. fs/btrfs/tree-log.c +42 −6
  870. fs/btrfs/volumes.c +18 −1
  871. fs/cifs/asn1.c +5 −48
  872. fs/cifs/cifsfs.c +25 −0
  873. fs/cifs/cifsfs.h +4 −0
  874. fs/cifs/connect.c +13 −3
  875. fs/cifs/file.c +5 −1
  876. fs/cifs/inode.c +4 −6
  877. fs/cifs/netmisc.c +1 −1
  878. fs/compat.c +7 −8
  879. fs/dcache.c +11 −5
  880. fs/ecryptfs/miscdev.c +2 −12
  881. fs/ext2/ialloc.c +0 −1
  882. fs/ext2/inode.c +2 −0
  883. fs/ext3/super.c +2 −2
  884. fs/ext4/ext4.h +4 −4
  885. fs/ext4/extents.c +87 −21
  886. fs/ext4/extents_status.c +207 −5
  887. fs/ext4/extents_status.h +9 −0
  888. fs/ext4/ialloc.c +2 −2
  889. fs/ext4/indirect.c +2 −2
  890. fs/ext4/inode.c +174 −8
  891. fs/ext4/mballoc.c +8 −15
  892. fs/ext4/move_extent.c +27 −16
  893. fs/ext4/page-io.c +11 −1
  894. fs/ext4/resize.c +2 −2
  895. fs/ext4/super.c +4 −2
  896. fs/freevxfs/vxfs_super.c +1 −0
  897. fs/gfs2/file.c +4 −1
  898. fs/gfs2/incore.h +1 −0
  899. fs/gfs2/lock_dlm.c +20 −19
  900. fs/gfs2/rgrp.c +14 −18
  901. fs/hfsplus/extents.c +1 −1
  902. fs/hostfs/hostfs_kern.c +1 −0
  903. fs/hpfs/super.c +1 −0
  904. fs/hugetlbfs/inode.c +1 −1
  905. fs/inode.c +1 −1
  906. fs/internal.h +5 −0
  907. fs/isofs/inode.c +1 −0
  908. fs/jbd2/transaction.c +10 −5
  909. fs/namespace.c +54 −2
  910. fs/nfs/blocklayout/blocklayoutdm.c +2 −2
  911. fs/nfs/idmap.c +8 −5
  912. fs/nfs/nfs4client.c +29 −16
  913. fs/nfs/nfs4filelayout.c +0 −1
  914. fs/nfs/nfs4proc.c +2 −15
  915. fs/nfs/nfs4state.c +7 −1
  916. fs/nfs/pnfs.c +72 −9
  917. fs/nfs/pnfs.h +6 −0
  918. fs/nfs/super.c +1 −0
  919. fs/nfsd/nfs4state.c +2 −34
  920. fs/nfsd/nfs4xdr.c +1 −1
  921. fs/nfsd/nfscache.c +6 −5
  922. fs/nfsd/vfs.c +2 −1
  923. fs/pipe.c +3 −0
  924. fs/pnode.c +6 −0
  925. fs/pnode.h +1 −0
  926. fs/proc/array.c +1 −0
  927. fs/proc/generic.c +89 −30
  928. fs/proc/inode.c +3 −3
  929. fs/proc/root.c +4 −0
  930. fs/quota/dquot.c +4 −1
  931. fs/read_write.c +28 −0
  932. fs/reiserfs/super.c +1 −3
  933. fs/reiserfs/xattr.c +2 −2
  934. fs/splice.c +3 −1
  935. fs/squashfs/super.c +1 −0
  936. fs/sysfs/dir.c +16 −1
  937. fs/sysfs/mount.c +4 −0
  938. fs/sysv/super.c +1 −0
  939. fs/ubifs/super.c +6 −6
  940. fs/udf/super.c +1 −0
  941. fs/xfs/xfs_buf.c +6 −0
  942. fs/xfs/xfs_iomap.c +2 −2
  943. include/acpi/processor.h +3 −0
  944. include/asm-generic/atomic.h +0 −6
  945. include/asm-generic/cmpxchg.h +10 −0
  946. include/asm-generic/tlb.h +6 −1
  947. include/drm/drm_pciids.h +12 −1
  948. include/linux/ata.h +1 −1
  949. include/linux/blktrace_api.h +0 −1
  950. include/linux/capability.h +2 −0
  951. include/linux/compat.h +2 −2
  952. include/linux/debug_locks.h +2 −2
  953. include/linux/devfreq.h +8 −8
  954. include/linux/edac.h +2 −5
  955. include/linux/efi.h +8 −1
  956. include/linux/freezer.h +0 −3
  957. include/linux/fs_struct.h +2 −0
  958. include/linux/ftrace.h +4 −1
  959. include/linux/hash.h +2 −1
  960. include/linux/idr.h +51 −17
  961. include/linux/iio/common/st_sensors.h +6 −3
  962. include/linux/irq_work.h +1 −1
  963. include/linux/kernel.h +0 −1
  964. include/linux/kexec.h +2 −0
  965. include/linux/kvm_host.h +1 −1
  966. include/linux/kvm_types.h +1 −0
  967. include/linux/libata.h +1 −0
  968. include/linux/list.h +3 −1
  969. include/linux/mfd/max77693-private.h +23 −0
  970. include/linux/mfd/palmas.h +1 −0
  971. include/linux/mfd/tps65912.h +1 −0
  972. include/linux/mfd/wm831x/auxadc.h +2 −0
  973. include/linux/mfd/wm831x/core.h +1 −1
  974. include/linux/mm.h +2 −1
  975. include/linux/mman.h +1 −3
  976. include/linux/mmzone.h +1 −1
  977. include/linux/mount.h +2 −0
  978. include/linux/mtd/nand.h +7 −0
  979. include/linux/mxsfb.h +5 −2
  980. include/linux/netdevice.h +2 −2
  981. include/linux/netfilter/ipset/ip_set_ahash.h +23 −7
  982. include/linux/nvme.h +28 −0
  983. include/linux/pci.h +1 −0
  984. include/linux/perf_event.h +6 −0
  985. include/linux/preempt.h +14 −8
  986. include/linux/printk.h +6 −0
  987. include/linux/proc_fs.h +2 −0
  988. include/linux/res_counter.h +1 −0
  989. include/linux/sched.h +3 −2
  990. include/linux/security.h +12 −0
  991. include/linux/signal.h +2 −2
  992. include/linux/skbuff.h +16 −4
  993. include/linux/spinlock_up.h +18 −11
  994. include/linux/ssb/ssb_driver_chipcommon.h +2 −0
  995. include/linux/swiotlb.h +1 −0
  996. include/linux/thermal.h +1 −1
  997. include/linux/ucs2_string.h +14 −0
  998. include/linux/udp.h +1 −0
  999. include/linux/usb/cdc_ncm.h +1 −0
  1000. include/linux/usb/composite.h +2 −1
  1001. include/linux/usb/hcd.h +2 −0
  1002. include/linux/usb/serial.h +2 −0
  1003. include/linux/usb/ulpi.h +8 −0
  1004. include/linux/user_namespace.h +4 −0
  1005. include/net/addrconf.h +1 −0
  1006. include/net/dst.h +4 −2
  1007. include/net/flow_keys.h +1 −0
  1008. include/net/inet_frag.h +9 −0
  1009. include/net/ip_fib.h +5 −7
  1010. include/net/ip_vs.h +12 −0
  1011. include/net/ipip.h +6 −10
  1012. include/net/irda/irlmp.h +2 −1
  1013. include/net/iucv/af_iucv.h +8 −0
  1014. include/net/scm.h +2 −2
  1015. include/scsi/libfc.h +2 −1
  1016. include/sound/max98090.h +0 −0
  1017. include/sound/soc-dapm.h +1 −0
  1018. include/trace/events/block.h +4 −4
  1019. include/trace/events/sched.h +1 −1
  1020. include/uapi/linux/acct.h +4 −2
  1021. include/uapi/linux/aio_abi.h +2 −2
  1022. include/uapi/linux/fuse.h +216 −220
  1023. include/uapi/linux/packet_diag.h +3 −1
  1024. include/uapi/linux/raid/md_p.h +4 −2
  1025. include/uapi/linux/serial_core.h +4 −1
  1026. include/uapi/linux/unix_diag.h +3 −1
  1027. include/video/atmel_lcdc.h +1 −1
  1028. include/xen/interface/io/blkif.h +10 −0
  1029. include/xen/interface/physdev.h +6 −0
  1030. init/Kconfig +0 −4
  1031. ipc/mqueue.c +12 −3
  1032. ipc/msg.c +1 −0
  1033. kernel/capability.c +24 −0
  1034. kernel/events/core.c +10 −4
  1035. kernel/events/internal.h +1 −1
  1036. kernel/events/ring_buffer.c +18 −4
  1037. kernel/exit.c +1 −1
  1038. kernel/fork.c +4 −1
  1039. kernel/futex.c +23 −23
  1040. kernel/hrtimer.c +1 −2
  1041. kernel/kexec.c +105 −13
  1042. kernel/kprobes.c +13 −6
  1043. kernel/kthread.c +28 −24
  1044. kernel/lockdep.c +9 −8
  1045. kernel/pid_namespace.c +2 −1
  1046. kernel/printk.c +39 −41
  1047. kernel/sched/clock.c +26 −0
  1048. kernel/sched/core.c +5 −3
  1049. kernel/sched/cputime.c +1 −1
  1050. kernel/signal.c +5 −2
  1051. kernel/smpboot.c +12 −2
  1052. kernel/sys.c +34 −26
  1053. kernel/time/tick-broadcast.c +2 −1
  1054. kernel/trace/blktrace.c +3 −23
  1055. kernel/trace/ftrace.c +27 −31
  1056. kernel/trace/trace.c +53 −15
  1057. kernel/trace/trace.h +6 −0
  1058. kernel/trace/trace_irqsoff.c +14 −5
  1059. kernel/trace/trace_sched_wakeup.c +13 −5
  1060. kernel/trace/trace_stack.c +1 −1
  1061. kernel/user.c +2 −0
  1062. kernel/user_namespace.c +28 −9
  1063. kernel/workqueue.c +29 −22
  1064. lib/Kconfig +3 −0
  1065. lib/Makefile +2 −0
  1066. lib/bust_spinlocks.c +1 −2
  1067. lib/dma-debug.c +31 −14
  1068. lib/idr.c +30 −50
  1069. lib/kobject.c +8 −1
  1070. lib/swiotlb.c +15 −4
  1071. lib/ucs2_string.c +51 −0
  1072. lib/xz/Kconfig +1 −1
  1073. mm/Kconfig +6 −2
  1074. mm/fremap.c +5 −12
  1075. mm/hugetlb.c +17 −3
  1076. mm/memory.c +48 −0
  1077. mm/memory_hotplug.c +6 −2
  1078. mm/mlock.c +5 −6
  1079. mm/mmap.c +4 −2
  1080. mm/nommu.c +1 −1
  1081. mm/process_vm_access.c +0 −8
  1082. mm/vmscan.c +1 −1
  1083. net/802/mrp.c +4 −0
  1084. net/8021q/vlan.c +7 −7
  1085. net/atm/common.c +2 −0
  1086. net/ax25/af_ax25.c +1 −0
  1087. net/batman-adv/bat_iv_ogm.c +3 −3
  1088. net/batman-adv/main.c +4 −1
  1089. net/batman-adv/main.h +1 −1
  1090. net/batman-adv/routing.c +20 −18
  1091. net/batman-adv/translation-table.c +1 −1
  1092. net/batman-adv/vis.c +2 −2
  1093. net/bluetooth/af_bluetooth.c +2 −2
  1094. net/bluetooth/rfcomm/sock.c +1 −0
  1095. net/bluetooth/sco.c +2 −0
  1096. net/bridge/br_fdb.c +1 −1
  1097. net/bridge/br_if.c +2 −1
  1098. net/bridge/br_netlink.c +2 −0
  1099. net/bridge/br_private.h +1 −0
  1100. net/bridge/br_stp_if.c +1 −0
  1101. net/caif/caif_socket.c +2 −0
  1102. net/can/gw.c +3 −3
  1103. net/ceph/osdmap.c +29 −13
  1104. net/core/dev.c +11 −3
  1105. net/core/dev_addr_lists.c +3 −3
  1106. net/core/flow.c +1 −1
  1107. net/core/flow_dissector.c +2 −0
  1108. net/core/rtnetlink.c +6 −4
  1109. net/core/scm.c +3 −1
  1110. net/ipv4/af_inet.c +1 −2
  1111. net/ipv4/devinet.c +48 −18
  1112. net/ipv4/esp4.c +3 −3
  1113. net/ipv4/inet_fragment.c +19 −1
  1114. net/ipv4/ip_fragment.c +14 −11
  1115. net/ipv4/ip_gre.c +1 −4
  1116. net/ipv4/ip_options.c +1 −4
  1117. net/ipv4/ipconfig.c +2 −1
  1118. net/ipv4/netfilter/Kconfig +0 −13
  1119. net/ipv4/netfilter/ipt_rpfilter.c +7 −1
  1120. net/ipv4/syncookies.c +2 −2
  1121. net/ipv4/tcp.c +1 −1
  1122. net/ipv4/tcp_input.c +33 −38
  1123. net/ipv4/tcp_ipv4.c +7 −7
  1124. net/ipv4/tcp_output.c +12 −5
  1125. net/ipv4/udp.c +7 −0
  1126. net/ipv6/addrconf.c +40 −37
  1127. net/ipv6/addrconf_core.c +19 −0
  1128. net/ipv6/ip6_input.c +12 −0
  1129. net/ipv6/netfilter/ip6t_NPT.c +3 −1
  1130. net/ipv6/netfilter/ip6t_rpfilter.c +7 −1
  1131. net/ipv6/netfilter/nf_conntrack_reasm.c +6 −6
  1132. net/ipv6/reassembly.c +16 −4
  1133. net/ipv6/tcp_ipv6.c +8 −0
  1134. net/ipv6/udp.c +8 −0
  1135. net/irda/af_irda.c +6 −2
  1136. net/irda/iriap.c +2 −1
  1137. net/irda/irlmp.c +9 −1
  1138. net/iucv/af_iucv.c +18 −18
  1139. net/key/af_key.c +1 −0
  1140. net/l2tp/l2tp_core.c +101 −105
  1141. net/l2tp/l2tp_core.h +12 −10
  1142. net/l2tp/l2tp_debugfs.c +14 −14
  1143. net/l2tp/l2tp_ip.c +6 −0
  1144. net/l2tp/l2tp_ip6.c +8 −0
  1145. net/l2tp/l2tp_netlink.c +28 −44
  1146. net/l2tp/l2tp_ppp.c +36 −75
  1147. net/llc/af_llc.c +2 −0
  1148. net/mac80211/cfg.c +4 −2
  1149. net/mac80211/chan.c +14 −3
  1150. net/mac80211/ieee80211_i.h +3 −1
  1151. net/mac80211/iface.c +38 −24
  1152. net/mac80211/mesh.c +2 −1
  1153. net/mac80211/mlme.c +24 −6
  1154. net/mac80211/offchannel.c +17 −6
  1155. net/mac80211/rx.c +13 −1
  1156. net/mac80211/sta_info.c +10 −2
  1157. net/netfilter/ipset/ip_set_bitmap_ipmac.c +5 −1
  1158. net/netfilter/ipset/ip_set_hash_ipportnet.c +18 −0
  1159. net/netfilter/ipset/ip_set_hash_net.c +20 −2
  1160. net/netfilter/ipset/ip_set_hash_netiface.c +20 −2
  1161. net/netfilter/ipset/ip_set_hash_netport.c +18 −0
  1162. net/netfilter/ipset/ip_set_list_set.c +7 −3
  1163. net/netfilter/ipvs/ip_vs_core.c +8 −6
  1164. net/netfilter/ipvs/ip_vs_ctl.c +7 −0
  1165. net/netfilter/ipvs/ip_vs_proto_sctp.c +9 −7
  1166. net/netfilter/nf_conntrack_proto_dccp.c +6 −6
  1167. net/netfilter/nf_conntrack_proto_gre.c +6 −6
  1168. net/netfilter/nf_conntrack_proto_sctp.c +6 −6
  1169. net/netfilter/nf_conntrack_proto_udplite.c +6 −6
  1170. net/netfilter/nf_conntrack_sip.c +2 −4
  1171. net/netfilter/nf_conntrack_standalone.c +1 −0
  1172. net/netfilter/nf_nat_core.c +7 −33
  1173. net/netfilter/nfnetlink_acct.c +2 −0
  1174. net/netfilter/nfnetlink_queue_core.c +4 −2
  1175. net/netlink/genetlink.c +1 −0
  1176. net/netrom/af_netrom.c +1 −0
  1177. net/nfc/llcp/llcp.c +51 −15
  1178. net/nfc/llcp/sock.c +8 −3
  1179. net/openvswitch/actions.c +2 −2
  1180. net/openvswitch/datapath.c +21 −12
  1181. net/openvswitch/flow.c +6 −2
  1182. net/openvswitch/vport-netdev.c +1 −2
  1183. net/openvswitch/vport.c +1 −2
  1184. net/rose/af_rose.c +1 −0
  1185. net/sched/cls_fw.c +1 −1
  1186. net/sched/sch_cbq.c +4 −1
  1187. net/sched/sch_fq_codel.c +1 −1
  1188. net/sched/sch_generic.c +1 −1
  1189. net/sctp/associola.c +1 −1
  1190. net/sctp/sm_statefuns.c +1 −1
  1191. net/sunrpc/auth_gss/svcauth_gss.c +8 −4
  1192. net/sunrpc/clnt.c +3 −8
  1193. net/sunrpc/rpc_pipe.c +1 −0
  1194. net/sunrpc/sched.c +7 −2
  1195. net/sunrpc/xprtsock.c +10 −5
  1196. net/tipc/socket.c +7 −0
  1197. net/unix/af_unix.c +4 −5
  1198. net/vmw_vsock/af_vsock.c +5 −3
  1199. net/vmw_vsock/vmci_transport.c +22 −12
  1200. net/vmw_vsock/vsock_addr.c +0 −10
  1201. net/vmw_vsock/vsock_addr.h +0 −2
  1202. net/wireless/core.c +47 −17
  1203. net/wireless/core.h +3 −0
  1204. net/wireless/nl80211.c +27 −25
  1205. net/wireless/scan.c +16 −8
  1206. net/wireless/sme.c +6 −2
  1207. net/wireless/trace.h +3 −2
  1208. net/wireless/wext-sme.c +6 −0
  1209. net/xfrm/xfrm_replay.c +65 −1
  1210. scripts/Makefile.headersinst +6 −5
  1211. scripts/checkpatch.pl +1 −0
  1212. security/capability.c +6 −0
  1213. security/keys/compat.c +2 −2
  1214. security/keys/process_keys.c +1 −1
  1215. security/security.c +5 −0
  1216. security/selinux/hooks.c +7 −0
  1217. security/selinux/xfrm.c +1 −1
  1218. security/yama/yama_lsm.c +1 −3
  1219. sound/core/pcm_native.c +2 −10
  1220. sound/core/seq/seq_timer.c +4 −4
  1221. sound/oss/sequencer.c +6 −0
  1222. sound/pci/asihpi/asihpi.c +2 −1
  1223. sound/pci/hda/hda_codec.c +16 −12
  1224. sound/pci/hda/hda_eld.c +1 −1
  1225. sound/pci/hda/hda_generic.c +47 −1
  1226. sound/pci/hda/hda_intel.c +111 −27
  1227. sound/pci/hda/patch_ca0132.c +15 −13
  1228. sound/pci/hda/patch_cirrus.c +6 −2
  1229. sound/pci/hda/patch_conexant.c +11 −5
  1230. sound/pci/hda/patch_hdmi.c +1 −1
  1231. sound/pci/hda/patch_realtek.c +3 −1
  1232. sound/pci/hda/patch_sigmatel.c +29 −0
  1233. sound/soc/codecs/max98090.c +0 −0
  1234. sound/soc/codecs/max98090.h +0 −0
  1235. sound/soc/codecs/si476x.c +1 −0
  1236. sound/soc/codecs/wm5102.c +1 −1
  1237. sound/soc/codecs/wm8903.c +2 −0
  1238. sound/soc/codecs/wm_adsp.c +3 −2
  1239. sound/soc/fsl/imx-ssi.c +5 −0
  1240. sound/soc/fsl/pcm030-audio-fabric.c +1 −1
  1241. sound/soc/samsung/i2s.c +12 −5
  1242. sound/soc/sh/dma-sh7760.c +2 −2
  1243. sound/soc/soc-compress.c +11 −3
  1244. sound/soc/soc-core.c +5 −5
  1245. sound/soc/soc-dapm.c +14 −0
  1246. sound/soc/spear/spear_pcm.c +6 −6
  1247. sound/soc/tegra/tegra_pcm.c +1 −23
  1248. sound/usb/card.c +15 −0
  1249. sound/usb/clock.c +35 −10
  1250. sound/usb/mixer.c +13 −8
  1251. sound/usb/mixer_quirks.c +2 −2
  1252. sound/usb/quirks.c +1 −1
  1253. tools/lib/traceevent/Makefile +1 −1
  1254. tools/perf/Makefile +7 −1
  1255. tools/perf/bench/bench.h +24 −0
  1256. tools/perf/builtin-record.c +4 −2
  1257. tools/perf/util/hist.h +3 −2
  1258. tools/perf/util/strlist.c +1 −1
  1259. tools/power/x86/turbostat/turbostat.c +4 −1
  1260. tools/usb/ffs-test.c +1 −1
  1261. virt/kvm/ioapic.c +5 −2
  1262. virt/kvm/kvm_main.c +37 −10
CREDITS+8−0
@@ -1510,6 +1510,14 @@ D: Natsemi ethernet · 1509 unmodified lines
15101510 D: Cobalt Networks (x86) support
15111511 D: This-and-That
15121512
1513+N: Mark M. Hoffman
1514+E: mhoffman@lightlink.com
1515+D: asb100, lm93 and smsc47b397 hardware monitoring drivers
1516+D: hwmon subsystem core
1517+D: hwmon subsystem maintainer
1518+D: i2c-sis96x and i2c-stub SMBus drivers
1519+S: USA
1520+
15131521 N: Dirk Hohndel
15141522 E: hohndel@suse.de
15151523 D: The XFree86[tm] Project
Documentation/DocBook/device-drivers.tmpl+1−1
@@ -227,7 +227,7 @@ X!Isound/sound_firmware.c · 226 unmodified lines
227227 <chapter id="uart16x50">
228228 <title>16x50 UART Driver</title>
229229 !Edrivers/tty/serial/serial_core.c
230−!Edrivers/tty/serial/8250/8250.c
230+!Edrivers/tty/serial/8250/8250_core.c
231231 </chapter>
232232
233233 <chapter id="fbdev">
Documentation/devicetree/bindings/mfd/ab8500.txt+1−5
@@ -13,9 +13,6 @@ Required parent device properties: · 12 unmodified lines
1313 4 = active high level-sensitive
1414 8 = active low level-sensitive
1515
16−Optional parent device properties:
17−- reg : contains the PRCMU mailbox address for the AB8500 i2c port
18−
1916 The AB8500 consists of a large and varied group of sub-devices:
2017
2118 Device IRQ Names Supply Names Description
@@ -86,9 +83,8 @@ Non-standard child device properties: · 64 unmodified lines
8683 - stericsson,amic2-bias-vamic1 : Analoge Mic wishes to use a non-standard Vamic
8784 - stericsson,earpeice-cmv : Earpeice voltage (only: 950 | 1100 | 1270 | 1580)
8885
89−ab8500@5 {
86+ab8500 {
9087 compatible = "stericsson,ab8500";
91− reg = <5>; /* mailbox 5 is i2c */
9288 interrupts = <0 40 0x4>;
9389 interrupt-controller;
9490 #interrupt-cells = <2>;
Documentation/devicetree/bindings/tty/serial/of-serial.txt+3−0
@@ -11,6 +11,9 @@ Required properties: · 10 unmodified lines
1111 - "nvidia,tegra20-uart"
1212 - "nxp,lpc3220-uart"
1313 - "ibm,qpace-nwp-serial"
14+ - "altr,16550-FIFO32"
15+ - "altr,16550-FIFO64"
16+ - "altr,16550-FIFO128"
1417 - "serial" if the port type is unknown.
1518 - reg : offset and length of the register set for the device.
1619 - interrupts : should contain uart interrupt.
Documentation/hwmon/lm75+1−1
@@ -23,7 +23,7 @@ Supported chips: · 22 unmodified lines
2323 Datasheet: Publicly available at the Maxim website
2424 http://www.maxim-ic.com/
2525 * Microchip (TelCom) TCN75
26− Prefix: 'lm75'
26+ Prefix: 'tcn75'
2727 Addresses scanned: none
2828 Datasheet: Publicly available at the Microchip website
2929 http://www.microchip.com/
Documentation/i2c/busses/i2c-diolan-u2c+1−1
@@ -5,7 +5,7 @@ Supported adapters: · 4 unmodified lines
55 Documentation:
66 http://www.diolan.com/i2c/u2c12.html
77
8−Author: Guenter Roeck <guenter.roeck@ericsson.com>
8+Author: Guenter Roeck <linux@roeck-us.net>
99
1010 Description
1111 -----------
Documentation/kernel-parameters.txt+26−3
@@ -596,9 +596,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. · 595 unmodified lines
596596 is selected automatically. Check
597597 Documentation/kdump/kdump.txt for further details.
598598
599− crashkernel_low=size[KMG]
600− [KNL, x86] parts under 4G.
601−
602599 crashkernel=range1:size1[,range2:size2,...][@offset]
603600 [KNL] Same as above, but depends on the memory
604601 in the running system. The syntax of range is
@@ -606,6 +603,26 @@ bytes respectively. Such letter suffixes can also be entirely omitted. · 1 unmodified line
606603 a memory unit (amount[KMG]). See also
607604 Documentation/kdump/kdump.txt for an example.
608605
606+ crashkernel=size[KMG],high
607+ [KNL, x86_64] range could be above 4G. Allow kernel
608+ to allocate physical memory region from top, so could
609+ be above 4G if system have more than 4G ram installed.
610+ Otherwise memory region will be allocated below 4G, if
611+ available.
612+ It will be ignored if crashkernel=X is specified.
613+ crashkernel=size[KMG],low
614+ [KNL, x86_64] range under 4G. When crashkernel=X,high
615+ is passed, kernel could allocate physical memory region
616+ above 4G, that cause second kernel crash on system
617+ that require some amount of low memory, e.g. swiotlb
618+ requires at least 64M+32K low memory. Kernel would
619+ try to allocate 72M below 4G automatically.
620+ This one let user to specify own low range under 4G
621+ for second kernel instead.
622+ 0: to disable low allocation.
623+ It will be ignored when crashkernel=X,high is not used
624+ or memory reserved is below 4G.
625+
609626 cs89x0_dma= [HW,NET]
610627 Format: <dma>
611628
@@ -788,6 +805,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted. · 176 unmodified lines
788805 edd= [EDD]
789806 Format: {"off" | "on" | "skip[mbr]"}
790807
808+ efi_no_storage_paranoia [EFI; X86]
809+ Using this parameter you can use more than 50% of
810+ your efi variable storage. Use this parameter only if
811+ you are really sure that your UEFI does sane gc and
812+ fulfills the spec otherwise your board may brick.
813+
791814 eisa_irq_edge= [PARISC,HW]
792815 See header of drivers/parisc/eisa.c.
793816
Documentation/networking/ipvs-sysctl.txt+7−0
@@ -15,6 +15,13 @@ amemthresh - INTEGER · 14 unmodified lines
1515 enabled and the variable is automatically set to 2, otherwise
1616 the strategy is disabled and the variable is set to 1.
1717
18+backup_only - BOOLEAN
19+ 0 - disabled (default)
20+ not 0 - enabled
21+
22+ If set, disable the director function while the server is
23+ in backup mode to avoid packet loops for DR/TUN methods.
24+
1825 conntrack - BOOLEAN
1926 0 - disabled (default)
2027 not 0 - enabled
Documentation/scsi/LICENSE.qla2xxx+1−1
@@ -1,4 +1,4 @@
1−Copyright (c) 2003-2012 QLogic Corporation
1+Copyright (c) 2003-2013 QLogic Corporation
22 QLogic Linux FC-FCoE Driver
33
44 This program includes a device driver for Linux 3.x.
Documentation/sound/alsa/ALSA-Configuration.txt+3−4
@@ -890,9 +890,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. · 889 unmodified lines
890890 enable_msi - Enable Message Signaled Interrupt (MSI) (default = off)
891891 power_save - Automatic power-saving timeout (in second, 0 =
892892 disable)
893− power_save_controller - Support runtime D3 of HD-audio controller
894− (-1 = on for supported chip (default), false = off,
895− true = force to on even for unsupported hardware)
893+ power_save_controller - Reset HD-audio controller in power-saving mode
894+ (default = on)
896895 align_buffer_size - Force rounding of buffer/period sizes to multiples
897896 of 128 bytes. This is more efficient in terms of memory
898897 access but isn't required by the HDA spec and prevents
@@ -912,7 +911,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. · 13 unmodified lines
912911 models depending on the codec chip. The list of available models
913912 is found in HD-Audio-Models.txt
914913
915− The model name "genric" is treated as a special case. When this
914+ The model name "generic" is treated as a special case. When this
916915 model is given, the driver uses the generic codec parser without
917916 "codec-patch". It's sometimes good for testing and debugging.
918917
Documentation/sound/alsa/seq_oss.html+1−1
@@ -285,7 +285,7 @@ sample data. · 284 unmodified lines
285285 <H4>
286286 7.2.4 Close Callback</H4>
287287 The <TT>close</TT> callback is called when this device is closed by the
288−applicaion. If any private data was allocated in open callback, it must
288+application. If any private data was allocated in open callback, it must
289289 be released in the close callback. The deletion of ALSA port should be
290290 done here, too. This callback must not be NULL.
291291 <H4>
MAINTAINERS+66−34
@@ -1338,12 +1338,6 @@ S: Maintained · 1337 unmodified lines
13381338 F: drivers/platform/x86/asus*.c
13391339 F: drivers/platform/x86/eeepc*.c
13401340
1341−ASUS ASB100 HARDWARE MONITOR DRIVER
1342−M: "Mark M. Hoffman" <mhoffman@lightlink.com>
1343−L: lm-sensors@lm-sensors.org
1344−S: Maintained
1345−F: drivers/hwmon/asb100.c
1346−
13471341 ASYNCHRONOUS TRANSFERS/TRANSFORMS (IOAT) API
13481342 M: Dan Williams <djbw@fb.com>
13491343 W: http://sourceforge.net/projects/xscaleiop
@@ -1467,6 +1461,12 @@ F: drivers/dma/at_hdmac.c · 117 unmodified lines
14671461 F: drivers/dma/at_hdmac_regs.h
14681462 F: include/linux/platform_data/dma-atmel.h
14691463
1464+ATMEL I2C DRIVER
1465+M: Ludovic Desroches <ludovic.desroches@atmel.com>
1466+L: linux-i2c@vger.kernel.org
1467+S: Supported
1468+F: drivers/i2c/busses/i2c-at91.c
1469+
14701470 ATMEL ISI DRIVER
14711471 M: Josh Wu <josh.wu@atmel.com>
14721472 L: linux-media@vger.kernel.org
@@ -2629,7 +2629,7 @@ F: include/uapi/drm/ · 1156 unmodified lines
26292629
26302630 INTEL DRM DRIVERS (excluding Poulsbo, Moorestown and derivative chipsets)
26312631 M: Daniel Vetter <daniel.vetter@ffwll.ch>
2632−L: intel-gfx@lists.freedesktop.org (subscribers-only)
2632+L: intel-gfx@lists.freedesktop.org
26332633 L: dri-devel@lists.freedesktop.org
26342634 T: git git://people.freedesktop.org/~danvet/drm-intel
26352635 S: Supported
@@ -3242,6 +3242,12 @@ F: Documentation/firmware_class/ · 606 unmodified lines
32423242 F: drivers/base/firmware*.c
32433243 F: include/linux/firmware.h
32443244
3245+FLASHSYSTEM DRIVER (IBM FlashSystem 70/80 PCI SSD Flash Card)
3246+M: Joshua Morris <josh.h.morris@us.ibm.com>
3247+M: Philip Kelleher <pjk1939@linux.vnet.ibm.com>
3248+S: Maintained
3249+F: drivers/block/rsxx/
3250+
32453251 FLOPPY DRIVER
32463252 M: Jiri Kosina <jkosina@suse.cz>
32473253 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/floppy.git
@@ -3851,7 +3857,7 @@ F: drivers/i2c/busses/i2c-ismt.c · 603 unmodified lines
38513857 F: Documentation/i2c/busses/i2c-ismt
38523858
38533859 I2C/SMBUS STUB DRIVER
3854−M: "Mark M. Hoffman" <mhoffman@lightlink.com>
3860+M: Jean Delvare <khali@linux-fr.org>
38553861 L: linux-i2c@vger.kernel.org
38563862 S: Maintained
38573863 F: drivers/i2c/i2c-stub.c
@@ -4005,6 +4011,22 @@ M: Stanislaw Gruszka <stf_xl@wp.pl> · 147 unmodified lines
40054011 S: Maintained
40064012 F: drivers/usb/atm/ueagle-atm.c
40074013
4014+INA209 HARDWARE MONITOR DRIVER
4015+M: Guenter Roeck <linux@roeck-us.net>
4016+L: lm-sensors@lm-sensors.org
4017+S: Maintained
4018+F: Documentation/hwmon/ina209
4019+F: Documentation/devicetree/bindings/i2c/ina209.txt
4020+F: drivers/hwmon/ina209.c
4021+
4022+INA2XX HARDWARE MONITOR DRIVER
4023+M: Guenter Roeck <linux@roeck-us.net>
4024+L: lm-sensors@lm-sensors.org
4025+S: Maintained
4026+F: Documentation/hwmon/ina2xx
4027+F: drivers/hwmon/ina2xx.c
4028+F: include/linux/platform_data/ina2xx.h
4029+
40084030 INDUSTRY PACK SUBSYSTEM (IPACK)
40094031 M: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
40104032 M: Jens Taprogge <jens.taprogge@taprogge.org>
@@ -4919,6 +4941,12 @@ W: logfs.org · 908 unmodified lines
49194941 S: Maintained
49204942 F: fs/logfs/
49214943
4944+LPC32XX MACHINE SUPPORT
4945+M: Roland Stigge <stigge@antcom.de>
4946+L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
4947+S: Maintained
4948+F: arch/arm/mach-lpc32xx/
4949+
49224950 LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)
49234951 M: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>
49244952 M: Sreekanth Reddy <Sreekanth.Reddy@lsi.com>
@@ -5043,9 +5071,8 @@ S: Maintained · 118 unmodified lines
50435071 F: drivers/net/ethernet/marvell/sk*
50445072
50455073 MARVELL LIBERTAS WIRELESS DRIVER
5046−M: Dan Williams <dcbw@redhat.com>
50475074 L: libertas-dev@lists.infradead.org
5048−S: Maintained
5075+S: Orphan
50495076 F: drivers/net/wireless/libertas/
50505077
50515078 MARVELL MV643XX ETHERNET DRIVER
@@ -5098,6 +5125,15 @@ S: Maintained · 46 unmodified lines
50985125 F: Documentation/hwmon/max6650
50995126 F: drivers/hwmon/max6650.c
51005127
5128+MAX6697 HARDWARE MONITOR DRIVER
5129+M: Guenter Roeck <linux@roeck-us.net>
5130+L: lm-sensors@lm-sensors.org
5131+S: Maintained
5132+F: Documentation/hwmon/max6697
5133+F: Documentation/devicetree/bindings/i2c/max6697.txt
5134+F: drivers/hwmon/max6697.c
5135+F: include/linux/platform_data/max6697.h
5136+
51015137 MAXIRADIO FM RADIO RECEIVER DRIVER
51025138 M: Hans Verkuil <hverkuil@xs4all.nl>
51035139 L: linux-media@vger.kernel.org
@@ -5538,6 +5574,7 @@ F: include/uapi/linux/if_* · 434 unmodified lines
55385574 F: include/uapi/linux/netdevice.h
55395575
55405576 NETXEN (1/10) GbE SUPPORT
5577+M: Manish Chopra <manish.chopra@qlogic.com>
55415578 M: Sony Chacko <sony.chacko@qlogic.com>
55425579 M: Rajesh Borundia <rajesh.borundia@qlogic.com>
55435580 L: netdev@vger.kernel.org
@@ -5622,6 +5659,14 @@ S: Maintained · 78 unmodified lines
56225659 F: drivers/video/riva/
56235660 F: drivers/video/nvidia/
56245661
5662+NVM EXPRESS DRIVER
5663+M: Matthew Wilcox <willy@linux.intel.com>
5664+L: linux-nvme@lists.infradead.org
5665+T: git git://git.infradead.org/users/willy/linux-nvme.git
5666+S: Supported
5667+F: drivers/block/nvme.c
5668+F: include/linux/nvme.h
5669+
56255670 OMAP SUPPORT
56265671 M: Tony Lindgren <tony@atomide.com>
56275672 L: linux-omap@vger.kernel.org
@@ -5650,7 +5695,7 @@ S: Maintained · 22 unmodified lines
56505695 F: arch/arm/*omap*/*clock*
56515696
56525697 OMAP POWER MANAGEMENT SUPPORT
5653−M: Kevin Hilman <khilman@ti.com>
5698+M: Kevin Hilman <khilman@deeprootsystems.com>
56545699 L: linux-omap@vger.kernel.org
56555700 S: Maintained
56565701 F: arch/arm/*omap*/*pm*
@@ -5744,7 +5789,7 @@ F: arch/arm/*omap*/usb* · 87 unmodified lines
57445789
57455790 OMAP GPIO DRIVER
57465791 M: Santosh Shilimkar <santosh.shilimkar@ti.com>
5747−M: Kevin Hilman <khilman@ti.com>
5792+M: Kevin Hilman <khilman@deeprootsystems.com>
57485793 L: linux-omap@vger.kernel.org
57495794 S: Maintained
57505795 F: drivers/gpio/gpio-omap.c
@@ -6176,7 +6221,7 @@ F: include/linux/power_supply.h · 425 unmodified lines
61766221 F: drivers/power/
61776222
61786223 PNP SUPPORT
6179−M: Adam Belay <abelay@mit.edu>
6224+M: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
61806225 M: Bjorn Helgaas <bhelgaas@google.com>
61816226 S: Maintained
61826227 F: drivers/pnp/
@@ -6518,12 +6563,6 @@ S: Maintained · 335 unmodified lines
65186563 F: Documentation/blockdev/ramdisk.txt
65196564 F: drivers/block/brd.c
65206565
6521−RAMSAM DRIVER (IBM RamSan 70/80 PCI SSD Flash Card)
6522−M: Joshua Morris <josh.h.morris@us.ibm.com>
6523−M: Philip Kelleher <pjk1939@linux.vnet.ibm.com>
6524−S: Maintained
6525−F: drivers/block/rsxx/
6526−
65276566 RANDOM NUMBER DRIVER
65286567 M: Theodore Ts'o" <tytso@mit.edu>
65296568 S: Maintained
@@ -6592,7 +6631,7 @@ S: Supported · 62 unmodified lines
65926631 F: fs/reiserfs/
65936632
65946633 REGISTER MAP ABSTRACTION
6595−M: Mark Brown <broonie@opensource.wolfsonmicro.com>
6634+M: Mark Brown <broonie@kernel.org>
65966635 T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git
65976636 S: Supported
65986637 F: drivers/base/regmap/
@@ -6918,7 +6957,6 @@ F: drivers/scsi/st* · 319 unmodified lines
69186957
69196958 SCTP PROTOCOL
69206959 M: Vlad Yasevich <vyasevich@gmail.com>
6921−M: Sridhar Samudrala <sri@us.ibm.com>
69226960 M: Neil Horman <nhorman@tuxdriver.com>
69236961 L: linux-sctp@vger.kernel.org
69246962 W: http://lksctp.sourceforge.net
@@ -7140,7 +7178,7 @@ F: arch/arm/mach-s3c2410/bast-irq.c · 215 unmodified lines
71407178
71417179 TI DAVINCI MACHINE SUPPORT
71427180 M: Sekhar Nori <nsekhar@ti.com>
7143−M: Kevin Hilman <khilman@ti.com>
7181+M: Kevin Hilman <khilman@deeprootsystems.com>
71447182 L: davinci-linux-open-source@linux.davincidsp.com (moderated for non-subscribers)
71457183 T: git git://gitorious.org/linux-davinci/linux-davinci.git
71467184 Q: http://patchwork.kernel.org/project/linux-davinci/list/
@@ -7173,13 +7211,6 @@ L: netdev@vger.kernel.org · 26 unmodified lines
71737211 S: Maintained
71747212 F: drivers/net/ethernet/sis/sis900.*
71757213
7176−SIS 96X I2C/SMBUS DRIVER
7177−M: "Mark M. Hoffman" <mhoffman@lightlink.com>
7178−L: linux-i2c@vger.kernel.org
7179−S: Maintained
7180−F: Documentation/i2c/busses/i2c-sis96x
7181−F: drivers/i2c/busses/i2c-sis96x.c
7182−
71837214 SIS FRAMEBUFFER DRIVER
71847215 M: Thomas Winischhofer <thomas@winischhofer.net>
71857216 W: http://www.winischhofer.net/linuxsisvga.shtml
@@ -7257,7 +7288,7 @@ F: Documentation/hwmon/sch5627 · 71 unmodified lines
72577288 F: drivers/hwmon/sch5627.c
72587289
72597290 SMSC47B397 HARDWARE MONITOR DRIVER
7260−M: "Mark M. Hoffman" <mhoffman@lightlink.com>
7291+M: Jean Delvare <khali@linux-fr.org>
72617292 L: lm-sensors@lm-sensors.org
72627293 S: Maintained
72637294 F: Documentation/hwmon/smsc47b397
@@ -7348,7 +7379,7 @@ F: sound/ · 84 unmodified lines
73487379
73497380 SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
73507381 M: Liam Girdwood <lgirdwood@gmail.com>
7351−M: Mark Brown <broonie@opensource.wolfsonmicro.com>
7382+M: Mark Brown <broonie@kernel.org>
73527383 T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
73537384 L: alsa-devel@alsa-project.org (moderated for non-subscribers)
73547385 W: http://alsa-project.org/main/index.php/ASoC
@@ -7437,7 +7468,7 @@ F: drivers/clk/spear/ · 82 unmodified lines
74377468
74387469 SPI SUBSYSTEM
74397470 M: Grant Likely <grant.likely@secretlab.ca>
7440−M: Mark Brown <broonie@opensource.wolfsonmicro.com>
7471+M: Mark Brown <broonie@kernel.org>
74417472 L: spi-devel-general@lists.sourceforge.net
74427473 Q: http://patchwork.kernel.org/project/spi-devel-general/list/
74437474 T: git git://git.secretlab.ca/git/linux-2.6.git
@@ -7680,9 +7711,10 @@ F: include/linux/swiotlb.h · 236 unmodified lines
76807711
76817712 SYNOPSYS ARC ARCHITECTURE
76827713 M: Vineet Gupta <vgupta@synopsys.com>
7683−L: linux-snps-arc@vger.kernel.org
76847714 S: Supported
76857715 F: arch/arc/
7716+F: Documentation/devicetree/bindings/arc/
7717+F: drivers/tty/serial/arc-uart.c
76867718
76877719 SYSV FILESYSTEM
76887720 M: Christoph Hellwig <hch@infradead.org>
@@ -8681,7 +8713,7 @@ F: drivers/scsi/vmw_pvscsi.h · 992 unmodified lines
86818713
86828714 VOLTAGE AND CURRENT REGULATOR FRAMEWORK
86838715 M: Liam Girdwood <lrg@ti.com>
8684−M: Mark Brown <broonie@opensource.wolfsonmicro.com>
8716+M: Mark Brown <broonie@kernel.org>
86858717 W: http://opensource.wolfsonmicro.com/node/15
86868718 W: http://www.slimlogic.co.uk/?p=48
86878719 T: git git://git.kernel.org/pub/scm/linux/kernel/git/lrg/regulator.git
Makefile+3−2
@@ -1,7 +1,7 @@
11 VERSION = 3
22 PATCHLEVEL = 9
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc2
4+EXTRAVERSION = -rc8
55 NAME = Unicycling Gorilla
66
77 # *DOCUMENTATION*
@@ -513,7 +513,8 @@ ifeq ($(KBUILD_EXTMOD),) · 505 unmodified lines
513513 # Carefully list dependencies so we do not try to build scripts twice
514514 # in parallel
515515 PHONY += scripts
516−scripts: scripts_basic include/config/auto.conf include/config/tristate.conf
516+scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \
517+ asm-generic
517518 $(Q)$(MAKE) $(build)=$(@)
518519
519520 # Objects we will link into vmlinux / subdirs we need to visit
arch/Kconfig+0−7
@@ -319,13 +319,6 @@ config ARCH_WANT_OLD_COMPAT_IPC · 318 unmodified lines
319319 select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
320320 bool
321321
322−config HAVE_VIRT_TO_BUS
323− bool
324− help
325− An architecture should select this if it implements the
326− deprecated interface virt_to_bus(). All new architectures
327− should probably not select this.
328−
329322 config HAVE_ARCH_SECCOMP_FILTER
330323 bool
331324 help
arch/alpha/Kconfig+1−1
@@ -9,7 +9,7 @@ config ALPHA · 8 unmodified lines
99 select HAVE_PERF_EVENTS
1010 select HAVE_DMA_ATTRS
1111 select HAVE_GENERIC_HARDIRQS
12− select HAVE_VIRT_TO_BUS
12+ select VIRT_TO_BUS
1313 select GENERIC_IRQ_PROBE
1414 select AUTO_IRQ_AFFINITY if SMP
1515 select GENERIC_IRQ_SHOW
arch/alpha/Makefile+1−1
@@ -12,7 +12,7 @@ NM := $(NM) -B · 11 unmodified lines
1212
1313 LDFLAGS_vmlinux := -static -N #-relax
1414 CHECKFLAGS += -D__alpha__ -m64
15−cflags-y := -pipe -mno-fp-regs -ffixed-8 -msmall-data
15+cflags-y := -pipe -mno-fp-regs -ffixed-8
1616 cflags-y += $(call cc-option, -fno-jump-tables)
1717
1818 cpuflags-$(CONFIG_ALPHA_EV4) := -mcpu=ev4
arch/alpha/include/asm/floppy.h+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 #define fd_disable_irq() disable_irq(FLOPPY_IRQ)
2727 #define fd_cacheflush(addr,size) /* nothing */
2828 #define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt,\
29− IRQF_DISABLED, "floppy", NULL)
29+ 0, "floppy", NULL)
3030 #define fd_free_irq() free_irq(FLOPPY_IRQ, NULL)
3131
3232 #ifdef CONFIG_PCI
arch/alpha/kernel/irq.c+0−7
@@ -117,13 +117,6 @@ handle_irq(int irq) · 116 unmodified lines
117117 return;
118118 }
119119
120− /*
121− * From here we must proceed with IPL_MAX. Note that we do not
122− * explicitly enable interrupts afterwards - some MILO PALcode
123− * (namely LX164 one) seems to have severe problems with RTI
124− * at IPL 0.
125− */
126− local_irq_disable();
127120 irq_enter();
128121 generic_handle_irq_desc(irq, desc);
129122 irq_exit();
arch/alpha/kernel/irq_alpha.c+8−2
@@ -45,6 +45,14 @@ do_entInt(unsigned long type, unsigned long vector, · 44 unmodified lines
4545 unsigned long la_ptr, struct pt_regs *regs)
4646 {
4747 struct pt_regs *old_regs;
48+
49+ /*
50+ * Disable interrupts during IRQ handling.
51+ * Note that there is no matching local_irq_enable() due to
52+ * severe problems with RTI at IPL0 and some MILO PALcode
53+ * (namely LX164).
54+ */
55+ local_irq_disable();
4856 switch (type) {
4957 case 0:
5058 #ifdef CONFIG_SMP
@@ -62,7 +70,6 @@ do_entInt(unsigned long type, unsigned long vector, · 11 unmodified lines
6270 {
6371 long cpu;
6472
65− local_irq_disable();
6673 smp_percpu_timer_interrupt(regs);
6774 cpu = smp_processor_id();
6875 if (cpu != boot_cpuid) {
@@ -222,7 +229,6 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr, · 153 unmodified lines
222229
223230 struct irqaction timer_irqaction = {
224231 .handler = timer_interrupt,
225− .flags = IRQF_DISABLED,
226232 .name = "timer",
227233 };
228234
arch/alpha/kernel/sys_nautilus.c+5−0
@@ -188,6 +188,10 @@ nautilus_machine_check(unsigned long vector, unsigned long la_ptr) · 187 unmodified lines
188188 extern void free_reserved_mem(void *, void *);
189189 extern void pcibios_claim_one_bus(struct pci_bus *);
190190
191+static struct resource irongate_io = {
192+ .name = "Irongate PCI IO",
193+ .flags = IORESOURCE_IO,
194+};
191195 static struct resource irongate_mem = {
192196 .name = "Irongate PCI MEM",
193197 .flags = IORESOURCE_MEM,
@@ -209,6 +213,7 @@ nautilus_init_pci(void) · 15 unmodified lines
209213
210214 irongate = pci_get_bus_and_slot(0, 0);
211215 bus->self = irongate;
216+ bus->resource[0] = &irongate_io;
212217 bus->resource[1] = &irongate_mem;
213218
214219 pci_bus_size_bridges(bus);
arch/alpha/kernel/sys_titan.c+7−7
@@ -280,15 +280,15 @@ titan_late_init(void) · 279 unmodified lines
280280 * all reported to the kernel as machine checks, so the handler
281281 * is a nop so it can be called to count the individual events.
282282 */
283− titan_request_irq(63+16, titan_intr_nop, IRQF_DISABLED,
283+ titan_request_irq(63+16, titan_intr_nop, 0,
284284 "CChip Error", NULL);
285− titan_request_irq(62+16, titan_intr_nop, IRQF_DISABLED,
285+ titan_request_irq(62+16, titan_intr_nop, 0,
286286 "PChip 0 H_Error", NULL);
287− titan_request_irq(61+16, titan_intr_nop, IRQF_DISABLED,
287+ titan_request_irq(61+16, titan_intr_nop, 0,
288288 "PChip 1 H_Error", NULL);
289− titan_request_irq(60+16, titan_intr_nop, IRQF_DISABLED,
289+ titan_request_irq(60+16, titan_intr_nop, 0,
290290 "PChip 0 C_Error", NULL);
291− titan_request_irq(59+16, titan_intr_nop, IRQF_DISABLED,
291+ titan_request_irq(59+16, titan_intr_nop, 0,
292292 "PChip 1 C_Error", NULL);
293293
294294 /*
@@ -348,9 +348,9 @@ privateer_init_pci(void) · 53 unmodified lines
348348 * Hook a couple of extra err interrupts that the
349349 * common titan code won't.
350350 */
351− titan_request_irq(53+16, titan_intr_nop, IRQF_DISABLED,
351+ titan_request_irq(53+16, titan_intr_nop, 0,
352352 "NMI", NULL);
353− titan_request_irq(50+16, titan_intr_nop, IRQF_DISABLED,
353+ titan_request_irq(50+16, titan_intr_nop, 0,
354354 "Temperature Warning", NULL);
355355
356356 /*
arch/arc/include/asm/dma-mapping.h+1−1
@@ -126,7 +126,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, · 125 unmodified lines
126126 int i;
127127
128128 for_each_sg(sg, s, nents, i)
129− sg->dma_address = dma_map_page(dev, sg_page(s), s->offset,
129+ s->dma_address = dma_map_page(dev, sg_page(s), s->offset,
130130 s->length, dir);
131131
132132 return nents;
arch/arc/include/asm/elf.h+0−3
@@ -72,7 +72,4 @@ extern int elf_check_arch(const struct elf32_hdr *); · 71 unmodified lines
7272 */
7373 #define ELF_PLATFORM (NULL)
7474
75−#define SET_PERSONALITY(ex) \
76− set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
77−
7875 #endif
arch/arc/include/asm/entry.h+1−1
@@ -415,7 +415,7 @@ · 414 unmodified lines
415415 *-------------------------------------------------------------*/
416416 .macro SAVE_ALL_EXCEPTION marker
417417
418− st \marker, [sp, 8]
418+ st \marker, [sp, 8] /* orig_r8 */
419419 st r0, [sp, 4] /* orig_r0, needed only for sys calls */
420420
421421 /* Restore r9 used to code the early prologue */
arch/arc/include/asm/irqflags.h+8−4
@@ -39,7 +39,7 @@ static inline long arch_local_irq_save(void) · 38 unmodified lines
3939 " flag.nz %0 \n"
4040 : "=r"(temp), "=r"(flags)
4141 : "n"((STATUS_E1_MASK | STATUS_E2_MASK))
42− : "cc");
42+ : "memory", "cc");
4343
4444 return flags;
4545 }
@@ -53,7 +53,8 @@ static inline void arch_local_irq_restore(unsigned long flags) · 7 unmodified lines
5353 __asm__ __volatile__(
5454 " flag %0 \n"
5555 :
56− : "r"(flags));
56+ : "r"(flags)
57+ : "memory");
5758 }
5859
5960 /*
@@ -73,7 +74,8 @@ static inline void arch_local_irq_disable(void) · 13 unmodified lines
7374 " and %0, %0, %1 \n"
7475 " flag %0 \n"
7576 : "=&r"(temp)
76− : "n"(~(STATUS_E1_MASK | STATUS_E2_MASK)));
77+ : "n"(~(STATUS_E1_MASK | STATUS_E2_MASK))
78+ : "memory");
7779 }
7880
7981 /*
@@ -85,7 +87,9 @@ static inline long arch_local_save_flags(void) · 5 unmodified lines
8587
8688 __asm__ __volatile__(
8789 " lr %0, [status32] \n"
88− : "=&r"(temp));
90+ : "=&r"(temp)
91+ :
92+ : "memory");
8993
9094 return temp;
9195 }
arch/arc/include/asm/kgdb.h+2−4
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313
1414 #ifdef CONFIG_KGDB
1515
16−#include <asm/user.h>
16+#include <asm/ptrace.h>
1717
1818 /* to ensure compatibility with Linux 2.6.35, we don't implement the get/set
1919 * register API yet */
@@ -53,9 +53,7 @@ enum arc700_linux_regnums { · 33 unmodified lines
5353 };
5454
5555 #else
56−static inline void kgdb_trap(struct pt_regs *regs, int param)
57−{
58−}
56+#define kgdb_trap(regs, param)
5957 #endif
6058
6159 #endif /* __ARC_KGDB_H__ */
arch/arc/include/asm/ptrace.h+1−1
@@ -123,7 +123,7 @@ static inline long regs_return_value(struct pt_regs *regs) · 122 unmodified lines
123123 #define orig_r8_IS_SCALL 0x0001
124124 #define orig_r8_IS_SCALL_RESTARTED 0x0002
125125 #define orig_r8_IS_BRKPT 0x0004
126−#define orig_r8_IS_EXCPN 0x0004
126+#define orig_r8_IS_EXCPN 0x0008
127127 #define orig_r8_IS_IRQ1 0x0010
128128 #define orig_r8_IS_IRQ2 0x0020
129129
arch/arc/include/asm/syscalls.h+0−2
@@ -16,8 +16,6 @@ · 15 unmodified lines
1616 #include <linux/types.h>
1717
1818 int sys_clone_wrapper(int, int, int, int, int);
19−int sys_fork_wrapper(void);
20−int sys_vfork_wrapper(void);
2119 int sys_cacheflush(uint32_t, uint32_t uint32_t);
2220 int sys_arc_settls(void *);
2321 int sys_arc_gettls(void);
arch/arc/include/uapi/asm/ptrace.h+2−2
@@ -28,14 +28,14 @@ · 27 unmodified lines
2828 */
2929 struct user_regs_struct {
3030
31− struct scratch {
31+ struct {
3232 long pad;
3333 long bta, lp_start, lp_end, lp_count;
3434 long status32, ret, blink, fp, gp;
3535 long r12, r11, r10, r9, r8, r7, r6, r5, r4, r3, r2, r1, r0;
3636 long sp;
3737 } scratch;
38− struct callee {
38+ struct {
3939 long pad;
4040 long r25, r24, r23, r22, r21, r20;
4141 long r19, r18, r17, r16, r15, r14, r13;
arch/arc/kernel/entry.S+1−26
@@ -452,7 +452,7 @@ tracesys: · 451 unmodified lines
452452 ; using ERET won't work since next-PC has already committed
453453 lr r12, [efa]
454454 GET_CURR_TASK_FIELD_PTR TASK_THREAD, r11
455− st r12, [r11, THREAD_FAULT_ADDR]
455+ st r12, [r11, THREAD_FAULT_ADDR] ; thread.fault_address
456456
457457 ; PRE Sys Call Ptrace hook
458458 mov r0, sp ; pt_regs needed
@@ -792,31 +792,6 @@ ARC_EXIT ret_from_fork · 333 unmodified lines
792792
793793 ;################### Special Sys Call Wrappers ##########################
794794
795−; TBD: call do_fork directly from here
796−ARC_ENTRY sys_fork_wrapper
797− SAVE_CALLEE_SAVED_USER
798− bl @sys_fork
799− DISCARD_CALLEE_SAVED_USER
800−
801− GET_CURR_THR_INFO_FLAGS r10
802− btst r10, TIF_SYSCALL_TRACE
803− bnz tracesys_exit
804−
805− b ret_from_system_call
806−ARC_EXIT sys_fork_wrapper
807−
808−ARC_ENTRY sys_vfork_wrapper
809− SAVE_CALLEE_SAVED_USER
810− bl @sys_vfork
811− DISCARD_CALLEE_SAVED_USER
812−
813− GET_CURR_THR_INFO_FLAGS r10
814− btst r10, TIF_SYSCALL_TRACE
815− bnz tracesys_exit
816−
817− b ret_from_system_call
818−ARC_EXIT sys_vfork_wrapper
819−
820795 ARC_ENTRY sys_clone_wrapper
821796 SAVE_CALLEE_SAVED_USER
822797 bl @sys_clone
arch/arc/kernel/kgdb.c+1−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 */
1010
1111 #include <linux/kgdb.h>
12+#include <linux/sched.h>
1213 #include <asm/disasm.h>
1314 #include <asm/cacheflush.h>
1415
arch/arc/kernel/setup.c+1−3
@@ -232,10 +232,8 @@ char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len) · 231 unmodified lines
232232
233233 n += scnprintf(buf + n, len - n, "\n");
234234
235−#ifdef _ASM_GENERIC_UNISTD_H
236235 n += scnprintf(buf + n, len - n,
237− "OS ABI [v2]\t: asm-generic/{unistd,stat,fcntl}\n");
238−#endif
236+ "OS ABI [v3]\t: no-legacy-syscalls\n");
239237
240238 return buf;
241239 }
arch/arc/kernel/sys.c+0−2
@@ -6,8 +6,6 @@ · 5 unmodified lines
66 #include <asm/syscalls.h>
77
88 #define sys_clone sys_clone_wrapper
9−#define sys_fork sys_fork_wrapper
10−#define sys_vfork sys_vfork_wrapper
119
1210 #undef __SYSCALL
1311 #define __SYSCALL(nr, call) [nr] = (call),
arch/arm/Kconfig+23−13
@@ -49,7 +49,6 @@ config ARM · 48 unmodified lines
4949 select HAVE_REGS_AND_STACK_ACCESS_API
5050 select HAVE_SYSCALL_TRACEPOINTS
5151 select HAVE_UID16
52− select HAVE_VIRT_TO_BUS
5352 select KTIME_SCALAR
5453 select PERF_USE_VMALLOC
5554 select RTC_LIB
@@ -556,7 +555,6 @@ config ARCH_IXP4XX · 500 unmodified lines
556555 config ARCH_DOVE
557556 bool "Marvell Dove"
558557 select ARCH_REQUIRE_GPIOLIB
559− select COMMON_CLK_DOVE
560558 select CPU_V7
561559 select GENERIC_CLOCKEVENTS
562560 select MIGHT_HAVE_PCI
@@ -744,6 +742,7 @@ config ARCH_RPC · 181 unmodified lines
744742 select NEED_MACH_IO_H
745743 select NEED_MACH_MEMORY_H
746744 select NO_IOPORT
745+ select VIRT_TO_BUS
747746 help
748747 On the Acorn Risc-PC, Linux can support the internal IDE disk and
749748 CD-ROM interface, serial and parallel port, and the floppy drive.
@@ -879,6 +878,7 @@ config ARCH_SHARK · 129 unmodified lines
879878 select ISA_DMA
880879 select NEED_MACH_MEMORY_H
881880 select PCI
881+ select VIRT_TO_BUS
882882 select ZONE_DMA
883883 help
884884 Support for the StrongARM based Digital DNARD machine, also known
@@ -1006,12 +1006,12 @@ config ARCH_MULTI_V4_V5 · 121 unmodified lines
10061006 bool
10071007
10081008 config ARCH_MULTI_V6
1009− bool "ARMv6 based platforms (ARM11, Scorpion, ...)"
1009+ bool "ARMv6 based platforms (ARM11)"
10101010 select ARCH_MULTI_V6_V7
10111011 select CPU_V6
10121012
10131013 config ARCH_MULTI_V7
1014− bool "ARMv7 based platforms (Cortex-A, PJ4, Krait)"
1014+ bool "ARMv7 based platforms (Cortex-A, PJ4, Scorpion, Krait)"
10151015 default y
10161016 select ARCH_MULTI_V6_V7
10171017 select ARCH_VEXPRESS
@@ -1183,9 +1183,9 @@ config ARM_NR_BANKS · 165 unmodified lines
11831183 default 8
11841184
11851185 config IWMMXT
1186− bool "Enable iWMMXt support"
1186+ bool "Enable iWMMXt support" if !CPU_PJ4
11871187 depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4
1188− default y if PXA27x || PXA3xx || ARCH_MMP
1188+ default y if PXA27x || PXA3xx || ARCH_MMP || CPU_PJ4
11891189 help
11901190 Enable support for iWMMXt context switching at run time if
11911191 running on a CPU that supports it.
@@ -1439,6 +1439,16 @@ config ARM_ERRATA_775420 · 247 unmodified lines
14391439 to deadlock. This workaround puts DSB before executing ISB if
14401440 an abort may occur on cache maintenance.
14411441
1442+config ARM_ERRATA_798181
1443+ bool "ARM errata: TLBI/DSB failure on Cortex-A15"
1444+ depends on CPU_V7 && SMP
1445+ help
1446+ On Cortex-A15 (r0p0..r3p2) the TLBI*IS/DSB operations are not
1447+ adequately shooting down all use of the old entries. This
1448+ option enables the Linux kernel workaround for this erratum
1449+ which sends an IPI to the CPUs that are running the same ASID
1450+ as the one being invalidated.
1451+
14421452 endmenu
14431453
14441454 source "arch/arm/common/Kconfig"
@@ -1462,10 +1472,6 @@ config ISA_DMA · 17 unmodified lines
14621472 bool
14631473 select ISA_DMA_API
14641474
1465−config ARCH_NO_VIRT_TO_BUS
1466− def_bool y
1467− depends on !ARCH_RPC && !ARCH_NETWINDER && !ARCH_SHARK
1468−
14691475 # Select ISA DMA interface
14701476 config ISA_DMA_API
14711477 bool
@@ -1657,13 +1663,16 @@ config LOCAL_TIMERS · 185 unmodified lines
16571663 accounting to be spread across the timer interval, preventing a
16581664 "thundering herd" at every timer tick.
16591665
1666+# The GPIO number here must be sorted by descending number. In case of
1667+# a multiplatform kernel, we just want the highest value required by the
1668+# selected platforms.
16601669 config ARCH_NR_GPIO
16611670 int
16621671 default 1024 if ARCH_SHMOBILE || ARCH_TEGRA
1663− default 355 if ARCH_U8500
1664− default 264 if MACH_H4700
16651672 default 512 if SOC_OMAP5
1673+ default 355 if ARCH_U8500
16661674 default 288 if ARCH_VT8500 || ARCH_SUNXI
1675+ default 264 if MACH_H4700
16671676 default 0
16681677 help
16691678 Maximum number of GPIOs in the system.
@@ -1887,8 +1896,9 @@ config XEN_DOM0 · 217 unmodified lines
18871896
18881897 config XEN
18891898 bool "Xen guest support on ARM (EXPERIMENTAL)"
1890− depends on ARM && OF
1899+ depends on ARM && AEABI && OF
18911900 depends on CPU_V7 && !CPU_V6
1901+ depends on !GENERIC_ATOMIC64
18921902 help
18931903 Say Y if you want to run Linux in a Virtual Machine on Xen on ARM.
18941904
arch/arm/Kconfig.debug+2−1
@@ -492,9 +492,10 @@ config DEBUG_IMX_UART_PORT · 491 unmodified lines
492492 DEBUG_IMX31_UART || \
493493 DEBUG_IMX35_UART || \
494494 DEBUG_IMX51_UART || \
495− DEBUG_IMX50_IMX53_UART || \
495+ DEBUG_IMX53_UART || \
496496 DEBUG_IMX6Q_UART
497497 default 1
498+ depends on ARCH_MXC
498499 help
499500 Choose UART port on which kernel low-level debug messages
500501 should be output.
arch/arm/boot/Makefile+1−1
@@ -115,4 +115,4 @@ i: · 114 unmodified lines
115115 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
116116 $(obj)/Image System.map "$(INSTALL_PATH)"
117117
118−subdir- := bootp compressed
118+subdir- := bootp compressed dts
arch/arm/boot/dts/armada-370-mirabox.dts+1−1
@@ -54,7 +54,7 @@ · 53 unmodified lines
5454 };
5555
5656 mvsdio@d00d4000 {
57− pinctrl-0 = <&sdio_pins2>;
57+ pinctrl-0 = <&sdio_pins3>;
5858 pinctrl-names = "default";
5959 status = "okay";
6060 /*
arch/arm/boot/dts/armada-370-rd.dts+8−0
@@ -64,5 +64,13 @@ · 63 unmodified lines
6464 status = "okay";
6565 /* No CD or WP GPIOs */
6666 };
67+
68+ usb@d0050000 {
69+ status = "okay";
70+ };
71+
72+ usb@d0051000 {
73+ status = "okay";
74+ };
6775 };
6876 };
arch/arm/boot/dts/armada-370-xp.dtsi+2−3
@@ -31,7 +31,6 @@ · 30 unmodified lines
3131 mpic: interrupt-controller@d0020000 {
3232 compatible = "marvell,mpic";
3333 #interrupt-cells = <1>;
34− #address-cells = <1>;
3534 #size-cells = <1>;
3635 interrupt-controller;
3736 };
@@ -54,7 +53,7 @@ · 16 unmodified lines
5453 reg = <0xd0012000 0x100>;
5554 reg-shift = <2>;
5655 interrupts = <41>;
57− reg-io-width = <4>;
56+ reg-io-width = <1>;
5857 status = "disabled";
5958 };
6059 serial@d0012100 {
@@ -62,7 +61,7 @@ · 1 unmodified line
6261 reg = <0xd0012100 0x100>;
6362 reg-shift = <2>;
6463 interrupts = <42>;
65− reg-io-width = <4>;
64+ reg-io-width = <1>;
6665 status = "disabled";
6766 };
6867
arch/arm/boot/dts/armada-370.dtsi+6−0
@@ -59,6 +59,12 @@ · 58 unmodified lines
5959 "mpp50", "mpp51", "mpp52";
6060 marvell,function = "sd0";
6161 };
62+
63+ sdio_pins3: sdio-pins3 {
64+ marvell,pins = "mpp48", "mpp49", "mpp50",
65+ "mpp51", "mpp52", "mpp53";
66+ marvell,function = "sd0";
67+ };
6268 };
6369
6470 gpio0: gpio@d0018100 {
arch/arm/boot/dts/armada-xp.dtsi+2−2
@@ -46,7 +46,7 @@ · 45 unmodified lines
4646 reg = <0xd0012200 0x100>;
4747 reg-shift = <2>;
4848 interrupts = <43>;
49− reg-io-width = <4>;
49+ reg-io-width = <1>;
5050 status = "disabled";
5151 };
5252 serial@d0012300 {
@@ -54,7 +54,7 @@ · 1 unmodified line
5454 reg = <0xd0012300 0x100>;
5555 reg-shift = <2>;
5656 interrupts = <44>;
57− reg-io-width = <4>;
57+ reg-io-width = <1>;
5858 status = "disabled";
5959 };
6060
arch/arm/boot/dts/at91sam9x5.dtsi+26−2
@@ -238,8 +238,32 @@ · 237 unmodified lines
238238 nand {
239239 pinctrl_nand: nand-0 {
240240 atmel,pins =
241− <3 4 0x0 0x1 /* PD5 gpio RDY pin pull_up */
242− 3 5 0x0 0x1>; /* PD4 gpio enable pin pull_up */
241+ <3 0 0x1 0x0 /* PD0 periph A Read Enable */
242+ 3 1 0x1 0x0 /* PD1 periph A Write Enable */
243+ 3 2 0x1 0x0 /* PD2 periph A Address Latch Enable */
244+ 3 3 0x1 0x0 /* PD3 periph A Command Latch Enable */
245+ 3 4 0x0 0x1 /* PD4 gpio Chip Enable pin pull_up */
246+ 3 5 0x0 0x1 /* PD5 gpio RDY/BUSY pin pull_up */
247+ 3 6 0x1 0x0 /* PD6 periph A Data bit 0 */
248+ 3 7 0x1 0x0 /* PD7 periph A Data bit 1 */
249+ 3 8 0x1 0x0 /* PD8 periph A Data bit 2 */
250+ 3 9 0x1 0x0 /* PD9 periph A Data bit 3 */
251+ 3 10 0x1 0x0 /* PD10 periph A Data bit 4 */
252+ 3 11 0x1 0x0 /* PD11 periph A Data bit 5 */
253+ 3 12 0x1 0x0 /* PD12 periph A Data bit 6 */
254+ 3 13 0x1 0x0>; /* PD13 periph A Data bit 7 */
255+ };
256+
257+ pinctrl_nand_16bits: nand_16bits-0 {
258+ atmel,pins =
259+ <3 14 0x1 0x0 /* PD14 periph A Data bit 8 */
260+ 3 15 0x1 0x0 /* PD15 periph A Data bit 9 */
261+ 3 16 0x1 0x0 /* PD16 periph A Data bit 10 */
262+ 3 17 0x1 0x0 /* PD17 periph A Data bit 11 */
263+ 3 18 0x1 0x0 /* PD18 periph A Data bit 12 */
264+ 3 19 0x1 0x0 /* PD19 periph A Data bit 13 */
265+ 3 20 0x1 0x0 /* PD20 periph A Data bit 14 */
266+ 3 21 0x1 0x0>; /* PD21 periph A Data bit 15 */
243267 };
244268 };
245269
arch/arm/boot/dts/bcm2835.dtsi+1−1
@@ -105,7 +105,7 @@ · 104 unmodified lines
105105 compatible = "fixed-clock";
106106 reg = <1>;
107107 #clock-cells = <0>;
108− clock-frequency = <150000000>;
108+ clock-frequency = <250000000>;
109109 };
110110 };
111111 };
arch/arm/boot/dts/dbx5x0.dtsi+3−4
@@ -191,8 +191,8 @@ · 190 unmodified lines
191191
192192 prcmu: prcmu@80157000 {
193193 compatible = "stericsson,db8500-prcmu";
194− reg = <0x80157000 0x1000>;
195− reg-names = "prcmu";
194+ reg = <0x80157000 0x1000>, <0x801b0000 0x8000>, <0x801b8000 0x1000>;
195+ reg-names = "prcmu", "prcmu-tcpm", "prcmu-tcdm";
196196 interrupts = <0 47 0x4>;
197197 #address-cells = <1>;
198198 #size-cells = <1>;
@@ -319,9 +319,8 @@ · 120 unmodified lines
319319 };
320320 };
321321
322− ab8500@5 {
322+ ab8500 {
323323 compatible = "stericsson,ab8500";
324− reg = <5>; /* mailbox 5 is i2c */
325324 interrupt-parent = <&intc>;
326325 interrupts = <0 40 0x4>;
327326 interrupt-controller;
arch/arm/boot/dts/dove.dtsi+5−0
@@ -197,6 +197,11 @@ · 196 unmodified lines
197197 status = "disabled";
198198 };
199199
200+ rtc@d8500 {
201+ compatible = "marvell,orion-rtc";
202+ reg = <0xd8500 0x20>;
203+ };
204+
200205 crypto: crypto@30000 {
201206 compatible = "marvell,orion-crypto";
202207 reg = <0x30000 0x10000>,
arch/arm/boot/dts/exynos4.dtsi+9−0
@@ -275,18 +275,27 @@ · 274 unmodified lines
275275 compatible = "arm,pl330", "arm,primecell";
276276 reg = <0x12680000 0x1000>;
277277 interrupts = <0 35 0>;
278+ #dma-cells = <1>;
279+ #dma-channels = <8>;
280+ #dma-requests = <32>;
278281 };
279282
280283 pdma1: pdma@12690000 {
281284 compatible = "arm,pl330", "arm,primecell";
282285 reg = <0x12690000 0x1000>;
283286 interrupts = <0 36 0>;
287+ #dma-cells = <1>;
288+ #dma-channels = <8>;
289+ #dma-requests = <32>;
284290 };
285291
286292 mdma1: mdma@12850000 {
287293 compatible = "arm,pl330", "arm,primecell";
288294 reg = <0x12850000 0x1000>;
289295 interrupts = <0 34 0>;
296+ #dma-cells = <1>;
297+ #dma-channels = <8>;
298+ #dma-requests = <1>;
290299 };
291300 };
292301 };
arch/arm/boot/dts/exynos5440.dtsi+6−0
@@ -142,12 +142,18 @@ · 141 unmodified lines
142142 compatible = "arm,pl330", "arm,primecell";
143143 reg = <0x120000 0x1000>;
144144 interrupts = <0 34 0>;
145+ #dma-cells = <1>;
146+ #dma-channels = <8>;
147+ #dma-requests = <32>;
145148 };
146149
147150 pdma1: pdma@121B0000 {
148151 compatible = "arm,pl330", "arm,primecell";
149152 reg = <0x121000 0x1000>;
150153 interrupts = <0 35 0>;
154+ #dma-cells = <1>;
155+ #dma-channels = <8>;
156+ #dma-requests = <32>;
151157 };
152158 };
153159
arch/arm/boot/dts/href.dtsi+1−1
@@ -221,7 +221,7 @@ · 220 unmodified lines
221221 };
222222 };
223223
224− ab8500@5 {
224+ ab8500 {
225225 ab8500-regulators {
226226 ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
227227 regulator-name = "V-DISPLAY";
arch/arm/boot/dts/hrefv60plus.dts+1−1
@@ -158,7 +158,7 @@ · 157 unmodified lines
158158 };
159159 };
160160
161− ab8500@5 {
161+ ab8500 {
162162 ab8500-regulators {
163163 ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
164164 regulator-name = "V-DISPLAY";
arch/arm/boot/dts/imx28-m28evk.dts+0−1
@@ -152,7 +152,6 @@ · 151 unmodified lines
152152 i2c0: i2c@80058000 {
153153 pinctrl-names = "default";
154154 pinctrl-0 = <&i2c0_pins_a>;
155− clock-frequency = <400000>;
156155 status = "okay";
157156
158157 sgtl5000: codec@0a {
arch/arm/boot/dts/imx28-sps1.dts+0−1
@@ -70,7 +70,6 @@ · 69 unmodified lines
7070 i2c0: i2c@80058000 {
7171 pinctrl-names = "default";
7272 pinctrl-0 = <&i2c0_pins_a>;
73− clock-frequency = <400000>;
7473 status = "okay";
7574
7675 rtc: rtc@51 {
arch/arm/boot/dts/imx53-mba53.dts+1−2
@@ -42,10 +42,9 @@ · 41 unmodified lines
4242 fsl,pins = <689 0x10000 /* DISP1_DRDY */
4343 482 0x10000 /* DISP1_HSYNC */
4444 489 0x10000 /* DISP1_VSYNC */
45− 684 0x10000 /* DISP1_DAT_0 */
4645 515 0x10000 /* DISP1_DAT_22 */
4746 523 0x10000 /* DISP1_DAT_23 */
48− 543 0x10000 /* DISP1_DAT_21 */
47+ 545 0x10000 /* DISP1_DAT_21 */
4948 553 0x10000 /* DISP1_DAT_20 */
5049 558 0x10000 /* DISP1_DAT_19 */
5150 564 0x10000 /* DISP1_DAT_18 */
arch/arm/boot/dts/imx6qdl.dtsi+1−0
@@ -91,6 +91,7 @@ · 90 unmodified lines
9191 compatible = "arm,cortex-a9-twd-timer";
9292 reg = <0x00a00600 0x20>;
9393 interrupts = <1 13 0xf01>;
94+ clocks = <&clks 15>;
9495 };
9596
9697 L2: l2-cache@00a02000 {
arch/arm/boot/dts/kirkwood-dns320.dts+0−2
@@ -42,12 +42,10 @@ · 41 unmodified lines
4242
4343 ocp@f1000000 {
4444 serial@12000 {
45− clock-frequency = <166666667>;
4645 status = "okay";
4746 };
4847
4948 serial@12100 {
50− clock-frequency = <166666667>;
5149 status = "okay";
5250 };
5351 };
arch/arm/boot/dts/kirkwood-dns325.dts+0−1
@@ -50,7 +50,6 @@ · 49 unmodified lines
5050 };
5151 };
5252 serial@12000 {
53− clock-frequency = <200000000>;
5453 status = "okay";
5554 };
5655 };
arch/arm/boot/dts/kirkwood-dockstar.dts+0−1
@@ -37,7 +37,6 @@ · 36 unmodified lines
3737 };
3838 };
3939 serial@12000 {
40− clock-frequency = <200000000>;
4140 status = "ok";
4241 };
4342
arch/arm/boot/dts/kirkwood-dreamplug.dts+0−1
@@ -38,7 +38,6 @@ · 37 unmodified lines
3838 };
3939 };
4040 serial@12000 {
41− clock-frequency = <200000000>;
4241 status = "ok";
4342 };
4443
arch/arm/boot/dts/kirkwood-goflexnet.dts+1−1
@@ -73,11 +73,11 @@ · 72 unmodified lines
7373 };
7474 };
7575 serial@12000 {
76− clock-frequency = <200000000>;
7776 status = "ok";
7877 };
7978
8079 nand@3000000 {
80+ chip-delay = <40>;
8181 status = "okay";
8282
8383 partition@0 {
arch/arm/boot/dts/kirkwood-ib62x0.dts+0−1
@@ -51,7 +51,6 @@ · 50 unmodified lines
5151 };
5252 };
5353 serial@12000 {
54− clock-frequency = <200000000>;
5554 status = "okay";
5655 };
5756
arch/arm/boot/dts/kirkwood-iconnect.dts+0−1
@@ -78,7 +78,6 @@ · 77 unmodified lines
7878 };
7979 };
8080 serial@12000 {
81− clock-frequency = <200000000>;
8281 status = "ok";
8382 };
8483
arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts+7−8
@@ -96,11 +96,11 @@ · 95 unmodified lines
9696 marvell,function = "gpio";
9797 };
9898 pmx_led_rebuild_brt_ctrl_1: pmx-led-rebuild-brt-ctrl-1 {
99− marvell,pins = "mpp44";
99+ marvell,pins = "mpp46";
100100 marvell,function = "gpio";
101101 };
102102 pmx_led_rebuild_brt_ctrl_2: pmx-led-rebuild-brt-ctrl-2 {
103− marvell,pins = "mpp45";
103+ marvell,pins = "mpp47";
104104 marvell,function = "gpio";
105105 };
106106
@@ -115,7 +115,6 @@ · 8 unmodified lines
115115 };
116116
117117 serial@12000 {
118− clock-frequency = <200000000>;
119118 status = "ok";
120119 };
121120
@@ -158,14 +157,14 @@ · 36 unmodified lines
158157 gpios = <&gpio0 16 0>;
159158 linux,default-trigger = "default-on";
160159 };
161− health_led1 {
160+ rebuild_led {
161+ label = "status:white:rebuild_led";
162+ gpios = <&gpio1 4 0>;
163+ };
164+ health_led {
162165 label = "status:red:health_led";
163166 gpios = <&gpio1 5 0>;
164167 };
165− health_led2 {
166− label = "status:white:health_led";
167− gpios = <&gpio1 4 0>;
168− };
169168 backup_led {
170169 label = "status:blue:backup_led";
171170 gpios = <&gpio0 15 0>;
arch/arm/boot/dts/kirkwood-km_kirkwood.dts+0−1
@@ -34,7 +34,6 @@ · 33 unmodified lines
3434 };
3535
3636 serial@12000 {
37− clock-frequency = <200000000>;
3837 status = "ok";
3938 };
4039
arch/arm/boot/dts/kirkwood-lschlv2.dts+0−1
@@ -13,7 +13,6 @@ · 12 unmodified lines
1313
1414 ocp@f1000000 {
1515 serial@12000 {
16− clock-frequency = <166666667>;
1716 status = "okay";
1817 };
1918 };
arch/arm/boot/dts/kirkwood-lsxhl.dts+0−1
@@ -13,7 +13,6 @@ · 12 unmodified lines
1313
1414 ocp@f1000000 {
1515 serial@12000 {
16− clock-frequency = <200000000>;
1716 status = "okay";
1817 };
1918 };
arch/arm/boot/dts/kirkwood-mplcec4.dts+0−1
@@ -90,7 +90,6 @@ · 89 unmodified lines
9090 };
9191
9292 serial@12000 {
93− clock-frequency = <200000000>;
9493 status = "ok";
9594 };
9695
arch/arm/boot/dts/kirkwood-ns2-common.dtsi+0−1
@@ -23,7 +23,6 @@ · 22 unmodified lines
2323 };
2424
2525 serial@12000 {
26− clock-frequency = <166666667>;
2726 status = "okay";
2827 };
2928
arch/arm/boot/dts/kirkwood-nsa310.dts+0−1
@@ -117,7 +117,6 @@ · 116 unmodified lines
117117 };
118118
119119 serial@12000 {
120− clock-frequency = <200000000>;
121120 status = "ok";
122121 };
123122
arch/arm/boot/dts/kirkwood-openblocks_a6.dts+0−2
@@ -18,12 +18,10 @@ · 17 unmodified lines
1818
1919 ocp@f1000000 {
2020 serial@12000 {
21− clock-frequency = <200000000>;
2221 status = "ok";
2322 };
2423
2524 serial@12100 {
26− clock-frequency = <200000000>;
2725 status = "ok";
2826 };
2927
arch/arm/boot/dts/kirkwood-topkick.dts+0−1
@@ -108,7 +108,6 @@ · 107 unmodified lines
108108 };
109109
110110 serial@12000 {
111− clock-frequency = <200000000>;
112111 status = "ok";
113112 };
114113
arch/arm/boot/dts/kirkwood.dtsi+3−2
@@ -38,6 +38,7 @@ · 37 unmodified lines
3838 interrupt-controller;
3939 #interrupt-cells = <2>;
4040 interrupts = <35>, <36>, <37>, <38>;
41+ clocks = <&gate_clk 7>;
4142 };
4243
4344 gpio1: gpio@10140 {
@@ -49,6 +50,7 @@ · 5 unmodified lines
4950 interrupt-controller;
5051 #interrupt-cells = <2>;
5152 interrupts = <39>, <40>, <41>;
53+ clocks = <&gate_clk 7>;
5254 };
5355
5456 serial@12000 {
@@ -57,7 +59,6 @@ · 2 unmodified lines
5759 reg-shift = <2>;
5860 interrupts = <33>;
5961 clocks = <&gate_clk 7>;
60− /* set clock-frequency in board dts */
6162 status = "disabled";
6263 };
6364
@@ -67,7 +68,6 @@ · 3 unmodified lines
6768 reg-shift = <2>;
6869 interrupts = <34>;
6970 clocks = <&gate_clk 7>;
70− /* set clock-frequency in board dts */
7171 status = "disabled";
7272 };
7373
@@ -75,6 +75,7 @@ · 1 unmodified line
7575 compatible = "marvell,kirkwood-rtc", "marvell,orion-rtc";
7676 reg = <0x10300 0x20>;
7777 interrupts = <53>;
78+ clocks = <&gate_clk 7>;
7879 };
7980
8081 spi@10600 {
arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts+1−1
@@ -11,7 +11,7 @@ · 10 unmodified lines
1111
1212 / {
1313 model = "LaCie Ethernet Disk mini V2";
14− compatible = "lacie,ethernet-disk-mini-v2", "marvell-orion5x-88f5182", "marvell,orion5x";
14+ compatible = "lacie,ethernet-disk-mini-v2", "marvell,orion5x-88f5182", "marvell,orion5x";
1515
1616 memory {
1717 reg = <0x00000000 0x4000000>; /* 64 MB */
arch/arm/boot/dts/orion5x.dtsi+7−2
@@ -13,6 +13,9 @@ · 12 unmodified lines
1313 compatible = "marvell,orion5x";
1414 interrupt-parent = <&intc>;
1515
16+ aliases {
17+ gpio0 = &gpio0;
18+ };
1619 intc: interrupt-controller {
1720 compatible = "marvell,orion-intc", "marvell,intc";
1821 interrupt-controller;
@@ -32,7 +35,9 @@ · 13 unmodified lines
3235 #gpio-cells = <2>;
3336 gpio-controller;
3437 reg = <0x10100 0x40>;
35− ngpio = <32>;
38+ ngpios = <32>;
39+ interrupt-controller;
40+ #interrupt-cells = <2>;
3641 interrupts = <6>, <7>, <8>, <9>;
3742 };
3843
@@ -91,7 +96,7 @@ · 52 unmodified lines
9196 reg = <0x90000 0x10000>,
9297 <0xf2200000 0x800>;
9398 reg-names = "regs", "sram";
94− interrupts = <22>;
99+ interrupts = <28>;
95100 status = "okay";
96101 };
97102 };
arch/arm/boot/dts/snowball.dts+1−1
@@ -298,7 +298,7 @@ · 297 unmodified lines
298298 };
299299 };
300300
301− ab8500@5 {
301+ ab8500 {
302302 ab8500-regulators {
303303 ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
304304 regulator-name = "V-DISPLAY";
arch/arm/boot/dts/socfpga.dtsi+3−0
@@ -75,6 +75,9 @@ · 74 unmodified lines
7575 compatible = "arm,pl330", "arm,primecell";
7676 reg = <0xffe01000 0x1000>;
7777 interrupts = <0 180 4>;
78+ #dma-cells = <1>;
79+ #dma-channels = <8>;
80+ #dma-requests = <32>;
7881 };
7982 };
8083
arch/arm/boot/dts/tegra20.dtsi+2−1
@@ -118,6 +118,7 @@ · 117 unmodified lines
118118 compatible = "arm,cortex-a9-twd-timer";
119119 reg = <0x50040600 0x20>;
120120 interrupts = <1 13 0x304>;
121+ clocks = <&tegra_car 132>;
121122 };
122123
123124 intc: interrupt-controller {
@@ -384,7 +385,7 @@ · 260 unmodified lines
384385
385386 spi@7000d800 {
386387 compatible = "nvidia,tegra20-slink";
387− reg = <0x7000d480 0x200>;
388+ reg = <0x7000d800 0x200>;
388389 interrupts = <0 83 0x04>;
389390 nvidia,dma-request-selector = <&apbdma 17>;
390391 #address-cells = <1>;
arch/arm/boot/dts/tegra30.dtsi+2−1
@@ -119,6 +119,7 @@ · 118 unmodified lines
119119 compatible = "arm,cortex-a9-twd-timer";
120120 reg = <0x50040600 0x20>;
121121 interrupts = <1 13 0xf04>;
122+ clocks = <&tegra_car 214>;
122123 };
123124
124125 intc: interrupt-controller {
@@ -371,7 +372,7 @@ · 246 unmodified lines
371372
372373 spi@7000d800 {
373374 compatible = "nvidia,tegra30-slink", "nvidia,tegra20-slink";
374− reg = <0x7000d480 0x200>;
375+ reg = <0x7000d800 0x200>;
375376 interrupts = <0 83 0x04>;
376377 nvidia,dma-request-selector = <&apbdma 17>;
377378 #address-cells = <1>;
arch/arm/configs/mxs_defconfig+1−0
@@ -116,6 +116,7 @@ CONFIG_SND_SOC=y · 115 unmodified lines
116116 CONFIG_SND_MXS_SOC=y
117117 CONFIG_SND_SOC_MXS_SGTL5000=y
118118 CONFIG_USB=y
119+CONFIG_USB_EHCI_HCD=y
119120 CONFIG_USB_CHIPIDEA=y
120121 CONFIG_USB_CHIPIDEA_HOST=y
121122 CONFIG_USB_STORAGE=y
arch/arm/configs/omap2plus_defconfig+2−0
@@ -126,6 +126,8 @@ CONFIG_INPUT_MISC=y · 125 unmodified lines
126126 CONFIG_INPUT_TWL4030_PWRBUTTON=y
127127 CONFIG_VT_HW_CONSOLE_BINDING=y
128128 # CONFIG_LEGACY_PTYS is not set
129+CONFIG_SERIAL_8250=y
130+CONFIG_SERIAL_8250_CONSOLE=y
129131 CONFIG_SERIAL_8250_NR_UARTS=32
130132 CONFIG_SERIAL_8250_EXTENDED=y
131133 CONFIG_SERIAL_8250_MANY_PORTS=y
arch/arm/include/asm/delay.h+1−1
@@ -24,7 +24,7 @@ extern struct arm_delay_ops { · 23 unmodified lines
2424 void (*delay)(unsigned long);
2525 void (*const_udelay)(unsigned long);
2626 void (*udelay)(unsigned long);
27− bool const_clock;
27+ unsigned long ticks_per_jiffy;
2828 } arm_delay_ops;
2929
3030 #define __delay(n) arm_delay_ops.delay(n)
arch/arm/include/asm/glue-cache.h+0−8
@@ -19,14 +19,6 @@ · 18 unmodified lines
1919 #undef _CACHE
2020 #undef MULTI_CACHE
2121
22−#if defined(CONFIG_CPU_CACHE_V3)
23−# ifdef _CACHE
24−# define MULTI_CACHE 1
25−# else
26−# define _CACHE v3
27−# endif
28−#endif
29−
3022 #if defined(CONFIG_CPU_CACHE_V4)
3123 # ifdef _CACHE
3224 # define MULTI_CACHE 1
arch/arm/include/asm/hardware/iop3xx.h+1−1
@@ -37,7 +37,7 @@ extern int iop3xx_get_init_atu(void); · 36 unmodified lines
3737 * IOP3XX processor registers
3838 */
3939 #define IOP3XX_PERIPHERAL_PHYS_BASE 0xffffe000
40−#define IOP3XX_PERIPHERAL_VIRT_BASE 0xfeffe000
40+#define IOP3XX_PERIPHERAL_VIRT_BASE 0xfedfe000
4141 #define IOP3XX_PERIPHERAL_SIZE 0x00002000
4242 #define IOP3XX_PERIPHERAL_UPPER_PA (IOP3XX_PERIPHERAL_PHYS_BASE +\
4343 IOP3XX_PERIPHERAL_SIZE - 1)
arch/arm/include/asm/highmem.h+7−0
@@ -41,6 +41,13 @@ extern void kunmap_high(struct page *page); · 40 unmodified lines
4141 #endif
4242 #endif
4343
44+/*
45+ * Needed to be able to broadcast the TLB invalidation for kmap.
46+ */
47+#ifdef CONFIG_ARM_ERRATA_798181
48+#undef ARCH_NEEDS_KMAP_HIGH_GET
49+#endif
50+
4451 #ifdef ARCH_NEEDS_KMAP_HIGH_GET
4552 extern void *kmap_high_get(struct page *page);
4653 #else
arch/arm/include/asm/mmu_context.h+2−0
@@ -27,6 +27,8 @@ void __check_vmalloc_seq(struct mm_struct *mm); · 26 unmodified lines
2727 void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk);
2828 #define init_new_context(tsk,mm) ({ atomic64_set(&mm->context.id, 0); 0; })
2929
30+DECLARE_PER_CPU(atomic64_t, active_asids);
31+
3032 #else /* !CONFIG_CPU_HAS_ASID */
3133
3234 #ifdef CONFIG_MMU
arch/arm/include/asm/pgtable-3level.h+1−1
@@ -111,7 +111,7 @@ · 110 unmodified lines
111111 #define L_PTE_S2_MT_WRITETHROUGH (_AT(pteval_t, 0xa) << 2) /* MemAttr[3:0] */
112112 #define L_PTE_S2_MT_WRITEBACK (_AT(pteval_t, 0xf) << 2) /* MemAttr[3:0] */
113113 #define L_PTE_S2_RDONLY (_AT(pteval_t, 1) << 6) /* HAP[1] */
114−#define L_PTE_S2_RDWR (_AT(pteval_t, 2) << 6) /* HAP[2:1] */
114+#define L_PTE_S2_RDWR (_AT(pteval_t, 3) << 6) /* HAP[2:1] */
115115
116116 /*
117117 * Hyp-mode PL2 PTE definitions for LPAE.
arch/arm/include/asm/tlbflush.h+17−9
@@ -14,7 +14,6 @@ · 13 unmodified lines
1414
1515 #include <asm/glue.h>
1616
17−#define TLB_V3_PAGE (1 << 0)
1817 #define TLB_V4_U_PAGE (1 << 1)
1918 #define TLB_V4_D_PAGE (1 << 2)
2019 #define TLB_V4_I_PAGE (1 << 3)
@@ -22,7 +21,6 @@ · 1 unmodified line
2221 #define TLB_V6_D_PAGE (1 << 5)
2322 #define TLB_V6_I_PAGE (1 << 6)
2423
25−#define TLB_V3_FULL (1 << 8)
2624 #define TLB_V4_U_FULL (1 << 9)
2725 #define TLB_V4_D_FULL (1 << 10)
2826 #define TLB_V4_I_FULL (1 << 11)
@@ -52,7 +50,6 @@ · 23 unmodified lines
5250 * =============
5351 *
5452 * We have the following to choose from:
55− * v3 - ARMv3
5653 * v4 - ARMv4 without write buffer
5754 * v4wb - ARMv4 with write buffer without I TLB flush entry instruction
5855 * v4wbi - ARMv4 with write buffer with I TLB flush entry instruction
@@ -330,7 +327,6 @@ static inline void local_flush_tlb_all(void) · 271 unmodified lines
330327 if (tlb_flag(TLB_WB))
331328 dsb();
332329
333− tlb_op(TLB_V3_FULL, "c6, c0, 0", zero);
334330 tlb_op(TLB_V4_U_FULL | TLB_V6_U_FULL, "c8, c7, 0", zero);
335331 tlb_op(TLB_V4_D_FULL | TLB_V6_D_FULL, "c8, c6, 0", zero);
336332 tlb_op(TLB_V4_I_FULL | TLB_V6_I_FULL, "c8, c5, 0", zero);
@@ -351,9 +347,8 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm) · 14 unmodified lines
351347 if (tlb_flag(TLB_WB))
352348 dsb();
353349
354− if (possible_tlb_flags & (TLB_V3_FULL|TLB_V4_U_FULL|TLB_V4_D_FULL|TLB_V4_I_FULL)) {
350+ if (possible_tlb_flags & (TLB_V4_U_FULL|TLB_V4_D_FULL|TLB_V4_I_FULL)) {
355351 if (cpumask_test_cpu(get_cpu(), mm_cpumask(mm))) {
356− tlb_op(TLB_V3_FULL, "c6, c0, 0", zero);
357352 tlb_op(TLB_V4_U_FULL, "c8, c7, 0", zero);
358353 tlb_op(TLB_V4_D_FULL, "c8, c6, 0", zero);
359354 tlb_op(TLB_V4_I_FULL, "c8, c5, 0", zero);
@@ -385,9 +380,8 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) · 25 unmodified lines
385380 if (tlb_flag(TLB_WB))
386381 dsb();
387382
388− if (possible_tlb_flags & (TLB_V3_PAGE|TLB_V4_U_PAGE|TLB_V4_D_PAGE|TLB_V4_I_PAGE|TLB_V4_I_FULL) &&
383+ if (possible_tlb_flags & (TLB_V4_U_PAGE|TLB_V4_D_PAGE|TLB_V4_I_PAGE|TLB_V4_I_FULL) &&
389384 cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) {
390− tlb_op(TLB_V3_PAGE, "c6, c0, 0", uaddr);
391385 tlb_op(TLB_V4_U_PAGE, "c8, c7, 1", uaddr);
392386 tlb_op(TLB_V4_D_PAGE, "c8, c6, 1", uaddr);
393387 tlb_op(TLB_V4_I_PAGE, "c8, c5, 1", uaddr);
@@ -418,7 +412,6 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr) · 24 unmodified lines
418412 if (tlb_flag(TLB_WB))
419413 dsb();
420414
421− tlb_op(TLB_V3_PAGE, "c6, c0, 0", kaddr);
422415 tlb_op(TLB_V4_U_PAGE, "c8, c7, 1", kaddr);
423416 tlb_op(TLB_V4_D_PAGE, "c8, c6, 1", kaddr);
424417 tlb_op(TLB_V4_I_PAGE, "c8, c5, 1", kaddr);
@@ -450,6 +443,21 @@ static inline void local_flush_bp_all(void) · 25 unmodified lines
450443 isb();
451444 }
452445
446+#ifdef CONFIG_ARM_ERRATA_798181
447+static inline void dummy_flush_tlb_a15_erratum(void)
448+{
449+ /*
450+ * Dummy TLBIMVAIS. Using the unmapped address 0 and ASID 0.
451+ */
452+ asm("mcr p15, 0, %0, c8, c3, 1" : : "r" (0));
453+ dsb();
454+}
455+#else
456+static inline void dummy_flush_tlb_a15_erratum(void)
457+{
458+}
459+#endif
460+
453461 /*
454462 * flush_pmd_entry
455463 *
arch/arm/include/asm/xen/events.h+4−21
@@ -2,6 +2,7 @@ · 1 unmodified line
22 #define _ASM_ARM_XEN_EVENTS_H
33
44 #include <asm/ptrace.h>
5+#include <asm/atomic.h>
56
67 enum ipi_vector {
78 XEN_PLACEHOLDER_VECTOR,
@@ -15,26 +16,8 @@ static inline int xen_irqs_disabled(struct pt_regs *regs) · 7 unmodified lines
1516 return raw_irqs_disabled_flags(regs->ARM_cpsr);
1617 }
1718
18−/*
19− * We cannot use xchg because it does not support 8-byte
20− * values. However it is safe to use {ldr,dtd}exd directly because all
21− * platforms which Xen can run on support those instructions.
22− */
23−static inline xen_ulong_t xchg_xen_ulong(xen_ulong_t *ptr, xen_ulong_t val)
24−{
25− xen_ulong_t oldval;
26− unsigned int tmp;
27−
28− wmb();
29− asm volatile("@ xchg_xen_ulong\n"
30− "1: ldrexd %0, %H0, [%3]\n"
31− " strexd %1, %2, %H2, [%3]\n"
32− " teq %1, #0\n"
33− " bne 1b"
34− : "=&r" (oldval), "=&r" (tmp)
35− : "r" (val), "r" (ptr)
36− : "memory", "cc");
37− return oldval;
38−}
19+#define xchg_xen_ulong(ptr, val) atomic64_xchg(container_of((ptr), \
20+ atomic64_t, \
21+ counter), (val))
3922
4023 #endif /* _ASM_ARM_XEN_EVENTS_H */
arch/arm/kernel/entry-common.S+12−0
@@ -276,7 +276,13 @@ ENDPROC(ftrace_graph_caller_old) · 275 unmodified lines
276276 */
277277
278278 .macro mcount_enter
279+/*
280+ * This pad compensates for the push {lr} at the call site. Note that we are
281+ * unable to unwind through a function which does not otherwise save its lr.
282+ */
283+ UNWIND(.pad #4)
279284 stmdb sp!, {r0-r3, lr}
285+ UNWIND(.save {r0-r3, lr})
280286 .endm
281287
282288 .macro mcount_get_lr reg
@@ -289,6 +295,7 @@ ENDPROC(ftrace_graph_caller_old) · 6 unmodified lines
289295 .endm
290296
291297 ENTRY(__gnu_mcount_nc)
298+UNWIND(.fnstart)
292299 #ifdef CONFIG_DYNAMIC_FTRACE
293300 mov ip, lr
294301 ldmia sp!, {lr}
@@ -296,17 +303,22 @@ ENTRY(__gnu_mcount_nc) · 1 unmodified line
296303 #else
297304 __mcount
298305 #endif
306+UNWIND(.fnend)
299307 ENDPROC(__gnu_mcount_nc)
300308
301309 #ifdef CONFIG_DYNAMIC_FTRACE
302310 ENTRY(ftrace_caller)
311+UNWIND(.fnstart)
303312 __ftrace_caller
313+UNWIND(.fnend)
304314 ENDPROC(ftrace_caller)
305315 #endif
306316
307317 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
308318 ENTRY(ftrace_graph_caller)
319+UNWIND(.fnstart)
309320 __ftrace_graph_caller
321+UNWIND(.fnend)
310322 ENDPROC(ftrace_graph_caller)
311323 #endif
312324
arch/arm/kernel/head.S+1−1
@@ -267,7 +267,7 @@ __create_page_tables: · 266 unmodified lines
267267 addne r6, r6, #1 << SECTION_SHIFT
268268 strne r6, [r3]
269269
270−#if defined(CONFIG_LPAE) && defined(CONFIG_CPU_ENDIAN_BE8)
270+#if defined(CONFIG_ARM_LPAE) && defined(CONFIG_CPU_ENDIAN_BE8)
271271 sub r4, r4, #4 @ Fixup page table pointer
272272 @ for 64-bit descriptors
273273 #endif
arch/arm/kernel/hw_breakpoint.c+4−4
@@ -966,7 +966,7 @@ static void reset_ctrl_regs(void *unused) · 965 unmodified lines
966966 }
967967
968968 if (err) {
969− pr_warning("CPU %d debug is powered down!\n", cpu);
969+ pr_warn_once("CPU %d debug is powered down!\n", cpu);
970970 cpumask_or(&debug_err_mask, &debug_err_mask, cpumask_of(cpu));
971971 return;
972972 }
@@ -987,7 +987,7 @@ clear_vcr: · 14 unmodified lines
987987 isb();
988988
989989 if (cpumask_intersects(&debug_err_mask, cpumask_of(cpu))) {
990− pr_warning("CPU %d failed to disable vector catch\n", cpu);
990+ pr_warn_once("CPU %d failed to disable vector catch\n", cpu);
991991 return;
992992 }
993993
@@ -1007,7 +1007,7 @@ clear_vcr: · 13 unmodified lines
10071007 }
10081008
10091009 if (cpumask_intersects(&debug_err_mask, cpumask_of(cpu))) {
1010− pr_warning("CPU %d failed to clear debug register pairs\n", cpu);
1010+ pr_warn_once("CPU %d failed to clear debug register pairs\n", cpu);
10111011 return;
10121012 }
10131013
@@ -1043,7 +1043,7 @@ static int dbg_cpu_pm_notify(struct notifier_block *self, unsigned long action, · 29 unmodified lines
10431043 return NOTIFY_OK;
10441044 }
10451045
1046−static struct notifier_block __cpuinitdata dbg_cpu_pm_nb = {
1046+static struct notifier_block dbg_cpu_pm_nb = {
10471047 .notifier_call = dbg_cpu_pm_notify,
10481048 };
10491049
arch/arm/kernel/perf_event.c+4−1
@@ -253,7 +253,10 @@ validate_event(struct pmu_hw_events *hw_events, · 252 unmodified lines
253253 struct arm_pmu *armpmu = to_arm_pmu(event->pmu);
254254 struct pmu *leader_pmu = event->group_leader->pmu;
255255
256− if (event->pmu != leader_pmu || event->state <= PERF_EVENT_STATE_OFF)
256+ if (event->pmu != leader_pmu || event->state < PERF_EVENT_STATE_OFF)
257+ return 1;
258+
259+ if (event->state == PERF_EVENT_STATE_OFF && !event->attr.enable_on_exec)
257260 return 1;
258261
259262 return armpmu->get_event_idx(hw_events, event) >= 0;
arch/arm/kernel/sched_clock.c+2−2
@@ -45,12 +45,12 @@ static u32 notrace jiffy_sched_clock_read(void) · 44 unmodified lines
4545
4646 static u32 __read_mostly (*read_sched_clock)(void) = jiffy_sched_clock_read;
4747
48−static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
48+static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift)
4949 {
5050 return (cyc * mult) >> shift;
5151 }
5252
53−static unsigned long long cyc_to_sched_clock(u32 cyc, u32 mask)
53+static unsigned long long notrace cyc_to_sched_clock(u32 cyc, u32 mask)
5454 {
5555 u64 epoch_ns;
5656 u32 epoch_cyc;
arch/arm/kernel/setup.c+22−5
@@ -56,7 +56,6 @@ · 55 unmodified lines
5656 #include <asm/virt.h>
5757
5858 #include "atags.h"
59−#include "tcm.h"
6059
6160
6261 #if defined(CONFIG_FPE_NWFPE) || defined(CONFIG_FPE_FASTFPE)
@@ -353,6 +352,23 @@ void __init early_print(const char *str, ...) · 290 unmodified lines
353352 printk("%s", buf);
354353 }
355354
355+static void __init cpuid_init_hwcaps(void)
356+{
357+ unsigned int divide_instrs;
358+
359+ if (cpu_architecture() < CPU_ARCH_ARMv7)
360+ return;
361+
362+ divide_instrs = (read_cpuid_ext(CPUID_EXT_ISAR0) & 0x0f000000) >> 24;
363+
364+ switch (divide_instrs) {
365+ case 2:
366+ elf_hwcap |= HWCAP_IDIVA;
367+ case 1:
368+ elf_hwcap |= HWCAP_IDIVT;
369+ }
370+}
371+
356372 static void __init feat_v6_fixup(void)
357373 {
358374 int id = read_cpuid_id();
@@ -483,8 +499,11 @@ static void __init setup_processor(void) · 124 unmodified lines
483499 snprintf(elf_platform, ELF_PLATFORM_SIZE, "%s%c",
484500 list->elf_name, ENDIANNESS);
485501 elf_hwcap = list->elf_hwcap;
502+
503+ cpuid_init_hwcaps();
504+
486505 #ifndef CONFIG_ARM_THUMB
487− elf_hwcap &= ~HWCAP_THUMB;
506+ elf_hwcap &= ~(HWCAP_THUMB | HWCAP_IDIVT);
488507 #endif
489508
490509 feat_v6_fixup();
@@ -524,7 +543,7 @@ int __init arm_add_memory(phys_addr_t start, phys_addr_t size) · 33 unmodified lines
524543 size -= start & ~PAGE_MASK;
525544 bank->start = PAGE_ALIGN(start);
526545
527−#ifndef CONFIG_LPAE
546+#ifndef CONFIG_ARM_LPAE
528547 if (bank->start + size < bank->start) {
529548 printk(KERN_CRIT "Truncating memory at 0x%08llx to fit in "
530549 "32-bit physical address space\n", (long long)start);
@@ -778,8 +797,6 @@ void __init setup_arch(char **cmdline_p) · 247 unmodified lines
778797
779798 reserve_crashkernel();
780799
781− tcm_init();
782−
783800 #ifdef CONFIG_MULTI_IRQ_HANDLER
784801 handle_arch_irq = mdesc->handle_irq;
785802 #endif
arch/arm/kernel/smp.c+1−4
@@ -480,7 +480,7 @@ static void __cpuinit broadcast_timer_setup(struct clock_event_device *evt) · 479 unmodified lines
480480 evt->features = CLOCK_EVT_FEAT_ONESHOT |
481481 CLOCK_EVT_FEAT_PERIODIC |
482482 CLOCK_EVT_FEAT_DUMMY;
483− evt->rating = 400;
483+ evt->rating = 100;
484484 evt->mult = 1;
485485 evt->set_mode = broadcast_timer_set_mode;
486486
@@ -673,9 +673,6 @@ static int cpufreq_callback(struct notifier_block *nb, · 186 unmodified lines
673673 if (freq->flags & CPUFREQ_CONST_LOOPS)
674674 return NOTIFY_OK;
675675
676− if (arm_delay_ops.const_clock)
677− return NOTIFY_OK;
678−
679676 if (!per_cpu(l_p_j_ref, cpu)) {
680677 per_cpu(l_p_j_ref, cpu) =
681678 per_cpu(cpu_data, cpu).loops_per_jiffy;
arch/arm/kernel/smp_tlb.c+66−0
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212
1313 #include <asm/smp_plat.h>
1414 #include <asm/tlbflush.h>
15+#include <asm/mmu_context.h>
1516
1617 /**********************************************************************/
1718
@@ -69,12 +70,72 @@ static inline void ipi_flush_bp_all(void *ignored) · 51 unmodified lines
6970 local_flush_bp_all();
7071 }
7172
73+#ifdef CONFIG_ARM_ERRATA_798181
74+static int erratum_a15_798181(void)
75+{
76+ unsigned int midr = read_cpuid_id();
77+
78+ /* Cortex-A15 r0p0..r3p2 affected */
79+ if ((midr & 0xff0ffff0) != 0x410fc0f0 || midr > 0x413fc0f2)
80+ return 0;
81+ return 1;
82+}
83+#else
84+static int erratum_a15_798181(void)
85+{
86+ return 0;
87+}
88+#endif
89+
90+static void ipi_flush_tlb_a15_erratum(void *arg)
91+{
92+ dmb();
93+}
94+
95+static void broadcast_tlb_a15_erratum(void)
96+{
97+ if (!erratum_a15_798181())
98+ return;
99+
100+ dummy_flush_tlb_a15_erratum();
101+ smp_call_function_many(cpu_online_mask, ipi_flush_tlb_a15_erratum,
102+ NULL, 1);
103+}
104+
105+static void broadcast_tlb_mm_a15_erratum(struct mm_struct *mm)
106+{
107+ int cpu;
108+ cpumask_t mask = { CPU_BITS_NONE };
109+
110+ if (!erratum_a15_798181())
111+ return;
112+
113+ dummy_flush_tlb_a15_erratum();
114+ for_each_online_cpu(cpu) {
115+ if (cpu == smp_processor_id())
116+ continue;
117+ /*
118+ * We only need to send an IPI if the other CPUs are running
119+ * the same ASID as the one being invalidated. There is no
120+ * need for locking around the active_asids check since the
121+ * switch_mm() function has at least one dmb() (as required by
122+ * this workaround) in case a context switch happens on
123+ * another CPU after the condition below.
124+ */
125+ if (atomic64_read(&mm->context.id) ==
126+ atomic64_read(&per_cpu(active_asids, cpu)))
127+ cpumask_set_cpu(cpu, &mask);
128+ }
129+ smp_call_function_many(&mask, ipi_flush_tlb_a15_erratum, NULL, 1);
130+}
131+
72132 void flush_tlb_all(void)
73133 {
74134 if (tlb_ops_need_broadcast())
75135 on_each_cpu(ipi_flush_tlb_all, NULL, 1);
76136 else
77137 local_flush_tlb_all();
138+ broadcast_tlb_a15_erratum();
78139 }
79140
80141 void flush_tlb_mm(struct mm_struct *mm)
@@ -83,6 +144,7 @@ void flush_tlb_mm(struct mm_struct *mm) · 2 unmodified lines
83144 on_each_cpu_mask(mm_cpumask(mm), ipi_flush_tlb_mm, mm, 1);
84145 else
85146 local_flush_tlb_mm(mm);
147+ broadcast_tlb_mm_a15_erratum(mm);
86148 }
87149
88150 void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
@@ -95,6 +157,7 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) · 6 unmodified lines
95157 &ta, 1);
96158 } else
97159 local_flush_tlb_page(vma, uaddr);
160+ broadcast_tlb_mm_a15_erratum(vma->vm_mm);
98161 }
99162
100163 void flush_tlb_kernel_page(unsigned long kaddr)
@@ -105,6 +168,7 @@ void flush_tlb_kernel_page(unsigned long kaddr) · 4 unmodified lines
105168 on_each_cpu(ipi_flush_tlb_kernel_page, &ta, 1);
106169 } else
107170 local_flush_tlb_kernel_page(kaddr);
171+ broadcast_tlb_a15_erratum();
108172 }
109173
110174 void flush_tlb_range(struct vm_area_struct *vma,
@@ -119,6 +183,7 @@ void flush_tlb_range(struct vm_area_struct *vma, · 8 unmodified lines
119183 &ta, 1);
120184 } else
121185 local_flush_tlb_range(vma, start, end);
186+ broadcast_tlb_mm_a15_erratum(vma->vm_mm);
122187 }
123188
124189 void flush_tlb_kernel_range(unsigned long start, unsigned long end)
@@ -130,6 +195,7 @@ void flush_tlb_kernel_range(unsigned long start, unsigned long end) · 5 unmodified lines
130195 on_each_cpu(ipi_flush_tlb_kernel_range, &ta, 1);
131196 } else
132197 local_flush_tlb_kernel_range(start, end);
198+ broadcast_tlb_a15_erratum();
133199 }
134200
135201 void flush_bp_all(void)
arch/arm/kernel/tcm.c+0−1
@@ -17,7 +17,6 @@ · 16 unmodified lines
1717 #include <asm/mach/map.h>
1818 #include <asm/memory.h>
1919 #include <asm/system_info.h>
20−#include "tcm.h"
2120
2221 static struct gen_pool *tcm_pool;
2322 static bool dtcm_present;
arch/arm/kvm/arm.c+1−0
@@ -201,6 +201,7 @@ int kvm_dev_ioctl_check_extension(long ext) · 200 unmodified lines
201201 break;
202202 case KVM_CAP_ARM_SET_DEVICE_ADDR:
203203 r = 1;
204+ break;
204205 case KVM_CAP_NR_VCPUS:
205206 r = num_online_cpus();
206207 break;
arch/arm/kvm/coproc.c+2−2
@@ -79,11 +79,11 @@ static bool access_dcsw(struct kvm_vcpu *vcpu, · 78 unmodified lines
7979 u32 val;
8080 int cpu;
8181
82− cpu = get_cpu();
83−
8482 if (!p->is_write)
8583 return read_from_write_only(vcpu, p);
8684
85+ cpu = get_cpu();
86+
8787 cpumask_setall(&vcpu->arch.require_dcache_flush);
8888 cpumask_clear_cpu(cpu, &vcpu->arch.require_dcache_flush);
8989
arch/arm/kvm/vgic.c+14−21
@@ -883,8 +883,7 @@ static bool vgic_queue_irq(struct kvm_vcpu *vcpu, u8 sgi_source_id, int irq) · 882 unmodified lines
883883 lr, irq, vgic_cpu->vgic_lr[lr]);
884884 BUG_ON(!test_bit(lr, vgic_cpu->lr_used));
885885 vgic_cpu->vgic_lr[lr] |= GICH_LR_PENDING_BIT;
886−
887− goto out;
886+ return true;
888887 }
889888
890889 /* Try to use another LR for this interrupt */
@@ -898,7 +897,6 @@ static bool vgic_queue_irq(struct kvm_vcpu *vcpu, u8 sgi_source_id, int irq) · 7 unmodified lines
898897 vgic_cpu->vgic_irq_lr_map[irq] = lr;
899898 set_bit(lr, vgic_cpu->lr_used);
900899
901−out:
902900 if (!vgic_irq_is_edge(vcpu, irq))
903901 vgic_cpu->vgic_lr[lr] |= GICH_LR_EOI;
904902
@@ -1018,21 +1016,6 @@ static bool vgic_process_maintenance(struct kvm_vcpu *vcpu) · 113 unmodified lines
10181016
10191017 kvm_debug("MISR = %08x\n", vgic_cpu->vgic_misr);
10201018
1021− /*
1022− * We do not need to take the distributor lock here, since the only
1023− * action we perform is clearing the irq_active_bit for an EOIed
1024− * level interrupt. There is a potential race with
1025− * the queuing of an interrupt in __kvm_vgic_flush_hwstate(), where we
1026− * check if the interrupt is already active. Two possibilities:
1027− *
1028− * - The queuing is occurring on the same vcpu: cannot happen,
1029− * as we're already in the context of this vcpu, and
1030− * executing the handler
1031− * - The interrupt has been migrated to another vcpu, and we
1032− * ignore this interrupt for this run. Big deal. It is still
1033− * pending though, and will get considered when this vcpu
1034− * exits.
1035− */
10361019 if (vgic_cpu->vgic_misr & GICH_MISR_EOI) {
10371020 /*
10381021 * Some level interrupts have been EOIed. Clear their
@@ -1054,6 +1037,13 @@ static bool vgic_process_maintenance(struct kvm_vcpu *vcpu) · 15 unmodified lines
10541037 } else {
10551038 vgic_cpu_irq_clear(vcpu, irq);
10561039 }
1040+
1041+ /*
1042+ * Despite being EOIed, the LR may not have
1043+ * been marked as empty.
1044+ */
1045+ set_bit(lr, (unsigned long *)vgic_cpu->vgic_elrsr);
1046+ vgic_cpu->vgic_lr[lr] &= ~GICH_LR_ACTIVE_BIT;
10571047 }
10581048 }
10591049
@@ -1064,9 +1054,8 @@ static bool vgic_process_maintenance(struct kvm_vcpu *vcpu) · 4 unmodified lines
10641054 }
10651055
10661056 /*
1067− * Sync back the VGIC state after a guest run. We do not really touch
1068− * the distributor here (the irq_pending_on_cpu bit is safe to set),
1069− * so there is no need for taking its lock.
1057+ * Sync back the VGIC state after a guest run. The distributor lock is
1058+ * needed so we don't get preempted in the middle of the state processing.
10701059 */
10711060 static void __kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu)
10721061 {
@@ -1112,10 +1101,14 @@ void kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu) · 39 unmodified lines
11121101
11131102 void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu)
11141103 {
1104+ struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
1105+
11151106 if (!irqchip_in_kernel(vcpu->kvm))
11161107 return;
11171108
1109+ spin_lock(&dist->lock);
11181110 __kvm_vgic_sync_hwstate(vcpu);
1111+ spin_unlock(&dist->lock);
11191112 }
11201113
11211114 int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu)
arch/arm/lib/delay.c+5−3
@@ -58,7 +58,7 @@ static void __timer_delay(unsigned long cycles) · 57 unmodified lines
5858 static void __timer_const_udelay(unsigned long xloops)
5959 {
6060 unsigned long long loops = xloops;
61− loops *= loops_per_jiffy;
61+ loops *= arm_delay_ops.ticks_per_jiffy;
6262 __timer_delay(loops >> UDELAY_SHIFT);
6363 }
6464
@@ -73,11 +73,13 @@ void __init register_current_timer_delay(const struct delay_timer *timer) · 8 unmodified lines
7373 pr_info("Switching to timer-based delay loop\n");
7474 delay_timer = timer;
7575 lpj_fine = timer->freq / HZ;
76− loops_per_jiffy = lpj_fine;
76+
77+ /* cpufreq may scale loops_per_jiffy, so keep a private copy */
78+ arm_delay_ops.ticks_per_jiffy = lpj_fine;
7779 arm_delay_ops.delay = __timer_delay;
7880 arm_delay_ops.const_udelay = __timer_const_udelay;
7981 arm_delay_ops.udelay = __timer_udelay;
80− arm_delay_ops.const_clock = true;
82+
8183 delay_calibrated = true;
8284 } else {
8385 pr_info("Ignoring duplicate/late registration of read_current_timer delay\n");
arch/arm/lib/memset.S+13−20
@@ -14,31 +14,15 @@ · 13 unmodified lines
1414
1515 .text
1616 .align 5
17− .word 0
18−
19−1: subs r2, r2, #4 @ 1 do we have enough
20− blt 5f @ 1 bytes to align with?
21− cmp r3, #2 @ 1
22− strltb r1, [ip], #1 @ 1
23− strleb r1, [ip], #1 @ 1
24− strb r1, [ip], #1 @ 1
25− add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3))
26−/*
27− * The pointer is now aligned and the length is adjusted. Try doing the
28− * memset again.
29− */
3017
3118 ENTRY(memset)
32−/*
33− * Preserve the contents of r0 for the return value.
34− */
35− mov ip, r0
36− ands r3, ip, #3 @ 1 unaligned?
37− bne 1b @ 1
19+ ands r3, r0, #3 @ 1 unaligned?
20+ mov ip, r0 @ preserve r0 as return value
21+ bne 6f @ 1
3822 /*
3923 * we know that the pointer in ip is aligned to a word boundary.
4024 */
41− orr r1, r1, r1, lsl #8
25+1: orr r1, r1, r1, lsl #8
4226 orr r1, r1, r1, lsl #16
4327 mov r3, r1
4428 cmp r2, #16
@@ -127,4 +111,13 @@ ENTRY(memset) · 82 unmodified lines
127111 tst r2, #1
128112 strneb r1, [ip], #1
129113 mov pc, lr
114+
115+6: subs r2, r2, #4 @ 1 do we have enough
116+ blt 5b @ 1 bytes to align with?
117+ cmp r3, #2 @ 1
118+ strltb r1, [ip], #1 @ 1
119+ strleb r1, [ip], #1 @ 1
120+ strb r1, [ip], #1 @ 1
121+ add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3))
122+ b 1b
130123 ENDPROC(memset)
arch/arm/mach-at91/board-foxg20.c+1−0
@@ -176,6 +176,7 @@ static struct w1_gpio_platform_data w1_gpio_pdata = { · 175 unmodified lines
176176 /* If you choose to use a pin other than PB16 it needs to be 3.3V */
177177 .pin = AT91_PIN_PB16,
178178 .is_open_drain = 1,
179+ .ext_pullup_enable_pin = -EINVAL,
179180 };
180181
181182 static struct platform_device w1_device = {
arch/arm/mach-at91/board-stamp9g20.c+1−0
@@ -188,6 +188,7 @@ static struct spi_board_info portuxg20_spi_devices[] = { · 187 unmodified lines
188188 static struct w1_gpio_platform_data w1_gpio_pdata = {
189189 .pin = AT91_PIN_PA29,
190190 .is_open_drain = 1,
191+ .ext_pullup_enable_pin = -EINVAL,
191192 };
192193
193194 static struct platform_device w1_device = {
arch/arm/mach-at91/include/mach/gpio.h+8−0
@@ -209,6 +209,14 @@ extern int at91_get_gpio_value(unsigned pin); · 208 unmodified lines
209209 extern void at91_gpio_suspend(void);
210210 extern void at91_gpio_resume(void);
211211
212+#ifdef CONFIG_PINCTRL_AT91
213+extern void at91_pinctrl_gpio_suspend(void);
214+extern void at91_pinctrl_gpio_resume(void);
215+#else
216+static inline void at91_pinctrl_gpio_suspend(void) {}
217+static inline void at91_pinctrl_gpio_resume(void) {}
218+#endif
219+
212220 #endif /* __ASSEMBLY__ */
213221
214222 #endif
arch/arm/mach-at91/irq.c+8−12
@@ -92,23 +92,21 @@ static int at91_aic_set_wake(struct irq_data *d, unsigned value) · 91 unmodified lines
9292
9393 void at91_irq_suspend(void)
9494 {
95− int i = 0, bit;
95+ int bit = -1;
9696
9797 if (has_aic5()) {
9898 /* disable enabled irqs */
99− while ((bit = find_next_bit(backups, n_irqs, i)) < n_irqs) {
99+ while ((bit = find_next_bit(backups, n_irqs, bit + 1)) < n_irqs) {
100100 at91_aic_write(AT91_AIC5_SSR,
101101 bit & AT91_AIC5_INTSEL_MSK);
102102 at91_aic_write(AT91_AIC5_IDCR, 1);
103− i = bit;
104103 }
105104 /* enable wakeup irqs */
106− i = 0;
107− while ((bit = find_next_bit(wakeups, n_irqs, i)) < n_irqs) {
105+ bit = -1;
106+ while ((bit = find_next_bit(wakeups, n_irqs, bit + 1)) < n_irqs) {
108107 at91_aic_write(AT91_AIC5_SSR,
109108 bit & AT91_AIC5_INTSEL_MSK);
110109 at91_aic_write(AT91_AIC5_IECR, 1);
111− i = bit;
112110 }
113111 } else {
114112 at91_aic_write(AT91_AIC_IDCR, *backups);
@@ -118,23 +116,21 @@ void at91_irq_suspend(void) · 3 unmodified lines
118116
119117 void at91_irq_resume(void)
120118 {
121− int i = 0, bit;
119+ int bit = -1;
122120
123121 if (has_aic5()) {
124122 /* disable wakeup irqs */
125− while ((bit = find_next_bit(wakeups, n_irqs, i)) < n_irqs) {
123+ while ((bit = find_next_bit(wakeups, n_irqs, bit + 1)) < n_irqs) {
126124 at91_aic_write(AT91_AIC5_SSR,
127125 bit & AT91_AIC5_INTSEL_MSK);
128126 at91_aic_write(AT91_AIC5_IDCR, 1);
129− i = bit;
130127 }
131128 /* enable irqs disabled for suspend */
132− i = 0;
133− while ((bit = find_next_bit(backups, n_irqs, i)) < n_irqs) {
129+ bit = -1;
130+ while ((bit = find_next_bit(backups, n_irqs, bit + 1)) < n_irqs) {
134131 at91_aic_write(AT91_AIC5_SSR,
135132 bit & AT91_AIC5_INTSEL_MSK);
136133 at91_aic_write(AT91_AIC5_IECR, 1);
137− i = bit;
138134 }
139135 } else {
140136 at91_aic_write(AT91_AIC_IDCR, *wakeups);
arch/arm/mach-at91/pm.c+8−2
@@ -201,7 +201,10 @@ extern u32 at91_slow_clock_sz; · 200 unmodified lines
201201
202202 static int at91_pm_enter(suspend_state_t state)
203203 {
204− at91_gpio_suspend();
204+ if (of_have_populated_dt())
205+ at91_pinctrl_gpio_suspend();
206+ else
207+ at91_gpio_suspend();
205208 at91_irq_suspend();
206209
207210 pr_debug("AT91: PM - wake mask %08x, pm state %d\n",
@@ -286,7 +289,10 @@ static int at91_pm_enter(suspend_state_t state) · 78 unmodified lines
286289 error:
287290 target_state = PM_SUSPEND_ON;
288291 at91_irq_resume();
289− at91_gpio_resume();
292+ if (of_have_populated_dt())
293+ at91_pinctrl_gpio_resume();
294+ else
295+ at91_gpio_resume();
290296 return 0;
291297 }
292298
arch/arm/mach-cns3xxx/core.c+3−13
@@ -22,19 +22,9 @@ · 21 unmodified lines
2222
2323 static struct map_desc cns3xxx_io_desc[] __initdata = {
2424 {
25− .virtual = CNS3XXX_TC11MP_TWD_BASE_VIRT,
26− .pfn = __phys_to_pfn(CNS3XXX_TC11MP_TWD_BASE),
27− .length = SZ_4K,
28− .type = MT_DEVICE,
29− }, {
30− .virtual = CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT,
31− .pfn = __phys_to_pfn(CNS3XXX_TC11MP_GIC_CPU_BASE),
32− .length = SZ_4K,
33− .type = MT_DEVICE,
34− }, {
35− .virtual = CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT,
36− .pfn = __phys_to_pfn(CNS3XXX_TC11MP_GIC_DIST_BASE),
37− .length = SZ_4K,
25+ .virtual = CNS3XXX_TC11MP_SCU_BASE_VIRT,
26+ .pfn = __phys_to_pfn(CNS3XXX_TC11MP_SCU_BASE),
27+ .length = SZ_8K,
3828 .type = MT_DEVICE,
3929 }, {
4030 .virtual = CNS3XXX_TIMER1_2_3_BASE_VIRT,
arch/arm/mach-cns3xxx/include/mach/cns3xxx.h+8−8
@@ -94,10 +94,10 @@ · 93 unmodified lines
9494 #define RTC_INTR_STS_OFFSET 0x34
9595
9696 #define CNS3XXX_MISC_BASE 0x76000000 /* Misc Control */
97−#define CNS3XXX_MISC_BASE_VIRT 0xFFF07000 /* Misc Control */
97+#define CNS3XXX_MISC_BASE_VIRT 0xFB000000 /* Misc Control */
9898
9999 #define CNS3XXX_PM_BASE 0x77000000 /* Power Management Control */
100−#define CNS3XXX_PM_BASE_VIRT 0xFFF08000
100+#define CNS3XXX_PM_BASE_VIRT 0xFB001000
101101
102102 #define PM_CLK_GATE_OFFSET 0x00
103103 #define PM_SOFT_RST_OFFSET 0x04
@@ -109,7 +109,7 @@ · 5 unmodified lines
109109 #define PM_PLL_HM_PD_OFFSET 0x1C
110110
111111 #define CNS3XXX_UART0_BASE 0x78000000 /* UART 0 */
112−#define CNS3XXX_UART0_BASE_VIRT 0xFFF09000
112+#define CNS3XXX_UART0_BASE_VIRT 0xFB002000
113113
114114 #define CNS3XXX_UART1_BASE 0x78400000 /* UART 1 */
115115 #define CNS3XXX_UART1_BASE_VIRT 0xFFF0A000
@@ -130,7 +130,7 @@ · 14 unmodified lines
130130 #define CNS3XXX_I2S_BASE_VIRT 0xFFF10000
131131
132132 #define CNS3XXX_TIMER1_2_3_BASE 0x7C800000 /* Timer */
133−#define CNS3XXX_TIMER1_2_3_BASE_VIRT 0xFFF10800
133+#define CNS3XXX_TIMER1_2_3_BASE_VIRT 0xFB003000
134134
135135 #define TIMER1_COUNTER_OFFSET 0x00
136136 #define TIMER1_AUTO_RELOAD_OFFSET 0x04
@@ -227,16 +227,16 @@ · 90 unmodified lines
227227 * Testchip peripheral and fpga gic regions
228228 */
229229 #define CNS3XXX_TC11MP_SCU_BASE 0x90000000 /* IRQ, Test chip */
230−#define CNS3XXX_TC11MP_SCU_BASE_VIRT 0xFF000000
230+#define CNS3XXX_TC11MP_SCU_BASE_VIRT 0xFB004000
231231
232232 #define CNS3XXX_TC11MP_GIC_CPU_BASE 0x90000100 /* Test chip interrupt controller CPU interface */
233−#define CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT 0xFF000100
233+#define CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT (CNS3XXX_TC11MP_SCU_BASE_VIRT + 0x100)
234234
235235 #define CNS3XXX_TC11MP_TWD_BASE 0x90000600
236−#define CNS3XXX_TC11MP_TWD_BASE_VIRT 0xFF000600
236+#define CNS3XXX_TC11MP_TWD_BASE_VIRT (CNS3XXX_TC11MP_SCU_BASE_VIRT + 0x600)
237237
238238 #define CNS3XXX_TC11MP_GIC_DIST_BASE 0x90001000 /* Test chip interrupt controller distributor */
239−#define CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT 0xFF001000
239+#define CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT (CNS3XXX_TC11MP_SCU_BASE_VIRT + 0x1000)
240240
241241 #define CNS3XXX_TC11MP_L220_BASE 0x92002000 /* L220 registers */
242242 #define CNS3XXX_TC11MP_L220_BASE_VIRT 0xFF002000
arch/arm/mach-davinci/dma.c+3−0
@@ -743,6 +743,9 @@ EXPORT_SYMBOL(edma_free_channel); · 742 unmodified lines
743743 */
744744 int edma_alloc_slot(unsigned ctlr, int slot)
745745 {
746+ if (!edma_cc[ctlr])
747+ return -EINVAL;
748+
746749 if (slot >= 0)
747750 slot = EDMA_CHAN_SLOT(slot);
748751
arch/arm/mach-ep93xx/include/mach/uncompress.h+7−3
@@ -47,9 +47,13 @@ static void __raw_writel(unsigned int value, unsigned int ptr) · 46 unmodified lines
4747
4848 static inline void putc(int c)
4949 {
50− /* Transmit fifo not full? */
51− while (__raw_readb(PHYS_UART_FLAG) & UART_FLAG_TXFF)
52− ;
50+ int i;
51+
52+ for (i = 0; i < 10000; i++) {
53+ /* Transmit fifo not full? */
54+ if (!(__raw_readb(PHYS_UART_FLAG) & UART_FLAG_TXFF))
55+ break;
56+ }
5357
5458 __raw_writeb(c, PHYS_UART_DATA);
5559 }
arch/arm/mach-footbridge/Kconfig+1−0
@@ -67,6 +67,7 @@ config ARCH_NETWINDER · 66 unmodified lines
6767 select ISA
6868 select ISA_DMA
6969 select PCI
70+ select VIRT_TO_BUS
7071 help
7172 Say Y here if you intend to run this kernel on the Rebel.COM
7273 NetWinder. Information about this machine can be found at:
arch/arm/mach-highbank/hotplug.c+4−6
@@ -28,13 +28,11 @@ extern void secondary_startup(void); · 27 unmodified lines
2828 */
2929 void __ref highbank_cpu_die(unsigned int cpu)
3030 {
31− flush_cache_all();
32−
3331 highbank_set_cpu_jump(cpu, phys_to_virt(0));
34− highbank_set_core_pwr();
3532
36− cpu_do_idle();
33+ flush_cache_louis();
34+ highbank_set_core_pwr();
3735
38− /* We should never return from idle */
39− panic("highbank: cpu %d unexpectedly exit from shutdown\n", cpu);
36+ while (1)
37+ cpu_do_idle();
4038 }
arch/arm/mach-imx/clk-imx35.c+3−0
@@ -257,6 +257,7 @@ int __init mx35_clocks_init(void) · 256 unmodified lines
257257 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
258258 clk_register_clkdev(clk[nfc_div], NULL, "imx25-nand.0");
259259 clk_register_clkdev(clk[csi_gate], NULL, "mx3-camera.0");
260+ clk_register_clkdev(clk[admux_gate], "audmux", NULL);
260261
261262 clk_prepare_enable(clk[spba_gate]);
262263 clk_prepare_enable(clk[gpio1_gate]);
@@ -264,6 +265,8 @@ int __init mx35_clocks_init(void) · 1 unmodified line
264265 clk_prepare_enable(clk[gpio3_gate]);
265266 clk_prepare_enable(clk[iim_gate]);
266267 clk_prepare_enable(clk[emi_gate]);
268+ clk_prepare_enable(clk[max_gate]);
269+ clk_prepare_enable(clk[iomuxc_gate]);
267270
268271 /*
269272 * SCC is needed to boot via mmc after a watchdog reset. The clock code
arch/arm/mach-imx/clk-imx6q.c+2−3
@@ -115,7 +115,7 @@ static const char *gpu2d_core_sels[] = { "axi", "pll3_usb_otg", "pll2_pfd0_352m" · 114 unmodified lines
115115 static const char *gpu3d_core_sels[] = { "mmdc_ch0_axi", "pll3_usb_otg", "pll2_pfd1_594m", "pll2_pfd2_396m", };
116116 static const char *gpu3d_shader_sels[] = { "mmdc_ch0_axi", "pll3_usb_otg", "pll2_pfd1_594m", "pll2_pfd9_720m", };
117117 static const char *ipu_sels[] = { "mmdc_ch0_axi", "pll2_pfd2_396m", "pll3_120m", "pll3_pfd1_540m", };
118−static const char *ldb_di_sels[] = { "pll5_video", "pll2_pfd0_352m", "pll2_pfd2_396m", "mmdc_ch1_axi", "pll3_pfd1_540m", };
118+static const char *ldb_di_sels[] = { "pll5_video", "pll2_pfd0_352m", "pll2_pfd2_396m", "mmdc_ch1_axi", "pll3_usb_otg", };
119119 static const char *ipu_di_pre_sels[] = { "mmdc_ch0_axi", "pll3_usb_otg", "pll5_video", "pll2_pfd0_352m", "pll2_pfd2_396m", "pll3_pfd1_540m", };
120120 static const char *ipu1_di0_sels[] = { "ipu1_di0_pre", "dummy", "dummy", "ldb_di0", "ldb_di1", };
121121 static const char *ipu1_di1_sels[] = { "ipu1_di1_pre", "dummy", "dummy", "ldb_di0", "ldb_di1", };
@@ -172,7 +172,7 @@ static struct clk *clk[clk_max]; · 50 unmodified lines
172172 static struct clk_onecell_data clk_data;
173173
174174 static enum mx6q_clks const clks_init_on[] __initconst = {
175− mmdc_ch0_axi, rom,
175+ mmdc_ch0_axi, rom, pll1_sys,
176176 };
177177
178178 static struct clk_div_table clk_enet_ref_table[] = {
@@ -443,7 +443,6 @@ int __init mx6q_clocks_init(void) · 264 unmodified lines
443443
444444 clk_register_clkdev(clk[gpt_ipg], "ipg", "imx-gpt.0");
445445 clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0");
446− clk_register_clkdev(clk[twd], NULL, "smp_twd");
447446 clk_register_clkdev(clk[cko1_sel], "cko1_sel", NULL);
448447 clk_register_clkdev(clk[ahb], "ahb", NULL);
449448 clk_register_clkdev(clk[cko1], "cko1", NULL);
arch/arm/mach-imx/common.h+2−0
@@ -110,6 +110,8 @@ void tzic_handle_irq(struct pt_regs *); · 109 unmodified lines
110110
111111 extern void imx_enable_cpu(int cpu, bool enable);
112112 extern void imx_set_cpu_jump(int cpu, void *jump_addr);
113+extern u32 imx_get_cpu_arg(int cpu);
114+extern void imx_set_cpu_arg(int cpu, u32 arg);
113115 extern void v7_cpu_resume(void);
114116 extern u32 *pl310_get_save_ptr(void);
115117 #ifdef CONFIG_SMP
arch/arm/mach-imx/headsmp.S+9−9
@@ -26,16 +26,16 @@ ENDPROC(v7_secondary_startup) · 25 unmodified lines
2626
2727 #ifdef CONFIG_PM
2828 /*
29− * The following code is located into the .data section. This is to
30− * allow phys_l2x0_saved_regs to be accessed with a relative load
31− * as we are running on physical address here.
29+ * The following code must assume it is running from physical address
30+ * where absolute virtual addresses to the data section have to be
31+ * turned into relative ones.
3232 */
33− .data
34− .align
3533
3634 #ifdef CONFIG_CACHE_L2X0
3735 .macro pl310_resume
38− ldr r2, phys_l2x0_saved_regs
36+ adr r0, l2x0_saved_regs_offset
37+ ldr r2, [r0]
38+ add r2, r2, r0
3939 ldr r0, [r2, #L2X0_R_PHY_BASE] @ get physical base of l2x0
4040 ldr r1, [r2, #L2X0_R_AUX_CTRL] @ get aux_ctrl value
4141 str r1, [r0, #L2X0_AUX_CTRL] @ restore aux_ctrl
@@ -43,9 +43,9 @@ ENDPROC(v7_secondary_startup) · 1 unmodified line
4343 str r1, [r0, #L2X0_CTRL] @ re-enable L2
4444 .endm
4545
46− .globl phys_l2x0_saved_regs
47−phys_l2x0_saved_regs:
48− .long 0
46+l2x0_saved_regs_offset:
47+ .word l2x0_saved_regs - .
48+
4949 #else
5050 .macro pl310_resume
5151 .endm
arch/arm/mach-imx/hotplug.c+12−0
@@ -46,11 +46,23 @@ static inline void cpu_enter_lowpower(void) · 45 unmodified lines
4646 void imx_cpu_die(unsigned int cpu)
4747 {
4848 cpu_enter_lowpower();
49+ /*
50+ * We use the cpu jumping argument register to sync with
51+ * imx_cpu_kill() which is running on cpu0 and waiting for
52+ * the register being cleared to kill the cpu.
53+ */
54+ imx_set_cpu_arg(cpu, ~0);
4955 cpu_do_idle();
5056 }
5157
5258 int imx_cpu_kill(unsigned int cpu)
5359 {
60+ unsigned long timeout = jiffies + msecs_to_jiffies(50);
61+
62+ while (imx_get_cpu_arg(cpu) == 0)
63+ if (time_after(jiffies, timeout))
64+ return 0;
5465 imx_enable_cpu(cpu, false);
66+ imx_set_cpu_arg(cpu, 0);
5567 return 1;
5668 }
arch/arm/mach-imx/imx25-dt.c+5−0
@@ -27,6 +27,11 @@ static const char * const imx25_dt_board_compat[] __initconst = { · 26 unmodified lines
2727 NULL
2828 };
2929
30+static void __init imx25_timer_init(void)
31+{
32+ mx25_clocks_init_dt();
33+}
34+
3035 DT_MACHINE_START(IMX25_DT, "Freescale i.MX25 (Device Tree Support)")
3136 .map_io = mx25_map_io,
3237 .init_early = imx25_init_early,
arch/arm/mach-imx/pm-imx6q.c+0−15
@@ -22,8 +22,6 @@ · 21 unmodified lines
2222 #include "common.h"
2323 #include "hardware.h"
2424
25−extern unsigned long phys_l2x0_saved_regs;
26−
2725 static int imx6q_suspend_finish(unsigned long val)
2826 {
2927 cpu_do_idle();
@@ -57,18 +55,5 @@ static const struct platform_suspend_ops imx6q_pm_ops = { · 27 unmodified lines
5755
5856 void __init imx6q_pm_init(void)
5957 {
60− /*
61− * The l2x0 core code provides an infrastucture to save and restore
62− * l2x0 registers across suspend/resume cycle. But because imx6q
63− * retains L2 content during suspend and needs to resume L2 before
64− * MMU is enabled, it can only utilize register saving support and
65− * have to take care of restoring on its own. So we save physical
66− * address of the data structure used by l2x0 core to save registers,
67− * and later restore the necessary ones in imx6q resume entry.
68− */
69−#ifdef CONFIG_CACHE_L2X0
70− phys_l2x0_saved_regs = __pa(&l2x0_saved_regs);
71−#endif
72−
7358 suspend_set_ops(&imx6q_pm_ops);
7459 }
arch/arm/mach-imx/src.c+12−0
@@ -43,6 +43,18 @@ void imx_set_cpu_jump(int cpu, void *jump_addr) · 42 unmodified lines
4343 src_base + SRC_GPR1 + cpu * 8);
4444 }
4545
46+u32 imx_get_cpu_arg(int cpu)
47+{
48+ cpu = cpu_logical_map(cpu);
49+ return readl_relaxed(src_base + SRC_GPR1 + cpu * 8 + 4);
50+}
51+
52+void imx_set_cpu_arg(int cpu, u32 arg)
53+{
54+ cpu = cpu_logical_map(cpu);
55+ writel_relaxed(arg, src_base + SRC_GPR1 + cpu * 8 + 4);
56+}
57+
4658 void imx_src_prepare_restart(void)
4759 {
4860 u32 val;
arch/arm/mach-ixp4xx/vulcan-setup.c+1−0
@@ -163,6 +163,7 @@ static struct platform_device vulcan_max6369 = { · 162 unmodified lines
163163
164164 static struct w1_gpio_platform_data vulcan_w1_gpio_pdata = {
165165 .pin = 14,
166+ .ext_pullup_enable_pin = -EINVAL,
166167 };
167168
168169 static struct platform_device vulcan_w1_gpio = {
arch/arm/mach-kirkwood/board-dt.c+18−7
@@ -41,16 +41,12 @@ static void __init kirkwood_legacy_clk_init(void) · 40 unmodified lines
4141
4242 struct device_node *np = of_find_compatible_node(
4343 NULL, NULL, "marvell,kirkwood-gating-clock");
44−
4544 struct of_phandle_args clkspec;
45+ struct clk *clk;
4646
4747 clkspec.np = np;
4848 clkspec.args_count = 1;
4949
50− clkspec.args[0] = CGC_BIT_GE0;
51− orion_clkdev_add(NULL, "mv643xx_eth_port.0",
52− of_clk_get_from_provider(&clkspec));
53−
5450 clkspec.args[0] = CGC_BIT_PEX0;
5551 orion_clkdev_add("0", "pcie",
5652 of_clk_get_from_provider(&clkspec));
@@ -59,9 +55,24 @@ static void __init kirkwood_legacy_clk_init(void) · 2 unmodified lines
5955 orion_clkdev_add("1", "pcie",
6056 of_clk_get_from_provider(&clkspec));
6157
62− clkspec.args[0] = CGC_BIT_GE1;
63− orion_clkdev_add(NULL, "mv643xx_eth_port.1",
58+ clkspec.args[0] = CGC_BIT_SDIO;
59+ orion_clkdev_add(NULL, "mvsdio",
6460 of_clk_get_from_provider(&clkspec));
61+
62+ /*
63+ * The ethernet interfaces forget the MAC address assigned by
64+ * u-boot if the clocks are turned off. Until proper DT support
65+ * is available we always enable them for now.
66+ */
67+ clkspec.args[0] = CGC_BIT_GE0;
68+ clk = of_clk_get_from_provider(&clkspec);
69+ orion_clkdev_add(NULL, "mv643xx_eth_port.0", clk);
70+ clk_prepare_enable(clk);
71+
72+ clkspec.args[0] = CGC_BIT_GE1;
73+ clk = of_clk_get_from_provider(&clkspec);
74+ orion_clkdev_add(NULL, "mv643xx_eth_port.1", clk);
75+ clk_prepare_enable(clk);
6576 }
6677
6778 static void __init kirkwood_of_clk_init(void)
arch/arm/mach-kirkwood/board-iomega_ix2_200.c+6−1
@@ -20,10 +20,15 @@ static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = { · 19 unmodified lines
2020 .duplex = DUPLEX_FULL,
2121 };
2222
23+static struct mv643xx_eth_platform_data iomega_ix2_200_ge01_data = {
24+ .phy_addr = MV643XX_ETH_PHY_ADDR(11),
25+};
26+
2327 void __init iomega_ix2_200_init(void)
2428 {
2529 /*
2630 * Basic setup. Needs to be called early.
2731 */
28− kirkwood_ge01_init(&iomega_ix2_200_ge00_data);
32+ kirkwood_ge00_init(&iomega_ix2_200_ge00_data);
33+ kirkwood_ge01_init(&iomega_ix2_200_ge01_data);
2934 }
arch/arm/mach-kirkwood/guruplug-setup.c+2−0
@@ -53,6 +53,8 @@ static struct mv_sata_platform_data guruplug_sata_data = { · 52 unmodified lines
5353
5454 static struct mvsdio_platform_data guruplug_mvsdio_data = {
5555 /* unfortunately the CD signal has not been connected */
56+ .gpio_card_detect = -1,
57+ .gpio_write_protect = -1,
5658 };
5759
5860 static struct gpio_led guruplug_led_pins[] = {
arch/arm/mach-kirkwood/openrd-setup.c+1−0
@@ -55,6 +55,7 @@ static struct mv_sata_platform_data openrd_sata_data = { · 54 unmodified lines
5555
5656 static struct mvsdio_platform_data openrd_mvsdio_data = {
5757 .gpio_card_detect = 29, /* MPP29 used as SD card detect */
58+ .gpio_write_protect = -1,
5859 };
5960
6061 static unsigned int openrd_mpp_config[] __initdata = {
arch/arm/mach-kirkwood/rd88f6281-setup.c+1−0
@@ -69,6 +69,7 @@ static struct mv_sata_platform_data rd88f6281_sata_data = { · 68 unmodified lines
6969
7070 static struct mvsdio_platform_data rd88f6281_mvsdio_data = {
7171 .gpio_card_detect = 28,
72+ .gpio_write_protect = -1,
7273 };
7374
7475 static unsigned int rd88f6281_mpp_config[] __initdata = {
arch/arm/mach-mmp/gplugd.c+1−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 */
1010
1111 #include <linux/init.h>
12+#include <linux/platform_device.h>
1213 #include <linux/gpio.h>
1314
1415 #include <asm/mach/arch.h>
arch/arm/mach-msm/timer.c+4−1
@@ -62,7 +62,10 @@ static int msm_timer_set_next_event(unsigned long cycles, · 61 unmodified lines
6262 {
6363 u32 ctrl = readl_relaxed(event_base + TIMER_ENABLE);
6464
65− writel_relaxed(0, event_base + TIMER_CLEAR);
65+ ctrl &= ~TIMER_ENABLE_EN;
66+ writel_relaxed(ctrl, event_base + TIMER_ENABLE);
67+
68+ writel_relaxed(ctrl, event_base + TIMER_CLEAR);
6669 writel_relaxed(cycles, event_base + TIMER_MATCH_VAL);
6770 writel_relaxed(ctrl | TIMER_ENABLE_EN, event_base + TIMER_ENABLE);
6871 return 0;
arch/arm/mach-mvebu/irq-armada-370-xp.c+10−14
@@ -44,6 +44,8 @@ · 43 unmodified lines
4444
4545 #define ARMADA_370_XP_MAX_PER_CPU_IRQS (28)
4646
47+#define ARMADA_370_XP_TIMER0_PER_CPU_IRQ (5)
48+
4749 #define ACTIVE_DOORBELLS (8)
4850
4951 static DEFINE_RAW_SPINLOCK(irq_controller_lock);
@@ -59,36 +61,26 @@ static struct irq_domain *armada_370_xp_mpic_domain; · 9 unmodified lines
5961 */
6062 static void armada_370_xp_irq_mask(struct irq_data *d)
6163 {
62−#ifdef CONFIG_SMP
6364 irq_hw_number_t hwirq = irqd_to_hwirq(d);
6465
65− if (hwirq > ARMADA_370_XP_MAX_PER_CPU_IRQS)
66+ if (hwirq != ARMADA_370_XP_TIMER0_PER_CPU_IRQ)
6667 writel(hwirq, main_int_base +
6768 ARMADA_370_XP_INT_CLEAR_ENABLE_OFFS);
6869 else
6970 writel(hwirq, per_cpu_int_base +
7071 ARMADA_370_XP_INT_SET_MASK_OFFS);
71−#else
72− writel(irqd_to_hwirq(d),
73− per_cpu_int_base + ARMADA_370_XP_INT_SET_MASK_OFFS);
74−#endif
7572 }
7673
7774 static void armada_370_xp_irq_unmask(struct irq_data *d)
7875 {
79−#ifdef CONFIG_SMP
8076 irq_hw_number_t hwirq = irqd_to_hwirq(d);
8177
82− if (hwirq > ARMADA_370_XP_MAX_PER_CPU_IRQS)
78+ if (hwirq != ARMADA_370_XP_TIMER0_PER_CPU_IRQ)
8379 writel(hwirq, main_int_base +
8480 ARMADA_370_XP_INT_SET_ENABLE_OFFS);
8581 else
8682 writel(hwirq, per_cpu_int_base +
8783 ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
88−#else
89− writel(irqd_to_hwirq(d),
90− per_cpu_int_base + ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
91−#endif
9284 }
9385
9486 #ifdef CONFIG_SMP
@@ -144,10 +136,14 @@ static int armada_370_xp_mpic_irq_map(struct irq_domain *h, · 49 unmodified lines
144136 unsigned int virq, irq_hw_number_t hw)
145137 {
146138 armada_370_xp_irq_mask(irq_get_irq_data(virq));
147− writel(hw, main_int_base + ARMADA_370_XP_INT_SET_ENABLE_OFFS);
139+ if (hw != ARMADA_370_XP_TIMER0_PER_CPU_IRQ)
140+ writel(hw, per_cpu_int_base +
141+ ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
142+ else
143+ writel(hw, main_int_base + ARMADA_370_XP_INT_SET_ENABLE_OFFS);
148144 irq_set_status_flags(virq, IRQ_LEVEL);
149145
150− if (hw < ARMADA_370_XP_MAX_PER_CPU_IRQS) {
146+ if (hw == ARMADA_370_XP_TIMER0_PER_CPU_IRQ) {
151147 irq_set_percpu_devid(virq);
152148 irq_set_chip_and_handler(virq, &armada_370_xp_irq_chip,
153149 handle_percpu_devid_irq);
arch/arm/mach-mxs/icoll.c+1−1
@@ -100,7 +100,7 @@ static struct irq_domain_ops icoll_irq_domain_ops = { · 99 unmodified lines
100100 .xlate = irq_domain_xlate_onecell,
101101 };
102102
103−void __init icoll_of_init(struct device_node *np,
103+static void __init icoll_of_init(struct device_node *np,
104104 struct device_node *interrupt_parent)
105105 {
106106 /*
arch/arm/mach-mxs/mach-mxs.c+17−17
@@ -41,8 +41,6 @@ static struct fb_videomode mx23evk_video_modes[] = { · 40 unmodified lines
4141 .lower_margin = 4,
4242 .hsync_len = 1,
4343 .vsync_len = 1,
44− .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT |
45− FB_SYNC_DOTCLK_FAILING_ACT,
4644 },
4745 };
4846
@@ -59,8 +57,6 @@ static struct fb_videomode mx28evk_video_modes[] = { · 10 unmodified lines
5957 .lower_margin = 10,
6058 .hsync_len = 10,
6159 .vsync_len = 10,
62− .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT |
63− FB_SYNC_DOTCLK_FAILING_ACT,
6460 },
6561 };
6662
@@ -77,7 +73,6 @@ static struct fb_videomode m28evk_video_modes[] = { · 10 unmodified lines
7773 .lower_margin = 45,
7874 .hsync_len = 1,
7975 .vsync_len = 1,
80− .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT,
8176 },
8277 };
8378
@@ -94,9 +89,7 @@ static struct fb_videomode apx4devkit_video_modes[] = { · 10 unmodified lines
9489 .lower_margin = 13,
9590 .hsync_len = 48,
9691 .vsync_len = 3,
97− .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT |
98− FB_SYNC_DATA_ENABLE_HIGH_ACT |
99− FB_SYNC_DOTCLK_FAILING_ACT,
92+ .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
10093 },
10194 };
10295
@@ -113,9 +106,7 @@ static struct fb_videomode apf28dev_video_modes[] = { · 10 unmodified lines
113106 .lower_margin = 0x15,
114107 .hsync_len = 64,
115108 .vsync_len = 4,
116− .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT |
117− FB_SYNC_DATA_ENABLE_HIGH_ACT |
118− FB_SYNC_DOTCLK_FAILING_ACT,
109+ .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
119110 },
120111 };
121112
@@ -132,7 +123,6 @@ static struct fb_videomode cfa10049_video_modes[] = { · 10 unmodified lines
132123 .lower_margin = 2,
133124 .hsync_len = 15,
134125 .vsync_len = 15,
135− .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT
136126 },
137127 };
138128
@@ -259,6 +249,8 @@ static void __init imx23_evk_init(void) · 120 unmodified lines
259249 mxsfb_pdata.mode_count = ARRAY_SIZE(mx23evk_video_modes);
260250 mxsfb_pdata.default_bpp = 32;
261251 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
252+ mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT |
253+ MXSFB_SYNC_DOTCLK_FAILING_ACT;
262254 }
263255
264256 static inline void enable_clk_enet_out(void)
@@ -278,6 +270,8 @@ static void __init imx28_evk_init(void) · 13 unmodified lines
278270 mxsfb_pdata.mode_count = ARRAY_SIZE(mx28evk_video_modes);
279271 mxsfb_pdata.default_bpp = 32;
280272 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
273+ mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT |
274+ MXSFB_SYNC_DOTCLK_FAILING_ACT;
281275
282276 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
283277 }
@@ -297,6 +291,7 @@ static void __init m28evk_init(void) · 13 unmodified lines
297291 mxsfb_pdata.mode_count = ARRAY_SIZE(m28evk_video_modes);
298292 mxsfb_pdata.default_bpp = 16;
299293 mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;
294+ mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT;
300295 }
301296
302297 static void __init sc_sps1_init(void)
@@ -322,6 +317,8 @@ static void __init apx4devkit_init(void) · 19 unmodified lines
322317 mxsfb_pdata.mode_count = ARRAY_SIZE(apx4devkit_video_modes);
323318 mxsfb_pdata.default_bpp = 32;
324319 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
320+ mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT |
321+ MXSFB_SYNC_DOTCLK_FAILING_ACT;
325322 }
326323
327324 #define ENET0_MDC__GPIO_4_0 MXS_GPIO_NR(4, 0)
@@ -402,17 +399,18 @@ static void __init cfa10049_init(void) · 74 unmodified lines
402399 {
403400 enable_clk_enet_out();
404401 update_fec_mac_prop(OUI_CRYSTALFONTZ);
402+
403+ mxsfb_pdata.mode_list = cfa10049_video_modes;
404+ mxsfb_pdata.mode_count = ARRAY_SIZE(cfa10049_video_modes);
405+ mxsfb_pdata.default_bpp = 32;
406+ mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;
407+ mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT;
405408 }
406409
407410 static void __init cfa10037_init(void)
408411 {
409412 enable_clk_enet_out();
410413 update_fec_mac_prop(OUI_CRYSTALFONTZ);
411−
412− mxsfb_pdata.mode_list = cfa10049_video_modes;
413− mxsfb_pdata.mode_count = ARRAY_SIZE(cfa10049_video_modes);
414− mxsfb_pdata.default_bpp = 32;
415− mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;
416414 }
417415
418416 static void __init apf28_init(void)
@@ -423,6 +421,8 @@ static void __init apf28_init(void) · 4 unmodified lines
423421 mxsfb_pdata.mode_count = ARRAY_SIZE(apf28dev_video_modes);
424422 mxsfb_pdata.default_bpp = 16;
425423 mxsfb_pdata.ld_intf_width = STMLCDIF_16BIT;
424+ mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT |
425+ MXSFB_SYNC_DOTCLK_FAILING_ACT;
426426 }
427427
428428 static void __init mxs_machine_init(void)
arch/arm/mach-mxs/mm.c+1−0
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818
1919 #include <mach/mx23.h>
2020 #include <mach/mx28.h>
21+#include <mach/common.h>
2122
2223 /*
2324 * Define the MX23 memory map.
arch/arm/mach-mxs/ocotp.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <asm/processor.h> /* for cpu_relax() */
2020
2121 #include <mach/mxs.h>
22+#include <mach/common.h>
2223
2324 #define OCOTP_WORD_OFFSET 0x20
2425 #define OCOTP_WORD_COUNT 0x20
arch/arm/mach-omap1/clock_data.c+1−11
@@ -538,15 +538,6 @@ static struct clk usb_hhc_ck16xx = { · 537 unmodified lines
538538 };
539539
540540 static struct clk usb_dc_ck = {
541− .name = "usb_dc_ck",
542− .ops = &clkops_generic,
543− /* Direct from ULPD, no parent */
544− .rate = 48000000,
545− .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG),
546− .enable_bit = USB_REQ_EN_SHIFT,
547−};
548−
549−static struct clk usb_dc_ck7xx = {
550541 .name = "usb_dc_ck",
551542 .ops = &clkops_generic,
552543 /* Direct from ULPD, no parent */
@@ -727,8 +718,7 @@ static struct omap_clk omap_clks[] = { · 174 unmodified lines
727718 CLK(NULL, "usb_clko", &usb_clko, CK_16XX | CK_1510 | CK_310),
728719 CLK(NULL, "usb_hhc_ck", &usb_hhc_ck1510, CK_1510 | CK_310),
729720 CLK(NULL, "usb_hhc_ck", &usb_hhc_ck16xx, CK_16XX),
730− CLK(NULL, "usb_dc_ck", &usb_dc_ck, CK_16XX),
731− CLK(NULL, "usb_dc_ck", &usb_dc_ck7xx, CK_7XX),
721+ CLK(NULL, "usb_dc_ck", &usb_dc_ck, CK_16XX | CK_7XX),
732722 CLK(NULL, "mclk", &mclk_1510, CK_1510 | CK_310),
733723 CLK(NULL, "mclk", &mclk_16xx, CK_16XX),
734724 CLK(NULL, "bclk", &bclk_1510, CK_1510 | CK_310),
arch/arm/mach-omap1/common.h+2−0
@@ -31,6 +31,8 @@ · 30 unmodified lines
3131
3232 #include <plat/i2c.h>
3333
34+#include <mach/irqs.h>
35+
3436 #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
3537 void omap7xx_map_io(void);
3638 #else
arch/arm/mach-omap2/Kconfig+0−6
@@ -311,9 +311,6 @@ config MACH_OMAP_ZOOM2 · 310 unmodified lines
311311 default y
312312 select OMAP_PACKAGE_CBB
313313 select REGULATOR_FIXED_VOLTAGE if REGULATOR
314− select SERIAL_8250
315− select SERIAL_8250_CONSOLE
316− select SERIAL_CORE_CONSOLE
317314
318315 config MACH_OMAP_ZOOM3
319316 bool "OMAP3630 Zoom3 board"
@@ -321,9 +318,6 @@ config MACH_OMAP_ZOOM3 · 1 unmodified line
321318 default y
322319 select OMAP_PACKAGE_CBP
323320 select REGULATOR_FIXED_VOLTAGE if REGULATOR
324− select SERIAL_8250
325− select SERIAL_8250_CONSOLE
326− select SERIAL_CORE_CONSOLE
327321
328322 config MACH_CM_T35
329323 bool "CompuLab CM-T35/CM-T3730 modules"
arch/arm/mach-omap2/board-generic.c+2−0
@@ -102,6 +102,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)") · 101 unmodified lines
102102 .init_irq = omap_intc_of_init,
103103 .handle_irq = omap3_intc_handle_irq,
104104 .init_machine = omap_generic_init,
105+ .init_late = omap3_init_late,
105106 .init_time = omap3_sync32k_timer_init,
106107 .dt_compat = omap3_boards_compat,
107108 .restart = omap3xxx_restart,
@@ -119,6 +120,7 @@ DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)") · 11 unmodified lines
119120 .init_irq = omap_intc_of_init,
120121 .handle_irq = omap3_intc_handle_irq,
121122 .init_machine = omap_generic_init,
123+ .init_late = omap3_init_late,
122124 .init_time = omap3_secure_sync32k_timer_init,
123125 .dt_compat = omap3_gp_boards_compat,
124126 .restart = omap3xxx_restart,
arch/arm/mach-omap2/board-rx51.c+2−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <linux/io.h>
1818 #include <linux/gpio.h>
1919 #include <linux/leds.h>
20+#include <linux/usb/phy.h>
2021 #include <linux/usb/musb.h>
2122 #include <linux/platform_data/spi-omap2-mcspi.h>
2223
@@ -98,6 +99,7 @@ static void __init rx51_init(void) · 75 unmodified lines
9899 sdrc_params = nokia_get_sdram_timings();
99100 omap_sdrc_init(sdrc_params, sdrc_params);
100101
102+ usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
101103 usb_musb_init(&musb_board_data);
102104 rx51_peripherals_init();
103105
arch/arm/mach-omap2/cclock44xx_data.c+20−0
@@ -52,6 +52,13 @@ · 51 unmodified lines
5252 */
5353 #define OMAP4_DPLL_ABE_DEFFREQ 98304000
5454
55+/*
56+ * OMAP4 USB DPLL default frequency. In OMAP4430 TRM version V, section
57+ * "3.6.3.9.5 DPLL_USB Preferred Settings" shows that the preferred
58+ * locked frequency for the USB DPLL is 960MHz.
59+ */
60+#define OMAP4_DPLL_USB_DEFFREQ 960000000
61+
5562 /* Root clocks */
5663
5764 DEFINE_CLK_FIXED_RATE(extalt_clkin_ck, CLK_IS_ROOT, 59000000, 0x0);
@@ -1011,6 +1018,10 @@ DEFINE_CLK_OMAP_MUX(hsmmc2_fclk, "l3_init_clkdm", hsmmc1_fclk_sel, · 953 unmodified lines
10111018 OMAP4430_CM_L3INIT_MMC2_CLKCTRL, OMAP4430_CLKSEL_MASK,
10121019 hsmmc1_fclk_parents, func_dmic_abe_gfclk_ops);
10131020
1021+DEFINE_CLK_GATE(ocp2scp_usb_phy_phy_48m, "func_48m_fclk", &func_48m_fclk, 0x0,
1022+ OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL,
1023+ OMAP4430_OPTFCLKEN_PHY_48M_SHIFT, 0x0, NULL);
1024+
10141025 DEFINE_CLK_GATE(sha2md5_fck, "l3_div_ck", &l3_div_ck, 0x0,
10151026 OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL,
10161027 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
@@ -1538,6 +1549,7 @@ static struct omap_clk omap44xx_clks[] = { · 521 unmodified lines
15381549 CLK(NULL, "per_mcbsp4_gfclk", &per_mcbsp4_gfclk, CK_443X),
15391550 CLK(NULL, "hsmmc1_fclk", &hsmmc1_fclk, CK_443X),
15401551 CLK(NULL, "hsmmc2_fclk", &hsmmc2_fclk, CK_443X),
1552+ CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X),
15411553 CLK(NULL, "sha2md5_fck", &sha2md5_fck, CK_443X),
15421554 CLK(NULL, "slimbus1_fclk_1", &slimbus1_fclk_1, CK_443X),
15431555 CLK(NULL, "slimbus1_fclk_0", &slimbus1_fclk_0, CK_443X),
@@ -1705,5 +1717,13 @@ int __init omap4xxx_clk_init(void) · 161 unmodified lines
17051717 if (rc)
17061718 pr_err("%s: failed to configure ABE DPLL!\n", __func__);
17071719
1720+ /*
1721+ * Lock USB DPLL on OMAP4 devices so that the L3INIT power
1722+ * domain can transition to retention state when not in use.
1723+ */
1724+ rc = clk_set_rate(&dpll_usb_ck, OMAP4_DPLL_USB_DEFFREQ);
1725+ if (rc)
1726+ pr_err("%s: failed to configure USB DPLL!\n", __func__);
1727+
17081728 return 0;
17091729 }
arch/arm/mach-omap2/common.h+3−1
@@ -108,7 +108,6 @@ void omap35xx_init_late(void); · 107 unmodified lines
108108 void omap3630_init_late(void);
109109 void am35xx_init_late(void);
110110 void ti81xx_init_late(void);
111−void omap4430_init_late(void);
112111 int omap2_common_pm_late_init(void);
113112
114113 #if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430)
@@ -294,5 +293,8 @@ extern void omap_reserve(void); · 179 unmodified lines
294293 struct omap_hwmod;
295294 extern int omap_dss_reset(struct omap_hwmod *);
296295
296+/* SoC specific clock initializer */
297+extern int (*omap_clk_init)(void);
298+
297299 #endif /* __ASSEMBLER__ */
298300 #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
arch/arm/mach-omap2/gpmc.c+3−3
@@ -1122,9 +1122,6 @@ int gpmc_calc_timings(struct gpmc_timings *gpmc_t, · 1121 unmodified lines
11221122 /* TODO: remove, see function definition */
11231123 gpmc_convert_ps_to_ns(gpmc_t);
11241124
1125− /* Now the GPMC is initialised, unreserve the chip-selects */
1126− gpmc_cs_map = 0;
1127−
11281125 return 0;
11291126 }
11301127
@@ -1383,6 +1380,9 @@ static int gpmc_probe(struct platform_device *pdev) · 252 unmodified lines
13831380 if (IS_ERR_VALUE(gpmc_setup_irq()))
13841381 dev_warn(gpmc_dev, "gpmc_setup_irq failed\n");
13851382
1383+ /* Now the GPMC is initialised, unreserve the chip-selects */
1384+ gpmc_cs_map = 0;
1385+
13861386 rc = gpmc_probe_dt(pdev);
13871387 if (rc < 0) {
13881388 clk_disable_unprepare(gpmc_l3_clk);
arch/arm/mach-omap2/io.c+12−6
@@ -54,6 +54,12 @@ · 53 unmodified lines
5454 #include "prm3xxx.h"
5555 #include "prm44xx.h"
5656
57+/*
58+ * omap_clk_init: points to a function that does the SoC-specific
59+ * clock initializations
60+ */
61+int (*omap_clk_init)(void);
62+
5763 /*
5864 * The machine specific code may provide the extra mapping besides the
5965 * default mapping provided here.
@@ -397,7 +403,7 @@ void __init omap2420_init_early(void) · 337 unmodified lines
397403 omap242x_clockdomains_init();
398404 omap2420_hwmod_init();
399405 omap_hwmod_init_postsetup();
400− omap2420_clk_init();
406+ omap_clk_init = omap2420_clk_init;
401407 }
402408
403409 void __init omap2420_init_late(void)
@@ -427,7 +433,7 @@ void __init omap2430_init_early(void) · 23 unmodified lines
427433 omap243x_clockdomains_init();
428434 omap2430_hwmod_init();
429435 omap_hwmod_init_postsetup();
430− omap2430_clk_init();
436+ omap_clk_init = omap2430_clk_init;
431437 }
432438
433439 void __init omap2430_init_late(void)
@@ -462,7 +468,7 @@ void __init omap3_init_early(void) · 28 unmodified lines
462468 omap3xxx_clockdomains_init();
463469 omap3xxx_hwmod_init();
464470 omap_hwmod_init_postsetup();
465− omap3xxx_clk_init();
471+ omap_clk_init = omap3xxx_clk_init;
466472 }
467473
468474 void __init omap3430_init_early(void)
@@ -500,7 +506,7 @@ void __init ti81xx_init_early(void) · 31 unmodified lines
500506 omap3xxx_clockdomains_init();
501507 omap3xxx_hwmod_init();
502508 omap_hwmod_init_postsetup();
503− omap3xxx_clk_init();
509+ omap_clk_init = omap3xxx_clk_init;
504510 }
505511
506512 void __init omap3_init_late(void)
@@ -568,7 +574,7 @@ void __init am33xx_init_early(void) · 61 unmodified lines
568574 am33xx_clockdomains_init();
569575 am33xx_hwmod_init();
570576 omap_hwmod_init_postsetup();
571− am33xx_clk_init();
577+ omap_clk_init = am33xx_clk_init;
572578 }
573579 #endif
574580
@@ -593,7 +599,7 @@ void __init omap4430_init_early(void) · 18 unmodified lines
593599 omap44xx_clockdomains_init();
594600 omap44xx_hwmod_init();
595601 omap_hwmod_init_postsetup();
596− omap4xxx_clk_init();
602+ omap_clk_init = omap4xxx_clk_init;
597603 }
598604
599605 void __init omap4430_init_late(void)
arch/arm/mach-omap2/mux.c+5−4
@@ -211,8 +211,6 @@ static int __init _omap_mux_get_by_name(struct omap_mux_partition *partition, · 210 unmodified lines
211211 return -EINVAL;
212212 }
213213
214− pr_err("%s: Could not find signal %s\n", __func__, muxname);
215−
216214 return -ENODEV;
217215 }
218216
@@ -234,6 +232,8 @@ int __init omap_mux_get_by_name(const char *muxname, · 15 unmodified lines
234232 return mux_mode;
235233 }
236234
235+ pr_err("%s: Could not find signal %s\n", __func__, muxname);
236+
237237 return -ENODEV;
238238 }
239239
@@ -739,8 +739,9 @@ static void __init omap_mux_dbg_create_entry( · 499 unmodified lines
739739 list_for_each_entry(e, &partition->muxmodes, node) {
740740 struct omap_mux *m = &e->mux;
741741
742− (void)debugfs_create_file(m->muxnames[0], S_IWUSR, mux_dbg_dir,
743− m, &omap_mux_dbg_signal_fops);
742+ (void)debugfs_create_file(m->muxnames[0], S_IWUSR | S_IRUGO,
743+ mux_dbg_dir, m,
744+ &omap_mux_dbg_signal_fops);
744745 }
745746 }
746747
arch/arm/mach-omap2/omap_hwmod.c+5−2
@@ -1368,7 +1368,9 @@ static void _enable_sysc(struct omap_hwmod *oh) · 1367 unmodified lines
13681368 }
13691369
13701370 if (sf & SYSC_HAS_MIDLEMODE) {
1371− if (oh->flags & HWMOD_SWSUP_MSTANDBY) {
1371+ if (oh->flags & HWMOD_FORCE_MSTANDBY) {
1372+ idlemode = HWMOD_IDLEMODE_FORCE;
1373+ } else if (oh->flags & HWMOD_SWSUP_MSTANDBY) {
13721374 idlemode = HWMOD_IDLEMODE_NO;
13731375 } else {
13741376 if (sf & SYSC_HAS_ENAWAKEUP)
@@ -1440,7 +1442,8 @@ static void _idle_sysc(struct omap_hwmod *oh) · 65 unmodified lines
14401442 }
14411443
14421444 if (sf & SYSC_HAS_MIDLEMODE) {
1443− if (oh->flags & HWMOD_SWSUP_MSTANDBY) {
1445+ if ((oh->flags & HWMOD_SWSUP_MSTANDBY) ||
1446+ (oh->flags & HWMOD_FORCE_MSTANDBY)) {
14441447 idlemode = HWMOD_IDLEMODE_FORCE;
14451448 } else {
14461449 if (sf & SYSC_HAS_ENAWAKEUP)
arch/arm/mach-omap2/omap_hwmod.h+7−2
@@ -427,8 +427,8 @@ struct omap_hwmod_omap4_prcm { · 426 unmodified lines
427427 *
428428 * HWMOD_SWSUP_SIDLE: omap_hwmod code should manually bring module in and out
429429 * of idle, rather than relying on module smart-idle
430− * HWMOD_SWSUP_MSTDBY: omap_hwmod code should manually bring module in and out
431− * of standby, rather than relying on module smart-standby
430+ * HWMOD_SWSUP_MSTANDBY: omap_hwmod code should manually bring module in and
431+ * out of standby, rather than relying on module smart-standby
432432 * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for
433433 * SDRAM controller, etc. XXX probably belongs outside the main hwmod file
434434 * XXX Should be HWMOD_SETUP_NO_RESET
@@ -459,6 +459,10 @@ struct omap_hwmod_omap4_prcm { · 24 unmodified lines
459459 * correctly, or this is being abused to deal with some PM latency
460460 * issues -- but we're currently suffering from a shortage of
461461 * folks who are able to track these issues down properly.
462+ * HWMOD_FORCE_MSTANDBY: Always keep MIDLEMODE bits cleared so that device
463+ * is kept in force-standby mode. Failing to do so causes PM problems
464+ * with musb on OMAP3630 at least. Note that musb has a dedicated register
465+ * to control MSTANDBY signal when MIDLEMODE is set to force-standby.
462466 */
463467 #define HWMOD_SWSUP_SIDLE (1 << 0)
464468 #define HWMOD_SWSUP_MSTANDBY (1 << 1)
@@ -471,6 +475,7 @@ struct omap_hwmod_omap4_prcm { · 6 unmodified lines
471475 #define HWMOD_16BIT_REG (1 << 8)
472476 #define HWMOD_EXT_OPT_MAIN_CLK (1 << 9)
473477 #define HWMOD_BLOCK_WFI (1 << 10)
478+#define HWMOD_FORCE_MSTANDBY (1 << 11)
474479
475480 /*
476481 * omap_hwmod._int_flags definitions
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c+6−1
@@ -1707,9 +1707,14 @@ static struct omap_hwmod omap3xxx_usbhsotg_hwmod = { · 1706 unmodified lines
17071707 * Erratum ID: i479 idle_req / idle_ack mechanism potentially
17081708 * broken when autoidle is enabled
17091709 * workaround is to disable the autoidle bit at module level.
1710+ *
1711+ * Enabling the device in any other MIDLEMODE setting but force-idle
1712+ * causes core_pwrdm not enter idle states at least on OMAP3630.
1713+ * Note that musb has OTG_FORCESTDBY register that controls MSTANDBY
1714+ * signal when MIDLEMODE is set to force-idle.
17101715 */
17111716 .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE
1712− | HWMOD_SWSUP_MSTANDBY,
1717+ | HWMOD_FORCE_MSTANDBY,
17131718 };
17141719
17151720 /* usb_otg_hs */
arch/arm/mach-omap2/omap_hwmod_44xx_data.c+6−0
@@ -2714,6 +2714,10 @@ static struct omap_ocp2scp_dev ocp2scp_dev_attr[] = { · 2713 unmodified lines
27142714 { }
27152715 };
27162716
2717+static struct omap_hwmod_opt_clk ocp2scp_usb_phy_opt_clks[] = {
2718+ { .role = "48mhz", .clk = "ocp2scp_usb_phy_phy_48m" },
2719+};
2720+
27172721 /* ocp2scp_usb_phy */
27182722 static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = {
27192723 .name = "ocp2scp_usb_phy",
@@ -2728,6 +2732,8 @@ static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = { · 8 unmodified lines
27282732 },
27292733 },
27302734 .dev_attr = ocp2scp_dev_attr,
2735+ .opt_clks = ocp2scp_usb_phy_opt_clks,
2736+ .opt_clks_cnt = ARRAY_SIZE(ocp2scp_usb_phy_opt_clks),
27312737 };
27322738
27332739 /*
arch/arm/mach-omap2/timer.c+4−0
@@ -547,6 +547,8 @@ static inline void __init realtime_counter_init(void) · 546 unmodified lines
547547 clksrc_nr, clksrc_src) \
548548 void __init omap##name##_gptimer_timer_init(void) \
549549 { \
550+ if (omap_clk_init) \
551+ omap_clk_init(); \
550552 omap_dmtimer_init(); \
551553 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \
552554 omap2_gptimer_clocksource_init((clksrc_nr), clksrc_src); \
@@ -556,6 +558,8 @@ void __init omap##name##_gptimer_timer_init(void) \ · 3 unmodified lines
556558 clksrc_nr, clksrc_src) \
557559 void __init omap##name##_sync32k_timer_init(void) \
558560 { \
561+ if (omap_clk_init) \
562+ omap_clk_init(); \
559563 omap_dmtimer_init(); \
560564 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \
561565 /* Enable the use of clocksource="gp_timer" kernel parameter */ \
arch/arm/mach-pxa/raumfeld.c+1−0
@@ -505,6 +505,7 @@ static struct w1_gpio_platform_data w1_gpio_platform_data = { · 504 unmodified lines
505505 .pin = GPIO_ONE_WIRE,
506506 .is_open_drain = 0,
507507 .enable_external_pullup = w1_enable_external_pullup,
508+ .ext_pullup_enable_pin = -EINVAL,
508509 };
509510
510511 struct platform_device raumfeld_w1_gpio_device = {
arch/arm/mach-s3c24xx/include/mach/irqs.h+1−3
@@ -188,10 +188,8 @@ · 187 unmodified lines
188188
189189 #if defined(CONFIG_CPU_S3C2416)
190190 #define NR_IRQS (IRQ_S3C2416_I2S1 + 1)
191−#elif defined(CONFIG_CPU_S3C2443)
192−#define NR_IRQS (IRQ_S3C2443_AC97+1)
193191 #else
194−#define NR_IRQS (IRQ_S3C2440_AC97+1)
192+#define NR_IRQS (IRQ_S3C2443_AC97 + 1)
195193 #endif
196194
197195 /* compatibility define. */
arch/arm/mach-s3c24xx/irq.c+1−1
@@ -500,7 +500,7 @@ struct s3c_irq_intc *s3c24xx_init_intc(struct device_node *np, · 499 unmodified lines
500500 base = (void *)0xfd000000;
501501
502502 intc->reg_mask = base + 0xa4;
503− intc->reg_pending = base + 0x08;
503+ intc->reg_pending = base + 0xa8;
504504 irq_num = 20;
505505 irq_start = S3C2410_IRQ(32);
506506 irq_offset = 4;
arch/arm/mach-s5pv210/clock.c+18−18
@@ -214,11 +214,6 @@ static struct clk clk_pcmcdclk2 = { · 213 unmodified lines
214214 .name = "pcmcdclk",
215215 };
216216
217−static struct clk dummy_apb_pclk = {
218− .name = "apb_pclk",
219− .id = -1,
220−};
221−
222217 static struct clk *clkset_vpllsrc_list[] = {
223218 [0] = &clk_fin_vpll,
224219 [1] = &clk_sclk_hdmi27m,
@@ -305,18 +300,6 @@ static struct clk_ops clk_fout_apll_ops = { · 80 unmodified lines
305300
306301 static struct clk init_clocks_off[] = {
307302 {
308− .name = "dma",
309− .devname = "dma-pl330.0",
310− .parent = &clk_hclk_psys.clk,
311− .enable = s5pv210_clk_ip0_ctrl,
312− .ctrlbit = (1 << 3),
313− }, {
314− .name = "dma",
315− .devname = "dma-pl330.1",
316− .parent = &clk_hclk_psys.clk,
317− .enable = s5pv210_clk_ip0_ctrl,
318− .ctrlbit = (1 << 4),
319− }, {
320303 .name = "rot",
321304 .parent = &clk_hclk_dsys.clk,
322305 .enable = s5pv210_clk_ip0_ctrl,
@@ -573,6 +556,20 @@ static struct clk clk_hsmmc3 = { · 250 unmodified lines
573556 .ctrlbit = (1<<19),
574557 };
575558
559+static struct clk clk_pdma0 = {
560+ .name = "pdma0",
561+ .parent = &clk_hclk_psys.clk,
562+ .enable = s5pv210_clk_ip0_ctrl,
563+ .ctrlbit = (1 << 3),
564+};
565+
566+static struct clk clk_pdma1 = {
567+ .name = "pdma1",
568+ .parent = &clk_hclk_psys.clk,
569+ .enable = s5pv210_clk_ip0_ctrl,
570+ .ctrlbit = (1 << 4),
571+};
572+
576573 static struct clk *clkset_uart_list[] = {
577574 [6] = &clk_mout_mpll.clk,
578575 [7] = &clk_mout_epll.clk,
@@ -1075,6 +1072,8 @@ static struct clk *clk_cdev[] = { · 496 unmodified lines
10751072 &clk_hsmmc1,
10761073 &clk_hsmmc2,
10771074 &clk_hsmmc3,
1075+ &clk_pdma0,
1076+ &clk_pdma1,
10781077 };
10791078
10801079 /* Clock initialisation code */
@@ -1333,6 +1332,8 @@ static struct clk_lookup s5pv210_clk_lookup[] = { · 252 unmodified lines
13331332 CLKDEV_INIT(NULL, "spi_busclk0", &clk_p),
13341333 CLKDEV_INIT("s5pv210-spi.0", "spi_busclk1", &clk_sclk_spi0.clk),
13351334 CLKDEV_INIT("s5pv210-spi.1", "spi_busclk1", &clk_sclk_spi1.clk),
1335+ CLKDEV_INIT("dma-pl330.0", "apb_pclk", &clk_pdma0),
1336+ CLKDEV_INIT("dma-pl330.1", "apb_pclk", &clk_pdma1),
13361337 };
13371338
13381339 void __init s5pv210_register_clocks(void)
@@ -1361,6 +1362,5 @@ void __init s5pv210_register_clocks(void) · 22 unmodified lines
13611362 for (ptr = 0; ptr < ARRAY_SIZE(clk_cdev); ptr++)
13621363 s3c_disable_clocks(clk_cdev[ptr], 1);
13631364
1364− s3c24xx_register_clock(&dummy_apb_pclk);
13651365 s3c_pwmclk_init();
13661366 }
arch/arm/mach-s5pv210/mach-goni.c+1−1
@@ -845,7 +845,7 @@ static struct fimc_source_info goni_camera_sensors[] = { · 844 unmodified lines
845845 .mux_id = 0,
846846 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING |
847847 V4L2_MBUS_VSYNC_ACTIVE_LOW,
848− .bus_type = FIMC_BUS_TYPE_ITU_601,
848+ .fimc_bus_type = FIMC_BUS_TYPE_ITU_601,
849849 .board_info = &noon010pc30_board_info,
850850 .i2c_bus_num = 0,
851851 .clk_frequency = 16000000UL,
arch/arm/mach-shmobile/board-marzen.c+1−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include <linux/smsc911x.h>
3333 #include <linux/spi/spi.h>
3434 #include <linux/spi/sh_hspi.h>
35+#include <linux/mmc/host.h>
3536 #include <linux/mmc/sh_mobile_sdhi.h>
3637 #include <linux/mfd/tmio.h>
3738 #include <linux/usb/otg.h>
arch/arm/mach-spear3xx/spear3xx.c+1−1
@@ -14,7 +14,7 @@ · 13 unmodified lines
1414 #define pr_fmt(fmt) "SPEAr3xx: " fmt
1515
1616 #include <linux/amba/pl022.h>
17−#include <linux/amba/pl08x.h>
17+#include <linux/amba/pl080.h>
1818 #include <linux/io.h>
1919 #include <plat/pl080.h>
2020 #include <mach/generic.h>
arch/arm/mach-ux500/board-mop500-sdi.c+0−1
@@ -81,7 +81,6 @@ static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = { · 80 unmodified lines
8181 #endif
8282
8383 struct mmci_platform_data mop500_sdi0_data = {
84− .ios_handler = mop500_sdi0_ios_handler,
8584 .ocr_mask = MMC_VDD_29_30,
8685 .f_max = 50000000,
8786 .capabilities = MMC_CAP_4_BIT_DATA |
arch/arm/mach-ux500/board-mop500.c+12−0
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/init.h>
1313 #include <linux/interrupt.h>
1414 #include <linux/platform_device.h>
15+#include <linux/clk.h>
1516 #include <linux/io.h>
1617 #include <linux/i2c.h>
1718 #include <linux/platform_data/i2c-nomadik.h>
@@ -439,6 +440,15 @@ static void mop500_prox_deactivate(struct device *dev) · 421 unmodified lines
439440 regulator_put(prox_regulator);
440441 }
441442
443+void mop500_snowball_ethernet_clock_enable(void)
444+{
445+ struct clk *clk;
446+
447+ clk = clk_get_sys("fsmc", NULL);
448+ if (!IS_ERR(clk))
449+ clk_prepare_enable(clk);
450+}
451+
442452 static struct cryp_platform_data u8500_cryp1_platform_data = {
443453 .mem_to_engine = {
444454 .dir = STEDMA40_MEM_TO_PERIPH,
@@ -683,6 +693,8 @@ static void __init snowball_init_machine(void) · 238 unmodified lines
683693 mop500_audio_init(parent);
684694 mop500_uart_init(parent);
685695
696+ mop500_snowball_ethernet_clock_enable();
697+
686698 /* This board has full regulator constraints */
687699 regulator_has_full_constraints();
688700 }
arch/arm/mach-ux500/board-mop500.h+1−0
@@ -104,6 +104,7 @@ void __init mop500_pinmaps_init(void); · 103 unmodified lines
104104 void __init snowball_pinmaps_init(void);
105105 void __init hrefv60_pinmaps_init(void);
106106 void mop500_audio_init(struct device *parent);
107+void mop500_snowball_ethernet_clock_enable(void);
107108
108109 int __init mop500_uib_init(void);
109110 void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info,
arch/arm/mach-ux500/cpu-db8500.c+3−2
@@ -312,9 +312,10 @@ static void __init u8500_init_machine(void) · 311 unmodified lines
312312 /* Pinmaps must be in place before devices register */
313313 if (of_machine_is_compatible("st-ericsson,mop500"))
314314 mop500_pinmaps_init();
315− else if (of_machine_is_compatible("calaosystems,snowball-a9500"))
315+ else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {
316316 snowball_pinmaps_init();
317− else if (of_machine_is_compatible("st-ericsson,hrefv60+"))
317+ mop500_snowball_ethernet_clock_enable();
318+ } else if (of_machine_is_compatible("st-ericsson,hrefv60+"))
318319 hrefv60_pinmaps_init();
319320 else if (of_machine_is_compatible("st-ericsson,ccu9540")) {}
320321 /* TODO: Add pinmaps for ccu9540 board. */
arch/arm/mm/Kconfig+1−4
@@ -43,7 +43,7 @@ config CPU_ARM740T · 42 unmodified lines
4343 depends on !MMU
4444 select CPU_32v4T
4545 select CPU_ABRT_LV4T
46− select CPU_CACHE_V3 # although the core is v4t
46+ select CPU_CACHE_V4
4747 select CPU_CP15_MPU
4848 select CPU_PABRT_LEGACY
4949 help
@@ -469,9 +469,6 @@ config CPU_PABRT_V7 · 419 unmodified lines
469469 bool
470470
471471 # The cache model
472−config CPU_CACHE_V3
473− bool
474−
475472 config CPU_CACHE_V4
476473 bool
477474
arch/arm/mm/Makefile+0−1
@@ -33,7 +33,6 @@ obj-$(CONFIG_CPU_PABRT_LEGACY) += pabort-legacy.o · 32 unmodified lines
3333 obj-$(CONFIG_CPU_PABRT_V6) += pabort-v6.o
3434 obj-$(CONFIG_CPU_PABRT_V7) += pabort-v7.o
3535
36−obj-$(CONFIG_CPU_CACHE_V3) += cache-v3.o
3736 obj-$(CONFIG_CPU_CACHE_V4) += cache-v4.o
3837 obj-$(CONFIG_CPU_CACHE_V4WT) += cache-v4wt.o
3938 obj-$(CONFIG_CPU_CACHE_V4WB) += cache-v4wb.o
arch/arm/mm/cache-feroceon-l2.c+1−0
@@ -343,6 +343,7 @@ void __init feroceon_l2_init(int __l2_wt_override) · 342 unmodified lines
343343 outer_cache.inv_range = feroceon_l2_inv_range;
344344 outer_cache.clean_range = feroceon_l2_clean_range;
345345 outer_cache.flush_range = feroceon_l2_flush_range;
346+ outer_cache.inv_all = l2_inv_all;
346347
347348 enable_l2();
348349
arch/arm/mm/cache-l2x0.c+4−7
@@ -299,7 +299,7 @@ static void l2x0_unlock(u32 cache_id) · 298 unmodified lines
299299 int lockregs;
300300 int i;
301301
302− switch (cache_id) {
302+ switch (cache_id & L2X0_CACHE_ID_PART_MASK) {
303303 case L2X0_CACHE_ID_PART_L310:
304304 lockregs = 8;
305305 break;
@@ -333,15 +333,14 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask) · 27 unmodified lines
333333 if (cache_id_part_number_from_dt)
334334 cache_id = cache_id_part_number_from_dt;
335335 else
336− cache_id = readl_relaxed(l2x0_base + L2X0_CACHE_ID)
337− & L2X0_CACHE_ID_PART_MASK;
336+ cache_id = readl_relaxed(l2x0_base + L2X0_CACHE_ID);
338337 aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL);
339338
340339 aux &= aux_mask;
341340 aux |= aux_val;
342341
343342 /* Determine the number of ways */
344− switch (cache_id) {
343+ switch (cache_id & L2X0_CACHE_ID_PART_MASK) {
345344 case L2X0_CACHE_ID_PART_L310:
346345 if (aux & (1 << 16))
347346 ways = 16;
@@ -725,7 +724,6 @@ static const struct l2x0_of_data pl310_data = { · 377 unmodified lines
725724 .flush_all = l2x0_flush_all,
726725 .inv_all = l2x0_inv_all,
727726 .disable = l2x0_disable,
728− .set_debug = pl310_set_debug,
729727 },
730728 };
731729
@@ -814,9 +812,8 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask) · 82 unmodified lines
814812 data->save();
815813
816814 of_init = true;
817− l2x0_init(l2x0_base, aux_val, aux_mask);
818−
819815 memcpy(&outer_cache, &data->outer_cache, sizeof(outer_cache));
816+ l2x0_init(l2x0_base, aux_val, aux_mask);
820817
821818 return 0;
822819 }
arch/arm/mm/cache-v3.S+0−137
@@ -1,137 +0,0 @@
1−/*
2− * linux/arch/arm/mm/cache-v3.S
3− *
4− * Copyright (C) 1997-2002 Russell king
5− *
6− * This program is free software; you can redistribute it and/or modify
7− * it under the terms of the GNU General Public License version 2 as
8− * published by the Free Software Foundation.
9− */
10−#include <linux/linkage.h>
11−#include <linux/init.h>
12−#include <asm/page.h>
13−#include "proc-macros.S"
14−
15−/*
16− * flush_icache_all()
17− *
18− * Unconditionally clean and invalidate the entire icache.
19− */
20−ENTRY(v3_flush_icache_all)
21− mov pc, lr
22−ENDPROC(v3_flush_icache_all)
23−
24−/*
25− * flush_user_cache_all()
26− *
27− * Invalidate all cache entries in a particular address
28− * space.
29− *
30− * - mm - mm_struct describing address space
31− */
32−ENTRY(v3_flush_user_cache_all)
33− /* FALLTHROUGH */
34−/*
35− * flush_kern_cache_all()
36− *
37− * Clean and invalidate the entire cache.
38− */
39−ENTRY(v3_flush_kern_cache_all)
40− /* FALLTHROUGH */
41−
42−/*
43− * flush_user_cache_range(start, end, flags)
44− *
45− * Invalidate a range of cache entries in the specified
46− * address space.
47− *
48− * - start - start address (may not be aligned)
49− * - end - end address (exclusive, may not be aligned)
50− * - flags - vma_area_struct flags describing address space
51− */
52−ENTRY(v3_flush_user_cache_range)
53− mov ip, #0
54− mcreq p15, 0, ip, c7, c0, 0 @ flush ID cache
55− mov pc, lr
56−
57−/*
58− * coherent_kern_range(start, end)
59− *
60− * Ensure coherency between the Icache and the Dcache in the
61− * region described by start. If you have non-snooping
62− * Harvard caches, you need to implement this function.
63− *
64− * - start - virtual start address
65− * - end - virtual end address
66− */
67−ENTRY(v3_coherent_kern_range)
68− /* FALLTHROUGH */
69−
70−/*
71− * coherent_user_range(start, end)
72− *
73− * Ensure coherency between the Icache and the Dcache in the
74− * region described by start. If you have non-snooping
75− * Harvard caches, you need to implement this function.
76− *
77− * - start - virtual start address
78− * - end - virtual end address
79− */
80−ENTRY(v3_coherent_user_range)
81− mov r0, #0
82− mov pc, lr
83−
84−/*
85− * flush_kern_dcache_area(void *page, size_t size)
86− *
87− * Ensure no D cache aliasing occurs, either with itself or
88− * the I cache
89− *
90− * - addr - kernel address
91− * - size - region size
92− */
93−ENTRY(v3_flush_kern_dcache_area)
94− /* FALLTHROUGH */
95−
96−/*
97− * dma_flush_range(start, end)
98− *
99− * Clean and invalidate the specified virtual address range.
100− *
101− * - start - virtual start address
102− * - end - virtual end address
103− */
104−ENTRY(v3_dma_flush_range)
105− mov r0, #0
106− mcr p15, 0, r0, c7, c0, 0 @ flush ID cache
107− mov pc, lr
108−
109−/*
110− * dma_unmap_area(start, size, dir)
111− * - start - kernel virtual start address
112− * - size - size of region
113− * - dir - DMA direction
114− */
115−ENTRY(v3_dma_unmap_area)
116− teq r2, #DMA_TO_DEVICE
117− bne v3_dma_flush_range
118− /* FALLTHROUGH */
119−
120−/*
121− * dma_map_area(start, size, dir)
122− * - start - kernel virtual start address
123− * - size - size of region
124− * - dir - DMA direction
125− */
126−ENTRY(v3_dma_map_area)
127− mov pc, lr
128−ENDPROC(v3_dma_unmap_area)
129−ENDPROC(v3_dma_map_area)
130−
131− .globl v3_flush_kern_cache_louis
132− .equ v3_flush_kern_cache_louis, v3_flush_kern_cache_all
133−
134− __INITDATA
135−
136− @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
137− define_cache_functions v3
arch/arm/mm/cache-v4.S+1−1
@@ -58,7 +58,7 @@ ENTRY(v4_flush_kern_cache_all) · 57 unmodified lines
5858 ENTRY(v4_flush_user_cache_range)
5959 #ifdef CONFIG_CPU_CP15
6060 mov ip, #0
61− mcreq p15, 0, ip, c7, c7, 0 @ flush ID cache
61+ mcr p15, 0, ip, c7, c7, 0 @ flush ID cache
6262 mov pc, lr
6363 #else
6464 /* FALLTHROUGH */
arch/arm/mm/context.c+2−1
@@ -48,7 +48,7 @@ static DEFINE_RAW_SPINLOCK(cpu_asid_lock); · 47 unmodified lines
4848 static atomic64_t asid_generation = ATOMIC64_INIT(ASID_FIRST_VERSION);
4949 static DECLARE_BITMAP(asid_map, NUM_USER_ASIDS);
5050
51−static DEFINE_PER_CPU(atomic64_t, active_asids);
51+DEFINE_PER_CPU(atomic64_t, active_asids);
5252 static DEFINE_PER_CPU(u64, reserved_asids);
5353 static cpumask_t tlb_flush_pending;
5454
@@ -215,6 +215,7 @@ void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk) · 160 unmodified lines
215215 if (cpumask_test_and_clear_cpu(cpu, &tlb_flush_pending)) {
216216 local_flush_bp_all();
217217 local_flush_tlb_all();
218+ dummy_flush_tlb_a15_erratum();
218219 }
219220
220221 atomic64_set(&per_cpu(active_asids, cpu), asid);
arch/arm/mm/dma-mapping.c+3−2
@@ -342,6 +342,7 @@ static int __init atomic_pool_init(void) · 341 unmodified lines
342342 {
343343 struct dma_pool *pool = &atomic_pool;
344344 pgprot_t prot = pgprot_dmacoherent(pgprot_kernel);
345+ gfp_t gfp = GFP_KERNEL | GFP_DMA;
345346 unsigned long nr_pages = pool->size >> PAGE_SHIFT;
346347 unsigned long *bitmap;
347348 struct page *page;
@@ -361,8 +362,8 @@ static int __init atomic_pool_init(void) · 13 unmodified lines
361362 ptr = __alloc_from_contiguous(NULL, pool->size, prot, &page,
362363 atomic_pool_init);
363364 else
364− ptr = __alloc_remap_buffer(NULL, pool->size, GFP_KERNEL, prot,
365− &page, atomic_pool_init);
365+ ptr = __alloc_remap_buffer(NULL, pool->size, gfp, prot, &page,
366+ atomic_pool_init);
366367 if (ptr) {
367368 int i;
368369
arch/arm/mm/mmu.c+49−26
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 #include <asm/mach/pci.h>
3535
3636 #include "mm.h"
37+#include "tcm.h"
3738
3839 /*
3940 * empty_zero_page is a special page that is used for
@@ -598,39 +599,60 @@ static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr, · 558 unmodified lines
598599 } while (pte++, addr += PAGE_SIZE, addr != end);
599600 }
600601
601−static void __init alloc_init_section(pud_t *pud, unsigned long addr,
602− unsigned long end, phys_addr_t phys,
603− const struct mem_type *type)
602+static void __init map_init_section(pmd_t *pmd, unsigned long addr,
603+ unsigned long end, phys_addr_t phys,
604+ const struct mem_type *type)
604605 {
605− pmd_t *pmd = pmd_offset(pud, addr);
606−
606+#ifndef CONFIG_ARM_LPAE
607607 /*
608− * Try a section mapping - end, addr and phys must all be aligned
609− * to a section boundary. Note that PMDs refer to the individual
610− * L1 entries, whereas PGDs refer to a group of L1 entries making
611− * up one logical pointer to an L2 table.
608+ * In classic MMU format, puds and pmds are folded in to
609+ * the pgds. pmd_offset gives the PGD entry. PGDs refer to a
610+ * group of L1 entries making up one logical pointer to
611+ * an L2 table (2MB), where as PMDs refer to the individual
612+ * L1 entries (1MB). Hence increment to get the correct
613+ * offset for odd 1MB sections.
614+ * (See arch/arm/include/asm/pgtable-2level.h)
612615 */
613− if (type->prot_sect && ((addr | end | phys) & ~SECTION_MASK) == 0) {
614− pmd_t *p = pmd;
615−
616−#ifndef CONFIG_ARM_LPAE
617− if (addr & SECTION_SIZE)
618− pmd++;
616+ if (addr & SECTION_SIZE)
617+ pmd++;
619618 #endif
619+ do {
620+ *pmd = __pmd(phys | type->prot_sect);
621+ phys += SECTION_SIZE;
622+ } while (pmd++, addr += SECTION_SIZE, addr != end);
620623
621− do {
622− *pmd = __pmd(phys | type->prot_sect);
623− phys += SECTION_SIZE;
624− } while (pmd++, addr += SECTION_SIZE, addr != end);
624+ flush_pmd_entry(pmd);
625+}
625626
626− flush_pmd_entry(p);
627− } else {
627+static void __init alloc_init_pmd(pud_t *pud, unsigned long addr,
628+ unsigned long end, phys_addr_t phys,
629+ const struct mem_type *type)
630+{
631+ pmd_t *pmd = pmd_offset(pud, addr);
632+ unsigned long next;
633+
634+ do {
628635 /*
629− * No need to loop; pte's aren't interested in the
630− * individual L1 entries.
636+ * With LPAE, we must loop over to map
637+ * all the pmds for the given range.
631638 */
632− alloc_init_pte(pmd, addr, end, __phys_to_pfn(phys), type);
633− }
639+ next = pmd_addr_end(addr, end);
640+
641+ /*
642+ * Try a section mapping - addr, next and phys must all be
643+ * aligned to a section boundary.
644+ */
645+ if (type->prot_sect &&
646+ ((addr | next | phys) & ~SECTION_MASK) == 0) {
647+ map_init_section(pmd, addr, next, phys, type);
648+ } else {
649+ alloc_init_pte(pmd, addr, next,
650+ __phys_to_pfn(phys), type);
651+ }
652+
653+ phys += next - addr;
654+
655+ } while (pmd++, addr = next, addr != end);
634656 }
635657
636658 static void __init alloc_init_pud(pgd_t *pgd, unsigned long addr,
@@ -641,7 +663,7 @@ static void __init alloc_init_pud(pgd_t *pgd, unsigned long addr, · 4 unmodified lines
641663
642664 do {
643665 next = pud_addr_end(addr, end);
644− alloc_init_section(pud, addr, next, phys, type);
666+ alloc_init_pmd(pud, addr, next, phys, type);
645667 phys += next - addr;
646668 } while (pud++, addr = next, addr != end);
647669 }
@@ -1256,6 +1278,7 @@ void __init paging_init(struct machine_desc *mdesc) · 608 unmodified lines
12561278 dma_contiguous_remap();
12571279 devicemaps_init(mdesc);
12581280 kmap_init();
1281+ tcm_init();
12591282
12601283 top_pmd = pmd_off_k(0xffff0000);
12611284
arch/arm/mm/proc-arm740.S+17−13
@@ -77,24 +77,27 @@ __arm740_setup: · 76 unmodified lines
7777 mcr p15, 0, r0, c6, c0 @ set area 0, default
7878
7979 ldr r0, =(CONFIG_DRAM_BASE & 0xFFFFF000) @ base[31:12] of RAM
80− ldr r1, =(CONFIG_DRAM_SIZE >> 12) @ size of RAM (must be >= 4KB)
81− mov r2, #10 @ 11 is the minimum (4KB)
82−1: add r2, r2, #1 @ area size *= 2
83− mov r1, r1, lsr #1
80+ ldr r3, =(CONFIG_DRAM_SIZE >> 12) @ size of RAM (must be >= 4KB)
81+ mov r4, #10 @ 11 is the minimum (4KB)
82+1: add r4, r4, #1 @ area size *= 2
83+ movs r3, r3, lsr #1
8484 bne 1b @ count not zero r-shift
85− orr r0, r0, r2, lsl #1 @ the area register value
85+ orr r0, r0, r4, lsl #1 @ the area register value
8686 orr r0, r0, #1 @ set enable bit
8787 mcr p15, 0, r0, c6, c1 @ set area 1, RAM
8888
8989 ldr r0, =(CONFIG_FLASH_MEM_BASE & 0xFFFFF000) @ base[31:12] of FLASH
90− ldr r1, =(CONFIG_FLASH_SIZE >> 12) @ size of FLASH (must be >= 4KB)
91− mov r2, #10 @ 11 is the minimum (4KB)
92−1: add r2, r2, #1 @ area size *= 2
93− mov r1, r1, lsr #1
90+ ldr r3, =(CONFIG_FLASH_SIZE >> 12) @ size of FLASH (must be >= 4KB)
91+ cmp r3, #0
92+ moveq r0, #0
93+ beq 2f
94+ mov r4, #10 @ 11 is the minimum (4KB)
95+1: add r4, r4, #1 @ area size *= 2
96+ movs r3, r3, lsr #1
9497 bne 1b @ count not zero r-shift
95− orr r0, r0, r2, lsl #1 @ the area register value
98+ orr r0, r0, r4, lsl #1 @ the area register value
9699 orr r0, r0, #1 @ set enable bit
97− mcr p15, 0, r0, c6, c2 @ set area 2, ROM/FLASH
100+2: mcr p15, 0, r0, c6, c2 @ set area 2, ROM/FLASH
98101
99102 mov r0, #0x06
100103 mcr p15, 0, r0, c2, c0 @ Region 1&2 cacheable
@@ -137,13 +140,14 @@ __arm740_proc_info: · 36 unmodified lines
137140 .long 0x41807400
138141 .long 0xfffffff0
139142 .long 0
143+ .long 0
140144 b __arm740_setup
141145 .long cpu_arch_name
142146 .long cpu_elf_name
143− .long HWCAP_SWP | HWCAP_HALF | HWCAP_26BIT
147+ .long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB | HWCAP_26BIT
144148 .long cpu_arm740_name
145149 .long arm740_processor_functions
146150 .long 0
147151 .long 0
148− .long v3_cache_fns @ cache model
152+ .long v4_cache_fns @ cache model
149153 .size __arm740_proc_info, . - __arm740_proc_info
arch/arm/mm/proc-arm920.S+1−1
@@ -387,7 +387,7 @@ ENTRY(cpu_arm920_set_pte_ext) · 386 unmodified lines
387387 /* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */
388388 .globl cpu_arm920_suspend_size
389389 .equ cpu_arm920_suspend_size, 4 * 3
390−#ifdef CONFIG_PM_SLEEP
390+#ifdef CONFIG_ARM_CPU_SUSPEND
391391 ENTRY(cpu_arm920_do_suspend)
392392 stmfd sp!, {r4 - r6, lr}
393393 mrc p15, 0, r4, c13, c0, 0 @ PID
arch/arm/mm/proc-arm926.S+1−1
@@ -402,7 +402,7 @@ ENTRY(cpu_arm926_set_pte_ext) · 401 unmodified lines
402402 /* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */
403403 .globl cpu_arm926_suspend_size
404404 .equ cpu_arm926_suspend_size, 4 * 3
405−#ifdef CONFIG_PM_SLEEP
405+#ifdef CONFIG_ARM_CPU_SUSPEND
406406 ENTRY(cpu_arm926_do_suspend)
407407 stmfd sp!, {r4 - r6, lr}
408408 mrc p15, 0, r4, c13, c0, 0 @ PID
arch/arm/mm/proc-mohawk.S+1−1
@@ -350,7 +350,7 @@ ENTRY(cpu_mohawk_set_pte_ext) · 349 unmodified lines
350350
351351 .globl cpu_mohawk_suspend_size
352352 .equ cpu_mohawk_suspend_size, 4 * 6
353−#ifdef CONFIG_PM_SLEEP
353+#ifdef CONFIG_ARM_CPU_SUSPEND
354354 ENTRY(cpu_mohawk_do_suspend)
355355 stmfd sp!, {r4 - r9, lr}
356356 mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
arch/arm/mm/proc-sa1100.S+1−1
@@ -172,7 +172,7 @@ ENTRY(cpu_sa1100_set_pte_ext) · 171 unmodified lines
172172
173173 .globl cpu_sa1100_suspend_size
174174 .equ cpu_sa1100_suspend_size, 4 * 3
175−#ifdef CONFIG_PM_SLEEP
175+#ifdef CONFIG_ARM_CPU_SUSPEND
176176 ENTRY(cpu_sa1100_do_suspend)
177177 stmfd sp!, {r4 - r6, lr}
178178 mrc p15, 0, r4, c3, c0, 0 @ domain ID
arch/arm/mm/proc-syms.c+2−0
@@ -17,7 +17,9 @@ · 16 unmodified lines
1717
1818 #ifndef MULTI_CPU
1919 EXPORT_SYMBOL(cpu_dcache_clean_area);
20+#ifdef CONFIG_MMU
2021 EXPORT_SYMBOL(cpu_set_pte_ext);
22+#endif
2123 #else
2224 EXPORT_SYMBOL(processor);
2325 #endif
arch/arm/mm/proc-v6.S+1−1
@@ -138,7 +138,7 @@ ENTRY(cpu_v6_set_pte_ext) · 137 unmodified lines
138138 /* Suspend/resume support: taken from arch/arm/mach-s3c64xx/sleep.S */
139139 .globl cpu_v6_suspend_size
140140 .equ cpu_v6_suspend_size, 4 * 6
141−#ifdef CONFIG_PM_SLEEP
141+#ifdef CONFIG_ARM_CPU_SUSPEND
142142 ENTRY(cpu_v6_do_suspend)
143143 stmfd sp!, {r4 - r9, lr}
144144 mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
arch/arm/mm/proc-v7.S+17−2
@@ -420,7 +420,7 @@ __v7_pj4b_proc_info: · 419 unmodified lines
420420 __v7_ca7mp_proc_info:
421421 .long 0x410fc070
422422 .long 0xff0ffff0
423− __v7_proc __v7_ca7mp_setup, hwcaps = HWCAP_IDIV
423+ __v7_proc __v7_ca7mp_setup
424424 .size __v7_ca7mp_proc_info, . - __v7_ca7mp_proc_info
425425
426426 /*
@@ -430,9 +430,24 @@ __v7_ca7mp_proc_info: · 3 unmodified lines
430430 __v7_ca15mp_proc_info:
431431 .long 0x410fc0f0
432432 .long 0xff0ffff0
433− __v7_proc __v7_ca15mp_setup, hwcaps = HWCAP_IDIV
433+ __v7_proc __v7_ca15mp_setup
434434 .size __v7_ca15mp_proc_info, . - __v7_ca15mp_proc_info
435435
436+ /*
437+ * Qualcomm Inc. Krait processors.
438+ */
439+ .type __krait_proc_info, #object
440+__krait_proc_info:
441+ .long 0x510f0400 @ Required ID value
442+ .long 0xff0ffc00 @ Mask for ID
443+ /*
444+ * Some Krait processors don't indicate support for SDIV and UDIV
445+ * instructions in the ARM instruction set, even though they actually
446+ * do support them.
447+ */
448+ __v7_proc __v7_setup, hwcaps = HWCAP_IDIV
449+ .size __krait_proc_info, . - __krait_proc_info
450+
436451 /*
437452 * Match any ARMv7 processor core.
438453 */
arch/arm/mm/proc-xsc3.S+1−1
@@ -413,7 +413,7 @@ ENTRY(cpu_xsc3_set_pte_ext) · 412 unmodified lines
413413
414414 .globl cpu_xsc3_suspend_size
415415 .equ cpu_xsc3_suspend_size, 4 * 6
416−#ifdef CONFIG_PM_SLEEP
416+#ifdef CONFIG_ARM_CPU_SUSPEND
417417 ENTRY(cpu_xsc3_do_suspend)
418418 stmfd sp!, {r4 - r9, lr}
419419 mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
arch/arm/mm/proc-xscale.S+1−1
@@ -528,7 +528,7 @@ ENTRY(cpu_xscale_set_pte_ext) · 527 unmodified lines
528528
529529 .globl cpu_xscale_suspend_size
530530 .equ cpu_xscale_suspend_size, 4 * 6
531−#ifdef CONFIG_PM_SLEEP
531+#ifdef CONFIG_ARM_CPU_SUSPEND
532532 ENTRY(cpu_xscale_do_suspend)
533533 stmfd sp!, {r4 - r9, lr}
534534 mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
arch/arm/mm/tcm.hrenamed from arch/arm/kernel/tcm.h+0−0

File renamed without changes.

arch/arm/net/bpf_jit_32.c+1−1
@@ -576,7 +576,7 @@ load_ind: · 575 unmodified lines
576576 /* x = ((*(frame + k)) & 0xf) << 2; */
577577 ctx->seen |= SEEN_X | SEEN_DATA | SEEN_CALL;
578578 /* the interpreter should deal with the negative K */
579− if (k < 0)
579+ if ((int)k < 0)
580580 return -1;
581581 /* offset in r1: we might have to take the slow path */
582582 emit_mov_i(r_off, k, ctx);
arch/arm/plat-orion/addr-map.c+5−2
@@ -157,9 +157,12 @@ void __init orion_setup_cpu_mbus_target(const struct orion_addr_map_cfg *cfg, · 156 unmodified lines
157157 u32 size = readl(ddr_window_cpu_base + DDR_SIZE_CS_OFF(i));
158158
159159 /*
160− * Chip select enabled?
160+ * We only take care of entries for which the chip
161+ * select is enabled, and that don't have high base
162+ * address bits set (devices can only access the first
163+ * 32 bits of the memory).
161164 */
162− if (size & 1) {
165+ if ((size & 1) && !(base & 0xF)) {
163166 struct mbus_dram_window *w;
164167
165168 w = &orion_mbus_dram_info.cs[cs++];
arch/arm/plat-spear/Kconfig+1−1
@@ -10,7 +10,7 @@ choice · 9 unmodified lines
1010
1111 config ARCH_SPEAR13XX
1212 bool "ST SPEAr13xx with Device Tree"
13− select ARCH_HAVE_CPUFREQ
13+ select ARCH_HAS_CPUFREQ
1414 select ARM_GIC
1515 select CPU_V7
1616 select GPIO_SPEAR_SPICS
arch/arm64/Kconfig+0−1
@@ -9,7 +9,6 @@ config ARM64 · 8 unmodified lines
99 select CLONE_BACKWARDS
1010 select COMMON_CLK
1111 select GENERIC_CLOCKEVENTS
12− select GENERIC_HARDIRQS_NO_DEPRECATED
1312 select GENERIC_IOMAP
1413 select GENERIC_IRQ_PROBE
1514 select GENERIC_IRQ_SHOW
arch/arm64/Kconfig.debug+0−11
@@ -6,17 +6,6 @@ config FRAME_POINTER · 5 unmodified lines
66 bool
77 default y
88
9−config DEBUG_ERRORS
10− bool "Verbose kernel error messages"
11− depends on DEBUG_KERNEL
12− help
13− This option controls verbose debugging information which can be
14− printed when the kernel detects an internal error. This debugging
15− information is useful to kernel hackers when tracking down problems,
16− but mostly meaningless to other people. It's safe to say Y unless
17− you are concerned with the code size or don't want to see these
18− messages.
19−
209 config DEBUG_STACK_USAGE
2110 bool "Enable stack utilization instrumentation"
2211 depends on DEBUG_KERNEL
arch/arm64/configs/defconfig+0−1
@@ -82,4 +82,3 @@ CONFIG_DEBUG_KERNEL=y · 81 unmodified lines
8282 CONFIG_DEBUG_INFO=y
8383 # CONFIG_FTRACE is not set
8484 CONFIG_ATOMIC64_SELFTEST=y
85−CONFIG_DEBUG_ERRORS=y
arch/arm64/include/asm/ucontext.h+1−1
@@ -22,7 +22,7 @@ struct ucontext { · 21 unmodified lines
2222 stack_t uc_stack;
2323 sigset_t uc_sigmask;
2424 /* glibc uses a 1024-bit sigset_t */
25− __u8 __unused[(1024 - sizeof(sigset_t)) / 8];
25+ __u8 __unused[1024 / 8 - sizeof(sigset_t)];
2626 /* last for future expansion */
2727 struct sigcontext uc_mcontext;
2828 };
arch/arm64/kernel/arm64ksyms.c+2−0
@@ -40,7 +40,9 @@ EXPORT_SYMBOL(__copy_to_user); · 39 unmodified lines
4040 EXPORT_SYMBOL(__clear_user);
4141
4242 /* bitops */
43+#ifdef CONFIG_SMP
4344 EXPORT_SYMBOL(__atomic_hash);
45+#endif
4446
4547 /* physical memory */
4648 EXPORT_SYMBOL(memstart_addr);
arch/arm64/kernel/signal32.c+0−1
@@ -549,7 +549,6 @@ int compat_setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, · 548 unmodified lines
549549 sigset_t *set, struct pt_regs *regs)
550550 {
551551 struct compat_rt_sigframe __user *frame;
552− compat_stack_t stack;
553552 int err = 0;
554553
555554 frame = compat_get_sigframe(ka, regs, sizeof(*frame));
arch/arm64/mm/mmu.c+1−1
@@ -261,7 +261,7 @@ static void __init create_mapping(phys_addr_t phys, unsigned long virt, · 260 unmodified lines
261261 void __iomem * __init early_io_map(phys_addr_t phys, unsigned long virt)
262262 {
263263 unsigned long size, mask;
264− bool page64k = IS_ENABLED(ARM64_64K_PAGES);
264+ bool page64k = IS_ENABLED(CONFIG_ARM64_64K_PAGES);
265265 pgd_t *pgd;
266266 pud_t *pud;
267267 pmd_t *pmd;
arch/avr32/Kconfig+1−1
@@ -7,7 +7,7 @@ config AVR32 · 6 unmodified lines
77 select HAVE_OPROFILE
88 select HAVE_KPROBES
99 select HAVE_GENERIC_HARDIRQS
10− select HAVE_VIRT_TO_BUS
10+ select VIRT_TO_BUS
1111 select GENERIC_IRQ_PROBE
1212 select GENERIC_ATOMIC64
1313 select HARDIRQS_SW_RESEND
arch/avr32/include/asm/io.h+4−0
@@ -165,6 +165,10 @@ BUILDIO_IOPORT(l, u32) · 164 unmodified lines
165165 #define readw_be __raw_readw
166166 #define readl_be __raw_readl
167167
168+#define writeb_relaxed writeb
169+#define writew_relaxed writew
170+#define writel_relaxed writel
171+
168172 #define writeb_be __raw_writeb
169173 #define writew_be __raw_writew
170174 #define writel_be __raw_writel
arch/blackfin/Kconfig+1−1
@@ -33,7 +33,7 @@ config BLACKFIN · 32 unmodified lines
3333 select ARCH_HAVE_CUSTOM_GPIO_H
3434 select ARCH_WANT_OPTIONAL_GPIOLIB
3535 select HAVE_UID16
36− select HAVE_VIRT_TO_BUS
36+ select VIRT_TO_BUS
3737 select ARCH_WANT_IPC_PARSE_VERSION
3838 select HAVE_GENERIC_HARDIRQS
3939 select GENERIC_ATOMIC64
arch/c6x/include/asm/irqflags.h+1−1
@@ -27,7 +27,7 @@ static inline unsigned long arch_local_save_flags(void) · 26 unmodified lines
2727 /* set interrupt enabled status */
2828 static inline void arch_local_irq_restore(unsigned long flags)
2929 {
30− asm volatile (" mvc .s2 %0,CSR\n" : : "b"(flags));
30+ asm volatile (" mvc .s2 %0,CSR\n" : : "b"(flags) : "memory");
3131 }
3232
3333 /* unconditionally enable interrupts */
arch/cris/Kconfig+1−1
@@ -43,7 +43,7 @@ config CRIS · 42 unmodified lines
4343 select GENERIC_ATOMIC64
4444 select HAVE_GENERIC_HARDIRQS
4545 select HAVE_UID16
46− select HAVE_VIRT_TO_BUS
46+ select VIRT_TO_BUS
4747 select ARCH_WANT_IPC_PARSE_VERSION
4848 select GENERIC_IRQ_SHOW
4949 select GENERIC_IOMAP
arch/frv/Kconfig+1−1
@@ -6,7 +6,7 @@ config FRV · 5 unmodified lines
66 select HAVE_PERF_EVENTS
77 select HAVE_UID16
88 select HAVE_GENERIC_HARDIRQS
9− select HAVE_VIRT_TO_BUS
9+ select VIRT_TO_BUS
1010 select GENERIC_IRQ_SHOW
1111 select HAVE_DEBUG_BUGVERBOSE
1212 select ARCH_HAVE_NMI_SAFE_CMPXCHG
arch/h8300/Kconfig+1−1
@@ -5,7 +5,7 @@ config H8300 · 4 unmodified lines
55 select HAVE_GENERIC_HARDIRQS
66 select GENERIC_ATOMIC64
77 select HAVE_UID16
8− select HAVE_VIRT_TO_BUS
8+ select VIRT_TO_BUS
99 select ARCH_WANT_IPC_PARSE_VERSION
1010 select GENERIC_IRQ_SHOW
1111 select GENERIC_CPU_DEVICES
arch/ia64/Kconfig+1−1
@@ -26,7 +26,7 @@ config IA64 · 25 unmodified lines
2626 select HAVE_MEMBLOCK
2727 select HAVE_MEMBLOCK_NODE_MAP
2828 select HAVE_VIRT_CPU_ACCOUNTING
29− select HAVE_VIRT_TO_BUS
29+ select VIRT_TO_BUS
3030 select ARCH_DISCARD_MEMBLOCK
3131 select GENERIC_IRQ_PROBE
3232 select GENERIC_PENDING_IRQ if SMP
arch/ia64/kernel/palinfo.c+13−64
@@ -849,17 +849,6 @@ static palinfo_entry_t palinfo_entries[]={ · 848 unmodified lines
849849
850850 #define NR_PALINFO_ENTRIES (int) ARRAY_SIZE(palinfo_entries)
851851
852−/*
853− * this array is used to keep track of the proc entries we create. This is
854− * required in the module mode when we need to remove all entries. The procfs code
855− * does not do recursion of deletion
856− *
857− * Notes:
858− * - +1 accounts for the cpuN directory entry in /proc/pal
859− */
860−#define NR_PALINFO_PROC_ENTRIES (NR_CPUS*(NR_PALINFO_ENTRIES+1))
861−
862−static struct proc_dir_entry *palinfo_proc_entries[NR_PALINFO_PROC_ENTRIES];
863852 static struct proc_dir_entry *palinfo_dir;
864853
865854 /*
@@ -971,60 +960,32 @@ palinfo_read_entry(char *page, char **start, off_t off, int count, int *eof, voi · 105 unmodified lines
971960 static void __cpuinit
972961 create_palinfo_proc_entries(unsigned int cpu)
973962 {
974−# define CPUSTR "cpu%d"
975−
976963 pal_func_cpu_u_t f;
977− struct proc_dir_entry **pdir;
978964 struct proc_dir_entry *cpu_dir;
979965 int j;
980− char cpustr[sizeof(CPUSTR)];
981−
982−
983− /*
984− * we keep track of created entries in a depth-first order for
985− * cleanup purposes. Each entry is stored into palinfo_proc_entries
986− */
987− sprintf(cpustr,CPUSTR, cpu);
966+ char cpustr[3+4+1]; /* cpu numbers are up to 4095 on itanic */
967+ sprintf(cpustr, "cpu%d", cpu);
988968
989969 cpu_dir = proc_mkdir(cpustr, palinfo_dir);
970+ if (!cpu_dir)
971+ return;
990972
991973 f.req_cpu = cpu;
992974
993− /*
994− * Compute the location to store per cpu entries
995− * We dont store the top level entry in this list, but
996− * remove it finally after removing all cpu entries.
997− */
998− pdir = &palinfo_proc_entries[cpu*(NR_PALINFO_ENTRIES+1)];
999− *pdir++ = cpu_dir;
1000975 for (j=0; j < NR_PALINFO_ENTRIES; j++) {
1001976 f.func_id = j;
1002− *pdir = create_proc_read_entry(
1003− palinfo_entries[j].name, 0, cpu_dir,
1004− palinfo_read_entry, (void *)f.value);
1005− pdir++;
977+ create_proc_read_entry(
978+ palinfo_entries[j].name, 0, cpu_dir,
979+ palinfo_read_entry, (void *)f.value);
1006980 }
1007981 }
1008982
1009983 static void
1010984 remove_palinfo_proc_entries(unsigned int hcpu)
1011985 {
1012− int j;
1013− struct proc_dir_entry *cpu_dir, **pdir;
1014−
1015− pdir = &palinfo_proc_entries[hcpu*(NR_PALINFO_ENTRIES+1)];
1016− cpu_dir = *pdir;
1017− *pdir++=NULL;
1018− for (j=0; j < (NR_PALINFO_ENTRIES); j++) {
1019− if ((*pdir)) {
1020− remove_proc_entry ((*pdir)->name, cpu_dir);
1021− *pdir ++= NULL;
1022− }
1023− }
1024−
1025− if (cpu_dir) {
1026− remove_proc_entry(cpu_dir->name, palinfo_dir);
1027− }
986+ char cpustr[3+4+1]; /* cpu numbers are up to 4095 on itanic */
987+ sprintf(cpustr, "cpu%d", hcpu);
988+ remove_proc_subtree(cpustr, palinfo_dir);
1028989 }
1029990
1030991 static int __cpuinit palinfo_cpu_callback(struct notifier_block *nfb,
@@ -1058,6 +1019,8 @@ palinfo_init(void) · 27 unmodified lines
10581019
10591020 printk(KERN_INFO "PAL Information Facility v%s\n", PALINFO_VERSION);
10601021 palinfo_dir = proc_mkdir("pal", NULL);
1022+ if (!palinfo_dir)
1023+ return -ENOMEM;
10611024
10621025 /* Create palinfo dirs in /proc for all online cpus */
10631026 for_each_online_cpu(i) {
@@ -1073,22 +1036,8 @@ palinfo_init(void) · 9 unmodified lines
10731036 static void __exit
10741037 palinfo_exit(void)
10751038 {
1076− int i = 0;
1077−
1078− /* remove all nodes: depth first pass. Could optimize this */
1079− for_each_online_cpu(i) {
1080− remove_palinfo_proc_entries(i);
1081− }
1082−
1083− /*
1084− * Remove the top level entry finally
1085− */
1086− remove_proc_entry(palinfo_dir->name, NULL);
1087−
1088− /*
1089− * Unregister from cpu notifier callbacks
1090− */
10911039 unregister_hotcpu_notifier(&palinfo_cpu_notifier);
1040+ remove_proc_subtree("pal", NULL);
10921041 }
10931042
10941043 module_init(palinfo_init);
arch/ia64/kernel/process.c+1−4
@@ -291,7 +291,6 @@ cpu_idle (void) · 290 unmodified lines
291291 }
292292
293293 if (!need_resched()) {
294− void (*idle)(void);
295294 #ifdef CONFIG_SMP
296295 min_xtp();
297296 #endif
@@ -299,9 +298,7 @@ cpu_idle (void) · 1 unmodified line
299298 if (mark_idle)
300299 (*mark_idle)(1);
301300
302− if (!idle)
303− idle = default_idle;
304− (*idle)();
301+ default_idle();
305302 if (mark_idle)
306303 (*mark_idle)(0);
307304 #ifdef CONFIG_SMP
arch/m32r/Kconfig+1−1
@@ -10,7 +10,7 @@ config M32R · 9 unmodified lines
1010 select ARCH_WANT_IPC_PARSE_VERSION
1111 select HAVE_DEBUG_BUGVERBOSE
1212 select HAVE_GENERIC_HARDIRQS
13− select HAVE_VIRT_TO_BUS
13+ select VIRT_TO_BUS
1414 select GENERIC_IRQ_PROBE
1515 select GENERIC_IRQ_SHOW
1616 select GENERIC_ATOMIC64
arch/m32r/include/uapi/asm/stat.h+2−2
@@ -63,10 +63,10 @@ struct stat64 { · 62 unmodified lines
6363 long long st_size;
6464 unsigned long st_blksize;
6565
66−#if defined(__BIG_ENDIAN)
66+#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN)
6767 unsigned long __pad4; /* future possible st_blocks high bits */
6868 unsigned long st_blocks; /* Number 512-byte blocks allocated. */
69−#elif defined(__LITTLE_ENDIAN)
69+#elif defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN)
7070 unsigned long st_blocks; /* Number 512-byte blocks allocated. */
7171 unsigned long __pad4; /* future possible st_blocks high bits */
7272 #else
arch/m68k/Kconfig+1−1
@@ -8,7 +8,7 @@ config M68K · 7 unmodified lines
88 select GENERIC_IRQ_SHOW
99 select GENERIC_ATOMIC64
1010 select HAVE_UID16
11− select HAVE_VIRT_TO_BUS
11+ select VIRT_TO_BUS
1212 select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS
1313 select GENERIC_CPU_DEVICES
1414 select GENERIC_STRNCPY_FROM_USER if MMU
arch/m68k/Kconfig.machine+0−1
@@ -310,7 +310,6 @@ config COBRA5282 · 309 unmodified lines
310310 config SOM5282EM
311311 bool "EMAC.Inc SOM5282EM board support"
312312 depends on M528x
313− select EMAC_INC
314313 help
315314 Support for the EMAC.Inc SOM5282EM module.
316315
arch/m68k/include/asm/MC68328.h+5−5
@@ -293,7 +293,7 @@ · 292 unmodified lines
293293 /*
294294 * Here go the bitmasks themselves
295295 */
296−#define IMR_MSPIM (1 << SPIM _IRQ_NUM) /* Mask SPI Master interrupt */
296+#define IMR_MSPIM (1 << SPIM_IRQ_NUM) /* Mask SPI Master interrupt */
297297 #define IMR_MTMR2 (1 << TMR2_IRQ_NUM) /* Mask Timer 2 interrupt */
298298 #define IMR_MUART (1 << UART_IRQ_NUM) /* Mask UART interrupt */
299299 #define IMR_MWDT (1 << WDT_IRQ_NUM) /* Mask Watchdog Timer interrupt */
@@ -327,7 +327,7 @@ · 27 unmodified lines
327327 #define IWR_ADDR 0xfffff308
328328 #define IWR LONG_REF(IWR_ADDR)
329329
330−#define IWR_SPIM (1 << SPIM _IRQ_NUM) /* SPI Master interrupt */
330+#define IWR_SPIM (1 << SPIM_IRQ_NUM) /* SPI Master interrupt */
331331 #define IWR_TMR2 (1 << TMR2_IRQ_NUM) /* Timer 2 interrupt */
332332 #define IWR_UART (1 << UART_IRQ_NUM) /* UART interrupt */
333333 #define IWR_WDT (1 << WDT_IRQ_NUM) /* Watchdog Timer interrupt */
@@ -357,7 +357,7 @@ · 23 unmodified lines
357357 #define ISR_ADDR 0xfffff30c
358358 #define ISR LONG_REF(ISR_ADDR)
359359
360−#define ISR_SPIM (1 << SPIM _IRQ_NUM) /* SPI Master interrupt */
360+#define ISR_SPIM (1 << SPIM_IRQ_NUM) /* SPI Master interrupt */
361361 #define ISR_TMR2 (1 << TMR2_IRQ_NUM) /* Timer 2 interrupt */
362362 #define ISR_UART (1 << UART_IRQ_NUM) /* UART interrupt */
363363 #define ISR_WDT (1 << WDT_IRQ_NUM) /* Watchdog Timer interrupt */
@@ -391,7 +391,7 @@ · 27 unmodified lines
391391 #define IPR_ADDR 0xfffff310
392392 #define IPR LONG_REF(IPR_ADDR)
393393
394−#define IPR_SPIM (1 << SPIM _IRQ_NUM) /* SPI Master interrupt */
394+#define IPR_SPIM (1 << SPIM_IRQ_NUM) /* SPI Master interrupt */
395395 #define IPR_TMR2 (1 << TMR2_IRQ_NUM) /* Timer 2 interrupt */
396396 #define IPR_UART (1 << UART_IRQ_NUM) /* UART interrupt */
397397 #define IPR_WDT (1 << WDT_IRQ_NUM) /* Watchdog Timer interrupt */
@@ -757,7 +757,7 @@ · 359 unmodified lines
757757
758758 /* 'EZ328-compatible definitions */
759759 #define TCN_ADDR TCN1_ADDR
760−#define TCN TCN
760+#define TCN TCN1
761761
762762 /*
763763 * Timer Unit 1 and 2 Status Registers
arch/m68k/include/asm/gpio.h+20−0
@@ -86,4 +86,24 @@ static inline int gpio_cansleep(unsigned gpio) · 85 unmodified lines
8686 return gpio < MCFGPIO_PIN_MAX ? 0 : __gpio_cansleep(gpio);
8787 }
8888
89+static inline int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
90+{
91+ int err;
92+
93+ err = gpio_request(gpio, label);
94+ if (err)
95+ return err;
96+
97+ if (flags & GPIOF_DIR_IN)
98+ err = gpio_direction_input(gpio);
99+ else
100+ err = gpio_direction_output(gpio,
101+ (flags & GPIOF_INIT_HIGH) ? 1 : 0);
102+
103+ if (err)
104+ gpio_free(gpio);
105+
106+ return err;
107+}
108+
89109 #endif
arch/m68k/kernel/setup_no.c+3−0
@@ -57,6 +57,9 @@ void (*mach_reset)(void); · 56 unmodified lines
5757 void (*mach_halt)(void);
5858 void (*mach_power_off)(void);
5959
60+#ifdef CONFIG_M68000
61+#define CPU_NAME "MC68000"
62+#endif
6063 #ifdef CONFIG_M68328
6164 #define CPU_NAME "MC68328"
6265 #endif
arch/m68k/mm/init.c+1−1
@@ -188,7 +188,7 @@ void __init mem_init(void) · 187 unmodified lines
188188 }
189189 }
190190
191−#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
191+#if defined(CONFIG_MMU) && !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
192192 /* insert pointer tables allocated so far into the tablelist */
193193 init_pointer_table((unsigned long)kernel_pg_dir);
194194 for (i = 0; i < PTRS_PER_PGD; i++) {
arch/m68k/platform/coldfire/m528x.c+1−1
@@ -69,7 +69,7 @@ static void __init m528x_uarts_init(void) · 68 unmodified lines
6969 u8 port;
7070
7171 /* make sure PUAPAR is set for UART0 and UART1 */
72− port = readb(MCF5282_GPIO_PUAPAR);
72+ port = readb(MCFGPIO_PUAPAR);
7373 port |= 0x03 | (0x03 << 2);
7474 writeb(port, MCFGPIO_PUAPAR);
7575 }
arch/microblaze/Kconfig+1−1
@@ -19,7 +19,7 @@ config MICROBLAZE · 18 unmodified lines
1919 select HAVE_DEBUG_KMEMLEAK
2020 select IRQ_DOMAIN
2121 select HAVE_GENERIC_HARDIRQS
22− select HAVE_VIRT_TO_BUS
22+ select VIRT_TO_BUS
2323 select GENERIC_IRQ_PROBE
2424 select GENERIC_IRQ_SHOW
2525 select GENERIC_PCI_IOMAP
arch/mips/Kconfig+4−5
@@ -18,7 +18,7 @@ config MIPS · 17 unmodified lines
1818 select HAVE_KRETPROBES
1919 select HAVE_DEBUG_KMEMLEAK
2020 select ARCH_BINFMT_ELF_RANDOMIZE_PIE
21− select HAVE_ARCH_TRANSPARENT_HUGEPAGE
21+ select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES && 64BIT
2222 select RTC_LIB if !MACH_LOONGSON
2323 select GENERIC_ATOMIC64 if !64BIT
2424 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
@@ -38,7 +38,7 @@ config MIPS · 13 unmodified lines
3838 select GENERIC_CLOCKEVENTS
3939 select GENERIC_CMOS_UPDATE
4040 select HAVE_MOD_ARCH_SPECIFIC
41− select HAVE_VIRT_TO_BUS
41+ select VIRT_TO_BUS
4242 select MODULES_USE_ELF_REL if MODULES
4343 select MODULES_USE_ELF_RELA if MODULES && 64BIT
4444 select CLONE_BACKWARDS
@@ -657,7 +657,7 @@ config SNI_RM · 612 unmodified lines
657657 bool "SNI RM200/300/400"
658658 select FW_ARC if CPU_LITTLE_ENDIAN
659659 select FW_ARC32 if CPU_LITTLE_ENDIAN
660− select SNIPROM if CPU_BIG_ENDIAN
660+ select FW_SNIPROM if CPU_BIG_ENDIAN
661661 select ARCH_MAY_HAVE_PC_FDC
662662 select BOOT_ELF32
663663 select CEVT_R4K
@@ -1144,7 +1144,7 @@ config DEFAULT_SGI_PARTITION · 480 unmodified lines
11441144 config FW_ARC32
11451145 bool
11461146
1147−config SNIPROM
1147+config FW_SNIPROM
11481148 bool
11491149
11501150 config BOOT_ELF32
@@ -1493,7 +1493,6 @@ config CPU_XLP · 342 unmodified lines
14931493 select CPU_SUPPORTS_32BIT_KERNEL
14941494 select CPU_SUPPORTS_64BIT_KERNEL
14951495 select CPU_SUPPORTS_HIGHMEM
1496− select CPU_HAS_LLSC
14971496 select WEAK_ORDERING
14981497 select WEAK_REORDERING_BEYOND_LLSC
14991498 select CPU_HAS_PREFETCH
arch/mips/bcm63xx/boards/board_bcm963xx.c+1−4
@@ -745,10 +745,7 @@ void __init board_prom_init(void) · 744 unmodified lines
745745 strcpy(cfe_version, "unknown");
746746 printk(KERN_INFO PFX "CFE version: %s\n", cfe_version);
747747
748− if (bcm63xx_nvram_init(boot_addr + BCM963XX_NVRAM_OFFSET)) {
749− printk(KERN_ERR PFX "invalid nvram checksum\n");
750− return;
751− }
748+ bcm63xx_nvram_init(boot_addr + BCM963XX_NVRAM_OFFSET);
752749
753750 board_name = bcm63xx_nvram_get_name();
754751 /* find board by name */
arch/mips/bcm63xx/nvram.c+3−4
@@ -38,7 +38,7 @@ struct bcm963xx_nvram { · 37 unmodified lines
3838 static struct bcm963xx_nvram nvram;
3939 static int mac_addr_used;
4040
41−int __init bcm63xx_nvram_init(void *addr)
41+void __init bcm63xx_nvram_init(void *addr)
4242 {
4343 unsigned int check_len;
4444 u32 crc, expected_crc;
@@ -60,9 +60,8 @@ int __init bcm63xx_nvram_init(void *addr) · 15 unmodified lines
6060 crc = crc32_le(~0, (u8 *)&nvram, check_len);
6161
6262 if (crc != expected_crc)
63− return -EINVAL;
64−
65− return 0;
63+ pr_warn("nvram checksum failed, contents may be invalid (expected %08x, got %08x)\n",
64+ expected_crc, crc);
6665 }
6766
6867 u8 *bcm63xx_nvram_get_name(void)
arch/mips/bcm63xx/setup.c+1−1
@@ -157,4 +157,4 @@ int __init bcm63xx_register_devices(void) · 156 unmodified lines
157157 return board_register_devices();
158158 }
159159
160−device_initcall(bcm63xx_register_devices);
160+arch_initcall(bcm63xx_register_devices);
arch/mips/cavium-octeon/setup.c+4−1
@@ -174,7 +174,10 @@ static int octeon_kexec_prepare(struct kimage *image) · 173 unmodified lines
174174
175175 static void octeon_generic_shutdown(void)
176176 {
177− int cpu, i;
177+ int i;
178+#ifdef CONFIG_SMP
179+ int cpu;
180+#endif
178181 struct cvmx_bootmem_desc *bootmem_desc;
179182 void *named_block_array_ptr;
180183
arch/mips/include/asm/mach-bcm63xx/bcm63xx_nvram.h+1−3
@@ -9,10 +9,8 @@ · 8 unmodified lines
99 *
1010 * Initialized the local nvram copy from the target address and checks
1111 * its checksum.
12− *
13− * Returns 0 on success.
1412 */
15−int __init bcm63xx_nvram_init(void *nvram);
13+void bcm63xx_nvram_init(void *nvram);
1614
1715 /**
1816 * bcm63xx_nvram_get_name() - returns the board name according to nvram
arch/mips/include/asm/mach-sead3/cpu-feature-overrides.h+0−4
@@ -28,11 +28,7 @@ · 27 unmodified lines
2828 /* #define cpu_has_prefetch ? */
2929 #define cpu_has_mcheck 1
3030 /* #define cpu_has_ejtag ? */
31−#ifdef CONFIG_CPU_HAS_LLSC
3231 #define cpu_has_llsc 1
33−#else
34−#define cpu_has_llsc 0
35−#endif
3632 /* #define cpu_has_vtag_icache ? */
3733 /* #define cpu_has_dc_aliases ? */
3834 /* #define cpu_has_ic_fills_f_dc ? */
arch/mips/include/asm/mipsregs.h+190−19
@@ -1166,7 +1166,10 @@ do { \ · 1165 unmodified lines
11661166 unsigned int __dspctl; \
11671167 \
11681168 __asm__ __volatile__( \
1169+ " .set push \n" \
1170+ " .set dsp \n" \
11691171 " rddsp %0, %x1 \n" \
1172+ " .set pop \n" \
11701173 : "=r" (__dspctl) \
11711174 : "i" (mask)); \
11721175 __dspctl; \
@@ -1175,30 +1178,198 @@ do { \ · 2 unmodified lines
11751178 #define wrdsp(val, mask) \
11761179 do { \
11771180 __asm__ __volatile__( \
1181+ " .set push \n" \
1182+ " .set dsp \n" \
11781183 " wrdsp %0, %x1 \n" \
1184+ " .set pop \n" \
11791185 : \
11801186 : "r" (val), "i" (mask)); \
11811187 } while (0)
11821188
1183−#define mflo0() ({ long mflo0; __asm__("mflo %0, $ac0" : "=r" (mflo0)); mflo0;})
1184−#define mflo1() ({ long mflo1; __asm__("mflo %0, $ac1" : "=r" (mflo1)); mflo1;})
1185−#define mflo2() ({ long mflo2; __asm__("mflo %0, $ac2" : "=r" (mflo2)); mflo2;})
1186−#define mflo3() ({ long mflo3; __asm__("mflo %0, $ac3" : "=r" (mflo3)); mflo3;})
1187−
1188−#define mfhi0() ({ long mfhi0; __asm__("mfhi %0, $ac0" : "=r" (mfhi0)); mfhi0;})
1189−#define mfhi1() ({ long mfhi1; __asm__("mfhi %0, $ac1" : "=r" (mfhi1)); mfhi1;})
1190−#define mfhi2() ({ long mfhi2; __asm__("mfhi %0, $ac2" : "=r" (mfhi2)); mfhi2;})
1191−#define mfhi3() ({ long mfhi3; __asm__("mfhi %0, $ac3" : "=r" (mfhi3)); mfhi3;})
1192−
1193−#define mtlo0(x) __asm__("mtlo %0, $ac0" ::"r" (x))
1194−#define mtlo1(x) __asm__("mtlo %0, $ac1" ::"r" (x))
1195−#define mtlo2(x) __asm__("mtlo %0, $ac2" ::"r" (x))
1196−#define mtlo3(x) __asm__("mtlo %0, $ac3" ::"r" (x))
1197−
1198−#define mthi0(x) __asm__("mthi %0, $ac0" ::"r" (x))
1199−#define mthi1(x) __asm__("mthi %0, $ac1" ::"r" (x))
1200−#define mthi2(x) __asm__("mthi %0, $ac2" ::"r" (x))
1201−#define mthi3(x) __asm__("mthi %0, $ac3" ::"r" (x))
1189+#define mflo0() \
1190+({ \
1191+ long mflo0; \
1192+ __asm__( \
1193+ " .set push \n" \
1194+ " .set dsp \n" \
1195+ " mflo %0, $ac0 \n" \
1196+ " .set pop \n" \
1197+ : "=r" (mflo0)); \
1198+ mflo0; \
1199+})
1200+
1201+#define mflo1() \
1202+({ \
1203+ long mflo1; \
1204+ __asm__( \
1205+ " .set push \n" \
1206+ " .set dsp \n" \
1207+ " mflo %0, $ac1 \n" \
1208+ " .set pop \n" \
1209+ : "=r" (mflo1)); \
1210+ mflo1; \
1211+})
1212+
1213+#define mflo2() \
1214+({ \
1215+ long mflo2; \
1216+ __asm__( \
1217+ " .set push \n" \
1218+ " .set dsp \n" \
1219+ " mflo %0, $ac2 \n" \
1220+ " .set pop \n" \
1221+ : "=r" (mflo2)); \
1222+ mflo2; \
1223+})
1224+
1225+#define mflo3() \
1226+({ \
1227+ long mflo3; \
1228+ __asm__( \
1229+ " .set push \n" \
1230+ " .set dsp \n" \
1231+ " mflo %0, $ac3 \n" \
1232+ " .set pop \n" \
1233+ : "=r" (mflo3)); \
1234+ mflo3; \
1235+})
1236+
1237+#define mfhi0() \
1238+({ \
1239+ long mfhi0; \
1240+ __asm__( \
1241+ " .set push \n" \
1242+ " .set dsp \n" \
1243+ " mfhi %0, $ac0 \n" \
1244+ " .set pop \n" \
1245+ : "=r" (mfhi0)); \
1246+ mfhi0; \
1247+})
1248+
1249+#define mfhi1() \
1250+({ \
1251+ long mfhi1; \
1252+ __asm__( \
1253+ " .set push \n" \
1254+ " .set dsp \n" \
1255+ " mfhi %0, $ac1 \n" \
1256+ " .set pop \n" \
1257+ : "=r" (mfhi1)); \
1258+ mfhi1; \
1259+})
1260+
1261+#define mfhi2() \
1262+({ \
1263+ long mfhi2; \
1264+ __asm__( \
1265+ " .set push \n" \
1266+ " .set dsp \n" \
1267+ " mfhi %0, $ac2 \n" \
1268+ " .set pop \n" \
1269+ : "=r" (mfhi2)); \
1270+ mfhi2; \
1271+})
1272+
1273+#define mfhi3() \
1274+({ \
1275+ long mfhi3; \
1276+ __asm__( \
1277+ " .set push \n" \
1278+ " .set dsp \n" \
1279+ " mfhi %0, $ac3 \n" \
1280+ " .set pop \n" \
1281+ : "=r" (mfhi3)); \
1282+ mfhi3; \
1283+})
1284+
1285+
1286+#define mtlo0(x) \
1287+({ \
1288+ __asm__( \
1289+ " .set push \n" \
1290+ " .set dsp \n" \
1291+ " mtlo %0, $ac0 \n" \
1292+ " .set pop \n" \
1293+ : \
1294+ : "r" (x)); \
1295+})
1296+
1297+#define mtlo1(x) \
1298+({ \
1299+ __asm__( \
1300+ " .set push \n" \
1301+ " .set dsp \n" \
1302+ " mtlo %0, $ac1 \n" \
1303+ " .set pop \n" \
1304+ : \
1305+ : "r" (x)); \
1306+})
1307+
1308+#define mtlo2(x) \
1309+({ \
1310+ __asm__( \
1311+ " .set push \n" \
1312+ " .set dsp \n" \
1313+ " mtlo %0, $ac2 \n" \
1314+ " .set pop \n" \
1315+ : \
1316+ : "r" (x)); \
1317+})
1318+
1319+#define mtlo3(x) \
1320+({ \
1321+ __asm__( \
1322+ " .set push \n" \
1323+ " .set dsp \n" \
1324+ " mtlo %0, $ac3 \n" \
1325+ " .set pop \n" \
1326+ : \
1327+ : "r" (x)); \
1328+})
1329+
1330+#define mthi0(x) \
1331+({ \
1332+ __asm__( \
1333+ " .set push \n" \
1334+ " .set dsp \n" \
1335+ " mthi %0, $ac0 \n" \
1336+ " .set pop \n" \
1337+ : \
1338+ : "r" (x)); \
1339+})
1340+
1341+#define mthi1(x) \
1342+({ \
1343+ __asm__( \
1344+ " .set push \n" \
1345+ " .set dsp \n" \
1346+ " mthi %0, $ac1 \n" \
1347+ " .set pop \n" \
1348+ : \
1349+ : "r" (x)); \
1350+})
1351+
1352+#define mthi2(x) \
1353+({ \
1354+ __asm__( \
1355+ " .set push \n" \
1356+ " .set dsp \n" \
1357+ " mthi %0, $ac2 \n" \
1358+ " .set pop \n" \
1359+ : \
1360+ : "r" (x)); \
1361+})
1362+
1363+#define mthi3(x) \
1364+({ \
1365+ __asm__( \
1366+ " .set push \n" \
1367+ " .set dsp \n" \
1368+ " mthi %0, $ac3 \n" \
1369+ " .set pop \n" \
1370+ : \
1371+ : "r" (x)); \
1372+})
12021373
12031374 #else
12041375
arch/mips/include/asm/signal.h+1−1
@@ -21,6 +21,6 @@ · 20 unmodified lines
2121 #include <asm/sigcontext.h>
2222 #include <asm/siginfo.h>
2323
24−#define __ARCH_HAS_ODD_SIGACTION
24+#define __ARCH_HAS_IRIX_SIGACTION
2525
2626 #endif /* _ASM_SIGNAL_H */
arch/mips/include/uapi/asm/signal.h+6−2
@@ -72,6 +72,12 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */ · 71 unmodified lines
7272 *
7373 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
7474 * Unix names RESETHAND and NODEFER respectively.
75+ *
76+ * SA_RESTORER used to be defined as 0x04000000 but only the O32 ABI ever
77+ * supported its use and no libc was using it, so the entire sa-restorer
78+ * functionality was removed with lmo commit 39bffc12c3580ab for 2.5.48
79+ * retaining only the SA_RESTORER definition as a reminder to avoid
80+ * accidental reuse of the mask bit.
7581 */
7682 #define SA_ONSTACK 0x08000000
7783 #define SA_RESETHAND 0x80000000
@@ -84,8 +90,6 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */ · 6 unmodified lines
8490 #define SA_NOMASK SA_NODEFER
8591 #define SA_ONESHOT SA_RESETHAND
8692
87−#define SA_RESTORER 0x04000000 /* Only for o32 */
88−
8993 #define MINSIGSTKSZ 2048
9094 #define SIGSTKSZ 8192
9195
arch/mips/kernel/Makefile+6−19
@@ -100,29 +100,16 @@ obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_mipsxx.o · 99 unmodified lines
100100 obj-$(CONFIG_JUMP_LABEL) += jump_label.o
101101
102102 #
103−# DSP ASE supported for MIPS32 or MIPS64 Release 2 cores only. It is safe
104−# to enable DSP assembler support here even if the MIPS Release 2 CPU we
105−# are targetting does not support DSP because all code-paths making use of
106−# it properly check that the running CPU *actually does* support these
107−# instructions.
103+# DSP ASE supported for MIPS32 or MIPS64 Release 2 cores only. It is not
104+# safe to unconditionnaly use the assembler -mdsp / -mdspr2 switches
105+# here because the compiler may use DSP ASE instructions (such as lwx) in
106+# code paths where we cannot check that the CPU we are running on supports it.
107+# Proper abstraction using HAVE_AS_DSP and macros is done in
108+# arch/mips/include/asm/mipsregs.h.
108109 #
109110 ifeq ($(CONFIG_CPU_MIPSR2), y)
110111 CFLAGS_DSP = -DHAVE_AS_DSP
111112
112−#
113−# Check if assembler supports DSP ASE
114−#
115−ifeq ($(call cc-option-yn,-mdsp), y)
116−CFLAGS_DSP += -mdsp
117−endif
118−
119−#
120−# Check if assembler supports DSP ASE Rev2
121−#
122−ifeq ($(call cc-option-yn,-mdspr2), y)
123−CFLAGS_DSP += -mdspr2
124−endif
125−
126113 CFLAGS_signal.o = $(CFLAGS_DSP)
127114 CFLAGS_signal32.o = $(CFLAGS_DSP)
128115 CFLAGS_process.o = $(CFLAGS_DSP)
arch/mips/kernel/cpu-probe.c+6−7
@@ -580,6 +580,9 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) · 579 unmodified lines
580580 c->tlbsize = 48;
581581 break;
582582 case PRID_IMP_VR41XX:
583+ set_isa(c, MIPS_CPU_ISA_III);
584+ c->options = R4K_OPTS;
585+ c->tlbsize = 32;
583586 switch (c->processor_id & 0xf0) {
584587 case PRID_REV_VR4111:
585588 c->cputype = CPU_VR4111;
@@ -604,6 +607,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) · 18 unmodified lines
604607 __cpu_name[cpu] = "NEC VR4131";
605608 } else {
606609 c->cputype = CPU_VR4133;
610+ c->options |= MIPS_CPU_LLSC;
607611 __cpu_name[cpu] = "NEC VR4133";
608612 }
609613 break;
@@ -613,9 +617,6 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) · 3 unmodified lines
613617 __cpu_name[cpu] = "NEC Vr41xx";
614618 break;
615619 }
616− set_isa(c, MIPS_CPU_ISA_III);
617− c->options = R4K_OPTS;
618− c->tlbsize = 32;
619620 break;
620621 case PRID_IMP_R4300:
621622 c->cputype = CPU_R4300;
@@ -1226,10 +1227,8 @@ __cpuinit void cpu_probe(void) · 604 unmodified lines
12261227 if (c->options & MIPS_CPU_FPU) {
12271228 c->fpu_id = cpu_get_fpu_id();
12281229
1229− if (c->isa_level == MIPS_CPU_ISA_M32R1 ||
1230− c->isa_level == MIPS_CPU_ISA_M32R2 ||
1231− c->isa_level == MIPS_CPU_ISA_M64R1 ||
1232− c->isa_level == MIPS_CPU_ISA_M64R2) {
1230+ if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M32R2 |
1231+ MIPS_CPU_ISA_M64R1 | MIPS_CPU_ISA_M64R2)) {
12331232 if (c->fpu_id & MIPS_FPIR_3D)
12341233 c->ases |= MIPS_ASE_MIPS3D;
12351234 }
arch/mips/kernel/linux32.c+1−1
@@ -171,7 +171,7 @@ SYSCALL_DEFINE6(32_ipc, u32, call, long, first, long, second, long, third, · 170 unmodified lines
171171 err = compat_sys_shmctl(first, second, compat_ptr(ptr));
172172 break;
173173 default:
174− err = -EINVAL;
174+ err = -ENOSYS;
175175 break;
176176 }
177177
arch/mips/kernel/mcount.S+7−4
@@ -46,10 +46,9 @@ · 45 unmodified lines
4646 PTR_L a5, PT_R9(sp)
4747 PTR_L a6, PT_R10(sp)
4848 PTR_L a7, PT_R11(sp)
49−#else
50− PTR_ADDIU sp, PT_SIZE
5149 #endif
52−.endm
50+ PTR_ADDIU sp, PT_SIZE
51+ .endm
5352
5453 .macro RETURN_BACK
5554 jr ra
@@ -68,7 +67,11 @@ NESTED(ftrace_caller, PT_SIZE, ra) · 12 unmodified lines
6867 .globl _mcount
6968 _mcount:
7069 b ftrace_stub
71− addiu sp,sp,8
70+#ifdef CONFIG_32BIT
71+ addiu sp,sp,8
72+#else
73+ nop
74+#endif
7275
7376 /* When tracing is activated, it calls ftrace_caller+8 (aka here) */
7477 lw t1, function_trace_stop
arch/mips/kernel/proc.c+1−1
@@ -67,7 +67,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) · 66 unmodified lines
6767 if (cpu_has_mips_r) {
6868 seq_printf(m, "isa\t\t\t:");
6969 if (cpu_has_mips_1)
70− seq_printf(m, "%s", "mips1");
70+ seq_printf(m, "%s", " mips1");
7171 if (cpu_has_mips_2)
7272 seq_printf(m, "%s", " mips2");
7373 if (cpu_has_mips_3)
arch/mips/kernel/traps.c+1−1
@@ -1571,7 +1571,7 @@ void __cpuinit per_cpu_trap_init(bool is_boot_cpu) · 1570 unmodified lines
15711571 #ifdef CONFIG_64BIT
15721572 status_set |= ST0_FR|ST0_KX|ST0_SX|ST0_UX;
15731573 #endif
1574− if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV)
1574+ if (current_cpu_data.isa_level & MIPS_CPU_ISA_IV)
15751575 status_set |= ST0_XX;
15761576 if (cpu_has_dsp)
15771577 status_set |= ST0_MX;
arch/mips/lib/bitops.c+8−8
@@ -90,12 +90,12 @@ int __mips_test_and_set_bit(unsigned long nr, · 89 unmodified lines
9090 unsigned bit = nr & SZLONG_MASK;
9191 unsigned long mask;
9292 unsigned long flags;
93− unsigned long res;
93+ int res;
9494
9595 a += nr >> SZLONG_LOG;
9696 mask = 1UL << bit;
9797 raw_local_irq_save(flags);
98− res = (mask & *a);
98+ res = (mask & *a) != 0;
9999 *a |= mask;
100100 raw_local_irq_restore(flags);
101101 return res;
@@ -116,12 +116,12 @@ int __mips_test_and_set_bit_lock(unsigned long nr, · 14 unmodified lines
116116 unsigned bit = nr & SZLONG_MASK;
117117 unsigned long mask;
118118 unsigned long flags;
119− unsigned long res;
119+ int res;
120120
121121 a += nr >> SZLONG_LOG;
122122 mask = 1UL << bit;
123123 raw_local_irq_save(flags);
124− res = (mask & *a);
124+ res = (mask & *a) != 0;
125125 *a |= mask;
126126 raw_local_irq_restore(flags);
127127 return res;
@@ -141,12 +141,12 @@ int __mips_test_and_clear_bit(unsigned long nr, volatile unsigned long *addr) · 13 unmodified lines
141141 unsigned bit = nr & SZLONG_MASK;
142142 unsigned long mask;
143143 unsigned long flags;
144− unsigned long res;
144+ int res;
145145
146146 a += nr >> SZLONG_LOG;
147147 mask = 1UL << bit;
148148 raw_local_irq_save(flags);
149− res = (mask & *a);
149+ res = (mask & *a) != 0;
150150 *a &= ~mask;
151151 raw_local_irq_restore(flags);
152152 return res;
@@ -166,12 +166,12 @@ int __mips_test_and_change_bit(unsigned long nr, volatile unsigned long *addr) · 13 unmodified lines
166166 unsigned bit = nr & SZLONG_MASK;
167167 unsigned long mask;
168168 unsigned long flags;
169− unsigned long res;
169+ int res;
170170
171171 a += nr >> SZLONG_LOG;
172172 mask = 1UL << bit;
173173 raw_local_irq_save(flags);
174− res = (mask & *a);
174+ res = (mask & *a) != 0;
175175 *a ^= mask;
176176 raw_local_irq_restore(flags);
177177 return res;
arch/mips/lib/csum_partial.S+2−2
@@ -270,7 +270,7 @@ LEAF(csum_partial) · 269 unmodified lines
270270 #endif
271271
272272 /* odd buffer alignment? */
273−#ifdef CPU_MIPSR2
273+#ifdef CONFIG_CPU_MIPSR2
274274 wsbh v1, sum
275275 movn sum, v1, t7
276276 #else
@@ -670,7 +670,7 @@ EXC( sb t0, NBYTES-2(dst), .Ls_exc) · 393 unmodified lines
670670 addu sum, v1
671671 #endif
672672
673−#ifdef CPU_MIPSR2
673+#ifdef CONFIG_CPU_MIPSR2
674674 wsbh v1, sum
675675 movn sum, v1, odd
676676 #else
arch/mips/mm/c-r4k.c+2−4
@@ -1247,10 +1247,8 @@ static void __cpuinit setup_scache(void) · 1246 unmodified lines
12471247 return;
12481248
12491249 default:
1250− if (c->isa_level == MIPS_CPU_ISA_M32R1 ||
1251− c->isa_level == MIPS_CPU_ISA_M32R2 ||
1252− c->isa_level == MIPS_CPU_ISA_M64R1 ||
1253− c->isa_level == MIPS_CPU_ISA_M64R2) {
1250+ if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M32R2 |
1251+ MIPS_CPU_ISA_M64R1 | MIPS_CPU_ISA_M64R2)) {
12541252 #ifdef CONFIG_MIPS_CPU_SCACHE
12551253 if (mips_sc_init ()) {
12561254 scache_size = c->scache.ways * c->scache.sets * c->scache.linesz;
arch/mips/mm/sc-mips.c+2−4
@@ -98,10 +98,8 @@ static inline int __init mips_sc_probe(void) · 97 unmodified lines
9898 c->scache.flags |= MIPS_CACHE_NOT_PRESENT;
9999
100100 /* Ignore anything but MIPSxx processors */
101− if (c->isa_level != MIPS_CPU_ISA_M32R1 &&
102− c->isa_level != MIPS_CPU_ISA_M32R2 &&
103− c->isa_level != MIPS_CPU_ISA_M64R1 &&
104− c->isa_level != MIPS_CPU_ISA_M64R2)
101+ if (!(c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M32R2 |
102+ MIPS_CPU_ISA_M64R1 | MIPS_CPU_ISA_M64R2)))
105103 return 0;
106104
107105 /* Does this MIPS32/MIPS64 CPU have a config2 register? */
arch/mips/pci/pci-alchemy.c+2−2
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 #include <asm/mach-au1x00/au1000.h>
2020 #include <asm/tlbmisc.h>
2121
22−#ifdef CONFIG_DEBUG_PCI
22+#ifdef CONFIG_PCI_DEBUG
2323 #define DBG(x...) printk(KERN_DEBUG x)
2424 #else
2525 #define DBG(x...) do {} while (0)
@@ -162,7 +162,7 @@ static int config_access(unsigned char access_type, struct pci_bus *bus, · 136 unmodified lines
162162 if (status & (1 << 29)) {
163163 *data = 0xffffffff;
164164 error = -1;
165− DBG("alchemy-pci: master abort on cfg access %d bus %d dev %d",
165+ DBG("alchemy-pci: master abort on cfg access %d bus %d dev %d\n",
166166 access_type, bus->number, device);
167167 } else if ((status >> 28) & 0xf) {
168168 DBG("alchemy-pci: PCI ERR detected: dev %d, status %lx\n",
arch/mn10300/Kconfig+1−1
@@ -8,7 +8,7 @@ config MN10300 · 7 unmodified lines
88 select HAVE_ARCH_KGDB
99 select GENERIC_ATOMIC64
1010 select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER
11− select HAVE_VIRT_TO_BUS
11+ select VIRT_TO_BUS
1212 select GENERIC_CLOCKEVENTS
1313 select MODULES_USE_ELF_RELA
1414 select OLD_SIGSUSPEND3
arch/openrisc/Kconfig+1−2
@@ -9,10 +9,9 @@ config OPENRISC · 8 unmodified lines
99 select OF_EARLY_FLATTREE
1010 select IRQ_DOMAIN
1111 select HAVE_MEMBLOCK
12− select ARCH_WANT_OPTIONAL_GPIOLIB
12+ select ARCH_REQUIRE_GPIOLIB
1313 select HAVE_ARCH_TRACEHOOK
1414 select HAVE_GENERIC_HARDIRQS
15− select HAVE_VIRT_TO_BUS
1615 select GENERIC_IRQ_CHIP
1716 select GENERIC_IRQ_PROBE
1817 select GENERIC_IRQ_SHOW
arch/parisc/Kconfig+1−1
@@ -21,7 +21,7 @@ config PARISC · 20 unmodified lines
2121 select GENERIC_STRNCPY_FROM_USER
2222 select SYSCTL_ARCH_UNALIGN_ALLOW
2323 select HAVE_MOD_ARCH_SPECIFIC
24− select HAVE_VIRT_TO_BUS
24+ select VIRT_TO_BUS
2525 select MODULES_USE_ELF_RELA
2626 select CLONE_BACKWARDS
2727 select TTY # Needed for pdc_cons.c
arch/powerpc/Kconfig+2−1
@@ -90,6 +90,7 @@ config GENERIC_GPIO · 89 unmodified lines
9090 config PPC
9191 bool
9292 default y
93+ select BINFMT_ELF
9394 select OF
9495 select OF_EARLY_FLATTREE
9596 select HAVE_FTRACE_MCOUNT_RECORD
@@ -98,7 +99,7 @@ config PPC · 2 unmodified lines
9899 select HAVE_FUNCTION_GRAPH_TRACER
99100 select SYSCTL_EXCEPTION_TRACE
100101 select ARCH_WANT_OPTIONAL_GPIOLIB
101− select HAVE_VIRT_TO_BUS if !PPC64
102+ select VIRT_TO_BUS if !PPC64
102103 select HAVE_IDE
103104 select HAVE_IOREMAP_PROT
104105 select HAVE_EFFICIENT_UNALIGNED_ACCESS
arch/powerpc/include/asm/mmu-hash64.h+66−62
@@ -343,17 +343,16 @@ extern void slb_set_size(u16 size); · 342 unmodified lines
343343 /*
344344 * VSID allocation (256MB segment)
345345 *
346− * We first generate a 38-bit "proto-VSID". For kernel addresses this
347− * is equal to the ESID | 1 << 37, for user addresses it is:
348− * (context << USER_ESID_BITS) | (esid & ((1U << USER_ESID_BITS) - 1)
346+ * We first generate a 37-bit "proto-VSID". Proto-VSIDs are generated
347+ * from mmu context id and effective segment id of the address.
349348 *
350− * This splits the proto-VSID into the below range
351− * 0 - (2^(CONTEXT_BITS + USER_ESID_BITS) - 1) : User proto-VSID range
352− * 2^(CONTEXT_BITS + USER_ESID_BITS) - 2^(VSID_BITS) : Kernel proto-VSID range
353− *
354− * We also have CONTEXT_BITS + USER_ESID_BITS = VSID_BITS - 1
355− * That is, we assign half of the space to user processes and half
356− * to the kernel.
349+ * For user processes max context id is limited to ((1ul << 19) - 5)
350+ * for kernel space, we use the top 4 context ids to map address as below
351+ * NOTE: each context only support 64TB now.
352+ * 0x7fffc - [ 0xc000000000000000 - 0xc0003fffffffffff ]
353+ * 0x7fffd - [ 0xd000000000000000 - 0xd0003fffffffffff ]
354+ * 0x7fffe - [ 0xe000000000000000 - 0xe0003fffffffffff ]
355+ * 0x7ffff - [ 0xf000000000000000 - 0xf0003fffffffffff ]
357356 *
358357 * The proto-VSIDs are then scrambled into real VSIDs with the
359358 * multiplicative hash:
@@ -363,41 +362,49 @@ extern void slb_set_size(u16 size); · 3 unmodified lines
363362 * VSID_MULTIPLIER is prime, so in particular it is
364363 * co-prime to VSID_MODULUS, making this a 1:1 scrambling function.
365364 * Because the modulus is 2^n-1 we can compute it efficiently without
366− * a divide or extra multiply (see below).
367− *
368− * This scheme has several advantages over older methods:
369− *
370− * - We have VSIDs allocated for every kernel address
371− * (i.e. everything above 0xC000000000000000), except the very top
372− * segment, which simplifies several things.
365+ * a divide or extra multiply (see below). The scramble function gives
366+ * robust scattering in the hash table (at least based on some initial
367+ * results).
373368 *
374− * - We allow for USER_ESID_BITS significant bits of ESID and
375− * CONTEXT_BITS bits of context for user addresses.
376− * i.e. 64T (46 bits) of address space for up to half a million contexts.
369+ * We also consider VSID 0 special. We use VSID 0 for slb entries mapping
370+ * bad address. This enables us to consolidate bad address handling in
371+ * hash_page.
377372 *
378− * - The scramble function gives robust scattering in the hash
379− * table (at least based on some initial results). The previous
380− * method was more susceptible to pathological cases giving excessive
381− * hash collisions.
373+ * We also need to avoid the last segment of the last context, because that
374+ * would give a protovsid of 0x1fffffffff. That will result in a VSID 0
375+ * because of the modulo operation in vsid scramble. But the vmemmap
376+ * (which is what uses region 0xf) will never be close to 64TB in size
377+ * (it's 56 bytes per page of system memory).
382378 */
383379
380+#define CONTEXT_BITS 19
381+#define ESID_BITS 18
382+#define ESID_BITS_1T 6
383+
384+/*
385+ * 256MB segment
386+ * The proto-VSID space has 2^(CONTEX_BITS + ESID_BITS) - 1 segments
387+ * available for user + kernel mapping. The top 4 contexts are used for
388+ * kernel mapping. Each segment contains 2^28 bytes. Each
389+ * context maps 2^46 bytes (64TB) so we can support 2^19-1 contexts
390+ * (19 == 37 + 28 - 46).
391+ */
392+#define MAX_USER_CONTEXT ((ASM_CONST(1) << CONTEXT_BITS) - 5)
393+
384394 /*
385395 * This should be computed such that protovosid * vsid_mulitplier
386396 * doesn't overflow 64 bits. It should also be co-prime to vsid_modulus
387397 */
388398 #define VSID_MULTIPLIER_256M ASM_CONST(12538073) /* 24-bit prime */
389−#define VSID_BITS_256M 38
399+#define VSID_BITS_256M (CONTEXT_BITS + ESID_BITS)
390400 #define VSID_MODULUS_256M ((1UL<<VSID_BITS_256M)-1)
391401
392402 #define VSID_MULTIPLIER_1T ASM_CONST(12538073) /* 24-bit prime */
393−#define VSID_BITS_1T 26
403+#define VSID_BITS_1T (CONTEXT_BITS + ESID_BITS_1T)
394404 #define VSID_MODULUS_1T ((1UL<<VSID_BITS_1T)-1)
395405
396−#define CONTEXT_BITS 19
397−#define USER_ESID_BITS 18
398−#define USER_ESID_BITS_1T 6
399406
400−#define USER_VSID_RANGE (1UL << (USER_ESID_BITS + SID_SHIFT))
407+#define USER_VSID_RANGE (1UL << (ESID_BITS + SID_SHIFT))
401408
402409 /*
403410 * This macro generates asm code to compute the VSID scramble
@@ -421,7 +428,8 @@ extern void slb_set_size(u16 size); · 17 unmodified lines
421428 srdi rx,rt,VSID_BITS_##size; \
422429 clrldi rt,rt,(64-VSID_BITS_##size); \
423430 add rt,rt,rx; /* add high and low bits */ \
424− /* Now, r3 == VSID (mod 2^36-1), and lies between 0 and \
431+ /* NOTE: explanation based on VSID_BITS_##size = 36 \
432+ * Now, r3 == VSID (mod 2^36-1), and lies between 0 and \
425433 * 2^36-1+2^28-1. That in particular means that if r3 >= \
426434 * 2^36-1, then r3+1 has the 2^36 bit set. So, if r3+1 has \
427435 * the bit clear, r3 already has the answer we want, if it \
@@ -513,34 +521,6 @@ typedef struct { · 85 unmodified lines
513521 })
514522 #endif /* 1 */
515523
516−/*
517− * This is only valid for addresses >= PAGE_OFFSET
518− * The proto-VSID space is divided into two class
519− * User: 0 to 2^(CONTEXT_BITS + USER_ESID_BITS) -1
520− * kernel: 2^(CONTEXT_BITS + USER_ESID_BITS) to 2^(VSID_BITS) - 1
521− *
522− * With KERNEL_START at 0xc000000000000000, the proto vsid for
523− * the kernel ends up with 0xc00000000 (36 bits). With 64TB
524− * support we need to have kernel proto-VSID in the
525− * [2^37 to 2^38 - 1] range due to the increased USER_ESID_BITS.
526− */
527−static inline unsigned long get_kernel_vsid(unsigned long ea, int ssize)
528−{
529− unsigned long proto_vsid;
530− /*
531− * We need to make sure proto_vsid for the kernel is
532− * >= 2^(CONTEXT_BITS + USER_ESID_BITS[_1T])
533− */
534− if (ssize == MMU_SEGSIZE_256M) {
535− proto_vsid = ea >> SID_SHIFT;
536− proto_vsid |= (1UL << (CONTEXT_BITS + USER_ESID_BITS));
537− return vsid_scramble(proto_vsid, 256M);
538− }
539− proto_vsid = ea >> SID_SHIFT_1T;
540− proto_vsid |= (1UL << (CONTEXT_BITS + USER_ESID_BITS_1T));
541− return vsid_scramble(proto_vsid, 1T);
542−}
543−
544524 /* Returns the segment size indicator for a user address */
545525 static inline int user_segment_size(unsigned long addr)
546526 {
@@ -550,17 +530,41 @@ static inline int user_segment_size(unsigned long addr) · 3 unmodified lines
550530 return MMU_SEGSIZE_256M;
551531 }
552532
553−/* This is only valid for user addresses (which are below 2^44) */
554533 static inline unsigned long get_vsid(unsigned long context, unsigned long ea,
555534 int ssize)
556535 {
536+ /*
537+ * Bad address. We return VSID 0 for that
538+ */
539+ if ((ea & ~REGION_MASK) >= PGTABLE_RANGE)
540+ return 0;
541+
557542 if (ssize == MMU_SEGSIZE_256M)
558− return vsid_scramble((context << USER_ESID_BITS)
543+ return vsid_scramble((context << ESID_BITS)
559544 | (ea >> SID_SHIFT), 256M);
560− return vsid_scramble((context << USER_ESID_BITS_1T)
545+ return vsid_scramble((context << ESID_BITS_1T)
561546 | (ea >> SID_SHIFT_1T), 1T);
562547 }
563548
549+/*
550+ * This is only valid for addresses >= PAGE_OFFSET
551+ *
552+ * For kernel space, we use the top 4 context ids to map address as below
553+ * 0x7fffc - [ 0xc000000000000000 - 0xc0003fffffffffff ]
554+ * 0x7fffd - [ 0xd000000000000000 - 0xd0003fffffffffff ]
555+ * 0x7fffe - [ 0xe000000000000000 - 0xe0003fffffffffff ]
556+ * 0x7ffff - [ 0xf000000000000000 - 0xf0003fffffffffff ]
557+ */
558+static inline unsigned long get_kernel_vsid(unsigned long ea, int ssize)
559+{
560+ unsigned long context;
561+
562+ /*
563+ * kernel take the top 4 context from the available range
564+ */
565+ context = (MAX_USER_CONTEXT) + ((ea >> 60) - 0xc) + 1;
566+ return get_vsid(context, ea, ssize);
567+}
564568 #endif /* __ASSEMBLY__ */
565569
566570 #endif /* _ASM_POWERPC_MMU_HASH64_H_ */
arch/powerpc/kernel/cputable.c+1−1
@@ -275,7 +275,7 @@ static struct cpu_spec __initdata cpu_specs[] = { · 274 unmodified lines
275275 .cpu_features = CPU_FTRS_PPC970,
276276 .cpu_user_features = COMMON_USER_POWER4 |
277277 PPC_FEATURE_HAS_ALTIVEC_COMP,
278− .mmu_features = MMU_FTR_HPTE_TABLE,
278+ .mmu_features = MMU_FTRS_PPC970,
279279 .icache_bsize = 128,
280280 .dcache_bsize = 128,
281281 .num_pmcs = 8,
arch/powerpc/kernel/entry_64.S+2−2
@@ -304,7 +304,7 @@ syscall_exit_work: · 303 unmodified lines
304304 subi r12,r12,TI_FLAGS
305305
306306 4: /* Anything else left to do? */
307− SET_DEFAULT_THREAD_PPR(r3, r9) /* Set thread.ppr = 3 */
307+ SET_DEFAULT_THREAD_PPR(r3, r10) /* Set thread.ppr = 3 */
308308 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
309309 beq .ret_from_except_lite
310310
@@ -657,7 +657,7 @@ resume_kernel: · 346 unmodified lines
657657 /* Clear _TIF_EMULATE_STACK_STORE flag */
658658 lis r11,_TIF_EMULATE_STACK_STORE@h
659659 addi r5,r9,TI_FLAGS
660− ldarx r4,0,r5
660+0: ldarx r4,0,r5
661661 andc r4,r4,r11
662662 stdcx. r4,0,r5
663663 bne- 0b
arch/powerpc/kernel/epapr_paravirt.c+6−0
@@ -23,8 +23,10 @@ · 22 unmodified lines
2323 #include <asm/code-patching.h>
2424 #include <asm/machdep.h>
2525
26+#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
2627 extern void epapr_ev_idle(void);
2728 extern u32 epapr_ev_idle_start[];
29+#endif
2830
2931 bool epapr_paravirt_enabled;
3032
@@ -47,11 +49,15 @@ static int __init epapr_paravirt_init(void) · 16 unmodified lines
4749
4850 for (i = 0; i < (len / 4); i++) {
4951 patch_instruction(epapr_hypercall_start + i, insts[i]);
52+#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
5053 patch_instruction(epapr_ev_idle_start + i, insts[i]);
54+#endif
5155 }
5256
57+#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
5358 if (of_get_property(hyper_node, "has-idle", NULL))
5459 ppc_md.power_save = epapr_ev_idle;
60+#endif
5561
5662 epapr_paravirt_enabled = true;
5763
arch/powerpc/kernel/exceptions-64s.S+97−81
@@ -1066,78 +1066,6 @@ unrecov_user_slb: · 1065 unmodified lines
10661066 #endif /* __DISABLED__ */
10671067
10681068
1069−/*
1070− * r13 points to the PACA, r9 contains the saved CR,
1071− * r12 contain the saved SRR1, SRR0 is still ready for return
1072− * r3 has the faulting address
1073− * r9 - r13 are saved in paca->exslb.
1074− * r3 is saved in paca->slb_r3
1075− * We assume we aren't going to take any exceptions during this procedure.
1076− */
1077−_GLOBAL(slb_miss_realmode)
1078− mflr r10
1079−#ifdef CONFIG_RELOCATABLE
1080− mtctr r11
1081−#endif
1082−
1083− stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
1084− std r10,PACA_EXSLB+EX_LR(r13) /* save LR */
1085−
1086− bl .slb_allocate_realmode
1087−
1088− /* All done -- return from exception. */
1089−
1090− ld r10,PACA_EXSLB+EX_LR(r13)
1091− ld r3,PACA_EXSLB+EX_R3(r13)
1092− lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
1093−
1094− mtlr r10
1095−
1096− andi. r10,r12,MSR_RI /* check for unrecoverable exception */
1097− beq- 2f
1098−
1099−.machine push
1100−.machine "power4"
1101− mtcrf 0x80,r9
1102− mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */
1103−.machine pop
1104−
1105− RESTORE_PPR_PACA(PACA_EXSLB, r9)
1106− ld r9,PACA_EXSLB+EX_R9(r13)
1107− ld r10,PACA_EXSLB+EX_R10(r13)
1108− ld r11,PACA_EXSLB+EX_R11(r13)
1109− ld r12,PACA_EXSLB+EX_R12(r13)
1110− ld r13,PACA_EXSLB+EX_R13(r13)
1111− rfid
1112− b . /* prevent speculative execution */
1113−
1114−2: mfspr r11,SPRN_SRR0
1115− ld r10,PACAKBASE(r13)
1116− LOAD_HANDLER(r10,unrecov_slb)
1117− mtspr SPRN_SRR0,r10
1118− ld r10,PACAKMSR(r13)
1119− mtspr SPRN_SRR1,r10
1120− rfid
1121− b .
1122−
1123−unrecov_slb:
1124− EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
1125− DISABLE_INTS
1126− bl .save_nvgprs
1127−1: addi r3,r1,STACK_FRAME_OVERHEAD
1128− bl .unrecoverable_exception
1129− b 1b
1130−
1131−
1132−#ifdef CONFIG_PPC_970_NAP
1133−power4_fixup_nap:
1134− andc r9,r9,r10
1135− std r9,TI_LOCAL_FLAGS(r11)
1136− ld r10,_LINK(r1) /* make idle task do the */
1137− std r10,_NIP(r1) /* equivalent of a blr */
1138− blr
1139−#endif
1140−
11411069 .align 7
11421070 .globl alignment_common
11431071 alignment_common:
@@ -1335,6 +1263,78 @@ _GLOBAL(opal_mc_secondary_handler) · 191 unmodified lines
13351263 #endif /* CONFIG_PPC_POWERNV */
13361264
13371265
1266+/*
1267+ * r13 points to the PACA, r9 contains the saved CR,
1268+ * r12 contain the saved SRR1, SRR0 is still ready for return
1269+ * r3 has the faulting address
1270+ * r9 - r13 are saved in paca->exslb.
1271+ * r3 is saved in paca->slb_r3
1272+ * We assume we aren't going to take any exceptions during this procedure.
1273+ */
1274+_GLOBAL(slb_miss_realmode)
1275+ mflr r10
1276+#ifdef CONFIG_RELOCATABLE
1277+ mtctr r11
1278+#endif
1279+
1280+ stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
1281+ std r10,PACA_EXSLB+EX_LR(r13) /* save LR */
1282+
1283+ bl .slb_allocate_realmode
1284+
1285+ /* All done -- return from exception. */
1286+
1287+ ld r10,PACA_EXSLB+EX_LR(r13)
1288+ ld r3,PACA_EXSLB+EX_R3(r13)
1289+ lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
1290+
1291+ mtlr r10
1292+
1293+ andi. r10,r12,MSR_RI /* check for unrecoverable exception */
1294+ beq- 2f
1295+
1296+.machine push
1297+.machine "power4"
1298+ mtcrf 0x80,r9
1299+ mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */
1300+.machine pop
1301+
1302+ RESTORE_PPR_PACA(PACA_EXSLB, r9)
1303+ ld r9,PACA_EXSLB+EX_R9(r13)
1304+ ld r10,PACA_EXSLB+EX_R10(r13)
1305+ ld r11,PACA_EXSLB+EX_R11(r13)
1306+ ld r12,PACA_EXSLB+EX_R12(r13)
1307+ ld r13,PACA_EXSLB+EX_R13(r13)
1308+ rfid
1309+ b . /* prevent speculative execution */
1310+
1311+2: mfspr r11,SPRN_SRR0
1312+ ld r10,PACAKBASE(r13)
1313+ LOAD_HANDLER(r10,unrecov_slb)
1314+ mtspr SPRN_SRR0,r10
1315+ ld r10,PACAKMSR(r13)
1316+ mtspr SPRN_SRR1,r10
1317+ rfid
1318+ b .
1319+
1320+unrecov_slb:
1321+ EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
1322+ DISABLE_INTS
1323+ bl .save_nvgprs
1324+1: addi r3,r1,STACK_FRAME_OVERHEAD
1325+ bl .unrecoverable_exception
1326+ b 1b
1327+
1328+
1329+#ifdef CONFIG_PPC_970_NAP
1330+power4_fixup_nap:
1331+ andc r9,r9,r10
1332+ std r9,TI_LOCAL_FLAGS(r11)
1333+ ld r10,_LINK(r1) /* make idle task do the */
1334+ std r10,_NIP(r1) /* equivalent of a blr */
1335+ blr
1336+#endif
1337+
13381338 /*
13391339 * Hash table stuff
13401340 */
@@ -1452,20 +1452,36 @@ do_ste_alloc: · 111 unmodified lines
14521452 _GLOBAL(do_stab_bolted)
14531453 stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
14541454 std r11,PACA_EXSLB+EX_SRR0(r13) /* save SRR0 in exc. frame */
1455+ mfspr r11,SPRN_DAR /* ea */
14551456
1457+ /*
1458+ * check for bad kernel/user address
1459+ * (ea & ~REGION_MASK) >= PGTABLE_RANGE
1460+ */
1461+ rldicr. r9,r11,4,(63 - 46 - 4)
1462+ li r9,0 /* VSID = 0 for bad address */
1463+ bne- 0f
1464+
1465+ /*
1466+ * Calculate VSID:
1467+ * This is the kernel vsid, we take the top for context from
1468+ * the range. context = (MAX_USER_CONTEXT) + ((ea >> 60) - 0xc) + 1
1469+ * Here we know that (ea >> 60) == 0xc
1470+ */
1471+ lis r9,(MAX_USER_CONTEXT + 1)@ha
1472+ addi r9,r9,(MAX_USER_CONTEXT + 1)@l
1473+
1474+ srdi r10,r11,SID_SHIFT
1475+ rldimi r10,r9,ESID_BITS,0 /* proto vsid */
1476+ ASM_VSID_SCRAMBLE(r10, r9, 256M)
1477+ rldic r9,r10,12,16 /* r9 = vsid << 12 */
1478+
1479+0:
14561480 /* Hash to the primary group */
14571481 ld r10,PACASTABVIRT(r13)
1458− mfspr r11,SPRN_DAR
1459− srdi r11,r11,28
1482+ srdi r11,r11,SID_SHIFT
14601483 rldimi r10,r11,7,52 /* r10 = first ste of the group */
14611484
1462− /* Calculate VSID */
1463− /* This is a kernel address, so protovsid = ESID | 1 << 37 */
1464− li r9,0x1
1465− rldimi r11,r9,(CONTEXT_BITS + USER_ESID_BITS),0
1466− ASM_VSID_SCRAMBLE(r11, r9, 256M)
1467− rldic r9,r11,12,16 /* r9 = vsid << 12 */
1468−
14691485 /* Search the primary group for a free entry */
14701486 1: ld r11,0(r10) /* Test valid bit of the current ste */
14711487 andi. r11,r11,0x80
arch/powerpc/kernel/process.c+2−0
@@ -555,10 +555,12 @@ static inline void tm_recheckpoint_new_task(struct task_struct *new) · 554 unmodified lines
555555 new->thread.regs->msr |=
556556 (MSR_FP | new->thread.fpexc_mode);
557557 }
558+#ifdef CONFIG_ALTIVEC
558559 if (msr & MSR_VEC) {
559560 do_load_up_transact_altivec(&new->thread);
560561 new->thread.regs->msr |= MSR_VEC;
561562 }
563+#endif
562564 /* We may as well turn on VSX too since all the state is restored now */
563565 if (msr & MSR_VSX)
564566 new->thread.regs->msr |= MSR_VSX;
arch/powerpc/kernel/prom_init.c+7−7
@@ -2832,11 +2832,13 @@ static void unreloc_toc(void) · 2831 unmodified lines
28322832 {
28332833 }
28342834 #else
2835−static void __reloc_toc(void *tocstart, unsigned long offset,
2836− unsigned long nr_entries)
2835+static void __reloc_toc(unsigned long offset, unsigned long nr_entries)
28372836 {
28382837 unsigned long i;
2839− unsigned long *toc_entry = (unsigned long *)tocstart;
2838+ unsigned long *toc_entry;
2839+
2840+ /* Get the start of the TOC by using r2 directly. */
2841+ asm volatile("addi %0,2,-0x8000" : "=b" (toc_entry));
28402842
28412843 for (i = 0; i < nr_entries; i++) {
28422844 *toc_entry = *toc_entry + offset;
@@ -2850,8 +2852,7 @@ static void reloc_toc(void) · 7 unmodified lines
28502852 unsigned long nr_entries =
28512853 (__prom_init_toc_end - __prom_init_toc_start) / sizeof(long);
28522854
2853− /* Need to add offset to get at __prom_init_toc_start */
2854− __reloc_toc(__prom_init_toc_start + offset, offset, nr_entries);
2855+ __reloc_toc(offset, nr_entries);
28552856
28562857 mb();
28572858 }
@@ -2864,8 +2865,7 @@ static void unreloc_toc(void) · 6 unmodified lines
28642865
28652866 mb();
28662867
2867− /* __prom_init_toc_start has been relocated, no need to add offset */
2868− __reloc_toc(__prom_init_toc_start, -offset, nr_entries);
2868+ __reloc_toc(-offset, nr_entries);
28692869 }
28702870 #endif
28712871 #endif
arch/powerpc/kernel/ptrace.c+1−0
@@ -1428,6 +1428,7 @@ static long ppc_set_hwdebug(struct task_struct *child, · 1427 unmodified lines
14281428
14291429 brk.address = bp_info->addr & ~7UL;
14301430 brk.type = HW_BRK_TYPE_TRANSLATE;
1431+ brk.len = 8;
14311432 if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_READ)
14321433 brk.type |= HW_BRK_TYPE_READ;
14331434 if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_WRITE)
arch/powerpc/kernel/signal_32.c+2−0
@@ -866,10 +866,12 @@ static long restore_tm_user_regs(struct pt_regs *regs, · 865 unmodified lines
866866 do_load_up_transact_fpu(&current->thread);
867867 regs->msr |= (MSR_FP | current->thread.fpexc_mode);
868868 }
869+#ifdef CONFIG_ALTIVEC
869870 if (msr & MSR_VEC) {
870871 do_load_up_transact_altivec(&current->thread);
871872 regs->msr |= MSR_VEC;
872873 }
874+#endif
873875
874876 return 0;
875877 }
arch/powerpc/kernel/signal_64.c+2−0
@@ -522,10 +522,12 @@ static long restore_tm_sigcontexts(struct pt_regs *regs, · 521 unmodified lines
522522 do_load_up_transact_fpu(&current->thread);
523523 regs->msr |= (MSR_FP | current->thread.fpexc_mode);
524524 }
525+#ifdef CONFIG_ALTIVEC
525526 if (msr & MSR_VEC) {
526527 do_load_up_transact_altivec(&current->thread);
527528 regs->msr |= MSR_VEC;
528529 }
530+#endif
529531
530532 return err;
531533 }
arch/powerpc/kernel/tm.S+2−0
@@ -309,6 +309,7 @@ _GLOBAL(tm_recheckpoint) · 308 unmodified lines
309309 or r5, r6, r5 /* Set MSR.FP+.VSX/.VEC */
310310 mtmsr r5
311311
312+#ifdef CONFIG_ALTIVEC
312313 /* FP and VEC registers: These are recheckpointed from thread.fpr[]
313314 * and thread.vr[] respectively. The thread.transact_fpr[] version
314315 * is more modern, and will be loaded subsequently by any FPUnavailable
@@ -323,6 +324,7 @@ _GLOBAL(tm_recheckpoint) · 8 unmodified lines
323324 REST_32VRS(0, r5, r3) /* r5 scratch, r3 THREAD ptr */
324325 ld r5, THREAD_VRSAVE(r3)
325326 mtspr SPRN_VRSAVE, r5
327+#endif
326328
327329 dont_restore_vec:
328330 andi. r0, r4, MSR_FP
arch/powerpc/kvm/book3s_64_mmu_host.c+2−2
@@ -326,8 +326,8 @@ int kvmppc_mmu_init(struct kvm_vcpu *vcpu) · 325 unmodified lines
326326 vcpu3s->context_id[0] = err;
327327
328328 vcpu3s->proto_vsid_max = ((vcpu3s->context_id[0] + 1)
329− << USER_ESID_BITS) - 1;
330− vcpu3s->proto_vsid_first = vcpu3s->context_id[0] << USER_ESID_BITS;
329+ << ESID_BITS) - 1;
330+ vcpu3s->proto_vsid_first = vcpu3s->context_id[0] << ESID_BITS;
331331 vcpu3s->proto_vsid_next = vcpu3s->proto_vsid_first;
332332
333333 kvmppc_mmu_hpte_init(vcpu);
arch/powerpc/kvm/e500.h+8−16
@@ -26,17 +26,20 @@ · 25 unmodified lines
2626 #define E500_PID_NUM 3
2727 #define E500_TLB_NUM 2
2828
29−#define E500_TLB_VALID 1
30−#define E500_TLB_BITMAP 2
29+/* entry is mapped somewhere in host TLB */
30+#define E500_TLB_VALID (1 << 0)
31+/* TLB1 entry is mapped by host TLB1, tracked by bitmaps */
32+#define E500_TLB_BITMAP (1 << 1)
33+/* TLB1 entry is mapped by host TLB0 */
3134 #define E500_TLB_TLB0 (1 << 2)
3235
3336 struct tlbe_ref {
34− pfn_t pfn;
35− unsigned int flags; /* E500_TLB_* */
37+ pfn_t pfn; /* valid only for TLB0, except briefly */
38+ unsigned int flags; /* E500_TLB_* */
3639 };
3740
3841 struct tlbe_priv {
39− struct tlbe_ref ref; /* TLB0 only -- TLB1 uses tlb_refs */
42+ struct tlbe_ref ref;
4043 };
4144
4245 #ifdef CONFIG_KVM_E500V2
@@ -63,17 +66,6 @@ struct kvmppc_vcpu_e500 { · 20 unmodified lines
6366
6467 unsigned int gtlb_nv[E500_TLB_NUM];
6568
66− /*
67− * information associated with each host TLB entry --
68− * TLB1 only for now. If/when guest TLB1 entries can be
69− * mapped with host TLB0, this will be used for that too.
70− *
71− * We don't want to use this for guest TLB0 because then we'd
72− * have the overhead of doing the translation again even if
73− * the entry is still in the guest TLB (e.g. we swapped out
74− * and back, and our host TLB entries got evicted).
75− */
76− struct tlbe_ref *tlb_refs[E500_TLB_NUM];
7769 unsigned int host_tlb1_nv;
7870
7971 u32 svr;
arch/powerpc/kvm/e500_mmu_host.c+27−57
@@ -193,8 +193,11 @@ void inval_gtlbe_on_host(struct kvmppc_vcpu_e500 *vcpu_e500, int tlbsel, · 192 unmodified lines
193193 struct tlbe_ref *ref = &vcpu_e500->gtlb_priv[tlbsel][esel].ref;
194194
195195 /* Don't bother with unmapped entries */
196− if (!(ref->flags & E500_TLB_VALID))
197− return;
196+ if (!(ref->flags & E500_TLB_VALID)) {
197+ WARN(ref->flags & (E500_TLB_BITMAP | E500_TLB_TLB0),
198+ "%s: flags %x\n", __func__, ref->flags);
199+ WARN_ON(tlbsel == 1 && vcpu_e500->g2h_tlb1_map[esel]);
200+ }
198201
199202 if (tlbsel == 1 && ref->flags & E500_TLB_BITMAP) {
200203 u64 tmp = vcpu_e500->g2h_tlb1_map[esel];
@@ -248,7 +251,7 @@ static inline void kvmppc_e500_ref_setup(struct tlbe_ref *ref, · 47 unmodified lines
248251 pfn_t pfn)
249252 {
250253 ref->pfn = pfn;
251− ref->flags = E500_TLB_VALID;
254+ ref->flags |= E500_TLB_VALID;
252255
253256 if (tlbe_is_writable(gtlbe))
254257 kvm_set_pfn_dirty(pfn);
@@ -257,6 +260,7 @@ static inline void kvmppc_e500_ref_setup(struct tlbe_ref *ref, · 2 unmodified lines
257260 static inline void kvmppc_e500_ref_release(struct tlbe_ref *ref)
258261 {
259262 if (ref->flags & E500_TLB_VALID) {
263+ /* FIXME: don't log bogus pfn for TLB1 */
260264 trace_kvm_booke206_ref_release(ref->pfn, ref->flags);
261265 ref->flags = 0;
262266 }
@@ -274,36 +278,23 @@ static void clear_tlb1_bitmap(struct kvmppc_vcpu_e500 *vcpu_e500) · 11 unmodified lines
274278
275279 static void clear_tlb_privs(struct kvmppc_vcpu_e500 *vcpu_e500)
276280 {
277− int tlbsel = 0;
278− int i;
279−
280− for (i = 0; i < vcpu_e500->gtlb_params[tlbsel].entries; i++) {
281− struct tlbe_ref *ref =
282− &vcpu_e500->gtlb_priv[tlbsel][i].ref;
283− kvmppc_e500_ref_release(ref);
284− }
285−}
286−
287−static void clear_tlb_refs(struct kvmppc_vcpu_e500 *vcpu_e500)
288−{
289− int stlbsel = 1;
281+ int tlbsel;
290282 int i;
291283
292− kvmppc_e500_tlbil_all(vcpu_e500);
293−
294− for (i = 0; i < host_tlb_params[stlbsel].entries; i++) {
295− struct tlbe_ref *ref =
296− &vcpu_e500->tlb_refs[stlbsel][i];
297− kvmppc_e500_ref_release(ref);
284+ for (tlbsel = 0; tlbsel <= 1; tlbsel++) {
285+ for (i = 0; i < vcpu_e500->gtlb_params[tlbsel].entries; i++) {
286+ struct tlbe_ref *ref =
287+ &vcpu_e500->gtlb_priv[tlbsel][i].ref;
288+ kvmppc_e500_ref_release(ref);
289+ }
298290 }
299−
300− clear_tlb_privs(vcpu_e500);
301291 }
302292
303293 void kvmppc_core_flush_tlb(struct kvm_vcpu *vcpu)
304294 {
305295 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
306− clear_tlb_refs(vcpu_e500);
296+ kvmppc_e500_tlbil_all(vcpu_e500);
297+ clear_tlb_privs(vcpu_e500);
307298 clear_tlb1_bitmap(vcpu_e500);
308299 }
309300
@@ -458,8 +449,6 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, · 148 unmodified lines
458449 gvaddr &= ~((tsize_pages << PAGE_SHIFT) - 1);
459450 }
460451
461− /* Drop old ref and setup new one. */
462− kvmppc_e500_ref_release(ref);
463452 kvmppc_e500_ref_setup(ref, gtlbe, pfn);
464453
465454 kvmppc_e500_setup_stlbe(&vcpu_e500->vcpu, gtlbe, tsize,
@@ -507,14 +496,15 @@ static int kvmppc_e500_tlb1_map_tlb1(struct kvmppc_vcpu_e500 *vcpu_e500, · 41 unmodified lines
507496 if (unlikely(vcpu_e500->host_tlb1_nv >= tlb1_max_shadow_size()))
508497 vcpu_e500->host_tlb1_nv = 0;
509498
510− vcpu_e500->tlb_refs[1][sesel] = *ref;
511− vcpu_e500->g2h_tlb1_map[esel] |= (u64)1 << sesel;
512− vcpu_e500->gtlb_priv[1][esel].ref.flags |= E500_TLB_BITMAP;
513499 if (vcpu_e500->h2g_tlb1_rmap[sesel]) {
514− unsigned int idx = vcpu_e500->h2g_tlb1_rmap[sesel];
500+ unsigned int idx = vcpu_e500->h2g_tlb1_rmap[sesel] - 1;
515501 vcpu_e500->g2h_tlb1_map[idx] &= ~(1ULL << sesel);
516502 }
517− vcpu_e500->h2g_tlb1_rmap[sesel] = esel;
503+
504+ vcpu_e500->gtlb_priv[1][esel].ref.flags |= E500_TLB_BITMAP;
505+ vcpu_e500->g2h_tlb1_map[esel] |= (u64)1 << sesel;
506+ vcpu_e500->h2g_tlb1_rmap[sesel] = esel + 1;
507+ WARN_ON(!(ref->flags & E500_TLB_VALID));
518508
519509 return sesel;
520510 }
@@ -526,13 +516,12 @@ static int kvmppc_e500_tlb1_map(struct kvmppc_vcpu_e500 *vcpu_e500, · 5 unmodified lines
526516 u64 gvaddr, gfn_t gfn, struct kvm_book3e_206_tlb_entry *gtlbe,
527517 struct kvm_book3e_206_tlb_entry *stlbe, int esel)
528518 {
529− struct tlbe_ref ref;
519+ struct tlbe_ref *ref = &vcpu_e500->gtlb_priv[1][esel].ref;
530520 int sesel;
531521 int r;
532522
533− ref.flags = 0;
534523 r = kvmppc_e500_shadow_map(vcpu_e500, gvaddr, gfn, gtlbe, 1, stlbe,
535− &ref);
524+ ref);
536525 if (r)
537526 return r;
538527
@@ -544,7 +533,7 @@ static int kvmppc_e500_tlb1_map(struct kvmppc_vcpu_e500 *vcpu_e500, · 5 unmodified lines
544533 }
545534
546535 /* Otherwise map into TLB1 */
547− sesel = kvmppc_e500_tlb1_map_tlb1(vcpu_e500, &ref, esel);
536+ sesel = kvmppc_e500_tlb1_map_tlb1(vcpu_e500, ref, esel);
548537 write_stlbe(vcpu_e500, gtlbe, stlbe, 1, sesel);
549538
550539 return 0;
@@ -565,7 +554,7 @@ void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 eaddr, gpa_t gpaddr, · 14 unmodified lines
565554 case 0:
566555 priv = &vcpu_e500->gtlb_priv[tlbsel][esel];
567556
568− /* Triggers after clear_tlb_refs or on initial mapping */
557+ /* Triggers after clear_tlb_privs or on initial mapping */
569558 if (!(priv->ref.flags & E500_TLB_VALID)) {
570559 kvmppc_e500_tlb0_map(vcpu_e500, esel, &stlbe);
571560 } else {
@@ -665,35 +654,16 @@ int e500_mmu_host_init(struct kvmppc_vcpu_e500 *vcpu_e500) · 93 unmodified lines
665654 host_tlb_params[0].entries / host_tlb_params[0].ways;
666655 host_tlb_params[1].sets = 1;
667656
668− vcpu_e500->tlb_refs[0] =
669− kzalloc(sizeof(struct tlbe_ref) * host_tlb_params[0].entries,
670− GFP_KERNEL);
671− if (!vcpu_e500->tlb_refs[0])
672− goto err;
673−
674− vcpu_e500->tlb_refs[1] =
675− kzalloc(sizeof(struct tlbe_ref) * host_tlb_params[1].entries,
676− GFP_KERNEL);
677− if (!vcpu_e500->tlb_refs[1])
678− goto err;
679−
680657 vcpu_e500->h2g_tlb1_rmap = kzalloc(sizeof(unsigned int) *
681658 host_tlb_params[1].entries,
682659 GFP_KERNEL);
683660 if (!vcpu_e500->h2g_tlb1_rmap)
684− goto err;
661+ return -EINVAL;
685662
686663 return 0;
687−
688−err:
689− kfree(vcpu_e500->tlb_refs[0]);
690− kfree(vcpu_e500->tlb_refs[1]);
691− return -EINVAL;
692664 }
693665
694666 void e500_mmu_host_uninit(struct kvmppc_vcpu_e500 *vcpu_e500)
695667 {
696668 kfree(vcpu_e500->h2g_tlb1_rmap);
697− kfree(vcpu_e500->tlb_refs[0]);
698− kfree(vcpu_e500->tlb_refs[1]);
699669 }
arch/powerpc/kvm/e500mc.c+6−1
@@ -108,6 +108,8 @@ void kvmppc_mmu_msr_notify(struct kvm_vcpu *vcpu, u32 old_msr) · 107 unmodified lines
108108 {
109109 }
110110
111+static DEFINE_PER_CPU(struct kvm_vcpu *, last_vcpu_on_cpu);
112+
111113 void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
112114 {
113115 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
@@ -136,8 +138,11 @@ void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu) · 22 unmodified lines
136138 mtspr(SPRN_GDEAR, vcpu->arch.shared->dar);
137139 mtspr(SPRN_GESR, vcpu->arch.shared->esr);
138140
139− if (vcpu->arch.oldpir != mfspr(SPRN_PIR))
141+ if (vcpu->arch.oldpir != mfspr(SPRN_PIR) ||
142+ __get_cpu_var(last_vcpu_on_cpu) != vcpu) {
140143 kvmppc_e500_tlbil_all(vcpu_e500);
144+ __get_cpu_var(last_vcpu_on_cpu) = vcpu;
145+ }
141146
142147 kvmppc_load_guest_fp(vcpu);
143148 }
arch/powerpc/mm/hash_utils_64.c+17−5
@@ -195,6 +195,11 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend, · 194 unmodified lines
195195 unsigned long vpn = hpt_vpn(vaddr, vsid, ssize);
196196 unsigned long tprot = prot;
197197
198+ /*
199+ * If we hit a bad address return error.
200+ */
201+ if (!vsid)
202+ return -1;
198203 /* Make kernel text executable */
199204 if (overlaps_kernel_text(vaddr, vaddr + step))
200205 tprot &= ~HPTE_R_N;
@@ -759,6 +764,8 @@ void __init early_init_mmu(void) · 558 unmodified lines
759764 /* Initialize stab / SLB management */
760765 if (mmu_has_feature(MMU_FTR_SLB))
761766 slb_initialize();
767+ else
768+ stab_initialize(get_paca()->stab_real);
762769 }
763770
764771 #ifdef CONFIG_SMP
@@ -922,11 +929,6 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap) · 157 unmodified lines
922929 DBG_LOW("hash_page(ea=%016lx, access=%lx, trap=%lx\n",
923930 ea, access, trap);
924931
925− if ((ea & ~REGION_MASK) >= PGTABLE_RANGE) {
926− DBG_LOW(" out of pgtable range !\n");
927− return 1;
928− }
929−
930932 /* Get region & vsid */
931933 switch (REGION_ID(ea)) {
932934 case USER_REGION_ID:
@@ -957,6 +959,11 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap) · 24 unmodified lines
957959 }
958960 DBG_LOW(" mm=%p, mm->pgdir=%p, vsid=%016lx\n", mm, mm->pgd, vsid);
959961
962+ /* Bad address. */
963+ if (!vsid) {
964+ DBG_LOW("Bad address!\n");
965+ return 1;
966+ }
960967 /* Get pgdir */
961968 pgdir = mm->pgd;
962969 if (pgdir == NULL)
@@ -1126,6 +1133,8 @@ void hash_preload(struct mm_struct *mm, unsigned long ea, · 163 unmodified lines
11261133 /* Get VSID */
11271134 ssize = user_segment_size(ea);
11281135 vsid = get_vsid(mm->context.id, ea, ssize);
1136+ if (!vsid)
1137+ return;
11291138
11301139 /* Hash doesn't like irqs */
11311140 local_irq_save(flags);
@@ -1233,6 +1242,9 @@ static void kernel_map_linear_page(unsigned long vaddr, unsigned long lmi) · 101 unmodified lines
12331242 hash = hpt_hash(vpn, PAGE_SHIFT, mmu_kernel_ssize);
12341243 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
12351244
1245+ /* Don't create HPTE entries for bad address */
1246+ if (!vsid)
1247+ return;
12361248 ret = ppc_md.hpte_insert(hpteg, vpn, __pa(vaddr),
12371249 mode, HPTE_V_BOLTED,
12381250 mmu_linear_psize, mmu_kernel_ssize);
arch/powerpc/mm/mmu_context_hash64.c+1−10
@@ -29,15 +29,6 @@ · 28 unmodified lines
2929 static DEFINE_SPINLOCK(mmu_context_lock);
3030 static DEFINE_IDA(mmu_context_ida);
3131
32−/*
33− * 256MB segment
34− * The proto-VSID space has 2^(CONTEX_BITS + USER_ESID_BITS) - 1 segments
35− * available for user mappings. Each segment contains 2^28 bytes. Each
36− * context maps 2^46 bytes (64TB) so we can support 2^19-1 contexts
37− * (19 == 37 + 28 - 46).
38− */
39−#define MAX_CONTEXT ((1UL << CONTEXT_BITS) - 1)
40−
4132 int __init_new_context(void)
4233 {
4334 int index;
@@ -56,7 +47,7 @@ again: · 12 unmodified lines
5647 else if (err)
5748 return err;
5849
59− if (index > MAX_CONTEXT) {
50+ if (index > MAX_USER_CONTEXT) {
6051 spin_lock(&mmu_context_lock);
6152 ida_remove(&mmu_context_ida, index);
6253 spin_unlock(&mmu_context_lock);
arch/powerpc/mm/pgtable_64.c+1−1
@@ -61,7 +61,7 @@ · 60 unmodified lines
6161 #endif
6262
6363 #ifdef CONFIG_PPC_STD_MMU_64
64−#if TASK_SIZE_USER64 > (1UL << (USER_ESID_BITS + SID_SHIFT))
64+#if TASK_SIZE_USER64 > (1UL << (ESID_BITS + SID_SHIFT))
6565 #error TASK_SIZE_USER64 exceeds user VSID range
6666 #endif
6767 #endif
arch/powerpc/mm/slb_low.S+25−25
@@ -31,10 +31,15 @@ · 30 unmodified lines
3131 * No other registers are examined or changed.
3232 */
3333 _GLOBAL(slb_allocate_realmode)
34− /* r3 = faulting address */
34+ /*
35+ * check for bad kernel/user address
36+ * (ea & ~REGION_MASK) >= PGTABLE_RANGE
37+ */
38+ rldicr. r9,r3,4,(63 - 46 - 4)
39+ bne- 8f
3540
3641 srdi r9,r3,60 /* get region */
37− srdi r10,r3,28 /* get esid */
42+ srdi r10,r3,SID_SHIFT /* get esid */
3843 cmpldi cr7,r9,0xc /* cmp PAGE_OFFSET for later use */
3944
4045 /* r3 = address, r10 = esid, cr7 = <> PAGE_OFFSET */
@@ -56,12 +61,14 @@ _GLOBAL(slb_allocate_realmode) · 15 unmodified lines
5661 */
5762 _GLOBAL(slb_miss_kernel_load_linear)
5863 li r11,0
59− li r9,0x1
6064 /*
61− * for 1T we shift 12 bits more. slb_finish_load_1T will do
62− * the necessary adjustment
65+ * context = (MAX_USER_CONTEXT) + ((ea >> 60) - 0xc) + 1
66+ * r9 = region id.
6367 */
64− rldimi r10,r9,(CONTEXT_BITS + USER_ESID_BITS),0
68+ addis r9,r9,(MAX_USER_CONTEXT - 0xc + 1)@ha
69+ addi r9,r9,(MAX_USER_CONTEXT - 0xc + 1)@l
70+
71+
6572 BEGIN_FTR_SECTION
6673 b slb_finish_load
6774 END_MMU_FTR_SECTION_IFCLR(MMU_FTR_1T_SEGMENT)
@@ -91,24 +98,19 @@ _GLOBAL(slb_miss_kernel_load_vmemmap) · 23 unmodified lines
9198 _GLOBAL(slb_miss_kernel_load_io)
9299 li r11,0
93100 6:
94− li r9,0x1
95101 /*
96− * for 1T we shift 12 bits more. slb_finish_load_1T will do
97− * the necessary adjustment
102+ * context = (MAX_USER_CONTEXT) + ((ea >> 60) - 0xc) + 1
103+ * r9 = region id.
98104 */
99− rldimi r10,r9,(CONTEXT_BITS + USER_ESID_BITS),0
105+ addis r9,r9,(MAX_USER_CONTEXT - 0xc + 1)@ha
106+ addi r9,r9,(MAX_USER_CONTEXT - 0xc + 1)@l
107+
100108 BEGIN_FTR_SECTION
101109 b slb_finish_load
102110 END_MMU_FTR_SECTION_IFCLR(MMU_FTR_1T_SEGMENT)
103111 b slb_finish_load_1T
104112
105−0: /* user address: proto-VSID = context << 15 | ESID. First check
106− * if the address is within the boundaries of the user region
107− */
108− srdi. r9,r10,USER_ESID_BITS
109− bne- 8f /* invalid ea bits set */
110−
111−
113+0:
112114 /* when using slices, we extract the psize off the slice bitmaps
113115 * and then we need to get the sllp encoding off the mmu_psize_defs
114116 * array.
@@ -164,15 +166,13 @@ END_MMU_FTR_SECTION_IFCLR(MMU_FTR_1T_SEGMENT) · 49 unmodified lines
164166 ld r9,PACACONTEXTID(r13)
165167 BEGIN_FTR_SECTION
166168 cmpldi r10,0x1000
167−END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEGMENT)
168− rldimi r10,r9,USER_ESID_BITS,0
169−BEGIN_FTR_SECTION
170169 bge slb_finish_load_1T
171170 END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEGMENT)
172171 b slb_finish_load
173172
174173 8: /* invalid EA */
175174 li r10,0 /* BAD_VSID */
175+ li r9,0 /* BAD_VSID */
176176 li r11,SLB_VSID_USER /* flags don't much matter */
177177 b slb_finish_load
178178
@@ -221,8 +221,6 @@ _GLOBAL(slb_allocate_user) · 42 unmodified lines
221221
222222 /* get context to calculate proto-VSID */
223223 ld r9,PACACONTEXTID(r13)
224− rldimi r10,r9,USER_ESID_BITS,0
225−
226224 /* fall through slb_finish_load */
227225
228226 #endif /* __DISABLED__ */
@@ -231,9 +229,10 @@ _GLOBAL(slb_allocate_user) · 2 unmodified lines
231229 /*
232230 * Finish loading of an SLB entry and return
233231 *
234− * r3 = EA, r10 = proto-VSID, r11 = flags, clobbers r9, cr7 = <> PAGE_OFFSET
232+ * r3 = EA, r9 = context, r10 = ESID, r11 = flags, clobbers r9, cr7 = <> PAGE_OFFSET
235233 */
236234 slb_finish_load:
235+ rldimi r10,r9,ESID_BITS,0
237236 ASM_VSID_SCRAMBLE(r10,r9,256M)
238237 /*
239238 * bits above VSID_BITS_256M need to be ignored from r10
@@ -298,10 +297,11 @@ _GLOBAL(slb_compare_rr_to_size) · 58 unmodified lines
298297 /*
299298 * Finish loading of a 1T SLB entry (for the kernel linear mapping) and return.
300299 *
301− * r3 = EA, r10 = proto-VSID, r11 = flags, clobbers r9
300+ * r3 = EA, r9 = context, r10 = ESID(256MB), r11 = flags, clobbers r9
302301 */
303302 slb_finish_load_1T:
304− srdi r10,r10,40-28 /* get 1T ESID */
303+ srdi r10,r10,(SID_SHIFT_1T - SID_SHIFT) /* get 1T ESID */
304+ rldimi r10,r9,ESID_BITS_1T,0
305305 ASM_VSID_SCRAMBLE(r10,r9,1T)
306306 /*
307307 * bits above VSID_BITS_1T need to be ignored from r10
arch/powerpc/mm/tlb_hash64.c+1−1
@@ -82,11 +82,11 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr, · 81 unmodified lines
8282 if (!is_kernel_addr(addr)) {
8383 ssize = user_segment_size(addr);
8484 vsid = get_vsid(mm->context.id, addr, ssize);
85− WARN_ON(vsid == 0);
8685 } else {
8786 vsid = get_kernel_vsid(addr, mmu_kernel_ssize);
8887 ssize = mmu_kernel_ssize;
8988 }
89+ WARN_ON(vsid == 0);
9090 vpn = hpt_vpn(addr, vsid, ssize);
9191 rpte = __real_pte(__pte(pte), ptep);
9292
arch/powerpc/perf/power7-pmu.c+13−0
@@ -420,7 +420,20 @@ static struct attribute_group power7_pmu_events_group = { · 419 unmodified lines
420420 .attrs = power7_events_attr,
421421 };
422422
423+PMU_FORMAT_ATTR(event, "config:0-19");
424+
425+static struct attribute *power7_pmu_format_attr[] = {
426+ &format_attr_event.attr,
427+ NULL,
428+};
429+
430+struct attribute_group power7_pmu_format_group = {
431+ .name = "format",
432+ .attrs = power7_pmu_format_attr,
433+};
434+
423435 static const struct attribute_group *power7_pmu_attr_groups[] = {
436+ &power7_pmu_format_group,
424437 &power7_pmu_events_group,
425438 NULL,
426439 };
arch/powerpc/platforms/85xx/sgy_cts1000.c+3−3
@@ -69,7 +69,7 @@ static irqreturn_t gpio_halt_irq(int irq, void *__data) · 68 unmodified lines
6969 return IRQ_HANDLED;
7070 };
7171
72−static int __devinit gpio_halt_probe(struct platform_device *pdev)
72+static int gpio_halt_probe(struct platform_device *pdev)
7373 {
7474 enum of_gpio_flags flags;
7575 struct device_node *node = pdev->dev.of_node;
@@ -128,7 +128,7 @@ static int __devinit gpio_halt_probe(struct platform_device *pdev) · 52 unmodified lines
128128 return 0;
129129 }
130130
131−static int __devexit gpio_halt_remove(struct platform_device *pdev)
131+static int gpio_halt_remove(struct platform_device *pdev)
132132 {
133133 if (halt_node) {
134134 int gpio = of_get_gpio(halt_node, 0);
@@ -165,7 +165,7 @@ static struct platform_driver gpio_halt_driver = { · 30 unmodified lines
165165 .of_match_table = gpio_halt_match,
166166 },
167167 .probe = gpio_halt_probe,
168− .remove = __devexit_p(gpio_halt_remove),
168+ .remove = gpio_halt_remove,
169169 };
170170
171171 module_platform_driver(gpio_halt_driver);
arch/powerpc/platforms/Kconfig.cputype+2−4
@@ -124,9 +124,8 @@ config 6xx · 123 unmodified lines
124124 select PPC_HAVE_PMU_SUPPORT
125125
126126 config POWER3
127− bool
128127 depends on PPC64 && PPC_BOOK3S
129− default y if !POWER4_ONLY
128+ def_bool y
130129
131130 config POWER4
132131 depends on PPC64 && PPC_BOOK3S
@@ -145,8 +144,7 @@ config TUNE_CELL · 12 unmodified lines
145144 but somewhat slower on other machines. This option only changes
146145 the scheduling of instructions, not the selection of instructions
147146 itself, so the resulting kernel will keep running on all other
148− machines. When building a kernel that is supposed to run only
149− on Cell, you should also select the POWER4_ONLY option.
147+ machines.
150148
151149 # this is temp to handle compat with arch=ppc
152150 config 8xx
arch/powerpc/platforms/pseries/lpar.c+7−1
@@ -186,7 +186,13 @@ static long pSeries_lpar_hpte_remove(unsigned long hpte_group) · 185 unmodified lines
186186 (0x1UL << 4), &dummy1, &dummy2);
187187 if (lpar_rc == H_SUCCESS)
188188 return i;
189− BUG_ON(lpar_rc != H_NOT_FOUND);
189+
190+ /*
191+ * The test for adjunct partition is performed before the
192+ * ANDCOND test. H_RESOURCE may be returned, so we need to
193+ * check for that as well.
194+ */
195+ BUG_ON(lpar_rc != H_NOT_FOUND && lpar_rc != H_RESOURCE);
190196
191197 slot_offset++;
192198 slot_offset &= 0x7;
arch/s390/Kconfig+1−1
@@ -134,7 +134,7 @@ config S390 · 133 unmodified lines
134134 select HAVE_SYSCALL_WRAPPERS
135135 select HAVE_UID16 if 32BIT
136136 select HAVE_VIRT_CPU_ACCOUNTING
137− select HAVE_VIRT_TO_BUS
137+ select VIRT_TO_BUS
138138 select INIT_ALL_POSSIBLE
139139 select KTIME_SCALAR if 32BIT
140140 select MODULES_USE_ELF_RELA
arch/s390/include/asm/eadm.h+5−1
@@ -34,6 +34,8 @@ struct arsb { · 33 unmodified lines
3434 u32 reserved[4];
3535 } __packed;
3636
37+#define EQC_WR_PROHIBIT 22
38+
3739 struct msb {
3840 u8 fmt:4;
3941 u8 oc:4;
@@ -96,11 +98,13 @@ struct scm_device { · 56 unmodified lines
9698 #define OP_STATE_TEMP_ERR 2
9799 #define OP_STATE_PERM_ERR 3
98100
101+enum scm_event {SCM_CHANGE, SCM_AVAIL};
102+
99103 struct scm_driver {
100104 struct device_driver drv;
101105 int (*probe) (struct scm_device *scmdev);
102106 int (*remove) (struct scm_device *scmdev);
103− void (*notify) (struct scm_device *scmdev);
107+ void (*notify) (struct scm_device *scmdev, enum scm_event event);
104108 void (*handler) (struct scm_device *scmdev, void *data, int error);
105109 };
106110
arch/s390/include/asm/io.h+0−4
@@ -50,10 +50,6 @@ void unxlate_dev_mem_ptr(unsigned long phys, void *addr); · 49 unmodified lines
5050 #define ioremap_nocache(addr, size) ioremap(addr, size)
5151 #define ioremap_wc ioremap_nocache
5252
53−/* TODO: s390 cannot support io_remap_pfn_range... */
54−#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
55− remap_pfn_range(vma, vaddr, pfn, size, prot)
56−
5753 static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
5854 {
5955 return (void __iomem *) offset;
arch/s390/include/asm/pgtable.h+7−1
@@ -57,6 +57,10 @@ extern unsigned long zero_page_mask; · 56 unmodified lines
5757 (((unsigned long)(vaddr)) &zero_page_mask))))
5858 #define __HAVE_COLOR_ZERO_PAGE
5959
60+/* TODO: s390 cannot support io_remap_pfn_range... */
61+#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
62+ remap_pfn_range(vma, vaddr, pfn, size, prot)
63+
6064 #endif /* !__ASSEMBLY__ */
6165
6266 /*
@@ -344,6 +348,7 @@ extern unsigned long MODULES_END; · 281 unmodified lines
344348 #define _REGION3_ENTRY_CO 0x100 /* change-recording override */
345349
346350 /* Bits in the segment table entry */
351+#define _SEGMENT_ENTRY_ORIGIN_LARGE ~0xfffffUL /* large page address */
347352 #define _SEGMENT_ENTRY_ORIGIN ~0x7ffUL/* segment table origin */
348353 #define _SEGMENT_ENTRY_RO 0x200 /* page protection bit */
349354 #define _SEGMENT_ENTRY_INV 0x20 /* invalid segment table entry */
@@ -1531,7 +1536,8 @@ extern int s390_enable_sie(void); · 1181 unmodified lines
15311536 /*
15321537 * No page table caches to initialise
15331538 */
1534−#define pgtable_cache_init() do { } while (0)
1539+static inline void pgtable_cache_init(void) { }
1540+static inline void check_pgt_cache(void) { }
15351541
15361542 #include <asm-generic/pgtable.h>
15371543
arch/s390/include/asm/tlbflush.h+0−2
@@ -74,8 +74,6 @@ static inline void __tlb_flush_idte(unsigned long asce) · 73 unmodified lines
7474
7575 static inline void __tlb_flush_mm(struct mm_struct * mm)
7676 {
77− if (unlikely(cpumask_empty(mm_cpumask(mm))))
78− return;
7977 /*
8078 * If the machine has IDTE we prefer to do a per mm flush
8179 * on all cpus instead of doing a local flush if the mm
arch/s390/kernel/entry.S+2−1
@@ -636,7 +636,8 @@ ENTRY(mcck_int_handler) · 635 unmodified lines
636636 UPDATE_VTIME %r14,%r15,__LC_MCCK_ENTER_TIMER
637637 mcck_skip:
638638 SWITCH_ASYNC __LC_GPREGS_SAVE_AREA+32,__LC_PANIC_STACK,PAGE_SHIFT
639− mvc __PT_R0(64,%r11),__LC_GPREGS_SAVE_AREA
639+ stm %r0,%r7,__PT_R0(%r11)
640+ mvc __PT_R8(32,%r11),__LC_GPREGS_SAVE_AREA+32
640641 stm %r8,%r9,__PT_PSW(%r11)
641642 xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15)
642643 l %r1,BASED(.Ldo_machine_check)
arch/s390/kernel/entry64.S+3−2
@@ -678,8 +678,9 @@ ENTRY(mcck_int_handler) · 677 unmodified lines
678678 UPDATE_VTIME %r14,__LC_MCCK_ENTER_TIMER
679679 LAST_BREAK %r14
680680 mcck_skip:
681− lghi %r14,__LC_GPREGS_SAVE_AREA
682− mvc __PT_R0(128,%r11),0(%r14)
681+ lghi %r14,__LC_GPREGS_SAVE_AREA+64
682+ stmg %r0,%r7,__PT_R0(%r11)
683+ mvc __PT_R8(64,%r11),0(%r14)
683684 stmg %r8,%r9,__PT_PSW(%r11)
684685 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
685686 lgr %r2,%r11 # pass pointer to pt_regs
arch/s390/kernel/setup.c+2−0
@@ -571,6 +571,8 @@ static void __init setup_memory_end(void) · 570 unmodified lines
571571
572572 /* Split remaining virtual space between 1:1 mapping & vmemmap array */
573573 tmp = VMALLOC_START / (PAGE_SIZE + sizeof(struct page));
574+ /* vmemmap contains a multiple of PAGES_PER_SECTION struct pages */
575+ tmp = SECTION_ALIGN_UP(tmp);
574576 tmp = VMALLOC_START - tmp * sizeof(struct page);
575577 tmp &= ~((vmax >> 11) - 1); /* align to page table level */
576578 tmp = min(tmp, 1UL << MAX_PHYSMEM_BITS);
arch/s390/lib/uaccess_pt.c+55−28
@@ -77,42 +77,69 @@ static size_t copy_in_kernel(size_t count, void __user *to, · 76 unmodified lines
7777 * >= -4095 (IS_ERR_VALUE(x) returns true), a fault has occured and the address
7878 * contains the (negative) exception code.
7979 */
80−static __always_inline unsigned long follow_table(struct mm_struct *mm,
81− unsigned long addr, int write)
80+#ifdef CONFIG_64BIT
81+static unsigned long follow_table(struct mm_struct *mm,
82+ unsigned long address, int write)
8283 {
83− pgd_t *pgd;
84− pud_t *pud;
85− pmd_t *pmd;
86− pte_t *ptep;
84+ unsigned long *table = (unsigned long *)__pa(mm->pgd);
85+
86+ switch (mm->context.asce_bits & _ASCE_TYPE_MASK) {
87+ case _ASCE_TYPE_REGION1:
88+ table = table + ((address >> 53) & 0x7ff);
89+ if (unlikely(*table & _REGION_ENTRY_INV))
90+ return -0x39UL;
91+ table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN);
92+ case _ASCE_TYPE_REGION2:
93+ table = table + ((address >> 42) & 0x7ff);
94+ if (unlikely(*table & _REGION_ENTRY_INV))
95+ return -0x3aUL;
96+ table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN);
97+ case _ASCE_TYPE_REGION3:
98+ table = table + ((address >> 31) & 0x7ff);
99+ if (unlikely(*table & _REGION_ENTRY_INV))
100+ return -0x3bUL;
101+ table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN);
102+ case _ASCE_TYPE_SEGMENT:
103+ table = table + ((address >> 20) & 0x7ff);
104+ if (unlikely(*table & _SEGMENT_ENTRY_INV))
105+ return -0x10UL;
106+ if (unlikely(*table & _SEGMENT_ENTRY_LARGE)) {
107+ if (write && (*table & _SEGMENT_ENTRY_RO))
108+ return -0x04UL;
109+ return (*table & _SEGMENT_ENTRY_ORIGIN_LARGE) +
110+ (address & ~_SEGMENT_ENTRY_ORIGIN_LARGE);
111+ }
112+ table = (unsigned long *)(*table & _SEGMENT_ENTRY_ORIGIN);
113+ }
114+ table = table + ((address >> 12) & 0xff);
115+ if (unlikely(*table & _PAGE_INVALID))
116+ return -0x11UL;
117+ if (write && (*table & _PAGE_RO))
118+ return -0x04UL;
119+ return (*table & PAGE_MASK) + (address & ~PAGE_MASK);
120+}
87121
88− pgd = pgd_offset(mm, addr);
89− if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
90− return -0x3aUL;
122+#else /* CONFIG_64BIT */
91123
92− pud = pud_offset(pgd, addr);
93− if (pud_none(*pud) || unlikely(pud_bad(*pud)))
94− return -0x3bUL;
124+static unsigned long follow_table(struct mm_struct *mm,
125+ unsigned long address, int write)
126+{
127+ unsigned long *table = (unsigned long *)__pa(mm->pgd);
95128
96− pmd = pmd_offset(pud, addr);
97− if (pmd_none(*pmd))
129+ table = table + ((address >> 20) & 0x7ff);
130+ if (unlikely(*table & _SEGMENT_ENTRY_INV))
98131 return -0x10UL;
99− if (pmd_large(*pmd)) {
100− if (write && (pmd_val(*pmd) & _SEGMENT_ENTRY_RO))
101− return -0x04UL;
102− return (pmd_val(*pmd) & HPAGE_MASK) + (addr & ~HPAGE_MASK);
103− }
104− if (unlikely(pmd_bad(*pmd)))
105− return -0x10UL;
106−
107− ptep = pte_offset_map(pmd, addr);
108− if (!pte_present(*ptep))
132+ table = (unsigned long *)(*table & _SEGMENT_ENTRY_ORIGIN);
133+ table = table + ((address >> 12) & 0xff);
134+ if (unlikely(*table & _PAGE_INVALID))
109135 return -0x11UL;
110− if (write && (!pte_write(*ptep) || !pte_dirty(*ptep)))
136+ if (write && (*table & _PAGE_RO))
111137 return -0x04UL;
112−
113− return (pte_val(*ptep) & PAGE_MASK) + (addr & ~PAGE_MASK);
138+ return (*table & PAGE_MASK) + (address & ~PAGE_MASK);
114139 }
115140
141+#endif /* CONFIG_64BIT */
142+
116143 static __always_inline size_t __user_copy_pt(unsigned long uaddr, void *kptr,
117144 size_t n, int write_user)
118145 {
@@ -197,7 +224,7 @@ size_t copy_to_user_pt(size_t n, void __user *to, const void *from) · 78 unmodified lines
197224
198225 static size_t clear_user_pt(size_t n, void __user *to)
199226 {
200− void *zpage = &empty_zero_page;
227+ void *zpage = (void *) empty_zero_page;
201228 long done, size, ret;
202229
203230 done = 0;
arch/score/Kconfig+1−1
@@ -12,7 +12,7 @@ config SCORE · 11 unmodified lines
1212 select GENERIC_CPU_DEVICES
1313 select GENERIC_CLOCKEVENTS
1414 select HAVE_MOD_ARCH_SPECIFIC
15− select HAVE_VIRT_TO_BUS
15+ select VIRT_TO_BUS
1616 select MODULES_USE_ELF_REL
1717 select CLONE_BACKWARDS
1818
arch/sparc/Kconfig+1−7
@@ -84,12 +84,6 @@ config ARCH_DEFCONFIG · 83 unmodified lines
8484 default "arch/sparc/configs/sparc32_defconfig" if SPARC32
8585 default "arch/sparc/configs/sparc64_defconfig" if SPARC64
8686
87−# CONFIG_BITS can be used at source level to get 32/64 bits
88−config BITS
89− int
90− default 32 if SPARC32
91− default 64 if SPARC64
92−
9387 config IOMMU_HELPER
9488 bool
9589 default y if SPARC64
@@ -197,7 +191,7 @@ config RWSEM_XCHGADD_ALGORITHM · 101 unmodified lines
197191
198192 config GENERIC_HWEIGHT
199193 bool
200− default y if !ULTRA_HAS_POPULATION_COUNT
194+ default y
201195
202196 config GENERIC_CALIBRATE_DELAY
203197 bool
arch/sparc/include/asm/Kbuild+5−0
@@ -2,11 +2,16 @@ · 1 unmodified line
22
33
44 generic-y += clkdev.h
5+generic-y += cputime.h
56 generic-y += div64.h
7+generic-y += emergency-restart.h
68 generic-y += exec.h
79 generic-y += local64.h
10+generic-y += mutex.h
811 generic-y += irq_regs.h
912 generic-y += local.h
1013 generic-y += module.h
14+generic-y += serial.h
1115 generic-y += trace_clock.h
16+generic-y += types.h
1217 generic-y += word-at-a-time.h
arch/sparc/include/asm/cputime.h+0−6
@@ -1,6 +0,0 @@
1−#ifndef __SPARC_CPUTIME_H
2−#define __SPARC_CPUTIME_H
3−
4−#include <asm-generic/cputime.h>
5−
6−#endif /* __SPARC_CPUTIME_H */
arch/sparc/include/asm/emergency-restart.h+0−6
@@ -1,6 +0,0 @@
1−#ifndef _ASM_EMERGENCY_RESTART_H
2−#define _ASM_EMERGENCY_RESTART_H
3−
4−#include <asm-generic/emergency-restart.h>
5−
6−#endif /* _ASM_EMERGENCY_RESTART_H */
arch/sparc/include/asm/mutex.h+0−9
@@ -1,9 +0,0 @@
1−/*
2− * Pull in the generic implementation for the mutex fastpath.
3− *
4− * TODO: implement optimized primitives instead, or leave the generic
5− * implementation in place, or pick the atomic_xchg() based generic
6− * implementation. (see asm-generic/mutex-xchg.h for details)
7− */
8−
9−#include <asm-generic/mutex-dec.h>
arch/sparc/include/asm/pgtable_64.h+1−0
@@ -915,6 +915,7 @@ static inline int io_remap_pfn_range(struct vm_area_struct *vma, · 914 unmodified lines
915915 return remap_pfn_range(vma, from, phys_base >> PAGE_SHIFT, size, prot);
916916 }
917917
918+#include <asm/tlbflush.h>
918919 #include <asm-generic/pgtable.h>
919920
920921 /* We provide our own get_unmapped_area to cope with VA holes and
arch/sparc/include/asm/serial.h+0−6
@@ -1,6 +0,0 @@
1−#ifndef __SPARC_SERIAL_H
2−#define __SPARC_SERIAL_H
3−
4−#define BASE_BAUD ( 1843200 / 16 )
5−
6−#endif /* __SPARC_SERIAL_H */
arch/sparc/include/asm/smp_32.h+0−5
@@ -36,7 +36,6 @@ typedef void (*smpfunc_t)(unsigned long, unsigned long, unsigned long, · 35 unmodified lines
3636 unsigned long, unsigned long);
3737
3838 void cpu_panic(void);
39−extern void smp4m_irq_rotate(int cpu);
4039
4140 /*
4241 * General functions that each host system must provide.
@@ -46,7 +45,6 @@ void sun4m_init_smp(void); · 3 unmodified lines
4645 void sun4d_init_smp(void);
4746
4847 void smp_callin(void);
49−void smp_boot_cpus(void);
5048 void smp_store_cpu_info(int);
5149
5250 void smp_resched_interrupt(void);
@@ -107,9 +105,6 @@ extern int hard_smp_processor_id(void); · 54 unmodified lines
107105
108106 #define raw_smp_processor_id() (current_thread_info()->cpu)
109107
110−#define prof_multiplier(__cpu) cpu_data(__cpu).multiplier
111−#define prof_counter(__cpu) cpu_data(__cpu).counter
112−
113108 void smp_setup_cpu_possible_map(void);
114109
115110 #endif /* !(__ASSEMBLY__) */
arch/sparc/include/asm/spitfire.h+1−0
@@ -45,6 +45,7 @@ · 44 unmodified lines
4545 #define SUN4V_CHIP_NIAGARA3 0x03
4646 #define SUN4V_CHIP_NIAGARA4 0x04
4747 #define SUN4V_CHIP_NIAGARA5 0x05
48+#define SUN4V_CHIP_SPARC64X 0x8a
4849 #define SUN4V_CHIP_UNKNOWN 0xff
4950
5051 #ifndef __ASSEMBLY__
arch/sparc/include/asm/switch_to_64.h+1−2
@@ -18,8 +18,7 @@ do { \ · 17 unmodified lines
1818 * and 2 stores in this critical code path. -DaveM
1919 */
2020 #define switch_to(prev, next, last) \
21−do { flush_tlb_pending(); \
22− save_and_clear_fpu(); \
21+do { save_and_clear_fpu(); \
2322 /* If you are tempted to conditionalize the following */ \
2423 /* so that ASI is only written if it changes, think again. */ \
2524 __asm__ __volatile__("wr %%g0, %0, %%asi" \
arch/sparc/include/asm/tlbflush_64.h+31−6
@@ -11,24 +11,40 @@ · 10 unmodified lines
1111 struct tlb_batch {
1212 struct mm_struct *mm;
1313 unsigned long tlb_nr;
14+ unsigned long active;
1415 unsigned long vaddrs[TLB_BATCH_NR];
1516 };
1617
1718 extern void flush_tsb_kernel_range(unsigned long start, unsigned long end);
1819 extern void flush_tsb_user(struct tlb_batch *tb);
20+extern void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr);
1921
2022 /* TLB flush operations. */
2123
22−extern void flush_tlb_pending(void);
24+static inline void flush_tlb_mm(struct mm_struct *mm)
25+{
26+}
27+
28+static inline void flush_tlb_page(struct vm_area_struct *vma,
29+ unsigned long vmaddr)
30+{
31+}
32+
33+static inline void flush_tlb_range(struct vm_area_struct *vma,
34+ unsigned long start, unsigned long end)
35+{
36+}
37+
38+#define __HAVE_ARCH_ENTER_LAZY_MMU_MODE
2339
24−#define flush_tlb_range(vma,start,end) \
25− do { (void)(start); flush_tlb_pending(); } while (0)
26−#define flush_tlb_page(vma,addr) flush_tlb_pending()
27−#define flush_tlb_mm(mm) flush_tlb_pending()
40+extern void flush_tlb_pending(void);
41+extern void arch_enter_lazy_mmu_mode(void);
42+extern void arch_leave_lazy_mmu_mode(void);
43+#define arch_flush_lazy_mmu_mode() do {} while (0)
2844
2945 /* Local cpu only. */
3046 extern void __flush_tlb_all(void);
31−
47+extern void __flush_tlb_page(unsigned long context, unsigned long vaddr);
3248 extern void __flush_tlb_kernel_range(unsigned long start, unsigned long end);
3349
3450 #ifndef CONFIG_SMP
@@ -38,15 +54,24 @@ do { flush_tsb_kernel_range(start,end); \ · 3 unmodified lines
3854 __flush_tlb_kernel_range(start,end); \
3955 } while (0)
4056
57+static inline void global_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr)
58+{
59+ __flush_tlb_page(CTX_HWBITS(mm->context), vaddr);
60+}
61+
4162 #else /* CONFIG_SMP */
4263
4364 extern void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end);
65+extern void smp_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr);
4466
4567 #define flush_tlb_kernel_range(start, end) \
4668 do { flush_tsb_kernel_range(start,end); \
4769 smp_flush_tlb_kernel_range(start, end); \
4870 } while (0)
4971
72+#define global_flush_tlb_page(mm, vaddr) \
73+ smp_flush_tlb_page(mm, vaddr)
74+
5075 #endif /* ! CONFIG_SMP */
5176
5277 #endif /* _SPARC64_TLBFLUSH_H */
arch/sparc/include/uapi/asm/Kbuild+0−1
@@ -44,7 +44,6 @@ header-y += swab.h · 43 unmodified lines
4444 header-y += termbits.h
4545 header-y += termios.h
4646 header-y += traps.h
47−header-y += types.h
4847 header-y += uctx.h
4948 header-y += unistd.h
5049 header-y += utrap.h
arch/sparc/include/uapi/asm/types.h+0−17
@@ -1,17 +0,0 @@
1−#ifndef _SPARC_TYPES_H
2−#define _SPARC_TYPES_H
3−/*
4− * This file is never included by application software unless
5− * explicitly requested (e.g., via linux/types.h) in which case the
6− * application is Linux specific so (user-) name space pollution is
7− * not a major issue. However, for interoperability, libraries still
8− * need to be careful to avoid a name clashes.
9− */
10−
11−#if defined(__sparc__)
12−
13−#include <asm-generic/int-ll64.h>
14−
15−#endif /* defined(__sparc__) */
16−
17−#endif /* defined(_SPARC_TYPES_H) */
arch/sparc/kernel/cpu.c+6−0
@@ -493,6 +493,12 @@ static void __init sun4v_cpu_probe(void) · 492 unmodified lines
493493 sparc_pmu_type = "niagara5";
494494 break;
495495
496+ case SUN4V_CHIP_SPARC64X:
497+ sparc_cpu_type = "SPARC64-X";
498+ sparc_fpu_type = "SPARC64-X integrated FPU";
499+ sparc_pmu_type = "sparc64-x";
500+ break;
501+
496502 default:
497503 printk(KERN_WARNING "CPU: Unknown sun4v cpu type [%s]\n",
498504 prom_cpu_compatible);
arch/sparc/kernel/head_64.S+23−2
@@ -134,6 +134,8 @@ prom_niagara_prefix: · 133 unmodified lines
134134 .asciz "SUNW,UltraSPARC-T"
135135 prom_sparc_prefix:
136136 .asciz "SPARC-"
137+prom_sparc64x_prefix:
138+ .asciz "SPARC64-X"
137139 .align 4
138140 prom_root_compatible:
139141 .skip 64
@@ -412,7 +414,7 @@ sun4v_chip_type: · 272 unmodified lines
412414 cmp %g2, 'T'
413415 be,pt %xcc, 70f
414416 cmp %g2, 'M'
415− bne,pn %xcc, 4f
417+ bne,pn %xcc, 49f
416418 nop
417419
418420 70: ldub [%g1 + 7], %g2
@@ -425,7 +427,7 @@ sun4v_chip_type: · 6 unmodified lines
425427 cmp %g2, '5'
426428 be,pt %xcc, 5f
427429 mov SUN4V_CHIP_NIAGARA5, %g4
428− ba,pt %xcc, 4f
430+ ba,pt %xcc, 49f
429431 nop
430432
431433 91: sethi %hi(prom_cpu_compatible), %g1
@@ -439,6 +441,25 @@ sun4v_chip_type: · 7 unmodified lines
439441 mov SUN4V_CHIP_NIAGARA2, %g4
440442
441443 4:
444+ /* Athena */
445+ sethi %hi(prom_cpu_compatible), %g1
446+ or %g1, %lo(prom_cpu_compatible), %g1
447+ sethi %hi(prom_sparc64x_prefix), %g7
448+ or %g7, %lo(prom_sparc64x_prefix), %g7
449+ mov 9, %g3
450+41: ldub [%g7], %g2
451+ ldub [%g1], %g4
452+ cmp %g2, %g4
453+ bne,pn %icc, 49f
454+ add %g7, 1, %g7
455+ subcc %g3, 1, %g3
456+ bne,pt %xcc, 41b
457+ add %g1, 1, %g1
458+ mov SUN4V_CHIP_SPARC64X, %g4
459+ ba,pt %xcc, 5f
460+ nop
461+
462+49:
442463 mov SUN4V_CHIP_UNKNOWN, %g4
443464 5: sethi %hi(sun4v_chip_type), %g2
444465 or %g2, %lo(sun4v_chip_type), %g2
arch/sparc/kernel/leon_pci_grpci2.c+26−15
@@ -186,6 +186,8 @@ struct grpci2_cap_first { · 185 unmodified lines
186186 #define CAP9_IOMAP_OFS 0x20
187187 #define CAP9_BARSIZE_OFS 0x24
188188
189+#define TGT 256
190+
189191 struct grpci2_priv {
190192 struct leon_pci_info info; /* must be on top of this structure */
191193 struct grpci2_regs *regs;
@@ -237,8 +239,12 @@ static int grpci2_cfg_r32(struct grpci2_priv *priv, unsigned int bus, · 45 unmodified lines
237239 if (where & 0x3)
238240 return -EINVAL;
239241
240− if (bus == 0 && PCI_SLOT(devfn) != 0)
241− devfn += (0x8 * 6);
242+ if (bus == 0) {
243+ devfn += (0x8 * 6); /* start at AD16=Device0 */
244+ } else if (bus == TGT) {
245+ bus = 0;
246+ devfn = 0; /* special case: bridge controller itself */
247+ }
242248
243249 /* Select bus */
244250 spin_lock_irqsave(&grpci2_dev_lock, flags);
@@ -303,8 +309,12 @@ static int grpci2_cfg_w32(struct grpci2_priv *priv, unsigned int bus, · 58 unmodified lines
303309 if (where & 0x3)
304310 return -EINVAL;
305311
306− if (bus == 0 && PCI_SLOT(devfn) != 0)
307− devfn += (0x8 * 6);
312+ if (bus == 0) {
313+ devfn += (0x8 * 6); /* start at AD16=Device0 */
314+ } else if (bus == TGT) {
315+ bus = 0;
316+ devfn = 0; /* special case: bridge controller itself */
317+ }
308318
309319 /* Select bus */
310320 spin_lock_irqsave(&grpci2_dev_lock, flags);
@@ -368,7 +378,7 @@ static int grpci2_read_config(struct pci_bus *bus, unsigned int devfn, · 57 unmodified lines
368378 unsigned int busno = bus->number;
369379 int ret;
370380
371− if (PCI_SLOT(devfn) > 15 || (PCI_SLOT(devfn) == 0 && busno == 0)) {
381+ if (PCI_SLOT(devfn) > 15 || busno > 255) {
372382 *val = ~0;
373383 return 0;
374384 }
@@ -406,7 +416,7 @@ static int grpci2_write_config(struct pci_bus *bus, unsigned int devfn, · 31 unmodified lines
406416 struct grpci2_priv *priv = grpci2priv;
407417 unsigned int busno = bus->number;
408418
409− if (PCI_SLOT(devfn) > 15 || (PCI_SLOT(devfn) == 0 && busno == 0))
419+ if (PCI_SLOT(devfn) > 15 || busno > 255)
410420 return 0;
411421
412422 #ifdef GRPCI2_DEBUG_CFGACCESS
@@ -578,15 +588,15 @@ void grpci2_hw_init(struct grpci2_priv *priv) · 165 unmodified lines
578588 REGSTORE(regs->ahbmst_map[i], priv->pci_area);
579589
580590 /* Get the GRPCI2 Host PCI ID */
581− grpci2_cfg_r32(priv, 0, 0, PCI_VENDOR_ID, &priv->pciid);
591+ grpci2_cfg_r32(priv, TGT, 0, PCI_VENDOR_ID, &priv->pciid);
582592
583593 /* Get address to first (always defined) capability structure */
584− grpci2_cfg_r8(priv, 0, 0, PCI_CAPABILITY_LIST, &capptr);
594+ grpci2_cfg_r8(priv, TGT, 0, PCI_CAPABILITY_LIST, &capptr);
585595
586596 /* Enable/Disable Byte twisting */
587− grpci2_cfg_r32(priv, 0, 0, capptr+CAP9_IOMAP_OFS, &io_map);
597+ grpci2_cfg_r32(priv, TGT, 0, capptr+CAP9_IOMAP_OFS, &io_map);
588598 io_map = (io_map & ~0x1) | (priv->bt_enabled ? 1 : 0);
589− grpci2_cfg_w32(priv, 0, 0, capptr+CAP9_IOMAP_OFS, io_map);
599+ grpci2_cfg_w32(priv, TGT, 0, capptr+CAP9_IOMAP_OFS, io_map);
590600
591601 /* Setup the Host's PCI Target BARs for other peripherals to access,
592602 * and do DMA to the host's memory. The target BARs can be sized and
@@ -617,17 +627,18 @@ void grpci2_hw_init(struct grpci2_priv *priv) · 24 unmodified lines
617627 pciadr = 0;
618628 }
619629 }
620− grpci2_cfg_w32(priv, 0, 0, capptr+CAP9_BARSIZE_OFS+i*4, bar_sz);
621− grpci2_cfg_w32(priv, 0, 0, PCI_BASE_ADDRESS_0+i*4, pciadr);
622− grpci2_cfg_w32(priv, 0, 0, capptr+CAP9_BAR_OFS+i*4, ahbadr);
630+ grpci2_cfg_w32(priv, TGT, 0, capptr+CAP9_BARSIZE_OFS+i*4,
631+ bar_sz);
632+ grpci2_cfg_w32(priv, TGT, 0, PCI_BASE_ADDRESS_0+i*4, pciadr);
633+ grpci2_cfg_w32(priv, TGT, 0, capptr+CAP9_BAR_OFS+i*4, ahbadr);
623634 printk(KERN_INFO " TGT BAR[%d]: 0x%08x (PCI)-> 0x%08x\n",
624635 i, pciadr, ahbadr);
625636 }
626637
627638 /* set as bus master and enable pci memory responses */
628− grpci2_cfg_r32(priv, 0, 0, PCI_COMMAND, &data);
639+ grpci2_cfg_r32(priv, TGT, 0, PCI_COMMAND, &data);
629640 data |= (PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
630− grpci2_cfg_w32(priv, 0, 0, PCI_COMMAND, data);
641+ grpci2_cfg_w32(priv, TGT, 0, PCI_COMMAND, data);
631642
632643 /* Enable Error respone (CPU-TRAP) on illegal memory access. */
633644 REGSTORE(regs->ctrl, CTRL_ER | CTRL_PE);
arch/sparc/kernel/smp_64.c+37−4
@@ -849,7 +849,7 @@ void smp_tsb_sync(struct mm_struct *mm) · 848 unmodified lines
849849 }
850850
851851 extern unsigned long xcall_flush_tlb_mm;
852−extern unsigned long xcall_flush_tlb_pending;
852+extern unsigned long xcall_flush_tlb_page;
853853 extern unsigned long xcall_flush_tlb_kernel_range;
854854 extern unsigned long xcall_fetch_glob_regs;
855855 extern unsigned long xcall_fetch_glob_pmu;
@@ -1074,23 +1074,56 @@ local_flush_and_out: · 218 unmodified lines
10741074 put_cpu();
10751075 }
10761076
1077+struct tlb_pending_info {
1078+ unsigned long ctx;
1079+ unsigned long nr;
1080+ unsigned long *vaddrs;
1081+};
1082+
1083+static void tlb_pending_func(void *info)
1084+{
1085+ struct tlb_pending_info *t = info;
1086+
1087+ __flush_tlb_pending(t->ctx, t->nr, t->vaddrs);
1088+}
1089+
10771090 void smp_flush_tlb_pending(struct mm_struct *mm, unsigned long nr, unsigned long *vaddrs)
10781091 {
10791092 u32 ctx = CTX_HWBITS(mm->context);
1093+ struct tlb_pending_info info;
10801094 int cpu = get_cpu();
10811095
1096+ info.ctx = ctx;
1097+ info.nr = nr;
1098+ info.vaddrs = vaddrs;
1099+
10821100 if (mm == current->mm && atomic_read(&mm->mm_users) == 1)
10831101 cpumask_copy(mm_cpumask(mm), cpumask_of(cpu));
10841102 else
1085− smp_cross_call_masked(&xcall_flush_tlb_pending,
1086− ctx, nr, (unsigned long) vaddrs,
1087− mm_cpumask(mm));
1103+ smp_call_function_many(mm_cpumask(mm), tlb_pending_func,
1104+ &info, 1);
10881105
10891106 __flush_tlb_pending(ctx, nr, vaddrs);
10901107
10911108 put_cpu();
10921109 }
10931110
1111+void smp_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr)
1112+{
1113+ unsigned long context = CTX_HWBITS(mm->context);
1114+ int cpu = get_cpu();
1115+
1116+ if (mm == current->mm && atomic_read(&mm->mm_users) == 1)
1117+ cpumask_copy(mm_cpumask(mm), cpumask_of(cpu));
1118+ else
1119+ smp_cross_call_masked(&xcall_flush_tlb_page,
1120+ context, vaddr, 0,
1121+ mm_cpumask(mm));
1122+ __flush_tlb_page(context, vaddr);
1123+
1124+ put_cpu();
1125+}
1126+
10941127 void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end)
10951128 {
10961129 start &= PAGE_MASK;
arch/sparc/lib/bitext.c+1−5
@@ -119,11 +119,7 @@ void bit_map_clear(struct bit_map *t, int offset, int len) · 118 unmodified lines
119119
120120 void bit_map_init(struct bit_map *t, unsigned long *map, int size)
121121 {
122−
123− if ((size & 07) != 0)
124− BUG();
125− memset(map, 0, size>>3);
126−
122+ bitmap_zero(map, size);
127123 memset(t, 0, sizeof *t);
128124 spin_lock_init(&t->lock);
129125 t->map = map;
arch/sparc/mm/iommu.c+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434 #define IOMMU_RNGE IOMMU_RNGE_256MB
3535 #define IOMMU_START 0xF0000000
3636 #define IOMMU_WINSIZE (256*1024*1024U)
37−#define IOMMU_NPTES (IOMMU_WINSIZE/PAGE_SIZE) /* 64K PTEs, 265KB */
37+#define IOMMU_NPTES (IOMMU_WINSIZE/PAGE_SIZE) /* 64K PTEs, 256KB */
3838 #define IOMMU_ORDER 6 /* 4096 * (1<<6) */
3939
4040 /* srmmu.c */
arch/sparc/mm/srmmu.c+3−1
@@ -280,7 +280,9 @@ static void __init srmmu_nocache_init(void) · 279 unmodified lines
280280 SRMMU_NOCACHE_ALIGN_MAX, 0UL);
281281 memset(srmmu_nocache_pool, 0, srmmu_nocache_size);
282282
283− srmmu_nocache_bitmap = __alloc_bootmem(bitmap_bits >> 3, SMP_CACHE_BYTES, 0UL);
283+ srmmu_nocache_bitmap =
284+ __alloc_bootmem(BITS_TO_LONGS(bitmap_bits) * sizeof(long),
285+ SMP_CACHE_BYTES, 0UL);
284286 bit_map_init(&srmmu_nocache_map, srmmu_nocache_bitmap, bitmap_bits);
285287
286288 srmmu_swapper_pg_dir = __srmmu_get_nocache(SRMMU_PGD_TABLE_SIZE, SRMMU_PGD_TABLE_SIZE);
arch/sparc/mm/tlb.c+34−4
@@ -24,11 +24,17 @@ static DEFINE_PER_CPU(struct tlb_batch, tlb_batch); · 23 unmodified lines
2424 void flush_tlb_pending(void)
2525 {
2626 struct tlb_batch *tb = &get_cpu_var(tlb_batch);
27+ struct mm_struct *mm = tb->mm;
2728
28− if (tb->tlb_nr) {
29− flush_tsb_user(tb);
29+ if (!tb->tlb_nr)
30+ goto out;
3031
31− if (CTX_VALID(tb->mm->context)) {
32+ flush_tsb_user(tb);
33+
34+ if (CTX_VALID(mm->context)) {
35+ if (tb->tlb_nr == 1) {
36+ global_flush_tlb_page(mm, tb->vaddrs[0]);
37+ } else {
3238 #ifdef CONFIG_SMP
3339 smp_flush_tlb_pending(tb->mm, tb->tlb_nr,
3440 &tb->vaddrs[0]);
@@ -37,12 +43,30 @@ void flush_tlb_pending(void) · 2 unmodified lines
3743 tb->tlb_nr, &tb->vaddrs[0]);
3844 #endif
3945 }
40− tb->tlb_nr = 0;
4146 }
4247
48+ tb->tlb_nr = 0;
49+
50+out:
4351 put_cpu_var(tlb_batch);
4452 }
4553
54+void arch_enter_lazy_mmu_mode(void)
55+{
56+ struct tlb_batch *tb = &__get_cpu_var(tlb_batch);
57+
58+ tb->active = 1;
59+}
60+
61+void arch_leave_lazy_mmu_mode(void)
62+{
63+ struct tlb_batch *tb = &__get_cpu_var(tlb_batch);
64+
65+ if (tb->tlb_nr)
66+ flush_tlb_pending();
67+ tb->active = 0;
68+}
69+
4670 static void tlb_batch_add_one(struct mm_struct *mm, unsigned long vaddr,
4771 bool exec)
4872 {
@@ -60,6 +84,12 @@ static void tlb_batch_add_one(struct mm_struct *mm, unsigned long vaddr, · 11 unmodified lines
6084 nr = 0;
6185 }
6286
87+ if (!tb->active) {
88+ global_flush_tlb_page(mm, vaddr);
89+ flush_tsb_user_page(mm, vaddr);
90+ return;
91+ }
92+
6393 if (nr == 0)
6494 tb->mm = mm;
6595
arch/sparc/mm/tsb.c+42−15
@@ -7,11 +7,10 @@ · 6 unmodified lines
77 #include <linux/preempt.h>
88 #include <linux/slab.h>
99 #include <asm/page.h>
10−#include <asm/tlbflush.h>
11−#include <asm/tlb.h>
12−#include <asm/mmu_context.h>
1310 #include <asm/pgtable.h>
11+#include <asm/mmu_context.h>
1412 #include <asm/tsb.h>
13+#include <asm/tlb.h>
1514 #include <asm/oplib.h>
1615
1716 extern struct tsb swapper_tsb[KERNEL_TSB_NENTRIES];
@@ -46,23 +45,27 @@ void flush_tsb_kernel_range(unsigned long start, unsigned long end) · 28 unmodified lines
4645 }
4746 }
4847
49−static void __flush_tsb_one(struct tlb_batch *tb, unsigned long hash_shift,
50− unsigned long tsb, unsigned long nentries)
48+static void __flush_tsb_one_entry(unsigned long tsb, unsigned long v,
49+ unsigned long hash_shift,
50+ unsigned long nentries)
5151 {
52− unsigned long i;
52+ unsigned long tag, ent, hash;
5353
54− for (i = 0; i < tb->tlb_nr; i++) {
55− unsigned long v = tb->vaddrs[i];
56− unsigned long tag, ent, hash;
54+ v &= ~0x1UL;
55+ hash = tsb_hash(v, hash_shift, nentries);
56+ ent = tsb + (hash * sizeof(struct tsb));
57+ tag = (v >> 22UL);
5758
58− v &= ~0x1UL;
59+ tsb_flush(ent, tag);
60+}
5961
60− hash = tsb_hash(v, hash_shift, nentries);
61− ent = tsb + (hash * sizeof(struct tsb));
62− tag = (v >> 22UL);
62+static void __flush_tsb_one(struct tlb_batch *tb, unsigned long hash_shift,
63+ unsigned long tsb, unsigned long nentries)
64+{
65+ unsigned long i;
6366
64− tsb_flush(ent, tag);
65− }
67+ for (i = 0; i < tb->tlb_nr; i++)
68+ __flush_tsb_one_entry(tsb, tb->vaddrs[i], hash_shift, nentries);
6669 }
6770
6871 void flush_tsb_user(struct tlb_batch *tb)
@@ -90,6 +93,30 @@ void flush_tsb_user(struct tlb_batch *tb) · 21 unmodified lines
9093 spin_unlock_irqrestore(&mm->context.lock, flags);
9194 }
9295
96+void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr)
97+{
98+ unsigned long nentries, base, flags;
99+
100+ spin_lock_irqsave(&mm->context.lock, flags);
101+
102+ base = (unsigned long) mm->context.tsb_block[MM_TSB_BASE].tsb;
103+ nentries = mm->context.tsb_block[MM_TSB_BASE].tsb_nentries;
104+ if (tlb_type == cheetah_plus || tlb_type == hypervisor)
105+ base = __pa(base);
106+ __flush_tsb_one_entry(base, vaddr, PAGE_SHIFT, nentries);
107+
108+#if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
109+ if (mm->context.tsb_block[MM_TSB_HUGE].tsb) {
110+ base = (unsigned long) mm->context.tsb_block[MM_TSB_HUGE].tsb;
111+ nentries = mm->context.tsb_block[MM_TSB_HUGE].tsb_nentries;
112+ if (tlb_type == cheetah_plus || tlb_type == hypervisor)
113+ base = __pa(base);
114+ __flush_tsb_one_entry(base, vaddr, HPAGE_SHIFT, nentries);
115+ }
116+#endif
117+ spin_unlock_irqrestore(&mm->context.lock, flags);
118+}
119+
93120 #define HV_PGSZ_IDX_BASE HV_PGSZ_IDX_8K
94121 #define HV_PGSZ_MASK_BASE HV_PGSZ_MASK_8K
95122
arch/sparc/mm/ultra.S+95−24
@@ -52,6 +52,33 @@ __flush_tlb_mm: /* 18 insns */ · 51 unmodified lines
5252 nop
5353 nop
5454
55+ .align 32
56+ .globl __flush_tlb_page
57+__flush_tlb_page: /* 22 insns */
58+ /* %o0 = context, %o1 = vaddr */
59+ rdpr %pstate, %g7
60+ andn %g7, PSTATE_IE, %g2
61+ wrpr %g2, %pstate
62+ mov SECONDARY_CONTEXT, %o4
63+ ldxa [%o4] ASI_DMMU, %g2
64+ stxa %o0, [%o4] ASI_DMMU
65+ andcc %o1, 1, %g0
66+ andn %o1, 1, %o3
67+ be,pn %icc, 1f
68+ or %o3, 0x10, %o3
69+ stxa %g0, [%o3] ASI_IMMU_DEMAP
70+1: stxa %g0, [%o3] ASI_DMMU_DEMAP
71+ membar #Sync
72+ stxa %g2, [%o4] ASI_DMMU
73+ sethi %hi(KERNBASE), %o4
74+ flush %o4
75+ retl
76+ wrpr %g7, 0x0, %pstate
77+ nop
78+ nop
79+ nop
80+ nop
81+
5582 .align 32
5683 .globl __flush_tlb_pending
5784 __flush_tlb_pending: /* 26 insns */
@@ -203,6 +230,31 @@ __cheetah_flush_tlb_mm: /* 19 insns */ · 145 unmodified lines
203230 retl
204231 wrpr %g7, 0x0, %pstate
205232
233+__cheetah_flush_tlb_page: /* 22 insns */
234+ /* %o0 = context, %o1 = vaddr */
235+ rdpr %pstate, %g7
236+ andn %g7, PSTATE_IE, %g2
237+ wrpr %g2, 0x0, %pstate
238+ wrpr %g0, 1, %tl
239+ mov PRIMARY_CONTEXT, %o4
240+ ldxa [%o4] ASI_DMMU, %g2
241+ srlx %g2, CTX_PGSZ1_NUC_SHIFT, %o3
242+ sllx %o3, CTX_PGSZ1_NUC_SHIFT, %o3
243+ or %o0, %o3, %o0 /* Preserve nucleus page size fields */
244+ stxa %o0, [%o4] ASI_DMMU
245+ andcc %o1, 1, %g0
246+ be,pn %icc, 1f
247+ andn %o1, 1, %o3
248+ stxa %g0, [%o3] ASI_IMMU_DEMAP
249+1: stxa %g0, [%o3] ASI_DMMU_DEMAP
250+ membar #Sync
251+ stxa %g2, [%o4] ASI_DMMU
252+ sethi %hi(KERNBASE), %o4
253+ flush %o4
254+ wrpr %g0, 0, %tl
255+ retl
256+ wrpr %g7, 0x0, %pstate
257+
206258 __cheetah_flush_tlb_pending: /* 27 insns */
207259 /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */
208260 rdpr %pstate, %g7
@@ -269,6 +321,20 @@ __hypervisor_flush_tlb_mm: /* 10 insns */ · 60 unmodified lines
269321 retl
270322 nop
271323
324+__hypervisor_flush_tlb_page: /* 11 insns */
325+ /* %o0 = context, %o1 = vaddr */
326+ mov %o0, %g2
327+ mov %o1, %o0 /* ARG0: vaddr + IMMU-bit */
328+ mov %g2, %o1 /* ARG1: mmu context */
329+ mov HV_MMU_ALL, %o2 /* ARG2: flags */
330+ srlx %o0, PAGE_SHIFT, %o0
331+ sllx %o0, PAGE_SHIFT, %o0
332+ ta HV_MMU_UNMAP_ADDR_TRAP
333+ brnz,pn %o0, __hypervisor_tlb_tl0_error
334+ mov HV_MMU_UNMAP_ADDR_TRAP, %o1
335+ retl
336+ nop
337+
272338 __hypervisor_flush_tlb_pending: /* 16 insns */
273339 /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */
274340 sllx %o1, 3, %g1
@@ -339,6 +405,13 @@ cheetah_patch_cachetlbops: · 64 unmodified lines
339405 call tlb_patch_one
340406 mov 19, %o2
341407
408+ sethi %hi(__flush_tlb_page), %o0
409+ or %o0, %lo(__flush_tlb_page), %o0
410+ sethi %hi(__cheetah_flush_tlb_page), %o1
411+ or %o1, %lo(__cheetah_flush_tlb_page), %o1
412+ call tlb_patch_one
413+ mov 22, %o2
414+
342415 sethi %hi(__flush_tlb_pending), %o0
343416 or %o0, %lo(__flush_tlb_pending), %o0
344417 sethi %hi(__cheetah_flush_tlb_pending), %o1
@@ -397,10 +470,9 @@ xcall_flush_tlb_mm: /* 21 insns */ · 52 unmodified lines
397470 nop
398471 nop
399472
400− .globl xcall_flush_tlb_pending
401−xcall_flush_tlb_pending: /* 21 insns */
402− /* %g5=context, %g1=nr, %g7=vaddrs[] */
403− sllx %g1, 3, %g1
473+ .globl xcall_flush_tlb_page
474+xcall_flush_tlb_page: /* 17 insns */
475+ /* %g5=context, %g1=vaddr */
404476 mov PRIMARY_CONTEXT, %g4
405477 ldxa [%g4] ASI_DMMU, %g2
406478 srlx %g2, CTX_PGSZ1_NUC_SHIFT, %g4
@@ -408,20 +480,16 @@ xcall_flush_tlb_pending: /* 21 insns */ · 1 unmodified line
408480 or %g5, %g4, %g5
409481 mov PRIMARY_CONTEXT, %g4
410482 stxa %g5, [%g4] ASI_DMMU
411−1: sub %g1, (1 << 3), %g1
412− ldx [%g7 + %g1], %g5
413− andcc %g5, 0x1, %g0
483+ andcc %g1, 0x1, %g0
414484 be,pn %icc, 2f
415−
416− andn %g5, 0x1, %g5
485+ andn %g1, 0x1, %g5
417486 stxa %g0, [%g5] ASI_IMMU_DEMAP
418487 2: stxa %g0, [%g5] ASI_DMMU_DEMAP
419488 membar #Sync
420− brnz,pt %g1, 1b
421− nop
422489 stxa %g2, [%g4] ASI_DMMU
423490 retry
424491 nop
492+ nop
425493
426494 .globl xcall_flush_tlb_kernel_range
427495 xcall_flush_tlb_kernel_range: /* 25 insns */
@@ -656,15 +724,13 @@ __hypervisor_xcall_flush_tlb_mm: /* 21 insns */ · 228 unmodified lines
656724 membar #Sync
657725 retry
658726
659− .globl __hypervisor_xcall_flush_tlb_pending
660−__hypervisor_xcall_flush_tlb_pending: /* 21 insns */
661− /* %g5=ctx, %g1=nr, %g7=vaddrs[], %g2,%g3,%g4,g6=scratch */
662− sllx %g1, 3, %g1
727+ .globl __hypervisor_xcall_flush_tlb_page
728+__hypervisor_xcall_flush_tlb_page: /* 17 insns */
729+ /* %g5=ctx, %g1=vaddr */
663730 mov %o0, %g2
664731 mov %o1, %g3
665732 mov %o2, %g4
666−1: sub %g1, (1 << 3), %g1
667− ldx [%g7 + %g1], %o0 /* ARG0: virtual address */
733+ mov %g1, %o0 /* ARG0: virtual address */
668734 mov %g5, %o1 /* ARG1: mmu context */
669735 mov HV_MMU_ALL, %o2 /* ARG2: flags */
670736 srlx %o0, PAGE_SHIFT, %o0
@@ -673,8 +739,6 @@ __hypervisor_xcall_flush_tlb_pending: /* 21 insns */ · 2 unmodified lines
673739 mov HV_MMU_UNMAP_ADDR_TRAP, %g6
674740 brnz,a,pn %o0, __hypervisor_tlb_xcall_error
675741 mov %o0, %g5
676− brnz,pt %g1, 1b
677− nop
678742 mov %g2, %o0
679743 mov %g3, %o1
680744 mov %g4, %o2
@@ -757,6 +821,13 @@ hypervisor_patch_cachetlbops: · 76 unmodified lines
757821 call tlb_patch_one
758822 mov 10, %o2
759823
824+ sethi %hi(__flush_tlb_page), %o0
825+ or %o0, %lo(__flush_tlb_page), %o0
826+ sethi %hi(__hypervisor_flush_tlb_page), %o1
827+ or %o1, %lo(__hypervisor_flush_tlb_page), %o1
828+ call tlb_patch_one
829+ mov 11, %o2
830+
760831 sethi %hi(__flush_tlb_pending), %o0
761832 or %o0, %lo(__flush_tlb_pending), %o0
762833 sethi %hi(__hypervisor_flush_tlb_pending), %o1
@@ -788,12 +859,12 @@ hypervisor_patch_cachetlbops: · 25 unmodified lines
788859 call tlb_patch_one
789860 mov 21, %o2
790861
791− sethi %hi(xcall_flush_tlb_pending), %o0
792− or %o0, %lo(xcall_flush_tlb_pending), %o0
793− sethi %hi(__hypervisor_xcall_flush_tlb_pending), %o1
794− or %o1, %lo(__hypervisor_xcall_flush_tlb_pending), %o1
862+ sethi %hi(xcall_flush_tlb_page), %o0
863+ or %o0, %lo(xcall_flush_tlb_page), %o0
864+ sethi %hi(__hypervisor_xcall_flush_tlb_page), %o1
865+ or %o1, %lo(__hypervisor_xcall_flush_tlb_page), %o1
795866 call tlb_patch_one
796− mov 21, %o2
867+ mov 17, %o2
797868
798869 sethi %hi(xcall_flush_tlb_kernel_range), %o0
799870 or %o0, %lo(xcall_flush_tlb_kernel_range), %o0
arch/tile/Kconfig+1−1
@@ -17,7 +17,7 @@ config TILE · 16 unmodified lines
1717 select GENERIC_IRQ_SHOW
1818 select HAVE_DEBUG_BUGVERBOSE
1919 select HAVE_SYSCALL_WRAPPERS if TILEGX
20− select HAVE_VIRT_TO_BUS
20+ select VIRT_TO_BUS
2121 select SYS_HYPERVISOR
2222 select ARCH_HAVE_NMI_SAFE_CMPXCHG
2323 select GENERIC_CLOCKEVENTS
arch/tile/configs/tilegx_defconfig+0−1
@@ -330,7 +330,6 @@ CONFIG_MD_RAID0=m · 329 unmodified lines
330330 CONFIG_MD_RAID1=m
331331 CONFIG_MD_RAID10=m
332332 CONFIG_MD_RAID456=m
333−CONFIG_MULTICORE_RAID456=y
334333 CONFIG_MD_FAULTY=m
335334 CONFIG_BLK_DEV_DM=m
336335 CONFIG_DM_DEBUG=y
arch/tile/configs/tilepro_defconfig+0−1
@@ -324,7 +324,6 @@ CONFIG_MD_RAID0=m · 323 unmodified lines
324324 CONFIG_MD_RAID1=m
325325 CONFIG_MD_RAID10=m
326326 CONFIG_MD_RAID456=m
327−CONFIG_MULTICORE_RAID456=y
328327 CONFIG_MD_FAULTY=m
329328 CONFIG_BLK_DEV_DM=m
330329 CONFIG_DM_DEBUG=y
arch/tile/include/asm/irqflags.h+9−1
@@ -40,7 +40,15 @@ · 39 unmodified lines
4040 #include <asm/percpu.h>
4141 #include <arch/spr_def.h>
4242
43−/* Set and clear kernel interrupt masks. */
43+/*
44+ * Set and clear kernel interrupt masks.
45+ *
46+ * NOTE: __insn_mtspr() is a compiler builtin marked as a memory
47+ * clobber. We rely on it being equivalent to a compiler barrier in
48+ * this code since arch_local_irq_save() and friends must act as
49+ * compiler barriers. This compiler semantic is baked into enough
50+ * places that the compiler will maintain it going forward.
51+ */
4452 #if CHIP_HAS_SPLIT_INTR_MASK()
4553 #if INT_PERF_COUNT < 32 || INT_AUX_PERF_COUNT < 32 || INT_MEM_ERROR >= 32
4654 # error Fix assumptions about which word various interrupts are in
arch/tile/kernel/setup.c+12−13
@@ -1004,15 +1004,8 @@ void __cpuinit setup_cpu(int boot) · 1003 unmodified lines
10041004
10051005 #ifdef CONFIG_BLK_DEV_INITRD
10061006
1007−/*
1008− * Note that the kernel can potentially support other compression
1009− * techniques than gz, though we don't do so by default. If we ever
1010− * decide to do so we can either look for other filename extensions,
1011− * or just allow a file with this name to be compressed with an
1012− * arbitrary compressor (somewhat counterintuitively).
1013− */
10141007 static int __initdata set_initramfs_file;
1015−static char __initdata initramfs_file[128] = "initramfs.cpio.gz";
1008+static char __initdata initramfs_file[128] = "initramfs";
10161009
10171010 static int __init setup_initramfs_file(char *str)
10181011 {
@@ -1026,9 +1019,9 @@ static int __init setup_initramfs_file(char *str) · 7 unmodified lines
10261019 early_param("initramfs_file", setup_initramfs_file);
10271020
10281021 /*
1029− * We look for an "initramfs.cpio.gz" file in the hvfs.
1030− * If there is one, we allocate some memory for it and it will be
1031− * unpacked to the initramfs.
1022+ * We look for a file called "initramfs" in the hvfs. If there is one, we
1023+ * allocate some memory for it and it will be unpacked to the initramfs.
1024+ * If it's compressed, the initd code will uncompress it first.
10321025 */
10331026 static void __init load_hv_initrd(void)
10341027 {
@@ -1038,10 +1031,16 @@ static void __init load_hv_initrd(void) · 3 unmodified lines
10381031
10391032 fd = hv_fs_findfile((HV_VirtAddr) initramfs_file);
10401033 if (fd == HV_ENOENT) {
1041− if (set_initramfs_file)
1034+ if (set_initramfs_file) {
10421035 pr_warning("No such hvfs initramfs file '%s'\n",
10431036 initramfs_file);
1044− return;
1037+ return;
1038+ } else {
1039+ /* Try old backwards-compatible name. */
1040+ fd = hv_fs_findfile((HV_VirtAddr)"initramfs.cpio.gz");
1041+ if (fd == HV_ENOENT)
1042+ return;
1043+ }
10451044 }
10461045 BUG_ON(fd < 0);
10471046 stat = hv_fs_fstat(fd);
arch/unicore32/Kconfig+1−1
@@ -9,7 +9,7 @@ config UNICORE32 · 8 unmodified lines
99 select GENERIC_ATOMIC64
1010 select HAVE_KERNEL_LZO
1111 select HAVE_KERNEL_LZMA
12− select HAVE_VIRT_TO_BUS
12+ select VIRT_TO_BUS
1313 select ARCH_HAVE_CUSTOM_GPIO_H
1414 select GENERIC_FIND_FIRST_BIT
1515 select GENERIC_IRQ_PROBE
arch/x86/Kconfig+2−1
@@ -112,7 +112,7 @@ config X86 · 111 unmodified lines
112112 select GENERIC_STRNLEN_USER
113113 select HAVE_CONTEXT_TRACKING if X86_64
114114 select HAVE_IRQ_TIME_ACCOUNTING
115− select HAVE_VIRT_TO_BUS
115+ select VIRT_TO_BUS
116116 select MODULES_USE_ELF_REL if X86_32
117117 select MODULES_USE_ELF_RELA if X86_64
118118 select CLONE_BACKWARDS if X86_32
@@ -1550,6 +1550,7 @@ config X86_SMAP · 1431 unmodified lines
15501550 config EFI
15511551 bool "EFI runtime service support"
15521552 depends on ACPI
1553+ select UCS2_STRING
15531554 ---help---
15541555 This enables the kernel to use EFI runtime services that are
15551556 available (such as the EFI variable services).
arch/x86/boot/compressed/Makefile+2−3
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 # create a compressed vmlinux image from the original vmlinux
55 #
66
7−targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo head_$(BITS).o misc.o string.o cmdline.o early_serial_console.o piggy.o
7+targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo
88
99 KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
1010 KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
@@ -29,7 +29,6 @@ VMLINUX_OBJS = $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \ · 18 unmodified lines
2929 $(obj)/piggy.o
3030
3131 $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone
32−$(obj)/efi_stub_$(BITS).o: KBUILD_CLFAGS += -fshort-wchar -mno-red-zone
3332
3433 ifeq ($(CONFIG_EFI_STUB), y)
3534 VMLINUX_OBJS += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o
@@ -43,7 +42,7 @@ OBJCOPYFLAGS_vmlinux.bin := -R .comment -S · 7 unmodified lines
4342 $(obj)/vmlinux.bin: vmlinux FORCE
4443 $(call if_changed,objcopy)
4544
46−targets += vmlinux.bin.all vmlinux.relocs
45+targets += $(patsubst $(obj)/%,%,$(VMLINUX_OBJS)) vmlinux.bin.all vmlinux.relocs
4746
4847 CMD_RELOCS = arch/x86/tools/relocs
4948 quiet_cmd_relocs = RELOCS $@
arch/x86/boot/compressed/eboot.c+47−0
@@ -251,6 +251,51 @@ static void find_bits(unsigned long mask, u8 *pos, u8 *size) · 250 unmodified lines
251251 *size = len;
252252 }
253253
254+static efi_status_t setup_efi_vars(struct boot_params *params)
255+{
256+ struct setup_data *data;
257+ struct efi_var_bootdata *efidata;
258+ u64 store_size, remaining_size, var_size;
259+ efi_status_t status;
260+
261+ if (!sys_table->runtime->query_variable_info)
262+ return EFI_UNSUPPORTED;
263+
264+ data = (struct setup_data *)(unsigned long)params->hdr.setup_data;
265+
266+ while (data && data->next)
267+ data = (struct setup_data *)(unsigned long)data->next;
268+
269+ status = efi_call_phys4(sys_table->runtime->query_variable_info,
270+ EFI_VARIABLE_NON_VOLATILE |
271+ EFI_VARIABLE_BOOTSERVICE_ACCESS |
272+ EFI_VARIABLE_RUNTIME_ACCESS, &store_size,
273+ &remaining_size, &var_size);
274+
275+ if (status != EFI_SUCCESS)
276+ return status;
277+
278+ status = efi_call_phys3(sys_table->boottime->allocate_pool,
279+ EFI_LOADER_DATA, sizeof(*efidata), &efidata);
280+
281+ if (status != EFI_SUCCESS)
282+ return status;
283+
284+ efidata->data.type = SETUP_EFI_VARS;
285+ efidata->data.len = sizeof(struct efi_var_bootdata) -
286+ sizeof(struct setup_data);
287+ efidata->data.next = 0;
288+ efidata->store_size = store_size;
289+ efidata->remaining_size = remaining_size;
290+ efidata->max_var_size = var_size;
291+
292+ if (data)
293+ data->next = (unsigned long)efidata;
294+ else
295+ params->hdr.setup_data = (unsigned long)efidata;
296+
297+}
298+
254299 static efi_status_t setup_efi_pci(struct boot_params *params)
255300 {
256301 efi_pci_io_protocol *pci;
@@ -1157,6 +1202,8 @@ struct boot_params *efi_main(void *handle, efi_system_table_t *_table, · 900 unmodified lines
11571202
11581203 setup_graphics(boot_params);
11591204
1205+ setup_efi_vars(boot_params);
1206+
11601207 setup_efi_pci(boot_params);
11611208
11621209 status = efi_call_phys3(sys_table->boottime->allocate_pool,
arch/x86/include/asm/efi.h+7−0
@@ -102,6 +102,13 @@ extern void efi_call_phys_epilog(void); · 101 unmodified lines
102102 extern void efi_unmap_memmap(void);
103103 extern void efi_memory_uc(u64 addr, unsigned long size);
104104
105+struct efi_var_bootdata {
106+ struct setup_data data;
107+ u64 store_size;
108+ u64 remaining_size;
109+ u64 max_var_size;
110+};
111+
105112 #ifdef CONFIG_EFI
106113
107114 static inline bool efi_is_native(void)
arch/x86/include/asm/kprobes.h+1−0
@@ -77,6 +77,7 @@ struct arch_specific_insn { · 76 unmodified lines
7777 * a post_handler or break_handler).
7878 */
7979 int boostable;
80+ bool if_modifier;
8081 };
8182
8283 struct arch_optimized_insn {
arch/x86/include/asm/kvm_host.h+2−2
@@ -414,8 +414,8 @@ struct kvm_vcpu_arch { · 413 unmodified lines
414414 gpa_t time;
415415 struct pvclock_vcpu_time_info hv_clock;
416416 unsigned int hw_tsc_khz;
417− unsigned int time_offset;
418− struct page *time_page;
417+ struct gfn_to_hva_cache pv_time;
418+ bool pv_time_enabled;
419419 /* set guest stopped flag in pvclock flags field */
420420 bool pvclock_set_guest_stopped_request;
421421
arch/x86/include/asm/paravirt.h+4−1
@@ -703,7 +703,10 @@ static inline void arch_leave_lazy_mmu_mode(void) · 702 unmodified lines
703703 PVOP_VCALL0(pv_mmu_ops.lazy_mode.leave);
704704 }
705705
706−void arch_flush_lazy_mmu_mode(void);
706+static inline void arch_flush_lazy_mmu_mode(void)
707+{
708+ PVOP_VCALL0(pv_mmu_ops.lazy_mode.flush);
709+}
707710
708711 static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx,
709712 phys_addr_t phys, pgprot_t flags)
arch/x86/include/asm/paravirt_types.h+2−0
@@ -91,6 +91,7 @@ struct pv_lazy_ops { · 90 unmodified lines
9191 /* Set deferred update mode, used for batching operations. */
9292 void (*enter)(void);
9393 void (*leave)(void);
94+ void (*flush)(void);
9495 };
9596
9697 struct pv_time_ops {
@@ -679,6 +680,7 @@ void paravirt_end_context_switch(struct task_struct *next); · 582 unmodified lines
679680
680681 void paravirt_enter_lazy_mmu(void);
681682 void paravirt_leave_lazy_mmu(void);
683+void paravirt_flush_lazy_mmu(void);
682684
683685 void _paravirt_nop(void);
684686 u32 _paravirt_ident_32(u32);
arch/x86/include/asm/syscall.h+2−2
@@ -29,13 +29,13 @@ extern const unsigned long sys_call_table[]; · 28 unmodified lines
2929 */
3030 static inline int syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
3131 {
32− return regs->orig_ax & __SYSCALL_MASK;
32+ return regs->orig_ax;
3333 }
3434
3535 static inline void syscall_rollback(struct task_struct *task,
3636 struct pt_regs *regs)
3737 {
38− regs->ax = regs->orig_ax & __SYSCALL_MASK;
38+ regs->ax = regs->orig_ax;
3939 }
4040
4141 static inline long syscall_get_error(struct task_struct *task,
arch/x86/include/asm/tlb.h+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
77
88 #define tlb_flush(tlb) \
99 { \
10− if (tlb->fullmm == 0) \
10+ if (!tlb->fullmm && !tlb->need_flush_all) \
1111 flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end, 0UL); \
1212 else \
1313 flush_tlb_mm_range(tlb->mm, 0UL, TLB_FLUSH_ALL, 0UL); \
arch/x86/include/asm/xen/hypercall.h+2−2
@@ -382,14 +382,14 @@ HYPERVISOR_console_io(int cmd, int count, char *str) · 381 unmodified lines
382382 return _hypercall3(int, console_io, cmd, count, str);
383383 }
384384
385−extern int __must_check HYPERVISOR_physdev_op_compat(int, void *);
385+extern int __must_check xen_physdev_op_compat(int, void *);
386386
387387 static inline int
388388 HYPERVISOR_physdev_op(int cmd, void *arg)
389389 {
390390 int rc = _hypercall2(int, physdev_op, cmd, arg);
391391 if (unlikely(rc == -ENOSYS))
392− rc = HYPERVISOR_physdev_op_compat(cmd, arg);
392+ rc = xen_physdev_op_compat(cmd, arg);
393393 return rc;
394394 }
395395
arch/x86/include/uapi/asm/bootparam.h+1−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 #define SETUP_E820_EXT 1
77 #define SETUP_DTB 2
88 #define SETUP_PCI 3
9+#define SETUP_EFI_VARS 4
910
1011 /* ram_size flags */
1112 #define RAMDISK_IMAGE_START_MASK 0x07FF
arch/x86/include/uapi/asm/msr-index.h+1−0
@@ -44,6 +44,7 @@ · 43 unmodified lines
4444 #define SNB_C1_AUTO_UNDEMOTE (1UL << 27)
4545 #define SNB_C3_AUTO_UNDEMOTE (1UL << 28)
4646
47+#define MSR_PLATFORM_INFO 0x000000ce
4748 #define MSR_MTRRcap 0x000000fe
4849 #define MSR_IA32_BBL_CR_CTL 0x00000119
4950 #define MSR_IA32_BBL_CR_CTL3 0x0000011e
arch/x86/kernel/cpu/mshyperv.c+5−13
@@ -35,13 +35,6 @@ static bool __init ms_hyperv_platform(void) · 34 unmodified lines
3535 if (!boot_cpu_has(X86_FEATURE_HYPERVISOR))
3636 return false;
3737
38− /*
39− * Xen emulates Hyper-V to support enlightened Windows.
40− * Check to see first if we are on a Xen Hypervisor.
41− */
42− if (xen_cpuid_base())
43− return false;
44−
4538 cpuid(HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS,
4639 &eax, &hyp_signature[0], &hyp_signature[1], &hyp_signature[2]);
4740
@@ -82,12 +75,6 @@ static void __init ms_hyperv_init_platform(void) · 34 unmodified lines
8275
8376 if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE)
8477 clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100);
85−#if IS_ENABLED(CONFIG_HYPERV)
86− /*
87− * Setup the IDT for hypervisor callback.
88− */
89− alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, hyperv_callback_vector);
90−#endif
9178 }
9279
9380 const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = {
@@ -103,6 +90,11 @@ static irq_handler_t vmbus_isr; · 9 unmodified lines
10390
10491 void hv_register_vmbus_handler(int irq, irq_handler_t handler)
10592 {
93+ /*
94+ * Setup the IDT for hypervisor callback.
95+ */
96+ alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, hyperv_callback_vector);
97+
10698 vmbus_irq = irq;
10799 vmbus_isr = handler;
108100 }
arch/x86/kernel/cpu/perf_event_intel.c+20−4
@@ -101,6 +101,10 @@ static struct event_constraint intel_snb_event_constraints[] __read_mostly = · 100 unmodified lines
101101 FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
102102 FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
103103 FIXED_EVENT_CONSTRAINT(0x0300, 2), /* CPU_CLK_UNHALTED.REF */
104+ INTEL_UEVENT_CONSTRAINT(0x04a3, 0xf), /* CYCLE_ACTIVITY.CYCLES_NO_DISPATCH */
105+ INTEL_UEVENT_CONSTRAINT(0x05a3, 0xf), /* CYCLE_ACTIVITY.STALLS_L2_PENDING */
106+ INTEL_UEVENT_CONSTRAINT(0x02a3, 0x4), /* CYCLE_ACTIVITY.CYCLES_L1D_PENDING */
107+ INTEL_UEVENT_CONSTRAINT(0x06a3, 0x4), /* CYCLE_ACTIVITY.STALLS_L1D_PENDING */
104108 INTEL_EVENT_CONSTRAINT(0x48, 0x4), /* L1D_PEND_MISS.PENDING */
105109 INTEL_UEVENT_CONSTRAINT(0x01c0, 0x2), /* INST_RETIRED.PREC_DIST */
106110 INTEL_EVENT_CONSTRAINT(0xcd, 0x8), /* MEM_TRANS_RETIRED.LOAD_LATENCY */
@@ -149,8 +153,14 @@ static struct event_constraint intel_gen_event_constraints[] __read_mostly = · 42 unmodified lines
149153 };
150154
151155 static struct extra_reg intel_snb_extra_regs[] __read_mostly = {
152− INTEL_EVENT_EXTRA_REG(0xb7, MSR_OFFCORE_RSP_0, 0x3fffffffffull, RSP_0),
153− INTEL_EVENT_EXTRA_REG(0xbb, MSR_OFFCORE_RSP_1, 0x3fffffffffull, RSP_1),
156+ INTEL_EVENT_EXTRA_REG(0xb7, MSR_OFFCORE_RSP_0, 0x3f807f8fffull, RSP_0),
157+ INTEL_EVENT_EXTRA_REG(0xbb, MSR_OFFCORE_RSP_1, 0x3f807f8fffull, RSP_1),
158+ EVENT_EXTRA_END
159+};
160+
161+static struct extra_reg intel_snbep_extra_regs[] __read_mostly = {
162+ INTEL_EVENT_EXTRA_REG(0xb7, MSR_OFFCORE_RSP_0, 0x3fffff8fffull, RSP_0),
163+ INTEL_EVENT_EXTRA_REG(0xbb, MSR_OFFCORE_RSP_1, 0x3fffff8fffull, RSP_1),
154164 EVENT_EXTRA_END
155165 };
156166
@@ -2093,7 +2103,10 @@ __init int intel_pmu_init(void) · 1936 unmodified lines
20932103 x86_pmu.event_constraints = intel_snb_event_constraints;
20942104 x86_pmu.pebs_constraints = intel_snb_pebs_event_constraints;
20952105 x86_pmu.pebs_aliases = intel_pebs_aliases_snb;
2096− x86_pmu.extra_regs = intel_snb_extra_regs;
2106+ if (boot_cpu_data.x86_model == 45)
2107+ x86_pmu.extra_regs = intel_snbep_extra_regs;
2108+ else
2109+ x86_pmu.extra_regs = intel_snb_extra_regs;
20972110 /* all extra regs are per-cpu when HT is on */
20982111 x86_pmu.er_flags |= ERF_HAS_RSP_1;
20992112 x86_pmu.er_flags |= ERF_NO_HT_SHARING;
@@ -2119,7 +2132,10 @@ __init int intel_pmu_init(void) · 19 unmodified lines
21192132 x86_pmu.event_constraints = intel_ivb_event_constraints;
21202133 x86_pmu.pebs_constraints = intel_ivb_pebs_event_constraints;
21212134 x86_pmu.pebs_aliases = intel_pebs_aliases_snb;
2122− x86_pmu.extra_regs = intel_snb_extra_regs;
2135+ if (boot_cpu_data.x86_model == 62)
2136+ x86_pmu.extra_regs = intel_snbep_extra_regs;
2137+ else
2138+ x86_pmu.extra_regs = intel_snb_extra_regs;
21232139 /* all extra regs are per-cpu when HT is on */
21242140 x86_pmu.er_flags |= ERF_HAS_RSP_1;
21252141 x86_pmu.er_flags |= ERF_NO_HT_SHARING;
arch/x86/kernel/cpu/perf_event_intel_ds.c+12−1
@@ -314,10 +314,11 @@ int intel_pmu_drain_bts_buffer(void) · 313 unmodified lines
314314 if (top <= at)
315315 return 0;
316316
317+ memset(&regs, 0, sizeof(regs));
318+
317319 ds->bts_index = ds->bts_buffer_base;
318320
319321 perf_sample_data_init(&data, 0, event->hw.last_period);
320− regs.ip = 0;
321322
322323 /*
323324 * Prepare a generic sample, i.e. fill in the invariant fields.
@@ -729,3 +730,13 @@ void intel_ds_init(void) · 405 unmodified lines
729730 }
730731 }
731732 }
733+
734+void perf_restore_debug_store(void)
735+{
736+ struct debug_store *ds = __this_cpu_read(cpu_hw_events.ds);
737+
738+ if (!x86_pmu.bts && !x86_pmu.pebs)
739+ return;
740+
741+ wrmsrl(MSR_IA32_DS_AREA, (unsigned long)ds);
742+}
arch/x86/kernel/kprobes/core.c+4−1
@@ -375,6 +375,9 @@ static void __kprobes arch_copy_kprobe(struct kprobe *p) · 374 unmodified lines
375375 else
376376 p->ainsn.boostable = -1;
377377
378+ /* Check whether the instruction modifies Interrupt Flag or not */
379+ p->ainsn.if_modifier = is_IF_modifier(p->ainsn.insn);
380+
378381 /* Also, displacement change doesn't affect the first byte */
379382 p->opcode = p->ainsn.insn[0];
380383 }
@@ -434,7 +437,7 @@ static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs, · 53 unmodified lines
434437 __this_cpu_write(current_kprobe, p);
435438 kcb->kprobe_saved_flags = kcb->kprobe_old_flags
436439 = (regs->flags & (X86_EFLAGS_TF | X86_EFLAGS_IF));
437− if (is_IF_modifier(p->ainsn.insn))
440+ if (p->ainsn.if_modifier)
438441 kcb->kprobe_saved_flags &= ~X86_EFLAGS_IF;
439442 }
440443
arch/x86/kernel/microcode_core_early.c+31−7
@@ -45,9 +45,6 @@ static int __cpuinit x86_vendor(void) · 44 unmodified lines
4545 u32 eax = 0x00000000;
4646 u32 ebx, ecx = 0, edx;
4747
48− if (!have_cpuid_p())
49− return X86_VENDOR_UNKNOWN;
50−
5148 native_cpuid(&eax, &ebx, &ecx, &edx);
5249
5350 if (CPUID_IS(CPUID_INTEL1, CPUID_INTEL2, CPUID_INTEL3, ebx, ecx, edx))
@@ -59,18 +56,45 @@ static int __cpuinit x86_vendor(void) · 5 unmodified lines
5956 return X86_VENDOR_UNKNOWN;
6057 }
6158
59+static int __cpuinit x86_family(void)
60+{
61+ u32 eax = 0x00000001;
62+ u32 ebx, ecx = 0, edx;
63+ int x86;
64+
65+ native_cpuid(&eax, &ebx, &ecx, &edx);
66+
67+ x86 = (eax >> 8) & 0xf;
68+ if (x86 == 15)
69+ x86 += (eax >> 20) & 0xff;
70+
71+ return x86;
72+}
73+
6274 void __init load_ucode_bsp(void)
6375 {
64− int vendor = x86_vendor();
76+ int vendor, x86;
77+
78+ if (!have_cpuid_p())
79+ return;
6580
66− if (vendor == X86_VENDOR_INTEL)
81+ vendor = x86_vendor();
82+ x86 = x86_family();
83+
84+ if (vendor == X86_VENDOR_INTEL && x86 >= 6)
6785 load_ucode_intel_bsp();
6886 }
6987
7088 void __cpuinit load_ucode_ap(void)
7189 {
72− int vendor = x86_vendor();
90+ int vendor, x86;
91+
92+ if (!have_cpuid_p())
93+ return;
94+
95+ vendor = x86_vendor();
96+ x86 = x86_family();
7397
74− if (vendor == X86_VENDOR_INTEL)
98+ if (vendor == X86_VENDOR_INTEL && x86 >= 6)
7599 load_ucode_intel_ap();
76100 }
arch/x86/kernel/microcode_intel_early.c+15−15
@@ -90,13 +90,13 @@ microcode_phys(struct microcode_intel **mc_saved_tmp, · 89 unmodified lines
9090 struct microcode_intel ***mc_saved;
9191
9292 mc_saved = (struct microcode_intel ***)
93− __pa_symbol(&mc_saved_data->mc_saved);
93+ __pa_nodebug(&mc_saved_data->mc_saved);
9494 for (i = 0; i < mc_saved_data->mc_saved_count; i++) {
9595 struct microcode_intel *p;
9696
9797 p = *(struct microcode_intel **)
98− __pa(mc_saved_data->mc_saved + i);
99− mc_saved_tmp[i] = (struct microcode_intel *)__pa(p);
98+ __pa_nodebug(mc_saved_data->mc_saved + i);
99+ mc_saved_tmp[i] = (struct microcode_intel *)__pa_nodebug(p);
100100 }
101101 }
102102 #endif
@@ -562,7 +562,7 @@ scan_microcode(unsigned long start, unsigned long end, · 459 unmodified lines
562562 struct cpio_data cd;
563563 long offset = 0;
564564 #ifdef CONFIG_X86_32
565− char *p = (char *)__pa_symbol(ucode_name);
565+ char *p = (char *)__pa_nodebug(ucode_name);
566566 #else
567567 char *p = ucode_name;
568568 #endif
@@ -630,8 +630,8 @@ static void __cpuinit print_ucode(struct ucode_cpu_info *uci) · 61 unmodified lines
630630 if (mc_intel == NULL)
631631 return;
632632
633− delay_ucode_info_p = (int *)__pa_symbol(&delay_ucode_info);
634− current_mc_date_p = (int *)__pa_symbol(&current_mc_date);
633+ delay_ucode_info_p = (int *)__pa_nodebug(&delay_ucode_info);
634+ current_mc_date_p = (int *)__pa_nodebug(&current_mc_date);
635635
636636 *delay_ucode_info_p = 1;
637637 *current_mc_date_p = mc_intel->hdr.date;
@@ -659,8 +659,8 @@ static inline void __cpuinit print_ucode(struct ucode_cpu_info *uci) · 21 unmodified lines
659659 }
660660 #endif
661661
662−static int apply_microcode_early(struct mc_saved_data *mc_saved_data,
663− struct ucode_cpu_info *uci)
662+static int __cpuinit apply_microcode_early(struct mc_saved_data *mc_saved_data,
663+ struct ucode_cpu_info *uci)
664664 {
665665 struct microcode_intel *mc_intel;
666666 unsigned int val[2];
@@ -741,15 +741,15 @@ load_ucode_intel_bsp(void) · 74 unmodified lines
741741 #ifdef CONFIG_X86_32
742742 struct boot_params *boot_params_p;
743743
744− boot_params_p = (struct boot_params *)__pa_symbol(&boot_params);
744+ boot_params_p = (struct boot_params *)__pa_nodebug(&boot_params);
745745 ramdisk_image = boot_params_p->hdr.ramdisk_image;
746746 ramdisk_size = boot_params_p->hdr.ramdisk_size;
747747 initrd_start_early = ramdisk_image;
748748 initrd_end_early = initrd_start_early + ramdisk_size;
749749
750750 _load_ucode_intel_bsp(
751− (struct mc_saved_data *)__pa_symbol(&mc_saved_data),
752− (unsigned long *)__pa_symbol(&mc_saved_in_initrd),
751+ (struct mc_saved_data *)__pa_nodebug(&mc_saved_data),
752+ (unsigned long *)__pa_nodebug(&mc_saved_in_initrd),
753753 initrd_start_early, initrd_end_early, &uci);
754754 #else
755755 ramdisk_image = boot_params.hdr.ramdisk_image;
@@ -772,10 +772,10 @@ void __cpuinit load_ucode_intel_ap(void) · 16 unmodified lines
772772 unsigned long *initrd_start_p;
773773
774774 mc_saved_in_initrd_p =
775− (unsigned long *)__pa_symbol(mc_saved_in_initrd);
776− mc_saved_data_p = (struct mc_saved_data *)__pa_symbol(&mc_saved_data);
777− initrd_start_p = (unsigned long *)__pa_symbol(&initrd_start);
778− initrd_start_addr = (unsigned long)__pa_symbol(*initrd_start_p);
775+ (unsigned long *)__pa_nodebug(mc_saved_in_initrd);
776+ mc_saved_data_p = (struct mc_saved_data *)__pa_nodebug(&mc_saved_data);
777+ initrd_start_p = (unsigned long *)__pa_nodebug(&initrd_start);
778+ initrd_start_addr = (unsigned long)__pa_nodebug(*initrd_start_p);
779779 #else
780780 mc_saved_data_p = &mc_saved_data;
781781 mc_saved_in_initrd_p = mc_saved_in_initrd;
arch/x86/kernel/paravirt.c+13−12
@@ -263,6 +263,18 @@ void paravirt_leave_lazy_mmu(void) · 262 unmodified lines
263263 leave_lazy(PARAVIRT_LAZY_MMU);
264264 }
265265
266+void paravirt_flush_lazy_mmu(void)
267+{
268+ preempt_disable();
269+
270+ if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU) {
271+ arch_leave_lazy_mmu_mode();
272+ arch_enter_lazy_mmu_mode();
273+ }
274+
275+ preempt_enable();
276+}
277+
266278 void paravirt_start_context_switch(struct task_struct *prev)
267279 {
268280 BUG_ON(preemptible());
@@ -292,18 +304,6 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void) · 23 unmodified lines
292304 return this_cpu_read(paravirt_lazy_mode);
293305 }
294306
295−void arch_flush_lazy_mmu_mode(void)
296−{
297− preempt_disable();
298−
299− if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU) {
300− arch_leave_lazy_mmu_mode();
301− arch_enter_lazy_mmu_mode();
302− }
303−
304− preempt_enable();
305−}
306−
307307 struct pv_info pv_info = {
308308 .name = "bare hardware",
309309 .paravirt_enabled = 0,
@@ -475,6 +475,7 @@ struct pv_mmu_ops pv_mmu_ops = { · 165 unmodified lines
475475 .lazy_mode = {
476476 .enter = paravirt_nop,
477477 .leave = paravirt_nop,
478+ .flush = paravirt_nop,
478479 },
479480
480481 .set_fixmap = native_set_fixmap,
arch/x86/kernel/setup.c+37−8
@@ -507,11 +507,14 @@ static void __init memblock_x86_reserve_range_setup_data(void) · 506 unmodified lines
507507 /*
508508 * Keep the crash kernel below this limit. On 32 bits earlier kernels
509509 * would limit the kernel to the low 512 MiB due to mapping restrictions.
510+ * On 64bit, old kexec-tools need to under 896MiB.
510511 */
511512 #ifdef CONFIG_X86_32
512−# define CRASH_KERNEL_ADDR_MAX (512 << 20)
513+# define CRASH_KERNEL_ADDR_LOW_MAX (512 << 20)
514+# define CRASH_KERNEL_ADDR_HIGH_MAX (512 << 20)
513515 #else
514−# define CRASH_KERNEL_ADDR_MAX MAXMEM
516+# define CRASH_KERNEL_ADDR_LOW_MAX (896UL<<20)
517+# define CRASH_KERNEL_ADDR_HIGH_MAX MAXMEM
515518 #endif
516519
517520 static void __init reserve_crashkernel_low(void)
@@ -521,19 +524,35 @@ static void __init reserve_crashkernel_low(void) · 3 unmodified lines
521524 unsigned long long low_base = 0, low_size = 0;
522525 unsigned long total_low_mem;
523526 unsigned long long base;
527+ bool auto_set = false;
524528 int ret;
525529
526530 total_low_mem = memblock_mem_size(1UL<<(32-PAGE_SHIFT));
531+ /* crashkernel=Y,low */
527532 ret = parse_crashkernel_low(boot_command_line, total_low_mem,
528533 &low_size, &base);
529− if (ret != 0 || low_size <= 0)
530− return;
534+ if (ret != 0) {
535+ /*
536+ * two parts from lib/swiotlb.c:
537+ * swiotlb size: user specified with swiotlb= or default.
538+ * swiotlb overflow buffer: now is hardcoded to 32k.
539+ * We round it to 8M for other buffers that
540+ * may need to stay low too.
541+ */
542+ low_size = swiotlb_size_or_default() + (8UL<<20);
543+ auto_set = true;
544+ } else {
545+ /* passed with crashkernel=0,low ? */
546+ if (!low_size)
547+ return;
548+ }
531549
532550 low_base = memblock_find_in_range(low_size, (1ULL<<32),
533551 low_size, alignment);
534552
535553 if (!low_base) {
536− pr_info("crashkernel low reservation failed - No suitable area found.\n");
554+ if (!auto_set)
555+ pr_info("crashkernel low reservation failed - No suitable area found.\n");
537556
538557 return;
539558 }
@@ -554,14 +573,22 @@ static void __init reserve_crashkernel(void) · 14 unmodified lines
554573 const unsigned long long alignment = 16<<20; /* 16M */
555574 unsigned long long total_mem;
556575 unsigned long long crash_size, crash_base;
576+ bool high = false;
557577 int ret;
558578
559579 total_mem = memblock_phys_mem_size();
560580
581+ /* crashkernel=XM */
561582 ret = parse_crashkernel(boot_command_line, total_mem,
562583 &crash_size, &crash_base);
563− if (ret != 0 || crash_size <= 0)
564− return;
584+ if (ret != 0 || crash_size <= 0) {
585+ /* crashkernel=X,high */
586+ ret = parse_crashkernel_high(boot_command_line, total_mem,
587+ &crash_size, &crash_base);
588+ if (ret != 0 || crash_size <= 0)
589+ return;
590+ high = true;
591+ }
565592
566593 /* 0 means: find the address automatically */
567594 if (crash_base <= 0) {
@@ -569,7 +596,9 @@ static void __init reserve_crashkernel(void) · 1 unmodified line
569596 * kexec want bzImage is below CRASH_KERNEL_ADDR_MAX
570597 */
571598 crash_base = memblock_find_in_range(alignment,
572− CRASH_KERNEL_ADDR_MAX, crash_size, alignment);
599+ high ? CRASH_KERNEL_ADDR_HIGH_MAX :
600+ CRASH_KERNEL_ADDR_LOW_MAX,
601+ crash_size, alignment);
573602
574603 if (!crash_base) {
575604 pr_info("crashkernel reservation failed - No suitable area found.\n");
arch/x86/kvm/lapic.c+1−1
@@ -1857,7 +1857,7 @@ int kvm_lapic_enable_pv_eoi(struct kvm_vcpu *vcpu, u64 data) · 1856 unmodified lines
18571857 if (!pv_eoi_enabled(vcpu))
18581858 return 0;
18591859 return kvm_gfn_to_hva_cache_init(vcpu->kvm, &vcpu->arch.pv_eoi.data,
1860− addr);
1860+ addr, sizeof(u8));
18611861 }
18621862
18631863 void kvm_lapic_init(void)
arch/x86/kvm/x86.c+33−36
@@ -1406,25 +1406,15 @@ static int kvm_guest_time_update(struct kvm_vcpu *v) · 1405 unmodified lines
14061406 unsigned long flags, this_tsc_khz;
14071407 struct kvm_vcpu_arch *vcpu = &v->arch;
14081408 struct kvm_arch *ka = &v->kvm->arch;
1409− void *shared_kaddr;
14101409 s64 kernel_ns, max_kernel_ns;
14111410 u64 tsc_timestamp, host_tsc;
1412− struct pvclock_vcpu_time_info *guest_hv_clock;
1411+ struct pvclock_vcpu_time_info guest_hv_clock;
14131412 u8 pvclock_flags;
14141413 bool use_master_clock;
14151414
14161415 kernel_ns = 0;
14171416 host_tsc = 0;
14181417
1419− /* Keep irq disabled to prevent changes to the clock */
1420− local_irq_save(flags);
1421− this_tsc_khz = __get_cpu_var(cpu_tsc_khz);
1422− if (unlikely(this_tsc_khz == 0)) {
1423− local_irq_restore(flags);
1424− kvm_make_request(KVM_REQ_CLOCK_UPDATE, v);
1425− return 1;
1426− }
1427−
14281418 /*
14291419 * If the host uses TSC clock, then passthrough TSC as stable
14301420 * to the guest.
@@ -1436,6 +1426,15 @@ static int kvm_guest_time_update(struct kvm_vcpu *v) · 5 unmodified lines
14361426 kernel_ns = ka->master_kernel_ns;
14371427 }
14381428 spin_unlock(&ka->pvclock_gtod_sync_lock);
1429+
1430+ /* Keep irq disabled to prevent changes to the clock */
1431+ local_irq_save(flags);
1432+ this_tsc_khz = __get_cpu_var(cpu_tsc_khz);
1433+ if (unlikely(this_tsc_khz == 0)) {
1434+ local_irq_restore(flags);
1435+ kvm_make_request(KVM_REQ_CLOCK_UPDATE, v);
1436+ return 1;
1437+ }
14391438 if (!use_master_clock) {
14401439 host_tsc = native_read_tsc();
14411440 kernel_ns = get_kernel_ns();
@@ -1463,7 +1462,7 @@ static int kvm_guest_time_update(struct kvm_vcpu *v) · 21 unmodified lines
14631462
14641463 local_irq_restore(flags);
14651464
1466− if (!vcpu->time_page)
1465+ if (!vcpu->pv_time_enabled)
14671466 return 0;
14681467
14691468 /*
@@ -1525,12 +1524,12 @@ static int kvm_guest_time_update(struct kvm_vcpu *v) · 55 unmodified lines
15251524 */
15261525 vcpu->hv_clock.version += 2;
15271526
1528− shared_kaddr = kmap_atomic(vcpu->time_page);
1529−
1530− guest_hv_clock = shared_kaddr + vcpu->time_offset;
1527+ if (unlikely(kvm_read_guest_cached(v->kvm, &vcpu->pv_time,
1528+ &guest_hv_clock, sizeof(guest_hv_clock))))
1529+ return 0;
15311530
15321531 /* retain PVCLOCK_GUEST_STOPPED if set in guest copy */
1533− pvclock_flags = (guest_hv_clock->flags & PVCLOCK_GUEST_STOPPED);
1532+ pvclock_flags = (guest_hv_clock.flags & PVCLOCK_GUEST_STOPPED);
15341533
15351534 if (vcpu->pvclock_set_guest_stopped_request) {
15361535 pvclock_flags |= PVCLOCK_GUEST_STOPPED;
@@ -1543,12 +1542,9 @@ static int kvm_guest_time_update(struct kvm_vcpu *v) · 6 unmodified lines
15431542
15441543 vcpu->hv_clock.flags = pvclock_flags;
15451544
1546− memcpy(shared_kaddr + vcpu->time_offset, &vcpu->hv_clock,
1547− sizeof(vcpu->hv_clock));
1548−
1549− kunmap_atomic(shared_kaddr);
1550−
1551− mark_page_dirty(v->kvm, vcpu->time >> PAGE_SHIFT);
1545+ kvm_write_guest_cached(v->kvm, &vcpu->pv_time,
1546+ &vcpu->hv_clock,
1547+ sizeof(vcpu->hv_clock));
15521548 return 0;
15531549 }
15541550
@@ -1827,7 +1823,8 @@ static int kvm_pv_enable_async_pf(struct kvm_vcpu *vcpu, u64 data) · 272 unmodified lines
18271823 return 0;
18281824 }
18291825
1830− if (kvm_gfn_to_hva_cache_init(vcpu->kvm, &vcpu->arch.apf.data, gpa))
1826+ if (kvm_gfn_to_hva_cache_init(vcpu->kvm, &vcpu->arch.apf.data, gpa,
1827+ sizeof(u32)))
18311828 return 1;
18321829
18331830 vcpu->arch.apf.send_user_only = !(data & KVM_ASYNC_PF_SEND_ALWAYS);
@@ -1837,10 +1834,7 @@ static int kvm_pv_enable_async_pf(struct kvm_vcpu *vcpu, u64 data) · 3 unmodified lines
18371834
18381835 static void kvmclock_reset(struct kvm_vcpu *vcpu)
18391836 {
1840− if (vcpu->arch.time_page) {
1841− kvm_release_page_dirty(vcpu->arch.time_page);
1842− vcpu->arch.time_page = NULL;
1843− }
1837+ vcpu->arch.pv_time_enabled = false;
18441838 }
18451839
18461840 static void accumulate_steal_time(struct kvm_vcpu *vcpu)
@@ -1947,6 +1941,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 100 unmodified lines
19471941 break;
19481942 case MSR_KVM_SYSTEM_TIME_NEW:
19491943 case MSR_KVM_SYSTEM_TIME: {
1944+ u64 gpa_offset;
19501945 kvmclock_reset(vcpu);
19511946
19521947 vcpu->arch.time = data;
@@ -1956,14 +1951,14 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 3 unmodified lines
19561951 if (!(data & 1))
19571952 break;
19581953
1959− /* ...but clean it before doing the actual write */
1960− vcpu->arch.time_offset = data & ~(PAGE_MASK | 1);
1961−
1962− vcpu->arch.time_page =
1963− gfn_to_page(vcpu->kvm, data >> PAGE_SHIFT);
1954+ gpa_offset = data & ~(PAGE_MASK | 1);
19641955
1965− if (is_error_page(vcpu->arch.time_page))
1966− vcpu->arch.time_page = NULL;
1956+ if (kvm_gfn_to_hva_cache_init(vcpu->kvm,
1957+ &vcpu->arch.pv_time, data & ~1ULL,
1958+ sizeof(struct pvclock_vcpu_time_info)))
1959+ vcpu->arch.pv_time_enabled = false;
1960+ else
1961+ vcpu->arch.pv_time_enabled = true;
19671962
19681963 break;
19691964 }
@@ -1980,7 +1975,8 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 10 unmodified lines
19801975 return 1;
19811976
19821977 if (kvm_gfn_to_hva_cache_init(vcpu->kvm, &vcpu->arch.st.stime,
1983− data & KVM_STEAL_VALID_BITS))
1978+ data & KVM_STEAL_VALID_BITS,
1979+ sizeof(struct kvm_steal_time)))
19841980 return 1;
19851981
19861982 vcpu->arch.st.msr_val = data;
@@ -2967,7 +2963,7 @@ static int kvm_vcpu_ioctl_x86_set_xcrs(struct kvm_vcpu *vcpu, · 980 unmodified lines
29672963 */
29682964 static int kvm_set_guest_paused(struct kvm_vcpu *vcpu)
29692965 {
2970− if (!vcpu->arch.time_page)
2966+ if (!vcpu->arch.pv_time_enabled)
29712967 return -EINVAL;
29722968 vcpu->arch.pvclock_set_guest_stopped_request = true;
29732969 kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
@@ -6718,6 +6714,7 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) · 3744 unmodified lines
67186714 goto fail_free_wbinvd_dirty_mask;
67196715
67206716 vcpu->arch.ia32_tsc_adjust_msr = 0x0;
6717+ vcpu->arch.pv_time_enabled = false;
67216718 kvm_async_pf_hash_reset(vcpu);
67226719 kvm_pmu_init(vcpu);
67236720
arch/x86/lguest/boot.c+1−0
@@ -1334,6 +1334,7 @@ __init void lguest_init(void) · 1333 unmodified lines
13341334 pv_mmu_ops.read_cr3 = lguest_read_cr3;
13351335 pv_mmu_ops.lazy_mode.enter = paravirt_enter_lazy_mmu;
13361336 pv_mmu_ops.lazy_mode.leave = lguest_leave_lazy_mmu_mode;
1337+ pv_mmu_ops.lazy_mode.flush = paravirt_flush_lazy_mmu;
13371338 pv_mmu_ops.pte_update = lguest_pte_update;
13381339 pv_mmu_ops.pte_update_defer = lguest_pte_update;
13391340
arch/x86/lib/usercopy_64.c+2−2
@@ -74,10 +74,10 @@ copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest) · 73 unmodified lines
7474 char c;
7575 unsigned zero_len;
7676
77− for (; len; --len) {
77+ for (; len; --len, to++) {
7878 if (__get_user_nocheck(c, from++, sizeof(char)))
7979 break;
80− if (__put_user_nocheck(c, to++, sizeof(char)))
80+ if (__put_user_nocheck(c, to, sizeof(char)))
8181 break;
8282 }
8383
arch/x86/mm/fault.c+4−2
@@ -378,10 +378,12 @@ static noinline __kprobes int vmalloc_fault(unsigned long address) · 377 unmodified lines
378378 if (pgd_none(*pgd_ref))
379379 return -1;
380380
381− if (pgd_none(*pgd))
381+ if (pgd_none(*pgd)) {
382382 set_pgd(pgd, *pgd_ref);
383− else
383+ arch_flush_lazy_mmu_mode();
384+ } else {
384385 BUG_ON(pgd_page_vaddr(*pgd) != pgd_page_vaddr(*pgd_ref));
386+ }
385387
386388 /*
387389 * Below here mismatches are bugs because these lower tables
arch/x86/mm/pageattr-test.c+1−1
@@ -68,7 +68,7 @@ static int print_split(struct split_state *s) · 67 unmodified lines
6868 s->gpg++;
6969 i += GPS/PAGE_SIZE;
7070 } else if (level == PG_LEVEL_2M) {
71− if (!(pte_val(*pte) & _PAGE_PSE)) {
71+ if ((pte_val(*pte) & _PAGE_PRESENT) && !(pte_val(*pte) & _PAGE_PSE)) {
7272 printk(KERN_ERR
7373 "%lx level %d but not PSE %Lx\n",
7474 addr, level, (u64)pte_val(*pte));
arch/x86/mm/pageattr.c+7−5
@@ -467,7 +467,7 @@ try_preserve_large_page(pte_t *kpte, unsigned long address, · 466 unmodified lines
467467 * We are safe now. Check whether the new pgprot is the same:
468468 */
469469 old_pte = *kpte;
470− old_prot = new_prot = req_prot = pte_pgprot(old_pte);
470+ old_prot = req_prot = pte_pgprot(old_pte);
471471
472472 pgprot_val(req_prot) &= ~pgprot_val(cpa->mask_clr);
473473 pgprot_val(req_prot) |= pgprot_val(cpa->mask_set);
@@ -478,12 +478,12 @@ try_preserve_large_page(pte_t *kpte, unsigned long address, · 4 unmodified lines
478478 * a non present pmd. The canon_pgprot will clear _PAGE_GLOBAL
479479 * for the ancient hardware that doesn't support it.
480480 */
481− if (pgprot_val(new_prot) & _PAGE_PRESENT)
482− pgprot_val(new_prot) |= _PAGE_PSE | _PAGE_GLOBAL;
481+ if (pgprot_val(req_prot) & _PAGE_PRESENT)
482+ pgprot_val(req_prot) |= _PAGE_PSE | _PAGE_GLOBAL;
483483 else
484− pgprot_val(new_prot) &= ~(_PAGE_PSE | _PAGE_GLOBAL);
484+ pgprot_val(req_prot) &= ~(_PAGE_PSE | _PAGE_GLOBAL);
485485
486− new_prot = canon_pgprot(new_prot);
486+ req_prot = canon_pgprot(req_prot);
487487
488488 /*
489489 * old_pte points to the large page base address. So we need
@@ -1413,6 +1413,8 @@ void kernel_map_pages(struct page *page, int numpages, int enable) · 923 unmodified lines
14131413 * but that can deadlock->flush only current cpu:
14141414 */
14151415 __flush_tlb_all();
1416+
1417+ arch_flush_lazy_mmu_mode();
14161418 }
14171419
14181420 #ifdef CONFIG_HIBERNATION
arch/x86/mm/pgtable.c+7−0
@@ -58,6 +58,13 @@ void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte) · 57 unmodified lines
5858 void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
5959 {
6060 paravirt_release_pmd(__pa(pmd) >> PAGE_SHIFT);
61+ /*
62+ * NOTE! For PAE, any changes to the top page-directory-pointer-table
63+ * entries need a full cr3 reload to flush.
64+ */
65+#ifdef CONFIG_X86_PAE
66+ tlb->need_flush_all = 1;
67+#endif
6168 tlb_remove_page(tlb, virt_to_page(pmd));
6269 }
6370
arch/x86/platform/efi/efi.c+163−5
@@ -41,6 +41,7 @@ · 40 unmodified lines
4141 #include <linux/io.h>
4242 #include <linux/reboot.h>
4343 #include <linux/bcd.h>
44+#include <linux/ucs2_string.h>
4445
4546 #include <asm/setup.h>
4647 #include <asm/efi.h>
@@ -52,6 +53,13 @@ · 5 unmodified lines
5253
5354 #define EFI_DEBUG 1
5455
56+/*
57+ * There's some additional metadata associated with each
58+ * variable. Intel's reference implementation is 60 bytes - bump that
59+ * to account for potential alignment constraints
60+ */
61+#define VAR_METADATA_SIZE 64
62+
5563 struct efi __read_mostly efi = {
5664 .mps = EFI_INVALID_TABLE_ADDR,
5765 .acpi = EFI_INVALID_TABLE_ADDR,
@@ -70,6 +78,13 @@ struct efi_memory_map memmap; · 12 unmodified lines
7078 static struct efi efi_phys __initdata;
7179 static efi_system_table_t efi_systab __initdata;
7280
81+static u64 efi_var_store_size;
82+static u64 efi_var_remaining_size;
83+static u64 efi_var_max_var_size;
84+static u64 boot_used_size;
85+static u64 boot_var_size;
86+static u64 active_size;
87+
7388 unsigned long x86_efi_facility;
7489
7590 /*
@@ -99,6 +114,15 @@ static int __init setup_add_efi_memmap(char *arg) · 23 unmodified lines
99114 }
100115 early_param("add_efi_memmap", setup_add_efi_memmap);
101116
117+static bool efi_no_storage_paranoia;
118+
119+static int __init setup_storage_paranoia(char *arg)
120+{
121+ efi_no_storage_paranoia = true;
122+ return 0;
123+}
124+early_param("efi_no_storage_paranoia", setup_storage_paranoia);
125+
102126
103127 static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc)
104128 {
@@ -163,8 +187,53 @@ static efi_status_t virt_efi_get_next_variable(unsigned long *name_size, · 58 unmodified lines
163187 efi_char16_t *name,
164188 efi_guid_t *vendor)
165189 {
166− return efi_call_virt3(get_next_variable,
167− name_size, name, vendor);
190+ efi_status_t status;
191+ static bool finished = false;
192+ static u64 var_size;
193+
194+ status = efi_call_virt3(get_next_variable,
195+ name_size, name, vendor);
196+
197+ if (status == EFI_NOT_FOUND) {
198+ finished = true;
199+ if (var_size < boot_used_size) {
200+ boot_var_size = boot_used_size - var_size;
201+ active_size += boot_var_size;
202+ } else {
203+ printk(KERN_WARNING FW_BUG "efi: Inconsistent initial sizes\n");
204+ }
205+ }
206+
207+ if (boot_used_size && !finished) {
208+ unsigned long size;
209+ u32 attr;
210+ efi_status_t s;
211+ void *tmp;
212+
213+ s = virt_efi_get_variable(name, vendor, &attr, &size, NULL);
214+
215+ if (s != EFI_BUFFER_TOO_SMALL || !size)
216+ return status;
217+
218+ tmp = kmalloc(size, GFP_ATOMIC);
219+
220+ if (!tmp)
221+ return status;
222+
223+ s = virt_efi_get_variable(name, vendor, &attr, &size, tmp);
224+
225+ if (s == EFI_SUCCESS && (attr & EFI_VARIABLE_NON_VOLATILE)) {
226+ var_size += size;
227+ var_size += ucs2_strsize(name, 1024);
228+ active_size += size;
229+ active_size += VAR_METADATA_SIZE;
230+ active_size += ucs2_strsize(name, 1024);
231+ }
232+
233+ kfree(tmp);
234+ }
235+
236+ return status;
168237 }
169238
170239 static efi_status_t virt_efi_set_variable(efi_char16_t *name,
@@ -173,9 +242,34 @@ static efi_status_t virt_efi_set_variable(efi_char16_t *name, · 2 unmodified lines
173242 unsigned long data_size,
174243 void *data)
175244 {
176− return efi_call_virt5(set_variable,
177− name, vendor, attr,
178− data_size, data);
245+ efi_status_t status;
246+ u32 orig_attr = 0;
247+ unsigned long orig_size = 0;
248+
249+ status = virt_efi_get_variable(name, vendor, &orig_attr, &orig_size,
250+ NULL);
251+
252+ if (status != EFI_BUFFER_TOO_SMALL)
253+ orig_size = 0;
254+
255+ status = efi_call_virt5(set_variable,
256+ name, vendor, attr,
257+ data_size, data);
258+
259+ if (status == EFI_SUCCESS) {
260+ if (orig_size) {
261+ active_size -= orig_size;
262+ active_size -= ucs2_strsize(name, 1024);
263+ active_size -= VAR_METADATA_SIZE;
264+ }
265+ if (data_size) {
266+ active_size += data_size;
267+ active_size += ucs2_strsize(name, 1024);
268+ active_size += VAR_METADATA_SIZE;
269+ }
270+ }
271+
272+ return status;
179273 }
180274
181275 static efi_status_t virt_efi_query_variable_info(u32 attr,
@@ -690,6 +784,9 @@ void __init efi_init(void) · 508 unmodified lines
690784 char vendor[100] = "unknown";
691785 int i = 0;
692786 void *tmp;
787+ struct setup_data *data;
788+ struct efi_var_bootdata *efi_var_data;
789+ u64 pa_data;
693790
694791 #ifdef CONFIG_X86_32
695792 if (boot_params.efi_info.efi_systab_hi ||
@@ -707,6 +804,22 @@ void __init efi_init(void) · 11 unmodified lines
707804 if (efi_systab_init(efi_phys.systab))
708805 return;
709806
807+ pa_data = boot_params.hdr.setup_data;
808+ while (pa_data) {
809+ data = early_ioremap(pa_data, sizeof(*efi_var_data));
810+ if (data->type == SETUP_EFI_VARS) {
811+ efi_var_data = (struct efi_var_bootdata *)data;
812+
813+ efi_var_store_size = efi_var_data->store_size;
814+ efi_var_remaining_size = efi_var_data->remaining_size;
815+ efi_var_max_var_size = efi_var_data->max_var_size;
816+ }
817+ pa_data = data->next;
818+ early_iounmap(data, sizeof(*efi_var_data));
819+ }
820+
821+ boot_used_size = efi_var_store_size - efi_var_remaining_size;
822+
710823 set_bit(EFI_SYSTEM_TABLES, &x86_efi_facility);
711824
712825 /*
@@ -1007,3 +1120,48 @@ u64 efi_mem_attributes(unsigned long phys_addr) · 294 unmodified lines
10071120 }
10081121 return 0;
10091122 }
1123+
1124+/*
1125+ * Some firmware has serious problems when using more than 50% of the EFI
1126+ * variable store, i.e. it triggers bugs that can brick machines. Ensure that
1127+ * we never use more than this safe limit.
1128+ *
1129+ * Return EFI_SUCCESS if it is safe to write 'size' bytes to the variable
1130+ * store.
1131+ */
1132+efi_status_t efi_query_variable_store(u32 attributes, unsigned long size)
1133+{
1134+ efi_status_t status;
1135+ u64 storage_size, remaining_size, max_size;
1136+
1137+ status = efi.query_variable_info(attributes, &storage_size,
1138+ &remaining_size, &max_size);
1139+ if (status != EFI_SUCCESS)
1140+ return status;
1141+
1142+ if (!max_size && remaining_size > size)
1143+ printk_once(KERN_ERR FW_BUG "Broken EFI implementation"
1144+ " is returning MaxVariableSize=0\n");
1145+ /*
1146+ * Some firmware implementations refuse to boot if there's insufficient
1147+ * space in the variable store. We account for that by refusing the
1148+ * write if permitting it would reduce the available space to under
1149+ * 50%. However, some firmware won't reclaim variable space until
1150+ * after the used (not merely the actively used) space drops below
1151+ * a threshold. We can approximate that case with the value calculated
1152+ * above. If both the firmware and our calculations indicate that the
1153+ * available space would drop below 50%, refuse the write.
1154+ */
1155+
1156+ if (!storage_size || size > remaining_size ||
1157+ (max_size && size > max_size))
1158+ return EFI_OUT_OF_RESOURCES;
1159+
1160+ if (!efi_no_storage_paranoia &&
1161+ ((active_size + size + VAR_METADATA_SIZE > storage_size / 2) &&
1162+ (remaining_size - size < storage_size / 2)))
1163+ return EFI_OUT_OF_RESOURCES;
1164+
1165+ return EFI_SUCCESS;
1166+}
1167+EXPORT_SYMBOL_GPL(efi_query_variable_store);
arch/x86/power/cpu.c+2−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/suspend.h>
1212 #include <linux/export.h>
1313 #include <linux/smp.h>
14+#include <linux/perf_event.h>
1415
1516 #include <asm/pgtable.h>
1617 #include <asm/proto.h>
@@ -228,6 +229,7 @@ static void __restore_processor_state(struct saved_context *ctxt) · 211 unmodified lines
228229 do_fpu_end();
229230 x86_platform.restore_sched_clock_state();
230231 mtrr_bp_restore();
232+ perf_restore_debug_store();
231233 }
232234
233235 /* Needed by apm.c */
arch/x86/xen/mmu.c+10−6
@@ -1467,8 +1467,6 @@ static void __init xen_write_cr3_init(unsigned long cr3) · 1466 unmodified lines
14671467 __xen_write_cr3(true, cr3);
14681468
14691469 xen_mc_issue(PARAVIRT_LAZY_CPU); /* interrupts restored */
1470−
1471− pv_mmu_ops.write_cr3 = &xen_write_cr3;
14721470 }
14731471 #endif
14741472
@@ -1750,14 +1748,18 @@ static void *m2v(phys_addr_t maddr) · 275 unmodified lines
17501748 }
17511749
17521750 /* Set the page permissions on an identity-mapped pages */
1753−static void set_page_prot(void *addr, pgprot_t prot)
1751+static void set_page_prot_flags(void *addr, pgprot_t prot, unsigned long flags)
17541752 {
17551753 unsigned long pfn = __pa(addr) >> PAGE_SHIFT;
17561754 pte_t pte = pfn_pte(pfn, prot);
17571755
1758− if (HYPERVISOR_update_va_mapping((unsigned long)addr, pte, 0))
1756+ if (HYPERVISOR_update_va_mapping((unsigned long)addr, pte, flags))
17591757 BUG();
17601758 }
1759+static void set_page_prot(void *addr, pgprot_t prot)
1760+{
1761+ return set_page_prot_flags(addr, prot, UVMF_NONE);
1762+}
17611763 #ifdef CONFIG_X86_32
17621764 static void __init xen_map_identity_early(pmd_t *pmd, unsigned long max_pfn)
17631765 {
@@ -1841,12 +1843,12 @@ static void __init check_pt_base(unsigned long *pt_base, unsigned long *pt_end, · 77 unmodified lines
18411843 unsigned long addr)
18421844 {
18431845 if (*pt_base == PFN_DOWN(__pa(addr))) {
1844− set_page_prot((void *)addr, PAGE_KERNEL);
1846+ set_page_prot_flags((void *)addr, PAGE_KERNEL, UVMF_INVLPG);
18451847 clear_page((void *)addr);
18461848 (*pt_base)++;
18471849 }
18481850 if (*pt_end == PFN_DOWN(__pa(addr))) {
1849− set_page_prot((void *)addr, PAGE_KERNEL);
1851+ set_page_prot_flags((void *)addr, PAGE_KERNEL, UVMF_INVLPG);
18501852 clear_page((void *)addr);
18511853 (*pt_end)--;
18521854 }
@@ -2122,6 +2124,7 @@ static void __init xen_post_allocator_init(void) · 269 unmodified lines
21222124 #endif
21232125
21242126 #ifdef CONFIG_X86_64
2127+ pv_mmu_ops.write_cr3 = &xen_write_cr3;
21252128 SetPagePinned(virt_to_page(level3_user_vsyscall));
21262129 #endif
21272130 xen_mark_init_mm_pinned();
@@ -2197,6 +2200,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = { · 69 unmodified lines
21972200 .lazy_mode = {
21982201 .enter = paravirt_enter_lazy_mmu,
21992202 .leave = xen_leave_lazy_mmu,
2203+ .flush = paravirt_flush_lazy_mmu,
22002204 },
22012205
22022206 .set_fixmap = xen_set_fixmap,
arch/xtensa/Kconfig+1−1
@@ -9,7 +9,7 @@ config XTENSA · 8 unmodified lines
99 select HAVE_IDE
1010 select GENERIC_ATOMIC64
1111 select HAVE_GENERIC_HARDIRQS
12− select HAVE_VIRT_TO_BUS
12+ select VIRT_TO_BUS
1313 select GENERIC_IRQ_SHOW
1414 select GENERIC_CPU_DEVICES
1515 select MODULES_USE_ELF_RELA
block/blk-core.c+1−0
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939
4040 EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_remap);
4141 EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_remap);
42+EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_complete);
4243 EXPORT_TRACEPOINT_SYMBOL_GPL(block_unplug);
4344
4445 DEFINE_IDA(blk_queue_ida);
block/blk-flush.c+1−1
@@ -444,7 +444,7 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask, · 443 unmodified lines
444444 * copied from blk_rq_pos(rq).
445445 */
446446 if (error_sector)
447− *error_sector = bio->bi_sector;
447+ *error_sector = bio->bi_sector;
448448
449449 if (!bio_flagged(bio, BIO_UPTODATE))
450450 ret = -EIO;
block/blk-sysfs.c+2−0
@@ -229,6 +229,8 @@ queue_store_##name(struct request_queue *q, const char *page, size_t count) \ · 228 unmodified lines
229229 unsigned long val; \
230230 ssize_t ret; \
231231 ret = queue_var_store(&val, page, count); \
232+ if (ret < 0) \
233+ return ret; \
232234 if (neg) \
233235 val = !val; \
234236 \
crypto/gcm.c+14−3
@@ -44,6 +44,7 @@ struct crypto_rfc4543_ctx { · 43 unmodified lines
4444
4545 struct crypto_rfc4543_req_ctx {
4646 u8 auth_tag[16];
47+ u8 assocbuf[32];
4748 struct scatterlist cipher[1];
4849 struct scatterlist payload[2];
4950 struct scatterlist assoc[2];
@@ -1133,9 +1134,19 @@ static struct aead_request *crypto_rfc4543_crypt(struct aead_request *req, · 1083 unmodified lines
11331134 scatterwalk_crypto_chain(payload, dst, vdst == req->iv + 8, 2);
11341135 assoclen += 8 + req->cryptlen - (enc ? 0 : authsize);
11351136
1136− sg_init_table(assoc, 2);
1137− sg_set_page(assoc, sg_page(req->assoc), req->assoc->length,
1138− req->assoc->offset);
1137+ if (req->assoc->length == req->assoclen) {
1138+ sg_init_table(assoc, 2);
1139+ sg_set_page(assoc, sg_page(req->assoc), req->assoc->length,
1140+ req->assoc->offset);
1141+ } else {
1142+ BUG_ON(req->assoclen > sizeof(rctx->assocbuf));
1143+
1144+ scatterwalk_map_and_copy(rctx->assocbuf, req->assoc, 0,
1145+ req->assoclen, 0);
1146+
1147+ sg_init_table(assoc, 2);
1148+ sg_set_buf(assoc, rctx->assocbuf, req->assoclen);
1149+ }
11391150 scatterwalk_crypto_chain(assoc, payload, 0, 2);
11401151
11411152 aead_request_set_tfm(subreq, ctx->child);
drivers/acpi/Kconfig+1−1
@@ -396,7 +396,7 @@ config ACPI_CUSTOM_METHOD · 395 unmodified lines
396396
397397 config ACPI_BGRT
398398 bool "Boottime Graphics Resource Table support"
399− depends on EFI
399+ depends on EFI && X86
400400 help
401401 This driver adds support for exposing the ACPI Boottime Graphics
402402 Resource Table, which allows the operating system to obtain
drivers/acpi/acpi_i2c.c+1−1
@@ -90,7 +90,7 @@ void acpi_i2c_register_devices(struct i2c_adapter *adapter) · 89 unmodified lines
9090 acpi_handle handle;
9191 acpi_status status;
9292
93− handle = ACPI_HANDLE(&adapter->dev);
93+ handle = ACPI_HANDLE(adapter->dev.parent);
9494 if (!handle)
9595 return;
9696
drivers/acpi/apei/cper.c+1−1
@@ -405,7 +405,7 @@ int apei_estatus_check(const struct acpi_hest_generic_status *estatus) · 404 unmodified lines
405405 return rc;
406406 data_len = estatus->data_length;
407407 gdata = (struct acpi_hest_generic_data *)(estatus + 1);
408− while (data_len > sizeof(*gdata)) {
408+ while (data_len >= sizeof(*gdata)) {
409409 gedata_len = gdata->error_data_length;
410410 if (gedata_len > data_len - sizeof(*gdata))
411411 return -EINVAL;
drivers/acpi/pci_root.c+44−41
@@ -415,7 +415,6 @@ static int acpi_pci_root_add(struct acpi_device *device, · 414 unmodified lines
415415 struct acpi_pci_root *root;
416416 struct acpi_pci_driver *driver;
417417 u32 flags, base_flags;
418− bool is_osc_granted = false;
419418
420419 root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL);
421420 if (!root)
@@ -476,6 +475,30 @@ static int acpi_pci_root_add(struct acpi_device *device, · 54 unmodified lines
476475 flags = base_flags = OSC_PCI_SEGMENT_GROUPS_SUPPORT;
477476 acpi_pci_osc_support(root, flags);
478477
478+ /*
479+ * TBD: Need PCI interface for enumeration/configuration of roots.
480+ */
481+
482+ mutex_lock(&acpi_pci_root_lock);
483+ list_add_tail(&root->node, &acpi_pci_roots);
484+ mutex_unlock(&acpi_pci_root_lock);
485+
486+ /*
487+ * Scan the Root Bridge
488+ * --------------------
489+ * Must do this prior to any attempt to bind the root device, as the
490+ * PCI namespace does not get created until this call is made (and
491+ * thus the root bridge's pci_dev does not exist).
492+ */
493+ root->bus = pci_acpi_scan_root(root);
494+ if (!root->bus) {
495+ printk(KERN_ERR PREFIX
496+ "Bus %04x:%02x not present in PCI namespace\n",
497+ root->segment, (unsigned int)root->secondary.start);
498+ result = -ENODEV;
499+ goto out_del_root;
500+ }
501+
479502 /* Indicate support for various _OSC capabilities. */
480503 if (pci_ext_cfg_avail())
481504 flags |= OSC_EXT_PCI_CONFIG_SUPPORT;
@@ -494,6 +517,7 @@ static int acpi_pci_root_add(struct acpi_device *device, · 12 unmodified lines
494517 flags = base_flags;
495518 }
496519 }
520+
497521 if (!pcie_ports_disabled
498522 && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) {
499523 flags = OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL
@@ -514,54 +538,28 @@ static int acpi_pci_root_add(struct acpi_device *device, · 14 unmodified lines
514538 status = acpi_pci_osc_control_set(device->handle, &flags,
515539 OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL);
516540 if (ACPI_SUCCESS(status)) {
517− is_osc_granted = true;
518541 dev_info(&device->dev,
519542 "ACPI _OSC control (0x%02x) granted\n", flags);
543+ if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) {
544+ /*
545+ * We have ASPM control, but the FADT indicates
546+ * that it's unsupported. Clear it.
547+ */
548+ pcie_clear_aspm(root->bus);
549+ }
520550 } else {
521− is_osc_granted = false;
522551 dev_info(&device->dev,
523552 "ACPI _OSC request failed (%s), "
524553 "returned control mask: 0x%02x\n",
525554 acpi_format_exception(status), flags);
555+ pr_info("ACPI _OSC control for PCIe not granted, "
556+ "disabling ASPM\n");
557+ pcie_no_aspm();
526558 }
527559 } else {
528560 dev_info(&device->dev,
529− "Unable to request _OSC control "
530− "(_OSC support mask: 0x%02x)\n", flags);
531− }
532−
533− /*
534− * TBD: Need PCI interface for enumeration/configuration of roots.
535− */
536−
537− mutex_lock(&acpi_pci_root_lock);
538− list_add_tail(&root->node, &acpi_pci_roots);
539− mutex_unlock(&acpi_pci_root_lock);
540−
541− /*
542− * Scan the Root Bridge
543− * --------------------
544− * Must do this prior to any attempt to bind the root device, as the
545− * PCI namespace does not get created until this call is made (and
546− * thus the root bridge's pci_dev does not exist).
547− */
548− root->bus = pci_acpi_scan_root(root);
549− if (!root->bus) {
550− printk(KERN_ERR PREFIX
551− "Bus %04x:%02x not present in PCI namespace\n",
552− root->segment, (unsigned int)root->secondary.start);
553− result = -ENODEV;
554− goto out_del_root;
555− }
556−
557− /* ASPM setting */
558− if (is_osc_granted) {
559− if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM)
560− pcie_clear_aspm(root->bus);
561− } else {
562− pr_info("ACPI _OSC control for PCIe not granted, "
563− "disabling ASPM\n");
564− pcie_no_aspm();
561+ "Unable to request _OSC control "
562+ "(_OSC support mask: 0x%02x)\n", flags);
565563 }
566564
567565 pci_acpi_add_bus_pm_notifier(device, root->bus);
@@ -646,6 +644,7 @@ static void handle_root_bridge_insertion(acpi_handle handle) · 78 unmodified lines
646644
647645 static void handle_root_bridge_removal(struct acpi_device *device)
648646 {
647+ acpi_status status;
649648 struct acpi_eject_event *ej_event;
650649
651650 ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL);
@@ -661,7 +660,9 @@ static void handle_root_bridge_removal(struct acpi_device *device) · 9 unmodified lines
661660 ej_event->device = device;
662661 ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
663662
664− acpi_bus_hot_remove_device(ej_event);
663+ status = acpi_os_hotplug_execute(acpi_bus_hot_remove_device, ej_event);
664+ if (ACPI_FAILURE(status))
665+ kfree(ej_event);
665666 }
666667
667668 static void _handle_hotplug_event_root(struct work_struct *work)
@@ -676,8 +677,9 @@ static void _handle_hotplug_event_root(struct work_struct *work) · 8 unmodified lines
676677 handle = hp_work->handle;
677678 type = hp_work->type;
678679
679− root = acpi_pci_find_root(handle);
680+ acpi_scan_lock_acquire();
680681
682+ root = acpi_pci_find_root(handle);
681683 acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
682684
683685 switch (type) {
@@ -711,6 +713,7 @@ static void _handle_hotplug_event_root(struct work_struct *work) · 27 unmodified lines
711713 break;
712714 }
713715
716+ acpi_scan_lock_release();
714717 kfree(hp_work); /* allocated in handle_hotplug_event_bridge */
715718 kfree(buffer.pointer);
716719 }
drivers/acpi/processor_idle.c+7−6
@@ -66,7 +66,8 @@ module_param(latency_factor, uint, 0644); · 65 unmodified lines
6666
6767 static DEFINE_PER_CPU(struct cpuidle_device *, acpi_cpuidle_device);
6868
69−static struct acpi_processor_cx *acpi_cstate[CPUIDLE_STATE_MAX];
69+static DEFINE_PER_CPU(struct acpi_processor_cx * [CPUIDLE_STATE_MAX],
70+ acpi_cstate);
7071
7172 static int disabled_by_idle_boot_param(void)
7273 {
@@ -722,7 +723,7 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, · 649 unmodified lines
722723 struct cpuidle_driver *drv, int index)
723724 {
724725 struct acpi_processor *pr;
725− struct acpi_processor_cx *cx = acpi_cstate[index];
726+ struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
726727
727728 pr = __this_cpu_read(processors);
728729
@@ -745,7 +746,7 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, · 16 unmodified lines
745746 */
746747 static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
747748 {
748− struct acpi_processor_cx *cx = acpi_cstate[index];
749+ struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
749750
750751 ACPI_FLUSH_CPU_CACHE();
751752
@@ -775,7 +776,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, · 23 unmodified lines
775776 struct cpuidle_driver *drv, int index)
776777 {
777778 struct acpi_processor *pr;
778− struct acpi_processor_cx *cx = acpi_cstate[index];
779+ struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
779780
780781 pr = __this_cpu_read(processors);
781782
@@ -833,7 +834,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, · 51 unmodified lines
833834 struct cpuidle_driver *drv, int index)
834835 {
835836 struct acpi_processor *pr;
836− struct acpi_processor_cx *cx = acpi_cstate[index];
837+ struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
837838
838839 pr = __this_cpu_read(processors);
839840
@@ -960,7 +961,7 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr, · 120 unmodified lines
960961 !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED))
961962 continue;
962963 #endif
963− acpi_cstate[count] = cx;
964+ per_cpu(acpi_cstate[count], dev->cpu) = cx;
964965
965966 count++;
966967 if (count == CPUIDLE_STATE_MAX)
drivers/acpi/processor_perflib.c+2−2
@@ -465,7 +465,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr) · 464 unmodified lines
465465 return result;
466466 }
467467
468−static int acpi_processor_get_performance_info(struct acpi_processor *pr)
468+int acpi_processor_get_performance_info(struct acpi_processor *pr)
469469 {
470470 int result = 0;
471471 acpi_status status = AE_OK;
@@ -509,7 +509,7 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr) · 37 unmodified lines
509509 #endif
510510 return result;
511511 }
512−
512+EXPORT_SYMBOL_GPL(acpi_processor_get_performance_info);
513513 int acpi_processor_notify_smm(struct module *calling_module)
514514 {
515515 acpi_status status;
drivers/acpi/sleep.c+8−0
@@ -193,6 +193,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { · 192 unmodified lines
193193 },
194194 {
195195 .callback = init_nvs_nosave,
196+ .ident = "Sony Vaio VGN-FW21M",
197+ .matches = {
198+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
199+ DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW21M"),
200+ },
201+ },
202+ {
203+ .callback = init_nvs_nosave,
196204 .ident = "Sony Vaio VPCEB17FX",
197205 .matches = {
198206 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
drivers/amba/tegra-ahb.c+1−1
@@ -158,7 +158,7 @@ int tegra_ahb_enable_smmu(struct device_node *dn) · 157 unmodified lines
158158 EXPORT_SYMBOL(tegra_ahb_enable_smmu);
159159 #endif
160160
161−#ifdef CONFIG_PM_SLEEP
161+#ifdef CONFIG_PM
162162 static int tegra_ahb_suspend(struct device *dev)
163163 {
164164 int i;
drivers/ata/Kconfig+7−6
@@ -59,15 +59,16 @@ config ATA_ACPI · 58 unmodified lines
5959 option libata.noacpi=1
6060
6161 config SATA_ZPODD
62− bool "SATA Zero Power ODD Support"
62+ bool "SATA Zero Power Optical Disc Drive (ZPODD) support"
6363 depends on ATA_ACPI
6464 default n
6565 help
66− This option adds support for SATA ZPODD. It requires both
67− ODD and the platform support, and if enabled, will automatically
68− power on/off the ODD when certain condition is satisfied. This
69− does not impact user's experience of the ODD, only power is saved
70− when ODD is not in use(i.e. no disc inside).
66+ This option adds support for SATA Zero Power Optical Disc
67+ Drive (ZPODD). It requires both the ODD and the platform
68+ support, and if enabled, will automatically power on/off the
69+ ODD when certain condition is satisfied. This does not impact
70+ end user's experience of the ODD, only power is saved when
71+ the ODD is not in use (i.e. no disc inside).
7172
7273 If unsure, say N.
7374
drivers/ata/ahci.c+2−0
@@ -281,6 +281,8 @@ static const struct pci_device_id ahci_pci_tbl[] = { · 280 unmodified lines
281281 { PCI_VDEVICE(INTEL, 0x1f37), board_ahci }, /* Avoton RAID */
282282 { PCI_VDEVICE(INTEL, 0x1f3e), board_ahci }, /* Avoton RAID */
283283 { PCI_VDEVICE(INTEL, 0x1f3f), board_ahci }, /* Avoton RAID */
284+ { PCI_VDEVICE(INTEL, 0x2823), board_ahci }, /* Wellsburg RAID */
285+ { PCI_VDEVICE(INTEL, 0x2827), board_ahci }, /* Wellsburg RAID */
284286 { PCI_VDEVICE(INTEL, 0x8d02), board_ahci }, /* Wellsburg AHCI */
285287 { PCI_VDEVICE(INTEL, 0x8d04), board_ahci }, /* Wellsburg RAID */
286288 { PCI_VDEVICE(INTEL, 0x8d06), board_ahci }, /* Wellsburg RAID */
drivers/ata/ata_piix.c+17−1
@@ -150,6 +150,7 @@ enum piix_controller_ids { · 149 unmodified lines
150150 tolapai_sata,
151151 piix_pata_vmw, /* PIIX4 for VMware, spurious DMA_ERR */
152152 ich8_sata_snb,
153+ ich8_2port_sata_snb,
153154 };
154155
155156 struct piix_map_db {
@@ -304,7 +305,7 @@ static const struct pci_device_id piix_pci_tbl[] = { · 148 unmodified lines
304305 /* SATA Controller IDE (Lynx Point) */
305306 { 0x8086, 0x8c01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb },
306307 /* SATA Controller IDE (Lynx Point) */
307− { 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
308+ { 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_snb },
308309 /* SATA Controller IDE (Lynx Point) */
309310 { 0x8086, 0x8c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
310311 /* SATA Controller IDE (Lynx Point-LP) */
@@ -439,6 +440,7 @@ static const struct piix_map_db *piix_map_db_table[] = { · 128 unmodified lines
439440 [ich8m_apple_sata] = &ich8m_apple_map_db,
440441 [tolapai_sata] = &tolapai_map_db,
441442 [ich8_sata_snb] = &ich8_map_db,
443+ [ich8_2port_sata_snb] = &ich8_2port_map_db,
442444 };
443445
444446 static struct pci_bits piix_enable_bits[] = {
@@ -1242,6 +1244,16 @@ static struct ata_port_info piix_port_info[] = { · 797 unmodified lines
12421244 .udma_mask = ATA_UDMA6,
12431245 .port_ops = &piix_sata_ops,
12441246 },
1247+
1248+ [ich8_2port_sata_snb] =
1249+ {
1250+ .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR
1251+ | PIIX_FLAG_PIO16,
1252+ .pio_mask = ATA_PIO4,
1253+ .mwdma_mask = ATA_MWDMA2,
1254+ .udma_mask = ATA_UDMA6,
1255+ .port_ops = &piix_sata_ops,
1256+ },
12451257 };
12461258
12471259 #define AHCI_PCI_BAR 5
@@ -1547,6 +1559,10 @@ static bool piix_broken_system_poweroff(struct pci_dev *pdev) · 299 unmodified lines
15471559
15481560 static int prefer_ms_hyperv = 1;
15491561 module_param(prefer_ms_hyperv, int, 0);
1562+MODULE_PARM_DESC(prefer_ms_hyperv,
1563+ "Prefer Hyper-V paravirtualization drivers instead of ATA, "
1564+ "0 - Use ATA drivers, "
1565+ "1 (Default) - Use the paravirtualization drivers.");
15501566
15511567 static void piix_ignore_devices_quirk(struct ata_host *host)
15521568 {
drivers/ata/libata-acpi.c+1−1
@@ -1027,7 +1027,7 @@ static void ata_acpi_register_power_resource(struct ata_device *dev) · 1026 unmodified lines
10271027
10281028 handle = ata_dev_acpi_handle(dev);
10291029 if (handle)
1030− acpi_dev_pm_remove_dependent(handle, &sdev->sdev_gendev);
1030+ acpi_dev_pm_add_dependent(handle, &sdev->sdev_gendev);
10311031 }
10321032
10331033 static void ata_acpi_unregister_power_resource(struct ata_device *dev)
drivers/ata/libata-core.c+5−1
@@ -2329,7 +2329,7 @@ int ata_dev_configure(struct ata_device *dev) · 2328 unmodified lines
23292329 * from SATA Settings page of Identify Device Data Log.
23302330 */
23312331 if (ata_id_has_devslp(dev->id)) {
2332− u8 sata_setting[ATA_SECT_SIZE];
2332+ u8 *sata_setting = ap->sector_buf;
23332333 int i, j;
23342334
23352335 dev->flags |= ATA_DFLAG_DEVSLP;
@@ -2439,6 +2439,9 @@ int ata_dev_configure(struct ata_device *dev) · 103 unmodified lines
24392439 dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128,
24402440 dev->max_sectors);
24412441
2442+ if (dev->horkage & ATA_HORKAGE_MAX_SEC_LBA48)
2443+ dev->max_sectors = ATA_MAX_SECTORS_LBA48;
2444+
24422445 if (ap->ops->dev_config)
24432446 ap->ops->dev_config(dev);
24442447
@@ -4100,6 +4103,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { · 1655 unmodified lines
41004103 /* Weird ATAPI devices */
41014104 { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 },
41024105 { "QUANTUM DAT DAT72-000", NULL, ATA_HORKAGE_ATAPI_MOD16_DMA },
4106+ { "Slimtype DVD A DS8A8SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 },
41034107
41044108 /* Devices we expect to fail diagnostics */
41054109
drivers/ata/libata-scsi.c+4−4
@@ -532,8 +532,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg) · 531 unmodified lines
532532 struct scsi_sense_hdr sshdr;
533533 scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE,
534534 &sshdr);
535− if (sshdr.sense_key == 0 &&
536− sshdr.asc == 0 && sshdr.ascq == 0)
535+ if (sshdr.sense_key == RECOVERED_ERROR &&
536+ sshdr.asc == 0 && sshdr.ascq == 0x1d)
537537 cmd_result &= ~SAM_STAT_CHECK_CONDITION;
538538 }
539539
@@ -618,8 +618,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) · 78 unmodified lines
618618 struct scsi_sense_hdr sshdr;
619619 scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE,
620620 &sshdr);
621− if (sshdr.sense_key == 0 &&
622− sshdr.asc == 0 && sshdr.ascq == 0)
621+ if (sshdr.sense_key == RECOVERED_ERROR &&
622+ sshdr.asc == 0 && sshdr.ascq == 0x1d)
623623 cmd_result &= ~SAM_STAT_CHECK_CONDITION;
624624 }
625625
drivers/ata/pata_samsung_cf.c+1−12
@@ -661,18 +661,7 @@ static struct platform_driver pata_s3c_driver = { · 660 unmodified lines
661661 },
662662 };
663663
664−static int __init pata_s3c_init(void)
665−{
666− return platform_driver_probe(&pata_s3c_driver, pata_s3c_probe);
667−}
668−
669−static void __exit pata_s3c_exit(void)
670−{
671− platform_driver_unregister(&pata_s3c_driver);
672−}
673−
674−module_init(pata_s3c_init);
675−module_exit(pata_s3c_exit);
664+module_platform_driver_probe(pata_s3c_driver, pata_s3c_probe);
676665
677666 MODULE_AUTHOR("Abhilash Kesavan, <a.kesavan@samsung.com>");
678667 MODULE_DESCRIPTION("low-level driver for Samsung PATA controller");
drivers/ata/sata_fsl.c+1−2
@@ -1511,8 +1511,7 @@ error_exit_with_cleanup: · 1510 unmodified lines
15111511
15121512 if (hcr_base)
15131513 iounmap(hcr_base);
1514− if (host_priv)
1515− kfree(host_priv);
1514+ kfree(host_priv);
15161515
15171516 return retval;
15181517 }
drivers/base/power/qos.c+47−13
@@ -46,6 +46,7 @@ · 45 unmodified lines
4646 #include "power.h"
4747
4848 static DEFINE_MUTEX(dev_pm_qos_mtx);
49+static DEFINE_MUTEX(dev_pm_qos_sysfs_mtx);
4950
5051 static BLOCKING_NOTIFIER_HEAD(dev_pm_notifiers);
5152
@@ -216,12 +217,17 @@ void dev_pm_qos_constraints_destroy(struct device *dev) · 164 unmodified lines
216217 struct pm_qos_constraints *c;
217218 struct pm_qos_flags *f;
218219
219− mutex_lock(&dev_pm_qos_mtx);
220+ mutex_lock(&dev_pm_qos_sysfs_mtx);
220221
221222 /*
222223 * If the device's PM QoS resume latency limit or PM QoS flags have been
223224 * exposed to user space, they have to be hidden at this point.
224225 */
226+ pm_qos_sysfs_remove_latency(dev);
227+ pm_qos_sysfs_remove_flags(dev);
228+
229+ mutex_lock(&dev_pm_qos_mtx);
230+
225231 __dev_pm_qos_hide_latency_limit(dev);
226232 __dev_pm_qos_hide_flags(dev);
227233
@@ -254,6 +260,8 @@ void dev_pm_qos_constraints_destroy(struct device *dev) · 26 unmodified lines
254260
255261 out:
256262 mutex_unlock(&dev_pm_qos_mtx);
263+
264+ mutex_unlock(&dev_pm_qos_sysfs_mtx);
257265 }
258266
259267 /**
@@ -558,6 +566,14 @@ static void __dev_pm_qos_drop_user_request(struct device *dev, · 298 unmodified lines
558566 kfree(req);
559567 }
560568
569+static void dev_pm_qos_drop_user_request(struct device *dev,
570+ enum dev_pm_qos_req_type type)
571+{
572+ mutex_lock(&dev_pm_qos_mtx);
573+ __dev_pm_qos_drop_user_request(dev, type);
574+ mutex_unlock(&dev_pm_qos_mtx);
575+}
576+
561577 /**
562578 * dev_pm_qos_expose_latency_limit - Expose PM QoS latency limit to user space.
563579 * @dev: Device whose PM QoS latency limit is to be exposed to user space.
@@ -581,6 +597,8 @@ int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value) · 17 unmodified lines
581597 return ret;
582598 }
583599
600+ mutex_lock(&dev_pm_qos_sysfs_mtx);
601+
584602 mutex_lock(&dev_pm_qos_mtx);
585603
586604 if (IS_ERR_OR_NULL(dev->power.qos))
@@ -591,26 +609,27 @@ int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value) · 4 unmodified lines
591609 if (ret < 0) {
592610 __dev_pm_qos_remove_request(req);
593611 kfree(req);
612+ mutex_unlock(&dev_pm_qos_mtx);
594613 goto out;
595614 }
596−
597615 dev->power.qos->latency_req = req;
616+
617+ mutex_unlock(&dev_pm_qos_mtx);
618+
598619 ret = pm_qos_sysfs_add_latency(dev);
599620 if (ret)
600− __dev_pm_qos_drop_user_request(dev, DEV_PM_QOS_LATENCY);
621+ dev_pm_qos_drop_user_request(dev, DEV_PM_QOS_LATENCY);
601622
602623 out:
603− mutex_unlock(&dev_pm_qos_mtx);
624+ mutex_unlock(&dev_pm_qos_sysfs_mtx);
604625 return ret;
605626 }
606627 EXPORT_SYMBOL_GPL(dev_pm_qos_expose_latency_limit);
607628
608629 static void __dev_pm_qos_hide_latency_limit(struct device *dev)
609630 {
610− if (!IS_ERR_OR_NULL(dev->power.qos) && dev->power.qos->latency_req) {
611− pm_qos_sysfs_remove_latency(dev);
631+ if (!IS_ERR_OR_NULL(dev->power.qos) && dev->power.qos->latency_req)
612632 __dev_pm_qos_drop_user_request(dev, DEV_PM_QOS_LATENCY);
613− }
614633 }
615634
616635 /**
@@ -619,9 +638,15 @@ static void __dev_pm_qos_hide_latency_limit(struct device *dev) · 2 unmodified lines
619638 */
620639 void dev_pm_qos_hide_latency_limit(struct device *dev)
621640 {
641+ mutex_lock(&dev_pm_qos_sysfs_mtx);
642+
643+ pm_qos_sysfs_remove_latency(dev);
644+
622645 mutex_lock(&dev_pm_qos_mtx);
623646 __dev_pm_qos_hide_latency_limit(dev);
624647 mutex_unlock(&dev_pm_qos_mtx);
648+
649+ mutex_unlock(&dev_pm_qos_sysfs_mtx);
625650 }
626651 EXPORT_SYMBOL_GPL(dev_pm_qos_hide_latency_limit);
627652
@@ -649,6 +674,8 @@ int dev_pm_qos_expose_flags(struct device *dev, s32 val) · 21 unmodified lines
649674 }
650675
651676 pm_runtime_get_sync(dev);
677+ mutex_lock(&dev_pm_qos_sysfs_mtx);
678+
652679 mutex_lock(&dev_pm_qos_mtx);
653680
654681 if (IS_ERR_OR_NULL(dev->power.qos))
@@ -659,16 +686,19 @@ int dev_pm_qos_expose_flags(struct device *dev, s32 val) · 4 unmodified lines
659686 if (ret < 0) {
660687 __dev_pm_qos_remove_request(req);
661688 kfree(req);
689+ mutex_unlock(&dev_pm_qos_mtx);
662690 goto out;
663691 }
664−
665692 dev->power.qos->flags_req = req;
693+
694+ mutex_unlock(&dev_pm_qos_mtx);
695+
666696 ret = pm_qos_sysfs_add_flags(dev);
667697 if (ret)
668− __dev_pm_qos_drop_user_request(dev, DEV_PM_QOS_FLAGS);
698+ dev_pm_qos_drop_user_request(dev, DEV_PM_QOS_FLAGS);
669699
670700 out:
671− mutex_unlock(&dev_pm_qos_mtx);
701+ mutex_unlock(&dev_pm_qos_sysfs_mtx);
672702 pm_runtime_put(dev);
673703 return ret;
674704 }
@@ -676,10 +706,8 @@ EXPORT_SYMBOL_GPL(dev_pm_qos_expose_flags); · 1 unmodified line
676706
677707 static void __dev_pm_qos_hide_flags(struct device *dev)
678708 {
679− if (!IS_ERR_OR_NULL(dev->power.qos) && dev->power.qos->flags_req) {
680− pm_qos_sysfs_remove_flags(dev);
709+ if (!IS_ERR_OR_NULL(dev->power.qos) && dev->power.qos->flags_req)
681710 __dev_pm_qos_drop_user_request(dev, DEV_PM_QOS_FLAGS);
682− }
683711 }
684712
685713 /**
@@ -689,9 +717,15 @@ static void __dev_pm_qos_hide_flags(struct device *dev) · 3 unmodified lines
689717 void dev_pm_qos_hide_flags(struct device *dev)
690718 {
691719 pm_runtime_get_sync(dev);
720+ mutex_lock(&dev_pm_qos_sysfs_mtx);
721+
722+ pm_qos_sysfs_remove_flags(dev);
723+
692724 mutex_lock(&dev_pm_qos_mtx);
693725 __dev_pm_qos_hide_flags(dev);
694726 mutex_unlock(&dev_pm_qos_mtx);
727+
728+ mutex_unlock(&dev_pm_qos_sysfs_mtx);
695729 pm_runtime_put(dev);
696730 }
697731 EXPORT_SYMBOL_GPL(dev_pm_qos_hide_flags);
drivers/base/regmap/regcache-rbtree.c+1−1
@@ -398,7 +398,7 @@ static int regcache_rbtree_sync(struct regmap *map, unsigned int min, · 397 unmodified lines
398398 base = 0;
399399
400400 if (max < rbnode->base_reg + rbnode->blklen)
401− end = rbnode->base_reg + rbnode->blklen - max;
401+ end = max - rbnode->base_reg + 1;
402402 else
403403 end = rbnode->blklen;
404404
drivers/base/regmap/regmap.c+4−2
@@ -710,12 +710,12 @@ skip_format_initialization: · 709 unmodified lines
710710 }
711711 }
712712
713+ regmap_debugfs_init(map, config->name);
714+
713715 ret = regcache_init(map, config);
714716 if (ret != 0)
715717 goto err_range;
716718
717− regmap_debugfs_init(map, config->name);
718−
719719 /* Add a devres resource for dev_get_regmap() */
720720 m = devres_alloc(dev_get_regmap_release, sizeof(*m), GFP_KERNEL);
721721 if (!m) {
@@ -1036,6 +1036,8 @@ static int _regmap_raw_write(struct regmap *map, unsigned int reg, · 314 unmodified lines
10361036 kfree(async->work_buf);
10371037 kfree(async);
10381038 }
1039+
1040+ return ret;
10391041 }
10401042
10411043 trace_regmap_hw_write_start(map->dev, reg,
drivers/block/Kconfig+2−2
@@ -532,11 +532,11 @@ config BLK_DEV_RBD · 531 unmodified lines
532532 If unsure, say N.
533533
534534 config BLK_DEV_RSXX
535− tristate "RamSam PCIe Flash SSD Device Driver"
535+ tristate "IBM FlashSystem 70/80 PCIe SSD Device Driver"
536536 depends on PCI
537537 help
538538 Device driver for IBM's high speed PCIe SSD
539− storage devices: RamSan-70 and RamSan-80.
539+ storage devices: FlashSystem-70 and FlashSystem-80.
540540
541541 To compile this driver as a module, choose M here: the
542542 module will be called rsxx.
drivers/block/aoe/aoecmd.c+2−1
@@ -51,8 +51,9 @@ new_skb(ulong len) · 50 unmodified lines
5151 {
5252 struct sk_buff *skb;
5353
54− skb = alloc_skb(len, GFP_ATOMIC);
54+ skb = alloc_skb(len + MAX_HEADER, GFP_ATOMIC);
5555 if (skb) {
56+ skb_reserve(skb, MAX_HEADER);
5657 skb_reset_mac_header(skb);
5758 skb_reset_network_header(skb);
5859 skb->protocol = __constant_htons(ETH_P_AOE);
drivers/block/cciss.c+1−1
@@ -4206,7 +4206,7 @@ static int cciss_find_cfgtables(ctlr_info_t *h) · 4205 unmodified lines
42064206 if (rc)
42074207 return rc;
42084208 h->cfgtable = remap_pci_mem(pci_resource_start(h->pdev,
4209− cfg_base_addr_index) + cfg_offset, sizeof(h->cfgtable));
4209+ cfg_base_addr_index) + cfg_offset, sizeof(*h->cfgtable));
42104210 if (!h->cfgtable)
42114211 return -ENOMEM;
42124212 rc = write_driver_ver_to_cfgtable(h->cfgtable);
drivers/block/loop.c+9−1
@@ -922,6 +922,11 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode, · 921 unmodified lines
922922 lo->lo_flags |= LO_FLAGS_PARTSCAN;
923923 if (lo->lo_flags & LO_FLAGS_PARTSCAN)
924924 ioctl_by_bdev(bdev, BLKRRPART, 0);
925+
926+ /* Grab the block_device to prevent its destruction after we
927+ * put /dev/loopXX inode. Later in loop_clr_fd() we bdput(bdev).
928+ */
929+ bdgrab(bdev);
925930 return 0;
926931
927932 out_clr:
@@ -1031,8 +1036,10 @@ static int loop_clr_fd(struct loop_device *lo) · 103 unmodified lines
10311036 memset(lo->lo_encrypt_key, 0, LO_KEY_SIZE);
10321037 memset(lo->lo_crypt_name, 0, LO_NAME_SIZE);
10331038 memset(lo->lo_file_name, 0, LO_NAME_SIZE);
1034− if (bdev)
1039+ if (bdev) {
1040+ bdput(bdev);
10351041 invalidate_bdev(bdev);
1042+ }
10361043 set_capacity(lo->lo_disk, 0);
10371044 loop_sysfs_exit(lo);
10381045 if (bdev) {
@@ -1623,6 +1630,7 @@ static int loop_add(struct loop_device **l, int i) · 584 unmodified lines
16231630 goto out_free_dev;
16241631 i = err;
16251632
1633+ err = -ENOMEM;
16261634 lo->lo_queue = blk_alloc_queue(GFP_KERNEL);
16271635 if (!lo->lo_queue)
16281636 goto out_free_dev;
drivers/block/mg_disk.c+3−1
@@ -890,8 +890,10 @@ static int mg_probe(struct platform_device *plat_dev) · 889 unmodified lines
890890 gpio_direction_output(host->rst, 1);
891891
892892 /* reset out pin */
893− if (!(prv_data->dev_attr & MG_DEV_MASK))
893+ if (!(prv_data->dev_attr & MG_DEV_MASK)) {
894+ err = -EINVAL;
894895 goto probe_err_3a;
896+ }
895897
896898 if (prv_data->dev_attr != MG_BOOT_DEV) {
897899 rsc = platform_get_resource_byname(plat_dev, IORESOURCE_IO,
drivers/block/mtip32xx/mtip32xx.c+235−96
@@ -81,12 +81,17 @@ · 80 unmodified lines
8181 /* Device instance number, incremented each time a device is probed. */
8282 static int instance;
8383
84+struct list_head online_list;
85+struct list_head removing_list;
86+spinlock_t dev_lock;
87+
8488 /*
8589 * Global variable used to hold the major block device number
8690 * allocated in mtip_init().
8791 */
8892 static int mtip_major;
8993 static struct dentry *dfs_parent;
94+static struct dentry *dfs_device_status;
9095
9196 static u32 cpu_use[NR_CPUS];
9297
@@ -243,40 +248,31 @@ static inline void release_slot(struct mtip_port *port, int tag) · 150 unmodified lines
243248 /*
244249 * Reset the HBA (without sleeping)
245250 *
246− * Just like hba_reset, except does not call sleep, so can be
247− * run from interrupt/tasklet context.
248− *
249251 * @dd Pointer to the driver data structure.
250252 *
251253 * return value
252254 * 0 The reset was successful.
253255 * -1 The HBA Reset bit did not clear.
254256 */
255−static int hba_reset_nosleep(struct driver_data *dd)
257+static int mtip_hba_reset(struct driver_data *dd)
256258 {
257259 unsigned long timeout;
258260
259− /* Chip quirk: quiesce any chip function */
260− mdelay(10);
261−
262261 /* Set the reset bit */
263262 writel(HOST_RESET, dd->mmio + HOST_CTL);
264263
265264 /* Flush */
266265 readl(dd->mmio + HOST_CTL);
267266
268− /*
269− * Wait 10ms then spin for up to 1 second
270− * waiting for reset acknowledgement
271− */
272− timeout = jiffies + msecs_to_jiffies(1000);
273− mdelay(10);
274− while ((readl(dd->mmio + HOST_CTL) & HOST_RESET)
275− && time_before(jiffies, timeout))
276− mdelay(1);
267+ /* Spin for up to 2 seconds, waiting for reset acknowledgement */
268+ timeout = jiffies + msecs_to_jiffies(2000);
269+ do {
270+ mdelay(10);
271+ if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag))
272+ return -1;
277273
278− if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag))
279− return -1;
274+ } while ((readl(dd->mmio + HOST_CTL) & HOST_RESET)
275+ && time_before(jiffies, timeout));
280276
281277 if (readl(dd->mmio + HOST_CTL) & HOST_RESET)
282278 return -1;
@@ -481,7 +477,7 @@ static void mtip_restart_port(struct mtip_port *port) · 198 unmodified lines
481477 dev_warn(&port->dd->pdev->dev,
482478 "PxCMD.CR not clear, escalating reset\n");
483479
484− if (hba_reset_nosleep(port->dd))
480+ if (mtip_hba_reset(port->dd))
485481 dev_err(&port->dd->pdev->dev,
486482 "HBA reset escalation failed.\n");
487483
@@ -527,6 +523,26 @@ static void mtip_restart_port(struct mtip_port *port) · 39 unmodified lines
527523
528524 }
529525
526+static int mtip_device_reset(struct driver_data *dd)
527+{
528+ int rv = 0;
529+
530+ if (mtip_check_surprise_removal(dd->pdev))
531+ return 0;
532+
533+ if (mtip_hba_reset(dd) < 0)
534+ rv = -EFAULT;
535+
536+ mdelay(1);
537+ mtip_init_port(dd->port);
538+ mtip_start_port(dd->port);
539+
540+ /* Enable interrupts on the HBA. */
541+ writel(readl(dd->mmio + HOST_CTL) | HOST_IRQ_EN,
542+ dd->mmio + HOST_CTL);
543+ return rv;
544+}
545+
530546 /*
531547 * Helper function for tag logging
532548 */
@@ -632,7 +648,7 @@ static void mtip_timeout_function(unsigned long int data) · 99 unmodified lines
632648 if (cmdto_cnt) {
633649 print_tags(port->dd, "timed out", tagaccum, cmdto_cnt);
634650 if (!test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags)) {
635− mtip_restart_port(port);
651+ mtip_device_reset(port->dd);
636652 wake_up_interruptible(&port->svc_wait);
637653 }
638654 clear_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags);
@@ -1283,11 +1299,11 @@ static int mtip_exec_internal_command(struct mtip_port *port, · 644 unmodified lines
12831299 int rv = 0, ready2go = 1;
12841300 struct mtip_cmd *int_cmd = &port->commands[MTIP_TAG_INTERNAL];
12851301 unsigned long to;
1302+ struct driver_data *dd = port->dd;
12861303
12871304 /* Make sure the buffer is 8 byte aligned. This is asic specific. */
12881305 if (buffer & 0x00000007) {
1289− dev_err(&port->dd->pdev->dev,
1290− "SG buffer is not 8 byte aligned\n");
1306+ dev_err(&dd->pdev->dev, "SG buffer is not 8 byte aligned\n");
12911307 return -EFAULT;
12921308 }
12931309
@@ -1300,23 +1316,21 @@ static int mtip_exec_internal_command(struct mtip_port *port, · 6 unmodified lines
13001316 mdelay(100);
13011317 } while (time_before(jiffies, to));
13021318 if (!ready2go) {
1303− dev_warn(&port->dd->pdev->dev,
1319+ dev_warn(&dd->pdev->dev,
13041320 "Internal cmd active. new cmd [%02X]\n", fis->command);
13051321 return -EBUSY;
13061322 }
13071323 set_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags);
13081324 port->ic_pause_timer = 0;
13091325
1310− if (fis->command == ATA_CMD_SEC_ERASE_UNIT)
1311− clear_bit(MTIP_PF_SE_ACTIVE_BIT, &port->flags);
1312− else if (fis->command == ATA_CMD_DOWNLOAD_MICRO)
1313− clear_bit(MTIP_PF_DM_ACTIVE_BIT, &port->flags);
1326+ clear_bit(MTIP_PF_SE_ACTIVE_BIT, &port->flags);
1327+ clear_bit(MTIP_PF_DM_ACTIVE_BIT, &port->flags);
13141328
13151329 if (atomic == GFP_KERNEL) {
13161330 if (fis->command != ATA_CMD_STANDBYNOW1) {
13171331 /* wait for io to complete if non atomic */
13181332 if (mtip_quiesce_io(port, 5000) < 0) {
1319− dev_warn(&port->dd->pdev->dev,
1333+ dev_warn(&dd->pdev->dev,
13201334 "Failed to quiesce IO\n");
13211335 release_slot(port, MTIP_TAG_INTERNAL);
13221336 clear_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags);
@@ -1361,58 +1375,84 @@ static int mtip_exec_internal_command(struct mtip_port *port, · 38 unmodified lines
13611375 /* Issue the command to the hardware */
13621376 mtip_issue_non_ncq_command(port, MTIP_TAG_INTERNAL);
13631377
1364− /* Poll if atomic, wait_for_completion otherwise */
13651378 if (atomic == GFP_KERNEL) {
13661379 /* Wait for the command to complete or timeout. */
1367− if (wait_for_completion_timeout(
1380+ if (wait_for_completion_interruptible_timeout(
13681381 &wait,
1369− msecs_to_jiffies(timeout)) == 0) {
1370− dev_err(&port->dd->pdev->dev,
1371− "Internal command did not complete [%d] "
1372− "within timeout of %lu ms\n",
1373− atomic, timeout);
1374− if (mtip_check_surprise_removal(port->dd->pdev) ||
1382+ msecs_to_jiffies(timeout)) <= 0) {
1383+ if (rv == -ERESTARTSYS) { /* interrupted */
1384+ dev_err(&dd->pdev->dev,
1385+ "Internal command [%02X] was interrupted after %lu ms\n",
1386+ fis->command, timeout);
1387+ rv = -EINTR;
1388+ goto exec_ic_exit;
1389+ } else if (rv == 0) /* timeout */
1390+ dev_err(&dd->pdev->dev,
1391+ "Internal command did not complete [%02X] within timeout of %lu ms\n",
1392+ fis->command, timeout);
1393+ else
1394+ dev_err(&dd->pdev->dev,
1395+ "Internal command [%02X] wait returned code [%d] after %lu ms - unhandled\n",
1396+ fis->command, rv, timeout);
1397+
1398+ if (mtip_check_surprise_removal(dd->pdev) ||
13751399 test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
1376− &port->dd->dd_flag)) {
1400+ &dd->dd_flag)) {
1401+ dev_err(&dd->pdev->dev,
1402+ "Internal command [%02X] wait returned due to SR\n",
1403+ fis->command);
13771404 rv = -ENXIO;
13781405 goto exec_ic_exit;
13791406 }
1407+ mtip_device_reset(dd); /* recover from timeout issue */
13801408 rv = -EAGAIN;
1409+ goto exec_ic_exit;
13811410 }
13821411 } else {
1412+ u32 hba_stat, port_stat;
1413+
13831414 /* Spin for <timeout> checking if command still outstanding */
13841415 timeout = jiffies + msecs_to_jiffies(timeout);
13851416 while ((readl(port->cmd_issue[MTIP_TAG_INTERNAL])
13861417 & (1 << MTIP_TAG_INTERNAL))
13871418 && time_before(jiffies, timeout)) {
1388− if (mtip_check_surprise_removal(port->dd->pdev)) {
1419+ if (mtip_check_surprise_removal(dd->pdev)) {
13891420 rv = -ENXIO;
13901421 goto exec_ic_exit;
13911422 }
13921423 if ((fis->command != ATA_CMD_STANDBYNOW1) &&
13931424 test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
1394− &port->dd->dd_flag)) {
1425+ &dd->dd_flag)) {
13951426 rv = -ENXIO;
13961427 goto exec_ic_exit;
13971428 }
1398− if (readl(port->mmio + PORT_IRQ_STAT) & PORT_IRQ_ERR) {
1399− atomic_inc(&int_cmd->active); /* error */
1400− break;
1429+ port_stat = readl(port->mmio + PORT_IRQ_STAT);
1430+ if (!port_stat)
1431+ continue;
1432+
1433+ if (port_stat & PORT_IRQ_ERR) {
1434+ dev_err(&dd->pdev->dev,
1435+ "Internal command [%02X] failed\n",
1436+ fis->command);
1437+ mtip_device_reset(dd);
1438+ rv = -EIO;
1439+ goto exec_ic_exit;
1440+ } else {
1441+ writel(port_stat, port->mmio + PORT_IRQ_STAT);
1442+ hba_stat = readl(dd->mmio + HOST_IRQ_STAT);
1443+ if (hba_stat)
1444+ writel(hba_stat,
1445+ dd->mmio + HOST_IRQ_STAT);
14011446 }
1447+ break;
14021448 }
14031449 }
14041450
1405− if (atomic_read(&int_cmd->active) > 1) {
1406− dev_err(&port->dd->pdev->dev,
1407− "Internal command [%02X] failed\n", fis->command);
1408− rv = -EIO;
1409− }
14101451 if (readl(port->cmd_issue[MTIP_TAG_INTERNAL])
14111452 & (1 << MTIP_TAG_INTERNAL)) {
14121453 rv = -ENXIO;
1413− if (!test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
1414− &port->dd->dd_flag)) {
1415− mtip_restart_port(port);
1454+ if (!test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag)) {
1455+ mtip_device_reset(dd);
14161456 rv = -EAGAIN;
14171457 }
14181458 }
@@ -1724,7 +1764,8 @@ static int mtip_get_smart_attr(struct mtip_port *port, unsigned int id, · 305 unmodified lines
17241764 * -EINVAL Invalid parameters passed in, trim not supported
17251765 * -EIO Error submitting trim request to hw
17261766 */
1727−static int mtip_send_trim(struct driver_data *dd, unsigned int lba, unsigned int len)
1767+static int mtip_send_trim(struct driver_data *dd, unsigned int lba,
1768+ unsigned int len)
17281769 {
17291770 int i, rv = 0;
17301771 u64 tlba, tlen, sect_left;
@@ -1810,45 +1851,6 @@ static bool mtip_hw_get_capacity(struct driver_data *dd, sector_t *sectors) · 79 unmodified lines
18101851 return (bool) !!port->identify_valid;
18111852 }
18121853
1813−/*
1814− * Reset the HBA.
1815− *
1816− * Resets the HBA by setting the HBA Reset bit in the Global
1817− * HBA Control register. After setting the HBA Reset bit the
1818− * function waits for 1 second before reading the HBA Reset
1819− * bit to make sure it has cleared. If HBA Reset is not clear
1820− * an error is returned. Cannot be used in non-blockable
1821− * context.
1822− *
1823− * @dd Pointer to the driver data structure.
1824− *
1825− * return value
1826− * 0 The reset was successful.
1827− * -1 The HBA Reset bit did not clear.
1828− */
1829−static int mtip_hba_reset(struct driver_data *dd)
1830−{
1831− mtip_deinit_port(dd->port);
1832−
1833− /* Set the reset bit */
1834− writel(HOST_RESET, dd->mmio + HOST_CTL);
1835−
1836− /* Flush */
1837− readl(dd->mmio + HOST_CTL);
1838−
1839− /* Wait for reset to clear */
1840− ssleep(1);
1841−
1842− /* Check the bit has cleared */
1843− if (readl(dd->mmio + HOST_CTL) & HOST_RESET) {
1844− dev_err(&dd->pdev->dev,
1845− "Reset bit did not clear.\n");
1846− return -1;
1847− }
1848−
1849− return 0;
1850−}
1851−
18521854 /*
18531855 * Display the identify command data.
18541856 *
@@ -2710,6 +2712,100 @@ static ssize_t mtip_hw_show_status(struct device *dev, · 855 unmodified lines
27102712
27112713 static DEVICE_ATTR(status, S_IRUGO, mtip_hw_show_status, NULL);
27122714
2715+/* debugsfs entries */
2716+
2717+static ssize_t show_device_status(struct device_driver *drv, char *buf)
2718+{
2719+ int size = 0;
2720+ struct driver_data *dd, *tmp;
2721+ unsigned long flags;
2722+ char id_buf[42];
2723+ u16 status = 0;
2724+
2725+ spin_lock_irqsave(&dev_lock, flags);
2726+ size += sprintf(&buf[size], "Devices Present:\n");
2727+ list_for_each_entry_safe(dd, tmp, &online_list, online_list) {
2728+ if (dd->pdev) {
2729+ if (dd->port &&
2730+ dd->port->identify &&
2731+ dd->port->identify_valid) {
2732+ strlcpy(id_buf,
2733+ (char *) (dd->port->identify + 10), 21);
2734+ status = *(dd->port->identify + 141);
2735+ } else {
2736+ memset(id_buf, 0, 42);
2737+ status = 0;
2738+ }
2739+
2740+ if (dd->port &&
2741+ test_bit(MTIP_PF_REBUILD_BIT, &dd->port->flags)) {
2742+ size += sprintf(&buf[size],
2743+ " device %s %s (ftl rebuild %d %%)\n",
2744+ dev_name(&dd->pdev->dev),
2745+ id_buf,
2746+ status);
2747+ } else {
2748+ size += sprintf(&buf[size],
2749+ " device %s %s\n",
2750+ dev_name(&dd->pdev->dev),
2751+ id_buf);
2752+ }
2753+ }
2754+ }
2755+
2756+ size += sprintf(&buf[size], "Devices Being Removed:\n");
2757+ list_for_each_entry_safe(dd, tmp, &removing_list, remove_list) {
2758+ if (dd->pdev) {
2759+ if (dd->port &&
2760+ dd->port->identify &&
2761+ dd->port->identify_valid) {
2762+ strlcpy(id_buf,
2763+ (char *) (dd->port->identify+10), 21);
2764+ status = *(dd->port->identify + 141);
2765+ } else {
2766+ memset(id_buf, 0, 42);
2767+ status = 0;
2768+ }
2769+
2770+ if (dd->port &&
2771+ test_bit(MTIP_PF_REBUILD_BIT, &dd->port->flags)) {
2772+ size += sprintf(&buf[size],
2773+ " device %s %s (ftl rebuild %d %%)\n",
2774+ dev_name(&dd->pdev->dev),
2775+ id_buf,
2776+ status);
2777+ } else {
2778+ size += sprintf(&buf[size],
2779+ " device %s %s\n",
2780+ dev_name(&dd->pdev->dev),
2781+ id_buf);
2782+ }
2783+ }
2784+ }
2785+ spin_unlock_irqrestore(&dev_lock, flags);
2786+
2787+ return size;
2788+}
2789+
2790+static ssize_t mtip_hw_read_device_status(struct file *f, char __user *ubuf,
2791+ size_t len, loff_t *offset)
2792+{
2793+ int size = *offset;
2794+ char buf[MTIP_DFS_MAX_BUF_SIZE];
2795+
2796+ if (!len || *offset)
2797+ return 0;
2798+
2799+ size += show_device_status(NULL, buf);
2800+
2801+ *offset = size <= len ? size : len;
2802+ size = copy_to_user(ubuf, buf, *offset);
2803+ if (size)
2804+ return -EFAULT;
2805+
2806+ return *offset;
2807+}
2808+
27132809 static ssize_t mtip_hw_read_registers(struct file *f, char __user *ubuf,
27142810 size_t len, loff_t *offset)
27152811 {
@@ -2804,6 +2900,13 @@ static ssize_t mtip_hw_read_flags(struct file *f, char __user *ubuf, · 88 unmodified lines
28042900 return *offset;
28052901 }
28062902
2903+static const struct file_operations mtip_device_status_fops = {
2904+ .owner = THIS_MODULE,
2905+ .open = simple_open,
2906+ .read = mtip_hw_read_device_status,
2907+ .llseek = no_llseek,
2908+};
2909+
28072910 static const struct file_operations mtip_regs_fops = {
28082911 .owner = THIS_MODULE,
28092912 .open = simple_open,
@@ -4161,6 +4264,7 @@ static int mtip_pci_probe(struct pci_dev *pdev, · 1351 unmodified lines
41614264 const struct cpumask *node_mask;
41624265 int cpu, i = 0, j = 0;
41634266 int my_node = NUMA_NO_NODE;
4267+ unsigned long flags;
41644268
41654269 /* Allocate memory for this devices private data. */
41664270 my_node = pcibus_to_node(pdev->bus);
@@ -4218,12 +4322,16 @@ static int mtip_pci_probe(struct pci_dev *pdev, · 51 unmodified lines
42184322 dd->pdev = pdev;
42194323 dd->numa_node = my_node;
42204324
4325+ INIT_LIST_HEAD(&dd->online_list);
4326+ INIT_LIST_HEAD(&dd->remove_list);
4327+
42214328 memset(dd->workq_name, 0, 32);
42224329 snprintf(dd->workq_name, 31, "mtipq%d", dd->instance);
42234330
42244331 dd->isr_workq = create_workqueue(dd->workq_name);
42254332 if (!dd->isr_workq) {
42264333 dev_warn(&pdev->dev, "Can't create wq %d\n", dd->instance);
4334+ rv = -ENOMEM;
42274335 goto block_initialize_err;
42284336 }
42294337
@@ -4282,7 +4390,8 @@ static int mtip_pci_probe(struct pci_dev *pdev, · 52 unmodified lines
42824390 INIT_WORK(&dd->work[7].work, mtip_workq_sdbf7);
42834391
42844392 pci_set_master(pdev);
4285− if (pci_enable_msi(pdev)) {
4393+ rv = pci_enable_msi(pdev);
4394+ if (rv) {
42864395 dev_warn(&pdev->dev,
42874396 "Unable to enable MSI interrupt.\n");
42884397 goto block_initialize_err;
@@ -4303,6 +4412,14 @@ static int mtip_pci_probe(struct pci_dev *pdev, · 14 unmodified lines
43034412 instance++;
43044413 if (rv != MTIP_FTL_REBUILD_MAGIC)
43054414 set_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag);
4415+ else
4416+ rv = 0; /* device in rebuild state, return 0 from probe */
4417+
4418+ /* Add to online list even if in ftl rebuild */
4419+ spin_lock_irqsave(&dev_lock, flags);
4420+ list_add(&dd->online_list, &online_list);
4421+ spin_unlock_irqrestore(&dev_lock, flags);
4422+
43064423 goto done;
43074424
43084425 block_initialize_err:
@@ -4336,9 +4453,15 @@ static void mtip_pci_remove(struct pci_dev *pdev) · 27 unmodified lines
43364453 {
43374454 struct driver_data *dd = pci_get_drvdata(pdev);
43384455 int counter = 0;
4456+ unsigned long flags;
43394457
43404458 set_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag);
43414459
4460+ spin_lock_irqsave(&dev_lock, flags);
4461+ list_del_init(&dd->online_list);
4462+ list_add(&dd->remove_list, &removing_list);
4463+ spin_unlock_irqrestore(&dev_lock, flags);
4464+
43424465 if (mtip_check_surprise_removal(pdev)) {
43434466 while (!test_bit(MTIP_DDF_CLEANUP_BIT, &dd->dd_flag)) {
43444467 counter++;
@@ -4364,6 +4487,10 @@ static void mtip_pci_remove(struct pci_dev *pdev) · 19 unmodified lines
43644487
43654488 pci_disable_msi(pdev);
43664489
4490+ spin_lock_irqsave(&dev_lock, flags);
4491+ list_del_init(&dd->remove_list);
4492+ spin_unlock_irqrestore(&dev_lock, flags);
4493+
43674494 kfree(dd);
43684495 pcim_iounmap_regions(pdev, 1 << MTIP_ABAR);
43694496 }
@@ -4511,6 +4638,11 @@ static int __init mtip_init(void) · 141 unmodified lines
45114638
45124639 pr_info(MTIP_DRV_NAME " Version " MTIP_DRV_VERSION "\n");
45134640
4641+ spin_lock_init(&dev_lock);
4642+
4643+ INIT_LIST_HEAD(&online_list);
4644+ INIT_LIST_HEAD(&removing_list);
4645+
45144646 /* Allocate a major block device number to use with this driver. */
45154647 error = register_blkdev(0, MTIP_DRV_NAME);
45164648 if (error <= 0) {
@@ -4520,11 +4652,18 @@ static int __init mtip_init(void) · 3 unmodified lines
45204652 }
45214653 mtip_major = error;
45224654
4523− if (!dfs_parent) {
4524− dfs_parent = debugfs_create_dir("rssd", NULL);
4525− if (IS_ERR_OR_NULL(dfs_parent)) {
4526− pr_warn("Error creating debugfs parent\n");
4527− dfs_parent = NULL;
4655+ dfs_parent = debugfs_create_dir("rssd", NULL);
4656+ if (IS_ERR_OR_NULL(dfs_parent)) {
4657+ pr_warn("Error creating debugfs parent\n");
4658+ dfs_parent = NULL;
4659+ }
4660+ if (dfs_parent) {
4661+ dfs_device_status = debugfs_create_file("device_status",
4662+ S_IRUGO, dfs_parent, NULL,
4663+ &mtip_device_status_fops);
4664+ if (IS_ERR_OR_NULL(dfs_device_status)) {
4665+ pr_err("Error creating device_status node\n");
4666+ dfs_device_status = NULL;
45284667 }
45294668 }
45304669
drivers/block/mtip32xx/mtip32xx.h+11−7
@@ -129,9 +129,9 @@ enum { · 128 unmodified lines
129129 MTIP_PF_EH_ACTIVE_BIT = 1, /* error handling */
130130 MTIP_PF_SE_ACTIVE_BIT = 2, /* secure erase */
131131 MTIP_PF_DM_ACTIVE_BIT = 3, /* download microcde */
132− MTIP_PF_PAUSE_IO = ((1 << MTIP_PF_IC_ACTIVE_BIT) | \
133− (1 << MTIP_PF_EH_ACTIVE_BIT) | \
134− (1 << MTIP_PF_SE_ACTIVE_BIT) | \
132+ MTIP_PF_PAUSE_IO = ((1 << MTIP_PF_IC_ACTIVE_BIT) |
133+ (1 << MTIP_PF_EH_ACTIVE_BIT) |
134+ (1 << MTIP_PF_SE_ACTIVE_BIT) |
135135 (1 << MTIP_PF_DM_ACTIVE_BIT)),
136136
137137 MTIP_PF_SVC_THD_ACTIVE_BIT = 4,
@@ -144,9 +144,9 @@ enum { · 6 unmodified lines
144144 MTIP_DDF_REMOVE_PENDING_BIT = 1,
145145 MTIP_DDF_OVER_TEMP_BIT = 2,
146146 MTIP_DDF_WRITE_PROTECT_BIT = 3,
147− MTIP_DDF_STOP_IO = ((1 << MTIP_DDF_REMOVE_PENDING_BIT) | \
148− (1 << MTIP_DDF_SEC_LOCK_BIT) | \
149− (1 << MTIP_DDF_OVER_TEMP_BIT) | \
147+ MTIP_DDF_STOP_IO = ((1 << MTIP_DDF_REMOVE_PENDING_BIT) |
148+ (1 << MTIP_DDF_SEC_LOCK_BIT) |
149+ (1 << MTIP_DDF_OVER_TEMP_BIT) |
150150 (1 << MTIP_DDF_WRITE_PROTECT_BIT)),
151151
152152 MTIP_DDF_CLEANUP_BIT = 5,
@@ -180,7 +180,7 @@ struct mtip_work { · 27 unmodified lines
180180
181181 #define MTIP_TRIM_TIMEOUT_MS 240000
182182 #define MTIP_MAX_TRIM_ENTRIES 8
183−#define MTIP_MAX_TRIM_ENTRY_LEN 0xfff8
183+#define MTIP_MAX_TRIM_ENTRY_LEN 0xfff8
184184
185185 struct mtip_trim_entry {
186186 u32 lba; /* starting lba of region */
@@ -501,6 +501,10 @@ struct driver_data { · 314 unmodified lines
501501 atomic_t irq_workers_active;
502502
503503 int isr_binding;
504+
505+ struct list_head online_list; /* linkage for online list */
506+
507+ struct list_head remove_list; /* linkage for removing list */
504508 };
505509
506510 #endif
drivers/block/nvme.c+24−9
@@ -135,6 +135,7 @@ static inline void _nvme_check_size(void) · 134 unmodified lines
135135 BUILD_BUG_ON(sizeof(struct nvme_id_ctrl) != 4096);
136136 BUILD_BUG_ON(sizeof(struct nvme_id_ns) != 4096);
137137 BUILD_BUG_ON(sizeof(struct nvme_lba_range_type) != 64);
138+ BUILD_BUG_ON(sizeof(struct nvme_smart_log) != 512);
138139 }
139140
140141 typedef void (*nvme_completion_fn)(struct nvme_dev *, void *,
@@ -237,7 +238,8 @@ static void *free_cmdid(struct nvme_queue *nvmeq, int cmdid, · 96 unmodified lines
237238 *fn = special_completion;
238239 return CMD_CTX_INVALID;
239240 }
240− *fn = info[cmdid].fn;
241+ if (fn)
242+ *fn = info[cmdid].fn;
241243 ctx = info[cmdid].ctx;
242244 info[cmdid].fn = special_completion;
243245 info[cmdid].ctx = CMD_CTX_COMPLETED;
@@ -335,6 +337,7 @@ nvme_alloc_iod(unsigned nseg, unsigned nbytes, gfp_t gfp) · 91 unmodified lines
335337 iod->offset = offsetof(struct nvme_iod, sg[nseg]);
336338 iod->npages = -1;
337339 iod->length = nbytes;
340+ iod->nents = 0;
338341 }
339342
340343 return iod;
@@ -375,7 +378,8 @@ static void bio_completion(struct nvme_dev *dev, void *ctx, · 34 unmodified lines
375378 struct bio *bio = iod->private;
376379 u16 status = le16_to_cpup(&cqe->status) >> 1;
377380
378− dma_unmap_sg(&dev->pci_dev->dev, iod->sg, iod->nents,
381+ if (iod->nents)
382+ dma_unmap_sg(&dev->pci_dev->dev, iod->sg, iod->nents,
379383 bio_data_dir(bio) ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
380384 nvme_free_iod(dev, iod);
381385 if (status) {
@@ -589,7 +593,7 @@ static int nvme_submit_bio_queue(struct nvme_queue *nvmeq, struct nvme_ns *ns, · 207 unmodified lines
589593
590594 result = nvme_map_bio(nvmeq->q_dmadev, iod, bio, dma_dir, psegs);
591595 if (result < 0)
592− goto free_iod;
596+ goto free_cmdid;
593597 length = result;
594598
595599 cmnd->rw.command_id = cmdid;
@@ -609,6 +613,8 @@ static int nvme_submit_bio_queue(struct nvme_queue *nvmeq, struct nvme_ns *ns, · 13 unmodified lines
609613
610614 return 0;
611615
616+ free_cmdid:
617+ free_cmdid(nvmeq, cmdid, NULL);
612618 free_iod:
613619 nvme_free_iod(nvmeq->dev, iod);
614620 nomem:
@@ -835,8 +841,8 @@ static int nvme_identify(struct nvme_dev *dev, unsigned nsid, unsigned cns, · 220 unmodified lines
835841 return nvme_submit_admin_cmd(dev, &c, NULL);
836842 }
837843
838−static int nvme_get_features(struct nvme_dev *dev, unsigned fid,
839− unsigned nsid, dma_addr_t dma_addr)
844+static int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid,
845+ dma_addr_t dma_addr, u32 *result)
840846 {
841847 struct nvme_command c;
842848
@@ -846,7 +852,7 @@ static int nvme_get_features(struct nvme_dev *dev, unsigned fid, · 3 unmodified lines
846852 c.features.prp1 = cpu_to_le64(dma_addr);
847853 c.features.fid = cpu_to_le32(fid);
848854
849− return nvme_submit_admin_cmd(dev, &c, NULL);
855+ return nvme_submit_admin_cmd(dev, &c, result);
850856 }
851857
852858 static int nvme_set_features(struct nvme_dev *dev, unsigned fid,
@@ -906,6 +912,10 @@ static void nvme_free_queue(struct nvme_dev *dev, int qid) · 53 unmodified lines
906912
907913 spin_lock_irq(&nvmeq->q_lock);
908914 nvme_cancel_ios(nvmeq, false);
915+ while (bio_list_peek(&nvmeq->sq_cong)) {
916+ struct bio *bio = bio_list_pop(&nvmeq->sq_cong);
917+ bio_endio(bio, -EIO);
918+ }
909919 spin_unlock_irq(&nvmeq->q_lock);
910920
911921 irq_set_affinity_hint(vector, NULL);
@@ -1230,12 +1240,17 @@ static int nvme_user_admin_cmd(struct nvme_dev *dev, · 318 unmodified lines
12301240 if (length != cmd.data_len)
12311241 status = -ENOMEM;
12321242 else
1233− status = nvme_submit_admin_cmd(dev, &c, NULL);
1243+ status = nvme_submit_admin_cmd(dev, &c, &cmd.result);
12341244
12351245 if (cmd.data_len) {
12361246 nvme_unmap_user_pages(dev, cmd.opcode & 1, iod);
12371247 nvme_free_iod(dev, iod);
12381248 }
1249+
1250+ if (!status && copy_to_user(&ucmd->result, &cmd.result,
1251+ sizeof(cmd.result)))
1252+ status = -EFAULT;
1253+
12391254 return status;
12401255 }
12411256
@@ -1523,9 +1538,9 @@ static int nvme_dev_add(struct nvme_dev *dev) · 281 unmodified lines
15231538 continue;
15241539
15251540 res = nvme_get_features(dev, NVME_FEAT_LBA_RANGE, i,
1526− dma_addr + 4096);
1541+ dma_addr + 4096, NULL);
15271542 if (res)
1528− continue;
1543+ memset(mem + 4096, 0, 4096);
15291544
15301545 ns = nvme_alloc_ns(dev, i, mem, mem + 4096);
15311546 if (ns)
drivers/block/rbd.c+32−18
@@ -1264,6 +1264,32 @@ static bool obj_request_done_test(struct rbd_obj_request *obj_request) · 1263 unmodified lines
12641264 return atomic_read(&obj_request->done) != 0;
12651265 }
12661266
1267+static void
1268+rbd_img_obj_request_read_callback(struct rbd_obj_request *obj_request)
1269+{
1270+ dout("%s: obj %p img %p result %d %llu/%llu\n", __func__,
1271+ obj_request, obj_request->img_request, obj_request->result,
1272+ obj_request->xferred, obj_request->length);
1273+ /*
1274+ * ENOENT means a hole in the image. We zero-fill the
1275+ * entire length of the request. A short read also implies
1276+ * zero-fill to the end of the request. Either way we
1277+ * update the xferred count to indicate the whole request
1278+ * was satisfied.
1279+ */
1280+ BUG_ON(obj_request->type != OBJ_REQUEST_BIO);
1281+ if (obj_request->result == -ENOENT) {
1282+ zero_bio_chain(obj_request->bio_list, 0);
1283+ obj_request->result = 0;
1284+ obj_request->xferred = obj_request->length;
1285+ } else if (obj_request->xferred < obj_request->length &&
1286+ !obj_request->result) {
1287+ zero_bio_chain(obj_request->bio_list, obj_request->xferred);
1288+ obj_request->xferred = obj_request->length;
1289+ }
1290+ obj_request_done_set(obj_request);
1291+}
1292+
12671293 static void rbd_obj_request_complete(struct rbd_obj_request *obj_request)
12681294 {
12691295 dout("%s: obj %p cb %p\n", __func__, obj_request,
@@ -1284,23 +1310,10 @@ static void rbd_osd_read_callback(struct rbd_obj_request *obj_request) · 14 unmodified lines
12841310 {
12851311 dout("%s: obj %p result %d %llu/%llu\n", __func__, obj_request,
12861312 obj_request->result, obj_request->xferred, obj_request->length);
1287− /*
1288− * ENOENT means a hole in the object. We zero-fill the
1289− * entire length of the request. A short read also implies
1290− * zero-fill to the end of the request. Either way we
1291− * update the xferred count to indicate the whole request
1292− * was satisfied.
1293− */
1294− if (obj_request->result == -ENOENT) {
1295− zero_bio_chain(obj_request->bio_list, 0);
1296− obj_request->result = 0;
1297− obj_request->xferred = obj_request->length;
1298− } else if (obj_request->xferred < obj_request->length &&
1299− !obj_request->result) {
1300− zero_bio_chain(obj_request->bio_list, obj_request->xferred);
1301− obj_request->xferred = obj_request->length;
1302− }
1303− obj_request_done_set(obj_request);
1313+ if (obj_request->img_request)
1314+ rbd_img_obj_request_read_callback(obj_request);
1315+ else
1316+ obj_request_done_set(obj_request);
13041317 }
13051318
13061319 static void rbd_osd_write_callback(struct rbd_obj_request *obj_request)
@@ -1729,9 +1742,10 @@ static int rbd_img_request_submit(struct rbd_img_request *img_request) · 422 unmodified lines
17291742 struct rbd_device *rbd_dev = img_request->rbd_dev;
17301743 struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc;
17311744 struct rbd_obj_request *obj_request;
1745+ struct rbd_obj_request *next_obj_request;
17321746
17331747 dout("%s: img %p\n", __func__, img_request);
1734− for_each_obj_request(img_request, obj_request) {
1748+ for_each_obj_request_safe(img_request, obj_request, next_obj_request) {
17351749 int ret;
17361750
17371751 obj_request->callback = rbd_img_obj_callback;
drivers/block/rsxx/Makefile+1−1
@@ -1,2 +1,2 @@
11 obj-$(CONFIG_BLK_DEV_RSXX) += rsxx.o
2−rsxx-y := config.o core.o cregs.o dev.o dma.o
2+rsxx-objs := config.o core.o cregs.o dev.o dma.o
drivers/block/rsxx/config.c+3−5
@@ -29,15 +29,13 @@ · 28 unmodified lines
2929 #include "rsxx_priv.h"
3030 #include "rsxx_cfg.h"
3131
32−static void initialize_config(void *config)
32+static void initialize_config(struct rsxx_card_cfg *cfg)
3333 {
34− struct rsxx_card_cfg *cfg = config;
35−
3634 cfg->hdr.version = RSXX_CFG_VERSION;
3735
3836 cfg->data.block_size = RSXX_HW_BLK_SIZE;
3937 cfg->data.stripe_size = RSXX_HW_BLK_SIZE;
40− cfg->data.vendor_id = RSXX_VENDOR_ID_TMS_IBM;
38+ cfg->data.vendor_id = RSXX_VENDOR_ID_IBM;
4139 cfg->data.cache_order = (-1);
4240 cfg->data.intr_coal.mode = RSXX_INTR_COAL_DISABLED;
4341 cfg->data.intr_coal.count = 0;
@@ -181,7 +179,7 @@ int rsxx_load_config(struct rsxx_cardinfo *card) · 137 unmodified lines
181179 } else {
182180 dev_info(CARD_TO_DEV(card),
183181 "Initializing card configuration.\n");
184− initialize_config(card);
182+ initialize_config(&card->config);
185183 st = rsxx_save_config(card);
186184 if (st)
187185 return st;
drivers/block/rsxx/core.c+224−13
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 #include <linux/reboot.h>
3131 #include <linux/slab.h>
3232 #include <linux/bitops.h>
33+#include <linux/delay.h>
3334
3435 #include <linux/genhd.h>
3536 #include <linux/idr.h>
@@ -39,8 +40,8 @@ · 3 unmodified lines
3940
4041 #define NO_LEGACY 0
4142
42−MODULE_DESCRIPTION("IBM RamSan PCIe Flash SSD Device Driver");
43−MODULE_AUTHOR("IBM <support@ramsan.com>");
43+MODULE_DESCRIPTION("IBM FlashSystem 70/80 PCIe SSD Device Driver");
44+MODULE_AUTHOR("Joshua Morris/Philip Kelleher, IBM");
4445 MODULE_LICENSE("GPL");
4546 MODULE_VERSION(DRIVER_VERSION);
4647
@@ -52,6 +53,13 @@ static DEFINE_IDA(rsxx_disk_ida); · 5 unmodified lines
5253 static DEFINE_SPINLOCK(rsxx_ida_lock);
5354
5455 /*----------------- Interrupt Control & Handling -------------------*/
56+
57+static void rsxx_mask_interrupts(struct rsxx_cardinfo *card)
58+{
59+ card->isr_mask = 0;
60+ card->ier_mask = 0;
61+}
62+
5563 static void __enable_intr(unsigned int *mask, unsigned int intr)
5664 {
5765 *mask |= intr;
@@ -71,7 +79,8 @@ static void __disable_intr(unsigned int *mask, unsigned int intr) · 13 unmodified lines
7179 */
7280 void rsxx_enable_ier(struct rsxx_cardinfo *card, unsigned int intr)
7381 {
74− if (unlikely(card->halt))
82+ if (unlikely(card->halt) ||
83+ unlikely(card->eeh_state))
7584 return;
7685
7786 __enable_intr(&card->ier_mask, intr);
@@ -80,6 +89,9 @@ void rsxx_enable_ier(struct rsxx_cardinfo *card, unsigned int intr) · 2 unmodified lines
8089
8190 void rsxx_disable_ier(struct rsxx_cardinfo *card, unsigned int intr)
8291 {
92+ if (unlikely(card->eeh_state))
93+ return;
94+
8395 __disable_intr(&card->ier_mask, intr);
8496 iowrite32(card->ier_mask, card->regmap + IER);
8597 }
@@ -87,7 +99,8 @@ void rsxx_disable_ier(struct rsxx_cardinfo *card, unsigned int intr) · 1 unmodified line
8799 void rsxx_enable_ier_and_isr(struct rsxx_cardinfo *card,
88100 unsigned int intr)
89101 {
90− if (unlikely(card->halt))
102+ if (unlikely(card->halt) ||
103+ unlikely(card->eeh_state))
91104 return;
92105
93106 __enable_intr(&card->isr_mask, intr);
@@ -97,6 +110,9 @@ void rsxx_enable_ier_and_isr(struct rsxx_cardinfo *card, · 3 unmodified lines
97110 void rsxx_disable_ier_and_isr(struct rsxx_cardinfo *card,
98111 unsigned int intr)
99112 {
113+ if (unlikely(card->eeh_state))
114+ return;
115+
100116 __disable_intr(&card->isr_mask, intr);
101117 __disable_intr(&card->ier_mask, intr);
102118 iowrite32(card->ier_mask, card->regmap + IER);
@@ -115,6 +131,9 @@ static irqreturn_t rsxx_isr(int irq, void *pdata) · 12 unmodified lines
115131 do {
116132 reread_isr = 0;
117133
134+ if (unlikely(card->eeh_state))
135+ break;
136+
118137 isr = ioread32(card->regmap + ISR);
119138 if (isr == 0xffffffff) {
120139 /*
@@ -161,9 +180,9 @@ static irqreturn_t rsxx_isr(int irq, void *pdata) · 40 unmodified lines
161180 }
162181
163182 /*----------------- Card Event Handler -------------------*/
164−static char *rsxx_card_state_to_str(unsigned int state)
183+static const char * const rsxx_card_state_to_str(unsigned int state)
165184 {
166− static char *state_strings[] = {
185+ static const char * const state_strings[] = {
167186 "Unknown", "Shutdown", "Starting", "Formatting",
168187 "Uninitialized", "Good", "Shutting Down",
169188 "Fault", "Read Only Fault", "dStroying"
@@ -304,6 +323,192 @@ static int card_shutdown(struct rsxx_cardinfo *card) · 134 unmodified lines
304323 return 0;
305324 }
306325
326+static int rsxx_eeh_frozen(struct pci_dev *dev)
327+{
328+ struct rsxx_cardinfo *card = pci_get_drvdata(dev);
329+ int i;
330+ int st;
331+
332+ dev_warn(&dev->dev, "IBM FlashSystem PCI: preparing for slot reset.\n");
333+
334+ card->eeh_state = 1;
335+ rsxx_mask_interrupts(card);
336+
337+ /*
338+ * We need to guarantee that the write for eeh_state and masking
339+ * interrupts does not become reordered. This will prevent a possible
340+ * race condition with the EEH code.
341+ */
342+ wmb();
343+
344+ pci_disable_device(dev);
345+
346+ st = rsxx_eeh_save_issued_dmas(card);
347+ if (st)
348+ return st;
349+
350+ rsxx_eeh_save_issued_creg(card);
351+
352+ for (i = 0; i < card->n_targets; i++) {
353+ if (card->ctrl[i].status.buf)
354+ pci_free_consistent(card->dev, STATUS_BUFFER_SIZE8,
355+ card->ctrl[i].status.buf,
356+ card->ctrl[i].status.dma_addr);
357+ if (card->ctrl[i].cmd.buf)
358+ pci_free_consistent(card->dev, COMMAND_BUFFER_SIZE8,
359+ card->ctrl[i].cmd.buf,
360+ card->ctrl[i].cmd.dma_addr);
361+ }
362+
363+ return 0;
364+}
365+
366+static void rsxx_eeh_failure(struct pci_dev *dev)
367+{
368+ struct rsxx_cardinfo *card = pci_get_drvdata(dev);
369+ int i;
370+
371+ dev_err(&dev->dev, "IBM FlashSystem PCI: disabling failed card.\n");
372+
373+ card->eeh_state = 1;
374+
375+ for (i = 0; i < card->n_targets; i++)
376+ del_timer_sync(&card->ctrl[i].activity_timer);
377+
378+ rsxx_eeh_cancel_dmas(card);
379+}
380+
381+static int rsxx_eeh_fifo_flush_poll(struct rsxx_cardinfo *card)
382+{
383+ unsigned int status;
384+ int iter = 0;
385+
386+ /* We need to wait for the hardware to reset */
387+ while (iter++ < 10) {
388+ status = ioread32(card->regmap + PCI_RECONFIG);
389+
390+ if (status & RSXX_FLUSH_BUSY) {
391+ ssleep(1);
392+ continue;
393+ }
394+
395+ if (status & RSXX_FLUSH_TIMEOUT)
396+ dev_warn(CARD_TO_DEV(card), "HW: flash controller timeout\n");
397+ return 0;
398+ }
399+
400+ /* Hardware failed resetting itself. */
401+ return -1;
402+}
403+
404+static pci_ers_result_t rsxx_error_detected(struct pci_dev *dev,
405+ enum pci_channel_state error)
406+{
407+ int st;
408+
409+ if (dev->revision < RSXX_EEH_SUPPORT)
410+ return PCI_ERS_RESULT_NONE;
411+
412+ if (error == pci_channel_io_perm_failure) {
413+ rsxx_eeh_failure(dev);
414+ return PCI_ERS_RESULT_DISCONNECT;
415+ }
416+
417+ st = rsxx_eeh_frozen(dev);
418+ if (st) {
419+ dev_err(&dev->dev, "Slot reset setup failed\n");
420+ rsxx_eeh_failure(dev);
421+ return PCI_ERS_RESULT_DISCONNECT;
422+ }
423+
424+ return PCI_ERS_RESULT_NEED_RESET;
425+}
426+
427+static pci_ers_result_t rsxx_slot_reset(struct pci_dev *dev)
428+{
429+ struct rsxx_cardinfo *card = pci_get_drvdata(dev);
430+ unsigned long flags;
431+ int i;
432+ int st;
433+
434+ dev_warn(&dev->dev,
435+ "IBM FlashSystem PCI: recovering from slot reset.\n");
436+
437+ st = pci_enable_device(dev);
438+ if (st)
439+ goto failed_hw_setup;
440+
441+ pci_set_master(dev);
442+
443+ st = rsxx_eeh_fifo_flush_poll(card);
444+ if (st)
445+ goto failed_hw_setup;
446+
447+ rsxx_dma_queue_reset(card);
448+
449+ for (i = 0; i < card->n_targets; i++) {
450+ st = rsxx_hw_buffers_init(dev, &card->ctrl[i]);
451+ if (st)
452+ goto failed_hw_buffers_init;
453+ }
454+
455+ if (card->config_valid)
456+ rsxx_dma_configure(card);
457+
458+ /* Clears the ISR register from spurious interrupts */
459+ st = ioread32(card->regmap + ISR);
460+
461+ card->eeh_state = 0;
462+
463+ st = rsxx_eeh_remap_dmas(card);
464+ if (st)
465+ goto failed_remap_dmas;
466+
467+ spin_lock_irqsave(&card->irq_lock, flags);
468+ if (card->n_targets & RSXX_MAX_TARGETS)
469+ rsxx_enable_ier_and_isr(card, CR_INTR_ALL_G);
470+ else
471+ rsxx_enable_ier_and_isr(card, CR_INTR_ALL_C);
472+ spin_unlock_irqrestore(&card->irq_lock, flags);
473+
474+ rsxx_kick_creg_queue(card);
475+
476+ for (i = 0; i < card->n_targets; i++) {
477+ spin_lock(&card->ctrl[i].queue_lock);
478+ if (list_empty(&card->ctrl[i].queue)) {
479+ spin_unlock(&card->ctrl[i].queue_lock);
480+ continue;
481+ }
482+ spin_unlock(&card->ctrl[i].queue_lock);
483+
484+ queue_work(card->ctrl[i].issue_wq,
485+ &card->ctrl[i].issue_dma_work);
486+ }
487+
488+ dev_info(&dev->dev, "IBM FlashSystem PCI: recovery complete.\n");
489+
490+ return PCI_ERS_RESULT_RECOVERED;
491+
492+failed_hw_buffers_init:
493+failed_remap_dmas:
494+ for (i = 0; i < card->n_targets; i++) {
495+ if (card->ctrl[i].status.buf)
496+ pci_free_consistent(card->dev,
497+ STATUS_BUFFER_SIZE8,
498+ card->ctrl[i].status.buf,
499+ card->ctrl[i].status.dma_addr);
500+ if (card->ctrl[i].cmd.buf)
501+ pci_free_consistent(card->dev,
502+ COMMAND_BUFFER_SIZE8,
503+ card->ctrl[i].cmd.buf,
504+ card->ctrl[i].cmd.dma_addr);
505+ }
506+failed_hw_setup:
507+ rsxx_eeh_failure(dev);
508+ return PCI_ERS_RESULT_DISCONNECT;
509+
510+}
511+
307512 /*----------------- Driver Initialization & Setup -------------------*/
308513 /* Returns: 0 if the driver is compatible with the device
309514 -1 if the driver is NOT compatible with the device */
@@ -383,6 +588,7 @@ static int rsxx_pci_probe(struct pci_dev *dev, · 73 unmodified lines
383588
384589 spin_lock_init(&card->irq_lock);
385590 card->halt = 0;
591+ card->eeh_state = 0;
386592
387593 spin_lock_irq(&card->irq_lock);
388594 rsxx_disable_ier_and_isr(card, CR_INTR_ALL);
@@ -538,9 +744,6 @@ static void rsxx_pci_remove(struct pci_dev *dev) · 149 unmodified lines
538744 rsxx_disable_ier_and_isr(card, CR_INTR_EVENT);
539745 spin_unlock_irqrestore(&card->irq_lock, flags);
540746
541− /* Prevent work_structs from re-queuing themselves. */
542− card->halt = 1;
543−
544747 cancel_work_sync(&card->event_work);
545748
546749 rsxx_destroy_dev(card);
@@ -549,6 +752,10 @@ static void rsxx_pci_remove(struct pci_dev *dev) · 2 unmodified lines
549752 spin_lock_irqsave(&card->irq_lock, flags);
550753 rsxx_disable_ier_and_isr(card, CR_INTR_ALL);
551754 spin_unlock_irqrestore(&card->irq_lock, flags);
755+
756+ /* Prevent work_structs from re-queuing themselves. */
757+ card->halt = 1;
758+
552759 free_irq(dev->irq, card);
553760
554761 if (!force_legacy)
@@ -592,11 +799,14 @@ static void rsxx_pci_shutdown(struct pci_dev *dev) · 37 unmodified lines
592799 card_shutdown(card);
593800 }
594801
802+static const struct pci_error_handlers rsxx_err_handler = {
803+ .error_detected = rsxx_error_detected,
804+ .slot_reset = rsxx_slot_reset,
805+};
806+
595807 static DEFINE_PCI_DEVICE_TABLE(rsxx_pci_ids) = {
596− {PCI_DEVICE(PCI_VENDOR_ID_TMS_IBM, PCI_DEVICE_ID_RS70_FLASH)},
597− {PCI_DEVICE(PCI_VENDOR_ID_TMS_IBM, PCI_DEVICE_ID_RS70D_FLASH)},
598− {PCI_DEVICE(PCI_VENDOR_ID_TMS_IBM, PCI_DEVICE_ID_RS80_FLASH)},
599− {PCI_DEVICE(PCI_VENDOR_ID_TMS_IBM, PCI_DEVICE_ID_RS81_FLASH)},
808+ {PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_FS70_FLASH)},
809+ {PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_FS80_FLASH)},
600810 {0,},
601811 };
602812
@@ -609,6 +819,7 @@ static struct pci_driver rsxx_pci_driver = { · 6 unmodified lines
609819 .remove = rsxx_pci_remove,
610820 .suspend = rsxx_pci_suspend,
611821 .shutdown = rsxx_pci_shutdown,
822+ .err_handler = &rsxx_err_handler,
612823 };
613824
614825 static int __init rsxx_core_init(void)
drivers/block/rsxx/cregs.c+72−40
@@ -58,7 +58,7 @@ static struct kmem_cache *creg_cmd_pool; · 57 unmodified lines
5858 #error Unknown endianess!!! Aborting...
5959 #endif
6060
61−static void copy_to_creg_data(struct rsxx_cardinfo *card,
61+static int copy_to_creg_data(struct rsxx_cardinfo *card,
6262 int cnt8,
6363 void *buf,
6464 unsigned int stream)
@@ -66,6 +66,9 @@ static void copy_to_creg_data(struct rsxx_cardinfo *card, · 1 unmodified line
6666 int i = 0;
6767 u32 *data = buf;
6868
69+ if (unlikely(card->eeh_state))
70+ return -EIO;
71+
6972 for (i = 0; cnt8 > 0; i++, cnt8 -= 4) {
7073 /*
7174 * Firmware implementation makes it necessary to byte swap on
@@ -76,10 +79,12 @@ static void copy_to_creg_data(struct rsxx_cardinfo *card, · 4 unmodified lines
7679 else
7780 iowrite32(data[i], card->regmap + CREG_DATA(i));
7881 }
82+
83+ return 0;
7984 }
8085
8186
82−static void copy_from_creg_data(struct rsxx_cardinfo *card,
87+static int copy_from_creg_data(struct rsxx_cardinfo *card,
8388 int cnt8,
8489 void *buf,
8590 unsigned int stream)
@@ -87,6 +92,9 @@ static void copy_from_creg_data(struct rsxx_cardinfo *card, · 1 unmodified line
8792 int i = 0;
8893 u32 *data = buf;
8994
95+ if (unlikely(card->eeh_state))
96+ return -EIO;
97+
9098 for (i = 0; cnt8 > 0; i++, cnt8 -= 4) {
9199 /*
92100 * Firmware implementation makes it necessary to byte swap on
@@ -97,41 +105,31 @@ static void copy_from_creg_data(struct rsxx_cardinfo *card, · 4 unmodified lines
97105 else
98106 data[i] = ioread32(card->regmap + CREG_DATA(i));
99107 }
100−}
101−
102−static struct creg_cmd *pop_active_cmd(struct rsxx_cardinfo *card)
103−{
104− struct creg_cmd *cmd;
105108
106− /*
107− * Spin lock is needed because this can be called in atomic/interrupt
108− * context.
109− */
110− spin_lock_bh(&card->creg_ctrl.lock);
111− cmd = card->creg_ctrl.active_cmd;
112− card->creg_ctrl.active_cmd = NULL;
113− spin_unlock_bh(&card->creg_ctrl.lock);
114−
115− return cmd;
109+ return 0;
116110 }
117111
118112 static void creg_issue_cmd(struct rsxx_cardinfo *card, struct creg_cmd *cmd)
119113 {
114+ int st;
115+
116+ if (unlikely(card->eeh_state))
117+ return;
118+
120119 iowrite32(cmd->addr, card->regmap + CREG_ADD);
121120 iowrite32(cmd->cnt8, card->regmap + CREG_CNT);
122121
123122 if (cmd->op == CREG_OP_WRITE) {
124− if (cmd->buf)
125− copy_to_creg_data(card, cmd->cnt8,
126− cmd->buf, cmd->stream);
123+ if (cmd->buf) {
124+ st = copy_to_creg_data(card, cmd->cnt8,
125+ cmd->buf, cmd->stream);
126+ if (st)
127+ return;
128+ }
127129 }
128130
129− /*
130− * Data copy must complete before initiating the command. This is
131− * needed for weakly ordered processors (i.e. PowerPC), so that all
132− * neccessary registers are written before we kick the hardware.
133− */
134− wmb();
131+ if (unlikely(card->eeh_state))
132+ return;
135133
136134 /* Setting the valid bit will kick off the command. */
137135 iowrite32(cmd->op, card->regmap + CREG_CMD);
@@ -196,11 +194,11 @@ static int creg_queue_cmd(struct rsxx_cardinfo *card, · 58 unmodified lines
196194 cmd->cb_private = cb_private;
197195 cmd->status = 0;
198196
199− spin_lock(&card->creg_ctrl.lock);
197+ spin_lock_bh(&card->creg_ctrl.lock);
200198 list_add_tail(&cmd->list, &card->creg_ctrl.queue);
201199 card->creg_ctrl.q_depth++;
202200 creg_kick_queue(card);
203− spin_unlock(&card->creg_ctrl.lock);
201+ spin_unlock_bh(&card->creg_ctrl.lock);
204202
205203 return 0;
206204 }
@@ -210,7 +208,11 @@ static void creg_cmd_timed_out(unsigned long data) · 3 unmodified lines
210208 struct rsxx_cardinfo *card = (struct rsxx_cardinfo *) data;
211209 struct creg_cmd *cmd;
212210
213− cmd = pop_active_cmd(card);
211+ spin_lock(&card->creg_ctrl.lock);
212+ cmd = card->creg_ctrl.active_cmd;
213+ card->creg_ctrl.active_cmd = NULL;
214+ spin_unlock(&card->creg_ctrl.lock);
215+
214216 if (cmd == NULL) {
215217 card->creg_ctrl.creg_stats.creg_timeout++;
216218 dev_warn(CARD_TO_DEV(card),
@@ -247,7 +249,11 @@ static void creg_cmd_done(struct work_struct *work) · 30 unmodified lines
247249 if (del_timer_sync(&card->creg_ctrl.cmd_timer) == 0)
248250 card->creg_ctrl.creg_stats.failed_cancel_timer++;
249251
250− cmd = pop_active_cmd(card);
252+ spin_lock_bh(&card->creg_ctrl.lock);
253+ cmd = card->creg_ctrl.active_cmd;
254+ card->creg_ctrl.active_cmd = NULL;
255+ spin_unlock_bh(&card->creg_ctrl.lock);
256+
251257 if (cmd == NULL) {
252258 dev_err(CARD_TO_DEV(card),
253259 "Spurious creg interrupt!\n");
@@ -287,7 +293,7 @@ static void creg_cmd_done(struct work_struct *work) · 33 unmodified lines
287293 goto creg_done;
288294 }
289295
290− copy_from_creg_data(card, cnt8, cmd->buf, cmd->stream);
296+ st = copy_from_creg_data(card, cnt8, cmd->buf, cmd->stream);
291297 }
292298
293299 creg_done:
@@ -296,10 +302,10 @@ creg_done: · 2 unmodified lines
296302
297303 kmem_cache_free(creg_cmd_pool, cmd);
298304
299− spin_lock(&card->creg_ctrl.lock);
305+ spin_lock_bh(&card->creg_ctrl.lock);
300306 card->creg_ctrl.active = 0;
301307 creg_kick_queue(card);
302− spin_unlock(&card->creg_ctrl.lock);
308+ spin_unlock_bh(&card->creg_ctrl.lock);
303309 }
304310
305311 static void creg_reset(struct rsxx_cardinfo *card)
@@ -324,7 +330,7 @@ static void creg_reset(struct rsxx_cardinfo *card) · 18 unmodified lines
324330 "Resetting creg interface for recovery\n");
325331
326332 /* Cancel outstanding commands */
327− spin_lock(&card->creg_ctrl.lock);
333+ spin_lock_bh(&card->creg_ctrl.lock);
328334 list_for_each_entry_safe(cmd, tmp, &card->creg_ctrl.queue, list) {
329335 list_del(&cmd->list);
330336 card->creg_ctrl.q_depth--;
@@ -345,7 +351,7 @@ static void creg_reset(struct rsxx_cardinfo *card) · 14 unmodified lines
345351
346352 card->creg_ctrl.active = 0;
347353 }
348− spin_unlock(&card->creg_ctrl.lock);
354+ spin_unlock_bh(&card->creg_ctrl.lock);
349355
350356 card->creg_ctrl.reset = 0;
351357 spin_lock_irqsave(&card->irq_lock, flags);
@@ -399,12 +405,12 @@ static int __issue_creg_rw(struct rsxx_cardinfo *card, · 47 unmodified lines
399405 return st;
400406
401407 /*
402− * This timeout is neccessary for unresponsive hardware. The additional
408+ * This timeout is necessary for unresponsive hardware. The additional
403409 * 20 seconds to used to guarantee that each cregs requests has time to
404410 * complete.
405411 */
406− timeout = msecs_to_jiffies((CREG_TIMEOUT_MSEC *
407− card->creg_ctrl.q_depth) + 20000);
412+ timeout = msecs_to_jiffies(CREG_TIMEOUT_MSEC *
413+ card->creg_ctrl.q_depth + 20000);
408414
409415 /*
410416 * The creg interface is guaranteed to complete. It has a timeout
@@ -690,6 +696,32 @@ int rsxx_reg_access(struct rsxx_cardinfo *card, · 279 unmodified lines
690696 return 0;
691697 }
692698
699+void rsxx_eeh_save_issued_creg(struct rsxx_cardinfo *card)
700+{
701+ struct creg_cmd *cmd = NULL;
702+
703+ cmd = card->creg_ctrl.active_cmd;
704+ card->creg_ctrl.active_cmd = NULL;
705+
706+ if (cmd) {
707+ del_timer_sync(&card->creg_ctrl.cmd_timer);
708+
709+ spin_lock_bh(&card->creg_ctrl.lock);
710+ list_add(&cmd->list, &card->creg_ctrl.queue);
711+ card->creg_ctrl.q_depth++;
712+ card->creg_ctrl.active = 0;
713+ spin_unlock_bh(&card->creg_ctrl.lock);
714+ }
715+}
716+
717+void rsxx_kick_creg_queue(struct rsxx_cardinfo *card)
718+{
719+ spin_lock_bh(&card->creg_ctrl.lock);
720+ if (!list_empty(&card->creg_ctrl.queue))
721+ creg_kick_queue(card);
722+ spin_unlock_bh(&card->creg_ctrl.lock);
723+}
724+
693725 /*------------ Initialization & Setup --------------*/
694726 int rsxx_creg_setup(struct rsxx_cardinfo *card)
695727 {
@@ -712,7 +744,7 @@ void rsxx_creg_destroy(struct rsxx_cardinfo *card) · 16 unmodified lines
712744 int cnt = 0;
713745
714746 /* Cancel outstanding commands */
715− spin_lock(&card->creg_ctrl.lock);
747+ spin_lock_bh(&card->creg_ctrl.lock);
716748 list_for_each_entry_safe(cmd, tmp, &card->creg_ctrl.queue, list) {
717749 list_del(&cmd->list);
718750 if (cmd->cb)
@@ -737,7 +769,7 @@ void rsxx_creg_destroy(struct rsxx_cardinfo *card) · 18 unmodified lines
737769 "Canceled active creg command\n");
738770 kmem_cache_free(creg_cmd_pool, cmd);
739771 }
740− spin_unlock(&card->creg_ctrl.lock);
772+ spin_unlock_bh(&card->creg_ctrl.lock);
741773
742774 cancel_work_sync(&card->creg_ctrl.done_work);
743775 }
drivers/block/rsxx/dma.c+168−71
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828 struct rsxx_dma {
2929 struct list_head list;
3030 u8 cmd;
31− unsigned int laddr; /* Logical address on the ramsan */
31+ unsigned int laddr; /* Logical address */
3232 struct {
3333 u32 off;
3434 u32 cnt;
@@ -81,9 +81,6 @@ enum rsxx_hw_status { · 46 unmodified lines
8181 HW_STATUS_FAULT = 0x08,
8282 };
8383
84−#define STATUS_BUFFER_SIZE8 4096
85−#define COMMAND_BUFFER_SIZE8 4096
86−
8784 static struct kmem_cache *rsxx_dma_pool;
8885
8986 struct dma_tracker {
@@ -122,7 +119,7 @@ static unsigned int rsxx_get_dma_tgt(struct rsxx_cardinfo *card, u64 addr8) · 32 unmodified lines
122119 return tgt;
123120 }
124121
125−static void rsxx_dma_queue_reset(struct rsxx_cardinfo *card)
122+void rsxx_dma_queue_reset(struct rsxx_cardinfo *card)
126123 {
127124 /* Reset all DMA Command/Status Queues */
128125 iowrite32(DMA_QUEUE_RESET, card->regmap + RESET);
@@ -210,7 +207,8 @@ static void dma_intr_coal_auto_tune(struct rsxx_cardinfo *card) · 81 unmodified lines
210207 u32 q_depth = 0;
211208 u32 intr_coal;
212209
213− if (card->config.data.intr_coal.mode != RSXX_INTR_COAL_AUTO_TUNE)
210+ if (card->config.data.intr_coal.mode != RSXX_INTR_COAL_AUTO_TUNE ||
211+ unlikely(card->eeh_state))
214212 return;
215213
216214 for (i = 0; i < card->n_targets; i++)
@@ -223,31 +221,26 @@ static void dma_intr_coal_auto_tune(struct rsxx_cardinfo *card) · 6 unmodified lines
223221 }
224222
225223 /*----------------- RSXX DMA Handling -------------------*/
226−static void rsxx_complete_dma(struct rsxx_cardinfo *card,
224+static void rsxx_complete_dma(struct rsxx_dma_ctrl *ctrl,
227225 struct rsxx_dma *dma,
228226 unsigned int status)
229227 {
230228 if (status & DMA_SW_ERR)
231− printk_ratelimited(KERN_ERR
232− "SW Error in DMA(cmd x%02x, laddr x%08x)\n",
233− dma->cmd, dma->laddr);
229+ ctrl->stats.dma_sw_err++;
234230 if (status & DMA_HW_FAULT)
235− printk_ratelimited(KERN_ERR
236− "HW Fault in DMA(cmd x%02x, laddr x%08x)\n",
237− dma->cmd, dma->laddr);
231+ ctrl->stats.dma_hw_fault++;
238232 if (status & DMA_CANCELLED)
239− printk_ratelimited(KERN_ERR
240− "DMA Cancelled(cmd x%02x, laddr x%08x)\n",
241− dma->cmd, dma->laddr);
233+ ctrl->stats.dma_cancelled++;
242234
243235 if (dma->dma_addr)
244− pci_unmap_page(card->dev, dma->dma_addr, get_dma_size(dma),
236+ pci_unmap_page(ctrl->card->dev, dma->dma_addr,
237+ get_dma_size(dma),
245238 dma->cmd == HW_CMD_BLK_WRITE ?
246239 PCI_DMA_TODEVICE :
247240 PCI_DMA_FROMDEVICE);
248241
249242 if (dma->cb)
250− dma->cb(card, dma->cb_data, status ? 1 : 0);
243+ dma->cb(ctrl->card, dma->cb_data, status ? 1 : 0);
251244
252245 kmem_cache_free(rsxx_dma_pool, dma);
253246 }
@@ -330,14 +323,15 @@ static void rsxx_handle_dma_error(struct rsxx_dma_ctrl *ctrl, · 76 unmodified lines
330323 if (requeue_cmd)
331324 rsxx_requeue_dma(ctrl, dma);
332325 else
333− rsxx_complete_dma(ctrl->card, dma, status);
326+ rsxx_complete_dma(ctrl, dma, status);
334327 }
335328
336329 static void dma_engine_stalled(unsigned long data)
337330 {
338331 struct rsxx_dma_ctrl *ctrl = (struct rsxx_dma_ctrl *)data;
339332
340− if (atomic_read(&ctrl->stats.hw_q_depth) == 0)
333+ if (atomic_read(&ctrl->stats.hw_q_depth) == 0 ||
334+ unlikely(ctrl->card->eeh_state))
341335 return;
342336
343337 if (ctrl->cmd.idx != ioread32(ctrl->regmap + SW_CMD_IDX)) {
@@ -369,7 +363,8 @@ static void rsxx_issue_dmas(struct work_struct *work) · 25 unmodified lines
369363 ctrl = container_of(work, struct rsxx_dma_ctrl, issue_dma_work);
370364 hw_cmd_buf = ctrl->cmd.buf;
371365
372− if (unlikely(ctrl->card->halt))
366+ if (unlikely(ctrl->card->halt) ||
367+ unlikely(ctrl->card->eeh_state))
373368 return;
374369
375370 while (1) {
@@ -397,7 +392,7 @@ static void rsxx_issue_dmas(struct work_struct *work) · 21 unmodified lines
397392 */
398393 if (unlikely(ctrl->card->dma_fault)) {
399394 push_tracker(ctrl->trackers, tag);
400− rsxx_complete_dma(ctrl->card, dma, DMA_CANCELLED);
395+ rsxx_complete_dma(ctrl, dma, DMA_CANCELLED);
401396 continue;
402397 }
403398
@@ -432,19 +427,15 @@ static void rsxx_issue_dmas(struct work_struct *work) · 28 unmodified lines
432427
433428 /* Let HW know we've queued commands. */
434429 if (cmds_pending) {
435− /*
436− * We must guarantee that the CPU writes to 'ctrl->cmd.buf'
437− * (which is in PCI-consistent system-memory) from the loop
438− * above make it into the coherency domain before the
439− * following PIO "trigger" updating the cmd.idx. A WMB is
440− * sufficient. We need not explicitly CPU cache-flush since
441− * the memory is a PCI-consistent (ie; coherent) mapping.
442− */
443− wmb();
444−
445430 atomic_add(cmds_pending, &ctrl->stats.hw_q_depth);
446431 mod_timer(&ctrl->activity_timer,
447432 jiffies + DMA_ACTIVITY_TIMEOUT);
433+
434+ if (unlikely(ctrl->card->eeh_state)) {
435+ del_timer_sync(&ctrl->activity_timer);
436+ return;
437+ }
438+
448439 iowrite32(ctrl->cmd.idx, ctrl->regmap + SW_CMD_IDX);
449440 }
450441 }
@@ -463,7 +454,8 @@ static void rsxx_dma_done(struct work_struct *work) · 12 unmodified lines
463454 hw_st_buf = ctrl->status.buf;
464455
465456 if (unlikely(ctrl->card->halt) ||
466− unlikely(ctrl->card->dma_fault))
457+ unlikely(ctrl->card->dma_fault) ||
458+ unlikely(ctrl->card->eeh_state))
467459 return;
468460
469461 count = le16_to_cpu(hw_st_buf[ctrl->status.idx].count);
@@ -508,7 +500,7 @@ static void rsxx_dma_done(struct work_struct *work) · 38 unmodified lines
508500 if (status)
509501 rsxx_handle_dma_error(ctrl, dma, status);
510502 else
511− rsxx_complete_dma(ctrl->card, dma, 0);
503+ rsxx_complete_dma(ctrl, dma, 0);
512504
513505 push_tracker(ctrl->trackers, tag);
514506
@@ -727,20 +719,54 @@ bvec_err: · 212 unmodified lines
727719
728720
729721 /*----------------- DMA Engine Initialization & Setup -------------------*/
722+int rsxx_hw_buffers_init(struct pci_dev *dev, struct rsxx_dma_ctrl *ctrl)
723+{
724+ ctrl->status.buf = pci_alloc_consistent(dev, STATUS_BUFFER_SIZE8,
725+ &ctrl->status.dma_addr);
726+ ctrl->cmd.buf = pci_alloc_consistent(dev, COMMAND_BUFFER_SIZE8,
727+ &ctrl->cmd.dma_addr);
728+ if (ctrl->status.buf == NULL || ctrl->cmd.buf == NULL)
729+ return -ENOMEM;
730+
731+ memset(ctrl->status.buf, 0xac, STATUS_BUFFER_SIZE8);
732+ iowrite32(lower_32_bits(ctrl->status.dma_addr),
733+ ctrl->regmap + SB_ADD_LO);
734+ iowrite32(upper_32_bits(ctrl->status.dma_addr),
735+ ctrl->regmap + SB_ADD_HI);
736+
737+ memset(ctrl->cmd.buf, 0x83, COMMAND_BUFFER_SIZE8);
738+ iowrite32(lower_32_bits(ctrl->cmd.dma_addr), ctrl->regmap + CB_ADD_LO);
739+ iowrite32(upper_32_bits(ctrl->cmd.dma_addr), ctrl->regmap + CB_ADD_HI);
740+
741+ ctrl->status.idx = ioread32(ctrl->regmap + HW_STATUS_CNT);
742+ if (ctrl->status.idx > RSXX_MAX_OUTSTANDING_CMDS) {
743+ dev_crit(&dev->dev, "Failed reading status cnt x%x\n",
744+ ctrl->status.idx);
745+ return -EINVAL;
746+ }
747+ iowrite32(ctrl->status.idx, ctrl->regmap + HW_STATUS_CNT);
748+ iowrite32(ctrl->status.idx, ctrl->regmap + SW_STATUS_CNT);
749+
750+ ctrl->cmd.idx = ioread32(ctrl->regmap + HW_CMD_IDX);
751+ if (ctrl->cmd.idx > RSXX_MAX_OUTSTANDING_CMDS) {
752+ dev_crit(&dev->dev, "Failed reading cmd cnt x%x\n",
753+ ctrl->status.idx);
754+ return -EINVAL;
755+ }
756+ iowrite32(ctrl->cmd.idx, ctrl->regmap + HW_CMD_IDX);
757+ iowrite32(ctrl->cmd.idx, ctrl->regmap + SW_CMD_IDX);
758+
759+ return 0;
760+}
761+
730762 static int rsxx_dma_ctrl_init(struct pci_dev *dev,
731763 struct rsxx_dma_ctrl *ctrl)
732764 {
733765 int i;
766+ int st;
734767
735768 memset(&ctrl->stats, 0, sizeof(ctrl->stats));
736769
737− ctrl->status.buf = pci_alloc_consistent(dev, STATUS_BUFFER_SIZE8,
738− &ctrl->status.dma_addr);
739− ctrl->cmd.buf = pci_alloc_consistent(dev, COMMAND_BUFFER_SIZE8,
740− &ctrl->cmd.dma_addr);
741− if (ctrl->status.buf == NULL || ctrl->cmd.buf == NULL)
742− return -ENOMEM;
743−
744770 ctrl->trackers = vmalloc(DMA_TRACKER_LIST_SIZE8);
745771 if (!ctrl->trackers)
746772 return -ENOMEM;
@@ -770,35 +796,9 @@ static int rsxx_dma_ctrl_init(struct pci_dev *dev, · 23 unmodified lines
770796 INIT_WORK(&ctrl->issue_dma_work, rsxx_issue_dmas);
771797 INIT_WORK(&ctrl->dma_done_work, rsxx_dma_done);
772798
773− memset(ctrl->status.buf, 0xac, STATUS_BUFFER_SIZE8);
774− iowrite32(lower_32_bits(ctrl->status.dma_addr),
775− ctrl->regmap + SB_ADD_LO);
776− iowrite32(upper_32_bits(ctrl->status.dma_addr),
777− ctrl->regmap + SB_ADD_HI);
778−
779− memset(ctrl->cmd.buf, 0x83, COMMAND_BUFFER_SIZE8);
780− iowrite32(lower_32_bits(ctrl->cmd.dma_addr), ctrl->regmap + CB_ADD_LO);
781− iowrite32(upper_32_bits(ctrl->cmd.dma_addr), ctrl->regmap + CB_ADD_HI);
782−
783− ctrl->status.idx = ioread32(ctrl->regmap + HW_STATUS_CNT);
784− if (ctrl->status.idx > RSXX_MAX_OUTSTANDING_CMDS) {
785− dev_crit(&dev->dev, "Failed reading status cnt x%x\n",
786− ctrl->status.idx);
787− return -EINVAL;
788− }
789− iowrite32(ctrl->status.idx, ctrl->regmap + HW_STATUS_CNT);
790− iowrite32(ctrl->status.idx, ctrl->regmap + SW_STATUS_CNT);
791−
792− ctrl->cmd.idx = ioread32(ctrl->regmap + HW_CMD_IDX);
793− if (ctrl->cmd.idx > RSXX_MAX_OUTSTANDING_CMDS) {
794− dev_crit(&dev->dev, "Failed reading cmd cnt x%x\n",
795− ctrl->status.idx);
796− return -EINVAL;
797− }
798− iowrite32(ctrl->cmd.idx, ctrl->regmap + HW_CMD_IDX);
799− iowrite32(ctrl->cmd.idx, ctrl->regmap + SW_CMD_IDX);
800−
801− wmb();
799+ st = rsxx_hw_buffers_init(dev, ctrl);
800+ if (st)
801+ return st;
802802
803803 return 0;
804804 }
@@ -834,7 +834,7 @@ static int rsxx_dma_stripe_setup(struct rsxx_cardinfo *card, · 29 unmodified lines
834834 return 0;
835835 }
836836
837−static int rsxx_dma_configure(struct rsxx_cardinfo *card)
837+int rsxx_dma_configure(struct rsxx_cardinfo *card)
838838 {
839839 u32 intr_coal;
840840
@@ -980,6 +980,103 @@ void rsxx_dma_destroy(struct rsxx_cardinfo *card) · 139 unmodified lines
980980 }
981981 }
982982
983+int rsxx_eeh_save_issued_dmas(struct rsxx_cardinfo *card)
984+{
985+ int i;
986+ int j;
987+ int cnt;
988+ struct rsxx_dma *dma;
989+ struct list_head *issued_dmas;
990+
991+ issued_dmas = kzalloc(sizeof(*issued_dmas) * card->n_targets,
992+ GFP_KERNEL);
993+ if (!issued_dmas)
994+ return -ENOMEM;
995+
996+ for (i = 0; i < card->n_targets; i++) {
997+ INIT_LIST_HEAD(&issued_dmas[i]);
998+ cnt = 0;
999+ for (j = 0; j < RSXX_MAX_OUTSTANDING_CMDS; j++) {
1000+ dma = get_tracker_dma(card->ctrl[i].trackers, j);
1001+ if (dma == NULL)
1002+ continue;
1003+
1004+ if (dma->cmd == HW_CMD_BLK_WRITE)
1005+ card->ctrl[i].stats.writes_issued--;
1006+ else if (dma->cmd == HW_CMD_BLK_DISCARD)
1007+ card->ctrl[i].stats.discards_issued--;
1008+ else
1009+ card->ctrl[i].stats.reads_issued--;
1010+
1011+ list_add_tail(&dma->list, &issued_dmas[i]);
1012+ push_tracker(card->ctrl[i].trackers, j);
1013+ cnt++;
1014+ }
1015+
1016+ spin_lock(&card->ctrl[i].queue_lock);
1017+ list_splice(&issued_dmas[i], &card->ctrl[i].queue);
1018+
1019+ atomic_sub(cnt, &card->ctrl[i].stats.hw_q_depth);
1020+ card->ctrl[i].stats.sw_q_depth += cnt;
1021+ card->ctrl[i].e_cnt = 0;
1022+
1023+ list_for_each_entry(dma, &card->ctrl[i].queue, list) {
1024+ if (dma->dma_addr)
1025+ pci_unmap_page(card->dev, dma->dma_addr,
1026+ get_dma_size(dma),
1027+ dma->cmd == HW_CMD_BLK_WRITE ?
1028+ PCI_DMA_TODEVICE :
1029+ PCI_DMA_FROMDEVICE);
1030+ }
1031+ spin_unlock(&card->ctrl[i].queue_lock);
1032+ }
1033+
1034+ kfree(issued_dmas);
1035+
1036+ return 0;
1037+}
1038+
1039+void rsxx_eeh_cancel_dmas(struct rsxx_cardinfo *card)
1040+{
1041+ struct rsxx_dma *dma;
1042+ struct rsxx_dma *tmp;
1043+ int i;
1044+
1045+ for (i = 0; i < card->n_targets; i++) {
1046+ spin_lock(&card->ctrl[i].queue_lock);
1047+ list_for_each_entry_safe(dma, tmp, &card->ctrl[i].queue, list) {
1048+ list_del(&dma->list);
1049+
1050+ rsxx_complete_dma(&card->ctrl[i], dma, DMA_CANCELLED);
1051+ }
1052+ spin_unlock(&card->ctrl[i].queue_lock);
1053+ }
1054+}
1055+
1056+int rsxx_eeh_remap_dmas(struct rsxx_cardinfo *card)
1057+{
1058+ struct rsxx_dma *dma;
1059+ int i;
1060+
1061+ for (i = 0; i < card->n_targets; i++) {
1062+ spin_lock(&card->ctrl[i].queue_lock);
1063+ list_for_each_entry(dma, &card->ctrl[i].queue, list) {
1064+ dma->dma_addr = pci_map_page(card->dev, dma->page,
1065+ dma->pg_off, get_dma_size(dma),
1066+ dma->cmd == HW_CMD_BLK_WRITE ?
1067+ PCI_DMA_TODEVICE :
1068+ PCI_DMA_FROMDEVICE);
1069+ if (!dma->dma_addr) {
1070+ spin_unlock(&card->ctrl[i].queue_lock);
1071+ kmem_cache_free(rsxx_dma_pool, dma);
1072+ return -ENOMEM;
1073+ }
1074+ }
1075+ spin_unlock(&card->ctrl[i].queue_lock);
1076+ }
1077+
1078+ return 0;
1079+}
9831080
9841081 int rsxx_dma_init(void)
9851082 {
drivers/block/rsxx/rsxx.h+4−2
@@ -27,15 +27,17 @@ · 26 unmodified lines
2727
2828 /*----------------- IOCTL Definitions -------------------*/
2929
30+#define RSXX_MAX_DATA 8
31+
3032 struct rsxx_reg_access {
3133 __u32 addr;
3234 __u32 cnt;
3335 __u32 stat;
3436 __u32 stream;
35− __u32 data[8];
37+ __u32 data[RSXX_MAX_DATA];
3638 };
3739
38−#define RSXX_MAX_REG_CNT (8 * (sizeof(__u32)))
40+#define RSXX_MAX_REG_CNT (RSXX_MAX_DATA * (sizeof(__u32)))
3941
4042 #define RSXX_IOC_MAGIC 'r'
4143
drivers/block/rsxx/rsxx_cfg.h+1−1
@@ -58,7 +58,7 @@ struct rsxx_card_cfg { · 57 unmodified lines
5858 };
5959
6060 /* Vendor ID Values */
61−#define RSXX_VENDOR_ID_TMS_IBM 0
61+#define RSXX_VENDOR_ID_IBM 0
6262 #define RSXX_VENDOR_ID_DSI 1
6363 #define RSXX_VENDOR_COUNT 2
6464
drivers/block/rsxx/rsxx_priv.h+27−7
@@ -45,16 +45,13 @@ · 44 unmodified lines
4545
4646 struct proc_cmd;
4747
48−#define PCI_VENDOR_ID_TMS_IBM 0x15B6
49−#define PCI_DEVICE_ID_RS70_FLASH 0x0019
50−#define PCI_DEVICE_ID_RS70D_FLASH 0x001A
51−#define PCI_DEVICE_ID_RS80_FLASH 0x001C
52−#define PCI_DEVICE_ID_RS81_FLASH 0x001E
48+#define PCI_DEVICE_ID_FS70_FLASH 0x04A9
49+#define PCI_DEVICE_ID_FS80_FLASH 0x04AA
5350
5451 #define RS70_PCI_REV_SUPPORTED 4
5552
5653 #define DRIVER_NAME "rsxx"
57−#define DRIVER_VERSION "3.7"
54+#define DRIVER_VERSION "4.0"
5855
5956 /* Block size is 4096 */
6057 #define RSXX_HW_BLK_SHIFT 12
@@ -67,6 +64,9 @@ struct proc_cmd; · 6 unmodified lines
6764 #define RSXX_MAX_OUTSTANDING_CMDS 255
6865 #define RSXX_CS_IDX_MASK 0xff
6966
67+#define STATUS_BUFFER_SIZE8 4096
68+#define COMMAND_BUFFER_SIZE8 4096
69+
7070 #define RSXX_MAX_TARGETS 8
7171
7272 struct dma_tracker_list;
@@ -91,6 +91,9 @@ struct rsxx_dma_stats { · 18 unmodified lines
9191 u32 discards_failed;
9292 u32 done_rescheduled;
9393 u32 issue_rescheduled;
94+ u32 dma_sw_err;
95+ u32 dma_hw_fault;
96+ u32 dma_cancelled;
9497 u32 sw_q_depth; /* Number of DMAs on the SW queue. */
9598 atomic_t hw_q_depth; /* Number of DMAs queued to HW. */
9699 };
@@ -116,6 +119,7 @@ struct rsxx_dma_ctrl { · 19 unmodified lines
116119 struct rsxx_cardinfo {
117120 struct pci_dev *dev;
118121 unsigned int halt;
122+ unsigned int eeh_state;
119123
120124 void __iomem *regmap;
121125 spinlock_t irq_lock;
@@ -224,6 +228,7 @@ enum rsxx_pci_regmap { · 102 unmodified lines
224228 PERF_RD512_HI = 0xac,
225229 PERF_WR512_LO = 0xb0,
226230 PERF_WR512_HI = 0xb4,
231+ PCI_RECONFIG = 0xb8,
227232 };
228233
229234 enum rsxx_intr {
@@ -237,6 +242,8 @@ enum rsxx_intr { · 7 unmodified lines
237242 CR_INTR_DMA5 = 0x00000080,
238243 CR_INTR_DMA6 = 0x00000100,
239244 CR_INTR_DMA7 = 0x00000200,
245+ CR_INTR_ALL_C = 0x0000003f,
246+ CR_INTR_ALL_G = 0x000003ff,
240247 CR_INTR_DMA_ALL = 0x000003f5,
241248 CR_INTR_ALL = 0xffffffff,
242249 };
@@ -253,8 +260,14 @@ enum rsxx_pci_reset { · 10 unmodified lines
253260 DMA_QUEUE_RESET = 0x00000001,
254261 };
255262
263+enum rsxx_hw_fifo_flush {
264+ RSXX_FLUSH_BUSY = 0x00000002,
265+ RSXX_FLUSH_TIMEOUT = 0x00000004,
266+};
267+
256268 enum rsxx_pci_revision {
257269 RSXX_DISCARD_SUPPORT = 2,
270+ RSXX_EEH_SUPPORT = 3,
258271 };
259272
260273 enum rsxx_creg_cmd {
@@ -360,11 +373,17 @@ int rsxx_dma_setup(struct rsxx_cardinfo *card); · 99 unmodified lines
360373 void rsxx_dma_destroy(struct rsxx_cardinfo *card);
361374 int rsxx_dma_init(void);
362375 void rsxx_dma_cleanup(void);
376+void rsxx_dma_queue_reset(struct rsxx_cardinfo *card);
377+int rsxx_dma_configure(struct rsxx_cardinfo *card);
363378 int rsxx_dma_queue_bio(struct rsxx_cardinfo *card,
364379 struct bio *bio,
365380 atomic_t *n_dmas,
366381 rsxx_dma_cb cb,
367382 void *cb_data);
383+int rsxx_hw_buffers_init(struct pci_dev *dev, struct rsxx_dma_ctrl *ctrl);
384+int rsxx_eeh_save_issued_dmas(struct rsxx_cardinfo *card);
385+void rsxx_eeh_cancel_dmas(struct rsxx_cardinfo *card);
386+int rsxx_eeh_remap_dmas(struct rsxx_cardinfo *card);
368387
369388 /***** cregs.c *****/
370389 int rsxx_creg_write(struct rsxx_cardinfo *card, u32 addr,
@@ -389,10 +408,11 @@ int rsxx_creg_setup(struct rsxx_cardinfo *card); · 18 unmodified lines
389408 void rsxx_creg_destroy(struct rsxx_cardinfo *card);
390409 int rsxx_creg_init(void);
391410 void rsxx_creg_cleanup(void);
392−
393411 int rsxx_reg_access(struct rsxx_cardinfo *card,
394412 struct rsxx_reg_access __user *ucmd,
395413 int read);
414+void rsxx_eeh_save_issued_creg(struct rsxx_cardinfo *card);
415+void rsxx_kick_creg_queue(struct rsxx_cardinfo *card);
396416
397417
398418
drivers/block/xen-blkback/blkback.c+39−29
@@ -164,7 +164,7 @@ static void make_response(struct xen_blkif *blkif, u64 id, · 163 unmodified lines
164164
165165 #define foreach_grant_safe(pos, n, rbtree, node) \
166166 for ((pos) = container_of(rb_first((rbtree)), typeof(*(pos)), node), \
167− (n) = rb_next(&(pos)->node); \
167+ (n) = (&(pos)->node != NULL) ? rb_next(&(pos)->node) : NULL; \
168168 &(pos)->node != NULL; \
169169 (pos) = container_of(n, typeof(*(pos)), node), \
170170 (n) = (&(pos)->node != NULL) ? rb_next(&(pos)->node) : NULL)
@@ -381,8 +381,8 @@ irqreturn_t xen_blkif_be_int(int irq, void *dev_id) · 210 unmodified lines
381381
382382 static void print_stats(struct xen_blkif *blkif)
383383 {
384− pr_info("xen-blkback (%s): oo %3d | rd %4d | wr %4d | f %4d"
385− " | ds %4d\n",
384+ pr_info("xen-blkback (%s): oo %3llu | rd %4llu | wr %4llu | f %4llu"
385+ " | ds %4llu\n",
386386 current->comm, blkif->st_oo_req,
387387 blkif->st_rd_req, blkif->st_wr_req,
388388 blkif->st_f_req, blkif->st_ds_req);
@@ -442,7 +442,7 @@ int xen_blkif_schedule(void *arg) · 53 unmodified lines
442442 }
443443
444444 struct seg_buf {
445− unsigned long buf;
445+ unsigned int offset;
446446 unsigned int nsec;
447447 };
448448 /*
@@ -621,30 +621,21 @@ static int xen_blkbk_map(struct blkif_request *req, · 172 unmodified lines
621621 * If this is a new persistent grant
622622 * save the handler
623623 */
624− persistent_gnts[i]->handle = map[j].handle;
625− persistent_gnts[i]->dev_bus_addr =
626− map[j++].dev_bus_addr;
624+ persistent_gnts[i]->handle = map[j++].handle;
627625 }
628626 pending_handle(pending_req, i) =
629627 persistent_gnts[i]->handle;
630628
631629 if (ret)
632630 continue;
633−
634− seg[i].buf = persistent_gnts[i]->dev_bus_addr |
635− (req->u.rw.seg[i].first_sect << 9);
636631 } else {
637− pending_handle(pending_req, i) = map[j].handle;
632+ pending_handle(pending_req, i) = map[j++].handle;
638633 bitmap_set(pending_req->unmap_seg, i, 1);
639634
640− if (ret) {
641− j++;
635+ if (ret)
642636 continue;
643− }
644−
645− seg[i].buf = map[j++].dev_bus_addr |
646− (req->u.rw.seg[i].first_sect << 9);
647637 }
638+ seg[i].offset = (req->u.rw.seg[i].first_sect << 9);
648639 }
649640 return ret;
650641 }
@@ -679,6 +670,16 @@ static int dispatch_discard_io(struct xen_blkif *blkif, · 28 unmodified lines
679670 return err;
680671 }
681672
673+static int dispatch_other_io(struct xen_blkif *blkif,
674+ struct blkif_request *req,
675+ struct pending_req *pending_req)
676+{
677+ free_req(pending_req);
678+ make_response(blkif, req->u.other.id, req->operation,
679+ BLKIF_RSP_EOPNOTSUPP);
680+ return -EIO;
681+}
682+
682683 static void xen_blk_drain_io(struct xen_blkif *blkif)
683684 {
684685 atomic_set(&blkif->drain, 1);
@@ -800,17 +801,30 @@ __do_block_io_op(struct xen_blkif *blkif) · 115 unmodified lines
800801
801802 /* Apply all sanity checks to /private copy/ of request. */
802803 barrier();
803− if (unlikely(req.operation == BLKIF_OP_DISCARD)) {
804+
805+ switch (req.operation) {
806+ case BLKIF_OP_READ:
807+ case BLKIF_OP_WRITE:
808+ case BLKIF_OP_WRITE_BARRIER:
809+ case BLKIF_OP_FLUSH_DISKCACHE:
810+ if (dispatch_rw_block_io(blkif, &req, pending_req))
811+ goto done;
812+ break;
813+ case BLKIF_OP_DISCARD:
804814 free_req(pending_req);
805815 if (dispatch_discard_io(blkif, &req))
806− break;
807− } else if (dispatch_rw_block_io(blkif, &req, pending_req))
816+ goto done;
808817 break;
818+ default:
819+ if (dispatch_other_io(blkif, &req, pending_req))
820+ goto done;
821+ break;
822+ }
809823
810824 /* Yield point for this unbounded loop. */
811825 cond_resched();
812826 }
813−
827+done:
814828 return more_to_do;
815829 }
816830
@@ -904,7 +918,8 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif, · 87 unmodified lines
904918 pr_debug(DRV_PFX "access denied: %s of [%llu,%llu] on dev=%04x\n",
905919 operation == READ ? "read" : "write",
906920 preq.sector_number,
907− preq.sector_number + preq.nr_sects, preq.dev);
921+ preq.sector_number + preq.nr_sects,
922+ blkif->vbd.pdevice);
908923 goto fail_response;
909924 }
910925
@@ -947,7 +962,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif, · 36 unmodified lines
947962 (bio_add_page(bio,
948963 pages[i],
949964 seg[i].nsec << 9,
950− seg[i].buf & ~PAGE_MASK) == 0)) {
965+ seg[i].offset) == 0)) {
951966
952967 bio = bio_alloc(GFP_KERNEL, nseg-i);
953968 if (unlikely(bio == NULL))
@@ -977,13 +992,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif, · 23 unmodified lines
977992 bio->bi_end_io = end_block_io_op;
978993 }
979994
980− /*
981− * We set it one so that the last submit_bio does not have to call
982− * atomic_inc.
983− */
984995 atomic_set(&pending_req->pendcnt, nbio);
985−
986− /* Get a reference count for the disk queue and start sending I/O */
987996 blk_start_plug(&plug);
988997
989998 for (i = 0; i < nbio; i++)
@@ -1011,6 +1020,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif, · 21 unmodified lines
10111020 fail_put_bio:
10121021 for (i = 0; i < nbio; i++)
10131022 bio_put(biolist[i]);
1023+ atomic_set(&pending_req->pendcnt, 1);
10141024 __end_block_io_op(pending_req, -EINVAL);
10151025 msleep(1); /* back off a bit */
10161026 return -EIO;
drivers/block/xen-blkback/common.h+32−8
@@ -77,11 +77,18 @@ struct blkif_x86_32_request_discard { · 76 unmodified lines
7777 uint64_t nr_sectors;
7878 } __attribute__((__packed__));
7979
80+struct blkif_x86_32_request_other {
81+ uint8_t _pad1;
82+ blkif_vdev_t _pad2;
83+ uint64_t id; /* private guest value, echoed in resp */
84+} __attribute__((__packed__));
85+
8086 struct blkif_x86_32_request {
8187 uint8_t operation; /* BLKIF_OP_??? */
8288 union {
8389 struct blkif_x86_32_request_rw rw;
8490 struct blkif_x86_32_request_discard discard;
91+ struct blkif_x86_32_request_other other;
8592 } u;
8693 } __attribute__((__packed__));
8794
@@ -113,11 +120,19 @@ struct blkif_x86_64_request_discard { · 25 unmodified lines
113120 uint64_t nr_sectors;
114121 } __attribute__((__packed__));
115122
123+struct blkif_x86_64_request_other {
124+ uint8_t _pad1;
125+ blkif_vdev_t _pad2;
126+ uint32_t _pad3; /* offsetof(blkif_..,u.discard.id)==8 */
127+ uint64_t id; /* private guest value, echoed in resp */
128+} __attribute__((__packed__));
129+
116130 struct blkif_x86_64_request {
117131 uint8_t operation; /* BLKIF_OP_??? */
118132 union {
119133 struct blkif_x86_64_request_rw rw;
120134 struct blkif_x86_64_request_discard discard;
135+ struct blkif_x86_64_request_other other;
121136 } u;
122137 } __attribute__((__packed__));
123138
@@ -172,7 +187,6 @@ struct persistent_gnt { · 48 unmodified lines
172187 struct page *page;
173188 grant_ref_t gnt;
174189 grant_handle_t handle;
175− uint64_t dev_bus_addr;
176190 struct rb_node node;
177191 };
178192
@@ -208,13 +222,13 @@ struct xen_blkif { · 29 unmodified lines
208222
209223 /* statistics */
210224 unsigned long st_print;
211− int st_rd_req;
212− int st_wr_req;
213− int st_oo_req;
214− int st_f_req;
215− int st_ds_req;
216− int st_rd_sect;
217− int st_wr_sect;
225+ unsigned long long st_rd_req;
226+ unsigned long long st_wr_req;
227+ unsigned long long st_oo_req;
228+ unsigned long long st_f_req;
229+ unsigned long long st_ds_req;
230+ unsigned long long st_rd_sect;
231+ unsigned long long st_wr_sect;
218232
219233 wait_queue_head_t waiting_to_free;
220234 };
@@ -278,6 +292,11 @@ static inline void blkif_get_x86_32_req(struct blkif_request *dst, · 57 unmodified lines
278292 dst->u.discard.nr_sectors = src->u.discard.nr_sectors;
279293 break;
280294 default:
295+ /*
296+ * Don't know how to translate this op. Only get the
297+ * ID so failure can be reported to the frontend.
298+ */
299+ dst->u.other.id = src->u.other.id;
281300 break;
282301 }
283302 }
@@ -309,6 +328,11 @@ static inline void blkif_get_x86_64_req(struct blkif_request *dst, · 25 unmodified lines
309328 dst->u.discard.nr_sectors = src->u.discard.nr_sectors;
310329 break;
311330 default:
331+ /*
332+ * Don't know how to translate this op. Only get the
333+ * ID so failure can be reported to the frontend.
334+ */
335+ dst->u.other.id = src->u.other.id;
312336 break;
313337 }
314338 }
drivers/block/xen-blkback/xenbus.c+7−7
@@ -230,13 +230,13 @@ int __init xen_blkif_interface_init(void) · 229 unmodified lines
230230 } \
231231 static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL)
232232
233−VBD_SHOW(oo_req, "%d\n", be->blkif->st_oo_req);
234−VBD_SHOW(rd_req, "%d\n", be->blkif->st_rd_req);
235−VBD_SHOW(wr_req, "%d\n", be->blkif->st_wr_req);
236−VBD_SHOW(f_req, "%d\n", be->blkif->st_f_req);
237−VBD_SHOW(ds_req, "%d\n", be->blkif->st_ds_req);
238−VBD_SHOW(rd_sect, "%d\n", be->blkif->st_rd_sect);
239−VBD_SHOW(wr_sect, "%d\n", be->blkif->st_wr_sect);
233+VBD_SHOW(oo_req, "%llu\n", be->blkif->st_oo_req);
234+VBD_SHOW(rd_req, "%llu\n", be->blkif->st_rd_req);
235+VBD_SHOW(wr_req, "%llu\n", be->blkif->st_wr_req);
236+VBD_SHOW(f_req, "%llu\n", be->blkif->st_f_req);
237+VBD_SHOW(ds_req, "%llu\n", be->blkif->st_ds_req);
238+VBD_SHOW(rd_sect, "%llu\n", be->blkif->st_rd_sect);
239+VBD_SHOW(wr_sect, "%llu\n", be->blkif->st_wr_sect);
240240
241241 static struct attribute *xen_vbdstat_attrs[] = {
242242 &dev_attr_oo_req.attr,
drivers/block/xen-blkfront.c+91−63
@@ -44,7 +44,7 @@ · 43 unmodified lines
4444 #include <linux/mutex.h>
4545 #include <linux/scatterlist.h>
4646 #include <linux/bitmap.h>
47−#include <linux/llist.h>
47+#include <linux/list.h>
4848
4949 #include <xen/xen.h>
5050 #include <xen/xenbus.h>
@@ -68,13 +68,12 @@ enum blkif_state { · 17 unmodified lines
6868 struct grant {
6969 grant_ref_t gref;
7070 unsigned long pfn;
71− struct llist_node node;
71+ struct list_head node;
7272 };
7373
7474 struct blk_shadow {
7575 struct blkif_request req;
7676 struct request *request;
77− unsigned long frame[BLKIF_MAX_SEGMENTS_PER_REQUEST];
7877 struct grant *grants_used[BLKIF_MAX_SEGMENTS_PER_REQUEST];
7978 };
8079
@@ -105,7 +104,7 @@ struct blkfront_info · 24 unmodified lines
105104 struct work_struct work;
106105 struct gnttab_free_callback callback;
107106 struct blk_shadow shadow[BLK_RING_SIZE];
108− struct llist_head persistent_gnts;
107+ struct list_head persistent_gnts;
109108 unsigned int persistent_gnts_c;
110109 unsigned long shadow_free;
111110 unsigned int feature_flush;
@@ -165,6 +164,69 @@ static int add_id_to_freelist(struct blkfront_info *info, · 53 unmodified lines
165164 return 0;
166165 }
167166
167+static int fill_grant_buffer(struct blkfront_info *info, int num)
168+{
169+ struct page *granted_page;
170+ struct grant *gnt_list_entry, *n;
171+ int i = 0;
172+
173+ while(i < num) {
174+ gnt_list_entry = kzalloc(sizeof(struct grant), GFP_NOIO);
175+ if (!gnt_list_entry)
176+ goto out_of_memory;
177+
178+ granted_page = alloc_page(GFP_NOIO);
179+ if (!granted_page) {
180+ kfree(gnt_list_entry);
181+ goto out_of_memory;
182+ }
183+
184+ gnt_list_entry->pfn = page_to_pfn(granted_page);
185+ gnt_list_entry->gref = GRANT_INVALID_REF;
186+ list_add(&gnt_list_entry->node, &info->persistent_gnts);
187+ i++;
188+ }
189+
190+ return 0;
191+
192+out_of_memory:
193+ list_for_each_entry_safe(gnt_list_entry, n,
194+ &info->persistent_gnts, node) {
195+ list_del(&gnt_list_entry->node);
196+ __free_page(pfn_to_page(gnt_list_entry->pfn));
197+ kfree(gnt_list_entry);
198+ i--;
199+ }
200+ BUG_ON(i != 0);
201+ return -ENOMEM;
202+}
203+
204+static struct grant *get_grant(grant_ref_t *gref_head,
205+ struct blkfront_info *info)
206+{
207+ struct grant *gnt_list_entry;
208+ unsigned long buffer_mfn;
209+
210+ BUG_ON(list_empty(&info->persistent_gnts));
211+ gnt_list_entry = list_first_entry(&info->persistent_gnts, struct grant,
212+ node);
213+ list_del(&gnt_list_entry->node);
214+
215+ if (gnt_list_entry->gref != GRANT_INVALID_REF) {
216+ info->persistent_gnts_c--;
217+ return gnt_list_entry;
218+ }
219+
220+ /* Assign a gref to this page */
221+ gnt_list_entry->gref = gnttab_claim_grant_reference(gref_head);
222+ BUG_ON(gnt_list_entry->gref == -ENOSPC);
223+ buffer_mfn = pfn_to_mfn(gnt_list_entry->pfn);
224+ gnttab_grant_foreign_access_ref(gnt_list_entry->gref,
225+ info->xbdev->otherend_id,
226+ buffer_mfn, 0);
227+ return gnt_list_entry;
228+}
229+
168230 static const char *op_name(int op)
169231 {
170232 static const char *const names[] = {
@@ -293,7 +355,6 @@ static int blkif_ioctl(struct block_device *bdev, fmode_t mode, · 122 unmodified lines
293355 static int blkif_queue_request(struct request *req)
294356 {
295357 struct blkfront_info *info = req->rq_disk->private_data;
296− unsigned long buffer_mfn;
297358 struct blkif_request *ring_req;
298359 unsigned long id;
299360 unsigned int fsect, lsect;
@@ -306,7 +367,6 @@ static int blkif_queue_request(struct request *req) · 6 unmodified lines
306367 */
307368 bool new_persistent_gnts;
308369 grant_ref_t gref_head;
309− struct page *granted_page;
310370 struct grant *gnt_list_entry = NULL;
311371 struct scatterlist *sg;
312372
@@ -370,41 +430,8 @@ static int blkif_queue_request(struct request *req) · 57 unmodified lines
370430 fsect = sg->offset >> 9;
371431 lsect = fsect + (sg->length >> 9) - 1;
372432
373− if (info->persistent_gnts_c) {
374− BUG_ON(llist_empty(&info->persistent_gnts));
375− gnt_list_entry = llist_entry(
376− llist_del_first(&info->persistent_gnts),
377− struct grant, node);
378−
379− ref = gnt_list_entry->gref;
380− buffer_mfn = pfn_to_mfn(gnt_list_entry->pfn);
381− info->persistent_gnts_c--;
382− } else {
383− ref = gnttab_claim_grant_reference(&gref_head);
384− BUG_ON(ref == -ENOSPC);
385−
386− gnt_list_entry =
387− kmalloc(sizeof(struct grant),
388− GFP_ATOMIC);
389− if (!gnt_list_entry)
390− return -ENOMEM;
391−
392− granted_page = alloc_page(GFP_ATOMIC);
393− if (!granted_page) {
394− kfree(gnt_list_entry);
395− return -ENOMEM;
396− }
397−
398− gnt_list_entry->pfn =
399− page_to_pfn(granted_page);
400− gnt_list_entry->gref = ref;
401−
402− buffer_mfn = pfn_to_mfn(page_to_pfn(
403− granted_page));
404− gnttab_grant_foreign_access_ref(ref,
405− info->xbdev->otherend_id,
406− buffer_mfn, 0);
407− }
433+ gnt_list_entry = get_grant(&gref_head, info);
434+ ref = gnt_list_entry->gref;
408435
409436 info->shadow[id].grants_used[i] = gnt_list_entry;
410437
@@ -435,7 +462,6 @@ static int blkif_queue_request(struct request *req) · 24 unmodified lines
435462 kunmap_atomic(shared_data);
436463 }
437464
438− info->shadow[id].frame[i] = mfn_to_pfn(buffer_mfn);
439465 ring_req->u.rw.seg[i] =
440466 (struct blkif_request_segment) {
441467 .gref = ref,
@@ -790,9 +816,8 @@ static void blkif_restart_queue(struct work_struct *work) · 348 unmodified lines
790816
791817 static void blkif_free(struct blkfront_info *info, int suspend)
792818 {
793− struct llist_node *all_gnts;
794− struct grant *persistent_gnt, *tmp;
795− struct llist_node *n;
819+ struct grant *persistent_gnt;
820+ struct grant *n;
796821
797822 /* Prevent new requests being issued until we fix things up. */
798823 spin_lock_irq(&info->io_lock);
@@ -803,22 +828,20 @@ static void blkif_free(struct blkfront_info *info, int suspend) · 4 unmodified lines
803828 blk_stop_queue(info->rq);
804829
805830 /* Remove all persistent grants */
806− if (info->persistent_gnts_c) {
807− all_gnts = llist_del_all(&info->persistent_gnts);
808− persistent_gnt = llist_entry(all_gnts, typeof(*(persistent_gnt)), node);
809− while (persistent_gnt) {
810− gnttab_end_foreign_access(persistent_gnt->gref, 0, 0UL);
831+ if (!list_empty(&info->persistent_gnts)) {
832+ list_for_each_entry_safe(persistent_gnt, n,
833+ &info->persistent_gnts, node) {
834+ list_del(&persistent_gnt->node);
835+ if (persistent_gnt->gref != GRANT_INVALID_REF) {
836+ gnttab_end_foreign_access(persistent_gnt->gref,
837+ 0, 0UL);
838+ info->persistent_gnts_c--;
839+ }
811840 __free_page(pfn_to_page(persistent_gnt->pfn));
812− tmp = persistent_gnt;
813− n = persistent_gnt->node.next;
814− if (n)
815− persistent_gnt = llist_entry(n, typeof(*(persistent_gnt)), node);
816− else
817− persistent_gnt = NULL;
818− kfree(tmp);
841+ kfree(persistent_gnt);
819842 }
820− info->persistent_gnts_c = 0;
821843 }
844+ BUG_ON(info->persistent_gnts_c != 0);
822845
823846 /* No more gnttab callback work. */
824847 gnttab_cancel_free_callback(&info->callback);
@@ -875,7 +898,7 @@ static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info, · 50 unmodified lines
875898 }
876899 /* Add the persistent grant into the list of free grants */
877900 for (i = 0; i < s->req.u.rw.nr_segments; i++) {
878− llist_add(&s->grants_used[i]->node, &info->persistent_gnts);
901+ list_add(&s->grants_used[i]->node, &info->persistent_gnts);
879902 info->persistent_gnts_c++;
880903 }
881904 }
@@ -1013,6 +1036,12 @@ static int setup_blkring(struct xenbus_device *dev, · 131 unmodified lines
10131036
10141037 sg_init_table(info->sg, BLKIF_MAX_SEGMENTS_PER_REQUEST);
10151038
1039+ /* Allocate memory for grants */
1040+ err = fill_grant_buffer(info, BLK_RING_SIZE *
1041+ BLKIF_MAX_SEGMENTS_PER_REQUEST);
1042+ if (err)
1043+ goto fail;
1044+
10161045 err = xenbus_grant_ring(dev, virt_to_mfn(info->ring.sring));
10171046 if (err < 0) {
10181047 free_page((unsigned long)sring);
@@ -1171,7 +1200,7 @@ static int blkfront_probe(struct xenbus_device *dev, · 152 unmodified lines
11711200 spin_lock_init(&info->io_lock);
11721201 info->xbdev = dev;
11731202 info->vdevice = vdevice;
1174− init_llist_head(&info->persistent_gnts);
1203+ INIT_LIST_HEAD(&info->persistent_gnts);
11751204 info->persistent_gnts_c = 0;
11761205 info->connected = BLKIF_STATE_DISCONNECTED;
11771206 INIT_WORK(&info->work, blkif_restart_queue);
@@ -1203,11 +1232,10 @@ static int blkif_recover(struct blkfront_info *info) · 25 unmodified lines
12031232 int j;
12041233
12051234 /* Stage 1: Make a safe copy of the shadow state. */
1206− copy = kmalloc(sizeof(info->shadow),
1235+ copy = kmemdup(info->shadow, sizeof(info->shadow),
12071236 GFP_NOIO | __GFP_REPEAT | __GFP_HIGH);
12081237 if (!copy)
12091238 return -ENOMEM;
1210− memcpy(copy, info->shadow, sizeof(info->shadow));
12111239
12121240 /* Stage 2: Set up free list. */
12131241 memset(&info->shadow, 0, sizeof(info->shadow));
@@ -1236,7 +1264,7 @@ static int blkif_recover(struct blkfront_info *info) · 22 unmodified lines
12361264 gnttab_grant_foreign_access_ref(
12371265 req->u.rw.seg[j].gref,
12381266 info->xbdev->otherend_id,
1239− pfn_to_mfn(info->shadow[req->u.rw.id].frame[j]),
1267+ pfn_to_mfn(copy[i].grants_used[j]->pfn),
12401268 0);
12411269 }
12421270 info->shadow[req->u.rw.id].req = *req;
drivers/bluetooth/ath3k.c+8−0
@@ -73,9 +73,13 @@ static struct usb_device_id ath3k_table[] = { · 72 unmodified lines
7373 { USB_DEVICE(0x03F0, 0x311D) },
7474
7575 /* Atheros AR3012 with sflash firmware*/
76+ { USB_DEVICE(0x0CF3, 0x0036) },
7677 { USB_DEVICE(0x0CF3, 0x3004) },
78+ { USB_DEVICE(0x0CF3, 0x3008) },
7779 { USB_DEVICE(0x0CF3, 0x311D) },
80+ { USB_DEVICE(0x0CF3, 0x817a) },
7881 { USB_DEVICE(0x13d3, 0x3375) },
82+ { USB_DEVICE(0x04CA, 0x3004) },
7983 { USB_DEVICE(0x04CA, 0x3005) },
8084 { USB_DEVICE(0x04CA, 0x3006) },
8185 { USB_DEVICE(0x04CA, 0x3008) },
@@ -105,9 +109,13 @@ MODULE_DEVICE_TABLE(usb, ath3k_table); · 23 unmodified lines
105109 static struct usb_device_id ath3k_blist_tbl[] = {
106110
107111 /* Atheros AR3012 with sflash firmware*/
112+ { USB_DEVICE(0x0CF3, 0x0036), .driver_info = BTUSB_ATH3012 },
108113 { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
114+ { USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 },
109115 { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
116+ { USB_DEVICE(0x0CF3, 0x817a), .driver_info = BTUSB_ATH3012 },
110117 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
118+ { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
111119 { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
112120 { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 },
113121 { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
drivers/bluetooth/btusb.c+4−0
@@ -131,9 +131,13 @@ static struct usb_device_id blacklist_table[] = { · 130 unmodified lines
131131 { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
132132
133133 /* Atheros 3012 with sflash firmware */
134+ { USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 },
134135 { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
136+ { USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 },
135137 { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
138+ { USB_DEVICE(0x0cf3, 0x817a), .driver_info = BTUSB_ATH3012 },
136139 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
140+ { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
137141 { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
138142 { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 },
139143 { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
drivers/char/hpet.c+1−13
@@ -373,26 +373,14 @@ static int hpet_mmap(struct file *file, struct vm_area_struct *vma) · 372 unmodified lines
373373 struct hpet_dev *devp;
374374 unsigned long addr;
375375
376− if (((vma->vm_end - vma->vm_start) != PAGE_SIZE) || vma->vm_pgoff)
377− return -EINVAL;
378−
379376 devp = file->private_data;
380377 addr = devp->hd_hpets->hp_hpet_phys;
381378
382379 if (addr & (PAGE_SIZE - 1))
383380 return -ENOSYS;
384381
385− vma->vm_flags |= VM_IO;
386382 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
387−
388− if (io_remap_pfn_range(vma, vma->vm_start, addr >> PAGE_SHIFT,
389− PAGE_SIZE, vma->vm_page_prot)) {
390− printk(KERN_ERR "%s: io_remap_pfn_range failed\n",
391− __func__);
392− return -EAGAIN;
393− }
394−
395− return 0;
383+ return vm_iomap_memory(vma, addr, PAGE_SIZE);
396384 #else
397385 return -ENOSYS;
398386 #endif
drivers/char/hw_random/core.c+9−0
@@ -380,6 +380,15 @@ void hwrng_unregister(struct hwrng *rng) · 379 unmodified lines
380380 }
381381 EXPORT_SYMBOL_GPL(hwrng_unregister);
382382
383+static void __exit hwrng_exit(void)
384+{
385+ mutex_lock(&rng_mutex);
386+ BUG_ON(current_rng);
387+ kfree(rng_buffer);
388+ mutex_unlock(&rng_mutex);
389+}
390+
391+module_exit(hwrng_exit);
383392
384393 MODULE_DESCRIPTION("H/W Random Number Generator (RNG) driver");
385394 MODULE_LICENSE("GPL");
drivers/char/hw_random/virtio-rng.c+11−2
@@ -92,14 +92,22 @@ static int probe_common(struct virtio_device *vdev) · 91 unmodified lines
9292 {
9393 int err;
9494
95+ if (vq) {
96+ /* We only support one device for now */
97+ return -EBUSY;
98+ }
9599 /* We expect a single virtqueue. */
96100 vq = virtio_find_single_vq(vdev, random_recv_done, "input");
97− if (IS_ERR(vq))
98− return PTR_ERR(vq);
101+ if (IS_ERR(vq)) {
102+ err = PTR_ERR(vq);
103+ vq = NULL;
104+ return err;
105+ }
99106
100107 err = hwrng_register(&virtio_hwrng);
101108 if (err) {
102109 vdev->config->del_vqs(vdev);
110+ vq = NULL;
103111 return err;
104112 }
105113
@@ -112,6 +120,7 @@ static void remove_common(struct virtio_device *vdev) · 6 unmodified lines
112120 busy = false;
113121 hwrng_unregister(&virtio_hwrng);
114122 vdev->config->del_vqs(vdev);
123+ vq = NULL;
115124 }
116125
117126 static int virtrng_probe(struct virtio_device *vdev)
drivers/char/virtio_console.c+30−14
@@ -149,7 +149,8 @@ struct ports_device { · 148 unmodified lines
149149 spinlock_t ports_lock;
150150
151151 /* To protect the vq operations for the control channel */
152− spinlock_t cvq_lock;
152+ spinlock_t c_ivq_lock;
153+ spinlock_t c_ovq_lock;
153154
154155 /* The current config space is stored here */
155156 struct virtio_console_config config;
@@ -569,11 +570,14 @@ static ssize_t __send_control_msg(struct ports_device *portdev, u32 port_id, · 413 unmodified lines
569570 vq = portdev->c_ovq;
570571
571572 sg_init_one(sg, &cpkt, sizeof(cpkt));
573+
574+ spin_lock(&portdev->c_ovq_lock);
572575 if (virtqueue_add_buf(vq, sg, 1, 0, &cpkt, GFP_ATOMIC) == 0) {
573576 virtqueue_kick(vq);
574577 while (!virtqueue_get_buf(vq, &len))
575578 cpu_relax();
576579 }
580+ spin_unlock(&portdev->c_ovq_lock);
577581 return 0;
578582 }
579583
@@ -1436,7 +1440,7 @@ static int add_port(struct ports_device *portdev, u32 id) · 856 unmodified lines
14361440 * rproc_serial does not want the console port, only
14371441 * the generic port implementation.
14381442 */
1439− port->host_connected = port->guest_connected = true;
1443+ port->host_connected = true;
14401444 else if (!use_multiport(port->portdev)) {
14411445 /*
14421446 * If we're not using multiport support,
@@ -1709,23 +1713,23 @@ static void control_work_handler(struct work_struct *work) · 266 unmodified lines
17091713 portdev = container_of(work, struct ports_device, control_work);
17101714 vq = portdev->c_ivq;
17111715
1712− spin_lock(&portdev->cvq_lock);
1716+ spin_lock(&portdev->c_ivq_lock);
17131717 while ((buf = virtqueue_get_buf(vq, &len))) {
1714− spin_unlock(&portdev->cvq_lock);
1718+ spin_unlock(&portdev->c_ivq_lock);
17151719
17161720 buf->len = len;
17171721 buf->offset = 0;
17181722
17191723 handle_control_message(portdev, buf);
17201724
1721− spin_lock(&portdev->cvq_lock);
1725+ spin_lock(&portdev->c_ivq_lock);
17221726 if (add_inbuf(portdev->c_ivq, buf) < 0) {
17231727 dev_warn(&portdev->vdev->dev,
17241728 "Error adding buffer to queue\n");
17251729 free_buf(buf, false);
17261730 }
17271731 }
1728− spin_unlock(&portdev->cvq_lock);
1732+ spin_unlock(&portdev->c_ivq_lock);
17291733 }
17301734
17311735 static void out_intr(struct virtqueue *vq)
@@ -1752,13 +1756,23 @@ static void in_intr(struct virtqueue *vq) · 20 unmodified lines
17521756 port->inbuf = get_inbuf(port);
17531757
17541758 /*
1755− * Don't queue up data when port is closed. This condition
1759+ * Normally the port should not accept data when the port is
1760+ * closed. For generic serial ports, the host won't (shouldn't)
1761+ * send data till the guest is connected. But this condition
17561762 * can be reached when a console port is not yet connected (no
1757− * tty is spawned) and the host sends out data to console
1758− * ports. For generic serial ports, the host won't
1759− * (shouldn't) send data till the guest is connected.
1763+ * tty is spawned) and the other side sends out data over the
1764+ * vring, or when a remote devices start sending data before
1765+ * the ports are opened.
1766+ *
1767+ * A generic serial port will discard data if not connected,
1768+ * while console ports and rproc-serial ports accepts data at
1769+ * any time. rproc-serial is initiated with guest_connected to
1770+ * false because port_fops_open expects this. Console ports are
1771+ * hooked up with an HVC console and is initialized with
1772+ * guest_connected to true.
17601773 */
1761− if (!port->guest_connected)
1774+
1775+ if (!port->guest_connected && !is_rproc_serial(port->portdev->vdev))
17621776 discard_port_data(port);
17631777
17641778 spin_unlock_irqrestore(&port->inbuf_lock, flags);
@@ -1986,10 +2000,12 @@ static int virtcons_probe(struct virtio_device *vdev) · 221 unmodified lines
19862000 if (multiport) {
19872001 unsigned int nr_added_bufs;
19882002
1989− spin_lock_init(&portdev->cvq_lock);
2003+ spin_lock_init(&portdev->c_ivq_lock);
2004+ spin_lock_init(&portdev->c_ovq_lock);
19902005 INIT_WORK(&portdev->control_work, &control_work_handler);
19912006
1992− nr_added_bufs = fill_queue(portdev->c_ivq, &portdev->cvq_lock);
2007+ nr_added_bufs = fill_queue(portdev->c_ivq,
2008+ &portdev->c_ivq_lock);
19932009 if (!nr_added_bufs) {
19942010 dev_err(&vdev->dev,
19952011 "Error allocating buffers for control queue\n");
@@ -2140,7 +2156,7 @@ static int virtcons_restore(struct virtio_device *vdev) · 144 unmodified lines
21402156 return ret;
21412157
21422158 if (use_multiport(portdev))
2143− fill_queue(portdev->c_ivq, &portdev->cvq_lock);
2159+ fill_queue(portdev->c_ivq, &portdev->c_ivq_lock);
21442160
21452161 list_for_each_entry(port, &portdev->ports, list) {
21462162 port->in_vq = portdev->in_vqs[port->id];
drivers/clk/clk-vt8500.c+1−1
@@ -157,7 +157,7 @@ static int vt8500_dclk_set_rate(struct clk_hw *hw, unsigned long rate, · 156 unmodified lines
157157 divisor = parent_rate / rate;
158158
159159 /* If prate / rate would be decimal, incr the divisor */
160− if (rate * divisor < *prate)
160+ if (rate * divisor < parent_rate)
161161 divisor++;
162162
163163 if (divisor == cdev->div_mask + 1)
drivers/clk/tegra/clk-tegra20.c+1−2
@@ -703,7 +703,7 @@ static void tegra20_pll_init(void) · 702 unmodified lines
703703 clks[pll_a_out0] = clk;
704704
705705 /* PLLE */
706− clk = tegra_clk_register_plle("pll_e", "pll_ref", clk_base, NULL,
706+ clk = tegra_clk_register_plle("pll_e", "pll_ref", clk_base, pmc_base,
707707 0, 100000000, &pll_e_params,
708708 0, pll_e_freq_table, NULL);
709709 clk_register_clkdev(clk, "pll_e", NULL);
@@ -1292,7 +1292,6 @@ static struct tegra_clk_duplicate tegra_clk_duplicates[] = { · 582 unmodified lines
12921292 TEGRA_CLK_DUPLICATE(usbd, "tegra-ehci.0", NULL),
12931293 TEGRA_CLK_DUPLICATE(usbd, "tegra-otg", NULL),
12941294 TEGRA_CLK_DUPLICATE(cclk, NULL, "cpu"),
1295− TEGRA_CLK_DUPLICATE(twd, "smp_twd", NULL),
12961295 TEGRA_CLK_DUPLICATE(clk_max, NULL, NULL), /* Must be the last entry */
12971296 };
12981297
drivers/clk/tegra/clk-tegra30.c+0−1
@@ -1931,7 +1931,6 @@ static struct tegra_clk_duplicate tegra_clk_duplicates[] = { · 1930 unmodified lines
19311931 TEGRA_CLK_DUPLICATE(cml1, "tegra_sata_cml", NULL),
19321932 TEGRA_CLK_DUPLICATE(cml0, "tegra_pcie", "cml"),
19331933 TEGRA_CLK_DUPLICATE(pciex, "tegra_pcie", "pciex"),
1934− TEGRA_CLK_DUPLICATE(twd, "smp_twd", NULL),
19351934 TEGRA_CLK_DUPLICATE(vcp, "nvavp", "vcp"),
19361935 TEGRA_CLK_DUPLICATE(clk_max, NULL, NULL), /* MUST be the last entry */
19371936 };
drivers/cpufreq/acpi-cpufreq.c+0−2
@@ -730,7 +730,6 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) · 729 unmodified lines
730730 policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) {
731731 cpumask_copy(policy->cpus, perf->shared_cpu_map);
732732 }
733− cpumask_copy(policy->related_cpus, perf->shared_cpu_map);
734733
735734 #ifdef CONFIG_SMP
736735 dmi_check_system(sw_any_bug_dmi_table);
@@ -742,7 +741,6 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) · 5 unmodified lines
742741 if (check_amd_hwpstate_cpu(cpu) && !acpi_pstate_strict) {
743742 cpumask_clear(policy->cpus);
744743 cpumask_set_cpu(cpu, policy->cpus);
745− cpumask_copy(policy->related_cpus, cpu_sibling_mask(cpu));
746744 policy->shared_type = CPUFREQ_SHARED_TYPE_HW;
747745 pr_info_once(PFX "overriding BIOS provided _PSD data\n");
748746 }
drivers/cpufreq/cpufreq-cpu0.c+8−2
@@ -178,10 +178,16 @@ static struct cpufreq_driver cpu0_cpufreq_driver = { · 177 unmodified lines
178178
179179 static int cpu0_cpufreq_probe(struct platform_device *pdev)
180180 {
181− struct device_node *np;
181+ struct device_node *np, *parent;
182182 int ret;
183183
184− for_each_child_of_node(of_find_node_by_path("/cpus"), np) {
184+ parent = of_find_node_by_path("/cpus");
185+ if (!parent) {
186+ pr_err("failed to find OF /cpus\n");
187+ return -ENOENT;
188+ }
189+
190+ for_each_child_of_node(parent, np) {
185191 if (of_get_property(np, "operating-points", NULL))
186192 break;
187193 }
drivers/cpufreq/cpufreq_governor.h+3−3
@@ -14,8 +14,8 @@ · 13 unmodified lines
1414 * published by the Free Software Foundation.
1515 */
1616
17−#ifndef _CPUFREQ_GOVERNER_H
18−#define _CPUFREQ_GOVERNER_H
17+#ifndef _CPUFREQ_GOVERNOR_H
18+#define _CPUFREQ_GOVERNOR_H
1919
2020 #include <linux/cpufreq.h>
2121 #include <linux/kobject.h>
@@ -175,4 +175,4 @@ bool need_load_eval(struct cpu_dbs_common_info *cdbs, · 153 unmodified lines
175175 unsigned int sampling_rate);
176176 int cpufreq_governor_dbs(struct dbs_data *dbs_data,
177177 struct cpufreq_policy *policy, unsigned int event);
178−#endif /* _CPUFREQ_GOVERNER_H */
178+#endif /* _CPUFREQ_GOVERNOR_H */
drivers/cpufreq/cpufreq_stats.c+8−4
@@ -180,15 +180,19 @@ static void cpufreq_stats_free_sysfs(unsigned int cpu) · 179 unmodified lines
180180 {
181181 struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
182182
183− if (!cpufreq_frequency_get_table(cpu))
183+ if (!policy)
184184 return;
185185
186− if (policy && !policy_is_shared(policy)) {
186+ if (!cpufreq_frequency_get_table(cpu))
187+ goto put_ref;
188+
189+ if (!policy_is_shared(policy)) {
187190 pr_debug("%s: Free sysfs stat\n", __func__);
188191 sysfs_remove_group(&policy->kobj, &stats_attr_group);
189192 }
190− if (policy)
191− cpufreq_cpu_put(policy);
193+
194+put_ref:
195+ cpufreq_cpu_put(policy);
192196 }
193197
194198 static int cpufreq_stats_create_table(struct cpufreq_policy *policy,
drivers/cpufreq/intel_pstate.c+30−5
@@ -358,14 +358,14 @@ static void intel_pstate_sysfs_expose_params(void) · 357 unmodified lines
358358 static int intel_pstate_min_pstate(void)
359359 {
360360 u64 value;
361− rdmsrl(0xCE, value);
361+ rdmsrl(MSR_PLATFORM_INFO, value);
362362 return (value >> 40) & 0xFF;
363363 }
364364
365365 static int intel_pstate_max_pstate(void)
366366 {
367367 u64 value;
368− rdmsrl(0xCE, value);
368+ rdmsrl(MSR_PLATFORM_INFO, value);
369369 return (value >> 8) & 0xFF;
370370 }
371371
@@ -373,7 +373,7 @@ static int intel_pstate_turbo_pstate(void) · 1 unmodified line
373373 {
374374 u64 value;
375375 int nont, ret;
376− rdmsrl(0x1AD, value);
376+ rdmsrl(MSR_NHM_TURBO_RATIO_LIMIT, value);
377377 nont = intel_pstate_max_pstate();
378378 ret = ((value) & 255);
379379 if (ret <= nont)
@@ -454,7 +454,7 @@ static inline void intel_pstate_calc_busy(struct cpudata *cpu, · 74 unmodified lines
454454 sample->idletime_us * 100,
455455 sample->duration_us);
456456 core_pct = div64_u64(sample->aperf * 100, sample->mperf);
457− sample->freq = cpu->pstate.turbo_pstate * core_pct * 1000;
457+ sample->freq = cpu->pstate.max_pstate * core_pct * 1000;
458458
459459 sample->core_pct_busy = div_s64((sample->pstate_pct_busy * core_pct),
460460 100);
@@ -502,7 +502,6 @@ static inline void intel_pstate_set_sample_time(struct cpudata *cpu) · 41 unmodified lines
502502
503503 sample_time = cpu->pstate_policy->sample_rate_ms;
504504 delay = msecs_to_jiffies(sample_time);
505− delay -= jiffies % delay;
506505 mod_timer_pinned(&cpu->timer, jiffies + delay);
507506 }
508507
@@ -752,6 +751,29 @@ static struct cpufreq_driver intel_pstate_driver = { · 243 unmodified lines
752751
753752 static int __initdata no_load;
754753
754+static int intel_pstate_msrs_not_valid(void)
755+{
756+ /* Check that all the msr's we are using are valid. */
757+ u64 aperf, mperf, tmp;
758+
759+ rdmsrl(MSR_IA32_APERF, aperf);
760+ rdmsrl(MSR_IA32_MPERF, mperf);
761+
762+ if (!intel_pstate_min_pstate() ||
763+ !intel_pstate_max_pstate() ||
764+ !intel_pstate_turbo_pstate())
765+ return -ENODEV;
766+
767+ rdmsrl(MSR_IA32_APERF, tmp);
768+ if (!(tmp - aperf))
769+ return -ENODEV;
770+
771+ rdmsrl(MSR_IA32_MPERF, tmp);
772+ if (!(tmp - mperf))
773+ return -ENODEV;
774+
775+ return 0;
776+}
755777 static int __init intel_pstate_init(void)
756778 {
757779 int cpu, rc = 0;
@@ -764,6 +786,9 @@ static int __init intel_pstate_init(void) · 6 unmodified lines
764786 if (!id)
765787 return -ENODEV;
766788
789+ if (intel_pstate_msrs_not_valid())
790+ return -ENODEV;
791+
767792 pr_info("Intel P-state driver initializing.\n");
768793
769794 all_cpu_data = vmalloc(sizeof(void *) * num_possible_cpus());
drivers/crypto/caam/caamalg.c+2−25
@@ -1650,11 +1650,7 @@ struct caam_alg_template { · 1649 unmodified lines
16501650 };
16511651
16521652 static struct caam_alg_template driver_algs[] = {
1653− /*
1654− * single-pass ipsec_esp descriptor
1655− * authencesn(*,*) is also registered, although not present
1656− * explicitly here.
1657− */
1653+ /* single-pass ipsec_esp descriptor */
16581654 {
16591655 .name = "authenc(hmac(md5),cbc(aes))",
16601656 .driver_name = "authenc-hmac-md5-cbc-aes-caam",
@@ -2217,9 +2213,7 @@ static int __init caam_algapi_init(void) · 556 unmodified lines
22172213 for (i = 0; i < ARRAY_SIZE(driver_algs); i++) {
22182214 /* TODO: check if h/w supports alg */
22192215 struct caam_crypto_alg *t_alg;
2220− bool done = false;
22212216
2222−authencesn:
22232217 t_alg = caam_alg_alloc(ctrldev, &driver_algs[i]);
22242218 if (IS_ERR(t_alg)) {
22252219 err = PTR_ERR(t_alg);
@@ -2233,25 +2227,8 @@ authencesn: · 7 unmodified lines
22332227 dev_warn(ctrldev, "%s alg registration failed\n",
22342228 t_alg->crypto_alg.cra_driver_name);
22352229 kfree(t_alg);
2236− } else {
2230+ } else
22372231 list_add_tail(&t_alg->entry, &priv->alg_list);
2238− if (driver_algs[i].type == CRYPTO_ALG_TYPE_AEAD &&
2239− !memcmp(driver_algs[i].name, "authenc", 7) &&
2240− !done) {
2241− char *name;
2242−
2243− name = driver_algs[i].name;
2244− memmove(name + 10, name + 7, strlen(name) - 7);
2245− memcpy(name + 7, "esn", 3);
2246−
2247− name = driver_algs[i].driver_name;
2248− memmove(name + 10, name + 7, strlen(name) - 7);
2249− memcpy(name + 7, "esn", 3);
2250−
2251− done = true;
2252− goto authencesn;
2253− }
2254− }
22552232 }
22562233 if (!list_empty(&priv->alg_list))
22572234 dev_info(ctrldev, "%s algorithms registered in /proc/crypto\n",
drivers/crypto/caam/compat.h+0−1
@@ -23,7 +23,6 @@ · 22 unmodified lines
2323 #include <linux/types.h>
2424 #include <linux/debugfs.h>
2525 #include <linux/circ_buf.h>
26−#include <linux/string.h>
2726 #include <net/xfrm.h>
2827
2928 #include <crypto/algapi.h>
drivers/crypto/talitos.c+2−28
@@ -38,7 +38,6 @@ · 37 unmodified lines
3838 #include <linux/spinlock.h>
3939 #include <linux/rtnetlink.h>
4040 #include <linux/slab.h>
41−#include <linux/string.h>
4241
4342 #include <crypto/algapi.h>
4443 #include <crypto/aes.h>
@@ -1974,11 +1973,7 @@ struct talitos_alg_template { · 1929 unmodified lines
19741973 };
19751974
19761975 static struct talitos_alg_template driver_algs[] = {
1977− /*
1978− * AEAD algorithms. These use a single-pass ipsec_esp descriptor.
1979− * authencesn(*,*) is also registered, although not present
1980− * explicitly here.
1981− */
1976+ /* AEAD algorithms. These use a single-pass ipsec_esp descriptor */
19821977 { .type = CRYPTO_ALG_TYPE_AEAD,
19831978 .alg.crypto = {
19841979 .cra_name = "authenc(hmac(sha1),cbc(aes))",
@@ -2820,9 +2815,7 @@ static int talitos_probe(struct platform_device *ofdev) · 835 unmodified lines
28202815 if (hw_supports(dev, driver_algs[i].desc_hdr_template)) {
28212816 struct talitos_crypto_alg *t_alg;
28222817 char *name = NULL;
2823− bool authenc = false;
28242818
2825−authencesn:
28262819 t_alg = talitos_alg_alloc(dev, &driver_algs[i]);
28272820 if (IS_ERR(t_alg)) {
28282821 err = PTR_ERR(t_alg);
@@ -2837,8 +2830,6 @@ authencesn: · 8 unmodified lines
28372830 err = crypto_register_alg(
28382831 &t_alg->algt.alg.crypto);
28392832 name = t_alg->algt.alg.crypto.cra_driver_name;
2840− authenc = authenc ? !authenc :
2841− !(bool)memcmp(name, "authenc", 7);
28422833 break;
28432834 case CRYPTO_ALG_TYPE_AHASH:
28442835 err = crypto_register_ahash(
@@ -2851,25 +2842,8 @@ authencesn: · 6 unmodified lines
28512842 dev_err(dev, "%s alg registration failed\n",
28522843 name);
28532844 kfree(t_alg);
2854− } else {
2845+ } else
28552846 list_add_tail(&t_alg->entry, &priv->alg_list);
2856− if (authenc) {
2857− struct crypto_alg *alg =
2858− &driver_algs[i].alg.crypto;
2859−
2860− name = alg->cra_name;
2861− memmove(name + 10, name + 7,
2862− strlen(name) - 7);
2863− memcpy(name + 7, "esn", 3);
2864−
2865− name = alg->cra_driver_name;
2866− memmove(name + 10, name + 7,
2867− strlen(name) - 7);
2868− memcpy(name + 7, "esn", 3);
2869−
2870− goto authencesn;
2871− }
2872− }
28732847 }
28742848 }
28752849 if (!list_empty(&priv->alg_list))
drivers/crypto/ux500/cryp/cryp_core.c+1−1
@@ -1750,7 +1750,7 @@ static struct platform_driver cryp_driver = { · 1749 unmodified lines
17501750 .shutdown = ux500_cryp_shutdown,
17511751 .driver = {
17521752 .owner = THIS_MODULE,
1753− .name = "cryp1"
1753+ .name = "cryp1",
17541754 .pm = &ux500_cryp_pm,
17551755 }
17561756 };
drivers/dma/Kconfig+1−0
@@ -83,6 +83,7 @@ config INTEL_IOP_ADMA · 82 unmodified lines
8383
8484 config DW_DMAC
8585 tristate "Synopsys DesignWare AHB DMA support"
86+ depends on GENERIC_HARDIRQS
8687 select DMA_ENGINE
8788 default y if CPU_AT32AP7000
8889 help
drivers/dma/at_hdmac.c+4−5
@@ -310,8 +310,6 @@ static void atc_complete_all(struct at_dma_chan *atchan) · 309 unmodified lines
310310
311311 dev_vdbg(chan2dev(&atchan->chan_common), "complete all\n");
312312
313− BUG_ON(atc_chan_is_enabled(atchan));
314−
315313 /*
316314 * Submit queued descriptors ASAP, i.e. before we go through
317315 * the completed ones.
@@ -368,6 +366,9 @@ static void atc_advance_work(struct at_dma_chan *atchan) · 50 unmodified lines
368366 {
369367 dev_vdbg(chan2dev(&atchan->chan_common), "advance_work\n");
370368
369+ if (atc_chan_is_enabled(atchan))
370+ return;
371+
371372 if (list_empty(&atchan->active_list) ||
372373 list_is_singular(&atchan->active_list)) {
373374 atc_complete_all(atchan);
@@ -1078,9 +1079,7 @@ static void atc_issue_pending(struct dma_chan *chan) · 704 unmodified lines
10781079 return;
10791080
10801081 spin_lock_irqsave(&atchan->lock, flags);
1081− if (!atc_chan_is_enabled(atchan)) {
1082− atc_advance_work(atchan);
1083− }
1082+ atc_advance_work(atchan);
10841083 spin_unlock_irqrestore(&atchan->lock, flags);
10851084 }
10861085
drivers/dma/dw_dmac.c+19−4
@@ -1001,6 +1001,13 @@ static inline void convert_burst(u32 *maxburst) · 1000 unmodified lines
10011001 *maxburst = 0;
10021002 }
10031003
1004+static inline void convert_slave_id(struct dw_dma_chan *dwc)
1005+{
1006+ struct dw_dma *dw = to_dw_dma(dwc->chan.device);
1007+
1008+ dwc->dma_sconfig.slave_id -= dw->request_line_base;
1009+}
1010+
10041011 static int
10051012 set_runtime_config(struct dma_chan *chan, struct dma_slave_config *sconfig)
10061013 {
@@ -1015,6 +1022,7 @@ set_runtime_config(struct dma_chan *chan, struct dma_slave_config *sconfig) · 8 unmodified lines
10151022
10161023 convert_burst(&dwc->dma_sconfig.src_maxburst);
10171024 convert_burst(&dwc->dma_sconfig.dst_maxburst);
1025+ convert_slave_id(dwc);
10181026
10191027 return 0;
10201028 }
@@ -1276,9 +1284,9 @@ static struct dma_chan *dw_dma_xlate(struct of_phandle_args *dma_spec, · 255 unmodified lines
12761284 if (dma_spec->args_count != 3)
12771285 return NULL;
12781286
1279− fargs.req = be32_to_cpup(dma_spec->args+0);
1280− fargs.src = be32_to_cpup(dma_spec->args+1);
1281− fargs.dst = be32_to_cpup(dma_spec->args+2);
1287+ fargs.req = dma_spec->args[0];
1288+ fargs.src = dma_spec->args[1];
1289+ fargs.dst = dma_spec->args[2];
12821290
12831291 if (WARN_ON(fargs.req >= DW_DMA_MAX_NR_REQUESTS ||
12841292 fargs.src >= dw->nr_masters ||
@@ -1628,6 +1636,7 @@ dw_dma_parse_dt(struct platform_device *pdev) · 343 unmodified lines
16281636
16291637 static int dw_probe(struct platform_device *pdev)
16301638 {
1639+ const struct platform_device_id *match;
16311640 struct dw_dma_platform_data *pdata;
16321641 struct resource *io;
16331642 struct dw_dma *dw;
@@ -1711,6 +1720,11 @@ static int dw_probe(struct platform_device *pdev) · 77 unmodified lines
17111720 memcpy(dw->data_width, pdata->data_width, 4);
17121721 }
17131722
1723+ /* Get the base request line if set */
1724+ match = platform_get_device_id(pdev);
1725+ if (match)
1726+ dw->request_line_base = (unsigned int)match->driver_data;
1727+
17141728 /* Calculate all channel mask before DMA setup */
17151729 dw->all_chan_mask = (1 << nr_channels) - 1;
17161730
@@ -1906,7 +1920,8 @@ MODULE_DEVICE_TABLE(of, dw_dma_id_table); · 189 unmodified lines
19061920 #endif
19071921
19081922 static const struct platform_device_id dw_dma_ids[] = {
1909− { "INTL9C60", 0 },
1923+ /* Name, Request Line Base */
1924+ { "INTL9C60", (kernel_ulong_t)16 },
19101925 { }
19111926 };
19121927
drivers/dma/dw_dmac_regs.h+1−0
@@ -247,6 +247,7 @@ struct dw_dma { · 246 unmodified lines
247247 /* hardware configuration */
248248 unsigned char nr_masters;
249249 unsigned char data_width[4];
250+ unsigned int request_line_base;
250251
251252 struct dw_dma_chan chan[0];
252253 };
drivers/dma/omap-dma.c+14−6
@@ -276,12 +276,20 @@ static void omap_dma_issue_pending(struct dma_chan *chan) · 275 unmodified lines
276276
277277 spin_lock_irqsave(&c->vc.lock, flags);
278278 if (vchan_issue_pending(&c->vc) && !c->desc) {
279− struct omap_dmadev *d = to_omap_dma_dev(chan->device);
280− spin_lock(&d->lock);
281− if (list_empty(&c->node))
282− list_add_tail(&c->node, &d->pending);
283− spin_unlock(&d->lock);
284− tasklet_schedule(&d->task);
279+ /*
280+ * c->cyclic is used only by audio and in this case the DMA need
281+ * to be started without delay.
282+ */
283+ if (!c->cyclic) {
284+ struct omap_dmadev *d = to_omap_dma_dev(chan->device);
285+ spin_lock(&d->lock);
286+ if (list_empty(&c->node))
287+ list_add_tail(&c->node, &d->pending);
288+ spin_unlock(&d->lock);
289+ tasklet_schedule(&d->task);
290+ } else {
291+ omap_dma_start_desc(c);
292+ }
285293 }
286294 spin_unlock_irqrestore(&c->vc.lock, flags);
287295 }
drivers/dma/pl330.c+27−11
@@ -2882,7 +2882,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) · 2881 unmodified lines
28822882 {
28832883 struct dma_pl330_platdata *pdat;
28842884 struct dma_pl330_dmac *pdmac;
2885− struct dma_pl330_chan *pch;
2885+ struct dma_pl330_chan *pch, *_p;
28862886 struct pl330_info *pi;
28872887 struct dma_device *pd;
28882888 struct resource *res;
@@ -2984,7 +2984,16 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) · 95 unmodified lines
29842984 ret = dma_async_device_register(pd);
29852985 if (ret) {
29862986 dev_err(&adev->dev, "unable to register DMAC\n");
2987− goto probe_err2;
2987+ goto probe_err3;
2988+ }
2989+
2990+ if (adev->dev.of_node) {
2991+ ret = of_dma_controller_register(adev->dev.of_node,
2992+ of_dma_pl330_xlate, pdmac);
2993+ if (ret) {
2994+ dev_err(&adev->dev,
2995+ "unable to register DMA to the generic DT DMA helpers\n");
2996+ }
29882997 }
29892998
29902999 dev_info(&adev->dev,
@@ -2995,16 +3004,21 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) · 4 unmodified lines
29953004 pi->pcfg.data_bus_width / 8, pi->pcfg.num_chan,
29963005 pi->pcfg.num_peri, pi->pcfg.num_events);
29973006
2998− ret = of_dma_controller_register(adev->dev.of_node,
2999− of_dma_pl330_xlate, pdmac);
3000− if (ret) {
3001− dev_err(&adev->dev,
3002− "unable to register DMA to the generic DT DMA helpers\n");
3003− goto probe_err2;
3004− }
3005−
30063007 return 0;
3008+probe_err3:
3009+ amba_set_drvdata(adev, NULL);
30073010
3011+ /* Idle the DMAC */
3012+ list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels,
3013+ chan.device_node) {
3014+
3015+ /* Remove the channel */
3016+ list_del(&pch->chan.device_node);
3017+
3018+ /* Flush the channel */
3019+ pl330_control(&pch->chan, DMA_TERMINATE_ALL, 0);
3020+ pl330_free_chan_resources(&pch->chan);
3021+ }
30083022 probe_err2:
30093023 pl330_del(pi);
30103024 probe_err1:
@@ -3023,8 +3037,10 @@ static int pl330_remove(struct amba_device *adev) · 12 unmodified lines
30233037 if (!pdmac)
30243038 return 0;
30253039
3026− of_dma_controller_free(adev->dev.of_node);
3040+ if (adev->dev.of_node)
3041+ of_dma_controller_free(adev->dev.of_node);
30273042
3043+ dma_async_device_unregister(&pdmac->ddma);
30283044 amba_set_drvdata(adev, NULL);
30293045
30303046 /* Idle the DMAC */
drivers/edac/amd64_edac.c+9−6
@@ -2048,12 +2048,18 @@ static int init_csrows(struct mem_ctl_info *mci) · 2047 unmodified lines
20482048 edac_dbg(1, "MC node: %d, csrow: %d\n",
20492049 pvt->mc_node_id, i);
20502050
2051− if (row_dct0)
2051+ if (row_dct0) {
20522052 nr_pages = amd64_csrow_nr_pages(pvt, 0, i);
2053+ csrow->channels[0]->dimm->nr_pages = nr_pages;
2054+ }
20532055
20542056 /* K8 has only one DCT */
2055− if (boot_cpu_data.x86 != 0xf && row_dct1)
2056− nr_pages += amd64_csrow_nr_pages(pvt, 1, i);
2057+ if (boot_cpu_data.x86 != 0xf && row_dct1) {
2058+ int row_dct1_pages = amd64_csrow_nr_pages(pvt, 1, i);
2059+
2060+ csrow->channels[1]->dimm->nr_pages = row_dct1_pages;
2061+ nr_pages += row_dct1_pages;
2062+ }
20572063
20582064 mtype = amd64_determine_memory_type(pvt, i);
20592065
@@ -2072,9 +2078,7 @@ static int init_csrows(struct mem_ctl_info *mci) · 12 unmodified lines
20722078 dimm = csrow->channels[j]->dimm;
20732079 dimm->mtype = mtype;
20742080 dimm->edac_mode = edac_mode;
2075− dimm->nr_pages = nr_pages;
20762081 }
2077− csrow->nr_pages = nr_pages;
20782082 }
20792083
20802084 return empty;
@@ -2419,7 +2423,6 @@ static int amd64_init_one_instance(struct pci_dev *F2) · 338 unmodified lines
24192423
24202424 mci->pvt_info = pvt;
24212425 mci->pdev = &pvt->F2->dev;
2422− mci->csbased = 1;
24232426
24242427 setup_mci_misc_attrs(mci, fam_type);
24252428
drivers/edac/edac_mc.c+3−3
@@ -86,7 +86,7 @@ static void edac_mc_dump_dimm(struct dimm_info *dimm, int number) · 85 unmodified lines
8686 edac_dimm_info_location(dimm, location, sizeof(location));
8787
8888 edac_dbg(4, "%s%i: %smapped as virtual row %d, chan %d\n",
89− dimm->mci->mem_is_per_rank ? "rank" : "dimm",
89+ dimm->mci->csbased ? "rank" : "dimm",
9090 number, location, dimm->csrow, dimm->cschannel);
9191 edac_dbg(4, " dimm = %p\n", dimm);
9292 edac_dbg(4, " dimm->label = '%s'\n", dimm->label);
@@ -341,7 +341,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, · 248 unmodified lines
341341 memcpy(mci->layers, layers, sizeof(*layer) * n_layers);
342342 mci->nr_csrows = tot_csrows;
343343 mci->num_cschannel = tot_channels;
344− mci->mem_is_per_rank = per_rank;
344+ mci->csbased = per_rank;
345345
346346 /*
347347 * Alocate and fill the csrow/channels structs
@@ -1235,7 +1235,7 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type, · 887 unmodified lines
12351235 * incrementing the compat API counters
12361236 */
12371237 edac_dbg(4, "%s csrows map: (%d,%d)\n",
1238− mci->mem_is_per_rank ? "rank" : "dimm",
1238+ mci->csbased ? "rank" : "dimm",
12391239 dimm->csrow, dimm->cschannel);
12401240 if (row == -1)
12411241 row = dimm->csrow;
drivers/edac/edac_mc_sysfs.c+5−12
@@ -143,7 +143,7 @@ static const char *edac_caps[] = { · 142 unmodified lines
143143 * and the per-dimm/per-rank one
144144 */
145145 #define DEVICE_ATTR_LEGACY(_name, _mode, _show, _store) \
146− struct device_attribute dev_attr_legacy_##_name = __ATTR(_name, _mode, _show, _store)
146+ static struct device_attribute dev_attr_legacy_##_name = __ATTR(_name, _mode, _show, _store)
147147
148148 struct dev_ch_attribute {
149149 struct device_attribute attr;
@@ -180,9 +180,6 @@ static ssize_t csrow_size_show(struct device *dev, · 30 unmodified lines
180180 int i;
181181 u32 nr_pages = 0;
182182
183− if (csrow->mci->csbased)
184− return sprintf(data, "%u\n", PAGES_TO_MiB(csrow->nr_pages));
185−
186183 for (i = 0; i < csrow->nr_channels; i++)
187184 nr_pages += csrow->channels[i]->dimm->nr_pages;
188185 return sprintf(data, "%u\n", PAGES_TO_MiB(nr_pages));
@@ -612,7 +609,7 @@ static int edac_create_dimm_object(struct mem_ctl_info *mci, · 423 unmodified lines
612609 device_initialize(&dimm->dev);
613610
614611 dimm->dev.parent = &mci->dev;
615− if (mci->mem_is_per_rank)
612+ if (mci->csbased)
616613 dev_set_name(&dimm->dev, "rank%d", index);
617614 else
618615 dev_set_name(&dimm->dev, "dimm%d", index);
@@ -778,14 +775,10 @@ static ssize_t mci_size_mb_show(struct device *dev, · 159 unmodified lines
778775 for (csrow_idx = 0; csrow_idx < mci->nr_csrows; csrow_idx++) {
779776 struct csrow_info *csrow = mci->csrows[csrow_idx];
780777
781− if (csrow->mci->csbased) {
782− total_pages += csrow->nr_pages;
783− } else {
784− for (j = 0; j < csrow->nr_channels; j++) {
785− struct dimm_info *dimm = csrow->channels[j]->dimm;
778+ for (j = 0; j < csrow->nr_channels; j++) {
779+ struct dimm_info *dimm = csrow->channels[j]->dimm;
786780
787− total_pages += dimm->nr_pages;
788− }
781+ total_pages += dimm->nr_pages;
789782 }
790783 }
791784
drivers/eisa/pci_eisa.c+46−21
@@ -19,10 +19,10 @@ · 18 unmodified lines
1919 /* There is only *one* pci_eisa device per machine, right ? */
2020 static struct eisa_root_device pci_eisa_root;
2121
22−static int __init pci_eisa_init(struct pci_dev *pdev,
23− const struct pci_device_id *ent)
22+static int __init pci_eisa_init(struct pci_dev *pdev)
2423 {
25− int rc;
24+ int rc, i;
25+ struct resource *res, *bus_res = NULL;
2626
2727 if ((rc = pci_enable_device (pdev))) {
2828 printk (KERN_ERR "pci_eisa : Could not enable device %s\n",
@@ -30,9 +30,30 @@ static int __init pci_eisa_init(struct pci_dev *pdev, · 1 unmodified line
3030 return rc;
3131 }
3232
33+ /*
34+ * The Intel 82375 PCI-EISA bridge is a subtractive-decode PCI
35+ * device, so the resources available on EISA are the same as those
36+ * available on the 82375 bus. This works the same as a PCI-PCI
37+ * bridge in subtractive-decode mode (see pci_read_bridge_bases()).
38+ * We assume other PCI-EISA bridges are similar.
39+ *
40+ * eisa_root_register() can only deal with a single io port resource,
41+ * so we use the first valid io port resource.
42+ */
43+ pci_bus_for_each_resource(pdev->bus, res, i)
44+ if (res && (res->flags & IORESOURCE_IO)) {
45+ bus_res = res;
46+ break;
47+ }
48+
49+ if (!bus_res) {
50+ dev_err(&pdev->dev, "No resources available\n");
51+ return -1;
52+ }
53+
3354 pci_eisa_root.dev = &pdev->dev;
34− pci_eisa_root.res = pdev->bus->resource[0];
35− pci_eisa_root.bus_base_addr = pdev->bus->resource[0]->start;
55+ pci_eisa_root.res = bus_res;
56+ pci_eisa_root.bus_base_addr = bus_res->start;
3657 pci_eisa_root.slots = EISA_MAX_SLOTS;
3758 pci_eisa_root.dma_mask = pdev->dma_mask;
3859 dev_set_drvdata(pci_eisa_root.dev, &pci_eisa_root);
@@ -45,22 +66,26 @@ static int __init pci_eisa_init(struct pci_dev *pdev, · 6 unmodified lines
4566 return 0;
4667 }
4768
48−static struct pci_device_id pci_eisa_pci_tbl[] = {
49− { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
50− PCI_CLASS_BRIDGE_EISA << 8, 0xffff00, 0 },
51− { 0, }
52−};
69+/*
70+ * We have to call pci_eisa_init_early() before pnpacpi_init()/isapnp_init().
71+ * Otherwise pnp resource will get enabled early and could prevent eisa
72+ * to be initialized.
73+ * Also need to make sure pci_eisa_init_early() is called after
74+ * x86/pci_subsys_init().
75+ * So need to use subsys_initcall_sync with it.
76+ */
77+static int __init pci_eisa_init_early(void)
78+{
79+ struct pci_dev *dev = NULL;
80+ int ret;
5381
54−static struct pci_driver __refdata pci_eisa_driver = {
55− .name = "pci_eisa",
56− .id_table = pci_eisa_pci_tbl,
57− .probe = pci_eisa_init,
58−};
82+ for_each_pci_dev(dev)
83+ if ((dev->class >> 8) == PCI_CLASS_BRIDGE_EISA) {
84+ ret = pci_eisa_init(dev);
85+ if (ret)
86+ return ret;
87+ }
5988
60−static int __init pci_eisa_init_module (void)
61−{
62− return pci_register_driver (&pci_eisa_driver);
89+ return 0;
6390 }
64−
65−device_initcall(pci_eisa_init_module);
66−MODULE_DEVICE_TABLE(pci, pci_eisa_pci_tbl);
91+subsys_initcall_sync(pci_eisa_init_early);
drivers/extcon/extcon-max77693.c+80−23
@@ -32,6 +32,38 @@ · 31 unmodified lines
3232 #define DEV_NAME "max77693-muic"
3333 #define DELAY_MS_DEFAULT 20000 /* unit: millisecond */
3434
35+/*
36+ * Default value of MAX77693 register to bring up MUIC device.
37+ * If user don't set some initial value for MUIC device through platform data,
38+ * extcon-max77693 driver use 'default_init_data' to bring up base operation
39+ * of MAX77693 MUIC device.
40+ */
41+struct max77693_reg_data default_init_data[] = {
42+ {
43+ /* STATUS2 - [3]ChgDetRun */
44+ .addr = MAX77693_MUIC_REG_STATUS2,
45+ .data = STATUS2_CHGDETRUN_MASK,
46+ }, {
47+ /* INTMASK1 - Unmask [3]ADC1KM,[0]ADCM */
48+ .addr = MAX77693_MUIC_REG_INTMASK1,
49+ .data = INTMASK1_ADC1K_MASK
50+ | INTMASK1_ADC_MASK,
51+ }, {
52+ /* INTMASK2 - Unmask [0]ChgTypM */
53+ .addr = MAX77693_MUIC_REG_INTMASK2,
54+ .data = INTMASK2_CHGTYP_MASK,
55+ }, {
56+ /* INTMASK3 - Mask all of interrupts */
57+ .addr = MAX77693_MUIC_REG_INTMASK3,
58+ .data = 0x0,
59+ }, {
60+ /* CDETCTRL2 */
61+ .addr = MAX77693_MUIC_REG_CDETCTRL2,
62+ .data = CDETCTRL2_VIDRMEN_MASK
63+ | CDETCTRL2_DXOVPEN_MASK,
64+ },
65+};
66+
3567 enum max77693_muic_adc_debounce_time {
3668 ADC_DEBOUNCE_TIME_5MS = 0,
3769 ADC_DEBOUNCE_TIME_10MS,
@@ -1045,8 +1077,9 @@ static int max77693_muic_probe(struct platform_device *pdev) · 1007 unmodified lines
10451077 {
10461078 struct max77693_dev *max77693 = dev_get_drvdata(pdev->dev.parent);
10471079 struct max77693_platform_data *pdata = dev_get_platdata(max77693->dev);
1048− struct max77693_muic_platform_data *muic_pdata = pdata->muic_data;
10491080 struct max77693_muic_info *info;
1081+ struct max77693_reg_data *init_data;
1082+ int num_init_data;
10501083 int delay_jiffies;
10511084 int ret;
10521085 int i;
@@ -1145,15 +1178,25 @@ static int max77693_muic_probe(struct platform_device *pdev) · 92 unmodified lines
11451178 goto err_irq;
11461179 }
11471180
1148− /* Initialize MUIC register by using platform data */
1149− for (i = 0 ; i < muic_pdata->num_init_data ; i++) {
1150− enum max77693_irq_source irq_src = MAX77693_IRQ_GROUP_NR;
1181+
1182+ /* Initialize MUIC register by using platform data or default data */
1183+ if (pdata->muic_data) {
1184+ init_data = pdata->muic_data->init_data;
1185+ num_init_data = pdata->muic_data->num_init_data;
1186+ } else {
1187+ init_data = default_init_data;
1188+ num_init_data = ARRAY_SIZE(default_init_data);
1189+ }
1190+
1191+ for (i = 0 ; i < num_init_data ; i++) {
1192+ enum max77693_irq_source irq_src
1193+ = MAX77693_IRQ_GROUP_NR;
11511194
11521195 max77693_write_reg(info->max77693->regmap_muic,
1153− muic_pdata->init_data[i].addr,
1154− muic_pdata->init_data[i].data);
1196+ init_data[i].addr,
1197+ init_data[i].data);
11551198
1156− switch (muic_pdata->init_data[i].addr) {
1199+ switch (init_data[i].addr) {
11571200 case MAX77693_MUIC_REG_INTMASK1:
11581201 irq_src = MUIC_INT1;
11591202 break;
@@ -1167,22 +1210,40 @@ static int max77693_muic_probe(struct platform_device *pdev) · 7 unmodified lines
11671210
11681211 if (irq_src < MAX77693_IRQ_GROUP_NR)
11691212 info->max77693->irq_masks_cur[irq_src]
1170− = muic_pdata->init_data[i].data;
1213+ = init_data[i].data;
11711214 }
11721215
1173− /*
1174− * Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
1175− * h/w path of COMP2/COMN1 on CONTROL1 register.
1176− */
1177− if (muic_pdata->path_uart)
1178− info->path_uart = muic_pdata->path_uart;
1179− else
1180− info->path_uart = CONTROL1_SW_UART;
1216+ if (pdata->muic_data) {
1217+ struct max77693_muic_platform_data *muic_pdata = pdata->muic_data;
11811218
1182− if (muic_pdata->path_usb)
1183− info->path_usb = muic_pdata->path_usb;
1184− else
1219+ /*
1220+ * Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
1221+ * h/w path of COMP2/COMN1 on CONTROL1 register.
1222+ */
1223+ if (muic_pdata->path_uart)
1224+ info->path_uart = muic_pdata->path_uart;
1225+ else
1226+ info->path_uart = CONTROL1_SW_UART;
1227+
1228+ if (muic_pdata->path_usb)
1229+ info->path_usb = muic_pdata->path_usb;
1230+ else
1231+ info->path_usb = CONTROL1_SW_USB;
1232+
1233+ /*
1234+ * Default delay time for detecting cable state
1235+ * after certain time.
1236+ */
1237+ if (muic_pdata->detcable_delay_ms)
1238+ delay_jiffies =
1239+ msecs_to_jiffies(muic_pdata->detcable_delay_ms);
1240+ else
1241+ delay_jiffies = msecs_to_jiffies(DELAY_MS_DEFAULT);
1242+ } else {
11851243 info->path_usb = CONTROL1_SW_USB;
1244+ info->path_uart = CONTROL1_SW_UART;
1245+ delay_jiffies = msecs_to_jiffies(DELAY_MS_DEFAULT);
1246+ }
11861247
11871248 /* Set initial path for UART */
11881249 max77693_muic_set_path(info, info->path_uart, true);
@@ -1208,10 +1269,6 @@ static int max77693_muic_probe(struct platform_device *pdev) · 19 unmodified lines
12081269 * driver should notify cable state to upper layer.
12091270 */
12101271 INIT_DELAYED_WORK(&info->wq_detcable, max77693_muic_detect_cable_wq);
1211− if (muic_pdata->detcable_delay_ms)
1212− delay_jiffies = msecs_to_jiffies(muic_pdata->detcable_delay_ms);
1213− else
1214− delay_jiffies = msecs_to_jiffies(DELAY_MS_DEFAULT);
12151272 schedule_delayed_work(&info->wq_detcable, delay_jiffies);
12161273
12171274 return ret;
drivers/extcon/extcon-max8997.c+34−22
@@ -712,29 +712,45 @@ static int max8997_muic_probe(struct platform_device *pdev) · 711 unmodified lines
712712 goto err_irq;
713713 }
714714
715− /* Initialize registers according to platform data */
716715 if (pdata->muic_pdata) {
717− struct max8997_muic_platform_data *mdata = info->muic_pdata;
718−
719− for (i = 0; i < mdata->num_init_data; i++) {
720− max8997_write_reg(info->muic, mdata->init_data[i].addr,
721− mdata->init_data[i].data);
716+ struct max8997_muic_platform_data *muic_pdata
717+ = pdata->muic_pdata;
718+
719+ /* Initialize registers according to platform data */
720+ for (i = 0; i < muic_pdata->num_init_data; i++) {
721+ max8997_write_reg(info->muic,
722+ muic_pdata->init_data[i].addr,
723+ muic_pdata->init_data[i].data);
722724 }
723− }
724725
725− /*
726− * Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
727− * h/w path of COMP2/COMN1 on CONTROL1 register.
728− */
729− if (pdata->muic_pdata->path_uart)
730− info->path_uart = pdata->muic_pdata->path_uart;
731− else
732− info->path_uart = CONTROL1_SW_UART;
726+ /*
727+ * Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
728+ * h/w path of COMP2/COMN1 on CONTROL1 register.
729+ */
730+ if (muic_pdata->path_uart)
731+ info->path_uart = muic_pdata->path_uart;
732+ else
733+ info->path_uart = CONTROL1_SW_UART;
733734
734− if (pdata->muic_pdata->path_usb)
735− info->path_usb = pdata->muic_pdata->path_usb;
736− else
735+ if (muic_pdata->path_usb)
736+ info->path_usb = muic_pdata->path_usb;
737+ else
738+ info->path_usb = CONTROL1_SW_USB;
739+
740+ /*
741+ * Default delay time for detecting cable state
742+ * after certain time.
743+ */
744+ if (muic_pdata->detcable_delay_ms)
745+ delay_jiffies =
746+ msecs_to_jiffies(muic_pdata->detcable_delay_ms);
747+ else
748+ delay_jiffies = msecs_to_jiffies(DELAY_MS_DEFAULT);
749+ } else {
750+ info->path_uart = CONTROL1_SW_UART;
737751 info->path_usb = CONTROL1_SW_USB;
752+ delay_jiffies = msecs_to_jiffies(DELAY_MS_DEFAULT);
753+ }
738754
739755 /* Set initial path for UART */
740756 max8997_muic_set_path(info, info->path_uart, true);
@@ -751,10 +767,6 @@ static int max8997_muic_probe(struct platform_device *pdev) · 10 unmodified lines
751767 * driver should notify cable state to upper layer.
752768 */
753769 INIT_DELAYED_WORK(&info->wq_detcable, max8997_muic_detect_cable_wq);
754− if (pdata->muic_pdata->detcable_delay_ms)
755− delay_jiffies = msecs_to_jiffies(pdata->muic_pdata->detcable_delay_ms);
756− else
757− delay_jiffies = msecs_to_jiffies(DELAY_MS_DEFAULT);
758770 schedule_delayed_work(&info->wq_detcable, delay_jiffies);
759771
760772 return 0;
drivers/firmware/Kconfig+19−0
@@ -39,6 +39,7 @@ config FIRMWARE_MEMMAP · 38 unmodified lines
3939 config EFI_VARS
4040 tristate "EFI Variable Support via sysfs"
4141 depends on EFI
42+ select UCS2_STRING
4243 default n
4344 help
4445 If you say Y here, you are able to get EFI (Extensible Firmware
@@ -53,6 +54,24 @@ config EFI_VARS · 8 unmodified lines
5354 Subsequent efibootmgr releases may be found at:
5455 <http://linux.dell.com/efibootmgr>
5556
57+config EFI_VARS_PSTORE
58+ bool "Register efivars backend for pstore"
59+ depends on EFI_VARS && PSTORE
60+ default y
61+ help
62+ Say Y here to enable use efivars as a backend to pstore. This
63+ will allow writing console messages, crash dumps, or anything
64+ else supported by pstore to EFI variables.
65+
66+config EFI_VARS_PSTORE_DEFAULT_DISABLE
67+ bool "Disable using efivars as a pstore backend by default"
68+ depends on EFI_VARS_PSTORE
69+ default n
70+ help
71+ Saying Y here will disable the use of efivars as a storage
72+ backend for pstore by default. This setting can be overridden
73+ using the efivars module's pstore_disable parameter.
74+
5675 config EFI_PCDP
5776 bool "Console device selection via EFI PCDP or HCDP table"
5877 depends on ACPI && EFI && IA64
drivers/firmware/efivars.c+125−123
@@ -80,6 +80,7 @@ · 79 unmodified lines
8080 #include <linux/slab.h>
8181 #include <linux/pstore.h>
8282 #include <linux/ctype.h>
83+#include <linux/ucs2_string.h>
8384
8485 #include <linux/fs.h>
8586 #include <linux/ramfs.h>
@@ -103,6 +104,11 @@ MODULE_VERSION(EFIVARS_VERSION); · 17 unmodified lines
103104 */
104105 #define GUID_LEN 36
105106
107+static bool efivars_pstore_disable =
108+ IS_ENABLED(CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE);
109+
110+module_param_named(pstore_disable, efivars_pstore_disable, bool, 0644);
111+
106112 /*
107113 * The maximum size of VariableName + Data = 1024
108114 * Therefore, it's reasonable to save that much
@@ -165,51 +171,7 @@ efivar_create_sysfs_entry(struct efivars *efivars, · 56 unmodified lines
165171
166172 static void efivar_update_sysfs_entries(struct work_struct *);
167173 static DECLARE_WORK(efivar_work, efivar_update_sysfs_entries);
168−
169−/* Return the number of unicode characters in data */
170−static unsigned long
171−utf16_strnlen(efi_char16_t *s, size_t maxlength)
172−{
173− unsigned long length = 0;
174−
175− while (*s++ != 0 && length < maxlength)
176− length++;
177− return length;
178−}
179−
180−static inline unsigned long
181−utf16_strlen(efi_char16_t *s)
182−{
183− return utf16_strnlen(s, ~0UL);
184−}
185−
186−/*
187− * Return the number of bytes is the length of this string
188− * Note: this is NOT the same as the number of unicode characters
189− */
190−static inline unsigned long
191−utf16_strsize(efi_char16_t *data, unsigned long maxlength)
192−{
193− return utf16_strnlen(data, maxlength/sizeof(efi_char16_t)) * sizeof(efi_char16_t);
194−}
195−
196−static inline int
197−utf16_strncmp(const efi_char16_t *a, const efi_char16_t *b, size_t len)
198−{
199− while (1) {
200− if (len == 0)
201− return 0;
202− if (*a < *b)
203− return -1;
204− if (*a > *b)
205− return 1;
206− if (*a == 0) /* implies *b == 0 */
207− return 0;
208− a++;
209− b++;
210− len--;
211− }
212−}
174+static bool efivar_wq_enabled = true;
213175
214176 static bool
215177 validate_device_path(struct efi_variable *var, int match, u8 *buffer,
@@ -262,7 +224,7 @@ validate_load_option(struct efi_variable *var, int match, u8 *buffer, · 46 unmodified lines
262224 u16 filepathlength;
263225 int i, desclength = 0, namelen;
264226
265− namelen = utf16_strnlen(var->VariableName, sizeof(var->VariableName));
227+ namelen = ucs2_strnlen(var->VariableName, sizeof(var->VariableName));
266228
267229 /* Either "Boot" or "Driver" followed by four digits of hex */
268230 for (i = match; i < match+4; i++) {
@@ -285,7 +247,7 @@ validate_load_option(struct efi_variable *var, int match, u8 *buffer, · 16 unmodified lines
285247 * There's no stored length for the description, so it has to be
286248 * found by hand
287249 */
288− desclength = utf16_strsize((efi_char16_t *)(buffer + 6), len - 6) + 2;
250+ desclength = ucs2_strsize((efi_char16_t *)(buffer + 6), len - 6) + 2;
289251
290252 /* Each boot entry must have a descriptor */
291253 if (!desclength)
@@ -430,24 +392,12 @@ static efi_status_t · 138 unmodified lines
430392 check_var_size_locked(struct efivars *efivars, u32 attributes,
431393 unsigned long size)
432394 {
433− u64 storage_size, remaining_size, max_size;
434− efi_status_t status;
435395 const struct efivar_operations *fops = efivars->ops;
436396
437− if (!efivars->ops->query_variable_info)
397+ if (!efivars->ops->query_variable_store)
438398 return EFI_UNSUPPORTED;
439399
440− status = fops->query_variable_info(attributes, &storage_size,
441− &remaining_size, &max_size);
442−
443− if (status != EFI_SUCCESS)
444− return status;
445−
446− if (!storage_size || size > remaining_size || size > max_size ||
447− (remaining_size - size) < (storage_size / 2))
448− return EFI_OUT_OF_RESOURCES;
449−
450− return status;
400+ return fops->query_variable_store(attributes, size);
451401 }
452402
453403
@@ -587,7 +537,7 @@ efivar_store_raw(struct efivar_entry *entry, const char *buf, size_t count) · 133 unmodified lines
587537 spin_lock_irq(&efivars->lock);
588538
589539 status = check_var_size_locked(efivars, new_var->Attributes,
590− new_var->DataSize + utf16_strsize(new_var->VariableName, 1024));
540+ new_var->DataSize + ucs2_strsize(new_var->VariableName, 1024));
591541
592542 if (status == EFI_SUCCESS || status == EFI_UNSUPPORTED)
593543 status = efivars->ops->set_variable(new_var->VariableName,
@@ -765,7 +715,7 @@ static ssize_t efivarfs_file_write(struct file *file, · 171 unmodified lines
765715 * QueryVariableInfo() isn't supported by the firmware.
766716 */
767717
768− varsize = datasize + utf16_strsize(var->var.VariableName, 1024);
718+ varsize = datasize + ucs2_strsize(var->var.VariableName, 1024);
769719 status = check_var_size(efivars, attributes, varsize);
770720
771721 if (status != EFI_SUCCESS) {
@@ -1217,7 +1167,7 @@ static int efivarfs_fill_super(struct super_block *sb, void *data, int silent) · 445 unmodified lines
12171167
12181168 inode = NULL;
12191169
1220− len = utf16_strlen(entry->var.VariableName);
1170+ len = ucs2_strlen(entry->var.VariableName);
12211171
12221172 /* name, plus '-', plus GUID, plus NUL*/
12231173 name = kmalloc(len + 1 + GUID_LEN + 1, GFP_ATOMIC);
@@ -1309,9 +1259,7 @@ static const struct inode_operations efivarfs_dir_inode_operations = { · 85 unmodified lines
13091259 .create = efivarfs_create,
13101260 };
13111261
1312−static struct pstore_info efi_pstore_info;
1313−
1314−#ifdef CONFIG_PSTORE
1262+#ifdef CONFIG_EFI_VARS_PSTORE
13151263
13161264 static int efi_pstore_open(struct pstore_info *psi)
13171265 {
@@ -1441,7 +1389,7 @@ static int efi_pstore_write(enum pstore_type_id type, · 123 unmodified lines
14411389
14421390 spin_unlock_irqrestore(&efivars->lock, flags);
14431391
1444− if (reason == KMSG_DUMP_OOPS)
1392+ if (reason == KMSG_DUMP_OOPS && efivar_wq_enabled)
14451393 schedule_work(&efivar_work);
14461394
14471395 *id = part;
@@ -1477,8 +1425,8 @@ static int efi_pstore_erase(enum pstore_type_id type, u64 id, int count, · 29 unmodified lines
14771425
14781426 if (efi_guidcmp(entry->var.VendorGuid, vendor))
14791427 continue;
1480− if (utf16_strncmp(entry->var.VariableName, efi_name,
1481− utf16_strlen(efi_name))) {
1428+ if (ucs2_strncmp(entry->var.VariableName, efi_name,
1429+ ucs2_strlen(efi_name))) {
14821430 /*
14831431 * Check if an old format,
14841432 * which doesn't support holding
@@ -1490,8 +1438,8 @@ static int efi_pstore_erase(enum pstore_type_id type, u64 id, int count, · 5 unmodified lines
14901438 for (i = 0; i < DUMP_NAME_LEN; i++)
14911439 efi_name_old[i] = name_old[i];
14921440
1493− if (utf16_strncmp(entry->var.VariableName, efi_name_old,
1494− utf16_strlen(efi_name_old)))
1441+ if (ucs2_strncmp(entry->var.VariableName, efi_name_old,
1442+ ucs2_strlen(efi_name_old)))
14951443 continue;
14961444 }
14971445
@@ -1514,38 +1462,6 @@ static int efi_pstore_erase(enum pstore_type_id type, u64 id, int count, · 16 unmodified lines
15141462
15151463 return 0;
15161464 }
1517−#else
1518−static int efi_pstore_open(struct pstore_info *psi)
1519−{
1520− return 0;
1521−}
1522−
1523−static int efi_pstore_close(struct pstore_info *psi)
1524−{
1525− return 0;
1526−}
1527−
1528−static ssize_t efi_pstore_read(u64 *id, enum pstore_type_id *type, int *count,
1529− struct timespec *timespec,
1530− char **buf, struct pstore_info *psi)
1531−{
1532− return -1;
1533−}
1534−
1535−static int efi_pstore_write(enum pstore_type_id type,
1536− enum kmsg_dump_reason reason, u64 *id,
1537− unsigned int part, int count, size_t size,
1538− struct pstore_info *psi)
1539−{
1540− return 0;
1541−}
1542−
1543−static int efi_pstore_erase(enum pstore_type_id type, u64 id, int count,
1544− struct timespec time, struct pstore_info *psi)
1545−{
1546− return 0;
1547−}
1548−#endif
15491465
15501466 static struct pstore_info efi_pstore_info = {
15511467 .owner = THIS_MODULE,
@@ -1557,6 +1473,24 @@ static struct pstore_info efi_pstore_info = { · 5 unmodified lines
15571473 .erase = efi_pstore_erase,
15581474 };
15591475
1476+static void efivar_pstore_register(struct efivars *efivars)
1477+{
1478+ efivars->efi_pstore_info = efi_pstore_info;
1479+ efivars->efi_pstore_info.buf = kmalloc(4096, GFP_KERNEL);
1480+ if (efivars->efi_pstore_info.buf) {
1481+ efivars->efi_pstore_info.bufsize = 1024;
1482+ efivars->efi_pstore_info.data = efivars;
1483+ spin_lock_init(&efivars->efi_pstore_info.buf_lock);
1484+ pstore_register(&efivars->efi_pstore_info);
1485+ }
1486+}
1487+#else
1488+static void efivar_pstore_register(struct efivars *efivars)
1489+{
1490+ return;
1491+}
1492+#endif
1493+
15601494 static ssize_t efivar_create(struct file *filp, struct kobject *kobj,
15611495 struct bin_attribute *bin_attr,
15621496 char *buf, loff_t pos, size_t count)
@@ -1583,8 +1517,8 @@ static ssize_t efivar_create(struct file *filp, struct kobject *kobj, · 20 unmodified lines
15831517 * Does this variable already exist?
15841518 */
15851519 list_for_each_entry_safe(search_efivar, n, &efivars->list, list) {
1586− strsize1 = utf16_strsize(search_efivar->var.VariableName, 1024);
1587− strsize2 = utf16_strsize(new_var->VariableName, 1024);
1520+ strsize1 = ucs2_strsize(search_efivar->var.VariableName, 1024);
1521+ strsize2 = ucs2_strsize(new_var->VariableName, 1024);
15881522 if (strsize1 == strsize2 &&
15891523 !memcmp(&(search_efivar->var.VariableName),
15901524 new_var->VariableName, strsize1) &&
@@ -1600,7 +1534,7 @@ static ssize_t efivar_create(struct file *filp, struct kobject *kobj, · 9 unmodified lines
16001534 }
16011535
16021536 status = check_var_size_locked(efivars, new_var->Attributes,
1603− new_var->DataSize + utf16_strsize(new_var->VariableName, 1024));
1537+ new_var->DataSize + ucs2_strsize(new_var->VariableName, 1024));
16041538
16051539 if (status && status != EFI_UNSUPPORTED) {
16061540 spin_unlock_irq(&efivars->lock);
@@ -1624,7 +1558,7 @@ static ssize_t efivar_create(struct file *filp, struct kobject *kobj, · 17 unmodified lines
16241558
16251559 /* Create the entry in sysfs. Locking is not required here */
16261560 status = efivar_create_sysfs_entry(efivars,
1627− utf16_strsize(new_var->VariableName,
1561+ ucs2_strsize(new_var->VariableName,
16281562 1024),
16291563 new_var->VariableName,
16301564 &new_var->VendorGuid);
@@ -1654,8 +1588,8 @@ static ssize_t efivar_delete(struct file *filp, struct kobject *kobj, · 23 unmodified lines
16541588 * Does this variable already exist?
16551589 */
16561590 list_for_each_entry_safe(search_efivar, n, &efivars->list, list) {
1657− strsize1 = utf16_strsize(search_efivar->var.VariableName, 1024);
1658− strsize2 = utf16_strsize(del_var->VariableName, 1024);
1591+ strsize1 = ucs2_strsize(search_efivar->var.VariableName, 1024);
1592+ strsize2 = ucs2_strsize(del_var->VariableName, 1024);
16591593 if (strsize1 == strsize2 &&
16601594 !memcmp(&(search_efivar->var.VariableName),
16611595 del_var->VariableName, strsize1) &&
@@ -1701,9 +1635,9 @@ static bool variable_is_present(efi_char16_t *variable_name, efi_guid_t *vendor) · 39 unmodified lines
17011635 unsigned long strsize1, strsize2;
17021636 bool found = false;
17031637
1704− strsize1 = utf16_strsize(variable_name, 1024);
1638+ strsize1 = ucs2_strsize(variable_name, 1024);
17051639 list_for_each_entry_safe(entry, n, &efivars->list, list) {
1706− strsize2 = utf16_strsize(entry->var.VariableName, 1024);
1640+ strsize2 = ucs2_strsize(entry->var.VariableName, 1024);
17071641 if (strsize1 == strsize2 &&
17081642 !memcmp(variable_name, &(entry->var.VariableName),
17091643 strsize2) &&
@@ -1716,6 +1650,31 @@ static bool variable_is_present(efi_char16_t *variable_name, efi_guid_t *vendor) · 6 unmodified lines
17161650 return found;
17171651 }
17181652
1653+/*
1654+ * Returns the size of variable_name, in bytes, including the
1655+ * terminating NULL character, or variable_name_size if no NULL
1656+ * character is found among the first variable_name_size bytes.
1657+ */
1658+static unsigned long var_name_strnsize(efi_char16_t *variable_name,
1659+ unsigned long variable_name_size)
1660+{
1661+ unsigned long len;
1662+ efi_char16_t c;
1663+
1664+ /*
1665+ * The variable name is, by definition, a NULL-terminated
1666+ * string, so make absolutely sure that variable_name_size is
1667+ * the value we expect it to be. If not, return the real size.
1668+ */
1669+ for (len = 2; len <= variable_name_size; len += sizeof(c)) {
1670+ c = variable_name[(len / sizeof(c)) - 1];
1671+ if (!c)
1672+ break;
1673+ }
1674+
1675+ return min(len, variable_name_size);
1676+}
1677+
17191678 static void efivar_update_sysfs_entries(struct work_struct *work)
17201679 {
17211680 struct efivars *efivars = &__efivars;
@@ -1756,10 +1715,13 @@ static void efivar_update_sysfs_entries(struct work_struct *work) · 34 unmodified lines
17561715 if (!found) {
17571716 kfree(variable_name);
17581717 break;
1759− } else
1718+ } else {
1719+ variable_name_size = var_name_strnsize(variable_name,
1720+ variable_name_size);
17601721 efivar_create_sysfs_entry(efivars,
17611722 variable_name_size,
17621723 variable_name, &vendor);
1724+ }
17631725 }
17641726 }
17651727
@@ -1958,6 +1920,35 @@ void unregister_efivars(struct efivars *efivars) · 192 unmodified lines
19581920 }
19591921 EXPORT_SYMBOL_GPL(unregister_efivars);
19601922
1923+/*
1924+ * Print a warning when duplicate EFI variables are encountered and
1925+ * disable the sysfs workqueue since the firmware is buggy.
1926+ */
1927+static void dup_variable_bug(efi_char16_t *s16, efi_guid_t *vendor_guid,
1928+ unsigned long len16)
1929+{
1930+ size_t i, len8 = len16 / sizeof(efi_char16_t);
1931+ char *s8;
1932+
1933+ /*
1934+ * Disable the workqueue since the algorithm it uses for
1935+ * detecting new variables won't work with this buggy
1936+ * implementation of GetNextVariableName().
1937+ */
1938+ efivar_wq_enabled = false;
1939+
1940+ s8 = kzalloc(len8, GFP_KERNEL);
1941+ if (!s8)
1942+ return;
1943+
1944+ for (i = 0; i < len8; i++)
1945+ s8[i] = s16[i];
1946+
1947+ printk(KERN_WARNING "efivars: duplicate variable: %s-%pUl\n",
1948+ s8, vendor_guid);
1949+ kfree(s8);
1950+}
1951+
19611952 int register_efivars(struct efivars *efivars,
19621953 const struct efivar_operations *ops,
19631954 struct kobject *parent_kobj)
@@ -2006,6 +1997,24 @@ int register_efivars(struct efivars *efivars, · 42 unmodified lines
20061997 &vendor_guid);
20071998 switch (status) {
20081999 case EFI_SUCCESS:
2000+ variable_name_size = var_name_strnsize(variable_name,
2001+ variable_name_size);
2002+
2003+ /*
2004+ * Some firmware implementations return the
2005+ * same variable name on multiple calls to
2006+ * get_next_variable(). Terminate the loop
2007+ * immediately as there is no guarantee that
2008+ * we'll ever see a different variable name,
2009+ * and may end up looping here forever.
2010+ */
2011+ if (variable_is_present(variable_name, &vendor_guid)) {
2012+ dup_variable_bug(variable_name, &vendor_guid,
2013+ variable_name_size);
2014+ status = EFI_NOT_FOUND;
2015+ break;
2016+ }
2017+
20092018 efivar_create_sysfs_entry(efivars,
20102019 variable_name_size,
20112020 variable_name,
@@ -2025,15 +2034,8 @@ int register_efivars(struct efivars *efivars, · 13 unmodified lines
20252034 if (error)
20262035 unregister_efivars(efivars);
20272036
2028− efivars->efi_pstore_info = efi_pstore_info;
2029−
2030− efivars->efi_pstore_info.buf = kmalloc(4096, GFP_KERNEL);
2031− if (efivars->efi_pstore_info.buf) {
2032− efivars->efi_pstore_info.bufsize = 1024;
2033− efivars->efi_pstore_info.data = efivars;
2034− spin_lock_init(&efivars->efi_pstore_info.buf_lock);
2035− pstore_register(&efivars->efi_pstore_info);
2036− }
2037+ if (!efivars_pstore_disable)
2038+ efivar_pstore_register(efivars);
20372039
20382040 register_filesystem(&efivarfs_type);
20392041
@@ -2073,7 +2075,7 @@ efivars_init(void) · 33 unmodified lines
20732075 ops.get_variable = efi.get_variable;
20742076 ops.set_variable = efi.set_variable;
20752077 ops.get_next_variable = efi.get_next_variable;
2076− ops.query_variable_info = efi.query_variable_info;
2078+ ops.query_variable_store = efi_query_variable_store;
20772079
20782080 error = register_efivars(&__efivars, &ops, efi_kobj);
20792081 if (error)
drivers/gpio/gpio-ich.c+1−1
@@ -214,7 +214,7 @@ static int ichx_gpio_request(struct gpio_chip *chip, unsigned nr) · 213 unmodified lines
214214 * If it can't be trusted, assume that the pin can be used as a GPIO.
215215 */
216216 if (ichx_priv.desc->use_sel_ignore[nr / 32] & (1 << (nr & 0x1f)))
217− return 1;
217+ return 0;
218218
219219 return ichx_read_bit(GPIO_USE_SEL, nr) ? 0 : -ENODEV;
220220 }
drivers/gpio/gpio-mvebu.c+7−0
@@ -42,6 +42,7 @@ · 41 unmodified lines
4242 #include <linux/io.h>
4343 #include <linux/of_irq.h>
4444 #include <linux/of_device.h>
45+#include <linux/clk.h>
4546 #include <linux/pinctrl/consumer.h>
4647
4748 /*
@@ -496,6 +497,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev) · 448 unmodified lines
496497 struct resource *res;
497498 struct irq_chip_generic *gc;
498499 struct irq_chip_type *ct;
500+ struct clk *clk;
499501 unsigned int ngpios;
500502 int soc_variant;
501503 int i, cpu, id;
@@ -529,6 +531,11 @@ static int mvebu_gpio_probe(struct platform_device *pdev) · 27 unmodified lines
529531 return id;
530532 }
531533
534+ clk = devm_clk_get(&pdev->dev, NULL);
535+ /* Not all SoCs require a clock.*/
536+ if (!IS_ERR(clk))
537+ clk_prepare_enable(clk);
538+
532539 mvchip->soc_variant = soc_variant;
533540 mvchip->chip.label = dev_name(&pdev->dev);
534541 mvchip->chip.dev = &pdev->dev;
drivers/gpio/gpio-pca953x.c+1−1
@@ -575,7 +575,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip, · 574 unmodified lines
575575 chip->gpio_chip.ngpio,
576576 irq_base,
577577 &pca953x_irq_simple_ops,
578− NULL);
578+ chip);
579579 if (!chip->domain)
580580 return -ENODEV;
581581
drivers/gpio/gpio-stmpe.c+11−4
@@ -307,11 +307,15 @@ static const struct irq_domain_ops stmpe_gpio_irq_simple_ops = { · 306 unmodified lines
307307 .xlate = irq_domain_xlate_twocell,
308308 };
309309
310−static int stmpe_gpio_irq_init(struct stmpe_gpio *stmpe_gpio)
310+static int stmpe_gpio_irq_init(struct stmpe_gpio *stmpe_gpio,
311+ struct device_node *np)
311312 {
312− int base = stmpe_gpio->irq_base;
313+ int base = 0;
313314
314− stmpe_gpio->domain = irq_domain_add_simple(NULL,
315+ if (!np)
316+ base = stmpe_gpio->irq_base;
317+
318+ stmpe_gpio->domain = irq_domain_add_simple(np,
315319 stmpe_gpio->chip.ngpio, base,
316320 &stmpe_gpio_irq_simple_ops, stmpe_gpio);
317321 if (!stmpe_gpio->domain) {
@@ -346,6 +350,9 @@ static int stmpe_gpio_probe(struct platform_device *pdev) · 28 unmodified lines
346350 stmpe_gpio->chip = template_chip;
347351 stmpe_gpio->chip.ngpio = stmpe->num_gpios;
348352 stmpe_gpio->chip.dev = &pdev->dev;
353+#ifdef CONFIG_OF
354+ stmpe_gpio->chip.of_node = np;
355+#endif
349356 stmpe_gpio->chip.base = pdata ? pdata->gpio_base : -1;
350357
351358 if (pdata)
@@ -366,7 +373,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev) · 14 unmodified lines
366373 goto out_free;
367374
368375 if (irq >= 0) {
369− ret = stmpe_gpio_irq_init(stmpe_gpio);
376+ ret = stmpe_gpio_irq_init(stmpe_gpio, np);
370377 if (ret)
371378 goto out_disable;
372379
drivers/gpio/gpiolib-of.c+2−3
@@ -193,7 +193,7 @@ static void of_gpiochip_add_pin_range(struct gpio_chip *chip) · 192 unmodified lines
193193 if (!np)
194194 return;
195195
196− do {
196+ for (;; index++) {
197197 ret = of_parse_phandle_with_args(np, "gpio-ranges",
198198 "#gpio-range-cells", index, &pinspec);
199199 if (ret)
@@ -222,8 +222,7 @@ static void of_gpiochip_add_pin_range(struct gpio_chip *chip) · 22 unmodified lines
222222
223223 if (ret)
224224 break;
225−
226− } while (index++);
225+ }
227226 }
228227
229228 #else
drivers/gpu/drm/drm_crtc.c+0−2
@@ -2326,7 +2326,6 @@ int drm_mode_addfb(struct drm_device *dev, · 2325 unmodified lines
23262326 fb = dev->mode_config.funcs->fb_create(dev, file_priv, &r);
23272327 if (IS_ERR(fb)) {
23282328 DRM_DEBUG_KMS("could not create framebuffer\n");
2329− drm_modeset_unlock_all(dev);
23302329 return PTR_ERR(fb);
23312330 }
23322331
@@ -2506,7 +2505,6 @@ int drm_mode_addfb2(struct drm_device *dev, · 173 unmodified lines
25062505 fb = dev->mode_config.funcs->fb_create(dev, file_priv, r);
25072506 if (IS_ERR(fb)) {
25082507 DRM_DEBUG_KMS("could not create framebuffer\n");
2509− drm_modeset_unlock_all(dev);
25102508 return PTR_ERR(fb);
25112509 }
25122510
drivers/gpu/drm/drm_edid.c+2−1
@@ -1634,7 +1634,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev, · 1633 unmodified lines
16341634 unsigned vblank = (pt->vactive_vblank_hi & 0xf) << 8 | pt->vblank_lo;
16351635 unsigned hsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0xc0) << 2 | pt->hsync_offset_lo;
16361636 unsigned hsync_pulse_width = (pt->hsync_vsync_offset_pulse_width_hi & 0x30) << 4 | pt->hsync_pulse_width_lo;
1637− unsigned vsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0xc) >> 2 | pt->vsync_offset_pulse_width_lo >> 4;
1637+ unsigned vsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0xc) << 2 | pt->vsync_offset_pulse_width_lo >> 4;
16381638 unsigned vsync_pulse_width = (pt->hsync_vsync_offset_pulse_width_hi & 0x3) << 4 | (pt->vsync_offset_pulse_width_lo & 0xf);
16391639
16401640 /* ignore tiny modes */
@@ -1715,6 +1715,7 @@ set_size: · 74 unmodified lines
17151715 }
17161716
17171717 mode->type = DRM_MODE_TYPE_DRIVER;
1718+ mode->vrefresh = drm_mode_vrefresh(mode);
17181719 drm_mode_set_name(mode);
17191720
17201721 return mode;
drivers/gpu/drm/drm_fb_helper.c+5−3
@@ -1544,10 +1544,10 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) · 1543 unmodified lines
15441544 if (!fb_helper->fb)
15451545 return 0;
15461546
1547− drm_modeset_lock_all(dev);
1547+ mutex_lock(&fb_helper->dev->mode_config.mutex);
15481548 if (!drm_fb_helper_is_bound(fb_helper)) {
15491549 fb_helper->delayed_hotplug = true;
1550− drm_modeset_unlock_all(dev);
1550+ mutex_unlock(&fb_helper->dev->mode_config.mutex);
15511551 return 0;
15521552 }
15531553 DRM_DEBUG_KMS("\n");
@@ -1558,9 +1558,11 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) · 4 unmodified lines
15581558
15591559 count = drm_fb_helper_probe_connector_modes(fb_helper, max_width,
15601560 max_height);
1561+ mutex_unlock(&fb_helper->dev->mode_config.mutex);
1562+
1563+ drm_modeset_lock_all(dev);
15611564 drm_setup_crtcs(fb_helper);
15621565 drm_modeset_unlock_all(dev);
1563−
15641566 drm_fb_helper_set_par(fb_helper->fbdev);
15651567
15661568 return 0;
drivers/gpu/drm/drm_fops.c+4−2
@@ -123,6 +123,7 @@ int drm_open(struct inode *inode, struct file *filp) · 122 unmodified lines
123123 int retcode = 0;
124124 int need_setup = 0;
125125 struct address_space *old_mapping;
126+ struct address_space *old_imapping;
126127
127128 minor = idr_find(&drm_minors_idr, minor_id);
128129 if (!minor)
@@ -137,6 +138,7 @@ int drm_open(struct inode *inode, struct file *filp) · 8 unmodified lines
137138 if (!dev->open_count++)
138139 need_setup = 1;
139140 mutex_lock(&dev->struct_mutex);
141+ old_imapping = inode->i_mapping;
140142 old_mapping = dev->dev_mapping;
141143 if (old_mapping == NULL)
142144 dev->dev_mapping = &inode->i_data;
@@ -159,8 +161,8 @@ int drm_open(struct inode *inode, struct file *filp) · 16 unmodified lines
159161
160162 err_undo:
161163 mutex_lock(&dev->struct_mutex);
162− filp->f_mapping = old_mapping;
163− inode->i_mapping = old_mapping;
164+ filp->f_mapping = old_imapping;
165+ inode->i_mapping = old_imapping;
164166 iput(container_of(dev->dev_mapping, struct inode, i_data));
165167 dev->dev_mapping = old_mapping;
166168 mutex_unlock(&dev->struct_mutex);
drivers/gpu/drm/exynos/exynos_drm_fimd.c+11−10
@@ -38,11 +38,12 @@ · 37 unmodified lines
3838 /* position control register for hardware window 0, 2 ~ 4.*/
3939 #define VIDOSD_A(win) (VIDOSD_BASE + 0x00 + (win) * 16)
4040 #define VIDOSD_B(win) (VIDOSD_BASE + 0x04 + (win) * 16)
41−/* size control register for hardware window 0. */
42−#define VIDOSD_C_SIZE_W0 (VIDOSD_BASE + 0x08)
43−/* alpha control register for hardware window 1 ~ 4. */
44−#define VIDOSD_C(win) (VIDOSD_BASE + 0x18 + (win) * 16)
45−/* size control register for hardware window 1 ~ 4. */
41+/*
42+ * size control register for hardware windows 0 and alpha control register
43+ * for hardware windows 1 ~ 4
44+ */
45+#define VIDOSD_C(win) (VIDOSD_BASE + 0x08 + (win) * 16)
46+/* size control register for hardware windows 1 ~ 2. */
4647 #define VIDOSD_D(win) (VIDOSD_BASE + 0x0C + (win) * 16)
4748
4849 #define VIDWx_BUF_START(win, buf) (VIDW_BUF_START(buf) + (win) * 8)
@@ -50,9 +51,9 @@ · 1 unmodified line
5051 #define VIDWx_BUF_SIZE(win, buf) (VIDW_BUF_SIZE(buf) + (win) * 4)
5152
5253 /* color key control register for hardware window 1 ~ 4. */
53−#define WKEYCON0_BASE(x) ((WKEYCON0 + 0x140) + (x * 8))
54+#define WKEYCON0_BASE(x) ((WKEYCON0 + 0x140) + ((x - 1) * 8))
5455 /* color key value register for hardware window 1 ~ 4. */
55−#define WKEYCON1_BASE(x) ((WKEYCON1 + 0x140) + (x * 8))
56+#define WKEYCON1_BASE(x) ((WKEYCON1 + 0x140) + ((x - 1) * 8))
5657
5758 /* FIMD has totally five hardware windows. */
5859 #define WINDOWS_NR 5
@@ -109,9 +110,9 @@ struct fimd_context { · 50 unmodified lines
109110
110111 #ifdef CONFIG_OF
111112 static const struct of_device_id fimd_driver_dt_match[] = {
112− { .compatible = "samsung,exynos4-fimd",
113+ { .compatible = "samsung,exynos4210-fimd",
113114 .data = &exynos4_fimd_driver_data },
114− { .compatible = "samsung,exynos5-fimd",
115+ { .compatible = "samsung,exynos5250-fimd",
115116 .data = &exynos5_fimd_driver_data },
116117 {},
117118 };
@@ -581,7 +582,7 @@ static void fimd_win_commit(struct device *dev, int zpos) · 463 unmodified lines
581582 if (win != 3 && win != 4) {
582583 u32 offset = VIDOSD_D(win);
583584 if (win == 0)
584− offset = VIDOSD_C_SIZE_W0;
585+ offset = VIDOSD_C(win);
585586 val = win_data->ovl_width * win_data->ovl_height;
586587 writel(val, ctx->regs + offset);
587588
drivers/gpu/drm/exynos/exynos_drm_g2d.c+325−45
@@ -48,8 +48,14 @@ · 47 unmodified lines
4848
4949 /* registers for base address */
5050 #define G2D_SRC_BASE_ADDR 0x0304
51+#define G2D_SRC_COLOR_MODE 0x030C
52+#define G2D_SRC_LEFT_TOP 0x0310
53+#define G2D_SRC_RIGHT_BOTTOM 0x0314
5154 #define G2D_SRC_PLANE2_BASE_ADDR 0x0318
5255 #define G2D_DST_BASE_ADDR 0x0404
56+#define G2D_DST_COLOR_MODE 0x040C
57+#define G2D_DST_LEFT_TOP 0x0410
58+#define G2D_DST_RIGHT_BOTTOM 0x0414
5359 #define G2D_DST_PLANE2_BASE_ADDR 0x0418
5460 #define G2D_PAT_BASE_ADDR 0x0500
5561 #define G2D_MSK_BASE_ADDR 0x0520
@@ -82,7 +88,7 @@ · 26 unmodified lines
8288 #define G2D_DMA_LIST_DONE_COUNT_OFFSET 17
8389
8490 /* G2D_DMA_HOLD_CMD */
85−#define G2D_USET_HOLD (1 << 2)
91+#define G2D_USER_HOLD (1 << 2)
8692 #define G2D_LIST_HOLD (1 << 1)
8793 #define G2D_BITBLT_HOLD (1 << 0)
8894
@@ -91,13 +97,27 @@ · 2 unmodified lines
9197 #define G2D_START_NHOLT (1 << 1)
9298 #define G2D_START_BITBLT (1 << 0)
9399
100+/* buffer color format */
101+#define G2D_FMT_XRGB8888 0
102+#define G2D_FMT_ARGB8888 1
103+#define G2D_FMT_RGB565 2
104+#define G2D_FMT_XRGB1555 3
105+#define G2D_FMT_ARGB1555 4
106+#define G2D_FMT_XRGB4444 5
107+#define G2D_FMT_ARGB4444 6
108+#define G2D_FMT_PACKED_RGB888 7
109+#define G2D_FMT_A8 11
110+#define G2D_FMT_L8 12
111+
112+/* buffer valid length */
113+#define G2D_LEN_MIN 1
114+#define G2D_LEN_MAX 8000
115+
94116 #define G2D_CMDLIST_SIZE (PAGE_SIZE / 4)
95117 #define G2D_CMDLIST_NUM 64
96118 #define G2D_CMDLIST_POOL_SIZE (G2D_CMDLIST_SIZE * G2D_CMDLIST_NUM)
97119 #define G2D_CMDLIST_DATA_NUM (G2D_CMDLIST_SIZE / sizeof(u32) - 2)
98120
99−#define MAX_BUF_ADDR_NR 6
100−
101121 /* maximum buffer pool size of userptr is 64MB as default */
102122 #define MAX_POOL (64 * 1024 * 1024)
103123
@@ -106,6 +126,17 @@ enum { · 2 unmodified lines
106126 BUF_TYPE_USERPTR,
107127 };
108128
129+enum g2d_reg_type {
130+ REG_TYPE_NONE = -1,
131+ REG_TYPE_SRC,
132+ REG_TYPE_SRC_PLANE2,
133+ REG_TYPE_DST,
134+ REG_TYPE_DST_PLANE2,
135+ REG_TYPE_PAT,
136+ REG_TYPE_MSK,
137+ MAX_REG_TYPE_NR
138+};
139+
109140 /* cmdlist data structure */
110141 struct g2d_cmdlist {
111142 u32 head;
@@ -113,6 +144,42 @@ struct g2d_cmdlist { · 1 unmodified line
113144 u32 last; /* last data offset */
114145 };
115146
147+/*
148+ * A structure of buffer description
149+ *
150+ * @format: color format
151+ * @left_x: the x coordinates of left top corner
152+ * @top_y: the y coordinates of left top corner
153+ * @right_x: the x coordinates of right bottom corner
154+ * @bottom_y: the y coordinates of right bottom corner
155+ *
156+ */
157+struct g2d_buf_desc {
158+ unsigned int format;
159+ unsigned int left_x;
160+ unsigned int top_y;
161+ unsigned int right_x;
162+ unsigned int bottom_y;
163+};
164+
165+/*
166+ * A structure of buffer information
167+ *
168+ * @map_nr: manages the number of mapped buffers
169+ * @reg_types: stores regitster type in the order of requested command
170+ * @handles: stores buffer handle in its reg_type position
171+ * @types: stores buffer type in its reg_type position
172+ * @descs: stores buffer description in its reg_type position
173+ *
174+ */
175+struct g2d_buf_info {
176+ unsigned int map_nr;
177+ enum g2d_reg_type reg_types[MAX_REG_TYPE_NR];
178+ unsigned long handles[MAX_REG_TYPE_NR];
179+ unsigned int types[MAX_REG_TYPE_NR];
180+ struct g2d_buf_desc descs[MAX_REG_TYPE_NR];
181+};
182+
116183 struct drm_exynos_pending_g2d_event {
117184 struct drm_pending_event base;
118185 struct drm_exynos_g2d_event event;
@@ -131,14 +198,11 @@ struct g2d_cmdlist_userptr { · 12 unmodified lines
131198 bool in_pool;
132199 bool out_of_list;
133200 };
134−
135201 struct g2d_cmdlist_node {
136202 struct list_head list;
137203 struct g2d_cmdlist *cmdlist;
138− unsigned int map_nr;
139− unsigned long handles[MAX_BUF_ADDR_NR];
140− unsigned int obj_type[MAX_BUF_ADDR_NR];
141204 dma_addr_t dma_addr;
205+ struct g2d_buf_info buf_info;
142206
143207 struct drm_exynos_pending_g2d_event *event;
144208 };
@@ -188,6 +252,7 @@ static int g2d_init_cmdlist(struct g2d_data *g2d) · 43 unmodified lines
188252 struct exynos_drm_subdrv *subdrv = &g2d->subdrv;
189253 int nr;
190254 int ret;
255+ struct g2d_buf_info *buf_info;
191256
192257 init_dma_attrs(&g2d->cmdlist_dma_attrs);
193258 dma_set_attr(DMA_ATTR_WRITE_COMBINE, &g2d->cmdlist_dma_attrs);
@@ -209,11 +274,17 @@ static int g2d_init_cmdlist(struct g2d_data *g2d) · 15 unmodified lines
209274 }
210275
211276 for (nr = 0; nr < G2D_CMDLIST_NUM; nr++) {
277+ unsigned int i;
278+
212279 node[nr].cmdlist =
213280 g2d->cmdlist_pool_virt + nr * G2D_CMDLIST_SIZE;
214281 node[nr].dma_addr =
215282 g2d->cmdlist_pool + nr * G2D_CMDLIST_SIZE;
216283
284+ buf_info = &node[nr].buf_info;
285+ for (i = 0; i < MAX_REG_TYPE_NR; i++)
286+ buf_info->reg_types[i] = REG_TYPE_NONE;
287+
217288 list_add_tail(&node[nr].list, &g2d->free_cmdlist);
218289 }
219290
@@ -450,7 +521,7 @@ static dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev, · 230 unmodified lines
450521 DMA_BIDIRECTIONAL);
451522 if (ret < 0) {
452523 DRM_ERROR("failed to map sgt with dma region.\n");
453− goto err_free_sgt;
524+ goto err_sg_free_table;
454525 }
455526
456527 g2d_userptr->dma_addr = sgt->sgl[0].dma_address;
@@ -467,8 +538,10 @@ static dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev, · 10 unmodified lines
467538
468539 return &g2d_userptr->dma_addr;
469540
470−err_free_sgt:
541+err_sg_free_table:
471542 sg_free_table(sgt);
543+
544+err_free_sgt:
472545 kfree(sgt);
473546 sgt = NULL;
474547
@@ -506,36 +579,172 @@ static void g2d_userptr_free_all(struct drm_device *drm_dev, · 31 unmodified lines
506579 g2d->current_pool = 0;
507580 }
508581
582+static enum g2d_reg_type g2d_get_reg_type(int reg_offset)
583+{
584+ enum g2d_reg_type reg_type;
585+
586+ switch (reg_offset) {
587+ case G2D_SRC_BASE_ADDR:
588+ case G2D_SRC_COLOR_MODE:
589+ case G2D_SRC_LEFT_TOP:
590+ case G2D_SRC_RIGHT_BOTTOM:
591+ reg_type = REG_TYPE_SRC;
592+ break;
593+ case G2D_SRC_PLANE2_BASE_ADDR:
594+ reg_type = REG_TYPE_SRC_PLANE2;
595+ break;
596+ case G2D_DST_BASE_ADDR:
597+ case G2D_DST_COLOR_MODE:
598+ case G2D_DST_LEFT_TOP:
599+ case G2D_DST_RIGHT_BOTTOM:
600+ reg_type = REG_TYPE_DST;
601+ break;
602+ case G2D_DST_PLANE2_BASE_ADDR:
603+ reg_type = REG_TYPE_DST_PLANE2;
604+ break;
605+ case G2D_PAT_BASE_ADDR:
606+ reg_type = REG_TYPE_PAT;
607+ break;
608+ case G2D_MSK_BASE_ADDR:
609+ reg_type = REG_TYPE_MSK;
610+ break;
611+ default:
612+ reg_type = REG_TYPE_NONE;
613+ DRM_ERROR("Unknown register offset![%d]\n", reg_offset);
614+ break;
615+ };
616+
617+ return reg_type;
618+}
619+
620+static unsigned long g2d_get_buf_bpp(unsigned int format)
621+{
622+ unsigned long bpp;
623+
624+ switch (format) {
625+ case G2D_FMT_XRGB8888:
626+ case G2D_FMT_ARGB8888:
627+ bpp = 4;
628+ break;
629+ case G2D_FMT_RGB565:
630+ case G2D_FMT_XRGB1555:
631+ case G2D_FMT_ARGB1555:
632+ case G2D_FMT_XRGB4444:
633+ case G2D_FMT_ARGB4444:
634+ bpp = 2;
635+ break;
636+ case G2D_FMT_PACKED_RGB888:
637+ bpp = 3;
638+ break;
639+ default:
640+ bpp = 1;
641+ break;
642+ }
643+
644+ return bpp;
645+}
646+
647+static bool g2d_check_buf_desc_is_valid(struct g2d_buf_desc *buf_desc,
648+ enum g2d_reg_type reg_type,
649+ unsigned long size)
650+{
651+ unsigned int width, height;
652+ unsigned long area;
653+
654+ /*
655+ * check source and destination buffers only.
656+ * so the others are always valid.
657+ */
658+ if (reg_type != REG_TYPE_SRC && reg_type != REG_TYPE_DST)
659+ return true;
660+
661+ width = buf_desc->right_x - buf_desc->left_x;
662+ if (width < G2D_LEN_MIN || width > G2D_LEN_MAX) {
663+ DRM_ERROR("width[%u] is out of range!\n", width);
664+ return false;
665+ }
666+
667+ height = buf_desc->bottom_y - buf_desc->top_y;
668+ if (height < G2D_LEN_MIN || height > G2D_LEN_MAX) {
669+ DRM_ERROR("height[%u] is out of range!\n", height);
670+ return false;
671+ }
672+
673+ area = (unsigned long)width * (unsigned long)height *
674+ g2d_get_buf_bpp(buf_desc->format);
675+ if (area > size) {
676+ DRM_ERROR("area[%lu] is out of range[%lu]!\n", area, size);
677+ return false;
678+ }
679+
680+ return true;
681+}
682+
509683 static int g2d_map_cmdlist_gem(struct g2d_data *g2d,
510684 struct g2d_cmdlist_node *node,
511685 struct drm_device *drm_dev,
512686 struct drm_file *file)
513687 {
514688 struct g2d_cmdlist *cmdlist = node->cmdlist;
689+ struct g2d_buf_info *buf_info = &node->buf_info;
515690 int offset;
691+ int ret;
516692 int i;
517693
518− for (i = 0; i < node->map_nr; i++) {
694+ for (i = 0; i < buf_info->map_nr; i++) {
695+ struct g2d_buf_desc *buf_desc;
696+ enum g2d_reg_type reg_type;
697+ int reg_pos;
519698 unsigned long handle;
520699 dma_addr_t *addr;
521700
522− offset = cmdlist->last - (i * 2 + 1);
523− handle = cmdlist->data[offset];
701+ reg_pos = cmdlist->last - 2 * (i + 1);
702+
703+ offset = cmdlist->data[reg_pos];
704+ handle = cmdlist->data[reg_pos + 1];
705+
706+ reg_type = g2d_get_reg_type(offset);
707+ if (reg_type == REG_TYPE_NONE) {
708+ ret = -EFAULT;
709+ goto err;
710+ }
711+
712+ buf_desc = &buf_info->descs[reg_type];
713+
714+ if (buf_info->types[reg_type] == BUF_TYPE_GEM) {
715+ unsigned long size;
716+
717+ size = exynos_drm_gem_get_size(drm_dev, handle, file);
718+ if (!size) {
719+ ret = -EFAULT;
720+ goto err;
721+ }
722+
723+ if (!g2d_check_buf_desc_is_valid(buf_desc, reg_type,
724+ size)) {
725+ ret = -EFAULT;
726+ goto err;
727+ }
524728
525− if (node->obj_type[i] == BUF_TYPE_GEM) {
526729 addr = exynos_drm_gem_get_dma_addr(drm_dev, handle,
527730 file);
528731 if (IS_ERR(addr)) {
529− node->map_nr = i;
530− return -EFAULT;
732+ ret = -EFAULT;
733+ goto err;
531734 }
532735 } else {
533736 struct drm_exynos_g2d_userptr g2d_userptr;
534737
535738 if (copy_from_user(&g2d_userptr, (void __user *)handle,
536739 sizeof(struct drm_exynos_g2d_userptr))) {
537− node->map_nr = i;
538− return -EFAULT;
740+ ret = -EFAULT;
741+ goto err;
742+ }
743+
744+ if (!g2d_check_buf_desc_is_valid(buf_desc, reg_type,
745+ g2d_userptr.size)) {
746+ ret = -EFAULT;
747+ goto err;
539748 }
540749
541750 addr = g2d_userptr_get_dma_addr(drm_dev,
@@ -544,16 +753,21 @@ static int g2d_map_cmdlist_gem(struct g2d_data *g2d, · 2 unmodified lines
544753 file,
545754 &handle);
546755 if (IS_ERR(addr)) {
547− node->map_nr = i;
548− return -EFAULT;
756+ ret = -EFAULT;
757+ goto err;
549758 }
550759 }
551760
552− cmdlist->data[offset] = *addr;
553− node->handles[i] = handle;
761+ cmdlist->data[reg_pos + 1] = *addr;
762+ buf_info->reg_types[i] = reg_type;
763+ buf_info->handles[reg_type] = handle;
554764 }
555765
556766 return 0;
767+
768+err:
769+ buf_info->map_nr = i;
770+ return ret;
557771 }
558772
559773 static void g2d_unmap_cmdlist_gem(struct g2d_data *g2d,
@@ -561,22 +775,33 @@ static void g2d_unmap_cmdlist_gem(struct g2d_data *g2d, · 1 unmodified line
561775 struct drm_file *filp)
562776 {
563777 struct exynos_drm_subdrv *subdrv = &g2d->subdrv;
778+ struct g2d_buf_info *buf_info = &node->buf_info;
564779 int i;
565780
566− for (i = 0; i < node->map_nr; i++) {
567− unsigned long handle = node->handles[i];
781+ for (i = 0; i < buf_info->map_nr; i++) {
782+ struct g2d_buf_desc *buf_desc;
783+ enum g2d_reg_type reg_type;
784+ unsigned long handle;
785+
786+ reg_type = buf_info->reg_types[i];
787+
788+ buf_desc = &buf_info->descs[reg_type];
789+ handle = buf_info->handles[reg_type];
568790
569− if (node->obj_type[i] == BUF_TYPE_GEM)
791+ if (buf_info->types[reg_type] == BUF_TYPE_GEM)
570792 exynos_drm_gem_put_dma_addr(subdrv->drm_dev, handle,
571793 filp);
572794 else
573795 g2d_userptr_put_dma_addr(subdrv->drm_dev, handle,
574796 false);
575797
576− node->handles[i] = 0;
798+ buf_info->reg_types[i] = REG_TYPE_NONE;
799+ buf_info->handles[reg_type] = 0;
800+ buf_info->types[reg_type] = 0;
801+ memset(buf_desc, 0x00, sizeof(*buf_desc));
577802 }
578803
579− node->map_nr = 0;
804+ buf_info->map_nr = 0;
580805 }
581806
582807 static void g2d_dma_start(struct g2d_data *g2d,
@@ -589,10 +814,6 @@ static void g2d_dma_start(struct g2d_data *g2d, · 6 unmodified lines
589814 pm_runtime_get_sync(g2d->dev);
590815 clk_enable(g2d->gate_clk);
591816
592− /* interrupt enable */
593− writel_relaxed(G2D_INTEN_ACF | G2D_INTEN_UCF | G2D_INTEN_GCF,
594− g2d->regs + G2D_INTEN);
595−
596817 writel_relaxed(node->dma_addr, g2d->regs + G2D_DMA_SFR_BASE_ADDR);
597818 writel_relaxed(G2D_DMA_START, g2d->regs + G2D_DMA_COMMAND);
598819 }
@@ -643,7 +864,6 @@ static void g2d_runqueue_worker(struct work_struct *work) · 44 unmodified lines
643864 struct g2d_data *g2d = container_of(work, struct g2d_data,
644865 runqueue_work);
645866
646−
647867 mutex_lock(&g2d->runqueue_mutex);
648868 clk_disable(g2d->gate_clk);
649869 pm_runtime_put_sync(g2d->dev);
@@ -724,20 +944,14 @@ static int g2d_check_reg_offset(struct device *dev, · 74 unmodified lines
724944 int i;
725945
726946 for (i = 0; i < nr; i++) {
727− index = cmdlist->last - 2 * (i + 1);
947+ struct g2d_buf_info *buf_info = &node->buf_info;
948+ struct g2d_buf_desc *buf_desc;
949+ enum g2d_reg_type reg_type;
950+ unsigned long value;
728951
729− if (for_addr) {
730− /* check userptr buffer type. */
731− reg_offset = (cmdlist->data[index] &
732− ~0x7fffffff) >> 31;
733− if (reg_offset) {
734− node->obj_type[i] = BUF_TYPE_USERPTR;
735− cmdlist->data[index] &= ~G2D_BUF_USERPTR;
736− }
737− }
952+ index = cmdlist->last - 2 * (i + 1);
738953
739954 reg_offset = cmdlist->data[index] & ~0xfffff000;
740−
741955 if (reg_offset < G2D_VALID_START || reg_offset > G2D_VALID_END)
742956 goto err;
743957 if (reg_offset % 4)
@@ -753,8 +967,60 @@ static int g2d_check_reg_offset(struct device *dev, · 9 unmodified lines
753967 if (!for_addr)
754968 goto err;
755969
756− if (node->obj_type[i] != BUF_TYPE_USERPTR)
757− node->obj_type[i] = BUF_TYPE_GEM;
970+ reg_type = g2d_get_reg_type(reg_offset);
971+ if (reg_type == REG_TYPE_NONE)
972+ goto err;
973+
974+ /* check userptr buffer type. */
975+ if ((cmdlist->data[index] & ~0x7fffffff) >> 31) {
976+ buf_info->types[reg_type] = BUF_TYPE_USERPTR;
977+ cmdlist->data[index] &= ~G2D_BUF_USERPTR;
978+ } else
979+ buf_info->types[reg_type] = BUF_TYPE_GEM;
980+ break;
981+ case G2D_SRC_COLOR_MODE:
982+ case G2D_DST_COLOR_MODE:
983+ if (for_addr)
984+ goto err;
985+
986+ reg_type = g2d_get_reg_type(reg_offset);
987+ if (reg_type == REG_TYPE_NONE)
988+ goto err;
989+
990+ buf_desc = &buf_info->descs[reg_type];
991+ value = cmdlist->data[index + 1];
992+
993+ buf_desc->format = value & 0xf;
994+ break;
995+ case G2D_SRC_LEFT_TOP:
996+ case G2D_DST_LEFT_TOP:
997+ if (for_addr)
998+ goto err;
999+
1000+ reg_type = g2d_get_reg_type(reg_offset);
1001+ if (reg_type == REG_TYPE_NONE)
1002+ goto err;
1003+
1004+ buf_desc = &buf_info->descs[reg_type];
1005+ value = cmdlist->data[index + 1];
1006+
1007+ buf_desc->left_x = value & 0x1fff;
1008+ buf_desc->top_y = (value & 0x1fff0000) >> 16;
1009+ break;
1010+ case G2D_SRC_RIGHT_BOTTOM:
1011+ case G2D_DST_RIGHT_BOTTOM:
1012+ if (for_addr)
1013+ goto err;
1014+
1015+ reg_type = g2d_get_reg_type(reg_offset);
1016+ if (reg_type == REG_TYPE_NONE)
1017+ goto err;
1018+
1019+ buf_desc = &buf_info->descs[reg_type];
1020+ value = cmdlist->data[index + 1];
1021+
1022+ buf_desc->right_x = value & 0x1fff;
1023+ buf_desc->bottom_y = (value & 0x1fff0000) >> 16;
7581024 break;
7591025 default:
7601026 if (for_addr)
@@ -860,9 +1126,23 @@ int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data, · 99 unmodified lines
8601126 cmdlist->data[cmdlist->last++] = G2D_SRC_BASE_ADDR;
8611127 cmdlist->data[cmdlist->last++] = 0;
8621128
1129+ /*
1130+ * 'LIST_HOLD' command should be set to the DMA_HOLD_CMD_REG
1131+ * and GCF bit should be set to INTEN register if user wants
1132+ * G2D interrupt event once current command list execution is
1133+ * finished.
1134+ * Otherwise only ACF bit should be set to INTEN register so
1135+ * that one interrupt is occured after all command lists
1136+ * have been completed.
1137+ */
8631138 if (node->event) {
1139+ cmdlist->data[cmdlist->last++] = G2D_INTEN;
1140+ cmdlist->data[cmdlist->last++] = G2D_INTEN_ACF | G2D_INTEN_GCF;
8641141 cmdlist->data[cmdlist->last++] = G2D_DMA_HOLD_CMD;
8651142 cmdlist->data[cmdlist->last++] = G2D_LIST_HOLD;
1143+ } else {
1144+ cmdlist->data[cmdlist->last++] = G2D_INTEN;
1145+ cmdlist->data[cmdlist->last++] = G2D_INTEN_ACF;
8661146 }
8671147
8681148 /* Check size of cmdlist: last 2 is about G2D_BITBLT_START */
@@ -887,7 +1167,7 @@ int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data, · 18 unmodified lines
8871167 if (ret < 0)
8881168 goto err_free_event;
8891169
890− node->map_nr = req->cmd_buf_nr;
1170+ node->buf_info.map_nr = req->cmd_buf_nr;
8911171 if (req->cmd_buf_nr) {
8921172 struct drm_exynos_g2d_cmd *cmd_buf;
8931173
drivers/gpu/drm/exynos/exynos_drm_gem.c+21−0
@@ -164,6 +164,27 @@ out: · 163 unmodified lines
164164 exynos_gem_obj = NULL;
165165 }
166166
167+unsigned long exynos_drm_gem_get_size(struct drm_device *dev,
168+ unsigned int gem_handle,
169+ struct drm_file *file_priv)
170+{
171+ struct exynos_drm_gem_obj *exynos_gem_obj;
172+ struct drm_gem_object *obj;
173+
174+ obj = drm_gem_object_lookup(dev, file_priv, gem_handle);
175+ if (!obj) {
176+ DRM_ERROR("failed to lookup gem object.\n");
177+ return 0;
178+ }
179+
180+ exynos_gem_obj = to_exynos_gem_obj(obj);
181+
182+ drm_gem_object_unreference_unlocked(obj);
183+
184+ return exynos_gem_obj->buffer->size;
185+}
186+
187+
167188 struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev,
168189 unsigned long size)
169190 {
drivers/gpu/drm/exynos/exynos_drm_gem.h+5−0
@@ -130,6 +130,11 @@ int exynos_drm_gem_userptr_ioctl(struct drm_device *dev, void *data, · 129 unmodified lines
130130 int exynos_drm_gem_get_ioctl(struct drm_device *dev, void *data,
131131 struct drm_file *file_priv);
132132
133+/* get buffer size to gem handle. */
134+unsigned long exynos_drm_gem_get_size(struct drm_device *dev,
135+ unsigned int gem_handle,
136+ struct drm_file *file_priv);
137+
133138 /* initialize gem object. */
134139 int exynos_drm_gem_init_object(struct drm_gem_object *obj);
135140
drivers/gpu/drm/exynos/exynos_drm_vidi.c+2−4
@@ -117,13 +117,12 @@ static struct edid *vidi_get_edid(struct device *dev, · 116 unmodified lines
117117 }
118118
119119 edid_len = (1 + ctx->raw_edid->extensions) * EDID_LENGTH;
120− edid = kzalloc(edid_len, GFP_KERNEL);
120+ edid = kmemdup(ctx->raw_edid, edid_len, GFP_KERNEL);
121121 if (!edid) {
122122 DRM_DEBUG_KMS("failed to allocate edid\n");
123123 return ERR_PTR(-ENOMEM);
124124 }
125125
126− memcpy(edid, ctx->raw_edid, edid_len);
127126 return edid;
128127 }
129128
@@ -563,12 +562,11 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, void *data, · 433 unmodified lines
563562 return -EINVAL;
564563 }
565564 edid_len = (1 + raw_edid->extensions) * EDID_LENGTH;
566− ctx->raw_edid = kzalloc(edid_len, GFP_KERNEL);
565+ ctx->raw_edid = kmemdup(raw_edid, edid_len, GFP_KERNEL);
567566 if (!ctx->raw_edid) {
568567 DRM_DEBUG_KMS("failed to allocate raw_edid.\n");
569568 return -ENOMEM;
570569 }
571− memcpy(ctx->raw_edid, raw_edid, edid_len);
572570 } else {
573571 /*
574572 * with connection = 0, free raw_edid
drivers/gpu/drm/exynos/exynos_mixer.c+1−1
@@ -818,7 +818,7 @@ static void mixer_win_disable(void *ctx, int win) · 817 unmodified lines
818818 mixer_ctx->win_data[win].enabled = false;
819819 }
820820
821−int mixer_check_timing(void *ctx, struct fb_videomode *timing)
821+static int mixer_check_timing(void *ctx, struct fb_videomode *timing)
822822 {
823823 struct mixer_context *mixer_ctx = ctx;
824824 u32 w, h;
drivers/gpu/drm/i915/i915_debugfs.c+1−1
@@ -103,7 +103,7 @@ static const char *cache_level_str(int type) · 102 unmodified lines
103103 static void
104104 describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
105105 {
106− seq_printf(m, "%p: %s%s %8zdKiB %02x %02x %d %d %d%s%s%s",
106+ seq_printf(m, "%pK: %s%s %8zdKiB %02x %02x %d %d %d%s%s%s",
107107 &obj->base,
108108 get_pin_flag(obj),
109109 get_tiling_flag(obj),
drivers/gpu/drm/i915/i915_drv.c+5−0
@@ -125,6 +125,11 @@ MODULE_PARM_DESC(preliminary_hw_support, · 124 unmodified lines
125125 "Enable Haswell and ValleyView Support. "
126126 "(default: false)");
127127
128+int i915_disable_power_well __read_mostly = 0;
129+module_param_named(disable_power_well, i915_disable_power_well, int, 0600);
130+MODULE_PARM_DESC(disable_power_well,
131+ "Disable the power well when possible (default: false)");
132+
128133 static struct drm_driver driver;
129134 extern int intel_agp_enabled;
130135
drivers/gpu/drm/i915/i915_drv.h+1−0
@@ -1398,6 +1398,7 @@ extern int i915_enable_fbc __read_mostly; · 1397 unmodified lines
13981398 extern bool i915_enable_hangcheck __read_mostly;
13991399 extern int i915_enable_ppgtt __read_mostly;
14001400 extern unsigned int i915_preliminary_hw_support __read_mostly;
1401+extern int i915_disable_power_well __read_mostly;
14011402
14021403 extern int i915_suspend(struct drm_device *dev, pm_message_t state);
14031404 extern int i915_resume(struct drm_device *dev);
drivers/gpu/drm/i915/i915_gem_execbuffer.c+9−4
@@ -57,7 +57,7 @@ eb_create(struct drm_i915_gem_execbuffer2 *args) · 56 unmodified lines
5757 if (eb == NULL) {
5858 int size = args->buffer_count;
5959 int count = PAGE_SIZE / sizeof(struct hlist_head) / 2;
60− BUILD_BUG_ON(!is_power_of_2(PAGE_SIZE / sizeof(struct hlist_head)));
60+ BUILD_BUG_ON_NOT_POWER_OF_2(PAGE_SIZE / sizeof(struct hlist_head));
6161 while (count > 2*size)
6262 count >>= 1;
6363 eb = kzalloc(count*sizeof(struct hlist_head) +
@@ -732,6 +732,8 @@ validate_exec_list(struct drm_i915_gem_exec_object2 *exec, · 668 unmodified lines
732732 int count)
733733 {
734734 int i;
735+ int relocs_total = 0;
736+ int relocs_max = INT_MAX / sizeof(struct drm_i915_gem_relocation_entry);
735737
736738 for (i = 0; i < count; i++) {
737739 char __user *ptr = (char __user *)(uintptr_t)exec[i].relocs_ptr;
@@ -740,10 +742,13 @@ validate_exec_list(struct drm_i915_gem_exec_object2 *exec, · 2 unmodified lines
740742 if (exec[i].flags & __EXEC_OBJECT_UNKNOWN_FLAGS)
741743 return -EINVAL;
742744
743− /* First check for malicious input causing overflow */
744− if (exec[i].relocation_count >
745− INT_MAX / sizeof(struct drm_i915_gem_relocation_entry))
745+ /* First check for malicious input causing overflow in
746+ * the worst case where we need to allocate the entire
747+ * relocation tree as a single array.
748+ */
749+ if (exec[i].relocation_count > relocs_max - relocs_total)
746750 return -EINVAL;
751+ relocs_total += exec[i].relocation_count;
747752
748753 length = exec[i].relocation_count *
749754 sizeof(struct drm_i915_gem_relocation_entry);
drivers/gpu/drm/i915/intel_crt.c+17−23
@@ -45,6 +45,9 @@ · 44 unmodified lines
4545
4646 struct intel_crt {
4747 struct intel_encoder base;
48+ /* DPMS state is stored in the connector, which we need in the
49+ * encoder's enable/disable callbacks */
50+ struct intel_connector *connector;
4851 bool force_hotplug_required;
4952 u32 adpa_reg;
5053 };
@@ -81,29 +84,6 @@ static bool intel_crt_get_hw_state(struct intel_encoder *encoder, · 30 unmodified lines
8184 return true;
8285 }
8386
84−static void intel_disable_crt(struct intel_encoder *encoder)
85−{
86− struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
87− struct intel_crt *crt = intel_encoder_to_crt(encoder);
88− u32 temp;
89−
90− temp = I915_READ(crt->adpa_reg);
91− temp |= ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE;
92− temp &= ~ADPA_DAC_ENABLE;
93− I915_WRITE(crt->adpa_reg, temp);
94−}
95−
96−static void intel_enable_crt(struct intel_encoder *encoder)
97−{
98− struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
99− struct intel_crt *crt = intel_encoder_to_crt(encoder);
100− u32 temp;
101−
102− temp = I915_READ(crt->adpa_reg);
103− temp |= ADPA_DAC_ENABLE;
104− I915_WRITE(crt->adpa_reg, temp);
105−}
106−
10787 /* Note: The caller is required to filter out dpms modes not supported by the
10888 * platform. */
10989 static void intel_crt_set_dpms(struct intel_encoder *encoder, int mode)
@@ -135,6 +115,19 @@ static void intel_crt_set_dpms(struct intel_encoder *encoder, int mode) · 25 unmodified lines
135115 I915_WRITE(crt->adpa_reg, temp);
136116 }
137117
118+static void intel_disable_crt(struct intel_encoder *encoder)
119+{
120+ intel_crt_set_dpms(encoder, DRM_MODE_DPMS_OFF);
121+}
122+
123+static void intel_enable_crt(struct intel_encoder *encoder)
124+{
125+ struct intel_crt *crt = intel_encoder_to_crt(encoder);
126+
127+ intel_crt_set_dpms(encoder, crt->connector->base.dpms);
128+}
129+
130+
138131 static void intel_crt_dpms(struct drm_connector *connector, int mode)
139132 {
140133 struct drm_device *dev = connector->dev;
@@ -746,6 +739,7 @@ void intel_crt_init(struct drm_device *dev) · 605 unmodified lines
746739 }
747740
748741 connector = &intel_connector->base;
742+ crt->connector = intel_connector;
749743 drm_connector_init(dev, &intel_connector->base,
750744 &intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA);
751745
drivers/gpu/drm/i915/intel_display.c+5−5
@@ -5771,6 +5771,11 @@ static int haswell_crtc_mode_set(struct drm_crtc *crtc, · 5770 unmodified lines
57715771 num_connectors++;
57725772 }
57735773
5774+ if (is_cpu_edp)
5775+ intel_crtc->cpu_transcoder = TRANSCODER_EDP;
5776+ else
5777+ intel_crtc->cpu_transcoder = pipe;
5778+
57745779 /* We are not sure yet this won't happen. */
57755780 WARN(!HAS_PCH_LPT(dev), "Unexpected PCH type %d\n",
57765781 INTEL_PCH_TYPE(dev));
@@ -5837,11 +5842,6 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, · 60 unmodified lines
58375842 int pipe = intel_crtc->pipe;
58385843 int ret;
58395844
5840− if (IS_HASWELL(dev) && intel_pipe_has_type(crtc, INTEL_OUTPUT_EDP))
5841− intel_crtc->cpu_transcoder = TRANSCODER_EDP;
5842− else
5843− intel_crtc->cpu_transcoder = pipe;
5844−
58455845 drm_vblank_pre_modeset(dev, pipe);
58465846
58475847 ret = dev_priv->display.crtc_mode_set(crtc, mode, adjusted_mode,
drivers/gpu/drm/i915/intel_dp.c+15−2
@@ -820,6 +820,7 @@ intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, · 819 unmodified lines
820820 struct intel_link_m_n m_n;
821821 int pipe = intel_crtc->pipe;
822822 enum transcoder cpu_transcoder = intel_crtc->cpu_transcoder;
823+ int target_clock;
823824
824825 /*
825826 * Find the lane count in the intel_encoder private
@@ -835,13 +836,22 @@ intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, · 9 unmodified lines
835836 }
836837 }
837838
839+ target_clock = mode->clock;
840+ for_each_encoder_on_crtc(dev, crtc, intel_encoder) {
841+ if (intel_encoder->type == INTEL_OUTPUT_EDP) {
842+ target_clock = intel_edp_target_clock(intel_encoder,
843+ mode);
844+ break;
845+ }
846+ }
847+
838848 /*
839849 * Compute the GMCH and Link ratios. The '3' here is
840850 * the number of bytes_per_pixel post-LUT, which we always
841851 * set up for 8-bits of R/G/B, or 3 bytes total.
842852 */
843853 intel_link_compute_m_n(intel_crtc->bpp, lane_count,
844− mode->clock, adjusted_mode->clock, &m_n);
854+ target_clock, adjusted_mode->clock, &m_n);
845855
846856 if (IS_HASWELL(dev)) {
847857 I915_WRITE(PIPE_DATA_M1(cpu_transcoder),
@@ -1930,7 +1940,7 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) · 1082 unmodified lines
19301940 for (i = 0; i < intel_dp->lane_count; i++)
19311941 if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0)
19321942 break;
1933− if (i == intel_dp->lane_count && voltage_tries == 5) {
1943+ if (i == intel_dp->lane_count) {
19341944 ++loop_tries;
19351945 if (loop_tries == 5) {
19361946 DRM_DEBUG_KMS("too many full retries, give up\n");
@@ -2549,12 +2559,15 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder) · 612 unmodified lines
25492559 {
25502560 struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
25512561 struct intel_dp *intel_dp = &intel_dig_port->dp;
2562+ struct drm_device *dev = intel_dp_to_dev(intel_dp);
25522563
25532564 i2c_del_adapter(&intel_dp->adapter);
25542565 drm_encoder_cleanup(encoder);
25552566 if (is_edp(intel_dp)) {
25562567 cancel_delayed_work_sync(&intel_dp->panel_vdd_work);
2568+ mutex_lock(&dev->mode_config.mutex);
25572569 ironlake_panel_vdd_off_sync(intel_dp);
2570+ mutex_unlock(&dev->mode_config.mutex);
25582571 }
25592572 kfree(intel_dig_port);
25602573 }
drivers/gpu/drm/i915/intel_i2c.c+10−1
@@ -203,7 +203,13 @@ intel_gpio_setup(struct intel_gmbus *bus, u32 pin) · 202 unmodified lines
203203 algo->data = bus;
204204 }
205205
206−#define HAS_GMBUS_IRQ(dev) (INTEL_INFO(dev)->gen >= 4)
206+/*
207+ * gmbus on gen4 seems to be able to generate legacy interrupts even when in MSI
208+ * mode. This results in spurious interrupt warnings if the legacy irq no. is
209+ * shared with another device. The kernel then disables that interrupt source
210+ * and so prevents the other device from working properly.
211+ */
212+#define HAS_GMBUS_IRQ(dev) (INTEL_INFO(dev)->gen >= 5)
207213 static int
208214 gmbus_wait_hw_status(struct drm_i915_private *dev_priv,
209215 u32 gmbus2_status,
@@ -214,6 +220,9 @@ gmbus_wait_hw_status(struct drm_i915_private *dev_priv, · 4 unmodified lines
214220 u32 gmbus2 = 0;
215221 DEFINE_WAIT(wait);
216222
223+ if (!HAS_GMBUS_IRQ(dev_priv->dev))
224+ gmbus4_irq_en = 0;
225+
217226 /* Important: The hw handles only the first bit, so set only one! Since
218227 * we also need to check for NAKs besides the hw ready/idle signal, we
219228 * need to wake up periodically and check that ourselves. */
drivers/gpu/drm/i915/intel_panel.c+5−8
@@ -321,9 +321,6 @@ void intel_panel_enable_backlight(struct drm_device *dev, · 320 unmodified lines
321321 if (dev_priv->backlight_level == 0)
322322 dev_priv->backlight_level = intel_panel_get_max_backlight(dev);
323323
324− dev_priv->backlight_enabled = true;
325− intel_panel_actually_set_backlight(dev, dev_priv->backlight_level);
326−
327324 if (INTEL_INFO(dev)->gen >= 4) {
328325 uint32_t reg, tmp;
329326
@@ -359,12 +356,12 @@ void intel_panel_enable_backlight(struct drm_device *dev, · 29 unmodified lines
359356 }
360357
361358 set_level:
362− /* Check the current backlight level and try to set again if it's zero.
363− * On some machines, BLC_PWM_CPU_CTL is cleared to zero automatically
364− * when BLC_PWM_CPU_CTL2 and BLC_PWM_PCH_CTL1 are written.
359+ /* Call below after setting BLC_PWM_CPU_CTL2 and BLC_PWM_PCH_CTL1.
360+ * BLC_PWM_CPU_CTL may be cleared to zero automatically when these
361+ * registers are set.
365362 */
366− if (!intel_panel_get_backlight(dev))
367− intel_panel_actually_set_backlight(dev, dev_priv->backlight_level);
363+ dev_priv->backlight_enabled = true;
364+ intel_panel_actually_set_backlight(dev, dev_priv->backlight_level);
368365 }
369366
370367 static void intel_panel_init_backlight(struct drm_device *dev)
drivers/gpu/drm/i915/intel_pm.c+3−0
@@ -4079,6 +4079,9 @@ void intel_set_power_well(struct drm_device *dev, bool enable) · 4078 unmodified lines
40794079 if (!IS_HASWELL(dev))
40804080 return;
40814081
4082+ if (!i915_disable_power_well && !enable)
4083+ return;
4084+
40824085 tmp = I915_READ(HSW_PWR_WELL_DRIVER);
40834086 is_enabled = tmp & HSW_PWR_WELL_STATE;
40844087 enable_requested = tmp & HSW_PWR_WELL_ENABLE;
drivers/gpu/drm/mgag200/mgag200_mode.c+8−15
@@ -382,19 +382,19 @@ static int mga_g200eh_set_plls(struct mga_device *mdev, long clock) · 381 unmodified lines
382382 m = n = p = 0;
383383 vcomax = 800000;
384384 vcomin = 400000;
385− pllreffreq = 3333;
385+ pllreffreq = 33333;
386386
387387 delta = 0xffffffff;
388388 permitteddelta = clock * 5 / 1000;
389389
390− for (testp = 16; testp > 0; testp--) {
390+ for (testp = 16; testp > 0; testp >>= 1) {
391391 if (clock * testp > vcomax)
392392 continue;
393393 if (clock * testp < vcomin)
394394 continue;
395395
396396 for (testm = 1; testm < 33; testm++) {
397− for (testn = 1; testn < 257; testn++) {
397+ for (testn = 17; testn < 257; testn++) {
398398 computed = (pllreffreq * testn) /
399399 (testm * testp);
400400 if (computed > clock)
@@ -404,11 +404,11 @@ static int mga_g200eh_set_plls(struct mga_device *mdev, long clock) · 3 unmodified lines
404404 if (tmpdelta < delta) {
405405 delta = tmpdelta;
406406 n = testn - 1;
407− m = (testm - 1) | ((n >> 1) & 0x80);
407+ m = (testm - 1);
408408 p = testp - 1;
409409 }
410410 if ((clock * testp) >= 600000)
411− p |= 80;
411+ p |= 0x80;
412412 }
413413 }
414414 }
@@ -751,8 +751,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, · 336 unmodified lines
751751 int i;
752752 unsigned char misc = 0;
753753 unsigned char ext_vga[6];
754− unsigned char ext_vga_index24;
755− unsigned char dac_index90 = 0;
756754 u8 bppshift;
757755
758756 static unsigned char dacvalue[] = {
@@ -803,7 +801,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, · 44 unmodified lines
803801 option2 = 0x0000b000;
804802 break;
805803 case G200_ER:
806− dac_index90 = 0;
807804 break;
808805 }
809806
@@ -852,10 +849,8 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, · 42 unmodified lines
852849 WREG_DAC(i, dacvalue[i]);
853850 }
854851
855− if (mdev->type == G200_ER) {
856− WREG_DAC(0x90, dac_index90);
857− }
858−
852+ if (mdev->type == G200_ER)
853+ WREG_DAC(0x90, 0);
859854
860855 if (option)
861856 pci_write_config_dword(dev->pdev, PCI_MGA_OPTION, option);
@@ -952,8 +947,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, · 90 unmodified lines
952947 if (mdev->type == G200_WB)
953948 ext_vga[1] |= 0x88;
954949
955− ext_vga_index24 = 0x05;
956−
957950 /* Set pixel clocks */
958951 misc = 0x2d;
959952 WREG8(MGA_MISC_OUT, misc);
@@ -965,7 +958,7 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, · 5 unmodified lines
965958 }
966959
967960 if (mdev->type == G200_ER)
968− WREG_ECRT(24, ext_vga_index24);
961+ WREG_ECRT(0x24, 0x5);
969962
970963 if (mdev->type == G200_EV) {
971964 WREG_ECRT(6, 0);
drivers/gpu/drm/nouveau/core/core/object.c+1−2
@@ -278,7 +278,6 @@ nouveau_object_del(struct nouveau_object *client, u32 _parent, u32 _handle) · 277 unmodified lines
278278 struct nouveau_object *parent = NULL;
279279 struct nouveau_object *namedb = NULL;
280280 struct nouveau_handle *handle = NULL;
281− int ret = -EINVAL;
282281
283282 parent = nouveau_handle_ref(client, _parent);
284283 if (!parent)
@@ -295,7 +294,7 @@ nouveau_object_del(struct nouveau_object *client, u32 _parent, u32 _handle) · 10 unmodified lines
295294 }
296295
297296 nouveau_object_ref(NULL, &parent);
298− return ret;
297+ return handle ? 0 : -EINVAL;
299298 }
300299
301300 int
drivers/gpu/drm/nouveau/core/engine/disp/nv50.c+2−2
@@ -544,13 +544,13 @@ nv50_disp_curs_ofuncs = { · 543 unmodified lines
544544 static void
545545 nv50_disp_base_vblank_enable(struct nouveau_event *event, int head)
546546 {
547− nv_mask(event->priv, 0x61002c, (1 << head), (1 << head));
547+ nv_mask(event->priv, 0x61002c, (4 << head), (4 << head));
548548 }
549549
550550 static void
551551 nv50_disp_base_vblank_disable(struct nouveau_event *event, int head)
552552 {
553− nv_mask(event->priv, 0x61002c, (1 << head), (0 << head));
553+ nv_mask(event->priv, 0x61002c, (4 << head), 0);
554554 }
555555
556556 static int
drivers/gpu/drm/nouveau/core/include/subdev/therm.h+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 #include <core/device.h>
55 #include <core/subdev.h>
66
7−enum nouveau_therm_mode {
7+enum nouveau_therm_fan_mode {
88 NOUVEAU_THERM_CTRL_NONE = 0,
99 NOUVEAU_THERM_CTRL_MANUAL = 1,
1010 NOUVEAU_THERM_CTRL_AUTO = 2,
drivers/gpu/drm/nouveau/core/subdev/bios/base.c+17−0
@@ -248,6 +248,22 @@ nouveau_bios_shadow_pci(struct nouveau_bios *bios) · 247 unmodified lines
248248 }
249249 }
250250
251+static void
252+nouveau_bios_shadow_platform(struct nouveau_bios *bios)
253+{
254+ struct pci_dev *pdev = nv_device(bios)->pdev;
255+ size_t size;
256+
257+ void __iomem *rom = pci_platform_rom(pdev, &size);
258+ if (rom && size) {
259+ bios->data = kmalloc(size, GFP_KERNEL);
260+ if (bios->data) {
261+ memcpy_fromio(bios->data, rom, size);
262+ bios->size = size;
263+ }
264+ }
265+}
266+
251267 static int
252268 nouveau_bios_score(struct nouveau_bios *bios, const bool writeable)
253269 {
@@ -288,6 +304,7 @@ nouveau_bios_shadow(struct nouveau_bios *bios) · 34 unmodified lines
288304 { "PROM", nouveau_bios_shadow_prom, false, 0, 0, NULL },
289305 { "ACPI", nouveau_bios_shadow_acpi, true, 0, 0, NULL },
290306 { "PCIROM", nouveau_bios_shadow_pci, true, 0, 0, NULL },
307+ { "PLATFORM", nouveau_bios_shadow_platform, true, 0, 0, NULL },
291308 {}
292309 };
293310 struct methods *mthd, *best;
drivers/gpu/drm/nouveau/core/subdev/therm/base.c+12−6
@@ -134,7 +134,7 @@ nouveau_therm_alarm(struct nouveau_alarm *alarm) · 133 unmodified lines
134134 }
135135
136136 int
137−nouveau_therm_mode(struct nouveau_therm *therm, int mode)
137+nouveau_therm_fan_mode(struct nouveau_therm *therm, int mode)
138138 {
139139 struct nouveau_therm_priv *priv = (void *)therm;
140140 struct nouveau_device *device = nv_device(therm);
@@ -149,10 +149,15 @@ nouveau_therm_mode(struct nouveau_therm *therm, int mode) · 8 unmodified lines
149149 (mode != NOUVEAU_THERM_CTRL_NONE && device->card_type >= NV_C0))
150150 return -EINVAL;
151151
152+ /* do not allow automatic fan management if the thermal sensor is
153+ * not available */
154+ if (priv->mode == 2 && therm->temp_get(therm) < 0)
155+ return -EINVAL;
156+
152157 if (priv->mode == mode)
153158 return 0;
154159
155− nv_info(therm, "Thermal management: %s\n", name[mode]);
160+ nv_info(therm, "fan management: %s\n", name[mode]);
156161 nouveau_therm_update(therm, mode);
157162 return 0;
158163 }
@@ -213,7 +218,7 @@ nouveau_therm_attr_set(struct nouveau_therm *therm, · 54 unmodified lines
213218 priv->fan->bios.max_duty = value;
214219 return 0;
215220 case NOUVEAU_THERM_ATTR_FAN_MODE:
216− return nouveau_therm_mode(therm, value);
221+ return nouveau_therm_fan_mode(therm, value);
217222 case NOUVEAU_THERM_ATTR_THRS_FAN_BOOST:
218223 priv->bios_sensor.thrs_fan_boost.temp = value;
219224 priv->sensor.program_alarms(therm);
@@ -263,7 +268,7 @@ _nouveau_therm_init(struct nouveau_object *object) · 43 unmodified lines
263268 return ret;
264269
265270 if (priv->suspend >= 0)
266− nouveau_therm_mode(therm, priv->mode);
271+ nouveau_therm_fan_mode(therm, priv->mode);
267272 priv->sensor.program_alarms(therm);
268273 return 0;
269274 }
@@ -313,11 +318,12 @@ nouveau_therm_create_(struct nouveau_object *parent, · 43 unmodified lines
313318 int
314319 nouveau_therm_preinit(struct nouveau_therm *therm)
315320 {
316− nouveau_therm_ic_ctor(therm);
317321 nouveau_therm_sensor_ctor(therm);
322+ nouveau_therm_ic_ctor(therm);
318323 nouveau_therm_fan_ctor(therm);
319324
320− nouveau_therm_mode(therm, NOUVEAU_THERM_CTRL_NONE);
325+ nouveau_therm_fan_mode(therm, NOUVEAU_THERM_CTRL_NONE);
326+ nouveau_therm_sensor_preinit(therm);
321327 return 0;
322328 }
323329
drivers/gpu/drm/nouveau/core/subdev/therm/ic.c+4−2
@@ -32,6 +32,7 @@ probe_monitoring_device(struct nouveau_i2c_port *i2c, · 31 unmodified lines
3232 struct i2c_board_info *info)
3333 {
3434 struct nouveau_therm_priv *priv = (void *)nouveau_therm(i2c);
35+ struct nvbios_therm_sensor *sensor = &priv->bios_sensor;
3536 struct i2c_client *client;
3637
3738 request_module("%s%s", I2C_MODULE_PREFIX, info->type);
@@ -46,8 +47,9 @@ probe_monitoring_device(struct nouveau_i2c_port *i2c, · 8 unmodified lines
4647 }
4748
4849 nv_info(priv,
49− "Found an %s at address 0x%x (controlled by lm_sensors)\n",
50− info->type, info->addr);
50+ "Found an %s at address 0x%x (controlled by lm_sensors, "
51+ "temp offset %+i C)\n",
52+ info->type, info->addr, sensor->offset_constant);
5153 priv->ic = client;
5254
5355 return true;
drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c+48−19
@@ -29,54 +29,83 @@ struct nv40_therm_priv { · 28 unmodified lines
2929 struct nouveau_therm_priv base;
3030 };
3131
32+enum nv40_sensor_style { INVALID_STYLE = -1, OLD_STYLE = 0, NEW_STYLE = 1 };
33+
34+static enum nv40_sensor_style
35+nv40_sensor_style(struct nouveau_therm *therm)
36+{
37+ struct nouveau_device *device = nv_device(therm);
38+
39+ switch (device->chipset) {
40+ case 0x43:
41+ case 0x44:
42+ case 0x4a:
43+ case 0x47:
44+ return OLD_STYLE;
45+
46+ case 0x46:
47+ case 0x49:
48+ case 0x4b:
49+ case 0x4e:
50+ case 0x4c:
51+ case 0x67:
52+ case 0x68:
53+ case 0x63:
54+ return NEW_STYLE;
55+ default:
56+ return INVALID_STYLE;
57+ }
58+}
59+
3260 static int
3361 nv40_sensor_setup(struct nouveau_therm *therm)
3462 {
35− struct nouveau_device *device = nv_device(therm);
63+ enum nv40_sensor_style style = nv40_sensor_style(therm);
3664
3765 /* enable ADC readout and disable the ALARM threshold */
38− if (device->chipset >= 0x46) {
66+ if (style == NEW_STYLE) {
3967 nv_mask(therm, 0x15b8, 0x80000000, 0);
4068 nv_wr32(therm, 0x15b0, 0x80003fff);
41− mdelay(10); /* wait for the temperature to stabilize */
69+ mdelay(20); /* wait for the temperature to stabilize */
4270 return nv_rd32(therm, 0x15b4) & 0x3fff;
43− } else {
71+ } else if (style == OLD_STYLE) {
4472 nv_wr32(therm, 0x15b0, 0xff);
73+ mdelay(20); /* wait for the temperature to stabilize */
4574 return nv_rd32(therm, 0x15b4) & 0xff;
46− }
75+ } else
76+ return -ENODEV;
4777 }
4878
4979 static int
5080 nv40_temp_get(struct nouveau_therm *therm)
5181 {
5282 struct nouveau_therm_priv *priv = (void *)therm;
53− struct nouveau_device *device = nv_device(therm);
5483 struct nvbios_therm_sensor *sensor = &priv->bios_sensor;
84+ enum nv40_sensor_style style = nv40_sensor_style(therm);
5585 int core_temp;
5686
57− if (device->chipset >= 0x46) {
87+ if (style == NEW_STYLE) {
5888 nv_wr32(therm, 0x15b0, 0x80003fff);
5989 core_temp = nv_rd32(therm, 0x15b4) & 0x3fff;
60− } else {
90+ } else if (style == OLD_STYLE) {
6191 nv_wr32(therm, 0x15b0, 0xff);
6292 core_temp = nv_rd32(therm, 0x15b4) & 0xff;
63− }
64−
65− /* Setup the sensor if the temperature is 0 */
66− if (core_temp == 0)
67− core_temp = nv40_sensor_setup(therm);
93+ } else
94+ return -ENODEV;
6895
69− if (sensor->slope_div == 0)
70− sensor->slope_div = 1;
71− if (sensor->offset_den == 0)
72− sensor->offset_den = 1;
73− if (sensor->slope_mult < 1)
74− sensor->slope_mult = 1;
96+ /* if the slope or the offset is unset, do no use the sensor */
97+ if (!sensor->slope_div || !sensor->slope_mult ||
98+ !sensor->offset_num || !sensor->offset_den)
99+ return -ENODEV;
75100
76101 core_temp = core_temp * sensor->slope_mult / sensor->slope_div;
77102 core_temp = core_temp + sensor->offset_num / sensor->offset_den;
78103 core_temp = core_temp + sensor->offset_constant - 8;
79104
105+ /* reserve negative temperatures for errors */
106+ if (core_temp < 0)
107+ core_temp = 0;
108+
80109 return core_temp;
81110 }
82111
drivers/gpu/drm/nouveau/core/subdev/therm/priv.h+2−1
@@ -102,7 +102,7 @@ struct nouveau_therm_priv { · 101 unmodified lines
102102 struct i2c_client *ic;
103103 };
104104
105−int nouveau_therm_mode(struct nouveau_therm *therm, int mode);
105+int nouveau_therm_fan_mode(struct nouveau_therm *therm, int mode);
106106 int nouveau_therm_attr_get(struct nouveau_therm *therm,
107107 enum nouveau_therm_attr_type type);
108108 int nouveau_therm_attr_set(struct nouveau_therm *therm,
@@ -122,6 +122,7 @@ int nouveau_therm_fan_sense(struct nouveau_therm *therm); · 13 unmodified lines
122122
123123 int nouveau_therm_preinit(struct nouveau_therm *);
124124
125+void nouveau_therm_sensor_preinit(struct nouveau_therm *);
125126 void nouveau_therm_sensor_set_threshold_state(struct nouveau_therm *therm,
126127 enum nouveau_therm_thrs thrs,
127128 enum nouveau_therm_thrs_state st);
drivers/gpu/drm/nouveau/core/subdev/therm/temp.c+16−14
@@ -34,10 +34,6 @@ nouveau_therm_temp_set_defaults(struct nouveau_therm *therm) · 33 unmodified lines
3434 {
3535 struct nouveau_therm_priv *priv = (void *)therm;
3636
37− priv->bios_sensor.slope_mult = 1;
38− priv->bios_sensor.slope_div = 1;
39− priv->bios_sensor.offset_num = 0;
40− priv->bios_sensor.offset_den = 1;
4137 priv->bios_sensor.offset_constant = 0;
4238
4339 priv->bios_sensor.thrs_fan_boost.temp = 90;
@@ -60,11 +56,6 @@ nouveau_therm_temp_safety_checks(struct nouveau_therm *therm) · 16 unmodified lines
6056 struct nouveau_therm_priv *priv = (void *)therm;
6157 struct nvbios_therm_sensor *s = &priv->bios_sensor;
6258
63− if (!priv->bios_sensor.slope_div)
64− priv->bios_sensor.slope_div = 1;
65− if (!priv->bios_sensor.offset_den)
66− priv->bios_sensor.offset_den = 1;
67−
6859 /* enforce a minimum hysteresis on thresholds */
6960 s->thrs_fan_boost.hysteresis = max_t(u8, s->thrs_fan_boost.hysteresis, 2);
7061 s->thrs_down_clock.hysteresis = max_t(u8, s->thrs_down_clock.hysteresis, 2);
@@ -106,16 +97,16 @@ void nouveau_therm_sensor_event(struct nouveau_therm *therm, · 35 unmodified lines
10697 const char *thresolds[] = {
10798 "fanboost", "downclock", "critical", "shutdown"
10899 };
109− uint8_t temperature = therm->temp_get(therm);
100+ int temperature = therm->temp_get(therm);
110101
111102 if (thrs < 0 || thrs > 3)
112103 return;
113104
114105 if (dir == NOUVEAU_THERM_THRS_FALLING)
115− nv_info(therm, "temperature (%u C) went below the '%s' threshold\n",
106+ nv_info(therm, "temperature (%i C) went below the '%s' threshold\n",
116107 temperature, thresolds[thrs]);
117108 else
118− nv_info(therm, "temperature (%u C) hit the '%s' threshold\n",
109+ nv_info(therm, "temperature (%i C) hit the '%s' threshold\n",
119110 temperature, thresolds[thrs]);
120111
121112 active = (dir == NOUVEAU_THERM_THRS_RISING);
@@ -123,7 +114,7 @@ void nouveau_therm_sensor_event(struct nouveau_therm *therm, · 1 unmodified line
123114 case NOUVEAU_THERM_THRS_FANBOOST:
124115 if (active) {
125116 nouveau_therm_fan_set(therm, true, 100);
126− nouveau_therm_mode(therm, NOUVEAU_THERM_CTRL_AUTO);
117+ nouveau_therm_fan_mode(therm, NOUVEAU_THERM_CTRL_AUTO);
127118 }
128119 break;
129120 case NOUVEAU_THERM_THRS_DOWNCLOCK:
@@ -202,7 +193,7 @@ alarm_timer_callback(struct nouveau_alarm *alarm) · 72 unmodified lines
202193 NOUVEAU_THERM_THRS_SHUTDOWN);
203194
204195 /* schedule the next poll in one second */
205− if (list_empty(&alarm->head))
196+ if (therm->temp_get(therm) >= 0 && list_empty(&alarm->head))
206197 ptimer->alarm(ptimer, 1000 * 1000 * 1000, alarm);
207198
208199 spin_unlock_irqrestore(&priv->sensor.alarm_program_lock, flags);
@@ -225,6 +216,17 @@ nouveau_therm_program_alarms_polling(struct nouveau_therm *therm) · 16 unmodified lines
225216 alarm_timer_callback(&priv->sensor.therm_poll_alarm);
226217 }
227218
219+void
220+nouveau_therm_sensor_preinit(struct nouveau_therm *therm)
221+{
222+ const char *sensor_avail = "yes";
223+
224+ if (therm->temp_get(therm) < 0)
225+ sensor_avail = "no";
226+
227+ nv_info(therm, "internal sensor: %s\n", sensor_avail);
228+}
229+
228230 int
229231 nouveau_therm_sensor_ctor(struct nouveau_therm *therm)
230232 {
drivers/gpu/drm/nouveau/nouveau_abi16.c+15−8
@@ -116,6 +116,11 @@ nouveau_abi16_chan_fini(struct nouveau_abi16 *abi16, · 115 unmodified lines
116116 {
117117 struct nouveau_abi16_ntfy *ntfy, *temp;
118118
119+ /* wait for all activity to stop before releasing notify object, which
120+ * may be still in use */
121+ if (chan->chan && chan->ntfy)
122+ nouveau_channel_idle(chan->chan);
123+
119124 /* cleanup notifier state */
120125 list_for_each_entry_safe(ntfy, temp, &chan->notifiers, head) {
121126 nouveau_abi16_ntfy_fini(chan, ntfy);
@@ -386,7 +391,7 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS) · 264 unmodified lines
386391 struct nouveau_drm *drm = nouveau_drm(dev);
387392 struct nouveau_device *device = nv_device(drm->device);
388393 struct nouveau_abi16 *abi16 = nouveau_abi16_get(file_priv, dev);
389− struct nouveau_abi16_chan *chan, *temp;
394+ struct nouveau_abi16_chan *chan = NULL, *temp;
390395 struct nouveau_abi16_ntfy *ntfy;
391396 struct nouveau_object *object;
392397 struct nv_dma_class args = {};
@@ -399,10 +404,11 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS) · 6 unmodified lines
399404 if (unlikely(nv_device(abi16->device)->card_type >= NV_C0))
400405 return nouveau_abi16_put(abi16, -EINVAL);
401406
402− list_for_each_entry_safe(chan, temp, &abi16->channels, head) {
403− if (chan->chan->handle == (NVDRM_CHAN | info->channel))
407+ list_for_each_entry(temp, &abi16->channels, head) {
408+ if (temp->chan->handle == (NVDRM_CHAN | info->channel)) {
409+ chan = temp;
404410 break;
405− chan = NULL;
411+ }
406412 }
407413
408414 if (!chan)
@@ -454,17 +460,18 @@ nouveau_abi16_ioctl_gpuobj_free(ABI16_IOCTL_ARGS) · 45 unmodified lines
454460 {
455461 struct drm_nouveau_gpuobj_free *fini = data;
456462 struct nouveau_abi16 *abi16 = nouveau_abi16_get(file_priv, dev);
457− struct nouveau_abi16_chan *chan, *temp;
463+ struct nouveau_abi16_chan *chan = NULL, *temp;
458464 struct nouveau_abi16_ntfy *ntfy;
459465 int ret;
460466
461467 if (unlikely(!abi16))
462468 return -ENOMEM;
463469
464− list_for_each_entry_safe(chan, temp, &abi16->channels, head) {
465− if (chan->chan->handle == (NVDRM_CHAN | fini->channel))
470+ list_for_each_entry(temp, &abi16->channels, head) {
471+ if (temp->chan->handle == (NVDRM_CHAN | fini->channel)) {
472+ chan = temp;
466473 break;
467− chan = NULL;
474+ }
468475 }
469476
470477 if (!chan)
drivers/gpu/drm/nouveau/nouveau_bo.c+2−2
@@ -801,7 +801,7 @@ nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, · 800 unmodified lines
801801 stride = 16 * 4;
802802 height = amount / stride;
803803
804− if (new_mem->mem_type == TTM_PL_VRAM &&
804+ if (old_mem->mem_type == TTM_PL_VRAM &&
805805 nouveau_bo_tile_layout(nvbo)) {
806806 ret = RING_SPACE(chan, 8);
807807 if (ret)
@@ -823,7 +823,7 @@ nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, · 15 unmodified lines
823823 BEGIN_NV04(chan, NvSubCopy, 0x0200, 1);
824824 OUT_RING (chan, 1);
825825 }
826− if (old_mem->mem_type == TTM_PL_VRAM &&
826+ if (new_mem->mem_type == TTM_PL_VRAM &&
827827 nouveau_bo_tile_layout(nvbo)) {
828828 ret = RING_SPACE(chan, 8);
829829 if (ret)
drivers/gpu/drm/nouveau/nouveau_drm.c+20−12
@@ -71,12 +71,26 @@ module_param_named(modeset, nouveau_modeset, int, 0400); · 70 unmodified lines
7171
7272 static struct drm_driver driver;
7373
74+static int
75+nouveau_drm_vblank_handler(struct nouveau_eventh *event, int head)
76+{
77+ struct nouveau_drm *drm =
78+ container_of(event, struct nouveau_drm, vblank[head]);
79+ drm_handle_vblank(drm->dev, head);
80+ return NVKM_EVENT_KEEP;
81+}
82+
7483 static int
7584 nouveau_drm_vblank_enable(struct drm_device *dev, int head)
7685 {
7786 struct nouveau_drm *drm = nouveau_drm(dev);
7887 struct nouveau_disp *pdisp = nouveau_disp(drm->device);
79− nouveau_event_get(pdisp->vblank, head, &drm->vblank);
88+
89+ if (WARN_ON_ONCE(head > ARRAY_SIZE(drm->vblank)))
90+ return -EIO;
91+ WARN_ON_ONCE(drm->vblank[head].func);
92+ drm->vblank[head].func = nouveau_drm_vblank_handler;
93+ nouveau_event_get(pdisp->vblank, head, &drm->vblank[head]);
8094 return 0;
8195 }
8296
@@ -85,16 +99,11 @@ nouveau_drm_vblank_disable(struct drm_device *dev, int head) · 2 unmodified lines
8599 {
86100 struct nouveau_drm *drm = nouveau_drm(dev);
87101 struct nouveau_disp *pdisp = nouveau_disp(drm->device);
88− nouveau_event_put(pdisp->vblank, head, &drm->vblank);
89−}
90−
91−static int
92−nouveau_drm_vblank_handler(struct nouveau_eventh *event, int head)
93−{
94− struct nouveau_drm *drm =
95− container_of(event, struct nouveau_drm, vblank);
96− drm_handle_vblank(drm->dev, head);
97− return NVKM_EVENT_KEEP;
102+ if (drm->vblank[head].func)
103+ nouveau_event_put(pdisp->vblank, head, &drm->vblank[head]);
104+ else
105+ WARN_ON_ONCE(1);
106+ drm->vblank[head].func = NULL;
98107 }
99108
100109 static u64
@@ -292,7 +301,6 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags) · 191 unmodified lines
292301
293302 dev->dev_private = drm;
294303 drm->dev = dev;
295− drm->vblank.func = nouveau_drm_vblank_handler;
296304
297305 INIT_LIST_HEAD(&drm->clients);
298306 spin_lock_init(&drm->tile.lock);
drivers/gpu/drm/nouveau/nouveau_drm.h+1−1
@@ -113,7 +113,7 @@ struct nouveau_drm { · 112 unmodified lines
113113 struct nvbios vbios;
114114 struct nouveau_display *display;
115115 struct backlight_device *backlight;
116− struct nouveau_eventh vblank;
116+ struct nouveau_eventh vblank[4];
117117
118118 /* power management */
119119 struct nouveau_pm *pm;
drivers/gpu/drm/nouveau/nouveau_pm.c+31−13
@@ -402,8 +402,12 @@ nouveau_hwmon_show_temp(struct device *d, struct device_attribute *a, char *buf) · 401 unmodified lines
402402 struct drm_device *dev = dev_get_drvdata(d);
403403 struct nouveau_drm *drm = nouveau_drm(dev);
404404 struct nouveau_therm *therm = nouveau_therm(drm->device);
405+ int temp = therm->temp_get(therm);
405406
406− return snprintf(buf, PAGE_SIZE, "%d\n", therm->temp_get(therm) * 1000);
407+ if (temp < 0)
408+ return temp;
409+
410+ return snprintf(buf, PAGE_SIZE, "%d\n", temp * 1000);
407411 }
408412 static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, nouveau_hwmon_show_temp,
409413 NULL, 0);
@@ -871,7 +875,12 @@ static SENSOR_DEVICE_ATTR(pwm1_max, S_IRUGO | S_IWUSR, · 461 unmodified lines
871875 nouveau_hwmon_get_pwm1_max,
872876 nouveau_hwmon_set_pwm1_max, 0);
873877
874−static struct attribute *hwmon_attributes[] = {
878+static struct attribute *hwmon_default_attributes[] = {
879+ &sensor_dev_attr_name.dev_attr.attr,
880+ &sensor_dev_attr_update_rate.dev_attr.attr,
881+ NULL
882+};
883+static struct attribute *hwmon_temp_attributes[] = {
875884 &sensor_dev_attr_temp1_input.dev_attr.attr,
876885 &sensor_dev_attr_temp1_auto_point1_pwm.dev_attr.attr,
877886 &sensor_dev_attr_temp1_auto_point1_temp.dev_attr.attr,
@@ -882,8 +891,6 @@ static struct attribute *hwmon_attributes[] = { · 4 unmodified lines
882891 &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr,
883892 &sensor_dev_attr_temp1_emergency.dev_attr.attr,
884893 &sensor_dev_attr_temp1_emergency_hyst.dev_attr.attr,
885− &sensor_dev_attr_name.dev_attr.attr,
886− &sensor_dev_attr_update_rate.dev_attr.attr,
887894 NULL
888895 };
889896 static struct attribute *hwmon_fan_rpm_attributes[] = {
@@ -898,8 +905,11 @@ static struct attribute *hwmon_pwm_fan_attributes[] = { · 8 unmodified lines
898905 NULL
899906 };
900907
901−static const struct attribute_group hwmon_attrgroup = {
902− .attrs = hwmon_attributes,
908+static const struct attribute_group hwmon_default_attrgroup = {
909+ .attrs = hwmon_default_attributes,
910+};
911+static const struct attribute_group hwmon_temp_attrgroup = {
912+ .attrs = hwmon_temp_attributes,
903913 };
904914 static const struct attribute_group hwmon_fan_rpm_attrgroup = {
905915 .attrs = hwmon_fan_rpm_attributes,
@@ -931,13 +941,22 @@ nouveau_hwmon_init(struct drm_device *dev) · 25 unmodified lines
931941 }
932942 dev_set_drvdata(hwmon_dev, dev);
933943
934− /* default sysfs entries */
935− ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_attrgroup);
944+ /* set the default attributes */
945+ ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_default_attrgroup);
936946 if (ret) {
937947 if (ret)
938948 goto error;
939949 }
940950
951+ /* if the card has a working thermal sensor */
952+ if (therm->temp_get(therm) >= 0) {
953+ ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_temp_attrgroup);
954+ if (ret) {
955+ if (ret)
956+ goto error;
957+ }
958+ }
959+
941960 /* if the card has a pwm fan */
942961 /*XXX: incorrect, need better detection for this, some boards have
943962 * the gpio entries for pwm fan control even when there's no
@@ -979,11 +998,10 @@ nouveau_hwmon_fini(struct drm_device *dev) · 35 unmodified lines
979998 struct nouveau_pm *pm = nouveau_pm(dev);
980999
9811000 if (pm->hwmon) {
982− sysfs_remove_group(&pm->hwmon->kobj, &hwmon_attrgroup);
983− sysfs_remove_group(&pm->hwmon->kobj,
984− &hwmon_pwm_fan_attrgroup);
985− sysfs_remove_group(&pm->hwmon->kobj,
986− &hwmon_fan_rpm_attrgroup);
1001+ sysfs_remove_group(&pm->hwmon->kobj, &hwmon_default_attrgroup);
1002+ sysfs_remove_group(&pm->hwmon->kobj, &hwmon_temp_attrgroup);
1003+ sysfs_remove_group(&pm->hwmon->kobj, &hwmon_pwm_fan_attrgroup);
1004+ sysfs_remove_group(&pm->hwmon->kobj, &hwmon_fan_rpm_attrgroup);
9871005
9881006 hwmon_device_unregister(pm->hwmon);
9891007 }
drivers/gpu/drm/nouveau/nv50_display.c+4−3
@@ -479,7 +479,7 @@ nv50_display_flip_wait(void *data) · 478 unmodified lines
479479 {
480480 struct nv50_display_flip *flip = data;
481481 if (nouveau_bo_rd32(flip->disp->sync, flip->chan->addr / 4) ==
482− flip->chan->data);
482+ flip->chan->data)
483483 return true;
484484 usleep_range(1, 2);
485485 return false;
@@ -524,6 +524,8 @@ nv50_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb, · 38 unmodified lines
524524 swap_interval <<= 4;
525525 if (swap_interval == 0)
526526 swap_interval |= 0x100;
527+ if (chan == NULL)
528+ evo_sync(crtc->dev);
527529
528530 push = evo_wait(sync, 128);
529531 if (unlikely(push == NULL))
@@ -586,8 +588,6 @@ nv50_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb, · 56 unmodified lines
586588 sync->addr ^= 0x10;
587589 sync->data++;
588590 FIRE_RING (chan);
589− } else {
590− evo_sync(crtc->dev);
591591 }
592592
593593 /* queue the flip */
@@ -2276,6 +2276,7 @@ nv50_display_create(struct drm_device *dev) · 1682 unmodified lines
22762276 NV_WARN(drm, "failed to create encoder %d/%d/%d: %d\n",
22772277 dcbe->location, dcbe->type,
22782278 ffs(dcbe->or) - 1, ret);
2279+ ret = 0;
22792280 }
22802281 }
22812282
drivers/gpu/drm/radeon/ni.c+27−6
@@ -468,13 +468,19 @@ static void cayman_gpu_init(struct radeon_device *rdev) · 467 unmodified lines
468468 (rdev->pdev->device == 0x9907) ||
469469 (rdev->pdev->device == 0x9908) ||
470470 (rdev->pdev->device == 0x9909) ||
471+ (rdev->pdev->device == 0x990B) ||
472+ (rdev->pdev->device == 0x990C) ||
473+ (rdev->pdev->device == 0x990F) ||
471474 (rdev->pdev->device == 0x9910) ||
472− (rdev->pdev->device == 0x9917)) {
475+ (rdev->pdev->device == 0x9917) ||
476+ (rdev->pdev->device == 0x9999)) {
473477 rdev->config.cayman.max_simds_per_se = 6;
474478 rdev->config.cayman.max_backends_per_se = 2;
475479 } else if ((rdev->pdev->device == 0x9903) ||
476480 (rdev->pdev->device == 0x9904) ||
477481 (rdev->pdev->device == 0x990A) ||
482+ (rdev->pdev->device == 0x990D) ||
483+ (rdev->pdev->device == 0x990E) ||
478484 (rdev->pdev->device == 0x9913) ||
479485 (rdev->pdev->device == 0x9918)) {
480486 rdev->config.cayman.max_simds_per_se = 4;
@@ -483,6 +489,9 @@ static void cayman_gpu_init(struct radeon_device *rdev) · 2 unmodified lines
483489 (rdev->pdev->device == 0x9990) ||
484490 (rdev->pdev->device == 0x9991) ||
485491 (rdev->pdev->device == 0x9994) ||
492+ (rdev->pdev->device == 0x9995) ||
493+ (rdev->pdev->device == 0x9996) ||
494+ (rdev->pdev->device == 0x999A) ||
486495 (rdev->pdev->device == 0x99A0)) {
487496 rdev->config.cayman.max_simds_per_se = 3;
488497 rdev->config.cayman.max_backends_per_se = 1;
@@ -616,11 +625,22 @@ static void cayman_gpu_init(struct radeon_device *rdev) · 127 unmodified lines
616625 WREG32(DMA_TILING_CONFIG + DMA0_REGISTER_OFFSET, gb_addr_config);
617626 WREG32(DMA_TILING_CONFIG + DMA1_REGISTER_OFFSET, gb_addr_config);
618627
619− tmp = gb_addr_config & NUM_PIPES_MASK;
620− tmp = r6xx_remap_render_backend(rdev, tmp,
621− rdev->config.cayman.max_backends_per_se *
622− rdev->config.cayman.max_shader_engines,
623− CAYMAN_MAX_BACKENDS, disabled_rb_mask);
628+ if ((rdev->config.cayman.max_backends_per_se == 1) &&
629+ (rdev->flags & RADEON_IS_IGP)) {
630+ if ((disabled_rb_mask & 3) == 1) {
631+ /* RB0 disabled, RB1 enabled */
632+ tmp = 0x11111111;
633+ } else {
634+ /* RB1 disabled, RB0 enabled */
635+ tmp = 0x00000000;
636+ }
637+ } else {
638+ tmp = gb_addr_config & NUM_PIPES_MASK;
639+ tmp = r6xx_remap_render_backend(rdev, tmp,
640+ rdev->config.cayman.max_backends_per_se *
641+ rdev->config.cayman.max_shader_engines,
642+ CAYMAN_MAX_BACKENDS, disabled_rb_mask);
643+ }
624644 WREG32(GB_BACKEND_MAP, tmp);
625645
626646 cgts_tcc_disable = 0xffff0000;
@@ -1771,6 +1791,7 @@ int cayman_resume(struct radeon_device *rdev) · 1144 unmodified lines
17711791 int cayman_suspend(struct radeon_device *rdev)
17721792 {
17731793 r600_audio_fini(rdev);
1794+ radeon_vm_manager_fini(rdev);
17741795 cayman_cp_enable(rdev, false);
17751796 cayman_dma_stop(rdev);
17761797 evergreen_irq_suspend(rdev);
drivers/gpu/drm/radeon/radeon_benchmark.c+10−11
@@ -122,10 +122,7 @@ static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size, · 121 unmodified lines
122122 goto out_cleanup;
123123 }
124124
125− /* r100 doesn't have dma engine so skip the test */
126− /* also, VRAM-to-VRAM test doesn't make much sense for DMA */
127− /* skip it as well if domains are the same */
128− if ((rdev->asic->copy.dma) && (sdomain != ddomain)) {
125+ if (rdev->asic->copy.dma) {
129126 time = radeon_benchmark_do_move(rdev, size, saddr, daddr,
130127 RADEON_BENCHMARK_COPY_DMA, n);
131128 if (time < 0)
@@ -135,13 +132,15 @@ static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size, · 3 unmodified lines
135132 sdomain, ddomain, "dma");
136133 }
137134
138− time = radeon_benchmark_do_move(rdev, size, saddr, daddr,
139− RADEON_BENCHMARK_COPY_BLIT, n);
140− if (time < 0)
141− goto out_cleanup;
142− if (time > 0)
143− radeon_benchmark_log_results(n, size, time,
144− sdomain, ddomain, "blit");
135+ if (rdev->asic->copy.blit) {
136+ time = radeon_benchmark_do_move(rdev, size, saddr, daddr,
137+ RADEON_BENCHMARK_COPY_BLIT, n);
138+ if (time < 0)
139+ goto out_cleanup;
140+ if (time > 0)
141+ radeon_benchmark_log_results(n, size, time,
142+ sdomain, ddomain, "blit");
143+ }
145144
146145 out_cleanup:
147146 if (sobj) {
drivers/gpu/drm/radeon/radeon_bios.c+26−0
@@ -99,6 +99,29 @@ static bool radeon_read_bios(struct radeon_device *rdev) · 98 unmodified lines
9999 return true;
100100 }
101101
102+static bool radeon_read_platform_bios(struct radeon_device *rdev)
103+{
104+ uint8_t __iomem *bios;
105+ size_t size;
106+
107+ rdev->bios = NULL;
108+
109+ bios = pci_platform_rom(rdev->pdev, &size);
110+ if (!bios) {
111+ return false;
112+ }
113+
114+ if (size == 0 || bios[0] != 0x55 || bios[1] != 0xaa) {
115+ return false;
116+ }
117+ rdev->bios = kmemdup(bios, size, GFP_KERNEL);
118+ if (rdev->bios == NULL) {
119+ return false;
120+ }
121+
122+ return true;
123+}
124+
102125 #ifdef CONFIG_ACPI
103126 /* ATRM is used to get the BIOS on the discrete cards in
104127 * dual-gpu systems.
@@ -620,6 +643,9 @@ bool radeon_get_bios(struct radeon_device *rdev) · 515 unmodified lines
620643 if (r == false) {
621644 r = radeon_read_disabled_bios(rdev);
622645 }
646+ if (r == false) {
647+ r = radeon_read_platform_bios(rdev);
648+ }
623649 if (r == false || rdev->bios == NULL) {
624650 DRM_ERROR("Unable to locate a BIOS ROM\n");
625651 rdev->bios = NULL;
drivers/gpu/drm/radeon/si.c+1−0
@@ -4469,6 +4469,7 @@ int si_resume(struct radeon_device *rdev) · 4468 unmodified lines
44694469
44704470 int si_suspend(struct radeon_device *rdev)
44714471 {
4472+ radeon_vm_manager_fini(rdev);
44724473 si_cp_enable(rdev, false);
44734474 cayman_dma_stop(rdev);
44744475 si_irq_suspend(rdev);
drivers/gpu/drm/udl/udl_connector.c+4−0
@@ -61,6 +61,10 @@ static int udl_get_modes(struct drm_connector *connector) · 60 unmodified lines
6161 int ret;
6262
6363 edid = (struct edid *)udl_get_edid(udl);
64+ if (!edid) {
65+ drm_mode_connector_update_edid_property(connector, NULL);
66+ return 0;
67+ }
6468
6569 /*
6670 * We only read the main block, but if the monitor reports extension
drivers/hid/hid-core.c+12−1
@@ -2077,7 +2077,6 @@ static const struct hid_device_id hid_ignore_list[] = { · 2076 unmodified lines
20772077 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HYBRID) },
20782078 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HEATCONTROL) },
20792079 { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_BEATPAD) },
2080− { HID_USB_DEVICE(USB_VENDOR_ID_MASTERKIT, USB_DEVICE_ID_MASTERKIT_MA901RADIO) },
20812080 { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1024LS) },
20822081 { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1208LS) },
20832082 { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT1) },
@@ -2244,6 +2243,18 @@ bool hid_ignore(struct hid_device *hdev) · 160 unmodified lines
22442243 hdev->product <= USB_DEVICE_ID_VELLEMAN_K8061_LAST))
22452244 return true;
22462245 break;
2246+ case USB_VENDOR_ID_ATMEL_V_USB:
2247+ /* Masterkit MA901 usb radio based on Atmel tiny85 chip and
2248+ * it has the same USB ID as many Atmel V-USB devices. This
2249+ * usb radio is handled by radio-ma901.c driver so we want
2250+ * ignore the hid. Check the name, bus, product and ignore
2251+ * if we have MA901 usb radio.
2252+ */
2253+ if (hdev->product == USB_DEVICE_ID_ATMEL_V_USB &&
2254+ hdev->bus == BUS_USB &&
2255+ strncmp(hdev->name, "www.masterkit.ru MA901", 22) == 0)
2256+ return true;
2257+ break;
22472258 }
22482259
22492260 if (hdev->type == HID_TYPE_USBMOUSE &&
drivers/hid/hid-ids.h+8−3
@@ -158,6 +158,8 @@ · 157 unmodified lines
158158 #define USB_VENDOR_ID_ATMEL 0x03eb
159159 #define USB_DEVICE_ID_ATMEL_MULTITOUCH 0x211c
160160 #define USB_DEVICE_ID_ATMEL_MXT_DIGITIZER 0x2118
161+#define USB_VENDOR_ID_ATMEL_V_USB 0x16c0
162+#define USB_DEVICE_ID_ATMEL_V_USB 0x05df
161163
162164 #define USB_VENDOR_ID_AUREAL 0x0755
163165 #define USB_DEVICE_ID_AUREAL_W01RN 0x2626
@@ -557,9 +559,6 @@ · 393 unmodified lines
557559 #define USB_VENDOR_ID_MADCATZ 0x0738
558560 #define USB_DEVICE_ID_MADCATZ_BEATPAD 0x4540
559561
560−#define USB_VENDOR_ID_MASTERKIT 0x16c0
561−#define USB_DEVICE_ID_MASTERKIT_MA901RADIO 0x05df
562−
563562 #define USB_VENDOR_ID_MCC 0x09db
564563 #define USB_DEVICE_ID_MCC_PMD1024LS 0x0076
565564 #define USB_DEVICE_ID_MCC_PMD1208LS 0x007a
@@ -590,6 +589,9 @@ · 24 unmodified lines
590589 #define USB_VENDOR_ID_MONTEREY 0x0566
591590 #define USB_DEVICE_ID_GENIUS_KB29E 0x3004
592591
592+#define USB_VENDOR_ID_MSI 0x1770
593+#define USB_DEVICE_ID_MSI_GX680R_LED_PANEL 0xff00
594+
593595 #define USB_VENDOR_ID_NATIONAL_SEMICONDUCTOR 0x0400
594596 #define USB_DEVICE_ID_N_S_HARMONY 0xc359
595597
@@ -684,6 +686,9 @@ · 88 unmodified lines
684686 #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001 0x3001
685687 #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008 0x3008
686688
689+#define USB_VENDOR_ID_REALTEK 0x0bda
690+#define USB_DEVICE_ID_REALTEK_READER 0x0152
691+
687692 #define USB_VENDOR_ID_ROCCAT 0x1e7d
688693 #define USB_DEVICE_ID_ROCCAT_ARVO 0x30d4
689694 #define USB_DEVICE_ID_ROCCAT_ISKU 0x319c
drivers/hid/hid-magicmouse.c+20−9
@@ -462,6 +462,21 @@ static int magicmouse_input_mapping(struct hid_device *hdev, · 461 unmodified lines
462462 return 0;
463463 }
464464
465+static void magicmouse_input_configured(struct hid_device *hdev,
466+ struct hid_input *hi)
467+
468+{
469+ struct magicmouse_sc *msc = hid_get_drvdata(hdev);
470+
471+ int ret = magicmouse_setup_input(msc->input, hdev);
472+ if (ret) {
473+ hid_err(hdev, "magicmouse setup input failed (%d)\n", ret);
474+ /* clean msc->input to notify probe() of the failure */
475+ msc->input = NULL;
476+ }
477+}
478+
479+
465480 static int magicmouse_probe(struct hid_device *hdev,
466481 const struct hid_device_id *id)
467482 {
@@ -493,15 +508,10 @@ static int magicmouse_probe(struct hid_device *hdev, · 25 unmodified lines
493508 goto err_free;
494509 }
495510
496− /* We do this after hid-input is done parsing reports so that
497− * hid-input uses the most natural button and axis IDs.
498− */
499− if (msc->input) {
500− ret = magicmouse_setup_input(msc->input, hdev);
501− if (ret) {
502− hid_err(hdev, "magicmouse setup input failed (%d)\n", ret);
503− goto err_stop_hw;
504− }
511+ if (!msc->input) {
512+ hid_err(hdev, "magicmouse input not registered\n");
513+ ret = -ENOMEM;
514+ goto err_stop_hw;
505515 }
506516
507517 if (id->product == USB_DEVICE_ID_APPLE_MAGICMOUSE)
@@ -568,6 +578,7 @@ static struct hid_driver magicmouse_driver = { · 60 unmodified lines
568578 .remove = magicmouse_remove,
569579 .raw_event = magicmouse_raw_event,
570580 .input_mapping = magicmouse_input_mapping,
581+ .input_configured = magicmouse_input_configured,
571582 };
572583 module_hid_driver(magicmouse_driver);
573584
drivers/hid/hid-multitouch.c+5−1
@@ -621,6 +621,7 @@ static void mt_process_mt_event(struct hid_device *hid, struct hid_field *field, · 620 unmodified lines
621621 {
622622 struct mt_device *td = hid_get_drvdata(hid);
623623 __s32 quirks = td->mtclass.quirks;
624+ struct input_dev *input = field->hidinput->input;
624625
625626 if (hid->claimed & HID_CLAIMED_INPUT) {
626627 switch (usage->hid) {
@@ -670,13 +671,16 @@ static void mt_process_mt_event(struct hid_device *hid, struct hid_field *field, · 43 unmodified lines
670671 break;
671672
672673 default:
674+ if (usage->type)
675+ input_event(input, usage->type, usage->code,
676+ value);
673677 return;
674678 }
675679
676680 if (usage->usage_index + 1 == field->report_count) {
677681 /* we only take into account the last report. */
678682 if (usage->hid == td->last_slot_field)
679− mt_complete_slot(td, field->hidinput->input);
683+ mt_complete_slot(td, input);
680684
681685 if (field->index == td->last_field_index
682686 && td->num_received >= td->num_expected)
drivers/hid/usbhid/hid-quirks.c+2−0
@@ -73,6 +73,7 @@ static const struct hid_blacklist { · 72 unmodified lines
7373 { USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS },
7474 { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET },
7575 { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET },
76+ { USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GX680R_LED_PANEL, HID_QUIRK_NO_INIT_REPORTS },
7677 { USB_VENDOR_ID_NOVATEK, USB_DEVICE_ID_NOVATEK_MOUSE, HID_QUIRK_NO_INIT_REPORTS },
7778 { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS },
7879 { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1, HID_QUIRK_NO_INIT_REPORTS },
@@ -80,6 +81,7 @@ static const struct hid_blacklist { · 1 unmodified line
8081 { USB_VENDOR_ID_PRODIGE, USB_DEVICE_ID_PRODIGE_CORDLESS, HID_QUIRK_NOGET },
8182 { USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001, HID_QUIRK_NOGET },
8283 { USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008, HID_QUIRK_NOGET },
84+ { USB_VENDOR_ID_REALTEK, USB_DEVICE_ID_REALTEK_READER, HID_QUIRK_NO_INIT_REPORTS },
8385 { USB_VENDOR_ID_SENNHEISER, USB_DEVICE_ID_SENNHEISER_BTD500USB, HID_QUIRK_NOGET },
8486 { USB_VENDOR_ID_SIGMATEL, USB_DEVICE_ID_SIGMATEL_STMP3780, HID_QUIRK_NOGET },
8587 { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET },
drivers/hwmon/lineage-pem.c+2−0
@@ -422,6 +422,7 @@ static struct attribute *pem_input_attributes[] = { · 421 unmodified lines
422422 &sensor_dev_attr_in2_input.dev_attr.attr,
423423 &sensor_dev_attr_curr1_input.dev_attr.attr,
424424 &sensor_dev_attr_power1_input.dev_attr.attr,
425+ NULL
425426 };
426427
427428 static const struct attribute_group pem_input_group = {
@@ -432,6 +433,7 @@ static struct attribute *pem_fan_attributes[] = { · 4 unmodified lines
432433 &sensor_dev_attr_fan1_input.dev_attr.attr,
433434 &sensor_dev_attr_fan2_input.dev_attr.attr,
434435 &sensor_dev_attr_fan3_input.dev_attr.attr,
436+ NULL
435437 };
436438
437439 static const struct attribute_group pem_fan_group = {
drivers/hwmon/lm75.h+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 which contains this code, we don't worry about the wasted space.
2626 */
2727
28−#include <linux/hwmon.h>
28+#include <linux/kernel.h>
2929
3030 /* straight from the datasheet */
3131 #define LM75_TEMP_MIN (-55000)
drivers/hwmon/pmbus/ltc2978.c+8−6
@@ -59,7 +59,7 @@ enum chips { ltc2978, ltc3880 }; · 58 unmodified lines
5959 struct ltc2978_data {
6060 enum chips id;
6161 int vin_min, vin_max;
62− int temp_min, temp_max;
62+ int temp_min, temp_max[2];
6363 int vout_min[8], vout_max[8];
6464 int iout_max[2];
6565 int temp2_max;
@@ -113,9 +113,10 @@ static int ltc2978_read_word_data_common(struct i2c_client *client, int page, · 47 unmodified lines
113113 ret = pmbus_read_word_data(client, page,
114114 LTC2978_MFR_TEMPERATURE_PEAK);
115115 if (ret >= 0) {
116− if (lin11_to_val(ret) > lin11_to_val(data->temp_max))
117− data->temp_max = ret;
118− ret = data->temp_max;
116+ if (lin11_to_val(ret)
117+ > lin11_to_val(data->temp_max[page]))
118+ data->temp_max[page] = ret;
119+ ret = data->temp_max[page];
119120 }
120121 break;
121122 case PMBUS_VIRT_RESET_VOUT_HISTORY:
@@ -266,7 +267,7 @@ static int ltc2978_write_word_data(struct i2c_client *client, int page, · 144 unmodified lines
266267 break;
267268 case PMBUS_VIRT_RESET_TEMP_HISTORY:
268269 data->temp_min = 0x7bff;
269− data->temp_max = 0x7c00;
270+ data->temp_max[page] = 0x7c00;
270271 ret = ltc2978_clear_peaks(client, page, data->id);
271272 break;
272273 default:
@@ -323,7 +324,8 @@ static int ltc2978_probe(struct i2c_client *client, · 50 unmodified lines
323324 data->vin_min = 0x7bff;
324325 data->vin_max = 0x7c00;
325326 data->temp_min = 0x7bff;
326− data->temp_max = 0x7c00;
327+ for (i = 0; i < ARRAY_SIZE(data->temp_max); i++)
328+ data->temp_max[i] = 0x7c00;
327329 data->temp2_max = 0x7c00;
328330
329331 switch (data->id) {
drivers/hwmon/pmbus/pmbus_core.c+7−5
@@ -766,12 +766,14 @@ static ssize_t pmbus_show_label(struct device *dev, · 765 unmodified lines
766766 static int pmbus_add_attribute(struct pmbus_data *data, struct attribute *attr)
767767 {
768768 if (data->num_attributes >= data->max_attributes - 1) {
769− data->max_attributes += PMBUS_ATTR_ALLOC_SIZE;
770− data->group.attrs = krealloc(data->group.attrs,
771− sizeof(struct attribute *) *
772− data->max_attributes, GFP_KERNEL);
773− if (data->group.attrs == NULL)
769+ int new_max_attrs = data->max_attributes + PMBUS_ATTR_ALLOC_SIZE;
770+ void *new_attrs = krealloc(data->group.attrs,
771+ new_max_attrs * sizeof(void *),
772+ GFP_KERNEL);
773+ if (!new_attrs)
774774 return -ENOMEM;
775+ data->group.attrs = new_attrs;
776+ data->max_attributes = new_max_attrs;
775777 }
776778
777779 data->group.attrs[data->num_attributes++] = attr;
drivers/hwspinlock/hwspinlock_core.c+2−0
@@ -416,6 +416,8 @@ static int __hwspin_lock_request(struct hwspinlock *hwlock) · 415 unmodified lines
416416 ret = pm_runtime_get_sync(dev);
417417 if (ret < 0) {
418418 dev_err(dev, "%s: can't power on device\n", __func__);
419+ pm_runtime_put_noidle(dev);
420+ module_put(dev->driver->owner);
419421 return ret;
420422 }
421423
drivers/i2c/Kconfig+1−1
@@ -4,7 +4,6 @@ · 3 unmodified lines
44
55 menuconfig I2C
66 tristate "I2C support"
7− depends on !S390
87 select RT_MUTEXES
98 ---help---
109 I2C (pronounce: I-squared-C) is a slow serial bus protocol used in
@@ -76,6 +75,7 @@ config I2C_HELPER_AUTO · 65 unmodified lines
7675
7776 config I2C_SMBUS
7877 tristate "SMBus-specific protocols" if !I2C_HELPER_AUTO
78+ depends on GENERIC_HARDIRQS
7979 help
8080 Say Y here if you want support for SMBus extensions to the I2C
8181 specification. At the moment, the only supported extension is
drivers/i2c/busses/Kconfig+4−2
@@ -114,7 +114,7 @@ config I2C_I801 · 113 unmodified lines
114114
115115 config I2C_ISCH
116116 tristate "Intel SCH SMBus 1.0"
117− depends on PCI
117+ depends on PCI && GENERIC_HARDIRQS
118118 select LPC_SCH
119119 help
120120 Say Y here if you want to use SMBus controller on the Intel SCH
@@ -543,6 +543,7 @@ config I2C_NUC900 · 422 unmodified lines
543543
544544 config I2C_OCORES
545545 tristate "OpenCores I2C Controller"
546+ depends on GENERIC_HARDIRQS
546547 help
547548 If you say yes to this option, support will be included for the
548549 OpenCores I2C controller. For details see
@@ -777,7 +778,7 @@ config I2C_DIOLAN_U2C · 228 unmodified lines
777778
778779 config I2C_PARPORT
779780 tristate "Parallel port adapter"
780− depends on PARPORT
781+ depends on PARPORT && GENERIC_HARDIRQS
781782 select I2C_ALGOBIT
782783 select I2C_SMBUS
783784 help
@@ -802,6 +803,7 @@ config I2C_PARPORT · 18 unmodified lines
802803
803804 config I2C_PARPORT_LIGHT
804805 tristate "Parallel port adapter (light)"
806+ depends on GENERIC_HARDIRQS
805807 select I2C_ALGOBIT
806808 select I2C_SMBUS
807809 help
drivers/i2c/busses/i2c-designware-platdrv.c+0−1
@@ -182,7 +182,6 @@ static int dw_i2c_probe(struct platform_device *pdev) · 181 unmodified lines
182182 adap->algo = &i2c_dw_algo;
183183 adap->dev.parent = &pdev->dev;
184184 adap->dev.of_node = pdev->dev.of_node;
185− ACPI_HANDLE_SET(&adap->dev, ACPI_HANDLE(&pdev->dev));
186185
187186 r = i2c_add_numbered_adapter(adap);
188187 if (r) {
drivers/i2c/busses/i2c-ismt.c+2−0
@@ -80,6 +80,7 @@ · 79 unmodified lines
8080 /* PCI DIDs for the Intel SMBus Message Transport (SMT) Devices */
8181 #define PCI_DEVICE_ID_INTEL_S1200_SMT0 0x0c59
8282 #define PCI_DEVICE_ID_INTEL_S1200_SMT1 0x0c5a
83+#define PCI_DEVICE_ID_INTEL_AVOTON_SMT 0x1f15
8384
8485 #define ISMT_DESC_ENTRIES 32 /* number of descriptor entries */
8586 #define ISMT_MAX_RETRIES 3 /* number of SMBus retries to attempt */
@@ -185,6 +186,7 @@ struct ismt_priv { · 99 unmodified lines
185186 static const DEFINE_PCI_DEVICE_TABLE(ismt_ids) = {
186187 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_S1200_SMT0) },
187188 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_S1200_SMT1) },
189+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_AVOTON_SMT) },
188190 { 0, }
189191 };
190192
drivers/i2c/busses/i2c-tegra.c+11−2
@@ -411,7 +411,11 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev) · 410 unmodified lines
411411 int clk_multiplier = I2C_CLK_MULTIPLIER_STD_FAST_MODE;
412412 u32 clk_divisor;
413413
414− tegra_i2c_clock_enable(i2c_dev);
414+ err = tegra_i2c_clock_enable(i2c_dev);
415+ if (err < 0) {
416+ dev_err(i2c_dev->dev, "Clock enable failed %d\n", err);
417+ return err;
418+ }
415419
416420 tegra_periph_reset_assert(i2c_dev->div_clk);
417421 udelay(2);
@@ -628,7 +632,12 @@ static int tegra_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], · 210 unmodified lines
628632 if (i2c_dev->is_suspended)
629633 return -EBUSY;
630634
631− tegra_i2c_clock_enable(i2c_dev);
635+ ret = tegra_i2c_clock_enable(i2c_dev);
636+ if (ret < 0) {
637+ dev_err(i2c_dev->dev, "Clock enable failed %d\n", ret);
638+ return ret;
639+ }
640+
632641 for (i = 0; i < num; i++) {
633642 enum msg_end_type end_type = MSG_END_STOP;
634643 if (i < (num - 1)) {
drivers/i2c/muxes/i2c-mux-pca9541.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Copyright (c) 2010 Ericsson AB.
55 *
6− * Author: Guenter Roeck <guenter.roeck@ericsson.com>
6+ * Author: Guenter Roeck <linux@roeck-us.net>
77 *
88 * Derived from:
99 * pca954x.c
drivers/idle/intel_idle.c+1−0
@@ -465,6 +465,7 @@ static const struct x86_cpu_id intel_idle_ids[] = { · 464 unmodified lines
465465 ICPU(0x3c, idle_cpu_hsw),
466466 ICPU(0x3f, idle_cpu_hsw),
467467 ICPU(0x45, idle_cpu_hsw),
468+ ICPU(0x46, idle_cpu_hsw),
468469 {}
469470 };
470471 MODULE_DEVICE_TABLE(x86cpu, intel_idle_ids);
drivers/iio/common/st_sensors/st_sensors_core.c+4−5
@@ -62,7 +62,7 @@ st_sensors_match_odr_error: · 61 unmodified lines
6262 int st_sensors_set_odr(struct iio_dev *indio_dev, unsigned int odr)
6363 {
6464 int err;
65− struct st_sensor_odr_avl odr_out;
65+ struct st_sensor_odr_avl odr_out = {0, 0};
6666 struct st_sensor_data *sdata = iio_priv(indio_dev);
6767
6868 err = st_sensors_match_odr(sdata->sensor, odr, &odr_out);
@@ -114,7 +114,7 @@ st_sensors_match_odr_error: · 45 unmodified lines
114114
115115 static int st_sensors_set_fullscale(struct iio_dev *indio_dev, unsigned int fs)
116116 {
117− int err, i;
117+ int err, i = 0;
118118 struct st_sensor_data *sdata = iio_priv(indio_dev);
119119
120120 err = st_sensors_match_fs(sdata->sensor, fs, &i);
@@ -139,14 +139,13 @@ st_accel_set_fullscale_error: · 18 unmodified lines
139139
140140 int st_sensors_set_enable(struct iio_dev *indio_dev, bool enable)
141141 {
142− bool found;
143142 u8 tmp_value;
144143 int err = -EINVAL;
145− struct st_sensor_odr_avl odr_out;
144+ bool found = false;
145+ struct st_sensor_odr_avl odr_out = {0, 0};
146146 struct st_sensor_data *sdata = iio_priv(indio_dev);
147147
148148 if (enable) {
149− found = false;
150149 tmp_value = sdata->sensor->pw.value_on;
151150 if ((sdata->sensor->odr.addr == sdata->sensor->pw.addr) &&
152151 (sdata->sensor->odr.mask == sdata->sensor->pw.mask)) {
drivers/iio/dac/ad5064.c+38−26
@@ -27,7 +27,6 @@ · 26 unmodified lines
2727 #define AD5064_ADDR(x) ((x) << 20)
2828 #define AD5064_CMD(x) ((x) << 24)
2929
30−#define AD5064_ADDR_DAC(chan) (chan)
3130 #define AD5064_ADDR_ALL_DAC 0xF
3231
3332 #define AD5064_CMD_WRITE_INPUT_N 0x0
@@ -131,15 +130,15 @@ static int ad5064_write(struct ad5064_state *st, unsigned int cmd, · 97 unmodified lines
131130 }
132131
133132 static int ad5064_sync_powerdown_mode(struct ad5064_state *st,
134− unsigned int channel)
133+ const struct iio_chan_spec *chan)
135134 {
136135 unsigned int val;
137136 int ret;
138137
139− val = (0x1 << channel);
138+ val = (0x1 << chan->address);
140139
141− if (st->pwr_down[channel])
142− val |= st->pwr_down_mode[channel] << 8;
140+ if (st->pwr_down[chan->channel])
141+ val |= st->pwr_down_mode[chan->channel] << 8;
143142
144143 ret = ad5064_write(st, AD5064_CMD_POWERDOWN_DAC, 0, val, 0);
145144
@@ -169,7 +168,7 @@ static int ad5064_set_powerdown_mode(struct iio_dev *indio_dev, · 23 unmodified lines
169168 mutex_lock(&indio_dev->mlock);
170169 st->pwr_down_mode[chan->channel] = mode + 1;
171170
172− ret = ad5064_sync_powerdown_mode(st, chan->channel);
171+ ret = ad5064_sync_powerdown_mode(st, chan);
173172 mutex_unlock(&indio_dev->mlock);
174173
175174 return ret;
@@ -205,7 +204,7 @@ static ssize_t ad5064_write_dac_powerdown(struct iio_dev *indio_dev, · 29 unmodified lines
205204 mutex_lock(&indio_dev->mlock);
206205 st->pwr_down[chan->channel] = pwr_down;
207206
208− ret = ad5064_sync_powerdown_mode(st, chan->channel);
207+ ret = ad5064_sync_powerdown_mode(st, chan);
209208 mutex_unlock(&indio_dev->mlock);
210209 return ret ? ret : len;
211210 }
@@ -258,7 +257,7 @@ static int ad5064_write_raw(struct iio_dev *indio_dev, · 46 unmodified lines
258257
259258 switch (mask) {
260259 case IIO_CHAN_INFO_RAW:
261− if (val > (1 << chan->scan_type.realbits) || val < 0)
260+ if (val >= (1 << chan->scan_type.realbits) || val < 0)
262261 return -EINVAL;
263262
264263 mutex_lock(&indio_dev->mlock);
@@ -292,34 +291,44 @@ static const struct iio_chan_spec_ext_info ad5064_ext_info[] = { · 27 unmodified lines
292291 { },
293292 };
294293
295−#define AD5064_CHANNEL(chan, bits) { \
294+#define AD5064_CHANNEL(chan, addr, bits) { \
296295 .type = IIO_VOLTAGE, \
297296 .indexed = 1, \
298297 .output = 1, \
299298 .channel = (chan), \
300299 .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
301300 IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \
302− .address = AD5064_ADDR_DAC(chan), \
301+ .address = addr, \
303302 .scan_type = IIO_ST('u', (bits), 16, 20 - (bits)), \
304303 .ext_info = ad5064_ext_info, \
305304 }
306305
307306 #define DECLARE_AD5064_CHANNELS(name, bits) \
308307 const struct iio_chan_spec name[] = { \
309− AD5064_CHANNEL(0, bits), \
310− AD5064_CHANNEL(1, bits), \
311− AD5064_CHANNEL(2, bits), \
312− AD5064_CHANNEL(3, bits), \
313− AD5064_CHANNEL(4, bits), \
314− AD5064_CHANNEL(5, bits), \
315− AD5064_CHANNEL(6, bits), \
316− AD5064_CHANNEL(7, bits), \
308+ AD5064_CHANNEL(0, 0, bits), \
309+ AD5064_CHANNEL(1, 1, bits), \
310+ AD5064_CHANNEL(2, 2, bits), \
311+ AD5064_CHANNEL(3, 3, bits), \
312+ AD5064_CHANNEL(4, 4, bits), \
313+ AD5064_CHANNEL(5, 5, bits), \
314+ AD5064_CHANNEL(6, 6, bits), \
315+ AD5064_CHANNEL(7, 7, bits), \
316+}
317+
318+#define DECLARE_AD5065_CHANNELS(name, bits) \
319+const struct iio_chan_spec name[] = { \
320+ AD5064_CHANNEL(0, 0, bits), \
321+ AD5064_CHANNEL(1, 3, bits), \
317322 }
318323
319324 static DECLARE_AD5064_CHANNELS(ad5024_channels, 12);
320325 static DECLARE_AD5064_CHANNELS(ad5044_channels, 14);
321326 static DECLARE_AD5064_CHANNELS(ad5064_channels, 16);
322327
328+static DECLARE_AD5065_CHANNELS(ad5025_channels, 12);
329+static DECLARE_AD5065_CHANNELS(ad5045_channels, 14);
330+static DECLARE_AD5065_CHANNELS(ad5065_channels, 16);
331+
323332 static const struct ad5064_chip_info ad5064_chip_info_tbl[] = {
324333 [ID_AD5024] = {
325334 .shared_vref = false,
@@ -328,7 +337,7 @@ static const struct ad5064_chip_info ad5064_chip_info_tbl[] = { · 2 unmodified lines
328337 },
329338 [ID_AD5025] = {
330339 .shared_vref = false,
331− .channels = ad5024_channels,
340+ .channels = ad5025_channels,
332341 .num_channels = 2,
333342 },
334343 [ID_AD5044] = {
@@ -338,7 +347,7 @@ static const struct ad5064_chip_info ad5064_chip_info_tbl[] = { · 3 unmodified lines
338347 },
339348 [ID_AD5045] = {
340349 .shared_vref = false,
341− .channels = ad5044_channels,
350+ .channels = ad5045_channels,
342351 .num_channels = 2,
343352 },
344353 [ID_AD5064] = {
@@ -353,7 +362,7 @@ static const struct ad5064_chip_info ad5064_chip_info_tbl[] = { · 8 unmodified lines
353362 },
354363 [ID_AD5065] = {
355364 .shared_vref = false,
356− .channels = ad5064_channels,
365+ .channels = ad5065_channels,
357366 .num_channels = 2,
358367 },
359368 [ID_AD5628_1] = {
@@ -429,6 +438,7 @@ static int ad5064_probe(struct device *dev, enum ad5064_type type, · 69 unmodified lines
429438 {
430439 struct iio_dev *indio_dev;
431440 struct ad5064_state *st;
441+ unsigned int midscale;
432442 unsigned int i;
433443 int ret;
434444
@@ -465,11 +475,6 @@ static int ad5064_probe(struct device *dev, enum ad5064_type type, · 30 unmodified lines
465475 goto error_free_reg;
466476 }
467477
468− for (i = 0; i < st->chip_info->num_channels; ++i) {
469− st->pwr_down_mode[i] = AD5064_LDAC_PWRDN_1K;
470− st->dac_cache[i] = 0x8000;
471− }
472−
473478 indio_dev->dev.parent = dev;
474479 indio_dev->name = name;
475480 indio_dev->info = &ad5064_info;
@@ -477,6 +482,13 @@ static int ad5064_probe(struct device *dev, enum ad5064_type type, · 1 unmodified line
477482 indio_dev->channels = st->chip_info->channels;
478483 indio_dev->num_channels = st->chip_info->num_channels;
479484
485+ midscale = (1 << indio_dev->channels[0].scan_type.realbits) / 2;
486+
487+ for (i = 0; i < st->chip_info->num_channels; ++i) {
488+ st->pwr_down_mode[i] = AD5064_LDAC_PWRDN_1K;
489+ st->dac_cache[i] = midscale;
490+ }
491+
480492 ret = iio_device_register(indio_dev);
481493 if (ret)
482494 goto error_disable_reg;
drivers/iio/imu/inv_mpu6050/Kconfig+1−0
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 config INV_MPU6050_IIO
66 tristate "Invensense MPU6050 devices"
77 depends on I2C && SYSFS
8+ select IIO_BUFFER
89 select IIO_TRIGGERED_BUFFER
910 help
1011 This driver supports the Invensense MPU6050 devices.
drivers/infiniband/hw/cxgb4/cm.c+12−0
@@ -1575,6 +1575,12 @@ static int c4iw_reconnect(struct c4iw_ep *ep) · 1574 unmodified lines
15751575
15761576 neigh = dst_neigh_lookup(ep->dst,
15771577 &ep->com.cm_id->remote_addr.sin_addr.s_addr);
1578+ if (!neigh) {
1579+ pr_err("%s - cannot alloc neigh.\n", __func__);
1580+ err = -ENOMEM;
1581+ goto fail4;
1582+ }
1583+
15781584 /* get a l2t entry */
15791585 if (neigh->dev->flags & IFF_LOOPBACK) {
15801586 PDBG("%s LOOPBACK\n", __func__);
@@ -3053,6 +3059,12 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb) · 1472 unmodified lines
30533059 dst = &rt->dst;
30543060 neigh = dst_neigh_lookup_skb(dst, skb);
30553061
3062+ if (!neigh) {
3063+ pr_err("%s - failed to allocate neigh!\n",
3064+ __func__);
3065+ goto free_dst;
3066+ }
3067+
30563068 if (neigh->dev->flags & IFF_LOOPBACK) {
30573069 pdev = ip_dev_find(&init_net, iph->daddr);
30583070 e = cxgb4_l2t_get(dev->rdev.lldi.l2t, neigh,
drivers/infiniband/hw/cxgb4/qp.c+3−1
@@ -186,8 +186,10 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq, · 185 unmodified lines
186186 wq->rq.queue = dma_alloc_coherent(&(rdev->lldi.pdev->dev),
187187 wq->rq.memsize, &(wq->rq.dma_addr),
188188 GFP_KERNEL);
189− if (!wq->rq.queue)
189+ if (!wq->rq.queue) {
190+ ret = -ENOMEM;
190191 goto free_sq;
192+ }
191193 PDBG("%s sq base va 0x%p pa 0x%llx rq base va 0x%p pa 0x%llx\n",
192194 __func__, wq->sq.queue,
193195 (unsigned long long)virt_to_phys(wq->sq.queue),
drivers/infiniband/hw/ipath/ipath_verbs.c+1−1
@@ -620,7 +620,7 @@ void ipath_ib_rcv(struct ipath_ibdev *dev, void *rhdr, void *data, · 619 unmodified lines
620620 goto bail;
621621 }
622622
623− opcode = be32_to_cpu(ohdr->bth[0]) >> 24;
623+ opcode = (be32_to_cpu(ohdr->bth[0]) >> 24) & 0x7f;
624624 dev->opstats[opcode].n_bytes += tlen;
625625 dev->opstats[opcode].n_packets++;
626626
drivers/infiniband/hw/mlx4/cm.c+0−1
@@ -362,7 +362,6 @@ void mlx4_ib_cm_paravirt_init(struct mlx4_ib_dev *dev) · 361 unmodified lines
362362 INIT_LIST_HEAD(&dev->sriov.cm_list);
363363 dev->sriov.sl_id_map = RB_ROOT;
364364 idr_init(&dev->sriov.pv_id_table);
365− idr_pre_get(&dev->sriov.pv_id_table, GFP_KERNEL);
366365 }
367366
368367 /* slave = -1 ==> all slaves */
drivers/infiniband/hw/qib/Kconfig+3−3
@@ -1,7 +1,7 @@
11 config INFINIBAND_QIB
2− tristate "QLogic PCIe HCA support"
2+ tristate "Intel PCIe HCA support"
33 depends on 64BIT
44 ---help---
5− This is a low-level driver for QLogic PCIe QLE InfiniBand host
6− channel adapters. This driver does not support the QLogic
5+ This is a low-level driver for Intel PCIe QLE InfiniBand host
6+ channel adapters. This driver does not support the Intel
77 HyperTransport card (model QHT7140).
drivers/infiniband/hw/qib/qib_driver.c+3−2
@@ -1,4 +1,5 @@
11 /*
2+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
23 * Copyright (c) 2006, 2007, 2008, 2009 QLogic Corporation. All rights reserved.
34 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
45 *
@@ -63,8 +64,8 @@ MODULE_PARM_DESC(compat_ddr_negotiate, · 58 unmodified lines
6364 "Attempt pre-IBTA 1.2 DDR speed negotiation");
6465
6566 MODULE_LICENSE("Dual BSD/GPL");
66−MODULE_AUTHOR("QLogic <support@qlogic.com>");
67−MODULE_DESCRIPTION("QLogic IB driver");
67+MODULE_AUTHOR("Intel <ibsupport@intel.com>");
68+MODULE_DESCRIPTION("Intel IB driver");
6869 MODULE_VERSION(QIB_DRIVER_VERSION);
6970
7071 /*
drivers/infiniband/hw/qib/qib_iba6120.c+2−1
@@ -1,4 +1,5 @@
11 /*
2+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
23 * Copyright (c) 2006, 2007, 2008, 2009, 2010 QLogic Corporation.
34 * All rights reserved.
45 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
@@ -51,7 +52,7 @@ static u32 qib_6120_iblink_state(u64); · 46 unmodified lines
5152
5253 /*
5354 * This file contains all the chip-specific register information and
54− * access functions for the QLogic QLogic_IB PCI-Express chip.
55+ * access functions for the Intel Intel_IB PCI-Express chip.
5556 *
5657 */
5758
drivers/infiniband/hw/qib/qib_init.c+4−4
@@ -1,5 +1,5 @@
11 /*
2− * Copyright (c) 2012 Intel Corporation. All rights reserved.
2+ * Copyright (c) 2012, 2013 Intel Corporation. All rights reserved.
33 * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
44 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
55 *
@@ -1138,7 +1138,7 @@ void qib_disable_after_error(struct qib_devdata *dd) · 1132 unmodified lines
11381138 static void qib_remove_one(struct pci_dev *);
11391139 static int qib_init_one(struct pci_dev *, const struct pci_device_id *);
11401140
1141−#define DRIVER_LOAD_MSG "QLogic " QIB_DRV_NAME " loaded: "
1141+#define DRIVER_LOAD_MSG "Intel " QIB_DRV_NAME " loaded: "
11421142 #define PFX QIB_DRV_NAME ": "
11431143
11441144 static DEFINE_PCI_DEVICE_TABLE(qib_pci_tbl) = {
@@ -1355,7 +1355,7 @@ static int qib_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 210 unmodified lines
13551355 dd = qib_init_iba6120_funcs(pdev, ent);
13561356 #else
13571357 qib_early_err(&pdev->dev,
1358− "QLogic PCIE device 0x%x cannot work if CONFIG_PCI_MSI is not enabled\n",
1358+ "Intel PCIE device 0x%x cannot work if CONFIG_PCI_MSI is not enabled\n",
13591359 ent->device);
13601360 dd = ERR_PTR(-ENODEV);
13611361 #endif
@@ -1371,7 +1371,7 @@ static int qib_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 9 unmodified lines
13711371
13721372 default:
13731373 qib_early_err(&pdev->dev,
1374− "Failing on unknown QLogic deviceid 0x%x\n",
1374+ "Failing on unknown Intel deviceid 0x%x\n",
13751375 ent->device);
13761376 ret = -ENODEV;
13771377 }
drivers/infiniband/hw/qib/qib_sd7220.c+1−1
@@ -1,5 +1,5 @@
11 /*
2− * Copyright (c) 2012 Intel Corporation. All rights reserved.
2+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
33 * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
44 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
55 *
drivers/infiniband/hw/qib/qib_verbs.c+2−2
@@ -1,5 +1,5 @@
11 /*
2− * Copyright (c) 2012 Intel Corporation. All rights reserved.
2+ * Copyright (c) 2012, 2013 Intel Corporation. All rights reserved.
33 * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
44 * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
55 *
@@ -2224,7 +2224,7 @@ int qib_register_ib_device(struct qib_devdata *dd) · 2218 unmodified lines
22242224 ibdev->dma_ops = &qib_dma_mapping_ops;
22252225
22262226 snprintf(ibdev->node_desc, sizeof(ibdev->node_desc),
2227− "QLogic Infiniband HCA %s", init_utsname()->nodename);
2227+ "Intel Infiniband HCA %s", init_utsname()->nodename);
22282228
22292229 ret = ib_register_device(ibdev, qib_create_port_files);
22302230 if (ret)
drivers/infiniband/ulp/ipoib/ipoib_cm.c+6−2
@@ -758,9 +758,13 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_ · 757 unmodified lines
758758 if (++priv->tx_outstanding == ipoib_sendq_size) {
759759 ipoib_dbg(priv, "TX ring 0x%x full, stopping kernel net queue\n",
760760 tx->qp->qp_num);
761− if (ib_req_notify_cq(priv->send_cq, IB_CQ_NEXT_COMP))
762− ipoib_warn(priv, "request notify on send CQ failed\n");
763761 netif_stop_queue(dev);
762+ rc = ib_req_notify_cq(priv->send_cq,
763+ IB_CQ_NEXT_COMP | IB_CQ_REPORT_MISSED_EVENTS);
764+ if (rc < 0)
765+ ipoib_warn(priv, "request notify on send CQ failed\n");
766+ else if (rc)
767+ ipoib_send_comp_handler(priv->send_cq, dev);
764768 }
765769 }
766770 }
drivers/input/joystick/analog.c+2−6
@@ -158,14 +158,10 @@ static unsigned int get_time_pit(void) · 157 unmodified lines
158158 #define GET_TIME(x) rdtscl(x)
159159 #define DELTA(x,y) ((y)-(x))
160160 #define TIME_NAME "TSC"
161−#elif defined(__alpha__)
161+#elif defined(__alpha__) || defined(CONFIG_MN10300) || defined(CONFIG_ARM) || defined(CONFIG_TILE)
162162 #define GET_TIME(x) do { x = get_cycles(); } while (0)
163163 #define DELTA(x,y) ((y)-(x))
164−#define TIME_NAME "PCC"
165−#elif defined(CONFIG_MN10300) || defined(CONFIG_TILE)
166−#define GET_TIME(x) do { x = get_cycles(); } while (0)
167−#define DELTA(x, y) ((x) - (y))
168−#define TIME_NAME "TSC"
164+#define TIME_NAME "get_cycles"
169165 #else
170166 #define FAKE_TIME
171167 static unsigned long analog_faketime = 0;
drivers/input/tablet/wacom_wac.c+4−4
@@ -359,7 +359,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom) · 358 unmodified lines
359359 case 0x802: /* Intuos4 General Pen */
360360 case 0x804: /* Intuos4 Marker Pen */
361361 case 0x40802: /* Intuos4 Classic Pen */
362− case 0x18803: /* DTH2242 Grip Pen */
362+ case 0x18802: /* DTH2242 Grip Pen */
363363 case 0x022:
364364 wacom->tool[idx] = BTN_TOOL_PEN;
365365 break;
@@ -1912,7 +1912,7 @@ static const struct wacom_features wacom_features_0xBB = · 1546 unmodified lines
19121912 { "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047,
19131913 63, INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
19141914 static const struct wacom_features wacom_features_0xBC =
1915− { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047,
1915+ { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40640, 25400, 2047,
19161916 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
19171917 static const struct wacom_features wacom_features_0x26 =
19181918 { "Wacom Intuos5 touch S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047,
@@ -2144,7 +2144,7 @@ const struct usb_device_id wacom_ids[] = { · 225 unmodified lines
21442144 { USB_DEVICE_WACOM(0x44) },
21452145 { USB_DEVICE_WACOM(0x45) },
21462146 { USB_DEVICE_WACOM(0x59) },
2147− { USB_DEVICE_WACOM(0x5D) },
2147+ { USB_DEVICE_DETAILED(0x5D, USB_CLASS_HID, 0, 0) },
21482148 { USB_DEVICE_WACOM(0xB0) },
21492149 { USB_DEVICE_WACOM(0xB1) },
21502150 { USB_DEVICE_WACOM(0xB2) },
@@ -2209,7 +2209,7 @@ const struct usb_device_id wacom_ids[] = { · 58 unmodified lines
22092209 { USB_DEVICE_WACOM(0x47) },
22102210 { USB_DEVICE_WACOM(0xF4) },
22112211 { USB_DEVICE_WACOM(0xF8) },
2212− { USB_DEVICE_WACOM(0xF6) },
2212+ { USB_DEVICE_DETAILED(0xF6, USB_CLASS_HID, 0, 0) },
22132213 { USB_DEVICE_WACOM(0xFA) },
22142214 { USB_DEVICE_LENOVO(0x6004) },
22152215 { }
drivers/iommu/Kconfig+1−1
@@ -130,7 +130,7 @@ config IRQ_REMAP · 129 unmodified lines
130130 # OMAP IOMMU support
131131 config OMAP_IOMMU
132132 bool "OMAP IOMMU Support"
133− depends on ARCH_OMAP
133+ depends on ARCH_OMAP2PLUS
134134 select IOMMU_API
135135
136136 config OMAP_IOVMM
drivers/iommu/amd_iommu.c+10−12
@@ -2466,18 +2466,16 @@ static int device_change_notifier(struct notifier_block *nb, · 2465 unmodified lines
24662466
24672467 /* allocate a protection domain if a device is added */
24682468 dma_domain = find_protection_domain(devid);
2469− if (dma_domain)
2470− goto out;
2471− dma_domain = dma_ops_domain_alloc();
2472− if (!dma_domain)
2473− goto out;
2474− dma_domain->target_dev = devid;
2475−
2476− spin_lock_irqsave(&iommu_pd_list_lock, flags);
2477− list_add_tail(&dma_domain->list, &iommu_pd_list);
2478− spin_unlock_irqrestore(&iommu_pd_list_lock, flags);
2479−
2480− dev_data = get_dev_data(dev);
2469+ if (!dma_domain) {
2470+ dma_domain = dma_ops_domain_alloc();
2471+ if (!dma_domain)
2472+ goto out;
2473+ dma_domain->target_dev = devid;
2474+
2475+ spin_lock_irqsave(&iommu_pd_list_lock, flags);
2476+ list_add_tail(&dma_domain->list, &iommu_pd_list);
2477+ spin_unlock_irqrestore(&iommu_pd_list_lock, flags);
2478+ }
24812479
24822480 dev->archdata.dma_ops = &amd_iommu_dma_ops;
24832481
drivers/iommu/amd_iommu_init.c+1−1
@@ -980,7 +980,7 @@ static void __init free_iommu_all(void) · 979 unmodified lines
980980 * BIOS should disable L2B micellaneous clock gating by setting
981981 * L2_L2B_CK_GATE_CONTROL[CKGateL2BMiscDisable](D0F2xF4_x90[2]) = 1b
982982 */
983−static void __init amd_iommu_erratum_746_workaround(struct amd_iommu *iommu)
983+static void amd_iommu_erratum_746_workaround(struct amd_iommu *iommu)
984984 {
985985 u32 value;
986986
drivers/iommu/irq_remapping.c+0−1
@@ -2,7 +2,6 @@ · 1 unmodified line
22 #include <linux/cpumask.h>
33 #include <linux/kernel.h>
44 #include <linux/string.h>
5−#include <linux/cpumask.h>
65 #include <linux/errno.h>
76 #include <linux/msi.h>
87 #include <linux/irq.h>
drivers/irqchip/irq-gic.c+3−2
@@ -236,7 +236,8 @@ static int gic_retrigger(struct irq_data *d) · 235 unmodified lines
236236 if (gic_arch_extn.irq_retrigger)
237237 return gic_arch_extn.irq_retrigger(d);
238238
239− return -ENXIO;
239+ /* the genirq layer expects 0 if we can't retrigger in hardware */
240+ return 0;
240241 }
241242
242243 #ifdef CONFIG_SMP
@@ -648,7 +649,7 @@ void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) · 405 unmodified lines
648649
649650 /* Convert our logical CPU mask into a physical one. */
650651 for_each_cpu(cpu, mask)
651− map |= 1 << cpu_logical_map(cpu);
652+ map |= gic_cpu_map[cpu];
652653
653654 /*
654655 * Ensure that stores to Normal memory are visible to the
drivers/isdn/hisax/Kconfig+4−2
@@ -237,7 +237,8 @@ config HISAX_MIC · 236 unmodified lines
237237
238238 config HISAX_NETJET
239239 bool "NETjet card"
240− depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV || (XTENSA && !CPU_LITTLE_ENDIAN)))
240+ depends on PCI && (BROKEN || !(PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV || (XTENSA && !CPU_LITTLE_ENDIAN)))
241+ depends on VIRT_TO_BUS
241242 help
242243 This enables HiSax support for the NetJet from Traverse
243244 Technologies.
@@ -248,7 +249,8 @@ config HISAX_NETJET · 4 unmodified lines
248249
249250 config HISAX_NETJET_U
250251 bool "NETspider U card"
251− depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV || (XTENSA && !CPU_LITTLE_ENDIAN)))
252+ depends on PCI && (BROKEN || !(PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV || (XTENSA && !CPU_LITTLE_ENDIAN)))
253+ depends on VIRT_TO_BUS
252254 help
253255 This enables HiSax support for the Netspider U interface ISDN card
254256 from Traverse Technologies.
drivers/md/dm-bufio.c+2−0
@@ -1025,6 +1025,8 @@ void dm_bufio_prefetch(struct dm_bufio_client *c, · 1024 unmodified lines
10251025 {
10261026 struct blk_plug plug;
10271027
1028+ BUG_ON(dm_bufio_in_request());
1029+
10281030 blk_start_plug(&plug);
10291031 dm_bufio_lock(c);
10301032
drivers/md/dm-cache-metadata.c+51−13
@@ -83,6 +83,8 @@ struct cache_disk_superblock { · 82 unmodified lines
8383 __le32 read_misses;
8484 __le32 write_hits;
8585 __le32 write_misses;
86+
87+ __le32 policy_version[CACHE_POLICY_VERSION_SIZE];
8688 } __packed;
8789
8890 struct dm_cache_metadata {
@@ -109,6 +111,7 @@ struct dm_cache_metadata { · 20 unmodified lines
109111 bool clean_when_opened:1;
110112
111113 char policy_name[CACHE_POLICY_NAME_SIZE];
114+ unsigned policy_version[CACHE_POLICY_VERSION_SIZE];
112115 size_t policy_hint_size;
113116 struct dm_cache_statistics stats;
114117 };
@@ -268,7 +271,8 @@ static int __write_initial_superblock(struct dm_cache_metadata *cmd) · 153 unmodified lines
268271 memset(disk_super->uuid, 0, sizeof(disk_super->uuid));
269272 disk_super->magic = cpu_to_le64(CACHE_SUPERBLOCK_MAGIC);
270273 disk_super->version = cpu_to_le32(CACHE_VERSION);
271− memset(disk_super->policy_name, 0, CACHE_POLICY_NAME_SIZE);
274+ memset(disk_super->policy_name, 0, sizeof(disk_super->policy_name));
275+ memset(disk_super->policy_version, 0, sizeof(disk_super->policy_version));
272276 disk_super->policy_hint_size = 0;
273277
274278 r = dm_sm_copy_root(cmd->metadata_sm, &disk_super->metadata_space_map_root,
@@ -284,7 +288,6 @@ static int __write_initial_superblock(struct dm_cache_metadata *cmd) · 9 unmodified lines
284288 disk_super->metadata_block_size = cpu_to_le32(DM_CACHE_METADATA_BLOCK_SIZE >> SECTOR_SHIFT);
285289 disk_super->data_block_size = cpu_to_le32(cmd->data_block_size);
286290 disk_super->cache_blocks = cpu_to_le32(0);
287− memset(disk_super->policy_name, 0, sizeof(disk_super->policy_name));
288291
289292 disk_super->read_hits = cpu_to_le32(0);
290293 disk_super->read_misses = cpu_to_le32(0);
@@ -478,6 +481,9 @@ static void read_superblock_fields(struct dm_cache_metadata *cmd, · 187 unmodified lines
478481 cmd->data_block_size = le32_to_cpu(disk_super->data_block_size);
479482 cmd->cache_blocks = to_cblock(le32_to_cpu(disk_super->cache_blocks));
480483 strncpy(cmd->policy_name, disk_super->policy_name, sizeof(cmd->policy_name));
484+ cmd->policy_version[0] = le32_to_cpu(disk_super->policy_version[0]);
485+ cmd->policy_version[1] = le32_to_cpu(disk_super->policy_version[1]);
486+ cmd->policy_version[2] = le32_to_cpu(disk_super->policy_version[2]);
481487 cmd->policy_hint_size = le32_to_cpu(disk_super->policy_hint_size);
482488
483489 cmd->stats.read_hits = le32_to_cpu(disk_super->read_hits);
@@ -572,6 +578,9 @@ static int __commit_transaction(struct dm_cache_metadata *cmd, · 88 unmodified lines
572578 disk_super->discard_nr_blocks = cpu_to_le64(from_dblock(cmd->discard_nr_blocks));
573579 disk_super->cache_blocks = cpu_to_le32(from_cblock(cmd->cache_blocks));
574580 strncpy(disk_super->policy_name, cmd->policy_name, sizeof(disk_super->policy_name));
581+ disk_super->policy_version[0] = cpu_to_le32(cmd->policy_version[0]);
582+ disk_super->policy_version[1] = cpu_to_le32(cmd->policy_version[1]);
583+ disk_super->policy_version[2] = cpu_to_le32(cmd->policy_version[2]);
575584
576585 disk_super->read_hits = cpu_to_le32(cmd->stats.read_hits);
577586 disk_super->read_misses = cpu_to_le32(cmd->stats.read_misses);
@@ -854,18 +863,43 @@ struct thunk { · 276 unmodified lines
854863 bool hints_valid;
855864 };
856865
866+static bool policy_unchanged(struct dm_cache_metadata *cmd,
867+ struct dm_cache_policy *policy)
868+{
869+ const char *policy_name = dm_cache_policy_get_name(policy);
870+ const unsigned *policy_version = dm_cache_policy_get_version(policy);
871+ size_t policy_hint_size = dm_cache_policy_get_hint_size(policy);
872+
873+ /*
874+ * Ensure policy names match.
875+ */
876+ if (strncmp(cmd->policy_name, policy_name, sizeof(cmd->policy_name)))
877+ return false;
878+
879+ /*
880+ * Ensure policy major versions match.
881+ */
882+ if (cmd->policy_version[0] != policy_version[0])
883+ return false;
884+
885+ /*
886+ * Ensure policy hint sizes match.
887+ */
888+ if (cmd->policy_hint_size != policy_hint_size)
889+ return false;
890+
891+ return true;
892+}
893+
857894 static bool hints_array_initialized(struct dm_cache_metadata *cmd)
858895 {
859896 return cmd->hint_root && cmd->policy_hint_size;
860897 }
861898
862899 static bool hints_array_available(struct dm_cache_metadata *cmd,
863− const char *policy_name)
900+ struct dm_cache_policy *policy)
864901 {
865− bool policy_names_match = !strncmp(cmd->policy_name, policy_name,
866− sizeof(cmd->policy_name));
867−
868− return cmd->clean_when_opened && policy_names_match &&
902+ return cmd->clean_when_opened && policy_unchanged(cmd, policy) &&
869903 hints_array_initialized(cmd);
870904 }
871905
@@ -899,7 +933,8 @@ static int __load_mapping(void *context, uint64_t cblock, void *leaf) · 27 unmodified lines
899933 return r;
900934 }
901935
902−static int __load_mappings(struct dm_cache_metadata *cmd, const char *policy_name,
936+static int __load_mappings(struct dm_cache_metadata *cmd,
937+ struct dm_cache_policy *policy,
903938 load_mapping_fn fn, void *context)
904939 {
905940 struct thunk thunk;
@@ -909,18 +944,19 @@ static int __load_mappings(struct dm_cache_metadata *cmd, const char *policy_nam · 3 unmodified lines
909944
910945 thunk.cmd = cmd;
911946 thunk.respect_dirty_flags = cmd->clean_when_opened;
912− thunk.hints_valid = hints_array_available(cmd, policy_name);
947+ thunk.hints_valid = hints_array_available(cmd, policy);
913948
914949 return dm_array_walk(&cmd->info, cmd->root, __load_mapping, &thunk);
915950 }
916951
917−int dm_cache_load_mappings(struct dm_cache_metadata *cmd, const char *policy_name,
952+int dm_cache_load_mappings(struct dm_cache_metadata *cmd,
953+ struct dm_cache_policy *policy,
918954 load_mapping_fn fn, void *context)
919955 {
920956 int r;
921957
922958 down_read(&cmd->root_lock);
923− r = __load_mappings(cmd, policy_name, fn, context);
959+ r = __load_mappings(cmd, policy, fn, context);
924960 up_read(&cmd->root_lock);
925961
926962 return r;
@@ -979,7 +1015,7 @@ static int __dirty(struct dm_cache_metadata *cmd, dm_cblock_t cblock, bool dirty · 52 unmodified lines
9791015 /* nothing to be done */
9801016 return 0;
9811017
982− value = pack_value(oblock, flags | (dirty ? M_DIRTY : 0));
1018+ value = pack_value(oblock, (flags & ~M_DIRTY) | (dirty ? M_DIRTY : 0));
9831019 __dm_bless_for_disk(&value);
9841020
9851021 r = dm_array_set_value(&cmd->info, cmd->root, from_cblock(cblock),
@@ -1070,13 +1106,15 @@ static int begin_hints(struct dm_cache_metadata *cmd, struct dm_cache_policy *po · 84 unmodified lines
10701106 __le32 value;
10711107 size_t hint_size;
10721108 const char *policy_name = dm_cache_policy_get_name(policy);
1109+ const unsigned *policy_version = dm_cache_policy_get_version(policy);
10731110
10741111 if (!policy_name[0] ||
10751112 (strlen(policy_name) > sizeof(cmd->policy_name) - 1))
10761113 return -EINVAL;
10771114
1078− if (strcmp(cmd->policy_name, policy_name)) {
1115+ if (!policy_unchanged(cmd, policy)) {
10791116 strncpy(cmd->policy_name, policy_name, sizeof(cmd->policy_name));
1117+ memcpy(cmd->policy_version, policy_version, sizeof(cmd->policy_version));
10801118
10811119 hint_size = dm_cache_policy_get_hint_size(policy);
10821120 if (!hint_size)
drivers/md/dm-cache-metadata.h+1−1
@@ -89,7 +89,7 @@ typedef int (*load_mapping_fn)(void *context, dm_oblock_t oblock, · 88 unmodified lines
8989 dm_cblock_t cblock, bool dirty,
9090 uint32_t hint, bool hint_valid);
9191 int dm_cache_load_mappings(struct dm_cache_metadata *cmd,
92− const char *policy_name,
92+ struct dm_cache_policy *policy,
9393 load_mapping_fn fn,
9494 void *context);
9595
drivers/md/dm-cache-policy-cleaner.c+5−2
@@ -17,7 +17,6 @@ · 16 unmodified lines
1717 /*----------------------------------------------------------------*/
1818
1919 #define DM_MSG_PREFIX "cache cleaner"
20−#define CLEANER_VERSION "1.0.0"
2120
2221 /* Cache entry struct. */
2322 struct wb_cache_entry {
@@ -434,6 +433,7 @@ static struct dm_cache_policy *wb_create(dm_cblock_t cache_size, · 410 unmodified lines
434433
435434 static struct dm_cache_policy_type wb_policy_type = {
436435 .name = "cleaner",
436+ .version = {1, 0, 0},
437437 .hint_size = 0,
438438 .owner = THIS_MODULE,
439439 .create = wb_create
@@ -446,7 +446,10 @@ static int __init wb_init(void) · 6 unmodified lines
446446 if (r < 0)
447447 DMERR("register failed %d", r);
448448 else
449− DMINFO("version " CLEANER_VERSION " loaded");
449+ DMINFO("version %u.%u.%u loaded",
450+ wb_policy_type.version[0],
451+ wb_policy_type.version[1],
452+ wb_policy_type.version[2]);
450453
451454 return r;
452455 }
drivers/md/dm-cache-policy-internal.h+2−0
@@ -117,6 +117,8 @@ void dm_cache_policy_destroy(struct dm_cache_policy *p); · 116 unmodified lines
117117 */
118118 const char *dm_cache_policy_get_name(struct dm_cache_policy *p);
119119
120+const unsigned *dm_cache_policy_get_version(struct dm_cache_policy *p);
121+
120122 size_t dm_cache_policy_get_hint_size(struct dm_cache_policy *p);
121123
122124 /*----------------------------------------------------------------*/
drivers/md/dm-cache-policy-mq.c+6−2
@@ -14,7 +14,6 @@ · 13 unmodified lines
1414 #include <linux/vmalloc.h>
1515
1616 #define DM_MSG_PREFIX "cache-policy-mq"
17−#define MQ_VERSION "1.0.0"
1817
1918 static struct kmem_cache *mq_entry_cache;
2019
@@ -1133,6 +1132,7 @@ bad_cache_alloc: · 1112 unmodified lines
11331132
11341133 static struct dm_cache_policy_type mq_policy_type = {
11351134 .name = "mq",
1135+ .version = {1, 0, 0},
11361136 .hint_size = 4,
11371137 .owner = THIS_MODULE,
11381138 .create = mq_create
@@ -1140,6 +1140,7 @@ static struct dm_cache_policy_type mq_policy_type = { · 1 unmodified line
11401140
11411141 static struct dm_cache_policy_type default_policy_type = {
11421142 .name = "default",
1143+ .version = {1, 0, 0},
11431144 .hint_size = 4,
11441145 .owner = THIS_MODULE,
11451146 .create = mq_create
@@ -1164,7 +1165,10 @@ static int __init mq_init(void) · 18 unmodified lines
11641165
11651166 r = dm_cache_policy_register(&default_policy_type);
11661167 if (!r) {
1167− DMINFO("version " MQ_VERSION " loaded");
1168+ DMINFO("version %u.%u.%u loaded",
1169+ mq_policy_type.version[0],
1170+ mq_policy_type.version[1],
1171+ mq_policy_type.version[2]);
11681172 return 0;
11691173 }
11701174
drivers/md/dm-cache-policy.c+8−0
@@ -150,6 +150,14 @@ const char *dm_cache_policy_get_name(struct dm_cache_policy *p) · 149 unmodified lines
150150 }
151151 EXPORT_SYMBOL_GPL(dm_cache_policy_get_name);
152152
153+const unsigned *dm_cache_policy_get_version(struct dm_cache_policy *p)
154+{
155+ struct dm_cache_policy_type *t = p->private;
156+
157+ return t->version;
158+}
159+EXPORT_SYMBOL_GPL(dm_cache_policy_get_version);
160+
153161 size_t dm_cache_policy_get_hint_size(struct dm_cache_policy *p)
154162 {
155163 struct dm_cache_policy_type *t = p->private;
drivers/md/dm-cache-policy.h+2−0
@@ -196,6 +196,7 @@ struct dm_cache_policy { · 195 unmodified lines
196196 * We maintain a little register of the different policy types.
197197 */
198198 #define CACHE_POLICY_NAME_SIZE 16
199+#define CACHE_POLICY_VERSION_SIZE 3
199200
200201 struct dm_cache_policy_type {
201202 /* For use by the register code only. */
@@ -206,6 +207,7 @@ struct dm_cache_policy_type { · 4 unmodified lines
206207 * what gets passed on the target line to select your policy.
207208 */
208209 char name[CACHE_POLICY_NAME_SIZE];
210+ unsigned version[CACHE_POLICY_VERSION_SIZE];
209211
210212 /*
211213 * Policies may store a hint for each each cache block.
drivers/md/dm-cache-target.c+144−70
@@ -6,6 +6,7 @@ · 5 unmodified lines
66
77 #include "dm.h"
88 #include "dm-bio-prison.h"
9+#include "dm-bio-record.h"
910 #include "dm-cache-metadata.h"
1011
1112 #include <linux/dm-io.h>
@@ -142,6 +143,7 @@ struct cache { · 130 unmodified lines
142143 spinlock_t lock;
143144 struct bio_list deferred_bios;
144145 struct bio_list deferred_flush_bios;
146+ struct bio_list deferred_writethrough_bios;
145147 struct list_head quiesced_migrations;
146148 struct list_head completed_migrations;
147149 struct list_head need_commit_migrations;
@@ -158,7 +160,7 @@ struct cache { · 10 unmodified lines
158160 /*
159161 * origin_blocks entries, discarded if set.
160162 */
161− sector_t discard_block_size; /* a power of 2 times sectors per block */
163+ uint32_t discard_block_size; /* a power of 2 times sectors per block */
162164 dm_dblock_t discard_nr_blocks;
163165 unsigned long *discard_bitset;
164166
@@ -199,6 +201,16 @@ struct per_bio_data { · 34 unmodified lines
199201 bool tick:1;
200202 unsigned req_nr:2;
201203 struct dm_deferred_entry *all_io_entry;
204+
205+ /*
206+ * writethrough fields. These MUST remain at the end of this
207+ * structure and the 'cache' member must be the first as it
208+ * is used to determine the offsetof the writethrough fields.
209+ */
210+ struct cache *cache;
211+ dm_cblock_t cblock;
212+ bio_end_io_t *saved_bi_end_io;
213+ struct dm_bio_details bio_details;
202214 };
203215
204216 struct dm_cache_migration {
@@ -412,17 +424,24 @@ static bool block_size_is_power_of_two(struct cache *cache) · 207 unmodified lines
412424 return cache->sectors_per_block_shift >= 0;
413425 }
414426
427+static dm_block_t block_div(dm_block_t b, uint32_t n)
428+{
429+ do_div(b, n);
430+
431+ return b;
432+}
433+
415434 static dm_dblock_t oblock_to_dblock(struct cache *cache, dm_oblock_t oblock)
416435 {
417− sector_t discard_blocks = cache->discard_block_size;
436+ uint32_t discard_blocks = cache->discard_block_size;
418437 dm_block_t b = from_oblock(oblock);
419438
420439 if (!block_size_is_power_of_two(cache))
421− (void) sector_div(discard_blocks, cache->sectors_per_block);
440+ discard_blocks = discard_blocks / cache->sectors_per_block;
422441 else
423442 discard_blocks >>= cache->sectors_per_block_shift;
424443
425− (void) sector_div(b, discard_blocks);
444+ b = block_div(b, discard_blocks);
426445
427446 return to_dblock(b);
428447 }
@@ -500,16 +519,28 @@ static void save_stats(struct cache *cache) · 71 unmodified lines
500519 /*----------------------------------------------------------------
501520 * Per bio data
502521 *--------------------------------------------------------------*/
503−static struct per_bio_data *get_per_bio_data(struct bio *bio)
522+
523+/*
524+ * If using writeback, leave out struct per_bio_data's writethrough fields.
525+ */
526+#define PB_DATA_SIZE_WB (offsetof(struct per_bio_data, cache))
527+#define PB_DATA_SIZE_WT (sizeof(struct per_bio_data))
528+
529+static size_t get_per_bio_data_size(struct cache *cache)
504530 {
505− struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data));
531+ return cache->features.write_through ? PB_DATA_SIZE_WT : PB_DATA_SIZE_WB;
532+}
533+
534+static struct per_bio_data *get_per_bio_data(struct bio *bio, size_t data_size)
535+{
536+ struct per_bio_data *pb = dm_per_bio_data(bio, data_size);
506537 BUG_ON(!pb);
507538 return pb;
508539 }
509540
510−static struct per_bio_data *init_per_bio_data(struct bio *bio)
541+static struct per_bio_data *init_per_bio_data(struct bio *bio, size_t data_size)
511542 {
512− struct per_bio_data *pb = get_per_bio_data(bio);
543+ struct per_bio_data *pb = get_per_bio_data(bio, data_size);
513544
514545 pb->tick = false;
515546 pb->req_nr = dm_bio_get_target_bio_nr(bio);
@@ -543,7 +574,8 @@ static void remap_to_cache(struct cache *cache, struct bio *bio, · 27 unmodified lines
543574 static void check_if_tick_bio_needed(struct cache *cache, struct bio *bio)
544575 {
545576 unsigned long flags;
546− struct per_bio_data *pb = get_per_bio_data(bio);
577+ size_t pb_data_size = get_per_bio_data_size(cache);
578+ struct per_bio_data *pb = get_per_bio_data(bio, pb_data_size);
547579
548580 spin_lock_irqsave(&cache->lock, flags);
549581 if (cache->need_tick_bio &&
@@ -609,6 +641,58 @@ static void issue(struct cache *cache, struct bio *bio) · 59 unmodified lines
609641 spin_unlock_irqrestore(&cache->lock, flags);
610642 }
611643
644+static void defer_writethrough_bio(struct cache *cache, struct bio *bio)
645+{
646+ unsigned long flags;
647+
648+ spin_lock_irqsave(&cache->lock, flags);
649+ bio_list_add(&cache->deferred_writethrough_bios, bio);
650+ spin_unlock_irqrestore(&cache->lock, flags);
651+
652+ wake_worker(cache);
653+}
654+
655+static void writethrough_endio(struct bio *bio, int err)
656+{
657+ struct per_bio_data *pb = get_per_bio_data(bio, PB_DATA_SIZE_WT);
658+ bio->bi_end_io = pb->saved_bi_end_io;
659+
660+ if (err) {
661+ bio_endio(bio, err);
662+ return;
663+ }
664+
665+ dm_bio_restore(&pb->bio_details, bio);
666+ remap_to_cache(pb->cache, bio, pb->cblock);
667+
668+ /*
669+ * We can't issue this bio directly, since we're in interrupt
670+ * context. So it get's put on a bio list for processing by the
671+ * worker thread.
672+ */
673+ defer_writethrough_bio(pb->cache, bio);
674+}
675+
676+/*
677+ * When running in writethrough mode we need to send writes to clean blocks
678+ * to both the cache and origin devices. In future we'd like to clone the
679+ * bio and send them in parallel, but for now we're doing them in
680+ * series as this is easier.
681+ */
682+static void remap_to_origin_then_cache(struct cache *cache, struct bio *bio,
683+ dm_oblock_t oblock, dm_cblock_t cblock)
684+{
685+ struct per_bio_data *pb = get_per_bio_data(bio, PB_DATA_SIZE_WT);
686+
687+ pb->cache = cache;
688+ pb->cblock = cblock;
689+ pb->saved_bi_end_io = bio->bi_end_io;
690+ dm_bio_record(&pb->bio_details, bio);
691+ bio->bi_end_io = writethrough_endio;
692+
693+ remap_to_origin_clear_discard(pb->cache, bio, oblock);
694+}
695+
612696 /*----------------------------------------------------------------
613697 * Migration processing
614698 *
@@ -972,7 +1056,8 @@ static void defer_bio(struct cache *cache, struct bio *bio) · 357 unmodified lines
9721056
9731057 static void process_flush_bio(struct cache *cache, struct bio *bio)
9741058 {
975− struct per_bio_data *pb = get_per_bio_data(bio);
1059+ size_t pb_data_size = get_per_bio_data_size(cache);
1060+ struct per_bio_data *pb = get_per_bio_data(bio, pb_data_size);
9761061
9771062 BUG_ON(bio->bi_size);
9781063 if (!pb->req_nr)
@@ -1002,7 +1087,7 @@ static void process_discard_bio(struct cache *cache, struct bio *bio) · 23 unmodified lines
10021087 dm_block_t end_block = bio->bi_sector + bio_sectors(bio);
10031088 dm_block_t b;
10041089
1005− (void) sector_div(end_block, cache->discard_block_size);
1090+ end_block = block_div(end_block, cache->discard_block_size);
10061091
10071092 for (b = start_block; b < end_block; b++)
10081093 set_discard(cache, to_dblock(b));
@@ -1044,7 +1129,8 @@ static void process_bio(struct cache *cache, struct prealloc *structs, · 35 unmodified lines
10441129 dm_oblock_t block = get_bio_block(cache, bio);
10451130 struct dm_bio_prison_cell *cell_prealloc, *old_ocell, *new_ocell;
10461131 struct policy_result lookup_result;
1047− struct per_bio_data *pb = get_per_bio_data(bio);
1132+ size_t pb_data_size = get_per_bio_data_size(cache);
1133+ struct per_bio_data *pb = get_per_bio_data(bio, pb_data_size);
10481134 bool discarded_block = is_discarded_oblock(cache, block);
10491135 bool can_migrate = discarded_block || spare_migration_bandwidth(cache);
10501136
@@ -1070,14 +1156,9 @@ static void process_bio(struct cache *cache, struct prealloc *structs, · 19 unmodified lines
10701156 inc_hit_counter(cache, bio);
10711157 pb->all_io_entry = dm_deferred_entry_inc(cache->all_io_ds);
10721158
1073− if (is_writethrough_io(cache, bio, lookup_result.cblock)) {
1074− /*
1075− * No need to mark anything dirty in write through mode.
1076− */
1077− pb->req_nr == 0 ?
1078− remap_to_cache(cache, bio, lookup_result.cblock) :
1079− remap_to_origin_clear_discard(cache, bio, block);
1080− } else
1159+ if (is_writethrough_io(cache, bio, lookup_result.cblock))
1160+ remap_to_origin_then_cache(cache, bio, block, lookup_result.cblock);
1161+ else
10811162 remap_to_cache_dirty(cache, bio, block, lookup_result.cblock);
10821163
10831164 issue(cache, bio);
@@ -1086,17 +1167,8 @@ static void process_bio(struct cache *cache, struct prealloc *structs, · 2 unmodified lines
10861167 case POLICY_MISS:
10871168 inc_miss_counter(cache, bio);
10881169 pb->all_io_entry = dm_deferred_entry_inc(cache->all_io_ds);
1089−
1090− if (pb->req_nr != 0) {
1091− /*
1092− * This is a duplicate writethrough io that is no
1093− * longer needed because the block has been demoted.
1094− */
1095− bio_endio(bio, 0);
1096− } else {
1097− remap_to_origin_clear_discard(cache, bio, block);
1098− issue(cache, bio);
1099− }
1170+ remap_to_origin_clear_discard(cache, bio, block);
1171+ issue(cache, bio);
11001172 break;
11011173
11021174 case POLICY_NEW:
@@ -1217,6 +1289,23 @@ static void process_deferred_flush_bios(struct cache *cache, bool submit_bios) · 114 unmodified lines
12171289 submit_bios ? generic_make_request(bio) : bio_io_error(bio);
12181290 }
12191291
1292+static void process_deferred_writethrough_bios(struct cache *cache)
1293+{
1294+ unsigned long flags;
1295+ struct bio_list bios;
1296+ struct bio *bio;
1297+
1298+ bio_list_init(&bios);
1299+
1300+ spin_lock_irqsave(&cache->lock, flags);
1301+ bio_list_merge(&bios, &cache->deferred_writethrough_bios);
1302+ bio_list_init(&cache->deferred_writethrough_bios);
1303+ spin_unlock_irqrestore(&cache->lock, flags);
1304+
1305+ while ((bio = bio_list_pop(&bios)))
1306+ generic_make_request(bio);
1307+}
1308+
12201309 static void writeback_some_dirty_blocks(struct cache *cache)
12211310 {
12221311 int r = 0;
@@ -1313,6 +1402,7 @@ static int more_work(struct cache *cache) · 90 unmodified lines
13131402 else
13141403 return !bio_list_empty(&cache->deferred_bios) ||
13151404 !bio_list_empty(&cache->deferred_flush_bios) ||
1405+ !bio_list_empty(&cache->deferred_writethrough_bios) ||
13161406 !list_empty(&cache->quiesced_migrations) ||
13171407 !list_empty(&cache->completed_migrations) ||
13181408 !list_empty(&cache->need_commit_migrations);
@@ -1331,6 +1421,8 @@ static void do_worker(struct work_struct *ws) · 12 unmodified lines
13311421
13321422 writeback_some_dirty_blocks(cache);
13331423
1424+ process_deferred_writethrough_bios(cache);
1425+
13341426 if (commit_if_needed(cache)) {
13351427 process_deferred_flush_bios(cache, false);
13361428
@@ -1756,8 +1848,11 @@ static int create_cache_policy(struct cache *cache, struct cache_args *ca, · 419 unmodified lines
17561848 }
17571849
17581850 r = set_config_values(cache->policy, ca->policy_argc, ca->policy_argv);
1759− if (r)
1851+ if (r) {
1852+ *error = "Error setting cache policy's config values";
17601853 dm_cache_policy_destroy(cache->policy);
1854+ cache->policy = NULL;
1855+ }
17611856
17621857 return r;
17631858 }
@@ -1793,8 +1888,6 @@ static sector_t calculate_discard_block_size(sector_t cache_block_size, · 29 unmodified lines
17931888
17941889 #define DEFAULT_MIGRATION_THRESHOLD (2048 * 100)
17951890
1796−static unsigned cache_num_write_bios(struct dm_target *ti, struct bio *bio);
1797−
17981891 static int cache_create(struct cache_args *ca, struct cache **result)
17991892 {
18001893 int r = 0;
@@ -1811,7 +1904,6 @@ static int cache_create(struct cache_args *ca, struct cache **result) · 10 unmodified lines
18111904
18121905 cache->ti = ca->ti;
18131906 ti->private = cache;
1814− ti->per_bio_data_size = sizeof(struct per_bio_data);
18151907 ti->num_flush_bios = 2;
18161908 ti->flush_supported = true;
18171909
@@ -1820,9 +1912,7 @@ static int cache_create(struct cache_args *ca, struct cache **result) · 2 unmodified lines
18201912 ti->discard_zeroes_data_unsupported = true;
18211913
18221914 memcpy(&cache->features, &ca->features, sizeof(cache->features));
1823−
1824− if (cache->features.write_through)
1825− ti->num_write_bios = cache_num_write_bios;
1915+ ti->per_bio_data_size = get_per_bio_data_size(cache);
18261916
18271917 cache->callbacks.congested_fn = cache_is_congested;
18281918 dm_table_add_target_callbacks(ti->table, &cache->callbacks);
@@ -1835,7 +1925,7 @@ static int cache_create(struct cache_args *ca, struct cache **result) · 6 unmodified lines
18351925
18361926 /* FIXME: factor out this whole section */
18371927 origin_blocks = cache->origin_sectors = ca->origin_sectors;
1838− (void) sector_div(origin_blocks, ca->block_size);
1928+ origin_blocks = block_div(origin_blocks, ca->block_size);
18391929 cache->origin_blocks = to_oblock(origin_blocks);
18401930
18411931 cache->sectors_per_block = ca->block_size;
@@ -1848,7 +1938,7 @@ static int cache_create(struct cache_args *ca, struct cache **result) · 6 unmodified lines
18481938 dm_block_t cache_size = ca->cache_sectors;
18491939
18501940 cache->sectors_per_block_shift = -1;
1851− (void) sector_div(cache_size, ca->block_size);
1941+ cache_size = block_div(cache_size, ca->block_size);
18521942 cache->cache_size = to_cblock(cache_size);
18531943 } else {
18541944 cache->sectors_per_block_shift = __ffs(ca->block_size);
@@ -1873,6 +1963,7 @@ static int cache_create(struct cache_args *ca, struct cache **result) · 18 unmodified lines
18731963 spin_lock_init(&cache->lock);
18741964 bio_list_init(&cache->deferred_bios);
18751965 bio_list_init(&cache->deferred_flush_bios);
1966+ bio_list_init(&cache->deferred_writethrough_bios);
18761967 INIT_LIST_HEAD(&cache->quiesced_migrations);
18771968 INIT_LIST_HEAD(&cache->completed_migrations);
18781969 INIT_LIST_HEAD(&cache->need_commit_migrations);
@@ -2002,6 +2093,8 @@ static int cache_ctr(struct dm_target *ti, unsigned argc, char **argv) · 123 unmodified lines
20022093 goto out;
20032094
20042095 r = cache_create(ca, &cache);
2096+ if (r)
2097+ goto out;
20052098
20062099 r = copy_ctr_args(cache, argc - 3, (const char **)argv + 3);
20072100 if (r) {
@@ -2016,26 +2109,13 @@ out: · 8 unmodified lines
20162109 return r;
20172110 }
20182111
2019−static unsigned cache_num_write_bios(struct dm_target *ti, struct bio *bio)
2020−{
2021− int r;
2022− struct cache *cache = ti->private;
2023− dm_oblock_t block = get_bio_block(cache, bio);
2024− dm_cblock_t cblock;
2025−
2026− r = policy_lookup(cache->policy, block, &cblock);
2027− if (r < 0)
2028− return 2; /* assume the worst */
2029−
2030− return (!r && !is_dirty(cache, cblock)) ? 2 : 1;
2031−}
2032−
20332112 static int cache_map(struct dm_target *ti, struct bio *bio)
20342113 {
20352114 struct cache *cache = ti->private;
20362115
20372116 int r;
20382117 dm_oblock_t block = get_bio_block(cache, bio);
2118+ size_t pb_data_size = get_per_bio_data_size(cache);
20392119 bool can_migrate = false;
20402120 bool discarded_block;
20412121 struct dm_bio_prison_cell *cell;
@@ -2052,7 +2132,7 @@ static int cache_map(struct dm_target *ti, struct bio *bio) · 10 unmodified lines
20522132 return DM_MAPIO_REMAPPED;
20532133 }
20542134
2055− pb = init_per_bio_data(bio);
2135+ pb = init_per_bio_data(bio, pb_data_size);
20562136
20572137 if (bio->bi_rw & (REQ_FLUSH | REQ_FUA | REQ_DISCARD)) {
20582138 defer_bio(cache, bio);
@@ -2097,18 +2177,12 @@ static int cache_map(struct dm_target *ti, struct bio *bio) · 38 unmodified lines
20972177 inc_hit_counter(cache, bio);
20982178 pb->all_io_entry = dm_deferred_entry_inc(cache->all_io_ds);
20992179
2100− if (is_writethrough_io(cache, bio, lookup_result.cblock)) {
2101− /*
2102− * No need to mark anything dirty in write through mode.
2103− */
2104− pb->req_nr == 0 ?
2105− remap_to_cache(cache, bio, lookup_result.cblock) :
2106− remap_to_origin_clear_discard(cache, bio, block);
2107− cell_defer(cache, cell, false);
2108− } else {
2180+ if (is_writethrough_io(cache, bio, lookup_result.cblock))
2181+ remap_to_origin_then_cache(cache, bio, block, lookup_result.cblock);
2182+ else
21092183 remap_to_cache_dirty(cache, bio, block, lookup_result.cblock);
2110− cell_defer(cache, cell, false);
2111− }
2184+
2185+ cell_defer(cache, cell, false);
21122186 break;
21132187
21142188 case POLICY_MISS:
@@ -2143,7 +2217,8 @@ static int cache_end_io(struct dm_target *ti, struct bio *bio, int error) · 28 unmodified lines
21432217 {
21442218 struct cache *cache = ti->private;
21452219 unsigned long flags;
2146− struct per_bio_data *pb = get_per_bio_data(bio);
2220+ size_t pb_data_size = get_per_bio_data_size(cache);
2221+ struct per_bio_data *pb = get_per_bio_data(bio, pb_data_size);
21472222
21482223 if (pb->tick) {
21492224 policy_tick(cache->policy);
@@ -2319,8 +2394,7 @@ static int cache_preresume(struct dm_target *ti) · 169 unmodified lines
23192394 }
23202395
23212396 if (!cache->loaded_mappings) {
2322− r = dm_cache_load_mappings(cache->cmd,
2323− dm_cache_policy_get_name(cache->policy),
2397+ r = dm_cache_load_mappings(cache->cmd, cache->policy,
23242398 load_mapping, cache);
23252399 if (r) {
23262400 DMERR("could not load cache mappings");
@@ -2535,7 +2609,7 @@ static void cache_io_hints(struct dm_target *ti, struct queue_limits *limits) · 208 unmodified lines
25352609
25362610 static struct target_type cache_target = {
25372611 .name = "cache",
2538− .version = {1, 0, 0},
2612+ .version = {1, 1, 0},
25392613 .module = THIS_MODULE,
25402614 .ctr = cache_ctr,
25412615 .dtr = cache_dtr,
drivers/md/dm-thin.c+8−3
@@ -1577,6 +1577,11 @@ static bool data_dev_supports_discard(struct pool_c *pt) · 1576 unmodified lines
15771577 return q && blk_queue_discard(q);
15781578 }
15791579
1580+static bool is_factor(sector_t block_size, uint32_t n)
1581+{
1582+ return !sector_div(block_size, n);
1583+}
1584+
15801585 /*
15811586 * If discard_passdown was enabled verify that the data device
15821587 * supports discards. Disable discard_passdown if not.
@@ -1602,7 +1607,7 @@ static void disable_passdown_if_not_supported(struct pool_c *pt) · 19 unmodified lines
16021607 else if (data_limits->discard_granularity > block_size)
16031608 reason = "discard granularity larger than a block";
16041609
1605− else if (block_size & (data_limits->discard_granularity - 1))
1610+ else if (!is_factor(block_size, data_limits->discard_granularity))
16061611 reason = "discard granularity not a factor of block size";
16071612
16081613 if (reason) {
@@ -2544,7 +2549,7 @@ static struct target_type pool_target = { · 935 unmodified lines
25442549 .name = "thin-pool",
25452550 .features = DM_TARGET_SINGLETON | DM_TARGET_ALWAYS_WRITEABLE |
25462551 DM_TARGET_IMMUTABLE,
2547− .version = {1, 6, 1},
2552+ .version = {1, 7, 0},
25482553 .module = THIS_MODULE,
25492554 .ctr = pool_ctr,
25502555 .dtr = pool_dtr,
@@ -2831,7 +2836,7 @@ static int thin_iterate_devices(struct dm_target *ti, · 280 unmodified lines
28312836
28322837 static struct target_type thin_target = {
28332838 .name = "thin",
2834− .version = {1, 7, 1},
2839+ .version = {1, 8, 0},
28352840 .module = THIS_MODULE,
28362841 .ctr = thin_ctr,
28372842 .dtr = thin_dtr,
drivers/md/dm-verity.c+34−5
@@ -93,6 +93,13 @@ struct dm_verity_io { · 92 unmodified lines
9393 */
9494 };
9595
96+struct dm_verity_prefetch_work {
97+ struct work_struct work;
98+ struct dm_verity *v;
99+ sector_t block;
100+ unsigned n_blocks;
101+};
102+
96103 static struct shash_desc *io_hash_desc(struct dm_verity *v, struct dm_verity_io *io)
97104 {
98105 return (struct shash_desc *)(io + 1);
@@ -424,15 +431,18 @@ static void verity_end_io(struct bio *bio, int error) · 325 unmodified lines
424431 * The root buffer is not prefetched, it is assumed that it will be cached
425432 * all the time.
426433 */
427−static void verity_prefetch_io(struct dm_verity *v, struct dm_verity_io *io)
434+static void verity_prefetch_io(struct work_struct *work)
428435 {
436+ struct dm_verity_prefetch_work *pw =
437+ container_of(work, struct dm_verity_prefetch_work, work);
438+ struct dm_verity *v = pw->v;
429439 int i;
430440
431441 for (i = v->levels - 2; i >= 0; i--) {
432442 sector_t hash_block_start;
433443 sector_t hash_block_end;
434− verity_hash_at_level(v, io->block, i, &hash_block_start, NULL);
435− verity_hash_at_level(v, io->block + io->n_blocks - 1, i, &hash_block_end, NULL);
444+ verity_hash_at_level(v, pw->block, i, &hash_block_start, NULL);
445+ verity_hash_at_level(v, pw->block + pw->n_blocks - 1, i, &hash_block_end, NULL);
436446 if (!i) {
437447 unsigned cluster = ACCESS_ONCE(dm_verity_prefetch_cluster);
438448
@@ -452,6 +462,25 @@ no_prefetch_cluster: · 13 unmodified lines
452462 dm_bufio_prefetch(v->bufio, hash_block_start,
453463 hash_block_end - hash_block_start + 1);
454464 }
465+
466+ kfree(pw);
467+}
468+
469+static void verity_submit_prefetch(struct dm_verity *v, struct dm_verity_io *io)
470+{
471+ struct dm_verity_prefetch_work *pw;
472+
473+ pw = kmalloc(sizeof(struct dm_verity_prefetch_work),
474+ GFP_NOIO | __GFP_NORETRY | __GFP_NOMEMALLOC | __GFP_NOWARN);
475+
476+ if (!pw)
477+ return;
478+
479+ INIT_WORK(&pw->work, verity_prefetch_io);
480+ pw->v = v;
481+ pw->block = io->block;
482+ pw->n_blocks = io->n_blocks;
483+ queue_work(v->verify_wq, &pw->work);
455484 }
456485
457486 /*
@@ -498,7 +527,7 @@ static int verity_map(struct dm_target *ti, struct bio *bio) · 40 unmodified lines
498527 memcpy(io->io_vec, bio_iovec(bio),
499528 io->io_vec_size * sizeof(struct bio_vec));
500529
501− verity_prefetch_io(v, io);
530+ verity_submit_prefetch(v, io);
502531
503532 generic_make_request(bio);
504533
@@ -858,7 +887,7 @@ bad: · 353 unmodified lines
858887
859888 static struct target_type verity_target = {
860889 .name = "verity",
861− .version = {1, 1, 1},
890+ .version = {1, 2, 0},
862891 .module = THIS_MODULE,
863892 .ctr = verity_ctr,
864893 .dtr = verity_dtr,
drivers/md/dm.c+1−0
@@ -611,6 +611,7 @@ static void dec_pending(struct dm_io *io, int error) · 610 unmodified lines
611611 queue_io(md, bio);
612612 } else {
613613 /* done with normal IO or empty flush */
614+ trace_block_bio_complete(md->queue, bio, io_error);
614615 bio_endio(bio, io_error);
615616 }
616617 }
drivers/md/md.c+2−4
@@ -7663,10 +7663,8 @@ static int remove_and_add_spares(struct mddev *mddev) · 7662 unmodified lines
76637663 removed++;
76647664 }
76657665 }
7666− if (removed)
7667− sysfs_notify(&mddev->kobj, NULL,
7668− "degraded");
7669−
7666+ if (removed && mddev->kobj.sd)
7667+ sysfs_notify(&mddev->kobj, NULL, "degraded");
76707668
76717669 rdev_for_each(rdev, mddev) {
76727670 if (rdev->raid_disk >= 0 &&
drivers/md/md.h+2−2
@@ -506,7 +506,7 @@ static inline char * mdname (struct mddev * mddev) · 505 unmodified lines
506506 static inline int sysfs_link_rdev(struct mddev *mddev, struct md_rdev *rdev)
507507 {
508508 char nm[20];
509− if (!test_bit(Replacement, &rdev->flags)) {
509+ if (!test_bit(Replacement, &rdev->flags) && mddev->kobj.sd) {
510510 sprintf(nm, "rd%d", rdev->raid_disk);
511511 return sysfs_create_link(&mddev->kobj, &rdev->kobj, nm);
512512 } else
@@ -516,7 +516,7 @@ static inline int sysfs_link_rdev(struct mddev *mddev, struct md_rdev *rdev) · 3 unmodified lines
516516 static inline void sysfs_unlink_rdev(struct mddev *mddev, struct md_rdev *rdev)
517517 {
518518 char nm[20];
519− if (!test_bit(Replacement, &rdev->flags)) {
519+ if (!test_bit(Replacement, &rdev->flags) && mddev->kobj.sd) {
520520 sprintf(nm, "rd%d", rdev->raid_disk);
521521 sysfs_remove_link(&mddev->kobj, nm);
522522 }
drivers/md/persistent-data/dm-btree-remove.c+24−22
@@ -139,15 +139,8 @@ struct child { · 138 unmodified lines
139139 struct btree_node *n;
140140 };
141141
142−static struct dm_btree_value_type le64_type = {
143− .context = NULL,
144− .size = sizeof(__le64),
145− .inc = NULL,
146− .dec = NULL,
147− .equal = NULL
148−};
149−
150−static int init_child(struct dm_btree_info *info, struct btree_node *parent,
142+static int init_child(struct dm_btree_info *info, struct dm_btree_value_type *vt,
143+ struct btree_node *parent,
151144 unsigned index, struct child *result)
152145 {
153146 int r, inc;
@@ -164,7 +157,7 @@ static int init_child(struct dm_btree_info *info, struct btree_node *parent, · 10 unmodified lines
164157 result->n = dm_block_data(result->block);
165158
166159 if (inc)
167− inc_children(info->tm, result->n, &le64_type);
160+ inc_children(info->tm, result->n, vt);
168161
169162 *((__le64 *) value_ptr(parent, index)) =
170163 cpu_to_le64(dm_block_location(result->block));
@@ -236,7 +229,7 @@ static void __rebalance2(struct dm_btree_info *info, struct btree_node *parent, · 65 unmodified lines
236229 }
237230
238231 static int rebalance2(struct shadow_spine *s, struct dm_btree_info *info,
239− unsigned left_index)
232+ struct dm_btree_value_type *vt, unsigned left_index)
240233 {
241234 int r;
242235 struct btree_node *parent;
@@ -244,11 +237,11 @@ static int rebalance2(struct shadow_spine *s, struct dm_btree_info *info, · 1 unmodified line
244237
245238 parent = dm_block_data(shadow_current(s));
246239
247− r = init_child(info, parent, left_index, &left);
240+ r = init_child(info, vt, parent, left_index, &left);
248241 if (r)
249242 return r;
250243
251− r = init_child(info, parent, left_index + 1, &right);
244+ r = init_child(info, vt, parent, left_index + 1, &right);
252245 if (r) {
253246 exit_child(info, &left);
254247 return r;
@@ -368,7 +361,7 @@ static void __rebalance3(struct dm_btree_info *info, struct btree_node *parent, · 113 unmodified lines
368361 }
369362
370363 static int rebalance3(struct shadow_spine *s, struct dm_btree_info *info,
371− unsigned left_index)
364+ struct dm_btree_value_type *vt, unsigned left_index)
372365 {
373366 int r;
374367 struct btree_node *parent = dm_block_data(shadow_current(s));
@@ -377,17 +370,17 @@ static int rebalance3(struct shadow_spine *s, struct dm_btree_info *info, · 2 unmodified lines
377370 /*
378371 * FIXME: fill out an array?
379372 */
380− r = init_child(info, parent, left_index, &left);
373+ r = init_child(info, vt, parent, left_index, &left);
381374 if (r)
382375 return r;
383376
384− r = init_child(info, parent, left_index + 1, &center);
377+ r = init_child(info, vt, parent, left_index + 1, &center);
385378 if (r) {
386379 exit_child(info, &left);
387380 return r;
388381 }
389382
390− r = init_child(info, parent, left_index + 2, &right);
383+ r = init_child(info, vt, parent, left_index + 2, &right);
391384 if (r) {
392385 exit_child(info, &left);
393386 exit_child(info, &center);
@@ -434,7 +427,8 @@ static int get_nr_entries(struct dm_transaction_manager *tm, · 40 unmodified lines
434427 }
435428
436429 static int rebalance_children(struct shadow_spine *s,
437− struct dm_btree_info *info, uint64_t key)
430+ struct dm_btree_info *info,
431+ struct dm_btree_value_type *vt, uint64_t key)
438432 {
439433 int i, r, has_left_sibling, has_right_sibling;
440434 uint32_t child_entries;
@@ -472,13 +466,13 @@ static int rebalance_children(struct shadow_spine *s, · 31 unmodified lines
472466 has_right_sibling = i < (le32_to_cpu(n->header.nr_entries) - 1);
473467
474468 if (!has_left_sibling)
475− r = rebalance2(s, info, i);
469+ r = rebalance2(s, info, vt, i);
476470
477471 else if (!has_right_sibling)
478− r = rebalance2(s, info, i - 1);
472+ r = rebalance2(s, info, vt, i - 1);
479473
480474 else
481− r = rebalance3(s, info, i - 1);
475+ r = rebalance3(s, info, vt, i - 1);
482476
483477 return r;
484478 }
@@ -529,7 +523,7 @@ static int remove_raw(struct shadow_spine *s, struct dm_btree_info *info, · 44 unmodified lines
529523 if (le32_to_cpu(n->header.flags) & LEAF_NODE)
530524 return do_leaf(n, key, index);
531525
532− r = rebalance_children(s, info, key);
526+ r = rebalance_children(s, info, vt, key);
533527 if (r)
534528 break;
535529
@@ -550,6 +544,14 @@ static int remove_raw(struct shadow_spine *s, struct dm_btree_info *info, · 14 unmodified lines
550544 return r;
551545 }
552546
547+static struct dm_btree_value_type le64_type = {
548+ .context = NULL,
549+ .size = sizeof(__le64),
550+ .inc = NULL,
551+ .dec = NULL,
552+ .equal = NULL
553+};
554+
553555 int dm_btree_remove(struct dm_btree_info *info, dm_block_t root,
554556 uint64_t *keys, dm_block_t *new_root)
555557 {
drivers/md/raid5.c+91−36
@@ -184,6 +184,8 @@ static void return_io(struct bio *return_bi) · 183 unmodified lines
184184 return_bi = bi->bi_next;
185185 bi->bi_next = NULL;
186186 bi->bi_size = 0;
187+ trace_block_bio_complete(bdev_get_queue(bi->bi_bdev),
188+ bi, 0);
187189 bio_endio(bi, 0);
188190 bi = return_bi;
189191 }
@@ -671,9 +673,11 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s) · 481 unmodified lines
671673 bi->bi_next = NULL;
672674 if (rrdev)
673675 set_bit(R5_DOUBLE_LOCKED, &sh->dev[i].flags);
674− trace_block_bio_remap(bdev_get_queue(bi->bi_bdev),
675− bi, disk_devt(conf->mddev->gendisk),
676− sh->dev[i].sector);
676+
677+ if (conf->mddev->gendisk)
678+ trace_block_bio_remap(bdev_get_queue(bi->bi_bdev),
679+ bi, disk_devt(conf->mddev->gendisk),
680+ sh->dev[i].sector);
677681 generic_make_request(bi);
678682 }
679683 if (rrdev) {
@@ -701,9 +705,10 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s) · 21 unmodified lines
701705 rbi->bi_io_vec[0].bv_offset = 0;
702706 rbi->bi_size = STRIPE_SIZE;
703707 rbi->bi_next = NULL;
704− trace_block_bio_remap(bdev_get_queue(rbi->bi_bdev),
705− rbi, disk_devt(conf->mddev->gendisk),
706− sh->dev[i].sector);
708+ if (conf->mddev->gendisk)
709+ trace_block_bio_remap(bdev_get_queue(rbi->bi_bdev),
710+ rbi, disk_devt(conf->mddev->gendisk),
711+ sh->dev[i].sector);
707712 generic_make_request(rbi);
708713 }
709714 if (!rdev && !rrdev) {
@@ -2280,17 +2285,6 @@ schedule_reconstruction(struct stripe_head *sh, struct stripe_head_state *s, · 1570 unmodified lines
22802285 int level = conf->level;
22812286
22822287 if (rcw) {
2283− /* if we are not expanding this is a proper write request, and
2284− * there will be bios with new data to be drained into the
2285− * stripe cache
2286− */
2287− if (!expand) {
2288− sh->reconstruct_state = reconstruct_state_drain_run;
2289− set_bit(STRIPE_OP_BIODRAIN, &s->ops_request);
2290− } else
2291− sh->reconstruct_state = reconstruct_state_run;
2292−
2293− set_bit(STRIPE_OP_RECONSTRUCT, &s->ops_request);
22942288
22952289 for (i = disks; i--; ) {
22962290 struct r5dev *dev = &sh->dev[i];
@@ -2303,6 +2297,21 @@ schedule_reconstruction(struct stripe_head *sh, struct stripe_head_state *s, · 6 unmodified lines
23032297 s->locked++;
23042298 }
23052299 }
2300+ /* if we are not expanding this is a proper write request, and
2301+ * there will be bios with new data to be drained into the
2302+ * stripe cache
2303+ */
2304+ if (!expand) {
2305+ if (!s->locked)
2306+ /* False alarm, nothing to do */
2307+ return;
2308+ sh->reconstruct_state = reconstruct_state_drain_run;
2309+ set_bit(STRIPE_OP_BIODRAIN, &s->ops_request);
2310+ } else
2311+ sh->reconstruct_state = reconstruct_state_run;
2312+
2313+ set_bit(STRIPE_OP_RECONSTRUCT, &s->ops_request);
2314+
23062315 if (s->locked + conf->max_degraded == disks)
23072316 if (!test_and_set_bit(STRIPE_FULL_WRITE, &sh->state))
23082317 atomic_inc(&conf->pending_full_writes);
@@ -2311,11 +2320,6 @@ schedule_reconstruction(struct stripe_head *sh, struct stripe_head_state *s, · 2 unmodified lines
23112320 BUG_ON(!(test_bit(R5_UPTODATE, &sh->dev[pd_idx].flags) ||
23122321 test_bit(R5_Wantcompute, &sh->dev[pd_idx].flags)));
23132322
2314− sh->reconstruct_state = reconstruct_state_prexor_drain_run;
2315− set_bit(STRIPE_OP_PREXOR, &s->ops_request);
2316− set_bit(STRIPE_OP_BIODRAIN, &s->ops_request);
2317− set_bit(STRIPE_OP_RECONSTRUCT, &s->ops_request);
2318−
23192323 for (i = disks; i--; ) {
23202324 struct r5dev *dev = &sh->dev[i];
23212325 if (i == pd_idx)
@@ -2330,6 +2334,13 @@ schedule_reconstruction(struct stripe_head *sh, struct stripe_head_state *s, · 8 unmodified lines
23302334 s->locked++;
23312335 }
23322336 }
2337+ if (!s->locked)
2338+ /* False alarm - nothing to do */
2339+ return;
2340+ sh->reconstruct_state = reconstruct_state_prexor_drain_run;
2341+ set_bit(STRIPE_OP_PREXOR, &s->ops_request);
2342+ set_bit(STRIPE_OP_BIODRAIN, &s->ops_request);
2343+ set_bit(STRIPE_OP_RECONSTRUCT, &s->ops_request);
23332344 }
23342345
23352346 /* keep the parity disk(s) locked while asynchronous operations
@@ -2564,6 +2575,8 @@ handle_failed_sync(struct r5conf *conf, struct stripe_head *sh, · 228 unmodified lines
25642575 int i;
25652576
25662577 clear_bit(STRIPE_SYNCING, &sh->state);
2578+ if (test_and_clear_bit(R5_Overlap, &sh->dev[sh->pd_idx].flags))
2579+ wake_up(&conf->wait_for_overlap);
25672580 s->syncing = 0;
25682581 s->replacing = 0;
25692582 /* There is nothing more to do for sync/check/repair.
@@ -2737,6 +2750,7 @@ static void handle_stripe_clean_event(struct r5conf *conf, · 167 unmodified lines
27372750 {
27382751 int i;
27392752 struct r5dev *dev;
2753+ int discard_pending = 0;
27402754
27412755 for (i = disks; i--; )
27422756 if (sh->dev[i].written) {
@@ -2765,9 +2779,23 @@ static void handle_stripe_clean_event(struct r5conf *conf, · 22 unmodified lines
27652779 STRIPE_SECTORS,
27662780 !test_bit(STRIPE_DEGRADED, &sh->state),
27672781 0);
2768− }
2769− } else if (test_bit(R5_Discard, &sh->dev[i].flags))
2770− clear_bit(R5_Discard, &sh->dev[i].flags);
2782+ } else if (test_bit(R5_Discard, &dev->flags))
2783+ discard_pending = 1;
2784+ }
2785+ if (!discard_pending &&
2786+ test_bit(R5_Discard, &sh->dev[sh->pd_idx].flags)) {
2787+ clear_bit(R5_Discard, &sh->dev[sh->pd_idx].flags);
2788+ clear_bit(R5_UPTODATE, &sh->dev[sh->pd_idx].flags);
2789+ if (sh->qd_idx >= 0) {
2790+ clear_bit(R5_Discard, &sh->dev[sh->qd_idx].flags);
2791+ clear_bit(R5_UPTODATE, &sh->dev[sh->qd_idx].flags);
2792+ }
2793+ /* now that discard is done we can proceed with any sync */
2794+ clear_bit(STRIPE_DISCARD, &sh->state);
2795+ if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state))
2796+ set_bit(STRIPE_HANDLE, &sh->state);
2797+
2798+ }
27712799
27722800 if (test_and_clear_bit(STRIPE_FULL_WRITE, &sh->state))
27732801 if (atomic_dec_and_test(&conf->pending_full_writes))
@@ -2826,8 +2854,10 @@ static void handle_stripe_dirtying(struct r5conf *conf, · 52 unmodified lines
28262854 set_bit(STRIPE_HANDLE, &sh->state);
28272855 if (rmw < rcw && rmw > 0) {
28282856 /* prefer read-modify-write, but need to get some data */
2829− blk_add_trace_msg(conf->mddev->queue, "raid5 rmw %llu %d",
2830− (unsigned long long)sh->sector, rmw);
2857+ if (conf->mddev->queue)
2858+ blk_add_trace_msg(conf->mddev->queue,
2859+ "raid5 rmw %llu %d",
2860+ (unsigned long long)sh->sector, rmw);
28312861 for (i = disks; i--; ) {
28322862 struct r5dev *dev = &sh->dev[i];
28332863 if ((dev->towrite || i == sh->pd_idx) &&
@@ -2877,7 +2907,7 @@ static void handle_stripe_dirtying(struct r5conf *conf, · 43 unmodified lines
28772907 }
28782908 }
28792909 }
2880− if (rcw)
2910+ if (rcw && conf->mddev->queue)
28812911 blk_add_trace_msg(conf->mddev->queue, "raid5 rcw %llu %d %d %d",
28822912 (unsigned long long)sh->sector,
28832913 rcw, qread, test_bit(STRIPE_DELAYED, &sh->state));
@@ -3417,9 +3447,15 @@ static void handle_stripe(struct stripe_head *sh) · 533 unmodified lines
34173447 return;
34183448 }
34193449
3420− if (test_and_clear_bit(STRIPE_SYNC_REQUESTED, &sh->state)) {
3421− set_bit(STRIPE_SYNCING, &sh->state);
3422− clear_bit(STRIPE_INSYNC, &sh->state);
3450+ if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state)) {
3451+ spin_lock(&sh->stripe_lock);
3452+ /* Cannot process 'sync' concurrently with 'discard' */
3453+ if (!test_bit(STRIPE_DISCARD, &sh->state) &&
3454+ test_and_clear_bit(STRIPE_SYNC_REQUESTED, &sh->state)) {
3455+ set_bit(STRIPE_SYNCING, &sh->state);
3456+ clear_bit(STRIPE_INSYNC, &sh->state);
3457+ }
3458+ spin_unlock(&sh->stripe_lock);
34233459 }
34243460 clear_bit(STRIPE_DELAYED, &sh->state);
34253461
@@ -3579,6 +3615,8 @@ static void handle_stripe(struct stripe_head *sh) · 153 unmodified lines
35793615 test_bit(STRIPE_INSYNC, &sh->state)) {
35803616 md_done_sync(conf->mddev, STRIPE_SECTORS, 1);
35813617 clear_bit(STRIPE_SYNCING, &sh->state);
3618+ if (test_and_clear_bit(R5_Overlap, &sh->dev[sh->pd_idx].flags))
3619+ wake_up(&conf->wait_for_overlap);
35823620 }
35833621
35843622 /* If the failed drives are just a ReadError, then we might need
@@ -3878,6 +3916,8 @@ static void raid5_align_endio(struct bio *bi, int error) · 293 unmodified lines
38783916 rdev_dec_pending(rdev, conf->mddev);
38793917
38803918 if (!error && uptodate) {
3919+ trace_block_bio_complete(bdev_get_queue(raid_bi->bi_bdev),
3920+ raid_bi, 0);
38813921 bio_endio(raid_bi, 0);
38823922 if (atomic_dec_and_test(&conf->active_aligned_reads))
38833923 wake_up(&conf->wait_for_stripe);
@@ -3982,9 +4022,10 @@ static int chunk_aligned_read(struct mddev *mddev, struct bio * raid_bio) · 98 unmodified lines
39824022 atomic_inc(&conf->active_aligned_reads);
39834023 spin_unlock_irq(&conf->device_lock);
39844024
3985− trace_block_bio_remap(bdev_get_queue(align_bi->bi_bdev),
3986− align_bi, disk_devt(mddev->gendisk),
3987− raid_bio->bi_sector);
4025+ if (mddev->gendisk)
4026+ trace_block_bio_remap(bdev_get_queue(align_bi->bi_bdev),
4027+ align_bi, disk_devt(mddev->gendisk),
4028+ raid_bio->bi_sector);
39884029 generic_make_request(align_bi);
39894030 return 1;
39904031 } else {
@@ -4078,7 +4119,8 @@ static void raid5_unplug(struct blk_plug_cb *blk_cb, bool from_schedule) · 87 unmodified lines
40784119 }
40794120 spin_unlock_irq(&conf->device_lock);
40804121 }
4081− trace_block_unplug(mddev->queue, cnt, !from_schedule);
4122+ if (mddev->queue)
4123+ trace_block_unplug(mddev->queue, cnt, !from_schedule);
40824124 kfree(cb);
40834125 }
40844126
@@ -4141,6 +4183,13 @@ static void make_discard_request(struct mddev *mddev, struct bio *bi) · 56 unmodified lines
41414183 sh = get_active_stripe(conf, logical_sector, 0, 0, 0);
41424184 prepare_to_wait(&conf->wait_for_overlap, &w,
41434185 TASK_UNINTERRUPTIBLE);
4186+ set_bit(R5_Overlap, &sh->dev[sh->pd_idx].flags);
4187+ if (test_bit(STRIPE_SYNCING, &sh->state)) {
4188+ release_stripe(sh);
4189+ schedule();
4190+ goto again;
4191+ }
4192+ clear_bit(R5_Overlap, &sh->dev[sh->pd_idx].flags);
41444193 spin_lock_irq(&sh->stripe_lock);
41454194 for (d = 0; d < conf->raid_disks; d++) {
41464195 if (d == sh->pd_idx || d == sh->qd_idx)
@@ -4153,6 +4202,7 @@ static void make_discard_request(struct mddev *mddev, struct bio *bi) · 6 unmodified lines
41534202 goto again;
41544203 }
41554204 }
4205+ set_bit(STRIPE_DISCARD, &sh->state);
41564206 finish_wait(&conf->wait_for_overlap, &w);
41574207 for (d = 0; d < conf->raid_disks; d++) {
41584208 if (d == sh->pd_idx || d == sh->qd_idx)
@@ -4336,6 +4386,8 @@ static void make_request(struct mddev *mddev, struct bio * bi) · 177 unmodified lines
43364386 if ( rw == WRITE )
43374387 md_write_end(mddev);
43384388
4389+ trace_block_bio_complete(bdev_get_queue(bi->bi_bdev),
4390+ bi, 0);
43394391 bio_endio(bi, 0);
43404392 }
43414393 }
@@ -4712,8 +4764,11 @@ static int retry_aligned_read(struct r5conf *conf, struct bio *raid_bio) · 370 unmodified lines
47124764 handled++;
47134765 }
47144766 remaining = raid5_dec_bi_active_stripes(raid_bio);
4715− if (remaining == 0)
4767+ if (remaining == 0) {
4768+ trace_block_bio_complete(bdev_get_queue(raid_bio->bi_bdev),
4769+ raid_bio, 0);
47164770 bio_endio(raid_bio, 0);
4771+ }
47174772 if (atomic_dec_and_test(&conf->active_aligned_reads))
47184773 wake_up(&conf->wait_for_stripe);
47194774 return handled;
drivers/md/raid5.h+1−4
@@ -221,10 +221,6 @@ struct stripe_head { · 220 unmodified lines
221221 struct stripe_operations {
222222 int target, target2;
223223 enum sum_check_flags zero_sum_result;
224− #ifdef CONFIG_MULTICORE_RAID456
225− unsigned long request;
226− wait_queue_head_t wait_for_ops;
227− #endif
228224 } ops;
229225 struct r5dev {
230226 /* rreq and rvec are used for the replacement device when
@@ -323,6 +319,7 @@ enum { · 92 unmodified lines
323319 STRIPE_COMPUTE_RUN,
324320 STRIPE_OPS_REQ_PENDING,
325321 STRIPE_ON_UNPLUG_LIST,
322+ STRIPE_DISCARD,
326323 };
327324
328325 /*
drivers/media/i2c/m5mols/m5mols_core.c+1−1
@@ -724,7 +724,7 @@ static int m5mols_s_stream(struct v4l2_subdev *sd, int enable) · 723 unmodified lines
724724 if (enable) {
725725 if (is_code(code, M5MOLS_RESTYPE_MONITOR))
726726 ret = m5mols_start_monitor(info);
727− if (is_code(code, M5MOLS_RESTYPE_CAPTURE))
727+ else if (is_code(code, M5MOLS_RESTYPE_CAPTURE))
728728 ret = m5mols_start_capture(info);
729729 else
730730 ret = -EINVAL;
drivers/media/pci/bt8xx/bttv-driver.c+15−5
@@ -250,17 +250,19 @@ static u8 SRAM_Table[][60] = · 249 unmodified lines
250250 vdelay start of active video in 2 * field lines relative to
251251 trailing edge of /VRESET pulse (VDELAY register).
252252 sheight height of active video in 2 * field lines.
253+ extraheight Added to sheight for cropcap.bounds.height only
253254 videostart0 ITU-R frame line number of the line corresponding
254255 to vdelay in the first field. */
255256 #define CROPCAP(minhdelayx1, hdelayx1, swidth, totalwidth, sqwidth, \
256− vdelay, sheight, videostart0) \
257+ vdelay, sheight, extraheight, videostart0) \
257258 .cropcap.bounds.left = minhdelayx1, \
258259 /* * 2 because vertically we count field lines times two, */ \
259260 /* e.g. 23 * 2 to 23 * 2 + 576 in PAL-BGHI defrect. */ \
260261 .cropcap.bounds.top = (videostart0) * 2 - (vdelay) + MIN_VDELAY, \
261262 /* 4 is a safety margin at the end of the line. */ \
262263 .cropcap.bounds.width = (totalwidth) - (minhdelayx1) - 4, \
263− .cropcap.bounds.height = (sheight) + (vdelay) - MIN_VDELAY, \
264+ .cropcap.bounds.height = (sheight) + (extraheight) + (vdelay) - \
265+ MIN_VDELAY, \
264266 .cropcap.defrect.left = hdelayx1, \
265267 .cropcap.defrect.top = (videostart0) * 2, \
266268 .cropcap.defrect.width = swidth, \
@@ -301,9 +303,10 @@ const struct bttv_tvnorm bttv_tvnorms[] = { · 34 unmodified lines
301303 /* totalwidth */ 1135,
302304 /* sqwidth */ 944,
303305 /* vdelay */ 0x20,
304− /* bt878 (and bt848?) can capture another
305− line below active video. */
306− /* sheight */ (576 + 2) + 0x20 - 2,
306+ /* sheight */ 576,
307+ /* bt878 (and bt848?) can capture another
308+ line below active video. */
309+ /* extraheight */ 2,
307310 /* videostart0 */ 23)
308311 },{
309312 .v4l2_id = V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR,
@@ -330,6 +333,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = { · 20 unmodified lines
330333 /* sqwidth */ 780,
331334 /* vdelay */ 0x1a,
332335 /* sheight */ 480,
336+ /* extraheight */ 0,
333337 /* videostart0 */ 23)
334338 },{
335339 .v4l2_id = V4L2_STD_SECAM,
@@ -355,6 +359,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = { · 19 unmodified lines
355359 /* sqwidth */ 944,
356360 /* vdelay */ 0x20,
357361 /* sheight */ 576,
362+ /* extraheight */ 0,
358363 /* videostart0 */ 23)
359364 },{
360365 .v4l2_id = V4L2_STD_PAL_Nc,
@@ -380,6 +385,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = { · 19 unmodified lines
380385 /* sqwidth */ 780,
381386 /* vdelay */ 0x1a,
382387 /* sheight */ 576,
388+ /* extraheight */ 0,
383389 /* videostart0 */ 23)
384390 },{
385391 .v4l2_id = V4L2_STD_PAL_M,
@@ -405,6 +411,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = { · 19 unmodified lines
405411 /* sqwidth */ 780,
406412 /* vdelay */ 0x1a,
407413 /* sheight */ 480,
414+ /* extraheight */ 0,
408415 /* videostart0 */ 23)
409416 },{
410417 .v4l2_id = V4L2_STD_PAL_N,
@@ -430,6 +437,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = { · 19 unmodified lines
430437 /* sqwidth */ 944,
431438 /* vdelay */ 0x20,
432439 /* sheight */ 576,
440+ /* extraheight */ 0,
433441 /* videostart0 */ 23)
434442 },{
435443 .v4l2_id = V4L2_STD_NTSC_M_JP,
@@ -455,6 +463,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = { · 19 unmodified lines
455463 /* sqwidth */ 780,
456464 /* vdelay */ 0x16,
457465 /* sheight */ 480,
466+ /* extraheight */ 0,
458467 /* videostart0 */ 23)
459468 },{
460469 /* that one hopefully works with the strange timing
@@ -484,6 +493,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = { · 23 unmodified lines
484493 /* sqwidth */ 944,
485494 /* vdelay */ 0x1a,
486495 /* sheight */ 480,
496+ /* extraheight */ 0,
487497 /* videostart0 */ 23)
488498 }
489499 };
drivers/media/platform/Kconfig+1−1
@@ -204,7 +204,7 @@ config VIDEO_SAMSUNG_EXYNOS_GSC · 203 unmodified lines
204204
205205 config VIDEO_SH_VEU
206206 tristate "SuperH VEU mem2mem video processing driver"
207− depends on VIDEO_DEV && VIDEO_V4L2
207+ depends on VIDEO_DEV && VIDEO_V4L2 && GENERIC_HARDIRQS
208208 select VIDEOBUF2_DMA_CONTIG
209209 select V4L2_MEM2MEM_DEV
210210 help
drivers/media/platform/exynos-gsc/gsc-core.c+5−3
@@ -1054,16 +1054,18 @@ static int gsc_m2m_suspend(struct gsc_dev *gsc) · 1053 unmodified lines
10541054
10551055 static int gsc_m2m_resume(struct gsc_dev *gsc)
10561056 {
1057+ struct gsc_ctx *ctx;
10571058 unsigned long flags;
10581059
10591060 spin_lock_irqsave(&gsc->slock, flags);
10601061 /* Clear for full H/W setup in first run after resume */
1062+ ctx = gsc->m2m.ctx;
10611063 gsc->m2m.ctx = NULL;
10621064 spin_unlock_irqrestore(&gsc->slock, flags);
10631065
10641066 if (test_and_clear_bit(ST_M2M_SUSPENDED, &gsc->state))
1065− gsc_m2m_job_finish(gsc->m2m.ctx,
1066− VB2_BUF_STATE_ERROR);
1067+ gsc_m2m_job_finish(ctx, VB2_BUF_STATE_ERROR);
1068+
10671069 return 0;
10681070 }
10691071
@@ -1204,7 +1206,7 @@ static int gsc_resume(struct device *dev) · 134 unmodified lines
12041206 /* Do not resume if the device was idle before system suspend */
12051207 spin_lock_irqsave(&gsc->slock, flags);
12061208 if (!test_and_clear_bit(ST_SUSPEND, &gsc->state) ||
1207− !gsc_m2m_active(gsc)) {
1209+ !gsc_m2m_opened(gsc)) {
12081210 spin_unlock_irqrestore(&gsc->slock, flags);
12091211 return 0;
12101212 }
drivers/media/platform/s5p-fimc/fimc-core.c+4−2
@@ -850,16 +850,18 @@ static int fimc_m2m_suspend(struct fimc_dev *fimc) · 849 unmodified lines
850850
851851 static int fimc_m2m_resume(struct fimc_dev *fimc)
852852 {
853+ struct fimc_ctx *ctx;
853854 unsigned long flags;
854855
855856 spin_lock_irqsave(&fimc->slock, flags);
856857 /* Clear for full H/W setup in first run after resume */
858+ ctx = fimc->m2m.ctx;
857859 fimc->m2m.ctx = NULL;
858860 spin_unlock_irqrestore(&fimc->slock, flags);
859861
860862 if (test_and_clear_bit(ST_M2M_SUSPENDED, &fimc->state))
861− fimc_m2m_job_finish(fimc->m2m.ctx,
862− VB2_BUF_STATE_ERROR);
863+ fimc_m2m_job_finish(ctx, VB2_BUF_STATE_ERROR);
864+
863865 return 0;
864866 }
865867
drivers/media/platform/s5p-fimc/fimc-lite-reg.c+4−4
@@ -128,10 +128,10 @@ static const u32 src_pixfmt_map[8][3] = { · 127 unmodified lines
128128 void flite_hw_set_source_format(struct fimc_lite *dev, struct flite_frame *f)
129129 {
130130 enum v4l2_mbus_pixelcode pixelcode = dev->fmt->mbus_code;
131− unsigned int i = ARRAY_SIZE(src_pixfmt_map);
131+ int i = ARRAY_SIZE(src_pixfmt_map);
132132 u32 cfg;
133133
134− while (i-- >= 0) {
134+ while (--i >= 0) {
135135 if (src_pixfmt_map[i][0] == pixelcode)
136136 break;
137137 }
@@ -224,9 +224,9 @@ static void flite_hw_set_out_order(struct fimc_lite *dev, struct flite_frame *f) · 86 unmodified lines
224224 { V4L2_MBUS_FMT_VYUY8_2X8, FLITE_REG_CIODMAFMT_CRYCBY },
225225 };
226226 u32 cfg = readl(dev->regs + FLITE_REG_CIODMAFMT);
227− unsigned int i = ARRAY_SIZE(pixcode);
227+ int i = ARRAY_SIZE(pixcode);
228228
229− while (i-- >= 0)
229+ while (--i >= 0)
230230 if (pixcode[i][0] == dev->fmt->mbus_code)
231231 break;
232232 cfg &= ~FLITE_REG_CIODMAFMT_YCBCR_ORDER_MASK;
drivers/media/platform/s5p-fimc/fimc-lite.c+1−0
@@ -1408,6 +1408,7 @@ static const struct v4l2_ctrl_config fimc_lite_ctrl = { · 1407 unmodified lines
14081408 .id = V4L2_CTRL_CLASS_USER | 0x1001,
14091409 .type = V4L2_CTRL_TYPE_BOOLEAN,
14101410 .name = "Test Pattern 640x480",
1411+ .step = 1,
14111412 };
14121413
14131414 static int fimc_lite_create_capture_subdev(struct fimc_lite *fimc)
drivers/media/platform/s5p-fimc/fimc-mdevice.c+19−20
@@ -827,7 +827,7 @@ static int fimc_md_link_notify(struct media_pad *source, · 826 unmodified lines
827827 struct fimc_pipeline *pipeline;
828828 struct v4l2_subdev *sd;
829829 struct mutex *lock;
830− int ret = 0;
830+ int i, ret = 0;
831831 int ref_count;
832832
833833 if (media_entity_type(sink->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
@@ -854,29 +854,28 @@ static int fimc_md_link_notify(struct media_pad *source, · 20 unmodified lines
854854 return 0;
855855 }
856856
857+ mutex_lock(lock);
858+ ref_count = fimc ? fimc->vid_cap.refcnt : fimc_lite->ref_count;
859+
857860 if (!(flags & MEDIA_LNK_FL_ENABLED)) {
858− int i;
859− mutex_lock(lock);
860− ret = __fimc_pipeline_close(pipeline);
861+ if (ref_count > 0) {
862+ ret = __fimc_pipeline_close(pipeline);
863+ if (!ret && fimc)
864+ fimc_ctrls_delete(fimc->vid_cap.ctx);
865+ }
861866 for (i = 0; i < IDX_MAX; i++)
862867 pipeline->subdevs[i] = NULL;
863− if (fimc)
864− fimc_ctrls_delete(fimc->vid_cap.ctx);
865− mutex_unlock(lock);
866− return ret;
868+ } else if (ref_count > 0) {
869+ /*
870+ * Link activation. Enable power of pipeline elements only if
871+ * the pipeline is already in use, i.e. its video node is open.
872+ * Recreate the controls destroyed during the link deactivation.
873+ */
874+ ret = __fimc_pipeline_open(pipeline,
875+ source->entity, true);
876+ if (!ret && fimc)
877+ ret = fimc_capture_ctrls_create(fimc);
867878 }
868− /*
869− * Link activation. Enable power of pipeline elements only if the
870− * pipeline is already in use, i.e. its video node is opened.
871− * Recreate the controls destroyed during the link deactivation.
872− */
873− mutex_lock(lock);
874−
875− ref_count = fimc ? fimc->vid_cap.refcnt : fimc_lite->ref_count;
876− if (ref_count > 0)
877− ret = __fimc_pipeline_open(pipeline, source->entity, true);
878− if (!ret && fimc)
879− ret = fimc_capture_ctrls_create(fimc);
880879
881880 mutex_unlock(lock);
882881 return ret ? -EPIPE : ret;
drivers/media/platform/s5p-mfc/s5p_mfc.c+1−1
@@ -276,7 +276,7 @@ static void s5p_mfc_handle_frame_new(struct s5p_mfc_ctx *ctx, unsigned int err) · 275 unmodified lines
276276 unsigned int frame_type;
277277
278278 dspl_y_addr = s5p_mfc_hw_call(dev->mfc_ops, get_dspl_y_adr, dev);
279− frame_type = s5p_mfc_hw_call(dev->mfc_ops, get_dec_frame_type, dev);
279+ frame_type = s5p_mfc_hw_call(dev->mfc_ops, get_disp_frame_type, ctx);
280280
281281 /* If frame is same as previous then skip and do not dequeue */
282282 if (frame_type == S5P_FIMV_DECODE_FRAME_SKIPPED) {
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c+1−0
@@ -232,6 +232,7 @@ static struct mfc_control controls[] = { · 231 unmodified lines
232232 .minimum = 0,
233233 .maximum = 1,
234234 .default_value = 0,
235+ .step = 1,
235236 .menu_skip_mask = 0,
236237 },
237238 {
drivers/media/radio/radio-ma901.c+11−0
@@ -347,9 +347,20 @@ static void usb_ma901radio_release(struct v4l2_device *v4l2_dev) · 346 unmodified lines
347347 static int usb_ma901radio_probe(struct usb_interface *intf,
348348 const struct usb_device_id *id)
349349 {
350+ struct usb_device *dev = interface_to_usbdev(intf);
350351 struct ma901radio_device *radio;
351352 int retval = 0;
352353
354+ /* Masterkit MA901 usb radio has the same USB ID as many others
355+ * Atmel V-USB devices. Let's make additional checks to be sure
356+ * that this is our device.
357+ */
358+
359+ if (dev->product && dev->manufacturer &&
360+ (strncmp(dev->product, "MA901", 5) != 0
361+ || strncmp(dev->manufacturer, "www.masterkit.ru", 16) != 0))
362+ return -ENODEV;
363+
353364 radio = kzalloc(sizeof(struct ma901radio_device), GFP_KERNEL);
354365 if (!radio) {
355366 dev_err(&intf->dev, "kzalloc for ma901radio_device failed\n");
drivers/media/rc/Kconfig+1−1
@@ -291,7 +291,7 @@ config IR_TTUSBIR · 290 unmodified lines
291291
292292 config IR_RX51
293293 tristate "Nokia N900 IR transmitter diode"
294− depends on OMAP_DM_TIMER && LIRC && !ARCH_MULTIPLATFORM
294+ depends on OMAP_DM_TIMER && ARCH_OMAP2PLUS && LIRC && !ARCH_MULTIPLATFORM
295295 ---help---
296296 Say Y or M here if you want to enable support for the IR
297297 transmitter diode built in the Nokia N900 (RX51) device.
drivers/media/v4l2-core/Makefile+1−1
@@ -10,7 +10,7 @@ ifeq ($(CONFIG_COMPAT),y) · 9 unmodified lines
1010 videodev-objs += v4l2-compat-ioctl32.o
1111 endif
1212
13−obj-$(CONFIG_VIDEO_DEV) += videodev.o
13+obj-$(CONFIG_VIDEO_V4L2) += videodev.o
1414 obj-$(CONFIG_VIDEO_V4L2_INT_DEVICE) += v4l2-int-device.o
1515 obj-$(CONFIG_VIDEO_V4L2) += v4l2-common.o
1616
drivers/mfd/Kconfig+1−0
@@ -858,6 +858,7 @@ config EZX_PCAP · 857 unmodified lines
858858 config AB8500_CORE
859859 bool "ST-Ericsson AB8500 Mixed Signal Power Management chip"
860860 depends on GENERIC_HARDIRQS && ABX500_CORE && MFD_DB8500_PRCMU
861+ select POWER_SUPPLY
861862 select MFD_CORE
862863 select IRQ_DOMAIN
863864 help
drivers/mfd/ab8500-gpadc.c+13−4
@@ -594,9 +594,12 @@ static int ab8500_gpadc_runtime_suspend(struct device *dev) · 593 unmodified lines
594594 static int ab8500_gpadc_runtime_resume(struct device *dev)
595595 {
596596 struct ab8500_gpadc *gpadc = dev_get_drvdata(dev);
597+ int ret;
597598
598− regulator_enable(gpadc->regu);
599− return 0;
599+ ret = regulator_enable(gpadc->regu);
600+ if (ret)
601+ dev_err(dev, "Failed to enable vtvout LDO: %d\n", ret);
602+ return ret;
600603 }
601604
602605 static int ab8500_gpadc_runtime_idle(struct device *dev)
@@ -643,7 +646,7 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) · 40 unmodified lines
643646 }
644647
645648 /* VTVout LDO used to power up ab8500-GPADC */
646− gpadc->regu = regulator_get(&pdev->dev, "vddadc");
649+ gpadc->regu = devm_regulator_get(&pdev->dev, "vddadc");
647650 if (IS_ERR(gpadc->regu)) {
648651 ret = PTR_ERR(gpadc->regu);
649652 dev_err(gpadc->dev, "failed to get vtvout LDO\n");
@@ -652,7 +655,11 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) · 2 unmodified lines
652655
653656 platform_set_drvdata(pdev, gpadc);
654657
655− regulator_enable(gpadc->regu);
658+ ret = regulator_enable(gpadc->regu);
659+ if (ret) {
660+ dev_err(gpadc->dev, "Failed to enable vtvout LDO: %d\n", ret);
661+ goto fail_enable;
662+ }
656663
657664 pm_runtime_set_autosuspend_delay(gpadc->dev, GPADC_AUDOSUSPEND_DELAY);
658665 pm_runtime_use_autosuspend(gpadc->dev);
@@ -663,6 +670,8 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) · 4 unmodified lines
663670 list_add_tail(&gpadc->node, &ab8500_gpadc_list);
664671 dev_dbg(gpadc->dev, "probe success\n");
665672 return 0;
673+
674+fail_enable:
666675 fail_irq:
667676 free_irq(gpadc->irq, gpadc);
668677 fail:
drivers/mfd/omap-usb-host.c+3−3
@@ -460,15 +460,15 @@ static void omap_usbhs_init(struct device *dev) · 459 unmodified lines
460460
461461 switch (omap->usbhs_rev) {
462462 case OMAP_USBHS_REV1:
463− omap_usbhs_rev1_hostconfig(omap, reg);
463+ reg = omap_usbhs_rev1_hostconfig(omap, reg);
464464 break;
465465
466466 case OMAP_USBHS_REV2:
467− omap_usbhs_rev2_hostconfig(omap, reg);
467+ reg = omap_usbhs_rev2_hostconfig(omap, reg);
468468 break;
469469
470470 default: /* newer revisions */
471− omap_usbhs_rev2_hostconfig(omap, reg);
471+ reg = omap_usbhs_rev2_hostconfig(omap, reg);
472472 break;
473473 }
474474
drivers/mfd/palmas.c+33−3
@@ -257,9 +257,24 @@ static struct regmap_irq_chip palmas_irq_chip = { · 256 unmodified lines
257257 PALMAS_INT1_MASK),
258258 };
259259
260−static void palmas_dt_to_pdata(struct device_node *node,
260+static int palmas_set_pdata_irq_flag(struct i2c_client *i2c,
261261 struct palmas_platform_data *pdata)
262262 {
263+ struct irq_data *irq_data = irq_get_irq_data(i2c->irq);
264+ if (!irq_data) {
265+ dev_err(&i2c->dev, "Invalid IRQ: %d\n", i2c->irq);
266+ return -EINVAL;
267+ }
268+
269+ pdata->irq_flags = irqd_get_trigger_type(irq_data);
270+ dev_info(&i2c->dev, "Irq flag is 0x%08x\n", pdata->irq_flags);
271+ return 0;
272+}
273+
274+static void palmas_dt_to_pdata(struct i2c_client *i2c,
275+ struct palmas_platform_data *pdata)
276+{
277+ struct device_node *node = i2c->dev.of_node;
263278 int ret;
264279 u32 prop;
265280
@@ -283,6 +298,8 @@ static void palmas_dt_to_pdata(struct device_node *node, · 17 unmodified lines
283298 pdata->power_ctrl = PALMAS_POWER_CTRL_NSLEEP_MASK |
284299 PALMAS_POWER_CTRL_ENABLE1_MASK |
285300 PALMAS_POWER_CTRL_ENABLE2_MASK;
301+ if (i2c->irq)
302+ palmas_set_pdata_irq_flag(i2c, pdata);
286303 }
287304
288305 static int palmas_i2c_probe(struct i2c_client *i2c,
@@ -304,7 +321,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c, · 15 unmodified lines
304321 if (!pdata)
305322 return -ENOMEM;
306323
307− palmas_dt_to_pdata(node, pdata);
324+ palmas_dt_to_pdata(i2c, pdata);
308325 }
309326
310327 if (!pdata)
@@ -344,6 +361,19 @@ static int palmas_i2c_probe(struct i2c_client *i2c, · 33 unmodified lines
344361 }
345362 }
346363
364+ /* Change interrupt line output polarity */
365+ if (pdata->irq_flags & IRQ_TYPE_LEVEL_HIGH)
366+ reg = PALMAS_POLARITY_CTRL_INT_POLARITY;
367+ else
368+ reg = 0;
369+ ret = palmas_update_bits(palmas, PALMAS_PU_PD_OD_BASE,
370+ PALMAS_POLARITY_CTRL, PALMAS_POLARITY_CTRL_INT_POLARITY,
371+ reg);
372+ if (ret < 0) {
373+ dev_err(palmas->dev, "POLARITY_CTRL updat failed: %d\n", ret);
374+ goto err;
375+ }
376+
347377 /* Change IRQ into clear on read mode for efficiency */
348378 slave = PALMAS_BASE_TO_SLAVE(PALMAS_INTERRUPT_BASE);
349379 addr = PALMAS_BASE_TO_REG(PALMAS_INTERRUPT_BASE, PALMAS_INT_CTRL);
@@ -352,7 +382,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c, · 2 unmodified lines
352382 regmap_write(palmas->regmap[slave], addr, reg);
353383
354384 ret = regmap_add_irq_chip(palmas->regmap[slave], palmas->irq,
355− IRQF_ONESHOT | IRQF_TRIGGER_LOW, 0, &palmas_irq_chip,
385+ IRQF_ONESHOT | pdata->irq_flags, 0, &palmas_irq_chip,
356386 &palmas->irq_data);
357387 if (ret < 0)
358388 goto err;
drivers/mfd/tps65912-core.c+1−0
@@ -169,6 +169,7 @@ err: · 168 unmodified lines
169169 void tps65912_device_exit(struct tps65912 *tps65912)
170170 {
171171 mfd_remove_devices(tps65912->dev);
172+ tps65912_irq_exit(tps65912);
172173 kfree(tps65912);
173174 }
174175
drivers/mfd/twl4030-audio.c+1−1
@@ -118,7 +118,7 @@ EXPORT_SYMBOL_GPL(twl4030_audio_enable_resource); · 117 unmodified lines
118118 * Disable the resource.
119119 * The function returns with error or the content of the register
120120 */
121−int twl4030_audio_disable_resource(unsigned id)
121+int twl4030_audio_disable_resource(enum twl4030_audio_res id)
122122 {
123123 struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
124124 int val;
drivers/mfd/twl4030-madc.c+1−1
@@ -800,7 +800,7 @@ static int twl4030_madc_remove(struct platform_device *pdev) · 799 unmodified lines
800800
801801 static struct platform_driver twl4030_madc_driver = {
802802 .probe = twl4030_madc_probe,
803− .remove = __exit_p(twl4030_madc_remove),
803+ .remove = twl4030_madc_remove,
804804 .driver = {
805805 .name = "twl4030_madc",
806806 .owner = THIS_MODULE,
drivers/misc/mei/hw-me.c+20−9
@@ -151,6 +151,20 @@ static void mei_me_intr_disable(struct mei_device *dev) · 150 unmodified lines
151151 mei_hcsr_set(hw, hcsr);
152152 }
153153
154+/**
155+ * mei_me_hw_reset_release - release device from the reset
156+ *
157+ * @dev: the device structure
158+ */
159+static void mei_me_hw_reset_release(struct mei_device *dev)
160+{
161+ struct mei_me_hw *hw = to_me_hw(dev);
162+ u32 hcsr = mei_hcsr_read(hw);
163+
164+ hcsr |= H_IG;
165+ hcsr &= ~H_RST;
166+ mei_hcsr_set(hw, hcsr);
167+}
154168 /**
155169 * mei_me_hw_reset - resets fw via mei csr register.
156170 *
@@ -169,18 +183,14 @@ static void mei_me_hw_reset(struct mei_device *dev, bool intr_enable) · 12 unmodified lines
169183 if (intr_enable)
170184 hcsr |= H_IE;
171185 else
172− hcsr &= ~H_IE;
173−
174− mei_hcsr_set(hw, hcsr);
175−
176− hcsr = mei_hcsr_read(hw) | H_IG;
177− hcsr &= ~H_RST;
186+ hcsr |= ~H_IE;
178187
179188 mei_hcsr_set(hw, hcsr);
180189
181− hcsr = mei_hcsr_read(hw);
190+ if (dev->dev_state == MEI_DEV_POWER_DOWN)
191+ mei_me_hw_reset_release(dev);
182192
183− dev_dbg(&dev->pdev->dev, "current HCSR = 0x%08x.\n", hcsr);
193+ dev_dbg(&dev->pdev->dev, "current HCSR = 0x%08x.\n", mei_hcsr_read(hw));
184194 }
185195
186196 /**
@@ -466,7 +476,8 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id) · 279 unmodified lines
466476 mutex_unlock(&dev->device_lock);
467477 return IRQ_HANDLED;
468478 } else {
469− dev_dbg(&dev->pdev->dev, "FW not ready.\n");
479+ dev_dbg(&dev->pdev->dev, "Reset Completed.\n");
480+ mei_me_hw_reset_release(dev);
470481 mutex_unlock(&dev->device_lock);
471482 return IRQ_HANDLED;
472483 }
drivers/misc/mei/init.c+18−0
@@ -183,6 +183,24 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled) · 182 unmodified lines
183183 mei_cl_all_write_clear(dev);
184184 }
185185
186+void mei_stop(struct mei_device *dev)
187+{
188+ dev_dbg(&dev->pdev->dev, "stopping the device.\n");
189+
190+ mutex_lock(&dev->device_lock);
191+
192+ cancel_delayed_work(&dev->timer_work);
193+
194+ mei_wd_stop(dev);
195+
196+ dev->dev_state = MEI_DEV_POWER_DOWN;
197+ mei_reset(dev, 0);
198+
199+ mutex_unlock(&dev->device_lock);
200+
201+ flush_scheduled_work();
202+}
203+
186204
187205
188206
drivers/misc/mei/mei_dev.h+1−0
@@ -381,6 +381,7 @@ static inline unsigned long mei_secs_to_jiffies(unsigned long sec) · 380 unmodified lines
381381 void mei_device_init(struct mei_device *dev);
382382 void mei_reset(struct mei_device *dev, int interrupts);
383383 int mei_hw_init(struct mei_device *dev);
384+void mei_stop(struct mei_device *dev);
384385
385386 /*
386387 * MEI interrupt functions prototype
drivers/misc/mei/pci-me.c+7−45
@@ -247,44 +247,14 @@ static void mei_remove(struct pci_dev *pdev) · 246 unmodified lines
247247
248248 hw = to_me_hw(dev);
249249
250− mutex_lock(&dev->device_lock);
251−
252− cancel_delayed_work(&dev->timer_work);
253250
254− mei_wd_stop(dev);
251+ dev_err(&pdev->dev, "stop\n");
252+ mei_stop(dev);
255253
256254 mei_pdev = NULL;
257255
258− if (dev->iamthif_cl.state == MEI_FILE_CONNECTED) {
259− dev->iamthif_cl.state = MEI_FILE_DISCONNECTING;
260− mei_cl_disconnect(&dev->iamthif_cl);
261− }
262− if (dev->wd_cl.state == MEI_FILE_CONNECTED) {
263− dev->wd_cl.state = MEI_FILE_DISCONNECTING;
264− mei_cl_disconnect(&dev->wd_cl);
265− }
266−
267− /* Unregistering watchdog device */
268256 mei_watchdog_unregister(dev);
269257
270− /* remove entry if already in list */
271− dev_dbg(&pdev->dev, "list del iamthif and wd file list.\n");
272−
273− if (dev->open_handle_count > 0)
274− dev->open_handle_count--;
275− mei_cl_unlink(&dev->wd_cl);
276−
277− if (dev->open_handle_count > 0)
278− dev->open_handle_count--;
279− mei_cl_unlink(&dev->iamthif_cl);
280−
281− dev->iamthif_current_cb = NULL;
282− dev->me_clients_num = 0;
283−
284− mutex_unlock(&dev->device_lock);
285−
286− flush_scheduled_work();
287−
288258 /* disable interrupts */
289259 mei_disable_interrupts(dev);
290260
@@ -308,28 +278,20 @@ static int mei_pci_suspend(struct device *device) · 17 unmodified lines
308278 {
309279 struct pci_dev *pdev = to_pci_dev(device);
310280 struct mei_device *dev = pci_get_drvdata(pdev);
311− int err;
312281
313282 if (!dev)
314283 return -ENODEV;
315− mutex_lock(&dev->device_lock);
316284
317− cancel_delayed_work(&dev->timer_work);
285+ dev_err(&pdev->dev, "suspend\n");
318286
319− /* Stop watchdog if exists */
320− err = mei_wd_stop(dev);
321− /* Set new mei state */
322− if (dev->dev_state == MEI_DEV_ENABLED ||
323− dev->dev_state == MEI_DEV_RECOVERING_FROM_RESET) {
324− dev->dev_state = MEI_DEV_POWER_DOWN;
325− mei_reset(dev, 0);
326− }
327− mutex_unlock(&dev->device_lock);
287+ mei_stop(dev);
288+
289+ mei_disable_interrupts(dev);
328290
329291 free_irq(pdev->irq, dev);
330292 pci_disable_msi(pdev);
331293
332− return err;
294+ return 0;
333295 }
334296
335297 static int mei_pci_resume(struct device *device)
drivers/misc/vmw_vmci/Kconfig+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44
55 config VMWARE_VMCI
66 tristate "VMware VMCI Driver"
7− depends on X86 && PCI
7+ depends on X86 && PCI && NET
88 help
99 This is VMware's Virtual Machine Communication Interface. It enables
1010 high-speed communication between host and guest in a virtual
drivers/misc/vmw_vmci/vmci_datagram.c+3−1
@@ -42,9 +42,11 @@ struct datagram_entry { · 41 unmodified lines
4242
4343 struct delayed_datagram_info {
4444 struct datagram_entry *entry;
45− struct vmci_datagram msg;
4645 struct work_struct work;
4746 bool in_dg_host_queue;
47+ /* msg and msg_payload must be together. */
48+ struct vmci_datagram msg;
49+ u8 msg_payload[];
4850 };
4951
5052 /* Number of in-flight host->host datagrams */
drivers/mtd/bcm47xxpart.c+33−19
@@ -19,6 +19,12 @@ · 18 unmodified lines
1919 /* 10 parts were found on sflash on Netgear WNDR4500 */
2020 #define BCM47XXPART_MAX_PARTS 12
2121
22+/*
23+ * Amount of bytes we read when analyzing each block of flash memory.
24+ * Set it big enough to allow detecting partition and reading important data.
25+ */
26+#define BCM47XXPART_BYTES_TO_READ 0x404
27+
2228 /* Magics */
2329 #define BOARD_DATA_MAGIC 0x5246504D /* MPFR */
2430 #define POT_MAGIC1 0x54544f50 /* POTT */
@@ -57,17 +63,15 @@ static int bcm47xxpart_parse(struct mtd_info *master, · 32 unmodified lines
5763 struct trx_header *trx;
5864 int trx_part = -1;
5965 int last_trx_part = -1;
60− int max_bytes_to_read = 0x8004;
66+ int possible_nvram_sizes[] = { 0x8000, 0xF000, 0x10000, };
6167
6268 if (blocksize <= 0x10000)
6369 blocksize = 0x10000;
64− if (blocksize == 0x20000)
65− max_bytes_to_read = 0x18004;
6670
6771 /* Alloc */
6872 parts = kzalloc(sizeof(struct mtd_partition) * BCM47XXPART_MAX_PARTS,
6973 GFP_KERNEL);
70− buf = kzalloc(max_bytes_to_read, GFP_KERNEL);
74+ buf = kzalloc(BCM47XXPART_BYTES_TO_READ, GFP_KERNEL);
7175
7276 /* Parse block by block looking for magics */
7377 for (offset = 0; offset <= master->size - blocksize;
@@ -82,7 +86,7 @@ static int bcm47xxpart_parse(struct mtd_info *master, · 8 unmodified lines
8286 }
8387
8488 /* Read beginning of the block */
85− if (mtd_read(master, offset, max_bytes_to_read,
89+ if (mtd_read(master, offset, BCM47XXPART_BYTES_TO_READ,
8690 &bytes_read, (uint8_t *)buf) < 0) {
8791 pr_err("mtd_read error while parsing (offset: 0x%X)!\n",
8892 offset);
@@ -96,20 +100,6 @@ static int bcm47xxpart_parse(struct mtd_info *master, · 7 unmodified lines
96100 continue;
97101 }
98102
99− /* Standard NVRAM */
100− if (buf[0x000 / 4] == NVRAM_HEADER ||
101− buf[0x1000 / 4] == NVRAM_HEADER ||
102− buf[0x8000 / 4] == NVRAM_HEADER ||
103− (blocksize == 0x20000 && (
104− buf[0x10000 / 4] == NVRAM_HEADER ||
105− buf[0x11000 / 4] == NVRAM_HEADER ||
106− buf[0x18000 / 4] == NVRAM_HEADER))) {
107− bcm47xxpart_add_part(&parts[curr_part++], "nvram",
108− offset, 0);
109− offset = rounddown(offset, blocksize);
110− continue;
111− }
112−
113103 /*
114104 * board_data starts with board_id which differs across boards,
115105 * but we can use 'MPFR' (hopefully) magic at 0x100
@@ -178,6 +168,30 @@ static int bcm47xxpart_parse(struct mtd_info *master, · 62 unmodified lines
178168 continue;
179169 }
180170 }
171+
172+ /* Look for NVRAM at the end of the last block. */
173+ for (i = 0; i < ARRAY_SIZE(possible_nvram_sizes); i++) {
174+ if (curr_part > BCM47XXPART_MAX_PARTS) {
175+ pr_warn("Reached maximum number of partitions, scanning stopped!\n");
176+ break;
177+ }
178+
179+ offset = master->size - possible_nvram_sizes[i];
180+ if (mtd_read(master, offset, 0x4, &bytes_read,
181+ (uint8_t *)buf) < 0) {
182+ pr_err("mtd_read error while reading at offset 0x%X!\n",
183+ offset);
184+ continue;
185+ }
186+
187+ /* Standard NVRAM */
188+ if (buf[0] == NVRAM_HEADER) {
189+ bcm47xxpart_add_part(&parts[curr_part++], "nvram",
190+ master->size - blocksize, 0);
191+ break;
192+ }
193+ }
194+
181195 kfree(buf);
182196
183197 /*
drivers/mtd/mtdchar.c+2−57
@@ -1123,33 +1123,6 @@ static unsigned long mtdchar_get_unmapped_area(struct file *file, · 1122 unmodified lines
11231123 }
11241124 #endif
11251125
1126−static inline unsigned long get_vm_size(struct vm_area_struct *vma)
1127−{
1128− return vma->vm_end - vma->vm_start;
1129−}
1130−
1131−static inline resource_size_t get_vm_offset(struct vm_area_struct *vma)
1132−{
1133− return (resource_size_t) vma->vm_pgoff << PAGE_SHIFT;
1134−}
1135−
1136−/*
1137− * Set a new vm offset.
1138− *
1139− * Verify that the incoming offset really works as a page offset,
1140− * and that the offset and size fit in a resource_size_t.
1141− */
1142−static inline int set_vm_offset(struct vm_area_struct *vma, resource_size_t off)
1143−{
1144− pgoff_t pgoff = off >> PAGE_SHIFT;
1145− if (off != (resource_size_t) pgoff << PAGE_SHIFT)
1146− return -EINVAL;
1147− if (off + get_vm_size(vma) - 1 < off)
1148− return -EINVAL;
1149− vma->vm_pgoff = pgoff;
1150− return 0;
1151−}
1152−
11531126 /*
11541127 * set up a mapping for shared memory segments
11551128 */
@@ -1159,45 +1132,17 @@ static int mtdchar_mmap(struct file *file, struct vm_area_struct *vma) · 3 unmodified lines
11591132 struct mtd_file_info *mfi = file->private_data;
11601133 struct mtd_info *mtd = mfi->mtd;
11611134 struct map_info *map = mtd->priv;
1162− resource_size_t start, off;
1163− unsigned long len, vma_len;
11641135
11651136 /* This is broken because it assumes the MTD device is map-based
11661137 and that mtd->priv is a valid struct map_info. It should be
11671138 replaced with something that uses the mtd_get_unmapped_area()
11681139 operation properly. */
11691140 if (0 /*mtd->type == MTD_RAM || mtd->type == MTD_ROM*/) {
1170− off = get_vm_offset(vma);
1171− start = map->phys;
1172− len = PAGE_ALIGN((start & ~PAGE_MASK) + map->size);
1173− start &= PAGE_MASK;
1174− vma_len = get_vm_size(vma);
1175−
1176− /* Overflow in off+len? */
1177− if (vma_len + off < off)
1178− return -EINVAL;
1179− /* Does it fit in the mapping? */
1180− if (vma_len + off > len)
1181− return -EINVAL;
1182−
1183− off += start;
1184− /* Did that overflow? */
1185− if (off < start)
1186− return -EINVAL;
1187− if (set_vm_offset(vma, off) < 0)
1188− return -EINVAL;
1189− vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
1190−
11911141 #ifdef pgprot_noncached
1192− if (file->f_flags & O_DSYNC || off >= __pa(high_memory))
1142+ if (file->f_flags & O_DSYNC || map->phys >= __pa(high_memory))
11931143 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
11941144 #endif
1195− if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
1196− vma->vm_end - vma->vm_start,
1197− vma->vm_page_prot))
1198− return -EAGAIN;
1199−
1200− return 0;
1145+ return vm_iomap_memory(vma, map->phys, map->size);
12011146 }
12021147 return -ENOSYS;
12031148 #else
drivers/mtd/nand/nand_base.c+16−0
@@ -1523,6 +1523,14 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from, · 1522 unmodified lines
15231523 oobreadlen -= toread;
15241524 }
15251525 }
1526+
1527+ if (chip->options & NAND_NEED_READRDY) {
1528+ /* Apply delay or wait for ready/busy pin */
1529+ if (!chip->dev_ready)
1530+ udelay(chip->chip_delay);
1531+ else
1532+ nand_wait_ready(mtd);
1533+ }
15261534 } else {
15271535 memcpy(buf, chip->buffers->databuf + col, bytes);
15281536 buf += bytes;
@@ -1787,6 +1795,14 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from, · 258 unmodified lines
17871795 len = min(len, readlen);
17881796 buf = nand_transfer_oob(chip, buf, ops, len);
17891797
1798+ if (chip->options & NAND_NEED_READRDY) {
1799+ /* Apply delay or wait for ready/busy pin */
1800+ if (!chip->dev_ready)
1801+ udelay(chip->chip_delay);
1802+ else
1803+ nand_wait_ready(mtd);
1804+ }
1805+
17901806 readlen -= len;
17911807 if (!readlen)
17921808 break;
drivers/mtd/nand/nand_ids.c+41−39
@@ -22,49 +22,51 @@ · 21 unmodified lines
2222 * 512 512 Byte page size
2323 */
2424 struct nand_flash_dev nand_flash_ids[] = {
25+#define SP_OPTIONS NAND_NEED_READRDY
26+#define SP_OPTIONS16 (SP_OPTIONS | NAND_BUSWIDTH_16)
2527
2628 #ifdef CONFIG_MTD_NAND_MUSEUM_IDS
27− {"NAND 1MiB 5V 8-bit", 0x6e, 256, 1, 0x1000, 0},
28− {"NAND 2MiB 5V 8-bit", 0x64, 256, 2, 0x1000, 0},
29− {"NAND 4MiB 5V 8-bit", 0x6b, 512, 4, 0x2000, 0},
30− {"NAND 1MiB 3,3V 8-bit", 0xe8, 256, 1, 0x1000, 0},
31− {"NAND 1MiB 3,3V 8-bit", 0xec, 256, 1, 0x1000, 0},
32− {"NAND 2MiB 3,3V 8-bit", 0xea, 256, 2, 0x1000, 0},
33− {"NAND 4MiB 3,3V 8-bit", 0xd5, 512, 4, 0x2000, 0},
34− {"NAND 4MiB 3,3V 8-bit", 0xe3, 512, 4, 0x2000, 0},
35− {"NAND 4MiB 3,3V 8-bit", 0xe5, 512, 4, 0x2000, 0},
36− {"NAND 8MiB 3,3V 8-bit", 0xd6, 512, 8, 0x2000, 0},
37−
38− {"NAND 8MiB 1,8V 8-bit", 0x39, 512, 8, 0x2000, 0},
39− {"NAND 8MiB 3,3V 8-bit", 0xe6, 512, 8, 0x2000, 0},
40− {"NAND 8MiB 1,8V 16-bit", 0x49, 512, 8, 0x2000, NAND_BUSWIDTH_16},
41− {"NAND 8MiB 3,3V 16-bit", 0x59, 512, 8, 0x2000, NAND_BUSWIDTH_16},
29+ {"NAND 1MiB 5V 8-bit", 0x6e, 256, 1, 0x1000, SP_OPTIONS},
30+ {"NAND 2MiB 5V 8-bit", 0x64, 256, 2, 0x1000, SP_OPTIONS},
31+ {"NAND 4MiB 5V 8-bit", 0x6b, 512, 4, 0x2000, SP_OPTIONS},
32+ {"NAND 1MiB 3,3V 8-bit", 0xe8, 256, 1, 0x1000, SP_OPTIONS},
33+ {"NAND 1MiB 3,3V 8-bit", 0xec, 256, 1, 0x1000, SP_OPTIONS},
34+ {"NAND 2MiB 3,3V 8-bit", 0xea, 256, 2, 0x1000, SP_OPTIONS},
35+ {"NAND 4MiB 3,3V 8-bit", 0xd5, 512, 4, 0x2000, SP_OPTIONS},
36+ {"NAND 4MiB 3,3V 8-bit", 0xe3, 512, 4, 0x2000, SP_OPTIONS},
37+ {"NAND 4MiB 3,3V 8-bit", 0xe5, 512, 4, 0x2000, SP_OPTIONS},
38+ {"NAND 8MiB 3,3V 8-bit", 0xd6, 512, 8, 0x2000, SP_OPTIONS},
39+
40+ {"NAND 8MiB 1,8V 8-bit", 0x39, 512, 8, 0x2000, SP_OPTIONS},
41+ {"NAND 8MiB 3,3V 8-bit", 0xe6, 512, 8, 0x2000, SP_OPTIONS},
42+ {"NAND 8MiB 1,8V 16-bit", 0x49, 512, 8, 0x2000, SP_OPTIONS16},
43+ {"NAND 8MiB 3,3V 16-bit", 0x59, 512, 8, 0x2000, SP_OPTIONS16},
4244 #endif
4345
44− {"NAND 16MiB 1,8V 8-bit", 0x33, 512, 16, 0x4000, 0},
45− {"NAND 16MiB 3,3V 8-bit", 0x73, 512, 16, 0x4000, 0},
46− {"NAND 16MiB 1,8V 16-bit", 0x43, 512, 16, 0x4000, NAND_BUSWIDTH_16},
47− {"NAND 16MiB 3,3V 16-bit", 0x53, 512, 16, 0x4000, NAND_BUSWIDTH_16},
48−
49− {"NAND 32MiB 1,8V 8-bit", 0x35, 512, 32, 0x4000, 0},
50− {"NAND 32MiB 3,3V 8-bit", 0x75, 512, 32, 0x4000, 0},
51− {"NAND 32MiB 1,8V 16-bit", 0x45, 512, 32, 0x4000, NAND_BUSWIDTH_16},
52− {"NAND 32MiB 3,3V 16-bit", 0x55, 512, 32, 0x4000, NAND_BUSWIDTH_16},
53−
54− {"NAND 64MiB 1,8V 8-bit", 0x36, 512, 64, 0x4000, 0},
55− {"NAND 64MiB 3,3V 8-bit", 0x76, 512, 64, 0x4000, 0},
56− {"NAND 64MiB 1,8V 16-bit", 0x46, 512, 64, 0x4000, NAND_BUSWIDTH_16},
57− {"NAND 64MiB 3,3V 16-bit", 0x56, 512, 64, 0x4000, NAND_BUSWIDTH_16},
58−
59− {"NAND 128MiB 1,8V 8-bit", 0x78, 512, 128, 0x4000, 0},
60− {"NAND 128MiB 1,8V 8-bit", 0x39, 512, 128, 0x4000, 0},
61− {"NAND 128MiB 3,3V 8-bit", 0x79, 512, 128, 0x4000, 0},
62− {"NAND 128MiB 1,8V 16-bit", 0x72, 512, 128, 0x4000, NAND_BUSWIDTH_16},
63− {"NAND 128MiB 1,8V 16-bit", 0x49, 512, 128, 0x4000, NAND_BUSWIDTH_16},
64− {"NAND 128MiB 3,3V 16-bit", 0x74, 512, 128, 0x4000, NAND_BUSWIDTH_16},
65− {"NAND 128MiB 3,3V 16-bit", 0x59, 512, 128, 0x4000, NAND_BUSWIDTH_16},
66−
67− {"NAND 256MiB 3,3V 8-bit", 0x71, 512, 256, 0x4000, 0},
46+ {"NAND 16MiB 1,8V 8-bit", 0x33, 512, 16, 0x4000, SP_OPTIONS},
47+ {"NAND 16MiB 3,3V 8-bit", 0x73, 512, 16, 0x4000, SP_OPTIONS},
48+ {"NAND 16MiB 1,8V 16-bit", 0x43, 512, 16, 0x4000, SP_OPTIONS16},
49+ {"NAND 16MiB 3,3V 16-bit", 0x53, 512, 16, 0x4000, SP_OPTIONS16},
50+
51+ {"NAND 32MiB 1,8V 8-bit", 0x35, 512, 32, 0x4000, SP_OPTIONS},
52+ {"NAND 32MiB 3,3V 8-bit", 0x75, 512, 32, 0x4000, SP_OPTIONS},
53+ {"NAND 32MiB 1,8V 16-bit", 0x45, 512, 32, 0x4000, SP_OPTIONS16},
54+ {"NAND 32MiB 3,3V 16-bit", 0x55, 512, 32, 0x4000, SP_OPTIONS16},
55+
56+ {"NAND 64MiB 1,8V 8-bit", 0x36, 512, 64, 0x4000, SP_OPTIONS},
57+ {"NAND 64MiB 3,3V 8-bit", 0x76, 512, 64, 0x4000, SP_OPTIONS},
58+ {"NAND 64MiB 1,8V 16-bit", 0x46, 512, 64, 0x4000, SP_OPTIONS16},
59+ {"NAND 64MiB 3,3V 16-bit", 0x56, 512, 64, 0x4000, SP_OPTIONS16},
60+
61+ {"NAND 128MiB 1,8V 8-bit", 0x78, 512, 128, 0x4000, SP_OPTIONS},
62+ {"NAND 128MiB 1,8V 8-bit", 0x39, 512, 128, 0x4000, SP_OPTIONS},
63+ {"NAND 128MiB 3,3V 8-bit", 0x79, 512, 128, 0x4000, SP_OPTIONS},
64+ {"NAND 128MiB 1,8V 16-bit", 0x72, 512, 128, 0x4000, SP_OPTIONS16},
65+ {"NAND 128MiB 1,8V 16-bit", 0x49, 512, 128, 0x4000, SP_OPTIONS16},
66+ {"NAND 128MiB 3,3V 16-bit", 0x74, 512, 128, 0x4000, SP_OPTIONS16},
67+ {"NAND 128MiB 3,3V 16-bit", 0x59, 512, 128, 0x4000, SP_OPTIONS16},
68+
69+ {"NAND 256MiB 3,3V 8-bit", 0x71, 512, 256, 0x4000, SP_OPTIONS},
6870
6971 /*
7072 * These are the new chips with large page size. The pagesize and the
drivers/net/bonding/bond_main.c+75−33
@@ -846,8 +846,10 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, · 845 unmodified lines
846846 if (bond->dev->flags & IFF_ALLMULTI)
847847 dev_set_allmulti(old_active->dev, -1);
848848
849+ netif_addr_lock_bh(bond->dev);
849850 netdev_for_each_mc_addr(ha, bond->dev)
850851 dev_mc_del(old_active->dev, ha->addr);
852+ netif_addr_unlock_bh(bond->dev);
851853 }
852854
853855 if (new_active) {
@@ -858,8 +860,10 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, · 4 unmodified lines
858860 if (bond->dev->flags & IFF_ALLMULTI)
859861 dev_set_allmulti(new_active->dev, 1);
860862
863+ netif_addr_lock_bh(bond->dev);
861864 netdev_for_each_mc_addr(ha, bond->dev)
862865 dev_mc_add(new_active->dev, ha->addr);
866+ netif_addr_unlock_bh(bond->dev);
863867 }
864868 }
865869
@@ -1746,6 +1750,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) · 880 unmodified lines
17461750
17471751 bond_compute_features(bond);
17481752
1753+ bond_update_speed_duplex(new_slave);
1754+
17491755 read_lock(&bond->lock);
17501756
17511757 new_slave->last_arp_rx = jiffies -
@@ -1798,8 +1804,6 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) · 46 unmodified lines
17981804 new_slave->link == BOND_LINK_DOWN ? "DOWN" :
17991805 (new_slave->link == BOND_LINK_UP ? "UP" : "BACK"));
18001806
1801− bond_update_speed_duplex(new_slave);
1802−
18031807 if (USES_PRIMARY(bond->params.mode) && bond->params.primary[0]) {
18041808 /* if there is a primary slave, remember it */
18051809 if (strcmp(bond->params.primary, new_slave->dev->name) == 0) {
@@ -1901,11 +1905,29 @@ err_dest_symlinks: · 95 unmodified lines
19011905 bond_destroy_slave_symlinks(bond_dev, slave_dev);
19021906
19031907 err_detach:
1908+ if (!USES_PRIMARY(bond->params.mode)) {
1909+ netif_addr_lock_bh(bond_dev);
1910+ bond_mc_list_flush(bond_dev, slave_dev);
1911+ netif_addr_unlock_bh(bond_dev);
1912+ }
1913+ bond_del_vlans_from_slave(bond, slave_dev);
19041914 write_lock_bh(&bond->lock);
19051915 bond_detach_slave(bond, new_slave);
1916+ if (bond->primary_slave == new_slave)
1917+ bond->primary_slave = NULL;
19061918 write_unlock_bh(&bond->lock);
1919+ if (bond->curr_active_slave == new_slave) {
1920+ read_lock(&bond->lock);
1921+ write_lock_bh(&bond->curr_slave_lock);
1922+ bond_change_active_slave(bond, NULL);
1923+ bond_select_active_slave(bond);
1924+ write_unlock_bh(&bond->curr_slave_lock);
1925+ read_unlock(&bond->lock);
1926+ }
1927+ slave_disable_netpoll(new_slave);
19071928
19081929 err_close:
1930+ slave_dev->priv_flags &= ~IFF_BONDING;
19091931 dev_close(slave_dev);
19101932
19111933 err_unset_master:
@@ -1976,12 +1998,11 @@ static int __bond_release_one(struct net_device *bond_dev, · 64 unmodified lines
19761998 return -EINVAL;
19771999 }
19782000
2001+ write_unlock_bh(&bond->lock);
19792002 /* unregister rx_handler early so bond_handle_frame wouldn't be called
19802003 * for this slave anymore.
19812004 */
19822005 netdev_rx_handler_unregister(slave_dev);
1983− write_unlock_bh(&bond->lock);
1984− synchronize_net();
19852006 write_lock_bh(&bond->lock);
19862007
19872008 if (!all && !bond->params.fail_over_mac) {
@@ -2374,8 +2395,6 @@ static void bond_miimon_commit(struct bonding *bond) · 386 unmodified lines
23742395 bond_set_backup_slave(slave);
23752396 }
23762397
2377− bond_update_speed_duplex(slave);
2378−
23792398 pr_info("%s: link status definitely up for interface %s, %u Mbps %s duplex.\n",
23802399 bond->dev->name, slave->dev->name,
23812400 slave->speed, slave->duplex ? "full" : "half");
@@ -3171,11 +3190,20 @@ static int bond_slave_netdev_event(unsigned long event, · 789 unmodified lines
31713190 struct net_device *slave_dev)
31723191 {
31733192 struct slave *slave = bond_slave_get_rtnl(slave_dev);
3174− struct bonding *bond = slave->bond;
3175− struct net_device *bond_dev = slave->bond->dev;
3193+ struct bonding *bond;
3194+ struct net_device *bond_dev;
31763195 u32 old_speed;
31773196 u8 old_duplex;
31783197
3198+ /* A netdev event can be generated while enslaving a device
3199+ * before netdev_rx_handler_register is called in which case
3200+ * slave will be NULL
3201+ */
3202+ if (!slave)
3203+ return NOTIFY_DONE;
3204+ bond_dev = slave->bond->dev;
3205+ bond = slave->bond;
3206+
31793207 switch (event) {
31803208 case NETDEV_UNREGISTER:
31813209 if (bond->setup_by_slave)
@@ -3289,20 +3317,22 @@ static int bond_xmit_hash_policy_l2(struct sk_buff *skb, int count) · 107 unmodified lines
32893317 */
32903318 static int bond_xmit_hash_policy_l23(struct sk_buff *skb, int count)
32913319 {
3292− struct ethhdr *data = (struct ethhdr *)skb->data;
3293− struct iphdr *iph;
3294− struct ipv6hdr *ipv6h;
3320+ const struct ethhdr *data;
3321+ const struct iphdr *iph;
3322+ const struct ipv6hdr *ipv6h;
32953323 u32 v6hash;
3296− __be32 *s, *d;
3324+ const __be32 *s, *d;
32973325
32983326 if (skb->protocol == htons(ETH_P_IP) &&
3299− skb_network_header_len(skb) >= sizeof(*iph)) {
3327+ pskb_network_may_pull(skb, sizeof(*iph))) {
33003328 iph = ip_hdr(skb);
3329+ data = (struct ethhdr *)skb->data;
33013330 return ((ntohl(iph->saddr ^ iph->daddr) & 0xffff) ^
33023331 (data->h_dest[5] ^ data->h_source[5])) % count;
33033332 } else if (skb->protocol == htons(ETH_P_IPV6) &&
3304− skb_network_header_len(skb) >= sizeof(*ipv6h)) {
3333+ pskb_network_may_pull(skb, sizeof(*ipv6h))) {
33053334 ipv6h = ipv6_hdr(skb);
3335+ data = (struct ethhdr *)skb->data;
33063336 s = &ipv6h->saddr.s6_addr32[0];
33073337 d = &ipv6h->daddr.s6_addr32[0];
33083338 v6hash = (s[1] ^ d[1]) ^ (s[2] ^ d[2]) ^ (s[3] ^ d[3]);
@@ -3321,33 +3351,36 @@ static int bond_xmit_hash_policy_l23(struct sk_buff *skb, int count) · 12 unmodified lines
33213351 static int bond_xmit_hash_policy_l34(struct sk_buff *skb, int count)
33223352 {
33233353 u32 layer4_xor = 0;
3324− struct iphdr *iph;
3325− struct ipv6hdr *ipv6h;
3326− __be32 *s, *d;
3327− __be16 *layer4hdr;
3354+ const struct iphdr *iph;
3355+ const struct ipv6hdr *ipv6h;
3356+ const __be32 *s, *d;
3357+ const __be16 *l4 = NULL;
3358+ __be16 _l4[2];
3359+ int noff = skb_network_offset(skb);
3360+ int poff;
33283361
33293362 if (skb->protocol == htons(ETH_P_IP) &&
3330− skb_network_header_len(skb) >= sizeof(*iph)) {
3363+ pskb_may_pull(skb, noff + sizeof(*iph))) {
33313364 iph = ip_hdr(skb);
3332− if (!ip_is_fragment(iph) &&
3333− (iph->protocol == IPPROTO_TCP ||
3334− iph->protocol == IPPROTO_UDP) &&
3335− (skb_headlen(skb) - skb_network_offset(skb) >=
3336− iph->ihl * sizeof(u32) + sizeof(*layer4hdr) * 2)) {
3337− layer4hdr = (__be16 *)((u32 *)iph + iph->ihl);
3338− layer4_xor = ntohs(*layer4hdr ^ *(layer4hdr + 1));
3365+ poff = proto_ports_offset(iph->protocol);
3366+
3367+ if (!ip_is_fragment(iph) && poff >= 0) {
3368+ l4 = skb_header_pointer(skb, noff + (iph->ihl << 2) + poff,
3369+ sizeof(_l4), &_l4);
3370+ if (l4)
3371+ layer4_xor = ntohs(l4[0] ^ l4[1]);
33393372 }
33403373 return (layer4_xor ^
33413374 ((ntohl(iph->saddr ^ iph->daddr)) & 0xffff)) % count;
33423375 } else if (skb->protocol == htons(ETH_P_IPV6) &&
3343− skb_network_header_len(skb) >= sizeof(*ipv6h)) {
3376+ pskb_may_pull(skb, noff + sizeof(*ipv6h))) {
33443377 ipv6h = ipv6_hdr(skb);
3345− if ((ipv6h->nexthdr == IPPROTO_TCP ||
3346− ipv6h->nexthdr == IPPROTO_UDP) &&
3347− (skb_headlen(skb) - skb_network_offset(skb) >=
3348− sizeof(*ipv6h) + sizeof(*layer4hdr) * 2)) {
3349− layer4hdr = (__be16 *)(ipv6h + 1);
3350− layer4_xor = ntohs(*layer4hdr ^ *(layer4hdr + 1));
3378+ poff = proto_ports_offset(ipv6h->nexthdr);
3379+ if (poff >= 0) {
3380+ l4 = skb_header_pointer(skb, noff + sizeof(*ipv6h) + poff,
3381+ sizeof(_l4), &_l4);
3382+ if (l4)
3383+ layer4_xor = ntohs(l4[0] ^ l4[1]);
33513384 }
33523385 s = &ipv6h->saddr.s6_addr32[0];
33533386 d = &ipv6h->daddr.s6_addr32[0];
@@ -4849,9 +4882,18 @@ static int __net_init bond_net_init(struct net *net) · 1495 unmodified lines
48494882 static void __net_exit bond_net_exit(struct net *net)
48504883 {
48514884 struct bond_net *bn = net_generic(net, bond_net_id);
4885+ struct bonding *bond, *tmp_bond;
4886+ LIST_HEAD(list);
48524887
48534888 bond_destroy_sysfs(bn);
48544889 bond_destroy_proc_dir(bn);
4890+
4891+ /* Kill off any bonds created after unregistering bond rtnl ops */
4892+ rtnl_lock();
4893+ list_for_each_entry_safe(bond, tmp_bond, &bn->dev_list, bond_list)
4894+ unregister_netdevice_queue(bond->dev, &list);
4895+ unregister_netdevice_many(&list);
4896+ rtnl_unlock();
48554897 }
48564898
48574899 static struct pernet_operations bond_net_ops = {
drivers/net/bonding/bond_sysfs.c+53−44
@@ -183,6 +183,11 @@ int bond_create_slave_symlinks(struct net_device *master, · 182 unmodified lines
183183 sprintf(linkname, "slave_%s", slave->name);
184184 ret = sysfs_create_link(&(master->dev.kobj), &(slave->dev.kobj),
185185 linkname);
186+
187+ /* free the master link created earlier in case of error */
188+ if (ret)
189+ sysfs_remove_link(&(slave->dev.kobj), "master");
190+
186191 return ret;
187192
188193 }
@@ -522,7 +527,7 @@ static ssize_t bonding_store_arp_interval(struct device *d, · 333 unmodified lines
522527 goto out;
523528 }
524529 if (new_value < 0) {
525− pr_err("%s: Invalid arp_interval value %d not in range 1-%d; rejected.\n",
530+ pr_err("%s: Invalid arp_interval value %d not in range 0-%d; rejected.\n",
526531 bond->dev->name, new_value, INT_MAX);
527532 ret = -EINVAL;
528533 goto out;
@@ -537,14 +542,15 @@ static ssize_t bonding_store_arp_interval(struct device *d, · 8 unmodified lines
537542 pr_info("%s: Setting ARP monitoring interval to %d.\n",
538543 bond->dev->name, new_value);
539544 bond->params.arp_interval = new_value;
540− if (bond->params.miimon) {
541− pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring.\n",
542− bond->dev->name, bond->dev->name);
543− bond->params.miimon = 0;
544− }
545− if (!bond->params.arp_targets[0]) {
546− pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified.\n",
547− bond->dev->name);
545+ if (new_value) {
546+ if (bond->params.miimon) {
547+ pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring.\n",
548+ bond->dev->name, bond->dev->name);
549+ bond->params.miimon = 0;
550+ }
551+ if (!bond->params.arp_targets[0])
552+ pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified.\n",
553+ bond->dev->name);
548554 }
549555 if (bond->dev->flags & IFF_UP) {
550556 /* If the interface is up, we may need to fire off
@@ -552,10 +558,13 @@ static ssize_t bonding_store_arp_interval(struct device *d, · 1 unmodified line
552558 * timer will get fired off when the open function
553559 * is called.
554560 */
555− cancel_delayed_work_sync(&bond->mii_work);
556− queue_delayed_work(bond->wq, &bond->arp_work, 0);
561+ if (!new_value) {
562+ cancel_delayed_work_sync(&bond->arp_work);
563+ } else {
564+ cancel_delayed_work_sync(&bond->mii_work);
565+ queue_delayed_work(bond->wq, &bond->arp_work, 0);
566+ }
557567 }
558−
559568 out:
560569 rtnl_unlock();
561570 return ret;
@@ -697,7 +706,7 @@ static ssize_t bonding_store_downdelay(struct device *d, · 135 unmodified lines
697706 }
698707 if (new_value < 0) {
699708 pr_err("%s: Invalid down delay value %d not in range %d-%d; rejected.\n",
700− bond->dev->name, new_value, 1, INT_MAX);
709+ bond->dev->name, new_value, 0, INT_MAX);
701710 ret = -EINVAL;
702711 goto out;
703712 } else {
@@ -752,8 +761,8 @@ static ssize_t bonding_store_updelay(struct device *d, · 48 unmodified lines
752761 goto out;
753762 }
754763 if (new_value < 0) {
755− pr_err("%s: Invalid down delay value %d not in range %d-%d; rejected.\n",
756− bond->dev->name, new_value, 1, INT_MAX);
764+ pr_err("%s: Invalid up delay value %d not in range %d-%d; rejected.\n",
765+ bond->dev->name, new_value, 0, INT_MAX);
757766 ret = -EINVAL;
758767 goto out;
759768 } else {
@@ -963,37 +972,37 @@ static ssize_t bonding_store_miimon(struct device *d, · 203 unmodified lines
963972 }
964973 if (new_value < 0) {
965974 pr_err("%s: Invalid miimon value %d not in range %d-%d; rejected.\n",
966− bond->dev->name, new_value, 1, INT_MAX);
975+ bond->dev->name, new_value, 0, INT_MAX);
967976 ret = -EINVAL;
968977 goto out;
969− } else {
970− pr_info("%s: Setting MII monitoring interval to %d.\n",
971− bond->dev->name, new_value);
972− bond->params.miimon = new_value;
973− if (bond->params.updelay)
974− pr_info("%s: Note: Updating updelay (to %d) since it is a multiple of the miimon value.\n",
975− bond->dev->name,
976− bond->params.updelay * bond->params.miimon);
977− if (bond->params.downdelay)
978− pr_info("%s: Note: Updating downdelay (to %d) since it is a multiple of the miimon value.\n",
979− bond->dev->name,
980− bond->params.downdelay * bond->params.miimon);
981− if (bond->params.arp_interval) {
982− pr_info("%s: MII monitoring cannot be used with ARP monitoring. Disabling ARP monitoring...\n",
983− bond->dev->name);
984− bond->params.arp_interval = 0;
985− if (bond->params.arp_validate) {
986− bond->params.arp_validate =
987− BOND_ARP_VALIDATE_NONE;
988− }
989− }
990−
991− if (bond->dev->flags & IFF_UP) {
992− /* If the interface is up, we may need to fire off
993− * the MII timer. If the interface is down, the
994− * timer will get fired off when the open function
995− * is called.
996− */
978+ }
979+ pr_info("%s: Setting MII monitoring interval to %d.\n",
980+ bond->dev->name, new_value);
981+ bond->params.miimon = new_value;
982+ if (bond->params.updelay)
983+ pr_info("%s: Note: Updating updelay (to %d) since it is a multiple of the miimon value.\n",
984+ bond->dev->name,
985+ bond->params.updelay * bond->params.miimon);
986+ if (bond->params.downdelay)
987+ pr_info("%s: Note: Updating downdelay (to %d) since it is a multiple of the miimon value.\n",
988+ bond->dev->name,
989+ bond->params.downdelay * bond->params.miimon);
990+ if (new_value && bond->params.arp_interval) {
991+ pr_info("%s: MII monitoring cannot be used with ARP monitoring. Disabling ARP monitoring...\n",
992+ bond->dev->name);
993+ bond->params.arp_interval = 0;
994+ if (bond->params.arp_validate)
995+ bond->params.arp_validate = BOND_ARP_VALIDATE_NONE;
996+ }
997+ if (bond->dev->flags & IFF_UP) {
998+ /* If the interface is up, we may need to fire off
999+ * the MII timer. If the interface is down, the
1000+ * timer will get fired off when the open function
1001+ * is called.
1002+ */
1003+ if (!new_value) {
1004+ cancel_delayed_work_sync(&bond->mii_work);
1005+ } else {
9971006 cancel_delayed_work_sync(&bond->arp_work);
9981007 queue_delayed_work(bond->wq, &bond->mii_work, 0);
9991008 }
drivers/net/can/mcp251x.c+8−2
@@ -929,6 +929,7 @@ static int mcp251x_open(struct net_device *net) · 928 unmodified lines
929929 struct mcp251x_priv *priv = netdev_priv(net);
930930 struct spi_device *spi = priv->spi;
931931 struct mcp251x_platform_data *pdata = spi->dev.platform_data;
932+ unsigned long flags;
932933 int ret;
933934
934935 ret = open_candev(net);
@@ -945,9 +946,14 @@ static int mcp251x_open(struct net_device *net) · 10 unmodified lines
945946 priv->tx_skb = NULL;
946947 priv->tx_len = 0;
947948
949+ flags = IRQF_ONESHOT;
950+ if (pdata->irq_flags)
951+ flags |= pdata->irq_flags;
952+ else
953+ flags |= IRQF_TRIGGER_FALLING;
954+
948955 ret = request_threaded_irq(spi->irq, NULL, mcp251x_can_ist,
949− pdata->irq_flags ? pdata->irq_flags : IRQF_TRIGGER_FALLING,
950− DEVICE_NAME, priv);
956+ flags, DEVICE_NAME, priv);
951957 if (ret) {
952958 dev_err(&spi->dev, "failed to acquire irq %d\n", spi->irq);
953959 if (pdata->transceiver_enable)
drivers/net/can/sja1000/Kconfig+1−0
@@ -46,6 +46,7 @@ config CAN_EMS_PCI · 45 unmodified lines
4646 config CAN_PEAK_PCMCIA
4747 tristate "PEAK PCAN-PC Card"
4848 depends on PCMCIA
49+ depends on HAS_IOPORT
4950 ---help---
5051 This driver is for the PCAN-PC Card PCMCIA adapter (1 or 2 channels)
5152 from PEAK-System (http://www.peak-system.com). To compile this
drivers/net/can/sja1000/plx_pci.c+2−2
@@ -348,7 +348,7 @@ static inline int plx_pci_check_sja1000(const struct sja1000_priv *priv) · 347 unmodified lines
348348 */
349349 if ((priv->read_reg(priv, REG_CR) & REG_CR_BASICCAN_INITIAL_MASK) ==
350350 REG_CR_BASICCAN_INITIAL &&
351− (priv->read_reg(priv, REG_SR) == REG_SR_BASICCAN_INITIAL) &&
351+ (priv->read_reg(priv, SJA1000_REG_SR) == REG_SR_BASICCAN_INITIAL) &&
352352 (priv->read_reg(priv, REG_IR) == REG_IR_BASICCAN_INITIAL))
353353 flag = 1;
354354
@@ -360,7 +360,7 @@ static inline int plx_pci_check_sja1000(const struct sja1000_priv *priv) · 5 unmodified lines
360360 * See states on p. 23 of the Datasheet.
361361 */
362362 if (priv->read_reg(priv, REG_MOD) == REG_MOD_PELICAN_INITIAL &&
363− priv->read_reg(priv, REG_SR) == REG_SR_PELICAN_INITIAL &&
363+ priv->read_reg(priv, SJA1000_REG_SR) == REG_SR_PELICAN_INITIAL &&
364364 priv->read_reg(priv, REG_IR) == REG_IR_PELICAN_INITIAL)
365365 return flag;
366366
drivers/net/can/sja1000/sja1000.c+3−3
@@ -92,7 +92,7 @@ static void sja1000_write_cmdreg(struct sja1000_priv *priv, u8 val) · 91 unmodified lines
9292 */
9393 spin_lock_irqsave(&priv->cmdreg_lock, flags);
9494 priv->write_reg(priv, REG_CMR, val);
95− priv->read_reg(priv, REG_SR);
95+ priv->read_reg(priv, SJA1000_REG_SR);
9696 spin_unlock_irqrestore(&priv->cmdreg_lock, flags);
9797 }
9898
@@ -502,7 +502,7 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id) · 403 unmodified lines
502502
503503 while ((isrc = priv->read_reg(priv, REG_IR)) && (n < SJA1000_MAX_IRQ)) {
504504 n++;
505− status = priv->read_reg(priv, REG_SR);
505+ status = priv->read_reg(priv, SJA1000_REG_SR);
506506 /* check for absent controller due to hw unplug */
507507 if (status == 0xFF && sja1000_is_absent(priv))
508508 return IRQ_NONE;
@@ -530,7 +530,7 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id) · 21 unmodified lines
530530 /* receive interrupt */
531531 while (status & SR_RBS) {
532532 sja1000_rx(dev);
533− status = priv->read_reg(priv, REG_SR);
533+ status = priv->read_reg(priv, SJA1000_REG_SR);
534534 /* check for absent controller */
535535 if (status == 0xFF && sja1000_is_absent(priv))
536536 return IRQ_NONE;
drivers/net/can/sja1000/sja1000.h+1−1
@@ -56,7 +56,7 @@ · 55 unmodified lines
5656 /* SJA1000 registers - manual section 6.4 (Pelican Mode) */
5757 #define REG_MOD 0x00
5858 #define REG_CMR 0x01
59−#define REG_SR 0x02
59+#define SJA1000_REG_SR 0x02
6060 #define REG_IR 0x03
6161 #define REG_IER 0x04
6262 #define REG_ALC 0x0B
drivers/net/can/sja1000/sja1000_of_platform.c+15−16
@@ -96,8 +96,8 @@ static int sja1000_ofp_probe(struct platform_device *ofdev) · 95 unmodified lines
9696 struct net_device *dev;
9797 struct sja1000_priv *priv;
9898 struct resource res;
99− const u32 *prop;
100− int err, irq, res_size, prop_size;
99+ u32 prop;
100+ int err, irq, res_size;
101101 void __iomem *base;
102102
103103 err = of_address_to_resource(np, 0, &res);
@@ -138,27 +138,27 @@ static int sja1000_ofp_probe(struct platform_device *ofdev) · 34 unmodified lines
138138 priv->read_reg = sja1000_ofp_read_reg;
139139 priv->write_reg = sja1000_ofp_write_reg;
140140
141− prop = of_get_property(np, "nxp,external-clock-frequency", &prop_size);
142− if (prop && (prop_size == sizeof(u32)))
143− priv->can.clock.freq = *prop / 2;
141+ err = of_property_read_u32(np, "nxp,external-clock-frequency", &prop);
142+ if (!err)
143+ priv->can.clock.freq = prop / 2;
144144 else
145145 priv->can.clock.freq = SJA1000_OFP_CAN_CLOCK; /* default */
146146
147− prop = of_get_property(np, "nxp,tx-output-mode", &prop_size);
148− if (prop && (prop_size == sizeof(u32)))
149− priv->ocr |= *prop & OCR_MODE_MASK;
147+ err = of_property_read_u32(np, "nxp,tx-output-mode", &prop);
148+ if (!err)
149+ priv->ocr |= prop & OCR_MODE_MASK;
150150 else
151151 priv->ocr |= OCR_MODE_NORMAL; /* default */
152152
153− prop = of_get_property(np, "nxp,tx-output-config", &prop_size);
154− if (prop && (prop_size == sizeof(u32)))
155− priv->ocr |= (*prop << OCR_TX_SHIFT) & OCR_TX_MASK;
153+ err = of_property_read_u32(np, "nxp,tx-output-config", &prop);
154+ if (!err)
155+ priv->ocr |= (prop << OCR_TX_SHIFT) & OCR_TX_MASK;
156156 else
157157 priv->ocr |= OCR_TX0_PULLDOWN; /* default */
158158
159− prop = of_get_property(np, "nxp,clock-out-frequency", &prop_size);
160− if (prop && (prop_size == sizeof(u32)) && *prop) {
161− u32 divider = priv->can.clock.freq * 2 / *prop;
159+ err = of_property_read_u32(np, "nxp,clock-out-frequency", &prop);
160+ if (!err && prop) {
161+ u32 divider = priv->can.clock.freq * 2 / prop;
162162
163163 if (divider > 1)
164164 priv->cdr |= divider / 2 - 1;
@@ -168,8 +168,7 @@ static int sja1000_ofp_probe(struct platform_device *ofdev) · 3 unmodified lines
168168 priv->cdr |= CDR_CLK_OFF; /* default */
169169 }
170170
171− prop = of_get_property(np, "nxp,no-comparator-bypass", NULL);
172− if (!prop)
171+ if (!of_property_read_bool(np, "nxp,no-comparator-bypass"))
173172 priv->cdr |= CDR_CBP; /* default */
174173
175174 priv->irq_flags = IRQF_SHARED;
drivers/net/ethernet/8390/ax88796.c+1−1
@@ -828,7 +828,7 @@ static int ax_probe(struct platform_device *pdev) · 827 unmodified lines
828828 struct ei_device *ei_local;
829829 struct ax_device *ax;
830830 struct resource *irq, *mem, *mem2;
831− resource_size_t mem_size, mem2_size = 0;
831+ unsigned long mem_size, mem2_size = 0;
832832 int ret = 0;
833833
834834 dev = ax__alloc_ei_netdev(sizeof(struct ax_device));
drivers/net/ethernet/atheros/atl1e/atl1e.h+1−2
@@ -186,7 +186,7 @@ struct atl1e_tpd_desc { · 185 unmodified lines
186186 /* how about 0x2000 */
187187 #define MAX_TX_BUF_LEN 0x2000
188188 #define MAX_TX_BUF_SHIFT 13
189−/*#define MAX_TX_BUF_LEN 0x3000 */
189+#define MAX_TSO_SEG_SIZE 0x3c00
190190
191191 /* rrs word 1 bit 0:31 */
192192 #define RRS_RX_CSUM_MASK 0xFFFF
@@ -438,7 +438,6 @@ struct atl1e_adapter { · 245 unmodified lines
438438 struct atl1e_hw hw;
439439 struct atl1e_hw_stats hw_stats;
440440
441− bool have_msi;
442441 u32 wol;
443442 u16 link_speed;
444443 u16 link_duplex;
drivers/net/ethernet/atheros/atl1e/atl1e_main.c+3−17
@@ -1849,34 +1849,19 @@ static void atl1e_free_irq(struct atl1e_adapter *adapter) · 1848 unmodified lines
18491849 struct net_device *netdev = adapter->netdev;
18501850
18511851 free_irq(adapter->pdev->irq, netdev);
1852−
1853− if (adapter->have_msi)
1854− pci_disable_msi(adapter->pdev);
18551852 }
18561853
18571854 static int atl1e_request_irq(struct atl1e_adapter *adapter)
18581855 {
18591856 struct pci_dev *pdev = adapter->pdev;
18601857 struct net_device *netdev = adapter->netdev;
1861− int flags = 0;
18621858 int err = 0;
18631859
1864− adapter->have_msi = true;
1865− err = pci_enable_msi(pdev);
1866− if (err) {
1867− netdev_dbg(netdev,
1868− "Unable to allocate MSI interrupt Error: %d\n", err);
1869− adapter->have_msi = false;
1870− }
1871−
1872− if (!adapter->have_msi)
1873− flags |= IRQF_SHARED;
1874− err = request_irq(pdev->irq, atl1e_intr, flags, netdev->name, netdev);
1860+ err = request_irq(pdev->irq, atl1e_intr, IRQF_SHARED, netdev->name,
1861+ netdev);
18751862 if (err) {
18761863 netdev_dbg(adapter->netdev,
18771864 "Unable to allocate interrupt Error: %d\n", err);
1878− if (adapter->have_msi)
1879− pci_disable_msi(pdev);
18801865 return err;
18811866 }
18821867 netdev_dbg(netdev, "atl1e_request_irq OK\n");
@@ -2344,6 +2329,7 @@ static int atl1e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 461 unmodified lines
23442329
23452330 INIT_WORK(&adapter->reset_task, atl1e_reset_task);
23462331 INIT_WORK(&adapter->link_chg_task, atl1e_link_chg_task);
2332+ netif_set_gso_max_size(netdev, MAX_TSO_SEG_SIZE);
23472333 err = register_netdev(netdev);
23482334 if (err) {
23492335 netdev_err(netdev, "register netdevice failed\n");
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c+6−2
@@ -2614,6 +2614,9 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 2613 unmodified lines
26142614 }
26152615 }
26162616
2617+ /* initialize FW coalescing state machines in RAM */
2618+ bnx2x_update_coalesce(bp);
2619+
26172620 /* setup the leading queue */
26182621 rc = bnx2x_setup_leading(bp);
26192622 if (rc) {
@@ -2760,6 +2763,7 @@ load_error2: · 140 unmodified lines
27602763 bp->port.pmf = 0;
27612764 load_error1:
27622765 bnx2x_napi_disable(bp);
2766+ bnx2x_del_all_napi(bp);
27632767
27642768 /* clear pf_load status, as it was already set */
27652769 if (IS_PF(bp))
@@ -4579,11 +4583,11 @@ static void storm_memset_hc_disable(struct bnx2x *bp, u8 port, · 1813 unmodified lines
45794583 u32 enable_flag = disable ? 0 : (1 << HC_INDEX_DATA_HC_ENABLED_SHIFT);
45804584 u32 addr = BAR_CSTRORM_INTMEM +
45814585 CSTORM_STATUS_BLOCK_DATA_FLAGS_OFFSET(fw_sb_id, sb_index);
4582− u16 flags = REG_RD16(bp, addr);
4586+ u8 flags = REG_RD8(bp, addr);
45834587 /* clear and set */
45844588 flags &= ~HC_INDEX_DATA_HC_ENABLED;
45854589 flags |= enable_flag;
4586− REG_WR16(bp, addr, flags);
4590+ REG_WR8(bp, addr, flags);
45874591 DP(NETIF_MSG_IFUP,
45884592 "port %x fw_sb_id %d sb_index %d disable %d\n",
45894593 port, fw_sb_id, sb_index, disable);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c+9−9
@@ -2139,12 +2139,12 @@ static u8 bnx2x_dcbnl_get_cap(struct net_device *netdev, int capid, u8 *cap) · 2138 unmodified lines
21392139 break;
21402140 default:
21412141 BNX2X_ERR("Non valid capability ID\n");
2142− rval = -EINVAL;
2142+ rval = 1;
21432143 break;
21442144 }
21452145 } else {
21462146 DP(BNX2X_MSG_DCB, "DCB disabled\n");
2147− rval = -EINVAL;
2147+ rval = 1;
21482148 }
21492149
21502150 DP(BNX2X_MSG_DCB, "capid %d:%x\n", capid, *cap);
@@ -2170,12 +2170,12 @@ static int bnx2x_dcbnl_get_numtcs(struct net_device *netdev, int tcid, u8 *num) · 19 unmodified lines
21702170 break;
21712171 default:
21722172 BNX2X_ERR("Non valid TC-ID\n");
2173− rval = -EINVAL;
2173+ rval = 1;
21742174 break;
21752175 }
21762176 } else {
21772177 DP(BNX2X_MSG_DCB, "DCB disabled\n");
2178− rval = -EINVAL;
2178+ rval = 1;
21792179 }
21802180
21812181 return rval;
@@ -2188,7 +2188,7 @@ static int bnx2x_dcbnl_set_numtcs(struct net_device *netdev, int tcid, u8 num) · 6 unmodified lines
21882188 return -EINVAL;
21892189 }
21902190
2191−static u8 bnx2x_dcbnl_get_pfc_state(struct net_device *netdev)
2191+static u8 bnx2x_dcbnl_get_pfc_state(struct net_device *netdev)
21922192 {
21932193 struct bnx2x *bp = netdev_priv(netdev);
21942194 DP(BNX2X_MSG_DCB, "state = %d\n", bp->dcbx_local_feat.pfc.enabled);
@@ -2390,12 +2390,12 @@ static u8 bnx2x_dcbnl_get_featcfg(struct net_device *netdev, int featid, · 195 unmodified lines
23902390 break;
23912391 default:
23922392 BNX2X_ERR("Non valid featrue-ID\n");
2393− rval = -EINVAL;
2393+ rval = 1;
23942394 break;
23952395 }
23962396 } else {
23972397 DP(BNX2X_MSG_DCB, "DCB disabled\n");
2398− rval = -EINVAL;
2398+ rval = 1;
23992399 }
24002400
24012401 return rval;
@@ -2431,12 +2431,12 @@ static u8 bnx2x_dcbnl_set_featcfg(struct net_device *netdev, int featid, · 29 unmodified lines
24312431 break;
24322432 default:
24332433 BNX2X_ERR("Non valid featrue-ID\n");
2434− rval = -EINVAL;
2434+ rval = 1;
24352435 break;
24362436 }
24372437 } else {
24382438 DP(BNX2X_MSG_DCB, "dcbnl call not valid\n");
2439− rval = -EINVAL;
2439+ rval = 1;
24402440 }
24412441
24422442 return rval;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c+11−7
@@ -13437,13 +13437,7 @@ static void bnx2x_check_kr2_wa(struct link_params *params, · 13436 unmodified lines
1343713437 {
1343813438 struct bnx2x *bp = params->bp;
1343913439 u16 base_page, next_page, not_kr2_device, lane;
13440− int sigdet = bnx2x_warpcore_get_sigdet(phy, params);
13441−
13442− if (!sigdet) {
13443− if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE))
13444− bnx2x_kr2_recovery(params, vars, phy);
13445− return;
13446− }
13440+ int sigdet;
1344713441
1344813442 /* Once KR2 was disabled, wait 5 seconds before checking KR2 recovery
1344913443 * since some switches tend to reinit the AN process and clear the
@@ -13454,6 +13448,16 @@ static void bnx2x_check_kr2_wa(struct link_params *params, · 4 unmodified lines
1345413448 vars->check_kr2_recovery_cnt--;
1345513449 return;
1345613450 }
13451+
13452+ sigdet = bnx2x_warpcore_get_sigdet(phy, params);
13453+ if (!sigdet) {
13454+ if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE)) {
13455+ bnx2x_kr2_recovery(params, vars, phy);
13456+ DP(NETIF_MSG_LINK, "No sigdet\n");
13457+ }
13458+ return;
13459+ }
13460+
1345713461 lane = bnx2x_get_warpcore_lane(phy, params);
1345813462 CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,
1345913463 MDIO_AER_BLOCK_AER_REG, lane);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+6−1
@@ -4947,7 +4947,7 @@ static void bnx2x_after_function_update(struct bnx2x *bp) · 4946 unmodified lines
49474947 q);
49484948 }
49494949
4950− if (!NO_FCOE(bp)) {
4950+ if (!NO_FCOE(bp) && CNIC_ENABLED(bp)) {
49514951 fp = &bp->fp[FCOE_IDX(bp)];
49524952 queue_params.q_obj = &bnx2x_sp_obj(bp, fp).q_obj;
49534953
@@ -9878,6 +9878,10 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp) · 4924 unmodified lines
98789878 REG_RD(bp, NIG_REG_NIG_INT_STS_CLR_0);
98799879 }
98809880 }
9881+ if (!CHIP_IS_E1x(bp))
9882+ /* block FW from writing to host */
9883+ REG_WR(bp, PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER, 0);
9884+
98819885 /* wait until BRB is empty */
98829886 tmp_reg = REG_RD(bp, BRB1_REG_NUM_OF_FULL_BLOCKS);
98839887 while (timer_count) {
@@ -13354,6 +13358,7 @@ static int bnx2x_unregister_cnic(struct net_device *dev) · 3470 unmodified lines
1335413358 RCU_INIT_POINTER(bp->cnic_ops, NULL);
1335513359 mutex_unlock(&bp->cnic_mutex);
1335613360 synchronize_rcu();
13361+ bp->cnic_enabled = false;
1335713362 kfree(bp->cnic_kwq);
1335813363 bp->cnic_kwq = NULL;
1335913364
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h+2−1
@@ -459,8 +459,9 @@ struct bnx2x_fw_port_stats_old { · 458 unmodified lines
459459
460460 #define UPDATE_QSTAT(s, t) \
461461 do { \
462− qstats->t##_hi = qstats_old->t##_hi + le32_to_cpu(s.hi); \
463462 qstats->t##_lo = qstats_old->t##_lo + le32_to_cpu(s.lo); \
463+ qstats->t##_hi = qstats_old->t##_hi + le32_to_cpu(s.hi) \
464+ + ((qstats->t##_lo < qstats_old->t##_lo) ? 1 : 0); \
464465 } while (0)
465466
466467 #define UPDATE_QSTAT_OLD(f) \
drivers/net/ethernet/broadcom/tg3.c+13−2
@@ -4130,6 +4130,14 @@ static void tg3_phy_copper_begin(struct tg3 *tp) · 4129 unmodified lines
41304130 tp->link_config.active_speed = tp->link_config.speed;
41314131 tp->link_config.active_duplex = tp->link_config.duplex;
41324132
4133+ if (tg3_asic_rev(tp) == ASIC_REV_5714) {
4134+ /* With autoneg disabled, 5715 only links up when the
4135+ * advertisement register has the configured speed
4136+ * enabled.
4137+ */
4138+ tg3_writephy(tp, MII_ADVERTISE, ADVERTISE_ALL);
4139+ }
4140+
41334141 bmcr = 0;
41344142 switch (tp->link_config.speed) {
41354143 default:
@@ -14596,8 +14604,11 @@ static void tg3_read_vpd(struct tg3 *tp) · 10460 unmodified lines
1459614604 if (j + len > block_end)
1459714605 goto partno;
1459814606
14599− memcpy(tp->fw_ver, &vpd_data[j], len);
14600− strncat(tp->fw_ver, " bc ", vpdlen - len - 1);
14607+ if (len >= sizeof(tp->fw_ver))
14608+ len = sizeof(tp->fw_ver) - 1;
14609+ memset(tp->fw_ver, 0, sizeof(tp->fw_ver));
14610+ snprintf(tp->fw_ver, sizeof(tp->fw_ver), "%.*s bc ", len,
14611+ &vpd_data[j]);
1460114612 }
1460214613
1460314614 partno:
drivers/net/ethernet/calxeda/xgmac.c+8−1
@@ -163,6 +163,7 @@ · 162 unmodified lines
163163 #define XGMAC_FLOW_CTRL_FCB_BPA 0x00000001 /* Flow Control Busy ... */
164164
165165 /* XGMAC_INT_STAT reg */
166+#define XGMAC_INT_STAT_PMTIM 0x00800000 /* PMT Interrupt Mask */
166167 #define XGMAC_INT_STAT_PMT 0x0080 /* PMT Interrupt Status */
167168 #define XGMAC_INT_STAT_LPI 0x0040 /* LPI Interrupt Status */
168169
@@ -960,6 +961,9 @@ static int xgmac_hw_init(struct net_device *dev) · 791 unmodified lines
960961 writel(DMA_INTR_DEFAULT_MASK, ioaddr + XGMAC_DMA_STATUS);
961962 writel(DMA_INTR_DEFAULT_MASK, ioaddr + XGMAC_DMA_INTR_ENA);
962963
964+ /* Mask power mgt interrupt */
965+ writel(XGMAC_INT_STAT_PMTIM, ioaddr + XGMAC_INT_STAT);
966+
963967 /* XGMAC requires AXI bus init. This is a 'magic number' for now */
964968 writel(0x0077000E, ioaddr + XGMAC_DMA_AXI_BUS);
965969
@@ -1141,6 +1145,9 @@ static int xgmac_rx(struct xgmac_priv *priv, int limit) · 175 unmodified lines
11411145 struct sk_buff *skb;
11421146 int frame_len;
11431147
1148+ if (!dma_ring_cnt(priv->rx_head, priv->rx_tail, DMA_RX_RING_SZ))
1149+ break;
1150+
11441151 entry = priv->rx_tail;
11451152 p = priv->dma_rx + entry;
11461153 if (desc_get_owner(p))
@@ -1825,7 +1832,7 @@ static void xgmac_pmt(void __iomem *ioaddr, unsigned long mode) · 678 unmodified lines
18251832 unsigned int pmt = 0;
18261833
18271834 if (mode & WAKE_MAGIC)
1828− pmt |= XGMAC_PMT_POWERDOWN | XGMAC_PMT_MAGIC_PKT;
1835+ pmt |= XGMAC_PMT_POWERDOWN | XGMAC_PMT_MAGIC_PKT_EN;
18291836 if (mode & WAKE_UCAST)
18301837 pmt |= XGMAC_PMT_POWERDOWN | XGMAC_PMT_GLBL_UNICAST;
18311838
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c+9−3
@@ -497,8 +497,9 @@ int t4_memory_write(struct adapter *adap, int mtype, u32 addr, u32 len, · 496 unmodified lines
497497 }
498498
499499 #define EEPROM_STAT_ADDR 0x7bfc
500−#define VPD_BASE 0
501500 #define VPD_LEN 512
501+#define VPD_BASE 0x400
502+#define VPD_BASE_OLD 0
502503
503504 /**
504505 * t4_seeprom_wp - enable/disable EEPROM write protection
@@ -524,7 +525,7 @@ int t4_seeprom_wp(struct adapter *adapter, bool enable) · 19 unmodified lines
524525 int get_vpd_params(struct adapter *adapter, struct vpd_params *p)
525526 {
526527 u32 cclk_param, cclk_val;
527− int i, ret;
528+ int i, ret, addr;
528529 int ec, sn;
529530 u8 *vpd, csum;
530531 unsigned int vpdr_len, kw_offset, id_len;
@@ -533,7 +534,12 @@ int get_vpd_params(struct adapter *adapter, struct vpd_params *p) · 2 unmodified lines
533534 if (!vpd)
534535 return -ENOMEM;
535536
536− ret = pci_read_vpd(adapter->pdev, VPD_BASE, VPD_LEN, vpd);
537+ ret = pci_read_vpd(adapter->pdev, VPD_BASE, sizeof(u32), vpd);
538+ if (ret < 0)
539+ goto out;
540+ addr = *vpd == 0x82 ? VPD_BASE : VPD_BASE_OLD;
541+
542+ ret = pci_read_vpd(adapter->pdev, addr, VPD_LEN, vpd);
537543 if (ret < 0)
538544 goto out;
539545
drivers/net/ethernet/davicom/dm9000.c+110−104
@@ -257,6 +257,107 @@ static void dm9000_dumpblk_32bit(void __iomem *reg, int count) · 256 unmodified lines
257257 tmp = readl(reg);
258258 }
259259
260+/*
261+ * Sleep, either by using msleep() or if we are suspending, then
262+ * use mdelay() to sleep.
263+ */
264+static void dm9000_msleep(board_info_t *db, unsigned int ms)
265+{
266+ if (db->in_suspend)
267+ mdelay(ms);
268+ else
269+ msleep(ms);
270+}
271+
272+/* Read a word from phyxcer */
273+static int
274+dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg)
275+{
276+ board_info_t *db = netdev_priv(dev);
277+ unsigned long flags;
278+ unsigned int reg_save;
279+ int ret;
280+
281+ mutex_lock(&db->addr_lock);
282+
283+ spin_lock_irqsave(&db->lock, flags);
284+
285+ /* Save previous register address */
286+ reg_save = readb(db->io_addr);
287+
288+ /* Fill the phyxcer register into REG_0C */
289+ iow(db, DM9000_EPAR, DM9000_PHY | reg);
290+
291+ /* Issue phyxcer read command */
292+ iow(db, DM9000_EPCR, EPCR_ERPRR | EPCR_EPOS);
293+
294+ writeb(reg_save, db->io_addr);
295+ spin_unlock_irqrestore(&db->lock, flags);
296+
297+ dm9000_msleep(db, 1); /* Wait read complete */
298+
299+ spin_lock_irqsave(&db->lock, flags);
300+ reg_save = readb(db->io_addr);
301+
302+ iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer read command */
303+
304+ /* The read data keeps on REG_0D & REG_0E */
305+ ret = (ior(db, DM9000_EPDRH) << 8) | ior(db, DM9000_EPDRL);
306+
307+ /* restore the previous address */
308+ writeb(reg_save, db->io_addr);
309+ spin_unlock_irqrestore(&db->lock, flags);
310+
311+ mutex_unlock(&db->addr_lock);
312+
313+ dm9000_dbg(db, 5, "phy_read[%02x] -> %04x\n", reg, ret);
314+ return ret;
315+}
316+
317+/* Write a word to phyxcer */
318+static void
319+dm9000_phy_write(struct net_device *dev,
320+ int phyaddr_unused, int reg, int value)
321+{
322+ board_info_t *db = netdev_priv(dev);
323+ unsigned long flags;
324+ unsigned long reg_save;
325+
326+ dm9000_dbg(db, 5, "phy_write[%02x] = %04x\n", reg, value);
327+ mutex_lock(&db->addr_lock);
328+
329+ spin_lock_irqsave(&db->lock, flags);
330+
331+ /* Save previous register address */
332+ reg_save = readb(db->io_addr);
333+
334+ /* Fill the phyxcer register into REG_0C */
335+ iow(db, DM9000_EPAR, DM9000_PHY | reg);
336+
337+ /* Fill the written data into REG_0D & REG_0E */
338+ iow(db, DM9000_EPDRL, value);
339+ iow(db, DM9000_EPDRH, value >> 8);
340+
341+ /* Issue phyxcer write command */
342+ iow(db, DM9000_EPCR, EPCR_EPOS | EPCR_ERPRW);
343+
344+ writeb(reg_save, db->io_addr);
345+ spin_unlock_irqrestore(&db->lock, flags);
346+
347+ dm9000_msleep(db, 1); /* Wait write complete */
348+
349+ spin_lock_irqsave(&db->lock, flags);
350+ reg_save = readb(db->io_addr);
351+
352+ iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer write command */
353+
354+ /* restore the previous address */
355+ writeb(reg_save, db->io_addr);
356+
357+ spin_unlock_irqrestore(&db->lock, flags);
358+ mutex_unlock(&db->addr_lock);
359+}
360+
260361 /* dm9000_set_io
261362 *
262363 * select the specified set of io routines to use with the
@@ -795,6 +896,9 @@ dm9000_init_dm9000(struct net_device *dev) · 532 unmodified lines
795896
796897 iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */
797898
899+ dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); /* PHY RESET */
900+ dm9000_phy_write(dev, 0, MII_DM_DSPCR, DSPCR_INIT_PARAM); /* Init */
901+
798902 ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0;
799903
800904 /* if wol is needed, then always set NCR_WAKEEN otherwise we end
@@ -1201,109 +1305,6 @@ dm9000_open(struct net_device *dev) · 400 unmodified lines
12011305 return 0;
12021306 }
12031307
1204−/*
1205− * Sleep, either by using msleep() or if we are suspending, then
1206− * use mdelay() to sleep.
1207− */
1208−static void dm9000_msleep(board_info_t *db, unsigned int ms)
1209−{
1210− if (db->in_suspend)
1211− mdelay(ms);
1212− else
1213− msleep(ms);
1214−}
1215−
1216−/*
1217− * Read a word from phyxcer
1218− */
1219−static int
1220−dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg)
1221−{
1222− board_info_t *db = netdev_priv(dev);
1223− unsigned long flags;
1224− unsigned int reg_save;
1225− int ret;
1226−
1227− mutex_lock(&db->addr_lock);
1228−
1229− spin_lock_irqsave(&db->lock,flags);
1230−
1231− /* Save previous register address */
1232− reg_save = readb(db->io_addr);
1233−
1234− /* Fill the phyxcer register into REG_0C */
1235− iow(db, DM9000_EPAR, DM9000_PHY | reg);
1236−
1237− iow(db, DM9000_EPCR, EPCR_ERPRR | EPCR_EPOS); /* Issue phyxcer read command */
1238−
1239− writeb(reg_save, db->io_addr);
1240− spin_unlock_irqrestore(&db->lock,flags);
1241−
1242− dm9000_msleep(db, 1); /* Wait read complete */
1243−
1244− spin_lock_irqsave(&db->lock,flags);
1245− reg_save = readb(db->io_addr);
1246−
1247− iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer read command */
1248−
1249− /* The read data keeps on REG_0D & REG_0E */
1250− ret = (ior(db, DM9000_EPDRH) << 8) | ior(db, DM9000_EPDRL);
1251−
1252− /* restore the previous address */
1253− writeb(reg_save, db->io_addr);
1254− spin_unlock_irqrestore(&db->lock,flags);
1255−
1256− mutex_unlock(&db->addr_lock);
1257−
1258− dm9000_dbg(db, 5, "phy_read[%02x] -> %04x\n", reg, ret);
1259− return ret;
1260−}
1261−
1262−/*
1263− * Write a word to phyxcer
1264− */
1265−static void
1266−dm9000_phy_write(struct net_device *dev,
1267− int phyaddr_unused, int reg, int value)
1268−{
1269− board_info_t *db = netdev_priv(dev);
1270− unsigned long flags;
1271− unsigned long reg_save;
1272−
1273− dm9000_dbg(db, 5, "phy_write[%02x] = %04x\n", reg, value);
1274− mutex_lock(&db->addr_lock);
1275−
1276− spin_lock_irqsave(&db->lock,flags);
1277−
1278− /* Save previous register address */
1279− reg_save = readb(db->io_addr);
1280−
1281− /* Fill the phyxcer register into REG_0C */
1282− iow(db, DM9000_EPAR, DM9000_PHY | reg);
1283−
1284− /* Fill the written data into REG_0D & REG_0E */
1285− iow(db, DM9000_EPDRL, value);
1286− iow(db, DM9000_EPDRH, value >> 8);
1287−
1288− iow(db, DM9000_EPCR, EPCR_EPOS | EPCR_ERPRW); /* Issue phyxcer write command */
1289−
1290− writeb(reg_save, db->io_addr);
1291− spin_unlock_irqrestore(&db->lock, flags);
1292−
1293− dm9000_msleep(db, 1); /* Wait write complete */
1294−
1295− spin_lock_irqsave(&db->lock,flags);
1296− reg_save = readb(db->io_addr);
1297−
1298− iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer write command */
1299−
1300− /* restore the previous address */
1301− writeb(reg_save, db->io_addr);
1302−
1303− spin_unlock_irqrestore(&db->lock, flags);
1304− mutex_unlock(&db->addr_lock);
1305−}
1306−
13071308 static void
13081309 dm9000_shutdown(struct net_device *dev)
13091310 {
@@ -1502,7 +1503,12 @@ dm9000_probe(struct platform_device *pdev) · 192 unmodified lines
15021503 db->flags |= DM9000_PLATF_SIMPLE_PHY;
15031504 #endif
15041505
1505− dm9000_reset(db);
1506+ /* Fixing bug on dm9000_probe, takeover dm9000_reset(db),
1507+ * Need 'NCR_MAC_LBK' bit to indeed stable our DM9000 fifo
1508+ * while probe stage.
1509+ */
1510+
1511+ iow(db, DM9000_NCR, NCR_MAC_LBK | NCR_RST);
15061512
15071513 /* try multiple times, DM9000 sometimes gets the read wrong */
15081514 for (i = 0; i < 8; i++) {
drivers/net/ethernet/davicom/dm9000.h+10−1
@@ -69,7 +69,9 @@ · 68 unmodified lines
6969 #define NCR_WAKEEN (1<<6)
7070 #define NCR_FCOL (1<<4)
7171 #define NCR_FDX (1<<3)
72−#define NCR_LBK (3<<1)
72+
73+#define NCR_RESERVED (3<<1)
74+#define NCR_MAC_LBK (1<<1)
7375 #define NCR_RST (1<<0)
7476
7577 #define NSR_SPEED (1<<7)
@@ -167,5 +169,12 @@ · 91 unmodified lines
167169 #define ISR_LNKCHNG (1<<5)
168170 #define ISR_UNDERRUN (1<<4)
169171
172+/* Davicom MII registers.
173+ */
174+
175+#define MII_DM_DSPCR 0x1b /* DSP Control Register */
176+
177+#define DSPCR_INIT_PARAM 0xE100 /* DSP init parameter */
178+
170179 #endif /* _DM9000X_H_ */
171180
drivers/net/ethernet/dec/tulip/Kconfig+1−0
@@ -108,6 +108,7 @@ config TULIP_DM910X · 107 unmodified lines
108108 config DE4X5
109109 tristate "Generic DECchip & DIGITAL EtherWORKS PCI/EISA"
110110 depends on (PCI || EISA)
111+ depends on VIRT_TO_BUS || ALPHA || PPC || SPARC
111112 select CRC32
112113 ---help---
113114 This is support for the DIGITAL series of PCI/EISA Ethernet cards.
drivers/net/ethernet/emulex/benet/be_main.c+3−2
@@ -759,8 +759,9 @@ static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter, · 758 unmodified lines
759759
760760 if (vlan_tx_tag_present(skb)) {
761761 vlan_tag = be_get_tx_vlan_tag(adapter, skb);
762− __vlan_put_tag(skb, vlan_tag);
763− skb->vlan_tci = 0;
762+ skb = __vlan_put_tag(skb, vlan_tag);
763+ if (skb)
764+ skb->vlan_tci = 0;
764765 }
765766
766767 return skb;
drivers/net/ethernet/freescale/fec.c+69−45
@@ -345,6 +345,53 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 344 unmodified lines
345345 return NETDEV_TX_OK;
346346 }
347347
348+/* Init RX & TX buffer descriptors
349+ */
350+static void fec_enet_bd_init(struct net_device *dev)
351+{
352+ struct fec_enet_private *fep = netdev_priv(dev);
353+ struct bufdesc *bdp;
354+ unsigned int i;
355+
356+ /* Initialize the receive buffer descriptors. */
357+ bdp = fep->rx_bd_base;
358+ for (i = 0; i < RX_RING_SIZE; i++) {
359+
360+ /* Initialize the BD for every fragment in the page. */
361+ if (bdp->cbd_bufaddr)
362+ bdp->cbd_sc = BD_ENET_RX_EMPTY;
363+ else
364+ bdp->cbd_sc = 0;
365+ bdp = fec_enet_get_nextdesc(bdp, fep->bufdesc_ex);
366+ }
367+
368+ /* Set the last buffer to wrap */
369+ bdp = fec_enet_get_prevdesc(bdp, fep->bufdesc_ex);
370+ bdp->cbd_sc |= BD_SC_WRAP;
371+
372+ fep->cur_rx = fep->rx_bd_base;
373+
374+ /* ...and the same for transmit */
375+ bdp = fep->tx_bd_base;
376+ fep->cur_tx = bdp;
377+ for (i = 0; i < TX_RING_SIZE; i++) {
378+
379+ /* Initialize the BD for every fragment in the page. */
380+ bdp->cbd_sc = 0;
381+ if (bdp->cbd_bufaddr && fep->tx_skbuff[i]) {
382+ dev_kfree_skb_any(fep->tx_skbuff[i]);
383+ fep->tx_skbuff[i] = NULL;
384+ }
385+ bdp->cbd_bufaddr = 0;
386+ bdp = fec_enet_get_nextdesc(bdp, fep->bufdesc_ex);
387+ }
388+
389+ /* Set the last buffer to wrap */

145 more lines aren’t shown here.

drivers/net/ethernet/freescale/fec.h+1−0

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

drivers/net/ethernet/freescale/fec_ptp.c+3−0

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

drivers/net/ethernet/intel/e100.c+25−11

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

drivers/net/ethernet/intel/e1000/e1000_ethtool.c+11−3

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

drivers/net/ethernet/intel/e1000e/netdev.c+6−1

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

drivers/net/ethernet/intel/igb/e1000_82575.c+19−14

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

drivers/net/ethernet/intel/igb/igb.h+0−8

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

drivers/net/ethernet/intel/igb/igb_hwmon.c+1−1

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

drivers/net/ethernet/intel/igb/igb_main.c+6−108

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

drivers/net/ethernet/intel/igb/igb_ptp.c+1−1

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

drivers/net/ethernet/intel/ixgb/ixgb_main.c+6−1

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

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+9−2

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

drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c+6−0

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

drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c+20−4

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

drivers/net/ethernet/lantiq_etop.c+1−1

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

drivers/net/ethernet/marvell/Kconfig+1−1

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

drivers/net/ethernet/marvell/mvneta.c+9−9

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

drivers/net/ethernet/marvell/sky2.c+1−1

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

drivers/net/ethernet/marvell/sky2.h+1−1

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

drivers/net/ethernet/mellanox/mlx4/en_netdev.c+13−13

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

drivers/net/ethernet/mellanox/mlx4/eq.c+1−1

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

drivers/net/ethernet/mellanox/mlx4/resource_tracker.c+35−10

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

drivers/net/ethernet/micrel/ks8851.c+1−1

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

drivers/net/ethernet/nxp/lpc_eth.c+2−1

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

drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c+2−2

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c+10−5

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c+1−2

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c+2−2

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

drivers/net/ethernet/qlogic/qlge/qlge.h+1−1

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

drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c+1−1

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

drivers/net/ethernet/qlogic/qlge/qlge_main.c+29−7

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

drivers/net/ethernet/realtek/r8169.c+25−3

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

drivers/net/ethernet/renesas/sh_eth.c+28−10

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

drivers/net/ethernet/renesas/sh_eth.h+2−1

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

drivers/net/ethernet/sfc/nic.c+2−1

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

drivers/net/ethernet/stmicro/stmmac/mmc_core.c+1−0

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

drivers/net/ethernet/ti/cpsw.c+4−4

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

drivers/net/ethernet/ti/davinci_emac.c+2−2

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

drivers/net/hyperv/netvsc.c+12−5

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

drivers/net/hyperv/netvsc_drv.c+0−2

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

drivers/net/hyperv/rndis_filter.c+1−13

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

drivers/net/netconsole.c+9−6

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

drivers/net/tun.c+1−1

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

drivers/net/usb/Kconfig+1−1

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

drivers/net/usb/cdc_mbim.c+2−11

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

drivers/net/usb/cdc_ncm.c+32−17

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

drivers/net/usb/qmi_wwan.c+120−33

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

drivers/net/usb/smsc75xx.c+8−4

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

drivers/net/wireless/ath/ath9k/ar9003_calib.c+4−0

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

drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h+1−1

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

drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c+2−2

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

drivers/net/wireless/ath/ath9k/dfs_pri_detector.c+2−2

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

drivers/net/wireless/ath/ath9k/htc_drv_init.c+1−1

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

drivers/net/wireless/ath/ath9k/link.c+15−14

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

drivers/net/wireless/ath/ath9k/main.c+4−0

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

drivers/net/wireless/b43/dma.c+53−12

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

drivers/net/wireless/b43/phy_n.c+6−5

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

drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c+3−3

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

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c+26−27

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

drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c+132−132

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

drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c+130−239

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

drivers/net/wireless/brcm80211/brcmsmac/phy/phytbl_lcn.c+32−32

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

drivers/net/wireless/iwlegacy/3945-mac.c+12−10

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

drivers/net/wireless/iwlegacy/4965-rs.c+2−1

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

drivers/net/wireless/iwlwifi/dvm/lib.c+9−0

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

drivers/net/wireless/iwlwifi/dvm/rxon.c+8−10

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

drivers/net/wireless/iwlwifi/dvm/tx.c+1−1

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

drivers/net/wireless/iwlwifi/dvm/ucode.c+2−2

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

drivers/net/wireless/iwlwifi/pcie/trans.c+13−0

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

drivers/net/wireless/iwlwifi/pcie/tx.c+1−1

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

drivers/net/wireless/mwifiex/cfg80211.c+2−1

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

drivers/net/wireless/mwifiex/cmdevt.c+16−6

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

drivers/net/wireless/mwifiex/init.c+8−0

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

drivers/net/wireless/mwifiex/join.c+3−4

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

drivers/net/wireless/mwifiex/main.h+2−2

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

drivers/net/wireless/mwifiex/pcie.c+1−0

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

drivers/net/wireless/mwifiex/scan.c+12−5

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

drivers/net/wireless/mwifiex/sta_ioctl.c+2−8

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

drivers/net/wireless/rt2x00/Kconfig+9−2

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

drivers/net/wireless/rt2x00/Makefile+1−0

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

drivers/net/wireless/rt2x00/rt2400pci.c+1−0

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

drivers/net/wireless/rt2x00/rt2500pci.c+1−0

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

drivers/net/wireless/rt2x00/rt2800pci.c+8−7

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

drivers/net/wireless/rt2x00/rt2x00mmio.c+216−0

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

drivers/net/wireless/rt2x00/rt2x00mmio.h+119−0

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

drivers/net/wireless/rt2x00/rt2x00pci.c+0−176

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

drivers/net/wireless/rt2x00/rt2x00pci.h+0−88

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

drivers/net/wireless/rt2x00/rt61pci.c+1−0

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

drivers/net/wireless/rtlwifi/rtl8192cu/hw.c+35−54

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

drivers/net/wireless/rtlwifi/usb.c+1−0

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

drivers/nfc/microread/mei.c+17−21

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

drivers/pci/pci-acpi.c+8−7

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

drivers/pci/pci-driver.c+3−2

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

drivers/pci/pcie/portdrv_pci.c+0−13

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

drivers/pci/rom.c+19−9

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

drivers/pinctrl/mvebu/pinctrl-mvebu.c+1−1

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

drivers/pinctrl/pinconf.c+1−1

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

drivers/pinctrl/pinconf.h+1−1

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

drivers/pinctrl/pinctrl-abx500.c+1−1

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

drivers/pinctrl/pinctrl-at91.c+60−1

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

drivers/pinctrl/pinmux.c+5−0

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

drivers/platform/x86/hp-wmi.c+0−4

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

drivers/platform/x86/thinkpad_acpi.c+0−10

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

drivers/remoteproc/Kconfig+1−1

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

drivers/remoteproc/remoteproc_core.c+4−2

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

drivers/remoteproc/ste_modem_rproc.c+6−1

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

drivers/rtc/rtc-da9052.c+3−5

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

drivers/rtc/rtc-mv.c+24−4

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

drivers/s390/block/scm_blk.c+67−9

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

drivers/s390/block/scm_blk.h+2−0

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

drivers/s390/block/scm_drv.c+17−6

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

drivers/s390/char/sclp_cmd.c+2−0

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

drivers/s390/char/tty3270.c+9−7

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

drivers/s390/cio/chsc.c+17−0

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

drivers/s390/cio/chsc.h+2−0

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

drivers/s390/cio/scm.c+17−1

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

drivers/s390/net/qeth_core.h+4−0

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

drivers/s390/net/qeth_core_main.c+57−7

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

drivers/s390/net/qeth_l2_main.c+2−0

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

drivers/s390/net/qeth_l3_main.c+17−8

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

drivers/s390/net/qeth_l3_sys.c+2−0

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

drivers/sbus/char/bbc_i2c.c+2−2

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

drivers/scsi/bnx2fc/bnx2fc_fcoe.c+3−3

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

drivers/scsi/fcoe/fcoe.c+11−4

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

drivers/scsi/fcoe/fcoe_ctlr.c+46−14

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

drivers/scsi/ibmvscsi/ibmvscsi.c+1−1

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

drivers/scsi/ipr.c+10−3

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

drivers/scsi/libfc/fc_disc.c+18−8

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

drivers/scsi/libsas/sas_expander.c+13−1

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

drivers/scsi/lpfc/lpfc_sli.c+2−1

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

drivers/scsi/qla2xxx/qla_attr.c+0−5

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

drivers/scsi/qla2xxx/qla_dbg.c+2−1

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

drivers/scsi/qla2xxx/qla_def.h+0−1

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

drivers/scsi/qla2xxx/qla_gbl.h+0−3

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

drivers/scsi/qla2xxx/qla_init.c+1−3

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

drivers/scsi/qla2xxx/qla_mbx.c+0−58

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

drivers/scsi/qla2xxx/qla_version.h+1−1

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

drivers/scsi/st.c+7−1

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

drivers/spi/Kconfig+2−1

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

drivers/spi/spi-bcm63xx.c+1−2

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

drivers/spi/spi-mpc512x-psc.c+1−1

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

drivers/spi/spi-pxa2xx.c+0−1

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

drivers/spi/spi-s3c64xx.c+25−16

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

drivers/spi/spi-tegra20-slink.c+8−17

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

drivers/spi/spi.c+8−9

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

drivers/ssb/driver_chipcommon_pmu.c+29−0

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

drivers/staging/comedi/drivers/dt9812.c+10−6

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

drivers/staging/comedi/drivers/s626.c+1−1

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

drivers/staging/comedi/drivers/usbdux.c+19−12

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

drivers/staging/comedi/drivers/usbduxfast.c+18−12

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

drivers/staging/comedi/drivers/usbduxsigma.c+17−10

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

drivers/staging/imx-drm/ipuv3-crtc.c+12−11

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

drivers/staging/tidspbridge/rmgr/drv.c+26−44

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

drivers/staging/vt6656/card.c+1−1

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

drivers/staging/vt6656/main_usb.c+0−4

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

drivers/staging/zcache/Kconfig+1−1

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

drivers/staging/zcache/ramster/tcp.c+10−15

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

drivers/target/iscsi/iscsi_target_auth.c+4−1

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

drivers/target/target_core_alua.c+3−0

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

drivers/target/target_core_file.h+1−1

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

drivers/target/target_core_pscsi.c+8−3

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

drivers/target/target_core_sbc.c+5−2

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

drivers/target/target_core_tpg.c+2−1

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

drivers/target/target_core_transport.c+3−1

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

drivers/thermal/dove_thermal.c+6−10

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

drivers/thermal/exynos_thermal.c+1−1

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

drivers/thermal/kirkwood_thermal.c+3−5

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

drivers/thermal/rcar_thermal.c+14−15

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

drivers/tty/mxser.c+4−4

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

drivers/tty/serial/8250/8250_core.crenamed from drivers/tty/serial/8250/8250.c+53−1

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

drivers/tty/serial/8250/8250_pci.c+24−10

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

drivers/tty/serial/8250/Kconfig+17−0

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

drivers/tty/serial/8250/Makefile+4−4

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

drivers/tty/serial/Kconfig+2−2

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

drivers/tty/serial/atmel_serial.c+5−6

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

drivers/tty/serial/bcm63xx_uart.c+4−4

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

drivers/tty/serial/mpc52xx_uart.c+1−1

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

drivers/tty/serial/of_serial.c+6−0

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

drivers/tty/serial/omap-serial.c+11−0

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

drivers/tty/serial/sunsu.c+9−12

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

drivers/tty/serial/vt8500_serial.c+1−8

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

drivers/tty/serial/xilinx_uartps.c+2−0

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

drivers/tty/tty_buffer.c+1−1

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

drivers/tty/vt/vc_screen.c+4−2

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

drivers/usb/Makefile+1−1

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

drivers/usb/c67x00/c67x00-sched.c+2−2

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

drivers/usb/chipidea/udc.c+3−3

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

drivers/usb/class/cdc-acm.c+19−3

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

drivers/usb/class/cdc-wdm.c+20−3

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

drivers/usb/core/hcd-pci.c+14−9

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

drivers/usb/core/hcd.c+8−0

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

drivers/usb/core/port.c+0−1

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

drivers/usb/core/usb-acpi.c+7−1

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

drivers/usb/dwc3/core.c+1−0

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

drivers/usb/dwc3/dwc3-exynos.c+0−2

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

drivers/usb/dwc3/dwc3-omap.c+3−5

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

drivers/usb/dwc3/dwc3-pci.c+0−2

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

drivers/usb/dwc3/ep0.c+4−3

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

drivers/usb/dwc3/gadget.c+0−3

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

drivers/usb/gadget/Kconfig+1−0

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

drivers/usb/gadget/Makefile+6−6

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

drivers/usb/gadget/composite.c+1−4

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

drivers/usb/gadget/f_rndis.c+1−2

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

drivers/usb/gadget/f_uac1.c+1−0

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

drivers/usb/gadget/g_ffs.c+2−2

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

drivers/usb/gadget/imx_udc.c+8−12

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

drivers/usb/gadget/net2272.c+8−1

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

drivers/usb/gadget/net2280.c+7−1

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

drivers/usb/gadget/omap_udc.c+2−1

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

drivers/usb/gadget/pxa25x_udc.c+15−9

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

drivers/usb/gadget/pxa27x_udc.c+12−6

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

drivers/usb/gadget/s3c2410_udc.c+12−16

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

drivers/usb/gadget/u_serial.c+1−1

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

drivers/usb/gadget/u_uac1.c+3−0

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

drivers/usb/gadget/udc-core.c+1−1

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

drivers/usb/host/ehci-hcd.c+3−4

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

drivers/usb/host/ehci-hub.c+1−1

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

drivers/usb/host/ehci-q.c+40−9

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

drivers/usb/host/ehci-sched.c+2−0

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

drivers/usb/host/ehci-timer.c+1−1

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

drivers/usb/host/xhci-mem.c+8−28

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

drivers/usb/host/xhci-pci.c+1−0

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

drivers/usb/host/xhci-ring.c+35−26

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

drivers/usb/host/xhci.c+24−1

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

drivers/usb/host/xhci.h+7−2

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

drivers/usb/musb/Kconfig+0−5

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

drivers/usb/musb/da8xx.c+1−1

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

drivers/usb/musb/musb_core.c+0−6

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

drivers/usb/musb/musb_gadget.c+7−2

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

drivers/usb/musb/omap2430.c+8−4

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

drivers/usb/otg/otg.c+7−3

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

drivers/usb/phy/Kconfig+1−0

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

drivers/usb/phy/omap-control-usb.c+9−15

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

drivers/usb/phy/omap-usb3.c+3−5

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

drivers/usb/phy/samsung-usbphy.c+3−5

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

drivers/usb/serial/ark3116.c+6−4

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

drivers/usb/serial/ch341.c+6−5

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

drivers/usb/serial/cp210x.c+20−0

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

drivers/usb/serial/cypress_m8.c+8−6

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

drivers/usb/serial/f81232.c+5−4

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

drivers/usb/serial/ftdi_sio.c+9−11

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

drivers/usb/serial/ftdi_sio_ids.h+7−0

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

drivers/usb/serial/garmin_gps.c+1−6

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

drivers/usb/serial/io_edgeport.c+7−5

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

drivers/usb/serial/io_ti.c+7−6

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

drivers/usb/serial/mct_u232.c+7−6

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

drivers/usb/serial/mos7840.c+10−6

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

drivers/usb/serial/option.c+5−0

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

drivers/usb/serial/oti6858.c+6−4

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

drivers/usb/serial/pl2303.c+6−5

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

drivers/usb/serial/qcaux.c+1−0

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

drivers/usb/serial/qcserial.c+5−2

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

drivers/usb/serial/quatech2.c+12−7

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

drivers/usb/serial/spcp8x5.c+5−4

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

drivers/usb/serial/ssu100.c+7−5

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

drivers/usb/serial/ti_usb_3410_5052.c+6−4

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

drivers/usb/serial/usb-serial.c+3−1

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

drivers/usb/storage/initializers.c+2−74

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

drivers/usb/storage/initializers.h+2−2

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

drivers/usb/storage/unusual_devs.h+342−2

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

drivers/vfio/pci/vfio_pci.c+2−1

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

drivers/vfio/pci/vfio_pci_config.c+1−0

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

drivers/vfio/pci/vfio_pci_intrs.c+1−0

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

drivers/vhost/net.c+2−1

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

drivers/vhost/tcm_vhost.c+148−72

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

drivers/video/atmel_lcdfb.c+15−7

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

drivers/video/ep93xx-fb.c+1−0

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

drivers/video/fbmem.c+14−25

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

drivers/video/fbmon.c+1−1

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

drivers/video/mmp/core.c+0−2

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

drivers/video/mxsfb.c+5−2

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

drivers/video/omap/lcd_ams_delta.c+1−0

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

drivers/video/omap/lcd_osk.c+3−0

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

drivers/video/omap/omapfb_main.c+2−0

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

drivers/video/omap2/displays/panel-tpo-td043mtea1.c+11−2

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

drivers/video/omap2/dss/dss_features.c+2−4

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

drivers/video/sh_mobile_lcdcfb.c+1−0

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

drivers/video/uvesafb.c+2−1

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

drivers/w1/masters/w1-gpio.c+4−2

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

drivers/w1/w1.c+2−1

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

drivers/watchdog/Kconfig+1−1

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

drivers/watchdog/sp5100_tco.c+6−120

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

drivers/watchdog/sp5100_tco.h+1−1

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

drivers/xen/Kconfig+1−1

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

drivers/xen/events.c+30−9

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

drivers/xen/fallback.c+2−1

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

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

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

drivers/xen/xen-pciback/pci_stub.c+44−15

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

drivers/xen/xen-pciback/pciback_ops.c+2−1

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

drivers/xen/xen-stub.c+0−1

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

fs/binfmt_elf.c+1−0

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

fs/bio.c+0−2

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

fs/block_dev.c+1−0

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

fs/btrfs/ctree.c+20−10

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

fs/btrfs/disk-io.c+10−4

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

fs/btrfs/extent-tree.c+76−13

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

fs/btrfs/extent_io.c+33−0

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

fs/btrfs/extent_io.h+2−0

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

fs/btrfs/file-item.c+3−3

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

fs/btrfs/file.c+10−0

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

fs/btrfs/inode.c+21−4

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

fs/btrfs/locking.h+0−1

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

fs/btrfs/ordered-data.c+2−0

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

fs/btrfs/qgroup.c+7−6

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

fs/btrfs/scrub.c+2−1

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

fs/btrfs/send.c+4−6

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

fs/btrfs/transaction.c+5−6

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

fs/btrfs/tree-log.c+42−6

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

fs/btrfs/volumes.c+18−1

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

fs/cifs/asn1.c+5−48

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

fs/cifs/cifsfs.c+25−0

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

fs/cifs/cifsfs.h+4−0

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

fs/cifs/connect.c+13−3

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

fs/cifs/file.c+5−1

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

fs/cifs/inode.c+4−6

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

fs/cifs/netmisc.c+1−1

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

fs/compat.c+7−8

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

fs/dcache.c+11−5

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

fs/ecryptfs/miscdev.c+2−12

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

fs/ext2/ialloc.c+0−1

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

fs/ext2/inode.c+2−0

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

fs/ext3/super.c+2−2

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

fs/ext4/ext4.h+4−4

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

fs/ext4/extents.c+87−21

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

fs/ext4/extents_status.c+207−5

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

fs/ext4/extents_status.h+9−0

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

fs/ext4/ialloc.c+2−2

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

fs/ext4/indirect.c+2−2

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

fs/ext4/inode.c+174−8

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

fs/ext4/mballoc.c+8−15

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

fs/ext4/move_extent.c+27−16

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

fs/ext4/page-io.c+11−1

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

fs/ext4/resize.c+2−2

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

fs/ext4/super.c+4−2

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

fs/freevxfs/vxfs_super.c+1−0

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

fs/gfs2/file.c+4−1

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

fs/gfs2/incore.h+1−0

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

fs/gfs2/lock_dlm.c+20−19

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

fs/gfs2/rgrp.c+14−18

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

fs/hfsplus/extents.c+1−1

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

fs/hostfs/hostfs_kern.c+1−0

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

fs/hpfs/super.c+1−0

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

fs/hugetlbfs/inode.c+1−1

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

fs/inode.c+1−1

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

fs/internal.h+5−0

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

fs/isofs/inode.c+1−0

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

fs/jbd2/transaction.c+10−5

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

fs/namespace.c+54−2

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

fs/nfs/blocklayout/blocklayoutdm.c+2−2

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

fs/nfs/idmap.c+8−5

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

fs/nfs/nfs4client.c+29−16

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

fs/nfs/nfs4filelayout.c+0−1

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

fs/nfs/nfs4proc.c+2−15

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

fs/nfs/nfs4state.c+7−1

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

fs/nfs/pnfs.c+72−9

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

fs/nfs/pnfs.h+6−0

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

fs/nfs/super.c+1−0

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

fs/nfsd/nfs4state.c+2−34

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

fs/nfsd/nfs4xdr.c+1−1

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

fs/nfsd/nfscache.c+6−5

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

fs/nfsd/vfs.c+2−1

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

fs/pipe.c+3−0

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

fs/pnode.c+6−0

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

fs/pnode.h+1−0

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

fs/proc/array.c+1−0

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

fs/proc/generic.c+89−30

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

fs/proc/inode.c+3−3

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

fs/proc/root.c+4−0

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

fs/quota/dquot.c+4−1

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

fs/read_write.c+28−0

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

fs/reiserfs/super.c+1−3

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

fs/reiserfs/xattr.c+2−2

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

fs/splice.c+3−1

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

fs/squashfs/super.c+1−0

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

fs/sysfs/dir.c+16−1

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

fs/sysfs/mount.c+4−0

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

fs/sysv/super.c+1−0

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

fs/ubifs/super.c+6−6

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

fs/udf/super.c+1−0

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

fs/xfs/xfs_buf.c+6−0

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

fs/xfs/xfs_iomap.c+2−2

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

include/acpi/processor.h+3−0

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

include/asm-generic/atomic.h+0−6

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

include/asm-generic/cmpxchg.h+10−0

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

include/asm-generic/tlb.h+6−1

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

include/drm/drm_pciids.h+12−1

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

include/linux/ata.h+1−1

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

include/linux/blktrace_api.h+0−1

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

include/linux/capability.h+2−0

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

include/linux/compat.h+2−2

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

include/linux/debug_locks.h+2−2

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

include/linux/devfreq.h+8−8

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

include/linux/edac.h+2−5

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

include/linux/efi.h+8−1

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

include/linux/freezer.h+0−3

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

include/linux/fs_struct.h+2−0

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

include/linux/ftrace.h+4−1

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

include/linux/hash.h+2−1

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

include/linux/idr.h+51−17

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

include/linux/iio/common/st_sensors.h+6−3

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

include/linux/irq_work.h+1−1

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

include/linux/kernel.h+0−1

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

include/linux/kexec.h+2−0

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

include/linux/kvm_host.h+1−1

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

include/linux/kvm_types.h+1−0

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

include/linux/libata.h+1−0

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

include/linux/list.h+3−1

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

include/linux/mfd/max77693-private.h+23−0

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

include/linux/mfd/palmas.h+1−0

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

include/linux/mfd/tps65912.h+1−0

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

include/linux/mfd/wm831x/auxadc.h+2−0

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

include/linux/mfd/wm831x/core.h+1−1

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

include/linux/mm.h+2−1

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

include/linux/mman.h+1−3

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

include/linux/mmzone.h+1−1

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

include/linux/mount.h+2−0

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

include/linux/mtd/nand.h+7−0

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

include/linux/mxsfb.h+5−2

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

include/linux/netdevice.h+2−2

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

include/linux/netfilter/ipset/ip_set_ahash.h+23−7

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

include/linux/nvme.h+28−0

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

include/linux/pci.h+1−0

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

include/linux/perf_event.h+6−0

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

include/linux/preempt.h+14−8

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

include/linux/printk.h+6−0

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

include/linux/proc_fs.h+2−0

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

include/linux/res_counter.h+1−0

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

include/linux/sched.h+3−2

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

include/linux/security.h+12−0

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

include/linux/signal.h+2−2

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

include/linux/skbuff.h+16−4

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

include/linux/spinlock_up.h+18−11

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

include/linux/ssb/ssb_driver_chipcommon.h+2−0

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

include/linux/swiotlb.h+1−0

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

include/linux/thermal.h+1−1

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

include/linux/ucs2_string.h+14−0

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

include/linux/udp.h+1−0

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

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

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

include/linux/usb/composite.h+2−1

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

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

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

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

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

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

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

include/linux/user_namespace.h+4−0

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

include/net/addrconf.h+1−0

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

include/net/dst.h+4−2

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

include/net/flow_keys.h+1−0

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

include/net/inet_frag.h+9−0

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

include/net/ip_fib.h+5−7

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

include/net/ip_vs.h+12−0

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

include/net/ipip.h+6−10

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

include/net/irda/irlmp.h+2−1

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

include/net/iucv/af_iucv.h+8−0

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

include/net/scm.h+2−2

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

include/scsi/libfc.h+2−1

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

include/sound/max98090.h+0−0

File mode changed from 100755 to 100644.

include/sound/soc-dapm.h+1−0

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

include/trace/events/block.h+4−4

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

include/trace/events/sched.h+1−1

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

include/uapi/linux/acct.h+4−2

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

include/uapi/linux/aio_abi.h+2−2

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

include/uapi/linux/fuse.h+216−220

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

include/uapi/linux/packet_diag.h+3−1

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

include/uapi/linux/raid/md_p.h+4−2

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

include/uapi/linux/serial_core.h+4−1

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

include/uapi/linux/unix_diag.h+3−1

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

include/video/atmel_lcdc.h+1−1

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

include/xen/interface/io/blkif.h+10−0

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

include/xen/interface/physdev.h+6−0

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

init/Kconfig+0−4

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

ipc/mqueue.c+12−3

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

ipc/msg.c+1−0

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

kernel/capability.c+24−0

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

kernel/events/core.c+10−4

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

kernel/events/internal.h+1−1

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

kernel/events/ring_buffer.c+18−4

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

kernel/exit.c+1−1

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

kernel/fork.c+4−1

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

kernel/futex.c+23−23

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

kernel/hrtimer.c+1−2

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

kernel/kexec.c+105−13

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

kernel/kprobes.c+13−6

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

kernel/kthread.c+28−24

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

kernel/lockdep.c+9−8

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

kernel/pid_namespace.c+2−1

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

kernel/printk.c+39−41

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

kernel/sched/clock.c+26−0

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

kernel/sched/core.c+5−3

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

kernel/sched/cputime.c+1−1

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

kernel/signal.c+5−2

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

kernel/smpboot.c+12−2

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

kernel/sys.c+34−26

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

kernel/time/tick-broadcast.c+2−1

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

kernel/trace/blktrace.c+3−23

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

kernel/trace/ftrace.c+27−31

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

kernel/trace/trace.c+53−15

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

kernel/trace/trace.h+6−0

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

kernel/trace/trace_irqsoff.c+14−5

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

kernel/trace/trace_sched_wakeup.c+13−5

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

kernel/trace/trace_stack.c+1−1

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

kernel/user.c+2−0

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

kernel/user_namespace.c+28−9

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

kernel/workqueue.c+29−22

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

lib/Kconfig+3−0

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

lib/Makefile+2−0

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

lib/bust_spinlocks.c+1−2

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

lib/dma-debug.c+31−14

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

lib/idr.c+30−50

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

lib/kobject.c+8−1

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

lib/swiotlb.c+15−4

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

lib/ucs2_string.c+51−0

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

lib/xz/Kconfig+1−1

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

mm/Kconfig+6−2

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

mm/fremap.c+5−12

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

mm/hugetlb.c+17−3

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

mm/memory.c+48−0

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

mm/memory_hotplug.c+6−2

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

mm/mlock.c+5−6

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

mm/mmap.c+4−2

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

mm/nommu.c+1−1

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

mm/process_vm_access.c+0−8

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

mm/vmscan.c+1−1

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

net/802/mrp.c+4−0

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

net/8021q/vlan.c+7−7

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

net/atm/common.c+2−0

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

net/ax25/af_ax25.c+1−0

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

net/batman-adv/bat_iv_ogm.c+3−3

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

net/batman-adv/main.c+4−1

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

net/batman-adv/main.h+1−1

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

net/batman-adv/routing.c+20−18

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

net/batman-adv/translation-table.c+1−1

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

net/batman-adv/vis.c+2−2

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

net/bluetooth/af_bluetooth.c+2−2

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

net/bluetooth/rfcomm/sock.c+1−0

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

net/bluetooth/sco.c+2−0

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

net/bridge/br_fdb.c+1−1

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

net/bridge/br_if.c+2−1

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

net/bridge/br_netlink.c+2−0

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

net/bridge/br_private.h+1−0

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

net/bridge/br_stp_if.c+1−0

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

net/caif/caif_socket.c+2−0

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

net/can/gw.c+3−3

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

net/ceph/osdmap.c+29−13

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

net/core/dev.c+11−3

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

net/core/dev_addr_lists.c+3−3

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

net/core/flow.c+1−1

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

net/core/flow_dissector.c+2−0

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

net/core/rtnetlink.c+6−4

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

net/core/scm.c+3−1

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

net/ipv4/af_inet.c+1−2

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

net/ipv4/devinet.c+48−18

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

net/ipv4/esp4.c+3−3

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

net/ipv4/inet_fragment.c+19−1

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

net/ipv4/ip_fragment.c+14−11

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

net/ipv4/ip_gre.c+1−4

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

net/ipv4/ip_options.c+1−4

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

net/ipv4/ipconfig.c+2−1

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

net/ipv4/netfilter/Kconfig+0−13

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

net/ipv4/netfilter/ipt_rpfilter.c+7−1

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

net/ipv4/syncookies.c+2−2

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

net/ipv4/tcp.c+1−1

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

net/ipv4/tcp_input.c+33−38

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

net/ipv4/tcp_ipv4.c+7−7

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

net/ipv4/tcp_output.c+12−5

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

net/ipv4/udp.c+7−0

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

net/ipv6/addrconf.c+40−37

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

net/ipv6/addrconf_core.c+19−0

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

net/ipv6/ip6_input.c+12−0

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

net/ipv6/netfilter/ip6t_NPT.c+3−1

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

net/ipv6/netfilter/ip6t_rpfilter.c+7−1

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

net/ipv6/netfilter/nf_conntrack_reasm.c+6−6

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

net/ipv6/reassembly.c+16−4

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

net/ipv6/tcp_ipv6.c+8−0

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

net/ipv6/udp.c+8−0

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

net/irda/af_irda.c+6−2

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

net/irda/iriap.c+2−1

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

net/irda/irlmp.c+9−1

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

net/iucv/af_iucv.c+18−18

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

net/key/af_key.c+1−0

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

net/l2tp/l2tp_core.c+101−105

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

net/l2tp/l2tp_core.h+12−10

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

net/l2tp/l2tp_debugfs.c+14−14

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

net/l2tp/l2tp_ip.c+6−0

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

net/l2tp/l2tp_ip6.c+8−0

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

net/l2tp/l2tp_netlink.c+28−44

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

net/l2tp/l2tp_ppp.c+36−75

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

net/llc/af_llc.c+2−0

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

net/mac80211/cfg.c+4−2

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

net/mac80211/chan.c+14−3

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

net/mac80211/ieee80211_i.h+3−1

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

net/mac80211/iface.c+38−24

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

net/mac80211/mesh.c+2−1

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

net/mac80211/mlme.c+24−6

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

net/mac80211/offchannel.c+17−6

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

net/mac80211/rx.c+13−1

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

net/mac80211/sta_info.c+10−2

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

net/netfilter/ipset/ip_set_bitmap_ipmac.c+5−1

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

net/netfilter/ipset/ip_set_hash_ipportnet.c+18−0

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

net/netfilter/ipset/ip_set_hash_net.c+20−2

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

net/netfilter/ipset/ip_set_hash_netiface.c+20−2

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

net/netfilter/ipset/ip_set_hash_netport.c+18−0

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

net/netfilter/ipset/ip_set_list_set.c+7−3

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

net/netfilter/ipvs/ip_vs_core.c+8−6

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

net/netfilter/ipvs/ip_vs_ctl.c+7−0

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

net/netfilter/ipvs/ip_vs_proto_sctp.c+9−7

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

net/netfilter/nf_conntrack_proto_dccp.c+6−6

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

net/netfilter/nf_conntrack_proto_gre.c+6−6

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

net/netfilter/nf_conntrack_proto_sctp.c+6−6

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

net/netfilter/nf_conntrack_proto_udplite.c+6−6

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

net/netfilter/nf_conntrack_sip.c+2−4

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

net/netfilter/nf_conntrack_standalone.c+1−0

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

net/netfilter/nf_nat_core.c+7−33

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

net/netfilter/nfnetlink_acct.c+2−0

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

net/netfilter/nfnetlink_queue_core.c+4−2

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

net/netlink/genetlink.c+1−0

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

net/netrom/af_netrom.c+1−0

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

net/nfc/llcp/llcp.c+51−15

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

net/nfc/llcp/sock.c+8−3

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

net/openvswitch/actions.c+2−2

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

net/openvswitch/datapath.c+21−12

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

net/openvswitch/flow.c+6−2

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

net/openvswitch/vport-netdev.c+1−2

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

net/openvswitch/vport.c+1−2

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

net/rose/af_rose.c+1−0

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

net/sched/cls_fw.c+1−1

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

net/sched/sch_cbq.c+4−1

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

net/sched/sch_fq_codel.c+1−1

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

net/sched/sch_generic.c+1−1

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

net/sctp/associola.c+1−1

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

net/sctp/sm_statefuns.c+1−1

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

net/sunrpc/auth_gss/svcauth_gss.c+8−4

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

net/sunrpc/clnt.c+3−8

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

net/sunrpc/rpc_pipe.c+1−0

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

net/sunrpc/sched.c+7−2

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

net/sunrpc/xprtsock.c+10−5

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

net/tipc/socket.c+7−0

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

net/unix/af_unix.c+4−5

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

net/vmw_vsock/af_vsock.c+5−3

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

net/vmw_vsock/vmci_transport.c+22−12

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

net/vmw_vsock/vsock_addr.c+0−10

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

net/vmw_vsock/vsock_addr.h+0−2

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

net/wireless/core.c+47−17

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

net/wireless/core.h+3−0

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

net/wireless/nl80211.c+27−25

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

net/wireless/scan.c+16−8

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

net/wireless/sme.c+6−2

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

net/wireless/trace.h+3−2

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

net/wireless/wext-sme.c+6−0

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

net/xfrm/xfrm_replay.c+65−1

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

scripts/Makefile.headersinst+6−5

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

scripts/checkpatch.pl+1−0

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

security/capability.c+6−0

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

security/keys/compat.c+2−2

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

security/keys/process_keys.c+1−1

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

security/security.c+5−0

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

security/selinux/hooks.c+7−0

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

security/selinux/xfrm.c+1−1

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

security/yama/yama_lsm.c+1−3

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

sound/core/pcm_native.c+2−10

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

sound/core/seq/seq_timer.c+4−4

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

sound/oss/sequencer.c+6−0

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

sound/pci/asihpi/asihpi.c+2−1

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

sound/pci/hda/hda_codec.c+16−12

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

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

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

sound/pci/hda/hda_generic.c+47−1

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

sound/pci/hda/hda_intel.c+111−27

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

sound/pci/hda/patch_ca0132.c+15−13

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

sound/pci/hda/patch_cirrus.c+6−2

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

sound/pci/hda/patch_conexant.c+11−5

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

sound/pci/hda/patch_hdmi.c+1−1

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

sound/pci/hda/patch_realtek.c+3−1

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

sound/pci/hda/patch_sigmatel.c+29−0

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

sound/soc/codecs/max98090.c+0−0

File mode changed from 100755 to 100644.

sound/soc/codecs/max98090.h+0−0

File mode changed from 100755 to 100644.

sound/soc/codecs/si476x.c+1−0

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

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

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

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

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

sound/soc/codecs/wm_adsp.c+3−2

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

sound/soc/fsl/imx-ssi.c+5−0

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

sound/soc/fsl/pcm030-audio-fabric.c+1−1

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

sound/soc/samsung/i2s.c+12−5

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

sound/soc/sh/dma-sh7760.c+2−2

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

sound/soc/soc-compress.c+11−3

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

sound/soc/soc-core.c+5−5

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

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

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

sound/soc/spear/spear_pcm.c+6−6

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

sound/soc/tegra/tegra_pcm.c+1−23

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

sound/usb/card.c+15−0

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

sound/usb/clock.c+35−10

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

sound/usb/mixer.c+13−8

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

sound/usb/mixer_quirks.c+2−2

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

sound/usb/quirks.c+1−1

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

tools/lib/traceevent/Makefile+1−1

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

tools/perf/Makefile+7−1

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

tools/perf/bench/bench.h+24−0

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

tools/perf/builtin-record.c+4−2

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

tools/perf/util/hist.h+3−2

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

tools/perf/util/strlist.c+1−1

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

tools/power/x86/turbostat/turbostat.c+4−1

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

tools/usb/ffs-test.c+1−1

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

virt/kvm/ioapic.c+5−2

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

virt/kvm/kvm_main.c+37−10

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