History

Merge tag 'v4.8-rc8' into drm-next

Linux 4.8-rc8 There was a lot of fallout in the imx/amdgpu/i915 drivers, so backmerge it now to avoid troubles. * tag 'v4.8-rc8': (1442 commits) Linux 4.8-rc8 fault_in_multipages_readable() throws set-but-unused error mm: check VMA flags to avoid invalid PROT_NONE NUMA balancing radix tree: fix sibling entry handling in radix_tree_descend() radix tree test suite: Test radix_tree_replace_slot() for multiorder entries fix memory leaks in tracing_buffers_splice_read() tracing: Move mutex to protect against resetting of seq data MIPS: Fix delay slot emulation count in debugfs MIPS: SMP: Fix possibility of deadlock when bringing CPUs online mm: delete unnecessary and unsafe init_tlb_ubc() huge tmpfs: fix Committed_AS leak shmem: fix tmpfs to handle the huge= option properly blk-mq: skip unmapped queues in blk_mq_alloc_request_hctx MIPS: Fix pre-r6 emulation FPU initialisation arm64: kgdb: handle read-only text / modules arm64: Call numa_store_cpu_info() earlier. locking/hung_task: Fix typo in CONFIG_DETECT_HUNG_TASK help text nvme-rdma: only clear queue flags after successful connect i2c: qup: skip qup_i2c_suspend if the device is already runtime suspended perf/core: Limit matching exclusive events to one PMU ...

Dave Airlie committed 10 years ago

Commit ca09fb92 parents 9f4ef05 08895a81280 files · +13509 −7754Browse files

Unified · Split

1280 files
  1. .mailmap +3 −0
  2. Documentation/ABI/stable/sysfs-devices +1 −1
  3. Documentation/PCI/MSI-HOWTO.txt +10 −14
  4. Documentation/PCI/pci.txt +0 −1
  5. Documentation/arm/CCN.txt +10 −6
  6. Documentation/arm64/silicon-errata.txt +1 −0
  7. Documentation/conf.py +1 −1
  8. Documentation/cpu-freq/cpufreq-stats.txt +1 −1
  9. Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt +7 −0
  10. Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt +1 −0
  11. Documentation/devicetree/bindings/mmc/sdhci-st.txt +1 −1
  12. Documentation/devicetree/bindings/serial/8250.txt +0 −19
  13. Documentation/devicetree/bindings/sound/omap-mcpdm.txt +0 −10
  14. Documentation/devicetree/bindings/thermal/thermal.txt +5 −5
  15. Documentation/filesystems/overlayfs.txt +3 −5
  16. Documentation/hwmon/ftsteutates +2 −2
  17. Documentation/i2c/slave-interface +5 −0
  18. Documentation/kernel-documentation.rst +0 −6
  19. Documentation/kernel-parameters.txt +4 −0
  20. Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst +20 −1
  21. Documentation/media/uapi/cec/cec-ioc-dqevent.rst +6 −2
  22. Documentation/networking/dsa/dsa.txt +0 −20
  23. Documentation/networking/rxrpc.txt +11 −10
  24. Documentation/power/basic-pm-debugging.txt +26 −1
  25. Documentation/power/interface.txt +76 −75
  26. Documentation/powerpc/transactional_memory.txt +2 −0
  27. Documentation/rapidio/mport_cdev.txt +4 −0
  28. Documentation/sphinx-static/theme_overrides.css +2 −1
  29. MAINTAINERS +56 −20
  30. Makefile +1 −1
  31. arch/Kconfig +0 −11
  32. arch/alpha/include/asm/uaccess.h +8 −11
  33. arch/arc/include/asm/entry.h +2 −2
  34. arch/arc/include/asm/irqflags-compact.h +1 −1
  35. arch/arc/include/asm/pgtable.h +1 −1
  36. arch/arc/include/asm/uaccess.h +9 −2
  37. arch/arc/include/uapi/asm/elf.h +9 −2
  38. arch/arc/kernel/arcksyms.c +2 −0
  39. arch/arc/kernel/process.c +1 −1
  40. arch/arc/kernel/setup.c +4 −2
  41. arch/arc/mm/cache.c +9 −0
  42. arch/arc/mm/highmem.c +1 −0
  43. arch/arm/boot/dts/am335x-baltos.dtsi +1 −1
  44. arch/arm/boot/dts/am335x-igep0033.dtsi +1 −1
  45. arch/arm/boot/dts/am335x-phycore-som.dtsi +1 −1
  46. arch/arm/boot/dts/armada-388-clearfog.dts +4 −4
  47. arch/arm/boot/dts/bcm2835-rpi.dtsi +1 −0
  48. arch/arm/boot/dts/bcm283x.dtsi +2 −1
  49. arch/arm/boot/dts/exynos5410-odroidxu.dts +0 −3
  50. arch/arm/boot/dts/imx6qdl.dtsi +1 −1
  51. arch/arm/boot/dts/imx6sx-sabreauto.dts +1 −1
  52. arch/arm/boot/dts/imx7d-sdb.dts +1 −1
  53. arch/arm/boot/dts/kirkwood-ib62x0.dts +1 −1
  54. arch/arm/boot/dts/kirkwood-openrd.dtsi +4 −0
  55. arch/arm/boot/dts/logicpd-som-lv.dtsi +6 −5
  56. arch/arm/boot/dts/logicpd-torpedo-som.dtsi +1 −0
  57. arch/arm/boot/dts/omap3-overo-base.dtsi +3 −1
  58. arch/arm/boot/dts/omap3-overo-chestnut43-common.dtsi +0 −2
  59. arch/arm/boot/dts/omap3-overo-tobi-common.dtsi +0 −2
  60. arch/arm/boot/dts/omap3-overo-tobiduo-common.dtsi +0 −3
  61. arch/arm/boot/dts/rk3066a.dtsi +2 −0
  62. arch/arm/boot/dts/rk3288.dtsi +2 −0
  63. arch/arm/boot/dts/rk3xxx.dtsi +2 −0
  64. arch/arm/boot/dts/stih407-family.dtsi +6 −4
  65. arch/arm/boot/dts/stih410.dtsi +8 −4
  66. arch/arm/boot/dts/sun5i-a13.dtsi +1 −1
  67. arch/arm/boot/dts/tegra114-dalmore.dts +1 −1
  68. arch/arm/boot/dts/tegra114-roth.dts +1 −1
  69. arch/arm/boot/dts/tegra114-tn7.dts +1 −1
  70. arch/arm/boot/dts/tegra124-jetson-tk1.dts +2 −2
  71. arch/arm/common/locomo.c +2 −3
  72. arch/arm/common/sa1111.c +19 −13
  73. arch/arm/configs/keystone_defconfig +1 −0
  74. arch/arm/configs/multi_v7_defconfig +1 −1
  75. arch/arm/crypto/aes-ce-glue.c +1 −1
  76. arch/arm/include/asm/pgtable-2level-hwdef.h +1 −0
  77. arch/arm/include/asm/pgtable-3level-hwdef.h +1 −0
  78. arch/arm/kernel/entry-armv.S +1 −0
  79. arch/arm/kernel/hyp-stub.S +13 −0
  80. arch/arm/kvm/arm.c +0 −2
  81. arch/arm/kvm/mmu.c +4 −2
  82. arch/arm/mach-exynos/suspend.c +6 −0
  83. arch/arm/mach-imx/gpc.c +6 −0
  84. arch/arm/mach-imx/mach-imx6ul.c +1 −0
  85. arch/arm/mach-imx/pm-imx6.c +2 −2
  86. arch/arm/mach-omap2/cm33xx.c +0 −6
  87. arch/arm/mach-omap2/cminst44xx.c +0 −6
  88. arch/arm/mach-omap2/omap_hwmod.c +8 −0
  89. arch/arm/mach-omap2/omap_hwmod.h +4 −0
  90. arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c +2 −0
  91. arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +12 −0
  92. arch/arm/mach-pxa/idp.c +2 −1
  93. arch/arm/mach-pxa/lubbock.c +14 −0
  94. arch/arm/mach-pxa/xcep.c +2 −1
  95. arch/arm/mach-realview/core.c +2 −1
  96. arch/arm/mach-sa1100/clock.c +3 −2
  97. arch/arm/mach-sa1100/generic.c +4 −0
  98. arch/arm/mach-sa1100/generic.h +2 −0
  99. arch/arm/mach-sa1100/pleb.c +1 −1
  100. arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c +26 −36
  101. arch/arm/mm/mmu.c +17 −6
  102. arch/arm/mm/proc-v7.S +1 −0
  103. arch/arm/xen/enlighten.c +4 −5
  104. arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +4 −4
  105. arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +4 −4
  106. arch/arm64/boot/dts/apm/apm-storm.dtsi +4 −4
  107. arch/arm64/boot/dts/broadcom/bcm2835-rpi.dtsi +1 −0
  108. arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts +2 −2
  109. arch/arm64/boot/dts/broadcom/bcm2837.dtsi +1 −1
  110. arch/arm64/boot/dts/broadcom/bcm283x-rpi-smsc9514.dtsi +1 −0
  111. arch/arm64/boot/dts/broadcom/bcm283x.dtsi +1 −0
  112. arch/arm64/boot/dts/broadcom/ns2.dtsi +4 −4
  113. arch/arm64/boot/dts/cavium/thunder-88xx.dtsi +4 −4
  114. arch/arm64/boot/dts/exynos/exynos7.dtsi +4 −4
  115. arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi +4 −4
  116. arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi +4 −4
  117. arch/arm64/boot/dts/marvell/armada-ap806.dtsi +4 −4
  118. arch/arm64/boot/dts/rockchip/rk3368.dtsi +2 −0
  119. arch/arm64/boot/dts/socionext/uniphier-ph1-ld20.dtsi +4 −4
  120. arch/arm64/boot/dts/xilinx/zynqmp.dtsi +4 −4
  121. arch/arm64/crypto/aes-glue.c +1 −1
  122. arch/arm64/include/asm/debug-monitors.h +0 −2
  123. arch/arm64/include/asm/percpu.h +4 −4
  124. arch/arm64/include/asm/spinlock.h +10 −0
  125. arch/arm64/kernel/head.S +3 −0
  126. arch/arm64/kernel/kgdb.c +24 −12
  127. arch/arm64/kernel/sleep.S +9 −1
  128. arch/arm64/kernel/smp.c +6 −8
  129. arch/arm64/kvm/hyp/switch.c +1 −1
  130. arch/arm64/kvm/sys_regs.c +1 −9
  131. arch/arm64/mm/dump.c +3 −3
  132. arch/arm64/mm/numa.c +2 −0
  133. arch/arm64/mm/proc.S +9 −0
  134. arch/avr32/include/asm/uaccess.h +10 −1
  135. arch/avr32/kernel/avr32_ksyms.c +1 −1
  136. arch/avr32/lib/copy_user.S +4 −4
  137. arch/blackfin/include/asm/uaccess.h +5 −4
  138. arch/blackfin/mach-bf561/boards/cm_bf561.c +2 −1
  139. arch/blackfin/mach-bf561/boards/ezkit.c +2 −1
  140. arch/cris/include/asm/uaccess.h +32 −39
  141. arch/frv/include/asm/uaccess.h +9 −3
  142. arch/hexagon/include/asm/uaccess.h +2 −1
  143. arch/ia64/include/asm/uaccess.h +13 −20
  144. arch/m32r/include/asm/uaccess.h +1 −1
  145. arch/metag/include/asm/uaccess.h +2 −1
  146. arch/microblaze/include/asm/uaccess.h +7 −4
  147. arch/mips/Kconfig +1 −0
  148. arch/mips/Kconfig.debug +0 −36
  149. arch/mips/Makefile +0 −4
  150. arch/mips/ath79/clock.c +1 −1
  151. arch/mips/cavium-octeon/octeon-platform.c +1 −1
  152. arch/mips/include/asm/asmmacro.h +1 −0
  153. arch/mips/include/asm/mach-cavium-octeon/mangle-port.h +2 −2
  154. arch/mips/include/asm/mach-paravirt/kernel-entry-init.h +2 −0
  155. arch/mips/include/asm/page.h +2 −2
  156. arch/mips/include/asm/uaccess.h +3 −0
  157. arch/mips/kernel/mips-r2-to-r6-emul.c +2 −0
  158. arch/mips/kernel/process.c +4 −4
  159. arch/mips/kernel/setup.c +7 −0
  160. arch/mips/kernel/smp.c +3 −4
  161. arch/mips/kernel/uprobes.c +1 −1
  162. arch/mips/kernel/vdso.c +4 −4
  163. arch/mips/kvm/mmu.c +1 −1
  164. arch/mips/math-emu/dsemul.c +1 −0
  165. arch/mips/mm/c-r4k.c +1 −1
  166. arch/mips/mm/init.c +6 −7
  167. arch/mn10300/include/asm/uaccess.h +1 −0
  168. arch/mn10300/lib/usercopy.c +3 −1
  169. arch/nios2/include/asm/uaccess.h +8 −5
  170. arch/openrisc/include/asm/uaccess.h +11 −24
  171. arch/parisc/Kconfig +0 −1
  172. arch/parisc/configs/c8000_defconfig +0 −1
  173. arch/parisc/configs/generic-64bit_defconfig +0 −1
  174. arch/parisc/include/asm/uaccess.h +16 −11
  175. arch/parisc/include/uapi/asm/errno.h +2 −2
  176. arch/parisc/kernel/processor.c +0 −8
  177. arch/parisc/kernel/time.c +0 −12
  178. arch/powerpc/include/asm/cpu_has_feature.h +1 −1
  179. arch/powerpc/include/asm/cputhreads.h +1 −0
  180. arch/powerpc/include/asm/hmi.h +1 −1
  181. arch/powerpc/include/asm/paca.h +7 −5
  182. arch/powerpc/include/asm/pci-bridge.h +1 −0
  183. arch/powerpc/include/asm/uaccess.h +7 −31
  184. arch/powerpc/kernel/Makefile +1 −1
  185. arch/powerpc/kernel/entry_64.S +6 −6
  186. arch/powerpc/kernel/exceptions-64s.S +24 −5
  187. arch/powerpc/kernel/idle_book3s.S +5 −5
  188. arch/powerpc/kernel/kprobes.c +1 −1
  189. arch/powerpc/kernel/pci-common.c +36 −0
  190. arch/powerpc/kernel/prom_init.c +6 −3
  191. arch/powerpc/kernel/signal_32.c +14 −0
  192. arch/powerpc/kernel/signal_64.c +14 −0
  193. arch/powerpc/kernel/smp.c +1 −1
  194. arch/powerpc/kernel/traps.c +2 −1
  195. arch/powerpc/kvm/Makefile +1 −0
  196. arch/powerpc/kvm/book3s_hv_hmi.c +0 −0
  197. arch/powerpc/lib/checksum_32.S +4 −3
  198. arch/powerpc/mm/fault.c +1 −1
  199. arch/powerpc/mm/slb_low.S +6 −1
  200. arch/powerpc/platforms/512x/mpc512x_lpbfifo.c +0 −1
  201. arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c +0 −1
  202. arch/powerpc/platforms/embedded6xx/holly.c +1 −1
  203. arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c +1 −1
  204. arch/powerpc/platforms/powernv/opal-dump.c +6 −1
  205. arch/powerpc/platforms/powernv/opal-elog.c +6 −1
  206. arch/powerpc/platforms/powernv/pci-ioda.c +44 −13
  207. arch/powerpc/platforms/pseries/pci.c +4 −0
  208. arch/powerpc/platforms/pseries/pci_dlpar.c +5 −2
  209. arch/powerpc/platforms/pseries/setup.c +1 −1
  210. arch/powerpc/sysdev/cpm1.c +4 −2
  211. arch/powerpc/sysdev/cpm_common.c +2 −1
  212. arch/powerpc/sysdev/fsl_rio.c +1 −1
  213. arch/powerpc/sysdev/xics/icp-opal.c +7 −5
  214. arch/s390/Kconfig +0 −1
  215. arch/s390/boot/compressed/head.S +8 −3
  216. arch/s390/configs/default_defconfig +1 −2
  217. arch/s390/configs/gcov_defconfig +1 −2
  218. arch/s390/configs/performance_defconfig +1 −2
  219. arch/s390/crypto/crc32-vx.c +3 −3
  220. arch/s390/defconfig +1 −2
  221. arch/s390/include/asm/uaccess.h +16 −11
  222. arch/s390/kernel/head.S +3 −1
  223. arch/s390/kernel/setup.c +2 −4
  224. arch/s390/kvm/kvm-s390.c +6 −4
  225. arch/s390/kvm/vsie.c +1 −1
  226. arch/s390/lib/string.c +7 −9
  227. arch/s390/mm/pageattr.c +2 −0
  228. arch/score/include/asm/uaccess.h +24 −22
  229. arch/sh/include/asm/atomic-llsc.h +1 −1
  230. arch/sh/include/asm/uaccess.h +4 −1
  231. arch/sh/include/asm/uaccess_64.h +1 −0
  232. arch/sparc/include/asm/uaccess_32.h +6 −7
  233. arch/sparc/include/asm/uaccess_64.h +3 −4
  234. arch/tile/Kconfig +0 −1
  235. arch/tile/include/asm/uaccess.h +10 −12
  236. arch/um/include/asm/common.lds.S +1 −1
  237. arch/um/kernel/skas/syscall.c +3 −7
  238. arch/x86/Kconfig +0 −1
  239. arch/x86/boot/compressed/eboot.c +69 −65
  240. arch/x86/configs/tiny.config +2 −0
  241. arch/x86/crypto/sha256-mb/sha256_mb.c +2 −2
  242. arch/x86/crypto/sha256-mb/sha256_mb_mgr_flush_avx2.S +4 −3
  243. arch/x86/crypto/sha512-mb/sha512_mb.c +2 −2
  244. arch/x86/events/amd/core.c +2 −2
  245. arch/x86/events/amd/uncore.c +18 −4
  246. arch/x86/events/intel/bts.c +96 −30
  247. arch/x86/events/intel/core.c +8 −7
  248. arch/x86/events/intel/cqm.c +9 −0
  249. arch/x86/events/intel/ds.c +11 −8
  250. arch/x86/events/intel/pt.c +14 −4
  251. arch/x86/include/asm/uaccess.h +16 −63
  252. arch/x86/kernel/apic/apic.c +6 −1
  253. arch/x86/kernel/cpu/amd.c +12 −0
  254. arch/x86/kernel/cpu/microcode/amd.c +16 −2
  255. arch/x86/kernel/kvmclock.c +1 −0
  256. arch/x86/kernel/paravirt.c +2 −2
  257. arch/x86/kernel/smpboot.c +16 −9
  258. arch/x86/kvm/ioapic.c +5 −3
  259. arch/x86/kvm/pmu_amd.c +2 −2
  260. arch/x86/kvm/vmx.c +69 −67
  261. arch/x86/kvm/x86.c +4 −4
  262. arch/x86/mm/kaslr.c +1 −1
  263. arch/x86/mm/pageattr.c +11 −10
  264. arch/x86/mm/pat.c +10 −7
  265. arch/x86/pci/fixup.c +13 −7
  266. arch/x86/pci/vmd.c +8 −2
  267. arch/x86/platform/efi/efi_64.c +1 −1
  268. arch/x86/power/hibernate_64.c +1 −1
  269. arch/x86/um/ptrace_32.c +3 −0
  270. arch/x86/um/ptrace_64.c +4 −0
  271. arch/x86/xen/enlighten.c +1 −1
  272. block/bio.c +11 −10
  273. block/blk-core.c +3 −1
  274. block/blk-merge.c +41 −14
  275. block/blk-mq.c +33 −43
  276. block/blk-throttle.c +4 −2
  277. block/elevator.c +1 −1
  278. crypto/Kconfig +1 −1
  279. crypto/blkcipher.c +2 −1
  280. crypto/cryptd.c +9 −3
  281. crypto/echainiv.c +24 −91
  282. crypto/rsa-pkcs1pad.c +24 −17
  283. crypto/sha3_generic.c +8 −8
  284. drivers/acpi/nfit/mce.c +1 −1
  285. drivers/acpi/scan.c +3 −3
  286. drivers/ata/libahci.c +1 −1
  287. drivers/ata/pata_ninja32.c +1 −1
  288. drivers/base/power/runtime.c +7 −7
  289. drivers/base/regmap/regcache-rbtree.c +28 −10
  290. drivers/base/regmap/regcache.c +3 −2
  291. drivers/base/regmap/regmap.c +6 −0
  292. drivers/block/floppy.c +13 −14
  293. drivers/block/xen-blkfront.c +56 −41
  294. drivers/bus/arm-cci.c +1 −1
  295. drivers/bus/arm-ccn.c +79 −33
  296. drivers/bus/vexpress-config.c +1 −0
  297. drivers/char/hw_random/Kconfig +1 −1
  298. drivers/char/tpm/tpm2-cmd.c +1 −2
  299. drivers/char/virtio_console.c +15 −8
  300. drivers/clk/renesas/r8a7795-cpg-mssr.c +5 −4
  301. drivers/clk/rockchip/clk-rk3399.c +6 −5
  302. drivers/clk/sunxi-ng/ccu-sun8i-h3.c +8 −8
  303. drivers/clk/sunxi-ng/ccu_common.c +1 −1
  304. drivers/clk/sunxi-ng/ccu_nk.c +3 −3
  305. drivers/clk/sunxi/clk-a10-pll2.c +2 −2
  306. drivers/clk/sunxi/clk-sun8i-mbus.c +1 −1
  307. drivers/clk/tegra/clk-tegra114.c +2 −2
  308. drivers/clocksource/bcm_kona_timer.c +10 −6
  309. drivers/clocksource/mips-gic-timer.c +1 −1
  310. drivers/clocksource/pxa_timer.c +2 −0
  311. drivers/clocksource/sun4i_timer.c +8 −1
  312. drivers/clocksource/time-armada-370-xp.c +0 −1
  313. drivers/clocksource/time-pistachio.c +4 −4
  314. drivers/clocksource/timer-atmel-pit.c +7 −0
  315. drivers/cpufreq/cpufreq-dt-platdev.c +2 −0
  316. drivers/crypto/caam/caamalg.c +45 −45
  317. drivers/crypto/caam/caamhash.c +1 −0
  318. drivers/crypto/qat/qat_common/qat_algs.c +2 −2
  319. drivers/crypto/vmx/aes_xts.c +1 −1
  320. drivers/dax/dax.c +1 −1
  321. drivers/dax/pmem.c +3 −0
  322. drivers/dma/at_xdmac.c +2 −2
  323. drivers/dma/fsl_raid.c +1 −0
  324. drivers/dma/img-mdc-dma.c +1 −3
  325. drivers/dma/pxa_dma.c +7 −4
  326. drivers/dma/sh/usb-dmac.c +11 −8
  327. drivers/edac/Kconfig +8 −0
  328. drivers/edac/Makefile +1 −0
  329. drivers/edac/sb_edac.c +11 −4
  330. drivers/edac/skx_edac.c +1121 −0
  331. drivers/firmware/arm_scpi.c +3 −2
  332. drivers/firmware/dmi-id.c +4 −4
  333. drivers/firmware/efi/efi.c +5 −2
  334. drivers/firmware/efi/libstub/efi-stub-helper.c +139 −30
  335. drivers/firmware/efi/libstub/fdt.c +39 −15
  336. drivers/firmware/efi/libstub/random.c +10 −2
  337. drivers/gpio/Kconfig +7 −5
  338. drivers/gpio/gpio-max730x.c +4 −4
  339. drivers/gpio/gpio-mcp23s08.c +1 −1
  340. drivers/gpio/gpio-sa1100.c +1 −1
  341. drivers/gpio/gpiolib-of.c +0 −1
  342. drivers/gpu/drm/amd/amdgpu/amdgpu.h +2 −3
  343. drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +13 −0
  344. drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +0 −9
  345. drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +2 −2
  346. drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +3 −2
  347. drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 −2
  348. drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +2 −1
  349. drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +4 −1
  350. drivers/gpu/drm/amd/amdgpu/cik_sdma.c +3 −0
  351. drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +9 −3
  352. drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c +1 −1
  353. drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c +1 −1
  354. drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +1 −1
  355. drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +1 −1
  356. drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +5 −5
  357. drivers/gpu/drm/drm_atomic.c +3 −3
  358. drivers/gpu/drm/drm_fb_helper.c +1 −1
  359. drivers/gpu/drm/exynos/exynos_drm_fb.c +3 −3
  360. drivers/gpu/drm/exynos/exynos_drm_fimc.c +2 −27
  361. drivers/gpu/drm/exynos/exynos_drm_g2d.c +7 −22
  362. drivers/gpu/drm/exynos/exynos_drm_gsc.c +4 −31
  363. drivers/gpu/drm/exynos/exynos_drm_rotator.c +2 −24
  364. drivers/gpu/drm/i915/i915_gem.c +3 −0
  365. drivers/gpu/drm/i915/intel_display.c +2 −0
  366. drivers/gpu/drm/imx/ipuv3-crtc.c +4 −0
  367. drivers/gpu/drm/mediatek/Kconfig +3 −0
  368. drivers/gpu/drm/msm/msm_drv.h +6 −0
  369. drivers/gpu/drm/msm/msm_gem.c +9 −0
  370. drivers/gpu/drm/msm/msm_gem_submit.c +24 −5
  371. drivers/gpu/drm/nouveau/nouveau_acpi.c +11 −0
  372. drivers/gpu/drm/radeon/atombios_crtc.c +3 −1
  373. drivers/gpu/drm/radeon/radeon_atpx_handler.c +0 −9
  374. drivers/gpu/drm/radeon/radeon_ttm.c +2 −2
  375. drivers/gpu/drm/tegra/dsi.c +36 −7
  376. drivers/gpu/drm/vc4/vc4_bo.c +1 −1
  377. drivers/gpu/drm/vc4/vc4_drv.c +3 −3
  378. drivers/gpu/drm/vc4/vc4_drv.h +9 −0
  379. drivers/gpu/drm/vc4/vc4_gem.c +9 −9
  380. drivers/gpu/drm/vc4/vc4_irq.c +3 −1
  381. drivers/gpu/drm/vc4/vc4_validate_shaders.c +8 −2
  382. drivers/gpu/host1x/mipi.c +31 −32
  383. drivers/hwmon/it87.c +2 −1
  384. drivers/i2c/busses/i2c-at91.c +14 −10
  385. drivers/i2c/busses/i2c-bcm-iproc.c +1 −1
  386. drivers/i2c/busses/i2c-bcm-kona.c +2 −2
  387. drivers/i2c/busses/i2c-brcmstb.c +1 −1
  388. drivers/i2c/busses/i2c-cadence.c +1 −1
  389. drivers/i2c/busses/i2c-cros-ec-tunnel.c +1 −1
  390. drivers/i2c/busses/i2c-designware-core.c +10 −6
  391. drivers/i2c/busses/i2c-eg20t.c +11 −7
  392. drivers/i2c/busses/i2c-meson.c +3 −3
  393. drivers/i2c/busses/i2c-ocores.c +10 −4
  394. drivers/i2c/busses/i2c-qup.c +2 −1
  395. drivers/i2c/busses/i2c-rcar.c +1 −1
  396. drivers/i2c/busses/i2c-rk3x.c +13 −1
  397. drivers/i2c/busses/i2c-sh_mobile.c +1 −1
  398. drivers/i2c/muxes/i2c-demux-pinctrl.c +14 −5
  399. drivers/i2c/muxes/i2c-mux-pca954x.c +1 −1
  400. drivers/iio/accel/Kconfig +4 −1
  401. drivers/iio/accel/bma220_spi.c +1 −1
  402. drivers/iio/accel/bmc150-accel-core.c +11 −0
  403. drivers/iio/accel/kxsd9.c +2 −0
  404. drivers/iio/adc/Kconfig +1 −0
  405. drivers/iio/adc/ad799x.c +1 −0
  406. drivers/iio/adc/at91_adc.c +2 −2
  407. drivers/iio/adc/rockchip_saradc.c +30 −0
  408. drivers/iio/adc/ti-ads1015.c +2 −1
  409. drivers/iio/adc/ti_am335x_adc.c +12 −4
  410. drivers/iio/chemical/atlas-ph-sensor.c +1 −1
  411. drivers/iio/common/hid-sensors/hid-sensor-attributes.c +2 −2
  412. drivers/iio/dac/stx104.c +29 −9
  413. drivers/iio/humidity/Kconfig +2 −0
  414. drivers/iio/humidity/am2315.c +1 −1
  415. drivers/iio/humidity/hdc100x.c +7 −20
  416. drivers/iio/industrialio-buffer.c +19 −8
  417. drivers/iio/industrialio-core.c +2 −3
  418. drivers/iio/light/Kconfig +2 −1
  419. drivers/iio/pressure/bmp280-core.c +5 −3
  420. drivers/iio/proximity/as3935.c +1 −1
  421. drivers/infiniband/core/cma.c +12 −6
  422. drivers/infiniband/core/multicast.c +2 −11
  423. drivers/infiniband/hw/cxgb4/cm.c +10 −2
  424. drivers/infiniband/hw/cxgb4/cq.c +5 −5
  425. drivers/infiniband/hw/cxgb4/device.c +5 −0
  426. drivers/infiniband/hw/cxgb4/iw_cxgb4.h +1 −0
  427. drivers/infiniband/hw/cxgb4/qp.c +1 −1
  428. drivers/infiniband/hw/cxgb4/t4.h +5 −0
  429. drivers/infiniband/hw/hfi1/affinity.c +13 −8
  430. drivers/infiniband/hw/hfi1/chip.c +81 −11
  431. drivers/infiniband/hw/hfi1/chip.h +1 −0
  432. drivers/infiniband/hw/hfi1/debugfs.c +61 −85
  433. drivers/infiniband/hw/hfi1/driver.c +6 −5
  434. drivers/infiniband/hw/hfi1/file_ops.c +3 −1
  435. drivers/infiniband/hw/hfi1/hfi.h +21 −3
  436. drivers/infiniband/hw/hfi1/init.c +3 −2
  437. drivers/infiniband/hw/hfi1/mad.c +12 −14
  438. drivers/infiniband/hw/hfi1/pio_copy.c +12 −0
  439. drivers/infiniband/hw/hfi1/qp.c +0 −4
  440. drivers/infiniband/hw/hfi1/qsfp.c +30 −2
  441. drivers/infiniband/hw/hfi1/qsfp.h +3 −0
  442. drivers/infiniband/hw/hfi1/user_sdma.c +4 −1
  443. drivers/infiniband/hw/i40iw/i40iw.h +2 −2
  444. drivers/infiniband/hw/i40iw/i40iw_cm.c +3 −23
  445. drivers/infiniband/hw/i40iw/i40iw_hw.c +1 −0
  446. drivers/infiniband/hw/i40iw/i40iw_main.c +7 −5
  447. drivers/infiniband/hw/i40iw/i40iw_utils.c +4 −1
  448. drivers/infiniband/hw/i40iw/i40iw_verbs.c +1 −3
  449. drivers/infiniband/hw/mlx4/cq.c +9 −31
  450. drivers/infiniband/hw/mlx4/mad.c +23 −0
  451. drivers/infiniband/hw/mlx4/main.c +3 −0
  452. drivers/infiniband/hw/mlx4/mcg.c +7 −7
  453. drivers/infiniband/hw/mlx4/mlx4_ib.h +1 −1
  454. drivers/infiniband/hw/mlx4/qp.c +20 −17
  455. drivers/infiniband/hw/mlx5/cq.c +2 −20
  456. drivers/infiniband/hw/mlx5/main.c +15 −3
  457. drivers/infiniband/hw/mlx5/mem.c +3 −3
  458. drivers/infiniband/hw/mlx5/mlx5_ib.h +1 −0
  459. drivers/infiniband/hw/mlx5/qp.c +5 −8
  460. drivers/infiniband/hw/ocrdma/ocrdma_hw.c +7 −7
  461. drivers/infiniband/hw/ocrdma/ocrdma_sli.h +8 −4
  462. drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +2 −2
  463. drivers/infiniband/hw/qib/qib_debugfs.c +9 −3
  464. drivers/infiniband/hw/qib/qib_fs.c +5 −21
  465. drivers/infiniband/hw/qib/qib_qp.c +0 −4
  466. drivers/infiniband/hw/usnic/usnic_ib_main.c +2 −1
  467. drivers/infiniband/sw/rdmavt/mr.c +1 −1
  468. drivers/infiniband/sw/rdmavt/qp.c +2 −1
  469. drivers/infiniband/sw/rxe/rxe.c +22 −3
  470. drivers/infiniband/sw/rxe/rxe_comp.c +13 −0
  471. drivers/infiniband/sw/rxe/rxe_net.c +25 −30
  472. drivers/infiniband/sw/rxe/rxe_net.h +4 −1
  473. drivers/infiniband/sw/rxe/rxe_recv.c +1 −1
  474. drivers/infiniband/sw/rxe/rxe_req.c +44 −13
  475. drivers/infiniband/sw/rxe/rxe_resp.c +6 −5
  476. drivers/infiniband/ulp/ipoib/ipoib.h +1 −0
  477. drivers/infiniband/ulp/ipoib/ipoib_cm.c +16 −0
  478. drivers/infiniband/ulp/ipoib/ipoib_ib.c +9 −0
  479. drivers/infiniband/ulp/ipoib/ipoib_main.c +1 −1
  480. drivers/infiniband/ulp/isert/ib_isert.c +21 −4
  481. drivers/infiniband/ulp/isert/ib_isert.h +2 −0
  482. drivers/infiniband/ulp/srpt/ib_srpt.c +5 −4
  483. drivers/input/keyboard/tegra-kbc.c +1 −1
  484. drivers/input/rmi4/rmi_driver.c +2 −1
  485. drivers/input/serio/i8042.c +1 −0
  486. drivers/input/touchscreen/ads7846.c +0 −1
  487. drivers/input/touchscreen/silead.c +10 −8
  488. drivers/iommu/arm-smmu-v3.c +5 −2
  489. drivers/iommu/arm-smmu.c +7 −27
  490. drivers/iommu/dma-iommu.c +9 −5
  491. drivers/iommu/io-pgtable-arm-v7s.c +3 −1
  492. drivers/iommu/mtk_iommu.h +3 −3
  493. drivers/irqchip/irq-atmel-aic.c +3 −2
  494. drivers/irqchip/irq-atmel-aic5.c +3 −2
  495. drivers/irqchip/irq-gic-v3-its.c +6 −1
  496. drivers/irqchip/irq-gic-v3.c +13 −5
  497. drivers/irqchip/irq-gic.c +7 −0
  498. drivers/irqchip/irq-mips-gic.c +61 −56
  499. drivers/macintosh/ams/ams-i2c.c +0 −1
  500. drivers/macintosh/windfarm_pm112.c +0 −1
  501. drivers/macintosh/windfarm_pm72.c +0 −1
  502. drivers/macintosh/windfarm_rm31.c +0 −1
  503. drivers/mailbox/Kconfig +1 −0
  504. drivers/mailbox/bcm-pdc-mailbox.c +6 −5
  505. drivers/md/bcache/super.c +10 −4
  506. drivers/md/bitmap.c +33 −14
  507. drivers/md/dm-bufio.c +1 −1
  508. drivers/md/dm-crypt.c +9 −2
  509. drivers/md/dm-flakey.c +16 −11
  510. drivers/md/dm-log-writes.c +5 −5
  511. drivers/md/dm-log.c +6 −5
  512. drivers/md/dm-raid.c +47 −35
  513. drivers/md/dm-round-robin.c +5 −2
  514. drivers/md/md-cluster.c +9 −3
  515. drivers/md/md.c +19 −21
  516. drivers/md/raid10.c +7 −6
  517. drivers/md/raid5-cache.c +15 −31
  518. drivers/md/raid5.c +53 −21
  519. drivers/media/cec-edid.c +4 −1
  520. drivers/media/pci/cx23885/cx23885-417.c +1 −0
  521. drivers/media/pci/saa7134/saa7134-dvb.c +1 −0
  522. drivers/media/pci/saa7134/saa7134-empress.c +1 −0
  523. drivers/media/platform/Kconfig +1 −1
  524. drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h +0 −1
  525. drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c +26 −16
  526. drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c +5 −1
  527. drivers/media/platform/mtk-vcodec/mtk_vcodec_intr.h +0 −1
  528. drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c +8 −8
  529. drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c +7 −9
  530. drivers/media/platform/rcar-fcp.c +7 −1
  531. drivers/memory/omap-gpmc.c +7 −14
  532. drivers/misc/Kconfig +0 −10
  533. drivers/misc/Makefile +0 −1
  534. drivers/misc/bh1780gli.c +0 −259
  535. drivers/misc/cxl/vphb.c +9 −1
  536. drivers/misc/lkdtm_rodata.c +1 −1
  537. drivers/misc/lkdtm_usercopy.c +17 −8
  538. drivers/misc/mei/hw-me.c +8 −2
  539. drivers/misc/mei/pci-me.c +2 −2
  540. drivers/mmc/card/block.c +3 −2
  541. drivers/mmc/card/queue.c +5 −2
  542. drivers/mmc/card/queue.h +3 −1
  543. drivers/mmc/host/dw_mmc.c +9 −5
  544. drivers/mmc/host/dw_mmc.h +3 −0
  545. drivers/mmc/host/omap.c +10 −8
  546. drivers/mmc/host/omap_hsmmc.c +8 −8
  547. drivers/mmc/host/sdhci-st.c +14 −1
  548. drivers/mtd/nand/mtk_ecc.c +8 −4
  549. drivers/mtd/nand/mtk_nand.c +5 −2
  550. drivers/mtd/nand/mxc_nand.c +1 −1
  551. drivers/net/bonding/bond_main.c +5 −4
  552. drivers/net/can/flexcan.c +8 −5
  553. drivers/net/can/ifi_canfd/ifi_canfd.c +10 −1
  554. drivers/net/dsa/b53/b53_regs.h +1 −1
  555. drivers/net/dsa/bcm_sf2.h +1 −1
  556. drivers/net/dsa/mv88e6xxx/chip.c +8 −2
  557. drivers/net/ethernet/apm/xgene/xgene_enet_hw.c +2 −0
  558. drivers/net/ethernet/arc/emac_main.c +4 −2
  559. drivers/net/ethernet/atheros/alx/main.c +2 −0
  560. drivers/net/ethernet/atheros/alx/reg.h +1 −0
  561. drivers/net/ethernet/broadcom/bgmac-bcma.c +1 −1
  562. drivers/net/ethernet/broadcom/bnx2.c +7 −5
  563. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +15 −4
  564. drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 −2
  565. drivers/net/ethernet/broadcom/tg3.c +2 −14
  566. drivers/net/ethernet/brocade/bna/bnad_ethtool.c +29 −28
  567. drivers/net/ethernet/cadence/macb.c +23 −0
  568. drivers/net/ethernet/cadence/macb.h +1 −1
  569. drivers/net/ethernet/cavium/thunder/nic.h +1 −0
  570. drivers/net/ethernet/cavium/thunder/nic_main.c +8 −3
  571. drivers/net/ethernet/cavium/thunder/nic_reg.h +0 −1
  572. drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c +4 −1
  573. drivers/net/ethernet/cavium/thunder/nicvf_main.c +15 −5
  574. drivers/net/ethernet/cavium/thunder/nicvf_queues.c +57 −7
  575. drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +2 −2
  576. drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +18 −7
  577. drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +6 −1
  578. drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h +6 −0
  579. drivers/net/ethernet/chelsio/cxgb4vf/t4vf_common.h +11 −4
  580. drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c +7 −2
  581. drivers/net/ethernet/davicom/dm9000.c +5 −3
  582. drivers/net/ethernet/freescale/gianfar.c +14 −6
  583. drivers/net/ethernet/freescale/gianfar.h +2 −1
  584. drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c +1 −1
  585. drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c +2 −1
  586. drivers/net/ethernet/ibm/emac/core.c +32 −2
  587. drivers/net/ethernet/intel/e1000e/82571.c +4 −2
  588. drivers/net/ethernet/intel/e1000e/e1000.h +1 −0
  589. drivers/net/ethernet/intel/e1000e/ich8lan.c +2 −1
  590. drivers/net/ethernet/intel/e1000e/netdev.c +39 −27
  591. drivers/net/ethernet/intel/i40e/i40e_client.c +30 −11
  592. drivers/net/ethernet/intel/i40e/i40e_main.c +36 −15
  593. drivers/net/ethernet/intel/igb/igb_ptp.c +23 −3
  594. drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +3 −1
  595. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +16 −7
  596. drivers/net/ethernet/mediatek/mtk_eth_soc.c +76 −56
  597. drivers/net/ethernet/mediatek/mtk_eth_soc.h +14 −8
  598. drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c +30 −27
  599. drivers/net/ethernet/mellanox/mlx4/en_netdev.c +8 −13
  600. drivers/net/ethernet/mellanox/mlx4/en_tx.c +7 −5
  601. drivers/net/ethernet/mellanox/mlx4/eq.c +2 −2
  602. drivers/net/ethernet/mellanox/mlx4/main.c +3 −0
  603. drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +3 −12
  604. drivers/net/ethernet/mellanox/mlx4/port.c +2 −2
  605. drivers/net/ethernet/mellanox/mlx5/core/cmd.c +54 −31
  606. drivers/net/ethernet/mellanox/mlx5/core/en.h +9 −12
  607. drivers/net/ethernet/mellanox/mlx5/core/en_common.c +4 −3
  608. drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +16 −5
  609. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +90 −11
  610. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +52 −60
  611. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +2 −3
  612. drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +30 −33
  613. drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +4 −0
  614. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +10 −4
  615. drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +34 −34
  616. drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c +4 −2
  617. drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +10 −7
  618. drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +1 −0
  619. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +34 −12
  620. drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c +2 −2
  621. drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +1 −1
  622. drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c +10 −1
  623. drivers/net/ethernet/mellanox/mlx5/core/main.c +29 −30
  624. drivers/net/ethernet/mellanox/mlxsw/port.h +1 −0
  625. drivers/net/ethernet/mellanox/mlxsw/reg.h +11 −0
  626. drivers/net/ethernet/mellanox/mlxsw/spectrum.c +124 −60
  627. drivers/net/ethernet/mellanox/mlxsw/spectrum.h +2 −2
  628. drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c +5 −9
  629. drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c +6 −4
  630. drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +107 −58
  631. drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +19 −51
  632. drivers/net/ethernet/mellanox/mlxsw/trap.h +4 −0
  633. drivers/net/ethernet/netronome/nfp/nfp_net_common.c +6 −7
  634. drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c +0 −1
  635. drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c +2 −5
  636. drivers/net/ethernet/nxp/lpc_eth.c +9 −11
  637. drivers/net/ethernet/qlogic/qed/qed.h +10 −1
  638. drivers/net/ethernet/qlogic/qed/qed_dcbx.c +185 −56
  639. drivers/net/ethernet/qlogic/qed/qed_hsi.h +8 −0
  640. drivers/net/ethernet/qlogic/qed/qed_mcp.c +2 −2
  641. drivers/net/ethernet/qlogic/qede/qede_main.c +6 −2
  642. drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +2 −2
  643. drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c +0 −2
  644. drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h +5 −4
  645. drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +55 −40
  646. drivers/net/ethernet/realtek/8139cp.c +1 −1
  647. drivers/net/ethernet/renesas/sh_eth.c +7 −0
  648. drivers/net/ethernet/sfc/ef10.c +2 −1
  649. drivers/net/ethernet/smsc/smc91x.c +7 −0
  650. drivers/net/ethernet/smsc/smc91x.h +47 −20
  651. drivers/net/ethernet/smsc/smsc911x.c +104 −109
  652. drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c +1 −1
  653. drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +1 −1
  654. drivers/net/ethernet/synopsys/dwc_eth_qos.c +28 −27
  655. drivers/net/ethernet/tehuti/tehuti.c +1 −1
  656. drivers/net/ethernet/ti/cpsw.c +2 −0
  657. drivers/net/ethernet/tundra/tsi108_eth.c +2 −0
  658. drivers/net/ethernet/xilinx/xilinx_emaclite.c +5 −3
  659. drivers/net/hyperv/hyperv_net.h +9 −15
  660. drivers/net/hyperv/netvsc.c +8 −11
  661. drivers/net/hyperv/netvsc_drv.c +49 −56
  662. drivers/net/macsec.c +44 −8
  663. drivers/net/macvlan.c +1 −1
  664. drivers/net/macvtap.c +1 −4
  665. drivers/net/phy/Kconfig +1 −0
  666. drivers/net/phy/mdio-xgene.c +2 −4
  667. drivers/net/phy/micrel.c +20 −9
  668. drivers/net/phy/phy.c +4 −2
  669. drivers/net/team/team_mode_loadbalance.c +15 −0
  670. drivers/net/tun.c +1 −5
  671. drivers/net/usb/kaweth.c +7 −3
  672. drivers/net/usb/r8152.c +146 −135
  673. drivers/net/vmxnet3/vmxnet3_drv.c +3 −1
  674. drivers/net/vmxnet3/vmxnet3_int.h +2 −2
  675. drivers/net/vxlan.c +32 −40
  676. drivers/net/wireless/ath/ath10k/htt_rx.c +5 −5
  677. drivers/net/wireless/ath/ath10k/pci.c +0 −1
  678. drivers/net/wireless/ath/ath9k/hw.c +2 −2
  679. drivers/net/wireless/ath/ath9k/main.c +12 −6
  680. drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +14 −14
  681. drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +1 −1
  682. drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +1 −1
  683. drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +5 −3
  684. drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h +1 −1
  685. drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c +2 −1
  686. drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.h +2 −1
  687. drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +1 −0
  688. drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +2 −0
  689. drivers/net/wireless/intel/iwlwifi/mvm/tx.c +9 −10
  690. drivers/net/wireless/marvell/mwifiex/11n_aggr.c +2 −1
  691. drivers/net/wireless/ti/wlcore/main.c +3 −2
  692. drivers/net/xen-netback/xenbus.c +30 −16
  693. drivers/nvdimm/bus.c +5 −1
  694. drivers/nvme/host/Kconfig +2 −2
  695. drivers/nvme/host/core.c +7 −4
  696. drivers/nvme/host/fabrics.c +16 −7
  697. drivers/nvme/host/fabrics.h +1 −1
  698. drivers/nvme/host/pci.c +8 −1
  699. drivers/nvme/host/rdma.c +98 −90
  700. drivers/nvme/target/Kconfig +1 −1
  701. drivers/nvme/target/loop.c +2 −2
  702. drivers/nvme/target/rdma.c +4 −3
  703. drivers/of/base.c +3 −11
  704. drivers/of/fdt.c +1 −1
  705. drivers/of/irq.c +3 −2
  706. drivers/of/platform.c +2 −0
  707. drivers/pci/host-bridge.c +1 −0
  708. drivers/pci/msi.c +10 −8
  709. drivers/pci/quirks.c +5 −2
  710. drivers/pci/remove.c +1 −2
  711. drivers/pcmcia/ds.c +7 −5
  712. drivers/pcmcia/pxa2xx_base.c +5 −4
  713. drivers/pcmcia/pxa2xx_base.h +1 −1
  714. drivers/pcmcia/sa1111_badge4.c +8 −14
  715. drivers/pcmcia/sa1111_generic.c +17 −5
  716. drivers/pcmcia/sa1111_jornada720.c +10 −15
  717. drivers/pcmcia/sa1111_lubbock.c +13 −19
  718. drivers/pcmcia/sa1111_neponset.c +10 −16
  719. drivers/pcmcia/sa11xx_base.c +4 −4
  720. drivers/pcmcia/soc_common.c +1 −1
  721. drivers/perf/arm_pmu.c +2 −1
  722. drivers/phy/phy-brcm-sata.c +1 −1
  723. drivers/phy/phy-sun4i-usb.c +46 −22
  724. drivers/phy/phy-sun9i-usb.c +2 −2
  725. drivers/pinctrl/intel/pinctrl-cherryview.c +2 −3
  726. drivers/pinctrl/intel/pinctrl-merrifield.c +1 −0
  727. drivers/pinctrl/meson/pinctrl-meson.c +1 −7
  728. drivers/pinctrl/pinctrl-amd.c +0 −20
  729. drivers/pinctrl/pinctrl-pistachio.c +7 −14
  730. drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c +2 −2
  731. drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c +2 −2
  732. drivers/platform/olpc/olpc-ec.c +3 −5
  733. drivers/platform/x86/intel_pmic_gpio.c +2 −6
  734. drivers/power/max17042_battery.c +9 −6
  735. drivers/power/reset/Kconfig +1 −1
  736. drivers/power/reset/hisi-reboot.c +4 −1
  737. drivers/power/tps65217_charger.c +1 −0
  738. drivers/rapidio/devices/tsi721.c +1 −1
  739. drivers/rapidio/rio_cm.c +16 −3
  740. drivers/regulator/max14577-regulator.c +2 −2
  741. drivers/regulator/max77693-regulator.c +2 −2
  742. drivers/regulator/qcom_smd-regulator.c +16 −14
  743. drivers/s390/block/dasd.c +9 −1
  744. drivers/s390/block/dasd_eckd.c +10 −0
  745. drivers/s390/cio/device.c +0 −2
  746. drivers/s390/cio/device_status.c +4 −3
  747. drivers/s390/cio/io_sch.h +0 −1
  748. drivers/s390/cio/qdio_main.c +57 −56
  749. drivers/s390/net/qeth_core.h +1 −0
  750. drivers/s390/net/qeth_core_main.c +31 −1
  751. drivers/s390/net/qeth_l2_main.c +3 −3
  752. drivers/s390/net/qeth_l3_main.c +20 −9
  753. drivers/s390/net/qeth_l3_sys.c +5 −0
  754. drivers/scsi/aacraid/commctrl.c +11 −2
  755. drivers/scsi/constants.c +3 −2
  756. drivers/scsi/fcoe/fcoe_ctlr.c +1 −1
  757. drivers/scsi/megaraid/megaraid_sas_base.c +3 −3
  758. drivers/scsi/megaraid/megaraid_sas_fusion.c +1 −1
  759. drivers/scsi/mpt3sas/mpt3sas_base.c +11 −11
  760. drivers/scsi/scsi_devinfo.c +4 −0
  761. drivers/scsi/scsi_transport_sas.c +0 −16
  762. drivers/scsi/ses.c +3 −2
  763. drivers/scsi/wd719x.c +1 −1
  764. drivers/spi/spi-img-spfi.c +0 −2
  765. drivers/spi/spi-mt65xx.c +0 −1
  766. drivers/spi/spi-pxa2xx-pci.c +1 −0
  767. drivers/spi/spi-qup.c +0 −1
  768. drivers/spi/spi-sh-msiof.c +3 −0
  769. drivers/spi/spi.c +8 −2
  770. drivers/staging/comedi/drivers/adv_pci1760.c +1 −0
  771. drivers/staging/comedi/drivers/comedi_test.c +12 −34
  772. drivers/staging/comedi/drivers/daqboard2000.c +1 −1
  773. drivers/staging/comedi/drivers/dt2811.c +2 −2
  774. drivers/staging/comedi/drivers/ni_mio_common.c +10 −2
  775. drivers/staging/iio/impedance-analyzer/ad5933.c +1 −1
  776. drivers/staging/lustre/lustre/llite/namei.c +24 −19
  777. drivers/staging/media/cec/TODO +1 −0
  778. drivers/staging/media/cec/cec-adap.c +18 −8
  779. drivers/staging/media/cec/cec-api.c +6 −6
  780. drivers/staging/media/cec/cec-core.c +15 −12
  781. drivers/staging/media/pulse8-cec/pulse8-cec.c +5 −5
  782. drivers/staging/wilc1000/host_interface.c +1 −2
  783. drivers/staging/wilc1000/linux_wlan.c +1 −1
  784. drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +2 −2
  785. drivers/thermal/cpu_cooling.c +16 −5
  786. drivers/thermal/imx_thermal.c +1 −3
  787. drivers/thermal/int340x_thermal/int3406_thermal.c +0 −1
  788. drivers/thermal/rcar_thermal.c +1 −0
  789. drivers/thunderbolt/nhi.c +6 −0
  790. drivers/thunderbolt/switch.c +3 −1
  791. drivers/tty/serial/8250/8250.h +1 −34
  792. drivers/tty/serial/8250/8250_core.c +0 −9
  793. drivers/tty/serial/8250/8250_fintek.c +2 −2
  794. drivers/tty/serial/8250/8250_mid.c +3 −0
  795. drivers/tty/serial/8250/8250_omap.c +13 −18
  796. drivers/tty/serial/8250/8250_pci.c +139 −0
  797. drivers/tty/serial/8250/8250_port.c +1 −6
  798. drivers/tty/serial/8250/Kconfig +0 −1
  799. drivers/usb/chipidea/udc.c +14 −2
  800. drivers/usb/class/cdc-acm.c +2 −3
  801. drivers/usb/class/cdc-acm.h +0 −1
  802. drivers/usb/core/config.c +80 −14
  803. drivers/usb/core/devio.c +16 −7
  804. drivers/usb/core/hub.c +9 −14
  805. drivers/usb/dwc2/core.h +1 −0
  806. drivers/usb/dwc2/platform.c +22 −0
  807. drivers/usb/dwc3/core.c +1 −0
  808. drivers/usb/dwc3/debug.h +1 −1
  809. drivers/usb/dwc3/dwc3-of-simple.c +1 −0
  810. drivers/usb/dwc3/dwc3-pci.c +13 −2
  811. drivers/usb/dwc3/gadget.c +36 −25
  812. drivers/usb/gadget/composite.c +4 −2
  813. drivers/usb/gadget/configfs.c +2 −0
  814. drivers/usb/gadget/function/f_eem.c +8 −4
  815. drivers/usb/gadget/function/f_rndis.c +3 −0
  816. drivers/usb/gadget/function/rndis.c +6 −0
  817. drivers/usb/gadget/function/u_ether.c +2 −1
  818. drivers/usb/gadget/function/u_serial.c +6 −1
  819. drivers/usb/gadget/function/uvc_configfs.c +1 −1
  820. drivers/usb/gadget/legacy/inode.c +2 −2
  821. drivers/usb/gadget/udc/core.c +5 −2
  822. drivers/usb/gadget/udc/fsl_qe_udc.c +3 −6
  823. drivers/usb/gadget/udc/renesas_usb3.c +2 −0
  824. drivers/usb/host/ehci-hcd.c +2 −2
  825. drivers/usb/host/max3421-hcd.c +1 −1
  826. drivers/usb/host/xhci-hub.c +3 −0
  827. drivers/usb/host/xhci-pci.c +2 −1
  828. drivers/usb/host/xhci-ring.c +14 −8
  829. drivers/usb/misc/ftdi-elan.c +5 −5
  830. drivers/usb/misc/usbtest.c +5 −4
  831. drivers/usb/musb/Kconfig +1 −1
  832. drivers/usb/musb/musb_virthub.c +6 −1
  833. drivers/usb/phy/phy-generic.c +6 −2
  834. drivers/usb/phy/phy-omap-otg.c +2 −0
  835. drivers/usb/renesas_usbhs/common.c +2 −1
  836. drivers/usb/renesas_usbhs/fifo.c +2 −2
  837. drivers/usb/renesas_usbhs/mod.c +9 −2
  838. drivers/usb/renesas_usbhs/mod_gadget.c +6 −3
  839. drivers/usb/serial/ftdi_sio.c +3 −0
  840. drivers/usb/serial/ftdi_sio_ids.h +12 −0
  841. drivers/usb/serial/mos7720.c +1 −1
  842. drivers/usb/serial/mos7840.c +2 −2
  843. drivers/usb/serial/option.c +31 −0
  844. drivers/usb/serial/usb-serial-simple.c +2 −1
  845. drivers/usb/serial/usb-serial.c +3 −1
  846. drivers/vhost/scsi.c +3 −3
  847. drivers/vhost/test.c +4 −4
  848. drivers/virtio/virtio_ring.c +1 −1
  849. drivers/xen/xenbus/xenbus_dev_frontend.c +1 −1
  850. fs/afs/cmservice.c +34 −44
  851. fs/afs/fsclient.c +72 −149
  852. fs/afs/internal.h +13 −1
  853. fs/afs/rxrpc.c +45 −28
  854. fs/afs/vlclient.c +4 −7
  855. fs/aio.c +6 −1
  856. fs/autofs4/expire.c +42 −13
  857. fs/binfmt_elf.c +1 −1
  858. fs/block_dev.c +3 −2
  859. fs/btrfs/backref.c +1 −0
  860. fs/btrfs/ctree.h +5 −1
  861. fs/btrfs/delayed-ref.c +2 −5
  862. fs/btrfs/disk-io.c +51 −5
  863. fs/btrfs/disk-io.h +2 −0
  864. fs/btrfs/extent-tree.c +107 −116
  865. fs/btrfs/extent_io.h +1 −0
  866. fs/btrfs/file.c +16 −12
  867. fs/btrfs/inode-map.c +1 −2
  868. fs/btrfs/inode.c +27 −10
  869. fs/btrfs/ioctl.c +13 −1
  870. fs/btrfs/qgroup.c +52 −10
  871. fs/btrfs/qgroup.h +31 −5
  872. fs/btrfs/relocation.c +118 −10
  873. fs/btrfs/root-tree.c +18 −9
  874. fs/btrfs/send.c +5 −3
  875. fs/btrfs/super.c +16 −0
  876. fs/btrfs/transaction.c +6 −1
  877. fs/btrfs/tree-log.c +20 −2
  878. fs/btrfs/tree-log.h +4 −1
  879. fs/btrfs/volumes.c +19 −8
  880. fs/ceph/dir.c +1 −1
  881. fs/cifs/cifsfs.c +12 −17
  882. fs/cifs/cifsproto.h +1 −1
  883. fs/cifs/connect.c +29 −2
  884. fs/configfs/file.c +1 −0
  885. fs/crypto/policy.c +29 −12
  886. fs/devpts/inode.c +2 −1
  887. fs/dlm/debug_fs.c +48 −14
  888. fs/ext4/inode.c +0 −2
  889. fs/ext4/ioctl.c +1 −1
  890. fs/ext4/super.c +17 −1
  891. fs/ext4/xattr.c +31 −22
  892. fs/ext4/xattr.h +1 −0
  893. fs/f2fs/data.c +1 −1
  894. fs/f2fs/f2fs.h +6 −6
  895. fs/f2fs/file.c +10 −12
  896. fs/f2fs/node.c +23 −24
  897. fs/f2fs/super.c +1 −5
  898. fs/fuse/file.c +4 −3
  899. fs/ioctl.c +5 −1
  900. fs/iomap.c +17 −9
  901. fs/kernfs/file.c +21 −7
  902. fs/nfs/blocklayout/blocklayout.c +1 −1
  903. fs/nfs/blocklayout/blocklayout.h +2 −1
  904. fs/nfs/blocklayout/extent_tree.c +7 −3
  905. fs/nfs/callback.c +1 −0
  906. fs/nfs/callback_proc.c +2 −6
  907. fs/nfs/client.c +5 −5
  908. fs/nfs/file.c +4 −1
  909. fs/nfs/flexfilelayout/flexfilelayout.c +22 −23
  910. fs/nfs/flexfilelayout/flexfilelayout.h +1 −1
  911. fs/nfs/flexfilelayout/flexfilelayoutdev.c +12 −11
  912. fs/nfs/internal.h +4 −1
  913. fs/nfs/nfs42proc.c +29 −5
  914. fs/nfs/nfs4client.c +5 −0
  915. fs/nfs/nfs4proc.c +90 −20
  916. fs/nfs/nfs4session.c +53 −0
  917. fs/nfs/nfs4session.h +6 −1
  918. fs/nfs/pnfs.c +25 −19
  919. fs/nfs/super.c +17 −2
  920. fs/notify/fanotify/fanotify.c +1 −12
  921. fs/notify/fanotify/fanotify_user.c +24 −12
  922. fs/notify/group.c +19 −0
  923. fs/notify/notification.c +7 −16
  924. fs/ocfs2/alloc.c +19 −37
  925. fs/ocfs2/cluster/tcp_internal.h +1 −4
  926. fs/ocfs2/dlm/dlmconvert.c +6 −6
  927. fs/ocfs2/file.c +24 −10
  928. fs/ocfs2/suballoc.c +12 −2
  929. fs/overlayfs/copy_up.c +2 −0
  930. fs/overlayfs/dir.c +56 −2
  931. fs/overlayfs/inode.c +44 −64
  932. fs/overlayfs/overlayfs.h +9 −8
  933. fs/overlayfs/readdir.c +62 −1
  934. fs/overlayfs/super.c +69 −24
  935. fs/proc/base.c +1 −6
  936. fs/proc/kcore.c +20 −11
  937. fs/proc/task_mmu.c +2 −0
  938. fs/ramfs/file-mmu.c +9 −0
  939. fs/seq_file.c +3 −1
  940. fs/sysfs/file.c +7 −1
  941. fs/ubifs/tnc_commit.c +1 −1
  942. fs/ubifs/xattr.c +4 −1
  943. fs/xfs/libxfs/xfs_alloc.c +16 −0
  944. fs/xfs/libxfs/xfs_btree.c +13 −1
  945. fs/xfs/libxfs/xfs_defer.c +4 −13
  946. fs/xfs/libxfs/xfs_defer.h +1 −1
  947. fs/xfs/libxfs/xfs_format.h +10 −3
  948. fs/xfs/libxfs/xfs_rmap_btree.c +6 −0
  949. fs/xfs/libxfs/xfs_sb.c +2 −1
  950. fs/xfs/xfs_buf.c +1 −2
  951. fs/xfs/xfs_file.c +12 −1
  952. fs/xfs/xfs_fsops.c +1 −0
  953. fs/xfs/xfs_iomap.c +56 −13
  954. fs/xfs/xfs_iomap.h +1 −0
  955. fs/xfs/xfs_iops.c +8 −1
  956. fs/xfs/xfs_super.c +8 −1
  957. fs/xfs/xfs_trace.h +1 −2
  958. include/asm-generic/uaccess.h +14 −7
  959. include/linux/acpi.h +1 −1
  960. include/linux/bio.h +8 −2
  961. include/linux/blkdev.h +4 −2
  962. include/linux/cec-funcs.h +75 −3
  963. include/linux/cec.h +4 −1
  964. include/linux/compiler-gcc.h +7 −3
  965. include/linux/compiler.h +4 −3
  966. include/linux/cpuhotplug.h +2 −0
  967. include/linux/efi.h +21 −6
  968. include/linux/fs.h +1 −0
  969. include/linux/fscrypto.h +2 −3
  970. include/linux/fsnotify_backend.h +3 −3
  971. include/linux/host1x.h +2 −0
  972. include/linux/iio/sw_trigger.h +1 −1
  973. include/linux/iomap.h +7 −1
  974. include/linux/irq.h +10 −0
  975. include/linux/irqchip/arm-gic-v3.h +1 −0
  976. include/linux/mempolicy.h +4 −0
  977. include/linux/mfd/da8xx-cfgchip.h +153 −0
  978. include/linux/mfd/ti_am335x_tscadc.h +4 −4
  979. include/linux/mlx5/mlx5_ifc.h +3 −2
  980. include/linux/mm.h +1 −0
  981. include/linux/mmzone.h +14 −2
  982. include/linux/netdevice.h +2 −2
  983. include/linux/netfilter/nfnetlink_acct.h +2 −2
  984. include/linux/nvme.h +1 −1
  985. include/linux/pagemap.h +20 −19
  986. include/linux/pci.h +6 −13
  987. include/linux/qed/qed_if.h +8 −0
  988. include/linux/sctp.h +0 −64
  989. include/linux/serial_8250.h +0 −1
  990. include/linux/skbuff.h +33 −19
  991. include/linux/smc91x.h +10 −0
  992. include/linux/sysctl.h +2 −0
  993. include/linux/thread_info.h +4 −3
  994. include/linux/uio.h +1 −1
  995. include/media/cec.h +1 −1
  996. include/net/act_api.h +5 −18
  997. include/net/af_rxrpc.h +1 −1
  998. include/net/af_unix.h +1 −1
  999. include/net/cfg80211.h +9 −0
  1000. include/net/gre.h +1 −0
  1001. include/net/inet_ecn.h +2 −1
  1002. include/net/ip_fib.h +2 −1
  1003. include/net/mac80211.h +2 −1
  1004. include/net/netfilter/nf_conntrack_synproxy.h +14 −0
  1005. include/net/netfilter/nft_meta.h +4 −0
  1006. include/net/netfilter/nft_reject.h +4 −0
  1007. include/net/pkt_cls.h +36 −5
  1008. include/net/sctp/sm.h +1 −1
  1009. include/net/sock.h +10 −0
  1010. include/net/tcp.h +2 −0
  1011. include/net/xfrm.h +3 −1
  1012. include/rdma/ib_verbs.h +3 −8
  1013. include/scsi/scsi_transport_sas.h +2 −3
  1014. include/uapi/linux/atm_zatm.h +1 −0
  1015. include/uapi/linux/bpf.h +2 −2
  1016. include/uapi/linux/if_pppol2tp.h +2 −1
  1017. include/uapi/linux/if_pppox.h +3 −0
  1018. include/uapi/linux/if_tunnel.h +3 −0
  1019. include/uapi/linux/ipx.h +12 −1
  1020. include/uapi/linux/libc-compat.h +26 −0
  1021. include/uapi/linux/netfilter/nf_tables.h +1 −1
  1022. include/uapi/linux/openvswitch.h +3 −3
  1023. include/uapi/linux/sctp.h +64 −0
  1024. include/xen/xen-ops.h +2 −2
  1025. kernel/audit_watch.c +5 −3
  1026. kernel/bpf/hashtab.c +73 −11
  1027. kernel/bpf/verifier.c +4 −3
  1028. kernel/cgroup.c +6 −0
  1029. kernel/configs/tiny.config +8 −0
  1030. kernel/cpuset.c +15 −0
  1031. kernel/events/core.c +102 −34
  1032. kernel/events/ring_buffer.c +11 −4
  1033. kernel/events/uprobes.c +3 −2
  1034. kernel/exit.c +1 −6
  1035. kernel/fork.c +29 −8
  1036. kernel/irq/affinity.c +2 −0
  1037. kernel/irq/chip.c +15 −0
  1038. kernel/irq/manage.c +6 −2
  1039. kernel/kexec_file.c +3 −0
  1040. kernel/memremap.c +9 −0
  1041. kernel/power/qos.c +10 −1
  1042. kernel/power/snapshot.c +5 −5
  1043. kernel/printk/braille.c +2 −2
  1044. kernel/printk/nmi.c +23 −15
  1045. kernel/sched/core.c +22 −0
  1046. kernel/sched/cputime.c +25 −8
  1047. kernel/seccomp.c +8 −4
  1048. kernel/sysctl.c +43 −2
  1049. kernel/time/tick-sched.c +2 −1
  1050. kernel/time/timekeeping.c +4 −1
  1051. kernel/time/timekeeping_debug.c +7 −2
  1052. kernel/trace/blktrace.c +1 −1
  1053. kernel/trace/trace.c +16 −13
  1054. lib/Kconfig.debug +1 −19
  1055. lib/Makefile +0 −1
  1056. lib/iov_iter.c +2 −22
  1057. lib/radix-tree.c +4 −4
  1058. lib/rhashtable.c +13 −7
  1059. lib/test_hash.c +16 −10
  1060. lib/test_rhashtable.c +1 −1
  1061. lib/usercopy.c +0 −9
  1062. mm/Kconfig +8 −1
  1063. mm/debug.c +4 −2
  1064. mm/huge_memory.c +8 −6
  1065. mm/khugepaged.c +13 −12
  1066. mm/memcontrol.c +40 −27
  1067. mm/memory.c +7 −5
  1068. mm/memory_hotplug.c +3 −1
  1069. mm/mempolicy.c +17 −0
  1070. mm/page_alloc.c +4 −51
  1071. mm/page_io.c +3 −0
  1072. mm/readahead.c +9 −0
  1073. mm/shmem.c +3 −2
  1074. mm/swapfile.c +0 −1
  1075. mm/usercopy.c +40 −28
  1076. mm/vmscan.c +11 −30
  1077. net/8021q/vlan.c +1 −1
  1078. net/batman-adv/bat_v_elp.c +1 −1
  1079. net/batman-adv/routing.c +27 −1
  1080. net/bluetooth/af_bluetooth.c +1 −1
  1081. net/bluetooth/hci_request.c +2 −0
  1082. net/bluetooth/hci_sock.c +1 −1
  1083. net/bluetooth/l2cap_core.c +8 −0
  1084. net/bluetooth/l2cap_sock.c +12 −2
  1085. net/bridge/br_fdb.c +27 −25
  1086. net/bridge/br_input.c +2 −5
  1087. net/bridge/br_multicast.c +1 −1
  1088. net/bridge/netfilter/ebtables.c +2 −0
  1089. net/bridge/netfilter/nft_meta_bridge.c +1 −0
  1090. net/core/dev.c +19 −7
  1091. net/core/filter.c +47 −62
  1092. net/core/flow_dissector.c +4 −2
  1093. net/core/sock.c +4 −1
  1094. net/ipv4/devinet.c +7 −4
  1095. net/ipv4/fib_frontend.c +2 −1
  1096. net/ipv4/fib_semantics.c +6 −2
  1097. net/ipv4/fib_trie.c +4 −8
  1098. net/ipv4/ip_gre.c +0 −1
  1099. net/ipv4/ip_input.c +3 −2
  1100. net/ipv4/ip_tunnel_core.c +5 −3
  1101. net/ipv4/ip_vti.c +45 −1
  1102. net/ipv4/ipmr.c +5 −2
  1103. net/ipv4/netfilter/nft_chain_route_ipv4.c +7 −4
  1104. net/ipv4/netfilter/nft_reject_ipv4.c +1 −0
  1105. net/ipv4/route.c +8 −2
  1106. net/ipv4/tcp.c +0 −2
  1107. net/ipv4/tcp_diag.c +6 −1
  1108. net/ipv4/tcp_fastopen.c +2 −0
  1109. net/ipv4/tcp_input.c +1 −1
  1110. net/ipv4/tcp_ipv4.c +7 −1
  1111. net/ipv4/tcp_output.c +5 −2
  1112. net/ipv4/tcp_timer.c +1 −0
  1113. net/ipv4/tcp_yeah.c +1 −1
  1114. net/ipv4/udp.c +6 −7
  1115. net/ipv4/udplite.c +0 −1
  1116. net/ipv4/xfrm4_policy.c +1 −1
  1117. net/ipv6/addrconf.c +40 −16
  1118. net/ipv6/calipso.c +3 −1
  1119. net/ipv6/ip6_gre.c +0 −2
  1120. net/ipv6/ip6_tunnel.c +2 −0
  1121. net/ipv6/ip6_vti.c +15 −4
  1122. net/ipv6/ip6mr.c +5 −2
  1123. net/ipv6/netfilter/nft_chain_route_ipv6.c +7 −3
  1124. net/ipv6/netfilter/nft_reject_ipv6.c +1 −0
  1125. net/ipv6/ping.c +24 −18
  1126. net/ipv6/route.c +10 −1
  1127. net/ipv6/tcp_ipv6.c +7 −1
  1128. net/ipv6/udp.c +0 −1
  1129. net/ipv6/udplite.c +0 −1
  1130. net/ipv6/xfrm6_input.c +11 −4
  1131. net/ipv6/xfrm6_policy.c +1 −1
  1132. net/ipv6/xfrm6_tunnel.c +1 −1
  1133. net/irda/af_irda.c +2 −3
  1134. net/irda/iriap.c +6 −2
  1135. net/kcm/kcmsock.c +2 −1
  1136. net/l2tp/l2tp_core.c +3 −0
  1137. net/l2tp/l2tp_ppp.c +1 −1
  1138. net/mac80211/agg-rx.c +7 −1
  1139. net/mac80211/agg-tx.c +3 −0
  1140. net/mac80211/cfg.c +1 −1
  1141. net/mac80211/driver-ops.h +1 −1
  1142. net/mac80211/mesh.c +6 −4
  1143. net/mac80211/mesh_hwmp.c +2 −1
  1144. net/mac80211/mesh_pathtbl.c +1 −1
  1145. net/mac80211/rx.c +1 −1
  1146. net/mac80211/sta_info.c +2 −2
  1147. net/mac80211/status.c +7 −7
  1148. net/mac80211/tdls.c +4 −3
  1149. net/mac80211/tx.c +42 −37
  1150. net/netfilter/nf_conntrack_core.c +3 −3
  1151. net/netfilter/nf_conntrack_expect.c +1 −1
  1152. net/netfilter/nf_conntrack_h323_main.c +2 −1
  1153. net/netfilter/nf_conntrack_netlink.c +4 −6
  1154. net/netfilter/nf_conntrack_sip.c +2 −2
  1155. net/netfilter/nf_conntrack_standalone.c +4 −0
  1156. net/netfilter/nf_nat_core.c +3 −2
  1157. net/netfilter/nf_tables_netdev.c +0 −1
  1158. net/netfilter/nf_tables_trace.c +1 −1
  1159. net/netfilter/nfnetlink_acct.c +12 −11
  1160. net/netfilter/nfnetlink_cttimeout.c +38 −27
  1161. net/netfilter/nfnetlink_log.c +1 −0
  1162. net/netfilter/nfnetlink_queue.c +2 −4
  1163. net/netfilter/nft_exthdr.c +9 −2
  1164. net/netfilter/nft_meta.c +13 −4
  1165. net/netfilter/nft_rbtree.c +6 −4
  1166. net/netfilter/nft_reject.c +16 −0
  1167. net/netfilter/nft_reject_inet.c +6 −1
  1168. net/netfilter/xt_TPROXY.c +4 −0
  1169. net/netfilter/xt_nfacct.c +1 −1
  1170. net/openvswitch/conntrack.c +1 −7
  1171. net/openvswitch/vport-geneve.c +8 −1
  1172. net/openvswitch/vport-gre.c +9 −2
  1173. net/openvswitch/vport-internal_dev.c +1 −1
  1174. net/openvswitch/vport-vxlan.c +8 −1
  1175. net/rxrpc/ar-internal.h +1 −0
  1176. net/rxrpc/call_accept.c +1 −0
  1177. net/rxrpc/call_event.c +7 −0
  1178. net/rxrpc/call_object.c +4 −7
  1179. net/rxrpc/input.c +18 −21
  1180. net/rxrpc/recvmsg.c +3 −22
  1181. net/rxrpc/skbuff.c +34 −7
  1182. net/sched/act_api.c +9 −25
  1183. net/sched/act_ife.c +10 −8
  1184. net/sched/act_police.c +11 −51
  1185. net/sched/cls_api.c +36 −15
  1186. net/sched/sch_generic.c +5 −4
  1187. net/sctp/input.c +24 −14
  1188. net/sctp/inqueue.c +0 −13
  1189. net/sctp/output.c +12 −1
  1190. net/sctp/proc.c +1 −0
  1191. net/sctp/sctp_diag.c +16 −8
  1192. net/sctp/ulpevent.c +2 −2
  1193. net/sunrpc/auth_gss/svcauth_gss.c +3 −2
  1194. net/sunrpc/clnt.c +2 −2
  1195. net/sunrpc/xprtrdma/verbs.c +32 −13
  1196. net/sunrpc/xprtrdma/xprt_rdma.h +1 −0
  1197. net/sunrpc/xprtsock.c +1 −1
  1198. net/tipc/monitor.c +2 −1
  1199. net/tipc/name_distr.c +5 −3
  1200. net/tipc/socket.c +2 −1
  1201. net/tipc/udp_media.c +4 −1
  1202. net/unix/af_unix.c +49 −62
  1203. net/vmw_vsock/virtio_transport.c +3 −7
  1204. net/wireless/chan.c +1 −0
  1205. net/wireless/nl80211.c +32 −4
  1206. net/wireless/wext-core.c +2 −23
  1207. net/xfrm/xfrm_input.c +7 −7
  1208. net/xfrm/xfrm_policy.c +4 −0
  1209. net/xfrm/xfrm_state.c +1 −0
  1210. net/xfrm/xfrm_user.c +10 −12
  1211. samples/bpf/bpf_helpers.h +2 −2
  1212. samples/bpf/test_cgrp2_tc_kern.c +1 −1
  1213. samples/bpf/test_maps.c +13 −2
  1214. scripts/checkpatch.pl +0 −9
  1215. scripts/faddr2line +177 −0
  1216. scripts/get_maintainer.pl +3 −1
  1217. scripts/package/builddeb +3 −1
  1218. scripts/tags.sh +0 −1
  1219. security/Kconfig +12 −0
  1220. security/keys/encrypted-keys/encrypted.c +7 −4
  1221. sound/core/rawmidi.c +3 −1
  1222. sound/core/timer.c +32 −2
  1223. sound/firewire/fireworks/fireworks.h +0 −1
  1224. sound/firewire/fireworks/fireworks_hwdep.c +52 −19
  1225. sound/firewire/fireworks/fireworks_proc.c +2 −2
  1226. sound/firewire/fireworks/fireworks_transaction.c +2 −3
  1227. sound/firewire/tascam/tascam-hwdep.c +11 −22
  1228. sound/pci/hda/patch_realtek.c +19 −3
  1229. sound/soc/atmel/atmel_ssc_dai.c +3 −2
  1230. sound/soc/codecs/da7213.c +2 −2
  1231. sound/soc/codecs/max98371.c +1 −0
  1232. sound/soc/codecs/nau8825.c +32 −46
  1233. sound/soc/codecs/wm2000.c +1 −1
  1234. sound/soc/generic/Makefile +3 −3
  1235. sound/soc/generic/simple-card-utils.c +6 −0
  1236. sound/soc/intel/skylake/skl-sst-utils.c +5 −0
  1237. sound/soc/intel/skylake/skl.c +3 −1
  1238. sound/soc/omap/omap-abe-twl6040.c +32 −29
  1239. sound/soc/omap/omap-mcpdm.c +3 −19
  1240. sound/soc/samsung/s3c24xx_uda134x.c +4 −3
  1241. sound/soc/sh/rcar/src.c +5 −1
  1242. sound/soc/soc-compress.c +3 −1
  1243. sound/soc/soc-core.c +2 −3
  1244. sound/soc/soc-dapm.c +10 −0
  1245. sound/usb/line6/pcm.c +2 −1
  1246. sound/usb/line6/pod.c +6 −6
  1247. sound/usb/quirks.c +1 −0
  1248. tools/arch/arm64/include/uapi/asm/kvm.h +2 −0
  1249. tools/arch/s390/include/uapi/asm/kvm.h +41 −0
  1250. tools/arch/s390/include/uapi/asm/sie.h +1 −0
  1251. tools/gpio/gpio-event-mon.c +1 −1
  1252. tools/iio/iio_generic_buffer.c +2 −2
  1253. tools/include/linux/string.h +5 −1
  1254. tools/lguest/lguest.c +3 −3
  1255. tools/perf/arch/powerpc/util/sym-handling.c +2 −0
  1256. tools/perf/arch/x86/util/intel-pt.c +5 −1
  1257. tools/perf/builtin-mem.c +3 −0
  1258. tools/perf/builtin-script.c +10 −3
  1259. tools/perf/util/evsel.c +3 −3
  1260. tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +23 −21
  1261. tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c +17 −7
  1262. tools/perf/util/jitdump.c +1 −0
  1263. tools/perf/util/probe-file.c +29 −7
  1264. tools/perf/util/symbol-elf.c +2 −1
  1265. tools/perf/util/unwind-libdw.c +1 −1
  1266. tools/perf/util/unwind-libunwind-local.c +1 −1
  1267. tools/testing/radix-tree/Makefile +1 −1
  1268. tools/testing/radix-tree/multiorder.c +12 −4
  1269. tools/virtio/linux/dma-mapping.h +16 −0
  1270. tools/virtio/linux/kernel.h +14 −0
  1271. tools/virtio/linux/slab.h +4 −0
  1272. tools/virtio/linux/virtio.h +5 −1
  1273. tools/virtio/linux/virtio_config.h +13 −0
  1274. tools/virtio/ringtest/ptr_ring.c +1 −0
  1275. virt/kvm/arm/arch_timer.c +10 −1
  1276. virt/kvm/arm/vgic/vgic-its.c +114 −44
  1277. virt/kvm/arm/vgic/vgic-mmio-v3.c +16 −10
  1278. virt/kvm/arm/vgic/vgic-v3.c +8 −0
  1279. virt/kvm/arm/vgic/vgic.c +5 −5
  1280. virt/kvm/arm/vgic/vgic.h +6 −0
.mailmap+3−0
@@ -88,6 +88,7 @@ Kay Sievers <kay.sievers@vrfy.org> · 87 unmodified lines
8888 Kenneth W Chen <kenneth.w.chen@intel.com>
8989 Konstantin Khlebnikov <koct9i@gmail.com> <k.khlebnikov@samsung.com>
9090 Koushik <raghavendra.koushik@neterion.com>
91+Krzysztof Kozlowski <krzk@kernel.org> <k.kozlowski@samsung.com>
9192 Krzysztof Kozlowski <krzk@kernel.org> <k.kozlowski.k@gmail.com>
9293 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
9394 Leonid I Ananiev <leonid.i.ananiev@intel.com>
@@ -158,6 +159,8 @@ Valdis Kletnieks <Valdis.Kletnieks@vt.edu> · 64 unmodified lines
158159 Viresh Kumar <vireshk@kernel.org> <viresh.kumar@st.com>
159160 Viresh Kumar <vireshk@kernel.org> <viresh.linux@gmail.com>
160161 Viresh Kumar <vireshk@kernel.org> <viresh.kumar2@arm.com>
162+Vladimir Davydov <vdavydov.dev@gmail.com> <vdavydov@virtuozzo.com>
163+Vladimir Davydov <vdavydov.dev@gmail.com> <vdavydov@parallels.com>
161164 Takashi YOSHII <takashi.yoshii.zj@renesas.com>
162165 Yusuke Goda <goda.yusuke@renesas.com>
163166 Gustavo Padovan <gustavo@las.ic.unicamp.br>
Documentation/ABI/stable/sysfs-devices+1−1
@@ -1,7 +1,7 @@
11 # Note: This documents additional properties of any device beyond what
22 # is documented in Documentation/sysfs-rules.txt
33
4−What: /sys/devices/*/of_path
4+What: /sys/devices/*/of_node
55 Date: February 2015
66 Contact: Device Tree mailing list <devicetree@vger.kernel.org>
77 Description:
Documentation/PCI/MSI-HOWTO.txt+10−14
@@ -94,14 +94,11 @@ has a requirements for a minimum number of vectors the driver can pass a · 93 unmodified lines
9494 min_vecs argument set to this limit, and the PCI core will return -ENOSPC
9595 if it can't meet the minimum number of vectors.
9696
97−The flags argument should normally be set to 0, but can be used to pass the
98−PCI_IRQ_NOMSI and PCI_IRQ_NOMSIX flag in case a device claims to support
99−MSI or MSI-X, but the support is broken, or to pass PCI_IRQ_NOLEGACY in
100−case the device does not support legacy interrupt lines.
101−
102−By default this function will spread the interrupts around the available
103−CPUs, but this feature can be disabled by passing the PCI_IRQ_NOAFFINITY
104−flag.
97+The flags argument is used to specify which type of interrupt can be used
98+by the device and the driver (PCI_IRQ_LEGACY, PCI_IRQ_MSI, PCI_IRQ_MSIX).
99+A convenient short-hand (PCI_IRQ_ALL_TYPES) is also available to ask for
100+any possible kind of interrupt. If the PCI_IRQ_AFFINITY flag is set,
101+pci_alloc_irq_vectors() will spread the interrupts around the available CPUs.
105102
106103 To get the Linux IRQ numbers passed to request_irq() and free_irq() and the
107104 vectors, use the following function:
@@ -131,7 +128,7 @@ larger than the number supported by the device it will automatically be · 23 unmodified lines
131128 capped to the supported limit, so there is no need to query the number of
132129 vectors supported beforehand:
133130
134− nvec = pci_alloc_irq_vectors(pdev, 1, nvec, 0);
131+ nvec = pci_alloc_irq_vectors(pdev, 1, nvec, PCI_IRQ_ALL_TYPES)
135132 if (nvec < 0)
136133 goto out_err;
137134
@@ -140,7 +137,7 @@ interrupts it can request a particular number of interrupts by passing that · 2 unmodified lines
140137 number to pci_alloc_irq_vectors() function as both 'min_vecs' and
141138 'max_vecs' parameters:
142139
143− ret = pci_alloc_irq_vectors(pdev, nvec, nvec, 0);
140+ ret = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_ALL_TYPES);
144141 if (ret < 0)
145142 goto out_err;
146143
@@ -148,15 +145,14 @@ The most notorious example of the request type described above is enabling · 1 unmodified line
148145 the single MSI mode for a device. It could be done by passing two 1s as
149146 'min_vecs' and 'max_vecs':
150147
151− ret = pci_alloc_irq_vectors(pdev, 1, 1, 0);
148+ ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
152149 if (ret < 0)
153150 goto out_err;
154151
155152 Some devices might not support using legacy line interrupts, in which case
156−the PCI_IRQ_NOLEGACY flag can be used to fail the request if the platform
157−can't provide MSI or MSI-X interrupts:
153+the driver can specify that only MSI or MSI-X is acceptable:
158154
159− nvec = pci_alloc_irq_vectors(pdev, 1, nvec, PCI_IRQ_NOLEGACY);
155+ nvec = pci_alloc_irq_vectors(pdev, 1, nvec, PCI_IRQ_MSI | PCI_IRQ_MSIX);
160156 if (nvec < 0)
161157 goto out_err;
162158
Documentation/PCI/pci.txt+0−1
@@ -124,7 +124,6 @@ initialization with a pointer to a structure describing the driver · 123 unmodified lines
124124
125125 The ID table is an array of struct pci_device_id entries ending with an
126126 all-zero entry. Definitions with static const are generally preferred.
127−Use of the deprecated macro DEFINE_PCI_DEVICE_TABLE should be avoided.
128127
129128 Each entry consists of:
130129
Documentation/arm/CCN.txt+10−6
@@ -18,13 +18,17 @@ and config2 fields of the perf_event_attr structure. The "events" · 17 unmodified lines
1818 directory provides configuration templates for all documented
1919 events, that can be used with perf tool. For example "xp_valid_flit"
2020 is an equivalent of "type=0x8,event=0x4". Other parameters must be
21−explicitly specified. For events originating from device, "node"
22−defines its index. All crosspoint events require "xp" (index),
23−"port" (device port number) and "vc" (virtual channel ID) and
24−"dir" (direction). Watchpoints (special "event" value 0xfe) also
25−require comparator values ("cmp_l" and "cmp_h") and "mask", being
26−index of the comparator mask.
21+explicitly specified.
2722
23+For events originating from device, "node" defines its index.
24+
25+Crosspoint PMU events require "xp" (index), "bus" (bus number)
26+and "vc" (virtual channel ID).
27+
28+Crosspoint watchpoint-based events (special "event" value 0xfe)
29+require "xp" and "vc" as as above plus "port" (device port index),
30+"dir" (transmit/receive direction), comparator values ("cmp_l"
31+and "cmp_h") and "mask", being index of the comparator mask.
2832 Masks are defined separately from the event description
2933 (due to limited number of the config values) in the "cmp_mask"
3034 directory, with first 8 configurable by user and additional
Documentation/arm64/silicon-errata.txt+1−0
@@ -53,6 +53,7 @@ stable kernels. · 52 unmodified lines
5353 | ARM | Cortex-A57 | #832075 | ARM64_ERRATUM_832075 |
5454 | ARM | Cortex-A57 | #852523 | N/A |
5555 | ARM | Cortex-A57 | #834220 | ARM64_ERRATUM_834220 |
56+| ARM | Cortex-A72 | #853709 | N/A |
5657 | ARM | MMU-500 | #841119,#826419 | N/A |
5758 | | | | |
5859 | Cavium | ThunderX ITS | #22375, #24313 | CAVIUM_ERRATUM_22375 |
Documentation/conf.py+1−1
@@ -131,7 +131,7 @@ pygments_style = 'sphinx' · 130 unmodified lines
131131 todo_include_todos = False
132132
133133 primary_domain = 'C'
134−highlight_language = 'C'
134+highlight_language = 'guess'
135135
136136 # -- Options for HTML output ----------------------------------------------
137137
Documentation/cpu-freq/cpufreq-stats.txt+1−1
@@ -103,7 +103,7 @@ Config Main Menu · 102 unmodified lines
103103 Power management options (ACPI, APM) --->
104104 CPU Frequency scaling --->
105105 [*] CPU Frequency scaling
106− <*> CPU frequency translation statistics
106+ [*] CPU frequency translation statistics
107107 [*] CPU frequency translation statistics details
108108
109109
Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt+7−0
@@ -16,6 +16,11 @@ Required properties: · 15 unmodified lines
1616 - vref-supply: The regulator supply ADC reference voltage.
1717 - #io-channel-cells: Should be 1, see ../iio-bindings.txt
1818
19+Optional properties:
20+- resets: Must contain an entry for each entry in reset-names if need support
21+ this option. See ../reset/reset.txt for details.
22+- reset-names: Must include the name "saradc-apb".
23+
1924 Example:
2025 saradc: saradc@2006c000 {
2126 compatible = "rockchip,saradc";
@@ -23,6 +28,8 @@ Example: · 1 unmodified line
2328 interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
2429 clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>;
2530 clock-names = "saradc", "apb_pclk";
31+ resets = <&cru SRST_SARADC>;
32+ reset-names = "saradc-apb";
2633 #io-channel-cells = <1>;
2734 vref-supply = <&vcc18>;
2835 };
Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt+1−0
@@ -13,6 +13,7 @@ Required properties: · 12 unmodified lines
1313 - touchscreen-size-y : See touchscreen.txt
1414
1515 Optional properties:
16+- firmware-name : File basename (string) for board specific firmware
1617 - touchscreen-inverted-x : See touchscreen.txt
1718 - touchscreen-inverted-y : See touchscreen.txt
1819 - touchscreen-swapped-x-y : See touchscreen.txt
Documentation/devicetree/bindings/mmc/sdhci-st.txt+1−1
@@ -10,7 +10,7 @@ Required properties: · 9 unmodified lines
1010 subsystem (mmcss) inside the FlashSS (available in STiH407 SoC
1111 family).
1212
13−- clock-names: Should be "mmc".
13+- clock-names: Should be "mmc" and "icn". (NB: The latter is not compulsory)
1414 See: Documentation/devicetree/bindings/resource-names.txt
1515 - clocks: Phandle to the clock.
1616 See: Documentation/devicetree/bindings/clock/clock-bindings.txt
Documentation/devicetree/bindings/serial/8250.txt+0−19
@@ -42,9 +42,6 @@ Optional properties: · 41 unmodified lines
4242 - auto-flow-control: one way to enable automatic flow control support. The
4343 driver is allowed to detect support for the capability even without this
4444 property.
45−- {rts,cts,dtr,dsr,rng,dcd}-gpios: specify a GPIO for RTS/CTS/DTR/DSR/RI/DCD
46− line respectively. It will use specified GPIO instead of the peripheral
47− function pin for the UART feature. If unsure, don't specify this property.
4845
4946 Note:
5047 * fsl,ns16550:
@@ -66,19 +63,3 @@ Example: · 15 unmodified lines
6663 interrupts = <10>;
6764 reg-shift = <2>;
6865 };
69−
70−Example for OMAP UART using GPIO-based modem control signals:
71−
72− uart4: serial@49042000 {
73− compatible = "ti,omap3-uart";
74− reg = <0x49042000 0x400>;
75− interrupts = <80>;
76− ti,hwmods = "uart4";
77− clock-frequency = <48000000>;
78− cts-gpios = <&gpio3 5 GPIO_ACTIVE_LOW>;
79− rts-gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
80− dtr-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
81− dsr-gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
82− dcd-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
83− rng-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
84− };
Documentation/devicetree/bindings/sound/omap-mcpdm.txt+0−10
@@ -8,8 +8,6 @@ Required properties: · 7 unmodified lines
88 - interrupts: Interrupt number for McPDM
99 - interrupt-parent: The parent interrupt controller
1010 - ti,hwmods: Name of the hwmod associated to the McPDM
11−- clocks: phandle for the pdmclk provider, likely <&twl6040>
12−- clock-names: Must be "pdmclk"
1311
1412 Example:
1513
@@ -21,11 +19,3 @@ mcpdm: mcpdm@40132000 { · 5 unmodified lines
2119 interrupt-parent = <&gic>;
2220 ti,hwmods = "mcpdm";
2321 };
24−
25−In board DTS file the pdmclk needs to be added:
26−
27−&mcpdm {
28− clocks = <&twl6040>;
29− clock-names = "pdmclk";
30− status = "okay";
31−};
Documentation/devicetree/bindings/thermal/thermal.txt+5−5
@@ -62,7 +62,7 @@ For more examples of cooling devices, refer to the example sections below. · 61 unmodified lines
6262 Required properties:
6363 - #cooling-cells: Used to provide cooling device specific information
6464 Type: unsigned while referring to it. Must be at least 2, in order
65− Size: one cell to specify minimum and maximum cooling state used
65+ Size: one cell to specify minimum and maximum cooling state used
6666 in the reference. The first cell is the minimum
6767 cooling state requested and the second cell is
6868 the maximum cooling state requested in the reference.
@@ -119,7 +119,7 @@ Required properties: · 50 unmodified lines
119119 Optional property:
120120 - contribution: The cooling contribution to the thermal zone of the
121121 Type: unsigned referred cooling device at the referred trip point.
122− Size: one cell The contribution is a ratio of the sum
122+ Size: one cell The contribution is a ratio of the sum
123123 of all cooling contributions within a thermal zone.
124124
125125 Note: Using the THERMAL_NO_LIMIT (-1UL) constant in the cooling-device phandle
@@ -145,7 +145,7 @@ Required properties: · 19 unmodified lines
145145 Size: one cell
146146
147147 - thermal-sensors: A list of thermal sensor phandles and sensor specifier
148− Type: list of used while monitoring the thermal zone.
148+ Type: list of used while monitoring the thermal zone.
149149 phandles + sensor
150150 specifier
151151
@@ -473,7 +473,7 @@ thermal-zones { · 321 unmodified lines
473473 <&adc>; /* pcb north */
474474
475475 /* hotspot = 100 * bandgap - 120 * adc + 484 */
476− coefficients = <100 -120 484>;
476+ coefficients = <100 -120 484>;
477477
478478 trips {
479479 ...
@@ -502,7 +502,7 @@ from the ADC sensor. The binding would be then: · 22 unmodified lines
502502 thermal-sensors = <&adc>;
503503
504504 /* hotspot = 1 * adc + 6000 */
505− coefficients = <1 6000>;
505+ coefficients = <1 6000>;
506506
507507 (d) - Board thermal
508508
Documentation/filesystems/overlayfs.txt+3−5
@@ -183,12 +183,10 @@ The copy_up operation essentially creates a new, identical file and · 182 unmodified lines
183183 moves it over to the old name. The new file may be on a different
184184 filesystem, so both st_dev and st_ino of the file may change.
185185
186−Any open files referring to this inode will access the old data and
187−metadata. Similarly any file locks obtained before copy_up will not
188−apply to the copied up file.
186+Any open files referring to this inode will access the old data.
189187
190−On a file opened with O_RDONLY fchmod(2), fchown(2), futimesat(2) and
191−fsetxattr(2) will fail with EROFS.
188+Any file locks (and leases) obtained before copy_up will not apply
189+to the copied up file.
192190
193191 If a file with multiple hard links is copied up, then this will
194192 "break" the link. Changes will not be propagated to other names
Documentation/hwmon/ftsteutates+2−2
@@ -19,5 +19,5 @@ enhancements. It can monitor up to 4 voltages, 16 temperatures and · 18 unmodified lines
1919 implemented in this driver.
2020
2121 Specification of the chip can be found here:
22−ftp:///pub/Mainboard-OEM-Sales/Services/Software&Tools/Linux_SystemMonitoring&Watchdog&GPIO/BMC-Teutates_Specification_V1.21.pdf
23−ftp:///pub/Mainboard-OEM-Sales/Services/Software&Tools/Linux_SystemMonitoring&Watchdog&GPIO/Fujitsu_mainboards-1-Sensors_HowTo-en-US.pdf
22+ftp://ftp.ts.fujitsu.com/pub/Mainboard-OEM-Sales/Services/Software&Tools/Linux_SystemMonitoring&Watchdog&GPIO/BMC-Teutates_Specification_V1.21.pdf
23+ftp://ftp.ts.fujitsu.com/pub/Mainboard-OEM-Sales/Services/Software&Tools/Linux_SystemMonitoring&Watchdog&GPIO/Fujitsu_mainboards-1-Sensors_HowTo-en-US.pdf
Documentation/i2c/slave-interface+5−0
@@ -145,6 +145,11 @@ If you want to add slave support to the bus driver: · 144 unmodified lines
145145
146146 * Catch the slave interrupts and send appropriate i2c_slave_events to the backend.
147147
148+Note that most hardware supports being master _and_ slave on the same bus. So,
149+if you extend a bus driver, please make sure that the driver supports that as
150+well. In almost all cases, slave support does not need to disable the master
151+functionality.
152+
148153 Check the i2c-rcar driver as an example.
149154
150155
Documentation/kernel-documentation.rst+0−6
@@ -366,8 +366,6 @@ Domain`_ references. · 365 unmodified lines
366366 Cross-referencing from reStructuredText
367367 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
368368
369−.. highlight:: none
370−
371369 To cross-reference the functions and types defined in the kernel-doc comments
372370 from reStructuredText documents, please use the `Sphinx C Domain`_
373371 references. For example::
@@ -390,8 +388,6 @@ For further details, please refer to the `Sphinx C Domain`_ documentation. · 16 unmodified lines
390388 Function documentation
391389 ----------------------
392390
393−.. highlight:: c
394−
395391 The general format of a function and function-like macro kernel-doc comment is::
396392
397393 /**
@@ -572,8 +568,6 @@ DocBook XML [DEPRECATED] · 174 unmodified lines
572568 Converting DocBook to Sphinx
573569 ----------------------------
574570
575−.. highlight:: none
576−
577571 Over time, we expect all of the documents under ``Documentation/DocBook`` to be
578572 converted to Sphinx and reStructuredText. For most DocBook XML documents, a good
579573 enough solution is to use the simple ``Documentation/sphinx/tmplcvt`` script,
Documentation/kernel-parameters.txt+4−0
@@ -3032,6 +3032,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted. · 3031 unmodified lines
30323032 PAGE_SIZE is used as alignment.
30333033 PCI-PCI bridge can be specified, if resource
30343034 windows need to be expanded.
3035+ To specify the alignment for several
3036+ instances of a device, the PCI vendor,
3037+ device, subvendor, and subdevice may be
3038+ specified, e.g., 4096@pci:8086:9c22:103c:198f
30353039 ecrc= Enable/disable PCIe ECRC (transaction layer
30363040 end-to-end CRC checking).
30373041 bios: Use BIOS/firmware settings. This is the
Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst+20−1
@@ -144,7 +144,7 @@ logical address types are already defined will return with error ``EBUSY``. · 143 unmodified lines
144144
145145 - ``flags``
146146
147− - Flags. No flags are defined yet, so set this to 0.
147+ - Flags. See :ref:`cec-log-addrs-flags` for a list of available flags.
148148
149149 - .. row 7
150150
@@ -201,6 +201,25 @@ logical address types are already defined will return with error ``EBUSY``. · 50 unmodified lines
201201 give the CEC framework more information about the device type, even
202202 though the framework won't use it directly in the CEC message.
203203
204+.. _cec-log-addrs-flags:
205+
206+.. flat-table:: Flags for struct cec_log_addrs
207+ :header-rows: 0
208+ :stub-columns: 0
209+ :widths: 3 1 4
210+
211+
212+ - .. _`CEC-LOG-ADDRS-FL-ALLOW-UNREG-FALLBACK`:
213+
214+ - ``CEC_LOG_ADDRS_FL_ALLOW_UNREG_FALLBACK``
215+
216+ - 1
217+
218+ - By default if no logical address of the requested type can be claimed, then
219+ it will go back to the unconfigured state. If this flag is set, then it will
220+ fallback to the Unregistered logical address. Note that if the Unregistered
221+ logical address was explicitly requested, then this flag has no effect.
222+
204223 .. _cec-versions:
205224
206225 .. flat-table:: CEC Versions
Documentation/media/uapi/cec/cec-ioc-dqevent.rst+6−2
@@ -64,7 +64,8 @@ it is guaranteed that the state did change in between the two events. · 63 unmodified lines
6464
6565 - ``phys_addr``
6666
67− - The current physical address.
67+ - The current physical address. This is ``CEC_PHYS_ADDR_INVALID`` if no
68+ valid physical address is set.
6869
6970 - .. row 2
7071
@@ -72,7 +73,10 @@ it is guaranteed that the state did change in between the two events. · 1 unmodified line
7273
7374 - ``log_addr_mask``
7475
75− - The current set of claimed logical addresses.
76+ - The current set of claimed logical addresses. This is 0 if no logical
77+ addresses are claimed or if ``phys_addr`` is ``CEC_PHYS_ADDR_INVALID``.
78+ If bit 15 is set (``1 << CEC_LOG_ADDR_UNREGISTERED``) then this device
79+ has the unregistered logical address. In that case all other bits are 0.
7680
7781
7882
Documentation/networking/dsa/dsa.txt+0−20
@@ -587,26 +587,6 @@ of DSA, would be the its port-based VLAN, used by the associated bridge device. · 586 unmodified lines
587587 TODO
588588 ====
589589
590−The platform device problem
591−---------------------------
592−DSA is currently implemented as a platform device driver which is far from ideal
593−as was discussed in this thread:
594−
595−http://permalink.gmane.org/gmane.linux.network/329848
596−
597−This basically prevents the device driver model to be properly used and applied,
598−and support non-MDIO, non-MMIO Ethernet connected switches.
599−
600−Another problem with the platform device driver approach is that it prevents the
601−use of a modular switch drivers build due to a circular dependency, illustrated
602−here:
603−
604−http://comments.gmane.org/gmane.linux.network/345803
605−
606−Attempts of reworking this has been done here:
607−
608−https://lwn.net/Articles/643149/
609−
610590 Making SWITCHDEV and DSA converge towards an unified codebase
611591 -------------------------------------------------------------
612592
Documentation/networking/rxrpc.txt+11−10
@@ -790,13 +790,12 @@ The kernel interface functions are as follows: · 789 unmodified lines
790790 Data messages can have their contents extracted with the usual bunch of
791791 socket buffer manipulation functions. A data message can be determined to
792792 be the last one in a sequence with rxrpc_kernel_is_data_last(). When a
793− data message has been used up, rxrpc_kernel_data_delivered() should be
794− called on it..
793+ data message has been used up, rxrpc_kernel_data_consumed() should be
794+ called on it.
795795
796− Non-data messages should be handled to rxrpc_kernel_free_skb() to dispose
797− of. It is possible to get extra refs on all types of message for later
798− freeing, but this may pin the state of a call until the message is finally
799− freed.
796+ Messages should be handled to rxrpc_kernel_free_skb() to dispose of. It
797+ is possible to get extra refs on all types of message for later freeing,
798+ but this may pin the state of a call until the message is finally freed.
800799
801800 (*) Accept an incoming call.
802801
@@ -821,12 +820,14 @@ The kernel interface functions are as follows: · 18 unmodified lines
821820 Other errors may be returned if the call had been aborted (-ECONNABORTED)
822821 or had timed out (-ETIME).
823822
824− (*) Record the delivery of a data message and free it.
823+ (*) Record the delivery of a data message.
825824
826− void rxrpc_kernel_data_delivered(struct sk_buff *skb);
825+ void rxrpc_kernel_data_consumed(struct rxrpc_call *call,
826+ struct sk_buff *skb);
827827
828− This is used to record a data message as having been delivered and to
829− update the ACK state for the call. The socket buffer will be freed.
828+ This is used to record a data message as having been consumed and to
829+ update the ACK state for the call. The message must still be passed to
830+ rxrpc_kernel_free_skb() for disposal by the caller.
830831
831832 (*) Free a message.
832833
Documentation/power/basic-pm-debugging.txt+26−1
@@ -164,7 +164,32 @@ load n/2 modules more and try again. · 163 unmodified lines
164164 Again, if you find the offending module(s), it(they) must be unloaded every time
165165 before hibernation, and please report the problem with it(them).
166166
167−c) Advanced debugging
167+c) Using the "test_resume" hibernation option
168+
169+/sys/power/disk generally tells the kernel what to do after creating a
170+hibernation image. One of the available options is "test_resume" which
171+causes the just created image to be used for immediate restoration. Namely,
172+after doing:
173+
174+# echo test_resume > /sys/power/disk
175+# echo disk > /sys/power/state
176+
177+a hibernation image will be created and a resume from it will be triggered
178+immediately without involving the platform firmware in any way.
179+
180+That test can be used to check if failures to resume from hibernation are
181+related to bad interactions with the platform firmware. That is, if the above
182+works every time, but resume from actual hibernation does not work or is
183+unreliable, the platform firmware may be responsible for the failures.
184+
185+On architectures and platforms that support using different kernels to restore
186+hibernation images (that is, the kernel used to read the image from storage and
187+load it into memory is different from the one included in the image) or support
188+kernel address space randomization, it also can be used to check if failures
189+to resume may be related to the differences between the restore and image
190+kernels.
191+
192+d) Advanced debugging
168193
169194 In case that hibernation does not work on your system even in the minimal
170195 configuration and compiling more drivers as modules is not practical or some
Documentation/power/interface.txt+76−75
@@ -1,75 +1,76 @@
1−Power Management Interface
2−
3−
4−The power management subsystem provides a unified sysfs interface to
5−userspace, regardless of what architecture or platform one is
6−running. The interface exists in /sys/power/ directory (assuming sysfs
7−is mounted at /sys).
8−
9−/sys/power/state controls system power state. Reading from this file
10−returns what states are supported, which is hard-coded to 'freeze',
11−'standby' (Power-On Suspend), 'mem' (Suspend-to-RAM), and 'disk'
12−(Suspend-to-Disk).
13−
14−Writing to this file one of those strings causes the system to
15−transition into that state. Please see the file
16−Documentation/power/states.txt for a description of each of those
17−states.
18−
19−
20−/sys/power/disk controls the operating mode of the suspend-to-disk
21−mechanism. Suspend-to-disk can be handled in several ways. We have a
22−few options for putting the system to sleep - using the platform driver
23−(e.g. ACPI or other suspend_ops), powering off the system or rebooting the
24−system (for testing).
25−
26−Additionally, /sys/power/disk can be used to turn on one of the two testing
27−modes of the suspend-to-disk mechanism: 'testproc' or 'test'. If the
28−suspend-to-disk mechanism is in the 'testproc' mode, writing 'disk' to
29−/sys/power/state will cause the kernel to disable nonboot CPUs and freeze
30−tasks, wait for 5 seconds, unfreeze tasks and enable nonboot CPUs. If it is
31−in the 'test' mode, writing 'disk' to /sys/power/state will cause the kernel
32−to disable nonboot CPUs and freeze tasks, shrink memory, suspend devices, wait
33−for 5 seconds, resume devices, unfreeze tasks and enable nonboot CPUs. Then,
34−we are able to look in the log messages and work out, for example, which code
35−is being slow and which device drivers are misbehaving.
36−
37−Reading from this file will display all supported modes and the currently
38−selected one in brackets, for example
39−
40− [shutdown] reboot test testproc
41−
42−Writing to this file will accept one of
43−
44− 'platform' (only if the platform supports it)
45− 'shutdown'
46− 'reboot'
47− 'testproc'
48− 'test'
49−
50−/sys/power/image_size controls the size of the image created by
51−the suspend-to-disk mechanism. It can be written a string
52−representing a non-negative integer that will be used as an upper
53−limit of the image size, in bytes. The suspend-to-disk mechanism will
54−do its best to ensure the image size will not exceed that number. However,
55−if this turns out to be impossible, it will try to suspend anyway using the
56−smallest image possible. In particular, if "0" is written to this file, the
57−suspend image will be as small as possible.
58−
59−Reading from this file will display the current image size limit, which
60−is set to 2/5 of available RAM by default.
61−
62−/sys/power/pm_trace controls the code which saves the last PM event point in
63−the RTC across reboots, so that you can debug a machine that just hangs
64−during suspend (or more commonly, during resume). Namely, the RTC is only
65−used to save the last PM event point if this file contains '1'. Initially it
66−contains '0' which may be changed to '1' by writing a string representing a
67−nonzero integer into it.
68−
69−To use this debugging feature you should attempt to suspend the machine, then
70−reboot it and run
71−
72− dmesg -s 1000000 | grep 'hash matches'
73−
74−CAUTION: Using it will cause your machine's real-time (CMOS) clock to be
75−set to a random invalid time after a resume.
1+Power Management Interface for System Sleep
2+
3+Copyright (c) 2016 Intel Corp., Rafael J. Wysocki <rafael.j.wysocki@intel.com>
4+
5+The power management subsystem provides userspace with a unified sysfs interface
6+for system sleep regardless of the underlying system architecture or platform.
7+The interface is located in the /sys/power/ directory (assuming that sysfs is
8+mounted at /sys).
9+
10+/sys/power/state is the system sleep state control file.
11+
12+Reading from it returns a list of supported sleep states, encoded as:
13+
14+'freeze' (Suspend-to-Idle)
15+'standby' (Power-On Suspend)
16+'mem' (Suspend-to-RAM)
17+'disk' (Suspend-to-Disk)
18+
19+Suspend-to-Idle is always supported. Suspend-to-Disk is always supported
20+too as long the kernel has been configured to support hibernation at all
21+(ie. CONFIG_HIBERNATION is set in the kernel configuration file). Support
22+for Suspend-to-RAM and Power-On Suspend depends on the capabilities of the
23+platform.
24+
25+If one of the strings listed in /sys/power/state is written to it, the system
26+will attempt to transition into the corresponding sleep state. Refer to
27+Documentation/power/states.txt for a description of each of those states.
28+
29+/sys/power/disk controls the operating mode of hibernation (Suspend-to-Disk).
30+Specifically, it tells the kernel what to do after creating a hibernation image.
31+
32+Reading from it returns a list of supported options encoded as:
33+
34+'platform' (put the system into sleep using a platform-provided method)
35+'shutdown' (shut the system down)
36+'reboot' (reboot the system)
37+'suspend' (trigger a Suspend-to-RAM transition)
38+'test_resume' (resume-after-hibernation test mode)
39+
40+The currently selected option is printed in square brackets.
41+
42+The 'platform' option is only available if the platform provides a special
43+mechanism to put the system to sleep after creating a hibernation image (ACPI
44+does that, for example). The 'suspend' option is available if Suspend-to-RAM
45+is supported. Refer to Documentation/power/basic_pm_debugging.txt for the
46+description of the 'test_resume' option.
47+
48+To select an option, write the string representing it to /sys/power/disk.
49+
50+/sys/power/image_size controls the size of hibernation images.
51+
52+It can be written a string representing a non-negative integer that will be
53+used as a best-effort upper limit of the image size, in bytes. The hibernation
54+core will do its best to ensure that the image size will not exceed that number.
55+However, if that turns out to be impossible to achieve, a hibernation image will
56+still be created and its size will be as small as possible. In particular,
57+writing '0' to this file will enforce hibernation images to be as small as
58+possible.
59+
60+Reading from this file returns the current image size limit, which is set to
61+around 2/5 of available RAM by default.
62+
63+/sys/power/pm_trace controls the PM trace mechanism saving the last suspend
64+or resume event point in the RTC across reboots.
65+
66+It helps to debug hard lockups or reboots due to device driver failures that
67+occur during system suspend or resume (which is more common) more effectively.
68+
69+If /sys/power/pm_trace contains '1', the fingerprint of each suspend/resume
70+event point in turn will be stored in the RTC memory (overwriting the actual
71+RTC information), so it will survive a system crash if one occurs right after
72+storing it and it can be used later to identify the driver that caused the crash
73+to happen (see Documentation/power/s2ram.txt for more information).
74+
75+Initially it contains '0' which may be changed to '1' by writing a string
76+representing a nonzero integer into it.
Documentation/powerpc/transactional_memory.txt+2−0
@@ -167,6 +167,8 @@ signal will be rolled back anyway. · 166 unmodified lines
167167 For signals taken in non-TM or suspended mode, we use the
168168 normal/non-checkpointed stack pointer.
169169
170+Any transaction initiated inside a sighandler and suspended on return
171+from the sighandler to the kernel will get reclaimed and discarded.
170172
171173 Failure cause codes used by kernel
172174 ==================================
Documentation/rapidio/mport_cdev.txt+4−0
@@ -80,6 +80,10 @@ functionality of their platform when planning to use this driver: · 79 unmodified lines
8080
8181 III. Module parameters
8282
83+- 'dma_timeout' - DMA transfer completion timeout (in msec, default value 3000).
84+ This parameter set a maximum completion wait time for SYNC mode DMA
85+ transfer requests and for RIO_WAIT_FOR_ASYNC ioctl requests.
86+
8387 - 'dbg_level' - This parameter allows to control amount of debug information
8488 generated by this device driver. This parameter is formed by set of
8589 bit masks that correspond to the specific functional blocks.
Documentation/sphinx-static/theme_overrides.css+2−1
@@ -42,11 +42,12 @@ · 41 unmodified lines
4242 caption a.headerlink { opacity: 0; }
4343 caption a.headerlink:hover { opacity: 1; }
4444
45− /* inline literal: drop the borderbox and red color */
45+ /* inline literal: drop the borderbox, padding and red color */
4646
4747 code, .rst-content tt, .rst-content code {
4848 color: inherit;
4949 border: none;
50+ padding: unset;
5051 background: inherit;
5152 font-size: 85%;
5253 }
MAINTAINERS+56−20
@@ -798,6 +798,7 @@ M: Laura Abbott <labbott@redhat.com> · 797 unmodified lines
798798 M: Sumit Semwal <sumit.semwal@linaro.org>
799799 L: devel@driverdev.osuosl.org
800800 S: Supported
801+F: Documentation/devicetree/bindings/staging/ion/
801802 F: drivers/staging/android/ion
802803 F: drivers/staging/android/uapi/ion.h
803804 F: drivers/staging/android/uapi/ion_test.h
@@ -881,6 +882,15 @@ S: Supported · 77 unmodified lines
881882 F: drivers/gpu/drm/arc/
882883 F: Documentation/devicetree/bindings/display/snps,arcpgu.txt
883884
885+ARM ARCHITECTED TIMER DRIVER
886+M: Mark Rutland <mark.rutland@arm.com>
887+M: Marc Zyngier <marc.zyngier@arm.com>
888+L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
889+S: Maintained
890+F: arch/arm/include/asm/arch_timer.h
891+F: arch/arm64/include/asm/arch_timer.h
892+F: drivers/clocksource/arm_arch_timer.c
893+
884894 ARM HDLCD DRM DRIVER
885895 M: Liviu Dudau <liviu.dudau@arm.com>
886896 S: Supported
@@ -1614,7 +1624,8 @@ N: rockchip · 727 unmodified lines
16141624
16151625 ARM/SAMSUNG EXYNOS ARM ARCHITECTURES
16161626 M: Kukjin Kim <kgene@kernel.org>
1617−M: Krzysztof Kozlowski <k.kozlowski@samsung.com>
1627+M: Krzysztof Kozlowski <krzk@kernel.org>
1628+R: Javier Martinez Canillas <javier@osg.samsung.com>
16181629 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
16191630 L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
16201631 S: Maintained
@@ -1634,7 +1645,6 @@ F: drivers/*/*s3c64xx* · 13 unmodified lines
16341645 F: drivers/*/*s5pv210*
16351646 F: drivers/memory/samsung/*
16361647 F: drivers/soc/samsung/*
1637−F: drivers/spi/spi-s3c*
16381648 F: Documentation/arm/Samsung/
16391649 F: Documentation/devicetree/bindings/arm/samsung/
16401650 F: Documentation/devicetree/bindings/sram/samsung-sram.txt
@@ -1822,6 +1832,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson.git · 181 unmodified lines
18221832 ARM/UNIPHIER ARCHITECTURE
18231833 M: Masahiro Yamada <yamada.masahiro@socionext.com>
18241834 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1835+T: git git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier.git
18251836 S: Maintained
18261837 F: arch/arm/boot/dts/uniphier*
18271838 F: arch/arm/include/asm/hardware/cache-uniphier.h
@@ -2475,7 +2486,7 @@ F: include/net/bluetooth/ · 647 unmodified lines
24752486 BONDING DRIVER
24762487 M: Jay Vosburgh <j.vosburgh@gmail.com>
24772488 M: Veaceslav Falico <vfalico@gmail.com>
2478−M: Andy Gospodarek <gospo@cumulusnetworks.com>
2489+M: Andy Gospodarek <andy@greyhouse.net>
24792490 L: netdev@vger.kernel.org
24802491 W: http://sourceforge.net/projects/bonding/
24812492 S: Supported
@@ -2490,7 +2501,7 @@ S: Supported · 8 unmodified lines
24902501 F: kernel/bpf/
24912502
24922503 BROADCOM B44 10/100 ETHERNET DRIVER
2493−M: Gary Zambrano <zambrano@broadcom.com>
2504+M: Michael Chan <michael.chan@broadcom.com>
24942505 L: netdev@vger.kernel.org
24952506 S: Supported
24962507 F: drivers/net/ethernet/broadcom/b44.*
@@ -3238,7 +3249,7 @@ F: kernel/cpuset.c · 741 unmodified lines
32383249 CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)
32393250 M: Johannes Weiner <hannes@cmpxchg.org>
32403251 M: Michal Hocko <mhocko@kernel.org>
3241−M: Vladimir Davydov <vdavydov@virtuozzo.com>
3252+M: Vladimir Davydov <vdavydov.dev@gmail.com>
32423253 L: cgroups@vger.kernel.org
32433254 L: linux-mm@kvack.org
32443255 S: Maintained
@@ -3259,7 +3270,7 @@ S: Maintained · 14 unmodified lines
32593270 F: drivers/net/wan/cosa*
32603271
32613272 CPMAC ETHERNET DRIVER
3262−M: Florian Fainelli <florian@openwrt.org>
3273+M: Florian Fainelli <f.fainelli@gmail.com>
32633274 L: netdev@vger.kernel.org
32643275 S: Maintained
32653276 F: drivers/net/ethernet/ti/cpmac.c
@@ -4533,6 +4544,12 @@ L: linux-edac@vger.kernel.org · 1267 unmodified lines
45334544 S: Maintained
45344545 F: drivers/edac/sb_edac.c
45354546
4547+EDAC-SKYLAKE
4548+M: Tony Luck <tony.luck@intel.com>
4549+L: linux-edac@vger.kernel.org
4550+S: Maintained
4551+F: drivers/edac/skx_edac.c
4552+
45364553 EDAC-XGENE
45374554 APPLIED MICRO (APM) X-GENE SOC EDAC
45384555 M: Loc Ho <lho@apm.com>
@@ -6094,7 +6111,7 @@ S: Supported · 1555 unmodified lines
60946111 F: drivers/cpufreq/intel_pstate.c
60956112
60966113 INTEL FRAMEBUFFER DRIVER (excluding 810 and 815)
6097−M: Maik Broemme <mbroemme@plusserver.de>
6114+M: Maik Broemme <mbroemme@libmpq.org>
60986115 L: linux-fbdev@vger.kernel.org
60996116 S: Maintained
61006117 F: Documentation/fb/intelfb.txt
@@ -7457,7 +7474,8 @@ F: Documentation/devicetree/bindings/sound/max9860.txt · 1356 unmodified lines
74577474 F: sound/soc/codecs/max9860.*
74587475
74597476 MAXIM MUIC CHARGER DRIVERS FOR EXYNOS BASED BOARDS
7460−M: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7477+M: Krzysztof Kozlowski <krzk@kernel.org>
7478+M: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
74617479 L: linux-pm@vger.kernel.org
74627480 S: Supported
74637481 F: drivers/power/max14577_charger.c
@@ -7473,7 +7491,8 @@ F: include/dt-bindings/*/*max77802.h · 9 unmodified lines
74737491
74747492 MAXIM PMIC AND MUIC DRIVERS FOR EXYNOS BASED BOARDS
74757493 M: Chanwoo Choi <cw00.choi@samsung.com>
7476−M: Krzysztof Kozlowski <k.kozlowski@samsung.com>
7494+M: Krzysztof Kozlowski <krzk@kernel.org>
7495+M: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
74777496 L: linux-kernel@vger.kernel.org
74787497 S: Supported
74797498 F: drivers/*/max14577*.c
@@ -7663,7 +7682,7 @@ L: linux-rdma@vger.kernel.org · 183 unmodified lines
76637682 S: Supported
76647683 W: https://github.com/SoftRoCE/rxe-dev/wiki/rxe-dev:-Home
76657684 Q: http://patchwork.kernel.org/project/linux-rdma/list/
7666−F: drivers/infiniband/hw/rxe/
7685+F: drivers/infiniband/sw/rxe/
76677686 F: include/uapi/rdma/rdma_user_rxe.h
76687687
76697688 MEMBARRIER SUPPORT
@@ -8150,6 +8169,15 @@ S: Maintained · 480 unmodified lines
81508169 W: https://fedorahosted.org/dropwatch/
81518170 F: net/core/drop_monitor.c
81528171
8172+NETWORKING [DSA]
8173+M: Andrew Lunn <andrew@lunn.ch>
8174+M: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
8175+M: Florian Fainelli <f.fainelli@gmail.com>
8176+S: Maintained
8177+F: net/dsa/
8178+F: include/net/dsa.h
8179+F: drivers/net/dsa/
8180+
81538181 NETWORKING [GENERAL]
81548182 M: "David S. Miller" <davem@davemloft.net>
81558183 L: netdev@vger.kernel.org
@@ -9239,7 +9267,7 @@ F: drivers/pinctrl/sh-pfc/ · 1083 unmodified lines
92399267
92409268 PIN CONTROLLER - SAMSUNG
92419269 M: Tomasz Figa <tomasz.figa@gmail.com>
9242−M: Krzysztof Kozlowski <k.kozlowski@samsung.com>
9270+M: Krzysztof Kozlowski <krzk@kernel.org>
92439271 M: Sylwester Nawrocki <s.nawrocki@samsung.com>
92449272 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
92459273 L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
@@ -10172,7 +10200,7 @@ S: Maintained · 926 unmodified lines
1017210200 F: drivers/platform/x86/samsung-laptop.c
1017310201
1017410202 SAMSUNG AUDIO (ASoC) DRIVERS
10175−M: Krzysztof Kozlowski <k.kozlowski@samsung.com>
10203+M: Krzysztof Kozlowski <krzk@kernel.org>
1017610204 M: Sangbeom Kim <sbkim73@samsung.com>
1017710205 M: Sylwester Nawrocki <s.nawrocki@samsung.com>
1017810206 L: alsa-devel@alsa-project.org (moderated for non-subscribers)
@@ -10187,7 +10215,8 @@ F: drivers/video/fbdev/s3c-fb.c · 8 unmodified lines
1018710215
1018810216 SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS
1018910217 M: Sangbeom Kim <sbkim73@samsung.com>
10190−M: Krzysztof Kozlowski <k.kozlowski@samsung.com>
10218+M: Krzysztof Kozlowski <krzk@kernel.org>
10219+M: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
1019110220 L: linux-kernel@vger.kernel.org
1019210221 L: linux-samsung-soc@vger.kernel.org
1019310222 S: Supported
@@ -10246,6 +10275,17 @@ S: Supported · 52 unmodified lines
1024610275 L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
1024710276 F: drivers/clk/samsung/
1024810277
10278+SAMSUNG SPI DRIVERS
10279+M: Kukjin Kim <kgene@kernel.org>
10280+M: Krzysztof Kozlowski <krzk@kernel.org>
10281+M: Andi Shyti <andi.shyti@samsung.com>
10282+L: linux-spi@vger.kernel.org
10283+L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
10284+S: Maintained
10285+F: Documentation/devicetree/bindings/spi/spi-samsung.txt
10286+F: drivers/spi/spi-s3c*
10287+F: include/linux/platform_data/spi-s3c64xx.h
10288+
1024910289 SAMSUNG SXGBE DRIVERS
1025010290 M: Byungho An <bh74.an@samsung.com>
1025110291 M: Girish K S <ks.giri@samsung.com>
@@ -11225,12 +11265,8 @@ S: Odd Fixes · 973 unmodified lines
1122511265 F: drivers/staging/vt665?/
1122611266
1122711267 STAGING - WILC1000 WIFI DRIVER
11228−M: Johnny Kim <johnny.kim@atmel.com>
11229−M: Austin Shin <austin.shin@atmel.com>
11230−M: Chris Park <chris.park@atmel.com>
11231−M: Tony Cho <tony.cho@atmel.com>
11232−M: Glen Lee <glen.lee@atmel.com>
11233−M: Leo Kim <leo.kim@atmel.com>
11268+M: Aditya Shankar <aditya.shankar@microchip.com>
11269+M: Ganesh Krishna <ganesh.krishna@microchip.com>
1123411270 L: linux-wireless@vger.kernel.org
1123511271 S: Supported
1123611272 F: drivers/staging/wilc1000/
@@ -12550,7 +12586,7 @@ F: include/linux/if_*vlan.h · 1313 unmodified lines
1255012586 F: net/8021q/
1255112587
1255212588 VLYNQ BUS
12553−M: Florian Fainelli <florian@openwrt.org>
12589+M: Florian Fainelli <f.fainelli@gmail.com>
1255412590 L: openwrt-devel@lists.openwrt.org (subscribers-only)
1255512591 S: Maintained
1255612592 F: drivers/vlynq/vlynq.c
Makefile+1−1
@@ -1,7 +1,7 @@
11 VERSION = 4
22 PATCHLEVEL = 8
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc2
4+EXTRAVERSION = -rc8
55 NAME = Psychotic Stoned Sheep
66
77 # *DOCUMENTATION*
arch/Kconfig+0−11
@@ -336,17 +336,6 @@ config HAVE_ARCH_SECCOMP_FILTER · 335 unmodified lines
336336 results in the system call being skipped immediately.
337337 - seccomp syscall wired up
338338
339− For best performance, an arch should use seccomp_phase1 and
340− seccomp_phase2 directly. It should call seccomp_phase1 for all
341− syscalls if TIF_SECCOMP is set, but seccomp_phase1 does not
342− need to be called from a ptrace-safe context. It must then
343− call seccomp_phase2 if seccomp_phase1 returns anything other
344− than SECCOMP_PHASE1_OK or SECCOMP_PHASE1_SKIP.
345−
346− As an additional optimization, an arch may provide seccomp_data
347− directly to seccomp_phase1; this avoids multiple calls
348− to the syscall_xyz helpers for every syscall.
349−
350339 config SECCOMP_FILTER
351340 def_bool y
352341 depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
arch/alpha/include/asm/uaccess.h+8−11
@@ -371,14 +371,6 @@ __copy_tofrom_user_nocheck(void *to, const void *from, long len) · 370 unmodified lines
371371 return __cu_len;
372372 }
373373
374−extern inline long
375−__copy_tofrom_user(void *to, const void *from, long len, const void __user *validate)
376−{
377− if (__access_ok((unsigned long)validate, len, get_fs()))
378− len = __copy_tofrom_user_nocheck(to, from, len);
379− return len;
380−}
381−
382374 #define __copy_to_user(to, from, n) \
383375 ({ \
384376 __chk_user_ptr(to); \
@@ -393,17 +385,22 @@ __copy_tofrom_user(void *to, const void *from, long len, const void __user *vali · 8 unmodified lines
393385 #define __copy_to_user_inatomic __copy_to_user
394386 #define __copy_from_user_inatomic __copy_from_user
395387
396−
397388 extern inline long
398389 copy_to_user(void __user *to, const void *from, long n)
399390 {
400− return __copy_tofrom_user((__force void *)to, from, n, to);
391+ if (likely(__access_ok((unsigned long)to, n, get_fs())))
392+ n = __copy_tofrom_user_nocheck((__force void *)to, from, n);
393+ return n;
401394 }
402395
403396 extern inline long
404397 copy_from_user(void *to, const void __user *from, long n)
405398 {
406− return __copy_tofrom_user(to, (__force void *)from, n, from);
399+ if (likely(__access_ok((unsigned long)from, n, get_fs())))
400+ n = __copy_tofrom_user_nocheck(to, (__force void *)from, n);
401+ else
402+ memset(to, 0, n);
403+ return n;
407404 }
408405
409406 extern void __do_clear_user(void);
arch/arc/include/asm/entry.h+2−2
@@ -142,7 +142,7 @@ · 141 unmodified lines
142142
143143 #ifdef CONFIG_ARC_CURR_IN_REG
144144 ; Retrieve orig r25 and save it with rest of callee_regs
145− ld.as r12, [r12, PT_user_r25]
145+ ld r12, [r12, PT_user_r25]
146146 PUSH r12
147147 #else
148148 PUSH r25
@@ -198,7 +198,7 @@ · 49 unmodified lines
198198
199199 ; SP is back to start of pt_regs
200200 #ifdef CONFIG_ARC_CURR_IN_REG
201− st.as r12, [sp, PT_user_r25]
201+ st r12, [sp, PT_user_r25]
202202 #endif
203203 .endm
204204
arch/arc/include/asm/irqflags-compact.h+1−1
@@ -188,10 +188,10 @@ static inline int arch_irqs_disabled(void) · 187 unmodified lines
188188 .endm
189189
190190 .macro IRQ_ENABLE scratch
191+ TRACE_ASM_IRQ_ENABLE
191192 lr \scratch, [status32]
192193 or \scratch, \scratch, (STATUS_E1_MASK | STATUS_E2_MASK)
193194 flag \scratch
194− TRACE_ASM_IRQ_ENABLE
195195 .endm
196196
197197 #endif /* __ASSEMBLY__ */
arch/arc/include/asm/pgtable.h+1−1
@@ -280,7 +280,7 @@ static inline void pmd_set(pmd_t *pmdp, pte_t *ptep) · 279 unmodified lines
280280
281281 #define pte_page(pte) pfn_to_page(pte_pfn(pte))
282282 #define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)
283−#define pfn_pte(pfn, prot) (__pte(((pte_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot)))
283+#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
284284
285285 /* Don't use virt_to_pfn for macros below: could cause truncations for PAE40*/
286286 #define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)
arch/arc/include/asm/uaccess.h+9−2
@@ -83,7 +83,10 @@ · 82 unmodified lines
8383 "2: ;nop\n" \
8484 " .section .fixup, \"ax\"\n" \
8585 " .align 4\n" \
86− "3: mov %0, %3\n" \
86+ "3: # return -EFAULT\n" \
87+ " mov %0, %3\n" \
88+ " # zero out dst ptr\n" \
89+ " mov %1, 0\n" \
8790 " j 2b\n" \
8891 " .previous\n" \
8992 " .section __ex_table, \"a\"\n" \
@@ -101,7 +104,11 @@ · 11 unmodified lines
101104 "2: ;nop\n" \
102105 " .section .fixup, \"ax\"\n" \
103106 " .align 4\n" \
104− "3: mov %0, %3\n" \
107+ "3: # return -EFAULT\n" \
108+ " mov %0, %3\n" \
109+ " # zero out dst ptr\n" \
110+ " mov %1, 0\n" \
111+ " mov %R1, 0\n" \
105112 " j 2b\n" \
106113 " .previous\n" \
107114 " .section __ex_table, \"a\"\n" \
arch/arc/include/uapi/asm/elf.h+9−2
@@ -13,8 +13,15 @@ · 12 unmodified lines
1313
1414 /* Machine specific ELF Hdr flags */
1515 #define EF_ARC_OSABI_MSK 0x00000f00
16−#define EF_ARC_OSABI_ORIG 0x00000000 /* MUST be zero for back-compat */
17−#define EF_ARC_OSABI_CURRENT 0x00000300 /* v3 (no legacy syscalls) */
16+
17+#define EF_ARC_OSABI_V3 0x00000300 /* v3 (no legacy syscalls) */
18+#define EF_ARC_OSABI_V4 0x00000400 /* v4 (64bit data any reg align) */
19+
20+#if __GNUC__ < 6
21+#define EF_ARC_OSABI_CURRENT EF_ARC_OSABI_V3
22+#else
23+#define EF_ARC_OSABI_CURRENT EF_ARC_OSABI_V4
24+#endif
1825
1926 typedef unsigned long elf_greg_t;
2027 typedef unsigned long elf_fpregset_t;
arch/arc/kernel/arcksyms.c+2−0
@@ -28,6 +28,7 @@ extern void __muldf3(void); · 27 unmodified lines
2828 extern void __divdf3(void);
2929 extern void __floatunsidf(void);
3030 extern void __floatunsisf(void);
31+extern void __udivdi3(void);
3132
3233 EXPORT_SYMBOL(__ashldi3);
3334 EXPORT_SYMBOL(__ashrdi3);
@@ -45,6 +46,7 @@ EXPORT_SYMBOL(__muldf3); · 11 unmodified lines
4546 EXPORT_SYMBOL(__divdf3);
4647 EXPORT_SYMBOL(__floatunsidf);
4748 EXPORT_SYMBOL(__floatunsisf);
49+EXPORT_SYMBOL(__udivdi3);
4850
4951 /* ARC optimised assembler routines */
5052 EXPORT_SYMBOL(memset);
arch/arc/kernel/process.c+1−1
@@ -199,7 +199,7 @@ int elf_check_arch(const struct elf32_hdr *x) · 198 unmodified lines
199199 }
200200
201201 eflags = x->e_flags;
202− if ((eflags & EF_ARC_OSABI_MSK) < EF_ARC_OSABI_CURRENT) {
202+ if ((eflags & EF_ARC_OSABI_MSK) != EF_ARC_OSABI_CURRENT) {
203203 pr_err("ABI mismatch - you need newer toolchain\n");
204204 force_sigsegv(SIGSEGV, current);
205205 return 0;
arch/arc/kernel/setup.c+4−2
@@ -291,8 +291,10 @@ static char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len) · 290 unmodified lines
291291 cpu->dccm.base_addr, TO_KB(cpu->dccm.sz),
292292 cpu->iccm.base_addr, TO_KB(cpu->iccm.sz));
293293
294− n += scnprintf(buf + n, len - n,
295− "OS ABI [v3]\t: no-legacy-syscalls\n");
294+ n += scnprintf(buf + n, len - n, "OS ABI [v%d]\t: %s\n",
295+ EF_ARC_OSABI_CURRENT >> 8,
296+ EF_ARC_OSABI_CURRENT == EF_ARC_OSABI_V3 ?
297+ "no-legacy-syscalls" : "64-bit data any register aligned");
296298
297299 return buf;
298300 }
arch/arc/mm/cache.c+9−0
@@ -921,6 +921,15 @@ void arc_cache_init(void) · 920 unmodified lines
921921
922922 printk(arc_cache_mumbojumbo(0, str, sizeof(str)));
923923
924+ /*
925+ * Only master CPU needs to execute rest of function:
926+ * - Assume SMP so all cores will have same cache config so
927+ * any geomtry checks will be same for all
928+ * - IOC setup / dma callbacks only need to be setup once
929+ */
930+ if (cpu)
931+ return;
932+
924933 if (IS_ENABLED(CONFIG_ARC_HAS_ICACHE)) {
925934 struct cpuinfo_arc_cache *ic = &cpuinfo_arc700[cpu].icache;
926935
arch/arc/mm/highmem.c+1−0
@@ -61,6 +61,7 @@ void *kmap(struct page *page) · 60 unmodified lines
6161
6262 return kmap_high(page);
6363 }
64+EXPORT_SYMBOL(kmap);
6465
6566 void *kmap_atomic(struct page *page)
6667 {
arch/arm/boot/dts/am335x-baltos.dtsi+1−1
@@ -226,7 +226,7 @@ · 225 unmodified lines
226226
227227 #address-cells = <1>;
228228 #size-cells = <1>;
229− elm_id = <&elm>;
229+ ti,elm-id = <&elm>;
230230 };
231231 };
232232
arch/arm/boot/dts/am335x-igep0033.dtsi+1−1
@@ -161,7 +161,7 @@ · 160 unmodified lines
161161
162162 #address-cells = <1>;
163163 #size-cells = <1>;
164− elm_id = <&elm>;
164+ ti,elm-id = <&elm>;
165165
166166 /* MTD partition table */
167167 partition@0 {
arch/arm/boot/dts/am335x-phycore-som.dtsi+1−1
@@ -197,7 +197,7 @@ · 196 unmodified lines
197197 gpmc,wr-access-ns = <30>;
198198 gpmc,wr-data-mux-bus-ns = <0>;
199199
200− elm_id = <&elm>;
200+ ti,elm-id = <&elm>;
201201
202202 #address-cells = <1>;
203203 #size-cells = <1>;
arch/arm/boot/dts/armada-388-clearfog.dts+4−4
@@ -390,12 +390,12 @@ · 389 unmodified lines
390390
391391 port@0 {
392392 reg = <0>;
393− label = "lan1";
393+ label = "lan5";
394394 };
395395
396396 port@1 {
397397 reg = <1>;
398− label = "lan2";
398+ label = "lan4";
399399 };
400400
401401 port@2 {
@@ -405,12 +405,12 @@ · 3 unmodified lines
405405
406406 port@3 {
407407 reg = <3>;
408− label = "lan4";
408+ label = "lan2";
409409 };
410410
411411 port@4 {
412412 reg = <4>;
413− label = "lan5";
413+ label = "lan1";
414414 };
415415
416416 port@5 {
arch/arm/boot/dts/bcm2835-rpi.dtsi+1−0
@@ -2,6 +2,7 @@ · 1 unmodified line
22
33 / {
44 memory {
5+ device_type = "memory";
56 reg = <0 0x10000000>;
67 };
78
arch/arm/boot/dts/bcm283x.dtsi+2−1
@@ -2,7 +2,6 @@ · 1 unmodified line
22 #include <dt-bindings/clock/bcm2835.h>
33 #include <dt-bindings/clock/bcm2835-aux.h>
44 #include <dt-bindings/gpio/gpio.h>
5−#include "skeleton.dtsi"
65
76 /* This include file covers the common peripherals and configuration between
87 * bcm2835 and bcm2836 implementations, leaving the CPU configuration to
@@ -13,6 +12,8 @@ · 4 unmodified lines
1312 compatible = "brcm,bcm2835";
1413 model = "BCM2835";
1514 interrupt-parent = <&intc>;
15+ #address-cells = <1>;
16+ #size-cells = <1>;
1617
1718 chosen {
1819 bootargs = "earlyprintk console=ttyAMA0";
arch/arm/boot/dts/exynos5410-odroidxu.dts+0−3
@@ -447,14 +447,11 @@ · 446 unmodified lines
447447 samsung,dw-mshc-ciu-div = <3>;
448448 samsung,dw-mshc-sdr-timing = <0 4>;
449449 samsung,dw-mshc-ddr-timing = <0 2>;
450− samsung,dw-mshc-hs400-timing = <0 2>;
451− samsung,read-strobe-delay = <90>;
452450 pinctrl-names = "default";
453451 pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus1 &sd0_bus4 &sd0_bus8 &sd0_cd>;
454452 bus-width = <8>;
455453 cap-mmc-highspeed;
456454 mmc-hs200-1_8v;
457− mmc-hs400-1_8v;
458455 vmmc-supply = <&ldo20_reg>;
459456 vqmmc-supply = <&ldo11_reg>;
460457 };
arch/arm/boot/dts/imx6qdl.dtsi+1−1
@@ -243,7 +243,7 @@ · 242 unmodified lines
243243 clocks = <&clks IMX6QDL_CLK_SPDIF_GCLK>, <&clks IMX6QDL_CLK_OSC>,
244244 <&clks IMX6QDL_CLK_SPDIF>, <&clks IMX6QDL_CLK_ASRC>,
245245 <&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_ESAI_EXTAL>,
246− <&clks IMX6QDL_CLK_IPG>, <&clks IMX6QDL_CLK_MLB>,
246+ <&clks IMX6QDL_CLK_IPG>, <&clks IMX6QDL_CLK_DUMMY>,
247247 <&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_SPBA>;
248248 clock-names = "core", "rxtx0",
249249 "rxtx1", "rxtx2",
arch/arm/boot/dts/imx6sx-sabreauto.dts+1−1
@@ -64,7 +64,7 @@ · 63 unmodified lines
6464 cd-gpios = <&gpio7 11 GPIO_ACTIVE_LOW>;
6565 no-1-8-v;
6666 keep-power-in-suspend;
67− enable-sdio-wakup;
67+ wakeup-source;
6868 status = "okay";
6969 };
7070
arch/arm/boot/dts/imx7d-sdb.dts+1−1
@@ -131,7 +131,7 @@ · 130 unmodified lines
131131 ti,y-min = /bits/ 16 <0>;
132132 ti,y-max = /bits/ 16 <0>;
133133 ti,pressure-max = /bits/ 16 <0>;
134− ti,x-plat-ohms = /bits/ 16 <400>;
134+ ti,x-plate-ohms = /bits/ 16 <400>;
135135 wakeup-source;
136136 };
137137 };
arch/arm/boot/dts/kirkwood-ib62x0.dts+1−1
@@ -113,7 +113,7 @@ · 112 unmodified lines
113113
114114 partition@e0000 {
115115 label = "u-boot environment";
116− reg = <0xe0000 0x100000>;
116+ reg = <0xe0000 0x20000>;
117117 };
118118
119119 partition@100000 {
arch/arm/boot/dts/kirkwood-openrd.dtsi+4−0
@@ -116,6 +116,10 @@ · 115 unmodified lines
116116 };
117117 };
118118
119+&pciec {
120+ status = "okay";
121+};
122+
119123 &pcie0 {
120124 status = "okay";
121125 };
arch/arm/boot/dts/logicpd-som-lv.dtsi+6−5
@@ -35,10 +35,15 @@ · 34 unmodified lines
3535 ranges = <0 0 0x00000000 0x1000000>; /* CS0: 16MB for NAND */
3636
3737 nand@0,0 {
38− linux,mtd-name = "micron,mt29f4g16abbda3w";
38+ compatible = "ti,omap2-nand";
3939 reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
40+ interrupt-parent = <&gpmc>;
41+ interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
42+ <1 IRQ_TYPE_NONE>; /* termcount */
43+ linux,mtd-name = "micron,mt29f4g16abbda3w";
4044 nand-bus-width = <16>;
4145 ti,nand-ecc-opt = "bch8";
46+ rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */
4247 gpmc,sync-clk-ps = <0>;
4348 gpmc,cs-on-ns = <0>;
4449 gpmc,cs-rd-off-ns = <44>;
@@ -54,10 +59,6 @@ · 9 unmodified lines
5459 gpmc,wr-access-ns = <40>;
5560 gpmc,wr-data-mux-bus-ns = <0>;
5661 gpmc,device-width = <2>;
57−
58− gpmc,page-burst-access-ns = <5>;
59− gpmc,cycle2cycle-delay-ns = <50>;
60−
6162 #address-cells = <1>;
6263 #size-cells = <1>;
6364
arch/arm/boot/dts/logicpd-torpedo-som.dtsi+1−0
@@ -46,6 +46,7 @@ · 45 unmodified lines
4646 linux,mtd-name = "micron,mt29f4g16abbda3w";
4747 nand-bus-width = <16>;
4848 ti,nand-ecc-opt = "bch8";
49+ rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */
4950 gpmc,sync-clk-ps = <0>;
5051 gpmc,cs-on-ns = <0>;
5152 gpmc,cs-rd-off-ns = <44>;
arch/arm/boot/dts/omap3-overo-base.dtsi+3−1
@@ -223,7 +223,9 @@ · 222 unmodified lines
223223 };
224224
225225 &gpmc {
226− ranges = <0 0 0x00000000 0x20000000>;
226+ ranges = <0 0 0x30000000 0x1000000>, /* CS0 */
227+ <4 0 0x2b000000 0x1000000>, /* CS4 */
228+ <5 0 0x2c000000 0x1000000>; /* CS5 */
227229
228230 nand@0,0 {
229231 compatible = "ti,omap2-nand";
arch/arm/boot/dts/omap3-overo-chestnut43-common.dtsi+0−2
@@ -55,8 +55,6 @@ · 54 unmodified lines
5555 #include "omap-gpmc-smsc9221.dtsi"
5656
5757 &gpmc {
58− ranges = <5 0 0x2c000000 0x1000000>; /* CS5 */
59−
6058 ethernet@gpmc {
6159 reg = <5 0 0xff>;
6260 interrupt-parent = <&gpio6>;
arch/arm/boot/dts/omap3-overo-tobi-common.dtsi+0−2
@@ -27,8 +27,6 @@ · 26 unmodified lines
2727 #include "omap-gpmc-smsc9221.dtsi"
2828
2929 &gpmc {
30− ranges = <5 0 0x2c000000 0x1000000>; /* CS5 */
31−
3230 ethernet@gpmc {
3331 reg = <5 0 0xff>;
3432 interrupt-parent = <&gpio6>;
arch/arm/boot/dts/omap3-overo-tobiduo-common.dtsi+0−3
@@ -15,9 +15,6 @@ · 14 unmodified lines
1515 #include "omap-gpmc-smsc9221.dtsi"
1616
1717 &gpmc {
18− ranges = <4 0 0x2b000000 0x1000000>, /* CS4 */
19− <5 0 0x2c000000 0x1000000>; /* CS5 */
20−
2118 smsc1: ethernet@gpmc {
2219 reg = <5 0 0xff>;
2320 interrupt-parent = <&gpio6>;
arch/arm/boot/dts/rk3066a.dtsi+2−0
@@ -197,6 +197,8 @@ · 196 unmodified lines
197197 clock-names = "saradc", "apb_pclk";
198198 interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
199199 #io-channel-cells = <1>;
200+ resets = <&cru SRST_SARADC>;
201+ reset-names = "saradc-apb";
200202 status = "disabled";
201203 };
202204
arch/arm/boot/dts/rk3288.dtsi+2−0
@@ -279,6 +279,8 @@ · 278 unmodified lines
279279 #io-channel-cells = <1>;
280280 clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>;
281281 clock-names = "saradc", "apb_pclk";
282+ resets = <&cru SRST_SARADC>;
283+ reset-names = "saradc-apb";
282284 status = "disabled";
283285 };
284286
arch/arm/boot/dts/rk3xxx.dtsi+2−0
@@ -399,6 +399,8 @@ · 398 unmodified lines
399399 #io-channel-cells = <1>;
400400 clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>;
401401 clock-names = "saradc", "apb_pclk";
402+ resets = <&cru SRST_SARADC>;
403+ reset-names = "saradc-apb";
402404 status = "disabled";
403405 };
404406
arch/arm/boot/dts/stih407-family.dtsi+6−4
@@ -550,8 +550,9 @@ · 549 unmodified lines
550550 interrupt-names = "mmcirq";
551551 pinctrl-names = "default";
552552 pinctrl-0 = <&pinctrl_mmc0>;
553− clock-names = "mmc";
554− clocks = <&clk_s_c0_flexgen CLK_MMC_0>;
553+ clock-names = "mmc", "icn";
554+ clocks = <&clk_s_c0_flexgen CLK_MMC_0>,
555+ <&clk_s_c0_flexgen CLK_RX_ICN_HVA>;
555556 bus-width = <8>;
556557 non-removable;
557558 };
@@ -565,8 +566,9 @@ · 7 unmodified lines
565566 interrupt-names = "mmcirq";
566567 pinctrl-names = "default";
567568 pinctrl-0 = <&pinctrl_sd1>;
568− clock-names = "mmc";
569− clocks = <&clk_s_c0_flexgen CLK_MMC_1>;
569+ clock-names = "mmc", "icn";
570+ clocks = <&clk_s_c0_flexgen CLK_MMC_1>,
571+ <&clk_s_c0_flexgen CLK_RX_ICN_HVA>;
570572 resets = <&softreset STIH407_MMC1_SOFTRESET>;
571573 bus-width = <4>;
572574 };
arch/arm/boot/dts/stih410.dtsi+8−4
@@ -41,7 +41,8 @@ · 40 unmodified lines
4141 compatible = "st,st-ohci-300x";
4242 reg = <0x9a03c00 0x100>;
4343 interrupts = <GIC_SPI 180 IRQ_TYPE_NONE>;
44− clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>;
44+ clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>,
45+ <&clk_s_c0_flexgen CLK_RX_ICN_DISP_0>;
4546 resets = <&powerdown STIH407_USB2_PORT0_POWERDOWN>,
4647 <&softreset STIH407_USB2_PORT0_SOFTRESET>;
4748 reset-names = "power", "softreset";
@@ -57,7 +58,8 @@ · 9 unmodified lines
5758 interrupts = <GIC_SPI 151 IRQ_TYPE_NONE>;
5859 pinctrl-names = "default";
5960 pinctrl-0 = <&pinctrl_usb0>;
60− clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>;
61+ clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>,
62+ <&clk_s_c0_flexgen CLK_RX_ICN_DISP_0>;
6163 resets = <&powerdown STIH407_USB2_PORT0_POWERDOWN>,
6264 <&softreset STIH407_USB2_PORT0_SOFTRESET>;
6365 reset-names = "power", "softreset";
@@ -71,7 +73,8 @@ · 7 unmodified lines
7173 compatible = "st,st-ohci-300x";
7274 reg = <0x9a83c00 0x100>;
7375 interrupts = <GIC_SPI 181 IRQ_TYPE_NONE>;
74− clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>;
76+ clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>,
77+ <&clk_s_c0_flexgen CLK_RX_ICN_DISP_0>;
7578 resets = <&powerdown STIH407_USB2_PORT1_POWERDOWN>,
7679 <&softreset STIH407_USB2_PORT1_SOFTRESET>;
7780 reset-names = "power", "softreset";
@@ -87,7 +90,8 @@ · 9 unmodified lines
8790 interrupts = <GIC_SPI 153 IRQ_TYPE_NONE>;
8891 pinctrl-names = "default";
8992 pinctrl-0 = <&pinctrl_usb1>;
90− clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>;
93+ clocks = <&clk_s_c0_flexgen CLK_TX_ICN_DISP_0>,
94+ <&clk_s_c0_flexgen CLK_RX_ICN_DISP_0>;
9195 resets = <&powerdown STIH407_USB2_PORT1_POWERDOWN>,
9296 <&softreset STIH407_USB2_PORT1_SOFTRESET>;
9397 reset-names = "power", "softreset";
arch/arm/boot/dts/sun5i-a13.dtsi+1−1
@@ -84,7 +84,7 @@ · 83 unmodified lines
8484 trips {
8585 cpu_alert0: cpu_alert0 {
8686 /* milliCelsius */
87− temperature = <850000>;
87+ temperature = <85000>;
8888 hysteresis = <2000>;
8989 type = "passive";
9090 };
arch/arm/boot/dts/tegra114-dalmore.dts+1−1
@@ -897,7 +897,7 @@ · 896 unmodified lines
897897 palmas: tps65913@58 {
898898 compatible = "ti,palmas";
899899 reg = <0x58>;
900− interrupts = <0 86 IRQ_TYPE_LEVEL_LOW>;
900+ interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>;
901901
902902 #interrupt-cells = <2>;
903903 interrupt-controller;
arch/arm/boot/dts/tegra114-roth.dts+1−1
@@ -802,7 +802,7 @@ · 801 unmodified lines
802802 palmas: pmic@58 {
803803 compatible = "ti,palmas";
804804 reg = <0x58>;
805− interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_LOW>;
805+ interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
806806
807807 #interrupt-cells = <2>;
808808 interrupt-controller;
arch/arm/boot/dts/tegra114-tn7.dts+1−1
@@ -63,7 +63,7 @@ · 62 unmodified lines
6363 palmas: pmic@58 {
6464 compatible = "ti,palmas";
6565 reg = <0x58>;
66− interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_LOW>;
66+ interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
6767
6868 #interrupt-cells = <2>;
6969 interrupt-controller;
arch/arm/boot/dts/tegra124-jetson-tk1.dts+2−2
@@ -1382,7 +1382,7 @@ · 1381 unmodified lines
13821382 * Pin 41: BR_UART1_TXD
13831383 * Pin 44: BR_UART1_RXD
13841384 */
1385− serial@0,70006000 {
1385+ serial@70006000 {
13861386 compatible = "nvidia,tegra124-hsuart", "nvidia,tegra30-hsuart";
13871387 status = "okay";
13881388 };
@@ -1394,7 +1394,7 @@ · 5 unmodified lines
13941394 * Pin 71: UART2_CTS_L
13951395 * Pin 74: UART2_RTS_L
13961396 */
1397− serial@0,70006040 {
1397+ serial@70006040 {
13981398 compatible = "nvidia,tegra124-hsuart", "nvidia,tegra30-hsuart";
13991399 status = "okay";
14001400 };
arch/arm/common/locomo.c+2−3
@@ -140,7 +140,7 @@ static struct locomo_dev_info locomo_devices[] = { · 139 unmodified lines
140140
141141 static void locomo_handler(struct irq_desc *desc)
142142 {
143− struct locomo *lchip = irq_desc_get_chip_data(desc);
143+ struct locomo *lchip = irq_desc_get_handler_data(desc);
144144 int req, i;
145145
146146 /* Acknowledge the parent IRQ */
@@ -200,8 +200,7 @@ static void locomo_setup_irq(struct locomo *lchip) · 53 unmodified lines
200200 * Install handler for IRQ_LOCOMO_HW.
201201 */
202202 irq_set_irq_type(lchip->irq, IRQ_TYPE_EDGE_FALLING);
203− irq_set_chip_data(lchip->irq, lchip);
204− irq_set_chained_handler(lchip->irq, locomo_handler);
203+ irq_set_chained_handler_and_data(lchip->irq, locomo_handler, lchip);
205204
206205 /* Install handlers for IRQ_LOCOMO_* */
207206 for ( ; irq <= lchip->irq_base + 3; irq++) {
arch/arm/common/sa1111.c+19−13
@@ -472,8 +472,8 @@ static int sa1111_setup_irq(struct sa1111 *sachip, unsigned irq_base) · 471 unmodified lines
472472 * specifies that S0ReadyInt and S1ReadyInt should be '1'.
473473 */
474474 sa1111_writel(0, irqbase + SA1111_INTPOL0);
475− sa1111_writel(SA1111_IRQMASK_HI(IRQ_S0_READY_NINT) |
476− SA1111_IRQMASK_HI(IRQ_S1_READY_NINT),
475+ sa1111_writel(BIT(IRQ_S0_READY_NINT & 31) |
476+ BIT(IRQ_S1_READY_NINT & 31),
477477 irqbase + SA1111_INTPOL1);
478478
479479 /* clear all IRQs */
@@ -754,7 +754,7 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq) · 274 unmodified lines
754754 if (sachip->irq != NO_IRQ) {
755755 ret = sa1111_setup_irq(sachip, pd->irq_base);
756756 if (ret)
757− goto err_unmap;
757+ goto err_clk;
758758 }
759759
760760 #ifdef CONFIG_ARCH_SA1100
@@ -799,6 +799,8 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq) · 38 unmodified lines
799799
800800 return 0;
801801
802+ err_clk:
803+ clk_disable(sachip->clk);
802804 err_unmap:
803805 iounmap(sachip->base);
804806 err_clk_unprep:
@@ -869,9 +871,9 @@ struct sa1111_save_data { · 64 unmodified lines
869871
870872 #ifdef CONFIG_PM
871873
872−static int sa1111_suspend(struct platform_device *dev, pm_message_t state)
874+static int sa1111_suspend_noirq(struct device *dev)
873875 {
874− struct sa1111 *sachip = platform_get_drvdata(dev);
876+ struct sa1111 *sachip = dev_get_drvdata(dev);
875877 struct sa1111_save_data *save;
876878 unsigned long flags;
877879 unsigned int val;
@@ -934,9 +936,9 @@ static int sa1111_suspend(struct platform_device *dev, pm_message_t state) · 56 unmodified lines
934936 * restored by their respective drivers, and must be called
935937 * via LDM after this function.
936938 */
937−static int sa1111_resume(struct platform_device *dev)
939+static int sa1111_resume_noirq(struct device *dev)
938940 {
939− struct sa1111 *sachip = platform_get_drvdata(dev);
941+ struct sa1111 *sachip = dev_get_drvdata(dev);
940942 struct sa1111_save_data *save;
941943 unsigned long flags, id;
942944 void __iomem *base;
@@ -952,7 +954,7 @@ static int sa1111_resume(struct platform_device *dev) · 9 unmodified lines
952954 id = sa1111_readl(sachip->base + SA1111_SKID);
953955 if ((id & SKID_ID_MASK) != SKID_SA1111_ID) {
954956 __sa1111_remove(sachip);
955− platform_set_drvdata(dev, NULL);
957+ dev_set_drvdata(dev, NULL);
956958 kfree(save);
957959 return 0;
958960 }
@@ -1003,8 +1005,8 @@ static int sa1111_resume(struct platform_device *dev) · 44 unmodified lines
10031005 }
10041006
10051007 #else
1006−#define sa1111_suspend NULL
1007−#define sa1111_resume NULL
1008+#define sa1111_suspend_noirq NULL
1009+#define sa1111_resume_noirq NULL
10081010 #endif
10091011
10101012 static int sa1111_probe(struct platform_device *pdev)
@@ -1017,7 +1019,7 @@ static int sa1111_probe(struct platform_device *pdev) · 6 unmodified lines
10171019 return -EINVAL;
10181020 irq = platform_get_irq(pdev, 0);
10191021 if (irq < 0)
1020− return -ENXIO;
1022+ return irq;
10211023
10221024 return __sa1111_probe(&pdev->dev, mem, irq);
10231025 }
@@ -1038,6 +1040,11 @@ static int sa1111_remove(struct platform_device *pdev) · 14 unmodified lines
10381040 return 0;
10391041 }
10401042
1043+static struct dev_pm_ops sa1111_pm_ops = {
1044+ .suspend_noirq = sa1111_suspend_noirq,
1045+ .resume_noirq = sa1111_resume_noirq,
1046+};
1047+
10411048 /*
10421049 * Not sure if this should be on the system bus or not yet.
10431050 * We really want some way to register a system device at
@@ -1050,10 +1057,9 @@ static int sa1111_remove(struct platform_device *pdev) · 6 unmodified lines
10501057 static struct platform_driver sa1111_device_driver = {
10511058 .probe = sa1111_probe,
10521059 .remove = sa1111_remove,
1053− .suspend = sa1111_suspend,
1054− .resume = sa1111_resume,
10551060 .driver = {
10561061 .name = "sa1111",
1062+ .pm = &sa1111_pm_ops,
10571063 },
10581064 };
10591065
arch/arm/configs/keystone_defconfig+1−0
@@ -161,6 +161,7 @@ CONFIG_USB_MON=y · 160 unmodified lines
161161 CONFIG_USB_XHCI_HCD=y
162162 CONFIG_USB_STORAGE=y
163163 CONFIG_USB_DWC3=y
164+CONFIG_NOP_USB_XCEIV=y
164165 CONFIG_KEYSTONE_USB_PHY=y
165166 CONFIG_NEW_LEDS=y
166167 CONFIG_LEDS_CLASS=y
arch/arm/configs/multi_v7_defconfig+1−1
@@ -781,7 +781,7 @@ CONFIG_MXS_DMA=y · 780 unmodified lines
781781 CONFIG_DMA_BCM2835=y
782782 CONFIG_DMA_OMAP=y
783783 CONFIG_QCOM_BAM_DMA=y
784−CONFIG_XILINX_VDMA=y
784+CONFIG_XILINX_DMA=y
785785 CONFIG_DMA_SUN6I=y
786786 CONFIG_STAGING=y
787787 CONFIG_SENSORS_ISL29018=y
arch/arm/crypto/aes-ce-glue.c+1−1
@@ -284,7 +284,7 @@ static int ctr_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst, · 283 unmodified lines
284284 err = blkcipher_walk_done(desc, &walk,
285285 walk.nbytes % AES_BLOCK_SIZE);
286286 }
287− if (nbytes) {
287+ if (walk.nbytes % AES_BLOCK_SIZE) {
288288 u8 *tdst = walk.dst.virt.addr + blocks * AES_BLOCK_SIZE;
289289 u8 *tsrc = walk.src.virt.addr + blocks * AES_BLOCK_SIZE;
290290 u8 __aligned(8) tail[AES_BLOCK_SIZE];
arch/arm/include/asm/pgtable-2level-hwdef.h+1−0
@@ -47,6 +47,7 @@ · 46 unmodified lines
4747 #define PMD_SECT_WB (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
4848 #define PMD_SECT_MINICACHE (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE)
4949 #define PMD_SECT_WBWA (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
50+#define PMD_SECT_CACHE_MASK (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
5051 #define PMD_SECT_NONSHARED_DEV (PMD_SECT_TEX(2))
5152
5253 /*
arch/arm/include/asm/pgtable-3level-hwdef.h+1−0
@@ -62,6 +62,7 @@ · 61 unmodified lines
6262 #define PMD_SECT_WT (_AT(pmdval_t, 2) << 2) /* normal inner write-through */
6363 #define PMD_SECT_WB (_AT(pmdval_t, 3) << 2) /* normal inner write-back */
6464 #define PMD_SECT_WBWA (_AT(pmdval_t, 7) << 2) /* normal inner write-alloc */
65+#define PMD_SECT_CACHE_MASK (_AT(pmdval_t, 7) << 2)
6566
6667 /*
6768 * + Level 3 descriptor (PTE)
arch/arm/kernel/entry-armv.S+1−0
@@ -295,6 +295,7 @@ __und_svc_fault: · 294 unmodified lines
295295 bl __und_fault
296296
297297 __und_svc_finish:
298+ get_thread_info tsk
298299 ldr r5, [sp, #S_PSR] @ Get SVC cpsr
299300 svc_exit r5 @ return from exception
300301 UNWIND(.fnend )
arch/arm/kernel/hyp-stub.S+13−0
@@ -142,6 +142,19 @@ ARM_BE8(orr r7, r7, #(1 << 25)) @ HSCTLR.EE · 141 unmodified lines
142142 and r7, #0x1f @ Preserve HPMN
143143 mcr p15, 4, r7, c1, c1, 1 @ HDCR
144144
145+ @ Make sure NS-SVC is initialised appropriately
146+ mrc p15, 0, r7, c1, c0, 0 @ SCTLR
147+ orr r7, #(1 << 5) @ CP15 barriers enabled
148+ bic r7, #(3 << 7) @ Clear SED/ITD for v8 (RES0 for v7)
149+ bic r7, #(3 << 19) @ WXN and UWXN disabled
150+ mcr p15, 0, r7, c1, c0, 0 @ SCTLR
151+
152+ mrc p15, 0, r7, c0, c0, 0 @ MIDR
153+ mcr p15, 4, r7, c0, c0, 0 @ VPIDR
154+
155+ mrc p15, 0, r7, c0, c0, 5 @ MPIDR
156+ mcr p15, 4, r7, c0, c0, 5 @ VMPIDR
157+
145158 #if !defined(ZIMAGE) && defined(CONFIG_ARM_ARCH_TIMER)
146159 @ make CNTP_* and CNTPCT accessible from PL1
147160 mrc p15, 0, r7, c0, c1, 1 @ ID_PFR1
arch/arm/kvm/arm.c+0−2
@@ -158,8 +158,6 @@ void kvm_arch_destroy_vm(struct kvm *kvm) · 157 unmodified lines
158158 {
159159 int i;
160160
161− kvm_free_stage2_pgd(kvm);
162−
163161 for (i = 0; i < KVM_MAX_VCPUS; ++i) {
164162 if (kvm->vcpus[i]) {
165163 kvm_arch_vcpu_free(kvm->vcpus[i]);
arch/arm/kvm/mmu.c+4−2
@@ -1309,7 +1309,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, · 1308 unmodified lines
13091309 smp_rmb();
13101310
13111311 pfn = gfn_to_pfn_prot(kvm, gfn, write_fault, &writable);
1312− if (is_error_pfn(pfn))
1312+ if (is_error_noslot_pfn(pfn))
13131313 return -EFAULT;
13141314
13151315 if (kvm_is_device_pfn(pfn)) {
@@ -1714,7 +1714,8 @@ int kvm_mmu_init(void) · 398 unmodified lines
17141714 kern_hyp_va(PAGE_OFFSET), kern_hyp_va(~0UL));
17151715
17161716 if (hyp_idmap_start >= kern_hyp_va(PAGE_OFFSET) &&
1717− hyp_idmap_start < kern_hyp_va(~0UL)) {
1717+ hyp_idmap_start < kern_hyp_va(~0UL) &&
1718+ hyp_idmap_start != (unsigned long)__hyp_idmap_text_start) {
17181719 /*
17191720 * The idmap page is intersecting with the VA space,
17201721 * it is not safe to continue further.
@@ -1893,6 +1894,7 @@ void kvm_arch_memslots_updated(struct kvm *kvm, struct kvm_memslots *slots) · 172 unmodified lines
18931894
18941895 void kvm_arch_flush_shadow_all(struct kvm *kvm)
18951896 {
1897+ kvm_free_stage2_pgd(kvm);
18961898 }
18971899
18981900 void kvm_arch_flush_shadow_memslot(struct kvm *kvm,
arch/arm/mach-exynos/suspend.c+6−0
@@ -255,6 +255,12 @@ static int __init exynos_pmu_irq_init(struct device_node *node, · 254 unmodified lines
255255 return -ENOMEM;
256256 }
257257
258+ /*
259+ * Clear the OF_POPULATED flag set in of_irq_init so that
260+ * later the Exynos PMU platform device won't be skipped.
261+ */
262+ of_node_clear_flag(node, OF_POPULATED);
263+
258264 return 0;
259265 }
260266
arch/arm/mach-imx/gpc.c+6−0
@@ -271,6 +271,12 @@ static int __init imx_gpc_init(struct device_node *node, · 270 unmodified lines
271271 for (i = 0; i < IMR_NUM; i++)
272272 writel_relaxed(~0, gpc_base + GPC_IMR1 + i * 4);
273273
274+ /*
275+ * Clear the OF_POPULATED flag set in of_irq_init so that
276+ * later the GPC power domain driver will not be skipped.
277+ */
278+ of_node_clear_flag(node, OF_POPULATED);
279+
274280 return 0;
275281 }
276282 IRQCHIP_DECLARE(imx_gpc, "fsl,imx6q-gpc", imx_gpc_init);
arch/arm/mach-imx/mach-imx6ul.c+1−0
@@ -64,6 +64,7 @@ static void __init imx6ul_init_machine(void) · 63 unmodified lines
6464 if (parent == NULL)
6565 pr_warn("failed to initialize soc device\n");
6666
67+ of_platform_default_populate(NULL, NULL, parent);
6768 imx6ul_enet_init();
6869 imx_anatop_init();
6970 imx6ul_pm_init();
arch/arm/mach-imx/pm-imx6.c+2−2
@@ -295,7 +295,7 @@ int imx6_set_lpm(enum mxc_cpu_pwr_mode mode) · 294 unmodified lines
295295 val &= ~BM_CLPCR_SBYOS;
296296 if (cpu_is_imx6sl())
297297 val |= BM_CLPCR_BYPASS_PMIC_READY;
298− if (cpu_is_imx6sl() || cpu_is_imx6sx())
298+ if (cpu_is_imx6sl() || cpu_is_imx6sx() || cpu_is_imx6ul())
299299 val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;
300300 else
301301 val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
@@ -310,7 +310,7 @@ int imx6_set_lpm(enum mxc_cpu_pwr_mode mode) · 8 unmodified lines
310310 val |= 0x3 << BP_CLPCR_STBY_COUNT;
311311 val |= BM_CLPCR_VSTBY;
312312 val |= BM_CLPCR_SBYOS;
313− if (cpu_is_imx6sl())
313+ if (cpu_is_imx6sl() || cpu_is_imx6sx())
314314 val |= BM_CLPCR_BYPASS_PMIC_READY;
315315 if (cpu_is_imx6sl() || cpu_is_imx6sx() || cpu_is_imx6ul())
316316 val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;
arch/arm/mach-omap2/cm33xx.c+0−6
@@ -220,9 +220,6 @@ static int am33xx_cm_wait_module_ready(u8 part, s16 inst, u16 clkctrl_offs, · 219 unmodified lines
220220 {
221221 int i = 0;
222222
223− if (!clkctrl_offs)
224− return 0;
225−
226223 omap_test_timeout(_is_module_ready(inst, clkctrl_offs),
227224 MAX_MODULE_READY_TIME, i);
228225
@@ -246,9 +243,6 @@ static int am33xx_cm_wait_module_idle(u8 part, s16 inst, u16 clkctrl_offs, · 17 unmodified lines
246243 {
247244 int i = 0;
248245
249− if (!clkctrl_offs)
250− return 0;
251−
252246 omap_test_timeout((_clkctrl_idlest(inst, clkctrl_offs) ==
253247 CLKCTRL_IDLEST_DISABLED),
254248 MAX_MODULE_READY_TIME, i);
arch/arm/mach-omap2/cminst44xx.c+0−6
@@ -278,9 +278,6 @@ static int omap4_cminst_wait_module_ready(u8 part, s16 inst, u16 clkctrl_offs, · 277 unmodified lines
278278 {
279279 int i = 0;
280280
281− if (!clkctrl_offs)
282− return 0;
283−
284281 omap_test_timeout(_is_module_ready(part, inst, clkctrl_offs),
285282 MAX_MODULE_READY_TIME, i);
286283
@@ -304,9 +301,6 @@ static int omap4_cminst_wait_module_idle(u8 part, s16 inst, u16 clkctrl_offs, · 17 unmodified lines
304301 {
305302 int i = 0;
306303
307− if (!clkctrl_offs)
308− return 0;
309−
310304 omap_test_timeout((_clkctrl_idlest(part, inst, clkctrl_offs) ==
311305 CLKCTRL_IDLEST_DISABLED),
312306 MAX_MODULE_DISABLE_TIME, i);
arch/arm/mach-omap2/omap_hwmod.c+8−0
@@ -1053,6 +1053,10 @@ static int _omap4_wait_target_disable(struct omap_hwmod *oh) · 1052 unmodified lines
10531053 if (oh->flags & HWMOD_NO_IDLEST)
10541054 return 0;
10551055
1056+ if (!oh->prcm.omap4.clkctrl_offs &&
1057+ !(oh->prcm.omap4.flags & HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET))
1058+ return 0;
1059+
10561060 return omap_cm_wait_module_idle(oh->clkdm->prcm_partition,
10571061 oh->clkdm->cm_inst,
10581062 oh->prcm.omap4.clkctrl_offs, 0);
@@ -2971,6 +2975,10 @@ static int _omap4_wait_target_ready(struct omap_hwmod *oh) · 1912 unmodified lines
29712975 if (!_find_mpu_rt_port(oh))
29722976 return 0;
29732977
2978+ if (!oh->prcm.omap4.clkctrl_offs &&
2979+ !(oh->prcm.omap4.flags & HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET))
2980+ return 0;
2981+
29742982 /* XXX check module SIDLEMODE, hardreset status */
29752983
29762984 return omap_cm_wait_module_ready(oh->clkdm->prcm_partition,
arch/arm/mach-omap2/omap_hwmod.h+4−0
@@ -443,8 +443,12 @@ struct omap_hwmod_omap2_prcm { · 442 unmodified lines
443443 * HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT: Some IP blocks don't have a PRCM
444444 * module-level context loss register associated with them; this
445445 * flag bit should be set in those cases
446+ * HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET: Some IP blocks have a valid CLKCTRL
447+ * offset of zero; this flag bit should be set in those cases to
448+ * distinguish from hwmods that have no clkctrl offset.
446449 */
447450 #define HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT (1 << 0)
451+#define HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET (1 << 1)
448452
449453 /**
450454 * struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c+2−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #define CLKCTRL(oh, clkctrl) ((oh).prcm.omap4.clkctrl_offs = (clkctrl))
3030 #define RSTCTRL(oh, rstctrl) ((oh).prcm.omap4.rstctrl_offs = (rstctrl))
3131 #define RSTST(oh, rstst) ((oh).prcm.omap4.rstst_offs = (rstst))
32+#define PRCM_FLAGS(oh, flag) ((oh).prcm.omap4.flags = (flag))
3233
3334 /*
3435 * 'l3' class
@@ -1296,6 +1297,7 @@ static void omap_hwmod_am33xx_clkctrl(void) · 1261 unmodified lines
12961297 CLKCTRL(am33xx_i2c1_hwmod, AM33XX_CM_WKUP_I2C0_CLKCTRL_OFFSET);
12971298 CLKCTRL(am33xx_wd_timer1_hwmod, AM33XX_CM_WKUP_WDT1_CLKCTRL_OFFSET);
12981299 CLKCTRL(am33xx_rtc_hwmod, AM33XX_CM_RTC_RTC_CLKCTRL_OFFSET);
1300+ PRCM_FLAGS(am33xx_rtc_hwmod, HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET);
12991301 CLKCTRL(am33xx_mmc2_hwmod, AM33XX_CM_PER_MMC2_CLKCTRL_OFFSET);
13001302 CLKCTRL(am33xx_gpmc_hwmod, AM33XX_CM_PER_GPMC_CLKCTRL_OFFSET);
13011303 CLKCTRL(am33xx_l4_ls_hwmod, AM33XX_CM_PER_L4LS_CLKCTRL_OFFSET);
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c+12−0
@@ -722,8 +722,20 @@ static struct omap_hwmod omap3xxx_dss_dispc_hwmod = { · 721 unmodified lines
722722 * display serial interface controller
723723 */
724724
725+static struct omap_hwmod_class_sysconfig omap3xxx_dsi_sysc = {
726+ .rev_offs = 0x0000,
727+ .sysc_offs = 0x0010,
728+ .syss_offs = 0x0014,
729+ .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
730+ SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
731+ SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
732+ .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
733+ .sysc_fields = &omap_hwmod_sysc_type1,
734+};
735+
725736 static struct omap_hwmod_class omap3xxx_dsi_hwmod_class = {
726737 .name = "dsi",
738+ .sysc = &omap3xxx_dsi_sysc,
727739 };
728740
729741 static struct omap_hwmod_irq_info omap3xxx_dsi1_irqs[] = {
arch/arm/mach-pxa/idp.c+2−1
@@ -83,7 +83,8 @@ static struct resource smc91x_resources[] = { · 82 unmodified lines
8383 };
8484
8585 static struct smc91x_platdata smc91x_platdata = {
86− .flags = SMC91X_USE_32BIT | SMC91X_USE_DMA | SMC91X_NOWAIT,
86+ .flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_USE_32BIT |
87+ SMC91X_USE_DMA | SMC91X_NOWAIT,
8788 };
8889
8990 static struct platform_device smc91x_device = {
arch/arm/mach-pxa/lubbock.c+14−0
@@ -137,6 +137,18 @@ static struct pxa2xx_udc_mach_info udc_info __initdata = { · 136 unmodified lines
137137 // no D+ pullup; lubbock can't connect/disconnect in software
138138 };
139139
140+static void lubbock_init_pcmcia(void)
141+{
142+ struct clk *clk;
143+
144+ /* Add an alias for the SA1111 PCMCIA clock */
145+ clk = clk_get_sys("pxa2xx-pcmcia", NULL);
146+ if (!IS_ERR(clk)) {
147+ clkdev_create(clk, NULL, "1800");
148+ clk_put(clk);
149+ }
150+}
151+
140152 static struct resource sa1111_resources[] = {
141153 [0] = {
142154 .start = 0x10000000,
@@ -467,6 +479,8 @@ static void __init lubbock_init(void) · 324 unmodified lines
467479 pxa_set_btuart_info(NULL);
468480 pxa_set_stuart_info(NULL);
469481
482+ lubbock_init_pcmcia();
483+
470484 clk_add_alias("SA1111_CLK", NULL, "GPIO11_CLK", NULL);
471485 pxa_set_udc_info(&udc_info);
472486 pxa_set_fb_info(NULL, &sharp_lm8v31);
arch/arm/mach-pxa/xcep.c+2−1
@@ -120,7 +120,8 @@ static struct resource smc91x_resources[] = { · 119 unmodified lines
120120 };
121121
122122 static struct smc91x_platdata xcep_smc91x_info = {
123− .flags = SMC91X_USE_32BIT | SMC91X_NOWAIT | SMC91X_USE_DMA,
123+ .flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_USE_32BIT |
124+ SMC91X_NOWAIT | SMC91X_USE_DMA,
124125 };
125126
126127 static struct platform_device smc91x_device = {
arch/arm/mach-realview/core.c+2−1
@@ -93,7 +93,8 @@ static struct smsc911x_platform_config smsc911x_config = { · 92 unmodified lines
9393 };
9494
9595 static struct smc91x_platdata smc91x_platdata = {
96− .flags = SMC91X_USE_32BIT | SMC91X_NOWAIT,
96+ .flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_USE_32BIT |
97+ SMC91X_NOWAIT,
9798 };
9899
99100 static struct platform_device realview_eth_device = {
arch/arm/mach-sa1100/clock.c+3−2
@@ -125,6 +125,8 @@ static unsigned long clk_36864_get_rate(struct clk *clk) · 124 unmodified lines
125125 }
126126
127127 static struct clkops clk_36864_ops = {
128+ .enable = clk_cpu_enable,
129+ .disable = clk_cpu_disable,
128130 .get_rate = clk_36864_get_rate,
129131 };
130132
@@ -140,9 +142,8 @@ static struct clk_lookup sa11xx_clkregs[] = { · 9 unmodified lines
140142 CLKDEV_INIT(NULL, "OSTIMER0", &clk_36864),
141143 };
142144
143−static int __init sa11xx_clk_init(void)
145+int __init sa11xx_clk_init(void)
144146 {
145147 clkdev_add_table(sa11xx_clkregs, ARRAY_SIZE(sa11xx_clkregs));
146148 return 0;
147149 }
148−core_initcall(sa11xx_clk_init);
arch/arm/mach-sa1100/generic.c+4−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434
3535 #include <mach/hardware.h>
3636 #include <mach/irqs.h>
37+#include <mach/reset.h>
3738
3839 #include "generic.h"
3940 #include <clocksource/pxa.h>
@@ -95,6 +96,8 @@ static void sa1100_power_off(void) · 55 unmodified lines
9596
9697 void sa11x0_restart(enum reboot_mode mode, const char *cmd)
9798 {
99+ clear_reset_status(RESET_STATUS_ALL);
100+
98101 if (mode == REBOOT_SOFT) {
99102 /* Jump into ROM at address 0 */
100103 soft_restart(0);
@@ -388,6 +391,7 @@ void __init sa1100_init_irq(void) · 287 unmodified lines
388391 sa11x0_init_irq_nodt(IRQ_GPIO0_SC, irq_resource.start);
389392
390393 sa1100_init_gpio();
394+ sa11xx_clk_init();
391395 }
392396
393397 /*
arch/arm/mach-sa1100/generic.h+2−0
@@ -44,3 +44,5 @@ int sa11x0_pm_init(void); · 43 unmodified lines
4444 #else
4545 static inline int sa11x0_pm_init(void) { return 0; }
4646 #endif
47+
48+int sa11xx_clk_init(void);
arch/arm/mach-sa1100/pleb.c+1−1
@@ -45,7 +45,7 @@ static struct resource smc91x_resources[] = { · 44 unmodified lines
4545 };
4646
4747 static struct smc91x_platdata smc91x_platdata = {
48− .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
48+ .flags = SMC91X_USE_16BIT | SMC91X_USE_8BIT | SMC91X_NOWAIT,
4949 };
5050
5151 static struct platform_device smc91x_device = {
arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c+26−36
@@ -41,39 +41,26 @@ · 40 unmodified lines
4141
4242 #define REGULATOR_IRQ_MASK BIT(2) /* IRQ2, active low */
4343
44−static void __iomem *irqc;
45−
46−static const u8 da9063_mask_regs[] = {
47− DA9063_REG_IRQ_MASK_A,
48− DA9063_REG_IRQ_MASK_B,
49− DA9063_REG_IRQ_MASK_C,
50− DA9063_REG_IRQ_MASK_D,
51−};
52−
53−/* DA9210 System Control and Event Registers */
44+/* start of DA9210 System Control and Event Registers */
5445 #define DA9210_REG_MASK_A 0x54
55−#define DA9210_REG_MASK_B 0x55
56−
57−static const u8 da9210_mask_regs[] = {
58− DA9210_REG_MASK_A,
59− DA9210_REG_MASK_B,
60−};
61−
62−static void da9xxx_mask_irqs(struct i2c_client *client, const u8 regs[],
63− unsigned int nregs)
64−{
65− unsigned int i;
6646
67− dev_info(&client->dev, "Masking %s interrupt sources\n", client->name);
47+static void __iomem *irqc;
6848
69− for (i = 0; i < nregs; i++) {
70− int error = i2c_smbus_write_byte_data(client, regs[i], ~0);
71− if (error) {
72− dev_err(&client->dev, "i2c error %d\n", error);
73− return;
74− }
75− }
76−}
49+/* first byte sets the memory pointer, following are consecutive reg values */
50+static u8 da9063_irq_clr[] = { DA9063_REG_IRQ_MASK_A, 0xff, 0xff, 0xff, 0xff };
51+static u8 da9210_irq_clr[] = { DA9210_REG_MASK_A, 0xff, 0xff };
52+
53+static struct i2c_msg da9xxx_msgs[2] = {
54+ {
55+ .addr = 0x58,
56+ .len = ARRAY_SIZE(da9063_irq_clr),
57+ .buf = da9063_irq_clr,
58+ }, {
59+ .addr = 0x68,
60+ .len = ARRAY_SIZE(da9210_irq_clr),
61+ .buf = da9210_irq_clr,
62+ },
63+};
7764
7865 static int regulator_quirk_notify(struct notifier_block *nb,
7966 unsigned long action, void *data)
@@ -93,12 +80,15 @@ static int regulator_quirk_notify(struct notifier_block *nb, · 13 unmodified lines
9380 client = to_i2c_client(dev);
9481 dev_dbg(dev, "Detected %s\n", client->name);
9582
96− if ((client->addr == 0x58 && !strcmp(client->name, "da9063")))
97− da9xxx_mask_irqs(client, da9063_mask_regs,
98− ARRAY_SIZE(da9063_mask_regs));
99− else if (client->addr == 0x68 && !strcmp(client->name, "da9210"))
100− da9xxx_mask_irqs(client, da9210_mask_regs,
101− ARRAY_SIZE(da9210_mask_regs));
83+ if ((client->addr == 0x58 && !strcmp(client->name, "da9063")) ||
84+ (client->addr == 0x68 && !strcmp(client->name, "da9210"))) {
85+ int ret;
86+
87+ dev_info(&client->dev, "clearing da9063/da9210 interrupts\n");
88+ ret = i2c_transfer(client->adapter, da9xxx_msgs, ARRAY_SIZE(da9xxx_msgs));
89+ if (ret != ARRAY_SIZE(da9xxx_msgs))
90+ dev_err(&client->dev, "i2c error %d\n", ret);
91+ }
10292
10393 mon = ioread32(irqc + IRQC_MONITOR);
10494 if (mon & REGULATOR_IRQ_MASK)
arch/arm/mm/mmu.c+17−6
@@ -137,7 +137,7 @@ void __init init_default_cache_policy(unsigned long pmd) · 136 unmodified lines
137137
138138 initial_pmd_value = pmd;
139139
140− pmd &= PMD_SECT_TEX(1) | PMD_SECT_BUFFERABLE | PMD_SECT_CACHEABLE;
140+ pmd &= PMD_SECT_CACHE_MASK;
141141
142142 for (i = 0; i < ARRAY_SIZE(cache_policies); i++)
143143 if (cache_policies[i].pmd == pmd) {
@@ -728,7 +728,8 @@ static void *__init late_alloc(unsigned long sz) · 584 unmodified lines
728728 {
729729 void *ptr = (void *)__get_free_pages(PGALLOC_GFP, get_order(sz));
730730
731− BUG_ON(!ptr);
731+ if (!ptr || !pgtable_page_ctor(virt_to_page(ptr)))
732+ BUG();
732733 return ptr;
733734 }
734735
@@ -1155,10 +1156,19 @@ void __init sanity_check_meminfo(void) · 420 unmodified lines
11551156 {
11561157 phys_addr_t memblock_limit = 0;
11571158 int highmem = 0;
1158− phys_addr_t vmalloc_limit = __pa(vmalloc_min - 1) + 1;
1159+ u64 vmalloc_limit;
11591160 struct memblock_region *reg;
11601161 bool should_use_highmem = false;
11611162
1163+ /*
1164+ * Let's use our own (unoptimized) equivalent of __pa() that is
1165+ * not affected by wrap-arounds when sizeof(phys_addr_t) == 4.
1166+ * The result is used as the upper bound on physical memory address
1167+ * and may itself be outside the valid range for which phys_addr_t
1168+ * and therefore __pa() is defined.
1169+ */
1170+ vmalloc_limit = (u64)(uintptr_t)vmalloc_min - PAGE_OFFSET + PHYS_OFFSET;
1171+
11621172 for_each_memblock(memory, reg) {
11631173 phys_addr_t block_start = reg->base;
11641174 phys_addr_t block_end = reg->base + reg->size;
@@ -1183,10 +1193,11 @@ void __init sanity_check_meminfo(void) · 18 unmodified lines
11831193 if (reg->size > size_limit) {
11841194 phys_addr_t overlap_size = reg->size - size_limit;
11851195
1186− pr_notice("Truncating RAM at %pa-%pa to -%pa",
1187− &block_start, &block_end, &vmalloc_limit);
1188− memblock_remove(vmalloc_limit, overlap_size);
1196+ pr_notice("Truncating RAM at %pa-%pa",
1197+ &block_start, &block_end);
11891198 block_end = vmalloc_limit;
1199+ pr_cont(" to -%pa", &block_end);
1200+ memblock_remove(vmalloc_limit, overlap_size);
11901201 should_use_highmem = true;
11911202 }
11921203 }
arch/arm/mm/proc-v7.S+1−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <asm/hwcap.h>
1717 #include <asm/pgtable-hwdef.h>
1818 #include <asm/pgtable.h>
19+#include <asm/memory.h>
1920
2021 #include "proc-macros.S"
2122
arch/arm/xen/enlighten.c+4−5
@@ -50,7 +50,7 @@ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); · 49 unmodified lines
5050 static struct vcpu_info __percpu *xen_vcpu_info;
5151
5252 /* Linux <-> Xen vCPU id mapping */
53−DEFINE_PER_CPU(int, xen_vcpu_id) = -1;
53+DEFINE_PER_CPU(uint32_t, xen_vcpu_id);
5454 EXPORT_PER_CPU_SYMBOL(xen_vcpu_id);
5555
5656 /* These are unused until we support booting "pre-ballooned" */
@@ -170,9 +170,6 @@ static int xen_starting_cpu(unsigned int cpu) · 113 unmodified lines
170170 pr_info("Xen: initializing cpu%d\n", cpu);
171171 vcpup = per_cpu_ptr(xen_vcpu_info, cpu);
172172
173− /* Direct vCPU id mapping for ARM guests. */
174− per_cpu(xen_vcpu_id, cpu) = cpu;
175−
176173 info.mfn = virt_to_gfn(vcpup);
177174 info.offset = xen_offset_in_page(vcpup);
178175
@@ -330,6 +327,7 @@ static int __init xen_guest_init(void) · 151 unmodified lines
330327 {
331328 struct xen_add_to_physmap xatp;
332329 struct shared_info *shared_info_page = NULL;
330+ int cpu;
333331
334332 if (!xen_domain())
335333 return 0;
@@ -380,7 +378,8 @@ static int __init xen_guest_init(void) · 44 unmodified lines
380378 return -ENOMEM;
381379
382380 /* Direct vCPU id mapping for ARM guests. */
383− per_cpu(xen_vcpu_id, 0) = 0;
381+ for_each_possible_cpu(cpu)
382+ per_cpu(xen_vcpu_id, cpu) = cpu;
384383
385384 xen_auto_xlat_grant_frames.count = gnttab_max_grant_frames();
386385 if (xen_xlate_map_ballooned_pages(&xen_auto_xlat_grant_frames.pfn,
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi+4−4
@@ -255,10 +255,10 @@ · 254 unmodified lines
255255 /* Local timer */
256256 timer {
257257 compatible = "arm,armv8-timer";
258− interrupts = <1 13 0xf01>,
259− <1 14 0xf01>,
260− <1 11 0xf01>,
261− <1 10 0xf01>;
258+ interrupts = <1 13 0xf08>,
259+ <1 14 0xf08>,
260+ <1 11 0xf08>,
261+ <1 10 0xf08>;
262262 };
263263
264264 timer0: timer0@ffc03000 {
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi+4−4
@@ -102,13 +102,13 @@ · 101 unmodified lines
102102 timer {
103103 compatible = "arm,armv8-timer";
104104 interrupts = <GIC_PPI 13
105− (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_EDGE_RISING)>,
105+ (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>,
106106 <GIC_PPI 14
107− (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_EDGE_RISING)>,
107+ (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>,
108108 <GIC_PPI 11
109− (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_EDGE_RISING)>,
109+ (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>,
110110 <GIC_PPI 10
111− (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_EDGE_RISING)>;
111+ (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>;
112112 };
113113
114114 xtal: xtal-clk {
arch/arm64/boot/dts/apm/apm-storm.dtsi+4−4
@@ -110,10 +110,10 @@ · 109 unmodified lines
110110
111111 timer {
112112 compatible = "arm,armv8-timer";
113− interrupts = <1 0 0xff01>, /* Secure Phys IRQ */
114− <1 13 0xff01>, /* Non-secure Phys IRQ */
115− <1 14 0xff01>, /* Virt IRQ */
116− <1 15 0xff01>; /* Hyp IRQ */
113+ interrupts = <1 0 0xff08>, /* Secure Phys IRQ */
114+ <1 13 0xff08>, /* Non-secure Phys IRQ */
115+ <1 14 0xff08>, /* Virt IRQ */
116+ <1 15 0xff08>; /* Hyp IRQ */
117117 clock-frequency = <50000000>;
118118 };
119119
arch/arm64/boot/dts/broadcom/bcm2835-rpi.dtsi+1−0
@@ -0,0 +1 @@
1+../../../../arm/boot/dts/bcm2835-rpi.dtsi
arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts+2−2
@@ -1,7 +1,7 @@
11 /dts-v1/;
22 #include "bcm2837.dtsi"
3−#include "../../../../arm/boot/dts/bcm2835-rpi.dtsi"
4−#include "../../../../arm/boot/dts/bcm283x-rpi-smsc9514.dtsi"
3+#include "bcm2835-rpi.dtsi"
4+#include "bcm283x-rpi-smsc9514.dtsi"
55
66 / {
77 compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
arch/arm64/boot/dts/broadcom/bcm2837.dtsi+1−1
@@ -1,4 +1,4 @@
1−#include "../../../../arm/boot/dts/bcm283x.dtsi"
1+#include "bcm283x.dtsi"
22
33 / {
44 compatible = "brcm,bcm2836";
arch/arm64/boot/dts/broadcom/bcm283x-rpi-smsc9514.dtsi+1−0
@@ -0,0 +1 @@
1+../../../../arm/boot/dts/bcm283x-rpi-smsc9514.dtsi
arch/arm64/boot/dts/broadcom/bcm283x.dtsi+1−0
@@ -0,0 +1 @@
1+../../../../arm/boot/dts/bcm283x.dtsi
arch/arm64/boot/dts/broadcom/ns2.dtsi+4−4
@@ -88,13 +88,13 @@ · 87 unmodified lines
8888 timer {
8989 compatible = "arm,armv8-timer";
9090 interrupts = <GIC_PPI 13 (GIC_CPU_MASK_RAW(0xff) |
91− IRQ_TYPE_EDGE_RISING)>,
91+ IRQ_TYPE_LEVEL_LOW)>,
9292 <GIC_PPI 14 (GIC_CPU_MASK_RAW(0xff) |
93− IRQ_TYPE_EDGE_RISING)>,
93+ IRQ_TYPE_LEVEL_LOW)>,
9494 <GIC_PPI 11 (GIC_CPU_MASK_RAW(0xff) |
95− IRQ_TYPE_EDGE_RISING)>,
95+ IRQ_TYPE_LEVEL_LOW)>,
9696 <GIC_PPI 10 (GIC_CPU_MASK_RAW(0xff) |
97− IRQ_TYPE_EDGE_RISING)>;
97+ IRQ_TYPE_LEVEL_LOW)>;
9898 };
9999
100100 pmu {
arch/arm64/boot/dts/cavium/thunder-88xx.dtsi+4−4
@@ -354,10 +354,10 @@ · 353 unmodified lines
354354
355355 timer {
356356 compatible = "arm,armv8-timer";
357− interrupts = <1 13 0xff01>,
358− <1 14 0xff01>,
359− <1 11 0xff01>,
360− <1 10 0xff01>;
357+ interrupts = <1 13 4>,
358+ <1 14 4>,
359+ <1 11 4>,
360+ <1 10 4>;
361361 };
362362
363363 pmu {
arch/arm64/boot/dts/exynos/exynos7.dtsi+4−4
@@ -473,10 +473,10 @@ · 472 unmodified lines
473473
474474 timer {
475475 compatible = "arm,armv8-timer";
476− interrupts = <1 13 0xff01>,
477− <1 14 0xff01>,
478− <1 11 0xff01>,
479− <1 10 0xff01>;
476+ interrupts = <1 13 0xff08>,
477+ <1 14 0xff08>,
478+ <1 11 0xff08>,
479+ <1 10 0xff08>;
480480 };
481481
482482 pmu_system_controller: system-controller@105c0000 {
arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi+4−4
@@ -119,10 +119,10 @@ · 118 unmodified lines
119119
120120 timer {
121121 compatible = "arm,armv8-timer";
122− interrupts = <1 13 0x1>, /* Physical Secure PPI */
123− <1 14 0x1>, /* Physical Non-Secure PPI */
124− <1 11 0x1>, /* Virtual PPI */
125− <1 10 0x1>; /* Hypervisor PPI */
122+ interrupts = <1 13 0xf08>, /* Physical Secure PPI */
123+ <1 14 0xf08>, /* Physical Non-Secure PPI */
124+ <1 11 0xf08>, /* Virtual PPI */
125+ <1 10 0xf08>; /* Hypervisor PPI */
126126 };
127127
128128 pmu {
arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi+4−4
@@ -191,10 +191,10 @@ · 190 unmodified lines
191191
192192 timer {
193193 compatible = "arm,armv8-timer";
194− interrupts = <1 13 0x8>, /* Physical Secure PPI, active-low */
195− <1 14 0x8>, /* Physical Non-Secure PPI, active-low */
196− <1 11 0x8>, /* Virtual PPI, active-low */
197− <1 10 0x8>; /* Hypervisor PPI, active-low */
194+ interrupts = <1 13 4>, /* Physical Secure PPI, active-low */
195+ <1 14 4>, /* Physical Non-Secure PPI, active-low */
196+ <1 11 4>, /* Virtual PPI, active-low */
197+ <1 10 4>; /* Hypervisor PPI, active-low */
198198 };
199199
200200 pmu {
arch/arm64/boot/dts/marvell/armada-ap806.dtsi+4−4
@@ -122,10 +122,10 @@ · 121 unmodified lines
122122
123123 timer {
124124 compatible = "arm,armv8-timer";
125− interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>,
126− <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>,
127− <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>,
128− <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>;
125+ interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
126+ <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
127+ <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
128+ <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
129129 };
130130
131131 odmi: odmi@300000 {
arch/arm64/boot/dts/rockchip/rk3368.dtsi+2−0
@@ -270,6 +270,8 @@ · 269 unmodified lines
270270 #io-channel-cells = <1>;
271271 clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>;
272272 clock-names = "saradc", "apb_pclk";
273+ resets = <&cru SRST_SARADC>;
274+ reset-names = "saradc-apb";
273275 status = "disabled";
274276 };
275277
arch/arm64/boot/dts/socionext/uniphier-ph1-ld20.dtsi+4−4
@@ -129,10 +129,10 @@ · 128 unmodified lines
129129
130130 timer {
131131 compatible = "arm,armv8-timer";
132− interrupts = <1 13 0xf01>,
133− <1 14 0xf01>,
134− <1 11 0xf01>,
135− <1 10 0xf01>;
132+ interrupts = <1 13 4>,
133+ <1 14 4>,
134+ <1 11 4>,
135+ <1 10 4>;
136136 };
137137
138138 soc {
arch/arm64/boot/dts/xilinx/zynqmp.dtsi+4−4
@@ -65,10 +65,10 @@ · 64 unmodified lines
6565 timer {
6666 compatible = "arm,armv8-timer";
6767 interrupt-parent = <&gic>;
68− interrupts = <1 13 0xf01>,
69− <1 14 0xf01>,
70− <1 11 0xf01>,
71− <1 10 0xf01>;
68+ interrupts = <1 13 0xf08>,
69+ <1 14 0xf08>,
70+ <1 11 0xf08>,
71+ <1 10 0xf08>;
7272 };
7373
7474 amba_apu {
arch/arm64/crypto/aes-glue.c+1−1
@@ -216,7 +216,7 @@ static int ctr_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst, · 215 unmodified lines
216216 err = blkcipher_walk_done(desc, &walk,
217217 walk.nbytes % AES_BLOCK_SIZE);
218218 }
219− if (nbytes) {
219+ if (walk.nbytes % AES_BLOCK_SIZE) {
220220 u8 *tdst = walk.dst.virt.addr + blocks * AES_BLOCK_SIZE;
221221 u8 *tsrc = walk.src.virt.addr + blocks * AES_BLOCK_SIZE;
222222 u8 __aligned(8) tail[AES_BLOCK_SIZE];
arch/arm64/include/asm/debug-monitors.h+0−2
@@ -61,8 +61,6 @@ · 60 unmodified lines
6161
6262 #define AARCH64_BREAK_KGDB_DYN_DBG \
6363 (AARCH64_BREAK_MON | (KGDB_DYN_DBG_BRK_IMM << 5))
64−#define KGDB_DYN_BRK_INS_BYTE(x) \
65− ((AARCH64_BREAK_KGDB_DYN_DBG >> (8 * (x))) & 0xff)
6664
6765 #define CACHE_FLUSH_IS_SAFE 1
6866
arch/arm64/include/asm/percpu.h+4−4
@@ -199,19 +199,19 @@ static inline unsigned long __percpu_xchg(void *ptr, unsigned long val, · 198 unmodified lines
199199 #define _percpu_read(pcp) \
200200 ({ \
201201 typeof(pcp) __retval; \
202− preempt_disable(); \
202+ preempt_disable_notrace(); \
203203 __retval = (typeof(pcp))__percpu_read(raw_cpu_ptr(&(pcp)), \
204204 sizeof(pcp)); \
205− preempt_enable(); \
205+ preempt_enable_notrace(); \
206206 __retval; \
207207 })
208208
209209 #define _percpu_write(pcp, val) \
210210 do { \
211− preempt_disable(); \
211+ preempt_disable_notrace(); \
212212 __percpu_write(raw_cpu_ptr(&(pcp)), (unsigned long)(val), \
213213 sizeof(pcp)); \
214− preempt_enable(); \
214+ preempt_enable_notrace(); \
215215 } while(0) \
216216
217217 #define _pcp_protect(operation, pcp, val) \
arch/arm64/include/asm/spinlock.h+10−0
@@ -363,4 +363,14 @@ static inline int arch_read_trylock(arch_rwlock_t *rw) · 362 unmodified lines
363363 #define arch_read_relax(lock) cpu_relax()
364364 #define arch_write_relax(lock) cpu_relax()
365365
366+/*
367+ * Accesses appearing in program order before a spin_lock() operation
368+ * can be reordered with accesses inside the critical section, by virtue
369+ * of arch_spin_lock being constructed using acquire semantics.
370+ *
371+ * In cases where this is problematic (e.g. try_to_wake_up), an
372+ * smp_mb__before_spinlock() can restore the required ordering.
373+ */
374+#define smp_mb__before_spinlock() smp_mb()
375+
366376 #endif /* __ASM_SPINLOCK_H */
arch/arm64/kernel/head.S+3−0
@@ -757,6 +757,9 @@ ENTRY(__enable_mmu) · 756 unmodified lines
757757 isb
758758 bl __create_page_tables // recreate kernel mapping
759759
760+ tlbi vmalle1 // Remove any stale TLB entries
761+ dsb nsh
762+
760763 msr sctlr_el1, x19 // re-enable the MMU
761764 isb
762765 ic iallu // flush instructions fetched
arch/arm64/kernel/kgdb.c+24−12
@@ -19,10 +19,13 @@ · 18 unmodified lines
1919 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2020 */
2121
22+#include <linux/bug.h>
2223 #include <linux/irq.h>
2324 #include <linux/kdebug.h>
2425 #include <linux/kgdb.h>
2526 #include <linux/kprobes.h>
27+#include <asm/debug-monitors.h>
28+#include <asm/insn.h>
2629 #include <asm/traps.h>
2730
2831 struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] = {
@@ -338,15 +341,24 @@ void kgdb_arch_exit(void) · 309 unmodified lines
338341 unregister_die_notifier(&kgdb_notifier);
339342 }
340343
341−/*
342− * ARM instructions are always in LE.
343− * Break instruction is encoded in LE format
344− */
345−struct kgdb_arch arch_kgdb_ops = {
346− .gdb_bpt_instr = {
347− KGDB_DYN_BRK_INS_BYTE(0),
348− KGDB_DYN_BRK_INS_BYTE(1),
349− KGDB_DYN_BRK_INS_BYTE(2),
350− KGDB_DYN_BRK_INS_BYTE(3),
351− }
352−};
344+struct kgdb_arch arch_kgdb_ops;
345+
346+int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
347+{
348+ int err;
349+
350+ BUILD_BUG_ON(AARCH64_INSN_SIZE != BREAK_INSTR_SIZE);
351+
352+ err = aarch64_insn_read((void *)bpt->bpt_addr, (u32 *)bpt->saved_instr);
353+ if (err)
354+ return err;
355+
356+ return aarch64_insn_write((void *)bpt->bpt_addr,
357+ (u32)AARCH64_BREAK_KGDB_DYN_DBG);
358+}
359+
360+int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)
361+{
362+ return aarch64_insn_write((void *)bpt->bpt_addr,
363+ *(u32 *)bpt->saved_instr);
364+}
arch/arm64/kernel/sleep.S+9−1
@@ -101,12 +101,20 @@ ENTRY(cpu_resume) · 100 unmodified lines
101101 bl el2_setup // if in EL2 drop to EL1 cleanly
102102 /* enable the MMU early - so we can access sleep_save_stash by va */
103103 adr_l lr, __enable_mmu /* __cpu_setup will return here */
104− ldr x27, =_cpu_resume /* __enable_mmu will branch here */
104+ adr_l x27, _resume_switched /* __enable_mmu will branch here */
105105 adrp x25, idmap_pg_dir
106106 adrp x26, swapper_pg_dir
107107 b __cpu_setup
108108 ENDPROC(cpu_resume)
109109
110+ .pushsection ".idmap.text", "ax"
111+_resume_switched:
112+ ldr x8, =_cpu_resume
113+ br x8
114+ENDPROC(_resume_switched)
115+ .ltorg
116+ .popsection
117+
110118 ENTRY(_cpu_resume)
111119 mrs x1, mpidr_el1
112120 adrp x8, mpidr_hash
arch/arm64/kernel/smp.c+6−8
@@ -201,12 +201,6 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) · 200 unmodified lines
201201 return ret;
202202 }
203203
204−static void smp_store_cpu_info(unsigned int cpuid)
205−{
206− store_cpu_topology(cpuid);
207− numa_store_cpu_info(cpuid);
208−}
209−
210204 /*
211205 * This is the secondary CPU boot entry. We're using this CPUs
212206 * idle thread stack, but a set of temporary page tables.
@@ -254,7 +248,7 @@ asmlinkage void secondary_start_kernel(void) · 41 unmodified lines
254248 */
255249 notify_cpu_starting(cpu);
256250
257− smp_store_cpu_info(cpu);
251+ store_cpu_topology(cpu);
258252
259253 /*
260254 * OK, now it's safe to let the boot CPU continue. Wait for
@@ -689,10 +683,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus) · 428 unmodified lines
689683 {
690684 int err;
691685 unsigned int cpu;
686+ unsigned int this_cpu;
692687
693688 init_cpu_topology();
694689
695− smp_store_cpu_info(smp_processor_id());
690+ this_cpu = smp_processor_id();
691+ store_cpu_topology(this_cpu);
692+ numa_store_cpu_info(this_cpu);
696693
697694 /*
698695 * If UP is mandated by "nosmp" (which implies "maxcpus=0"), don't set
@@ -719,6 +716,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) · 20 unmodified lines
719716 continue;
720717
721718 set_cpu_present(cpu, true);
719+ numa_store_cpu_info(cpu);
722720 }
723721 }
724722
arch/arm64/kvm/hyp/switch.c+1−1
@@ -256,7 +256,7 @@ static int __hyp_text __guest_run(struct kvm_vcpu *vcpu) · 255 unmodified lines
256256
257257 /*
258258 * We must restore the 32-bit state before the sysregs, thanks
259− * to Cortex-A57 erratum #852523.
259+ * to erratum #852523 (Cortex-A57) or #853709 (Cortex-A72).
260260 */
261261 __sysreg32_restore_state(vcpu);
262262 __sysreg_restore_guest_state(guest_ctxt);
arch/arm64/kvm/sys_regs.c+1−9
@@ -823,14 +823,6 @@ static bool access_pmuserenr(struct kvm_vcpu *vcpu, struct sys_reg_params *p, · 822 unmodified lines
823823 * Architected system registers.
824824 * Important: Must be sorted ascending by Op0, Op1, CRn, CRm, Op2
825825 *
826− * We could trap ID_DFR0 and tell the guest we don't support performance
827− * monitoring. Unfortunately the patch to make the kernel check ID_DFR0 was
828− * NAKed, so it will read the PMCR anyway.
829− *
830− * Therefore we tell the guest we have 0 counters. Unfortunately, we
831− * must always support PMCCNTR (the cycle counter): we just RAZ/WI for
832− * all PM registers, which doesn't crash the guest kernel at least.
833− *
834826 * Debug handling: We do trap most, if not all debug related system
835827 * registers. The implementation is good enough to ensure that a guest
836828 * can use these with minimal performance degradation. The drawback is
@@ -1360,7 +1352,7 @@ static const struct sys_reg_desc cp15_regs[] = { · 523 unmodified lines
13601352 { Op1( 0), CRn(10), CRm( 3), Op2( 1), access_vm_reg, NULL, c10_AMAIR1 },
13611353
13621354 /* ICC_SRE */
1363− { Op1( 0), CRn(12), CRm(12), Op2( 5), trap_raz_wi },
1355+ { Op1( 0), CRn(12), CRm(12), Op2( 5), access_gic_sre },
13641356
13651357 { Op1( 0), CRn(13), CRm( 0), Op2( 1), access_vm_reg, NULL, c13_CID },
13661358
arch/arm64/mm/dump.c+3−3
@@ -242,7 +242,7 @@ static void note_page(struct pg_state *st, unsigned long addr, unsigned level, · 241 unmodified lines
242242
243243 static void walk_pte(struct pg_state *st, pmd_t *pmd, unsigned long start)
244244 {
245− pte_t *pte = pte_offset_kernel(pmd, 0);
245+ pte_t *pte = pte_offset_kernel(pmd, 0UL);
246246 unsigned long addr;
247247 unsigned i;
248248
@@ -254,7 +254,7 @@ static void walk_pte(struct pg_state *st, pmd_t *pmd, unsigned long start) · 5 unmodified lines
254254
255255 static void walk_pmd(struct pg_state *st, pud_t *pud, unsigned long start)
256256 {
257− pmd_t *pmd = pmd_offset(pud, 0);
257+ pmd_t *pmd = pmd_offset(pud, 0UL);
258258 unsigned long addr;
259259 unsigned i;
260260
@@ -271,7 +271,7 @@ static void walk_pmd(struct pg_state *st, pud_t *pud, unsigned long start) · 10 unmodified lines
271271
272272 static void walk_pud(struct pg_state *st, pgd_t *pgd, unsigned long start)
273273 {
274− pud_t *pud = pud_offset(pgd, 0);
274+ pud_t *pud = pud_offset(pgd, 0UL);
275275 unsigned long addr;
276276 unsigned i;
277277
arch/arm64/mm/numa.c+2−0
@@ -23,6 +23,8 @@ · 22 unmodified lines
2323 #include <linux/module.h>
2424 #include <linux/of.h>
2525
26+#include <asm/acpi.h>
27+
2628 struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
2729 EXPORT_SYMBOL(node_data);
2830 nodemask_t numa_nodes_parsed __initdata;
arch/arm64/mm/proc.S+9−0
@@ -100,7 +100,16 @@ ENTRY(cpu_do_resume) · 99 unmodified lines
100100
101101 msr tcr_el1, x8
102102 msr vbar_el1, x9
103+
104+ /*
105+ * __cpu_setup() cleared MDSCR_EL1.MDE and friends, before unmasking
106+ * debug exceptions. By restoring MDSCR_EL1 here, we may take a debug
107+ * exception. Mask them until local_dbg_restore() in cpu_suspend()
108+ * resets them.
109+ */
110+ disable_dbg
103111 msr mdscr_el1, x10
112+
104113 msr sctlr_el1, x12
105114 /*
106115 * Restore oslsr_el1 by writing oslar_el1
arch/avr32/include/asm/uaccess.h+10−1
@@ -74,7 +74,7 @@ extern __kernel_size_t __copy_user(void *to, const void *from, · 73 unmodified lines
7474
7575 extern __kernel_size_t copy_to_user(void __user *to, const void *from,
7676 __kernel_size_t n);
77−extern __kernel_size_t copy_from_user(void *to, const void __user *from,
77+extern __kernel_size_t ___copy_from_user(void *to, const void __user *from,
7878 __kernel_size_t n);
7979
8080 static inline __kernel_size_t __copy_to_user(void __user *to, const void *from,
@@ -88,6 +88,15 @@ static inline __kernel_size_t __copy_from_user(void *to, · 7 unmodified lines
8888 {
8989 return __copy_user(to, (const void __force *)from, n);
9090 }
91+static inline __kernel_size_t copy_from_user(void *to,
92+ const void __user *from,
93+ __kernel_size_t n)
94+{
95+ size_t res = ___copy_from_user(to, from, n);
96+ if (unlikely(res))
97+ memset(to + (n - res), 0, res);
98+ return res;
99+}
91100
92101 #define __copy_to_user_inatomic __copy_to_user
93102 #define __copy_from_user_inatomic __copy_from_user
arch/avr32/kernel/avr32_ksyms.c+1−1
@@ -36,7 +36,7 @@ EXPORT_SYMBOL(copy_page); · 35 unmodified lines
3636 /*
3737 * Userspace access stuff.
3838 */
39−EXPORT_SYMBOL(copy_from_user);
39+EXPORT_SYMBOL(___copy_from_user);
4040 EXPORT_SYMBOL(copy_to_user);
4141 EXPORT_SYMBOL(__copy_user);
4242 EXPORT_SYMBOL(strncpy_from_user);
arch/avr32/lib/copy_user.S+4−4
@@ -23,13 +23,13 @@ · 22 unmodified lines
2323 */
2424 .text
2525 .align 1
26− .global copy_from_user
27− .type copy_from_user, @function
28−copy_from_user:
26+ .global ___copy_from_user
27+ .type ___copy_from_user, @function
28+___copy_from_user:
2929 branch_if_kernel r8, __copy_user
3030 ret_if_privileged r8, r11, r10, r10
3131 rjmp __copy_user
32− .size copy_from_user, . - copy_from_user
32+ .size ___copy_from_user, . - ___copy_from_user
3333
3434 .global copy_to_user
3535 .type copy_to_user, @function
arch/blackfin/include/asm/uaccess.h+5−4
@@ -171,11 +171,12 @@ static inline int bad_user_access_length(void) · 170 unmodified lines
171171 static inline unsigned long __must_check
172172 copy_from_user(void *to, const void __user *from, unsigned long n)
173173 {
174− if (access_ok(VERIFY_READ, from, n))
174+ if (likely(access_ok(VERIFY_READ, from, n))) {
175175 memcpy(to, (const void __force *)from, n);
176− else
177− return n;
178− return 0;
176+ return 0;
177+ }
178+ memset(to, 0, n);
179+ return n;
179180 }
180181
181182 static inline unsigned long __must_check
arch/blackfin/mach-bf561/boards/cm_bf561.c+2−1
@@ -146,7 +146,8 @@ static struct platform_device hitachi_fb_device = { · 145 unmodified lines
146146 #include <linux/smc91x.h>
147147
148148 static struct smc91x_platdata smc91x_info = {
149− .flags = SMC91X_USE_32BIT | SMC91X_NOWAIT,
149+ .flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_USE_32BIT |
150+ SMC91X_NOWAIT,
150151 .leda = RPC_LED_100_10,
151152 .ledb = RPC_LED_TX_RX,
152153 };
arch/blackfin/mach-bf561/boards/ezkit.c+2−1
@@ -134,7 +134,8 @@ static struct platform_device net2272_bfin_device = { · 133 unmodified lines
134134 #include <linux/smc91x.h>
135135
136136 static struct smc91x_platdata smc91x_info = {
137− .flags = SMC91X_USE_32BIT | SMC91X_NOWAIT,
137+ .flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_USE_32BIT |
138+ SMC91X_NOWAIT,
138139 .leda = RPC_LED_100_10,
139140 .ledb = RPC_LED_TX_RX,
140141 };
arch/cris/include/asm/uaccess.h+32−39
@@ -194,30 +194,6 @@ extern unsigned long __copy_user(void __user *to, const void *from, unsigned lon · 193 unmodified lines
194194 extern unsigned long __copy_user_zeroing(void *to, const void __user *from, unsigned long n);
195195 extern unsigned long __do_clear_user(void __user *to, unsigned long n);
196196
197−static inline unsigned long
198−__generic_copy_to_user(void __user *to, const void *from, unsigned long n)
199−{
200− if (access_ok(VERIFY_WRITE, to, n))
201− return __copy_user(to, from, n);
202− return n;
203−}
204−
205−static inline unsigned long
206−__generic_copy_from_user(void *to, const void __user *from, unsigned long n)
207−{
208− if (access_ok(VERIFY_READ, from, n))
209− return __copy_user_zeroing(to, from, n);
210− return n;
211−}
212−
213−static inline unsigned long
214−__generic_clear_user(void __user *to, unsigned long n)
215−{
216− if (access_ok(VERIFY_WRITE, to, n))
217− return __do_clear_user(to, n);
218− return n;
219−}
220−
221197 static inline long
222198 __strncpy_from_user(char *dst, const char __user *src, long count)
223199 {
@@ -282,7 +258,7 @@ __constant_copy_from_user(void *to, const void __user *from, unsigned long n) · 58 unmodified lines
282258 else if (n == 24)
283259 __asm_copy_from_user_24(to, from, ret);
284260 else
285− ret = __generic_copy_from_user(to, from, n);
261+ ret = __copy_user_zeroing(to, from, n);
286262
287263 return ret;
288264 }
@@ -333,7 +309,7 @@ __constant_copy_to_user(void __user *to, const void *from, unsigned long n) · 44 unmodified lines
333309 else if (n == 24)
334310 __asm_copy_to_user_24(to, from, ret);
335311 else
336− ret = __generic_copy_to_user(to, from, n);
312+ ret = __copy_user(to, from, n);
337313
338314 return ret;
339315 }
@@ -366,26 +342,43 @@ __constant_clear_user(void __user *to, unsigned long n) · 26 unmodified lines
366342 else if (n == 24)
367343 __asm_clear_24(to, ret);
368344 else
369− ret = __generic_clear_user(to, n);
345+ ret = __do_clear_user(to, n);
370346
371347 return ret;
372348 }
373349
374350
375−#define clear_user(to, n) \
376− (__builtin_constant_p(n) ? \
377− __constant_clear_user(to, n) : \
378− __generic_clear_user(to, n))
351+static inline size_t clear_user(void __user *to, size_t n)
352+{
353+ if (unlikely(!access_ok(VERIFY_WRITE, to, n)))
354+ return n;
355+ if (__builtin_constant_p(n))
356+ return __constant_clear_user(to, n);
357+ else
358+ return __do_clear_user(to, n);
359+}
379360
380−#define copy_from_user(to, from, n) \
381− (__builtin_constant_p(n) ? \
382− __constant_copy_from_user(to, from, n) : \
383− __generic_copy_from_user(to, from, n))
361+static inline size_t copy_from_user(void *to, const void __user *from, size_t n)
362+{
363+ if (unlikely(!access_ok(VERIFY_READ, from, n))) {
364+ memset(to, 0, n);
365+ return n;
366+ }
367+ if (__builtin_constant_p(n))
368+ return __constant_copy_from_user(to, from, n);
369+ else
370+ return __copy_user_zeroing(to, from, n);
371+}
384372
385−#define copy_to_user(to, from, n) \
386− (__builtin_constant_p(n) ? \
387− __constant_copy_to_user(to, from, n) : \
388− __generic_copy_to_user(to, from, n))
373+static inline size_t copy_to_user(void __user *to, const void *from, size_t n)
374+{
375+ if (unlikely(!access_ok(VERIFY_WRITE, to, n)))
376+ return n;
377+ if (__builtin_constant_p(n))
378+ return __constant_copy_to_user(to, from, n);
379+ else
380+ return __copy_user(to, from, n);
381+}
389382
390383 /* We let the __ versions of copy_from/to_user inline, because they're often
391384 * used in fast paths and have only a small space overhead.
arch/frv/include/asm/uaccess.h+9−3
@@ -263,19 +263,25 @@ do { \ · 262 unmodified lines
263263 extern long __memset_user(void *dst, unsigned long count);
264264 extern long __memcpy_user(void *dst, const void *src, unsigned long count);
265265
266−#define clear_user(dst,count) __memset_user(____force(dst), (count))
266+#define __clear_user(dst,count) __memset_user(____force(dst), (count))
267267 #define __copy_from_user_inatomic(to, from, n) __memcpy_user((to), ____force(from), (n))
268268 #define __copy_to_user_inatomic(to, from, n) __memcpy_user(____force(to), (from), (n))
269269
270270 #else
271271
272−#define clear_user(dst,count) (memset(____force(dst), 0, (count)), 0)
272+#define __clear_user(dst,count) (memset(____force(dst), 0, (count)), 0)
273273 #define __copy_from_user_inatomic(to, from, n) (memcpy((to), ____force(from), (n)), 0)
274274 #define __copy_to_user_inatomic(to, from, n) (memcpy(____force(to), (from), (n)), 0)
275275
276276 #endif
277277
278−#define __clear_user clear_user
278+static inline unsigned long __must_check
279+clear_user(void __user *to, unsigned long n)
280+{
281+ if (likely(__access_ok(to, n)))
282+ n = __clear_user(to, n);
283+ return n;
284+}
279285
280286 static inline unsigned long __must_check
281287 __copy_to_user(void __user *to, const void *from, unsigned long n)
arch/hexagon/include/asm/uaccess.h+2−1
@@ -103,7 +103,8 @@ static inline long hexagon_strncpy_from_user(char *dst, const char __user *src, · 102 unmodified lines
103103 {
104104 long res = __strnlen_user(src, n);
105105
106− /* return from strnlen can't be zero -- that would be rubbish. */
106+ if (unlikely(!res))
107+ return -EFAULT;
107108
108109 if (res > n) {
109110 copy_from_user(dst, src, n);
arch/ia64/include/asm/uaccess.h+13−20
@@ -241,8 +241,7 @@ extern unsigned long __must_check __copy_user (void __user *to, const void __use · 240 unmodified lines
241241 static inline unsigned long
242242 __copy_to_user (void __user *to, const void *from, unsigned long count)
243243 {
244− if (!__builtin_constant_p(count))
245− check_object_size(from, count, true);
244+ check_object_size(from, count, true);
246245
247246 return __copy_user(to, (__force void __user *) from, count);
248247 }
@@ -250,8 +249,7 @@ __copy_to_user (void __user *to, const void *from, unsigned long count) · 1 unmodified line
250249 static inline unsigned long
251250 __copy_from_user (void *to, const void __user *from, unsigned long count)
252251 {
253− if (!__builtin_constant_p(count))
254− check_object_size(to, count, false);
252+ check_object_size(to, count, false);
255253
256254 return __copy_user((__force void __user *) to, from, count);
257255 }
@@ -265,27 +263,22 @@ __copy_from_user (void *to, const void __user *from, unsigned long count) · 7 unmodified lines
265263 long __cu_len = (n); \
266264 \
267265 if (__access_ok(__cu_to, __cu_len, get_fs())) { \
268− if (!__builtin_constant_p(n)) \
269− check_object_size(__cu_from, __cu_len, true); \
266+ check_object_size(__cu_from, __cu_len, true); \
270267 __cu_len = __copy_user(__cu_to, (__force void __user *) __cu_from, __cu_len); \
271268 } \
272269 __cu_len; \
273270 })
274271
275−#define copy_from_user(to, from, n) \
276−({ \
277− void *__cu_to = (to); \
278− const void __user *__cu_from = (from); \
279− long __cu_len = (n); \
280− \
281− __chk_user_ptr(__cu_from); \
282− if (__access_ok(__cu_from, __cu_len, get_fs())) { \
283− if (!__builtin_constant_p(n)) \
284− check_object_size(__cu_to, __cu_len, false); \
285− __cu_len = __copy_user((__force void __user *) __cu_to, __cu_from, __cu_len); \
286− } \
287− __cu_len; \
288−})
272+static inline unsigned long
273+copy_from_user(void *to, const void __user *from, unsigned long n)
274+{
275+ check_object_size(to, n, false);
276+ if (likely(__access_ok(from, n, get_fs())))
277+ n = __copy_user((__force void __user *) to, from, n);
278+ else
279+ memset(to, 0, n);
280+ return n;
281+}
289282
290283 #define __copy_in_user(to, from, size) __copy_user((to), (from), (size))
291284
arch/m32r/include/asm/uaccess.h+1−1
@@ -219,7 +219,7 @@ extern int fixup_exception(struct pt_regs *regs); · 218 unmodified lines
219219 #define __get_user_nocheck(x, ptr, size) \
220220 ({ \
221221 long __gu_err = 0; \
222− unsigned long __gu_val; \
222+ unsigned long __gu_val = 0; \
223223 might_fault(); \
224224 __get_user_size(__gu_val, (ptr), (size), __gu_err); \
225225 (x) = (__force __typeof__(*(ptr)))__gu_val; \
arch/metag/include/asm/uaccess.h+2−1
@@ -204,8 +204,9 @@ extern unsigned long __must_check __copy_user_zeroing(void *to, · 203 unmodified lines
204204 static inline unsigned long
205205 copy_from_user(void *to, const void __user *from, unsigned long n)
206206 {
207− if (access_ok(VERIFY_READ, from, n))
207+ if (likely(access_ok(VERIFY_READ, from, n)))
208208 return __copy_user_zeroing(to, from, n);
209+ memset(to, 0, n);
209210 return n;
210211 }
211212
arch/microblaze/include/asm/uaccess.h+7−4
@@ -227,7 +227,7 @@ extern long __user_bad(void); · 226 unmodified lines
227227
228228 #define __get_user(x, ptr) \
229229 ({ \
230− unsigned long __gu_val; \
230+ unsigned long __gu_val = 0; \
231231 /*unsigned long __gu_ptr = (unsigned long)(ptr);*/ \
232232 long __gu_err; \
233233 switch (sizeof(*(ptr))) { \
@@ -373,10 +373,13 @@ extern long __user_bad(void); · 139 unmodified lines
373373 static inline long copy_from_user(void *to,
374374 const void __user *from, unsigned long n)
375375 {
376+ unsigned long res = n;
376377 might_fault();
377− if (access_ok(VERIFY_READ, from, n))
378− return __copy_from_user(to, from, n);
379− return n;
378+ if (likely(access_ok(VERIFY_READ, from, n)))
379+ res = __copy_from_user(to, from, n);
380+ if (unlikely(res))
381+ memset(to + (n - res), 0, res);
382+ return res;
380383 }
381384
382385 #define __copy_to_user(to, from, n) \
arch/mips/Kconfig+1−0
@@ -65,6 +65,7 @@ config MIPS · 64 unmodified lines
6565 select ARCH_CLOCKSOURCE_DATA
6666 select HANDLE_DOMAIN_IRQ
6767 select HAVE_EXIT_THREAD
68+ select HAVE_REGS_AND_STACK_ACCESS_API
6869
6970 menu "Machine selection"
7071
arch/mips/Kconfig.debug+0−36
@@ -113,42 +113,6 @@ config SPINLOCK_TEST · 112 unmodified lines
113113 help
114114 Add several files to the debugfs to test spinlock speed.
115115
116−if CPU_MIPSR6
117−
118−choice
119− prompt "Compact branch policy"
120− default MIPS_COMPACT_BRANCHES_OPTIMAL
121−
122−config MIPS_COMPACT_BRANCHES_NEVER
123− bool "Never (force delay slot branches)"
124− help
125− Pass the -mcompact-branches=never flag to the compiler in order to
126− force it to always emit branches with delay slots, and make no use
127− of the compact branch instructions introduced by MIPSr6. This is
128− useful if you suspect there may be an issue with compact branches in
129− either the compiler or the CPU.
130−
131−config MIPS_COMPACT_BRANCHES_OPTIMAL
132− bool "Optimal (use where beneficial)"
133− help
134− Pass the -mcompact-branches=optimal flag to the compiler in order for
135− it to make use of compact branch instructions where it deems them
136− beneficial, and use branches with delay slots elsewhere. This is the
137− default compiler behaviour, and should be used unless you have a
138− reason to choose otherwise.
139−
140−config MIPS_COMPACT_BRANCHES_ALWAYS
141− bool "Always (force compact branches)"
142− help
143− Pass the -mcompact-branches=always flag to the compiler in order to
144− force it to always emit compact branches, making no use of branch
145− instructions with delay slots. This can result in more compact code
146− which may be beneficial in some scenarios.
147−
148−endchoice
149−
150−endif # CPU_MIPSR6
151−
152116 config SCACHE_DEBUGFS
153117 bool "L2 cache debugfs entries"
154118 depends on DEBUG_FS
arch/mips/Makefile+0−4
@@ -203,10 +203,6 @@ endif · 202 unmodified lines
203203 toolchain-virt := $(call cc-option-yn,$(mips-cflags) -mvirt)
204204 cflags-$(toolchain-virt) += -DTOOLCHAIN_SUPPORTS_VIRT
205205
206−cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_NEVER) += -mcompact-branches=never
207−cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_OPTIMAL) += -mcompact-branches=optimal
208−cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_ALWAYS) += -mcompact-branches=always
209−
210206 #
211207 # Firmware support
212208 #
arch/mips/ath79/clock.c+1−1
@@ -96,7 +96,7 @@ static struct clk * __init ath79_reg_ffclk(const char *name, · 95 unmodified lines
9696 struct clk *clk;
9797
9898 clk = clk_register_fixed_factor(NULL, name, parent_name, 0, mult, div);
99− if (!clk)
99+ if (IS_ERR(clk))
100100 panic("failed to allocate %s clock structure", name);
101101
102102 return clk;
arch/mips/cavium-octeon/octeon-platform.c+1−1
@@ -1059,7 +1059,7 @@ static int __init octeon_publish_devices(void) · 1058 unmodified lines
10591059 {
10601060 return of_platform_bus_probe(NULL, octeon_ids, NULL);
10611061 }
1062−device_initcall(octeon_publish_devices);
1062+arch_initcall(octeon_publish_devices);
10631063
10641064 MODULE_AUTHOR("David Daney <ddaney@caviumnetworks.com>");
10651065 MODULE_LICENSE("GPL");
arch/mips/include/asm/asmmacro.h+1−0
@@ -157,6 +157,7 @@ · 156 unmodified lines
157157 ldc1 $f28, THREAD_FPR28(\thread)
158158 ldc1 $f30, THREAD_FPR30(\thread)
159159 ctc1 \tmp, fcr31
160+ .set pop
160161 .endm
161162
162163 .macro fpu_restore_16odd thread
arch/mips/include/asm/mach-cavium-octeon/mangle-port.h+2−2
@@ -15,8 +15,8 @@ · 14 unmodified lines
1515 static inline bool __should_swizzle_bits(volatile void *a)
1616 {
1717 extern const bool octeon_should_swizzle_table[];
18+ u64 did = ((u64)(uintptr_t)a >> 40) & 0xff;
1819
19− unsigned long did = ((unsigned long)a >> 40) & 0xff;
2020 return octeon_should_swizzle_table[did];
2121 }
2222
@@ -29,7 +29,7 @@ static inline bool __should_swizzle_bits(volatile void *a) · 6 unmodified lines
2929
3030 #define __should_swizzle_bits(a) false
3131
32−static inline bool __should_swizzle_addr(unsigned long p)
32+static inline bool __should_swizzle_addr(u64 p)
3333 {
3434 /* boot bus? */
3535 return ((p >> 40) & 0xff) == 0;
arch/mips/include/asm/mach-paravirt/kernel-entry-init.h+2−0
@@ -11,11 +11,13 @@ · 10 unmodified lines
1111 #define CP0_EBASE $15, 1
1212
1313 .macro kernel_entry_setup
14+#ifdef CONFIG_SMP
1415 mfc0 t0, CP0_EBASE
1516 andi t0, t0, 0x3ff # CPUNum
1617 beqz t0, 1f
1718 # CPUs other than zero goto smp_bootstrap
1819 j smp_bootstrap
20+#endif /* CONFIG_SMP */
1921
2022 1:
2123 .endm
arch/mips/include/asm/page.h+2−2
@@ -164,7 +164,7 @@ typedef struct { unsigned long pgprot; } pgprot_t; · 163 unmodified lines
164164 */
165165 static inline unsigned long ___pa(unsigned long x)
166166 {
167− if (config_enabled(CONFIG_64BIT)) {
167+ if (IS_ENABLED(CONFIG_64BIT)) {
168168 /*
169169 * For MIPS64 the virtual address may either be in one of
170170 * the compatibility segements ckseg0 or ckseg1, or it may
@@ -173,7 +173,7 @@ static inline unsigned long ___pa(unsigned long x) · 2 unmodified lines
173173 return x < CKSEG0 ? XPHYSADDR(x) : CPHYSADDR(x);
174174 }
175175
176− if (!config_enabled(CONFIG_EVA)) {
176+ if (!IS_ENABLED(CONFIG_EVA)) {
177177 /*
178178 * We're using the standard MIPS32 legacy memory map, ie.
179179 * the address x is going to be in kseg0 or kseg1. We can
arch/mips/include/asm/uaccess.h+3−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <linux/kernel.h>
1515 #include <linux/errno.h>
1616 #include <linux/thread_info.h>
17+#include <linux/string.h>
1718 #include <asm/asm-eva.h>
1819
1920 /*
@@ -1170,6 +1171,8 @@ extern size_t __copy_in_user_eva(void *__to, const void *__from, size_t __n); · 1150 unmodified lines
11701171 __cu_len = __invoke_copy_from_user(__cu_to, \
11711172 __cu_from, \
11721173 __cu_len); \
1174+ } else { \
1175+ memset(__cu_to, 0, __cu_len); \
11731176 } \
11741177 } \
11751178 __cu_len; \
arch/mips/kernel/mips-r2-to-r6-emul.c+2−0
@@ -1164,7 +1164,9 @@ fpu_emul: · 1163 unmodified lines
11641164 regs->regs[31] = r31;
11651165 regs->cp0_epc = epc;
11661166 if (!used_math()) { /* First time FPU user. */
1167+ preempt_disable();
11671168 err = init_fpu();
1169+ preempt_enable();
11681170 set_used_math();
11691171 }
11701172 lose_fpu(1); /* Save FPU state for the emulator. */
arch/mips/kernel/process.c+4−4
@@ -605,14 +605,14 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value) · 604 unmodified lines
605605 return -EOPNOTSUPP;
606606
607607 /* Avoid inadvertently triggering emulation */
608− if ((value & PR_FP_MODE_FR) && cpu_has_fpu &&
609− !(current_cpu_data.fpu_id & MIPS_FPIR_F64))
608+ if ((value & PR_FP_MODE_FR) && raw_cpu_has_fpu &&
609+ !(raw_current_cpu_data.fpu_id & MIPS_FPIR_F64))
610610 return -EOPNOTSUPP;
611− if ((value & PR_FP_MODE_FRE) && cpu_has_fpu && !cpu_has_fre)
611+ if ((value & PR_FP_MODE_FRE) && raw_cpu_has_fpu && !cpu_has_fre)
612612 return -EOPNOTSUPP;
613613
614614 /* FR = 0 not supported in MIPS R6 */
615− if (!(value & PR_FP_MODE_FR) && cpu_has_fpu && cpu_has_mips_r6)
615+ if (!(value & PR_FP_MODE_FR) && raw_cpu_has_fpu && cpu_has_mips_r6)
616616 return -EOPNOTSUPP;
617617
618618 /* Proceed with the mode switch */
arch/mips/kernel/setup.c+7−0
@@ -87,6 +87,13 @@ void __init add_memory_region(phys_addr_t start, phys_addr_t size, long type) · 86 unmodified lines
8787 int x = boot_mem_map.nr_map;
8888 int i;
8989
90+ /*
91+ * If the region reaches the top of the physical address space, adjust
92+ * the size slightly so that (start + size) doesn't overflow
93+ */
94+ if (start + size - 1 == (phys_addr_t)ULLONG_MAX)
95+ --size;
96+
9097 /* Sanity check */
9198 if (start + size < start) {
9299 pr_warn("Trying to add an invalid memory region, skipped\n");
arch/mips/kernel/smp.c+3−4
@@ -322,6 +322,9 @@ asmlinkage void start_secondary(void) · 321 unmodified lines
322322 cpumask_set_cpu(cpu, &cpu_coherent_mask);
323323 notify_cpu_starting(cpu);
324324
325+ cpumask_set_cpu(cpu, &cpu_callin_map);
326+ synchronise_count_slave(cpu);
327+
325328 set_cpu_online(cpu, true);
326329
327330 set_cpu_sibling_map(cpu);
@@ -329,10 +332,6 @@ asmlinkage void start_secondary(void) · 1 unmodified line
329332
330333 calculate_cpu_foreign_map();
331334
332− cpumask_set_cpu(cpu, &cpu_callin_map);
333−
334− synchronise_count_slave(cpu);
335−
336335 /*
337336 * irq will be enabled in ->smp_finish(), enabling it too early
338337 * is dangerous.
arch/mips/kernel/uprobes.c+1−1
@@ -222,7 +222,7 @@ int arch_uprobe_exception_notify(struct notifier_block *self, · 221 unmodified lines
222222 return NOTIFY_DONE;
223223
224224 switch (val) {
225− case DIE_BREAK:
225+ case DIE_UPROBE:
226226 if (uprobe_pre_sstep_notifier(regs))
227227 return NOTIFY_STOP;
228228 break;
arch/mips/kernel/vdso.c+4−4
@@ -39,16 +39,16 @@ static struct vm_special_mapping vdso_vvar_mapping = { · 38 unmodified lines
3939 static void __init init_vdso_image(struct mips_vdso_image *image)
4040 {
4141 unsigned long num_pages, i;
42+ unsigned long data_pfn;
4243
4344 BUG_ON(!PAGE_ALIGNED(image->data));
4445 BUG_ON(!PAGE_ALIGNED(image->size));
4546
4647 num_pages = image->size / PAGE_SIZE;
4748
48− for (i = 0; i < num_pages; i++) {
49− image->mapping.pages[i] =
50− virt_to_page(image->data + (i * PAGE_SIZE));
51− }
49+ data_pfn = __phys_to_pfn(__pa_symbol(image->data));
50+ for (i = 0; i < num_pages; i++)
51+ image->mapping.pages[i] = pfn_to_page(data_pfn + i);
5252 }
5353
5454 static int __init init_vdso(void)
arch/mips/kvm/mmu.c+1−1
@@ -40,7 +40,7 @@ static int kvm_mips_map_page(struct kvm *kvm, gfn_t gfn) · 39 unmodified lines
4040 srcu_idx = srcu_read_lock(&kvm->srcu);
4141 pfn = gfn_to_pfn(kvm, gfn);
4242
43− if (is_error_pfn(pfn)) {
43+ if (is_error_noslot_pfn(pfn)) {
4444 kvm_err("Couldn't get pfn for gfn %#llx!\n", gfn);
4545 err = -EFAULT;
4646 goto out;
arch/mips/math-emu/dsemul.c+1−0
@@ -298,5 +298,6 @@ bool do_dsemulret(struct pt_regs *xcp) · 297 unmodified lines
298298 /* Set EPC to return to post-branch instruction */
299299 xcp->cp0_epc = current->thread.bd_emu_cont_pc;
300300 pr_debug("dsemulret to 0x%08lx\n", xcp->cp0_epc);
301+ MIPS_FPU_EMU_INC_STATS(ds_emul);
301302 return true;
302303 }
arch/mips/mm/c-r4k.c+1−1
@@ -800,7 +800,7 @@ static void r4k_flush_icache_range(unsigned long start, unsigned long end) · 799 unmodified lines
800800 * If address-based cache ops don't require an SMP call, then
801801 * use them exclusively for small flushes.
802802 */
803− size = start - end;
803+ size = end - start;
804804 cache_size = icache_size;
805805 if (!cpu_has_ic_fills_f_dc) {
806806 size *= 2;
arch/mips/mm/init.c+6−7
@@ -261,7 +261,6 @@ unsigned __weak platform_maar_init(unsigned num_pairs) · 260 unmodified lines
261261 {
262262 struct maar_config cfg[BOOT_MEM_MAP_MAX];
263263 unsigned i, num_configured, num_cfg = 0;
264− phys_addr_t skip;
265264
266265 for (i = 0; i < boot_mem_map.nr_map; i++) {
267266 switch (boot_mem_map.map[i].type) {
@@ -272,14 +271,14 @@ unsigned __weak platform_maar_init(unsigned num_pairs) · 4 unmodified lines
272271 continue;
273272 }
274273
275− skip = 0x10000 - (boot_mem_map.map[i].addr & 0xffff);
276−
274+ /* Round lower up */
277275 cfg[num_cfg].lower = boot_mem_map.map[i].addr;
278− cfg[num_cfg].lower += skip;
276+ cfg[num_cfg].lower = (cfg[num_cfg].lower + 0xffff) & ~0xffff;
279277
280− cfg[num_cfg].upper = cfg[num_cfg].lower;
281− cfg[num_cfg].upper += boot_mem_map.map[i].size - 1;
282− cfg[num_cfg].upper -= skip;
278+ /* Round upper down */
279+ cfg[num_cfg].upper = boot_mem_map.map[i].addr +
280+ boot_mem_map.map[i].size;
281+ cfg[num_cfg].upper = (cfg[num_cfg].upper & ~0xffff) - 1;
283282
284283 cfg[num_cfg].attrs = MIPS_MAAR_S;
285284 num_cfg++;
arch/mn10300/include/asm/uaccess.h+1−0
@@ -166,6 +166,7 @@ struct __large_struct { unsigned long buf[100]; }; · 165 unmodified lines
166166 "2:\n" \
167167 " .section .fixup,\"ax\"\n" \
168168 "3:\n\t" \
169+ " mov 0,%1\n" \
169170 " mov %3,%0\n" \
170171 " jmp 2b\n" \
171172 " .previous\n" \
arch/mn10300/lib/usercopy.c+3−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 * as published by the Free Software Foundation; either version
1010 * 2 of the Licence, or (at your option) any later version.
1111 */
12−#include <asm/uaccess.h>
12+#include <linux/uaccess.h>
1313
1414 unsigned long
1515 __generic_copy_to_user(void *to, const void *from, unsigned long n)
@@ -24,6 +24,8 @@ __generic_copy_from_user(void *to, const void *from, unsigned long n) · 8 unmodified lines
2424 {
2525 if (access_ok(VERIFY_READ, from, n))
2626 __copy_user_zeroing(to, from, n);
27+ else
28+ memset(to, 0, n);
2729 return n;
2830 }
2931
arch/nios2/include/asm/uaccess.h+8−5
@@ -102,9 +102,12 @@ extern long __copy_to_user(void __user *to, const void *from, unsigned long n); · 101 unmodified lines
102102 static inline long copy_from_user(void *to, const void __user *from,
103103 unsigned long n)
104104 {
105− if (!access_ok(VERIFY_READ, from, n))
106− return n;
107− return __copy_from_user(to, from, n);
105+ unsigned long res = n;
106+ if (access_ok(VERIFY_READ, from, n))
107+ res = __copy_from_user(to, from, n);
108+ if (unlikely(res))
109+ memset(to + (n - res), 0, res);
110+ return res;
108111 }
109112
110113 static inline long copy_to_user(void __user *to, const void *from,
@@ -139,7 +142,7 @@ extern long strnlen_user(const char __user *s, long n); · 28 unmodified lines
139142
140143 #define __get_user_unknown(val, size, ptr, err) do { \
141144 err = 0; \
142− if (copy_from_user(&(val), ptr, size)) { \
145+ if (__copy_from_user(&(val), ptr, size)) { \
143146 err = -EFAULT; \
144147 } \
145148 } while (0)
@@ -166,7 +169,7 @@ do { \ · 20 unmodified lines
166169 ({ \
167170 long __gu_err = -EFAULT; \
168171 const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \
169− unsigned long __gu_val; \
172+ unsigned long __gu_val = 0; \
170173 __get_user_common(__gu_val, sizeof(*(ptr)), __gu_ptr, __gu_err);\
171174 (x) = (__force __typeof__(x))__gu_val; \
172175 __gu_err; \
arch/openrisc/include/asm/uaccess.h+11−24
@@ -273,28 +273,20 @@ __copy_tofrom_user(void *to, const void *from, unsigned long size); · 272 unmodified lines
273273 static inline unsigned long
274274 copy_from_user(void *to, const void *from, unsigned long n)
275275 {
276− unsigned long over;
277−
278− if (access_ok(VERIFY_READ, from, n))
279− return __copy_tofrom_user(to, from, n);
280− if ((unsigned long)from < TASK_SIZE) {
281− over = (unsigned long)from + n - TASK_SIZE;
282− return __copy_tofrom_user(to, from, n - over) + over;
283− }
284− return n;
276+ unsigned long res = n;
277+
278+ if (likely(access_ok(VERIFY_READ, from, n)))
279+ res = __copy_tofrom_user(to, from, n);
280+ if (unlikely(res))
281+ memset(to + (n - res), 0, res);
282+ return res;
285283 }
286284
287285 static inline unsigned long
288286 copy_to_user(void *to, const void *from, unsigned long n)
289287 {
290− unsigned long over;
291−
292− if (access_ok(VERIFY_WRITE, to, n))
293− return __copy_tofrom_user(to, from, n);
294− if ((unsigned long)to < TASK_SIZE) {
295− over = (unsigned long)to + n - TASK_SIZE;
296− return __copy_tofrom_user(to, from, n - over) + over;
297− }
288+ if (likely(access_ok(VERIFY_WRITE, to, n)))
289+ n = __copy_tofrom_user(to, from, n);
298290 return n;
299291 }
300292
@@ -303,13 +295,8 @@ extern unsigned long __clear_user(void *addr, unsigned long size); · 2 unmodified lines
303295 static inline __must_check unsigned long
304296 clear_user(void *addr, unsigned long size)
305297 {
306−
307− if (access_ok(VERIFY_WRITE, addr, size))
308− return __clear_user(addr, size);
309− if ((unsigned long)addr < TASK_SIZE) {
310− unsigned long over = (unsigned long)addr + size - TASK_SIZE;
311− return __clear_user(addr, size - over) + over;
312− }
298+ if (likely(access_ok(VERIFY_WRITE, addr, size)))
299+ size = __clear_user(addr, size);
313300 return size;
314301 }
315302
arch/parisc/Kconfig+0−1
@@ -1,6 +1,5 @@
11 config PARISC
22 def_bool y
3− select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
43 select ARCH_MIGHT_HAVE_PC_PARPORT
54 select HAVE_IDE
65 select HAVE_OPROFILE
arch/parisc/configs/c8000_defconfig+0−1
@@ -245,7 +245,6 @@ CONFIG_DEBUG_RT_MUTEXES=y · 244 unmodified lines
245245 CONFIG_PROVE_RCU_DELAY=y
246246 CONFIG_DEBUG_BLOCK_EXT_DEVT=y
247247 CONFIG_LATENCYTOP=y
248−CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y
249248 CONFIG_KEYS=y
250249 # CONFIG_CRYPTO_HW is not set
251250 CONFIG_FONTS=y
arch/parisc/configs/generic-64bit_defconfig+0−1
@@ -291,7 +291,6 @@ CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y · 290 unmodified lines
291291 CONFIG_BOOTPARAM_HUNG_TASK_PANIC=y
292292 # CONFIG_SCHED_DEBUG is not set
293293 CONFIG_TIMER_STATS=y
294−CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y
295294 CONFIG_CRYPTO_MANAGER=y
296295 CONFIG_CRYPTO_ECB=m
297296 CONFIG_CRYPTO_PCBC=m
arch/parisc/include/asm/uaccess.h+16−11
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <asm-generic/uaccess-unaligned.h>
1111
1212 #include <linux/bug.h>
13+#include <linux/string.h>
1314
1415 #define VERIFY_READ 0
1516 #define VERIFY_WRITE 1
@@ -208,26 +209,30 @@ unsigned long copy_in_user(void __user *dst, const void __user *src, unsigned lo · 192 unmodified lines
208209 #define __copy_to_user_inatomic __copy_to_user
209210 #define __copy_from_user_inatomic __copy_from_user
210211
211−extern void copy_from_user_overflow(void)
212−#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
213− __compiletime_error("copy_from_user() buffer size is not provably correct")
214−#else
215− __compiletime_warning("copy_from_user() buffer size is not provably correct")
216−#endif
217−;
212+extern void __compiletime_error("usercopy buffer size is too small")
213+__bad_copy_user(void);
214+
215+static inline void copy_user_overflow(int size, unsigned long count)
216+{
217+ WARN(1, "Buffer overflow detected (%d < %lu)!\n", size, count);
218+}
218219
219220 static inline unsigned long __must_check copy_from_user(void *to,
220221 const void __user *from,
221222 unsigned long n)
222223 {
223224 int sz = __compiletime_object_size(to);
224− int ret = -EFAULT;
225+ unsigned long ret = n;
225226
226− if (likely(sz == -1 || !__builtin_constant_p(n) || sz >= n))
227+ if (likely(sz == -1 || sz >= n))
227228 ret = __copy_from_user(to, from, n);
228− else
229− copy_from_user_overflow();
229+ else if (!__builtin_constant_p(n))
230+ copy_user_overflow(sz, n);
231+ else
232+ __bad_copy_user();
230233
234+ if (unlikely(ret))
235+ memset(to + (n - ret), 0, ret);
231236 return ret;
232237 }
233238
arch/parisc/include/uapi/asm/errno.h+2−2
@@ -97,10 +97,10 @@ · 96 unmodified lines
9797 #define ENOTCONN 235 /* Transport endpoint is not connected */
9898 #define ESHUTDOWN 236 /* Cannot send after transport endpoint shutdown */
9999 #define ETOOMANYREFS 237 /* Too many references: cannot splice */
100−#define EREFUSED ECONNREFUSED /* for HP's NFS apparently */
101100 #define ETIMEDOUT 238 /* Connection timed out */
102101 #define ECONNREFUSED 239 /* Connection refused */
103−#define EREMOTERELEASE 240 /* Remote peer released connection */
102+#define EREFUSED ECONNREFUSED /* for HP's NFS apparently */
103+#define EREMOTERELEASE 240 /* Remote peer released connection */
104104 #define EHOSTDOWN 241 /* Host is down */
105105 #define EHOSTUNREACH 242 /* No route to host */
106106
arch/parisc/kernel/processor.c+0−8
@@ -51,8 +51,6 @@ EXPORT_SYMBOL(_parisc_requires_coherency); · 50 unmodified lines
5151
5252 DEFINE_PER_CPU(struct cpuinfo_parisc, cpu_data);
5353
54−extern int update_cr16_clocksource(void); /* from time.c */
55−
5654 /*
5755 ** PARISC CPU driver - claim "device" and initialize CPU data structures.
5856 **
@@ -228,12 +226,6 @@ static int processor_probe(struct parisc_device *dev) · 169 unmodified lines
228226 }
229227 #endif
230228
231− /* If we've registered more than one cpu,
232− * we'll use the jiffies clocksource since cr16
233− * is not synchronized between CPUs.
234− */
235− update_cr16_clocksource();
236−
237229 return 0;
238230 }
239231
arch/parisc/kernel/time.c+0−12
@@ -221,18 +221,6 @@ static struct clocksource clocksource_cr16 = { · 220 unmodified lines
221221 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
222222 };
223223
224−int update_cr16_clocksource(void)
225−{
226− /* since the cr16 cycle counters are not synchronized across CPUs,
227− we'll check if we should switch to a safe clocksource: */
228− if (clocksource_cr16.rating != 0 && num_online_cpus() > 1) {
229− clocksource_change_rating(&clocksource_cr16, 0);
230− return 1;
231− }
232−
233− return 0;
234−}
235−
236224 void __init start_cpu_itimer(void)
237225 {
238226 unsigned int cpu = smp_processor_id();
arch/powerpc/include/asm/cpu_has_feature.h+1−1
@@ -15,7 +15,7 @@ static inline bool early_cpu_has_feature(unsigned long feature) · 14 unmodified lines
1515 #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECKS
1616 #include <linux/jump_label.h>
1717
18−#define NUM_CPU_FTR_KEYS 64
18+#define NUM_CPU_FTR_KEYS BITS_PER_LONG
1919
2020 extern struct static_key_true cpu_feature_keys[NUM_CPU_FTR_KEYS];
2121
arch/powerpc/include/asm/cputhreads.h+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33
44 #ifndef __ASSEMBLY__
55 #include <linux/cpumask.h>
6+#include <asm/cpu_has_feature.h>
67
78 /*
89 * Mapping of threads to cores
arch/powerpc/include/asm/hmi.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #ifndef __ASM_PPC64_HMI_H__
2222 #define __ASM_PPC64_HMI_H__
2323
24−#ifdef CONFIG_PPC_BOOK3S_64
24+#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
2525
2626 #define CORE_TB_RESYNC_REQ_BIT 63
2727 #define MAX_SUBCORE_PER_CORE 4
arch/powerpc/include/asm/paca.h+7−5
@@ -183,11 +183,6 @@ struct paca_struct { · 182 unmodified lines
183183 */
184184 u16 in_mce;
185185 u8 hmi_event_available; /* HMI event is available */
186− /*
187− * Bitmap for sibling subcore status. See kvm/book3s_hv_ras.c for
188− * more details
189− */
190− struct sibling_subcore_state *sibling_subcore_state;
191186 #endif
192187
193188 /* Stuff for accurate time accounting */
@@ -202,6 +197,13 @@ struct paca_struct { · 8 unmodified lines
202197 struct kvmppc_book3s_shadow_vcpu shadow_vcpu;
203198 #endif
204199 struct kvmppc_host_state kvm_hstate;
200+#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
201+ /*
202+ * Bitmap for sibling subcore status. See kvm/book3s_hv_ras.c for
203+ * more details
204+ */
205+ struct sibling_subcore_state *sibling_subcore_state;
206+#endif
205207 #endif
206208 };
207209
arch/powerpc/include/asm/pci-bridge.h+1−0
@@ -301,6 +301,7 @@ extern void pci_process_bridge_OF_ranges(struct pci_controller *hose, · 300 unmodified lines
301301 /* Allocate & free a PCI host bridge structure */
302302 extern struct pci_controller *pcibios_alloc_controller(struct device_node *dev);
303303 extern void pcibios_free_controller(struct pci_controller *phb);
304+extern void pcibios_free_controller_deferred(struct pci_host_bridge *bridge);
304305
305306 #ifdef CONFIG_PCI
306307 extern int pcibios_vaddr_is_ioport(void __iomem *address);
arch/powerpc/include/asm/uaccess.h+7−31
@@ -308,40 +308,21 @@ extern unsigned long __copy_tofrom_user(void __user *to, · 307 unmodified lines
308308 static inline unsigned long copy_from_user(void *to,
309309 const void __user *from, unsigned long n)
310310 {
311− unsigned long over;
312−
313− if (access_ok(VERIFY_READ, from, n)) {
314− if (!__builtin_constant_p(n))
315− check_object_size(to, n, false);
311+ if (likely(access_ok(VERIFY_READ, from, n))) {
312+ check_object_size(to, n, false);
316313 return __copy_tofrom_user((__force void __user *)to, from, n);
317314 }
318− if ((unsigned long)from < TASK_SIZE) {
319− over = (unsigned long)from + n - TASK_SIZE;
320− if (!__builtin_constant_p(n - over))
321− check_object_size(to, n - over, false);
322− return __copy_tofrom_user((__force void __user *)to, from,
323− n - over) + over;
324− }
315+ memset(to, 0, n);
325316 return n;
326317 }
327318
328319 static inline unsigned long copy_to_user(void __user *to,
329320 const void *from, unsigned long n)
330321 {
331− unsigned long over;
332−
333322 if (access_ok(VERIFY_WRITE, to, n)) {
334− if (!__builtin_constant_p(n))
335− check_object_size(from, n, true);
323+ check_object_size(from, n, true);
336324 return __copy_tofrom_user(to, (__force void __user *)from, n);
337325 }
338− if ((unsigned long)to < TASK_SIZE) {
339− over = (unsigned long)to + n - TASK_SIZE;
340− if (!__builtin_constant_p(n))
341− check_object_size(from, n - over, true);
342− return __copy_tofrom_user(to, (__force void __user *)from,
343− n - over) + over;
344− }
345326 return n;
346327 }
347328
@@ -383,8 +364,7 @@ static inline unsigned long __copy_from_user_inatomic(void *to, · 35 unmodified lines
383364 return 0;
384365 }
385366
386− if (!__builtin_constant_p(n))
387− check_object_size(to, n, false);
367+ check_object_size(to, n, false);
388368
389369 return __copy_tofrom_user((__force void __user *)to, from, n);
390370 }
@@ -412,8 +392,8 @@ static inline unsigned long __copy_to_user_inatomic(void __user *to, · 21 unmodified lines
412392 if (ret == 0)
413393 return 0;
414394 }
415− if (!__builtin_constant_p(n))
416− check_object_size(from, n, true);
395+
396+ check_object_size(from, n, true);
417397
418398 return __copy_tofrom_user(to, (__force const void __user *)from, n);
419399 }
@@ -439,10 +419,6 @@ static inline unsigned long clear_user(void __user *addr, unsigned long size) · 19 unmodified lines
439419 might_fault();
440420 if (likely(access_ok(VERIFY_WRITE, addr, size)))
441421 return __clear_user(addr, size);
442− if ((unsigned long)addr < TASK_SIZE) {
443− unsigned long over = (unsigned long)addr + size - TASK_SIZE;
444− return __clear_user(addr, size - over) + over;
445− }
446422 return size;
447423 }
448424
arch/powerpc/kernel/Makefile+1−1
@@ -41,7 +41,7 @@ obj-$(CONFIG_VDSO32) += vdso32/ · 40 unmodified lines
4141 obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
4242 obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_ppc970.o cpu_setup_pa6t.o
4343 obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_power.o
44−obj-$(CONFIG_PPC_BOOK3S_64) += mce.o mce_power.o hmi.o
44+obj-$(CONFIG_PPC_BOOK3S_64) += mce.o mce_power.o
4545 obj-$(CONFIG_PPC_BOOK3E_64) += exceptions-64e.o idle_book3e.o
4646 obj-$(CONFIG_PPC64) += vdso64/
4747 obj-$(CONFIG_ALTIVEC) += vecemu.o
arch/powerpc/kernel/entry_64.S+6−6
@@ -368,13 +368,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) · 367 unmodified lines
368368 tabort_syscall:
369369 /* Firstly we need to enable TM in the kernel */
370370 mfmsr r10
371− li r13, 1
372− rldimi r10, r13, MSR_TM_LG, 63-MSR_TM_LG
371+ li r9, 1
372+ rldimi r10, r9, MSR_TM_LG, 63-MSR_TM_LG
373373 mtmsrd r10, 0
374374
375375 /* tabort, this dooms the transaction, nothing else */
376− li r13, (TM_CAUSE_SYSCALL|TM_CAUSE_PERSISTENT)
377− TABORT(R13)
376+ li r9, (TM_CAUSE_SYSCALL|TM_CAUSE_PERSISTENT)
377+ TABORT(R9)
378378
379379 /*
380380 * Return directly to userspace. We have corrupted user register state,
@@ -382,8 +382,8 @@ tabort_syscall: · 1 unmodified line
382382 * resume after the tbegin of the aborted transaction with the
383383 * checkpointed register state.
384384 */
385− li r13, MSR_RI
386− andc r10, r10, r13
385+ li r9, MSR_RI
386+ andc r10, r10, r9
387387 mtmsrd r10, 1
388388 mtspr SPRN_SRR0, r11
389389 mtspr SPRN_SRR1, r12
arch/powerpc/kernel/exceptions-64s.S+24−5
@@ -485,7 +485,23 @@ machine_check_fwnmi: · 484 unmodified lines
485485 EXCEPTION_PROLOG_0(PACA_EXMC)
486486 machine_check_pSeries_0:
487487 EXCEPTION_PROLOG_1(PACA_EXMC, KVMTEST, 0x200)
488− EXCEPTION_PROLOG_PSERIES_1(machine_check_common, EXC_STD)
488+ /*
489+ * The following is essentially EXCEPTION_PROLOG_PSERIES_1 with the
490+ * difference that MSR_RI is not enabled, because PACA_EXMC is being
491+ * used, so nested machine check corrupts it. machine_check_common
492+ * enables MSR_RI.
493+ */
494+ ld r12,PACAKBASE(r13)
495+ ld r10,PACAKMSR(r13)
496+ xori r10,r10,MSR_RI
497+ mfspr r11,SPRN_SRR0
498+ LOAD_HANDLER(r12, machine_check_common)
499+ mtspr SPRN_SRR0,r12
500+ mfspr r12,SPRN_SRR1
501+ mtspr SPRN_SRR1,r10
502+ rfid
503+ b . /* prevent speculative execution */
504+
489505 KVM_HANDLER_SKIP(PACA_EXMC, EXC_STD, 0x200)
490506 KVM_HANDLER_SKIP(PACA_EXGEN, EXC_STD, 0x300)
491507 KVM_HANDLER_SKIP(PACA_EXSLB, EXC_STD, 0x380)
@@ -969,14 +985,17 @@ ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX) · 477 unmodified lines
969985 machine_check_common:
970986
971987 mfspr r10,SPRN_DAR
972− std r10,PACA_EXGEN+EX_DAR(r13)
988+ std r10,PACA_EXMC+EX_DAR(r13)
973989 mfspr r10,SPRN_DSISR
974− stw r10,PACA_EXGEN+EX_DSISR(r13)
990+ stw r10,PACA_EXMC+EX_DSISR(r13)
975991 EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC)
976992 FINISH_NAP
977993 RECONCILE_IRQ_STATE(r10, r11)
978− ld r3,PACA_EXGEN+EX_DAR(r13)
979− lwz r4,PACA_EXGEN+EX_DSISR(r13)
994+ ld r3,PACA_EXMC+EX_DAR(r13)
995+ lwz r4,PACA_EXMC+EX_DSISR(r13)
996+ /* Enable MSR_RI when finished with PACA_EXMC */
997+ li r10,MSR_RI
998+ mtmsrd r10,1
980999 std r3,_DAR(r1)
9811000 std r4,_DSISR(r1)
9821001 bl save_nvgprs
arch/powerpc/kernel/idle_book3s.S+5−5
@@ -411,7 +411,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300) · 410 unmodified lines
411411 *
412412 * r13 - PACA
413413 * cr3 - gt if waking up with partial/complete hypervisor state loss
414− * cr4 - eq if waking up from complete hypervisor state loss.
414+ * cr4 - gt or eq if waking up from complete hypervisor state loss.
415415 */
416416 _GLOBAL(pnv_wakeup_tb_loss)
417417 ld r1,PACAR1(r13)
@@ -453,7 +453,7 @@ lwarx_loop2: · 35 unmodified lines
453453 * At this stage
454454 * cr2 - eq if first thread to wakeup in core
455455 * cr3- gt if waking up with partial/complete hypervisor state loss
456− * cr4 - eq if waking up from complete hypervisor state loss.
456+ * cr4 - gt or eq if waking up from complete hypervisor state loss.
457457 */
458458
459459 ori r15,r15,PNV_CORE_IDLE_LOCK_BIT
@@ -481,7 +481,7 @@ first_thread_in_subcore: · 21 unmodified lines
481481 * If waking up from sleep, subcore state is not lost. Hence
482482 * skip subcore state restore
483483 */
484− bne cr4,subcore_state_restored
484+ blt cr4,subcore_state_restored
485485
486486 /* Restore per-subcore state */
487487 ld r4,_SDR1(r1)
@@ -526,7 +526,7 @@ timebase_resync: · 38 unmodified lines
526526 * If waking up from sleep, per core state is not lost, skip to
527527 * clear_lock.
528528 */
529− bne cr4,clear_lock
529+ blt cr4,clear_lock
530530
531531 /*
532532 * First thread in the core to wake up and its waking up with
@@ -557,7 +557,7 @@ common_exit: · 24 unmodified lines
557557 * If waking up from sleep, hypervisor state is not lost. Hence
558558 * skip hypervisor state restore.
559559 */
560− bne cr4,hypervisor_state_restored
560+ blt cr4,hypervisor_state_restored
561561
562562 /* Waking up from winkle */
563563
arch/powerpc/kernel/kprobes.c+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 #include <linux/kprobes.h>
3030 #include <linux/ptrace.h>
3131 #include <linux/preempt.h>
32−#include <linux/module.h>
32+#include <linux/extable.h>
3333 #include <linux/kdebug.h>
3434 #include <linux/slab.h>
3535 #include <asm/code-patching.h>
arch/powerpc/kernel/pci-common.c+36−0
@@ -153,6 +153,42 @@ void pcibios_free_controller(struct pci_controller *phb) · 152 unmodified lines
153153 }
154154 EXPORT_SYMBOL_GPL(pcibios_free_controller);
155155
156+/*
157+ * This function is used to call pcibios_free_controller()
158+ * in a deferred manner: a callback from the PCI subsystem.
159+ *
160+ * _*DO NOT*_ call pcibios_free_controller() explicitly if
161+ * this is used (or it may access an invalid *phb pointer).
162+ *
163+ * The callback occurs when all references to the root bus
164+ * are dropped (e.g., child buses/devices and their users).
165+ *
166+ * It's called as .release_fn() of 'struct pci_host_bridge'
167+ * which is associated with the 'struct pci_controller.bus'
168+ * (root bus) - it expects .release_data to hold a pointer
169+ * to 'struct pci_controller'.
170+ *
171+ * In order to use it, register .release_fn()/release_data
172+ * like this:
173+ *
174+ * pci_set_host_bridge_release(bridge,
175+ * pcibios_free_controller_deferred
176+ * (void *) phb);
177+ *
178+ * e.g. in the pcibios_root_bridge_prepare() callback from
179+ * pci_create_root_bus().
180+ */
181+void pcibios_free_controller_deferred(struct pci_host_bridge *bridge)
182+{
183+ struct pci_controller *phb = (struct pci_controller *)
184+ bridge->release_data;
185+
186+ pr_debug("domain %d, dynamic %d\n", phb->global_number, phb->is_dynamic);
187+
188+ pcibios_free_controller(phb);
189+}
190+EXPORT_SYMBOL_GPL(pcibios_free_controller_deferred);
191+
156192 /*
157193 * The function is used to return the minimal alignment
158194 * for memory or I/O windows of the associated P2P bridge.
arch/powerpc/kernel/prom_init.c+6−3
@@ -695,7 +695,7 @@ unsigned char ibm_architecture_vec[] = { · 694 unmodified lines
695695 OV4_MIN_ENT_CAP, /* minimum VP entitled capacity */
696696
697697 /* option vector 5: PAPR/OF options */
698− VECTOR_LENGTH(18), /* length */
698+ VECTOR_LENGTH(21), /* length */
699699 0, /* don't ignore, don't halt */
700700 OV5_FEAT(OV5_LPAR) | OV5_FEAT(OV5_SPLPAR) | OV5_FEAT(OV5_LARGE_PAGES) |
701701 OV5_FEAT(OV5_DRCONF_MEMORY) | OV5_FEAT(OV5_DONATE_DEDICATE_CPU) |
@@ -726,8 +726,11 @@ unsigned char ibm_architecture_vec[] = { · 24 unmodified lines
726726 0,
727727 0,
728728 OV5_FEAT(OV5_PFO_HW_RNG) | OV5_FEAT(OV5_PFO_HW_ENCR) |
729− OV5_FEAT(OV5_PFO_HW_842),
730− OV5_FEAT(OV5_SUB_PROCESSORS),
729+ OV5_FEAT(OV5_PFO_HW_842), /* Byte 17 */
730+ 0, /* Byte 18 */
731+ 0, /* Byte 19 */
732+ 0, /* Byte 20 */
733+ OV5_FEAT(OV5_SUB_PROCESSORS), /* Byte 21 */
731734
732735 /* option vector 6: IBM PAPR hints */
733736 VECTOR_LENGTH(3), /* length */
arch/powerpc/kernel/signal_32.c+14−0
@@ -1226,7 +1226,21 @@ long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8, · 1225 unmodified lines
12261226 (regs->gpr[1] + __SIGNAL_FRAMESIZE + 16);
12271227 if (!access_ok(VERIFY_READ, rt_sf, sizeof(*rt_sf)))
12281228 goto bad;
1229+
12291230 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
1231+ /*
1232+ * If there is a transactional state then throw it away.
1233+ * The purpose of a sigreturn is to destroy all traces of the
1234+ * signal frame, this includes any transactional state created
1235+ * within in. We only check for suspended as we can never be
1236+ * active in the kernel, we are active, there is nothing better to
1237+ * do than go ahead and Bad Thing later.
1238+ * The cause is not important as there will never be a
1239+ * recheckpoint so it's not user visible.
1240+ */
1241+ if (MSR_TM_SUSPENDED(mfmsr()))
1242+ tm_reclaim_current(0);
1243+
12301244 if (__get_user(tmp, &rt_sf->uc.uc_link))
12311245 goto bad;
12321246 uc_transact = (struct ucontext __user *)(uintptr_t)tmp;
arch/powerpc/kernel/signal_64.c+14−0
@@ -676,7 +676,21 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, · 675 unmodified lines
676676 if (__copy_from_user(&set, &uc->uc_sigmask, sizeof(set)))
677677 goto badframe;
678678 set_current_blocked(&set);
679+
679680 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
681+ /*
682+ * If there is a transactional state then throw it away.
683+ * The purpose of a sigreturn is to destroy all traces of the
684+ * signal frame, this includes any transactional state created
685+ * within in. We only check for suspended as we can never be
686+ * active in the kernel, we are active, there is nothing better to
687+ * do than go ahead and Bad Thing later.
688+ * The cause is not important as there will never be a
689+ * recheckpoint so it's not user visible.
690+ */
691+ if (MSR_TM_SUSPENDED(mfmsr()))
692+ tm_reclaim_current(0);
693+
680694 if (__get_user(msr, &uc->uc_mcontext.gp_regs[PT_MSR]))
681695 goto badframe;
682696 if (MSR_TM_ACTIVE(msr)) {
arch/powerpc/kernel/smp.c+1−1
@@ -830,7 +830,7 @@ int __cpu_disable(void) · 829 unmodified lines
830830
831831 /* Update sibling maps */
832832 base = cpu_first_thread_sibling(cpu);
833− for (i = 0; i < threads_per_core; i++) {
833+ for (i = 0; i < threads_per_core && base + i < nr_cpu_ids; i++) {
834834 cpumask_clear_cpu(cpu, cpu_sibling_mask(base + i));
835835 cpumask_clear_cpu(base + i, cpu_sibling_mask(cpu));
836836 cpumask_clear_cpu(cpu, cpu_core_mask(base + i));
arch/powerpc/kernel/traps.c+2−1
@@ -25,7 +25,8 @@ · 24 unmodified lines
2525 #include <linux/user.h>
2626 #include <linux/interrupt.h>
2727 #include <linux/init.h>
28−#include <linux/module.h>
28+#include <linux/extable.h>
29+#include <linux/module.h> /* print_modules */
2930 #include <linux/prctl.h>
3031 #include <linux/delay.h>
3132 #include <linux/kprobes.h>
arch/powerpc/kvm/Makefile+1−0
@@ -78,6 +78,7 @@ kvm-book3s_64-builtin-xics-objs-$(CONFIG_KVM_XICS) := \ · 77 unmodified lines
7878
7979 ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
8080 kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HANDLER) += \
81+ book3s_hv_hmi.o \
8182 book3s_hv_rmhandlers.o \
8283 book3s_hv_rm_mmu.o \
8384 book3s_hv_ras.o \
arch/powerpc/kvm/book3s_hv_hmi.crenamed from arch/powerpc/kernel/hmi.c+0−0

File renamed without changes.

arch/powerpc/lib/checksum_32.S+4−3
@@ -127,18 +127,19 @@ _GLOBAL(csum_partial_copy_generic) · 126 unmodified lines
127127 stw r7,12(r1)
128128 stw r8,8(r1)
129129
130− rlwinm r0,r4,3,0x8
131− rlwnm r6,r6,r0,0,31 /* odd destination address: rotate one byte */
132− cmplwi cr7,r0,0 /* is destination address even ? */
133130 addic r12,r6,0
134131 addi r6,r4,-4
135132 neg r0,r4
136133 addi r4,r3,-4
137134 andi. r0,r0,CACHELINE_MASK /* # bytes to start of cache line */
135+ crset 4*cr7+eq
138136 beq 58f
139137
140138 cmplw 0,r5,r0 /* is this more than total to do? */
141139 blt 63f /* if not much to do */
140+ rlwinm r7,r6,3,0x8
141+ rlwnm r12,r12,r7,0,31 /* odd destination address: rotate one byte */
142+ cmplwi cr7,r7,0 /* is destination address even ? */
142143 andi. r8,r0,3 /* get it word-aligned first */
143144 mtctr r8
144145 beq+ 61f
arch/powerpc/mm/fault.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 #include <linux/mm.h>
2727 #include <linux/interrupt.h>
2828 #include <linux/highmem.h>
29−#include <linux/module.h>
29+#include <linux/extable.h>
3030 #include <linux/kprobes.h>
3131 #include <linux/kdebug.h>
3232 #include <linux/perf_event.h>
arch/powerpc/mm/slb_low.S+6−1
@@ -113,7 +113,12 @@ BEGIN_FTR_SECTION · 112 unmodified lines
113113 END_MMU_FTR_SECTION_IFCLR(MMU_FTR_1T_SEGMENT)
114114 b slb_finish_load_1T
115115
116−0:
116+0: /*
117+ * For userspace addresses, make sure this is region 0.
118+ */
119+ cmpdi r9, 0
120+ bne 8f
121+
117122 /* when using slices, we extract the psize off the slice bitmaps
118123 * and then we need to get the sllp encoding off the mmu_psize_defs
119124 * array.
arch/powerpc/platforms/512x/mpc512x_lpbfifo.c+0−1
@@ -528,7 +528,6 @@ static struct platform_driver mpc512x_lpbfifo_driver = { · 527 unmodified lines
528528 .remove = mpc512x_lpbfifo_remove,
529529 .driver = {
530530 .name = DRV_NAME,
531− .owner = THIS_MODULE,
532531 .of_match_table = mpc512x_lpbfifo_match,
533532 },
534533 };
arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c+0−1
@@ -222,7 +222,6 @@ static const struct of_device_id mcu_of_match_table[] = { · 221 unmodified lines
222222 static struct i2c_driver mcu_driver = {
223223 .driver = {
224224 .name = "mcu-mpc8349emitx",
225− .owner = THIS_MODULE,
226225 .of_match_table = mcu_of_match_table,
227226 },
228227 .probe = mcu_probe,
arch/powerpc/platforms/embedded6xx/holly.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 #include <linux/tty.h>
2727 #include <linux/serial_core.h>
2828 #include <linux/of_platform.h>
29−#include <linux/module.h>
29+#include <linux/extable.h>
3030
3131 #include <asm/time.h>
3232 #include <asm/machdep.h>
arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 #include <linux/pci.h>
2424 #include <linux/kdev_t.h>
2525 #include <linux/console.h>
26−#include <linux/module.h>
26+#include <linux/extable.h>
2727 #include <linux/delay.h>
2828 #include <linux/irq.h>
2929 #include <linux/seq_file.h>
arch/powerpc/platforms/powernv/opal-dump.c+6−1
@@ -370,6 +370,7 @@ static irqreturn_t process_dump(int irq, void *data) · 369 unmodified lines
370370 uint32_t dump_id, dump_size, dump_type;
371371 struct dump_obj *dump;
372372 char name[22];
373+ struct kobject *kobj;
373374
374375 rc = dump_read_info(&dump_id, &dump_size, &dump_type);
375376 if (rc != OPAL_SUCCESS)
@@ -381,8 +382,12 @@ static irqreturn_t process_dump(int irq, void *data) · 5 unmodified lines
381382 * that gracefully and not create two conflicting
382383 * entries.
383384 */
384− if (kset_find_obj(dump_kset, name))
385+ kobj = kset_find_obj(dump_kset, name);
386+ if (kobj) {
387+ /* Drop reference added by kset_find_obj() */
388+ kobject_put(kobj);
385389 return 0;
390+ }
386391
387392 dump = create_dump_obj(dump_id, dump_size, dump_type);
388393 if (!dump)
arch/powerpc/platforms/powernv/opal-elog.c+6−1
@@ -247,6 +247,7 @@ static irqreturn_t elog_event(int irq, void *data) · 246 unmodified lines
247247 uint64_t elog_type;
248248 int rc;
249249 char name[2+16+1];
250+ struct kobject *kobj;
250251
251252 rc = opal_get_elog_size(&id, &size, &type);
252253 if (rc != OPAL_SUCCESS) {
@@ -269,8 +270,12 @@ static irqreturn_t elog_event(int irq, void *data) · 16 unmodified lines
269270 * that gracefully and not create two conflicting
270271 * entries.
271272 */
272− if (kset_find_obj(elog_kset, name))
273+ kobj = kset_find_obj(elog_kset, name);
274+ if (kobj) {
275+ /* Drop reference added by kset_find_obj() */
276+ kobject_put(kobj);
273277 return IRQ_HANDLED;
278+ }
274279
275280 create_elog_obj(log_id, elog_size, elog_type);
276281
arch/powerpc/platforms/powernv/pci-ioda.c+44−13
@@ -124,6 +124,13 @@ static inline bool pnv_pci_is_m64(struct pnv_phb *phb, struct resource *r) · 123 unmodified lines
124124 r->start < (phb->ioda.m64_base + phb->ioda.m64_size));
125125 }
126126
127+static inline bool pnv_pci_is_m64_flags(unsigned long resource_flags)
128+{
129+ unsigned long flags = (IORESOURCE_MEM_64 | IORESOURCE_PREFETCH);
130+
131+ return (resource_flags & flags) == flags;
132+}
133+
127134 static struct pnv_ioda_pe *pnv_ioda_init_pe(struct pnv_phb *phb, int pe_no)
128135 {
129136 phb->ioda.pe_array[pe_no].phb = phb;
@@ -149,7 +156,7 @@ static void pnv_ioda_reserve_pe(struct pnv_phb *phb, int pe_no) · 19 unmodified lines
149156
150157 static struct pnv_ioda_pe *pnv_ioda_alloc_pe(struct pnv_phb *phb)
151158 {
152− unsigned long pe = phb->ioda.total_pe_num - 1;
159+ long pe;
153160
154161 for (pe = phb->ioda.total_pe_num - 1; pe >= 0; pe--) {
155162 if (!test_and_set_bit(pe, phb->ioda.pe_alloc))
@@ -162,11 +169,12 @@ static struct pnv_ioda_pe *pnv_ioda_alloc_pe(struct pnv_phb *phb) · 6 unmodified lines
162169 static void pnv_ioda_free_pe(struct pnv_ioda_pe *pe)
163170 {
164171 struct pnv_phb *phb = pe->phb;
172+ unsigned int pe_num = pe->pe_number;
165173
166174 WARN_ON(pe->pdev);
167175
168176 memset(pe, 0, sizeof(struct pnv_ioda_pe));
169− clear_bit(pe->pe_number, phb->ioda.pe_alloc);
177+ clear_bit(pe_num, phb->ioda.pe_alloc);
170178 }
171179
172180 /* The default M64 BAR is shared by all PEs */
@@ -2216,7 +2224,7 @@ static long pnv_pci_ioda2_set_window(struct iommu_table_group *table_group, · 2043 unmodified lines
22162224
22172225 pnv_pci_link_table_and_group(phb->hose->node, num,
22182226 tbl, &pe->table_group);
2219− pnv_pci_phb3_tce_invalidate_pe(pe);
2227+ pnv_pci_ioda2_tce_invalidate_pe(pe);
22202228
22212229 return 0;
22222230 }
@@ -2354,7 +2362,7 @@ static long pnv_pci_ioda2_unset_window(struct iommu_table_group *table_group, · 131 unmodified lines
23542362 if (ret)
23552363 pe_warn(pe, "Unmapping failed, ret = %ld\n", ret);
23562364 else
2357− pnv_pci_phb3_tce_invalidate_pe(pe);
2365+ pnv_pci_ioda2_tce_invalidate_pe(pe);
23582366
23592367 pnv_pci_unlink_table_and_group(table_group->tables[num], table_group);
23602368
@@ -2870,7 +2878,7 @@ static void pnv_pci_ioda_fixup_iov_resources(struct pci_dev *pdev) · 509 unmodified lines
28702878 res = &pdev->resource[i + PCI_IOV_RESOURCES];
28712879 if (!res->flags || res->parent)
28722880 continue;
2873− if (!pnv_pci_is_m64(phb, res)) {
2881+ if (!pnv_pci_is_m64_flags(res->flags)) {
28742882 dev_warn(&pdev->dev, "Don't support SR-IOV with"
28752883 " non M64 VF BAR%d: %pR. \n",
28762884 i, res);
@@ -3095,7 +3103,7 @@ static resource_size_t pnv_pci_window_alignment(struct pci_bus *bus, · 218 unmodified lines
30953103 * alignment for any 64-bit resource, PCIe doesn't care and
30963104 * bridges only do 64-bit prefetchable anyway.
30973105 */
3098− if (phb->ioda.m64_segsize && (type & IORESOURCE_MEM_64))
3106+ if (phb->ioda.m64_segsize && pnv_pci_is_m64_flags(type))
30993107 return phb->ioda.m64_segsize;
31003108 if (type & IORESOURCE_MEM)
31013109 return phb->ioda.m32_segsize;
@@ -3402,12 +3410,6 @@ static void pnv_ioda_release_pe(struct pnv_ioda_pe *pe) · 300 unmodified lines
34023410 struct pnv_phb *phb = pe->phb;
34033411 struct pnv_ioda_pe *slave, *tmp;
34043412
3405− /* Release slave PEs in compound PE */
3406− if (pe->flags & PNV_IODA_PE_MASTER) {
3407− list_for_each_entry_safe(slave, tmp, &pe->slaves, list)
3408− pnv_ioda_release_pe(slave);
3409− }
3410−
34113413 list_del(&pe->list);
34123414 switch (phb->type) {
34133415 case PNV_PHB_IODA1:
@@ -3422,7 +3424,26 @@ static void pnv_ioda_release_pe(struct pnv_ioda_pe *pe) · 8 unmodified lines
34223424
34233425 pnv_ioda_release_pe_seg(pe);
34243426 pnv_ioda_deconfigure_pe(pe->phb, pe);
3425− pnv_ioda_free_pe(pe);
3427+
3428+ /* Release slave PEs in the compound PE */
3429+ if (pe->flags & PNV_IODA_PE_MASTER) {
3430+ list_for_each_entry_safe(slave, tmp, &pe->slaves, list) {
3431+ list_del(&slave->list);
3432+ pnv_ioda_free_pe(slave);
3433+ }
3434+ }
3435+
3436+ /*
3437+ * The PE for root bus can be removed because of hotplug in EEH
3438+ * recovery for fenced PHB error. We need to mark the PE dead so
3439+ * that it can be populated again in PCI hot add path. The PE
3440+ * shouldn't be destroyed as it's the global reserved resource.
3441+ */
3442+ if (phb->ioda.root_pe_populated &&
3443+ phb->ioda.root_pe_idx == pe->pe_number)
3444+ phb->ioda.root_pe_populated = false;
3445+ else
3446+ pnv_ioda_free_pe(pe);
34263447 }
34273448
34283449 static void pnv_pci_release_device(struct pci_dev *pdev)
@@ -3438,7 +3459,17 @@ static void pnv_pci_release_device(struct pci_dev *pdev) · 9 unmodified lines
34383459 if (!pdn || pdn->pe_number == IODA_INVALID_PE)
34393460 return;
34403461
3462+ /*
3463+ * PCI hotplug can happen as part of EEH error recovery. The @pdn
3464+ * isn't removed and added afterwards in this scenario. We should
3465+ * set the PE number in @pdn to an invalid one. Otherwise, the PE's
3466+ * device count is decreased on removing devices while failing to
3467+ * be increased on adding devices. It leads to unbalanced PE's device
3468+ * count and eventually make normal PCI hotplug path broken.
3469+ */
34413470 pe = &phb->ioda.pe_array[pdn->pe_number];
3471+ pdn->pe_number = IODA_INVALID_PE;
3472+
34423473 WARN_ON(--pe->device_count < 0);
34433474 if (pe->device_count == 0)
34443475 pnv_ioda_release_pe(pe);
arch/powerpc/platforms/pseries/pci.c+4−0
@@ -119,6 +119,10 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge) · 118 unmodified lines
119119
120120 bus = bridge->bus;
121121
122+ /* Rely on the pcibios_free_controller_deferred() callback. */
123+ pci_set_host_bridge_release(bridge, pcibios_free_controller_deferred,
124+ (void *) pci_bus_to_host(bus));
125+
122126 dn = pcibios_get_phb_of_node(bus);
123127 if (!dn)
124128 return 0;
arch/powerpc/platforms/pseries/pci_dlpar.c+5−2
@@ -106,8 +106,11 @@ int remove_phb_dynamic(struct pci_controller *phb) · 105 unmodified lines
106106 release_resource(res);
107107 }
108108
109− /* Free pci_controller data structure */
110− pcibios_free_controller(phb);
109+ /*
110+ * The pci_controller data structure is freed by
111+ * the pcibios_free_controller_deferred() callback;
112+ * see pseries_root_bridge_prepare().
113+ */
111114
112115 return 0;
113116 }
arch/powerpc/platforms/pseries/setup.c+1−1
@@ -41,7 +41,6 @@ · 40 unmodified lines
4141 #include <linux/root_dev.h>
4242 #include <linux/of.h>
4343 #include <linux/of_pci.h>
44−#include <linux/kexec.h>
4544
4645 #include <asm/mmu.h>
4746 #include <asm/processor.h>
@@ -66,6 +65,7 @@ · 18 unmodified lines
6665 #include <asm/eeh.h>
6766 #include <asm/reg.h>
6867 #include <asm/plpar_wrappers.h>
68+#include <asm/kexec.h>
6969
7070 #include "pseries.h"
7171
arch/powerpc/sysdev/cpm1.c+4−2
@@ -534,7 +534,8 @@ struct cpm1_gpio16_chip { · 533 unmodified lines
534534
535535 static void cpm1_gpio16_save_regs(struct of_mm_gpio_chip *mm_gc)
536536 {
537− struct cpm1_gpio16_chip *cpm1_gc = gpiochip_get_data(&mm_gc->gc);
537+ struct cpm1_gpio16_chip *cpm1_gc =
538+ container_of(mm_gc, struct cpm1_gpio16_chip, mm_gc);
538539 struct cpm_ioport16 __iomem *iop = mm_gc->regs;
539540
540541 cpm1_gc->cpdata = in_be16(&iop->dat);
@@ -649,7 +650,8 @@ struct cpm1_gpio32_chip { · 108 unmodified lines
649650
650651 static void cpm1_gpio32_save_regs(struct of_mm_gpio_chip *mm_gc)
651652 {
652− struct cpm1_gpio32_chip *cpm1_gc = gpiochip_get_data(&mm_gc->gc);
653+ struct cpm1_gpio32_chip *cpm1_gc =
654+ container_of(mm_gc, struct cpm1_gpio32_chip, mm_gc);
653655 struct cpm_ioport32b __iomem *iop = mm_gc->regs;
654656
655657 cpm1_gc->cpdata = in_be32(&iop->dat);
arch/powerpc/sysdev/cpm_common.c+2−1
@@ -94,7 +94,8 @@ struct cpm2_gpio32_chip { · 93 unmodified lines
9494
9595 static void cpm2_gpio32_save_regs(struct of_mm_gpio_chip *mm_gc)
9696 {
97− struct cpm2_gpio32_chip *cpm2_gc = gpiochip_get_data(&mm_gc->gc);
97+ struct cpm2_gpio32_chip *cpm2_gc =
98+ container_of(mm_gc, struct cpm2_gpio32_chip, mm_gc);
9899 struct cpm2_ioports __iomem *iop = mm_gc->regs;
99100
100101 cpm2_gc->cpdata = in_be32(&iop->dat);
arch/powerpc/sysdev/fsl_rio.c+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 */
2424
2525 #include <linux/init.h>
26−#include <linux/module.h>
26+#include <linux/extable.h>
2727 #include <linux/types.h>
2828 #include <linux/dma-mapping.h>
2929 #include <linux/interrupt.h>
arch/powerpc/sysdev/xics/icp-opal.c+7−5
@@ -23,10 +23,10 @@ · 22 unmodified lines
2323
2424 static void icp_opal_teardown_cpu(void)
2525 {
26− int cpu = smp_processor_id();
26+ int hw_cpu = hard_smp_processor_id();
2727
2828 /* Clear any pending IPI */
29− opal_int_set_mfrr(cpu, 0xff);
29+ opal_int_set_mfrr(hw_cpu, 0xff);
3030 }
3131
3232 static void icp_opal_flush_ipi(void)
@@ -101,14 +101,16 @@ static void icp_opal_eoi(struct irq_data *d) · 68 unmodified lines
101101
102102 static void icp_opal_cause_ipi(int cpu, unsigned long data)
103103 {
104− opal_int_set_mfrr(cpu, IPI_PRIORITY);
104+ int hw_cpu = get_hard_smp_processor_id(cpu);
105+
106+ opal_int_set_mfrr(hw_cpu, IPI_PRIORITY);
105107 }
106108
107109 static irqreturn_t icp_opal_ipi_action(int irq, void *dev_id)
108110 {
109− int cpu = smp_processor_id();
111+ int hw_cpu = hard_smp_processor_id();
110112
111− opal_int_set_mfrr(cpu, 0xff);
113+ opal_int_set_mfrr(hw_cpu, 0xff);
112114
113115 return smp_ipi_demux();
114116 }
arch/s390/Kconfig+0−1
@@ -68,7 +68,6 @@ config DEBUG_RODATA · 67 unmodified lines
6868 config S390
6969 def_bool y
7070 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
71− select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
7271 select ARCH_HAS_DEVMEM_IS_ALLOWED
7372 select ARCH_HAS_ELF_RANDOMIZE
7473 select ARCH_HAS_GCOV_PROFILE_ALL
arch/s390/boot/compressed/head.S+8−3
@@ -21,16 +21,21 @@ ENTRY(startup_continue) · 20 unmodified lines
2121 lg %r15,.Lstack-.LPG1(%r13)
2222 aghi %r15,-160
2323 brasl %r14,decompress_kernel
24− # setup registers for memory mover & branch to target
24+ # Set up registers for memory mover. We move the decompressed image to
25+ # 0x11000, starting at offset 0x11000 in the decompressed image so
26+ # that code living at 0x11000 in the image will end up at 0x11000 in
27+ # memory.
2528 lgr %r4,%r2
2629 lg %r2,.Loffset-.LPG1(%r13)
2730 la %r4,0(%r2,%r4)
2831 lg %r3,.Lmvsize-.LPG1(%r13)
2932 lgr %r5,%r3
30− # move the memory mover someplace safe
33+ # Move the memory mover someplace safe so it doesn't overwrite itself.
3134 la %r1,0x200
3235 mvc 0(mover_end-mover,%r1),mover-.LPG1(%r13)
33− # decompress image is started at 0x11000
36+ # When the memory mover is done we pass control to
37+ # arch/s390/kernel/head64.S:startup_continue which lives at 0x11000 in
38+ # the decompressed image.
3439 lgr %r6,%r2
3540 br %r1
3641 mover:
arch/s390/configs/default_defconfig+1−2
@@ -602,7 +602,6 @@ CONFIG_FAIL_FUTEX=y · 601 unmodified lines
602602 CONFIG_FAULT_INJECTION_DEBUG_FS=y
603603 CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y
604604 CONFIG_LATENCYTOP=y
605−CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y
606605 CONFIG_IRQSOFF_TRACER=y
607606 CONFIG_PREEMPT_TRACER=y
608607 CONFIG_SCHED_TRACER=y
@@ -678,7 +677,7 @@ CONFIG_CRYPTO_SHA512_S390=m · 69 unmodified lines
678677 CONFIG_CRYPTO_DES_S390=m
679678 CONFIG_CRYPTO_AES_S390=m
680679 CONFIG_CRYPTO_GHASH_S390=m
681−CONFIG_CRYPTO_CRC32_S390=m
680+CONFIG_CRYPTO_CRC32_S390=y
682681 CONFIG_ASYMMETRIC_KEY_TYPE=y
683682 CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m
684683 CONFIG_X509_CERTIFICATE_PARSER=m
arch/s390/configs/gcov_defconfig+1−2
@@ -552,7 +552,6 @@ CONFIG_NOTIFIER_ERROR_INJECTION=m · 551 unmodified lines
552552 CONFIG_CPU_NOTIFIER_ERROR_INJECT=m
553553 CONFIG_PM_NOTIFIER_ERROR_INJECT=m
554554 CONFIG_LATENCYTOP=y
555−CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y
556555 CONFIG_BLK_DEV_IO_TRACE=y
557556 # CONFIG_KPROBE_EVENT is not set
558557 CONFIG_TRACE_ENUM_MAP_FILE=y
@@ -616,7 +615,7 @@ CONFIG_CRYPTO_SHA512_S390=m · 57 unmodified lines
616615 CONFIG_CRYPTO_DES_S390=m
617616 CONFIG_CRYPTO_AES_S390=m
618617 CONFIG_CRYPTO_GHASH_S390=m
619−CONFIG_CRYPTO_CRC32_S390=m
618+CONFIG_CRYPTO_CRC32_S390=y
620619 CONFIG_ASYMMETRIC_KEY_TYPE=y
621620 CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m
622621 CONFIG_X509_CERTIFICATE_PARSER=m
arch/s390/configs/performance_defconfig+1−2
@@ -549,7 +549,6 @@ CONFIG_TIMER_STATS=y · 548 unmodified lines
549549 CONFIG_RCU_TORTURE_TEST=m
550550 CONFIG_RCU_CPU_STALL_TIMEOUT=60
551551 CONFIG_LATENCYTOP=y
552−CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y
553552 CONFIG_SCHED_TRACER=y
554553 CONFIG_FTRACE_SYSCALLS=y
555554 CONFIG_STACK_TRACER=y
@@ -615,7 +614,7 @@ CONFIG_CRYPTO_SHA512_S390=m · 59 unmodified lines
615614 CONFIG_CRYPTO_DES_S390=m
616615 CONFIG_CRYPTO_AES_S390=m
617616 CONFIG_CRYPTO_GHASH_S390=m
618−CONFIG_CRYPTO_CRC32_S390=m
617+CONFIG_CRYPTO_CRC32_S390=y
619618 CONFIG_ASYMMETRIC_KEY_TYPE=y
620619 CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m
621620 CONFIG_X509_CERTIFICATE_PARSER=m
arch/s390/crypto/crc32-vx.c+3−3
@@ -51,6 +51,9 @@ u32 crc32c_le_vgfm_16(u32 crc, unsigned char const *buf, size_t size); · 50 unmodified lines
5151 struct kernel_fpu vxstate; \
5252 unsigned long prealign, aligned, remaining; \
5353 \
54+ if (datalen < VX_MIN_LEN + VX_ALIGN_MASK) \
55+ return ___crc32_sw(crc, data, datalen); \
56+ \
5457 if ((unsigned long)data & VX_ALIGN_MASK) { \
5558 prealign = VX_ALIGNMENT - \
5659 ((unsigned long)data & VX_ALIGN_MASK); \
@@ -59,9 +62,6 @@ u32 crc32c_le_vgfm_16(u32 crc, unsigned char const *buf, size_t size); · 2 unmodified lines
5962 data = (void *)((unsigned long)data + prealign); \
6063 } \
6164 \
62− if (datalen < VX_MIN_LEN) \
63− return ___crc32_sw(crc, data, datalen); \
64− \
6565 aligned = datalen & ~VX_ALIGN_MASK; \
6666 remaining = datalen & VX_ALIGN_MASK; \
6767 \
arch/s390/defconfig+1−2
@@ -172,7 +172,6 @@ CONFIG_DEBUG_NOTIFIERS=y · 171 unmodified lines
172172 CONFIG_RCU_CPU_STALL_TIMEOUT=60
173173 CONFIG_RCU_TRACE=y
174174 CONFIG_LATENCYTOP=y
175−CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y
176175 CONFIG_SCHED_TRACER=y
177176 CONFIG_FTRACE_SYSCALLS=y
178177 CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP=y
@@ -234,7 +233,7 @@ CONFIG_CRYPTO_SHA256_S390=m · 55 unmodified lines
234233 CONFIG_CRYPTO_SHA512_S390=m
235234 CONFIG_CRYPTO_DES_S390=m
236235 CONFIG_CRYPTO_AES_S390=m
237−CONFIG_CRYPTO_CRC32_S390=m
236+CONFIG_CRYPTO_CRC32_S390=y
238237 CONFIG_CRC7=m
239238 # CONFIG_XZ_DEC_X86 is not set
240239 # CONFIG_XZ_DEC_POWERPC is not set
arch/s390/include/asm/uaccess.h+16−11
@@ -266,28 +266,28 @@ int __put_user_bad(void) __attribute__((noreturn)); · 265 unmodified lines
266266 __chk_user_ptr(ptr); \
267267 switch (sizeof(*(ptr))) { \
268268 case 1: { \
269− unsigned char __x; \
269+ unsigned char __x = 0; \
270270 __gu_err = __get_user_fn(&__x, ptr, \
271271 sizeof(*(ptr))); \
272272 (x) = *(__force __typeof__(*(ptr)) *) &__x; \
273273 break; \
274274 }; \
275275 case 2: { \
276− unsigned short __x; \
276+ unsigned short __x = 0; \
277277 __gu_err = __get_user_fn(&__x, ptr, \
278278 sizeof(*(ptr))); \
279279 (x) = *(__force __typeof__(*(ptr)) *) &__x; \
280280 break; \
281281 }; \
282282 case 4: { \
283− unsigned int __x; \
283+ unsigned int __x = 0; \
284284 __gu_err = __get_user_fn(&__x, ptr, \
285285 sizeof(*(ptr))); \
286286 (x) = *(__force __typeof__(*(ptr)) *) &__x; \
287287 break; \
288288 }; \
289289 case 8: { \
290− unsigned long long __x; \
290+ unsigned long long __x = 0; \
291291 __gu_err = __get_user_fn(&__x, ptr, \
292292 sizeof(*(ptr))); \
293293 (x) = *(__force __typeof__(*(ptr)) *) &__x; \
@@ -311,6 +311,14 @@ int __get_user_bad(void) __attribute__((noreturn)); · 17 unmodified lines
311311 #define __put_user_unaligned __put_user
312312 #define __get_user_unaligned __get_user
313313
314+extern void __compiletime_error("usercopy buffer size is too small")
315+__bad_copy_user(void);
316+
317+static inline void copy_user_overflow(int size, unsigned long count)
318+{
319+ WARN(1, "Buffer overflow detected (%d < %lu)!\n", size, count);
320+}
321+
314322 /**
315323 * copy_to_user: - Copy a block of data into user space.
316324 * @to: Destination address, in user space.
@@ -332,12 +340,6 @@ copy_to_user(void __user *to, const void *from, unsigned long n) · 15 unmodified lines
332340 return __copy_to_user(to, from, n);
333341 }
334342
335−void copy_from_user_overflow(void)
336−#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
337−__compiletime_warning("copy_from_user() buffer size is not provably correct")
338−#endif
339−;
340−
341343 /**
342344 * copy_from_user: - Copy a block of data from user space.
343345 * @to: Destination address, in kernel space.
@@ -362,7 +364,10 @@ copy_from_user(void *to, const void __user *from, unsigned long n) · 18 unmodified lines
362364
363365 might_fault();
364366 if (unlikely(sz != -1 && sz < n)) {
365− copy_from_user_overflow();
367+ if (!__builtin_constant_p(n))
368+ copy_user_overflow(sz, n);
369+ else
370+ __bad_copy_user();
366371 return n;
367372 }
368373 return __copy_from_user(to, from, n);
arch/s390/kernel/head.S+3−1
@@ -309,7 +309,9 @@ ENTRY(startup_kdump) · 308 unmodified lines
309309 l %r15,.Lstack-.LPG0(%r13)
310310 ahi %r15,-STACK_FRAME_OVERHEAD
311311 brasl %r14,verify_facilities
312− /* Continue with startup code in head64.S */
312+# For uncompressed images, continue in
313+# arch/s390/kernel/head64.S. For compressed images, continue in
314+# arch/s390/boot/compressed/head.S.
313315 jg startup_continue
314316
315317 .Lstack:
arch/s390/kernel/setup.c+2−4
@@ -204,11 +204,9 @@ static void __init conmode_default(void) · 203 unmodified lines
204204 #endif
205205 }
206206 } else if (MACHINE_IS_KVM) {
207− if (sclp.has_vt220 &&
208− config_enabled(CONFIG_SCLP_VT220_CONSOLE))
207+ if (sclp.has_vt220 && IS_ENABLED(CONFIG_SCLP_VT220_CONSOLE))
209208 SET_CONSOLE_VT220;
210− else if (sclp.has_linemode &&
211− config_enabled(CONFIG_SCLP_CONSOLE))
209+ else if (sclp.has_linemode && IS_ENABLED(CONFIG_SCLP_CONSOLE))
212210 SET_CONSOLE_SCLP;
213211 else
214212 SET_CONSOLE_HVC;
arch/s390/kvm/kvm-s390.c+6−4
@@ -2231,9 +2231,10 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu) · 2230 unmodified lines
22312231 return -EINVAL;
22322232 current->thread.fpu.fpc = fpu->fpc;
22332233 if (MACHINE_HAS_VX)
2234− convert_fp_to_vx(current->thread.fpu.vxrs, (freg_t *)fpu->fprs);
2234+ convert_fp_to_vx((__vector128 *) vcpu->run->s.regs.vrs,
2235+ (freg_t *) fpu->fprs);
22352236 else
2236− memcpy(current->thread.fpu.fprs, &fpu->fprs, sizeof(fpu->fprs));
2237+ memcpy(vcpu->run->s.regs.fprs, &fpu->fprs, sizeof(fpu->fprs));
22372238 return 0;
22382239 }
22392240
@@ -2242,9 +2243,10 @@ int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu) · 2 unmodified lines
22422243 /* make sure we have the latest values */
22432244 save_fpu_regs();
22442245 if (MACHINE_HAS_VX)
2245− convert_vx_to_fp((freg_t *)fpu->fprs, current->thread.fpu.vxrs);
2246+ convert_vx_to_fp((freg_t *) fpu->fprs,
2247+ (__vector128 *) vcpu->run->s.regs.vrs);
22462248 else
2247− memcpy(fpu->fprs, current->thread.fpu.fprs, sizeof(fpu->fprs));
2249+ memcpy(fpu->fprs, vcpu->run->s.regs.fprs, sizeof(fpu->fprs));
22482250 fpu->fpc = current->thread.fpu.fpc;
22492251 return 0;
22502252 }
arch/s390/kvm/vsie.c+1−1
@@ -584,7 +584,7 @@ static int pin_blocks(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page) · 583 unmodified lines
584584 /* Validity 0x0044 will be checked by SIE */
585585 if (rc)
586586 goto unpin;
587− scb_s->gvrd = hpa;
587+ scb_s->riccbd = hpa;
588588 }
589589 return 0;
590590 unpin:
arch/s390/lib/string.c+7−9
@@ -237,11 +237,10 @@ char * strrchr(const char * s, int c) · 236 unmodified lines
237237 EXPORT_SYMBOL(strrchr);
238238
239239 static inline int clcle(const char *s1, unsigned long l1,
240− const char *s2, unsigned long l2,
241− int *diff)
240+ const char *s2, unsigned long l2)
242241 {
243242 register unsigned long r2 asm("2") = (unsigned long) s1;
244− register unsigned long r3 asm("3") = (unsigned long) l2;
243+ register unsigned long r3 asm("3") = (unsigned long) l1;
245244 register unsigned long r4 asm("4") = (unsigned long) s2;
246245 register unsigned long r5 asm("5") = (unsigned long) l2;
247246 int cc;
@@ -252,7 +251,6 @@ static inline int clcle(const char *s1, unsigned long l1, · 4 unmodified lines
252251 " srl %0,28"
253252 : "=&d" (cc), "+a" (r2), "+a" (r3),
254253 "+a" (r4), "+a" (r5) : : "cc");
255− *diff = *(char *)r2 - *(char *)r4;
256254 return cc;
257255 }
258256
@@ -270,9 +268,9 @@ char * strstr(const char * s1,const char * s2) · 11 unmodified lines
270268 return (char *) s1;
271269 l1 = __strend(s1) - s1;
272270 while (l1-- >= l2) {
273− int cc, dummy;
271+ int cc;
274272
275− cc = clcle(s1, l1, s2, l2, &dummy);
273+ cc = clcle(s1, l2, s2, l2);
276274 if (!cc)
277275 return (char *) s1;
278276 s1++;
@@ -313,11 +311,11 @@ EXPORT_SYMBOL(memchr); · 34 unmodified lines
313311 */
314312 int memcmp(const void *cs, const void *ct, size_t n)
315313 {
316− int ret, diff;
314+ int ret;
317315
318− ret = clcle(cs, n, ct, n, &diff);
316+ ret = clcle(cs, n, ct, n);
319317 if (ret)
320− ret = diff;
318+ ret = ret == 1 ? -1 : 1;
321319 return ret;
322320 }
323321 EXPORT_SYMBOL(memcmp);
arch/s390/mm/pageattr.c+2−0
@@ -252,6 +252,8 @@ static int change_page_attr(unsigned long addr, unsigned long end, · 251 unmodified lines
252252 int rc = -EINVAL;
253253 pgd_t *pgdp;
254254
255+ if (addr == end)
256+ return 0;
255257 if (end >= MODULES_END)
256258 return -EINVAL;
257259 mutex_lock(&cpa_mutex);
arch/score/include/asm/uaccess.h+24−22
@@ -163,7 +163,7 @@ do { \ · 162 unmodified lines
163163 __get_user_asm(val, "lw", ptr); \
164164 break; \
165165 case 8: \
166− if ((copy_from_user((void *)&val, ptr, 8)) == 0) \
166+ if (__copy_from_user((void *)&val, ptr, 8) == 0) \
167167 __gu_err = 0; \
168168 else \
169169 __gu_err = -EFAULT; \
@@ -188,6 +188,8 @@ do { \ · 18 unmodified lines
188188 \
189189 if (likely(access_ok(VERIFY_READ, __gu_ptr, size))) \
190190 __get_user_common((x), size, __gu_ptr); \
191+ else \
192+ (x) = 0; \
191193 \
192194 __gu_err; \
193195 })
@@ -201,6 +203,7 @@ do { \ · 7 unmodified lines
201203 "2:\n" \
202204 ".section .fixup,\"ax\"\n" \
203205 "3:li %0, %4\n" \
206+ "li %1, 0\n" \
204207 "j 2b\n" \
205208 ".previous\n" \
206209 ".section __ex_table,\"a\"\n" \
@@ -298,35 +301,34 @@ extern int __copy_tofrom_user(void *to, const void *from, unsigned long len); · 91 unmodified lines
298301 static inline unsigned long
299302 copy_from_user(void *to, const void *from, unsigned long len)
300303 {
301− unsigned long over;
304+ unsigned long res = len;
302305
303− if (access_ok(VERIFY_READ, from, len))
304− return __copy_tofrom_user(to, from, len);
306+ if (likely(access_ok(VERIFY_READ, from, len)))
307+ res = __copy_tofrom_user(to, from, len);
305308
306− if ((unsigned long)from < TASK_SIZE) {
307− over = (unsigned long)from + len - TASK_SIZE;
308− return __copy_tofrom_user(to, from, len - over) + over;
309− }
310− return len;
309+ if (unlikely(res))
310+ memset(to + (len - res), 0, res);
311+
312+ return res;
311313 }
312314
313315 static inline unsigned long
314316 copy_to_user(void *to, const void *from, unsigned long len)
315317 {
316− unsigned long over;
317−
318− if (access_ok(VERIFY_WRITE, to, len))
319− return __copy_tofrom_user(to, from, len);
318+ if (likely(access_ok(VERIFY_WRITE, to, len)))
319+ len = __copy_tofrom_user(to, from, len);
320320
321− if ((unsigned long)to < TASK_SIZE) {
322− over = (unsigned long)to + len - TASK_SIZE;
323− return __copy_tofrom_user(to, from, len - over) + over;
324− }
325321 return len;
326322 }
327323
328−#define __copy_from_user(to, from, len) \
329− __copy_tofrom_user((to), (from), (len))
324+static inline unsigned long
325+__copy_from_user(void *to, const void *from, unsigned long len)
326+{
327+ unsigned long left = __copy_tofrom_user(to, from, len);
328+ if (unlikely(left))
329+ memset(to + (len - left), 0, left);
330+ return left;
331+}
330332
331333 #define __copy_to_user(to, from, len) \
332334 __copy_tofrom_user((to), (from), (len))
@@ -340,17 +342,17 @@ __copy_to_user_inatomic(void *to, const void *from, unsigned long len) · 7 unmodified lines
340342 static inline unsigned long
341343 __copy_from_user_inatomic(void *to, const void *from, unsigned long len)
342344 {
343− return __copy_from_user(to, from, len);
345+ return __copy_tofrom_user(to, from, len);
344346 }
345347
346−#define __copy_in_user(to, from, len) __copy_from_user(to, from, len)
348+#define __copy_in_user(to, from, len) __copy_tofrom_user(to, from, len)
347349
348350 static inline unsigned long
349351 copy_in_user(void *to, const void *from, unsigned long len)
350352 {
351353 if (access_ok(VERIFY_READ, from, len) &&
352354 access_ok(VERFITY_WRITE, to, len))
353− return copy_from_user(to, from, len);
355+ return __copy_tofrom_user(to, from, len);
354356 }
355357
356358 /*
arch/sh/include/asm/atomic-llsc.h+1−1
@@ -60,7 +60,7 @@ static inline int atomic_fetch_##op(int i, atomic_t *v) \ · 59 unmodified lines
6060 " movco.l %0, @%3 \n" \
6161 " bf 1b \n" \
6262 " synco \n" \
63− : "=&z" (temp), "=&z" (res) \
63+ : "=&z" (temp), "=&r" (res) \
6464 : "r" (i), "r" (&v->counter) \
6565 : "t"); \
6666 \
arch/sh/include/asm/uaccess.h+4−1
@@ -151,7 +151,10 @@ copy_from_user(void *to, const void __user *from, unsigned long n) · 150 unmodified lines
151151 __kernel_size_t __copy_size = (__kernel_size_t) n;
152152
153153 if (__copy_size && __access_ok(__copy_from, __copy_size))
154− return __copy_user(to, from, __copy_size);
154+ __copy_size = __copy_user(to, from, __copy_size);
155+
156+ if (unlikely(__copy_size))
157+ memset(to + (n - __copy_size), 0, __copy_size);
155158
156159 return __copy_size;
157160 }
arch/sh/include/asm/uaccess_64.h+1−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 #define __get_user_size(x,ptr,size,retval) \
2525 do { \
2626 retval = 0; \
27+ x = 0; \
2728 switch (size) { \
2829 case 1: \
2930 retval = __get_user_asm_b((void *)&x, \
arch/sparc/include/asm/uaccess_32.h+6−7
@@ -249,8 +249,7 @@ unsigned long __copy_user(void __user *to, const void __user *from, unsigned lon · 248 unmodified lines
249249 static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n)
250250 {
251251 if (n && __access_ok((unsigned long) to, n)) {
252− if (!__builtin_constant_p(n))
253− check_object_size(from, n, true);
252+ check_object_size(from, n, true);
254253 return __copy_user(to, (__force void __user *) from, n);
255254 } else
256255 return n;
@@ -258,19 +257,19 @@ static inline unsigned long copy_to_user(void __user *to, const void *from, unsi · 1 unmodified line
258257
259258 static inline unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n)
260259 {
261− if (!__builtin_constant_p(n))
262− check_object_size(from, n, true);
260+ check_object_size(from, n, true);
263261 return __copy_user(to, (__force void __user *) from, n);
264262 }
265263
266264 static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n)
267265 {
268266 if (n && __access_ok((unsigned long) from, n)) {
269− if (!__builtin_constant_p(n))
270− check_object_size(to, n, false);
267+ check_object_size(to, n, false);
271268 return __copy_user((__force void __user *) to, from, n);
272− } else
269+ } else {
270+ memset(to, 0, n);
273271 return n;
272+ }
274273 }
275274
276275 static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n)
arch/sparc/include/asm/uaccess_64.h+3−4
@@ -212,8 +212,7 @@ copy_from_user(void *to, const void __user *from, unsigned long size) · 211 unmodified lines
212212 {
213213 unsigned long ret;
214214
215− if (!__builtin_constant_p(size))
216− check_object_size(to, size, false);
215+ check_object_size(to, size, false);
217216
218217 ret = ___copy_from_user(to, from, size);
219218 if (unlikely(ret))
@@ -233,8 +232,8 @@ copy_to_user(void __user *to, const void *from, unsigned long size) · 13 unmodified lines
233232 {
234233 unsigned long ret;
235234
236− if (!__builtin_constant_p(size))
237− check_object_size(from, size, true);
235+ check_object_size(from, size, true);
236+
238237 ret = ___copy_to_user(to, from, size);
239238 if (unlikely(ret))
240239 ret = copy_to_user_fixup(to, from, size);
arch/tile/Kconfig+0−1
@@ -4,7 +4,6 @@ · 3 unmodified lines
44 config TILE
55 def_bool y
66 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
7− select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
87 select ARCH_HAS_DEVMEM_IS_ALLOWED
98 select ARCH_HAVE_NMI_SAFE_CMPXCHG
109 select ARCH_WANT_FRAME_POINTERS
arch/tile/include/asm/uaccess.h+10−12
@@ -416,14 +416,13 @@ _copy_from_user(void *to, const void __user *from, unsigned long n) · 415 unmodified lines
416416 return n;
417417 }
418418
419−#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
420−/*
421− * There are still unprovable places in the generic code as of 2.6.34, so this
422− * option is not really compatible with -Werror, which is more useful in
423− * general.
424− */
425−extern void copy_from_user_overflow(void)
426− __compiletime_warning("copy_from_user() size is not provably correct");
419+extern void __compiletime_error("usercopy buffer size is too small")
420+__bad_copy_user(void);
421+
422+static inline void copy_user_overflow(int size, unsigned long count)
423+{
424+ WARN(1, "Buffer overflow detected (%d < %lu)!\n", size, count);
425+}
427426
428427 static inline unsigned long __must_check copy_from_user(void *to,
429428 const void __user *from,
@@ -433,14 +432,13 @@ static inline unsigned long __must_check copy_from_user(void *to, · 3 unmodified lines
433432
434433 if (likely(sz == -1 || sz >= n))
435434 n = _copy_from_user(to, from, n);
435+ else if (!__builtin_constant_p(n))
436+ copy_user_overflow(sz, n);
436437 else
437− copy_from_user_overflow();
438+ __bad_copy_user();
438439
439440 return n;
440441 }
441−#else
442−#define copy_from_user _copy_from_user
443−#endif
444442
445443 #ifdef __tilegx__
446444 /**
arch/um/include/asm/common.lds.S+1−1
@@ -81,7 +81,7 @@ · 80 unmodified lines
8181 .altinstr_replacement : { *(.altinstr_replacement) }
8282 /* .exit.text is discard at runtime, not link time, to deal with references
8383 from .altinstructions and .eh_frame */
84− .exit.text : { *(.exit.text) }
84+ .exit.text : { EXIT_TEXT }
8585 .exit.data : { *(.exit.data) }
8686
8787 .preinit_array : {
arch/um/kernel/skas/syscall.c+3−7
@@ -21,21 +21,17 @@ void handle_syscall(struct uml_pt_regs *r) · 20 unmodified lines
2121 PT_REGS_SET_SYSCALL_RETURN(regs, -ENOSYS);
2222
2323 if (syscall_trace_enter(regs))
24− return;
24+ goto out;
2525
2626 /* Do the seccomp check after ptrace; failures should be fast. */
2727 if (secure_computing(NULL) == -1)
28− return;
28+ goto out;
2929
30− /* Update the syscall number after orig_ax has potentially been updated
31− * with ptrace.
32− */
33− UPT_SYSCALL_NR(r) = PT_SYSCALL_NR(r->gp);
3430 syscall = UPT_SYSCALL_NR(r);
35−
3631 if (syscall >= 0 && syscall <= __NR_syscall_max)
3732 PT_REGS_SET_SYSCALL_RETURN(regs,
3833 EXECUTE_SYSCALL(syscall, regs));
3934
35+out:
4036 syscall_trace_leave(regs);
4137 }
arch/x86/Kconfig+0−1
@@ -24,7 +24,6 @@ config X86 · 23 unmodified lines
2424 select ARCH_DISCARD_MEMBLOCK
2525 select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
2626 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
27− select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
2827 select ARCH_HAS_DEVMEM_IS_ALLOWED
2928 select ARCH_HAS_ELF_RANDOMIZE
3029 select ARCH_HAS_FAST_MULTIPLIER
arch/x86/boot/compressed/eboot.c+69−65
@@ -1004,79 +1004,87 @@ static efi_status_t alloc_e820ext(u32 nr_desc, struct setup_data **e820ext, · 1003 unmodified lines
10041004 return status;
10051005 }
10061006
1007−static efi_status_t exit_boot(struct boot_params *boot_params,
1008− void *handle, bool is64)
1009−{
1010− struct efi_info *efi = &boot_params->efi_info;
1011− unsigned long map_sz, key, desc_size;
1012− efi_memory_desc_t *mem_map;
1007+struct exit_boot_struct {
1008+ struct boot_params *boot_params;
1009+ struct efi_info *efi;
10131010 struct setup_data *e820ext;
1014− const char *signature;
10151011 __u32 e820ext_size;
1016− __u32 nr_desc, prev_nr_desc;
1017− efi_status_t status;
1018− __u32 desc_version;
1019− bool called_exit = false;
1020− u8 nr_entries;
1021− int i;
1022−
1023− nr_desc = 0;
1024− e820ext = NULL;
1025− e820ext_size = 0;
1026−
1027−get_map:
1028− status = efi_get_memory_map(sys_table, &mem_map, &map_sz, &desc_size,
1029− &desc_version, &key);
1030−
1031− if (status != EFI_SUCCESS)
1032− return status;
1033−
1034− prev_nr_desc = nr_desc;
1035− nr_desc = map_sz / desc_size;
1036− if (nr_desc > prev_nr_desc &&
1037− nr_desc > ARRAY_SIZE(boot_params->e820_map)) {
1038− u32 nr_e820ext = nr_desc - ARRAY_SIZE(boot_params->e820_map);
1039−
1040− status = alloc_e820ext(nr_e820ext, &e820ext, &e820ext_size);
1041− if (status != EFI_SUCCESS)
1042− goto free_mem_map;
1012+ bool is64;
1013+};
10431014
1044− efi_call_early(free_pool, mem_map);
1045− goto get_map; /* Allocated memory, get map again */
1015+static efi_status_t exit_boot_func(efi_system_table_t *sys_table_arg,
1016+ struct efi_boot_memmap *map,
1017+ void *priv)
1018+{
1019+ static bool first = true;
1020+ const char *signature;
1021+ __u32 nr_desc;
1022+ efi_status_t status;
1023+ struct exit_boot_struct *p = priv;
1024+
1025+ if (first) {
1026+ nr_desc = *map->buff_size / *map->desc_size;
1027+ if (nr_desc > ARRAY_SIZE(p->boot_params->e820_map)) {
1028+ u32 nr_e820ext = nr_desc -
1029+ ARRAY_SIZE(p->boot_params->e820_map);
1030+
1031+ status = alloc_e820ext(nr_e820ext, &p->e820ext,
1032+ &p->e820ext_size);
1033+ if (status != EFI_SUCCESS)
1034+ return status;
1035+ }
1036+ first = false;
10461037 }
10471038
1048− signature = is64 ? EFI64_LOADER_SIGNATURE : EFI32_LOADER_SIGNATURE;
1049− memcpy(&efi->efi_loader_signature, signature, sizeof(__u32));
1039+ signature = p->is64 ? EFI64_LOADER_SIGNATURE : EFI32_LOADER_SIGNATURE;
1040+ memcpy(&p->efi->efi_loader_signature, signature, sizeof(__u32));
10501041
1051− efi->efi_systab = (unsigned long)sys_table;
1052− efi->efi_memdesc_size = desc_size;
1053− efi->efi_memdesc_version = desc_version;
1054− efi->efi_memmap = (unsigned long)mem_map;
1055− efi->efi_memmap_size = map_sz;
1042+ p->efi->efi_systab = (unsigned long)sys_table_arg;
1043+ p->efi->efi_memdesc_size = *map->desc_size;
1044+ p->efi->efi_memdesc_version = *map->desc_ver;
1045+ p->efi->efi_memmap = (unsigned long)*map->map;
1046+ p->efi->efi_memmap_size = *map->map_size;
10561047
10571048 #ifdef CONFIG_X86_64
1058− efi->efi_systab_hi = (unsigned long)sys_table >> 32;
1059− efi->efi_memmap_hi = (unsigned long)mem_map >> 32;
1049+ p->efi->efi_systab_hi = (unsigned long)sys_table_arg >> 32;
1050+ p->efi->efi_memmap_hi = (unsigned long)*map->map >> 32;
10601051 #endif
10611052
1053+ return EFI_SUCCESS;
1054+}
1055+
1056+static efi_status_t exit_boot(struct boot_params *boot_params,
1057+ void *handle, bool is64)
1058+{
1059+ unsigned long map_sz, key, desc_size, buff_size;
1060+ efi_memory_desc_t *mem_map;
1061+ struct setup_data *e820ext;
1062+ __u32 e820ext_size;
1063+ efi_status_t status;
1064+ __u32 desc_version;
1065+ struct efi_boot_memmap map;
1066+ struct exit_boot_struct priv;
1067+
1068+ map.map = &mem_map;
1069+ map.map_size = &map_sz;
1070+ map.desc_size = &desc_size;
1071+ map.desc_ver = &desc_version;
1072+ map.key_ptr = &key;
1073+ map.buff_size = &buff_size;
1074+ priv.boot_params = boot_params;
1075+ priv.efi = &boot_params->efi_info;
1076+ priv.e820ext = NULL;
1077+ priv.e820ext_size = 0;
1078+ priv.is64 = is64;
1079+
10621080 /* Might as well exit boot services now */
1063− status = efi_call_early(exit_boot_services, handle, key);
1064− if (status != EFI_SUCCESS) {
1065− /*
1066− * ExitBootServices() will fail if any of the event
1067− * handlers change the memory map. In which case, we
1068− * must be prepared to retry, but only once so that
1069− * we're guaranteed to exit on repeated failures instead
1070− * of spinning forever.
1071− */
1072− if (called_exit)
1073− goto free_mem_map;
1074−
1075− called_exit = true;
1076− efi_call_early(free_pool, mem_map);
1077− goto get_map;
1078− }
1081+ status = efi_exit_boot_services(sys_table, handle, &map, &priv,
1082+ exit_boot_func);
1083+ if (status != EFI_SUCCESS)
1084+ return status;
10791085
1086+ e820ext = priv.e820ext;
1087+ e820ext_size = priv.e820ext_size;
10801088 /* Historic? */
10811089 boot_params->alt_mem_k = 32 * 1024;
10821090
@@ -1085,10 +1093,6 @@ get_map: · 2 unmodified lines
10851093 return status;
10861094
10871095 return EFI_SUCCESS;
1088−
1089−free_mem_map:
1090− efi_call_early(free_pool, mem_map);
1091− return status;
10921096 }
10931097
10941098 /*
arch/x86/configs/tiny.config+2−0
@@ -1 +1,3 @@
11 CONFIG_NOHIGHMEM=y
2+# CONFIG_HIGHMEM4G is not set
3+# CONFIG_HIGHMEM64G is not set
arch/x86/crypto/sha256-mb/sha256_mb.c+2−2
@@ -485,10 +485,10 @@ static int sha_complete_job(struct mcryptd_hash_request_ctx *rctx, · 484 unmodified lines
485485
486486 req = cast_mcryptd_ctx_to_req(req_ctx);
487487 if (irqs_disabled())
488− rctx->complete(&req->base, ret);
488+ req_ctx->complete(&req->base, ret);
489489 else {
490490 local_bh_disable();
491− rctx->complete(&req->base, ret);
491+ req_ctx->complete(&req->base, ret);
492492 local_bh_enable();
493493 }
494494 }
arch/x86/crypto/sha256-mb/sha256_mb_mgr_flush_avx2.S+4−3
@@ -265,13 +265,14 @@ ENTRY(sha256_mb_mgr_get_comp_job_avx2) · 264 unmodified lines
265265 vpinsrd $1, _args_digest+1*32(state, idx, 4), %xmm0, %xmm0
266266 vpinsrd $2, _args_digest+2*32(state, idx, 4), %xmm0, %xmm0
267267 vpinsrd $3, _args_digest+3*32(state, idx, 4), %xmm0, %xmm0
268− movl _args_digest+4*32(state, idx, 4), tmp2_w
268+ vmovd _args_digest(state , idx, 4) , %xmm0
269269 vpinsrd $1, _args_digest+5*32(state, idx, 4), %xmm1, %xmm1
270270 vpinsrd $2, _args_digest+6*32(state, idx, 4), %xmm1, %xmm1
271271 vpinsrd $3, _args_digest+7*32(state, idx, 4), %xmm1, %xmm1
272272
273− vmovdqu %xmm0, _result_digest(job_rax)
274− movl tmp2_w, _result_digest+1*16(job_rax)
273+ vmovdqu %xmm0, _result_digest(job_rax)
274+ offset = (_result_digest + 1*16)
275+ vmovdqu %xmm1, offset(job_rax)
275276
276277 pop %rbx
277278
arch/x86/crypto/sha512-mb/sha512_mb.c+2−2
@@ -497,10 +497,10 @@ static int sha_complete_job(struct mcryptd_hash_request_ctx *rctx, · 496 unmodified lines
497497
498498 req = cast_mcryptd_ctx_to_req(req_ctx);
499499 if (irqs_disabled())
500− rctx->complete(&req->base, ret);
500+ req_ctx->complete(&req->base, ret);
501501 else {
502502 local_bh_disable();
503− rctx->complete(&req->base, ret);
503+ req_ctx->complete(&req->base, ret);
504504 local_bh_enable();
505505 }
506506 }
arch/x86/events/amd/core.c+2−2
@@ -119,8 +119,8 @@ static const u64 amd_perfmon_event_map[PERF_COUNT_HW_MAX] = · 118 unmodified lines
119119 {
120120 [PERF_COUNT_HW_CPU_CYCLES] = 0x0076,
121121 [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
122− [PERF_COUNT_HW_CACHE_REFERENCES] = 0x0080,
123− [PERF_COUNT_HW_CACHE_MISSES] = 0x0081,
122+ [PERF_COUNT_HW_CACHE_REFERENCES] = 0x077d,
123+ [PERF_COUNT_HW_CACHE_MISSES] = 0x077e,
124124 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c2,
125125 [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c3,
126126 [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x00d0, /* "Decoder empty" event */
arch/x86/events/amd/uncore.c+18−4
@@ -29,6 +29,8 @@ · 28 unmodified lines
2929
3030 #define COUNTER_SHIFT 16
3131
32+static HLIST_HEAD(uncore_unused_list);
33+
3234 struct amd_uncore {
3335 int id;
3436 int refcnt;
@@ -39,7 +41,7 @@ struct amd_uncore { · 4 unmodified lines
3941 cpumask_t *active_mask;
4042 struct pmu *pmu;
4143 struct perf_event *events[MAX_COUNTERS];
42− struct amd_uncore *free_when_cpu_online;
44+ struct hlist_node node;
4345 };
4446
4547 static struct amd_uncore * __percpu *amd_uncore_nb;
@@ -306,6 +308,7 @@ static int amd_uncore_cpu_up_prepare(unsigned int cpu) · 260 unmodified lines
306308 uncore_nb->msr_base = MSR_F15H_NB_PERF_CTL;
307309 uncore_nb->active_mask = &amd_nb_active_mask;
308310 uncore_nb->pmu = &amd_nb_pmu;
311+ uncore_nb->id = -1;
309312 *per_cpu_ptr(amd_uncore_nb, cpu) = uncore_nb;
310313 }
311314
@@ -319,6 +322,7 @@ static int amd_uncore_cpu_up_prepare(unsigned int cpu) · 7 unmodified lines
319322 uncore_l2->msr_base = MSR_F16H_L2I_PERF_CTL;
320323 uncore_l2->active_mask = &amd_l2_active_mask;
321324 uncore_l2->pmu = &amd_l2_pmu;
325+ uncore_l2->id = -1;
322326 *per_cpu_ptr(amd_uncore_l2, cpu) = uncore_l2;
323327 }
324328
@@ -348,7 +352,7 @@ amd_uncore_find_online_sibling(struct amd_uncore *this, · 23 unmodified lines
348352 continue;
349353
350354 if (this->id == that->id) {
351− that->free_when_cpu_online = this;
355+ hlist_add_head(&this->node, &uncore_unused_list);
352356 this = that;
353357 break;
354358 }
@@ -388,13 +392,23 @@ static int amd_uncore_cpu_starting(unsigned int cpu) · 33 unmodified lines
388392 return 0;
389393 }
390394
395+static void uncore_clean_online(void)
396+{
397+ struct amd_uncore *uncore;
398+ struct hlist_node *n;
399+
400+ hlist_for_each_entry_safe(uncore, n, &uncore_unused_list, node) {
401+ hlist_del(&uncore->node);
402+ kfree(uncore);
403+ }
404+}
405+
391406 static void uncore_online(unsigned int cpu,
392407 struct amd_uncore * __percpu *uncores)
393408 {
394409 struct amd_uncore *uncore = *per_cpu_ptr(uncores, cpu);
395410
396− kfree(uncore->free_when_cpu_online);
397− uncore->free_when_cpu_online = NULL;
411+ uncore_clean_online();
398412
399413 if (cpu == uncore->cpu)
400414 cpumask_set_cpu(cpu, uncore->active_mask);
arch/x86/events/intel/bts.c+96−30
@@ -31,7 +31,17 @@ · 30 unmodified lines
3131 struct bts_ctx {
3232 struct perf_output_handle handle;
3333 struct debug_store ds_back;
34− int started;
34+ int state;
35+};
36+
37+/* BTS context states: */
38+enum {
39+ /* no ongoing AUX transactions */
40+ BTS_STATE_STOPPED = 0,
41+ /* AUX transaction is on, BTS tracing is disabled */
42+ BTS_STATE_INACTIVE,
43+ /* AUX transaction is on, BTS tracing is running */
44+ BTS_STATE_ACTIVE,
3545 };
3646
3747 static DEFINE_PER_CPU(struct bts_ctx, bts_ctx);
@@ -204,6 +214,15 @@ static void bts_update(struct bts_ctx *bts) · 166 unmodified lines
204214 static int
205215 bts_buffer_reset(struct bts_buffer *buf, struct perf_output_handle *handle);
206216
217+/*
218+ * Ordering PMU callbacks wrt themselves and the PMI is done by means
219+ * of bts::state, which:
220+ * - is set when bts::handle::event is valid, that is, between
221+ * perf_aux_output_begin() and perf_aux_output_end();
222+ * - is zero otherwise;
223+ * - is ordered against bts::handle::event with a compiler barrier.
224+ */
225+
207226 static void __bts_event_start(struct perf_event *event)
208227 {
209228 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
@@ -221,10 +240,13 @@ static void __bts_event_start(struct perf_event *event) · 11 unmodified lines
221240
222241 /*
223242 * local barrier to make sure that ds configuration made it
224− * before we enable BTS
243+ * before we enable BTS and bts::state goes ACTIVE
225244 */
226245 wmb();
227246
247+ /* INACTIVE/STOPPED -> ACTIVE */
248+ WRITE_ONCE(bts->state, BTS_STATE_ACTIVE);
249+
228250 intel_pmu_enable_bts(config);
229251
230252 }
@@ -251,9 +273,6 @@ static void bts_event_start(struct perf_event *event, int flags) · 20 unmodified lines
251273
252274 __bts_event_start(event);
253275
254− /* PMI handler: this counter is running and likely generating PMIs */
255− ACCESS_ONCE(bts->started) = 1;
256−
257276 return;
258277
259278 fail_end_stop:
@@ -263,30 +282,34 @@ fail_stop: · 3 unmodified lines
263282 event->hw.state = PERF_HES_STOPPED;
264283 }
265284
266−static void __bts_event_stop(struct perf_event *event)
285+static void __bts_event_stop(struct perf_event *event, int state)
267286 {
287+ struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
288+
289+ /* ACTIVE -> INACTIVE(PMI)/STOPPED(->stop()) */
290+ WRITE_ONCE(bts->state, state);
291+
268292 /*
269293 * No extra synchronization is mandated by the documentation to have
270294 * BTS data stores globally visible.
271295 */
272296 intel_pmu_disable_bts();
273−
274− if (event->hw.state & PERF_HES_STOPPED)
275− return;
276−
277− ACCESS_ONCE(event->hw.state) |= PERF_HES_STOPPED;
278297 }
279298
280299 static void bts_event_stop(struct perf_event *event, int flags)
281300 {
282301 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
283302 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
284− struct bts_buffer *buf = perf_get_aux(&bts->handle);
303+ struct bts_buffer *buf = NULL;
304+ int state = READ_ONCE(bts->state);
285305
286− /* PMI handler: don't restart this counter */
287− ACCESS_ONCE(bts->started) = 0;
306+ if (state == BTS_STATE_ACTIVE)
307+ __bts_event_stop(event, BTS_STATE_STOPPED);
288308
289− __bts_event_stop(event);
309+ if (state != BTS_STATE_STOPPED)
310+ buf = perf_get_aux(&bts->handle);
311+
312+ event->hw.state |= PERF_HES_STOPPED;
290313
291314 if (flags & PERF_EF_UPDATE) {
292315 bts_update(bts);
@@ -296,6 +319,7 @@ static void bts_event_stop(struct perf_event *event, int flags) · 3 unmodified lines
296319 bts->handle.head =
297320 local_xchg(&buf->data_size,
298321 buf->nr_pages << PAGE_SHIFT);
322+
299323 perf_aux_output_end(&bts->handle, local_xchg(&buf->data_size, 0),
300324 !!local_xchg(&buf->lost, 0));
301325 }
@@ -310,8 +334,20 @@ static void bts_event_stop(struct perf_event *event, int flags) · 8 unmodified lines
310334 void intel_bts_enable_local(void)
311335 {
312336 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
337+ int state = READ_ONCE(bts->state);
338+
339+ /*
340+ * Here we transition from INACTIVE to ACTIVE;
341+ * if we instead are STOPPED from the interrupt handler,
342+ * stay that way. Can't be ACTIVE here though.
343+ */
344+ if (WARN_ON_ONCE(state == BTS_STATE_ACTIVE))
345+ return;
346+
347+ if (state == BTS_STATE_STOPPED)
348+ return;
313349
314− if (bts->handle.event && bts->started)
350+ if (bts->handle.event)
315351 __bts_event_start(bts->handle.event);
316352 }
317353
@@ -319,8 +355,15 @@ void intel_bts_disable_local(void) · 1 unmodified line
319355 {
320356 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
321357
358+ /*
359+ * Here we transition from ACTIVE to INACTIVE;
360+ * do nothing for STOPPED or INACTIVE.
361+ */
362+ if (READ_ONCE(bts->state) != BTS_STATE_ACTIVE)
363+ return;
364+
322365 if (bts->handle.event)
323− __bts_event_stop(bts->handle.event);
366+ __bts_event_stop(bts->handle.event, BTS_STATE_INACTIVE);
324367 }
325368
326369 static int
@@ -335,8 +378,6 @@ bts_buffer_reset(struct bts_buffer *buf, struct perf_output_handle *handle) · 8 unmodified lines
335378 return 0;
336379
337380 head = handle->head & ((buf->nr_pages << PAGE_SHIFT) - 1);
338− if (WARN_ON_ONCE(head != local_read(&buf->head)))
339− return -EINVAL;
340381
341382 phys = &buf->buf[buf->cur_buf];
342383 space = phys->offset + phys->displacement + phys->size - head;
@@ -403,22 +444,37 @@ bts_buffer_reset(struct bts_buffer *buf, struct perf_output_handle *handle) · 60 unmodified lines
403444
404445 int intel_bts_interrupt(void)
405446 {
447+ struct debug_store *ds = this_cpu_ptr(&cpu_hw_events)->ds;
406448 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
407449 struct perf_event *event = bts->handle.event;
408450 struct bts_buffer *buf;
409451 s64 old_head;
410− int err;
452+ int err = -ENOSPC, handled = 0;
411453
412− if (!event || !bts->started)
413− return 0;
454+ /*
455+ * The only surefire way of knowing if this NMI is ours is by checking
456+ * the write ptr against the PMI threshold.
457+ */
458+ if (ds && (ds->bts_index >= ds->bts_interrupt_threshold))
459+ handled = 1;
460+
461+ /*
462+ * this is wrapped in intel_bts_enable_local/intel_bts_disable_local,
463+ * so we can only be INACTIVE or STOPPED
464+ */
465+ if (READ_ONCE(bts->state) == BTS_STATE_STOPPED)
466+ return handled;
414467
415468 buf = perf_get_aux(&bts->handle);
469+ if (!buf)
470+ return handled;
471+
416472 /*
417473 * Skip snapshot counters: they don't use the interrupt, but
418474 * there's no other way of telling, because the pointer will
419475 * keep moving
420476 */
421− if (!buf || buf->snapshot)
477+ if (buf->snapshot)
422478 return 0;
423479
424480 old_head = local_read(&buf->head);
@@ -426,18 +482,27 @@ int intel_bts_interrupt(void) · 1 unmodified line
426482
427483 /* no new data */
428484 if (old_head == local_read(&buf->head))
429− return 0;
485+ return handled;
430486
431487 perf_aux_output_end(&bts->handle, local_xchg(&buf->data_size, 0),
432488 !!local_xchg(&buf->lost, 0));
433489
434490 buf = perf_aux_output_begin(&bts->handle, event);
435− if (!buf)
436− return 1;
491+ if (buf)
492+ err = bts_buffer_reset(buf, &bts->handle);
493+
494+ if (err) {
495+ WRITE_ONCE(bts->state, BTS_STATE_STOPPED);
437496
438− err = bts_buffer_reset(buf, &bts->handle);
439− if (err)
440− perf_aux_output_end(&bts->handle, 0, false);
497+ if (buf) {
498+ /*
499+ * BTS_STATE_STOPPED should be visible before
500+ * cleared handle::event
501+ */
502+ barrier();
503+ perf_aux_output_end(&bts->handle, 0, false);
504+ }
505+ }
441506
442507 return 1;
443508 }
@@ -519,7 +584,8 @@ static __init int bts_init(void) · 75 unmodified lines
519584 if (!boot_cpu_has(X86_FEATURE_DTES64) || !x86_pmu.bts)
520585 return -ENODEV;
521586
522− bts_pmu.capabilities = PERF_PMU_CAP_AUX_NO_SG | PERF_PMU_CAP_ITRACE;
587+ bts_pmu.capabilities = PERF_PMU_CAP_AUX_NO_SG | PERF_PMU_CAP_ITRACE |
588+ PERF_PMU_CAP_EXCLUSIVE;
523589 bts_pmu.task_ctx_nr = perf_sw_context;
524590 bts_pmu.event_init = bts_event_init;
525591 bts_pmu.add = bts_event_add;
arch/x86/events/intel/core.c+8−7
@@ -1730,9 +1730,11 @@ static __initconst const u64 knl_hw_cache_extra_regs · 1729 unmodified lines
17301730 * disabled state if called consecutively.
17311731 *
17321732 * During consecutive calls, the same disable value will be written to related
1733− * registers, so the PMU state remains unchanged. hw.state in
1734− * intel_bts_disable_local will remain PERF_HES_STOPPED too in consecutive
1735− * calls.
1733+ * registers, so the PMU state remains unchanged.
1734+ *
1735+ * intel_bts events don't coexist with intel PMU's BTS events because of
1736+ * x86_add_exclusive(x86_lbr_exclusive_lbr); there's no need to keep them
1737+ * disabled around intel PMU's event batching etc, only inside the PMI handler.
17361738 */
17371739 static void __intel_pmu_disable_all(void)
17381740 {
@@ -1742,8 +1744,6 @@ static void __intel_pmu_disable_all(void) · 3 unmodified lines
17421744
17431745 if (test_bit(INTEL_PMC_IDX_FIXED_BTS, cpuc->active_mask))
17441746 intel_pmu_disable_bts();
1745− else
1746− intel_bts_disable_local();
17471747
17481748 intel_pmu_pebs_disable_all();
17491749 }
@@ -1771,8 +1771,7 @@ static void __intel_pmu_enable_all(int added, bool pmi) · 21 unmodified lines
17711771 return;
17721772
17731773 intel_pmu_enable_bts(event->hw.config);
1774− } else
1775− intel_bts_enable_local();
1774+ }
17761775 }
17771776
17781777 static void intel_pmu_enable_all(int added)
@@ -2073,6 +2072,7 @@ static int intel_pmu_handle_irq(struct pt_regs *regs) · 294 unmodified lines
20732072 */
20742073 if (!x86_pmu.late_ack)
20752074 apic_write(APIC_LVTPC, APIC_DM_NMI);
2075+ intel_bts_disable_local();
20762076 __intel_pmu_disable_all();
20772077 handled = intel_pmu_drain_bts_buffer();
20782078 handled += intel_bts_interrupt();
@@ -2172,6 +2172,7 @@ done: · 93 unmodified lines
21722172 /* Only restore PMU state when it's active. See x86_pmu_disable(). */
21732173 if (cpuc->enabled)
21742174 __intel_pmu_enable_all(0, true);
2175+ intel_bts_enable_local();
21752176
21762177 /*
21772178 * Only unmask the NMI after the overflow counters
arch/x86/events/intel/cqm.c+9−0
@@ -458,6 +458,11 @@ static void __intel_cqm_event_count(void *info); · 457 unmodified lines
458458 static void init_mbm_sample(u32 rmid, u32 evt_type);
459459 static void __intel_mbm_event_count(void *info);
460460
461+static bool is_cqm_event(int e)
462+{
463+ return (e == QOS_L3_OCCUP_EVENT_ID);
464+}
465+
461466 static bool is_mbm_event(int e)
462467 {
463468 return (e >= QOS_MBM_TOTAL_EVENT_ID && e <= QOS_MBM_LOCAL_EVENT_ID);
@@ -1366,6 +1371,10 @@ static int intel_cqm_event_init(struct perf_event *event) · 902 unmodified lines
13661371 (event->attr.config > QOS_MBM_LOCAL_EVENT_ID))
13671372 return -EINVAL;
13681373
1374+ if ((is_cqm_event(event->attr.config) && !cqm_enabled) ||
1375+ (is_mbm_event(event->attr.config) && !mbm_enabled))
1376+ return -EINVAL;
1377+
13691378 /* unsupported modes and filters */
13701379 if (event->attr.exclude_user ||
13711380 event->attr.exclude_kernel ||
arch/x86/events/intel/ds.c+11−8
@@ -1274,18 +1274,18 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs) · 1273 unmodified lines
12741274 struct pebs_record_nhm *p = at;
12751275 u64 pebs_status;
12761276
1277− /* PEBS v3 has accurate status bits */
1277+ pebs_status = p->status & cpuc->pebs_enabled;
1278+ pebs_status &= (1ULL << x86_pmu.max_pebs_events) - 1;
1279+
1280+ /* PEBS v3 has more accurate status bits */
12781281 if (x86_pmu.intel_cap.pebs_format >= 3) {
1279− for_each_set_bit(bit, (unsigned long *)&p->status,
1280− MAX_PEBS_EVENTS)
1282+ for_each_set_bit(bit, (unsigned long *)&pebs_status,
1283+ x86_pmu.max_pebs_events)
12811284 counts[bit]++;
12821285
12831286 continue;
12841287 }
12851288
1286− pebs_status = p->status & cpuc->pebs_enabled;
1287− pebs_status &= (1ULL << x86_pmu.max_pebs_events) - 1;
1288−
12891289 /*
12901290 * On some CPUs the PEBS status can be zero when PEBS is
12911291 * racing with clearing of GLOBAL_STATUS.
@@ -1333,8 +1333,11 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs) · 41 unmodified lines
13331333 continue;
13341334
13351335 event = cpuc->events[bit];
1336− WARN_ON_ONCE(!event);
1337− WARN_ON_ONCE(!event->attr.precise_ip);
1336+ if (WARN_ON_ONCE(!event))
1337+ continue;
1338+
1339+ if (WARN_ON_ONCE(!event->attr.precise_ip))
1340+ continue;
13381341
13391342 /* log dropped samples number */
13401343 if (error[bit])
arch/x86/events/intel/pt.c+14−4
@@ -1074,6 +1074,11 @@ static void pt_addr_filters_fini(struct perf_event *event) · 1073 unmodified lines
10741074 event->hw.addr_filters = NULL;
10751075 }
10761076
1077+static inline bool valid_kernel_ip(unsigned long ip)
1078+{
1079+ return virt_addr_valid(ip) && kernel_ip(ip);
1080+}
1081+
10771082 static int pt_event_addr_filters_validate(struct list_head *filters)
10781083 {
10791084 struct perf_addr_filter *filter;
@@ -1081,11 +1086,16 @@ static int pt_event_addr_filters_validate(struct list_head *filters) · 1 unmodified line
10811086
10821087 list_for_each_entry(filter, filters, entry) {
10831088 /* PT doesn't support single address triggers */
1084− if (!filter->range)
1089+ if (!filter->range || !filter->size)
10851090 return -EOPNOTSUPP;
10861091
1087− if (!filter->inode && !kernel_ip(filter->offset))
1088− return -EINVAL;
1092+ if (!filter->inode) {
1093+ if (!valid_kernel_ip(filter->offset))
1094+ return -EINVAL;
1095+
1096+ if (!valid_kernel_ip(filter->offset + filter->size))
1097+ return -EINVAL;
1098+ }
10891099
10901100 if (++range > pt_cap_get(PT_CAP_num_address_ranges))
10911101 return -EOPNOTSUPP;
@@ -1111,7 +1121,7 @@ static void pt_event_addr_filters_sync(struct perf_event *event) · 19 unmodified lines
11111121 } else {
11121122 /* apply the offset */
11131123 msr_a = filter->offset + offs[range];
1114− msr_b = filter->size + msr_a;
1124+ msr_b = filter->size + msr_a - 1;
11151125 }
11161126
11171127 filters->filter[range].msr_a = msr_a;
arch/x86/include/asm/uaccess.h+16−63
@@ -433,7 +433,11 @@ do { \ · 432 unmodified lines
433433 #define __get_user_asm_ex(x, addr, itype, rtype, ltype) \
434434 asm volatile("1: mov"itype" %1,%"rtype"0\n" \
435435 "2:\n" \
436− _ASM_EXTABLE_EX(1b, 2b) \
436+ ".section .fixup,\"ax\"\n" \
437+ "3:xor"itype" %"rtype"0,%"rtype"0\n" \
438+ " jmp 2b\n" \
439+ ".previous\n" \
440+ _ASM_EXTABLE_EX(1b, 3b) \
437441 : ltype(x) : "m" (__m(addr)))
438442
439443 #define __put_user_nocheck(x, ptr, size) \
@@ -697,44 +701,15 @@ unsigned long __must_check _copy_from_user(void *to, const void __user *from, · 257 unmodified lines
697701 unsigned long __must_check _copy_to_user(void __user *to, const void *from,
698702 unsigned n);
699703
700−#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
701−# define copy_user_diag __compiletime_error
702−#else
703−# define copy_user_diag __compiletime_warning
704−#endif
705−
706−extern void copy_user_diag("copy_from_user() buffer size is too small")
707−copy_from_user_overflow(void);
708−extern void copy_user_diag("copy_to_user() buffer size is too small")
709−copy_to_user_overflow(void) __asm__("copy_from_user_overflow");
710−
711−#undef copy_user_diag
712−
713−#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
714−
715−extern void
716−__compiletime_warning("copy_from_user() buffer size is not provably correct")
717−__copy_from_user_overflow(void) __asm__("copy_from_user_overflow");
718−#define __copy_from_user_overflow(size, count) __copy_from_user_overflow()
719−
720−extern void
721−__compiletime_warning("copy_to_user() buffer size is not provably correct")
722−__copy_to_user_overflow(void) __asm__("copy_from_user_overflow");
723−#define __copy_to_user_overflow(size, count) __copy_to_user_overflow()
704+extern void __compiletime_error("usercopy buffer size is too small")
705+__bad_copy_user(void);
724706
725−#else
726−
727−static inline void
728−__copy_from_user_overflow(int size, unsigned long count)
707+static inline void copy_user_overflow(int size, unsigned long count)
729708 {
730709 WARN(1, "Buffer overflow detected (%d < %lu)!\n", size, count);
731710 }
732711
733−#define __copy_to_user_overflow __copy_from_user_overflow
734−
735−#endif
736−
737−static inline unsigned long __must_check
712+static __always_inline unsigned long __must_check
738713 copy_from_user(void *to, const void __user *from, unsigned long n)
739714 {
740715 int sz = __compiletime_object_size(to);
@@ -743,36 +718,18 @@ copy_from_user(void *to, const void __user *from, unsigned long n) · 2 unmodified lines
743718
744719 kasan_check_write(to, n);
745720
746− /*
747− * While we would like to have the compiler do the checking for us
748− * even in the non-constant size case, any false positives there are
749− * a problem (especially when DEBUG_STRICT_USER_COPY_CHECKS, but even
750− * without - the [hopefully] dangerous looking nature of the warning
751− * would make people go look at the respecitive call sites over and
752− * over again just to find that there's no problem).
753− *
754− * And there are cases where it's just not realistic for the compiler
755− * to prove the count to be in range. For example when multiple call
756− * sites of a helper function - perhaps in different source files -
757− * all doing proper range checking, yet the helper function not doing
758− * so again.
759− *
760− * Therefore limit the compile time checking to the constant size
761− * case, and do only runtime checking for non-constant sizes.
762− */
763−
764721 if (likely(sz < 0 || sz >= n)) {
765722 check_object_size(to, n, false);
766723 n = _copy_from_user(to, from, n);
767− } else if (__builtin_constant_p(n))
768− copy_from_user_overflow();
724+ } else if (!__builtin_constant_p(n))
725+ copy_user_overflow(sz, n);
769726 else
770− __copy_from_user_overflow(sz, n);
727+ __bad_copy_user();
771728
772729 return n;
773730 }
774731
775−static inline unsigned long __must_check
732+static __always_inline unsigned long __must_check
776733 copy_to_user(void __user *to, const void *from, unsigned long n)
777734 {
778735 int sz = __compiletime_object_size(from);
@@ -781,21 +738,17 @@ copy_to_user(void __user *to, const void *from, unsigned long n) · 2 unmodified lines
781738
782739 might_fault();
783740
784− /* See the comment in copy_from_user() above. */
785741 if (likely(sz < 0 || sz >= n)) {
786742 check_object_size(from, n, true);
787743 n = _copy_to_user(to, from, n);
788− } else if (__builtin_constant_p(n))
789− copy_to_user_overflow();
744+ } else if (!__builtin_constant_p(n))
745+ copy_user_overflow(sz, n);
790746 else
791− __copy_to_user_overflow(sz, n);
747+ __bad_copy_user();
792748
793749 return n;
794750 }
795751
796−#undef __copy_from_user_overflow
797−#undef __copy_to_user_overflow
798−
799752 /*
800753 * We rely on the nested NMI work to allow atomic faults from the NMI path; the
801754 * nested NMI paths are careful to preserve CR2.
arch/x86/kernel/apic/apic.c+6−1
@@ -1623,6 +1623,9 @@ void __init enable_IR_x2apic(void) · 1622 unmodified lines
16231623 unsigned long flags;
16241624 int ret, ir_stat;
16251625
1626+ if (skip_ioapic_setup)
1627+ return;
1628+
16261629 ir_stat = irq_remapping_prepare();
16271630 if (ir_stat < 0 && !x2apic_supported())
16281631 return;
@@ -2090,7 +2093,6 @@ int generic_processor_info(int apicid, int version) · 461 unmodified lines
20902093 return -EINVAL;
20912094 }
20922095
2093− num_processors++;
20942096 if (apicid == boot_cpu_physical_apicid) {
20952097 /*
20962098 * x86_bios_cpu_apicid is required to have processors listed
@@ -2113,10 +2115,13 @@ int generic_processor_info(int apicid, int version) · 16 unmodified lines
21132115
21142116 pr_warning("APIC: Package limit reached. Processor %d/0x%x ignored.\n",
21152117 thiscpu, apicid);
2118+
21162119 disabled_cpus++;
21172120 return -ENOSPC;
21182121 }
21192122
2123+ num_processors++;
2124+
21202125 /*
21212126 * Validate version
21222127 */
arch/x86/kernel/cpu/amd.c+12−0
@@ -669,6 +669,17 @@ static void init_amd_gh(struct cpuinfo_x86 *c) · 668 unmodified lines
669669 set_cpu_bug(c, X86_BUG_AMD_TLB_MMATCH);
670670 }
671671
672+#define MSR_AMD64_DE_CFG 0xC0011029
673+
674+static void init_amd_ln(struct cpuinfo_x86 *c)
675+{
676+ /*
677+ * Apply erratum 665 fix unconditionally so machines without a BIOS
678+ * fix work.
679+ */
680+ msr_set_bit(MSR_AMD64_DE_CFG, 31);
681+}
682+
672683 static void init_amd_bd(struct cpuinfo_x86 *c)
673684 {
674685 u64 value;
@@ -726,6 +737,7 @@ static void init_amd(struct cpuinfo_x86 *c) · 51 unmodified lines
726737 case 6: init_amd_k7(c); break;
727738 case 0xf: init_amd_k8(c); break;
728739 case 0x10: init_amd_gh(c); break;
740+ case 0x12: init_amd_ln(c); break;
729741 case 0x15: init_amd_bd(c); break;
730742 }
731743
arch/x86/kernel/cpu/microcode/amd.c+16−2
@@ -54,6 +54,7 @@ static LIST_HEAD(pcache); · 53 unmodified lines
5454 */
5555 static u8 *container;
5656 static size_t container_size;
57+static bool ucode_builtin;
5758
5859 static u32 ucode_new_rev;
5960 static u8 amd_ucode_patch[PATCH_MAX_SIZE];
@@ -281,18 +282,22 @@ static bool __init load_builtin_amd_microcode(struct cpio_data *cp, · 221 unmodified lines
281282 void __init load_ucode_amd_bsp(unsigned int family)
282283 {
283284 struct cpio_data cp;
285+ bool *builtin;
284286 void **data;
285287 size_t *size;
286288
287289 #ifdef CONFIG_X86_32
288290 data = (void **)__pa_nodebug(&ucode_cpio.data);
289291 size = (size_t *)__pa_nodebug(&ucode_cpio.size);
292+ builtin = (bool *)__pa_nodebug(&ucode_builtin);
290293 #else
291294 data = &ucode_cpio.data;
292295 size = &ucode_cpio.size;
296+ builtin = &ucode_builtin;
293297 #endif
294298
295− if (!load_builtin_amd_microcode(&cp, family))
299+ *builtin = load_builtin_amd_microcode(&cp, family);
300+ if (!*builtin)
296301 cp = find_ucode_in_initrd();
297302
298303 if (!(cp.data && cp.size))
@@ -355,6 +360,7 @@ void load_ucode_amd_ap(void) · 56 unmodified lines
355360 unsigned int cpu = smp_processor_id();
356361 struct equiv_cpu_entry *eq;
357362 struct microcode_amd *mc;
363+ u8 *cont = container;
358364 u32 rev, eax;
359365 u16 eq_id;
360366
@@ -371,8 +377,12 @@ void load_ucode_amd_ap(void) · 10 unmodified lines
371377 if (check_current_patch_level(&rev, false))
372378 return;
373379
380+ /* Add CONFIG_RANDOMIZE_MEMORY offset. */
381+ if (!ucode_builtin)
382+ cont += PAGE_OFFSET - __PAGE_OFFSET_BASE;
383+
374384 eax = cpuid_eax(0x00000001);
375− eq = (struct equiv_cpu_entry *)(container + CONTAINER_HDR_SZ);
385+ eq = (struct equiv_cpu_entry *)(cont + CONTAINER_HDR_SZ);
376386
377387 eq_id = find_equiv_id(eq, eax);
378388 if (!eq_id)
@@ -434,6 +444,10 @@ int __init save_microcode_in_initrd_amd(void) · 55 unmodified lines
434444 else
435445 container = cont_va;
436446
447+ /* Add CONFIG_RANDOMIZE_MEMORY offset. */
448+ if (!ucode_builtin)
449+ container += PAGE_OFFSET - __PAGE_OFFSET_BASE;
450+
437451 eax = cpuid_eax(0x00000001);
438452 eax = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff);
439453
arch/x86/kernel/kvmclock.c+1−0
@@ -289,6 +289,7 @@ void __init kvmclock_init(void) · 288 unmodified lines
289289 put_cpu();
290290
291291 x86_platform.calibrate_tsc = kvm_get_tsc_khz;
292+ x86_platform.calibrate_cpu = kvm_get_tsc_khz;
292293 x86_platform.get_wallclock = kvm_get_wallclock;
293294 x86_platform.set_wallclock = kvm_set_wallclock;
294295 #ifdef CONFIG_X86_LOCAL_APIC
arch/x86/kernel/paravirt.c+2−2
@@ -56,12 +56,12 @@ asm (".pushsection .entry.text, \"ax\"\n" · 55 unmodified lines
5656 ".popsection");
5757
5858 /* identity function, which can be inlined */
59−u32 _paravirt_ident_32(u32 x)
59+u32 notrace _paravirt_ident_32(u32 x)
6060 {
6161 return x;
6262 }
6363
64−u64 _paravirt_ident_64(u64 x)
64+u64 notrace _paravirt_ident_64(u64 x)
6565 {
6666 return x;
6767 }
arch/x86/kernel/smpboot.c+16−9
@@ -100,10 +100,11 @@ EXPORT_PER_CPU_SYMBOL(cpu_info); · 99 unmodified lines
100100 /* Logical package management. We might want to allocate that dynamically */
101101 static int *physical_to_logical_pkg __read_mostly;
102102 static unsigned long *physical_package_map __read_mostly;;
103−static unsigned long *logical_package_map __read_mostly;
104103 static unsigned int max_physical_pkg_id __read_mostly;
105104 unsigned int __max_logical_packages __read_mostly;
106105 EXPORT_SYMBOL(__max_logical_packages);
106+static unsigned int logical_packages __read_mostly;
107+static bool logical_packages_frozen __read_mostly;
107108
108109 /* Maximum number of SMT threads on any online core */
109110 int __max_smt_threads __read_mostly;
@@ -277,14 +278,14 @@ int topology_update_package_map(unsigned int apicid, unsigned int cpu) · 167 unmodified lines
277278 if (test_and_set_bit(pkg, physical_package_map))
278279 goto found;
279280
280− new = find_first_zero_bit(logical_package_map, __max_logical_packages);
281− if (new >= __max_logical_packages) {
281+ if (logical_packages_frozen) {
282282 physical_to_logical_pkg[pkg] = -1;
283− pr_warn("APIC(%x) Package %u exceeds logical package map\n",
283+ pr_warn("APIC(%x) Package %u exceeds logical package max\n",
284284 apicid, pkg);
285285 return -ENOSPC;
286286 }
287− set_bit(new, logical_package_map);
287+
288+ new = logical_packages++;
288289 pr_info("APIC(%x) Converting physical %u to logical package %u\n",
289290 apicid, pkg, new);
290291 physical_to_logical_pkg[pkg] = new;
@@ -341,6 +342,7 @@ static void __init smp_init_package_map(void) · 50 unmodified lines
341342 }
342343
343344 __max_logical_packages = DIV_ROUND_UP(total_cpus, ncpus);
345+ logical_packages = 0;
344346
345347 /*
346348 * Possibly larger than what we need as the number of apic ids per
@@ -352,10 +354,6 @@ static void __init smp_init_package_map(void) · 5 unmodified lines
352354 memset(physical_to_logical_pkg, 0xff, size);
353355 size = BITS_TO_LONGS(max_physical_pkg_id) * sizeof(unsigned long);
354356 physical_package_map = kzalloc(size, GFP_KERNEL);
355− size = BITS_TO_LONGS(__max_logical_packages) * sizeof(unsigned long);
356− logical_package_map = kzalloc(size, GFP_KERNEL);
357−
358− pr_info("Max logical packages: %u\n", __max_logical_packages);
359357
360358 for_each_present_cpu(cpu) {
361359 unsigned int apicid = apic->cpu_present_to_apicid(cpu);
@@ -369,6 +367,15 @@ static void __init smp_init_package_map(void) · 7 unmodified lines
369367 set_cpu_possible(cpu, false);
370368 set_cpu_present(cpu, false);
371369 }
370+
371+ if (logical_packages > __max_logical_packages) {
372+ pr_warn("Detected more packages (%u), then computed by BIOS data (%u).\n",
373+ logical_packages, __max_logical_packages);
374+ logical_packages_frozen = true;
375+ __max_logical_packages = logical_packages;
376+ }
377+
378+ pr_info("Max logical packages: %u\n", __max_logical_packages);
372379 }
373380
374381 void __init smp_store_boot_cpu_info(void)
arch/x86/kvm/ioapic.c+5−3
@@ -109,6 +109,7 @@ static void __rtc_irq_eoi_tracking_restore_one(struct kvm_vcpu *vcpu) · 108 unmodified lines
109109 {
110110 bool new_val, old_val;
111111 struct kvm_ioapic *ioapic = vcpu->kvm->arch.vioapic;
112+ struct dest_map *dest_map = &ioapic->rtc_status.dest_map;
112113 union kvm_ioapic_redirect_entry *e;
113114
114115 e = &ioapic->redirtbl[RTC_GSI];
@@ -117,16 +118,17 @@ static void __rtc_irq_eoi_tracking_restore_one(struct kvm_vcpu *vcpu) · 2 unmodified lines
117118 return;
118119
119120 new_val = kvm_apic_pending_eoi(vcpu, e->fields.vector);
120− old_val = test_bit(vcpu->vcpu_id, ioapic->rtc_status.dest_map.map);
121+ old_val = test_bit(vcpu->vcpu_id, dest_map->map);
121122
122123 if (new_val == old_val)
123124 return;
124125
125126 if (new_val) {
126− __set_bit(vcpu->vcpu_id, ioapic->rtc_status.dest_map.map);
127+ __set_bit(vcpu->vcpu_id, dest_map->map);
128+ dest_map->vectors[vcpu->vcpu_id] = e->fields.vector;
127129 ioapic->rtc_status.pending_eoi++;
128130 } else {
129− __clear_bit(vcpu->vcpu_id, ioapic->rtc_status.dest_map.map);
131+ __clear_bit(vcpu->vcpu_id, dest_map->map);
130132 ioapic->rtc_status.pending_eoi--;
131133 rtc_status_pending_eoi_check_valid(ioapic);
132134 }
arch/x86/kvm/pmu_amd.c+2−2
@@ -23,8 +23,8 @@ · 22 unmodified lines
2323 static struct kvm_event_hw_type_mapping amd_event_mapping[] = {
2424 [0] = { 0x76, 0x00, PERF_COUNT_HW_CPU_CYCLES },
2525 [1] = { 0xc0, 0x00, PERF_COUNT_HW_INSTRUCTIONS },
26− [2] = { 0x80, 0x00, PERF_COUNT_HW_CACHE_REFERENCES },
27− [3] = { 0x81, 0x00, PERF_COUNT_HW_CACHE_MISSES },
26+ [2] = { 0x7d, 0x07, PERF_COUNT_HW_CACHE_REFERENCES },
27+ [3] = { 0x7e, 0x07, PERF_COUNT_HW_CACHE_MISSES },
2828 [4] = { 0xc2, 0x00, PERF_COUNT_HW_BRANCH_INSTRUCTIONS },
2929 [5] = { 0xc3, 0x00, PERF_COUNT_HW_BRANCH_MISSES },
3030 [6] = { 0xd0, 0x00, PERF_COUNT_HW_STALLED_CYCLES_FRONTEND },
arch/x86/kvm/vmx.c+69−67
@@ -422,6 +422,7 @@ struct nested_vmx { · 421 unmodified lines
422422 struct list_head vmcs02_pool;
423423 int vmcs02_num;
424424 u64 vmcs01_tsc_offset;
425+ bool change_vmcs01_virtual_x2apic_mode;
425426 /* L2 must run next, and mustn't decide to exit to L1. */
426427 bool nested_run_pending;
427428 /*
@@ -435,6 +436,8 @@ struct nested_vmx { · 7 unmodified lines
435436 bool pi_pending;
436437 u16 posted_intr_nv;
437438
439+ unsigned long *msr_bitmap;
440+
438441 struct hrtimer preemption_timer;
439442 bool preemption_timer_expired;
440443
@@ -924,7 +927,6 @@ static unsigned long *vmx_msr_bitmap_legacy; · 483 unmodified lines
924927 static unsigned long *vmx_msr_bitmap_longmode;
925928 static unsigned long *vmx_msr_bitmap_legacy_x2apic;
926929 static unsigned long *vmx_msr_bitmap_longmode_x2apic;
927−static unsigned long *vmx_msr_bitmap_nested;
928930 static unsigned long *vmx_vmread_bitmap;
929931 static unsigned long *vmx_vmwrite_bitmap;
930932
@@ -2198,6 +2200,12 @@ static void vmx_vcpu_pi_load(struct kvm_vcpu *vcpu, int cpu) · 1267 unmodified lines
21982200 new.control) != old.control);
21992201 }
22002202
2203+static void decache_tsc_multiplier(struct vcpu_vmx *vmx)
2204+{
2205+ vmx->current_tsc_ratio = vmx->vcpu.arch.tsc_scaling_ratio;
2206+ vmcs_write64(TSC_MULTIPLIER, vmx->current_tsc_ratio);
2207+}
2208+
22012209 /*
22022210 * Switches to specified vcpu, until a matching vcpu_put(), but assumes
22032211 * vcpu mutex is already taken.
@@ -2256,10 +2264,8 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu) · 52 unmodified lines
22562264
22572265 /* Setup TSC multiplier */
22582266 if (kvm_has_tsc_control &&
2259− vmx->current_tsc_ratio != vcpu->arch.tsc_scaling_ratio) {
2260− vmx->current_tsc_ratio = vcpu->arch.tsc_scaling_ratio;
2261− vmcs_write64(TSC_MULTIPLIER, vmx->current_tsc_ratio);
2262− }
2267+ vmx->current_tsc_ratio != vcpu->arch.tsc_scaling_ratio)
2268+ decache_tsc_multiplier(vmx);
22632269
22642270 vmx_vcpu_pi_load(vcpu, cpu);
22652271 vmx->host_pkru = read_pkru();
@@ -2508,7 +2514,7 @@ static void vmx_set_msr_bitmap(struct kvm_vcpu *vcpu) · 242 unmodified lines
25082514 unsigned long *msr_bitmap;
25092515
25102516 if (is_guest_mode(vcpu))
2511− msr_bitmap = vmx_msr_bitmap_nested;
2517+ msr_bitmap = to_vmx(vcpu)->nested.msr_bitmap;
25122518 else if (cpu_has_secondary_exec_ctrls() &&
25132519 (vmcs_read32(SECONDARY_VM_EXEC_CONTROL) &
25142520 SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE)) {
@@ -6363,13 +6369,6 @@ static __init int hardware_setup(void) · 3848 unmodified lines
63636369 if (!vmx_msr_bitmap_longmode_x2apic)
63646370 goto out4;
63656371
6366− if (nested) {
6367− vmx_msr_bitmap_nested =
6368− (unsigned long *)__get_free_page(GFP_KERNEL);
6369− if (!vmx_msr_bitmap_nested)
6370− goto out5;
6371− }
6372−
63736372 vmx_vmread_bitmap = (unsigned long *)__get_free_page(GFP_KERNEL);
63746373 if (!vmx_vmread_bitmap)
63756374 goto out6;
@@ -6392,8 +6391,6 @@ static __init int hardware_setup(void) · 16 unmodified lines
63926391
63936392 memset(vmx_msr_bitmap_legacy, 0xff, PAGE_SIZE);
63946393 memset(vmx_msr_bitmap_longmode, 0xff, PAGE_SIZE);
6395− if (nested)
6396− memset(vmx_msr_bitmap_nested, 0xff, PAGE_SIZE);
63976394
63986395 if (setup_vmcs_config(&vmcs_config) < 0) {
63996396 r = -EIO;
@@ -6529,9 +6526,6 @@ out8: · 129 unmodified lines
65296526 out7:
65306527 free_page((unsigned long)vmx_vmread_bitmap);
65316528 out6:
6532− if (nested)
6533− free_page((unsigned long)vmx_msr_bitmap_nested);
6534−out5:
65356529 free_page((unsigned long)vmx_msr_bitmap_longmode_x2apic);
65366530 out4:
65376531 free_page((unsigned long)vmx_msr_bitmap_longmode);
@@ -6557,8 +6551,6 @@ static __exit void hardware_unsetup(void) · 19 unmodified lines
65576551 free_page((unsigned long)vmx_io_bitmap_a);
65586552 free_page((unsigned long)vmx_vmwrite_bitmap);
65596553 free_page((unsigned long)vmx_vmread_bitmap);
6560− if (nested)
6561− free_page((unsigned long)vmx_msr_bitmap_nested);
65626554
65636555 free_kvm_area();
65646556 }
@@ -6995,16 +6987,21 @@ static int handle_vmon(struct kvm_vcpu *vcpu) · 430 unmodified lines
69956987 return 1;
69966988 }
69976989
6990+ if (cpu_has_vmx_msr_bitmap()) {
6991+ vmx->nested.msr_bitmap =
6992+ (unsigned long *)__get_free_page(GFP_KERNEL);
6993+ if (!vmx->nested.msr_bitmap)
6994+ goto out_msr_bitmap;
6995+ }
6996+
69986997 vmx->nested.cached_vmcs12 = kmalloc(VMCS12_SIZE, GFP_KERNEL);
69996998 if (!vmx->nested.cached_vmcs12)
7000− return -ENOMEM;
6999+ goto out_cached_vmcs12;
70017000
70027001 if (enable_shadow_vmcs) {
70037002 shadow_vmcs = alloc_vmcs();
7004− if (!shadow_vmcs) {
7005− kfree(vmx->nested.cached_vmcs12);
7006− return -ENOMEM;
7007− }
7003+ if (!shadow_vmcs)
7004+ goto out_shadow_vmcs;
70087005 /* mark vmcs as shadow */
70097006 shadow_vmcs->revision_id |= (1u << 31);
70107007 /* init shadow vmcs */
@@ -7024,6 +7021,15 @@ static int handle_vmon(struct kvm_vcpu *vcpu) · 13 unmodified lines
70247021 skip_emulated_instruction(vcpu);
70257022 nested_vmx_succeed(vcpu);
70267023 return 1;
7024+
7025+out_shadow_vmcs:
7026+ kfree(vmx->nested.cached_vmcs12);
7027+
7028+out_cached_vmcs12:
7029+ free_page((unsigned long)vmx->nested.msr_bitmap);
7030+
7031+out_msr_bitmap:
7032+ return -ENOMEM;
70277033 }
70287034
70297035 /*
@@ -7098,6 +7104,10 @@ static void free_nested(struct vcpu_vmx *vmx) · 68 unmodified lines
70987104 vmx->nested.vmxon = false;
70997105 free_vpid(vmx->nested.vpid02);
71007106 nested_release_vmcs12(vmx);
7107+ if (vmx->nested.msr_bitmap) {
7108+ free_page((unsigned long)vmx->nested.msr_bitmap);
7109+ vmx->nested.msr_bitmap = NULL;
7110+ }
71017111 if (enable_shadow_vmcs)
71027112 free_vmcs(vmx->nested.current_shadow_vmcs);
71037113 kfree(vmx->nested.cached_vmcs12);
@@ -8419,6 +8429,12 @@ static void vmx_set_virtual_x2apic_mode(struct kvm_vcpu *vcpu, bool set) · 1315 unmodified lines
84198429 {
84208430 u32 sec_exec_control;
84218431
8432+ /* Postpone execution until vmcs01 is the current VMCS. */
8433+ if (is_guest_mode(vcpu)) {
8434+ to_vmx(vcpu)->nested.change_vmcs01_virtual_x2apic_mode = true;
8435+ return;
8436+ }
8437+
84228438 /*
84238439 * There is not point to enable virtualize x2apic without enable
84248440 * apicv
@@ -9472,8 +9488,10 @@ static inline bool nested_vmx_merge_msr_bitmap(struct kvm_vcpu *vcpu, · 1047 unmodified lines
94729488 {
94739489 int msr;
94749490 struct page *page;
9475− unsigned long *msr_bitmap;
9491+ unsigned long *msr_bitmap_l1;
9492+ unsigned long *msr_bitmap_l0 = to_vmx(vcpu)->nested.msr_bitmap;
94769493
9494+ /* This shortcut is ok because we support only x2APIC MSRs so far. */
94779495 if (!nested_cpu_has_virt_x2apic_mode(vmcs12))
94789496 return false;
94799497
@@ -9482,63 +9500,37 @@ static inline bool nested_vmx_merge_msr_bitmap(struct kvm_vcpu *vcpu, · 2 unmodified lines
94829500 WARN_ON(1);
94839501 return false;
94849502 }
9485− msr_bitmap = (unsigned long *)kmap(page);
9486− if (!msr_bitmap) {
9503+ msr_bitmap_l1 = (unsigned long *)kmap(page);
9504+ if (!msr_bitmap_l1) {
94879505 nested_release_page_clean(page);
94889506 WARN_ON(1);
94899507 return false;
94909508 }
94919509
9510+ memset(msr_bitmap_l0, 0xff, PAGE_SIZE);
9511+
94929512 if (nested_cpu_has_virt_x2apic_mode(vmcs12)) {
94939513 if (nested_cpu_has_apic_reg_virt(vmcs12))
94949514 for (msr = 0x800; msr <= 0x8ff; msr++)
94959515 nested_vmx_disable_intercept_for_msr(
9496− msr_bitmap,
9497− vmx_msr_bitmap_nested,
9516+ msr_bitmap_l1, msr_bitmap_l0,
94989517 msr, MSR_TYPE_R);
9499− /* TPR is allowed */
9500− nested_vmx_disable_intercept_for_msr(msr_bitmap,
9501− vmx_msr_bitmap_nested,
9518+
9519+ nested_vmx_disable_intercept_for_msr(
9520+ msr_bitmap_l1, msr_bitmap_l0,
95029521 APIC_BASE_MSR + (APIC_TASKPRI >> 4),
95039522 MSR_TYPE_R | MSR_TYPE_W);
9523+
95049524 if (nested_cpu_has_vid(vmcs12)) {
9505− /* EOI and self-IPI are allowed */
95069525 nested_vmx_disable_intercept_for_msr(
9507− msr_bitmap,
9508− vmx_msr_bitmap_nested,
9526+ msr_bitmap_l1, msr_bitmap_l0,
95099527 APIC_BASE_MSR + (APIC_EOI >> 4),
95109528 MSR_TYPE_W);
95119529 nested_vmx_disable_intercept_for_msr(
9512− msr_bitmap,
9513− vmx_msr_bitmap_nested,
9530+ msr_bitmap_l1, msr_bitmap_l0,
95149531 APIC_BASE_MSR + (APIC_SELF_IPI >> 4),
95159532 MSR_TYPE_W);
95169533 }
9517− } else {
9518− /*
9519− * Enable reading intercept of all the x2apic
9520− * MSRs. We should not rely on vmcs12 to do any
9521− * optimizations here, it may have been modified
9522− * by L1.
9523− */
9524− for (msr = 0x800; msr <= 0x8ff; msr++)
9525− __vmx_enable_intercept_for_msr(
9526− vmx_msr_bitmap_nested,
9527− msr,
9528− MSR_TYPE_R);
9529−
9530− __vmx_enable_intercept_for_msr(
9531− vmx_msr_bitmap_nested,
9532− APIC_BASE_MSR + (APIC_TASKPRI >> 4),
9533− MSR_TYPE_W);
9534− __vmx_enable_intercept_for_msr(
9535− vmx_msr_bitmap_nested,
9536− APIC_BASE_MSR + (APIC_EOI >> 4),
9537− MSR_TYPE_W);
9538− __vmx_enable_intercept_for_msr(
9539− vmx_msr_bitmap_nested,
9540− APIC_BASE_MSR + (APIC_SELF_IPI >> 4),
9541− MSR_TYPE_W);
95429534 }
95439535 kunmap(page);
95449536 nested_release_page_clean(page);
@@ -9957,10 +9949,10 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) · 412 unmodified lines
99579949 }
99589950
99599951 if (cpu_has_vmx_msr_bitmap() &&
9960− exec_control & CPU_BASED_USE_MSR_BITMAPS) {
9961− nested_vmx_merge_msr_bitmap(vcpu, vmcs12);
9962− /* MSR_BITMAP will be set by following vmx_set_efer. */
9963− } else
9952+ exec_control & CPU_BASED_USE_MSR_BITMAPS &&
9953+ nested_vmx_merge_msr_bitmap(vcpu, vmcs12))
9954+ ; /* MSR_BITMAP will be set by following vmx_set_efer. */
9955+ else
99649956 exec_control &= ~CPU_BASED_USE_MSR_BITMAPS;
99659957
99669958 /*
@@ -10011,6 +10003,8 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) · 44 unmodified lines
1001110003 vmx->nested.vmcs01_tsc_offset + vmcs12->tsc_offset);
1001210004 else
1001310005 vmcs_write64(TSC_OFFSET, vmx->nested.vmcs01_tsc_offset);
10006+ if (kvm_has_tsc_control)
10007+ decache_tsc_multiplier(vmx);
1001410008
1001510009 if (enable_vpid) {
1001610010 /*
@@ -10767,6 +10761,14 @@ static void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 exit_reason, · 750 unmodified lines
1076710761 else
1076810762 vmcs_set_bits(PIN_BASED_VM_EXEC_CONTROL,
1076910763 PIN_BASED_VMX_PREEMPTION_TIMER);
10764+ if (kvm_has_tsc_control)
10765+ decache_tsc_multiplier(vmx);
10766+
10767+ if (vmx->nested.change_vmcs01_virtual_x2apic_mode) {
10768+ vmx->nested.change_vmcs01_virtual_x2apic_mode = false;
10769+ vmx_set_virtual_x2apic_mode(vcpu,
10770+ vcpu->arch.apic_base & X2APIC_ENABLE);
10771+ }
1077010772
1077110773 /* This is needed for same reason as it was needed in prepare_vmcs02 */
1077210774 vmx->host_rsp = 0;
arch/x86/kvm/x86.c+4−4
@@ -2743,16 +2743,16 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) · 2742 unmodified lines
27432743 if (tsc_delta < 0)
27442744 mark_tsc_unstable("KVM discovered backwards TSC");
27452745
2746− if (kvm_lapic_hv_timer_in_use(vcpu) &&
2747− kvm_x86_ops->set_hv_timer(vcpu,
2748− kvm_get_lapic_tscdeadline_msr(vcpu)))
2749− kvm_lapic_switch_to_sw_timer(vcpu);
27502746 if (check_tsc_unstable()) {
27512747 u64 offset = kvm_compute_tsc_offset(vcpu,
27522748 vcpu->arch.last_guest_tsc);
27532749 kvm_x86_ops->write_tsc_offset(vcpu, offset);
27542750 vcpu->arch.tsc_catchup = 1;
27552751 }
2752+ if (kvm_lapic_hv_timer_in_use(vcpu) &&
2753+ kvm_x86_ops->set_hv_timer(vcpu,
2754+ kvm_get_lapic_tscdeadline_msr(vcpu)))
2755+ kvm_lapic_switch_to_sw_timer(vcpu);
27562756 /*
27572757 * On a host with synchronized TSC, there is no need to update
27582758 * kvmclock on vcpu->cpu migration
arch/x86/mm/kaslr.c+1−1
@@ -77,7 +77,7 @@ static inline unsigned long get_padding(struct kaslr_memory_region *region) · 76 unmodified lines
7777 */
7878 static inline bool kaslr_memory_enabled(void)
7979 {
80− return kaslr_enabled() && !config_enabled(CONFIG_KASAN);
80+ return kaslr_enabled() && !IS_ENABLED(CONFIG_KASAN);
8181 }
8282
8383 /* Initialize base and padding for each memory region randomized with KASLR */
arch/x86/mm/pageattr.c+11−10
@@ -917,11 +917,11 @@ static void populate_pte(struct cpa_data *cpa, · 916 unmodified lines
917917 }
918918 }
919919
920−static int populate_pmd(struct cpa_data *cpa,
921− unsigned long start, unsigned long end,
922− unsigned num_pages, pud_t *pud, pgprot_t pgprot)
920+static long populate_pmd(struct cpa_data *cpa,
921+ unsigned long start, unsigned long end,
922+ unsigned num_pages, pud_t *pud, pgprot_t pgprot)
923923 {
924− unsigned int cur_pages = 0;
924+ long cur_pages = 0;
925925 pmd_t *pmd;
926926 pgprot_t pmd_pgprot;
927927
@@ -991,12 +991,12 @@ static int populate_pmd(struct cpa_data *cpa, · 63 unmodified lines
991991 return num_pages;
992992 }
993993
994−static int populate_pud(struct cpa_data *cpa, unsigned long start, pgd_t *pgd,
995− pgprot_t pgprot)
994+static long populate_pud(struct cpa_data *cpa, unsigned long start, pgd_t *pgd,
995+ pgprot_t pgprot)
996996 {
997997 pud_t *pud;
998998 unsigned long end;
999− int cur_pages = 0;
999+ long cur_pages = 0;
10001000 pgprot_t pud_pgprot;
10011001
10021002 end = start + (cpa->numpages << PAGE_SHIFT);
@@ -1052,7 +1052,7 @@ static int populate_pud(struct cpa_data *cpa, unsigned long start, pgd_t *pgd, · 49 unmodified lines
10521052
10531053 /* Map trailing leftover */
10541054 if (start < end) {
1055− int tmp;
1055+ long tmp;
10561056
10571057 pud = pud_offset(pgd, start);
10581058 if (pud_none(*pud))
@@ -1078,7 +1078,7 @@ static int populate_pgd(struct cpa_data *cpa, unsigned long addr) · 19 unmodified lines
10781078 pgprot_t pgprot = __pgprot(_KERNPG_TABLE);
10791079 pud_t *pud = NULL; /* shut up gcc */
10801080 pgd_t *pgd_entry;
1081− int ret;
1081+ long ret;
10821082
10831083 pgd_entry = cpa->pgd + pgd_index(addr);
10841084
@@ -1327,7 +1327,8 @@ static int cpa_process_alias(struct cpa_data *cpa) · 242 unmodified lines
13271327
13281328 static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias)
13291329 {
1330− int ret, numpages = cpa->numpages;
1330+ unsigned long numpages = cpa->numpages;
1331+ int ret;
13311332
13321333 while (numpages) {
13331334 /*
arch/x86/mm/pat.c+10−7
@@ -927,9 +927,10 @@ int track_pfn_copy(struct vm_area_struct *vma) · 926 unmodified lines
927927 }
928928
929929 /*
930− * prot is passed in as a parameter for the new mapping. If the vma has a
931− * linear pfn mapping for the entire range reserve the entire vma range with
932− * single reserve_pfn_range call.
930+ * prot is passed in as a parameter for the new mapping. If the vma has
931+ * a linear pfn mapping for the entire range, or no vma is provided,
932+ * reserve the entire pfn + size range with single reserve_pfn_range
933+ * call.
933934 */
934935 int track_pfn_remap(struct vm_area_struct *vma, pgprot_t *prot,
935936 unsigned long pfn, unsigned long addr, unsigned long size)
@@ -938,11 +939,12 @@ int track_pfn_remap(struct vm_area_struct *vma, pgprot_t *prot, · 2 unmodified lines
938939 enum page_cache_mode pcm;
939940
940941 /* reserve the whole chunk starting from paddr */
941− if (addr == vma->vm_start && size == (vma->vm_end - vma->vm_start)) {
942+ if (!vma || (addr == vma->vm_start
943+ && size == (vma->vm_end - vma->vm_start))) {
942944 int ret;
943945
944946 ret = reserve_pfn_range(paddr, size, prot, 0);
945− if (!ret)
947+ if (ret == 0 && vma)
946948 vma->vm_flags |= VM_PAT;
947949 return ret;
948950 }
@@ -997,7 +999,7 @@ void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn, · 48 unmodified lines
997999 resource_size_t paddr;
9981000 unsigned long prot;
9991001
1000− if (!(vma->vm_flags & VM_PAT))
1002+ if (vma && !(vma->vm_flags & VM_PAT))
10011003 return;
10021004
10031005 /* free the chunk starting from pfn or the whole chunk */
@@ -1011,7 +1013,8 @@ void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn, · 7 unmodified lines
10111013 size = vma->vm_end - vma->vm_start;
10121014 }
10131015 free_pfn_range(paddr, size);
1014− vma->vm_flags &= ~VM_PAT;
1016+ if (vma)
1017+ vma->vm_flags &= ~VM_PAT;
10151018 }
10161019
10171020 /*
arch/x86/pci/fixup.c+13−7
@@ -553,15 +553,21 @@ static void twinhead_reserve_killing_zone(struct pci_dev *dev) · 552 unmodified lines
553553 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x27B9, twinhead_reserve_killing_zone);
554554
555555 /*
556− * Broadwell EP Home Agent BARs erroneously return non-zero values when read.
556+ * Device [8086:2fc0]
557+ * Erratum HSE43
558+ * CONFIG_TDP_NOMINAL CSR Implemented at Incorrect Offset
559+ * http://www.intel.com/content/www/us/en/processors/xeon/xeon-e5-v3-spec-update.html
557560 *
558− * See http://www.intel.com/content/www/us/en/processors/xeon/xeon-e5-v4-spec-update.html
559− * entry BDF2.
561+ * Devices [8086:6f60,6fa0,6fc0]
562+ * Erratum BDF2
563+ * PCI BARs in the Home Agent Will Return Non-Zero Values During Enumeration
564+ * http://www.intel.com/content/www/us/en/processors/xeon/xeon-e5-v4-spec-update.html
560565 */
561−static void pci_bdwep_bar(struct pci_dev *dev)
566+static void pci_invalid_bar(struct pci_dev *dev)
562567 {
563568 dev->non_compliant_bars = 1;
564569 }
565−DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6f60, pci_bdwep_bar);
566−DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6fa0, pci_bdwep_bar);
567−DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6fc0, pci_bdwep_bar);
570+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2fc0, pci_invalid_bar);
571+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6f60, pci_invalid_bar);
572+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6fa0, pci_invalid_bar);
573+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6fc0, pci_invalid_bar);
arch/x86/pci/vmd.c+8−2
@@ -41,6 +41,7 @@ static DEFINE_RAW_SPINLOCK(list_lock); · 40 unmodified lines
4141 * @node: list item for parent traversal.
4242 * @rcu: RCU callback item for freeing.
4343 * @irq: back pointer to parent.
44+ * @enabled: true if driver enabled IRQ
4445 * @virq: the virtual IRQ value provided to the requesting driver.
4546 *
4647 * Every MSI/MSI-X IRQ requested for a device in a VMD domain will be mapped to
@@ -50,6 +51,7 @@ struct vmd_irq { · 3 unmodified lines
5051 struct list_head node;
5152 struct rcu_head rcu;
5253 struct vmd_irq_list *irq;
54+ bool enabled;
5355 unsigned int virq;
5456 };
5557
@@ -122,7 +124,9 @@ static void vmd_irq_enable(struct irq_data *data) · 66 unmodified lines
122124 unsigned long flags;
123125
124126 raw_spin_lock_irqsave(&list_lock, flags);
127+ WARN_ON(vmdirq->enabled);
125128 list_add_tail_rcu(&vmdirq->node, &vmdirq->irq->irq_list);
129+ vmdirq->enabled = true;
126130 raw_spin_unlock_irqrestore(&list_lock, flags);
127131
128132 data->chip->irq_unmask(data);
@@ -136,8 +140,10 @@ static void vmd_irq_disable(struct irq_data *data) · 7 unmodified lines
136140 data->chip->irq_mask(data);
137141
138142 raw_spin_lock_irqsave(&list_lock, flags);
139− list_del_rcu(&vmdirq->node);
140− INIT_LIST_HEAD_RCU(&vmdirq->node);
143+ if (vmdirq->enabled) {
144+ list_del_rcu(&vmdirq->node);
145+ vmdirq->enabled = false;
146+ }
141147 raw_spin_unlock_irqrestore(&list_lock, flags);
142148 }
143149
arch/x86/platform/efi/efi_64.c+1−1
@@ -245,7 +245,7 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) · 244 unmodified lines
245245 * text and allocate a new stack because we can't rely on the
246246 * stack pointer being < 4GB.
247247 */
248− if (!IS_ENABLED(CONFIG_EFI_MIXED))
248+ if (!IS_ENABLED(CONFIG_EFI_MIXED) || efi_is_native())
249249 return 0;
250250
251251 /*
arch/x86/power/hibernate_64.c+1−1
@@ -113,7 +113,7 @@ static int set_up_temporary_mappings(void) · 112 unmodified lines
113113 return result;
114114 }
115115
116− temp_level4_pgt = (unsigned long)pgd - __PAGE_OFFSET;
116+ temp_level4_pgt = __pa(pgd);
117117 return 0;
118118 }
119119
arch/x86/um/ptrace_32.c+3−0
@@ -84,7 +84,10 @@ int putreg(struct task_struct *child, int regno, unsigned long value) · 83 unmodified lines
8484 case EAX:
8585 case EIP:
8686 case UESP:
87+ break;
8788 case ORIG_EAX:
89+ /* Update the syscall number. */
90+ UPT_SYSCALL_NR(&child->thread.regs.regs) = value;
8891 break;
8992 case FS:
9093 if (value && (value & 3) != 3)
arch/x86/um/ptrace_64.c+4−0
@@ -78,7 +78,11 @@ int putreg(struct task_struct *child, int regno, unsigned long value) · 77 unmodified lines
7878 case RSI:
7979 case RDI:
8080 case RBP:
81+ break;
82+
8183 case ORIG_RAX:
84+ /* Update the syscall number. */
85+ UPT_SYSCALL_NR(&child->thread.regs.regs) = value;
8286 break;
8387
8488 case FS:
arch/x86/xen/enlighten.c+1−1
@@ -118,7 +118,7 @@ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); · 117 unmodified lines
118118 DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
119119
120120 /* Linux <-> Xen vCPU id mapping */
121−DEFINE_PER_CPU(int, xen_vcpu_id) = -1;
121+DEFINE_PER_CPU(uint32_t, xen_vcpu_id);
122122 EXPORT_PER_CPU_SYMBOL(xen_vcpu_id);
123123
124124 enum xen_domain_type xen_domain_type = XEN_NATIVE;
block/bio.c+11−10
@@ -667,18 +667,19 @@ struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask, · 666 unmodified lines
667667 bio->bi_iter.bi_sector = bio_src->bi_iter.bi_sector;
668668 bio->bi_iter.bi_size = bio_src->bi_iter.bi_size;
669669
670− if (bio_op(bio) == REQ_OP_DISCARD)
671− goto integrity_clone;
672−
673− if (bio_op(bio) == REQ_OP_WRITE_SAME) {
670+ switch (bio_op(bio)) {
671+ case REQ_OP_DISCARD:
672+ case REQ_OP_SECURE_ERASE:
673+ break;
674+ case REQ_OP_WRITE_SAME:
674675 bio->bi_io_vec[bio->bi_vcnt++] = bio_src->bi_io_vec[0];
675− goto integrity_clone;
676+ break;
677+ default:
678+ bio_for_each_segment(bv, bio_src, iter)
679+ bio->bi_io_vec[bio->bi_vcnt++] = bv;
680+ break;
676681 }
677682
678− bio_for_each_segment(bv, bio_src, iter)
679− bio->bi_io_vec[bio->bi_vcnt++] = bv;
680−
681−integrity_clone:
682683 if (bio_integrity(bio_src)) {
683684 int ret;
684685
@@ -1788,7 +1789,7 @@ struct bio *bio_split(struct bio *bio, int sectors, · 1103 unmodified lines
17881789 * Discards need a mutable bio_vec to accommodate the payload
17891790 * required by the DSM TRIM and UNMAP commands.
17901791 */
1791− if (bio_op(bio) == REQ_OP_DISCARD)
1792+ if (bio_op(bio) == REQ_OP_DISCARD || bio_op(bio) == REQ_OP_SECURE_ERASE)
17921793 split = bio_clone_bioset(bio, gfp, bs);
17931794 else
17941795 split = bio_clone_fast(bio, gfp, bs);
block/blk-core.c+3−1
@@ -515,7 +515,9 @@ EXPORT_SYMBOL_GPL(blk_queue_bypass_end); · 514 unmodified lines
515515
516516 void blk_set_queue_dying(struct request_queue *q)
517517 {
518− queue_flag_set_unlocked(QUEUE_FLAG_DYING, q);
518+ spin_lock_irq(q->queue_lock);
519+ queue_flag_set(QUEUE_FLAG_DYING, q);
520+ spin_unlock_irq(q->queue_lock);
519521
520522 if (q->mq_ops)
521523 blk_mq_wake_waiters(q);
block/blk-merge.c+41−14
@@ -94,8 +94,30 @@ static struct bio *blk_bio_segment_split(struct request_queue *q, · 93 unmodified lines
9494 bool do_split = true;
9595 struct bio *new = NULL;
9696 const unsigned max_sectors = get_max_io_size(q, bio);
97+ unsigned bvecs = 0;
9798
9899 bio_for_each_segment(bv, bio, iter) {
100+ /*
101+ * With arbitrary bio size, the incoming bio may be very
102+ * big. We have to split the bio into small bios so that
103+ * each holds at most BIO_MAX_PAGES bvecs because
104+ * bio_clone() can fail to allocate big bvecs.
105+ *
106+ * It should have been better to apply the limit per
107+ * request queue in which bio_clone() is involved,
108+ * instead of globally. The biggest blocker is the
109+ * bio_clone() in bio bounce.
110+ *
111+ * If bio is splitted by this reason, we should have
112+ * allowed to continue bios merging, but don't do
113+ * that now for making the change simple.
114+ *
115+ * TODO: deal with bio bounce's bio_clone() gracefully
116+ * and convert the global limit into per-queue limit.
117+ */
118+ if (bvecs++ >= BIO_MAX_PAGES)
119+ goto split;
120+
99121 /*
100122 * If the queue doesn't support SG gaps and adding this
101123 * offset would create a gap, disallow it.
@@ -172,12 +194,18 @@ void blk_queue_split(struct request_queue *q, struct bio **bio, · 70 unmodified lines
172194 struct bio *split, *res;
173195 unsigned nsegs;
174196
175− if (bio_op(*bio) == REQ_OP_DISCARD)
197+ switch (bio_op(*bio)) {
198+ case REQ_OP_DISCARD:
199+ case REQ_OP_SECURE_ERASE:
176200 split = blk_bio_discard_split(q, *bio, bs, &nsegs);
177− else if (bio_op(*bio) == REQ_OP_WRITE_SAME)
201+ break;
202+ case REQ_OP_WRITE_SAME:
178203 split = blk_bio_write_same_split(q, *bio, bs, &nsegs);
179− else
204+ break;
205+ default:
180206 split = blk_bio_segment_split(q, *bio, q->bio_split, &nsegs);
207+ break;
208+ }
181209
182210 /* physical segments can be figured out during splitting */
183211 res = split ? split : *bio;
@@ -213,7 +241,7 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q, · 29 unmodified lines
213241 * This should probably be returning 0, but blk_add_request_payload()
214242 * (Christoph!!!!)
215243 */
216− if (bio_op(bio) == REQ_OP_DISCARD)
244+ if (bio_op(bio) == REQ_OP_DISCARD || bio_op(bio) == REQ_OP_SECURE_ERASE)
217245 return 1;
218246
219247 if (bio_op(bio) == REQ_OP_WRITE_SAME)
@@ -385,7 +413,9 @@ static int __blk_bios_map_sg(struct request_queue *q, struct bio *bio, · 165 unmodified lines
385413 nsegs = 0;
386414 cluster = blk_queue_cluster(q);
387415
388− if (bio_op(bio) == REQ_OP_DISCARD) {
416+ switch (bio_op(bio)) {
417+ case REQ_OP_DISCARD:
418+ case REQ_OP_SECURE_ERASE:
389419 /*
390420 * This is a hack - drivers should be neither modifying the
391421 * biovec, nor relying on bi_vcnt - but because of
@@ -393,19 +423,16 @@ static int __blk_bios_map_sg(struct request_queue *q, struct bio *bio, · 1 unmodified line
393423 * a payload we need to set up here (thank you Christoph) and
394424 * bi_vcnt is really the only way of telling if we need to.
395425 */
396−
397− if (bio->bi_vcnt)
398− goto single_segment;
399−
400− return 0;
401− }
402−
403− if (bio_op(bio) == REQ_OP_WRITE_SAME) {
404−single_segment:
426+ if (!bio->bi_vcnt)
427+ return 0;
428+ /* Fall through */
429+ case REQ_OP_WRITE_SAME:
405430 *sg = sglist;
406431 bvec = bio_iovec(bio);
407432 sg_set_page(*sg, bvec.bv_page, bvec.bv_len, bvec.bv_offset);
408433 return 1;
434+ default:
435+ break;
409436 }
410437
411438 for_each_bio(bio)
block/blk-mq.c+33−43
@@ -296,17 +296,29 @@ struct request *blk_mq_alloc_request_hctx(struct request_queue *q, int rw, · 295 unmodified lines
296296 if (ret)
297297 return ERR_PTR(ret);
298298
299+ /*
300+ * Check if the hardware context is actually mapped to anything.
301+ * If not tell the caller that it should skip this queue.
302+ */
299303 hctx = q->queue_hw_ctx[hctx_idx];
304+ if (!blk_mq_hw_queue_mapped(hctx)) {
305+ ret = -EXDEV;
306+ goto out_queue_exit;
307+ }
300308 ctx = __blk_mq_get_ctx(q, cpumask_first(hctx->cpumask));
301309
302310 blk_mq_set_alloc_data(&alloc_data, q, flags, ctx, hctx);
303311 rq = __blk_mq_alloc_request(&alloc_data, rw, 0);
304312 if (!rq) {
305− blk_queue_exit(q);
306− return ERR_PTR(-EWOULDBLOCK);
313+ ret = -EWOULDBLOCK;
314+ goto out_queue_exit;
307315 }
308316
309317 return rq;
318+
319+out_queue_exit:
320+ blk_queue_exit(q);
321+ return ERR_PTR(ret);
310322 }
311323 EXPORT_SYMBOL_GPL(blk_mq_alloc_request_hctx);
312324
@@ -793,11 +805,12 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx) · 480 unmodified lines
793805 struct list_head *dptr;
794806 int queued;
795807
796− WARN_ON(!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask));
797−
798808 if (unlikely(test_bit(BLK_MQ_S_STOPPED, &hctx->state)))
799809 return;
800810
811+ WARN_ON(!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask) &&
812+ cpu_online(hctx->next_cpu));
813+
801814 hctx->run++;
802815
803816 /*
@@ -1036,10 +1049,11 @@ void blk_mq_delay_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs) · 232 unmodified lines
10361049 EXPORT_SYMBOL(blk_mq_delay_queue);
10371050
10381051 static inline void __blk_mq_insert_req_list(struct blk_mq_hw_ctx *hctx,
1039− struct blk_mq_ctx *ctx,
10401052 struct request *rq,
10411053 bool at_head)
10421054 {
1055+ struct blk_mq_ctx *ctx = rq->mq_ctx;
1056+
10431057 trace_block_rq_insert(hctx->queue, rq);
10441058
10451059 if (at_head)
@@ -1053,20 +1067,16 @@ static void __blk_mq_insert_request(struct blk_mq_hw_ctx *hctx, · 7 unmodified lines
10531067 {
10541068 struct blk_mq_ctx *ctx = rq->mq_ctx;
10551069
1056− __blk_mq_insert_req_list(hctx, ctx, rq, at_head);
1070+ __blk_mq_insert_req_list(hctx, rq, at_head);
10571071 blk_mq_hctx_mark_pending(hctx, ctx);
10581072 }
10591073
10601074 void blk_mq_insert_request(struct request *rq, bool at_head, bool run_queue,
1061− bool async)
1075+ bool async)
10621076 {
1077+ struct blk_mq_ctx *ctx = rq->mq_ctx;
10631078 struct request_queue *q = rq->q;
10641079 struct blk_mq_hw_ctx *hctx;
1065− struct blk_mq_ctx *ctx = rq->mq_ctx, *current_ctx;
1066−
1067− current_ctx = blk_mq_get_ctx(q);
1068− if (!cpu_online(ctx->cpu))
1069− rq->mq_ctx = ctx = current_ctx;
10701080
10711081 hctx = q->mq_ops->map_queue(q, ctx->cpu);
10721082
@@ -1076,8 +1086,6 @@ void blk_mq_insert_request(struct request *rq, bool at_head, bool run_queue, · 3 unmodified lines
10761086
10771087 if (run_queue)
10781088 blk_mq_run_hw_queue(hctx, async);
1079−
1080− blk_mq_put_ctx(current_ctx);
10811089 }
10821090
10831091 static void blk_mq_insert_requests(struct request_queue *q,
@@ -1088,14 +1096,9 @@ static void blk_mq_insert_requests(struct request_queue *q, · 4 unmodified lines
10881096
10891097 {
10901098 struct blk_mq_hw_ctx *hctx;
1091− struct blk_mq_ctx *current_ctx;
10921099
10931100 trace_block_unplug(q, depth, !from_schedule);
10941101
1095− current_ctx = blk_mq_get_ctx(q);
1096−
1097− if (!cpu_online(ctx->cpu))
1098− ctx = current_ctx;
10991102 hctx = q->mq_ops->map_queue(q, ctx->cpu);
11001103
11011104 /*
@@ -1107,15 +1110,14 @@ static void blk_mq_insert_requests(struct request_queue *q, · 5 unmodified lines
11071110 struct request *rq;
11081111
11091112 rq = list_first_entry(list, struct request, queuelist);
1113+ BUG_ON(rq->mq_ctx != ctx);
11101114 list_del_init(&rq->queuelist);
1111− rq->mq_ctx = ctx;
1112− __blk_mq_insert_req_list(hctx, ctx, rq, false);
1115+ __blk_mq_insert_req_list(hctx, rq, false);
11131116 }
11141117 blk_mq_hctx_mark_pending(hctx, ctx);
11151118 spin_unlock(&ctx->lock);
11161119
11171120 blk_mq_run_hw_queue(hctx, from_schedule);
1118− blk_mq_put_ctx(current_ctx);
11191121 }
11201122
11211123 static int plug_ctx_cmp(void *priv, struct list_head *a, struct list_head *b)
@@ -1630,16 +1632,17 @@ static int blk_mq_alloc_bitmap(struct blk_mq_ctxmap *bitmap, int node) · 508 unmodified lines
16301632 return 0;
16311633 }
16321634
1635+/*
1636+ * 'cpu' is going away. splice any existing rq_list entries from this
1637+ * software queue to the hw queue dispatch list, and ensure that it
1638+ * gets run.
1639+ */
16331640 static int blk_mq_hctx_cpu_offline(struct blk_mq_hw_ctx *hctx, int cpu)
16341641 {
1635− struct request_queue *q = hctx->queue;
16361642 struct blk_mq_ctx *ctx;
16371643 LIST_HEAD(tmp);
16381644
1639− /*
1640− * Move ctx entries to new CPU, if this one is going away.
1641− */
1642− ctx = __blk_mq_get_ctx(q, cpu);
1645+ ctx = __blk_mq_get_ctx(hctx->queue, cpu);
16431646
16441647 spin_lock(&ctx->lock);
16451648 if (!list_empty(&ctx->rq_list)) {
@@ -1651,24 +1654,11 @@ static int blk_mq_hctx_cpu_offline(struct blk_mq_hw_ctx *hctx, int cpu) · 5 unmodified lines
16511654 if (list_empty(&tmp))
16521655 return NOTIFY_OK;
16531656
1654− ctx = blk_mq_get_ctx(q);
1655− spin_lock(&ctx->lock);
1656−
1657− while (!list_empty(&tmp)) {
1658− struct request *rq;
1659−
1660− rq = list_first_entry(&tmp, struct request, queuelist);
1661− rq->mq_ctx = ctx;
1662− list_move_tail(&rq->queuelist, &ctx->rq_list);
1663− }
1664−
1665− hctx = q->mq_ops->map_queue(q, ctx->cpu);
1666− blk_mq_hctx_mark_pending(hctx, ctx);
1667−
1668− spin_unlock(&ctx->lock);
1657+ spin_lock(&hctx->lock);
1658+ list_splice_tail_init(&tmp, &hctx->dispatch);
1659+ spin_unlock(&hctx->lock);
16691660
16701661 blk_mq_run_hw_queue(hctx, true);
1671− blk_mq_put_ctx(ctx);
16721662 return NOTIFY_OK;
16731663 }
16741664
block/blk-throttle.c+4−2
@@ -780,9 +780,11 @@ static bool tg_may_dispatch(struct throtl_grp *tg, struct bio *bio, · 779 unmodified lines
780780 /*
781781 * If previous slice expired, start a new one otherwise renew/extend
782782 * existing slice to make sure it is at least throtl_slice interval
783− * long since now.
783+ * long since now. New slice is started only for empty throttle group.
784+ * If there is queued bio, that means there should be an active
785+ * slice and it should be extended instead.
784786 */
785− if (throtl_slice_used(tg, rw))
787+ if (throtl_slice_used(tg, rw) && !(tg->service_queue.nr_queued[rw]))
786788 throtl_start_new_slice(tg, rw);
787789 else {
788790 if (time_before(tg->slice_end[rw], jiffies + throtl_slice))
block/elevator.c+1−1
@@ -366,7 +366,7 @@ void elv_dispatch_sort(struct request_queue *q, struct request *rq) · 365 unmodified lines
366366 list_for_each_prev(entry, &q->queue_head) {
367367 struct request *pos = list_entry_rq(entry);
368368
369− if ((req_op(rq) == REQ_OP_DISCARD) != (req_op(pos) == REQ_OP_DISCARD))
369+ if (req_op(rq) != req_op(pos))
370370 break;
371371 if (rq_data_dir(rq) != rq_data_dir(pos))
372372 break;
crypto/Kconfig+1−1
@@ -439,7 +439,7 @@ config CRYPTO_CRC32C_INTEL · 438 unmodified lines
439439
440440 config CRYPT_CRC32C_VPMSUM
441441 tristate "CRC32c CRC algorithm (powerpc64)"
442− depends on PPC64
442+ depends on PPC64 && ALTIVEC
443443 select CRYPTO_HASH
444444 select CRC32
445445 help
crypto/blkcipher.c+2−1
@@ -233,6 +233,8 @@ static int blkcipher_walk_next(struct blkcipher_desc *desc, · 232 unmodified lines
233233 return blkcipher_walk_done(desc, walk, -EINVAL);
234234 }
235235
236+ bsize = min(walk->walk_blocksize, n);
237+
236238 walk->flags &= ~(BLKCIPHER_WALK_SLOW | BLKCIPHER_WALK_COPY |
237239 BLKCIPHER_WALK_DIFF);
238240 if (!scatterwalk_aligned(&walk->in, walk->alignmask) ||
@@ -245,7 +247,6 @@ static int blkcipher_walk_next(struct blkcipher_desc *desc, · 6 unmodified lines
245247 }
246248 }
247249
248− bsize = min(walk->walk_blocksize, n);
249250 n = scatterwalk_clamp(&walk->in, n);
250251 n = scatterwalk_clamp(&walk->out, n);
251252
crypto/cryptd.c+9−3
@@ -631,9 +631,14 @@ static int cryptd_hash_export(struct ahash_request *req, void *out) · 630 unmodified lines
631631
632632 static int cryptd_hash_import(struct ahash_request *req, const void *in)
633633 {
634− struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req);
634+ struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
635+ struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm);
636+ struct shash_desc *desc = cryptd_shash_desc(req);
637+
638+ desc->tfm = ctx->child;
639+ desc->flags = req->base.flags;
635640
636− return crypto_shash_import(&rctx->desc, in);
641+ return crypto_shash_import(desc, in);
637642 }
638643
639644 static int cryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb,
@@ -733,13 +738,14 @@ static void cryptd_aead_crypt(struct aead_request *req, · 93 unmodified lines
733738 rctx = aead_request_ctx(req);
734739 compl = rctx->complete;
735740
741+ tfm = crypto_aead_reqtfm(req);
742+
736743 if (unlikely(err == -EINPROGRESS))
737744 goto out;
738745 aead_request_set_tfm(req, child);
739746 err = crypt( req );
740747
741748 out:
742− tfm = crypto_aead_reqtfm(req);
743749 ctx = crypto_aead_ctx(tfm);
744750 refcnt = atomic_read(&ctx->refcnt);
745751
crypto/echainiv.c+24−91
@@ -1,8 +1,8 @@
11 /*
22 * echainiv: Encrypted Chain IV Generator
33 *
4− * This generator generates an IV based on a sequence number by xoring it
5− * with a salt and then encrypting it with the same key as used to encrypt
4+ * This generator generates an IV based on a sequence number by multiplying
5+ * it with a salt and then encrypting it with the same key as used to encrypt
66 * the plain text. This algorithm requires that the block size be equal
77 * to the IV size. It is mainly useful for CBC.
88 *
@@ -24,81 +24,17 @@ · 15 unmodified lines
2424 #include <linux/err.h>
2525 #include <linux/init.h>
2626 #include <linux/kernel.h>
27−#include <linux/mm.h>
2827 #include <linux/module.h>
29−#include <linux/percpu.h>
30−#include <linux/spinlock.h>
28+#include <linux/slab.h>
3129 #include <linux/string.h>
3230
33−#define MAX_IV_SIZE 16
34−
35−static DEFINE_PER_CPU(u32 [MAX_IV_SIZE / sizeof(u32)], echainiv_iv);
36−
37−/* We don't care if we get preempted and read/write IVs from the next CPU. */
38−static void echainiv_read_iv(u8 *dst, unsigned size)
39−{
40− u32 *a = (u32 *)dst;
41− u32 __percpu *b = echainiv_iv;
42−
43− for (; size >= 4; size -= 4) {
44− *a++ = this_cpu_read(*b);
45− b++;
46− }
47−}
48−
49−static void echainiv_write_iv(const u8 *src, unsigned size)
50−{
51− const u32 *a = (const u32 *)src;
52− u32 __percpu *b = echainiv_iv;
53−
54− for (; size >= 4; size -= 4) {
55− this_cpu_write(*b, *a);
56− a++;
57− b++;
58− }
59−}
60−
61−static void echainiv_encrypt_complete2(struct aead_request *req, int err)
62−{
63− struct aead_request *subreq = aead_request_ctx(req);
64− struct crypto_aead *geniv;
65− unsigned int ivsize;
66−
67− if (err == -EINPROGRESS)
68− return;
69−
70− if (err)
71− goto out;
72−
73− geniv = crypto_aead_reqtfm(req);
74− ivsize = crypto_aead_ivsize(geniv);
75−
76− echainiv_write_iv(subreq->iv, ivsize);
77−
78− if (req->iv != subreq->iv)
79− memcpy(req->iv, subreq->iv, ivsize);
80−
81−out:
82− if (req->iv != subreq->iv)
83− kzfree(subreq->iv);
84−}
85−
86−static void echainiv_encrypt_complete(struct crypto_async_request *base,
87− int err)
88−{
89− struct aead_request *req = base->data;
90−
91− echainiv_encrypt_complete2(req, err);
92− aead_request_complete(req, err);
93−}
94−
9531 static int echainiv_encrypt(struct aead_request *req)
9632 {
9733 struct crypto_aead *geniv = crypto_aead_reqtfm(req);
9834 struct aead_geniv_ctx *ctx = crypto_aead_ctx(geniv);
9935 struct aead_request *subreq = aead_request_ctx(req);
100− crypto_completion_t compl;
101− void *data;
36+ __be64 nseqno;
37+ u64 seqno;
10238 u8 *info;
10339 unsigned int ivsize = crypto_aead_ivsize(geniv);
10440 int err;
@@ -108,8 +44,6 @@ static int echainiv_encrypt(struct aead_request *req) · 3 unmodified lines
10844
10945 aead_request_set_tfm(subreq, ctx->child);
11046
111− compl = echainiv_encrypt_complete;
112− data = req;
11347 info = req->iv;
11448
11549 if (req->src != req->dst) {
@@ -127,29 +61,30 @@ static int echainiv_encrypt(struct aead_request *req) · 11 unmodified lines
12761 return err;
12862 }
12963
130− if (unlikely(!IS_ALIGNED((unsigned long)info,
131− crypto_aead_alignmask(geniv) + 1))) {
132− info = kmalloc(ivsize, req->base.flags &
133− CRYPTO_TFM_REQ_MAY_SLEEP ? GFP_KERNEL:
134− GFP_ATOMIC);
135− if (!info)
136− return -ENOMEM;
137−
138− memcpy(info, req->iv, ivsize);
139− }
140−
141− aead_request_set_callback(subreq, req->base.flags, compl, data);
64+ aead_request_set_callback(subreq, req->base.flags,
65+ req->base.complete, req->base.data);
14266 aead_request_set_crypt(subreq, req->dst, req->dst,
14367 req->cryptlen, info);
14468 aead_request_set_ad(subreq, req->assoclen);
14569
146− crypto_xor(info, ctx->salt, ivsize);
70+ memcpy(&nseqno, info + ivsize - 8, 8);
71+ seqno = be64_to_cpu(nseqno);
72+ memset(info, 0, ivsize);
73+
14774 scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1);
148− echainiv_read_iv(info, ivsize);
14975
150− err = crypto_aead_encrypt(subreq);
151− echainiv_encrypt_complete2(req, err);
152− return err;
76+ do {
77+ u64 a;
78+
79+ memcpy(&a, ctx->salt + ivsize - 8, 8);
80+
81+ a |= 1;
82+ a *= seqno;
83+
84+ memcpy(info + ivsize - 8, &a, 8);
85+ } while ((ivsize -= 8));
86+
87+ return crypto_aead_encrypt(subreq);
15388 }
15489
15590 static int echainiv_decrypt(struct aead_request *req)
@@ -196,8 +131,7 @@ static int echainiv_aead_create(struct crypto_template *tmpl, · 40 unmodified lines
196131 alg = crypto_spawn_aead_alg(spawn);
197132
198133 err = -EINVAL;
199− if (inst->alg.ivsize & (sizeof(u32) - 1) ||
200− inst->alg.ivsize > MAX_IV_SIZE)
134+ if (inst->alg.ivsize & (sizeof(u64) - 1) || !inst->alg.ivsize)
201135 goto free_inst;
202136
203137 inst->alg.encrypt = echainiv_encrypt;
@@ -206,7 +140,6 @@ static int echainiv_aead_create(struct crypto_template *tmpl, · 2 unmodified lines
206140 inst->alg.init = aead_init_geniv;
207141 inst->alg.exit = aead_exit_geniv;
208142
209− inst->alg.base.cra_alignmask |= __alignof__(u32) - 1;
210143 inst->alg.base.cra_ctxsize = sizeof(struct aead_geniv_ctx);
211144 inst->alg.base.cra_ctxsize += inst->alg.ivsize;
212145
crypto/rsa-pkcs1pad.c+24−17
@@ -298,41 +298,48 @@ static int pkcs1pad_decrypt_complete(struct akcipher_request *req, int err) · 297 unmodified lines
298298 struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
299299 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
300300 struct pkcs1pad_request *req_ctx = akcipher_request_ctx(req);
301+ unsigned int dst_len;
301302 unsigned int pos;
302−
303− if (err == -EOVERFLOW)
304− /* Decrypted value had no leading 0 byte */
305− err = -EINVAL;
303+ u8 *out_buf;
306304
307305 if (err)
308306 goto done;
309307
310− if (req_ctx->child_req.dst_len != ctx->key_size - 1) {
311− err = -EINVAL;
308+ err = -EINVAL;
309+ dst_len = req_ctx->child_req.dst_len;
310+ if (dst_len < ctx->key_size - 1)
312311 goto done;
312+
313+ out_buf = req_ctx->out_buf;
314+ if (dst_len == ctx->key_size) {
315+ if (out_buf[0] != 0x00)
316+ /* Decrypted value had no leading 0 byte */
317+ goto done;
318+
319+ dst_len--;
320+ out_buf++;
313321 }
314322
315− if (req_ctx->out_buf[0] != 0x02) {
316− err = -EINVAL;
323+ if (out_buf[0] != 0x02)
317324 goto done;
318− }
319− for (pos = 1; pos < req_ctx->child_req.dst_len; pos++)
320− if (req_ctx->out_buf[pos] == 0x00)
325+
326+ for (pos = 1; pos < dst_len; pos++)
327+ if (out_buf[pos] == 0x00)
321328 break;
322− if (pos < 9 || pos == req_ctx->child_req.dst_len) {
323− err = -EINVAL;
329+ if (pos < 9 || pos == dst_len)
324330 goto done;
325− }
326331 pos++;
327332
328− if (req->dst_len < req_ctx->child_req.dst_len - pos)
333+ err = 0;
334+
335+ if (req->dst_len < dst_len - pos)
329336 err = -EOVERFLOW;
330− req->dst_len = req_ctx->child_req.dst_len - pos;
337+ req->dst_len = dst_len - pos;
331338
332339 if (!err)
333340 sg_copy_from_buffer(req->dst,
334341 sg_nents_for_len(req->dst, req->dst_len),
335− req_ctx->out_buf + pos, req->dst_len);
342+ out_buf + pos, req->dst_len);
336343
337344 done:
338345 kzfree(req_ctx->out_buf);
crypto/sha3_generic.c+8−8
@@ -24,14 +24,14 @@ · 23 unmodified lines
2424 #define ROTL64(x, y) (((x) << (y)) | ((x) >> (64 - (y))))
2525
2626 static const u64 keccakf_rndc[24] = {
27− 0x0000000000000001, 0x0000000000008082, 0x800000000000808a,
28− 0x8000000080008000, 0x000000000000808b, 0x0000000080000001,
29− 0x8000000080008081, 0x8000000000008009, 0x000000000000008a,
30− 0x0000000000000088, 0x0000000080008009, 0x000000008000000a,
31− 0x000000008000808b, 0x800000000000008b, 0x8000000000008089,
32− 0x8000000000008003, 0x8000000000008002, 0x8000000000000080,
33− 0x000000000000800a, 0x800000008000000a, 0x8000000080008081,
34− 0x8000000000008080, 0x0000000080000001, 0x8000000080008008
27+ 0x0000000000000001ULL, 0x0000000000008082ULL, 0x800000000000808aULL,
28+ 0x8000000080008000ULL, 0x000000000000808bULL, 0x0000000080000001ULL,
29+ 0x8000000080008081ULL, 0x8000000000008009ULL, 0x000000000000008aULL,
30+ 0x0000000000000088ULL, 0x0000000080008009ULL, 0x000000008000000aULL,
31+ 0x000000008000808bULL, 0x800000000000008bULL, 0x8000000000008089ULL,
32+ 0x8000000000008003ULL, 0x8000000000008002ULL, 0x8000000000000080ULL,
33+ 0x000000000000800aULL, 0x800000008000000aULL, 0x8000000080008081ULL,
34+ 0x8000000000008080ULL, 0x0000000080000001ULL, 0x8000000080008008ULL
3535 };
3636
3737 static const int keccakf_rotc[24] = {
drivers/acpi/nfit/mce.c+1−1
@@ -42,7 +42,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val, · 41 unmodified lines
4242 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) {
4343 struct acpi_nfit_system_address *spa = nfit_spa->spa;
4444
45− if (nfit_spa_type(spa) == NFIT_SPA_PM)
45+ if (nfit_spa_type(spa) != NFIT_SPA_PM)
4646 continue;
4747 /* find the spa that covers the mce addr */
4848 if (spa->address > mce->addr)
drivers/acpi/scan.c+3−3
@@ -2054,7 +2054,7 @@ int __init acpi_scan_init(void) · 2053 unmodified lines
20542054
20552055 static struct acpi_probe_entry *ape;
20562056 static int acpi_probe_count;
2057−static DEFINE_SPINLOCK(acpi_probe_lock);
2057+static DEFINE_MUTEX(acpi_probe_mutex);
20582058
20592059 static int __init acpi_match_madt(struct acpi_subtable_header *header,
20602060 const unsigned long end)
@@ -2073,7 +2073,7 @@ int __init __acpi_probe_device_table(struct acpi_probe_entry *ap_head, int nr) · 12 unmodified lines
20732073 if (acpi_disabled)
20742074 return 0;
20752075
2076− spin_lock(&acpi_probe_lock);
2076+ mutex_lock(&acpi_probe_mutex);
20772077 for (ape = ap_head; nr; ape++, nr--) {
20782078 if (ACPI_COMPARE_NAME(ACPI_SIG_MADT, ape->id)) {
20792079 acpi_probe_count = 0;
@@ -2086,7 +2086,7 @@ int __init __acpi_probe_device_table(struct acpi_probe_entry *ap_head, int nr) · 6 unmodified lines
20862086 count++;
20872087 }
20882088 }
2089− spin_unlock(&acpi_probe_lock);
2089+ mutex_unlock(&acpi_probe_mutex);
20902090
20912091 return count;
20922092 }
drivers/ata/libahci.c+1−1
@@ -2524,7 +2524,7 @@ static int ahci_host_activate_multi_irqs(struct ata_host *host, · 2523 unmodified lines
25242524
25252525 /* Do not receive interrupts sent by dummy ports */
25262526 if (!pp) {
2527− disable_irq(irq + i);
2527+ disable_irq(irq);
25282528 continue;
25292529 }
25302530
drivers/ata/pata_ninja32.c+1−1
@@ -144,7 +144,7 @@ static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id) · 143 unmodified lines
144144 ap->ioaddr.altstatus_addr = base + 0x1E;
145145 ap->ioaddr.bmdma_addr = base;
146146 ata_sff_std_ports(&ap->ioaddr);
147− ap->pflags = ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32CHANGE;
147+ ap->pflags |= ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32CHANGE;
148148
149149 ninja32_program(base);
150150 /* FIXME: Should we disable them at remove ? */
drivers/base/power/runtime.c+7−7
@@ -301,7 +301,7 @@ static int rpm_idle(struct device *dev, int rpmflags) · 300 unmodified lines
301301 int (*callback)(struct device *);
302302 int retval;
303303
304− trace_rpm_idle(dev, rpmflags);
304+ trace_rpm_idle_rcuidle(dev, rpmflags);
305305 retval = rpm_check_suspend_allowed(dev);
306306 if (retval < 0)
307307 ; /* Conditions are wrong. */
@@ -337,7 +337,7 @@ static int rpm_idle(struct device *dev, int rpmflags) · 29 unmodified lines
337337 dev->power.request_pending = true;
338338 queue_work(pm_wq, &dev->power.work);
339339 }
340− trace_rpm_return_int(dev, _THIS_IP_, 0);
340+ trace_rpm_return_int_rcuidle(dev, _THIS_IP_, 0);
341341 return 0;
342342 }
343343
@@ -352,7 +352,7 @@ static int rpm_idle(struct device *dev, int rpmflags) · 8 unmodified lines
352352 wake_up_all(&dev->power.wait_queue);
353353
354354 out:
355− trace_rpm_return_int(dev, _THIS_IP_, retval);
355+ trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval);
356356 return retval ? retval : rpm_suspend(dev, rpmflags | RPM_AUTO);
357357 }
358358
@@ -419,7 +419,7 @@ static int rpm_suspend(struct device *dev, int rpmflags) · 60 unmodified lines
419419 struct device *parent = NULL;
420420 int retval;
421421
422− trace_rpm_suspend(dev, rpmflags);
422+ trace_rpm_suspend_rcuidle(dev, rpmflags);
423423
424424 repeat:
425425 retval = rpm_check_suspend_allowed(dev);
@@ -549,7 +549,7 @@ static int rpm_suspend(struct device *dev, int rpmflags) · 123 unmodified lines
549549 }
550550
551551 out:
552− trace_rpm_return_int(dev, _THIS_IP_, retval);
552+ trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval);
553553
554554 return retval;
555555
@@ -601,7 +601,7 @@ static int rpm_resume(struct device *dev, int rpmflags) · 45 unmodified lines
601601 struct device *parent = NULL;
602602 int retval = 0;
603603
604− trace_rpm_resume(dev, rpmflags);
604+ trace_rpm_resume_rcuidle(dev, rpmflags);
605605
606606 repeat:
607607 if (dev->power.runtime_error)
@@ -764,7 +764,7 @@ static int rpm_resume(struct device *dev, int rpmflags) · 156 unmodified lines
764764 spin_lock_irq(&dev->power.lock);
765765 }
766766
767− trace_rpm_return_int(dev, _THIS_IP_, retval);
767+ trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval);
768768
769769 return retval;
770770 }
drivers/base/regmap/regcache-rbtree.c+28−10
@@ -404,6 +404,7 @@ static int regcache_rbtree_write(struct regmap *map, unsigned int reg, · 403 unmodified lines
404404 unsigned int new_base_reg, new_top_reg;
405405 unsigned int min, max;
406406 unsigned int max_dist;
407+ unsigned int dist, best_dist = UINT_MAX;
407408
408409 max_dist = map->reg_stride * sizeof(*rbnode_tmp) /
409410 map->cache_word_size;
@@ -423,24 +424,41 @@ static int regcache_rbtree_write(struct regmap *map, unsigned int reg, · 13 unmodified lines
423424 &base_reg, &top_reg);
424425
425426 if (base_reg <= max && top_reg >= min) {
426− new_base_reg = min(reg, base_reg);
427− new_top_reg = max(reg, top_reg);
428− } else {
429− if (max < base_reg)
430− node = node->rb_left;
427+ if (reg < base_reg)
428+ dist = base_reg - reg;
429+ else if (reg > top_reg)
430+ dist = reg - top_reg;
431431 else
432− node = node->rb_right;
433−
434− continue;
432+ dist = 0;
433+ if (dist < best_dist) {
434+ rbnode = rbnode_tmp;
435+ best_dist = dist;
436+ new_base_reg = min(reg, base_reg);
437+ new_top_reg = max(reg, top_reg);
438+ }
435439 }
436440
437− ret = regcache_rbtree_insert_to_block(map, rbnode_tmp,
441+ /*
442+ * Keep looking, we want to choose the closest block,
443+ * otherwise we might end up creating overlapping
444+ * blocks, which breaks the rbtree.
445+ */
446+ if (reg < base_reg)
447+ node = node->rb_left;
448+ else if (reg > top_reg)
449+ node = node->rb_right;
450+ else
451+ break;
452+ }
453+
454+ if (rbnode) {
455+ ret = regcache_rbtree_insert_to_block(map, rbnode,
438456 new_base_reg,
439457 new_top_reg, reg,
440458 value);
441459 if (ret)
442460 return ret;
443− rbtree_ctx->cached_rbnode = rbnode_tmp;
461+ rbtree_ctx->cached_rbnode = rbnode;
444462 return 0;
445463 }
446464
drivers/base/regmap/regcache.c+3−2
@@ -38,10 +38,11 @@ static int regcache_hw_init(struct regmap *map) · 37 unmodified lines
3838
3939 /* calculate the size of reg_defaults */
4040 for (count = 0, i = 0; i < map->num_reg_defaults_raw; i++)
41− if (!regmap_volatile(map, i * map->reg_stride))
41+ if (regmap_readable(map, i * map->reg_stride) &&
42+ !regmap_volatile(map, i * map->reg_stride))
4243 count++;
4344
44− /* all registers are volatile, so just bypass */
45+ /* all registers are unreadable or volatile, so just bypass */
4546 if (!count) {
4647 map->cache_bypass = true;
4748 return 0;
drivers/base/regmap/regmap.c+6−0
@@ -1474,6 +1474,12 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg, · 1473 unmodified lines
14741474 ret = map->bus->write(map->bus_context, buf, len);
14751475
14761476 kfree(buf);
1477+ } else if (ret != 0 && !map->cache_bypass && map->format.parse_val) {
1478+ /* regcache_drop_region() takes lock that we already have,
1479+ * thus call map->cache_ops->drop() directly
1480+ */
1481+ if (map->cache_ops && map->cache_ops->drop)
1482+ map->cache_ops->drop(map, reg, reg + 1);
14771483 }
14781484
14791485 trace_regmap_hw_write_done(map, reg, val_len / map->format.val_bytes);
drivers/block/floppy.c+13−14
@@ -3706,22 +3706,21 @@ static int floppy_open(struct block_device *bdev, fmode_t mode) · 3705 unmodified lines
37063706 if (UFDCS->rawcmd == 1)
37073707 UFDCS->rawcmd = 2;
37083708
3709− if (mode & (FMODE_READ|FMODE_WRITE)) {
3710− UDRS->last_checked = 0;
3711− clear_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags);
3712− check_disk_change(bdev);
3713− if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags))
3714− goto out;
3715− if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags))
3709+ if (!(mode & FMODE_NDELAY)) {
3710+ if (mode & (FMODE_READ|FMODE_WRITE)) {
3711+ UDRS->last_checked = 0;
3712+ clear_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags);
3713+ check_disk_change(bdev);
3714+ if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags))
3715+ goto out;
3716+ if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags))
3717+ goto out;
3718+ }
3719+ res = -EROFS;
3720+ if ((mode & FMODE_WRITE) &&
3721+ !test_bit(FD_DISK_WRITABLE_BIT, &UDRS->flags))
37163722 goto out;
37173723 }
3718−
3719− res = -EROFS;
3720−
3721− if ((mode & FMODE_WRITE) &&
3722− !test_bit(FD_DISK_WRITABLE_BIT, &UDRS->flags))
3723− goto out;
3724−
37253724 mutex_unlock(&open_lock);
37263725 mutex_unlock(&floppy_mutex);
37273726 return 0;
drivers/block/xen-blkfront.c+56−41
@@ -189,6 +189,8 @@ struct blkfront_info · 188 unmodified lines
189189 struct mutex mutex;
190190 struct xenbus_device *xbdev;
191191 struct gendisk *gd;
192+ u16 sector_size;
193+ unsigned int physical_sector_size;
192194 int vdevice;
193195 blkif_vdev_t handle;
194196 enum blkif_state connected;
@@ -910,9 +912,45 @@ static struct blk_mq_ops blkfront_mq_ops = { · 715 unmodified lines
910912 .map_queue = blk_mq_map_queue,
911913 };
912914
915+static void blkif_set_queue_limits(struct blkfront_info *info)
916+{
917+ struct request_queue *rq = info->rq;
918+ struct gendisk *gd = info->gd;
919+ unsigned int segments = info->max_indirect_segments ? :
920+ BLKIF_MAX_SEGMENTS_PER_REQUEST;
921+
922+ queue_flag_set_unlocked(QUEUE_FLAG_VIRT, rq);
923+
924+ if (info->feature_discard) {
925+ queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, rq);
926+ blk_queue_max_discard_sectors(rq, get_capacity(gd));
927+ rq->limits.discard_granularity = info->discard_granularity;
928+ rq->limits.discard_alignment = info->discard_alignment;
929+ if (info->feature_secdiscard)
930+ queue_flag_set_unlocked(QUEUE_FLAG_SECERASE, rq);
931+ }
932+
933+ /* Hard sector size and max sectors impersonate the equiv. hardware. */
934+ blk_queue_logical_block_size(rq, info->sector_size);
935+ blk_queue_physical_block_size(rq, info->physical_sector_size);
936+ blk_queue_max_hw_sectors(rq, (segments * XEN_PAGE_SIZE) / 512);
937+
938+ /* Each segment in a request is up to an aligned page in size. */
939+ blk_queue_segment_boundary(rq, PAGE_SIZE - 1);
940+ blk_queue_max_segment_size(rq, PAGE_SIZE);
941+
942+ /* Ensure a merged request will fit in a single I/O ring slot. */
943+ blk_queue_max_segments(rq, segments / GRANTS_PER_PSEG);
944+
945+ /* Make sure buffer addresses are sector-aligned. */
946+ blk_queue_dma_alignment(rq, 511);
947+
948+ /* Make sure we don't use bounce buffers. */
949+ blk_queue_bounce_limit(rq, BLK_BOUNCE_ANY);
950+}
951+
913952 static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size,
914− unsigned int physical_sector_size,
915− unsigned int segments)
953+ unsigned int physical_sector_size)
916954 {
917955 struct request_queue *rq;
918956 struct blkfront_info *info = gd->private_data;
@@ -944,36 +982,11 @@ static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size, · 25 unmodified lines
944982 }
945983
946984 rq->queuedata = info;
947− queue_flag_set_unlocked(QUEUE_FLAG_VIRT, rq);
948−
949− if (info->feature_discard) {
950− queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, rq);
951− blk_queue_max_discard_sectors(rq, get_capacity(gd));
952− rq->limits.discard_granularity = info->discard_granularity;
953− rq->limits.discard_alignment = info->discard_alignment;
954− if (info->feature_secdiscard)
955− queue_flag_set_unlocked(QUEUE_FLAG_SECERASE, rq);
956− }
957−
958− /* Hard sector size and max sectors impersonate the equiv. hardware. */
959− blk_queue_logical_block_size(rq, sector_size);
960− blk_queue_physical_block_size(rq, physical_sector_size);
961− blk_queue_max_hw_sectors(rq, (segments * XEN_PAGE_SIZE) / 512);
962−
963− /* Each segment in a request is up to an aligned page in size. */
964− blk_queue_segment_boundary(rq, PAGE_SIZE - 1);
965− blk_queue_max_segment_size(rq, PAGE_SIZE);
966−
967− /* Ensure a merged request will fit in a single I/O ring slot. */
968− blk_queue_max_segments(rq, segments / GRANTS_PER_PSEG);
969−
970− /* Make sure buffer addresses are sector-aligned. */
971− blk_queue_dma_alignment(rq, 511);
972−
973− /* Make sure we don't use bounce buffers. */
974− blk_queue_bounce_limit(rq, BLK_BOUNCE_ANY);
975−
976− gd->queue = rq;
985+ info->rq = gd->queue = rq;
986+ info->gd = gd;
987+ info->sector_size = sector_size;
988+ info->physical_sector_size = physical_sector_size;
989+ blkif_set_queue_limits(info);
977990
978991 return 0;
979992 }
@@ -1136,16 +1149,11 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity, · 156 unmodified lines
11361149 gd->private_data = info;
11371150 set_capacity(gd, capacity);
11381151
1139− if (xlvbd_init_blk_queue(gd, sector_size, physical_sector_size,
1140− info->max_indirect_segments ? :
1141− BLKIF_MAX_SEGMENTS_PER_REQUEST)) {
1152+ if (xlvbd_init_blk_queue(gd, sector_size, physical_sector_size)) {
11421153 del_gendisk(gd);
11431154 goto release;
11441155 }
11451156
1146− info->rq = gd->queue;
1147− info->gd = gd;
1148−
11491157 xlvbd_flush(info);
11501158
11511159 if (vdisk_info & VDISK_READONLY)
@@ -1315,7 +1323,7 @@ free_shadow: · 163 unmodified lines
13151323 rinfo->ring_ref[i] = GRANT_INVALID_REF;
13161324 }
13171325 }
1318− free_pages((unsigned long)rinfo->ring.sring, get_order(info->nr_ring_pages * PAGE_SIZE));
1326+ free_pages((unsigned long)rinfo->ring.sring, get_order(info->nr_ring_pages * XEN_PAGE_SIZE));
13191327 rinfo->ring.sring = NULL;
13201328
13211329 if (rinfo->irq)
@@ -2007,8 +2015,10 @@ static int blkif_recover(struct blkfront_info *info) · 685 unmodified lines
20072015 struct split_bio *split_bio;
20082016
20092017 blkfront_gather_backend_features(info);
2018+ /* Reset limits changed by blk_mq_update_nr_hw_queues(). */
2019+ blkif_set_queue_limits(info);
20102020 segs = info->max_indirect_segments ? : BLKIF_MAX_SEGMENTS_PER_REQUEST;
2011− blk_queue_max_segments(info->rq, segs);
2021+ blk_queue_max_segments(info->rq, segs / GRANTS_PER_PSEG);
20122022
20132023 for (r_index = 0; r_index < info->nr_rings; r_index++) {
20142024 struct blkfront_ring_info *rinfo = &info->rinfo[r_index];
@@ -2432,7 +2442,7 @@ static void blkfront_connect(struct blkfront_info *info) · 417 unmodified lines
24322442 if (err) {
24332443 xenbus_dev_fatal(info->xbdev, err, "xlvbd_add at %s",
24342444 info->xbdev->otherend);
2435− return;
2445+ goto fail;
24362446 }
24372447
24382448 xenbus_switch_state(info->xbdev, XenbusStateConnected);
@@ -2445,6 +2455,11 @@ static void blkfront_connect(struct blkfront_info *info) · 6 unmodified lines
24452455 device_add_disk(&info->xbdev->dev, info->gd);
24462456
24472457 info->is_ready = 1;
2458+ return;
2459+
2460+fail:
2461+ blkif_free(info, 0);
2462+ return;
24482463 }
24492464
24502465 /**
drivers/bus/arm-cci.c+1−1
@@ -551,7 +551,7 @@ static struct attribute *cci5xx_pmu_event_attrs[] = { · 550 unmodified lines
551551 CCI5xx_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_wrq, 0xB),
552552 CCI5xx_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snoop_cd_hs, 0xC),
553553 CCI5xx_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_rq_stall_addr_hazard, 0xD),
554− CCI5xx_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snopp_rq_stall_tt_full, 0xE),
554+ CCI5xx_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snoop_rq_stall_tt_full, 0xE),
555555 CCI5xx_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snoop_rq_tzmp1_prot, 0xF),
556556 NULL
557557 };
drivers/bus/arm-ccn.c+79−33
@@ -187,6 +187,7 @@ struct arm_ccn { · 186 unmodified lines
187187 struct arm_ccn_component *xp;
188188
189189 struct arm_ccn_dt dt;
190+ int mn_id;
190191 };
191192
192193 static DEFINE_MUTEX(arm_ccn_mutex);
@@ -212,6 +213,7 @@ static int arm_ccn_node_to_xp_port(int node) · 19 unmodified lines
212213 #define CCN_CONFIG_TYPE(_config) (((_config) >> 8) & 0xff)
213214 #define CCN_CONFIG_EVENT(_config) (((_config) >> 16) & 0xff)
214215 #define CCN_CONFIG_PORT(_config) (((_config) >> 24) & 0x3)
216+#define CCN_CONFIG_BUS(_config) (((_config) >> 24) & 0x3)
215217 #define CCN_CONFIG_VC(_config) (((_config) >> 26) & 0x7)
216218 #define CCN_CONFIG_DIR(_config) (((_config) >> 29) & 0x1)
217219 #define CCN_CONFIG_MASK(_config) (((_config) >> 30) & 0xf)
@@ -241,6 +243,7 @@ static CCN_FORMAT_ATTR(xp, "config:0-7"); · 23 unmodified lines
241243 static CCN_FORMAT_ATTR(type, "config:8-15");
242244 static CCN_FORMAT_ATTR(event, "config:16-23");
243245 static CCN_FORMAT_ATTR(port, "config:24-25");
246+static CCN_FORMAT_ATTR(bus, "config:24-25");
244247 static CCN_FORMAT_ATTR(vc, "config:26-28");
245248 static CCN_FORMAT_ATTR(dir, "config:29-29");
246249 static CCN_FORMAT_ATTR(mask, "config:30-33");
@@ -253,6 +256,7 @@ static struct attribute *arm_ccn_pmu_format_attrs[] = { · 6 unmodified lines
253256 &arm_ccn_pmu_format_attr_type.attr.attr,
254257 &arm_ccn_pmu_format_attr_event.attr.attr,
255258 &arm_ccn_pmu_format_attr_port.attr.attr,
259+ &arm_ccn_pmu_format_attr_bus.attr.attr,
256260 &arm_ccn_pmu_format_attr_vc.attr.attr,
257261 &arm_ccn_pmu_format_attr_dir.attr.attr,
258262 &arm_ccn_pmu_format_attr_mask.attr.attr,
@@ -328,6 +332,7 @@ struct arm_ccn_pmu_event { · 69 unmodified lines
328332 static ssize_t arm_ccn_pmu_event_show(struct device *dev,
329333 struct device_attribute *attr, char *buf)
330334 {
335+ struct arm_ccn *ccn = pmu_to_arm_ccn(dev_get_drvdata(dev));
331336 struct arm_ccn_pmu_event *event = container_of(attr,
332337 struct arm_ccn_pmu_event, attr);
333338 ssize_t res;
@@ -349,10 +354,17 @@ static ssize_t arm_ccn_pmu_event_show(struct device *dev, · 15 unmodified lines
349354 break;
350355 case CCN_TYPE_XP:
351356 res += snprintf(buf + res, PAGE_SIZE - res,
352− ",xp=?,port=?,vc=?,dir=?");
357+ ",xp=?,vc=?");
353358 if (event->event == CCN_EVENT_WATCHPOINT)
354359 res += snprintf(buf + res, PAGE_SIZE - res,
355− ",cmp_l=?,cmp_h=?,mask=?");
360+ ",port=?,dir=?,cmp_l=?,cmp_h=?,mask=?");
361+ else
362+ res += snprintf(buf + res, PAGE_SIZE - res,
363+ ",bus=?");
364+
365+ break;
366+ case CCN_TYPE_MN:
367+ res += snprintf(buf + res, PAGE_SIZE - res, ",node=%d", ccn->mn_id);
356368 break;
357369 default:
358370 res += snprintf(buf + res, PAGE_SIZE - res, ",node=?");
@@ -383,9 +395,9 @@ static umode_t arm_ccn_pmu_events_is_visible(struct kobject *kobj, · 24 unmodified lines
383395 }
384396
385397 static struct arm_ccn_pmu_event arm_ccn_pmu_events[] = {
386− CCN_EVENT_MN(eobarrier, "dir=0,vc=0,cmp_h=0x1c00", CCN_IDX_MASK_OPCODE),
387− CCN_EVENT_MN(ecbarrier, "dir=0,vc=0,cmp_h=0x1e00", CCN_IDX_MASK_OPCODE),
388− CCN_EVENT_MN(dvmop, "dir=0,vc=0,cmp_h=0x2800", CCN_IDX_MASK_OPCODE),
398+ CCN_EVENT_MN(eobarrier, "dir=1,vc=0,cmp_h=0x1c00", CCN_IDX_MASK_OPCODE),
399+ CCN_EVENT_MN(ecbarrier, "dir=1,vc=0,cmp_h=0x1e00", CCN_IDX_MASK_OPCODE),
400+ CCN_EVENT_MN(dvmop, "dir=1,vc=0,cmp_h=0x2800", CCN_IDX_MASK_OPCODE),
389401 CCN_EVENT_HNI(txdatflits, "dir=1,vc=3", CCN_IDX_MASK_ANY),
390402 CCN_EVENT_HNI(rxdatflits, "dir=0,vc=3", CCN_IDX_MASK_ANY),
391403 CCN_EVENT_HNI(txreqflits, "dir=1,vc=0", CCN_IDX_MASK_ANY),
@@ -733,9 +745,10 @@ static int arm_ccn_pmu_event_init(struct perf_event *event) · 341 unmodified lines
733745
734746 if (has_branch_stack(event) || event->attr.exclude_user ||
735747 event->attr.exclude_kernel || event->attr.exclude_hv ||
736− event->attr.exclude_idle) {
748+ event->attr.exclude_idle || event->attr.exclude_host ||
749+ event->attr.exclude_guest) {
737750 dev_warn(ccn->dev, "Can't exclude execution levels!\n");
738− return -EOPNOTSUPP;
751+ return -EINVAL;
739752 }
740753
741754 if (event->cpu < 0) {
@@ -759,6 +772,12 @@ static int arm_ccn_pmu_event_init(struct perf_event *event) · 17 unmodified lines
759772
760773 /* Validate node/xp vs topology */
761774 switch (type) {
775+ case CCN_TYPE_MN:
776+ if (node_xp != ccn->mn_id) {
777+ dev_warn(ccn->dev, "Invalid MN ID %d!\n", node_xp);
778+ return -EINVAL;
779+ }
780+ break;
762781 case CCN_TYPE_XP:
763782 if (node_xp >= ccn->num_xps) {
764783 dev_warn(ccn->dev, "Invalid XP ID %d!\n", node_xp);
@@ -886,6 +905,10 @@ static void arm_ccn_pmu_xp_dt_config(struct perf_event *event, int enable) · 121 unmodified lines
886905 struct arm_ccn_component *xp;
887906 u32 val, dt_cfg;
888907
908+ /* Nothing to do for cycle counter */
909+ if (hw->idx == CCN_IDX_PMU_CYCLE_COUNTER)
910+ return;
911+
889912 if (CCN_CONFIG_TYPE(event->attr.config) == CCN_TYPE_XP)
890913 xp = &ccn->xp[CCN_CONFIG_XP(event->attr.config)];
891914 else
@@ -917,38 +940,17 @@ static void arm_ccn_pmu_event_start(struct perf_event *event, int flags) · 25 unmodified lines
917940 arm_ccn_pmu_read_counter(ccn, hw->idx));
918941 hw->state = 0;
919942
920− /*
921− * Pin the timer, so that the overflows are handled by the chosen
922− * event->cpu (this is the same one as presented in "cpumask"
923− * attribute).
924− */
925− if (!ccn->irq)
926− hrtimer_start(&ccn->dt.hrtimer, arm_ccn_pmu_timer_period(),
927− HRTIMER_MODE_REL_PINNED);
928−
929943 /* Set the DT bus input, engaging the counter */
930944 arm_ccn_pmu_xp_dt_config(event, 1);
931945 }
932946
933947 static void arm_ccn_pmu_event_stop(struct perf_event *event, int flags)
934948 {
935− struct arm_ccn *ccn = pmu_to_arm_ccn(event->pmu);
936949 struct hw_perf_event *hw = &event->hw;
937− u64 timeout;
938950
939951 /* Disable counting, setting the DT bus to pass-through mode */
940952 arm_ccn_pmu_xp_dt_config(event, 0);
941953
942− if (!ccn->irq)
943− hrtimer_cancel(&ccn->dt.hrtimer);
944−
945− /* Let the DT bus drain */
946− timeout = arm_ccn_pmu_read_counter(ccn, CCN_IDX_PMU_CYCLE_COUNTER) +
947− ccn->num_xps;
948− while (arm_ccn_pmu_read_counter(ccn, CCN_IDX_PMU_CYCLE_COUNTER) <
949− timeout)
950− cpu_relax();
951−
952954 if (flags & PERF_EF_UPDATE)
953955 arm_ccn_pmu_event_update(event);
954956
@@ -988,7 +990,7 @@ static void arm_ccn_pmu_xp_watchpoint_config(struct perf_event *event) · 33 unmodified lines
988990
989991 /* Comparison values */
990992 writel(cmp_l & 0xffffffff, source->base + CCN_XP_DT_CMP_VAL_L(wp));
991− writel((cmp_l >> 32) & 0xefffffff,
993+ writel((cmp_l >> 32) & 0x7fffffff,
992994 source->base + CCN_XP_DT_CMP_VAL_L(wp) + 4);
993995 writel(cmp_h & 0xffffffff, source->base + CCN_XP_DT_CMP_VAL_H(wp));
994996 writel((cmp_h >> 32) & 0x0fffffff,
@@ -996,7 +998,7 @@ static void arm_ccn_pmu_xp_watchpoint_config(struct perf_event *event) · 1 unmodified line
996998
997999 /* Mask */
9981000 writel(mask_l & 0xffffffff, source->base + CCN_XP_DT_CMP_MASK_L(wp));
999− writel((mask_l >> 32) & 0xefffffff,
1001+ writel((mask_l >> 32) & 0x7fffffff,
10001002 source->base + CCN_XP_DT_CMP_MASK_L(wp) + 4);
10011003 writel(mask_h & 0xffffffff, source->base + CCN_XP_DT_CMP_MASK_H(wp));
10021004 writel((mask_h >> 32) & 0x0fffffff,
@@ -1014,7 +1016,7 @@ static void arm_ccn_pmu_xp_event_config(struct perf_event *event) · 11 unmodified lines
10141016 hw->event_base = CCN_XP_DT_CONFIG__DT_CFG__XP_PMU_EVENT(hw->config_base);
10151017
10161018 id = (CCN_CONFIG_VC(event->attr.config) << 4) |
1017− (CCN_CONFIG_PORT(event->attr.config) << 3) |
1019+ (CCN_CONFIG_BUS(event->attr.config) << 3) |
10181020 (CCN_CONFIG_EVENT(event->attr.config) << 0);
10191021
10201022 val = readl(source->base + CCN_XP_PMU_EVENT_SEL);
@@ -1099,15 +1101,31 @@ static void arm_ccn_pmu_event_config(struct perf_event *event) · 78 unmodified lines
10991101 spin_unlock(&ccn->dt.config_lock);
11001102 }
11011103
1104+static int arm_ccn_pmu_active_counters(struct arm_ccn *ccn)
1105+{
1106+ return bitmap_weight(ccn->dt.pmu_counters_mask,
1107+ CCN_NUM_PMU_EVENT_COUNTERS + 1);
1108+}
1109+
11021110 static int arm_ccn_pmu_event_add(struct perf_event *event, int flags)
11031111 {
11041112 int err;
11051113 struct hw_perf_event *hw = &event->hw;
1114+ struct arm_ccn *ccn = pmu_to_arm_ccn(event->pmu);
11061115
11071116 err = arm_ccn_pmu_event_alloc(event);
11081117 if (err)
11091118 return err;
11101119
1120+ /*
1121+ * Pin the timer, so that the overflows are handled by the chosen
1122+ * event->cpu (this is the same one as presented in "cpumask"
1123+ * attribute).
1124+ */
1125+ if (!ccn->irq && arm_ccn_pmu_active_counters(ccn) == 1)
1126+ hrtimer_start(&ccn->dt.hrtimer, arm_ccn_pmu_timer_period(),
1127+ HRTIMER_MODE_REL_PINNED);
1128+
11111129 arm_ccn_pmu_event_config(event);
11121130
11131131 hw->state = PERF_HES_STOPPED;
@@ -1120,9 +1138,14 @@ static int arm_ccn_pmu_event_add(struct perf_event *event, int flags) · 6 unmodified lines
11201138
11211139 static void arm_ccn_pmu_event_del(struct perf_event *event, int flags)
11221140 {
1141+ struct arm_ccn *ccn = pmu_to_arm_ccn(event->pmu);
1142+
11231143 arm_ccn_pmu_event_stop(event, PERF_EF_UPDATE);
11241144
11251145 arm_ccn_pmu_event_release(event);
1146+
1147+ if (!ccn->irq && arm_ccn_pmu_active_counters(ccn) == 0)
1148+ hrtimer_cancel(&ccn->dt.hrtimer);
11261149 }
11271150
11281151 static void arm_ccn_pmu_event_read(struct perf_event *event)
@@ -1130,6 +1153,24 @@ static void arm_ccn_pmu_event_read(struct perf_event *event) · 1 unmodified line
11301153 arm_ccn_pmu_event_update(event);
11311154 }
11321155
1156+static void arm_ccn_pmu_enable(struct pmu *pmu)
1157+{
1158+ struct arm_ccn *ccn = pmu_to_arm_ccn(pmu);
1159+
1160+ u32 val = readl(ccn->dt.base + CCN_DT_PMCR);
1161+ val |= CCN_DT_PMCR__PMU_EN;
1162+ writel(val, ccn->dt.base + CCN_DT_PMCR);
1163+}
1164+
1165+static void arm_ccn_pmu_disable(struct pmu *pmu)
1166+{
1167+ struct arm_ccn *ccn = pmu_to_arm_ccn(pmu);
1168+
1169+ u32 val = readl(ccn->dt.base + CCN_DT_PMCR);
1170+ val &= ~CCN_DT_PMCR__PMU_EN;
1171+ writel(val, ccn->dt.base + CCN_DT_PMCR);
1172+}
1173+
11331174 static irqreturn_t arm_ccn_pmu_overflow_handler(struct arm_ccn_dt *dt)
11341175 {
11351176 u32 pmovsr = readl(dt->base + CCN_DT_PMOVSR);
@@ -1252,6 +1293,8 @@ static int arm_ccn_pmu_init(struct arm_ccn *ccn) · 116 unmodified lines
12521293 .start = arm_ccn_pmu_event_start,
12531294 .stop = arm_ccn_pmu_event_stop,
12541295 .read = arm_ccn_pmu_event_read,
1296+ .pmu_enable = arm_ccn_pmu_enable,
1297+ .pmu_disable = arm_ccn_pmu_disable,
12551298 };
12561299
12571300 /* No overflow interrupt? Have to use a timer instead. */
@@ -1361,6 +1404,8 @@ static int arm_ccn_init_nodes(struct arm_ccn *ccn, int region, · 103 unmodified lines
13611404
13621405 switch (type) {
13631406 case CCN_TYPE_MN:
1407+ ccn->mn_id = id;
1408+ return 0;
13641409 case CCN_TYPE_DT:
13651410 return 0;
13661411 case CCN_TYPE_XP:
@@ -1471,8 +1516,9 @@ static int arm_ccn_probe(struct platform_device *pdev) · 104 unmodified lines
14711516 /* Can set 'disable' bits, so can acknowledge interrupts */
14721517 writel(CCN_MN_ERRINT_STATUS__PMU_EVENTS__ENABLE,
14731518 ccn->base + CCN_MN_ERRINT_STATUS);
1474− err = devm_request_irq(ccn->dev, irq, arm_ccn_irq_handler, 0,
1475− dev_name(ccn->dev), ccn);
1519+ err = devm_request_irq(ccn->dev, irq, arm_ccn_irq_handler,
1520+ IRQF_NOBALANCING | IRQF_NO_THREAD,
1521+ dev_name(ccn->dev), ccn);
14761522 if (err)
14771523 return err;
14781524
drivers/bus/vexpress-config.c+1−0
@@ -178,6 +178,7 @@ static int vexpress_config_populate(struct device_node *node) · 177 unmodified lines
178178
179179 parent = class_find_device(vexpress_config_class, NULL, bridge,
180180 vexpress_config_node_match);
181+ of_node_put(bridge);
181182 if (WARN_ON(!parent))
182183 return -ENODEV;
183184
drivers/char/hw_random/Kconfig+1−1
@@ -244,7 +244,7 @@ config HW_RANDOM_TX4939 · 243 unmodified lines
244244
245245 config HW_RANDOM_MXC_RNGA
246246 tristate "Freescale i.MX RNGA Random Number Generator"
247− depends on ARCH_HAS_RNGA
247+ depends on SOC_IMX31
248248 default HW_RANDOM
249249 ---help---
250250 This driver provides kernel-side support for the Random Number
drivers/char/tpm/tpm2-cmd.c+1−2
@@ -957,7 +957,7 @@ int tpm2_auto_startup(struct tpm_chip *chip) · 956 unmodified lines
957957 goto out;
958958
959959 rc = tpm2_do_selftest(chip);
960− if (rc != TPM2_RC_INITIALIZE) {
960+ if (rc != 0 && rc != TPM2_RC_INITIALIZE) {
961961 dev_err(&chip->dev, "TPM self test failed\n");
962962 goto out;
963963 }
@@ -974,7 +974,6 @@ int tpm2_auto_startup(struct tpm_chip *chip) · 10 unmodified lines
974974 }
975975 }
976976
977− return rc;
978977 out:
979978 if (rc > 0)
980979 rc = -ENODEV;
drivers/char/virtio_console.c+15−8
@@ -165,6 +165,12 @@ struct ports_device { · 164 unmodified lines
165165 */
166166 struct virtqueue *c_ivq, *c_ovq;
167167
168+ /*
169+ * A control packet buffer for guest->host requests, protected
170+ * by c_ovq_lock.
171+ */
172+ struct virtio_console_control cpkt;
173+
168174 /* Array of per-port IO virtqueues */
169175 struct virtqueue **in_vqs, **out_vqs;
170176
@@ -560,28 +566,29 @@ static ssize_t __send_control_msg(struct ports_device *portdev, u32 port_id, · 389 unmodified lines
560566 unsigned int event, unsigned int value)
561567 {
562568 struct scatterlist sg[1];
563− struct virtio_console_control cpkt;
564569 struct virtqueue *vq;
565570 unsigned int len;
566571
567572 if (!use_multiport(portdev))
568573 return 0;
569574
570− cpkt.id = cpu_to_virtio32(portdev->vdev, port_id);
571− cpkt.event = cpu_to_virtio16(portdev->vdev, event);
572− cpkt.value = cpu_to_virtio16(portdev->vdev, value);
573−
574575 vq = portdev->c_ovq;
575576
576− sg_init_one(sg, &cpkt, sizeof(cpkt));
577−
578577 spin_lock(&portdev->c_ovq_lock);
579− if (virtqueue_add_outbuf(vq, sg, 1, &cpkt, GFP_ATOMIC) == 0) {
578+
579+ portdev->cpkt.id = cpu_to_virtio32(portdev->vdev, port_id);
580+ portdev->cpkt.event = cpu_to_virtio16(portdev->vdev, event);
581+ portdev->cpkt.value = cpu_to_virtio16(portdev->vdev, value);
582+
583+ sg_init_one(sg, &portdev->cpkt, sizeof(struct virtio_console_control));
584+
585+ if (virtqueue_add_outbuf(vq, sg, 1, &portdev->cpkt, GFP_ATOMIC) == 0) {
580586 virtqueue_kick(vq);
581587 while (!virtqueue_get_buf(vq, &len)
582588 && !virtqueue_is_broken(vq))
583589 cpu_relax();
584590 }
591+
585592 spin_unlock(&portdev->c_ovq_lock);
586593 return 0;
587594 }
drivers/clk/renesas/r8a7795-cpg-mssr.c+5−4
@@ -69,6 +69,7 @@ static const struct cpg_core_clk r8a7795_core_clks[] __initconst = { · 68 unmodified lines
6969 DEF_FIXED(".s1", CLK_S1, CLK_PLL1_DIV2, 3, 1),
7070 DEF_FIXED(".s2", CLK_S2, CLK_PLL1_DIV2, 4, 1),
7171 DEF_FIXED(".s3", CLK_S3, CLK_PLL1_DIV2, 6, 1),
72+ DEF_FIXED(".sdsrc", CLK_SDSRC, CLK_PLL1_DIV2, 2, 1),
7273
7374 /* Core Clock Outputs */
7475 DEF_FIXED("ztr", R8A7795_CLK_ZTR, CLK_PLL1_DIV2, 6, 1),
@@ -87,10 +88,10 @@ static const struct cpg_core_clk r8a7795_core_clks[] __initconst = { · 12 unmodified lines
8788 DEF_FIXED("s3d2", R8A7795_CLK_S3D2, CLK_S3, 2, 1),
8889 DEF_FIXED("s3d4", R8A7795_CLK_S3D4, CLK_S3, 4, 1),
8990
90− DEF_GEN3_SD("sd0", R8A7795_CLK_SD0, CLK_PLL1_DIV2, 0x0074),
91− DEF_GEN3_SD("sd1", R8A7795_CLK_SD1, CLK_PLL1_DIV2, 0x0078),
92− DEF_GEN3_SD("sd2", R8A7795_CLK_SD2, CLK_PLL1_DIV2, 0x0268),
93− DEF_GEN3_SD("sd3", R8A7795_CLK_SD3, CLK_PLL1_DIV2, 0x026c),
91+ DEF_GEN3_SD("sd0", R8A7795_CLK_SD0, CLK_SDSRC, 0x0074),
92+ DEF_GEN3_SD("sd1", R8A7795_CLK_SD1, CLK_SDSRC, 0x0078),
93+ DEF_GEN3_SD("sd2", R8A7795_CLK_SD2, CLK_SDSRC, 0x0268),
94+ DEF_GEN3_SD("sd3", R8A7795_CLK_SD3, CLK_SDSRC, 0x026c),
9495
9596 DEF_FIXED("cl", R8A7795_CLK_CL, CLK_PLL1_DIV2, 48, 1),
9697 DEF_FIXED("cp", R8A7795_CLK_CP, CLK_EXTAL, 2, 1),
drivers/clk/rockchip/clk-rk3399.c+6−5
@@ -833,9 +833,9 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = { · 832 unmodified lines
833833
834834 /* perihp */
835835 GATE(0, "cpll_aclk_perihp_src", "cpll", CLK_IGNORE_UNUSED,
836− RK3399_CLKGATE_CON(5), 0, GFLAGS),
837− GATE(0, "gpll_aclk_perihp_src", "gpll", CLK_IGNORE_UNUSED,
838836 RK3399_CLKGATE_CON(5), 1, GFLAGS),
837+ GATE(0, "gpll_aclk_perihp_src", "gpll", CLK_IGNORE_UNUSED,
838+ RK3399_CLKGATE_CON(5), 0, GFLAGS),
839839 COMPOSITE(ACLK_PERIHP, "aclk_perihp", mux_aclk_perihp_p, CLK_IGNORE_UNUSED,
840840 RK3399_CLKSEL_CON(14), 7, 1, MFLAGS, 0, 5, DFLAGS,
841841 RK3399_CLKGATE_CON(5), 2, GFLAGS),
@@ -923,9 +923,9 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = { · 81 unmodified lines
923923 RK3399_CLKGATE_CON(6), 14, GFLAGS),
924924
925925 GATE(0, "cpll_aclk_emmc_src", "cpll", CLK_IGNORE_UNUSED,
926− RK3399_CLKGATE_CON(6), 12, GFLAGS),
927− GATE(0, "gpll_aclk_emmc_src", "gpll", CLK_IGNORE_UNUSED,
928926 RK3399_CLKGATE_CON(6), 13, GFLAGS),
927+ GATE(0, "gpll_aclk_emmc_src", "gpll", CLK_IGNORE_UNUSED,
928+ RK3399_CLKGATE_CON(6), 12, GFLAGS),
929929 COMPOSITE_NOGATE(ACLK_EMMC, "aclk_emmc", mux_aclk_emmc_p, CLK_IGNORE_UNUSED,
930930 RK3399_CLKSEL_CON(21), 7, 1, MFLAGS, 0, 5, DFLAGS),
931931 GATE(ACLK_EMMC_CORE, "aclk_emmccore", "aclk_emmc", CLK_IGNORE_UNUSED,
@@ -1071,7 +1071,7 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = { · 139 unmodified lines
10711071 /* vio */
10721072 COMPOSITE(ACLK_VIO, "aclk_vio", mux_pll_src_cpll_gpll_ppll_p, CLK_IGNORE_UNUSED,
10731073 RK3399_CLKSEL_CON(42), 6, 2, MFLAGS, 0, 5, DFLAGS,
1074− RK3399_CLKGATE_CON(11), 10, GFLAGS),
1074+ RK3399_CLKGATE_CON(11), 0, GFLAGS),
10751075 COMPOSITE_NOMUX(PCLK_VIO, "pclk_vio", "aclk_vio", 0,
10761076 RK3399_CLKSEL_CON(43), 0, 5, DFLAGS,
10771077 RK3399_CLKGATE_CON(11), 1, GFLAGS),
@@ -1484,6 +1484,7 @@ static const char *const rk3399_cru_critical_clocks[] __initconst = { · 406 unmodified lines
14841484 "hclk_perilp1",
14851485 "hclk_perilp1_noc",
14861486 "aclk_dmac0_perilp",
1487+ "aclk_emmc_noc",
14871488 "gpll_hclk_perilp1_src",
14881489 "gpll_aclk_perilp0_src",
14891490 "gpll_aclk_perihp_src",
drivers/clk/sunxi-ng/ccu-sun8i-h3.c+8−8
@@ -783,14 +783,14 @@ static struct ccu_reset_map sun8i_h3_ccu_resets[] = { · 782 unmodified lines
783783 [RST_BUS_I2S1] = { 0x2d0, BIT(13) },
784784 [RST_BUS_I2S2] = { 0x2d0, BIT(14) },
785785
786− [RST_BUS_I2C0] = { 0x2d4, BIT(0) },
787− [RST_BUS_I2C1] = { 0x2d4, BIT(1) },
788− [RST_BUS_I2C2] = { 0x2d4, BIT(2) },
789− [RST_BUS_UART0] = { 0x2d4, BIT(16) },
790− [RST_BUS_UART1] = { 0x2d4, BIT(17) },
791− [RST_BUS_UART2] = { 0x2d4, BIT(18) },
792− [RST_BUS_UART3] = { 0x2d4, BIT(19) },
793− [RST_BUS_SCR] = { 0x2d4, BIT(20) },
786+ [RST_BUS_I2C0] = { 0x2d8, BIT(0) },
787+ [RST_BUS_I2C1] = { 0x2d8, BIT(1) },
788+ [RST_BUS_I2C2] = { 0x2d8, BIT(2) },
789+ [RST_BUS_UART0] = { 0x2d8, BIT(16) },
790+ [RST_BUS_UART1] = { 0x2d8, BIT(17) },
791+ [RST_BUS_UART2] = { 0x2d8, BIT(18) },
792+ [RST_BUS_UART3] = { 0x2d8, BIT(19) },
793+ [RST_BUS_SCR] = { 0x2d8, BIT(20) },
794794 };
795795
796796 static const struct sunxi_ccu_desc sun8i_h3_ccu_desc = {
drivers/clk/sunxi-ng/ccu_common.c+1−1
@@ -31,7 +31,7 @@ void ccu_helper_wait_for_lock(struct ccu_common *common, u32 lock) · 30 unmodified lines
3131 return;
3232
3333 WARN_ON(readl_relaxed_poll_timeout(common->base + common->reg, reg,
34− !(reg & lock), 100, 70000));
34+ reg & lock, 100, 70000));
3535 }
3636
3737 int sunxi_ccu_probe(struct device_node *node, void __iomem *reg,
drivers/clk/sunxi-ng/ccu_nk.c+3−3
@@ -14,9 +14,9 @@ · 13 unmodified lines
1414 #include "ccu_gate.h"
1515 #include "ccu_nk.h"
1616
17−void ccu_nk_find_best(unsigned long parent, unsigned long rate,
18− unsigned int max_n, unsigned int max_k,
19− unsigned int *n, unsigned int *k)
17+static void ccu_nk_find_best(unsigned long parent, unsigned long rate,
18+ unsigned int max_n, unsigned int max_k,
19+ unsigned int *n, unsigned int *k)
2020 {
2121 unsigned long best_rate = 0;
2222 unsigned int best_k = 0, best_n = 0;
drivers/clk/sunxi/clk-a10-pll2.c+2−2
@@ -73,7 +73,7 @@ static void __init sun4i_pll2_setup(struct device_node *node, · 72 unmodified lines
7373 SUN4I_PLL2_PRE_DIV_WIDTH,
7474 CLK_DIVIDER_ONE_BASED | CLK_DIVIDER_ALLOW_ZERO,
7575 &sun4i_a10_pll2_lock);
76− if (!prediv_clk) {
76+ if (IS_ERR(prediv_clk)) {
7777 pr_err("Couldn't register the prediv clock\n");
7878 goto err_free_array;
7979 }
@@ -106,7 +106,7 @@ static void __init sun4i_pll2_setup(struct device_node *node, · 26 unmodified lines
106106 &mult->hw, &clk_multiplier_ops,
107107 &gate->hw, &clk_gate_ops,
108108 CLK_SET_RATE_PARENT);
109− if (!base_clk) {
109+ if (IS_ERR(base_clk)) {
110110 pr_err("Couldn't register the base multiplier clock\n");
111111 goto err_free_multiplier;
112112 }
drivers/clk/sunxi/clk-sun8i-mbus.c+1−1
@@ -48,7 +48,7 @@ static void __init sun8i_a23_mbus_setup(struct device_node *node) · 47 unmodified lines
4848 return;
4949
5050 reg = of_io_request_and_map(node, 0, of_node_full_name(node));
51− if (!reg) {
51+ if (IS_ERR(reg)) {
5252 pr_err("Could not get registers for sun8i-mbus-clk\n");
5353 goto err_free_parents;
5454 }
drivers/clk/tegra/clk-tegra114.c+2−2
@@ -428,7 +428,7 @@ static struct tegra_clk_pll_params pll_d_params = { · 427 unmodified lines
428428 .div_nmp = &pllp_nmp,
429429 .freq_table = pll_d_freq_table,
430430 .flags = TEGRA_PLL_HAS_CPCON | TEGRA_PLL_SET_LFCON |
431− TEGRA_PLL_USE_LOCK | TEGRA_PLL_HAS_LOCK_ENABLE,
431+ TEGRA_PLL_HAS_LOCK_ENABLE,
432432 };
433433
434434 static struct tegra_clk_pll_params pll_d2_params = {
@@ -446,7 +446,7 @@ static struct tegra_clk_pll_params pll_d2_params = { · 11 unmodified lines
446446 .div_nmp = &pllp_nmp,
447447 .freq_table = pll_d_freq_table,
448448 .flags = TEGRA_PLL_HAS_CPCON | TEGRA_PLL_SET_LFCON |
449− TEGRA_PLL_USE_LOCK | TEGRA_PLL_HAS_LOCK_ENABLE,
449+ TEGRA_PLL_HAS_LOCK_ENABLE,
450450 };
451451
452452 static const struct pdiv_map pllu_p[] = {
drivers/clocksource/bcm_kona_timer.c+10−6
@@ -66,10 +66,10 @@ static void kona_timer_disable_and_clear(void __iomem *base) · 65 unmodified lines
6666
6767 }
6868
69−static void
69+static int
7070 kona_timer_get_counter(void __iomem *timer_base, uint32_t *msw, uint32_t *lsw)
7171 {
72− int loop_limit = 4;
72+ int loop_limit = 3;
7373
7474 /*
7575 * Read 64-bit free running counter
@@ -83,18 +83,19 @@ kona_timer_get_counter(void __iomem *timer_base, uint32_t *msw, uint32_t *lsw) · 7 unmodified lines
8383 * if new hi-word is equal to previously read hi-word then stop.
8484 */
8585
86− while (--loop_limit) {
86+ do {
8787 *msw = readl(timer_base + KONA_GPTIMER_STCHI_OFFSET);
8888 *lsw = readl(timer_base + KONA_GPTIMER_STCLO_OFFSET);
8989 if (*msw == readl(timer_base + KONA_GPTIMER_STCHI_OFFSET))
9090 break;
91− }
91+ } while (--loop_limit);
9292 if (!loop_limit) {
9393 pr_err("bcm_kona_timer: getting counter failed.\n");
9494 pr_err(" Timer will be impacted\n");
95+ return -ETIMEDOUT;
9596 }
9697
97− return;
98+ return 0;
9899 }
99100
100101 static int kona_timer_set_next_event(unsigned long clc,
@@ -112,8 +113,11 @@ static int kona_timer_set_next_event(unsigned long clc, · 11 unmodified lines
112113
113114 uint32_t lsw, msw;
114115 uint32_t reg;
116+ int ret;
115117
116− kona_timer_get_counter(timers.tmr_regs, &msw, &lsw);
118+ ret = kona_timer_get_counter(timers.tmr_regs, &msw, &lsw);
119+ if (ret)
120+ return ret;
117121
118122 /* Load the "next" event tick value */
119123 writel(lsw + clc, timers.tmr_regs + KONA_GPTIMER_STCM0_OFFSET);
drivers/clocksource/mips-gic-timer.c+1−1
@@ -164,7 +164,7 @@ void __init gic_clocksource_init(unsigned int frequency) · 163 unmodified lines
164164 gic_start_count();
165165 }
166166
167−static void __init gic_clocksource_of_init(struct device_node *node)
167+static int __init gic_clocksource_of_init(struct device_node *node)
168168 {
169169 struct clk *clk;
170170 int ret;
drivers/clocksource/pxa_timer.c+2−0
@@ -21,6 +21,8 @@ · 20 unmodified lines
2121 #include <linux/of_irq.h>
2222 #include <linux/sched_clock.h>
2323
24+#include <clocksource/pxa.h>
25+
2426 #include <asm/div64.h>
2527
2628 #define OSMR0 0x00 /* OS Timer 0 Match Register */
drivers/clocksource/sun4i_timer.c+8−1
@@ -123,12 +123,16 @@ static struct clock_event_device sun4i_clockevent = { · 122 unmodified lines
123123 .set_next_event = sun4i_clkevt_next_event,
124124 };
125125
126+static void sun4i_timer_clear_interrupt(void)
127+{
128+ writel(TIMER_IRQ_EN(0), timer_base + TIMER_IRQ_ST_REG);
129+}
126130
127131 static irqreturn_t sun4i_timer_interrupt(int irq, void *dev_id)
128132 {
129133 struct clock_event_device *evt = (struct clock_event_device *)dev_id;
130134
131− writel(0x1, timer_base + TIMER_IRQ_ST_REG);
135+ sun4i_timer_clear_interrupt();
132136 evt->event_handler(evt);
133137
134138 return IRQ_HANDLED;
@@ -208,6 +212,9 @@ static int __init sun4i_timer_init(struct device_node *node) · 73 unmodified lines
208212 /* Make sure timer is stopped before playing with interrupts */
209213 sun4i_clkevt_time_stop(0);
210214
215+ /* clear timer0 interrupt */
216+ sun4i_timer_clear_interrupt();
217+
211218 sun4i_clockevent.cpumask = cpu_possible_mask;
212219 sun4i_clockevent.irq = irq;
213220
drivers/clocksource/time-armada-370-xp.c+0−1
@@ -338,7 +338,6 @@ static int __init armada_xp_timer_init(struct device_node *np) · 337 unmodified lines
338338 struct clk *clk = of_clk_get_by_name(np, "fixed");
339339 int ret;
340340
341− clk = of_clk_get(np, 0);
342341 if (IS_ERR(clk)) {
343342 pr_err("Failed to get clock");
344343 return PTR_ERR(clk);
drivers/clocksource/time-pistachio.c+4−4
@@ -202,10 +202,10 @@ static int __init pistachio_clksrc_of_init(struct device_node *node) · 201 unmodified lines
202202 rate = clk_get_rate(fast_clk);
203203
204204 /* Disable irq's for clocksource usage */
205− gpt_writel(&pcs_gpt.base, 0, TIMER_IRQ_MASK, 0);
206− gpt_writel(&pcs_gpt.base, 0, TIMER_IRQ_MASK, 1);
207− gpt_writel(&pcs_gpt.base, 0, TIMER_IRQ_MASK, 2);
208− gpt_writel(&pcs_gpt.base, 0, TIMER_IRQ_MASK, 3);
205+ gpt_writel(pcs_gpt.base, 0, TIMER_IRQ_MASK, 0);
206+ gpt_writel(pcs_gpt.base, 0, TIMER_IRQ_MASK, 1);
207+ gpt_writel(pcs_gpt.base, 0, TIMER_IRQ_MASK, 2);
208+ gpt_writel(pcs_gpt.base, 0, TIMER_IRQ_MASK, 3);
209209
210210 /* Enable timer block */
211211 writel(TIMER_ME_GLOBAL, pcs_gpt.base);
drivers/clocksource/timer-atmel-pit.c+7−0
@@ -240,6 +240,7 @@ static int __init at91sam926x_pit_common_init(struct pit_data *data) · 239 unmodified lines
240240 static int __init at91sam926x_pit_dt_init(struct device_node *node)
241241 {
242242 struct pit_data *data;
243+ int ret;
243244
244245 data = kzalloc(sizeof(*data), GFP_KERNEL);
245246 if (!data)
@@ -261,6 +262,12 @@ static int __init at91sam926x_pit_dt_init(struct device_node *node) · 15 unmodified lines
261262 return PTR_ERR(data->mck);
262263 }
263264
265+ ret = clk_prepare_enable(data->mck);
266+ if (ret) {
267+ pr_err("Unable to enable mck\n");
268+ return ret;
269+ }
270+
264271 /* Get the interrupts property */
265272 data->irq = irq_of_parse_and_map(node, 0);
266273 if (!data->irq) {
drivers/cpufreq/cpufreq-dt-platdev.c+2−0
@@ -74,6 +74,8 @@ static const struct of_device_id machines[] __initconst = { · 73 unmodified lines
7474 { .compatible = "ti,omap5", },
7575
7676 { .compatible = "xlnx,zynq-7000", },
77+
78+ { }
7779 };
7880
7981 static int __init cpufreq_dt_platdev_init(void)
drivers/crypto/caam/caamalg.c+45−45
@@ -441,6 +441,9 @@ static int aead_set_sh_desc(struct crypto_aead *aead) · 440 unmodified lines
441441 OP_ALG_AAI_CTR_MOD128);
442442 const bool is_rfc3686 = alg->caam.rfc3686;
443443
444+ if (!ctx->authsize)
445+ return 0;
446+
444447 /* NULL encryption / decryption */
445448 if (!ctx->enckeylen)
446449 return aead_null_set_sh_desc(aead);
@@ -553,7 +556,10 @@ skip_enc: · 106 unmodified lines
553556
554557 /* Read and write assoclen bytes */
555558 append_math_add(desc, VARSEQINLEN, ZERO, REG3, CAAM_CMD_SZ);
556− append_math_add(desc, VARSEQOUTLEN, ZERO, REG3, CAAM_CMD_SZ);
559+ if (alg->caam.geniv)
560+ append_math_add_imm_u32(desc, VARSEQOUTLEN, REG3, IMM, ivsize);
561+ else
562+ append_math_add(desc, VARSEQOUTLEN, ZERO, REG3, CAAM_CMD_SZ);
557563
558564 /* Skip assoc data */
559565 append_seq_fifo_store(desc, 0, FIFOST_TYPE_SKIP | FIFOLDST_VLF);
@@ -562,6 +568,14 @@ skip_enc: · 2 unmodified lines
562568 append_seq_fifo_load(desc, 0, FIFOLD_CLASS_CLASS2 | FIFOLD_TYPE_MSG |
563569 KEY_VLF);
564570
571+ if (alg->caam.geniv) {
572+ append_seq_load(desc, ivsize, LDST_CLASS_1_CCB |
573+ LDST_SRCDST_BYTE_CONTEXT |
574+ (ctx1_iv_off << LDST_OFFSET_SHIFT));
575+ append_move(desc, MOVE_SRC_CLASS1CTX | MOVE_DEST_CLASS2INFIFO |
576+ (ctx1_iv_off << MOVE_OFFSET_SHIFT) | ivsize);
577+ }
578+
565579 /* Load Counter into CONTEXT1 reg */
566580 if (is_rfc3686)
567581 append_load_imm_u32(desc, be32_to_cpu(1), LDST_IMM |
@@ -614,7 +628,7 @@ skip_enc: · 46 unmodified lines
614628 keys_fit_inline = true;
615629
616630 /* aead_givencrypt shared descriptor */
617− desc = ctx->sh_desc_givenc;
631+ desc = ctx->sh_desc_enc;
618632
619633 /* Note: Context registers are saved. */
620634 init_sh_desc_key_aead(desc, ctx, keys_fit_inline, is_rfc3686);
@@ -645,13 +659,13 @@ copy_iv: · 24 unmodified lines
645659 append_operation(desc, ctx->class2_alg_type |
646660 OP_ALG_AS_INITFINAL | OP_ALG_ENCRYPT);
647661
648− /* ivsize + cryptlen = seqoutlen - authsize */
649− append_math_sub_imm_u32(desc, REG3, SEQOUTLEN, IMM, ctx->authsize);
650−
651662 /* Read and write assoclen bytes */
652663 append_math_add(desc, VARSEQINLEN, ZERO, REG3, CAAM_CMD_SZ);
653664 append_math_add(desc, VARSEQOUTLEN, ZERO, REG3, CAAM_CMD_SZ);
654665
666+ /* ivsize + cryptlen = seqoutlen - authsize */
667+ append_math_sub_imm_u32(desc, REG3, SEQOUTLEN, IMM, ctx->authsize);
668+
655669 /* Skip assoc data */
656670 append_seq_fifo_store(desc, 0, FIFOST_TYPE_SKIP | FIFOLDST_VLF);
657671
@@ -697,7 +711,7 @@ copy_iv: · 39 unmodified lines
697711 ctx->sh_desc_enc_dma = dma_map_single(jrdev, desc,
698712 desc_bytes(desc),
699713 DMA_TO_DEVICE);
700− if (dma_mapping_error(jrdev, ctx->sh_desc_givenc_dma)) {
714+ if (dma_mapping_error(jrdev, ctx->sh_desc_enc_dma)) {
701715 dev_err(jrdev, "unable to map shared descriptor\n");
702716 return -ENOMEM;
703717 }
@@ -2147,7 +2161,7 @@ static void init_authenc_job(struct aead_request *req, · 1443 unmodified lines
21472161
21482162 init_aead_job(req, edesc, all_contig, encrypt);
21492163
2150− if (ivsize && (is_rfc3686 || !(alg->caam.geniv && encrypt)))
2164+ if (ivsize && ((is_rfc3686 && encrypt) || !alg->caam.geniv))
21512165 append_load_as_imm(desc, req->iv, ivsize,
21522166 LDST_CLASS_1_CCB |
21532167 LDST_SRCDST_BYTE_CONTEXT |
@@ -2534,20 +2548,6 @@ static int aead_decrypt(struct aead_request *req) · 380 unmodified lines
25342548 return ret;
25352549 }
25362550
2537−static int aead_givdecrypt(struct aead_request *req)
2538−{
2539− struct crypto_aead *aead = crypto_aead_reqtfm(req);
2540− unsigned int ivsize = crypto_aead_ivsize(aead);
2541−
2542− if (req->cryptlen < ivsize)
2543− return -EINVAL;
2544−
2545− req->cryptlen -= ivsize;
2546− req->assoclen += ivsize;
2547−
2548− return aead_decrypt(req);
2549−}
2550−
25512551 /*
25522552 * allocate and map the ablkcipher extended descriptor for ablkcipher
25532553 */
@@ -3207,7 +3207,7 @@ static struct caam_aead_alg driver_aeads[] = { · 653 unmodified lines
32073207 .setkey = aead_setkey,
32083208 .setauthsize = aead_setauthsize,
32093209 .encrypt = aead_encrypt,
3210− .decrypt = aead_givdecrypt,
3210+ .decrypt = aead_decrypt,
32113211 .ivsize = AES_BLOCK_SIZE,
32123212 .maxauthsize = MD5_DIGEST_SIZE,
32133213 },
@@ -3253,7 +3253,7 @@ static struct caam_aead_alg driver_aeads[] = { · 39 unmodified lines
32533253 .setkey = aead_setkey,
32543254 .setauthsize = aead_setauthsize,
32553255 .encrypt = aead_encrypt,
3256− .decrypt = aead_givdecrypt,
3256+ .decrypt = aead_decrypt,
32573257 .ivsize = AES_BLOCK_SIZE,
32583258 .maxauthsize = SHA1_DIGEST_SIZE,
32593259 },
@@ -3299,7 +3299,7 @@ static struct caam_aead_alg driver_aeads[] = { · 39 unmodified lines
32993299 .setkey = aead_setkey,
33003300 .setauthsize = aead_setauthsize,
33013301 .encrypt = aead_encrypt,
3302− .decrypt = aead_givdecrypt,
3302+ .decrypt = aead_decrypt,
33033303 .ivsize = AES_BLOCK_SIZE,
33043304 .maxauthsize = SHA224_DIGEST_SIZE,
33053305 },
@@ -3345,7 +3345,7 @@ static struct caam_aead_alg driver_aeads[] = { · 39 unmodified lines
33453345 .setkey = aead_setkey,
33463346 .setauthsize = aead_setauthsize,
33473347 .encrypt = aead_encrypt,
3348− .decrypt = aead_givdecrypt,
3348+ .decrypt = aead_decrypt,
33493349 .ivsize = AES_BLOCK_SIZE,
33503350 .maxauthsize = SHA256_DIGEST_SIZE,
33513351 },
@@ -3391,7 +3391,7 @@ static struct caam_aead_alg driver_aeads[] = { · 39 unmodified lines
33913391 .setkey = aead_setkey,
33923392 .setauthsize = aead_setauthsize,
33933393 .encrypt = aead_encrypt,
3394− .decrypt = aead_givdecrypt,
3394+ .decrypt = aead_decrypt,
33953395 .ivsize = AES_BLOCK_SIZE,
33963396 .maxauthsize = SHA384_DIGEST_SIZE,
33973397 },
@@ -3437,7 +3437,7 @@ static struct caam_aead_alg driver_aeads[] = { · 39 unmodified lines
34373437 .setkey = aead_setkey,
34383438 .setauthsize = aead_setauthsize,
34393439 .encrypt = aead_encrypt,
3440− .decrypt = aead_givdecrypt,
3440+ .decrypt = aead_decrypt,
34413441 .ivsize = AES_BLOCK_SIZE,
34423442 .maxauthsize = SHA512_DIGEST_SIZE,
34433443 },
@@ -3483,7 +3483,7 @@ static struct caam_aead_alg driver_aeads[] = { · 39 unmodified lines
34833483 .setkey = aead_setkey,
34843484 .setauthsize = aead_setauthsize,
34853485 .encrypt = aead_encrypt,
3486− .decrypt = aead_givdecrypt,
3486+ .decrypt = aead_decrypt,
34873487 .ivsize = DES3_EDE_BLOCK_SIZE,
34883488 .maxauthsize = MD5_DIGEST_SIZE,
34893489 },
@@ -3531,7 +3531,7 @@ static struct caam_aead_alg driver_aeads[] = { · 41 unmodified lines
35313531 .setkey = aead_setkey,
35323532 .setauthsize = aead_setauthsize,
35333533 .encrypt = aead_encrypt,
3534− .decrypt = aead_givdecrypt,
3534+ .decrypt = aead_decrypt,
35353535 .ivsize = DES3_EDE_BLOCK_SIZE,
35363536 .maxauthsize = SHA1_DIGEST_SIZE,
35373537 },
@@ -3579,7 +3579,7 @@ static struct caam_aead_alg driver_aeads[] = { · 41 unmodified lines
35793579 .setkey = aead_setkey,
35803580 .setauthsize = aead_setauthsize,
35813581 .encrypt = aead_encrypt,
3582− .decrypt = aead_givdecrypt,
3582+ .decrypt = aead_decrypt,
35833583 .ivsize = DES3_EDE_BLOCK_SIZE,
35843584 .maxauthsize = SHA224_DIGEST_SIZE,
35853585 },
@@ -3627,7 +3627,7 @@ static struct caam_aead_alg driver_aeads[] = { · 41 unmodified lines
36273627 .setkey = aead_setkey,
36283628 .setauthsize = aead_setauthsize,
36293629 .encrypt = aead_encrypt,
3630− .decrypt = aead_givdecrypt,
3630+ .decrypt = aead_decrypt,
36313631 .ivsize = DES3_EDE_BLOCK_SIZE,
36323632 .maxauthsize = SHA256_DIGEST_SIZE,
36333633 },
@@ -3675,7 +3675,7 @@ static struct caam_aead_alg driver_aeads[] = { · 41 unmodified lines
36753675 .setkey = aead_setkey,
36763676 .setauthsize = aead_setauthsize,
36773677 .encrypt = aead_encrypt,
3678− .decrypt = aead_givdecrypt,
3678+ .decrypt = aead_decrypt,
36793679 .ivsize = DES3_EDE_BLOCK_SIZE,
36803680 .maxauthsize = SHA384_DIGEST_SIZE,
36813681 },
@@ -3723,7 +3723,7 @@ static struct caam_aead_alg driver_aeads[] = { · 41 unmodified lines
37233723 .setkey = aead_setkey,
37243724 .setauthsize = aead_setauthsize,
37253725 .encrypt = aead_encrypt,
3726− .decrypt = aead_givdecrypt,
3726+ .decrypt = aead_decrypt,
37273727 .ivsize = DES3_EDE_BLOCK_SIZE,
37283728 .maxauthsize = SHA512_DIGEST_SIZE,
37293729 },
@@ -3769,7 +3769,7 @@ static struct caam_aead_alg driver_aeads[] = { · 39 unmodified lines
37693769 .setkey = aead_setkey,
37703770 .setauthsize = aead_setauthsize,
37713771 .encrypt = aead_encrypt,
3772− .decrypt = aead_givdecrypt,
3772+ .decrypt = aead_decrypt,
37733773 .ivsize = DES_BLOCK_SIZE,
37743774 .maxauthsize = MD5_DIGEST_SIZE,
37753775 },
@@ -3815,7 +3815,7 @@ static struct caam_aead_alg driver_aeads[] = { · 39 unmodified lines
38153815 .setkey = aead_setkey,
38163816 .setauthsize = aead_setauthsize,
38173817 .encrypt = aead_encrypt,
3818− .decrypt = aead_givdecrypt,
3818+ .decrypt = aead_decrypt,
38193819 .ivsize = DES_BLOCK_SIZE,
38203820 .maxauthsize = SHA1_DIGEST_SIZE,
38213821 },
@@ -3861,7 +3861,7 @@ static struct caam_aead_alg driver_aeads[] = { · 39 unmodified lines
38613861 .setkey = aead_setkey,
38623862 .setauthsize = aead_setauthsize,
38633863 .encrypt = aead_encrypt,
3864− .decrypt = aead_givdecrypt,
3864+ .decrypt = aead_decrypt,
38653865 .ivsize = DES_BLOCK_SIZE,
38663866 .maxauthsize = SHA224_DIGEST_SIZE,
38673867 },
@@ -3907,7 +3907,7 @@ static struct caam_aead_alg driver_aeads[] = { · 39 unmodified lines
39073907 .setkey = aead_setkey,
39083908 .setauthsize = aead_setauthsize,
39093909 .encrypt = aead_encrypt,
3910− .decrypt = aead_givdecrypt,
3910+ .decrypt = aead_decrypt,
39113911 .ivsize = DES_BLOCK_SIZE,
39123912 .maxauthsize = SHA256_DIGEST_SIZE,
39133913 },
@@ -3953,7 +3953,7 @@ static struct caam_aead_alg driver_aeads[] = { · 39 unmodified lines
39533953 .setkey = aead_setkey,
39543954 .setauthsize = aead_setauthsize,
39553955 .encrypt = aead_encrypt,
3956− .decrypt = aead_givdecrypt,
3956+ .decrypt = aead_decrypt,
39573957 .ivsize = DES_BLOCK_SIZE,
39583958 .maxauthsize = SHA384_DIGEST_SIZE,
39593959 },
@@ -3999,7 +3999,7 @@ static struct caam_aead_alg driver_aeads[] = { · 39 unmodified lines
39993999 .setkey = aead_setkey,
40004000 .setauthsize = aead_setauthsize,
40014001 .encrypt = aead_encrypt,
4002− .decrypt = aead_givdecrypt,
4002+ .decrypt = aead_decrypt,
40034003 .ivsize = DES_BLOCK_SIZE,
40044004 .maxauthsize = SHA512_DIGEST_SIZE,
40054005 },
@@ -4048,7 +4048,7 @@ static struct caam_aead_alg driver_aeads[] = { · 42 unmodified lines
40484048 .setkey = aead_setkey,
40494049 .setauthsize = aead_setauthsize,
40504050 .encrypt = aead_encrypt,
4051− .decrypt = aead_givdecrypt,
4051+ .decrypt = aead_decrypt,
40524052 .ivsize = CTR_RFC3686_IV_SIZE,
40534053 .maxauthsize = MD5_DIGEST_SIZE,
40544054 },
@@ -4099,7 +4099,7 @@ static struct caam_aead_alg driver_aeads[] = { · 44 unmodified lines
40994099 .setkey = aead_setkey,
41004100 .setauthsize = aead_setauthsize,
41014101 .encrypt = aead_encrypt,
4102− .decrypt = aead_givdecrypt,
4102+ .decrypt = aead_decrypt,
41034103 .ivsize = CTR_RFC3686_IV_SIZE,
41044104 .maxauthsize = SHA1_DIGEST_SIZE,
41054105 },
@@ -4150,7 +4150,7 @@ static struct caam_aead_alg driver_aeads[] = { · 44 unmodified lines
41504150 .setkey = aead_setkey,
41514151 .setauthsize = aead_setauthsize,
41524152 .encrypt = aead_encrypt,
4153− .decrypt = aead_givdecrypt,
4153+ .decrypt = aead_decrypt,
41544154 .ivsize = CTR_RFC3686_IV_SIZE,
41554155 .maxauthsize = SHA224_DIGEST_SIZE,
41564156 },
@@ -4201,7 +4201,7 @@ static struct caam_aead_alg driver_aeads[] = { · 44 unmodified lines
42014201 .setkey = aead_setkey,
42024202 .setauthsize = aead_setauthsize,
42034203 .encrypt = aead_encrypt,
4204− .decrypt = aead_givdecrypt,
4204+ .decrypt = aead_decrypt,
42054205 .ivsize = CTR_RFC3686_IV_SIZE,
42064206 .maxauthsize = SHA256_DIGEST_SIZE,
42074207 },
@@ -4252,7 +4252,7 @@ static struct caam_aead_alg driver_aeads[] = { · 44 unmodified lines
42524252 .setkey = aead_setkey,
42534253 .setauthsize = aead_setauthsize,
42544254 .encrypt = aead_encrypt,
4255− .decrypt = aead_givdecrypt,
4255+ .decrypt = aead_decrypt,
42564256 .ivsize = CTR_RFC3686_IV_SIZE,
42574257 .maxauthsize = SHA384_DIGEST_SIZE,
42584258 },
@@ -4303,7 +4303,7 @@ static struct caam_aead_alg driver_aeads[] = { · 44 unmodified lines
43034303 .setkey = aead_setkey,
43044304 .setauthsize = aead_setauthsize,
43054305 .encrypt = aead_encrypt,
4306− .decrypt = aead_givdecrypt,
4306+ .decrypt = aead_decrypt,
43074307 .ivsize = CTR_RFC3686_IV_SIZE,
43084308 .maxauthsize = SHA512_DIGEST_SIZE,
43094309 },
drivers/crypto/caam/caamhash.c+1−0
@@ -1898,6 +1898,7 @@ caam_hash_alloc(struct caam_hash_template *template, · 1897 unmodified lines
18981898 template->name);
18991899 snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s",
19001900 template->driver_name);
1901+ t_alg->ahash_alg.setkey = NULL;
19011902 }
19021903 alg->cra_module = THIS_MODULE;
19031904 alg->cra_init = caam_hash_cra_init;
drivers/crypto/qat/qat_common/qat_algs.c+2−2
@@ -1260,8 +1260,8 @@ static struct crypto_alg qat_algs[] = { { · 1259 unmodified lines
12601260 .setkey = qat_alg_ablkcipher_xts_setkey,
12611261 .decrypt = qat_alg_ablkcipher_decrypt,
12621262 .encrypt = qat_alg_ablkcipher_encrypt,
1263− .min_keysize = AES_MIN_KEY_SIZE,
1264− .max_keysize = AES_MAX_KEY_SIZE,
1263+ .min_keysize = 2 * AES_MIN_KEY_SIZE,
1264+ .max_keysize = 2 * AES_MAX_KEY_SIZE,
12651265 .ivsize = AES_BLOCK_SIZE,
12661266 },
12671267 },
drivers/crypto/vmx/aes_xts.c+1−1
@@ -129,8 +129,8 @@ static int p8_aes_xts_crypt(struct blkcipher_desc *desc, · 128 unmodified lines
129129
130130 blkcipher_walk_init(&walk, dst, src, nbytes);
131131
132− iv = (u8 *)walk.iv;
133132 ret = blkcipher_walk_virt(desc, &walk);
133+ iv = walk.iv;
134134 memset(tweak, 0, AES_BLOCK_SIZE);
135135 aes_p8_encrypt(iv, tweak, &ctx->tweak_key);
136136
drivers/dax/dax.c+1−1
@@ -459,7 +459,7 @@ static int __dax_dev_pmd_fault(struct dax_dev *dax_dev, · 458 unmodified lines
459459 }
460460
461461 pgoff = linear_page_index(vma, pmd_addr);
462− phys = pgoff_to_phys(dax_dev, pgoff, PAGE_SIZE);
462+ phys = pgoff_to_phys(dax_dev, pgoff, PMD_SIZE);
463463 if (phys == -1) {
464464 dev_dbg(dev, "%s: phys_to_pgoff(%#lx) failed\n", __func__,
465465 pgoff);
drivers/dax/pmem.c+3−0
@@ -116,6 +116,9 @@ static int dax_pmem_probe(struct device *dev) · 115 unmodified lines
116116 if (rc)
117117 return rc;
118118
119+ /* adjust the dax_region resource to the start of data */
120+ res.start += le64_to_cpu(pfn_sb->dataoff);
121+
119122 nd_region = to_nd_region(dev->parent);
120123 dax_region = alloc_dax_region(dev, nd_region->id, &res,
121124 le32_to_cpu(pfn_sb->align), addr, PFN_DEV|PFN_MAP);
drivers/dma/at_xdmac.c+2−2
@@ -2067,7 +2067,7 @@ err_dma_unregister: · 2066 unmodified lines
20672067 err_clk_disable:
20682068 clk_disable_unprepare(atxdmac->clk);
20692069 err_free_irq:
2070− free_irq(atxdmac->irq, atxdmac->dma.dev);
2070+ free_irq(atxdmac->irq, atxdmac);
20712071 return ret;
20722072 }
20732073
@@ -2081,7 +2081,7 @@ static int at_xdmac_remove(struct platform_device *pdev) · 7 unmodified lines
20812081 dma_async_device_unregister(&atxdmac->dma);
20822082 clk_disable_unprepare(atxdmac->clk);
20832083
2084− free_irq(atxdmac->irq, atxdmac->dma.dev);
2084+ free_irq(atxdmac->irq, atxdmac);
20852085
20862086 for (i = 0; i < atxdmac->dma.chancnt; i++) {
20872087 struct at_xdmac_chan *atchan = &atxdmac->chan[i];
drivers/dma/fsl_raid.c+1−0
@@ -836,6 +836,7 @@ static int fsl_re_probe(struct platform_device *ofdev) · 835 unmodified lines
836836 rc = of_property_read_u32(np, "reg", &off);
837837 if (rc) {
838838 dev_err(dev, "Reg property not found in JQ node\n");
839+ of_node_put(np);
839840 return -ENODEV;
840841 }
841842 /* Find out the Job Rings present under each JQ */
drivers/dma/img-mdc-dma.c+1−3
@@ -861,7 +861,6 @@ static int mdc_dma_probe(struct platform_device *pdev) · 860 unmodified lines
861861 {
862862 struct mdc_dma *mdma;
863863 struct resource *res;
864− const struct of_device_id *match;
865864 unsigned int i;
866865 u32 val;
867866 int ret;
@@ -871,8 +870,7 @@ static int mdc_dma_probe(struct platform_device *pdev) · 3 unmodified lines
871870 return -ENOMEM;
872871 platform_set_drvdata(pdev, mdma);
873872
874− match = of_match_device(mdc_dma_of_match, &pdev->dev);
875− mdma->soc = match->data;
873+ mdma->soc = of_device_get_match_data(&pdev->dev);
876874
877875 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
878876 mdma->regs = devm_ioremap_resource(&pdev->dev, res);
drivers/dma/pxa_dma.c+7−4
@@ -638,7 +638,7 @@ static bool pxad_try_hotchain(struct virt_dma_chan *vc, · 637 unmodified lines
638638 vd_last_issued = list_entry(vc->desc_issued.prev,
639639 struct virt_dma_desc, node);
640640 pxad_desc_chain(vd_last_issued, vd);
641− if (is_chan_running(chan) || is_desc_completed(vd_last_issued))
641+ if (is_chan_running(chan) || is_desc_completed(vd))
642642 return true;
643643 }
644644
@@ -671,6 +671,7 @@ static irqreturn_t pxad_chan_handler(int irq, void *dev_id) · 26 unmodified lines
671671 struct virt_dma_desc *vd, *tmp;
672672 unsigned int dcsr;
673673 unsigned long flags;
674+ bool vd_completed;
674675 dma_cookie_t last_started = 0;
675676
676677 BUG_ON(!chan);
@@ -681,15 +682,17 @@ static irqreturn_t pxad_chan_handler(int irq, void *dev_id) · 4 unmodified lines
681682
682683 spin_lock_irqsave(&chan->vc.lock, flags);
683684 list_for_each_entry_safe(vd, tmp, &chan->vc.desc_issued, node) {
685+ vd_completed = is_desc_completed(vd);
684686 dev_dbg(&chan->vc.chan.dev->device,
685− "%s(): checking txd %p[%x]: completed=%d\n",
686− __func__, vd, vd->tx.cookie, is_desc_completed(vd));
687+ "%s(): checking txd %p[%x]: completed=%d dcsr=0x%x\n",
688+ __func__, vd, vd->tx.cookie, vd_completed,
689+ dcsr);
687690 last_started = vd->tx.cookie;
688691 if (to_pxad_sw_desc(vd)->cyclic) {
689692 vchan_cyclic_callback(vd);
690693 break;
691694 }
692− if (is_desc_completed(vd)) {
695+ if (vd_completed) {
693696 list_del(&vd->node);
694697 vchan_cookie_complete(vd);
695698 } else {
drivers/dma/sh/usb-dmac.c+11−8
@@ -600,27 +600,30 @@ static irqreturn_t usb_dmac_isr_channel(int irq, void *dev) · 599 unmodified lines
600600 {
601601 struct usb_dmac_chan *chan = dev;
602602 irqreturn_t ret = IRQ_NONE;
603− u32 mask = USB_DMACHCR_TE;
604− u32 check_bits = USB_DMACHCR_TE | USB_DMACHCR_SP;
603+ u32 mask = 0;
605604 u32 chcr;
605+ bool xfer_end = false;
606606
607607 spin_lock(&chan->vc.lock);
608608
609609 chcr = usb_dmac_chan_read(chan, USB_DMACHCR);
610− if (chcr & check_bits)
611− mask |= USB_DMACHCR_DE | check_bits;
610+ if (chcr & (USB_DMACHCR_TE | USB_DMACHCR_SP)) {
611+ mask |= USB_DMACHCR_DE | USB_DMACHCR_TE | USB_DMACHCR_SP;
612+ if (chcr & USB_DMACHCR_DE)
613+ xfer_end = true;
614+ ret |= IRQ_HANDLED;
615+ }
612616 if (chcr & USB_DMACHCR_NULL) {
613617 /* An interruption of TE will happen after we set FTE */
614618 mask |= USB_DMACHCR_NULL;
615619 chcr |= USB_DMACHCR_FTE;
616620 ret |= IRQ_HANDLED;
617621 }
618− usb_dmac_chan_write(chan, USB_DMACHCR, chcr & ~mask);
622+ if (mask)
623+ usb_dmac_chan_write(chan, USB_DMACHCR, chcr & ~mask);
619624
620− if (chcr & check_bits) {
625+ if (xfer_end)
621626 usb_dmac_isr_transfer_end(chan);
622− ret |= IRQ_HANDLED;
623− }
624627
625628 spin_unlock(&chan->vc.lock);
626629
drivers/edac/Kconfig+8−0
@@ -251,6 +251,14 @@ config EDAC_SBRIDGE · 250 unmodified lines
251251 Support for error detection and correction the Intel
252252 Sandy Bridge, Ivy Bridge and Haswell Integrated Memory Controllers.
253253
254+config EDAC_SKX
255+ tristate "Intel Skylake server Integrated MC"
256+ depends on EDAC_MM_EDAC && PCI && X86_64 && X86_MCE_INTEL
257+ depends on PCI_MMCONFIG
258+ help
259+ Support for error detection and correction the Intel
260+ Skylake server Integrated Memory Controllers.
261+
254262 config EDAC_MPC85XX
255263 tristate "Freescale MPC83xx / MPC85xx"
256264 depends on EDAC_MM_EDAC && FSL_SOC
drivers/edac/Makefile+1−0
@@ -31,6 +31,7 @@ obj-$(CONFIG_EDAC_I5400) += i5400_edac.o · 30 unmodified lines
3131 obj-$(CONFIG_EDAC_I7300) += i7300_edac.o
3232 obj-$(CONFIG_EDAC_I7CORE) += i7core_edac.o
3333 obj-$(CONFIG_EDAC_SBRIDGE) += sb_edac.o
34+obj-$(CONFIG_EDAC_SKX) += skx_edac.o
3435 obj-$(CONFIG_EDAC_E7XXX) += e7xxx_edac.o
3536 obj-$(CONFIG_EDAC_E752X) += e752x_edac.o
3637 obj-$(CONFIG_EDAC_I82443BXGX) += i82443bxgx_edac.o
drivers/edac/sb_edac.c+11−4
@@ -552,9 +552,9 @@ static const struct pci_id_table pci_dev_descr_haswell_table[] = { · 551 unmodified lines
552552 /* Knight's Landing Support */
553553 /*
554554 * KNL's memory channels are swizzled between memory controllers.
555− * MC0 is mapped to CH3,5,6 and MC1 is mapped to CH0,1,2
555+ * MC0 is mapped to CH3,4,5 and MC1 is mapped to CH0,1,2
556556 */
557−#define knl_channel_remap(channel) ((channel + 3) % 6)
557+#define knl_channel_remap(mc, chan) ((mc) ? (chan) : (chan) + 3)
558558
559559 /* Memory controller, TAD tables, error injection - 2-8-0, 2-9-0 (2 of these) */
560560 #define PCI_DEVICE_ID_INTEL_KNL_IMC_MC 0x7840
@@ -1286,7 +1286,7 @@ static u32 knl_get_mc_route(int entry, u32 reg) · 725 unmodified lines
12861286 mc = GET_BITFIELD(reg, entry*3, (entry*3)+2);
12871287 chan = GET_BITFIELD(reg, (entry*2) + 18, (entry*2) + 18 + 1);
12881288
1289− return knl_channel_remap(mc*3 + chan);
1289+ return knl_channel_remap(mc, chan);
12901290 }
12911291
12921292 /*
@@ -2997,8 +2997,15 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci, · 1704 unmodified lines
29972997 } else {
29982998 char A = *("A");
29992999
3000− channel = knl_channel_remap(channel);
3000+ /*
3001+ * Reported channel is in range 0-2, so we can't map it
3002+ * back to mc. To figure out mc we check machine check
3003+ * bank register that reported this error.
3004+ * bank15 means mc0 and bank16 means mc1.
3005+ */
3006+ channel = knl_channel_remap(m->bank == 16, channel);
30013007 channel_mask = 1 << channel;
3008+
30023009 snprintf(msg, sizeof(msg),
30033010 "%s%s err_code:%04x:%04x channel:%d (DIMM_%c)",
30043011 overflow ? " OVERFLOW" : "",
drivers/edac/skx_edac.c+1121−0
@@ -0,0 +1,1121 @@
1+/*
2+ * EDAC driver for Intel(R) Xeon(R) Skylake processors
3+ * Copyright (c) 2016, Intel Corporation.
4+ *
5+ * This program is free software; you can redistribute it and/or modify it
6+ * under the terms and conditions of the GNU General Public License,
7+ * version 2, as published by the Free Software Foundation.
8+ *
9+ * This program is distributed in the hope it will be useful, but WITHOUT
10+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12+ * more details.
13+ */
14+
15+#include <linux/module.h>
16+#include <linux/init.h>
17+#include <linux/pci.h>
18+#include <linux/pci_ids.h>
19+#include <linux/slab.h>
20+#include <linux/delay.h>
21+#include <linux/edac.h>
22+#include <linux/mmzone.h>
23+#include <linux/smp.h>
24+#include <linux/bitmap.h>
25+#include <linux/math64.h>
26+#include <linux/mod_devicetable.h>
27+#include <asm/cpu_device_id.h>
28+#include <asm/processor.h>
29+#include <asm/mce.h>
30+
31+#include "edac_core.h"
32+
33+#define SKX_REVISION " Ver: 1.0 "
34+
35+/*
36+ * Debug macros
37+ */
38+#define skx_printk(level, fmt, arg...) \
39+ edac_printk(level, "skx", fmt, ##arg)
40+
41+#define skx_mc_printk(mci, level, fmt, arg...) \
42+ edac_mc_chipset_printk(mci, level, "skx", fmt, ##arg)
43+
44+/*
45+ * Get a bit field at register value <v>, from bit <lo> to bit <hi>
46+ */
47+#define GET_BITFIELD(v, lo, hi) \
48+ (((v) & GENMASK_ULL((hi), (lo))) >> (lo))
49+
50+static LIST_HEAD(skx_edac_list);
51+
52+static u64 skx_tolm, skx_tohm;
53+
54+#define NUM_IMC 2 /* memory controllers per socket */
55+#define NUM_CHANNELS 3 /* channels per memory controller */
56+#define NUM_DIMMS 2 /* Max DIMMS per channel */
57+
58+#define MASK26 0x3FFFFFF /* Mask for 2^26 */
59+#define MASK29 0x1FFFFFFF /* Mask for 2^29 */
60+
61+/*
62+ * Each cpu socket contains some pci devices that provide global
63+ * information, and also some that are local to each of the two
64+ * memory controllers on the die.
65+ */
66+struct skx_dev {
67+ struct list_head list;
68+ u8 bus[4];
69+ struct pci_dev *sad_all;
70+ struct pci_dev *util_all;
71+ u32 mcroute;
72+ struct skx_imc {
73+ struct mem_ctl_info *mci;
74+ u8 mc; /* system wide mc# */
75+ u8 lmc; /* socket relative mc# */
76+ u8 src_id, node_id;
77+ struct skx_channel {
78+ struct pci_dev *cdev;
79+ struct skx_dimm {
80+ u8 close_pg;
81+ u8 bank_xor_enable;
82+ u8 fine_grain_bank;
83+ u8 rowbits;
84+ u8 colbits;
85+ } dimms[NUM_DIMMS];
86+ } chan[NUM_CHANNELS];
87+ } imc[NUM_IMC];
88+};
89+static int skx_num_sockets;
90+
91+struct skx_pvt {
92+ struct skx_imc *imc;
93+};
94+
95+struct decoded_addr {
96+ struct skx_dev *dev;
97+ u64 addr;
98+ int socket;
99+ int imc;
100+ int channel;
101+ u64 chan_addr;
102+ int sktways;
103+ int chanways;
104+ int dimm;
105+ int rank;
106+ int channel_rank;
107+ u64 rank_address;
108+ int row;
109+ int column;
110+ int bank_address;
111+ int bank_group;
112+};
113+
114+static struct skx_dev *get_skx_dev(u8 bus, u8 idx)
115+{
116+ struct skx_dev *d;
117+
118+ list_for_each_entry(d, &skx_edac_list, list) {
119+ if (d->bus[idx] == bus)
120+ return d;
121+ }
122+
123+ return NULL;
124+}
125+
126+enum munittype {
127+ CHAN0, CHAN1, CHAN2, SAD_ALL, UTIL_ALL, SAD
128+};
129+
130+struct munit {
131+ u16 did;
132+ u16 devfn[NUM_IMC];
133+ u8 busidx;
134+ u8 per_socket;
135+ enum munittype mtype;
136+};
137+
138+/*
139+ * List of PCI device ids that we need together with some device
140+ * number and function numbers to tell which memory controller the
141+ * device belongs to.
142+ */
143+static const struct munit skx_all_munits[] = {
144+ { 0x2054, { }, 1, 1, SAD_ALL },
145+ { 0x2055, { }, 1, 1, UTIL_ALL },
146+ { 0x2040, { PCI_DEVFN(10, 0), PCI_DEVFN(12, 0) }, 2, 2, CHAN0 },
147+ { 0x2044, { PCI_DEVFN(10, 4), PCI_DEVFN(12, 4) }, 2, 2, CHAN1 },
148+ { 0x2048, { PCI_DEVFN(11, 0), PCI_DEVFN(13, 0) }, 2, 2, CHAN2 },
149+ { 0x208e, { }, 1, 0, SAD },
150+ { }
151+};
152+
153+/*
154+ * We use the per-socket device 0x2016 to count how many sockets are present,
155+ * and to detemine which PCI buses are associated with each socket. Allocate
156+ * and build the full list of all the skx_dev structures that we need here.
157+ */
158+static int get_all_bus_mappings(void)
159+{
160+ struct pci_dev *pdev, *prev;
161+ struct skx_dev *d;
162+ u32 reg;
163+ int ndev = 0;
164+
165+ prev = NULL;
166+ for (;;) {
167+ pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 0x2016, prev);
168+ if (!pdev)
169+ break;
170+ ndev++;
171+ d = kzalloc(sizeof(*d), GFP_KERNEL);
172+ if (!d) {
173+ pci_dev_put(pdev);
174+ return -ENOMEM;
175+ }
176+ pci_read_config_dword(pdev, 0xCC, &reg);
177+ d->bus[0] = GET_BITFIELD(reg, 0, 7);
178+ d->bus[1] = GET_BITFIELD(reg, 8, 15);
179+ d->bus[2] = GET_BITFIELD(reg, 16, 23);
180+ d->bus[3] = GET_BITFIELD(reg, 24, 31);
181+ edac_dbg(2, "busses: %x, %x, %x, %x\n",
182+ d->bus[0], d->bus[1], d->bus[2], d->bus[3]);
183+ list_add_tail(&d->list, &skx_edac_list);
184+ skx_num_sockets++;
185+ prev = pdev;
186+ }
187+
188+ return ndev;
189+}
190+
191+static int get_all_munits(const struct munit *m)
192+{
193+ struct pci_dev *pdev, *prev;
194+ struct skx_dev *d;
195+ u32 reg;
196+ int i = 0, ndev = 0;
197+
198+ prev = NULL;
199+ for (;;) {
200+ pdev = pci_get_device(PCI_VENDOR_ID_INTEL, m->did, prev);
201+ if (!pdev)
202+ break;
203+ ndev++;
204+ if (m->per_socket == NUM_IMC) {
205+ for (i = 0; i < NUM_IMC; i++)
206+ if (m->devfn[i] == pdev->devfn)
207+ break;
208+ if (i == NUM_IMC)
209+ goto fail;
210+ }
211+ d = get_skx_dev(pdev->bus->number, m->busidx);
212+ if (!d)
213+ goto fail;
214+
215+ /* Be sure that the device is enabled */
216+ if (unlikely(pci_enable_device(pdev) < 0)) {
217+ skx_printk(KERN_ERR,
218+ "Couldn't enable %04x:%04x\n", PCI_VENDOR_ID_INTEL, m->did);
219+ goto fail;
220+ }
221+
222+ switch (m->mtype) {
223+ case CHAN0: case CHAN1: case CHAN2:
224+ pci_dev_get(pdev);
225+ d->imc[i].chan[m->mtype].cdev = pdev;
226+ break;
227+ case SAD_ALL:
228+ pci_dev_get(pdev);
229+ d->sad_all = pdev;
230+ break;
231+ case UTIL_ALL:
232+ pci_dev_get(pdev);
233+ d->util_all = pdev;
234+ break;
235+ case SAD:
236+ /*
237+ * one of these devices per core, including cores
238+ * that don't exist on this SKU. Ignore any that
239+ * read a route table of zero, make sure all the
240+ * non-zero values match.
241+ */
242+ pci_read_config_dword(pdev, 0xB4, &reg);
243+ if (reg != 0) {
244+ if (d->mcroute == 0)
245+ d->mcroute = reg;
246+ else if (d->mcroute != reg) {
247+ skx_printk(KERN_ERR,
248+ "mcroute mismatch\n");
249+ goto fail;
250+ }
251+ }
252+ ndev--;
253+ break;
254+ }
255+
256+ prev = pdev;
257+ }
258+
259+ return ndev;
260+fail:
261+ pci_dev_put(pdev);
262+ return -ENODEV;
263+}
264+
265+const struct x86_cpu_id skx_cpuids[] = {
266+ { X86_VENDOR_INTEL, 6, 0x55, 0, 0 }, /* Skylake */
267+ { }
268+};
269+MODULE_DEVICE_TABLE(x86cpu, skx_cpuids);
270+
271+static u8 get_src_id(struct skx_dev *d)
272+{
273+ u32 reg;
274+
275+ pci_read_config_dword(d->util_all, 0xF0, &reg);
276+
277+ return GET_BITFIELD(reg, 12, 14);
278+}
279+
280+static u8 skx_get_node_id(struct skx_dev *d)
281+{
282+ u32 reg;
283+
284+ pci_read_config_dword(d->util_all, 0xF4, &reg);
285+
286+ return GET_BITFIELD(reg, 0, 2);
287+}
288+
289+static int get_dimm_attr(u32 reg, int lobit, int hibit, int add, int minval,
290+ int maxval, char *name)
291+{
292+ u32 val = GET_BITFIELD(reg, lobit, hibit);
293+
294+ if (val < minval || val > maxval) {
295+ edac_dbg(2, "bad %s = %d (raw=%x)\n", name, val, reg);
296+ return -EINVAL;
297+ }
298+ return val + add;
299+}
300+
301+#define IS_DIMM_PRESENT(mtr) GET_BITFIELD((mtr), 15, 15)
302+
303+#define numrank(reg) get_dimm_attr((reg), 12, 13, 0, 1, 2, "ranks")
304+#define numrow(reg) get_dimm_attr((reg), 2, 4, 12, 1, 6, "rows")
305+#define numcol(reg) get_dimm_attr((reg), 0, 1, 10, 0, 2, "cols")
306+
307+static int get_width(u32 mtr)
308+{
309+ switch (GET_BITFIELD(mtr, 8, 9)) {
310+ case 0:
311+ return DEV_X4;
312+ case 1:
313+ return DEV_X8;
314+ case 2:
315+ return DEV_X16;
316+ }
317+ return DEV_UNKNOWN;
318+}
319+
320+static int skx_get_hi_lo(void)
321+{
322+ struct pci_dev *pdev;
323+ u32 reg;
324+
325+ pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 0x2034, NULL);
326+ if (!pdev) {
327+ edac_dbg(0, "Can't get tolm/tohm\n");
328+ return -ENODEV;
329+ }
330+
331+ pci_read_config_dword(pdev, 0xD0, &reg);
332+ skx_tolm = reg;
333+ pci_read_config_dword(pdev, 0xD4, &reg);
334+ skx_tohm = reg;
335+ pci_read_config_dword(pdev, 0xD8, &reg);
336+ skx_tohm |= (u64)reg << 32;
337+
338+ pci_dev_put(pdev);
339+ edac_dbg(2, "tolm=%llx tohm=%llx\n", skx_tolm, skx_tohm);
340+
341+ return 0;
342+}
343+
344+static int get_dimm_info(u32 mtr, u32 amap, struct dimm_info *dimm,
345+ struct skx_imc *imc, int chan, int dimmno)
346+{
347+ int banks = 16, ranks, rows, cols, npages;
348+ u64 size;
349+
350+ if (!IS_DIMM_PRESENT(mtr))
351+ return 0;
352+ ranks = numrank(mtr);
353+ rows = numrow(mtr);
354+ cols = numcol(mtr);
355+
356+ /*
357+ * Compute size in 8-byte (2^3) words, then shift to MiB (2^20)
358+ */
359+ size = ((1ull << (rows + cols + ranks)) * banks) >> (20 - 3);
360+ npages = MiB_TO_PAGES(size);
361+
362+ edac_dbg(0, "mc#%d: channel %d, dimm %d, %lld Mb (%d pages) bank: %d, rank: %d, row: %#x, col: %#x\n",
363+ imc->mc, chan, dimmno, size, npages,
364+ banks, ranks, rows, cols);
365+
366+ imc->chan[chan].dimms[dimmno].close_pg = GET_BITFIELD(mtr, 0, 0);
367+ imc->chan[chan].dimms[dimmno].bank_xor_enable = GET_BITFIELD(mtr, 9, 9);
368+ imc->chan[chan].dimms[dimmno].fine_grain_bank = GET_BITFIELD(amap, 0, 0);
369+ imc->chan[chan].dimms[dimmno].rowbits = rows;
370+ imc->chan[chan].dimms[dimmno].colbits = cols;
371+
372+ dimm->nr_pages = npages;
373+ dimm->grain = 32;
374+ dimm->dtype = get_width(mtr);
375+ dimm->mtype = MEM_DDR4;
376+ dimm->edac_mode = EDAC_SECDED; /* likely better than this */
377+ snprintf(dimm->label, sizeof(dimm->label), "CPU_SrcID#%u_MC#%u_Chan#%u_DIMM#%u",
378+ imc->src_id, imc->lmc, chan, dimmno);
379+
380+ return 1;
381+}
382+
383+#define SKX_GET_MTMTR(dev, reg) \
384+ pci_read_config_dword((dev), 0x87c, &reg)
385+
386+static bool skx_check_ecc(struct pci_dev *pdev)
387+{
388+ u32 mtmtr;
389+
390+ SKX_GET_MTMTR(pdev, mtmtr);
391+
392+ return !!GET_BITFIELD(mtmtr, 2, 2);
393+}
394+
395+static int skx_get_dimm_config(struct mem_ctl_info *mci)
396+{
397+ struct skx_pvt *pvt = mci->pvt_info;
398+ struct skx_imc *imc = pvt->imc;
399+ struct dimm_info *dimm;
400+ int i, j;
401+ u32 mtr, amap;
402+ int ndimms;
403+
404+ for (i = 0; i < NUM_CHANNELS; i++) {
405+ ndimms = 0;
406+ pci_read_config_dword(imc->chan[i].cdev, 0x8C, &amap);
407+ for (j = 0; j < NUM_DIMMS; j++) {
408+ dimm = EDAC_DIMM_PTR(mci->layers, mci->dimms,
409+ mci->n_layers, i, j, 0);
410+ pci_read_config_dword(imc->chan[i].cdev,
411+ 0x80 + 4*j, &mtr);
412+ ndimms += get_dimm_info(mtr, amap, dimm, imc, i, j);
413+ }
414+ if (ndimms && !skx_check_ecc(imc->chan[0].cdev)) {
415+ skx_printk(KERN_ERR, "ECC is disabled on imc %d\n", imc->mc);
416+ return -ENODEV;
417+ }
418+ }
419+
420+ return 0;
421+}
422+
423+static void skx_unregister_mci(struct skx_imc *imc)
424+{
425+ struct mem_ctl_info *mci = imc->mci;
426+
427+ if (!mci)
428+ return;
429+
430+ edac_dbg(0, "MC%d: mci = %p\n", imc->mc, mci);
431+
432+ /* Remove MC sysfs nodes */
433+ edac_mc_del_mc(mci->pdev);
434+
435+ edac_dbg(1, "%s: free mci struct\n", mci->ctl_name);
436+ kfree(mci->ctl_name);
437+ edac_mc_free(mci);
438+}
439+
440+static int skx_register_mci(struct skx_imc *imc)
441+{
442+ struct mem_ctl_info *mci;
443+ struct edac_mc_layer layers[2];
444+ struct pci_dev *pdev = imc->chan[0].cdev;
445+ struct skx_pvt *pvt;
446+ int rc;
447+
448+ /* allocate a new MC control structure */
449+ layers[0].type = EDAC_MC_LAYER_CHANNEL;
450+ layers[0].size = NUM_CHANNELS;
451+ layers[0].is_virt_csrow = false;
452+ layers[1].type = EDAC_MC_LAYER_SLOT;
453+ layers[1].size = NUM_DIMMS;
454+ layers[1].is_virt_csrow = true;
455+ mci = edac_mc_alloc(imc->mc, ARRAY_SIZE(layers), layers,
456+ sizeof(struct skx_pvt));
457+
458+ if (unlikely(!mci))
459+ return -ENOMEM;
460+
461+ edac_dbg(0, "MC#%d: mci = %p\n", imc->mc, mci);
462+
463+ /* Associate skx_dev and mci for future usage */
464+ imc->mci = mci;
465+ pvt = mci->pvt_info;
466+ pvt->imc = imc;
467+
468+ mci->ctl_name = kasprintf(GFP_KERNEL, "Skylake Socket#%d IMC#%d",
469+ imc->node_id, imc->lmc);
470+ mci->mtype_cap = MEM_FLAG_DDR4;
471+ mci->edac_ctl_cap = EDAC_FLAG_NONE;
472+ mci->edac_cap = EDAC_FLAG_NONE;
473+ mci->mod_name = "skx_edac.c";
474+ mci->dev_name = pci_name(imc->chan[0].cdev);
475+ mci->mod_ver = SKX_REVISION;
476+ mci->ctl_page_to_phys = NULL;
477+
478+ rc = skx_get_dimm_config(mci);
479+ if (rc < 0)
480+ goto fail;
481+
482+ /* record ptr to the generic device */
483+ mci->pdev = &pdev->dev;
484+
485+ /* add this new MC control structure to EDAC's list of MCs */
486+ if (unlikely(edac_mc_add_mc(mci))) {
487+ edac_dbg(0, "MC: failed edac_mc_add_mc()\n");
488+ rc = -EINVAL;
489+ goto fail;
490+ }
491+
492+ return 0;
493+
494+fail:
495+ kfree(mci->ctl_name);
496+ edac_mc_free(mci);
497+ imc->mci = NULL;
498+ return rc;
499+}
500+
501+#define SKX_MAX_SAD 24
502+
503+#define SKX_GET_SAD(d, i, reg) \
504+ pci_read_config_dword((d)->sad_all, 0x60 + 8 * (i), &reg)
505+#define SKX_GET_ILV(d, i, reg) \
506+ pci_read_config_dword((d)->sad_all, 0x64 + 8 * (i), &reg)
507+
508+#define SKX_SAD_MOD3MODE(sad) GET_BITFIELD((sad), 30, 31)
509+#define SKX_SAD_MOD3(sad) GET_BITFIELD((sad), 27, 27)
510+#define SKX_SAD_LIMIT(sad) (((u64)GET_BITFIELD((sad), 7, 26) << 26) | MASK26)
511+#define SKX_SAD_MOD3ASMOD2(sad) GET_BITFIELD((sad), 5, 6)
512+#define SKX_SAD_ATTR(sad) GET_BITFIELD((sad), 3, 4)
513+#define SKX_SAD_INTERLEAVE(sad) GET_BITFIELD((sad), 1, 2)
514+#define SKX_SAD_ENABLE(sad) GET_BITFIELD((sad), 0, 0)
515+
516+#define SKX_ILV_REMOTE(tgt) (((tgt) & 8) == 0)
517+#define SKX_ILV_TARGET(tgt) ((tgt) & 7)
518+
519+static bool skx_sad_decode(struct decoded_addr *res)
520+{
521+ struct skx_dev *d = list_first_entry(&skx_edac_list, typeof(*d), list);
522+ u64 addr = res->addr;
523+ int i, idx, tgt, lchan, shift;
524+ u32 sad, ilv;
525+ u64 limit, prev_limit;
526+ int remote = 0;
527+
528+ /* Simple sanity check for I/O space or out of range */
529+ if (addr >= skx_tohm || (addr >= skx_tolm && addr < BIT_ULL(32))) {
530+ edac_dbg(0, "Address %llx out of range\n", addr);
531+ return false;
532+ }
533+
534+restart:
535+ prev_limit = 0;
536+ for (i = 0; i < SKX_MAX_SAD; i++) {
537+ SKX_GET_SAD(d, i, sad);
538+ limit = SKX_SAD_LIMIT(sad);
539+ if (SKX_SAD_ENABLE(sad)) {
540+ if (addr >= prev_limit && addr <= limit)
541+ goto sad_found;
542+ }
543+ prev_limit = limit + 1;
544+ }
545+ edac_dbg(0, "No SAD entry for %llx\n", addr);
546+ return false;
547+
548+sad_found:
549+ SKX_GET_ILV(d, i, ilv);
550+
551+ switch (SKX_SAD_INTERLEAVE(sad)) {
552+ case 0:
553+ idx = GET_BITFIELD(addr, 6, 8);
554+ break;
555+ case 1:
556+ idx = GET_BITFIELD(addr, 8, 10);
557+ break;
558+ case 2:
559+ idx = GET_BITFIELD(addr, 12, 14);
560+ break;
561+ case 3:
562+ idx = GET_BITFIELD(addr, 30, 32);
563+ break;
564+ }
565+
566+ tgt = GET_BITFIELD(ilv, 4 * idx, 4 * idx + 3);
567+
568+ /* If point to another node, find it and start over */
569+ if (SKX_ILV_REMOTE(tgt)) {
570+ if (remote) {
571+ edac_dbg(0, "Double remote!\n");
572+ return false;
573+ }
574+ remote = 1;
575+ list_for_each_entry(d, &skx_edac_list, list) {
576+ if (d->imc[0].src_id == SKX_ILV_TARGET(tgt))
577+ goto restart;
578+ }
579+ edac_dbg(0, "Can't find node %d\n", SKX_ILV_TARGET(tgt));
580+ return false;
581+ }
582+
583+ if (SKX_SAD_MOD3(sad) == 0)
584+ lchan = SKX_ILV_TARGET(tgt);
585+ else {
586+ switch (SKX_SAD_MOD3MODE(sad)) {
587+ case 0:
588+ shift = 6;
589+ break;
590+ case 1:
591+ shift = 8;
592+ break;
593+ case 2:
594+ shift = 12;
595+ break;
596+ default:
597+ edac_dbg(0, "illegal mod3mode\n");
598+ return false;
599+ }
600+ switch (SKX_SAD_MOD3ASMOD2(sad)) {
601+ case 0:
602+ lchan = (addr >> shift) % 3;
603+ break;
604+ case 1:
605+ lchan = (addr >> shift) % 2;
606+ break;
607+ case 2:
608+ lchan = (addr >> shift) % 2;
609+ lchan = (lchan << 1) | ~lchan;
610+ break;
611+ case 3:
612+ lchan = ((addr >> shift) % 2) << 1;
613+ break;
614+ }
615+ lchan = (lchan << 1) | (SKX_ILV_TARGET(tgt) & 1);
616+ }
617+
618+ res->dev = d;
619+ res->socket = d->imc[0].src_id;
620+ res->imc = GET_BITFIELD(d->mcroute, lchan * 3, lchan * 3 + 2);
621+ res->channel = GET_BITFIELD(d->mcroute, lchan * 2 + 18, lchan * 2 + 19);
622+
623+ edac_dbg(2, "%llx: socket=%d imc=%d channel=%d\n",
624+ res->addr, res->socket, res->imc, res->channel);
625+ return true;
626+}
627+
628+#define SKX_MAX_TAD 8
629+
630+#define SKX_GET_TADBASE(d, mc, i, reg) \
631+ pci_read_config_dword((d)->imc[mc].chan[0].cdev, 0x850 + 4 * (i), &reg)
632+#define SKX_GET_TADWAYNESS(d, mc, i, reg) \
633+ pci_read_config_dword((d)->imc[mc].chan[0].cdev, 0x880 + 4 * (i), &reg)
634+#define SKX_GET_TADCHNILVOFFSET(d, mc, ch, i, reg) \
635+ pci_read_config_dword((d)->imc[mc].chan[ch].cdev, 0x90 + 4 * (i), &reg)
636+
637+#define SKX_TAD_BASE(b) ((u64)GET_BITFIELD((b), 12, 31) << 26)
638+#define SKX_TAD_SKT_GRAN(b) GET_BITFIELD((b), 4, 5)
639+#define SKX_TAD_CHN_GRAN(b) GET_BITFIELD((b), 6, 7)
640+#define SKX_TAD_LIMIT(b) (((u64)GET_BITFIELD((b), 12, 31) << 26) | MASK26)
641+#define SKX_TAD_OFFSET(b) ((u64)GET_BITFIELD((b), 4, 23) << 26)
642+#define SKX_TAD_SKTWAYS(b) (1 << GET_BITFIELD((b), 10, 11))
643+#define SKX_TAD_CHNWAYS(b) (GET_BITFIELD((b), 8, 9) + 1)
644+
645+/* which bit used for both socket and channel interleave */
646+static int skx_granularity[] = { 6, 8, 12, 30 };
647+
648+static u64 skx_do_interleave(u64 addr, int shift, int ways, u64 lowbits)
649+{
650+ addr >>= shift;
651+ addr /= ways;
652+ addr <<= shift;
653+
654+ return addr | (lowbits & ((1ull << shift) - 1));
655+}
656+
657+static bool skx_tad_decode(struct decoded_addr *res)
658+{
659+ int i;
660+ u32 base, wayness, chnilvoffset;
661+ int skt_interleave_bit, chn_interleave_bit;
662+ u64 channel_addr;
663+
664+ for (i = 0; i < SKX_MAX_TAD; i++) {
665+ SKX_GET_TADBASE(res->dev, res->imc, i, base);
666+ SKX_GET_TADWAYNESS(res->dev, res->imc, i, wayness);
667+ if (SKX_TAD_BASE(base) <= res->addr && res->addr <= SKX_TAD_LIMIT(wayness))
668+ goto tad_found;
669+ }
670+ edac_dbg(0, "No TAD entry for %llx\n", res->addr);
671+ return false;
672+
673+tad_found:
674+ res->sktways = SKX_TAD_SKTWAYS(wayness);
675+ res->chanways = SKX_TAD_CHNWAYS(wayness);
676+ skt_interleave_bit = skx_granularity[SKX_TAD_SKT_GRAN(base)];
677+ chn_interleave_bit = skx_granularity[SKX_TAD_CHN_GRAN(base)];
678+
679+ SKX_GET_TADCHNILVOFFSET(res->dev, res->imc, res->channel, i, chnilvoffset);
680+ channel_addr = res->addr - SKX_TAD_OFFSET(chnilvoffset);
681+
682+ if (res->chanways == 3 && skt_interleave_bit > chn_interleave_bit) {
683+ /* Must handle channel first, then socket */
684+ channel_addr = skx_do_interleave(channel_addr, chn_interleave_bit,
685+ res->chanways, channel_addr);
686+ channel_addr = skx_do_interleave(channel_addr, skt_interleave_bit,
687+ res->sktways, channel_addr);
688+ } else {
689+ /* Handle socket then channel. Preserve low bits from original address */
690+ channel_addr = skx_do_interleave(channel_addr, skt_interleave_bit,
691+ res->sktways, res->addr);
692+ channel_addr = skx_do_interleave(channel_addr, chn_interleave_bit,
693+ res->chanways, res->addr);
694+ }
695+
696+ res->chan_addr = channel_addr;
697+
698+ edac_dbg(2, "%llx: chan_addr=%llx sktways=%d chanways=%d\n",
699+ res->addr, res->chan_addr, res->sktways, res->chanways);
700+ return true;
701+}
702+
703+#define SKX_MAX_RIR 4
704+
705+#define SKX_GET_RIRWAYNESS(d, mc, ch, i, reg) \
706+ pci_read_config_dword((d)->imc[mc].chan[ch].cdev, \
707+ 0x108 + 4 * (i), &reg)
708+#define SKX_GET_RIRILV(d, mc, ch, idx, i, reg) \
709+ pci_read_config_dword((d)->imc[mc].chan[ch].cdev, \
710+ 0x120 + 16 * idx + 4 * (i), &reg)
711+
712+#define SKX_RIR_VALID(b) GET_BITFIELD((b), 31, 31)
713+#define SKX_RIR_LIMIT(b) (((u64)GET_BITFIELD((b), 1, 11) << 29) | MASK29)
714+#define SKX_RIR_WAYS(b) (1 << GET_BITFIELD((b), 28, 29))
715+#define SKX_RIR_CHAN_RANK(b) GET_BITFIELD((b), 16, 19)
716+#define SKX_RIR_OFFSET(b) ((u64)(GET_BITFIELD((b), 2, 15) << 26))
717+
718+static bool skx_rir_decode(struct decoded_addr *res)
719+{
720+ int i, idx, chan_rank;
721+ int shift;
722+ u32 rirway, rirlv;
723+ u64 rank_addr, prev_limit = 0, limit;
724+
725+ if (res->dev->imc[res->imc].chan[res->channel].dimms[0].close_pg)
726+ shift = 6;
727+ else
728+ shift = 13;
729+
730+ for (i = 0; i < SKX_MAX_RIR; i++) {
731+ SKX_GET_RIRWAYNESS(res->dev, res->imc, res->channel, i, rirway);
732+ limit = SKX_RIR_LIMIT(rirway);
733+ if (SKX_RIR_VALID(rirway)) {
734+ if (prev_limit <= res->chan_addr &&
735+ res->chan_addr <= limit)
736+ goto rir_found;
737+ }
738+ prev_limit = limit;
739+ }
740+ edac_dbg(0, "No RIR entry for %llx\n", res->addr);
741+ return false;
742+
743+rir_found:
744+ rank_addr = res->chan_addr >> shift;
745+ rank_addr /= SKX_RIR_WAYS(rirway);
746+ rank_addr <<= shift;
747+ rank_addr |= res->chan_addr & GENMASK_ULL(shift - 1, 0);
748+
749+ res->rank_address = rank_addr;
750+ idx = (res->chan_addr >> shift) % SKX_RIR_WAYS(rirway);
751+
752+ SKX_GET_RIRILV(res->dev, res->imc, res->channel, idx, i, rirlv);
753+ res->rank_address = rank_addr - SKX_RIR_OFFSET(rirlv);
754+ chan_rank = SKX_RIR_CHAN_RANK(rirlv);
755+ res->channel_rank = chan_rank;
756+ res->dimm = chan_rank / 4;
757+ res->rank = chan_rank % 4;
758+
759+ edac_dbg(2, "%llx: dimm=%d rank=%d chan_rank=%d rank_addr=%llx\n",
760+ res->addr, res->dimm, res->rank,
761+ res->channel_rank, res->rank_address);
762+ return true;
763+}
764+
765+static u8 skx_close_row[] = {
766+ 15, 16, 17, 18, 20, 21, 22, 28, 10, 11, 12, 13, 29, 30, 31, 32, 33
767+};
768+static u8 skx_close_column[] = {
769+ 3, 4, 5, 14, 19, 23, 24, 25, 26, 27
770+};
771+static u8 skx_open_row[] = {
772+ 14, 15, 16, 20, 28, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33
773+};
774+static u8 skx_open_column[] = {
775+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
776+};
777+static u8 skx_open_fine_column[] = {
778+ 3, 4, 5, 7, 8, 9, 10, 11, 12, 13
779+};
780+
781+static int skx_bits(u64 addr, int nbits, u8 *bits)
782+{
783+ int i, res = 0;
784+
785+ for (i = 0; i < nbits; i++)
786+ res |= ((addr >> bits[i]) & 1) << i;
787+ return res;
788+}
789+
790+static int skx_bank_bits(u64 addr, int b0, int b1, int do_xor, int x0, int x1)
791+{
792+ int ret = GET_BITFIELD(addr, b0, b0) | (GET_BITFIELD(addr, b1, b1) << 1);
793+
794+ if (do_xor)
795+ ret ^= GET_BITFIELD(addr, x0, x0) | (GET_BITFIELD(addr, x1, x1) << 1);
796+
797+ return ret;
798+}
799+
800+static bool skx_mad_decode(struct decoded_addr *r)
801+{
802+ struct skx_dimm *dimm = &r->dev->imc[r->imc].chan[r->channel].dimms[r->dimm];
803+ int bg0 = dimm->fine_grain_bank ? 6 : 13;
804+
805+ if (dimm->close_pg) {
806+ r->row = skx_bits(r->rank_address, dimm->rowbits, skx_close_row);
807+ r->column = skx_bits(r->rank_address, dimm->colbits, skx_close_column);
808+ r->column |= 0x400; /* C10 is autoprecharge, always set */
809+ r->bank_address = skx_bank_bits(r->rank_address, 8, 9, dimm->bank_xor_enable, 22, 28);
810+ r->bank_group = skx_bank_bits(r->rank_address, 6, 7, dimm->bank_xor_enable, 20, 21);
811+ } else {
812+ r->row = skx_bits(r->rank_address, dimm->rowbits, skx_open_row);
813+ if (dimm->fine_grain_bank)
814+ r->column = skx_bits(r->rank_address, dimm->colbits, skx_open_fine_column);
815+ else
816+ r->column = skx_bits(r->rank_address, dimm->colbits, skx_open_column);
817+ r->bank_address = skx_bank_bits(r->rank_address, 18, 19, dimm->bank_xor_enable, 22, 23);
818+ r->bank_group = skx_bank_bits(r->rank_address, bg0, 17, dimm->bank_xor_enable, 20, 21);
819+ }
820+ r->row &= (1u << dimm->rowbits) - 1;
821+
822+ edac_dbg(2, "%llx: row=%x col=%x bank_addr=%d bank_group=%d\n",
823+ r->addr, r->row, r->column, r->bank_address,
824+ r->bank_group);
825+ return true;
826+}
827+
828+static bool skx_decode(struct decoded_addr *res)
829+{
830+
831+ return skx_sad_decode(res) && skx_tad_decode(res) &&
832+ skx_rir_decode(res) && skx_mad_decode(res);
833+}
834+
835+#ifdef CONFIG_EDAC_DEBUG
836+/*
837+ * Debug feature. Make /sys/kernel/debug/skx_edac_test/addr.
838+ * Write an address to this file to exercise the address decode
839+ * logic in this driver.
840+ */
841+static struct dentry *skx_test;
842+static u64 skx_fake_addr;
843+
844+static int debugfs_u64_set(void *data, u64 val)
845+{
846+ struct decoded_addr res;
847+
848+ res.addr = val;
849+ skx_decode(&res);
850+
851+ return 0;
852+}
853+
854+DEFINE_SIMPLE_ATTRIBUTE(fops_u64_wo, NULL, debugfs_u64_set, "%llu\n");
855+
856+static struct dentry *mydebugfs_create(const char *name, umode_t mode,
857+ struct dentry *parent, u64 *value)
858+{
859+ return debugfs_create_file(name, mode, parent, value, &fops_u64_wo);
860+}
861+
862+static void setup_skx_debug(void)
863+{
864+ skx_test = debugfs_create_dir("skx_edac_test", NULL);
865+ mydebugfs_create("addr", S_IWUSR, skx_test, &skx_fake_addr);
866+}
867+
868+static void teardown_skx_debug(void)
869+{
870+ debugfs_remove_recursive(skx_test);
871+}
872+#else
873+static void setup_skx_debug(void)
874+{
875+}
876+
877+static void teardown_skx_debug(void)
878+{
879+}
880+#endif /*CONFIG_EDAC_DEBUG*/
881+
882+static void skx_mce_output_error(struct mem_ctl_info *mci,
883+ const struct mce *m,
884+ struct decoded_addr *res)
885+{
886+ enum hw_event_mc_err_type tp_event;
887+ char *type, *optype, msg[256];
888+ bool ripv = GET_BITFIELD(m->mcgstatus, 0, 0);
889+ bool overflow = GET_BITFIELD(m->status, 62, 62);
890+ bool uncorrected_error = GET_BITFIELD(m->status, 61, 61);
891+ bool recoverable;
892+ u32 core_err_cnt = GET_BITFIELD(m->status, 38, 52);
893+ u32 mscod = GET_BITFIELD(m->status, 16, 31);
894+ u32 errcode = GET_BITFIELD(m->status, 0, 15);
895+ u32 optypenum = GET_BITFIELD(m->status, 4, 6);
896+
897+ recoverable = GET_BITFIELD(m->status, 56, 56);
898+
899+ if (uncorrected_error) {
900+ if (ripv) {
901+ type = "FATAL";
902+ tp_event = HW_EVENT_ERR_FATAL;
903+ } else {
904+ type = "NON_FATAL";
905+ tp_event = HW_EVENT_ERR_UNCORRECTED;
906+ }
907+ } else {
908+ type = "CORRECTED";
909+ tp_event = HW_EVENT_ERR_CORRECTED;
910+ }
911+
912+ /*
913+ * According with Table 15-9 of the Intel Architecture spec vol 3A,
914+ * memory errors should fit in this mask:
915+ * 000f 0000 1mmm cccc (binary)
916+ * where:
917+ * f = Correction Report Filtering Bit. If 1, subsequent errors
918+ * won't be shown
919+ * mmm = error type
920+ * cccc = channel
921+ * If the mask doesn't match, report an error to the parsing logic
922+ */
923+ if (!((errcode & 0xef80) == 0x80)) {
924+ optype = "Can't parse: it is not a mem";
925+ } else {
926+ switch (optypenum) {
927+ case 0:
928+ optype = "generic undef request error";
929+ break;
930+ case 1:
931+ optype = "memory read error";
932+ break;
933+ case 2:
934+ optype = "memory write error";
935+ break;
936+ case 3:
937+ optype = "addr/cmd error";
938+ break;
939+ case 4:
940+ optype = "memory scrubbing error";
941+ break;
942+ default:
943+ optype = "reserved";
944+ break;
945+ }
946+ }
947+
948+ snprintf(msg, sizeof(msg),
949+ "%s%s err_code:%04x:%04x socket:%d imc:%d rank:%d bg:%d ba:%d row:%x col:%x",
950+ overflow ? " OVERFLOW" : "",
951+ (uncorrected_error && recoverable) ? " recoverable" : "",
952+ mscod, errcode,
953+ res->socket, res->imc, res->rank,
954+ res->bank_group, res->bank_address, res->row, res->column);
955+
956+ edac_dbg(0, "%s\n", msg);
957+
958+ /* Call the helper to output message */
959+ edac_mc_handle_error(tp_event, mci, core_err_cnt,
960+ m->addr >> PAGE_SHIFT, m->addr & ~PAGE_MASK, 0,
961+ res->channel, res->dimm, -1,
962+ optype, msg);
963+}
964+
965+static int skx_mce_check_error(struct notifier_block *nb, unsigned long val,
966+ void *data)
967+{
968+ struct mce *mce = (struct mce *)data;
969+ struct decoded_addr res;
970+ struct mem_ctl_info *mci;
971+ char *type;
972+
973+ if (get_edac_report_status() == EDAC_REPORTING_DISABLED)
974+ return NOTIFY_DONE;
975+
976+ /* ignore unless this is memory related with an address */
977+ if ((mce->status & 0xefff) >> 7 != 1 || !(mce->status & MCI_STATUS_ADDRV))
978+ return NOTIFY_DONE;
979+
980+ res.addr = mce->addr;
981+ if (!skx_decode(&res))
982+ return NOTIFY_DONE;
983+ mci = res.dev->imc[res.imc].mci;
984+
985+ if (mce->mcgstatus & MCG_STATUS_MCIP)
986+ type = "Exception";
987+ else
988+ type = "Event";
989+
990+ skx_mc_printk(mci, KERN_DEBUG, "HANDLING MCE MEMORY ERROR\n");
991+
992+ skx_mc_printk(mci, KERN_DEBUG, "CPU %d: Machine Check %s: %Lx "
993+ "Bank %d: %016Lx\n", mce->extcpu, type,
994+ mce->mcgstatus, mce->bank, mce->status);
995+ skx_mc_printk(mci, KERN_DEBUG, "TSC %llx ", mce->tsc);
996+ skx_mc_printk(mci, KERN_DEBUG, "ADDR %llx ", mce->addr);
997+ skx_mc_printk(mci, KERN_DEBUG, "MISC %llx ", mce->misc);
998+
999+ skx_mc_printk(mci, KERN_DEBUG, "PROCESSOR %u:%x TIME %llu SOCKET "
1000+ "%u APIC %x\n", mce->cpuvendor, mce->cpuid,
1001+ mce->time, mce->socketid, mce->apicid);
1002+
1003+ skx_mce_output_error(mci, mce, &res);
1004+
1005+ return NOTIFY_DONE;
1006+}
1007+
1008+static struct notifier_block skx_mce_dec = {
1009+ .notifier_call = skx_mce_check_error,
1010+};
1011+
1012+static void skx_remove(void)
1013+{
1014+ int i, j;
1015+ struct skx_dev *d, *tmp;
1016+
1017+ edac_dbg(0, "\n");
1018+
1019+ list_for_each_entry_safe(d, tmp, &skx_edac_list, list) {
1020+ list_del(&d->list);
1021+ for (i = 0; i < NUM_IMC; i++) {
1022+ skx_unregister_mci(&d->imc[i]);
1023+ for (j = 0; j < NUM_CHANNELS; j++)
1024+ pci_dev_put(d->imc[i].chan[j].cdev);
1025+ }
1026+ pci_dev_put(d->util_all);
1027+ pci_dev_put(d->sad_all);
1028+
1029+ kfree(d);
1030+ }
1031+}
1032+
1033+/*
1034+ * skx_init:
1035+ * make sure we are running on the correct cpu model
1036+ * search for all the devices we need
1037+ * check which DIMMs are present.
1038+ */
1039+int __init skx_init(void)
1040+{
1041+ const struct x86_cpu_id *id;
1042+ const struct munit *m;
1043+ int rc = 0, i;
1044+ u8 mc = 0, src_id, node_id;
1045+ struct skx_dev *d;
1046+
1047+ edac_dbg(2, "\n");
1048+
1049+ id = x86_match_cpu(skx_cpuids);
1050+ if (!id)
1051+ return -ENODEV;
1052+
1053+ rc = skx_get_hi_lo();
1054+ if (rc)
1055+ return rc;
1056+
1057+ rc = get_all_bus_mappings();
1058+ if (rc < 0)
1059+ goto fail;
1060+ if (rc == 0) {
1061+ edac_dbg(2, "No memory controllers found\n");
1062+ return -ENODEV;
1063+ }
1064+
1065+ for (m = skx_all_munits; m->did; m++) {
1066+ rc = get_all_munits(m);
1067+ if (rc < 0)
1068+ goto fail;
1069+ if (rc != m->per_socket * skx_num_sockets) {
1070+ edac_dbg(2, "Expected %d, got %d of %x\n",
1071+ m->per_socket * skx_num_sockets, rc, m->did);
1072+ rc = -ENODEV;
1073+ goto fail;
1074+ }
1075+ }
1076+
1077+ list_for_each_entry(d, &skx_edac_list, list) {
1078+ src_id = get_src_id(d);
1079+ node_id = skx_get_node_id(d);
1080+ edac_dbg(2, "src_id=%d node_id=%d\n", src_id, node_id);
1081+ for (i = 0; i < NUM_IMC; i++) {
1082+ d->imc[i].mc = mc++;
1083+ d->imc[i].lmc = i;
1084+ d->imc[i].src_id = src_id;
1085+ d->imc[i].node_id = node_id;
1086+ rc = skx_register_mci(&d->imc[i]);
1087+ if (rc < 0)
1088+ goto fail;
1089+ }
1090+ }
1091+
1092+ /* Ensure that the OPSTATE is set correctly for POLL or NMI */
1093+ opstate_init();
1094+
1095+ setup_skx_debug();
1096+
1097+ mce_register_decode_chain(&skx_mce_dec);
1098+
1099+ return 0;
1100+fail:
1101+ skx_remove();
1102+ return rc;
1103+}
1104+
1105+static void __exit skx_exit(void)
1106+{
1107+ edac_dbg(2, "\n");
1108+ mce_unregister_decode_chain(&skx_mce_dec);
1109+ skx_remove();
1110+ teardown_skx_debug();
1111+}
1112+
1113+module_init(skx_init);
1114+module_exit(skx_exit);
1115+
1116+module_param(edac_op_state, int, 0444);
1117+MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI");
1118+
1119+MODULE_LICENSE("GPL v2");
1120+MODULE_AUTHOR("Tony Luck");
1121+MODULE_DESCRIPTION("MC Driver for Intel Skylake server processors");
drivers/firmware/arm_scpi.c+3−2
@@ -709,9 +709,10 @@ static int scpi_probe(struct platform_device *pdev) · 708 unmodified lines
709709 struct mbox_client *cl = &pchan->cl;
710710 struct device_node *shmem = of_parse_phandle(np, "shmem", idx);
711711
712− if (of_address_to_resource(shmem, 0, &res)) {
712+ ret = of_address_to_resource(shmem, 0, &res);
713+ of_node_put(shmem);
714+ if (ret) {
713715 dev_err(dev, "failed to get SCPI payload mem resource\n");
714− ret = -EINVAL;
715716 goto err;
716717 }
717718
drivers/firmware/dmi-id.c+4−4
@@ -229,14 +229,14 @@ static int __init dmi_id_init(void) · 228 unmodified lines
229229
230230 ret = device_register(dmi_dev);
231231 if (ret)
232− goto fail_free_dmi_dev;
232+ goto fail_put_dmi_dev;
233233
234234 return 0;
235235
236−fail_free_dmi_dev:
237− kfree(dmi_dev);
238−fail_class_unregister:
236+fail_put_dmi_dev:
237+ put_device(dmi_dev);
239238
239+fail_class_unregister:
240240 class_unregister(&dmi_class);
241241
242242 return ret;
drivers/firmware/efi/efi.c+5−2
@@ -657,9 +657,12 @@ static int __init fdt_find_uefi_params(unsigned long node, const char *uname, · 656 unmodified lines
657657 }
658658
659659 if (subnode) {
660− node = of_get_flat_dt_subnode_by_name(node, subnode);
661− if (node < 0)
660+ int err = of_get_flat_dt_subnode_by_name(node, subnode);
661+
662+ if (err < 0)
662663 return 0;
664+
665+ node = err;
663666 }
664667
665668 return __find_uefi_params(node, info, dt_params[i].params);
drivers/firmware/efi/libstub/efi-stub-helper.c+139−30
@@ -41,6 +41,8 @@ static unsigned long __chunk_size = EFI_READ_CHUNK_SIZE; · 40 unmodified lines
4141 #define EFI_ALLOC_ALIGN EFI_PAGE_SIZE
4242 #endif
4343
44+#define EFI_MMAP_NR_SLACK_SLOTS 8
45+
4446 struct file_info {
4547 efi_file_handle_t *handle;
4648 u64 size;
@@ -63,49 +65,62 @@ void efi_printk(efi_system_table_t *sys_table_arg, char *str) · 16 unmodified lines
6365 }
6466 }
6567
68+static inline bool mmap_has_headroom(unsigned long buff_size,
69+ unsigned long map_size,
70+ unsigned long desc_size)
71+{
72+ unsigned long slack = buff_size - map_size;
73+
74+ return slack / desc_size >= EFI_MMAP_NR_SLACK_SLOTS;
75+}
76+
6677 efi_status_t efi_get_memory_map(efi_system_table_t *sys_table_arg,
67− efi_memory_desc_t **map,
68− unsigned long *map_size,
69− unsigned long *desc_size,
70− u32 *desc_ver,
71− unsigned long *key_ptr)
78+ struct efi_boot_memmap *map)
7279 {
7380 efi_memory_desc_t *m = NULL;
7481 efi_status_t status;
7582 unsigned long key;
7683 u32 desc_version;
7784
78− *map_size = sizeof(*m) * 32;
85+ *map->desc_size = sizeof(*m);
86+ *map->map_size = *map->desc_size * 32;
87+ *map->buff_size = *map->map_size;
7988 again:
80− /*
81− * Add an additional efi_memory_desc_t because we're doing an
82− * allocation which may be in a new descriptor region.
83− */
84− *map_size += sizeof(*m);
8589 status = efi_call_early(allocate_pool, EFI_LOADER_DATA,
86− *map_size, (void **)&m);
90+ *map->map_size, (void **)&m);
8791 if (status != EFI_SUCCESS)
8892 goto fail;
8993
90− *desc_size = 0;
94+ *map->desc_size = 0;
9195 key = 0;
92− status = efi_call_early(get_memory_map, map_size, m,
93− &key, desc_size, &desc_version);
94− if (status == EFI_BUFFER_TOO_SMALL) {
96+ status = efi_call_early(get_memory_map, map->map_size, m,
97+ &key, map->desc_size, &desc_version);
98+ if (status == EFI_BUFFER_TOO_SMALL ||
99+ !mmap_has_headroom(*map->buff_size, *map->map_size,
100+ *map->desc_size)) {
95101 efi_call_early(free_pool, m);
102+ /*
103+ * Make sure there is some entries of headroom so that the
104+ * buffer can be reused for a new map after allocations are
105+ * no longer permitted. Its unlikely that the map will grow to
106+ * exceed this headroom once we are ready to trigger
107+ * ExitBootServices()
108+ */
109+ *map->map_size += *map->desc_size * EFI_MMAP_NR_SLACK_SLOTS;
110+ *map->buff_size = *map->map_size;
96111 goto again;
97112 }
98113
99114 if (status != EFI_SUCCESS)
100115 efi_call_early(free_pool, m);
101116
102− if (key_ptr && status == EFI_SUCCESS)
103− *key_ptr = key;
104− if (desc_ver && status == EFI_SUCCESS)
105− *desc_ver = desc_version;
117+ if (map->key_ptr && status == EFI_SUCCESS)
118+ *map->key_ptr = key;
119+ if (map->desc_ver && status == EFI_SUCCESS)
120+ *map->desc_ver = desc_version;
106121
107122 fail:
108− *map = m;
123+ *map->map = m;
109124 return status;
110125 }
111126
@@ -113,13 +128,20 @@ fail: · 1 unmodified line
113128 unsigned long get_dram_base(efi_system_table_t *sys_table_arg)
114129 {
115130 efi_status_t status;
116− unsigned long map_size;
131+ unsigned long map_size, buff_size;
117132 unsigned long membase = EFI_ERROR;
118133 struct efi_memory_map map;
119134 efi_memory_desc_t *md;
135+ struct efi_boot_memmap boot_map;
120136
121− status = efi_get_memory_map(sys_table_arg, (efi_memory_desc_t **)&map.map,
122− &map_size, &map.desc_size, NULL, NULL);
137+ boot_map.map = (efi_memory_desc_t **)&map.map;
138+ boot_map.map_size = &map_size;
139+ boot_map.desc_size = &map.desc_size;
140+ boot_map.desc_ver = NULL;
141+ boot_map.key_ptr = NULL;
142+ boot_map.buff_size = &buff_size;
143+
144+ status = efi_get_memory_map(sys_table_arg, &boot_map);
123145 if (status != EFI_SUCCESS)
124146 return membase;
125147
@@ -144,15 +166,22 @@ efi_status_t efi_high_alloc(efi_system_table_t *sys_table_arg, · 18 unmodified lines
144166 unsigned long size, unsigned long align,
145167 unsigned long *addr, unsigned long max)
146168 {
147− unsigned long map_size, desc_size;
169+ unsigned long map_size, desc_size, buff_size;
148170 efi_memory_desc_t *map;
149171 efi_status_t status;
150172 unsigned long nr_pages;
151173 u64 max_addr = 0;
152174 int i;
175+ struct efi_boot_memmap boot_map;
176+
177+ boot_map.map = &map;
178+ boot_map.map_size = &map_size;
179+ boot_map.desc_size = &desc_size;
180+ boot_map.desc_ver = NULL;
181+ boot_map.key_ptr = NULL;
182+ boot_map.buff_size = &buff_size;
153183
154− status = efi_get_memory_map(sys_table_arg, &map, &map_size, &desc_size,
155− NULL, NULL);
184+ status = efi_get_memory_map(sys_table_arg, &boot_map);
156185 if (status != EFI_SUCCESS)
157186 goto fail;
158187
@@ -230,14 +259,21 @@ efi_status_t efi_low_alloc(efi_system_table_t *sys_table_arg, · 71 unmodified lines
230259 unsigned long size, unsigned long align,
231260 unsigned long *addr)
232261 {
233− unsigned long map_size, desc_size;
262+ unsigned long map_size, desc_size, buff_size;
234263 efi_memory_desc_t *map;
235264 efi_status_t status;
236265 unsigned long nr_pages;
237266 int i;
267+ struct efi_boot_memmap boot_map;
238268
239− status = efi_get_memory_map(sys_table_arg, &map, &map_size, &desc_size,
240− NULL, NULL);
269+ boot_map.map = &map;
270+ boot_map.map_size = &map_size;
271+ boot_map.desc_size = &desc_size;
272+ boot_map.desc_ver = NULL;
273+ boot_map.key_ptr = NULL;
274+ boot_map.buff_size = &buff_size;
275+
276+ status = efi_get_memory_map(sys_table_arg, &boot_map);
241277 if (status != EFI_SUCCESS)
242278 goto fail;
243279
@@ -704,3 +740,76 @@ char *efi_convert_cmdline(efi_system_table_t *sys_table_arg, · 460 unmodified lines
704740 *cmd_line_len = options_bytes;
705741 return (char *)cmdline_addr;
706742 }
743+
744+/*
745+ * Handle calling ExitBootServices according to the requirements set out by the
746+ * spec. Obtains the current memory map, and returns that info after calling
747+ * ExitBootServices. The client must specify a function to perform any
748+ * processing of the memory map data prior to ExitBootServices. A client
749+ * specific structure may be passed to the function via priv. The client
750+ * function may be called multiple times.
751+ */
752+efi_status_t efi_exit_boot_services(efi_system_table_t *sys_table_arg,
753+ void *handle,
754+ struct efi_boot_memmap *map,
755+ void *priv,
756+ efi_exit_boot_map_processing priv_func)
757+{
758+ efi_status_t status;
759+
760+ status = efi_get_memory_map(sys_table_arg, map);
761+
762+ if (status != EFI_SUCCESS)
763+ goto fail;
764+
765+ status = priv_func(sys_table_arg, map, priv);
766+ if (status != EFI_SUCCESS)
767+ goto free_map;
768+
769+ status = efi_call_early(exit_boot_services, handle, *map->key_ptr);
770+
771+ if (status == EFI_INVALID_PARAMETER) {
772+ /*
773+ * The memory map changed between efi_get_memory_map() and
774+ * exit_boot_services(). Per the UEFI Spec v2.6, Section 6.4:
775+ * EFI_BOOT_SERVICES.ExitBootServices we need to get the
776+ * updated map, and try again. The spec implies one retry
777+ * should be sufficent, which is confirmed against the EDK2
778+ * implementation. Per the spec, we can only invoke
779+ * get_memory_map() and exit_boot_services() - we cannot alloc
780+ * so efi_get_memory_map() cannot be used, and we must reuse
781+ * the buffer. For all practical purposes, the headroom in the
782+ * buffer should account for any changes in the map so the call
783+ * to get_memory_map() is expected to succeed here.
784+ */
785+ *map->map_size = *map->buff_size;
786+ status = efi_call_early(get_memory_map,
787+ map->map_size,
788+ *map->map,
789+ map->key_ptr,
790+ map->desc_size,
791+ map->desc_ver);
792+
793+ /* exit_boot_services() was called, thus cannot free */
794+ if (status != EFI_SUCCESS)
795+ goto fail;
796+
797+ status = priv_func(sys_table_arg, map, priv);
798+ /* exit_boot_services() was called, thus cannot free */
799+ if (status != EFI_SUCCESS)
800+ goto fail;
801+
802+ status = efi_call_early(exit_boot_services, handle, *map->key_ptr);
803+ }
804+
805+ /* exit_boot_services() was called, thus cannot free */
806+ if (status != EFI_SUCCESS)
807+ goto fail;
808+
809+ return EFI_SUCCESS;
810+
811+free_map:
812+ efi_call_early(free_pool, *map->map);
813+fail:
814+ return status;
815+}
drivers/firmware/efi/libstub/fdt.c+39−15
@@ -152,6 +152,27 @@ fdt_set_fail: · 151 unmodified lines
152152 #define EFI_FDT_ALIGN EFI_PAGE_SIZE
153153 #endif
154154
155+struct exit_boot_struct {
156+ efi_memory_desc_t *runtime_map;
157+ int *runtime_entry_count;
158+};
159+
160+static efi_status_t exit_boot_func(efi_system_table_t *sys_table_arg,
161+ struct efi_boot_memmap *map,
162+ void *priv)
163+{
164+ struct exit_boot_struct *p = priv;
165+ /*
166+ * Update the memory map with virtual addresses. The function will also
167+ * populate @runtime_map with copies of just the EFI_MEMORY_RUNTIME
168+ * entries so that we can pass it straight to SetVirtualAddressMap()
169+ */
170+ efi_get_virtmap(*map->map, *map->map_size, *map->desc_size,
171+ p->runtime_map, p->runtime_entry_count);
172+
173+ return EFI_SUCCESS;
174+}
175+
155176 /*
156177 * Allocate memory for a new FDT, then add EFI, commandline, and
157178 * initrd related fields to the FDT. This routine increases the
@@ -175,13 +196,22 @@ efi_status_t allocate_new_fdt_and_exit_boot(efi_system_table_t *sys_table, · 17 unmodified lines
175196 unsigned long fdt_addr,
176197 unsigned long fdt_size)
177198 {
178− unsigned long map_size, desc_size;
199+ unsigned long map_size, desc_size, buff_size;
179200 u32 desc_ver;
180201 unsigned long mmap_key;
181202 efi_memory_desc_t *memory_map, *runtime_map;
182203 unsigned long new_fdt_size;
183204 efi_status_t status;
184205 int runtime_entry_count = 0;
206+ struct efi_boot_memmap map;
207+ struct exit_boot_struct priv;
208+
209+ map.map = &runtime_map;
210+ map.map_size = &map_size;
211+ map.desc_size = &desc_size;
212+ map.desc_ver = &desc_ver;
213+ map.key_ptr = &mmap_key;
214+ map.buff_size = &buff_size;
185215
186216 /*
187217 * Get a copy of the current memory map that we will use to prepare
@@ -189,8 +219,7 @@ efi_status_t allocate_new_fdt_and_exit_boot(efi_system_table_t *sys_table, · 1 unmodified line
189219 * subsequent allocations adding entries, since they could not affect
190220 * the number of EFI_MEMORY_RUNTIME regions.
191221 */
192− status = efi_get_memory_map(sys_table, &runtime_map, &map_size,
193− &desc_size, &desc_ver, &mmap_key);
222+ status = efi_get_memory_map(sys_table, &map);
194223 if (status != EFI_SUCCESS) {
195224 pr_efi_err(sys_table, "Unable to retrieve UEFI memory map.\n");
196225 return status;
@@ -199,6 +228,7 @@ efi_status_t allocate_new_fdt_and_exit_boot(efi_system_table_t *sys_table, · 2 unmodified lines
199228 pr_efi(sys_table,
200229 "Exiting boot services and installing virtual address map...\n");
201230
231+ map.map = &memory_map;
202232 /*
203233 * Estimate size of new FDT, and allocate memory for it. We
204234 * will allocate a bigger buffer if this ends up being too
@@ -218,8 +248,7 @@ efi_status_t allocate_new_fdt_and_exit_boot(efi_system_table_t *sys_table, · 13 unmodified lines
218248 * we can get the memory map key needed for
219249 * exit_boot_services().
220250 */
221− status = efi_get_memory_map(sys_table, &memory_map, &map_size,
222− &desc_size, &desc_ver, &mmap_key);
251+ status = efi_get_memory_map(sys_table, &map);
223252 if (status != EFI_SUCCESS)
224253 goto fail_free_new_fdt;
225254
@@ -250,16 +279,11 @@ efi_status_t allocate_new_fdt_and_exit_boot(efi_system_table_t *sys_table, · 24 unmodified lines
250279 }
251280 }
252281
253− /*
254− * Update the memory map with virtual addresses. The function will also
255− * populate @runtime_map with copies of just the EFI_MEMORY_RUNTIME
256− * entries so that we can pass it straight into SetVirtualAddressMap()
257− */
258− efi_get_virtmap(memory_map, map_size, desc_size, runtime_map,
259− &runtime_entry_count);
260−
261− /* Now we are ready to exit_boot_services.*/
262− status = sys_table->boottime->exit_boot_services(handle, mmap_key);
282+ sys_table->boottime->free_pool(memory_map);
283+ priv.runtime_map = runtime_map;
284+ priv.runtime_entry_count = &runtime_entry_count;
285+ status = efi_exit_boot_services(sys_table, handle, &map, &priv,
286+ exit_boot_func);
263287
264288 if (status == EFI_SUCCESS) {
265289 efi_set_virtual_address_map_t *svam;
drivers/firmware/efi/libstub/random.c+10−2
@@ -73,12 +73,20 @@ efi_status_t efi_random_alloc(efi_system_table_t *sys_table_arg, · 72 unmodified lines
7373 unsigned long random_seed)
7474 {
7575 unsigned long map_size, desc_size, total_slots = 0, target_slot;
76+ unsigned long buff_size;
7677 efi_status_t status;
7778 efi_memory_desc_t *memory_map;
7879 int map_offset;
80+ struct efi_boot_memmap map;
7981
80− status = efi_get_memory_map(sys_table_arg, &memory_map, &map_size,
81− &desc_size, NULL, NULL);
82+ map.map = &memory_map;
83+ map.map_size = &map_size;
84+ map.desc_size = &desc_size;
85+ map.desc_ver = NULL;
86+ map.key_ptr = NULL;
87+ map.buff_size = &buff_size;
88+
89+ status = efi_get_memory_map(sys_table_arg, &map);
8290 if (status != EFI_SUCCESS)
8391 return status;
8492
drivers/gpio/Kconfig+7−5
@@ -50,6 +50,7 @@ config GPIO_DEVRES · 49 unmodified lines
5050 config OF_GPIO
5151 def_bool y
5252 depends on OF
53+ depends on HAS_IOMEM
5354
5455 config GPIO_ACPI
5556 def_bool y
@@ -188,7 +189,7 @@ config GPIO_EP93XX · 132 unmodified lines
188189 config GPIO_ETRAXFS
189190 bool "Axis ETRAX FS General I/O"
190191 depends on CRIS || COMPILE_TEST
191− depends on OF
192+ depends on OF_GPIO
192193 select GPIO_GENERIC
193194 select GPIOLIB_IRQCHIP
194195 help
@@ -214,7 +215,7 @@ config GPIO_GENERIC_PLATFORM · 19 unmodified lines
214215
215216 config GPIO_GRGPIO
216217 tristate "Aeroflex Gaisler GRGPIO support"
217− depends on OF
218+ depends on OF_GPIO
218219 select GPIO_GENERIC
219220 select IRQ_DOMAIN
220221 help
@@ -312,7 +313,7 @@ config GPIO_MPC8XXX · 91 unmodified lines
312313 config GPIO_MVEBU
313314 def_bool y
314315 depends on PLAT_ORION
315− depends on OF
316+ depends on OF_GPIO
316317 select GENERIC_IRQ_CHIP
317318
318319 config GPIO_MXC
@@ -405,7 +406,7 @@ config GPIO_TEGRA · 86 unmodified lines
405406 bool "NVIDIA Tegra GPIO support"
406407 default ARCH_TEGRA
407408 depends on ARCH_TEGRA || COMPILE_TEST
408− depends on OF
409+ depends on OF_GPIO
409410 help
410411 Say yes here to support GPIO pins on NVIDIA Tegra SoCs.
411412
@@ -1099,7 +1100,7 @@ menu "SPI GPIO expanders" · 687 unmodified lines
10991100
11001101 config GPIO_74X164
11011102 tristate "74x164 serial-in/parallel-out 8-bits shift register"
1102− depends on OF
1103+ depends on OF_GPIO
11031104 help
11041105 Driver for 74x164 compatible serial-in/parallel-out 8-outputs
11051106 shift registers. This driver can be used to provide access
@@ -1130,6 +1131,7 @@ menu "SPI or I2C GPIO expanders" · 24 unmodified lines
11301131
11311132 config GPIO_MCP23S08
11321133 tristate "Microchip MCP23xxx I/O expander"
1134+ depends on OF_GPIO
11331135 select GPIOLIB_IRQCHIP
11341136 help
11351137 SPI/I2C driver for Microchip MCP23S08/MCP23S17/MCP23008/MCP23017
drivers/gpio/gpio-max730x.c+4−4
@@ -192,6 +192,10 @@ int __max730x_probe(struct max7301 *ts) · 191 unmodified lines
192192 ts->chip.parent = dev;
193193 ts->chip.owner = THIS_MODULE;
194194
195+ ret = gpiochip_add_data(&ts->chip, ts);
196+ if (ret)
197+ goto exit_destroy;
198+
195199 /*
196200 * initialize pullups according to platform data and cache the
197201 * register values for later use.
@@ -213,10 +217,6 @@ int __max730x_probe(struct max7301 *ts) · 15 unmodified lines
213217 }
214218 }
215219
216− ret = gpiochip_add_data(&ts->chip, ts);
217− if (ret)
218− goto exit_destroy;
219−
220220 return ret;
221221
222222 exit_destroy:
drivers/gpio/gpio-mcp23s08.c+1−1
@@ -564,7 +564,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev, · 563 unmodified lines
564564 mcp->chip.direction_output = mcp23s08_direction_output;
565565 mcp->chip.set = mcp23s08_set;
566566 mcp->chip.dbg_show = mcp23s08_dbg_show;
567−#ifdef CONFIG_OF
567+#ifdef CONFIG_OF_GPIO
568568 mcp->chip.of_gpio_n_cells = 2;
569569 mcp->chip.of_node = dev->of_node;
570570 #endif
drivers/gpio/gpio-sa1100.c+1−1
@@ -155,7 +155,7 @@ static int sa1100_gpio_irqdomain_map(struct irq_domain *d, · 154 unmodified lines
155155 {
156156 irq_set_chip_and_handler(irq, &sa1100_gpio_irq_chip,
157157 handle_edge_irq);
158− irq_set_noprobe(irq);
158+ irq_set_probe(irq);
159159
160160 return 0;
161161 }
drivers/gpio/gpiolib-of.c+0−1
@@ -16,7 +16,6 @@ · 15 unmodified lines
1616 #include <linux/errno.h>
1717 #include <linux/module.h>
1818 #include <linux/io.h>
19−#include <linux/io-mapping.h>
2019 #include <linux/gpio/consumer.h>
2120 #include <linux/of.h>
2221 #include <linux/of_address.h>
drivers/gpu/drm/amd/amdgpu/amdgpu.h+2−3
@@ -407,7 +407,6 @@ unsigned amdgpu_fence_count_emitted(struct amdgpu_ring *ring); · 406 unmodified lines
407407 /*
408408 * BO.
409409 */
410−
411410 struct amdgpu_bo_list_entry {
412411 struct amdgpu_bo *robj;
413412 struct ttm_validate_buffer tv;
@@ -620,9 +619,9 @@ int amdgpu_gart_table_vram_pin(struct amdgpu_device *adev); · 206 unmodified lines
620619 void amdgpu_gart_table_vram_unpin(struct amdgpu_device *adev);
621620 int amdgpu_gart_init(struct amdgpu_device *adev);
622621 void amdgpu_gart_fini(struct amdgpu_device *adev);
623−void amdgpu_gart_unbind(struct amdgpu_device *adev, unsigned offset,
622+void amdgpu_gart_unbind(struct amdgpu_device *adev, uint64_t offset,
624623 int pages);
625−int amdgpu_gart_bind(struct amdgpu_device *adev, unsigned offset,
624+int amdgpu_gart_bind(struct amdgpu_device *adev, uint64_t offset,
626625 int pages, struct page **pagelist,
627626 dma_addr_t *dma_addr, uint32_t flags);
628627 int amdgpu_ttm_recover_gart(struct amdgpu_device *adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c+13−0
@@ -348,6 +348,19 @@ bool amdgpu_atombios_get_connector_info_from_object_table(struct amdgpu_device * · 347 unmodified lines
348348 (le16_to_cpu(path->usConnObjectId) &
349349 OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT;
350350
351+ /* Skip TV/CV support */
352+ if ((le16_to_cpu(path->usDeviceTag) ==
353+ ATOM_DEVICE_TV1_SUPPORT) ||
354+ (le16_to_cpu(path->usDeviceTag) ==
355+ ATOM_DEVICE_CV_SUPPORT))
356+ continue;
357+
358+ if (con_obj_id >= ARRAY_SIZE(object_connector_convert)) {
359+ DRM_ERROR("invalid con_obj_id %d for device tag 0x%04x\n",
360+ con_obj_id, le16_to_cpu(path->usDeviceTag));
361+ continue;
362+ }
363+
351364 connector_type =
352365 object_connector_convert[con_obj_id];
353366 connector_object_id = con_obj_id;
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c+0−9
@@ -205,16 +205,7 @@ static int amdgpu_atpx_validate(struct amdgpu_atpx *atpx) · 204 unmodified lines
205205 atpx->is_hybrid = false;
206206 if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) {
207207 printk("ATPX Hybrid Graphics\n");
208−#if 1
209− /* This is a temporary hack until the D3 cold support
210− * makes it upstream. The ATPX power_control method seems
211− * to still work on even if the system should be using
212− * the new standardized hybrid D3 cold ACPI interface.
213− */
214− atpx->functions.power_cntl = true;
215−#else
216208 atpx->functions.power_cntl = false;
217−#endif
218209 atpx->is_hybrid = true;
219210 }
220211
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c+2−2
@@ -221,7 +221,7 @@ void amdgpu_gart_table_vram_free(struct amdgpu_device *adev) · 220 unmodified lines
221221 * Unbinds the requested pages from the gart page table and
222222 * replaces them with the dummy page (all asics).
223223 */
224−void amdgpu_gart_unbind(struct amdgpu_device *adev, unsigned offset,
224+void amdgpu_gart_unbind(struct amdgpu_device *adev, uint64_t offset,
225225 int pages)
226226 {
227227 unsigned t;
@@ -268,7 +268,7 @@ void amdgpu_gart_unbind(struct amdgpu_device *adev, unsigned offset, · 40 unmodified lines
268268 * (all asics).
269269 * Returns 0 for success, -EINVAL for failure.
270270 */
271−int amdgpu_gart_bind(struct amdgpu_device *adev, unsigned offset,
271+int amdgpu_gart_bind(struct amdgpu_device *adev, uint64_t offset,
272272 int pages, struct page **pagelist, dma_addr_t *dma_addr,
273273 uint32_t flags)
274274 {
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c+3−2
@@ -295,7 +295,7 @@ void amdgpu_ib_pool_fini(struct amdgpu_device *adev) · 294 unmodified lines
295295 int amdgpu_ib_ring_tests(struct amdgpu_device *adev)
296296 {
297297 unsigned i;
298− int r;
298+ int r, ret = 0;
299299
300300 for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
301301 struct amdgpu_ring *ring = adev->rings[i];
@@ -316,10 +316,11 @@ int amdgpu_ib_ring_tests(struct amdgpu_device *adev) · 14 unmodified lines
316316 } else {
317317 /* still not good, but we can live with it */
318318 DRM_ERROR("amdgpu: failed testing IB on ring %d (%d).\n", i, r);
319+ ret = r;
319320 }
320321 }
321322 }
322− return 0;
323+ return ret;
323324 }
324325
325326 /*
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c+2−2
@@ -273,8 +273,8 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo, · 272 unmodified lines
273273
274274 adev = amdgpu_get_adev(bo->bdev);
275275 ring = adev->mman.buffer_funcs_ring;
276− old_start = old_mem->start << PAGE_SHIFT;
277− new_start = new_mem->start << PAGE_SHIFT;
276+ old_start = (u64)old_mem->start << PAGE_SHIFT;
277+ new_start = (u64)new_mem->start << PAGE_SHIFT;
278278
279279 switch (old_mem->mem_type) {
280280 case TTM_PL_TT:
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c+2−1
@@ -1154,7 +1154,8 @@ int amdgpu_uvd_ring_test_ib(struct amdgpu_ring *ring, long timeout) · 1153 unmodified lines
11541154 r = 0;
11551155 }
11561156
1157−error:
11581157 fence_put(fence);
1158+
1159+error:
11591160 return r;
11601161 }
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c+4−1
@@ -1593,7 +1593,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm) · 1592 unmodified lines
15931593 r = amd_sched_entity_init(&ring->sched, &vm->entity,
15941594 rq, amdgpu_sched_jobs);
15951595 if (r)
1596− return r;
1596+ goto err;
15971597
15981598 vm->page_directory_fence = NULL;
15991599
@@ -1624,6 +1624,9 @@ error_free_page_directory: · 24 unmodified lines
16241624 error_free_sched_entity:
16251625 amd_sched_entity_fini(&ring->sched, &vm->entity);
16261626
1627+err:
1628+ drm_free_large(vm->page_tables);
1629+
16271630 return r;
16281631 }
16291632
drivers/gpu/drm/amd/amdgpu/cik_sdma.c+3−0
@@ -52,6 +52,7 @@ static void cik_sdma_set_ring_funcs(struct amdgpu_device *adev); · 51 unmodified lines
5252 static void cik_sdma_set_irq_funcs(struct amdgpu_device *adev);
5353 static void cik_sdma_set_buffer_funcs(struct amdgpu_device *adev);
5454 static void cik_sdma_set_vm_pte_funcs(struct amdgpu_device *adev);
55+static int cik_sdma_soft_reset(void *handle);
5556
5657 MODULE_FIRMWARE("radeon/bonaire_sdma.bin");
5758 MODULE_FIRMWARE("radeon/bonaire_sdma1.bin");
@@ -1014,6 +1015,8 @@ static int cik_sdma_resume(void *handle) · 956 unmodified lines
10141015 {
10151016 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
10161017
1018+ cik_sdma_soft_reset(handle);
1019+
10171020 return cik_sdma_hw_init(adev);
10181021 }
10191022
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c+9−3
@@ -2927,8 +2927,7 @@ static int gfx_v7_0_cp_compute_resume(struct amdgpu_device *adev) · 2926 unmodified lines
29272927 u64 wb_gpu_addr;
29282928 u32 *buf;
29292929 struct bonaire_mqd *mqd;
2930−
2931− gfx_v7_0_cp_compute_enable(adev, true);
2930+ struct amdgpu_ring *ring;
29322931
29332932 /* fix up chicken bits */
29342933 tmp = RREG32(mmCP_CPF_DEBUG);
@@ -2963,7 +2962,7 @@ static int gfx_v7_0_cp_compute_resume(struct amdgpu_device *adev) · 28 unmodified lines
29632962
29642963 /* init the queues. Just two for now. */
29652964 for (i = 0; i < adev->gfx.num_compute_rings; i++) {
2966− struct amdgpu_ring *ring = &adev->gfx.compute_ring[i];
2965+ ring = &adev->gfx.compute_ring[i];
29672966
29682967 if (ring->mqd_obj == NULL) {
29692968 r = amdgpu_bo_create(adev,
@@ -3142,6 +3141,13 @@ static int gfx_v7_0_cp_compute_resume(struct amdgpu_device *adev) · 172 unmodified lines
31423141 amdgpu_bo_unreserve(ring->mqd_obj);
31433142
31443143 ring->ready = true;
3144+ }
3145+
3146+ gfx_v7_0_cp_compute_enable(adev, true);
3147+
3148+ for (i = 0; i < adev->gfx.num_compute_rings; i++) {
3149+ ring = &adev->gfx.compute_ring[i];
3150+
31453151 r = amdgpu_ring_test_ring(ring);
31463152 if (r)
31473153 ring->ready = false;
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c+1−1
@@ -710,7 +710,7 @@ static int sdma_v2_4_ring_test_ib(struct amdgpu_ring *ring, long timeout) · 709 unmodified lines
710710 DRM_ERROR("amdgpu: IB test timed out\n");
711711 r = -ETIMEDOUT;
712712 goto err1;
713− } else if (r) {
713+ } else if (r < 0) {
714714 DRM_ERROR("amdgpu: fence wait failed (%ld).\n", r);
715715 goto err1;
716716 }
drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c+1−1
@@ -186,7 +186,7 @@ u32 __iomem *kfd_get_kernel_doorbell(struct kfd_dev *kfd, · 185 unmodified lines
186186 sizeof(u32)) + inx;
187187
188188 pr_debug("kfd: get kernel queue doorbell\n"
189− " doorbell offset == 0x%08d\n"
189+ " doorbell offset == 0x%08X\n"
190190 " kernel address == 0x%08lX\n",
191191 *doorbell_off, (uintptr_t)(kfd->doorbell_kernel_ptr + inx));
192192
drivers/gpu/drm/amd/scheduler/gpu_scheduler.c+1−1
@@ -405,7 +405,7 @@ void amd_sched_job_recovery(struct amd_gpu_scheduler *sched) · 404 unmodified lines
405405 spin_lock(&sched->job_list_lock);
406406 s_job = list_first_entry_or_null(&sched->ring_mirror_list,
407407 struct amd_sched_job, node);
408− if (s_job)
408+ if (s_job && sched->timeout != MAX_SCHEDULE_TIMEOUT)
409409 schedule_delayed_work(&s_job->work_tdr, sched->timeout);
410410
411411 list_for_each_entry_safe(s_job, tmp, &sched->ring_mirror_list, node) {
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c+1−1
@@ -387,7 +387,7 @@ void atmel_hlcdc_crtc_irq(struct drm_crtc *c) · 386 unmodified lines
387387 atmel_hlcdc_crtc_finish_page_flip(drm_crtc_to_atmel_hlcdc_crtc(c));
388388 }
389389
390−void atmel_hlcdc_crtc_reset(struct drm_crtc *crtc)
390+static void atmel_hlcdc_crtc_reset(struct drm_crtc *crtc)
391391 {
392392 struct atmel_hlcdc_crtc_state *state;
393393
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c+5−5
@@ -320,19 +320,19 @@ atmel_hlcdc_plane_update_pos_and_size(struct atmel_hlcdc_plane *plane, · 319 unmodified lines
320320 u32 *coeff_tab = heo_upscaling_ycoef;
321321 u32 max_memsize;
322322
323− if (state->crtc_w < state->src_w)
323+ if (state->crtc_h < state->src_h)
324324 coeff_tab = heo_downscaling_ycoef;
325325 for (i = 0; i < ARRAY_SIZE(heo_upscaling_ycoef); i++)
326326 atmel_hlcdc_layer_update_cfg(&plane->layer,
327327 33 + i,
328328 0xffffffff,
329329 coeff_tab[i]);
330− factor = ((8 * 256 * state->src_w) - (256 * 4)) /
331− state->crtc_w;
330+ factor = ((8 * 256 * state->src_h) - (256 * 4)) /
331+ state->crtc_h;
332332 factor++;
333− max_memsize = ((factor * state->crtc_w) + (256 * 4)) /
333+ max_memsize = ((factor * state->crtc_h) + (256 * 4)) /
334334 2048;
335− if (max_memsize > state->src_w)
335+ if (max_memsize > state->src_h)
336336 factor--;
337337 factor_reg |= (factor << 16) | 0x80000000;
338338 }
drivers/gpu/drm/drm_atomic.c+3−3
@@ -475,7 +475,7 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc, · 474 unmodified lines
475475 val,
476476 -1,
477477 &replaced);
478− state->color_mgmt_changed = replaced;
478+ state->color_mgmt_changed |= replaced;
479479 return ret;
480480 } else if (property == config->ctm_property) {
481481 ret = drm_atomic_replace_property_blob_from_id(crtc,
@@ -483,7 +483,7 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc, · 1 unmodified line
483483 val,
484484 sizeof(struct drm_color_ctm),
485485 &replaced);
486− state->color_mgmt_changed = replaced;
486+ state->color_mgmt_changed |= replaced;
487487 return ret;
488488 } else if (property == config->gamma_lut_property) {
489489 ret = drm_atomic_replace_property_blob_from_id(crtc,
@@ -491,7 +491,7 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc, · 1 unmodified line
491491 val,
492492 -1,
493493 &replaced);
494− state->color_mgmt_changed = replaced;
494+ state->color_mgmt_changed |= replaced;
495495 return ret;
496496 } else if (crtc->funcs->atomic_set_property)
497497 return crtc->funcs->atomic_set_property(crtc, state, property, val);
drivers/gpu/drm/drm_fb_helper.c+1−1
@@ -466,7 +466,7 @@ static bool drm_fb_helper_is_bound(struct drm_fb_helper *fb_helper) · 465 unmodified lines
466466
467467 /* Sometimes user space wants everything disabled, so don't steal the
468468 * display if there's a master. */
469− if (lockless_dereference(dev->master))
469+ if (READ_ONCE(dev->master))
470470 return false;
471471
472472 drm_for_each_crtc(crtc, dev) {
drivers/gpu/drm/exynos/exynos_drm_fb.c+3−3
@@ -55,11 +55,11 @@ static int check_fb_gem_memory_type(struct drm_device *drm_dev, · 54 unmodified lines
5555 flags = exynos_gem->flags;
5656
5757 /*
58− * without iommu support, not support physically non-continuous memory
59− * for framebuffer.
58+ * Physically non-contiguous memory type for framebuffer is not
59+ * supported without IOMMU.
6060 */
6161 if (IS_NONCONTIG_BUFFER(flags)) {
62− DRM_ERROR("cannot use this gem memory type for fb.\n");
62+ DRM_ERROR("Non-contiguous GEM memory is not supported.\n");
6363 return -EINVAL;
6464 }
6565
drivers/gpu/drm/exynos/exynos_drm_fimc.c+2−27
@@ -1753,32 +1753,6 @@ static int fimc_clk_ctrl(struct fimc_context *ctx, bool enable) · 1752 unmodified lines
17531753 return 0;
17541754 }
17551755
1756−#ifdef CONFIG_PM_SLEEP
1757−static int fimc_suspend(struct device *dev)
1758−{
1759− struct fimc_context *ctx = get_fimc_context(dev);
1760−
1761− DRM_DEBUG_KMS("id[%d]\n", ctx->id);
1762−
1763− if (pm_runtime_suspended(dev))
1764− return 0;
1765−
1766− return fimc_clk_ctrl(ctx, false);
1767−}
1768−
1769−static int fimc_resume(struct device *dev)
1770−{
1771− struct fimc_context *ctx = get_fimc_context(dev);
1772−
1773− DRM_DEBUG_KMS("id[%d]\n", ctx->id);
1774−
1775− if (!pm_runtime_suspended(dev))
1776− return fimc_clk_ctrl(ctx, true);
1777−
1778− return 0;
1779−}
1780−#endif
1781−
17821756 static int fimc_runtime_suspend(struct device *dev)
17831757 {
17841758 struct fimc_context *ctx = get_fimc_context(dev);
@@ -1799,7 +1773,8 @@ static int fimc_runtime_resume(struct device *dev) · 14 unmodified lines
17991773 #endif
18001774
18011775 static const struct dev_pm_ops fimc_pm_ops = {
1802− SET_SYSTEM_SLEEP_PM_OPS(fimc_suspend, fimc_resume)
1776+ SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
1777+ pm_runtime_force_resume)
18031778 SET_RUNTIME_PM_OPS(fimc_runtime_suspend, fimc_runtime_resume, NULL)
18041779 };
18051780
drivers/gpu/drm/exynos/exynos_drm_g2d.c+7−22
@@ -1475,8 +1475,8 @@ static int g2d_remove(struct platform_device *pdev) · 1474 unmodified lines
14751475 return 0;
14761476 }
14771477
1478−#ifdef CONFIG_PM_SLEEP
1479−static int g2d_suspend(struct device *dev)
1478+#ifdef CONFIG_PM
1479+static int g2d_runtime_suspend(struct device *dev)
14801480 {
14811481 struct g2d_data *g2d = dev_get_drvdata(dev);
14821482
@@ -1490,25 +1490,6 @@ static int g2d_suspend(struct device *dev) · 7 unmodified lines
14901490
14911491 flush_work(&g2d->runqueue_work);
14921492
1493− return 0;
1494−}
1495−
1496−static int g2d_resume(struct device *dev)
1497−{
1498− struct g2d_data *g2d = dev_get_drvdata(dev);
1499−
1500− g2d->suspended = false;
1501− g2d_exec_runqueue(g2d);
1502−
1503− return 0;
1504−}
1505−#endif
1506−
1507−#ifdef CONFIG_PM
1508−static int g2d_runtime_suspend(struct device *dev)
1509−{
1510− struct g2d_data *g2d = dev_get_drvdata(dev);
1511−
15121493 clk_disable_unprepare(g2d->gate_clk);
15131494
15141495 return 0;
@@ -1523,12 +1504,16 @@ static int g2d_runtime_resume(struct device *dev) · 8 unmodified lines
15231504 if (ret < 0)
15241505 dev_warn(dev, "failed to enable clock.\n");
15251506
1507+ g2d->suspended = false;
1508+ g2d_exec_runqueue(g2d);
1509+
15261510 return ret;
15271511 }
15281512 #endif
15291513
15301514 static const struct dev_pm_ops g2d_pm_ops = {
1531− SET_SYSTEM_SLEEP_PM_OPS(g2d_suspend, g2d_resume)
1515+ SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
1516+ pm_runtime_force_resume)
15321517 SET_RUNTIME_PM_OPS(g2d_runtime_suspend, g2d_runtime_resume, NULL)
15331518 };
15341519
drivers/gpu/drm/exynos/exynos_drm_gsc.c+4−31
@@ -1760,34 +1760,7 @@ static int gsc_remove(struct platform_device *pdev) · 1759 unmodified lines
17601760 return 0;
17611761 }
17621762
1763−#ifdef CONFIG_PM_SLEEP
1764−static int gsc_suspend(struct device *dev)
1765−{
1766− struct gsc_context *ctx = get_gsc_context(dev);
1767−
1768− DRM_DEBUG_KMS("id[%d]\n", ctx->id);
1769−
1770− if (pm_runtime_suspended(dev))
1771− return 0;
1772−
1773− return gsc_clk_ctrl(ctx, false);
1774−}
1775−
1776−static int gsc_resume(struct device *dev)
1777−{
1778− struct gsc_context *ctx = get_gsc_context(dev);
1779−
1780− DRM_DEBUG_KMS("id[%d]\n", ctx->id);
1781−
1782− if (!pm_runtime_suspended(dev))
1783− return gsc_clk_ctrl(ctx, true);
1784−
1785− return 0;
1786−}
1787−#endif
1788−
1789−#ifdef CONFIG_PM
1790−static int gsc_runtime_suspend(struct device *dev)
1763+static int __maybe_unused gsc_runtime_suspend(struct device *dev)
17911764 {
17921765 struct gsc_context *ctx = get_gsc_context(dev);
17931766
@@ -1796,7 +1769,7 @@ static int gsc_runtime_suspend(struct device *dev) · 2 unmodified lines
17961769 return gsc_clk_ctrl(ctx, false);
17971770 }
17981771
1799−static int gsc_runtime_resume(struct device *dev)
1772+static int __maybe_unused gsc_runtime_resume(struct device *dev)
18001773 {
18011774 struct gsc_context *ctx = get_gsc_context(dev);
18021775
@@ -1804,10 +1777,10 @@ static int gsc_runtime_resume(struct device *dev) · 1 unmodified line
18041777
18051778 return gsc_clk_ctrl(ctx, true);
18061779 }
1807−#endif
18081780
18091781 static const struct dev_pm_ops gsc_pm_ops = {
1810− SET_SYSTEM_SLEEP_PM_OPS(gsc_suspend, gsc_resume)
1782+ SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
1783+ pm_runtime_force_resume)
18111784 SET_RUNTIME_PM_OPS(gsc_runtime_suspend, gsc_runtime_resume, NULL)
18121785 };
18131786
drivers/gpu/drm/exynos/exynos_drm_rotator.c+2−24
@@ -794,29 +794,6 @@ static int rotator_clk_crtl(struct rot_context *rot, bool enable) · 793 unmodified lines
794794 return 0;
795795 }
796796
797−
798−#ifdef CONFIG_PM_SLEEP
799−static int rotator_suspend(struct device *dev)
800−{
801− struct rot_context *rot = dev_get_drvdata(dev);
802−
803− if (pm_runtime_suspended(dev))
804− return 0;
805−
806− return rotator_clk_crtl(rot, false);
807−}
808−
809−static int rotator_resume(struct device *dev)
810−{
811− struct rot_context *rot = dev_get_drvdata(dev);
812−
813− if (!pm_runtime_suspended(dev))
814− return rotator_clk_crtl(rot, true);
815−
816− return 0;
817−}
818−#endif
819−
820797 static int rotator_runtime_suspend(struct device *dev)
821798 {
822799 struct rot_context *rot = dev_get_drvdata(dev);
@@ -833,7 +810,8 @@ static int rotator_runtime_resume(struct device *dev) · 10 unmodified lines
833810 #endif
834811
835812 static const struct dev_pm_ops rotator_pm_ops = {
836− SET_SYSTEM_SLEEP_PM_OPS(rotator_suspend, rotator_resume)
813+ SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
814+ pm_runtime_force_resume)
837815 SET_RUNTIME_PM_OPS(rotator_runtime_suspend, rotator_runtime_resume,
838816 NULL)
839817 };
drivers/gpu/drm/i915/i915_gem.c+3−0
@@ -2616,6 +2616,8 @@ static void i915_gem_reset_engine(struct intel_engine_cs *engine) · 2615 unmodified lines
26162616 list_for_each_entry_continue(request, &engine->request_list, link)
26172617 if (request->ctx == incomplete_ctx)
26182618 reset_request(request);
2619+
2620+ engine->i915->gt.active_engines &= ~intel_engine_flag(engine);
26192621 }
26202622
26212623 void i915_gem_reset(struct drm_i915_private *dev_priv)
@@ -2626,6 +2628,7 @@ void i915_gem_reset(struct drm_i915_private *dev_priv) · 4 unmodified lines
26262628
26272629 for_each_engine(engine, dev_priv)
26282630 i915_gem_reset_engine(engine);
2631+ mod_delayed_work(dev_priv->wq, &dev_priv->gt.idle_work, 0);
26292632
26302633 i915_gem_restore_fences(&dev_priv->drm);
26312634 }
drivers/gpu/drm/i915/intel_display.c+2−0
@@ -3601,6 +3601,8 @@ void intel_finish_reset(struct drm_i915_private *dev_priv) · 3600 unmodified lines
36013601
36023602 dev_priv->modeset_restore_state = NULL;
36033603
3604+ dev_priv->modeset_restore_state = NULL;
3605+
36043606 /* reset doesn't touch the display */
36053607 if (!gpu_reset_clobbers_display(dev_priv)) {
36063608 if (!state) {
drivers/gpu/drm/imx/ipuv3-crtc.c+4−0
@@ -79,6 +79,8 @@ static void ipu_crtc_atomic_disable(struct drm_crtc *crtc, · 78 unmodified lines
7979
8080 /* always disable planes on the CRTC */
8181 drm_atomic_helper_disable_planes_on_crtc(old_crtc_state, true);
82+
83+ drm_crtc_vblank_off(crtc);
8284 }
8385
8486 static void imx_drm_crtc_reset(struct drm_crtc *crtc)
@@ -183,6 +185,8 @@ static int ipu_crtc_atomic_check(struct drm_crtc *crtc, · 98 unmodified lines
183185 static void ipu_crtc_atomic_begin(struct drm_crtc *crtc,
184186 struct drm_crtc_state *old_crtc_state)
185187 {
188+ drm_crtc_vblank_on(crtc);
189+
186190 spin_lock_irq(&crtc->dev->event_lock);
187191 if (crtc->state->event) {
188192 WARN_ON(drm_crtc_vblank_get(crtc));
drivers/gpu/drm/mediatek/Kconfig+3−0
@@ -2,6 +2,9 @@ config DRM_MEDIATEK · 1 unmodified line
22 tristate "DRM Support for Mediatek SoCs"
33 depends on DRM
44 depends on ARCH_MEDIATEK || (ARM && COMPILE_TEST)
5+ depends on COMMON_CLK
6+ depends on HAVE_ARM_SMCCC
7+ depends on OF
58 select DRM_GEM_CMA_HELPER
69 select DRM_KMS_HELPER
710 select DRM_MIPI_DSI
drivers/gpu/drm/msm/msm_drv.h+6−0
@@ -157,6 +157,12 @@ struct msm_drm_private { · 156 unmodified lines
157157 struct shrinker shrinker;
158158
159159 struct msm_vblank_ctrl vblank_ctrl;
160+
161+ /* task holding struct_mutex.. currently only used in submit path
162+ * to detect and reject faults from copy_from_user() for submit
163+ * ioctl.
164+ */
165+ struct task_struct *struct_mutex_task;
160166 };
161167
162168 struct msm_format {
drivers/gpu/drm/msm/msm_gem.c+9−0
@@ -196,11 +196,20 @@ int msm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) · 195 unmodified lines
196196 {
197197 struct drm_gem_object *obj = vma->vm_private_data;
198198 struct drm_device *dev = obj->dev;
199+ struct msm_drm_private *priv = dev->dev_private;
199200 struct page **pages;
200201 unsigned long pfn;
201202 pgoff_t pgoff;
202203 int ret;
203204
205+ /* This should only happen if userspace tries to pass a mmap'd
206+ * but unfaulted gem bo vaddr into submit ioctl, triggering
207+ * a page fault while struct_mutex is already held. This is
208+ * not a valid use-case so just bail.
209+ */
210+ if (priv->struct_mutex_task == current)
211+ return VM_FAULT_SIGBUS;
212+
204213 /* Make sure we don't parallel update on a fault, nor move or remove
205214 * something from beneath our feet
206215 */
drivers/gpu/drm/msm/msm_gem_submit.c+24−5
@@ -66,6 +66,14 @@ void msm_gem_submit_free(struct msm_gem_submit *submit) · 65 unmodified lines
6666 kfree(submit);
6767 }
6868
69+static inline unsigned long __must_check
70+copy_from_user_inatomic(void *to, const void __user *from, unsigned long n)
71+{
72+ if (access_ok(VERIFY_READ, from, n))
73+ return __copy_from_user_inatomic(to, from, n);
74+ return -EFAULT;
75+}
76+
6977 static int submit_lookup_objects(struct msm_gem_submit *submit,
7078 struct drm_msm_gem_submit *args, struct drm_file *file)
7179 {
@@ -73,6 +81,7 @@ static int submit_lookup_objects(struct msm_gem_submit *submit, · 1 unmodified line
7381 int ret = 0;
7482
7583 spin_lock(&file->table_lock);
84+ pagefault_disable();
7685
7786 for (i = 0; i < args->nr_bos; i++) {
7887 struct drm_msm_gem_submit_bo submit_bo;
@@ -86,10 +95,15 @@ static int submit_lookup_objects(struct msm_gem_submit *submit, · 7 unmodified lines
8695 */
8796 submit->bos[i].flags = 0;
8897
89− ret = copy_from_user(&submit_bo, userptr, sizeof(submit_bo));
90− if (ret) {
91− ret = -EFAULT;
92− goto out_unlock;
98+ ret = copy_from_user_inatomic(&submit_bo, userptr, sizeof(submit_bo));
99+ if (unlikely(ret)) {
100+ pagefault_enable();
101+ spin_unlock(&file->table_lock);
102+ ret = copy_from_user(&submit_bo, userptr, sizeof(submit_bo));
103+ if (ret)
104+ goto out;
105+ spin_lock(&file->table_lock);
106+ pagefault_disable();
93107 }
94108
95109 if (submit_bo.flags & ~MSM_SUBMIT_BO_FLAGS) {
@@ -129,9 +143,12 @@ static int submit_lookup_objects(struct msm_gem_submit *submit, · 33 unmodified lines
129143 }
130144
131145 out_unlock:
132− submit->nr_bos = i;
146+ pagefault_enable();
133147 spin_unlock(&file->table_lock);
134148
149+out:
150+ submit->nr_bos = i;
151+
135152 return ret;
136153 }
137154
@@ -392,6 +409,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, · 254 unmodified lines
392409 goto out_unlock;
393410 }
394411 }
412+ priv->struct_mutex_task = current;
395413
396414 submit = submit_create(dev, gpu, args->nr_bos, args->nr_cmds);
397415 if (!submit) {
@@ -531,6 +549,7 @@ out: · 133 unmodified lines
531549 out_unlock:
532550 if (ret && (out_fence_fd >= 0))
533551 put_unused_fd(out_fence_fd);
552+ priv->struct_mutex_task = NULL;
534553 mutex_unlock(&dev->struct_mutex);
535554 return ret;
536555 }
drivers/gpu/drm/nouveau/nouveau_acpi.c+11−0
@@ -225,6 +225,17 @@ static bool nouveau_pr3_present(struct pci_dev *pdev) · 224 unmodified lines
225225 if (!parent_pdev)
226226 return false;
227227
228+ if (!parent_pdev->bridge_d3) {
229+ /*
230+ * Parent PCI bridge is currently not power managed.
231+ * Since userspace can change these afterwards to be on
232+ * the safe side we stick with _DSM and prevent usage of
233+ * _PR3 from the bridge.
234+ */
235+ pci_d3cold_disable(pdev);
236+ return false;
237+ }
238+
228239 parent_adev = ACPI_COMPANION(&parent_pdev->dev);
229240 if (!parent_adev)
230241 return false;
drivers/gpu/drm/radeon/atombios_crtc.c+3−1
@@ -627,7 +627,9 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, · 626 unmodified lines
627627 if (radeon_crtc->ss.refdiv) {
628628 radeon_crtc->pll_flags |= RADEON_PLL_USE_REF_DIV;
629629 radeon_crtc->pll_reference_div = radeon_crtc->ss.refdiv;
630− if (rdev->family >= CHIP_RV770)
630+ if (ASIC_IS_AVIVO(rdev) &&
631+ rdev->family != CHIP_RS780 &&
632+ rdev->family != CHIP_RS880)
631633 radeon_crtc->pll_flags |= RADEON_PLL_USE_FRAC_FB_DIV;
632634 }
633635 }
drivers/gpu/drm/radeon/radeon_atpx_handler.c+0−9
@@ -203,16 +203,7 @@ static int radeon_atpx_validate(struct radeon_atpx *atpx) · 202 unmodified lines
203203 atpx->is_hybrid = false;
204204 if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) {
205205 printk("ATPX Hybrid Graphics\n");
206−#if 1
207− /* This is a temporary hack until the D3 cold support
208− * makes it upstream. The ATPX power_control method seems
209− * to still work on even if the system should be using
210− * the new standardized hybrid D3 cold ACPI interface.
211− */
212− atpx->functions.power_cntl = true;
213−#else
214206 atpx->functions.power_cntl = false;
215−#endif
216207 atpx->is_hybrid = true;
217208 }
218209
drivers/gpu/drm/radeon/radeon_ttm.c+2−2
@@ -264,8 +264,8 @@ static int radeon_move_blit(struct ttm_buffer_object *bo, · 263 unmodified lines
264264
265265 rdev = radeon_get_rdev(bo->bdev);
266266 ridx = radeon_copy_ring_index(rdev);
267− old_start = old_mem->start << PAGE_SHIFT;
268− new_start = new_mem->start << PAGE_SHIFT;
267+ old_start = (u64)old_mem->start << PAGE_SHIFT;
268+ new_start = (u64)new_mem->start << PAGE_SHIFT;
269269
270270 switch (old_mem->mem_type) {
271271 case TTM_PL_VRAM:
drivers/gpu/drm/tegra/dsi.c+36−7
@@ -840,6 +840,21 @@ static const struct drm_encoder_funcs tegra_dsi_encoder_funcs = { · 839 unmodified lines
840840 .destroy = tegra_output_encoder_destroy,
841841 };
842842
843+static void tegra_dsi_unprepare(struct tegra_dsi *dsi)
844+{
845+ int err;
846+
847+ if (dsi->slave)
848+ tegra_dsi_unprepare(dsi->slave);
849+
850+ err = tegra_mipi_disable(dsi->mipi);
851+ if (err < 0)
852+ dev_err(dsi->dev, "failed to disable MIPI calibration: %d\n",
853+ err);
854+
855+ pm_runtime_put(dsi->dev);
856+}
857+
843858 static void tegra_dsi_encoder_disable(struct drm_encoder *encoder)
844859 {
845860 struct tegra_output *output = encoder_to_output(encoder);
@@ -876,7 +891,26 @@ static void tegra_dsi_encoder_disable(struct drm_encoder *encoder) · 30 unmodified lines
876891
877892 tegra_dsi_disable(dsi);
878893
879− pm_runtime_put(dsi->dev);
894+ tegra_dsi_unprepare(dsi);
895+}
896+
897+static void tegra_dsi_prepare(struct tegra_dsi *dsi)
898+{
899+ int err;
900+
901+ pm_runtime_get_sync(dsi->dev);
902+
903+ err = tegra_mipi_enable(dsi->mipi);
904+ if (err < 0)
905+ dev_err(dsi->dev, "failed to enable MIPI calibration: %d\n",
906+ err);
907+
908+ err = tegra_dsi_pad_calibrate(dsi);
909+ if (err < 0)
910+ dev_err(dsi->dev, "MIPI calibration failed: %d\n", err);
911+
912+ if (dsi->slave)
913+ tegra_dsi_prepare(dsi->slave);
880914 }
881915
882916 static void tegra_dsi_encoder_enable(struct drm_encoder *encoder)
@@ -887,13 +921,8 @@ static void tegra_dsi_encoder_enable(struct drm_encoder *encoder) · 4 unmodified lines
887921 struct tegra_dsi *dsi = to_dsi(output);
888922 struct tegra_dsi_state *state;
889923 u32 value;
890− int err;
891−
892− pm_runtime_get_sync(dsi->dev);
893924
894− err = tegra_dsi_pad_calibrate(dsi);
895− if (err < 0)
896− dev_err(dsi->dev, "MIPI calibration failed: %d\n", err);
925+ tegra_dsi_prepare(dsi);
897926
898927 state = tegra_dsi_get_state(dsi);
899928
drivers/gpu/drm/vc4/vc4_bo.c+1−1
@@ -144,7 +144,7 @@ static struct list_head *vc4_get_cache_list_for_size(struct drm_device *dev, · 143 unmodified lines
144144 return &vc4->bo_cache.size_list[page_index];
145145 }
146146
147−void vc4_bo_cache_purge(struct drm_device *dev)
147+static void vc4_bo_cache_purge(struct drm_device *dev)
148148 {
149149 struct vc4_dev *vc4 = to_vc4_dev(dev);
150150
drivers/gpu/drm/vc4/vc4_drv.c+3−3
@@ -58,21 +58,21 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, · 57 unmodified lines
5858 switch (args->param) {
5959 case DRM_VC4_PARAM_V3D_IDENT0:
6060 ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
61− if (ret)
61+ if (ret < 0)
6262 return ret;
6363 args->value = V3D_READ(V3D_IDENT0);
6464 pm_runtime_put(&vc4->v3d->pdev->dev);
6565 break;
6666 case DRM_VC4_PARAM_V3D_IDENT1:
6767 ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
68− if (ret)
68+ if (ret < 0)
6969 return ret;
7070 args->value = V3D_READ(V3D_IDENT1);
7171 pm_runtime_put(&vc4->v3d->pdev->dev);
7272 break;
7373 case DRM_VC4_PARAM_V3D_IDENT2:
7474 ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
75− if (ret)
75+ if (ret < 0)
7676 return ret;
7777 args->value = V3D_READ(V3D_IDENT2);
7878 pm_runtime_put(&vc4->v3d->pdev->dev);
drivers/gpu/drm/vc4/vc4_drv.h+9−0
@@ -321,6 +321,15 @@ vc4_first_render_job(struct vc4_dev *vc4) · 320 unmodified lines
321321 struct vc4_exec_info, head);
322322 }
323323
324+static inline struct vc4_exec_info *
325+vc4_last_render_job(struct vc4_dev *vc4)
326+{
327+ if (list_empty(&vc4->render_job_list))
328+ return NULL;
329+ return list_last_entry(&vc4->render_job_list,
330+ struct vc4_exec_info, head);
331+}
332+
324333 /**
325334 * struct vc4_texture_sample_info - saves the offsets into the UBO for texture
326335 * setup parameters.
drivers/gpu/drm/vc4/vc4_gem.c+9−9
@@ -530,8 +530,8 @@ vc4_cl_lookup_bos(struct drm_device *dev, · 529 unmodified lines
530530 return -EINVAL;
531531 }
532532
533− exec->bo = kcalloc(exec->bo_count, sizeof(struct drm_gem_cma_object *),
534− GFP_KERNEL);
533+ exec->bo = drm_calloc_large(exec->bo_count,
534+ sizeof(struct drm_gem_cma_object *));
535535 if (!exec->bo) {
536536 DRM_ERROR("Failed to allocate validated BO pointers\n");
537537 return -ENOMEM;
@@ -568,8 +568,8 @@ vc4_cl_lookup_bos(struct drm_device *dev, · 30 unmodified lines
568568 spin_unlock(&file_priv->table_lock);
569569
570570 fail:
571− kfree(handles);
572− return 0;
571+ drm_free_large(handles);
572+ return ret;
573573 }
574574
575575 static int
@@ -604,7 +604,7 @@ vc4_get_bcl(struct drm_device *dev, struct vc4_exec_info *exec) · 28 unmodified lines
604604 * read the contents back for validation, and I think the
605605 * bo->vaddr is uncached access.
606606 */
607− temp = kmalloc(temp_size, GFP_KERNEL);
607+ temp = drm_malloc_ab(temp_size, 1);
608608 if (!temp) {
609609 DRM_ERROR("Failed to allocate storage for copying "
610610 "in bin/render CLs.\n");
@@ -671,7 +671,7 @@ vc4_get_bcl(struct drm_device *dev, struct vc4_exec_info *exec) · 60 unmodified lines
671671 ret = vc4_validate_shader_recs(dev, exec);
672672
673673 fail:
674− kfree(temp);
674+ drm_free_large(temp);
675675 return ret;
676676 }
677677
@@ -684,7 +684,7 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) · 6 unmodified lines
684684 if (exec->bo) {
685685 for (i = 0; i < exec->bo_count; i++)
686686 drm_gem_object_unreference_unlocked(&exec->bo[i]->base);
687− kfree(exec->bo);
687+ drm_free_large(exec->bo);
688688 }
689689
690690 while (!list_empty(&exec->unref_list)) {
@@ -938,8 +938,8 @@ vc4_gem_destroy(struct drm_device *dev) · 247 unmodified lines
938938 vc4->overflow_mem = NULL;
939939 }
940940
941− vc4_bo_cache_destroy(dev);
942−
943941 if (vc4->hang_state)
944942 vc4_free_hang_state(dev, vc4->hang_state);
943+
944+ vc4_bo_cache_destroy(dev);
945945 }
drivers/gpu/drm/vc4/vc4_irq.c+3−1
@@ -83,8 +83,10 @@ vc4_overflow_mem_work(struct work_struct *work) · 82 unmodified lines
8383
8484 spin_lock_irqsave(&vc4->job_lock, irqflags);
8585 current_exec = vc4_first_bin_job(vc4);
86+ if (!current_exec)
87+ current_exec = vc4_last_render_job(vc4);
8688 if (current_exec) {
87− vc4->overflow_mem->seqno = vc4->finished_seqno + 1;
89+ vc4->overflow_mem->seqno = current_exec->seqno;
8890 list_add_tail(&vc4->overflow_mem->unref_head,
8991 &current_exec->unref_list);
9092 vc4->overflow_mem = NULL;
drivers/gpu/drm/vc4/vc4_validate_shaders.c+8−2
@@ -309,8 +309,14 @@ validate_uniform_address_write(struct vc4_validated_shader_info *validated_shade · 308 unmodified lines
309309 * of uniforms on each side. However, this scheme is easy to
310310 * validate so it's all we allow for now.
311311 */
312−
313− if (QPU_GET_FIELD(inst, QPU_SIG) != QPU_SIG_NONE) {
312+ switch (QPU_GET_FIELD(inst, QPU_SIG)) {
313+ case QPU_SIG_NONE:
314+ case QPU_SIG_SCOREBOARD_UNLOCK:
315+ case QPU_SIG_COLOR_LOAD:
316+ case QPU_SIG_LOAD_TMU0:
317+ case QPU_SIG_LOAD_TMU1:
318+ break;
319+ default:
314320 DRM_ERROR("uniforms address change must be "
315321 "normal math\n");
316322 return false;
drivers/gpu/host1x/mipi.c+31−32
@@ -242,20 +242,6 @@ struct tegra_mipi_device *tegra_mipi_request(struct device *device) · 241 unmodified lines
242242 dev->pads = args.args[0];
243243 dev->device = device;
244244
245− mutex_lock(&dev->mipi->lock);
246−
247− if (dev->mipi->usage_count++ == 0) {
248− err = tegra_mipi_power_up(dev->mipi);
249− if (err < 0) {
250− dev_err(dev->mipi->dev,
251− "failed to power up MIPI bricks: %d\n",
252− err);
253− return ERR_PTR(err);
254− }
255− }
256−
257− mutex_unlock(&dev->mipi->lock);
258−
259245 return dev;
260246
261247 put:
@@ -270,29 +256,42 @@ EXPORT_SYMBOL(tegra_mipi_request); · 8 unmodified lines
270256
271257 void tegra_mipi_free(struct tegra_mipi_device *device)
272258 {
273− int err;
259+ platform_device_put(device->pdev);
260+ kfree(device);
261+}
262+EXPORT_SYMBOL(tegra_mipi_free);
274263
275− mutex_lock(&device->mipi->lock);
264+int tegra_mipi_enable(struct tegra_mipi_device *dev)
265+{
266+ int err = 0;
276267
277− if (--device->mipi->usage_count == 0) {
278− err = tegra_mipi_power_down(device->mipi);
279− if (err < 0) {
280− /*
281− * Not much that can be done here, so an error message
282− * will have to do.
283− */
284− dev_err(device->mipi->dev,
285− "failed to power down MIPI bricks: %d\n",
286− err);
287− }
288− }
268+ mutex_lock(&dev->mipi->lock);
289269
290− mutex_unlock(&device->mipi->lock);
270+ if (dev->mipi->usage_count++ == 0)
271+ err = tegra_mipi_power_up(dev->mipi);
272+
273+ mutex_unlock(&dev->mipi->lock);
274+
275+ return err;
291276
292− platform_device_put(device->pdev);
293− kfree(device);
294277 }
295−EXPORT_SYMBOL(tegra_mipi_free);
278+EXPORT_SYMBOL(tegra_mipi_enable);
279+
280+int tegra_mipi_disable(struct tegra_mipi_device *dev)
281+{
282+ int err = 0;
283+
284+ mutex_lock(&dev->mipi->lock);
285+
286+ if (--dev->mipi->usage_count == 0)
287+ err = tegra_mipi_power_down(dev->mipi);
288+
289+ mutex_unlock(&dev->mipi->lock);
290+
291+ return err;
292+
293+}
294+EXPORT_SYMBOL(tegra_mipi_disable);
296295
297296 static int tegra_mipi_wait(struct tegra_mipi *mipi)
298297 {
drivers/hwmon/it87.c+2−1
@@ -491,7 +491,7 @@ struct it87_sio_data { · 490 unmodified lines
491491 struct it87_data {
492492 const struct attribute_group *groups[7];
493493 enum chips type;
494− u16 features;
494+ u32 features;
495495 u8 peci_mask;
496496 u8 old_peci_mask;
497497
@@ -2015,6 +2015,7 @@ static struct attribute *it87_attributes_in[] = { · 1517 unmodified lines
20152015 &sensor_dev_attr_in10_input.dev_attr.attr, /* 41 */
20162016 &sensor_dev_attr_in11_input.dev_attr.attr, /* 41 */
20172017 &sensor_dev_attr_in12_input.dev_attr.attr, /* 41 */
2018+ NULL
20182019 };
20192020
20202021 static const struct attribute_group it87_group_in = {
drivers/i2c/busses/i2c-at91.c+14−10
@@ -38,6 +38,7 @@ · 37 unmodified lines
3838 #define AT91_I2C_TIMEOUT msecs_to_jiffies(100) /* transfer timeout */
3939 #define AT91_I2C_DMA_THRESHOLD 8 /* enable DMA if transfer size is bigger than this threshold */
4040 #define AUTOSUSPEND_TIMEOUT 2000
41+#define AT91_I2C_MAX_ALT_CMD_DATA_SIZE 256
4142
4243 /* AT91 TWI register definitions */
4344 #define AT91_TWI_CR 0x0000 /* Control Register */
@@ -141,6 +142,7 @@ struct at91_twi_dev { · 97 unmodified lines
141142 unsigned twi_cwgr_reg;
142143 struct at91_twi_pdata *pdata;
143144 bool use_dma;
145+ bool use_alt_cmd;
144146 bool recv_len_abort;
145147 u32 fifo_size;
146148 struct at91_twi_dma dma;
@@ -269,7 +271,7 @@ static void at91_twi_write_next_byte(struct at91_twi_dev *dev) · 122 unmodified lines
269271
270272 /* send stop when last byte has been written */
271273 if (--dev->buf_len == 0)
272− if (!dev->pdata->has_alt_cmd)
274+ if (!dev->use_alt_cmd)
273275 at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_STOP);
274276
275277 dev_dbg(dev->dev, "wrote 0x%x, to go %d\n", *dev->buf, dev->buf_len);
@@ -292,7 +294,7 @@ static void at91_twi_write_data_dma_callback(void *data) · 16 unmodified lines
292294 * we just have to enable TXCOMP one.
293295 */
294296 at91_twi_write(dev, AT91_TWI_IER, AT91_TWI_TXCOMP);
295− if (!dev->pdata->has_alt_cmd)
297+ if (!dev->use_alt_cmd)
296298 at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_STOP);
297299 }
298300
@@ -410,7 +412,7 @@ static void at91_twi_read_next_byte(struct at91_twi_dev *dev) · 111 unmodified lines
410412 }
411413
412414 /* send stop if second but last byte has been read */
413− if (!dev->pdata->has_alt_cmd && dev->buf_len == 1)
415+ if (!dev->use_alt_cmd && dev->buf_len == 1)
414416 at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_STOP);
415417
416418 dev_dbg(dev->dev, "read 0x%x, to go %d\n", *dev->buf, dev->buf_len);
@@ -426,7 +428,7 @@ static void at91_twi_read_data_dma_callback(void *data) · 9 unmodified lines
426428 dma_unmap_single(dev->dev, sg_dma_address(&dev->dma.sg[0]),
427429 dev->buf_len, DMA_FROM_DEVICE);
428430
429− if (!dev->pdata->has_alt_cmd) {
431+ if (!dev->use_alt_cmd) {
430432 /* The last two bytes have to be read without using dma */
431433 dev->buf += dev->buf_len - 2;
432434 dev->buf_len = 2;
@@ -443,7 +445,7 @@ static void at91_twi_read_data_dma(struct at91_twi_dev *dev) · 10 unmodified lines
443445 struct dma_chan *chan_rx = dma->chan_rx;
444446 size_t buf_len;
445447
446− buf_len = (dev->pdata->has_alt_cmd) ? dev->buf_len : dev->buf_len - 2;
448+ buf_len = (dev->use_alt_cmd) ? dev->buf_len : dev->buf_len - 2;
447449 dma->direction = DMA_FROM_DEVICE;
448450
449451 /* Keep in mind that we won't use dma to read the last two bytes */
@@ -651,7 +653,7 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev) · 201 unmodified lines
651653 unsigned start_flags = AT91_TWI_START;
652654
653655 /* if only one byte is to be read, immediately stop transfer */
654− if (!has_alt_cmd && dev->buf_len <= 1 &&
656+ if (!dev->use_alt_cmd && dev->buf_len <= 1 &&
655657 !(dev->msg->flags & I2C_M_RECV_LEN))
656658 start_flags |= AT91_TWI_STOP;
657659 at91_twi_write(dev, AT91_TWI_CR, start_flags);
@@ -745,7 +747,7 @@ static int at91_twi_xfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num) · 87 unmodified lines
745747 int ret;
746748 unsigned int_addr_flag = 0;
747749 struct i2c_msg *m_start = msg;
748− bool is_read, use_alt_cmd = false;
750+ bool is_read;
749751
750752 dev_dbg(&adap->dev, "at91_xfer: processing %d messages:\n", num);
751753
@@ -768,14 +770,16 @@ static int at91_twi_xfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num) · 16 unmodified lines
768770 at91_twi_write(dev, AT91_TWI_IADR, internal_address);
769771 }
770772
773+ dev->use_alt_cmd = false;
771774 is_read = (m_start->flags & I2C_M_RD);
772775 if (dev->pdata->has_alt_cmd) {
773− if (m_start->len > 0) {
776+ if (m_start->len > 0 &&
777+ m_start->len < AT91_I2C_MAX_ALT_CMD_DATA_SIZE) {
774778 at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_ACMEN);
775779 at91_twi_write(dev, AT91_TWI_ACR,
776780 AT91_TWI_ACR_DATAL(m_start->len) |
777781 ((is_read) ? AT91_TWI_ACR_DIR : 0));
778− use_alt_cmd = true;
782+ dev->use_alt_cmd = true;
779783 } else {
780784 at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_ACMDIS);
781785 }
@@ -784,7 +788,7 @@ static int at91_twi_xfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num) · 2 unmodified lines
784788 at91_twi_write(dev, AT91_TWI_MMR,
785789 (m_start->addr << 16) |
786790 int_addr_flag |
787− ((!use_alt_cmd && is_read) ? AT91_TWI_MREAD : 0));
791+ ((!dev->use_alt_cmd && is_read) ? AT91_TWI_MREAD : 0));
788792
789793 dev->buf_len = m_start->len;
790794 dev->buf = m_start->buf;
drivers/i2c/busses/i2c-bcm-iproc.c+1−1
@@ -158,7 +158,7 @@ static irqreturn_t bcm_iproc_i2c_isr(int irq, void *data) · 157 unmodified lines
158158
159159 if (status & BIT(IS_M_START_BUSY_SHIFT)) {
160160 iproc_i2c->xfer_is_done = 1;
161− complete_all(&iproc_i2c->done);
161+ complete(&iproc_i2c->done);
162162 }
163163
164164 writel(status, iproc_i2c->base + IS_OFFSET);
drivers/i2c/busses/i2c-bcm-kona.c+2−2
@@ -229,7 +229,7 @@ static irqreturn_t bcm_kona_i2c_isr(int irq, void *devid) · 228 unmodified lines
229229 dev->base + TXFCR_OFFSET);
230230
231231 writel(status & ~ISR_RESERVED_MASK, dev->base + ISR_OFFSET);
232− complete_all(&dev->done);
232+ complete(&dev->done);
233233
234234 return IRQ_HANDLED;
235235 }
@@ -643,7 +643,7 @@ static int bcm_kona_i2c_xfer(struct i2c_adapter *adapter, · 407 unmodified lines
643643 if (rc < 0) {
644644 dev_err(dev->device,
645645 "restart cmd failed rc = %d\n", rc);
646− goto xfer_send_stop;
646+ goto xfer_send_stop;
647647 }
648648 }
649649
drivers/i2c/busses/i2c-brcmstb.c+1−1
@@ -228,7 +228,7 @@ static irqreturn_t brcmstb_i2c_isr(int irq, void *devid) · 227 unmodified lines
228228 return IRQ_NONE;
229229
230230 brcmstb_i2c_enable_disable_irq(dev, INT_DISABLE);
231− complete_all(&dev->done);
231+ complete(&dev->done);
232232
233233 dev_dbg(dev->device, "isr handled");
234234 return IRQ_HANDLED;
drivers/i2c/busses/i2c-cadence.c+1−1
@@ -767,7 +767,7 @@ static int cdns_i2c_setclk(unsigned long clk_in, struct cdns_i2c *id) · 766 unmodified lines
767767 * depending on the scaling direction.
768768 *
769769 * Return: NOTIFY_STOP if the rate change should be aborted, NOTIFY_OK
770− * to acknowedge the change, NOTIFY_DONE if the notification is
770+ * to acknowledge the change, NOTIFY_DONE if the notification is
771771 * considered irrelevant.
772772 */
773773 static int cdns_i2c_clk_notifier_cb(struct notifier_block *nb, unsigned long
drivers/i2c/busses/i2c-cros-ec-tunnel.c+1−1
@@ -215,7 +215,7 @@ static int ec_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg i2c_msgs[], · 214 unmodified lines
215215 msg->outsize = request_len;
216216 msg->insize = response_len;
217217
218− result = cros_ec_cmd_xfer(bus->ec, msg);
218+ result = cros_ec_cmd_xfer_status(bus->ec, msg);
219219 if (result < 0) {
220220 dev_err(dev, "Error transferring EC i2c message %d\n", result);
221221 goto exit;
drivers/i2c/busses/i2c-designware-core.c+10−6
@@ -367,13 +367,17 @@ int i2c_dw_init(struct dw_i2c_dev *dev) · 366 unmodified lines
367367 dev_dbg(dev->dev, "Fast-mode HCNT:LCNT = %d:%d\n", hcnt, lcnt);
368368
369369 /* Configure SDA Hold Time if required */
370− if (dev->sda_hold_time) {
371− reg = dw_readl(dev, DW_IC_COMP_VERSION);
372− if (reg >= DW_IC_SDA_HOLD_MIN_VERS)
370+ reg = dw_readl(dev, DW_IC_COMP_VERSION);
371+ if (reg >= DW_IC_SDA_HOLD_MIN_VERS) {
372+ if (dev->sda_hold_time) {
373373 dw_writel(dev, dev->sda_hold_time, DW_IC_SDA_HOLD);
374− else
375− dev_warn(dev->dev,
376− "Hardware too old to adjust SDA hold time.");
374+ } else {
375+ /* Keep previous hold time setting if no one set it */
376+ dev->sda_hold_time = dw_readl(dev, DW_IC_SDA_HOLD);
377+ }
378+ } else {
379+ dev_warn(dev->dev,
380+ "Hardware too old to adjust SDA hold time.\n");
377381 }
378382
379383 /* Configure Tx/Rx FIFO threshold levels */
drivers/i2c/busses/i2c-eg20t.c+11−7
@@ -773,13 +773,6 @@ static int pch_i2c_probe(struct pci_dev *pdev, · 772 unmodified lines
773773 /* Set the number of I2C channel instance */
774774 adap_info->ch_num = id->driver_data;
775775
776− ret = request_irq(pdev->irq, pch_i2c_handler, IRQF_SHARED,
777− KBUILD_MODNAME, adap_info);
778− if (ret) {
779− pch_pci_err(pdev, "request_irq FAILED\n");
780− goto err_request_irq;
781− }
782−
783776 for (i = 0; i < adap_info->ch_num; i++) {
784777 pch_adap = &adap_info->pch_data[i].pch_adapter;
785778 adap_info->pch_i2c_suspended = false;
@@ -797,6 +790,17 @@ static int pch_i2c_probe(struct pci_dev *pdev, · 11 unmodified lines
797790
798791 pch_adap->dev.of_node = pdev->dev.of_node;
799792 pch_adap->dev.parent = &pdev->dev;
793+ }
794+
795+ ret = request_irq(pdev->irq, pch_i2c_handler, IRQF_SHARED,
796+ KBUILD_MODNAME, adap_info);
797+ if (ret) {
798+ pch_pci_err(pdev, "request_irq FAILED\n");
799+ goto err_request_irq;
800+ }
801+
802+ for (i = 0; i < adap_info->ch_num; i++) {
803+ pch_adap = &adap_info->pch_data[i].pch_adapter;
800804
801805 pch_i2c_init(&adap_info->pch_data[i]);
802806
drivers/i2c/busses/i2c-meson.c+3−3
@@ -211,7 +211,7 @@ static void meson_i2c_stop(struct meson_i2c *i2c) · 210 unmodified lines
211211 meson_i2c_add_token(i2c, TOKEN_STOP);
212212 } else {
213213 i2c->state = STATE_IDLE;
214− complete_all(&i2c->done);
214+ complete(&i2c->done);
215215 }
216216 }
217217
@@ -238,7 +238,7 @@ static irqreturn_t meson_i2c_irq(int irqno, void *dev_id) · 20 unmodified lines
238238 dev_dbg(i2c->dev, "error bit set\n");
239239 i2c->error = -ENXIO;
240240 i2c->state = STATE_IDLE;
241− complete_all(&i2c->done);
241+ complete(&i2c->done);
242242 goto out;
243243 }
244244
@@ -269,7 +269,7 @@ static irqreturn_t meson_i2c_irq(int irqno, void *dev_id) · 24 unmodified lines
269269 break;
270270 case STATE_STOP:
271271 i2c->state = STATE_IDLE;
272− complete_all(&i2c->done);
272+ complete(&i2c->done);
273273 break;
274274 case STATE_IDLE:
275275 break;
drivers/i2c/busses/i2c-ocores.c+10−4
@@ -379,6 +379,7 @@ static int ocores_i2c_of_probe(struct platform_device *pdev, · 378 unmodified lines
379379 if (!clock_frequency_present) {
380380 dev_err(&pdev->dev,
381381 "Missing required parameter 'opencores,ip-clock-frequency'\n");
382+ clk_disable_unprepare(i2c->clk);
382383 return -ENODEV;
383384 }
384385 i2c->ip_clock_khz = clock_frequency / 1000;
@@ -467,20 +468,21 @@ static int ocores_i2c_probe(struct platform_device *pdev) · 82 unmodified lines
467468 default:
468469 dev_err(&pdev->dev, "Unsupported I/O width (%d)\n",
469470 i2c->reg_io_width);
470− return -EINVAL;
471+ ret = -EINVAL;
472+ goto err_clk;
471473 }
472474 }
473475
474476 ret = ocores_init(&pdev->dev, i2c);
475477 if (ret)
476− return ret;
478+ goto err_clk;
477479
478480 init_waitqueue_head(&i2c->wait);
479481 ret = devm_request_irq(&pdev->dev, irq, ocores_isr, 0,
480482 pdev->name, i2c);
481483 if (ret) {
482484 dev_err(&pdev->dev, "Cannot claim IRQ\n");
483− return ret;
485+ goto err_clk;
484486 }
485487
486488 /* hook up driver to tree */
@@ -494,7 +496,7 @@ static int ocores_i2c_probe(struct platform_device *pdev) · 7 unmodified lines
494496 ret = i2c_add_adapter(&i2c->adap);
495497 if (ret) {
496498 dev_err(&pdev->dev, "Failed to add adapter\n");
497− return ret;
499+ goto err_clk;
498500 }
499501
500502 /* add in known devices to the bus */
@@ -504,6 +506,10 @@ static int ocores_i2c_probe(struct platform_device *pdev) · 3 unmodified lines
504506 }
505507
506508 return 0;
509+
510+err_clk:
511+ clk_disable_unprepare(i2c->clk);
512+ return ret;
507513 }
508514
509515 static int ocores_i2c_remove(struct platform_device *pdev)
drivers/i2c/busses/i2c-qup.c+2−1
@@ -1599,7 +1599,8 @@ static int qup_i2c_pm_resume_runtime(struct device *device) · 1598 unmodified lines
15991599 #ifdef CONFIG_PM_SLEEP
16001600 static int qup_i2c_suspend(struct device *device)
16011601 {
1602− qup_i2c_pm_suspend_runtime(device);
1602+ if (!pm_runtime_suspended(device))
1603+ return qup_i2c_pm_suspend_runtime(device);
16031604 return 0;
16041605 }
16051606
drivers/i2c/busses/i2c-rcar.c+1−1
@@ -378,7 +378,7 @@ static void rcar_i2c_dma(struct rcar_i2c_priv *priv) · 377 unmodified lines
378378 }
379379
380380 dma_addr = dma_map_single(chan->device->dev, buf, len, dir);
381− if (dma_mapping_error(dev, dma_addr)) {
381+ if (dma_mapping_error(chan->device->dev, dma_addr)) {
382382 dev_dbg(dev, "dma map failed, using PIO\n");
383383 return;
384384 }
drivers/i2c/busses/i2c-rk3x.c+13−1
@@ -918,7 +918,7 @@ static void rk3x_i2c_adapt_div(struct rk3x_i2c *i2c, unsigned long clk_rate) · 917 unmodified lines
918918 * Code adapted from i2c-cadence.c.
919919 *
920920 * Return: NOTIFY_STOP if the rate change should be aborted, NOTIFY_OK
921− * to acknowedge the change, NOTIFY_DONE if the notification is
921+ * to acknowledge the change, NOTIFY_DONE if the notification is
922922 * considered irrelevant.
923923 */
924924 static int rk3x_i2c_clk_notifier_cb(struct notifier_block *nb, unsigned long
@@ -1111,6 +1111,15 @@ static int rk3x_i2c_xfer(struct i2c_adapter *adap, · 186 unmodified lines
11111111 return ret < 0 ? ret : num;
11121112 }
11131113
1114+static __maybe_unused int rk3x_i2c_resume(struct device *dev)
1115+{
1116+ struct rk3x_i2c *i2c = dev_get_drvdata(dev);
1117+
1118+ rk3x_i2c_adapt_div(i2c, clk_get_rate(i2c->clk));
1119+
1120+ return 0;
1121+}
1122+
11141123 static u32 rk3x_i2c_func(struct i2c_adapter *adap)
11151124 {
11161125 return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | I2C_FUNC_PROTOCOL_MANGLING;
@@ -1334,12 +1343,15 @@ static int rk3x_i2c_remove(struct platform_device *pdev) · 217 unmodified lines
13341343 return 0;
13351344 }
13361345
1346+static SIMPLE_DEV_PM_OPS(rk3x_i2c_pm_ops, NULL, rk3x_i2c_resume);
1347+
13371348 static struct platform_driver rk3x_i2c_driver = {
13381349 .probe = rk3x_i2c_probe,
13391350 .remove = rk3x_i2c_remove,
13401351 .driver = {
13411352 .name = "rk3x-i2c",
13421353 .of_match_table = rk3x_i2c_match,
1354+ .pm = &rk3x_i2c_pm_ops,
13431355 },
13441356 };
13451357
drivers/i2c/busses/i2c-sh_mobile.c+1−1
@@ -610,7 +610,7 @@ static void sh_mobile_i2c_xfer_dma(struct sh_mobile_i2c_data *pd) · 609 unmodified lines
610610 return;
611611
612612 dma_addr = dma_map_single(chan->device->dev, pd->msg->buf, pd->msg->len, dir);
613− if (dma_mapping_error(pd->dev, dma_addr)) {
613+ if (dma_mapping_error(chan->device->dev, dma_addr)) {
614614 dev_dbg(pd->dev, "dma map failed, using PIO\n");
615615 return;
616616 }
drivers/i2c/muxes/i2c-demux-pinctrl.c+14−5
@@ -37,8 +37,6 @@ struct i2c_demux_pinctrl_priv { · 36 unmodified lines
3737 struct i2c_demux_pinctrl_chan chan[];
3838 };
3939
40−static struct property status_okay = { .name = "status", .length = 3, .value = "ok" };
41−
4240 static int i2c_demux_master_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
4341 {
4442 struct i2c_demux_pinctrl_priv *priv = adap->algo_data;
@@ -68,7 +66,7 @@ static int i2c_demux_activate_master(struct i2c_demux_pinctrl_priv *priv, u32 ne · 23 unmodified lines
6866 adap = of_find_i2c_adapter_by_node(priv->chan[new_chan].parent_np);
6967 if (!adap) {
7068 ret = -ENODEV;
71− goto err;
69+ goto err_with_revert;
7270 }
7371
7472 p = devm_pinctrl_get_select(adap->dev.parent, priv->bus_name);
@@ -103,8 +101,11 @@ static int i2c_demux_activate_master(struct i2c_demux_pinctrl_priv *priv, u32 ne · 28 unmodified lines
103101
104102 err_with_put:
105103 i2c_put_adapter(adap);
104+ err_with_revert:
105+ of_changeset_revert(&priv->chan[new_chan].chgset);
106106 err:
107107 dev_err(priv->dev, "failed to setup demux-adapter %d (%d)\n", new_chan, ret);
108+ priv->cur_chan = -EINVAL;
108109 return ret;
109110 }
110111
@@ -190,6 +191,7 @@ static int i2c_demux_pinctrl_probe(struct platform_device *pdev) · 79 unmodified lines
190191 {
191192 struct device_node *np = pdev->dev.of_node;
192193 struct i2c_demux_pinctrl_priv *priv;
194+ struct property *props;
193195 int num_chan, i, j, err;
194196
195197 num_chan = of_count_phandle_with_args(np, "i2c-parent", NULL);
@@ -200,7 +202,10 @@ static int i2c_demux_pinctrl_probe(struct platform_device *pdev) · 4 unmodified lines
200202
201203 priv = devm_kzalloc(&pdev->dev, sizeof(*priv)
202204 + num_chan * sizeof(struct i2c_demux_pinctrl_chan), GFP_KERNEL);
203− if (!priv)
205+
206+ props = devm_kcalloc(&pdev->dev, num_chan, sizeof(*props), GFP_KERNEL);
207+
208+ if (!priv || !props)
204209 return -ENOMEM;
205210
206211 err = of_property_read_string(np, "i2c-bus-name", &priv->bus_name);
@@ -218,8 +223,12 @@ static int i2c_demux_pinctrl_probe(struct platform_device *pdev) · 11 unmodified lines
218223 }
219224 priv->chan[i].parent_np = adap_np;
220225
226+ props[i].name = devm_kstrdup(&pdev->dev, "status", GFP_KERNEL);
227+ props[i].value = devm_kstrdup(&pdev->dev, "ok", GFP_KERNEL);
228+ props[i].length = 3;
229+
221230 of_changeset_init(&priv->chan[i].chgset);
222− of_changeset_update_property(&priv->chan[i].chgset, adap_np, &status_okay);
231+ of_changeset_update_property(&priv->chan[i].chgset, adap_np, &props[i]);
223232 }
224233
225234 priv->num_chan = num_chan;
drivers/i2c/muxes/i2c-mux-pca954x.c+1−1
@@ -164,7 +164,7 @@ static int pca954x_select_chan(struct i2c_mux_core *muxc, u32 chan) · 163 unmodified lines
164164 /* Only select the channel if its different from the last channel */
165165 if (data->last_chan != regval) {
166166 ret = pca954x_reg_write(muxc->parent, client, regval);
167− data->last_chan = regval;
167+ data->last_chan = ret ? 0 : regval;
168168 }
169169
170170 return ret;
drivers/iio/accel/Kconfig+4−1
@@ -20,6 +20,8 @@ config BMA180 · 19 unmodified lines
2020 config BMA220
2121 tristate "Bosch BMA220 3-Axis Accelerometer Driver"
2222 depends on SPI
23+ select IIO_BUFFER
24+ select IIO_TRIGGERED_BUFFER
2325 help
2426 Say yes here to add support for the Bosch BMA220 triaxial
2527 acceleration sensor.
@@ -234,7 +236,8 @@ config STK8312 · 208 unmodified lines
234236 config STK8BA50
235237 tristate "Sensortek STK8BA50 3-Axis Accelerometer Driver"
236238 depends on I2C
237− depends on IIO_TRIGGER
239+ select IIO_BUFFER
240+ select IIO_TRIGGERED_BUFFER
238241 help
239242 Say yes here to get support for the Sensortek STK8BA50 3-axis
240243 accelerometer.
drivers/iio/accel/bma220_spi.c+1−1
@@ -253,7 +253,7 @@ static int bma220_probe(struct spi_device *spi) · 252 unmodified lines
253253 if (ret < 0)
254254 return ret;
255255
256− ret = iio_triggered_buffer_setup(indio_dev, NULL,
256+ ret = iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time,
257257 bma220_trigger_handler, NULL);
258258 if (ret < 0) {
259259 dev_err(&spi->dev, "iio triggered buffer setup failed\n");
drivers/iio/accel/bmc150-accel-core.c+11−0
@@ -67,6 +67,9 @@ · 66 unmodified lines
6767 #define BMC150_ACCEL_REG_PMU_BW 0x10
6868 #define BMC150_ACCEL_DEF_BW 125
6969
70+#define BMC150_ACCEL_REG_RESET 0x14
71+#define BMC150_ACCEL_RESET_VAL 0xB6
72+
7073 #define BMC150_ACCEL_REG_INT_MAP_0 0x19
7174 #define BMC150_ACCEL_INT_MAP_0_BIT_SLOPE BIT(2)
7275
@@ -1497,6 +1500,14 @@ static int bmc150_accel_chip_init(struct bmc150_accel_data *data) · 1424 unmodified lines
14971500 int ret, i;
14981501 unsigned int val;
14991502
1503+ /*
1504+ * Reset chip to get it in a known good state. A delay of 1.8ms after
1505+ * reset is required according to the data sheets of supported chips.
1506+ */
1507+ regmap_write(data->regmap, BMC150_ACCEL_REG_RESET,
1508+ BMC150_ACCEL_RESET_VAL);
1509+ usleep_range(1800, 2500);
1510+
15001511 ret = regmap_read(data->regmap, BMC150_ACCEL_REG_CHIP_ID, &val);
15011512 if (ret < 0) {
15021513 dev_err(dev, "Error: Reading chip id\n");
drivers/iio/accel/kxsd9.c+2−0
@@ -160,11 +160,13 @@ static int kxsd9_read_raw(struct iio_dev *indio_dev, · 159 unmodified lines
160160 if (ret < 0)
161161 goto error_ret;
162162 *val = ret;
163+ ret = IIO_VAL_INT;
163164 break;
164165 case IIO_CHAN_INFO_SCALE:
165166 ret = spi_w8r8(st->us, KXSD9_READ(KXSD9_REG_CTRL_C));
166167 if (ret < 0)
167168 goto error_ret;
169+ *val = 0;
168170 *val2 = kxsd9_micro_scales[ret & KXSD9_FS_MASK];
169171 ret = IIO_VAL_INT_PLUS_MICRO;
170172 break;
drivers/iio/adc/Kconfig+1−0
@@ -389,6 +389,7 @@ config QCOM_SPMI_VADC · 388 unmodified lines
389389 config ROCKCHIP_SARADC
390390 tristate "Rockchip SARADC driver"
391391 depends on ARCH_ROCKCHIP || (ARM && COMPILE_TEST)
392+ depends on RESET_CONTROLLER
392393 help
393394 Say yes here to build support for the SARADC found in SoCs from
394395 Rockchip.
drivers/iio/adc/ad799x.c+1−0
@@ -527,6 +527,7 @@ static struct attribute_group ad799x_event_attrs_group = { · 526 unmodified lines
527527 static const struct iio_info ad7991_info = {
528528 .read_raw = &ad799x_read_raw,
529529 .driver_module = THIS_MODULE,
530+ .update_scan_mode = ad799x_update_scan_mode,
530531 };
531532
532533 static const struct iio_info ad7993_4_7_8_noirq_info = {
drivers/iio/adc/at91_adc.c+2−2
@@ -381,8 +381,8 @@ static irqreturn_t at91_adc_rl_interrupt(int irq, void *private) · 380 unmodified lines
381381 st->ts_bufferedmeasure = false;
382382 input_report_key(st->ts_input, BTN_TOUCH, 0);
383383 input_sync(st->ts_input);
384− } else if (status & AT91_ADC_EOC(3)) {
385− /* Conversion finished */
384+ } else if (status & AT91_ADC_EOC(3) && st->ts_input) {
385+ /* Conversion finished and we've a touchscreen */
386386 if (st->ts_bufferedmeasure) {
387387 /*
388388 * Last measurement is always discarded, since it can
drivers/iio/adc/rockchip_saradc.c+30−0
@@ -21,6 +21,8 @@ · 20 unmodified lines
2121 #include <linux/of_device.h>
2222 #include <linux/clk.h>
2323 #include <linux/completion.h>
24+#include <linux/delay.h>
25+#include <linux/reset.h>
2426 #include <linux/regulator/consumer.h>
2527 #include <linux/iio/iio.h>
2628
@@ -53,6 +55,7 @@ struct rockchip_saradc { · 26 unmodified lines
5355 struct clk *clk;
5456 struct completion completion;
5557 struct regulator *vref;
58+ struct reset_control *reset;
5659 const struct rockchip_saradc_data *data;
5760 u16 last_val;
5861 };
@@ -190,6 +193,16 @@ static const struct of_device_id rockchip_saradc_match[] = { · 131 unmodified lines
190193 };
191194 MODULE_DEVICE_TABLE(of, rockchip_saradc_match);
192195
196+/**
197+ * Reset SARADC Controller.
198+ */
199+static void rockchip_saradc_reset_controller(struct reset_control *reset)
200+{
201+ reset_control_assert(reset);
202+ usleep_range(10, 20);
203+ reset_control_deassert(reset);
204+}
205+
193206 static int rockchip_saradc_probe(struct platform_device *pdev)
194207 {
195208 struct rockchip_saradc *info = NULL;
@@ -218,6 +231,20 @@ static int rockchip_saradc_probe(struct platform_device *pdev) · 22 unmodified lines
218231 if (IS_ERR(info->regs))
219232 return PTR_ERR(info->regs);
220233
234+ /*
235+ * The reset should be an optional property, as it should work
236+ * with old devicetrees as well
237+ */
238+ info->reset = devm_reset_control_get(&pdev->dev, "saradc-apb");
239+ if (IS_ERR(info->reset)) {
240+ ret = PTR_ERR(info->reset);
241+ if (ret != -ENOENT)
242+ return ret;
243+
244+ dev_dbg(&pdev->dev, "no reset control found\n");
245+ info->reset = NULL;
246+ }
247+
221248 init_completion(&info->completion);
222249
223250 irq = platform_get_irq(pdev, 0);
@@ -252,6 +279,9 @@ static int rockchip_saradc_probe(struct platform_device *pdev) · 28 unmodified lines
252279 return PTR_ERR(info->vref);
253280 }
254281
282+ if (info->reset)
283+ rockchip_saradc_reset_controller(info->reset);
284+
255285 /*
256286 * Use a default value for the converter clock.
257287 * This may become user-configurable in the future.
drivers/iio/adc/ti-ads1015.c+2−1
@@ -489,7 +489,8 @@ static struct iio_info ads1115_info = { · 488 unmodified lines
489489 #ifdef CONFIG_OF
490490 static int ads1015_get_channels_config_of(struct i2c_client *client)
491491 {
492− struct ads1015_data *data = i2c_get_clientdata(client);
492+ struct iio_dev *indio_dev = i2c_get_clientdata(client);
493+ struct ads1015_data *data = iio_priv(indio_dev);
493494 struct device_node *node;
494495
495496 if (!client->dev.of_node ||
drivers/iio/adc/ti_am335x_adc.c+12−4
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232
3333 struct tiadc_device {
3434 struct ti_tscadc_dev *mfd_tscadc;
35+ struct mutex fifo1_lock; /* to protect fifo access */
3536 int channels;
3637 u8 channel_line[8];
3738 u8 channel_step[8];
@@ -359,6 +360,7 @@ static int tiadc_read_raw(struct iio_dev *indio_dev, · 321 unmodified lines
359360 int *val, int *val2, long mask)
360361 {
361362 struct tiadc_device *adc_dev = iio_priv(indio_dev);
363+ int ret = IIO_VAL_INT;
362364 int i, map_val;
363365 unsigned int fifo1count, read, stepid;
364366 bool found = false;
@@ -372,13 +374,14 @@ static int tiadc_read_raw(struct iio_dev *indio_dev, · 7 unmodified lines
372374 if (!step_en)
373375 return -EINVAL;
374376
377+ mutex_lock(&adc_dev->fifo1_lock);
375378 fifo1count = tiadc_readl(adc_dev, REG_FIFO1CNT);
376379 while (fifo1count--)
377380 tiadc_readl(adc_dev, REG_FIFO1);
378381
379382 am335x_tsc_se_set_once(adc_dev->mfd_tscadc, step_en);
380383
381− timeout = jiffies + usecs_to_jiffies
384+ timeout = jiffies + msecs_to_jiffies
382385 (IDLE_TIMEOUT * adc_dev->channels);
383386 /* Wait for Fifo threshold interrupt */
384387 while (1) {
@@ -388,7 +391,8 @@ static int tiadc_read_raw(struct iio_dev *indio_dev, · 3 unmodified lines
388391
389392 if (time_after(jiffies, timeout)) {
390393 am335x_tsc_se_adc_done(adc_dev->mfd_tscadc);
391− return -EAGAIN;
394+ ret = -EAGAIN;
395+ goto err_unlock;
392396 }
393397 }
394398 map_val = adc_dev->channel_step[chan->scan_index];
@@ -414,8 +418,11 @@ static int tiadc_read_raw(struct iio_dev *indio_dev, · 19 unmodified lines
414418 am335x_tsc_se_adc_done(adc_dev->mfd_tscadc);
415419
416420 if (found == false)
417− return -EBUSY;
418− return IIO_VAL_INT;
421+ ret = -EBUSY;
422+
423+err_unlock:
424+ mutex_unlock(&adc_dev->fifo1_lock);
425+ return ret;
419426 }
420427
421428 static const struct iio_info tiadc_info = {
@@ -483,6 +490,7 @@ static int tiadc_probe(struct platform_device *pdev) · 61 unmodified lines
483490
484491 tiadc_step_config(indio_dev);
485492 tiadc_writel(adc_dev, REG_FIFO1THR, FIFO1_THRESHOLD);
493+ mutex_init(&adc_dev->fifo1_lock);
486494
487495 err = tiadc_channel_init(indio_dev, adc_dev->channels);
488496 if (err < 0)
drivers/iio/chemical/atlas-ph-sensor.c+1−1
@@ -434,7 +434,7 @@ static int atlas_read_raw(struct iio_dev *indio_dev, · 433 unmodified lines
434434 break;
435435 case IIO_ELECTRICALCONDUCTIVITY:
436436 *val = 1; /* 0.00001 */
437− *val = 100000;
437+ *val2 = 100000;
438438 break;
439439 case IIO_CONCENTRATION:
440440 *val = 0; /* 0.000000001 */
drivers/iio/common/hid-sensors/hid-sensor-attributes.c+2−2
@@ -56,8 +56,8 @@ static struct { · 55 unmodified lines
5656 {HID_USAGE_SENSOR_ALS, 0, 1, 0},
5757 {HID_USAGE_SENSOR_ALS, HID_USAGE_SENSOR_UNITS_LUX, 1, 0},
5858
59− {HID_USAGE_SENSOR_PRESSURE, 0, 100000, 0},
60− {HID_USAGE_SENSOR_PRESSURE, HID_USAGE_SENSOR_UNITS_PASCAL, 1, 0},
59+ {HID_USAGE_SENSOR_PRESSURE, 0, 100, 0},
60+ {HID_USAGE_SENSOR_PRESSURE, HID_USAGE_SENSOR_UNITS_PASCAL, 0, 1000},
6161 };
6262
6363 static int pow_10(unsigned power)
drivers/iio/dac/stx104.c+29−9
@@ -65,6 +65,16 @@ struct stx104_gpio { · 64 unmodified lines
6565 unsigned int out_state;
6666 };
6767
68+/**
69+ * struct stx104_dev - STX104 device private data structure
70+ * @indio_dev: IIO device
71+ * @chip: instance of the gpio_chip
72+ */
73+struct stx104_dev {
74+ struct iio_dev *indio_dev;
75+ struct gpio_chip *chip;
76+};
77+
6878 static int stx104_read_raw(struct iio_dev *indio_dev,
6979 struct iio_chan_spec const *chan, int *val, int *val2, long mask)
7080 {
@@ -107,6 +117,7 @@ static const struct iio_chan_spec stx104_channels[STX104_NUM_CHAN] = { · 36 unmodified lines
107117 static int stx104_gpio_get_direction(struct gpio_chip *chip,
108118 unsigned int offset)
109119 {
120+ /* GPIO 0-3 are input only, while the rest are output only */
110121 if (offset < 4)
111122 return 1;
112123
@@ -169,6 +180,7 @@ static int stx104_probe(struct device *dev, unsigned int id) · 56 unmodified lines
169180 struct iio_dev *indio_dev;
170181 struct stx104_iio *priv;
171182 struct stx104_gpio *stx104gpio;
183+ struct stx104_dev *stx104dev;
172184 int err;
173185
174186 indio_dev = devm_iio_device_alloc(dev, sizeof(*priv));
@@ -179,6 +191,10 @@ static int stx104_probe(struct device *dev, unsigned int id) · 4 unmodified lines
179191 if (!stx104gpio)
180192 return -ENOMEM;
181193
194+ stx104dev = devm_kzalloc(dev, sizeof(*stx104dev), GFP_KERNEL);
195+ if (!stx104dev)
196+ return -ENOMEM;
197+
182198 if (!devm_request_region(dev, base[id], STX104_EXTENT,
183199 dev_name(dev))) {
184200 dev_err(dev, "Unable to lock port addresses (0x%X-0x%X)\n",
@@ -199,12 +215,6 @@ static int stx104_probe(struct device *dev, unsigned int id) · 14 unmodified lines
199215 outw(0, base[id] + 4);
200216 outw(0, base[id] + 6);
201217
202− err = devm_iio_device_register(dev, indio_dev);
203− if (err) {
204− dev_err(dev, "IIO device registering failed (%d)\n", err);
205− return err;
206− }
207−
208218 stx104gpio->chip.label = dev_name(dev);
209219 stx104gpio->chip.parent = dev;
210220 stx104gpio->chip.owner = THIS_MODULE;
@@ -220,7 +230,9 @@ static int stx104_probe(struct device *dev, unsigned int id) · 9 unmodified lines
220230
221231 spin_lock_init(&stx104gpio->lock);
222232
223− dev_set_drvdata(dev, stx104gpio);
233+ stx104dev->indio_dev = indio_dev;
234+ stx104dev->chip = &stx104gpio->chip;
235+ dev_set_drvdata(dev, stx104dev);
224236
225237 err = gpiochip_add_data(&stx104gpio->chip, stx104gpio);
226238 if (err) {
@@ -228,14 +240,22 @@ static int stx104_probe(struct device *dev, unsigned int id) · 1 unmodified line
228240 return err;
229241 }
230242
243+ err = iio_device_register(indio_dev);
244+ if (err) {
245+ dev_err(dev, "IIO device registering failed (%d)\n", err);
246+ gpiochip_remove(&stx104gpio->chip);
247+ return err;
248+ }
249+
231250 return 0;
232251 }
233252
234253 static int stx104_remove(struct device *dev, unsigned int id)
235254 {
236− struct stx104_gpio *const stx104gpio = dev_get_drvdata(dev);
255+ struct stx104_dev *const stx104dev = dev_get_drvdata(dev);
237256
238− gpiochip_remove(&stx104gpio->chip);
257+ iio_device_unregister(stx104dev->indio_dev);
258+ gpiochip_remove(stx104dev->chip);
239259
240260 return 0;
241261 }
drivers/iio/humidity/Kconfig+2−0
@@ -6,6 +6,8 @@ menu "Humidity sensors" · 5 unmodified lines
66 config AM2315
77 tristate "Aosong AM2315 relative humidity and temperature sensor"
88 depends on I2C
9+ select IIO_BUFFER
10+ select IIO_TRIGGERED_BUFFER
911 help
1012 If you say yes here you get support for the Aosong AM2315
1113 relative humidity and ambient temperature sensor.
drivers/iio/humidity/am2315.c+1−1
@@ -244,7 +244,7 @@ static int am2315_probe(struct i2c_client *client, · 243 unmodified lines
244244 indio_dev->channels = am2315_channels;
245245 indio_dev->num_channels = ARRAY_SIZE(am2315_channels);
246246
247− ret = iio_triggered_buffer_setup(indio_dev, NULL,
247+ ret = iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time,
248248 am2315_trigger_handler, NULL);
249249 if (ret < 0) {
250250 dev_err(&client->dev, "iio triggered buffer setup failed\n");
drivers/iio/humidity/hdc100x.c+7−20
@@ -142,7 +142,7 @@ static int hdc100x_get_measurement(struct hdc100x_data *data, · 141 unmodified lines
142142 struct i2c_client *client = data->client;
143143 int delay = data->adc_int_us[chan->address];
144144 int ret;
145− int val;
145+ __be16 val;
146146
147147 /* start measurement */
148148 ret = i2c_smbus_write_byte(client, chan->address);
@@ -154,26 +154,13 @@ static int hdc100x_get_measurement(struct hdc100x_data *data, · 5 unmodified lines
154154 /* wait for integration time to pass */
155155 usleep_range(delay, delay + 1000);
156156
157− /*
158− * i2c_smbus_read_word_data cannot() be used here due to the command
159− * value not being understood and causes NAKs preventing any reading
160− * from being accessed.
161− */
162− ret = i2c_smbus_read_byte(client);
157+ /* read measurement */
158+ ret = i2c_master_recv(data->client, (char *)&val, sizeof(val));
163159 if (ret < 0) {
164− dev_err(&client->dev, "cannot read high byte measurement");
160+ dev_err(&client->dev, "cannot read sensor data\n");
165161 return ret;
166162 }
167− val = ret << 8;
168−
169− ret = i2c_smbus_read_byte(client);
170− if (ret < 0) {
171− dev_err(&client->dev, "cannot read low byte measurement");
172− return ret;
173− }
174− val |= ret;
175−
176− return val;
163+ return be16_to_cpu(val);
177164 }
178165
179166 static int hdc100x_get_heater_status(struct hdc100x_data *data)
@@ -272,8 +259,8 @@ static int hdc100x_probe(struct i2c_client *client, · 92 unmodified lines
272259 struct iio_dev *indio_dev;
273260 struct hdc100x_data *data;
274261
275− if (!i2c_check_functionality(client->adapter,
276− I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BYTE))
262+ if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA |
263+ I2C_FUNC_SMBUS_BYTE | I2C_FUNC_I2C))
277264 return -EOPNOTSUPP;
278265
279266 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
drivers/iio/industrialio-buffer.c+19−8
@@ -107,9 +107,10 @@ ssize_t iio_buffer_read_first_n_outer(struct file *filp, char __user *buf, · 106 unmodified lines
107107 {
108108 struct iio_dev *indio_dev = filp->private_data;
109109 struct iio_buffer *rb = indio_dev->buffer;
110+ DEFINE_WAIT_FUNC(wait, woken_wake_function);
110111 size_t datum_size;
111112 size_t to_wait;
112− int ret;
113+ int ret = 0;
113114
114115 if (!indio_dev->info)
115116 return -ENODEV;
@@ -131,19 +132,29 @@ ssize_t iio_buffer_read_first_n_outer(struct file *filp, char __user *buf, · 15 unmodified lines
131132 else
132133 to_wait = min_t(size_t, n / datum_size, rb->watermark);
133134
135+ add_wait_queue(&rb->pollq, &wait);
134136 do {
135− ret = wait_event_interruptible(rb->pollq,
136− iio_buffer_ready(indio_dev, rb, to_wait, n / datum_size));
137− if (ret)
138− return ret;
137+ if (!indio_dev->info) {
138+ ret = -ENODEV;
139+ break;
140+ }
139141
140− if (!indio_dev->info)
141− return -ENODEV;
142+ if (!iio_buffer_ready(indio_dev, rb, to_wait, n / datum_size)) {
143+ if (signal_pending(current)) {
144+ ret = -ERESTARTSYS;
145+ break;
146+ }
147+
148+ wait_woken(&wait, TASK_INTERRUPTIBLE,
149+ MAX_SCHEDULE_TIMEOUT);
150+ continue;
151+ }
142152
143153 ret = rb->access->read_first_n(rb, n, buf);
144154 if (ret == 0 && (filp->f_flags & O_NONBLOCK))
145155 ret = -EAGAIN;
146− } while (ret == 0);
156+ } while (ret == 0);
157+ remove_wait_queue(&rb->pollq, &wait);
147158
148159 return ret;
149160 }
drivers/iio/industrialio-core.c+2−3
@@ -613,9 +613,8 @@ ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals) · 612 unmodified lines
613613 return sprintf(buf, "%d.%09u\n", vals[0], vals[1]);
614614 case IIO_VAL_FRACTIONAL:
615615 tmp = div_s64((s64)vals[0] * 1000000000LL, vals[1]);
616− vals[1] = do_div(tmp, 1000000000LL);
617− vals[0] = tmp;
618− return sprintf(buf, "%d.%09u\n", vals[0], vals[1]);
616+ vals[0] = (int)div_s64_rem(tmp, 1000000000, &vals[1]);
617+ return sprintf(buf, "%d.%09u\n", vals[0], abs(vals[1]));
619618 case IIO_VAL_FRACTIONAL_LOG2:
620619 tmp = (s64)vals[0] * 1000000000LL >> vals[1];
621620 vals[1] = do_div(tmp, 1000000000LL);
drivers/iio/light/Kconfig+2−1
@@ -76,7 +76,6 @@ config BH1750 · 75 unmodified lines
7676 config BH1780
7777 tristate "ROHM BH1780 ambient light sensor"
7878 depends on I2C
79− depends on !SENSORS_BH1780
8079 help
8180 Say Y here to build support for the ROHM BH1780GLI ambient
8281 light sensor.
@@ -238,6 +237,8 @@ config MAX44000 · 155 unmodified lines
238237 tristate "MAX44000 Ambient and Infrared Proximity Sensor"
239238 depends on I2C
240239 select REGMAP_I2C
240+ select IIO_BUFFER
241+ select IIO_TRIGGERED_BUFFER
241242 help
242243 Say Y here if you want to build support for Maxim Integrated's
243244 MAX44000 ambient and infrared proximity sensor device.
drivers/iio/pressure/bmp280-core.c+5−3
@@ -970,7 +970,7 @@ int bmp280_common_probe(struct device *dev, · 969 unmodified lines
970970 data->vdda = devm_regulator_get(dev, "vdda");
971971 if (IS_ERR(data->vdda)) {
972972 dev_err(dev, "failed to get VDDA regulator\n");
973− ret = PTR_ERR(data->vddd);
973+ ret = PTR_ERR(data->vdda);
974974 goto out_disable_vddd;
975975 }
976976 ret = regulator_enable(data->vdda);
@@ -1079,7 +1079,8 @@ EXPORT_SYMBOL(bmp280_common_remove); · 102 unmodified lines
10791079 #ifdef CONFIG_PM
10801080 static int bmp280_runtime_suspend(struct device *dev)
10811081 {
1082− struct bmp280_data *data = dev_get_drvdata(dev);
1082+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
1083+ struct bmp280_data *data = iio_priv(indio_dev);
10831084 int ret;
10841085
10851086 ret = regulator_disable(data->vdda);
@@ -1090,7 +1091,8 @@ static int bmp280_runtime_suspend(struct device *dev) · 4 unmodified lines
10901091
10911092 static int bmp280_runtime_resume(struct device *dev)
10921093 {
1093− struct bmp280_data *data = dev_get_drvdata(dev);
1094+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
1095+ struct bmp280_data *data = iio_priv(indio_dev);
10941096 int ret;
10951097
10961098 ret = regulator_enable(data->vddd);
drivers/iio/proximity/as3935.c+1−1
@@ -397,7 +397,7 @@ static int as3935_probe(struct spi_device *spi) · 396 unmodified lines
397397 return ret;
398398 }
399399
400− ret = iio_triggered_buffer_setup(indio_dev, NULL,
400+ ret = iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time,
401401 &as3935_trigger_handler, NULL);
402402
403403 if (ret) {
drivers/infiniband/core/cma.c+12−6
@@ -2462,18 +2462,24 @@ static int cma_resolve_iboe_route(struct rdma_id_private *id_priv) · 2461 unmodified lines
24622462
24632463 if (addr->dev_addr.bound_dev_if) {
24642464 ndev = dev_get_by_index(&init_net, addr->dev_addr.bound_dev_if);
2465− if (!ndev)
2466− return -ENODEV;
2465+ if (!ndev) {
2466+ ret = -ENODEV;
2467+ goto err2;
2468+ }
24672469
24682470 if (ndev->flags & IFF_LOOPBACK) {
24692471 dev_put(ndev);
2470− if (!id_priv->id.device->get_netdev)
2471− return -EOPNOTSUPP;
2472+ if (!id_priv->id.device->get_netdev) {
2473+ ret = -EOPNOTSUPP;
2474+ goto err2;
2475+ }
24722476
24732477 ndev = id_priv->id.device->get_netdev(id_priv->id.device,
24742478 id_priv->id.port_num);
2475− if (!ndev)
2476− return -ENODEV;
2479+ if (!ndev) {
2480+ ret = -ENODEV;
2481+ goto err2;
2482+ }
24772483 }
24782484
24792485 route->path_rec->net = &init_net;
drivers/infiniband/core/multicast.c+2−11
@@ -106,7 +106,6 @@ struct mcast_group { · 105 unmodified lines
106106 atomic_t refcount;
107107 enum mcast_group_state state;
108108 struct ib_sa_query *query;
109− int query_id;
110109 u16 pkey_index;
111110 u8 leave_state;
112111 int retries;
@@ -340,11 +339,7 @@ static int send_join(struct mcast_group *group, struct mcast_member *member) · 227 unmodified lines
340339 member->multicast.comp_mask,
341340 3000, GFP_KERNEL, join_handler, group,
342341 &group->query);
343− if (ret >= 0) {
344− group->query_id = ret;
345− ret = 0;
346− }
347− return ret;
342+ return (ret > 0) ? 0 : ret;
348343 }
349344
350345 static int send_leave(struct mcast_group *group, u8 leave_state)
@@ -364,11 +359,7 @@ static int send_leave(struct mcast_group *group, u8 leave_state) · 13 unmodified lines
364359 IB_SA_MCMEMBER_REC_JOIN_STATE,
365360 3000, GFP_KERNEL, leave_handler,
366361 group, &group->query);
367− if (ret >= 0) {
368− group->query_id = ret;
369− ret = 0;
370− }
371− return ret;
362+ return (ret > 0) ? 0 : ret;
372363 }
373364
374365 static void join_group(struct mcast_group *group, struct mcast_member *member,
drivers/infiniband/hw/cxgb4/cm.c+10−2
@@ -333,6 +333,8 @@ static void remove_ep_tid(struct c4iw_ep *ep) · 332 unmodified lines
333333
334334 spin_lock_irqsave(&ep->com.dev->lock, flags);
335335 _remove_handle(ep->com.dev, &ep->com.dev->hwtid_idr, ep->hwtid, 0);
336+ if (idr_is_empty(&ep->com.dev->hwtid_idr))
337+ wake_up(&ep->com.dev->wait);
336338 spin_unlock_irqrestore(&ep->com.dev->lock, flags);
337339 }
338340
@@ -1827,8 +1829,12 @@ static int process_mpa_request(struct c4iw_ep *ep, struct sk_buff *skb) · 1488 unmodified lines
18271829 (ep->mpa_pkt + sizeof(*mpa));
18281830 ep->ird = ntohs(mpa_v2_params->ird) &
18291831 MPA_V2_IRD_ORD_MASK;
1832+ ep->ird = min_t(u32, ep->ird,
1833+ cur_max_read_depth(ep->com.dev));
18301834 ep->ord = ntohs(mpa_v2_params->ord) &
18311835 MPA_V2_IRD_ORD_MASK;
1836+ ep->ord = min_t(u32, ep->ord,
1837+ cur_max_read_depth(ep->com.dev));
18321838 PDBG("%s initiator ird %u ord %u\n", __func__, ep->ird,
18331839 ep->ord);
18341840 if (ntohs(mpa_v2_params->ird) & MPA_V2_PEER2PEER_MODEL)
@@ -2113,8 +2119,10 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip, · 278 unmodified lines
21132119 }
21142120 ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t,
21152121 n, pdev, rt_tos2priority(tos));
2116− if (!ep->l2t)
2122+ if (!ep->l2t) {
2123+ dev_put(pdev);
21172124 goto out;
2125+ }
21182126 ep->mtu = pdev->mtu;
21192127 ep->tx_chan = cxgb4_port_chan(pdev);
21202128 ep->smac_idx = cxgb4_tp_smt_idx(adapter_type,
@@ -3136,7 +3144,7 @@ int c4iw_accept_cr(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) · 1015 unmodified lines
31363144 if (ep->mpa_attr.version == 2 && ep->mpa_attr.enhanced_rdma_conn) {
31373145 if (conn_param->ord > ep->ird) {
31383146 if (RELAXED_IRD_NEGOTIATION) {
3139− ep->ord = ep->ird;
3147+ conn_param->ord = ep->ird;
31403148 } else {
31413149 ep->ird = conn_param->ird;
31423150 ep->ord = conn_param->ord;
drivers/infiniband/hw/cxgb4/cq.c+5−5
@@ -1016,15 +1016,15 @@ int c4iw_resize_cq(struct ib_cq *cq, int cqe, struct ib_udata *udata) · 1015 unmodified lines
10161016 int c4iw_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
10171017 {
10181018 struct c4iw_cq *chp;
1019− int ret;
1019+ int ret = 0;
10201020 unsigned long flag;
10211021
10221022 chp = to_c4iw_cq(ibcq);
10231023 spin_lock_irqsave(&chp->lock, flag);
1024− ret = t4_arm_cq(&chp->cq,
1025− (flags & IB_CQ_SOLICITED_MASK) == IB_CQ_SOLICITED);
1024+ t4_arm_cq(&chp->cq,
1025+ (flags & IB_CQ_SOLICITED_MASK) == IB_CQ_SOLICITED);
1026+ if (flags & IB_CQ_REPORT_MISSED_EVENTS)
1027+ ret = t4_cq_notempty(&chp->cq);
10261028 spin_unlock_irqrestore(&chp->lock, flag);
1027− if (ret && !(flags & IB_CQ_REPORT_MISSED_EVENTS))
1028− ret = 0;
10291029 return ret;
10301030 }
drivers/infiniband/hw/cxgb4/device.c+5−0
@@ -872,9 +872,13 @@ static void c4iw_rdev_close(struct c4iw_rdev *rdev) · 871 unmodified lines
872872 static void c4iw_dealloc(struct uld_ctx *ctx)
873873 {
874874 c4iw_rdev_close(&ctx->dev->rdev);
875+ WARN_ON_ONCE(!idr_is_empty(&ctx->dev->cqidr));
875876 idr_destroy(&ctx->dev->cqidr);
877+ WARN_ON_ONCE(!idr_is_empty(&ctx->dev->qpidr));
876878 idr_destroy(&ctx->dev->qpidr);
879+ WARN_ON_ONCE(!idr_is_empty(&ctx->dev->mmidr));
877880 idr_destroy(&ctx->dev->mmidr);
881+ wait_event(ctx->dev->wait, idr_is_empty(&ctx->dev->hwtid_idr));
878882 idr_destroy(&ctx->dev->hwtid_idr);
879883 idr_destroy(&ctx->dev->stid_idr);
880884 idr_destroy(&ctx->dev->atid_idr);
@@ -992,6 +996,7 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop) · 111 unmodified lines
992996 mutex_init(&devp->rdev.stats.lock);
993997 mutex_init(&devp->db_mutex);
994998 INIT_LIST_HEAD(&devp->db_fc_list);
999+ init_waitqueue_head(&devp->wait);
9951000 devp->avail_ird = devp->rdev.lldi.max_ird_adapter;
9961001
9971002 if (c4iw_debugfs_root) {
drivers/infiniband/hw/cxgb4/iw_cxgb4.h+1−0
@@ -263,6 +263,7 @@ struct c4iw_dev { · 262 unmodified lines
263263 struct idr stid_idr;
264264 struct list_head db_fc_list;
265265 u32 avail_ird;
266+ wait_queue_head_t wait;
266267 };
267268
268269 static inline struct c4iw_dev *to_c4iw_dev(struct ib_device *ibdev)
drivers/infiniband/hw/cxgb4/qp.c+1−1
@@ -683,7 +683,7 @@ static int build_inv_stag(union t4_wr *wqe, struct ib_send_wr *wr, · 682 unmodified lines
683683 return 0;
684684 }
685685
686−void _free_qp(struct kref *kref)
686+static void _free_qp(struct kref *kref)
687687 {
688688 struct c4iw_qp *qhp;
689689
drivers/infiniband/hw/cxgb4/t4.h+5−0
@@ -634,6 +634,11 @@ static inline int t4_valid_cqe(struct t4_cq *cq, struct t4_cqe *cqe) · 633 unmodified lines
634634 return (CQE_GENBIT(cqe) == cq->gen);
635635 }
636636
637+static inline int t4_cq_notempty(struct t4_cq *cq)
638+{
639+ return cq->sw_in_use || t4_valid_cqe(cq, &cq->queue[cq->cidx]);
640+}
641+
637642 static inline int t4_next_hw_cqe(struct t4_cq *cq, struct t4_cqe **cqe)
638643 {
639644 int ret;
drivers/infiniband/hw/hfi1/affinity.c+13−8
@@ -47,7 +47,6 @@ · 46 unmodified lines
4747 #include <linux/topology.h>
4848 #include <linux/cpumask.h>
4949 #include <linux/module.h>
50−#include <linux/cpumask.h>
5150
5251 #include "hfi.h"
5352 #include "affinity.h"
@@ -682,7 +681,7 @@ int hfi1_set_sdma_affinity(struct hfi1_devdata *dd, const char *buf, · 628 unmodified lines
682681 size_t count)
683682 {
684683 struct hfi1_affinity_node *entry;
685− struct cpumask mask;
684+ cpumask_var_t mask;
686685 int ret, i;
687686
688687 spin_lock(&node_affinity.lock);
@@ -692,19 +691,24 @@ int hfi1_set_sdma_affinity(struct hfi1_devdata *dd, const char *buf, · 3 unmodified lines
692691 if (!entry)
693692 return -EINVAL;
694693
695− ret = cpulist_parse(buf, &mask);
694+ ret = zalloc_cpumask_var(&mask, GFP_KERNEL);
695+ if (!ret)
696+ return -ENOMEM;
697+
698+ ret = cpulist_parse(buf, mask);
696699 if (ret)
697− return ret;
700+ goto out;
698701
699− if (!cpumask_subset(&mask, cpu_online_mask) || cpumask_empty(&mask)) {
702+ if (!cpumask_subset(mask, cpu_online_mask) || cpumask_empty(mask)) {
700703 dd_dev_warn(dd, "Invalid CPU mask\n");
701− return -EINVAL;
704+ ret = -EINVAL;
705+ goto out;
702706 }
703707
704708 mutex_lock(&sdma_affinity_mutex);
705709 /* reset the SDMA interrupt affinity details */
706710 init_cpu_mask_set(&entry->def_intr);
707− cpumask_copy(&entry->def_intr.mask, &mask);
711+ cpumask_copy(&entry->def_intr.mask, mask);
708712 /*
709713 * Reassign the affinity for each SDMA interrupt.
710714 */
@@ -720,8 +724,9 @@ int hfi1_set_sdma_affinity(struct hfi1_devdata *dd, const char *buf, · 9 unmodified lines
720724 if (ret)
721725 break;
722726 }
723−
724727 mutex_unlock(&sdma_affinity_mutex);
728+out:
729+ free_cpumask_var(mask);
725730 return ret ? ret : strnlen(buf, PAGE_SIZE);
726731 }
727732
drivers/infiniband/hw/hfi1/chip.c+81−11
@@ -9490,6 +9490,78 @@ static void init_lcb(struct hfi1_devdata *dd) · 9489 unmodified lines
94909490 write_csr(dd, DC_LCB_CFG_TX_FIFOS_RESET, 0x00);
94919491 }
94929492
9493+/*
9494+ * Perform a test read on the QSFP. Return 0 on success, -ERRNO
9495+ * on error.
9496+ */
9497+static int test_qsfp_read(struct hfi1_pportdata *ppd)
9498+{
9499+ int ret;
9500+ u8 status;
9501+
9502+ /* report success if not a QSFP */
9503+ if (ppd->port_type != PORT_TYPE_QSFP)
9504+ return 0;
9505+
9506+ /* read byte 2, the status byte */
9507+ ret = one_qsfp_read(ppd, ppd->dd->hfi1_id, 2, &status, 1);
9508+ if (ret < 0)
9509+ return ret;
9510+ if (ret != 1)
9511+ return -EIO;
9512+
9513+ return 0; /* success */
9514+}
9515+
9516+/*
9517+ * Values for QSFP retry.
9518+ *
9519+ * Give up after 10s (20 x 500ms). The overall timeout was empirically
9520+ * arrived at from experience on a large cluster.
9521+ */
9522+#define MAX_QSFP_RETRIES 20
9523+#define QSFP_RETRY_WAIT 500 /* msec */
9524+
9525+/*
9526+ * Try a QSFP read. If it fails, schedule a retry for later.
9527+ * Called on first link activation after driver load.
9528+ */
9529+static void try_start_link(struct hfi1_pportdata *ppd)
9530+{
9531+ if (test_qsfp_read(ppd)) {
9532+ /* read failed */
9533+ if (ppd->qsfp_retry_count >= MAX_QSFP_RETRIES) {
9534+ dd_dev_err(ppd->dd, "QSFP not responding, giving up\n");
9535+ return;
9536+ }
9537+ dd_dev_info(ppd->dd,
9538+ "QSFP not responding, waiting and retrying %d\n",
9539+ (int)ppd->qsfp_retry_count);
9540+ ppd->qsfp_retry_count++;
9541+ queue_delayed_work(ppd->hfi1_wq, &ppd->start_link_work,
9542+ msecs_to_jiffies(QSFP_RETRY_WAIT));
9543+ return;
9544+ }
9545+ ppd->qsfp_retry_count = 0;
9546+
9547+ /*
9548+ * Tune the SerDes to a ballpark setting for optimal signal and bit
9549+ * error rate. Needs to be done before starting the link.
9550+ */
9551+ tune_serdes(ppd);
9552+ start_link(ppd);
9553+}
9554+
9555+/*
9556+ * Workqueue function to start the link after a delay.
9557+ */
9558+void handle_start_link(struct work_struct *work)
9559+{
9560+ struct hfi1_pportdata *ppd = container_of(work, struct hfi1_pportdata,
9561+ start_link_work.work);
9562+ try_start_link(ppd);
9563+}
9564+
94939565 int bringup_serdes(struct hfi1_pportdata *ppd)
94949566 {
94959567 struct hfi1_devdata *dd = ppd->dd;
@@ -9525,14 +9597,8 @@ int bringup_serdes(struct hfi1_pportdata *ppd) · 29 unmodified lines
95259597 set_qsfp_int_n(ppd, 1);
95269598 }
95279599
9528− /*
9529− * Tune the SerDes to a ballpark setting for
9530− * optimal signal and bit error rate
9531− * Needs to be done before starting the link
9532− */
9533− tune_serdes(ppd);
9534−
9535− return start_link(ppd);
9600+ try_start_link(ppd);
9601+ return 0;
95369602 }
95379603
95389604 void hfi1_quiet_serdes(struct hfi1_pportdata *ppd)
@@ -9549,6 +9615,10 @@ void hfi1_quiet_serdes(struct hfi1_pportdata *ppd) · 10 unmodified lines
95499615 ppd->driver_link_ready = 0;
95509616 ppd->link_enabled = 0;
95519617
9618+ ppd->qsfp_retry_count = MAX_QSFP_RETRIES; /* prevent more retries */
9619+ flush_delayed_work(&ppd->start_link_work);
9620+ cancel_delayed_work_sync(&ppd->start_link_work);
9621+
95529622 ppd->offline_disabled_reason =
95539623 HFI1_ODR_MASK(OPA_LINKDOWN_REASON_SMA_DISABLED);
95549624 set_link_down_reason(ppd, OPA_LINKDOWN_REASON_SMA_DISABLED, 0,
@@ -12865,7 +12935,7 @@ fail: · 3310 unmodified lines
1286512935 */
1286612936 static int set_up_context_variables(struct hfi1_devdata *dd)
1286712937 {
12868− int num_kernel_contexts;
12938+ unsigned long num_kernel_contexts;
1286912939 int total_contexts;
1287012940 int ret;
1287112941 unsigned ngroups;
@@ -12894,9 +12964,9 @@ static int set_up_context_variables(struct hfi1_devdata *dd) · 22 unmodified lines
1289412964 */
1289512965 if (num_kernel_contexts > (dd->chip_send_contexts - num_vls - 1)) {
1289612966 dd_dev_err(dd,
12897− "Reducing # kernel rcv contexts to: %d, from %d\n",
12967+ "Reducing # kernel rcv contexts to: %d, from %lu\n",
1289812968 (int)(dd->chip_send_contexts - num_vls - 1),
12899− (int)num_kernel_contexts);
12969+ num_kernel_contexts);
1290012970 num_kernel_contexts = dd->chip_send_contexts - num_vls - 1;
1290112971 }
1290212972 /*
drivers/infiniband/hw/hfi1/chip.h+1−0
@@ -706,6 +706,7 @@ void handle_link_up(struct work_struct *work); · 705 unmodified lines
706706 void handle_link_down(struct work_struct *work);
707707 void handle_link_downgrade(struct work_struct *work);
708708 void handle_link_bounce(struct work_struct *work);
709+void handle_start_link(struct work_struct *work);
709710 void handle_sma_message(struct work_struct *work);
710711 void reset_qsfp(struct hfi1_pportdata *ppd);
711712 void qsfp_event(struct work_struct *work);
drivers/infiniband/hw/hfi1/debugfs.c+61−85
@@ -59,6 +59,40 @@ · 58 unmodified lines
5959
6060 static struct dentry *hfi1_dbg_root;
6161
62+/* wrappers to enforce srcu in seq file */
63+static ssize_t hfi1_seq_read(
64+ struct file *file,
65+ char __user *buf,
66+ size_t size,
67+ loff_t *ppos)
68+{
69+ struct dentry *d = file->f_path.dentry;
70+ int srcu_idx;
71+ ssize_t r;
72+
73+ r = debugfs_use_file_start(d, &srcu_idx);
74+ if (likely(!r))
75+ r = seq_read(file, buf, size, ppos);
76+ debugfs_use_file_finish(srcu_idx);
77+ return r;
78+}
79+
80+static loff_t hfi1_seq_lseek(
81+ struct file *file,
82+ loff_t offset,
83+ int whence)
84+{
85+ struct dentry *d = file->f_path.dentry;
86+ int srcu_idx;
87+ loff_t r;
88+
89+ r = debugfs_use_file_start(d, &srcu_idx);
90+ if (likely(!r))
91+ r = seq_lseek(file, offset, whence);
92+ debugfs_use_file_finish(srcu_idx);
93+ return r;
94+}
95+
6296 #define private2dd(file) (file_inode(file)->i_private)
6397 #define private2ppd(file) (file_inode(file)->i_private)
6498
@@ -87,8 +121,8 @@ static int _##name##_open(struct inode *inode, struct file *s) \ · 22 unmodified lines
87121 static const struct file_operations _##name##_file_ops = { \
88122 .owner = THIS_MODULE, \
89123 .open = _##name##_open, \
90− .read = seq_read, \
91− .llseek = seq_lseek, \
124+ .read = hfi1_seq_read, \
125+ .llseek = hfi1_seq_lseek, \
92126 .release = seq_release \
93127 }
94128
@@ -105,11 +139,9 @@ do { \ · 10 unmodified lines
105139 DEBUGFS_FILE_CREATE(#name, parent, data, &_##name##_file_ops, S_IRUGO)
106140
107141 static void *_opcode_stats_seq_start(struct seq_file *s, loff_t *pos)
108−__acquires(RCU)
109142 {
110143 struct hfi1_opcode_stats_perctx *opstats;
111144
112− rcu_read_lock();
113145 if (*pos >= ARRAY_SIZE(opstats->stats))
114146 return NULL;
115147 return pos;
@@ -126,9 +158,7 @@ static void *_opcode_stats_seq_next(struct seq_file *s, void *v, loff_t *pos) · 10 unmodified lines
126158 }
127159
128160 static void _opcode_stats_seq_stop(struct seq_file *s, void *v)
129−__releases(RCU)
130161 {
131− rcu_read_unlock();
132162 }
133163
134164 static int _opcode_stats_seq_show(struct seq_file *s, void *v)
@@ -223,28 +253,32 @@ DEBUGFS_SEQ_FILE_OPEN(ctx_stats) · 88 unmodified lines
223253 DEBUGFS_FILE_OPS(ctx_stats);
224254
225255 static void *_qp_stats_seq_start(struct seq_file *s, loff_t *pos)
226−__acquires(RCU)
256+ __acquires(RCU)
227257 {
228258 struct qp_iter *iter;
229259 loff_t n = *pos;
230260
231− rcu_read_lock();
232261 iter = qp_iter_init(s->private);
262+
263+ /* stop calls rcu_read_unlock */
264+ rcu_read_lock();
265+
233266 if (!iter)
234267 return NULL;
235268
236− while (n--) {
269+ do {
237270 if (qp_iter_next(iter)) {
238271 kfree(iter);
239272 return NULL;
240273 }
241− }
274+ } while (n--);
242275
243276 return iter;
244277 }
245278
246279 static void *_qp_stats_seq_next(struct seq_file *s, void *iter_ptr,
247280 loff_t *pos)
281+ __must_hold(RCU)
248282 {
249283 struct qp_iter *iter = iter_ptr;
250284
@@ -259,7 +293,7 @@ static void *_qp_stats_seq_next(struct seq_file *s, void *iter_ptr, · 8 unmodified lines
259293 }
260294
261295 static void _qp_stats_seq_stop(struct seq_file *s, void *iter_ptr)
262−__releases(RCU)
296+ __releases(RCU)
263297 {
264298 rcu_read_unlock();
265299 }
@@ -281,12 +315,10 @@ DEBUGFS_SEQ_FILE_OPEN(qp_stats) · 15 unmodified lines
281315 DEBUGFS_FILE_OPS(qp_stats);
282316
283317 static void *_sdes_seq_start(struct seq_file *s, loff_t *pos)
284−__acquires(RCU)
285318 {
286319 struct hfi1_ibdev *ibd;
287320 struct hfi1_devdata *dd;
288321
289− rcu_read_lock();
290322 ibd = (struct hfi1_ibdev *)s->private;
291323 dd = dd_from_dev(ibd);
292324 if (!dd->per_sdma || *pos >= dd->num_sdma)
@@ -306,9 +338,7 @@ static void *_sdes_seq_next(struct seq_file *s, void *v, loff_t *pos) · 13 unmodified lines
306338 }
307339
308340 static void _sdes_seq_stop(struct seq_file *s, void *v)
309−__releases(RCU)
310341 {
311− rcu_read_unlock();
312342 }
313343
314344 static int _sdes_seq_show(struct seq_file *s, void *v)
@@ -335,11 +365,9 @@ static ssize_t dev_counters_read(struct file *file, char __user *buf, · 20 unmodified lines
335365 struct hfi1_devdata *dd;
336366 ssize_t rval;
337367
338− rcu_read_lock();
339368 dd = private2dd(file);
340369 avail = hfi1_read_cntrs(dd, NULL, &counters);
341370 rval = simple_read_from_buffer(buf, count, ppos, counters, avail);
342− rcu_read_unlock();
343371 return rval;
344372 }
345373
@@ -352,11 +380,9 @@ static ssize_t dev_names_read(struct file *file, char __user *buf, · 6 unmodified lines
352380 struct hfi1_devdata *dd;
353381 ssize_t rval;
354382
355− rcu_read_lock();
356383 dd = private2dd(file);
357384 avail = hfi1_read_cntrs(dd, &names, NULL);
358385 rval = simple_read_from_buffer(buf, count, ppos, names, avail);
359− rcu_read_unlock();
360386 return rval;
361387 }
362388
@@ -379,11 +405,9 @@ static ssize_t portnames_read(struct file *file, char __user *buf, · 16 unmodified lines
379405 struct hfi1_devdata *dd;
380406 ssize_t rval;
381407
382− rcu_read_lock();
383408 dd = private2dd(file);
384409 avail = hfi1_read_portcntrs(dd->pport, &names, NULL);
385410 rval = simple_read_from_buffer(buf, count, ppos, names, avail);
386− rcu_read_unlock();
387411 return rval;
388412 }
389413
@@ -396,11 +420,9 @@ static ssize_t portcntrs_debugfs_read(struct file *file, char __user *buf, · 6 unmodified lines
396420 struct hfi1_pportdata *ppd;
397421 ssize_t rval;
398422
399− rcu_read_lock();
400423 ppd = private2ppd(file);
401424 avail = hfi1_read_portcntrs(ppd, NULL, &counters);
402425 rval = simple_read_from_buffer(buf, count, ppos, counters, avail);
403− rcu_read_unlock();
404426 return rval;
405427 }
406428
@@ -430,16 +452,13 @@ static ssize_t asic_flags_read(struct file *file, char __user *buf, · 23 unmodified lines
430452 int used;
431453 int i;
432454
433− rcu_read_lock();
434455 ppd = private2ppd(file);
435456 dd = ppd->dd;
436457 size = PAGE_SIZE;
437458 used = 0;
438459 tmp = kmalloc(size, GFP_KERNEL);
439− if (!tmp) {
440− rcu_read_unlock();
460+ if (!tmp)
441461 return -ENOMEM;
442− }
443462
444463 scratch0 = read_csr(dd, ASIC_CFG_SCRATCH);
445464 used += scnprintf(tmp + used, size - used,
@@ -466,7 +485,6 @@ static ssize_t asic_flags_read(struct file *file, char __user *buf, · 20 unmodified lines
466485 used += scnprintf(tmp + used, size - used, "Write bits to clear\n");
467486
468487 ret = simple_read_from_buffer(buf, count, ppos, tmp, used);
469− rcu_read_unlock();
470488 kfree(tmp);
471489 return ret;
472490 }
@@ -482,15 +500,12 @@ static ssize_t asic_flags_write(struct file *file, const char __user *buf, · 9 unmodified lines
482500 u64 scratch0;
483501 u64 clear;
484502
485− rcu_read_lock();
486503 ppd = private2ppd(file);
487504 dd = ppd->dd;
488505
489506 buff = kmalloc(count + 1, GFP_KERNEL);
490− if (!buff) {
491− ret = -ENOMEM;
492− goto do_return;
493− }
507+ if (!buff)
508+ return -ENOMEM;
494509
495510 ret = copy_from_user(buff, buf, count);
496511 if (ret > 0) {
@@ -523,8 +538,6 @@ static ssize_t asic_flags_write(struct file *file, const char __user *buf, · 26 unmodified lines
523538
524539 do_free:
525540 kfree(buff);
526− do_return:
527− rcu_read_unlock();
528541 return ret;
529542 }
530543
@@ -538,18 +551,14 @@ static ssize_t qsfp_debugfs_dump(struct file *file, char __user *buf, · 7 unmodified lines
538551 char *tmp;
539552 int ret;
540553
541− rcu_read_lock();
542554 ppd = private2ppd(file);
543555 tmp = kmalloc(PAGE_SIZE, GFP_KERNEL);
544− if (!tmp) {
545− rcu_read_unlock();
556+ if (!tmp)
546557 return -ENOMEM;
547− }
548558
549559 ret = qsfp_dump(ppd, tmp, PAGE_SIZE);
550560 if (ret > 0)
551561 ret = simple_read_from_buffer(buf, count, ppos, tmp, ret);
552− rcu_read_unlock();
553562 kfree(tmp);
554563 return ret;
555564 }
@@ -565,7 +574,6 @@ static ssize_t __i2c_debugfs_write(struct file *file, const char __user *buf, · 9 unmodified lines
565574 int offset;
566575 int total_written;
567576
568− rcu_read_lock();
569577 ppd = private2ppd(file);
570578
571579 /* byte offset format: [offsetSize][i2cAddr][offsetHigh][offsetLow] */
@@ -573,16 +581,12 @@ static ssize_t __i2c_debugfs_write(struct file *file, const char __user *buf, · 1 unmodified line
573581 offset = *ppos & 0xffff;
574582
575583 /* explicitly reject invalid address 0 to catch cp and cat */
576− if (i2c_addr == 0) {
577− ret = -EINVAL;
578− goto _return;
579− }
584+ if (i2c_addr == 0)
585+ return -EINVAL;
580586
581587 buff = kmalloc(count, GFP_KERNEL);
582− if (!buff) {
583− ret = -ENOMEM;
584− goto _return;
585− }
588+ if (!buff)
589+ return -ENOMEM;
586590
587591 ret = copy_from_user(buff, buf, count);
588592 if (ret > 0) {
@@ -602,8 +606,6 @@ static ssize_t __i2c_debugfs_write(struct file *file, const char __user *buf, · 13 unmodified lines
602606
603607 _free:
604608 kfree(buff);
605− _return:
606− rcu_read_unlock();
607609 return ret;
608610 }
609611
@@ -632,7 +634,6 @@ static ssize_t __i2c_debugfs_read(struct file *file, char __user *buf, · 22 unmodified lines
632634 int offset;
633635 int total_read;
634636
635− rcu_read_lock();
636637 ppd = private2ppd(file);
637638
638639 /* byte offset format: [offsetSize][i2cAddr][offsetHigh][offsetLow] */
@@ -640,16 +641,12 @@ static ssize_t __i2c_debugfs_read(struct file *file, char __user *buf, · 1 unmodified line
640641 offset = *ppos & 0xffff;
641642
642643 /* explicitly reject invalid address 0 to catch cp and cat */
643− if (i2c_addr == 0) {
644− ret = -EINVAL;
645− goto _return;
646− }
644+ if (i2c_addr == 0)
645+ return -EINVAL;
647646
648647 buff = kmalloc(count, GFP_KERNEL);
649− if (!buff) {
650− ret = -ENOMEM;
651− goto _return;
652− }
648+ if (!buff)
649+ return -ENOMEM;
653650
654651 total_read = i2c_read(ppd, target, i2c_addr, offset, buff, count);
655652 if (total_read < 0) {
@@ -669,8 +666,6 @@ static ssize_t __i2c_debugfs_read(struct file *file, char __user *buf, · 13 unmodified lines
669666
670667 _free:
671668 kfree(buff);
672− _return:
673− rcu_read_unlock();
674669 return ret;
675670 }
676671
@@ -697,26 +692,20 @@ static ssize_t __qsfp_debugfs_write(struct file *file, const char __user *buf, · 20 unmodified lines
697692 int ret;
698693 int total_written;
699694
700− rcu_read_lock();
701− if (*ppos + count > QSFP_PAGESIZE * 4) { /* base page + page00-page03 */
702− ret = -EINVAL;
703− goto _return;
704− }
695+ if (*ppos + count > QSFP_PAGESIZE * 4) /* base page + page00-page03 */
696+ return -EINVAL;
705697
706698 ppd = private2ppd(file);
707699
708700 buff = kmalloc(count, GFP_KERNEL);
709− if (!buff) {
710− ret = -ENOMEM;
711− goto _return;
712− }
701+ if (!buff)
702+ return -ENOMEM;
713703
714704 ret = copy_from_user(buff, buf, count);
715705 if (ret > 0) {
716706 ret = -EFAULT;
717707 goto _free;
718708 }
719−
720709 total_written = qsfp_write(ppd, target, *ppos, buff, count);
721710 if (total_written < 0) {
722711 ret = total_written;
@@ -729,8 +718,6 @@ static ssize_t __qsfp_debugfs_write(struct file *file, const char __user *buf, · 6 unmodified lines
729718
730719 _free:
731720 kfree(buff);
732− _return:
733− rcu_read_unlock();
734721 return ret;
735722 }
736723
@@ -757,7 +744,6 @@ static ssize_t __qsfp_debugfs_read(struct file *file, char __user *buf, · 20 unmodified lines
757744 int ret;
758745 int total_read;
759746
760− rcu_read_lock();
761747 if (*ppos + count > QSFP_PAGESIZE * 4) { /* base page + page00-page03 */
762748 ret = -EINVAL;
763749 goto _return;
@@ -790,7 +776,6 @@ static ssize_t __qsfp_debugfs_read(struct file *file, char __user *buf, · 26 unmodified lines
790776 _free:
791777 kfree(buff);
792778 _return:
793− rcu_read_unlock();
794779 return ret;
795780 }
796781
@@ -1006,7 +991,6 @@ void hfi1_dbg_ibdev_exit(struct hfi1_ibdev *ibd) · 209 unmodified lines
1006991 debugfs_remove_recursive(ibd->hfi1_ibdev_dbg);
1007992 out:
1008993 ibd->hfi1_ibdev_dbg = NULL;
1009− synchronize_rcu();
1010994 }
1011995
1012996 /*
@@ -1031,9 +1015,7 @@ static const char * const hfi1_statnames[] = { · 18 unmodified lines
10311015 };
10321016
10331017 static void *_driver_stats_names_seq_start(struct seq_file *s, loff_t *pos)
1034−__acquires(RCU)
10351018 {
1036− rcu_read_lock();
10371019 if (*pos >= ARRAY_SIZE(hfi1_statnames))
10381020 return NULL;
10391021 return pos;
@@ -1051,9 +1033,7 @@ static void *_driver_stats_names_seq_next( · 11 unmodified lines
10511033 }
10521034
10531035 static void _driver_stats_names_seq_stop(struct seq_file *s, void *v)
1054−__releases(RCU)
10551036 {
1056− rcu_read_unlock();
10571037 }
10581038
10591039 static int _driver_stats_names_seq_show(struct seq_file *s, void *v)
@@ -1069,9 +1049,7 @@ DEBUGFS_SEQ_FILE_OPEN(driver_stats_names) · 9 unmodified lines
10691049 DEBUGFS_FILE_OPS(driver_stats_names);
10701050
10711051 static void *_driver_stats_seq_start(struct seq_file *s, loff_t *pos)
1072−__acquires(RCU)
10731052 {
1074− rcu_read_lock();
10751053 if (*pos >= ARRAY_SIZE(hfi1_statnames))
10761054 return NULL;
10771055 return pos;
@@ -1086,9 +1064,7 @@ static void *_driver_stats_seq_next(struct seq_file *s, void *v, loff_t *pos) · 8 unmodified lines
10861064 }
10871065
10881066 static void _driver_stats_seq_stop(struct seq_file *s, void *v)
1089−__releases(RCU)
10901067 {
1091− rcu_read_unlock();
10921068 }
10931069
10941070 static u64 hfi1_sps_ints(void)
drivers/infiniband/hw/hfi1/driver.c+6−5
@@ -888,14 +888,15 @@ void set_all_slowpath(struct hfi1_devdata *dd) · 887 unmodified lines
888888 }
889889
890890 static inline int set_armed_to_active(struct hfi1_ctxtdata *rcd,
891− struct hfi1_packet packet,
891+ struct hfi1_packet *packet,
892892 struct hfi1_devdata *dd)
893893 {
894894 struct work_struct *lsaw = &rcd->ppd->linkstate_active_work;
895− struct hfi1_message_header *hdr = hfi1_get_msgheader(packet.rcd->dd,
896− packet.rhf_addr);
895+ struct hfi1_message_header *hdr = hfi1_get_msgheader(packet->rcd->dd,
896+ packet->rhf_addr);
897+ u8 etype = rhf_rcv_type(packet->rhf);
897898
898− if (hdr2sc(hdr, packet.rhf) != 0xf) {
899+ if (etype == RHF_RCV_TYPE_IB && hdr2sc(hdr, packet->rhf) != 0xf) {
899900 int hwstate = read_logical_state(dd);
900901
901902 if (hwstate != LSTATE_ACTIVE) {
@@ -979,7 +980,7 @@ int handle_receive_interrupt(struct hfi1_ctxtdata *rcd, int thread) · 77 unmodified lines
979980 /* Auto activate link on non-SC15 packet receive */
980981 if (unlikely(rcd->ppd->host_link_state ==
981982 HLS_UP_ARMED) &&
982− set_armed_to_active(rcd, packet, dd))
983+ set_armed_to_active(rcd, &packet, dd))
983984 goto bail;
984985 last = process_rcv_packet(&packet, thread);
985986 }
drivers/infiniband/hw/hfi1/file_ops.c+3−1
@@ -183,6 +183,7 @@ static int hfi1_file_open(struct inode *inode, struct file *fp) · 182 unmodified lines
183183 if (fd) {
184184 fd->rec_cpu_num = -1; /* no cpu affinity by default */
185185 fd->mm = current->mm;
186+ atomic_inc(&fd->mm->mm_count);
186187 }
187188
188189 fp->private_data = fd;
@@ -222,7 +223,7 @@ static long hfi1_file_ioctl(struct file *fp, unsigned int cmd, · 33 unmodified lines
222223 ret = assign_ctxt(fp, &uinfo);
223224 if (ret < 0)
224225 return ret;
225− setup_ctxt(fp);
226+ ret = setup_ctxt(fp);
226227 if (ret)
227228 return ret;
228229 ret = user_init(fp);
@@ -779,6 +780,7 @@ static int hfi1_file_close(struct inode *inode, struct file *fp) · 550 unmodified lines
779780 mutex_unlock(&hfi1_mutex);
780781 hfi1_free_ctxtdata(dd, uctxt);
781782 done:
783+ mmdrop(fdata->mm);
782784 kobject_put(&dd->kobj);
783785 kfree(fdata);
784786 return 0;
drivers/infiniband/hw/hfi1/hfi.h+21−3
@@ -605,6 +605,7 @@ struct hfi1_pportdata { · 604 unmodified lines
605605 struct work_struct freeze_work;
606606 struct work_struct link_downgrade_work;
607607 struct work_struct link_bounce_work;
608+ struct delayed_work start_link_work;
608609 /* host link state variables */
609610 struct mutex hls_lock;
610611 u32 host_link_state;
@@ -659,6 +660,7 @@ struct hfi1_pportdata { · 48 unmodified lines
659660 u8 linkinit_reason;
660661 u8 local_tx_rate; /* rate given to 8051 firmware */
661662 u8 last_pstate; /* info only */
663+ u8 qsfp_retry_count;
662664
663665 /* placeholders for IB MAD packet settings */
664666 u8 overrun_threshold;
@@ -1272,9 +1274,26 @@ static inline int hdr2sc(struct hfi1_message_header *hdr, u64 rhf) · 607 unmodified lines
12721274 ((!!(rhf_dc_info(rhf))) << 4);
12731275 }
12741276
1277+#define HFI1_JKEY_WIDTH 16
1278+#define HFI1_JKEY_MASK (BIT(16) - 1)
1279+#define HFI1_ADMIN_JKEY_RANGE 32
1280+
1281+/*
1282+ * J_KEYs are split and allocated in the following groups:
1283+ * 0 - 31 - users with administrator privileges
1284+ * 32 - 63 - kernel protocols using KDETH packets
1285+ * 64 - 65535 - all other users using KDETH packets
1286+ */
12751287 static inline u16 generate_jkey(kuid_t uid)
12761288 {
1277− return from_kuid(current_user_ns(), uid) & 0xffff;
1289+ u16 jkey = from_kuid(current_user_ns(), uid) & HFI1_JKEY_MASK;
1290+
1291+ if (capable(CAP_SYS_ADMIN))
1292+ jkey &= HFI1_ADMIN_JKEY_RANGE - 1;
1293+ else if (jkey < 64)
1294+ jkey |= BIT(HFI1_JKEY_WIDTH - 1);
1295+
1296+ return jkey;
12781297 }
12791298
12801299 /*
@@ -1656,7 +1675,6 @@ struct cc_state *get_cc_state_protected(struct hfi1_pportdata *ppd) · 375 unmodified lines
16561675 struct hfi1_devdata *hfi1_init_dd(struct pci_dev *,
16571676 const struct pci_device_id *);
16581677 void hfi1_free_devdata(struct hfi1_devdata *);
1659−void cc_state_reclaim(struct rcu_head *rcu);
16601678 struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_t extra);
16611679
16621680 /* LED beaconing functions */
@@ -1788,7 +1806,7 @@ extern unsigned int hfi1_max_mtu; · 125 unmodified lines
17881806 extern unsigned int hfi1_cu;
17891807 extern unsigned int user_credit_return_threshold;
17901808 extern int num_user_contexts;
1791−extern unsigned n_krcvqs;
1809+extern unsigned long n_krcvqs;
17921810 extern uint krcvqs[];
17931811 extern int krcvqsset;
17941812 extern uint kdeth_qp;
drivers/infiniband/hw/hfi1/init.c+3−2
@@ -94,7 +94,7 @@ module_param_array(krcvqs, uint, &krcvqsset, S_IRUGO); · 93 unmodified lines
9494 MODULE_PARM_DESC(krcvqs, "Array of the number of non-control kernel receive queues by VL");
9595
9696 /* computed based on above array */
97−unsigned n_krcvqs;
97+unsigned long n_krcvqs;
9898
9999 static unsigned hfi1_rcvarr_split = 25;
100100 module_param_named(rcvarr_split, hfi1_rcvarr_split, uint, S_IRUGO);
@@ -500,6 +500,7 @@ void hfi1_init_pportdata(struct pci_dev *pdev, struct hfi1_pportdata *ppd, · 399 unmodified lines
500500 INIT_WORK(&ppd->link_downgrade_work, handle_link_downgrade);
501501 INIT_WORK(&ppd->sma_message_work, handle_sma_message);
502502 INIT_WORK(&ppd->link_bounce_work, handle_link_bounce);
503+ INIT_DELAYED_WORK(&ppd->start_link_work, handle_start_link);
503504 INIT_WORK(&ppd->linkstate_active_work, receive_interrupt_work);
504505 INIT_WORK(&ppd->qsfp_info.qsfp_work, qsfp_event);
505506
@@ -1333,7 +1334,7 @@ static void cleanup_device_data(struct hfi1_devdata *dd) · 827 unmodified lines
13331334 spin_unlock(&ppd->cc_state_lock);
13341335
13351336 if (cc_state)
1336− call_rcu(&cc_state->rcu, cc_state_reclaim);
1337+ kfree_rcu(cc_state, rcu);
13371338 }
13381339
13391340 free_credit_return(dd);
drivers/infiniband/hw/hfi1/mad.c+12−14
@@ -1819,6 +1819,11 @@ static int __subn_get_opa_cable_info(struct opa_smp *smp, u32 am, u8 *data, · 1818 unmodified lines
18191819 u32 len = OPA_AM_CI_LEN(am) + 1;
18201820 int ret;
18211821
1822+ if (dd->pport->port_type != PORT_TYPE_QSFP) {
1823+ smp->status |= IB_SMP_INVALID_FIELD;
1824+ return reply((struct ib_mad_hdr *)smp);
1825+ }
1826+
18221827 #define __CI_PAGE_SIZE BIT(7) /* 128 bytes */
18231828 #define __CI_PAGE_MASK ~(__CI_PAGE_SIZE - 1)
18241829 #define __CI_PAGE_NUM(a) ((a) & __CI_PAGE_MASK)
@@ -2599,7 +2604,7 @@ static int pma_get_opa_datacounters(struct opa_pma_mad *pmp, · 774 unmodified lines
25992604 u8 lq, num_vls;
26002605 u8 res_lli, res_ler;
26012606 u64 port_mask;
2602− unsigned long port_num;
2607+ u8 port_num;
26032608 unsigned long vl;
26042609 u32 vl_select_mask;
26052610 int vfi;
@@ -2633,9 +2638,9 @@ static int pma_get_opa_datacounters(struct opa_pma_mad *pmp, · 27 unmodified lines
26332638 */
26342639 port_mask = be64_to_cpu(req->port_select_mask[3]);
26352640 port_num = find_first_bit((unsigned long *)&port_mask,
2636− sizeof(port_mask));
2641+ sizeof(port_mask) * 8);
26372642
2638− if ((u8)port_num != port) {
2643+ if (port_num != port) {
26392644 pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
26402645 return reply((struct ib_mad_hdr *)pmp);
26412646 }
@@ -2837,7 +2842,7 @@ static int pma_get_opa_porterrors(struct opa_pma_mad *pmp, · 195 unmodified lines
28372842 */
28382843 port_mask = be64_to_cpu(req->port_select_mask[3]);
28392844 port_num = find_first_bit((unsigned long *)&port_mask,
2840− sizeof(port_mask));
2845+ sizeof(port_mask) * 8);
28412846
28422847 if (port_num != port) {
28432848 pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
@@ -3010,7 +3015,7 @@ static int pma_get_opa_errorinfo(struct opa_pma_mad *pmp, · 166 unmodified lines
30103015 */
30113016 port_mask = be64_to_cpu(req->port_select_mask[3]);
30123017 port_num = find_first_bit((unsigned long *)&port_mask,
3013− sizeof(port_mask));
3018+ sizeof(port_mask) * 8);
30143019
30153020 if (port_num != port) {
30163021 pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
@@ -3247,7 +3252,7 @@ static int pma_set_opa_errorinfo(struct opa_pma_mad *pmp, · 230 unmodified lines
32473252 */
32483253 port_mask = be64_to_cpu(req->port_select_mask[3]);
32493254 port_num = find_first_bit((unsigned long *)&port_mask,
3250− sizeof(port_mask));
3255+ sizeof(port_mask) * 8);
32513256
32523257 if (port_num != port) {
32533258 pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
@@ -3398,7 +3403,7 @@ static void apply_cc_state(struct hfi1_pportdata *ppd) · 144 unmodified lines
33983403
33993404 spin_unlock(&ppd->cc_state_lock);
34003405
3401− call_rcu(&old_cc_state->rcu, cc_state_reclaim);
3406+ kfree_rcu(old_cc_state, rcu);
34023407 }
34033408
34043409 static int __subn_set_opa_cong_setting(struct opa_smp *smp, u32 am, u8 *data,
@@ -3553,13 +3558,6 @@ static int __subn_get_opa_cc_table(struct opa_smp *smp, u32 am, u8 *data, · 148 unmodified lines
35533558 return reply((struct ib_mad_hdr *)smp);
35543559 }
35553560
3556−void cc_state_reclaim(struct rcu_head *rcu)
3557−{
3558− struct cc_state *cc_state = container_of(rcu, struct cc_state, rcu);
3559−
3560− kfree(cc_state);
3561−}
3562−
35633561 static int __subn_set_opa_cc_table(struct opa_smp *smp, u32 am, u8 *data,
35643562 struct ib_device *ibdev, u8 port,
35653563 u32 *resp_len)
drivers/infiniband/hw/hfi1/pio_copy.c+12−0
@@ -771,6 +771,9 @@ void seg_pio_copy_mid(struct pio_buf *pbuf, const void *from, size_t nbytes) · 770 unmodified lines
771771 read_extra_bytes(pbuf, from, to_fill);
772772 from += to_fill;
773773 nbytes -= to_fill;
774+ /* may not be enough valid bytes left to align */
775+ if (extra > nbytes)
776+ extra = nbytes;
774777
775778 /* ...now write carry */
776779 dest = pbuf->start + (pbuf->qw_written * sizeof(u64));
@@ -798,6 +801,15 @@ void seg_pio_copy_mid(struct pio_buf *pbuf, const void *from, size_t nbytes) · 21 unmodified lines
798801 read_low_bytes(pbuf, from, extra);
799802 from += extra;
800803 nbytes -= extra;
804+ /*
805+ * If no bytes are left, return early - we are done.
806+ * NOTE: This short-circuit is *required* because
807+ * "extra" may have been reduced in size and "from"
808+ * is not aligned, as required when leaving this
809+ * if block.
810+ */
811+ if (nbytes == 0)
812+ return;
801813 }
802814
803815 /* at this point, from is QW aligned */
drivers/infiniband/hw/hfi1/qp.c+0−4
@@ -656,10 +656,6 @@ struct qp_iter *qp_iter_init(struct hfi1_ibdev *dev) · 655 unmodified lines
656656
657657 iter->dev = dev;
658658 iter->specials = dev->rdi.ibdev.phys_port_cnt * 2;
659− if (qp_iter_next(iter)) {
660− kfree(iter);
661− return NULL;
662− }
663659
664660 return iter;
665661 }
drivers/infiniband/hw/hfi1/qsfp.c+30−2
@@ -706,8 +706,8 @@ int get_cable_info(struct hfi1_devdata *dd, u32 port_num, u32 addr, u32 len, · 705 unmodified lines
706706 u8 *data)
707707 {
708708 struct hfi1_pportdata *ppd;
709− u32 excess_len = 0;
710− int ret = 0;
709+ u32 excess_len = len;
710+ int ret = 0, offset = 0;
711711
712712 if (port_num > dd->num_pports || port_num < 1) {
713713 dd_dev_info(dd, "%s: Invalid port number %d\n",
@@ -740,6 +740,34 @@ int get_cable_info(struct hfi1_devdata *dd, u32 port_num, u32 addr, u32 len, · 26 unmodified lines
740740 }
741741
742742 memcpy(data, &ppd->qsfp_info.cache[addr], len);
743+
744+ if (addr <= QSFP_MONITOR_VAL_END &&
745+ (addr + len) >= QSFP_MONITOR_VAL_START) {
746+ /* Overlap with the dynamic channel monitor range */
747+ if (addr < QSFP_MONITOR_VAL_START) {
748+ if (addr + len <= QSFP_MONITOR_VAL_END)
749+ len = addr + len - QSFP_MONITOR_VAL_START;
750+ else
751+ len = QSFP_MONITOR_RANGE;
752+ offset = QSFP_MONITOR_VAL_START - addr;
753+ addr = QSFP_MONITOR_VAL_START;
754+ } else if (addr == QSFP_MONITOR_VAL_START) {
755+ offset = 0;
756+ if (addr + len > QSFP_MONITOR_VAL_END)
757+ len = QSFP_MONITOR_RANGE;
758+ } else {
759+ offset = 0;
760+ if (addr + len > QSFP_MONITOR_VAL_END)
761+ len = QSFP_MONITOR_VAL_END - addr + 1;
762+ }
763+ /* Refresh the values of the dynamic monitors from the cable */
764+ ret = one_qsfp_read(ppd, dd->hfi1_id, addr, data + offset, len);
765+ if (ret != len) {
766+ ret = -EAGAIN;
767+ goto set_zeroes;
768+ }
769+ }
770+
743771 return 0;
744772
745773 set_zeroes:
drivers/infiniband/hw/hfi1/qsfp.h+3−0
@@ -74,6 +74,9 @@ · 73 unmodified lines
7474 /* Defined fields that Intel requires of qualified cables */
7575 /* Byte 0 is Identifier, not checked */
7676 /* Byte 1 is reserved "status MSB" */
77+#define QSFP_MONITOR_VAL_START 22
78+#define QSFP_MONITOR_VAL_END 81
79+#define QSFP_MONITOR_RANGE (QSFP_MONITOR_VAL_END - QSFP_MONITOR_VAL_START + 1)
7780 #define QSFP_TX_CTRL_BYTE_OFFS 86
7881 #define QSFP_PWR_CTRL_BYTE_OFFS 93
7982 #define QSFP_CDR_CTRL_BYTE_OFFS 98
drivers/infiniband/hw/hfi1/user_sdma.c+4−1
@@ -114,6 +114,8 @@ MODULE_PARM_DESC(sdma_comp_size, "Size of User SDMA completion ring. Default: 12 · 113 unmodified lines
114114 #define KDETH_HCRC_LOWER_SHIFT 24
115115 #define KDETH_HCRC_LOWER_MASK 0xff
116116
117+#define AHG_KDETH_INTR_SHIFT 12
118+
117119 #define PBC2LRH(x) ((((x) & 0xfff) << 2) - 4)
118120 #define LRH2PBC(x) ((((x) >> 2) + 1) & 0xfff)
119121
@@ -1480,7 +1482,8 @@ static int set_txreq_header_ahg(struct user_sdma_request *req, · 1360 unmodified lines
14801482 /* Clear KDETH.SH on last packet */
14811483 if (unlikely(tx->flags & TXREQ_FLAGS_REQ_LAST_PKT)) {
14821484 val |= cpu_to_le16(KDETH_GET(hdr->kdeth.ver_tid_offset,
1483− INTR) >> 16);
1485+ INTR) <<
1486+ AHG_KDETH_INTR_SHIFT);
14841487 val &= cpu_to_le16(~(1U << 13));
14851488 AHG_HEADER_SET(req->ahg, diff, 7, 16, 14, val);
14861489 } else {
drivers/infiniband/hw/i40iw/i40iw.h+2−2
@@ -232,7 +232,7 @@ struct i40iw_device { · 231 unmodified lines
232232 struct i40e_client *client;
233233 struct i40iw_hw hw;
234234 struct i40iw_cm_core cm_core;
235− unsigned long *mem_resources;
235+ u8 *mem_resources;
236236 unsigned long *allocated_qps;
237237 unsigned long *allocated_cqs;
238238 unsigned long *allocated_mrs;
@@ -435,8 +435,8 @@ static inline int i40iw_alloc_resource(struct i40iw_device *iwdev, · 196 unmodified lines
435435 *next = resource_num + 1;
436436 if (*next == max_resources)
437437 *next = 0;
438− spin_unlock_irqrestore(&iwdev->resource_lock, flags);
439438 *req_resource_num = resource_num;
439+ spin_unlock_irqrestore(&iwdev->resource_lock, flags);
440440
441441 return 0;
442442 }
drivers/infiniband/hw/i40iw/i40iw_cm.c+3−23
@@ -535,8 +535,8 @@ static struct i40iw_puda_buf *i40iw_form_cm_frame(struct i40iw_cm_node *cm_node, · 534 unmodified lines
535535 buf += hdr_len;
536536 }
537537
538− if (pd_len)
539− memcpy(buf, pdata->addr, pd_len);
538+ if (pdata && pdata->addr)
539+ memcpy(buf, pdata->addr, pdata->size);
540540
541541 atomic_set(&sqbuf->refcount, 1);
542542
@@ -3346,26 +3346,6 @@ int i40iw_cm_disconn(struct i40iw_qp *iwqp) · 2803 unmodified lines
33463346 return 0;
33473347 }
33483348
3349−/**
3350− * i40iw_loopback_nop - Send a nop
3351− * @qp: associated hw qp
3352− */
3353−static void i40iw_loopback_nop(struct i40iw_sc_qp *qp)
3354−{
3355− u64 *wqe;
3356− u64 header;
3357−
3358− wqe = qp->qp_uk.sq_base->elem;
3359− set_64bit_val(wqe, 0, 0);
3360− set_64bit_val(wqe, 8, 0);
3361− set_64bit_val(wqe, 16, 0);
3362−
3363− header = LS_64(I40IWQP_OP_NOP, I40IWQPSQ_OPCODE) |
3364− LS_64(0, I40IWQPSQ_SIGCOMPL) |
3365− LS_64(qp->qp_uk.swqe_polarity, I40IWQPSQ_VALID);
3366− set_64bit_val(wqe, 24, header);
3367−}
3368−
33693349 /**
33703350 * i40iw_qp_disconnect - free qp and close cm
33713351 * @iwqp: associate qp for the connection
@@ -3638,7 +3618,7 @@ int i40iw_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) · 266 unmodified lines
36383618 } else {
36393619 if (iwqp->page)
36403620 iwqp->sc_qp.qp_uk.sq_base = kmap(iwqp->page);
3641− i40iw_loopback_nop(&iwqp->sc_qp);
3621+ dev->iw_priv_qp_ops->qp_send_lsmm(&iwqp->sc_qp, NULL, 0, 0);
36423622 }
36433623
36443624 if (iwqp->page)
drivers/infiniband/hw/i40iw/i40iw_hw.c+1−0
@@ -265,6 +265,7 @@ void i40iw_next_iw_state(struct i40iw_qp *iwqp, · 264 unmodified lines
265265 info.dont_send_fin = false;
266266 if (iwqp->sc_qp.term_flags && (state == I40IW_QP_STATE_ERROR))
267267 info.reset_tcp_conn = true;
268+ iwqp->hw_iwarp_state = state;
268269 i40iw_hw_modify_qp(iwqp->iwdev, iwqp, &info, 0);
269270 }
270271
drivers/infiniband/hw/i40iw/i40iw_main.c+7−5
@@ -100,7 +100,7 @@ static struct notifier_block i40iw_net_notifier = { · 99 unmodified lines
100100 .notifier_call = i40iw_net_event
101101 };
102102
103−static int i40iw_notifiers_registered;
103+static atomic_t i40iw_notifiers_registered;
104104
105105 /**
106106 * i40iw_find_i40e_handler - find a handler given a client info
@@ -1342,12 +1342,11 @@ exit: · 1235 unmodified lines
13421342 */
13431343 static void i40iw_register_notifiers(void)
13441344 {
1345− if (!i40iw_notifiers_registered) {
1345+ if (atomic_inc_return(&i40iw_notifiers_registered) == 1) {
13461346 register_inetaddr_notifier(&i40iw_inetaddr_notifier);
13471347 register_inet6addr_notifier(&i40iw_inetaddr6_notifier);
13481348 register_netevent_notifier(&i40iw_net_notifier);
13491349 }
1350− i40iw_notifiers_registered++;
13511350 }
13521351
13531352 /**
@@ -1429,8 +1428,7 @@ static void i40iw_deinit_device(struct i40iw_device *iwdev, bool reset, bool del · 75 unmodified lines
14291428 i40iw_del_macip_entry(iwdev, (u8)iwdev->mac_ip_table_idx);
14301429 /* fallthrough */
14311430 case INET_NOTIFIER:
1432− if (i40iw_notifiers_registered > 0) {
1433− i40iw_notifiers_registered--;
1431+ if (!atomic_dec_return(&i40iw_notifiers_registered)) {
14341432 unregister_netevent_notifier(&i40iw_net_notifier);
14351433 unregister_inetaddr_notifier(&i40iw_inetaddr_notifier);
14361434 unregister_inet6addr_notifier(&i40iw_inetaddr6_notifier);
@@ -1558,6 +1556,10 @@ static int i40iw_open(struct i40e_info *ldev, struct i40e_client *client) · 121 unmodified lines
15581556 enum i40iw_status_code status;
15591557 struct i40iw_handler *hdl;
15601558
1559+ hdl = i40iw_find_netdev(ldev->netdev);
1560+ if (hdl)
1561+ return 0;
1562+
15611563 hdl = kzalloc(sizeof(*hdl), GFP_KERNEL);
15621564 if (!hdl)
15631565 return -ENOMEM;
drivers/infiniband/hw/i40iw/i40iw_utils.c+4−1
@@ -673,8 +673,11 @@ enum i40iw_status_code i40iw_free_virt_mem(struct i40iw_hw *hw, · 672 unmodified lines
673673 {
674674 if (!mem)
675675 return I40IW_ERR_PARAM;
676+ /*
677+ * mem->va points to the parent of mem, so both mem and mem->va
678+ * can not be touched once mem->va is freed
679+ */
676680 kfree(mem->va);
677− mem->va = NULL;
678681 return 0;
679682 }
680683
drivers/infiniband/hw/i40iw/i40iw_verbs.c+1−3
@@ -794,7 +794,6 @@ static struct ib_qp *i40iw_create_qp(struct ib_pd *ibpd, · 793 unmodified lines
794794 return &iwqp->ibqp;
795795 error:
796796 i40iw_free_qp_resources(iwdev, iwqp, qp_num);
797− kfree(mem);
798797 return ERR_PTR(err_code);
799798 }
800799
@@ -1926,8 +1925,7 @@ static int i40iw_dereg_mr(struct ib_mr *ib_mr) · 1125 unmodified lines
19261925 }
19271926 if (iwpbl->pbl_allocated)
19281927 i40iw_free_pble(iwdev->pble_rsrc, palloc);
1929− kfree(iwpbl->iwmr);
1930− iwpbl->iwmr = NULL;
1928+ kfree(iwmr);
19311929 return 0;
19321930 }
19331931
drivers/infiniband/hw/mlx4/cq.c+9−31
@@ -576,8 +576,8 @@ static int mlx4_ib_ipoib_csum_ok(__be16 status, __be16 checksum) · 575 unmodified lines
576576 checksum == cpu_to_be16(0xffff);
577577 }
578578
579−static int use_tunnel_data(struct mlx4_ib_qp *qp, struct mlx4_ib_cq *cq, struct ib_wc *wc,
580− unsigned tail, struct mlx4_cqe *cqe, int is_eth)
579+static void use_tunnel_data(struct mlx4_ib_qp *qp, struct mlx4_ib_cq *cq, struct ib_wc *wc,
580+ unsigned tail, struct mlx4_cqe *cqe, int is_eth)
581581 {
582582 struct mlx4_ib_proxy_sqp_hdr *hdr;
583583
@@ -600,8 +600,6 @@ static int use_tunnel_data(struct mlx4_ib_qp *qp, struct mlx4_ib_cq *cq, struct · 16 unmodified lines
600600 wc->slid = be16_to_cpu(hdr->tun.slid_mac_47_32);
601601 wc->sl = (u8) (be16_to_cpu(hdr->tun.sl_vid) >> 12);
602602 }
603−
604− return 0;
605603 }
606604
607605 static void mlx4_ib_qp_sw_comp(struct mlx4_ib_qp *qp, int num_entries,
@@ -689,12 +687,6 @@ repoll: · 81 unmodified lines
689687 is_error = (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) ==
690688 MLX4_CQE_OPCODE_ERROR;
691689
692− if (unlikely((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) == MLX4_OPCODE_NOP &&
693− is_send)) {
694− pr_warn("Completion for NOP opcode detected!\n");
695− return -EINVAL;
696− }
697−
698690 /* Resize CQ in progress */
699691 if (unlikely((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) == MLX4_CQE_OPCODE_RESIZE)) {
700692 if (cq->resize_buf) {
@@ -720,12 +712,6 @@ repoll: · 19 unmodified lines
720712 */
721713 mqp = __mlx4_qp_lookup(to_mdev(cq->ibcq.device)->dev,
722714 be32_to_cpu(cqe->vlan_my_qpn));
723− if (unlikely(!mqp)) {
724− pr_warn("CQ %06x with entry for unknown QPN %06x\n",
725− cq->mcq.cqn, be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_QPN_MASK);
726− return -EINVAL;
727− }
728−
729715 *cur_qp = to_mibqp(mqp);
730716 }
731717
@@ -738,11 +724,6 @@ repoll: · 6 unmodified lines
738724 /* SRQ is also in the radix tree */
739725 msrq = mlx4_srq_lookup(to_mdev(cq->ibcq.device)->dev,
740726 srq_num);
741− if (unlikely(!msrq)) {
742− pr_warn("CQ %06x with entry for unknown SRQN %06x\n",
743− cq->mcq.cqn, srq_num);
744− return -EINVAL;
745− }
746727 }
747728
748729 if (is_send) {
@@ -852,9 +833,11 @@ repoll: · 103 unmodified lines
852833 if (mlx4_is_mfunc(to_mdev(cq->ibcq.device)->dev)) {
853834 if ((*cur_qp)->mlx4_ib_qp_type &
854835 (MLX4_IB_QPT_PROXY_SMI_OWNER |
855− MLX4_IB_QPT_PROXY_SMI | MLX4_IB_QPT_PROXY_GSI))
856− return use_tunnel_data(*cur_qp, cq, wc, tail,
857− cqe, is_eth);
836+ MLX4_IB_QPT_PROXY_SMI | MLX4_IB_QPT_PROXY_GSI)) {
837+ use_tunnel_data(*cur_qp, cq, wc, tail, cqe,
838+ is_eth);
839+ return 0;
840+ }
858841 }
859842
860843 wc->slid = be16_to_cpu(cqe->rlid);
@@ -891,7 +874,6 @@ int mlx4_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) · 30 unmodified lines
891874 struct mlx4_ib_qp *cur_qp = NULL;
892875 unsigned long flags;
893876 int npolled;
894− int err = 0;
895877 struct mlx4_ib_dev *mdev = to_mdev(cq->ibcq.device);
896878
897879 spin_lock_irqsave(&cq->lock, flags);
@@ -901,8 +883,7 @@ int mlx4_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) · 3 unmodified lines
901883 }
902884
903885 for (npolled = 0; npolled < num_entries; ++npolled) {
904− err = mlx4_ib_poll_one(cq, &cur_qp, wc + npolled);
905− if (err)
886+ if (mlx4_ib_poll_one(cq, &cur_qp, wc + npolled))
906887 break;
907888 }
908889
@@ -911,10 +892,7 @@ int mlx4_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) · 2 unmodified lines
911892 out:
912893 spin_unlock_irqrestore(&cq->lock, flags);
913894
914− if (err == 0 || err == -EAGAIN)
915− return npolled;
916− else
917− return err;
895+ return npolled;
918896 }
919897
920898 int mlx4_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
drivers/infiniband/hw/mlx4/mad.c+23−0
@@ -1128,6 +1128,27 @@ void handle_port_mgmt_change_event(struct work_struct *work) · 1127 unmodified lines
11281128
11291129 /* Generate GUID changed event */
11301130 if (changed_attr & MLX4_EQ_PORT_INFO_GID_PFX_CHANGE_MASK) {
1131+ if (mlx4_is_master(dev->dev)) {
1132+ union ib_gid gid;
1133+ int err = 0;
1134+
1135+ if (!eqe->event.port_mgmt_change.params.port_info.gid_prefix)
1136+ err = __mlx4_ib_query_gid(&dev->ib_dev, port, 0, &gid, 1);
1137+ else
1138+ gid.global.subnet_prefix =
1139+ eqe->event.port_mgmt_change.params.port_info.gid_prefix;
1140+ if (err) {
1141+ pr_warn("Could not change QP1 subnet prefix for port %d: query_gid error (%d)\n",
1142+ port, err);
1143+ } else {
1144+ pr_debug("Changing QP1 subnet prefix for port %d. old=0x%llx. new=0x%llx\n",
1145+ port,
1146+ (u64)atomic64_read(&dev->sriov.demux[port - 1].subnet_prefix),
1147+ be64_to_cpu(gid.global.subnet_prefix));
1148+ atomic64_set(&dev->sriov.demux[port - 1].subnet_prefix,
1149+ be64_to_cpu(gid.global.subnet_prefix));
1150+ }
1151+ }
11311152 mlx4_ib_dispatch_event(dev, port, IB_EVENT_GID_CHANGE);
11321153 /*if master, notify all slaves*/
11331154 if (mlx4_is_master(dev->dev))
@@ -2202,6 +2223,8 @@ int mlx4_ib_init_sriov(struct mlx4_ib_dev *dev) · 1068 unmodified lines
22022223 if (err)
22032224 goto demux_err;
22042225 dev->sriov.demux[i].guid_cache[0] = gid.global.interface_id;
2226+ atomic64_set(&dev->sriov.demux[i].subnet_prefix,
2227+ be64_to_cpu(gid.global.subnet_prefix));
22052228 err = alloc_pv_object(dev, mlx4_master_func_num(dev->dev), i + 1,
22062229 &dev->sriov.sqps[i]);
22072230 if (err)
drivers/infiniband/hw/mlx4/main.c+3−0
@@ -2202,6 +2202,9 @@ static int mlx4_ib_alloc_diag_counters(struct mlx4_ib_dev *ibdev) · 2201 unmodified lines
22022202 bool per_port = !!(ibdev->dev->caps.flags2 &
22032203 MLX4_DEV_CAP_FLAG2_DIAG_PER_PORT);
22042204
2205+ if (mlx4_is_slave(ibdev->dev))
2206+ return 0;
2207+
22052208 for (i = 0; i < MLX4_DIAG_COUNTERS_TYPES; i++) {
22062209 /* i == 1 means we are building port counters */
22072210 if (i && !per_port)
drivers/infiniband/hw/mlx4/mcg.c+7−7
@@ -489,7 +489,7 @@ static u8 get_leave_state(struct mcast_group *group) · 488 unmodified lines
489489 if (!group->members[i])
490490 leave_state |= (1 << i);
491491
492− return leave_state & (group->rec.scope_join_state & 7);
492+ return leave_state & (group->rec.scope_join_state & 0xf);
493493 }
494494
495495 static int join_group(struct mcast_group *group, int slave, u8 join_mask)
@@ -564,8 +564,8 @@ static void mlx4_ib_mcg_timeout_handler(struct work_struct *work) · 68 unmodified lines
564564 } else
565565 mcg_warn_group(group, "DRIVER BUG\n");
566566 } else if (group->state == MCAST_LEAVE_SENT) {
567− if (group->rec.scope_join_state & 7)
568− group->rec.scope_join_state &= 0xf8;
567+ if (group->rec.scope_join_state & 0xf)
568+ group->rec.scope_join_state &= 0xf0;
569569 group->state = MCAST_IDLE;
570570 mutex_unlock(&group->lock);
571571 if (release_group(group, 1))
@@ -605,7 +605,7 @@ static int handle_leave_req(struct mcast_group *group, u8 leave_mask, · 33 unmodified lines
605605 static int handle_join_req(struct mcast_group *group, u8 join_mask,
606606 struct mcast_req *req)
607607 {
608− u8 group_join_state = group->rec.scope_join_state & 7;
608+ u8 group_join_state = group->rec.scope_join_state & 0xf;
609609 int ref = 0;
610610 u16 status;
611611 struct ib_sa_mcmember_data *sa_data = (struct ib_sa_mcmember_data *)req->sa_mad.data;
@@ -690,8 +690,8 @@ static void mlx4_ib_mcg_work_handler(struct work_struct *work) · 78 unmodified lines
690690 u8 cur_join_state;
691691
692692 resp_join_state = ((struct ib_sa_mcmember_data *)
693− group->response_sa_mad.data)->scope_join_state & 7;
694− cur_join_state = group->rec.scope_join_state & 7;
693+ group->response_sa_mad.data)->scope_join_state & 0xf;
694+ cur_join_state = group->rec.scope_join_state & 0xf;
695695
696696 if (method == IB_MGMT_METHOD_GET_RESP) {
697697 /* successfull join */
@@ -710,7 +710,7 @@ process_requests: · 12 unmodified lines
710710 req = list_first_entry(&group->pending_list, struct mcast_req,
711711 group_list);
712712 sa_data = (struct ib_sa_mcmember_data *)req->sa_mad.data;
713− req_join_state = sa_data->scope_join_state & 0x7;
713+ req_join_state = sa_data->scope_join_state & 0xf;
714714
715715 /* For a leave request, we will immediately answer the VF, and
716716 * update our internal counters. The actual leave will be sent
drivers/infiniband/hw/mlx4/mlx4_ib.h+1−1
@@ -448,7 +448,7 @@ struct mlx4_ib_demux_ctx { · 447 unmodified lines
448448 struct workqueue_struct *wq;
449449 struct workqueue_struct *ud_wq;
450450 spinlock_t ud_lock;
451− __be64 subnet_prefix;
451+ atomic64_t subnet_prefix;
452452 __be64 guid_cache[128];
453453 struct mlx4_ib_dev *dev;
454454 /* the following lock protects both mcg_table and mcg_mgid0_list */
drivers/infiniband/hw/mlx4/qp.c+20−17
@@ -2493,24 +2493,27 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_ud_wr *wr, · 2492 unmodified lines
24932493 sqp->ud_header.grh.flow_label =
24942494 ah->av.ib.sl_tclass_flowlabel & cpu_to_be32(0xfffff);
24952495 sqp->ud_header.grh.hop_limit = ah->av.ib.hop_limit;
2496− if (is_eth)
2496+ if (is_eth) {
24972497 memcpy(sqp->ud_header.grh.source_gid.raw, sgid.raw, 16);
2498− else {
2499− if (mlx4_is_mfunc(to_mdev(ib_dev)->dev)) {
2500− /* When multi-function is enabled, the ib_core gid
2501− * indexes don't necessarily match the hw ones, so
2502− * we must use our own cache */
2503− sqp->ud_header.grh.source_gid.global.subnet_prefix =
2504− to_mdev(ib_dev)->sriov.demux[sqp->qp.port - 1].
2505− subnet_prefix;
2506− sqp->ud_header.grh.source_gid.global.interface_id =
2507− to_mdev(ib_dev)->sriov.demux[sqp->qp.port - 1].
2508− guid_cache[ah->av.ib.gid_index];
2509− } else
2510− ib_get_cached_gid(ib_dev,
2511− be32_to_cpu(ah->av.ib.port_pd) >> 24,
2512− ah->av.ib.gid_index,
2513− &sqp->ud_header.grh.source_gid, NULL);
2498+ } else {
2499+ if (mlx4_is_mfunc(to_mdev(ib_dev)->dev)) {
2500+ /* When multi-function is enabled, the ib_core gid
2501+ * indexes don't necessarily match the hw ones, so
2502+ * we must use our own cache
2503+ */
2504+ sqp->ud_header.grh.source_gid.global.subnet_prefix =
2505+ cpu_to_be64(atomic64_read(&(to_mdev(ib_dev)->sriov.
2506+ demux[sqp->qp.port - 1].
2507+ subnet_prefix)));
2508+ sqp->ud_header.grh.source_gid.global.interface_id =
2509+ to_mdev(ib_dev)->sriov.demux[sqp->qp.port - 1].
2510+ guid_cache[ah->av.ib.gid_index];
2511+ } else {
2512+ ib_get_cached_gid(ib_dev,
2513+ be32_to_cpu(ah->av.ib.port_pd) >> 24,
2514+ ah->av.ib.gid_index,
2515+ &sqp->ud_header.grh.source_gid, NULL);
2516+ }
25142517 }
25152518 memcpy(sqp->ud_header.grh.destination_gid.raw,
25162519 ah->av.ib.dgid, 16);
drivers/infiniband/hw/mlx5/cq.c+2−20
@@ -553,12 +553,6 @@ repoll: · 552 unmodified lines
553553 * from the table.
554554 */
555555 mqp = __mlx5_qp_lookup(dev->mdev, qpn);
556− if (unlikely(!mqp)) {
557− mlx5_ib_warn(dev, "CQE@CQ %06x for unknown QPN %6x\n",
558− cq->mcq.cqn, qpn);
559− return -EINVAL;
560− }
561−
562556 *cur_qp = to_mibqp(mqp);
563557 }
564558
@@ -619,13 +613,6 @@ repoll: · 54 unmodified lines
619613 read_lock(&dev->mdev->priv.mkey_table.lock);
620614 mmkey = __mlx5_mr_lookup(dev->mdev,
621615 mlx5_base_mkey(be32_to_cpu(sig_err_cqe->mkey)));
622− if (unlikely(!mmkey)) {
623− read_unlock(&dev->mdev->priv.mkey_table.lock);
624− mlx5_ib_warn(dev, "CQE@CQ %06x for unknown MR %6x\n",
625− cq->mcq.cqn, be32_to_cpu(sig_err_cqe->mkey));
626− return -EINVAL;
627− }
628−
629616 mr = to_mibmr(mmkey);
630617 get_sig_err_item(sig_err_cqe, &mr->sig->err_item);
631618 mr->sig->sig_err_exists = true;
@@ -676,7 +663,6 @@ int mlx5_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) · 44 unmodified lines
676663 unsigned long flags;
677664 int soft_polled = 0;
678665 int npolled;
679− int err = 0;
680666
681667 spin_lock_irqsave(&cq->lock, flags);
682668 if (mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) {
@@ -688,8 +674,7 @@ int mlx5_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) · 5 unmodified lines
688674 soft_polled = poll_soft_wc(cq, num_entries, wc);
689675
690676 for (npolled = 0; npolled < num_entries - soft_polled; npolled++) {
691− err = mlx5_poll_one(cq, &cur_qp, wc + soft_polled + npolled);
692− if (err)
677+ if (mlx5_poll_one(cq, &cur_qp, wc + soft_polled + npolled))
693678 break;
694679 }
695680
@@ -698,10 +683,7 @@ int mlx5_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) · 2 unmodified lines
698683 out:
699684 spin_unlock_irqrestore(&cq->lock, flags);
700685
701− if (err == 0 || err == -EAGAIN)
702− return soft_polled + npolled;
703− else
704− return err;
686+ return soft_polled + npolled;
705687 }
706688
707689 int mlx5_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
drivers/infiniband/hw/mlx5/main.c+15−3
@@ -37,7 +37,6 @@ · 36 unmodified lines
3737 #include <linux/pci.h>
3838 #include <linux/dma-mapping.h>
3939 #include <linux/slab.h>
40−#include <linux/io-mapping.h>
4140 #if defined(CONFIG_X86)
4241 #include <asm/pat.h>
4342 #endif
@@ -289,7 +288,9 @@ __be16 mlx5_get_roce_udp_sport(struct mlx5_ib_dev *dev, u8 port_num, · 245 unmodified lines
289288
290289 static int mlx5_use_mad_ifc(struct mlx5_ib_dev *dev)
291290 {
292− return !MLX5_CAP_GEN(dev->mdev, ib_virt);
291+ if (MLX5_CAP_GEN(dev->mdev, port_type) == MLX5_CAP_PORT_TYPE_IB)
292+ return !MLX5_CAP_GEN(dev->mdev, ib_virt);
293+ return 0;
293294 }
294295
295296 enum {
@@ -1429,6 +1430,13 @@ static int parse_flow_attr(u32 *match_c, u32 *match_v, · 1133 unmodified lines
14291430 dmac_47_16),
14301431 ib_spec->eth.val.dst_mac);
14311432
1433+ ether_addr_copy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, outer_headers_c,
1434+ smac_47_16),
1435+ ib_spec->eth.mask.src_mac);
1436+ ether_addr_copy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, outer_headers_v,
1437+ smac_47_16),
1438+ ib_spec->eth.val.src_mac);
1439+
14321440 if (ib_spec->eth.mask.vlan_tag) {
14331441 MLX5_SET(fte_match_set_lyr_2_4, outer_headers_c,
14341442 vlan_tag, 1);
@@ -1850,6 +1858,7 @@ static struct ib_flow *mlx5_ib_create_flow(struct ib_qp *qp, · 415 unmodified lines
18501858 int domain)
18511859 {
18521860 struct mlx5_ib_dev *dev = to_mdev(qp->device);
1861+ struct mlx5_ib_qp *mqp = to_mqp(qp);
18531862 struct mlx5_ib_flow_handler *handler = NULL;
18541863 struct mlx5_flow_destination *dst = NULL;
18551864 struct mlx5_ib_flow_prio *ft_prio;
@@ -1876,7 +1885,10 @@ static struct ib_flow *mlx5_ib_create_flow(struct ib_qp *qp, · 20 unmodified lines
18761885 }
18771886
18781887 dst->type = MLX5_FLOW_DESTINATION_TYPE_TIR;
1879− dst->tir_num = to_mqp(qp)->raw_packet_qp.rq.tirn;
1888+ if (mqp->flags & MLX5_IB_QP_RSS)
1889+ dst->tir_num = mqp->rss_qp.tirn;
1890+ else
1891+ dst->tir_num = mqp->raw_packet_qp.rq.tirn;
18801892
18811893 if (flow_attr->type == IB_FLOW_ATTR_NORMAL) {
18821894 if (flow_attr->flags & IB_FLOW_ATTR_FLAGS_DONT_TRAP) {
drivers/infiniband/hw/mlx5/mem.c+3−3
@@ -71,7 +71,7 @@ void mlx5_ib_cont_pages(struct ib_umem *umem, u64 addr, int *count, int *shift, · 70 unmodified lines
7171
7272 addr = addr >> page_shift;
7373 tmp = (unsigned long)addr;
74− m = find_first_bit(&tmp, sizeof(tmp));
74+ m = find_first_bit(&tmp, BITS_PER_LONG);
7575 skip = 1 << m;
7676 mask = skip - 1;
7777 i = 0;
@@ -81,7 +81,7 @@ void mlx5_ib_cont_pages(struct ib_umem *umem, u64 addr, int *count, int *shift, · 3 unmodified lines
8181 for (k = 0; k < len; k++) {
8282 if (!(i & mask)) {
8383 tmp = (unsigned long)pfn;
84− m = min_t(unsigned long, m, find_first_bit(&tmp, sizeof(tmp)));
84+ m = min_t(unsigned long, m, find_first_bit(&tmp, BITS_PER_LONG));
8585 skip = 1 << m;
8686 mask = skip - 1;
8787 base = pfn;
@@ -89,7 +89,7 @@ void mlx5_ib_cont_pages(struct ib_umem *umem, u64 addr, int *count, int *shift, · 1 unmodified line
8989 } else {
9090 if (base + p != pfn) {
9191 tmp = (unsigned long)p;
92− m = find_first_bit(&tmp, sizeof(tmp));
92+ m = find_first_bit(&tmp, BITS_PER_LONG);
9393 skip = 1 << m;
9494 mask = skip - 1;
9595 base = pfn;
drivers/infiniband/hw/mlx5/mlx5_ib.h+1−0
@@ -402,6 +402,7 @@ enum mlx5_ib_qp_flags { · 401 unmodified lines
402402 /* QP uses 1 as its source QP number */
403403 MLX5_IB_QP_SQPN_QP1 = 1 << 6,
404404 MLX5_IB_QP_CAP_SCATTER_FCS = 1 << 7,
405+ MLX5_IB_QP_RSS = 1 << 8,
405406 };
406407
407408 struct mlx5_umr_wr {
drivers/infiniband/hw/mlx5/qp.c+5−8
@@ -1449,6 +1449,7 @@ create_tir: · 1448 unmodified lines
14491449 kvfree(in);
14501450 /* qpn is reserved for that QP */
14511451 qp->trans_qp.base.mqp.qpn = 0;
1452+ qp->flags |= MLX5_IB_QP_RSS;
14521453 return 0;
14531454
14541455 err:
@@ -3658,12 +3659,8 @@ static int begin_wqe(struct mlx5_ib_qp *qp, void **seg, · 2203 unmodified lines
36583659 struct ib_send_wr *wr, unsigned *idx,
36593660 int *size, int nreq)
36603661 {
3661− int err = 0;
3662−
3663− if (unlikely(mlx5_wq_overflow(&qp->sq, nreq, qp->ibqp.send_cq))) {
3664− err = -ENOMEM;
3665− return err;
3666− }
3662+ if (unlikely(mlx5_wq_overflow(&qp->sq, nreq, qp->ibqp.send_cq)))
3663+ return -ENOMEM;
36673664
36683665 *idx = qp->sq.cur_post & (qp->sq.wqe_cnt - 1);
36693666 *seg = mlx5_get_send_wqe(qp, *idx);
@@ -3679,7 +3676,7 @@ static int begin_wqe(struct mlx5_ib_qp *qp, void **seg, · 9 unmodified lines
36793676 *seg += sizeof(**ctrl);
36803677 *size = sizeof(**ctrl) / 16;
36813678
3682− return err;
3679+ return 0;
36833680 }
36843681
36853682 static void finish_wqe(struct mlx5_ib_qp *qp,
@@ -3758,7 +3755,7 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 72 unmodified lines
37583755 num_sge = wr->num_sge;
37593756 if (unlikely(num_sge > qp->sq.max_gs)) {
37603757 mlx5_ib_warn(dev, "\n");
3761− err = -ENOMEM;
3758+ err = -EINVAL;
37623759 *bad_wr = wr;
37633760 goto out;
37643761 }
drivers/infiniband/hw/ocrdma/ocrdma_hw.c+7−7
@@ -1156,18 +1156,18 @@ static void ocrdma_get_attr(struct ocrdma_dev *dev, · 1155 unmodified lines
11561156 attr->max_srq =
11571157 (rsp->max_srq_rpir_qps & OCRDMA_MBX_QUERY_CFG_MAX_SRQ_MASK) >>
11581158 OCRDMA_MBX_QUERY_CFG_MAX_SRQ_OFFSET;
1159− attr->max_send_sge = ((rsp->max_write_send_sge &
1159+ attr->max_send_sge = ((rsp->max_recv_send_sge &
11601160 OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_MASK) >>
11611161 OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_SHIFT);
1162− attr->max_recv_sge = (rsp->max_write_send_sge &
1163− OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_MASK) >>
1164− OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_SHIFT;
1162+ attr->max_recv_sge = (rsp->max_recv_send_sge &
1163+ OCRDMA_MBX_QUERY_CFG_MAX_RECV_SGE_MASK) >>
1164+ OCRDMA_MBX_QUERY_CFG_MAX_RECV_SGE_SHIFT;
11651165 attr->max_srq_sge = (rsp->max_srq_rqe_sge &
11661166 OCRDMA_MBX_QUERY_CFG_MAX_SRQ_SGE_MASK) >>
11671167 OCRDMA_MBX_QUERY_CFG_MAX_SRQ_SGE_OFFSET;
1168− attr->max_rdma_sge = (rsp->max_write_send_sge &
1169− OCRDMA_MBX_QUERY_CFG_MAX_WRITE_SGE_MASK) >>
1170− OCRDMA_MBX_QUERY_CFG_MAX_WRITE_SGE_SHIFT;
1168+ attr->max_rdma_sge = (rsp->max_wr_rd_sge &
1169+ OCRDMA_MBX_QUERY_CFG_MAX_RD_SGE_MASK) >>
1170+ OCRDMA_MBX_QUERY_CFG_MAX_RD_SGE_SHIFT;
11711171 attr->max_ord_per_qp = (rsp->max_ird_ord_per_qp &
11721172 OCRDMA_MBX_QUERY_CFG_MAX_ORD_PER_QP_MASK) >>
11731173 OCRDMA_MBX_QUERY_CFG_MAX_ORD_PER_QP_SHIFT;
drivers/infiniband/hw/ocrdma/ocrdma_sli.h+8−4
@@ -554,9 +554,9 @@ enum { · 553 unmodified lines
554554 OCRDMA_MBX_QUERY_CFG_L3_TYPE_MASK = 0x18,
555555 OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_SHIFT = 0,
556556 OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_MASK = 0xFFFF,
557− OCRDMA_MBX_QUERY_CFG_MAX_WRITE_SGE_SHIFT = 16,
558− OCRDMA_MBX_QUERY_CFG_MAX_WRITE_SGE_MASK = 0xFFFF <<
559− OCRDMA_MBX_QUERY_CFG_MAX_WRITE_SGE_SHIFT,
557+ OCRDMA_MBX_QUERY_CFG_MAX_RECV_SGE_SHIFT = 16,
558+ OCRDMA_MBX_QUERY_CFG_MAX_RECV_SGE_MASK = 0xFFFF <<
559+ OCRDMA_MBX_QUERY_CFG_MAX_RECV_SGE_SHIFT,
560560
561561 OCRDMA_MBX_QUERY_CFG_MAX_ORD_PER_QP_SHIFT = 0,
562562 OCRDMA_MBX_QUERY_CFG_MAX_ORD_PER_QP_MASK = 0xFFFF,
@@ -612,6 +612,8 @@ enum { · 49 unmodified lines
612612 OCRDMA_MBX_QUERY_CFG_MAX_SRQ_SGE_OFFSET = 0,
613613 OCRDMA_MBX_QUERY_CFG_MAX_SRQ_SGE_MASK = 0xFFFF <<
614614 OCRDMA_MBX_QUERY_CFG_MAX_SRQ_SGE_OFFSET,
615+ OCRDMA_MBX_QUERY_CFG_MAX_RD_SGE_SHIFT = 0,
616+ OCRDMA_MBX_QUERY_CFG_MAX_RD_SGE_MASK = 0xFFFF,
615617 };
616618
617619 struct ocrdma_mbx_query_config {
@@ -619,7 +621,7 @@ struct ocrdma_mbx_query_config { · 1 unmodified line
619621 struct ocrdma_mbx_rsp rsp;
620622 u32 qp_srq_cq_ird_ord;
621623 u32 max_pd_ca_ack_delay;
622− u32 max_write_send_sge;
624+ u32 max_recv_send_sge;
623625 u32 max_ird_ord_per_qp;
624626 u32 max_shared_ird_ord;
625627 u32 max_mr;
@@ -639,6 +641,8 @@ struct ocrdma_mbx_query_config { · 13 unmodified lines
639641 u32 max_wqes_rqes_per_q;
640642 u32 max_cq_cqes_per_cq;
641643 u32 max_srq_rqe_sge;
644+ u32 max_wr_rd_sge;
645+ u32 ird_pgsz_num_pages;
642646 };
643647
644648 struct ocrdma_fw_ver_rsp {
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c+2−2
@@ -125,8 +125,8 @@ int ocrdma_query_device(struct ib_device *ibdev, struct ib_device_attr *attr, · 124 unmodified lines
125125 IB_DEVICE_SYS_IMAGE_GUID |
126126 IB_DEVICE_LOCAL_DMA_LKEY |
127127 IB_DEVICE_MEM_MGT_EXTENSIONS;
128− attr->max_sge = dev->attr.max_send_sge;
129− attr->max_sge_rd = attr->max_sge;
128+ attr->max_sge = min(dev->attr.max_send_sge, dev->attr.max_recv_sge);
129+ attr->max_sge_rd = dev->attr.max_rdma_sge;
130130 attr->max_cq = dev->attr.max_cq;
131131 attr->max_cqe = dev->attr.max_cqe;
132132 attr->max_mr = dev->attr.max_mr;
drivers/infiniband/hw/qib/qib_debugfs.c+9−3
@@ -189,27 +189,32 @@ static int _ctx_stats_seq_show(struct seq_file *s, void *v) · 188 unmodified lines
189189 DEBUGFS_FILE(ctx_stats)
190190
191191 static void *_qp_stats_seq_start(struct seq_file *s, loff_t *pos)
192+ __acquires(RCU)
192193 {
193194 struct qib_qp_iter *iter;
194195 loff_t n = *pos;
195196
196− rcu_read_lock();
197197 iter = qib_qp_iter_init(s->private);
198+
199+ /* stop calls rcu_read_unlock */
200+ rcu_read_lock();
201+
198202 if (!iter)
199203 return NULL;
200204
201− while (n--) {
205+ do {
202206 if (qib_qp_iter_next(iter)) {
203207 kfree(iter);
204208 return NULL;
205209 }
206− }
210+ } while (n--);
207211
208212 return iter;
209213 }
210214
211215 static void *_qp_stats_seq_next(struct seq_file *s, void *iter_ptr,
212216 loff_t *pos)
217+ __must_hold(RCU)
213218 {
214219 struct qib_qp_iter *iter = iter_ptr;
215220
@@ -224,6 +229,7 @@ static void *_qp_stats_seq_next(struct seq_file *s, void *iter_ptr, · 8 unmodified lines
224229 }
225230
226231 static void _qp_stats_seq_stop(struct seq_file *s, void *iter_ptr)
232+ __releases(RCU)
227233 {
228234 rcu_read_unlock();
229235 }
drivers/infiniband/hw/qib/qib_fs.c+5−21
@@ -328,26 +328,12 @@ static ssize_t flash_write(struct file *file, const char __user *buf, · 327 unmodified lines
328328
329329 pos = *ppos;
330330
331− if (pos != 0) {
332− ret = -EINVAL;
333− goto bail;
334− }
335−
336− if (count != sizeof(struct qib_flash)) {
337− ret = -EINVAL;
338− goto bail;
339− }
340−
341− tmp = kmalloc(count, GFP_KERNEL);
342− if (!tmp) {
343− ret = -ENOMEM;
344− goto bail;
345− }
331+ if (pos != 0 || count != sizeof(struct qib_flash))
332+ return -EINVAL;
346333
347− if (copy_from_user(tmp, buf, count)) {
348− ret = -EFAULT;
349− goto bail_tmp;
350− }
334+ tmp = memdup_user(buf, count);
335+ if (IS_ERR(tmp))
336+ return PTR_ERR(tmp);
351337
352338 dd = private2dd(file);
353339 if (qib_eeprom_write(dd, pos, tmp, count)) {
@@ -361,8 +347,6 @@ static ssize_t flash_write(struct file *file, const char __user *buf, · 7 unmodified lines
361347
362348 bail_tmp:
363349 kfree(tmp);
364−
365−bail:
366350 return ret;
367351 }
368352
drivers/infiniband/hw/qib/qib_qp.c+0−4
@@ -573,10 +573,6 @@ struct qib_qp_iter *qib_qp_iter_init(struct qib_ibdev *dev) · 572 unmodified lines
573573 return NULL;
574574
575575 iter->dev = dev;
576− if (qib_qp_iter_next(iter)) {
577− kfree(iter);
578− return NULL;
579− }
580576
581577 return iter;
582578 }
drivers/infiniband/hw/usnic/usnic_ib_main.c+2−1
@@ -664,7 +664,8 @@ static int __init usnic_ib_init(void) · 663 unmodified lines
664664 return err;
665665 }
666666
667− if (pci_register_driver(&usnic_ib_pci_driver)) {
667+ err = pci_register_driver(&usnic_ib_pci_driver);
668+ if (err) {
668669 usnic_err("Unable to register with PCI\n");
669670 goto out_umem_fini;
670671 }
drivers/infiniband/sw/rdmavt/mr.c+1−1
@@ -294,7 +294,7 @@ static void __rvt_free_mr(struct rvt_mr *mr) · 293 unmodified lines
294294 {
295295 rvt_deinit_mregion(&mr->mr);
296296 rvt_free_lkey(&mr->mr);
297− vfree(mr);
297+ kfree(mr);
298298 }
299299
300300 /**
drivers/infiniband/sw/rdmavt/qp.c+2−1
@@ -873,7 +873,8 @@ bail_qpn: · 872 unmodified lines
873873 free_qpn(&rdi->qp_dev->qpn_table, qp->ibqp.qp_num);
874874
875875 bail_rq_wq:
876− vfree(qp->r_rq.wq);
876+ if (!qp->ip)
877+ vfree(qp->r_rq.wq);
877878
878879 bail_driver_priv:
879880 rdi->driver_f.qp_priv_free(rdi, qp);
drivers/infiniband/sw/rxe/rxe.c+22−3
@@ -362,15 +362,34 @@ static int __init rxe_module_init(void) · 361 unmodified lines
362362 return err;
363363 }
364364
365− err = rxe_net_init();
365+ err = rxe_net_ipv4_init();
366366 if (err) {
367− pr_err("rxe: unable to init\n");
367+ pr_err("rxe: unable to init ipv4 tunnel\n");
368368 rxe_cache_exit();
369− return err;
369+ goto exit;
370+ }
371+
372+ err = rxe_net_ipv6_init();
373+ if (err) {
374+ pr_err("rxe: unable to init ipv6 tunnel\n");
375+ rxe_cache_exit();
376+ goto exit;
370377 }
378+
379+ err = register_netdevice_notifier(&rxe_net_notifier);
380+ if (err) {
381+ pr_err("rxe: Failed to rigister netdev notifier\n");
382+ goto exit;
383+ }
384+
371385 pr_info("rxe: loaded\n");
372386
373387 return 0;
388+
389+exit:
390+ rxe_release_udp_tunnel(recv_sockets.sk4);
391+ rxe_release_udp_tunnel(recv_sockets.sk6);
392+ return err;
374393 }
375394
376395 static void __exit rxe_module_exit(void)
drivers/infiniband/sw/rxe/rxe_comp.c+13−0
@@ -689,7 +689,14 @@ int rxe_completer(void *arg) · 688 unmodified lines
689689 qp->req.need_retry = 1;
690690 rxe_run_task(&qp->req.task, 1);
691691 }
692+
693+ if (pkt) {
694+ rxe_drop_ref(pkt->qp);
695+ kfree_skb(skb);
696+ }
697+
692698 goto exit;
699+
693700 } else {
694701 wqe->status = IB_WC_RETRY_EXC_ERR;
695702 state = COMPST_ERROR;
@@ -716,6 +723,12 @@ int rxe_completer(void *arg) · 20 unmodified lines
716723 case COMPST_ERROR:
717724 do_complete(qp, wqe);
718725 rxe_qp_error(qp);
726+
727+ if (pkt) {
728+ rxe_drop_ref(pkt->qp);
729+ kfree_skb(skb);
730+ }
731+
719732 goto exit;
720733 }
721734 }
drivers/infiniband/sw/rxe/rxe_net.c+25−30
@@ -275,9 +275,10 @@ static struct socket *rxe_setup_udp_tunnel(struct net *net, __be16 port, · 274 unmodified lines
275275 return sock;
276276 }
277277
278−static void rxe_release_udp_tunnel(struct socket *sk)
278+void rxe_release_udp_tunnel(struct socket *sk)
279279 {
280− udp_tunnel_sock_release(sk);
280+ if (sk)
281+ udp_tunnel_sock_release(sk);
281282 }
282283
283284 static void prepare_udp_hdr(struct sk_buff *skb, __be16 src_port,
@@ -658,51 +659,45 @@ out: · 374 unmodified lines
658659 return NOTIFY_OK;
659660 }
660661
661−static struct notifier_block rxe_net_notifier = {
662+struct notifier_block rxe_net_notifier = {
662663 .notifier_call = rxe_notify,
663664 };
664665
665−int rxe_net_init(void)
666+int rxe_net_ipv4_init(void)
666667 {
667− int err;
668−
669668 spin_lock_init(&dev_list_lock);
670669
671− recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
672− htons(ROCE_V2_UDP_DPORT), true);
673− if (IS_ERR(recv_sockets.sk6)) {
674− recv_sockets.sk6 = NULL;
675− pr_err("rxe: Failed to create IPv6 UDP tunnel\n");
676− return -1;
677− }
678−
679670 recv_sockets.sk4 = rxe_setup_udp_tunnel(&init_net,
680− htons(ROCE_V2_UDP_DPORT), false);
671+ htons(ROCE_V2_UDP_DPORT), false);
681672 if (IS_ERR(recv_sockets.sk4)) {
682− rxe_release_udp_tunnel(recv_sockets.sk6);
683673 recv_sockets.sk4 = NULL;
684− recv_sockets.sk6 = NULL;
685674 pr_err("rxe: Failed to create IPv4 UDP tunnel\n");
686675 return -1;
687676 }
688677
689− err = register_netdevice_notifier(&rxe_net_notifier);
690− if (err) {
691− rxe_release_udp_tunnel(recv_sockets.sk6);
692− rxe_release_udp_tunnel(recv_sockets.sk4);
693− pr_err("rxe: Failed to rigister netdev notifier\n");
694− }
695−
696− return err;
678+ return 0;
697679 }
698680
699−void rxe_net_exit(void)
681+int rxe_net_ipv6_init(void)
700682 {
701− if (recv_sockets.sk6)
702− rxe_release_udp_tunnel(recv_sockets.sk6);
683+#if IS_ENABLED(CONFIG_IPV6)
703684
704− if (recv_sockets.sk4)
705− rxe_release_udp_tunnel(recv_sockets.sk4);
685+ spin_lock_init(&dev_list_lock);
706686
687+ recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
688+ htons(ROCE_V2_UDP_DPORT), true);
689+ if (IS_ERR(recv_sockets.sk6)) {
690+ recv_sockets.sk6 = NULL;
691+ pr_err("rxe: Failed to create IPv6 UDP tunnel\n");
692+ return -1;
693+ }
694+#endif
695+ return 0;
696+}
697+
698+void rxe_net_exit(void)
699+{
700+ rxe_release_udp_tunnel(recv_sockets.sk6);
701+ rxe_release_udp_tunnel(recv_sockets.sk4);
707702 unregister_netdevice_notifier(&rxe_net_notifier);
708703 }
drivers/infiniband/sw/rxe/rxe_net.h+4−1
@@ -44,10 +44,13 @@ struct rxe_recv_sockets { · 43 unmodified lines
4444 };
4545
4646 extern struct rxe_recv_sockets recv_sockets;
47+extern struct notifier_block rxe_net_notifier;
48+void rxe_release_udp_tunnel(struct socket *sk);
4749
4850 struct rxe_dev *rxe_net_add(struct net_device *ndev);
4951
50−int rxe_net_init(void);
52+int rxe_net_ipv4_init(void);
53+int rxe_net_ipv6_init(void);
5154 void rxe_net_exit(void);
5255
5356 #endif /* RXE_NET_H */
drivers/infiniband/sw/rxe/rxe_recv.c+1−1
@@ -312,7 +312,7 @@ static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct sk_buff *skb) · 311 unmodified lines
312312 * make a copy of the skb to post to the next qp
313313 */
314314 skb_copy = (mce->qp_list.next != &mcg->qp_list) ?
315− skb_clone(skb, GFP_KERNEL) : NULL;
315+ skb_clone(skb, GFP_ATOMIC) : NULL;
316316
317317 pkt->qp = qp;
318318 rxe_add_ref(qp);
drivers/infiniband/sw/rxe/rxe_req.c+44−13
@@ -511,24 +511,21 @@ static int fill_packet(struct rxe_qp *qp, struct rxe_send_wqe *wqe, · 510 unmodified lines
511511 }
512512
513513 static void update_wqe_state(struct rxe_qp *qp,
514− struct rxe_send_wqe *wqe,
515− struct rxe_pkt_info *pkt,
516− enum wqe_state *prev_state)
514+ struct rxe_send_wqe *wqe,
515+ struct rxe_pkt_info *pkt)
517516 {
518− enum wqe_state prev_state_ = wqe->state;
519−
520517 if (pkt->mask & RXE_END_MASK) {
521518 if (qp_type(qp) == IB_QPT_RC)
522519 wqe->state = wqe_state_pending;
523520 } else {
524521 wqe->state = wqe_state_processing;
525522 }
526−
527− *prev_state = prev_state_;
528523 }
529524
530−static void update_state(struct rxe_qp *qp, struct rxe_send_wqe *wqe,
531− struct rxe_pkt_info *pkt, int payload)
525+static void update_wqe_psn(struct rxe_qp *qp,
526+ struct rxe_send_wqe *wqe,
527+ struct rxe_pkt_info *pkt,
528+ int payload)
532529 {
533530 /* number of packets left to send including current one */
534531 int num_pkt = (wqe->dma.resid + payload + qp->mtu - 1) / qp->mtu;
@@ -546,9 +543,34 @@ static void update_state(struct rxe_qp *qp, struct rxe_send_wqe *wqe, · 11 unmodified lines
546543 qp->req.psn = (wqe->first_psn + num_pkt) & BTH_PSN_MASK;
547544 else
548545 qp->req.psn = (qp->req.psn + 1) & BTH_PSN_MASK;
546+}
549547
550− qp->req.opcode = pkt->opcode;
548+static void save_state(struct rxe_send_wqe *wqe,
549+ struct rxe_qp *qp,
550+ struct rxe_send_wqe *rollback_wqe,
551+ struct rxe_qp *rollback_qp)
552+{
553+ rollback_wqe->state = wqe->state;
554+ rollback_wqe->first_psn = wqe->first_psn;
555+ rollback_wqe->last_psn = wqe->last_psn;
556+ rollback_qp->req.psn = qp->req.psn;
557+}
551558
559+static void rollback_state(struct rxe_send_wqe *wqe,
560+ struct rxe_qp *qp,
561+ struct rxe_send_wqe *rollback_wqe,
562+ struct rxe_qp *rollback_qp)
563+{
564+ wqe->state = rollback_wqe->state;
565+ wqe->first_psn = rollback_wqe->first_psn;
566+ wqe->last_psn = rollback_wqe->last_psn;
567+ qp->req.psn = rollback_qp->req.psn;
568+}
569+
570+static void update_state(struct rxe_qp *qp, struct rxe_send_wqe *wqe,
571+ struct rxe_pkt_info *pkt, int payload)
572+{
573+ qp->req.opcode = pkt->opcode;
552574
553575 if (pkt->mask & RXE_END_MASK)
554576 qp->req.wqe_index = next_index(qp->sq.queue, qp->req.wqe_index);
@@ -571,7 +593,8 @@ int rxe_requester(void *arg) · 16 unmodified lines
571593 int mtu;
572594 int opcode;
573595 int ret;
574− enum wqe_state prev_state;
596+ struct rxe_qp rollback_qp;
597+ struct rxe_send_wqe rollback_wqe;
575598
576599 next_wqe:
577600 if (unlikely(!qp->valid || qp->req.state == QP_STATE_ERROR))
@@ -688,13 +711,21 @@ next_wqe: · 110 unmodified lines
688711 goto err;
689712 }
690713
691− update_wqe_state(qp, wqe, &pkt, &prev_state);
714+ /*
715+ * To prevent a race on wqe access between requester and completer,
716+ * wqe members state and psn need to be set before calling
717+ * rxe_xmit_packet().
718+ * Otherwise, completer might initiate an unjustified retry flow.
719+ */
720+ save_state(wqe, qp, &rollback_wqe, &rollback_qp);
721+ update_wqe_state(qp, wqe, &pkt);
722+ update_wqe_psn(qp, wqe, &pkt, payload);
692723 ret = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp, &pkt, skb);
693724 if (ret) {
694725 qp->need_req_skb = 1;
695726 kfree_skb(skb);
696727
697− wqe->state = prev_state;
728+ rollback_state(wqe, qp, &rollback_wqe, &rollback_qp);
698729
699730 if (ret == -EAGAIN) {
700731 rxe_run_task(&qp->req.task, 1);
drivers/infiniband/sw/rxe/rxe_resp.c+6−5
@@ -972,11 +972,13 @@ static int send_atomic_ack(struct rxe_qp *qp, struct rxe_pkt_info *pkt, · 971 unmodified lines
972972 free_rd_atomic_resource(qp, res);
973973 rxe_advance_resp_resource(qp);
974974
975+ memcpy(SKB_TO_PKT(skb), &ack_pkt, sizeof(skb->cb));
976+
975977 res->type = RXE_ATOMIC_MASK;
976978 res->atomic.skb = skb;
977− res->first_psn = qp->resp.psn;
978− res->last_psn = qp->resp.psn;
979− res->cur_psn = qp->resp.psn;
979+ res->first_psn = ack_pkt.psn;
980+ res->last_psn = ack_pkt.psn;
981+ res->cur_psn = ack_pkt.psn;
980982
981983 rc = rxe_xmit_packet(rxe, qp, &ack_pkt, skb_copy);
982984 if (rc) {
@@ -1116,8 +1118,7 @@ static enum resp_states duplicate_request(struct rxe_qp *qp, · 133 unmodified lines
11161118 rc = RESPST_CLEANUP;
11171119 goto out;
11181120 }
1119− bth_set_psn(SKB_TO_PKT(skb_copy),
1120− qp->resp.psn - 1);
1121+
11211122 /* Resend the result. */
11221123 rc = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp,
11231124 pkt, skb_copy);
drivers/infiniband/ulp/ipoib/ipoib.h+1−0
@@ -478,6 +478,7 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb, · 477 unmodified lines
478478 struct ipoib_ah *address, u32 qpn);
479479 void ipoib_reap_ah(struct work_struct *work);
480480
481+struct ipoib_path *__path_find(struct net_device *dev, void *gid);
481482 void ipoib_mark_paths_invalid(struct net_device *dev);
482483 void ipoib_flush_paths(struct net_device *dev);
483484 int ipoib_check_sm_sendonly_fullmember_support(struct ipoib_dev_priv *priv);
drivers/infiniband/ulp/ipoib/ipoib_cm.c+16−0
@@ -1318,6 +1318,8 @@ void ipoib_cm_destroy_tx(struct ipoib_cm_tx *tx) · 1317 unmodified lines
13181318 }
13191319 }
13201320
1321+#define QPN_AND_OPTIONS_OFFSET 4
1322+
13211323 static void ipoib_cm_tx_start(struct work_struct *work)
13221324 {
13231325 struct ipoib_dev_priv *priv = container_of(work, struct ipoib_dev_priv,
@@ -1326,6 +1328,7 @@ static void ipoib_cm_tx_start(struct work_struct *work) · 2 unmodified lines
13261328 struct ipoib_neigh *neigh;
13271329 struct ipoib_cm_tx *p;
13281330 unsigned long flags;
1331+ struct ipoib_path *path;
13291332 int ret;
13301333
13311334 struct ib_sa_path_rec pathrec;
@@ -1338,7 +1341,19 @@ static void ipoib_cm_tx_start(struct work_struct *work) · 6 unmodified lines
13381341 p = list_entry(priv->cm.start_list.next, typeof(*p), list);
13391342 list_del_init(&p->list);
13401343 neigh = p->neigh;
1344+
13411345 qpn = IPOIB_QPN(neigh->daddr);
1346+ /*
1347+ * As long as the search is with these 2 locks,
1348+ * path existence indicates its validity.
1349+ */
1350+ path = __path_find(dev, neigh->daddr + QPN_AND_OPTIONS_OFFSET);
1351+ if (!path) {
1352+ pr_info("%s ignore not valid path %pI6\n",
1353+ __func__,
1354+ neigh->daddr + QPN_AND_OPTIONS_OFFSET);
1355+ goto free_neigh;
1356+ }
13421357 memcpy(&pathrec, &p->path->pathrec, sizeof pathrec);
13431358
13441359 spin_unlock_irqrestore(&priv->lock, flags);
@@ -1350,6 +1365,7 @@ static void ipoib_cm_tx_start(struct work_struct *work) · 5 unmodified lines
13501365 spin_lock_irqsave(&priv->lock, flags);
13511366
13521367 if (ret) {
1368+free_neigh:
13531369 neigh = p->neigh;
13541370 if (neigh) {
13551371 neigh->cm = NULL;
drivers/infiniband/ulp/ipoib/ipoib_ib.c+9−0
@@ -1161,8 +1161,17 @@ static void __ipoib_ib_dev_flush(struct ipoib_dev_priv *priv, · 1160 unmodified lines
11611161 }
11621162
11631163 if (level == IPOIB_FLUSH_LIGHT) {
1164+ int oper_up;
11641165 ipoib_mark_paths_invalid(dev);
1166+ /* Set IPoIB operation as down to prevent races between:
1167+ * the flush flow which leaves MCG and on the fly joins
1168+ * which can happen during that time. mcast restart task
1169+ * should deal with join requests we missed.
1170+ */
1171+ oper_up = test_and_clear_bit(IPOIB_FLAG_OPER_UP, &priv->flags);
11651172 ipoib_mcast_dev_flush(dev);
1173+ if (oper_up)
1174+ set_bit(IPOIB_FLAG_OPER_UP, &priv->flags);
11661175 ipoib_flush_ah(dev);
11671176 }
11681177
drivers/infiniband/ulp/ipoib/ipoib_main.c+1−1
@@ -485,7 +485,7 @@ int ipoib_set_mode(struct net_device *dev, const char *buf) · 484 unmodified lines
485485 return -EINVAL;
486486 }
487487
488−static struct ipoib_path *__path_find(struct net_device *dev, void *gid)
488+struct ipoib_path *__path_find(struct net_device *dev, void *gid)
489489 {
490490 struct ipoib_dev_priv *priv = netdev_priv(dev);
491491 struct rb_node *n = priv->path_tree.rb_node;
drivers/infiniband/ulp/isert/ib_isert.c+21−4
@@ -403,6 +403,7 @@ isert_init_conn(struct isert_conn *isert_conn) · 402 unmodified lines
403403 INIT_LIST_HEAD(&isert_conn->node);
404404 init_completion(&isert_conn->login_comp);
405405 init_completion(&isert_conn->login_req_comp);
406+ init_waitqueue_head(&isert_conn->rem_wait);
406407 kref_init(&isert_conn->kref);
407408 mutex_init(&isert_conn->mutex);
408409 INIT_WORK(&isert_conn->release_work, isert_release_work);
@@ -448,7 +449,7 @@ isert_alloc_login_buf(struct isert_conn *isert_conn, · 39 unmodified lines
448449
449450 isert_conn->login_rsp_buf = kzalloc(ISER_RX_PAYLOAD_SIZE, GFP_KERNEL);
450451 if (!isert_conn->login_rsp_buf) {
451− isert_err("Unable to allocate isert_conn->login_rspbuf\n");
452+ ret = -ENOMEM;
452453 goto out_unmap_login_req_buf;
453454 }
454455
@@ -578,7 +579,8 @@ isert_connect_release(struct isert_conn *isert_conn) · 123 unmodified lines
578579 BUG_ON(!device);
579580
580581 isert_free_rx_descriptors(isert_conn);
581− if (isert_conn->cm_id)
582+ if (isert_conn->cm_id &&
583+ !isert_conn->dev_removed)
582584 rdma_destroy_id(isert_conn->cm_id);
583585
584586 if (isert_conn->qp) {
@@ -593,7 +595,10 @@ isert_connect_release(struct isert_conn *isert_conn) · 8 unmodified lines
593595
594596 isert_device_put(device);
595597
596− kfree(isert_conn);
598+ if (isert_conn->dev_removed)
599+ wake_up_interruptible(&isert_conn->rem_wait);
600+ else
601+ kfree(isert_conn);
597602 }
598603
599604 static void
@@ -753,6 +758,7 @@ static int · 153 unmodified lines
753758 isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
754759 {
755760 struct isert_np *isert_np = cma_id->context;
761+ struct isert_conn *isert_conn;
756762 int ret = 0;
757763
758764 isert_info("%s (%d): status %d id %p np %p\n",
@@ -773,10 +779,21 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) · 14 unmodified lines
773779 break;
774780 case RDMA_CM_EVENT_ADDR_CHANGE: /* FALLTHRU */
775781 case RDMA_CM_EVENT_DISCONNECTED: /* FALLTHRU */
776− case RDMA_CM_EVENT_DEVICE_REMOVAL: /* FALLTHRU */
777782 case RDMA_CM_EVENT_TIMEWAIT_EXIT: /* FALLTHRU */
778783 ret = isert_disconnected_handler(cma_id, event->event);
779784 break;
785+ case RDMA_CM_EVENT_DEVICE_REMOVAL:
786+ isert_conn = cma_id->qp->qp_context;
787+ isert_conn->dev_removed = true;
788+ isert_disconnected_handler(cma_id, event->event);
789+ wait_event_interruptible(isert_conn->rem_wait,
790+ isert_conn->state == ISER_CONN_DOWN);
791+ kfree(isert_conn);
792+ /*
793+ * return non-zero from the callback to destroy
794+ * the rdma cm id
795+ */
796+ return 1;
780797 case RDMA_CM_EVENT_REJECTED: /* FALLTHRU */
781798 case RDMA_CM_EVENT_UNREACHABLE: /* FALLTHRU */
782799 case RDMA_CM_EVENT_CONNECT_ERROR:
drivers/infiniband/ulp/isert/ib_isert.h+2−0
@@ -158,6 +158,8 @@ struct isert_conn { · 157 unmodified lines
158158 struct work_struct release_work;
159159 bool logout_posted;
160160 bool snd_w_inv;
161+ wait_queue_head_t rem_wait;
162+ bool dev_removed;
161163 };
162164
163165 #define ISERT_MAX_CQ 64
drivers/infiniband/ulp/srpt/ib_srpt.c+5−4
@@ -522,6 +522,11 @@ static int srpt_refresh_port(struct srpt_port *sport) · 521 unmodified lines
522522 if (ret)
523523 goto err_query_port;
524524
525+ snprintf(sport->port_guid, sizeof(sport->port_guid),
526+ "0x%016llx%016llx",
527+ be64_to_cpu(sport->gid.global.subnet_prefix),
528+ be64_to_cpu(sport->gid.global.interface_id));
529+
525530 if (!sport->mad_agent) {
526531 memset(&reg_req, 0, sizeof(reg_req));
527532 reg_req.mgmt_class = IB_MGMT_CLASS_DEVICE_MGMT;
@@ -2548,10 +2553,6 @@ static void srpt_add_one(struct ib_device *device) · 2020 unmodified lines
25482553 sdev->device->name, i);
25492554 goto err_ring;
25502555 }
2551− snprintf(sport->port_guid, sizeof(sport->port_guid),
2552− "0x%016llx%016llx",
2553− be64_to_cpu(sport->gid.global.subnet_prefix),
2554− be64_to_cpu(sport->gid.global.interface_id));
25552556 }
25562557
25572558 spin_lock(&srpt_dev_lock);
drivers/input/keyboard/tegra-kbc.c+1−1
@@ -376,7 +376,7 @@ static int tegra_kbc_start(struct tegra_kbc *kbc) · 375 unmodified lines
376376 /* Reset the KBC controller to clear all previous status.*/
377377 reset_control_assert(kbc->rst);
378378 udelay(100);
379− reset_control_assert(kbc->rst);
379+ reset_control_deassert(kbc->rst);
380380 udelay(100);
381381
382382 tegra_kbc_config_pins(kbc);
drivers/input/rmi4/rmi_driver.c+2−1
@@ -553,7 +553,6 @@ int rmi_read_register_desc(struct rmi_device *d, u16 addr, · 552 unmodified lines
553553 goto free_struct_buff;
554554
555555 reg = find_first_bit(rdesc->presense_map, RMI_REG_DESC_PRESENSE_BITS);
556− map_offset = 0;
557556 for (i = 0; i < rdesc->num_registers; i++) {
558557 struct rmi_register_desc_item *item = &rdesc->registers[i];
559558 int reg_size = struct_buf[offset];
@@ -576,6 +575,8 @@ int rmi_read_register_desc(struct rmi_device *d, u16 addr, · 16 unmodified lines
576575 item->reg = reg;
577576 item->reg_size = reg_size;
578577
578+ map_offset = 0;
579+
579580 do {
580581 for (b = 0; b < 7; b++) {
581582 if (struct_buf[offset] & (0x1 << b))
drivers/input/serio/i8042.c+1−0
@@ -1305,6 +1305,7 @@ static int __init i8042_create_aux_port(int idx) · 1304 unmodified lines
13051305 serio->write = i8042_aux_write;
13061306 serio->start = i8042_start;
13071307 serio->stop = i8042_stop;
1308+ serio->ps2_cmd_mutex = &i8042_mutex;
13081309 serio->port_data = port;
13091310 serio->dev.parent = &i8042_platform_device->dev;
13101311 if (idx < 0) {
drivers/input/touchscreen/ads7846.c+0−1
@@ -1473,7 +1473,6 @@ static int ads7846_remove(struct spi_device *spi) · 1472 unmodified lines
14731473
14741474 ads784x_hwmon_unregister(spi, ts);
14751475
1476− regulator_disable(ts->reg);
14771476 regulator_put(ts->reg);
14781477
14791478 if (!ts->get_pendown_state) {
drivers/input/touchscreen/silead.c+10−8
@@ -390,9 +390,10 @@ static void silead_ts_read_props(struct i2c_client *client) · 389 unmodified lines
390390 data->max_fingers = 5; /* Most devices handle up-to 5 fingers */
391391 }
392392
393− error = device_property_read_string(dev, "touchscreen-fw-name", &str);
393+ error = device_property_read_string(dev, "firmware-name", &str);
394394 if (!error)
395− snprintf(data->fw_name, sizeof(data->fw_name), "%s", str);
395+ snprintf(data->fw_name, sizeof(data->fw_name),
396+ "silead/%s", str);
396397 else
397398 dev_dbg(dev, "Firmware file name read error. Using default.");
398399 }
@@ -410,14 +411,14 @@ static int silead_ts_set_default_fw_name(struct silead_ts_data *data, · 11 unmodified lines
410411 if (!acpi_id)
411412 return -ENODEV;
412413
413− snprintf(data->fw_name, sizeof(data->fw_name), "%s.fw",
414− acpi_id->id);
414+ snprintf(data->fw_name, sizeof(data->fw_name),
415+ "silead/%s.fw", acpi_id->id);
415416
416417 for (i = 0; i < strlen(data->fw_name); i++)
417418 data->fw_name[i] = tolower(data->fw_name[i]);
418419 } else {
419− snprintf(data->fw_name, sizeof(data->fw_name), "%s.fw",
420− id->name);
420+ snprintf(data->fw_name, sizeof(data->fw_name),
421+ "silead/%s.fw", id->name);
421422 }
422423
423424 return 0;
@@ -426,7 +427,8 @@ static int silead_ts_set_default_fw_name(struct silead_ts_data *data, · 2 unmodified lines
426427 static int silead_ts_set_default_fw_name(struct silead_ts_data *data,
427428 const struct i2c_device_id *id)
428429 {
429− snprintf(data->fw_name, sizeof(data->fw_name), "%s.fw", id->name);
430+ snprintf(data->fw_name, sizeof(data->fw_name),
431+ "silead/%s.fw", id->name);
430432 return 0;
431433 }
432434 #endif
@@ -464,7 +466,7 @@ static int silead_ts_probe(struct i2c_client *client, · 31 unmodified lines
464466 return -ENODEV;
465467
466468 /* Power GPIO pin */
467− data->gpio_power = gpiod_get_optional(dev, "power", GPIOD_OUT_LOW);
469+ data->gpio_power = devm_gpiod_get_optional(dev, "power", GPIOD_OUT_LOW);
468470 if (IS_ERR(data->gpio_power)) {
469471 if (PTR_ERR(data->gpio_power) != -EPROBE_DEFER)
470472 dev_err(dev, "Shutdown GPIO request failed\n");
drivers/iommu/arm-smmu-v3.c+5−2
@@ -879,7 +879,7 @@ static void arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu) · 878 unmodified lines
879879 * We may have concurrent producers, so we need to be careful
880880 * not to touch any of the shadow cmdq state.
881881 */
882− queue_read(cmd, Q_ENT(q, idx), q->ent_dwords);
882+ queue_read(cmd, Q_ENT(q, cons), q->ent_dwords);
883883 dev_err(smmu->dev, "skipping command in error state:\n");
884884 for (i = 0; i < ARRAY_SIZE(cmd); ++i)
885885 dev_err(smmu->dev, "\t0x%016llx\n", (unsigned long long)cmd[i]);
@@ -890,7 +890,7 @@ static void arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu) · 4 unmodified lines
890890 return;
891891 }
892892
893− queue_write(cmd, Q_ENT(q, idx), q->ent_dwords);
893+ queue_write(Q_ENT(q, cons), cmd, q->ent_dwords);
894894 }
895895
896896 static void arm_smmu_cmdq_issue_cmd(struct arm_smmu_device *smmu,
@@ -1034,6 +1034,9 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_device *smmu, u32 sid, · 137 unmodified lines
10341034 case STRTAB_STE_0_CFG_S2_TRANS:
10351035 ste_live = true;
10361036 break;
1037+ case STRTAB_STE_0_CFG_ABORT:
1038+ if (disable_bypass)
1039+ break;
10371040 default:
10381041 BUG(); /* STE corruption */
10391042 }
drivers/iommu/arm-smmu.c+7−27
@@ -686,8 +686,7 @@ static struct iommu_gather_ops arm_smmu_gather_ops = { · 685 unmodified lines
686686
687687 static irqreturn_t arm_smmu_context_fault(int irq, void *dev)
688688 {
689− int flags, ret;
690− u32 fsr, fsynr, resume;
689+ u32 fsr, fsynr;
691690 unsigned long iova;
692691 struct iommu_domain *domain = dev;
693692 struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
@@ -701,34 +700,15 @@ static irqreturn_t arm_smmu_context_fault(int irq, void *dev) · 7 unmodified lines
701700 if (!(fsr & FSR_FAULT))
702701 return IRQ_NONE;
703702
704− if (fsr & FSR_IGN)
705− dev_err_ratelimited(smmu->dev,
706− "Unexpected context fault (fsr 0x%x)\n",
707− fsr);
708−
709703 fsynr = readl_relaxed(cb_base + ARM_SMMU_CB_FSYNR0);
710− flags = fsynr & FSYNR0_WNR ? IOMMU_FAULT_WRITE : IOMMU_FAULT_READ;
711−
712704 iova = readq_relaxed(cb_base + ARM_SMMU_CB_FAR);
713− if (!report_iommu_fault(domain, smmu->dev, iova, flags)) {
714− ret = IRQ_HANDLED;
715− resume = RESUME_RETRY;
716− } else {
717− dev_err_ratelimited(smmu->dev,
718− "Unhandled context fault: iova=0x%08lx, fsynr=0x%x, cb=%d\n",
719− iova, fsynr, cfg->cbndx);
720− ret = IRQ_NONE;
721− resume = RESUME_TERMINATE;
722− }
723−
724− /* Clear the faulting FSR */
725− writel(fsr, cb_base + ARM_SMMU_CB_FSR);
726705
727− /* Retry or terminate any stalled transactions */
728− if (fsr & FSR_SS)
729− writel_relaxed(resume, cb_base + ARM_SMMU_CB_RESUME);
706+ dev_err_ratelimited(smmu->dev,
707+ "Unhandled context fault: fsr=0x%x, iova=0x%08lx, fsynr=0x%x, cb=%d\n",
708+ fsr, iova, fsynr, cfg->cbndx);
730709
731− return ret;
710+ writel(fsr, cb_base + ARM_SMMU_CB_FSR);
711+ return IRQ_HANDLED;
732712 }
733713
734714 static irqreturn_t arm_smmu_global_fault(int irq, void *dev)
@@ -837,7 +817,7 @@ static void arm_smmu_init_context_bank(struct arm_smmu_domain *smmu_domain, · 102 unmodified lines
837817 }
838818
839819 /* SCTLR */
840− reg = SCTLR_CFCFG | SCTLR_CFIE | SCTLR_CFRE | SCTLR_M | SCTLR_EAE_SBOP;
820+ reg = SCTLR_CFIE | SCTLR_CFRE | SCTLR_M | SCTLR_EAE_SBOP;
841821 if (stage1)
842822 reg |= SCTLR_S1_ASIDPNE;
843823 #ifdef __BIG_ENDIAN
drivers/iommu/dma-iommu.c+9−5
@@ -68,7 +68,8 @@ void iommu_put_dma_cookie(struct iommu_domain *domain) · 67 unmodified lines
6868 if (!iovad)
6969 return;
7070
71− put_iova_domain(iovad);
71+ if (iovad->granule)
72+ put_iova_domain(iovad);
7273 kfree(iovad);
7374 domain->iova_cookie = NULL;
7475 }
@@ -151,12 +152,15 @@ int dma_direction_to_prot(enum dma_data_direction dir, bool coherent) · 76 unmodified lines
151152 }
152153 }
153154
154−static struct iova *__alloc_iova(struct iova_domain *iovad, size_t size,
155+static struct iova *__alloc_iova(struct iommu_domain *domain, size_t size,
155156 dma_addr_t dma_limit)
156157 {
158+ struct iova_domain *iovad = domain->iova_cookie;
157159 unsigned long shift = iova_shift(iovad);
158160 unsigned long length = iova_align(iovad, size) >> shift;
159161
162+ if (domain->geometry.force_aperture)
163+ dma_limit = min(dma_limit, domain->geometry.aperture_end);
160164 /*
161165 * Enforce size-alignment to be safe - there could perhaps be an
162166 * attribute to control this per-device, or at least per-domain...
@@ -314,7 +318,7 @@ struct page **iommu_dma_alloc(struct device *dev, size_t size, gfp_t gfp, · 151 unmodified lines
314318 if (!pages)
315319 return NULL;
316320
317− iova = __alloc_iova(iovad, size, dev->coherent_dma_mask);
321+ iova = __alloc_iova(domain, size, dev->coherent_dma_mask);
318322 if (!iova)
319323 goto out_free_pages;
320324
@@ -386,7 +390,7 @@ dma_addr_t iommu_dma_map_page(struct device *dev, struct page *page, · 65 unmodified lines
386390 phys_addr_t phys = page_to_phys(page) + offset;
387391 size_t iova_off = iova_offset(iovad, phys);
388392 size_t len = iova_align(iovad, size + iova_off);
389− struct iova *iova = __alloc_iova(iovad, len, dma_get_mask(dev));
393+ struct iova *iova = __alloc_iova(domain, len, dma_get_mask(dev));
390394
391395 if (!iova)
392396 return DMA_ERROR_CODE;
@@ -538,7 +542,7 @@ int iommu_dma_map_sg(struct device *dev, struct scatterlist *sg, · 145 unmodified lines
538542 prev = s;
539543 }
540544
541− iova = __alloc_iova(iovad, iova_len, dma_get_mask(dev));
545+ iova = __alloc_iova(domain, iova_len, dma_get_mask(dev));
542546 if (!iova)
543547 goto out_restore_sg;
544548
drivers/iommu/io-pgtable-arm-v7s.c+3−1
@@ -286,12 +286,14 @@ static int arm_v7s_pte_to_prot(arm_v7s_iopte pte, int lvl) · 285 unmodified lines
286286 int prot = IOMMU_READ;
287287 arm_v7s_iopte attr = pte >> ARM_V7S_ATTR_SHIFT(lvl);
288288
289− if (attr & ARM_V7S_PTE_AP_RDONLY)
289+ if (!(attr & ARM_V7S_PTE_AP_RDONLY))
290290 prot |= IOMMU_WRITE;
291291 if ((attr & (ARM_V7S_TEX_MASK << ARM_V7S_TEX_SHIFT)) == 0)
292292 prot |= IOMMU_MMIO;
293293 else if (pte & ARM_V7S_ATTR_C)
294294 prot |= IOMMU_CACHE;
295+ if (pte & ARM_V7S_ATTR_XN(lvl))
296+ prot |= IOMMU_NOEXEC;
295297
296298 return prot;
297299 }
drivers/iommu/mtk_iommu.h+3−3
@@ -55,19 +55,19 @@ struct mtk_iommu_data { · 54 unmodified lines
5555 bool enable_4GB;
5656 };
5757
58−static int compare_of(struct device *dev, void *data)
58+static inline int compare_of(struct device *dev, void *data)
5959 {
6060 return dev->of_node == data;
6161 }
6262
63−static int mtk_iommu_bind(struct device *dev)
63+static inline int mtk_iommu_bind(struct device *dev)
6464 {
6565 struct mtk_iommu_data *data = dev_get_drvdata(dev);
6666
6767 return component_bind_all(dev, &data->smi_imu);
6868 }
6969
70−static void mtk_iommu_unbind(struct device *dev)
70+static inline void mtk_iommu_unbind(struct device *dev)
7171 {
7272 struct mtk_iommu_data *data = dev_get_drvdata(dev);
7373
drivers/irqchip/irq-atmel-aic.c+3−2
@@ -176,6 +176,7 @@ static int aic_irq_domain_xlate(struct irq_domain *d, · 175 unmodified lines
176176 {
177177 struct irq_domain_chip_generic *dgc = d->gc;
178178 struct irq_chip_generic *gc;
179+ unsigned long flags;
179180 unsigned smr;
180181 int idx;
181182 int ret;
@@ -194,11 +195,11 @@ static int aic_irq_domain_xlate(struct irq_domain *d, · 12 unmodified lines
194195
195196 gc = dgc->gc[idx];
196197
197− irq_gc_lock(gc);
198+ irq_gc_lock_irqsave(gc, flags);
198199 smr = irq_reg_readl(gc, AT91_AIC_SMR(*out_hwirq));
199200 aic_common_set_priority(intspec[2], &smr);
200201 irq_reg_writel(gc, smr, AT91_AIC_SMR(*out_hwirq));
201− irq_gc_unlock(gc);
202+ irq_gc_unlock_irqrestore(gc, flags);
202203
203204 return ret;
204205 }
drivers/irqchip/irq-atmel-aic5.c+3−2
@@ -258,6 +258,7 @@ static int aic5_irq_domain_xlate(struct irq_domain *d, · 257 unmodified lines
258258 unsigned int *out_type)
259259 {
260260 struct irq_chip_generic *bgc = irq_get_domain_generic_chip(d, 0);
261+ unsigned long flags;
261262 unsigned smr;
262263 int ret;
263264
@@ -269,12 +270,12 @@ static int aic5_irq_domain_xlate(struct irq_domain *d, · 5 unmodified lines
269270 if (ret)
270271 return ret;
271272
272− irq_gc_lock(bgc);
273+ irq_gc_lock_irqsave(bgc, flags);
273274 irq_reg_writel(bgc, *out_hwirq, AT91_AIC5_SSR);
274275 smr = irq_reg_readl(bgc, AT91_AIC5_SMR);
275276 aic_common_set_priority(intspec[2], &smr);
276277 irq_reg_writel(bgc, smr, AT91_AIC5_SMR);
277− irq_gc_unlock(bgc);
278+ irq_gc_unlock_irqrestore(bgc, flags);
278279
279280 return ret;
280281 }
drivers/irqchip/irq-gic-v3-its.c+6−1
@@ -1545,7 +1545,12 @@ static int its_force_quiescent(void __iomem *base) · 1544 unmodified lines
15451545 u32 val;
15461546
15471547 val = readl_relaxed(base + GITS_CTLR);
1548− if (val & GITS_CTLR_QUIESCENT)
1548+ /*
1549+ * GIC architecture specification requires the ITS to be both
1550+ * disabled and quiescent for writes to GITS_BASER<n> or
1551+ * GITS_CBASER to not have UNPREDICTABLE results.
1552+ */
1553+ if ((val & GITS_CTLR_QUIESCENT) && !(val & GITS_CTLR_ENABLE))
15491554 return 0;
15501555
15511556 /* Disable the generation of all interrupts to this ITS */
drivers/irqchip/irq-gic-v3.c+13−5
@@ -548,7 +548,7 @@ static int gic_starting_cpu(unsigned int cpu) · 547 unmodified lines
548548 static u16 gic_compute_target_list(int *base_cpu, const struct cpumask *mask,
549549 unsigned long cluster_id)
550550 {
551− int cpu = *base_cpu;
551+ int next_cpu, cpu = *base_cpu;
552552 unsigned long mpidr = cpu_logical_map(cpu);
553553 u16 tlist = 0;
554554
@@ -562,9 +562,10 @@ static u16 gic_compute_target_list(int *base_cpu, const struct cpumask *mask, · 7 unmodified lines
562562
563563 tlist |= 1 << (mpidr & 0xf);
564564
565− cpu = cpumask_next(cpu, mask);
566− if (cpu >= nr_cpu_ids)
565+ next_cpu = cpumask_next(cpu, mask);
566+ if (next_cpu >= nr_cpu_ids)
567567 goto out;
568+ cpu = next_cpu;
568569
569570 mpidr = cpu_logical_map(cpu);
570571
@@ -667,13 +668,20 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, · 96 unmodified lines
667668 #endif
668669
669670 #ifdef CONFIG_CPU_PM
671+/* Check whether it's single security state view */
672+static bool gic_dist_security_disabled(void)
673+{
674+ return readl_relaxed(gic_data.dist_base + GICD_CTLR) & GICD_CTLR_DS;
675+}
676+
670677 static int gic_cpu_pm_notifier(struct notifier_block *self,
671678 unsigned long cmd, void *v)
672679 {
673680 if (cmd == CPU_PM_EXIT) {
674− gic_enable_redist(true);
681+ if (gic_dist_security_disabled())
682+ gic_enable_redist(true);
675683 gic_cpu_sys_reg_init();
676− } else if (cmd == CPU_PM_ENTER) {
684+ } else if (cmd == CPU_PM_ENTER && gic_dist_security_disabled()) {
677685 gic_write_grpen1(0);
678686 gic_enable_redist(false);
679687 }
drivers/irqchip/irq-gic.c+7−0
@@ -769,6 +769,13 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) · 768 unmodified lines
769769 int cpu;
770770 unsigned long flags, map = 0;
771771
772+ if (unlikely(nr_cpu_ids == 1)) {
773+ /* Only one CPU? let's do a self-IPI... */
774+ writel_relaxed(2 << 24 | irq,
775+ gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
776+ return;
777+ }
778+
772779 raw_spin_lock_irqsave(&irq_controller_lock, flags);
773780
774781 /* Convert our logical CPU mask into a physical one. */
drivers/irqchip/irq-mips-gic.c+61−56
@@ -638,27 +638,6 @@ static int gic_local_irq_domain_map(struct irq_domain *d, unsigned int virq, · 637 unmodified lines
638638 if (!gic_local_irq_is_routable(intr))
639639 return -EPERM;
640640
641− /*
642− * HACK: These are all really percpu interrupts, but the rest
643− * of the MIPS kernel code does not use the percpu IRQ API for
644− * the CP0 timer and performance counter interrupts.
645− */
646− switch (intr) {
647− case GIC_LOCAL_INT_TIMER:
648− case GIC_LOCAL_INT_PERFCTR:
649− case GIC_LOCAL_INT_FDC:
650− irq_set_chip_and_handler(virq,
651− &gic_all_vpes_local_irq_controller,
652− handle_percpu_irq);
653− break;
654− default:
655− irq_set_chip_and_handler(virq,
656− &gic_local_irq_controller,
657− handle_percpu_devid_irq);
658− irq_set_percpu_devid(virq);
659− break;
660− }
661−
662641 spin_lock_irqsave(&gic_lock, flags);
663642 for (i = 0; i < gic_vpes; i++) {
664643 u32 val = GIC_MAP_TO_PIN_MSK | gic_cpu_pin;
@@ -713,9 +692,6 @@ static int gic_shared_irq_domain_map(struct irq_domain *d, unsigned int virq, · 48 unmodified lines
713692 unsigned long flags;
714693 int i;
715694
716− irq_set_chip_and_handler(virq, &gic_level_irq_controller,
717− handle_level_irq);
718−
719695 spin_lock_irqsave(&gic_lock, flags);
720696 gic_map_to_pin(intr, gic_cpu_pin);
721697 gic_map_to_vpe(intr, mips_cm_vp_id(vpe));
@@ -727,12 +703,42 @@ static int gic_shared_irq_domain_map(struct irq_domain *d, unsigned int virq, · 5 unmodified lines
727703 return 0;
728704 }
729705
730−static int gic_irq_domain_map(struct irq_domain *d, unsigned int virq,
731− irq_hw_number_t hw)
706+static int gic_setup_dev_chip(struct irq_domain *d, unsigned int virq,
707+ unsigned int hwirq)
732708 {
733− if (GIC_HWIRQ_TO_LOCAL(hw) < GIC_NUM_LOCAL_INTRS)
734− return gic_local_irq_domain_map(d, virq, hw);
735− return gic_shared_irq_domain_map(d, virq, hw, 0);
709+ struct irq_chip *chip;
710+ int err;
711+
712+ if (hwirq >= GIC_SHARED_HWIRQ_BASE) {
713+ err = irq_domain_set_hwirq_and_chip(d, virq, hwirq,
714+ &gic_level_irq_controller,
715+ NULL);
716+ } else {
717+ switch (GIC_HWIRQ_TO_LOCAL(hwirq)) {
718+ case GIC_LOCAL_INT_TIMER:
719+ case GIC_LOCAL_INT_PERFCTR:
720+ case GIC_LOCAL_INT_FDC:
721+ /*
722+ * HACK: These are all really percpu interrupts, but
723+ * the rest of the MIPS kernel code does not use the
724+ * percpu IRQ API for them.
725+ */
726+ chip = &gic_all_vpes_local_irq_controller;
727+ irq_set_handler(virq, handle_percpu_irq);
728+ break;
729+
730+ default:
731+ chip = &gic_local_irq_controller;
732+ irq_set_handler(virq, handle_percpu_devid_irq);
733+ irq_set_percpu_devid(virq);
734+ break;
735+ }
736+
737+ err = irq_domain_set_hwirq_and_chip(d, virq, hwirq,
738+ chip, NULL);
739+ }
740+
741+ return err;
736742 }
737743
738744 static int gic_irq_domain_alloc(struct irq_domain *d, unsigned int virq,
@@ -743,15 +749,12 @@ static int gic_irq_domain_alloc(struct irq_domain *d, unsigned int virq, · 4 unmodified lines
743749 int cpu, ret, i;
744750
745751 if (spec->type == GIC_DEVICE) {
746− /* verify that it doesn't conflict with an IPI irq */
747− if (test_bit(spec->hwirq, ipi_resrv))
752+ /* verify that shared irqs don't conflict with an IPI irq */
753+ if ((spec->hwirq >= GIC_SHARED_HWIRQ_BASE) &&
754+ test_bit(GIC_HWIRQ_TO_SHARED(spec->hwirq), ipi_resrv))
748755 return -EBUSY;
749756
750− hwirq = GIC_SHARED_TO_HWIRQ(spec->hwirq);
751−
752− return irq_domain_set_hwirq_and_chip(d, virq, hwirq,
753− &gic_level_irq_controller,
754− NULL);
757+ return gic_setup_dev_chip(d, virq, spec->hwirq);
755758 } else {
756759 base_hwirq = find_first_bit(ipi_resrv, gic_shared_intrs);
757760 if (base_hwirq == gic_shared_intrs) {
@@ -771,11 +774,13 @@ static int gic_irq_domain_alloc(struct irq_domain *d, unsigned int virq, · 13 unmodified lines
771774 hwirq = GIC_SHARED_TO_HWIRQ(base_hwirq + i);
772775
773776 ret = irq_domain_set_hwirq_and_chip(d, virq + i, hwirq,
774− &gic_edge_irq_controller,
777+ &gic_level_irq_controller,
775778 NULL);
776779 if (ret)
777780 goto error;
778781
782+ irq_set_handler(virq + i, handle_level_irq);
783+
779784 ret = gic_shared_irq_domain_map(d, virq + i, hwirq, cpu);
780785 if (ret)
781786 goto error;
@@ -818,7 +823,6 @@ int gic_irq_domain_match(struct irq_domain *d, struct device_node *node, · 36 unmodified lines
818823 }
819824
820825 static const struct irq_domain_ops gic_irq_domain_ops = {
821− .map = gic_irq_domain_map,
822826 .alloc = gic_irq_domain_alloc,
823827 .free = gic_irq_domain_free,
824828 .match = gic_irq_domain_match,
@@ -849,29 +853,20 @@ static int gic_dev_domain_alloc(struct irq_domain *d, unsigned int virq, · 24 unmodified lines
849853 struct irq_fwspec *fwspec = arg;
850854 struct gic_irq_spec spec = {
851855 .type = GIC_DEVICE,
852− .hwirq = fwspec->param[1],
853856 };
854857 int i, ret;
855− bool is_shared = fwspec->param[0] == GIC_SHARED;
856858
857− if (is_shared) {
858− ret = irq_domain_alloc_irqs_parent(d, virq, nr_irqs, &spec);
859− if (ret)
860− return ret;
861− }
862−
863− for (i = 0; i < nr_irqs; i++) {
864− irq_hw_number_t hwirq;
859+ if (fwspec->param[0] == GIC_SHARED)
860+ spec.hwirq = GIC_SHARED_TO_HWIRQ(fwspec->param[1]);
861+ else
862+ spec.hwirq = GIC_LOCAL_TO_HWIRQ(fwspec->param[1]);
865863
866− if (is_shared)
867− hwirq = GIC_SHARED_TO_HWIRQ(spec.hwirq + i);
868− else
869− hwirq = GIC_LOCAL_TO_HWIRQ(spec.hwirq + i);
864+ ret = irq_domain_alloc_irqs_parent(d, virq, nr_irqs, &spec);
865+ if (ret)
866+ return ret;
870867
871− ret = irq_domain_set_hwirq_and_chip(d, virq + i,
872− hwirq,
873− &gic_level_irq_controller,
874− NULL);
868+ for (i = 0; i < nr_irqs; i++) {
869+ ret = gic_setup_dev_chip(d, virq + i, spec.hwirq + i);
875870 if (ret)
876871 goto error;
877872 }
@@ -890,10 +885,20 @@ void gic_dev_domain_free(struct irq_domain *d, unsigned int virq, · 12 unmodified lines
890885 return;
891886 }
892887
888+static void gic_dev_domain_activate(struct irq_domain *domain,
889+ struct irq_data *d)
890+{
891+ if (GIC_HWIRQ_TO_LOCAL(d->hwirq) < GIC_NUM_LOCAL_INTRS)
892+ gic_local_irq_domain_map(domain, d->irq, d->hwirq);
893+ else
894+ gic_shared_irq_domain_map(domain, d->irq, d->hwirq, 0);
895+}
896+
893897 static struct irq_domain_ops gic_dev_domain_ops = {
894898 .xlate = gic_dev_domain_xlate,
895899 .alloc = gic_dev_domain_alloc,
896900 .free = gic_dev_domain_free,
901+ .activate = gic_dev_domain_activate,
897902 };
898903
899904 static int gic_ipi_domain_xlate(struct irq_domain *d, struct device_node *ctrlr,
drivers/macintosh/ams/ams-i2c.c+0−1
@@ -73,7 +73,6 @@ MODULE_DEVICE_TABLE(i2c, ams_id); · 72 unmodified lines
7373 static struct i2c_driver ams_i2c_driver = {
7474 .driver = {
7575 .name = "ams",
76− .owner = THIS_MODULE,
7776 },
7877 .probe = ams_i2c_probe,
7978 .remove = ams_i2c_remove,
drivers/macintosh/windfarm_pm112.c+0−1
@@ -668,7 +668,6 @@ static struct platform_driver wf_pm112_driver = { · 667 unmodified lines
668668 .remove = wf_pm112_remove,
669669 .driver = {
670670 .name = "windfarm",
671− .owner = THIS_MODULE,
672671 },
673672 };
674673
drivers/macintosh/windfarm_pm72.c+0−1
@@ -789,7 +789,6 @@ static struct platform_driver wf_pm72_driver = { · 788 unmodified lines
789789 .remove = wf_pm72_remove,
790790 .driver = {
791791 .name = "windfarm",
792− .owner = THIS_MODULE,
793792 },
794793 };
795794
drivers/macintosh/windfarm_rm31.c+0−1
@@ -682,7 +682,6 @@ static struct platform_driver wf_rm31_driver = { · 681 unmodified lines
682682 .remove = wf_rm31_remove,
683683 .driver = {
684684 .name = "windfarm",
685− .owner = THIS_MODULE,
686685 },
687686 };
688687
drivers/mailbox/Kconfig+1−0
@@ -127,6 +127,7 @@ config XGENE_SLIMPRO_MBOX · 126 unmodified lines
127127 config BCM_PDC_MBOX
128128 tristate "Broadcom PDC Mailbox"
129129 depends on ARM64 || COMPILE_TEST
130+ depends on HAS_DMA
130131 default ARCH_BCM_IPROC
131132 help
132133 Mailbox implementation for the Broadcom PDC ring manager,
drivers/mailbox/bcm-pdc-mailbox.c+6−5
@@ -469,7 +469,7 @@ static const struct file_operations pdc_debugfs_stats = { · 468 unmodified lines
469469 * this directory for a SPU.
470470 * @pdcs: PDC state structure
471471 */
472−void pdc_setup_debugfs(struct pdc_state *pdcs)
472+static void pdc_setup_debugfs(struct pdc_state *pdcs)
473473 {
474474 char spu_stats_name[16];
475475
@@ -485,7 +485,7 @@ void pdc_setup_debugfs(struct pdc_state *pdcs) · 9 unmodified lines
485485 &pdc_debugfs_stats);
486486 }
487487
488−void pdc_free_debugfs(void)
488+static void pdc_free_debugfs(void)
489489 {
490490 if (debugfs_dir && simple_empty(debugfs_dir)) {
491491 debugfs_remove_recursive(debugfs_dir);
@@ -1191,10 +1191,11 @@ static void pdc_shutdown(struct mbox_chan *chan) · 699 unmodified lines
11911191 {
11921192 struct pdc_state *pdcs = chan->con_priv;
11931193
1194− if (pdcs)
1195− dev_dbg(&pdcs->pdev->dev,
1196− "Shutdown mailbox channel for PDC %u", pdcs->pdc_idx);
1194+ if (!pdcs)
1195+ return;
11971196
1197+ dev_dbg(&pdcs->pdev->dev,
1198+ "Shutdown mailbox channel for PDC %u", pdcs->pdc_idx);
11981199 pdc_ring_free(pdcs);
11991200 }
12001201
drivers/md/bcache/super.c+10−4
@@ -760,7 +760,8 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size, · 759 unmodified lines
760760 if (!d->nr_stripes ||
761761 d->nr_stripes > INT_MAX ||
762762 d->nr_stripes > SIZE_MAX / sizeof(atomic_t)) {
763− pr_err("nr_stripes too large");
763+ pr_err("nr_stripes too large or invalid: %u (start sector beyond end of disk?)",
764+ (unsigned)d->nr_stripes);
764765 return -ENOMEM;
765766 }
766767
@@ -1820,7 +1821,7 @@ static int cache_alloc(struct cache *ca) · 1053 unmodified lines
18201821 free = roundup_pow_of_two(ca->sb.nbuckets) >> 10;
18211822
18221823 if (!init_fifo(&ca->free[RESERVE_BTREE], 8, GFP_KERNEL) ||
1823− !init_fifo(&ca->free[RESERVE_PRIO], prio_buckets(ca), GFP_KERNEL) ||
1824+ !init_fifo_exact(&ca->free[RESERVE_PRIO], prio_buckets(ca), GFP_KERNEL) ||
18241825 !init_fifo(&ca->free[RESERVE_MOVINGGC], free, GFP_KERNEL) ||
18251826 !init_fifo(&ca->free[RESERVE_NONE], free, GFP_KERNEL) ||
18261827 !init_fifo(&ca->free_inc, free << 2, GFP_KERNEL) ||
@@ -1844,7 +1845,7 @@ static int register_cache(struct cache_sb *sb, struct page *sb_page, · 17 unmodified lines
18441845 struct block_device *bdev, struct cache *ca)
18451846 {
18461847 char name[BDEVNAME_SIZE];
1847− const char *err = NULL;
1848+ const char *err = NULL; /* must be set for any error case */
18481849 int ret = 0;
18491850
18501851 memcpy(&ca->sb, sb, sizeof(struct cache_sb));
@@ -1861,8 +1862,13 @@ static int register_cache(struct cache_sb *sb, struct page *sb_page, · 10 unmodified lines
18611862 ca->discard = CACHE_DISCARD(&ca->sb);
18621863
18631864 ret = cache_alloc(ca);
1864− if (ret != 0)
1865+ if (ret != 0) {
1866+ if (ret == -ENOMEM)
1867+ err = "cache_alloc(): -ENOMEM";
1868+ else
1869+ err = "cache_alloc(): unknown error";
18651870 goto err;
1871+ }
18661872
18671873 if (kobject_add(&ca->kobj, &part_to_dev(bdev->bd_part)->kobj, "bcache")) {
18681874 err = "error calling kobject_add";
drivers/md/bitmap.c+33−14
@@ -2183,19 +2183,29 @@ location_show(struct mddev *mddev, char *page) · 2182 unmodified lines
21832183 static ssize_t
21842184 location_store(struct mddev *mddev, const char *buf, size_t len)
21852185 {
2186+ int rv;
21862187
2188+ rv = mddev_lock(mddev);
2189+ if (rv)
2190+ return rv;
21872191 if (mddev->pers) {
2188− if (!mddev->pers->quiesce)
2189− return -EBUSY;
2190− if (mddev->recovery || mddev->sync_thread)
2191− return -EBUSY;
2192+ if (!mddev->pers->quiesce) {
2193+ rv = -EBUSY;
2194+ goto out;
2195+ }
2196+ if (mddev->recovery || mddev->sync_thread) {
2197+ rv = -EBUSY;
2198+ goto out;
2199+ }
21922200 }
21932201
21942202 if (mddev->bitmap || mddev->bitmap_info.file ||
21952203 mddev->bitmap_info.offset) {
21962204 /* bitmap already configured. Only option is to clear it */
2197− if (strncmp(buf, "none", 4) != 0)
2198− return -EBUSY;
2205+ if (strncmp(buf, "none", 4) != 0) {
2206+ rv = -EBUSY;
2207+ goto out;
2208+ }
21992209 if (mddev->pers) {
22002210 mddev->pers->quiesce(mddev, 1);
22012211 bitmap_destroy(mddev);
@@ -2214,21 +2224,25 @@ location_store(struct mddev *mddev, const char *buf, size_t len) · 12 unmodified lines
22142224 /* nothing to be done */;
22152225 else if (strncmp(buf, "file:", 5) == 0) {
22162226 /* Not supported yet */
2217− return -EINVAL;
2227+ rv = -EINVAL;
2228+ goto out;
22182229 } else {
2219− int rv;
22202230 if (buf[0] == '+')
22212231 rv = kstrtoll(buf+1, 10, &offset);
22222232 else
22232233 rv = kstrtoll(buf, 10, &offset);
22242234 if (rv)
2225− return rv;
2226− if (offset == 0)
2227− return -EINVAL;
2235+ goto out;
2236+ if (offset == 0) {
2237+ rv = -EINVAL;
2238+ goto out;
2239+ }
22282240 if (mddev->bitmap_info.external == 0 &&
22292241 mddev->major_version == 0 &&
2230− offset != mddev->bitmap_info.default_offset)
2231− return -EINVAL;
2242+ offset != mddev->bitmap_info.default_offset) {
2243+ rv = -EINVAL;
2244+ goto out;
2245+ }
22322246 mddev->bitmap_info.offset = offset;
22332247 if (mddev->pers) {
22342248 struct bitmap *bitmap;
@@ -2245,7 +2259,7 @@ location_store(struct mddev *mddev, const char *buf, size_t len) · 10 unmodified lines
22452259 mddev->pers->quiesce(mddev, 0);
22462260 if (rv) {
22472261 bitmap_destroy(mddev);
2248− return rv;
2262+ goto out;
22492263 }
22502264 }
22512265 }
@@ -2257,6 +2271,11 @@ location_store(struct mddev *mddev, const char *buf, size_t len) · 5 unmodified lines
22572271 set_bit(MD_CHANGE_DEVS, &mddev->flags);
22582272 md_wakeup_thread(mddev->thread);
22592273 }
2274+ rv = 0;
2275+out:
2276+ mddev_unlock(mddev);
2277+ if (rv)
2278+ return rv;
22602279 return len;
22612280 }
22622281
drivers/md/dm-bufio.c+1−1
@@ -1879,7 +1879,7 @@ static int __init dm_bufio_init(void) · 1878 unmodified lines
18791879 __cache_size_refresh();
18801880 mutex_unlock(&dm_bufio_clients_lock);
18811881
1882− dm_bufio_wq = create_singlethread_workqueue("dm_bufio_cache");
1882+ dm_bufio_wq = alloc_workqueue("dm_bufio_cache", WQ_MEM_RECLAIM, 0);
18831883 if (!dm_bufio_wq)
18841884 return -ENOMEM;
18851885
drivers/md/dm-crypt.c+9−2
@@ -181,7 +181,7 @@ struct crypt_config { · 180 unmodified lines
181181 u8 key[0];
182182 };
183183
184−#define MIN_IOS 16
184+#define MIN_IOS 64
185185
186186 static void clone_init(struct dm_crypt_io *, struct bio *);
187187 static void kcryptd_queue_crypt(struct dm_crypt_io *io);
@@ -1453,7 +1453,7 @@ static int crypt_alloc_tfms(struct crypt_config *cc, char *ciphermode) · 1265 unmodified lines
14531453 unsigned i;
14541454 int err;
14551455
1456− cc->tfms = kmalloc(cc->tfms_count * sizeof(struct crypto_skcipher *),
1456+ cc->tfms = kzalloc(cc->tfms_count * sizeof(struct crypto_skcipher *),
14571457 GFP_KERNEL);
14581458 if (!cc->tfms)
14591459 return -ENOMEM;
@@ -1924,6 +1924,13 @@ static int crypt_map(struct dm_target *ti, struct bio *bio) · 464 unmodified lines
19241924 return DM_MAPIO_REMAPPED;
19251925 }
19261926
1927+ /*
1928+ * Check if bio is too large, split as needed.
1929+ */
1930+ if (unlikely(bio->bi_iter.bi_size > (BIO_MAX_PAGES << PAGE_SHIFT)) &&
1931+ bio_data_dir(bio) == WRITE)
1932+ dm_accept_partial_bio(bio, ((BIO_MAX_PAGES << PAGE_SHIFT) >> SECTOR_SHIFT));
1933+
19271934 io = dm_per_bio_data(bio, cc->per_bio_data_size);
19281935 crypt_io_init(io, cc, bio, dm_target_offset(ti, bio->bi_iter.bi_sector));
19291936 io->ctx.req = (struct skcipher_request *)(io + 1);
drivers/md/dm-flakey.c+16−11
@@ -289,15 +289,13 @@ static int flakey_map(struct dm_target *ti, struct bio *bio) · 288 unmodified lines
289289 pb->bio_submitted = true;
290290
291291 /*
292− * Map reads as normal only if corrupt_bio_byte set.
292+ * Error reads if neither corrupt_bio_byte or drop_writes are set.
293+ * Otherwise, flakey_end_io() will decide if the reads should be modified.
293294 */
294295 if (bio_data_dir(bio) == READ) {
295− /* If flags were specified, only corrupt those that match. */
296− if (fc->corrupt_bio_byte && (fc->corrupt_bio_rw == READ) &&
297− all_corrupt_bio_flags_match(bio, fc))
298− goto map_bio;
299− else
296+ if (!fc->corrupt_bio_byte && !test_bit(DROP_WRITES, &fc->flags))
300297 return -EIO;
298+ goto map_bio;
301299 }
302300
303301 /*
@@ -334,14 +332,21 @@ static int flakey_end_io(struct dm_target *ti, struct bio *bio, int error) · 30 unmodified lines
334332 struct flakey_c *fc = ti->private;
335333 struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data));
336334
337− /*
338− * Corrupt successful READs while in down state.
339− */
340335 if (!error && pb->bio_submitted && (bio_data_dir(bio) == READ)) {
341− if (fc->corrupt_bio_byte)
336+ if (fc->corrupt_bio_byte && (fc->corrupt_bio_rw == READ) &&
337+ all_corrupt_bio_flags_match(bio, fc)) {
338+ /*
339+ * Corrupt successful matching READs while in down state.
340+ */
342341 corrupt_bio_data(bio, fc);
343− else
342+
343+ } else if (!test_bit(DROP_WRITES, &fc->flags)) {
344+ /*
345+ * Error read during the down_interval if drop_writes
346+ * wasn't configured.
347+ */
344348 return -EIO;
349+ }
345350 }
346351
347352 return error;
drivers/md/dm-log-writes.c+5−5
@@ -259,12 +259,12 @@ static int log_one_block(struct log_writes_c *lc, · 258 unmodified lines
259259 goto out;
260260 sector++;
261261
262− bio = bio_alloc(GFP_KERNEL, block->vec_cnt);
262+ atomic_inc(&lc->io_blocks);
263+ bio = bio_alloc(GFP_KERNEL, min(block->vec_cnt, BIO_MAX_PAGES));
263264 if (!bio) {
264265 DMERR("Couldn't alloc log bio");
265266 goto error;
266267 }
267− atomic_inc(&lc->io_blocks);
268268 bio->bi_iter.bi_size = 0;
269269 bio->bi_iter.bi_sector = sector;
270270 bio->bi_bdev = lc->logdev->bdev;
@@ -282,7 +282,7 @@ static int log_one_block(struct log_writes_c *lc, · 11 unmodified lines
282282 if (ret != block->vecs[i].bv_len) {
283283 atomic_inc(&lc->io_blocks);
284284 submit_bio(bio);
285− bio = bio_alloc(GFP_KERNEL, block->vec_cnt - i);
285+ bio = bio_alloc(GFP_KERNEL, min(block->vec_cnt - i, BIO_MAX_PAGES));
286286 if (!bio) {
287287 DMERR("Couldn't alloc log bio");
288288 goto error;
@@ -459,9 +459,9 @@ static int log_writes_ctr(struct dm_target *ti, unsigned int argc, char **argv) · 170 unmodified lines
459459 goto bad;
460460 }
461461
462− ret = -EINVAL;
463462 lc->log_kthread = kthread_run(log_writes_kthread, lc, "log-write");
464− if (!lc->log_kthread) {
463+ if (IS_ERR(lc->log_kthread)) {
464+ ret = PTR_ERR(lc->log_kthread);
465465 ti->error = "Couldn't alloc kthread";
466466 dm_put_device(ti, lc->dev);
467467 dm_put_device(ti, lc->logdev);
drivers/md/dm-log.c+6−5
@@ -291,9 +291,10 @@ static void header_from_disk(struct log_header_core *core, struct log_header_dis · 290 unmodified lines
291291 core->nr_regions = le64_to_cpu(disk->nr_regions);
292292 }
293293
294−static int rw_header(struct log_c *lc, int rw)
294+static int rw_header(struct log_c *lc, int op)
295295 {
296− lc->io_req.bi_op = rw;
296+ lc->io_req.bi_op = op;
297+ lc->io_req.bi_op_flags = 0;
297298
298299 return dm_io(&lc->io_req, 1, &lc->header_location, NULL);
299300 }
@@ -316,7 +317,7 @@ static int read_header(struct log_c *log) · 16 unmodified lines
316317 {
317318 int r;
318319
319− r = rw_header(log, READ);
320+ r = rw_header(log, REQ_OP_READ);
320321 if (r)
321322 return r;
322323
@@ -630,7 +631,7 @@ static int disk_resume(struct dm_dirty_log *log) · 307 unmodified lines
630631 header_to_disk(&lc->header, lc->disk_header);
631632
632633 /* write the new header */
633− r = rw_header(lc, WRITE);
634+ r = rw_header(lc, REQ_OP_WRITE);
634635 if (!r) {
635636 r = flush_header(lc);
636637 if (r)
@@ -698,7 +699,7 @@ static int disk_flush(struct dm_dirty_log *log) · 61 unmodified lines
698699 log_clear_bit(lc, lc->clean_bits, i);
699700 }
700701
701− r = rw_header(lc, WRITE);
702+ r = rw_header(lc, REQ_OP_WRITE);
702703 if (r)
703704 fail_log_device(lc);
704705 else {
drivers/md/dm-raid.c+47−35
@@ -191,7 +191,6 @@ struct raid_dev { · 190 unmodified lines
191191 #define RT_FLAG_RS_BITMAP_LOADED 2
192192 #define RT_FLAG_UPDATE_SBS 3
193193 #define RT_FLAG_RESHAPE_RS 4
194−#define RT_FLAG_KEEP_RS_FROZEN 5
195194
196195 /* Array elements of 64 bit needed for rebuild/failed disk bits */
197196 #define DISKS_ARRAY_ELEMS ((MAX_RAID_DEVICES + (sizeof(uint64_t) * 8 - 1)) / sizeof(uint64_t) / 8)
@@ -861,6 +860,9 @@ static int validate_region_size(struct raid_set *rs, unsigned long region_size) · 663 unmodified lines
861860 {
862861 unsigned long min_region_size = rs->ti->len / (1 << 21);
863862
863+ if (rs_is_raid0(rs))
864+ return 0;
865+
864866 if (!region_size) {
865867 /*
866868 * Choose a reasonable default. All figures in sectors.
@@ -930,6 +932,8 @@ static int validate_raid_redundancy(struct raid_set *rs) · 63 unmodified lines
930932 rebuild_cnt++;
931933
932934 switch (rs->raid_type->level) {
935+ case 0:
936+ break;
933937 case 1:
934938 if (rebuild_cnt >= rs->md.raid_disks)
935939 goto too_many;
@@ -2335,6 +2339,13 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs) · 1399 unmodified lines
23352339 case 0:
23362340 break;
23372341 default:
2342+ /*
2343+ * We have to keep any raid0 data/metadata device pairs or
2344+ * the MD raid0 personality will fail to start the array.
2345+ */
2346+ if (rs_is_raid0(rs))
2347+ continue;
2348+
23382349 dev = container_of(rdev, struct raid_dev, rdev);
23392350 if (dev->meta_dev)
23402351 dm_put_device(ti, dev->meta_dev);
@@ -2579,7 +2590,6 @@ static int rs_prepare_reshape(struct raid_set *rs) · 238 unmodified lines
25792590 } else {
25802591 /* Process raid1 without delta_disks */
25812592 mddev->raid_disks = rs->raid_disks;
2582− set_bit(RT_FLAG_KEEP_RS_FROZEN, &rs->runtime_flags);
25832593 reshape = false;
25842594 }
25852595 } else {
@@ -2590,7 +2600,6 @@ static int rs_prepare_reshape(struct raid_set *rs) · 4 unmodified lines
25902600 if (reshape) {
25912601 set_bit(RT_FLAG_RESHAPE_RS, &rs->runtime_flags);
25922602 set_bit(RT_FLAG_UPDATE_SBS, &rs->runtime_flags);
2593− set_bit(RT_FLAG_KEEP_RS_FROZEN, &rs->runtime_flags);
25942603 } else if (mddev->raid_disks < rs->raid_disks)
25952604 /* Create new superblocks and bitmaps, if any new disks */
25962605 set_bit(RT_FLAG_UPDATE_SBS, &rs->runtime_flags);
@@ -2902,7 +2911,6 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv) · 305 unmodified lines
29022911 goto bad;
29032912
29042913 set_bit(RT_FLAG_UPDATE_SBS, &rs->runtime_flags);
2905− set_bit(RT_FLAG_KEEP_RS_FROZEN, &rs->runtime_flags);
29062914 /* Takeover ain't recovery, so disable recovery */
29072915 rs_setup_recovery(rs, MaxSector);
29082916 rs_set_new(rs);
@@ -3386,21 +3394,28 @@ static void raid_postsuspend(struct dm_target *ti) · 477 unmodified lines
33863394 {
33873395 struct raid_set *rs = ti->private;
33883396
3389− if (test_and_clear_bit(RT_FLAG_RS_RESUMED, &rs->runtime_flags)) {
3390− if (!rs->md.suspended)
3391− mddev_suspend(&rs->md);
3392− rs->md.ro = 1;
3393− }
3397+ if (!rs->md.suspended)
3398+ mddev_suspend(&rs->md);
3399+
3400+ rs->md.ro = 1;
33943401 }
33953402
33963403 static void attempt_restore_of_faulty_devices(struct raid_set *rs)
33973404 {
33983405 int i;
3399− uint64_t failed_devices, cleared_failed_devices = 0;
3406+ uint64_t cleared_failed_devices[DISKS_ARRAY_ELEMS];
34003407 unsigned long flags;
3408+ bool cleared = false;
34013409 struct dm_raid_superblock *sb;
3410+ struct mddev *mddev = &rs->md;
34023411 struct md_rdev *r;
34033412
3413+ /* RAID personalities have to provide hot add/remove methods or we need to bail out. */
3414+ if (!mddev->pers || !mddev->pers->hot_add_disk || !mddev->pers->hot_remove_disk)
3415+ return;
3416+
3417+ memset(cleared_failed_devices, 0, sizeof(cleared_failed_devices));
3418+
34043419 for (i = 0; i < rs->md.raid_disks; i++) {
34053420 r = &rs->dev[i].rdev;
34063421 if (test_bit(Faulty, &r->flags) && r->sb_page &&
@@ -3420,7 +3435,7 @@ static void attempt_restore_of_faulty_devices(struct raid_set *rs) · 13 unmodified lines
34203435 * ourselves.
34213436 */
34223437 if ((r->raid_disk >= 0) &&
3423− (r->mddev->pers->hot_remove_disk(r->mddev, r) != 0))
3438+ (mddev->pers->hot_remove_disk(mddev, r) != 0))
34243439 /* Failed to revive this device, try next */
34253440 continue;
34263441
@@ -3430,22 +3445,30 @@ static void attempt_restore_of_faulty_devices(struct raid_set *rs) · 3 unmodified lines
34303445 clear_bit(Faulty, &r->flags);
34313446 clear_bit(WriteErrorSeen, &r->flags);
34323447 clear_bit(In_sync, &r->flags);
3433− if (r->mddev->pers->hot_add_disk(r->mddev, r)) {
3448+ if (mddev->pers->hot_add_disk(mddev, r)) {
34343449 r->raid_disk = -1;
34353450 r->saved_raid_disk = -1;
34363451 r->flags = flags;
34373452 } else {
34383453 r->recovery_offset = 0;
3439− cleared_failed_devices |= 1 << i;
3454+ set_bit(i, (void *) cleared_failed_devices);
3455+ cleared = true;
34403456 }
34413457 }
34423458 }
3443− if (cleared_failed_devices) {
3459+
3460+ /* If any failed devices could be cleared, update all sbs failed_devices bits */
3461+ if (cleared) {
3462+ uint64_t failed_devices[DISKS_ARRAY_ELEMS];
3463+
34443464 rdev_for_each(r, &rs->md) {
34453465 sb = page_address(r->sb_page);
3446− failed_devices = le64_to_cpu(sb->failed_devices);
3447− failed_devices &= ~cleared_failed_devices;
3448− sb->failed_devices = cpu_to_le64(failed_devices);
3466+ sb_retrieve_failed_devices(sb, failed_devices);
3467+
3468+ for (i = 0; i < DISKS_ARRAY_ELEMS; i++)
3469+ failed_devices[i] &= ~cleared_failed_devices[i];
3470+
3471+ sb_update_failed_devices(sb, failed_devices);
34493472 }
34503473 }
34513474 }
@@ -3610,26 +3633,15 @@ static void raid_resume(struct dm_target *ti) · 158 unmodified lines
36103633 * devices are reachable again.
36113634 */
36123635 attempt_restore_of_faulty_devices(rs);
3613− } else {
3614− mddev->ro = 0;
3615− mddev->in_sync = 0;
3636+ }
36163637
3617− /*
3618− * When passing in flags to the ctr, we expect userspace
3619− * to reset them because they made it to the superblocks
3620− * and reload the mapping anyway.
3621− *
3622− * -> only unfreeze recovery in case of a table reload or
3623− * we'll have a bogus recovery/reshape position
3624− * retrieved from the superblock by the ctr because
3625− * the ongoing recovery/reshape will change it after read.
3626− */
3627− if (!test_bit(RT_FLAG_KEEP_RS_FROZEN, &rs->runtime_flags))
3628− clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
3638+ mddev->ro = 0;
3639+ mddev->in_sync = 0;
36293640
3630− if (mddev->suspended)
3631− mddev_resume(mddev);
3632− }
3641+ clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
3642+
3643+ if (mddev->suspended)
3644+ mddev_resume(mddev);
36333645 }
36343646
36353647 static struct target_type raid_target = {
drivers/md/dm-round-robin.c+5−2
@@ -210,14 +210,17 @@ static struct dm_path *rr_select_path(struct path_selector *ps, size_t nr_bytes) · 209 unmodified lines
210210 struct path_info *pi = NULL;
211211 struct dm_path *current_path = NULL;
212212
213+ local_irq_save(flags);
213214 current_path = *this_cpu_ptr(s->current_path);
214215 if (current_path) {
215216 percpu_counter_dec(&s->repeat_count);
216− if (percpu_counter_read_positive(&s->repeat_count) > 0)
217+ if (percpu_counter_read_positive(&s->repeat_count) > 0) {
218+ local_irq_restore(flags);
217219 return current_path;
220+ }
218221 }
219222
220− spin_lock_irqsave(&s->lock, flags);
223+ spin_lock(&s->lock);
221224 if (!list_empty(&s->valid_paths)) {
222225 pi = list_entry(s->valid_paths.next, struct path_info, list);
223226 list_move_tail(&pi->list, &s->valid_paths);
drivers/md/md-cluster.c+9−3
@@ -834,8 +834,10 @@ static int join(struct mddev *mddev, int nodes) · 833 unmodified lines
834834 goto err;
835835 }
836836 cinfo->ack_lockres = lockres_init(mddev, "ack", ack_bast, 0);
837− if (!cinfo->ack_lockres)
837+ if (!cinfo->ack_lockres) {
838+ ret = -ENOMEM;
838839 goto err;
840+ }
839841 /* get sync CR lock on ACK. */
840842 if (dlm_lock_sync(cinfo->ack_lockres, DLM_LOCK_CR))
841843 pr_err("md-cluster: failed to get a sync CR lock on ACK!(%d)\n",
@@ -849,8 +851,10 @@ static int join(struct mddev *mddev, int nodes) · 7 unmodified lines
849851 pr_info("md-cluster: Joined cluster %s slot %d\n", str, cinfo->slot_number);
850852 snprintf(str, 64, "bitmap%04d", cinfo->slot_number - 1);
851853 cinfo->bitmap_lockres = lockres_init(mddev, str, NULL, 1);
852− if (!cinfo->bitmap_lockres)
854+ if (!cinfo->bitmap_lockres) {
855+ ret = -ENOMEM;
853856 goto err;
857+ }
854858 if (dlm_lock_sync(cinfo->bitmap_lockres, DLM_LOCK_PW)) {
855859 pr_err("Failed to get bitmap lock\n");
856860 ret = -EINVAL;
@@ -858,8 +862,10 @@ static int join(struct mddev *mddev, int nodes) · 1 unmodified line
858862 }
859863
860864 cinfo->resync_lockres = lockres_init(mddev, "resync", NULL, 0);
861− if (!cinfo->resync_lockres)
865+ if (!cinfo->resync_lockres) {
866+ ret = -ENOMEM;
862867 goto err;
868+ }
863869
864870 return 0;
865871 err:
drivers/md/md.c+19−21
@@ -1604,11 +1604,8 @@ static int super_1_validate(struct mddev *mddev, struct md_rdev *rdev) · 1603 unmodified lines
16041604 mddev->new_chunk_sectors = mddev->chunk_sectors;
16051605 }
16061606
1607− if (le32_to_cpu(sb->feature_map) & MD_FEATURE_JOURNAL) {
1607+ if (le32_to_cpu(sb->feature_map) & MD_FEATURE_JOURNAL)
16081608 set_bit(MD_HAS_JOURNAL, &mddev->flags);
1609− if (mddev->recovery_cp == MaxSector)
1610− set_bit(MD_JOURNAL_CLEAN, &mddev->flags);
1611− }
16121609 } else if (mddev->pers == NULL) {
16131610 /* Insist of good event counter while assembling, except for
16141611 * spares (which don't need an event count) */
@@ -5851,6 +5848,9 @@ static int get_array_info(struct mddev *mddev, void __user *arg) · 4236 unmodified lines
58515848 working++;
58525849 if (test_bit(In_sync, &rdev->flags))
58535850 insync++;
5851+ else if (test_bit(Journal, &rdev->flags))
5852+ /* TODO: add journal count to md_u.h */
5853+ ;
58545854 else
58555855 spare++;
58565856 }
@@ -7610,16 +7610,12 @@ EXPORT_SYMBOL(unregister_md_cluster_operations); · 1753 unmodified lines
76107610
76117611 int md_setup_cluster(struct mddev *mddev, int nodes)
76127612 {
7613− int err;
7614−
7615− err = request_module("md-cluster");
7616− if (err) {
7617− pr_err("md-cluster module not found.\n");
7618− return -ENOENT;
7619− }
7620−
7613+ if (!md_cluster_ops)
7614+ request_module("md-cluster");
76217615 spin_lock(&pers_lock);
7616+ /* ensure module won't be unloaded */
76227617 if (!md_cluster_ops || !try_module_get(md_cluster_mod)) {
7618+ pr_err("can't find md-cluster module or get it's reference.\n");
76237619 spin_unlock(&pers_lock);
76247620 return -ENOENT;
76257621 }
@@ -7862,6 +7858,7 @@ void md_do_sync(struct md_thread *thread) · 236 unmodified lines
78627858 */
78637859
78647860 do {
7861+ int mddev2_minor = -1;
78657862 mddev->curr_resync = 2;
78667863
78677864 try_again:
@@ -7891,10 +7888,14 @@ void md_do_sync(struct md_thread *thread) · 23 unmodified lines
78917888 prepare_to_wait(&resync_wait, &wq, TASK_INTERRUPTIBLE);
78927889 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery) &&
78937890 mddev2->curr_resync >= mddev->curr_resync) {
7894− printk(KERN_INFO "md: delaying %s of %s"
7895− " until %s has finished (they"
7896− " share one or more physical units)\n",
7897− desc, mdname(mddev), mdname(mddev2));
7891+ if (mddev2_minor != mddev2->md_minor) {
7892+ mddev2_minor = mddev2->md_minor;
7893+ printk(KERN_INFO "md: delaying %s of %s"
7894+ " until %s has finished (they"
7895+ " share one or more physical units)\n",
7896+ desc, mdname(mddev),
7897+ mdname(mddev2));
7898+ }
78987899 mddev_put(mddev2);
78997900 if (signal_pending(current))
79007901 flush_signals(current);
@@ -8275,16 +8276,13 @@ no_add: · 374 unmodified lines
82758276 static void md_start_sync(struct work_struct *ws)
82768277 {
82778278 struct mddev *mddev = container_of(ws, struct mddev, del_work);
8278− int ret = 0;
82798279
82808280 mddev->sync_thread = md_register_thread(md_do_sync,
82818281 mddev,
82828282 "resync");
82838283 if (!mddev->sync_thread) {
8284− if (!(mddev_is_clustered(mddev) && ret == -EAGAIN))
8285− printk(KERN_ERR "%s: could not start resync"
8286− " thread...\n",
8287− mdname(mddev));
8284+ printk(KERN_ERR "%s: could not start resync thread...\n",
8285+ mdname(mddev));
82888286 /* leave the spares where they are, it shouldn't hurt */
82898287 clear_bit(MD_RECOVERY_SYNC, &mddev->recovery);
82908288 clear_bit(MD_RECOVERY_RESHAPE, &mddev->recovery);
drivers/md/raid10.c+7−6
@@ -1064,6 +1064,8 @@ static void __make_request(struct mddev *mddev, struct bio *bio) · 1063 unmodified lines
10641064 int max_sectors;
10651065 int sectors;
10661066
1067+ md_write_start(mddev, bio);
1068+
10671069 /*
10681070 * Register the new request and wait if the reconstruction
10691071 * thread has put up a bar for new requests.
@@ -1445,8 +1447,6 @@ static void raid10_make_request(struct mddev *mddev, struct bio *bio) · 375 unmodified lines
14451447 return;
14461448 }
14471449
1448− md_write_start(mddev, bio);
1449−
14501450 do {
14511451
14521452 /*
@@ -2465,20 +2465,21 @@ static int narrow_write_error(struct r10bio *r10_bio, int i) · 1012 unmodified lines
24652465
24662466 while (sect_to_write) {
24672467 struct bio *wbio;
2468+ sector_t wsector;
24682469 if (sectors > sect_to_write)
24692470 sectors = sect_to_write;
24702471 /* Write at 'sector' for 'sectors' */
24712472 wbio = bio_clone_mddev(bio, GFP_NOIO, mddev);
24722473 bio_trim(wbio, sector - bio->bi_iter.bi_sector, sectors);
2473− wbio->bi_iter.bi_sector = (r10_bio->devs[i].addr+
2474− choose_data_offset(r10_bio, rdev) +
2475− (sector - r10_bio->sector));
2474+ wsector = r10_bio->devs[i].addr + (sector - r10_bio->sector);
2475+ wbio->bi_iter.bi_sector = wsector +
2476+ choose_data_offset(r10_bio, rdev);
24762477 wbio->bi_bdev = rdev->bdev;
24772478 bio_set_op_attrs(wbio, REQ_OP_WRITE, 0);
24782479
24792480 if (submit_bio_wait(wbio) < 0)
24802481 /* Failure! */
2481− ok = rdev_set_badblocks(rdev, sector,
2482+ ok = rdev_set_badblocks(rdev, wsector,
24822483 sectors, 0)
24832484 && ok;
24842485
drivers/md/raid5-cache.c+15−31
@@ -96,7 +96,6 @@ struct r5l_log { · 95 unmodified lines
9696 spinlock_t no_space_stripes_lock;
9797
9898 bool need_cache_flush;
99− bool in_teardown;
10099 };
101100
102101 /*
@@ -704,31 +703,22 @@ static void r5l_write_super_and_discard_space(struct r5l_log *log, · 601 unmodified lines
704703
705704 mddev = log->rdev->mddev;
706705 /*
707− * This is to avoid a deadlock. r5l_quiesce holds reconfig_mutex and
708− * wait for this thread to finish. This thread waits for
709− * MD_CHANGE_PENDING clear, which is supposed to be done in
710− * md_check_recovery(). md_check_recovery() tries to get
711− * reconfig_mutex. Since r5l_quiesce already holds the mutex,
712− * md_check_recovery() fails, so the PENDING never get cleared. The
713− * in_teardown check workaround this issue.
706+ * Discard could zero data, so before discard we must make sure
707+ * superblock is updated to new log tail. Updating superblock (either
708+ * directly call md_update_sb() or depend on md thread) must hold
709+ * reconfig mutex. On the other hand, raid5_quiesce is called with
710+ * reconfig_mutex hold. The first step of raid5_quiesce() is waitting
711+ * for all IO finish, hence waitting for reclaim thread, while reclaim
712+ * thread is calling this function and waitting for reconfig mutex. So
713+ * there is a deadlock. We workaround this issue with a trylock.
714+ * FIXME: we could miss discard if we can't take reconfig mutex
714715 */
715− if (!log->in_teardown) {
716− set_mask_bits(&mddev->flags, 0,
717− BIT(MD_CHANGE_DEVS) | BIT(MD_CHANGE_PENDING));
718− md_wakeup_thread(mddev->thread);
719− wait_event(mddev->sb_wait,
720− !test_bit(MD_CHANGE_PENDING, &mddev->flags) ||
721− log->in_teardown);
722− /*
723− * r5l_quiesce could run after in_teardown check and hold
724− * mutex first. Superblock might get updated twice.
725− */
726− if (log->in_teardown)
727− md_update_sb(mddev, 1);
728− } else {
729− WARN_ON(!mddev_is_locked(mddev));
730− md_update_sb(mddev, 1);
731− }
716+ set_mask_bits(&mddev->flags, 0,
717+ BIT(MD_CHANGE_DEVS) | BIT(MD_CHANGE_PENDING));
718+ if (!mddev_trylock(mddev))
719+ return;
720+ md_update_sb(mddev, 1);
721+ mddev_unlock(mddev);
732722
733723 /* discard IO error really doesn't matter, ignore it */
734724 if (log->last_checkpoint < end) {
@@ -827,7 +817,6 @@ void r5l_quiesce(struct r5l_log *log, int state) · 92 unmodified lines
827817 if (!log || state == 2)
828818 return;
829819 if (state == 0) {
830− log->in_teardown = 0;
831820 /*
832821 * This is a special case for hotadd. In suspend, the array has
833822 * no journal. In resume, journal is initialized as well as the
@@ -838,11 +827,6 @@ void r5l_quiesce(struct r5l_log *log, int state) · 4 unmodified lines
838827 log->reclaim_thread = md_register_thread(r5l_reclaim_thread,
839828 log->rdev->mddev, "reclaim");
840829 } else if (state == 1) {
841− /*
842− * at this point all stripes are finished, so io_unit is at
843− * least in STRIPE_END state
844− */
845− log->in_teardown = 1;
846830 /* make sure r5l_write_super_and_discard_space exits */
847831 mddev = log->rdev->mddev;
848832 wake_up(&mddev->sb_wait);
drivers/md/raid5.c+53−21
@@ -659,6 +659,7 @@ raid5_get_active_stripe(struct r5conf *conf, sector_t sector, · 658 unmodified lines
659659 {
660660 struct stripe_head *sh;
661661 int hash = stripe_hash_locks_hash(sector);
662+ int inc_empty_inactive_list_flag;
662663
663664 pr_debug("get_stripe, sector %llu\n", (unsigned long long)sector);
664665
@@ -703,7 +704,12 @@ raid5_get_active_stripe(struct r5conf *conf, sector_t sector, · 38 unmodified lines
703704 atomic_inc(&conf->active_stripes);
704705 BUG_ON(list_empty(&sh->lru) &&
705706 !test_bit(STRIPE_EXPANDING, &sh->state));
707+ inc_empty_inactive_list_flag = 0;
708+ if (!list_empty(conf->inactive_list + hash))
709+ inc_empty_inactive_list_flag = 1;
706710 list_del_init(&sh->lru);
711+ if (list_empty(conf->inactive_list + hash) && inc_empty_inactive_list_flag)
712+ atomic_inc(&conf->empty_inactive_list_nr);
707713 if (sh->group) {
708714 sh->group->stripes_cnt--;
709715 sh->group = NULL;
@@ -762,6 +768,7 @@ static void stripe_add_to_batch_list(struct r5conf *conf, struct stripe_head *sh · 52 unmodified lines
762768 sector_t head_sector, tmp_sec;
763769 int hash;
764770 int dd_idx;
771+ int inc_empty_inactive_list_flag;
765772
766773 /* Don't cross chunks, so stripe pd_idx/qd_idx is the same */
767774 tmp_sec = sh->sector;
@@ -779,7 +786,12 @@ static void stripe_add_to_batch_list(struct r5conf *conf, struct stripe_head *sh · 11 unmodified lines
779786 atomic_inc(&conf->active_stripes);
780787 BUG_ON(list_empty(&head->lru) &&
781788 !test_bit(STRIPE_EXPANDING, &head->state));
789+ inc_empty_inactive_list_flag = 0;
790+ if (!list_empty(conf->inactive_list + hash))
791+ inc_empty_inactive_list_flag = 1;
782792 list_del_init(&head->lru);
793+ if (list_empty(conf->inactive_list + hash) && inc_empty_inactive_list_flag)
794+ atomic_inc(&conf->empty_inactive_list_nr);
783795 if (head->group) {
784796 head->group->stripes_cnt--;
785797 head->group = NULL;
@@ -993,7 +1005,6 @@ again: · 207 unmodified lines
9931005
9941006 set_bit(STRIPE_IO_STARTED, &sh->state);
9951007
996− bio_reset(bi);
9971008 bi->bi_bdev = rdev->bdev;
9981009 bio_set_op_attrs(bi, op, op_flags);
9991010 bi->bi_end_io = op_is_write(op)
@@ -1045,7 +1056,6 @@ again: · 45 unmodified lines
10451056
10461057 set_bit(STRIPE_IO_STARTED, &sh->state);
10471058
1048− bio_reset(rbi);
10491059 rbi->bi_bdev = rrdev->bdev;
10501060 bio_set_op_attrs(rbi, op, op_flags);
10511061 BUG_ON(!op_is_write(op));
@@ -1978,9 +1988,11 @@ static void raid_run_ops(struct stripe_head *sh, unsigned long ops_request) · 926 unmodified lines
19781988 put_cpu();
19791989 }
19801990
1981−static struct stripe_head *alloc_stripe(struct kmem_cache *sc, gfp_t gfp)
1991+static struct stripe_head *alloc_stripe(struct kmem_cache *sc, gfp_t gfp,
1992+ int disks)
19821993 {
19831994 struct stripe_head *sh;
1995+ int i;
19841996
19851997 sh = kmem_cache_zalloc(sc, gfp);
19861998 if (sh) {
@@ -1989,6 +2001,17 @@ static struct stripe_head *alloc_stripe(struct kmem_cache *sc, gfp_t gfp) · 2 unmodified lines
19892001 INIT_LIST_HEAD(&sh->batch_list);
19902002 INIT_LIST_HEAD(&sh->lru);
19912003 atomic_set(&sh->count, 1);
2004+ for (i = 0; i < disks; i++) {
2005+ struct r5dev *dev = &sh->dev[i];
2006+
2007+ bio_init(&dev->req);
2008+ dev->req.bi_io_vec = &dev->vec;
2009+ dev->req.bi_max_vecs = 1;
2010+
2011+ bio_init(&dev->rreq);
2012+ dev->rreq.bi_io_vec = &dev->rvec;
2013+ dev->rreq.bi_max_vecs = 1;
2014+ }
19922015 }
19932016 return sh;
19942017 }
@@ -1996,7 +2019,7 @@ static int grow_one_stripe(struct r5conf *conf, gfp_t gfp) · 1 unmodified line
19962019 {
19972020 struct stripe_head *sh;
19982021
1999− sh = alloc_stripe(conf->slab_cache, gfp);
2022+ sh = alloc_stripe(conf->slab_cache, gfp, conf->pool_size);
20002023 if (!sh)
20012024 return 0;
20022025
@@ -2167,7 +2190,7 @@ static int resize_stripes(struct r5conf *conf, int newsize) · 164 unmodified lines
21672190 mutex_lock(&conf->cache_size_mutex);
21682191
21692192 for (i = conf->max_nr_stripes; i; i--) {
2170− nsh = alloc_stripe(sc, GFP_KERNEL);
2193+ nsh = alloc_stripe(sc, GFP_KERNEL, newsize);
21712194 if (!nsh)
21722195 break;
21732196
@@ -2299,6 +2322,7 @@ static void raid5_end_read_request(struct bio * bi) · 125 unmodified lines
22992322 (unsigned long long)sh->sector, i, atomic_read(&sh->count),
23002323 bi->bi_error);
23012324 if (i == disks) {
2325+ bio_reset(bi);
23022326 BUG();
23032327 return;
23042328 }
@@ -2399,6 +2423,7 @@ static void raid5_end_read_request(struct bio * bi) · 94 unmodified lines
23992423 }
24002424 }
24012425 rdev_dec_pending(rdev, conf->mddev);
2426+ bio_reset(bi);
24022427 clear_bit(R5_LOCKED, &sh->dev[i].flags);
24032428 set_bit(STRIPE_HANDLE, &sh->state);
24042429 raid5_release_stripe(sh);
@@ -2436,6 +2461,7 @@ static void raid5_end_write_request(struct bio *bi) · 31 unmodified lines
24362461 (unsigned long long)sh->sector, i, atomic_read(&sh->count),
24372462 bi->bi_error);
24382463 if (i == disks) {
2464+ bio_reset(bi);
24392465 BUG();
24402466 return;
24412467 }
@@ -2472,6 +2498,7 @@ static void raid5_end_write_request(struct bio *bi) · 30 unmodified lines
24722498 if (sh->batch_head && bi->bi_error && !replacement)
24732499 set_bit(STRIPE_BATCH_ERR, &sh->batch_head->state);
24742500
2501+ bio_reset(bi);
24752502 if (!test_and_clear_bit(R5_DOUBLE_LOCKED, &sh->dev[i].flags))
24762503 clear_bit(R5_LOCKED, &sh->dev[i].flags);
24772504 set_bit(STRIPE_HANDLE, &sh->state);
@@ -2485,16 +2512,6 @@ static void raid5_build_block(struct stripe_head *sh, int i, int previous) · 7 unmodified lines
24852512 {
24862513 struct r5dev *dev = &sh->dev[i];
24872514
2488− bio_init(&dev->req);
2489− dev->req.bi_io_vec = &dev->vec;
2490− dev->req.bi_max_vecs = 1;
2491− dev->req.bi_private = sh;
2492−
2493− bio_init(&dev->rreq);
2494− dev->rreq.bi_io_vec = &dev->rvec;
2495− dev->rreq.bi_max_vecs = 1;
2496− dev->rreq.bi_private = sh;
2497−
24982515 dev->flags = 0;
24992516 dev->sector = raid5_compute_blocknr(sh, i, previous);
25002517 }
@@ -4628,7 +4645,9 @@ finish: · 2127 unmodified lines
46284645 }
46294646
46304647 if (!bio_list_empty(&s.return_bi)) {
4631− if (test_bit(MD_CHANGE_PENDING, &conf->mddev->flags)) {
4648+ if (test_bit(MD_CHANGE_PENDING, &conf->mddev->flags) &&
4649+ (s.failed <= conf->max_degraded ||
4650+ conf->mddev->external == 0)) {
46324651 spin_lock_irq(&conf->device_lock);
46334652 bio_list_merge(&conf->return_bi, &s.return_bi);
46344653 spin_unlock_irq(&conf->device_lock);
@@ -6620,6 +6639,16 @@ static struct r5conf *setup_conf(struct mddev *mddev) · 1985 unmodified lines
66206639 }
66216640
66226641 conf->min_nr_stripes = NR_STRIPES;
6642+ if (mddev->reshape_position != MaxSector) {
6643+ int stripes = max_t(int,
6644+ ((mddev->chunk_sectors << 9) / STRIPE_SIZE) * 4,
6645+ ((mddev->new_chunk_sectors << 9) / STRIPE_SIZE) * 4);
6646+ conf->min_nr_stripes = max(NR_STRIPES, stripes);
6647+ if (conf->min_nr_stripes != NR_STRIPES)
6648+ printk(KERN_INFO
6649+ "md/raid:%s: force stripe size %d for reshape\n",
6650+ mdname(mddev), conf->min_nr_stripes);
6651+ }
66236652 memory = conf->min_nr_stripes * (sizeof(struct stripe_head) +
66246653 max_disks * ((sizeof(struct bio) + PAGE_SIZE))) / 1024;
66256654 atomic_set(&conf->empty_inactive_list_nr, NR_STRIPE_HASH_LOCKS);
@@ -6826,11 +6855,14 @@ static int raid5_run(struct mddev *mddev) · 200 unmodified lines
68266855 if (IS_ERR(conf))
68276856 return PTR_ERR(conf);
68286857
6829− if (test_bit(MD_HAS_JOURNAL, &mddev->flags) && !journal_dev) {
6830− printk(KERN_ERR "md/raid:%s: journal disk is missing, force array readonly\n",
6831− mdname(mddev));
6832− mddev->ro = 1;
6833− set_disk_ro(mddev->gendisk, 1);
6858+ if (test_bit(MD_HAS_JOURNAL, &mddev->flags)) {
6859+ if (!journal_dev) {
6860+ pr_err("md/raid:%s: journal disk is missing, force array readonly\n",
6861+ mdname(mddev));
6862+ mddev->ro = 1;
6863+ set_disk_ro(mddev->gendisk, 1);
6864+ } else if (mddev->recovery_cp == MaxSector)
6865+ set_bit(MD_JOURNAL_CLEAN, &mddev->flags);
68346866 }
68356867
68366868 conf->min_offset_diff = min_offset_diff;
drivers/media/cec-edid.c+4−1
@@ -70,7 +70,10 @@ static unsigned int cec_get_edid_spa_location(const u8 *edid, unsigned int size) · 69 unmodified lines
7070 u8 tag = edid[i] >> 5;
7171 u8 len = edid[i] & 0x1f;
7272
73− if (tag == 3 && len >= 5 && i + len <= end)
73+ if (tag == 3 && len >= 5 && i + len <= end &&
74+ edid[i + 1] == 0x03 &&
75+ edid[i + 2] == 0x0c &&
76+ edid[i + 3] == 0x00)
7477 return i + 4;
7578 i += len + 1;
7679 } while (i < end);
drivers/media/pci/cx23885/cx23885-417.c+1−0
@@ -1552,6 +1552,7 @@ int cx23885_417_register(struct cx23885_dev *dev) · 1551 unmodified lines
15521552 q->mem_ops = &vb2_dma_sg_memops;
15531553 q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
15541554 q->lock = &dev->lock;
1555+ q->dev = &dev->pci->dev;
15551556
15561557 err = vb2_queue_init(q);
15571558 if (err < 0)
drivers/media/pci/saa7134/saa7134-dvb.c+1−0
@@ -1238,6 +1238,7 @@ static int dvb_init(struct saa7134_dev *dev) · 1237 unmodified lines
12381238 q->buf_struct_size = sizeof(struct saa7134_buf);
12391239 q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
12401240 q->lock = &dev->lock;
1241+ q->dev = &dev->pci->dev;
12411242 ret = vb2_queue_init(q);
12421243 if (ret) {
12431244 vb2_dvb_dealloc_frontends(&dev->frontends);
drivers/media/pci/saa7134/saa7134-empress.c+1−0
@@ -295,6 +295,7 @@ static int empress_init(struct saa7134_dev *dev) · 294 unmodified lines
295295 q->buf_struct_size = sizeof(struct saa7134_buf);
296296 q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
297297 q->lock = &dev->lock;
298+ q->dev = &dev->pci->dev;
298299 err = vb2_queue_init(q);
299300 if (err)
300301 return err;
drivers/media/platform/Kconfig+1−1
@@ -169,7 +169,7 @@ config VIDEO_MEDIATEK_VPU · 168 unmodified lines
169169 config VIDEO_MEDIATEK_VCODEC
170170 tristate "Mediatek Video Codec driver"
171171 depends on MTK_IOMMU || COMPILE_TEST
172− depends on VIDEO_DEV && VIDEO_V4L2
172+ depends on VIDEO_DEV && VIDEO_V4L2 && HAS_DMA
173173 depends on ARCH_MEDIATEK || COMPILE_TEST
174174 select VIDEOBUF2_DMA_CONTIG
175175 select V4L2_MEM2MEM_DEV
drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h+0−1
@@ -23,7 +23,6 @@ · 22 unmodified lines
2323 #include <media/v4l2-ioctl.h>
2424 #include <media/videobuf2-core.h>
2525
26−#include "mtk_vcodec_util.h"
2726
2827 #define MTK_VCODEC_DRV_NAME "mtk_vcodec_drv"
2928 #define MTK_VCODEC_ENC_NAME "mtk-vcodec-enc"
drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c+26−16
@@ -487,7 +487,6 @@ static int vidioc_venc_s_fmt_out(struct file *file, void *priv, · 486 unmodified lines
487487 struct mtk_q_data *q_data;
488488 int ret, i;
489489 struct mtk_video_fmt *fmt;
490− unsigned int pitch_w_div16;
491490 struct v4l2_pix_format_mplane *pix_fmt_mp = &f->fmt.pix_mp;
492491
493492 vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type);
@@ -530,15 +529,6 @@ static int vidioc_venc_s_fmt_out(struct file *file, void *priv, · 36 unmodified lines
530529 q_data->coded_width = f->fmt.pix_mp.width;
531530 q_data->coded_height = f->fmt.pix_mp.height;
532531
533− pitch_w_div16 = DIV_ROUND_UP(q_data->visible_width, 16);
534− if (pitch_w_div16 % 8 != 0) {
535− /* Adjust returned width/height, so application could correctly
536− * allocate hw required memory
537− */
538− q_data->visible_height += 32;
539− vidioc_try_fmt(f, q_data->fmt);
540− }
541−
542532 q_data->field = f->fmt.pix_mp.field;
543533 ctx->colorspace = f->fmt.pix_mp.colorspace;
544534 ctx->ycbcr_enc = f->fmt.pix_mp.ycbcr_enc;
@@ -878,7 +868,8 @@ static int mtk_venc_encode_header(void *priv) · 333 unmodified lines
878868 {
879869 struct mtk_vcodec_ctx *ctx = priv;
880870 int ret;
881− struct vb2_buffer *dst_buf;
871+ struct vb2_buffer *src_buf, *dst_buf;
872+ struct vb2_v4l2_buffer *dst_vb2_v4l2, *src_vb2_v4l2;
882873 struct mtk_vcodec_mem bs_buf;
883874 struct venc_done_result enc_result;
884875
@@ -911,6 +902,15 @@ static int mtk_venc_encode_header(void *priv) · 26 unmodified lines
911902 mtk_v4l2_err("venc_if_encode failed=%d", ret);
912903 return -EINVAL;
913904 }
905+ src_buf = v4l2_m2m_next_src_buf(ctx->m2m_ctx);
906+ if (src_buf) {
907+ src_vb2_v4l2 = to_vb2_v4l2_buffer(src_buf);
908+ dst_vb2_v4l2 = to_vb2_v4l2_buffer(dst_buf);
909+ dst_buf->timestamp = src_buf->timestamp;
910+ dst_vb2_v4l2->timecode = src_vb2_v4l2->timecode;
911+ } else {
912+ mtk_v4l2_err("No timestamp for the header buffer.");
913+ }
914914
915915 ctx->state = MTK_STATE_HEADER;
916916 dst_buf->planes[0].bytesused = enc_result.bs_size;
@@ -1003,7 +1003,7 @@ static void mtk_venc_worker(struct work_struct *work) · 86 unmodified lines
10031003 struct mtk_vcodec_mem bs_buf;
10041004 struct venc_done_result enc_result;
10051005 int ret, i;
1006− struct vb2_v4l2_buffer *vb2_v4l2;
1006+ struct vb2_v4l2_buffer *dst_vb2_v4l2, *src_vb2_v4l2;
10071007
10081008 /* check dst_buf, dst_buf may be removed in device_run
10091009 * to stored encdoe header so we need check dst_buf and
@@ -1043,9 +1043,14 @@ static void mtk_venc_worker(struct work_struct *work) · 33 unmodified lines
10431043 ret = venc_if_encode(ctx, VENC_START_OPT_ENCODE_FRAME,
10441044 &frm_buf, &bs_buf, &enc_result);
10451045
1046− vb2_v4l2 = container_of(dst_buf, struct vb2_v4l2_buffer, vb2_buf);
1046+ src_vb2_v4l2 = to_vb2_v4l2_buffer(src_buf);
1047+ dst_vb2_v4l2 = to_vb2_v4l2_buffer(dst_buf);
1048+
1049+ dst_buf->timestamp = src_buf->timestamp;
1050+ dst_vb2_v4l2->timecode = src_vb2_v4l2->timecode;
1051+
10471052 if (enc_result.is_key_frm)
1048− vb2_v4l2->flags |= V4L2_BUF_FLAG_KEYFRAME;
1053+ dst_vb2_v4l2->flags |= V4L2_BUF_FLAG_KEYFRAME;
10491054
10501055 if (ret) {
10511056 v4l2_m2m_buf_done(to_vb2_v4l2_buffer(src_buf),
@@ -1217,7 +1222,7 @@ int mtk_vcodec_enc_ctrls_setup(struct mtk_vcodec_ctx *ctx) · 165 unmodified lines
12171222 0, V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE);
12181223 v4l2_ctrl_new_std_menu(handler, ops, V4L2_CID_MPEG_VIDEO_H264_PROFILE,
12191224 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH,
1220− 0, V4L2_MPEG_VIDEO_H264_PROFILE_MAIN);
1225+ 0, V4L2_MPEG_VIDEO_H264_PROFILE_HIGH);
12211226 v4l2_ctrl_new_std_menu(handler, ops, V4L2_CID_MPEG_VIDEO_H264_LEVEL,
12221227 V4L2_MPEG_VIDEO_H264_LEVEL_4_2,
12231228 0, V4L2_MPEG_VIDEO_H264_LEVEL_4_0);
@@ -1288,5 +1293,10 @@ int mtk_venc_lock(struct mtk_vcodec_ctx *ctx) · 64 unmodified lines
12881293
12891294 void mtk_vcodec_enc_release(struct mtk_vcodec_ctx *ctx)
12901295 {
1291− venc_if_deinit(ctx);
1296+ int ret = venc_if_deinit(ctx);
1297+
1298+ if (ret)
1299+ mtk_v4l2_err("venc_if_deinit failed=%d", ret);
1300+
1301+ ctx->state = MTK_STATE_FREE;
12921302 }
drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c+5−1
@@ -218,11 +218,15 @@ static int fops_vcodec_release(struct file *file) · 217 unmodified lines
218218 mtk_v4l2_debug(1, "[%d] encoder", ctx->id);
219219 mutex_lock(&dev->dev_mutex);
220220
221+ /*
222+ * Call v4l2_m2m_ctx_release to make sure the worker thread is not
223+ * running after venc_if_deinit.
224+ */
225+ v4l2_m2m_ctx_release(ctx->m2m_ctx);
221226 mtk_vcodec_enc_release(ctx);
222227 v4l2_fh_del(&ctx->fh);
223228 v4l2_fh_exit(&ctx->fh);
224229 v4l2_ctrl_handler_free(&ctx->ctrl_hdl);
225− v4l2_m2m_ctx_release(ctx->m2m_ctx);
226230
227231 list_del_init(&ctx->list);
228232 dev->num_instances--;
drivers/media/platform/mtk-vcodec/mtk_vcodec_intr.h+0−1
@@ -16,7 +16,6 @@ · 15 unmodified lines
1616 #define _MTK_VCODEC_INTR_H_
1717
1818 #define MTK_INST_IRQ_RECEIVED 0x1
19−#define MTK_INST_WORK_THREAD_ABORT_DONE 0x2
2019
2120 struct mtk_vcodec_ctx;
2221
drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c+8−8
@@ -61,6 +61,8 @@ enum venc_h264_bs_mode { · 60 unmodified lines
6161
6262 /*
6363 * struct venc_h264_vpu_config - Structure for h264 encoder configuration
64+ * AP-W/R : AP is writer/reader on this item
65+ * VPU-W/R: VPU is write/reader on this item
6466 * @input_fourcc: input fourcc
6567 * @bitrate: target bitrate (in bps)
6668 * @pic_w: picture width. Picture size is visible stream resolution, in pixels,
@@ -94,13 +96,13 @@ struct venc_h264_vpu_config { · 27 unmodified lines
9496
9597 /*
9698 * struct venc_h264_vpu_buf - Structure for buffer information
97− * @align: buffer alignment (in bytes)
99+ * AP-W/R : AP is writer/reader on this item
100+ * VPU-W/R: VPU is write/reader on this item
98101 * @iova: IO virtual address
99102 * @vpua: VPU side memory addr which is used by RC_CODE
100103 * @size: buffer size (in bytes)
101104 */
102105 struct venc_h264_vpu_buf {
103− u32 align;
104106 u32 iova;
105107 u32 vpua;
106108 u32 size;
@@ -108,6 +110,8 @@ struct venc_h264_vpu_buf { · 1 unmodified line
108110
109111 /*
110112 * struct venc_h264_vsi - Structure for VPU driver control and info share
113+ * AP-W/R : AP is writer/reader on this item
114+ * VPU-W/R: VPU is write/reader on this item
111115 * This structure is allocated in VPU side and shared to AP side.
112116 * @config: h264 encoder configuration
113117 * @work_bufs: working buffer information in VPU side
@@ -150,12 +154,6 @@ struct venc_h264_inst { · 36 unmodified lines
150154 struct mtk_vcodec_ctx *ctx;
151155 };
152156
153−static inline void h264_write_reg(struct venc_h264_inst *inst, u32 addr,
154− u32 val)
155−{
156− writel(val, inst->hw_base + addr);
157−}
158−
159157 static inline u32 h264_read_reg(struct venc_h264_inst *inst, u32 addr)
160158 {
161159 return readl(inst->hw_base + addr);
@@ -214,6 +212,8 @@ static unsigned int h264_get_level(struct venc_h264_inst *inst, · 52 unmodified lines
214212 return 40;
215213 case V4L2_MPEG_VIDEO_H264_LEVEL_4_1:
216214 return 41;
215+ case V4L2_MPEG_VIDEO_H264_LEVEL_4_2:
216+ return 42;
217217 default:
218218 mtk_vcodec_debug(inst, "unsupported level %d", level);
219219 return 31;
drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c+7−9
@@ -56,6 +56,8 @@ enum venc_vp8_vpu_work_buf { · 55 unmodified lines
5656
5757 /*
5858 * struct venc_vp8_vpu_config - Structure for vp8 encoder configuration
59+ * AP-W/R : AP is writer/reader on this item
60+ * VPU-W/R: VPU is write/reader on this item
5961 * @input_fourcc: input fourcc
6062 * @bitrate: target bitrate (in bps)
6163 * @pic_w: picture width. Picture size is visible stream resolution, in pixels,
@@ -83,14 +85,14 @@ struct venc_vp8_vpu_config { · 21 unmodified lines
8385 };
8486
8587 /*
86− * struct venc_vp8_vpu_buf -Structure for buffer information
87− * @align: buffer alignment (in bytes)
88+ * struct venc_vp8_vpu_buf - Structure for buffer information
89+ * AP-W/R : AP is writer/reader on this item
90+ * VPU-W/R: VPU is write/reader on this item
8891 * @iova: IO virtual address
8992 * @vpua: VPU side memory addr which is used by RC_CODE
9093 * @size: buffer size (in bytes)
9194 */
9295 struct venc_vp8_vpu_buf {
93− u32 align;
9496 u32 iova;
9597 u32 vpua;
9698 u32 size;
@@ -98,6 +100,8 @@ struct venc_vp8_vpu_buf { · 1 unmodified line
98100
99101 /*
100102 * struct venc_vp8_vsi - Structure for VPU driver control and info share
103+ * AP-W/R : AP is writer/reader on this item
104+ * VPU-W/R: VPU is write/reader on this item
101105 * This structure is allocated in VPU side and shared to AP side.
102106 * @config: vp8 encoder configuration
103107 * @work_bufs: working buffer information in VPU side
@@ -138,12 +142,6 @@ struct venc_vp8_inst { · 34 unmodified lines
138142 struct mtk_vcodec_ctx *ctx;
139143 };
140144
141−static inline void vp8_enc_write_reg(struct venc_vp8_inst *inst, u32 addr,
142− u32 val)
143−{
144− writel(val, inst->hw_base + addr);
145−}
146−
147145 static inline u32 vp8_enc_read_reg(struct venc_vp8_inst *inst, u32 addr)
148146 {
149147 return readl(inst->hw_base + addr);
drivers/media/platform/rcar-fcp.c+7−1
@@ -99,10 +99,16 @@ EXPORT_SYMBOL_GPL(rcar_fcp_put); · 98 unmodified lines
9999 */
100100 int rcar_fcp_enable(struct rcar_fcp_device *fcp)
101101 {
102+ int error;
103+
102104 if (!fcp)
103105 return 0;
104106
105− return pm_runtime_get_sync(fcp->dev);
107+ error = pm_runtime_get_sync(fcp->dev);
108+ if (error < 0)
109+ return error;
110+
111+ return 0;
106112 }
107113 EXPORT_SYMBOL_GPL(rcar_fcp_enable);
108114
drivers/memory/omap-gpmc.c+7−14
@@ -2185,7 +2185,7 @@ static int gpmc_probe_dt(struct platform_device *pdev) · 2184 unmodified lines
21852185 return 0;
21862186 }
21872187
2188−static int gpmc_probe_dt_children(struct platform_device *pdev)
2188+static void gpmc_probe_dt_children(struct platform_device *pdev)
21892189 {
21902190 int ret;
21912191 struct device_node *child;
@@ -2200,11 +2200,11 @@ static int gpmc_probe_dt_children(struct platform_device *pdev) · 8 unmodified lines
22002200 else
22012201 ret = gpmc_probe_generic_child(pdev, child);
22022202
2203− if (ret)
2204− return ret;
2203+ if (ret) {
2204+ dev_err(&pdev->dev, "failed to probe DT child '%s': %d\n",
2205+ child->name, ret);
2206+ }
22052207 }
2206−
2207− return 0;
22082208 }
22092209 #else
22102210 static int gpmc_probe_dt(struct platform_device *pdev)
@@ -2212,9 +2212,8 @@ static int gpmc_probe_dt(struct platform_device *pdev) · 1 unmodified line
22122212 return 0;
22132213 }
22142214
2215−static int gpmc_probe_dt_children(struct platform_device *pdev)
2215+static void gpmc_probe_dt_children(struct platform_device *pdev)
22162216 {
2217− return 0;
22182217 }
22192218 #endif /* CONFIG_OF */
22202219
@@ -2369,16 +2368,10 @@ static int gpmc_probe(struct platform_device *pdev) · 148 unmodified lines
23692368 goto setup_irq_failed;
23702369 }
23712370
2372− rc = gpmc_probe_dt_children(pdev);
2373− if (rc < 0) {
2374− dev_err(gpmc->dev, "failed to probe DT children\n");
2375− goto dt_children_failed;
2376− }
2371+ gpmc_probe_dt_children(pdev);
23772372
23782373 return 0;
23792374
2380−dt_children_failed:
2381− gpmc_free_irq(gpmc);
23822375 setup_irq_failed:
23832376 gpmc_gpio_exit(gpmc);
23842377 gpio_init_failed:
drivers/misc/Kconfig+0−10
@@ -345,16 +345,6 @@ config SENSORS_TSL2550 · 344 unmodified lines
345345 This driver can also be built as a module. If so, the module
346346 will be called tsl2550.
347347
348−config SENSORS_BH1780
349− tristate "ROHM BH1780GLI ambient light sensor"
350− depends on I2C && SYSFS
351− help
352− If you say yes here you get support for the ROHM BH1780GLI
353− ambient light sensor.
354−
355− This driver can also be built as a module. If so, the module
356− will be called bh1780gli.
357−
358348 config SENSORS_BH1770
359349 tristate "BH1770GLC / SFH7770 combined ALS - Proximity sensor"
360350 depends on I2C
drivers/misc/Makefile+0−1
@@ -19,7 +19,6 @@ obj-$(CONFIG_TIFM_CORE) += tifm_core.o · 18 unmodified lines
1919 obj-$(CONFIG_TIFM_7XX1) += tifm_7xx1.o
2020 obj-$(CONFIG_PHANTOM) += phantom.o
2121 obj-$(CONFIG_QCOM_COINCELL) += qcom-coincell.o
22−obj-$(CONFIG_SENSORS_BH1780) += bh1780gli.o
2322 obj-$(CONFIG_SENSORS_BH1770) += bh1770glc.o
2423 obj-$(CONFIG_SENSORS_APDS990X) += apds990x.o
2524 obj-$(CONFIG_SGI_IOC4) += ioc4.o
drivers/misc/bh1780gli.c+0−259
@@ -1,259 +0,0 @@
1−/*
2− * bh1780gli.c
3− * ROHM Ambient Light Sensor Driver
4− *
5− * Copyright (C) 2010 Texas Instruments
6− * Author: Hemanth V <hemanthv@ti.com>
7− *
8− * This program is free software; you can redistribute it and/or modify it
9− * under the terms of the GNU General Public License version 2 as published by
10− * the Free Software Foundation.
11− *
12− * This program is distributed in the hope that it will be useful, but WITHOUT
13− * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14− * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15− * more details.
16− *
17− * You should have received a copy of the GNU General Public License along with
18− * this program. If not, see <http://www.gnu.org/licenses/>.
19− */
20−#include <linux/i2c.h>
21−#include <linux/slab.h>
22−#include <linux/mutex.h>
23−#include <linux/platform_device.h>
24−#include <linux/delay.h>
25−#include <linux/module.h>
26−#include <linux/of.h>
27−
28−#define BH1780_REG_CONTROL 0x80
29−#define BH1780_REG_PARTID 0x8A
30−#define BH1780_REG_MANFID 0x8B
31−#define BH1780_REG_DLOW 0x8C
32−#define BH1780_REG_DHIGH 0x8D
33−
34−#define BH1780_REVMASK (0xf)
35−#define BH1780_POWMASK (0x3)
36−#define BH1780_POFF (0x0)
37−#define BH1780_PON (0x3)
38−
39−/* power on settling time in ms */
40−#define BH1780_PON_DELAY 2
41−
42−struct bh1780_data {
43− struct i2c_client *client;
44− int power_state;
45− /* lock for sysfs operations */
46− struct mutex lock;
47−};
48−
49−static int bh1780_write(struct bh1780_data *ddata, u8 reg, u8 val, char *msg)
50−{
51− int ret = i2c_smbus_write_byte_data(ddata->client, reg, val);
52− if (ret < 0)
53− dev_err(&ddata->client->dev,
54− "i2c_smbus_write_byte_data failed error %d Register (%s)\n",
55− ret, msg);
56− return ret;
57−}
58−
59−static int bh1780_read(struct bh1780_data *ddata, u8 reg, char *msg)
60−{
61− int ret = i2c_smbus_read_byte_data(ddata->client, reg);
62− if (ret < 0)
63− dev_err(&ddata->client->dev,
64− "i2c_smbus_read_byte_data failed error %d Register (%s)\n",
65− ret, msg);
66− return ret;
67−}
68−
69−static ssize_t bh1780_show_lux(struct device *dev,
70− struct device_attribute *attr, char *buf)
71−{
72− struct platform_device *pdev = to_platform_device(dev);
73− struct bh1780_data *ddata = platform_get_drvdata(pdev);
74− int lsb, msb;
75−
76− lsb = bh1780_read(ddata, BH1780_REG_DLOW, "DLOW");
77− if (lsb < 0)
78− return lsb;
79−
80− msb = bh1780_read(ddata, BH1780_REG_DHIGH, "DHIGH");
81− if (msb < 0)
82− return msb;
83−
84− return sprintf(buf, "%d\n", (msb << 8) | lsb);
85−}
86−
87−static ssize_t bh1780_show_power_state(struct device *dev,
88− struct device_attribute *attr,
89− char *buf)
90−{
91− struct platform_device *pdev = to_platform_device(dev);
92− struct bh1780_data *ddata = platform_get_drvdata(pdev);
93− int state;
94−
95− state = bh1780_read(ddata, BH1780_REG_CONTROL, "CONTROL");
96− if (state < 0)
97− return state;
98−
99− return sprintf(buf, "%d\n", state & BH1780_POWMASK);
100−}
101−
102−static ssize_t bh1780_store_power_state(struct device *dev,
103− struct device_attribute *attr,
104− const char *buf, size_t count)
105−{
106− struct platform_device *pdev = to_platform_device(dev);
107− struct bh1780_data *ddata = platform_get_drvdata(pdev);
108− unsigned long val;
109− int error;
110−
111− error = kstrtoul(buf, 0, &val);
112− if (error)
113− return error;
114−
115− if (val < BH1780_POFF || val > BH1780_PON)
116− return -EINVAL;
117−
118− mutex_lock(&ddata->lock);
119−
120− error = bh1780_write(ddata, BH1780_REG_CONTROL, val, "CONTROL");
121− if (error < 0) {
122− mutex_unlock(&ddata->lock);
123− return error;
124− }
125−
126− msleep(BH1780_PON_DELAY);
127− ddata->power_state = val;
128− mutex_unlock(&ddata->lock);
129−
130− return count;
131−}
132−
133−static DEVICE_ATTR(lux, S_IRUGO, bh1780_show_lux, NULL);
134−
135−static DEVICE_ATTR(power_state, S_IWUSR | S_IRUGO,
136− bh1780_show_power_state, bh1780_store_power_state);
137−
138−static struct attribute *bh1780_attributes[] = {
139− &dev_attr_power_state.attr,
140− &dev_attr_lux.attr,
141− NULL
142−};
143−
144−static const struct attribute_group bh1780_attr_group = {
145− .attrs = bh1780_attributes,
146−};
147−
148−static int bh1780_probe(struct i2c_client *client,
149− const struct i2c_device_id *id)
150−{
151− int ret;
152− struct bh1780_data *ddata;
153− struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
154−
155− if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE))
156− return -EIO;
157−
158− ddata = devm_kzalloc(&client->dev, sizeof(struct bh1780_data),
159− GFP_KERNEL);
160− if (ddata == NULL)
161− return -ENOMEM;
162−
163− ddata->client = client;
164− i2c_set_clientdata(client, ddata);
165−
166− ret = bh1780_read(ddata, BH1780_REG_PARTID, "PART ID");
167− if (ret < 0)
168− return ret;
169−
170− dev_info(&client->dev, "Ambient Light Sensor, Rev : %d\n",
171− (ret & BH1780_REVMASK));
172−
173− mutex_init(&ddata->lock);
174−
175− return sysfs_create_group(&client->dev.kobj, &bh1780_attr_group);
176−}
177−
178−static int bh1780_remove(struct i2c_client *client)
179−{
180− sysfs_remove_group(&client->dev.kobj, &bh1780_attr_group);
181−
182− return 0;
183−}
184−
185−#ifdef CONFIG_PM_SLEEP
186−static int bh1780_suspend(struct device *dev)
187−{
188− struct bh1780_data *ddata;
189− int state, ret;
190− struct i2c_client *client = to_i2c_client(dev);
191−
192− ddata = i2c_get_clientdata(client);
193− state = bh1780_read(ddata, BH1780_REG_CONTROL, "CONTROL");
194− if (state < 0)
195− return state;
196−
197− ddata->power_state = state & BH1780_POWMASK;
198−
199− ret = bh1780_write(ddata, BH1780_REG_CONTROL, BH1780_POFF,
200− "CONTROL");
201−
202− if (ret < 0)
203− return ret;
204−
205− return 0;
206−}
207−
208−static int bh1780_resume(struct device *dev)
209−{
210− struct bh1780_data *ddata;
211− int state, ret;
212− struct i2c_client *client = to_i2c_client(dev);
213−
214− ddata = i2c_get_clientdata(client);
215− state = ddata->power_state;
216− ret = bh1780_write(ddata, BH1780_REG_CONTROL, state,
217− "CONTROL");
218−
219− if (ret < 0)
220− return ret;
221−
222− return 0;
223−}
224−#endif /* CONFIG_PM_SLEEP */
225−
226−static SIMPLE_DEV_PM_OPS(bh1780_pm, bh1780_suspend, bh1780_resume);
227−
228−static const struct i2c_device_id bh1780_id[] = {
229− { "bh1780", 0 },
230− { },
231−};
232−
233−MODULE_DEVICE_TABLE(i2c, bh1780_id);
234−
235−#ifdef CONFIG_OF
236−static const struct of_device_id of_bh1780_match[] = {
237− { .compatible = "rohm,bh1780gli", },
238− {},
239−};
240−
241−MODULE_DEVICE_TABLE(of, of_bh1780_match);
242−#endif
243−
244−static struct i2c_driver bh1780_driver = {
245− .probe = bh1780_probe,
246− .remove = bh1780_remove,
247− .id_table = bh1780_id,
248− .driver = {
249− .name = "bh1780",
250− .pm = &bh1780_pm,
251− .of_match_table = of_match_ptr(of_bh1780_match),
252− },
253−};
254−
255−module_i2c_driver(bh1780_driver);
256−
257−MODULE_DESCRIPTION("BH1780GLI Ambient Light Sensor Driver");
258−MODULE_LICENSE("GPL");
259−MODULE_AUTHOR("Hemanth V <hemanthv@ti.com>");
drivers/misc/cxl/vphb.c+9−1
@@ -230,6 +230,11 @@ int cxl_pci_vphb_add(struct cxl_afu *afu) · 229 unmodified lines
230230 if (phb->bus == NULL)
231231 return -ENXIO;
232232
233+ /* Set release hook on root bus */
234+ pci_set_host_bridge_release(to_pci_host_bridge(phb->bus->bridge),
235+ pcibios_free_controller_deferred,
236+ (void *) phb);
237+
233238 /* Claim resources. This might need some rework as well depending
234239 * whether we are doing probe-only or not, like assigning unassigned
235240 * resources etc...
@@ -256,7 +261,10 @@ void cxl_pci_vphb_remove(struct cxl_afu *afu) · 20 unmodified lines
256261 afu->phb = NULL;
257262
258263 pci_remove_root_bus(phb->bus);
259− pcibios_free_controller(phb);
264+ /*
265+ * We don't free phb here - that's handled by
266+ * pcibios_free_controller_deferred()
267+ */
260268 }
261269
262270 static bool _cxl_pci_is_vphb_device(struct pci_controller *phb)
drivers/misc/lkdtm_rodata.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 */
55 #include "lkdtm.h"
66
7−void lkdtm_rodata_do_nothing(void)
7+void notrace lkdtm_rodata_do_nothing(void)
88 {
99 /* Does nothing. We just want an architecture agnostic "return". */
1010 }
drivers/misc/lkdtm_usercopy.c+17−8
@@ -9,7 +9,15 @@ · 8 unmodified lines
99 #include <linux/uaccess.h>
1010 #include <asm/cacheflush.h>
1111
12−static size_t cache_size = 1024;
12+/*
13+ * Many of the tests here end up using const sizes, but those would
14+ * normally be ignored by hardened usercopy, so force the compiler
15+ * into choosing the non-const path to make sure we trigger the
16+ * hardened usercopy checks by added "unconst" to all the const copies,
17+ * and making sure "cache_size" isn't optimized into a const.
18+ */
19+static volatile size_t unconst = 0;
20+static volatile size_t cache_size = 1024;
1321 static struct kmem_cache *bad_cache;
1422
1523 static const unsigned char test_text[] = "This is a test.\n";
@@ -67,14 +75,14 @@ static noinline void do_usercopy_stack(bool to_user, bool bad_frame) · 51 unmodified lines
6775 if (to_user) {
6876 pr_info("attempting good copy_to_user of local stack\n");
6977 if (copy_to_user((void __user *)user_addr, good_stack,
70− sizeof(good_stack))) {
78+ unconst + sizeof(good_stack))) {
7179 pr_warn("copy_to_user failed unexpectedly?!\n");
7280 goto free_user;
7381 }
7482
7583 pr_info("attempting bad copy_to_user of distant stack\n");
7684 if (copy_to_user((void __user *)user_addr, bad_stack,
77− sizeof(good_stack))) {
85+ unconst + sizeof(good_stack))) {
7886 pr_warn("copy_to_user failed, but lacked Oops\n");
7987 goto free_user;
8088 }
@@ -88,14 +96,14 @@ static noinline void do_usercopy_stack(bool to_user, bool bad_frame) · 7 unmodified lines
8896
8997 pr_info("attempting good copy_from_user of local stack\n");
9098 if (copy_from_user(good_stack, (void __user *)user_addr,
91− sizeof(good_stack))) {
99+ unconst + sizeof(good_stack))) {
92100 pr_warn("copy_from_user failed unexpectedly?!\n");
93101 goto free_user;
94102 }
95103
96104 pr_info("attempting bad copy_from_user of distant stack\n");
97105 if (copy_from_user(bad_stack, (void __user *)user_addr,
98− sizeof(good_stack))) {
106+ unconst + sizeof(good_stack))) {
99107 pr_warn("copy_from_user failed, but lacked Oops\n");
100108 goto free_user;
101109 }
@@ -109,7 +117,7 @@ static void do_usercopy_heap_size(bool to_user) · 7 unmodified lines
109117 {
110118 unsigned long user_addr;
111119 unsigned char *one, *two;
112− const size_t size = 1024;
120+ size_t size = unconst + 1024;
113121
114122 one = kmalloc(size, GFP_KERNEL);
115123 two = kmalloc(size, GFP_KERNEL);
@@ -285,13 +293,14 @@ void lkdtm_USERCOPY_KERNEL(void) · 169 unmodified lines
285293
286294 pr_info("attempting good copy_to_user from kernel rodata\n");
287295 if (copy_to_user((void __user *)user_addr, test_text,
288− sizeof(test_text))) {
296+ unconst + sizeof(test_text))) {
289297 pr_warn("copy_to_user failed unexpectedly?!\n");
290298 goto free_user;
291299 }
292300
293301 pr_info("attempting bad copy_to_user from kernel text\n");
294− if (copy_to_user((void __user *)user_addr, vm_mmap, PAGE_SIZE)) {
302+ if (copy_to_user((void __user *)user_addr, vm_mmap,
303+ unconst + PAGE_SIZE)) {
295304 pr_warn("copy_to_user failed, but lacked Oops\n");
296305 goto free_user;
297306 }
drivers/misc/mei/hw-me.c+8−2
@@ -1263,8 +1263,14 @@ static bool mei_me_fw_type_nm(struct pci_dev *pdev) · 1262 unmodified lines
12631263 static bool mei_me_fw_type_sps(struct pci_dev *pdev)
12641264 {
12651265 u32 reg;
1266− /* Read ME FW Status check for SPS Firmware */
1267− pci_read_config_dword(pdev, PCI_CFG_HFS_1, &reg);
1266+ unsigned int devfn;
1267+
1268+ /*
1269+ * Read ME FW Status register to check for SPS Firmware
1270+ * The SPS FW is only signaled in pci function 0
1271+ */
1272+ devfn = PCI_DEVFN(PCI_SLOT(pdev->devfn), 0);
1273+ pci_bus_read_config_dword(pdev->bus, devfn, PCI_CFG_HFS_1, &reg);
12681274 trace_mei_pci_cfg_read(&pdev->dev, "PCI_CFG_HFS_1", PCI_CFG_HFS_1, reg);
12691275 /* if bits [19:16] = 15, running SPS Firmware */
12701276 return (reg & 0xf0000) == 0xf0000;
drivers/misc/mei/pci-me.c+2−2
@@ -85,8 +85,8 @@ static const struct pci_device_id mei_me_pci_tbl[] = { · 84 unmodified lines
8585
8686 {MEI_PCI_DEVICE(MEI_DEV_ID_SPT, mei_me_pch8_cfg)},
8787 {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_2, mei_me_pch8_cfg)},
88− {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H, mei_me_pch8_cfg)},
89− {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H_2, mei_me_pch8_cfg)},
88+ {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H, mei_me_pch8_sps_cfg)},
89+ {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H_2, mei_me_pch8_sps_cfg)},
9090
9191 {MEI_PCI_DEVICE(MEI_DEV_ID_BXT_M, mei_me_pch8_cfg)},
9292 {MEI_PCI_DEVICE(MEI_DEV_ID_APL_I, mei_me_pch8_cfg)},
drivers/mmc/card/block.c+3−2
@@ -1726,6 +1726,7 @@ static u8 mmc_blk_prep_packed_list(struct mmc_queue *mq, struct request *req) · 1725 unmodified lines
17261726 break;
17271727
17281728 if (req_op(next) == REQ_OP_DISCARD ||
1729+ req_op(next) == REQ_OP_SECURE_ERASE ||
17291730 req_op(next) == REQ_OP_FLUSH)
17301731 break;
17311732
@@ -2150,6 +2151,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) · 418 unmodified lines
21502151 struct mmc_card *card = md->queue.card;
21512152 struct mmc_host *host = card->host;
21522153 unsigned long flags;
2154+ bool req_is_special = mmc_req_is_special(req);
21532155
21542156 if (req && !mq->mqrq_prev->req)
21552157 /* claim host only for the first request */
@@ -2190,8 +2192,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) · 34 unmodified lines
21902192 }
21912193
21922194 out:
2193− if ((!req && !(mq->flags & MMC_QUEUE_NEW_REQUEST)) ||
2194− mmc_req_is_special(req))
2195+ if ((!req && !(mq->flags & MMC_QUEUE_NEW_REQUEST)) || req_is_special)
21952196 /*
21962197 * Release host when there are no more requests
21972198 * and after special request(discard, flush) is done.
drivers/mmc/card/queue.c+5−2
@@ -33,7 +33,8 @@ static int mmc_prep_request(struct request_queue *q, struct request *req) · 32 unmodified lines
3333 /*
3434 * We only like normal block requests and discards.
3535 */
36− if (req->cmd_type != REQ_TYPE_FS && req_op(req) != REQ_OP_DISCARD) {
36+ if (req->cmd_type != REQ_TYPE_FS && req_op(req) != REQ_OP_DISCARD &&
37+ req_op(req) != REQ_OP_SECURE_ERASE) {
3738 blk_dump_rq_flags(req, "MMC bad request");
3839 return BLKPREP_KILL;
3940 }
@@ -64,6 +65,8 @@ static int mmc_queue_thread(void *d) · 24 unmodified lines
6465 spin_unlock_irq(q->queue_lock);
6566
6667 if (req || mq->mqrq_prev->req) {
68+ bool req_is_special = mmc_req_is_special(req);
69+
6770 set_current_state(TASK_RUNNING);
6871 mq->issue_fn(mq, req);
6972 cond_resched();
@@ -79,7 +82,7 @@ static int mmc_queue_thread(void *d) · 9 unmodified lines
7982 * has been finished. Do not assign it to previous
8083 * request.
8184 */
82− if (mmc_req_is_special(req))
85+ if (req_is_special)
8386 mq->mqrq_cur->req = NULL;
8487
8588 mq->mqrq_prev->brq.mrq.data = NULL;
drivers/mmc/card/queue.h+3−1
@@ -4,7 +4,9 @@ · 3 unmodified lines
44 static inline bool mmc_req_is_special(struct request *req)
55 {
66 return req &&
7− (req_op(req) == REQ_OP_FLUSH || req_op(req) == REQ_OP_DISCARD);
7+ (req_op(req) == REQ_OP_FLUSH ||
8+ req_op(req) == REQ_OP_DISCARD ||
9+ req_op(req) == REQ_OP_SECURE_ERASE);
810 }
911
1012 struct request;
drivers/mmc/host/dw_mmc.c+9−5
@@ -1112,11 +1112,12 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot, bool force_clkinit) · 1111 unmodified lines
11121112
11131113 div = (host->bus_hz != clock) ? DIV_ROUND_UP(div, 2) : 0;
11141114
1115− dev_info(&slot->mmc->class_dev,
1116− "Bus speed (slot %d) = %dHz (slot req %dHz, actual %dHZ div = %d)\n",
1117− slot->id, host->bus_hz, clock,
1118− div ? ((host->bus_hz / div) >> 1) :
1119− host->bus_hz, div);
1115+ if (clock != slot->__clk_old || force_clkinit)
1116+ dev_info(&slot->mmc->class_dev,
1117+ "Bus speed (slot %d) = %dHz (slot req %dHz, actual %dHZ div = %d)\n",
1118+ slot->id, host->bus_hz, clock,
1119+ div ? ((host->bus_hz / div) >> 1) :
1120+ host->bus_hz, div);
11201121
11211122 /* disable clock */
11221123 mci_writel(host, CLKENA, 0);
@@ -1139,6 +1140,9 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot, bool force_clkinit) · 16 unmodified lines
11391140
11401141 /* inform CIU */
11411142 mci_send_cmd(slot, sdmmc_cmd_bits, 0);
1143+
1144+ /* keep the last clock value that was requested from core */
1145+ slot->__clk_old = clock;
11421146 }
11431147
11441148 host->current_speed = clock;
drivers/mmc/host/dw_mmc.h+3−0
@@ -249,6 +249,8 @@ extern int dw_mci_resume(struct dw_mci *host); · 248 unmodified lines
249249 * @queue_node: List node for placing this node in the @queue list of
250250 * &struct dw_mci.
251251 * @clock: Clock rate configured by set_ios(). Protected by host->lock.
252+ * @__clk_old: The last clock value that was requested from core.
253+ * Keeping track of this helps us to avoid spamming the console.
252254 * @flags: Random state bits associated with the slot.
253255 * @id: Number of this slot.
254256 * @sdio_id: Number of this slot in the SDIO interrupt registers.
@@ -263,6 +265,7 @@ struct dw_mci_slot { · 8 unmodified lines
263265 struct list_head queue_node;
264266
265267 unsigned int clock;
268+ unsigned int __clk_old;
266269
267270 unsigned long flags;
268271 #define DW_MMC_CARD_PRESENT 0
drivers/mmc/host/omap.c+10−8
@@ -1016,14 +1016,16 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req) · 1015 unmodified lines
10161016
10171017 /* Only reconfigure if we have a different burst size */
10181018 if (*bp != burst) {
1019− struct dma_slave_config cfg;
1020−
1021− cfg.src_addr = host->phys_base + OMAP_MMC_REG(host, DATA);
1022− cfg.dst_addr = host->phys_base + OMAP_MMC_REG(host, DATA);
1023− cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
1024− cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
1025− cfg.src_maxburst = burst;
1026− cfg.dst_maxburst = burst;
1019+ struct dma_slave_config cfg = {
1020+ .src_addr = host->phys_base +
1021+ OMAP_MMC_REG(host, DATA),
1022+ .dst_addr = host->phys_base +
1023+ OMAP_MMC_REG(host, DATA),
1024+ .src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
1025+ .dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
1026+ .src_maxburst = burst,
1027+ .dst_maxburst = burst,
1028+ };
10271029
10281030 if (dmaengine_slave_config(c, &cfg))
10291031 goto use_pio;
drivers/mmc/host/omap_hsmmc.c+8−8
@@ -1409,11 +1409,18 @@ static int omap_hsmmc_pre_dma_transfer(struct omap_hsmmc_host *host, · 1408 unmodified lines
14091409 static int omap_hsmmc_setup_dma_transfer(struct omap_hsmmc_host *host,
14101410 struct mmc_request *req)
14111411 {
1412− struct dma_slave_config cfg;
14131412 struct dma_async_tx_descriptor *tx;
14141413 int ret = 0, i;
14151414 struct mmc_data *data = req->data;
14161415 struct dma_chan *chan;
1416+ struct dma_slave_config cfg = {
1417+ .src_addr = host->mapbase + OMAP_HSMMC_DATA,
1418+ .dst_addr = host->mapbase + OMAP_HSMMC_DATA,
1419+ .src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
1420+ .dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
1421+ .src_maxburst = data->blksz / 4,
1422+ .dst_maxburst = data->blksz / 4,
1423+ };
14171424
14181425 /* Sanity check: all the SG entries must be aligned by block size. */
14191426 for (i = 0; i < data->sg_len; i++) {
@@ -1433,13 +1440,6 @@ static int omap_hsmmc_setup_dma_transfer(struct omap_hsmmc_host *host, · 13 unmodified lines
14331440
14341441 chan = omap_hsmmc_get_dma_chan(host, data);
14351442
1436− cfg.src_addr = host->mapbase + OMAP_HSMMC_DATA;
1437− cfg.dst_addr = host->mapbase + OMAP_HSMMC_DATA;
1438− cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
1439− cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
1440− cfg.src_maxburst = data->blksz / 4;
1441− cfg.dst_maxburst = data->blksz / 4;
1442−
14431443 ret = dmaengine_slave_config(chan, &cfg);
14441444 if (ret)
14451445 return ret;
drivers/mmc/host/sdhci-st.c+14−1
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828
2929 struct st_mmc_platform_data {
3030 struct reset_control *rstc;
31+ struct clk *icnclk;
3132 void __iomem *top_ioaddr;
3233 };
3334
@@ -353,7 +354,7 @@ static int sdhci_st_probe(struct platform_device *pdev) · 319 unmodified lines
353354 struct sdhci_host *host;
354355 struct st_mmc_platform_data *pdata;
355356 struct sdhci_pltfm_host *pltfm_host;
356− struct clk *clk;
357+ struct clk *clk, *icnclk;
357358 int ret = 0;
358359 u16 host_version;
359360 struct resource *res;
@@ -365,6 +366,11 @@ static int sdhci_st_probe(struct platform_device *pdev) · 5 unmodified lines
365366 return PTR_ERR(clk);
366367 }
367368
369+ /* ICN clock isn't compulsory, but use it if it's provided. */
370+ icnclk = devm_clk_get(&pdev->dev, "icn");
371+ if (IS_ERR(icnclk))
372+ icnclk = NULL;
373+
368374 rstc = devm_reset_control_get(&pdev->dev, NULL);
369375 if (IS_ERR(rstc))
370376 rstc = NULL;
@@ -389,6 +395,7 @@ static int sdhci_st_probe(struct platform_device *pdev) · 18 unmodified lines
389395 }
390396
391397 clk_prepare_enable(clk);
398+ clk_prepare_enable(icnclk);
392399
393400 /* Configure the FlashSS Top registers for setting eMMC TX/RX delay */
394401 res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
@@ -400,6 +407,7 @@ static int sdhci_st_probe(struct platform_device *pdev) · 5 unmodified lines
400407 }
401408
402409 pltfm_host->clk = clk;
410+ pdata->icnclk = icnclk;
403411
404412 /* Configure the Arasan HC inside the flashSS */
405413 st_mmcss_cconfig(np, host);
@@ -422,6 +430,7 @@ static int sdhci_st_probe(struct platform_device *pdev) · 16 unmodified lines
422430 return 0;
423431
424432 err_out:
433+ clk_disable_unprepare(icnclk);
425434 clk_disable_unprepare(clk);
426435 err_of:
427436 sdhci_pltfm_free(pdev);
@@ -442,6 +451,8 @@ static int sdhci_st_remove(struct platform_device *pdev) · 14 unmodified lines
442451
443452 ret = sdhci_pltfm_unregister(pdev);
444453
454+ clk_disable_unprepare(pdata->icnclk);
455+
445456 if (rstc)
446457 reset_control_assert(rstc);
447458
@@ -462,6 +473,7 @@ static int sdhci_st_suspend(struct device *dev) · 14 unmodified lines
462473 if (pdata->rstc)
463474 reset_control_assert(pdata->rstc);
464475
476+ clk_disable_unprepare(pdata->icnclk);
465477 clk_disable_unprepare(pltfm_host->clk);
466478 out:
467479 return ret;
@@ -475,6 +487,7 @@ static int sdhci_st_resume(struct device *dev) · 7 unmodified lines
475487 struct device_node *np = dev->of_node;
476488
477489 clk_prepare_enable(pltfm_host->clk);
490+ clk_prepare_enable(pdata->icnclk);
478491
479492 if (pdata->rstc)
480493 reset_control_deassert(pdata->rstc);
drivers/mtd/nand/mtk_ecc.c+8−4
@@ -366,7 +366,8 @@ int mtk_ecc_encode(struct mtk_ecc *ecc, struct mtk_ecc_config *config, · 365 unmodified lines
366366 u8 *data, u32 bytes)
367367 {
368368 dma_addr_t addr;
369− u32 *p, len, i;
369+ u8 *p;
370+ u32 len, i, val;
370371 int ret = 0;
371372
372373 addr = dma_map_single(ecc->dev, data, bytes, DMA_TO_DEVICE);
@@ -392,11 +393,14 @@ int mtk_ecc_encode(struct mtk_ecc *ecc, struct mtk_ecc_config *config, · 19 unmodified lines
392393
393394 /* Program ECC bytes to OOB: per sector oob = FDM + ECC + SPARE */
394395 len = (config->strength * ECC_PARITY_BITS + 7) >> 3;
395− p = (u32 *)(data + bytes);
396+ p = data + bytes;
396397
397398 /* write the parity bytes generated by the ECC back to the OOB region */
398− for (i = 0; i < len; i++)
399− p[i] = readl(ecc->regs + ECC_ENCPAR(i));
399+ for (i = 0; i < len; i++) {
400+ if ((i % 4) == 0)
401+ val = readl(ecc->regs + ECC_ENCPAR(i / 4));
402+ p[i] = (val >> ((i % 4) * 8)) & 0xff;
403+ }
400404 timeout:
401405
402406 dma_unmap_single(ecc->dev, addr, bytes, DMA_TO_DEVICE);
drivers/mtd/nand/mtk_nand.c+5−2
@@ -93,6 +93,9 @@ · 92 unmodified lines
9393 #define NFI_FSM_MASK (0xf << 16)
9494 #define NFI_ADDRCNTR (0x70)
9595 #define CNTR_MASK GENMASK(16, 12)
96+#define ADDRCNTR_SEC_SHIFT (12)
97+#define ADDRCNTR_SEC(val) \
98+ (((val) & CNTR_MASK) >> ADDRCNTR_SEC_SHIFT)
9699 #define NFI_STRADDR (0x80)
97100 #define NFI_BYTELEN (0x84)
98101 #define NFI_CSEL (0x90)
@@ -699,7 +702,7 @@ static int mtk_nfc_do_write_page(struct mtd_info *mtd, struct nand_chip *chip, · 600 unmodified lines
699702 }
700703
701704 ret = readl_poll_timeout_atomic(nfc->regs + NFI_ADDRCNTR, reg,
702− (reg & CNTR_MASK) >= chip->ecc.steps,
705+ ADDRCNTR_SEC(reg) >= chip->ecc.steps,
703706 10, MTK_TIMEOUT);
704707 if (ret)
705708 dev_err(dev, "hwecc write timeout\n");
@@ -902,7 +905,7 @@ static int mtk_nfc_read_subpage(struct mtd_info *mtd, struct nand_chip *chip, · 196 unmodified lines
902905 dev_warn(nfc->dev, "read ahb/dma done timeout\n");
903906
904907 rc = readl_poll_timeout_atomic(nfc->regs + NFI_BYTELEN, reg,
905− (reg & CNTR_MASK) >= sectors, 10,
908+ ADDRCNTR_SEC(reg) >= sectors, 10,
906909 MTK_TIMEOUT);
907910 if (rc < 0) {
908911 dev_err(nfc->dev, "subpage done timeout\n");
drivers/mtd/nand/mxc_nand.c+1−1
@@ -943,7 +943,7 @@ static int mxc_v2_ooblayout_free(struct mtd_info *mtd, int section, · 942 unmodified lines
943943 struct nand_chip *nand_chip = mtd_to_nand(mtd);
944944 int stepsize = nand_chip->ecc.bytes == 9 ? 16 : 26;
945945
946− if (section > nand_chip->ecc.steps)
946+ if (section >= nand_chip->ecc.steps)
947947 return -ERANGE;
948948
949949 if (!section) {
drivers/net/bonding/bond_main.c+5−4
@@ -152,7 +152,7 @@ module_param(lacp_rate, charp, 0); · 151 unmodified lines
152152 MODULE_PARM_DESC(lacp_rate, "LACPDU tx rate to request from 802.3ad partner; "
153153 "0 for slow, 1 for fast");
154154 module_param(ad_select, charp, 0);
155−MODULE_PARM_DESC(ad_select, "803.ad aggregation selection logic; "
155+MODULE_PARM_DESC(ad_select, "802.3ad aggregation selection logic; "
156156 "0 for stable (default), 1 for bandwidth, "
157157 "2 for count");
158158 module_param(min_links, int, 0);
@@ -1341,9 +1341,10 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) · 1182 unmodified lines
13411341 slave_dev->name);
13421342 }
13431343
1344− /* already enslaved */
1345− if (slave_dev->flags & IFF_SLAVE) {
1346− netdev_dbg(bond_dev, "Error: Device was already enslaved\n");
1344+ /* already in-use? */
1345+ if (netdev_is_rx_handler_busy(slave_dev)) {
1346+ netdev_err(bond_dev,
1347+ "Error: Device is in use and cannot be enslaved\n");
13471348 return -EBUSY;
13481349 }
13491350
drivers/net/can/flexcan.c+8−5
@@ -1268,11 +1268,10 @@ static int __maybe_unused flexcan_suspend(struct device *device) · 1267 unmodified lines
12681268 struct flexcan_priv *priv = netdev_priv(dev);
12691269 int err;
12701270
1271− err = flexcan_chip_disable(priv);
1272− if (err)
1273− return err;
1274−
12751271 if (netif_running(dev)) {
1272+ err = flexcan_chip_disable(priv);
1273+ if (err)
1274+ return err;
12761275 netif_stop_queue(dev);
12771276 netif_device_detach(dev);
12781277 }
@@ -1285,13 +1284,17 @@ static int __maybe_unused flexcan_resume(struct device *device) · 6 unmodified lines
12851284 {
12861285 struct net_device *dev = dev_get_drvdata(device);
12871286 struct flexcan_priv *priv = netdev_priv(dev);
1287+ int err;
12881288
12891289 priv->can.state = CAN_STATE_ERROR_ACTIVE;
12901290 if (netif_running(dev)) {
12911291 netif_device_attach(dev);
12921292 netif_start_queue(dev);
1293+ err = flexcan_chip_enable(priv);
1294+ if (err)
1295+ return err;
12931296 }
1294− return flexcan_chip_enable(priv);
1297+ return 0;
12951298 }
12961299
12971300 static SIMPLE_DEV_PM_OPS(flexcan_pm_ops, flexcan_suspend, flexcan_resume);
drivers/net/can/ifi_canfd/ifi_canfd.c+10−1
@@ -81,6 +81,10 @@ · 80 unmodified lines
8181 #define IFI_CANFD_TIME_SET_TIMEA_4_12_6_6 BIT(15)
8282
8383 #define IFI_CANFD_TDELAY 0x1c
84+#define IFI_CANFD_TDELAY_DEFAULT 0xb
85+#define IFI_CANFD_TDELAY_MASK 0x3fff
86+#define IFI_CANFD_TDELAY_ABS BIT(14)
87+#define IFI_CANFD_TDELAY_EN BIT(15)
8488
8589 #define IFI_CANFD_ERROR 0x20
8690 #define IFI_CANFD_ERROR_TX_OFFSET 0
@@ -641,7 +645,7 @@ static void ifi_canfd_set_bittiming(struct net_device *ndev) · 554 unmodified lines
641645 struct ifi_canfd_priv *priv = netdev_priv(ndev);
642646 const struct can_bittiming *bt = &priv->can.bittiming;
643647 const struct can_bittiming *dbt = &priv->can.data_bittiming;
644− u16 brp, sjw, tseg1, tseg2;
648+ u16 brp, sjw, tseg1, tseg2, tdc;
645649
646650 /* Configure bit timing */
647651 brp = bt->brp - 2;
@@ -664,6 +668,11 @@ static void ifi_canfd_set_bittiming(struct net_device *ndev) · 16 unmodified lines
664668 (brp << IFI_CANFD_TIME_PRESCALE_OFF) |
665669 (sjw << IFI_CANFD_TIME_SJW_OFF_7_9_8_8),
666670 priv->base + IFI_CANFD_FTIME);
671+
672+ /* Configure transmitter delay */
673+ tdc = (dbt->brp * (dbt->phase_seg1 + 1)) & IFI_CANFD_TDELAY_MASK;
674+ writel(IFI_CANFD_TDELAY_EN | IFI_CANFD_TDELAY_ABS | tdc,
675+ priv->base + IFI_CANFD_TDELAY);
667676 }
668677
669678 static void ifi_canfd_set_filter(struct net_device *ndev, const u32 id,
drivers/net/dsa/b53/b53_regs.h+1−1
@@ -258,7 +258,7 @@ · 257 unmodified lines
258258 * BCM5325 and BCM5365 share most definitions below
259259 */
260260 #define B53_ARLTBL_MAC_VID_ENTRY(n) (0x10 * (n))
261−#define ARLTBL_MAC_MASK 0xffffffffffff
261+#define ARLTBL_MAC_MASK 0xffffffffffffULL
262262 #define ARLTBL_VID_S 48
263263 #define ARLTBL_VID_MASK_25 0xff
264264 #define ARLTBL_VID_MASK 0xfff
drivers/net/dsa/bcm_sf2.h+1−1
@@ -205,8 +205,8 @@ static inline void name##_writeq(struct bcm_sf2_priv *priv, u64 val, \ · 204 unmodified lines
205205 static inline void intrl2_##which##_mask_clear(struct bcm_sf2_priv *priv, \
206206 u32 mask) \
207207 { \
208− intrl2_##which##_writel(priv, mask, INTRL2_CPU_MASK_CLEAR); \
209208 priv->irq##which##_mask &= ~(mask); \
209+ intrl2_##which##_writel(priv, mask, INTRL2_CPU_MASK_CLEAR); \
210210 } \
211211 static inline void intrl2_##which##_mask_set(struct bcm_sf2_priv *priv, \
212212 u32 mask) \
drivers/net/dsa/mv88e6xxx/chip.c+8−2
@@ -2656,15 +2656,19 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port) · 2655 unmodified lines
26562656 return ret;
26572657 }
26582658
2659+ /* Rate Control: disable ingress rate limiting. */
26592660 if (mv88e6xxx_6352_family(chip) || mv88e6xxx_6351_family(chip) ||
26602661 mv88e6xxx_6165_family(chip) || mv88e6xxx_6097_family(chip) ||
2661− mv88e6xxx_6185_family(chip) || mv88e6xxx_6095_family(chip) ||
26622662 mv88e6xxx_6320_family(chip)) {
2663− /* Rate Control: disable ingress rate limiting. */
26642663 ret = _mv88e6xxx_reg_write(chip, REG_PORT(port),
26652664 PORT_RATE_CONTROL, 0x0001);
26662665 if (ret)
26672666 return ret;
2667+ } else if (mv88e6xxx_6185_family(chip) || mv88e6xxx_6095_family(chip)) {
2668+ ret = _mv88e6xxx_reg_write(chip, REG_PORT(port),
2669+ PORT_RATE_CONTROL, 0x0000);
2670+ if (ret)
2671+ return ret;
26682672 }
26692673
26702674 /* Port Control 1: disable trunking, disable sending
@@ -3187,6 +3191,7 @@ static int mv88e6xxx_set_addr(struct dsa_switch *ds, u8 *addr) · 516 unmodified lines
31873191 return err;
31883192 }
31893193
3194+#ifdef CONFIG_NET_DSA_HWMON
31903195 static int mv88e6xxx_mdio_page_read(struct dsa_switch *ds, int port, int page,
31913196 int reg)
31923197 {
@@ -3212,6 +3217,7 @@ static int mv88e6xxx_mdio_page_write(struct dsa_switch *ds, int port, int page, · 19 unmodified lines
32123217
32133218 return ret;
32143219 }
3220+#endif
32153221
32163222 static int mv88e6xxx_port_to_mdio_addr(struct mv88e6xxx_chip *chip, int port)
32173223 {
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c+2−0
@@ -793,6 +793,8 @@ int xgene_enet_phy_connect(struct net_device *ndev) · 792 unmodified lines
793793 netdev_err(ndev, "Could not connect to PHY\n");
794794 return -ENODEV;
795795 }
796+#else
797+ return -ENODEV;
796798 #endif
797799 }
798800
drivers/net/ethernet/arc/emac_main.c+4−2
@@ -771,8 +771,10 @@ int arc_emac_probe(struct net_device *ndev, int interface) · 770 unmodified lines
771771 priv->dev = dev;
772772
773773 priv->regs = devm_ioremap_resource(dev, &res_regs);
774− if (IS_ERR(priv->regs))
775− return PTR_ERR(priv->regs);
774+ if (IS_ERR(priv->regs)) {
775+ err = PTR_ERR(priv->regs);
776+ goto out_put_node;
777+ }
776778
777779 dev_dbg(dev, "Registers base address is 0x%p\n", priv->regs);
778780
drivers/net/ethernet/atheros/alx/main.c+2−0
@@ -1545,6 +1545,8 @@ static const struct pci_device_id alx_pci_tbl[] = { · 1544 unmodified lines
15451545 .driver_data = ALX_DEV_QUIRK_MSI_INTX_DISABLE_BUG },
15461546 { PCI_VDEVICE(ATTANSIC, ALX_DEV_ID_E2400),
15471547 .driver_data = ALX_DEV_QUIRK_MSI_INTX_DISABLE_BUG },
1548+ { PCI_VDEVICE(ATTANSIC, ALX_DEV_ID_E2500),
1549+ .driver_data = ALX_DEV_QUIRK_MSI_INTX_DISABLE_BUG },
15481550 { PCI_VDEVICE(ATTANSIC, ALX_DEV_ID_AR8162),
15491551 .driver_data = ALX_DEV_QUIRK_MSI_INTX_DISABLE_BUG },
15501552 { PCI_VDEVICE(ATTANSIC, ALX_DEV_ID_AR8171) },
drivers/net/ethernet/atheros/alx/reg.h+1−0
@@ -38,6 +38,7 @@ · 37 unmodified lines
3838 #define ALX_DEV_ID_AR8161 0x1091
3939 #define ALX_DEV_ID_E2200 0xe091
4040 #define ALX_DEV_ID_E2400 0xe0a1
41+#define ALX_DEV_ID_E2500 0xe0b1
4142 #define ALX_DEV_ID_AR8162 0x1090
4243 #define ALX_DEV_ID_AR8171 0x10A1
4344 #define ALX_DEV_ID_AR8172 0x10A0
drivers/net/ethernet/broadcom/bgmac-bcma.c+1−1
@@ -159,7 +159,7 @@ static int bgmac_probe(struct bcma_device *core) · 158 unmodified lines
159159
160160 if (!bgmac_is_bcm4707_family(core)) {
161161 mii_bus = bcma_mdio_mii_register(core, bgmac->phyaddr);
162− if (!IS_ERR(mii_bus)) {
162+ if (IS_ERR(mii_bus)) {
163163 err = PTR_ERR(mii_bus);
164164 goto err;
165165 }
drivers/net/ethernet/broadcom/bnx2.c+7−5
@@ -6356,10 +6356,6 @@ bnx2_open(struct net_device *dev) · 6355 unmodified lines
63566356 struct bnx2 *bp = netdev_priv(dev);
63576357 int rc;
63586358
6359− rc = bnx2_request_firmware(bp);
6360− if (rc < 0)
6361− goto out;
6362−
63636359 netif_carrier_off(dev);
63646360
63656361 bnx2_disable_int(bp);
@@ -6428,7 +6424,6 @@ open_err: · 62 unmodified lines
64286424 bnx2_free_irq(bp);
64296425 bnx2_free_mem(bp);
64306426 bnx2_del_napi(bp);
6431− bnx2_release_firmware(bp);
64326427 goto out;
64336428 }
64346429
@@ -8575,6 +8570,12 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 2140 unmodified lines
85758570
85768571 pci_set_drvdata(pdev, dev);
85778572
8573+ rc = bnx2_request_firmware(bp);
8574+ if (rc < 0)
8575+ goto error;
8576+
8577+
8578+ bnx2_reset_chip(bp, BNX2_DRV_MSG_CODE_RESET);
85788579 memcpy(dev->dev_addr, bp->mac_addr, ETH_ALEN);
85798580
85808581 dev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG |
@@ -8607,6 +8608,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 26 unmodified lines
86078608 return 0;
86088609
86098610 error:
8611+ bnx2_release_firmware(bp);
86108612 pci_iounmap(pdev, bp->regview);
86118613 pci_release_regions(pdev);
86128614 pci_disable_device(pdev);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+15−4
@@ -772,6 +772,11 @@ void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl) · 771 unmodified lines
772772 (bp->common.bc_ver & 0xff00) >> 8,
773773 (bp->common.bc_ver & 0xff));
774774
775+ if (pci_channel_offline(bp->pdev)) {
776+ BNX2X_ERR("Cannot dump MCP info while in PCI error\n");
777+ return;
778+ }
779+
775780 val = REG_RD(bp, MCP_REG_MCPR_CPU_PROGRAM_COUNTER);
776781 if (val == REG_RD(bp, MCP_REG_MCPR_CPU_PROGRAM_COUNTER))
777782 BNX2X_ERR("%s" "MCP PC at 0x%x\n", lvl, val);
@@ -9415,10 +9420,16 @@ unload_error: · 8637 unmodified lines
94159420 /* Release IRQs */
94169421 bnx2x_free_irq(bp);
94179422
9418− /* Reset the chip */
9419− rc = bnx2x_reset_hw(bp, reset_code);
9420− if (rc)
9421− BNX2X_ERR("HW_RESET failed\n");
9423+ /* Reset the chip, unless PCI function is offline. If we reach this
9424+ * point following a PCI error handling, it means device is really
9425+ * in a bad state and we're about to remove it, so reset the chip
9426+ * is not a good idea.
9427+ */
9428+ if (!pci_channel_offline(bp->pdev)) {
9429+ rc = bnx2x_reset_hw(bp, reset_code);
9430+ if (rc)
9431+ BNX2X_ERR("HW_RESET failed\n");
9432+ }
94229433
94239434 /* Report UNLOAD_DONE to MCP */
94249435 bnx2x_send_unload_done(bp, keep_link);
drivers/net/ethernet/broadcom/bnxt/bnxt.c+2−2
@@ -353,8 +353,8 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev) · 352 unmodified lines
353353 push_len = (length + sizeof(*tx_push) + 7) / 8;
354354 if (push_len > 16) {
355355 __iowrite64_copy(txr->tx_doorbell, tx_push_buf, 16);
356− __iowrite64_copy(txr->tx_doorbell + 4, tx_push_buf + 1,
357− push_len - 16);
356+ __iowrite32_copy(txr->tx_doorbell + 4, tx_push_buf + 1,
357+ (push_len - 16) << 1);
358358 } else {
359359 __iowrite64_copy(txr->tx_doorbell, tx_push_buf,
360360 push_len);
drivers/net/ethernet/broadcom/tg3.c+2−14
@@ -12552,10 +12552,6 @@ static int tg3_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, · 12551 unmodified lines
1255212552 info->data = TG3_RSS_MAX_NUM_QS;
1255312553 }
1255412554
12555− /* The first interrupt vector only
12556− * handles link interrupts.
12557− */
12558− info->data -= 1;
1255912555 return 0;
1256012556
1256112557 default:
@@ -14014,7 +14010,9 @@ static int tg3_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec) · 1452 unmodified lines
1401414010 }
1401514011
1401614012 if ((ec->rx_coalesce_usecs > MAX_RXCOL_TICKS) ||
14013+ (!ec->rx_coalesce_usecs) ||
1401714014 (ec->tx_coalesce_usecs > MAX_TXCOL_TICKS) ||
14015+ (!ec->tx_coalesce_usecs) ||
1401814016 (ec->rx_max_coalesced_frames > MAX_RXMAX_FRAMES) ||
1401914017 (ec->tx_max_coalesced_frames > MAX_TXMAX_FRAMES) ||
1402014018 (ec->rx_coalesce_usecs_irq > max_rxcoal_tick_int) ||
@@ -14025,16 +14023,6 @@ static int tg3_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec) · 4 unmodified lines
1402514023 (ec->stats_block_coalesce_usecs < min_stat_coal_ticks))
1402614024 return -EINVAL;
1402714025
14028− /* No rx interrupts will be generated if both are zero */
14029− if ((ec->rx_coalesce_usecs == 0) &&
14030− (ec->rx_max_coalesced_frames == 0))
14031− return -EINVAL;
14032−
14033− /* No tx interrupts will be generated if both are zero */
14034− if ((ec->tx_coalesce_usecs == 0) &&
14035− (ec->tx_max_coalesced_frames == 0))
14036− return -EINVAL;
14037−
1403814026 /* Only copy relevant parameters, ignore all others. */
1403914027 tp->coal.rx_coalesce_usecs = ec->rx_coalesce_usecs;
1404014028 tp->coal.tx_coalesce_usecs = ec->tx_coalesce_usecs;
drivers/net/ethernet/brocade/bna/bnad_ethtool.c+29−28
@@ -31,15 +31,10 @@ · 30 unmodified lines
3131 #define BNAD_NUM_TXF_COUNTERS 12
3232 #define BNAD_NUM_RXF_COUNTERS 10
3333 #define BNAD_NUM_CQ_COUNTERS (3 + 5)
34−#define BNAD_NUM_RXQ_COUNTERS 6
34+#define BNAD_NUM_RXQ_COUNTERS 7
3535 #define BNAD_NUM_TXQ_COUNTERS 5
3636
37−#define BNAD_ETHTOOL_STATS_NUM \
38− (sizeof(struct rtnl_link_stats64) / sizeof(u64) + \
39− sizeof(struct bnad_drv_stats) / sizeof(u64) + \
40− offsetof(struct bfi_enet_stats, rxf_stats[0]) / sizeof(u64))
41−
42−static const char *bnad_net_stats_strings[BNAD_ETHTOOL_STATS_NUM] = {
37+static const char *bnad_net_stats_strings[] = {
4338 "rx_packets",
4439 "tx_packets",
4540 "rx_bytes",
@@ -50,22 +45,10 @@ static const char *bnad_net_stats_strings[BNAD_ETHTOOL_STATS_NUM] = { · 4 unmodified lines
5045 "tx_dropped",
5146 "multicast",
5247 "collisions",
53−
5448 "rx_length_errors",
55− "rx_over_errors",
5649 "rx_crc_errors",
5750 "rx_frame_errors",
58− "rx_fifo_errors",
59− "rx_missed_errors",
60−
61− "tx_aborted_errors",
62− "tx_carrier_errors",
6351 "tx_fifo_errors",
64− "tx_heartbeat_errors",
65− "tx_window_errors",
66−
67− "rx_compressed",
68− "tx_compressed",
6952
7053 "netif_queue_stop",
7154 "netif_queue_wakeup",
@@ -254,6 +237,8 @@ static const char *bnad_net_stats_strings[BNAD_ETHTOOL_STATS_NUM] = { · 182 unmodified lines
254237 "fc_tx_fid_parity_errors",
255238 };
256239
240+#define BNAD_ETHTOOL_STATS_NUM ARRAY_SIZE(bnad_net_stats_strings)
241+
257242 static int
258243 bnad_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
259244 {
@@ -658,6 +643,8 @@ bnad_get_strings(struct net_device *netdev, u32 stringset, u8 *string) · 398 unmodified lines
658643 string += ETH_GSTRING_LEN;
659644 sprintf(string, "rxq%d_allocbuf_failed", q_num);
660645 string += ETH_GSTRING_LEN;
646+ sprintf(string, "rxq%d_mapbuf_failed", q_num);
647+ string += ETH_GSTRING_LEN;
661648 sprintf(string, "rxq%d_producer_index", q_num);
662649 string += ETH_GSTRING_LEN;
663650 sprintf(string, "rxq%d_consumer_index", q_num);
@@ -678,6 +665,9 @@ bnad_get_strings(struct net_device *netdev, u32 stringset, u8 *string) · 14 unmodified lines
678665 sprintf(string, "rxq%d_allocbuf_failed",
679666 q_num);
680667 string += ETH_GSTRING_LEN;
668+ sprintf(string, "rxq%d_mapbuf_failed",
669+ q_num);
670+ string += ETH_GSTRING_LEN;
681671 sprintf(string, "rxq%d_producer_index",
682672 q_num);
683673 string += ETH_GSTRING_LEN;
@@ -854,9 +844,9 @@ bnad_get_ethtool_stats(struct net_device *netdev, struct ethtool_stats *stats, · 170 unmodified lines
854844 u64 *buf)
855845 {
856846 struct bnad *bnad = netdev_priv(netdev);
857− int i, j, bi;
847+ int i, j, bi = 0;
858848 unsigned long flags;
859− struct rtnl_link_stats64 *net_stats64;
849+ struct rtnl_link_stats64 net_stats64;
860850 u64 *stats64;
861851 u32 bmap;
862852
@@ -871,14 +861,25 @@ bnad_get_ethtool_stats(struct net_device *netdev, struct ethtool_stats *stats, · 8 unmodified lines
871861 * under the same lock
872862 */
873863 spin_lock_irqsave(&bnad->bna_lock, flags);
874− bi = 0;
875− memset(buf, 0, stats->n_stats * sizeof(u64));
876−
877− net_stats64 = (struct rtnl_link_stats64 *)buf;
878− bnad_netdev_qstats_fill(bnad, net_stats64);
879− bnad_netdev_hwstats_fill(bnad, net_stats64);
880864
881− bi = sizeof(*net_stats64) / sizeof(u64);
865+ memset(&net_stats64, 0, sizeof(net_stats64));
866+ bnad_netdev_qstats_fill(bnad, &net_stats64);
867+ bnad_netdev_hwstats_fill(bnad, &net_stats64);
868+
869+ buf[bi++] = net_stats64.rx_packets;
870+ buf[bi++] = net_stats64.tx_packets;
871+ buf[bi++] = net_stats64.rx_bytes;
872+ buf[bi++] = net_stats64.tx_bytes;
873+ buf[bi++] = net_stats64.rx_errors;
874+ buf[bi++] = net_stats64.tx_errors;
875+ buf[bi++] = net_stats64.rx_dropped;
876+ buf[bi++] = net_stats64.tx_dropped;
877+ buf[bi++] = net_stats64.multicast;
878+ buf[bi++] = net_stats64.collisions;
879+ buf[bi++] = net_stats64.rx_length_errors;
880+ buf[bi++] = net_stats64.rx_crc_errors;
881+ buf[bi++] = net_stats64.rx_frame_errors;
882+ buf[bi++] = net_stats64.tx_fifo_errors;
882883
883884 /* Get netif_queue_stopped from stack */
884885 bnad->stats.drv_stats.netif_queue_stopped = netif_queue_stopped(netdev);
drivers/net/ethernet/cadence/macb.c+23−0
@@ -1323,6 +1323,24 @@ dma_error: · 1322 unmodified lines
13231323 return 0;
13241324 }
13251325
1326+static inline int macb_clear_csum(struct sk_buff *skb)
1327+{
1328+ /* no change for packets without checksum offloading */
1329+ if (skb->ip_summed != CHECKSUM_PARTIAL)
1330+ return 0;
1331+
1332+ /* make sure we can modify the header */
1333+ if (unlikely(skb_cow_head(skb, 0)))
1334+ return -1;
1335+
1336+ /* initialize checksum field
1337+ * This is required - at least for Zynq, which otherwise calculates
1338+ * wrong UDP header checksums for UDP packets with UDP data len <=2
1339+ */
1340+ *(__sum16 *)(skb_checksum_start(skb) + skb->csum_offset) = 0;
1341+ return 0;
1342+}
1343+
13261344 static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
13271345 {
13281346 u16 queue_index = skb_get_queue_mapping(skb);
@@ -1362,6 +1380,11 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev) · 33 unmodified lines
13621380 return NETDEV_TX_BUSY;
13631381 }
13641382
1383+ if (macb_clear_csum(skb)) {
1384+ dev_kfree_skb_any(skb);
1385+ return NETDEV_TX_OK;
1386+ }
1387+
13651388 /* Map socket buffer for DMA transfer */
13661389 if (!macb_tx_map(bp, queue, skb)) {
13671390 dev_kfree_skb_any(skb);
drivers/net/ethernet/cadence/macb.h+1−1
@@ -403,11 +403,11 @@ · 402 unmodified lines
403403 #define MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII 0x00000004
404404 #define MACB_CAPS_NO_GIGABIT_HALF 0x00000008
405405 #define MACB_CAPS_USRIO_DISABLED 0x00000010
406+#define MACB_CAPS_JUMBO 0x00000020
406407 #define MACB_CAPS_FIFO_MODE 0x10000000
407408 #define MACB_CAPS_GIGABIT_MODE_AVAILABLE 0x20000000
408409 #define MACB_CAPS_SG_DISABLED 0x40000000
409410 #define MACB_CAPS_MACB_IS_GEM 0x80000000
410−#define MACB_CAPS_JUMBO 0x00000010
411411
412412 /* Bit manipulation macros */
413413 #define MACB_BIT(name) \
drivers/net/ethernet/cavium/thunder/nic.h+1−0
@@ -279,6 +279,7 @@ struct nicvf { · 278 unmodified lines
279279 u8 sqs_id;
280280 bool sqs_mode;
281281 bool hw_tso;
282+ bool t88;
282283
283284 /* Receive buffer alloc */
284285 u32 rb_page_offset;
drivers/net/ethernet/cavium/thunder/nic_main.c+8−3
@@ -251,9 +251,14 @@ static void nic_set_tx_pkt_pad(struct nicpf *nic, int size) · 250 unmodified lines
251251 int lmac;
252252 u64 lmac_cfg;
253253
254− /* Max value that can be set is 60 */
255− if (size > 60)
256− size = 60;
254+ /* There is a issue in HW where-in while sending GSO sized
255+ * pkts as part of TSO, if pkt len falls below this size
256+ * NIC will zero PAD packet and also updates IP total length.
257+ * Hence set this value to lessthan min pkt size of MAC+IP+TCP
258+ * headers, BGX will do the padding to transmit 64 byte pkt.
259+ */
260+ if (size > 52)
261+ size = 52;
257262
258263 for (lmac = 0; lmac < (MAX_BGX_PER_CN88XX * MAX_LMAC_PER_BGX); lmac++) {
259264 lmac_cfg = nic_reg_read(nic, NIC_PF_LMAC_0_7_CFG | (lmac << 3));
drivers/net/ethernet/cavium/thunder/nic_reg.h+0−1
@@ -170,7 +170,6 @@ · 169 unmodified lines
170170 #define NIC_QSET_SQ_0_7_DOOR (0x010838)
171171 #define NIC_QSET_SQ_0_7_STATUS (0x010840)
172172 #define NIC_QSET_SQ_0_7_DEBUG (0x010848)
173−#define NIC_QSET_SQ_0_7_CNM_CHG (0x010860)
174173 #define NIC_QSET_SQ_0_7_STAT_0_1 (0x010900)
175174
176175 #define NIC_QSET_RBDR_0_1_CFG (0x010C00)
drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c+4−1
@@ -382,7 +382,10 @@ static void nicvf_get_regs(struct net_device *dev, · 381 unmodified lines
382382 p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_DOOR, q);
383383 p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_STATUS, q);
384384 p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_DEBUG, q);
385− p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_CNM_CHG, q);
385+ /* Padding, was NIC_QSET_SQ_0_7_CNM_CHG, which
386+ * produces bus errors when read
387+ */
388+ p[i++] = 0;
386389 p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_STAT_0_1, q);
387390 reg_offset = NIC_QSET_SQ_0_7_STAT_0_1 | (1 << 3);
388391 p[i++] = nicvf_queue_reg_read(nic, reg_offset, q);
drivers/net/ethernet/cavium/thunder/nicvf_main.c+15−5
@@ -513,6 +513,7 @@ static void nicvf_snd_pkt_handler(struct net_device *netdev, · 512 unmodified lines
513513 struct nicvf *nic = netdev_priv(netdev);
514514 struct snd_queue *sq;
515515 struct sq_hdr_subdesc *hdr;
516+ struct sq_hdr_subdesc *tso_sqe;
516517
517518 sq = &nic->qs->sq[cqe_tx->sq_idx];
518519
@@ -527,17 +528,21 @@ static void nicvf_snd_pkt_handler(struct net_device *netdev, · 8 unmodified lines
527528
528529 nicvf_check_cqe_tx_errs(nic, cq, cqe_tx);
529530 skb = (struct sk_buff *)sq->skbuff[cqe_tx->sqe_ptr];
530− /* For TSO offloaded packets only one SQE will have a valid SKB */
531531 if (skb) {
532+ /* Check for dummy descriptor used for HW TSO offload on 88xx */
533+ if (hdr->dont_send) {
534+ /* Get actual TSO descriptors and free them */
535+ tso_sqe =
536+ (struct sq_hdr_subdesc *)GET_SQ_DESC(sq, hdr->rsvd2);
537+ nicvf_put_sq_desc(sq, tso_sqe->subdesc_cnt + 1);
538+ }
532539 nicvf_put_sq_desc(sq, hdr->subdesc_cnt + 1);
533540 prefetch(skb);
534541 dev_consume_skb_any(skb);
535542 sq->skbuff[cqe_tx->sqe_ptr] = (u64)NULL;
536543 } else {
537− /* In case of HW TSO, HW sends a CQE for each segment of a TSO
538− * packet instead of a single CQE for the whole TSO packet
539− * transmitted. Each of this CQE points to the same SQE, so
540− * avoid freeing same SQE multiple times.
544+ /* In case of SW TSO on 88xx, only last segment will have
545+ * a SKB attached, so just free SQEs here.
541546 */
542547 if (!nic->hw_tso)
543548 nicvf_put_sq_desc(sq, hdr->subdesc_cnt + 1);
@@ -1502,6 +1507,7 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 958 unmodified lines
15021507 struct net_device *netdev;
15031508 struct nicvf *nic;
15041509 int err, qcount;
1510+ u16 sdevid;
15051511
15061512 err = pci_enable_device(pdev);
15071513 if (err) {
@@ -1575,6 +1581,10 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 67 unmodified lines
15751581 if (!pass1_silicon(nic->pdev))
15761582 nic->hw_tso = true;
15771583
1584+ pci_read_config_word(nic->pdev, PCI_SUBSYSTEM_ID, &sdevid);
1585+ if (sdevid == 0xA134)
1586+ nic->t88 = true;
1587+
15781588 /* Check if this VF is in QS only mode */
15791589 if (nic->sqs_mode)
15801590 return 0;
drivers/net/ethernet/cavium/thunder/nicvf_queues.c+57−7
@@ -938,6 +938,8 @@ static int nicvf_tso_count_subdescs(struct sk_buff *skb) · 937 unmodified lines
938938 return num_edescs + sh->gso_segs;
939939 }
940940
941+#define POST_CQE_DESC_COUNT 2
942+
941943 /* Get the number of SQ descriptors needed to xmit this skb */
942944 static int nicvf_sq_subdesc_required(struct nicvf *nic, struct sk_buff *skb)
943945 {
@@ -948,6 +950,10 @@ static int nicvf_sq_subdesc_required(struct nicvf *nic, struct sk_buff *skb) · 4 unmodified lines
948950 return subdesc_cnt;
949951 }
950952
953+ /* Dummy descriptors to get TSO pkt completion notification */
954+ if (nic->t88 && nic->hw_tso && skb_shinfo(skb)->gso_size)
955+ subdesc_cnt += POST_CQE_DESC_COUNT;
956+
951957 if (skb_shinfo(skb)->nr_frags)
952958 subdesc_cnt += skb_shinfo(skb)->nr_frags;
953959
@@ -965,14 +971,21 @@ nicvf_sq_add_hdr_subdesc(struct nicvf *nic, struct snd_queue *sq, int qentry, · 11 unmodified lines
965971 struct sq_hdr_subdesc *hdr;
966972
967973 hdr = (struct sq_hdr_subdesc *)GET_SQ_DESC(sq, qentry);
968− sq->skbuff[qentry] = (u64)skb;
969−
970974 memset(hdr, 0, SND_QUEUE_DESC_SIZE);
971975 hdr->subdesc_type = SQ_DESC_TYPE_HEADER;
972− /* Enable notification via CQE after processing SQE */
973− hdr->post_cqe = 1;
974− /* No of subdescriptors following this */
975− hdr->subdesc_cnt = subdesc_cnt;
976+
977+ if (nic->t88 && nic->hw_tso && skb_shinfo(skb)->gso_size) {
978+ /* post_cqe = 0, to avoid HW posting a CQE for every TSO
979+ * segment transmitted on 88xx.
980+ */
981+ hdr->subdesc_cnt = subdesc_cnt - POST_CQE_DESC_COUNT;
982+ } else {
983+ sq->skbuff[qentry] = (u64)skb;
984+ /* Enable notification via CQE after processing SQE */
985+ hdr->post_cqe = 1;
986+ /* No of subdescriptors following this */
987+ hdr->subdesc_cnt = subdesc_cnt;
988+ }
976989 hdr->tot_len = len;
977990
978991 /* Offload checksum calculation to HW */
@@ -1023,6 +1036,37 @@ static inline void nicvf_sq_add_gather_subdesc(struct snd_queue *sq, int qentry, · 44 unmodified lines
10231036 gather->addr = data;
10241037 }
10251038
1039+/* Add HDR + IMMEDIATE subdescriptors right after descriptors of a TSO
1040+ * packet so that a CQE is posted as a notifation for transmission of
1041+ * TSO packet.
1042+ */
1043+static inline void nicvf_sq_add_cqe_subdesc(struct snd_queue *sq, int qentry,
1044+ int tso_sqe, struct sk_buff *skb)
1045+{
1046+ struct sq_imm_subdesc *imm;
1047+ struct sq_hdr_subdesc *hdr;
1048+
1049+ sq->skbuff[qentry] = (u64)skb;
1050+
1051+ hdr = (struct sq_hdr_subdesc *)GET_SQ_DESC(sq, qentry);
1052+ memset(hdr, 0, SND_QUEUE_DESC_SIZE);
1053+ hdr->subdesc_type = SQ_DESC_TYPE_HEADER;
1054+ /* Enable notification via CQE after processing SQE */
1055+ hdr->post_cqe = 1;
1056+ /* There is no packet to transmit here */
1057+ hdr->dont_send = 1;
1058+ hdr->subdesc_cnt = POST_CQE_DESC_COUNT - 1;
1059+ hdr->tot_len = 1;
1060+ /* Actual TSO header SQE index, needed for cleanup */
1061+ hdr->rsvd2 = tso_sqe;
1062+
1063+ qentry = nicvf_get_nxt_sqentry(sq, qentry);
1064+ imm = (struct sq_imm_subdesc *)GET_SQ_DESC(sq, qentry);
1065+ memset(imm, 0, SND_QUEUE_DESC_SIZE);
1066+ imm->subdesc_type = SQ_DESC_TYPE_IMMEDIATE;
1067+ imm->len = 1;
1068+}
1069+
10261070 /* Segment a TSO packet into 'gso_size' segments and append
10271071 * them to SQ for transfer
10281072 */
@@ -1096,7 +1140,7 @@ static int nicvf_sq_append_tso(struct nicvf *nic, struct snd_queue *sq, · 67 unmodified lines
10961140 int nicvf_sq_append_skb(struct nicvf *nic, struct sk_buff *skb)
10971141 {
10981142 int i, size;
1099− int subdesc_cnt;
1143+ int subdesc_cnt, tso_sqe = 0;
11001144 int sq_num, qentry;
11011145 struct queue_set *qs;
11021146 struct snd_queue *sq;
@@ -1131,6 +1175,7 @@ int nicvf_sq_append_skb(struct nicvf *nic, struct sk_buff *skb) · 28 unmodified lines
11311175 /* Add SQ header subdesc */
11321176 nicvf_sq_add_hdr_subdesc(nic, sq, qentry, subdesc_cnt - 1,
11331177 skb, skb->len);
1178+ tso_sqe = qentry;
11341179
11351180 /* Add SQ gather subdescs */
11361181 qentry = nicvf_get_nxt_sqentry(sq, qentry);
@@ -1154,6 +1199,11 @@ int nicvf_sq_append_skb(struct nicvf *nic, struct sk_buff *skb) · 17 unmodified lines
11541199 }
11551200
11561201 doorbell:
1202+ if (nic->t88 && skb_shinfo(skb)->gso_size) {
1203+ qentry = nicvf_get_nxt_sqentry(sq, qentry);
1204+ nicvf_sq_add_cqe_subdesc(sq, qentry, tso_sqe, skb);
1205+ }
1206+
11571207 /* make sure all memory stores are done before ringing doorbell */
11581208 smp_wmb();
11591209
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h+2−2
@@ -419,8 +419,8 @@ struct link_config { · 418 unmodified lines
419419 unsigned short supported; /* link capabilities */
420420 unsigned short advertising; /* advertised capabilities */
421421 unsigned short lp_advertising; /* peer advertised capabilities */
422− unsigned short requested_speed; /* speed user has requested */
423− unsigned short speed; /* actual link speed */
422+ unsigned int requested_speed; /* speed user has requested */
423+ unsigned int speed; /* actual link speed */
424424 unsigned char requested_fc; /* flow control user has requested */
425425 unsigned char fc; /* actual link flow control */
426426 unsigned char autoneg; /* autonegotiating? */
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c+18−7
@@ -4305,10 +4305,17 @@ static const struct pci_error_handlers cxgb4_eeh = { · 4304 unmodified lines
43054305 .resume = eeh_resume,
43064306 };
43074307
4308+/* Return true if the Link Configuration supports "High Speeds" (those greater
4309+ * than 1Gb/s).
4310+ */
43084311 static inline bool is_x_10g_port(const struct link_config *lc)
43094312 {
4310− return (lc->supported & FW_PORT_CAP_SPEED_10G) != 0 ||
4311− (lc->supported & FW_PORT_CAP_SPEED_40G) != 0;
4313+ unsigned int speeds, high_speeds;
4314+
4315+ speeds = FW_PORT_CAP_SPEED_V(FW_PORT_CAP_SPEED_G(lc->supported));
4316+ high_speeds = speeds & ~(FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G);
4317+
4318+ return high_speeds != 0;
43124319 }
43134320
43144321 static inline void init_rspq(struct adapter *adap, struct sge_rspq *q,
@@ -4335,6 +4342,11 @@ static void cfg_queues(struct adapter *adap) · 20 unmodified lines
43354342 #endif
43364343 int ciq_size;
43374344
4345+ /* Reduce memory usage in kdump environment, disable all offload.
4346+ */
4347+ if (is_kdump_kernel())
4348+ adap->params.offload = 0;
4349+
43384350 for_each_port(adap, i)
43394351 n10g += is_x_10g_port(&adap2pinfo(adap, i)->link_cfg);
43404352 #ifdef CONFIG_CHELSIO_T4_DCB
@@ -4365,11 +4377,6 @@ static void cfg_queues(struct adapter *adap) · 24 unmodified lines
43654377 if (q10g > netif_get_num_default_rss_queues())
43664378 q10g = netif_get_num_default_rss_queues();
43674379
4368− /* Reduce memory usage in kdump environment, disable all offload.
4369− */
4370− if (is_kdump_kernel())
4371− adap->params.offload = 0;
4372−
43734380 for_each_port(adap, i) {
43744381 struct port_info *pi = adap2pinfo(adap, i);
43754382
@@ -4756,8 +4763,12 @@ static void print_port_info(const struct net_device *dev) · 380 unmodified lines
47564763 bufp += sprintf(bufp, "1000/");
47574764 if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G)
47584765 bufp += sprintf(bufp, "10G/");
4766+ if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_25G)
4767+ bufp += sprintf(bufp, "25G/");
47594768 if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G)
47604769 bufp += sprintf(bufp, "40G/");
4770+ if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_100G)
4771+ bufp += sprintf(bufp, "100G/");
47614772 if (bufp != buf)
47624773 --bufp;
47634774 sprintf(bufp, "BASE-%s", t4_get_port_type_description(pi->port_type));
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c+6−1
@@ -3627,7 +3627,8 @@ void t4_ulprx_read_la(struct adapter *adap, u32 *la_buf) · 3626 unmodified lines
36273627 }
36283628
36293629 #define ADVERT_MASK (FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G |\
3630− FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_40G | \
3630+ FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_25G | \
3631+ FW_PORT_CAP_SPEED_40G | FW_PORT_CAP_SPEED_100G | \
36313632 FW_PORT_CAP_ANEG)
36323633
36333634 /**
@@ -7196,8 +7197,12 @@ void t4_handle_get_port_info(struct port_info *pi, const __be64 *rpl) · 3562 unmodified lines
71967197 speed = 1000;
71977198 else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_10G))
71987199 speed = 10000;
7200+ else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_25G))
7201+ speed = 25000;
71997202 else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_40G))
72007203 speed = 40000;
7204+ else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_100G))
7205+ speed = 100000;
72017206
72027207 lc = &pi->link_cfg;
72037208
drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h+6−0
@@ -2265,6 +2265,12 @@ enum fw_port_cap { · 2264 unmodified lines
22652265 FW_PORT_CAP_802_3_ASM_DIR = 0x8000,
22662266 };
22672267
2268+#define FW_PORT_CAP_SPEED_S 0
2269+#define FW_PORT_CAP_SPEED_M 0x3f
2270+#define FW_PORT_CAP_SPEED_V(x) ((x) << FW_PORT_CAP_SPEED_S)
2271+#define FW_PORT_CAP_SPEED_G(x) \
2272+ (((x) >> FW_PORT_CAP_SPEED_S) & FW_PORT_CAP_SPEED_M)
2273+
22682274 enum fw_port_mdi {
22692275 FW_PORT_CAP_MDI_UNCHANGED,
22702276 FW_PORT_CAP_MDI_AUTO,
drivers/net/ethernet/chelsio/cxgb4vf/t4vf_common.h+11−4
@@ -108,8 +108,8 @@ struct link_config { · 107 unmodified lines
108108 unsigned int supported; /* link capabilities */
109109 unsigned int advertising; /* advertised capabilities */
110110 unsigned short lp_advertising; /* peer advertised capabilities */
111− unsigned short requested_speed; /* speed user has requested */
112− unsigned short speed; /* actual link speed */
111+ unsigned int requested_speed; /* speed user has requested */
112+ unsigned int speed; /* actual link speed */
113113 unsigned char requested_fc; /* flow control user has requested */
114114 unsigned char fc; /* actual link flow control */
115115 unsigned char autoneg; /* autonegotiating? */
@@ -271,10 +271,17 @@ static inline bool is_10g_port(const struct link_config *lc) · 155 unmodified lines
271271 return (lc->supported & FW_PORT_CAP_SPEED_10G) != 0;
272272 }
273273
274+/* Return true if the Link Configuration supports "High Speeds" (those greater
275+ * than 1Gb/s).
276+ */
274277 static inline bool is_x_10g_port(const struct link_config *lc)
275278 {
276− return (lc->supported & FW_PORT_CAP_SPEED_10G) != 0 ||
277− (lc->supported & FW_PORT_CAP_SPEED_40G) != 0;
279+ unsigned int speeds, high_speeds;
280+
281+ speeds = FW_PORT_CAP_SPEED_V(FW_PORT_CAP_SPEED_G(lc->supported));
282+ high_speeds = speeds & ~(FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G);
283+
284+ return high_speeds != 0;
278285 }
279286
280287 static inline unsigned int core_ticks_per_usec(const struct adapter *adapter)
drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c+7−2
@@ -314,8 +314,9 @@ int t4vf_wr_mbox_core(struct adapter *adapter, const void *cmd, int size, · 313 unmodified lines
314314 }
315315
316316 #define ADVERT_MASK (FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G |\
317− FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_40G | \
318− FW_PORT_CAP_SPEED_100G | FW_PORT_CAP_ANEG)
317+ FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_25G | \
318+ FW_PORT_CAP_SPEED_40G | FW_PORT_CAP_SPEED_100G | \
319+ FW_PORT_CAP_ANEG)
319320
320321 /**
321322 * init_link_config - initialize a link's SW state
@@ -1712,8 +1713,12 @@ int t4vf_handle_fw_rpl(struct adapter *adapter, const __be64 *rpl) · 1390 unmodified lines
17121713 speed = 1000;
17131714 else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_10G))
17141715 speed = 10000;
1716+ else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_25G))
1717+ speed = 25000;
17151718 else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_40G))
17161719 speed = 40000;
1720+ else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_100G))
1721+ speed = 100000;
17171722
17181723 /*
17191724 * Scan all of our "ports" (Virtual Interfaces) looking for
drivers/net/ethernet/davicom/dm9000.c+5−3
@@ -1299,6 +1299,7 @@ static int · 1298 unmodified lines
12991299 dm9000_open(struct net_device *dev)
13001300 {
13011301 struct board_info *db = netdev_priv(dev);
1302+ unsigned int irq_flags = irq_get_trigger_type(dev->irq);
13021303
13031304 if (netif_msg_ifup(db))
13041305 dev_dbg(db->dev, "enabling %s\n", dev->name);
@@ -1306,9 +1307,11 @@ dm9000_open(struct net_device *dev) · 1 unmodified line
13061307 /* If there is no IRQ type specified, tell the user that this is a
13071308 * problem
13081309 */
1309− if (irq_get_trigger_type(dev->irq) == IRQF_TRIGGER_NONE)
1310+ if (irq_flags == IRQF_TRIGGER_NONE)
13101311 dev_warn(db->dev, "WARNING: no IRQ resource flags set.\n");
13111312
1313+ irq_flags |= IRQF_SHARED;
1314+
13121315 /* GPIO0 on pre-activate PHY, Reg 1F is not set by reset */
13131316 iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */
13141317 mdelay(1); /* delay needs by DM9000B */
@@ -1316,8 +1319,7 @@ dm9000_open(struct net_device *dev) · 1 unmodified line
13161319 /* Initialize DM9000 board */
13171320 dm9000_init_dm9000(dev);
13181321
1319− if (request_irq(dev->irq, dm9000_interrupt, IRQF_SHARED,
1320− dev->name, dev))
1322+ if (request_irq(dev->irq, dm9000_interrupt, irq_flags, dev->name, dev))
13211323 return -EAGAIN;
13221324 /* Now that we have an interrupt handler hooked up we can unmask
13231325 * our interrupts
drivers/net/ethernet/freescale/gianfar.c+14−6
@@ -2922,17 +2922,25 @@ static bool gfar_add_rx_frag(struct gfar_rx_buff *rxb, u32 lstatus, · 2921 unmodified lines
29222922 {
29232923 unsigned int size = lstatus & BD_LENGTH_MASK;
29242924 struct page *page = rxb->page;
2925+ bool last = !!(lstatus & BD_LFLAG(RXBD_LAST));
29252926
29262927 /* Remove the FCS from the packet length */
2927− if (likely(lstatus & BD_LFLAG(RXBD_LAST)))
2928+ if (last)
29282929 size -= ETH_FCS_LEN;
29292930
2930− if (likely(first))
2931+ if (likely(first)) {
29312932 skb_put(skb, size);
2932− else
2933− skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
2934− rxb->page_offset + RXBUF_ALIGNMENT,
2935− size, GFAR_RXB_TRUESIZE);
2933+ } else {
2934+ /* the last fragments' length contains the full frame length */
2935+ if (last)
2936+ size -= skb->len;
2937+
2938+ /* in case the last fragment consisted only of the FCS */
2939+ if (size > 0)
2940+ skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
2941+ rxb->page_offset + RXBUF_ALIGNMENT,
2942+ size, GFAR_RXB_TRUESIZE);
2943+ }
29362944
29372945 /* try reuse page */
29382946 if (unlikely(page_count(page) != 1))
drivers/net/ethernet/freescale/gianfar.h+2−1
@@ -100,7 +100,8 @@ extern const char gfar_driver_version[]; · 99 unmodified lines
100100 #define DEFAULT_RX_LFC_THR 16
101101 #define DEFAULT_LFC_PTVVAL 4
102102
103−#define GFAR_RXB_SIZE 1536
103+/* prevent fragmenation by HW in DSA environments */
104+#define GFAR_RXB_SIZE roundup(1536 + 8, 64)
104105 #define GFAR_SKBFRAG_SIZE (RXBUF_ALIGNMENT + GFAR_RXB_SIZE \
105106 + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
106107 #define GFAR_RXB_TRUESIZE 2048
drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c+1−1
@@ -17,7 +17,7 @@ static const struct mac_stats_string g_gmac_stats_string[] = { · 16 unmodified lines
1717 {"gmac_rx_octets_total_ok", MAC_STATS_FIELD_OFF(rx_good_bytes)},
1818 {"gmac_rx_octets_bad", MAC_STATS_FIELD_OFF(rx_bad_bytes)},
1919 {"gmac_rx_uc_pkts", MAC_STATS_FIELD_OFF(rx_uc_pkts)},
20− {"gamc_rx_mc_pkts", MAC_STATS_FIELD_OFF(rx_mc_pkts)},
20+ {"gmac_rx_mc_pkts", MAC_STATS_FIELD_OFF(rx_mc_pkts)},
2121 {"gmac_rx_bc_pkts", MAC_STATS_FIELD_OFF(rx_bc_pkts)},
2222 {"gmac_rx_pkts_64octets", MAC_STATS_FIELD_OFF(rx_64bytes)},
2323 {"gmac_rx_pkts_65to127", MAC_STATS_FIELD_OFF(rx_65to127)},
drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c+2−1
@@ -328,9 +328,10 @@ static void hns_ppe_init_hw(struct hns_ppe_cb *ppe_cb) · 327 unmodified lines
328328 static void hns_ppe_uninit_hw(struct hns_ppe_cb *ppe_cb)
329329 {
330330 u32 port;
331− struct dsaf_device *dsaf_dev = ppe_cb->ppe_common_cb->dsaf_dev;
332331
333332 if (ppe_cb->ppe_common_cb) {
333+ struct dsaf_device *dsaf_dev = ppe_cb->ppe_common_cb->dsaf_dev;
334+
334335 port = ppe_cb->index;
335336 dsaf_dev->misc_op->ppe_srst(dsaf_dev, port, 0);
336337 }
drivers/net/ethernet/ibm/emac/core.c+32−2
@@ -977,7 +977,37 @@ static void emac_set_multicast_list(struct net_device *ndev) · 976 unmodified lines
977977 dev->mcast_pending = 1;
978978 return;
979979 }
980+
981+ mutex_lock(&dev->link_lock);
980982 __emac_set_multicast_list(dev);
983+ mutex_unlock(&dev->link_lock);
984+}
985+
986+static int emac_set_mac_address(struct net_device *ndev, void *sa)
987+{
988+ struct emac_instance *dev = netdev_priv(ndev);
989+ struct sockaddr *addr = sa;
990+ struct emac_regs __iomem *p = dev->emacp;
991+
992+ if (!is_valid_ether_addr(addr->sa_data))
993+ return -EADDRNOTAVAIL;
994+
995+ mutex_lock(&dev->link_lock);
996+
997+ memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
998+
999+ emac_rx_disable(dev);
1000+ emac_tx_disable(dev);
1001+ out_be32(&p->iahr, (ndev->dev_addr[0] << 8) | ndev->dev_addr[1]);
1002+ out_be32(&p->ialr, (ndev->dev_addr[2] << 24) |
1003+ (ndev->dev_addr[3] << 16) | (ndev->dev_addr[4] << 8) |
1004+ ndev->dev_addr[5]);
1005+ emac_tx_enable(dev);
1006+ emac_rx_enable(dev);
1007+
1008+ mutex_unlock(&dev->link_lock);
1009+
1010+ return 0;
9811011 }
9821012
9831013 static int emac_resize_rx_ring(struct emac_instance *dev, int new_mtu)
@@ -2686,7 +2716,7 @@ static const struct net_device_ops emac_netdev_ops = { · 1702 unmodified lines
26862716 .ndo_do_ioctl = emac_ioctl,
26872717 .ndo_tx_timeout = emac_tx_timeout,
26882718 .ndo_validate_addr = eth_validate_addr,
2689− .ndo_set_mac_address = eth_mac_addr,
2719+ .ndo_set_mac_address = emac_set_mac_address,
26902720 .ndo_start_xmit = emac_start_xmit,
26912721 .ndo_change_mtu = eth_change_mtu,
26922722 };
@@ -2699,7 +2729,7 @@ static const struct net_device_ops emac_gige_netdev_ops = { · 6 unmodified lines
26992729 .ndo_do_ioctl = emac_ioctl,
27002730 .ndo_tx_timeout = emac_tx_timeout,
27012731 .ndo_validate_addr = eth_validate_addr,
2702− .ndo_set_mac_address = eth_mac_addr,
2732+ .ndo_set_mac_address = emac_set_mac_address,
27032733 .ndo_start_xmit = emac_start_xmit_sg,
27042734 .ndo_change_mtu = emac_change_mtu,
27052735 };
drivers/net/ethernet/intel/e1000e/82571.c+4−2
@@ -2032,7 +2032,8 @@ const struct e1000_info e1000_82574_info = { · 2031 unmodified lines
20322032 | FLAG2_DISABLE_ASPM_L0S
20332033 | FLAG2_DISABLE_ASPM_L1
20342034 | FLAG2_NO_DISABLE_RX
2035− | FLAG2_DMA_BURST,
2035+ | FLAG2_DMA_BURST
2036+ | FLAG2_CHECK_SYSTIM_OVERFLOW,
20362037 .pba = 32,
20372038 .max_hw_frame_size = DEFAULT_JUMBO,
20382039 .get_variants = e1000_get_variants_82571,
@@ -2053,7 +2054,8 @@ const struct e1000_info e1000_82583_info = { · 14 unmodified lines
20532054 | FLAG_HAS_CTRLEXT_ON_LOAD,
20542055 .flags2 = FLAG2_DISABLE_ASPM_L0S
20552056 | FLAG2_DISABLE_ASPM_L1
2056− | FLAG2_NO_DISABLE_RX,
2057+ | FLAG2_NO_DISABLE_RX
2058+ | FLAG2_CHECK_SYSTIM_OVERFLOW,
20572059 .pba = 32,
20582060 .max_hw_frame_size = DEFAULT_JUMBO,
20592061 .get_variants = e1000_get_variants_82571,
drivers/net/ethernet/intel/e1000e/e1000.h+1−0
@@ -452,6 +452,7 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca); · 451 unmodified lines
452452 #define FLAG2_PCIM2PCI_ARBITER_WA BIT(11)
453453 #define FLAG2_DFLT_CRC_STRIPPING BIT(12)
454454 #define FLAG2_CHECK_RX_HWTSTAMP BIT(13)
455+#define FLAG2_CHECK_SYSTIM_OVERFLOW BIT(14)
455456
456457 #define E1000_RX_DESC_PS(R, i) \
457458 (&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
drivers/net/ethernet/intel/e1000e/ich8lan.c+2−1
@@ -5885,7 +5885,8 @@ const struct e1000_info e1000_pch_lpt_info = { · 5884 unmodified lines
58855885 | FLAG_HAS_JUMBO_FRAMES
58865886 | FLAG_APME_IN_WUC,
58875887 .flags2 = FLAG2_HAS_PHY_STATS
5888− | FLAG2_HAS_EEE,
5888+ | FLAG2_HAS_EEE
5889+ | FLAG2_CHECK_SYSTIM_OVERFLOW,
58895890 .pba = 26,
58905891 .max_hw_frame_size = 9022,
58915892 .get_variants = e1000_get_variants_ich8lan,
drivers/net/ethernet/intel/e1000e/netdev.c+39−27
@@ -4302,6 +4302,42 @@ void e1000e_reinit_locked(struct e1000_adapter *adapter) · 4301 unmodified lines
43024302 clear_bit(__E1000_RESETTING, &adapter->state);
43034303 }
43044304
4305+/**
4306+ * e1000e_sanitize_systim - sanitize raw cycle counter reads
4307+ * @hw: pointer to the HW structure
4308+ * @systim: cycle_t value read, sanitized and returned
4309+ *
4310+ * Errata for 82574/82583 possible bad bits read from SYSTIMH/L:
4311+ * check to see that the time is incrementing at a reasonable
4312+ * rate and is a multiple of incvalue.
4313+ **/
4314+static cycle_t e1000e_sanitize_systim(struct e1000_hw *hw, cycle_t systim)
4315+{
4316+ u64 time_delta, rem, temp;
4317+ cycle_t systim_next;
4318+ u32 incvalue;
4319+ int i;
4320+
4321+ incvalue = er32(TIMINCA) & E1000_TIMINCA_INCVALUE_MASK;
4322+ for (i = 0; i < E1000_MAX_82574_SYSTIM_REREADS; i++) {
4323+ /* latch SYSTIMH on read of SYSTIML */
4324+ systim_next = (cycle_t)er32(SYSTIML);
4325+ systim_next |= (cycle_t)er32(SYSTIMH) << 32;
4326+
4327+ time_delta = systim_next - systim;
4328+ temp = time_delta;
4329+ /* VMWare users have seen incvalue of zero, don't div / 0 */
4330+ rem = incvalue ? do_div(temp, incvalue) : (time_delta != 0);
4331+
4332+ systim = systim_next;
4333+
4334+ if ((time_delta < E1000_82574_SYSTIM_EPSILON) && (rem == 0))
4335+ break;
4336+ }
4337+
4338+ return systim;
4339+}
4340+
43054341 /**
43064342 * e1000e_cyclecounter_read - read raw cycle counter (used by time counter)
43074343 * @cc: cyclecounter structure
@@ -4312,7 +4348,7 @@ static cycle_t e1000e_cyclecounter_read(const struct cyclecounter *cc) · 4 unmodified lines
43124348 cc);
43134349 struct e1000_hw *hw = &adapter->hw;
43144350 u32 systimel, systimeh;
4315− cycle_t systim, systim_next;
4351+ cycle_t systim;
43164352 /* SYSTIMH latching upon SYSTIML read does not work well.
43174353 * This means that if SYSTIML overflows after we read it but before
43184354 * we read SYSTIMH, the value of SYSTIMH has been incremented and we
@@ -4335,33 +4371,9 @@ static cycle_t e1000e_cyclecounter_read(const struct cyclecounter *cc) · 16 unmodified lines
43354371 systim = (cycle_t)systimel;
43364372 systim |= (cycle_t)systimeh << 32;
43374373
4338− if ((hw->mac.type == e1000_82574) || (hw->mac.type == e1000_82583)) {
4339− u64 time_delta, rem, temp;
4340− u32 incvalue;
4341− int i;
4342−
4343− /* errata for 82574/82583 possible bad bits read from SYSTIMH/L
4344− * check to see that the time is incrementing at a reasonable
4345− * rate and is a multiple of incvalue
4346− */
4347− incvalue = er32(TIMINCA) & E1000_TIMINCA_INCVALUE_MASK;
4348− for (i = 0; i < E1000_MAX_82574_SYSTIM_REREADS; i++) {
4349− /* latch SYSTIMH on read of SYSTIML */
4350− systim_next = (cycle_t)er32(SYSTIML);
4351− systim_next |= (cycle_t)er32(SYSTIMH) << 32;
4352−
4353− time_delta = systim_next - systim;
4354− temp = time_delta;
4355− /* VMWare users have seen incvalue of zero, don't div / 0 */
4356− rem = incvalue ? do_div(temp, incvalue) : (time_delta != 0);
4357−
4358− systim = systim_next;
4374+ if (adapter->flags2 & FLAG2_CHECK_SYSTIM_OVERFLOW)
4375+ systim = e1000e_sanitize_systim(hw, systim);
43594376
4360− if ((time_delta < E1000_82574_SYSTIM_EPSILON) &&
4361− (rem == 0))
4362− break;
4363− }
4364− }
43654377 return systim;
43664378 }
43674379
drivers/net/ethernet/intel/i40e/i40e_client.c+30−11
@@ -199,6 +199,7 @@ void i40e_notify_client_of_l2_param_changes(struct i40e_vsi *vsi) · 198 unmodified lines
199199 void i40e_notify_client_of_netdev_open(struct i40e_vsi *vsi)
200200 {
201201 struct i40e_client_instance *cdev;
202+ int ret = 0;
202203
203204 if (!vsi)
204205 return;
@@ -211,7 +212,14 @@ void i40e_notify_client_of_netdev_open(struct i40e_vsi *vsi) · 6 unmodified lines
211212 "Cannot locate client instance open routine\n");
212213 continue;
213214 }
214− cdev->client->ops->open(&cdev->lan_info, cdev->client);
215+ if (!(test_bit(__I40E_CLIENT_INSTANCE_OPENED,
216+ &cdev->state))) {
217+ ret = cdev->client->ops->open(&cdev->lan_info,
218+ cdev->client);
219+ if (!ret)
220+ set_bit(__I40E_CLIENT_INSTANCE_OPENED,
221+ &cdev->state);
222+ }
215223 }
216224 }
217225 mutex_unlock(&i40e_client_instance_mutex);
@@ -407,12 +415,14 @@ struct i40e_vsi *i40e_vsi_lookup(struct i40e_pf *pf, · 189 unmodified lines
407415 * i40e_client_add_instance - add a client instance struct to the instance list
408416 * @pf: pointer to the board struct
409417 * @client: pointer to a client struct in the client list.
418+ * @existing: if there was already an existing instance
410419 *
411− * Returns cdev ptr on success, NULL on failure
420+ * Returns cdev ptr on success or if already exists, NULL on failure
412421 **/
413422 static
414423 struct i40e_client_instance *i40e_client_add_instance(struct i40e_pf *pf,
415− struct i40e_client *client)
424+ struct i40e_client *client,
425+ bool *existing)
416426 {
417427 struct i40e_client_instance *cdev;
418428 struct netdev_hw_addr *mac = NULL;
@@ -421,7 +431,7 @@ struct i40e_client_instance *i40e_client_add_instance(struct i40e_pf *pf, · 2 unmodified lines
421431 mutex_lock(&i40e_client_instance_mutex);
422432 list_for_each_entry(cdev, &i40e_client_instances, list) {
423433 if ((cdev->lan_info.pf == pf) && (cdev->client == client)) {
424− cdev = NULL;
434+ *existing = true;
425435 goto out;
426436 }
427437 }
@@ -505,6 +515,7 @@ void i40e_client_subtask(struct i40e_pf *pf) · 77 unmodified lines
505515 {
506516 struct i40e_client_instance *cdev;
507517 struct i40e_client *client;
518+ bool existing = false;
508519 int ret = 0;
509520
510521 if (!(pf->flags & I40E_FLAG_SERVICE_CLIENT_REQUESTED))
@@ -528,18 +539,25 @@ void i40e_client_subtask(struct i40e_pf *pf) · 17 unmodified lines
528539 /* check if L2 VSI is up, if not we are not ready */
529540 if (test_bit(__I40E_DOWN, &pf->vsi[pf->lan_vsi]->state))
530541 continue;
542+ } else {
543+ dev_warn(&pf->pdev->dev, "This client %s is being instanciated at probe\n",
544+ client->name);
531545 }
532546
533547 /* Add the client instance to the instance list */
534− cdev = i40e_client_add_instance(pf, client);
548+ cdev = i40e_client_add_instance(pf, client, &existing);
535549 if (!cdev)
536550 continue;
537551
538− /* Also up the ref_cnt of no. of instances of this client */
539− atomic_inc(&client->ref_cnt);
540− dev_info(&pf->pdev->dev, "Added instance of Client %s to PF%d bus=0x%02x func=0x%02x\n",
541− client->name, pf->hw.pf_id,
542− pf->hw.bus.device, pf->hw.bus.func);
552+ if (!existing) {
553+ /* Also up the ref_cnt for no. of instances of this
554+ * client.
555+ */
556+ atomic_inc(&client->ref_cnt);
557+ dev_info(&pf->pdev->dev, "Added instance of Client %s to PF%d bus=0x%02x func=0x%02x\n",
558+ client->name, pf->hw.pf_id,
559+ pf->hw.bus.device, pf->hw.bus.func);
560+ }
543561
544562 /* Send an Open request to the client */
545563 atomic_inc(&cdev->ref_cnt);
@@ -588,7 +606,8 @@ int i40e_lan_add_device(struct i40e_pf *pf) · 42 unmodified lines
588606 pf->hw.pf_id, pf->hw.bus.device, pf->hw.bus.func);
589607
590608 /* Since in some cases register may have happened before a device gets
591− * added, we can schedule a subtask to go initiate the clients.
609+ * added, we can schedule a subtask to go initiate the clients if
610+ * they can be launched at probe time.
592611 */
593612 pf->flags |= I40E_FLAG_SERVICE_CLIENT_REQUESTED;
594613 i40e_service_event_schedule(pf);
drivers/net/ethernet/intel/i40e/i40e_main.c+36−15
@@ -4554,23 +4554,38 @@ static u8 i40e_get_iscsi_tc_map(struct i40e_pf *pf) · 4553 unmodified lines
45544554 **/
45554555 static u8 i40e_dcb_get_num_tc(struct i40e_dcbx_config *dcbcfg)
45564556 {
4557+ int i, tc_unused = 0;
45574558 u8 num_tc = 0;
4558− int i;
4559+ u8 ret = 0;
45594560
45604561 /* Scan the ETS Config Priority Table to find
45614562 * traffic class enabled for a given priority
4562− * and use the traffic class index to get the
4563− * number of traffic classes enabled
4563+ * and create a bitmask of enabled TCs
45644564 */
4565− for (i = 0; i < I40E_MAX_USER_PRIORITY; i++) {
4566− if (dcbcfg->etscfg.prioritytable[i] > num_tc)
4567− num_tc = dcbcfg->etscfg.prioritytable[i];
4568− }
4565+ for (i = 0; i < I40E_MAX_USER_PRIORITY; i++)
4566+ num_tc |= BIT(dcbcfg->etscfg.prioritytable[i]);
45694567
4570− /* Traffic class index starts from zero so
4571− * increment to return the actual count
4568+ /* Now scan the bitmask to check for
4569+ * contiguous TCs starting with TC0
45724570 */
4573− return num_tc + 1;
4571+ for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
4572+ if (num_tc & BIT(i)) {
4573+ if (!tc_unused) {
4574+ ret++;
4575+ } else {
4576+ pr_err("Non-contiguous TC - Disabling DCB\n");
4577+ return 1;
4578+ }
4579+ } else {
4580+ tc_unused = 1;
4581+ }
4582+ }
4583+
4584+ /* There is always at least TC0 */
4585+ if (!ret)
4586+ ret = 1;
4587+
4588+ return ret;
45744589 }
45754590
45764591 /**
@@ -5098,9 +5113,13 @@ static int i40e_init_pf_dcb(struct i40e_pf *pf) · 521 unmodified lines
50985113 DCB_CAP_DCBX_VER_IEEE;
50995114
51005115 pf->flags |= I40E_FLAG_DCB_CAPABLE;
5101− /* Enable DCB tagging only when more than one TC */
5116+ /* Enable DCB tagging only when more than one TC
5117+ * or explicitly disable if only one TC
5118+ */
51025119 if (i40e_dcb_get_num_tc(&hw->local_dcbx_config) > 1)
51035120 pf->flags |= I40E_FLAG_DCB_ENABLED;
5121+ else
5122+ pf->flags &= ~I40E_FLAG_DCB_ENABLED;
51045123 dev_dbg(&pf->pdev->dev,
51055124 "DCBX offload is supported for this PF.\n");
51065125 }
@@ -5416,7 +5435,6 @@ int i40e_open(struct net_device *netdev) · 309 unmodified lines
54165435 wr32(&pf->hw, I40E_GLLAN_TSOMSK_L, be32_to_cpu(TCP_FLAG_CWR) >> 16);
54175436
54185437 udp_tunnel_get_rx_info(netdev);
5419− i40e_notify_client_of_netdev_open(vsi);
54205438
54215439 return 0;
54225440 }
@@ -5702,7 +5720,7 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf, · 279 unmodified lines
57025720 u8 type;
57035721
57045722 /* Not DCB capable or capability disabled */
5705− if (!(pf->flags & I40E_FLAG_DCB_CAPABLE))
5723+ if (!(pf->flags & I40E_FLAG_DCB_ENABLED))
57065724 return ret;
57075725
57085726 /* Ignore if event is not for Nearest Bridge */
@@ -7882,6 +7900,7 @@ static int i40e_init_interrupt_scheme(struct i40e_pf *pf) · 2173 unmodified lines
78827900 #endif
78837901 I40E_FLAG_RSS_ENABLED |
78847902 I40E_FLAG_DCB_CAPABLE |
7903+ I40E_FLAG_DCB_ENABLED |
78857904 I40E_FLAG_SRIOV_ENABLED |
78867905 I40E_FLAG_FD_SB_ENABLED |
78877906 I40E_FLAG_FD_ATR_ENABLED |
@@ -10488,6 +10507,7 @@ static void i40e_determine_queue_usage(struct i40e_pf *pf) · 2600 unmodified lines
1048810507 I40E_FLAG_FD_SB_ENABLED |
1048910508 I40E_FLAG_FD_ATR_ENABLED |
1049010509 I40E_FLAG_DCB_CAPABLE |
10510+ I40E_FLAG_DCB_ENABLED |
1049110511 I40E_FLAG_SRIOV_ENABLED |
1049210512 I40E_FLAG_VMDQ_ENABLED);
1049310513 } else if (!(pf->flags & (I40E_FLAG_RSS_ENABLED |
@@ -10511,7 +10531,8 @@ static void i40e_determine_queue_usage(struct i40e_pf *pf) · 17 unmodified lines
1051110531 /* Not enough queues for all TCs */
1051210532 if ((pf->flags & I40E_FLAG_DCB_CAPABLE) &&
1051310533 (queues_left < I40E_MAX_TRAFFIC_CLASS)) {
10514− pf->flags &= ~I40E_FLAG_DCB_CAPABLE;
10534+ pf->flags &= ~(I40E_FLAG_DCB_CAPABLE |
10535+ I40E_FLAG_DCB_ENABLED);
1051510536 dev_info(&pf->pdev->dev, "not enough queues for DCB. DCB is disabled.\n");
1051610537 }
1051710538 pf->num_lan_qps = max_t(int, pf->rss_size_max,
@@ -10908,7 +10929,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 390 unmodified lines
1090810929 err = i40e_init_pf_dcb(pf);
1090910930 if (err) {
1091010931 dev_info(&pdev->dev, "DCB init failed %d, disabled\n", err);
10911− pf->flags &= ~I40E_FLAG_DCB_CAPABLE;
10932+ pf->flags &= ~(I40E_FLAG_DCB_CAPABLE & I40E_FLAG_DCB_ENABLED);
1091210933 /* Continue without DCB enabled */
1091310934 }
1091410935 #endif /* CONFIG_I40E_DCB */
drivers/net/ethernet/intel/igb/igb_ptp.c+23−3
@@ -744,7 +744,8 @@ static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter) · 743 unmodified lines
744744 }
745745 }
746746
747− shhwtstamps.hwtstamp = ktime_sub_ns(shhwtstamps.hwtstamp, adjust);
747+ shhwtstamps.hwtstamp =
748+ ktime_add_ns(shhwtstamps.hwtstamp, adjust);
748749
749750 skb_tstamp_tx(adapter->ptp_tx_skb, &shhwtstamps);
750751 dev_kfree_skb_any(adapter->ptp_tx_skb);
@@ -767,13 +768,32 @@ void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, · 16 unmodified lines
767768 struct sk_buff *skb)
768769 {
769770 __le64 *regval = (__le64 *)va;
771+ struct igb_adapter *adapter = q_vector->adapter;
772+ int adjust = 0;
770773
771774 /* The timestamp is recorded in little endian format.
772775 * DWORD: 0 1 2 3
773776 * Field: Reserved Reserved SYSTIML SYSTIMH
774777 */
775− igb_ptp_systim_to_hwtstamp(q_vector->adapter, skb_hwtstamps(skb),
778+ igb_ptp_systim_to_hwtstamp(adapter, skb_hwtstamps(skb),
776779 le64_to_cpu(regval[1]));
780+
781+ /* adjust timestamp for the RX latency based on link speed */
782+ if (adapter->hw.mac.type == e1000_i210) {
783+ switch (adapter->link_speed) {
784+ case SPEED_10:
785+ adjust = IGB_I210_RX_LATENCY_10;
786+ break;
787+ case SPEED_100:
788+ adjust = IGB_I210_RX_LATENCY_100;
789+ break;
790+ case SPEED_1000:
791+ adjust = IGB_I210_RX_LATENCY_1000;
792+ break;
793+ }
794+ }
795+ skb_hwtstamps(skb)->hwtstamp =
796+ ktime_sub_ns(skb_hwtstamps(skb)->hwtstamp, adjust);
777797 }
778798
779799 /**
@@ -825,7 +845,7 @@ void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, · 45 unmodified lines
825845 }
826846 }
827847 skb_hwtstamps(skb)->hwtstamp =
828− ktime_add_ns(skb_hwtstamps(skb)->hwtstamp, adjust);
848+ ktime_sub_ns(skb_hwtstamps(skb)->hwtstamp, adjust);
829849
830850 /* Update the last_rx_timestamp timer in order to enable watchdog check
831851 * for error case of latched timestamp on a dropped packet.
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c+3−1
@@ -2958,8 +2958,10 @@ s32 ixgbe_clear_vmdq_generic(struct ixgbe_hw *hw, u32 rar, u32 vmdq) · 2957 unmodified lines
29582958 }
29592959
29602960 /* was that the last pool using this rar? */
2961− if (mpsar_lo == 0 && mpsar_hi == 0 && rar != 0)
2961+ if (mpsar_lo == 0 && mpsar_hi == 0 &&
2962+ rar != 0 && rar != hw->mac.san_mac_rar_index)
29622963 hw->mac.ops.clear_rar(hw, rar);
2964+
29632965 return 0;
29642966 }
29652967
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+16−7
@@ -4100,6 +4100,8 @@ static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter) · 4099 unmodified lines
41004100 struct ixgbe_hw *hw = &adapter->hw;
41014101 u32 vlnctrl, i;
41024102
4103+ vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
4104+
41034105 switch (hw->mac.type) {
41044106 case ixgbe_mac_82599EB:
41054107 case ixgbe_mac_X540:
@@ -4112,8 +4114,7 @@ static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter) · 6 unmodified lines
41124114 /* fall through */
41134115 case ixgbe_mac_82598EB:
41144116 /* legacy case, we can just disable VLAN filtering */
4115− vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
4116− vlnctrl &= ~(IXGBE_VLNCTRL_VFE | IXGBE_VLNCTRL_CFIEN);
4117+ vlnctrl &= ~IXGBE_VLNCTRL_VFE;
41174118 IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
41184119 return;
41194120 }
@@ -4125,6 +4126,10 @@ static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter) · 5 unmodified lines
41254126 /* Set flag so we don't redo unnecessary work */
41264127 adapter->flags2 |= IXGBE_FLAG2_VLAN_PROMISC;
41274128
4129+ /* For VMDq and SR-IOV we must leave VLAN filtering enabled */
4130+ vlnctrl |= IXGBE_VLNCTRL_VFE;
4131+ IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
4132+
41284133 /* Add PF to all active pools */
41294134 for (i = IXGBE_VLVF_ENTRIES; --i;) {
41304135 u32 reg_offset = IXGBE_VLVFB(i * 2 + VMDQ_P(0) / 32);
@@ -4191,6 +4196,11 @@ static void ixgbe_vlan_promisc_disable(struct ixgbe_adapter *adapter) · 60 unmodified lines
41914196 struct ixgbe_hw *hw = &adapter->hw;
41924197 u32 vlnctrl, i;
41934198
4199+ /* Set VLAN filtering to enabled */
4200+ vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
4201+ vlnctrl |= IXGBE_VLNCTRL_VFE;
4202+ IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
4203+
41944204 switch (hw->mac.type) {
41954205 case ixgbe_mac_82599EB:
41964206 case ixgbe_mac_X540:
@@ -4202,10 +4212,6 @@ static void ixgbe_vlan_promisc_disable(struct ixgbe_adapter *adapter) · 5 unmodified lines
42024212 break;
42034213 /* fall through */
42044214 case ixgbe_mac_82598EB:
4205− vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
4206− vlnctrl &= ~IXGBE_VLNCTRL_CFIEN;
4207− vlnctrl |= IXGBE_VLNCTRL_VFE;
4208− IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
42094215 return;
42104216 }
42114217
@@ -8390,12 +8396,14 @@ static int parse_tc_actions(struct ixgbe_adapter *adapter, · 4178 unmodified lines
83908396 struct tcf_exts *exts, u64 *action, u8 *queue)
83918397 {
83928398 const struct tc_action *a;
8399+ LIST_HEAD(actions);
83938400 int err;
83948401
83958402 if (tc_no_actions(exts))
83968403 return -EINVAL;
83978404
8398− tc_for_each_action(a, exts) {
8405+ tcf_exts_to_list(exts, &actions);
8406+ list_for_each_entry(a, &actions, list) {
83998407
84008408 /* Drop action */
84018409 if (is_tcf_gact_shot(a)) {
@@ -9517,6 +9525,7 @@ skip_sriov: · 1115 unmodified lines
95179525
95189526 /* copy netdev features into list of user selectable features */
95199527 netdev->hw_features |= netdev->features |
9528+ NETIF_F_HW_VLAN_CTAG_FILTER |
95209529 NETIF_F_HW_VLAN_CTAG_RX |
95219530 NETIF_F_HW_VLAN_CTAG_TX |
95229531 NETIF_F_RXALL |
drivers/net/ethernet/mediatek/mtk_eth_soc.c+76−56
@@ -50,6 +50,10 @@ static const struct mtk_ethtool_stats { · 49 unmodified lines
5050 MTK_ETHTOOL_STAT(rx_flow_control_packets),
5151 };
5252
53+static const char * const mtk_clks_source_name[] = {
54+ "ethif", "esw", "gp1", "gp2"
55+};
56+
5357 void mtk_w32(struct mtk_eth *eth, u32 val, unsigned reg)
5458 {
5559 __raw_writel(val, eth->base + reg);
@@ -245,12 +249,16 @@ static int mtk_phy_connect(struct mtk_mac *mac) · 189 unmodified lines
245249 case PHY_INTERFACE_MODE_MII:
246250 ge_mode = 1;
247251 break;
248− case PHY_INTERFACE_MODE_RMII:
252+ case PHY_INTERFACE_MODE_REVMII:
249253 ge_mode = 2;
250254 break;
255+ case PHY_INTERFACE_MODE_RMII:
256+ if (!mac->id)
257+ goto err_phy;
258+ ge_mode = 3;
259+ break;
251260 default:
252− dev_err(eth->dev, "invalid phy_mode\n");
253− return -1;
261+ goto err_phy;
254262 }
255263
256264 /* put the gmac into the right mode */
@@ -263,19 +271,31 @@ static int mtk_phy_connect(struct mtk_mac *mac) · 6 unmodified lines
263271 mac->phy_dev->autoneg = AUTONEG_ENABLE;
264272 mac->phy_dev->speed = 0;
265273 mac->phy_dev->duplex = 0;
274+
275+ if (of_phy_is_fixed_link(mac->of_node))
276+ mac->phy_dev->supported |=
277+ SUPPORTED_Pause | SUPPORTED_Asym_Pause;
278+
266279 mac->phy_dev->supported &= PHY_GBIT_FEATURES | SUPPORTED_Pause |
267280 SUPPORTED_Asym_Pause;
268281 mac->phy_dev->advertising = mac->phy_dev->supported |
269282 ADVERTISED_Autoneg;
270283 phy_start_aneg(mac->phy_dev);
271284
285+ of_node_put(np);
286+
272287 return 0;
288+
289+err_phy:
290+ of_node_put(np);
291+ dev_err(eth->dev, "invalid phy_mode\n");
292+ return -EINVAL;
273293 }
274294
275295 static int mtk_mdio_init(struct mtk_eth *eth)
276296 {
277297 struct device_node *mii_np;
278− int err;
298+ int ret;
279299
280300 mii_np = of_get_child_by_name(eth->dev->of_node, "mdio-bus");
281301 if (!mii_np) {
@@ -284,13 +304,13 @@ static int mtk_mdio_init(struct mtk_eth *eth) · 2 unmodified lines
284304 }
285305
286306 if (!of_device_is_available(mii_np)) {
287− err = 0;
307+ ret = -ENODEV;
288308 goto err_put_node;
289309 }
290310
291− eth->mii_bus = mdiobus_alloc();
311+ eth->mii_bus = devm_mdiobus_alloc(eth->dev);
292312 if (!eth->mii_bus) {
293− err = -ENOMEM;
313+ ret = -ENOMEM;
294314 goto err_put_node;
295315 }
296316
@@ -301,19 +321,11 @@ static int mtk_mdio_init(struct mtk_eth *eth) · 4 unmodified lines
301321 eth->mii_bus->parent = eth->dev;
302322
303323 snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%s", mii_np->name);
304− err = of_mdiobus_register(eth->mii_bus, mii_np);
305− if (err)
306− goto err_free_bus;
307−
308− return 0;
309−
310−err_free_bus:
311− mdiobus_free(eth->mii_bus);
324+ ret = of_mdiobus_register(eth->mii_bus, mii_np);
312325
313326 err_put_node:
314327 of_node_put(mii_np);
315− eth->mii_bus = NULL;
316− return err;
328+ return ret;
317329 }
318330
319331 static void mtk_mdio_cleanup(struct mtk_eth *eth)
@@ -322,8 +334,6 @@ static void mtk_mdio_cleanup(struct mtk_eth *eth) · 2 unmodified lines
322334 return;
323335
324336 mdiobus_unregister(eth->mii_bus);
325− of_node_put(eth->mii_bus->dev.of_node);
326− mdiobus_free(eth->mii_bus);
327337 }
328338
329339 static inline void mtk_irq_disable(struct mtk_eth *eth, u32 mask)
@@ -542,15 +552,15 @@ static inline struct mtk_tx_buf *mtk_desc_to_tx_buf(struct mtk_tx_ring *ring, · 212 unmodified lines
542552 return &ring->buf[idx];
543553 }
544554
545−static void mtk_tx_unmap(struct device *dev, struct mtk_tx_buf *tx_buf)
555+static void mtk_tx_unmap(struct mtk_eth *eth, struct mtk_tx_buf *tx_buf)
546556 {
547557 if (tx_buf->flags & MTK_TX_FLAGS_SINGLE0) {
548− dma_unmap_single(dev,
558+ dma_unmap_single(eth->dev,
549559 dma_unmap_addr(tx_buf, dma_addr0),
550560 dma_unmap_len(tx_buf, dma_len0),
551561 DMA_TO_DEVICE);
552562 } else if (tx_buf->flags & MTK_TX_FLAGS_PAGE0) {
553− dma_unmap_page(dev,
563+ dma_unmap_page(eth->dev,
554564 dma_unmap_addr(tx_buf, dma_addr0),
555565 dma_unmap_len(tx_buf, dma_len0),
556566 DMA_TO_DEVICE);
@@ -572,14 +582,15 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev, · 15 unmodified lines
572582 dma_addr_t mapped_addr;
573583 unsigned int nr_frags;
574584 int i, n_desc = 1;
575− u32 txd4 = 0;
585+ u32 txd4 = 0, fport;
576586
577587 itxd = ring->next_free;
578588 if (itxd == ring->last_free)
579589 return -ENOMEM;
580590
581591 /* set the forward port */
582− txd4 |= (mac->id + 1) << TX_DMA_FPORT_SHIFT;
592+ fport = (mac->id + 1) << TX_DMA_FPORT_SHIFT;
593+ txd4 |= fport;
583594
584595 tx_buf = mtk_desc_to_tx_buf(ring, itxd);
585596 memset(tx_buf, 0, sizeof(*tx_buf));
@@ -595,9 +606,9 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev, · 9 unmodified lines
595606 if (skb_vlan_tag_present(skb))
596607 txd4 |= TX_DMA_INS_VLAN | skb_vlan_tag_get(skb);
597608
598− mapped_addr = dma_map_single(&dev->dev, skb->data,
609+ mapped_addr = dma_map_single(eth->dev, skb->data,
599610 skb_headlen(skb), DMA_TO_DEVICE);
600− if (unlikely(dma_mapping_error(&dev->dev, mapped_addr)))
611+ if (unlikely(dma_mapping_error(eth->dev, mapped_addr)))
601612 return -ENOMEM;
602613
603614 WRITE_ONCE(itxd->txd1, mapped_addr);
@@ -623,10 +634,10 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev, · 19 unmodified lines
623634
624635 n_desc++;
625636 frag_map_size = min(frag_size, MTK_TX_DMA_BUF_LEN);
626− mapped_addr = skb_frag_dma_map(&dev->dev, frag, offset,
637+ mapped_addr = skb_frag_dma_map(eth->dev, frag, offset,
627638 frag_map_size,
628639 DMA_TO_DEVICE);
629− if (unlikely(dma_mapping_error(&dev->dev, mapped_addr)))
640+ if (unlikely(dma_mapping_error(eth->dev, mapped_addr)))
630641 goto err_dma;
631642
632643 if (i == nr_frags - 1 &&
@@ -637,7 +648,7 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev, · 4 unmodified lines
637648 WRITE_ONCE(txd->txd3, (TX_DMA_SWC |
638649 TX_DMA_PLEN0(frag_map_size) |
639650 last_frag * TX_DMA_LS0));
640− WRITE_ONCE(txd->txd4, 0);
651+ WRITE_ONCE(txd->txd4, fport);
641652
642653 tx_buf->skb = (struct sk_buff *)MTK_DMA_DUMMY_DESC;
643654 tx_buf = mtk_desc_to_tx_buf(ring, txd);
@@ -679,7 +690,7 @@ err_dma: · 35 unmodified lines
679690 tx_buf = mtk_desc_to_tx_buf(ring, itxd);
680691
681692 /* unmap dma */
682− mtk_tx_unmap(&dev->dev, tx_buf);
693+ mtk_tx_unmap(eth, tx_buf);
683694
684695 itxd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
685696 itxd = mtk_qdma_phys_to_virt(ring, itxd->txd2);
@@ -836,11 +847,11 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, · 150 unmodified lines
836847 netdev->stats.rx_dropped++;
837848 goto release_desc;
838849 }
839− dma_addr = dma_map_single(&eth->netdev[mac]->dev,
850+ dma_addr = dma_map_single(eth->dev,
840851 new_data + NET_SKB_PAD,
841852 ring->buf_size,
842853 DMA_FROM_DEVICE);
843− if (unlikely(dma_mapping_error(&netdev->dev, dma_addr))) {
854+ if (unlikely(dma_mapping_error(eth->dev, dma_addr))) {
844855 skb_free_frag(new_data);
845856 netdev->stats.rx_dropped++;
846857 goto release_desc;
@@ -849,13 +860,13 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, · 2 unmodified lines
849860 /* receive data */
850861 skb = build_skb(data, ring->frag_size);
851862 if (unlikely(!skb)) {
852− put_page(virt_to_head_page(new_data));
863+ skb_free_frag(new_data);
853864 netdev->stats.rx_dropped++;
854865 goto release_desc;
855866 }
856867 skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN);
857868
858− dma_unmap_single(&netdev->dev, trxd.rxd1,
869+ dma_unmap_single(eth->dev, trxd.rxd1,
859870 ring->buf_size, DMA_FROM_DEVICE);
860871 pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
861872 skb->dev = netdev;
@@ -937,7 +948,7 @@ static int mtk_poll_tx(struct mtk_eth *eth, int budget) · 75 unmodified lines
937948 done[mac]++;
938949 budget--;
939950 }
940− mtk_tx_unmap(eth->dev, tx_buf);
951+ mtk_tx_unmap(eth, tx_buf);
941952
942953 ring->last_free = desc;
943954 atomic_inc(&ring->free_count);
@@ -1092,7 +1103,7 @@ static void mtk_tx_clean(struct mtk_eth *eth) · 148 unmodified lines
10921103
10931104 if (ring->buf) {
10941105 for (i = 0; i < MTK_DMA_SIZE; i++)
1095− mtk_tx_unmap(eth->dev, &ring->buf[i]);
1106+ mtk_tx_unmap(eth, &ring->buf[i]);
10961107 kfree(ring->buf);
10971108 ring->buf = NULL;
10981109 }
@@ -1490,10 +1501,7 @@ static void mtk_uninit(struct net_device *dev) · 391 unmodified lines
14901501 struct mtk_eth *eth = mac->hw;
14911502
14921503 phy_disconnect(mac->phy_dev);
1493− mtk_mdio_cleanup(eth);
14941504 mtk_irq_disable(eth, ~0);
1495− free_irq(eth->irq[1], dev);
1496− free_irq(eth->irq[2], dev);
14971505 }
14981506
14991507 static int mtk_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
@@ -1751,6 +1759,7 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) · 251 unmodified lines
17511759 goto free_netdev;
17521760 }
17531761 spin_lock_init(&mac->hw_stats->stats_lock);
1762+ u64_stats_init(&mac->hw_stats->syncp);
17541763 mac->hw_stats->reg_offset = id * MTK_STAT_OFFSET;
17551764
17561765 SET_NETDEV_DEV(eth->netdev[id], eth->dev);
@@ -1796,6 +1805,7 @@ static int mtk_probe(struct platform_device *pdev) · 39 unmodified lines
17961805 if (!eth)
17971806 return -ENOMEM;
17981807
1808+ eth->dev = &pdev->dev;
17991809 eth->base = devm_ioremap_resource(&pdev->dev, res);
18001810 if (IS_ERR(eth->base))
18011811 return PTR_ERR(eth->base);
@@ -1830,21 +1840,21 @@ static int mtk_probe(struct platform_device *pdev) · 28 unmodified lines
18301840 return -ENXIO;
18311841 }
18321842 }
1843+ for (i = 0; i < ARRAY_SIZE(eth->clks); i++) {
1844+ eth->clks[i] = devm_clk_get(eth->dev,
1845+ mtk_clks_source_name[i]);
1846+ if (IS_ERR(eth->clks[i])) {
1847+ if (PTR_ERR(eth->clks[i]) == -EPROBE_DEFER)
1848+ return -EPROBE_DEFER;
1849+ return -ENODEV;
1850+ }
1851+ }
18331852
1834− eth->clk_ethif = devm_clk_get(&pdev->dev, "ethif");
1835− eth->clk_esw = devm_clk_get(&pdev->dev, "esw");
1836− eth->clk_gp1 = devm_clk_get(&pdev->dev, "gp1");
1837− eth->clk_gp2 = devm_clk_get(&pdev->dev, "gp2");
1838− if (IS_ERR(eth->clk_esw) || IS_ERR(eth->clk_gp1) ||
1839− IS_ERR(eth->clk_gp2) || IS_ERR(eth->clk_ethif))
1840− return -ENODEV;
1841−
1842− clk_prepare_enable(eth->clk_ethif);
1843− clk_prepare_enable(eth->clk_esw);
1844− clk_prepare_enable(eth->clk_gp1);
1845− clk_prepare_enable(eth->clk_gp2);
1853+ clk_prepare_enable(eth->clks[MTK_CLK_ETHIF]);
1854+ clk_prepare_enable(eth->clks[MTK_CLK_ESW]);
1855+ clk_prepare_enable(eth->clks[MTK_CLK_GP1]);
1856+ clk_prepare_enable(eth->clks[MTK_CLK_GP2]);
18461857
1847− eth->dev = &pdev->dev;
18481858 eth->msg_enable = netif_msg_init(mtk_msg_level, MTK_DEFAULT_MSG_ENABLE);
18491859 INIT_WORK(&eth->pending_work, mtk_pending_work);
18501860
@@ -1886,15 +1896,24 @@ err_free_dev: · 35 unmodified lines
18861896 static int mtk_remove(struct platform_device *pdev)
18871897 {
18881898 struct mtk_eth *eth = platform_get_drvdata(pdev);
1899+ int i;
18891900
1890− clk_disable_unprepare(eth->clk_ethif);
1891− clk_disable_unprepare(eth->clk_esw);
1892− clk_disable_unprepare(eth->clk_gp1);
1893− clk_disable_unprepare(eth->clk_gp2);
1901+ /* stop all devices to make sure that dma is properly shut down */
1902+ for (i = 0; i < MTK_MAC_COUNT; i++) {
1903+ if (!eth->netdev[i])
1904+ continue;
1905+ mtk_stop(eth->netdev[i]);
1906+ }
1907+
1908+ clk_disable_unprepare(eth->clks[MTK_CLK_ETHIF]);
1909+ clk_disable_unprepare(eth->clks[MTK_CLK_ESW]);
1910+ clk_disable_unprepare(eth->clks[MTK_CLK_GP1]);
1911+ clk_disable_unprepare(eth->clks[MTK_CLK_GP2]);
18941912
18951913 netif_napi_del(&eth->tx_napi);
18961914 netif_napi_del(&eth->rx_napi);
18971915 mtk_cleanup(eth);
1916+ mtk_mdio_cleanup(eth);
18981917 platform_set_drvdata(pdev, NULL);
18991918
19001919 return 0;
@@ -1904,6 +1923,7 @@ const struct of_device_id of_mtk_match[] = { · 3 unmodified lines
19041923 { .compatible = "mediatek,mt7623-eth" },
19051924 {},
19061925 };
1926+MODULE_DEVICE_TABLE(of, of_mtk_match);
19071927
19081928 static struct platform_driver mtk_driver = {
19091929 .probe = mtk_probe,
drivers/net/ethernet/mediatek/mtk_eth_soc.h+14−8
@@ -290,6 +290,17 @@ enum mtk_tx_flags { · 289 unmodified lines
290290 MTK_TX_FLAGS_PAGE0 = 0x02,
291291 };
292292
293+/* This enum allows us to identify how the clock is defined on the array of the
294+ * clock in the order
295+ */
296+enum mtk_clks_map {
297+ MTK_CLK_ETHIF,
298+ MTK_CLK_ESW,
299+ MTK_CLK_GP1,
300+ MTK_CLK_GP2,
301+ MTK_CLK_MAX
302+};
303+
293304 /* struct mtk_tx_buf - This struct holds the pointers to the memory pointed at
294305 * by the TX descriptor s
295306 * @skb: The SKB pointer of the packet being sent
@@ -370,10 +381,7 @@ struct mtk_rx_ring { · 74 unmodified lines
370381 * @scratch_ring: Newer SoCs need memory for a second HW managed TX ring
371382 * @phy_scratch_ring: physical address of scratch_ring
372383 * @scratch_head: The scratch memory that scratch_ring points to.
373− * @clk_ethif: The ethif clock
374− * @clk_esw: The switch clock
375− * @clk_gp1: The gmac1 clock
376− * @clk_gp2: The gmac2 clock
384+ * @clks: clock array for all clocks required
377385 * @mii_bus: If there is a bus we need to create an instance for it
378386 * @pending_work: The workqueue used to reset the dma ring
379387 */
@@ -400,10 +408,8 @@ struct mtk_eth { · 20 unmodified lines
400408 struct mtk_tx_dma *scratch_ring;
401409 dma_addr_t phy_scratch_ring;
402410 void *scratch_head;
403− struct clk *clk_ethif;
404− struct clk *clk_esw;
405− struct clk *clk_gp1;
406− struct clk *clk_gp2;
411+ struct clk *clks[MTK_CLK_MAX];
412+
407413 struct mii_bus *mii_bus;
408414 struct work_struct pending_work;
409415 };
drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c+30−27
@@ -94,7 +94,7 @@ static u8 mlx4_en_dcbnl_getcap(struct net_device *dev, int capid, u8 *cap) · 93 unmodified lines
9494 *cap = true;
9595 break;
9696 case DCB_CAP_ATTR_DCBX:
97− *cap = priv->cee_params.dcbx_cap;
97+ *cap = priv->dcbx_cap;
9898 break;
9999 case DCB_CAP_ATTR_PFC_TCS:
100100 *cap = 1 << mlx4_max_tc(priv->mdev->dev);
@@ -111,14 +111,14 @@ static u8 mlx4_en_dcbnl_getpfcstate(struct net_device *netdev) · 10 unmodified lines
111111 {
112112 struct mlx4_en_priv *priv = netdev_priv(netdev);
113113
114− return priv->cee_params.dcb_cfg.pfc_state;
114+ return priv->cee_config.pfc_state;
115115 }
116116
117117 static void mlx4_en_dcbnl_setpfcstate(struct net_device *netdev, u8 state)
118118 {
119119 struct mlx4_en_priv *priv = netdev_priv(netdev);
120120
121− priv->cee_params.dcb_cfg.pfc_state = state;
121+ priv->cee_config.pfc_state = state;
122122 }
123123
124124 static void mlx4_en_dcbnl_get_pfc_cfg(struct net_device *netdev, int priority,
@@ -126,7 +126,7 @@ static void mlx4_en_dcbnl_get_pfc_cfg(struct net_device *netdev, int priority, · 1 unmodified line
126126 {
127127 struct mlx4_en_priv *priv = netdev_priv(netdev);
128128
129− *setting = priv->cee_params.dcb_cfg.tc_config[priority].dcb_pfc;
129+ *setting = priv->cee_config.dcb_pfc[priority];
130130 }
131131
132132 static void mlx4_en_dcbnl_set_pfc_cfg(struct net_device *netdev, int priority,
@@ -134,8 +134,8 @@ static void mlx4_en_dcbnl_set_pfc_cfg(struct net_device *netdev, int priority, · 1 unmodified line
134134 {
135135 struct mlx4_en_priv *priv = netdev_priv(netdev);
136136
137− priv->cee_params.dcb_cfg.tc_config[priority].dcb_pfc = setting;
138− priv->cee_params.dcb_cfg.pfc_state = true;
137+ priv->cee_config.dcb_pfc[priority] = setting;
138+ priv->cee_config.pfc_state = true;
139139 }
140140
141141 static int mlx4_en_dcbnl_getnumtcs(struct net_device *netdev, int tcid, u8 *num)
@@ -157,13 +157,11 @@ static u8 mlx4_en_dcbnl_set_all(struct net_device *netdev) · 15 unmodified lines
157157 {
158158 struct mlx4_en_priv *priv = netdev_priv(netdev);
159159 struct mlx4_en_dev *mdev = priv->mdev;
160− struct mlx4_en_cee_config *dcb_cfg = &priv->cee_params.dcb_cfg;
161− int err = 0;
162160
163− if (!(priv->cee_params.dcbx_cap & DCB_CAP_DCBX_VER_CEE))
164− return -EINVAL;
161+ if (!(priv->dcbx_cap & DCB_CAP_DCBX_VER_CEE))
162+ return 1;
165163
166− if (dcb_cfg->pfc_state) {
164+ if (priv->cee_config.pfc_state) {
167165 int tc;
168166
169167 priv->prof->rx_pause = 0;
@@ -171,7 +169,7 @@ static u8 mlx4_en_dcbnl_set_all(struct net_device *netdev) · 1 unmodified line
171169 for (tc = 0; tc < CEE_DCBX_MAX_PRIO; tc++) {
172170 u8 tc_mask = 1 << tc;
173171
174− switch (dcb_cfg->tc_config[tc].dcb_pfc) {
172+ switch (priv->cee_config.dcb_pfc[tc]) {
175173 case pfc_disabled:
176174 priv->prof->tx_ppp &= ~tc_mask;
177175 priv->prof->rx_ppp &= ~tc_mask;
@@ -199,15 +197,17 @@ static u8 mlx4_en_dcbnl_set_all(struct net_device *netdev) · 21 unmodified lines
199197 en_dbg(DRV, priv, "Set pfc off\n");
200198 }
201199
202− err = mlx4_SET_PORT_general(mdev->dev, priv->port,
203− priv->rx_skb_size + ETH_FCS_LEN,
204− priv->prof->tx_pause,
205− priv->prof->tx_ppp,
206− priv->prof->rx_pause,
207− priv->prof->rx_ppp);
208− if (err)
200+ if (mlx4_SET_PORT_general(mdev->dev, priv->port,
201+ priv->rx_skb_size + ETH_FCS_LEN,
202+ priv->prof->tx_pause,
203+ priv->prof->tx_ppp,
204+ priv->prof->rx_pause,
205+ priv->prof->rx_ppp)) {
209206 en_err(priv, "Failed setting pause params\n");
210− return err;
207+ return 1;
208+ }
209+
210+ return 0;
211211 }
212212
213213 static u8 mlx4_en_dcbnl_get_state(struct net_device *dev)
@@ -225,7 +225,7 @@ static u8 mlx4_en_dcbnl_set_state(struct net_device *dev, u8 state) · 11 unmodified lines
225225 struct mlx4_en_priv *priv = netdev_priv(dev);
226226 int num_tcs = 0;
227227
228− if (!(priv->cee_params.dcbx_cap & DCB_CAP_DCBX_VER_CEE))
228+ if (!(priv->dcbx_cap & DCB_CAP_DCBX_VER_CEE))
229229 return 1;
230230
231231 if (!!(state) == !!(priv->flags & MLX4_EN_FLAG_DCB_ENABLED))
@@ -238,7 +238,10 @@ static u8 mlx4_en_dcbnl_set_state(struct net_device *dev, u8 state) · 6 unmodified lines
238238 priv->flags &= ~MLX4_EN_FLAG_DCB_ENABLED;
239239 }
240240
241− return mlx4_en_setup_tc(dev, num_tcs);
241+ if (mlx4_en_setup_tc(dev, num_tcs))
242+ return 1;
243+
244+ return 0;
242245 }
243246
244247 /* On success returns a non-zero 802.1p user priority bitmap
@@ -252,7 +255,7 @@ static int mlx4_en_dcbnl_getapp(struct net_device *netdev, u8 idtype, u16 id) · 7 unmodified lines
252255 .selector = idtype,
253256 .protocol = id,
254257 };
255− if (!(priv->cee_params.dcbx_cap & DCB_CAP_DCBX_VER_CEE))
258+ if (!(priv->dcbx_cap & DCB_CAP_DCBX_VER_CEE))
256259 return 0;
257260
258261 return dcb_getapp(netdev, &app);
@@ -264,7 +267,7 @@ static int mlx4_en_dcbnl_setapp(struct net_device *netdev, u8 idtype, · 5 unmodified lines
264267 struct mlx4_en_priv *priv = netdev_priv(netdev);
265268 struct dcb_app app;
266269
267− if (!(priv->cee_params.dcbx_cap & DCB_CAP_DCBX_VER_CEE))
270+ if (!(priv->dcbx_cap & DCB_CAP_DCBX_VER_CEE))
268271 return -EINVAL;
269272
270273 memset(&app, 0, sizeof(struct dcb_app));
@@ -433,7 +436,7 @@ static u8 mlx4_en_dcbnl_getdcbx(struct net_device *dev) · 162 unmodified lines
433436 {
434437 struct mlx4_en_priv *priv = netdev_priv(dev);
435438
436− return priv->cee_params.dcbx_cap;
439+ return priv->dcbx_cap;
437440 }
438441
439442 static u8 mlx4_en_dcbnl_setdcbx(struct net_device *dev, u8 mode)
@@ -442,7 +445,7 @@ static u8 mlx4_en_dcbnl_setdcbx(struct net_device *dev, u8 mode) · 2 unmodified lines
442445 struct ieee_ets ets = {0};
443446 struct ieee_pfc pfc = {0};
444447
445− if (mode == priv->cee_params.dcbx_cap)
448+ if (mode == priv->dcbx_cap)
446449 return 0;
447450
448451 if ((mode & DCB_CAP_DCBX_LLD_MANAGED) ||
@@ -451,7 +454,7 @@ static u8 mlx4_en_dcbnl_setdcbx(struct net_device *dev, u8 mode) · 2 unmodified lines
451454 !(mode & DCB_CAP_DCBX_HOST))
452455 goto err;
453456
454− priv->cee_params.dcbx_cap = mode;
457+ priv->dcbx_cap = mode;
455458
456459 ets.ets_cap = IEEE_8021QAZ_MAX_TCS;
457460 pfc.pfc_cap = IEEE_8021QAZ_MAX_TCS;
drivers/net/ethernet/mellanox/mlx4/en_netdev.c+8−13
@@ -71,10 +71,11 @@ int mlx4_en_setup_tc(struct net_device *dev, u8 up) · 70 unmodified lines
7171 #ifdef CONFIG_MLX4_EN_DCB
7272 if (!mlx4_is_slave(priv->mdev->dev)) {
7373 if (up) {
74− priv->flags |= MLX4_EN_FLAG_DCB_ENABLED;
74+ if (priv->dcbx_cap)
75+ priv->flags |= MLX4_EN_FLAG_DCB_ENABLED;
7576 } else {
7677 priv->flags &= ~MLX4_EN_FLAG_DCB_ENABLED;
77− priv->cee_params.dcb_cfg.pfc_state = false;
78+ priv->cee_config.pfc_state = false;
7879 }
7980 }
8081 #endif /* CONFIG_MLX4_EN_DCB */
@@ -3048,9 +3049,6 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, · 2967 unmodified lines
30483049 struct mlx4_en_priv *priv;
30493050 int i;
30503051 int err;
3051−#ifdef CONFIG_MLX4_EN_DCB
3052− struct tc_configuration *tc;
3053−#endif
30543052
30553053 dev = alloc_etherdev_mqs(sizeof(struct mlx4_en_priv),
30563054 MAX_TX_RINGS, MAX_RX_RINGS);
@@ -3117,16 +3115,13 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, · 60 unmodified lines
31173115 priv->msg_enable = MLX4_EN_MSG_LEVEL;
31183116 #ifdef CONFIG_MLX4_EN_DCB
31193117 if (!mlx4_is_slave(priv->mdev->dev)) {
3120− priv->cee_params.dcbx_cap = DCB_CAP_DCBX_VER_CEE |
3121− DCB_CAP_DCBX_HOST |
3122− DCB_CAP_DCBX_VER_IEEE;
3118+ priv->dcbx_cap = DCB_CAP_DCBX_VER_CEE | DCB_CAP_DCBX_HOST |
3119+ DCB_CAP_DCBX_VER_IEEE;
31233120 priv->flags |= MLX4_EN_DCB_ENABLED;
3124− priv->cee_params.dcb_cfg.pfc_state = false;
3121+ priv->cee_config.pfc_state = false;
31253122
3126− for (i = 0; i < MLX4_EN_NUM_UP; i++) {
3127− tc = &priv->cee_params.dcb_cfg.tc_config[i];
3128− tc->dcb_pfc = pfc_disabled;
3129− }
3123+ for (i = 0; i < MLX4_EN_NUM_UP; i++)
3124+ priv->cee_config.dcb_pfc[i] = pfc_disabled;
31303125
31313126 if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ETS_CFG) {
31323127 dev->dcbnl_ops = &mlx4_en_dcbnl_ops;
drivers/net/ethernet/mellanox/mlx4/en_tx.c+7−5
@@ -818,7 +818,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) · 817 unmodified lines
818818 real_size = get_real_size(skb, shinfo, dev, &lso_header_size,
819819 &inline_ok, &fragptr);
820820 if (unlikely(!real_size))
821− goto tx_drop;
821+ goto tx_drop_count;
822822
823823 /* Align descriptor to TXBB size */
824824 desc_size = ALIGN(real_size, TXBB_SIZE);
@@ -826,7 +826,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) · 1 unmodified line
826826 if (unlikely(nr_txbb > MAX_DESC_TXBBS)) {
827827 if (netif_msg_tx_err(priv))
828828 en_warn(priv, "Oversized header or SG list\n");
829− goto tx_drop;
829+ goto tx_drop_count;
830830 }
831831
832832 bf_ok = ring->bf_enabled;
@@ -1071,9 +1071,10 @@ tx_drop_unmap: · 238 unmodified lines
10711071 PCI_DMA_TODEVICE);
10721072 }
10731073
1074+tx_drop_count:
1075+ ring->tx_dropped++;
10741076 tx_drop:
10751077 dev_kfree_skb_any(skb);
1076− ring->tx_dropped++;
10771078 return NETDEV_TX_OK;
10781079 }
10791080
@@ -1106,7 +1107,7 @@ netdev_tx_t mlx4_en_xmit_frame(struct mlx4_en_rx_alloc *frame, · 26 unmodified lines
11061107 goto tx_drop;
11071108
11081109 if (mlx4_en_is_tx_ring_full(ring))
1109− goto tx_drop;
1110+ goto tx_drop_count;
11101111
11111112 /* fetch ring->cons far ahead before needing it to avoid stall */
11121113 ring_cons = READ_ONCE(ring->cons);
@@ -1176,7 +1177,8 @@ netdev_tx_t mlx4_en_xmit_frame(struct mlx4_en_rx_alloc *frame, · 63 unmodified lines
11761177
11771178 return NETDEV_TX_OK;
11781179
1179−tx_drop:
1180+tx_drop_count:
11801181 ring->tx_dropped++;
1182+tx_drop:
11811183 return NETDEV_TX_BUSY;
11821184 }
drivers/net/ethernet/mellanox/mlx4/eq.c+2−2
@@ -1305,8 +1305,8 @@ int mlx4_init_eq_table(struct mlx4_dev *dev) · 1304 unmodified lines
13051305 return 0;
13061306
13071307 err_out_unmap:
1308− while (i >= 0)
1309− mlx4_free_eq(dev, &priv->eq_table.eq[i--]);
1308+ while (i > 0)
1309+ mlx4_free_eq(dev, &priv->eq_table.eq[--i]);
13101310 #ifdef CONFIG_RFS_ACCEL
13111311 for (i = 1; i <= dev->caps.num_ports; i++) {
13121312 if (mlx4_priv(dev)->port[i].rmap) {
drivers/net/ethernet/mellanox/mlx4/main.c+3−0
@@ -2970,6 +2970,7 @@ static int mlx4_init_port_info(struct mlx4_dev *dev, int port) · 2969 unmodified lines
29702970 mlx4_err(dev, "Failed to create mtu file for port %d\n", port);
29712971 device_remove_file(&info->dev->persist->pdev->dev,
29722972 &info->port_attr);
2973+ devlink_port_unregister(&info->devlink_port);
29732974 info->port = -1;
29742975 }
29752976
@@ -2984,6 +2985,8 @@ static void mlx4_cleanup_port_info(struct mlx4_port_info *info) · 8 unmodified lines
29842985 device_remove_file(&info->dev->persist->pdev->dev, &info->port_attr);
29852986 device_remove_file(&info->dev->persist->pdev->dev,
29862987 &info->port_mtu_attr);
2988+ devlink_port_unregister(&info->devlink_port);
2989+
29872990 #ifdef CONFIG_RFS_ACCEL
29882991 free_irq_cpu_rmap(info->rmap);
29892992 info->rmap = NULL;
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h+3−12
@@ -482,20 +482,10 @@ enum dcb_pfc_type { · 481 unmodified lines
482482 pfc_enabled_rx
483483 };
484484
485−struct tc_configuration {
486− enum dcb_pfc_type dcb_pfc;
487−};
488−
489485 struct mlx4_en_cee_config {
490486 bool pfc_state;
491− struct tc_configuration tc_config[MLX4_EN_NUM_UP];
487+ enum dcb_pfc_type dcb_pfc[MLX4_EN_NUM_UP];
492488 };
493−
494−struct mlx4_en_cee_params {
495− u8 dcbx_cap;
496− struct mlx4_en_cee_config dcb_cfg;
497−};
498−
499489 #endif
500490
501491 struct ethtool_flow_id {
@@ -624,7 +614,8 @@ struct mlx4_en_priv { · 122 unmodified lines
624614 struct ieee_ets ets;
625615 u16 maxrate[IEEE_8021QAZ_MAX_TCS];
626616 enum dcbnl_cndd_states cndd_state[IEEE_8021QAZ_MAX_TCS];
627− struct mlx4_en_cee_params cee_params;
617+ struct mlx4_en_cee_config cee_config;
618+ u8 dcbx_cap;
628619 #endif
629620 #ifdef CONFIG_RFS_ACCEL
630621 spinlock_t filters_lock;
drivers/net/ethernet/mellanox/mlx4/port.c+2−2
@@ -52,7 +52,7 @@ · 51 unmodified lines
5252
5353 #define MLX4_FLAG_V_IGNORE_FCS_MASK 0x2
5454 #define MLX4_IGNORE_FCS_MASK 0x1
55−#define MLNX4_TX_MAX_NUMBER 8
55+#define MLX4_TC_MAX_NUMBER 8
5656
5757 void mlx4_init_mac_table(struct mlx4_dev *dev, struct mlx4_mac_table *table)
5858 {
@@ -2022,7 +2022,7 @@ int mlx4_max_tc(struct mlx4_dev *dev) · 1963 unmodified lines
20222022 u8 num_tc = dev->caps.max_tc_eth;
20232023
20242024 if (!num_tc)
2025− num_tc = MLNX4_TX_MAX_NUMBER;
2025+ num_tc = MLX4_TC_MAX_NUMBER;
20262026
20272027 return num_tc;
20282028 }
drivers/net/ethernet/mellanox/mlx5/core/cmd.c+54−31
@@ -143,13 +143,14 @@ static struct mlx5_cmd_layout *get_inst(struct mlx5_cmd *cmd, int idx) · 142 unmodified lines
143143 return cmd->cmd_buf + (idx << cmd->log_stride);
144144 }
145145
146−static u8 xor8_buf(void *buf, int len)
146+static u8 xor8_buf(void *buf, size_t offset, int len)
147147 {
148148 u8 *ptr = buf;
149149 u8 sum = 0;
150150 int i;
151+ int end = len + offset;
151152
152− for (i = 0; i < len; i++)
153+ for (i = offset; i < end; i++)
153154 sum ^= ptr[i];
154155
155156 return sum;
@@ -157,41 +158,49 @@ static u8 xor8_buf(void *buf, int len) · 1 unmodified line
157158
158159 static int verify_block_sig(struct mlx5_cmd_prot_block *block)
159160 {
160− if (xor8_buf(block->rsvd0, sizeof(*block) - sizeof(block->data) - 1) != 0xff)
161+ size_t rsvd0_off = offsetof(struct mlx5_cmd_prot_block, rsvd0);
162+ int xor_len = sizeof(*block) - sizeof(block->data) - 1;
163+
164+ if (xor8_buf(block, rsvd0_off, xor_len) != 0xff)
161165 return -EINVAL;
162166
163− if (xor8_buf(block, sizeof(*block)) != 0xff)
167+ if (xor8_buf(block, 0, sizeof(*block)) != 0xff)
164168 return -EINVAL;
165169
166170 return 0;
167171 }
168172
169−static void calc_block_sig(struct mlx5_cmd_prot_block *block, u8 token,
170− int csum)
173+static void calc_block_sig(struct mlx5_cmd_prot_block *block)
171174 {
172− block->token = token;
173− if (csum) {
174− block->ctrl_sig = ~xor8_buf(block->rsvd0, sizeof(*block) -
175− sizeof(block->data) - 2);
176− block->sig = ~xor8_buf(block, sizeof(*block) - 1);
177− }
175+ int ctrl_xor_len = sizeof(*block) - sizeof(block->data) - 2;
176+ size_t rsvd0_off = offsetof(struct mlx5_cmd_prot_block, rsvd0);
177+
178+ block->ctrl_sig = ~xor8_buf(block, rsvd0_off, ctrl_xor_len);
179+ block->sig = ~xor8_buf(block, 0, sizeof(*block) - 1);
178180 }
179181
180−static void calc_chain_sig(struct mlx5_cmd_msg *msg, u8 token, int csum)
182+static void calc_chain_sig(struct mlx5_cmd_msg *msg)
181183 {
182184 struct mlx5_cmd_mailbox *next = msg->next;
183−
184− while (next) {
185− calc_block_sig(next->buf, token, csum);
185+ int size = msg->len;
186+ int blen = size - min_t(int, sizeof(msg->first.data), size);
187+ int n = (blen + MLX5_CMD_DATA_BLOCK_SIZE - 1)
188+ / MLX5_CMD_DATA_BLOCK_SIZE;
189+ int i = 0;
190+
191+ for (i = 0; i < n && next; i++) {
192+ calc_block_sig(next->buf);
186193 next = next->next;
187194 }
188195 }
189196
190197 static void set_signature(struct mlx5_cmd_work_ent *ent, int csum)
191198 {
192− ent->lay->sig = ~xor8_buf(ent->lay, sizeof(*ent->lay));
193− calc_chain_sig(ent->in, ent->token, csum);
194− calc_chain_sig(ent->out, ent->token, csum);
199+ ent->lay->sig = ~xor8_buf(ent->lay, 0, sizeof(*ent->lay));
200+ if (csum) {
201+ calc_chain_sig(ent->in);
202+ calc_chain_sig(ent->out);
203+ }
195204 }
196205
197206 static void poll_timeout(struct mlx5_cmd_work_ent *ent)
@@ -222,12 +231,17 @@ static int verify_signature(struct mlx5_cmd_work_ent *ent) · 24 unmodified lines
222231 struct mlx5_cmd_mailbox *next = ent->out->next;
223232 int err;
224233 u8 sig;
234+ int size = ent->out->len;
235+ int blen = size - min_t(int, sizeof(ent->out->first.data), size);
236+ int n = (blen + MLX5_CMD_DATA_BLOCK_SIZE - 1)
237+ / MLX5_CMD_DATA_BLOCK_SIZE;
238+ int i = 0;
225239
226− sig = xor8_buf(ent->lay, sizeof(*ent->lay));
240+ sig = xor8_buf(ent->lay, 0, sizeof(*ent->lay));
227241 if (sig != 0xff)
228242 return -EINVAL;
229243
230− while (next) {
244+ for (i = 0; i < n && next; i++) {
231245 err = verify_block_sig(next->buf);
232246 if (err)
233247 return err;
@@ -656,7 +670,6 @@ static void cmd_work_handler(struct work_struct *work) · 422 unmodified lines
656670 spin_unlock_irqrestore(&cmd->alloc_lock, flags);
657671 }
658672
659− ent->token = alloc_token(cmd);
660673 cmd->ent_arr[ent->idx] = ent;
661674 lay = get_inst(cmd, ent->idx);
662675 ent->lay = lay;
@@ -766,7 +779,8 @@ static u8 *get_status_ptr(struct mlx5_outbox_hdr *out) · 103 unmodified lines
766779 static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *in,
767780 struct mlx5_cmd_msg *out, void *uout, int uout_size,
768781 mlx5_cmd_cbk_t callback,
769− void *context, int page_queue, u8 *status)
782+ void *context, int page_queue, u8 *status,
783+ u8 token)
770784 {
771785 struct mlx5_cmd *cmd = &dev->cmd;
772786 struct mlx5_cmd_work_ent *ent;
@@ -783,6 +797,8 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *in, · 10 unmodified lines
783797 if (IS_ERR(ent))
784798 return PTR_ERR(ent);
785799
800+ ent->token = token;
801+
786802 if (!callback)
787803 init_completion(&ent->done);
788804
@@ -854,7 +870,8 @@ static const struct file_operations fops = { · 65 unmodified lines
854870 .write = dbg_write,
855871 };
856872
857−static int mlx5_copy_to_msg(struct mlx5_cmd_msg *to, void *from, int size)
873+static int mlx5_copy_to_msg(struct mlx5_cmd_msg *to, void *from, int size,
874+ u8 token)
858875 {
859876 struct mlx5_cmd_prot_block *block;
860877 struct mlx5_cmd_mailbox *next;
@@ -880,6 +897,7 @@ static int mlx5_copy_to_msg(struct mlx5_cmd_msg *to, void *from, int size) · 19 unmodified lines
880897 memcpy(block->data, from, copy);
881898 from += copy;
882899 size -= copy;
900+ block->token = token;
883901 next = next->next;
884902 }
885903
@@ -949,7 +967,8 @@ static void free_cmd_box(struct mlx5_core_dev *dev, · 63 unmodified lines
949967 }
950968
951969 static struct mlx5_cmd_msg *mlx5_alloc_cmd_msg(struct mlx5_core_dev *dev,
952− gfp_t flags, int size)
970+ gfp_t flags, int size,
971+ u8 token)
953972 {
954973 struct mlx5_cmd_mailbox *tmp, *head = NULL;
955974 struct mlx5_cmd_prot_block *block;
@@ -978,6 +997,7 @@ static struct mlx5_cmd_msg *mlx5_alloc_cmd_msg(struct mlx5_core_dev *dev, · 22 unmodified lines
978997 tmp->next = head;
979998 block->next = cpu_to_be64(tmp->next ? tmp->next->dma : 0);
980999 block->block_num = cpu_to_be32(n - i - 1);
1000+ block->token = token;
9811001 head = tmp;
9821002 }
9831003 msg->next = head;
@@ -1352,7 +1372,7 @@ static struct mlx5_cmd_msg *alloc_msg(struct mlx5_core_dev *dev, int in_size, · 368 unmodified lines
13521372 }
13531373
13541374 if (IS_ERR(msg))
1355− msg = mlx5_alloc_cmd_msg(dev, gfp, in_size);
1375+ msg = mlx5_alloc_cmd_msg(dev, gfp, in_size, 0);
13561376
13571377 return msg;
13581378 }
@@ -1377,6 +1397,7 @@ static int cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out, · 18 unmodified lines
13771397 int err;
13781398 u8 status = 0;
13791399 u32 drv_synd;
1400+ u8 token;
13801401
13811402 if (pci_channel_offline(dev->pdev) ||
13821403 dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) {
@@ -1395,20 +1416,22 @@ static int cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out, · 12 unmodified lines
13951416 return err;
13961417 }
13971418
1398− err = mlx5_copy_to_msg(inb, in, in_size);
1419+ token = alloc_token(&dev->cmd);
1420+
1421+ err = mlx5_copy_to_msg(inb, in, in_size, token);
13991422 if (err) {
14001423 mlx5_core_warn(dev, "err %d\n", err);
14011424 goto out_in;
14021425 }
14031426
1404− outb = mlx5_alloc_cmd_msg(dev, gfp, out_size);
1427+ outb = mlx5_alloc_cmd_msg(dev, gfp, out_size, token);
14051428 if (IS_ERR(outb)) {
14061429 err = PTR_ERR(outb);
14071430 goto out_in;
14081431 }
14091432
14101433 err = mlx5_cmd_invoke(dev, inb, outb, out, out_size, callback, context,
1411− pages_queue, &status);
1434+ pages_queue, &status, token);
14121435 if (err)
14131436 goto out_out;
14141437
@@ -1476,7 +1499,7 @@ static int create_msg_cache(struct mlx5_core_dev *dev) · 61 unmodified lines
14761499 INIT_LIST_HEAD(&cmd->cache.med.head);
14771500
14781501 for (i = 0; i < NUM_LONG_LISTS; i++) {
1479− msg = mlx5_alloc_cmd_msg(dev, GFP_KERNEL, LONG_LIST_SIZE);
1502+ msg = mlx5_alloc_cmd_msg(dev, GFP_KERNEL, LONG_LIST_SIZE, 0);
14801503 if (IS_ERR(msg)) {
14811504 err = PTR_ERR(msg);
14821505 goto ex_err;
@@ -1486,7 +1509,7 @@ static int create_msg_cache(struct mlx5_core_dev *dev) · 3 unmodified lines
14861509 }
14871510
14881511 for (i = 0; i < NUM_MED_LISTS; i++) {
1489− msg = mlx5_alloc_cmd_msg(dev, GFP_KERNEL, MED_LIST_SIZE);
1512+ msg = mlx5_alloc_cmd_msg(dev, GFP_KERNEL, MED_LIST_SIZE, 0);

3 more lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx5/core/en.h+9−12

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

drivers/net/ethernet/mellanox/mlx5/core/en_common.c+4−3

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

drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c+16−5

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

drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c+90−11

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

drivers/net/ethernet/mellanox/mlx5/core/en_main.c+52−60

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

drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+2−3

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

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c+30−33

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

drivers/net/ethernet/mellanox/mlx5/core/en_stats.h+4−0

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

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+10−4

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

drivers/net/ethernet/mellanox/mlx5/core/en_tx.c+34−34

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

drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c+4−2

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c+10−7

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch.h+1−0

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+34−12

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

drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c+2−2

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

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c+1−1

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

drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c+10−1

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

drivers/net/ethernet/mellanox/mlx5/core/main.c+29−30

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

drivers/net/ethernet/mellanox/mlxsw/port.h+1−0

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

drivers/net/ethernet/mellanox/mlxsw/reg.h+11−0

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

drivers/net/ethernet/mellanox/mlxsw/spectrum.c+124−60

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

drivers/net/ethernet/mellanox/mlxsw/spectrum.h+2−2

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c+5−9

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c+6−4

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+107−58

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c+19−51

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

drivers/net/ethernet/mellanox/mlxsw/trap.h+4−0

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

drivers/net/ethernet/netronome/nfp/nfp_net_common.c+6−7

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

drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c+0−1

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

drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c+2−5

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

drivers/net/ethernet/nxp/lpc_eth.c+9−11

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

drivers/net/ethernet/qlogic/qed/qed.h+10−1

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

drivers/net/ethernet/qlogic/qed/qed_dcbx.c+185−56

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

drivers/net/ethernet/qlogic/qed/qed_hsi.h+8−0

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

drivers/net/ethernet/qlogic/qed/qed_mcp.c+2−2

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

drivers/net/ethernet/qlogic/qede/qede_main.c+6−2

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic.h+2−2

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

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

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h+5−4

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c+55−40

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

drivers/net/ethernet/realtek/8139cp.c+1−1

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

drivers/net/ethernet/renesas/sh_eth.c+7−0

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

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

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

drivers/net/ethernet/smsc/smc91x.c+7−0

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

drivers/net/ethernet/smsc/smc91x.h+47−20

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

drivers/net/ethernet/smsc/smsc911x.c+104−109

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

drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c+1−1

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

drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c+1−1

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

drivers/net/ethernet/synopsys/dwc_eth_qos.c+28−27

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

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

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

drivers/net/ethernet/ti/cpsw.c+2−0

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

drivers/net/ethernet/tundra/tsi108_eth.c+2−0

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

drivers/net/ethernet/xilinx/xilinx_emaclite.c+5−3

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

drivers/net/hyperv/hyperv_net.h+9−15

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

drivers/net/hyperv/netvsc.c+8−11

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

drivers/net/hyperv/netvsc_drv.c+49−56

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

drivers/net/macsec.c+44−8

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

drivers/net/macvlan.c+1−1

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

drivers/net/macvtap.c+1−4

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

drivers/net/phy/Kconfig+1−0

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

drivers/net/phy/mdio-xgene.c+2−4

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

drivers/net/phy/micrel.c+20−9

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

drivers/net/phy/phy.c+4−2

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

drivers/net/team/team_mode_loadbalance.c+15−0

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

drivers/net/tun.c+1−5

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

drivers/net/usb/kaweth.c+7−3

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

drivers/net/usb/r8152.c+146−135

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

drivers/net/vmxnet3/vmxnet3_drv.c+3−1

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

drivers/net/vmxnet3/vmxnet3_int.h+2−2

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

drivers/net/vxlan.c+32−40

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

drivers/net/wireless/ath/ath10k/htt_rx.c+5−5

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

drivers/net/wireless/ath/ath10k/pci.c+0−1

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

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

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

drivers/net/wireless/ath/ath9k/main.c+12−6

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c+14−14

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h+1−1

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c+1−1

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c+5−3

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h+1−1

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

drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c+2−1

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

drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.h+2−1

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

drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c+1−0

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

drivers/net/wireless/intel/iwlwifi/mvm/mvm.h+2−0

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

drivers/net/wireless/intel/iwlwifi/mvm/tx.c+9−10

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

drivers/net/wireless/marvell/mwifiex/11n_aggr.c+2−1

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

drivers/net/wireless/ti/wlcore/main.c+3−2

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

drivers/net/xen-netback/xenbus.c+30−16

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

drivers/nvdimm/bus.c+5−1

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

drivers/nvme/host/Kconfig+2−2

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

drivers/nvme/host/core.c+7−4

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

drivers/nvme/host/fabrics.c+16−7

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

drivers/nvme/host/fabrics.h+1−1

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

drivers/nvme/host/pci.c+8−1

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

drivers/nvme/host/rdma.c+98−90

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

drivers/nvme/target/Kconfig+1−1

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

drivers/nvme/target/loop.c+2−2

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

drivers/nvme/target/rdma.c+4−3

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

drivers/of/base.c+3−11

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

drivers/of/fdt.c+1−1

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

drivers/of/irq.c+3−2

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

drivers/of/platform.c+2−0

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

drivers/pci/host-bridge.c+1−0

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

drivers/pci/msi.c+10−8

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

drivers/pci/quirks.c+5−2

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

drivers/pci/remove.c+1−2

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

drivers/pcmcia/ds.c+7−5

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

drivers/pcmcia/pxa2xx_base.c+5−4

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

drivers/pcmcia/pxa2xx_base.h+1−1

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

drivers/pcmcia/sa1111_badge4.c+8−14

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

drivers/pcmcia/sa1111_generic.c+17−5

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

drivers/pcmcia/sa1111_jornada720.c+10−15

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

drivers/pcmcia/sa1111_lubbock.c+13−19

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

drivers/pcmcia/sa1111_neponset.c+10−16

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

drivers/pcmcia/sa11xx_base.c+4−4

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

drivers/pcmcia/soc_common.c+1−1

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

drivers/perf/arm_pmu.c+2−1

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

drivers/phy/phy-brcm-sata.c+1−1

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

drivers/phy/phy-sun4i-usb.c+46−22

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

drivers/phy/phy-sun9i-usb.c+2−2

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

drivers/pinctrl/intel/pinctrl-cherryview.c+2−3

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

drivers/pinctrl/intel/pinctrl-merrifield.c+1−0

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

drivers/pinctrl/meson/pinctrl-meson.c+1−7

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

drivers/pinctrl/pinctrl-amd.c+0−20

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

drivers/pinctrl/pinctrl-pistachio.c+7−14

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

drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c+2−2

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

drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c+2−2

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

drivers/platform/olpc/olpc-ec.c+3−5

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

drivers/platform/x86/intel_pmic_gpio.c+2−6

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

drivers/power/max17042_battery.c+9−6

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

drivers/power/reset/Kconfig+1−1

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

drivers/power/reset/hisi-reboot.c+4−1

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

drivers/power/tps65217_charger.c+1−0

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

drivers/rapidio/devices/tsi721.c+1−1

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

drivers/rapidio/rio_cm.c+16−3

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

drivers/regulator/max14577-regulator.c+2−2

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

drivers/regulator/max77693-regulator.c+2−2

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

drivers/regulator/qcom_smd-regulator.c+16−14

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

drivers/s390/block/dasd.c+9−1

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

drivers/s390/block/dasd_eckd.c+10−0

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

drivers/s390/cio/device.c+0−2

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

drivers/s390/cio/device_status.c+4−3

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

drivers/s390/cio/io_sch.h+0−1

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

drivers/s390/cio/qdio_main.c+57−56

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

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

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

drivers/s390/net/qeth_core_main.c+31−1

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

drivers/s390/net/qeth_l2_main.c+3−3

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

drivers/s390/net/qeth_l3_main.c+20−9

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

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

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

drivers/scsi/aacraid/commctrl.c+11−2

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

drivers/scsi/constants.c+3−2

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

drivers/scsi/fcoe/fcoe_ctlr.c+1−1

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

drivers/scsi/megaraid/megaraid_sas_base.c+3−3

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

drivers/scsi/megaraid/megaraid_sas_fusion.c+1−1

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

drivers/scsi/mpt3sas/mpt3sas_base.c+11−11

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

drivers/scsi/scsi_devinfo.c+4−0

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

drivers/scsi/scsi_transport_sas.c+0−16

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

drivers/scsi/ses.c+3−2

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

drivers/scsi/wd719x.c+1−1

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

drivers/spi/spi-img-spfi.c+0−2

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

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

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

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

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

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

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

drivers/spi/spi-sh-msiof.c+3−0

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

drivers/spi/spi.c+8−2

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

drivers/staging/comedi/drivers/adv_pci1760.c+1−0

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

drivers/staging/comedi/drivers/comedi_test.c+12−34

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

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

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

drivers/staging/comedi/drivers/dt2811.c+2−2

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

drivers/staging/comedi/drivers/ni_mio_common.c+10−2

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

drivers/staging/iio/impedance-analyzer/ad5933.c+1−1

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

drivers/staging/lustre/lustre/llite/namei.c+24−19

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

drivers/staging/media/cec/TODO+1−0

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

drivers/staging/media/cec/cec-adap.c+18−8

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

drivers/staging/media/cec/cec-api.c+6−6

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

drivers/staging/media/cec/cec-core.c+15−12

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

drivers/staging/media/pulse8-cec/pulse8-cec.c+5−5

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

drivers/staging/wilc1000/host_interface.c+1−2

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

drivers/staging/wilc1000/linux_wlan.c+1−1

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

drivers/staging/wilc1000/wilc_wfi_cfgoperations.c+2−2

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

drivers/thermal/cpu_cooling.c+16−5

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

drivers/thermal/imx_thermal.c+1−3

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

drivers/thermal/int340x_thermal/int3406_thermal.c+0−1

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

drivers/thermal/rcar_thermal.c+1−0

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

drivers/thunderbolt/nhi.c+6−0

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

drivers/thunderbolt/switch.c+3−1

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

drivers/tty/serial/8250/8250.h+1−34

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

drivers/tty/serial/8250/8250_core.c+0−9

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

drivers/tty/serial/8250/8250_fintek.c+2−2

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

drivers/tty/serial/8250/8250_mid.c+3−0

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

drivers/tty/serial/8250/8250_omap.c+13−18

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

drivers/tty/serial/8250/8250_pci.c+139−0

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

drivers/tty/serial/8250/8250_port.c+1−6

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

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

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

drivers/usb/chipidea/udc.c+14−2

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

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

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

drivers/usb/class/cdc-acm.h+0−1

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

drivers/usb/core/config.c+80−14

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

drivers/usb/core/devio.c+16−7

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

drivers/usb/core/hub.c+9−14

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

drivers/usb/dwc2/core.h+1−0

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

drivers/usb/dwc2/platform.c+22−0

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

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

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

drivers/usb/dwc3/debug.h+1−1

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

drivers/usb/dwc3/dwc3-of-simple.c+1−0

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

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

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

drivers/usb/dwc3/gadget.c+36−25

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

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

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

drivers/usb/gadget/configfs.c+2−0

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

drivers/usb/gadget/function/f_eem.c+8−4

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

drivers/usb/gadget/function/f_rndis.c+3−0

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

drivers/usb/gadget/function/rndis.c+6−0

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

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

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

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

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

drivers/usb/gadget/function/uvc_configfs.c+1−1

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

drivers/usb/gadget/legacy/inode.c+2−2

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

drivers/usb/gadget/udc/core.c+5−2

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

drivers/usb/gadget/udc/fsl_qe_udc.c+3−6

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

drivers/usb/gadget/udc/renesas_usb3.c+2−0

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

drivers/usb/host/ehci-hcd.c+2−2

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

drivers/usb/host/max3421-hcd.c+1−1

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

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

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

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

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

drivers/usb/host/xhci-ring.c+14−8

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

drivers/usb/misc/ftdi-elan.c+5−5

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

drivers/usb/misc/usbtest.c+5−4

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

drivers/usb/musb/Kconfig+1−1

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

drivers/usb/musb/musb_virthub.c+6−1

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

drivers/usb/phy/phy-generic.c+6−2

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

drivers/usb/phy/phy-omap-otg.c+2−0

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

drivers/usb/renesas_usbhs/common.c+2−1

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

drivers/usb/renesas_usbhs/fifo.c+2−2

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

drivers/usb/renesas_usbhs/mod.c+9−2

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

drivers/usb/renesas_usbhs/mod_gadget.c+6−3

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

drivers/usb/serial/ftdi_sio.c+3−0

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

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

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

drivers/usb/serial/mos7720.c+1−1

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

drivers/usb/serial/mos7840.c+2−2

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

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

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

drivers/usb/serial/usb-serial-simple.c+2−1

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

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

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

drivers/vhost/scsi.c+3−3

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

drivers/vhost/test.c+4−4

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

drivers/virtio/virtio_ring.c+1−1

This diff is large: its 9 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/afs/cmservice.c+34−44

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

fs/afs/fsclient.c+72−149

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

fs/afs/internal.h+13−1

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

fs/afs/rxrpc.c+45−28

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

fs/afs/vlclient.c+4−7

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

fs/aio.c+6−1

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

fs/autofs4/expire.c+42−13

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

fs/binfmt_elf.c+1−1

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

fs/block_dev.c+3−2

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

fs/btrfs/backref.c+1−0

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

fs/btrfs/ctree.h+5−1

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

fs/btrfs/delayed-ref.c+2−5

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

fs/btrfs/disk-io.c+51−5

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

fs/btrfs/disk-io.h+2−0

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

fs/btrfs/extent-tree.c+107−116

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

fs/btrfs/extent_io.h+1−0

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

fs/btrfs/file.c+16−12

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

fs/btrfs/inode-map.c+1−2

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

fs/btrfs/inode.c+27−10

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

fs/btrfs/ioctl.c+13−1

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

fs/btrfs/qgroup.c+52−10

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

fs/btrfs/qgroup.h+31−5

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

fs/btrfs/relocation.c+118−10

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

fs/btrfs/root-tree.c+18−9

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

fs/btrfs/send.c+5−3

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

fs/btrfs/super.c+16−0

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

fs/btrfs/transaction.c+6−1

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

fs/btrfs/tree-log.c+20−2

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

fs/btrfs/tree-log.h+4−1

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

fs/btrfs/volumes.c+19−8

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

fs/ceph/dir.c+1−1

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

fs/cifs/cifsfs.c+12−17

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

fs/cifs/cifsproto.h+1−1

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

fs/cifs/connect.c+29−2

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

fs/configfs/file.c+1−0

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

fs/crypto/policy.c+29−12

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

fs/devpts/inode.c+2−1

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

fs/dlm/debug_fs.c+48−14

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

fs/ext4/inode.c+0−2

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

fs/ext4/ioctl.c+1−1

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

fs/ext4/super.c+17−1

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

fs/ext4/xattr.c+31−22

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

fs/ext4/xattr.h+1−0

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

fs/f2fs/data.c+1−1

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

fs/f2fs/f2fs.h+6−6

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

fs/f2fs/file.c+10−12

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

fs/f2fs/node.c+23−24

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

fs/f2fs/super.c+1−5

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

fs/fuse/file.c+4−3

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

fs/ioctl.c+5−1

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

fs/iomap.c+17−9

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

fs/kernfs/file.c+21−7

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

fs/nfs/blocklayout/blocklayout.c+1−1

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

fs/nfs/blocklayout/blocklayout.h+2−1

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

fs/nfs/blocklayout/extent_tree.c+7−3

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

fs/nfs/callback.c+1−0

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

fs/nfs/callback_proc.c+2−6

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

fs/nfs/client.c+5−5

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

fs/nfs/file.c+4−1

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

fs/nfs/flexfilelayout/flexfilelayout.c+22−23

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

fs/nfs/flexfilelayout/flexfilelayout.h+1−1

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

fs/nfs/flexfilelayout/flexfilelayoutdev.c+12−11

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

fs/nfs/internal.h+4−1

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

fs/nfs/nfs42proc.c+29−5

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

fs/nfs/nfs4client.c+5−0

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

fs/nfs/nfs4proc.c+90−20

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

fs/nfs/nfs4session.c+53−0

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

fs/nfs/nfs4session.h+6−1

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

fs/nfs/pnfs.c+25−19

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

fs/nfs/super.c+17−2

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

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

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

fs/notify/fanotify/fanotify_user.c+24−12

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

fs/notify/group.c+19−0

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

fs/notify/notification.c+7−16

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

fs/ocfs2/alloc.c+19−37

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

fs/ocfs2/cluster/tcp_internal.h+1−4

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

fs/ocfs2/dlm/dlmconvert.c+6−6

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

fs/ocfs2/file.c+24−10

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

fs/ocfs2/suballoc.c+12−2

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

fs/overlayfs/copy_up.c+2−0

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

fs/overlayfs/dir.c+56−2

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

fs/overlayfs/inode.c+44−64

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

fs/overlayfs/overlayfs.h+9−8

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

fs/overlayfs/readdir.c+62−1

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

fs/overlayfs/super.c+69−24

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

fs/proc/base.c+1−6

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

fs/proc/kcore.c+20−11

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

fs/proc/task_mmu.c+2−0

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

fs/ramfs/file-mmu.c+9−0

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

fs/seq_file.c+3−1

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

fs/sysfs/file.c+7−1

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

fs/ubifs/tnc_commit.c+1−1

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

fs/ubifs/xattr.c+4−1

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

fs/xfs/libxfs/xfs_alloc.c+16−0

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

fs/xfs/libxfs/xfs_btree.c+13−1

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

fs/xfs/libxfs/xfs_defer.c+4−13

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

fs/xfs/libxfs/xfs_defer.h+1−1

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

fs/xfs/libxfs/xfs_format.h+10−3

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

fs/xfs/libxfs/xfs_rmap_btree.c+6−0

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

fs/xfs/libxfs/xfs_sb.c+2−1

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

fs/xfs/xfs_buf.c+1−2

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

fs/xfs/xfs_file.c+12−1

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

fs/xfs/xfs_fsops.c+1−0

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

fs/xfs/xfs_iomap.c+56−13

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

fs/xfs/xfs_iomap.h+1−0

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

fs/xfs/xfs_iops.c+8−1

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

fs/xfs/xfs_super.c+8−1

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

fs/xfs/xfs_trace.h+1−2

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

include/asm-generic/uaccess.h+14−7

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

include/linux/acpi.h+1−1

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

include/linux/bio.h+8−2

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

include/linux/blkdev.h+4−2

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

include/linux/cec-funcs.h+75−3

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

include/linux/cec.h+4−1

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

include/linux/compiler-gcc.h+7−3

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

include/linux/compiler.h+4−3

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

include/linux/cpuhotplug.h+2−0

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

include/linux/efi.h+21−6

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

include/linux/fs.h+1−0

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

include/linux/fscrypto.h+2−3

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

include/linux/fsnotify_backend.h+3−3

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

include/linux/host1x.h+2−0

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

include/linux/iio/sw_trigger.h+1−1

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

include/linux/iomap.h+7−1

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

include/linux/irq.h+10−0

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

include/linux/irqchip/arm-gic-v3.h+1−0

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

include/linux/mempolicy.h+4−0

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

include/linux/mfd/da8xx-cfgchip.h+153−0

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

include/linux/mfd/ti_am335x_tscadc.h+4−4

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

include/linux/mlx5/mlx5_ifc.h+3−2

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

include/linux/mm.h+1−0

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

include/linux/mmzone.h+14−2

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

include/linux/netdevice.h+2−2

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

include/linux/netfilter/nfnetlink_acct.h+2−2

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

include/linux/nvme.h+1−1

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

include/linux/pagemap.h+20−19

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

include/linux/pci.h+6−13

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

include/linux/qed/qed_if.h+8−0

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

include/linux/sctp.h+0−64

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

include/linux/serial_8250.h+0−1

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

include/linux/skbuff.h+33−19

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

include/linux/smc91x.h+10−0

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

include/linux/sysctl.h+2−0

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

include/linux/thread_info.h+4−3

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

include/linux/uio.h+1−1

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

include/media/cec.h+1−1

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

include/net/act_api.h+5−18

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

include/net/af_rxrpc.h+1−1

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

include/net/af_unix.h+1−1

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

include/net/cfg80211.h+9−0

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

include/net/gre.h+1−0

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

include/net/inet_ecn.h+2−1

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

include/net/ip_fib.h+2−1

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

include/net/mac80211.h+2−1

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

include/net/netfilter/nf_conntrack_synproxy.h+14−0

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

include/net/netfilter/nft_meta.h+4−0

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

include/net/netfilter/nft_reject.h+4−0

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

include/net/pkt_cls.h+36−5

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

include/net/sctp/sm.h+1−1

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

include/net/sock.h+10−0

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

include/net/tcp.h+2−0

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

include/net/xfrm.h+3−1

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

include/rdma/ib_verbs.h+3−8

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

include/scsi/scsi_transport_sas.h+2−3

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

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

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

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

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

include/uapi/linux/if_pppol2tp.h+2−1

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

include/uapi/linux/if_pppox.h+3−0

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

include/uapi/linux/if_tunnel.h+3−0

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

include/uapi/linux/ipx.h+12−1

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

include/uapi/linux/libc-compat.h+26−0

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

include/uapi/linux/netfilter/nf_tables.h+1−1

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

include/uapi/linux/openvswitch.h+3−3

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

include/uapi/linux/sctp.h+64−0

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

include/xen/xen-ops.h+2−2

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

kernel/audit_watch.c+5−3

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

kernel/bpf/hashtab.c+73−11

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

kernel/bpf/verifier.c+4−3

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

kernel/cgroup.c+6−0

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

kernel/configs/tiny.config+8−0

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

kernel/cpuset.c+15−0

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

kernel/events/core.c+102−34

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

kernel/events/ring_buffer.c+11−4

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

kernel/events/uprobes.c+3−2

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

kernel/exit.c+1−6

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

kernel/fork.c+29−8

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

kernel/irq/affinity.c+2−0

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

kernel/irq/chip.c+15−0

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

kernel/irq/manage.c+6−2

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

kernel/kexec_file.c+3−0

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

kernel/memremap.c+9−0

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

kernel/power/qos.c+10−1

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

kernel/power/snapshot.c+5−5

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

kernel/printk/braille.c+2−2

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

kernel/printk/nmi.c+23−15

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

kernel/sched/core.c+22−0

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

kernel/sched/cputime.c+25−8

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

kernel/seccomp.c+8−4

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

kernel/sysctl.c+43−2

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

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

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

kernel/time/timekeeping.c+4−1

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

kernel/time/timekeeping_debug.c+7−2

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

kernel/trace/blktrace.c+1−1

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

kernel/trace/trace.c+16−13

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

lib/Kconfig.debug+1−19

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

lib/Makefile+0−1

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

lib/iov_iter.c+2−22

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

lib/radix-tree.c+4−4

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

lib/rhashtable.c+13−7

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

lib/test_hash.c+16−10

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

lib/test_rhashtable.c+1−1

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

lib/usercopy.c+0−9

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

mm/Kconfig+8−1

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

mm/debug.c+4−2

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

mm/huge_memory.c+8−6

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

mm/khugepaged.c+13−12

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

mm/memcontrol.c+40−27

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

mm/memory.c+7−5

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

mm/memory_hotplug.c+3−1

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

mm/mempolicy.c+17−0

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

mm/page_alloc.c+4−51

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

mm/page_io.c+3−0

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

mm/readahead.c+9−0

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

mm/shmem.c+3−2

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

mm/swapfile.c+0−1

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

mm/usercopy.c+40−28

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

mm/vmscan.c+11−30

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

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

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

net/batman-adv/bat_v_elp.c+1−1

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

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

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

net/bluetooth/af_bluetooth.c+1−1

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

net/bluetooth/hci_request.c+2−0

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

net/bluetooth/hci_sock.c+1−1

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

net/bluetooth/l2cap_core.c+8−0

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

net/bluetooth/l2cap_sock.c+12−2

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

net/bridge/br_fdb.c+27−25

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

net/bridge/br_input.c+2−5

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

net/bridge/br_multicast.c+1−1

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

net/bridge/netfilter/ebtables.c+2−0

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

net/bridge/netfilter/nft_meta_bridge.c+1−0

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

net/core/dev.c+19−7

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

net/core/filter.c+47−62

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

net/core/flow_dissector.c+4−2

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

net/core/sock.c+4−1

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

net/ipv4/devinet.c+7−4

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

net/ipv4/fib_frontend.c+2−1

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

net/ipv4/fib_semantics.c+6−2

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

net/ipv4/fib_trie.c+4−8

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

net/ipv4/ip_gre.c+0−1

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

net/ipv4/ip_input.c+3−2

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

net/ipv4/ip_tunnel_core.c+5−3

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

net/ipv4/ip_vti.c+45−1

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

net/ipv4/ipmr.c+5−2

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

net/ipv4/netfilter/nft_chain_route_ipv4.c+7−4

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

net/ipv4/netfilter/nft_reject_ipv4.c+1−0

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

net/ipv4/route.c+8−2

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

net/ipv4/tcp.c+0−2

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

net/ipv4/tcp_diag.c+6−1

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

net/ipv4/tcp_fastopen.c+2−0

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

net/ipv4/tcp_input.c+1−1

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

net/ipv4/tcp_ipv4.c+7−1

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

net/ipv4/tcp_output.c+5−2

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

net/ipv4/tcp_timer.c+1−0

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

net/ipv4/tcp_yeah.c+1−1

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

net/ipv4/udp.c+6−7

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

net/ipv4/udplite.c+0−1

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

net/ipv4/xfrm4_policy.c+1−1

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

net/ipv6/addrconf.c+40−16

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

net/ipv6/calipso.c+3−1

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

net/ipv6/ip6_gre.c+0−2

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

net/ipv6/ip6_tunnel.c+2−0

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

net/ipv6/ip6_vti.c+15−4

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

net/ipv6/ip6mr.c+5−2

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

net/ipv6/netfilter/nft_chain_route_ipv6.c+7−3

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

net/ipv6/netfilter/nft_reject_ipv6.c+1−0

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

net/ipv6/ping.c+24−18

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

net/ipv6/route.c+10−1

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

net/ipv6/tcp_ipv6.c+7−1

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

net/ipv6/udp.c+0−1

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

net/ipv6/udplite.c+0−1

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

net/ipv6/xfrm6_input.c+11−4

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

net/ipv6/xfrm6_policy.c+1−1

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

net/ipv6/xfrm6_tunnel.c+1−1

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

net/irda/af_irda.c+2−3

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

net/irda/iriap.c+6−2

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

net/kcm/kcmsock.c+2−1

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

net/l2tp/l2tp_core.c+3−0

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

net/l2tp/l2tp_ppp.c+1−1

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

net/mac80211/agg-rx.c+7−1

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

net/mac80211/agg-tx.c+3−0

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

net/mac80211/cfg.c+1−1

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

net/mac80211/driver-ops.h+1−1

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

net/mac80211/mesh.c+6−4

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

net/mac80211/mesh_hwmp.c+2−1

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

net/mac80211/mesh_pathtbl.c+1−1

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

net/mac80211/rx.c+1−1

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

net/mac80211/sta_info.c+2−2

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

net/mac80211/status.c+7−7

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

net/mac80211/tdls.c+4−3

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

net/mac80211/tx.c+42−37

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

net/netfilter/nf_conntrack_core.c+3−3

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

net/netfilter/nf_conntrack_expect.c+1−1

This diff is large: its 9 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/nf_conntrack_netlink.c+4−6

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

net/netfilter/nf_conntrack_sip.c+2−2

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

net/netfilter/nf_conntrack_standalone.c+4−0

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

net/netfilter/nf_nat_core.c+3−2

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

net/netfilter/nf_tables_netdev.c+0−1

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

net/netfilter/nf_tables_trace.c+1−1

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

net/netfilter/nfnetlink_acct.c+12−11

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

net/netfilter/nfnetlink_cttimeout.c+38−27

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

net/netfilter/nfnetlink_log.c+1−0

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

net/netfilter/nfnetlink_queue.c+2−4

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

net/netfilter/nft_exthdr.c+9−2

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

net/netfilter/nft_meta.c+13−4

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

net/netfilter/nft_rbtree.c+6−4

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

net/netfilter/nft_reject.c+16−0

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

net/netfilter/nft_reject_inet.c+6−1

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

net/netfilter/xt_TPROXY.c+4−0

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

net/netfilter/xt_nfacct.c+1−1

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

net/openvswitch/conntrack.c+1−7

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

net/openvswitch/vport-geneve.c+8−1

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

net/openvswitch/vport-gre.c+9−2

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

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

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

net/openvswitch/vport-vxlan.c+8−1

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

net/rxrpc/ar-internal.h+1−0

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

net/rxrpc/call_accept.c+1−0

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

net/rxrpc/call_event.c+7−0

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

net/rxrpc/call_object.c+4−7

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

net/rxrpc/input.c+18−21

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

net/rxrpc/recvmsg.c+3−22

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

net/rxrpc/skbuff.c+34−7

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

net/sched/act_api.c+9−25

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

net/sched/act_ife.c+10−8

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

net/sched/act_police.c+11−51

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

net/sched/cls_api.c+36−15

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

net/sched/sch_generic.c+5−4

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

net/sctp/input.c+24−14

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

net/sctp/inqueue.c+0−13

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

net/sctp/output.c+12−1

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

net/sctp/proc.c+1−0

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

net/sctp/sctp_diag.c+16−8

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

net/sctp/ulpevent.c+2−2

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

net/sunrpc/auth_gss/svcauth_gss.c+3−2

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

net/sunrpc/clnt.c+2−2

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

net/sunrpc/xprtrdma/verbs.c+32−13

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

net/sunrpc/xprtrdma/xprt_rdma.h+1−0

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

net/sunrpc/xprtsock.c+1−1

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

net/tipc/monitor.c+2−1

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

net/tipc/name_distr.c+5−3

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

net/tipc/socket.c+2−1

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

net/tipc/udp_media.c+4−1

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

net/unix/af_unix.c+49−62

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

net/vmw_vsock/virtio_transport.c+3−7

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

net/wireless/chan.c+1−0

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

net/wireless/nl80211.c+32−4

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

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

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

net/xfrm/xfrm_input.c+7−7

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

net/xfrm/xfrm_policy.c+4−0

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

net/xfrm/xfrm_state.c+1−0

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

net/xfrm/xfrm_user.c+10−12

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

samples/bpf/bpf_helpers.h+2−2

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

samples/bpf/test_cgrp2_tc_kern.c+1−1

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

samples/bpf/test_maps.c+13−2

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

scripts/checkpatch.pl+0−9

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

scripts/faddr2line+177−0

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

scripts/get_maintainer.pl+3−1

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

scripts/package/builddeb+3−1

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

scripts/tags.sh+0−1

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

security/Kconfig+12−0

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

security/keys/encrypted-keys/encrypted.c+7−4

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

sound/core/rawmidi.c+3−1

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

sound/core/timer.c+32−2

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

sound/firewire/fireworks/fireworks.h+0−1

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

sound/firewire/fireworks/fireworks_hwdep.c+52−19

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

sound/firewire/fireworks/fireworks_proc.c+2−2

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

sound/firewire/fireworks/fireworks_transaction.c+2−3

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

sound/firewire/tascam/tascam-hwdep.c+11−22

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

sound/pci/hda/patch_realtek.c+19−3

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

sound/soc/atmel/atmel_ssc_dai.c+3−2

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

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

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

sound/soc/codecs/max98371.c+1−0

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

sound/soc/codecs/nau8825.c+32−46

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

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

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

sound/soc/generic/Makefile+3−3

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

sound/soc/generic/simple-card-utils.c+6−0

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

sound/soc/intel/skylake/skl-sst-utils.c+5−0

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

sound/soc/intel/skylake/skl.c+3−1

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

sound/soc/omap/omap-abe-twl6040.c+32−29

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

sound/soc/omap/omap-mcpdm.c+3−19

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

sound/soc/samsung/s3c24xx_uda134x.c+4−3

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

sound/soc/sh/rcar/src.c+5−1

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

sound/soc/soc-compress.c+3−1

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

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

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

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

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

sound/usb/line6/pcm.c+2−1

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

sound/usb/line6/pod.c+6−6

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

sound/usb/quirks.c+1−0

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

tools/arch/arm64/include/uapi/asm/kvm.h+2−0

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

tools/arch/s390/include/uapi/asm/kvm.h+41−0

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

tools/arch/s390/include/uapi/asm/sie.h+1−0

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

tools/gpio/gpio-event-mon.c+1−1

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

tools/iio/iio_generic_buffer.c+2−2

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

tools/include/linux/string.h+5−1

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

tools/lguest/lguest.c+3−3

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

tools/perf/arch/powerpc/util/sym-handling.c+2−0

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

tools/perf/arch/x86/util/intel-pt.c+5−1

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

tools/perf/builtin-mem.c+3−0

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

tools/perf/builtin-script.c+10−3

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

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

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

tools/perf/util/intel-pt-decoder/intel-pt-decoder.c+23−21

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

tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c+17−7

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

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

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

tools/perf/util/probe-file.c+29−7

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

tools/perf/util/symbol-elf.c+2−1

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

tools/perf/util/unwind-libdw.c+1−1

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

tools/perf/util/unwind-libunwind-local.c+1−1

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

tools/testing/radix-tree/Makefile+1−1

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

tools/testing/radix-tree/multiorder.c+12−4

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

tools/virtio/linux/dma-mapping.h+16−0

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

tools/virtio/linux/kernel.h+14−0

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

tools/virtio/linux/slab.h+4−0

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

tools/virtio/linux/virtio.h+5−1

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

tools/virtio/linux/virtio_config.h+13−0

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

tools/virtio/ringtest/ptr_ring.c+1−0

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

virt/kvm/arm/arch_timer.c+10−1

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

virt/kvm/arm/vgic/vgic-its.c+114−44

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

virt/kvm/arm/vgic/vgic-mmio-v3.c+16−10

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

virt/kvm/arm/vgic/vgic-v3.c+8−0

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

virt/kvm/arm/vgic/vgic.c+5−5

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

virt/kvm/arm/vgic/vgic.h+6−0

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t