History

Merge branch 'linus' into perf/core

Conflicts: tools/perf/Makefile tools/perf/builtin-test.c tools/perf/perf.h tools/perf/tests/parse-events.c tools/perf/util/evsel.h

Ingo Molnar committed 13 years ago

Commit f0b9abf2 parents adc1ef1 1b3c3931115 files · +13259 −8000Browse files

Unified · Split

1115 files
  1. CREDITS +5 −0
  2. Documentation/arm64/memory.txt +6 −6
  3. Documentation/cgroups/memory.txt +4 −0
  4. Documentation/devicetree/bindings/arm/atmel-at91.txt +1 −1
  5. Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt +19 −0
  6. Documentation/devicetree/bindings/net/mdio-gpio.txt +8 −1
  7. Documentation/devicetree/bindings/pinctrl/nvidia,tegra20-pinmux.txt +1 −1
  8. Documentation/devicetree/bindings/pinctrl/nvidia,tegra30-pinmux.txt +1 −1
  9. Documentation/filesystems/proc.txt +12 −4
  10. Documentation/firmware_class/README +17 −9
  11. Documentation/hwmon/fam15h_power +1 −1
  12. Documentation/networking/netdev-features.txt +1 −1
  13. Documentation/networking/vxlan.txt +2 −2
  14. Documentation/zh_CN/IRQ.txt +39 −0
  15. Documentation/zh_CN/arm64/booting.txt +156 −0
  16. Documentation/zh_CN/arm64/memory.txt +93 −0
  17. MAINTAINERS +95 −22
  18. Makefile +1 −1
  19. arch/alpha/kernel/osf_sys.c +3 −3
  20. arch/arm/Kconfig +6 −4
  21. arch/arm/Makefile +7 −6
  22. arch/arm/boot/Makefile +5 −5
  23. arch/arm/boot/compressed/head.S +13 −1
  24. arch/arm/boot/dts/at91sam9g20ek_common.dtsi +2 −2
  25. arch/arm/boot/dts/dbx5x0.dtsi +16 −1
  26. arch/arm/boot/dts/exynos4210-trats.dts +4 −2
  27. arch/arm/boot/dts/imx23.dtsi +1 −0
  28. arch/arm/boot/dts/imx28.dtsi +1 −0
  29. arch/arm/boot/dts/omap3.dtsi +2 −2
  30. arch/arm/boot/dts/tegra30.dtsi +2 −2
  31. arch/arm/common/timer-sp.c +1 −1
  32. arch/arm/configs/imx_v6_v7_defconfig +2 −0
  33. arch/arm/configs/mvebu_defconfig +7 −3
  34. arch/arm/configs/versatile_defconfig +1 −0
  35. arch/arm/include/asm/flat.h +1 −1
  36. arch/arm/include/asm/io.h +2 −2
  37. arch/arm/include/asm/sched_clock.h +0 −2
  38. arch/arm/include/asm/uaccess.h +2 −2
  39. arch/arm/include/asm/vfpmacros.h +6 −6
  40. arch/arm/include/debug/8250_32.S +27 −0
  41. arch/arm/include/debug/picoxcell.S +1 −17
  42. arch/arm/include/debug/socfpga.S +5 −0
  43. arch/arm/include/uapi/asm/hwcap.h +2 −1
  44. arch/arm/kernel/irq.c +2 −0
  45. arch/arm/kernel/kprobes-test-arm.c +4 −0
  46. arch/arm/kernel/machine_kexec.c +3 −4
  47. arch/arm/kernel/perf_event.c +4 −0
  48. arch/arm/kernel/sched_clock.c +4 −14
  49. arch/arm/kernel/smp.c +10 −4
  50. arch/arm/kernel/smp_twd.c +2 −2
  51. arch/arm/lib/delay.c +1 −0
  52. arch/arm/mach-at91/Kconfig +2 −8
  53. arch/arm/mach-at91/at91rm9200.c +1 −1
  54. arch/arm/mach-at91/at91rm9200_devices.c +3 −3
  55. arch/arm/mach-at91/at91sam9260.c +2 −2
  56. arch/arm/mach-at91/at91sam9260_devices.c +3 −3
  57. arch/arm/mach-at91/at91sam9261.c +2 −2
  58. arch/arm/mach-at91/at91sam9261_devices.c +3 −3
  59. arch/arm/mach-at91/at91sam9263.c +1 −1
  60. arch/arm/mach-at91/at91sam9263_devices.c +3 −3
  61. arch/arm/mach-at91/at91sam9g45_devices.c +6 −6
  62. arch/arm/mach-at91/at91sam9rl_devices.c +2 −2
  63. arch/arm/mach-at91/at91x40.c +1 −1
  64. arch/arm/mach-at91/board-neocore926.c +1 −1
  65. arch/arm/mach-at91/board-sam9261ek.c +1 −1
  66. arch/arm/mach-at91/board-sam9263ek.c +1 −1
  67. arch/arm/mach-at91/generic.h +2 −1
  68. arch/arm/mach-at91/irq.c +7 −2
  69. arch/arm/mach-at91/setup.c +2 −2
  70. arch/arm/mach-davinci/dm644x.c +1 −2
  71. arch/arm/mach-dove/include/mach/pm.h +1 −1
  72. arch/arm/mach-dove/irq.c +13 −1
  73. arch/arm/mach-exynos/common.c +5 −0
  74. arch/arm/mach-exynos/dma.c +3 −0
  75. arch/arm/mach-exynos/include/mach/map.h +1 −0
  76. arch/arm/mach-exynos/mach-exynos4-dt.c +1 −0
  77. arch/arm/mach-highbank/system.c +2 −1
  78. arch/arm/mach-imx/clk-busy.c +1 −1
  79. arch/arm/mach-imx/clk-gate2.c +1 −1
  80. arch/arm/mach-imx/clk-imx25.c +2 −2
  81. arch/arm/mach-imx/clk-imx27.c +2 −2
  82. arch/arm/mach-imx/ehci-imx25.c +1 −1
  83. arch/arm/mach-imx/ehci-imx35.c +1 −1
  84. arch/arm/mach-imx/mm-imx3.c +2 −3
  85. arch/arm/mach-ixp4xx/common-pci.c +1 −0
  86. arch/arm/mach-ixp4xx/common.c +5 −8
  87. arch/arm/mach-ixp4xx/goramo_mlr.c +2 −1
  88. arch/arm/mach-ixp4xx/include/mach/debug-macro.S +2 −2
  89. arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h +19 −27
  90. arch/arm/mach-ixp4xx/include/mach/qmgr.h +6 −6
  91. arch/arm/mach-ixp4xx/ixp4xx_npe.c +8 −1
  92. arch/arm/mach-ixp4xx/ixp4xx_qmgr.c +1 −11
  93. arch/arm/mach-kirkwood/pcie.c +8 −3
  94. arch/arm/mach-omap2/Kconfig +0 −1
  95. arch/arm/mach-omap2/board-igep0020.c +5 −0
  96. arch/arm/mach-omap2/board-omap3beagle.c +13 −9
  97. arch/arm/mach-omap2/clock33xx_data.c +2 −0
  98. arch/arm/mach-omap2/clockdomains44xx_data.c +1 −1
  99. arch/arm/mach-omap2/common-board-devices.c +20 −14
  100. arch/arm/mach-omap2/devices.c +79 −0
  101. arch/arm/mach-omap2/mux34xx.c +4 −4
  102. arch/arm/mach-omap2/omap_hwmod.c +49 −14
  103. arch/arm/mach-omap2/omap_hwmod_44xx_data.c +36 −0
  104. arch/arm/mach-omap2/pm.h +1 −0
  105. arch/arm/mach-omap2/pm34xx.c +28 −2
  106. arch/arm/mach-omap2/serial.c +5 −0
  107. arch/arm/mach-omap2/twl-common.c +2 −1
  108. arch/arm/mach-omap2/vc.c +1 −1
  109. arch/arm/mach-pxa/hx4700.c +7 −1
  110. arch/arm/mach-pxa/spitz_pm.c +2 −6
  111. arch/arm/mach-s3c24xx/s3c2416.c +2 −0
  112. arch/arm/mach-s3c24xx/s3c2443.c +4 −0
  113. arch/arm/mach-s5p64x0/common.c +3 −0
  114. arch/arm/mach-s5pc100/common.c +3 −0
  115. arch/arm/mach-s5pv210/common.c +3 −0
  116. arch/arm/mach-shmobile/setup-r8a7779.c +1 −1
  117. arch/arm/mach-spear13xx/include/mach/spear1310_misc_regs.h +0 −0
  118. arch/arm/mach-spear13xx/include/mach/spear1340_misc_regs.h +0 −0
  119. arch/arm/mach-ux500/cpu.c +1 −0
  120. arch/arm/mm/alignment.c +4 −2
  121. arch/arm/mm/dma-mapping.c +1 −1
  122. arch/arm/mm/proc-v6.S +1 −1
  123. arch/arm/mm/vmregion.h +0 −1
  124. arch/arm/plat-mxc/devices/platform-mxc-mmc.c +1 −1
  125. arch/arm/plat-omap/Kconfig +1 −0
  126. arch/arm/plat-omap/i2c.c +21 −0
  127. arch/arm/plat-omap/include/plat/omap-serial.h +2 −2
  128. arch/arm/plat-omap/include/plat/omap_hwmod.h +6 −0
  129. arch/arm/plat-s3c24xx/dma.c +5 −4
  130. arch/arm/plat-samsung/include/plat/spi-core.h +30 −0
  131. arch/arm/tools/Makefile +1 −1
  132. arch/arm/vfp/vfpmodule.c +6 −3
  133. arch/arm/xen/enlighten.c +11 −0
  134. arch/arm/xen/hypercall.S +5 −9
  135. arch/arm64/Kconfig +1 −0
  136. arch/arm64/include/asm/elf.h +1 −4
  137. arch/arm64/include/asm/fpsimd.h +2 −3
  138. arch/arm64/include/asm/io.h +5 −5
  139. arch/arm64/include/asm/pgtable-hwdef.h +4 −2
  140. arch/arm64/include/asm/pgtable.h +20 −20
  141. arch/arm64/include/asm/processor.h +2 −0
  142. arch/arm64/include/asm/unistd.h +0 −1
  143. arch/arm64/include/asm/unistd32.h +1 −1
  144. arch/arm64/kernel/perf_event.c +2 −8
  145. arch/arm64/kernel/process.c +0 −18
  146. arch/arm64/kernel/smp.c +1 −2
  147. arch/arm64/mm/init.c +1 −1
  148. arch/c6x/include/asm/setup.h +33 −0
  149. arch/c6x/include/uapi/asm/Kbuild +2 −0
  150. arch/c6x/include/uapi/asm/kvm_para.h +0 −1
  151. arch/c6x/include/uapi/asm/setup.h +3 −30
  152. arch/c6x/kernel/entry.S +3 −2
  153. arch/frv/Kconfig +1 −0
  154. arch/frv/boot/Makefile +6 −4
  155. arch/frv/include/asm/unistd.h +0 −1
  156. arch/frv/kernel/entry.S +3 −25
  157. arch/frv/kernel/process.c +3 −2
  158. arch/frv/mb93090-mb00/pci-dma-nommu.c +1 −0
  159. arch/h8300/include/asm/cache.h +2 −1
  160. arch/ia64/mm/init.c +0 −1
  161. arch/m68k/include/asm/signal.h +3 −3
  162. arch/microblaze/kernel/signal.c +1 −1
  163. arch/mips/cavium-octeon/executive/cvmx-l2c.c +1 −0
  164. arch/mips/fw/arc/misc.c +1 −0
  165. arch/mips/include/asm/bitops.h +39 −89
  166. arch/mips/include/asm/compat.h +1 −1
  167. arch/mips/include/asm/hugetlb.h +11 −1
  168. arch/mips/include/asm/io.h +1 −0
  169. arch/mips/include/asm/irqflags.h +75 −132
  170. arch/mips/include/asm/thread_info.h +0 −6
  171. arch/mips/kernel/cpu-probe.c +0 −1
  172. arch/mips/kernel/entry.S +6 −1
  173. arch/mips/kernel/scall64-n32.S +3 −3
  174. arch/mips/kernel/setup.c +20 −6
  175. arch/mips/lib/Makefile +3 −2
  176. arch/mips/lib/bitops.c +179 −0
  177. arch/mips/lib/mips-atomic.c +176 −0
  178. arch/mips/mm/tlb-r4k.c +4 −14
  179. arch/mips/mti-malta/malta-platform.c +2 −1
  180. arch/openrisc/kernel/signal.c +2 −4
  181. arch/parisc/kernel/signal32.c +4 −2
  182. arch/parisc/kernel/sys_parisc.c +2 −0
  183. arch/parisc/kernel/syscall_table.S +1 −1
  184. arch/powerpc/boot/dts/mpc5200b.dtsi +6 −0
  185. arch/powerpc/boot/dts/o2d.dtsi +0 −6
  186. arch/powerpc/boot/dts/pcm030.dts +6 −1
  187. arch/powerpc/platforms/52xx/mpc52xx_pic.c +5 −4
  188. arch/powerpc/platforms/pseries/eeh_pe.c +1 −1
  189. arch/powerpc/platforms/pseries/msi.c +2 −1
  190. arch/s390/Kconfig +1 −0
  191. arch/s390/include/asm/cio.h +2 −0
  192. arch/s390/include/asm/compat.h +1 −1
  193. arch/s390/include/asm/pgtable.h +22 −13
  194. arch/s390/include/asm/topology.h +3 −0
  195. arch/s390/include/uapi/asm/ptrace.h +2 −2
  196. arch/s390/kernel/compat_signal.c +12 −2
  197. arch/s390/kernel/compat_wrapper.S +1 −1
  198. arch/s390/kernel/sclp.S +7 −1
  199. arch/s390/kernel/signal.c +12 −2
  200. arch/s390/kernel/topology.c +4 −2
  201. arch/s390/lib/uaccess_pt.c +1 −1
  202. arch/s390/mm/gup.c +3 −4
  203. arch/score/kernel/signal.c +2 −5
  204. arch/sh/kernel/signal_64.c +2 −4
  205. arch/sparc/Kconfig +1 −0
  206. arch/sparc/boot/piggyback.c +6 −6
  207. arch/sparc/crypto/Makefile +8 −8
  208. arch/sparc/crypto/aes_glue.c +2 −0
  209. arch/sparc/crypto/camellia_glue.c +2 −0
  210. arch/sparc/crypto/crc32c_glue.c +2 −0
  211. arch/sparc/crypto/des_glue.c +2 −0
  212. arch/sparc/crypto/md5_glue.c +2 −0
  213. arch/sparc/crypto/sha1_glue.c +2 −0
  214. arch/sparc/crypto/sha256_glue.c +2 −0
  215. arch/sparc/crypto/sha512_glue.c +2 −0
  216. arch/sparc/include/asm/atomic_64.h +3 −1
  217. arch/sparc/include/asm/backoff.h +59 −10
  218. arch/sparc/include/asm/compat.h +3 −2
  219. arch/sparc/include/asm/processor_64.h +16 −1
  220. arch/sparc/include/asm/prom.h +8 −0
  221. arch/sparc/include/asm/thread_info_64.h +5 −0
  222. arch/sparc/include/asm/ttable.h +16 −8
  223. arch/sparc/include/uapi/asm/unistd.h +6 −1
  224. arch/sparc/kernel/entry.h +7 −0
  225. arch/sparc/kernel/leon_kernel.c +4 −2
  226. arch/sparc/kernel/perf_event.c +16 −6
  227. arch/sparc/kernel/process_64.c +23 −19
  228. arch/sparc/kernel/ptrace_64.c +2 −2
  229. arch/sparc/kernel/setup_64.c +21 −0
  230. arch/sparc/kernel/signal_64.c +1 −3
  231. arch/sparc/kernel/sys32.S +1 −1
  232. arch/sparc/kernel/sys_sparc_64.c +5 −0
  233. arch/sparc/kernel/syscalls.S +12 −2
  234. arch/sparc/kernel/systbls_32.S +1 −0
  235. arch/sparc/kernel/systbls_64.S +3 −1
  236. arch/sparc/kernel/unaligned_64.c +23 −13
  237. arch/sparc/kernel/visemul.c +14 −9
  238. arch/sparc/kernel/vmlinux.lds.S +5 −0
  239. arch/sparc/kernel/winfixup.S +2 −0
  240. arch/sparc/lib/atomic_64.S +15 −1
  241. arch/sparc/lib/ksyms.c +1 −0
  242. arch/sparc/math-emu/math_64.c +1 −1
  243. arch/um/kernel/exec.c +2 −1
  244. arch/unicore32/Kconfig +6 −1
  245. arch/unicore32/include/asm/Kbuild +0 −1
  246. arch/unicore32/include/asm/bug.h +0 −5
  247. arch/unicore32/include/asm/cmpxchg.h +1 −1
  248. arch/unicore32/include/asm/kvm_para.h +0 −1
  249. arch/unicore32/include/asm/processor.h +0 −5
  250. arch/unicore32/include/asm/ptrace.h +1 −75
  251. arch/unicore32/include/uapi/asm/Kbuild +7 −0
  252. arch/unicore32/include/uapi/asm/byteorder.h +0 −0
  253. arch/unicore32/include/uapi/asm/ptrace.h +90 −0
  254. arch/unicore32/include/uapi/asm/sigcontext.h +0 −0
  255. arch/unicore32/include/uapi/asm/unistd.h +1 −0
  256. arch/unicore32/kernel/entry.S +7 −13
  257. arch/unicore32/kernel/process.c +14 −44
  258. arch/unicore32/kernel/setup.h +6 −0
  259. arch/unicore32/kernel/sys.c +0 −63
  260. arch/unicore32/mm/fault.c +27 −10
  261. arch/x86/boot/compressed/eboot.c +2 −0
  262. arch/x86/boot/header.S +0 −3
  263. arch/x86/include/asm/Kbuild +3 −0
  264. arch/x86/include/asm/efi.h +4 −2
  265. arch/x86/include/asm/fpu-internal.h +9 −6
  266. arch/x86/include/asm/ptrace.h +4 −11
  267. arch/x86/include/asm/xen/hypercall.h +7 −14
  268. arch/x86/include/asm/xen/hypervisor.h +0 −1
  269. arch/x86/kernel/apic/io_apic.c +3 −0
  270. arch/x86/kernel/cpu/amd.c +14 −0
  271. arch/x86/kernel/cpu/mcheck/mce_amd.c +1 −1
  272. arch/x86/kernel/cpu/mcheck/mce_intel.c +18 −13
  273. arch/x86/kernel/cpu/perf_event_intel_uncore.c +28 −17
  274. arch/x86/kernel/cpu/perf_event_knc.c +82 −11
  275. arch/x86/kernel/cpu/perf_event_p6.c +112 −15
  276. arch/x86/kernel/e820.c +3 −0
  277. arch/x86/kernel/entry_64.S +7 −7
  278. arch/x86/kernel/head_32.S +7 −2
  279. arch/x86/kernel/microcode_amd.c +6 −2
  280. arch/x86/kernel/ptrace.c +37 −0
  281. arch/x86/kernel/setup.c +20 −7
  282. arch/x86/kernel/smpboot.c +5 −0
  283. arch/x86/kvm/cpuid.h +3 −0
  284. arch/x86/kvm/emulate.c +1 −2
  285. arch/x86/kvm/vmx.c +7 −4
  286. arch/x86/kvm/x86.c +37 −26
  287. arch/x86/mm/init.c +31 −27
  288. arch/x86/mm/init_64.c +6 −1
  289. arch/x86/mm/tlb.c +1 −1
  290. arch/x86/pci/ce4100.c +13 −0
  291. arch/x86/platform/ce4100/ce4100.c +24 −0
  292. arch/x86/platform/efi/efi.c +28 −19
  293. arch/x86/platform/efi/efi_64.c +5 −2
  294. arch/x86/xen/mmu.c +20 −1
  295. arch/xtensa/Kconfig +2 −0
  296. arch/xtensa/include/asm/io.h +4 −0
  297. arch/xtensa/include/asm/processor.h +1 −3
  298. arch/xtensa/include/asm/syscall.h +1 −1
  299. arch/xtensa/include/asm/unistd.h +5 −10
  300. arch/xtensa/include/uapi/asm/unistd.h +4 −12
  301. arch/xtensa/kernel/entry.S +13 −44
  302. arch/xtensa/kernel/process.c +71 −57
  303. arch/xtensa/kernel/syscall.c +3 −4
  304. arch/xtensa/kernel/xtensa_ksyms.c +0 −1
  305. block/Kconfig +1 −1
  306. block/blk-cgroup.c +10 −0
  307. block/blk-core.c +2 −1
  308. block/blk-exec.c +7 −1
  309. crypto/cryptd.c +8 −3
  310. drivers/acpi/glue.c +1 −0
  311. drivers/acpi/processor_driver.c +1 −0
  312. drivers/acpi/video.c +7 −4
  313. drivers/ata/ahci_platform.c +1 −1
  314. drivers/ata/libata-acpi.c +8 −3
  315. drivers/ata/libata-core.c +4 −0
  316. drivers/ata/libata-scsi.c +2 −0
  317. drivers/ata/pata_arasan_cf.c +7 −1
  318. drivers/ata/sata_highbank.c +2 −2
  319. drivers/ata/sata_svw.c +35 −0
  320. drivers/atm/ambassador.c +1 −0
  321. drivers/base/Kconfig +1 −1
  322. drivers/base/dma-coherent.c +2 −3
  323. drivers/base/dma-contiguous.c +1 −4
  324. drivers/base/firmware_class.c +151 −115
  325. drivers/base/platform.c +7 −0
  326. drivers/base/power/domain.c +4 −1
  327. drivers/base/power/qos.c +1 −1
  328. drivers/bcma/main.c +3 −2
  329. drivers/block/Kconfig +8 −7
  330. drivers/block/aoe/aoecmd.c +1 −1
  331. drivers/block/cciss.c +0 −1
  332. drivers/block/floppy.c +50 −43
  333. drivers/block/loop.c +15 −2
  334. drivers/block/mtip32xx/mtip32xx.c +25 −8
  335. drivers/block/mtip32xx/mtip32xx.h +5 −2
  336. drivers/block/xen-blkback/common.h +2 −2
  337. drivers/block/xen-blkback/xenbus.c +4 −5
  338. drivers/bluetooth/ath3k.c +1 −0
  339. drivers/bluetooth/btusb.c +1 −0
  340. drivers/bus/omap-ocp2scp.c +65 −3
  341. drivers/char/hw_random/Kconfig +3 −3
  342. drivers/char/hw_random/ixp4xx-rng.c +4 −1
  343. drivers/char/raw.c +1 −1
  344. drivers/char/sonypi.c +1 −1
  345. drivers/clk/ux500/u8500_clk.c +46 −4
  346. drivers/cpufreq/cpufreq_stats.c +1 −0
  347. drivers/cpufreq/powernow-k8.c +2 −9
  348. drivers/crypto/Kconfig +1 −1
  349. drivers/crypto/ixp4xx_crypto.c +6 −6
  350. drivers/dma/Kconfig +11 −0
  351. drivers/dma/dw_dmac_regs.h +13 −5
  352. drivers/dma/imx-dma.c +3 −1
  353. drivers/dma/sirf-dma.c +2 −2
  354. drivers/edac/amd64_edac.c +4 −7
  355. drivers/edac/amd64_edac.h +1 −1
  356. drivers/edac/edac_mc.c +11 −3
  357. drivers/edac/edac_stub.c +1 −1
  358. drivers/edac/i7300_edac.c +4 −4
  359. drivers/edac/i7core_edac.c +3 −3
  360. drivers/edac/i82975x_edac.c +4 −7
  361. drivers/edac/mce_amd_inj.c +2 −2
  362. drivers/extcon/extcon-adc-jack.c +7 −3
  363. drivers/extcon/extcon-class.c +81 −61
  364. drivers/extcon/extcon-gpio.c +0 −1
  365. drivers/extcon/extcon-max77693.c +34 −12
  366. drivers/extcon/extcon-max8997.c +2 −4
  367. drivers/firewire/sbp2.c +2 −0
  368. drivers/gpio/Kconfig +2 −2
  369. drivers/gpio/gpio-74x164.c +1 −1
  370. drivers/gpio/gpio-mcp23s08.c +3 −3
  371. drivers/gpio/gpio-mvebu.c +26 −1
  372. drivers/gpio/gpio-omap.c +35 −0
  373. drivers/gpio/gpio-timberdale.c +2 −2
  374. drivers/gpio/gpiolib.c +7 −3
  375. drivers/gpu/drm/drm_fops.c +30 −14
  376. drivers/gpu/drm/exynos/Kconfig +1 −1
  377. drivers/gpu/drm/exynos/exynos_drm_connector.c +1 −0
  378. drivers/gpu/drm/exynos/exynos_drm_encoder.c +24 −17
  379. drivers/gpu/drm/exynos/exynos_drm_fbdev.c +2 −1
  380. drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 −2
  381. drivers/gpu/drm/exynos/exynos_drm_plane.c +0 −1
  382. drivers/gpu/drm/exynos/exynos_mixer.c +1 −1
  383. drivers/gpu/drm/i915/i915_dma.c +2 −1
  384. drivers/gpu/drm/i915/intel_bios.c +2 −9
  385. drivers/gpu/drm/i915/intel_crt.c +2 −2
  386. drivers/gpu/drm/i915/intel_display.c +11 −0
  387. drivers/gpu/drm/i915/intel_overlay.c +11 −3
  388. drivers/gpu/drm/i915/intel_panel.c +1 −1
  389. drivers/gpu/drm/i915/intel_pm.c +3 −9
  390. drivers/gpu/drm/i915/intel_sdvo.c +71 −30
  391. drivers/gpu/drm/i915/intel_sdvo_regs.h +2 −0
  392. drivers/gpu/drm/nouveau/core/core/mm.c +6 −3
  393. drivers/gpu/drm/nouveau/core/engine/disp/nv50.c +20 −11
  394. drivers/gpu/drm/nouveau/core/engine/graph/ctxnv40.c +9 −3
  395. drivers/gpu/drm/nouveau/core/engine/graph/nv40.c +5 −3
  396. drivers/gpu/drm/nouveau/core/engine/graph/nv40.h +1 −1
  397. drivers/gpu/drm/nouveau/core/engine/mpeg/nv40.c +1 −1
  398. drivers/gpu/drm/nouveau/core/include/core/mm.h +0 −1
  399. drivers/gpu/drm/nouveau/core/include/core/object.h +9 −5
  400. drivers/gpu/drm/nouveau/core/include/subdev/clock.h +2 −1
  401. drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c +1 −1
  402. drivers/gpu/drm/nouveau/core/subdev/clock/nva3.c +19 −0
  403. drivers/gpu/drm/nouveau/core/subdev/clock/nvc0.c +1 −0
  404. drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c +4 −6
  405. drivers/gpu/drm/nouveau/core/subdev/i2c/base.c +1 −1
  406. drivers/gpu/drm/nouveau/core/subdev/vm/nv41.c +1 −1
  407. drivers/gpu/drm/nouveau/nouveau_abi16.c +4 −0
  408. drivers/gpu/drm/nouveau/nouveau_connector.c +1 −1
  409. drivers/gpu/drm/nouveau/nouveau_display.c +21 −15
  410. drivers/gpu/drm/nouveau/nouveau_drm.c +23 −16
  411. drivers/gpu/drm/nouveau/nouveau_drm.h +2 −0
  412. drivers/gpu/drm/nouveau/nouveau_irq.c +9 −7
  413. drivers/gpu/drm/nouveau/nv04_dac.c +8 −8
  414. drivers/gpu/drm/nouveau/nv04_dfp.c +7 −7
  415. drivers/gpu/drm/nouveau/nv04_tv.c +4 −5
  416. drivers/gpu/drm/radeon/atombios_crtc.c +16 −28
  417. drivers/gpu/drm/radeon/atombios_encoders.c +5 −2
  418. drivers/gpu/drm/radeon/evergreen.c +3 −1
  419. drivers/gpu/drm/radeon/evergreen_cs.c +5 −1
  420. drivers/gpu/drm/radeon/evergreend.h +4 −0
  421. drivers/gpu/drm/radeon/ni.c +27 −18
  422. drivers/gpu/drm/radeon/nid.h +1 −0
  423. drivers/gpu/drm/radeon/radeon_agp.c +4 −1
  424. drivers/gpu/drm/radeon/radeon_atpx_handler.c +5 −5
  425. drivers/gpu/drm/radeon/radeon_connectors.c +21 −7
  426. drivers/gpu/drm/radeon/radeon_device.c +24 −36
  427. drivers/gpu/drm/radeon/radeon_gart.c +10 −12
  428. drivers/gpu/drm/radeon/radeon_gem.c +17 −1
  429. drivers/gpu/drm/radeon/radeon_legacy_crtc.c +13 −2
  430. drivers/gpu/drm/radeon/radeon_legacy_encoders.c +151 −29
  431. drivers/gpu/drm/radeon/radeon_object.c +0 −19
  432. drivers/gpu/drm/radeon/si.c +29 −19
  433. drivers/gpu/drm/radeon/sid.h +1 −0
  434. drivers/gpu/drm/ttm/ttm_page_alloc.c +4 −1
  435. drivers/gpu/drm/ttm/ttm_tt.c +0 −4
  436. drivers/gpu/drm/udl/udl_drv.h +1 −1
  437. drivers/gpu/drm/udl/udl_fb.c +7 −5
  438. drivers/gpu/drm/udl/udl_transfer.c +3 −2
  439. drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c +1 −1
  440. drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +5 −0
  441. drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +2 −0
  442. drivers/hid/hid-apple.c +6 −0
  443. drivers/hid/hid-core.c +6 −0
  444. drivers/hid/hid-ids.h +3 −0
  445. drivers/hid/hid-microsoft.c +13 −5
  446. drivers/hid/hid-multitouch.c +2 −3
  447. drivers/hid/hidraw.c +43 −26
  448. drivers/hv/channel.c +13 −11
  449. drivers/hwmon/asb100.c +1 −1
  450. drivers/hwmon/fam15h_power.c +2 −2
  451. drivers/hwmon/gpio-fan.c +2 −0
  452. drivers/hwmon/w83627ehf.c +1 −0
  453. drivers/hwmon/w83627hf.c +1 −1
  454. drivers/hwmon/w83781d.c +1 −1
  455. drivers/hwmon/w83791d.c +1 −1
  456. drivers/hwmon/w83792d.c +1 −1
  457. drivers/hwmon/w83l786ng.c +1 −1
  458. drivers/i2c/Makefile +1 −0
  459. drivers/i2c/busses/Kconfig +0 −1
  460. drivers/i2c/busses/Makefile +0 −1
  461. drivers/i2c/busses/i2c-at91.c +6 −1
  462. drivers/i2c/busses/i2c-i801.c +7 −4
  463. drivers/i2c/busses/i2c-mxs.c +16 −172
  464. drivers/i2c/busses/i2c-nomadik.c +7 −2
  465. drivers/i2c/busses/i2c-omap.c +17 −19
  466. drivers/i2c/busses/i2c-s3c2410.c +1 −0
  467. drivers/i2c/busses/i2c-tegra.c +1 −1
  468. drivers/i2c/i2c-stub.c +32 −34
  469. drivers/i2c/muxes/i2c-mux-pinctrl.c +1 −1
  470. drivers/iio/Kconfig +0 −1
  471. drivers/iio/Makefile +0 −1
  472. drivers/infiniband/hw/cxgb4/mem.c +1 −1
  473. drivers/infiniband/hw/mlx4/alias_GUID.c +1 −1
  474. drivers/infiniband/hw/mlx4/mad.c +40 −45
  475. drivers/infiniband/hw/mlx4/mcg.c +10 −8
  476. drivers/input/input-mt.c +4 −0
  477. drivers/input/keyboard/Kconfig +1 −0
  478. drivers/input/keyboard/pxa27x_keypad.c +3 −0
  479. drivers/input/misc/xen-kbdfront.c +4 −1
  480. drivers/input/mouse/bcm5974.c +21 −0
  481. drivers/input/mousedev.c +2 −2
  482. drivers/input/tablet/wacom_sys.c +49 −2
  483. drivers/input/tablet/wacom_wac.c +88 −3
  484. drivers/input/tablet/wacom_wac.h +5 −0
  485. drivers/input/touchscreen/Kconfig +1 −1
  486. drivers/input/touchscreen/ads7846.c +5 −1
  487. drivers/input/touchscreen/egalax_ts.c +21 −2
  488. drivers/input/touchscreen/tsc40.c +0 −1
  489. drivers/iommu/amd_iommu_init.c +32 −7
  490. drivers/iommu/intel-iommu.c +2 −2
  491. drivers/iommu/tegra-smmu.c +2 −1
  492. drivers/irqchip/irq-bcm2835.c +2 −1
  493. drivers/isdn/Kconfig +1 −1
  494. drivers/isdn/gigaset/bas-gigaset.c +16 −3
  495. drivers/isdn/i4l/Kconfig +1 −1
  496. drivers/isdn/i4l/isdn_common.c +0 −4
  497. drivers/leds/ledtrig-cpu.c +0 −21
  498. drivers/md/dm.c +7 −1
  499. drivers/md/faulty.c +4 −1
  500. drivers/md/md.c +20 −7
  501. drivers/md/raid1.c +2 −2
  502. drivers/md/raid10.c +79 −69
  503. drivers/md/raid5.c +43 −36
  504. drivers/media/dvb-frontends/stv0900_core.c +3 −3
  505. drivers/media/i2c/adv7604.c +272 −105
  506. drivers/media/i2c/soc_camera/mt9v022.c +8 −3
  507. drivers/media/platform/exynos-gsc/gsc-core.c +4 −2
  508. drivers/media/platform/exynos-gsc/gsc-m2m.c +2 −2
  509. drivers/media/platform/exynos-gsc/gsc-regs.h +8 −8
  510. drivers/media/platform/omap3isp/ispccdc.c +2 −2
  511. drivers/media/platform/omap3isp/ispstat.c +2 −2
  512. drivers/media/platform/omap3isp/ispstat.h +2 −2
  513. drivers/media/platform/omap3isp/ispvideo.c +1 −1
  514. drivers/media/platform/s5p-fimc/Kconfig +1 −0
  515. drivers/media/platform/s5p-fimc/fimc-capture.c +10 −4
  516. drivers/media/platform/s5p-fimc/fimc-lite.c +7 −3
  517. drivers/media/platform/s5p-fimc/fimc-m2m.c +1 −2
  518. drivers/media/platform/s5p-fimc/fimc-mdevice.c +20 −21
  519. drivers/media/platform/s5p-mfc/s5p_mfc.c +2 −5
  520. drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +1 −1
  521. drivers/media/platform/sh_vou.c +2 −1
  522. drivers/media/platform/soc_camera/mx1_camera.c +0 −9
  523. drivers/media/platform/soc_camera/mx2_camera.c +9 −4
  524. drivers/media/platform/soc_camera/mx3_camera.c +3 −2
  525. drivers/media/platform/soc_camera/omap1_camera.c +2 −2
  526. drivers/media/platform/soc_camera/pxa_camera.c +2 −2
  527. drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c +7 −6
  528. drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +5 −6
  529. drivers/media/usb/dvb-usb-v2/dvb_usb_urb.c +1 −3
  530. drivers/media/usb/dvb-usb-v2/rtl28xxu.c +4 −0
  531. drivers/mfd/arizona-core.c +11 −3
  532. drivers/mfd/arizona-irq.c +1 −0
  533. drivers/mfd/twl-core.c +1 −1
  534. drivers/mfd/twl4030-irq.c +2 −1
  535. drivers/mfd/wm5102-tables.c +1 −518
  536. drivers/mmc/host/dw_mmc-exynos.c +4 −4
  537. drivers/mmc/host/dw_mmc-pltfm.c +3 −3
  538. drivers/mmc/host/dw_mmc-pltfm.h +1 −1
  539. drivers/mmc/host/dw_mmc.c +34 −28
  540. drivers/mmc/host/mxcmmc.c +1 −1
  541. drivers/mmc/host/omap_hsmmc.c +12 −7
  542. drivers/mmc/host/sdhci-dove.c +20 −18
  543. drivers/mmc/host/sdhci-of-esdhc.c +11 −0
  544. drivers/mmc/host/sdhci-pci.c +1 −1
  545. drivers/mmc/host/sdhci-pltfm.c +7 −0
  546. drivers/mmc/host/sdhci-s3c.c +23 −14
  547. drivers/mmc/host/sdhci.c +28 −16
  548. drivers/mmc/host/sdhci.h +1 −0
  549. drivers/mmc/host/sh_mmcif.c +3 −7
  550. drivers/mtd/devices/slram.c +1 −1
  551. drivers/mtd/nand/nand_base.c +6 −4
  552. drivers/mtd/ofpart.c +1 −1
  553. drivers/mtd/onenand/onenand_base.c +1 −1
  554. drivers/mtd/ubi/wl.c +16 −10
  555. drivers/net/bonding/bond_main.c +36 −64
  556. drivers/net/bonding/bond_sysfs.c +14 −26
  557. drivers/net/can/flexcan.c +16 −3
  558. drivers/net/can/sja1000/peak_pci.c +11 −2
  559. drivers/net/can/usb/peak_usb/pcan_usb.c +6 −2
  560. drivers/net/can/usb/peak_usb/pcan_usb_pro.c +6 −2
  561. drivers/net/ethernet/8390/ne.c +1 −0
  562. drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +1 −1
  563. drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +115 −47
  564. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +18 −6
  565. drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +19 −0
  566. drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +5 −34
  567. drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h +3 −0
  568. drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +5 −1
  569. drivers/net/ethernet/freescale/gianfar.c +4 −1
  570. drivers/net/ethernet/freescale/gianfar_ptp.c +1 −1
  571. drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +3 −0
  572. drivers/net/ethernet/jme.c +12 −24
  573. drivers/net/ethernet/marvell/skge.c +1 −1
  574. drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c +1 −1
  575. drivers/net/ethernet/mellanox/mlx4/en_tx.c +1 −2
  576. drivers/net/ethernet/mellanox/mlx4/eq.c +14 −10
  577. drivers/net/ethernet/mellanox/mlx4/main.c +4 −1
  578. drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +0 −6
  579. drivers/net/ethernet/micrel/ksz884x.c +6 −14
  580. drivers/net/ethernet/nxp/lpc_eth.c +1 −0
  581. drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +37 −79
  582. drivers/net/ethernet/qlogic/qla3xxx.c +7 −2
  583. drivers/net/ethernet/realtek/8139cp.c +19 −14
  584. drivers/net/ethernet/realtek/r8169.c +5 −0
  585. drivers/net/ethernet/sis/sis900.c +1 −1
  586. drivers/net/ethernet/smsc/smsc911x.c +15 −2
  587. drivers/net/ethernet/ti/Kconfig +1 −1
  588. drivers/net/ethernet/tile/tilegx.c +20 −17
  589. drivers/net/ethernet/xilinx/xilinx_axienet_main.c +9 −7
  590. drivers/net/ethernet/xscale/ixp4xx_eth.c +5 −3
  591. drivers/net/irda/sir_dev.c +1 −1
  592. drivers/net/phy/Kconfig +5 −0
  593. drivers/net/phy/Makefile +1 −0
  594. drivers/net/phy/at803x.c +176 −0
  595. drivers/net/phy/mdio-gpio.c +7 −4
  596. drivers/net/team/team.c +3 −1
  597. drivers/net/team/team_mode_broadcast.c +3 −3
  598. drivers/net/usb/cdc_eem.c +2 −1
  599. drivers/net/usb/cdc_ether.c +26 −15
  600. drivers/net/usb/cdc_ncm.c +18 −4
  601. drivers/net/usb/ipheth.c +5 −0
  602. drivers/net/usb/qmi_wwan.c +56 −0
  603. drivers/net/usb/smsc95xx.c +3 −2
  604. drivers/net/usb/usbnet.c +8 −3
  605. drivers/net/vmxnet3/vmxnet3_drv.c +45 −20
  606. drivers/net/vxlan.c +8 −4
  607. drivers/net/wan/ixp4xx_hss.c +6 −4
  608. drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h +82 −82
  609. drivers/net/wireless/ath/ath9k/hif_usb.c +1 −0
  610. drivers/net/wireless/ath/ath9k/hw.c +1 −1
  611. drivers/net/wireless/ath/ath9k/xmit.c +8 −2
  612. drivers/net/wireless/b43/main.c +4 −0
  613. drivers/net/wireless/b43legacy/pio.c +1 −1
  614. drivers/net/wireless/brcm80211/brcmfmac/usb.c +1 −1
  615. drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +26 −46
  616. drivers/net/wireless/ipw2x00/ipw2200.c +1 −1
  617. drivers/net/wireless/iwlwifi/dvm/devices.c +24 −15
  618. drivers/net/wireless/iwlwifi/dvm/mac80211.c +15 −1
  619. drivers/net/wireless/iwlwifi/dvm/main.c +1 −1
  620. drivers/net/wireless/iwlwifi/dvm/rxon.c +6 −6
  621. drivers/net/wireless/iwlwifi/pcie/rx.c +21 −2
  622. drivers/net/wireless/iwlwifi/pcie/tx.c +0 −8
  623. drivers/net/wireless/mwifiex/cfg80211.c +5 −2
  624. drivers/net/wireless/mwifiex/cmdevt.c +8 −3
  625. drivers/net/wireless/mwifiex/scan.c +5 −8
  626. drivers/net/wireless/mwifiex/sdio.c +6 −5
  627. drivers/net/wireless/rt2x00/rt2500usb.c +1 −0
  628. drivers/net/wireless/rt2x00/rt2800lib.c +1 −1
  629. drivers/net/wireless/rt2x00/rt2800usb.c +1 −0
  630. drivers/net/wireless/rt2x00/rt73usb.c +1 −0
  631. drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +1 −0
  632. drivers/net/wireless/rtlwifi/usb.c +1 −1
  633. drivers/net/xen-netfront.c +77 −21
  634. drivers/nfc/pn533.c +14 −11
  635. drivers/pci/bus.c +0 −3
  636. drivers/pci/pci-driver.c +2 −10
  637. drivers/pci/pci-sysfs.c +0 −34
  638. drivers/pci/pci.c +32 −0
  639. drivers/pci/pci.h +2 −0
  640. drivers/pci/pcie/aer/aerdrv_core.c +16 −4
  641. drivers/pci/pcie/portdrv_core.c +2 −1
  642. drivers/pci/proc.c +8 −0
  643. drivers/pinctrl/Kconfig +3 −1
  644. drivers/pinctrl/core.c +3 −1
  645. drivers/pinctrl/pinconf.c +0 −4
  646. drivers/pinctrl/pinctrl-nomadik.c +3 −3
  647. drivers/pinctrl/pinctrl-tegra.c +1 −1
  648. drivers/pinctrl/pinctrl-tegra30.c +12 −12
  649. drivers/pinctrl/spear/pinctrl-spear.c +1 −1
  650. drivers/pinctrl/spear/pinctrl-spear1310.c +320 −45
  651. drivers/pinctrl/spear/pinctrl-spear1340.c +39 −2
  652. drivers/pinctrl/spear/pinctrl-spear320.c +6 −2
  653. drivers/pinctrl/spear/pinctrl-spear3xx.h +1 −0
  654. drivers/rapidio/rio.c +1 −1
  655. drivers/regulator/core.c +20 −13
  656. drivers/remoteproc/remoteproc_virtio.c +12 −6
  657. drivers/rtc/rtc-imxdi.c +2 −0
  658. drivers/rtc/rtc-tps65910.c +3 −3
  659. drivers/s390/char/con3215.c +5 −7
  660. drivers/s390/cio/css.h +0 −3
  661. drivers/s390/cio/device.c +1 −7
  662. drivers/s390/cio/idset.c +1 −2
  663. drivers/s390/net/qeth_core_main.c +22 −2
  664. drivers/s390/net/qeth_l2_main.c +8 −5
  665. drivers/scsi/isci/request.c +1 −1
  666. drivers/scsi/megaraid/megaraid_sas.h +1 −1
  667. drivers/scsi/megaraid/megaraid_sas_base.c +6 −8
  668. drivers/scsi/qla2xxx/qla_mid.c +3 −0
  669. drivers/scsi/qla2xxx/qla_target.c +11 −14
  670. drivers/scsi/qla2xxx/qla_target.h +1 −0
  671. drivers/scsi/qla2xxx/tcm_qla2xxx.c +76 −1
  672. drivers/scsi/qla2xxx/tcm_qla2xxx.h +2 −0
  673. drivers/scsi/qlogicpti.c +1 −12
  674. drivers/scsi/scsi.c +45 −0
  675. drivers/scsi/scsi_lib.c +17 −5
  676. drivers/scsi/sd.c +179 −23
  677. drivers/scsi/sd.h +7 −0
  678. drivers/spi/spi-mxs.c +2 −1
  679. drivers/spi/spi-pl022.c +0 −3
  680. drivers/spi/spi-rspi.c +34 −22
  681. drivers/staging/android/android_alarm.h +1 −3
  682. drivers/staging/android/binder.c +28 −2
  683. drivers/staging/comedi/drivers/8255_pci.c +2 −0
  684. drivers/staging/comedi/drivers/amplc_dio200.c +2 −0
  685. drivers/staging/comedi/drivers/amplc_pc236.c +3 −2
  686. drivers/staging/comedi/drivers/amplc_pc263.c +2 −0
  687. drivers/staging/comedi/drivers/das08.c +2 −0
  688. drivers/staging/comedi/drivers/ni_daq_700.c +1 −1
  689. drivers/staging/comedi/drivers/ni_labpc.c +2 −0
  690. drivers/staging/iio/accel/adis16201_core.c +13 −11
  691. drivers/staging/iio/accel/adis16203_core.c +11 −9
  692. drivers/staging/iio/accel/adis16204_core.c +12 −10
  693. drivers/staging/iio/accel/adis16209_core.c +10 −8
  694. drivers/staging/iio/accel/adis16220_core.c +11 −8
  695. drivers/staging/iio/accel/adis16240_core.c +12 −11
  696. drivers/staging/iio/gyro/adis16260_core.c +17 −12
  697. drivers/staging/iio/imu/adis16400.h +2 −0
  698. drivers/staging/iio/imu/adis16400_core.c +44 −26
  699. drivers/staging/ipack/bridges/tpci200.c +1 −0
  700. drivers/staging/omapdrm/omap_gem.c +2 −2
  701. drivers/staging/ramster/Kconfig +1 −0
  702. drivers/staging/tidspbridge/core/tiomap3430.c +26 −11
  703. drivers/staging/tidspbridge/hw/hw_mmu.c +20 −95
  704. drivers/staging/tidspbridge/hw/hw_mmu.h +14 −17
  705. drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h +2 −2
  706. drivers/staging/tidspbridge/include/dspbridge/host_os.h +2 −2
  707. drivers/staging/tidspbridge/rmgr/drv.c +4 −4
  708. drivers/staging/tidspbridge/rmgr/node.c +15 −6
  709. drivers/staging/zram/zram_drv.c +10 −2
  710. drivers/target/iscsi/iscsi_target.c +3 −1
  711. drivers/target/iscsi/iscsi_target_core.h +1 −0
  712. drivers/target/iscsi/iscsi_target_login.c +1 −0
  713. drivers/target/iscsi/iscsi_target_util.c +20 −2
  714. drivers/target/iscsi/iscsi_target_util.h +1 −0
  715. drivers/target/target_core_configfs.c +2 −1
  716. drivers/target/target_core_device.c +9 −9
  717. drivers/target/target_core_sbc.c +18 −0
  718. drivers/target/target_core_spc.c +2 −0
  719. drivers/target/target_core_tmr.c +3 −3
  720. drivers/target/target_core_transport.c +4 −3
  721. drivers/thermal/exynos_thermal.c +1 −1
  722. drivers/thermal/rcar_thermal.c +1 −1
  723. drivers/tty/hvc/hvc_console.c +0 −7
  724. drivers/tty/serial/max310x.c +1 −0
  725. drivers/tty/serial/omap-serial.c +6 −6
  726. drivers/tty/vt/vt.c +4 −4
  727. drivers/usb/core/hcd.c +16 −0
  728. drivers/usb/core/hub.c +5 −2
  729. drivers/usb/early/ehci-dbgp.c +9 −6
  730. drivers/usb/gadget/net2272.c +3 −1
  731. drivers/usb/gadget/u_ether.c +2 −1
  732. drivers/usb/host/ehci-ls1x.c +1 −1
  733. drivers/usb/host/ohci-xls.c +1 −1
  734. drivers/usb/host/pci-quirks.c +8 −1
  735. drivers/usb/host/xhci-dbg.c +0 −2
  736. drivers/usb/host/xhci-hub.c +6 −3
  737. drivers/usb/host/xhci-ring.c +11 −0
  738. drivers/usb/host/xhci.c +4 −4
  739. drivers/usb/misc/ezusb.c +1 −0
  740. drivers/usb/musb/musb_dsps.c +4 −4
  741. drivers/usb/musb/musb_gadget.c +26 −4
  742. drivers/usb/musb/ux500.c +1 −1
  743. drivers/usb/otg/Kconfig +2 −2
  744. drivers/usb/renesas_usbhs/fifo.c +1 −0
  745. drivers/usb/renesas_usbhs/mod_host.c +5 −0
  746. drivers/usb/serial/ch341.c +16 −7
  747. drivers/usb/serial/digi_acceleport.c +67 −50
  748. drivers/usb/serial/ipw.c +3 −4
  749. drivers/usb/serial/keyspan.c +87 −93
  750. drivers/usb/serial/keyspan.h +8 −0
  751. drivers/usb/serial/mct_u232.c +33 −26
  752. drivers/usb/serial/metro-usb.c +19 −46
  753. drivers/usb/serial/mos7720.c +32 −30
  754. drivers/usb/serial/mos7840.c +207 −288
  755. drivers/usb/serial/omninet.c +18 −18
  756. drivers/usb/serial/opticon.c +9 −2
  757. drivers/usb/serial/option.c +29 −3
  758. drivers/usb/serial/qcserial.c +17 −16
  759. drivers/usb/serial/quatech2.c +61 −74
  760. drivers/usb/serial/sierra.c +68 −65
  761. drivers/usb/serial/usb-wwan.h +1 −1
  762. drivers/usb/serial/usb_wwan.c +53 −77
  763. drivers/usb/serial/whiteheat.c +27 −33
  764. drivers/usb/storage/scsiglue.c +6 −0
  765. drivers/usb/storage/unusual_devs.h +6 −0
  766. drivers/vhost/net.c +2 −1
  767. drivers/vhost/vhost.c +1 −1
  768. drivers/video/backlight/Kconfig +2 −1
  769. drivers/video/omap2/dss/dsi.c +11 −2
  770. drivers/video/omap2/dss/dss.c +11 −7
  771. drivers/video/omap2/dss/hdmi.c +3 −1
  772. drivers/video/omap2/omapfb/omapfb-ioctl.c +1 −1
  773. drivers/video/xen-fbfront.c +4 −1
  774. drivers/virtio/virtio.c +3 −1
  775. drivers/xen/Kconfig +2 −0
  776. drivers/xen/Makefile +1 −0
  777. drivers/xen/events.c +1 −1
  778. drivers/xen/fallback.c +80 −0
  779. drivers/xen/gntdev.c +19 −17
  780. drivers/xen/privcmd.c +11 −7
  781. drivers/xen/xenbus/xenbus_dev_frontend.c +1 −1
  782. fs/bio.c +4 −2
  783. fs/block_dev.c +3 −120
  784. fs/btrfs/backref.c +12 −16
  785. fs/btrfs/backref.h +4 −0
  786. fs/btrfs/ctree.c +55 −15
  787. fs/btrfs/ctree.h +3 −0
  788. fs/btrfs/extent_io.c +2 −2
  789. fs/btrfs/inode.c +3 −4
  790. fs/btrfs/ioctl.c +4 −2
  791. fs/btrfs/qgroup.c +13 −4
  792. fs/btrfs/send.c +95 −61
  793. fs/btrfs/transaction.c +1 −1
  794. fs/btrfs/volumes.c +7 −0
  795. fs/buffer.c +113 −32
  796. fs/ceph/export.c +2 −0
  797. fs/cifs/cifsacl.c +20 −29
  798. fs/cifs/dir.c +10 −1
  799. fs/cifs/file.c +3 −3
  800. fs/cifs/readdir.c +4 −1
  801. fs/cifs/smb1ops.c +1 −2
  802. fs/compat_ioctl.c +2 −0
  803. fs/direct-io.c +5 −3
  804. fs/eventpoll.c +3 −35
  805. fs/exec.c +2 −1
  806. fs/ext3/balloc.c +3 −2
  807. fs/ext4/ialloc.c +9 −10
  808. fs/file.c +10 −9
  809. fs/fs-writeback.c +2 −0
  810. fs/gfs2/file.c +5 −9
  811. fs/gfs2/lops.c +2 −14
  812. fs/gfs2/quota.c +5 −2
  813. fs/gfs2/rgrp.c +21 −12
  814. fs/gfs2/super.c +2 −1
  815. fs/gfs2/trans.c +8 −0
  816. fs/inode.c +14 −2
  817. fs/internal.h +1 −0
  818. fs/jbd/transaction.c +2 −0
  819. fs/jffs2/file.c +21 −18
  820. fs/lockd/mon.c +32 −25
  821. fs/namei.c +7 −2
  822. fs/nfs/dir.c +4 −3
  823. fs/nfs/dns_resolve.c +3 −2
  824. fs/nfs/inode.c +4 −1
  825. fs/nfs/internal.h +4 −2
  826. fs/nfs/mount_clnt.c +1 −1
  827. fs/nfs/namespace.c +14 −5
  828. fs/nfs/nfs4namespace.c +2 −1
  829. fs/nfs/nfs4proc.c +28 −18
  830. fs/nfs/pnfs.c +2 −2
  831. fs/nfs/super.c +50 −1
  832. fs/nfs/unlink.c +1 −1
  833. fs/notify/fanotify/fanotify.c +1 −0
  834. fs/notify/fanotify/fanotify_user.c +2 −1
  835. fs/proc/base.c +112 −2
  836. fs/pstore/platform.c +2 −1
  837. fs/reiserfs/inode.c +7 −3
  838. fs/reiserfs/stree.c +4 −0
  839. fs/reiserfs/super.c +46 −14
  840. fs/sysfs/dir.c +8 −8
  841. fs/ubifs/find.c +10 −2
  842. fs/ubifs/lprops.c +6 −0
  843. fs/ubifs/ubifs.h +3 −0
  844. fs/xfs/xfs_alloc.c +2 −41
  845. fs/xfs/xfs_alloc.h +0 −3
  846. fs/xfs/xfs_alloc_btree.c +2 −0
  847. fs/xfs/xfs_aops.c +39 −15
  848. fs/xfs/xfs_attr_leaf.c +18 −2
  849. fs/xfs/xfs_bmap.c +54 −9
  850. fs/xfs/xfs_bmap.h +8 −1
  851. fs/xfs/xfs_buf.c +12 −2
  852. fs/xfs/xfs_buf_item.c +18 −0
  853. fs/xfs/xfs_fsops.c +19 −2
  854. fs/xfs/xfs_ialloc.c +1 −0
  855. fs/xfs/xfs_inode.c +2 −1
  856. fs/xfs/xfs_ioctl.c +1 −1
  857. fs/xfs/xfs_iomap.c +3 −1
  858. fs/xfs/xfs_log.c +16 −3
  859. fs/xfs/xfs_log_recover.c +1 −1
  860. include/drm/drm_pciids.h +4 −0
  861. include/linux/bug.h +1 −0
  862. include/linux/clk-provider.h +2 −2
  863. include/linux/dynamic_debug.h +1 −1
  864. include/linux/extcon.h +1 −1
  865. include/linux/fs.h +0 −5
  866. include/linux/gfp.h +4 −4
  867. include/linux/hashtable.h +192 −0
  868. include/linux/hw_breakpoint.h +1 −30
  869. include/linux/i2c-omap.h +1 −0
  870. include/linux/iio/iio.h +16 −0
  871. include/linux/kernel.h +7 −0
  872. include/linux/kvm_host.h +2 −13
  873. include/linux/memblock.h +1 −0
  874. include/linux/mempolicy.h +0 −16
  875. include/linux/mfd/max77693.h +13 −0
  876. include/linux/mm.h +0 −4
  877. include/linux/mmc/dw_mmc.h +3 −3
  878. include/linux/mmc/sdhci.h +1 −0
  879. include/linux/mmzone.h +1 −1
  880. include/linux/netdevice.h +3 −0
  881. include/linux/of_address.h +4 −0
  882. include/linux/percpu-rwsem.h +11 −17
  883. include/linux/platform_data/omap_ocp2scp.h +31 −0
  884. include/linux/ptp_clock_kernel.h +2 −1
  885. include/linux/raid/Kbuild +0 −2
  886. include/linux/raid/md_u.h +1 −140
  887. include/linux/rbtree_augmented.h +1 −0
  888. include/linux/rio.h +2 −0
  889. include/linux/spi/ads7846.h +3 −2
  890. include/linux/spi/tsc2005.h +0 −2
  891. include/linux/tcp.h +2 −1
  892. include/media/adv7604.h +10 −11
  893. include/net/cfg80211.h +10 −0
  894. include/net/tcp.h +1 −0
  895. include/net/xfrm.h +1 −1
  896. include/scsi/scsi_device.h +4 −0
  897. include/sound/core.h +3 −0
  898. include/trace/events/xen.h +8 −0
  899. include/uapi/linux/Kbuild +1 −0
  900. include/uapi/linux/eventpoll.h +0 −1
  901. include/uapi/linux/hw_breakpoint.h +30 −0
  902. include/uapi/linux/oom.h +9 −0
  903. include/uapi/linux/raid/Kbuild +2 −0
  904. include/uapi/linux/raid/md_p.h +0 −0
  905. include/uapi/linux/raid/md_u.h +155 −0
  906. include/uapi/linux/tcp.h +1 −0
  907. include/xen/hvm.h +32 −2
  908. init/main.c +2 −0
  909. kernel/Makefile +2 −4
  910. kernel/cgroup.c +10 −31
  911. kernel/events/hw_breakpoint.c +7 −5
  912. kernel/futex.c +39 −20
  913. kernel/modsign_pubkey.c +2 −2
  914. kernel/module.c +16 −11
  915. kernel/module_signing.c +7 −7
  916. kernel/pid_namespace.c +11 −1
  917. kernel/sched/auto_group.c +0 −4
  918. kernel/sched/auto_group.h +0 −5
  919. kernel/watchdog.c +5 −2
  920. kernel/workqueue.c +17 −7
  921. lib/Makefile +1 −1
  922. lib/asn1_decoder.c +1 −1
  923. lib/genalloc.c +1 −1
  924. lib/mpi/longlong.h +17 −2
  925. mm/bootmem.c +1 −9
  926. mm/compaction.c +9 −1
  927. mm/highmem.c +1 −1
  928. mm/memblock.c +24 −0
  929. mm/memcontrol.c +50 −17
  930. mm/memory-failure.c +8 −0
  931. mm/memory.c +4 −6
  932. mm/memory_hotplug.c +0 −7
  933. mm/mempolicy.c +0 −22
  934. mm/mmap.c +2 −0
  935. mm/mmu_notifier.c +13 −13
  936. mm/mmzone.c +1 −5
  937. mm/nobootmem.c +0 −3
  938. mm/page_alloc.c +33 −50
  939. mm/rmap.c +15 −5
  940. mm/shmem.c +31 −13
  941. mm/sparse.c +4 −6
  942. mm/swapfile.c +2 −2
  943. mm/vmscan.c +47 −60
  944. net/8021q/vlan.c +3 −1
  945. net/batman-adv/bridge_loop_avoidance.c +18 −9
  946. net/batman-adv/routing.c +7 −1
  947. net/batman-adv/soft-interface.c +6 −6
  948. net/batman-adv/translation-table.c +14 −1
  949. net/batman-adv/types.h +2 −0
  950. net/bluetooth/hci_core.c +2 −2
  951. net/bluetooth/mgmt.c +7 −5
  952. net/bluetooth/smp.c +5 −3
  953. net/can/bcm.c +3 −0
  954. net/ceph/messenger.c +4 −2
  955. net/core/dev.c +6 −2
  956. net/core/dev_addr_lists.c +2 −1
  957. net/core/net-sysfs.c +20 −0
  958. net/core/rtnetlink.c +2 −1
  959. net/core/skbuff.c +7 −5
  960. net/ipv4/icmp.c +2 −1
  961. net/ipv4/inet_diag.c +4 −1
  962. net/ipv4/ip_sockglue.c +22 −13
  963. net/ipv4/ip_vti.c +5 −0
  964. net/ipv4/ipmr.c +4 −0
  965. net/ipv4/netfilter/iptable_nat.c +3 −1
  966. net/ipv4/route.c +12 −6
  967. net/ipv4/tcp.c +13 −16
  968. net/ipv4/tcp_illinois.c +5 −3
  969. net/ipv4/tcp_input.c +29 −8
  970. net/ipv4/tcp_ipv4.c +1 −0
  971. net/ipv4/tcp_metrics.c +10 −4
  972. net/ipv4/tcp_minisocks.c +1 −0
  973. net/ipv4/tcp_output.c +14 −5
  974. net/ipv4/tcp_timer.c +2 −2
  975. net/ipv4/xfrm4_policy.c +1 −12
  976. net/ipv6/inet6_connection_sock.c +2 −1
  977. net/ipv6/ip6_gre.c +4 −4
  978. net/ipv6/ipv6_sockglue.c +1 −0
  979. net/ipv6/ndisc.c +1 −2
  980. net/ipv6/netfilter/ip6table_nat.c +3 −1
  981. net/ipv6/netfilter/nf_conntrack_reasm.c +2 −2
  982. net/ipv6/route.c +2 −2
  983. net/irda/irttp.c +1 −0
  984. net/l2tp/l2tp_eth.c +1 −0
  985. net/mac80211/cfg.c +3 −0
  986. net/mac80211/ibss.c +5 −5
  987. net/mac80211/ieee80211_i.h +2 −0
  988. net/mac80211/iface.c +1 −1
  989. net/mac80211/main.c +4 −2
  990. net/mac80211/mlme.c +23 −12
  991. net/mac80211/offchannel.c +0 −2
  992. net/mac80211/rx.c +56 −18
  993. net/mac80211/scan.c +1 −1
  994. net/mac80211/sta_info.c +10 −5
  995. net/mac80211/status.c +9 −0
  996. net/mac80211/tx.c +6 −3
  997. net/mac80211/util.c +39 −9
  998. net/mac80211/wpa.c +10 −4
  999. net/netfilter/ipset/ip_set_hash_ip.c +2 −2
  1000. net/netfilter/ipset/ip_set_hash_ipport.c +3 −4
  1001. net/netfilter/ipset/ip_set_hash_ipportip.c +3 −4
  1002. net/netfilter/ipset/ip_set_hash_ipportnet.c +5 −2
  1003. net/netfilter/ipset/ip_set_hash_netiface.c +1 −1
  1004. net/netfilter/ipvs/ip_vs_ctl.c +2 −1
  1005. net/netfilter/nf_conntrack_h323_main.c +2 −1
  1006. net/netfilter/nfnetlink_cttimeout.c +2 −1
  1007. net/netfilter/xt_CT.c +6 −4
  1008. net/netfilter/xt_TEE.c +1 −0
  1009. net/netfilter/xt_nat.c +4 −4
  1010. net/netlink/af_netlink.c +15 −4
  1011. net/nfc/llcp/llcp.c +1 −1
  1012. net/openvswitch/flow.c +5 −9
  1013. net/openvswitch/vport-netdev.c +1 −1
  1014. net/sched/sch_qfq.c +79 −30
  1015. net/sctp/chunk.c +14 −6
  1016. net/sctp/proc.c +4 −4
  1017. net/sctp/socket.c +3 −3
  1018. net/sctp/transport.c +1 −1
  1019. net/sunrpc/backchannel_rqst.c +1 −1
  1020. net/sunrpc/xprtsock.c +10 −31
  1021. net/tipc/handler.c +0 −1
  1022. net/wireless/core.c +1 −2
  1023. net/wireless/mlme.c +3 −9
  1024. net/wireless/reg.c +5 −5
  1025. net/wireless/util.c +8 −6
  1026. scripts/Makefile.modinst +2 −1
  1027. scripts/checkpatch.pl +4 −2
  1028. scripts/headers_install.pl +3 −0
  1029. scripts/kconfig/expr.h +2 −3
  1030. scripts/kconfig/list.h +91 −0
  1031. scripts/kconfig/lkc_proto.h +2 −2
  1032. scripts/kconfig/mconf.c +3 −3
  1033. scripts/kconfig/menu.c +8 −6
  1034. scripts/sign-file +3 −3
  1035. security/apparmor/policy.c +23 −1
  1036. security/device_cgroup.c +72 −29
  1037. security/selinux/netnode.c +2 −1
  1038. sound/core/compress_offload.c +7 −2
  1039. sound/core/control.c +5 −0
  1040. sound/core/hwdep.c +11 −1
  1041. sound/core/init.c +30 −20
  1042. sound/core/oss/mixer_oss.c +9 −2
  1043. sound/core/oss/pcm_oss.c +7 −0
  1044. sound/core/pcm.c +11 −2
  1045. sound/core/pcm_native.c +29 −6
  1046. sound/core/rawmidi.c +25 −1
  1047. sound/core/sound.c +9 −2
  1048. sound/core/sound_oss.c +8 −2
  1049. sound/i2c/other/ak4113.c +1 −1
  1050. sound/i2c/other/ak4114.c +1 −1
  1051. sound/i2c/other/ak4117.c +1 −1
  1052. sound/isa/opti9xx/miro.c +0 −1
  1053. sound/pci/als300.c +4 −0
  1054. sound/pci/es1968.c +9 −2
  1055. sound/pci/fm801.c +8 −3
  1056. sound/pci/hda/hda_codec.c +11 −2
  1057. sound/pci/hda/hda_codec.h +1 −0
  1058. sound/pci/hda/hda_intel.c +22 −19
  1059. sound/pci/hda/patch_analog.c +1 −0
  1060. sound/pci/hda/patch_cirrus.c +13 −9
  1061. sound/pci/hda/patch_realtek.c +34 −14
  1062. sound/pci/hda/patch_sigmatel.c +2 −0
  1063. sound/pci/hda/patch_via.c +29 −7
  1064. sound/pci/ice1712/ice1724.c +6 −1
  1065. sound/pci/rme9652/hdspm.c +142 −97
  1066. sound/soc/codecs/arizona.c +2 −2
  1067. sound/soc/codecs/cs4271.c +3 −8
  1068. sound/soc/codecs/cs42l52.c +2 −3
  1069. sound/soc/codecs/wm5102.c +551 −1
  1070. sound/soc/codecs/wm8978.c +1 −1
  1071. sound/soc/codecs/wm8994.c +18 −2
  1072. sound/soc/codecs/wm8994.h +1 −0
  1073. sound/soc/kirkwood/kirkwood-dma.c +1 −2
  1074. sound/soc/kirkwood/kirkwood-i2s.c +37 −37
  1075. sound/soc/mxs/mxs-saif.c +13 −4
  1076. sound/soc/omap/omap-dmic.c +2 −2
  1077. sound/soc/omap/zoom2.c +2 −3
  1078. sound/soc/samsung/Kconfig +2 −0
  1079. sound/soc/samsung/bells.c +1 −1
  1080. sound/soc/soc-core.c +3 −2
  1081. sound/soc/soc-dapm.c +1 −1
  1082. sound/soc/ux500/mop500.c +17 −0
  1083. sound/soc/ux500/ux500_msp_i2s.c +3 −5
  1084. sound/usb/card.c +9 −5
  1085. sound/usb/card.h +1 −0
  1086. sound/usb/endpoint.c +13 −0
  1087. sound/usb/endpoint.h +1 −0
  1088. sound/usb/midi.c +6 −2
  1089. sound/usb/mixer.c +43 −22
  1090. sound/usb/mixer_quirks.c +51 −7
  1091. sound/usb/pcm.c +38 −20
  1092. sound/usb/proc.c +2 −2
  1093. sound/usb/stream.c +1 −0
  1094. sound/usb/usbaudio.h +1 −1
  1095. tools/perf/Makefile +29 −1
  1096. tools/perf/arch/x86/include/perf_regs.h +1 −1
  1097. tools/perf/builtin-kvm.c +67 −54
  1098. tools/perf/perf.h +3 −12
  1099. tools/perf/tests/parse-events.c +1 −1
  1100. tools/perf/util/evsel.c +2 −2
  1101. tools/perf/util/evsel.h +1 −1
  1102. tools/perf/util/header.c +2 −0
  1103. tools/perf/util/header.h +1 −1
  1104. tools/perf/util/parse-events.c +1 −1
  1105. tools/perf/util/parse-events.h +1 −1
  1106. tools/perf/util/pmu.h +1 −1
  1107. tools/perf/util/session.h +1 −1
  1108. tools/perf/util/strbuf.c +4 −4
  1109. tools/power/x86/turbostat/turbostat.c +19 −9
  1110. tools/testing/ktest/ktest.pl +4 −2
  1111. tools/testing/selftests/Makefile +1 −1
  1112. tools/testing/selftests/epoll/Makefile +0 −11
  1113. tools/testing/selftests/epoll/test_epoll.c +0 −344
  1114. tools/vm/page-types.c +1 −1
  1115. usr/gen_init_cpio.c +23 −20
CREDITS+5−0
@@ -1823,6 +1823,11 @@ S: Kattreinstr 38 · 1822 unmodified lines
18231823 S: D-64295
18241824 S: Germany
18251825
1826+N: Avi Kivity
1827+E: avi.kivity@gmail.com
1828+D: Kernel-based Virtual Machine (KVM)
1829+S: Ra'annana, Israel
1830+
18261831 N: Andi Kleen
18271832 E: andi@firstfloor.org
18281833 U: http://www.halobates.de
Documentation/arm64/memory.txt+6−6
@@ -27,17 +27,17 @@ Start End Size Use · 26 unmodified lines
2727 -----------------------------------------------------------------------
2828 0000000000000000 0000007fffffffff 512GB user
2929
30−ffffff8000000000 ffffffbbfffcffff ~240GB vmalloc
30+ffffff8000000000 ffffffbbfffeffff ~240GB vmalloc
3131
32−ffffffbbfffd0000 ffffffbcfffdffff 64KB [guard page]
32+ffffffbbffff0000 ffffffbbffffffff 64KB [guard page]
3333
34−ffffffbbfffe0000 ffffffbcfffeffff 64KB PCI I/O space
34+ffffffbc00000000 ffffffbdffffffff 8GB vmemmap
3535
36−ffffffbbffff0000 ffffffbcffffffff 64KB [guard page]
36+ffffffbe00000000 ffffffbffbbfffff ~8GB [guard, future vmmemap]
3737
38−ffffffbc00000000 ffffffbdffffffff 8GB vmemmap
38+ffffffbffbe00000 ffffffbffbe0ffff 64KB PCI I/O space
3939
40−ffffffbe00000000 ffffffbffbffffff ~8GB [guard, future vmmemap]
40+ffffffbbffff0000 ffffffbcffffffff ~2MB [guard]
4141
4242 ffffffbffc000000 ffffffbfffffffff 64MB modules
4343
Documentation/cgroups/memory.txt+4−0
@@ -466,6 +466,10 @@ Note: · 465 unmodified lines
466466 5.3 swappiness
467467
468468 Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only.
469+Please note that unlike the global swappiness, memcg knob set to 0
470+really prevents from any swapping even if there is a swap storage
471+available. This might lead to memcg OOM killer if there are no file
472+pages to reclaim.
469473
470474 Following cgroups' swappiness can't be changed.
471475 - root cgroup (uses /proc/sys/vm/swappiness).
Documentation/devicetree/bindings/arm/atmel-at91.txt+1−1
@@ -8,7 +8,7 @@ PIT Timer required properties: · 7 unmodified lines
88 shared across all System Controller members.
99
1010 TC/TCLIB Timer required properties:
11−- compatible: Should be "atmel,<chip>-pit".
11+- compatible: Should be "atmel,<chip>-tcb".
1212 <chip> can be "at91rm9200" or "at91sam9x5"
1313 - reg: Should contain registers location and length
1414 - interrupts: Should contain all interrupts for the TC block
Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt+19−0
@@ -0,0 +1,19 @@
1+* EETI eGalax Multiple Touch Controller
2+
3+Required properties:
4+- compatible: must be "eeti,egalax_ts"
5+- reg: i2c slave address
6+- interrupt-parent: the phandle for the interrupt controller
7+- interrupts: touch controller interrupt
8+- wakeup-gpios: the gpio pin to be used for waking up the controller
9+ as well as uased as irq pin
10+
11+Example:
12+
13+ egalax_ts@04 {
14+ compatible = "eeti,egalax_ts";
15+ reg = <0x04>;
16+ interrupt-parent = <&gpio1>;
17+ interrupts = <9 2>;
18+ wakeup-gpios = <&gpio1 9 0>;
19+ };
Documentation/devicetree/bindings/net/mdio-gpio.txt+8−1
@@ -8,9 +8,16 @@ gpios property as described in section VIII.1 in the following order: · 7 unmodified lines
88
99 MDC, MDIO.
1010
11+Note: Each gpio-mdio bus should have an alias correctly numbered in "aliases"
12+node.
13+
1114 Example:
1215
13−mdio {
16+aliases {
17+ mdio-gpio0 = <&mdio0>;
18+};
19+
20+mdio0: mdio {
1421 compatible = "virtual,mdio-gpio";
1522 #address-cells = <1>;
1623 #size-cells = <0>;
Documentation/devicetree/bindings/pinctrl/nvidia,tegra20-pinmux.txt+1−1
@@ -93,7 +93,7 @@ Valid values for pin and group names are: · 92 unmodified lines
9393
9494 With some exceptions, these support nvidia,high-speed-mode,
9595 nvidia,schmitt, nvidia,low-power-mode, nvidia,pull-down-strength,
96− nvidia,pull-up-strength, nvidia,slew_rate-rising, nvidia,slew_rate-falling.
96+ nvidia,pull-up-strength, nvidia,slew-rate-rising, nvidia,slew-rate-falling.
9797
9898 drive_ao1, drive_ao2, drive_at1, drive_at2, drive_cdev1, drive_cdev2,
9999 drive_csus, drive_dap1, drive_dap2, drive_dap3, drive_dap4, drive_dbg,
Documentation/devicetree/bindings/pinctrl/nvidia,tegra30-pinmux.txt+1−1
@@ -83,7 +83,7 @@ Valid values for pin and group names are: · 82 unmodified lines
8383 drive groups:
8484
8585 These all support nvidia,pull-down-strength, nvidia,pull-up-strength,
86− nvidia,slew_rate-rising, nvidia,slew_rate-falling. Most but not all
86+ nvidia,slew-rate-rising, nvidia,slew-rate-falling. Most but not all
8787 support nvidia,high-speed-mode, nvidia,schmitt, nvidia,low-power-mode.
8888
8989 ao1, ao2, at1, at2, at3, at4, at5, cdev1, cdev2, cec, crt, csus, dap1,
Documentation/filesystems/proc.txt+12−4
@@ -33,7 +33,7 @@ Table of Contents · 32 unmodified lines
3333 2 Modifying System Parameters
3434
3535 3 Per-Process Parameters
36− 3.1 /proc/<pid>/oom_score_adj - Adjust the oom-killer
36+ 3.1 /proc/<pid>/oom_adj & /proc/<pid>/oom_score_adj - Adjust the oom-killer
3737 score
3838 3.2 /proc/<pid>/oom_score - Display current oom-killer score
3939 3.3 /proc/<pid>/io - Display the IO accounting fields
@@ -1320,10 +1320,10 @@ of the kernel. · 1280 unmodified lines
13201320 CHAPTER 3: PER-PROCESS PARAMETERS
13211321 ------------------------------------------------------------------------------
13221322
1323−3.1 /proc/<pid>/oom_score_adj- Adjust the oom-killer score
1323+3.1 /proc/<pid>/oom_adj & /proc/<pid>/oom_score_adj- Adjust the oom-killer score
13241324 --------------------------------------------------------------------------------
13251325
1326−This file can be used to adjust the badness heuristic used to select which
1326+These file can be used to adjust the badness heuristic used to select which
13271327 process gets killed in out of memory conditions.
13281328
13291329 The badness heuristic assigns a value to each candidate task ranging from 0
@@ -1361,6 +1361,12 @@ same system, cpuset, mempolicy, or memory controller resources to use at least · 31 unmodified lines
13611361 equivalent to discounting 50% of the task's allowed memory from being considered
13621362 as scoring against the task.
13631363
1364+For backwards compatibility with previous kernels, /proc/<pid>/oom_adj may also
1365+be used to tune the badness score. Its acceptable values range from -16
1366+(OOM_ADJUST_MIN) to +15 (OOM_ADJUST_MAX) and a special value of -17
1367+(OOM_DISABLE) to disable oom killing entirely for that task. Its value is
1368+scaled linearly with /proc/<pid>/oom_score_adj.
1369+
13641370 The value of /proc/<pid>/oom_score_adj may be reduced no lower than the last
13651371 value set by a CAP_SYS_RESOURCE process. To reduce the value any lower
13661372 requires CAP_SYS_RESOURCE.
@@ -1375,7 +1381,9 @@ minimal amount of work. · 8 unmodified lines
13751381 -------------------------------------------------------------
13761382
13771383 This file can be used to check the current score used by the oom-killer is for
1378−any given <pid>.
1384+any given <pid>. Use it together with /proc/<pid>/oom_score_adj to tune which
1385+process should be killed in an out-of-memory situation.
1386+
13791387
13801388 3.3 /proc/<pid>/io - Display the IO accounting fields
13811389 -------------------------------------------------------
Documentation/firmware_class/README+17−9
@@ -18,32 +18,40 @@ · 17 unmodified lines
1818 High level behavior (mixed):
1919 ============================
2020
21− kernel(driver): calls request_firmware(&fw_entry, $FIRMWARE, device)
22−
23− userspace:
21+ 1), kernel(driver):
22+ - calls request_firmware(&fw_entry, $FIRMWARE, device)
23+ - kernel searchs the fimware image with name $FIRMWARE directly
24+ in the below search path of root filesystem:
25+ "/lib/firmware/updates/" UTS_RELEASE,
26+ "/lib/firmware/updates",
27+ "/lib/firmware/" UTS_RELEASE,
28+ "/lib/firmware"
29+ - If found, goto 7), else goto 2)
30+
31+ 2), userspace:
2432 - /sys/class/firmware/xxx/{loading,data} appear.
2533 - hotplug gets called with a firmware identifier in $FIRMWARE
2634 and the usual hotplug environment.
2735 - hotplug: echo 1 > /sys/class/firmware/xxx/loading
2836
29− kernel: Discard any previous partial load.
37+ 3), kernel: Discard any previous partial load.
3038
31− userspace:
39+ 4), userspace:
3240 - hotplug: cat appropriate_firmware_image > \
3341 /sys/class/firmware/xxx/data
3442
35− kernel: grows a buffer in PAGE_SIZE increments to hold the image as it
43+ 5), kernel: grows a buffer in PAGE_SIZE increments to hold the image as it
3644 comes in.
3745
38− userspace:
46+ 6), userspace:
3947 - hotplug: echo 0 > /sys/class/firmware/xxx/loading
4048
41− kernel: request_firmware() returns and the driver has the firmware
49+ 7), kernel: request_firmware() returns and the driver has the firmware
4250 image in fw_entry->{data,size}. If something went wrong
4351 request_firmware() returns non-zero and fw_entry is set to
4452 NULL.
4553
46− kernel(driver): Driver code calls release_firmware(fw_entry) releasing
54+ 8), kernel(driver): Driver code calls release_firmware(fw_entry) releasing
4755 the firmware image and any related resource.
4856
4957 High level behavior (driver code):
Documentation/hwmon/fam15h_power+1−1
@@ -10,7 +10,7 @@ Supported chips: · 9 unmodified lines
1010 BIOS and Kernel Developer's Guide (BKDG) For AMD Family 15h Processors
1111 (not yet published)
1212
13−Author: Andreas Herrmann <andreas.herrmann3@amd.com>
13+Author: Andreas Herrmann <herrmann.der.user@googlemail.com>
1414
1515 Description
1616 -----------
Documentation/networking/netdev-features.txt+1−1
@@ -164,4 +164,4 @@ read the CRC recorded by the NIC on receipt of the packet. · 163 unmodified lines
164164 This requests that the NIC receive all possible frames, including errored
165165 frames (such as bad FCS, etc). This can be helpful when sniffing a link with
166166 bad packets on it. Some NICs may receive more packets if also put into normal
167−PROMISC mdoe.
167+PROMISC mode.
Documentation/networking/vxlan.txt+2−2
@@ -32,7 +32,7 @@ no entry is in the forwarding table. · 31 unmodified lines
3232 # ip link delete vxlan0
3333
3434 3. Show vxlan info
35− # ip -d show vxlan0
35+ # ip -d link show vxlan0
3636
3737 It is possible to create, destroy and display the vxlan
3838 forwarding table using the new bridge command.
@@ -41,7 +41,7 @@ forwarding table using the new bridge command. · 2 unmodified lines
4141 # bridge fdb add to 00:17:42:8a:b4:05 dst 192.19.0.2 dev vxlan0
4242
4343 2. Delete forwarding table entry
44− # bridge fdb delete 00:17:42:8a:b4:05
44+ # bridge fdb delete 00:17:42:8a:b4:05 dev vxlan0
4545
4646 3. Show forwarding table
4747 # bridge fdb show dev vxlan0
Documentation/zh_CN/IRQ.txt+39−0
@@ -0,0 +1,39 @@
1+Chinese translated version of Documentation/IRQ.txt
2+
3+If you have any comment or update to the content, please contact the
4+original document maintainer directly. However, if you have a problem
5+communicating in English you can also ask the Chinese maintainer for
6+help. Contact the Chinese maintainer if this translation is outdated
7+or if there is a problem with the translation.
8+
9+Maintainer: Eric W. Biederman <ebiederman@xmission.com>
10+Chinese maintainer: Fu Wei <tekkamanninja@gmail.com>
11+---------------------------------------------------------------------
12+Documentation/IRQ.txt 的中文翻译
13+
14+如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
15+交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
16+译存在问题,请联系中文版维护者。
17+英文版维护者: Eric W. Biederman <ebiederman@xmission.com>
18+中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
19+中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
20+中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
21+
22+
23+以下为正文
24+---------------------------------------------------------------------
25+何为 IRQ?
26+
27+一个 IRQ 是来自某个设备的一个中断请求。目前,它们可以来自一个硬件引脚,
28+或来自一个数据包。多个设备可能连接到同个硬件引脚,从而共享一个 IRQ。
29+
30+一个 IRQ 编号是用于告知硬件中断源的内核标识。通常情况下,这是一个
31+全局 irq_desc 数组的索引,但是除了在 linux/interrupt.h 中的实现,
32+具体的细节是体系结构特定的。
33+
34+一个 IRQ 编号是设备上某个可能的中断源的枚举。通常情况下,枚举的编号是
35+该引脚在系统内中断控制器的所有输入引脚中的编号。对于 ISA 总线中的情况,
36+枚举的是在两个 i8259 中断控制器中 16 个输入引脚。
37+
38+架构可以对 IRQ 编号指定额外的含义,在硬件涉及任何手工配置的情况下,
39+是被提倡的。ISA 的 IRQ 是一个分配这类额外含义的典型例子。
Documentation/zh_CN/arm64/booting.txt+156−0
@@ -0,0 +1,156 @@
1+Chinese translated version of Documentation/arm64/booting.txt
2+
3+If you have any comment or update to the content, please contact the
4+original document maintainer directly. However, if you have a problem
5+communicating in English you can also ask the Chinese maintainer for
6+help. Contact the Chinese maintainer if this translation is outdated
7+or if there is a problem with the translation.
8+
9+Maintainer: Will Deacon <will.deacon@arm.com>
10+Chinese maintainer: Fu Wei <tekkamanninja@gmail.com>
11+---------------------------------------------------------------------
12+Documentation/arm64/booting.txt 的中文翻译
13+
14+如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
15+交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
16+译存在问题,请联系中文版维护者。
17+
18+英文版维护者: Will Deacon <will.deacon@arm.com>
19+中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
20+中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
21+中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
22+
23+以下为正文
24+---------------------------------------------------------------------
25+ 启动 AArch64 Linux
26+ ==================
27+
28+作者: Will Deacon <will.deacon@arm.com>
29+日期: 2012 年 09 月 07 日
30+
31+本文档基于 Russell King 的 ARM 启动文档,且适用于所有公开发布的
32+AArch64 Linux 内核代码。
33+
34+AArch64 异常模型由多个异常级别(EL0 - EL3)组成,对于 EL0 和 EL1
35+异常级有对应的安全和非安全模式。EL2 是系统管理级,且仅存在于
36+非安全模式下。EL3 是最高特权级,且仅存在于安全模式下。
37+
38+基于本文档的目的,我们将简单地使用‘引导装载程序’(‘boot loader’)
39+这个术语来定义在将控制权交给 Linux 内核前 CPU 上执行的所有软件。
40+这可能包含安全监控和系统管理代码,或者它可能只是一些用于准备最小启动
41+环境的指令。
42+
43+基本上,引导装载程序(至少)应实现以下操作:
44+
45+1、设置和初始化 RAM
46+2、设置设备树数据
47+3、解压内核映像
48+4、调用内核映像
49+
50+
51+1、设置和初始化 RAM
52+-----------------
53+
54+必要性: 强制
55+
56+引导装载程序应该找到并初始化系统中所有内核用于保持系统变量数据的 RAM。
57+这个操作的执行是设备依赖的。(它可能使用内部算法来自动定位和计算所有
58+RAM,或可能使用对这个设备已知的 RAM 信息,还可能使用任何引导装载程序
59+设计者想到的匹配方法。)
60+
61+
62+2、设置设备树数据
63+---------------
64+
65+必要性: 强制
66+
67+设备树数据块(dtb)大小必须不大于 2 MB,且位于从内核映像起始算起第一个
68+512MB 内的 2MB 边界上。这使得内核可以通过初始页表中的单个节描述符来
69+映射此数据块。
70+
71+
72+3、解压内核映像
73+-------------
74+
75+必要性: 可选
76+
77+AArch64 内核当前没有提供自解压代码,因此如果使用了压缩内核映像文件
78+(比如 Image.gz),则需要通过引导装载程序(使用 gzip 等)来进行解压。
79+若引导装载程序没有实现这个需求,就要使用非压缩内核映像文件。
80+
81+
82+4、调用内核映像
83+-------------
84+
85+必要性: 强制
86+
87+已解压的内核映像包含一个 32 字节的头,内容如下:
88+
89+ u32 magic = 0x14000008; /* 跳转到 stext, 小端 */
90+ u32 res0 = 0; /* 保留 */
91+ u64 text_offset; /* 映像装载偏移 */
92+ u64 res1 = 0; /* 保留 */
93+ u64 res2 = 0; /* 保留 */
94+
95+映像必须位于系统 RAM 起始处的特定偏移(当前是 0x80000)。系统 RAM
96+的起始地址必须是以 2MB 对齐的。
97+
98+在跳转入内核前,必须符合以下状态:
99+
100+- 停止所有 DMA 设备,这样内存数据就不会因为虚假网络包或磁盘数据而
101+ 被破坏。这可能可以节省你许多的调试时间。
102+
103+- 主 CPU 通用寄存器设置
104+ x0 = 系统 RAM 中设备树数据块(dtb)的物理地址。
105+ x1 = 0 (保留,将来可能使用)
106+ x2 = 0 (保留,将来可能使用)
107+ x3 = 0 (保留,将来可能使用)
108+
109+- CPU 模式
110+ 所有形式的中断必须在 PSTATE.DAIF 中被屏蔽(Debug、SError、IRQ
111+ 和 FIQ)。
112+ CPU 必须处于 EL2(推荐,可访问虚拟化扩展)或非安全 EL1 模式下。
113+
114+- 高速缓存、MMU
115+ MMU 必须关闭。
116+ 指令缓存开启或关闭都可以。
117+ 数据缓存必须关闭且无效。
118+ 外部高速缓存(如果存在)必须配置并禁用。
119+
120+- 架构计时器
121+ CNTFRQ 必须设定为计时器的频率。
122+ 如果在 EL1 模式下进入内核,则 CNTHCTL_EL2 中的 EL1PCTEN (bit 0)
123+ 必须置位。
124+
125+- 一致性
126+ 通过内核启动的所有 CPU 在内核入口地址上必须处于相同的一致性域中。
127+ 这可能要根据具体实现来定义初始化过程,以使能每个CPU上对维护操作的
128+ 接收。
129+
130+- 系统寄存器
131+ 在进入内核映像的异常级中,所有构架中可写的系统寄存器必须通过软件
132+ 在一个更高的异常级别下初始化,以防止在 未知 状态下运行。
133+
134+引导装载程序必须在每个 CPU 处于以下状态时跳入内核入口:
135+
136+- 主 CPU 必须直接跳入内核映像的第一条指令。通过此 CPU 传递的设备树
137+ 数据块必须在每个 CPU 节点中包含以下内容:
138+
139+ 1、‘enable-method’属性。目前,此字段支持的值仅为字符串“spin-table”。
140+
141+ 2、‘cpu-release-addr’标识一个 64-bit、初始化为零的内存位置。
142+
143+ 引导装载程序必须生成这些设备树属性,并在跳入内核入口之前将其插入
144+ 数据块。
145+
146+- 任何辅助 CPU 必须在内存保留区(通过设备树中的 /memreserve/ 域传递
147+ 给内核)中自旋于内核之外,轮询它们的 cpu-release-addr 位置(必须
148+ 包含在保留区中)。可通过插入 wfe 指令来降低忙循环开销,而主 CPU 将
149+ 发出 sev 指令。当对 cpu-release-addr 所指位置的读取操作返回非零值
150+ 时,CPU 必须直接跳入此值所指向的地址。
151+
152+- 辅助 CPU 通用寄存器设置
153+ x0 = 0 (保留,将来可能使用)
154+ x1 = 0 (保留,将来可能使用)
155+ x2 = 0 (保留,将来可能使用)
156+ x3 = 0 (保留,将来可能使用)
Documentation/zh_CN/arm64/memory.txt+93−0
@@ -0,0 +1,93 @@
1+Chinese translated version of Documentation/arm64/memory.txt
2+
3+If you have any comment or update to the content, please contact the
4+original document maintainer directly. However, if you have a problem
5+communicating in English you can also ask the Chinese maintainer for
6+help. Contact the Chinese maintainer if this translation is outdated
7+or if there is a problem with the translation.
8+
9+Maintainer: Catalin Marinas <catalin.marinas@arm.com>
10+Chinese maintainer: Fu Wei <tekkamanninja@gmail.com>
11+---------------------------------------------------------------------
12+Documentation/arm64/memory.txt 的中文翻译
13+
14+如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
15+交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
16+译存在问题,请联系中文版维护者。
17+
18+英文版维护者: Catalin Marinas <catalin.marinas@arm.com>
19+中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
20+中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
21+中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
22+
23+以下为正文
24+---------------------------------------------------------------------
25+ Linux 在 AArch64 中的内存布局
26+ ===========================
27+
28+作者: Catalin Marinas <catalin.marinas@arm.com>
29+日期: 2012 年 02 月 20 日
30+
31+本文档描述 AArch64 Linux 内核所使用的虚拟内存布局。此构架可以实现
32+页大小为 4KB 的 4 级转换表和页大小为 64KB 的 3 级转换表。
33+
34+AArch64 Linux 使用页大小为 4KB 的 3 级转换表配置,对于用户和内核
35+都有 39-bit (512GB) 的虚拟地址空间。对于页大小为 64KB的配置,仅
36+使用 2 级转换表,但内存布局相同。
37+
38+用户地址空间的 63:39 位为 0,而内核地址空间的相应位为 1。TTBRx 的
39+选择由虚拟地址的 63 位给出。swapper_pg_dir 仅包含内核(全局)映射,
40+而用户 pgd 仅包含用户(非全局)映射。swapper_pgd_dir 地址被写入
41+TTBR1 中,且从不写入 TTBR0。
42+
43+
44+AArch64 Linux 内存布局:
45+
46+起始地址 结束地址 大小 用途
47+-----------------------------------------------------------------------
48+0000000000000000 0000007fffffffff 512GB 用户空间
49+
50+ffffff8000000000 ffffffbbfffcffff ~240GB vmalloc
51+
52+ffffffbbfffd0000 ffffffbcfffdffff 64KB [防护页]
53+
54+ffffffbbfffe0000 ffffffbcfffeffff 64KB PCI I/O 空间
55+
56+ffffffbbffff0000 ffffffbcffffffff 64KB [防护页]
57+
58+ffffffbc00000000 ffffffbdffffffff 8GB vmemmap
59+
60+ffffffbe00000000 ffffffbffbffffff ~8GB [防护页,未来用于 vmmemap]
61+
62+ffffffbffc000000 ffffffbfffffffff 64MB 模块
63+
64+ffffffc000000000 ffffffffffffffff 256GB 内存空间
65+
66+
67+4KB 页大小的转换表查找:
68+
69++--------+--------+--------+--------+--------+--------+--------+--------+
70+|63 56|55 48|47 40|39 32|31 24|23 16|15 8|7 0|
71++--------+--------+--------+--------+--------+--------+--------+--------+
72+ | | | | | |
73+ | | | | | v
74+ | | | | | [11:0] 页内偏移
75+ | | | | +-> [20:12] L3 索引
76+ | | | +-----------> [29:21] L2 索引
77+ | | +---------------------> [38:30] L1 索引
78+ | +-------------------------------> [47:39] L0 索引 (未使用)
79+ +-------------------------------------------------> [63] TTBR0/1
80+
81+
82+64KB 页大小的转换表查找:
83+
84++--------+--------+--------+--------+--------+--------+--------+--------+
85+|63 56|55 48|47 40|39 32|31 24|23 16|15 8|7 0|
86++--------+--------+--------+--------+--------+--------+--------+--------+
87+ | | | | |
88+ | | | | v
89+ | | | | [15:0] 页内偏移
90+ | | | +----------> [28:16] L3 索引
91+ | | +--------------------------> [41:29] L2 索引 (仅使用 38:29 )
92+ | +-------------------------------> [47:42] L1 索引 (未使用)
93+ +-------------------------------------------------> [63] TTBR0/1
MAINTAINERS+95−22
@@ -503,7 +503,7 @@ F: include/linux/altera_uart.h · 502 unmodified lines
503503 F: include/linux/altera_jtaguart.h
504504
505505 AMD FAM15H PROCESSOR POWER MONITORING DRIVER
506−M: Andreas Herrmann <andreas.herrmann3@amd.com>
506+M: Andreas Herrmann <herrmann.der.user@googlemail.com>
507507 L: lm-sensors@lm-sensors.org
508508 S: Maintained
509509 F: Documentation/hwmon/fam15h_power
@@ -526,17 +526,17 @@ F: drivers/video/geode/ · 16 unmodified lines
526526 F: arch/x86/include/asm/geode.h
527527
528528 AMD IOMMU (AMD-VI)
529−M: Joerg Roedel <joerg.roedel@amd.com>
529+M: Joerg Roedel <joro@8bytes.org>
530530 L: iommu@lists.linux-foundation.org
531531 T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
532−S: Supported
532+S: Maintained
533533 F: drivers/iommu/amd_iommu*.[ch]
534534 F: include/linux/amd-iommu.h
535535
536536 AMD MICROCODE UPDATE SUPPORT
537−M: Andreas Herrmann <andreas.herrmann3@amd.com>
537+M: Andreas Herrmann <herrmann.der.user@googlemail.com>
538538 L: amd64-microcode@amd64.org
539−S: Supported
539+S: Maintained
540540 F: arch/x86/kernel/microcode_amd.c
541541
542542 AMS (Apple Motion Sensor) DRIVER
@@ -637,6 +637,13 @@ W: http://www.arm.linux.org.uk/ · 94 unmodified lines
637637 S: Maintained
638638 F: arch/arm/
639639
640+ARM SUB-ARCHITECTURES
641+L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
642+S: MAINTAINED
643+F: arch/arm/mach-*/
644+F: arch/arm/plat-*/
645+T: git git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git
646+
640647 ARM PRIMECELL AACI PL041 DRIVER
641648 M: Russell King <linux@arm.linux.org.uk>
642649 S: Maintained
@@ -834,6 +841,14 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/kristoffer/linux-hpc.git · 191 unmodified lines
834841 F: arch/arm/mach-sa1100/jornada720.c
835842 F: arch/arm/mach-sa1100/include/mach/jornada720.h
836843
844+ARM/IGEP MACHINE SUPPORT
845+M: Enric Balletbo i Serra <eballetbo@gmail.com>
846+M: Javier Martinez Canillas <javier@dowhile0.org>
847+L: linux-omap@vger.kernel.org
848+L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
849+S: Maintained
850+F: arch/arm/mach-omap2/board-igep0020.c
851+
837852 ARM/INCOME PXA270 SUPPORT
838853 M: Marek Vasut <marek.vasut@gmail.com>
839854 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -2500,6 +2515,7 @@ M: Joonyoung Shim <jy0922.shim@samsung.com> · 1660 unmodified lines
25002515 M: Seung-Woo Kim <sw0312.kim@samsung.com>
25012516 M: Kyungmin Park <kyungmin.park@samsung.com>
25022517 L: dri-devel@lists.freedesktop.org
2518+T: git git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git
25032519 S: Supported
25042520 F: drivers/gpu/drm/exynos
25052521 F: include/drm/exynos*
@@ -2700,10 +2716,10 @@ F: include/linux/edac.h · 194 unmodified lines
27002716
27012717 EDAC-AMD64
27022718 M: Doug Thompson <dougthompson@xmission.com>
2703−M: Borislav Petkov <borislav.petkov@amd.com>
2719+M: Borislav Petkov <bp@alien8.de>
27042720 L: linux-edac@vger.kernel.org
27052721 W: bluesmoke.sourceforge.net
2706−S: Supported
2722+S: Maintained
27072723 F: drivers/edac/amd64_edac*
27082724
27092725 EDAC-E752X
@@ -2802,6 +2818,7 @@ F: sound/usb/misc/ua101.c · 92 unmodified lines
28022818 EXTENSIBLE FIRMWARE INTERFACE (EFI)
28032819 M: Matt Fleming <matt.fleming@intel.com>
28042820 L: linux-efi@vger.kernel.org
2821+T: git git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi.git
28052822 S: Maintained
28062823 F: Documentation/x86/efi-stub.txt
28072824 F: arch/ia64/kernel/efi.c
@@ -3589,6 +3606,49 @@ F: drivers/hid/hid-hyperv.c · 781 unmodified lines
35893606 F: drivers/net/hyperv/
35903607 F: drivers/staging/hv/
35913608
3609+I2C OVER PARALLEL PORT
3610+M: Jean Delvare <khali@linux-fr.org>
3611+L: linux-i2c@vger.kernel.org
3612+S: Maintained
3613+F: Documentation/i2c/busses/i2c-parport
3614+F: Documentation/i2c/busses/i2c-parport-light
3615+F: drivers/i2c/busses/i2c-parport.c
3616+F: drivers/i2c/busses/i2c-parport-light.c
3617+
3618+I2C/SMBUS CONTROLLER DRIVERS FOR PC
3619+M: Jean Delvare <khali@linux-fr.org>
3620+L: linux-i2c@vger.kernel.org
3621+S: Maintained
3622+F: Documentation/i2c/busses/i2c-ali1535
3623+F: Documentation/i2c/busses/i2c-ali1563
3624+F: Documentation/i2c/busses/i2c-ali15x3
3625+F: Documentation/i2c/busses/i2c-amd756
3626+F: Documentation/i2c/busses/i2c-amd8111
3627+F: Documentation/i2c/busses/i2c-i801
3628+F: Documentation/i2c/busses/i2c-nforce2
3629+F: Documentation/i2c/busses/i2c-piix4
3630+F: Documentation/i2c/busses/i2c-sis5595
3631+F: Documentation/i2c/busses/i2c-sis630
3632+F: Documentation/i2c/busses/i2c-sis96x
3633+F: Documentation/i2c/busses/i2c-via
3634+F: Documentation/i2c/busses/i2c-viapro
3635+F: drivers/i2c/busses/i2c-ali1535.c
3636+F: drivers/i2c/busses/i2c-ali1563.c
3637+F: drivers/i2c/busses/i2c-ali15x3.c
3638+F: drivers/i2c/busses/i2c-amd756.c
3639+F: drivers/i2c/busses/i2c-amd756-s4882.c
3640+F: drivers/i2c/busses/i2c-amd8111.c
3641+F: drivers/i2c/busses/i2c-i801.c
3642+F: drivers/i2c/busses/i2c-isch.c
3643+F: drivers/i2c/busses/i2c-nforce2.c
3644+F: drivers/i2c/busses/i2c-nforce2-s4985.c
3645+F: drivers/i2c/busses/i2c-piix4.c
3646+F: drivers/i2c/busses/i2c-sis5595.c
3647+F: drivers/i2c/busses/i2c-sis630.c
3648+F: drivers/i2c/busses/i2c-sis96x.c
3649+F: drivers/i2c/busses/i2c-via.c
3650+F: drivers/i2c/busses/i2c-viapro.c
3651+
35923652 I2C/SMBUS STUB DRIVER
35933653 M: "Mark M. Hoffman" <mhoffman@lightlink.com>
35943654 L: linux-i2c@vger.kernel.org
@@ -3596,9 +3656,8 @@ S: Maintained · 1 unmodified line
35963656 F: drivers/i2c/busses/i2c-stub.c
35973657
35983658 I2C SUBSYSTEM
3599−M: "Jean Delvare (PC drivers, core)" <khali@linux-fr.org>
3659+M: Wolfram Sang <w.sang@pengutronix.de>
36003660 M: "Ben Dooks (embedded platforms)" <ben-linux@fluff.org>
3601−M: "Wolfram Sang (embedded platforms)" <w.sang@pengutronix.de>
36023661 L: linux-i2c@vger.kernel.org
36033662 W: http://i2c.wiki.kernel.org/
36043663 T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/
@@ -3609,6 +3668,13 @@ F: drivers/i2c/ · 4 unmodified lines
36093668 F: include/linux/i2c.h
36103669 F: include/linux/i2c-*.h
36113670
3671+I2C-TAOS-EVM DRIVER
3672+M: Jean Delvare <khali@linux-fr.org>
3673+L: linux-i2c@vger.kernel.org
3674+S: Maintained
3675+F: Documentation/i2c/busses/i2c-taos-evm
3676+F: drivers/i2c/busses/i2c-taos-evm.c
3677+
36123678 I2C-TINY-USB DRIVER
36133679 M: Till Harbaum <till@harbaum.org>
36143680 L: linux-i2c@vger.kernel.org
@@ -3695,7 +3761,7 @@ S: Maintained · 80 unmodified lines
36953761 F: drivers/platform/x86/ideapad-laptop.c
36963762
36973763 IDE/ATAPI DRIVERS
3698−M: Borislav Petkov <petkovbb@gmail.com>
3764+M: Borislav Petkov <bp@alien8.de>
36993765 L: linux-ide@vger.kernel.org
37003766 S: Maintained
37013767 F: Documentation/cdrom/ide-cd
@@ -4222,8 +4288,8 @@ F: include/linux/lockd/ · 520 unmodified lines
42224288 F: include/linux/sunrpc/
42234289
42244290 KERNEL VIRTUAL MACHINE (KVM)
4225−M: Avi Kivity <avi@redhat.com>
42264291 M: Marcelo Tosatti <mtosatti@redhat.com>
4292+M: Gleb Natapov <gleb@redhat.com>
42274293 L: kvm@vger.kernel.org
42284294 W: http://kvm.qumranet.com
42294295 S: Supported
@@ -5061,7 +5127,13 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git · 831 unmodified lines
50615127 S: Odd Fixes
50625128 F: drivers/net/
50635129 F: include/linux/if_*
5064−F: include/linux/*device.h
5130+F: include/linux/netdevice.h
5131+F: include/linux/arcdevice.h
5132+F: include/linux/etherdevice.h
5133+F: include/linux/fcdevice.h
5134+F: include/linux/fddidevice.h
5135+F: include/linux/hippidevice.h
5136+F: include/linux/inetdevice.h
50655137
50665138 NETXEN (1/10) GbE SUPPORT
50675139 M: Sony Chacko <sony.chacko@qlogic.com>
@@ -5349,7 +5421,7 @@ S: Maintained · 281 unmodified lines
53495421 F: sound/drivers/opl4/
53505422
53515423 OPROFILE
5352−M: Robert Richter <robert.richter@amd.com>
5424+M: Robert Richter <rric@kernel.org>
53535425 L: oprofile-list@lists.sf.net
53545426 S: Maintained
53555427 F: arch/*/include/asm/oprofile*.h
@@ -5633,7 +5705,7 @@ S: Maintained · 277 unmodified lines
56335705 F: drivers/pinctrl/spear/
56345706
56355707 PKTCDVD DRIVER
5636−M: Peter Osterlund <petero2@telia.com>
5708+M: Jiri Kosina <jkosina@suse.cz>
56375709 S: Maintained
56385710 F: drivers/block/pktcdvd.c
56395711 F: include/linux/pktcdvd.h
@@ -7195,6 +7267,14 @@ L: linux-xtensa@linux-xtensa.org · 1555 unmodified lines
71957267 S: Maintained
71967268 F: arch/xtensa/
71977269
7270+THERMAL
7271+M: Zhang Rui <rui.zhang@intel.com>
7272+L: linux-pm@vger.kernel.org
7273+T: git git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git
7274+S: Supported
7275+F: drivers/thermal/
7276+F: include/linux/thermal.h
7277+
71987278 THINKPAD ACPI EXTRAS DRIVER
71997279 M: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>
72007280 L: ibm-acpi-devel@lists.sourceforge.net
@@ -7872,13 +7952,6 @@ M: Roger Luethi <rl@hellgate.ch> · 671 unmodified lines
78727952 S: Maintained
78737953 F: drivers/net/ethernet/via/via-rhine.c
78747954
7875−VIAPRO SMBUS DRIVER
7876−M: Jean Delvare <khali@linux-fr.org>
7877−L: linux-i2c@vger.kernel.org
7878−S: Maintained
7879−F: Documentation/i2c/busses/i2c-viapro
7880−F: drivers/i2c/busses/i2c-viapro.c
7881−
78827955 VIA SD/MMC CARD CONTROLLER DRIVER
78837956 M: Bruce Chang <brucechang@via.com.tw>
78847957 M: Harald Welte <HaraldWelte@viatech.com>
@@ -8133,7 +8206,7 @@ F: drivers/platform/x86 · 248 unmodified lines
81338206
81348207 X86 MCE INFRASTRUCTURE
81358208 M: Tony Luck <tony.luck@intel.com>
8136−M: Borislav Petkov <bp@amd64.org>
8209+M: Borislav Petkov <bp@alien8.de>
81378210 L: linux-edac@vger.kernel.org
81388211 S: Maintained
81398212 F: arch/x86/kernel/cpu/mcheck/*
Makefile+1−1
@@ -1,7 +1,7 @@
11 VERSION = 3
22 PATCHLEVEL = 7
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc2
4+EXTRAVERSION = -rc8
55 NAME = Terrified Chipmunk
66
77 # *DOCUMENTATION*
arch/alpha/kernel/osf_sys.c+3−3
@@ -445,7 +445,7 @@ struct procfs_args { · 444 unmodified lines
445445 * unhappy with OSF UFS. [CHECKME]
446446 */
447447 static int
448−osf_ufs_mount(char *dirname, struct ufs_args __user *args, int flags)
448+osf_ufs_mount(const char *dirname, struct ufs_args __user *args, int flags)
449449 {
450450 int retval;
451451 struct cdfs_args tmp;
@@ -465,7 +465,7 @@ osf_ufs_mount(char *dirname, struct ufs_args __user *args, int flags) · 13 unmodified lines
465465 }
466466
467467 static int
468−osf_cdfs_mount(char *dirname, struct cdfs_args __user *args, int flags)
468+osf_cdfs_mount(const char *dirname, struct cdfs_args __user *args, int flags)
469469 {
470470 int retval;
471471 struct cdfs_args tmp;
@@ -485,7 +485,7 @@ osf_cdfs_mount(char *dirname, struct cdfs_args __user *args, int flags) · 13 unmodified lines
485485 }
486486
487487 static int
488−osf_procfs_mount(char *dirname, struct procfs_args __user *args, int flags)
488+osf_procfs_mount(const char *dirname, struct procfs_args __user *args, int flags)
489489 {
490490 struct procfs_args tmp;
491491
arch/arm/Kconfig+6−4
@@ -547,6 +547,7 @@ config ARCH_KIRKWOOD · 546 unmodified lines
547547 select CPU_FEROCEON
548548 select GENERIC_CLOCKEVENTS
549549 select PCI
550+ select PCI_QUIRKS
550551 select PLAT_ORION_LEGACY
551552 help
552553 Support for the following Marvell Kirkwood series SoCs:
@@ -1603,8 +1604,8 @@ config NR_CPUS · 1050 unmodified lines
16031604 default "4"
16041605
16051606 config HOTPLUG_CPU
1606− bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
1607− depends on SMP && HOTPLUG && EXPERIMENTAL
1607+ bool "Support for hot-pluggable CPUs"
1608+ depends on SMP && HOTPLUG
16081609 help
16091610 Say Y here to experiment with turning CPUs off and on. CPUs
16101611 can be controlled through /sys/devices/system/cpu.
@@ -1645,8 +1646,8 @@ config HZ · 34 unmodified lines
16451646 default 100
16461647
16471648 config THUMB2_KERNEL
1648− bool "Compile the kernel in Thumb-2 mode (EXPERIMENTAL)"
1649− depends on CPU_V7 && !CPU_V6 && !CPU_V6K && EXPERIMENTAL
1649+ bool "Compile the kernel in Thumb-2 mode"
1650+ depends on CPU_V7 && !CPU_V6 && !CPU_V6K
16501651 select AEABI
16511652 select ARM_ASM_UNIFIED
16521653 select ARM_UNWIND
@@ -1850,6 +1851,7 @@ config XEN_DOM0 · 197 unmodified lines
18501851 config XEN
18511852 bool "Xen guest support on ARM (EXPERIMENTAL)"
18521853 depends on EXPERIMENTAL && ARM && OF
1854+ depends on CPU_V7 && !CPU_V6
18531855 help
18541856 Say Y if you want to run Linux in a Virtual Machine on Xen on ARM.
18551857
arch/arm/Makefile+7−6
@@ -21,8 +21,6 @@ endif · 20 unmodified lines
2121 OBJCOPYFLAGS :=-O binary -R .comment -S
2222 GZFLAGS :=-9
2323 #KBUILD_CFLAGS +=-pipe
24−# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
25−KBUILD_CFLAGS +=$(call cc-option,-marm,)
2624
2725 # Never generate .eh_frame
2826 KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm)
@@ -105,17 +103,20 @@ endif · 76 unmodified lines
105103 ifeq ($(CONFIG_THUMB2_KERNEL),y)
106104 AFLAGS_AUTOIT :=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mauto-it)
107105 AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
108−CFLAGS_THUMB2 :=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN)
109−AFLAGS_THUMB2 :=$(CFLAGS_THUMB2) -Wa$(comma)-mthumb
106+CFLAGS_ISA :=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN)
107+AFLAGS_ISA :=$(CFLAGS_ISA) -Wa$(comma)-mthumb
110108 # Work around buggy relocation from gas if requested:
111109 ifeq ($(CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11),y)
112110 CFLAGS_MODULE +=-fno-optimize-sibling-calls
113111 endif
112+else
113+CFLAGS_ISA :=$(call cc-option,-marm,)
114+AFLAGS_ISA :=$(CFLAGS_ISA)
114115 endif
115116
116117 # Need -Uarm for gcc < 3.x
117−KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_THUMB2) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
118−KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_THUMB2) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float
118+KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
119+KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float
119120
120121 CHECKFLAGS += -D__arm__
121122
arch/arm/boot/Makefile+5−5
@@ -33,7 +33,7 @@ ifeq ($(CONFIG_XIP_KERNEL),y) · 32 unmodified lines
3333
3434 $(obj)/xipImage: vmlinux FORCE
3535 $(call if_changed,objcopy)
36− @echo ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))'
36+ @$(kecho) ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))'
3737
3838 $(obj)/Image $(obj)/zImage: FORCE
3939 @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)'
@@ -48,14 +48,14 @@ $(obj)/xipImage: FORCE · 8 unmodified lines
4848
4949 $(obj)/Image: vmlinux FORCE
5050 $(call if_changed,objcopy)
51− @echo ' Kernel: $@ is ready'
51+ @$(kecho) ' Kernel: $@ is ready'
5252
5353 $(obj)/compressed/vmlinux: $(obj)/Image FORCE
5454 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
5555
5656 $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
5757 $(call if_changed,objcopy)
58− @echo ' Kernel: $@ is ready'
58+ @$(kecho) ' Kernel: $@ is ready'
5959
6060 endif
6161
@@ -90,7 +90,7 @@ fi · 28 unmodified lines
9090 $(obj)/uImage: $(obj)/zImage FORCE
9191 @$(check_for_multiple_loadaddr)
9292 $(call if_changed,uimage)
93− @echo ' Image $@ is ready'
93+ @$(kecho) ' Image $@ is ready'
9494
9595 $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
9696 $(Q)$(MAKE) $(build)=$(obj)/bootp $@
@@ -98,7 +98,7 @@ $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE · 1 unmodified line
9898
9999 $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
100100 $(call if_changed,objcopy)
101− @echo ' Kernel: $@ is ready'
101+ @$(kecho) ' Kernel: $@ is ready'
102102
103103 PHONY += initrd FORCE
104104 initrd:
arch/arm/boot/compressed/head.S+13−1
@@ -652,6 +652,15 @@ __setup_mmu: sub r3, r4, #16384 @ Page directory size · 651 unmodified lines
652652 mov pc, lr
653653 ENDPROC(__setup_mmu)
654654
655+@ Enable unaligned access on v6, to allow better code generation
656+@ for the decompressor C code:
657+__armv6_mmu_cache_on:
658+ mrc p15, 0, r0, c1, c0, 0 @ read SCTLR
659+ bic r0, r0, #2 @ A (no unaligned access fault)
660+ orr r0, r0, #1 << 22 @ U (v6 unaligned access model)
661+ mcr p15, 0, r0, c1, c0, 0 @ write SCTLR
662+ b __armv4_mmu_cache_on
663+
655664 __arm926ejs_mmu_cache_on:
656665 #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
657666 mov r0, #4 @ put dcache in WT mode
@@ -694,6 +703,9 @@ __armv7_mmu_cache_on: · 36 unmodified lines
694703 bic r0, r0, #1 << 28 @ clear SCTLR.TRE
695704 orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement
696705 orr r0, r0, #0x003c @ write buffer
706+ bic r0, r0, #2 @ A (no unaligned access fault)
707+ orr r0, r0, #1 << 22 @ U (v6 unaligned access model)
708+ @ (needed for ARM1176)
697709 #ifdef CONFIG_MMU
698710 #ifdef CONFIG_CPU_ENDIAN_BE8
699711 orr r0, r0, #1 << 25 @ big-endian page tables
@@ -914,7 +926,7 @@ proc_types: · 214 unmodified lines
914926
915927 .word 0x0007b000 @ ARMv6
916928 .word 0x000ff000
917− W(b) __armv4_mmu_cache_on
929+ W(b) __armv6_mmu_cache_on
918930 W(b) __armv4_mmu_cache_off
919931 W(b) __armv6_mmu_cache_flush
920932
arch/arm/boot/dts/at91sam9g20ek_common.dtsi+2−2
@@ -126,14 +126,14 @@ · 125 unmodified lines
126126 #size-cells = <0>;
127127
128128 btn3 {
129− label = "Buttin 3";
129+ label = "Button 3";
130130 gpios = <&pioA 30 1>;
131131 linux,code = <0x103>;
132132 gpio-key,wakeup;
133133 };
134134
135135 btn4 {
136− label = "Buttin 4";
136+ label = "Button 4";
137137 gpios = <&pioA 31 1>;
138138 linux,code = <0x104>;
139139 gpio-key,wakeup;
arch/arm/boot/dts/dbx5x0.dtsi+16−1
@@ -483,6 +483,8 @@ · 482 unmodified lines
483483 compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell";
484484 reg = <0x80004000 0x1000>;
485485 interrupts = <0 21 0x4>;
486+ arm,primecell-periphid = <0x180024>;
487+
486488 #address-cells = <1>;
487489 #size-cells = <0>;
488490 v-i2c-supply = <&db8500_vape_reg>;
@@ -494,6 +496,8 @@ · 5 unmodified lines
494496 compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell";
495497 reg = <0x80122000 0x1000>;
496498 interrupts = <0 22 0x4>;
499+ arm,primecell-periphid = <0x180024>;
500+
497501 #address-cells = <1>;
498502 #size-cells = <0>;
499503 v-i2c-supply = <&db8500_vape_reg>;
@@ -505,6 +509,8 @@ · 5 unmodified lines
505509 compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell";
506510 reg = <0x80128000 0x1000>;
507511 interrupts = <0 55 0x4>;
512+ arm,primecell-periphid = <0x180024>;
513+
508514 #address-cells = <1>;
509515 #size-cells = <0>;
510516 v-i2c-supply = <&db8500_vape_reg>;
@@ -516,6 +522,8 @@ · 5 unmodified lines
516522 compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell";
517523 reg = <0x80110000 0x1000>;
518524 interrupts = <0 12 0x4>;
525+ arm,primecell-periphid = <0x180024>;
526+
519527 #address-cells = <1>;
520528 #size-cells = <0>;
521529 v-i2c-supply = <&db8500_vape_reg>;
@@ -527,6 +535,8 @@ · 5 unmodified lines
527535 compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell";
528536 reg = <0x8012a000 0x1000>;
529537 interrupts = <0 51 0x4>;
538+ arm,primecell-periphid = <0x180024>;
539+
530540 #address-cells = <1>;
531541 #size-cells = <0>;
532542 v-i2c-supply = <&db8500_vape_reg>;
@@ -573,33 +583,38 @@ · 40 unmodified lines
573583 interrupts = <0 60 0x4>;
574584 status = "disabled";
575585 };
586+
576587 sdi@80118000 {
577588 compatible = "arm,pl18x", "arm,primecell";
578589 reg = <0x80118000 0x1000>;
579590 interrupts = <0 50 0x4>;
580591 status = "disabled";
581592 };
593+
582594 sdi@80005000 {
583595 compatible = "arm,pl18x", "arm,primecell";
584596 reg = <0x80005000 0x1000>;
585597 interrupts = <0 41 0x4>;
586598 status = "disabled";
587599 };
600+
588601 sdi@80119000 {
589602 compatible = "arm,pl18x", "arm,primecell";
590603 reg = <0x80119000 0x1000>;
591604 interrupts = <0 59 0x4>;
592605 status = "disabled";
593606 };
607+
594608 sdi@80114000 {
595609 compatible = "arm,pl18x", "arm,primecell";
596610 reg = <0x80114000 0x1000>;
597611 interrupts = <0 99 0x4>;
598612 status = "disabled";
599613 };
614+
600615 sdi@80008000 {
601616 compatible = "arm,pl18x", "arm,primecell";
602− reg = <0x80114000 0x1000>;
617+ reg = <0x80008000 0x1000>;
603618 interrupts = <0 100 0x4>;
604619 status = "disabled";
605620 };
arch/arm/boot/dts/exynos4210-trats.dts+4−2
@@ -20,8 +20,10 @@ · 19 unmodified lines
2020 compatible = "samsung,trats", "samsung,exynos4210";
2121
2222 memory {
23− reg = <0x40000000 0x20000000
24− 0x60000000 0x20000000>;
23+ reg = <0x40000000 0x10000000
24+ 0x50000000 0x10000000
25+ 0x60000000 0x10000000
26+ 0x70000000 0x10000000>;
2527 };
2628
2729 chosen {
arch/arm/boot/dts/imx23.dtsi+1−0
@@ -69,6 +69,7 @@ · 68 unmodified lines
6969 interrupts = <13>, <56>;
7070 interrupt-names = "gpmi-dma", "bch";
7171 clocks = <&clks 34>;
72+ clock-names = "gpmi_io";
7273 fsl,gpmi-dma-channel = <4>;
7374 status = "disabled";
7475 };
arch/arm/boot/dts/imx28.dtsi+1−0
@@ -85,6 +85,7 @@ · 84 unmodified lines
8585 interrupts = <88>, <41>;
8686 interrupt-names = "gpmi-dma", "bch";
8787 clocks = <&clks 50>;
88+ clock-names = "gpmi_io";
8889 fsl,gpmi-dma-channel = <4>;
8990 status = "disabled";
9091 };
arch/arm/boot/dts/omap3.dtsi+2−2
@@ -257,7 +257,7 @@ · 256 unmodified lines
257257 interrupt-names = "common", "tx", "rx", "sidetone";
258258 interrupt-parent = <&intc>;
259259 ti,buffer-size = <1280>;
260− ti,hwmods = "mcbsp2";
260+ ti,hwmods = "mcbsp2", "mcbsp2_sidetone";
261261 };
262262
263263 mcbsp3: mcbsp@49024000 {
@@ -272,7 +272,7 @@ · 8 unmodified lines
272272 interrupt-names = "common", "tx", "rx", "sidetone";
273273 interrupt-parent = <&intc>;
274274 ti,buffer-size = <128>;
275− ti,hwmods = "mcbsp3";
275+ ti,hwmods = "mcbsp3", "mcbsp3_sidetone";
276276 };
277277
278278 mcbsp4: mcbsp@49026000 {
arch/arm/boot/dts/tegra30.dtsi+2−2
@@ -73,8 +73,8 @@ · 72 unmodified lines
7373
7474 pinmux: pinmux {
7575 compatible = "nvidia,tegra30-pinmux";
76− reg = <0x70000868 0xd0 /* Pad control registers */
77− 0x70003000 0x3e0>; /* Mux registers */
76+ reg = <0x70000868 0xd4 /* Pad control registers */
77+ 0x70003000 0x3e4>; /* Mux registers */
7878 };
7979
8080 serial@70006000 {
arch/arm/common/timer-sp.c+1−1
@@ -162,7 +162,6 @@ static struct clock_event_device sp804_clockevent = { · 161 unmodified lines
162162 .set_mode = sp804_set_mode,
163163 .set_next_event = sp804_set_next_event,
164164 .rating = 300,
165− .cpumask = cpu_all_mask,
166165 };
167166
168167 static struct irqaction sp804_timer_irq = {
@@ -185,6 +184,7 @@ void __init sp804_clockevents_init(void __iomem *base, unsigned int irq, · 16 unmodified lines
185184 clkevt_reload = DIV_ROUND_CLOSEST(rate, HZ);
186185 evt->name = name;
187186 evt->irq = irq;
187+ evt->cpumask = cpu_possible_mask;
188188
189189 setup_irq(irq, &sp804_timer_irq);
190190 clockevents_config_and_register(evt, rate, 0xf, 0xffffffff);
arch/arm/configs/imx_v6_v7_defconfig+2−0
@@ -139,6 +139,7 @@ CONFIG_I2C_IMX=y · 138 unmodified lines
139139 CONFIG_SPI=y
140140 CONFIG_SPI_IMX=y
141141 CONFIG_GPIO_SYSFS=y
142+CONFIG_GPIO_MC9S08DZ60=y
142143 # CONFIG_HWMON is not set
143144 CONFIG_WATCHDOG=y
144145 CONFIG_IMX2_WDT=y
@@ -155,6 +156,7 @@ CONFIG_SOC_CAMERA=y · 10 unmodified lines
155156 CONFIG_SOC_CAMERA_OV2640=y
156157 CONFIG_VIDEO_MX3=y
157158 CONFIG_FB=y
159+CONFIG_LCD_PLATFORM=y
158160 CONFIG_BACKLIGHT_LCD_SUPPORT=y
159161 CONFIG_LCD_CLASS_DEVICE=y
160162 CONFIG_LCD_L4F00242T03=y
arch/arm/configs/mvebu_defconfig+7−3
@@ -1,6 +1,6 @@
11 CONFIG_EXPERIMENTAL=y
22 CONFIG_SYSVIPC=y
3−CONFIG_NO_HZ=y
3+CONFIG_IRQ_DOMAIN_DEBUG=y
44 CONFIG_HIGH_RES_TIMERS=y
55 CONFIG_LOG_BUF_SHIFT=14
66 CONFIG_BLK_DEV_INITRD=y
@@ -9,10 +9,12 @@ CONFIG_SLAB=y · 2 unmodified lines
99 CONFIG_MODULES=y
1010 CONFIG_MODULE_UNLOAD=y
1111 CONFIG_ARCH_MVEBU=y
12−CONFIG_MACH_ARMADA_370_XP=y
12+CONFIG_MACH_ARMADA_370=y
13+CONFIG_MACH_ARMADA_XP=y
14+# CONFIG_CACHE_L2X0 is not set
1315 CONFIG_AEABI=y
1416 CONFIG_HIGHMEM=y
15−CONFIG_USE_OF=y
17+# CONFIG_COMPACTION is not set
1618 CONFIG_ZBOOT_ROM_TEXT=0x0
1719 CONFIG_ZBOOT_ROM_BSS=0x0
1820 CONFIG_ARM_APPENDED_DTB=y
@@ -23,6 +25,8 @@ CONFIG_SERIAL_8250_CONSOLE=y · 4 unmodified lines
2325 CONFIG_SERIAL_OF_PLATFORM=y
2426 CONFIG_GPIOLIB=y
2527 CONFIG_GPIO_SYSFS=y
28+# CONFIG_USB_SUPPORT is not set
29+# CONFIG_IOMMU_SUPPORT is not set
2630 CONFIG_EXT2_FS=y
2731 CONFIG_EXT3_FS=y
2832 # CONFIG_EXT3_FS_XATTR is not set
arch/arm/configs/versatile_defconfig+1−0
@@ -1,3 +1,4 @@
1+CONFIG_ARCH_VERSATILE=y
12 CONFIG_EXPERIMENTAL=y
23 # CONFIG_LOCALVERSION_AUTO is not set
34 CONFIG_SYSVIPC=y
arch/arm/include/asm/flat.h+1−1
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 #define flat_argvp_envp_on_stack() 1
99 #define flat_old_ram_flag(flags) (flags)
1010 #define flat_reloc_valid(reloc, size) ((reloc) <= (size))
11−#define flat_get_addr_from_rp(rp, relval, flags, persistent) get_unaligned(rp)
11+#define flat_get_addr_from_rp(rp, relval, flags, persistent) ((void)persistent,get_unaligned(rp))
1212 #define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp)
1313 #define flat_get_relocate_addr(rel) (rel)
1414 #define flat_set_persistent(relval, p) 0
arch/arm/include/asm/io.h+2−2
@@ -64,7 +64,7 @@ extern void __raw_readsl(const void __iomem *addr, void *data, int longlen); · 63 unmodified lines
6464 static inline void __raw_writew(u16 val, volatile void __iomem *addr)
6565 {
6666 asm volatile("strh %1, %0"
67− : "+Qo" (*(volatile u16 __force *)addr)
67+ : "+Q" (*(volatile u16 __force *)addr)
6868 : "r" (val));
6969 }
7070
@@ -72,7 +72,7 @@ static inline u16 __raw_readw(const volatile void __iomem *addr) · 1 unmodified line
7272 {
7373 u16 val;
7474 asm volatile("ldrh %1, %0"
75− : "+Qo" (*(volatile u16 __force *)addr),
75+ : "+Q" (*(volatile u16 __force *)addr),
7676 "=r" (val));
7777 return val;
7878 }
arch/arm/include/asm/sched_clock.h+0−2
@@ -10,7 +10,5 @@ · 9 unmodified lines
1010
1111 extern void sched_clock_postinit(void);
1212 extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate);
13−extern void setup_sched_clock_needs_suspend(u32 (*read)(void), int bits,
14− unsigned long rate);
1513
1614 #endif
arch/arm/include/asm/uaccess.h+2−2
@@ -200,8 +200,8 @@ extern int __put_user_8(void *, unsigned long long); · 199 unmodified lines
200200 #define USER_DS KERNEL_DS
201201
202202 #define segment_eq(a,b) (1)
203−#define __addr_ok(addr) (1)
204−#define __range_ok(addr,size) (0)
203+#define __addr_ok(addr) ((void)(addr),1)
204+#define __range_ok(addr,size) ((void)(addr),0)
205205 #define get_fs() (KERNEL_DS)
206206
207207 static inline void set_fs(mm_segment_t fs)
arch/arm/include/asm/vfpmacros.h+6−6
@@ -27,9 +27,9 @@ · 26 unmodified lines
2727 #if __LINUX_ARM_ARCH__ <= 6
2828 ldr \tmp, =elf_hwcap @ may not have MVFR regs
2929 ldr \tmp, [\tmp, #0]
30− tst \tmp, #HWCAP_VFPv3D16
31− ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
32− addne \base, \base, #32*4 @ step over unused register space
30+ tst \tmp, #HWCAP_VFPD32
31+ ldcnel p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
32+ addeq \base, \base, #32*4 @ step over unused register space
3333 #else
3434 VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
3535 and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
@@ -51,9 +51,9 @@ · 15 unmodified lines
5151 #if __LINUX_ARM_ARCH__ <= 6
5252 ldr \tmp, =elf_hwcap @ may not have MVFR regs
5353 ldr \tmp, [\tmp, #0]
54− tst \tmp, #HWCAP_VFPv3D16
55− stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
56− addne \base, \base, #32*4 @ step over unused register space
54+ tst \tmp, #HWCAP_VFPD32
55+ stcnel p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
56+ addeq \base, \base, #32*4 @ step over unused register space
5757 #else
5858 VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
5959 and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
arch/arm/include/debug/8250_32.S+27−0
@@ -0,0 +1,27 @@
1+/*
2+ * Copyright (c) 2011 Picochip Ltd., Jamie Iles
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License version 2 as
6+ * published by the Free Software Foundation.
7+ *
8+ * Derived from arch/arm/mach-davinci/include/mach/debug-macro.S to use 32-bit
9+ * accesses to the 8250.
10+ */
11+
12+#include <linux/serial_reg.h>
13+
14+ .macro senduart,rd,rx
15+ str \rd, [\rx, #UART_TX << UART_SHIFT]
16+ .endm
17+
18+ .macro busyuart,rd,rx
19+1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT]
20+ and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
21+ teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
22+ bne 1002b
23+ .endm
24+
25+ /* The UART's don't have any flow control IO's wired up. */
26+ .macro waituart,rd,rx
27+ .endm
arch/arm/include/debug/picoxcell.S+1−17
@@ -5,10 +5,7 @@ · 4 unmodified lines
55 * it under the terms of the GNU General Public License version 2 as
66 * published by the Free Software Foundation.
77 *
8− * Derived from arch/arm/mach-davinci/include/mach/debug-macro.S to use 32-bit
9− * accesses to the 8250.
108 */
11−#include <linux/serial_reg.h>
129
1310 #define UART_SHIFT 2
1411 #define PICOXCELL_UART1_BASE 0x80230000
@@ -19,17 +16,4 @@ · 4 unmodified lines
1916 ldr \rp, =PICOXCELL_UART1_BASE
2017 .endm
2118
22− .macro senduart,rd,rx
23− str \rd, [\rx, #UART_TX << UART_SHIFT]
24− .endm
25−
26− .macro busyuart,rd,rx
27−1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT]
28− and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
29− teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
30− bne 1002b
31− .endm
32−
33− /* The UART's don't have any flow control IO's wired up. */
34− .macro waituart,rd,rx
35− .endm
19+#include "8250_32.S"
arch/arm/include/debug/socfpga.S+5−0
@@ -7,6 +7,9 @@ · 6 unmodified lines
77 * published by the Free Software Foundation.
88 */
99
10+#define UART_SHIFT 2
11+#define DEBUG_LL_UART_OFFSET 0x00002000
12+
1013 .macro addruart, rp, rv, tmp
1114 mov \rp, #DEBUG_LL_UART_OFFSET
1215 orr \rp, \rp, #0x00c00000
@@ -14,3 +17,5 @@ · 1 unmodified line
1417 orr \rp, \rp, #0xff000000 @ physical base
1518 .endm
1619
20+#include "8250_32.S"
21+
arch/arm/include/uapi/asm/hwcap.h+2−1
@@ -18,11 +18,12 @@ · 17 unmodified lines
1818 #define HWCAP_THUMBEE (1 << 11)
1919 #define HWCAP_NEON (1 << 12)
2020 #define HWCAP_VFPv3 (1 << 13)
21−#define HWCAP_VFPv3D16 (1 << 14)
21+#define HWCAP_VFPv3D16 (1 << 14) /* also set for VFPv4-D16 */
2222 #define HWCAP_TLS (1 << 15)
2323 #define HWCAP_VFPv4 (1 << 16)
2424 #define HWCAP_IDIVA (1 << 17)
2525 #define HWCAP_IDIVT (1 << 18)
26+#define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */
2627 #define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
2728
2829
arch/arm/kernel/irq.c+2−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 #include <linux/list.h>
3535 #include <linux/kallsyms.h>
3636 #include <linux/proc_fs.h>
37+#include <linux/export.h>
3738
3839 #include <asm/exception.h>
3940 #include <asm/mach/arch.h>
@@ -109,6 +110,7 @@ void set_irq_flags(unsigned int irq, unsigned int iflags) · 69 unmodified lines
109110 /* Order is clear bits in "clr" then set bits in "set" */
110111 irq_modify_status(irq, clr, set & ~clr);
111112 }
113+EXPORT_SYMBOL_GPL(set_irq_flags);
112114
113115 void __init init_IRQ(void)
114116 {
arch/arm/kernel/kprobes-test-arm.c+4−0
@@ -366,7 +366,9 @@ void kprobe_arm_test_cases(void) · 365 unmodified lines
366366 TEST_UNSUPPORTED(".word 0xe04f0392 @ umaal r0, pc, r2, r3")
367367 TEST_UNSUPPORTED(".word 0xe0500090 @ undef")
368368 TEST_UNSUPPORTED(".word 0xe05fff9f @ undef")
369+#endif
369370
371+#if __LINUX_ARM_ARCH__ >= 7
370372 TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
371373 TEST_RRR( "mlshi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
372374 TEST_RR( "mls lr, r",1, VAL2,", r",2, VAL3,", r13")
@@ -456,6 +458,8 @@ void kprobe_arm_test_cases(void) · 83 unmodified lines
456458 TEST_UNSUPPORTED(".word 0xe1700090") /* Unallocated space */
457459 #if __LINUX_ARM_ARCH__ >= 6
458460 TEST_UNSUPPORTED("ldrex r2, [sp]")
461+#endif
462+#if (__LINUX_ARM_ARCH__ >= 7) || defined(CONFIG_CPU_32v6K)
459463 TEST_UNSUPPORTED("strexd r0, r2, r3, [sp]")
460464 TEST_UNSUPPORTED("ldrexd r2, r3, [sp]")
461465 TEST_UNSUPPORTED("strexb r0, r2, [sp]")
arch/arm/kernel/machine_kexec.c+3−4
@@ -45,10 +45,9 @@ int machine_kexec_prepare(struct kimage *image) · 44 unmodified lines
4545 for (i = 0; i < image->nr_segments; i++) {
4646 current_segment = &image->segment[i];
4747
48− err = memblock_is_region_memory(current_segment->mem,
49− current_segment->memsz);
50− if (err)
51− return - EINVAL;
48+ if (!memblock_is_region_memory(current_segment->mem,
49+ current_segment->memsz))
50+ return -EINVAL;
5251
5352 err = get_user(header, (__be32*)current_segment->buf);
5453 if (err)
arch/arm/kernel/perf_event.c+4−0
@@ -96,6 +96,10 @@ armpmu_event_set_period(struct perf_event *event, · 95 unmodified lines
9696 s64 period = hwc->sample_period;
9797 int ret = 0;
9898
99+ /* The period may have been changed by PERF_EVENT_IOC_PERIOD */
100+ if (unlikely(period != hwc->last_period))
101+ left = period - (hwc->last_period - left);
102+
99103 if (unlikely(left <= -period)) {
100104 left = period;
101105 local64_set(&hwc->period_left, left);
arch/arm/kernel/sched_clock.c+4−14
@@ -107,13 +107,6 @@ static void sched_clock_poll(unsigned long wrap_ticks) · 106 unmodified lines
107107 update_sched_clock();
108108 }
109109
110−void __init setup_sched_clock_needs_suspend(u32 (*read)(void), int bits,
111− unsigned long rate)
112−{
113− setup_sched_clock(read, bits, rate);
114− cd.needs_suspend = true;
115−}
116−
117110 void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate)
118111 {
119112 unsigned long r, w;
@@ -189,18 +182,15 @@ void __init sched_clock_postinit(void) · 69 unmodified lines
189182 static int sched_clock_suspend(void)
190183 {
191184 sched_clock_poll(sched_clock_timer.data);
192− if (cd.needs_suspend)
193− cd.suspended = true;
185+ cd.suspended = true;
194186 return 0;
195187 }
196188
197189 static void sched_clock_resume(void)
198190 {
199− if (cd.needs_suspend) {
200− cd.epoch_cyc = read_sched_clock();
201− cd.epoch_cyc_copy = cd.epoch_cyc;
202− cd.suspended = false;
203− }
191+ cd.epoch_cyc = read_sched_clock();
192+ cd.epoch_cyc_copy = cd.epoch_cyc;
193+ cd.suspended = false;
204194 }
205195
206196 static struct syscore_ops sched_clock_ops = {
arch/arm/kernel/smp.c+10−4
@@ -294,18 +294,24 @@ static void percpu_timer_setup(void); · 293 unmodified lines
294294 asmlinkage void __cpuinit secondary_start_kernel(void)
295295 {
296296 struct mm_struct *mm = &init_mm;
297− unsigned int cpu = smp_processor_id();
297+ unsigned int cpu;
298+
299+ /*
300+ * The identity mapping is uncached (strongly ordered), so
301+ * switch away from it before attempting any exclusive accesses.
302+ */
303+ cpu_switch_mm(mm->pgd, mm);
304+ enter_lazy_tlb(mm, current);
305+ local_flush_tlb_all();
298306
299307 /*
300308 * All kernel threads share the same mm context; grab a
301309 * reference and switch to it.
302310 */
311+ cpu = smp_processor_id();
303312 atomic_inc(&mm->mm_count);
304313 current->active_mm = mm;
305314 cpumask_set_cpu(cpu, mm_cpumask(mm));
306− cpu_switch_mm(mm->pgd, mm);
307− enter_lazy_tlb(mm, current);
308− local_flush_tlb_all();
309315
310316 printk("CPU%u: Booted secondary processor\n", cpu);
311317
arch/arm/kernel/smp_twd.c+2−2
@@ -42,10 +42,10 @@ static void twd_set_mode(enum clock_event_mode mode, · 41 unmodified lines
4242
4343 switch (mode) {
4444 case CLOCK_EVT_MODE_PERIODIC:
45− /* timer load already set up */
4645 ctrl = TWD_TIMER_CONTROL_ENABLE | TWD_TIMER_CONTROL_IT_ENABLE
4746 | TWD_TIMER_CONTROL_PERIODIC;
48− __raw_writel(twd_timer_rate / HZ, twd_base + TWD_TIMER_LOAD);
47+ __raw_writel(DIV_ROUND_CLOSEST(twd_timer_rate, HZ),
48+ twd_base + TWD_TIMER_LOAD);
4949 break;
5050 case CLOCK_EVT_MODE_ONESHOT:
5151 /* period set, and timer enabled in 'next_event' hook */
arch/arm/lib/delay.c+1−0
@@ -45,6 +45,7 @@ int read_current_timer(unsigned long *timer_val) · 44 unmodified lines
4545 *timer_val = delay_timer->read_current_timer();
4646 return 0;
4747 }
48+EXPORT_SYMBOL_GPL(read_current_timer);
4849
4950 static void __timer_delay(unsigned long cycles)
5051 {
arch/arm/mach-at91/Kconfig+2−8
@@ -21,19 +21,13 @@ config SOC_AT91SAM9 · 20 unmodified lines
2121 bool
2222 select CPU_ARM926T
2323 select GENERIC_CLOCKEVENTS
24+ select MULTI_IRQ_HANDLER
25+ select SPARSE_IRQ
2426
2527 menu "Atmel AT91 System-on-Chip"
2628
2729 comment "Atmel AT91 Processor"
2830
29−config SOC_AT91SAM9
30− bool
31− select AT91_SAM9_SMC
32− select AT91_SAM9_TIME
33− select CPU_ARM926T
34− select MULTI_IRQ_HANDLER
35− select SPARSE_IRQ
36−
3731 config SOC_AT91RM9200
3832 bool "AT91RM9200"
3933 select CPU_ARM920T
arch/arm/mach-at91/at91rm9200.c+1−1
@@ -187,7 +187,7 @@ static struct clk_lookup periph_clocks_lookups[] = { · 186 unmodified lines
187187 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
188188 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
189189 CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
190− CLKDEV_CON_DEV_ID(NULL, "i2c-at91rm9200", &twi_clk),
190+ CLKDEV_CON_DEV_ID(NULL, "i2c-at91rm9200.0", &twi_clk),
191191 /* fake hclk clock */
192192 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
193193 CLKDEV_CON_ID("pioA", &pioA_clk),
arch/arm/mach-at91/at91rm9200_devices.c+3−3
@@ -68,7 +68,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) · 67 unmodified lines
6868
6969 /* Enable overcurrent notification */
7070 for (i = 0; i < data->ports; i++) {
71− if (data->overcurrent_pin[i])
71+ if (gpio_is_valid(data->overcurrent_pin[i]))
7272 at91_set_gpio_input(data->overcurrent_pin[i], 1);
7373 }
7474
@@ -479,7 +479,7 @@ static struct i2c_gpio_platform_data pdata = { · 404 unmodified lines
479479
480480 static struct platform_device at91rm9200_twi_device = {
481481 .name = "i2c-gpio",
482− .id = -1,
482+ .id = 0,
483483 .dev.platform_data = &pdata,
484484 };
485485
@@ -512,7 +512,7 @@ static struct resource twi_resources[] = { · 26 unmodified lines
512512
513513 static struct platform_device at91rm9200_twi_device = {
514514 .name = "i2c-at91rm9200",
515− .id = -1,
515+ .id = 0,
516516 .resource = twi_resources,
517517 .num_resources = ARRAY_SIZE(twi_resources),
518518 };
arch/arm/mach-at91/at91sam9260.c+2−2
@@ -211,8 +211,8 @@ static struct clk_lookup periph_clocks_lookups[] = { · 210 unmodified lines
211211 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk),
212212 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk),
213213 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk),
214− CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260", &twi_clk),
215− CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20", &twi_clk),
214+ CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260.0", &twi_clk),
215+ CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.0", &twi_clk),
216216 /* more usart lookup table for DT entries */
217217 CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck),
218218 CLKDEV_CON_DEV_ID("usart", "fffb0000.serial", &usart0_clk),
arch/arm/mach-at91/at91sam9260_devices.c+3−3
@@ -72,7 +72,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) · 71 unmodified lines
7272
7373 /* Enable overcurrent notification */
7474 for (i = 0; i < data->ports; i++) {
75− if (data->overcurrent_pin[i])
75+ if (gpio_is_valid(data->overcurrent_pin[i]))
7676 at91_set_gpio_input(data->overcurrent_pin[i], 1);
7777 }
7878
@@ -389,7 +389,7 @@ static struct i2c_gpio_platform_data pdata = { · 310 unmodified lines
389389
390390 static struct platform_device at91sam9260_twi_device = {
391391 .name = "i2c-gpio",
392− .id = -1,
392+ .id = 0,
393393 .dev.platform_data = &pdata,
394394 };
395395
@@ -421,7 +421,7 @@ static struct resource twi_resources[] = { · 25 unmodified lines
421421 };
422422
423423 static struct platform_device at91sam9260_twi_device = {
424− .id = -1,
424+ .id = 0,
425425 .resource = twi_resources,
426426 .num_resources = ARRAY_SIZE(twi_resources),
427427 };
arch/arm/mach-at91/at91sam9261.c+2−2
@@ -178,8 +178,8 @@ static struct clk_lookup periph_clocks_lookups[] = { · 177 unmodified lines
178178 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
179179 CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
180180 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0),
181− CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9261", &twi_clk),
182− CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10", &twi_clk),
181+ CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9261.0", &twi_clk),
182+ CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10.0", &twi_clk),
183183 CLKDEV_CON_ID("pioA", &pioA_clk),
184184 CLKDEV_CON_ID("pioB", &pioB_clk),
185185 CLKDEV_CON_ID("pioC", &pioC_clk),
arch/arm/mach-at91/at91sam9261_devices.c+3−3
@@ -72,7 +72,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) · 71 unmodified lines
7272
7373 /* Enable overcurrent notification */
7474 for (i = 0; i < data->ports; i++) {
75− if (data->overcurrent_pin[i])
75+ if (gpio_is_valid(data->overcurrent_pin[i]))
7676 at91_set_gpio_input(data->overcurrent_pin[i], 1);
7777 }
7878
@@ -285,7 +285,7 @@ static struct i2c_gpio_platform_data pdata = { · 206 unmodified lines
285285
286286 static struct platform_device at91sam9261_twi_device = {
287287 .name = "i2c-gpio",
288− .id = -1,
288+ .id = 0,
289289 .dev.platform_data = &pdata,
290290 };
291291
@@ -317,7 +317,7 @@ static struct resource twi_resources[] = { · 25 unmodified lines
317317 };
318318
319319 static struct platform_device at91sam9261_twi_device = {
320− .id = -1,
320+ .id = 0,
321321 .resource = twi_resources,
322322 .num_resources = ARRAY_SIZE(twi_resources),
323323 };
arch/arm/mach-at91/at91sam9263.c+1−1
@@ -193,7 +193,7 @@ static struct clk_lookup periph_clocks_lookups[] = { · 192 unmodified lines
193193 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
194194 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
195195 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk),
196− CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260", &twi_clk),
196+ CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260.0", &twi_clk),
197197 /* fake hclk clock */
198198 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
199199 CLKDEV_CON_ID("pioA", &pioA_clk),
arch/arm/mach-at91/at91sam9263_devices.c+3−3
@@ -78,7 +78,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) · 77 unmodified lines
7878
7979 /* Enable overcurrent notification */
8080 for (i = 0; i < data->ports; i++) {
81− if (data->overcurrent_pin[i])
81+ if (gpio_is_valid(data->overcurrent_pin[i]))
8282 at91_set_gpio_input(data->overcurrent_pin[i], 1);
8383 }
8484
@@ -567,7 +567,7 @@ static struct i2c_gpio_platform_data pdata = { · 482 unmodified lines
567567
568568 static struct platform_device at91sam9263_twi_device = {
569569 .name = "i2c-gpio",
570− .id = -1,
570+ .id = 0,
571571 .dev.platform_data = &pdata,
572572 };
573573
@@ -600,7 +600,7 @@ static struct resource twi_resources[] = { · 26 unmodified lines
600600
601601 static struct platform_device at91sam9263_twi_device = {
602602 .name = "i2c-at91sam9260",
603− .id = -1,
603+ .id = 0,
604604 .resource = twi_resources,
605605 .num_resources = ARRAY_SIZE(twi_resources),
606606 };
arch/arm/mach-at91/at91sam9g45_devices.c+6−6
@@ -1841,8 +1841,8 @@ static struct resource sha_resources[] = { · 1840 unmodified lines
18411841 .flags = IORESOURCE_MEM,
18421842 },
18431843 [1] = {
1844− .start = AT91SAM9G45_ID_AESTDESSHA,
1845− .end = AT91SAM9G45_ID_AESTDESSHA,
1844+ .start = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA,
1845+ .end = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA,
18461846 .flags = IORESOURCE_IRQ,
18471847 },
18481848 };
@@ -1874,8 +1874,8 @@ static struct resource tdes_resources[] = { · 25 unmodified lines
18741874 .flags = IORESOURCE_MEM,
18751875 },
18761876 [1] = {
1877− .start = AT91SAM9G45_ID_AESTDESSHA,
1878− .end = AT91SAM9G45_ID_AESTDESSHA,
1877+ .start = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA,
1878+ .end = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA,
18791879 .flags = IORESOURCE_IRQ,
18801880 },
18811881 };
@@ -1910,8 +1910,8 @@ static struct resource aes_resources[] = { · 28 unmodified lines
19101910 .flags = IORESOURCE_MEM,
19111911 },
19121912 [1] = {
1913− .start = AT91SAM9G45_ID_AESTDESSHA,
1914− .end = AT91SAM9G45_ID_AESTDESSHA,
1913+ .start = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA,
1914+ .end = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA,
19151915 .flags = IORESOURCE_IRQ,
19161916 },
19171917 };
arch/arm/mach-at91/at91sam9rl_devices.c+2−2
@@ -314,7 +314,7 @@ static struct i2c_gpio_platform_data pdata = { · 313 unmodified lines
314314
315315 static struct platform_device at91sam9rl_twi_device = {
316316 .name = "i2c-gpio",
317− .id = -1,
317+ .id = 0,
318318 .dev.platform_data = &pdata,
319319 };
320320
@@ -347,7 +347,7 @@ static struct resource twi_resources[] = { · 26 unmodified lines
347347
348348 static struct platform_device at91sam9rl_twi_device = {
349349 .name = "i2c-at91sam9g20",
350− .id = -1,
350+ .id = 0,
351351 .resource = twi_resources,
352352 .num_resources = ARRAY_SIZE(twi_resources),
353353 };
arch/arm/mach-at91/at91x40.c+1−1
@@ -88,6 +88,6 @@ void __init at91x40_init_interrupts(unsigned int priority[NR_AIC_IRQS]) · 87 unmodified lines
8888 if (!priority)
8989 priority = at91x40_default_irq_priority;
9090
91− at91_aic_init(priority);
91+ at91_aic_init(priority, at91_extern_irq);
9292 }
9393
arch/arm/mach-at91/board-neocore926.c+1−1
@@ -129,7 +129,7 @@ static struct spi_board_info neocore926_spi_devices[] = { · 128 unmodified lines
129129 .max_speed_hz = 125000 * 16,
130130 .bus_num = 0,
131131 .platform_data = &ads_info,
132− .irq = AT91SAM9263_ID_IRQ1,
132+ .irq = NR_IRQS_LEGACY + AT91SAM9263_ID_IRQ1,
133133 },
134134 #endif
135135 };
arch/arm/mach-at91/board-sam9261ek.c+1−1
@@ -309,7 +309,7 @@ static struct spi_board_info ek_spi_devices[] = { · 308 unmodified lines
309309 .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */
310310 .bus_num = 0,
311311 .platform_data = &ads_info,
312− .irq = AT91SAM9261_ID_IRQ0,
312+ .irq = NR_IRQS_LEGACY + AT91SAM9261_ID_IRQ0,
313313 .controller_data = (void *) AT91_PIN_PA28, /* CS pin */
314314 },
315315 #endif
arch/arm/mach-at91/board-sam9263ek.c+1−1
@@ -132,7 +132,7 @@ static struct spi_board_info ek_spi_devices[] = { · 131 unmodified lines
132132 .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */
133133 .bus_num = 0,
134134 .platform_data = &ads_info,
135− .irq = AT91SAM9263_ID_IRQ1,
135+ .irq = NR_IRQS_LEGACY + AT91SAM9263_ID_IRQ1,
136136 },
137137 #endif
138138 };
arch/arm/mach-at91/generic.h+2−1
@@ -26,7 +26,8 @@ extern void __init at91_dt_initialize(void); · 25 unmodified lines
2626 extern void __init at91_init_irq_default(void);
2727 extern void __init at91_init_interrupts(unsigned int priority[]);
2828 extern void __init at91x40_init_interrupts(unsigned int priority[]);
29−extern void __init at91_aic_init(unsigned int priority[]);
29+extern void __init at91_aic_init(unsigned int priority[],
30+ unsigned int ext_irq_mask);
3031 extern int __init at91_aic_of_init(struct device_node *node,
3132 struct device_node *parent);
3233 extern int __init at91_aic5_of_init(struct device_node *node,
arch/arm/mach-at91/irq.c+7−2
@@ -502,14 +502,19 @@ int __init at91_aic5_of_init(struct device_node *node, · 501 unmodified lines
502502 /*
503503 * Initialize the AIC interrupt controller.
504504 */
505−void __init at91_aic_init(unsigned int *priority)
505+void __init at91_aic_init(unsigned int *priority, unsigned int ext_irq_mask)
506506 {
507507 unsigned int i;
508508 int irq_base;
509509
510− if (at91_aic_pm_init())
510+ at91_extern_irq = kzalloc(BITS_TO_LONGS(n_irqs)
511+ * sizeof(*at91_extern_irq), GFP_KERNEL);
512+
513+ if (at91_aic_pm_init() || at91_extern_irq == NULL)
511514 panic("Unable to allocate bit maps\n");
512515
516+ *at91_extern_irq = ext_irq_mask;
517+
513518 at91_aic_base = ioremap(AT91_AIC, 512);
514519 if (!at91_aic_base)
515520 panic("Unable to ioremap AIC registers\n");
arch/arm/mach-at91/setup.c+2−2
@@ -47,7 +47,7 @@ void __init at91_init_irq_default(void) · 46 unmodified lines
4747 void __init at91_init_interrupts(unsigned int *priority)
4848 {
4949 /* Initialize the AIC interrupt controller */
50− at91_aic_init(priority);
50+ at91_aic_init(priority, at91_extern_irq);
5151
5252 /* Enable GPIO interrupts */
5353 at91_gpio_irq_setup();
@@ -151,7 +151,7 @@ static void __init soc_detect(u32 dbgu_base) · 97 unmodified lines
151151 }
152152
153153 /* at91sam9g10 */
154− if ((cidr & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
154+ if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
155155 at91_soc_initdata.type = AT91_SOC_SAM9G10;
156156 at91_boot_soc = at91sam9261_soc;
157157 }
arch/arm/mach-davinci/dm644x.c+1−2
@@ -713,8 +713,7 @@ static int dm644x_venc_setup_clock(enum vpbe_enc_timings_type type, · 712 unmodified lines
713713 break;
714714 case VPBE_ENC_CUSTOM_TIMINGS:
715715 if (pclock <= 27000000) {
716− v |= DM644X_VPSS_MUXSEL_PLL2_MODE |
717− DM644X_VPSS_DACCLKEN;
716+ v |= DM644X_VPSS_DACCLKEN;
718717 writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL));
719718 } else {
720719 /*
arch/arm/mach-dove/include/mach/pm.h+1−1
@@ -63,7 +63,7 @@ static inline int pmu_to_irq(int pin) · 62 unmodified lines
6363
6464 static inline int irq_to_pmu(int irq)
6565 {
66− if (IRQ_DOVE_PMU_START < irq && irq < NR_IRQS)
66+ if (IRQ_DOVE_PMU_START <= irq && irq < NR_IRQS)
6767 return irq - IRQ_DOVE_PMU_START;
6868
6969 return -EINVAL;
arch/arm/mach-dove/irq.c+13−1
@@ -46,8 +46,20 @@ static void pmu_irq_ack(struct irq_data *d) · 45 unmodified lines
4646 int pin = irq_to_pmu(d->irq);
4747 u32 u;
4848
49+ /*
50+ * The PMU mask register is not RW0C: it is RW. This means that
51+ * the bits take whatever value is written to them; if you write
52+ * a '1', you will set the interrupt.
53+ *
54+ * Unfortunately this means there is NO race free way to clear
55+ * these interrupts.
56+ *
57+ * So, let's structure the code so that the window is as small as
58+ * possible.
59+ */
4960 u = ~(1 << (pin & 31));
50− writel(u, PMU_INTERRUPT_CAUSE);
61+ u &= readl_relaxed(PMU_INTERRUPT_CAUSE);
62+ writel_relaxed(u, PMU_INTERRUPT_CAUSE);
5163 }
5264
5365 static struct irq_chip pmu_irq_chip = {
arch/arm/mach-exynos/common.c+5−0
@@ -47,6 +47,7 @@ · 46 unmodified lines
4747 #include <plat/fimc-core.h>
4848 #include <plat/iic-core.h>
4949 #include <plat/tv-core.h>
50+#include <plat/spi-core.h>
5051 #include <plat/regs-serial.h>
5152
5253 #include "common.h"
@@ -346,6 +347,8 @@ static void __init exynos4_map_io(void) · 293 unmodified lines
346347
347348 s5p_fb_setname(0, "exynos4-fb");
348349 s5p_hdmi_setname("exynos4-hdmi");
350+
351+ s3c64xx_spi_setname("exynos4210-spi");
349352 }
350353
351354 static void __init exynos5_map_io(void)
@@ -366,6 +369,8 @@ static void __init exynos5_map_io(void) · 14 unmodified lines
366369 s3c_i2c0_setname("s3c2440-i2c");
367370 s3c_i2c1_setname("s3c2440-i2c");
368371 s3c_i2c2_setname("s3c2440-i2c");
372+
373+ s3c64xx_spi_setname("exynos4210-spi");
369374 }
370375
371376 static void __init exynos4_init_clocks(int xtal)
arch/arm/mach-exynos/dma.c+3−0
@@ -275,6 +275,9 @@ static int __init exynos_dma_init(void) · 274 unmodified lines
275275 exynos_pdma1_pdata.nr_valid_peri =
276276 ARRAY_SIZE(exynos4210_pdma1_peri);
277277 exynos_pdma1_pdata.peri_id = exynos4210_pdma1_peri;
278+
279+ if (samsung_rev() == EXYNOS4210_REV_0)
280+ exynos_mdma1_device.res.start = EXYNOS4_PA_S_MDMA1;
278281 } else if (soc_is_exynos4212() || soc_is_exynos4412()) {
279282 exynos_pdma0_pdata.nr_valid_peri =
280283 ARRAY_SIZE(exynos4212_pdma0_peri);
arch/arm/mach-exynos/include/mach/map.h+1−0
@@ -90,6 +90,7 @@ · 89 unmodified lines
9090
9191 #define EXYNOS4_PA_MDMA0 0x10810000
9292 #define EXYNOS4_PA_MDMA1 0x12850000
93+#define EXYNOS4_PA_S_MDMA1 0x12840000
9394 #define EXYNOS4_PA_PDMA0 0x12680000
9495 #define EXYNOS4_PA_PDMA1 0x12690000
9596 #define EXYNOS5_PA_MDMA0 0x10800000
arch/arm/mach-exynos/mach-exynos4-dt.c+1−0
@@ -99,6 +99,7 @@ static char const *exynos4_dt_compat[] __initdata = { · 98 unmodified lines
9999
100100 DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
101101 /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */
102+ .smp = smp_ops(exynos_smp_ops),
102103 .init_irq = exynos4_init_irq,
103104 .map_io = exynos4_dt_map_io,
104105 .handle_irq = gic_handle_irq,
arch/arm/mach-highbank/system.c+2−1
@@ -28,6 +28,7 @@ void highbank_restart(char mode, const char *cmd) · 27 unmodified lines
2828 hignbank_set_pwr_soft_reset();
2929
3030 scu_power_mode(scu_base_addr, SCU_PM_POWEROFF);
31− cpu_do_idle();
31+ while (1)
32+ cpu_do_idle();
3233 }
3334
arch/arm/mach-imx/clk-busy.c+1−1
@@ -108,7 +108,7 @@ struct clk *imx_clk_busy_divider(const char *name, const char *parent_name, · 107 unmodified lines
108108 busy->div.hw.init = &init;
109109
110110 clk = clk_register(NULL, &busy->div.hw);
111− if (!clk)
111+ if (IS_ERR(clk))
112112 kfree(busy);
113113
114114 return clk;
arch/arm/mach-imx/clk-gate2.c+1−1
@@ -112,7 +112,7 @@ struct clk *clk_register_gate2(struct device *dev, const char *name, · 111 unmodified lines
112112
113113 clk = clk_register(dev, &gate->hw);
114114 if (IS_ERR(clk))
115− kfree(clk);
115+ kfree(gate);
116116
117117 return clk;
118118 }
arch/arm/mach-imx/clk-imx25.c+2−2
@@ -127,8 +127,8 @@ int __init mx25_clocks_init(void) · 126 unmodified lines
127127 clk[esdhc2_ipg_per] = imx_clk_gate("esdhc2_ipg_per", "per4", ccm(CCM_CGCR0), 4);
128128 clk[gpt_ipg_per] = imx_clk_gate("gpt_ipg_per", "per5", ccm(CCM_CGCR0), 5);
129129 clk[i2c_ipg_per] = imx_clk_gate("i2c_ipg_per", "per6", ccm(CCM_CGCR0), 6);
130− clk[lcdc_ipg_per] = imx_clk_gate("lcdc_ipg_per", "per8", ccm(CCM_CGCR0), 7);
131− clk[nfc_ipg_per] = imx_clk_gate("nfc_ipg_per", "ipg_per", ccm(CCM_CGCR0), 8);
130+ clk[lcdc_ipg_per] = imx_clk_gate("lcdc_ipg_per", "per7", ccm(CCM_CGCR0), 7);
131+ clk[nfc_ipg_per] = imx_clk_gate("nfc_ipg_per", "per8", ccm(CCM_CGCR0), 8);
132132 clk[ssi1_ipg_per] = imx_clk_gate("ssi1_ipg_per", "per13", ccm(CCM_CGCR0), 13);
133133 clk[ssi2_ipg_per] = imx_clk_gate("ssi2_ipg_per", "per14", ccm(CCM_CGCR0), 14);
134134 clk[uart_ipg_per] = imx_clk_gate("uart_ipg_per", "per15", ccm(CCM_CGCR0), 15);
arch/arm/mach-imx/clk-imx27.c+2−2
@@ -109,7 +109,7 @@ int __init mx27_clocks_init(unsigned long fref) · 108 unmodified lines
109109 clk[per3_div] = imx_clk_divider("per3_div", "mpll_main2", CCM_PCDR1, 16, 6);
110110 clk[per4_div] = imx_clk_divider("per4_div", "mpll_main2", CCM_PCDR1, 24, 6);
111111 clk[vpu_sel] = imx_clk_mux("vpu_sel", CCM_CSCR, 21, 1, vpu_sel_clks, ARRAY_SIZE(vpu_sel_clks));
112− clk[vpu_div] = imx_clk_divider("vpu_div", "vpu_sel", CCM_PCDR0, 10, 3);
112+ clk[vpu_div] = imx_clk_divider("vpu_div", "vpu_sel", CCM_PCDR0, 10, 6);
113113 clk[usb_div] = imx_clk_divider("usb_div", "spll", CCM_CSCR, 28, 3);
114114 clk[cpu_sel] = imx_clk_mux("cpu_sel", CCM_CSCR, 15, 1, cpu_sel_clks, ARRAY_SIZE(cpu_sel_clks));
115115 clk[clko_sel] = imx_clk_mux("clko_sel", CCM_CCSR, 0, 5, clko_sel_clks, ARRAY_SIZE(clko_sel_clks));
@@ -121,7 +121,7 @@ int __init mx27_clocks_init(unsigned long fref) · 5 unmodified lines
121121 clk[ssi1_sel] = imx_clk_mux("ssi1_sel", CCM_CSCR, 22, 1, ssi_sel_clks, ARRAY_SIZE(ssi_sel_clks));
122122 clk[ssi2_sel] = imx_clk_mux("ssi2_sel", CCM_CSCR, 23, 1, ssi_sel_clks, ARRAY_SIZE(ssi_sel_clks));
123123 clk[ssi1_div] = imx_clk_divider("ssi1_div", "ssi1_sel", CCM_PCDR0, 16, 6);
124− clk[ssi2_div] = imx_clk_divider("ssi2_div", "ssi2_sel", CCM_PCDR0, 26, 3);
124+ clk[ssi2_div] = imx_clk_divider("ssi2_div", "ssi2_sel", CCM_PCDR0, 26, 6);
125125 clk[clko_en] = imx_clk_gate("clko_en", "clko_div", CCM_PCCR0, 0);
126126 clk[ssi2_ipg_gate] = imx_clk_gate("ssi2_ipg_gate", "ipg", CCM_PCCR0, 0);
127127 clk[ssi1_ipg_gate] = imx_clk_gate("ssi1_ipg_gate", "ipg", CCM_PCCR0, 1);
arch/arm/mach-imx/ehci-imx25.c+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 #define MX25_H1_SIC_SHIFT 21
3131 #define MX25_H1_SIC_MASK (0x3 << MX25_H1_SIC_SHIFT)
3232 #define MX25_H1_PP_BIT (1 << 18)
33−#define MX25_H1_PM_BIT (1 << 8)
33+#define MX25_H1_PM_BIT (1 << 16)
3434 #define MX25_H1_IPPUE_UP_BIT (1 << 7)
3535 #define MX25_H1_IPPUE_DOWN_BIT (1 << 6)
3636 #define MX25_H1_TLL_BIT (1 << 5)
arch/arm/mach-imx/ehci-imx35.c+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 #define MX35_H1_SIC_SHIFT 21
3131 #define MX35_H1_SIC_MASK (0x3 << MX35_H1_SIC_SHIFT)
3232 #define MX35_H1_PP_BIT (1 << 18)
33−#define MX35_H1_PM_BIT (1 << 8)
33+#define MX35_H1_PM_BIT (1 << 16)
3434 #define MX35_H1_IPPUE_UP_BIT (1 << 7)
3535 #define MX35_H1_IPPUE_DOWN_BIT (1 << 6)
3636 #define MX35_H1_TLL_BIT (1 << 5)
arch/arm/mach-imx/mm-imx3.c+2−3
@@ -108,9 +108,8 @@ void __init imx3_init_l2x0(void) · 107 unmodified lines
108108 }
109109
110110 l2x0_base = ioremap(MX3x_L2CC_BASE_ADDR, 4096);
111− if (IS_ERR(l2x0_base)) {
112− printk(KERN_ERR "remapping L2 cache area failed with %ld\n",
113− PTR_ERR(l2x0_base));
111+ if (!l2x0_base) {
112+ printk(KERN_ERR "remapping L2 cache area failed\n");
114113 return;
115114 }
116115
arch/arm/mach-ixp4xx/common-pci.c+1−0
@@ -410,6 +410,7 @@ void __init ixp4xx_pci_preinit(void) · 409 unmodified lines
410410 * Enable the IO window to be way up high, at 0xfffffc00
411411 */
412412 local_write_config(PCI_BASE_ADDRESS_5, 4, 0xfffffc01);
413+ local_write_config(0x40, 4, 0x000080FF); /* No TRDY time limit */
413414 } else {
414415 printk("PCI: IXP4xx is target - No bus scan performed\n");
415416 }
arch/arm/mach-ixp4xx/common.c+5−8
@@ -67,15 +67,12 @@ static struct map_desc ixp4xx_io_desc[] __initdata = { · 66 unmodified lines
6767 .pfn = __phys_to_pfn(IXP4XX_PCI_CFG_BASE_PHYS),
6868 .length = IXP4XX_PCI_CFG_REGION_SIZE,
6969 .type = MT_DEVICE
70− },
71−#ifdef CONFIG_DEBUG_LL
72− { /* Debug UART mapping */
73− .virtual = (unsigned long)IXP4XX_DEBUG_UART_BASE_VIRT,
74− .pfn = __phys_to_pfn(IXP4XX_DEBUG_UART_BASE_PHYS),
75− .length = IXP4XX_DEBUG_UART_REGION_SIZE,
70+ }, { /* Queue Manager */
71+ .virtual = (unsigned long)IXP4XX_QMGR_BASE_VIRT,
72+ .pfn = __phys_to_pfn(IXP4XX_QMGR_BASE_PHYS),
73+ .length = IXP4XX_QMGR_REGION_SIZE,
7674 .type = MT_DEVICE
77− }
78−#endif
75+ },
7976 };
8077
8178 void __init ixp4xx_map_io(void)
arch/arm/mach-ixp4xx/goramo_mlr.c+2−1
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <asm/mach/arch.h>
1616 #include <asm/mach/flash.h>
1717 #include <asm/mach/pci.h>
18+#include <asm/system_info.h>
1819
1920 #define SLOT_ETHA 0x0B /* IDSEL = AD21 */
2021 #define SLOT_ETHB 0x0C /* IDSEL = AD20 */
@@ -329,7 +330,7 @@ static struct platform_device device_hss_tab[] = { · 308 unmodified lines
329330 };
330331
331332
332−static struct platform_device *device_tab[6] __initdata = {
333+static struct platform_device *device_tab[7] __initdata = {
333334 &device_flash, /* index 0 */
334335 };
335336
arch/arm/mach-ixp4xx/include/mach/debug-macro.S+2−2
@@ -17,8 +17,8 @@ · 16 unmodified lines
1717 #else
1818 mov \rp, #0
1919 #endif
20− orr \rv, \rp, #0xff000000 @ virtual
21− orr \rv, \rv, #0x00b00000
20+ orr \rv, \rp, #0xfe000000 @ virtual
21+ orr \rv, \rv, #0x00f00000
2222 orr \rp, \rp, #0xc8000000 @ physical
2323 .endm
2424
arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h+19−27
@@ -30,51 +30,43 @@ · 29 unmodified lines
3030 *
3131 * 0x50000000 0x10000000 ioremap'd EXP BUS
3232 *
33− * 0x6000000 0x00004000 ioremap'd QMgr
33+ * 0xC8000000 0x00013000 0xFEF00000 On-Chip Peripherals
3434 *
35− * 0xC0000000 0x00001000 0xffbff000 PCI CFG
35+ * 0xC0000000 0x00001000 0xFEF13000 PCI CFG
3636 *
37− * 0xC4000000 0x00001000 0xffbfe000 EXP CFG
37+ * 0xC4000000 0x00001000 0xFEF14000 EXP CFG
3838 *
39− * 0xC8000000 0x00013000 0xffbeb000 On-Chip Peripherals
39+ * 0x60000000 0x00004000 0xFEF15000 QMgr
4040 */
4141
4242 /*
4343 * Queue Manager
4444 */
45−#define IXP4XX_QMGR_BASE_PHYS (0x60000000)
46−#define IXP4XX_QMGR_REGION_SIZE (0x00004000)
45+#define IXP4XX_QMGR_BASE_PHYS 0x60000000
46+#define IXP4XX_QMGR_BASE_VIRT IOMEM(0xFEF15000)
47+#define IXP4XX_QMGR_REGION_SIZE 0x00004000
4748
4849 /*
49− * Expansion BUS Configuration registers
50+ * Peripheral space, including debug UART. Must be section-aligned so that
51+ * it can be used with the low-level debug code.
5052 */
51−#define IXP4XX_EXP_CFG_BASE_PHYS (0xC4000000)
52−#define IXP4XX_EXP_CFG_BASE_VIRT IOMEM(0xFFBFE000)
53−#define IXP4XX_EXP_CFG_REGION_SIZE (0x00001000)
53+#define IXP4XX_PERIPHERAL_BASE_PHYS 0xC8000000
54+#define IXP4XX_PERIPHERAL_BASE_VIRT IOMEM(0xFEF00000)
55+#define IXP4XX_PERIPHERAL_REGION_SIZE 0x00013000
5456
5557 /*
5658 * PCI Config registers
5759 */
58−#define IXP4XX_PCI_CFG_BASE_PHYS (0xC0000000)
59−#define IXP4XX_PCI_CFG_BASE_VIRT IOMEM(0xFFBFF000)
60−#define IXP4XX_PCI_CFG_REGION_SIZE (0x00001000)
61−
62−/*
63− * Peripheral space
64− */
65−#define IXP4XX_PERIPHERAL_BASE_PHYS (0xC8000000)
66−#define IXP4XX_PERIPHERAL_BASE_VIRT IOMEM(0xFFBEB000)
67−#define IXP4XX_PERIPHERAL_REGION_SIZE (0x00013000)
60+#define IXP4XX_PCI_CFG_BASE_PHYS 0xC0000000
61+#define IXP4XX_PCI_CFG_BASE_VIRT IOMEM(0xFEF13000)
62+#define IXP4XX_PCI_CFG_REGION_SIZE 0x00001000
6863
6964 /*
70− * Debug UART
71− *
72− * This is basically a remap of UART1 into a region that is section
73− * aligned so that it * can be used with the low-level debug code.
65+ * Expansion BUS Configuration registers
7466 */
75−#define IXP4XX_DEBUG_UART_BASE_PHYS (0xC8000000)
76−#define IXP4XX_DEBUG_UART_BASE_VIRT IOMEM(0xffb00000)
77−#define IXP4XX_DEBUG_UART_REGION_SIZE (0x00001000)
67+#define IXP4XX_EXP_CFG_BASE_PHYS 0xC4000000
68+#define IXP4XX_EXP_CFG_BASE_VIRT 0xFEF14000
69+#define IXP4XX_EXP_CFG_REGION_SIZE 0x00001000
7870
7971 #define IXP4XX_EXP_CS0_OFFSET 0x00
8072 #define IXP4XX_EXP_CS1_OFFSET 0x04
arch/arm/mach-ixp4xx/include/mach/qmgr.h+6−6
@@ -86,7 +86,7 @@ void qmgr_release_queue(unsigned int queue); · 85 unmodified lines
8686
8787 static inline void qmgr_put_entry(unsigned int queue, u32 val)
8888 {
89− extern struct qmgr_regs __iomem *qmgr_regs;
89+ struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
9090 #if DEBUG_QMGR
9191 BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */
9292
@@ -99,7 +99,7 @@ static inline void qmgr_put_entry(unsigned int queue, u32 val) · 6 unmodified lines
9999 static inline u32 qmgr_get_entry(unsigned int queue)
100100 {
101101 u32 val;
102− extern struct qmgr_regs __iomem *qmgr_regs;
102+ const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
103103 val = __raw_readl(&qmgr_regs->acc[queue][0]);
104104 #if DEBUG_QMGR
105105 BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */
@@ -112,14 +112,14 @@ static inline u32 qmgr_get_entry(unsigned int queue) · 6 unmodified lines
112112
113113 static inline int __qmgr_get_stat1(unsigned int queue)
114114 {
115− extern struct qmgr_regs __iomem *qmgr_regs;
115+ const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
116116 return (__raw_readl(&qmgr_regs->stat1[queue >> 3])
117117 >> ((queue & 7) << 2)) & 0xF;
118118 }
119119
120120 static inline int __qmgr_get_stat2(unsigned int queue)
121121 {
122− extern struct qmgr_regs __iomem *qmgr_regs;
122+ const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
123123 BUG_ON(queue >= HALF_QUEUES);
124124 return (__raw_readl(&qmgr_regs->stat2[queue >> 4])
125125 >> ((queue & 0xF) << 1)) & 0x3;
@@ -145,7 +145,7 @@ static inline int qmgr_stat_empty(unsigned int queue) · 19 unmodified lines
145145 */
146146 static inline int qmgr_stat_below_low_watermark(unsigned int queue)
147147 {
148− extern struct qmgr_regs __iomem *qmgr_regs;
148+ const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
149149 if (queue >= HALF_QUEUES)
150150 return (__raw_readl(&qmgr_regs->statne_h) >>
151151 (queue - HALF_QUEUES)) & 0x01;
@@ -172,7 +172,7 @@ static inline int qmgr_stat_above_high_watermark(unsigned int queue) · 20 unmodified lines
172172 */
173173 static inline int qmgr_stat_full(unsigned int queue)
174174 {
175− extern struct qmgr_regs __iomem *qmgr_regs;
175+ const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
176176 if (queue >= HALF_QUEUES)
177177 return (__raw_readl(&qmgr_regs->statf_h) >>
178178 (queue - HALF_QUEUES)) & 0x01;
arch/arm/mach-ixp4xx/ixp4xx_npe.c+8−1
@@ -116,7 +116,11 @@ · 115 unmodified lines
116116 /* NPE mailbox_status value for reset */
117117 #define RESET_MBOX_STAT 0x0000F0F0
118118
119−const char *npe_names[] = { "NPE-A", "NPE-B", "NPE-C" };
119+#define NPE_A_FIRMWARE "NPE-A"
120+#define NPE_B_FIRMWARE "NPE-B"
121+#define NPE_C_FIRMWARE "NPE-C"
122+
123+const char *npe_names[] = { NPE_A_FIRMWARE, NPE_B_FIRMWARE, NPE_C_FIRMWARE };
120124
121125 #define print_npe(pri, npe, fmt, ...) \
122126 printk(pri "%s: " fmt, npe_name(npe), ## __VA_ARGS__)
@@ -724,6 +728,9 @@ module_exit(npe_cleanup_module); · 601 unmodified lines
724728
725729 MODULE_AUTHOR("Krzysztof Halasa");
726730 MODULE_LICENSE("GPL v2");
731+MODULE_FIRMWARE(NPE_A_FIRMWARE);
732+MODULE_FIRMWARE(NPE_B_FIRMWARE);
733+MODULE_FIRMWARE(NPE_C_FIRMWARE);
727734
728735 EXPORT_SYMBOL(npe_names);
729736 EXPORT_SYMBOL(npe_running);
arch/arm/mach-ixp4xx/ixp4xx_qmgr.c+1−11
@@ -14,7 +14,7 @@ · 13 unmodified lines
1414 #include <linux/module.h>
1515 #include <mach/qmgr.h>
1616
17−struct qmgr_regs __iomem *qmgr_regs;
17+static struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
1818 static struct resource *mem_res;
1919 static spinlock_t qmgr_lock;
2020 static u32 used_sram_bitmap[4]; /* 128 16-dword pages */
@@ -293,12 +293,6 @@ static int qmgr_init(void) · 272 unmodified lines
293293 if (mem_res == NULL)
294294 return -EBUSY;
295295
296− qmgr_regs = ioremap(IXP4XX_QMGR_BASE_PHYS, IXP4XX_QMGR_REGION_SIZE);
297− if (qmgr_regs == NULL) {
298− err = -ENOMEM;
299− goto error_map;
300− }
301−
302296 /* reset qmgr registers */
303297 for (i = 0; i < 4; i++) {
304298 __raw_writel(0x33333333, &qmgr_regs->stat1[i]);
@@ -347,8 +341,6 @@ static int qmgr_init(void) · 42 unmodified lines
347341 error_irq2:
348342 free_irq(IRQ_IXP4XX_QM1, NULL);
349343 error_irq:
350− iounmap(qmgr_regs);
351−error_map:
352344 release_mem_region(IXP4XX_QMGR_BASE_PHYS, IXP4XX_QMGR_REGION_SIZE);
353345 return err;
354346 }
@@ -359,7 +351,6 @@ static void qmgr_remove(void) · 4 unmodified lines
359351 free_irq(IRQ_IXP4XX_QM2, NULL);
360352 synchronize_irq(IRQ_IXP4XX_QM1);
361353 synchronize_irq(IRQ_IXP4XX_QM2);
362− iounmap(qmgr_regs);
363354 release_mem_region(IXP4XX_QMGR_BASE_PHYS, IXP4XX_QMGR_REGION_SIZE);
364355 }
365356
@@ -369,7 +360,6 @@ module_exit(qmgr_remove); · 3 unmodified lines
369360 MODULE_LICENSE("GPL v2");
370361 MODULE_AUTHOR("Krzysztof Halasa");
371362
372−EXPORT_SYMBOL(qmgr_regs);
373363 EXPORT_SYMBOL(qmgr_set_irq);
374364 EXPORT_SYMBOL(qmgr_enable_irq);
375365 EXPORT_SYMBOL(qmgr_disable_irq);
arch/arm/mach-kirkwood/pcie.c+8−3
@@ -207,14 +207,19 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys) · 206 unmodified lines
207207 return 1;
208208 }
209209
210+/*
211+ * The root complex has a hardwired class of PCI_CLASS_MEMORY_OTHER, when it
212+ * is operating as a root complex this needs to be switched to
213+ * PCI_CLASS_BRIDGE_HOST or Linux will errantly try to process the BAR's on
214+ * the device. Decoding setup is handled by the orion code.
215+ */
210216 static void __devinit rc_pci_fixup(struct pci_dev *dev)
211217 {
212− /*
213− * Prevent enumeration of root complex.
214− */
215218 if (dev->bus->parent == NULL && dev->devfn == 0) {
216219 int i;
217220
221+ dev->class &= 0xff;
222+ dev->class |= PCI_CLASS_BRIDGE_HOST << 8;
218223 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
219224 dev->resource[i].start = 0;
220225 dev->resource[i].end = 0;
arch/arm/mach-omap2/Kconfig+0−1
@@ -11,7 +11,6 @@ config ARCH_OMAP2PLUS_TYPICAL · 10 unmodified lines
1111 select I2C_OMAP
1212 select MENELAUS if ARCH_OMAP2
1313 select NEON if ARCH_OMAP3 || ARCH_OMAP4 || SOC_OMAP5
14− select PINCTRL
1514 select PM_RUNTIME
1615 select REGULATOR
1716 select SERIAL_OMAP
arch/arm/mach-omap2/board-igep0020.c+5−0
@@ -580,6 +580,11 @@ static void __init igep_wlan_bt_init(void) · 579 unmodified lines
580580 } else
581581 return;
582582
583+ /* Make sure that the GPIO pins are muxed correctly */
584+ omap_mux_init_gpio(igep_wlan_bt_gpios[0].gpio, OMAP_PIN_OUTPUT);
585+ omap_mux_init_gpio(igep_wlan_bt_gpios[1].gpio, OMAP_PIN_OUTPUT);
586+ omap_mux_init_gpio(igep_wlan_bt_gpios[2].gpio, OMAP_PIN_OUTPUT);
587+
583588 err = gpio_request_array(igep_wlan_bt_gpios,
584589 ARRAY_SIZE(igep_wlan_bt_gpios));
585590 if (err) {
arch/arm/mach-omap2/board-omap3beagle.c+13−9
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 #include <linux/input.h>
2525 #include <linux/gpio_keys.h>
2626 #include <linux/opp.h>
27+#include <linux/cpu.h>
2728
2829 #include <linux/mtd/mtd.h>
2930 #include <linux/mtd/partitions.h>
@@ -444,27 +445,31 @@ static struct omap_board_mux board_mux[] __initdata = { · 414 unmodified lines
444445 };
445446 #endif
446447
447−static void __init beagle_opp_init(void)
448+static int __init beagle_opp_init(void)
448449 {
449450 int r = 0;
450451
451− /* Initialize the omap3 opp table */
452− if (omap3_opp_init()) {
452+ if (!machine_is_omap3_beagle())
453+ return 0;
454+
455+ /* Initialize the omap3 opp table if not already created. */
456+ r = omap3_opp_init();
457+ if (IS_ERR_VALUE(r) && (r != -EEXIST)) {
453458 pr_err("%s: opp default init failed\n", __func__);
454− return;
459+ return r;
455460 }
456461
457462 /* Custom OPP enabled for all xM versions */
458463 if (cpu_is_omap3630()) {
459464 struct device *mpu_dev, *iva_dev;
460465
461− mpu_dev = omap_device_get_by_hwmod_name("mpu");
466+ mpu_dev = get_cpu_device(0);
462467 iva_dev = omap_device_get_by_hwmod_name("iva");
463468
464469 if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) {
465470 pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
466471 __func__, mpu_dev, iva_dev);
467− return;
472+ return -ENODEV;
468473 }
469474 /* Enable MPU 1GHz and lower opps */
470475 r = opp_enable(mpu_dev, 800000000);
@@ -484,8 +489,9 @@ static void __init beagle_opp_init(void) · 13 unmodified lines
484489 opp_disable(iva_dev, 660000000);
485490 }
486491 }
487− return;
492+ return 0;
488493 }
494+device_initcall(beagle_opp_init);
489495
490496 static void __init omap3_beagle_init(void)
491497 {
@@ -522,8 +528,6 @@ static void __init omap3_beagle_init(void) · 30 unmodified lines
522528 /* Ensure SDRC pins are mux'd for self-refresh */
523529 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
524530 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
525−
526− beagle_opp_init();
527531 }
528532
529533 MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
arch/arm/mach-omap2/clock33xx_data.c+2−0
@@ -1073,6 +1073,8 @@ static struct omap_clk am33xx_clks[] = { · 1072 unmodified lines
10731073 CLK(NULL, "gfx_fck_div_ck", &gfx_fck_div_ck, CK_AM33XX),
10741074 CLK(NULL, "sysclkout_pre_ck", &sysclkout_pre_ck, CK_AM33XX),
10751075 CLK(NULL, "clkout2_ck", &clkout2_ck, CK_AM33XX),
1076+ CLK(NULL, "timer_32k_ck", &clkdiv32k_ick, CK_AM33XX),
1077+ CLK(NULL, "timer_sys_ck", &sys_clkin_ck, CK_AM33XX),
10761078 };
10771079
10781080 int __init am33xx_clk_init(void)
arch/arm/mach-omap2/clockdomains44xx_data.c+1−1
@@ -359,7 +359,7 @@ static struct clockdomain iss_44xx_clkdm = { · 358 unmodified lines
359359 .clkdm_offs = OMAP4430_CM2_CAM_CAM_CDOFFS,
360360 .wkdep_srcs = iss_wkup_sleep_deps,
361361 .sleepdep_srcs = iss_wkup_sleep_deps,
362− .flags = CLKDM_CAN_HWSUP_SWSUP,
362+ .flags = CLKDM_CAN_SWSUP,
363363 };
364364
365365 static struct clockdomain l3_dss_44xx_clkdm = {
arch/arm/mach-omap2/common-board-devices.c+20−14
@@ -64,30 +64,36 @@ void __init omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce, · 63 unmodified lines
6464 struct spi_board_info *spi_bi = &ads7846_spi_board_info;
6565 int err;
6666
67− err = gpio_request_one(gpio_pendown, GPIOF_IN, "TSPenDown");
68− if (err) {
69− pr_err("Couldn't obtain gpio for TSPenDown: %d\n", err);
70− return;
71− }
67+ /*
68+ * If a board defines get_pendown_state() function, request the pendown
69+ * GPIO and set the GPIO debounce time.
70+ * If a board does not define the get_pendown_state() function, then
71+ * the ads7846 driver will setup the pendown GPIO itself.
72+ */
73+ if (board_pdata && board_pdata->get_pendown_state) {
74+ err = gpio_request_one(gpio_pendown, GPIOF_IN, "TSPenDown");
75+ if (err) {
76+ pr_err("Couldn't obtain gpio for TSPenDown: %d\n", err);
77+ return;
78+ }
7279
73− if (gpio_debounce)
74− gpio_set_debounce(gpio_pendown, gpio_debounce);
80+ if (gpio_debounce)
81+ gpio_set_debounce(gpio_pendown, gpio_debounce);
82+
83+ gpio_export(gpio_pendown, 0);
84+ }
7585
7686 spi_bi->bus_num = bus_num;
7787 spi_bi->irq = gpio_to_irq(gpio_pendown);
7888
89+ ads7846_config.gpio_pendown = gpio_pendown;
90+
7991 if (board_pdata) {
8092 board_pdata->gpio_pendown = gpio_pendown;
93+ board_pdata->gpio_pendown_debounce = gpio_debounce;
8194 spi_bi->platform_data = board_pdata;
82− if (board_pdata->get_pendown_state)
83− gpio_export(gpio_pendown, 0);
84− } else {
85− ads7846_config.gpio_pendown = gpio_pendown;
8695 }
8796
88− if (!board_pdata || (board_pdata && !board_pdata->get_pendown_state))
89− gpio_free(gpio_pendown);
90−
9197 spi_register_board_info(&ads7846_spi_board_info, 1);
9298 }
9399 #else
arch/arm/mach-omap2/devices.c+79−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/of.h>
2020 #include <linux/pinctrl/machine.h>
2121 #include <linux/platform_data/omap4-keypad.h>
22+#include <linux/platform_data/omap_ocp2scp.h>
2223
2324 #include <asm/mach-types.h>
2425 #include <asm/mach/map.h>
@@ -613,6 +614,83 @@ static void omap_init_vout(void) · 588 unmodified lines
613614 static inline void omap_init_vout(void) {}
614615 #endif
615616
617+#if defined(CONFIG_OMAP_OCP2SCP) || defined(CONFIG_OMAP_OCP2SCP_MODULE)
618+static int count_ocp2scp_devices(struct omap_ocp2scp_dev *ocp2scp_dev)
619+{
620+ int cnt = 0;
621+
622+ while (ocp2scp_dev->drv_name != NULL) {
623+ cnt++;
624+ ocp2scp_dev++;
625+ }
626+
627+ return cnt;
628+}
629+
630+static void omap_init_ocp2scp(void)
631+{
632+ struct omap_hwmod *oh;
633+ struct platform_device *pdev;
634+ int bus_id = -1, dev_cnt = 0, i;
635+ struct omap_ocp2scp_dev *ocp2scp_dev;
636+ const char *oh_name, *name;
637+ struct omap_ocp2scp_platform_data *pdata;
638+
639+ if (!cpu_is_omap44xx())
640+ return;
641+
642+ oh_name = "ocp2scp_usb_phy";
643+ name = "omap-ocp2scp";
644+
645+ oh = omap_hwmod_lookup(oh_name);
646+ if (!oh) {
647+ pr_err("%s: could not find omap_hwmod for %s\n", __func__,
648+ oh_name);
649+ return;
650+ }
651+
652+ pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
653+ if (!pdata) {
654+ pr_err("%s: No memory for ocp2scp pdata\n", __func__);
655+ return;
656+ }
657+
658+ ocp2scp_dev = oh->dev_attr;
659+ dev_cnt = count_ocp2scp_devices(ocp2scp_dev);
660+
661+ if (!dev_cnt) {
662+ pr_err("%s: No devices connected to ocp2scp\n", __func__);
663+ kfree(pdata);
664+ return;
665+ }
666+
667+ pdata->devices = kzalloc(sizeof(struct omap_ocp2scp_dev *)
668+ * dev_cnt, GFP_KERNEL);
669+ if (!pdata->devices) {
670+ pr_err("%s: No memory for ocp2scp pdata devices\n", __func__);
671+ kfree(pdata);
672+ return;
673+ }
674+
675+ for (i = 0; i < dev_cnt; i++, ocp2scp_dev++)
676+ pdata->devices[i] = ocp2scp_dev;
677+
678+ pdata->dev_cnt = dev_cnt;
679+
680+ pdev = omap_device_build(name, bus_id, oh, pdata, sizeof(*pdata), NULL,
681+ 0, false);
682+ if (IS_ERR(pdev)) {
683+ pr_err("Could not build omap_device for %s %s\n",
684+ name, oh_name);
685+ kfree(pdata->devices);
686+ kfree(pdata);
687+ return;
688+ }
689+}
690+#else
691+static inline void omap_init_ocp2scp(void) { }
692+#endif
693+
616694 /*-------------------------------------------------------------------------*/
617695
618696 static int __init omap2_init_devices(void)
@@ -640,6 +718,7 @@ static int __init omap2_init_devices(void) · 21 unmodified lines
640718 omap_init_sham();
641719 omap_init_aes();
642720 omap_init_vout();
721+ omap_init_ocp2scp();
643722
644723 return 0;
645724 }
arch/arm/mach-omap2/mux34xx.c+4−4
@@ -614,16 +614,16 @@ static struct omap_mux __initdata omap3_muxmodes[] = { · 613 unmodified lines
614614 "sys_off_mode", NULL, NULL, NULL,
615615 "gpio_9", NULL, NULL, "safe_mode"),
616616 _OMAP3_MUXENTRY(UART1_CTS, 150,
617− "uart1_cts", NULL, NULL, NULL,
617+ "uart1_cts", "ssi1_rdy_tx", NULL, NULL,
618618 "gpio_150", "hsusb3_tll_clk", NULL, "safe_mode"),
619619 _OMAP3_MUXENTRY(UART1_RTS, 149,
620− "uart1_rts", NULL, NULL, NULL,
620+ "uart1_rts", "ssi1_flag_tx", NULL, NULL,
621621 "gpio_149", NULL, NULL, "safe_mode"),
622622 _OMAP3_MUXENTRY(UART1_RX, 151,
623− "uart1_rx", NULL, "mcbsp1_clkr", "mcspi4_clk",
623+ "uart1_rx", "ss1_wake_tx", "mcbsp1_clkr", "mcspi4_clk",
624624 "gpio_151", NULL, NULL, "safe_mode"),
625625 _OMAP3_MUXENTRY(UART1_TX, 148,
626− "uart1_tx", NULL, NULL, NULL,
626+ "uart1_tx", "ssi1_dat_tx", NULL, NULL,
627627 "gpio_148", NULL, NULL, "safe_mode"),
628628 _OMAP3_MUXENTRY(UART2_CTS, 144,
629629 "uart2_cts", "mcbsp3_dx", "gpt9_pwm_evt", NULL,
arch/arm/mach-omap2/omap_hwmod.c+49−14
@@ -421,6 +421,38 @@ static int _set_softreset(struct omap_hwmod *oh, u32 *v) · 420 unmodified lines
421421 return 0;
422422 }
423423
424+/**
425+ * _wait_softreset_complete - wait for an OCP softreset to complete
426+ * @oh: struct omap_hwmod * to wait on
427+ *
428+ * Wait until the IP block represented by @oh reports that its OCP
429+ * softreset is complete. This can be triggered by software (see
430+ * _ocp_softreset()) or by hardware upon returning from off-mode (one
431+ * example is HSMMC). Waits for up to MAX_MODULE_SOFTRESET_WAIT
432+ * microseconds. Returns the number of microseconds waited.
433+ */
434+static int _wait_softreset_complete(struct omap_hwmod *oh)
435+{
436+ struct omap_hwmod_class_sysconfig *sysc;
437+ u32 softrst_mask;
438+ int c = 0;
439+
440+ sysc = oh->class->sysc;
441+
442+ if (sysc->sysc_flags & SYSS_HAS_RESET_STATUS)
443+ omap_test_timeout((omap_hwmod_read(oh, sysc->syss_offs)
444+ & SYSS_RESETDONE_MASK),
445+ MAX_MODULE_SOFTRESET_WAIT, c);
446+ else if (sysc->sysc_flags & SYSC_HAS_RESET_STATUS) {
447+ softrst_mask = (0x1 << sysc->sysc_fields->srst_shift);
448+ omap_test_timeout(!(omap_hwmod_read(oh, sysc->sysc_offs)
449+ & softrst_mask),
450+ MAX_MODULE_SOFTRESET_WAIT, c);
451+ }
452+
453+ return c;
454+}
455+
424456 /**
425457 * _set_dmadisable: set OCP_SYSCONFIG.DMADISABLE bit in @v
426458 * @oh: struct omap_hwmod *
@@ -1282,6 +1314,18 @@ static void _enable_sysc(struct omap_hwmod *oh) · 855 unmodified lines
12821314 if (!oh->class->sysc)
12831315 return;
12841316
1317+ /*
1318+ * Wait until reset has completed, this is needed as the IP
1319+ * block is reset automatically by hardware in some cases
1320+ * (off-mode for example), and the drivers require the
1321+ * IP to be ready when they access it
1322+ */
1323+ if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET)
1324+ _enable_optional_clocks(oh);
1325+ _wait_softreset_complete(oh);
1326+ if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET)
1327+ _disable_optional_clocks(oh);
1328+
12851329 v = oh->_sysc_cache;
12861330 sf = oh->class->sysc->sysc_flags;
12871331
@@ -1804,7 +1848,7 @@ static int _am33xx_disable_module(struct omap_hwmod *oh) · 516 unmodified lines
18041848 */
18051849 static int _ocp_softreset(struct omap_hwmod *oh)
18061850 {
1807− u32 v, softrst_mask;
1851+ u32 v;
18081852 int c = 0;
18091853 int ret = 0;
18101854
@@ -1834,19 +1878,7 @@ static int _ocp_softreset(struct omap_hwmod *oh) · 23 unmodified lines
18341878 if (oh->class->sysc->srst_udelay)
18351879 udelay(oh->class->sysc->srst_udelay);
18361880
1837− if (oh->class->sysc->sysc_flags & SYSS_HAS_RESET_STATUS)
1838− omap_test_timeout((omap_hwmod_read(oh,
1839− oh->class->sysc->syss_offs)
1840− & SYSS_RESETDONE_MASK),
1841− MAX_MODULE_SOFTRESET_WAIT, c);
1842− else if (oh->class->sysc->sysc_flags & SYSC_HAS_RESET_STATUS) {
1843− softrst_mask = (0x1 << oh->class->sysc->sysc_fields->srst_shift);
1844− omap_test_timeout(!(omap_hwmod_read(oh,
1845− oh->class->sysc->sysc_offs)
1846− & softrst_mask),
1847− MAX_MODULE_SOFTRESET_WAIT, c);
1848− }
1849−
1881+ c = _wait_softreset_complete(oh);
18501882 if (c == MAX_MODULE_SOFTRESET_WAIT)
18511883 pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n",
18521884 oh->name, MAX_MODULE_SOFTRESET_WAIT);
@@ -2352,6 +2384,9 @@ static int __init _setup_reset(struct omap_hwmod *oh) · 499 unmodified lines
23522384 if (oh->_state != _HWMOD_STATE_INITIALIZED)
23532385 return -EINVAL;
23542386
2387+ if (oh->flags & HWMOD_EXT_OPT_MAIN_CLK)
2388+ return -EPERM;
2389+
23552390 if (oh->rst_lines_cnt == 0) {
23562391 r = _enable(oh);
23572392 if (r) {
arch/arm/mach-omap2/omap_hwmod_44xx_data.c+36−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <linux/io.h>
2222 #include <linux/platform_data/gpio-omap.h>
2323 #include <linux/power/smartreflex.h>
24+#include <linux/platform_data/omap_ocp2scp.h>
2425
2526 #include <plat/omap_hwmod.h>
2627 #include <plat/i2c.h>
@@ -2125,6 +2126,14 @@ static struct omap_hwmod omap44xx_mcpdm_hwmod = { · 2098 unmodified lines
21252126 .name = "mcpdm",
21262127 .class = &omap44xx_mcpdm_hwmod_class,
21272128 .clkdm_name = "abe_clkdm",
2129+ /*
2130+ * It's suspected that the McPDM requires an off-chip main
2131+ * functional clock, controlled via I2C. This IP block is
2132+ * currently reset very early during boot, before I2C is
2133+ * available, so it doesn't seem that we have any choice in
2134+ * the kernel other than to avoid resetting it.
2135+ */
2136+ .flags = HWMOD_EXT_OPT_MAIN_CLK,
21282137 .mpu_irqs = omap44xx_mcpdm_irqs,
21292138 .sdma_reqs = omap44xx_mcpdm_sdma_reqs,
21302139 .main_clk = "mcpdm_fck",
@@ -2681,6 +2690,32 @@ static struct omap_hwmod_class omap44xx_ocp2scp_hwmod_class = { · 550 unmodified lines
26812690 .sysc = &omap44xx_ocp2scp_sysc,
26822691 };
26832692
2693+/* ocp2scp dev_attr */
2694+static struct resource omap44xx_usb_phy_and_pll_addrs[] = {
2695+ {
2696+ .name = "usb_phy",
2697+ .start = 0x4a0ad080,
2698+ .end = 0x4a0ae000,
2699+ .flags = IORESOURCE_MEM,
2700+ },
2701+ {
2702+ /* XXX: Remove this once control module driver is in place */
2703+ .name = "ctrl_dev",
2704+ .start = 0x4a002300,
2705+ .end = 0x4a002303,
2706+ .flags = IORESOURCE_MEM,
2707+ },
2708+ { }
2709+};
2710+
2711+static struct omap_ocp2scp_dev ocp2scp_dev_attr[] = {
2712+ {
2713+ .drv_name = "omap-usb2",
2714+ .res = omap44xx_usb_phy_and_pll_addrs,
2715+ },
2716+ { }
2717+};
2718+
26842719 /* ocp2scp_usb_phy */
26852720 static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = {
26862721 .name = "ocp2scp_usb_phy",
@@ -2694,6 +2729,7 @@ static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = { · 7 unmodified lines
26942729 .modulemode = MODULEMODE_HWCTRL,
26952730 },
26962731 },
2732+ .dev_attr = ocp2scp_dev_attr,
26972733 };
26982734
26992735 /*
arch/arm/mach-omap2/pm.h+1−0
@@ -91,6 +91,7 @@ extern void omap3_save_scratchpad_contents(void); · 90 unmodified lines
9191
9292 #define PM_RTA_ERRATUM_i608 (1 << 0)
9393 #define PM_SDRC_WAKEUP_ERRATUM_i583 (1 << 1)
94+#define PM_PER_MEMORIES_ERRATUM_i582 (1 << 2)
9495
9596 #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3)
9697 extern u16 pm34xx_errata;
arch/arm/mach-omap2/pm34xx.c+28−2
@@ -652,14 +652,17 @@ static void __init pm_errata_configure(void) · 651 unmodified lines
652652 /* Enable the l2 cache toggling in sleep logic */
653653 enable_omap3630_toggle_l2_on_restore();
654654 if (omap_rev() < OMAP3630_REV_ES1_2)
655− pm34xx_errata |= PM_SDRC_WAKEUP_ERRATUM_i583;
655+ pm34xx_errata |= (PM_SDRC_WAKEUP_ERRATUM_i583 |
656+ PM_PER_MEMORIES_ERRATUM_i582);
657+ } else if (cpu_is_omap34xx()) {
658+ pm34xx_errata |= PM_PER_MEMORIES_ERRATUM_i582;
656659 }
657660 }
658661
659662 int __init omap3_pm_init(void)
660663 {
661664 struct power_state *pwrst, *tmp;
662− struct clockdomain *neon_clkdm, *mpu_clkdm;
665+ struct clockdomain *neon_clkdm, *mpu_clkdm, *per_clkdm, *wkup_clkdm;
663666 int ret;
664667
665668 if (!omap3_has_io_chain_ctrl())
@@ -711,6 +714,8 @@ int __init omap3_pm_init(void) · 45 unmodified lines
711714
712715 neon_clkdm = clkdm_lookup("neon_clkdm");
713716 mpu_clkdm = clkdm_lookup("mpu_clkdm");
717+ per_clkdm = clkdm_lookup("per_clkdm");
718+ wkup_clkdm = clkdm_lookup("wkup_clkdm");
714719
715720 #ifdef CONFIG_SUSPEND
716721 omap_pm_suspend = omap3_pm_suspend;
@@ -727,6 +732,27 @@ int __init omap3_pm_init(void) · 10 unmodified lines
727732 if (IS_PM34XX_ERRATUM(PM_RTA_ERRATUM_i608))
728733 omap3630_ctrl_disable_rta();
729734
735+ /*
736+ * The UART3/4 FIFO and the sidetone memory in McBSP2/3 are
737+ * not correctly reset when the PER powerdomain comes back
738+ * from OFF or OSWR when the CORE powerdomain is kept active.
739+ * See OMAP36xx Erratum i582 "PER Domain reset issue after
740+ * Domain-OFF/OSWR Wakeup". This wakeup dependency is not a
741+ * complete workaround. The kernel must also prevent the PER
742+ * powerdomain from going to OSWR/OFF while the CORE
743+ * powerdomain is not going to OSWR/OFF. And if PER last
744+ * power state was off while CORE last power state was ON, the
745+ * UART3/4 and McBSP2/3 SIDETONE devices need to run a
746+ * self-test using their loopback tests; if that fails, those
747+ * devices are unusable until the PER/CORE can complete a transition
748+ * from ON to OSWR/OFF and then back to ON.
749+ *
750+ * XXX Technically this workaround is only needed if off-mode
751+ * or OSWR is enabled.
752+ */
753+ if (IS_PM34XX_ERRATUM(PM_PER_MEMORIES_ERRATUM_i582))
754+ clkdm_add_wkdep(per_clkdm, wkup_clkdm);
755+
730756 clkdm_add_wkdep(neon_clkdm, mpu_clkdm);
731757 if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
732758 omap3_secure_ram_storage =
arch/arm/mach-omap2/serial.c+5−0
@@ -329,6 +329,11 @@ void __init omap_serial_init_port(struct omap_board_data *bdata, · 328 unmodified lines
329329
330330 oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
331331
332+ if (console_uart_id == bdata->id) {
333+ omap_device_enable(pdev);
334+ pm_runtime_set_active(&pdev->dev);
335+ }
336+
332337 oh->dev_attr = uart;
333338
334339 if (((cpu_is_omap34xx() || cpu_is_omap44xx()) && bdata->pads)
arch/arm/mach-omap2/twl-common.c+2−1
@@ -73,6 +73,7 @@ void __init omap4_pmic_init(const char *pmic_type, · 72 unmodified lines
7373 {
7474 /* PMIC part*/
7575 omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
76+ omap_mux_init_signal("fref_clk0_out.sys_drm_msecure", OMAP_PIN_OUTPUT);
7677 omap_pmic_init(1, 400, pmic_type, 7 + OMAP44XX_IRQ_GIC_START, pmic_data);
7778
7879 /* Register additional devices on i2c1 bus if needed */
@@ -366,7 +367,7 @@ static struct regulator_init_data omap4_clk32kg_idata = { · 287 unmodified lines
366367 };
367368
368369 static struct regulator_consumer_supply omap4_vdd1_supply[] = {
369− REGULATOR_SUPPLY("vcc", "mpu.0"),
370+ REGULATOR_SUPPLY("vcc", "cpu0"),
370371 };
371372
372373 static struct regulator_consumer_supply omap4_vdd2_supply[] = {
arch/arm/mach-omap2/vc.c+1−1
@@ -264,7 +264,7 @@ static void __init omap_vc_i2c_init(struct voltagedomain *voltdm) · 263 unmodified lines
264264
265265 if (initialized) {
266266 if (voltdm->pmic->i2c_high_speed != i2c_high_speed)
267− pr_warn("%s: I2C config for vdd_%s does not match other channels (%u).",
267+ pr_warn("%s: I2C config for vdd_%s does not match other channels (%u).\n",
268268 __func__, voltdm->name, i2c_high_speed);
269269 return;
270270 }
arch/arm/mach-pxa/hx4700.c+7−1
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <linux/mfd/asic3.h>
2929 #include <linux/mtd/physmap.h>
3030 #include <linux/pda_power.h>
31+#include <linux/pwm.h>
3132 #include <linux/pwm_backlight.h>
3233 #include <linux/regulator/driver.h>
3334 #include <linux/regulator/gpio-regulator.h>
@@ -556,7 +557,7 @@ static struct platform_device hx4700_lcd = { · 522 unmodified lines
556557 */
557558
558559 static struct platform_pwm_backlight_data backlight_data = {
559− .pwm_id = 1,
560+ .pwm_id = -1, /* Superseded by pwm_lookup */
560561 .max_brightness = 200,
561562 .dft_brightness = 100,
562563 .pwm_period_ns = 30923,
@@ -571,6 +572,10 @@ static struct platform_device backlight = { · 8 unmodified lines
571572 },
572573 };
573574
575+static struct pwm_lookup hx4700_pwm_lookup[] = {
576+ PWM_LOOKUP("pxa27x-pwm.1", 0, "pwm-backlight", NULL),
577+};
578+
574579 /*
575580 * USB "Transceiver"
576581 */
@@ -872,6 +877,7 @@ static void __init hx4700_init(void) · 295 unmodified lines
872877 pxa_set_stuart_info(NULL);
873878
874879 platform_add_devices(devices, ARRAY_SIZE(devices));
880+ pwm_add_table(hx4700_pwm_lookup, ARRAY_SIZE(hx4700_pwm_lookup));
875881
876882 pxa_set_ficp_info(&ficp_info);
877883 pxa27x_set_i2c_power_info(NULL);
arch/arm/mach-pxa/spitz_pm.c+2−6
@@ -86,10 +86,7 @@ static void spitz_discharge1(int on) · 85 unmodified lines
8686 gpio_set_value(SPITZ_GPIO_LED_GREEN, on);
8787 }
8888
89−static unsigned long gpio18_config[] = {
90− GPIO18_RDY,
91− GPIO18_GPIO,
92−};
89+static unsigned long gpio18_config = GPIO18_GPIO;
9390
9491 static void spitz_presuspend(void)
9592 {
@@ -112,7 +109,7 @@ static void spitz_presuspend(void) · 16 unmodified lines
112109 PGSR3 &= ~SPITZ_GPIO_G3_STROBE_BIT;
113110 PGSR2 |= GPIO_bit(SPITZ_GPIO_KEY_STROBE0);
114111
115− pxa2xx_mfp_config(&gpio18_config[0], 1);
112+ pxa2xx_mfp_config(&gpio18_config, 1);
116113 gpio_request_one(18, GPIOF_OUT_INIT_HIGH, "Unknown");
117114 gpio_free(18);
118115
@@ -131,7 +128,6 @@ static void spitz_presuspend(void) · 12 unmodified lines
131128
132129 static void spitz_postsuspend(void)
133130 {
134− pxa2xx_mfp_config(&gpio18_config[1], 1);
135131 }
136132
137133 static int spitz_should_wakeup(unsigned int resume_on_alarm)
arch/arm/mach-s3c24xx/s3c2416.c+2−0
@@ -61,6 +61,7 @@ · 60 unmodified lines
6161 #include <plat/nand-core.h>
6262 #include <plat/adc-core.h>
6363 #include <plat/rtc-core.h>
64+#include <plat/spi-core.h>
6465
6566 static struct map_desc s3c2416_iodesc[] __initdata = {
6667 IODESC_ENT(WATCHDOG),
@@ -132,6 +133,7 @@ void __init s3c2416_map_io(void) · 65 unmodified lines
132133 /* initialize device information early */
133134 s3c2416_default_sdhci0();
134135 s3c2416_default_sdhci1();
136+ s3c64xx_spi_setname("s3c2443-spi");
135137
136138 iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc));
137139 }
arch/arm/mach-s3c24xx/s3c2443.c+4−0
@@ -43,6 +43,7 @@ · 42 unmodified lines
4343 #include <plat/nand-core.h>
4444 #include <plat/adc-core.h>
4545 #include <plat/rtc-core.h>
46+#include <plat/spi-core.h>
4647
4748 static struct map_desc s3c2443_iodesc[] __initdata = {
4849 IODESC_ENT(WATCHDOG),
@@ -100,6 +101,9 @@ void __init s3c2443_map_io(void) · 51 unmodified lines
100101 s3c24xx_gpiocfg_default.set_pull = s3c2443_gpio_setpull;
101102 s3c24xx_gpiocfg_default.get_pull = s3c2443_gpio_getpull;
102103
104+ /* initialize device information early */
105+ s3c64xx_spi_setname("s3c2443-spi");
106+
103107 iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc));
104108 }
105109
arch/arm/mach-s5p64x0/common.c+3−0
@@ -44,6 +44,7 @@ · 43 unmodified lines
4444 #include <plat/sdhci.h>
4545 #include <plat/adc-core.h>
4646 #include <plat/fb-core.h>
47+#include <plat/spi-core.h>
4748 #include <plat/gpio-cfg.h>
4849 #include <plat/regs-irqtype.h>
4950 #include <plat/regs-serial.h>
@@ -179,6 +180,7 @@ void __init s5p6440_map_io(void) · 129 unmodified lines
179180 /* initialize any device information early */
180181 s3c_adc_setname("s3c64xx-adc");
181182 s3c_fb_setname("s5p64x0-fb");
183+ s3c64xx_spi_setname("s5p64x0-spi");
182184
183185 s5p64x0_default_sdhci0();
184186 s5p64x0_default_sdhci1();
@@ -193,6 +195,7 @@ void __init s5p6450_map_io(void) · 8 unmodified lines
193195 /* initialize any device information early */
194196 s3c_adc_setname("s3c64xx-adc");
195197 s3c_fb_setname("s5p64x0-fb");
198+ s3c64xx_spi_setname("s5p64x0-spi");
196199
197200 s5p64x0_default_sdhci0();
198201 s5p64x0_default_sdhci1();
arch/arm/mach-s5pc100/common.c+3−0
@@ -45,6 +45,7 @@ · 44 unmodified lines
4545 #include <plat/fb-core.h>
4646 #include <plat/iic-core.h>
4747 #include <plat/onenand-core.h>
48+#include <plat/spi-core.h>
4849 #include <plat/regs-serial.h>
4950 #include <plat/watchdog-reset.h>
5051
@@ -165,6 +166,8 @@ void __init s5pc100_map_io(void) · 114 unmodified lines
165166 s3c_onenand_setname("s5pc100-onenand");
166167 s3c_fb_setname("s5pc100-fb");
167168 s3c_cfcon_setname("s5pc100-pata");
169+
170+ s3c64xx_spi_setname("s5pc100-spi");
168171 }
169172
170173 void __init s5pc100_init_clocks(int xtal)
arch/arm/mach-s5pv210/common.c+3−0
@@ -43,6 +43,7 @@ · 42 unmodified lines
4343 #include <plat/iic-core.h>
4444 #include <plat/keypad-core.h>
4545 #include <plat/tv-core.h>
46+#include <plat/spi-core.h>
4647 #include <plat/regs-serial.h>
4748
4849 #include "common.h"
@@ -196,6 +197,8 @@ void __init s5pv210_map_io(void) · 147 unmodified lines
196197
197198 /* setup TV devices */
198199 s5p_hdmi_setname("s5pv210-hdmi");
200+
201+ s3c64xx_spi_setname("s5pv210-spi");
199202 }
200203
201204 void __init s5pv210_init_clocks(int xtal)
arch/arm/mach-shmobile/setup-r8a7779.c+1−1
@@ -247,7 +247,7 @@ void __init r8a7779_add_standard_devices(void) · 246 unmodified lines
247247 {
248248 #ifdef CONFIG_CACHE_L2X0
249249 /* Early BRESP enable, Shared attribute override enable, 64K*16way */
250− l2x0_init((void __iomem __force *)(0xf0100000), 0x40470000, 0x82000fff);
250+ l2x0_init(IOMEM(0xf0100000), 0x40470000, 0x82000fff);
251251 #endif
252252 r8a7779_pm_init();
253253
arch/arm/mach-spear13xx/include/mach/spear1310_misc_regs.h+0−0

Empty file deleted.

arch/arm/mach-spear13xx/include/mach/spear1340_misc_regs.h+0−0

Empty file deleted.

arch/arm/mach-ux500/cpu.c+1−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/stat.h>
1717 #include <linux/of.h>
1818 #include <linux/of_irq.h>
19+#include <linux/irq.h>
1920 #include <linux/platform_data/clk-ux500.h>
2021
2122 #include <asm/hardware/gic.h>
arch/arm/mm/alignment.c+4−2
@@ -745,7 +745,7 @@ do_alignment_t32_to_handler(unsigned long *pinstr, struct pt_regs *regs, · 744 unmodified lines
745745 static int
746746 do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
747747 {
748− union offset_union offset;
748+ union offset_union uninitialized_var(offset);
749749 unsigned long instr = 0, instrptr;
750750 int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs);
751751 unsigned int type;
@@ -856,8 +856,10 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) · 104 unmodified lines
856856 if (thumb2_32b) {
857857 offset.un = 0;
858858 handler = do_alignment_t32_to_handler(&instr, regs, &offset);
859− } else
859+ } else {
860+ offset.un = 0;
860861 handler = do_alignment_ldmstm;
862+ }
861863 break;
862864
863865 default:
arch/arm/mm/dma-mapping.c+1−1
@@ -610,7 +610,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, · 609 unmodified lines
610610 gfp_t gfp, pgprot_t prot, bool is_coherent, const void *caller)
611611 {
612612 u64 mask = get_coherent_dma_mask(dev);
613− struct page *page;
613+ struct page *page = NULL;
614614 void *addr;
615615
616616 #ifdef CONFIG_DMA_API_DEBUG
arch/arm/mm/proc-v6.S+1−1
@@ -89,7 +89,7 @@ ENTRY(cpu_v6_dcache_clean_area) · 88 unmodified lines
8989 mov pc, lr
9090
9191 /*
92− * cpu_arm926_switch_mm(pgd_phys, tsk)
92+ * cpu_v6_switch_mm(pgd_phys, tsk)
9393 *
9494 * Set the translation table base pointer to be pgd_phys
9595 *
arch/arm/mm/vmregion.h+0−1
@@ -17,7 +17,6 @@ struct arm_vmregion { · 16 unmodified lines
1717 struct list_head vm_list;
1818 unsigned long vm_start;
1919 unsigned long vm_end;
20− void *priv;
2120 int vm_active;
2221 const void *caller;
2322 };
arch/arm/plat-mxc/devices/platform-mxc-mmc.c+1−1
@@ -55,7 +55,7 @@ struct platform_device *__init imx_add_mxc_mmc( · 54 unmodified lines
5555 struct resource res[] = {
5656 {
5757 .start = data->iobase,
58− .end = data->iobase + SZ_4K - 1,
58+ .end = data->iobase + data->iosize - 1,
5959 .flags = IORESOURCE_MEM,
6060 }, {
6161 .start = data->irq,
arch/arm/plat-omap/Kconfig+1−0
@@ -26,6 +26,7 @@ config ARCH_OMAP2PLUS · 25 unmodified lines
2626 select CLKDEV_LOOKUP
2727 select GENERIC_IRQ_CHIP
2828 select OMAP_DM_TIMER
29+ select PINCTRL
2930 select PROC_DEVICETREE if PROC_FS
3031 select SPARSE_IRQ
3132 select USE_OF
arch/arm/plat-omap/i2c.c+21−0
@@ -26,12 +26,14 @@ · 25 unmodified lines
2626 #include <linux/kernel.h>
2727 #include <linux/platform_device.h>
2828 #include <linux/i2c.h>
29+#include <linux/i2c-omap.h>
2930 #include <linux/slab.h>
3031 #include <linux/err.h>
3132 #include <linux/clk.h>
3233
3334 #include <mach/irqs.h>
3435 #include <plat/i2c.h>
36+#include <plat/omap-pm.h>
3537 #include <plat/omap_device.h>
3638
3739 #define OMAP_I2C_SIZE 0x3f
@@ -127,6 +129,16 @@ static inline int omap1_i2c_add_bus(int bus_id) · 89 unmodified lines
127129
128130
129131 #ifdef CONFIG_ARCH_OMAP2PLUS
132+/*
133+ * XXX This function is a temporary compatibility wrapper - only
134+ * needed until the I2C driver can be converted to call
135+ * omap_pm_set_max_dev_wakeup_lat() and handle a return code.
136+ */
137+static void omap_pm_set_max_mpu_wakeup_lat_compat(struct device *dev, long t)
138+{
139+ omap_pm_set_max_mpu_wakeup_lat(dev, t);
140+}
141+
130142 static inline int omap2_i2c_add_bus(int bus_id)
131143 {
132144 int l;
@@ -158,6 +170,15 @@ static inline int omap2_i2c_add_bus(int bus_id) · 25 unmodified lines
158170 dev_attr = (struct omap_i2c_dev_attr *)oh->dev_attr;
159171 pdata->flags = dev_attr->flags;
160172
173+ /*
174+ * When waiting for completion of a i2c transfer, we need to
175+ * set a wake up latency constraint for the MPU. This is to
176+ * ensure quick enough wakeup from idle, when transfer
177+ * completes.
178+ * Only omap3 has support for constraints
179+ */
180+ if (cpu_is_omap34xx())
181+ pdata->set_mpu_wkup_lat = omap_pm_set_max_mpu_wakeup_lat_compat;
161182 pdev = omap_device_build(name, bus_id, oh, pdata,
162183 sizeof(struct omap_i2c_bus_platform_data),
163184 NULL, 0, 0);
arch/arm/plat-omap/include/plat/omap-serial.h+2−2
@@ -40,10 +40,10 @@ · 39 unmodified lines
4040 #define OMAP_UART_WER_MOD_WKUP 0X7F
4141
4242 /* Enable XON/XOFF flow control on output */
43−#define OMAP_UART_SW_TX 0x8
43+#define OMAP_UART_SW_TX 0x04
4444
4545 /* Enable XON/XOFF flow control on input */
46−#define OMAP_UART_SW_RX 0x2
46+#define OMAP_UART_SW_RX 0x04
4747
4848 #define OMAP_UART_SYSC_RESET 0X07
4949 #define OMAP_UART_TCR_TRIG 0X0F
arch/arm/plat-omap/include/plat/omap_hwmod.h+6−0
@@ -443,6 +443,11 @@ struct omap_hwmod_omap4_prcm { · 442 unmodified lines
443443 * in order to complete the reset. Optional clocks will be disabled
444444 * again after the reset.
445445 * HWMOD_16BIT_REG: Module has 16bit registers
446+ * HWMOD_EXT_OPT_MAIN_CLK: The only main functional clock source for
447+ * this IP block comes from an off-chip source and is not always
448+ * enabled. This prevents the hwmod code from being able to
449+ * enable and reset the IP block early. XXX Eventually it should
450+ * be possible to query the clock framework for this information.
446451 */
447452 #define HWMOD_SWSUP_SIDLE (1 << 0)
448453 #define HWMOD_SWSUP_MSTANDBY (1 << 1)
@@ -453,6 +458,7 @@ struct omap_hwmod_omap4_prcm { · 4 unmodified lines
453458 #define HWMOD_NO_IDLEST (1 << 6)
454459 #define HWMOD_CONTROL_OPT_CLKS_IN_RESET (1 << 7)
455460 #define HWMOD_16BIT_REG (1 << 8)
461+#define HWMOD_EXT_OPT_MAIN_CLK (1 << 9)
456462
457463 /*
458464 * omap_hwmod._int_flags definitions
arch/arm/plat-s3c24xx/dma.c+5−4
@@ -473,12 +473,13 @@ int s3c2410_dma_enqueue(enum dma_ch channel, void *id, · 472 unmodified lines
473473 pr_debug("dma%d: %s: buffer %p queued onto non-empty channel\n",
474474 chan->number, __func__, buf);
475475
476− if (chan->end == NULL)
476+ if (chan->end == NULL) {
477477 pr_debug("dma%d: %s: %p not empty, and chan->end==NULL?\n",
478478 chan->number, __func__, chan);
479−
480− chan->end->next = buf;
481− chan->end = buf;
479+ } else {
480+ chan->end->next = buf;
481+ chan->end = buf;
482+ }
482483 }
483484
484485 /* if necessary, update the next buffer field */
arch/arm/plat-samsung/include/plat/spi-core.h+30−0
@@ -0,0 +1,30 @@
1+/*
2+ * Copyright (C) 2012 Heiko Stuebner <heiko@sntech.de>
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License version 2 as
6+ * published by the Free Software Foundation.
7+ */
8+
9+#ifndef __PLAT_S3C_SPI_CORE_H
10+#define __PLAT_S3C_SPI_CORE_H
11+
12+/* These functions are only for use with the core support code, such as
13+ * the cpu specific initialisation code
14+ */
15+
16+/* re-define device name depending on support. */
17+static inline void s3c64xx_spi_setname(char *name)
18+{
19+#ifdef CONFIG_S3C64XX_DEV_SPI0
20+ s3c64xx_device_spi0.name = name;
21+#endif
22+#ifdef CONFIG_S3C64XX_DEV_SPI1
23+ s3c64xx_device_spi1.name = name;
24+#endif
25+#ifdef CONFIG_S3C64XX_DEV_SPI2
26+ s3c64xx_device_spi2.name = name;
27+#endif
28+}
29+
30+#endif /* __PLAT_S3C_SPI_CORE_H */
arch/arm/tools/Makefile+1−1
@@ -5,6 +5,6 @@ · 4 unmodified lines
55 #
66
77 include/generated/mach-types.h: $(src)/gen-mach-types $(src)/mach-types
8− @echo ' Generating $@'
8+ @$(kecho) ' Generating $@'
99 @mkdir -p $(dir $@)
1010 $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; }
arch/arm/vfp/vfpmodule.c+6−3
@@ -701,11 +701,14 @@ static int __init vfp_init(void) · 700 unmodified lines
701701 elf_hwcap |= HWCAP_VFPv3;
702702
703703 /*
704− * Check for VFPv3 D16. CPUs in this configuration
705− * only have 16 x 64bit registers.
704+ * Check for VFPv3 D16 and VFPv4 D16. CPUs in
705+ * this configuration only have 16 x 64bit
706+ * registers.
706707 */
707708 if (((fmrx(MVFR0) & MVFR0_A_SIMD_MASK)) == 1)
708− elf_hwcap |= HWCAP_VFPv3D16;
709+ elf_hwcap |= HWCAP_VFPv3D16; /* also v4-D16 */
710+ else
711+ elf_hwcap |= HWCAP_VFPD32;
709712 }
710713 #endif
711714 /*
arch/arm/xen/enlighten.c+11−0
@@ -166,3 +166,14 @@ void free_xenballooned_pages(int nr_pages, struct page **pages) · 165 unmodified lines
166166 *pages = NULL;
167167 }
168168 EXPORT_SYMBOL_GPL(free_xenballooned_pages);
169+
170+/* In the hypervisor.S file. */
171+EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
172+EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
173+EXPORT_SYMBOL_GPL(HYPERVISOR_xen_version);
174+EXPORT_SYMBOL_GPL(HYPERVISOR_console_io);
175+EXPORT_SYMBOL_GPL(HYPERVISOR_sched_op);
176+EXPORT_SYMBOL_GPL(HYPERVISOR_hvm_op);
177+EXPORT_SYMBOL_GPL(HYPERVISOR_memory_op);
178+EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op);
179+EXPORT_SYMBOL_GPL(privcmd_call);
arch/arm/xen/hypercall.S+5−9
@@ -48,20 +48,16 @@ · 47 unmodified lines
4848
4949 #include <linux/linkage.h>
5050 #include <asm/assembler.h>
51+#include <asm/opcodes-virt.h>
5152 #include <xen/interface/xen.h>
5253
5354
54−/* HVC 0xEA1 */
55−#ifdef CONFIG_THUMB2_KERNEL
56−#define xen_hvc .word 0xf7e08ea1
57−#else
58−#define xen_hvc .word 0xe140ea71
59−#endif
55+#define XEN_IMM 0xEA1
6056
6157 #define HYPERCALL_SIMPLE(hypercall) \
6258 ENTRY(HYPERVISOR_##hypercall) \
6359 mov r12, #__HYPERVISOR_##hypercall; \
64− xen_hvc; \
60+ __HVC(XEN_IMM); \
6561 mov pc, lr; \
6662 ENDPROC(HYPERVISOR_##hypercall)
6763
@@ -76,7 +72,7 @@ ENTRY(HYPERVISOR_##hypercall) \ · 8 unmodified lines
7672 stmdb sp!, {r4} \
7773 ldr r4, [sp, #4] \
7874 mov r12, #__HYPERVISOR_##hypercall; \
79− xen_hvc \
75+ __HVC(XEN_IMM); \
8076 ldm sp!, {r4} \
8177 mov pc, lr \
8278 ENDPROC(HYPERVISOR_##hypercall)
@@ -100,7 +96,7 @@ ENTRY(privcmd_call) · 17 unmodified lines
10096 mov r2, r3
10197 ldr r3, [sp, #8]
10298 ldr r4, [sp, #4]
103− xen_hvc
99+ __HVC(XEN_IMM)
104100 ldm sp!, {r4}
105101 mov pc, lr
106102 ENDPROC(privcmd_call);
arch/arm64/Kconfig+1−0
@@ -1,6 +1,7 @@
11 config ARM64
22 def_bool y
33 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
4+ select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
45 select GENERIC_CLOCKEVENTS
56 select GENERIC_HARDIRQS_NO_DEPRECATED
67 select GENERIC_IOMAP
arch/arm64/include/asm/elf.h+1−4
@@ -25,12 +25,10 @@ · 24 unmodified lines
2525 #include <asm/user.h>
2626
2727 typedef unsigned long elf_greg_t;
28−typedef unsigned long elf_freg_t[3];
2928
3029 #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
3130 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
32−
33−typedef struct user_fp elf_fpregset_t;
31+typedef struct user_fpsimd_state elf_fpregset_t;
3432
3533 #define EM_AARCH64 183
3634
@@ -87,7 +85,6 @@ typedef struct user_fp elf_fpregset_t; · 50 unmodified lines
8785 #define R_AARCH64_MOVW_PREL_G2_NC 292
8886 #define R_AARCH64_MOVW_PREL_G3 293
8987
90−
9188 /*
9289 * These are used to set parameters in the core dumps.
9390 */
arch/arm64/include/asm/fpsimd.h+2−3
@@ -25,9 +25,8 @@ · 24 unmodified lines
2525 * - FPSR and FPCR
2626 * - 32 128-bit data registers
2727 *
28− * Note that user_fp forms a prefix of this structure, which is relied
29− * upon in the ptrace FP/SIMD accessors. struct user_fpsimd_state must
30− * form a prefix of struct fpsimd_state.
28+ * Note that user_fpsimd forms a prefix of this structure, which is
29+ * relied upon in the ptrace FP/SIMD accessors.
3130 */
3231 struct fpsimd_state {
3332 union {
arch/arm64/include/asm/io.h+5−5
@@ -114,7 +114,7 @@ static inline u64 __raw_readq(const volatile void __iomem *addr) · 113 unmodified lines
114114 * I/O port access primitives.
115115 */
116116 #define IO_SPACE_LIMIT 0xffff
117−#define PCI_IOBASE ((void __iomem *)0xffffffbbfffe0000UL)
117+#define PCI_IOBASE ((void __iomem *)(MODULES_VADDR - SZ_2M))
118118
119119 static inline u8 inb(unsigned long addr)
120120 {
@@ -222,12 +222,12 @@ extern void __iomem *__ioremap(phys_addr_t phys_addr, size_t size, pgprot_t prot · 101 unmodified lines
222222 extern void __iounmap(volatile void __iomem *addr);
223223
224224 #define PROT_DEFAULT (PTE_TYPE_PAGE | PTE_AF | PTE_DIRTY)
225−#define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_XN | PTE_ATTRINDX(MT_DEVICE_nGnRE))
225+#define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_ATTRINDX(MT_DEVICE_nGnRE))
226226 #define PROT_NORMAL_NC (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL_NC))
227227
228−#define ioremap(addr, size) __ioremap((addr), (size), PROT_DEVICE_nGnRE)
229−#define ioremap_nocache(addr, size) __ioremap((addr), (size), PROT_DEVICE_nGnRE)
230−#define ioremap_wc(addr, size) __ioremap((addr), (size), PROT_NORMAL_NC)
228+#define ioremap(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
229+#define ioremap_nocache(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
230+#define ioremap_wc(addr, size) __ioremap((addr), (size), __pgprot(PROT_NORMAL_NC))
231231 #define iounmap __iounmap
232232
233233 #define ARCH_HAS_IOREMAP_WC
arch/arm64/include/asm/pgtable-hwdef.h+4−2
@@ -38,7 +38,8 @@ · 37 unmodified lines
3838 #define PMD_SECT_S (_AT(pmdval_t, 3) << 8)
3939 #define PMD_SECT_AF (_AT(pmdval_t, 1) << 10)
4040 #define PMD_SECT_NG (_AT(pmdval_t, 1) << 11)
41−#define PMD_SECT_XN (_AT(pmdval_t, 1) << 54)
41+#define PMD_SECT_PXN (_AT(pmdval_t, 1) << 53)
42+#define PMD_SECT_UXN (_AT(pmdval_t, 1) << 54)
4243
4344 /*
4445 * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers).
@@ -57,7 +58,8 @@ · 12 unmodified lines
5758 #define PTE_SHARED (_AT(pteval_t, 3) << 8) /* SH[1:0], inner shareable */
5859 #define PTE_AF (_AT(pteval_t, 1) << 10) /* Access Flag */
5960 #define PTE_NG (_AT(pteval_t, 1) << 11) /* nG */
60−#define PTE_XN (_AT(pteval_t, 1) << 54) /* XN */
61+#define PTE_PXN (_AT(pteval_t, 1) << 53) /* Privileged XN */
62+#define PTE_UXN (_AT(pteval_t, 1) << 54) /* User XN */
6163
6264 /*
6365 * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers).
arch/arm64/include/asm/pgtable.h+20−20
@@ -62,23 +62,23 @@ extern pgprot_t pgprot_default; · 61 unmodified lines
6262
6363 #define _MOD_PROT(p, b) __pgprot(pgprot_val(p) | (b))
6464
65−#define PAGE_NONE _MOD_PROT(pgprot_default, PTE_NG | PTE_XN | PTE_RDONLY)
66−#define PAGE_SHARED _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_XN)
67−#define PAGE_SHARED_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG)
68−#define PAGE_COPY _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_XN | PTE_RDONLY)
69−#define PAGE_COPY_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_RDONLY)
70−#define PAGE_READONLY _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_XN | PTE_RDONLY)
71−#define PAGE_READONLY_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_RDONLY)
72−#define PAGE_KERNEL _MOD_PROT(pgprot_default, PTE_XN | PTE_DIRTY)
73−#define PAGE_KERNEL_EXEC _MOD_PROT(pgprot_default, PTE_DIRTY)
74−
75−#define __PAGE_NONE __pgprot(_PAGE_DEFAULT | PTE_NG | PTE_XN | PTE_RDONLY)
76−#define __PAGE_SHARED __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_XN)
77−#define __PAGE_SHARED_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG)
78−#define __PAGE_COPY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_XN | PTE_RDONLY)
79−#define __PAGE_COPY_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_RDONLY)
80−#define __PAGE_READONLY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_XN | PTE_RDONLY)
81−#define __PAGE_READONLY_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_RDONLY)
65+#define PAGE_NONE _MOD_PROT(pgprot_default, PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY)
66+#define PAGE_SHARED _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_UXN)
67+#define PAGE_SHARED_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN)
68+#define PAGE_COPY _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY)
69+#define PAGE_COPY_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_RDONLY)
70+#define PAGE_READONLY _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY)
71+#define PAGE_READONLY_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_RDONLY)
72+#define PAGE_KERNEL _MOD_PROT(pgprot_default, PTE_PXN | PTE_UXN | PTE_DIRTY)
73+#define PAGE_KERNEL_EXEC _MOD_PROT(pgprot_default, PTE_UXN | PTE_DIRTY)
74+
75+#define __PAGE_NONE __pgprot(_PAGE_DEFAULT | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY)
76+#define __PAGE_SHARED __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN)
77+#define __PAGE_SHARED_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN)
78+#define __PAGE_COPY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY)
79+#define __PAGE_COPY_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_RDONLY)
80+#define __PAGE_READONLY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY)
81+#define __PAGE_READONLY_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_RDONLY)
8282
8383 #endif /* __ASSEMBLY__ */
8484
@@ -130,10 +130,10 @@ extern struct page *empty_zero_page; · 45 unmodified lines
130130 #define pte_young(pte) (pte_val(pte) & PTE_AF)
131131 #define pte_special(pte) (pte_val(pte) & PTE_SPECIAL)
132132 #define pte_write(pte) (!(pte_val(pte) & PTE_RDONLY))
133−#define pte_exec(pte) (!(pte_val(pte) & PTE_XN))
133+#define pte_exec(pte) (!(pte_val(pte) & PTE_UXN))
134134
135135 #define pte_present_exec_user(pte) \
136− ((pte_val(pte) & (PTE_VALID | PTE_USER | PTE_XN)) == \
136+ ((pte_val(pte) & (PTE_VALID | PTE_USER | PTE_UXN)) == \
137137 (PTE_VALID | PTE_USER))
138138
139139 #define PTE_BIT_FUNC(fn,op) \
@@ -262,7 +262,7 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr) · 122 unmodified lines
262262
263263 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
264264 {
265− const pteval_t mask = PTE_USER | PTE_XN | PTE_RDONLY;
265+ const pteval_t mask = PTE_USER | PTE_PXN | PTE_UXN | PTE_RDONLY;
266266 pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask);
267267 return pte;
268268 }
arch/arm64/include/asm/processor.h+2−0
@@ -43,6 +43,8 @@ · 42 unmodified lines
4343 #else
4444 #define STACK_TOP STACK_TOP_MAX
4545 #endif /* CONFIG_COMPAT */
46+
47+#define ARCH_LOW_ADDRESS_LIMIT PHYS_MASK
4648 #endif /* __KERNEL__ */
4749
4850 struct debug_info {
arch/arm64/include/asm/unistd.h+0−1
@@ -14,7 +14,6 @@ · 13 unmodified lines
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616 #ifdef CONFIG_COMPAT
17−#define __ARCH_WANT_COMPAT_IPC_PARSE_VERSION
1817 #define __ARCH_WANT_COMPAT_STAT64
1918 #define __ARCH_WANT_SYS_GETHOSTNAME
2019 #define __ARCH_WANT_SYS_PAUSE
arch/arm64/include/asm/unistd32.h+1−1
@@ -392,7 +392,7 @@ __SYSCALL(367, sys_fanotify_init) · 391 unmodified lines
392392 __SYSCALL(368, compat_sys_fanotify_mark_wrapper)
393393 __SYSCALL(369, sys_prlimit64)
394394 __SYSCALL(370, sys_name_to_handle_at)
395−__SYSCALL(371, sys_open_by_handle_at)
395+__SYSCALL(371, compat_sys_open_by_handle_at)
396396 __SYSCALL(372, sys_clock_adjtime)
397397 __SYSCALL(373, sys_syncfs)
398398
arch/arm64/kernel/perf_event.c+2−8
@@ -613,17 +613,11 @@ enum armv8_pmuv3_perf_types { · 612 unmodified lines
613613 ARMV8_PMUV3_PERFCTR_BUS_ACCESS = 0x19,
614614 ARMV8_PMUV3_PERFCTR_MEM_ERROR = 0x1A,
615615 ARMV8_PMUV3_PERFCTR_BUS_CYCLES = 0x1D,
616−
617− /*
618− * This isn't an architected event.
619− * We detect this event number and use the cycle counter instead.
620− */
621− ARMV8_PMUV3_PERFCTR_CPU_CYCLES = 0xFF,
622616 };
623617
624618 /* PMUv3 HW events mapping. */
625619 static const unsigned armv8_pmuv3_perf_map[PERF_COUNT_HW_MAX] = {
626− [PERF_COUNT_HW_CPU_CYCLES] = ARMV8_PMUV3_PERFCTR_CPU_CYCLES,
620+ [PERF_COUNT_HW_CPU_CYCLES] = ARMV8_PMUV3_PERFCTR_CLOCK_CYCLES,
627621 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV8_PMUV3_PERFCTR_INSTR_EXECUTED,
628622 [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV8_PMUV3_PERFCTR_L1_DCACHE_ACCESS,
629623 [PERF_COUNT_HW_CACHE_MISSES] = ARMV8_PMUV3_PERFCTR_L1_DCACHE_REFILL,
@@ -1106,7 +1100,7 @@ static int armv8pmu_get_event_idx(struct pmu_hw_events *cpuc, · 476 unmodified lines
11061100 unsigned long evtype = event->config_base & ARMV8_EVTYPE_EVENT;
11071101
11081102 /* Always place a cycle counter into the cycle counter. */
1109− if (evtype == ARMV8_PMUV3_PERFCTR_CPU_CYCLES) {
1103+ if (evtype == ARMV8_PMUV3_PERFCTR_CLOCK_CYCLES) {
11101104 if (test_and_set_bit(ARMV8_IDX_CYCLE_COUNTER, cpuc->used_mask))
11111105 return -EAGAIN;
11121106
arch/arm64/kernel/process.c+0−18
@@ -309,24 +309,6 @@ struct task_struct *__switch_to(struct task_struct *prev, · 308 unmodified lines
309309 return last;
310310 }
311311
312−/*
313− * Fill in the task's elfregs structure for a core dump.
314− */
315−int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs)
316−{
317− elf_core_copy_regs(elfregs, task_pt_regs(t));
318− return 1;
319−}
320−
321−/*
322− * fill in the fpe structure for a core dump...
323− */
324−int dump_fpu (struct pt_regs *regs, struct user_fp *fp)
325−{
326− return 0;
327−}
328−EXPORT_SYMBOL(dump_fpu);
329−
330312 /*
331313 * Shuffle the argument into the correct register before calling the
332314 * thread function. x1 is the thread argument, x2 is the pointer to
arch/arm64/kernel/smp.c+1−2
@@ -211,8 +211,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void) · 210 unmodified lines
211211 * before we continue.
212212 */
213213 set_cpu_online(cpu, true);
214− while (!cpu_active(cpu))
215− cpu_relax();
214+ complete(&cpu_running);
216215
217216 /*
218217 * OK, it's off to the idle thread for us
arch/arm64/mm/init.c+1−1
@@ -80,7 +80,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) · 79 unmodified lines
8080 #ifdef CONFIG_ZONE_DMA32
8181 /* 4GB maximum for 32-bit only capable devices */
8282 max_dma32 = min(max, MAX_DMA32_PFN);
83− zone_size[ZONE_DMA32] = max_dma32 - min;
83+ zone_size[ZONE_DMA32] = max(min, max_dma32) - min;
8484 #endif
8585 zone_size[ZONE_NORMAL] = max - max_dma32;
8686
arch/c6x/include/asm/setup.h+33−0
@@ -0,0 +1,33 @@
1+/*
2+ * Port on Texas Instruments TMS320C6x architecture
3+ *
4+ * Copyright (C) 2004, 2009, 2010 2011 Texas Instruments Incorporated
5+ * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
6+ *
7+ * This program is free software; you can redistribute it and/or modify
8+ * it under the terms of the GNU General Public License version 2 as
9+ * published by the Free Software Foundation.
10+ */
11+#ifndef _ASM_C6X_SETUP_H
12+#define _ASM_C6X_SETUP_H
13+
14+#include <uapi/asm/setup.h>
15+
16+#ifndef __ASSEMBLY__
17+extern char c6x_command_line[COMMAND_LINE_SIZE];
18+
19+extern int c6x_add_memory(phys_addr_t start, unsigned long size);
20+
21+extern unsigned long ram_start;
22+extern unsigned long ram_end;
23+
24+extern int c6x_num_cores;
25+extern unsigned int c6x_silicon_rev;
26+extern unsigned int c6x_devstat;
27+extern unsigned char c6x_fuse_mac[6];
28+
29+extern void machine_init(unsigned long dt_ptr);
30+extern void time_init(void);
31+
32+#endif /* !__ASSEMBLY__ */
33+#endif /* _ASM_C6X_SETUP_H */
arch/c6x/include/uapi/asm/Kbuild+2−0
@@ -1,6 +1,8 @@
11 # UAPI Header export list
22 include include/uapi/asm-generic/Kbuild.asm
33
4+generic-y += kvm_para.h
5+
46 header-y += byteorder.h
57 header-y += kvm_para.h
68 header-y += ptrace.h
arch/c6x/include/uapi/asm/kvm_para.h+0−1
@@ -1 +0,0 @@
1−#include <asm-generic/kvm_para.h>
arch/c6x/include/uapi/asm/setup.h+3−30
@@ -1,33 +1,6 @@
1−/*
2− * Port on Texas Instruments TMS320C6x architecture
3− *
4− * Copyright (C) 2004, 2009, 2010 2011 Texas Instruments Incorporated
5− * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−#ifndef _ASM_C6X_SETUP_H
12−#define _ASM_C6X_SETUP_H
1+#ifndef _UAPI_ASM_C6X_SETUP_H
2+#define _UAPI_ASM_C6X_SETUP_H
133
144 #define COMMAND_LINE_SIZE 1024
155
16−#ifndef __ASSEMBLY__
17−extern char c6x_command_line[COMMAND_LINE_SIZE];
18−
19−extern int c6x_add_memory(phys_addr_t start, unsigned long size);
20−
21−extern unsigned long ram_start;
22−extern unsigned long ram_end;
23−
24−extern int c6x_num_cores;
25−extern unsigned int c6x_silicon_rev;
26−extern unsigned int c6x_devstat;
27−extern unsigned char c6x_fuse_mac[6];
28−
29−extern void machine_init(unsigned long dt_ptr);
30−extern void time_init(void);
31−
32−#endif /* !__ASSEMBLY__ */
33−#endif /* _ASM_C6X_SETUP_H */
6+#endif /* _UAPI_ASM_C6X_SETUP_H */
arch/c6x/kernel/entry.S+3−2
@@ -277,6 +277,8 @@ work_rescheduled: · 276 unmodified lines
277277 [A1] BNOP .S1 work_resched,5
278278
279279 work_notifysig:
280+ ;; enable interrupts for do_notify_resume()
281+ UNMASK_INT B2
280282 B .S2 do_notify_resume
281283 LDW .D2T1 *+SP(REGS__END+8),A6 ; syscall flag
282284 ADDKPC .S2 resume_userspace,B3,1
@@ -427,8 +429,7 @@ ENTRY(ret_from_kernel_execve) · 144 unmodified lines
427429 ENDPROC(ret_from_kernel_execve)
428430
429431 ;;
430− ;; These are the interrupt handlers, responsible for calling __do_IRQ()
431− ;; int6 is used for syscalls (see _system_call entry)
432+ ;; These are the interrupt handlers, responsible for calling c6x_do_IRQ()
432433 ;;
433434 .macro SAVE_ALL_INT
434435 SAVE_ALL IRP,ITSR
arch/frv/Kconfig+1−0
@@ -13,6 +13,7 @@ config FRV · 12 unmodified lines
1313 select GENERIC_CPU_DEVICES
1414 select ARCH_WANT_IPC_PARSE_VERSION
1515 select GENERIC_KERNEL_THREAD
16+ select GENERIC_KERNEL_EXECVE
1617
1718 config ZONE_DMA
1819 bool
arch/frv/boot/Makefile+6−4
@@ -17,6 +17,8 @@ PARAMS_PHYS = 0x0207c000 · 16 unmodified lines
1717 INITRD_PHYS = 0x02180000
1818 INITRD_VIRT = 0x02180000
1919
20+OBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment
21+
2022 #
2123 # If you don't define ZRELADDR above,
2224 # then it defaults to ZTEXTADDR
@@ -32,18 +34,18 @@ Image: $(obj)/Image · 9 unmodified lines
3234 targets: $(obj)/Image
3335
3436 $(obj)/Image: vmlinux FORCE
35− $(OBJCOPY) -O binary -R .note -R .comment -S vmlinux $@
37+ $(OBJCOPY) $(OBJCOPYFLAGS) -S vmlinux $@
3638
3739 #$(obj)/Image: $(CONFIGURE) $(SYSTEM)
38−# $(OBJCOPY) -O binary -R .note -R .comment -g -S $(SYSTEM) $@
40+# $(OBJCOPY) $(OBJCOPYFLAGS) -g -S $(SYSTEM) $@
3941
4042 bzImage: zImage
4143
4244 zImage: $(CONFIGURE) compressed/$(LINUX)
43− $(OBJCOPY) -O binary -R .note -R .comment -S compressed/$(LINUX) $@
45+ $(OBJCOPY) $(OBJCOPYFLAGS) -S compressed/$(LINUX) $@
4446
4547 bootpImage: bootp/bootp
46− $(OBJCOPY) -O binary -R .note -R .comment -S bootp/bootp $@
48+ $(OBJCOPY) $(OBJCOPYFLAGS) -S bootp/bootp $@
4749
4850 compressed/$(LINUX): $(LINUX) dep
4951 @$(MAKE) -C compressed $(LINUX)
arch/frv/include/asm/unistd.h+0−1
@@ -30,7 +30,6 @@ · 29 unmodified lines
3030 #define __ARCH_WANT_SYS_RT_SIGACTION
3131 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
3232 #define __ARCH_WANT_SYS_EXECVE
33−#define __ARCH_WANT_KERNEL_EXECVE
3433
3534 /*
3635 * "Conditional" syscalls
arch/frv/kernel/entry.S+3−25
@@ -869,11 +869,6 @@ ret_from_kernel_thread: · 868 unmodified lines
869869 call schedule_tail
870870 calll.p @(gr21,gr0)
871871 or gr20,gr20,gr8
872− bra sys_exit
873−
874− .globl ret_from_kernel_execve
875−ret_from_kernel_execve:
876− ori gr28,0,sp
877872 bra __syscall_exit
878873
879874 ###################################################################################################
@@ -1080,27 +1075,10 @@ __entry_return_from_kernel_interrupt: · 200 unmodified lines
10801075 subicc gr5,#0,gr0,icc0
10811076 beq icc0,#0,__entry_return_direct
10821077
1083−__entry_preempt_need_resched:
1084− ldi @(gr15,#TI_FLAGS),gr4
1085− andicc gr4,#_TIF_NEED_RESCHED,gr0,icc0
1086− beq icc0,#1,__entry_return_direct
1087−
1088− setlos #PREEMPT_ACTIVE,gr5
1089− sti gr5,@(gr15,#TI_FLAGS)
1090−
1091− andi gr23,#~PSR_PIL,gr23
1092− movgs gr23,psr
1093−
1094− call schedule
1095− sti gr0,@(gr15,#TI_PRE_COUNT)
1096−
1097− movsg psr,gr23
1098− ori gr23,#PSR_PIL_14,gr23
1099− movgs gr23,psr
1100− bra __entry_preempt_need_resched
1101−#else
1102− bra __entry_return_direct
1078+ subcc gr0,gr0,gr0,icc2 /* set Z and clear C */
1079+ call preempt_schedule_irq
11031080 #endif
1081+ bra __entry_return_direct
11041082
11051083
11061084 ###############################################################################
arch/frv/kernel/process.c+3−2
@@ -181,6 +181,9 @@ int copy_thread(unsigned long clone_flags, · 180 unmodified lines
181181 childregs = (struct pt_regs *)
182182 (task_stack_page(p) + THREAD_SIZE - FRV_FRAME0_SIZE);
183183
184+ /* set up the userspace frame (the only place that the USP is stored) */
185+ *childregs = *__kernel_frame0_ptr;
186+
184187 p->set_child_tid = p->clear_child_tid = NULL;
185188
186189 p->thread.frame = childregs;
@@ -191,10 +194,8 @@ int copy_thread(unsigned long clone_flags, · 4 unmodified lines
191194 p->thread.frame0 = childregs;
192195
193196 if (unlikely(!regs)) {
194− memset(childregs, 0, sizeof(struct pt_regs));
195197 childregs->gr9 = usp; /* function */
196198 childregs->gr8 = arg;
197− childregs->psr = PSR_S;
198199 p->thread.pc = (unsigned long) ret_from_kernel_thread;
199200 save_user_regs(p->thread.user);
200201 return 0;
arch/frv/mb93090-mb00/pci-dma-nommu.c+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111
1212 #include <linux/types.h>
1313 #include <linux/slab.h>
14+#include <linux/export.h>
1415 #include <linux/dma-mapping.h>
1516 #include <linux/list.h>
1617 #include <linux/pci.h>
arch/h8300/include/asm/cache.h+2−1
@@ -2,7 +2,8 @@ · 1 unmodified line
22 #define __ARCH_H8300_CACHE_H
33
44 /* bytes per L1 cache line */
5−#define L1_CACHE_BYTES 4
5+#define L1_CACHE_SHIFT 2
6+#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
67
78 /* m68k-elf-gcc 2.95.2 doesn't like these */
89
arch/ia64/mm/init.c+0−1
@@ -637,7 +637,6 @@ mem_init (void) · 636 unmodified lines
637637
638638 high_memory = __va(max_low_pfn * PAGE_SIZE);
639639
640− reset_zone_present_pages();
641640 for_each_online_pgdat(pgdat)
642641 if (pgdat->bdata->node_bootmem_map)
643642 totalram_pages += free_all_bootmem_node(pgdat);
arch/m68k/include/asm/signal.h+3−3
@@ -41,7 +41,7 @@ struct k_sigaction { · 40 unmodified lines
4141 static inline void sigaddset(sigset_t *set, int _sig)
4242 {
4343 asm ("bfset %0{%1,#1}"
44− : "+od" (*set)
44+ : "+o" (*set)
4545 : "id" ((_sig - 1) ^ 31)
4646 : "cc");
4747 }
@@ -49,7 +49,7 @@ static inline void sigaddset(sigset_t *set, int _sig) · 1 unmodified line
4949 static inline void sigdelset(sigset_t *set, int _sig)
5050 {
5151 asm ("bfclr %0{%1,#1}"
52− : "+od" (*set)
52+ : "+o" (*set)
5353 : "id" ((_sig - 1) ^ 31)
5454 : "cc");
5555 }
@@ -65,7 +65,7 @@ static inline int __gen_sigismember(sigset_t *set, int _sig) · 9 unmodified lines
6565 int ret;
6666 asm ("bfextu %1{%2,#1},%0"
6767 : "=d" (ret)
68− : "od" (*set), "id" ((_sig-1) ^ 31)
68+ : "o" (*set), "id" ((_sig-1) ^ 31)
6969 : "cc");
7070 return ret;
7171 }
arch/microblaze/kernel/signal.c+1−1
@@ -111,7 +111,7 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs) · 110 unmodified lines
111111
112112 /* It is more difficult to avoid calling this function than to
113113 call it and ignore errors. */
114− if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->r1))
114+ if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->r1) == -EFAULT)
115115 goto badframe;
116116
117117 return rval;
arch/mips/cavium-octeon/executive/cvmx-l2c.c+1−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 * measurement, and debugging facilities.
3131 */
3232
33+#include <linux/irqflags.h>
3334 #include <asm/octeon/cvmx.h>
3435 #include <asm/octeon/cvmx-l2c.h>
3536 #include <asm/octeon/cvmx-spinlock.h>
arch/mips/fw/arc/misc.c+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 */
1212 #include <linux/init.h>
1313 #include <linux/kernel.h>
14+#include <linux/irqflags.h>
1415
1516 #include <asm/bcache.h>
1617
arch/mips/include/asm/bitops.h+39−89
@@ -14,7 +14,6 @@ · 13 unmodified lines
1414 #endif
1515
1616 #include <linux/compiler.h>
17−#include <linux/irqflags.h>
1817 #include <linux/types.h>
1918 #include <asm/barrier.h>
2019 #include <asm/byteorder.h> /* sigh ... */
@@ -44,6 +43,24 @@ · 23 unmodified lines
4443 #define smp_mb__before_clear_bit() smp_mb__before_llsc()
4544 #define smp_mb__after_clear_bit() smp_llsc_mb()
4645
46+
47+/*
48+ * These are the "slower" versions of the functions and are in bitops.c.
49+ * These functions call raw_local_irq_{save,restore}().
50+ */
51+void __mips_set_bit(unsigned long nr, volatile unsigned long *addr);
52+void __mips_clear_bit(unsigned long nr, volatile unsigned long *addr);
53+void __mips_change_bit(unsigned long nr, volatile unsigned long *addr);
54+int __mips_test_and_set_bit(unsigned long nr,
55+ volatile unsigned long *addr);
56+int __mips_test_and_set_bit_lock(unsigned long nr,
57+ volatile unsigned long *addr);
58+int __mips_test_and_clear_bit(unsigned long nr,
59+ volatile unsigned long *addr);
60+int __mips_test_and_change_bit(unsigned long nr,
61+ volatile unsigned long *addr);
62+
63+
4764 /*
4865 * set_bit - Atomically set a bit in memory
4966 * @nr: the bit to set
@@ -57,7 +74,7 @@ · 7 unmodified lines
5774 static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
5875 {
5976 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
60− unsigned short bit = nr & SZLONG_MASK;
77+ int bit = nr & SZLONG_MASK;
6178 unsigned long temp;
6279
6380 if (kernel_uses_llsc && R10000_LLSC_WAR) {
@@ -92,17 +109,8 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr) · 28 unmodified lines
92109 : "=&r" (temp), "+m" (*m)
93110 : "ir" (1UL << bit));
94111 } while (unlikely(!temp));
95− } else {
96− volatile unsigned long *a = addr;
97− unsigned long mask;
98− unsigned long flags;
99−
100− a += nr >> SZLONG_LOG;
101− mask = 1UL << bit;
102− raw_local_irq_save(flags);
103− *a |= mask;
104− raw_local_irq_restore(flags);
105− }
112+ } else
113+ __mips_set_bit(nr, addr);
106114 }
107115
108116 /*
@@ -118,7 +126,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr) · 9 unmodified lines
118126 static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
119127 {
120128 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
121− unsigned short bit = nr & SZLONG_MASK;
129+ int bit = nr & SZLONG_MASK;
122130 unsigned long temp;
123131
124132 if (kernel_uses_llsc && R10000_LLSC_WAR) {
@@ -153,17 +161,8 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) · 28 unmodified lines
153161 : "=&r" (temp), "+m" (*m)
154162 : "ir" (~(1UL << bit)));
155163 } while (unlikely(!temp));
156− } else {
157− volatile unsigned long *a = addr;
158− unsigned long mask;
159− unsigned long flags;
160−
161− a += nr >> SZLONG_LOG;
162− mask = 1UL << bit;
163− raw_local_irq_save(flags);
164− *a &= ~mask;
165− raw_local_irq_restore(flags);
166− }
164+ } else
165+ __mips_clear_bit(nr, addr);
167166 }
168167
169168 /*
@@ -191,7 +190,7 @@ static inline void clear_bit_unlock(unsigned long nr, volatile unsigned long *ad · 21 unmodified lines
191190 */
192191 static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
193192 {
194− unsigned short bit = nr & SZLONG_MASK;
193+ int bit = nr & SZLONG_MASK;
195194
196195 if (kernel_uses_llsc && R10000_LLSC_WAR) {
197196 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
@@ -220,17 +219,8 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr) · 22 unmodified lines
220219 : "=&r" (temp), "+m" (*m)
221220 : "ir" (1UL << bit));
222221 } while (unlikely(!temp));
223− } else {
224− volatile unsigned long *a = addr;
225− unsigned long mask;
226− unsigned long flags;
227−
228− a += nr >> SZLONG_LOG;
229− mask = 1UL << bit;
230− raw_local_irq_save(flags);
231− *a ^= mask;
232− raw_local_irq_restore(flags);
233− }
222+ } else
223+ __mips_change_bit(nr, addr);
234224 }
235225
236226 /*
@@ -244,7 +234,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr) · 7 unmodified lines
244234 static inline int test_and_set_bit(unsigned long nr,
245235 volatile unsigned long *addr)
246236 {
247− unsigned short bit = nr & SZLONG_MASK;
237+ int bit = nr & SZLONG_MASK;
248238 unsigned long res;
249239
250240 smp_mb__before_llsc();
@@ -281,18 +271,8 @@ static inline int test_and_set_bit(unsigned long nr, · 30 unmodified lines
281271 } while (unlikely(!res));
282272
283273 res = temp & (1UL << bit);
284− } else {
285− volatile unsigned long *a = addr;
286− unsigned long mask;
287− unsigned long flags;
288−
289− a += nr >> SZLONG_LOG;
290− mask = 1UL << bit;
291− raw_local_irq_save(flags);
292− res = (mask & *a);
293− *a |= mask;
294− raw_local_irq_restore(flags);
295− }
274+ } else
275+ res = __mips_test_and_set_bit(nr, addr);
296276
297277 smp_llsc_mb();
298278
@@ -310,7 +290,7 @@ static inline int test_and_set_bit(unsigned long nr, · 11 unmodified lines
310290 static inline int test_and_set_bit_lock(unsigned long nr,
311291 volatile unsigned long *addr)
312292 {
313− unsigned short bit = nr & SZLONG_MASK;
293+ int bit = nr & SZLONG_MASK;
314294 unsigned long res;
315295
316296 if (kernel_uses_llsc && R10000_LLSC_WAR) {
@@ -345,18 +325,8 @@ static inline int test_and_set_bit_lock(unsigned long nr, · 28 unmodified lines
345325 } while (unlikely(!res));
346326
347327 res = temp & (1UL << bit);
348− } else {
349− volatile unsigned long *a = addr;
350− unsigned long mask;
351− unsigned long flags;
352−
353− a += nr >> SZLONG_LOG;
354− mask = 1UL << bit;
355− raw_local_irq_save(flags);
356− res = (mask & *a);
357− *a |= mask;
358− raw_local_irq_restore(flags);
359− }
328+ } else
329+ res = __mips_test_and_set_bit_lock(nr, addr);
360330
361331 smp_llsc_mb();
362332
@@ -373,7 +343,7 @@ static inline int test_and_set_bit_lock(unsigned long nr, · 10 unmodified lines
373343 static inline int test_and_clear_bit(unsigned long nr,
374344 volatile unsigned long *addr)
375345 {
376− unsigned short bit = nr & SZLONG_MASK;
346+ int bit = nr & SZLONG_MASK;
377347 unsigned long res;
378348
379349 smp_mb__before_llsc();
@@ -428,18 +398,8 @@ static inline int test_and_clear_bit(unsigned long nr, · 48 unmodified lines
428398 } while (unlikely(!res));
429399
430400 res = temp & (1UL << bit);
431− } else {
432− volatile unsigned long *a = addr;
433− unsigned long mask;
434− unsigned long flags;
435−
436− a += nr >> SZLONG_LOG;
437− mask = 1UL << bit;
438− raw_local_irq_save(flags);
439− res = (mask & *a);
440− *a &= ~mask;
441− raw_local_irq_restore(flags);
442− }
401+ } else
402+ res = __mips_test_and_clear_bit(nr, addr);
443403
444404 smp_llsc_mb();
445405
@@ -457,7 +417,7 @@ static inline int test_and_clear_bit(unsigned long nr, · 11 unmodified lines
457417 static inline int test_and_change_bit(unsigned long nr,
458418 volatile unsigned long *addr)
459419 {
460− unsigned short bit = nr & SZLONG_MASK;
420+ int bit = nr & SZLONG_MASK;
461421 unsigned long res;
462422
463423 smp_mb__before_llsc();
@@ -494,18 +454,8 @@ static inline int test_and_change_bit(unsigned long nr, · 30 unmodified lines
494454 } while (unlikely(!res));
495455
496456 res = temp & (1UL << bit);
497− } else {
498− volatile unsigned long *a = addr;
499− unsigned long mask;
500− unsigned long flags;
501−
502− a += nr >> SZLONG_LOG;
503− mask = 1UL << bit;
504− raw_local_irq_save(flags);
505− res = (mask & *a);
506− *a ^= mask;
507− raw_local_irq_restore(flags);
508− }
457+ } else
458+ res = __mips_test_and_change_bit(nr, addr);
509459
510460 smp_llsc_mb();
511461
arch/mips/include/asm/compat.h+1−1
@@ -290,7 +290,7 @@ struct compat_shmid64_ds { · 289 unmodified lines
290290
291291 static inline int is_compat_task(void)
292292 {
293− return test_thread_flag(TIF_32BIT);
293+ return test_thread_flag(TIF_32BIT_ADDR);
294294 }
295295
296296 #endif /* _ASM_COMPAT_H */
arch/mips/include/asm/hugetlb.h+11−1
@@ -95,7 +95,17 @@ static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, · 94 unmodified lines
9595 pte_t *ptep, pte_t pte,
9696 int dirty)
9797 {
98− return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
98+ int changed = !pte_same(*ptep, pte);
99+
100+ if (changed) {
101+ set_pte_at(vma->vm_mm, addr, ptep, pte);
102+ /*
103+ * There could be some standard sized pages in there,
104+ * get them all.
105+ */
106+ flush_tlb_range(vma, addr, addr + HPAGE_SIZE);
107+ }
108+ return changed;
99109 }
100110
101111 static inline pte_t huge_ptep_get(pte_t *ptep)
arch/mips/include/asm/io.h+1−0
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/compiler.h>
1616 #include <linux/kernel.h>
1717 #include <linux/types.h>
18+#include <linux/irqflags.h>
1819
1920 #include <asm/addrspace.h>
2021 #include <asm/bug.h>
arch/mips/include/asm/irqflags.h+75−132
@@ -16,83 +16,13 @@ · 15 unmodified lines
1616 #include <linux/compiler.h>
1717 #include <asm/hazards.h>
1818
19−__asm__(
20− " .macro arch_local_irq_enable \n"
21− " .set push \n"
22− " .set reorder \n"
23− " .set noat \n"
24−#ifdef CONFIG_MIPS_MT_SMTC
25− " mfc0 $1, $2, 1 # SMTC - clear TCStatus.IXMT \n"
26− " ori $1, 0x400 \n"
27− " xori $1, 0x400 \n"
28− " mtc0 $1, $2, 1 \n"
29−#elif defined(CONFIG_CPU_MIPSR2)
30− " ei \n"
31−#else
32− " mfc0 $1,$12 \n"
33− " ori $1,0x1f \n"
34− " xori $1,0x1e \n"
35− " mtc0 $1,$12 \n"
36−#endif
37− " irq_enable_hazard \n"
38− " .set pop \n"
39− " .endm");
19+#if defined(CONFIG_CPU_MIPSR2) && !defined(CONFIG_MIPS_MT_SMTC)
4020
41−extern void smtc_ipi_replay(void);
42−
43−static inline void arch_local_irq_enable(void)
44−{
45−#ifdef CONFIG_MIPS_MT_SMTC
46− /*
47− * SMTC kernel needs to do a software replay of queued
48− * IPIs, at the cost of call overhead on each local_irq_enable()
49− */
50− smtc_ipi_replay();
51−#endif
52− __asm__ __volatile__(
53− "arch_local_irq_enable"
54− : /* no outputs */
55− : /* no inputs */
56− : "memory");
57−}
58−
59−
60−/*
61− * For cli() we have to insert nops to make sure that the new value
62− * has actually arrived in the status register before the end of this
63− * macro.
64− * R4000/R4400 need three nops, the R4600 two nops and the R10000 needs
65− * no nops at all.
66− */
67−/*
68− * For TX49, operating only IE bit is not enough.
69− *
70− * If mfc0 $12 follows store and the mfc0 is last instruction of a
71− * page and fetching the next instruction causes TLB miss, the result
72− * of the mfc0 might wrongly contain EXL bit.
73− *
74− * ERT-TX49H2-027, ERT-TX49H3-012, ERT-TX49HL3-006, ERT-TX49H4-008
75− *
76− * Workaround: mask EXL bit of the result or place a nop before mfc0.
77− */
7821 __asm__(
7922 " .macro arch_local_irq_disable\n"
8023 " .set push \n"
8124 " .set noat \n"
82−#ifdef CONFIG_MIPS_MT_SMTC
83− " mfc0 $1, $2, 1 \n"
84− " ori $1, 0x400 \n"
85− " .set noreorder \n"
86− " mtc0 $1, $2, 1 \n"
87−#elif defined(CONFIG_CPU_MIPSR2)
8825 " di \n"
89−#else
90− " mfc0 $1,$12 \n"
91− " ori $1,0x1f \n"
92− " xori $1,0x1f \n"
93− " .set noreorder \n"
94− " mtc0 $1,$12 \n"
95−#endif
9626 " irq_disable_hazard \n"
9727 " .set pop \n"
9828 " .endm \n");
@@ -106,46 +36,14 @@ static inline void arch_local_irq_disable(void) · 7 unmodified lines
10636 : "memory");
10737 }
10838
109−__asm__(
110− " .macro arch_local_save_flags flags \n"
111− " .set push \n"
112− " .set reorder \n"
113−#ifdef CONFIG_MIPS_MT_SMTC
114− " mfc0 \\flags, $2, 1 \n"
115−#else
116− " mfc0 \\flags, $12 \n"
117−#endif
118− " .set pop \n"
119− " .endm \n");
120−
121−static inline unsigned long arch_local_save_flags(void)
122−{
123− unsigned long flags;
124− asm volatile("arch_local_save_flags %0" : "=r" (flags));
125− return flags;
126−}
12739
12840 __asm__(
12941 " .macro arch_local_irq_save result \n"
13042 " .set push \n"
13143 " .set reorder \n"
13244 " .set noat \n"
133−#ifdef CONFIG_MIPS_MT_SMTC
134− " mfc0 \\result, $2, 1 \n"
135− " ori $1, \\result, 0x400 \n"
136− " .set noreorder \n"
137− " mtc0 $1, $2, 1 \n"
138− " andi \\result, \\result, 0x400 \n"
139−#elif defined(CONFIG_CPU_MIPSR2)
14045 " di \\result \n"
14146 " andi \\result, 1 \n"
142−#else
143− " mfc0 \\result, $12 \n"
144− " ori $1, \\result, 0x1f \n"
145− " xori $1, 0x1f \n"
146− " .set noreorder \n"
147− " mtc0 $1, $12 \n"
148−#endif
14947 " irq_disable_hazard \n"
15048 " .set pop \n"
15149 " .endm \n");
@@ -160,61 +58,37 @@ static inline unsigned long arch_local_irq_save(void) · 8 unmodified lines
16058 return flags;
16159 }
16260
61+
16362 __asm__(
16463 " .macro arch_local_irq_restore flags \n"
16564 " .set push \n"
16665 " .set noreorder \n"
16766 " .set noat \n"
168−#ifdef CONFIG_MIPS_MT_SMTC
169− "mfc0 $1, $2, 1 \n"
170− "andi \\flags, 0x400 \n"
171− "ori $1, 0x400 \n"
172− "xori $1, 0x400 \n"
173− "or \\flags, $1 \n"
174− "mtc0 \\flags, $2, 1 \n"
175−#elif defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU)
67+#if defined(CONFIG_IRQ_CPU)
17668 /*
17769 * Slow, but doesn't suffer from a relatively unlikely race
17870 * condition we're having since days 1.
17971 */
18072 " beqz \\flags, 1f \n"
181− " di \n"
73+ " di \n"
18274 " ei \n"
18375 "1: \n"
184−#elif defined(CONFIG_CPU_MIPSR2)
76+#else
18577 /*
18678 * Fast, dangerous. Life is fun, life is good.
18779 */
18880 " mfc0 $1, $12 \n"
18981 " ins $1, \\flags, 0, 1 \n"
19082 " mtc0 $1, $12 \n"
191−#else
192− " mfc0 $1, $12 \n"
193− " andi \\flags, 1 \n"
194− " ori $1, 0x1f \n"
195− " xori $1, 0x1f \n"
196− " or \\flags, $1 \n"
197− " mtc0 \\flags, $12 \n"
19883 #endif
19984 " irq_disable_hazard \n"
20085 " .set pop \n"
20186 " .endm \n");
20287
203−
20488 static inline void arch_local_irq_restore(unsigned long flags)
20589 {
20690 unsigned long __tmp1;
20791
208−#ifdef CONFIG_MIPS_MT_SMTC
209− /*
210− * SMTC kernel needs to do a software replay of queued
211− * IPIs, at the cost of branch and call overhead on each
212− * local_irq_restore()
213− */
214− if (unlikely(!(flags & 0x0400)))
215− smtc_ipi_replay();
216−#endif
217−
21892 __asm__ __volatile__(
21993 "arch_local_irq_restore\t%0"
22094 : "=r" (__tmp1)
@@ -232,6 +106,75 @@ static inline void __arch_local_irq_restore(unsigned long flags) · 11 unmodified lines
232106 : "0" (flags)
233107 : "memory");
234108 }
109+#else
110+/* Functions that require preempt_{dis,en}able() are in mips-atomic.c */
111+void arch_local_irq_disable(void);
112+unsigned long arch_local_irq_save(void);
113+void arch_local_irq_restore(unsigned long flags);
114+void __arch_local_irq_restore(unsigned long flags);
115+#endif /* if defined(CONFIG_CPU_MIPSR2) && !defined(CONFIG_MIPS_MT_SMTC) */
116+
117+
118+__asm__(
119+ " .macro arch_local_irq_enable \n"
120+ " .set push \n"
121+ " .set reorder \n"
122+ " .set noat \n"
123+#ifdef CONFIG_MIPS_MT_SMTC
124+ " mfc0 $1, $2, 1 # SMTC - clear TCStatus.IXMT \n"
125+ " ori $1, 0x400 \n"
126+ " xori $1, 0x400 \n"
127+ " mtc0 $1, $2, 1 \n"
128+#elif defined(CONFIG_CPU_MIPSR2)
129+ " ei \n"
130+#else
131+ " mfc0 $1,$12 \n"
132+ " ori $1,0x1f \n"
133+ " xori $1,0x1e \n"
134+ " mtc0 $1,$12 \n"
135+#endif
136+ " irq_enable_hazard \n"
137+ " .set pop \n"
138+ " .endm");
139+
140+extern void smtc_ipi_replay(void);
141+
142+static inline void arch_local_irq_enable(void)
143+{
144+#ifdef CONFIG_MIPS_MT_SMTC
145+ /*
146+ * SMTC kernel needs to do a software replay of queued
147+ * IPIs, at the cost of call overhead on each local_irq_enable()
148+ */
149+ smtc_ipi_replay();
150+#endif
151+ __asm__ __volatile__(
152+ "arch_local_irq_enable"
153+ : /* no outputs */
154+ : /* no inputs */
155+ : "memory");
156+}
157+
158+
159+__asm__(
160+ " .macro arch_local_save_flags flags \n"
161+ " .set push \n"
162+ " .set reorder \n"
163+#ifdef CONFIG_MIPS_MT_SMTC
164+ " mfc0 \\flags, $2, 1 \n"
165+#else
166+ " mfc0 \\flags, $12 \n"
167+#endif
168+ " .set pop \n"
169+ " .endm \n");
170+
171+static inline unsigned long arch_local_save_flags(void)
172+{
173+ unsigned long flags;
174+ asm volatile("arch_local_save_flags %0" : "=r" (flags));
175+ return flags;
176+}
177+
235178
236179 static inline int arch_irqs_disabled_flags(unsigned long flags)
237180 {
@@ -245,7 +188,7 @@ static inline int arch_irqs_disabled_flags(unsigned long flags) · 7 unmodified lines
245188 #endif
246189 }
247190
248−#endif
191+#endif /* #ifndef __ASSEMBLY__ */
249192
250193 /*
251194 * Do the CPU's IRQ-state tracing from assembly code.
arch/mips/include/asm/thread_info.h+0−6
@@ -112,12 +112,6 @@ register struct thread_info *__current_thread_info __asm__("$28"); · 111 unmodified lines
112112 #define TIF_LOAD_WATCH 25 /* If set, load watch registers */
113113 #define TIF_SYSCALL_TRACE 31 /* syscall trace active */
114114
115−#ifdef CONFIG_MIPS32_O32
116−#define TIF_32BIT TIF_32BIT_REGS
117−#elif defined(CONFIG_MIPS32_N32)
118−#define TIF_32BIT _TIF_32BIT_ADDR
119−#endif /* CONFIG_MIPS32_O32 */
120−
121115 #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
122116 #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
123117 #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
arch/mips/kernel/cpu-probe.c+0−1
@@ -510,7 +510,6 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) · 509 unmodified lines
510510 c->cputype = CPU_R3000A;
511511 __cpu_name[cpu] = "R3000A";
512512 }
513− break;
514513 } else {
515514 c->cputype = CPU_R3000;
516515 __cpu_name[cpu] = "R3000";
arch/mips/kernel/entry.S+6−1
@@ -36,6 +36,11 @@ FEXPORT(ret_from_exception) · 35 unmodified lines
3636 FEXPORT(ret_from_irq)
3737 LONG_S s0, TI_REGS($28)
3838 FEXPORT(__ret_from_irq)
39+/*
40+ * We can be coming here from a syscall done in the kernel space,
41+ * e.g. a failed kernel_execve().
42+ */
43+resume_userspace_check:
3944 LONG_L t0, PT_STATUS(sp) # returning to kernel mode?
4045 andi t0, t0, KU_USER
4146 beqz t0, resume_kernel
@@ -162,7 +167,7 @@ work_notifysig: # deal with pending signals and · 120 unmodified lines
162167 move a0, sp
163168 li a1, 0
164169 jal do_notify_resume # a2 already loaded
165− j resume_userspace
170+ j resume_userspace_check
166171
167172 FEXPORT(syscall_exit_partial)
168173 local_irq_disable # make sure need_resched doesn't
arch/mips/kernel/scall64-n32.S+3−3
@@ -397,14 +397,14 @@ EXPORT(sysn32_call_table) · 396 unmodified lines
397397 PTR sys_timerfd_create
398398 PTR compat_sys_timerfd_gettime /* 6285 */
399399 PTR compat_sys_timerfd_settime
400− PTR sys_signalfd4
400+ PTR compat_sys_signalfd4
401401 PTR sys_eventfd2
402402 PTR sys_epoll_create1
403403 PTR sys_dup3 /* 6290 */
404404 PTR sys_pipe2
405405 PTR sys_inotify_init1
406− PTR sys_preadv
407− PTR sys_pwritev
406+ PTR compat_sys_preadv
407+ PTR compat_sys_pwritev
408408 PTR compat_sys_rt_tgsigqueueinfo /* 6295 */
409409 PTR sys_perf_event_open
410410 PTR sys_accept4
arch/mips/kernel/setup.c+20−6
@@ -79,7 +79,7 @@ static struct resource data_resource = { .name = "Kernel data", }; · 78 unmodified lines
7979 void __init add_memory_region(phys_t start, phys_t size, long type)
8080 {
8181 int x = boot_mem_map.nr_map;
82− struct boot_mem_map_entry *prev = boot_mem_map.map + x - 1;
82+ int i;
8383
8484 /* Sanity check */
8585 if (start + size < start) {
@@ -88,15 +88,29 @@ void __init add_memory_region(phys_t start, phys_t size, long type) · 2 unmodified lines
8888 }
8989
9090 /*
91− * Try to merge with previous entry if any. This is far less than
92− * perfect but is sufficient for most real world cases.
91+ * Try to merge with existing entry, if any.
9392 */
94− if (x && prev->addr + prev->size == start && prev->type == type) {
95− prev->size += size;
93+ for (i = 0; i < boot_mem_map.nr_map; i++) {
94+ struct boot_mem_map_entry *entry = boot_mem_map.map + i;
95+ unsigned long top;
96+
97+ if (entry->type != type)
98+ continue;
99+
100+ if (start + size < entry->addr)
101+ continue; /* no overlap */
102+
103+ if (entry->addr + entry->size < start)
104+ continue; /* no overlap */
105+
106+ top = max(entry->addr + entry->size, start + size);
107+ entry->addr = min(entry->addr, start);
108+ entry->size = top - entry->addr;
109+
96110 return;
97111 }
98112
99− if (x == BOOT_MEM_MAP_MAX) {
113+ if (boot_mem_map.nr_map == BOOT_MEM_MAP_MAX) {
100114 pr_err("Ooops! Too many entries in the memory map!\n");
101115 return;
102116 }
arch/mips/lib/Makefile+3−2
@@ -2,8 +2,9 @@ · 1 unmodified line
22 # Makefile for MIPS-specific library files..
33 #
44
5−lib-y += csum_partial.o delay.o memcpy.o memset.o \
6− strlen_user.o strncpy_user.o strnlen_user.o uncached.o
5+lib-y += bitops.o csum_partial.o delay.o memcpy.o memset.o \
6+ mips-atomic.o strlen_user.o strncpy_user.o \
7+ strnlen_user.o uncached.o
78
89 obj-y += iomap.o
910 obj-$(CONFIG_PCI) += iomap-pci.o
arch/mips/lib/bitops.c+179−0
@@ -0,0 +1,179 @@
1+/*
2+ * This file is subject to the terms and conditions of the GNU General Public
3+ * License. See the file "COPYING" in the main directory of this archive
4+ * for more details.
5+ *
6+ * Copyright (c) 1994-1997, 99, 2000, 06, 07 Ralf Baechle (ralf@linux-mips.org)
7+ * Copyright (c) 1999, 2000 Silicon Graphics, Inc.
8+ */
9+#include <linux/bitops.h>
10+#include <linux/irqflags.h>
11+#include <linux/export.h>
12+
13+
14+/**
15+ * __mips_set_bit - Atomically set a bit in memory. This is called by
16+ * set_bit() if it cannot find a faster solution.
17+ * @nr: the bit to set
18+ * @addr: the address to start counting from
19+ */
20+void __mips_set_bit(unsigned long nr, volatile unsigned long *addr)
21+{
22+ volatile unsigned long *a = addr;
23+ unsigned bit = nr & SZLONG_MASK;
24+ unsigned long mask;
25+ unsigned long flags;
26+
27+ a += nr >> SZLONG_LOG;
28+ mask = 1UL << bit;
29+ raw_local_irq_save(flags);
30+ *a |= mask;
31+ raw_local_irq_restore(flags);
32+}
33+EXPORT_SYMBOL(__mips_set_bit);
34+
35+
36+/**
37+ * __mips_clear_bit - Clears a bit in memory. This is called by clear_bit() if
38+ * it cannot find a faster solution.
39+ * @nr: Bit to clear
40+ * @addr: Address to start counting from
41+ */
42+void __mips_clear_bit(unsigned long nr, volatile unsigned long *addr)
43+{
44+ volatile unsigned long *a = addr;
45+ unsigned bit = nr & SZLONG_MASK;
46+ unsigned long mask;
47+ unsigned long flags;
48+
49+ a += nr >> SZLONG_LOG;
50+ mask = 1UL << bit;
51+ raw_local_irq_save(flags);
52+ *a &= ~mask;
53+ raw_local_irq_restore(flags);
54+}
55+EXPORT_SYMBOL(__mips_clear_bit);
56+
57+
58+/**
59+ * __mips_change_bit - Toggle a bit in memory. This is called by change_bit()
60+ * if it cannot find a faster solution.
61+ * @nr: Bit to change
62+ * @addr: Address to start counting from
63+ */
64+void __mips_change_bit(unsigned long nr, volatile unsigned long *addr)
65+{
66+ volatile unsigned long *a = addr;
67+ unsigned bit = nr & SZLONG_MASK;
68+ unsigned long mask;
69+ unsigned long flags;
70+
71+ a += nr >> SZLONG_LOG;
72+ mask = 1UL << bit;
73+ raw_local_irq_save(flags);
74+ *a ^= mask;
75+ raw_local_irq_restore(flags);
76+}
77+EXPORT_SYMBOL(__mips_change_bit);
78+
79+
80+/**
81+ * __mips_test_and_set_bit - Set a bit and return its old value. This is
82+ * called by test_and_set_bit() if it cannot find a faster solution.
83+ * @nr: Bit to set
84+ * @addr: Address to count from
85+ */
86+int __mips_test_and_set_bit(unsigned long nr,
87+ volatile unsigned long *addr)
88+{
89+ volatile unsigned long *a = addr;
90+ unsigned bit = nr & SZLONG_MASK;
91+ unsigned long mask;
92+ unsigned long flags;
93+ unsigned long res;
94+
95+ a += nr >> SZLONG_LOG;
96+ mask = 1UL << bit;
97+ raw_local_irq_save(flags);
98+ res = (mask & *a);
99+ *a |= mask;
100+ raw_local_irq_restore(flags);
101+ return res;
102+}
103+EXPORT_SYMBOL(__mips_test_and_set_bit);
104+
105+
106+/**
107+ * __mips_test_and_set_bit_lock - Set a bit and return its old value. This is
108+ * called by test_and_set_bit_lock() if it cannot find a faster solution.
109+ * @nr: Bit to set
110+ * @addr: Address to count from
111+ */
112+int __mips_test_and_set_bit_lock(unsigned long nr,
113+ volatile unsigned long *addr)
114+{
115+ volatile unsigned long *a = addr;
116+ unsigned bit = nr & SZLONG_MASK;
117+ unsigned long mask;
118+ unsigned long flags;
119+ unsigned long res;
120+
121+ a += nr >> SZLONG_LOG;
122+ mask = 1UL << bit;
123+ raw_local_irq_save(flags);
124+ res = (mask & *a);
125+ *a |= mask;
126+ raw_local_irq_restore(flags);
127+ return res;
128+}
129+EXPORT_SYMBOL(__mips_test_and_set_bit_lock);
130+
131+
132+/**
133+ * __mips_test_and_clear_bit - Clear a bit and return its old value. This is
134+ * called by test_and_clear_bit() if it cannot find a faster solution.
135+ * @nr: Bit to clear
136+ * @addr: Address to count from
137+ */
138+int __mips_test_and_clear_bit(unsigned long nr, volatile unsigned long *addr)
139+{
140+ volatile unsigned long *a = addr;
141+ unsigned bit = nr & SZLONG_MASK;
142+ unsigned long mask;
143+ unsigned long flags;
144+ unsigned long res;
145+
146+ a += nr >> SZLONG_LOG;
147+ mask = 1UL << bit;
148+ raw_local_irq_save(flags);
149+ res = (mask & *a);
150+ *a &= ~mask;
151+ raw_local_irq_restore(flags);
152+ return res;
153+}
154+EXPORT_SYMBOL(__mips_test_and_clear_bit);
155+
156+
157+/**
158+ * __mips_test_and_change_bit - Change a bit and return its old value. This is
159+ * called by test_and_change_bit() if it cannot find a faster solution.
160+ * @nr: Bit to change
161+ * @addr: Address to count from
162+ */
163+int __mips_test_and_change_bit(unsigned long nr, volatile unsigned long *addr)
164+{
165+ volatile unsigned long *a = addr;
166+ unsigned bit = nr & SZLONG_MASK;
167+ unsigned long mask;
168+ unsigned long flags;
169+ unsigned long res;
170+
171+ a += nr >> SZLONG_LOG;
172+ mask = 1UL << bit;
173+ raw_local_irq_save(flags);
174+ res = (mask & *a);
175+ *a ^= mask;
176+ raw_local_irq_restore(flags);
177+ return res;
178+}
179+EXPORT_SYMBOL(__mips_test_and_change_bit);
arch/mips/lib/mips-atomic.c+176−0
@@ -0,0 +1,176 @@
1+/*
2+ * This file is subject to the terms and conditions of the GNU General Public
3+ * License. See the file "COPYING" in the main directory of this archive
4+ * for more details.
5+ *
6+ * Copyright (C) 1994, 95, 96, 97, 98, 99, 2003 by Ralf Baechle
7+ * Copyright (C) 1996 by Paul M. Antoine
8+ * Copyright (C) 1999 Silicon Graphics
9+ * Copyright (C) 2000 MIPS Technologies, Inc.
10+ */
11+#include <asm/irqflags.h>
12+#include <asm/hazards.h>
13+#include <linux/compiler.h>
14+#include <linux/preempt.h>
15+#include <linux/export.h>
16+
17+#if !defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_MIPS_MT_SMTC)
18+
19+/*
20+ * For cli() we have to insert nops to make sure that the new value
21+ * has actually arrived in the status register before the end of this
22+ * macro.
23+ * R4000/R4400 need three nops, the R4600 two nops and the R10000 needs
24+ * no nops at all.
25+ */
26+/*
27+ * For TX49, operating only IE bit is not enough.
28+ *
29+ * If mfc0 $12 follows store and the mfc0 is last instruction of a
30+ * page and fetching the next instruction causes TLB miss, the result
31+ * of the mfc0 might wrongly contain EXL bit.
32+ *
33+ * ERT-TX49H2-027, ERT-TX49H3-012, ERT-TX49HL3-006, ERT-TX49H4-008
34+ *
35+ * Workaround: mask EXL bit of the result or place a nop before mfc0.
36+ */
37+__asm__(
38+ " .macro arch_local_irq_disable\n"
39+ " .set push \n"
40+ " .set noat \n"
41+#ifdef CONFIG_MIPS_MT_SMTC
42+ " mfc0 $1, $2, 1 \n"
43+ " ori $1, 0x400 \n"
44+ " .set noreorder \n"
45+ " mtc0 $1, $2, 1 \n"
46+#elif defined(CONFIG_CPU_MIPSR2)
47+ /* see irqflags.h for inline function */
48+#else
49+ " mfc0 $1,$12 \n"
50+ " ori $1,0x1f \n"
51+ " xori $1,0x1f \n"
52+ " .set noreorder \n"
53+ " mtc0 $1,$12 \n"
54+#endif
55+ " irq_disable_hazard \n"
56+ " .set pop \n"
57+ " .endm \n");
58+
59+notrace void arch_local_irq_disable(void)
60+{
61+ preempt_disable();
62+ __asm__ __volatile__(
63+ "arch_local_irq_disable"
64+ : /* no outputs */
65+ : /* no inputs */
66+ : "memory");
67+ preempt_enable();
68+}
69+EXPORT_SYMBOL(arch_local_irq_disable);
70+
71+
72+__asm__(
73+ " .macro arch_local_irq_save result \n"
74+ " .set push \n"
75+ " .set reorder \n"
76+ " .set noat \n"
77+#ifdef CONFIG_MIPS_MT_SMTC
78+ " mfc0 \\result, $2, 1 \n"
79+ " ori $1, \\result, 0x400 \n"
80+ " .set noreorder \n"
81+ " mtc0 $1, $2, 1 \n"
82+ " andi \\result, \\result, 0x400 \n"
83+#elif defined(CONFIG_CPU_MIPSR2)
84+ /* see irqflags.h for inline function */
85+#else
86+ " mfc0 \\result, $12 \n"
87+ " ori $1, \\result, 0x1f \n"
88+ " xori $1, 0x1f \n"
89+ " .set noreorder \n"
90+ " mtc0 $1, $12 \n"
91+#endif
92+ " irq_disable_hazard \n"
93+ " .set pop \n"
94+ " .endm \n");
95+
96+notrace unsigned long arch_local_irq_save(void)
97+{
98+ unsigned long flags;
99+ preempt_disable();
100+ asm volatile("arch_local_irq_save\t%0"
101+ : "=r" (flags)
102+ : /* no inputs */
103+ : "memory");
104+ preempt_enable();
105+ return flags;
106+}
107+EXPORT_SYMBOL(arch_local_irq_save);
108+
109+
110+__asm__(
111+ " .macro arch_local_irq_restore flags \n"
112+ " .set push \n"
113+ " .set noreorder \n"
114+ " .set noat \n"
115+#ifdef CONFIG_MIPS_MT_SMTC
116+ "mfc0 $1, $2, 1 \n"
117+ "andi \\flags, 0x400 \n"
118+ "ori $1, 0x400 \n"
119+ "xori $1, 0x400 \n"
120+ "or \\flags, $1 \n"
121+ "mtc0 \\flags, $2, 1 \n"
122+#elif defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU)
123+ /* see irqflags.h for inline function */
124+#elif defined(CONFIG_CPU_MIPSR2)
125+ /* see irqflags.h for inline function */
126+#else
127+ " mfc0 $1, $12 \n"
128+ " andi \\flags, 1 \n"
129+ " ori $1, 0x1f \n"
130+ " xori $1, 0x1f \n"
131+ " or \\flags, $1 \n"
132+ " mtc0 \\flags, $12 \n"
133+#endif
134+ " irq_disable_hazard \n"
135+ " .set pop \n"
136+ " .endm \n");
137+
138+notrace void arch_local_irq_restore(unsigned long flags)
139+{
140+ unsigned long __tmp1;
141+
142+#ifdef CONFIG_MIPS_MT_SMTC
143+ /*
144+ * SMTC kernel needs to do a software replay of queued
145+ * IPIs, at the cost of branch and call overhead on each
146+ * local_irq_restore()
147+ */
148+ if (unlikely(!(flags & 0x0400)))
149+ smtc_ipi_replay();
150+#endif
151+ preempt_disable();
152+ __asm__ __volatile__(
153+ "arch_local_irq_restore\t%0"
154+ : "=r" (__tmp1)
155+ : "0" (flags)
156+ : "memory");
157+ preempt_enable();
158+}
159+EXPORT_SYMBOL(arch_local_irq_restore);
160+
161+
162+notrace void __arch_local_irq_restore(unsigned long flags)
163+{
164+ unsigned long __tmp1;
165+
166+ preempt_disable();
167+ __asm__ __volatile__(
168+ "arch_local_irq_restore\t%0"
169+ : "=r" (__tmp1)
170+ : "0" (flags)
171+ : "memory");
172+ preempt_enable();
173+}
174+EXPORT_SYMBOL(__arch_local_irq_restore);
175+
176+#endif /* !defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_MIPS_MT_SMTC) */
arch/mips/mm/tlb-r4k.c+4−14
@@ -120,18 +120,11 @@ void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, · 119 unmodified lines
120120
121121 if (cpu_context(cpu, mm) != 0) {
122122 unsigned long size, flags;
123− int huge = is_vm_hugetlb_page(vma);
124123
125124 ENTER_CRITICAL(flags);
126− if (huge) {
127− start = round_down(start, HPAGE_SIZE);
128− end = round_up(end, HPAGE_SIZE);
129− size = (end - start) >> HPAGE_SHIFT;
130− } else {
131− start = round_down(start, PAGE_SIZE << 1);
132− end = round_up(end, PAGE_SIZE << 1);
133− size = (end - start) >> (PAGE_SHIFT + 1);
134− }
125+ start = round_down(start, PAGE_SIZE << 1);
126+ end = round_up(end, PAGE_SIZE << 1);
127+ size = (end - start) >> (PAGE_SHIFT + 1);
135128 if (size <= current_cpu_data.tlbsize/2) {
136129 int oldpid = read_c0_entryhi();
137130 int newpid = cpu_asid(cpu, mm);
@@ -140,10 +133,7 @@ void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, · 2 unmodified lines
140133 int idx;
141134
142135 write_c0_entryhi(start | newpid);
143− if (huge)
144− start += HPAGE_SIZE;
145− else
146− start += (PAGE_SIZE << 1);
136+ start += (PAGE_SIZE << 1);
147137 mtc0_tlbw_hazard();
148138 tlb_probe();
149139 tlb_probe_hazard();
arch/mips/mti-malta/malta-platform.c+2−1
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include <linux/mtd/partitions.h>
3030 #include <linux/mtd/physmap.h>
3131 #include <linux/platform_device.h>
32+#include <asm/mips-boards/maltaint.h>
3233 #include <mtd/mtd-abi.h>
3334
3435 #define SMC_PORT(base, int) \
@@ -48,7 +49,7 @@ static struct plat_serial8250_port uart8250_data[] = { · 13 unmodified lines
4849 SMC_PORT(0x2F8, 3),
4950 {
5051 .mapbase = 0x1f000900, /* The CBUS UART */
51− .irq = MIPS_CPU_IRQ_BASE + 2,
52+ .irq = MIPS_CPU_IRQ_BASE + MIPSCPU_INT_MB2,
5253 .uartclk = 3686400, /* Twice the usual clk! */
5354 .iotype = UPIO_MEM32,
5455 .flags = CBUS_UART_FLAGS,
arch/openrisc/kernel/signal.c+2−4
@@ -84,7 +84,6 @@ asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs) · 83 unmodified lines
8484 {
8585 struct rt_sigframe *frame = (struct rt_sigframe __user *)regs->sp;
8686 sigset_t set;
87− stack_t st;
8887
8988 /*
9089 * Since we stacked the signal on a dword boundary,
@@ -104,11 +103,10 @@ asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs) · 13 unmodified lines
104103 if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
105104 goto badframe;
106105
107− if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st)))
108− goto badframe;
109106 /* It is more difficult to avoid calling this function than to
110107 call it and ignore errors. */
111− do_sigaltstack(&st, NULL, regs->sp);
108+ if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT)
109+ goto badframe;
112110
113111 return regs->gpr[11];
114112
arch/parisc/kernel/signal32.c+4−2
@@ -65,7 +65,8 @@ put_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz) · 64 unmodified lines
6565 {
6666 compat_sigset_t s;
6767
68− if (sz != sizeof *set) panic("put_sigset32()");
68+ if (sz != sizeof *set)
69+ return -EINVAL;
6970 sigset_64to32(&s, set);
7071
7172 return copy_to_user(up, &s, sizeof s);
@@ -77,7 +78,8 @@ get_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz) · 5 unmodified lines
7778 compat_sigset_t s;
7879 int r;
7980
80− if (sz != sizeof *set) panic("put_sigset32()");
81+ if (sz != sizeof *set)
82+ return -EINVAL;
8183
8284 if ((r = copy_from_user(&s, up, sz)) == 0) {
8385 sigset_32to64(set, &s);
arch/parisc/kernel/sys_parisc.c+2−0
@@ -73,6 +73,8 @@ static unsigned long get_shared_area(struct address_space *mapping, · 72 unmodified lines
7373 struct vm_area_struct *vma;
7474 int offset = mapping ? get_offset(mapping) : 0;
7575
76+ offset = (offset + (pgoff << PAGE_SHIFT)) & 0x3FF000;
77+
7678 addr = DCACHE_ALIGN(addr - offset) + offset;
7779
7880 for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) {
arch/parisc/kernel/syscall_table.S+1−1
@@ -60,7 +60,7 @@ · 59 unmodified lines
6060 ENTRY_SAME(fork_wrapper)
6161 ENTRY_SAME(read)
6262 ENTRY_SAME(write)
63− ENTRY_SAME(open) /* 5 */
63+ ENTRY_COMP(open) /* 5 */
6464 ENTRY_SAME(close)
6565 ENTRY_SAME(waitpid)
6666 ENTRY_SAME(creat)
arch/powerpc/boot/dts/mpc5200b.dtsi+6−0
@@ -231,6 +231,12 @@ · 230 unmodified lines
231231 interrupts = <2 7 0>;
232232 };
233233
234+ sclpc@3c00 {
235+ compatible = "fsl,mpc5200-lpbfifo";
236+ reg = <0x3c00 0x60>;
237+ interrupts = <2 23 0>;
238+ };
239+
234240 i2c@3d00 {
235241 #address-cells = <1>;
236242 #size-cells = <0>;
arch/powerpc/boot/dts/o2d.dtsi+0−6
@@ -86,12 +86,6 @@ · 85 unmodified lines
8686 reg = <0>;
8787 };
8888 };
89−
90− sclpc@3c00 {
91− compatible = "fsl,mpc5200-lpbfifo";
92− reg = <0x3c00 0x60>;
93− interrupts = <3 23 0>;
94− };
9589 };
9690
9791 localbus {
arch/powerpc/boot/dts/pcm030.dts+6−1
@@ -59,7 +59,7 @@ · 58 unmodified lines
5959 #gpio-cells = <2>;
6060 };
6161
62− psc@2000 { /* PSC1 in ac97 mode */
62+ audioplatform: psc@2000 { /* PSC1 in ac97 mode */
6363 compatible = "mpc5200b-psc-ac97","fsl,mpc5200b-psc-ac97";
6464 cell-index = <0>;
6565 };
@@ -134,4 +134,9 @@ · 68 unmodified lines
134134 localbus {
135135 status = "disabled";
136136 };
137+
138+ sound {
139+ compatible = "phytec,pcm030-audio-fabric";
140+ asoc-platform = <&audioplatform>;
141+ };
137142 };
arch/powerpc/platforms/52xx/mpc52xx_pic.c+5−4
@@ -372,10 +372,11 @@ static int mpc52xx_irqhost_map(struct irq_domain *h, unsigned int virq, · 371 unmodified lines
372372 case MPC52xx_IRQ_L1_MAIN: irqchip = &mpc52xx_main_irqchip; break;
373373 case MPC52xx_IRQ_L1_PERP: irqchip = &mpc52xx_periph_irqchip; break;
374374 case MPC52xx_IRQ_L1_SDMA: irqchip = &mpc52xx_sdma_irqchip; break;
375− default:
376− pr_err("%s: invalid irq: virq=%i, l1=%i, l2=%i\n",
377− __func__, virq, l1irq, l2irq);
378− return -EINVAL;
375+ case MPC52xx_IRQ_L1_CRIT:
376+ pr_warn("%s: Critical IRQ #%d is unsupported! Nopping it.\n",
377+ __func__, l2irq);
378+ irq_set_chip(virq, &no_irq_chip);
379+ return 0;
379380 }
380381
381382 irq_set_chip_and_handler(virq, irqchip, handle_level_irq);
arch/powerpc/platforms/pseries/eeh_pe.c+1−1
@@ -449,7 +449,7 @@ int eeh_rmv_from_parent_pe(struct eeh_dev *edev, int purge_pe) · 448 unmodified lines
449449 if (list_empty(&pe->edevs)) {
450450 cnt = 0;
451451 list_for_each_entry(child, &pe->child_list, child) {
452− if (!(pe->type & EEH_PE_INVALID)) {
452+ if (!(child->type & EEH_PE_INVALID)) {
453453 cnt++;
454454 break;
455455 }
arch/powerpc/platforms/pseries/msi.c+2−1
@@ -220,7 +220,8 @@ static struct device_node *find_pe_dn(struct pci_dev *dev, int *total) · 219 unmodified lines
220220
221221 /* Get the top level device in the PE */
222222 edev = of_node_to_eeh_dev(dn);
223− edev = list_first_entry(&edev->pe->edevs, struct eeh_dev, list);
223+ if (edev->pe)
224+ edev = list_first_entry(&edev->pe->edevs, struct eeh_dev, list);
224225 dn = eeh_dev_to_of_node(edev);
225226 if (!dn)
226227 return NULL;
arch/s390/Kconfig+1−0
@@ -96,6 +96,7 @@ config S390 · 95 unmodified lines
9696 select HAVE_MEMBLOCK_NODE_MAP
9797 select HAVE_CMPXCHG_LOCAL
9898 select HAVE_CMPXCHG_DOUBLE
99+ select HAVE_ALIGNED_STRUCT_PAGE if SLUB
99100 select HAVE_VIRT_CPU_ACCOUNTING
100101 select VIRT_CPU_ACCOUNTING
101102 select ARCH_DISCARD_MEMBLOCK
arch/s390/include/asm/cio.h+2−0
@@ -9,6 +9,8 @@ · 8 unmodified lines
99
1010 #define LPM_ANYPATH 0xff
1111 #define __MAX_CSSID 0
12+#define __MAX_SUBCHANNEL 65535
13+#define __MAX_SSID 3
1214
1315 #include <asm/scsw.h>
1416
arch/s390/include/asm/compat.h+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 #define PSW32_MASK_CC 0x00003000UL
2121 #define PSW32_MASK_PM 0x00000f00UL
2222
23−#define PSW32_MASK_USER 0x00003F00UL
23+#define PSW32_MASK_USER 0x0000FF00UL
2424
2525 #define PSW32_ADDR_AMODE 0x80000000UL
2626 #define PSW32_ADDR_INSN 0x7FFFFFFFUL
arch/s390/include/asm/pgtable.h+22−13
@@ -506,12 +506,15 @@ static inline int pud_bad(pud_t pud) · 505 unmodified lines
506506
507507 static inline int pmd_present(pmd_t pmd)
508508 {
509− return (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN) != 0UL;
509+ unsigned long mask = _SEGMENT_ENTRY_INV | _SEGMENT_ENTRY_RO;
510+ return (pmd_val(pmd) & mask) == _HPAGE_TYPE_NONE ||
511+ !(pmd_val(pmd) & _SEGMENT_ENTRY_INV);
510512 }
511513
512514 static inline int pmd_none(pmd_t pmd)
513515 {
514− return (pmd_val(pmd) & _SEGMENT_ENTRY_INV) != 0UL;
516+ return (pmd_val(pmd) & _SEGMENT_ENTRY_INV) &&
517+ !(pmd_val(pmd) & _SEGMENT_ENTRY_RO);
515518 }
516519
517520 static inline int pmd_large(pmd_t pmd)
@@ -1223,6 +1226,11 @@ static inline void __pmd_idte(unsigned long address, pmd_t *pmdp) · 705 unmodified lines
12231226 }
12241227
12251228 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
1229+
1230+#define SEGMENT_NONE __pgprot(_HPAGE_TYPE_NONE)
1231+#define SEGMENT_RO __pgprot(_HPAGE_TYPE_RO)
1232+#define SEGMENT_RW __pgprot(_HPAGE_TYPE_RW)
1233+
12261234 #define __HAVE_ARCH_PGTABLE_DEPOSIT
12271235 extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pgtable_t pgtable);
12281236
@@ -1242,16 +1250,15 @@ static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr, · 13 unmodified lines
12421250
12431251 static inline unsigned long massage_pgprot_pmd(pgprot_t pgprot)
12441252 {
1245− unsigned long pgprot_pmd = 0;
1246−
1247− if (pgprot_val(pgprot) & _PAGE_INVALID) {
1248− if (pgprot_val(pgprot) & _PAGE_SWT)
1249− pgprot_pmd |= _HPAGE_TYPE_NONE;
1250− pgprot_pmd |= _SEGMENT_ENTRY_INV;
1251− }
1252− if (pgprot_val(pgprot) & _PAGE_RO)
1253− pgprot_pmd |= _SEGMENT_ENTRY_RO;
1254− return pgprot_pmd;
1253+ /*
1254+ * pgprot is PAGE_NONE, PAGE_RO, or PAGE_RW (see __Pxxx / __Sxxx)
1255+ * Convert to segment table entry format.
1256+ */
1257+ if (pgprot_val(pgprot) == pgprot_val(PAGE_NONE))
1258+ return pgprot_val(SEGMENT_NONE);
1259+ if (pgprot_val(pgprot) == pgprot_val(PAGE_RO))
1260+ return pgprot_val(SEGMENT_RO);
1261+ return pgprot_val(SEGMENT_RW);
12551262 }
12561263
12571264 static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
@@ -1269,7 +1276,9 @@ static inline pmd_t pmd_mkhuge(pmd_t pmd) · 11 unmodified lines
12691276
12701277 static inline pmd_t pmd_mkwrite(pmd_t pmd)
12711278 {
1272− pmd_val(pmd) &= ~_SEGMENT_ENTRY_RO;
1279+ /* Do not clobber _HPAGE_TYPE_NONE pages! */
1280+ if (!(pmd_val(pmd) & _SEGMENT_ENTRY_INV))
1281+ pmd_val(pmd) &= ~_SEGMENT_ENTRY_RO;
12731282 return pmd;
12741283 }
12751284
arch/s390/include/asm/topology.h+3−0
@@ -8,6 +8,9 @@ struct cpu; · 7 unmodified lines
88
99 #ifdef CONFIG_SCHED_BOOK
1010
11+extern unsigned char cpu_socket_id[NR_CPUS];
12+#define topology_physical_package_id(cpu) (cpu_socket_id[cpu])
13+
1114 extern unsigned char cpu_core_id[NR_CPUS];
1215 extern cpumask_t cpu_core_map[NR_CPUS];
1316
arch/s390/include/uapi/asm/ptrace.h+2−2
@@ -239,7 +239,7 @@ typedef struct · 238 unmodified lines
239239 #define PSW_MASK_EA 0x00000000UL
240240 #define PSW_MASK_BA 0x00000000UL
241241
242−#define PSW_MASK_USER 0x00003F00UL
242+#define PSW_MASK_USER 0x0000FF00UL
243243
244244 #define PSW_ADDR_AMODE 0x80000000UL
245245 #define PSW_ADDR_INSN 0x7FFFFFFFUL
@@ -269,7 +269,7 @@ typedef struct · 23 unmodified lines
269269 #define PSW_MASK_EA 0x0000000100000000UL
270270 #define PSW_MASK_BA 0x0000000080000000UL
271271
272−#define PSW_MASK_USER 0x00003F8180000000UL
272+#define PSW_MASK_USER 0x0000FF8180000000UL
273273
274274 #define PSW_ADDR_AMODE 0x0000000000000000UL
275275 #define PSW_ADDR_INSN 0xFFFFFFFFFFFFFFFFUL
arch/s390/kernel/compat_signal.c+12−2
@@ -309,6 +309,10 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs) · 308 unmodified lines
309309 regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) |
310310 (__u64)(regs32.psw.mask & PSW32_MASK_USER) << 32 |
311311 (__u64)(regs32.psw.addr & PSW32_ADDR_AMODE);
312+ /* Check for invalid user address space control. */
313+ if ((regs->psw.mask & PSW_MASK_ASC) >= (psw_kernel_bits & PSW_MASK_ASC))
314+ regs->psw.mask = (psw_user_bits & PSW_MASK_ASC) |
315+ (regs->psw.mask & ~PSW_MASK_ASC);
312316 regs->psw.addr = (__u64)(regs32.psw.addr & PSW32_ADDR_INSN);
313317 for (i = 0; i < NUM_GPRS; i++)
314318 regs->gprs[i] = (__u64) regs32.gprs[i];
@@ -481,7 +485,10 @@ static int setup_frame32(int sig, struct k_sigaction *ka, · 166 unmodified lines
481485
482486 /* Set up registers for signal handler */
483487 regs->gprs[15] = (__force __u64) frame;
484− regs->psw.mask |= PSW_MASK_BA; /* force amode 31 */
488+ /* Force 31 bit amode and default user address space control. */
489+ regs->psw.mask = PSW_MASK_BA |
490+ (psw_user_bits & PSW_MASK_ASC) |
491+ (regs->psw.mask & ~PSW_MASK_ASC);
485492 regs->psw.addr = (__force __u64) ka->sa.sa_handler;
486493
487494 regs->gprs[2] = map_signal(sig);
@@ -549,7 +556,10 @@ static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info, · 61 unmodified lines
549556
550557 /* Set up registers for signal handler */
551558 regs->gprs[15] = (__force __u64) frame;
552− regs->psw.mask |= PSW_MASK_BA; /* force amode 31 */
559+ /* Force 31 bit amode and default user address space control. */
560+ regs->psw.mask = PSW_MASK_BA |
561+ (psw_user_bits & PSW_MASK_ASC) |
562+ (regs->psw.mask & ~PSW_MASK_ASC);
553563 regs->psw.addr = (__u64) ka->sa.sa_handler;
554564
555565 regs->gprs[2] = map_signal(sig);
arch/s390/kernel/compat_wrapper.S+1−1
@@ -28,7 +28,7 @@ ENTRY(sys32_open_wrapper) · 27 unmodified lines
2828 llgtr %r2,%r2 # const char *
2929 lgfr %r3,%r3 # int
3030 lgfr %r4,%r4 # int
31− jg sys_open # branch to system call
31+ jg compat_sys_open # branch to system call
3232
3333 ENTRY(sys32_close_wrapper)
3434 llgfr %r2,%r2 # unsigned int
arch/s390/kernel/sclp.S+7−1
@@ -44,6 +44,12 @@ _sclp_wait_int: · 43 unmodified lines
4444 #endif
4545 mvc .LoldpswS1-.LbaseS1(16,%r13),0(%r8)
4646 mvc 0(16,%r8),0(%r9)
47+#ifdef CONFIG_64BIT
48+ epsw %r6,%r7 # set current addressing mode
49+ nill %r6,0x1 # in new psw (31 or 64 bit mode)
50+ nilh %r7,0x8000
51+ stm %r6,%r7,0(%r8)
52+#endif
4753 lhi %r6,0x0200 # cr mask for ext int (cr0.54)
4854 ltr %r2,%r2
4955 jz .LsetctS1
@@ -87,7 +93,7 @@ _sclp_wait_int: · 37 unmodified lines
8793 .long 0x00080000, 0x80000000+.LwaitS1 # PSW to handle ext int
8894 #ifdef CONFIG_64BIT
8995 .LextpswS1_64:
90− .quad 0x0000000180000000, .LwaitS1 # PSW to handle ext int, 64 bit
96+ .quad 0, .LwaitS1 # PSW to handle ext int, 64 bit
9197 #endif
9298 .LwaitpswS1:
9399 .long 0x010a0000, 0x00000000+.LloopS1 # PSW to wait for ext int
arch/s390/kernel/signal.c+12−2
@@ -136,6 +136,10 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs) · 135 unmodified lines
136136 /* Use regs->psw.mask instead of psw_user_bits to preserve PER bit. */
137137 regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) |
138138 (user_sregs.regs.psw.mask & PSW_MASK_USER);
139+ /* Check for invalid user address space control. */
140+ if ((regs->psw.mask & PSW_MASK_ASC) >= (psw_kernel_bits & PSW_MASK_ASC))
141+ regs->psw.mask = (psw_user_bits & PSW_MASK_ASC) |
142+ (regs->psw.mask & ~PSW_MASK_ASC);
139143 /* Check for invalid amode */
140144 if (regs->psw.mask & PSW_MASK_EA)
141145 regs->psw.mask |= PSW_MASK_BA;
@@ -273,7 +277,10 @@ static int setup_frame(int sig, struct k_sigaction *ka, · 131 unmodified lines
273277
274278 /* Set up registers for signal handler */
275279 regs->gprs[15] = (unsigned long) frame;
276− regs->psw.mask |= PSW_MASK_EA | PSW_MASK_BA; /* 64 bit amode */
280+ /* Force default amode and default user address space control. */
281+ regs->psw.mask = PSW_MASK_EA | PSW_MASK_BA |
282+ (psw_user_bits & PSW_MASK_ASC) |
283+ (regs->psw.mask & ~PSW_MASK_ASC);
277284 regs->psw.addr = (unsigned long) ka->sa.sa_handler | PSW_ADDR_AMODE;
278285
279286 regs->gprs[2] = map_signal(sig);
@@ -346,7 +353,10 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, · 66 unmodified lines
346353
347354 /* Set up registers for signal handler */
348355 regs->gprs[15] = (unsigned long) frame;
349− regs->psw.mask |= PSW_MASK_EA | PSW_MASK_BA; /* 64 bit amode */
356+ /* Force default amode and default user address space control. */
357+ regs->psw.mask = PSW_MASK_EA | PSW_MASK_BA |
358+ (psw_user_bits & PSW_MASK_ASC) |
359+ (regs->psw.mask & ~PSW_MASK_ASC);
350360 regs->psw.addr = (unsigned long) ka->sa.sa_handler | PSW_ADDR_AMODE;
351361
352362 regs->gprs[2] = map_signal(sig);
arch/s390/kernel/topology.c+4−2
@@ -40,6 +40,7 @@ static DEFINE_SPINLOCK(topology_lock); · 39 unmodified lines
4040 static struct mask_info core_info;
4141 cpumask_t cpu_core_map[NR_CPUS];
4242 unsigned char cpu_core_id[NR_CPUS];
43+unsigned char cpu_socket_id[NR_CPUS];
4344
4445 static struct mask_info book_info;
4546 cpumask_t cpu_book_map[NR_CPUS];
@@ -83,11 +84,12 @@ static struct mask_info *add_cpus_to_mask(struct topology_cpu *tl_cpu, · 37 unmodified lines
8384 cpumask_set_cpu(lcpu, &book->mask);
8485 cpu_book_id[lcpu] = book->id;
8586 cpumask_set_cpu(lcpu, &core->mask);
87+ cpu_core_id[lcpu] = rcpu;
8688 if (one_core_per_cpu) {
87− cpu_core_id[lcpu] = rcpu;
89+ cpu_socket_id[lcpu] = rcpu;
8890 core = core->next;
8991 } else {
90− cpu_core_id[lcpu] = core->id;
92+ cpu_socket_id[lcpu] = core->id;
9193 }
9294 smp_cpu_set_polarization(lcpu, tl_cpu->pp);
9395 }
arch/s390/lib/uaccess_pt.c+1−1
@@ -39,7 +39,7 @@ static __always_inline unsigned long follow_table(struct mm_struct *mm, · 38 unmodified lines
3939 pmd = pmd_offset(pud, addr);
4040 if (pmd_none(*pmd))
4141 return -0x10UL;
42− if (pmd_huge(*pmd)) {
42+ if (pmd_large(*pmd)) {
4343 if (write && (pmd_val(*pmd) & _SEGMENT_ENTRY_RO))
4444 return -0x04UL;
4545 return (pmd_val(*pmd) & HPAGE_MASK) + (addr & ~HPAGE_MASK);
arch/s390/mm/gup.c+3−4
@@ -126,7 +126,7 @@ static inline int gup_pmd_range(pud_t *pudp, pud_t pud, unsigned long addr, · 125 unmodified lines
126126 */
127127 if (pmd_none(pmd) || pmd_trans_splitting(pmd))
128128 return 0;
129− if (unlikely(pmd_huge(pmd))) {
129+ if (unlikely(pmd_large(pmd))) {
130130 if (!gup_huge_pmd(pmdp, pmd, addr, next,
131131 write, pages, nr))
132132 return 0;
@@ -180,8 +180,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write, · 47 unmodified lines
180180 addr = start;
181181 len = (unsigned long) nr_pages << PAGE_SHIFT;
182182 end = start + len;
183− if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ,
184− (void __user *)start, len)))
183+ if ((end < start) || (end > TASK_SIZE))
185184 return 0;
186185
187186 local_irq_save(flags);
@@ -229,7 +228,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write, · 41 unmodified lines
229228 addr = start;
230229 len = (unsigned long) nr_pages << PAGE_SHIFT;
231230 end = start + len;
232− if (end < start)
231+ if ((end < start) || (end > TASK_SIZE))
233232 goto slow_irqon;
234233
235234 /*
arch/score/kernel/signal.c+2−5
@@ -148,7 +148,6 @@ score_rt_sigreturn(struct pt_regs *regs) · 147 unmodified lines
148148 {
149149 struct rt_sigframe __user *frame;
150150 sigset_t set;
151− stack_t st;
152151 int sig;
153152
154153 /* Always make any pending restarted system calls return -EINTR */
@@ -168,12 +167,10 @@ score_rt_sigreturn(struct pt_regs *regs) · 13 unmodified lines
168167 else if (sig)
169168 force_sig(sig, current);
170169
171− if (__copy_from_user(&st, &frame->rs_uc.uc_stack, sizeof(st)))
172− goto badframe;
173−
174170 /* It is more difficult to avoid calling this function than to
175171 call it and ignore errors. */
176− do_sigaltstack((stack_t __user *)&st, NULL, regs->regs[0]);
172+ if (do_sigaltstack(&frame->rs_uc.uc_stack, NULL, regs->regs[0]) == -EFAULT)
173+ goto badframe;
177174 regs->is_syscall = 0;
178175
179176 __asm__ __volatile__(
arch/sh/kernel/signal_64.c+2−4
@@ -347,7 +347,6 @@ asmlinkage int sys_rt_sigreturn(unsigned long r2, unsigned long r3, · 346 unmodified lines
347347 {
348348 struct rt_sigframe __user *frame = (struct rt_sigframe __user *) (long) REF_REG_SP;
349349 sigset_t set;
350− stack_t __user st;
351350 long long ret;
352351
353352 /* Always make any pending restarted system calls return -EINTR */
@@ -365,11 +364,10 @@ asmlinkage int sys_rt_sigreturn(unsigned long r2, unsigned long r3, · 11 unmodified lines
365364 goto badframe;
366365 regs->pc -= 4;
367366
368− if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st)))
369− goto badframe;
370367 /* It is more difficult to avoid calling this function than to
371368 call it and ignore errors. */
372− do_sigaltstack(&st, NULL, REF_REG_SP);
369+ if (do_sigaltstack(&frame->uc.uc_stack, NULL, REF_REG_SP) == -EFAULT)
370+ goto badframe;
373371
374372 return (int) ret;
375373
arch/sparc/Kconfig+1−0
@@ -20,6 +20,7 @@ config SPARC · 19 unmodified lines
2020 select HAVE_ARCH_TRACEHOOK
2121 select SYSCTL_EXCEPTION_TRACE
2222 select ARCH_WANT_OPTIONAL_GPIOLIB
23+ select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
2324 select RTC_CLASS
2425 select RTC_DRV_M48T59
2526 select HAVE_IRQ_WORK
arch/sparc/boot/piggyback.c+6−6
@@ -81,18 +81,18 @@ static void usage(void) · 80 unmodified lines
8181
8282 static int start_line(const char *line)
8383 {
84− if (strcmp(line + 8, " T _start\n") == 0)
84+ if (strcmp(line + 10, " _start\n") == 0)
8585 return 1;
86− else if (strcmp(line + 16, " T _start\n") == 0)
86+ else if (strcmp(line + 18, " _start\n") == 0)
8787 return 1;
8888 return 0;
8989 }
9090
9191 static int end_line(const char *line)
9292 {
93− if (strcmp(line + 8, " A _end\n") == 0)
93+ if (strcmp(line + 10, " _end\n") == 0)
9494 return 1;
95− else if (strcmp (line + 16, " A _end\n") == 0)
95+ else if (strcmp (line + 18, " _end\n") == 0)
9696 return 1;
9797 return 0;
9898 }
@@ -100,8 +100,8 @@ static int end_line(const char *line) · 1 unmodified line
100100 /*
101101 * Find address for start and end in System.map.
102102 * The file looks like this:
103− * f0004000 T _start
104− * f0379f79 A _end
103+ * f0004000 ... _start
104+ * f0379f79 ... _end
105105 * 1234567890123456
106106 * ^coloumn 1
107107 * There is support for 64 bit addresses too.
arch/sparc/crypto/Makefile+8−8
@@ -13,13 +13,13 @@ obj-$(CONFIG_CRYPTO_DES_SPARC64) += camellia-sparc64.o · 12 unmodified lines
1313
1414 obj-$(CONFIG_CRYPTO_CRC32C_SPARC64) += crc32c-sparc64.o
1515
16−sha1-sparc64-y := sha1_asm.o sha1_glue.o crop_devid.o
17−sha256-sparc64-y := sha256_asm.o sha256_glue.o crop_devid.o
18−sha512-sparc64-y := sha512_asm.o sha512_glue.o crop_devid.o
19−md5-sparc64-y := md5_asm.o md5_glue.o crop_devid.o
16+sha1-sparc64-y := sha1_asm.o sha1_glue.o
17+sha256-sparc64-y := sha256_asm.o sha256_glue.o
18+sha512-sparc64-y := sha512_asm.o sha512_glue.o
19+md5-sparc64-y := md5_asm.o md5_glue.o
2020
21−aes-sparc64-y := aes_asm.o aes_glue.o crop_devid.o
22−des-sparc64-y := des_asm.o des_glue.o crop_devid.o
23−camellia-sparc64-y := camellia_asm.o camellia_glue.o crop_devid.o
21+aes-sparc64-y := aes_asm.o aes_glue.o
22+des-sparc64-y := des_asm.o des_glue.o
23+camellia-sparc64-y := camellia_asm.o camellia_glue.o
2424
25−crc32c-sparc64-y := crc32c_asm.o crc32c_glue.o crop_devid.o
25+crc32c-sparc64-y := crc32c_asm.o crc32c_glue.o
arch/sparc/crypto/aes_glue.c+2−0
@@ -475,3 +475,5 @@ MODULE_LICENSE("GPL"); · 474 unmodified lines
475475 MODULE_DESCRIPTION("AES Secure Hash Algorithm, sparc64 aes opcode accelerated");
476476
477477 MODULE_ALIAS("aes");
478+
479+#include "crop_devid.c"
arch/sparc/crypto/camellia_glue.c+2−0
@@ -320,3 +320,5 @@ MODULE_LICENSE("GPL"); · 319 unmodified lines
320320 MODULE_DESCRIPTION("Camellia Cipher Algorithm, sparc64 camellia opcode accelerated");
321321
322322 MODULE_ALIAS("aes");
323+
324+#include "crop_devid.c"
arch/sparc/crypto/crc32c_glue.c+2−0
@@ -177,3 +177,5 @@ MODULE_LICENSE("GPL"); · 176 unmodified lines
177177 MODULE_DESCRIPTION("CRC32c (Castagnoli), sparc64 crc32c opcode accelerated");
178178
179179 MODULE_ALIAS("crc32c");
180+
181+#include "crop_devid.c"
arch/sparc/crypto/des_glue.c+2−0
@@ -527,3 +527,5 @@ MODULE_LICENSE("GPL"); · 526 unmodified lines
527527 MODULE_DESCRIPTION("DES & Triple DES EDE Cipher Algorithms, sparc64 des opcode accelerated");
528528
529529 MODULE_ALIAS("des");
530+
531+#include "crop_devid.c"
arch/sparc/crypto/md5_glue.c+2−0
@@ -186,3 +186,5 @@ MODULE_LICENSE("GPL"); · 185 unmodified lines
186186 MODULE_DESCRIPTION("MD5 Secure Hash Algorithm, sparc64 md5 opcode accelerated");
187187
188188 MODULE_ALIAS("md5");
189+
190+#include "crop_devid.c"
arch/sparc/crypto/sha1_glue.c+2−0
@@ -181,3 +181,5 @@ MODULE_LICENSE("GPL"); · 180 unmodified lines
181181 MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm, sparc64 sha1 opcode accelerated");
182182
183183 MODULE_ALIAS("sha1");
184+
185+#include "crop_devid.c"
arch/sparc/crypto/sha256_glue.c+2−0
@@ -239,3 +239,5 @@ MODULE_DESCRIPTION("SHA-224 and SHA-256 Secure Hash Algorithm, sparc64 sha256 op · 238 unmodified lines
239239
240240 MODULE_ALIAS("sha224");
241241 MODULE_ALIAS("sha256");
242+
243+#include "crop_devid.c"
arch/sparc/crypto/sha512_glue.c+2−0
@@ -224,3 +224,5 @@ MODULE_DESCRIPTION("SHA-384 and SHA-512 Secure Hash Algorithm, sparc64 sha512 op · 223 unmodified lines
224224
225225 MODULE_ALIAS("sha384");
226226 MODULE_ALIAS("sha512");
227+
228+#include "crop_devid.c"
arch/sparc/include/asm/atomic_64.h+3−1
@@ -1,7 +1,7 @@
11 /* atomic.h: Thankfully the V9 is at least reasonable for this
22 * stuff.
33 *
4− * Copyright (C) 1996, 1997, 2000 David S. Miller (davem@redhat.com)
4+ * Copyright (C) 1996, 1997, 2000, 2012 David S. Miller (davem@redhat.com)
55 */
66
77 #ifndef __ARCH_SPARC64_ATOMIC__
@@ -106,6 +106,8 @@ static inline long atomic64_add_unless(atomic64_t *v, long a, long u) · 98 unmodified lines
106106
107107 #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
108108
109+extern long atomic64_dec_if_positive(atomic64_t *v);
110+
109111 /* Atomic operations are already serializing */
110112 #define smp_mb__before_atomic_dec() barrier()
111113 #define smp_mb__after_atomic_dec() barrier()
arch/sparc/include/asm/backoff.h+59−10
@@ -1,6 +1,46 @@
11 #ifndef _SPARC64_BACKOFF_H
22 #define _SPARC64_BACKOFF_H
33
4+/* The macros in this file implement an exponential backoff facility
5+ * for atomic operations.
6+ *
7+ * When multiple threads compete on an atomic operation, it is
8+ * possible for one thread to be continually denied a successful
9+ * completion of the compare-and-swap instruction. Heavily
10+ * threaded cpu implementations like Niagara can compound this
11+ * problem even further.
12+ *
13+ * When an atomic operation fails and needs to be retried, we spin a
14+ * certain number of times. At each subsequent failure of the same
15+ * operation we double the spin count, realizing an exponential
16+ * backoff.
17+ *
18+ * When we spin, we try to use an operation that will cause the
19+ * current cpu strand to block, and therefore make the core fully
20+ * available to any other other runnable strands. There are two
21+ * options, based upon cpu capabilities.
22+ *
23+ * On all cpus prior to SPARC-T4 we do three dummy reads of the
24+ * condition code register. Each read blocks the strand for something
25+ * between 40 and 50 cpu cycles.
26+ *
27+ * For SPARC-T4 and later we have a special "pause" instruction
28+ * available. This is implemented using writes to register %asr27.
29+ * The cpu will block the number of cycles written into the register,
30+ * unless a disrupting trap happens first. SPARC-T4 specifically
31+ * implements pause with a granularity of 8 cycles. Each strand has
32+ * an internal pause counter which decrements every 8 cycles. So the
33+ * chip shifts the %asr27 value down by 3 bits, and writes the result
34+ * into the pause counter. If a value smaller than 8 is written, the
35+ * chip blocks for 1 cycle.
36+ *
37+ * To achieve the same amount of backoff as the three %ccr reads give
38+ * on earlier chips, we shift the backoff value up by 7 bits. (Three
39+ * %ccr reads block for about 128 cycles, 1 << 7 == 128) We write the
40+ * whole amount we want to block into the pause register, rather than
41+ * loop writing 128 each time.
42+ */
43+
444 #define BACKOFF_LIMIT (4 * 1024)
545
646 #ifdef CONFIG_SMP
@@ -11,16 +51,25 @@ · 4 unmodified lines
1151 #define BACKOFF_LABEL(spin_label, continue_label) \
1252 spin_label
1353
14−#define BACKOFF_SPIN(reg, tmp, label) \
15− mov reg, tmp; \
16−88: brnz,pt tmp, 88b; \
17− sub tmp, 1, tmp; \
18− set BACKOFF_LIMIT, tmp; \
19− cmp reg, tmp; \
20− bg,pn %xcc, label; \
21− nop; \
22− ba,pt %xcc, label; \
23− sllx reg, 1, reg;
54+#define BACKOFF_SPIN(reg, tmp, label) \
55+ mov reg, tmp; \
56+88: rd %ccr, %g0; \
57+ rd %ccr, %g0; \
58+ rd %ccr, %g0; \
59+ .section .pause_3insn_patch,"ax";\
60+ .word 88b; \
61+ sllx tmp, 7, tmp; \
62+ wr tmp, 0, %asr27; \
63+ clr tmp; \
64+ .previous; \
65+ brnz,pt tmp, 88b; \
66+ sub tmp, 1, tmp; \
67+ set BACKOFF_LIMIT, tmp; \
68+ cmp reg, tmp; \
69+ bg,pn %xcc, label; \
70+ nop; \
71+ ba,pt %xcc, label; \
72+ sllx reg, 1, reg;
2473
2574 #else
2675
arch/sparc/include/asm/compat.h+3−2
@@ -232,9 +232,10 @@ static inline void __user *arch_compat_alloc_user_space(long len) · 231 unmodified lines
232232 struct pt_regs *regs = current_thread_info()->kregs;
233233 unsigned long usp = regs->u_regs[UREG_I6];
234234
235− if (!(test_thread_flag(TIF_32BIT)))
235+ if (test_thread_64bit_stack(usp))
236236 usp += STACK_BIAS;
237− else
237+
238+ if (test_thread_flag(TIF_32BIT))
238239 usp &= 0xffffffffUL;
239240
240241 usp -= len;
arch/sparc/include/asm/processor_64.h+16−1
@@ -196,7 +196,22 @@ extern unsigned long get_wchan(struct task_struct *task); · 195 unmodified lines
196196 #define KSTK_EIP(tsk) (task_pt_regs(tsk)->tpc)
197197 #define KSTK_ESP(tsk) (task_pt_regs(tsk)->u_regs[UREG_FP])
198198
199−#define cpu_relax() barrier()
199+/* Please see the commentary in asm/backoff.h for a description of
200+ * what these instructions are doing and how they have been choosen.
201+ * To make a long story short, we are trying to yield the current cpu
202+ * strand during busy loops.
203+ */
204+#define cpu_relax() asm volatile("\n99:\n\t" \
205+ "rd %%ccr, %%g0\n\t" \
206+ "rd %%ccr, %%g0\n\t" \
207+ "rd %%ccr, %%g0\n\t" \
208+ ".section .pause_3insn_patch,\"ax\"\n\t"\
209+ ".word 99b\n\t" \
210+ "wr %%g0, 128, %%asr27\n\t" \
211+ "nop\n\t" \
212+ "nop\n\t" \
213+ ".previous" \
214+ ::: "memory")
200215
201216 /* Prefetch support. This is tuned for UltraSPARC-III and later.
202217 * UltraSPARC-I will treat these as nops, and UltraSPARC-II has
arch/sparc/include/asm/prom.h+8−0
@@ -63,5 +63,13 @@ extern char *of_console_options; · 62 unmodified lines
6363 extern void irq_trans_init(struct device_node *dp);
6464 extern char *build_path_component(struct device_node *dp);
6565
66+/* SPARC has local implementations */
67+extern int of_address_to_resource(struct device_node *dev, int index,
68+ struct resource *r);
69+#define of_address_to_resource of_address_to_resource
70+
71+void __iomem *of_iomap(struct device_node *node, int index);
72+#define of_iomap of_iomap
73+
6674 #endif /* __KERNEL__ */
6775 #endif /* _SPARC_PROM_H */
arch/sparc/include/asm/thread_info_64.h+5−0
@@ -259,6 +259,11 @@ static inline bool test_and_clear_restore_sigmask(void) · 258 unmodified lines
259259
260260 #define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG)
261261
262+#define thread32_stack_is_64bit(__SP) (((__SP) & 0x1) != 0)
263+#define test_thread_64bit_stack(__SP) \
264+ ((test_thread_flag(TIF_32BIT) && !thread32_stack_is_64bit(__SP)) ? \
265+ false : true)
266+
262267 #endif /* !__ASSEMBLY__ */
263268
264269 #endif /* __KERNEL__ */
arch/sparc/include/asm/ttable.h+16−8
@@ -372,7 +372,9 @@ etrap_spill_fixup_64bit: \ · 371 unmodified lines
372372
373373 /* Normal 32bit spill */
374374 #define SPILL_2_GENERIC(ASI) \
375− srl %sp, 0, %sp; \
375+ and %sp, 1, %g3; \
376+ brnz,pn %g3, (. - (128 + 4)); \
377+ srl %sp, 0, %sp; \
376378 stwa %l0, [%sp + %g0] ASI; \
377379 mov 0x04, %g3; \
378380 stwa %l1, [%sp + %g3] ASI; \
@@ -398,14 +400,16 @@ etrap_spill_fixup_64bit: \ · 19 unmodified lines
398400 stwa %i6, [%g1 + %g0] ASI; \
399401 stwa %i7, [%g1 + %g3] ASI; \
400402 saved; \
401− retry; nop; nop; \
403+ retry; \
402404 b,a,pt %xcc, spill_fixup_dax; \
403405 b,a,pt %xcc, spill_fixup_mna; \
404406 b,a,pt %xcc, spill_fixup;
405407
406408 #define SPILL_2_GENERIC_ETRAP \
407409 etrap_user_spill_32bit: \
408− srl %sp, 0, %sp; \
410+ and %sp, 1, %g3; \
411+ brnz,pn %g3, etrap_user_spill_64bit; \
412+ srl %sp, 0, %sp; \
409413 stwa %l0, [%sp + 0x00] %asi; \
410414 stwa %l1, [%sp + 0x04] %asi; \
411415 stwa %l2, [%sp + 0x08] %asi; \
@@ -427,7 +431,7 @@ etrap_user_spill_32bit: \ · 15 unmodified lines
427431 ba,pt %xcc, etrap_save; \
428432 wrpr %g1, %cwp; \
429433 nop; nop; nop; nop; \
430− nop; nop; nop; nop; \
434+ nop; nop; \
431435 ba,a,pt %xcc, etrap_spill_fixup_32bit; \
432436 ba,a,pt %xcc, etrap_spill_fixup_32bit; \
433437 ba,a,pt %xcc, etrap_spill_fixup_32bit;
@@ -592,7 +596,9 @@ user_rtt_fill_64bit: \ · 158 unmodified lines
592596
593597 /* Normal 32bit fill */
594598 #define FILL_2_GENERIC(ASI) \
595− srl %sp, 0, %sp; \
599+ and %sp, 1, %g3; \
600+ brnz,pn %g3, (. - (128 + 4)); \
601+ srl %sp, 0, %sp; \
596602 lduwa [%sp + %g0] ASI, %l0; \
597603 mov 0x04, %g2; \
598604 mov 0x08, %g3; \
@@ -616,14 +622,16 @@ user_rtt_fill_64bit: \ · 17 unmodified lines
616622 lduwa [%g1 + %g3] ASI, %i6; \
617623 lduwa [%g1 + %g5] ASI, %i7; \
618624 restored; \
619− retry; nop; nop; nop; nop; \
625+ retry; nop; nop; \
620626 b,a,pt %xcc, fill_fixup_dax; \
621627 b,a,pt %xcc, fill_fixup_mna; \
622628 b,a,pt %xcc, fill_fixup;
623629
624630 #define FILL_2_GENERIC_RTRAP \
625631 user_rtt_fill_32bit: \
626− srl %sp, 0, %sp; \
632+ and %sp, 1, %g3; \
633+ brnz,pn %g3, user_rtt_fill_64bit; \
634+ srl %sp, 0, %sp; \
627635 lduwa [%sp + 0x00] %asi, %l0; \
628636 lduwa [%sp + 0x04] %asi, %l1; \
629637 lduwa [%sp + 0x08] %asi, %l2; \
@@ -643,7 +651,7 @@ user_rtt_fill_32bit: \ · 13 unmodified lines
643651 ba,pt %xcc, user_rtt_pre_restore; \
644652 restored; \
645653 nop; nop; nop; nop; nop; \
646− nop; nop; nop; nop; nop; \
654+ nop; nop; nop; \
647655 ba,a,pt %xcc, user_rtt_fill_fixup; \
648656 ba,a,pt %xcc, user_rtt_fill_fixup; \
649657 ba,a,pt %xcc, user_rtt_fill_fixup;
arch/sparc/include/uapi/asm/unistd.h+6−1
@@ -405,8 +405,13 @@ · 404 unmodified lines
405405 #define __NR_setns 337
406406 #define __NR_process_vm_readv 338
407407 #define __NR_process_vm_writev 339
408+#define __NR_kern_features 340
409+#define __NR_kcmp 341
408410
409−#define NR_syscalls 340
411+#define NR_syscalls 342
412+
413+/* Bitmask values returned from kern_features system call. */
414+#define KERN_FEATURE_MIXED_MODE_STACK 0x00000001
410415
411416 #ifdef __32bit_syscall_numbers__
412417 /* Sparc 32-bit only has the "setresuid32", "getresuid32" variants,
arch/sparc/kernel/entry.h+7−0
@@ -59,6 +59,13 @@ struct popc_6insn_patch_entry { · 58 unmodified lines
5959 extern struct popc_6insn_patch_entry __popc_6insn_patch,
6060 __popc_6insn_patch_end;
6161
62+struct pause_patch_entry {
63+ unsigned int addr;
64+ unsigned int insns[3];
65+};
66+extern struct pause_patch_entry __pause_3insn_patch,
67+ __pause_3insn_patch_end;
68+
6269 extern void __init per_cpu_patch(void);
6370 extern void sun4v_patch_1insn_range(struct sun4v_1insn_patch_entry *,
6471 struct sun4v_1insn_patch_entry *);
arch/sparc/kernel/leon_kernel.c+4−2
@@ -56,11 +56,13 @@ static inline unsigned int leon_eirq_get(int cpu) · 55 unmodified lines
5656 static void leon_handle_ext_irq(unsigned int irq, struct irq_desc *desc)
5757 {
5858 unsigned int eirq;
59+ struct irq_bucket *p;
5960 int cpu = sparc_leon3_cpuid();
6061
6162 eirq = leon_eirq_get(cpu);
62− if ((eirq & 0x10) && irq_map[eirq]->irq) /* bit4 tells if IRQ happened */
63− generic_handle_irq(irq_map[eirq]->irq);
63+ p = irq_map[eirq];
64+ if ((eirq & 0x10) && p && p->irq) /* bit4 tells if IRQ happened */
65+ generic_handle_irq(p->irq);
6466 }
6567
6668 /* The extended IRQ controller has been found, this function registers it */
arch/sparc/kernel/perf_event.c+16−6
@@ -1762,15 +1762,25 @@ static void perf_callchain_user_32(struct perf_callchain_entry *entry, · 1761 unmodified lines
17621762
17631763 ufp = regs->u_regs[UREG_I6] & 0xffffffffUL;
17641764 do {
1765− struct sparc_stackf32 *usf, sf;
17661765 unsigned long pc;
17671766
1768− usf = (struct sparc_stackf32 *) ufp;
1769− if (__copy_from_user_inatomic(&sf, usf, sizeof(sf)))
1770− break;
1767+ if (thread32_stack_is_64bit(ufp)) {
1768+ struct sparc_stackf *usf, sf;
17711769
1772− pc = sf.callers_pc;
1773− ufp = (unsigned long)sf.fp;
1770+ ufp += STACK_BIAS;
1771+ usf = (struct sparc_stackf *) ufp;
1772+ if (__copy_from_user_inatomic(&sf, usf, sizeof(sf)))
1773+ break;
1774+ pc = sf.callers_pc & 0xffffffff;
1775+ ufp = ((unsigned long) sf.fp) & 0xffffffff;
1776+ } else {
1777+ struct sparc_stackf32 *usf, sf;
1778+ usf = (struct sparc_stackf32 *) ufp;
1779+ if (__copy_from_user_inatomic(&sf, usf, sizeof(sf)))
1780+ break;
1781+ pc = sf.callers_pc;
1782+ ufp = (unsigned long)sf.fp;
1783+ }
17741784 perf_callchain_store(entry, pc);
17751785 } while (entry->nr < PERF_MAX_STACK_DEPTH);
17761786 }
arch/sparc/kernel/process_64.c+23−19
@@ -452,13 +452,16 @@ void flush_thread(void) · 451 unmodified lines
452452 /* It's a bit more tricky when 64-bit tasks are involved... */
453453 static unsigned long clone_stackframe(unsigned long csp, unsigned long psp)
454454 {
455+ bool stack_64bit = test_thread_64bit_stack(psp);
455456 unsigned long fp, distance, rval;
456457
457− if (!(test_thread_flag(TIF_32BIT))) {
458+ if (stack_64bit) {
458459 csp += STACK_BIAS;
459460 psp += STACK_BIAS;
460461 __get_user(fp, &(((struct reg_window __user *)psp)->ins[6]));
461462 fp += STACK_BIAS;
463+ if (test_thread_flag(TIF_32BIT))
464+ fp &= 0xffffffff;
462465 } else
463466 __get_user(fp, &(((struct reg_window32 __user *)psp)->ins[6]));
464467
@@ -472,7 +475,7 @@ static unsigned long clone_stackframe(unsigned long csp, unsigned long psp) · 7 unmodified lines
472475 rval = (csp - distance);
473476 if (copy_in_user((void __user *) rval, (void __user *) psp, distance))
474477 rval = 0;
475− else if (test_thread_flag(TIF_32BIT)) {
478+ else if (!stack_64bit) {
476479 if (put_user(((u32)csp),
477480 &(((struct reg_window32 __user *)rval)->ins[6])))
478481 rval = 0;
@@ -507,18 +510,18 @@ void synchronize_user_stack(void) · 28 unmodified lines
507510
508511 flush_user_windows();
509512 if ((window = get_thread_wsaved()) != 0) {
510− int winsize = sizeof(struct reg_window);
511− int bias = 0;
512−
513− if (test_thread_flag(TIF_32BIT))
514− winsize = sizeof(struct reg_window32);
515− else
516− bias = STACK_BIAS;
517−
518513 window -= 1;
519514 do {
520− unsigned long sp = (t->rwbuf_stkptrs[window] + bias);
521515 struct reg_window *rwin = &t->reg_window[window];
516+ int winsize = sizeof(struct reg_window);
517+ unsigned long sp;
518+
519+ sp = t->rwbuf_stkptrs[window];
520+
521+ if (test_thread_64bit_stack(sp))
522+ sp += STACK_BIAS;
523+ else
524+ winsize = sizeof(struct reg_window32);
522525
523526 if (!copy_to_user((char __user *)sp, rwin, winsize)) {
524527 shift_window_buffer(window, get_thread_wsaved() - 1, t);
@@ -544,13 +547,6 @@ void fault_in_user_windows(void) · 19 unmodified lines
544547 {
545548 struct thread_info *t = current_thread_info();
546549 unsigned long window;
547− int winsize = sizeof(struct reg_window);
548− int bias = 0;
549−
550− if (test_thread_flag(TIF_32BIT))
551− winsize = sizeof(struct reg_window32);
552− else
553− bias = STACK_BIAS;
554550
555551 flush_user_windows();
556552 window = get_thread_wsaved();
@@ -558,8 +554,16 @@ void fault_in_user_windows(void) · 1 unmodified line
558554 if (likely(window != 0)) {
559555 window -= 1;
560556 do {
561− unsigned long sp = (t->rwbuf_stkptrs[window] + bias);
562557 struct reg_window *rwin = &t->reg_window[window];
558+ int winsize = sizeof(struct reg_window);
559+ unsigned long sp;
560+
561+ sp = t->rwbuf_stkptrs[window];
562+
563+ if (test_thread_64bit_stack(sp))
564+ sp += STACK_BIAS;
565+ else
566+ winsize = sizeof(struct reg_window32);
563567
564568 if (unlikely(sp & 0x7UL))
565569 stack_unaligned(sp);
arch/sparc/kernel/ptrace_64.c+2−2
@@ -151,7 +151,7 @@ static int regwindow64_get(struct task_struct *target, · 150 unmodified lines
151151 {
152152 unsigned long rw_addr = regs->u_regs[UREG_I6];
153153
154− if (test_tsk_thread_flag(current, TIF_32BIT)) {
154+ if (!test_thread_64bit_stack(rw_addr)) {
155155 struct reg_window32 win32;
156156 int i;
157157
@@ -176,7 +176,7 @@ static int regwindow64_set(struct task_struct *target, · 18 unmodified lines
176176 {
177177 unsigned long rw_addr = regs->u_regs[UREG_I6];
178178
179− if (test_tsk_thread_flag(current, TIF_32BIT)) {
179+ if (!test_thread_64bit_stack(rw_addr)) {
180180 struct reg_window32 win32;
181181 int i;
182182
arch/sparc/kernel/setup_64.c+21−0
@@ -316,6 +316,25 @@ static void __init popc_patch(void) · 315 unmodified lines
316316 }
317317 }
318318
319+static void __init pause_patch(void)
320+{
321+ struct pause_patch_entry *p;
322+
323+ p = &__pause_3insn_patch;
324+ while (p < &__pause_3insn_patch_end) {
325+ unsigned long i, addr = p->addr;
326+
327+ for (i = 0; i < 3; i++) {
328+ *(unsigned int *) (addr + (i * 4)) = p->insns[i];
329+ wmb();
330+ __asm__ __volatile__("flush %0"
331+ : : "r" (addr + (i * 4)));
332+ }
333+
334+ p++;
335+ }
336+}
337+
319338 #ifdef CONFIG_SMP
320339 void __init boot_cpu_id_too_large(int cpu)
321340 {
@@ -528,6 +547,8 @@ static void __init init_sparc64_elf_hwcap(void) · 206 unmodified lines
528547
529548 if (sparc64_elf_hwcap & AV_SPARC_POPC)
530549 popc_patch();
550+ if (sparc64_elf_hwcap & AV_SPARC_PAUSE)
551+ pause_patch();
531552 }
532553
533554 void __init setup_arch(char **cmdline_p)
arch/sparc/kernel/signal_64.c+1−3
@@ -295,9 +295,7 @@ void do_rt_sigreturn(struct pt_regs *regs) · 294 unmodified lines
295295 err |= restore_fpu_state(regs, fpu_save);
296296
297297 err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t));
298− err |= do_sigaltstack(&sf->stack, NULL, (unsigned long)sf);
299−
300− if (err)
298+ if (err || do_sigaltstack(&sf->stack, NULL, (unsigned long)sf) == -EFAULT)
301299 goto segv;
302300
303301 err |= __get_user(rwin_save, &sf->rwin_save);
arch/sparc/kernel/sys32.S+1−1
@@ -47,7 +47,7 @@ STUB: sra REG1, 0, REG1; \ · 46 unmodified lines
4747 sra REG4, 0, REG4
4848
4949 SIGN1(sys32_exit, sparc_exit, %o0)
50−SIGN1(sys32_exit_group, sys_exit_group, %o0)
50+SIGN1(sys32_exit_group, sparc_exit_group, %o0)
5151 SIGN1(sys32_wait4, compat_sys_wait4, %o2)
5252 SIGN1(sys32_creat, sys_creat, %o1)
5353 SIGN1(sys32_mknod, sys_mknod, %o1)
arch/sparc/kernel/sys_sparc_64.c+5−0
@@ -751,3 +751,8 @@ int kernel_execve(const char *filename, · 750 unmodified lines
751751 : "cc");
752752 return __res;
753753 }
754+
755+asmlinkage long sys_kern_features(void)
756+{
757+ return KERN_FEATURE_MIXED_MODE_STACK;
758+}
arch/sparc/kernel/syscalls.S+12−2
@@ -118,10 +118,20 @@ ret_from_syscall: · 117 unmodified lines
118118 ba,pt %xcc, ret_sys_call
119119 ldx [%sp + PTREGS_OFF + PT_V9_I0], %o0
120120
121+ .globl sparc_exit_group
122+ .type sparc_exit_group,#function
123+sparc_exit_group:
124+ sethi %hi(sys_exit_group), %g7
125+ ba,pt %xcc, 1f
126+ or %g7, %lo(sys_exit_group), %g7
127+ .size sparc_exit_group,.-sparc_exit_group
128+
121129 .globl sparc_exit
122130 .type sparc_exit,#function
123131 sparc_exit:
124− rdpr %pstate, %g2
132+ sethi %hi(sys_exit), %g7
133+ or %g7, %lo(sys_exit), %g7
134+1: rdpr %pstate, %g2
125135 wrpr %g2, PSTATE_IE, %pstate
126136 rdpr %otherwin, %g1
127137 rdpr %cansave, %g3
@@ -129,7 +139,7 @@ sparc_exit: · 1 unmodified line
129139 wrpr %g3, 0x0, %cansave
130140 wrpr %g0, 0x0, %otherwin
131141 wrpr %g2, 0x0, %pstate
132− ba,pt %xcc, sys_exit
142+ jmpl %g7, %g0
133143 stb %g0, [%g6 + TI_WSAVED]
134144 .size sparc_exit,.-sparc_exit
135145
arch/sparc/kernel/systbls_32.S+1−0
@@ -85,3 +85,4 @@ sys_call_table: · 84 unmodified lines
8585 /*325*/ .long sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init
8686 /*330*/ .long sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime
8787 /*335*/ .long sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev
88+/*340*/ .long sys_ni_syscall, sys_kcmp
arch/sparc/kernel/systbls_64.S+3−1
@@ -86,6 +86,7 @@ sys_call_table32: · 85 unmodified lines
8686 .word compat_sys_pwritev, compat_sys_rt_tgsigqueueinfo, sys_perf_event_open, compat_sys_recvmmsg, sys_fanotify_init
8787 /*330*/ .word sys32_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, compat_sys_open_by_handle_at, compat_sys_clock_adjtime
8888 .word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev
89+/*340*/ .word sys_kern_features, sys_kcmp
8990
9091 #endif /* CONFIG_COMPAT */
9192
@@ -132,7 +133,7 @@ sys_call_table: · 40 unmodified lines
132133 /*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents
133134 .word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr
134135 /*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_nis_syscall, sys_ni_syscall
135− .word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname
136+ .word sys_setpgid, sys_fremovexattr, sys_tkill, sparc_exit_group, sys_newuname
136137 /*190*/ .word sys_init_module, sys_sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl
137138 .word sys_epoll_wait, sys_ioprio_set, sys_getppid, sys_nis_syscall, sys_sgetmask
138139 /*200*/ .word sys_ssetmask, sys_nis_syscall, sys_newlstat, sys_uselib, sys_nis_syscall
@@ -163,3 +164,4 @@ sys_call_table: · 24 unmodified lines
163164 .word sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init
164165 /*330*/ .word sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime
165166 .word sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev
167+/*340*/ .word sys_kern_features, sys_kcmp
arch/sparc/kernel/unaligned_64.c+23−13
@@ -113,21 +113,24 @@ static inline long sign_extend_imm13(long imm) · 112 unmodified lines
113113
114114 static unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs)
115115 {
116− unsigned long value;
116+ unsigned long value, fp;
117117
118118 if (reg < 16)
119119 return (!reg ? 0 : regs->u_regs[reg]);
120+
121+ fp = regs->u_regs[UREG_FP];
122+
120123 if (regs->tstate & TSTATE_PRIV) {
121124 struct reg_window *win;
122− win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS);
125+ win = (struct reg_window *)(fp + STACK_BIAS);
123126 value = win->locals[reg - 16];
124− } else if (test_thread_flag(TIF_32BIT)) {
127+ } else if (!test_thread_64bit_stack(fp)) {
125128 struct reg_window32 __user *win32;
126− win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
129+ win32 = (struct reg_window32 __user *)((unsigned long)((u32)fp));
127130 get_user(value, &win32->locals[reg - 16]);
128131 } else {
129132 struct reg_window __user *win;
130− win = (struct reg_window __user *)(regs->u_regs[UREG_FP] + STACK_BIAS);
133+ win = (struct reg_window __user *)(fp + STACK_BIAS);
131134 get_user(value, &win->locals[reg - 16]);
132135 }
133136 return value;
@@ -135,19 +138,24 @@ static unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs) · 1 unmodified line
135138
136139 static unsigned long *fetch_reg_addr(unsigned int reg, struct pt_regs *regs)
137140 {
141+ unsigned long fp;
142+
138143 if (reg < 16)
139144 return &regs->u_regs[reg];
145+
146+ fp = regs->u_regs[UREG_FP];
147+
140148 if (regs->tstate & TSTATE_PRIV) {
141149 struct reg_window *win;
142− win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS);
150+ win = (struct reg_window *)(fp + STACK_BIAS);
143151 return &win->locals[reg - 16];
144− } else if (test_thread_flag(TIF_32BIT)) {
152+ } else if (!test_thread_64bit_stack(fp)) {
145153 struct reg_window32 *win32;
146− win32 = (struct reg_window32 *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
154+ win32 = (struct reg_window32 *)((unsigned long)((u32)fp));
147155 return (unsigned long *)&win32->locals[reg - 16];
148156 } else {
149157 struct reg_window *win;
150− win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS);
158+ win = (struct reg_window *)(fp + STACK_BIAS);
151159 return &win->locals[reg - 16];
152160 }
153161 }
@@ -392,13 +400,15 @@ int handle_popc(u32 insn, struct pt_regs *regs) · 238 unmodified lines
392400 if (rd)
393401 regs->u_regs[rd] = ret;
394402 } else {
395− if (test_thread_flag(TIF_32BIT)) {
403+ unsigned long fp = regs->u_regs[UREG_FP];
404+
405+ if (!test_thread_64bit_stack(fp)) {
396406 struct reg_window32 __user *win32;
397− win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
407+ win32 = (struct reg_window32 __user *)((unsigned long)((u32)fp));
398408 put_user(ret, &win32->locals[rd - 16]);
399409 } else {
400410 struct reg_window __user *win;
401− win = (struct reg_window __user *)(regs->u_regs[UREG_FP] + STACK_BIAS);
411+ win = (struct reg_window __user *)(fp + STACK_BIAS);
402412 put_user(ret, &win->locals[rd - 16]);
403413 }
404414 }
@@ -554,7 +564,7 @@ void handle_ld_nf(u32 insn, struct pt_regs *regs) · 149 unmodified lines
554564 reg[0] = 0;
555565 if ((insn & 0x780000) == 0x180000)
556566 reg[1] = 0;
557− } else if (test_thread_flag(TIF_32BIT)) {
567+ } else if (!test_thread_64bit_stack(regs->u_regs[UREG_FP])) {
558568 put_user(0, (int __user *) reg);
559569 if ((insn & 0x780000) == 0x180000)
560570 put_user(0, ((int __user *) reg) + 1);
arch/sparc/kernel/visemul.c+14−9
@@ -149,21 +149,24 @@ static inline void maybe_flush_windows(unsigned int rs1, unsigned int rs2, · 148 unmodified lines
149149
150150 static unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs)
151151 {
152− unsigned long value;
152+ unsigned long value, fp;
153153
154154 if (reg < 16)
155155 return (!reg ? 0 : regs->u_regs[reg]);
156+
157+ fp = regs->u_regs[UREG_FP];
158+
156159 if (regs->tstate & TSTATE_PRIV) {
157160 struct reg_window *win;
158− win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS);
161+ win = (struct reg_window *)(fp + STACK_BIAS);
159162 value = win->locals[reg - 16];
160− } else if (test_thread_flag(TIF_32BIT)) {
163+ } else if (!test_thread_64bit_stack(fp)) {
161164 struct reg_window32 __user *win32;
162− win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
165+ win32 = (struct reg_window32 __user *)((unsigned long)((u32)fp));
163166 get_user(value, &win32->locals[reg - 16]);
164167 } else {
165168 struct reg_window __user *win;
166− win = (struct reg_window __user *)(regs->u_regs[UREG_FP] + STACK_BIAS);
169+ win = (struct reg_window __user *)(fp + STACK_BIAS);
167170 get_user(value, &win->locals[reg - 16]);
168171 }
169172 return value;
@@ -172,16 +175,18 @@ static unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs) · 2 unmodified lines
172175 static inline unsigned long __user *__fetch_reg_addr_user(unsigned int reg,
173176 struct pt_regs *regs)
174177 {
178+ unsigned long fp = regs->u_regs[UREG_FP];
179+
175180 BUG_ON(reg < 16);
176181 BUG_ON(regs->tstate & TSTATE_PRIV);
177182
178− if (test_thread_flag(TIF_32BIT)) {
183+ if (!test_thread_64bit_stack(fp)) {
179184 struct reg_window32 __user *win32;
180− win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
185+ win32 = (struct reg_window32 __user *)((unsigned long)((u32)fp));
181186 return (unsigned long __user *)&win32->locals[reg - 16];
182187 } else {
183188 struct reg_window __user *win;
184− win = (struct reg_window __user *)(regs->u_regs[UREG_FP] + STACK_BIAS);
189+ win = (struct reg_window __user *)(fp + STACK_BIAS);
185190 return &win->locals[reg - 16];
186191 }
187192 }
@@ -204,7 +209,7 @@ static void store_reg(struct pt_regs *regs, unsigned long val, unsigned long rd) · 16 unmodified lines
204209 } else {
205210 unsigned long __user *rd_user = __fetch_reg_addr_user(rd, regs);
206211
207− if (test_thread_flag(TIF_32BIT))
212+ if (!test_thread_64bit_stack(regs->u_regs[UREG_FP]))
208213 __put_user((u32)val, (u32 __user *)rd_user);
209214 else
210215 __put_user(val, rd_user);
arch/sparc/kernel/vmlinux.lds.S+5−0
@@ -132,6 +132,11 @@ SECTIONS · 131 unmodified lines
132132 *(.popc_6insn_patch)
133133 __popc_6insn_patch_end = .;
134134 }
135+ .pause_3insn_patch : {
136+ __pause_3insn_patch = .;
137+ *(.pause_3insn_patch)
138+ __pause_3insn_patch_end = .;
139+ }
135140 PERCPU_SECTION(SMP_CACHE_BYTES)
136141
137142 . = ALIGN(PAGE_SIZE);
arch/sparc/kernel/winfixup.S+2−0
@@ -43,6 +43,8 @@ spill_fixup_mna: · 42 unmodified lines
4343 spill_fixup_dax:
4444 TRAP_LOAD_THREAD_REG(%g6, %g1)
4545 ldx [%g6 + TI_FLAGS], %g1
46+ andcc %sp, 0x1, %g0
47+ movne %icc, 0, %g1
4648 andcc %g1, _TIF_32BIT, %g0
4749 ldub [%g6 + TI_WSAVED], %g1
4850 sll %g1, 3, %g3
arch/sparc/lib/atomic_64.S+15−1
@@ -1,6 +1,6 @@
11 /* atomic.S: These things are too big to do inline.
22 *
3− * Copyright (C) 1999, 2007 David S. Miller (davem@davemloft.net)
3+ * Copyright (C) 1999, 2007 2012 David S. Miller (davem@davemloft.net)
44 */
55
66 #include <linux/linkage.h>
@@ -117,3 +117,17 @@ ENTRY(atomic64_sub_ret) /* %o0 = decrement, %o1 = atomic_ptr */ · 110 unmodified lines
117117 sub %g1, %o0, %o0
118118 2: BACKOFF_SPIN(%o2, %o3, 1b)
119119 ENDPROC(atomic64_sub_ret)
120+
121+ENTRY(atomic64_dec_if_positive) /* %o0 = atomic_ptr */
122+ BACKOFF_SETUP(%o2)
123+1: ldx [%o0], %g1
124+ brlez,pn %g1, 3f
125+ sub %g1, 1, %g7
126+ casx [%o0], %g1, %g7
127+ cmp %g1, %g7
128+ bne,pn %xcc, BACKOFF_LABEL(2f, 1b)
129+ nop
130+3: retl
131+ sub %g1, 1, %o0
132+2: BACKOFF_SPIN(%o2, %o3, 1b)
133+ENDPROC(atomic64_dec_if_positive)
arch/sparc/lib/ksyms.c+1−0
@@ -116,6 +116,7 @@ EXPORT_SYMBOL(atomic64_add); · 115 unmodified lines
116116 EXPORT_SYMBOL(atomic64_add_ret);
117117 EXPORT_SYMBOL(atomic64_sub);
118118 EXPORT_SYMBOL(atomic64_sub_ret);
119+EXPORT_SYMBOL(atomic64_dec_if_positive);
119120
120121 /* Atomic bit operations. */
121122 EXPORT_SYMBOL(test_and_set_bit);
arch/sparc/math-emu/math_64.c+1−1
@@ -320,7 +320,7 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap) · 319 unmodified lines
320320 XR = 0;
321321 else if (freg < 16)
322322 XR = regs->u_regs[freg];
323− else if (test_thread_flag(TIF_32BIT)) {
323+ else if (!test_thread_64bit_stack(regs->u_regs[UREG_FP])) {
324324 struct reg_window32 __user *win32;
325325 flushw_user ();
326326 win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
arch/um/kernel/exec.c+2−1
@@ -32,13 +32,14 @@ void flush_thread(void) · 31 unmodified lines
3232 "err = %d\n", ret);
3333 force_sig(SIGKILL, current);
3434 }
35+ get_safe_registers(current_pt_regs()->regs.gp,
36+ current_pt_regs()->regs.fp);
3537
3638 __switch_mm(&current->mm->context.id);
3739 }
3840
3941 void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp)
4042 {
41− get_safe_registers(regs->regs.gp, regs->regs.fp);
4243 PT_REGS_IP(regs) = eip;
4344 PT_REGS_SP(regs) = esp;
4445 current->ptrace &= ~PT_DTRACE;
arch/unicore32/Kconfig+6−1
@@ -16,6 +16,8 @@ config UNICORE32 · 15 unmodified lines
1616 select ARCH_WANT_FRAME_POINTERS
1717 select GENERIC_IOMAP
1818 select MODULES_USE_ELF_REL
19+ select GENERIC_KERNEL_THREAD
20+ select GENERIC_KERNEL_EXECVE
1921 help
2022 UniCore-32 is 32-bit Instruction Set Architecture,
2123 including a series of low-power-consumption RISC chip
@@ -64,6 +66,9 @@ config GENERIC_CALIBRATE_DELAY · 42 unmodified lines
6466 config ARCH_MAY_HAVE_PC_FDC
6567 bool
6668
69+config ZONE_DMA
70+ def_bool y
71+
6772 config NEED_DMA_MAP_STATE
6873 def_bool y
6974
@@ -216,7 +221,7 @@ config PUV3_GPIO · 146 unmodified lines
216221 bool
217222 depends on !ARCH_FPGA
218223 select GENERIC_GPIO
219− select GPIO_SYSFS if EXPERIMENTAL
224+ select GPIO_SYSFS
220225 default y
221226
222227 if PUV3_NB0916
arch/unicore32/include/asm/Kbuild+0−1
@@ -1,4 +1,3 @@
1−include include/asm-generic/Kbuild.asm
21
32 generic-y += atomic.h
43 generic-y += auxvec.h
arch/unicore32/include/asm/bug.h+0−5
@@ -19,9 +19,4 @@ extern void die(const char *msg, struct pt_regs *regs, int err); · 18 unmodified lines
1919 extern void uc32_notify_die(const char *str, struct pt_regs *regs,
2020 struct siginfo *info, unsigned long err, unsigned long trap);
2121
22−extern asmlinkage void __backtrace(void);
23−extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
24−
25−extern void __show_regs(struct pt_regs *);
26−
2722 #endif /* __UNICORE_BUG_H__ */
arch/unicore32/include/asm/cmpxchg.h+1−1
@@ -35,7 +35,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, · 34 unmodified lines
3535 : "memory", "cc");
3636 break;
3737 default:
38− ret = __xchg_bad_pointer();
38+ __xchg_bad_pointer();
3939 }
4040
4141 return ret;
arch/unicore32/include/asm/kvm_para.h+0−1
@@ -1 +0,0 @@
1−#include <asm-generic/kvm_para.h>
arch/unicore32/include/asm/processor.h+0−5
@@ -72,11 +72,6 @@ unsigned long get_wchan(struct task_struct *p); · 71 unmodified lines
7272
7373 #define cpu_relax() barrier()
7474
75−/*
76− * Create a new kernel thread
77− */
78−extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
79−
8075 #define task_pt_regs(p) \
8176 ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1)
8277
arch/unicore32/include/asm/ptrace.h+1−75
@@ -12,80 +12,10 @@ · 11 unmodified lines
1212 #ifndef __UNICORE_PTRACE_H__
1313 #define __UNICORE_PTRACE_H__
1414
15−#define PTRACE_GET_THREAD_AREA 22
16−
17−/*
18− * PSR bits
19− */
20−#define USER_MODE 0x00000010
21−#define REAL_MODE 0x00000011
22−#define INTR_MODE 0x00000012
23−#define PRIV_MODE 0x00000013
24−#define ABRT_MODE 0x00000017
25−#define EXTN_MODE 0x0000001b
26−#define SUSR_MODE 0x0000001f
27−#define MODE_MASK 0x0000001f
28−#define PSR_R_BIT 0x00000040
29−#define PSR_I_BIT 0x00000080
30−#define PSR_V_BIT 0x10000000
31−#define PSR_C_BIT 0x20000000
32−#define PSR_Z_BIT 0x40000000
33−#define PSR_S_BIT 0x80000000
34−
35−/*
36− * Groups of PSR bits
37− */
38−#define PSR_f 0xff000000 /* Flags */
39−#define PSR_c 0x000000ff /* Control */
15+#include <uapi/asm/ptrace.h>
4016
4117 #ifndef __ASSEMBLY__
4218
43−/*
44− * This struct defines the way the registers are stored on the
45− * stack during a system call. Note that sizeof(struct pt_regs)
46− * has to be a multiple of 8.
47− */
48−struct pt_regs {
49− unsigned long uregs[34];
50−};
51−
52−#define UCreg_asr uregs[32]
53−#define UCreg_pc uregs[31]
54−#define UCreg_lr uregs[30]
55−#define UCreg_sp uregs[29]
56−#define UCreg_ip uregs[28]
57−#define UCreg_fp uregs[27]
58−#define UCreg_26 uregs[26]
59−#define UCreg_25 uregs[25]
60−#define UCreg_24 uregs[24]
61−#define UCreg_23 uregs[23]
62−#define UCreg_22 uregs[22]
63−#define UCreg_21 uregs[21]
64−#define UCreg_20 uregs[20]
65−#define UCreg_19 uregs[19]
66−#define UCreg_18 uregs[18]
67−#define UCreg_17 uregs[17]
68−#define UCreg_16 uregs[16]
69−#define UCreg_15 uregs[15]
70−#define UCreg_14 uregs[14]
71−#define UCreg_13 uregs[13]
72−#define UCreg_12 uregs[12]
73−#define UCreg_11 uregs[11]
74−#define UCreg_10 uregs[10]
75−#define UCreg_09 uregs[9]
76−#define UCreg_08 uregs[8]
77−#define UCreg_07 uregs[7]
78−#define UCreg_06 uregs[6]
79−#define UCreg_05 uregs[5]
80−#define UCreg_04 uregs[4]
81−#define UCreg_03 uregs[3]
82−#define UCreg_02 uregs[2]
83−#define UCreg_01 uregs[1]
84−#define UCreg_00 uregs[0]
85−#define UCreg_ORIG_00 uregs[33]
86−
87−#ifdef __KERNEL__
88−
8919 #define user_mode(regs) \
9020 (processor_mode(regs) == USER_MODE)
9121
@@ -125,9 +55,5 @@ static inline int valid_user_regs(struct pt_regs *regs) · 33 unmodified lines
12555
12656 #define instruction_pointer(regs) ((regs)->UCreg_pc)
12757
128−#endif /* __KERNEL__ */
129−
13058 #endif /* __ASSEMBLY__ */
131−
13259 #endif
133−
arch/unicore32/include/uapi/asm/Kbuild+7−0
@@ -1,3 +1,10 @@
11 # UAPI Header export list
22 include include/uapi/asm-generic/Kbuild.asm
33
4+header-y += byteorder.h
5+header-y += kvm_para.h
6+header-y += ptrace.h
7+header-y += sigcontext.h
8+header-y += unistd.h
9+
10+generic-y += kvm_para.h
arch/unicore32/include/uapi/asm/byteorder.hrenamed from arch/unicore32/include/asm/byteorder.h+0−0

File renamed without changes.

arch/unicore32/include/uapi/asm/ptrace.h+90−0
@@ -0,0 +1,90 @@
1+/*
2+ * linux/arch/unicore32/include/asm/ptrace.h
3+ *
4+ * Code specific to PKUnity SoC and UniCore ISA
5+ *
6+ * Copyright (C) 2001-2010 GUAN Xue-tao
7+ *
8+ * This program is free software; you can redistribute it and/or modify
9+ * it under the terms of the GNU General Public License version 2 as
10+ * published by the Free Software Foundation.
11+ */
12+#ifndef _UAPI__UNICORE_PTRACE_H__
13+#define _UAPI__UNICORE_PTRACE_H__
14+
15+#define PTRACE_GET_THREAD_AREA 22
16+
17+/*
18+ * PSR bits
19+ */
20+#define USER_MODE 0x00000010
21+#define REAL_MODE 0x00000011
22+#define INTR_MODE 0x00000012
23+#define PRIV_MODE 0x00000013
24+#define ABRT_MODE 0x00000017
25+#define EXTN_MODE 0x0000001b
26+#define SUSR_MODE 0x0000001f
27+#define MODE_MASK 0x0000001f
28+#define PSR_R_BIT 0x00000040
29+#define PSR_I_BIT 0x00000080
30+#define PSR_V_BIT 0x10000000
31+#define PSR_C_BIT 0x20000000
32+#define PSR_Z_BIT 0x40000000
33+#define PSR_S_BIT 0x80000000
34+
35+/*
36+ * Groups of PSR bits
37+ */
38+#define PSR_f 0xff000000 /* Flags */
39+#define PSR_c 0x000000ff /* Control */
40+
41+#ifndef __ASSEMBLY__
42+
43+/*
44+ * This struct defines the way the registers are stored on the
45+ * stack during a system call. Note that sizeof(struct pt_regs)
46+ * has to be a multiple of 8.
47+ */
48+struct pt_regs {
49+ unsigned long uregs[34];
50+};
51+
52+#define UCreg_asr uregs[32]
53+#define UCreg_pc uregs[31]
54+#define UCreg_lr uregs[30]
55+#define UCreg_sp uregs[29]
56+#define UCreg_ip uregs[28]
57+#define UCreg_fp uregs[27]
58+#define UCreg_26 uregs[26]
59+#define UCreg_25 uregs[25]
60+#define UCreg_24 uregs[24]
61+#define UCreg_23 uregs[23]
62+#define UCreg_22 uregs[22]
63+#define UCreg_21 uregs[21]
64+#define UCreg_20 uregs[20]
65+#define UCreg_19 uregs[19]
66+#define UCreg_18 uregs[18]
67+#define UCreg_17 uregs[17]
68+#define UCreg_16 uregs[16]
69+#define UCreg_15 uregs[15]
70+#define UCreg_14 uregs[14]
71+#define UCreg_13 uregs[13]
72+#define UCreg_12 uregs[12]
73+#define UCreg_11 uregs[11]
74+#define UCreg_10 uregs[10]
75+#define UCreg_09 uregs[9]
76+#define UCreg_08 uregs[8]
77+#define UCreg_07 uregs[7]
78+#define UCreg_06 uregs[6]
79+#define UCreg_05 uregs[5]
80+#define UCreg_04 uregs[4]
81+#define UCreg_03 uregs[3]
82+#define UCreg_02 uregs[2]
83+#define UCreg_01 uregs[1]
84+#define UCreg_00 uregs[0]
85+#define UCreg_ORIG_00 uregs[33]
86+
87+
88+#endif /* __ASSEMBLY__ */
89+
90+#endif /* _UAPI__UNICORE_PTRACE_H__ */
arch/unicore32/include/uapi/asm/sigcontext.hrenamed from arch/unicore32/include/asm/sigcontext.h+0−0

File renamed without changes.

arch/unicore32/include/uapi/asm/unistd.hrenamed from arch/unicore32/include/asm/unistd.h+1−0
@@ -12,3 +12,4 @@ · 11 unmodified lines
1212
1313 /* Use the standard ABI for syscalls. */
1414 #include <asm-generic/unistd.h>
15+#define __ARCH_WANT_SYS_EXECVE
arch/unicore32/kernel/entry.S+7−13
@@ -573,17 +573,16 @@ ENDPROC(ret_to_user) · 572 unmodified lines
573573 */
574574 ENTRY(ret_from_fork)
575575 b.l schedule_tail
576− get_thread_info tsk
577− ldw r1, [tsk+], #TI_FLAGS @ check for syscall tracing
578− mov why, #1
579− cand.a r1, #_TIF_SYSCALL_TRACE @ are we tracing syscalls?
580− beq ret_slow_syscall
581− mov r1, sp
582− mov r0, #1 @ trace exit [IP = 1]
583− b.l syscall_trace
584576 b ret_slow_syscall
585577 ENDPROC(ret_from_fork)
586578
579+ENTRY(ret_from_kernel_thread)
580+ b.l schedule_tail
581+ mov r0, r5
582+ adr lr, ret_slow_syscall
583+ mov pc, r4
584+ENDPROC(ret_from_kernel_thread)
585+
587586 /*=============================================================================
588587 * SWI handler
589588 *-----------------------------------------------------------------------------
@@ -669,11 +668,6 @@ __cr_alignment: · 79 unmodified lines
669668 #endif
670669 .ltorg
671670
672−ENTRY(sys_execve)
673− add r3, sp, #S_OFF
674− b __sys_execve
675−ENDPROC(sys_execve)
676−
677671 ENTRY(sys_clone)
678672 add ip, sp, #S_OFF
679673 stw ip, [sp+], #4
arch/unicore32/kernel/process.c+14−44
@@ -258,6 +258,7 @@ void release_thread(struct task_struct *dead_task) · 257 unmodified lines
258258 }
259259
260260 asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
261+asmlinkage void ret_from_kernel_thread(void) __asm__("ret_from_kernel_thread");
261262
262263 int
263264 copy_thread(unsigned long clone_flags, unsigned long stack_start,
@@ -266,17 +267,22 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start, · 2 unmodified lines
266267 struct thread_info *thread = task_thread_info(p);
267268 struct pt_regs *childregs = task_pt_regs(p);
268269
269− *childregs = *regs;
270− childregs->UCreg_00 = 0;
271− childregs->UCreg_sp = stack_start;
272−
273270 memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save));
274271 thread->cpu_context.sp = (unsigned long)childregs;
275− thread->cpu_context.pc = (unsigned long)ret_from_fork;
276−
277− if (clone_flags & CLONE_SETTLS)
278− childregs->UCreg_16 = regs->UCreg_03;
272+ if (unlikely(!regs)) {
273+ thread->cpu_context.pc = (unsigned long)ret_from_kernel_thread;
274+ thread->cpu_context.r4 = stack_start;
275+ thread->cpu_context.r5 = stk_sz;
276+ memset(childregs, 0, sizeof(struct pt_regs));
277+ } else {
278+ thread->cpu_context.pc = (unsigned long)ret_from_fork;
279+ *childregs = *regs;
280+ childregs->UCreg_00 = 0;
281+ childregs->UCreg_sp = stack_start;
279282
283+ if (clone_flags & CLONE_SETTLS)
284+ childregs->UCreg_16 = regs->UCreg_03;
285+ }
280286 return 0;
281287 }
282288
@@ -305,42 +311,6 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fp) · 22 unmodified lines
305311 }
306312 EXPORT_SYMBOL(dump_fpu);
307313
308−/*
309− * Shuffle the argument into the correct register before calling the
310− * thread function. r1 is the thread argument, r2 is the pointer to
311− * the thread function, and r3 points to the exit function.
312− */
313−asm(".pushsection .text\n"
314−" .align\n"
315−" .type kernel_thread_helper, #function\n"
316−"kernel_thread_helper:\n"
317−" mov.a asr, r7\n"
318−" mov r0, r4\n"
319−" mov lr, r6\n"
320−" mov pc, r5\n"
321−" .size kernel_thread_helper, . - kernel_thread_helper\n"
322−" .popsection");
323−
324−/*
325− * Create a kernel thread.
326− */
327−pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
328−{
329− struct pt_regs regs;
330−
331− memset(&regs, 0, sizeof(regs));
332−
333− regs.UCreg_04 = (unsigned long)arg;
334− regs.UCreg_05 = (unsigned long)fn;
335− regs.UCreg_06 = (unsigned long)do_exit;
336− regs.UCreg_07 = PRIV_MODE;
337− regs.UCreg_pc = (unsigned long)kernel_thread_helper;
338− regs.UCreg_asr = regs.UCreg_07 | PSR_I_BIT;
339−
340− return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
341−}
342−EXPORT_SYMBOL(kernel_thread);
343−
344314 unsigned long get_wchan(struct task_struct *p)
345315 {
346316 struct stackframe frame;
arch/unicore32/kernel/setup.h+6−0
@@ -30,4 +30,10 @@ extern char __vectors_start[], __vectors_end[]; · 29 unmodified lines
3030 extern void kernel_thread_helper(void);
3131
3232 extern void __init early_signal_init(void);
33+
34+extern asmlinkage void __backtrace(void);
35+extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
36+
37+extern void __show_regs(struct pt_regs *);
38+
3339 #endif
arch/unicore32/kernel/sys.c+0−63
@@ -42,69 +42,6 @@ asmlinkage long __sys_clone(unsigned long clone_flags, unsigned long newsp, · 41 unmodified lines
4242 parent_tid, child_tid);
4343 }
4444
45−/* sys_execve() executes a new program.
46− * This is called indirectly via a small wrapper
47− */
48−asmlinkage long __sys_execve(const char __user *filename,
49− const char __user *const __user *argv,
50− const char __user *const __user *envp,
51− struct pt_regs *regs)
52−{
53− int error;
54− struct filename *fn;
55−
56− fn = getname(filename);
57− error = PTR_ERR(fn);
58− if (IS_ERR(fn))
59− goto out;
60− error = do_execve(fn->name, argv, envp, regs);
61− putname(fn);
62−out:
63− return error;
64−}
65−
66−int kernel_execve(const char *filename,
67− const char *const argv[],
68− const char *const envp[])
69−{
70− struct pt_regs regs;
71− int ret;
72−
73− memset(&regs, 0, sizeof(struct pt_regs));
74− ret = do_execve(filename,
75− (const char __user *const __user *)argv,
76− (const char __user *const __user *)envp, &regs);
77− if (ret < 0)
78− goto out;
79−
80− /*
81− * Save argc to the register structure for userspace.
82− */
83− regs.UCreg_00 = ret;
84−
85− /*
86− * We were successful. We won't be returning to our caller, but
87− * instead to user space by manipulating the kernel stack.
88− */
89− asm("add r0, %0, %1\n\t"
90− "mov r1, %2\n\t"
91− "mov r2, %3\n\t"
92− "mov r22, #0\n\t" /* not a syscall */
93− "mov r23, %0\n\t" /* thread structure */
94− "b.l memmove\n\t" /* copy regs to top of stack */
95− "mov sp, r0\n\t" /* reposition stack pointer */
96− "b ret_to_user"
97− :
98− : "r" (current_thread_info()),
99− "Ir" (THREAD_START_SP - sizeof(regs)),
100− "r" (&regs),
101− "Ir" (sizeof(regs))
102− : "r0", "r1", "r2", "r3", "ip", "lr", "memory");
103−
104− out:
105− return ret;
106−}
107−
10845 /* Note: used by the compat code even in 64-bit Linux. */
10946 SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
11047 unsigned long, prot, unsigned long, flags,
arch/unicore32/mm/fault.c+27−10
@@ -168,7 +168,7 @@ static inline bool access_error(unsigned int fsr, struct vm_area_struct *vma) · 167 unmodified lines
168168 }
169169
170170 static int __do_pf(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
171− struct task_struct *tsk)
171+ unsigned int flags, struct task_struct *tsk)
172172 {
173173 struct vm_area_struct *vma;
174174 int fault;
@@ -194,14 +194,7 @@ good_area: · 19 unmodified lines
194194 * If for any reason at all we couldn't handle the fault, make
195195 * sure we exit gracefully rather than endlessly redo the fault.
196196 */
197− fault = handle_mm_fault(mm, vma, addr & PAGE_MASK,
198− (!(fsr ^ 0x12)) ? FAULT_FLAG_WRITE : 0);
199− if (unlikely(fault & VM_FAULT_ERROR))
200− return fault;
201− if (fault & VM_FAULT_MAJOR)
202− tsk->maj_flt++;
203− else
204− tsk->min_flt++;
197+ fault = handle_mm_fault(mm, vma, addr & PAGE_MASK, flags);
205198 return fault;
206199
207200 check_stack:
@@ -216,6 +209,8 @@ static int do_pf(unsigned long addr, unsigned int fsr, struct pt_regs *regs) · 8 unmodified lines
216209 struct task_struct *tsk;
217210 struct mm_struct *mm;
218211 int fault, sig, code;
212+ unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
213+ ((!(fsr ^ 0x12)) ? FAULT_FLAG_WRITE : 0);
219214
220215 tsk = current;
221216 mm = tsk->mm;
@@ -236,6 +231,7 @@ static int do_pf(unsigned long addr, unsigned int fsr, struct pt_regs *regs) · 14 unmodified lines
236231 if (!user_mode(regs)
237232 && !search_exception_tables(regs->UCreg_pc))
238233 goto no_context;
234+retry:
239235 down_read(&mm->mmap_sem);
240236 } else {
241237 /*
@@ -251,7 +247,28 @@ static int do_pf(unsigned long addr, unsigned int fsr, struct pt_regs *regs) · 9 unmodified lines
251247 #endif
252248 }
253249
254− fault = __do_pf(mm, addr, fsr, tsk);
250+ fault = __do_pf(mm, addr, fsr, flags, tsk);
251+
252+ /* If we need to retry but a fatal signal is pending, handle the
253+ * signal first. We do not need to release the mmap_sem because
254+ * it would already be released in __lock_page_or_retry in
255+ * mm/filemap.c. */
256+ if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
257+ return 0;
258+
259+ if (!(fault & VM_FAULT_ERROR) && (flags & FAULT_FLAG_ALLOW_RETRY)) {
260+ if (fault & VM_FAULT_MAJOR)
261+ tsk->maj_flt++;
262+ else
263+ tsk->min_flt++;
264+ if (fault & VM_FAULT_RETRY) {
265+ /* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk
266+ * of starvation. */
267+ flags &= ~FAULT_FLAG_ALLOW_RETRY;
268+ goto retry;
269+ }
270+ }
271+
255272 up_read(&mm->mmap_sem);
256273
257274 /*
arch/x86/boot/compressed/eboot.c+2−0
@@ -12,6 +12,8 @@ · 11 unmodified lines
1212 #include <asm/setup.h>
1313 #include <asm/desc.h>
1414
15+#undef memcpy /* Use memcpy from misc.c */
16+
1517 #include "eboot.h"
1618
1719 static efi_system_table_t *sys_table;
arch/x86/boot/header.S+0−3
@@ -476,6 +476,3 @@ die: · 475 unmodified lines
476476 setup_corrupt:
477477 .byte 7
478478 .string "No setup signature found...\n"
479−
480− .data
481−dummy: .long 0
arch/x86/include/asm/Kbuild+3−0
@@ -12,6 +12,7 @@ header-y += mce.h · 11 unmodified lines
1212 header-y += msr-index.h
1313 header-y += msr.h
1414 header-y += mtrr.h
15+header-y += perf_regs.h
1516 header-y += posix_types_32.h
1617 header-y += posix_types_64.h
1718 header-y += posix_types_x32.h
@@ -19,8 +20,10 @@ header-y += prctl.h · 1 unmodified line
1920 header-y += processor-flags.h
2021 header-y += ptrace-abi.h
2122 header-y += sigcontext32.h
23+header-y += svm.h
2224 header-y += ucontext.h
2325 header-y += vm86.h
26+header-y += vmx.h
2427 header-y += vsyscall.h
2528
2629 genhdr-y += unistd_32.h
arch/x86/include/asm/efi.h+4−2
@@ -35,7 +35,7 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...); · 34 unmodified lines
3535 #define efi_call_virt6(f, a1, a2, a3, a4, a5, a6) \
3636 efi_call_virt(f, a1, a2, a3, a4, a5, a6)
3737
38−#define efi_ioremap(addr, size, type) ioremap_cache(addr, size)
38+#define efi_ioremap(addr, size, type, attr) ioremap_cache(addr, size)
3939
4040 #else /* !CONFIG_X86_32 */
4141
@@ -89,7 +89,7 @@ extern u64 efi_call6(void *fp, u64 arg1, u64 arg2, u64 arg3, · 47 unmodified lines
8989 (u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6))
9090
9191 extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size,
92− u32 type);
92+ u32 type, u64 attribute);
9393
9494 #endif /* CONFIG_X86_32 */
9595
@@ -98,6 +98,8 @@ extern void efi_set_executable(efi_memory_desc_t *md, bool executable); · 2 unmodified lines
9898 extern int efi_memblock_x86_reserve_range(void);
9999 extern void efi_call_phys_prelog(void);
100100 extern void efi_call_phys_epilog(void);
101+extern void efi_unmap_memmap(void);
102+extern void efi_memory_uc(u64 addr, unsigned long size);
101103
102104 #ifndef CONFIG_EFI
103105 /*
arch/x86/include/asm/fpu-internal.h+9−6
@@ -399,14 +399,17 @@ static inline void drop_init_fpu(struct task_struct *tsk) · 398 unmodified lines
399399 typedef struct { int preload; } fpu_switch_t;
400400
401401 /*
402− * FIXME! We could do a totally lazy restore, but we need to
403− * add a per-cpu "this was the task that last touched the FPU
404− * on this CPU" variable, and the task needs to have a "I last
405− * touched the FPU on this CPU" and check them.
402+ * Must be run with preemption disabled: this clears the fpu_owner_task,
403+ * on this CPU.
406404 *
407− * We don't do that yet, so "fpu_lazy_restore()" always returns
408− * false, but some day..
405+ * This will disable any lazy FPU state restore of the current FPU state,
406+ * but if the current thread owns the FPU, it will still be saved by.
409407 */
408+static inline void __cpu_disable_lazy_restore(unsigned int cpu)
409+{
410+ per_cpu(fpu_owner_task, cpu) = NULL;
411+}
412+
410413 static inline int fpu_lazy_restore(struct task_struct *new, unsigned int cpu)
411414 {
412415 return new == this_cpu_read_stable(fpu_owner_task) &&
arch/x86/include/asm/ptrace.h+4−11
@@ -205,21 +205,14 @@ static inline bool user_64bit_mode(struct pt_regs *regs) · 204 unmodified lines
205205 }
206206 #endif
207207
208−/*
209− * X86_32 CPUs don't save ss and esp if the CPU is already in kernel mode
210− * when it traps. The previous stack will be directly underneath the saved
211− * registers, and 'sp/ss' won't even have been saved. Thus the '&regs->sp'.
212− *
213− * This is valid only for kernel mode traps.
214− */
215−static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
216−{
217208 #ifdef CONFIG_X86_32
218− return (unsigned long)(&regs->sp);
209+extern unsigned long kernel_stack_pointer(struct pt_regs *regs);
219210 #else
211+static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
212+{
220213 return regs->sp;
221−#endif
222214 }
215+#endif
223216
224217 #define GET_IP(regs) ((regs)->ip)
225218 #define GET_FP(regs) ((regs)->bp)
arch/x86/include/asm/xen/hypercall.h+7−14
@@ -359,18 +359,14 @@ HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val, · 358 unmodified lines
359359 return _hypercall4(int, update_va_mapping, va,
360360 new_val.pte, new_val.pte >> 32, flags);
361361 }
362+extern int __must_check xen_event_channel_op_compat(int, void *);
362363
363364 static inline int
364365 HYPERVISOR_event_channel_op(int cmd, void *arg)
365366 {
366367 int rc = _hypercall2(int, event_channel_op, cmd, arg);
367− if (unlikely(rc == -ENOSYS)) {
368− struct evtchn_op op;
369− op.cmd = cmd;
370− memcpy(&op.u, arg, sizeof(op.u));
371− rc = _hypercall1(int, event_channel_op_compat, &op);
372− memcpy(arg, &op.u, sizeof(op.u));
373− }
368+ if (unlikely(rc == -ENOSYS))
369+ rc = xen_event_channel_op_compat(cmd, arg);
374370 return rc;
375371 }
376372
@@ -386,17 +382,14 @@ HYPERVISOR_console_io(int cmd, int count, char *str) · 9 unmodified lines
386382 return _hypercall3(int, console_io, cmd, count, str);
387383 }
388384
385+extern int __must_check HYPERVISOR_physdev_op_compat(int, void *);
386+
389387 static inline int
390388 HYPERVISOR_physdev_op(int cmd, void *arg)
391389 {
392390 int rc = _hypercall2(int, physdev_op, cmd, arg);
393− if (unlikely(rc == -ENOSYS)) {
394− struct physdev_op op;
395− op.cmd = cmd;
396− memcpy(&op.u, arg, sizeof(op.u));
397− rc = _hypercall1(int, physdev_op_compat, &op);
398− memcpy(arg, &op.u, sizeof(op.u));
399− }
391+ if (unlikely(rc == -ENOSYS))
392+ rc = HYPERVISOR_physdev_op_compat(cmd, arg);
400393 return rc;
401394 }
402395
arch/x86/include/asm/xen/hypervisor.h+0−1
@@ -33,7 +33,6 @@ · 32 unmodified lines
3333 #ifndef _ASM_X86_XEN_HYPERVISOR_H
3434 #define _ASM_X86_XEN_HYPERVISOR_H
3535
36−/* arch/i386/kernel/setup.c */
3736 extern struct shared_info *HYPERVISOR_shared_info;
3837 extern struct start_info *xen_start_info;
3938
arch/x86/kernel/apic/io_apic.c+3−0
@@ -2257,6 +2257,9 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void) · 2256 unmodified lines
22572257 continue;
22582258
22592259 cfg = irq_cfg(irq);
2260+ if (!cfg)
2261+ continue;
2262+
22602263 raw_spin_lock(&desc->lock);
22612264
22622265 /*
arch/x86/kernel/cpu/amd.c+14−0
@@ -631,6 +631,20 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) · 630 unmodified lines
631631 }
632632 }
633633
634+ /*
635+ * The way access filter has a performance penalty on some workloads.
636+ * Disable it on the affected CPUs.
637+ */
638+ if ((c->x86 == 0x15) &&
639+ (c->x86_model >= 0x02) && (c->x86_model < 0x20)) {
640+ u64 val;
641+
642+ if (!rdmsrl_safe(0xc0011021, &val) && !(val & 0x1E)) {
643+ val |= 0x1E;
644+ wrmsrl_safe(0xc0011021, val);
645+ }
646+ }
647+
634648 cpu_detect_cache_sizes(c);
635649
636650 /* Multi core CPU? */
arch/x86/kernel/cpu/mcheck/mce_amd.c+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 *
77 * Written by Jacob Shin - AMD, Inc.
88 *
9− * Support: borislav.petkov@amd.com
9+ * Maintained by: Borislav Petkov <bp@alien8.de>
1010 *
1111 * April 2006
1212 * - added support for AMD Family 0x10 processors
arch/x86/kernel/cpu/mcheck/mce_intel.c+18−13
@@ -285,34 +285,39 @@ void cmci_clear(void) · 284 unmodified lines
285285 raw_spin_unlock_irqrestore(&cmci_discover_lock, flags);
286286 }
287287
288+static long cmci_rediscover_work_func(void *arg)
289+{
290+ int banks;
291+
292+ /* Recheck banks in case CPUs don't all have the same */
293+ if (cmci_supported(&banks))
294+ cmci_discover(banks);
295+
296+ return 0;
297+}
298+
288299 /*
289300 * After a CPU went down cycle through all the others and rediscover
290301 * Must run in process context.
291302 */
292303 void cmci_rediscover(int dying)
293304 {
294− int banks;
295− int cpu;
296− cpumask_var_t old;
305+ int cpu, banks;
297306
298307 if (!cmci_supported(&banks))
299308 return;
300− if (!alloc_cpumask_var(&old, GFP_KERNEL))
301− return;
302− cpumask_copy(old, &current->cpus_allowed);
303309
304310 for_each_online_cpu(cpu) {
305311 if (cpu == dying)
306312 continue;
307− if (set_cpus_allowed_ptr(current, cpumask_of(cpu)))
313+
314+ if (cpu == smp_processor_id()) {
315+ cmci_rediscover_work_func(NULL);
308316 continue;
309− /* Recheck banks in case CPUs don't all have the same */
310− if (cmci_supported(&banks))
311− cmci_discover(banks);
312− }
317+ }
313318
314− set_cpus_allowed_ptr(current, old);
315− free_cpumask_var(old);
319+ work_on_cpu(cpu, cmci_rediscover_work_func, NULL);
320+ }
316321 }
317322
318323 /*
arch/x86/kernel/cpu/perf_event_intel_uncore.c+28−17
@@ -118,22 +118,24 @@ static void snbep_uncore_pci_disable_box(struct intel_uncore_box *box) · 117 unmodified lines
118118 {
119119 struct pci_dev *pdev = box->pci_dev;
120120 int box_ctl = uncore_pci_box_ctl(box);
121− u32 config;
121+ u32 config = 0;
122122
123− pci_read_config_dword(pdev, box_ctl, &config);
124− config |= SNBEP_PMON_BOX_CTL_FRZ;
125− pci_write_config_dword(pdev, box_ctl, config);
123+ if (!pci_read_config_dword(pdev, box_ctl, &config)) {
124+ config |= SNBEP_PMON_BOX_CTL_FRZ;
125+ pci_write_config_dword(pdev, box_ctl, config);
126+ }
126127 }
127128
128129 static void snbep_uncore_pci_enable_box(struct intel_uncore_box *box)
129130 {
130131 struct pci_dev *pdev = box->pci_dev;
131132 int box_ctl = uncore_pci_box_ctl(box);
132− u32 config;
133+ u32 config = 0;
133134
134− pci_read_config_dword(pdev, box_ctl, &config);
135− config &= ~SNBEP_PMON_BOX_CTL_FRZ;
136− pci_write_config_dword(pdev, box_ctl, config);
135+ if (!pci_read_config_dword(pdev, box_ctl, &config)) {
136+ config &= ~SNBEP_PMON_BOX_CTL_FRZ;
137+ pci_write_config_dword(pdev, box_ctl, config);
138+ }
137139 }
138140
139141 static void snbep_uncore_pci_enable_event(struct intel_uncore_box *box, struct perf_event *event)
@@ -156,7 +158,7 @@ static u64 snbep_uncore_pci_read_counter(struct intel_uncore_box *box, struct pe · 16 unmodified lines
156158 {
157159 struct pci_dev *pdev = box->pci_dev;
158160 struct hw_perf_event *hwc = &event->hw;
159− u64 count;
161+ u64 count = 0;
160162
161163 pci_read_config_dword(pdev, hwc->event_base, (u32 *)&count);
162164 pci_read_config_dword(pdev, hwc->event_base + 4, (u32 *)&count + 1);
@@ -603,11 +605,12 @@ static struct pci_driver snbep_uncore_pci_driver = { · 440 unmodified lines
603605 /*
604606 * build pci bus to socket mapping
605607 */
606−static void snbep_pci2phy_map_init(void)
608+static int snbep_pci2phy_map_init(void)
607609 {
608610 struct pci_dev *ubox_dev = NULL;
609611 int i, bus, nodeid;
610− u32 config;
612+ int err = 0;
613+ u32 config = 0;
611614
612615 while (1) {
613616 /* find the UBOX device */
@@ -618,10 +621,14 @@ static void snbep_pci2phy_map_init(void) · 4 unmodified lines
618621 break;
619622 bus = ubox_dev->bus->number;
620623 /* get the Node ID of the local register */
621− pci_read_config_dword(ubox_dev, 0x40, &config);
624+ err = pci_read_config_dword(ubox_dev, 0x40, &config);
625+ if (err)
626+ break;
622627 nodeid = config;
623628 /* get the Node ID mapping */
624− pci_read_config_dword(ubox_dev, 0x54, &config);
629+ err = pci_read_config_dword(ubox_dev, 0x54, &config);
630+ if (err)
631+ break;
625632 /*
626633 * every three bits in the Node ID mapping register maps
627634 * to a particular node.
@@ -633,7 +640,11 @@ static void snbep_pci2phy_map_init(void) · 5 unmodified lines
633640 }
634641 }
635642 };
636− return;
643+
644+ if (ubox_dev)
645+ pci_dev_put(ubox_dev);
646+
647+ return err ? pcibios_err_to_errno(err) : 0;
637648 }
638649 /* end of Sandy Bridge-EP uncore support */
639650
@@ -1547,7 +1558,6 @@ void nhmex_rbox_alter_er(struct intel_uncore_box *box, struct perf_event *event) · 907 unmodified lines
15471558 {
15481559 struct hw_perf_event *hwc = &event->hw;
15491560 struct hw_perf_event_extra *reg1 = &hwc->extra_reg;
1550− int port;
15511561
15521562 /* adjust the main event selector and extra register index */
15531563 if (reg1->idx % 2) {
@@ -1559,7 +1569,6 @@ void nhmex_rbox_alter_er(struct intel_uncore_box *box, struct perf_event *event) · 5 unmodified lines
15591569 }
15601570
15611571 /* adjust extra register config */
1562− port = reg1->idx / 6 + box->pmu->pmu_idx * 4;
15631572 switch (reg1->idx % 6) {
15641573 case 2:
15651574 /* shift the 8~15 bits to the 0~7 bits */
@@ -2578,9 +2587,11 @@ static int __init uncore_pci_init(void) · 1012 unmodified lines
25782587
25792588 switch (boot_cpu_data.x86_model) {
25802589 case 45: /* Sandy Bridge-EP */
2590+ ret = snbep_pci2phy_map_init();
2591+ if (ret)
2592+ return ret;
25812593 pci_uncores = snbep_pci_uncores;
25822594 uncore_pci_driver = &snbep_uncore_pci_driver;
2583− snbep_pci2phy_map_init();
25842595 break;
25852596 default:
25862597 return 0;
arch/x86/kernel/cpu/perf_event_knc.c+82−11
@@ -3,6 +3,8 @@ · 2 unmodified lines
33 #include <linux/perf_event.h>
44 #include <linux/types.h>
55
6+#include <asm/hardirq.h>
7+
68 #include "perf_event.h"
79
810 static const u64 knc_perfmon_event_map[] =
@@ -173,30 +175,100 @@ static void knc_pmu_enable_all(int added) · 164 unmodified lines
173175 static inline void
174176 knc_pmu_disable_event(struct perf_event *event)
175177 {
176− struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
177178 struct hw_perf_event *hwc = &event->hw;
178179 u64 val;
179180
180181 val = hwc->config;
181− if (cpuc->enabled)
182− val &= ~ARCH_PERFMON_EVENTSEL_ENABLE;
182+ val &= ~ARCH_PERFMON_EVENTSEL_ENABLE;
183183
184184 (void)wrmsrl_safe(hwc->config_base + hwc->idx, val);
185185 }
186186
187187 static void knc_pmu_enable_event(struct perf_event *event)
188188 {
189− struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
190189 struct hw_perf_event *hwc = &event->hw;
191190 u64 val;
192191
193192 val = hwc->config;
194− if (cpuc->enabled)
195− val |= ARCH_PERFMON_EVENTSEL_ENABLE;
193+ val |= ARCH_PERFMON_EVENTSEL_ENABLE;
196194
197195 (void)wrmsrl_safe(hwc->config_base + hwc->idx, val);
198196 }
199197
198+static inline u64 knc_pmu_get_status(void)
199+{
200+ u64 status;
201+
202+ rdmsrl(MSR_KNC_IA32_PERF_GLOBAL_STATUS, status);
203+
204+ return status;
205+}
206+
207+static inline void knc_pmu_ack_status(u64 ack)
208+{
209+ wrmsrl(MSR_KNC_IA32_PERF_GLOBAL_OVF_CONTROL, ack);
210+}
211+
212+static int knc_pmu_handle_irq(struct pt_regs *regs)
213+{
214+ struct perf_sample_data data;
215+ struct cpu_hw_events *cpuc;
216+ int handled = 0;
217+ int bit, loops;
218+ u64 status;
219+
220+ cpuc = &__get_cpu_var(cpu_hw_events);
221+
222+ knc_pmu_disable_all();
223+
224+ status = knc_pmu_get_status();
225+ if (!status) {
226+ knc_pmu_enable_all(0);
227+ return handled;
228+ }
229+
230+ loops = 0;
231+again:
232+ knc_pmu_ack_status(status);
233+ if (++loops > 100) {
234+ WARN_ONCE(1, "perf: irq loop stuck!\n");
235+ perf_event_print_debug();
236+ goto done;
237+ }
238+
239+ inc_irq_stat(apic_perf_irqs);
240+
241+ for_each_set_bit(bit, (unsigned long *)&status, X86_PMC_IDX_MAX) {
242+ struct perf_event *event = cpuc->events[bit];
243+
244+ handled++;
245+
246+ if (!test_bit(bit, cpuc->active_mask))
247+ continue;
248+
249+ if (!intel_pmu_save_and_restart(event))
250+ continue;
251+
252+ perf_sample_data_init(&data, 0, event->hw.last_period);
253+
254+ if (perf_event_overflow(event, &data, regs))
255+ x86_pmu_stop(event, 0);
256+ }
257+
258+ /*
259+ * Repeat if there is more work to be done:
260+ */
261+ status = knc_pmu_get_status();
262+ if (status)
263+ goto again;
264+
265+done:
266+ knc_pmu_enable_all(0);
267+
268+ return handled;
269+}
270+
271+
200272 PMU_FORMAT_ATTR(event, "config:0-7" );
201273 PMU_FORMAT_ATTR(umask, "config:8-15" );
202274 PMU_FORMAT_ATTR(edge, "config:18" );
@@ -214,7 +286,7 @@ static struct attribute *intel_knc_formats_attr[] = { · 11 unmodified lines
214286
215287 static __initconst struct x86_pmu knc_pmu = {
216288 .name = "knc",
217− .handle_irq = x86_pmu_handle_irq,
289+ .handle_irq = knc_pmu_handle_irq,
218290 .disable_all = knc_pmu_disable_all,
219291 .enable_all = knc_pmu_enable_all,
220292 .enable = knc_pmu_enable_event,
@@ -226,12 +298,11 @@ static __initconst struct x86_pmu knc_pmu = { · 5 unmodified lines
226298 .event_map = knc_pmu_event_map,
227299 .max_events = ARRAY_SIZE(knc_perfmon_event_map),
228300 .apic = 1,
229− .max_period = (1ULL << 31) - 1,
301+ .max_period = (1ULL << 39) - 1,
230302 .version = 0,
231303 .num_counters = 2,
232− /* in theory 40 bits, early silicon is buggy though */
233− .cntval_bits = 32,
234− .cntval_mask = (1ULL << 32) - 1,
304+ .cntval_bits = 40,
305+ .cntval_mask = (1ULL << 40) - 1,
235306 .get_event_constraints = x86_get_event_constraints,
236307 .event_constraints = knc_event_constraints,
237308 .format_attrs = intel_knc_formats_attr,
arch/x86/kernel/cpu/perf_event_p6.c+112−15
@@ -8,13 +8,106 @@ · 7 unmodified lines
88 */
99 static const u64 p6_perfmon_event_map[] =
1010 {
11− [PERF_COUNT_HW_CPU_CYCLES] = 0x0079,
12− [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
13− [PERF_COUNT_HW_CACHE_REFERENCES] = 0x0f2e,
14− [PERF_COUNT_HW_CACHE_MISSES] = 0x012e,
15− [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4,
16− [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5,
17− [PERF_COUNT_HW_BUS_CYCLES] = 0x0062,
11+ [PERF_COUNT_HW_CPU_CYCLES] = 0x0079, /* CPU_CLK_UNHALTED */
12+ [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0, /* INST_RETIRED */
13+ [PERF_COUNT_HW_CACHE_REFERENCES] = 0x0f2e, /* L2_RQSTS:M:E:S:I */
14+ [PERF_COUNT_HW_CACHE_MISSES] = 0x012e, /* L2_RQSTS:I */
15+ [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4, /* BR_INST_RETIRED */
16+ [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5, /* BR_MISS_PRED_RETIRED */
17+ [PERF_COUNT_HW_BUS_CYCLES] = 0x0062, /* BUS_DRDY_CLOCKS */
18+ [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x00a2, /* RESOURCE_STALLS */
19+
20+};
21+
22+static __initconst u64 p6_hw_cache_event_ids
23+ [PERF_COUNT_HW_CACHE_MAX]
24+ [PERF_COUNT_HW_CACHE_OP_MAX]
25+ [PERF_COUNT_HW_CACHE_RESULT_MAX] =
26+{
27+ [ C(L1D) ] = {
28+ [ C(OP_READ) ] = {
29+ [ C(RESULT_ACCESS) ] = 0x0043, /* DATA_MEM_REFS */
30+ [ C(RESULT_MISS) ] = 0x0045, /* DCU_LINES_IN */
31+ },
32+ [ C(OP_WRITE) ] = {
33+ [ C(RESULT_ACCESS) ] = 0,
34+ [ C(RESULT_MISS) ] = 0x0f29, /* L2_LD:M:E:S:I */
35+ },
36+ [ C(OP_PREFETCH) ] = {
37+ [ C(RESULT_ACCESS) ] = 0,
38+ [ C(RESULT_MISS) ] = 0,
39+ },
40+ },
41+ [ C(L1I ) ] = {
42+ [ C(OP_READ) ] = {
43+ [ C(RESULT_ACCESS) ] = 0x0080, /* IFU_IFETCH */
44+ [ C(RESULT_MISS) ] = 0x0f28, /* L2_IFETCH:M:E:S:I */
45+ },
46+ [ C(OP_WRITE) ] = {
47+ [ C(RESULT_ACCESS) ] = -1,
48+ [ C(RESULT_MISS) ] = -1,
49+ },
50+ [ C(OP_PREFETCH) ] = {
51+ [ C(RESULT_ACCESS) ] = 0,
52+ [ C(RESULT_MISS) ] = 0,
53+ },
54+ },
55+ [ C(LL ) ] = {
56+ [ C(OP_READ) ] = {
57+ [ C(RESULT_ACCESS) ] = 0,
58+ [ C(RESULT_MISS) ] = 0,
59+ },
60+ [ C(OP_WRITE) ] = {
61+ [ C(RESULT_ACCESS) ] = 0,
62+ [ C(RESULT_MISS) ] = 0x0025, /* L2_M_LINES_INM */
63+ },
64+ [ C(OP_PREFETCH) ] = {
65+ [ C(RESULT_ACCESS) ] = 0,
66+ [ C(RESULT_MISS) ] = 0,
67+ },
68+ },
69+ [ C(DTLB) ] = {
70+ [ C(OP_READ) ] = {
71+ [ C(RESULT_ACCESS) ] = 0x0043, /* DATA_MEM_REFS */
72+ [ C(RESULT_MISS) ] = 0,
73+ },
74+ [ C(OP_WRITE) ] = {
75+ [ C(RESULT_ACCESS) ] = 0,
76+ [ C(RESULT_MISS) ] = 0,
77+ },
78+ [ C(OP_PREFETCH) ] = {
79+ [ C(RESULT_ACCESS) ] = 0,
80+ [ C(RESULT_MISS) ] = 0,
81+ },
82+ },
83+ [ C(ITLB) ] = {
84+ [ C(OP_READ) ] = {
85+ [ C(RESULT_ACCESS) ] = 0x0080, /* IFU_IFETCH */
86+ [ C(RESULT_MISS) ] = 0x0085, /* ITLB_MISS */
87+ },
88+ [ C(OP_WRITE) ] = {
89+ [ C(RESULT_ACCESS) ] = -1,
90+ [ C(RESULT_MISS) ] = -1,
91+ },
92+ [ C(OP_PREFETCH) ] = {
93+ [ C(RESULT_ACCESS) ] = -1,
94+ [ C(RESULT_MISS) ] = -1,
95+ },
96+ },
97+ [ C(BPU ) ] = {
98+ [ C(OP_READ) ] = {
99+ [ C(RESULT_ACCESS) ] = 0x00c4, /* BR_INST_RETIRED */
100+ [ C(RESULT_MISS) ] = 0x00c5, /* BR_MISS_PRED_RETIRED */
101+ },
102+ [ C(OP_WRITE) ] = {
103+ [ C(RESULT_ACCESS) ] = -1,
104+ [ C(RESULT_MISS) ] = -1,
105+ },
106+ [ C(OP_PREFETCH) ] = {
107+ [ C(RESULT_ACCESS) ] = -1,
108+ [ C(RESULT_MISS) ] = -1,
109+ },
110+ },
18111 };
19112
20113 static u64 p6_pmu_event_map(int hw_event)
@@ -34,7 +127,7 @@ static struct event_constraint p6_event_constraints[] = · 13 unmodified lines
34127 {
35128 INTEL_EVENT_CONSTRAINT(0xc1, 0x1), /* FLOPS */
36129 INTEL_EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */
37− INTEL_EVENT_CONSTRAINT(0x11, 0x1), /* FP_ASSIST */
130+ INTEL_EVENT_CONSTRAINT(0x11, 0x2), /* FP_ASSIST */
38131 INTEL_EVENT_CONSTRAINT(0x12, 0x2), /* MUL */
39132 INTEL_EVENT_CONSTRAINT(0x13, 0x2), /* DIV */
40133 INTEL_EVENT_CONSTRAINT(0x14, 0x1), /* CYCLES_DIV_BUSY */
@@ -64,25 +157,25 @@ static void p6_pmu_enable_all(int added) · 23 unmodified lines
64157 static inline void
65158 p6_pmu_disable_event(struct perf_event *event)
66159 {
67− struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
68160 struct hw_perf_event *hwc = &event->hw;
69161 u64 val = P6_NOP_EVENT;
70162
71− if (cpuc->enabled)
72− val |= ARCH_PERFMON_EVENTSEL_ENABLE;
73−
74163 (void)wrmsrl_safe(hwc->config_base, val);
75164 }
76165
77166 static void p6_pmu_enable_event(struct perf_event *event)
78167 {
79− struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
80168 struct hw_perf_event *hwc = &event->hw;
81169 u64 val;
82170
83171 val = hwc->config;
84− if (cpuc->enabled)
85− val |= ARCH_PERFMON_EVENTSEL_ENABLE;
172+
173+ /*
174+ * p6 only has a global event enable, set on PerfEvtSel0
175+ * We "disable" events by programming P6_NOP_EVENT
176+ * and we rely on p6_pmu_enable_all() being called
177+ * to actually enable the events.
178+ */
86179
87180 (void)wrmsrl_safe(hwc->config_base, val);
88181 }
@@ -160,5 +253,9 @@ __init int p6_pmu_init(void) · 71 unmodified lines
160253
161254 x86_pmu = p6_pmu;
162255
256+ memcpy(hw_cache_event_ids, p6_hw_cache_event_ids,
257+ sizeof(hw_cache_event_ids));
258+
259+
163260 return 0;
164261 }
arch/x86/kernel/e820.c+3−0
@@ -1077,6 +1077,9 @@ void __init memblock_x86_fill(void) · 1076 unmodified lines
10771077 memblock_add(ei->addr, ei->size);
10781078 }
10791079
1080+ /* throw away partial pages */
1081+ memblock_trim_memory(PAGE_SIZE);
1082+
10801083 memblock_dump_all();
10811084 }
10821085
arch/x86/kernel/entry_64.S+7−7
@@ -995,8 +995,8 @@ END(interrupt) · 994 unmodified lines
995995 */
996996 .p2align CONFIG_X86_L1_CACHE_SHIFT
997997 common_interrupt:
998− ASM_CLAC
999998 XCPT_FRAME
999+ ASM_CLAC
10001000 addq $-0x80,(%rsp) /* Adjust vector to [-256,-1] range */
10011001 interrupt do_IRQ
10021002 /* 0(%rsp): old_rsp-ARGOFFSET */
@@ -1135,8 +1135,8 @@ END(common_interrupt) · 132 unmodified lines
11351135 */
11361136 .macro apicinterrupt num sym do_sym
11371137 ENTRY(\sym)
1138− ASM_CLAC
11391138 INTR_FRAME
1139+ ASM_CLAC
11401140 pushq_cfi $~(\num)
11411141 .Lcommon_\sym:
11421142 interrupt \do_sym
@@ -1190,8 +1190,8 @@ apicinterrupt IRQ_WORK_VECTOR \ · 47 unmodified lines
11901190 */
11911191 .macro zeroentry sym do_sym
11921192 ENTRY(\sym)
1193− ASM_CLAC
11941193 INTR_FRAME
1194+ ASM_CLAC
11951195 PARAVIRT_ADJUST_EXCEPTION_FRAME
11961196 pushq_cfi $-1 /* ORIG_RAX: no syscall to restart */
11971197 subq $ORIG_RAX-R15, %rsp
@@ -1208,8 +1208,8 @@ END(\sym) · 10 unmodified lines
12081208
12091209 .macro paranoidzeroentry sym do_sym
12101210 ENTRY(\sym)
1211− ASM_CLAC
12121211 INTR_FRAME
1212+ ASM_CLAC
12131213 PARAVIRT_ADJUST_EXCEPTION_FRAME
12141214 pushq_cfi $-1 /* ORIG_RAX: no syscall to restart */
12151215 subq $ORIG_RAX-R15, %rsp
@@ -1227,8 +1227,8 @@ END(\sym) · 11 unmodified lines
12271227 #define INIT_TSS_IST(x) PER_CPU_VAR(init_tss) + (TSS_ist + ((x) - 1) * 8)
12281228 .macro paranoidzeroentry_ist sym do_sym ist
12291229 ENTRY(\sym)
1230− ASM_CLAC
12311230 INTR_FRAME
1231+ ASM_CLAC
12321232 PARAVIRT_ADJUST_EXCEPTION_FRAME
12331233 pushq_cfi $-1 /* ORIG_RAX: no syscall to restart */
12341234 subq $ORIG_RAX-R15, %rsp
@@ -1247,8 +1247,8 @@ END(\sym) · 12 unmodified lines
12471247
12481248 .macro errorentry sym do_sym
12491249 ENTRY(\sym)
1250− ASM_CLAC
12511250 XCPT_FRAME
1251+ ASM_CLAC
12521252 PARAVIRT_ADJUST_EXCEPTION_FRAME
12531253 subq $ORIG_RAX-R15, %rsp
12541254 CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
@@ -1266,8 +1266,8 @@ END(\sym) · 11 unmodified lines
12661266 /* error code is on the stack already */
12671267 .macro paranoiderrorentry sym do_sym
12681268 ENTRY(\sym)
1269− ASM_CLAC
12701269 XCPT_FRAME
1270+ ASM_CLAC
12711271 PARAVIRT_ADJUST_EXCEPTION_FRAME
12721272 subq $ORIG_RAX-R15, %rsp
12731273 CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
arch/x86/kernel/head_32.S+7−2
@@ -292,8 +292,8 @@ default_entry: · 291 unmodified lines
292292 * be using the global pages.
293293 *
294294 * NOTE! If we are on a 486 we may have no cr4 at all!
295− * Specifically, cr4 exists if and only if CPUID exists,
296− * which in turn exists if and only if EFLAGS.ID exists.
295+ * Specifically, cr4 exists if and only if CPUID exists
296+ * and has flags other than the FPU flag set.
297297 */
298298 movl $X86_EFLAGS_ID,%ecx
299299 pushl %ecx
@@ -308,6 +308,11 @@ default_entry: · 8 unmodified lines
308308 testl %ecx,%eax
309309 jz 6f # No ID flag = no CPUID = no CR4
310310
311+ movl $1,%eax
312+ cpuid
313+ andl $~1,%edx # Ignore CPUID.FPU
314+ jz 6f # No flags or only CPUID.FPU = no CR4
315+
311316 movl pa(mmu_cr4_features),%eax
312317 movl %eax,%cr4
313318
arch/x86/kernel/microcode_amd.c+6−2
@@ -8,8 +8,8 @@ · 7 unmodified lines
88 * Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
99 *
1010 * Maintainers:
11− * Andreas Herrmann <andreas.herrmann3@amd.com>
12− * Borislav Petkov <borislav.petkov@amd.com>
11+ * Andreas Herrmann <herrmann.der.user@googlemail.com>
12+ * Borislav Petkov <bp@alien8.de>
1313 *
1414 * This driver allows to upgrade microcode on F10h AMD
1515 * CPUs and later.
@@ -190,6 +190,7 @@ static unsigned int verify_patch_size(int cpu, u32 patch_size, · 174 unmodified lines
190190 #define F1XH_MPB_MAX_SIZE 2048
191191 #define F14H_MPB_MAX_SIZE 1824
192192 #define F15H_MPB_MAX_SIZE 4096
193+#define F16H_MPB_MAX_SIZE 3458
193194
194195 switch (c->x86) {
195196 case 0x14:
@@ -198,6 +199,9 @@ static unsigned int verify_patch_size(int cpu, u32 patch_size, · 2 unmodified lines
198199 case 0x15:
199200 max_size = F15H_MPB_MAX_SIZE;
200201 break;
202+ case 0x16:
203+ max_size = F16H_MPB_MAX_SIZE;
204+ break;
201205 default:
202206 max_size = F1XH_MPB_MAX_SIZE;
203207 break;
arch/x86/kernel/ptrace.c+37−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <linux/perf_event.h>
2323 #include <linux/hw_breakpoint.h>
2424 #include <linux/rcupdate.h>
25+#include <linux/module.h>
2526
2627 #include <asm/uaccess.h>
2728 #include <asm/pgtable.h>
@@ -166,6 +167,35 @@ static inline bool invalid_selector(u16 value) · 138 unmodified lines
166167
167168 #define FLAG_MASK FLAG_MASK_32
168169
170+/*
171+ * X86_32 CPUs don't save ss and esp if the CPU is already in kernel mode
172+ * when it traps. The previous stack will be directly underneath the saved
173+ * registers, and 'sp/ss' won't even have been saved. Thus the '&regs->sp'.
174+ *
175+ * Now, if the stack is empty, '&regs->sp' is out of range. In this
176+ * case we try to take the previous stack. To always return a non-null
177+ * stack pointer we fall back to regs as stack if no previous stack
178+ * exists.
179+ *
180+ * This is valid only for kernel mode traps.
181+ */
182+unsigned long kernel_stack_pointer(struct pt_regs *regs)
183+{
184+ unsigned long context = (unsigned long)regs & ~(THREAD_SIZE - 1);
185+ unsigned long sp = (unsigned long)&regs->sp;
186+ struct thread_info *tinfo;
187+
188+ if (context == (sp & ~(THREAD_SIZE - 1)))
189+ return sp;
190+
191+ tinfo = (struct thread_info *)context;
192+ if (tinfo->previous_esp)
193+ return tinfo->previous_esp;
194+
195+ return (unsigned long)regs;
196+}
197+EXPORT_SYMBOL_GPL(kernel_stack_pointer);
198+
169199 static unsigned long *pt_regs_access(struct pt_regs *regs, unsigned long regno)
170200 {
171201 BUILD_BUG_ON(offsetof(struct pt_regs, bx) != 0);
@@ -1511,6 +1541,13 @@ void syscall_trace_leave(struct pt_regs *regs) · 1339 unmodified lines
15111541 {
15121542 bool step;
15131543
1544+ /*
1545+ * We may come here right after calling schedule_user()
1546+ * or do_notify_resume(), in which case we can be in RCU
1547+ * user mode.
1548+ */
1549+ rcu_user_exit();
1550+
15141551 audit_syscall_exit(regs);
15151552
15161553 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
arch/x86/kernel/setup.c+20−7
@@ -921,18 +921,19 @@ void __init setup_arch(char **cmdline_p) · 920 unmodified lines
921921 #ifdef CONFIG_X86_64
922922 if (max_pfn > max_low_pfn) {
923923 int i;
924− for (i = 0; i < e820.nr_map; i++) {
925− struct e820entry *ei = &e820.map[i];
924+ unsigned long start, end;
925+ unsigned long start_pfn, end_pfn;
926926
927− if (ei->addr + ei->size <= 1UL << 32)
928− continue;
927+ for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn,
928+ NULL) {
929929
930− if (ei->type == E820_RESERVED)
930+ end = PFN_PHYS(end_pfn);
931+ if (end <= (1UL<<32))
931932 continue;
932933
934+ start = PFN_PHYS(start_pfn);
933935 max_pfn_mapped = init_memory_mapping(
934− ei->addr < 1UL << 32 ? 1UL << 32 : ei->addr,
935− ei->addr + ei->size);
936+ max((1UL<<32), start), end);
936937 }
937938
938939 /* can we preseve max_low_pfn ?*/
@@ -1048,6 +1049,18 @@ void __init setup_arch(char **cmdline_p) · 109 unmodified lines
10481049 arch_init_ideal_nops();
10491050
10501051 register_refined_jiffies(CLOCK_TICK_RATE);
1052+
1053+#ifdef CONFIG_EFI
1054+ /* Once setup is done above, disable efi_enabled on mismatched
1055+ * firmware/kernel archtectures since there is no support for
1056+ * runtime services.
1057+ */
1058+ if (efi_enabled && IS_ENABLED(CONFIG_X86_64) != efi_64bit) {
1059+ pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n");
1060+ efi_unmap_memmap();
1061+ efi_enabled = 0;
1062+ }
1063+#endif
10511064 }
10521065
10531066 #ifdef CONFIG_X86_32
arch/x86/kernel/smpboot.c+5−0
@@ -68,6 +68,8 @@ · 67 unmodified lines
6868 #include <asm/mwait.h>
6969 #include <asm/apic.h>
7070 #include <asm/io_apic.h>
71+#include <asm/i387.h>
72+#include <asm/fpu-internal.h>
7173 #include <asm/setup.h>
7274 #include <asm/uv/uv.h>
7375 #include <linux/mc146818rtc.h>
@@ -818,6 +820,9 @@ int __cpuinit native_cpu_up(unsigned int cpu, struct task_struct *tidle) · 744 unmodified lines
818820
819821 per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
820822
823+ /* the FPU context is blank, nobody can own it */
824+ __cpu_disable_lazy_restore(cpu);
825+
821826 err = do_boot_cpu(apicid, cpu, tidle);
822827 if (err) {
823828 pr_debug("do_boot_cpu failed %d\n", err);
arch/x86/kvm/cpuid.h+3−0
@@ -24,6 +24,9 @@ static inline bool guest_cpuid_has_xsave(struct kvm_vcpu *vcpu) · 23 unmodified lines
2424 {
2525 struct kvm_cpuid_entry2 *best;
2626
27+ if (!static_cpu_has(X86_FEATURE_XSAVE))
28+ return 0;
29+
2730 best = kvm_find_cpuid_entry(vcpu, 1, 0);
2831 return best && (best->ecx & bit(X86_FEATURE_XSAVE));
2932 }
arch/x86/kvm/emulate.c+1−2
@@ -426,8 +426,7 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt) · 425 unmodified lines
426426 _ASM_EXTABLE(1b, 3b) \
427427 : "=m" ((ctxt)->eflags), "=&r" (_tmp), \
428428 "+a" (*rax), "+d" (*rdx), "+qm"(_ex) \
429− : "i" (EFLAGS_MASK), "m" ((ctxt)->src.val), \
430− "a" (*rax), "d" (*rdx)); \
429+ : "i" (EFLAGS_MASK), "m" ((ctxt)->src.val)); \
431430 } while (0)
432431
433432 /* instruction has only one source operand, destination is implicit (e.g. mul, div, imul, idiv) */
arch/x86/kvm/vmx.c+7−4
@@ -6549,19 +6549,22 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu) · 6548 unmodified lines
65496549 }
65506550 }
65516551
6552− exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL);
65536552 /* Exposing INVPCID only when PCID is exposed */
65546553 best = kvm_find_cpuid_entry(vcpu, 0x7, 0);
65556554 if (vmx_invpcid_supported() &&
65566555 best && (best->ebx & bit(X86_FEATURE_INVPCID)) &&
65576556 guest_cpuid_has_pcid(vcpu)) {
6557+ exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL);
65586558 exec_control |= SECONDARY_EXEC_ENABLE_INVPCID;
65596559 vmcs_write32(SECONDARY_VM_EXEC_CONTROL,
65606560 exec_control);
65616561 } else {
6562− exec_control &= ~SECONDARY_EXEC_ENABLE_INVPCID;
6563− vmcs_write32(SECONDARY_VM_EXEC_CONTROL,
6564− exec_control);
6562+ if (cpu_has_secondary_exec_ctrls()) {
6563+ exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL);
6564+ exec_control &= ~SECONDARY_EXEC_ENABLE_INVPCID;
6565+ vmcs_write32(SECONDARY_VM_EXEC_CONTROL,
6566+ exec_control);
6567+ }
65656568 if (best)
65666569 best->ebx &= ~bit(X86_FEATURE_INVPCID);
65676570 }
arch/x86/kvm/x86.c+37−26
@@ -3779,7 +3779,7 @@ static int write_exit_mmio(struct kvm_vcpu *vcpu, gpa_t gpa, · 3778 unmodified lines
37793779 {
37803780 struct kvm_mmio_fragment *frag = &vcpu->mmio_fragments[0];
37813781
3782− memcpy(vcpu->run->mmio.data, frag->data, frag->len);
3782+ memcpy(vcpu->run->mmio.data, frag->data, min(8u, frag->len));
37833783 return X86EMUL_CONTINUE;
37843784 }
37853785
@@ -3832,18 +3832,11 @@ mmio: · 46 unmodified lines
38323832 bytes -= handled;
38333833 val += handled;
38343834
3835− while (bytes) {
3836− unsigned now = min(bytes, 8U);
3837−
3838− frag = &vcpu->mmio_fragments[vcpu->mmio_nr_fragments++];
3839− frag->gpa = gpa;
3840− frag->data = val;
3841− frag->len = now;
3842−
3843− gpa += now;
3844− val += now;
3845− bytes -= now;
3846− }
3835+ WARN_ON(vcpu->mmio_nr_fragments >= KVM_MAX_MMIO_FRAGMENTS);
3836+ frag = &vcpu->mmio_fragments[vcpu->mmio_nr_fragments++];
3837+ frag->gpa = gpa;
3838+ frag->data = val;
3839+ frag->len = bytes;
38473840 return X86EMUL_CONTINUE;
38483841 }
38493842
@@ -3890,7 +3883,7 @@ int emulator_read_write(struct x86_emulate_ctxt *ctxt, unsigned long addr, · 40 unmodified lines
38903883 vcpu->mmio_needed = 1;
38913884 vcpu->mmio_cur_fragment = 0;
38923885
3893− vcpu->run->mmio.len = vcpu->mmio_fragments[0].len;
3886+ vcpu->run->mmio.len = min(8u, vcpu->mmio_fragments[0].len);
38943887 vcpu->run->mmio.is_write = vcpu->mmio_is_write = ops->write;
38953888 vcpu->run->exit_reason = KVM_EXIT_MMIO;
38963889 vcpu->run->mmio.phys_addr = gpa;
@@ -5522,28 +5515,44 @@ static int complete_emulated_pio(struct kvm_vcpu *vcpu) · 1625 unmodified lines
55225515 *
55235516 * read:
55245517 * for each fragment
5525− * write gpa, len
5526− * exit
5527− * copy data
5518+ * for each mmio piece in the fragment
5519+ * write gpa, len
5520+ * exit
5521+ * copy data
55285522 * execute insn
55295523 *
55305524 * write:
55315525 * for each fragment
5532− * write gpa, len
5533− * copy data
5534− * exit
5526+ * for each mmio piece in the fragment
5527+ * write gpa, len
5528+ * copy data
5529+ * exit
55355530 */
55365531 static int complete_emulated_mmio(struct kvm_vcpu *vcpu)
55375532 {
55385533 struct kvm_run *run = vcpu->run;
55395534 struct kvm_mmio_fragment *frag;
5535+ unsigned len;
55405536
55415537 BUG_ON(!vcpu->mmio_needed);
55425538
55435539 /* Complete previous fragment */
5544− frag = &vcpu->mmio_fragments[vcpu->mmio_cur_fragment++];
5540+ frag = &vcpu->mmio_fragments[vcpu->mmio_cur_fragment];
5541+ len = min(8u, frag->len);
55455542 if (!vcpu->mmio_is_write)
5546− memcpy(frag->data, run->mmio.data, frag->len);
5543+ memcpy(frag->data, run->mmio.data, len);
5544+
5545+ if (frag->len <= 8) {
5546+ /* Switch to the next fragment. */
5547+ frag++;
5548+ vcpu->mmio_cur_fragment++;
5549+ } else {
5550+ /* Go forward to the next mmio piece. */
5551+ frag->data += len;
5552+ frag->gpa += len;
5553+ frag->len -= len;
5554+ }
5555+
55475556 if (vcpu->mmio_cur_fragment == vcpu->mmio_nr_fragments) {
55485557 vcpu->mmio_needed = 0;
55495558 if (vcpu->mmio_is_write)
@@ -5551,13 +5560,12 @@ static int complete_emulated_mmio(struct kvm_vcpu *vcpu) · 1 unmodified line
55515560 vcpu->mmio_read_completed = 1;
55525561 return complete_emulated_io(vcpu);
55535562 }
5554− /* Initiate next fragment */
5555− ++frag;
5563+
55565564 run->exit_reason = KVM_EXIT_MMIO;
55575565 run->mmio.phys_addr = frag->gpa;
55585566 if (vcpu->mmio_is_write)
5559− memcpy(run->mmio.data, frag->data, frag->len);
5560− run->mmio.len = frag->len;
5567+ memcpy(run->mmio.data, frag->data, min(8u, frag->len));
5568+ run->mmio.len = min(8u, frag->len);
55615569 run->mmio.is_write = vcpu->mmio_is_write;
55625570 vcpu->arch.complete_userspace_io = complete_emulated_mmio;
55635571 return 0;
@@ -5773,6 +5781,9 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, · 209 unmodified lines
57735781 int pending_vec, max_bits, idx;
57745782 struct desc_ptr dt;
57755783
5784+ if (!guest_cpuid_has_xsave(vcpu) && (sregs->cr4 & X86_CR4_OSXSAVE))
5785+ return -EINVAL;
5786+
57765787 dt.size = sregs->idt.limit;
57775788 dt.address = sregs->idt.base;
57785789 kvm_x86_ops->set_idt(vcpu, &dt);
arch/x86/mm/init.c+31−27
@@ -35,40 +35,44 @@ struct map_range { · 34 unmodified lines
3535 unsigned page_size_mask;
3636 };
3737
38−static void __init find_early_table_space(struct map_range *mr, unsigned long end,
39− int use_pse, int use_gbpages)
38+/*
39+ * First calculate space needed for kernel direct mapping page tables to cover
40+ * mr[0].start to mr[nr_range - 1].end, while accounting for possible 2M and 1GB
41+ * pages. Then find enough contiguous space for those page tables.
42+ */
43+static void __init find_early_table_space(struct map_range *mr, int nr_range)
4044 {
41− unsigned long puds, pmds, ptes, tables, start = 0, good_end = end;
45+ int i;
46+ unsigned long puds = 0, pmds = 0, ptes = 0, tables;
47+ unsigned long start = 0, good_end;
4248 phys_addr_t base;
4349
44− puds = (end + PUD_SIZE - 1) >> PUD_SHIFT;
45− tables = roundup(puds * sizeof(pud_t), PAGE_SIZE);
46−
47− if (use_gbpages) {
48− unsigned long extra;
49−
50− extra = end - ((end>>PUD_SHIFT) << PUD_SHIFT);
51− pmds = (extra + PMD_SIZE - 1) >> PMD_SHIFT;
52− } else
53− pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT;
50+ for (i = 0; i < nr_range; i++) {
51+ unsigned long range, extra;
5452
55− tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE);
53+ range = mr[i].end - mr[i].start;
54+ puds += (range + PUD_SIZE - 1) >> PUD_SHIFT;
5655
57− if (use_pse) {
58− unsigned long extra;
56+ if (mr[i].page_size_mask & (1 << PG_LEVEL_1G)) {
57+ extra = range - ((range >> PUD_SHIFT) << PUD_SHIFT);
58+ pmds += (extra + PMD_SIZE - 1) >> PMD_SHIFT;
59+ } else {
60+ pmds += (range + PMD_SIZE - 1) >> PMD_SHIFT;
61+ }
5962
60− extra = end - ((end>>PMD_SHIFT) << PMD_SHIFT);
63+ if (mr[i].page_size_mask & (1 << PG_LEVEL_2M)) {
64+ extra = range - ((range >> PMD_SHIFT) << PMD_SHIFT);
6165 #ifdef CONFIG_X86_32
62− extra += PMD_SIZE;
66+ extra += PMD_SIZE;
6367 #endif
64− /* The first 2/4M doesn't use large pages. */
65− if (mr->start < PMD_SIZE)
66− extra += mr->end - mr->start;
67−
68− ptes = (extra + PAGE_SIZE - 1) >> PAGE_SHIFT;
69− } else
70− ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT;
68+ ptes += (extra + PAGE_SIZE - 1) >> PAGE_SHIFT;
69+ } else {
70+ ptes += (range + PAGE_SIZE - 1) >> PAGE_SHIFT;
71+ }
72+ }
7173
74+ tables = roundup(puds * sizeof(pud_t), PAGE_SIZE);
75+ tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE);
7276 tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE);
7377
7478 #ifdef CONFIG_X86_32
@@ -86,7 +90,7 @@ static void __init find_early_table_space(struct map_range *mr, unsigned long en · 11 unmodified lines
8690 pgt_buf_top = pgt_buf_start + (tables >> PAGE_SHIFT);
8791
8892 printk(KERN_DEBUG "kernel direct mapping tables up to %#lx @ [mem %#010lx-%#010lx]\n",
89− end - 1, pgt_buf_start << PAGE_SHIFT,
93+ mr[nr_range - 1].end - 1, pgt_buf_start << PAGE_SHIFT,
9094 (pgt_buf_top << PAGE_SHIFT) - 1);
9195 }
9296
@@ -267,7 +271,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, · 174 unmodified lines
267271 * nodes are discovered.
268272 */
269273 if (!after_bootmem)
270− find_early_table_space(&mr[0], end, use_pse, use_gbpages);
274+ find_early_table_space(mr, nr_range);
271275
272276 for (i = 0; i < nr_range; i++)
273277 ret = kernel_physical_mapping_init(mr[i].start, mr[i].end,
arch/x86/mm/init_64.c+6−1
@@ -386,7 +386,8 @@ phys_pte_init(pte_t *pte_page, unsigned long addr, unsigned long end, · 385 unmodified lines
386386 * these mappings are more intelligent.
387387 */
388388 if (pte_val(*pte)) {
389− pages++;
389+ if (!after_bootmem)
390+ pages++;
390391 continue;
391392 }
392393
@@ -451,6 +452,8 @@ phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end, · 58 unmodified lines
451452 * attributes.
452453 */
453454 if (page_size_mask & (1 << PG_LEVEL_2M)) {
455+ if (!after_bootmem)
456+ pages++;
454457 last_map_addr = next;
455458 continue;
456459 }
@@ -526,6 +529,8 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end, · 69 unmodified lines
526529 * attributes.
527530 */
528531 if (page_size_mask & (1 << PG_LEVEL_1G)) {
532+ if (!after_bootmem)
533+ pages++;
529534 last_map_addr = next;
530535 continue;
531536 }
arch/x86/mm/tlb.c+1−1
@@ -197,7 +197,7 @@ void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, · 196 unmodified lines
197197 }
198198
199199 if (end == TLB_FLUSH_ALL || tlb_flushall_shift == -1
200− || vmflag == VM_HUGETLB) {
200+ || vmflag & VM_HUGETLB) {
201201 local_flush_tlb();
202202 goto flush_all;
203203 }
arch/x86/pci/ce4100.c+13−0
@@ -115,6 +115,16 @@ static void sata_revid_read(struct sim_dev_reg *reg, u32 *value) · 114 unmodified lines
115115 reg_read(reg, value);
116116 }
117117
118+static void reg_noirq_read(struct sim_dev_reg *reg, u32 *value)
119+{
120+ unsigned long flags;
121+
122+ raw_spin_lock_irqsave(&pci_config_lock, flags);
123+ /* force interrupt pin value to 0 */
124+ *value = reg->sim_reg.value & 0xfff00ff;
125+ raw_spin_unlock_irqrestore(&pci_config_lock, flags);
126+}
127+
118128 static struct sim_dev_reg bus1_fixups[] = {
119129 DEFINE_REG(2, 0, 0x10, (16*MB), reg_init, reg_read, reg_write)
120130 DEFINE_REG(2, 0, 0x14, (256), reg_init, reg_read, reg_write)
@@ -144,6 +154,7 @@ static struct sim_dev_reg bus1_fixups[] = { · 23 unmodified lines
144154 DEFINE_REG(11, 5, 0x10, (64*KB), reg_init, reg_read, reg_write)
145155 DEFINE_REG(11, 6, 0x10, (256), reg_init, reg_read, reg_write)
146156 DEFINE_REG(11, 7, 0x10, (64*KB), reg_init, reg_read, reg_write)
157+ DEFINE_REG(11, 7, 0x3c, 256, reg_init, reg_noirq_read, reg_write)
147158 DEFINE_REG(12, 0, 0x10, (128*KB), reg_init, reg_read, reg_write)
148159 DEFINE_REG(12, 0, 0x14, (256), reg_init, reg_read, reg_write)
149160 DEFINE_REG(12, 1, 0x10, (1024), reg_init, reg_read, reg_write)
@@ -161,8 +172,10 @@ static struct sim_dev_reg bus1_fixups[] = { · 11 unmodified lines
161172 DEFINE_REG(16, 0, 0x10, (64*KB), reg_init, reg_read, reg_write)
162173 DEFINE_REG(16, 0, 0x14, (64*MB), reg_init, reg_read, reg_write)
163174 DEFINE_REG(16, 0, 0x18, (64*MB), reg_init, reg_read, reg_write)
175+ DEFINE_REG(16, 0, 0x3c, 256, reg_init, reg_noirq_read, reg_write)
164176 DEFINE_REG(17, 0, 0x10, (128*KB), reg_init, reg_read, reg_write)
165177 DEFINE_REG(18, 0, 0x10, (1*KB), reg_init, reg_read, reg_write)
178+ DEFINE_REG(18, 0, 0x3c, 256, reg_init, reg_noirq_read, reg_write)
166179 };
167180
168181 static void __init init_sim_regs(void)
arch/x86/platform/ce4100/ce4100.c+24−0
@@ -21,12 +21,25 @@ · 20 unmodified lines
2121 #include <asm/i8259.h>
2222 #include <asm/io.h>
2323 #include <asm/io_apic.h>
24+#include <asm/emergency-restart.h>
2425
2526 static int ce4100_i8042_detect(void)
2627 {
2728 return 0;
2829 }
2930
31+/*
32+ * The CE4100 platform has an internal 8051 Microcontroller which is
33+ * responsible for signaling to the external Power Management Unit the
34+ * intention to reset, reboot or power off the system. This 8051 device has
35+ * its command register mapped at I/O port 0xcf9 and the value 0x4 is used
36+ * to power off the system.
37+ */
38+static void ce4100_power_off(void)
39+{
40+ outb(0x4, 0xcf9);
41+}
42+
3043 #ifdef CONFIG_SERIAL_8250
3144
3245 static unsigned int mem_serial_in(struct uart_port *p, int offset)
@@ -139,8 +152,19 @@ void __init x86_ce4100_early_setup(void) · 106 unmodified lines
139152 x86_init.mpparse.find_smp_config = x86_init_noop;
140153 x86_init.pci.init = ce4100_pci_init;
141154
155+ /*
156+ * By default, the reboot method is ACPI which is supported by the
157+ * CE4100 bootloader CEFDK using FADT.ResetReg Address and ResetValue
158+ * the bootloader will however issue a system power off instead of
159+ * reboot. By using BOOT_KBD we ensure proper system reboot as
160+ * expected.
161+ */
162+ reboot_type = BOOT_KBD;
163+
142164 #ifdef CONFIG_X86_IO_APIC
143165 x86_init.pci.init_irq = sdv_pci_init;
144166 x86_init.mpparse.setup_ioapic_ids = setup_ioapic_ids_from_mpc_nocheck;
145167 #endif
168+
169+ pm_power_off = ce4100_power_off;
146170 }
arch/x86/platform/efi/efi.c+28−19
@@ -70,11 +70,15 @@ EXPORT_SYMBOL(efi); · 69 unmodified lines
7070 struct efi_memory_map memmap;
7171
7272 bool efi_64bit;
73−static bool efi_native;
7473
7574 static struct efi efi_phys __initdata;
7675 static efi_system_table_t efi_systab __initdata;
7776
77+static inline bool efi_is_native(void)
78+{
79+ return IS_ENABLED(CONFIG_X86_64) == efi_64bit;
80+}
81+
7882 static int __init setup_noefi(char *arg)
7983 {
8084 efi_enabled = 0;
@@ -420,7 +424,7 @@ void __init efi_reserve_boot_services(void) · 339 unmodified lines
420424 }
421425 }
422426
423−static void __init efi_unmap_memmap(void)
427+void __init efi_unmap_memmap(void)
424428 {
425429 if (memmap.map) {
426430 early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
@@ -432,7 +436,7 @@ void __init efi_free_boot_services(void) · 5 unmodified lines
432436 {
433437 void *p;
434438
435− if (!efi_native)
439+ if (!efi_is_native())
436440 return;
437441
438442 for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
@@ -684,12 +688,10 @@ void __init efi_init(void) · 245 unmodified lines
684688 return;
685689 }
686690 efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab;
687− efi_native = !efi_64bit;
688691 #else
689692 efi_phys.systab = (efi_system_table_t *)
690693 (boot_params.efi_info.efi_systab |
691694 ((__u64)boot_params.efi_info.efi_systab_hi<<32));
692− efi_native = efi_64bit;
693695 #endif
694696
695697 if (efi_systab_init(efi_phys.systab)) {
@@ -723,7 +725,7 @@ void __init efi_init(void) · 27 unmodified lines
723725 * that doesn't match the kernel 32/64-bit mode.
724726 */
725727
726− if (!efi_native)
728+ if (!efi_is_native())
727729 pr_info("No EFI runtime due to 32/64-bit mismatch with kernel\n");
728730 else if (efi_runtime_init()) {
729731 efi_enabled = 0;
@@ -735,7 +737,7 @@ void __init efi_init(void) · 5 unmodified lines
735737 return;
736738 }
737739 #ifdef CONFIG_X86_32
738− if (efi_native) {
740+ if (efi_is_native()) {
739741 x86_platform.get_wallclock = efi_get_time;
740742 x86_platform.set_wallclock = efi_set_rtc_mmss;
741743 }
@@ -810,6 +812,16 @@ void __iomem *efi_lookup_mapped_addr(u64 phys_addr) · 68 unmodified lines
810812 return NULL;
811813 }
812814
815+void efi_memory_uc(u64 addr, unsigned long size)
816+{
817+ unsigned long page_shift = 1UL << EFI_PAGE_SHIFT;
818+ u64 npages;
819+
820+ npages = round_up(size, page_shift) / page_shift;
821+ memrange_efi_to_native(&addr, &npages);
822+ set_memory_uc(addr, npages);
823+}
824+
813825 /*
814826 * This function will switch the EFI runtime services to virtual mode.
815827 * Essentially, look through the EFI memmap and map every region that
@@ -823,7 +835,7 @@ void __init efi_enter_virtual_mode(void) · 7 unmodified lines
823835 efi_memory_desc_t *md, *prev_md = NULL;
824836 efi_status_t status;
825837 unsigned long size;
826− u64 end, systab, addr, npages, end_pfn;
838+ u64 end, systab, end_pfn;
827839 void *p, *va, *new_memmap = NULL;
828840 int count = 0;
829841
@@ -834,7 +846,7 @@ void __init efi_enter_virtual_mode(void) · 4 unmodified lines
834846 * non-native EFI
835847 */
836848
837− if (!efi_native) {
849+ if (!efi_is_native()) {
838850 efi_unmap_memmap();
839851 return;
840852 }
@@ -879,10 +891,14 @@ void __init efi_enter_virtual_mode(void) · 38 unmodified lines
879891 end_pfn = PFN_UP(end);
880892 if (end_pfn <= max_low_pfn_mapped
881893 || (end_pfn > (1UL << (32 - PAGE_SHIFT))
882− && end_pfn <= max_pfn_mapped))
894+ && end_pfn <= max_pfn_mapped)) {
883895 va = __va(md->phys_addr);
884− else
885− va = efi_ioremap(md->phys_addr, size, md->type);
896+
897+ if (!(md->attribute & EFI_MEMORY_WB))
898+ efi_memory_uc((u64)(unsigned long)va, size);
899+ } else
900+ va = efi_ioremap(md->phys_addr, size,
901+ md->type, md->attribute);
886902
887903 md->virt_addr = (u64) (unsigned long) va;
888904
@@ -892,13 +908,6 @@ void __init efi_enter_virtual_mode(void) · 3 unmodified lines
892908 continue;
893909 }
894910
895− if (!(md->attribute & EFI_MEMORY_WB)) {
896− addr = md->virt_addr;
897− npages = md->num_pages;
898− memrange_efi_to_native(&addr, &npages);
899− set_memory_uc(addr, npages);
900− }
901−
902911 systab = (u64) (unsigned long) efi_phys.systab;
903912 if (md->phys_addr <= systab && systab < end) {
904913 systab += md->virt_addr - md->phys_addr;
arch/x86/platform/efi/efi_64.c+5−2
@@ -82,7 +82,7 @@ void __init efi_call_phys_epilog(void) · 81 unmodified lines
8282 }
8383
8484 void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size,
85− u32 type)
85+ u32 type, u64 attribute)
8686 {
8787 unsigned long last_map_pfn;
8888
@@ -92,8 +92,11 @@ void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size, · 3 unmodified lines
9292 last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size);
9393 if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size) {
9494 unsigned long top = last_map_pfn << PAGE_SHIFT;
95− efi_ioremap(top, size - (top - phys_addr), type);
95+ efi_ioremap(top, size - (top - phys_addr), type, attribute);
9696 }
9797
98+ if (!(attribute & EFI_MEMORY_WB))
99+ efi_memory_uc((u64)(unsigned long)__va(phys_addr), size);
100+
98101 return (void __iomem *)__va(phys_addr);
99102 }
arch/x86/xen/mmu.c+20−1
@@ -1288,6 +1288,25 @@ unsigned long xen_read_cr2_direct(void) · 1287 unmodified lines
12881288 return this_cpu_read(xen_vcpu_info.arch.cr2);
12891289 }
12901290
1291+void xen_flush_tlb_all(void)
1292+{
1293+ struct mmuext_op *op;
1294+ struct multicall_space mcs;
1295+
1296+ trace_xen_mmu_flush_tlb_all(0);
1297+
1298+ preempt_disable();
1299+
1300+ mcs = xen_mc_entry(sizeof(*op));
1301+
1302+ op = mcs.args;
1303+ op->cmd = MMUEXT_TLB_FLUSH_ALL;
1304+ MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);
1305+
1306+ xen_mc_issue(PARAVIRT_LAZY_MMU);
1307+
1308+ preempt_enable();
1309+}
12911310 static void xen_flush_tlb(void)
12921311 {
12931312 struct mmuext_op *op;
@@ -2518,7 +2537,7 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma, · 1224 unmodified lines
25182537 err = 0;
25192538 out:
25202539
2521− flush_tlb_all();
2540+ xen_flush_tlb_all();
25222541
25232542 return err;
25242543 }
arch/xtensa/Kconfig+2−0
@@ -13,6 +13,8 @@ config XTENSA · 12 unmodified lines
1313 select GENERIC_CPU_DEVICES
1414 select MODULES_USE_ELF_RELA
1515 select GENERIC_PCI_IOMAP
16+ select GENERIC_KERNEL_THREAD
17+ select GENERIC_KERNEL_EXECVE
1618 select ARCH_WANT_OPTIONAL_GPIOLIB
1719 help
1820 Xtensa processors are 32-bit RISC machines designed by Tensilica
arch/xtensa/include/asm/io.h+4−0
@@ -62,6 +62,10 @@ static inline void __iomem *ioremap(unsigned long offset, unsigned long size) · 61 unmodified lines
6262 static inline void iounmap(volatile void __iomem *addr)
6363 {
6464 }
65+
66+#define virt_to_bus virt_to_phys
67+#define bus_to_virt phys_to_virt
68+
6569 #endif /* CONFIG_MMU */
6670
6771 /*
arch/xtensa/include/asm/processor.h+1−3
@@ -152,6 +152,7 @@ struct thread_struct { · 151 unmodified lines
152152
153153 /* Clearing a0 terminates the backtrace. */
154154 #define start_thread(regs, new_pc, new_sp) \
155+ memset(regs, 0, sizeof(*regs)); \
155156 regs->pc = new_pc; \
156157 regs->ps = USER_PS_VALUE; \
157158 regs->areg[1] = new_sp; \
@@ -168,9 +169,6 @@ struct mm_struct; · 10 unmodified lines
168169 /* Free all resources held by a thread. */
169170 #define release_thread(thread) do { } while(0)
170171
171−/* Create a kernel thread without removing it from tasklists */
172−extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
173−
174172 /* Copy and release all segment info associated with a VM */
175173 #define copy_segments(p, mm) do { } while(0)
176174 #define release_segments(mm) do { } while(0)
arch/xtensa/include/asm/syscall.h+1−1
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010
1111 struct pt_regs;
1212 struct sigaction;
13−asmlinkage long xtensa_execve(char*, char**, char**, struct pt_regs*);
13+asmlinkage long sys_execve(char*, char**, char**, struct pt_regs*);
1414 asmlinkage long xtensa_clone(unsigned long, unsigned long, struct pt_regs*);
1515 asmlinkage long xtensa_ptrace(long, long, long, long);
1616 asmlinkage long xtensa_sigreturn(struct pt_regs*);
arch/xtensa/include/asm/unistd.h+5−10
@@ -1,16 +1,9 @@
1−/*
2− * include/asm-xtensa/unistd.h
3− *
4− * This file is subject to the terms and conditions of the GNU General Public
5− * License. See the file "COPYING" in the main directory of this archive
6− * for more details.
7− *
8− * Copyright (C) 2001 - 2005 Tensilica Inc.
9− */
1+#ifndef _XTENSA_UNISTD_H
2+#define _XTENSA_UNISTD_H
103
4+#define __ARCH_WANT_SYS_EXECVE
115 #include <uapi/asm/unistd.h>
126
13−
147 /*
158 * "Conditional" syscalls
169 *
@@ -37,3 +30,5 @@ · 20 unmodified lines
3730 #define __IGNORE_mmap /* use mmap2 */
3831 #define __IGNORE_vfork /* use clone */
3932 #define __IGNORE_fadvise64 /* use fadvise64_64 */
33+
34+#endif /* _XTENSA_UNISTD_H */
arch/xtensa/include/uapi/asm/unistd.h+4−12
@@ -1,14 +1,4 @@
1−/*
2− * include/asm-xtensa/unistd.h
3− *
4− * This file is subject to the terms and conditions of the GNU General Public
5− * License. See the file "COPYING" in the main directory of this archive
6− * for more details.
7− *
8− * Copyright (C) 2001 - 2012 Tensilica Inc.
9− */
10−
11−#ifndef _UAPI_XTENSA_UNISTD_H
1+#if !defined(_UAPI_XTENSA_UNISTD_H) || defined(__SYSCALL)
122 #define _UAPI_XTENSA_UNISTD_H
133
144 #ifndef __SYSCALL
@@ -272,7 +262,7 @@ __SYSCALL(115, sys_sendmmsg, 4) · 257 unmodified lines
272262 #define __NR_clone 116
273263 __SYSCALL(116, xtensa_clone, 5)
274264 #define __NR_execve 117
275−__SYSCALL(117, xtensa_execve, 3)
265+__SYSCALL(117, sys_execve, 3)
276266 #define __NR_exit 118
277267 __SYSCALL(118, sys_exit, 1)
278268 #define __NR_exit_group 119
@@ -759,4 +749,6 @@ __SYSCALL(331, sys_kcmp, 5) · 480 unmodified lines
759749
760750 #define SYS_XTENSA_COUNT 5 /* count */
761751
752+#undef __SYSCALL
753+
762754 #endif /* _UAPI_XTENSA_UNISTD_H */
arch/xtensa/kernel/entry.S+13−44
@@ -1832,50 +1832,6 @@ ENTRY(system_call) · 1831 unmodified lines
18321832 retw
18331833
18341834
1835−/*
1836− * Create a kernel thread
1837− *
1838− * int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
1839− * a2 a2 a3 a4
1840− */
1841−
1842−ENTRY(kernel_thread)
1843− entry a1, 16
1844−
1845− mov a5, a2 # preserve fn over syscall
1846− mov a7, a3 # preserve args over syscall
1847−
1848− movi a3, _CLONE_VM | _CLONE_UNTRACED
1849− movi a2, __NR_clone
1850− or a6, a4, a3 # arg0: flags
1851− mov a3, a1 # arg1: sp
1852− syscall
1853−
1854− beq a3, a1, 1f # branch if parent
1855− mov a6, a7 # args
1856− callx4 a5 # fn(args)
1857−
1858− movi a2, __NR_exit
1859− syscall # return value of fn(args) still in a6
1860−
1861−1: retw
1862−
1863−/*
1864− * Do a system call from kernel instead of calling sys_execve, so we end up
1865− * with proper pt_regs.
1866− *
1867− * int kernel_execve(const char *fname, char *const argv[], charg *const envp[])
1868− * a2 a2 a3 a4
1869− */
1870−
1871−ENTRY(kernel_execve)
1872− entry a1, 16
1873− mov a6, a2 # arg0 is in a6
1874− movi a2, __NR_execve
1875− syscall
1876−
1877− retw
1878−
18791835 /*
18801836 * Task switch.
18811837 *
@@ -1958,3 +1914,16 @@ ENTRY(ret_from_fork) · 76 unmodified lines
19581914
19591915 j common_exception_return
19601916
1917+/*
1918+ * Kernel thread creation helper
1919+ * On entry, set up by copy_thread: a2 = thread_fn, a3 = thread_fn arg
1920+ * left from _switch_to: a6 = prev
1921+ */
1922+ENTRY(ret_from_kernel_thread)
1923+
1924+ call4 schedule_tail
1925+ mov a6, a3
1926+ callx4 a2
1927+ j common_exception_return
1928+
1929+ENDPROC(ret_from_kernel_thread)
arch/xtensa/kernel/process.c+71−57
@@ -45,6 +45,7 @@ · 44 unmodified lines
4545 #include <asm/regs.h>
4646
4747 extern void ret_from_fork(void);
48+extern void ret_from_kernel_thread(void);
4849
4950 struct task_struct *current_set[NR_CPUS] = {&init_task, };
5051
@@ -158,18 +159,30 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) · 107 unmodified lines
158159 /*
159160 * Copy thread.
160161 *
162+ * There are two modes in which this function is called:
163+ * 1) Userspace thread creation,
164+ * regs != NULL, usp_thread_fn is userspace stack pointer.
165+ * It is expected to copy parent regs (in case CLONE_VM is not set
166+ * in the clone_flags) and set up passed usp in the childregs.
167+ * 2) Kernel thread creation,
168+ * regs == NULL, usp_thread_fn is the function to run in the new thread
169+ * and thread_fn_arg is its parameter.
170+ * childregs are not used for the kernel threads.
171+ *
161172 * The stack layout for the new thread looks like this:
162173 *
163− * +------------------------+ <- sp in childregs (= tos)
174+ * +------------------------+
164175 * | childregs |
165176 * +------------------------+ <- thread.sp = sp in dummy-frame
166177 * | dummy-frame | (saved in dummy-frame spill-area)
167178 * +------------------------+
168179 *
169− * We create a dummy frame to return to ret_from_fork:
170− * a0 points to ret_from_fork (simulating a call4)
180+ * We create a dummy frame to return to either ret_from_fork or
181+ * ret_from_kernel_thread:
182+ * a0 points to ret_from_fork/ret_from_kernel_thread (simulating a call4)
171183 * sp points to itself (thread.sp)
172− * a2, a3 are unused.
184+ * a2, a3 are unused for userspace threads,
185+ * a2 points to thread_fn, a3 holds thread_fn arg for kernel threads.
173186 *
174187 * Note: This is a pristine frame, so we don't need any spill region on top of
175188 * childregs.
@@ -185,43 +198,63 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) · 9 unmodified lines
185198 * involved. Much simpler to just not copy those live frames across.
186199 */
187200
188−int copy_thread(unsigned long clone_flags, unsigned long usp,
189− unsigned long unused,
190− struct task_struct * p, struct pt_regs * regs)
201+int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn,
202+ unsigned long thread_fn_arg,
203+ struct task_struct *p, struct pt_regs *unused)
191204 {
192− struct pt_regs *childregs;
193− unsigned long tos;
194− int user_mode = user_mode(regs);
205+ struct pt_regs *childregs = task_pt_regs(p);
195206
196207 #if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS)
197208 struct thread_info *ti;
198209 #endif
199210
200− /* Set up new TSS. */
201− tos = (unsigned long)task_stack_page(p) + THREAD_SIZE;
202− if (user_mode)
203− childregs = (struct pt_regs*)(tos - PT_USER_SIZE);
204− else
205− childregs = (struct pt_regs*)tos - 1;
206−
207− /* This does not copy all the regs. In a bout of brilliance or madness,
208− ARs beyond a0-a15 exist past the end of the struct. */
209− *childregs = *regs;
210−
211211 /* Create a call4 dummy-frame: a0 = 0, a1 = childregs. */
212212 *((int*)childregs - 3) = (unsigned long)childregs;
213213 *((int*)childregs - 4) = 0;
214214
215− childregs->areg[2] = 0;
216− p->set_child_tid = p->clear_child_tid = NULL;
217− p->thread.ra = MAKE_RA_FOR_CALL((unsigned long)ret_from_fork, 0x1);
218215 p->thread.sp = (unsigned long)childregs;
219216
220− if (user_mode(regs)) {
217+ if (!(p->flags & PF_KTHREAD)) {
218+ struct pt_regs *regs = current_pt_regs();
219+ unsigned long usp = usp_thread_fn ?
220+ usp_thread_fn : regs->areg[1];
221221
222+ p->thread.ra = MAKE_RA_FOR_CALL(
223+ (unsigned long)ret_from_fork, 0x1);
224+
225+ /* This does not copy all the regs.
226+ * In a bout of brilliance or madness,
227+ * ARs beyond a0-a15 exist past the end of the struct.
228+ */
229+ *childregs = *regs;
222230 childregs->areg[1] = usp;
231+ childregs->areg[2] = 0;
232+
233+ /* When sharing memory with the parent thread, the child
234+ usually starts on a pristine stack, so we have to reset
235+ windowbase, windowstart and wmask.
236+ (Note that such a new thread is required to always create
237+ an initial call4 frame)
238+ The exception is vfork, where the new thread continues to
239+ run on the parent's stack until it calls execve. This could
240+ be a call8 or call12, which requires a legal stack frame
241+ of the previous caller for the overflow handlers to work.
242+ (Note that it's always legal to overflow live registers).
243+ In this case, ensure to spill at least the stack pointer
244+ of that frame. */
245+
223246 if (clone_flags & CLONE_VM) {
224− childregs->wmask = 1; /* can't share live windows */
247+ /* check that caller window is live and same stack */
248+ int len = childregs->wmask & ~0xf;
249+ if (regs->areg[1] == usp && len != 0) {
250+ int callinc = (regs->areg[0] >> 30) & 3;
251+ int caller_ars = XCHAL_NUM_AREGS - callinc * 4;
252+ put_user(regs->areg[caller_ars+1],
253+ (unsigned __user*)(usp - 12));
254+ }
255+ childregs->wmask = 1;
256+ childregs->windowstart = 1;
257+ childregs->windowbase = 0;
225258 } else {
226259 int len = childregs->wmask & ~0xf;
227260 memcpy(&childregs->areg[XCHAL_NUM_AREGS - len/4],
@@ -230,11 +263,19 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, · 2 unmodified lines
230263 // FIXME: we need to set THREADPTR in thread_info...
231264 if (clone_flags & CLONE_SETTLS)
232265 childregs->areg[2] = childregs->areg[6];
233−
234266 } else {
235− /* In kernel space, we start a new thread with a new stack. */
236− childregs->wmask = 1;
237− childregs->areg[1] = tos;
267+ p->thread.ra = MAKE_RA_FOR_CALL(
268+ (unsigned long)ret_from_kernel_thread, 1);
269+
270+ /* pass parameters to ret_from_kernel_thread:
271+ * a2 = thread_fn, a3 = thread_fn arg
272+ */
273+ *((int *)childregs - 1) = thread_fn_arg;
274+ *((int *)childregs - 2) = usp_thread_fn;
275+
276+ /* Childregs are only used when we're going to userspace
277+ * in which case start_thread will set them up.
278+ */
238279 }
239280
240281 #if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS)
@@ -330,32 +371,5 @@ long xtensa_clone(unsigned long clone_flags, unsigned long newsp, · 89 unmodified lines
330371 void __user *child_tid, long a5,
331372 struct pt_regs *regs)
332373 {
333− if (!newsp)
334− newsp = regs->areg[1];
335374 return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid);
336375 }
337−
338−/*
339− * xtensa_execve() executes a new program.
340− */
341−
342−asmlinkage
343−long xtensa_execve(const char __user *name,
344− const char __user *const __user *argv,
345− const char __user *const __user *envp,
346− long a3, long a4, long a5,
347− struct pt_regs *regs)
348−{
349− long error;
350− struct filename *filename;
351−
352− filename = getname(name);
353− error = PTR_ERR(filename);
354− if (IS_ERR(filename))
355− goto out;
356− error = do_execve(filename->name, argv, envp, regs);
357− putname(filename);
358−out:
359− return error;
360−}
361−
arch/xtensa/kernel/syscall.c+3−4
@@ -32,10 +32,8 @@ typedef void (*syscall_t)(void); · 31 unmodified lines
3232 syscall_t sys_call_table[__NR_syscall_count] /* FIXME __cacheline_aligned */= {
3333 [0 ... __NR_syscall_count - 1] = (syscall_t)&sys_ni_syscall,
3434
35−#undef __SYSCALL
3635 #define __SYSCALL(nr,symbol,nargs) [ nr ] = (syscall_t)symbol,
37−#undef __KERNEL_SYSCALLS__
38−#include <asm/unistd.h>
36+#include <uapi/asm/unistd.h>
3937 };
4038
4139 asmlinkage long xtensa_shmat(int shmid, char __user *shmaddr, int shmflg)
@@ -49,7 +47,8 @@ asmlinkage long xtensa_shmat(int shmid, char __user *shmaddr, int shmflg) · 7 unmodified lines
4947 return (long)ret;
5048 }
5149
52−asmlinkage long xtensa_fadvise64_64(int fd, int advice, unsigned long long offset, unsigned long long len)
50+asmlinkage long xtensa_fadvise64_64(int fd, int advice,
51+ unsigned long long offset, unsigned long long len)
5352 {
5453 return sys_fadvise64_64(fd, offset, len, advice);
5554 }
arch/xtensa/kernel/xtensa_ksyms.c+0−1
@@ -43,7 +43,6 @@ EXPORT_SYMBOL(__strncpy_user); · 42 unmodified lines
4343 EXPORT_SYMBOL(clear_page);
4444 EXPORT_SYMBOL(copy_page);
4545
46−EXPORT_SYMBOL(kernel_thread);
4746 EXPORT_SYMBOL(empty_zero_page);
4847
4948 /*
block/Kconfig+1−1
@@ -89,7 +89,7 @@ config BLK_DEV_INTEGRITY · 88 unmodified lines
8989
9090 config BLK_DEV_THROTTLING
9191 bool "Block layer bio throttling support"
92− depends on BLK_CGROUP=y && EXPERIMENTAL
92+ depends on BLK_CGROUP=y
9393 default n
9494 ---help---
9595 Block layer bio throttling support. It can be used to limit
block/blk-cgroup.c+10−0
@@ -285,6 +285,13 @@ static void blkg_destroy_all(struct request_queue *q) · 284 unmodified lines
285285 blkg_destroy(blkg);
286286 spin_unlock(&blkcg->lock);
287287 }
288+
289+ /*
290+ * root blkg is destroyed. Just clear the pointer since
291+ * root_rl does not take reference on root blkg.
292+ */
293+ q->root_blkg = NULL;
294+ q->root_rl.blkg = NULL;
288295 }
289296
290297 static void blkg_rcu_free(struct rcu_head *rcu_head)
@@ -326,6 +333,9 @@ struct request_list *__blk_queue_next_rl(struct request_list *rl, · 35 unmodified lines
326333 */
327334 if (rl == &q->root_rl) {
328335 ent = &q->blkg_list;
336+ /* There are no more block groups, hence no request lists */
337+ if (list_empty(ent))
338+ return NULL;
329339 } else {
330340 blkg = container_of(rl, struct blkcg_gq, rl);
331341 ent = &blkg->q_node;
block/blk-core.c+2−1
@@ -2868,7 +2868,8 @@ static int plug_rq_cmp(void *priv, struct list_head *a, struct list_head *b) · 2867 unmodified lines
28682868 struct request *rqa = container_of(a, struct request, queuelist);
28692869 struct request *rqb = container_of(b, struct request, queuelist);
28702870
2871− return !(rqa->q <= rqb->q);
2871+ return !(rqa->q < rqb->q ||
2872+ (rqa->q == rqb->q && blk_rq_pos(rqa) < blk_rq_pos(rqb)));
28722873 }
28732874
28742875 /*
block/blk-exec.c+7−1
@@ -52,11 +52,17 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk, · 51 unmodified lines
5252 rq_end_io_fn *done)
5353 {
5454 int where = at_head ? ELEVATOR_INSERT_FRONT : ELEVATOR_INSERT_BACK;
55+ bool is_pm_resume;
5556
5657 WARN_ON(irqs_disabled());
5758
5859 rq->rq_disk = bd_disk;
5960 rq->end_io = done;
61+ /*
62+ * need to check this before __blk_run_queue(), because rq can
63+ * be freed before that returns.
64+ */
65+ is_pm_resume = rq->cmd_type == REQ_TYPE_PM_RESUME;
6066
6167 spin_lock_irq(q->queue_lock);
6268
@@ -71,7 +77,7 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk, · 8 unmodified lines
7177 __elv_add_request(q, rq, where);
7278 __blk_run_queue(q);
7379 /* the queue is stopped so it won't be run */
74− if (rq->cmd_type == REQ_TYPE_PM_RESUME)
80+ if (is_pm_resume)
7581 q->request_fn(q);
7682 spin_unlock_irq(q->queue_lock);
7783 }
crypto/cryptd.c+8−3
@@ -137,13 +137,18 @@ static void cryptd_queue_worker(struct work_struct *work) · 136 unmodified lines
137137 struct crypto_async_request *req, *backlog;
138138
139139 cpu_queue = container_of(work, struct cryptd_cpu_queue, work);
140− /* Only handle one request at a time to avoid hogging crypto
141− * workqueue. preempt_disable/enable is used to prevent
142− * being preempted by cryptd_enqueue_request() */
140+ /*
141+ * Only handle one request at a time to avoid hogging crypto workqueue.
142+ * preempt_disable/enable is used to prevent being preempted by
143+ * cryptd_enqueue_request(). local_bh_disable/enable is used to prevent
144+ * cryptd_enqueue_request() being accessed from software interrupts.
145+ */
146+ local_bh_disable();
143147 preempt_disable();
144148 backlog = crypto_get_backlog(&cpu_queue->queue);
145149 req = crypto_dequeue_request(&cpu_queue->queue);
146150 preempt_enable();
151+ local_bh_enable();
147152
148153 if (!req)
149154 return;
drivers/acpi/glue.c+1−0
@@ -159,6 +159,7 @@ static int acpi_bind_one(struct device *dev, acpi_handle handle) · 158 unmodified lines
159159 if (physical_node->node_id >= ACPI_MAX_PHYSICAL_NODE) {
160160 retval = -ENOSPC;
161161 mutex_unlock(&acpi_dev->physical_node_lock);
162+ kfree(physical_node);
162163 goto err;
163164 }
164165
drivers/acpi/processor_driver.c+1−0
@@ -409,6 +409,7 @@ static void acpi_processor_notify(struct acpi_device *device, u32 event) · 408 unmodified lines
409409 acpi_bus_generate_proc_event(device, event, 0);
410410 acpi_bus_generate_netlink_event(device->pnp.device_class,
411411 dev_name(&device->dev), event, 0);
412+ break;
412413 default:
413414 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
414415 "Unsupported event [0x%x]\n", event));
drivers/acpi/video.c+7−4
@@ -1345,12 +1345,15 @@ static int · 1344 unmodified lines
13451345 acpi_video_bus_get_devices(struct acpi_video_bus *video,
13461346 struct acpi_device *device)
13471347 {
1348− int status;
1348+ int status = 0;
13491349 struct acpi_device *dev;
13501350
1351− status = acpi_video_device_enumerate(video);
1352− if (status)
1353− return status;
1351+ /*
1352+ * There are systems where video module known to work fine regardless
1353+ * of broken _DOD and ignoring returned value here doesn't cause
1354+ * any issues later.
1355+ */
1356+ acpi_video_device_enumerate(video);
13541357
13551358 list_for_each_entry(dev, &device->children, node) {
13561359
drivers/ata/ahci_platform.c+1−1
@@ -238,7 +238,7 @@ static int __devexit ahci_remove(struct platform_device *pdev) · 237 unmodified lines
238238 return 0;
239239 }
240240
241−#ifdef CONFIG_PM
241+#ifdef CONFIG_PM_SLEEP
242242 static int ahci_suspend(struct device *dev)
243243 {
244244 struct ahci_platform_data *pdata = dev_get_platdata(dev);
drivers/ata/libata-acpi.c+8−3
@@ -1105,10 +1105,15 @@ static int ata_acpi_bind_device(struct ata_port *ap, struct scsi_device *sdev, · 1104 unmodified lines
11051105 struct acpi_device *acpi_dev;
11061106 struct acpi_device_power_state *states;
11071107
1108− if (ap->flags & ATA_FLAG_ACPI_SATA)
1109− ata_dev = &ap->link.device[sdev->channel];
1110− else
1108+ if (ap->flags & ATA_FLAG_ACPI_SATA) {
1109+ if (!sata_pmp_attached(ap))
1110+ ata_dev = &ap->link.device[sdev->id];
1111+ else
1112+ ata_dev = &ap->pmp_link[sdev->channel].device[sdev->id];
1113+ }
1114+ else {
11111115 ata_dev = &ap->link.device[sdev->id];
1116+ }
11121117
11131118 *handle = ata_dev_acpi_handle(ata_dev);
11141119
drivers/ata/libata-core.c+4−0
@@ -2942,6 +2942,10 @@ const struct ata_timing *ata_timing_find_mode(u8 xfer_mode) · 2941 unmodified lines
29422942
29432943 if (xfer_mode == t->mode)
29442944 return t;
2945+
2946+ WARN_ONCE(true, "%s: unable to find timing for xfer_mode 0x%x\n",
2947+ __func__, xfer_mode);
2948+
29452949 return NULL;
29462950 }
29472951
drivers/ata/libata-scsi.c+2−0
@@ -1052,6 +1052,8 @@ static void ata_scsi_sdev_config(struct scsi_device *sdev) · 1051 unmodified lines
10521052 {
10531053 sdev->use_10_for_rw = 1;
10541054 sdev->use_10_for_ms = 1;
1055+ sdev->no_report_opcodes = 1;
1056+ sdev->no_write_same = 1;
10551057
10561058 /* Schedule policy is determined by ->qc_defer() callback and
10571059 * it needs to see every deferred qc. Set dev_blocked to 1 to
drivers/ata/pata_arasan_cf.c+7−1
@@ -317,6 +317,12 @@ static int cf_init(struct arasan_cf_dev *acdev) · 316 unmodified lines
317317 return ret;
318318 }
319319
320+ ret = clk_set_rate(acdev->clk, 166000000);
321+ if (ret) {
322+ dev_warn(acdev->host->dev, "clock set rate failed");
323+ return ret;
324+ }
325+
320326 spin_lock_irqsave(&acdev->host->lock, flags);
321327 /* configure CF interface clock */
322328 writel((pdata->cf_if_clk <= CF_IF_CLK_200M) ? pdata->cf_if_clk :
@@ -908,7 +914,7 @@ static int __devexit arasan_cf_remove(struct platform_device *pdev) · 585 unmodified lines
908914 return 0;
909915 }
910916
911−#ifdef CONFIG_PM
917+#ifdef CONFIG_PM_SLEEP
912918 static int arasan_cf_suspend(struct device *dev)
913919 {
914920 struct ata_host *host = dev_get_drvdata(dev);
drivers/ata/sata_highbank.c+2−2
@@ -260,7 +260,7 @@ static const struct of_device_id ahci_of_match[] = { · 259 unmodified lines
260260 };
261261 MODULE_DEVICE_TABLE(of, ahci_of_match);
262262
263−static int __init ahci_highbank_probe(struct platform_device *pdev)
263+static int __devinit ahci_highbank_probe(struct platform_device *pdev)
264264 {
265265 struct device *dev = &pdev->dev;
266266 struct ahci_host_priv *hpriv;
@@ -378,7 +378,7 @@ static int __devexit ahci_highbank_remove(struct platform_device *pdev) · 111 unmodified lines
378378 return 0;
379379 }
380380
381−#ifdef CONFIG_PM
381+#ifdef CONFIG_PM_SLEEP
382382 static int ahci_highbank_suspend(struct device *dev)
383383 {
384384 struct ata_host *host = dev_get_drvdata(dev);
drivers/ata/sata_svw.c+35−0
@@ -142,6 +142,39 @@ static int k2_sata_scr_write(struct ata_link *link, · 141 unmodified lines
142142 return 0;
143143 }
144144
145+static int k2_sata_softreset(struct ata_link *link,
146+ unsigned int *class, unsigned long deadline)
147+{
148+ u8 dmactl;
149+ void __iomem *mmio = link->ap->ioaddr.bmdma_addr;
150+
151+ dmactl = readb(mmio + ATA_DMA_CMD);
152+
153+ /* Clear the start bit */
154+ if (dmactl & ATA_DMA_START) {
155+ dmactl &= ~ATA_DMA_START;
156+ writeb(dmactl, mmio + ATA_DMA_CMD);
157+ }
158+
159+ return ata_sff_softreset(link, class, deadline);
160+}
161+
162+static int k2_sata_hardreset(struct ata_link *link,
163+ unsigned int *class, unsigned long deadline)
164+{
165+ u8 dmactl;
166+ void __iomem *mmio = link->ap->ioaddr.bmdma_addr;
167+
168+ dmactl = readb(mmio + ATA_DMA_CMD);
169+
170+ /* Clear the start bit */
171+ if (dmactl & ATA_DMA_START) {
172+ dmactl &= ~ATA_DMA_START;
173+ writeb(dmactl, mmio + ATA_DMA_CMD);
174+ }
175+
176+ return sata_sff_hardreset(link, class, deadline);
177+}
145178
146179 static void k2_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
147180 {
@@ -346,6 +379,8 @@ static struct scsi_host_template k2_sata_sht = { · 198 unmodified lines
346379
347380 static struct ata_port_operations k2_sata_ops = {
348381 .inherits = &ata_bmdma_port_ops,
382+ .softreset = k2_sata_softreset,
383+ .hardreset = k2_sata_hardreset,
349384 .sff_tf_load = k2_sata_tf_load,
350385 .sff_tf_read = k2_sata_tf_read,
351386 .sff_check_status = k2_stat_check_status,
drivers/atm/ambassador.c+1−0
@@ -1961,6 +1961,7 @@ static int __devinit ucode_init (loader_block * lb, amb_dev * dev) { · 1960 unmodified lines
19611961 res = loader_verify(lb, dev, rec);
19621962 if (res)
19631963 break;
1964+ rec = ihex_next_binrec(rec);
19641965 }
19651966 release_firmware(fw);
19661967 if (!res)
drivers/base/Kconfig+1−1
@@ -236,7 +236,7 @@ config CMA_SIZE_PERCENTAGE · 235 unmodified lines
236236
237237 choice
238238 prompt "Selected region size"
239− default CMA_SIZE_SEL_ABSOLUTE
239+ default CMA_SIZE_SEL_MBYTES
240240
241241 config CMA_SIZE_SEL_MBYTES
242242 bool "Use mega bytes value only"
drivers/base/dma-coherent.c+2−3
@@ -191,9 +191,8 @@ EXPORT_SYMBOL(dma_release_from_coherent); · 190 unmodified lines
191191 * This checks whether the memory was allocated from the per-device
192192 * coherent memory pool and if so, maps that memory to the provided vma.
193193 *
194− * Returns 1 if we correctly mapped the memory, or 0 if
195− * dma_release_coherent() should proceed with mapping memory from
196− * generic pools.
194+ * Returns 1 if we correctly mapped the memory, or 0 if the caller should
195+ * proceed with mapping memory from generic pools.
197196 */
198197 int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma,
199198 void *vaddr, size_t size, int *ret)
drivers/base/dma-contiguous.c+1−4
@@ -27,15 +27,12 @@ · 26 unmodified lines
2727 #include <linux/mm.h>
2828 #include <linux/mutex.h>
2929 #include <linux/page-isolation.h>
30+#include <linux/sizes.h>
3031 #include <linux/slab.h>
3132 #include <linux/swap.h>
3233 #include <linux/mm_types.h>
3334 #include <linux/dma-contiguous.h>
3435
35−#ifndef SZ_1M
36−#define SZ_1M (1 << 20)
37−#endif
38−
3936 struct cma {
4037 unsigned long base_pfn;
4138 unsigned long count;
drivers/base/firmware_class.c+151−115
@@ -36,68 +36,6 @@ MODULE_AUTHOR("Manuel Estrada Sainz"); · 35 unmodified lines
3636 MODULE_DESCRIPTION("Multi purpose firmware loading support");
3737 MODULE_LICENSE("GPL");
3838
39−static const char *fw_path[] = {
40− "/lib/firmware/updates/" UTS_RELEASE,
41− "/lib/firmware/updates",
42− "/lib/firmware/" UTS_RELEASE,
43− "/lib/firmware"
44−};
45−
46−/* Don't inline this: 'struct kstat' is biggish */
47−static noinline long fw_file_size(struct file *file)
48−{
49− struct kstat st;
50− if (vfs_getattr(file->f_path.mnt, file->f_path.dentry, &st))
51− return -1;
52− if (!S_ISREG(st.mode))
53− return -1;
54− if (st.size != (long)st.size)
55− return -1;
56− return st.size;
57−}
58−
59−static bool fw_read_file_contents(struct file *file, struct firmware *fw)
60−{
61− long size;
62− char *buf;
63−
64− size = fw_file_size(file);
65− if (size < 0)
66− return false;
67− buf = vmalloc(size);
68− if (!buf)
69− return false;
70− if (kernel_read(file, 0, buf, size) != size) {
71− vfree(buf);
72− return false;
73− }
74− fw->data = buf;
75− fw->size = size;
76− return true;
77−}
78−
79−static bool fw_get_filesystem_firmware(struct firmware *fw, const char *name)
80−{
81− int i;
82− bool success = false;
83− char *path = __getname();
84−
85− for (i = 0; i < ARRAY_SIZE(fw_path); i++) {
86− struct file *file;
87− snprintf(path, PATH_MAX, "%s/%s", fw_path[i], name);
88−
89− file = filp_open(path, O_RDONLY, 0);
90− if (IS_ERR(file))
91− continue;
92− success = fw_read_file_contents(file, fw);
93− fput(file);
94− if (success)
95− break;
96− }
97− __putname(path);
98− return success;
99−}
100−
10139 /* Builtin firmware support */
10240
10341 #ifdef CONFIG_FW_LOADER
@@ -150,6 +88,11 @@ enum { · 46 unmodified lines
15088 FW_STATUS_ABORT,
15189 };
15290
91+enum fw_buf_fmt {
92+ VMALLOC_BUF, /* used in direct loading */
93+ PAGE_BUF, /* used in loading via userspace */
94+};
95+
15396 static int loading_timeout = 60; /* In seconds */
15497
15598 static inline long firmware_loading_timeout(void)
@@ -173,8 +116,6 @@ struct firmware_cache { · 17 unmodified lines
173116 spinlock_t name_lock;
174117 struct list_head fw_names;
175118
176− wait_queue_head_t wait_queue;
177− int cnt;
178119 struct delayed_work work;
179120
180121 struct notifier_block pm_notify;
@@ -187,6 +128,7 @@ struct firmware_buf { · 6 unmodified lines
187128 struct completion completion;
188129 struct firmware_cache *fwc;
189130 unsigned long status;
131+ enum fw_buf_fmt fmt;
190132 void *data;
191133 size_t size;
192134 struct page **pages;
@@ -240,6 +182,7 @@ static struct firmware_buf *__allocate_fw_buf(const char *fw_name, · 47 unmodified lines
240182 strcpy(buf->fw_id, fw_name);
241183 buf->fwc = fwc;
242184 init_completion(&buf->completion);
185+ buf->fmt = VMALLOC_BUF;
243186
244187 pr_debug("%s: fw-%s buf=%p\n", __func__, fw_name, buf);
245188
@@ -307,10 +250,14 @@ static void __fw_free_buf(struct kref *ref) · 61 unmodified lines
307250 list_del(&buf->list);
308251 spin_unlock(&fwc->lock);
309252
310− vunmap(buf->data);
311− for (i = 0; i < buf->nr_pages; i++)
312− __free_page(buf->pages[i]);
313− kfree(buf->pages);
253+
254+ if (buf->fmt == PAGE_BUF) {
255+ vunmap(buf->data);
256+ for (i = 0; i < buf->nr_pages; i++)
257+ __free_page(buf->pages[i]);
258+ kfree(buf->pages);
259+ } else
260+ vfree(buf->data);
314261 kfree(buf);
315262 }
316263
@@ -319,6 +266,69 @@ static void fw_free_buf(struct firmware_buf *buf) · 2 unmodified lines
319266 kref_put(&buf->ref, __fw_free_buf);
320267 }
321268
269+/* direct firmware loading support */
270+static const char *fw_path[] = {
271+ "/lib/firmware/updates/" UTS_RELEASE,
272+ "/lib/firmware/updates",
273+ "/lib/firmware/" UTS_RELEASE,
274+ "/lib/firmware"
275+};
276+
277+/* Don't inline this: 'struct kstat' is biggish */
278+static noinline long fw_file_size(struct file *file)
279+{
280+ struct kstat st;
281+ if (vfs_getattr(file->f_path.mnt, file->f_path.dentry, &st))
282+ return -1;
283+ if (!S_ISREG(st.mode))
284+ return -1;
285+ if (st.size != (long)st.size)
286+ return -1;
287+ return st.size;
288+}
289+
290+static bool fw_read_file_contents(struct file *file, struct firmware_buf *fw_buf)
291+{
292+ long size;
293+ char *buf;
294+
295+ size = fw_file_size(file);
296+ if (size < 0)
297+ return false;
298+ buf = vmalloc(size);
299+ if (!buf)
300+ return false;
301+ if (kernel_read(file, 0, buf, size) != size) {
302+ vfree(buf);
303+ return false;
304+ }
305+ fw_buf->data = buf;
306+ fw_buf->size = size;
307+ return true;
308+}
309+
310+static bool fw_get_filesystem_firmware(struct firmware_buf *buf)
311+{
312+ int i;
313+ bool success = false;
314+ char *path = __getname();
315+
316+ for (i = 0; i < ARRAY_SIZE(fw_path); i++) {
317+ struct file *file;
318+ snprintf(path, PATH_MAX, "%s/%s", fw_path[i], buf->fw_id);
319+
320+ file = filp_open(path, O_RDONLY, 0);
321+ if (IS_ERR(file))
322+ continue;
323+ success = fw_read_file_contents(file, buf);
324+ fput(file);
325+ if (success)
326+ break;
327+ }
328+ __putname(path);
329+ return success;
330+}
331+
322332 static struct firmware_priv *to_firmware_priv(struct device *dev)
323333 {
324334 return container_of(dev, struct firmware_priv, dev);
@@ -423,6 +433,21 @@ static void firmware_free_data(const struct firmware *fw) · 98 unmodified lines
423433 #ifndef PAGE_KERNEL_RO
424434 #define PAGE_KERNEL_RO PAGE_KERNEL
425435 #endif
436+
437+/* one pages buffer should be mapped/unmapped only once */
438+static int fw_map_pages_buf(struct firmware_buf *buf)
439+{
440+ if (buf->fmt != PAGE_BUF)
441+ return 0;
442+
443+ if (buf->data)
444+ vunmap(buf->data);
445+ buf->data = vmap(buf->pages, buf->nr_pages, 0, PAGE_KERNEL_RO);
446+ if (!buf->data)
447+ return -ENOMEM;
448+ return 0;
449+}
450+
426451 /**
427452 * firmware_loading_store - set value in the 'loading' control file
428453 * @dev: device pointer
@@ -467,6 +492,14 @@ static ssize_t firmware_loading_store(struct device *dev, · 38 unmodified lines
467492 if (test_bit(FW_STATUS_LOADING, &fw_buf->status)) {
468493 set_bit(FW_STATUS_DONE, &fw_buf->status);
469494 clear_bit(FW_STATUS_LOADING, &fw_buf->status);
495+
496+ /*
497+ * Several loading requests may be pending on
498+ * one same firmware buf, so let all requests
499+ * see the mapped 'buf->data' once the loading
500+ * is completed.
501+ * */
502+ fw_map_pages_buf(fw_buf);
470503 complete_all(&fw_buf->completion);
471504 break;
472505 }
@@ -670,15 +703,6 @@ exit: · 197 unmodified lines
670703 return fw_priv;
671704 }
672705
673−/* one pages buffer is mapped/unmapped only once */
674−static int fw_map_pages_buf(struct firmware_buf *buf)
675−{
676− buf->data = vmap(buf->pages, buf->nr_pages, 0, PAGE_KERNEL_RO);
677− if (!buf->data)
678− return -ENOMEM;
679− return 0;
680−}
681−
682706 /* store the pages buffer info firmware from buf */
683707 static void fw_set_page_data(struct firmware_buf *buf, struct firmware *fw)
684708 {
@@ -778,11 +802,6 @@ _request_firmware_prepare(const struct firmware **firmware_p, const char *name, · 93 unmodified lines
778802 return NULL;
779803 }
780804
781− if (fw_get_filesystem_firmware(firmware, name)) {
782− dev_dbg(device, "firmware: direct-loading firmware %s\n", name);
783− return NULL;
784− }
785−
786805 ret = fw_lookup_and_allocate_buf(name, &fw_cache, &buf);
787806 if (!ret)
788807 fw_priv = fw_create_instance(firmware, name, device,
@@ -832,6 +851,21 @@ static int _request_firmware_load(struct firmware_priv *fw_priv, bool uevent, · 43 unmodified lines
832851 struct device *f_dev = &fw_priv->dev;
833852 struct firmware_buf *buf = fw_priv->buf;
834853 struct firmware_cache *fwc = &fw_cache;
854+ int direct_load = 0;
855+
856+ /* try direct loading from fs first */
857+ if (fw_get_filesystem_firmware(buf)) {
858+ dev_dbg(f_dev->parent, "firmware: direct-loading"
859+ " firmware %s\n", buf->fw_id);
860+
861+ set_bit(FW_STATUS_DONE, &buf->status);
862+ complete_all(&buf->completion);
863+ direct_load = 1;
864+ goto handle_fw;
865+ }
866+
867+ /* fall back on userspace loading */
868+ buf->fmt = PAGE_BUF;
835869
836870 dev_set_uevent_suppress(f_dev, true);
837871
@@ -870,6 +904,7 @@ static int _request_firmware_load(struct firmware_priv *fw_priv, bool uevent, · 32 unmodified lines
870904
871905 del_timer_sync(&fw_priv->timeout);
872906
907+handle_fw:
873908 mutex_lock(&fw_lock);
874909 if (!buf->size || test_bit(FW_STATUS_ABORT, &buf->status))
875910 retval = -ENOENT;
@@ -884,9 +919,6 @@ static int _request_firmware_load(struct firmware_priv *fw_priv, bool uevent, · 8 unmodified lines
884919 if (!retval && f_dev->parent)
885920 fw_add_devm_name(f_dev->parent, buf->fw_id);
886921
887− if (!retval)
888− retval = fw_map_pages_buf(buf);
889−
890922 /*
891923 * After caching firmware image is started, let it piggyback
892924 * on request firmware.
@@ -902,6 +934,9 @@ static int _request_firmware_load(struct firmware_priv *fw_priv, bool uevent, · 9 unmodified lines
902934 fw_priv->buf = NULL;
903935 mutex_unlock(&fw_lock);
904936
937+ if (direct_load)
938+ goto err_put_dev;
939+
905940 device_remove_file(f_dev, &dev_attr_loading);
906941 err_del_bin_attr:
907942 device_remove_bin_file(f_dev, &firmware_attr_data);
@@ -1129,6 +1164,8 @@ int uncache_firmware(const char *fw_name) · 221 unmodified lines
11291164 }
11301165
11311166 #ifdef CONFIG_PM_SLEEP
1167+static ASYNC_DOMAIN_EXCLUSIVE(fw_cache_domain);
1168+
11321169 static struct fw_cache_entry *alloc_fw_cache_entry(const char *name)
11331170 {
11341171 struct fw_cache_entry *fce;
@@ -1142,17 +1179,27 @@ exit: · 7 unmodified lines
11421179 return fce;
11431180 }
11441181
1145−static int fw_cache_piggyback_on_request(const char *name)
1182+static int __fw_entry_found(const char *name)
11461183 {
11471184 struct firmware_cache *fwc = &fw_cache;
11481185 struct fw_cache_entry *fce;
1149− int ret = 0;
11501186
1151− spin_lock(&fwc->name_lock);
11521187 list_for_each_entry(fce, &fwc->fw_names, list) {
11531188 if (!strcmp(fce->name, name))
1154− goto found;
1189+ return 1;
11551190 }
1191+ return 0;
1192+}
1193+
1194+static int fw_cache_piggyback_on_request(const char *name)
1195+{
1196+ struct firmware_cache *fwc = &fw_cache;
1197+ struct fw_cache_entry *fce;
1198+ int ret = 0;
1199+
1200+ spin_lock(&fwc->name_lock);
1201+ if (__fw_entry_found(name))
1202+ goto found;
11561203
11571204 fce = alloc_fw_cache_entry(name);
11581205 if (fce) {
@@ -1185,12 +1232,6 @@ static void __async_dev_cache_fw_image(void *fw_entry, · 26 unmodified lines
11851232
11861233 free_fw_cache_entry(fce);
11871234 }
1188−
1189− spin_lock(&fwc->name_lock);
1190− fwc->cnt--;
1191− spin_unlock(&fwc->name_lock);
1192−
1193− wake_up(&fwc->wait_queue);
11941235 }
11951236
11961237 /* called with dev->devres_lock held */
@@ -1229,11 +1270,19 @@ static void dev_cache_fw_image(struct device *dev, void *data) · 32 unmodified lines
12291270 list_del(&fce->list);
12301271
12311272 spin_lock(&fwc->name_lock);
1232− fwc->cnt++;
1233− list_add(&fce->list, &fwc->fw_names);
1273+ /* only one cache entry for one firmware */
1274+ if (!__fw_entry_found(fce->name)) {
1275+ list_add(&fce->list, &fwc->fw_names);
1276+ } else {
1277+ free_fw_cache_entry(fce);
1278+ fce = NULL;
1279+ }
12341280 spin_unlock(&fwc->name_lock);
12351281
1236− async_schedule(__async_dev_cache_fw_image, (void *)fce);
1282+ if (fce)
1283+ async_schedule_domain(__async_dev_cache_fw_image,
1284+ (void *)fce,
1285+ &fw_cache_domain);
12371286 }
12381287 }
12391288
@@ -1275,6 +1324,9 @@ static void device_cache_fw_images(void) · 35 unmodified lines
12751324
12761325 pr_debug("%s\n", __func__);
12771326
1327+ /* cancel uncache work */
1328+ cancel_delayed_work_sync(&fwc->work);
1329+
12781330 /*
12791331 * use small loading timeout for caching devices' firmware
12801332 * because all these firmware images have been loaded
@@ -1292,21 +1344,7 @@ static void device_cache_fw_images(void) · 11 unmodified lines
12921344 mutex_unlock(&fw_lock);
12931345
12941346 /* wait for completion of caching firmware for all devices */
1295− spin_lock(&fwc->name_lock);
1296− for (;;) {
1297− prepare_to_wait(&fwc->wait_queue, &wait,
1298− TASK_UNINTERRUPTIBLE);
1299− if (!fwc->cnt)
1300− break;
1301−
1302− spin_unlock(&fwc->name_lock);
1303−
1304− schedule();
1305−
1306− spin_lock(&fwc->name_lock);
1307− }
1308− spin_unlock(&fwc->name_lock);
1309− finish_wait(&fwc->wait_queue, &wait);
1347+ async_synchronize_full_domain(&fw_cache_domain);
13101348
13111349 loading_timeout = old_timeout;
13121350 }
@@ -1394,9 +1432,7 @@ static void __init fw_cache_init(void) · 81 unmodified lines
13941432 #ifdef CONFIG_PM_SLEEP
13951433 spin_lock_init(&fw_cache.name_lock);
13961434 INIT_LIST_HEAD(&fw_cache.fw_names);
1397− fw_cache.cnt = 0;
13981435
1399− init_waitqueue_head(&fw_cache.wait_queue);
14001436 INIT_DELAYED_WORK(&fw_cache.work,
14011437 device_uncache_fw_images_work);
14021438
drivers/base/platform.c+7−0
@@ -83,9 +83,16 @@ EXPORT_SYMBOL_GPL(platform_get_resource); · 82 unmodified lines
8383 */
8484 int platform_get_irq(struct platform_device *dev, unsigned int num)
8585 {
86+#ifdef CONFIG_SPARC
87+ /* sparc does not have irqs represented as IORESOURCE_IRQ resources */
88+ if (!dev || num >= dev->archdata.num_irqs)
89+ return -ENXIO;
90+ return dev->archdata.irqs[num];
91+#else
8692 struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num);
8793
8894 return r ? r->start : -ENXIO;
95+#endif
8996 }
9097 EXPORT_SYMBOL_GPL(platform_get_irq);
9198
drivers/base/power/domain.c+4−1
@@ -1862,7 +1862,7 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state) · 1861 unmodified lines
18621862 cpuidle_drv = cpuidle_driver_ref();
18631863 if (!cpuidle_drv) {
18641864 ret = -ENODEV;
1865− goto out;
1865+ goto err_drv;
18661866 }
18671867 if (cpuidle_drv->state_count <= state) {
18681868 ret = -EINVAL;
@@ -1884,6 +1884,9 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state) · 15 unmodified lines
18841884
18851885 err:
18861886 cpuidle_driver_unref();
1887+
1888+ err_drv:
1889+ kfree(cpu_data);
18871890 goto out;
18881891 }
18891892
drivers/base/power/qos.c+1−1
@@ -451,7 +451,7 @@ int dev_pm_qos_add_ancestor_request(struct device *dev, · 450 unmodified lines
451451 if (ancestor)
452452 error = dev_pm_qos_add_request(ancestor, req, value);
453453
454− if (error)
454+ if (error < 0)
455455 req->dev = NULL;
456456
457457 return error;
drivers/bcma/main.c+3−2
@@ -158,9 +158,10 @@ static int bcma_register_cores(struct bcma_bus *bus) · 157 unmodified lines
158158
159159 static void bcma_unregister_cores(struct bcma_bus *bus)
160160 {
161− struct bcma_device *core;
161+ struct bcma_device *core, *tmp;
162162
163− list_for_each_entry(core, &bus->cores, list) {
163+ list_for_each_entry_safe(core, tmp, &bus->cores, list) {
164+ list_del(&core->list);
164165 if (core->dev_registered)
165166 device_unregister(&core->dev);
166167 }
drivers/block/Kconfig+8−7
@@ -131,6 +131,7 @@ config BLK_CPQ_DA · 130 unmodified lines
131131 config BLK_CPQ_CISS_DA
132132 tristate "Compaq Smart Array 5xxx support"
133133 depends on PCI
134+ select CHECK_SIGNATURE
134135 help
135136 This is the driver for Compaq Smart Array 5xxx controllers.
136137 Everyone using these boards should say Y here.
@@ -166,8 +167,8 @@ config BLK_DEV_DAC960 · 29 unmodified lines
166167 module will be called DAC960.
167168
168169 config BLK_DEV_UMEM
169− tristate "Micro Memory MM5415 Battery Backed RAM support (EXPERIMENTAL)"
170− depends on PCI && EXPERIMENTAL
170+ tristate "Micro Memory MM5415 Battery Backed RAM support"
171+ depends on PCI
171172 ---help---
172173 Saying Y here will include support for the MM5415 family of
173174 battery backed (Non-volatile) RAM cards.
@@ -430,8 +431,8 @@ config CDROM_PKTCDVD_BUFFERS · 256 unmodified lines
430431 a disc is opened for writing.
431432
432433 config CDROM_PKTCDVD_WCACHE
433− bool "Enable write caching (EXPERIMENTAL)"
434− depends on CDROM_PKTCDVD && EXPERIMENTAL
434+ bool "Enable write caching"
435+ depends on CDROM_PKTCDVD
435436 help
436437 If enabled, write caching will be set for the CD-R/W device. For now
437438 this option is dangerous unless the CD-RW media is known good, as we
@@ -508,8 +509,8 @@ config XEN_BLKDEV_BACKEND · 70 unmodified lines
508509
509510
510511 config VIRTIO_BLK
511− tristate "Virtio block driver (EXPERIMENTAL)"
512− depends on EXPERIMENTAL && VIRTIO
512+ tristate "Virtio block driver"
513+ depends on VIRTIO
513514 ---help---
514515 This is the virtual block driver for virtio. It can be used with
515516 lguest or QEMU based VMMs (like KVM or Xen). Say Y or M.
@@ -528,7 +529,7 @@ config BLK_DEV_HD · 12 unmodified lines
528529
529530 config BLK_DEV_RBD
530531 tristate "Rados block device (RBD)"
531− depends on INET && EXPERIMENTAL && BLOCK
532+ depends on INET && BLOCK
532533 select CEPH_LIB
533534 select LIBCRC32C
534535 select CRYPTO_AES
drivers/block/aoe/aoecmd.c+1−1
@@ -935,7 +935,7 @@ aoe_end_request(struct aoedev *d, struct request *rq, int fastfail) · 934 unmodified lines
935935
936936 /* cf. http://lkml.org/lkml/2006/10/31/28 */
937937 if (!fastfail)
938− q->request_fn(q);
938+ __blk_run_queue(q);
939939 }
940940
941941 static void
drivers/block/cciss.c+0−1
@@ -5205,7 +5205,6 @@ static void cciss_shutdown(struct pci_dev *pdev) · 5204 unmodified lines
52055205 return;
52065206 }
52075207 /* write all data in the battery backed cache to disk */
5208− memset(flush_buf, 0, 4);
52095208 return_code = sendcmd_withirq(h, CCISS_CACHE_FLUSH, flush_buf,
52105209 4, 0, CTLR_LUNID, TYPE_CMD);
52115210 kfree(flush_buf);
drivers/block/floppy.c+50−43
@@ -4109,12 +4109,19 @@ static struct platform_driver floppy_driver = { · 4108 unmodified lines
41094109
41104110 static struct platform_device floppy_device[N_DRIVE];
41114111
4112+static bool floppy_available(int drive)
4113+{
4114+ if (!(allowed_drive_mask & (1 << drive)))
4115+ return false;
4116+ if (fdc_state[FDC(drive)].version == FDC_NONE)
4117+ return false;
4118+ return true;
4119+}
4120+
41124121 static struct kobject *floppy_find(dev_t dev, int *part, void *data)
41134122 {
41144123 int drive = (*part & 3) | ((*part & 0x80) >> 5);
4115− if (drive >= N_DRIVE ||
4116− !(allowed_drive_mask & (1 << drive)) ||
4117− fdc_state[FDC(drive)].version == FDC_NONE)
4124+ if (drive >= N_DRIVE || !floppy_available(drive))
41184125 return NULL;
41194126 if (((*part >> 2) & 0x1f) >= ARRAY_SIZE(floppy_type))
41204127 return NULL;
@@ -4124,8 +4131,7 @@ static struct kobject *floppy_find(dev_t dev, int *part, void *data) · 3 unmodified lines
41244131
41254132 static int __init do_floppy_init(void)
41264133 {
4127− int i, unit, drive;
4128− int err, dr;
4134+ int i, unit, drive, err;
41294135
41304136 set_debugt();
41314137 interruptjiffies = resultjiffies = jiffies;
@@ -4137,34 +4143,32 @@ static int __init do_floppy_init(void) · 5 unmodified lines
41374143
41384144 raw_cmd = NULL;
41394145
4140− for (dr = 0; dr < N_DRIVE; dr++) {
4141− disks[dr] = alloc_disk(1);
4142− if (!disks[dr]) {
4143− err = -ENOMEM;
4144− goto out_put_disk;
4145− }
4146+ floppy_wq = alloc_ordered_workqueue("floppy", 0);
4147+ if (!floppy_wq)
4148+ return -ENOMEM;
41464149
4147− floppy_wq = alloc_ordered_workqueue("floppy", 0);
4148− if (!floppy_wq) {
4150+ for (drive = 0; drive < N_DRIVE; drive++) {
4151+ disks[drive] = alloc_disk(1);
4152+ if (!disks[drive]) {
41494153 err = -ENOMEM;
41504154 goto out_put_disk;
41514155 }
41524156
4153− disks[dr]->queue = blk_init_queue(do_fd_request, &floppy_lock);
4154− if (!disks[dr]->queue) {
4157+ disks[drive]->queue = blk_init_queue(do_fd_request, &floppy_lock);
4158+ if (!disks[drive]->queue) {
41554159 err = -ENOMEM;
4156− goto out_destroy_workq;
4160+ goto out_put_disk;
41574161 }
41584162
4159− blk_queue_max_hw_sectors(disks[dr]->queue, 64);
4160− disks[dr]->major = FLOPPY_MAJOR;
4161− disks[dr]->first_minor = TOMINOR(dr);
4162− disks[dr]->fops = &floppy_fops;
4163− sprintf(disks[dr]->disk_name, "fd%d", dr);
4163+ blk_queue_max_hw_sectors(disks[drive]->queue, 64);
4164+ disks[drive]->major = FLOPPY_MAJOR;
4165+ disks[drive]->first_minor = TOMINOR(drive);
4166+ disks[drive]->fops = &floppy_fops;
4167+ sprintf(disks[drive]->disk_name, "fd%d", drive);
41644168
4165− init_timer(&motor_off_timer[dr]);
4166− motor_off_timer[dr].data = dr;
4167− motor_off_timer[dr].function = motor_off_callback;
4169+ init_timer(&motor_off_timer[drive]);
4170+ motor_off_timer[drive].data = drive;
4171+ motor_off_timer[drive].function = motor_off_callback;
41684172 }
41694173
41704174 err = register_blkdev(FLOPPY_MAJOR, "fd");
@@ -4282,9 +4286,7 @@ static int __init do_floppy_init(void) · 111 unmodified lines
42824286 }
42834287
42844288 for (drive = 0; drive < N_DRIVE; drive++) {
4285− if (!(allowed_drive_mask & (1 << drive)))
4286− continue;
4287− if (fdc_state[FDC(drive)].version == FDC_NONE)
4289+ if (!floppy_available(drive))
42884290 continue;
42894291
42904292 floppy_device[drive].name = floppy_device_name;
@@ -4293,7 +4295,7 @@ static int __init do_floppy_init(void) · 2 unmodified lines
42934295
42944296 err = platform_device_register(&floppy_device[drive]);
42954297 if (err)
4296− goto out_release_dma;
4298+ goto out_remove_drives;
42974299
42984300 err = device_create_file(&floppy_device[drive].dev,
42994301 &dev_attr_cmos);
@@ -4311,28 +4313,33 @@ static int __init do_floppy_init(void) · 11 unmodified lines
43114313
43124314 out_unreg_platform_dev:
43134315 platform_device_unregister(&floppy_device[drive]);
4316+out_remove_drives:
4317+ while (drive--) {
4318+ if (floppy_available(drive)) {
4319+ del_gendisk(disks[drive]);
4320+ device_remove_file(&floppy_device[drive].dev, &dev_attr_cmos);
4321+ platform_device_unregister(&floppy_device[drive]);
4322+ }
4323+ }
43144324 out_release_dma:
43154325 if (atomic_read(&usage_count))
43164326 floppy_release_irq_and_dma();
43174327 out_unreg_region:
43184328 blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256);
43194329 platform_driver_unregister(&floppy_driver);
4320−out_destroy_workq:
4321− destroy_workqueue(floppy_wq);
43224330 out_unreg_blkdev:
43234331 unregister_blkdev(FLOPPY_MAJOR, "fd");
43244332 out_put_disk:
4325− while (dr--) {
4326− del_timer_sync(&motor_off_timer[dr]);
4327− if (disks[dr]->queue) {
4328− blk_cleanup_queue(disks[dr]->queue);
4329− /*
4330− * put_disk() is not paired with add_disk() and
4331− * will put queue reference one extra time. fix it.
4332− */
4333− disks[dr]->queue = NULL;
4333+ destroy_workqueue(floppy_wq);
4334+ for (drive = 0; drive < N_DRIVE; drive++) {
4335+ if (!disks[drive])
4336+ break;
4337+ if (disks[drive]->queue) {
4338+ del_timer_sync(&motor_off_timer[drive]);
4339+ blk_cleanup_queue(disks[drive]->queue);
4340+ disks[drive]->queue = NULL;
43344341 }
4335− put_disk(disks[dr]);
4342+ put_disk(disks[drive]);
43364343 }
43374344 return err;
43384345 }
@@ -4548,11 +4555,12 @@ static void __exit floppy_module_exit(void) · 209 unmodified lines
45484555 unregister_blkdev(FLOPPY_MAJOR, "fd");
45494556 platform_driver_unregister(&floppy_driver);
45504557
4558+ destroy_workqueue(floppy_wq);
4559+
45514560 for (drive = 0; drive < N_DRIVE; drive++) {
45524561 del_timer_sync(&motor_off_timer[drive]);
45534562
4554− if ((allowed_drive_mask & (1 << drive)) &&
4555− fdc_state[FDC(drive)].version != FDC_NONE) {
4563+ if (floppy_available(drive)) {
45564564 del_gendisk(disks[drive]);
45574565 device_remove_file(&floppy_device[drive].dev, &dev_attr_cmos);
45584566 platform_device_unregister(&floppy_device[drive]);
@@ -4572,7 +4580,6 @@ static void __exit floppy_module_exit(void) · 13 unmodified lines
45724580
45734581 cancel_delayed_work_sync(&fd_timeout);
45744582 cancel_delayed_work_sync(&fd_timer);
4575− destroy_workqueue(floppy_wq);
45764583
45774584 if (atomic_read(&usage_count))
45784585 floppy_release_irq_and_dma();
drivers/block/loop.c+15−2
@@ -976,8 +976,21 @@ static int loop_clr_fd(struct loop_device *lo) · 975 unmodified lines
976976 if (lo->lo_state != Lo_bound)
977977 return -ENXIO;
978978
979− if (lo->lo_refcnt > 1) /* we needed one fd for the ioctl */
980− return -EBUSY;
979+ /*
980+ * If we've explicitly asked to tear down the loop device,
981+ * and it has an elevated reference count, set it for auto-teardown when
982+ * the last reference goes away. This stops $!~#$@ udev from
983+ * preventing teardown because it decided that it needs to run blkid on
984+ * the loopback device whenever they appear. xfstests is notorious for
985+ * failing tests because blkid via udev races with a losetup
986+ * <dev>/do something like mkfs/losetup -d <dev> causing the losetup -d
987+ * command to fail with EBUSY.
988+ */
989+ if (lo->lo_refcnt > 1) {
990+ lo->lo_flags |= LO_FLAGS_AUTOCLEAR;
991+ mutex_unlock(&lo->lo_ctl_mutex);
992+ return 0;
993+ }
981994
982995 if (filp == NULL)
983996 return -EINVAL;
drivers/block/mtip32xx/mtip32xx.c+25−8
@@ -559,7 +559,7 @@ static void mtip_timeout_function(unsigned long int data) · 558 unmodified lines
559559 struct mtip_cmd *command;
560560 int tag, cmdto_cnt = 0;
561561 unsigned int bit, group;
562− unsigned int num_command_slots = port->dd->slot_groups * 32;
562+ unsigned int num_command_slots;
563563 unsigned long to, tagaccum[SLOTBITS_IN_LONGS];
564564
565565 if (unlikely(!port))
@@ -572,6 +572,7 @@ static void mtip_timeout_function(unsigned long int data) · 6 unmodified lines
572572 }
573573 /* clear the tag accumulator */
574574 memset(tagaccum, 0, SLOTBITS_IN_LONGS * sizeof(long));
575+ num_command_slots = port->dd->slot_groups * 32;
575576
576577 for (tag = 0; tag < num_command_slots; tag++) {
577578 /*
@@ -2035,8 +2036,9 @@ static unsigned int implicit_sector(unsigned char command, · 1457 unmodified lines
20352036 }
20362037 return rv;
20372038 }
2038−
2039−static void mtip_set_timeout(struct host_to_dev_fis *fis, unsigned int *timeout)
2039+static void mtip_set_timeout(struct driver_data *dd,
2040+ struct host_to_dev_fis *fis,
2041+ unsigned int *timeout, u8 erasemode)
20402042 {
20412043 switch (fis->command) {
20422044 case ATA_CMD_DOWNLOAD_MICRO:
@@ -2044,7 +2046,10 @@ static void mtip_set_timeout(struct host_to_dev_fis *fis, unsigned int *timeout) · 1 unmodified line
20442046 break;
20452047 case ATA_CMD_SEC_ERASE_UNIT:
20462048 case 0xFC:
2047− *timeout = 240000; /* 4 minutes */
2049+ if (erasemode)
2050+ *timeout = ((*(dd->port->identify + 90) * 2) * 60000);
2051+ else
2052+ *timeout = ((*(dd->port->identify + 89) * 2) * 60000);
20482053 break;
20492054 case ATA_CMD_STANDBYNOW1:
20502055 *timeout = 120000; /* 2 minutes */
@@ -2087,6 +2092,7 @@ static int exec_drive_taskfile(struct driver_data *dd, · 36 unmodified lines
20872092 unsigned int transfer_size;
20882093 unsigned long task_file_data;
20892094 int intotal = outtotal + req_task->out_size;
2095+ int erasemode = 0;
20902096
20912097 taskout = req_task->out_size;
20922098 taskin = req_task->in_size;
@@ -2212,7 +2218,13 @@ static int exec_drive_taskfile(struct driver_data *dd, · 119 unmodified lines
22122218 fis.lba_hi,
22132219 fis.device);
22142220
2215− mtip_set_timeout(&fis, &timeout);
2221+ /* check for erase mode support during secure erase.*/
2222+ if ((fis.command == ATA_CMD_SEC_ERASE_UNIT) && outbuf &&
2223+ (outbuf[0] & MTIP_SEC_ERASE_MODE)) {
2224+ erasemode = 1;
2225+ }
2226+
2227+ mtip_set_timeout(dd, &fis, &timeout, erasemode);
22162228
22172229 /* Determine the correct transfer size.*/
22182230 if (force_single_sector)
@@ -2428,7 +2440,7 @@ static int mtip_hw_ioctl(struct driver_data *dd, unsigned int cmd, · 209 unmodified lines
24282440 * return value
24292441 * None
24302442 */
2431−static void mtip_hw_submit_io(struct driver_data *dd, sector_t start,
2443+static void mtip_hw_submit_io(struct driver_data *dd, sector_t sector,
24322444 int nsect, int nents, int tag, void *callback,
24332445 void *data, int dir)
24342446 {
@@ -2436,6 +2448,7 @@ static void mtip_hw_submit_io(struct driver_data *dd, sector_t start, · 1 unmodified line
24362448 struct mtip_port *port = dd->port;
24372449 struct mtip_cmd *command = &port->commands[tag];
24382450 int dma_dir = (dir == READ) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
2451+ u64 start = sector;
24392452
24402453 /* Map the scatter list for DMA access */
24412454 nents = dma_map_sg(&dd->pdev->dev, command->sg, nents, dma_dir);
@@ -2454,8 +2467,12 @@ static void mtip_hw_submit_io(struct driver_data *dd, sector_t start, · 12 unmodified lines
24542467 fis->opts = 1 << 7;
24552468 fis->command =
24562469 (dir == READ ? ATA_CMD_FPDMA_READ : ATA_CMD_FPDMA_WRITE);
2457− *((unsigned int *) &fis->lba_low) = (start & 0xFFFFFF);
2458− *((unsigned int *) &fis->lba_low_ex) = ((start >> 24) & 0xFFFFFF);
2470+ fis->lba_low = start & 0xFF;
2471+ fis->lba_mid = (start >> 8) & 0xFF;
2472+ fis->lba_hi = (start >> 16) & 0xFF;
2473+ fis->lba_low_ex = (start >> 24) & 0xFF;
2474+ fis->lba_mid_ex = (start >> 32) & 0xFF;
2475+ fis->lba_hi_ex = (start >> 40) & 0xFF;
24592476 fis->device = 1 << 6;
24602477 fis->features = nsect & 0xFF;
24612478 fis->features_ex = (nsect >> 8) & 0xFF;
drivers/block/mtip32xx/mtip32xx.h+5−2
@@ -33,6 +33,9 @@ · 32 unmodified lines
3333 /* offset of Device Control register in PCIe extended capabilites space */
3434 #define PCIE_CONFIG_EXT_DEVICE_CONTROL_OFFSET 0x48
3535
36+/* check for erase mode support during secure erase */
37+#define MTIP_SEC_ERASE_MODE 0x2
38+
3639 /* # of times to retry timed out/failed IOs */
3740 #define MTIP_MAX_RETRIES 2
3841
@@ -152,14 +155,14 @@ enum { · 113 unmodified lines
152155 MTIP_DDF_REBUILD_FAILED_BIT = 8,
153156 };
154157
155−__packed struct smart_attr{
158+struct smart_attr {
156159 u8 attr_id;
157160 u16 flags;
158161 u8 cur;
159162 u8 worst;
160163 u32 data;
161164 u8 res[3];
162−};
165+} __packed;
163166
164167 /* Register Frame Information Structure (FIS), host to device. */
165168 struct host_to_dev_fis {
drivers/block/xen-blkback/common.h+2−2
@@ -158,8 +158,8 @@ struct xen_vbd { · 157 unmodified lines
158158 struct block_device *bdev;
159159 /* Cached size parameter. */
160160 sector_t size;
161− bool flush_support;
162− bool discard_secure;
161+ unsigned int flush_support:1;
162+ unsigned int discard_secure:1;
163163 };
164164
165165 struct backend_info;
drivers/block/xen-blkback/xenbus.c+4−5
@@ -105,11 +105,10 @@ static struct xen_blkif *xen_blkif_alloc(domid_t domid) · 104 unmodified lines
105105 {
106106 struct xen_blkif *blkif;
107107
108− blkif = kmem_cache_alloc(xen_blkif_cachep, GFP_KERNEL);
108+ blkif = kmem_cache_zalloc(xen_blkif_cachep, GFP_KERNEL);
109109 if (!blkif)
110110 return ERR_PTR(-ENOMEM);
111111
112− memset(blkif, 0, sizeof(*blkif));
113112 blkif->domid = domid;
114113 spin_lock_init(&blkif->blk_ring_lock);
115114 atomic_set(&blkif->refcnt, 1);
@@ -196,7 +195,7 @@ static void xen_blkif_disconnect(struct xen_blkif *blkif) · 80 unmodified lines
196195 }
197196 }
198197
199−void xen_blkif_free(struct xen_blkif *blkif)
198+static void xen_blkif_free(struct xen_blkif *blkif)
200199 {
201200 if (!atomic_dec_and_test(&blkif->refcnt))
202201 BUG();
@@ -257,7 +256,7 @@ static struct attribute_group xen_vbdstat_group = { · 54 unmodified lines
257256 VBD_SHOW(physical_device, "%x:%x\n", be->major, be->minor);
258257 VBD_SHOW(mode, "%s\n", be->mode);
259258
260−int xenvbd_sysfs_addif(struct xenbus_device *dev)
259+static int xenvbd_sysfs_addif(struct xenbus_device *dev)
261260 {
262261 int error;
263262
@@ -281,7 +280,7 @@ fail1: device_remove_file(&dev->dev, &dev_attr_physical_device); · 17 unmodified lines
281280 return error;
282281 }
283282
284−void xenvbd_sysfs_delif(struct xenbus_device *dev)
283+static void xenvbd_sysfs_delif(struct xenbus_device *dev)
285284 {
286285 sysfs_remove_group(&dev->dev.kobj, &xen_vbdstat_group);
287286 device_remove_file(&dev->dev, &dev_attr_mode);
drivers/bluetooth/ath3k.c+1−0
@@ -67,6 +67,7 @@ static struct usb_device_id ath3k_table[] = { · 66 unmodified lines
6767 { USB_DEVICE(0x13d3, 0x3304) },
6868 { USB_DEVICE(0x0930, 0x0215) },
6969 { USB_DEVICE(0x0489, 0xE03D) },
70+ { USB_DEVICE(0x0489, 0xE027) },
7071
7172 /* Atheros AR9285 Malbec with sflash firmware */
7273 { USB_DEVICE(0x03F0, 0x311D) },
drivers/bluetooth/btusb.c+1−0
@@ -124,6 +124,7 @@ static struct usb_device_id blacklist_table[] = { · 123 unmodified lines
124124 { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE },
125125 { USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE },
126126 { USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE },
127+ { USB_DEVICE(0x0489, 0xe027), .driver_info = BTUSB_IGNORE },
127128
128129 /* Atheros AR9285 Malbec with sflash firmware */
129130 { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
drivers/bus/omap-ocp2scp.c+65−3
@@ -22,6 +22,26 @@ · 21 unmodified lines
2222 #include <linux/pm_runtime.h>
2323 #include <linux/of.h>
2424 #include <linux/of_platform.h>
25+#include <linux/platform_data/omap_ocp2scp.h>
26+
27+/**
28+ * _count_resources - count for the number of resources
29+ * @res: struct resource *
30+ *
31+ * Count and return the number of resources populated for the device that is
32+ * connected to ocp2scp.
33+ */
34+static unsigned _count_resources(struct resource *res)
35+{
36+ int cnt = 0;
37+
38+ while (res->start != res->end) {
39+ cnt++;
40+ res++;
41+ }
42+
43+ return cnt;
44+}
2545
2646 static int ocp2scp_remove_devices(struct device *dev, void *c)
2747 {
@@ -34,20 +54,62 @@ static int ocp2scp_remove_devices(struct device *dev, void *c) · 6 unmodified lines
3454
3555 static int __devinit omap_ocp2scp_probe(struct platform_device *pdev)
3656 {
37− int ret;
38− struct device_node *np = pdev->dev.of_node;
57+ int ret;
58+ unsigned res_cnt, i;
59+ struct device_node *np = pdev->dev.of_node;
60+ struct platform_device *pdev_child;
61+ struct omap_ocp2scp_platform_data *pdata = pdev->dev.platform_data;
62+ struct omap_ocp2scp_dev *dev;
3963
4064 if (np) {
4165 ret = of_platform_populate(np, NULL, NULL, &pdev->dev);
4266 if (ret) {
43− dev_err(&pdev->dev, "failed to add resources for ocp2scp child\n");
67+ dev_err(&pdev->dev,
68+ "failed to add resources for ocp2scp child\n");
4469 goto err0;
4570 }
71+ } else if (pdata) {
72+ for (i = 0, dev = *pdata->devices; i < pdata->dev_cnt; i++,
73+ dev++) {
74+ res_cnt = _count_resources(dev->res);
75+
76+ pdev_child = platform_device_alloc(dev->drv_name,
77+ PLATFORM_DEVID_AUTO);
78+ if (!pdev_child) {
79+ dev_err(&pdev->dev,
80+ "failed to allocate mem for ocp2scp child\n");
81+ goto err0;
82+ }
83+
84+ ret = platform_device_add_resources(pdev_child,
85+ dev->res, res_cnt);
86+ if (ret) {
87+ dev_err(&pdev->dev,
88+ "failed to add resources for ocp2scp child\n");
89+ goto err1;
90+ }
91+
92+ pdev_child->dev.parent = &pdev->dev;
93+
94+ ret = platform_device_add(pdev_child);
95+ if (ret) {
96+ dev_err(&pdev->dev,
97+ "failed to register ocp2scp child device\n");
98+ goto err1;
99+ }
100+ }
101+ } else {
102+ dev_err(&pdev->dev, "OCP2SCP initialized without plat data\n");
103+ return -EINVAL;
46104 }
105+
47106 pm_runtime_enable(&pdev->dev);
48107
49108 return 0;
50109
110+err1:
111+ platform_device_put(pdev_child);
112+
51113 err0:
52114 device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices);
53115
drivers/char/hw_random/Kconfig+3−3
@@ -127,12 +127,12 @@ config HW_RANDOM_VIA · 126 unmodified lines
127127 If unsure, say Y.
128128
129129 config HW_RANDOM_IXP4XX
130− tristate "Intel IXP4xx NPU HW Random Number Generator support"
130+ tristate "Intel IXP4xx NPU HW Pseudo-Random Number Generator support"
131131 depends on HW_RANDOM && ARCH_IXP4XX
132132 default HW_RANDOM
133133 ---help---
134− This driver provides kernel-side support for the Random
135− Number Generator hardware found on the Intel IXP4xx NPU.
134+ This driver provides kernel-side support for the Pseudo-Random
135+ Number Generator hardware found on the Intel IXP45x/46x NPU.
136136
137137 To compile this driver as a module, choose M here: the
138138 module will be called ixp4xx-rng.
drivers/char/hw_random/ixp4xx-rng.c+4−1
@@ -45,6 +45,9 @@ static int __init ixp4xx_rng_init(void) · 44 unmodified lines
4545 void __iomem * rng_base;
4646 int err;
4747
48+ if (!cpu_is_ixp46x()) /* includes IXP455 */
49+ return -ENOSYS;
50+
4851 rng_base = ioremap(0x70002100, 4);
4952 if (!rng_base)
5053 return -ENOMEM;
@@ -68,5 +71,5 @@ module_init(ixp4xx_rng_init); · 17 unmodified lines
6871 module_exit(ixp4xx_rng_exit);
6972
7073 MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>");
71−MODULE_DESCRIPTION("H/W Random Number Generator (RNG) driver for IXP4xx");
74+MODULE_DESCRIPTION("H/W Pseudo-Random Number Generator (RNG) driver for IXP45x/46x");
7275 MODULE_LICENSE("GPL");
drivers/char/raw.c+1−1
@@ -285,7 +285,7 @@ static long raw_ctl_compat_ioctl(struct file *file, unsigned int cmd, · 284 unmodified lines
285285
286286 static const struct file_operations raw_fops = {
287287 .read = do_sync_read,
288− .aio_read = blkdev_aio_read,
288+ .aio_read = generic_file_aio_read,
289289 .write = do_sync_write,
290290 .aio_write = blkdev_aio_write,
291291 .fsync = blkdev_fsync,
drivers/char/sonypi.c+1−1
@@ -1456,7 +1456,7 @@ static int __devexit sonypi_remove(struct platform_device *dev) · 1455 unmodified lines
14561456 return 0;
14571457 }
14581458
1459−#ifdef CONFIG_PM
1459+#ifdef CONFIG_PM_SLEEP
14601460 static int old_camera_power;
14611461
14621462 static int sonypi_suspend(struct device *dev)
drivers/clk/ux500/u8500_clk.c+46−4
@@ -40,7 +40,7 @@ void u8500_clk_init(void) · 39 unmodified lines
4040 CLK_IS_ROOT|CLK_IGNORE_UNUSED,
4141 32768);
4242 clk_register_clkdev(clk, "clk32k", NULL);
43− clk_register_clkdev(clk, NULL, "rtc-pl031");
43+ clk_register_clkdev(clk, "apb_pclk", "rtc-pl031");
4444
4545 /* PRCMU clocks */
4646 fw_version = prcmu_get_fw_version();
@@ -228,10 +228,17 @@ void u8500_clk_init(void) · 181 unmodified lines
228228
229229 clk = clk_reg_prcc_pclk("p1_pclk2", "per1clk", U8500_CLKRST1_BASE,
230230 BIT(2), 0);
231+ clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.1");
232+
231233 clk = clk_reg_prcc_pclk("p1_pclk3", "per1clk", U8500_CLKRST1_BASE,
232234 BIT(3), 0);
235+ clk_register_clkdev(clk, "apb_pclk", "msp0");
236+ clk_register_clkdev(clk, "apb_pclk", "ux500-msp-i2s.0");
237+
233238 clk = clk_reg_prcc_pclk("p1_pclk4", "per1clk", U8500_CLKRST1_BASE,
234239 BIT(4), 0);
240+ clk_register_clkdev(clk, "apb_pclk", "msp1");
241+ clk_register_clkdev(clk, "apb_pclk", "ux500-msp-i2s.1");
235242
236243 clk = clk_reg_prcc_pclk("p1_pclk5", "per1clk", U8500_CLKRST1_BASE,
237244 BIT(5), 0);
@@ -239,6 +246,7 @@ void u8500_clk_init(void) · 1 unmodified line
239246
240247 clk = clk_reg_prcc_pclk("p1_pclk6", "per1clk", U8500_CLKRST1_BASE,
241248 BIT(6), 0);
249+ clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.2");
242250
243251 clk = clk_reg_prcc_pclk("p1_pclk7", "per1clk", U8500_CLKRST1_BASE,
244252 BIT(7), 0);
@@ -246,6 +254,7 @@ void u8500_clk_init(void) · 1 unmodified line
246254
247255 clk = clk_reg_prcc_pclk("p1_pclk8", "per1clk", U8500_CLKRST1_BASE,
248256 BIT(8), 0);
257+ clk_register_clkdev(clk, "apb_pclk", "slimbus0");
249258
250259 clk = clk_reg_prcc_pclk("p1_pclk9", "per1clk", U8500_CLKRST1_BASE,
251260 BIT(9), 0);
@@ -255,11 +264,16 @@ void u8500_clk_init(void) · 3 unmodified lines
255264
256265 clk = clk_reg_prcc_pclk("p1_pclk10", "per1clk", U8500_CLKRST1_BASE,
257266 BIT(10), 0);
267+ clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.4");
268+
258269 clk = clk_reg_prcc_pclk("p1_pclk11", "per1clk", U8500_CLKRST1_BASE,
259270 BIT(11), 0);
271+ clk_register_clkdev(clk, "apb_pclk", "msp3");
272+ clk_register_clkdev(clk, "apb_pclk", "ux500-msp-i2s.3");
260273
261274 clk = clk_reg_prcc_pclk("p2_pclk0", "per2clk", U8500_CLKRST2_BASE,
262275 BIT(0), 0);
276+ clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.3");
263277
264278 clk = clk_reg_prcc_pclk("p2_pclk1", "per2clk", U8500_CLKRST2_BASE,
265279 BIT(1), 0);
@@ -279,12 +293,13 @@ void u8500_clk_init(void) · 13 unmodified lines
279293
280294 clk = clk_reg_prcc_pclk("p2_pclk5", "per2clk", U8500_CLKRST2_BASE,
281295 BIT(5), 0);
296+ clk_register_clkdev(clk, "apb_pclk", "msp2");
297+ clk_register_clkdev(clk, "apb_pclk", "ux500-msp-i2s.2");
282298
283299 clk = clk_reg_prcc_pclk("p2_pclk6", "per2clk", U8500_CLKRST2_BASE,
284300 BIT(6), 0);
285301 clk_register_clkdev(clk, "apb_pclk", "sdi1");
286302
287−
288303 clk = clk_reg_prcc_pclk("p2_pclk7", "per2clk", U8500_CLKRST2_BASE,
289304 BIT(7), 0);
290305 clk_register_clkdev(clk, "apb_pclk", "sdi3");
@@ -316,10 +331,15 @@ void u8500_clk_init(void) · 25 unmodified lines
316331
317332 clk = clk_reg_prcc_pclk("p3_pclk1", "per3clk", U8500_CLKRST3_BASE,
318333 BIT(1), 0);
334+ clk_register_clkdev(clk, "apb_pclk", "ssp0");
335+
319336 clk = clk_reg_prcc_pclk("p3_pclk2", "per3clk", U8500_CLKRST3_BASE,
320337 BIT(2), 0);
338+ clk_register_clkdev(clk, "apb_pclk", "ssp1");
339+
321340 clk = clk_reg_prcc_pclk("p3_pclk3", "per3clk", U8500_CLKRST3_BASE,
322341 BIT(3), 0);
342+ clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.0");
323343
324344 clk = clk_reg_prcc_pclk("p3_pclk4", "per3clk", U8500_CLKRST3_BASE,
325345 BIT(4), 0);
@@ -401,10 +421,17 @@ void u8500_clk_init(void) · 75 unmodified lines
401421
402422 clk = clk_reg_prcc_kclk("p1_i2c1_kclk", "i2cclk",
403423 U8500_CLKRST1_BASE, BIT(2), CLK_SET_RATE_GATE);
424+ clk_register_clkdev(clk, NULL, "nmk-i2c.1");
425+
404426 clk = clk_reg_prcc_kclk("p1_msp0_kclk", "msp02clk",
405427 U8500_CLKRST1_BASE, BIT(3), CLK_SET_RATE_GATE);
428+ clk_register_clkdev(clk, NULL, "msp0");
429+ clk_register_clkdev(clk, NULL, "ux500-msp-i2s.0");
430+
406431 clk = clk_reg_prcc_kclk("p1_msp1_kclk", "msp1clk",
407432 U8500_CLKRST1_BASE, BIT(4), CLK_SET_RATE_GATE);
433+ clk_register_clkdev(clk, NULL, "msp1");
434+ clk_register_clkdev(clk, NULL, "ux500-msp-i2s.1");
408435
409436 clk = clk_reg_prcc_kclk("p1_sdi0_kclk", "sdmmcclk",
410437 U8500_CLKRST1_BASE, BIT(5), CLK_SET_RATE_GATE);
@@ -412,17 +439,25 @@ void u8500_clk_init(void) · 1 unmodified line
412439
413440 clk = clk_reg_prcc_kclk("p1_i2c2_kclk", "i2cclk",
414441 U8500_CLKRST1_BASE, BIT(6), CLK_SET_RATE_GATE);
442+ clk_register_clkdev(clk, NULL, "nmk-i2c.2");
443+
415444 clk = clk_reg_prcc_kclk("p1_slimbus0_kclk", "slimclk",
416− U8500_CLKRST1_BASE, BIT(3), CLK_SET_RATE_GATE);
417− /* FIXME: Redefinition of BIT(3). */
445+ U8500_CLKRST1_BASE, BIT(8), CLK_SET_RATE_GATE);
446+ clk_register_clkdev(clk, NULL, "slimbus0");
447+
418448 clk = clk_reg_prcc_kclk("p1_i2c4_kclk", "i2cclk",
419449 U8500_CLKRST1_BASE, BIT(9), CLK_SET_RATE_GATE);
450+ clk_register_clkdev(clk, NULL, "nmk-i2c.4");
451+
420452 clk = clk_reg_prcc_kclk("p1_msp3_kclk", "msp1clk",
421453 U8500_CLKRST1_BASE, BIT(10), CLK_SET_RATE_GATE);
454+ clk_register_clkdev(clk, NULL, "msp3");
455+ clk_register_clkdev(clk, NULL, "ux500-msp-i2s.3");
422456
423457 /* Periph2 */
424458 clk = clk_reg_prcc_kclk("p2_i2c3_kclk", "i2cclk",
425459 U8500_CLKRST2_BASE, BIT(0), CLK_SET_RATE_GATE);
460+ clk_register_clkdev(clk, NULL, "nmk-i2c.3");
426461
427462 clk = clk_reg_prcc_kclk("p2_sdi4_kclk", "sdmmcclk",
428463 U8500_CLKRST2_BASE, BIT(2), CLK_SET_RATE_GATE);
@@ -430,6 +465,8 @@ void u8500_clk_init(void) · 1 unmodified line
430465
431466 clk = clk_reg_prcc_kclk("p2_msp2_kclk", "msp02clk",
432467 U8500_CLKRST2_BASE, BIT(3), CLK_SET_RATE_GATE);
468+ clk_register_clkdev(clk, NULL, "msp2");
469+ clk_register_clkdev(clk, NULL, "ux500-msp-i2s.2");
433470
434471 clk = clk_reg_prcc_kclk("p2_sdi1_kclk", "sdmmcclk",
435472 U8500_CLKRST2_BASE, BIT(4), CLK_SET_RATE_GATE);
@@ -450,10 +487,15 @@ void u8500_clk_init(void) · 14 unmodified lines
450487 /* Periph3 */
451488 clk = clk_reg_prcc_kclk("p3_ssp0_kclk", "sspclk",
452489 U8500_CLKRST3_BASE, BIT(1), CLK_SET_RATE_GATE);
490+ clk_register_clkdev(clk, NULL, "ssp0");
491+
453492 clk = clk_reg_prcc_kclk("p3_ssp1_kclk", "sspclk",
454493 U8500_CLKRST3_BASE, BIT(2), CLK_SET_RATE_GATE);
494+ clk_register_clkdev(clk, NULL, "ssp1");
495+
455496 clk = clk_reg_prcc_kclk("p3_i2c0_kclk", "i2cclk",
456497 U8500_CLKRST3_BASE, BIT(3), CLK_SET_RATE_GATE);
498+ clk_register_clkdev(clk, NULL, "nmk-i2c.0");
457499
458500 clk = clk_reg_prcc_kclk("p3_sdi2_kclk", "sdmmcclk",
459501 U8500_CLKRST3_BASE, BIT(4), CLK_SET_RATE_GATE);
drivers/cpufreq/cpufreq_stats.c+1−0
@@ -328,6 +328,7 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb, · 327 unmodified lines
328328 cpufreq_update_policy(cpu);
329329 break;
330330 case CPU_DOWN_PREPARE:
331+ case CPU_DOWN_PREPARE_FROZEN:
331332 cpufreq_stats_free_sysfs(cpu);
332333 break;
333334 case CPU_DEAD:
drivers/cpufreq/powernow-k8.c+2−9
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 * http://www.gnu.org/licenses/gpl.html
66 *
77 * Maintainer:
8− * Andreas Herrmann <andreas.herrmann3@amd.com>
8+ * Andreas Herrmann <herrmann.der.user@googlemail.com>
99 *
1010 * Based on the powernow-k7.c module written by Dave Jones.
1111 * (C) 2003 Dave Jones on behalf of SuSE Labs
@@ -1052,14 +1052,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, · 1040 unmodified lines
10521052 struct powernowk8_target_arg pta = { .pol = pol, .targfreq = targfreq,
10531053 .relation = relation };
10541054
1055− /*
1056− * Must run on @pol->cpu. cpufreq core is responsible for ensuring
1057− * that we're bound to the current CPU and pol->cpu stays online.
1058− */
1059− if (smp_processor_id() == pol->cpu)
1060− return powernowk8_target_fn(&pta);
1061− else
1062− return work_on_cpu(pol->cpu, powernowk8_target_fn, &pta);
1055+ return work_on_cpu(pol->cpu, powernowk8_target_fn, &pta);
10631056 }
10641057
10651058 /* Driver entry point to verify the policy and range of frequencies */
drivers/crypto/Kconfig+1−1
@@ -224,7 +224,7 @@ config CRYPTO_DEV_TALITOS · 223 unmodified lines
224224
225225 config CRYPTO_DEV_IXP4XX
226226 tristate "Driver for IXP4xx crypto hardware acceleration"
227− depends on ARCH_IXP4XX
227+ depends on ARCH_IXP4XX && IXP4XX_QMGR && IXP4XX_NPE
228228 select CRYPTO_DES
229229 select CRYPTO_ALGAPI
230230 select CRYPTO_AUTHENC
drivers/crypto/ixp4xx_crypto.c+6−6
@@ -750,12 +750,12 @@ static int setup_cipher(struct crypto_tfm *tfm, int encrypt, · 749 unmodified lines
750750 }
751751 if (cipher_cfg & MOD_AES) {
752752 switch (key_len) {
753− case 16: keylen_cfg = MOD_AES128 | KEYLEN_128; break;
754− case 24: keylen_cfg = MOD_AES192 | KEYLEN_192; break;
755− case 32: keylen_cfg = MOD_AES256 | KEYLEN_256; break;
756− default:
757− *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
758− return -EINVAL;
753+ case 16: keylen_cfg = MOD_AES128; break;
754+ case 24: keylen_cfg = MOD_AES192; break;
755+ case 32: keylen_cfg = MOD_AES256; break;
756+ default:
757+ *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
758+ return -EINVAL;
759759 }
760760 cipher_cfg |= keylen_cfg;
761761 } else if (cipher_cfg & MOD_3DES) {
drivers/dma/Kconfig+11−0
@@ -90,6 +90,17 @@ config DW_DMAC · 89 unmodified lines
9090 Support the Synopsys DesignWare AHB DMA controller. This
9191 can be integrated in chips such as the Atmel AT32ap7000.
9292
93+config DW_DMAC_BIG_ENDIAN_IO
94+ bool "Use big endian I/O register access"
95+ default y if AVR32
96+ depends on DW_DMAC
97+ help
98+ Say yes here to use big endian I/O access when reading and writing
99+ to the DMA controller registers. This is needed on some platforms,
100+ like the Atmel AVR32 architecture.
101+
102+ If unsure, use the default setting.
103+
93104 config AT_HDMAC
94105 tristate "Atmel AHB DMA support"
95106 depends on ARCH_AT91
drivers/dma/dw_dmac_regs.h+13−5
@@ -98,9 +98,17 @@ struct dw_dma_regs { · 97 unmodified lines
9898 u32 DW_PARAMS;
9999 };
100100
101+#ifdef CONFIG_DW_DMAC_BIG_ENDIAN_IO
102+#define dma_readl_native ioread32be
103+#define dma_writel_native iowrite32be
104+#else
105+#define dma_readl_native readl
106+#define dma_writel_native writel
107+#endif
108+
101109 /* To access the registers in early stage of probe */
102110 #define dma_read_byaddr(addr, name) \
103− readl((addr) + offsetof(struct dw_dma_regs, name))
111+ dma_readl_native((addr) + offsetof(struct dw_dma_regs, name))
104112
105113 /* Bitfields in DW_PARAMS */
106114 #define DW_PARAMS_NR_CHAN 8 /* number of channels */
@@ -216,9 +224,9 @@ __dwc_regs(struct dw_dma_chan *dwc) · 109 unmodified lines
216224 }
217225
218226 #define channel_readl(dwc, name) \
219− readl(&(__dwc_regs(dwc)->name))
227+ dma_readl_native(&(__dwc_regs(dwc)->name))
220228 #define channel_writel(dwc, name, val) \
221− writel((val), &(__dwc_regs(dwc)->name))
229+ dma_writel_native((val), &(__dwc_regs(dwc)->name))
222230
223231 static inline struct dw_dma_chan *to_dw_dma_chan(struct dma_chan *chan)
224232 {
@@ -246,9 +254,9 @@ static inline struct dw_dma_regs __iomem *__dw_regs(struct dw_dma *dw) · 21 unmodified lines
246254 }
247255
248256 #define dma_readl(dw, name) \
249− readl(&(__dw_regs(dw)->name))
257+ dma_readl_native(&(__dw_regs(dw)->name))
250258 #define dma_writel(dw, name, val) \
251− writel((val), &(__dw_regs(dw)->name))
259+ dma_writel_native((val), &(__dw_regs(dw)->name))
252260
253261 #define channel_set_bit(dw, reg, mask) \
254262 dma_writel(dw, reg, ((mask) << 8) | (mask))
drivers/dma/imx-dma.c+3−1
@@ -474,8 +474,10 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) · 473 unmodified lines
474474 slot = i;
475475 break;
476476 }
477− if (slot < 0)
477+ if (slot < 0) {
478+ spin_unlock_irqrestore(&imxdma->lock, flags);
478479 return -EBUSY;
480+ }
479481
480482 imxdma->slots_2d[slot].xsr = d->x;
481483 imxdma->slots_2d[slot].ysr = d->y;
drivers/dma/sirf-dma.c+2−2
@@ -109,7 +109,7 @@ static void sirfsoc_dma_execute(struct sirfsoc_dma_chan *schan) · 108 unmodified lines
109109 sdesc = list_first_entry(&schan->queued, struct sirfsoc_dma_desc,
110110 node);
111111 /* Move the first queued descriptor to active list */
112− list_move_tail(&schan->queued, &schan->active);
112+ list_move_tail(&sdesc->node, &schan->active);
113113
114114 /* Start the DMA transfer */
115115 writel_relaxed(sdesc->width, sdma->base + SIRFSOC_DMA_WIDTH_0 +
@@ -428,7 +428,7 @@ static struct dma_async_tx_descriptor *sirfsoc_dma_prep_interleaved( · 312 unmodified lines
428428 unsigned long iflags;
429429 int ret;
430430
431− if ((xt->dir != DMA_MEM_TO_DEV) || (xt->dir != DMA_DEV_TO_MEM)) {
431+ if ((xt->dir != DMA_MEM_TO_DEV) && (xt->dir != DMA_DEV_TO_MEM)) {
432432 ret = -EINVAL;
433433 goto err_dir;
434434 }
drivers/edac/amd64_edac.c+4−7
@@ -170,8 +170,11 @@ static int __amd64_set_scrub_rate(struct pci_dev *ctl, u32 new_bw, u32 min_rate) · 169 unmodified lines
170170 * memory controller and apply to register. Search for the first
171171 * bandwidth entry that is greater or equal than the setting requested
172172 * and program that. If at last entry, turn off DRAM scrubbing.
173+ *
174+ * If no suitable bandwidth is found, turn off DRAM scrubbing entirely
175+ * by falling back to the last element in scrubrates[].
173176 */
174− for (i = 0; i < ARRAY_SIZE(scrubrates); i++) {
177+ for (i = 0; i < ARRAY_SIZE(scrubrates) - 1; i++) {
175178 /*
176179 * skip scrub rates which aren't recommended
177180 * (see F10 BKDG, F3x58)
@@ -181,12 +184,6 @@ static int __amd64_set_scrub_rate(struct pci_dev *ctl, u32 new_bw, u32 min_rate) · 3 unmodified lines
181184
182185 if (scrubrates[i].bandwidth <= new_bw)
183186 break;
184−
185− /*
186− * if no suitable bandwidth found, turn off DRAM scrubbing
187− * entirely by falling back to the last element in the
188− * scrubrates array.
189− */
190187 }
191188
192189 scrubval = scrubrates[i].scrubval;
drivers/edac/amd64_edac.h+1−1
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333 * detection. The mods to Rev F required more family
3434 * information detection.
3535 *
36− * Changes/Fixes by Borislav Petkov <borislav.petkov@amd.com>:
36+ * Changes/Fixes by Borislav Petkov <bp@alien8.de>:
3737 * - misc fixes and code cleanups
3838 *
3939 * This module is based on the following documents
drivers/edac/edac_mc.c+11−3
@@ -416,10 +416,18 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, · 415 unmodified lines
416416 dimm->cschannel = chn;
417417
418418 /* Increment csrow location */
419− row++;
420− if (row == tot_csrows) {
421− row = 0;
419+ if (layers[0].is_virt_csrow) {
422420 chn++;
421+ if (chn == tot_channels) {
422+ chn = 0;
423+ row++;
424+ }
425+ } else {
426+ row++;
427+ if (row == tot_csrows) {
428+ row = 0;
429+ chn++;
430+ }
423431 }
424432
425433 /* Increment dimm location */
drivers/edac/edac_stub.c+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 *
66 * 2007 (c) MontaVista Software, Inc.
77 * 2010 (c) Advanced Micro Devices Inc.
8− * Borislav Petkov <borislav.petkov@amd.com>
8+ * Borislav Petkov <bp@alien8.de>
99 *
1010 * This file is licensed under the terms of the GNU General Public
1111 * License version 2. This program is licensed "as is" without any
drivers/edac/i7300_edac.c+4−4
@@ -197,8 +197,8 @@ static const char *ferr_fat_fbd_name[] = { · 196 unmodified lines
197197 [0] = "Memory Write error on non-redundant retry or "
198198 "FBD configuration Write error on retry",
199199 };
200−#define GET_FBD_FAT_IDX(fbderr) (fbderr & (3 << 28))
201−#define FERR_FAT_FBD_ERR_MASK ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3))
200+#define GET_FBD_FAT_IDX(fbderr) (((fbderr) >> 28) & 3)
201+#define FERR_FAT_FBD_ERR_MASK ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 22))
202202
203203 #define FERR_NF_FBD 0xa0
204204 static const char *ferr_nf_fbd_name[] = {
@@ -225,7 +225,7 @@ static const char *ferr_nf_fbd_name[] = { · 20 unmodified lines
225225 [1] = "Aliased Uncorrectable Non-Mirrored Demand Data ECC",
226226 [0] = "Uncorrectable Data ECC on Replay",
227227 };
228−#define GET_FBD_NF_IDX(fbderr) (fbderr & (3 << 28))
228+#define GET_FBD_NF_IDX(fbderr) (((fbderr) >> 28) & 3)
229229 #define FERR_NF_FBD_ERR_MASK ((1 << 24) | (1 << 23) | (1 << 22) | (1 << 21) |\
230230 (1 << 18) | (1 << 17) | (1 << 16) | (1 << 15) |\
231231 (1 << 14) | (1 << 13) | (1 << 11) | (1 << 10) |\
@@ -464,7 +464,7 @@ static void i7300_process_fbd_error(struct mem_ctl_info *mci) · 232 unmodified lines
464464 errnum = find_first_bit(&errors,
465465 ARRAY_SIZE(ferr_nf_fbd_name));
466466 specific = GET_ERR_FROM_TABLE(ferr_nf_fbd_name, errnum);
467− branch = (GET_FBD_FAT_IDX(error_reg) == 2) ? 1 : 0;
467+ branch = (GET_FBD_NF_IDX(error_reg) == 2) ? 1 : 0;
468468
469469 pci_read_config_dword(pvt->pci_dev_16_1_fsb_addr_map,
470470 REDMEMA, &syndrome);
drivers/edac/i7core_edac.c+3−3
@@ -816,7 +816,7 @@ static ssize_t i7core_inject_store_##param( \ · 815 unmodified lines
816816 struct device_attribute *mattr, \
817817 const char *data, size_t count) \
818818 { \
819− struct mem_ctl_info *mci = to_mci(dev); \
819+ struct mem_ctl_info *mci = dev_get_drvdata(dev); \
820820 struct i7core_pvt *pvt; \
821821 long value; \
822822 int rc; \
@@ -845,7 +845,7 @@ static ssize_t i7core_inject_show_##param( \ · 22 unmodified lines
845845 struct device_attribute *mattr, \
846846 char *data) \
847847 { \
848− struct mem_ctl_info *mci = to_mci(dev); \
848+ struct mem_ctl_info *mci = dev_get_drvdata(dev); \
849849 struct i7core_pvt *pvt; \
850850 \
851851 pvt = mci->pvt_info; \
@@ -1052,7 +1052,7 @@ static ssize_t i7core_show_counter_##param( \ · 200 unmodified lines
10521052 struct device_attribute *mattr, \
10531053 char *data) \
10541054 { \
1055− struct mem_ctl_info *mci = to_mci(dev); \
1055+ struct mem_ctl_info *mci = dev_get_drvdata(dev); \
10561056 struct i7core_pvt *pvt = mci->pvt_info; \
10571057 \
10581058 edac_dbg(1, "\n"); \
drivers/edac/i82975x_edac.c+4−7
@@ -370,10 +370,6 @@ static enum dev_type i82975x_dram_type(void __iomem *mch_window, int rank) · 369 unmodified lines
370370 static void i82975x_init_csrows(struct mem_ctl_info *mci,
371371 struct pci_dev *pdev, void __iomem *mch_window)
372372 {
373− static const char *labels[4] = {
374− "DIMM A1", "DIMM A2",
375− "DIMM B1", "DIMM B2"
376− };
377373 struct csrow_info *csrow;
378374 unsigned long last_cumul_size;
379375 u8 value;
@@ -423,9 +419,10 @@ static void i82975x_init_csrows(struct mem_ctl_info *mci, · 43 unmodified lines
423419 dimm = mci->csrows[index]->channels[chan]->dimm;
424420
425421 dimm->nr_pages = nr_pages / csrow->nr_channels;
426− strncpy(csrow->channels[chan]->dimm->label,
427− labels[(index >> 1) + (chan * 2)],
428− EDAC_MC_LABEL_LEN);
422+
423+ snprintf(csrow->channels[chan]->dimm->label, EDAC_MC_LABEL_LEN, "DIMM %c%d",
424+ (chan == 0) ? 'A' : 'B',
425+ index);
429426 dimm->grain = 1 << 7; /* 128Byte cache-line resolution */
430427 dimm->dtype = i82975x_dram_type(mch_window, index);
431428 dimm->mtype = MEM_DDR2; /* I82975x supports only DDR2 */
drivers/edac/mce_amd_inj.c+2−2
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 * This file may be distributed under the terms of the GNU General Public
77 * License version 2.
88 *
9− * Copyright (c) 2010: Borislav Petkov <borislav.petkov@amd.com>
9+ * Copyright (c) 2010: Borislav Petkov <bp@alien8.de>
1010 * Advanced Micro Devices Inc.
1111 */
1212
@@ -168,6 +168,6 @@ module_init(edac_init_mce_inject); · 155 unmodified lines
168168 module_exit(edac_exit_mce_inject);
169169
170170 MODULE_LICENSE("GPL");
171−MODULE_AUTHOR("Borislav Petkov <borislav.petkov@amd.com>");
171+MODULE_AUTHOR("Borislav Petkov <bp@alien8.de>");
172172 MODULE_AUTHOR("AMD Inc.");
173173 MODULE_DESCRIPTION("MCE injection facility for testing MCE decoding");
drivers/extcon/extcon-adc-jack.c+7−3
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 *
1515 */
1616
17+#include <linux/module.h>
1718 #include <linux/slab.h>
1819 #include <linux/device.h>
1920 #include <linux/platform_device.h>
@@ -161,13 +162,12 @@ static int __devinit adc_jack_probe(struct platform_device *pdev) · 141 unmodified lines
161162 err = request_any_context_irq(data->irq, adc_jack_irq_thread,
162163 pdata->irq_flags, pdata->name, data);
163164
164− if (err) {
165+ if (err < 0) {
165166 dev_err(&pdev->dev, "error: irq %d\n", data->irq);
166− err = -EINVAL;
167167 goto err_irq;
168168 }
169169
170− goto out;
170+ return 0;
171171
172172 err_irq:
173173 extcon_dev_unregister(&data->edev);
@@ -196,3 +196,7 @@ static struct platform_driver adc_jack_driver = { · 22 unmodified lines
196196 };
197197
198198 module_platform_driver(adc_jack_driver);
199+
200+MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>");
201+MODULE_DESCRIPTION("ADC Jack extcon driver");
202+MODULE_LICENSE("GPL v2");
drivers/extcon/extcon-class.c+81−61
@@ -41,7 +41,7 @@ · 40 unmodified lines
4141 * every single port-type of the following cable names. Please choose cable
4242 * names that are actually used in your extcon device.
4343 */
44−const char *extcon_cable_name[] = {
44+const char extcon_cable_name[][CABLE_NAME_MAX + 1] = {
4545 [EXTCON_USB] = "USB",
4646 [EXTCON_USB_HOST] = "USB-Host",
4747 [EXTCON_TA] = "TA",
@@ -62,8 +62,6 @@ const char *extcon_cable_name[] = { · 14 unmodified lines
6262 [EXTCON_VIDEO_IN] = "Video-in",
6363 [EXTCON_VIDEO_OUT] = "Video-out",
6464 [EXTCON_MECHANICAL] = "Mechanical",
65−
66− NULL,
6765 };
6866
6967 static struct class *extcon_class;
@@ -91,17 +89,13 @@ static int check_mutually_exclusive(struct extcon_dev *edev, u32 new_state) · 21 unmodified lines
9189 return 0;
9290
9391 for (i = 0; edev->mutually_exclusive[i]; i++) {
94− int count = 0, j;
92+ int weight;
9593 u32 correspondants = new_state & edev->mutually_exclusive[i];
96− u32 exp = 1;
97−
98− for (j = 0; j < 32; j++) {
99− if (exp & correspondants)
100− count++;
101− if (count > 1)
102− return i + 1;
103− exp <<= 1;
104− }
94+
95+ /* calculate the total number of bits set */
96+ weight = hweight32(correspondants);
97+ if (weight > 1)
98+ return i + 1;
10599 }
106100
107101 return 0;
@@ -362,7 +356,7 @@ int extcon_get_cable_state(struct extcon_dev *edev, const char *cable_name) · 254 unmodified lines
362356 EXPORT_SYMBOL_GPL(extcon_get_cable_state);
363357
364358 /**
365− * extcon_get_cable_state_() - Set the status of a specific cable.
359+ * extcon_set_cable_state_() - Set the status of a specific cable.
366360 * @edev: the extcon device that has the cable.
367361 * @index: cable index that can be retrieved by extcon_find_cable_index().
368362 * @cable_state: the new cable status. The default semantics is
@@ -382,7 +376,7 @@ int extcon_set_cable_state_(struct extcon_dev *edev, · 13 unmodified lines
382376 EXPORT_SYMBOL_GPL(extcon_set_cable_state_);
383377
384378 /**
385− * extcon_get_cable_state() - Set the status of a specific cable.
379+ * extcon_set_cable_state() - Set the status of a specific cable.
386380 * @edev: the extcon device that has the cable.
387381 * @cable_name: cable name.
388382 * @cable_state: the new cable status. The default semantics is
@@ -447,6 +441,8 @@ static int _call_per_cable(struct notifier_block *nb, unsigned long val, · 58 unmodified lines
447441 * extcon device.
448442 * @obj: an empty extcon_specific_cable_nb object to be returned.
449443 * @extcon_name: the name of extcon device.
444+ * if NULL, extcon_register_interest will register
445+ * every cable with the target cable_name given.
450446 * @cable_name: the target cable name.
451447 * @nb: the notifier block to get notified.
452448 *
@@ -466,22 +462,44 @@ int extcon_register_interest(struct extcon_specific_cable_nb *obj, · 13 unmodified lines
466462 const char *extcon_name, const char *cable_name,
467463 struct notifier_block *nb)
468464 {
469− if (!obj || !extcon_name || !cable_name || !nb)
465+ if (!obj || !cable_name || !nb)
470466 return -EINVAL;
471467
472− obj->edev = extcon_get_extcon_dev(extcon_name);
473− if (!obj->edev)
474− return -ENODEV;
468+ if (extcon_name) {
469+ obj->edev = extcon_get_extcon_dev(extcon_name);
470+ if (!obj->edev)
471+ return -ENODEV;
475472
476− obj->cable_index = extcon_find_cable_index(obj->edev, cable_name);
477− if (obj->cable_index < 0)
478− return -ENODEV;
473+ obj->cable_index = extcon_find_cable_index(obj->edev, cable_name);
474+ if (obj->cable_index < 0)
475+ return -ENODEV;
476+
477+ obj->user_nb = nb;
479478
480− obj->user_nb = nb;
479+ obj->internal_nb.notifier_call = _call_per_cable;
481480
482− obj->internal_nb.notifier_call = _call_per_cable;
481+ return raw_notifier_chain_register(&obj->edev->nh, &obj->internal_nb);
482+ } else {
483+ struct class_dev_iter iter;
484+ struct extcon_dev *extd;
485+ struct device *dev;
486+
487+ if (!extcon_class)
488+ return -ENODEV;
489+ class_dev_iter_init(&iter, extcon_class, NULL, NULL);
490+ while ((dev = class_dev_iter_next(&iter))) {
491+ extd = (struct extcon_dev *)dev_get_drvdata(dev);
492+
493+ if (extcon_find_cable_index(extd, cable_name) < 0)
494+ continue;
495+
496+ class_dev_iter_exit(&iter);
497+ return extcon_register_interest(obj, extd->name,
498+ cable_name, nb);
499+ }
483500
484− return raw_notifier_chain_register(&obj->edev->nh, &obj->internal_nb);
501+ return -ENODEV;
502+ }
485503 }
486504
487505 /**
@@ -551,43 +569,9 @@ static int create_extcon_class(void) · 63 unmodified lines
551569 return 0;
552570 }
553571
554−static void extcon_cleanup(struct extcon_dev *edev, bool skip)
555−{
556− mutex_lock(&extcon_dev_list_lock);
557− list_del(&edev->entry);
558− mutex_unlock(&extcon_dev_list_lock);
559−
560− if (!skip && get_device(edev->dev)) {
561− int index;
562−
563− if (edev->mutually_exclusive && edev->max_supported) {
564− for (index = 0; edev->mutually_exclusive[index];
565− index++)
566− kfree(edev->d_attrs_muex[index].attr.name);
567− kfree(edev->d_attrs_muex);
568− kfree(edev->attrs_muex);
569− }
570−
571− for (index = 0; index < edev->max_supported; index++)
572− kfree(edev->cables[index].attr_g.name);
573−
574− if (edev->max_supported) {
575− kfree(edev->extcon_dev_type.groups);
576− kfree(edev->cables);
577− }
578−
579− device_unregister(edev->dev);
580− put_device(edev->dev);
581− }
582−
583− kfree(edev->dev);
584−}
585−
586572 static void extcon_dev_release(struct device *dev)
587573 {
588− struct extcon_dev *edev = (struct extcon_dev *) dev_get_drvdata(dev);
589−
590− extcon_cleanup(edev, true);
574+ kfree(dev);
591575 }
592576
593577 static const char *muex_name = "mutually_exclusive";
@@ -813,7 +797,40 @@ EXPORT_SYMBOL_GPL(extcon_dev_register); · 219 unmodified lines
813797 */
814798 void extcon_dev_unregister(struct extcon_dev *edev)
815799 {
816− extcon_cleanup(edev, false);
800+ int index;
801+
802+ mutex_lock(&extcon_dev_list_lock);
803+ list_del(&edev->entry);
804+ mutex_unlock(&extcon_dev_list_lock);
805+
806+ if (IS_ERR_OR_NULL(get_device(edev->dev))) {
807+ dev_err(edev->dev, "Failed to unregister extcon_dev (%s)\n",
808+ dev_name(edev->dev));
809+ return;
810+ }
811+
812+ if (edev->mutually_exclusive && edev->max_supported) {
813+ for (index = 0; edev->mutually_exclusive[index];
814+ index++)
815+ kfree(edev->d_attrs_muex[index].attr.name);
816+ kfree(edev->d_attrs_muex);
817+ kfree(edev->attrs_muex);
818+ }
819+
820+ for (index = 0; index < edev->max_supported; index++)
821+ kfree(edev->cables[index].attr_g.name);
822+
823+ if (edev->max_supported) {
824+ kfree(edev->extcon_dev_type.groups);
825+ kfree(edev->cables);
826+ }
827+
828+#if defined(CONFIG_ANDROID)
829+ if (switch_class)
830+ class_compat_remove_link(switch_class, edev->dev, NULL);
831+#endif
832+ device_unregister(edev->dev);
833+ put_device(edev->dev);
817834 }
818835 EXPORT_SYMBOL_GPL(extcon_dev_unregister);
819836
@@ -825,6 +842,9 @@ module_init(extcon_class_init); · 5 unmodified lines
825842
826843 static void __exit extcon_class_exit(void)
827844 {
845+#if defined(CONFIG_ANDROID)
846+ class_compat_unregister(switch_class);
847+#endif
828848 class_destroy(extcon_class);
829849 }
830850 module_exit(extcon_class_exit);
drivers/extcon/extcon-gpio.c+0−1
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626 #include <linux/interrupt.h>
2727 #include <linux/platform_device.h>
2828 #include <linux/slab.h>
29−#include <linux/extcon.h>
3029 #include <linux/workqueue.h>
3130 #include <linux/gpio.h>
3231 #include <linux/extcon.h>
drivers/extcon/extcon-max77693.c+34−12
@@ -239,25 +239,19 @@ const char *max77693_extcon_cable[] = { · 238 unmodified lines
239239 static int max77693_muic_set_debounce_time(struct max77693_muic_info *info,
240240 enum max77693_muic_adc_debounce_time time)
241241 {
242− int ret = 0;
243− u8 ctrl3;
242+ int ret;
244243
245244 switch (time) {
246245 case ADC_DEBOUNCE_TIME_5MS:
247246 case ADC_DEBOUNCE_TIME_10MS:
248247 case ADC_DEBOUNCE_TIME_25MS:
249248 case ADC_DEBOUNCE_TIME_38_62MS:
250− ret = max77693_read_reg(info->max77693->regmap_muic,
251− MAX77693_MUIC_REG_CTRL3, &ctrl3);
252− ctrl3 &= ~CONTROL3_ADCDBSET_MASK;
253− ctrl3 |= (time << CONTROL3_ADCDBSET_SHIFT);
254−
255− ret = max77693_write_reg(info->max77693->regmap_muic,
256− MAX77693_MUIC_REG_CTRL3, ctrl3);
257− if (ret) {
249+ ret = max77693_update_reg(info->max77693->regmap_muic,
250+ MAX77693_MUIC_REG_CTRL3,
251+ time << CONTROL3_ADCDBSET_SHIFT,
252+ CONTROL3_ADCDBSET_MASK);
253+ if (ret)
258254 dev_err(info->dev, "failed to set ADC debounce time\n");
259− ret = -EINVAL;
260− }
261255 break;
262256 default:
263257 dev_err(info->dev, "invalid ADC debounce time\n");
@@ -657,6 +651,8 @@ out: · 393 unmodified lines
657651 static int __devinit max77693_muic_probe(struct platform_device *pdev)
658652 {
659653 struct max77693_dev *max77693 = dev_get_drvdata(pdev->dev.parent);
654+ struct max77693_platform_data *pdata = dev_get_platdata(max77693->dev);
655+ struct max77693_muic_platform_data *muic_pdata = pdata->muic_data;
660656 struct max77693_muic_info *info;
661657 int ret, i;
662658 u8 id;
@@ -727,6 +723,31 @@ static int __devinit max77693_muic_probe(struct platform_device *pdev) · 64 unmodified lines
727723 goto err_extcon;
728724 }
729725
726+ /* Initialize MUIC register by using platform data */
727+ for (i = 0 ; i < muic_pdata->num_init_data ; i++) {
728+ enum max77693_irq_source irq_src = MAX77693_IRQ_GROUP_NR;
729+
730+ max77693_write_reg(info->max77693->regmap_muic,
731+ muic_pdata->init_data[i].addr,
732+ muic_pdata->init_data[i].data);
733+
734+ switch (muic_pdata->init_data[i].addr) {
735+ case MAX77693_MUIC_REG_INTMASK1:
736+ irq_src = MUIC_INT1;
737+ break;
738+ case MAX77693_MUIC_REG_INTMASK2:
739+ irq_src = MUIC_INT2;
740+ break;
741+ case MAX77693_MUIC_REG_INTMASK3:
742+ irq_src = MUIC_INT3;
743+ break;
744+ }
745+
746+ if (irq_src < MAX77693_IRQ_GROUP_NR)
747+ info->max77693->irq_masks_cur[irq_src]
748+ = muic_pdata->init_data[i].data;
749+ }
750+
730751 /* Check revision number of MUIC device*/
731752 ret = max77693_read_reg(info->max77693->regmap_muic,
732753 MAX77693_MUIC_REG_ID, &id);
@@ -762,6 +783,7 @@ static int __devexit max77693_muic_remove(struct platform_device *pdev) · 29 unmodified lines
762783 free_irq(muic_irqs[i].virq, info);
763784 cancel_work_sync(&info->irq_work);
764785 extcon_dev_unregister(info->edev);
786+ kfree(info->edev);
765787 kfree(info);
766788
767789 return 0;
drivers/extcon/extcon-max8997.c+2−4
@@ -271,8 +271,6 @@ out: · 270 unmodified lines
271271 static int max8997_muic_handle_charger_type_detach(
272272 struct max8997_muic_info *info)
273273 {
274− int ret = 0;
275−
276274 switch (info->pre_charger_type) {
277275 case MAX8997_CHARGER_TYPE_USB:
278276 extcon_set_cable_state(info->edev, "USB", false);
@@ -290,11 +288,11 @@ static int max8997_muic_handle_charger_type_detach( · 11 unmodified lines
290288 extcon_set_cable_state(info->edev, "Fast-charger", false);
291289 break;
292290 default:
293− ret = -EINVAL;
291+ return -EINVAL;
294292 break;
295293 }
296294
297− return ret;
295+ return 0;
298296 }
299297
300298 static int max8997_muic_handle_charger_type(struct max8997_muic_info *info,
drivers/firewire/sbp2.c+2−0
@@ -1546,6 +1546,8 @@ static int sbp2_scsi_slave_configure(struct scsi_device *sdev) · 1545 unmodified lines
15461546 struct sbp2_logical_unit *lu = sdev->hostdata;
15471547
15481548 sdev->use_10_for_rw = 1;
1549+ sdev->no_report_opcodes = 1;
1550+ sdev->no_write_same = 1;
15491551
15501552 if (sbp2_param_exclusive_login)
15511553 sdev->manage_start_stop = 1;
drivers/gpio/Kconfig+2−2
@@ -47,7 +47,7 @@ if GPIOLIB · 46 unmodified lines
4747
4848 config OF_GPIO
4949 def_bool y
50− depends on OF && !SPARC
50+ depends on OF
5151
5252 config DEBUG_GPIO
5353 bool "Debug GPIO calls"
@@ -466,7 +466,7 @@ config GPIO_ADP5588_IRQ · 412 unmodified lines
466466
467467 config GPIO_ADNP
468468 tristate "Avionic Design N-bit GPIO expander"
469− depends on I2C && OF
469+ depends on I2C && OF_GPIO
470470 help
471471 This option enables support for N GPIOs found on Avionic Design
472472 I2C GPIO expanders. The register space will be extended by powers
drivers/gpio/gpio-74x164.c+1−1
@@ -153,7 +153,7 @@ static int __devinit gen_74x164_probe(struct spi_device *spi) · 152 unmodified lines
153153 }
154154
155155 chip->gpio_chip.ngpio = GEN_74X164_NUMBER_GPIOS * chip->registers;
156− chip->buffer = devm_kzalloc(&spi->dev, chip->gpio_chip.ngpio, GFP_KERNEL);
156+ chip->buffer = devm_kzalloc(&spi->dev, chip->registers, GFP_KERNEL);
157157 if (!chip->buffer) {
158158 ret = -ENOMEM;
159159 goto exit_destroy;
drivers/gpio/gpio-mcp23s08.c+3−3
@@ -77,7 +77,7 @@ struct mcp23s08_driver_data { · 76 unmodified lines
7777
7878 /*----------------------------------------------------------------------*/
7979
80−#ifdef CONFIG_I2C
80+#if IS_ENABLED(CONFIG_I2C)
8181
8282 static int mcp23008_read(struct mcp23s08 *mcp, unsigned reg)
8383 {
@@ -399,7 +399,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev, · 315 unmodified lines
399399 break;
400400 #endif /* CONFIG_SPI_MASTER */
401401
402−#ifdef CONFIG_I2C
402+#if IS_ENABLED(CONFIG_I2C)
403403 case MCP_TYPE_008:
404404 mcp->ops = &mcp23008_ops;
405405 mcp->chip.ngpio = 8;
@@ -473,7 +473,7 @@ fail: · 67 unmodified lines
473473
474474 /*----------------------------------------------------------------------*/
475475
476−#ifdef CONFIG_I2C
476+#if IS_ENABLED(CONFIG_I2C)
477477
478478 static int __devinit mcp230xx_probe(struct i2c_client *client,
479479 const struct i2c_device_id *id)
drivers/gpio/gpio-mvebu.c+26−1
@@ -92,6 +92,11 @@ static inline void __iomem *mvebu_gpioreg_out(struct mvebu_gpio_chip *mvchip) · 91 unmodified lines
9292 return mvchip->membase + GPIO_OUT_OFF;
9393 }
9494
95+static inline void __iomem *mvebu_gpioreg_blink(struct mvebu_gpio_chip *mvchip)
96+{
97+ return mvchip->membase + GPIO_BLINK_EN_OFF;
98+}
99+
95100 static inline void __iomem *mvebu_gpioreg_io_conf(struct mvebu_gpio_chip *mvchip)
96101 {
97102 return mvchip->membase + GPIO_IO_CONF_OFF;
@@ -206,6 +211,23 @@ static int mvebu_gpio_get(struct gpio_chip *chip, unsigned pin) · 108 unmodified lines
206211 return (u >> pin) & 1;
207212 }
208213
214+static void mvebu_gpio_blink(struct gpio_chip *chip, unsigned pin, int value)
215+{
216+ struct mvebu_gpio_chip *mvchip =
217+ container_of(chip, struct mvebu_gpio_chip, chip);
218+ unsigned long flags;
219+ u32 u;
220+
221+ spin_lock_irqsave(&mvchip->lock, flags);
222+ u = readl_relaxed(mvebu_gpioreg_blink(mvchip));
223+ if (value)
224+ u |= 1 << pin;
225+ else
226+ u &= ~(1 << pin);
227+ writel_relaxed(u, mvebu_gpioreg_blink(mvchip));
228+ spin_unlock_irqrestore(&mvchip->lock, flags);
229+}
230+
209231 static int mvebu_gpio_direction_input(struct gpio_chip *chip, unsigned pin)
210232 {
211233 struct mvebu_gpio_chip *mvchip =
@@ -244,6 +266,9 @@ static int mvebu_gpio_direction_output(struct gpio_chip *chip, unsigned pin, · 32 unmodified lines
244266 if (ret)
245267 return ret;
246268
269+ mvebu_gpio_blink(chip, pin, 0);
270+ mvebu_gpio_set(chip, pin, value);
271+
247272 spin_lock_irqsave(&mvchip->lock, flags);
248273 u = readl_relaxed(mvebu_gpioreg_io_conf(mvchip));
249274 u &= ~(1 << pin);
@@ -644,7 +669,7 @@ static int __devinit mvebu_gpio_probe(struct platform_device *pdev) · 394 unmodified lines
644669 ct->handler = handle_edge_irq;
645670 ct->chip.name = mvchip->chip.label;
646671
647− irq_setup_generic_chip(gc, IRQ_MSK(ngpios), IRQ_GC_INIT_MASK_CACHE,
672+ irq_setup_generic_chip(gc, IRQ_MSK(ngpios), 0,
648673 IRQ_NOREQUEST, IRQ_LEVEL | IRQ_NOPROBE);
649674
650675 /* Setup irq domain on top of the generic chip. */
drivers/gpio/gpio-omap.c+35−0
@@ -251,6 +251,40 @@ static void _set_gpio_debounce(struct gpio_bank *bank, unsigned gpio, · 250 unmodified lines
251251 }
252252 }
253253
254+/**
255+ * _clear_gpio_debounce - clear debounce settings for a gpio
256+ * @bank: the gpio bank we're acting upon
257+ * @gpio: the gpio number on this @gpio
258+ *
259+ * If a gpio is using debounce, then clear the debounce enable bit and if
260+ * this is the only gpio in this bank using debounce, then clear the debounce
261+ * time too. The debounce clock will also be disabled when calling this function
262+ * if this is the only gpio in the bank using debounce.
263+ */
264+static void _clear_gpio_debounce(struct gpio_bank *bank, unsigned gpio)
265+{
266+ u32 gpio_bit = GPIO_BIT(bank, gpio);
267+
268+ if (!bank->dbck_flag)
269+ return;
270+
271+ if (!(bank->dbck_enable_mask & gpio_bit))
272+ return;
273+
274+ bank->dbck_enable_mask &= ~gpio_bit;
275+ bank->context.debounce_en &= ~gpio_bit;
276+ __raw_writel(bank->context.debounce_en,
277+ bank->base + bank->regs->debounce_en);
278+
279+ if (!bank->dbck_enable_mask) {
280+ bank->context.debounce = 0;
281+ __raw_writel(bank->context.debounce, bank->base +
282+ bank->regs->debounce);
283+ clk_disable(bank->dbck);
284+ bank->dbck_enabled = false;
285+ }
286+}
287+
254288 static inline void set_gpio_trigger(struct gpio_bank *bank, int gpio,
255289 unsigned trigger)
256290 {
@@ -539,6 +573,7 @@ static void _reset_gpio(struct gpio_bank *bank, int gpio) · 282 unmodified lines
539573 _set_gpio_irqenable(bank, gpio, 0);
540574 _clear_gpio_irqstatus(bank, gpio);
541575 _set_gpio_triggering(bank, GPIO_INDEX(bank, gpio), IRQ_TYPE_NONE);
576+ _clear_gpio_debounce(bank, gpio);
542577 }
543578
544579 /* Use disable_irq_wake() and enable_irq_wake() functions from drivers */
drivers/gpio/gpio-timberdale.c+2−2
@@ -116,7 +116,7 @@ static void timbgpio_irq_disable(struct irq_data *d) · 115 unmodified lines
116116 unsigned long flags;
117117
118118 spin_lock_irqsave(&tgpio->lock, flags);
119− tgpio->last_ier &= ~(1 << offset);
119+ tgpio->last_ier &= ~(1UL << offset);
120120 iowrite32(tgpio->last_ier, tgpio->membase + TGPIO_IER);
121121 spin_unlock_irqrestore(&tgpio->lock, flags);
122122 }
@@ -128,7 +128,7 @@ static void timbgpio_irq_enable(struct irq_data *d) · 5 unmodified lines
128128 unsigned long flags;
129129
130130 spin_lock_irqsave(&tgpio->lock, flags);
131− tgpio->last_ier |= 1 << offset;
131+ tgpio->last_ier |= 1UL << offset;
132132 iowrite32(tgpio->last_ier, tgpio->membase + TGPIO_IER);
133133 spin_unlock_irqrestore(&tgpio->lock, flags);
134134 }
drivers/gpio/gpiolib.c+7−3
@@ -623,9 +623,11 @@ static ssize_t export_store(struct class *class, · 622 unmodified lines
623623 */
624624
625625 status = gpio_request(gpio, "sysfs");
626− if (status < 0)
626+ if (status < 0) {
627+ if (status == -EPROBE_DEFER)
628+ status = -ENODEV;
627629 goto done;
628−
630+ }
629631 status = gpio_export(gpio, true);
630632 if (status < 0)
631633 gpio_free(gpio);
@@ -1191,8 +1193,10 @@ int gpio_request(unsigned gpio, const char *label) · 559 unmodified lines
11911193
11921194 spin_lock_irqsave(&gpio_lock, flags);
11931195
1194− if (!gpio_is_valid(gpio))
1196+ if (!gpio_is_valid(gpio)) {
1197+ status = -EINVAL;
11951198 goto done;
1199+ }
11961200 desc = &gpio_desc[gpio];
11971201 chip = desc->chip;
11981202 if (chip == NULL)
drivers/gpu/drm/drm_fops.c+30−14
@@ -121,6 +121,8 @@ int drm_open(struct inode *inode, struct file *filp) · 120 unmodified lines
121121 int minor_id = iminor(inode);
122122 struct drm_minor *minor;
123123 int retcode = 0;
124+ int need_setup = 0;
125+ struct address_space *old_mapping;
124126
125127 minor = idr_find(&drm_minors_idr, minor_id);
126128 if (!minor)
@@ -132,23 +134,37 @@ int drm_open(struct inode *inode, struct file *filp) · 5 unmodified lines
132134 if (drm_device_is_unplugged(dev))
133135 return -ENODEV;
134136
137+ if (!dev->open_count++)
138+ need_setup = 1;
139+ mutex_lock(&dev->struct_mutex);
140+ old_mapping = dev->dev_mapping;
141+ if (old_mapping == NULL)
142+ dev->dev_mapping = &inode->i_data;
143+ /* ihold ensures nobody can remove inode with our i_data */
144+ ihold(container_of(dev->dev_mapping, struct inode, i_data));
145+ inode->i_mapping = dev->dev_mapping;
146+ filp->f_mapping = dev->dev_mapping;
147+ mutex_unlock(&dev->struct_mutex);
148+
135149 retcode = drm_open_helper(inode, filp, dev);
136− if (!retcode) {
137− atomic_inc(&dev->counts[_DRM_STAT_OPENS]);
138− if (!dev->open_count++)
139− retcode = drm_setup(dev);
140− }
141− if (!retcode) {
142− mutex_lock(&dev->struct_mutex);
143− if (dev->dev_mapping == NULL)
144− dev->dev_mapping = &inode->i_data;
145− /* ihold ensures nobody can remove inode with our i_data */
146− ihold(container_of(dev->dev_mapping, struct inode, i_data));
147− inode->i_mapping = dev->dev_mapping;
148− filp->f_mapping = dev->dev_mapping;
149− mutex_unlock(&dev->struct_mutex);
150+ if (retcode)
151+ goto err_undo;
152+ atomic_inc(&dev->counts[_DRM_STAT_OPENS]);
153+ if (need_setup) {
154+ retcode = drm_setup(dev);
155+ if (retcode)
156+ goto err_undo;
150157 }
158+ return 0;
151159
160+err_undo:
161+ mutex_lock(&dev->struct_mutex);
162+ filp->f_mapping = old_mapping;
163+ inode->i_mapping = old_mapping;
164+ iput(container_of(dev->dev_mapping, struct inode, i_data));
165+ dev->dev_mapping = old_mapping;
166+ mutex_unlock(&dev->struct_mutex);
167+ dev->open_count--;
152168 return retcode;
153169 }
154170 EXPORT_SYMBOL(drm_open);
drivers/gpu/drm/exynos/Kconfig+1−1
@@ -1,6 +1,6 @@
11 config DRM_EXYNOS
22 tristate "DRM Support for Samsung SoC EXYNOS Series"
3− depends on DRM && PLAT_SAMSUNG
3+ depends on DRM && (PLAT_SAMSUNG || ARCH_MULTIPLATFORM)
44 select DRM_KMS_HELPER
55 select FB_CFB_FILLRECT
66 select FB_CFB_COPYAREA
drivers/gpu/drm/exynos/exynos_drm_connector.c+1−0
@@ -374,6 +374,7 @@ struct drm_connector *exynos_drm_connector_create(struct drm_device *dev, · 373 unmodified lines
374374 exynos_connector->encoder_id = encoder->base.id;
375375 exynos_connector->manager = manager;
376376 exynos_connector->dpms = DRM_MODE_DPMS_OFF;
377+ connector->dpms = DRM_MODE_DPMS_OFF;
377378 connector->encoder = encoder;
378379
379380 err = drm_mode_connector_attach_encoder(connector, encoder);
drivers/gpu/drm/exynos/exynos_drm_encoder.c+24−17
@@ -43,12 +43,14 @@ · 42 unmodified lines
4343 * @manager: specific encoder has its own manager to control a hardware
4444 * appropriately and we can access a hardware drawing on this manager.
4545 * @dpms: store the encoder dpms value.
46+ * @updated: indicate whether overlay data updating is needed or not.
4647 */
4748 struct exynos_drm_encoder {
4849 struct drm_crtc *old_crtc;
4950 struct drm_encoder drm_encoder;
5051 struct exynos_drm_manager *manager;
51− int dpms;
52+ int dpms;
53+ bool updated;
5254 };
5355
5456 static void exynos_drm_connector_power(struct drm_encoder *encoder, int mode)
@@ -85,7 +87,9 @@ static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode) · 30 unmodified lines
8587 switch (mode) {
8688 case DRM_MODE_DPMS_ON:
8789 if (manager_ops && manager_ops->apply)
88− manager_ops->apply(manager->dev);
90+ if (!exynos_encoder->updated)
91+ manager_ops->apply(manager->dev);
92+
8993 exynos_drm_connector_power(encoder, mode);
9094 exynos_encoder->dpms = mode;
9195 break;
@@ -94,6 +98,7 @@ static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode) · 2 unmodified lines
9498 case DRM_MODE_DPMS_OFF:
9599 exynos_drm_connector_power(encoder, mode);
96100 exynos_encoder->dpms = mode;
101+ exynos_encoder->updated = false;
97102 break;
98103 default:
99104 DRM_ERROR("unspecified mode %d\n", mode);
@@ -205,13 +210,28 @@ static void exynos_drm_encoder_prepare(struct drm_encoder *encoder) · 105 unmodified lines
205210
206211 static void exynos_drm_encoder_commit(struct drm_encoder *encoder)
207212 {
208− struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder);
213+ struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder);
214+ struct exynos_drm_manager *manager = exynos_encoder->manager;
209215 struct exynos_drm_manager_ops *manager_ops = manager->ops;
210216
211217 DRM_DEBUG_KMS("%s\n", __FILE__);
212218
213219 if (manager_ops && manager_ops->commit)
214220 manager_ops->commit(manager->dev);
221+
222+ /*
223+ * this will avoid one issue that overlay data is updated to
224+ * real hardware two times.
225+ * And this variable will be used to check if the data was
226+ * already updated or not by exynos_drm_encoder_dpms function.
227+ */
228+ exynos_encoder->updated = true;
229+
230+ /*
231+ * In case of setcrtc, there is no way to update encoder's dpms
232+ * so update it here.
233+ */
234+ exynos_encoder->dpms = DRM_MODE_DPMS_ON;
215235 }
216236
217237 static void exynos_drm_encoder_disable(struct drm_encoder *encoder)
@@ -400,19 +420,6 @@ void exynos_drm_encoder_crtc_dpms(struct drm_encoder *encoder, void *data) · 182 unmodified lines
400420 if (manager_ops && manager_ops->dpms)
401421 manager_ops->dpms(manager->dev, mode);
402422
403− /*
404− * set current mode to new one so that data aren't updated into
405− * registers by drm_helper_connector_dpms two times.
406− *
407− * in case that drm_crtc_helper_set_mode() is called,
408− * overlay_ops->commit() and manager_ops->commit() callbacks
409− * can be called two times, first at drm_crtc_helper_set_mode()
410− * and second at drm_helper_connector_dpms().
411− * so with this setting, when drm_helper_connector_dpms() is called
412− * encoder->funcs->dpms() will be ignored.
413− */
414− exynos_encoder->dpms = mode;
415−
416423 /*
417424 * if this condition is ok then it means that the crtc is already
418425 * detached from encoder and last function for detaching is properly
@@ -506,6 +513,6 @@ void exynos_drm_encoder_plane_disable(struct drm_encoder *encoder, void *data) · 87 unmodified lines
506513 * because the setting for disabling the overlay will be updated
507514 * at vsync.
508515 */
509− if (overlay_ops->wait_for_vblank)
516+ if (overlay_ops && overlay_ops->wait_for_vblank)
510517 overlay_ops->wait_for_vblank(manager->dev);
511518 }
drivers/gpu/drm/exynos/exynos_drm_fbdev.c+2−1
@@ -87,7 +87,8 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper, · 86 unmodified lines
8787
8888 dev->mode_config.fb_base = (resource_size_t)buffer->dma_addr;
8989 fbi->screen_base = buffer->kvaddr + offset;
90− fbi->fix.smem_start = (unsigned long)(buffer->dma_addr + offset);
90+ fbi->fix.smem_start = (unsigned long)(page_to_phys(buffer->pages[0]) +
91+ offset);
9192 fbi->screen_size = size;
9293 fbi->fix.smem_len = size;
9394
drivers/gpu/drm/exynos/exynos_drm_fimd.c+2−2
@@ -61,11 +61,11 @@ struct fimd_driver_data { · 60 unmodified lines
6161 unsigned int timing_base;
6262 };
6363
64−struct fimd_driver_data exynos4_fimd_driver_data = {
64+static struct fimd_driver_data exynos4_fimd_driver_data = {
6565 .timing_base = 0x0,
6666 };
6767
68−struct fimd_driver_data exynos5_fimd_driver_data = {
68+static struct fimd_driver_data exynos5_fimd_driver_data = {
6969 .timing_base = 0x20000,
7070 };
7171
drivers/gpu/drm/exynos/exynos_drm_plane.c+0−1
@@ -204,7 +204,6 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, · 203 unmodified lines
204204 return ret;
205205
206206 plane->crtc = crtc;
207− plane->fb = crtc->fb;
208207
209208 exynos_plane_commit(plane);
210209 exynos_plane_dpms(plane, DRM_MODE_DPMS_ON);
drivers/gpu/drm/exynos/exynos_mixer.c+1−1
@@ -1142,7 +1142,7 @@ static int __devinit mixer_probe(struct platform_device *pdev) · 1141 unmodified lines
11421142 const struct of_device_id *match;
11431143 match = of_match_node(of_match_ptr(mixer_match_types),
11441144 pdev->dev.of_node);
1145− drv = match->data;
1145+ drv = (struct mixer_drv_data *)match->data;
11461146 } else {
11471147 drv = (struct mixer_drv_data *)
11481148 platform_get_device_id(pdev)->driver_data;
drivers/gpu/drm/i915/i915_dma.c+2−1
@@ -1505,7 +1505,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) · 1504 unmodified lines
15051505 goto put_gmch;
15061506 }
15071507
1508− i915_kick_out_firmware_fb(dev_priv);
1508+ if (drm_core_check_feature(dev, DRIVER_MODESET))
1509+ i915_kick_out_firmware_fb(dev_priv);
15091510
15101511 pci_set_master(dev->pdev);
15111512
drivers/gpu/drm/i915/intel_bios.c+2−9
@@ -499,12 +499,8 @@ parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb) · 498 unmodified lines
499499
500500 edp = find_section(bdb, BDB_EDP);
501501 if (!edp) {
502− if (SUPPORTS_EDP(dev_priv->dev) && dev_priv->edp.support) {
503− DRM_DEBUG_KMS("No eDP BDB found but eDP panel "
504− "supported, assume %dbpp panel color "
505− "depth.\n",
506− dev_priv->edp.bpp);
507− }
502+ if (SUPPORTS_EDP(dev_priv->dev) && dev_priv->edp.support)
503+ DRM_DEBUG_KMS("No eDP BDB found but eDP panel supported.\n");
508504 return;
509505 }
510506
@@ -657,9 +653,6 @@ init_vbt_defaults(struct drm_i915_private *dev_priv) · 146 unmodified lines
657653 dev_priv->lvds_use_ssc = 1;
658654 dev_priv->lvds_ssc_freq = intel_bios_ssc_frequency(dev, 1);
659655 DRM_DEBUG_KMS("Set default to SSC at %dMHz\n", dev_priv->lvds_ssc_freq);
660−
661− /* eDP data */
662− dev_priv->edp.bpp = 18;
663656 }
664657
665658 static int __init intel_no_opregion_vbt_callback(const struct dmi_system_id *id)
drivers/gpu/drm/i915/intel_crt.c+2−2
@@ -143,7 +143,7 @@ static void intel_crt_dpms(struct drm_connector *connector, int mode) · 142 unmodified lines
143143 int old_dpms;
144144
145145 /* PCH platforms and VLV only support on/off. */
146− if (INTEL_INFO(dev)->gen < 5 && mode != DRM_MODE_DPMS_ON)
146+ if (INTEL_INFO(dev)->gen >= 5 && mode != DRM_MODE_DPMS_ON)
147147 mode = DRM_MODE_DPMS_OFF;
148148
149149 if (mode == connector->dpms)
@@ -729,7 +729,7 @@ void intel_crt_init(struct drm_device *dev) · 579 unmodified lines
729729
730730 crt->base.type = INTEL_OUTPUT_ANALOG;
731731 crt->base.cloneable = true;
732− if (IS_HASWELL(dev))
732+ if (IS_HASWELL(dev) || IS_I830(dev))
733733 crt->base.crtc_mask = (1 << 0);
734734 else
735735 crt->base.crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
drivers/gpu/drm/i915/intel_display.c+11−0
@@ -3841,6 +3841,17 @@ static bool intel_choose_pipe_bpp_dither(struct drm_crtc *crtc, · 3840 unmodified lines
38413841 }
38423842 }
38433843
3844+ if (intel_encoder->type == INTEL_OUTPUT_EDP) {
3845+ /* Use VBT settings if we have an eDP panel */
3846+ unsigned int edp_bpc = dev_priv->edp.bpp / 3;
3847+
3848+ if (edp_bpc && edp_bpc < display_bpc) {
3849+ DRM_DEBUG_KMS("clamping display bpc (was %d) to eDP (%d)\n", display_bpc, edp_bpc);
3850+ display_bpc = edp_bpc;
3851+ }
3852+ continue;
3853+ }
3854+
38443855 /*
38453856 * HDMI is either 12 or 8, so if the display lets 10bpc sneak
38463857 * through, clamp it down. (Note: >12bpc will be caught below.)
drivers/gpu/drm/i915/intel_overlay.c+11−3
@@ -341,9 +341,17 @@ static int intel_overlay_off(struct intel_overlay *overlay) · 340 unmodified lines
341341 intel_ring_emit(ring, flip_addr);
342342 intel_ring_emit(ring, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP);
343343 /* turn overlay off */
344− intel_ring_emit(ring, MI_OVERLAY_FLIP | MI_OVERLAY_OFF);
345− intel_ring_emit(ring, flip_addr);
346− intel_ring_emit(ring, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP);
344+ if (IS_I830(dev)) {
345+ /* Workaround: Don't disable the overlay fully, since otherwise
346+ * it dies on the next OVERLAY_ON cmd. */
347+ intel_ring_emit(ring, MI_NOOP);
348+ intel_ring_emit(ring, MI_NOOP);
349+ intel_ring_emit(ring, MI_NOOP);
350+ } else {
351+ intel_ring_emit(ring, MI_OVERLAY_FLIP | MI_OVERLAY_OFF);
352+ intel_ring_emit(ring, flip_addr);
353+ intel_ring_emit(ring, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP);
354+ }
347355 intel_ring_advance(ring);
348356
349357 return intel_overlay_do_wait_request(overlay, intel_overlay_off_tail);
drivers/gpu/drm/i915/intel_panel.c+1−1
@@ -435,7 +435,7 @@ int intel_panel_setup_backlight(struct drm_device *dev) · 434 unmodified lines
435435 props.type = BACKLIGHT_RAW;
436436 props.max_brightness = _intel_panel_get_max_backlight(dev);
437437 if (props.max_brightness == 0) {
438− DRM_ERROR("Failed to get maximum backlight value\n");
438+ DRM_DEBUG_DRIVER("Failed to get maximum backlight value\n");
439439 return -ENODEV;
440440 }
441441 dev_priv->backlight =
drivers/gpu/drm/i915/intel_pm.c+3−9
@@ -2373,15 +2373,9 @@ int intel_enable_rc6(const struct drm_device *dev) · 2372 unmodified lines
23732373 if (i915_enable_rc6 >= 0)
23742374 return i915_enable_rc6;
23752375
2376− if (INTEL_INFO(dev)->gen == 5) {
2377−#ifdef CONFIG_INTEL_IOMMU
2378− /* Disable rc6 on ilk if VT-d is on. */
2379− if (intel_iommu_gfx_mapped)
2380− return false;
2381−#endif
2382− DRM_DEBUG_DRIVER("Ironlake: only RC6 available\n");
2383− return INTEL_RC6_ENABLE;
2384− }
2376+ /* Disable RC6 on Ironlake */
2377+ if (INTEL_INFO(dev)->gen == 5)
2378+ return 0;
23852379
23862380 if (IS_HASWELL(dev)) {
23872381 DRM_DEBUG_DRIVER("Haswell: only RC6 available\n");
drivers/gpu/drm/i915/intel_sdvo.c+71−30
@@ -894,6 +894,45 @@ static void intel_sdvo_dump_hdmi_buf(struct intel_sdvo *intel_sdvo) · 893 unmodified lines
894894 }
895895 #endif
896896
897+static bool intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo,
898+ unsigned if_index, uint8_t tx_rate,
899+ uint8_t *data, unsigned length)
900+{
901+ uint8_t set_buf_index[2] = { if_index, 0 };
902+ uint8_t hbuf_size, tmp[8];
903+ int i;
904+
905+ if (!intel_sdvo_set_value(intel_sdvo,
906+ SDVO_CMD_SET_HBUF_INDEX,
907+ set_buf_index, 2))
908+ return false;
909+
910+ if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HBUF_INFO,
911+ &hbuf_size, 1))
912+ return false;
913+
914+ /* Buffer size is 0 based, hooray! */
915+ hbuf_size++;
916+
917+ DRM_DEBUG_KMS("writing sdvo hbuf: %i, hbuf_size %i, hbuf_size: %i\n",
918+ if_index, length, hbuf_size);
919+
920+ for (i = 0; i < hbuf_size; i += 8) {
921+ memset(tmp, 0, 8);
922+ if (i < length)
923+ memcpy(tmp, data + i, min_t(unsigned, 8, length - i));
924+
925+ if (!intel_sdvo_set_value(intel_sdvo,
926+ SDVO_CMD_SET_HBUF_DATA,
927+ tmp, 8))
928+ return false;
929+ }
930+
931+ return intel_sdvo_set_value(intel_sdvo,
932+ SDVO_CMD_SET_HBUF_TXRATE,
933+ &tx_rate, 1);
934+}
935+
897936 static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo)
898937 {
899938 struct dip_infoframe avi_if = {
@@ -901,11 +940,7 @@ static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo) · 1 unmodified line
901940 .ver = DIP_VERSION_AVI,
902941 .len = DIP_LEN_AVI,
903942 };
904− uint8_t tx_rate = SDVO_HBUF_TX_VSYNC;
905− uint8_t set_buf_index[2] = { 1, 0 };
906943 uint8_t sdvo_data[4 + sizeof(avi_if.body.avi)];
907− uint64_t *data = (uint64_t *)sdvo_data;
908− unsigned i;
909944
910945 intel_dip_infoframe_csum(&avi_if);
911946
@@ -915,22 +950,9 @@ static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo) · 3 unmodified lines
915950 sdvo_data[3] = avi_if.checksum;
916951 memcpy(&sdvo_data[4], &avi_if.body, sizeof(avi_if.body.avi));
917952
918− if (!intel_sdvo_set_value(intel_sdvo,
919− SDVO_CMD_SET_HBUF_INDEX,
920− set_buf_index, 2))
921− return false;
922−
923− for (i = 0; i < sizeof(sdvo_data); i += 8) {
924− if (!intel_sdvo_set_value(intel_sdvo,
925− SDVO_CMD_SET_HBUF_DATA,
926− data, 8))
927− return false;
928− data++;
929− }
930−
931− return intel_sdvo_set_value(intel_sdvo,
932− SDVO_CMD_SET_HBUF_TXRATE,
933− &tx_rate, 1);
953+ return intel_sdvo_write_infoframe(intel_sdvo, SDVO_HBUF_INDEX_AVI_IF,
954+ SDVO_HBUF_TX_VSYNC,
955+ sdvo_data, sizeof(sdvo_data));
934956 }
935957
936958 static bool intel_sdvo_set_tv_format(struct intel_sdvo *intel_sdvo)
@@ -2179,7 +2201,6 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) · 1242 unmodified lines
21792201 connector->connector_type = DRM_MODE_CONNECTOR_HDMIA;
21802202 intel_sdvo->is_hdmi = true;
21812203 }
2182− intel_sdvo->base.cloneable = true;
21832204
21842205 intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo);
21852206 if (intel_sdvo->is_hdmi)
@@ -2210,7 +2231,6 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) · 24 unmodified lines
22102231
22112232 intel_sdvo->is_tv = true;
22122233 intel_sdvo->base.needs_tv_clock = true;
2213− intel_sdvo->base.cloneable = false;
22142234
22152235 intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo);
22162236
@@ -2253,8 +2273,6 @@ intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device) · 36 unmodified lines
22532273 intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB1;
22542274 }
22552275
2256− intel_sdvo->base.cloneable = true;
2257−
22582276 intel_sdvo_connector_init(intel_sdvo_connector,
22592277 intel_sdvo);
22602278 return true;
@@ -2285,9 +2303,6 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) · 24 unmodified lines
22852303 intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS1;
22862304 }
22872305
2288− /* SDVO LVDS is not cloneable because the input mode gets adjusted by the encoder */
2289− intel_sdvo->base.cloneable = false;
2290−
22912306 intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo);
22922307 if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector))
22932308 goto err;
@@ -2360,6 +2375,18 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags) · 66 unmodified lines
23602375 return true;
23612376 }
23622377
2378+static void intel_sdvo_output_cleanup(struct intel_sdvo *intel_sdvo)
2379+{
2380+ struct drm_device *dev = intel_sdvo->base.base.dev;
2381+ struct drm_connector *connector, *tmp;
2382+
2383+ list_for_each_entry_safe(connector, tmp,
2384+ &dev->mode_config.connector_list, head) {
2385+ if (intel_attached_encoder(connector) == &intel_sdvo->base)
2386+ intel_sdvo_destroy(connector);
2387+ }
2388+}
2389+
23632390 static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
23642391 struct intel_sdvo_connector *intel_sdvo_connector,
23652392 int type)
@@ -2683,9 +2710,20 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob) · 317 unmodified lines
26832710 intel_sdvo->caps.output_flags) != true) {
26842711 DRM_DEBUG_KMS("SDVO output failed to setup on %s\n",
26852712 SDVO_NAME(intel_sdvo));
2686− goto err;
2713+ /* Output_setup can leave behind connectors! */
2714+ goto err_output;
26872715 }
26882716
2717+ /*
2718+ * Cloning SDVO with anything is often impossible, since the SDVO
2719+ * encoder can request a special input timing mode. And even if that's
2720+ * not the case we have evidence that cloning a plain unscaled mode with
2721+ * VGA doesn't really work. Furthermore the cloning flags are way too
2722+ * simplistic anyway to express such constraints, so just give up on
2723+ * cloning for SDVO encoders.
2724+ */
2725+ intel_sdvo->base.cloneable = false;
2726+
26892727 /* Only enable the hotplug irq if we need it, to work around noisy
26902728 * hotplug lines.
26912729 */
@@ -2696,12 +2734,12 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob) · 4 unmodified lines
26962734
26972735 /* Set the input timing to the screen. Assume always input 0. */
26982736 if (!intel_sdvo_set_target_input(intel_sdvo))
2699− goto err;
2737+ goto err_output;
27002738
27012739 if (!intel_sdvo_get_input_pixel_clock_range(intel_sdvo,
27022740 &intel_sdvo->pixel_clock_min,
27032741 &intel_sdvo->pixel_clock_max))
2704− goto err;
2742+ goto err_output;
27052743
27062744 DRM_DEBUG_KMS("%s device VID/DID: %02X:%02X.%02X, "
27072745 "clock range %dMHz - %dMHz, "
@@ -2721,6 +2759,9 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob) · 13 unmodified lines
27212759 (SDVO_OUTPUT_TMDS1 | SDVO_OUTPUT_RGB1) ? 'Y' : 'N');
27222760 return true;
27232761
2762+err_output:
2763+ intel_sdvo_output_cleanup(intel_sdvo);
2764+
27242765 err:
27252766 drm_encoder_cleanup(&intel_encoder->base);
27262767 i2c_del_adapter(&intel_sdvo->ddc);
drivers/gpu/drm/i915/intel_sdvo_regs.h+2−0
@@ -708,6 +708,8 @@ struct intel_sdvo_enhancements_arg { · 707 unmodified lines
708708 #define SDVO_CMD_SET_AUDIO_STAT 0x91
709709 #define SDVO_CMD_GET_AUDIO_STAT 0x92
710710 #define SDVO_CMD_SET_HBUF_INDEX 0x93
711+ #define SDVO_HBUF_INDEX_ELD 0
712+ #define SDVO_HBUF_INDEX_AVI_IF 1
711713 #define SDVO_CMD_GET_HBUF_INDEX 0x94
712714 #define SDVO_CMD_GET_HBUF_INFO 0x95
713715 #define SDVO_CMD_SET_HBUF_AV_SPLIT 0x96
drivers/gpu/drm/nouveau/core/core/mm.c+6−3
@@ -218,13 +218,16 @@ nouveau_mm_init(struct nouveau_mm *mm, u32 offset, u32 length, u32 block) · 217 unmodified lines
218218 node = kzalloc(sizeof(*node), GFP_KERNEL);
219219 if (!node)
220220 return -ENOMEM;
221− node->offset = roundup(offset, mm->block_size);
222− node->length = rounddown(offset + length, mm->block_size) - node->offset;
221+
222+ if (length) {
223+ node->offset = roundup(offset, mm->block_size);
224+ node->length = rounddown(offset + length, mm->block_size);
225+ node->length -= node->offset;
226+ }
223227
224228 list_add_tail(&node->nl_entry, &mm->nodes);
225229 list_add_tail(&node->fl_entry, &mm->free);
226230 mm->heap_nodes++;
227− mm->heap_size += length;
228231 return 0;
229232 }
230233
drivers/gpu/drm/nouveau/core/engine/disp/nv50.c+20−11
@@ -22,6 +22,8 @@ · 21 unmodified lines
2222 * Authors: Ben Skeggs
2323 */
2424
25+#include <subdev/bar.h>
26+
2527 #include <engine/software.h>
2628 #include <engine/disp.h>
2729
@@ -37,6 +39,7 @@ nv50_disp_sclass[] = { · 9 unmodified lines
3739 static void
3840 nv50_disp_intr_vblank(struct nv50_disp_priv *priv, int crtc)
3941 {
42+ struct nouveau_bar *bar = nouveau_bar(priv);
4043 struct nouveau_disp *disp = &priv->base;
4144 struct nouveau_software_chan *chan, *temp;
4245 unsigned long flags;
@@ -46,19 +49,25 @@ nv50_disp_intr_vblank(struct nv50_disp_priv *priv, int crtc) · 3 unmodified lines
4649 if (chan->vblank.crtc != crtc)
4750 continue;
4851
49− nv_wr32(priv, 0x001704, chan->vblank.channel);
50− nv_wr32(priv, 0x001710, 0x80000000 | chan->vblank.ctxdma);
51−
52− if (nv_device(priv)->chipset == 0x50) {
53− nv_wr32(priv, 0x001570, chan->vblank.offset);
54− nv_wr32(priv, 0x001574, chan->vblank.value);
52+ if (nv_device(priv)->chipset >= 0xc0) {
53+ nv_wr32(priv, 0x001718, 0x80000000 | chan->vblank.channel);
54+ bar->flush(bar);
55+ nv_wr32(priv, 0x06000c,
56+ upper_32_bits(chan->vblank.offset));
57+ nv_wr32(priv, 0x060010,
58+ lower_32_bits(chan->vblank.offset));
59+ nv_wr32(priv, 0x060014, chan->vblank.value);
5560 } else {
56− if (nv_device(priv)->chipset >= 0xc0) {
57− nv_wr32(priv, 0x06000c,
58− upper_32_bits(chan->vblank.offset));
61+ nv_wr32(priv, 0x001704, chan->vblank.channel);
62+ nv_wr32(priv, 0x001710, 0x80000000 | chan->vblank.ctxdma);
63+ bar->flush(bar);
64+ if (nv_device(priv)->chipset == 0x50) {
65+ nv_wr32(priv, 0x001570, chan->vblank.offset);
66+ nv_wr32(priv, 0x001574, chan->vblank.value);
67+ } else {
68+ nv_wr32(priv, 0x060010, chan->vblank.offset);
69+ nv_wr32(priv, 0x060014, chan->vblank.value);
5970 }
60− nv_wr32(priv, 0x060010, chan->vblank.offset);
61− nv_wr32(priv, 0x060014, chan->vblank.value);
6271 }
6372
6473 list_del(&chan->vblank.head);
drivers/gpu/drm/nouveau/core/engine/graph/ctxnv40.c+9−3
@@ -669,21 +669,27 @@ nv40_grctx_fill(struct nouveau_device *device, struct nouveau_gpuobj *mem) · 668 unmodified lines
669669 });
670670 }
671671
672−void
672+int
673673 nv40_grctx_init(struct nouveau_device *device, u32 *size)
674674 {
675− u32 ctxprog[256], i;
675+ u32 *ctxprog = kmalloc(256 * 4, GFP_KERNEL), i;
676676 struct nouveau_grctx ctx = {
677677 .device = device,
678678 .mode = NOUVEAU_GRCTX_PROG,
679679 .data = ctxprog,
680− .ctxprog_max = ARRAY_SIZE(ctxprog)
680+ .ctxprog_max = 256,
681681 };
682682
683+ if (!ctxprog)
684+ return -ENOMEM;
685+
683686 nv40_grctx_generate(&ctx);
684687
685688 nv_wr32(device, 0x400324, 0);
686689 for (i = 0; i < ctx.ctxprog_len; i++)
687690 nv_wr32(device, 0x400328, ctxprog[i]);
688691 *size = ctx.ctxvals_pos * 4;
692+
693+ kfree(ctxprog);
694+ return 0;
689695 }
drivers/gpu/drm/nouveau/core/engine/graph/nv40.c+5−3
@@ -156,8 +156,8 @@ nv40_graph_context_ctor(struct nouveau_object *parent, · 155 unmodified lines
156156 static int
157157 nv40_graph_context_fini(struct nouveau_object *object, bool suspend)
158158 {
159− struct nv04_graph_priv *priv = (void *)object->engine;
160− struct nv04_graph_chan *chan = (void *)object;
159+ struct nv40_graph_priv *priv = (void *)object->engine;
160+ struct nv40_graph_chan *chan = (void *)object;
161161 u32 inst = 0x01000000 | nv_gpuobj(chan)->addr >> 4;
162162 int ret = 0;
163163
@@ -346,7 +346,9 @@ nv40_graph_init(struct nouveau_object *object) · 182 unmodified lines
346346 return ret;
347347
348348 /* generate and upload context program */
349− nv40_grctx_init(nv_device(priv), &priv->size);
349+ ret = nv40_grctx_init(nv_device(priv), &priv->size);
350+ if (ret)
351+ return ret;
350352
351353 /* No context present currently */
352354 nv_wr32(priv, NV40_PGRAPH_CTXCTL_CUR, 0x00000000);
drivers/gpu/drm/nouveau/core/engine/graph/nv40.h+1−1
@@ -15,7 +15,7 @@ nv44_graph_class(void *priv) · 14 unmodified lines
1515 return !(0x0baf & (1 << (device->chipset & 0x0f)));
1616 }
1717
18−void nv40_grctx_init(struct nouveau_device *, u32 *size);
18+int nv40_grctx_init(struct nouveau_device *, u32 *size);
1919 void nv40_grctx_fill(struct nouveau_device *, struct nouveau_gpuobj *);
2020
2121 #endif
drivers/gpu/drm/nouveau/core/engine/mpeg/nv40.c+1−1
@@ -38,7 +38,7 @@ struct nv40_mpeg_priv { · 37 unmodified lines
3838 };
3939
4040 struct nv40_mpeg_chan {
41− struct nouveau_mpeg base;
41+ struct nouveau_mpeg_chan base;
4242 };
4343
4444 /*******************************************************************************
drivers/gpu/drm/nouveau/core/include/core/mm.h+0−1
@@ -19,7 +19,6 @@ struct nouveau_mm { · 18 unmodified lines
1919
2020 u32 block_size;
2121 int heap_nodes;
22− u32 heap_size;
2322 };
2423
2524 int nouveau_mm_init(struct nouveau_mm *, u32 offset, u32 length, u32 block);
drivers/gpu/drm/nouveau/core/include/core/object.h+9−5
@@ -175,14 +175,18 @@ nv_mo32(void *obj, u32 addr, u32 mask, u32 data) · 174 unmodified lines
175175 return temp;
176176 }
177177
178−static inline bool
179−nv_strncmp(void *obj, u32 addr, u32 len, const char *str)
178+static inline int
179+nv_memcmp(void *obj, u32 addr, const char *str, u32 len)
180180 {
181+ unsigned char c1, c2;
182+
181183 while (len--) {
182− if (nv_ro08(obj, addr++) != *(str++))
183− return false;
184+ c1 = nv_ro08(obj, addr++);
185+ c2 = *(str++);
186+ if (c1 != c2)
187+ return c1 - c2;
184188 }
185− return true;
189+ return 0;
186190 }
187191
188192 #endif
drivers/gpu/drm/nouveau/core/include/subdev/clock.h+2−1
@@ -54,6 +54,7 @@ int nv04_clock_pll_calc(struct nouveau_clock *, struct nvbios_pll *, · 53 unmodified lines
5454 int clk, struct nouveau_pll_vals *);
5555 int nv04_clock_pll_prog(struct nouveau_clock *, u32 reg1,
5656 struct nouveau_pll_vals *);
57−
57+int nva3_clock_pll_calc(struct nouveau_clock *, struct nvbios_pll *,
58+ int clk, struct nouveau_pll_vals *);
5859
5960 #endif
drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c+1−1
@@ -64,7 +64,7 @@ dcb_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) · 63 unmodified lines
6464 }
6565 } else
6666 if (*ver >= 0x15) {
67− if (!nv_strncmp(bios, dcb - 7, 7, "DEV_REC")) {
67+ if (!nv_memcmp(bios, dcb - 7, "DEV_REC", 7)) {
6868 u16 i2c = nv_ro16(bios, dcb + 2);
6969 *hdr = 4;
7070 *cnt = (i2c - dcb) / 10;
drivers/gpu/drm/nouveau/core/subdev/clock/nva3.c+19−0
@@ -66,6 +66,24 @@ nva3_clock_pll_set(struct nouveau_clock *clk, u32 type, u32 freq) · 65 unmodified lines
6666 return ret;
6767 }
6868
69+int
70+nva3_clock_pll_calc(struct nouveau_clock *clock, struct nvbios_pll *info,
71+ int clk, struct nouveau_pll_vals *pv)
72+{
73+ int ret, N, M, P;
74+
75+ ret = nva3_pll_calc(clock, info, clk, &N, NULL, &M, &P);
76+
77+ if (ret > 0) {
78+ pv->refclk = info->refclk;
79+ pv->N1 = N;
80+ pv->M1 = M;
81+ pv->log2P = P;
82+ }
83+ return ret;
84+}
85+
86+
6987 static int
7088 nva3_clock_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
7189 struct nouveau_oclass *oclass, void *data, u32 size,
@@ -80,6 +98,7 @@ nva3_clock_ctor(struct nouveau_object *parent, struct nouveau_object *engine, · 8 unmodified lines
8098 return ret;
8199
82100 priv->base.pll_set = nva3_clock_pll_set;
101+ priv->base.pll_calc = nva3_clock_pll_calc;
83102 return 0;
84103 }
85104
drivers/gpu/drm/nouveau/core/subdev/clock/nvc0.c+1−0
@@ -79,6 +79,7 @@ nvc0_clock_ctor(struct nouveau_object *parent, struct nouveau_object *engine, · 78 unmodified lines
7979 return ret;
8080
8181 priv->base.pll_set = nvc0_clock_pll_set;
82+ priv->base.pll_calc = nva3_clock_pll_calc;
8283 return 0;
8384 }
8485
drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c+4−6
@@ -219,13 +219,11 @@ nv50_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, · 218 unmodified lines
219219 ((priv->base.ram.size & 0x000000ff) << 32);
220220
221221 tags = nv_rd32(priv, 0x100320);
222− if (tags) {
223− ret = nouveau_mm_init(&priv->base.tags, 0, tags, 1);
224− if (ret)
225− return ret;
222+ ret = nouveau_mm_init(&priv->base.tags, 0, tags, 1);
223+ if (ret)
224+ return ret;
226225
227− nv_debug(priv, "%d compression tags\n", tags);
228− }
226+ nv_debug(priv, "%d compression tags\n", tags);
229227
230228 size = (priv->base.ram.size >> 12) - rsvd_head - rsvd_tail;
231229 switch (device->chipset) {
drivers/gpu/drm/nouveau/core/subdev/i2c/base.c+1−1
@@ -292,7 +292,7 @@ nouveau_i2c_ctor(struct nouveau_object *parent, struct nouveau_object *engine, · 291 unmodified lines
292292 case DCB_I2C_NVIO_BIT:
293293 port->drive = info.drive & 0x0f;
294294 if (device->card_type < NV_D0) {
295− if (info.drive >= ARRAY_SIZE(nv50_i2c_port))
295+ if (port->drive >= ARRAY_SIZE(nv50_i2c_port))
296296 break;
297297 port->drive = nv50_i2c_port[port->drive];
298298 port->sense = port->drive;
drivers/gpu/drm/nouveau/core/subdev/vm/nv41.c+1−1
@@ -67,7 +67,7 @@ nv41_vm_unmap(struct nouveau_gpuobj *pgt, u32 pte, u32 cnt) · 66 unmodified lines
6767 static void
6868 nv41_vm_flush(struct nouveau_vm *vm)
6969 {
70− struct nv04_vm_priv *priv = (void *)vm->vmm;
70+ struct nv04_vmmgr_priv *priv = (void *)vm->vmm;
7171
7272 mutex_lock(&nv_subdev(priv)->mutex);
7373 nv_wr32(priv, 0x100810, 0x00000022);
drivers/gpu/drm/nouveau/nouveau_abi16.c+4−0
@@ -241,6 +241,10 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS) · 240 unmodified lines
241241
242242 if (unlikely(!abi16))
243243 return -ENOMEM;
244+
245+ if (!drm->channel)
246+ return nouveau_abi16_put(abi16, -ENODEV);
247+
244248 client = nv_client(abi16->client);
245249
246250 if (init->fb_ctxdma_handle == ~0 || init->tt_ctxdma_handle == ~0)
drivers/gpu/drm/nouveau/nouveau_connector.c+1−1
@@ -355,7 +355,7 @@ nouveau_connector_detect_lvds(struct drm_connector *connector, bool force) · 354 unmodified lines
355355 * valid - it's not (rh#613284)
356356 */
357357 if (nv_encoder->dcb->lvdsconf.use_acpi_for_edid) {
358− if (!(nv_connector->edid = nouveau_acpi_edid(dev, connector))) {
358+ if ((nv_connector->edid = nouveau_acpi_edid(dev, connector))) {
359359 status = connector_status_connected;
360360 goto out;
361361 }
drivers/gpu/drm/nouveau/nouveau_display.c+21−15
@@ -290,6 +290,7 @@ nouveau_display_create(struct drm_device *dev) · 289 unmodified lines
290290 struct nouveau_drm *drm = nouveau_drm(dev);
291291 struct nouveau_disp *pdisp = nouveau_disp(drm->device);
292292 struct nouveau_display *disp;
293+ u32 pclass = dev->pdev->class >> 8;
293294 int ret, gen;
294295
295296 disp = drm->display = kzalloc(sizeof(*disp), GFP_KERNEL);
@@ -360,23 +361,27 @@ nouveau_display_create(struct drm_device *dev) · 64 unmodified lines
360361 drm_kms_helper_poll_init(dev);
361362 drm_kms_helper_poll_disable(dev);
362363
363− if (nv_device(drm->device)->card_type < NV_50)
364− ret = nv04_display_create(dev);
365− else
366− if (nv_device(drm->device)->card_type < NV_D0)
367− ret = nv50_display_create(dev);
368− else
369− ret = nvd0_display_create(dev);
370− if (ret)
371− goto disp_create_err;
372−
373− if (dev->mode_config.num_crtc) {
374− ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
364+ if (nouveau_modeset == 1 ||
365+ (nouveau_modeset < 0 && pclass == PCI_CLASS_DISPLAY_VGA)) {
366+ if (nv_device(drm->device)->card_type < NV_50)
367+ ret = nv04_display_create(dev);
368+ else
369+ if (nv_device(drm->device)->card_type < NV_D0)
370+ ret = nv50_display_create(dev);
371+ else
372+ ret = nvd0_display_create(dev);
375373 if (ret)
376− goto vblank_err;
374+ goto disp_create_err;
375+
376+ if (dev->mode_config.num_crtc) {
377+ ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
378+ if (ret)
379+ goto vblank_err;
380+ }
381+
382+ nouveau_backlight_init(dev);
377383 }
378384
379− nouveau_backlight_init(dev);
380385 return 0;
381386
382387 vblank_err:
@@ -395,7 +400,8 @@ nouveau_display_destroy(struct drm_device *dev) · 12 unmodified lines
395400 nouveau_backlight_exit(dev);
396401 drm_vblank_cleanup(dev);
397402
398− disp->dtor(dev);
403+ if (disp->dtor)
404+ disp->dtor(dev);
399405
400406 drm_kms_helper_poll_fini(dev);
401407 drm_mode_config_cleanup(dev);
drivers/gpu/drm/nouveau/nouveau_drm.c+23−16
@@ -63,8 +63,9 @@ MODULE_PARM_DESC(noaccel, "disable kernel/abi16 acceleration"); · 62 unmodified lines
6363 static int nouveau_noaccel = 0;
6464 module_param_named(noaccel, nouveau_noaccel, int, 0400);
6565
66−MODULE_PARM_DESC(modeset, "enable driver");
67−static int nouveau_modeset = -1;
66+MODULE_PARM_DESC(modeset, "enable driver (default: auto, "
67+ "0 = disabled, 1 = enabled, 2 = headless)");
68+int nouveau_modeset = -1;
6869 module_param_named(modeset, nouveau_modeset, int, 0400);
6970
7071 static struct drm_driver driver;
@@ -128,7 +129,8 @@ nouveau_accel_init(struct nouveau_drm *drm) · 57 unmodified lines
128129
129130 /* initialise synchronisation routines */
130131 if (device->card_type < NV_10) ret = nv04_fence_create(drm);
131− else if (device->chipset < 0x84) ret = nv10_fence_create(drm);
132+ else if (device->card_type < NV_50) ret = nv10_fence_create(drm);
133+ else if (device->chipset < 0x84) ret = nv50_fence_create(drm);
132134 else if (device->card_type < NV_C0) ret = nv84_fence_create(drm);
133135 else ret = nvc0_fence_create(drm);
134136 if (ret) {
@@ -363,7 +365,8 @@ nouveau_drm_unload(struct drm_device *dev) · 228 unmodified lines
363365
364366 nouveau_pm_fini(dev);
365367
366− nouveau_display_fini(dev);
368+ if (dev->mode_config.num_crtc)
369+ nouveau_display_fini(dev);
367370 nouveau_display_destroy(dev);
368371
369372 nouveau_irq_fini(dev);
@@ -403,13 +406,15 @@ nouveau_drm_suspend(struct pci_dev *pdev, pm_message_t pm_state) · 33 unmodified lines
403406 pm_state.event == PM_EVENT_PRETHAW)
404407 return 0;
405408
406− NV_INFO(drm, "suspending fbcon...\n");
407− nouveau_fbcon_set_suspend(dev, 1);
409+ if (dev->mode_config.num_crtc) {
410+ NV_INFO(drm, "suspending fbcon...\n");
411+ nouveau_fbcon_set_suspend(dev, 1);
408412
409− NV_INFO(drm, "suspending display...\n");
410− ret = nouveau_display_suspend(dev);
411− if (ret)
412− return ret;
413+ NV_INFO(drm, "suspending display...\n");
414+ ret = nouveau_display_suspend(dev);
415+ if (ret)
416+ return ret;
417+ }
413418
414419 NV_INFO(drm, "evicting buffers...\n");
415420 ttm_bo_evict_mm(&drm->ttm.bdev, TTM_PL_VRAM);
@@ -445,8 +450,10 @@ fail_client: · 29 unmodified lines
445450 nouveau_client_init(&cli->base);
446451 }
447452
448− NV_INFO(drm, "resuming display...\n");
449− nouveau_display_resume(dev);
453+ if (dev->mode_config.num_crtc) {
454+ NV_INFO(drm, "resuming display...\n");
455+ nouveau_display_resume(dev);
456+ }
450457 return ret;
451458 }
452459
@@ -486,8 +493,10 @@ nouveau_drm_resume(struct pci_dev *pdev) · 33 unmodified lines
486493 nouveau_irq_postinstall(dev);
487494 nouveau_pm_resume(dev);
488495
489− NV_INFO(drm, "resuming display...\n");
490− nouveau_display_resume(dev);
496+ if (dev->mode_config.num_crtc) {
497+ NV_INFO(drm, "resuming display...\n");
498+ nouveau_display_resume(dev);
499+ }
491500 return 0;
492501 }
493502
@@ -662,9 +671,7 @@ nouveau_drm_init(void) · 168 unmodified lines
662671 #ifdef CONFIG_VGA_CONSOLE
663672 if (vgacon_text_force())
664673 nouveau_modeset = 0;
665− else
666674 #endif
667− nouveau_modeset = 1;
668675 }
669676
670677 if (!nouveau_modeset)
drivers/gpu/drm/nouveau/nouveau_drm.h+2−0
@@ -141,4 +141,6 @@ int nouveau_drm_resume(struct pci_dev *); · 140 unmodified lines
141141 nv_info((cli), fmt, ##args); \
142142 } while (0)
143143
144+extern int nouveau_modeset;
145+
144146 #endif
drivers/gpu/drm/nouveau/nouveau_irq.c+9−7
@@ -61,13 +61,15 @@ nouveau_irq_handler(DRM_IRQ_ARGS) · 60 unmodified lines
6161
6262 nv_subdev(pmc)->intr(nv_subdev(pmc));
6363
64− if (device->card_type >= NV_D0) {
65− if (nv_rd32(device, 0x000100) & 0x04000000)
66− nvd0_display_intr(dev);
67− } else
68− if (device->card_type >= NV_50) {
69− if (nv_rd32(device, 0x000100) & 0x04000000)
70− nv50_display_intr(dev);
64+ if (dev->mode_config.num_crtc) {
65+ if (device->card_type >= NV_D0) {
66+ if (nv_rd32(device, 0x000100) & 0x04000000)
67+ nvd0_display_intr(dev);
68+ } else
69+ if (device->card_type >= NV_50) {
70+ if (nv_rd32(device, 0x000100) & 0x04000000)
71+ nv50_display_intr(dev);
72+ }
7173 }
7274
7375 return IRQ_HANDLED;
drivers/gpu/drm/nouveau/nv04_dac.c+8−8
@@ -220,7 +220,7 @@ out: · 219 unmodified lines
220220 NVWriteVgaCrtc(dev, 0, NV_CIO_CR_MODE_INDEX, saved_cr_mode);
221221
222222 if (blue == 0x18) {
223− NV_INFO(drm, "Load detected on head A\n");
223+ NV_DEBUG(drm, "Load detected on head A\n");
224224 return connector_status_connected;
225225 }
226226
@@ -338,8 +338,8 @@ nv17_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector) · 111 unmodified lines
338338
339339 if (nv17_dac_sample_load(encoder) &
340340 NV_PRAMDAC_TEST_CONTROL_SENSEB_ALLHI) {
341− NV_INFO(drm, "Load detected on output %c\n",
342− '@' + ffs(dcb->or));
341+ NV_DEBUG(drm, "Load detected on output %c\n",
342+ '@' + ffs(dcb->or));
343343 return connector_status_connected;
344344 } else {
345345 return connector_status_disconnected;
@@ -413,9 +413,9 @@ static void nv04_dac_commit(struct drm_encoder *encoder) · 67 unmodified lines
413413
414414 helper->dpms(encoder, DRM_MODE_DPMS_ON);
415415
416− NV_INFO(drm, "Output %s is running on CRTC %d using output %c\n",
417− drm_get_connector_name(&nouveau_encoder_connector_get(nv_encoder)->base),
418− nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
416+ NV_DEBUG(drm, "Output %s is running on CRTC %d using output %c\n",
417+ drm_get_connector_name(&nouveau_encoder_connector_get(nv_encoder)->base),
418+ nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
419419 }
420420
421421 void nv04_dac_update_dacclk(struct drm_encoder *encoder, bool enable)
@@ -461,8 +461,8 @@ static void nv04_dac_dpms(struct drm_encoder *encoder, int mode) · 39 unmodified lines
461461 return;
462462 nv_encoder->last_dpms = mode;
463463
464− NV_INFO(drm, "Setting dpms mode %d on vga encoder (output %d)\n",
465− mode, nv_encoder->dcb->index);
464+ NV_DEBUG(drm, "Setting dpms mode %d on vga encoder (output %d)\n",
465+ mode, nv_encoder->dcb->index);
466466
467467 nv04_dac_update_dacclk(encoder, mode == DRM_MODE_DPMS_ON);
468468 }
drivers/gpu/drm/nouveau/nv04_dfp.c+7−7
@@ -476,9 +476,9 @@ static void nv04_dfp_commit(struct drm_encoder *encoder) · 475 unmodified lines
476476
477477 helper->dpms(encoder, DRM_MODE_DPMS_ON);
478478
479− NV_INFO(drm, "Output %s is running on CRTC %d using output %c\n",
480− drm_get_connector_name(&nouveau_encoder_connector_get(nv_encoder)->base),
481− nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
479+ NV_DEBUG(drm, "Output %s is running on CRTC %d using output %c\n",
480+ drm_get_connector_name(&nouveau_encoder_connector_get(nv_encoder)->base),
481+ nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
482482 }
483483
484484 static void nv04_dfp_update_backlight(struct drm_encoder *encoder, int mode)
@@ -520,8 +520,8 @@ static void nv04_lvds_dpms(struct drm_encoder *encoder, int mode) · 35 unmodified lines
520520 return;
521521 nv_encoder->last_dpms = mode;
522522
523− NV_INFO(drm, "Setting dpms mode %d on lvds encoder (output %d)\n",
524− mode, nv_encoder->dcb->index);
523+ NV_DEBUG(drm, "Setting dpms mode %d on lvds encoder (output %d)\n",
524+ mode, nv_encoder->dcb->index);
525525
526526 if (was_powersaving && is_powersaving_dpms(mode))
527527 return;
@@ -565,8 +565,8 @@ static void nv04_tmds_dpms(struct drm_encoder *encoder, int mode) · 37 unmodified lines
565565 return;
566566 nv_encoder->last_dpms = mode;
567567
568− NV_INFO(drm, "Setting dpms mode %d on tmds encoder (output %d)\n",
569− mode, nv_encoder->dcb->index);
568+ NV_DEBUG(drm, "Setting dpms mode %d on tmds encoder (output %d)\n",
569+ mode, nv_encoder->dcb->index);
570570
571571 nv04_dfp_update_backlight(encoder, mode);
572572 nv04_dfp_update_fp_control(encoder, mode);
drivers/gpu/drm/nouveau/nv04_tv.c+4−5
@@ -75,8 +75,8 @@ static void nv04_tv_dpms(struct drm_encoder *encoder, int mode) · 74 unmodified lines
7575 struct nv04_mode_state *state = &nv04_display(dev)->mode_reg;
7676 uint8_t crtc1A;
7777
78− NV_INFO(drm, "Setting dpms mode %d on TV encoder (output %d)\n",
79− mode, nv_encoder->dcb->index);
78+ NV_DEBUG(drm, "Setting dpms mode %d on TV encoder (output %d)\n",
79+ mode, nv_encoder->dcb->index);
8080
8181 state->pllsel &= ~(PLLSEL_TV_CRTC1_MASK | PLLSEL_TV_CRTC2_MASK);
8282
@@ -167,9 +167,8 @@ static void nv04_tv_commit(struct drm_encoder *encoder) · 84 unmodified lines
167167
168168 helper->dpms(encoder, DRM_MODE_DPMS_ON);
169169
170− NV_INFO(drm, "Output %s is running on CRTC %d using output %c\n",
171− drm_get_connector_name(&nouveau_encoder_connector_get(nv_encoder)->base), nv_crtc->index,
172− '@' + ffs(nv_encoder->dcb->or));
170+ NV_DEBUG(drm, "Output %s is running on CRTC %d using output %c\n",
171+ drm_get_connector_name(&nouveau_encoder_connector_get(nv_encoder)->base), nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
173172 }
174173
175174 static void nv04_tv_destroy(struct drm_encoder *encoder)
drivers/gpu/drm/radeon/atombios_crtc.c+16−28
@@ -1697,34 +1697,22 @@ static int radeon_atom_pick_pll(struct drm_crtc *crtc) · 1696 unmodified lines
16971697 DRM_ERROR("unable to allocate a PPLL\n");
16981698 return ATOM_PPLL_INVALID;
16991699 } else {
1700− if (ASIC_IS_AVIVO(rdev)) {
1701− /* in DP mode, the DP ref clock can come from either PPLL
1702− * depending on the asic:
1703− * DCE3: PPLL1 or PPLL2
1704− */
1705− if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(radeon_crtc->encoder))) {
1706− /* use the same PPLL for all DP monitors */
1707− pll = radeon_get_shared_dp_ppll(crtc);
1708− if (pll != ATOM_PPLL_INVALID)
1709− return pll;
1710− } else {
1711− /* use the same PPLL for all monitors with the same clock */
1712− pll = radeon_get_shared_nondp_ppll(crtc);
1713− if (pll != ATOM_PPLL_INVALID)
1714− return pll;
1715− }
1716− /* all other cases */
1717− pll_in_use = radeon_get_pll_use_mask(crtc);
1718− if (!(pll_in_use & (1 << ATOM_PPLL1)))
1719− return ATOM_PPLL1;
1720− if (!(pll_in_use & (1 << ATOM_PPLL2)))
1721− return ATOM_PPLL2;
1722− DRM_ERROR("unable to allocate a PPLL\n");
1723− return ATOM_PPLL_INVALID;
1724− } else {
1725− /* on pre-R5xx asics, the crtc to pll mapping is hardcoded */
1726− return radeon_crtc->crtc_id;
1727− }
1700+ /* on pre-R5xx asics, the crtc to pll mapping is hardcoded */
1701+ /* some atombios (observed in some DCE2/DCE3) code have a bug,
1702+ * the matching btw pll and crtc is done through
1703+ * PCLK_CRTC[1|2]_CNTL (0x480/0x484) but atombios code use the
1704+ * pll (1 or 2) to select which register to write. ie if using
1705+ * pll1 it will use PCLK_CRTC1_CNTL (0x480) and if using pll2
1706+ * it will use PCLK_CRTC2_CNTL (0x484), it then use crtc id to
1707+ * choose which value to write. Which is reverse order from
1708+ * register logic. So only case that works is when pllid is
1709+ * same as crtcid or when both pll and crtc are enabled and
1710+ * both use same clock.
1711+ *
1712+ * So just return crtc id as if crtc and pll were hard linked
1713+ * together even if they aren't
1714+ */
1715+ return radeon_crtc->crtc_id;
17281716 }
17291717 }
17301718
drivers/gpu/drm/radeon/atombios_encoders.c+5−2
@@ -184,6 +184,7 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder, · 183 unmodified lines
184184 struct radeon_backlight_privdata *pdata;
185185 struct radeon_encoder_atom_dig *dig;
186186 u8 backlight_level;
187+ char bl_name[16];
187188
188189 if (!radeon_encoder->enc_priv)
189190 return;
@@ -203,7 +204,9 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder, · 13 unmodified lines
203204 memset(&props, 0, sizeof(props));
204205 props.max_brightness = RADEON_MAX_BL_LEVEL;
205206 props.type = BACKLIGHT_RAW;
206− bd = backlight_device_register("radeon_bl", &drm_connector->kdev,
207+ snprintf(bl_name, sizeof(bl_name),
208+ "radeon_bl%d", dev->primary->index);
209+ bd = backlight_device_register(bl_name, &drm_connector->kdev,
207210 pdata, &radeon_atom_backlight_ops, &props);
208211 if (IS_ERR(bd)) {
209212 DRM_ERROR("Backlight registration failed\n");
@@ -1622,7 +1625,7 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode) · 1412 unmodified lines
16221625 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP, 0, 0);
16231626 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);
16241627 /* some early dce3.2 boards have a bug in their transmitter control table */
1625− if ((rdev->family != CHIP_RV710) || (rdev->family != CHIP_RV730))
1628+ if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730))
16261629 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0);
16271630 }
16281631 if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) {
drivers/gpu/drm/radeon/evergreen.c+3−1
@@ -1330,6 +1330,8 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav · 1329 unmodified lines
13301330 break;
13311331 udelay(1);
13321332 }
1333+ } else {
1334+ save->crtc_enabled[i] = false;
13331335 }
13341336 }
13351337
@@ -1372,7 +1374,7 @@ void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *s · 36 unmodified lines
13721374 WREG32(BIF_FB_EN, FB_READ_EN | FB_WRITE_EN);
13731375
13741376 for (i = 0; i < rdev->num_crtc; i++) {
1375− if (save->crtc_enabled) {
1377+ if (save->crtc_enabled[i]) {
13761378 if (ASIC_IS_DCE6(rdev)) {
13771379 tmp = RREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i]);
13781380 tmp |= EVERGREEN_CRTC_BLANK_DATA_EN;
drivers/gpu/drm/radeon/evergreen_cs.c+5−1
@@ -264,7 +264,7 @@ static int evergreen_surface_check_2d(struct radeon_cs_parser *p, · 263 unmodified lines
264264 /* macro tile width & height */
265265 palign = (8 * surf->bankw * track->npipes) * surf->mtilea;
266266 halign = (8 * surf->bankh * surf->nbanks) / surf->mtilea;
267− mtileb = (palign / 8) * (halign / 8) * tileb;;
267+ mtileb = (palign / 8) * (halign / 8) * tileb;
268268 mtile_pr = surf->nbx / palign;
269269 mtile_ps = (mtile_pr * surf->nby) / halign;
270270 surf->layer_size = mtile_ps * mtileb * slice_pt;
@@ -2725,6 +2725,9 @@ static bool evergreen_vm_reg_valid(u32 reg) · 2454 unmodified lines
27252725 /* check config regs */
27262726 switch (reg) {
27272727 case GRBM_GFX_INDEX:
2728+ case CP_STRMOUT_CNTL:
2729+ case CP_COHER_CNTL:
2730+ case CP_COHER_SIZE:
27282731 case VGT_VTX_VECT_EJECT_REG:
27292732 case VGT_CACHE_INVALIDATION:
27302733 case VGT_GS_VERTEX_REUSE:
@@ -2829,6 +2832,7 @@ static bool evergreen_vm_reg_valid(u32 reg) · 98 unmodified lines
28292832 case CAYMAN_SQ_EX_ALLOC_TABLE_SLOTS:
28302833 return true;
28312834 default:
2835+ DRM_ERROR("Invalid register 0x%x in CS\n", reg);
28322836 return false;
28332837 }
28342838 }
drivers/gpu/drm/radeon/evergreend.h+4−0
@@ -91,6 +91,10 @@ · 90 unmodified lines
9191 #define FB_READ_EN (1 << 0)
9292 #define FB_WRITE_EN (1 << 1)
9393
94+#define CP_STRMOUT_CNTL 0x84FC
95+
96+#define CP_COHER_CNTL 0x85F0
97+#define CP_COHER_SIZE 0x85F4
9498 #define CP_COHER_BASE 0x85F8
9599 #define CP_STALLED_STAT1 0x8674
96100 #define CP_STALLED_STAT2 0x8678
drivers/gpu/drm/radeon/ni.c+27−18
@@ -1538,26 +1538,31 @@ void cayman_vm_set_page(struct radeon_device *rdev, uint64_t pe, · 1537 unmodified lines
15381538 {
15391539 struct radeon_ring *ring = &rdev->ring[rdev->asic->vm.pt_ring_index];
15401540 uint32_t r600_flags = cayman_vm_page_flags(rdev, flags);
1541− int i;
15421541
1543− radeon_ring_write(ring, PACKET3(PACKET3_ME_WRITE, 1 + count * 2));
1544− radeon_ring_write(ring, pe);
1545− radeon_ring_write(ring, upper_32_bits(pe) & 0xff);
1546− for (i = 0; i < count; ++i) {
1547− uint64_t value = 0;
1548− if (flags & RADEON_VM_PAGE_SYSTEM) {
1549− value = radeon_vm_map_gart(rdev, addr);
1550− value &= 0xFFFFFFFFFFFFF000ULL;
1551− addr += incr;
1552−
1553− } else if (flags & RADEON_VM_PAGE_VALID) {
1554− value = addr;
1555− addr += incr;
1556− }
1542+ while (count) {
1543+ unsigned ndw = 1 + count * 2;
1544+ if (ndw > 0x3FFF)
1545+ ndw = 0x3FFF;
1546+
1547+ radeon_ring_write(ring, PACKET3(PACKET3_ME_WRITE, ndw));
1548+ radeon_ring_write(ring, pe);
1549+ radeon_ring_write(ring, upper_32_bits(pe) & 0xff);
1550+ for (; ndw > 1; ndw -= 2, --count, pe += 8) {
1551+ uint64_t value = 0;
1552+ if (flags & RADEON_VM_PAGE_SYSTEM) {
1553+ value = radeon_vm_map_gart(rdev, addr);
1554+ value &= 0xFFFFFFFFFFFFF000ULL;
1555+ addr += incr;
1556+
1557+ } else if (flags & RADEON_VM_PAGE_VALID) {
1558+ value = addr;
1559+ addr += incr;
1560+ }
15571561
1558− value |= r600_flags;
1559− radeon_ring_write(ring, value);
1560− radeon_ring_write(ring, upper_32_bits(value));
1562+ value |= r600_flags;
1563+ radeon_ring_write(ring, value);
1564+ radeon_ring_write(ring, upper_32_bits(value));
1565+ }
15611566 }
15621567 }
15631568
@@ -1586,4 +1591,8 @@ void cayman_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm) · 22 unmodified lines
15861591 /* bits 0-7 are the VM contexts0-7 */
15871592 radeon_ring_write(ring, PACKET0(VM_INVALIDATE_REQUEST, 0));
15881593 radeon_ring_write(ring, 1 << vm->id);
1594+
1595+ /* sync PFP to ME, otherwise we might get invalid PFP reads */
1596+ radeon_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0));
1597+ radeon_ring_write(ring, 0x0);
15891598 }
drivers/gpu/drm/radeon/nid.h+1−0
@@ -502,6 +502,7 @@ · 501 unmodified lines
502502 #define PACKET3_MPEG_INDEX 0x3A
503503 #define PACKET3_WAIT_REG_MEM 0x3C
504504 #define PACKET3_MEM_WRITE 0x3D
505+#define PACKET3_PFP_SYNC_ME 0x42
505506 #define PACKET3_SURFACE_SYNC 0x43
506507 # define PACKET3_CB0_DEST_BASE_ENA (1 << 6)
507508 # define PACKET3_CB1_DEST_BASE_ENA (1 << 7)
drivers/gpu/drm/radeon/radeon_agp.c+4−1
@@ -69,9 +69,12 @@ static struct radeon_agpmode_quirk radeon_agpmode_quirk_list[] = { · 68 unmodified lines
6969 /* Intel 82830 830 Chipset Host Bridge / Mobility M6 LY Needs AGPMode 2 (fdo #17360)*/
7070 { PCI_VENDOR_ID_INTEL, 0x3575, PCI_VENDOR_ID_ATI, 0x4c59,
7171 PCI_VENDOR_ID_DELL, 0x00e3, 2},
72− /* Intel 82852/82855 host bridge / Mobility FireGL 9000 R250 Needs AGPMode 1 (lp #296617) */
72+ /* Intel 82852/82855 host bridge / Mobility FireGL 9000 RV250 Needs AGPMode 1 (lp #296617) */
7373 { PCI_VENDOR_ID_INTEL, 0x3580, PCI_VENDOR_ID_ATI, 0x4c66,
7474 PCI_VENDOR_ID_DELL, 0x0149, 1},
75+ /* Intel 82855PM host bridge / Mobility FireGL 9000 RV250 Needs AGPMode 1 for suspend/resume */
76+ { PCI_VENDOR_ID_INTEL, 0x3340, PCI_VENDOR_ID_ATI, 0x4c66,
77+ PCI_VENDOR_ID_IBM, 0x0531, 1},
7578 /* Intel 82852/82855 host bridge / Mobility 9600 M10 RV350 Needs AGPMode 1 (deb #467460) */
7679 { PCI_VENDOR_ID_INTEL, 0x3580, PCI_VENDOR_ID_ATI, 0x4e50,
7780 0x1025, 0x0061, 1},
drivers/gpu/drm/radeon/radeon_atpx_handler.c+5−5
@@ -87,7 +87,7 @@ static union acpi_object *radeon_atpx_call(acpi_handle handle, int function, · 86 unmodified lines
8787 atpx_arg_elements[1].integer.value = 0;
8888 }
8989
90− status = acpi_evaluate_object(handle, "ATPX", &atpx_arg, &buffer);
90+ status = acpi_evaluate_object(handle, NULL, &atpx_arg, &buffer);
9191
9292 /* Fail only if calling the method fails and ATPX is supported */
9393 if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
@@ -352,9 +352,9 @@ static int radeon_atpx_switchto(enum vga_switcheroo_client_id id) · 258 unmodified lines
352352 }
353353
354354 /**
355− * radeon_atpx_switchto - switch to the requested GPU
355+ * radeon_atpx_power_state - power down/up the requested GPU
356356 *
357− * @id: GPU to switch to
357+ * @id: GPU to power down/up
358358 * @state: requested power state (0 = off, 1 = on)
359359 *
360360 * Execute the necessary ATPX function to power down/up the discrete GPU
@@ -373,11 +373,11 @@ static int radeon_atpx_power_state(enum vga_switcheroo_client_id id, · 12 unmodified lines
373373 }
374374
375375 /**
376− * radeon_atpx_pci_probe_handle - look up the ATRM and ATPX handles
376+ * radeon_atpx_pci_probe_handle - look up the ATPX handle
377377 *
378378 * @pdev: pci device
379379 *
380− * Look up the ATPX and ATRM handles (all asics).
380+ * Look up the ATPX handles (all asics).
381381 * Returns true if the handles are found, false if not.
382382 */
383383 static bool radeon_atpx_pci_probe_handle(struct pci_dev *pdev)
drivers/gpu/drm/radeon/radeon_connectors.c+21−7
@@ -941,7 +941,7 @@ radeon_dvi_detect(struct drm_connector *connector, bool force) · 940 unmodified lines
941941 struct drm_mode_object *obj;
942942 int i;
943943 enum drm_connector_status ret = connector_status_disconnected;
944− bool dret = false;
944+ bool dret = false, broken_edid = false;
945945
946946 if (!force && radeon_check_hpd_status_unchanged(connector))
947947 return connector->status;
@@ -965,6 +965,9 @@ radeon_dvi_detect(struct drm_connector *connector, bool force) · 17 unmodified lines
965965 ret = connector_status_disconnected;
966966 DRM_ERROR("%s: detected RS690 floating bus bug, stopping ddc detect\n", drm_get_connector_name(connector));
967967 radeon_connector->ddc_bus = NULL;
968+ } else {
969+ ret = connector_status_connected;
970+ broken_edid = true; /* defer use_digital to later */
968971 }
969972 } else {
970973 radeon_connector->use_digital = !!(radeon_connector->edid->input & DRM_EDID_INPUT_DIGITAL);
@@ -1047,13 +1050,24 @@ radeon_dvi_detect(struct drm_connector *connector, bool force) · 76 unmodified lines
10471050
10481051 encoder_funcs = encoder->helper_private;
10491052 if (encoder_funcs->detect) {
1050− if (ret != connector_status_connected) {
1051− ret = encoder_funcs->detect(encoder, connector);
1052− if (ret == connector_status_connected) {
1053− radeon_connector->use_digital = false;
1053+ if (!broken_edid) {
1054+ if (ret != connector_status_connected) {
1055+ /* deal with analog monitors without DDC */
1056+ ret = encoder_funcs->detect(encoder, connector);
1057+ if (ret == connector_status_connected) {
1058+ radeon_connector->use_digital = false;
1059+ }
1060+ if (ret != connector_status_disconnected)
1061+ radeon_connector->detected_by_load = true;
10541062 }
1055− if (ret != connector_status_disconnected)
1056− radeon_connector->detected_by_load = true;
1063+ } else {
1064+ enum drm_connector_status lret;
1065+ /* assume digital unless load detected otherwise */
1066+ radeon_connector->use_digital = true;
1067+ lret = encoder_funcs->detect(encoder, connector);
1068+ DRM_DEBUG_KMS("load_detect %x returned: %x\n",encoder->encoder_type,lret);
1069+ if (lret == connector_status_connected)
1070+ radeon_connector->use_digital = false;
10571071 }
10581072 break;
10591073 }
drivers/gpu/drm/radeon/radeon_device.c+24−36
@@ -355,6 +355,8 @@ int radeon_wb_init(struct radeon_device *rdev) · 354 unmodified lines
355355 */
356356 void radeon_vram_location(struct radeon_device *rdev, struct radeon_mc *mc, u64 base)
357357 {
358+ uint64_t limit = (uint64_t)radeon_vram_limit << 20;
359+
358360 mc->vram_start = base;
359361 if (mc->mc_vram_size > (0xFFFFFFFF - base + 1)) {
360362 dev_warn(rdev->dev, "limiting VRAM to PCI aperture size\n");
@@ -368,8 +370,8 @@ void radeon_vram_location(struct radeon_device *rdev, struct radeon_mc *mc, u64 · 7 unmodified lines
368370 mc->mc_vram_size = mc->aper_size;
369371 }
370372 mc->vram_end = mc->vram_start + mc->mc_vram_size - 1;
371− if (radeon_vram_limit && radeon_vram_limit < mc->real_vram_size)
372− mc->real_vram_size = radeon_vram_limit;
373+ if (limit && limit < mc->real_vram_size)
374+ mc->real_vram_size = limit;
373375 dev_info(rdev->dev, "VRAM: %lluM 0x%016llX - 0x%016llX (%lluM used)\n",
374376 mc->mc_vram_size >> 20, mc->vram_start,
375377 mc->vram_end, mc->real_vram_size >> 20);
@@ -834,6 +836,19 @@ static unsigned int radeon_vga_set_decode(void *cookie, bool state) · 458 unmodified lines
834836 return VGA_RSRC_NORMAL_IO | VGA_RSRC_NORMAL_MEM;
835837 }
836838
839+/**
840+ * radeon_check_pot_argument - check that argument is a power of two
841+ *
842+ * @arg: value to check
843+ *
844+ * Validates that a certain argument is a power of two (all asics).
845+ * Returns true if argument is valid.
846+ */
847+static bool radeon_check_pot_argument(int arg)
848+{
849+ return (arg & (arg - 1)) == 0;
850+}
851+
837852 /**
838853 * radeon_check_arguments - validate module params
839854 *
@@ -845,52 +860,25 @@ static unsigned int radeon_vga_set_decode(void *cookie, bool state) · 5 unmodified lines
845860 static void radeon_check_arguments(struct radeon_device *rdev)
846861 {
847862 /* vramlimit must be a power of two */
848− switch (radeon_vram_limit) {
849− case 0:
850− case 4:
851− case 8:
852− case 16:
853− case 32:
854− case 64:
855− case 128:
856− case 256:
857− case 512:
858− case 1024:
859− case 2048:
860− case 4096:
861− break;
862− default:
863+ if (!radeon_check_pot_argument(radeon_vram_limit)) {
863864 dev_warn(rdev->dev, "vram limit (%d) must be a power of 2\n",
864865 radeon_vram_limit);
865866 radeon_vram_limit = 0;
866− break;
867867 }
868− radeon_vram_limit = radeon_vram_limit << 20;
868+
869869 /* gtt size must be power of two and greater or equal to 32M */
870− switch (radeon_gart_size) {
871− case 4:
872− case 8:
873− case 16:
870+ if (radeon_gart_size < 32) {
874871 dev_warn(rdev->dev, "gart size (%d) too small forcing to 512M\n",
875872 radeon_gart_size);
876873 radeon_gart_size = 512;
877− break;
878− case 32:
879− case 64:
880− case 128:
881− case 256:
882− case 512:
883− case 1024:
884− case 2048:
885− case 4096:
886− break;
887− default:
874+
875+ } else if (!radeon_check_pot_argument(radeon_gart_size)) {
888876 dev_warn(rdev->dev, "gart size (%d) must be a power of 2\n",
889877 radeon_gart_size);
890878 radeon_gart_size = 512;
891− break;
892879 }
893− rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024;
880+ rdev->mc.gtt_size = (uint64_t)radeon_gart_size << 20;
881+
894882 /* AGP mode can only be -1, 1, 2, 4, 8 */
895883 switch (radeon_agpmode) {
896884 case -1:
drivers/gpu/drm/radeon/radeon_gart.c+10−12
@@ -355,14 +355,13 @@ int radeon_gart_init(struct radeon_device *rdev) · 354 unmodified lines
355355 DRM_INFO("GART: num cpu pages %u, num gpu pages %u\n",
356356 rdev->gart.num_cpu_pages, rdev->gart.num_gpu_pages);
357357 /* Allocate pages table */
358− rdev->gart.pages = kzalloc(sizeof(void *) * rdev->gart.num_cpu_pages,
359− GFP_KERNEL);
358+ rdev->gart.pages = vzalloc(sizeof(void *) * rdev->gart.num_cpu_pages);
360359 if (rdev->gart.pages == NULL) {
361360 radeon_gart_fini(rdev);
362361 return -ENOMEM;
363362 }
364− rdev->gart.pages_addr = kzalloc(sizeof(dma_addr_t) *
365− rdev->gart.num_cpu_pages, GFP_KERNEL);
363+ rdev->gart.pages_addr = vzalloc(sizeof(dma_addr_t) *
364+ rdev->gart.num_cpu_pages);
366365 if (rdev->gart.pages_addr == NULL) {
367366 radeon_gart_fini(rdev);
368367 return -ENOMEM;
@@ -388,8 +387,8 @@ void radeon_gart_fini(struct radeon_device *rdev) · 19 unmodified lines
388387 radeon_gart_unbind(rdev, 0, rdev->gart.num_cpu_pages);
389388 }
390389 rdev->gart.ready = false;
391− kfree(rdev->gart.pages);
392− kfree(rdev->gart.pages_addr);
390+ vfree(rdev->gart.pages);
391+ vfree(rdev->gart.pages_addr);
393392 rdev->gart.pages = NULL;
394393 rdev->gart.pages_addr = NULL;
395394
@@ -577,7 +576,7 @@ void radeon_vm_manager_fini(struct radeon_device *rdev) · 181 unmodified lines
577576 *
578577 * Global and local mutex must be locked!
579578 */
580−int radeon_vm_evict(struct radeon_device *rdev, struct radeon_vm *vm)
579+static int radeon_vm_evict(struct radeon_device *rdev, struct radeon_vm *vm)
581580 {
582581 struct radeon_vm *vm_evict;
583582
@@ -1036,8 +1035,7 @@ static void radeon_vm_update_ptes(struct radeon_device *rdev, · 452 unmodified lines
10361035 pte = radeon_sa_bo_gpu_addr(vm->page_tables[pt_idx]);
10371036 pte += (addr & mask) * 8;
10381037
1039− if (((last_pte + 8 * count) != pte) ||
1040− ((count + nptes) > 1 << 11)) {
1038+ if ((last_pte + 8 * count) != pte) {
10411039
10421040 if (count) {
10431041 radeon_asic_vm_set_page(rdev, last_pte,
@@ -1148,17 +1146,17 @@ int radeon_vm_bo_update_pte(struct radeon_device *rdev, · 104 unmodified lines
11481146
11491147 if (RADEON_VM_BLOCK_SIZE > 11)
11501148 /* reserve space for one header for every 2k dwords */
1151− ndw += (nptes >> 11) * 3;
1149+ ndw += (nptes >> 11) * 4;
11521150 else
11531151 /* reserve space for one header for
11541152 every (1 << BLOCK_SIZE) entries */
1155− ndw += (nptes >> RADEON_VM_BLOCK_SIZE) * 3;
1153+ ndw += (nptes >> RADEON_VM_BLOCK_SIZE) * 4;
11561154
11571155 /* reserve space for pte addresses */
11581156 ndw += nptes * 2;
11591157
11601158 /* reserve space for one header for every 2k dwords */
1161− ndw += (npdes >> 11) * 3;
1159+ ndw += (npdes >> 11) * 4;
11621160
11631161 /* reserve space for pde addresses */
11641162 ndw += npdes * 2;
drivers/gpu/drm/radeon/radeon_gem.c+17−1
@@ -53,6 +53,7 @@ int radeon_gem_object_create(struct radeon_device *rdev, int size, · 52 unmodified lines
5353 struct drm_gem_object **obj)
5454 {
5555 struct radeon_bo *robj;
56+ unsigned long max_size;
5657 int r;
5758
5859 *obj = NULL;
@@ -60,11 +61,26 @@ int radeon_gem_object_create(struct radeon_device *rdev, int size, · 1 unmodified line
6061 if (alignment < PAGE_SIZE) {
6162 alignment = PAGE_SIZE;
6263 }
64+
65+ /* maximun bo size is the minimun btw visible vram and gtt size */
66+ max_size = min(rdev->mc.visible_vram_size, rdev->mc.gtt_size);
67+ if (size > max_size) {
68+ printk(KERN_WARNING "%s:%d alloc size %dMb bigger than %ldMb limit\n",
69+ __func__, __LINE__, size >> 20, max_size >> 20);
70+ return -ENOMEM;
71+ }
72+
73+retry:
6374 r = radeon_bo_create(rdev, size, alignment, kernel, initial_domain, NULL, &robj);
6475 if (r) {
65− if (r != -ERESTARTSYS)
76+ if (r != -ERESTARTSYS) {
77+ if (initial_domain == RADEON_GEM_DOMAIN_VRAM) {
78+ initial_domain |= RADEON_GEM_DOMAIN_GTT;
79+ goto retry;
80+ }
6681 DRM_ERROR("Failed to allocate GEM object (%d, %d, %u, %d)\n",
6782 size, initial_domain, alignment, r);
83+ }
6884 return r;
6985 }
7086 *obj = &robj->gem_base;
drivers/gpu/drm/radeon/radeon_legacy_crtc.c+13−2
@@ -295,6 +295,7 @@ static void radeon_crtc_dpms(struct drm_crtc *crtc, int mode) · 294 unmodified lines
295295 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
296296 struct drm_device *dev = crtc->dev;
297297 struct radeon_device *rdev = dev->dev_private;
298+ uint32_t crtc_ext_cntl = 0;
298299 uint32_t mask;
299300
300301 if (radeon_crtc->crtc_id)
@@ -307,6 +308,16 @@ static void radeon_crtc_dpms(struct drm_crtc *crtc, int mode) · 6 unmodified lines
307308 RADEON_CRTC_VSYNC_DIS |
308309 RADEON_CRTC_HSYNC_DIS);
309310
311+ /*
312+ * On all dual CRTC GPUs this bit controls the CRTC of the primary DAC.
313+ * Therefore it is set in the DAC DMPS function.
314+ * This is different for GPU's with a single CRTC but a primary and a
315+ * TV DAC: here it controls the single CRTC no matter where it is
316+ * routed. Therefore we set it here.
317+ */
318+ if (rdev->flags & RADEON_SINGLE_CRTC)
319+ crtc_ext_cntl = RADEON_CRTC_CRT_ON;
320+
310321 switch (mode) {
311322 case DRM_MODE_DPMS_ON:
312323 radeon_crtc->enabled = true;
@@ -317,7 +328,7 @@ static void radeon_crtc_dpms(struct drm_crtc *crtc, int mode) · 4 unmodified lines
317328 else {
318329 WREG32_P(RADEON_CRTC_GEN_CNTL, RADEON_CRTC_EN, ~(RADEON_CRTC_EN |
319330 RADEON_CRTC_DISP_REQ_EN_B));
320− WREG32_P(RADEON_CRTC_EXT_CNTL, 0, ~mask);
331+ WREG32_P(RADEON_CRTC_EXT_CNTL, crtc_ext_cntl, ~(mask | crtc_ext_cntl));
321332 }
322333 drm_vblank_post_modeset(dev, radeon_crtc->crtc_id);
323334 radeon_crtc_load_lut(crtc);
@@ -331,7 +342,7 @@ static void radeon_crtc_dpms(struct drm_crtc *crtc, int mode) · 7 unmodified lines
331342 else {
332343 WREG32_P(RADEON_CRTC_GEN_CNTL, RADEON_CRTC_DISP_REQ_EN_B, ~(RADEON_CRTC_EN |
333344 RADEON_CRTC_DISP_REQ_EN_B));
334− WREG32_P(RADEON_CRTC_EXT_CNTL, mask, ~mask);
345+ WREG32_P(RADEON_CRTC_EXT_CNTL, mask, ~(mask | crtc_ext_cntl));
335346 }
336347 radeon_crtc->enabled = false;
337348 /* adjust pm to dpms changes AFTER disabling crtcs */
drivers/gpu/drm/radeon/radeon_legacy_encoders.c+151−29
@@ -370,6 +370,7 @@ void radeon_legacy_backlight_init(struct radeon_encoder *radeon_encoder, · 369 unmodified lines
370370 struct backlight_properties props;
371371 struct radeon_backlight_privdata *pdata;
372372 uint8_t backlight_level;
373+ char bl_name[16];
373374
374375 if (!radeon_encoder->enc_priv)
375376 return;
@@ -389,7 +390,9 @@ void radeon_legacy_backlight_init(struct radeon_encoder *radeon_encoder, · 13 unmodified lines
389390 memset(&props, 0, sizeof(props));
390391 props.max_brightness = RADEON_MAX_BL_LEVEL;
391392 props.type = BACKLIGHT_RAW;
392− bd = backlight_device_register("radeon_bl", &drm_connector->kdev,
393+ snprintf(bl_name, sizeof(bl_name),
394+ "radeon_bl%d", dev->primary->index);
395+ bd = backlight_device_register(bl_name, &drm_connector->kdev,
393396 pdata, &radeon_backlight_ops, &props);
394397 if (IS_ERR(bd)) {
395398 DRM_ERROR("Backlight registration failed\n");
@@ -534,7 +537,9 @@ static void radeon_legacy_primary_dac_dpms(struct drm_encoder *encoder, int mode · 138 unmodified lines
534537 break;
535538 }
536539
537− WREG32(RADEON_CRTC_EXT_CNTL, crtc_ext_cntl);
540+ /* handled in radeon_crtc_dpms() */
541+ if (!(rdev->flags & RADEON_SINGLE_CRTC))
542+ WREG32(RADEON_CRTC_EXT_CNTL, crtc_ext_cntl);
538543 WREG32(RADEON_DAC_CNTL, dac_cntl);
539544 WREG32(RADEON_DAC_MACRO_CNTL, dac_macro_cntl);
540545
@@ -659,6 +664,8 @@ static enum drm_connector_status radeon_legacy_primary_dac_detect(struct drm_enc · 118 unmodified lines
659664
660665 if (ASIC_IS_R300(rdev))
661666 tmp |= (0x1b6 << RADEON_DAC_FORCE_DATA_SHIFT);
667+ else if (ASIC_IS_RV100(rdev))
668+ tmp |= (0x1ac << RADEON_DAC_FORCE_DATA_SHIFT);
662669 else
663670 tmp |= (0x180 << RADEON_DAC_FORCE_DATA_SHIFT);
664671
@@ -668,6 +675,7 @@ static enum drm_connector_status radeon_legacy_primary_dac_detect(struct drm_enc · 3 unmodified lines
668675 tmp |= RADEON_DAC_RANGE_CNTL_PS2 | RADEON_DAC_CMP_EN;
669676 WREG32(RADEON_DAC_CNTL, tmp);
670677
678+ tmp = dac_macro_cntl;
671679 tmp &= ~(RADEON_DAC_PDWN_R |
672680 RADEON_DAC_PDWN_G |
673681 RADEON_DAC_PDWN_B);
@@ -1089,7 +1097,8 @@ static void radeon_legacy_tv_dac_dpms(struct drm_encoder *encoder, int mode) · 415 unmodified lines
10891097 } else {
10901098 if (is_tv)
10911099 WREG32(RADEON_TV_MASTER_CNTL, tv_master_cntl);
1092− else
1100+ /* handled in radeon_crtc_dpms() */
1101+ else if (!(rdev->flags & RADEON_SINGLE_CRTC))
10931102 WREG32(RADEON_CRTC2_GEN_CNTL, crtc2_gen_cntl);
10941103 WREG32(RADEON_TV_DAC_CNTL, tv_dac_cntl);
10951104 }
@@ -1413,13 +1422,104 @@ static bool radeon_legacy_tv_detect(struct drm_encoder *encoder, · 317 unmodified lines
14131422 return found;
14141423 }
14151424
1425+static bool radeon_legacy_ext_dac_detect(struct drm_encoder *encoder,
1426+ struct drm_connector *connector)
1427+{
1428+ struct drm_device *dev = encoder->dev;
1429+ struct radeon_device *rdev = dev->dev_private;
1430+ uint32_t gpio_monid, fp2_gen_cntl, disp_output_cntl, crtc2_gen_cntl;
1431+ uint32_t disp_lin_trans_grph_a, disp_lin_trans_grph_b, disp_lin_trans_grph_c;
1432+ uint32_t disp_lin_trans_grph_d, disp_lin_trans_grph_e, disp_lin_trans_grph_f;
1433+ uint32_t tmp, crtc2_h_total_disp, crtc2_v_total_disp;
1434+ uint32_t crtc2_h_sync_strt_wid, crtc2_v_sync_strt_wid;
1435+ bool found = false;
1436+ int i;
1437+
1438+ /* save the regs we need */
1439+ gpio_monid = RREG32(RADEON_GPIO_MONID);
1440+ fp2_gen_cntl = RREG32(RADEON_FP2_GEN_CNTL);
1441+ disp_output_cntl = RREG32(RADEON_DISP_OUTPUT_CNTL);
1442+ crtc2_gen_cntl = RREG32(RADEON_CRTC2_GEN_CNTL);
1443+ disp_lin_trans_grph_a = RREG32(RADEON_DISP_LIN_TRANS_GRPH_A);
1444+ disp_lin_trans_grph_b = RREG32(RADEON_DISP_LIN_TRANS_GRPH_B);
1445+ disp_lin_trans_grph_c = RREG32(RADEON_DISP_LIN_TRANS_GRPH_C);
1446+ disp_lin_trans_grph_d = RREG32(RADEON_DISP_LIN_TRANS_GRPH_D);
1447+ disp_lin_trans_grph_e = RREG32(RADEON_DISP_LIN_TRANS_GRPH_E);
1448+ disp_lin_trans_grph_f = RREG32(RADEON_DISP_LIN_TRANS_GRPH_F);
1449+ crtc2_h_total_disp = RREG32(RADEON_CRTC2_H_TOTAL_DISP);
1450+ crtc2_v_total_disp = RREG32(RADEON_CRTC2_V_TOTAL_DISP);
1451+ crtc2_h_sync_strt_wid = RREG32(RADEON_CRTC2_H_SYNC_STRT_WID);
1452+ crtc2_v_sync_strt_wid = RREG32(RADEON_CRTC2_V_SYNC_STRT_WID);
1453+
1454+ tmp = RREG32(RADEON_GPIO_MONID);
1455+ tmp &= ~RADEON_GPIO_A_0;
1456+ WREG32(RADEON_GPIO_MONID, tmp);
1457+
1458+ WREG32(RADEON_FP2_GEN_CNTL, (RADEON_FP2_ON |
1459+ RADEON_FP2_PANEL_FORMAT |
1460+ R200_FP2_SOURCE_SEL_TRANS_UNIT |
1461+ RADEON_FP2_DVO_EN |
1462+ R200_FP2_DVO_RATE_SEL_SDR));
1463+
1464+ WREG32(RADEON_DISP_OUTPUT_CNTL, (RADEON_DISP_DAC_SOURCE_RMX |
1465+ RADEON_DISP_TRANS_MATRIX_GRAPHICS));
1466+
1467+ WREG32(RADEON_CRTC2_GEN_CNTL, (RADEON_CRTC2_EN |
1468+ RADEON_CRTC2_DISP_REQ_EN_B));
1469+
1470+ WREG32(RADEON_DISP_LIN_TRANS_GRPH_A, 0x00000000);
1471+ WREG32(RADEON_DISP_LIN_TRANS_GRPH_B, 0x000003f0);
1472+ WREG32(RADEON_DISP_LIN_TRANS_GRPH_C, 0x00000000);
1473+ WREG32(RADEON_DISP_LIN_TRANS_GRPH_D, 0x000003f0);
1474+ WREG32(RADEON_DISP_LIN_TRANS_GRPH_E, 0x00000000);
1475+ WREG32(RADEON_DISP_LIN_TRANS_GRPH_F, 0x000003f0);
1476+
1477+ WREG32(RADEON_CRTC2_H_TOTAL_DISP, 0x01000008);
1478+ WREG32(RADEON_CRTC2_H_SYNC_STRT_WID, 0x00000800);
1479+ WREG32(RADEON_CRTC2_V_TOTAL_DISP, 0x00080001);
1480+ WREG32(RADEON_CRTC2_V_SYNC_STRT_WID, 0x00000080);
1481+
1482+ for (i = 0; i < 200; i++) {
1483+ tmp = RREG32(RADEON_GPIO_MONID);
1484+ if (tmp & RADEON_GPIO_Y_0)
1485+ found = true;
1486+
1487+ if (found)
1488+ break;
1489+
1490+ if (!drm_can_sleep())
1491+ mdelay(1);
1492+ else
1493+ msleep(1);
1494+ }
1495+
1496+ /* restore the regs we used */
1497+ WREG32(RADEON_DISP_LIN_TRANS_GRPH_A, disp_lin_trans_grph_a);
1498+ WREG32(RADEON_DISP_LIN_TRANS_GRPH_B, disp_lin_trans_grph_b);
1499+ WREG32(RADEON_DISP_LIN_TRANS_GRPH_C, disp_lin_trans_grph_c);
1500+ WREG32(RADEON_DISP_LIN_TRANS_GRPH_D, disp_lin_trans_grph_d);
1501+ WREG32(RADEON_DISP_LIN_TRANS_GRPH_E, disp_lin_trans_grph_e);
1502+ WREG32(RADEON_DISP_LIN_TRANS_GRPH_F, disp_lin_trans_grph_f);
1503+ WREG32(RADEON_CRTC2_H_TOTAL_DISP, crtc2_h_total_disp);
1504+ WREG32(RADEON_CRTC2_V_TOTAL_DISP, crtc2_v_total_disp);
1505+ WREG32(RADEON_CRTC2_H_SYNC_STRT_WID, crtc2_h_sync_strt_wid);
1506+ WREG32(RADEON_CRTC2_V_SYNC_STRT_WID, crtc2_v_sync_strt_wid);
1507+ WREG32(RADEON_CRTC2_GEN_CNTL, crtc2_gen_cntl);
1508+ WREG32(RADEON_DISP_OUTPUT_CNTL, disp_output_cntl);
1509+ WREG32(RADEON_FP2_GEN_CNTL, fp2_gen_cntl);
1510+ WREG32(RADEON_GPIO_MONID, gpio_monid);
1511+
1512+ return found;
1513+}
1514+
14161515 static enum drm_connector_status radeon_legacy_tv_dac_detect(struct drm_encoder *encoder,
14171516 struct drm_connector *connector)
14181517 {
14191518 struct drm_device *dev = encoder->dev;
14201519 struct radeon_device *rdev = dev->dev_private;
1421− uint32_t crtc2_gen_cntl, tv_dac_cntl, dac_cntl2, dac_ext_cntl;
1422− uint32_t disp_hw_debug, disp_output_cntl, gpiopad_a, pixclks_cntl, tmp;
1520+ uint32_t crtc2_gen_cntl = 0, tv_dac_cntl, dac_cntl2, dac_ext_cntl;
1521+ uint32_t gpiopad_a = 0, pixclks_cntl, tmp;
1522+ uint32_t disp_output_cntl = 0, disp_hw_debug = 0, crtc_ext_cntl = 0;
14231523 enum drm_connector_status found = connector_status_disconnected;
14241524 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
14251525 struct radeon_encoder_tv_dac *tv_dac = radeon_encoder->enc_priv;
@@ -1456,12 +1556,27 @@ static enum drm_connector_status radeon_legacy_tv_dac_detect(struct drm_encoder · 30 unmodified lines
14561556 return connector_status_disconnected;
14571557 }
14581558
1559+ /* R200 uses an external DAC for secondary DAC */
1560+ if (rdev->family == CHIP_R200) {
1561+ if (radeon_legacy_ext_dac_detect(encoder, connector))
1562+ found = connector_status_connected;
1563+ return found;
1564+ }
1565+
14591566 /* save the regs we need */
14601567 pixclks_cntl = RREG32_PLL(RADEON_PIXCLKS_CNTL);
1461− gpiopad_a = ASIC_IS_R300(rdev) ? RREG32(RADEON_GPIOPAD_A) : 0;
1462− disp_output_cntl = ASIC_IS_R300(rdev) ? RREG32(RADEON_DISP_OUTPUT_CNTL) : 0;
1463− disp_hw_debug = ASIC_IS_R300(rdev) ? 0 : RREG32(RADEON_DISP_HW_DEBUG);
1464− crtc2_gen_cntl = RREG32(RADEON_CRTC2_GEN_CNTL);
1568+
1569+ if (rdev->flags & RADEON_SINGLE_CRTC) {
1570+ crtc_ext_cntl = RREG32(RADEON_CRTC_EXT_CNTL);
1571+ } else {
1572+ if (ASIC_IS_R300(rdev)) {
1573+ gpiopad_a = RREG32(RADEON_GPIOPAD_A);
1574+ disp_output_cntl = RREG32(RADEON_DISP_OUTPUT_CNTL);
1575+ } else {
1576+ disp_hw_debug = RREG32(RADEON_DISP_HW_DEBUG);
1577+ }
1578+ crtc2_gen_cntl = RREG32(RADEON_CRTC2_GEN_CNTL);
1579+ }
14651580 tv_dac_cntl = RREG32(RADEON_TV_DAC_CNTL);
14661581 dac_ext_cntl = RREG32(RADEON_DAC_EXT_CNTL);
14671582 dac_cntl2 = RREG32(RADEON_DAC_CNTL2);
@@ -1470,22 +1585,24 @@ static enum drm_connector_status radeon_legacy_tv_dac_detect(struct drm_encoder · 2 unmodified lines
14701585 | RADEON_PIX2CLK_DAC_ALWAYS_ONb);
14711586 WREG32_PLL(RADEON_PIXCLKS_CNTL, tmp);
14721587
1473− if (ASIC_IS_R300(rdev))
1474− WREG32_P(RADEON_GPIOPAD_A, 1, ~1);
1475−
1476− tmp = crtc2_gen_cntl & ~RADEON_CRTC2_PIX_WIDTH_MASK;
1477− tmp |= RADEON_CRTC2_CRT2_ON |
1478− (2 << RADEON_CRTC2_PIX_WIDTH_SHIFT);
1479−
1480− WREG32(RADEON_CRTC2_GEN_CNTL, tmp);
1481−
1482− if (ASIC_IS_R300(rdev)) {
1483− tmp = disp_output_cntl & ~RADEON_DISP_TVDAC_SOURCE_MASK;
1484− tmp |= RADEON_DISP_TVDAC_SOURCE_CRTC2;
1485− WREG32(RADEON_DISP_OUTPUT_CNTL, tmp);
1588+ if (rdev->flags & RADEON_SINGLE_CRTC) {
1589+ tmp = crtc_ext_cntl | RADEON_CRTC_CRT_ON;
1590+ WREG32(RADEON_CRTC_EXT_CNTL, tmp);
14861591 } else {
1487− tmp = disp_hw_debug & ~RADEON_CRT2_DISP1_SEL;
1488− WREG32(RADEON_DISP_HW_DEBUG, tmp);
1592+ tmp = crtc2_gen_cntl & ~RADEON_CRTC2_PIX_WIDTH_MASK;
1593+ tmp |= RADEON_CRTC2_CRT2_ON |
1594+ (2 << RADEON_CRTC2_PIX_WIDTH_SHIFT);
1595+ WREG32(RADEON_CRTC2_GEN_CNTL, tmp);
1596+
1597+ if (ASIC_IS_R300(rdev)) {
1598+ WREG32_P(RADEON_GPIOPAD_A, 1, ~1);
1599+ tmp = disp_output_cntl & ~RADEON_DISP_TVDAC_SOURCE_MASK;
1600+ tmp |= RADEON_DISP_TVDAC_SOURCE_CRTC2;
1601+ WREG32(RADEON_DISP_OUTPUT_CNTL, tmp);
1602+ } else {
1603+ tmp = disp_hw_debug & ~RADEON_CRT2_DISP1_SEL;
1604+ WREG32(RADEON_DISP_HW_DEBUG, tmp);
1605+ }
14891606 }
14901607
14911608 tmp = RADEON_TV_DAC_NBLANK |
@@ -1527,14 +1644,19 @@ static enum drm_connector_status radeon_legacy_tv_dac_detect(struct drm_encoder · 35 unmodified lines
15271644 WREG32(RADEON_DAC_CNTL2, dac_cntl2);
15281645 WREG32(RADEON_DAC_EXT_CNTL, dac_ext_cntl);
15291646 WREG32(RADEON_TV_DAC_CNTL, tv_dac_cntl);
1530− WREG32(RADEON_CRTC2_GEN_CNTL, crtc2_gen_cntl);
15311647
1532− if (ASIC_IS_R300(rdev)) {
1533− WREG32(RADEON_DISP_OUTPUT_CNTL, disp_output_cntl);
1534− WREG32_P(RADEON_GPIOPAD_A, gpiopad_a, ~1);
1648+ if (rdev->flags & RADEON_SINGLE_CRTC) {
1649+ WREG32(RADEON_CRTC_EXT_CNTL, crtc_ext_cntl);
15351650 } else {
1536− WREG32(RADEON_DISP_HW_DEBUG, disp_hw_debug);
1651+ WREG32(RADEON_CRTC2_GEN_CNTL, crtc2_gen_cntl);
1652+ if (ASIC_IS_R300(rdev)) {
1653+ WREG32(RADEON_DISP_OUTPUT_CNTL, disp_output_cntl);
1654+ WREG32_P(RADEON_GPIOPAD_A, gpiopad_a, ~1);
1655+ } else {
1656+ WREG32(RADEON_DISP_HW_DEBUG, disp_hw_debug);
1657+ }
15371658 }
1659+
15381660 WREG32_PLL(RADEON_PIXCLKS_CNTL, pixclks_cntl);
15391661
15401662 return found;
drivers/gpu/drm/radeon/radeon_object.c+0−19
@@ -105,7 +105,6 @@ int radeon_bo_create(struct radeon_device *rdev, · 104 unmodified lines
105105 struct radeon_bo *bo;
106106 enum ttm_bo_type type;
107107 unsigned long page_align = roundup(byte_align, PAGE_SIZE) >> PAGE_SHIFT;
108− unsigned long max_size = 0;
109108 size_t acc_size;
110109 int r;
111110
@@ -121,18 +120,9 @@ int radeon_bo_create(struct radeon_device *rdev, · 9 unmodified lines
121120 }
122121 *bo_ptr = NULL;
123122
124− /* maximun bo size is the minimun btw visible vram and gtt size */
125− max_size = min(rdev->mc.visible_vram_size, rdev->mc.gtt_size);
126− if ((page_align << PAGE_SHIFT) >= max_size) {
127− printk(KERN_WARNING "%s:%d alloc size %ldM bigger than %ldMb limit\n",
128− __func__, __LINE__, page_align >> (20 - PAGE_SHIFT), max_size >> 20);
129− return -ENOMEM;
130− }
131−
132123 acc_size = ttm_bo_dma_acc_size(&rdev->mman.bdev, size,
133124 sizeof(struct radeon_bo));
134125
135−retry:
136126 bo = kzalloc(sizeof(struct radeon_bo), GFP_KERNEL);
137127 if (bo == NULL)
138128 return -ENOMEM;
@@ -154,15 +144,6 @@ retry: · 15 unmodified lines
154144 acc_size, sg, &radeon_ttm_bo_destroy);
155145 up_read(&rdev->pm.mclk_lock);
156146 if (unlikely(r != 0)) {
157− if (r != -ERESTARTSYS) {
158− if (domain == RADEON_GEM_DOMAIN_VRAM) {
159− domain |= RADEON_GEM_DOMAIN_GTT;
160− goto retry;
161− }
162− dev_err(rdev->dev,
163− "object_init failed for (%lu, 0x%08X)\n",
164− size, domain);
165− }
166147 return r;
167148 }
168149 *bo_ptr = bo;
drivers/gpu/drm/radeon/si.c+29−19
@@ -2474,6 +2474,7 @@ static bool si_vm_reg_valid(u32 reg) · 2473 unmodified lines
24742474 /* check config regs */
24752475 switch (reg) {
24762476 case GRBM_GFX_INDEX:
2477+ case CP_STRMOUT_CNTL:
24772478 case VGT_VTX_VECT_EJECT_REG:
24782479 case VGT_CACHE_INVALIDATION:
24792480 case VGT_ESGS_RING_SIZE:
@@ -2808,26 +2809,31 @@ void si_vm_set_page(struct radeon_device *rdev, uint64_t pe, · 328 unmodified lines
28082809 {
28092810 struct radeon_ring *ring = &rdev->ring[rdev->asic->vm.pt_ring_index];
28102811 uint32_t r600_flags = cayman_vm_page_flags(rdev, flags);
2811− int i;
2812− uint64_t value;
28132812
2814− radeon_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 2 + count * 2));
2815− radeon_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) |
2816− WRITE_DATA_DST_SEL(1)));
2817− radeon_ring_write(ring, pe);
2818− radeon_ring_write(ring, upper_32_bits(pe));
2819− for (i = 0; i < count; ++i) {
2820− if (flags & RADEON_VM_PAGE_SYSTEM) {
2821− value = radeon_vm_map_gart(rdev, addr);
2822− value &= 0xFFFFFFFFFFFFF000ULL;
2823− } else if (flags & RADEON_VM_PAGE_VALID)
2824− value = addr;
2825− else
2826− value = 0;
2827− addr += incr;
2828− value |= r600_flags;
2829− radeon_ring_write(ring, value);
2830− radeon_ring_write(ring, upper_32_bits(value));
2813+ while (count) {
2814+ unsigned ndw = 2 + count * 2;
2815+ if (ndw > 0x3FFE)
2816+ ndw = 0x3FFE;
2817+
2818+ radeon_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, ndw));
2819+ radeon_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) |
2820+ WRITE_DATA_DST_SEL(1)));
2821+ radeon_ring_write(ring, pe);
2822+ radeon_ring_write(ring, upper_32_bits(pe));
2823+ for (; ndw > 2; ndw -= 2, --count, pe += 8) {
2824+ uint64_t value;
2825+ if (flags & RADEON_VM_PAGE_SYSTEM) {
2826+ value = radeon_vm_map_gart(rdev, addr);
2827+ value &= 0xFFFFFFFFFFFFF000ULL;
2828+ } else if (flags & RADEON_VM_PAGE_VALID)
2829+ value = addr;
2830+ else
2831+ value = 0;
2832+ addr += incr;
2833+ value |= r600_flags;
2834+ radeon_ring_write(ring, value);
2835+ radeon_ring_write(ring, upper_32_bits(value));
2836+ }
28312837 }
28322838 }
28332839
@@ -2868,6 +2874,10 @@ void si_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm) · 34 unmodified lines
28682874 radeon_ring_write(ring, VM_INVALIDATE_REQUEST >> 2);
28692875 radeon_ring_write(ring, 0);
28702876 radeon_ring_write(ring, 1 << vm->id);
2877+
2878+ /* sync PFP to ME, otherwise we might get invalid PFP reads */
2879+ radeon_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0));
2880+ radeon_ring_write(ring, 0x0);
28712881 }
28722882
28732883 /*
drivers/gpu/drm/radeon/sid.h+1−0
@@ -424,6 +424,7 @@ · 423 unmodified lines
424424 # define RDERR_INT_ENABLE (1 << 0)
425425 # define GUI_IDLE_INT_ENABLE (1 << 19)
426426
427+#define CP_STRMOUT_CNTL 0x84FC
427428 #define SCRATCH_REG0 0x8500
428429 #define SCRATCH_REG1 0x8504
429430 #define SCRATCH_REG2 0x8508
drivers/gpu/drm/ttm/ttm_page_alloc.c+4−1
@@ -749,7 +749,10 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, · 748 unmodified lines
749749 /* clear the pages coming from the pool if requested */
750750 if (flags & TTM_PAGE_FLAG_ZERO_ALLOC) {
751751 list_for_each_entry(p, &plist, lru) {
752− clear_page(page_address(p));
752+ if (PageHighMem(p))
753+ clear_highpage(p);
754+ else
755+ clear_page(page_address(p));
753756 }
754757 }
755758
drivers/gpu/drm/ttm/ttm_tt.c+0−4
@@ -308,9 +308,7 @@ int ttm_tt_swapin(struct ttm_tt *ttm) · 307 unmodified lines
308308 if (unlikely(to_page == NULL))
309309 goto out_err;
310310
311− preempt_disable();
312311 copy_highpage(to_page, from_page);
313− preempt_enable();
314312 page_cache_release(from_page);
315313 }
316314
@@ -358,9 +356,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage) · 41 unmodified lines
358356 ret = PTR_ERR(to_page);
359357 goto out_err;
360358 }
361− preempt_disable();
362359 copy_highpage(to_page, from_page);
363− preempt_enable();
364360 set_page_dirty(to_page);
365361 mark_page_accessed(to_page);
366362 page_cache_release(to_page);
drivers/gpu/drm/udl/udl_drv.h+1−1
@@ -104,7 +104,7 @@ udl_fb_user_fb_create(struct drm_device *dev, · 103 unmodified lines
104104
105105 int udl_render_hline(struct drm_device *dev, int bpp, struct urb **urb_ptr,
106106 const char *front, char **urb_buf_ptr,
107− u32 byte_offset, u32 byte_width,
107+ u32 byte_offset, u32 device_byte_offset, u32 byte_width,
108108 int *ident_ptr, int *sent_ptr);
109109
110110 int udl_dumb_create(struct drm_file *file_priv,
drivers/gpu/drm/udl/udl_fb.c+7−5
@@ -114,9 +114,10 @@ static void udlfb_dpy_deferred_io(struct fb_info *info, · 113 unmodified lines
114114 list_for_each_entry(cur, &fbdefio->pagelist, lru) {
115115
116116 if (udl_render_hline(dev, (ufbdev->ufb.base.bits_per_pixel / 8),
117− &urb, (char *) info->fix.smem_start,
118− &cmd, cur->index << PAGE_SHIFT,
119− PAGE_SIZE, &bytes_identical, &bytes_sent))
117+ &urb, (char *) info->fix.smem_start,
118+ &cmd, cur->index << PAGE_SHIFT,
119+ cur->index << PAGE_SHIFT,
120+ PAGE_SIZE, &bytes_identical, &bytes_sent))
120121 goto error;
121122 bytes_rendered += PAGE_SIZE;
122123 }
@@ -187,10 +188,11 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int y, · 64 unmodified lines
187188 for (i = y; i < y + height ; i++) {
188189 const int line_offset = fb->base.pitches[0] * i;
189190 const int byte_offset = line_offset + (x * bpp);
190−
191+ const int dev_byte_offset = (fb->base.width * bpp * i) + (x * bpp);
191192 if (udl_render_hline(dev, bpp, &urb,
192193 (char *) fb->obj->vmapping,
193− &cmd, byte_offset, width * bpp,
194+ &cmd, byte_offset, dev_byte_offset,
195+ width * bpp,
194196 &bytes_identical, &bytes_sent))
195197 goto error;
196198 }
drivers/gpu/drm/udl/udl_transfer.c+3−2
@@ -213,11 +213,12 @@ static void udl_compress_hline16( · 212 unmodified lines
213213 */
214214 int udl_render_hline(struct drm_device *dev, int bpp, struct urb **urb_ptr,
215215 const char *front, char **urb_buf_ptr,
216− u32 byte_offset, u32 byte_width,
216+ u32 byte_offset, u32 device_byte_offset,
217+ u32 byte_width,
217218 int *ident_ptr, int *sent_ptr)
218219 {
219220 const u8 *line_start, *line_end, *next_pixel;
220− u32 base16 = 0 + (byte_offset / bpp) * 2;
221+ u32 base16 = 0 + (device_byte_offset / bpp) * 2;
221222 struct urb *urb = *urb_ptr;
222223 u8 *cmd = *urb_buf_ptr;
223224 u8 *cmd_end = (u8 *) urb->transfer_buffer + urb->transfer_buffer_length;
drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c+1−1
@@ -306,7 +306,7 @@ void vmw_bo_pin(struct ttm_buffer_object *bo, bool pin) · 305 unmodified lines
306306
307307 BUG_ON(!atomic_read(&bo->reserved));
308308 BUG_ON(old_mem_type != TTM_PL_VRAM &&
309− old_mem_type != VMW_PL_FLAG_GMR);
309+ old_mem_type != VMW_PL_GMR);
310310
311311 pl_flags = TTM_PL_FLAG_VRAM | VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED;
312312 if (pin)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c+5−0
@@ -1098,6 +1098,11 @@ static void vmw_pm_complete(struct device *kdev) · 1097 unmodified lines
10981098 struct drm_device *dev = pci_get_drvdata(pdev);
10991099 struct vmw_private *dev_priv = vmw_priv(dev);
11001100
1101+ mutex_lock(&dev_priv->hw_mutex);
1102+ vmw_write(dev_priv, SVGA_REG_ID, SVGA_ID_2);
1103+ (void) vmw_read(dev_priv, SVGA_REG_ID);
1104+ mutex_unlock(&dev_priv->hw_mutex);
1105+
11011106 /**
11021107 * Reclaim 3d reference held by fbdev and potentially
11031108 * start fifo.
drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c+2−0
@@ -110,6 +110,8 @@ int vmw_get_cap_3d_ioctl(struct drm_device *dev, void *data, · 109 unmodified lines
110110 memcpy_fromio(bounce, &fifo_mem[SVGA_FIFO_3D_CAPS], size);
111111
112112 ret = copy_to_user(buffer, bounce, size);
113+ if (ret)
114+ ret = -EFAULT;
113115 vfree(bounce);
114116
115117 if (unlikely(ret != 0))
drivers/hid/hid-apple.c+6−0
@@ -522,6 +522,12 @@ static const struct hid_device_id apple_devices[] = { · 521 unmodified lines
522522 .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
523523 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS),
524524 .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
525+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI),
526+ .driver_data = APPLE_HAS_FN },
527+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO),
528+ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
529+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS),
530+ .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
525531 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI),
526532 .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
527533 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
drivers/hid/hid-core.c+6−0
@@ -1532,6 +1532,9 @@ static const struct hid_device_id hid_have_special_driver[] = { · 1531 unmodified lines
15321532 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI) },
15331533 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO) },
15341534 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS) },
1535+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI) },
1536+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO) },
1537+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS) },
15351538 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) },
15361539 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) },
15371540 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) },
@@ -2139,6 +2142,9 @@ static const struct hid_device_id hid_mouse_ignore_list[] = { · 601 unmodified lines
21392142 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI) },
21402143 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO) },
21412144 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS) },
2145+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI) },
2146+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO) },
2147+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS) },
21422148 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
21432149 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
21442150 { }
drivers/hid/hid-ids.h+3−0
@@ -118,6 +118,9 @@ · 117 unmodified lines
118118 #define USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI 0x0252
119119 #define USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO 0x0253
120120 #define USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS 0x0254
121+#define USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI 0x0259
122+#define USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO 0x025a
123+#define USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS 0x025b
121124 #define USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI 0x0249
122125 #define USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO 0x024a
123126 #define USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS 0x024b
drivers/hid/hid-microsoft.c+13−5
@@ -28,22 +28,30 @@ · 27 unmodified lines
2828 #define MS_RDESC 0x08
2929 #define MS_NOGET 0x10
3030 #define MS_DUPLICATE_USAGES 0x20
31+#define MS_RDESC_3K 0x40
3132
32−/*
33− * Microsoft Wireless Desktop Receiver (Model 1028) has
34− * 'Usage Min/Max' where it ought to have 'Physical Min/Max'
35− */
3633 static __u8 *ms_report_fixup(struct hid_device *hdev, __u8 *rdesc,
3734 unsigned int *rsize)
3835 {
3936 unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);
4037
38+ /*
39+ * Microsoft Wireless Desktop Receiver (Model 1028) has
40+ * 'Usage Min/Max' where it ought to have 'Physical Min/Max'
41+ */
4142 if ((quirks & MS_RDESC) && *rsize == 571 && rdesc[557] == 0x19 &&
4243 rdesc[559] == 0x29) {
4344 hid_info(hdev, "fixing up Microsoft Wireless Receiver Model 1028 report descriptor\n");
4445 rdesc[557] = 0x35;
4546 rdesc[559] = 0x45;
4647 }
48+ /* the same as above (s/usage/physical/) */
49+ if ((quirks & MS_RDESC_3K) && *rsize == 106 && rdesc[94] == 0x19 &&
50+ rdesc[95] == 0x00 && rdesc[96] == 0x29 &&
51+ rdesc[97] == 0xff) {
52+ rdesc[94] = 0x35;
53+ rdesc[96] = 0x45;
54+ }
4755 return rdesc;
4856 }
4957
@@ -192,7 +200,7 @@ static const struct hid_device_id ms_devices[] = { · 142 unmodified lines
192200 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_USB),
193201 .driver_data = MS_PRESENTER },
194202 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K),
195− .driver_data = MS_ERGONOMY },
203+ .driver_data = MS_ERGONOMY | MS_RDESC_3K },
196204 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0),
197205 .driver_data = MS_NOGET },
198206 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_MOUSE_4500),
drivers/hid/hid-multitouch.c+2−3
@@ -210,8 +210,7 @@ static struct mt_class mt_classes[] = { · 209 unmodified lines
210210 },
211211 { .name = MT_CLS_GENERALTOUCH_PWT_TENFINGERS,
212212 .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
213− MT_QUIRK_SLOT_IS_CONTACTNUMBER,
214− .maxcontacts = 10
213+ MT_QUIRK_SLOT_IS_CONTACTNUMBER
215214 },
216215
217216 { .name = MT_CLS_FLATFROG,
@@ -421,11 +420,11 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, · 203 unmodified lines
421420 * contact max are global to the report */
422421 td->last_field_index = field->index;
423422 return -1;
424− }
425423 case HID_DG_TOUCH:
426424 /* Legacy devices use TIPSWITCH and not TOUCH.
427425 * Let's just ignore this field. */
428426 return -1;
427+ }
429428 /* let hid-input decide for the others */
430429 return 0;
431430
drivers/hid/hidraw.c+43−26
@@ -42,7 +42,6 @@ static struct cdev hidraw_cdev; · 41 unmodified lines
4242 static struct class *hidraw_class;
4343 static struct hidraw *hidraw_table[HIDRAW_MAX_DEVICES];
4444 static DEFINE_MUTEX(minors_lock);
45−static void drop_ref(struct hidraw *hid, int exists_bit);
4645
4746 static ssize_t hidraw_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
4847 {
@@ -114,7 +113,7 @@ static ssize_t hidraw_send_report(struct file *file, const char __user *buffer, · 65 unmodified lines
114113 __u8 *buf;
115114 int ret = 0;
116115
117− if (!hidraw_table[minor] || !hidraw_table[minor]->exist) {
116+ if (!hidraw_table[minor]) {
118117 ret = -ENODEV;
119118 goto out;
120119 }
@@ -262,7 +261,7 @@ static int hidraw_open(struct inode *inode, struct file *file) · 141 unmodified lines
262261 }
263262
264263 mutex_lock(&minors_lock);
265− if (!hidraw_table[minor] || !hidraw_table[minor]->exist) {
264+ if (!hidraw_table[minor]) {
266265 err = -ENODEV;
267266 goto out_unlock;
268267 }
@@ -299,12 +298,36 @@ out: · 30 unmodified lines
299298 static int hidraw_release(struct inode * inode, struct file * file)
300299 {
301300 unsigned int minor = iminor(inode);
301+ struct hidraw *dev;
302302 struct hidraw_list *list = file->private_data;
303+ int ret;
304+ int i;
305+
306+ mutex_lock(&minors_lock);
307+ if (!hidraw_table[minor]) {
308+ ret = -ENODEV;
309+ goto unlock;
310+ }
303311
304− drop_ref(hidraw_table[minor], 0);
305312 list_del(&list->node);
313+ dev = hidraw_table[minor];
314+ if (!--dev->open) {
315+ if (list->hidraw->exist) {
316+ hid_hw_power(dev->hid, PM_HINT_NORMAL);
317+ hid_hw_close(dev->hid);
318+ } else {
319+ kfree(list->hidraw);
320+ }
321+ }
322+
323+ for (i = 0; i < HIDRAW_BUFFER_SIZE; ++i)
324+ kfree(list->buffer[i].value);
306325 kfree(list);
307− return 0;
326+ ret = 0;
327+unlock:
328+ mutex_unlock(&minors_lock);
329+
330+ return ret;
308331 }
309332
310333 static long hidraw_ioctl(struct file *file, unsigned int cmd,
@@ -506,7 +529,21 @@ EXPORT_SYMBOL_GPL(hidraw_connect); · 195 unmodified lines
506529 void hidraw_disconnect(struct hid_device *hid)
507530 {
508531 struct hidraw *hidraw = hid->hidraw;
509− drop_ref(hidraw, 1);
532+
533+ mutex_lock(&minors_lock);
534+ hidraw->exist = 0;
535+
536+ device_destroy(hidraw_class, MKDEV(hidraw_major, hidraw->minor));
537+
538+ hidraw_table[hidraw->minor] = NULL;
539+
540+ if (hidraw->open) {
541+ hid_hw_close(hid);
542+ wake_up_interruptible(&hidraw->wait);
543+ } else {
544+ kfree(hidraw);
545+ }
546+ mutex_unlock(&minors_lock);
510547 }
511548 EXPORT_SYMBOL_GPL(hidraw_disconnect);
512549
@@ -555,23 +592,3 @@ void hidraw_exit(void) · 42 unmodified lines
555592 unregister_chrdev_region(dev_id, HIDRAW_MAX_DEVICES);
556593
557594 }
558−
559−static void drop_ref(struct hidraw *hidraw, int exists_bit)
560−{
561− mutex_lock(&minors_lock);
562− if (exists_bit) {
563− hid_hw_close(hidraw->hid);
564− hidraw->exist = 0;
565− if (hidraw->open)
566− wake_up_interruptible(&hidraw->wait);
567− } else {
568− --hidraw->open;
569− }
570−
571− if (!hidraw->open && !hidraw->exist) {
572− device_destroy(hidraw_class, MKDEV(hidraw_major, hidraw->minor));
573− hidraw_table[hidraw->minor] = NULL;
574− kfree(hidraw);
575− }
576− mutex_unlock(&minors_lock);
577−}
drivers/hv/channel.c+13−11
@@ -146,14 +146,14 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size, · 145 unmodified lines
146146
147147 if (ret != 0) {
148148 err = ret;
149− goto errorout;
149+ goto error0;
150150 }
151151
152152 ret = hv_ringbuffer_init(
153153 &newchannel->inbound, in, recv_ringbuffer_size);
154154 if (ret != 0) {
155155 err = ret;
156− goto errorout;
156+ goto error0;
157157 }
158158
159159
@@ -168,7 +168,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size, · 8 unmodified lines
168168
169169 if (ret != 0) {
170170 err = ret;
171− goto errorout;
171+ goto error0;
172172 }
173173
174174 /* Create and init the channel open message */
@@ -177,7 +177,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size, · 2 unmodified lines
177177 GFP_KERNEL);
178178 if (!open_info) {
179179 err = -ENOMEM;
180− goto errorout;
180+ goto error0;
181181 }
182182
183183 init_completion(&open_info->waitevent);
@@ -193,7 +193,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size, · 9 unmodified lines
193193
194194 if (userdatalen > MAX_USER_DEFINED_BYTES) {
195195 err = -EINVAL;
196− goto errorout;
196+ goto error0;
197197 }
198198
199199 if (userdatalen)
@@ -208,19 +208,18 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size, · 8 unmodified lines
208208 sizeof(struct vmbus_channel_open_channel));
209209
210210 if (ret != 0)
211− goto cleanup;
211+ goto error1;
212212
213213 t = wait_for_completion_timeout(&open_info->waitevent, 5*HZ);
214214 if (t == 0) {
215215 err = -ETIMEDOUT;
216− goto errorout;
216+ goto error1;
217217 }
218218
219219
220220 if (open_info->response.open_result.status)
221221 err = open_info->response.open_result.status;
222222
223−cleanup:
224223 spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
225224 list_del(&open_info->msglistentry);
226225 spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
@@ -228,9 +227,12 @@ cleanup: · 1 unmodified line
228227 kfree(open_info);
229228 return err;
230229
231−errorout:
232− hv_ringbuffer_cleanup(&newchannel->outbound);
233− hv_ringbuffer_cleanup(&newchannel->inbound);
230+error1:
231+ spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
232+ list_del(&open_info->msglistentry);
233+ spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
234+
235+error0:
234236 free_pages((unsigned long)out,
235237 get_order(send_ringbuffer_size + recv_ringbuffer_size));
236238 kfree(open_info);
drivers/hwmon/asb100.c+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232 * ASB100-A supports pwm1, while plain ASB100 does not. There is no known
3333 * way for the driver to tell which one is there.
3434 *
35− * Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA
35+ * Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA
3636 * asb100 7 3 1 4 0x31 0x0694 yes no
3737 */
3838
drivers/hwmon/fam15h_power.c+2−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * fam15h_power.c - AMD Family 15h processor power monitoring
33 *
44 * Copyright (c) 2011 Advanced Micro Devices, Inc.
5− * Author: Andreas Herrmann <andreas.herrmann3@amd.com>
5+ * Author: Andreas Herrmann <herrmann.der.user@googlemail.com>
66 *
77 *
88 * This driver is free software; you can redistribute it and/or
@@ -28,7 +28,7 @@ · 19 unmodified lines
2828 #include <asm/processor.h>
2929
3030 MODULE_DESCRIPTION("AMD Family 15h CPU processor power monitor");
31−MODULE_AUTHOR("Andreas Herrmann <andreas.herrmann3@amd.com>");
31+MODULE_AUTHOR("Andreas Herrmann <herrmann.der.user@googlemail.com>");
3232 MODULE_LICENSE("GPL");
3333
3434 /* D18F3 */
drivers/hwmon/gpio-fan.c+2−0
@@ -630,7 +630,9 @@ static struct platform_driver gpio_fan_driver = { · 629 unmodified lines
630630 .driver = {
631631 .name = "gpio-fan",
632632 .pm = GPIO_FAN_PM,
633+#ifdef CONFIG_OF_GPIO
633634 .of_match_table = of_match_ptr(of_gpio_fan_match),
635+#endif
634636 },
635637 };
636638
drivers/hwmon/w83627ehf.c+1−0
@@ -2083,6 +2083,7 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) · 2082 unmodified lines
20832083 mutex_init(&data->lock);
20842084 mutex_init(&data->update_lock);
20852085 data->name = w83627ehf_device_names[sio_data->kind];
2086+ data->bank = 0xff; /* Force initial bank selection */
20862087 platform_set_drvdata(pdev, data);
20872088
20882089 /* 627EHG and 627EHF have 10 voltage inputs; 627DHG and 667HG have 9 */
drivers/hwmon/w83627hf.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 /*
2626 * Supports following chips:
2727 *
28− * Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA
28+ * Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA
2929 * w83627hf 9 3 2 3 0x20 0x5ca3 no yes(LPC)
3030 * w83627thf 7 3 3 3 0x90 0x5ca3 no yes(LPC)
3131 * w83637hf 7 3 3 3 0x80 0x5ca3 no yes(LPC)
drivers/hwmon/w83781d.c+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
2424 /*
2525 * Supports following chips:
2626 *
27− * Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA
27+ * Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA
2828 * as99127f 7 3 0 3 0x31 0x12c3 yes no
2929 * as99127f rev.2 (type_name = as99127f) 0x31 0x5ca3 yes no
3030 * w83781d 7 3 0 3 0x10-1 0x5ca3 yes yes
drivers/hwmon/w83791d.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 /*
2323 * Supports following chips:
2424 *
25− * Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA
25+ * Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA
2626 * w83791d 10 5 5 3 0x71 0x5ca3 yes no
2727 *
2828 * The w83791d chip appears to be part way between the 83781d and the
drivers/hwmon/w83792d.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 /*
3232 * Supports following chips:
3333 *
34− * Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA
34+ * Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA
3535 * w83792d 9 7 7 3 0x7a 0x5ca3 yes no
3636 */
3737
drivers/hwmon/w83l786ng.c+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 /*
2121 * Supports following chips:
2222 *
23− * Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA
23+ * Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA
2424 * w83l786ng 3 2 2 2 0x7b 0x5ca3 yes no
2525 */
2626
drivers/i2c/Makefile+1−0
@@ -8,6 +8,7 @@ obj-$(CONFIG_I2C_SMBUS) += i2c-smbus.o · 7 unmodified lines
88 obj-$(CONFIG_I2C_CHARDEV) += i2c-dev.o
99 obj-$(CONFIG_I2C_MUX) += i2c-mux.o
1010 obj-y += algos/ busses/ muxes/
11+obj-$(CONFIG_I2C_STUB) += i2c-stub.o
1112
1213 ccflags-$(CONFIG_I2C_DEBUG_CORE) := -DDEBUG
1314 CFLAGS_i2c-core.o := -Wno-deprecated-declarations
drivers/i2c/busses/Kconfig+0−1
@@ -81,7 +81,6 @@ config I2C_I801 · 80 unmodified lines
8181 tristate "Intel 82801 (ICH/PCH)"
8282 depends on PCI
8383 select CHECK_SIGNATURE if X86 && DMI
84− select GPIOLIB if I2C_MUX
8584 help
8685 If you say yes to this option, support will be included for the Intel
8786 801 family of mainboard I2C interfaces. Specifically, the following
drivers/i2c/busses/Makefile+0−1
@@ -85,7 +85,6 @@ obj-$(CONFIG_I2C_ACORN) += i2c-acorn.o · 84 unmodified lines
8585 obj-$(CONFIG_I2C_ELEKTOR) += i2c-elektor.o
8686 obj-$(CONFIG_I2C_PCA_ISA) += i2c-pca-isa.o
8787 obj-$(CONFIG_I2C_SIBYTE) += i2c-sibyte.o
88−obj-$(CONFIG_I2C_STUB) += i2c-stub.o
8988 obj-$(CONFIG_SCx200_ACB) += scx200_acb.o
9089 obj-$(CONFIG_SCx200_I2C) += scx200_i2c.o
9190
drivers/i2c/busses/i2c-at91.c+6−1
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 #define AT91_TWI_STOP 0x0002 /* Send a Stop Condition */
4040 #define AT91_TWI_MSEN 0x0004 /* Master Transfer Enable */
4141 #define AT91_TWI_SVDIS 0x0020 /* Slave Transfer Disable */
42+#define AT91_TWI_QUICK 0x0040 /* SMBus quick command */
4243 #define AT91_TWI_SWRST 0x0080 /* Software Reset */
4344
4445 #define AT91_TWI_MMR 0x0004 /* Master Mode Register */
@@ -212,7 +213,11 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev) · 167 unmodified lines
212213
213214 INIT_COMPLETION(dev->cmd_complete);
214215 dev->transfer_status = 0;
215− if (dev->msg->flags & I2C_M_RD) {
216+
217+ if (!dev->buf_len) {
218+ at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_QUICK);
219+ at91_twi_write(dev, AT91_TWI_IER, AT91_TWI_TXCOMP);
220+ } else if (dev->msg->flags & I2C_M_RD) {
216221 unsigned start_flags = AT91_TWI_START;
217222
218223 if (at91_twi_read(dev, AT91_TWI_SR) & AT91_TWI_RXRDY) {
drivers/i2c/busses/i2c-i801.c+7−4
@@ -82,7 +82,8 @@ · 81 unmodified lines
8282 #include <linux/wait.h>
8383 #include <linux/err.h>
8484
85−#if defined CONFIG_I2C_MUX || defined CONFIG_I2C_MUX_MODULE
85+#if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \
86+ defined CONFIG_DMI
8687 #include <linux/gpio.h>
8788 #include <linux/i2c-mux-gpio.h>
8889 #include <linux/platform_device.h>
@@ -192,7 +193,8 @@ struct i801_priv { · 103 unmodified lines
192193 int len;
193194 u8 *data;
194195
195−#if defined CONFIG_I2C_MUX || defined CONFIG_I2C_MUX_MODULE
196+#if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \
197+ defined CONFIG_DMI
196198 const struct i801_mux_config *mux_drvdata;
197199 struct platform_device *mux_pdev;
198200 #endif
@@ -921,7 +923,8 @@ static void __init input_apanel_init(void) {} · 722 unmodified lines
921923 static void __devinit i801_probe_optional_slaves(struct i801_priv *priv) {}
922924 #endif /* CONFIG_X86 && CONFIG_DMI */
923925
924−#if defined CONFIG_I2C_MUX || defined CONFIG_I2C_MUX_MODULE
926+#if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \
927+ defined CONFIG_DMI
925928 static struct i801_mux_config i801_mux_config_asus_z8_d12 = {
926929 .gpio_chip = "gpio_ich",
927930 .values = { 0x02, 0x03 },
@@ -1059,7 +1062,7 @@ static unsigned int __devinit i801_get_adapter_class(struct i801_priv *priv) · 131 unmodified lines
10591062
10601063 id = dmi_first_match(mux_dmi_table);
10611064 if (id) {
1062− /* Remove from branch classes from trunk */
1065+ /* Remove branch classes from trunk */
10631066 mux_config = id->driver_data;
10641067 for (i = 0; i < mux_config->n_values; i++)
10651068 class &= ~mux_config->classes[i];
drivers/i2c/busses/i2c-mxs.c+16−172
@@ -1,7 +1,7 @@
11 /*
22 * Freescale MXS I2C bus driver
33 *
4− * Copyright (C) 2011 Wolfram Sang, Pengutronix e.K.
4+ * Copyright (C) 2011-2012 Wolfram Sang, Pengutronix e.K.
55 *
66 * based on a (non-working) driver which was:
77 *
@@ -35,10 +35,6 @@ · 27 unmodified lines
3535
3636 #define DRIVER_NAME "mxs-i2c"
3737
38−static bool use_pioqueue;
39−module_param(use_pioqueue, bool, 0);
40−MODULE_PARM_DESC(use_pioqueue, "Use PIOQUEUE mode for transfer instead of DMA");
41−
4238 #define MXS_I2C_CTRL0 (0x00)
4339 #define MXS_I2C_CTRL0_SET (0x04)
4440
@@ -75,23 +71,6 @@ MODULE_PARM_DESC(use_pioqueue, "Use PIOQUEUE mode for transfer instead of DMA"); · 30 unmodified lines
7571 MXS_I2C_CTRL1_SLAVE_STOP_IRQ | \
7672 MXS_I2C_CTRL1_SLAVE_IRQ)
7773
78−#define MXS_I2C_QUEUECTRL (0x60)
79−#define MXS_I2C_QUEUECTRL_SET (0x64)
80−#define MXS_I2C_QUEUECTRL_CLR (0x68)
81−
82−#define MXS_I2C_QUEUECTRL_QUEUE_RUN 0x20
83−#define MXS_I2C_QUEUECTRL_PIO_QUEUE_MODE 0x04
84−
85−#define MXS_I2C_QUEUESTAT (0x70)
86−#define MXS_I2C_QUEUESTAT_RD_QUEUE_EMPTY 0x00002000
87−#define MXS_I2C_QUEUESTAT_WRITE_QUEUE_CNT_MASK 0x0000001F
88−
89−#define MXS_I2C_QUEUECMD (0x80)
90−
91−#define MXS_I2C_QUEUEDATA (0x90)
92−
93−#define MXS_I2C_DATA (0xa0)
94−
9574
9675 #define MXS_CMD_I2C_SELECT (MXS_I2C_CTRL0_RETAIN_CLOCK | \
9776 MXS_I2C_CTRL0_PRE_SEND_START | \
@@ -153,7 +132,6 @@ struct mxs_i2c_dev { · 55 unmodified lines
153132 const struct mxs_i2c_speed_config *speed;
154133
155134 /* DMA support components */
156− bool dma_mode;
157135 int dma_channel;
158136 struct dma_chan *dmach;
159137 struct mxs_dma_data dma_data;
@@ -172,99 +150,6 @@ static void mxs_i2c_reset(struct mxs_i2c_dev *i2c) · 12 unmodified lines
172150 writel(i2c->speed->timing2, i2c->regs + MXS_I2C_TIMING2);
173151
174152 writel(MXS_I2C_IRQ_MASK << 8, i2c->regs + MXS_I2C_CTRL1_SET);
175− if (i2c->dma_mode)
176− writel(MXS_I2C_QUEUECTRL_PIO_QUEUE_MODE,
177− i2c->regs + MXS_I2C_QUEUECTRL_CLR);
178− else
179− writel(MXS_I2C_QUEUECTRL_PIO_QUEUE_MODE,
180− i2c->regs + MXS_I2C_QUEUECTRL_SET);
181−}
182−
183−static void mxs_i2c_pioq_setup_read(struct mxs_i2c_dev *i2c, u8 addr, int len,
184− int flags)
185−{
186− u32 data;
187−
188− writel(MXS_CMD_I2C_SELECT, i2c->regs + MXS_I2C_QUEUECMD);
189−
190− data = (addr << 1) | I2C_SMBUS_READ;
191− writel(data, i2c->regs + MXS_I2C_DATA);
192−
193− data = MXS_CMD_I2C_READ | MXS_I2C_CTRL0_XFER_COUNT(len) | flags;
194− writel(data, i2c->regs + MXS_I2C_QUEUECMD);
195−}
196−
197−static void mxs_i2c_pioq_setup_write(struct mxs_i2c_dev *i2c,
198− u8 addr, u8 *buf, int len, int flags)
199−{
200− u32 data;
201− int i, shifts_left;
202−
203− data = MXS_CMD_I2C_WRITE | MXS_I2C_CTRL0_XFER_COUNT(len + 1) | flags;
204− writel(data, i2c->regs + MXS_I2C_QUEUECMD);
205−
206− /*
207− * We have to copy the slave address (u8) and buffer (arbitrary number
208− * of u8) into the data register (u32). To achieve that, the u8 are put
209− * into the MSBs of 'data' which is then shifted for the next u8. When
210− * appropriate, 'data' is written to MXS_I2C_DATA. So, the first u32
211− * looks like this:
212− *
213− * 3 2 1 0
214− * 10987654|32109876|54321098|76543210
215− * --------+--------+--------+--------
216− * buffer+2|buffer+1|buffer+0|slave_addr
217− */
218−
219− data = ((addr << 1) | I2C_SMBUS_WRITE) << 24;
220−
221− for (i = 0; i < len; i++) {
222− data >>= 8;
223− data |= buf[i] << 24;
224− if ((i & 3) == 2)
225− writel(data, i2c->regs + MXS_I2C_DATA);
226− }
227−
228− /* Write out the remaining bytes if any */
229− shifts_left = 24 - (i & 3) * 8;
230− if (shifts_left)
231− writel(data >> shifts_left, i2c->regs + MXS_I2C_DATA);
232−}
233−
234−/*
235− * TODO: should be replaceable with a waitqueue and RD_QUEUE_IRQ (setting the
236− * rd_threshold to 1). Couldn't get this to work, though.
237− */
238−static int mxs_i2c_wait_for_data(struct mxs_i2c_dev *i2c)
239−{
240− unsigned long timeout = jiffies + msecs_to_jiffies(1000);
241−
242− while (readl(i2c->regs + MXS_I2C_QUEUESTAT)
243− & MXS_I2C_QUEUESTAT_RD_QUEUE_EMPTY) {
244− if (time_after(jiffies, timeout))
245− return -ETIMEDOUT;
246− cond_resched();
247− }
248−
249− return 0;
250−}
251−
252−static int mxs_i2c_finish_read(struct mxs_i2c_dev *i2c, u8 *buf, int len)
253−{
254− u32 uninitialized_var(data);
255− int i;
256−
257− for (i = 0; i < len; i++) {
258− if ((i & 3) == 0) {
259− if (mxs_i2c_wait_for_data(i2c))
260− return -ETIMEDOUT;
261− data = readl(i2c->regs + MXS_I2C_QUEUEDATA);
262− }
263− buf[i] = data & 0xff;
264− data >>= 8;
265− }
266−
267− return 0;
268153 }
269154
270155 static void mxs_i2c_dma_finish(struct mxs_i2c_dev *i2c)
@@ -402,12 +287,14 @@ read_init_dma_fail: · 131 unmodified lines
402287 select_init_dma_fail:
403288 dma_unmap_sg(i2c->dev, &i2c->sg_io[0], 1, DMA_TO_DEVICE);
404289 select_init_pio_fail:
290+ dmaengine_terminate_all(i2c->dmach);
405291 return -EINVAL;
406292
407293 /* Write failpath. */
408294 write_init_dma_fail:
409295 dma_unmap_sg(i2c->dev, i2c->sg_io, 2, DMA_TO_DEVICE);
410296 write_init_pio_fail:
297+ dmaengine_terminate_all(i2c->dmach);
411298 return -EINVAL;
412299 }
413300
@@ -432,39 +319,17 @@ static int mxs_i2c_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, · 18 unmodified lines
432319 init_completion(&i2c->cmd_complete);
433320 i2c->cmd_err = 0;
434321
435− if (i2c->dma_mode) {
436− ret = mxs_i2c_dma_setup_xfer(adap, msg, flags);
437− if (ret)
438− return ret;
439− } else {
440− if (msg->flags & I2C_M_RD) {
441− mxs_i2c_pioq_setup_read(i2c, msg->addr,
442− msg->len, flags);
443− } else {
444− mxs_i2c_pioq_setup_write(i2c, msg->addr, msg->buf,
445− msg->len, flags);
446− }
447−
448− writel(MXS_I2C_QUEUECTRL_QUEUE_RUN,
449− i2c->regs + MXS_I2C_QUEUECTRL_SET);
450− }
322+ ret = mxs_i2c_dma_setup_xfer(adap, msg, flags);
323+ if (ret)
324+ return ret;
451325
452326 ret = wait_for_completion_timeout(&i2c->cmd_complete,
453327 msecs_to_jiffies(1000));
454328 if (ret == 0)
455329 goto timeout;
456330
457− if (!i2c->dma_mode && !i2c->cmd_err && (msg->flags & I2C_M_RD)) {
458− ret = mxs_i2c_finish_read(i2c, msg->buf, msg->len);
459− if (ret)
460− goto timeout;
461− }
462−
463331 if (i2c->cmd_err == -ENXIO)
464332 mxs_i2c_reset(i2c);
465− else
466− writel(MXS_I2C_QUEUECTRL_QUEUE_RUN,
467− i2c->regs + MXS_I2C_QUEUECTRL_CLR);
468333
469334 dev_dbg(i2c->dev, "Done with err=%d\n", i2c->cmd_err);
470335
@@ -472,8 +337,7 @@ static int mxs_i2c_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, · 1 unmodified line
472337
473338 timeout:
474339 dev_dbg(i2c->dev, "Timeout!\n");
475− if (i2c->dma_mode)
476− mxs_i2c_dma_finish(i2c);
340+ mxs_i2c_dma_finish(i2c);
477341 mxs_i2c_reset(i2c);
478342 return -ETIMEDOUT;
479343 }
@@ -502,7 +366,6 @@ static irqreturn_t mxs_i2c_isr(int this_irq, void *dev_id) · 22 unmodified lines
502366 {
503367 struct mxs_i2c_dev *i2c = dev_id;
504368 u32 stat = readl(i2c->regs + MXS_I2C_CTRL1) & MXS_I2C_IRQ_MASK;
505− bool is_last_cmd;
506369
507370 if (!stat)
508371 return IRQ_NONE;
@@ -515,14 +378,6 @@ static irqreturn_t mxs_i2c_isr(int this_irq, void *dev_id) · 6 unmodified lines
515378 /* MXS_I2C_CTRL1_OVERSIZE_XFER_TERM_IRQ is only for slaves */
516379 i2c->cmd_err = -EIO;
517380
518− if (!i2c->dma_mode) {
519− is_last_cmd = (readl(i2c->regs + MXS_I2C_QUEUESTAT) &
520− MXS_I2C_QUEUESTAT_WRITE_QUEUE_CNT_MASK) == 0;
521−
522− if (is_last_cmd || i2c->cmd_err)
523− complete(&i2c->cmd_complete);
524− }
525−
526381 writel(stat, i2c->regs + MXS_I2C_CTRL1_CLR);
527382
528383 return IRQ_HANDLED;
@@ -555,15 +410,6 @@ static int mxs_i2c_get_ofdata(struct mxs_i2c_dev *i2c) · 26 unmodified lines
555410 struct device_node *node = dev->of_node;
556411 int ret;
557412
558− /*
559− * The MXS I2C DMA mode is prefered and enabled by default.
560− * The PIO mode is still supported, but should be used only
561− * for debuging purposes etc.
562− */
563− i2c->dma_mode = !use_pioqueue;
564− if (!i2c->dma_mode)
565− dev_info(dev, "Using PIOQUEUE mode for I2C transfers!\n");
566−
567413 /*
568414 * TODO: This is a temporary solution and should be changed
569415 * to use generic DMA binding later when the helpers get in.
@@ -571,8 +417,8 @@ static int mxs_i2c_get_ofdata(struct mxs_i2c_dev *i2c) · 1 unmodified line
571417 ret = of_property_read_u32(node, "fsl,i2c-dma-channel",
572418 &i2c->dma_channel);
573419 if (ret) {
574− dev_warn(dev, "Failed to get DMA channel, using PIOQUEUE!\n");
575− i2c->dma_mode = 0;
420+ dev_err(dev, "Failed to get DMA channel!\n");
421+ return -ENODEV;
576422 }
577423
578424 ret = of_property_read_u32(node, "clock-frequency", &speed);
@@ -634,15 +480,13 @@ static int __devinit mxs_i2c_probe(struct platform_device *pdev) · 55 unmodified lines
634480 }
635481
636482 /* Setup the DMA */
637− if (i2c->dma_mode) {
638− dma_cap_zero(mask);
639− dma_cap_set(DMA_SLAVE, mask);
640− i2c->dma_data.chan_irq = dmairq;
641− i2c->dmach = dma_request_channel(mask, mxs_i2c_dma_filter, i2c);
642− if (!i2c->dmach) {
643− dev_err(dev, "Failed to request dma\n");
644− return -ENODEV;
645− }
483+ dma_cap_zero(mask);
484+ dma_cap_set(DMA_SLAVE, mask);
485+ i2c->dma_data.chan_irq = dmairq;
486+ i2c->dmach = dma_request_channel(mask, mxs_i2c_dma_filter, i2c);
487+ if (!i2c->dmach) {
488+ dev_err(dev, "Failed to request dma\n");
489+ return -ENODEV;
646490 }
647491
648492 platform_set_drvdata(pdev, i2c);
drivers/i2c/busses/i2c-nomadik.c+7−2
@@ -644,7 +644,11 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap, · 643 unmodified lines
644644
645645 pm_runtime_get_sync(&dev->adev->dev);
646646
647− clk_enable(dev->clk);
647+ status = clk_prepare_enable(dev->clk);
648+ if (status) {
649+ dev_err(&dev->adev->dev, "can't prepare_enable clock\n");
650+ goto out_clk;
651+ }
648652
649653 status = init_hw(dev);
650654 if (status)
@@ -671,7 +675,8 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap, · 20 unmodified lines
671675 }
672676
673677 out:
674− clk_disable(dev->clk);
678+ clk_disable_unprepare(dev->clk);
679+out_clk:
675680 pm_runtime_put_sync(&dev->adev->dev);
676681
677682 dev->busy = false;
drivers/i2c/busses/i2c-omap.c+17−19
@@ -43,7 +43,6 @@ · 42 unmodified lines
4343 #include <linux/slab.h>
4444 #include <linux/i2c-omap.h>
4545 #include <linux/pm_runtime.h>
46−#include <linux/pm_qos.h>
4746
4847 /* I2C controller revisions */
4948 #define OMAP_I2C_OMAP1_REV_2 0x20
@@ -187,8 +186,9 @@ struct omap_i2c_dev { · 137 unmodified lines
187186 int reg_shift; /* bit shift for I2C register addresses */
188187 struct completion cmd_complete;
189188 struct resource *ioarea;
190− u32 latency; /* maximum MPU wkup latency */
191− struct pm_qos_request pm_qos_request;
189+ u32 latency; /* maximum mpu wkup latency */
190+ void (*set_mpu_wkup_lat)(struct device *dev,
191+ long latency);
192192 u32 speed; /* Speed of bus in kHz */
193193 u32 dtrev; /* extra revision from DT */
194194 u32 flags;
@@ -494,7 +494,9 @@ static void omap_i2c_resize_fifo(struct omap_i2c_dev *dev, u8 size, bool is_rx) · 299 unmodified lines
494494 dev->b_hw = 1; /* Enable hardware fixes */
495495
496496 /* calculate wakeup latency constraint for MPU */
497− dev->latency = (1000000 * dev->threshold) / (1000 * dev->speed / 8);
497+ if (dev->set_mpu_wkup_lat != NULL)
498+ dev->latency = (1000000 * dev->threshold) /
499+ (1000 * dev->speed / 8);
498500 }
499501
500502 /*
@@ -522,6 +524,9 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap, · 21 unmodified lines
522524 dev->buf = msg->buf;
523525 dev->buf_len = msg->len;
524526
527+ /* make sure writes to dev->buf_len are ordered */
528+ barrier();
529+
525530 omap_i2c_write_reg(dev, OMAP_I2C_CNT_REG, dev->buf_len);
526531
527532 /* Clear the FIFO Buffers */
@@ -579,7 +584,6 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap, · 51 unmodified lines
579584 */
580585 timeout = wait_for_completion_timeout(&dev->cmd_complete,
581586 OMAP_I2C_TIMEOUT);
582− dev->buf_len = 0;
583587 if (timeout == 0) {
584588 dev_err(dev->dev, "controller timed out\n");
585589 omap_i2c_init(dev);
@@ -629,16 +633,8 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) · 43 unmodified lines
629633 if (r < 0)
630634 goto out;
631635
632− /*
633− * When waiting for completion of a i2c transfer, we need to
634− * set a wake up latency constraint for the MPU. This is to
635− * ensure quick enough wakeup from idle, when transfer
636− * completes.
637− */
638− if (dev->latency)
639− pm_qos_add_request(&dev->pm_qos_request,
640− PM_QOS_CPU_DMA_LATENCY,
641− dev->latency);
636+ if (dev->set_mpu_wkup_lat != NULL)
637+ dev->set_mpu_wkup_lat(dev->dev, dev->latency);
642638
643639 for (i = 0; i < num; i++) {
644640 r = omap_i2c_xfer_msg(adap, &msgs[i], (i == (num - 1)));
@@ -646,8 +642,8 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) · 1 unmodified line
646642 break;
647643 }
648644
649− if (dev->latency)
650− pm_qos_remove_request(&dev->pm_qos_request);
645+ if (dev->set_mpu_wkup_lat != NULL)
646+ dev->set_mpu_wkup_lat(dev->dev, -1);
651647
652648 if (r == 0)
653649 r = num;
@@ -1104,6 +1100,7 @@ omap_i2c_probe(struct platform_device *pdev) · 450 unmodified lines
11041100 } else if (pdata != NULL) {
11051101 dev->speed = pdata->clkrate;
11061102 dev->flags = pdata->flags;
1103+ dev->set_mpu_wkup_lat = pdata->set_mpu_wkup_lat;
11071104 dev->dtrev = pdata->rev;
11081105 }
11091106
@@ -1159,8 +1156,9 @@ omap_i2c_probe(struct platform_device *pdev) · 49 unmodified lines
11591156 dev->b_hw = 1; /* Enable hardware fixes */
11601157
11611158 /* calculate wakeup latency constraint for MPU */
1162− dev->latency = (1000000 * dev->fifo_size) /
1163− (1000 * dev->speed / 8);
1159+ if (dev->set_mpu_wkup_lat != NULL)
1160+ dev->latency = (1000000 * dev->fifo_size) /
1161+ (1000 * dev->speed / 8);
11641162 }
11651163
11661164 /* reset ASAP, clearing any IRQs */
drivers/i2c/busses/i2c-s3c2410.c+1−0
@@ -806,6 +806,7 @@ static int s3c24xx_i2c_parse_dt_gpio(struct s3c24xx_i2c *i2c) · 805 unmodified lines
806806 dev_err(i2c->dev, "invalid gpio[%d]: %d\n", idx, gpio);
807807 goto free_gpio;
808808 }
809+ i2c->gpios[idx] = gpio;
809810
810811 ret = gpio_request(gpio, "i2c-bus");
811812 if (ret) {
drivers/i2c/busses/i2c-tegra.c+1−1
@@ -742,7 +742,7 @@ static int __devinit tegra_i2c_probe(struct platform_device *pdev) · 741 unmodified lines
742742 }
743743
744744 ret = devm_request_irq(&pdev->dev, i2c_dev->irq,
745− tegra_i2c_isr, 0, pdev->name, i2c_dev);
745+ tegra_i2c_isr, 0, dev_name(&pdev->dev), i2c_dev);
746746 if (ret) {
747747 dev_err(&pdev->dev, "Failed to request irq %i\n", i2c_dev->irq);
748748 return ret;
drivers/i2c/i2c-stub.crenamed from drivers/i2c/busses/i2c-stub.c+32−34
@@ -2,7 +2,7 @@ · 1 unmodified line
22 i2c-stub.c - I2C/SMBus chip emulator
33
44 Copyright (c) 2004 Mark M. Hoffman <mhoffman@lightlink.com>
5− Copyright (C) 2007 Jean Delvare <khali@linux-fr.org>
5+ Copyright (C) 2007, 2012 Jean Delvare <khali@linux-fr.org>
66
77 This program is free software; you can redistribute it and/or modify
88 it under the terms of the GNU General Public License as published by
@@ -51,8 +51,8 @@ struct stub_chip { · 42 unmodified lines
5151 static struct stub_chip *stub_chips;
5252
5353 /* Return negative errno on error. */
54−static s32 stub_xfer(struct i2c_adapter * adap, u16 addr, unsigned short flags,
55− char read_write, u8 command, int size, union i2c_smbus_data * data)
54+static s32 stub_xfer(struct i2c_adapter *adap, u16 addr, unsigned short flags,
55+ char read_write, u8 command, int size, union i2c_smbus_data *data)
5656 {
5757 s32 ret;
5858 int i, len;
@@ -78,14 +78,14 @@ static s32 stub_xfer(struct i2c_adapter * adap, u16 addr, unsigned short flags, · 19 unmodified lines
7878 case I2C_SMBUS_BYTE:
7979 if (read_write == I2C_SMBUS_WRITE) {
8080 chip->pointer = command;
81− dev_dbg(&adap->dev, "smbus byte - addr 0x%02x, "
82− "wrote 0x%02x.\n",
83− addr, command);
81+ dev_dbg(&adap->dev,
82+ "smbus byte - addr 0x%02x, wrote 0x%02x.\n",
83+ addr, command);
8484 } else {
8585 data->byte = chip->words[chip->pointer++] & 0xff;
86− dev_dbg(&adap->dev, "smbus byte - addr 0x%02x, "
87− "read 0x%02x.\n",
88− addr, data->byte);
86+ dev_dbg(&adap->dev,
87+ "smbus byte - addr 0x%02x, read 0x%02x.\n",
88+ addr, data->byte);
8989 }
9090
9191 ret = 0;
@@ -95,14 +95,14 @@ static s32 stub_xfer(struct i2c_adapter * adap, u16 addr, unsigned short flags, · 3 unmodified lines
9595 if (read_write == I2C_SMBUS_WRITE) {
9696 chip->words[command] &= 0xff00;
9797 chip->words[command] |= data->byte;
98− dev_dbg(&adap->dev, "smbus byte data - addr 0x%02x, "
99− "wrote 0x%02x at 0x%02x.\n",
100− addr, data->byte, command);
98+ dev_dbg(&adap->dev,
99+ "smbus byte data - addr 0x%02x, wrote 0x%02x at 0x%02x.\n",
100+ addr, data->byte, command);
101101 } else {
102102 data->byte = chip->words[command] & 0xff;
103− dev_dbg(&adap->dev, "smbus byte data - addr 0x%02x, "
104− "read 0x%02x at 0x%02x.\n",
105− addr, data->byte, command);
103+ dev_dbg(&adap->dev,
104+ "smbus byte data - addr 0x%02x, read 0x%02x at 0x%02x.\n",
105+ addr, data->byte, command);
106106 }
107107 chip->pointer = command + 1;
108108
@@ -112,14 +112,14 @@ static s32 stub_xfer(struct i2c_adapter * adap, u16 addr, unsigned short flags, · 3 unmodified lines
112112 case I2C_SMBUS_WORD_DATA:
113113 if (read_write == I2C_SMBUS_WRITE) {
114114 chip->words[command] = data->word;
115− dev_dbg(&adap->dev, "smbus word data - addr 0x%02x, "
116− "wrote 0x%04x at 0x%02x.\n",
117− addr, data->word, command);
115+ dev_dbg(&adap->dev,
116+ "smbus word data - addr 0x%02x, wrote 0x%04x at 0x%02x.\n",
117+ addr, data->word, command);
118118 } else {
119119 data->word = chip->words[command];
120− dev_dbg(&adap->dev, "smbus word data - addr 0x%02x, "
121− "read 0x%04x at 0x%02x.\n",
122− addr, data->word, command);
120+ dev_dbg(&adap->dev,
121+ "smbus word data - addr 0x%02x, read 0x%04x at 0x%02x.\n",
122+ addr, data->word, command);
123123 }
124124
125125 ret = 0;
@@ -132,17 +132,17 @@ static s32 stub_xfer(struct i2c_adapter * adap, u16 addr, unsigned short flags, · 6 unmodified lines
132132 chip->words[command + i] &= 0xff00;
133133 chip->words[command + i] |= data->block[1 + i];
134134 }
135− dev_dbg(&adap->dev, "i2c block data - addr 0x%02x, "
136− "wrote %d bytes at 0x%02x.\n",
137− addr, len, command);
135+ dev_dbg(&adap->dev,
136+ "i2c block data - addr 0x%02x, wrote %d bytes at 0x%02x.\n",
137+ addr, len, command);
138138 } else {
139139 for (i = 0; i < len; i++) {
140140 data->block[1 + i] =
141141 chip->words[command + i] & 0xff;
142142 }
143− dev_dbg(&adap->dev, "i2c block data - addr 0x%02x, "
144− "read %d bytes at 0x%02x.\n",
145− addr, len, command);
143+ dev_dbg(&adap->dev,
144+ "i2c block data - addr 0x%02x, read %d bytes at 0x%02x.\n",
145+ addr, len, command);
146146 }
147147
148148 ret = 0;
@@ -179,25 +179,24 @@ static int __init i2c_stub_init(void) · 30 unmodified lines
179179 int i, ret;
180180
181181 if (!chip_addr[0]) {
182− printk(KERN_ERR "i2c-stub: Please specify a chip address\n");
182+ pr_err("i2c-stub: Please specify a chip address\n");
183183 return -ENODEV;
184184 }
185185
186186 for (i = 0; i < MAX_CHIPS && chip_addr[i]; i++) {
187187 if (chip_addr[i] < 0x03 || chip_addr[i] > 0x77) {
188− printk(KERN_ERR "i2c-stub: Invalid chip address "
189− "0x%02x\n", chip_addr[i]);
188+ pr_err("i2c-stub: Invalid chip address 0x%02x\n",
189+ chip_addr[i]);
190190 return -EINVAL;
191191 }
192192
193− printk(KERN_INFO "i2c-stub: Virtual chip at 0x%02x\n",
194− chip_addr[i]);
193+ pr_info("i2c-stub: Virtual chip at 0x%02x\n", chip_addr[i]);
195194 }
196195
197196 /* Allocate memory for all chips at once */
198197 stub_chips = kzalloc(i * sizeof(struct stub_chip), GFP_KERNEL);
199198 if (!stub_chips) {
200− printk(KERN_ERR "i2c-stub: Out of memory\n");
199+ pr_err("i2c-stub: Out of memory\n");
201200 return -ENOMEM;
202201 }
203202
@@ -219,4 +218,3 @@ MODULE_LICENSE("GPL"); · 15 unmodified lines
219218
220219 module_init(i2c_stub_init);
221220 module_exit(i2c_stub_exit);
222−
drivers/i2c/muxes/i2c-mux-pinctrl.c+1−1
@@ -169,7 +169,7 @@ static int __devinit i2c_mux_pinctrl_probe(struct platform_device *pdev) · 168 unmodified lines
169169 mux->busses = devm_kzalloc(&pdev->dev,
170170 sizeof(mux->busses) * mux->pdata->bus_count,
171171 GFP_KERNEL);
172− if (!mux->states) {
172+ if (!mux->busses) {
173173 dev_err(&pdev->dev, "Cannot allocate busses\n");
174174 ret = -ENOMEM;
175175 goto err;
drivers/iio/Kconfig+0−1
@@ -62,7 +62,6 @@ source "drivers/iio/frequency/Kconfig" · 61 unmodified lines
6262 source "drivers/iio/dac/Kconfig"
6363 source "drivers/iio/common/Kconfig"
6464 source "drivers/iio/gyro/Kconfig"
65−source "drivers/iio/light/Kconfig"
6665 source "drivers/iio/magnetometer/Kconfig"
6766
6867 endif # IIO
drivers/iio/Makefile+0−1
@@ -18,5 +18,4 @@ obj-y += frequency/ · 17 unmodified lines
1818 obj-y += dac/
1919 obj-y += common/
2020 obj-y += gyro/
21−obj-y += light/
2221 obj-y += magnetometer/
drivers/infiniband/hw/cxgb4/mem.c+1−1
@@ -468,7 +468,7 @@ struct ib_mr *c4iw_register_phys_mem(struct ib_pd *pd, · 467 unmodified lines
468468 ret = alloc_pbl(mhp, npages);
469469 if (ret) {
470470 kfree(page_list);
471− goto err_pbl;
471+ goto err;
472472 }
473473
474474 ret = write_pbl(&mhp->rhp->rdev, page_list, mhp->attr.pbl_addr,
drivers/infiniband/hw/mlx4/alias_GUID.c+1−1
@@ -107,7 +107,7 @@ static __be64 get_cached_alias_guid(struct mlx4_ib_dev *dev, int port, int index · 106 unmodified lines
107107 {
108108 if (index >= NUM_ALIAS_GUID_PER_PORT) {
109109 pr_err("%s: ERROR: asked for index:%d\n", __func__, index);
110− return (__force __be64) ((u64) 0xFFFFFFFFFFFFFFFFUL);
110+ return (__force __be64) -1;
111111 }
112112 return *(__be64 *)&dev->sriov.demux[port - 1].guid_cache[index];
113113 }
drivers/infiniband/hw/mlx4/mad.c+40−45
@@ -409,38 +409,45 @@ int mlx4_ib_find_real_gid(struct ib_device *ibdev, u8 port, __be64 guid) · 408 unmodified lines
409409 }
410410
411411
412−static int get_pkey_phys_indices(struct mlx4_ib_dev *ibdev, u8 port, u8 ph_pkey_ix,
413− u8 *full_pk_ix, u8 *partial_pk_ix,
414− int *is_full_member)
412+static int find_slave_port_pkey_ix(struct mlx4_ib_dev *dev, int slave,
413+ u8 port, u16 pkey, u16 *ix)
415414 {
416− u16 search_pkey;
417− int fm;
418− int err = 0;
419− u16 pk;
415+ int i, ret;
416+ u8 unassigned_pkey_ix, pkey_ix, partial_ix = 0xFF;
417+ u16 slot_pkey;
420418
421− err = ib_get_cached_pkey(&ibdev->ib_dev, port, ph_pkey_ix, &search_pkey);
422− if (err)
423− return err;
419+ if (slave == mlx4_master_func_num(dev->dev))
420+ return ib_find_cached_pkey(&dev->ib_dev, port, pkey, ix);
424421
425− fm = (search_pkey & 0x8000) ? 1 : 0;
426− if (fm) {
427− *full_pk_ix = ph_pkey_ix;
428− search_pkey &= 0x7FFF;
429− } else {
430− *partial_pk_ix = ph_pkey_ix;
431− search_pkey |= 0x8000;
432− }
422+ unassigned_pkey_ix = dev->dev->phys_caps.pkey_phys_table_len[port] - 1;
433423
434− if (ib_find_exact_cached_pkey(&ibdev->ib_dev, port, search_pkey, &pk))
435− pk = 0xFFFF;
424+ for (i = 0; i < dev->dev->caps.pkey_table_len[port]; i++) {
425+ if (dev->pkeys.virt2phys_pkey[slave][port - 1][i] == unassigned_pkey_ix)
426+ continue;
436427
437− if (fm)
438− *partial_pk_ix = (pk & 0xFF);
439− else
440− *full_pk_ix = (pk & 0xFF);
428+ pkey_ix = dev->pkeys.virt2phys_pkey[slave][port - 1][i];
441429
442− *is_full_member = fm;
443− return err;
430+ ret = ib_get_cached_pkey(&dev->ib_dev, port, pkey_ix, &slot_pkey);
431+ if (ret)
432+ continue;
433+ if ((slot_pkey & 0x7FFF) == (pkey & 0x7FFF)) {
434+ if (slot_pkey & 0x8000) {
435+ *ix = (u16) pkey_ix;
436+ return 0;
437+ } else {
438+ /* take first partial pkey index found */
439+ if (partial_ix == 0xFF)
440+ partial_ix = pkey_ix;
441+ }
442+ }
443+ }
444+
445+ if (partial_ix < 0xFF) {
446+ *ix = (u16) partial_ix;
447+ return 0;
448+ }
449+
450+ return -EINVAL;
444451 }
445452
446453 int mlx4_ib_send_to_slave(struct mlx4_ib_dev *dev, int slave, u8 port,
@@ -458,10 +465,8 @@ int mlx4_ib_send_to_slave(struct mlx4_ib_dev *dev, int slave, u8 port, · 11 unmodified lines
458465 unsigned tun_tx_ix = 0;
459466 int dqpn;
460467 int ret = 0;
461− int i;
462− int is_full_member = 0;
463468 u16 tun_pkey_ix;
464− u8 ph_pkey_ix, full_pk_ix = 0, partial_pk_ix = 0;
469+ u16 cached_pkey;
465470
466471 if (dest_qpt > IB_QPT_GSI)
467472 return -EINVAL;
@@ -481,27 +486,17 @@ int mlx4_ib_send_to_slave(struct mlx4_ib_dev *dev, int slave, u8 port, · 13 unmodified lines
481486 else
482487 tun_qp = &tun_ctx->qp[1];
483488
484− /* compute pkey index for slave */
485− /* get physical pkey -- virtualized Dom0 pkey to phys*/
489+ /* compute P_Key index to put in tunnel header for slave */
486490 if (dest_qpt) {
487− ph_pkey_ix =
488− dev->pkeys.virt2phys_pkey[mlx4_master_func_num(dev->dev)][port - 1][wc->pkey_index];
489−
490− /* now, translate this to the slave pkey index */
491− ret = get_pkey_phys_indices(dev, port, ph_pkey_ix, &full_pk_ix,
492− &partial_pk_ix, &is_full_member);
491+ u16 pkey_ix;
492+ ret = ib_get_cached_pkey(&dev->ib_dev, port, wc->pkey_index, &cached_pkey);
493493 if (ret)
494494 return -EINVAL;
495495
496− for (i = 0; i < dev->dev->caps.pkey_table_len[port]; i++) {
497− if ((dev->pkeys.virt2phys_pkey[slave][port - 1][i] == full_pk_ix) ||
498− (is_full_member &&
499− (dev->pkeys.virt2phys_pkey[slave][port - 1][i] == partial_pk_ix)))
500− break;
501− }
502− if (i == dev->dev->caps.pkey_table_len[port])
496+ ret = find_slave_port_pkey_ix(dev, slave, port, cached_pkey, &pkey_ix);
497+ if (ret)
503498 return -EINVAL;
504− tun_pkey_ix = i;
499+ tun_pkey_ix = pkey_ix;
505500 } else
506501 tun_pkey_ix = dev->pkeys.virt2phys_pkey[slave][port - 1][0];
507502
drivers/infiniband/hw/mlx4/mcg.c+10−8
@@ -233,7 +233,8 @@ static int send_mad_to_slave(int slave, struct mlx4_ib_demux_ctx *ctx, · 232 unmodified lines
233233
234234 ib_query_ah(dev->sm_ah[ctx->port - 1], &ah_attr);
235235
236− wc.pkey_index = 0;
236+ if (ib_find_cached_pkey(&dev->ib_dev, ctx->port, IB_DEFAULT_PKEY_FULL, &wc.pkey_index))
237+ return -EINVAL;
237238 wc.sl = 0;
238239 wc.dlid_path_bits = 0;
239240 wc.port_num = ctx->port;
@@ -1074,10 +1075,6 @@ static void _mlx4_ib_mcg_port_cleanup(struct mlx4_ib_demux_ctx *ctx, int destroy · 834 unmodified lines
10741075 unsigned long end;
10751076 int count;
10761077
1077− if (ctx->flushing)
1078− return;
1079−
1080− ctx->flushing = 1;
10811078 for (i = 0; i < MAX_VFS; ++i)
10821079 clean_vf_mcast(ctx, i);
10831080
@@ -1107,9 +1104,6 @@ static void _mlx4_ib_mcg_port_cleanup(struct mlx4_ib_demux_ctx *ctx, int destroy · 23 unmodified lines
11071104 force_clean_group(group);
11081105 }
11091106 mutex_unlock(&ctx->mcg_table_lock);
1110−
1111− if (!destroy_wq)
1112− ctx->flushing = 0;
11131107 }
11141108
11151109 struct clean_work {
@@ -1123,6 +1117,7 @@ static void mcg_clean_task(struct work_struct *work) · 7 unmodified lines
11231117 struct clean_work *cw = container_of(work, struct clean_work, work);
11241118
11251119 _mlx4_ib_mcg_port_cleanup(cw->ctx, cw->destroy_wq);
1120+ cw->ctx->flushing = 0;
11261121 kfree(cw);
11271122 }
11281123
@@ -1130,13 +1125,20 @@ void mlx4_ib_mcg_port_cleanup(struct mlx4_ib_demux_ctx *ctx, int destroy_wq) · 1 unmodified line
11301125 {
11311126 struct clean_work *work;
11321127
1128+ if (ctx->flushing)
1129+ return;
1130+
1131+ ctx->flushing = 1;
1132+
11331133 if (destroy_wq) {
11341134 _mlx4_ib_mcg_port_cleanup(ctx, destroy_wq);
1135+ ctx->flushing = 0;
11351136 return;
11361137 }
11371138
11381139 work = kmalloc(sizeof *work, GFP_KERNEL);
11391140 if (!work) {
1141+ ctx->flushing = 0;
11401142 mcg_warn("failed allocating work for cleanup\n");
11411143 return;
11421144 }
drivers/input/input-mt.c+4−0
@@ -26,10 +26,14 @@ static void copy_abs(struct input_dev *dev, unsigned int dst, unsigned int src) · 25 unmodified lines
2626 * input_mt_init_slots() - initialize MT input slots
2727 * @dev: input device supporting MT events and finger tracking
2828 * @num_slots: number of slots used by the device
29+ * @flags: mt tasks to handle in core
2930 *
3031 * This function allocates all necessary memory for MT slot handling
3132 * in the input device, prepares the ABS_MT_SLOT and
3233 * ABS_MT_TRACKING_ID events for use and sets up appropriate buffers.
34+ * Depending on the flags set, it also performs pointer emulation and
35+ * frame synchronization.
36+ *
3337 * May be called repeatedly. Returns -EINVAL if attempting to
3438 * reinitialize with a different number of slots.
3539 */
drivers/input/keyboard/Kconfig+1−0
@@ -335,6 +335,7 @@ config KEYBOARD_LOCOMO · 334 unmodified lines
335335 config KEYBOARD_LPC32XX
336336 tristate "LPC32XX matrix key scanner support"
337337 depends on ARCH_LPC32XX && OF
338+ select INPUT_MATRIXKMAP
338339 help
339340 Say Y here if you want to use NXP LPC32XX SoC key scanner interface,
340341 connected to a key matrix.
drivers/input/keyboard/pxa27x_keypad.c+3−0
@@ -368,6 +368,9 @@ static void pxa27x_keypad_config(struct pxa27x_keypad *keypad) · 367 unmodified lines
368368 unsigned int mask = 0, direct_key_num = 0;
369369 unsigned long kpc = 0;
370370
371+ /* clear pending interrupt bit */
372+ keypad_readl(KPC);
373+
371374 /* enable matrix keys with automatic scan */
372375 if (pdata->matrix_key_rows && pdata->matrix_key_cols) {
373376 kpc |= KPC_ASACT | KPC_MIE | KPC_ME | KPC_MS_ALL;
drivers/input/misc/xen-kbdfront.c+4−1
@@ -311,7 +311,6 @@ static void xenkbd_backend_changed(struct xenbus_device *dev, · 310 unmodified lines
311311 case XenbusStateReconfiguring:
312312 case XenbusStateReconfigured:
313313 case XenbusStateUnknown:
314− case XenbusStateClosed:
315314 break;
316315
317316 case XenbusStateInitWait:
@@ -350,6 +349,10 @@ InitWait: · 32 unmodified lines
350349
351350 break;
352351
352+ case XenbusStateClosed:
353+ if (dev->state == XenbusStateClosed)
354+ break;
355+ /* Missed the backend's CLOSING state -- fallthrough */
353356 case XenbusStateClosing:
354357 xenbus_frontend_closed(dev);
355358 break;
drivers/input/mouse/bcm5974.c+21−0
@@ -84,6 +84,10 @@ · 83 unmodified lines
8484 #define USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI 0x0262
8585 #define USB_DEVICE_ID_APPLE_WELLSPRING7_ISO 0x0263
8686 #define USB_DEVICE_ID_APPLE_WELLSPRING7_JIS 0x0264
87+/* MacbookPro10,2 (unibody, October 2012) */
88+#define USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI 0x0259
89+#define USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO 0x025a
90+#define USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS 0x025b
8791
8892 #define BCM5974_DEVICE(prod) { \
8993 .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \
@@ -137,6 +141,10 @@ static const struct usb_device_id bcm5974_table[] = { · 47 unmodified lines
137141 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI),
138142 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_ISO),
139143 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_JIS),
144+ /* MacbookPro10,2 */
145+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI),
146+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO),
147+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS),
140148 /* Terminating entry */
141149 {}
142150 };
@@ -379,6 +387,19 @@ static const struct bcm5974_config bcm5974_config_table[] = { · 236 unmodified lines
379387 { SN_COORD, -150, 6730 },
380388 { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
381389 },
390+ {
391+ USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI,
392+ USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO,
393+ USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS,
394+ HAS_INTEGRATED_BUTTON,
395+ 0x84, sizeof(struct bt_data),
396+ 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
397+ { SN_PRESSURE, 0, 300 },
398+ { SN_WIDTH, 0, 2048 },
399+ { SN_COORD, -4750, 5280 },
400+ { SN_COORD, -150, 6730 },
401+ { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
402+ },
382403 {}
383404 };
384405
drivers/input/mousedev.c+2−2
@@ -12,8 +12,8 @@ · 11 unmodified lines
1212 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
1313
1414 #define MOUSEDEV_MINOR_BASE 32
15−#define MOUSEDEV_MINORS 32
16−#define MOUSEDEV_MIX 31
15+#define MOUSEDEV_MINORS 31
16+#define MOUSEDEV_MIX 63
1717
1818 #include <linux/sched.h>
1919 #include <linux/slab.h>
drivers/input/tablet/wacom_sys.c+49−2
@@ -391,7 +391,7 @@ static int wacom_parse_hid(struct usb_interface *intf, · 390 unmodified lines
391391 features->pktlen = WACOM_PKGLEN_TPC2FG;
392392 }
393393
394− if (features->type == MTSCREEN)
394+ if (features->type == MTSCREEN || features->type == WACOM_24HDT)
395395 features->pktlen = WACOM_PKGLEN_MTOUCH;
396396
397397 if (features->type == BAMBOO_PT) {
@@ -402,6 +402,14 @@ static int wacom_parse_hid(struct usb_interface *intf, · 4 unmodified lines
402402 features->x_max =
403403 get_unaligned_le16(&report[i + 8]);
404404 i += 15;
405+ } else if (features->type == WACOM_24HDT) {
406+ features->x_max =
407+ get_unaligned_le16(&report[i + 3]);
408+ features->x_phy =
409+ get_unaligned_le16(&report[i + 8]);
410+ features->unit = report[i - 1];
411+ features->unitExpo = report[i - 3];
412+ i += 12;
405413 } else {
406414 features->x_max =
407415 get_unaligned_le16(&report[i + 3]);
@@ -434,6 +442,12 @@ static int wacom_parse_hid(struct usb_interface *intf, · 26 unmodified lines
434442 features->y_phy =
435443 get_unaligned_le16(&report[i + 6]);
436444 i += 7;
445+ } else if (type == WACOM_24HDT) {
446+ features->y_max =
447+ get_unaligned_le16(&report[i + 3]);
448+ features->y_phy =
449+ get_unaligned_le16(&report[i - 2]);
450+ i += 7;
437451 } else if (type == BAMBOO_PT) {
438452 features->y_phy =
439453 get_unaligned_le16(&report[i + 3]);
@@ -541,6 +555,9 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat · 101 unmodified lines
541555 /* MT Tablet PC touch */
542556 return wacom_set_device_mode(intf, 3, 4, 4);
543557 }
558+ else if (features->type == WACOM_24HDT) {
559+ return wacom_set_device_mode(intf, 18, 3, 2);
560+ }
544561 } else if (features->device_type == BTN_TOOL_PEN) {
545562 if (features->type <= BAMBOO_PT && features->type != WIRELESS) {
546563 return wacom_set_device_mode(intf, 2, 2, 2);
@@ -613,6 +630,30 @@ struct wacom_usbdev_data { · 66 unmodified lines
613630 static LIST_HEAD(wacom_udev_list);
614631 static DEFINE_MUTEX(wacom_udev_list_lock);
615632
633+static struct usb_device *wacom_get_sibling(struct usb_device *dev, int vendor, int product)
634+{
635+ int port1;
636+ struct usb_device *sibling;
637+
638+ if (vendor == 0 && product == 0)
639+ return dev;
640+
641+ if (dev->parent == NULL)
642+ return NULL;
643+
644+ usb_hub_for_each_child(dev->parent, port1, sibling) {
645+ struct usb_device_descriptor *d;
646+ if (sibling == NULL)
647+ continue;
648+
649+ d = &sibling->descriptor;
650+ if (d->idVendor == vendor && d->idProduct == product)
651+ return sibling;
652+ }
653+
654+ return NULL;
655+}
656+
616657 static struct wacom_usbdev_data *wacom_get_usbdev_data(struct usb_device *dev)
617658 {
618659 struct wacom_usbdev_data *data;
@@ -1257,13 +1298,19 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i · 638 unmodified lines
12571298 strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name));
12581299
12591300 if (features->quirks & WACOM_QUIRK_MULTI_INPUT) {
1301+ struct usb_device *other_dev;
1302+
12601303 /* Append the device type to the name */
12611304 strlcat(wacom_wac->name,
12621305 features->device_type == BTN_TOOL_PEN ?
12631306 " Pen" : " Finger",
12641307 sizeof(wacom_wac->name));
12651308
1266− error = wacom_add_shared_data(wacom_wac, dev);
1309+
1310+ other_dev = wacom_get_sibling(dev, features->oVid, features->oPid);
1311+ if (other_dev == NULL || wacom_get_usbdev_data(other_dev) == NULL)
1312+ other_dev = dev;
1313+ error = wacom_add_shared_data(wacom_wac, other_dev);
12671314 if (error)
12681315 goto fail3;
12691316 }
drivers/input/tablet/wacom_wac.c+88−3
@@ -806,6 +806,70 @@ static int find_slot_from_contactid(struct wacom_wac *wacom, int contactid) · 805 unmodified lines
806806 return -1;
807807 }
808808
809+static int int_dist(int x1, int y1, int x2, int y2)
810+{
811+ int x = x2 - x1;
812+ int y = y2 - y1;
813+
814+ return int_sqrt(x*x + y*y);
815+}
816+
817+static int wacom_24hdt_irq(struct wacom_wac *wacom)
818+{
819+ struct input_dev *input = wacom->input;
820+ char *data = wacom->data;
821+ int i;
822+ int current_num_contacts = data[61];
823+ int contacts_to_send = 0;
824+
825+ /*
826+ * First packet resets the counter since only the first
827+ * packet in series will have non-zero current_num_contacts.
828+ */
829+ if (current_num_contacts)
830+ wacom->num_contacts_left = current_num_contacts;
831+
832+ /* There are at most 4 contacts per packet */
833+ contacts_to_send = min(4, wacom->num_contacts_left);
834+
835+ for (i = 0; i < contacts_to_send; i++) {
836+ int offset = (WACOM_BYTES_PER_24HDT_PACKET * i) + 1;
837+ bool touch = data[offset] & 0x1 && !wacom->shared->stylus_in_proximity;
838+ int id = data[offset + 1];
839+ int slot = find_slot_from_contactid(wacom, id);
840+
841+ if (slot < 0)
842+ continue;
843+ input_mt_slot(input, slot);
844+ input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
845+
846+ if (touch) {
847+ int t_x = le16_to_cpup((__le16 *)&data[offset + 2]);
848+ int c_x = le16_to_cpup((__le16 *)&data[offset + 4]);
849+ int t_y = le16_to_cpup((__le16 *)&data[offset + 6]);
850+ int c_y = le16_to_cpup((__le16 *)&data[offset + 8]);
851+ int w = le16_to_cpup((__le16 *)&data[offset + 10]);
852+ int h = le16_to_cpup((__le16 *)&data[offset + 12]);
853+
854+ input_report_abs(input, ABS_MT_POSITION_X, t_x);
855+ input_report_abs(input, ABS_MT_POSITION_Y, t_y);
856+ input_report_abs(input, ABS_MT_TOUCH_MAJOR, min(w,h));
857+ input_report_abs(input, ABS_MT_WIDTH_MAJOR, min(w, h) + int_dist(t_x, t_y, c_x, c_y));
858+ input_report_abs(input, ABS_MT_WIDTH_MINOR, min(w, h));
859+ input_report_abs(input, ABS_MT_ORIENTATION, w > h);
860+ }
861+ wacom->slots[slot] = touch ? id : -1;
862+ }
863+
864+ input_mt_report_pointer_emulation(input, true);
865+
866+ wacom->num_contacts_left -= contacts_to_send;
867+ if (wacom->num_contacts_left <= 0)
868+ wacom->num_contacts_left = 0;
869+
870+ return 1;
871+}
872+
809873 static int wacom_mt_touch(struct wacom_wac *wacom)
810874 {
811875 struct input_dev *input = wacom->input;
@@ -1255,6 +1319,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) · 443 unmodified lines
12551319 sync = wacom_intuos_irq(wacom_wac);
12561320 break;
12571321
1322+ case WACOM_24HDT:
1323+ sync = wacom_24hdt_irq(wacom_wac);
1324+ break;
1325+
12581326 case INTUOS5S:
12591327 case INTUOS5:
12601328 case INTUOS5L:
@@ -1340,7 +1408,8 @@ void wacom_setup_device_quirks(struct wacom_features *features) · 79 unmodified lines
13401408
13411409 /* these device have multiple inputs */
13421410 if (features->type >= WIRELESS ||
1343− (features->type >= INTUOS5S && features->type <= INTUOS5L))
1411+ (features->type >= INTUOS5S && features->type <= INTUOS5L) ||
1412+ (features->oVid && features->oPid))
13441413 features->quirks |= WACOM_QUIRK_MULTI_INPUT;
13451414
13461415 /* quirk for bamboo touch with 2 low res touches */
@@ -1449,6 +1518,9 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, · 102 unmodified lines
14491518
14501519 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
14511520 input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
1521+
1522+ __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
1523+
14521524 wacom_setup_cintiq(wacom_wac);
14531525 break;
14541526
@@ -1575,6 +1647,15 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, · 120 unmodified lines
15751647 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
15761648 break;
15771649
1650+ case WACOM_24HDT:
1651+ if (features->device_type == BTN_TOOL_FINGER) {
1652+ input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, features->x_max, 0, 0);
1653+ input_set_abs_params(input_dev, ABS_MT_WIDTH_MAJOR, 0, features->x_max, 0, 0);
1654+ input_set_abs_params(input_dev, ABS_MT_WIDTH_MINOR, 0, features->y_max, 0, 0);
1655+ input_set_abs_params(input_dev, ABS_MT_ORIENTATION, 0, 1, 0, 0);
1656+ }
1657+ /* fall through */
1658+
15781659 case MTSCREEN:
15791660 if (features->device_type == BTN_TOOL_FINGER) {
15801661 wacom_wac->slots = kmalloc(features->touch_max *
@@ -1869,8 +1950,11 @@ static const struct wacom_features wacom_features_0xF4 = · 288 unmodified lines
18691950 { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047,
18701951 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
18711952 static const struct wacom_features wacom_features_0xF8 =
1872− { "Wacom Cintiq 24HD touch", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047,
1873− 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1953+ { "Wacom Cintiq 24HD touch", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, /* Pen */
1954+ 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf6 };
1955+static const struct wacom_features wacom_features_0xF6 =
1956+ { "Wacom Cintiq 24HD touch", .type = WACOM_24HDT, /* Touch */
1957+ .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10 };
18741958 static const struct wacom_features wacom_features_0x3F =
18751959 { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023,
18761960 63, CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
@@ -2113,6 +2197,7 @@ const struct usb_device_id wacom_ids[] = { · 236 unmodified lines
21132197 { USB_DEVICE_WACOM(0x47) },
21142198 { USB_DEVICE_WACOM(0xF4) },
21152199 { USB_DEVICE_WACOM(0xF8) },
2200+ { USB_DEVICE_WACOM(0xF6) },
21162201 { USB_DEVICE_WACOM(0xFA) },
21172202 { USB_DEVICE_LENOVO(0x6004) },
21182203 { }
drivers/input/tablet/wacom_wac.h+5−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929
3030 /* wacom data size per MT contact */
3131 #define WACOM_BYTES_PER_MT_PACKET 11
32+#define WACOM_BYTES_PER_24HDT_PACKET 14
3233
3334 /* device IDs */
3435 #define STYLUS_DEVICE_ID 0x02
@@ -49,6 +50,7 @@ · 14 unmodified lines
4950 #define WACOM_REPORT_TPCHID 15
5051 #define WACOM_REPORT_TPCST 16
5152 #define WACOM_REPORT_TPC1FGE 18
53+#define WACOM_REPORT_24HDT 1
5254
5355 /* device quirks */
5456 #define WACOM_QUIRK_MULTI_INPUT 0x0001
@@ -81,6 +83,7 @@ enum { · 26 unmodified lines
8183 WACOM_MO,
8284 WIRELESS,
8385 BAMBOO_PT,
86+ WACOM_24HDT,
8487 TABLETPC, /* add new TPC below */
8588 TABLETPCE,
8689 TABLETPC2FG,
@@ -109,6 +112,8 @@ struct wacom_features { · 22 unmodified lines
109112 int distance_fuzz;
110113 unsigned quirks;
111114 unsigned touch_max;
115+ int oVid;
116+ int oPid;
112117 };
113118
114119 struct wacom_shared {
drivers/input/touchscreen/Kconfig+1−1
@@ -239,7 +239,7 @@ config TOUCHSCREEN_EETI · 238 unmodified lines
239239
240240 config TOUCHSCREEN_EGALAX
241241 tristate "EETI eGalax multi-touch panel support"
242− depends on I2C
242+ depends on I2C && OF
243243 help
244244 Say Y here to enable support for I2C connected EETI
245245 eGalax multi-touch panels.
drivers/input/touchscreen/ads7846.c+5−1
@@ -955,7 +955,8 @@ static int ads7846_resume(struct device *dev) · 954 unmodified lines
955955
956956 static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume);
957957
958−static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads7846 *ts)
958+static int __devinit ads7846_setup_pendown(struct spi_device *spi,
959+ struct ads7846 *ts)
959960 {
960961 struct ads7846_platform_data *pdata = spi->dev.platform_data;
961962 int err;
@@ -981,6 +982,9 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784 · 19 unmodified lines
981982
982983 ts->gpio_pendown = pdata->gpio_pendown;
983984
985+ if (pdata->gpio_pendown_debounce)
986+ gpio_set_debounce(pdata->gpio_pendown,
987+ pdata->gpio_pendown_debounce);
984988 } else {
985989 dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");
986990 return -EINVAL;
drivers/input/touchscreen/egalax_ts.c+21−2
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <linux/slab.h>
2929 #include <linux/bitops.h>
3030 #include <linux/input/mt.h>
31+#include <linux/of_gpio.h>
3132
3233 /*
3334 * Mouse Mode: some panel may configure the controller to mouse mode,
@@ -122,9 +123,17 @@ static irqreturn_t egalax_ts_interrupt(int irq, void *dev_id) · 88 unmodified lines
122123 /* wake up controller by an falling edge of interrupt gpio. */
123124 static int egalax_wake_up_device(struct i2c_client *client)
124125 {
125− int gpio = irq_to_gpio(client->irq);
126+ struct device_node *np = client->dev.of_node;
127+ int gpio;
126128 int ret;
127129
130+ if (!np)
131+ return -ENODEV;
132+
133+ gpio = of_get_named_gpio(np, "wakeup-gpios", 0);
134+ if (!gpio_is_valid(gpio))
135+ return -ENODEV;
136+
128137 ret = gpio_request(gpio, "egalax_irq");
129138 if (ret < 0) {
130139 dev_err(&client->dev,
@@ -181,7 +190,11 @@ static int __devinit egalax_ts_probe(struct i2c_client *client, · 50 unmodified lines
181190 ts->input_dev = input_dev;
182191
183192 /* controller may be in sleep, wake it up. */
184− egalax_wake_up_device(client);
193+ error = egalax_wake_up_device(client);
194+ if (error) {
195+ dev_err(&client->dev, "Failed to wake up the controller\n");
196+ goto err_free_dev;
197+ }
185198
186199 ret = egalax_firmware_version(client);
187200 if (ret < 0) {
@@ -274,11 +287,17 @@ static int egalax_ts_resume(struct device *dev) · 86 unmodified lines
274287
275288 static SIMPLE_DEV_PM_OPS(egalax_ts_pm_ops, egalax_ts_suspend, egalax_ts_resume);
276289
290+static struct of_device_id egalax_ts_dt_ids[] = {
291+ { .compatible = "eeti,egalax_ts" },
292+ { /* sentinel */ }
293+};
294+
277295 static struct i2c_driver egalax_ts_driver = {
278296 .driver = {
279297 .name = "egalax_ts",
280298 .owner = THIS_MODULE,
281299 .pm = &egalax_ts_pm_ops,
300+ .of_match_table = of_match_ptr(egalax_ts_dt_ids),
282301 },
283302 .id_table = egalax_ts_id,
284303 .probe = egalax_ts_probe,
drivers/input/touchscreen/tsc40.c+0−1
@@ -107,7 +107,6 @@ static int tsc_connect(struct serio *serio, struct serio_driver *drv) · 106 unmodified lines
107107 __set_bit(BTN_TOUCH, input_dev->keybit);
108108 input_set_abs_params(ptsc->dev, ABS_X, 0, 0x3ff, 0, 0);
109109 input_set_abs_params(ptsc->dev, ABS_Y, 0, 0x3ff, 0, 0);
110− input_set_abs_params(ptsc->dev, ABS_PRESSURE, 0, 0, 0, 0);
111110
112111 serio_set_drvdata(serio, ptsc);
113112
drivers/iommu/amd_iommu_init.c+32−7
@@ -1599,21 +1599,46 @@ static void __init free_on_init_error(void) · 1598 unmodified lines
15991599 #endif
16001600 }
16011601
1602+/* SB IOAPIC is always on this device in AMD systems */
1603+#define IOAPIC_SB_DEVID ((0x00 << 8) | PCI_DEVFN(0x14, 0))
1604+
16021605 static bool __init check_ioapic_information(void)
16031606 {
1607+ bool ret, has_sb_ioapic;
16041608 int idx;
16051609
1606− for (idx = 0; idx < nr_ioapics; idx++) {
1607− int id = mpc_ioapic_id(idx);
1610+ has_sb_ioapic = false;
1611+ ret = false;
16081612
1609− if (get_ioapic_devid(id) < 0) {
1610− pr_err(FW_BUG "AMD-Vi: IO-APIC[%d] not in IVRS table\n", id);
1611− pr_err("AMD-Vi: Disabling interrupt remapping due to BIOS Bug\n");
1612− return false;
1613+ for (idx = 0; idx < nr_ioapics; idx++) {
1614+ int devid, id = mpc_ioapic_id(idx);
1615+
1616+ devid = get_ioapic_devid(id);
1617+ if (devid < 0) {
1618+ pr_err(FW_BUG "AMD-Vi: IOAPIC[%d] not in IVRS table\n", id);
1619+ ret = false;
1620+ } else if (devid == IOAPIC_SB_DEVID) {
1621+ has_sb_ioapic = true;
1622+ ret = true;
16131623 }
16141624 }
16151625
1616− return true;
1626+ if (!has_sb_ioapic) {
1627+ /*
1628+ * We expect the SB IOAPIC to be listed in the IVRS
1629+ * table. The system timer is connected to the SB IOAPIC
1630+ * and if we don't have it in the list the system will
1631+ * panic at boot time. This situation usually happens
1632+ * when the BIOS is buggy and provides us the wrong
1633+ * device id for the IOAPIC in the system.
1634+ */
1635+ pr_err(FW_BUG "AMD-Vi: No southbridge IOAPIC found in IVRS table\n");
1636+ }
1637+
1638+ if (!ret)
1639+ pr_err("AMD-Vi: Disabling interrupt remapping due to BIOS Bug(s)\n");
1640+
1641+ return ret;
16171642 }
16181643
16191644 static void __init free_dma_resources(void)
drivers/iommu/intel-iommu.c+2−2
@@ -4108,7 +4108,7 @@ static void swap_pci_ref(struct pci_dev **from, struct pci_dev *to) · 4107 unmodified lines
41084108 static int intel_iommu_add_device(struct device *dev)
41094109 {
41104110 struct pci_dev *pdev = to_pci_dev(dev);
4111− struct pci_dev *bridge, *dma_pdev;
4111+ struct pci_dev *bridge, *dma_pdev = NULL;
41124112 struct iommu_group *group;
41134113 int ret;
41144114
@@ -4122,7 +4122,7 @@ static int intel_iommu_add_device(struct device *dev) · 7 unmodified lines
41224122 dma_pdev = pci_get_domain_bus_and_slot(
41234123 pci_domain_nr(pdev->bus),
41244124 bridge->subordinate->number, 0);
4125− else
4125+ if (!dma_pdev)
41264126 dma_pdev = pci_dev_get(bridge);
41274127 } else
41284128 dma_pdev = pci_dev_get(pdev);
drivers/iommu/tegra-smmu.c+2−1
@@ -200,7 +200,7 @@ enum { · 199 unmodified lines
200200
201201 #define SMMU_ADDR_TO_PFN(addr) ((addr) >> 12)
202202 #define SMMU_ADDR_TO_PDN(addr) ((addr) >> 22)
203−#define SMMU_PDN_TO_ADDR(addr) ((pdn) << 22)
203+#define SMMU_PDN_TO_ADDR(pdn) ((pdn) << 22)
204204
205205 #define _READABLE (1 << SMMU_PTB_DATA_ASID_READABLE_SHIFT)
206206 #define _WRITABLE (1 << SMMU_PTB_DATA_ASID_WRITABLE_SHIFT)
@@ -1054,6 +1054,7 @@ static int smmu_debugfs_stats_show(struct seq_file *s, void *v) · 847 unmodified lines
10541054 stats[i], val, offs);
10551055 }
10561056 seq_printf(s, "\n");
1057+ dput(dent);
10571058
10581059 return 0;
10591060 }
drivers/irqchip/irq-bcm2835.c+2−1
@@ -168,7 +168,8 @@ static int __init armctrl_of_init(struct device_node *node, · 167 unmodified lines
168168 }
169169
170170 static struct of_device_id irq_of_match[] __initconst = {
171− { .compatible = "brcm,bcm2835-armctrl-ic", .data = armctrl_of_init }
171+ { .compatible = "brcm,bcm2835-armctrl-ic", .data = armctrl_of_init },
172+ { }
172173 };
173174
174175 void __init bcm2835_init_irq(void)
drivers/isdn/Kconfig+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44
55 menuconfig ISDN
66 bool "ISDN support"
7− depends on NET
7+ depends on NET && NETDEVICES
88 depends on !S390 && !UML
99 ---help---
1010 ISDN ("Integrated Services Digital Network", called RNIS in France)
drivers/isdn/gigaset/bas-gigaset.c+16−3
@@ -617,7 +617,13 @@ static void int_in_work(struct work_struct *work) · 616 unmodified lines
617617 if (rc == 0)
618618 /* success, resubmit interrupt read URB */
619619 rc = usb_submit_urb(urb, GFP_ATOMIC);
620− if (rc != 0 && rc != -ENODEV) {
620+
621+ switch (rc) {
622+ case 0: /* success */
623+ case -ENODEV: /* device gone */
624+ case -EINVAL: /* URB already resubmitted, or terminal badness */
625+ break;
626+ default: /* failure: try to recover by resetting the device */
621627 dev_err(cs->dev, "clear halt failed: %s\n", get_usb_rcmsg(rc));
622628 rc = usb_lock_device_for_reset(ucs->udev, ucs->interface);
623629 if (rc == 0) {
@@ -2442,7 +2448,9 @@ static void gigaset_disconnect(struct usb_interface *interface) · 1818 unmodified lines
24422448 }
24432449
24442450 /* gigaset_suspend
2445− * This function is called before the USB connection is suspended.
2451+ * This function is called before the USB connection is suspended
2452+ * or before the USB device is reset.
2453+ * In the latter case, message == PMSG_ON.
24462454 */
24472455 static int gigaset_suspend(struct usb_interface *intf, pm_message_t message)
24482456 {
@@ -2498,7 +2506,12 @@ static int gigaset_suspend(struct usb_interface *intf, pm_message_t message) · 49 unmodified lines
24982506 del_timer_sync(&ucs->timer_atrdy);
24992507 del_timer_sync(&ucs->timer_cmd_in);
25002508 del_timer_sync(&ucs->timer_int_in);
2501− cancel_work_sync(&ucs->int_in_wq);
2509+
2510+ /* don't try to cancel int_in_wq from within reset as it
2511+ * might be the one requesting the reset
2512+ */
2513+ if (message.event != PM_EVENT_ON)
2514+ cancel_work_sync(&ucs->int_in_wq);
25022515
25032516 gig_dbg(DEBUG_SUSPEND, "suspend complete");
25042517 return 0;
drivers/isdn/i4l/Kconfig+1−1
@@ -6,7 +6,7 @@ if ISDN_I4L · 5 unmodified lines
66
77 config ISDN_PPP
88 bool "Support synchronous PPP"
9− depends on INET && NETDEVICES
9+ depends on INET
1010 select SLHC
1111 help
1212 Over digital connections such as ISDN, there is no need to
drivers/isdn/i4l/isdn_common.c+0−4
@@ -1312,7 +1312,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg) · 1311 unmodified lines
13121312 } else
13131313 return -EINVAL;
13141314 break;
1315−#ifdef CONFIG_NETDEVICES
13161315 case IIOCNETGPN:
13171316 /* Get peer phone number of a connected
13181317 * isdn network interface */
@@ -1322,7 +1321,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg) · 3 unmodified lines
13221321 return isdn_net_getpeer(&phone, argp);
13231322 } else
13241323 return -EINVAL;
1325−#endif
13261324 default:
13271325 return -EINVAL;
13281326 }
@@ -1352,7 +1350,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg) · 23 unmodified lines
13521350 case IIOCNETLCR:
13531351 printk(KERN_INFO "INFO: ISDN_ABC_LCR_SUPPORT not enabled\n");
13541352 return -ENODEV;
1355−#ifdef CONFIG_NETDEVICES
13561353 case IIOCNETAIF:
13571354 /* Add a network-interface */
13581355 if (arg) {
@@ -1491,7 +1488,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg) · 132 unmodified lines
14911488 return -EFAULT;
14921489 return isdn_net_force_hangup(name);
14931490 break;
1494−#endif /* CONFIG_NETDEVICES */
14951491 case IIOCSETVER:
14961492 dev->net_verbose = arg;
14971493 printk(KERN_INFO "isdn: Verbose-Level is %d\n", dev->net_verbose);
drivers/leds/ledtrig-cpu.c+0−21
@@ -33,8 +33,6 @@ · 32 unmodified lines
3333 struct led_trigger_cpu {
3434 char name[MAX_NAME_LEN];
3535 struct led_trigger *_trig;
36− struct mutex lock;
37− int lock_is_inited;
3836 };
3937
4038 static DEFINE_PER_CPU(struct led_trigger_cpu, cpu_trig);
@@ -50,12 +48,6 @@ void ledtrig_cpu(enum cpu_led_event ledevt) · 9 unmodified lines
5048 {
5149 struct led_trigger_cpu *trig = &__get_cpu_var(cpu_trig);
5250
53− /* mutex lock should be initialized before calling mutex_call() */
54− if (!trig->lock_is_inited)
55− return;
56−
57− mutex_lock(&trig->lock);
58−
5951 /* Locate the correct CPU LED */
6052 switch (ledevt) {
6153 case CPU_LED_IDLE_END:
@@ -75,8 +67,6 @@ void ledtrig_cpu(enum cpu_led_event ledevt) · 13 unmodified lines
7567 /* Will leave the LED as it is */
7668 break;
7769 }
78−
79− mutex_unlock(&trig->lock);
8070 }
8171 EXPORT_SYMBOL(ledtrig_cpu);
8272
@@ -117,14 +107,9 @@ static int __init ledtrig_cpu_init(void) · 34 unmodified lines
117107 for_each_possible_cpu(cpu) {
118108 struct led_trigger_cpu *trig = &per_cpu(cpu_trig, cpu);
119109
120− mutex_init(&trig->lock);
121−
122110 snprintf(trig->name, MAX_NAME_LEN, "cpu%d", cpu);
123111
124− mutex_lock(&trig->lock);
125112 led_trigger_register_simple(trig->name, &trig->_trig);
126− trig->lock_is_inited = 1;
127− mutex_unlock(&trig->lock);
128113 }
129114
130115 register_syscore_ops(&ledtrig_cpu_syscore_ops);
@@ -142,15 +127,9 @@ static void __exit ledtrig_cpu_exit(void) · 11 unmodified lines
142127 for_each_possible_cpu(cpu) {
143128 struct led_trigger_cpu *trig = &per_cpu(cpu_trig, cpu);
144129
145− mutex_lock(&trig->lock);
146−
147130 led_trigger_unregister_simple(trig->_trig);
148131 trig->_trig = NULL;
149132 memset(trig->name, 0, MAX_NAME_LEN);
150− trig->lock_is_inited = 0;
151−
152− mutex_unlock(&trig->lock);
153− mutex_destroy(&trig->lock);
154133 }
155134
156135 unregister_syscore_ops(&ledtrig_cpu_syscore_ops);
drivers/md/dm.c+7−1
@@ -740,8 +740,14 @@ static void rq_completed(struct mapped_device *md, int rw, int run_queue) · 739 unmodified lines
740740 if (!md_in_flight(md))
741741 wake_up(&md->wait);
742742
743+ /*
744+ * Run this off this callpath, as drivers could invoke end_io while
745+ * inside their request_fn (and holding the queue lock). Calling
746+ * back into ->request_fn() could deadlock attempting to grab the
747+ * queue lock again.
748+ */
743749 if (run_queue)
744− blk_run_queue(md->queue);
750+ blk_run_queue_async(md->queue);
745751
746752 /*
747753 * dm_put() must be at the end of this function. See the comment above
drivers/md/faulty.c+4−1
@@ -315,8 +315,11 @@ static int run(struct mddev *mddev) · 314 unmodified lines
315315 }
316316 conf->nfaults = 0;
317317
318− rdev_for_each(rdev, mddev)
318+ rdev_for_each(rdev, mddev) {
319319 conf->rdev = rdev;
320+ disk_stack_limits(mddev->gendisk, rdev->bdev,
321+ rdev->data_offset << 9);
322+ }
320323
321324 md_set_array_sectors(mddev, faulty_size(mddev, 0, 0));
322325 mddev->private = conf;
drivers/md/md.c+20−7
@@ -1817,10 +1817,10 @@ retry: · 1816 unmodified lines
18171817 memset(bbp, 0xff, PAGE_SIZE);
18181818
18191819 for (i = 0 ; i < bb->count ; i++) {
1820− u64 internal_bb = *p++;
1820+ u64 internal_bb = p[i];
18211821 u64 store_bb = ((BB_OFFSET(internal_bb) << 10)
18221822 | BB_LEN(internal_bb));
1823− *bbp++ = cpu_to_le64(store_bb);
1823+ bbp[i] = cpu_to_le64(store_bb);
18241824 }
18251825 bb->changed = 0;
18261826 if (read_seqretry(&bb->lock, seq))
@@ -5294,7 +5294,7 @@ void md_stop_writes(struct mddev *mddev) · 3467 unmodified lines
52945294 }
52955295 EXPORT_SYMBOL_GPL(md_stop_writes);
52965296
5297−void md_stop(struct mddev *mddev)
5297+static void __md_stop(struct mddev *mddev)
52985298 {
52995299 mddev->ready = 0;
53005300 mddev->pers->stop(mddev);
@@ -5304,6 +5304,18 @@ void md_stop(struct mddev *mddev) · 3 unmodified lines
53045304 mddev->pers = NULL;
53055305 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
53065306 }
5307+
5308+void md_stop(struct mddev *mddev)
5309+{
5310+ /* stop the array and free an attached data structures.
5311+ * This is called from dm-raid
5312+ */
5313+ __md_stop(mddev);
5314+ bitmap_destroy(mddev);
5315+ if (mddev->bio_set)
5316+ bioset_free(mddev->bio_set);
5317+}
5318+
53075319 EXPORT_SYMBOL_GPL(md_stop);
53085320
53095321 static int md_set_readonly(struct mddev *mddev, struct block_device *bdev)
@@ -5364,7 +5376,7 @@ static int do_md_stop(struct mddev * mddev, int mode, · 54 unmodified lines
53645376 set_disk_ro(disk, 0);
53655377
53665378 __md_stop_writes(mddev);
5367− md_stop(mddev);
5379+ __md_stop(mddev);
53685380 mddev->queue->merge_bvec_fn = NULL;
53695381 mddev->queue->backing_dev_info.congested_fn = NULL;
53705382
@@ -7936,9 +7948,9 @@ int md_is_badblock(struct badblocks *bb, sector_t s, int sectors, · 2565 unmodified lines
79367948 sector_t *first_bad, int *bad_sectors)
79377949 {
79387950 int hi;
7939− int lo = 0;
7951+ int lo;
79407952 u64 *p = bb->page;
7941− int rv = 0;
7953+ int rv;
79427954 sector_t target = s + sectors;
79437955 unsigned seq;
79447956
@@ -7953,7 +7965,8 @@ int md_is_badblock(struct badblocks *bb, sector_t s, int sectors, · 8 unmodified lines
79537965
79547966 retry:
79557967 seq = read_seqbegin(&bb->lock);
7956−
7968+ lo = 0;
7969+ rv = 0;
79577970 hi = bb->count;
79587971
79597972 /* Binary search between lo and hi for 'target'
drivers/md/raid1.c+2−2
@@ -963,7 +963,7 @@ static void raid1_unplug(struct blk_plug_cb *cb, bool from_schedule) · 962 unmodified lines
963963 struct r1conf *conf = mddev->private;
964964 struct bio *bio;
965965
966− if (from_schedule) {
966+ if (from_schedule || current->bio_list) {
967967 spin_lock_irq(&conf->device_lock);
968968 bio_list_merge(&conf->pending_bio_list, &plug->pending);
969969 conf->pending_count += plug->pending_cnt;
@@ -2710,7 +2710,7 @@ static struct r1conf *setup_conf(struct mddev *mddev) · 1740 unmodified lines
27102710 || disk_idx < 0)
27112711 continue;
27122712 if (test_bit(Replacement, &rdev->flags))
2713− disk = conf->mirrors + conf->raid_disks + disk_idx;
2713+ disk = conf->mirrors + mddev->raid_disks + disk_idx;
27142714 else
27152715 disk = conf->mirrors + disk_idx;
27162716
drivers/md/raid10.c+79−69
@@ -499,7 +499,7 @@ static void raid10_end_write_request(struct bio *bio, int error) · 498 unmodified lines
499499 */
500500 one_write_done(r10_bio);
501501 if (dec_rdev)
502− rdev_dec_pending(conf->mirrors[dev].rdev, conf->mddev);
502+ rdev_dec_pending(rdev, conf->mddev);
503503 }
504504
505505 /*
@@ -1069,7 +1069,7 @@ static void raid10_unplug(struct blk_plug_cb *cb, bool from_schedule) · 563 unmodified lines
10691069 struct r10conf *conf = mddev->private;
10701070 struct bio *bio;
10711071
1072− if (from_schedule) {
1072+ if (from_schedule || current->bio_list) {
10731073 spin_lock_irq(&conf->device_lock);
10741074 bio_list_merge(&conf->pending_bio_list, &plug->pending);
10751075 conf->pending_count += plug->pending_cnt;
@@ -1334,18 +1334,21 @@ retry_write: · 258 unmodified lines
13341334 blocked_rdev = rrdev;
13351335 break;
13361336 }
1337+ if (rdev && (test_bit(Faulty, &rdev->flags)
1338+ || test_bit(Unmerged, &rdev->flags)))
1339+ rdev = NULL;
13371340 if (rrdev && (test_bit(Faulty, &rrdev->flags)
13381341 || test_bit(Unmerged, &rrdev->flags)))
13391342 rrdev = NULL;
13401343
13411344 r10_bio->devs[i].bio = NULL;
13421345 r10_bio->devs[i].repl_bio = NULL;
1343− if (!rdev || test_bit(Faulty, &rdev->flags) ||
1344− test_bit(Unmerged, &rdev->flags)) {
1346+
1347+ if (!rdev && !rrdev) {
13451348 set_bit(R10BIO_Degraded, &r10_bio->state);
13461349 continue;
13471350 }
1348− if (test_bit(WriteErrorSeen, &rdev->flags)) {
1351+ if (rdev && test_bit(WriteErrorSeen, &rdev->flags)) {
13491352 sector_t first_bad;
13501353 sector_t dev_sector = r10_bio->devs[i].addr;
13511354 int bad_sectors;
@@ -1387,8 +1390,10 @@ retry_write: · 35 unmodified lines
13871390 max_sectors = good_sectors;
13881391 }
13891392 }
1390− r10_bio->devs[i].bio = bio;
1391− atomic_inc(&rdev->nr_pending);
1393+ if (rdev) {
1394+ r10_bio->devs[i].bio = bio;
1395+ atomic_inc(&rdev->nr_pending);
1396+ }
13921397 if (rrdev) {
13931398 r10_bio->devs[i].repl_bio = bio;
13941399 atomic_inc(&rrdev->nr_pending);
@@ -1444,69 +1449,71 @@ retry_write: · 49 unmodified lines
14441449 for (i = 0; i < conf->copies; i++) {
14451450 struct bio *mbio;
14461451 int d = r10_bio->devs[i].devnum;
1447− if (!r10_bio->devs[i].bio)
1448− continue;
1452+ if (r10_bio->devs[i].bio) {
1453+ struct md_rdev *rdev = conf->mirrors[d].rdev;
1454+ mbio = bio_clone_mddev(bio, GFP_NOIO, mddev);
1455+ md_trim_bio(mbio, r10_bio->sector - bio->bi_sector,
1456+ max_sectors);
1457+ r10_bio->devs[i].bio = mbio;
1458+
1459+ mbio->bi_sector = (r10_bio->devs[i].addr+
1460+ choose_data_offset(r10_bio,
1461+ rdev));
1462+ mbio->bi_bdev = rdev->bdev;
1463+ mbio->bi_end_io = raid10_end_write_request;
1464+ mbio->bi_rw = WRITE | do_sync | do_fua | do_discard;
1465+ mbio->bi_private = r10_bio;
14491466
1450− mbio = bio_clone_mddev(bio, GFP_NOIO, mddev);
1451− md_trim_bio(mbio, r10_bio->sector - bio->bi_sector,
1452− max_sectors);
1453− r10_bio->devs[i].bio = mbio;
1467+ atomic_inc(&r10_bio->remaining);
14541468
1455− mbio->bi_sector = (r10_bio->devs[i].addr+
1456− choose_data_offset(r10_bio,
1457− conf->mirrors[d].rdev));
1458− mbio->bi_bdev = conf->mirrors[d].rdev->bdev;
1459− mbio->bi_end_io = raid10_end_write_request;
1460− mbio->bi_rw = WRITE | do_sync | do_fua | do_discard;
1461− mbio->bi_private = r10_bio;
1469+ cb = blk_check_plugged(raid10_unplug, mddev,
1470+ sizeof(*plug));
1471+ if (cb)
1472+ plug = container_of(cb, struct raid10_plug_cb,
1473+ cb);
1474+ else
1475+ plug = NULL;
1476+ spin_lock_irqsave(&conf->device_lock, flags);
1477+ if (plug) {
1478+ bio_list_add(&plug->pending, mbio);
1479+ plug->pending_cnt++;
1480+ } else {
1481+ bio_list_add(&conf->pending_bio_list, mbio);
1482+ conf->pending_count++;
1483+ }
1484+ spin_unlock_irqrestore(&conf->device_lock, flags);
1485+ if (!plug)
1486+ md_wakeup_thread(mddev->thread);
1487+ }
14621488
1463− atomic_inc(&r10_bio->remaining);
1489+ if (r10_bio->devs[i].repl_bio) {
1490+ struct md_rdev *rdev = conf->mirrors[d].replacement;
1491+ if (rdev == NULL) {
1492+ /* Replacement just got moved to main 'rdev' */
1493+ smp_mb();
1494+ rdev = conf->mirrors[d].rdev;
1495+ }
1496+ mbio = bio_clone_mddev(bio, GFP_NOIO, mddev);
1497+ md_trim_bio(mbio, r10_bio->sector - bio->bi_sector,
1498+ max_sectors);
1499+ r10_bio->devs[i].repl_bio = mbio;
1500+
1501+ mbio->bi_sector = (r10_bio->devs[i].addr +
1502+ choose_data_offset(
1503+ r10_bio, rdev));
1504+ mbio->bi_bdev = rdev->bdev;
1505+ mbio->bi_end_io = raid10_end_write_request;
1506+ mbio->bi_rw = WRITE | do_sync | do_fua | do_discard;
1507+ mbio->bi_private = r10_bio;
14641508
1465− cb = blk_check_plugged(raid10_unplug, mddev, sizeof(*plug));
1466− if (cb)
1467− plug = container_of(cb, struct raid10_plug_cb, cb);
1468− else
1469− plug = NULL;
1470− spin_lock_irqsave(&conf->device_lock, flags);
1471− if (plug) {
1472− bio_list_add(&plug->pending, mbio);
1473− plug->pending_cnt++;
1474− } else {
1509+ atomic_inc(&r10_bio->remaining);
1510+ spin_lock_irqsave(&conf->device_lock, flags);
14751511 bio_list_add(&conf->pending_bio_list, mbio);
14761512 conf->pending_count++;
1513+ spin_unlock_irqrestore(&conf->device_lock, flags);
1514+ if (!mddev_check_plugged(mddev))
1515+ md_wakeup_thread(mddev->thread);
14771516 }
1478− spin_unlock_irqrestore(&conf->device_lock, flags);
1479− if (!plug)
1480− md_wakeup_thread(mddev->thread);
1481−
1482− if (!r10_bio->devs[i].repl_bio)
1483− continue;
1484−
1485− mbio = bio_clone_mddev(bio, GFP_NOIO, mddev);
1486− md_trim_bio(mbio, r10_bio->sector - bio->bi_sector,
1487− max_sectors);
1488− r10_bio->devs[i].repl_bio = mbio;
1489−
1490− /* We are actively writing to the original device
1491− * so it cannot disappear, so the replacement cannot
1492− * become NULL here
1493− */
1494− mbio->bi_sector = (r10_bio->devs[i].addr +
1495− choose_data_offset(
1496− r10_bio,
1497− conf->mirrors[d].replacement));
1498− mbio->bi_bdev = conf->mirrors[d].replacement->bdev;
1499− mbio->bi_end_io = raid10_end_write_request;
1500− mbio->bi_rw = WRITE | do_sync | do_fua | do_discard;
1501− mbio->bi_private = r10_bio;
1502−
1503− atomic_inc(&r10_bio->remaining);
1504− spin_lock_irqsave(&conf->device_lock, flags);
1505− bio_list_add(&conf->pending_bio_list, mbio);
1506− conf->pending_count++;
1507− spin_unlock_irqrestore(&conf->device_lock, flags);
1508− if (!mddev_check_plugged(mddev))
1509− md_wakeup_thread(mddev->thread);
15101517 }
15111518
15121519 /* Don't remove the bias on 'remaining' (one_write_done) until
@@ -1783,7 +1790,7 @@ static int raid10_add_disk(struct mddev *mddev, struct md_rdev *rdev) · 270 unmodified lines
17831790 clear_bit(Unmerged, &rdev->flags);
17841791 }
17851792 md_integrity_add_rdev(rdev, mddev);
1786− if (blk_queue_discard(bdev_get_queue(rdev->bdev)))
1793+ if (mddev->queue && blk_queue_discard(bdev_get_queue(rdev->bdev)))
17871794 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
17881795
17891796 print_conf(conf);
@@ -3613,11 +3620,14 @@ static int run(struct mddev *mddev) · 1823 unmodified lines
36133620 discard_supported = true;
36143621 }
36153622
3616− if (discard_supported)
3617− queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
3618− else
3619− queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
3620−
3623+ if (mddev->queue) {
3624+ if (discard_supported)
3625+ queue_flag_set_unlocked(QUEUE_FLAG_DISCARD,
3626+ mddev->queue);
3627+ else
3628+ queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD,
3629+ mddev->queue);
3630+ }
36213631 /* need to check that every block has at least one working mirror */
36223632 if (!enough(conf, -1)) {
36233633 printk(KERN_ERR "md/raid10:%s: not enough operational mirrors.\n",
drivers/md/raid5.c+43−36
@@ -2774,10 +2774,12 @@ static void handle_stripe_clean_event(struct r5conf *conf, · 2773 unmodified lines
27742774 dev = &sh->dev[i];
27752775 if (!test_bit(R5_LOCKED, &dev->flags) &&
27762776 (test_bit(R5_UPTODATE, &dev->flags) ||
2777− test_and_clear_bit(R5_Discard, &dev->flags))) {
2777+ test_bit(R5_Discard, &dev->flags))) {
27782778 /* We can return any write requests */
27792779 struct bio *wbi, *wbi2;
27802780 pr_debug("Return write for disc %d\n", i);
2781+ if (test_and_clear_bit(R5_Discard, &dev->flags))
2782+ clear_bit(R5_UPTODATE, &dev->flags);
27812783 wbi = dev->written;
27822784 dev->written = NULL;
27832785 while (wbi && wbi->bi_sector <
@@ -2795,7 +2797,8 @@ static void handle_stripe_clean_event(struct r5conf *conf, · 11 unmodified lines
27952797 !test_bit(STRIPE_DEGRADED, &sh->state),
27962798 0);
27972799 }
2798− }
2800+ } else if (test_bit(R5_Discard, &sh->dev[i].flags))
2801+ clear_bit(R5_Discard, &sh->dev[i].flags);
27992802
28002803 if (test_and_clear_bit(STRIPE_FULL_WRITE, &sh->state))
28012804 if (atomic_dec_and_test(&conf->pending_full_writes))
@@ -3490,40 +3493,6 @@ static void handle_stripe(struct stripe_head *sh) · 688 unmodified lines
34903493 handle_failed_sync(conf, sh, &s);
34913494 }
34923495
3493− /*
3494− * might be able to return some write requests if the parity blocks
3495− * are safe, or on a failed drive
3496− */
3497− pdev = &sh->dev[sh->pd_idx];
3498− s.p_failed = (s.failed >= 1 && s.failed_num[0] == sh->pd_idx)
3499− || (s.failed >= 2 && s.failed_num[1] == sh->pd_idx);
3500− qdev = &sh->dev[sh->qd_idx];
3501− s.q_failed = (s.failed >= 1 && s.failed_num[0] == sh->qd_idx)
3502− || (s.failed >= 2 && s.failed_num[1] == sh->qd_idx)
3503− || conf->level < 6;
3504−
3505− if (s.written &&
3506− (s.p_failed || ((test_bit(R5_Insync, &pdev->flags)
3507− && !test_bit(R5_LOCKED, &pdev->flags)
3508− && (test_bit(R5_UPTODATE, &pdev->flags) ||
3509− test_bit(R5_Discard, &pdev->flags))))) &&
3510− (s.q_failed || ((test_bit(R5_Insync, &qdev->flags)
3511− && !test_bit(R5_LOCKED, &qdev->flags)
3512− && (test_bit(R5_UPTODATE, &qdev->flags) ||
3513− test_bit(R5_Discard, &qdev->flags))))))
3514− handle_stripe_clean_event(conf, sh, disks, &s.return_bi);
3515−
3516− /* Now we might consider reading some blocks, either to check/generate
3517− * parity, or to satisfy requests
3518− * or to load a block that is being partially written.
3519− */
3520− if (s.to_read || s.non_overwrite
3521− || (conf->level == 6 && s.to_write && s.failed)
3522− || (s.syncing && (s.uptodate + s.compute < disks))
3523− || s.replacing
3524− || s.expanding)
3525− handle_stripe_fill(sh, &s, disks);
3526−
35273496 /* Now we check to see if any write operations have recently
35283497 * completed
35293498 */
@@ -3561,6 +3530,40 @@ static void handle_stripe(struct stripe_head *sh) · 31 unmodified lines
35613530 s.dec_preread_active = 1;
35623531 }
35633532
3533+ /*
3534+ * might be able to return some write requests if the parity blocks
3535+ * are safe, or on a failed drive
3536+ */
3537+ pdev = &sh->dev[sh->pd_idx];
3538+ s.p_failed = (s.failed >= 1 && s.failed_num[0] == sh->pd_idx)
3539+ || (s.failed >= 2 && s.failed_num[1] == sh->pd_idx);
3540+ qdev = &sh->dev[sh->qd_idx];
3541+ s.q_failed = (s.failed >= 1 && s.failed_num[0] == sh->qd_idx)
3542+ || (s.failed >= 2 && s.failed_num[1] == sh->qd_idx)
3543+ || conf->level < 6;
3544+
3545+ if (s.written &&
3546+ (s.p_failed || ((test_bit(R5_Insync, &pdev->flags)
3547+ && !test_bit(R5_LOCKED, &pdev->flags)
3548+ && (test_bit(R5_UPTODATE, &pdev->flags) ||
3549+ test_bit(R5_Discard, &pdev->flags))))) &&
3550+ (s.q_failed || ((test_bit(R5_Insync, &qdev->flags)
3551+ && !test_bit(R5_LOCKED, &qdev->flags)
3552+ && (test_bit(R5_UPTODATE, &qdev->flags) ||
3553+ test_bit(R5_Discard, &qdev->flags))))))
3554+ handle_stripe_clean_event(conf, sh, disks, &s.return_bi);
3555+
3556+ /* Now we might consider reading some blocks, either to check/generate
3557+ * parity, or to satisfy requests
3558+ * or to load a block that is being partially written.
3559+ */
3560+ if (s.to_read || s.non_overwrite
3561+ || (conf->level == 6 && s.to_write && s.failed)
3562+ || (s.syncing && (s.uptodate + s.compute < disks))
3563+ || s.replacing
3564+ || s.expanding)
3565+ handle_stripe_fill(sh, &s, disks);
3566+
35643567 /* Now to consider new write requests and what else, if anything
35653568 * should be read. We do not handle new writes when:
35663569 * 1/ A 'write' operation (copy+xor) is already in flight.
@@ -5529,6 +5532,10 @@ static int run(struct mddev *mddev) · 1962 unmodified lines
55295532 * discard data disk but write parity disk
55305533 */
55315534 stripe = stripe * PAGE_SIZE;
5535+ /* Round up to power of 2, as discard handling
5536+ * currently assumes that */
5537+ while ((stripe-1) & stripe)
5538+ stripe = (stripe | (stripe-1)) + 1;
55325539 mddev->queue->limits.discard_alignment = stripe;
55335540 mddev->queue->limits.discard_granularity = stripe;
55345541 /*
drivers/media/dvb-frontends/stv0900_core.c+3−3
@@ -300,15 +300,15 @@ static enum fe_stv0900_error stv0900_set_mclk(struct stv0900_internal *intp, u32 · 299 unmodified lines
300300 {
301301 u32 m_div, clk_sel;
302302
303− dprintk("%s: Mclk set to %d, Quartz = %d\n", __func__, mclk,
304− intp->quartz);
305−
306303 if (intp == NULL)
307304 return STV0900_INVALID_HANDLE;
308305
309306 if (intp->errs)
310307 return STV0900_I2C_ERROR;
311308
309+ dprintk("%s: Mclk set to %d, Quartz = %d\n", __func__, mclk,
310+ intp->quartz);
311+
312312 clk_sel = ((stv0900_get_bits(intp, F0900_SELX1RATIO) == 1) ? 4 : 6);
313313 m_div = ((clk_sel * mclk) / intp->quartz) - 1;
314314 stv0900_write_bits(intp, F0900_M_DIV, m_div);
drivers/media/i2c/adv7604.c+272−105
@@ -53,8 +53,7 @@ MODULE_LICENSE("GPL"); · 52 unmodified lines
5353 /* ADV7604 system clock frequency */
5454 #define ADV7604_fsc (28636360)
5555
56−#define DIGITAL_INPUT ((state->prim_mode == ADV7604_PRIM_MODE_HDMI_COMP) || \
57− (state->prim_mode == ADV7604_PRIM_MODE_HDMI_GR))
56+#define DIGITAL_INPUT (state->mode == ADV7604_MODE_HDMI)
5857
5958 /*
6059 **********************************************************************
@@ -68,7 +67,7 @@ struct adv7604_state { · 7 unmodified lines
6867 struct v4l2_subdev sd;
6968 struct media_pad pad;
7069 struct v4l2_ctrl_handler hdl;
71− enum adv7604_prim_mode prim_mode;
70+ enum adv7604_mode mode;
7271 struct v4l2_dv_timings timings;
7372 u8 edid[256];
7473 unsigned edid_blocks;
@@ -77,6 +76,7 @@ struct adv7604_state { · 2 unmodified lines
7776 struct workqueue_struct *work_queues;
7877 struct delayed_work delayed_work_enable_hotplug;
7978 bool connector_hdmi;
79+ bool restart_stdi_once;
8080
8181 /* i2c clients */
8282 struct i2c_client *i2c_avlink;
@@ -106,7 +106,6 @@ static const struct v4l2_dv_timings adv7604_timings[] = { · 23 unmodified lines
106106 V4L2_DV_BT_CEA_720X576P50,
107107 V4L2_DV_BT_CEA_1280X720P24,
108108 V4L2_DV_BT_CEA_1280X720P25,
109− V4L2_DV_BT_CEA_1280X720P30,
110109 V4L2_DV_BT_CEA_1280X720P50,
111110 V4L2_DV_BT_CEA_1280X720P60,
112111 V4L2_DV_BT_CEA_1920X1080P24,
@@ -115,6 +114,7 @@ static const struct v4l2_dv_timings adv7604_timings[] = { · 2 unmodified lines
115114 V4L2_DV_BT_CEA_1920X1080P50,
116115 V4L2_DV_BT_CEA_1920X1080P60,
117116
117+ /* sorted by DMT ID */
118118 V4L2_DV_BT_DMT_640X350P85,
119119 V4L2_DV_BT_DMT_640X400P85,
120120 V4L2_DV_BT_DMT_720X400P85,
@@ -164,6 +164,89 @@ static const struct v4l2_dv_timings adv7604_timings[] = { · 43 unmodified lines
164164 { },
165165 };
166166
167+struct adv7604_video_standards {
168+ struct v4l2_dv_timings timings;
169+ u8 vid_std;
170+ u8 v_freq;
171+};
172+
173+/* sorted by number of lines */
174+static const struct adv7604_video_standards adv7604_prim_mode_comp[] = {
175+ /* { V4L2_DV_BT_CEA_720X480P59_94, 0x0a, 0x00 }, TODO flickering */
176+ { V4L2_DV_BT_CEA_720X576P50, 0x0b, 0x00 },
177+ { V4L2_DV_BT_CEA_1280X720P50, 0x19, 0x01 },
178+ { V4L2_DV_BT_CEA_1280X720P60, 0x19, 0x00 },
179+ { V4L2_DV_BT_CEA_1920X1080P24, 0x1e, 0x04 },
180+ { V4L2_DV_BT_CEA_1920X1080P25, 0x1e, 0x03 },
181+ { V4L2_DV_BT_CEA_1920X1080P30, 0x1e, 0x02 },
182+ { V4L2_DV_BT_CEA_1920X1080P50, 0x1e, 0x01 },
183+ { V4L2_DV_BT_CEA_1920X1080P60, 0x1e, 0x00 },
184+ /* TODO add 1920x1080P60_RB (CVT timing) */
185+ { },
186+};
187+
188+/* sorted by number of lines */
189+static const struct adv7604_video_standards adv7604_prim_mode_gr[] = {
190+ { V4L2_DV_BT_DMT_640X480P60, 0x08, 0x00 },
191+ { V4L2_DV_BT_DMT_640X480P72, 0x09, 0x00 },
192+ { V4L2_DV_BT_DMT_640X480P75, 0x0a, 0x00 },
193+ { V4L2_DV_BT_DMT_640X480P85, 0x0b, 0x00 },
194+ { V4L2_DV_BT_DMT_800X600P56, 0x00, 0x00 },
195+ { V4L2_DV_BT_DMT_800X600P60, 0x01, 0x00 },
196+ { V4L2_DV_BT_DMT_800X600P72, 0x02, 0x00 },
197+ { V4L2_DV_BT_DMT_800X600P75, 0x03, 0x00 },
198+ { V4L2_DV_BT_DMT_800X600P85, 0x04, 0x00 },
199+ { V4L2_DV_BT_DMT_1024X768P60, 0x0c, 0x00 },
200+ { V4L2_DV_BT_DMT_1024X768P70, 0x0d, 0x00 },
201+ { V4L2_DV_BT_DMT_1024X768P75, 0x0e, 0x00 },
202+ { V4L2_DV_BT_DMT_1024X768P85, 0x0f, 0x00 },
203+ { V4L2_DV_BT_DMT_1280X1024P60, 0x05, 0x00 },
204+ { V4L2_DV_BT_DMT_1280X1024P75, 0x06, 0x00 },
205+ { V4L2_DV_BT_DMT_1360X768P60, 0x12, 0x00 },
206+ { V4L2_DV_BT_DMT_1366X768P60, 0x13, 0x00 },
207+ { V4L2_DV_BT_DMT_1400X1050P60, 0x14, 0x00 },
208+ { V4L2_DV_BT_DMT_1400X1050P75, 0x15, 0x00 },
209+ { V4L2_DV_BT_DMT_1600X1200P60, 0x16, 0x00 }, /* TODO not tested */
210+ /* TODO add 1600X1200P60_RB (not a DMT timing) */
211+ { V4L2_DV_BT_DMT_1680X1050P60, 0x18, 0x00 },
212+ { V4L2_DV_BT_DMT_1920X1200P60_RB, 0x19, 0x00 }, /* TODO not tested */
213+ { },
214+};
215+
216+/* sorted by number of lines */
217+static const struct adv7604_video_standards adv7604_prim_mode_hdmi_comp[] = {
218+ { V4L2_DV_BT_CEA_720X480P59_94, 0x0a, 0x00 },
219+ { V4L2_DV_BT_CEA_720X576P50, 0x0b, 0x00 },
220+ { V4L2_DV_BT_CEA_1280X720P50, 0x13, 0x01 },
221+ { V4L2_DV_BT_CEA_1280X720P60, 0x13, 0x00 },
222+ { V4L2_DV_BT_CEA_1920X1080P24, 0x1e, 0x04 },
223+ { V4L2_DV_BT_CEA_1920X1080P25, 0x1e, 0x03 },
224+ { V4L2_DV_BT_CEA_1920X1080P30, 0x1e, 0x02 },
225+ { V4L2_DV_BT_CEA_1920X1080P50, 0x1e, 0x01 },
226+ { V4L2_DV_BT_CEA_1920X1080P60, 0x1e, 0x00 },
227+ { },
228+};
229+
230+/* sorted by number of lines */
231+static const struct adv7604_video_standards adv7604_prim_mode_hdmi_gr[] = {
232+ { V4L2_DV_BT_DMT_640X480P60, 0x08, 0x00 },
233+ { V4L2_DV_BT_DMT_640X480P72, 0x09, 0x00 },
234+ { V4L2_DV_BT_DMT_640X480P75, 0x0a, 0x00 },
235+ { V4L2_DV_BT_DMT_640X480P85, 0x0b, 0x00 },
236+ { V4L2_DV_BT_DMT_800X600P56, 0x00, 0x00 },
237+ { V4L2_DV_BT_DMT_800X600P60, 0x01, 0x00 },
238+ { V4L2_DV_BT_DMT_800X600P72, 0x02, 0x00 },
239+ { V4L2_DV_BT_DMT_800X600P75, 0x03, 0x00 },
240+ { V4L2_DV_BT_DMT_800X600P85, 0x04, 0x00 },
241+ { V4L2_DV_BT_DMT_1024X768P60, 0x0c, 0x00 },
242+ { V4L2_DV_BT_DMT_1024X768P70, 0x0d, 0x00 },
243+ { V4L2_DV_BT_DMT_1024X768P75, 0x0e, 0x00 },
244+ { V4L2_DV_BT_DMT_1024X768P85, 0x0f, 0x00 },
245+ { V4L2_DV_BT_DMT_1280X1024P60, 0x05, 0x00 },
246+ { V4L2_DV_BT_DMT_1280X1024P75, 0x06, 0x00 },
247+ { },
248+};
249+
167250 /* ----------------------------------------------------------------------- */
168251
169252 static inline struct adv7604_state *to_state(struct v4l2_subdev *sd)
@@ -672,64 +755,144 @@ static int adv7604_s_detect_tx_5v_ctrl(struct v4l2_subdev *sd) · 502 unmodified lines
672755 ((io_read(sd, 0x6f) & 0x10) >> 4));
673756 }
674757
675−static void configure_free_run(struct v4l2_subdev *sd, const struct v4l2_bt_timings *timings)
758+static int find_and_set_predefined_video_timings(struct v4l2_subdev *sd,
759+ u8 prim_mode,
760+ const struct adv7604_video_standards *predef_vid_timings,
761+ const struct v4l2_dv_timings *timings)
762+{
763+ struct adv7604_state *state = to_state(sd);
764+ int i;
765+
766+ for (i = 0; predef_vid_timings[i].timings.bt.width; i++) {
767+ if (!v4l_match_dv_timings(timings, &predef_vid_timings[i].timings,
768+ DIGITAL_INPUT ? 250000 : 1000000))
769+ continue;
770+ io_write(sd, 0x00, predef_vid_timings[i].vid_std); /* video std */
771+ io_write(sd, 0x01, (predef_vid_timings[i].v_freq << 4) +
772+ prim_mode); /* v_freq and prim mode */
773+ return 0;
774+ }
775+
776+ return -1;
777+}
778+
779+static int configure_predefined_video_timings(struct v4l2_subdev *sd,
780+ struct v4l2_dv_timings *timings)
676781 {
782+ struct adv7604_state *state = to_state(sd);
783+ int err;
784+
785+ v4l2_dbg(1, debug, sd, "%s", __func__);
786+
787+ /* reset to default values */
788+ io_write(sd, 0x16, 0x43);
789+ io_write(sd, 0x17, 0x5a);
790+ /* disable embedded syncs for auto graphics mode */
791+ cp_write_and_or(sd, 0x81, 0xef, 0x00);
792+ cp_write(sd, 0x8f, 0x00);
793+ cp_write(sd, 0x90, 0x00);
794+ cp_write(sd, 0xa2, 0x00);
795+ cp_write(sd, 0xa3, 0x00);
796+ cp_write(sd, 0xa4, 0x00);
797+ cp_write(sd, 0xa5, 0x00);
798+ cp_write(sd, 0xa6, 0x00);
799+ cp_write(sd, 0xa7, 0x00);
800+ cp_write(sd, 0xab, 0x00);
801+ cp_write(sd, 0xac, 0x00);
802+
803+ switch (state->mode) {
804+ case ADV7604_MODE_COMP:
805+ case ADV7604_MODE_GR:
806+ err = find_and_set_predefined_video_timings(sd,
807+ 0x01, adv7604_prim_mode_comp, timings);
808+ if (err)
809+ err = find_and_set_predefined_video_timings(sd,
810+ 0x02, adv7604_prim_mode_gr, timings);
811+ break;
812+ case ADV7604_MODE_HDMI:
813+ err = find_and_set_predefined_video_timings(sd,
814+ 0x05, adv7604_prim_mode_hdmi_comp, timings);
815+ if (err)
816+ err = find_and_set_predefined_video_timings(sd,
817+ 0x06, adv7604_prim_mode_hdmi_gr, timings);
818+ break;
819+ default:
820+ v4l2_dbg(2, debug, sd, "%s: Unknown mode %d\n",
821+ __func__, state->mode);
822+ err = -1;
823+ break;
824+ }
825+
826+
827+ return err;
828+}
829+
830+static void configure_custom_video_timings(struct v4l2_subdev *sd,
831+ const struct v4l2_bt_timings *bt)
832+{
833+ struct adv7604_state *state = to_state(sd);
677834 struct i2c_client *client = v4l2_get_subdevdata(sd);
678− u32 width = htotal(timings);
679− u32 height = vtotal(timings);
680− u16 ch1_fr_ll = (((u32)timings->pixelclock / 100) > 0) ?
681− ((width * (ADV7604_fsc / 100)) / ((u32)timings->pixelclock / 100)) : 0;
835+ u32 width = htotal(bt);
836+ u32 height = vtotal(bt);
837+ u16 cp_start_sav = bt->hsync + bt->hbackporch - 4;
838+ u16 cp_start_eav = width - bt->hfrontporch;
839+ u16 cp_start_vbi = height - bt->vfrontporch;
840+ u16 cp_end_vbi = bt->vsync + bt->vbackporch;
841+ u16 ch1_fr_ll = (((u32)bt->pixelclock / 100) > 0) ?
842+ ((width * (ADV7604_fsc / 100)) / ((u32)bt->pixelclock / 100)) : 0;
843+ const u8 pll[2] = {
844+ 0xc0 | ((width >> 8) & 0x1f),
845+ width & 0xff
846+ };
682847
683848 v4l2_dbg(2, debug, sd, "%s\n", __func__);
684849
685− cp_write(sd, 0x8f, (ch1_fr_ll >> 8) & 0x7); /* CH1_FR_LL */
686− cp_write(sd, 0x90, ch1_fr_ll & 0xff); /* CH1_FR_LL */
687− cp_write(sd, 0xab, (height >> 4) & 0xff); /* CP_LCOUNT_MAX */
688− cp_write(sd, 0xac, (height & 0x0f) << 4); /* CP_LCOUNT_MAX */
689− /* TODO support interlaced */
690− cp_write(sd, 0x91, 0x10); /* INTERLACED */
691−
692− /* Should only be set in auto-graphics mode [REF_02 p. 91-92] */
693− if ((io_read(sd, 0x00) == 0x07) && (io_read(sd, 0x01) == 0x02)) {
694− u16 cp_start_sav, cp_start_eav, cp_start_vbi, cp_end_vbi;
695− const u8 pll[2] = {
696− (0xc0 | ((width >> 8) & 0x1f)),
697− (width & 0xff)
698− };
850+ switch (state->mode) {
851+ case ADV7604_MODE_COMP:
852+ case ADV7604_MODE_GR:
853+ /* auto graphics */
854+ io_write(sd, 0x00, 0x07); /* video std */
855+ io_write(sd, 0x01, 0x02); /* prim mode */
856+ /* enable embedded syncs for auto graphics mode */
857+ cp_write_and_or(sd, 0x81, 0xef, 0x10);
699858
859+ /* Should only be set in auto-graphics mode [REF_02, p. 91-92] */
700860 /* setup PLL_DIV_MAN_EN and PLL_DIV_RATIO */
701861 /* IO-map reg. 0x16 and 0x17 should be written in sequence */
702862 if (adv_smbus_write_i2c_block_data(client, 0x16, 2, pll)) {
703863 v4l2_err(sd, "writing to reg 0x16 and 0x17 failed\n");
704− return;
864+ break;
705865 }
706866
707867 /* active video - horizontal timing */
708− cp_start_sav = timings->hsync + timings->hbackporch - 4;
709− cp_start_eav = width - timings->hfrontporch;
710868 cp_write(sd, 0xa2, (cp_start_sav >> 4) & 0xff);
711− cp_write(sd, 0xa3, ((cp_start_sav & 0x0f) << 4) | ((cp_start_eav >> 8) & 0x0f));
869+ cp_write(sd, 0xa3, ((cp_start_sav & 0x0f) << 4) |
870+ ((cp_start_eav >> 8) & 0x0f));
712871 cp_write(sd, 0xa4, cp_start_eav & 0xff);
713872
714873 /* active video - vertical timing */
715− cp_start_vbi = height - timings->vfrontporch;
716− cp_end_vbi = timings->vsync + timings->vbackporch;
717874 cp_write(sd, 0xa5, (cp_start_vbi >> 4) & 0xff);
718− cp_write(sd, 0xa6, ((cp_start_vbi & 0xf) << 4) | ((cp_end_vbi >> 8) & 0xf));
875+ cp_write(sd, 0xa6, ((cp_start_vbi & 0xf) << 4) |
876+ ((cp_end_vbi >> 8) & 0xf));
719877 cp_write(sd, 0xa7, cp_end_vbi & 0xff);
720− } else {
721− /* reset to default values */
722− io_write(sd, 0x16, 0x43);
723− io_write(sd, 0x17, 0x5a);
724− cp_write(sd, 0xa2, 0x00);
725− cp_write(sd, 0xa3, 0x00);
726− cp_write(sd, 0xa4, 0x00);
727− cp_write(sd, 0xa5, 0x00);
728− cp_write(sd, 0xa6, 0x00);
729− cp_write(sd, 0xa7, 0x00);
878+ break;
879+ case ADV7604_MODE_HDMI:
880+ /* set default prim_mode/vid_std for HDMI
881+ accoring to [REF_03, c. 4.2] */
882+ io_write(sd, 0x00, 0x02); /* video std */
883+ io_write(sd, 0x01, 0x06); /* prim mode */
884+ break;
885+ default:
886+ v4l2_dbg(2, debug, sd, "%s: Unknown mode %d\n",
887+ __func__, state->mode);
888+ break;
730889 }
731−}
732890
891+ cp_write(sd, 0x8f, (ch1_fr_ll >> 8) & 0x7);
892+ cp_write(sd, 0x90, ch1_fr_ll & 0xff);
893+ cp_write(sd, 0xab, (height >> 4) & 0xff);
894+ cp_write(sd, 0xac, (height & 0x0f) << 4);
895+}
733896
734897 static void set_rgb_quantization_range(struct v4l2_subdev *sd)
735898 {
@@ -738,12 +901,7 @@ static void set_rgb_quantization_range(struct v4l2_subdev *sd) · 2 unmodified lines
738901 switch (state->rgb_quantization_range) {
739902 case V4L2_DV_RGB_RANGE_AUTO:
740903 /* automatic */
741− if ((hdmi_read(sd, 0x05) & 0x80) ||
742− (state->prim_mode == ADV7604_PRIM_MODE_COMP) ||
743− (state->prim_mode == ADV7604_PRIM_MODE_RGB)) {
744− /* receiving HDMI or analog signal */
745− io_write_and_or(sd, 0x02, 0x0f, 0xf0);
746− } else {
904+ if (DIGITAL_INPUT && !(hdmi_read(sd, 0x05) & 0x80)) {
747905 /* receiving DVI-D signal */
748906
749907 /* ADV7604 selects RGB limited range regardless of
@@ -756,6 +914,9 @@ static void set_rgb_quantization_range(struct v4l2_subdev *sd) · 6 unmodified lines
756914 /* RGB full range (0-255) */
757915 io_write_and_or(sd, 0x02, 0x0f, 0x10);
758916 }
917+ } else {
918+ /* receiving HDMI or analog signal, set automode */
919+ io_write_and_or(sd, 0x02, 0x0f, 0xf0);
759920 }
760921 break;
761922 case V4L2_DV_RGB_RANGE_LIMITED:
@@ -967,8 +1128,10 @@ static int stdi2dv_timings(struct v4l2_subdev *sd, · 205 unmodified lines
9671128 state->aspect_ratio, timings))
9681129 return 0;
9691130
970− v4l2_dbg(2, debug, sd, "%s: No format candidate found for lcf=%d, bl = %d\n",
971− __func__, stdi->lcf, stdi->bl);
1131+ v4l2_dbg(2, debug, sd,
1132+ "%s: No format candidate found for lcvs = %d, lcf=%d, bl = %d, %chsync, %cvsync\n",
1133+ __func__, stdi->lcvs, stdi->lcf, stdi->bl,
1134+ stdi->hs_pol, stdi->vs_pol);
9721135 return -1;
9731136 }
9741137
@@ -1123,7 +1286,7 @@ static int adv7604_query_dv_timings(struct v4l2_subdev *sd, · 148 unmodified lines
11231286 adv7604_fill_optional_dv_timings_fields(sd, timings);
11241287 } else {
11251288 /* find format
1126− * Since LCVS values are inaccurate (REF_03, page 275-276),
1289+ * Since LCVS values are inaccurate [REF_03, p. 275-276],
11271290 * stdi2dv_timings() is called with lcvs +-1 if the first attempt fails.
11281291 */
11291292 if (!stdi2dv_timings(sd, &stdi, timings))
@@ -1135,9 +1298,31 @@ static int adv7604_query_dv_timings(struct v4l2_subdev *sd, · 5 unmodified lines
11351298 stdi.lcvs -= 2;
11361299 v4l2_dbg(1, debug, sd, "%s: lcvs - 1 = %d\n", __func__, stdi.lcvs);
11371300 if (stdi2dv_timings(sd, &stdi, timings)) {
1301+ /*
1302+ * The STDI block may measure wrong values, especially
1303+ * for lcvs and lcf. If the driver can not find any
1304+ * valid timing, the STDI block is restarted to measure
1305+ * the video timings again. The function will return an
1306+ * error, but the restart of STDI will generate a new
1307+ * STDI interrupt and the format detection process will
1308+ * restart.
1309+ */
1310+ if (state->restart_stdi_once) {
1311+ v4l2_dbg(1, debug, sd, "%s: restart STDI\n", __func__);
1312+ /* TODO restart STDI for Sync Channel 2 */
1313+ /* enter one-shot mode */
1314+ cp_write_and_or(sd, 0x86, 0xf9, 0x00);
1315+ /* trigger STDI restart */
1316+ cp_write_and_or(sd, 0x86, 0xf9, 0x04);
1317+ /* reset to continuous mode */
1318+ cp_write_and_or(sd, 0x86, 0xf9, 0x02);
1319+ state->restart_stdi_once = false;
1320+ return -ENOLINK;
1321+ }
11381322 v4l2_dbg(1, debug, sd, "%s: format not supported\n", __func__);
11391323 return -ERANGE;
11401324 }
1325+ state->restart_stdi_once = true;
11411326 }
11421327 found:
11431328
@@ -1166,6 +1351,7 @@ static int adv7604_s_dv_timings(struct v4l2_subdev *sd, · 22 unmodified lines
11661351 {
11671352 struct adv7604_state *state = to_state(sd);
11681353 struct v4l2_bt_timings *bt;
1354+ int err;
11691355
11701356 if (!timings)
11711357 return -EINVAL;
@@ -1178,12 +1364,20 @@ static int adv7604_s_dv_timings(struct v4l2_subdev *sd, · 6 unmodified lines
11781364 __func__, (u32)bt->pixelclock);
11791365 return -ERANGE;
11801366 }
1367+
11811368 adv7604_fill_optional_dv_timings_fields(sd, timings);
11821369
11831370 state->timings = *timings;
11841371
1185− /* freerun */
1186− configure_free_run(sd, bt);
1372+ cp_write(sd, 0x91, bt->interlaced ? 0x50 : 0x10);
1373+
1374+ /* Use prim_mode and vid_std when available */
1375+ err = configure_predefined_video_timings(sd, timings);
1376+ if (err) {
1377+ /* custom settings when the video format
1378+ does not have prim_mode/vid_std */
1379+ configure_custom_video_timings(sd, bt);
1380+ }
11871381
11881382 set_rgb_quantization_range(sd);
11891383
@@ -1203,24 +1397,25 @@ static int adv7604_g_dv_timings(struct v4l2_subdev *sd, · 13 unmodified lines
12031397 return 0;
12041398 }
12051399
1206−static void enable_input(struct v4l2_subdev *sd, enum adv7604_prim_mode prim_mode)
1400+static void enable_input(struct v4l2_subdev *sd)
12071401 {
1208− switch (prim_mode) {
1209− case ADV7604_PRIM_MODE_COMP:
1210− case ADV7604_PRIM_MODE_RGB:
1402+ struct adv7604_state *state = to_state(sd);
1403+
1404+ switch (state->mode) {
1405+ case ADV7604_MODE_COMP:
1406+ case ADV7604_MODE_GR:
12111407 /* enable */
12121408 io_write(sd, 0x15, 0xb0); /* Disable Tristate of Pins (no audio) */
12131409 break;
1214− case ADV7604_PRIM_MODE_HDMI_COMP:
1215− case ADV7604_PRIM_MODE_HDMI_GR:
1410+ case ADV7604_MODE_HDMI:
12161411 /* enable */
12171412 hdmi_write(sd, 0x1a, 0x0a); /* Unmute audio */
12181413 hdmi_write(sd, 0x01, 0x00); /* Enable HDMI clock terminators */
12191414 io_write(sd, 0x15, 0xa0); /* Disable Tristate of Pins */
12201415 break;
12211416 default:
1222− v4l2_err(sd, "%s: reserved primary mode 0x%0x\n",
1223− __func__, prim_mode);
1417+ v4l2_dbg(2, debug, sd, "%s: Unknown mode %d\n",
1418+ __func__, state->mode);
12241419 break;
12251420 }
12261421 }
@@ -1233,17 +1428,13 @@ static void disable_input(struct v4l2_subdev *sd) · 6 unmodified lines
12331428 hdmi_write(sd, 0x01, 0x78); /* Disable HDMI clock terminators */
12341429 }
12351430
1236−static void select_input(struct v4l2_subdev *sd, enum adv7604_prim_mode prim_mode)
1431+static void select_input(struct v4l2_subdev *sd)
12371432 {
1238− switch (prim_mode) {
1239− case ADV7604_PRIM_MODE_COMP:
1240− case ADV7604_PRIM_MODE_RGB:
1241− /* set mode and select free run resolution */
1242− io_write(sd, 0x00, 0x07); /* video std */
1243− io_write(sd, 0x01, 0x02); /* prim mode */
1244− /* enable embedded syncs for auto graphics mode */
1245− cp_write_and_or(sd, 0x81, 0xef, 0x10);
1433+ struct adv7604_state *state = to_state(sd);
12461434
1435+ switch (state->mode) {
1436+ case ADV7604_MODE_COMP:
1437+ case ADV7604_MODE_GR:
12471438 /* reset ADI recommended settings for HDMI: */
12481439 /* "ADV7604 Register Settings Recommendations (rev. 2.5, June 2010)" p. 4. */
12491440 hdmi_write(sd, 0x0d, 0x04); /* HDMI filter optimization */
@@ -1271,16 +1462,7 @@ static void select_input(struct v4l2_subdev *sd, enum adv7604_prim_mode prim_mod · 21 unmodified lines
12711462 cp_write(sd, 0x40, 0x5c); /* CP core pre-gain control. Graphics mode */
12721463 break;
12731464
1274− case ADV7604_PRIM_MODE_HDMI_COMP:
1275− case ADV7604_PRIM_MODE_HDMI_GR:
1276− /* set mode and select free run resolution */
1277− /* video std */
1278− io_write(sd, 0x00,
1279− (prim_mode == ADV7604_PRIM_MODE_HDMI_GR) ? 0x02 : 0x1e);
1280− io_write(sd, 0x01, prim_mode); /* prim mode */
1281− /* disable embedded syncs for auto graphics mode */
1282− cp_write_and_or(sd, 0x81, 0xef, 0x00);
1283−
1465+ case ADV7604_MODE_HDMI:
12841466 /* set ADI recommended settings for HDMI: */
12851467 /* "ADV7604 Register Settings Recommendations (rev. 2.5, June 2010)" p. 4. */
12861468 hdmi_write(sd, 0x0d, 0x84); /* HDMI filter optimization */
@@ -1309,7 +1491,8 @@ static void select_input(struct v4l2_subdev *sd, enum adv7604_prim_mode prim_mod · 22 unmodified lines
13091491
13101492 break;
13111493 default:
1312− v4l2_err(sd, "%s: reserved primary mode 0x%0x\n", __func__, prim_mode);
1494+ v4l2_dbg(2, debug, sd, "%s: Unknown mode %d\n",
1495+ __func__, state->mode);
13131496 break;
13141497 }
13151498 }
@@ -1321,26 +1504,13 @@ static int adv7604_s_routing(struct v4l2_subdev *sd, · 5 unmodified lines
13211504
13221505 v4l2_dbg(2, debug, sd, "%s: input %d", __func__, input);
13231506
1324− switch (input) {
1325− case 0:
1326− /* TODO select HDMI_COMP or HDMI_GR */
1327− state->prim_mode = ADV7604_PRIM_MODE_HDMI_COMP;
1328− break;
1329− case 1:
1330− state->prim_mode = ADV7604_PRIM_MODE_RGB;
1331− break;
1332− case 2:
1333− state->prim_mode = ADV7604_PRIM_MODE_COMP;
1334− break;
1335− default:
1336− return -EINVAL;
1337− }
1507+ state->mode = input;
13381508
13391509 disable_input(sd);
13401510
1341− select_input(sd, state->prim_mode);
1511+ select_input(sd);
13421512
1343− enable_input(sd, state->prim_mode);
1513+ enable_input(sd);
13441514
13451515 return 0;
13461516 }
@@ -1549,8 +1719,9 @@ static int adv7604_log_status(struct v4l2_subdev *sd) · 202 unmodified lines
15491719 v4l2_info(sd, "CP locked: %s\n", no_lock_cp(sd) ? "false" : "true");
15501720 v4l2_info(sd, "CP free run: %s\n",
15511721 (!!(cp_read(sd, 0xff) & 0x10) ? "on" : "off"));
1552− v4l2_info(sd, "Prim-mode = 0x%x, video std = 0x%x\n",
1553− io_read(sd, 0x01) & 0x0f, io_read(sd, 0x00) & 0x3f);
1722+ v4l2_info(sd, "Prim-mode = 0x%x, video std = 0x%x, v_freq = 0x%x\n",
1723+ io_read(sd, 0x01) & 0x0f, io_read(sd, 0x00) & 0x3f,
1724+ (io_read(sd, 0x01) & 0x70) >> 4);
15541725
15551726 v4l2_info(sd, "-----Video Timings-----\n");
15561727 if (read_stdi(sd, &stdi))
@@ -1712,9 +1883,9 @@ static int adv7604_core_init(struct v4l2_subdev *sd) · 155 unmodified lines
17121883 cp_write(sd, 0xba, (pdata->hdmi_free_run_mode << 1) | 0x01); /* HDMI free run */
17131884 cp_write(sd, 0xf3, 0xdc); /* Low threshold to enter/exit free run mode */
17141885 cp_write(sd, 0xf9, 0x23); /* STDI ch. 1 - LCVS change threshold -
1715− ADI recommended setting [REF_01 c. 2.3.3] */
1886+ ADI recommended setting [REF_01, c. 2.3.3] */
17161887 cp_write(sd, 0x45, 0x23); /* STDI ch. 2 - LCVS change threshold -
1717− ADI recommended setting [REF_01 c. 2.3.3] */
1888+ ADI recommended setting [REF_01, c. 2.3.3] */
17181889 cp_write(sd, 0xc9, 0x2d); /* use prim_mode and vid_std as free run resolution
17191890 for digital formats */
17201891
@@ -1724,11 +1895,6 @@ static int adv7604_core_init(struct v4l2_subdev *sd) · 3 unmodified lines
17241895 afe_write(sd, 0x02, pdata->ain_sel); /* Select analog input muxing mode */
17251896 io_write_and_or(sd, 0x30, ~(1 << 4), pdata->output_bus_lsb_to_msb << 4);
17261897
1727− state->prim_mode = pdata->prim_mode;
1728− select_input(sd, pdata->prim_mode);
1729−
1730− enable_input(sd, pdata->prim_mode);
1731−
17321898 /* interrupts */
17331899 io_write(sd, 0x40, 0xc2); /* Configure INT1 */
17341900 io_write(sd, 0x41, 0xd7); /* STDI irq for any change, disable INT2 */
@@ -1883,6 +2049,7 @@ static int adv7604_probe(struct i2c_client *client, · 148 unmodified lines
18832049 v4l2_err(sd, "failed to create all i2c clients\n");
18842050 goto err_i2c;
18852051 }
2052+ state->restart_stdi_once = true;
18862053
18872054 /* work queues */
18882055 state->work_queues = create_singlethread_workqueue(client->name);
drivers/media/i2c/soc_camera/mt9v022.c+8−3
@@ -263,9 +263,14 @@ static int mt9v022_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a) · 262 unmodified lines
263263 if (ret & 1) /* Autoexposure */
264264 ret = reg_write(client, mt9v022->reg->max_total_shutter_width,
265265 rect.height + mt9v022->y_skip_top + 43);
266− else
267− ret = reg_write(client, MT9V022_TOTAL_SHUTTER_WIDTH,
268− rect.height + mt9v022->y_skip_top + 43);
266+ /*
267+ * If autoexposure is off, there is no need to set
268+ * MT9V022_TOTAL_SHUTTER_WIDTH here. Autoexposure can be off
269+ * only if the user has set exposure manually, using the
270+ * V4L2_CID_EXPOSURE_AUTO with the value V4L2_EXPOSURE_MANUAL.
271+ * In this case the register MT9V022_TOTAL_SHUTTER_WIDTH
272+ * already contains the correct value.
273+ */
269274 }
270275 /* Setup frame format: defaults apart from width and height */
271276 if (!ret)
drivers/media/platform/exynos-gsc/gsc-core.c+4−2
@@ -965,8 +965,10 @@ static struct platform_device_id gsc_driver_ids[] = { · 964 unmodified lines
965965 MODULE_DEVICE_TABLE(platform, gsc_driver_ids);
966966
967967 static const struct of_device_id exynos_gsc_match[] = {
968− { .compatible = "samsung,exynos5250-gsc",
969− .data = &gsc_v_100_drvdata, },
968+ {
969+ .compatible = "samsung,exynos5-gsc",
970+ .data = &gsc_v_100_drvdata,
971+ },
970972 {},
971973 };
972974 MODULE_DEVICE_TABLE(of, exynos_gsc_match);
drivers/media/platform/exynos-gsc/gsc-m2m.c+2−2
@@ -657,8 +657,7 @@ static int gsc_m2m_release(struct file *file) · 656 unmodified lines
657657 pr_debug("pid: %d, state: 0x%lx, refcnt= %d",
658658 task_pid_nr(current), gsc->state, gsc->m2m.refcnt);
659659
660− if (mutex_lock_interruptible(&gsc->lock))
661− return -ERESTARTSYS;
660+ mutex_lock(&gsc->lock);
662661
663662 v4l2_m2m_ctx_release(ctx->m2m_ctx);
664663 gsc_ctrls_delete(ctx);
@@ -732,6 +731,7 @@ int gsc_register_m2m_device(struct gsc_dev *gsc) · 67 unmodified lines
732731 gsc->vdev.ioctl_ops = &gsc_m2m_ioctl_ops;
733732 gsc->vdev.release = video_device_release_empty;
734733 gsc->vdev.lock = &gsc->lock;
734+ gsc->vdev.vfl_dir = VFL_DIR_M2M;
735735 snprintf(gsc->vdev.name, sizeof(gsc->vdev.name), "%s.%d:m2m",
736736 GSC_MODULE_NAME, gsc->id);
737737
drivers/media/platform/exynos-gsc/gsc-regs.h+8−8
@@ -40,10 +40,10 @@ · 39 unmodified lines
4040 #define GSC_IN_ROT_YFLIP (2 << 16)
4141 #define GSC_IN_ROT_XFLIP (1 << 16)
4242 #define GSC_IN_RGB_TYPE_MASK (3 << 14)
43−#define GSC_IN_RGB_HD_WIDE (3 << 14)
44−#define GSC_IN_RGB_HD_NARROW (2 << 14)
45−#define GSC_IN_RGB_SD_WIDE (1 << 14)
46−#define GSC_IN_RGB_SD_NARROW (0 << 14)
43+#define GSC_IN_RGB_HD_NARROW (3 << 14)
44+#define GSC_IN_RGB_HD_WIDE (2 << 14)
45+#define GSC_IN_RGB_SD_NARROW (1 << 14)
46+#define GSC_IN_RGB_SD_WIDE (0 << 14)
4747 #define GSC_IN_YUV422_1P_ORDER_MASK (1 << 13)
4848 #define GSC_IN_YUV422_1P_ORDER_LSB_Y (0 << 13)
4949 #define GSC_IN_YUV422_1P_OEDER_LSB_C (1 << 13)
@@ -85,10 +85,10 @@ · 35 unmodified lines
8585 #define GSC_OUT_GLOBAL_ALPHA_MASK (0xff << 24)
8686 #define GSC_OUT_GLOBAL_ALPHA(x) ((x) << 24)
8787 #define GSC_OUT_RGB_TYPE_MASK (3 << 10)
88−#define GSC_OUT_RGB_HD_NARROW (3 << 10)
89−#define GSC_OUT_RGB_HD_WIDE (2 << 10)
90−#define GSC_OUT_RGB_SD_NARROW (1 << 10)
91−#define GSC_OUT_RGB_SD_WIDE (0 << 10)
88+#define GSC_OUT_RGB_HD_WIDE (3 << 10)
89+#define GSC_OUT_RGB_HD_NARROW (2 << 10)
90+#define GSC_OUT_RGB_SD_WIDE (1 << 10)
91+#define GSC_OUT_RGB_SD_NARROW (0 << 10)
9292 #define GSC_OUT_YUV422_1P_ORDER_MASK (1 << 9)
9393 #define GSC_OUT_YUV422_1P_ORDER_LSB_Y (0 << 9)
9494 #define GSC_OUT_YUV422_1P_OEDER_LSB_C (1 << 9)
drivers/media/platform/omap3isp/ispccdc.c+2−2
@@ -1706,7 +1706,7 @@ static long ccdc_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) · 1705 unmodified lines
17061706 }
17071707
17081708 static int ccdc_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,
1709− const struct v4l2_event_subscription *sub)
1709+ struct v4l2_event_subscription *sub)
17101710 {
17111711 if (sub->type != V4L2_EVENT_FRAME_SYNC)
17121712 return -EINVAL;
@@ -1719,7 +1719,7 @@ static int ccdc_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh, · 6 unmodified lines
17191719 }
17201720
17211721 static int ccdc_unsubscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,
1722− const struct v4l2_event_subscription *sub)
1722+ struct v4l2_event_subscription *sub)
17231723 {
17241724 return v4l2_event_unsubscribe(fh, sub);
17251725 }
drivers/media/platform/omap3isp/ispstat.c+2−2
@@ -1025,7 +1025,7 @@ void omap3isp_stat_dma_isr(struct ispstat *stat) · 1024 unmodified lines
10251025
10261026 int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev,
10271027 struct v4l2_fh *fh,
1028− const struct v4l2_event_subscription *sub)
1028+ struct v4l2_event_subscription *sub)
10291029 {
10301030 struct ispstat *stat = v4l2_get_subdevdata(subdev);
10311031
@@ -1037,7 +1037,7 @@ int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev, · 5 unmodified lines
10371037
10381038 int omap3isp_stat_unsubscribe_event(struct v4l2_subdev *subdev,
10391039 struct v4l2_fh *fh,
1040− const struct v4l2_event_subscription *sub)
1040+ struct v4l2_event_subscription *sub)
10411041 {
10421042 return v4l2_event_unsubscribe(fh, sub);
10431043 }
drivers/media/platform/omap3isp/ispstat.h+2−2
@@ -147,10 +147,10 @@ int omap3isp_stat_init(struct ispstat *stat, const char *name, · 146 unmodified lines
147147 void omap3isp_stat_cleanup(struct ispstat *stat);
148148 int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev,
149149 struct v4l2_fh *fh,
150− const struct v4l2_event_subscription *sub);
150+ struct v4l2_event_subscription *sub);
151151 int omap3isp_stat_unsubscribe_event(struct v4l2_subdev *subdev,
152152 struct v4l2_fh *fh,
153− const struct v4l2_event_subscription *sub);
153+ struct v4l2_event_subscription *sub);
154154 int omap3isp_stat_s_stream(struct v4l2_subdev *subdev, int enable);
155155
156156 int omap3isp_stat_busy(struct ispstat *stat);
drivers/media/platform/omap3isp/ispvideo.c+1−1
@@ -792,7 +792,7 @@ isp_video_get_crop(struct file *file, void *fh, struct v4l2_crop *crop) · 791 unmodified lines
792792 }
793793
794794 static int
795−isp_video_set_crop(struct file *file, void *fh, struct v4l2_crop *crop)
795+isp_video_set_crop(struct file *file, void *fh, const struct v4l2_crop *crop)
796796 {
797797 struct isp_video *video = video_drvdata(file);
798798 struct v4l2_subdev *subdev;
drivers/media/platform/s5p-fimc/Kconfig+1−0
@@ -24,6 +24,7 @@ config VIDEO_S5P_FIMC · 23 unmodified lines
2424 config VIDEO_S5P_MIPI_CSIS
2525 tristate "S5P/EXYNOS MIPI-CSI2 receiver (MIPI-CSIS) driver"
2626 depends on REGULATOR
27+ select S5P_SETUP_MIPIPHY
2728 help
2829 This is a V4L2 driver for Samsung S5P and EXYNOS4 SoC MIPI-CSI2
2930 receiver (MIPI-CSIS) devices.
drivers/media/platform/s5p-fimc/fimc-capture.c+10−4
@@ -556,8 +556,7 @@ static int fimc_capture_close(struct file *file) · 555 unmodified lines
556556
557557 dbg("pid: %d, state: 0x%lx", task_pid_nr(current), fimc->state);
558558
559− if (mutex_lock_interruptible(&fimc->lock))
560− return -ERESTARTSYS;
559+ mutex_lock(&fimc->lock);
561560
562561 if (--fimc->vid_cap.refcnt == 0) {
563562 clear_bit(ST_CAPT_BUSY, &fimc->state);
@@ -1736,7 +1735,9 @@ static int fimc_register_capture_device(struct fimc_dev *fimc, · 1172 unmodified lines
17361735 q->mem_ops = &vb2_dma_contig_memops;
17371736 q->buf_struct_size = sizeof(struct fimc_vid_buffer);
17381737
1739− vb2_queue_init(q);
1738+ ret = vb2_queue_init(q);
1739+ if (ret)
1740+ goto err_ent;
17401741
17411742 vid_cap->vd_pad.flags = MEDIA_PAD_FL_SINK;
17421743 ret = media_entity_init(&vfd->entity, 1, &vid_cap->vd_pad, 0);
@@ -1772,9 +1773,13 @@ static int fimc_capture_subdev_registered(struct v4l2_subdev *sd) · 29 unmodified lines
17721773 if (ret)
17731774 return ret;
17741775
1776+ fimc->pipeline_ops = v4l2_get_subdev_hostdata(sd);
1777+
17751778 ret = fimc_register_capture_device(fimc, sd->v4l2_dev);
1776− if (ret)
1779+ if (ret) {
17771780 fimc_unregister_m2m_device(fimc);
1781+ fimc->pipeline_ops = NULL;
1782+ }
17781783
17791784 return ret;
17801785 }
@@ -1791,6 +1796,7 @@ static void fimc_capture_subdev_unregistered(struct v4l2_subdev *sd) · 10 unmodified lines
17911796 if (video_is_registered(&fimc->vid_cap.vfd)) {
17921797 video_unregister_device(&fimc->vid_cap.vfd);
17931798 media_entity_cleanup(&fimc->vid_cap.vfd.entity);
1799+ fimc->pipeline_ops = NULL;
17941800 }
17951801 kfree(fimc->vid_cap.ctx);
17961802 fimc->vid_cap.ctx = NULL;
drivers/media/platform/s5p-fimc/fimc-lite.c+7−3
@@ -491,8 +491,7 @@ static int fimc_lite_close(struct file *file) · 490 unmodified lines
491491 struct fimc_lite *fimc = video_drvdata(file);
492492 int ret;
493493
494− if (mutex_lock_interruptible(&fimc->lock))
495− return -ERESTARTSYS;
494+ mutex_lock(&fimc->lock);
496495
497496 if (--fimc->ref_count == 0 && fimc->out_path == FIMC_IO_DMA) {
498497 clear_bit(ST_FLITE_IN_USE, &fimc->state);
@@ -1253,7 +1252,9 @@ static int fimc_lite_subdev_registered(struct v4l2_subdev *sd) · 754 unmodified lines
12531252 q->buf_struct_size = sizeof(struct flite_buffer);
12541253 q->drv_priv = fimc;
12551254
1256− vb2_queue_init(q);
1255+ ret = vb2_queue_init(q);
1256+ if (ret < 0)
1257+ return ret;
12571258
12581259 fimc->vd_pad.flags = MEDIA_PAD_FL_SINK;
12591260 ret = media_entity_init(&vfd->entity, 1, &fimc->vd_pad, 0);
@@ -1261,10 +1262,12 @@ static int fimc_lite_subdev_registered(struct v4l2_subdev *sd) · 1 unmodified line
12611262 return ret;
12621263
12631264 video_set_drvdata(vfd, fimc);
1265+ fimc->pipeline_ops = v4l2_get_subdev_hostdata(sd);
12641266
12651267 ret = video_register_device(vfd, VFL_TYPE_GRABBER, -1);
12661268 if (ret < 0) {
12671269 media_entity_cleanup(&vfd->entity);
1270+ fimc->pipeline_ops = NULL;
12681271 return ret;
12691272 }
12701273
@@ -1283,6 +1286,7 @@ static void fimc_lite_subdev_unregistered(struct v4l2_subdev *sd) · 12 unmodified lines
12831286 if (video_is_registered(&fimc->vfd)) {
12841287 video_unregister_device(&fimc->vfd);
12851288 media_entity_cleanup(&fimc->vfd.entity);
1289+ fimc->pipeline_ops = NULL;
12861290 }
12871291 }
12881292
drivers/media/platform/s5p-fimc/fimc-m2m.c+1−2
@@ -718,8 +718,7 @@ static int fimc_m2m_release(struct file *file) · 717 unmodified lines
718718 dbg("pid: %d, state: 0x%lx, refcnt= %d",
719719 task_pid_nr(current), fimc->state, fimc->m2m.refcnt);
720720
721− if (mutex_lock_interruptible(&fimc->lock))
722− return -ERESTARTSYS;
721+ mutex_lock(&fimc->lock);
723722
724723 v4l2_m2m_ctx_release(ctx->m2m_ctx);
725724 fimc_ctrls_delete(ctx);
drivers/media/platform/s5p-fimc/fimc-mdevice.c+20−21
@@ -343,53 +343,50 @@ static int fimc_md_register_sensor_entities(struct fimc_md *fmd) · 342 unmodified lines
343343 static int fimc_register_callback(struct device *dev, void *p)
344344 {
345345 struct fimc_dev *fimc = dev_get_drvdata(dev);
346− struct v4l2_subdev *sd = &fimc->vid_cap.subdev;
346+ struct v4l2_subdev *sd;
347347 struct fimc_md *fmd = p;
348− int ret = 0;
349−
350− if (!fimc || !fimc->pdev)
351− return 0;
348+ int ret;
352349
353− if (fimc->pdev->id < 0 || fimc->pdev->id >= FIMC_MAX_DEVS)
350+ if (fimc == NULL || fimc->id >= FIMC_MAX_DEVS)
354351 return 0;
355352
356− fimc->pipeline_ops = &fimc_pipeline_ops;
357− fmd->fimc[fimc->pdev->id] = fimc;
353+ sd = &fimc->vid_cap.subdev;
358354 sd->grp_id = FIMC_GROUP_ID;
355+ v4l2_set_subdev_hostdata(sd, (void *)&fimc_pipeline_ops);
359356
360357 ret = v4l2_device_register_subdev(&fmd->v4l2_dev, sd);
361358 if (ret) {
362359 v4l2_err(&fmd->v4l2_dev, "Failed to register FIMC.%d (%d)\n",
363360 fimc->id, ret);
361+ return ret;
364362 }
365363
366− return ret;
364+ fmd->fimc[fimc->id] = fimc;
365+ return 0;
367366 }
368367
369368 static int fimc_lite_register_callback(struct device *dev, void *p)
370369 {
371370 struct fimc_lite *fimc = dev_get_drvdata(dev);
372− struct v4l2_subdev *sd = &fimc->subdev;
373371 struct fimc_md *fmd = p;
374372 int ret;
375373
376− if (fimc == NULL)
374+ if (fimc == NULL || fimc->index >= FIMC_LITE_MAX_DEVS)
377375 return 0;
378376
379− if (fimc->index >= FIMC_LITE_MAX_DEVS)
380− return 0;
381−
382− fimc->pipeline_ops = &fimc_pipeline_ops;
383− fmd->fimc_lite[fimc->index] = fimc;
384− sd->grp_id = FLITE_GROUP_ID;
377+ fimc->subdev.grp_id = FLITE_GROUP_ID;
378+ v4l2_set_subdev_hostdata(&fimc->subdev, (void *)&fimc_pipeline_ops);
385379
386− ret = v4l2_device_register_subdev(&fmd->v4l2_dev, sd);
380+ ret = v4l2_device_register_subdev(&fmd->v4l2_dev, &fimc->subdev);
387381 if (ret) {
388382 v4l2_err(&fmd->v4l2_dev,
389383 "Failed to register FIMC-LITE.%d (%d)\n",
390384 fimc->index, ret);
385+ return ret;
391386 }
392− return ret;
387+
388+ fmd->fimc_lite[fimc->index] = fimc;
389+ return 0;
393390 }
394391
395392 static int csis_register_callback(struct device *dev, void *p)
@@ -407,10 +404,12 @@ static int csis_register_callback(struct device *dev, void *p) · 11 unmodified lines
407404 v4l2_info(sd, "csis%d sd: %s\n", pdev->id, sd->name);
408405
409406 id = pdev->id < 0 ? 0 : pdev->id;
410− fmd->csis[id].sd = sd;
411407 sd->grp_id = CSIS_GROUP_ID;
408+
412409 ret = v4l2_device_register_subdev(&fmd->v4l2_dev, sd);
413− if (ret)
410+ if (!ret)
411+ fmd->csis[id].sd = sd;
412+ else
414413 v4l2_err(&fmd->v4l2_dev,
415414 "Failed to register CSIS subdevice: %d\n", ret);
416415 return ret;
drivers/media/platform/s5p-mfc/s5p_mfc.c+2−5
@@ -381,11 +381,8 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx, · 380 unmodified lines
381381 ctx->consumed_stream += s5p_mfc_hw_call(dev->mfc_ops,
382382 get_consumed_stream, dev);
383383 if (ctx->codec_mode != S5P_MFC_CODEC_H264_DEC &&
384− s5p_mfc_hw_call(dev->mfc_ops,
385− get_dec_frame_type, dev) ==
386− S5P_FIMV_DECODE_FRAME_P_FRAME
387− && ctx->consumed_stream + STUFF_BYTE <
388− src_buf->b->v4l2_planes[0].bytesused) {
384+ ctx->consumed_stream + STUFF_BYTE <
385+ src_buf->b->v4l2_planes[0].bytesused) {
389386 /* Run MFC again on the same buffer */
390387 mfc_debug(2, "Running again the same buffer\n");
391388 ctx->after_packed_pb = 1;
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c+1−1
@@ -1762,7 +1762,7 @@ int s5p_mfc_get_dspl_y_adr_v6(struct s5p_mfc_dev *dev) · 1761 unmodified lines
17621762
17631763 int s5p_mfc_get_dec_y_adr_v6(struct s5p_mfc_dev *dev)
17641764 {
1765− return mfc_read(dev, S5P_FIMV_D_DISPLAY_LUMA_ADDR_V6);
1765+ return mfc_read(dev, S5P_FIMV_D_DECODED_LUMA_ADDR_V6);
17661766 }
17671767
17681768 int s5p_mfc_get_dspl_status_v6(struct s5p_mfc_dev *dev)
drivers/media/platform/sh_vou.c+2−1
@@ -935,9 +935,10 @@ static int sh_vou_g_crop(struct file *file, void *fh, struct v4l2_crop *a) · 934 unmodified lines
935935 /* Assume a dull encoder, do all the work ourselves. */
936936 static int sh_vou_s_crop(struct file *file, void *fh, const struct v4l2_crop *a)
937937 {
938+ struct v4l2_crop a_writable = *a;
938939 struct video_device *vdev = video_devdata(file);
939940 struct sh_vou_device *vou_dev = video_get_drvdata(vdev);
940− struct v4l2_rect *rect = &a->c;
941+ struct v4l2_rect *rect = &a_writable.c;
941942 struct v4l2_crop sd_crop = {.type = V4L2_BUF_TYPE_VIDEO_OUTPUT};
942943 struct v4l2_pix_format *pix = &vou_dev->pix;
943944 struct sh_vou_geometry geo;
drivers/media/platform/soc_camera/mx1_camera.c+0−9
@@ -470,14 +470,6 @@ static void mx1_camera_remove_device(struct soc_camera_device *icd) · 469 unmodified lines
470470 pcdev->icd = NULL;
471471 }
472472
473−static int mx1_camera_set_crop(struct soc_camera_device *icd,
474− struct v4l2_crop *a)
475−{
476− struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
477−
478− return v4l2_subdev_call(sd, video, s_crop, a);
479−}
480−
481473 static int mx1_camera_set_bus_param(struct soc_camera_device *icd)
482474 {
483475 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
@@ -689,7 +681,6 @@ static struct soc_camera_host_ops mx1_soc_camera_host_ops = { · 205 unmodified lines
689681 .add = mx1_camera_add_device,
690682 .remove = mx1_camera_remove_device,
691683 .set_bus_param = mx1_camera_set_bus_param,
692− .set_crop = mx1_camera_set_crop,
693684 .set_fmt = mx1_camera_set_fmt,
694685 .try_fmt = mx1_camera_try_fmt,
695686 .init_videobuf = mx1_camera_init_videobuf,
drivers/media/platform/soc_camera/mx2_camera.c+9−4
@@ -864,8 +864,10 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count) · 863 unmodified lines
864864
865865 bytesperline = soc_mbus_bytes_per_line(icd->user_width,
866866 icd->current_fmt->host_fmt);
867− if (bytesperline < 0)
867+ if (bytesperline < 0) {
868+ spin_unlock_irqrestore(&pcdev->lock, flags);
868869 return bytesperline;
870+ }
869871
870872 /*
871873 * I didn't manage to properly enable/disable the prp
@@ -878,8 +880,10 @@ static int mx2_start_streaming(struct vb2_queue *q, unsigned int count) · 6 unmodified lines
878880 pcdev->discard_buffer = dma_alloc_coherent(ici->v4l2_dev.dev,
879881 pcdev->discard_size, &pcdev->discard_buffer_dma,
880882 GFP_KERNEL);
881− if (!pcdev->discard_buffer)
883+ if (!pcdev->discard_buffer) {
884+ spin_unlock_irqrestore(&pcdev->lock, flags);
882885 return -ENOMEM;
886+ }
883887
884888 pcdev->buf_discard[0].discard = true;
885889 list_add_tail(&pcdev->buf_discard[0].queue,
@@ -1099,9 +1103,10 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd) · 213 unmodified lines
10991103 }
11001104
11011105 static int mx2_camera_set_crop(struct soc_camera_device *icd,
1102− struct v4l2_crop *a)
1106+ const struct v4l2_crop *a)
11031107 {
1104− struct v4l2_rect *rect = &a->c;
1108+ struct v4l2_crop a_writable = *a;
1109+ struct v4l2_rect *rect = &a_writable.c;
11051110 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
11061111 struct v4l2_mbus_framefmt mf;
11071112 int ret;
drivers/media/platform/soc_camera/mx3_camera.c+3−2
@@ -799,9 +799,10 @@ static inline void stride_align(__u32 *width) · 798 unmodified lines
799799 * default g_crop and cropcap from soc_camera.c
800800 */
801801 static int mx3_camera_set_crop(struct soc_camera_device *icd,
802− struct v4l2_crop *a)
802+ const struct v4l2_crop *a)
803803 {
804− struct v4l2_rect *rect = &a->c;
804+ struct v4l2_crop a_writable = *a;
805+ struct v4l2_rect *rect = &a_writable.c;
805806 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
806807 struct mx3_camera_dev *mx3_cam = ici->priv;
807808 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
drivers/media/platform/soc_camera/omap1_camera.c+2−2
@@ -1215,9 +1215,9 @@ static int set_mbus_format(struct omap1_cam_dev *pcdev, struct device *dev, · 1214 unmodified lines
12151215 }
12161216
12171217 static int omap1_cam_set_crop(struct soc_camera_device *icd,
1218− struct v4l2_crop *crop)
1218+ const struct v4l2_crop *crop)
12191219 {
1220− struct v4l2_rect *rect = &crop->c;
1220+ const struct v4l2_rect *rect = &crop->c;
12211221 const struct soc_camera_format_xlate *xlate = icd->current_fmt;
12221222 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
12231223 struct device *dev = icd->parent;
drivers/media/platform/soc_camera/pxa_camera.c+2−2
@@ -1337,9 +1337,9 @@ static int pxa_camera_check_frame(u32 width, u32 height) · 1336 unmodified lines
13371337 }
13381338
13391339 static int pxa_camera_set_crop(struct soc_camera_device *icd,
1340− struct v4l2_crop *a)
1340+ const struct v4l2_crop *a)
13411341 {
1342− struct v4l2_rect *rect = &a->c;
1342+ const struct v4l2_rect *rect = &a->c;
13431343 struct device *dev = icd->parent;
13441344 struct soc_camera_host *ici = to_soc_camera_host(dev);
13451345 struct pxa_camera_dev *pcdev = ici->priv;
drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c+7−6
@@ -1182,13 +1182,13 @@ static void sh_mobile_ceu_put_formats(struct soc_camera_device *icd) · 1181 unmodified lines
11821182 }
11831183
11841184 /* Check if any dimension of r1 is smaller than respective one of r2 */
1185−static bool is_smaller(struct v4l2_rect *r1, struct v4l2_rect *r2)
1185+static bool is_smaller(const struct v4l2_rect *r1, const struct v4l2_rect *r2)
11861186 {
11871187 return r1->width < r2->width || r1->height < r2->height;
11881188 }
11891189
11901190 /* Check if r1 fails to cover r2 */
1191−static bool is_inside(struct v4l2_rect *r1, struct v4l2_rect *r2)
1191+static bool is_inside(const struct v4l2_rect *r1, const struct v4l2_rect *r2)
11921192 {
11931193 return r1->left > r2->left || r1->top > r2->top ||
11941194 r1->left + r1->width < r2->left + r2->width ||
@@ -1263,7 +1263,7 @@ static void update_subrect(struct sh_mobile_ceu_cam *cam) · 68 unmodified lines
12631263 * 3. if (2) failed, try to request the maximum image
12641264 */
12651265 static int client_s_crop(struct soc_camera_device *icd, struct v4l2_crop *crop,
1266− const struct v4l2_crop *cam_crop)
1266+ struct v4l2_crop *cam_crop)
12671267 {
12681268 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
12691269 struct v4l2_rect *rect = &crop->c, *cam_rect = &cam_crop->c;
@@ -1519,7 +1519,8 @@ static int client_scale(struct soc_camera_device *icd, · 249 unmodified lines
15191519 static int sh_mobile_ceu_set_crop(struct soc_camera_device *icd,
15201520 const struct v4l2_crop *a)
15211521 {
1522− struct v4l2_rect *rect = &a->c;
1522+ struct v4l2_crop a_writable = *a;
1523+ const struct v4l2_rect *rect = &a_writable.c;
15231524 struct device *dev = icd->parent;
15241525 struct soc_camera_host *ici = to_soc_camera_host(dev);
15251526 struct sh_mobile_ceu_dev *pcdev = ici->priv;
@@ -1545,7 +1546,7 @@ static int sh_mobile_ceu_set_crop(struct soc_camera_device *icd, · 19 unmodified lines
15451546 * 1. - 2. Apply iterative camera S_CROP for new input window, read back
15461547 * actual camera rectangle.
15471548 */
1548− ret = client_s_crop(icd, a, &cam_crop);
1549+ ret = client_s_crop(icd, &a_writable, &cam_crop);
15491550 if (ret < 0)
15501551 return ret;
15511552
@@ -1946,7 +1947,7 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd, · 394 unmodified lines
19461947 }
19471948
19481949 static int sh_mobile_ceu_set_livecrop(struct soc_camera_device *icd,
1949− struct v4l2_crop *a)
1950+ const struct v4l2_crop *a)
19501951 {
19511952 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
19521953 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c+5−6
@@ -283,14 +283,13 @@ static inline int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, · 282 unmodified lines
283283
284284 /* activate the pid on the device pid filter */
285285 if (adap->props->caps & DVB_USB_ADAP_HAS_PID_FILTER &&
286− adap->pid_filtering &&
287− adap->props->pid_filter)
286+ adap->pid_filtering && adap->props->pid_filter) {
288287 ret = adap->props->pid_filter(adap, dvbdmxfeed->index,
289288 dvbdmxfeed->pid, (count == 1) ? 1 : 0);
290− if (ret < 0)
291− dev_err(&d->udev->dev, "%s: pid_filter() " \
292− "failed=%d\n", KBUILD_MODNAME,
293− ret);
289+ if (ret < 0)
290+ dev_err(&d->udev->dev, "%s: pid_filter() failed=%d\n",
291+ KBUILD_MODNAME, ret);
292+ }
294293
295294 /* start feeding if it is first pid */
296295 if (adap->feed_count == 1 && count == 1) {
drivers/media/usb/dvb-usb-v2/dvb_usb_urb.c+1−3
@@ -32,9 +32,7 @@ int dvb_usbv2_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf, · 31 unmodified lines
3232 return -EINVAL;
3333 }
3434
35− ret = mutex_lock_interruptible(&d->usb_mutex);
36− if (ret < 0)
37− return ret;
35+ mutex_lock(&d->usb_mutex);
3836
3937 dev_dbg(&d->udev->dev, "%s: >>> %*ph\n", __func__, wlen, wbuf);
4038
drivers/media/usb/dvb-usb-v2/rtl28xxu.c+4−0
@@ -1346,6 +1346,10 @@ static const struct usb_device_id rtl28xxu_id_table[] = { · 1345 unmodified lines
13461346 &rtl2832u_props, "DigitalNow Quad DVB-T Receiver", NULL) },
13471347 { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x00d3,
13481348 &rtl2832u_props, "TerraTec Cinergy T Stick RC (Rev. 3)", NULL) },
1349+ { DVB_USB_DEVICE(USB_VID_DEXATEK, 0x1102,
1350+ &rtl2832u_props, "Dexatek DK mini DVB-T Dongle", NULL) },
1351+ { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x00d7,
1352+ &rtl2832u_props, "TerraTec Cinergy T Stick+", NULL) },
13491353 { }
13501354 };
13511355 MODULE_DEVICE_TABLE(usb, rtl28xxu_id_table);
drivers/mfd/arizona-core.c+11−3
@@ -96,11 +96,11 @@ static irqreturn_t arizona_underclocked(int irq, void *data) · 95 unmodified lines
9696 return IRQ_NONE;
9797 }
9898
99− if (val & ARIZONA_AIF3_UNDERCLOCKED_STS)
100− dev_err(arizona->dev, "AIF3 underclocked\n");
10199 if (val & ARIZONA_AIF3_UNDERCLOCKED_STS)
102100 dev_err(arizona->dev, "AIF3 underclocked\n");
103101 if (val & ARIZONA_AIF2_UNDERCLOCKED_STS)
102+ dev_err(arizona->dev, "AIF2 underclocked\n");
103+ if (val & ARIZONA_AIF1_UNDERCLOCKED_STS)
104104 dev_err(arizona->dev, "AIF1 underclocked\n");
105105 if (val & ARIZONA_ISRC2_UNDERCLOCKED_STS)
106106 dev_err(arizona->dev, "ISRC2 underclocked\n");
@@ -415,11 +415,19 @@ int __devinit arizona_dev_init(struct arizona *arizona) · 308 unmodified lines
415415
416416 /* If we have a /RESET GPIO we'll already be reset */
417417 if (!arizona->pdata.reset) {
418+ regcache_mark_dirty(arizona->regmap);
419+
418420 ret = regmap_write(arizona->regmap, ARIZONA_SOFTWARE_RESET, 0);
419421 if (ret != 0) {
420422 dev_err(dev, "Failed to reset device: %d\n", ret);
421423 goto err_reset;
422424 }
425+
426+ ret = regcache_sync(arizona->regmap);
427+ if (ret != 0) {
428+ dev_err(dev, "Failed to sync device: %d\n", ret);
429+ goto err_reset;
430+ }
423431 }
424432
425433 ret = arizona_wait_for_boot(arizona);
@@ -520,7 +528,7 @@ int __devinit arizona_dev_init(struct arizona *arizona) · 94 unmodified lines
520528 break;
521529 case WM5110:
522530 ret = mfd_add_devices(arizona->dev, -1, wm5110_devs,
523− ARRAY_SIZE(wm5102_devs), NULL, 0, NULL);
531+ ARRAY_SIZE(wm5110_devs), NULL, 0, NULL);
524532 break;
525533 }
526534
drivers/mfd/arizona-irq.c+1−0
@@ -178,6 +178,7 @@ int arizona_irq_init(struct arizona *arizona) · 177 unmodified lines
178178
179179 switch (arizona->rev) {
180180 case 0:
181+ case 1:
181182 ctrlif_error = false;
182183 break;
183184 default:
drivers/mfd/twl-core.c+1−1
@@ -671,7 +671,7 @@ add_children(struct twl4030_platform_data *pdata, unsigned irq_base, · 670 unmodified lines
671671 }
672672
673673 if (IS_ENABLED(CONFIG_PWM_TWL6030) && twl_class_is_6030()) {
674− child = add_child(TWL6030_MODULE_ID1, "twl6030-pwm", NULL, 0,
674+ child = add_child(SUB_CHIP_ID1, "twl6030-pwm", NULL, 0,
675675 false, 0, 0);
676676 if (IS_ERR(child))
677677 return PTR_ERR(child);
drivers/mfd/twl4030-irq.c+2−1
@@ -672,7 +672,8 @@ int twl4030_sih_setup(struct device *dev, int module, int irq_base) · 671 unmodified lines
672672 irq = sih_mod + twl4030_irq_base;
673673 irq_set_handler_data(irq, agent);
674674 agent->irq_name = kasprintf(GFP_KERNEL, "twl4030_%s", sih->name);
675− status = request_threaded_irq(irq, NULL, handle_twl4030_sih, 0,
675+ status = request_threaded_irq(irq, NULL, handle_twl4030_sih,
676+ IRQF_EARLY_RESUME,
676677 agent->irq_name ?: sih->name, NULL);
677678
678679 dev_info(dev, "%s (irq %d) chaining IRQs %d..%d\n", sih->name,
drivers/mfd/wm5102-tables.c+1−518
@@ -43,6 +43,7 @@ static const struct reg_default wm5102_reva_patch[] = { · 42 unmodified lines
4343 { 0x479, 0x0A30 },
4444 { 0x47B, 0x0810 },
4545 { 0x47D, 0x0510 },
46+ { 0x4D1, 0x017F },
4647 { 0x500, 0x000D },
4748 { 0x507, 0x1820 },
4849 { 0x508, 0x1820 },
@@ -52,524 +53,6 @@ static const struct reg_default wm5102_reva_patch[] = { · 3 unmodified lines
5253 { 0x580, 0x000D },
5354 { 0x587, 0x1820 },
5455 { 0x588, 0x1820 },
55− { 0x101, 0x8140 },
56− { 0x3000, 0x2225 },
57− { 0x3001, 0x3a03 },
58− { 0x3002, 0x0225 },
59− { 0x3003, 0x0801 },
60− { 0x3004, 0x6249 },
61− { 0x3005, 0x0c04 },
62− { 0x3006, 0x0225 },
63− { 0x3007, 0x5901 },
64− { 0x3008, 0xe249 },
65− { 0x3009, 0x030d },
66− { 0x300a, 0x0249 },
67− { 0x300b, 0x2c01 },
68− { 0x300c, 0xe249 },
69− { 0x300d, 0x4342 },
70− { 0x300e, 0xe249 },
71− { 0x300f, 0x73c0 },
72− { 0x3010, 0x4249 },
73− { 0x3011, 0x0c00 },
74− { 0x3012, 0x0225 },
75− { 0x3013, 0x1f01 },
76− { 0x3014, 0x0225 },
77− { 0x3015, 0x1e01 },
78− { 0x3016, 0x0225 },
79− { 0x3017, 0xfa00 },
80− { 0x3018, 0x0000 },
81− { 0x3019, 0xf000 },
82− { 0x301a, 0x0000 },
83− { 0x301b, 0xf000 },
84− { 0x301c, 0x0000 },
85− { 0x301d, 0xf000 },
86− { 0x301e, 0x0000 },
87− { 0x301f, 0xf000 },
88− { 0x3020, 0x0000 },
89− { 0x3021, 0xf000 },
90− { 0x3022, 0x0000 },
91− { 0x3023, 0xf000 },
92− { 0x3024, 0x0000 },
93− { 0x3025, 0xf000 },
94− { 0x3026, 0x0000 },
95− { 0x3027, 0xf000 },
96− { 0x3028, 0x0000 },
97− { 0x3029, 0xf000 },
98− { 0x302a, 0x0000 },
99− { 0x302b, 0xf000 },
100− { 0x302c, 0x0000 },
101− { 0x302d, 0xf000 },
102− { 0x302e, 0x0000 },
103− { 0x302f, 0xf000 },
104− { 0x3030, 0x0225 },
105− { 0x3031, 0x1a01 },
106− { 0x3032, 0x0225 },
107− { 0x3033, 0x1e00 },
108− { 0x3034, 0x0225 },
109− { 0x3035, 0x1f00 },
110− { 0x3036, 0x6225 },
111− { 0x3037, 0xf800 },
112− { 0x3038, 0x0000 },
113− { 0x3039, 0xf000 },
114− { 0x303a, 0x0000 },
115− { 0x303b, 0xf000 },
116− { 0x303c, 0x0000 },
117− { 0x303d, 0xf000 },
118− { 0x303e, 0x0000 },
119− { 0x303f, 0xf000 },
120− { 0x3040, 0x2226 },
121− { 0x3041, 0x3a03 },
122− { 0x3042, 0x0226 },
123− { 0x3043, 0x0801 },
124− { 0x3044, 0x6249 },
125− { 0x3045, 0x0c06 },
126− { 0x3046, 0x0226 },
127− { 0x3047, 0x5901 },
128− { 0x3048, 0xe249 },
129− { 0x3049, 0x030d },
130− { 0x304a, 0x0249 },
131− { 0x304b, 0x2c01 },
132− { 0x304c, 0xe249 },
133− { 0x304d, 0x4342 },
134− { 0x304e, 0xe249 },
135− { 0x304f, 0x73c0 },
136− { 0x3050, 0x4249 },
137− { 0x3051, 0x0c00 },
138− { 0x3052, 0x0226 },
139− { 0x3053, 0x1f01 },
140− { 0x3054, 0x0226 },
141− { 0x3055, 0x1e01 },
142− { 0x3056, 0x0226 },
143− { 0x3057, 0xfa00 },
144− { 0x3058, 0x0000 },
145− { 0x3059, 0xf000 },
146− { 0x305a, 0x0000 },
147− { 0x305b, 0xf000 },
148− { 0x305c, 0x0000 },
149− { 0x305d, 0xf000 },
150− { 0x305e, 0x0000 },
151− { 0x305f, 0xf000 },
152− { 0x3060, 0x0000 },
153− { 0x3061, 0xf000 },
154− { 0x3062, 0x0000 },
155− { 0x3063, 0xf000 },
156− { 0x3064, 0x0000 },
157− { 0x3065, 0xf000 },
158− { 0x3066, 0x0000 },
159− { 0x3067, 0xf000 },
160− { 0x3068, 0x0000 },
161− { 0x3069, 0xf000 },
162− { 0x306a, 0x0000 },
163− { 0x306b, 0xf000 },
164− { 0x306c, 0x0000 },
165− { 0x306d, 0xf000 },
166− { 0x306e, 0x0000 },
167− { 0x306f, 0xf000 },
168− { 0x3070, 0x0226 },
169− { 0x3071, 0x1a01 },
170− { 0x3072, 0x0226 },
171− { 0x3073, 0x1e00 },
172− { 0x3074, 0x0226 },
173− { 0x3075, 0x1f00 },
174− { 0x3076, 0x6226 },
175− { 0x3077, 0xf800 },
176− { 0x3078, 0x0000 },
177− { 0x3079, 0xf000 },
178− { 0x307a, 0x0000 },
179− { 0x307b, 0xf000 },
180− { 0x307c, 0x0000 },
181− { 0x307d, 0xf000 },
182− { 0x307e, 0x0000 },
183− { 0x307f, 0xf000 },
184− { 0x3080, 0x2227 },
185− { 0x3081, 0x3a03 },
186− { 0x3082, 0x0227 },
187− { 0x3083, 0x0801 },
188− { 0x3084, 0x6255 },
189− { 0x3085, 0x0c04 },
190− { 0x3086, 0x0227 },
191− { 0x3087, 0x5901 },
192− { 0x3088, 0xe255 },
193− { 0x3089, 0x030d },
194− { 0x308a, 0x0255 },
195− { 0x308b, 0x2c01 },
196− { 0x308c, 0xe255 },
197− { 0x308d, 0x4342 },
198− { 0x308e, 0xe255 },
199− { 0x308f, 0x73c0 },
200− { 0x3090, 0x4255 },
201− { 0x3091, 0x0c00 },
202− { 0x3092, 0x0227 },
203− { 0x3093, 0x1f01 },
204− { 0x3094, 0x0227 },
205− { 0x3095, 0x1e01 },
206− { 0x3096, 0x0227 },
207− { 0x3097, 0xfa00 },
208− { 0x3098, 0x0000 },
209− { 0x3099, 0xf000 },
210− { 0x309a, 0x0000 },
211− { 0x309b, 0xf000 },
212− { 0x309c, 0x0000 },
213− { 0x309d, 0xf000 },
214− { 0x309e, 0x0000 },
215− { 0x309f, 0xf000 },
216− { 0x30a0, 0x0000 },
217− { 0x30a1, 0xf000 },
218− { 0x30a2, 0x0000 },
219− { 0x30a3, 0xf000 },
220− { 0x30a4, 0x0000 },
221− { 0x30a5, 0xf000 },
222− { 0x30a6, 0x0000 },
223− { 0x30a7, 0xf000 },
224− { 0x30a8, 0x0000 },
225− { 0x30a9, 0xf000 },
226− { 0x30aa, 0x0000 },
227− { 0x30ab, 0xf000 },
228− { 0x30ac, 0x0000 },
229− { 0x30ad, 0xf000 },
230− { 0x30ae, 0x0000 },
231− { 0x30af, 0xf000 },
232− { 0x30b0, 0x0227 },
233− { 0x30b1, 0x1a01 },
234− { 0x30b2, 0x0227 },
235− { 0x30b3, 0x1e00 },
236− { 0x30b4, 0x0227 },
237− { 0x30b5, 0x1f00 },
238− { 0x30b6, 0x6227 },
239− { 0x30b7, 0xf800 },
240− { 0x30b8, 0x0000 },
241− { 0x30b9, 0xf000 },
242− { 0x30ba, 0x0000 },
243− { 0x30bb, 0xf000 },
244− { 0x30bc, 0x0000 },
245− { 0x30bd, 0xf000 },
246− { 0x30be, 0x0000 },
247− { 0x30bf, 0xf000 },
248− { 0x30c0, 0x2228 },
249− { 0x30c1, 0x3a03 },
250− { 0x30c2, 0x0228 },
251− { 0x30c3, 0x0801 },
252− { 0x30c4, 0x6255 },
253− { 0x30c5, 0x0c06 },
254− { 0x30c6, 0x0228 },
255− { 0x30c7, 0x5901 },
256− { 0x30c8, 0xe255 },
257− { 0x30c9, 0x030d },
258− { 0x30ca, 0x0255 },
259− { 0x30cb, 0x2c01 },
260− { 0x30cc, 0xe255 },
261− { 0x30cd, 0x4342 },
262− { 0x30ce, 0xe255 },
263− { 0x30cf, 0x73c0 },
264− { 0x30d0, 0x4255 },
265− { 0x30d1, 0x0c00 },
266− { 0x30d2, 0x0228 },
267− { 0x30d3, 0x1f01 },
268− { 0x30d4, 0x0228 },
269− { 0x30d5, 0x1e01 },
270− { 0x30d6, 0x0228 },
271− { 0x30d7, 0xfa00 },
272− { 0x30d8, 0x0000 },
273− { 0x30d9, 0xf000 },
274− { 0x30da, 0x0000 },
275− { 0x30db, 0xf000 },
276− { 0x30dc, 0x0000 },
277− { 0x30dd, 0xf000 },
278− { 0x30de, 0x0000 },
279− { 0x30df, 0xf000 },
280− { 0x30e0, 0x0000 },
281− { 0x30e1, 0xf000 },
282− { 0x30e2, 0x0000 },
283− { 0x30e3, 0xf000 },
284− { 0x30e4, 0x0000 },
285− { 0x30e5, 0xf000 },
286− { 0x30e6, 0x0000 },
287− { 0x30e7, 0xf000 },
288− { 0x30e8, 0x0000 },
289− { 0x30e9, 0xf000 },
290− { 0x30ea, 0x0000 },
291− { 0x30eb, 0xf000 },
292− { 0x30ec, 0x0000 },
293− { 0x30ed, 0xf000 },
294− { 0x30ee, 0x0000 },
295− { 0x30ef, 0xf000 },
296− { 0x30f0, 0x0228 },
297− { 0x30f1, 0x1a01 },
298− { 0x30f2, 0x0228 },
299− { 0x30f3, 0x1e00 },
300− { 0x30f4, 0x0228 },
301− { 0x30f5, 0x1f00 },
302− { 0x30f6, 0x6228 },
303− { 0x30f7, 0xf800 },
304− { 0x30f8, 0x0000 },
305− { 0x30f9, 0xf000 },
306− { 0x30fa, 0x0000 },
307− { 0x30fb, 0xf000 },
308− { 0x30fc, 0x0000 },
309− { 0x30fd, 0xf000 },
310− { 0x30fe, 0x0000 },
311− { 0x30ff, 0xf000 },
312− { 0x3100, 0x222b },
313− { 0x3101, 0x3a03 },
314− { 0x3102, 0x222b },
315− { 0x3103, 0x5803 },
316− { 0x3104, 0xe26f },
317− { 0x3105, 0x030d },
318− { 0x3106, 0x626f },
319− { 0x3107, 0x2c01 },
320− { 0x3108, 0xe26f },
321− { 0x3109, 0x4342 },
322− { 0x310a, 0xe26f },
323− { 0x310b, 0x73c0 },
324− { 0x310c, 0x026f },
325− { 0x310d, 0x0c00 },
326− { 0x310e, 0x022b },
327− { 0x310f, 0x1f01 },
328− { 0x3110, 0x022b },
329− { 0x3111, 0x1e01 },
330− { 0x3112, 0x022b },
331− { 0x3113, 0xfa00 },
332− { 0x3114, 0x0000 },
333− { 0x3115, 0xf000 },
334− { 0x3116, 0x0000 },
335− { 0x3117, 0xf000 },
336− { 0x3118, 0x0000 },
337− { 0x3119, 0xf000 },
338− { 0x311a, 0x0000 },
339− { 0x311b, 0xf000 },
340− { 0x311c, 0x0000 },
341− { 0x311d, 0xf000 },
342− { 0x311e, 0x0000 },
343− { 0x311f, 0xf000 },
344− { 0x3120, 0x022b },
345− { 0x3121, 0x0a01 },
346− { 0x3122, 0x022b },
347− { 0x3123, 0x1e00 },
348− { 0x3124, 0x022b },
349− { 0x3125, 0x1f00 },
350− { 0x3126, 0x622b },
351− { 0x3127, 0xf800 },
352− { 0x3128, 0x0000 },
353− { 0x3129, 0xf000 },
354− { 0x312a, 0x0000 },
355− { 0x312b, 0xf000 },
356− { 0x312c, 0x0000 },
357− { 0x312d, 0xf000 },
358− { 0x312e, 0x0000 },
359− { 0x312f, 0xf000 },
360− { 0x3130, 0x0000 },
361− { 0x3131, 0xf000 },
362− { 0x3132, 0x0000 },
363− { 0x3133, 0xf000 },
364− { 0x3134, 0x0000 },
365− { 0x3135, 0xf000 },
366− { 0x3136, 0x0000 },
367− { 0x3137, 0xf000 },
368− { 0x3138, 0x0000 },
369− { 0x3139, 0xf000 },
370− { 0x313a, 0x0000 },
371− { 0x313b, 0xf000 },
372− { 0x313c, 0x0000 },
373− { 0x313d, 0xf000 },
374− { 0x313e, 0x0000 },
375− { 0x313f, 0xf000 },
376− { 0x3140, 0x0000 },
377− { 0x3141, 0xf000 },
378− { 0x3142, 0x0000 },
379− { 0x3143, 0xf000 },
380− { 0x3144, 0x0000 },
381− { 0x3145, 0xf000 },
382− { 0x3146, 0x0000 },
383− { 0x3147, 0xf000 },
384− { 0x3148, 0x0000 },
385− { 0x3149, 0xf000 },
386− { 0x314a, 0x0000 },
387− { 0x314b, 0xf000 },
388− { 0x314c, 0x0000 },
389− { 0x314d, 0xf000 },
390− { 0x314e, 0x0000 },
391− { 0x314f, 0xf000 },
392− { 0x3150, 0x0000 },
393− { 0x3151, 0xf000 },
394− { 0x3152, 0x0000 },
395− { 0x3153, 0xf000 },
396− { 0x3154, 0x0000 },
397− { 0x3155, 0xf000 },
398− { 0x3156, 0x0000 },
399− { 0x3157, 0xf000 },
400− { 0x3158, 0x0000 },
401− { 0x3159, 0xf000 },
402− { 0x315a, 0x0000 },
403− { 0x315b, 0xf000 },
404− { 0x315c, 0x0000 },
405− { 0x315d, 0xf000 },
406− { 0x315e, 0x0000 },
407− { 0x315f, 0xf000 },
408− { 0x3160, 0x0000 },
409− { 0x3161, 0xf000 },
410− { 0x3162, 0x0000 },
411− { 0x3163, 0xf000 },
412− { 0x3164, 0x0000 },
413− { 0x3165, 0xf000 },
414− { 0x3166, 0x0000 },
415− { 0x3167, 0xf000 },
416− { 0x3168, 0x0000 },
417− { 0x3169, 0xf000 },
418− { 0x316a, 0x0000 },
419− { 0x316b, 0xf000 },
420− { 0x316c, 0x0000 },
421− { 0x316d, 0xf000 },
422− { 0x316e, 0x0000 },
423− { 0x316f, 0xf000 },
424− { 0x3170, 0x0000 },
425− { 0x3171, 0xf000 },
426− { 0x3172, 0x0000 },
427− { 0x3173, 0xf000 },
428− { 0x3174, 0x0000 },
429− { 0x3175, 0xf000 },
430− { 0x3176, 0x0000 },
431− { 0x3177, 0xf000 },
432− { 0x3178, 0x0000 },
433− { 0x3179, 0xf000 },
434− { 0x317a, 0x0000 },
435− { 0x317b, 0xf000 },
436− { 0x317c, 0x0000 },
437− { 0x317d, 0xf000 },
438− { 0x317e, 0x0000 },
439− { 0x317f, 0xf000 },
440− { 0x3180, 0x2001 },
441− { 0x3181, 0xf101 },
442− { 0x3182, 0x0000 },
443− { 0x3183, 0xf000 },
444− { 0x3184, 0x0000 },
445− { 0x3185, 0xf000 },
446− { 0x3186, 0x0000 },
447− { 0x3187, 0xf000 },
448− { 0x3188, 0x0000 },
449− { 0x3189, 0xf000 },
450− { 0x318a, 0x0000 },
451− { 0x318b, 0xf000 },
452− { 0x318c, 0x0000 },
453− { 0x318d, 0xf000 },
454− { 0x318e, 0x0000 },
455− { 0x318f, 0xf000 },
456− { 0x3190, 0x0000 },
457− { 0x3191, 0xf000 },
458− { 0x3192, 0x0000 },
459− { 0x3193, 0xf000 },
460− { 0x3194, 0x0000 },
461− { 0x3195, 0xf000 },
462− { 0x3196, 0x0000 },
463− { 0x3197, 0xf000 },
464− { 0x3198, 0x0000 },
465− { 0x3199, 0xf000 },
466− { 0x319a, 0x0000 },
467− { 0x319b, 0xf000 },
468− { 0x319c, 0x0000 },
469− { 0x319d, 0xf000 },
470− { 0x319e, 0x0000 },
471− { 0x319f, 0xf000 },
472− { 0x31a0, 0x0000 },
473− { 0x31a1, 0xf000 },
474− { 0x31a2, 0x0000 },
475− { 0x31a3, 0xf000 },
476− { 0x31a4, 0x0000 },
477− { 0x31a5, 0xf000 },
478− { 0x31a6, 0x0000 },
479− { 0x31a7, 0xf000 },
480− { 0x31a8, 0x0000 },
481− { 0x31a9, 0xf000 },
482− { 0x31aa, 0x0000 },
483− { 0x31ab, 0xf000 },
484− { 0x31ac, 0x0000 },
485− { 0x31ad, 0xf000 },
486− { 0x31ae, 0x0000 },
487− { 0x31af, 0xf000 },
488− { 0x31b0, 0x0000 },
489− { 0x31b1, 0xf000 },
490− { 0x31b2, 0x0000 },
491− { 0x31b3, 0xf000 },
492− { 0x31b4, 0x0000 },
493− { 0x31b5, 0xf000 },
494− { 0x31b6, 0x0000 },
495− { 0x31b7, 0xf000 },
496− { 0x31b8, 0x0000 },
497− { 0x31b9, 0xf000 },
498− { 0x31ba, 0x0000 },
499− { 0x31bb, 0xf000 },
500− { 0x31bc, 0x0000 },
501− { 0x31bd, 0xf000 },
502− { 0x31be, 0x0000 },
503− { 0x31bf, 0xf000 },
504− { 0x31c0, 0x0000 },
505− { 0x31c1, 0xf000 },
506− { 0x31c2, 0x0000 },
507− { 0x31c3, 0xf000 },
508− { 0x31c4, 0x0000 },
509− { 0x31c5, 0xf000 },
510− { 0x31c6, 0x0000 },
511− { 0x31c7, 0xf000 },
512− { 0x31c8, 0x0000 },
513− { 0x31c9, 0xf000 },
514− { 0x31ca, 0x0000 },
515− { 0x31cb, 0xf000 },
516− { 0x31cc, 0x0000 },
517− { 0x31cd, 0xf000 },
518− { 0x31ce, 0x0000 },
519− { 0x31cf, 0xf000 },
520− { 0x31d0, 0x0000 },
521− { 0x31d1, 0xf000 },
522− { 0x31d2, 0x0000 },
523− { 0x31d3, 0xf000 },
524− { 0x31d4, 0x0000 },
525− { 0x31d5, 0xf000 },
526− { 0x31d6, 0x0000 },
527− { 0x31d7, 0xf000 },
528− { 0x31d8, 0x0000 },
529− { 0x31d9, 0xf000 },
530− { 0x31da, 0x0000 },
531− { 0x31db, 0xf000 },
532− { 0x31dc, 0x0000 },
533− { 0x31dd, 0xf000 },
534− { 0x31de, 0x0000 },
535− { 0x31df, 0xf000 },
536− { 0x31e0, 0x0000 },
537− { 0x31e1, 0xf000 },
538− { 0x31e2, 0x0000 },
539− { 0x31e3, 0xf000 },
540− { 0x31e4, 0x0000 },
541− { 0x31e5, 0xf000 },
542− { 0x31e6, 0x0000 },
543− { 0x31e7, 0xf000 },
544− { 0x31e8, 0x0000 },
545− { 0x31e9, 0xf000 },
546− { 0x31ea, 0x0000 },
547− { 0x31eb, 0xf000 },
548− { 0x31ec, 0x0000 },
549− { 0x31ed, 0xf000 },
550− { 0x31ee, 0x0000 },
551− { 0x31ef, 0xf000 },
552− { 0x31f0, 0x0000 },
553− { 0x31f1, 0xf000 },
554− { 0x31f2, 0x0000 },
555− { 0x31f3, 0xf000 },
556− { 0x31f4, 0x0000 },
557− { 0x31f5, 0xf000 },
558− { 0x31f6, 0x0000 },
559− { 0x31f7, 0xf000 },
560− { 0x31f8, 0x0000 },
561− { 0x31f9, 0xf000 },
562− { 0x31fa, 0x0000 },
563− { 0x31fb, 0xf000 },
564− { 0x31fc, 0x0000 },
565− { 0x31fd, 0xf000 },
566− { 0x31fe, 0x0000 },
567− { 0x31ff, 0xf000 },
568− { 0x024d, 0xff50 },
569− { 0x0252, 0xff50 },
570− { 0x0259, 0x0112 },
571− { 0x025e, 0x0112 },
572− { 0x101, 0x0304 },
57356 { 0x80, 0x0000 },
57457 };
57558
drivers/mmc/host/dw_mmc-exynos.c+4−4
@@ -208,7 +208,7 @@ static unsigned long exynos5250_dwmmc_caps[4] = { · 207 unmodified lines
208208 MMC_CAP_CMD23,
209209 };
210210
211−static struct dw_mci_drv_data exynos5250_drv_data = {
211+static const struct dw_mci_drv_data exynos5250_drv_data = {
212212 .caps = exynos5250_dwmmc_caps,
213213 .init = dw_mci_exynos_priv_init,
214214 .setup_clock = dw_mci_exynos_setup_clock,
@@ -220,14 +220,14 @@ static struct dw_mci_drv_data exynos5250_drv_data = { · 5 unmodified lines
220220
221221 static const struct of_device_id dw_mci_exynos_match[] = {
222222 { .compatible = "samsung,exynos5250-dw-mshc",
223− .data = (void *)&exynos5250_drv_data, },
223+ .data = &exynos5250_drv_data, },
224224 {},
225225 };
226−MODULE_DEVICE_TABLE(of, dw_mci_pltfm_match);
226+MODULE_DEVICE_TABLE(of, dw_mci_exynos_match);
227227
228228 int dw_mci_exynos_probe(struct platform_device *pdev)
229229 {
230− struct dw_mci_drv_data *drv_data;
230+ const struct dw_mci_drv_data *drv_data;
231231 const struct of_device_id *match;
232232
233233 match = of_match_node(dw_mci_exynos_match, pdev->dev.of_node);
drivers/mmc/host/dw_mmc-pltfm.c+3−3
@@ -24,7 +24,7 @@ · 23 unmodified lines
2424 #include "dw_mmc.h"
2525
2626 int dw_mci_pltfm_register(struct platform_device *pdev,
27− struct dw_mci_drv_data *drv_data)
27+ const struct dw_mci_drv_data *drv_data)
2828 {
2929 struct dw_mci *host;
3030 struct resource *regs;
@@ -50,8 +50,8 @@ int dw_mci_pltfm_register(struct platform_device *pdev, · 19 unmodified lines
5050 if (!host->regs)
5151 return -ENOMEM;
5252
53− if (host->drv_data->init) {
54− ret = host->drv_data->init(host);
53+ if (drv_data && drv_data->init) {
54+ ret = drv_data->init(host);
5555 if (ret)
5656 return ret;
5757 }
drivers/mmc/host/dw_mmc-pltfm.h+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 #define _DW_MMC_PLTFM_H_
1414
1515 extern int dw_mci_pltfm_register(struct platform_device *pdev,
16− struct dw_mci_drv_data *drv_data);
16+ const struct dw_mci_drv_data *drv_data);
1717 extern int __devexit dw_mci_pltfm_remove(struct platform_device *pdev);
1818 extern const struct dev_pm_ops dw_mci_pltfm_pmops;
1919
drivers/mmc/host/dw_mmc.c+34−28
@@ -232,6 +232,7 @@ static u32 dw_mci_prepare_command(struct mmc_host *mmc, struct mmc_command *cmd) · 231 unmodified lines
232232 {
233233 struct mmc_data *data;
234234 struct dw_mci_slot *slot = mmc_priv(mmc);
235+ struct dw_mci_drv_data *drv_data = slot->host->drv_data;
235236 u32 cmdr;
236237 cmd->error = -EINPROGRESS;
237238
@@ -261,8 +262,8 @@ static u32 dw_mci_prepare_command(struct mmc_host *mmc, struct mmc_command *cmd) · 23 unmodified lines
261262 cmdr |= SDMMC_CMD_DAT_WR;
262263 }
263264
264− if (slot->host->drv_data->prepare_command)
265− slot->host->drv_data->prepare_command(slot->host, &cmdr);
265+ if (drv_data && drv_data->prepare_command)
266+ drv_data->prepare_command(slot->host, &cmdr);
266267
267268 return cmdr;
268269 }
@@ -434,7 +435,7 @@ static int dw_mci_idmac_init(struct dw_mci *host) · 165 unmodified lines
434435 return 0;
435436 }
436437
437−static struct dw_mci_dma_ops dw_mci_idmac_ops = {
438+static const struct dw_mci_dma_ops dw_mci_idmac_ops = {
438439 .init = dw_mci_idmac_init,
439440 .start = dw_mci_idmac_start_dma,
440441 .stop = dw_mci_idmac_stop_dma,
@@ -772,6 +773,7 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq) · 331 unmodified lines
772773 static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
773774 {
774775 struct dw_mci_slot *slot = mmc_priv(mmc);
776+ struct dw_mci_drv_data *drv_data = slot->host->drv_data;
775777 u32 regs;
776778
777779 /* set default 1 bit mode */
@@ -807,8 +809,8 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) · 29 unmodified lines
807809 slot->clock = ios->clock;
808810 }
809811
810− if (slot->host->drv_data->set_ios)
811− slot->host->drv_data->set_ios(slot->host, ios);
812+ if (drv_data && drv_data->set_ios)
813+ drv_data->set_ios(slot->host, ios);
812814
813815 switch (ios->power_mode) {
814816 case MMC_POWER_UP:
@@ -1815,6 +1817,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) · 1000 unmodified lines
18151817 {
18161818 struct mmc_host *mmc;
18171819 struct dw_mci_slot *slot;
1820+ struct dw_mci_drv_data *drv_data = host->drv_data;
18181821 int ctrl_id, ret;
18191822 u8 bus_width;
18201823
@@ -1854,8 +1857,8 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) · 33 unmodified lines
18541857 } else {
18551858 ctrl_id = to_platform_device(host->dev)->id;
18561859 }
1857− if (host->drv_data && host->drv_data->caps)
1858− mmc->caps |= host->drv_data->caps[ctrl_id];
1860+ if (drv_data && drv_data->caps)
1861+ mmc->caps |= drv_data->caps[ctrl_id];
18591862
18601863 if (host->pdata->caps2)
18611864 mmc->caps2 = host->pdata->caps2;
@@ -1867,10 +1870,10 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) · 5 unmodified lines
18671870 else
18681871 bus_width = 1;
18691872
1870− if (host->drv_data->setup_bus) {
1873+ if (drv_data && drv_data->setup_bus) {
18711874 struct device_node *slot_np;
18721875 slot_np = dw_mci_of_find_slot_node(host->dev, slot->id);
1873− ret = host->drv_data->setup_bus(host, slot_np, bus_width);
1876+ ret = drv_data->setup_bus(host, slot_np, bus_width);
18741877 if (ret)
18751878 goto err_setup_bus;
18761879 }
@@ -1968,7 +1971,7 @@ static void dw_mci_init_dma(struct dw_mci *host) · 91 unmodified lines
19681971 /* Determine which DMA interface to use */
19691972 #ifdef CONFIG_MMC_DW_IDMAC
19701973 host->dma_ops = &dw_mci_idmac_ops;
1971− dev_info(&host->dev, "Using internal DMA controller.\n");
1974+ dev_info(host->dev, "Using internal DMA controller.\n");
19721975 #endif
19731976
19741977 if (!host->dma_ops)
@@ -2035,6 +2038,7 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host) · 60 unmodified lines
20352038 struct dw_mci_board *pdata;
20362039 struct device *dev = host->dev;
20372040 struct device_node *np = dev->of_node;
2041+ struct dw_mci_drv_data *drv_data = host->drv_data;
20382042 int idx, ret;
20392043
20402044 pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
@@ -2062,8 +2066,8 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host) · 21 unmodified lines
20622066
20632067 of_property_read_u32(np, "card-detect-delay", &pdata->detect_delay_ms);
20642068
2065− if (host->drv_data->parse_dt) {
2066− ret = host->drv_data->parse_dt(host);
2069+ if (drv_data && drv_data->parse_dt) {
2070+ ret = drv_data->parse_dt(host);
20672071 if (ret)
20682072 return ERR_PTR(ret);
20692073 }
@@ -2080,6 +2084,7 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host) · 10 unmodified lines
20802084
20812085 int dw_mci_probe(struct dw_mci *host)
20822086 {
2087+ struct dw_mci_drv_data *drv_data = host->drv_data;
20832088 int width, i, ret = 0;
20842089 u32 fifo_size;
20852090 int init_slots = 0;
@@ -2127,8 +2132,8 @@ int dw_mci_probe(struct dw_mci *host) · 41 unmodified lines
21272132 else
21282133 host->bus_hz = clk_get_rate(host->ciu_clk);
21292134
2130− if (host->drv_data->setup_clock) {
2131− ret = host->drv_data->setup_clock(host);
2135+ if (drv_data && drv_data->setup_clock) {
2136+ ret = drv_data->setup_clock(host);
21322137 if (ret) {
21332138 dev_err(host->dev,
21342139 "implementation specific clock setup failed\n");
@@ -2228,6 +2233,21 @@ int dw_mci_probe(struct dw_mci *host) · 93 unmodified lines
22282233 else
22292234 host->num_slots = ((mci_readl(host, HCON) >> 1) & 0x1F) + 1;
22302235
2236+ /*
2237+ * Enable interrupts for command done, data over, data empty, card det,
2238+ * receive ready and error such as transmit, receive timeout, crc error
2239+ */
2240+ mci_writel(host, RINTSTS, 0xFFFFFFFF);
2241+ mci_writel(host, INTMASK, SDMMC_INT_CMD_DONE | SDMMC_INT_DATA_OVER |
2242+ SDMMC_INT_TXDR | SDMMC_INT_RXDR |
2243+ DW_MCI_ERROR_FLAGS | SDMMC_INT_CD);
2244+ mci_writel(host, CTRL, SDMMC_CTRL_INT_ENABLE); /* Enable mci interrupt */
2245+
2246+ dev_info(host->dev, "DW MMC controller at irq %d, "
2247+ "%d bit host data width, "
2248+ "%u deep fifo\n",
2249+ host->irq, width, fifo_size);
2250+
22312251 /* We need at least one slot to succeed */
22322252 for (i = 0; i < host->num_slots; i++) {
22332253 ret = dw_mci_init_slot(host, i);
@@ -2257,20 +2277,6 @@ int dw_mci_probe(struct dw_mci *host) · 23 unmodified lines
22572277 else
22582278 host->data_offset = DATA_240A_OFFSET;
22592279
2260− /*
2261− * Enable interrupts for command done, data over, data empty, card det,
2262− * receive ready and error such as transmit, receive timeout, crc error
2263− */
2264− mci_writel(host, RINTSTS, 0xFFFFFFFF);
2265− mci_writel(host, INTMASK, SDMMC_INT_CMD_DONE | SDMMC_INT_DATA_OVER |
2266− SDMMC_INT_TXDR | SDMMC_INT_RXDR |
2267− DW_MCI_ERROR_FLAGS | SDMMC_INT_CD);
2268− mci_writel(host, CTRL, SDMMC_CTRL_INT_ENABLE); /* Enable mci interrupt */
2269−
2270− dev_info(host->dev, "DW MMC controller at irq %d, "
2271− "%d bit host data width, "
2272− "%u deep fifo\n",
2273− host->irq, width, fifo_size);
22742280 if (host->quirks & DW_MCI_QUIRK_IDMAC_DTO)
22752281 dev_info(host->dev, "Internal DMAC interrupt fix enabled.\n");
22762282
drivers/mmc/host/mxcmmc.c+1−1
@@ -1134,4 +1134,4 @@ module_platform_driver(mxcmci_driver); · 1133 unmodified lines
11341134 MODULE_DESCRIPTION("i.MX Multimedia Card Interface Driver");
11351135 MODULE_AUTHOR("Sascha Hauer, Pengutronix");
11361136 MODULE_LICENSE("GPL");
1137−MODULE_ALIAS("platform:imx-mmc");
1137+MODULE_ALIAS("platform:mxc-mmc");
drivers/mmc/host/omap_hsmmc.c+12−7
@@ -178,7 +178,8 @@ struct omap_hsmmc_host { · 177 unmodified lines
178178
179179 static int omap_hsmmc_card_detect(struct device *dev, int slot)
180180 {
181− struct omap_mmc_platform_data *mmc = dev->platform_data;
181+ struct omap_hsmmc_host *host = dev_get_drvdata(dev);
182+ struct omap_mmc_platform_data *mmc = host->pdata;
182183
183184 /* NOTE: assumes card detect signal is active-low */
184185 return !gpio_get_value_cansleep(mmc->slots[0].switch_pin);
@@ -186,7 +187,8 @@ static int omap_hsmmc_card_detect(struct device *dev, int slot) · 1 unmodified line
186187
187188 static int omap_hsmmc_get_wp(struct device *dev, int slot)
188189 {
189− struct omap_mmc_platform_data *mmc = dev->platform_data;
190+ struct omap_hsmmc_host *host = dev_get_drvdata(dev);
191+ struct omap_mmc_platform_data *mmc = host->pdata;
190192
191193 /* NOTE: assumes write protect signal is active-high */
192194 return gpio_get_value_cansleep(mmc->slots[0].gpio_wp);
@@ -194,7 +196,8 @@ static int omap_hsmmc_get_wp(struct device *dev, int slot) · 1 unmodified line
194196
195197 static int omap_hsmmc_get_cover_state(struct device *dev, int slot)
196198 {
197− struct omap_mmc_platform_data *mmc = dev->platform_data;
199+ struct omap_hsmmc_host *host = dev_get_drvdata(dev);
200+ struct omap_mmc_platform_data *mmc = host->pdata;
198201
199202 /* NOTE: assumes card detect signal is active-low */
200203 return !gpio_get_value_cansleep(mmc->slots[0].switch_pin);
@@ -204,7 +207,8 @@ static int omap_hsmmc_get_cover_state(struct device *dev, int slot) · 3 unmodified lines
204207
205208 static int omap_hsmmc_suspend_cdirq(struct device *dev, int slot)
206209 {
207− struct omap_mmc_platform_data *mmc = dev->platform_data;
210+ struct omap_hsmmc_host *host = dev_get_drvdata(dev);
211+ struct omap_mmc_platform_data *mmc = host->pdata;
208212
209213 disable_irq(mmc->slots[0].card_detect_irq);
210214 return 0;
@@ -212,7 +216,8 @@ static int omap_hsmmc_suspend_cdirq(struct device *dev, int slot) · 1 unmodified line
212216
213217 static int omap_hsmmc_resume_cdirq(struct device *dev, int slot)
214218 {
215− struct omap_mmc_platform_data *mmc = dev->platform_data;
219+ struct omap_hsmmc_host *host = dev_get_drvdata(dev);
220+ struct omap_mmc_platform_data *mmc = host->pdata;
216221
217222 enable_irq(mmc->slots[0].card_detect_irq);
218223 return 0;
@@ -2009,9 +2014,9 @@ static int __devexit omap_hsmmc_remove(struct platform_device *pdev) · 1790 unmodified lines
20092014 clk_put(host->dbclk);
20102015 }
20112016
2012− mmc_free_host(host->mmc);
2017+ omap_hsmmc_gpio_free(host->pdata);
20132018 iounmap(host->base);
2014− omap_hsmmc_gpio_free(pdev->dev.platform_data);
2019+ mmc_free_host(host->mmc);
20152020
20162021 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
20172022 if (res)
drivers/mmc/host/sdhci-dove.c+20−18
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2020 */
2121
22+#include <linux/err.h>
2223 #include <linux/io.h>
2324 #include <linux/clk.h>
2425 #include <linux/err.h>
@@ -84,30 +85,32 @@ static int __devinit sdhci_dove_probe(struct platform_device *pdev) · 59 unmodified lines
8485 struct sdhci_dove_priv *priv;
8586 int ret;
8687
87− ret = sdhci_pltfm_register(pdev, &sdhci_dove_pdata);
88− if (ret)
89− goto sdhci_dove_register_fail;
90−
9188 priv = devm_kzalloc(&pdev->dev, sizeof(struct sdhci_dove_priv),
9289 GFP_KERNEL);
9390 if (!priv) {
9491 dev_err(&pdev->dev, "unable to allocate private data");
95− ret = -ENOMEM;
96− goto sdhci_dove_allocate_fail;
92+ return -ENOMEM;
9793 }
9894
95+ priv->clk = clk_get(&pdev->dev, NULL);
96+ if (!IS_ERR(priv->clk))
97+ clk_prepare_enable(priv->clk);
98+
99+ ret = sdhci_pltfm_register(pdev, &sdhci_dove_pdata);
100+ if (ret)
101+ goto sdhci_dove_register_fail;
102+
99103 host = platform_get_drvdata(pdev);
100104 pltfm_host = sdhci_priv(host);
101105 pltfm_host->priv = priv;
102106
103− priv->clk = clk_get(&pdev->dev, NULL);
104− if (!IS_ERR(priv->clk))
105− clk_prepare_enable(priv->clk);
106107 return 0;
107108
108−sdhci_dove_allocate_fail:
109− sdhci_pltfm_unregister(pdev);
110109 sdhci_dove_register_fail:
110+ if (!IS_ERR(priv->clk)) {
111+ clk_disable_unprepare(priv->clk);
112+ clk_put(priv->clk);
113+ }
111114 return ret;
112115 }
113116
@@ -117,14 +120,13 @@ static int __devexit sdhci_dove_remove(struct platform_device *pdev) · 3 unmodified lines
117120 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
118121 struct sdhci_dove_priv *priv = pltfm_host->priv;
119122
120− if (priv->clk) {
121− if (!IS_ERR(priv->clk)) {
122− clk_disable_unprepare(priv->clk);
123− clk_put(priv->clk);
124− }
125− devm_kfree(&pdev->dev, priv->clk);
123+ sdhci_pltfm_unregister(pdev);
124+
125+ if (!IS_ERR(priv->clk)) {
126+ clk_disable_unprepare(priv->clk);
127+ clk_put(priv->clk);
126128 }
127− return sdhci_pltfm_unregister(pdev);
129+ return 0;
128130 }
129131
130132 static const struct of_device_id sdhci_dove_of_match_table[] __devinitdata = {
drivers/mmc/host/sdhci-of-esdhc.c+11−0
@@ -169,6 +169,16 @@ static void esdhc_of_resume(struct sdhci_host *host) · 168 unmodified lines
169169 }
170170 #endif
171171
172+static void esdhc_of_platform_init(struct sdhci_host *host)
173+{
174+ u32 vvn;
175+
176+ vvn = in_be32(host->ioaddr + SDHCI_SLOT_INT_STATUS);
177+ vvn = (vvn & SDHCI_VENDOR_VER_MASK) >> SDHCI_VENDOR_VER_SHIFT;
178+ if (vvn == VENDOR_V_22)
179+ host->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
180+}
181+
172182 static struct sdhci_ops sdhci_esdhc_ops = {
173183 .read_l = esdhc_readl,
174184 .read_w = esdhc_readw,
@@ -180,6 +190,7 @@ static struct sdhci_ops sdhci_esdhc_ops = { · 5 unmodified lines
180190 .enable_dma = esdhc_of_enable_dma,
181191 .get_max_clock = esdhc_of_get_max_clock,
182192 .get_min_clock = esdhc_of_get_min_clock,
193+ .platform_init = esdhc_of_platform_init,
183194 #ifdef CONFIG_PM
184195 .platform_suspend = esdhc_of_suspend,
185196 .platform_resume = esdhc_of_resume,
drivers/mmc/host/sdhci-pci.c+1−1
@@ -1196,7 +1196,7 @@ static struct sdhci_pci_slot * __devinit sdhci_pci_probe_slot( · 1195 unmodified lines
11961196 return ERR_PTR(-ENODEV);
11971197 }
11981198
1199− if (pci_resource_len(pdev, bar) != 0x100) {
1199+ if (pci_resource_len(pdev, bar) < 0x100) {
12001200 dev_err(&pdev->dev, "Invalid iomem size. You may "
12011201 "experience problems.\n");
12021202 }
drivers/mmc/host/sdhci-pltfm.c+7−0
@@ -150,6 +150,13 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, · 149 unmodified lines
150150 goto err_remap;
151151 }
152152
153+ /*
154+ * Some platforms need to probe the controller to be able to
155+ * determine which caps should be used.
156+ */
157+ if (host->ops && host->ops->platform_init)
158+ host->ops->platform_init(host);
159+
153160 platform_set_drvdata(pdev, host);
154161
155162 return host;
drivers/mmc/host/sdhci-s3c.c+23−14
@@ -211,8 +211,8 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock) · 210 unmodified lines
211211 if (ourhost->cur_clk != best_src) {
212212 struct clk *clk = ourhost->clk_bus[best_src];
213213
214− clk_enable(clk);
215− clk_disable(ourhost->clk_bus[ourhost->cur_clk]);
214+ clk_prepare_enable(clk);
215+ clk_disable_unprepare(ourhost->clk_bus[ourhost->cur_clk]);
216216
217217 /* turn clock off to card before changing clock source */
218218 writew(0, host->ioaddr + SDHCI_CLOCK_CONTROL);
@@ -373,18 +373,25 @@ static struct sdhci_ops sdhci_s3c_ops = { · 154 unmodified lines
373373 static void sdhci_s3c_notify_change(struct platform_device *dev, int state)
374374 {
375375 struct sdhci_host *host = platform_get_drvdata(dev);
376+ struct sdhci_s3c *sc = sdhci_priv(host);
376377 unsigned long flags;
377378
378379 if (host) {
379380 spin_lock_irqsave(&host->lock, flags);
380381 if (state) {
381382 dev_dbg(&dev->dev, "card inserted.\n");
383+#ifdef CONFIG_PM_RUNTIME
384+ clk_prepare_enable(sc->clk_io);
385+#endif
382386 host->flags &= ~SDHCI_DEVICE_DEAD;
383387 host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
384388 } else {
385389 dev_dbg(&dev->dev, "card removed.\n");
386390 host->flags |= SDHCI_DEVICE_DEAD;
387391 host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
392+#ifdef CONFIG_PM_RUNTIME
393+ clk_disable_unprepare(sc->clk_io);
394+#endif
388395 }
389396 tasklet_schedule(&host->card_tasklet);
390397 spin_unlock_irqrestore(&host->lock, flags);
@@ -607,7 +614,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) · 216 unmodified lines
607614 }
608615
609616 /* enable the local io clock and keep it running for the moment. */
610− clk_enable(sc->clk_io);
617+ clk_prepare_enable(sc->clk_io);
611618
612619 for (clks = 0, ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
613620 struct clk *clk;
@@ -638,7 +645,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) · 24 unmodified lines
638645 }
639646
640647 #ifndef CONFIG_PM_RUNTIME
641− clk_enable(sc->clk_bus[sc->cur_clk]);
648+ clk_prepare_enable(sc->clk_bus[sc->cur_clk]);
642649 #endif
643650
644651 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -747,13 +754,14 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) · 102 unmodified lines
747754 sdhci_s3c_setup_card_detect_gpio(sc);
748755
749756 #ifdef CONFIG_PM_RUNTIME
750− clk_disable(sc->clk_io);
757+ if (pdata->cd_type != S3C_SDHCI_CD_INTERNAL)
758+ clk_disable_unprepare(sc->clk_io);
751759 #endif
752760 return 0;
753761
754762 err_req_regs:
755763 #ifndef CONFIG_PM_RUNTIME
756− clk_disable(sc->clk_bus[sc->cur_clk]);
764+ clk_disable_unprepare(sc->clk_bus[sc->cur_clk]);
757765 #endif
758766 for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
759767 if (sc->clk_bus[ptr]) {
@@ -762,7 +770,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) · 2 unmodified lines
762770 }
763771
764772 err_no_busclks:
765− clk_disable(sc->clk_io);
773+ clk_disable_unprepare(sc->clk_io);
766774 clk_put(sc->clk_io);
767775
768776 err_io_clk:
@@ -794,7 +802,8 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev) · 25 unmodified lines
794802 gpio_free(sc->ext_cd_gpio);
795803
796804 #ifdef CONFIG_PM_RUNTIME
797− clk_enable(sc->clk_io);
805+ if (pdata->cd_type != S3C_SDHCI_CD_INTERNAL)
806+ clk_prepare_enable(sc->clk_io);
798807 #endif
799808 sdhci_remove_host(host, 1);
800809
@@ -802,14 +811,14 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev) · 1 unmodified line
802811 pm_runtime_disable(&pdev->dev);
803812
804813 #ifndef CONFIG_PM_RUNTIME
805− clk_disable(sc->clk_bus[sc->cur_clk]);
814+ clk_disable_unprepare(sc->clk_bus[sc->cur_clk]);
806815 #endif
807816 for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
808817 if (sc->clk_bus[ptr]) {
809818 clk_put(sc->clk_bus[ptr]);
810819 }
811820 }
812− clk_disable(sc->clk_io);
821+ clk_disable_unprepare(sc->clk_io);
813822 clk_put(sc->clk_io);
814823
815824 if (pdev->dev.of_node) {
@@ -849,8 +858,8 @@ static int sdhci_s3c_runtime_suspend(struct device *dev) · 33 unmodified lines
849858
850859 ret = sdhci_runtime_suspend_host(host);
851860
852− clk_disable(ourhost->clk_bus[ourhost->cur_clk]);
853− clk_disable(busclk);
861+ clk_disable_unprepare(ourhost->clk_bus[ourhost->cur_clk]);
862+ clk_disable_unprepare(busclk);
854863 return ret;
855864 }
856865
@@ -861,8 +870,8 @@ static int sdhci_s3c_runtime_resume(struct device *dev) · 4 unmodified lines
861870 struct clk *busclk = ourhost->clk_io;
862871 int ret;
863872
864− clk_enable(busclk);
865− clk_enable(ourhost->clk_bus[ourhost->cur_clk]);
873+ clk_prepare_enable(busclk);
874+ clk_prepare_enable(ourhost->clk_bus[ourhost->cur_clk]);
866875 ret = sdhci_runtime_resume_host(host);
867876 return ret;
868877 }
drivers/mmc/host/sdhci.c+28−16
@@ -1315,16 +1315,19 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) · 1314 unmodified lines
13151315 */
13161316 if ((host->flags & SDHCI_NEEDS_RETUNING) &&
13171317 !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ))) {
1318− /* eMMC uses cmd21 while sd and sdio use cmd19 */
1319− tuning_opcode = mmc->card->type == MMC_TYPE_MMC ?
1320− MMC_SEND_TUNING_BLOCK_HS200 :
1321− MMC_SEND_TUNING_BLOCK;
1322− spin_unlock_irqrestore(&host->lock, flags);
1323− sdhci_execute_tuning(mmc, tuning_opcode);
1324− spin_lock_irqsave(&host->lock, flags);
1325−
1326− /* Restore original mmc_request structure */
1327− host->mrq = mrq;
1318+ if (mmc->card) {
1319+ /* eMMC uses cmd21 but sd and sdio use cmd19 */
1320+ tuning_opcode =
1321+ mmc->card->type == MMC_TYPE_MMC ?
1322+ MMC_SEND_TUNING_BLOCK_HS200 :
1323+ MMC_SEND_TUNING_BLOCK;
1324+ spin_unlock_irqrestore(&host->lock, flags);
1325+ sdhci_execute_tuning(mmc, tuning_opcode);
1326+ spin_lock_irqsave(&host->lock, flags);
1327+
1328+ /* Restore original mmc_request structure */
1329+ host->mrq = mrq;
1330+ }
13281331 }
13291332
13301333 if (mrq->sbc && !(host->flags & SDHCI_AUTO_CMD23))
@@ -2837,6 +2840,9 @@ int sdhci_add_host(struct sdhci_host *host) · 1506 unmodified lines
28372840 if (!(host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA))
28382841 mmc->caps |= MMC_CAP_4_BIT_DATA;
28392842
2843+ if (host->quirks2 & SDHCI_QUIRK2_HOST_NO_CMD23)
2844+ mmc->caps &= ~MMC_CAP_CMD23;
2845+
28402846 if (caps[0] & SDHCI_CAN_DO_HISPD)
28412847 mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
28422848
@@ -2846,9 +2852,12 @@ int sdhci_add_host(struct sdhci_host *host) · 3 unmodified lines
28462852
28472853 /* If vqmmc regulator and no 1.8V signalling, then there's no UHS */
28482854 host->vqmmc = regulator_get(mmc_dev(mmc), "vqmmc");
2849− if (IS_ERR(host->vqmmc)) {
2850− pr_info("%s: no vqmmc regulator found\n", mmc_hostname(mmc));
2851− host->vqmmc = NULL;
2855+ if (IS_ERR_OR_NULL(host->vqmmc)) {
2856+ if (PTR_ERR(host->vqmmc) < 0) {
2857+ pr_info("%s: no vqmmc regulator found\n",
2858+ mmc_hostname(mmc));
2859+ host->vqmmc = NULL;
2860+ }
28522861 }
28532862 else if (regulator_is_supported_voltage(host->vqmmc, 1800000, 1800000))
28542863 regulator_enable(host->vqmmc);
@@ -2904,9 +2913,12 @@ int sdhci_add_host(struct sdhci_host *host) · 49 unmodified lines
29042913 ocr_avail = 0;
29052914
29062915 host->vmmc = regulator_get(mmc_dev(mmc), "vmmc");
2907− if (IS_ERR(host->vmmc)) {
2908− pr_info("%s: no vmmc regulator found\n", mmc_hostname(mmc));
2909− host->vmmc = NULL;
2916+ if (IS_ERR_OR_NULL(host->vmmc)) {
2917+ if (PTR_ERR(host->vmmc) < 0) {
2918+ pr_info("%s: no vmmc regulator found\n",
2919+ mmc_hostname(mmc));
2920+ host->vmmc = NULL;
2921+ }
29102922 } else
29112923 regulator_enable(host->vmmc);
29122924
drivers/mmc/host/sdhci.h+1−0
@@ -278,6 +278,7 @@ struct sdhci_ops { · 277 unmodified lines
278278 void (*hw_reset)(struct sdhci_host *host);
279279 void (*platform_suspend)(struct sdhci_host *host);
280280 void (*platform_resume)(struct sdhci_host *host);
281+ void (*platform_init)(struct sdhci_host *host);
281282 };
282283
283284 #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
drivers/mmc/host/sh_mmcif.c+3−7
@@ -1104,7 +1104,6 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id) · 1103 unmodified lines
11041104 {
11051105 struct sh_mmcif_host *host = dev_id;
11061106 struct mmc_request *mrq = host->mrq;
1107− struct mmc_data *data = mrq->data;
11081107
11091108 cancel_delayed_work_sync(&host->timeout_work);
11101109
@@ -1152,13 +1151,14 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id) · 41 unmodified lines
11521151 case MMCIF_WAIT_FOR_READ_END:
11531152 case MMCIF_WAIT_FOR_WRITE_END:
11541153 if (host->sd_error)
1155− data->error = sh_mmcif_error_manage(host);
1154+ mrq->data->error = sh_mmcif_error_manage(host);
11561155 break;
11571156 default:
11581157 BUG();
11591158 }
11601159
11611160 if (host->wait_for != MMCIF_WAIT_FOR_STOP) {
1161+ struct mmc_data *data = mrq->data;
11621162 if (!mrq->cmd->error && data && !data->error)
11631163 data->bytes_xfered =
11641164 data->blocks * data->blksz;
@@ -1231,10 +1231,6 @@ static irqreturn_t sh_mmcif_intr(int irq, void *dev_id) · 66 unmodified lines
12311231 host->sd_error = true;
12321232 dev_dbg(&host->pd->dev, "int err state = %08x\n", state);
12331233 }
1234− if (host->state == STATE_IDLE) {
1235− dev_info(&host->pd->dev, "Spurious IRQ status 0x%x", state);
1236− return IRQ_HANDLED;
1237− }
12381234 if (state & ~(INT_CMD12RBE | INT_CMD12CRE)) {
12391235 if (!host->dma_active)
12401236 return IRQ_WAKE_THREAD;
@@ -1466,9 +1462,9 @@ static int __devexit sh_mmcif_remove(struct platform_device *pdev) · 225 unmodified lines
14661462
14671463 platform_set_drvdata(pdev, NULL);
14681464
1465+ clk_disable(host->hclk);
14691466 mmc_free_host(host->mmc);
14701467 pm_runtime_put_sync(&pdev->dev);
1471− clk_disable(host->hclk);
14721468 pm_runtime_disable(&pdev->dev);
14731469
14741470 return 0;
drivers/mtd/devices/slram.c+1−1
@@ -240,7 +240,7 @@ static int parse_cmdline(char *devname, char *szstart, char *szlength) · 239 unmodified lines
240240
241241 if (*(szlength) != '+') {
242242 devlength = simple_strtoul(szlength, &buffer, 0);
243− devlength = handle_unit(devlength, buffer) - devstart;
243+ devlength = handle_unit(devlength, buffer);
244244 if (devlength < devstart)
245245 goto err_out;
246246
drivers/mtd/nand/nand_base.c+6−4
@@ -2983,13 +2983,15 @@ static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip, · 2982 unmodified lines
29832983 /*
29842984 * Field definitions are in the following datasheets:
29852985 * Old style (4,5 byte ID): Samsung K9GAG08U0M (p.32)
2986− * New style (6 byte ID): Samsung K9GAG08U0F (p.44)
2986+ * New Samsung (6 byte ID): Samsung K9GAG08U0F (p.44)
29872987 * Hynix MLC (6 byte ID): Hynix H27UBG8T2B (p.22)
29882988 *
2989− * Check for ID length, cell type, and Hynix/Samsung ID to decide what
2990− * to do.
2989+ * Check for ID length, non-zero 6th byte, cell type, and Hynix/Samsung
2990+ * ID to decide what to do.
29912991 */
2992− if (id_len == 6 && id_data[0] == NAND_MFR_SAMSUNG) {
2992+ if (id_len == 6 && id_data[0] == NAND_MFR_SAMSUNG &&
2993+ (chip->cellinfo & NAND_CI_CELLTYPE_MSK) &&
2994+ id_data[5] != 0x00) {
29932995 /* Calc pagesize */
29942996 mtd->writesize = 2048 << (extid & 0x03);
29952997 extid >>= 2;
drivers/mtd/ofpart.c+1−1
@@ -121,7 +121,7 @@ static int parse_ofoldpart_partitions(struct mtd_info *master, · 120 unmodified lines
121121 nr_parts = plen / sizeof(part[0]);
122122
123123 *pparts = kzalloc(nr_parts * sizeof(*(*pparts)), GFP_KERNEL);
124− if (!pparts)
124+ if (!*pparts)
125125 return -ENOMEM;
126126
127127 names = of_get_property(dp, "partition-names", &plen);
drivers/mtd/onenand/onenand_base.c+1−1
@@ -3694,7 +3694,7 @@ static int flexonenand_check_blocks_erased(struct mtd_info *mtd, int start, int · 3693 unmodified lines
36943694 * flexonenand_set_boundary - Writes the SLC boundary
36953695 * @param mtd - mtd info structure
36963696 */
3697−int flexonenand_set_boundary(struct mtd_info *mtd, int die,
3697+static int flexonenand_set_boundary(struct mtd_info *mtd, int die,
36983698 int boundary, int lock)
36993699 {
37003700 struct onenand_chip *this = mtd->priv;
drivers/mtd/ubi/wl.c+16−10
@@ -498,7 +498,7 @@ out: · 497 unmodified lines
498498 * @ubi: UBI device description object
499499 *
500500 * This function returns a physical eraseblock in case of success and a
501− * negative error code in case of failure. Might sleep.
501+ * negative error code in case of failure.
502502 */
503503 static int __wl_get_peb(struct ubi_device *ubi)
504504 {
@@ -540,13 +540,6 @@ retry: · 35 unmodified lines
540540 * ubi_wl_get_peb() after removing e from the pool. */
541541 prot_queue_add(ubi, e);
542542 #endif
543− err = ubi_self_check_all_ff(ubi, e->pnum, ubi->vid_hdr_aloffset,
544− ubi->peb_size - ubi->vid_hdr_aloffset);
545− if (err) {
546− ubi_err("new PEB %d does not contain all 0xFF bytes", e->pnum);
547− return err;
548− }
549−
550543 return e->pnum;
551544 }
552545
@@ -679,17 +672,30 @@ static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi) · 126 unmodified lines
679672 #else
680673 static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi)
681674 {
682− return find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF);
675+ struct ubi_wl_entry *e;
676+
677+ e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF);
678+ self_check_in_wl_tree(ubi, e, &ubi->free);
679+ rb_erase(&e->u.rb, &ubi->free);
680+
681+ return e;
683682 }
684683
685684 int ubi_wl_get_peb(struct ubi_device *ubi)
686685 {
687− int peb;
686+ int peb, err;
688687
689688 spin_lock(&ubi->wl_lock);
690689 peb = __wl_get_peb(ubi);
691690 spin_unlock(&ubi->wl_lock);
692691
692+ err = ubi_self_check_all_ff(ubi, peb, ubi->vid_hdr_aloffset,
693+ ubi->peb_size - ubi->vid_hdr_aloffset);
694+ if (err) {
695+ ubi_err("new PEB %d does not contain all 0xFF bytes", peb);
696+ return err;
697+ }
698+
693699 return peb;
694700 }
695701 #endif
drivers/net/bonding/bond_main.c+36−64
@@ -1379,6 +1379,8 @@ static void bond_compute_features(struct bonding *bond) · 1378 unmodified lines
13791379 struct net_device *bond_dev = bond->dev;
13801380 netdev_features_t vlan_features = BOND_VLAN_FEATURES;
13811381 unsigned short max_hard_header_len = ETH_HLEN;
1382+ unsigned int gso_max_size = GSO_MAX_SIZE;
1383+ u16 gso_max_segs = GSO_MAX_SEGS;
13821384 int i;
13831385 unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE;
13841386
@@ -1394,11 +1396,16 @@ static void bond_compute_features(struct bonding *bond) · 9 unmodified lines
13941396 dst_release_flag &= slave->dev->priv_flags;
13951397 if (slave->dev->hard_header_len > max_hard_header_len)
13961398 max_hard_header_len = slave->dev->hard_header_len;
1399+
1400+ gso_max_size = min(gso_max_size, slave->dev->gso_max_size);
1401+ gso_max_segs = min(gso_max_segs, slave->dev->gso_max_segs);
13971402 }
13981403
13991404 done:
14001405 bond_dev->vlan_features = vlan_features;
14011406 bond_dev->hard_header_len = max_hard_header_len;
1407+ bond_dev->gso_max_segs = gso_max_segs;
1408+ netif_set_gso_max_size(bond_dev, gso_max_size);
14021409
14031410 flags = bond_dev->priv_flags & ~IFF_XMIT_DST_RELEASE;
14041411 bond_dev->priv_flags = flags | dst_release_flag;
@@ -3452,6 +3459,28 @@ static int bond_xmit_hash_policy_l34(struct sk_buff *skb, int count) · 2047 unmodified lines
34523459
34533460 /*-------------------------- Device entry points ----------------------------*/
34543461
3462+static void bond_work_init_all(struct bonding *bond)
3463+{
3464+ INIT_DELAYED_WORK(&bond->mcast_work,
3465+ bond_resend_igmp_join_requests_delayed);
3466+ INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor);
3467+ INIT_DELAYED_WORK(&bond->mii_work, bond_mii_monitor);
3468+ if (bond->params.mode == BOND_MODE_ACTIVEBACKUP)
3469+ INIT_DELAYED_WORK(&bond->arp_work, bond_activebackup_arp_mon);
3470+ else
3471+ INIT_DELAYED_WORK(&bond->arp_work, bond_loadbalance_arp_mon);
3472+ INIT_DELAYED_WORK(&bond->ad_work, bond_3ad_state_machine_handler);
3473+}
3474+
3475+static void bond_work_cancel_all(struct bonding *bond)
3476+{
3477+ cancel_delayed_work_sync(&bond->mii_work);
3478+ cancel_delayed_work_sync(&bond->arp_work);
3479+ cancel_delayed_work_sync(&bond->alb_work);
3480+ cancel_delayed_work_sync(&bond->ad_work);
3481+ cancel_delayed_work_sync(&bond->mcast_work);
3482+}
3483+
34553484 static int bond_open(struct net_device *bond_dev)
34563485 {
34573486 struct bonding *bond = netdev_priv(bond_dev);
@@ -3474,41 +3503,27 @@ static int bond_open(struct net_device *bond_dev) · 16 unmodified lines
34743503 }
34753504 read_unlock(&bond->lock);
34763505
3477− INIT_DELAYED_WORK(&bond->mcast_work, bond_resend_igmp_join_requests_delayed);
3506+ bond_work_init_all(bond);
34783507
34793508 if (bond_is_lb(bond)) {
34803509 /* bond_alb_initialize must be called before the timer
34813510 * is started.
34823511 */
3483− if (bond_alb_initialize(bond, (bond->params.mode == BOND_MODE_ALB))) {
3484− /* something went wrong - fail the open operation */
3512+ if (bond_alb_initialize(bond, (bond->params.mode == BOND_MODE_ALB)))
34853513 return -ENOMEM;
3486− }
3487−
3488− INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor);
34893514 queue_delayed_work(bond->wq, &bond->alb_work, 0);
34903515 }
34913516
3492− if (bond->params.miimon) { /* link check interval, in milliseconds. */
3493− INIT_DELAYED_WORK(&bond->mii_work, bond_mii_monitor);
3517+ if (bond->params.miimon) /* link check interval, in milliseconds. */
34943518 queue_delayed_work(bond->wq, &bond->mii_work, 0);
3495− }
34963519
34973520 if (bond->params.arp_interval) { /* arp interval, in milliseconds. */
3498− if (bond->params.mode == BOND_MODE_ACTIVEBACKUP)
3499− INIT_DELAYED_WORK(&bond->arp_work,
3500− bond_activebackup_arp_mon);
3501− else
3502− INIT_DELAYED_WORK(&bond->arp_work,
3503− bond_loadbalance_arp_mon);
3504−
35053521 queue_delayed_work(bond->wq, &bond->arp_work, 0);
35063522 if (bond->params.arp_validate)
35073523 bond->recv_probe = bond_arp_rcv;
35083524 }
35093525
35103526 if (bond->params.mode == BOND_MODE_8023AD) {
3511− INIT_DELAYED_WORK(&bond->ad_work, bond_3ad_state_machine_handler);
35123527 queue_delayed_work(bond->wq, &bond->ad_work, 0);
35133528 /* register to receive LACPDUs */
35143529 bond->recv_probe = bond_3ad_lacpdu_recv;
@@ -3523,34 +3538,10 @@ static int bond_close(struct net_device *bond_dev) · 8 unmodified lines
35233538 struct bonding *bond = netdev_priv(bond_dev);
35243539
35253540 write_lock_bh(&bond->lock);
3526−
35273541 bond->send_peer_notif = 0;
3528−
35293542 write_unlock_bh(&bond->lock);
35303543
3531− if (bond->params.miimon) { /* link check interval, in milliseconds. */
3532− cancel_delayed_work_sync(&bond->mii_work);
3533− }
3534−
3535− if (bond->params.arp_interval) { /* arp interval, in milliseconds. */
3536− cancel_delayed_work_sync(&bond->arp_work);
3537− }
3538−
3539− switch (bond->params.mode) {
3540− case BOND_MODE_8023AD:
3541− cancel_delayed_work_sync(&bond->ad_work);
3542− break;
3543− case BOND_MODE_TLB:
3544− case BOND_MODE_ALB:
3545− cancel_delayed_work_sync(&bond->alb_work);
3546− break;
3547− default:
3548− break;
3549− }
3550−
3551− if (delayed_work_pending(&bond->mcast_work))
3552− cancel_delayed_work_sync(&bond->mcast_work);
3553−
3544+ bond_work_cancel_all(bond);
35543545 if (bond_is_lb(bond)) {
35553546 /* Must be called only after all
35563547 * slaves have been released
@@ -4429,26 +4420,6 @@ static void bond_setup(struct net_device *bond_dev) · 872 unmodified lines
44294420 bond_dev->features |= bond_dev->hw_features;
44304421 }
44314422
4432−static void bond_work_cancel_all(struct bonding *bond)
4433−{
4434− if (bond->params.miimon && delayed_work_pending(&bond->mii_work))
4435− cancel_delayed_work_sync(&bond->mii_work);
4436−
4437− if (bond->params.arp_interval && delayed_work_pending(&bond->arp_work))
4438− cancel_delayed_work_sync(&bond->arp_work);
4439−
4440− if (bond->params.mode == BOND_MODE_ALB &&
4441− delayed_work_pending(&bond->alb_work))
4442− cancel_delayed_work_sync(&bond->alb_work);
4443−
4444− if (bond->params.mode == BOND_MODE_8023AD &&
4445− delayed_work_pending(&bond->ad_work))
4446− cancel_delayed_work_sync(&bond->ad_work);
4447−
4448− if (delayed_work_pending(&bond->mcast_work))
4449− cancel_delayed_work_sync(&bond->mcast_work);
4450−}
4451−
44524423 /*
44534424 * Destroy a bonding device.
44544425 * Must be under rtnl_lock when this function is called.
@@ -4699,12 +4670,13 @@ static int bond_check_params(struct bond_params *params) · 244 unmodified lines
46994670 arp_ip_count++) {
47004671 /* not complete check, but should be good enough to
47014672 catch mistakes */
4702− if (!isdigit(arp_ip_target[arp_ip_count][0])) {
4673+ __be32 ip = in_aton(arp_ip_target[arp_ip_count]);
4674+ if (!isdigit(arp_ip_target[arp_ip_count][0]) ||
4675+ ip == 0 || ip == htonl(INADDR_BROADCAST)) {
47034676 pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n",
47044677 arp_ip_target[arp_ip_count]);
47054678 arp_interval = 0;
47064679 } else {
4707− __be32 ip = in_aton(arp_ip_target[arp_ip_count]);
47084680 arp_target[arp_ip_count] = ip;
47094681 }
47104682 }
drivers/net/bonding/bond_sysfs.c+14−26
@@ -513,6 +513,8 @@ static ssize_t bonding_store_arp_interval(struct device *d, · 512 unmodified lines
513513 int new_value, ret = count;
514514 struct bonding *bond = to_bond(d);
515515
516+ if (!rtnl_trylock())
517+ return restart_syscall();
516518 if (sscanf(buf, "%d", &new_value) != 1) {
517519 pr_err("%s: no arp_interval value specified.\n",
518520 bond->dev->name);
@@ -539,10 +541,6 @@ static ssize_t bonding_store_arp_interval(struct device *d, · 20 unmodified lines
539541 pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring.\n",
540542 bond->dev->name, bond->dev->name);
541543 bond->params.miimon = 0;
542− if (delayed_work_pending(&bond->mii_work)) {
543− cancel_delayed_work(&bond->mii_work);
544− flush_workqueue(bond->wq);
545− }
546544 }
547545 if (!bond->params.arp_targets[0]) {
548546 pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified.\n",
@@ -554,19 +552,12 @@ static ssize_t bonding_store_arp_interval(struct device *d, · 5 unmodified lines
554552 * timer will get fired off when the open function
555553 * is called.
556554 */
557− if (!delayed_work_pending(&bond->arp_work)) {
558− if (bond->params.mode == BOND_MODE_ACTIVEBACKUP)
559− INIT_DELAYED_WORK(&bond->arp_work,
560− bond_activebackup_arp_mon);
561− else
562− INIT_DELAYED_WORK(&bond->arp_work,
563− bond_loadbalance_arp_mon);
564−
565− queue_delayed_work(bond->wq, &bond->arp_work, 0);
566− }
555+ cancel_delayed_work_sync(&bond->mii_work);
556+ queue_delayed_work(bond->wq, &bond->arp_work, 0);
567557 }
568558
569559 out:
560+ rtnl_unlock();
570561 return ret;
571562 }
572563 static DEVICE_ATTR(arp_interval, S_IRUGO | S_IWUSR,
@@ -962,6 +953,8 @@ static ssize_t bonding_store_miimon(struct device *d, · 389 unmodified lines
962953 int new_value, ret = count;
963954 struct bonding *bond = to_bond(d);
964955
956+ if (!rtnl_trylock())
957+ return restart_syscall();
965958 if (sscanf(buf, "%d", &new_value) != 1) {
966959 pr_err("%s: no miimon value specified.\n",
967960 bond->dev->name);
@@ -993,10 +986,6 @@ static ssize_t bonding_store_miimon(struct device *d, · 25 unmodified lines
993986 bond->params.arp_validate =
994987 BOND_ARP_VALIDATE_NONE;
995988 }
996− if (delayed_work_pending(&bond->arp_work)) {
997− cancel_delayed_work(&bond->arp_work);
998− flush_workqueue(bond->wq);
999− }
1000989 }
1001990
1002991 if (bond->dev->flags & IFF_UP) {
@@ -1005,15 +994,12 @@ static ssize_t bonding_store_miimon(struct device *d, · 2 unmodified lines
1005994 * timer will get fired off when the open function
1006995 * is called.
1007996 */
1008− if (!delayed_work_pending(&bond->mii_work)) {
1009− INIT_DELAYED_WORK(&bond->mii_work,
1010− bond_mii_monitor);
1011− queue_delayed_work(bond->wq,
1012− &bond->mii_work, 0);
1013− }
997+ cancel_delayed_work_sync(&bond->arp_work);
998+ queue_delayed_work(bond->wq, &bond->mii_work, 0);
1014999 }
10151000 }
10161001 out:
1002+ rtnl_unlock();
10171003 return ret;
10181004 }
10191005 static DEVICE_ATTR(miimon, S_IRUGO | S_IWUSR,
@@ -1060,7 +1046,7 @@ static ssize_t bonding_store_primary(struct device *d, · 40 unmodified lines
10601046 goto out;
10611047 }
10621048
1063− sscanf(buf, "%16s", ifname); /* IFNAMSIZ */
1049+ sscanf(buf, "%15s", ifname); /* IFNAMSIZ */
10641050
10651051 /* check to see if we are clearing primary */
10661052 if (!strlen(ifname) || buf[0] == '\n') {
@@ -1237,7 +1223,7 @@ static ssize_t bonding_store_active_slave(struct device *d, · 170 unmodified lines
12371223 goto out;
12381224 }
12391225
1240− sscanf(buf, "%16s", ifname); /* IFNAMSIZ */
1226+ sscanf(buf, "%15s", ifname); /* IFNAMSIZ */
12411227
12421228 /* check to see if we are clearing active */
12431229 if (!strlen(ifname) || buf[0] == '\n') {
@@ -1582,6 +1568,7 @@ static ssize_t bonding_store_slaves_active(struct device *d, · 338 unmodified lines
15821568 goto out;
15831569 }
15841570
1571+ read_lock(&bond->lock);
15851572 bond_for_each_slave(bond, slave, i) {
15861573 if (!bond_is_active_slave(slave)) {
15871574 if (new_value)
@@ -1590,6 +1577,7 @@ static ssize_t bonding_store_slaves_active(struct device *d, · 2 unmodified lines
15901577 slave->inactive = 1;
15911578 }
15921579 }
1580+ read_unlock(&bond->lock);
15931581 out:
15941582 return ret;
15951583 }
drivers/net/can/flexcan.c+16−3
@@ -144,9 +144,22 @@ · 143 unmodified lines
144144
145145 #define FLEXCAN_MB_CODE_MASK (0xf0ffffff)
146146
147−/* FLEXCAN hardware feature flags */
147+/*
148+ * FLEXCAN hardware feature flags
149+ *
150+ * Below is some version info we got:
151+ * SOC Version IP-Version Glitch- [TR]WRN_INT
152+ * Filter? connected?
153+ * MX25 FlexCAN2 03.00.00.00 no no
154+ * MX28 FlexCAN2 03.00.04.00 yes yes
155+ * MX35 FlexCAN2 03.00.00.00 no no
156+ * MX53 FlexCAN2 03.00.00.00 yes no
157+ * MX6s FlexCAN3 10.00.12.00 yes yes
158+ *
159+ * Some SOCs do not have the RX_WARN & TX_WARN interrupt line connected.
160+ */
148161 #define FLEXCAN_HAS_V10_FEATURES BIT(1) /* For core version >= 10 */
149−#define FLEXCAN_HAS_BROKEN_ERR_STATE BIT(2) /* Broken error state handling */
162+#define FLEXCAN_HAS_BROKEN_ERR_STATE BIT(2) /* [TR]WRN_INT not connected */
150163
151164 /* Structure of the message buffer */
152165 struct flexcan_mb {
@@ -205,7 +218,7 @@ static struct flexcan_devtype_data fsl_p1010_devtype_data = { · 52 unmodified lines
205218 };
206219 static struct flexcan_devtype_data fsl_imx28_devtype_data;
207220 static struct flexcan_devtype_data fsl_imx6q_devtype_data = {
208− .features = FLEXCAN_HAS_V10_FEATURES | FLEXCAN_HAS_BROKEN_ERR_STATE,
221+ .features = FLEXCAN_HAS_V10_FEATURES,
209222 };
210223
211224 static const struct can_bittiming_const flexcan_bittiming_const = {
drivers/net/can/sja1000/peak_pci.c+11−2
@@ -30,9 +30,10 @@ · 29 unmodified lines
3030
3131 #include "sja1000.h"
3232
33−MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>");
33+MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>");
3434 MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCI family cards");
3535 MODULE_SUPPORTED_DEVICE("PEAK PCAN PCI/PCIe/PCIeC miniPCI CAN cards");
36+MODULE_SUPPORTED_DEVICE("PEAK PCAN miniPCIe/cPCI PC/104+ PCI/104e CAN Cards");
3637 MODULE_LICENSE("GPL v2");
3738
3839 #define DRV_NAME "peak_pci"
@@ -64,7 +65,11 @@ struct peak_pci_chan { · 25 unmodified lines
6465 #define PEAK_PCI_DEVICE_ID 0x0001 /* for PCI/PCIe slot cards */
6566 #define PEAK_PCIEC_DEVICE_ID 0x0002 /* for ExpressCard slot cards */
6667 #define PEAK_PCIE_DEVICE_ID 0x0003 /* for nextgen PCIe slot cards */
67−#define PEAK_MPCI_DEVICE_ID 0x0008 /* The miniPCI slot cards */
68+#define PEAK_CPCI_DEVICE_ID 0x0004 /* for nextgen cPCI slot cards */
69+#define PEAK_MPCI_DEVICE_ID 0x0005 /* for nextgen miniPCI slot cards */
70+#define PEAK_PC_104P_DEVICE_ID 0x0006 /* PCAN-PC/104+ cards */
71+#define PEAK_PCI_104E_DEVICE_ID 0x0007 /* PCAN-PCI/104 Express cards */
72+#define PEAK_MPCIE_DEVICE_ID 0x0008 /* The miniPCIe slot cards */
6873
6974 #define PEAK_PCI_CHAN_MAX 4
7075
@@ -76,6 +81,10 @@ static DEFINE_PCI_DEVICE_TABLE(peak_pci_tbl) = { · 5 unmodified lines
7681 {PEAK_PCI_VENDOR_ID, PEAK_PCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
7782 {PEAK_PCI_VENDOR_ID, PEAK_PCIE_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
7883 {PEAK_PCI_VENDOR_ID, PEAK_MPCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
84+ {PEAK_PCI_VENDOR_ID, PEAK_MPCIE_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
85+ {PEAK_PCI_VENDOR_ID, PEAK_PC_104P_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
86+ {PEAK_PCI_VENDOR_ID, PEAK_PCI_104E_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
87+ {PEAK_PCI_VENDOR_ID, PEAK_CPCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
7988 #ifdef CONFIG_CAN_PEAK_PCIEC
8089 {PEAK_PCI_VENDOR_ID, PEAK_PCIEC_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
8190 #endif
drivers/net/can/usb/peak_usb/pcan_usb.c+6−2
@@ -519,8 +519,10 @@ static int pcan_usb_decode_error(struct pcan_usb_msg_context *mc, u8 n, · 518 unmodified lines
519519 mc->pdev->dev.can.state = new_state;
520520
521521 if (status_len & PCAN_USB_STATUSLEN_TIMESTAMP) {
522+ struct skb_shared_hwtstamps *hwts = skb_hwtstamps(skb);
523+
522524 peak_usb_get_ts_tv(&mc->pdev->time_ref, mc->ts16, &tv);
523− skb->tstamp = timeval_to_ktime(tv);
525+ hwts->hwtstamp = timeval_to_ktime(tv);
524526 }
525527
526528 netif_rx(skb);
@@ -605,6 +607,7 @@ static int pcan_usb_decode_data(struct pcan_usb_msg_context *mc, u8 status_len) · 78 unmodified lines
605607 struct sk_buff *skb;
606608 struct can_frame *cf;
607609 struct timeval tv;
610+ struct skb_shared_hwtstamps *hwts;
608611
609612 skb = alloc_can_skb(mc->netdev, &cf);
610613 if (!skb)
@@ -652,7 +655,8 @@ static int pcan_usb_decode_data(struct pcan_usb_msg_context *mc, u8 status_len) · 41 unmodified lines
652655
653656 /* convert timestamp into kernel time */
654657 peak_usb_get_ts_tv(&mc->pdev->time_ref, mc->ts16, &tv);
655− skb->tstamp = timeval_to_ktime(tv);
658+ hwts = skb_hwtstamps(skb);
659+ hwts->hwtstamp = timeval_to_ktime(tv);
656660
657661 /* push the skb */
658662 netif_rx(skb);
drivers/net/can/usb/peak_usb/pcan_usb_pro.c+6−2
@@ -532,6 +532,7 @@ static int pcan_usb_pro_handle_canmsg(struct pcan_usb_pro_interface *usb_if, · 531 unmodified lines
532532 struct can_frame *can_frame;
533533 struct sk_buff *skb;
534534 struct timeval tv;
535+ struct skb_shared_hwtstamps *hwts;
535536
536537 skb = alloc_can_skb(netdev, &can_frame);
537538 if (!skb)
@@ -549,7 +550,8 @@ static int pcan_usb_pro_handle_canmsg(struct pcan_usb_pro_interface *usb_if, · 11 unmodified lines
549550 memcpy(can_frame->data, rx->data, can_frame->can_dlc);
550551
551552 peak_usb_get_ts_tv(&usb_if->time_ref, le32_to_cpu(rx->ts32), &tv);
552− skb->tstamp = timeval_to_ktime(tv);
553+ hwts = skb_hwtstamps(skb);
554+ hwts->hwtstamp = timeval_to_ktime(tv);
553555
554556 netif_rx(skb);
555557 netdev->stats.rx_packets++;
@@ -570,6 +572,7 @@ static int pcan_usb_pro_handle_error(struct pcan_usb_pro_interface *usb_if, · 14 unmodified lines
570572 u8 err_mask = 0;
571573 struct sk_buff *skb;
572574 struct timeval tv;
575+ struct skb_shared_hwtstamps *hwts;
573576
574577 /* nothing should be sent while in BUS_OFF state */
575578 if (dev->can.state == CAN_STATE_BUS_OFF)
@@ -664,7 +667,8 @@ static int pcan_usb_pro_handle_error(struct pcan_usb_pro_interface *usb_if, · 88 unmodified lines
664667 dev->can.state = new_state;
665668
666669 peak_usb_get_ts_tv(&usb_if->time_ref, le32_to_cpu(er->ts32), &tv);
667− skb->tstamp = timeval_to_ktime(tv);
670+ hwts = skb_hwtstamps(skb);
671+ hwts->hwtstamp = timeval_to_ktime(tv);
668672 netif_rx(skb);
669673 netdev->stats.rx_packets++;
670674 netdev->stats.rx_bytes += can_frame->can_dlc;
drivers/net/ethernet/8390/ne.c+1−0
@@ -813,6 +813,7 @@ static int __init ne_drv_probe(struct platform_device *pdev) · 812 unmodified lines
813813 dev->irq = irq[this_dev];
814814 dev->mem_end = bad[this_dev];
815815 }
816+ SET_NETDEV_DEV(dev, &pdev->dev);
816817 err = do_ne_probe(dev);
817818 if (err) {
818819 free_netdev(dev);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c+1−1
@@ -1702,7 +1702,7 @@ static int bnx2x_set_eee(struct net_device *dev, struct ethtool_eee *edata) · 1701 unmodified lines
17021702 SHMEM_EEE_ADV_STATUS_SHIFT);
17031703 if ((advertised != (eee_cfg & SHMEM_EEE_ADV_STATUS_MASK))) {
17041704 DP(BNX2X_MSG_ETHTOOL,
1705− "Direct manipulation of EEE advertisment is not supported\n");
1705+ "Direct manipulation of EEE advertisement is not supported\n");
17061706 return -EINVAL;
17071707 }
17081708
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c+115−47
@@ -137,7 +137,16 @@ · 136 unmodified lines
137137 #define LINK_20GTFD LINK_STATUS_SPEED_AND_DUPLEX_20GTFD
138138 #define LINK_20GXFD LINK_STATUS_SPEED_AND_DUPLEX_20GXFD
139139
140−
140+#define LINK_UPDATE_MASK \
141+ (LINK_STATUS_SPEED_AND_DUPLEX_MASK | \
142+ LINK_STATUS_LINK_UP | \
143+ LINK_STATUS_PHYSICAL_LINK_FLAG | \
144+ LINK_STATUS_AUTO_NEGOTIATE_COMPLETE | \
145+ LINK_STATUS_RX_FLOW_CONTROL_FLAG_MASK | \
146+ LINK_STATUS_TX_FLOW_CONTROL_FLAG_MASK | \
147+ LINK_STATUS_PARALLEL_DETECTION_FLAG_MASK | \
148+ LINK_STATUS_LINK_PARTNER_SYMMETRIC_PAUSE | \
149+ LINK_STATUS_LINK_PARTNER_ASYMMETRIC_PAUSE)
141150
142151 #define SFP_EEPROM_CON_TYPE_ADDR 0x2
143152 #define SFP_EEPROM_CON_TYPE_VAL_LC 0x7
@@ -3295,6 +3304,21 @@ static void bnx2x_serdes_deassert(struct bnx2x *bp, u8 port) · 3151 unmodified lines
32953304 DEFAULT_PHY_DEV_ADDR);
32963305 }
32973306
3307+static void bnx2x_xgxs_specific_func(struct bnx2x_phy *phy,
3308+ struct link_params *params,
3309+ u32 action)
3310+{
3311+ struct bnx2x *bp = params->bp;
3312+ switch (action) {
3313+ case PHY_INIT:
3314+ /* Set correct devad */
3315+ REG_WR(bp, NIG_REG_XGXS0_CTRL_MD_ST + params->port*0x18, 0);
3316+ REG_WR(bp, NIG_REG_XGXS0_CTRL_MD_DEVAD + params->port*0x18,
3317+ phy->def_md_devad);
3318+ break;
3319+ }
3320+}
3321+
32983322 static void bnx2x_xgxs_deassert(struct link_params *params)
32993323 {
33003324 struct bnx2x *bp = params->bp;
@@ -3309,10 +3333,8 @@ static void bnx2x_xgxs_deassert(struct link_params *params) · 8 unmodified lines
33093333 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_3_CLEAR, val);
33103334 udelay(500);
33113335 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_3_SET, val);
3312−
3313− REG_WR(bp, NIG_REG_XGXS0_CTRL_MD_ST + port*0x18, 0);
3314− REG_WR(bp, NIG_REG_XGXS0_CTRL_MD_DEVAD + port*0x18,
3315− params->phy[INT_PHY].def_md_devad);
3336+ bnx2x_xgxs_specific_func(&params->phy[INT_PHY], params,
3337+ PHY_INIT);
33163338 }
33173339
33183340 static void bnx2x_calc_ieee_aneg_adv(struct bnx2x_phy *phy,
@@ -3545,14 +3567,11 @@ static void bnx2x_warpcore_set_lpi_passthrough(struct bnx2x_phy *phy, · 226 unmodified lines
35453567 static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,
35463568 struct link_params *params,
35473569 struct link_vars *vars) {
3548− u16 val16 = 0, lane, i;
3570+ u16 lane, i, cl72_ctrl, an_adv = 0;
3571+ u16 ucode_ver;
35493572 struct bnx2x *bp = params->bp;
35503573 static struct bnx2x_reg_set reg_set[] = {
35513574 {MDIO_WC_DEVAD, MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X2, 0x7},
3552− {MDIO_AN_DEVAD, MDIO_WC_REG_PAR_DET_10G_CTRL, 0},
3553− {MDIO_WC_DEVAD, MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL, 0},
3554− {MDIO_WC_DEVAD, MDIO_WC_REG_XGXSBLK1_LANECTRL0, 0xff},
3555− {MDIO_WC_DEVAD, MDIO_WC_REG_XGXSBLK1_LANECTRL1, 0x5555},
35563575 {MDIO_PMA_DEVAD, MDIO_WC_REG_IEEE0BLK_AUTONEGNP, 0x0},
35573576 {MDIO_WC_DEVAD, MDIO_WC_REG_RX66_CONTROL, 0x7415},
35583577 {MDIO_WC_DEVAD, MDIO_WC_REG_SERDESDIGITAL_MISC2, 0x6190},
@@ -3565,12 +3584,19 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, · 6 unmodified lines
35653584 bnx2x_cl45_write(bp, phy, reg_set[i].devad, reg_set[i].reg,
35663585 reg_set[i].val);
35673586
3587+ bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3588+ MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL, &cl72_ctrl);
3589+ cl72_ctrl &= 0xf8ff;
3590+ cl72_ctrl |= 0x3800;
3591+ bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3592+ MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL, cl72_ctrl);
3593+
35683594 /* Check adding advertisement for 1G KX */
35693595 if (((vars->line_speed == SPEED_AUTO_NEG) &&
35703596 (phy->speed_cap_mask & PORT_HW_CFG_SPEED_CAPABILITY_D0_1G)) ||
35713597 (vars->line_speed == SPEED_1000)) {
35723598 u32 addr = MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X2;
3573− val16 |= (1<<5);
3599+ an_adv |= (1<<5);
35743600
35753601 /* Enable CL37 1G Parallel Detect */
35763602 bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD, addr, 0x1);
@@ -3580,11 +3606,14 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, · 3 unmodified lines
35803606 (phy->speed_cap_mask & PORT_HW_CFG_SPEED_CAPABILITY_D0_10G)) ||
35813607 (vars->line_speed == SPEED_10000)) {
35823608 /* Check adding advertisement for 10G KR */
3583− val16 |= (1<<7);
3609+ an_adv |= (1<<7);
35843610 /* Enable 10G Parallel Detect */
3611+ CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,
3612+ MDIO_AER_BLOCK_AER_REG, 0);
3613+
35853614 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD,
35863615 MDIO_WC_REG_PAR_DET_10G_CTRL, 1);
3587−
3616+ bnx2x_set_aer_mmd(params, phy);
35883617 DP(NETIF_MSG_LINK, "Advertize 10G\n");
35893618 }
35903619
@@ -3604,7 +3633,7 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, · 13 unmodified lines
36043633
36053634 /* Advertised speeds */
36063635 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD,
3607− MDIO_WC_REG_AN_IEEE1BLK_AN_ADVERTISEMENT1, val16);
3636+ MDIO_WC_REG_AN_IEEE1BLK_AN_ADVERTISEMENT1, an_adv);
36083637
36093638 /* Advertised and set FEC (Forward Error Correction) */
36103639 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD,
@@ -3628,9 +3657,10 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, · 17 unmodified lines
36283657 /* Set KR Autoneg Work-Around flag for Warpcore version older than D108
36293658 */
36303659 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3631− MDIO_WC_REG_UC_INFO_B1_VERSION, &val16);
3632− if (val16 < 0xd108) {
3633− DP(NETIF_MSG_LINK, "Enable AN KR work-around\n");
3660+ MDIO_WC_REG_UC_INFO_B1_VERSION, &ucode_ver);
3661+ if (ucode_ver < 0xd108) {
3662+ DP(NETIF_MSG_LINK, "Enable AN KR work-around. WC ver:0x%x\n",
3663+ ucode_ver);
36343664 vars->rx_tx_asic_rst = MAX_KR_LINK_RETRY;
36353665 }
36363666 bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
@@ -3651,21 +3681,16 @@ static void bnx2x_warpcore_set_10G_KR(struct bnx2x_phy *phy, · 14 unmodified lines
36513681 struct link_vars *vars)
36523682 {
36533683 struct bnx2x *bp = params->bp;
3654− u16 i;
3684+ u16 val16, i, lane;
36553685 static struct bnx2x_reg_set reg_set[] = {
36563686 /* Disable Autoneg */
36573687 {MDIO_WC_DEVAD, MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X2, 0x7},
3658− {MDIO_AN_DEVAD, MDIO_WC_REG_PAR_DET_10G_CTRL, 0},
36593688 {MDIO_WC_DEVAD, MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL,
36603689 0x3f00},
36613690 {MDIO_AN_DEVAD, MDIO_WC_REG_AN_IEEE1BLK_AN_ADVERTISEMENT1, 0},
36623691 {MDIO_AN_DEVAD, MDIO_WC_REG_IEEE0BLK_MIICNTL, 0x0},
36633692 {MDIO_WC_DEVAD, MDIO_WC_REG_DIGITAL3_UP1, 0x1},
36643693 {MDIO_WC_DEVAD, MDIO_WC_REG_DIGITAL5_MISC7, 0xa},
3665− /* Disable CL36 PCS Tx */
3666− {MDIO_WC_DEVAD, MDIO_WC_REG_XGXSBLK1_LANECTRL0, 0x0},
3667− /* Double Wide Single Data Rate @ pll rate */
3668− {MDIO_WC_DEVAD, MDIO_WC_REG_XGXSBLK1_LANECTRL1, 0xFFFF},
36693694 /* Leave cl72 training enable, needed for KR */
36703695 {MDIO_PMA_DEVAD,
36713696 MDIO_WC_REG_PMD_IEEE9BLK_TENGBASE_KR_PMD_CONTROL_REGISTER_150,
@@ -3676,11 +3701,24 @@ static void bnx2x_warpcore_set_10G_KR(struct bnx2x_phy *phy, · 4 unmodified lines
36763701 bnx2x_cl45_write(bp, phy, reg_set[i].devad, reg_set[i].reg,
36773702 reg_set[i].val);
36783703
3679− /* Leave CL72 enabled */
3680− bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
3681− MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL,
3682− 0x3800);
3704+ lane = bnx2x_get_warpcore_lane(phy, params);
3705+ /* Global registers */
3706+ CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,
3707+ MDIO_AER_BLOCK_AER_REG, 0);
3708+ /* Disable CL36 PCS Tx */
3709+ bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3710+ MDIO_WC_REG_XGXSBLK1_LANECTRL0, &val16);
3711+ val16 &= ~(0x0011 << lane);
3712+ bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3713+ MDIO_WC_REG_XGXSBLK1_LANECTRL0, val16);
36833714
3715+ bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3716+ MDIO_WC_REG_XGXSBLK1_LANECTRL1, &val16);
3717+ val16 |= (0x0303 << (lane << 1));
3718+ bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3719+ MDIO_WC_REG_XGXSBLK1_LANECTRL1, val16);
3720+ /* Restore AER */
3721+ bnx2x_set_aer_mmd(params, phy);
36843722 /* Set speed via PMA/PMD register */
36853723 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD,
36863724 MDIO_WC_REG_IEEE0BLK_MIICNTL, 0x2040);
@@ -4303,7 +4341,7 @@ static void bnx2x_warpcore_link_reset(struct bnx2x_phy *phy, · 616 unmodified lines
43034341 struct link_params *params)
43044342 {
43054343 struct bnx2x *bp = params->bp;
4306− u16 val16;
4344+ u16 val16, lane;
43074345 bnx2x_sfp_e3_set_transmitter(params, phy, 0);
43084346 bnx2x_set_mdio_clk(bp, params->chip_id, params->port);
43094347 bnx2x_set_aer_mmd(params, phy);
@@ -4340,6 +4378,30 @@ static void bnx2x_warpcore_link_reset(struct bnx2x_phy *phy, · 30 unmodified lines
43404378 MDIO_WC_REG_XGXSBLK1_LANECTRL2,
43414379 val16 & 0xff00);
43424380
4381+ lane = bnx2x_get_warpcore_lane(phy, params);
4382+ /* Disable CL36 PCS Tx */
4383+ bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
4384+ MDIO_WC_REG_XGXSBLK1_LANECTRL0, &val16);
4385+ val16 |= (0x11 << lane);
4386+ if (phy->flags & FLAGS_WC_DUAL_MODE)
4387+ val16 |= (0x22 << lane);
4388+ bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
4389+ MDIO_WC_REG_XGXSBLK1_LANECTRL0, val16);
4390+
4391+ bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
4392+ MDIO_WC_REG_XGXSBLK1_LANECTRL1, &val16);
4393+ val16 &= ~(0x0303 << (lane << 1));
4394+ val16 |= (0x0101 << (lane << 1));
4395+ if (phy->flags & FLAGS_WC_DUAL_MODE) {
4396+ val16 &= ~(0x0c0c << (lane << 1));
4397+ val16 |= (0x0404 << (lane << 1));
4398+ }
4399+
4400+ bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
4401+ MDIO_WC_REG_XGXSBLK1_LANECTRL1, val16);
4402+ /* Restore AER */
4403+ bnx2x_set_aer_mmd(params, phy);
4404+
43434405 }
43444406
43454407 static void bnx2x_set_warpcore_loopback(struct bnx2x_phy *phy,
@@ -6296,15 +6358,7 @@ static int bnx2x_update_link_down(struct link_params *params, · 1950 unmodified lines
62966358 vars->mac_type = MAC_TYPE_NONE;
62976359
62986360 /* Update shared memory */
6299− vars->link_status &= ~(LINK_STATUS_SPEED_AND_DUPLEX_MASK |
6300− LINK_STATUS_LINK_UP |
6301− LINK_STATUS_PHYSICAL_LINK_FLAG |
6302− LINK_STATUS_AUTO_NEGOTIATE_COMPLETE |
6303− LINK_STATUS_RX_FLOW_CONTROL_FLAG_MASK |
6304− LINK_STATUS_TX_FLOW_CONTROL_FLAG_MASK |
6305− LINK_STATUS_PARALLEL_DETECTION_FLAG_MASK |
6306− LINK_STATUS_LINK_PARTNER_SYMMETRIC_PAUSE |
6307− LINK_STATUS_LINK_PARTNER_ASYMMETRIC_PAUSE);
6361+ vars->link_status &= ~LINK_UPDATE_MASK;
63086362 vars->line_speed = 0;
63096363 bnx2x_update_mng(params, vars->link_status);
63106364
@@ -6452,6 +6506,7 @@ int bnx2x_link_update(struct link_params *params, struct link_vars *vars) · 141 unmodified lines
64526506 u16 ext_phy_line_speed = 0, prev_line_speed = vars->line_speed;
64536507 u8 active_external_phy = INT_PHY;
64546508 vars->phy_flags &= ~PHY_HALF_OPEN_CONN_FLAG;
6509+ vars->link_status &= ~LINK_UPDATE_MASK;
64556510 for (phy_index = INT_PHY; phy_index < params->num_phys;
64566511 phy_index++) {
64576512 phy_vars[phy_index].flow_ctrl = 0;
@@ -7579,7 +7634,7 @@ static void bnx2x_warpcore_power_module(struct link_params *params, · 1121 unmodified lines
75797634 static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy,
75807635 struct link_params *params,
75817636 u16 addr, u8 byte_cnt,
7582− u8 *o_buf)
7637+ u8 *o_buf, u8 is_init)
75837638 {
75847639 int rc = 0;
75857640 u8 i, j = 0, cnt = 0;
@@ -7596,10 +7651,10 @@ static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy, · 10 unmodified lines
75967651 /* 4 byte aligned address */
75977652 addr32 = addr & (~0x3);
75987653 do {
7599− if (cnt == I2C_WA_PWR_ITER) {
7654+ if ((!is_init) && (cnt == I2C_WA_PWR_ITER)) {
76007655 bnx2x_warpcore_power_module(params, phy, 0);
76017656 /* Note that 100us are not enough here */
7602− usleep_range(1000,1000);
7657+ usleep_range(1000, 2000);
76037658 bnx2x_warpcore_power_module(params, phy, 1);
76047659 }
76057660 rc = bnx2x_bsc_read(params, phy, 0xa0, addr32, 0, byte_cnt,
@@ -7719,7 +7774,7 @@ int bnx2x_read_sfp_module_eeprom(struct bnx2x_phy *phy, · 113 unmodified lines
77197774 break;
77207775 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT:
77217776 rc = bnx2x_warpcore_read_sfp_module_eeprom(phy, params, addr,
7722− byte_cnt, o_buf);
7777+ byte_cnt, o_buf, 0);
77237778 break;
77247779 }
77257780 return rc;
@@ -7923,6 +7978,7 @@ static int bnx2x_wait_for_sfp_module_initialized(struct bnx2x_phy *phy, · 197 unmodified lines
79237978
79247979 {
79257980 u8 val;
7981+ int rc;
79267982 struct bnx2x *bp = params->bp;
79277983 u16 timeout;
79287984 /* Initialization time after hot-plug may take up to 300ms for
@@ -7930,8 +7986,14 @@ static int bnx2x_wait_for_sfp_module_initialized(struct bnx2x_phy *phy, · 1 unmodified line
79307986 */
79317987
79327988 for (timeout = 0; timeout < 60; timeout++) {
7933− if (bnx2x_read_sfp_module_eeprom(phy, params, 1, 1, &val)
7934− == 0) {
7989+ if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT)
7990+ rc = bnx2x_warpcore_read_sfp_module_eeprom(phy,
7991+ params, 1,
7992+ 1, &val, 1);
7993+ else
7994+ rc = bnx2x_read_sfp_module_eeprom(phy, params, 1, 1,
7995+ &val);
7996+ if (rc == 0) {
79357997 DP(NETIF_MSG_LINK,
79367998 "SFP+ module initialization took %d ms\n",
79377999 timeout * 5);
@@ -7939,7 +8001,8 @@ static int bnx2x_wait_for_sfp_module_initialized(struct bnx2x_phy *phy, · 1 unmodified line
79398001 }
79408002 usleep_range(5000, 10000);
79418003 }
7942− return -EINVAL;
8004+ rc = bnx2x_read_sfp_module_eeprom(phy, params, 1, 1, &val);
8005+ return rc;
79438006 }
79448007
79458008 static void bnx2x_8727_power_module(struct bnx2x *bp,
@@ -9878,7 +9941,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, · 1932 unmodified lines
98789941 else
98799942 rc = bnx2x_8483x_disable_eee(phy, params, vars);
98809943 if (rc) {
9881− DP(NETIF_MSG_LINK, "Failed to set EEE advertisment\n");
9944+ DP(NETIF_MSG_LINK, "Failed to set EEE advertisement\n");
98829945 return rc;
98839946 }
98849947 } else {
@@ -10993,7 +11056,7 @@ static struct bnx2x_phy phy_xgxs = { · 1108 unmodified lines
1099311056 .format_fw_ver = (format_fw_ver_t)NULL,
1099411057 .hw_reset = (hw_reset_t)NULL,
1099511058 .set_link_led = (set_link_led_t)NULL,
10996− .phy_specific_func = (phy_specific_func_t)NULL
11059+ .phy_specific_func = (phy_specific_func_t)bnx2x_xgxs_specific_func
1099711060 };
1099811061 static struct bnx2x_phy phy_warpcore = {
1099911062 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT,
@@ -11465,6 +11528,11 @@ static int bnx2x_populate_int_phy(struct bnx2x *bp, u32 shmem_base, u8 port, · 465 unmodified lines
1146511528 phy->media_type = ETH_PHY_BASE_T;
1146611529 break;
1146711530 case PORT_HW_CFG_NET_SERDES_IF_XFI:
11531+ phy->supported &= (SUPPORTED_1000baseT_Full |
11532+ SUPPORTED_10000baseT_Full |
11533+ SUPPORTED_FIBRE |
11534+ SUPPORTED_Pause |
11535+ SUPPORTED_Asym_Pause);
1146811536 phy->media_type = ETH_PHY_XFP_FIBER;
1146911537 break;
1147011538 case PORT_HW_CFG_NET_SERDES_IF_SFI:
@@ -12919,7 +12987,7 @@ static u8 bnx2x_analyze_link_error(struct link_params *params, · 1448 unmodified lines
1291912987 DP(NETIF_MSG_LINK, "Analyze TX Fault\n");
1292012988 break;
1292112989 default:
12922− DP(NETIF_MSG_LINK, "Analyze UNKOWN\n");
12990+ DP(NETIF_MSG_LINK, "Analyze UNKNOWN\n");
1292312991 }
1292412992 DP(NETIF_MSG_LINK, "Link changed:[%x %x]->%x\n", vars->link_up,
1292512993 old_status, status);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+18−6
@@ -6794,8 +6794,9 @@ static int bnx2x_init_hw_port(struct bnx2x *bp) · 6793 unmodified lines
67946794
67956795 bnx2x_init_block(bp, BLOCK_DORQ, init_phase);
67966796
6797+ bnx2x_init_block(bp, BLOCK_BRB1, init_phase);
6798+
67976799 if (CHIP_IS_E1(bp) || CHIP_IS_E1H(bp)) {
6798− bnx2x_init_block(bp, BLOCK_BRB1, init_phase);
67996800
68006801 if (IS_MF(bp))
68016802 low = ((bp->flags & ONE_PORT_FLAG) ? 160 : 246);
@@ -9544,10 +9545,13 @@ static int __devinit bnx2x_prev_unload_common(struct bnx2x *bp) · 2742 unmodified lines
95449545 */
95459546 static void __devinit bnx2x_prev_interrupted_dmae(struct bnx2x *bp)
95469547 {
9547− u32 val = REG_RD(bp, PGLUE_B_REG_PGLUE_B_INT_STS);
9548− if (val & PGLUE_B_PGLUE_B_INT_STS_REG_WAS_ERROR_ATTN) {
9549− BNX2X_ERR("was error bit was found to be set in pglueb upon startup. Clearing");
9550− REG_WR(bp, PGLUE_B_REG_WAS_ERROR_PF_7_0_CLR, 1 << BP_FUNC(bp));
9548+ if (!CHIP_IS_E1x(bp)) {
9549+ u32 val = REG_RD(bp, PGLUE_B_REG_PGLUE_B_INT_STS);
9550+ if (val & PGLUE_B_PGLUE_B_INT_STS_REG_WAS_ERROR_ATTN) {
9551+ BNX2X_ERR("was error bit was found to be set in pglueb upon startup. Clearing");
9552+ REG_WR(bp, PGLUE_B_REG_WAS_ERROR_PF_7_0_CLR,
9553+ 1 << BP_FUNC(bp));
9554+ }
95519555 }
95529556 }
95539557
@@ -11902,7 +11906,15 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, · 2348 unmodified lines
1190211906 /* disable FCOE L2 queue for E1x */
1190311907 if (CHIP_IS_E1x(bp))
1190411908 bp->flags |= NO_FCOE_FLAG;
11905−
11909+ /* disable FCOE for 57840 device, until FW supports it */
11910+ switch (ent->driver_data) {
11911+ case BCM57840_O:
11912+ case BCM57840_4_10:
11913+ case BCM57840_2_20:
11914+ case BCM57840_MFO:
11915+ case BCM57840_MF:
11916+ bp->flags |= NO_FCOE_FLAG;
11917+ }
1190611918 #endif
1190711919
1190811920
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h+19−0
@@ -251,6 +251,8 @@ struct adapter_params { · 250 unmodified lines
251251 unsigned char rev; /* chip revision */
252252 unsigned char offload;
253253
254+ unsigned char bypass;
255+
254256 unsigned int ofldq_wr_cred;
255257 };
256258
@@ -642,6 +644,23 @@ extern int dbfifo_int_thresh; · 385 unmodified lines
642644 #define for_each_port(adapter, iter) \
643645 for (iter = 0; iter < (adapter)->params.nports; ++iter)
644646
647+static inline int is_bypass(struct adapter *adap)
648+{
649+ return adap->params.bypass;
650+}
651+
652+static inline int is_bypass_device(int device)
653+{
654+ /* this should be set based upon device capabilities */
655+ switch (device) {
656+ case 0x440b:
657+ case 0x440c:
658+ return 1;
659+ default:
660+ return 0;
661+ }
662+}
663+
645664 static inline unsigned int core_ticks_per_usec(const struct adapter *adap)
646665 {
647666 return adap->params.vpd.cclk / 1000;
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c+5−34
@@ -3415,16 +3415,6 @@ static int adap_init0_config(struct adapter *adapter, int reset) · 3414 unmodified lines
34153415 "mismatch: [fini] csum=%#x, computed csum=%#x\n",
34163416 finicsum, cfcsum);
34173417
3418− /*
3419− * If we're a pure NIC driver then disable all offloading facilities.
3420− * This will allow the firmware to optimize aspects of the hardware
3421− * configuration which will result in improved performance.
3422− */
3423− caps_cmd.ofldcaps = 0;
3424− caps_cmd.iscsicaps = 0;
3425− caps_cmd.rdmacaps = 0;
3426− caps_cmd.fcoecaps = 0;
3427−
34283418 /*
34293419 * And now tell the firmware to use the configuration we just loaded.
34303420 */
@@ -3513,18 +3503,6 @@ static int adap_init0_no_config(struct adapter *adapter, int reset) · 82 unmodified lines
35133503 if (ret < 0)
35143504 goto bye;
35153505
3516−#ifndef CONFIG_CHELSIO_T4_OFFLOAD
3517− /*
3518− * If we're a pure NIC driver then disable all offloading facilities.
3519− * This will allow the firmware to optimize aspects of the hardware
3520− * configuration which will result in improved performance.
3521− */
3522− caps_cmd.ofldcaps = 0;
3523− caps_cmd.iscsicaps = 0;
3524− caps_cmd.rdmacaps = 0;
3525− caps_cmd.fcoecaps = 0;
3526−#endif
3527−
35283506 if (caps_cmd.niccaps & htons(FW_CAPS_CONFIG_NIC_VM)) {
35293507 if (!vf_acls)
35303508 caps_cmd.niccaps ^= htons(FW_CAPS_CONFIG_NIC_VM);
@@ -3745,6 +3723,7 @@ static int adap_init0(struct adapter *adap) · 214 unmodified lines
37453723 u32 v, port_vec;
37463724 enum dev_state state;
37473725 u32 params[7], val[7];
3726+ struct fw_caps_config_cmd caps_cmd;
37483727 int reset = 1, j;
37493728
37503729 /*
@@ -3898,6 +3877,9 @@ static int adap_init0(struct adapter *adap) · 147 unmodified lines
38983877 goto bye;
38993878 }
39003879
3880+ if (is_bypass_device(adap->pdev->device))
3881+ adap->params.bypass = 1;
3882+
39013883 /*
39023884 * Grab some of our basic fundamental operating parameters.
39033885 */
@@ -3940,13 +3922,12 @@ static int adap_init0(struct adapter *adap) · 36 unmodified lines
39403922 adap->tids.aftid_end = val[1];
39413923 }
39423924
3943−#ifdef CONFIG_CHELSIO_T4_OFFLOAD
39443925 /*
39453926 * Get device capabilities so we can determine what resources we need
39463927 * to manage.
39473928 */
39483929 memset(&caps_cmd, 0, sizeof(caps_cmd));
3949− caps_cmd.op_to_write = htonl(V_FW_CMD_OP(FW_CAPS_CONFIG_CMD) |
3930+ caps_cmd.op_to_write = htonl(FW_CMD_OP(FW_CAPS_CONFIG_CMD) |
39503931 FW_CMD_REQUEST | FW_CMD_READ);
39513932 caps_cmd.retval_len16 = htonl(FW_LEN16(caps_cmd));
39523933 ret = t4_wr_mbox(adap, adap->mbox, &caps_cmd, sizeof(caps_cmd),
@@ -3991,15 +3972,6 @@ static int adap_init0(struct adapter *adap) · 38 unmodified lines
39913972 adap->vres.ddp.size = val[4] - val[3] + 1;
39923973 adap->params.ofldq_wr_cred = val[5];
39933974
3994− params[0] = FW_PARAM_PFVF(ETHOFLD_START);
3995− params[1] = FW_PARAM_PFVF(ETHOFLD_END);
3996− ret = t4_query_params(adap, adap->mbox, adap->fn, 0, 2,
3997− params, val);
3998− if ((val[0] != val[1]) && (ret >= 0)) {
3999− adap->tids.uotid_base = val[0];
4000− adap->tids.nuotids = val[1] - val[0] + 1;
4001− }
4002−
40033975 adap->params.offload = 1;
40043976 }
40053977 if (caps_cmd.rdmacaps) {
@@ -4048,7 +4020,6 @@ static int adap_init0(struct adapter *adap) · 42 unmodified lines
40484020 }
40494021 #undef FW_PARAM_PFVF
40504022 #undef FW_PARAM_DEV
4051−#endif /* CONFIG_CHELSIO_T4_OFFLOAD */
40524023
40534024 /*
40544025 * These are finalized by FW initialization, load their values now.
drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h+3−0
@@ -102,6 +102,9 @@ struct tid_info { · 101 unmodified lines
102102 unsigned int ftid_base;
103103 unsigned int aftid_base;
104104 unsigned int aftid_end;
105+ /* Server filter region */
106+ unsigned int sftid_base;
107+ unsigned int nsftids;
105108
106109 spinlock_t atid_lock ____cacheline_aligned_in_smp;
107110 union aopen_entry *afree;
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c+5−1
@@ -2519,6 +2519,7 @@ int t4_fw_bye(struct adapter *adap, unsigned int mbox) · 2518 unmodified lines
25192519 {
25202520 struct fw_bye_cmd c;
25212521
2522+ memset(&c, 0, sizeof(c));
25222523 INIT_CMD(c, BYE, WRITE);
25232524 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
25242525 }
@@ -2535,6 +2536,7 @@ int t4_early_init(struct adapter *adap, unsigned int mbox) · 10 unmodified lines
25352536 {
25362537 struct fw_initialize_cmd c;
25372538
2539+ memset(&c, 0, sizeof(c));
25382540 INIT_CMD(c, INITIALIZE, WRITE);
25392541 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
25402542 }
@@ -2551,6 +2553,7 @@ int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset) · 10 unmodified lines
25512553 {
25522554 struct fw_reset_cmd c;
25532555
2556+ memset(&c, 0, sizeof(c));
25542557 INIT_CMD(c, RESET, WRITE);
25552558 c.val = htonl(reset);
25562559 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
@@ -2828,7 +2831,7 @@ int t4_fixup_host_params(struct adapter *adap, unsigned int page_size, · 271 unmodified lines
28282831 HOSTPAGESIZEPF7(sge_hps));
28292832
28302833 t4_set_reg_field(adap, SGE_CONTROL,
2831− INGPADBOUNDARY(INGPADBOUNDARY_MASK) |
2834+ INGPADBOUNDARY_MASK |
28322835 EGRSTATUSPAGESIZE_MASK,
28332836 INGPADBOUNDARY(fl_align_log - 5) |
28342837 EGRSTATUSPAGESIZE(stat_len != 64));
@@ -3278,6 +3281,7 @@ int t4_identify_port(struct adapter *adap, unsigned int mbox, unsigned int viid, · 443 unmodified lines
32783281 {
32793282 struct fw_vi_enable_cmd c;
32803283
3284+ memset(&c, 0, sizeof(c));
32813285 c.op_to_viid = htonl(FW_CMD_OP(FW_VI_ENABLE_CMD) | FW_CMD_REQUEST |
32823286 FW_CMD_EXEC | FW_VI_ENABLE_CMD_VIID(viid));
32833287 c.ien_to_len16 = htonl(FW_VI_ENABLE_CMD_LED | FW_LEN16(c));
drivers/net/ethernet/freescale/gianfar.c+4−1
@@ -1353,8 +1353,11 @@ static int gfar_restore(struct device *dev) · 1352 unmodified lines
13531353 struct gfar_private *priv = dev_get_drvdata(dev);
13541354 struct net_device *ndev = priv->ndev;
13551355
1356− if (!netif_running(ndev))
1356+ if (!netif_running(ndev)) {
1357+ netif_device_attach(ndev);
1358+
13571359 return 0;
1360+ }
13581361
13591362 gfar_init_bds(ndev);
13601363 init_registers(ndev);
drivers/net/ethernet/freescale/gianfar_ptp.c+1−1
@@ -478,7 +478,7 @@ static int gianfar_ptp_probe(struct platform_device *dev) · 477 unmodified lines
478478 pr_err("no resource\n");
479479 goto no_resource;
480480 }
481− if (request_resource(&ioport_resource, etsects->rsrc)) {
481+ if (request_resource(&iomem_resource, etsects->rsrc)) {
482482 pr_err("resource busy\n");
483483 goto no_resource;
484484 }
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c+3−0
@@ -2673,6 +2673,9 @@ static int ixgbe_get_ts_info(struct net_device *dev, · 2672 unmodified lines
26732673 case ixgbe_mac_X540:
26742674 case ixgbe_mac_82599EB:
26752675 info->so_timestamping =
2676+ SOF_TIMESTAMPING_TX_SOFTWARE |
2677+ SOF_TIMESTAMPING_RX_SOFTWARE |
2678+ SOF_TIMESTAMPING_SOFTWARE |
26762679 SOF_TIMESTAMPING_TX_HARDWARE |
26772680 SOF_TIMESTAMPING_RX_HARDWARE |
26782681 SOF_TIMESTAMPING_RAW_HARDWARE;
drivers/net/ethernet/jme.c+12−24
@@ -1860,10 +1860,14 @@ jme_open(struct net_device *netdev) · 1859 unmodified lines
18601860 jme_clear_pm(jme);
18611861 JME_NAPI_ENABLE(jme);
18621862
1863− tasklet_enable(&jme->linkch_task);
1864− tasklet_enable(&jme->txclean_task);
1865− tasklet_hi_enable(&jme->rxclean_task);
1866− tasklet_hi_enable(&jme->rxempty_task);
1863+ tasklet_init(&jme->linkch_task, jme_link_change_tasklet,
1864+ (unsigned long) jme);
1865+ tasklet_init(&jme->txclean_task, jme_tx_clean_tasklet,
1866+ (unsigned long) jme);
1867+ tasklet_init(&jme->rxclean_task, jme_rx_clean_tasklet,
1868+ (unsigned long) jme);
1869+ tasklet_init(&jme->rxempty_task, jme_rx_empty_tasklet,
1870+ (unsigned long) jme);
18671871
18681872 rc = jme_request_irq(jme);
18691873 if (rc)
@@ -1948,10 +1952,10 @@ jme_close(struct net_device *netdev) · 78 unmodified lines
19481952
19491953 JME_NAPI_DISABLE(jme);
19501954
1951− tasklet_disable(&jme->linkch_task);
1952− tasklet_disable(&jme->txclean_task);
1953− tasklet_disable(&jme->rxclean_task);
1954− tasklet_disable(&jme->rxempty_task);
1955+ tasklet_kill(&jme->linkch_task);
1956+ tasklet_kill(&jme->txclean_task);
1957+ tasklet_kill(&jme->rxclean_task);
1958+ tasklet_kill(&jme->rxempty_task);
19551959
19561960 jme_disable_rx_engine(jme);
19571961 jme_disable_tx_engine(jme);
@@ -3079,22 +3083,6 @@ jme_init_one(struct pci_dev *pdev, · 1121 unmodified lines
30793083 tasklet_init(&jme->pcc_task,
30803084 jme_pcc_tasklet,
30813085 (unsigned long) jme);
3082− tasklet_init(&jme->linkch_task,
3083− jme_link_change_tasklet,
3084− (unsigned long) jme);
3085− tasklet_init(&jme->txclean_task,
3086− jme_tx_clean_tasklet,
3087− (unsigned long) jme);
3088− tasklet_init(&jme->rxclean_task,
3089− jme_rx_clean_tasklet,
3090− (unsigned long) jme);
3091− tasklet_init(&jme->rxempty_task,
3092− jme_rx_empty_tasklet,
3093− (unsigned long) jme);
3094− tasklet_disable_nosync(&jme->linkch_task);
3095− tasklet_disable_nosync(&jme->txclean_task);
3096− tasklet_disable_nosync(&jme->rxclean_task);
3097− tasklet_disable_nosync(&jme->rxempty_task);
30983086 jme->dpi.cur = PCC_P1;
30993087
31003088 jme->reg_ghc = 0;
drivers/net/ethernet/marvell/skge.c+1−1
@@ -4026,7 +4026,7 @@ static void __devexit skge_remove(struct pci_dev *pdev) · 4025 unmodified lines
40264026 dev0 = hw->dev[0];
40274027 unregister_netdev(dev0);
40284028
4029− tasklet_disable(&hw->phy_task);
4029+ tasklet_kill(&hw->phy_task);
40304030
40314031 spin_lock_irq(&hw->hw_lock);
40324032 hw->intr_mask = 0;
drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c+1−1
@@ -237,7 +237,7 @@ static int mlx4_en_dcbnl_ieee_setmaxrate(struct net_device *dev, · 236 unmodified lines
237237 if (err)
238238 return err;
239239
240− memcpy(priv->maxrate, tmp, sizeof(*priv->maxrate));
240+ memcpy(priv->maxrate, tmp, sizeof(priv->maxrate));
241241
242242 return 0;
243243 }
drivers/net/ethernet/mellanox/mlx4/en_tx.c+1−2
@@ -143,7 +143,6 @@ void mlx4_en_destroy_tx_ring(struct mlx4_en_priv *priv, · 142 unmodified lines
143143 mlx4_bf_free(mdev->dev, &ring->bf);
144144 mlx4_qp_remove(mdev->dev, &ring->qp);
145145 mlx4_qp_free(mdev->dev, &ring->qp);
146− mlx4_qp_release_range(mdev->dev, ring->qpn, 1);
147146 mlx4_en_unmap_buffer(&ring->wqres.buf);
148147 mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size);
149148 kfree(ring->bounce_buf);
@@ -712,7 +711,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) · 562 unmodified lines
712711 if (bounce)
713712 tx_desc = mlx4_en_bounce_to_desc(priv, ring, index, desc_size);
714713
715− if (ring->bf_enabled && desc_size <= MAX_BF && !bounce && !vlan_tag) {
714+ if (ring->bf_enabled && desc_size <= MAX_BF && !bounce && !vlan_tx_tag_present(skb)) {
716715 *(__be32 *) (&tx_desc->ctrl.vlan_tag) |= cpu_to_be32(ring->doorbell_qpn);
717716 op_own |= htonl((bf_index & 0xffff) << 8);
718717 /* Ensure new descirptor hits memory
drivers/net/ethernet/mellanox/mlx4/eq.c+14−10
@@ -329,9 +329,6 @@ int set_and_calc_slave_port_state(struct mlx4_dev *dev, int slave, · 328 unmodified lines
329329 ctx = &priv->mfunc.master.slave_state[slave];
330330 spin_lock_irqsave(&ctx->lock, flags);
331331
332− mlx4_dbg(dev, "%s: slave: %d, current state: %d new event :%d\n",
333− __func__, slave, cur_state, event);
334−
335332 switch (cur_state) {
336333 case SLAVE_PORT_DOWN:
337334 if (MLX4_PORT_STATE_DEV_EVENT_PORT_UP == event)
@@ -366,9 +363,6 @@ int set_and_calc_slave_port_state(struct mlx4_dev *dev, int slave, · 28 unmodified lines
366363 goto out;
367364 }
368365 ret = mlx4_get_slave_port_state(dev, slave, port);
369− mlx4_dbg(dev, "%s: slave: %d, current state: %d new event"
370− " :%d gen_event: %d\n",
371− __func__, slave, cur_state, event, *gen_event);
372366
373367 out:
374368 spin_unlock_irqrestore(&ctx->lock, flags);
@@ -843,6 +837,18 @@ static void __iomem *mlx4_get_eq_uar(struct mlx4_dev *dev, struct mlx4_eq *eq) · 468 unmodified lines
843837 return priv->eq_table.uar_map[index] + 0x800 + 8 * (eq->eqn % 4);
844838 }
845839
840+static void mlx4_unmap_uar(struct mlx4_dev *dev)
841+{
842+ struct mlx4_priv *priv = mlx4_priv(dev);
843+ int i;
844+
845+ for (i = 0; i < mlx4_num_eq_uar(dev); ++i)
846+ if (priv->eq_table.uar_map[i]) {
847+ iounmap(priv->eq_table.uar_map[i]);
848+ priv->eq_table.uar_map[i] = NULL;
849+ }
850+}
851+
846852 static int mlx4_create_eq(struct mlx4_dev *dev, int nent,
847853 u8 intr, struct mlx4_eq *eq)
848854 {
@@ -1207,6 +1213,7 @@ err_out_unmap: · 358 unmodified lines
12071213 mlx4_free_irqs(dev);
12081214
12091215 err_out_bitmap:
1216+ mlx4_unmap_uar(dev);
12101217 mlx4_bitmap_cleanup(&priv->eq_table.bitmap);
12111218
12121219 err_out_free:
@@ -1231,10 +1238,7 @@ void mlx4_cleanup_eq_table(struct mlx4_dev *dev) · 18 unmodified lines
12311238 if (!mlx4_is_slave(dev))
12321239 mlx4_unmap_clr_int(dev);
12331240
1234− for (i = 0; i < mlx4_num_eq_uar(dev); ++i)
1235− if (priv->eq_table.uar_map[i])
1236− iounmap(priv->eq_table.uar_map[i]);
1237−
1241+ mlx4_unmap_uar(dev);
12381242 mlx4_bitmap_cleanup(&priv->eq_table.bitmap);
12391243
12401244 kfree(priv->eq_table.uar_map);
drivers/net/ethernet/mellanox/mlx4/main.c+4−1
@@ -1405,7 +1405,10 @@ unmap_bf: · 1404 unmodified lines
14051405 unmap_bf_area(dev);
14061406
14071407 err_close:
1408− mlx4_close_hca(dev);
1408+ if (mlx4_is_slave(dev))
1409+ mlx4_slave_exit(dev);
1410+ else
1411+ mlx4_CLOSE_HCA(dev, 0);
14091412
14101413 err_free_icm:
14111414 if (!mlx4_is_slave(dev))
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c+0−6
@@ -330,9 +330,6 @@ static void update_pkey_index(struct mlx4_dev *dev, int slave, · 329 unmodified lines
330330
331331 new_index = priv->virt2phys_pkey[slave][port - 1][orig_index];
332332 *(u8 *)(inbox->buf + 35) = new_index;
333−
334− mlx4_dbg(dev, "port = %d, orig pkey index = %d, "
335− "new pkey index = %d\n", port, orig_index, new_index);
336333 }
337334
338335 static void update_gid(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *inbox,
@@ -351,9 +348,6 @@ static void update_gid(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *inbox, · 12 unmodified lines
351348 if (optpar & MLX4_QP_OPTPAR_ALT_ADDR_PATH)
352349 qp_ctx->alt_path.mgid_index = slave & 0x7F;
353350 }
354−
355− mlx4_dbg(dev, "slave %d, new gid index: 0x%x ",
356− slave, qp_ctx->pri_path.mgid_index);
357351 }
358352
359353 static int mpt_mask(struct mlx4_dev *dev)
drivers/net/ethernet/micrel/ksz884x.c+6−14
@@ -5407,8 +5407,8 @@ static int netdev_close(struct net_device *dev) · 5406 unmodified lines
54075407 /* Delay for receive task to stop scheduling itself. */
54085408 msleep(2000 / HZ);
54095409
5410− tasklet_disable(&hw_priv->rx_tasklet);
5411− tasklet_disable(&hw_priv->tx_tasklet);
5410+ tasklet_kill(&hw_priv->rx_tasklet);
5411+ tasklet_kill(&hw_priv->tx_tasklet);
54125412 free_irq(dev->irq, hw_priv->dev);
54135413
54145414 transmit_cleanup(hw_priv, 0);
@@ -5459,8 +5459,10 @@ static int prepare_hardware(struct net_device *dev) · 44 unmodified lines
54595459 rc = request_irq(dev->irq, netdev_intr, IRQF_SHARED, dev->name, dev);
54605460 if (rc)
54615461 return rc;
5462− tasklet_enable(&hw_priv->rx_tasklet);
5463− tasklet_enable(&hw_priv->tx_tasklet);
5462+ tasklet_init(&hw_priv->rx_tasklet, rx_proc_task,
5463+ (unsigned long) hw_priv);
5464+ tasklet_init(&hw_priv->tx_tasklet, tx_proc_task,
5465+ (unsigned long) hw_priv);
54645466
54655467 hw->promiscuous = 0;
54665468 hw->all_multi = 0;
@@ -7033,16 +7035,6 @@ static int __devinit pcidev_init(struct pci_dev *pdev, · 1566 unmodified lines
70337035 spin_lock_init(&hw_priv->hwlock);
70347036 mutex_init(&hw_priv->lock);
70357037
7036− /* tasklet is enabled. */
7037− tasklet_init(&hw_priv->rx_tasklet, rx_proc_task,
7038− (unsigned long) hw_priv);
7039− tasklet_init(&hw_priv->tx_tasklet, tx_proc_task,
7040− (unsigned long) hw_priv);
7041−
7042− /* tasklet_enable will decrement the atomic counter. */
7043− tasklet_disable(&hw_priv->rx_tasklet);
7044− tasklet_disable(&hw_priv->tx_tasklet);
7045−
70467038 for (i = 0; i < TOTAL_PORT_NUM; i++)
70477039 init_waitqueue_head(&hw_priv->counter[i].counter);
70487040
drivers/net/ethernet/nxp/lpc_eth.c+1−0
@@ -1524,6 +1524,7 @@ static int lpc_eth_drv_remove(struct platform_device *pdev) · 1523 unmodified lines
15241524 pldat->dma_buff_base_p);
15251525 free_irq(ndev->irq, ndev);
15261526 iounmap(pldat->net_base);
1527+ mdiobus_unregister(pldat->mii_bus);
15271528 mdiobus_free(pldat->mii_bus);
15281529 clk_disable(pldat->clk);
15291530 clk_put(pldat->clk);
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c+37−79
@@ -338,26 +338,6 @@ static void pch_gbe_wait_clr_bit(void *reg, u32 bit) · 337 unmodified lines
338338 pr_err("Error: busy bit is not cleared\n");
339339 }
340340
341−/**
342− * pch_gbe_wait_clr_bit_irq - Wait to clear a bit for interrupt context
343− * @reg: Pointer of register
344− * @busy: Busy bit
345− */
346−static int pch_gbe_wait_clr_bit_irq(void *reg, u32 bit)
347−{
348− u32 tmp;
349− int ret = -1;
350− /* wait busy */
351− tmp = 20;
352− while ((ioread32(reg) & bit) && --tmp)
353− udelay(5);
354− if (!tmp)
355− pr_err("Error: busy bit is not cleared\n");
356− else
357− ret = 0;
358− return ret;
359−}
360−
361341 /**
362342 * pch_gbe_mac_mar_set - Set MAC address register
363343 * @hw: Pointer to the HW structure
@@ -409,15 +389,20 @@ static void pch_gbe_mac_reset_hw(struct pch_gbe_hw *hw) · 45 unmodified lines
409389 return;
410390 }
411391
412−static void pch_gbe_mac_reset_rx(struct pch_gbe_hw *hw)
392+static void pch_gbe_disable_mac_rx(struct pch_gbe_hw *hw)
413393 {
414− /* Read the MAC addresses. and store to the private data */
415− pch_gbe_mac_read_mac_addr(hw);
416− iowrite32(PCH_GBE_RX_RST, &hw->reg->RESET);
417− pch_gbe_wait_clr_bit_irq(&hw->reg->RESET, PCH_GBE_RX_RST);
418− /* Setup the MAC addresses */
419− pch_gbe_mac_mar_set(hw, hw->mac.addr, 0);
420− return;
394+ u32 rctl;
395+ /* Disables Receive MAC */
396+ rctl = ioread32(&hw->reg->MAC_RX_EN);
397+ iowrite32((rctl & ~PCH_GBE_MRE_MAC_RX_EN), &hw->reg->MAC_RX_EN);
398+}
399+
400+static void pch_gbe_enable_mac_rx(struct pch_gbe_hw *hw)
401+{
402+ u32 rctl;
403+ /* Enables Receive MAC */
404+ rctl = ioread32(&hw->reg->MAC_RX_EN);
405+ iowrite32((rctl | PCH_GBE_MRE_MAC_RX_EN), &hw->reg->MAC_RX_EN);
421406 }
422407
423408 /**
@@ -913,7 +898,7 @@ static void pch_gbe_setup_rctl(struct pch_gbe_adapter *adapter) · 489 unmodified lines
913898 static void pch_gbe_configure_rx(struct pch_gbe_adapter *adapter)
914899 {
915900 struct pch_gbe_hw *hw = &adapter->hw;
916− u32 rdba, rdlen, rctl, rxdma;
901+ u32 rdba, rdlen, rxdma;
917902
918903 pr_debug("dma adr = 0x%08llx size = 0x%08x\n",
919904 (unsigned long long)adapter->rx_ring->dma,
@@ -921,9 +906,7 @@ static void pch_gbe_configure_rx(struct pch_gbe_adapter *adapter) · 1 unmodified line
921906
922907 pch_gbe_mac_force_mac_fc(hw);
923908
924− /* Disables Receive MAC */
925− rctl = ioread32(&hw->reg->MAC_RX_EN);
926− iowrite32((rctl & ~PCH_GBE_MRE_MAC_RX_EN), &hw->reg->MAC_RX_EN);
909+ pch_gbe_disable_mac_rx(hw);
927910
928911 /* Disables Receive DMA */
929912 rxdma = ioread32(&hw->reg->DMA_CTRL);
@@ -1316,38 +1299,17 @@ void pch_gbe_update_stats(struct pch_gbe_adapter *adapter) · 386 unmodified lines
13161299 spin_unlock_irqrestore(&adapter->stats_lock, flags);
13171300 }
13181301
1319−static void pch_gbe_stop_receive(struct pch_gbe_adapter *adapter)
1302+static void pch_gbe_disable_dma_rx(struct pch_gbe_hw *hw)
13201303 {
1321− struct pch_gbe_hw *hw = &adapter->hw;
13221304 u32 rxdma;
1323− u16 value;
1324− int ret;
13251305
13261306 /* Disable Receive DMA */
13271307 rxdma = ioread32(&hw->reg->DMA_CTRL);
13281308 rxdma &= ~PCH_GBE_RX_DMA_EN;
13291309 iowrite32(rxdma, &hw->reg->DMA_CTRL);
1330− /* Wait Rx DMA BUS is IDLE */
1331− ret = pch_gbe_wait_clr_bit_irq(&hw->reg->RX_DMA_ST, PCH_GBE_IDLE_CHECK);
1332− if (ret) {
1333− /* Disable Bus master */
1334− pci_read_config_word(adapter->pdev, PCI_COMMAND, &value);
1335− value &= ~PCI_COMMAND_MASTER;
1336− pci_write_config_word(adapter->pdev, PCI_COMMAND, value);
1337− /* Stop Receive */
1338− pch_gbe_mac_reset_rx(hw);
1339− /* Enable Bus master */
1340− value |= PCI_COMMAND_MASTER;
1341− pci_write_config_word(adapter->pdev, PCI_COMMAND, value);
1342− } else {
1343− /* Stop Receive */
1344− pch_gbe_mac_reset_rx(hw);
1345− }
1346− /* reprogram multicast address register after reset */
1347− pch_gbe_set_multi(adapter->netdev);
13481310 }
13491311
1350−static void pch_gbe_start_receive(struct pch_gbe_hw *hw)
1312+static void pch_gbe_enable_dma_rx(struct pch_gbe_hw *hw)
13511313 {
13521314 u32 rxdma;
13531315
@@ -1355,9 +1317,6 @@ static void pch_gbe_start_receive(struct pch_gbe_hw *hw) · 1 unmodified line
13551317 rxdma = ioread32(&hw->reg->DMA_CTRL);
13561318 rxdma |= PCH_GBE_RX_DMA_EN;
13571319 iowrite32(rxdma, &hw->reg->DMA_CTRL);
1358− /* Enables Receive */
1359− iowrite32(PCH_GBE_MRE_MAC_RX_EN, &hw->reg->MAC_RX_EN);
1360− return;
13611320 }
13621321
13631322 /**
@@ -1393,7 +1352,7 @@ static irqreturn_t pch_gbe_intr(int irq, void *data) · 29 unmodified lines
13931352 int_en = ioread32(&hw->reg->INT_EN);
13941353 iowrite32((int_en & ~PCH_GBE_INT_RX_FIFO_ERR),
13951354 &hw->reg->INT_EN);
1396− pch_gbe_stop_receive(adapter);
1355+ pch_gbe_disable_dma_rx(&adapter->hw);
13971356 int_st |= ioread32(&hw->reg->INT_ST);
13981357 int_st = int_st & ioread32(&hw->reg->INT_EN);
13991358 }
@@ -1971,12 +1930,12 @@ int pch_gbe_up(struct pch_gbe_adapter *adapter) · 571 unmodified lines
19711930 struct net_device *netdev = adapter->netdev;
19721931 struct pch_gbe_tx_ring *tx_ring = adapter->tx_ring;
19731932 struct pch_gbe_rx_ring *rx_ring = adapter->rx_ring;
1974− int err;
1933+ int err = -EINVAL;
19751934
19761935 /* Ensure we have a valid MAC */
19771936 if (!is_valid_ether_addr(adapter->hw.mac.addr)) {
19781937 pr_err("Error: Invalid MAC address\n");
1979− return -EINVAL;
1938+ goto out;
19801939 }
19811940
19821941 /* hardware has been reset, we need to reload some things */
@@ -1989,18 +1948,19 @@ int pch_gbe_up(struct pch_gbe_adapter *adapter) · 6 unmodified lines
19891948
19901949 err = pch_gbe_request_irq(adapter);
19911950 if (err) {
1992− pr_err("Error: can't bring device up\n");
1993− return err;
1951+ pr_err("Error: can't bring device up - irq request failed\n");
1952+ goto out;
19941953 }
19951954 err = pch_gbe_alloc_rx_buffers_pool(adapter, rx_ring, rx_ring->count);
19961955 if (err) {
1997− pr_err("Error: can't bring device up\n");
1998− return err;
1956+ pr_err("Error: can't bring device up - alloc rx buffers pool failed\n");
1957+ goto freeirq;
19991958 }
20001959 pch_gbe_alloc_tx_buffers(adapter, tx_ring);
20011960 pch_gbe_alloc_rx_buffers(adapter, rx_ring, rx_ring->count);
20021961 adapter->tx_queue_len = netdev->tx_queue_len;
2003− pch_gbe_start_receive(&adapter->hw);
1962+ pch_gbe_enable_dma_rx(&adapter->hw);
1963+ pch_gbe_enable_mac_rx(&adapter->hw);
20041964
20051965 mod_timer(&adapter->watchdog_timer, jiffies);
20061966
@@ -2009,6 +1969,11 @@ int pch_gbe_up(struct pch_gbe_adapter *adapter) · 2 unmodified lines
20091969 netif_start_queue(adapter->netdev);
20101970
20111971 return 0;
1972+
1973+freeirq:
1974+ pch_gbe_free_irq(adapter);
1975+out:
1976+ return err;
20121977 }
20131978
20141979 /**
@@ -2405,7 +2370,6 @@ static int pch_gbe_napi_poll(struct napi_struct *napi, int budget) · 390 unmodified lines
24052370 int work_done = 0;
24062371 bool poll_end_flag = false;
24072372 bool cleaned = false;
2408− u32 int_en;
24092373
24102374 pr_debug("budget : %d\n", budget);
24112375
@@ -2422,19 +2386,13 @@ static int pch_gbe_napi_poll(struct napi_struct *napi, int budget) · 10 unmodified lines
24222386
24232387 if (poll_end_flag) {
24242388 napi_complete(napi);
2425− if (adapter->rx_stop_flag) {
2426− adapter->rx_stop_flag = false;
2427− pch_gbe_start_receive(&adapter->hw);
2428− }
24292389 pch_gbe_irq_enable(adapter);
2430− } else
2431− if (adapter->rx_stop_flag) {
2432− adapter->rx_stop_flag = false;
2433− pch_gbe_start_receive(&adapter->hw);
2434− int_en = ioread32(&adapter->hw.reg->INT_EN);
2435− iowrite32((int_en | PCH_GBE_INT_RX_FIFO_ERR),
2436− &adapter->hw.reg->INT_EN);
2437− }
2390+ }
2391+
2392+ if (adapter->rx_stop_flag) {
2393+ adapter->rx_stop_flag = false;
2394+ pch_gbe_enable_dma_rx(&adapter->hw);
2395+ }
24382396
24392397 pr_debug("poll_end_flag : %d work_done : %d budget : %d\n",
24402398 poll_end_flag, work_done, budget);
drivers/net/ethernet/qlogic/qla3xxx.c+7−2
@@ -2525,6 +2525,13 @@ static int ql_alloc_net_req_rsp_queues(struct ql3_adapter *qdev) · 2524 unmodified lines
25252525 qdev->req_q_size =
25262526 (u32) (NUM_REQ_Q_ENTRIES * sizeof(struct ob_mac_iocb_req));
25272527
2528+ qdev->rsp_q_size = NUM_RSP_Q_ENTRIES * sizeof(struct net_rsp_iocb);
2529+
2530+ /* The barrier is required to ensure request and response queue
2531+ * addr writes to the registers.
2532+ */
2533+ wmb();
2534+
25282535 qdev->req_q_virt_addr =
25292536 pci_alloc_consistent(qdev->pdev,
25302537 (size_t) qdev->req_q_size,
@@ -2536,8 +2543,6 @@ static int ql_alloc_net_req_rsp_queues(struct ql3_adapter *qdev) · 5 unmodified lines
25362543 return -ENOMEM;
25372544 }
25382545
2539− qdev->rsp_q_size = NUM_RSP_Q_ENTRIES * sizeof(struct net_rsp_iocb);
2540−
25412546 qdev->rsp_q_virt_addr =
25422547 pci_alloc_consistent(qdev->pdev,
25432548 (size_t) qdev->rsp_q_size,
drivers/net/ethernet/realtek/8139cp.c+19−14
@@ -979,17 +979,6 @@ static void cp_init_hw (struct cp_private *cp) · 978 unmodified lines
979979 cpw32_f (MAC0 + 0, le32_to_cpu (*(__le32 *) (dev->dev_addr + 0)));
980980 cpw32_f (MAC0 + 4, le32_to_cpu (*(__le32 *) (dev->dev_addr + 4)));
981981
982− cpw32_f(HiTxRingAddr, 0);
983− cpw32_f(HiTxRingAddr + 4, 0);
984−
985− ring_dma = cp->ring_dma;
986− cpw32_f(RxRingAddr, ring_dma & 0xffffffff);
987− cpw32_f(RxRingAddr + 4, (ring_dma >> 16) >> 16);
988−
989− ring_dma += sizeof(struct cp_desc) * CP_RX_RING_SIZE;
990− cpw32_f(TxRingAddr, ring_dma & 0xffffffff);
991− cpw32_f(TxRingAddr + 4, (ring_dma >> 16) >> 16);
992−
993982 cp_start_hw(cp);
994983 cpw8(TxThresh, 0x06); /* XXX convert magic num to a constant */
995984
@@ -1003,6 +992,17 @@ static void cp_init_hw (struct cp_private *cp) · 7 unmodified lines
1003992
1004993 cpw8(Config5, cpr8(Config5) & PMEStatus);
1005994
995+ cpw32_f(HiTxRingAddr, 0);
996+ cpw32_f(HiTxRingAddr + 4, 0);
997+
998+ ring_dma = cp->ring_dma;
999+ cpw32_f(RxRingAddr, ring_dma & 0xffffffff);
1000+ cpw32_f(RxRingAddr + 4, (ring_dma >> 16) >> 16);
1001+
1002+ ring_dma += sizeof(struct cp_desc) * CP_RX_RING_SIZE;
1003+ cpw32_f(TxRingAddr, ring_dma & 0xffffffff);
1004+ cpw32_f(TxRingAddr + 4, (ring_dma >> 16) >> 16);
1005+
10061006 cpw16(MultiIntr, 0);
10071007
10081008 cpw8_f(Cfg9346, Cfg9346_Lock);
@@ -1060,17 +1060,22 @@ static int cp_init_rings (struct cp_private *cp) · 51 unmodified lines
10601060
10611061 static int cp_alloc_rings (struct cp_private *cp)
10621062 {
1063+ struct device *d = &cp->pdev->dev;
10631064 void *mem;
1065+ int rc;
10641066
1065− mem = dma_alloc_coherent(&cp->pdev->dev, CP_RING_BYTES,
1066− &cp->ring_dma, GFP_KERNEL);
1067+ mem = dma_alloc_coherent(d, CP_RING_BYTES, &cp->ring_dma, GFP_KERNEL);
10671068 if (!mem)
10681069 return -ENOMEM;
10691070
10701071 cp->rx_ring = mem;
10711072 cp->tx_ring = &cp->rx_ring[CP_RX_RING_SIZE];
10721073
1073− return cp_init_rings(cp);
1074+ rc = cp_init_rings(cp);
1075+ if (rc < 0)
1076+ dma_free_coherent(d, CP_RING_BYTES, cp->rx_ring, cp->ring_dma);
1077+
1078+ return rc;
10741079 }
10751080
10761081 static void cp_clean_rings (struct cp_private *cp)
drivers/net/ethernet/realtek/r8169.c+5−0
@@ -3827,6 +3827,8 @@ static void rtl_wol_suspend_quirk(struct rtl8169_private *tp) · 3826 unmodified lines
38273827 void __iomem *ioaddr = tp->mmio_addr;
38283828
38293829 switch (tp->mac_version) {
3830+ case RTL_GIGA_MAC_VER_25:
3831+ case RTL_GIGA_MAC_VER_26:
38303832 case RTL_GIGA_MAC_VER_29:
38313833 case RTL_GIGA_MAC_VER_30:
38323834 case RTL_GIGA_MAC_VER_32:
@@ -4519,6 +4521,9 @@ static void rtl_set_rx_mode(struct net_device *dev) · 686 unmodified lines
45194521 mc_filter[1] = swab32(data);
45204522 }
45214523
4524+ if (tp->mac_version == RTL_GIGA_MAC_VER_35)
4525+ mc_filter[1] = mc_filter[0] = 0xffffffff;
4526+
45224527 RTL_W32(MAR0 + 4, mc_filter[1]);
45234528 RTL_W32(MAR0 + 0, mc_filter[0]);
45244529
drivers/net/ethernet/sis/sis900.c+1−1
@@ -2479,7 +2479,7 @@ static int sis900_resume(struct pci_dev *pci_dev) · 2478 unmodified lines
24792479 netif_start_queue(net_dev);
24802480
24812481 /* Workaround for EDB */
2482− sis900_set_mode(ioaddr, HW_SPEED_10_MBPS, FDX_CAPABLE_HALF_SELECTED);
2482+ sis900_set_mode(sis_priv, HW_SPEED_10_MBPS, FDX_CAPABLE_HALF_SELECTED);
24832483
24842484 /* Enable all known interrupts by setting the interrupt mask. */
24852485 sw32(imr, RxSOVR | RxORN | RxERR | RxOK | TxURN | TxERR | TxIDLE);
drivers/net/ethernet/smsc/smsc911x.c+15−2
@@ -2110,7 +2110,7 @@ static void __devinit smsc911x_read_mac_address(struct net_device *dev) · 2109 unmodified lines
21102110 static int __devinit smsc911x_init(struct net_device *dev)
21112111 {
21122112 struct smsc911x_data *pdata = netdev_priv(dev);
2113− unsigned int byte_test;
2113+ unsigned int byte_test, mask;
21142114 unsigned int to = 100;
21152115
21162116 SMSC_TRACE(pdata, probe, "Driver Parameters:");
@@ -2130,9 +2130,22 @@ static int __devinit smsc911x_init(struct net_device *dev) · 13 unmodified lines
21302130 /*
21312131 * poll the READY bit in PMT_CTRL. Any other access to the device is
21322132 * forbidden while this bit isn't set. Try for 100ms
2133+ *
2134+ * Note that this test is done before the WORD_SWAP register is
2135+ * programmed. So in some configurations the READY bit is at 16 before
2136+ * WORD_SWAP is written to. This issue is worked around by waiting
2137+ * until either bit 0 or bit 16 gets set in PMT_CTRL.
2138+ *
2139+ * SMSC has confirmed that checking bit 16 (marked as reserved in
2140+ * the datasheet) is fine since these bits "will either never be set
2141+ * or can only go high after READY does (so also indicate the device
2142+ * is ready)".
21332143 */
2134− while (!(smsc911x_reg_read(pdata, PMT_CTRL) & PMT_CTRL_READY_) && --to)
2144+
2145+ mask = PMT_CTRL_READY_ | swahw32(PMT_CTRL_READY_);
2146+ while (!(smsc911x_reg_read(pdata, PMT_CTRL) & mask) && --to)
21352147 udelay(1000);
2148+
21362149 if (to == 0) {
21372150 pr_err("Device not READY in 100ms aborting\n");
21382151 return -ENODEV;
drivers/net/ethernet/ti/Kconfig+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 config NET_VENDOR_TI
66 bool "Texas Instruments (TI) devices"
77 default y
8− depends on PCI || EISA || AR7 || (ARM && (ARCH_DAVINCI || ARCH_OMAP3))
8+ depends on PCI || EISA || AR7 || (ARM && (ARCH_DAVINCI || ARCH_OMAP3 || SOC_AM33XX))
99 ---help---
1010 If you have a network (Ethernet) card belonging to this class, say Y
1111 and read the Ethernet-HOWTO, available from
drivers/net/ethernet/tile/tilegx.c+20−17
@@ -917,7 +917,7 @@ static int tile_net_setup_interrupts(struct net_device *dev) · 916 unmodified lines
917917 ingress_irq = rc;
918918 tile_irq_activate(ingress_irq, TILE_IRQ_PERCPU);
919919 rc = request_irq(ingress_irq, tile_net_handle_ingress_irq,
920− 0, NULL, NULL);
920+ 0, "tile_net", NULL);
921921 if (rc != 0) {
922922 netdev_err(dev, "request_irq failed: %d\n", rc);
923923 destroy_irq(ingress_irq);
@@ -1334,11 +1334,11 @@ static int tso_count_edescs(struct sk_buff *skb) · 410 unmodified lines
13341334 {
13351335 struct skb_shared_info *sh = skb_shinfo(skb);
13361336 unsigned int sh_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
1337− unsigned int data_len = skb->data_len + skb->hdr_len - sh_len;
1337+ unsigned int data_len = skb->len - sh_len;
13381338 unsigned int p_len = sh->gso_size;
13391339 long f_id = -1; /* id of the current fragment */
1340− long f_size = skb->hdr_len; /* size of the current fragment */
1341− long f_used = sh_len; /* bytes used from the current fragment */
1340+ long f_size = skb_headlen(skb) - sh_len; /* current fragment size */
1341+ long f_used = 0; /* bytes used from the current fragment */
13421342 long n; /* size of the current piece of payload */
13431343 int num_edescs = 0;
13441344 int segment;
@@ -1353,7 +1353,7 @@ static int tso_count_edescs(struct sk_buff *skb) · 8 unmodified lines
13531353 /* Advance as needed. */
13541354 while (f_used >= f_size) {
13551355 f_id++;
1356− f_size = sh->frags[f_id].size;
1356+ f_size = skb_frag_size(&sh->frags[f_id]);
13571357 f_used = 0;
13581358 }
13591359
@@ -1384,13 +1384,13 @@ static void tso_headers_prepare(struct sk_buff *skb, unsigned char *headers, · 24 unmodified lines
13841384 struct iphdr *ih;
13851385 struct tcphdr *th;
13861386 unsigned int sh_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
1387− unsigned int data_len = skb->data_len + skb->hdr_len - sh_len;
1387+ unsigned int data_len = skb->len - sh_len;
13881388 unsigned char *data = skb->data;
13891389 unsigned int ih_off, th_off, p_len;
13901390 unsigned int isum_seed, tsum_seed, id, seq;
13911391 long f_id = -1; /* id of the current fragment */
1392− long f_size = skb->hdr_len; /* size of the current fragment */
1393− long f_used = sh_len; /* bytes used from the current fragment */
1392+ long f_size = skb_headlen(skb) - sh_len; /* current fragment size */
1393+ long f_used = 0; /* bytes used from the current fragment */
13941394 long n; /* size of the current piece of payload */
13951395 int segment;
13961396
@@ -1405,7 +1405,7 @@ static void tso_headers_prepare(struct sk_buff *skb, unsigned char *headers, · 8 unmodified lines
14051405 isum_seed = ((0xFFFF - ih->check) +
14061406 (0xFFFF - ih->tot_len) +
14071407 (0xFFFF - ih->id));
1408− tsum_seed = th->check + (0xFFFF ^ htons(sh_len + data_len));
1408+ tsum_seed = th->check + (0xFFFF ^ htons(skb->len));
14091409 id = ntohs(ih->id);
14101410 seq = ntohl(th->seq);
14111411
@@ -1444,7 +1444,7 @@ static void tso_headers_prepare(struct sk_buff *skb, unsigned char *headers, · 32 unmodified lines
14441444 /* Advance as needed. */
14451445 while (f_used >= f_size) {
14461446 f_id++;
1447− f_size = sh->frags[f_id].size;
1447+ f_size = skb_frag_size(&sh->frags[f_id]);
14481448 f_used = 0;
14491449 }
14501450
@@ -1478,14 +1478,14 @@ static void tso_egress(struct net_device *dev, gxio_mpipe_equeue_t *equeue, · 27 unmodified lines
14781478 struct tile_net_priv *priv = netdev_priv(dev);
14791479 struct skb_shared_info *sh = skb_shinfo(skb);
14801480 unsigned int sh_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
1481− unsigned int data_len = skb->data_len + skb->hdr_len - sh_len;
1481+ unsigned int data_len = skb->len - sh_len;
14821482 unsigned int p_len = sh->gso_size;
14831483 gxio_mpipe_edesc_t edesc_head = { { 0 } };
14841484 gxio_mpipe_edesc_t edesc_body = { { 0 } };
14851485 long f_id = -1; /* id of the current fragment */
1486− long f_size = skb->hdr_len; /* size of the current fragment */
1487− long f_used = sh_len; /* bytes used from the current fragment */
1488− void *f_data = skb->data;
1486+ long f_size = skb_headlen(skb) - sh_len; /* current fragment size */
1487+ long f_used = 0; /* bytes used from the current fragment */
1488+ void *f_data = skb->data + sh_len;
14891489 long n; /* size of the current piece of payload */
14901490 unsigned long tx_packets = 0, tx_bytes = 0;
14911491 unsigned int csum_start;
@@ -1516,15 +1516,18 @@ static void tso_egress(struct net_device *dev, gxio_mpipe_equeue_t *equeue, · 24 unmodified lines
15161516
15171517 /* Egress the payload. */
15181518 while (p_used < p_len) {
1519+ void *va;
15191520
15201521 /* Advance as needed. */
15211522 while (f_used >= f_size) {
15221523 f_id++;
1523− f_size = sh->frags[f_id].size;
1524− f_used = 0;
1524+ f_size = skb_frag_size(&sh->frags[f_id]);
15251525 f_data = tile_net_frag_buf(&sh->frags[f_id]);
1526+ f_used = 0;

16 more lines aren’t shown here.

drivers/net/ethernet/xilinx/xilinx_axienet_main.c+9−7

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

drivers/net/ethernet/xscale/ixp4xx_eth.c+5−3

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

drivers/net/irda/sir_dev.c+1−1

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

drivers/net/phy/Kconfig+5−0

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

drivers/net/phy/Makefile+1−0

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

drivers/net/phy/at803x.c+176−0

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

drivers/net/phy/mdio-gpio.c+7−4

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

drivers/net/team/team.c+3−1

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

drivers/net/team/team_mode_broadcast.c+3−3

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

drivers/net/usb/cdc_eem.c+2−1

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

drivers/net/usb/cdc_ether.c+26−15

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

drivers/net/usb/cdc_ncm.c+18−4

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

drivers/net/usb/ipheth.c+5−0

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

drivers/net/usb/qmi_wwan.c+56−0

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

drivers/net/usb/smsc95xx.c+3−2

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

drivers/net/usb/usbnet.c+8−3

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

drivers/net/vmxnet3/vmxnet3_drv.c+45−20

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

drivers/net/vxlan.c+8−4

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

drivers/net/wan/ixp4xx_hss.c+6−4

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

drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h+82−82

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

drivers/net/wireless/ath/ath9k/hif_usb.c+1−0

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

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

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

drivers/net/wireless/ath/ath9k/xmit.c+8−2

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

drivers/net/wireless/b43/main.c+4−0

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

drivers/net/wireless/b43legacy/pio.c+1−1

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

drivers/net/wireless/brcm80211/brcmfmac/usb.c+1−1

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

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

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

drivers/net/wireless/ipw2x00/ipw2200.c+1−1

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

drivers/net/wireless/iwlwifi/dvm/devices.c+24−15

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

drivers/net/wireless/iwlwifi/dvm/mac80211.c+15−1

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

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

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

drivers/net/wireless/iwlwifi/dvm/rxon.c+6−6

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

drivers/net/wireless/iwlwifi/pcie/rx.c+21−2

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

drivers/net/wireless/iwlwifi/pcie/tx.c+0−8

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

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

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

drivers/net/wireless/mwifiex/cmdevt.c+8−3

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

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

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

drivers/net/wireless/mwifiex/sdio.c+6−5

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

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

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

drivers/net/wireless/rt2x00/rt2800lib.c+1−1

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

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

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

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

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

drivers/net/wireless/rtlwifi/rtl8192cu/sw.c+1−0

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

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

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

drivers/net/xen-netfront.c+77−21

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

drivers/nfc/pn533.c+14−11

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

drivers/pci/bus.c+0−3

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

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

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

drivers/pci/pci-sysfs.c+0−34

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

drivers/pci/pci.c+32−0

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

drivers/pci/pci.h+2−0

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

drivers/pci/pcie/aer/aerdrv_core.c+16−4

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

drivers/pci/pcie/portdrv_core.c+2−1

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

drivers/pci/proc.c+8−0

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

drivers/pinctrl/Kconfig+3−1

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

drivers/pinctrl/core.c+3−1

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

drivers/pinctrl/pinconf.c+0−4

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

drivers/pinctrl/pinctrl-nomadik.c+3−3

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

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

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

drivers/pinctrl/pinctrl-tegra30.c+12−12

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

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

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

drivers/pinctrl/spear/pinctrl-spear1310.c+320−45

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

drivers/pinctrl/spear/pinctrl-spear1340.c+39−2

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

drivers/pinctrl/spear/pinctrl-spear320.c+6−2

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

drivers/pinctrl/spear/pinctrl-spear3xx.h+1−0

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

drivers/rapidio/rio.c+1−1

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

drivers/regulator/core.c+20−13

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

drivers/remoteproc/remoteproc_virtio.c+12−6

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

drivers/rtc/rtc-imxdi.c+2−0

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

drivers/rtc/rtc-tps65910.c+3−3

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

drivers/s390/char/con3215.c+5−7

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

drivers/s390/cio/css.h+0−3

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

drivers/s390/cio/device.c+1−7

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

drivers/s390/cio/idset.c+1−2

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

drivers/s390/net/qeth_core_main.c+22−2

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

drivers/s390/net/qeth_l2_main.c+8−5

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

drivers/scsi/isci/request.c+1−1

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

drivers/scsi/megaraid/megaraid_sas.h+1−1

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

drivers/scsi/megaraid/megaraid_sas_base.c+6−8

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

drivers/scsi/qla2xxx/qla_mid.c+3−0

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

drivers/scsi/qla2xxx/qla_target.c+11−14

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

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

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

drivers/scsi/qla2xxx/tcm_qla2xxx.c+76−1

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

drivers/scsi/qla2xxx/tcm_qla2xxx.h+2−0

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

drivers/scsi/qlogicpti.c+1−12

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

drivers/scsi/scsi.c+45−0

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

drivers/scsi/scsi_lib.c+17−5

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

drivers/scsi/sd.c+179−23

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

drivers/scsi/sd.h+7−0

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

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

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

drivers/spi/spi-pl022.c+0−3

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

drivers/spi/spi-rspi.c+34−22

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

drivers/staging/android/android_alarm.h+1−3

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

drivers/staging/android/binder.c+28−2

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

drivers/staging/comedi/drivers/8255_pci.c+2−0

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

drivers/staging/comedi/drivers/amplc_dio200.c+2−0

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

drivers/staging/comedi/drivers/amplc_pc236.c+3−2

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

drivers/staging/comedi/drivers/amplc_pc263.c+2−0

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

drivers/staging/comedi/drivers/das08.c+2−0

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

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

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

drivers/staging/comedi/drivers/ni_labpc.c+2−0

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

drivers/staging/iio/accel/adis16201_core.c+13−11

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

drivers/staging/iio/accel/adis16203_core.c+11−9

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

drivers/staging/iio/accel/adis16204_core.c+12−10

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

drivers/staging/iio/accel/adis16209_core.c+10−8

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

drivers/staging/iio/accel/adis16220_core.c+11−8

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

drivers/staging/iio/accel/adis16240_core.c+12−11

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

drivers/staging/iio/gyro/adis16260_core.c+17−12

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

drivers/staging/iio/imu/adis16400.h+2−0

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

drivers/staging/iio/imu/adis16400_core.c+44−26

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

drivers/staging/ipack/bridges/tpci200.c+1−0

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

drivers/staging/omapdrm/omap_gem.c+2−2

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

drivers/staging/ramster/Kconfig+1−0

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

drivers/staging/tidspbridge/core/tiomap3430.c+26−11

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

drivers/staging/tidspbridge/hw/hw_mmu.c+20−95

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

drivers/staging/tidspbridge/hw/hw_mmu.h+14−17

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

drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h+2−2

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

drivers/staging/tidspbridge/include/dspbridge/host_os.h+2−2

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

drivers/staging/tidspbridge/rmgr/drv.c+4−4

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

drivers/staging/tidspbridge/rmgr/node.c+15−6

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

drivers/staging/zram/zram_drv.c+10−2

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

drivers/target/iscsi/iscsi_target.c+3−1

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

drivers/target/iscsi/iscsi_target_core.h+1−0

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

drivers/target/iscsi/iscsi_target_login.c+1−0

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

drivers/target/iscsi/iscsi_target_util.c+20−2

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

drivers/target/iscsi/iscsi_target_util.h+1−0

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

drivers/target/target_core_configfs.c+2−1

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

drivers/target/target_core_device.c+9−9

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

drivers/target/target_core_sbc.c+18−0

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

drivers/target/target_core_spc.c+2−0

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

drivers/target/target_core_tmr.c+3−3

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

drivers/target/target_core_transport.c+4−3

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/rcar_thermal.c+1−1

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

drivers/tty/hvc/hvc_console.c+0−7

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

drivers/tty/serial/max310x.c+1−0

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

drivers/tty/serial/omap-serial.c+6−6

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

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

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

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

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

drivers/usb/core/hub.c+5−2

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

drivers/usb/early/ehci-dbgp.c+9−6

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

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

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

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

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

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

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

drivers/usb/host/ohci-xls.c+1−1

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

drivers/usb/host/pci-quirks.c+8−1

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

drivers/usb/host/xhci-dbg.c+0−2

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

drivers/usb/host/xhci-hub.c+6−3

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

drivers/usb/host/xhci-ring.c+11−0

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

drivers/usb/host/xhci.c+4−4

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

drivers/usb/misc/ezusb.c+1−0

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

drivers/usb/musb/musb_dsps.c+4−4

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

drivers/usb/musb/musb_gadget.c+26−4

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

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

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

drivers/usb/otg/Kconfig+2−2

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

drivers/usb/renesas_usbhs/fifo.c+1−0

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

drivers/usb/renesas_usbhs/mod_host.c+5−0

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

drivers/usb/serial/ch341.c+16−7

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

drivers/usb/serial/digi_acceleport.c+67−50

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

drivers/usb/serial/ipw.c+3−4

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

drivers/usb/serial/keyspan.c+87−93

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

drivers/usb/serial/keyspan.h+8−0

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

drivers/usb/serial/mct_u232.c+33−26

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

drivers/usb/serial/metro-usb.c+19−46

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

drivers/usb/serial/mos7720.c+32−30

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

drivers/usb/serial/mos7840.c+207−288

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

drivers/usb/serial/omninet.c+18−18

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

drivers/usb/serial/opticon.c+9−2

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

drivers/usb/serial/option.c+29−3

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

drivers/usb/serial/qcserial.c+17−16

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

drivers/usb/serial/quatech2.c+61−74

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

drivers/usb/serial/sierra.c+68−65

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

drivers/usb/serial/usb-wwan.h+1−1

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

drivers/usb/serial/usb_wwan.c+53−77

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

drivers/usb/serial/whiteheat.c+27−33

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

drivers/usb/storage/scsiglue.c+6−0

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

drivers/usb/storage/unusual_devs.h+6−0

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

drivers/vhost/net.c+2−1

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

drivers/vhost/vhost.c+1−1

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

drivers/video/backlight/Kconfig+2−1

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

drivers/video/omap2/dss/dsi.c+11−2

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

drivers/video/omap2/dss/dss.c+11−7

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

drivers/video/omap2/dss/hdmi.c+3−1

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

drivers/video/omap2/omapfb/omapfb-ioctl.c+1−1

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

drivers/video/xen-fbfront.c+4−1

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

drivers/virtio/virtio.c+3−1

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

drivers/xen/Kconfig+2−0

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

drivers/xen/Makefile+1−0

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

drivers/xen/events.c+1−1

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

drivers/xen/fallback.c+80−0

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

drivers/xen/gntdev.c+19−17

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

drivers/xen/privcmd.c+11−7

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

drivers/xen/xenbus/xenbus_dev_frontend.c+1−1

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

fs/bio.c+4−2

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

fs/block_dev.c+3−120

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

fs/btrfs/backref.c+12−16

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

fs/btrfs/backref.h+4−0

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

fs/btrfs/ctree.c+55−15

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

fs/btrfs/ctree.h+3−0

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

fs/btrfs/extent_io.c+2−2

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

fs/btrfs/inode.c+3−4

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

fs/btrfs/ioctl.c+4−2

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

fs/btrfs/qgroup.c+13−4

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

fs/btrfs/send.c+95−61

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

fs/btrfs/transaction.c+1−1

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

fs/btrfs/volumes.c+7−0

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

fs/buffer.c+113−32

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

fs/ceph/export.c+2−0

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

fs/cifs/cifsacl.c+20−29

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

fs/cifs/dir.c+10−1

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

fs/cifs/file.c+3−3

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

fs/cifs/readdir.c+4−1

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

fs/cifs/smb1ops.c+1−2

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

fs/compat_ioctl.c+2−0

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

fs/direct-io.c+5−3

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

fs/eventpoll.c+3−35

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

fs/exec.c+2−1

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

fs/ext3/balloc.c+3−2

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

fs/ext4/ialloc.c+9−10

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

fs/file.c+10−9

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

fs/fs-writeback.c+2−0

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

fs/gfs2/file.c+5−9

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

fs/gfs2/lops.c+2−14

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

fs/gfs2/quota.c+5−2

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

fs/gfs2/rgrp.c+21−12

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

fs/gfs2/super.c+2−1

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

fs/gfs2/trans.c+8−0

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

fs/inode.c+14−2

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

fs/internal.h+1−0

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

fs/jbd/transaction.c+2−0

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

fs/jffs2/file.c+21−18

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

fs/lockd/mon.c+32−25

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

fs/namei.c+7−2

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

fs/nfs/dir.c+4−3

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

fs/nfs/dns_resolve.c+3−2

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

fs/nfs/inode.c+4−1

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

fs/nfs/internal.h+4−2

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

fs/nfs/mount_clnt.c+1−1

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

fs/nfs/namespace.c+14−5

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

fs/nfs/nfs4namespace.c+2−1

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

fs/nfs/nfs4proc.c+28−18

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

fs/nfs/pnfs.c+2−2

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

fs/nfs/super.c+50−1

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

fs/nfs/unlink.c+1−1

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

fs/notify/fanotify/fanotify.c+1−0

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

fs/notify/fanotify/fanotify_user.c+2−1

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

fs/proc/base.c+112−2

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

fs/pstore/platform.c+2−1

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

fs/reiserfs/inode.c+7−3

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

fs/reiserfs/stree.c+4−0

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

fs/reiserfs/super.c+46−14

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

fs/sysfs/dir.c+8−8

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

fs/ubifs/find.c+10−2

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

fs/ubifs/lprops.c+6−0

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

fs/ubifs/ubifs.h+3−0

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

fs/xfs/xfs_alloc.c+2−41

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

fs/xfs/xfs_alloc.h+0−3

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

fs/xfs/xfs_alloc_btree.c+2−0

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

fs/xfs/xfs_aops.c+39−15

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

fs/xfs/xfs_attr_leaf.c+18−2

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

fs/xfs/xfs_bmap.c+54−9

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

fs/xfs/xfs_bmap.h+8−1

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

fs/xfs/xfs_buf.c+12−2

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

fs/xfs/xfs_buf_item.c+18−0

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

fs/xfs/xfs_fsops.c+19−2

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

fs/xfs/xfs_ialloc.c+1−0

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

fs/xfs/xfs_inode.c+2−1

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

fs/xfs/xfs_ioctl.c+1−1

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

fs/xfs/xfs_iomap.c+3−1

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

fs/xfs/xfs_log.c+16−3

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

fs/xfs/xfs_log_recover.c+1−1

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

include/drm/drm_pciids.h+4−0

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

include/linux/bug.h+1−0

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

include/linux/clk-provider.h+2−2

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

include/linux/dynamic_debug.h+1−1

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

include/linux/extcon.h+1−1

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

include/linux/fs.h+0−5

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

include/linux/gfp.h+4−4

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

include/linux/hashtable.h+192−0

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

include/linux/hw_breakpoint.h+1−30

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

include/linux/i2c-omap.h+1−0

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

include/linux/iio/iio.h+16−0

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

include/linux/kernel.h+7−0

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

include/linux/kvm_host.h+2−13

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

include/linux/memblock.h+1−0

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

include/linux/mempolicy.h+0−16

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

include/linux/mfd/max77693.h+13−0

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

include/linux/mm.h+0−4

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

include/linux/mmc/dw_mmc.h+3−3

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

include/linux/mmc/sdhci.h+1−0

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

include/linux/mmzone.h+1−1

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

include/linux/netdevice.h+3−0

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

include/linux/of_address.h+4−0

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

include/linux/percpu-rwsem.h+11−17

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

include/linux/platform_data/omap_ocp2scp.h+31−0

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

include/linux/ptp_clock_kernel.h+2−1

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

include/linux/raid/Kbuild+0−2

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

include/linux/raid/md_u.h+1−140

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

include/linux/rbtree_augmented.h+1−0

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

include/linux/rio.h+2−0

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

include/linux/spi/ads7846.h+3−2

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

include/linux/spi/tsc2005.h+0−2

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

include/linux/tcp.h+2−1

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

include/media/adv7604.h+10−11

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

include/net/cfg80211.h+10−0

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

include/net/tcp.h+1−0

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

include/net/xfrm.h+1−1

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

include/scsi/scsi_device.h+4−0

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

include/sound/core.h+3−0

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

include/trace/events/xen.h+8−0

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

include/uapi/linux/Kbuild+1−0

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

include/uapi/linux/eventpoll.h+0−1

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

include/uapi/linux/hw_breakpoint.h+30−0

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

include/uapi/linux/oom.h+9−0

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

include/uapi/linux/raid/Kbuild+2−0

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

include/uapi/linux/raid/md_p.hrenamed from include/linux/raid/md_p.h+0−0

File renamed without changes.

include/uapi/linux/raid/md_u.h+155−0

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

include/uapi/linux/tcp.h+1−0

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

include/xen/hvm.h+32−2

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

init/main.c+2−0

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

kernel/Makefile+2−4

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

kernel/cgroup.c+10−31

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

kernel/events/hw_breakpoint.c+7−5

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

kernel/futex.c+39−20

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

kernel/modsign_pubkey.c+2−2

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

kernel/module.c+16−11

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

kernel/module_signing.c+7−7

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

kernel/pid_namespace.c+11−1

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

kernel/sched/auto_group.c+0−4

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

kernel/sched/auto_group.h+0−5

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

kernel/watchdog.c+5−2

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

kernel/workqueue.c+17−7

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

lib/Makefile+1−1

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

lib/asn1_decoder.c+1−1

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

lib/genalloc.c+1−1

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

lib/mpi/longlong.h+17−2

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

mm/bootmem.c+1−9

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

mm/compaction.c+9−1

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

mm/highmem.c+1−1

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

mm/memblock.c+24−0

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

mm/memcontrol.c+50−17

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

mm/memory-failure.c+8−0

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

mm/memory.c+4−6

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

mm/memory_hotplug.c+0−7

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

mm/mempolicy.c+0−22

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

mm/mmap.c+2−0

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

mm/mmu_notifier.c+13−13

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

mm/mmzone.c+1−5

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

mm/nobootmem.c+0−3

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

mm/page_alloc.c+33−50

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

mm/rmap.c+15−5

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

mm/shmem.c+31−13

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

mm/sparse.c+4−6

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

mm/swapfile.c+2−2

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

mm/vmscan.c+47−60

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

net/8021q/vlan.c+3−1

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

net/batman-adv/bridge_loop_avoidance.c+18−9

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

net/batman-adv/routing.c+7−1

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

net/batman-adv/soft-interface.c+6−6

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

net/batman-adv/translation-table.c+14−1

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

net/batman-adv/types.h+2−0

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

net/bluetooth/hci_core.c+2−2

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

net/bluetooth/mgmt.c+7−5

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

net/bluetooth/smp.c+5−3

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

net/can/bcm.c+3−0

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

net/ceph/messenger.c+4−2

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

net/core/dev.c+6−2

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

net/core/dev_addr_lists.c+2−1

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

net/core/net-sysfs.c+20−0

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

net/core/rtnetlink.c+2−1

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

net/core/skbuff.c+7−5

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

net/ipv4/icmp.c+2−1

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

net/ipv4/inet_diag.c+4−1

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

net/ipv4/ip_sockglue.c+22−13

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

net/ipv4/ip_vti.c+5−0

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

net/ipv4/ipmr.c+4−0

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

net/ipv4/netfilter/iptable_nat.c+3−1

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

net/ipv4/route.c+12−6

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

net/ipv4/tcp.c+13−16

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

net/ipv4/tcp_illinois.c+5−3

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

net/ipv4/tcp_input.c+29−8

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

net/ipv4/tcp_ipv4.c+1−0

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

net/ipv4/tcp_metrics.c+10−4

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

net/ipv4/tcp_minisocks.c+1−0

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

net/ipv4/tcp_output.c+14−5

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

net/ipv4/tcp_timer.c+2−2

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

net/ipv4/xfrm4_policy.c+1−12

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

net/ipv6/inet6_connection_sock.c+2−1

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

net/ipv6/ip6_gre.c+4−4

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

net/ipv6/ipv6_sockglue.c+1−0

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

net/ipv6/ndisc.c+1−2

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

net/ipv6/netfilter/ip6table_nat.c+3−1

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

net/ipv6/netfilter/nf_conntrack_reasm.c+2−2

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

net/ipv6/route.c+2−2

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

net/irda/irttp.c+1−0

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

net/l2tp/l2tp_eth.c+1−0

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

net/mac80211/cfg.c+3−0

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

net/mac80211/ibss.c+5−5

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

net/mac80211/ieee80211_i.h+2−0

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

net/mac80211/iface.c+1−1

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

net/mac80211/main.c+4−2

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

net/mac80211/mlme.c+23−12

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

net/mac80211/offchannel.c+0−2

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

net/mac80211/rx.c+56−18

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

net/mac80211/scan.c+1−1

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

net/mac80211/sta_info.c+10−5

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

net/mac80211/status.c+9−0

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

net/mac80211/tx.c+6−3

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

net/mac80211/util.c+39−9

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

net/mac80211/wpa.c+10−4

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

net/netfilter/ipset/ip_set_hash_ip.c+2−2

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

net/netfilter/ipset/ip_set_hash_ipport.c+3−4

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

net/netfilter/ipset/ip_set_hash_ipportip.c+3−4

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

net/netfilter/ipset/ip_set_hash_ipportnet.c+5−2

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

net/netfilter/ipset/ip_set_hash_netiface.c+1−1

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

net/netfilter/ipvs/ip_vs_ctl.c+2−1

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

net/netfilter/nf_conntrack_h323_main.c+2−1

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

net/netfilter/nfnetlink_cttimeout.c+2−1

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

net/netfilter/xt_CT.c+6−4

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

net/netfilter/xt_TEE.c+1−0

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

net/netfilter/xt_nat.c+4−4

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

net/netlink/af_netlink.c+15−4

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

net/nfc/llcp/llcp.c+1−1

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

net/openvswitch/flow.c+5−9

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

net/openvswitch/vport-netdev.c+1−1

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

net/sched/sch_qfq.c+79−30

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

net/sctp/chunk.c+14−6

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

net/sctp/proc.c+4−4

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

net/sctp/socket.c+3−3

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

net/sctp/transport.c+1−1

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

net/sunrpc/backchannel_rqst.c+1−1

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

net/sunrpc/xprtsock.c+10−31

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

net/tipc/handler.c+0−1

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

net/wireless/core.c+1−2

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

net/wireless/mlme.c+3−9

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

net/wireless/reg.c+5−5

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

net/wireless/util.c+8−6

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

scripts/Makefile.modinst+2−1

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

scripts/checkpatch.pl+4−2

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

scripts/headers_install.pl+3−0

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

scripts/kconfig/expr.h+2−3

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

scripts/kconfig/list.h+91−0

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

scripts/kconfig/lkc_proto.h+2−2

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

scripts/kconfig/mconf.c+3−3

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

scripts/kconfig/menu.c+8−6

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

scripts/sign-file+3−3

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

security/apparmor/policy.c+23−1

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

security/device_cgroup.c+72−29

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

security/selinux/netnode.c+2−1

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

sound/core/compress_offload.c+7−2

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

sound/core/control.c+5−0

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

sound/core/hwdep.c+11−1

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

sound/core/init.c+30−20

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

sound/core/oss/mixer_oss.c+9−2

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

sound/core/oss/pcm_oss.c+7−0

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

sound/core/pcm.c+11−2

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

sound/core/pcm_native.c+29−6

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

sound/core/rawmidi.c+25−1

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

sound/core/sound.c+9−2

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

sound/core/sound_oss.c+8−2

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

sound/i2c/other/ak4113.c+1−1

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

sound/i2c/other/ak4114.c+1−1

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

sound/i2c/other/ak4117.c+1−1

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

sound/isa/opti9xx/miro.c+0−1

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

sound/pci/als300.c+4−0

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

sound/pci/es1968.c+9−2

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

sound/pci/fm801.c+8−3

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

sound/pci/hda/hda_codec.c+11−2

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

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

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

sound/pci/hda/hda_intel.c+22−19

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

sound/pci/hda/patch_analog.c+1−0

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

sound/pci/hda/patch_cirrus.c+13−9

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

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

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

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

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

sound/pci/hda/patch_via.c+29−7

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

sound/pci/ice1712/ice1724.c+6−1

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

sound/pci/rme9652/hdspm.c+142−97

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

sound/soc/codecs/arizona.c+2−2

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

sound/soc/codecs/cs4271.c+3−8

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

sound/soc/codecs/cs42l52.c+2−3

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

sound/soc/codecs/wm5102.c+551−1

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

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

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

sound/soc/codecs/wm8994.c+18−2

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

sound/soc/codecs/wm8994.h+1−0

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

sound/soc/kirkwood/kirkwood-dma.c+1−2

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

sound/soc/kirkwood/kirkwood-i2s.c+37−37

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

sound/soc/mxs/mxs-saif.c+13−4

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

sound/soc/omap/omap-dmic.c+2−2

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

sound/soc/omap/zoom2.c+2−3

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

sound/soc/samsung/Kconfig+2−0

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

sound/soc/samsung/bells.c+1−1

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

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

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

sound/soc/soc-dapm.c+1−1

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

sound/soc/ux500/mop500.c+17−0

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

sound/soc/ux500/ux500_msp_i2s.c+3−5

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

sound/usb/card.c+9−5

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

sound/usb/card.h+1−0

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

sound/usb/endpoint.c+13−0

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

sound/usb/endpoint.h+1−0

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

sound/usb/midi.c+6−2

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

sound/usb/mixer.c+43−22

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

sound/usb/mixer_quirks.c+51−7

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

sound/usb/pcm.c+38−20

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

sound/usb/proc.c+2−2

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

sound/usb/stream.c+1−0

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

sound/usb/usbaudio.h+1−1

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

tools/perf/Makefile+29−1

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

tools/perf/arch/x86/include/perf_regs.h+1−1

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

tools/perf/builtin-kvm.c+67−54

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

tools/perf/perf.h+3−12

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

tools/perf/tests/parse-events.c+1−1

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

tools/perf/util/evsel.c+2−2

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

tools/perf/util/evsel.h+1−1

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

tools/perf/util/header.c+2−0

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

tools/perf/util/header.h+1−1

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

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

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

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

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

tools/perf/util/pmu.h+1−1

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

tools/perf/util/session.h+1−1

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

tools/perf/util/strbuf.c+4−4

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

tools/power/x86/turbostat/turbostat.c+19−9

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

tools/testing/ktest/ktest.pl+4−2

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

tools/testing/selftests/Makefile+1−1

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

tools/testing/selftests/epoll/Makefile+0−11

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

tools/testing/selftests/epoll/test_epoll.c+0−344

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

tools/vm/page-types.c+1−1

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

usr/gen_init_cpio.c+23−20

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