History

Merge tag 'v5.0-rc6' into devel

Linux 5.0-rc6

Linus Walleij committed 7 years ago

Commit e6537212 parents a3240f0 d1393711624 files · +17342 −8602Browse files

Unified · Split

1624 files
  1. .clang-format +42 −1
  2. Documentation/ABI/stable/sysfs-driver-mlxreg-io +3 −3
  3. Documentation/ABI/testing/sysfs-block +9 −0
  4. Documentation/ABI/testing/sysfs-block-zram +9 −2
  5. Documentation/admin-guide/kernel-parameters.txt +3 −4
  6. Documentation/block/bfq-iosched.txt +7 −0
  7. Documentation/block/null_blk.txt +2 −1
  8. Documentation/block/queue-sysfs.txt +7 −0
  9. Documentation/blockdev/zram.txt +47 −27
  10. Documentation/bpf/bpf_design_QA.rst +5 −6
  11. Documentation/core-api/xarray.rst +9 −6
  12. Documentation/devicetree/bindings/Makefile +5 −1
  13. Documentation/devicetree/bindings/arm/cpu-capacity.txt +1 −1
  14. Documentation/devicetree/bindings/arm/idle-states.txt +1 −1
  15. Documentation/devicetree/bindings/arm/sp810.txt +1 −1
  16. Documentation/devicetree/bindings/arm/topology.txt +1 −1
  17. Documentation/devicetree/bindings/clock/marvell,mmp2.txt +1 −1
  18. Documentation/devicetree/bindings/display/arm,pl11x.txt +1 −1
  19. Documentation/devicetree/bindings/display/msm/gpu.txt +0 −1
  20. Documentation/devicetree/bindings/gpio/gpio-mvebu.txt +0 −2
  21. Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.txt +1 −1
  22. Documentation/devicetree/bindings/reset/socfpga-reset.txt +2 −1
  23. Documentation/devicetree/bindings/reset/uniphier-reset.txt +14 −11
  24. Documentation/devicetree/bindings/serio/olpc,ap-sp.txt +0 −4
  25. Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt +1 −1
  26. Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.txt +2 −2
  27. Documentation/driver-model/bus.txt +4 −4
  28. Documentation/fb/fbcon.txt +8 −0
  29. Documentation/features/core/cBPF-JIT/arch-support.txt +1 −0
  30. Documentation/features/core/eBPF-JIT/arch-support.txt +1 −0
  31. Documentation/features/core/generic-idle-thread/arch-support.txt +1 −0
  32. Documentation/features/core/jump-labels/arch-support.txt +1 −0
  33. Documentation/features/core/tracehook/arch-support.txt +1 −0
  34. Documentation/features/debug/KASAN/arch-support.txt +1 −0
  35. Documentation/features/debug/gcov-profile-all/arch-support.txt +1 −0
  36. Documentation/features/debug/kgdb/arch-support.txt +1 −0
  37. Documentation/features/debug/kprobes-on-ftrace/arch-support.txt +1 −0
  38. Documentation/features/debug/kprobes/arch-support.txt +1 −0
  39. Documentation/features/debug/kretprobes/arch-support.txt +1 −0
  40. Documentation/features/debug/optprobes/arch-support.txt +1 −0
  41. Documentation/features/debug/stackprotector/arch-support.txt +1 −0
  42. Documentation/features/debug/uprobes/arch-support.txt +1 −0
  43. Documentation/features/debug/user-ret-profiler/arch-support.txt +1 −0
  44. Documentation/features/io/dma-contiguous/arch-support.txt +1 −0
  45. Documentation/features/locking/cmpxchg-local/arch-support.txt +1 −0
  46. Documentation/features/locking/lockdep/arch-support.txt +1 −0
  47. Documentation/features/locking/queued-rwlocks/arch-support.txt +1 −0
  48. Documentation/features/locking/queued-spinlocks/arch-support.txt +1 −0
  49. Documentation/features/locking/rwsem-optimized/arch-support.txt +1 −0
  50. Documentation/features/perf/kprobes-event/arch-support.txt +1 −0
  51. Documentation/features/perf/perf-regs/arch-support.txt +1 −0
  52. Documentation/features/perf/perf-stackdump/arch-support.txt +1 −0
  53. Documentation/features/sched/membarrier-sync-core/arch-support.txt +1 −0
  54. Documentation/features/sched/numa-balancing/arch-support.txt +1 −0
  55. Documentation/features/seccomp/seccomp-filter/arch-support.txt +1 −0
  56. Documentation/features/time/arch-tick-broadcast/arch-support.txt +1 −0
  57. Documentation/features/time/clockevents/arch-support.txt +1 −0
  58. Documentation/features/time/context-tracking/arch-support.txt +1 −0
  59. Documentation/features/time/irq-time-acct/arch-support.txt +1 −0
  60. Documentation/features/time/modern-timekeeping/arch-support.txt +1 −0
  61. Documentation/features/time/virt-cpuacct/arch-support.txt +1 −0
  62. Documentation/features/vm/ELF-ASLR/arch-support.txt +1 −0
  63. Documentation/features/vm/PG_uncached/arch-support.txt +1 −0
  64. Documentation/features/vm/THP/arch-support.txt +1 −0
  65. Documentation/features/vm/TLB/arch-support.txt +1 −0
  66. Documentation/features/vm/huge-vmap/arch-support.txt +1 −0
  67. Documentation/features/vm/ioremap_prot/arch-support.txt +1 −0
  68. Documentation/features/vm/numa-memblock/arch-support.txt +1 −0
  69. Documentation/features/vm/pte_special/arch-support.txt +1 −0
  70. Documentation/filesystems/sysfs.txt +3 −1
  71. Documentation/networking/index.rst +13 −13
  72. Documentation/networking/rxrpc.txt +0 −45
  73. Documentation/networking/snmp_counter.rst +125 −5
  74. Documentation/networking/timestamping.txt +2 −2
  75. Documentation/sysctl/fs.txt +16 −10
  76. Documentation/trace/coresight-cpu-debug.txt +1 −1
  77. Documentation/virtual/kvm/amd-memory-encryption.rst +1 −1
  78. Documentation/x86/resctrl_ui.txt +1 −1
  79. MAINTAINERS +90 −30
  80. Makefile +5 −5
  81. arch/arc/include/asm/Kbuild +0 −4
  82. arch/arc/include/asm/arcregs.h +10 −2
  83. arch/arc/include/asm/bitops.h +3 −3
  84. arch/arc/include/asm/perf_event.h +2 −1
  85. arch/arc/kernel/perf_event.c +182 −59
  86. arch/arc/kernel/setup.c +18 −9
  87. arch/arc/kernel/troubleshoot.c +18 −12
  88. arch/arc/lib/memset-archs.S +32 −8
  89. arch/arc/mm/fault.c +9 −4
  90. arch/arc/mm/init.c +2 −1
  91. arch/arm/boot/dts/am335x-shc.dts +1 −1
  92. arch/arm/boot/dts/da850-evm.dts +26 −5
  93. arch/arm/boot/dts/da850-lcdk.dts +37 −1
  94. arch/arm/boot/dts/da850.dtsi +1 −1
  95. arch/arm/boot/dts/imx6q-pistachio.dts +1 −1
  96. arch/arm/boot/dts/imx6sll-evk.dts +1 −1
  97. arch/arm/boot/dts/imx6sx.dtsi +1 −1
  98. arch/arm/boot/dts/kirkwood-dnskw.dtsi +2 −2
  99. arch/arm/boot/dts/meson.dtsi +1 −1
  100. arch/arm/boot/dts/meson8b-ec100.dts +1 −2
  101. arch/arm/boot/dts/meson8b-odroidc1.dts +1 −3
  102. arch/arm/boot/dts/meson8m2-mxiii-plus.dts +1 −2
  103. arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi +1 −1
  104. arch/arm/boot/dts/omap3-gta04.dtsi +0 −4
  105. arch/arm/boot/dts/omap3-n900.dts +1 −1
  106. arch/arm/boot/dts/omap3-n950-n9.dtsi +28 −14
  107. arch/arm/boot/dts/omap5-l4.dtsi +0 −2
  108. arch/arm/boot/dts/r8a7743.dtsi +30 −6
  109. arch/arm/boot/dts/sun6i-a31.dtsi +1 −0
  110. arch/arm/boot/dts/sun8i-h3-beelink-x2.dts +1 −1
  111. arch/arm/boot/dts/vf610-bk4.dts +2 −2
  112. arch/arm/include/asm/xen/page-coherent.h +94 −0
  113. arch/arm/mach-cns3xxx/pcie.c +2 −2
  114. arch/arm/mach-davinci/board-da830-evm.c +2 −2
  115. arch/arm/mach-davinci/board-da850-evm.c +2 −2
  116. arch/arm/mach-davinci/board-dm355-evm.c +2 −2
  117. arch/arm/mach-davinci/board-dm644x-evm.c +2 −2
  118. arch/arm/mach-davinci/board-omapl138-hawk.c +2 −2
  119. arch/arm/mach-integrator/impd1.c +6 −2
  120. arch/arm/mach-iop32x/n2100.c +1 −2
  121. arch/arm/mach-socfpga/socfpga.c +4 −0
  122. arch/arm/mach-tango/pm.c +2 −4
  123. arch/arm/mach-tango/pm.h +7 −0
  124. arch/arm/mach-tango/setup.c +2 −0
  125. arch/arm/plat-pxa/ssp.c +0 −3
  126. arch/arm/xen/mm.c +0 −1
  127. arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +1 −0
  128. arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +1 −1
  129. arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +1 −2
  130. arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +1 −2
  131. arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts +1 −2
  132. arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +1 −2
  133. arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi +1 −2
  134. arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi +1 −2
  135. arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi +1 −2
  136. arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts +1 −2
  137. arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts +1 −2
  138. arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts +1 −2
  139. arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi +1 −2
  140. arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts +1 −2
  141. arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts +1 −2
  142. arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts +1 −2
  143. arch/arm64/boot/dts/marvell/armada-8040-mcbin.dtsi +1 −1
  144. arch/arm64/boot/dts/marvell/armada-ap806.dtsi +17 −0
  145. arch/arm64/boot/dts/qcom/msm8996.dtsi +1 −1
  146. arch/arm64/boot/dts/renesas/r8a774a1.dtsi +3 −0
  147. arch/arm64/boot/dts/renesas/r8a7796.dtsi +3 −0
  148. arch/arm64/boot/dts/renesas/r8a77965.dtsi +3 −0
  149. arch/arm64/configs/defconfig +4 −0
  150. arch/arm64/include/asm/asm-prototypes.h +1 −1
  151. arch/arm64/include/asm/cache.h +4 −0
  152. arch/arm64/include/asm/device.h +0 −3
  153. arch/arm64/include/asm/mmu.h +44 −0
  154. arch/arm64/include/asm/pgtable-prot.h +2 −2
  155. arch/arm64/include/asm/xen/page-coherent.h +76 −0
  156. arch/arm64/kernel/cpu_errata.c +1 −1
  157. arch/arm64/kernel/cpufeature.c +7 −2
  158. arch/arm64/kernel/head.S +1 −0
  159. arch/arm64/kernel/hibernate.c +3 −1
  160. arch/arm64/kernel/hyp-stub.S +2 −0
  161. arch/arm64/kernel/kaslr.c +7 −2
  162. arch/arm64/kernel/machine_kexec_file.c +6 −2
  163. arch/arm64/kernel/probes/kprobes.c +3 −3
  164. arch/arm64/mm/dma-mapping.c +1 −3
  165. arch/arm64/mm/dump.c +29 −30
  166. arch/arm64/mm/flush.c +5 −1
  167. arch/c6x/include/asm/Kbuild +1 −0
  168. arch/csky/include/asm/io.h +25 −0
  169. arch/csky/include/asm/pgalloc.h +18 −25
  170. arch/csky/kernel/module.c +22 −16
  171. arch/h8300/Makefile +0 −2
  172. arch/h8300/include/asm/Kbuild +1 −0
  173. arch/hexagon/include/asm/Kbuild +1 −0
  174. arch/ia64/Makefile +0 −2
  175. arch/m68k/emu/nfblock.c +7 −3
  176. arch/m68k/include/asm/Kbuild +1 −0
  177. arch/microblaze/include/asm/Kbuild +1 −0
  178. arch/mips/Kconfig +16 −0
  179. arch/mips/bcm47xx/setup.c +31 −0
  180. arch/mips/boot/dts/ingenic/ci20.dts +4 −4
  181. arch/mips/boot/dts/ingenic/jz4740.dtsi +1 −1
  182. arch/mips/boot/dts/xilfpga/nexys4ddr.dts +4 −4
  183. arch/mips/cavium-octeon/setup.c +1 −1
  184. arch/mips/configs/ath79_defconfig +1 −0
  185. arch/mips/include/asm/atomic.h +6 −0
  186. arch/mips/include/asm/barrier.h +36 −0
  187. arch/mips/include/asm/bitops.h +5 −0
  188. arch/mips/include/asm/futex.h +3 −0
  189. arch/mips/include/asm/mach-lantiq/falcon/falcon_irq.h +0 −2
  190. arch/mips/include/asm/mach-lantiq/xway/lantiq_irq.h +0 −2
  191. arch/mips/include/asm/pgtable.h +2 −0
  192. arch/mips/jazz/jazzdma.c +3 −2
  193. arch/mips/kernel/mips-cm.c +1 −1
  194. arch/mips/kernel/process.c +3 −4
  195. arch/mips/lantiq/irq.c +6 −71
  196. arch/mips/lantiq/xway/dma.c +3 −3
  197. arch/mips/loongson64/Platform +23 −0
  198. arch/mips/loongson64/common/reset.c +6 −1
  199. arch/mips/mm/tlbex.c +10 −0
  200. arch/mips/pci/msi-octeon.c +3 −1
  201. arch/mips/pci/pci-octeon.c +5 −5
  202. arch/mips/vdso/Makefile +3 −2
  203. arch/nds32/Makefile +0 −8
  204. arch/openrisc/Makefile +0 −3
  205. arch/openrisc/include/asm/Kbuild +1 −0
  206. arch/openrisc/include/asm/uaccess.h +6 −2
  207. arch/powerpc/include/asm/book3s/64/pgtable.h +7 −15
  208. arch/powerpc/include/uapi/asm/perf_regs.h +1 −0
  209. arch/powerpc/kernel/head_8xx.S +2 −1
  210. arch/powerpc/kernel/signal_64.c +4 −3
  211. arch/powerpc/kernel/trace/ftrace.c +0 −7
  212. arch/powerpc/mm/pgtable-book3s64.c +22 −0
  213. arch/powerpc/perf/perf_regs.c +6 −0
  214. arch/powerpc/platforms/4xx/ocm.c +3 −3
  215. arch/powerpc/platforms/chrp/setup.c +1 −2
  216. arch/powerpc/platforms/pasemi/dma_lib.c +1 −1
  217. arch/powerpc/platforms/powernv/npu-dma.c +1 −1
  218. arch/powerpc/platforms/powernv/pci-ioda.c +2 −1
  219. arch/powerpc/platforms/pseries/papr_scm.c +4 −1
  220. arch/powerpc/platforms/pseries/pci.c +2 −0
  221. arch/powerpc/sysdev/fsl_rmu.c +4 −3
  222. arch/riscv/Kconfig +4 −2
  223. arch/riscv/configs/defconfig +5 −3
  224. arch/riscv/include/asm/module.h +15 −13
  225. arch/riscv/include/asm/page.h +1 −1
  226. arch/riscv/include/asm/processor.h +1 −1
  227. arch/riscv/include/asm/ptrace.h +5 −0
  228. arch/riscv/include/asm/syscall.h +10 −0
  229. arch/riscv/include/asm/thread_info.h +6 −0
  230. arch/riscv/include/asm/unistd.h +2 −0
  231. arch/riscv/kernel/asm-offsets.c +1 −0
  232. arch/riscv/kernel/entry.S +19 −3
  233. arch/riscv/kernel/module-sections.c +16 −14
  234. arch/riscv/kernel/ptrace.c +8 −1
  235. arch/riscv/kernel/setup.c +9 −2
  236. arch/riscv/kernel/smp.c +36 −7
  237. arch/riscv/kernel/smpboot.c +1 −5
  238. arch/riscv/kernel/vmlinux.lds.S +6 −2
  239. arch/riscv/mm/init.c +2 −1
  240. arch/s390/include/asm/mmu_context.h +3 −4
  241. arch/s390/kernel/early.c +2 −2
  242. arch/s390/kernel/setup.c +2 −0
  243. arch/s390/kernel/smp.c +10 −1
  244. arch/s390/kernel/vdso.c +2 −3
  245. arch/unicore32/include/asm/Kbuild +1 −0
  246. arch/x86/Kconfig +5 −5
  247. arch/x86/boot/compressed/head_64.S +10 −0
  248. arch/x86/boot/compressed/pgtable.h +1 −1
  249. arch/x86/entry/entry_64_compat.S +4 −2
  250. arch/x86/events/intel/core.c +11 −5
  251. arch/x86/events/intel/uncore_snbep.c +3 −1
  252. arch/x86/include/asm/intel-family.h +2 −1
  253. arch/x86/include/asm/mmu_context.h +18 −0
  254. arch/x86/include/asm/page_64_types.h +4 −0
  255. arch/x86/include/asm/pgtable.h +1 −1
  256. arch/x86/include/asm/resctrl_sched.h +2 −2
  257. arch/x86/include/asm/uaccess.h +1 −1
  258. arch/x86/kernel/cpu/Makefile +1 −1
  259. arch/x86/kernel/cpu/bugs.c +2 −2
  260. arch/x86/kernel/cpu/mce/core.c +1 −0
  261. arch/x86/kernel/cpu/microcode/amd.c +1 −1
  262. arch/x86/kernel/cpu/resctrl/Makefile +2 −2
  263. arch/x86/kernel/crash.c +1 −0
  264. arch/x86/kernel/hpet.c +0 −4
  265. arch/x86/kernel/kexec-bzimage64.c +5 −0
  266. arch/x86/kernel/kvm.c +5 −2
  267. arch/x86/kernel/tsc.c +16 −14
  268. arch/x86/kvm/Makefile +0 −4
  269. arch/x86/kvm/hyperv.c +3 −4
  270. arch/x86/kvm/lapic.c +2 −0
  271. arch/x86/kvm/mmu.c +1 −0
  272. arch/x86/kvm/svm.c +18 −16
  273. arch/x86/kvm/trace.h +1 −1
  274. arch/x86/kvm/vmx/evmcs.c +4 −3
  275. arch/x86/kvm/vmx/nested.c +11 −7
  276. arch/x86/kvm/vmx/vmx.c +81 −73
  277. arch/x86/kvm/x86.c +12 −3
  278. arch/x86/lib/iomem.c +30 −3
  279. arch/x86/lib/kaslr.c +2 −2
  280. arch/x86/mm/fault.c +1 −1
  281. arch/x86/mm/mem_encrypt_identity.c +2 −2
  282. arch/x86/mm/pageattr.c +25 −25
  283. arch/x86/xen/enlighten_pv.c +1 −4
  284. arch/x86/xen/time.c +9 −3
  285. arch/xtensa/Kconfig +2 −2
  286. arch/xtensa/boot/dts/Makefile +3 −3
  287. arch/xtensa/configs/audio_kc705_defconfig +1 −1
  288. arch/xtensa/configs/cadence_csp_defconfig +1 −1
  289. arch/xtensa/configs/generic_kc705_defconfig +1 −1
  290. arch/xtensa/configs/nommu_kc705_defconfig +1 −1
  291. arch/xtensa/configs/smp_lx200_defconfig +2 −1
  292. arch/xtensa/kernel/head.S +4 −1
  293. arch/xtensa/kernel/smp.c +27 −14
  294. arch/xtensa/kernel/time.c +1 −1
  295. block/bfq-wf2q.c +5 −6
  296. block/blk-core.c +24 −2
  297. block/blk-flush.c +1 −1
  298. block/blk-iolatency.c +48 −8
  299. block/blk-mq-debugfs-zoned.c +0 −2
  300. block/blk-mq-debugfs.c +5 −1
  301. block/blk-mq.c +2 −1
  302. block/blk-mq.h +0 −1
  303. block/blk-wbt.c +2 −2
  304. crypto/adiantum.c +4 −0
  305. crypto/authenc.c +11 −3
  306. crypto/authencesn.c +1 −1
  307. crypto/sm3_generic.c +1 −1
  308. drivers/acpi/Kconfig +1 −0
  309. drivers/acpi/Makefile +2 −1
  310. drivers/acpi/arm64/iort.c +3 −2
  311. drivers/acpi/bus.c +15 −12
  312. drivers/acpi/internal.h +4 −0
  313. drivers/acpi/nfit/core.c +54 −32
  314. drivers/acpi/nfit/intel.c +4 −4
  315. drivers/acpi/numa.c +3 −3
  316. drivers/acpi/pmic/intel_pmic_xpower.c +33 −8
  317. drivers/acpi/power.c +22 −0
  318. drivers/android/binder.c +22 −15
  319. drivers/android/binder_internal.h +9 −0
  320. drivers/android/binderfs.c +161 −135
  321. drivers/ata/Kconfig +1 −1
  322. drivers/ata/ahci.h +2 −0
  323. drivers/ata/ahci_mvebu.c +64 −23
  324. drivers/ata/libahci_platform.c +13 −0
  325. drivers/ata/libata-core.c +1 −0
  326. drivers/ata/pata_macio.c +4 −5
  327. drivers/ata/sata_fsl.c +2 −2
  328. drivers/ata/sata_inic162x.c +9 −13
  329. drivers/atm/he.c +20 −21
  330. drivers/atm/idt77252.c +8 −8
  331. drivers/base/cacheinfo.c +2 −4
  332. drivers/base/power/main.c +3 −0
  333. drivers/base/power/runtime.c +12 −9
  334. drivers/base/regmap/regmap-irq.c +7 −1
  335. drivers/block/loop.c +33 −2
  336. drivers/block/nbd.c +3 −2
  337. drivers/block/null_blk.h +1 −0
  338. drivers/block/rbd.c +4 −5
  339. drivers/block/skd_main.c +2 −2
  340. drivers/block/zram/zram_drv.c +66 −24
  341. drivers/block/zram/zram_drv.h +3 −2
  342. drivers/char/ipmi/ipmi_msghandler.c +100 −73
  343. drivers/char/ipmi/ipmi_ssif.c +17 −8
  344. drivers/char/mwave/mwavedd.c +7 −0
  345. drivers/clk/Kconfig +0 −1
  346. drivers/clk/clk-versaclock5.c +3 −1
  347. drivers/clk/clk.c +13 −3
  348. drivers/clk/imx/clk-frac-pll.c +3 −2
  349. drivers/clk/imx/clk-imx8qxp-lpcg.c +2 −0
  350. drivers/clk/mmp/clk-of-mmp2.c +0 −4
  351. drivers/clk/qcom/Kconfig +1 −0
  352. drivers/clk/qcom/gcc-sdm845.c +10 −4
  353. drivers/clk/socfpga/clk-pll-s10.c +1 −1
  354. drivers/clk/socfpga/clk-s10.c +10 −10
  355. drivers/clk/tegra/clk-tegra124-dfll-fcpu.c +3 −1
  356. drivers/clk/ti/divider.c +10 −1
  357. drivers/clk/zynqmp/clkc.c +2 −2
  358. drivers/cpufreq/cpufreq.c +4 −8
  359. drivers/cpufreq/scmi-cpufreq.c +4 −4
  360. drivers/cpufreq/scpi-cpufreq.c +2 −2
  361. drivers/cpuidle/poll_state.c +1 −1
  362. drivers/crypto/Kconfig +1 −0
  363. drivers/crypto/amcc/crypto4xx_core.c +3 −3
  364. drivers/crypto/bcm/cipher.c +13 −31
  365. drivers/crypto/caam/caamalg.c +1 −1
  366. drivers/crypto/caam/caamhash.c +9 −6
  367. drivers/crypto/caam/desc.h +1 −0
  368. drivers/crypto/caam/error.h +9 −0
  369. drivers/crypto/cavium/cpt/cptpf_main.c +2 −2
  370. drivers/crypto/cavium/cpt/cptvf_main.c +4 −3
  371. drivers/crypto/cavium/nitrox/nitrox_lib.c +3 −3
  372. drivers/crypto/cavium/nitrox/nitrox_reqmgr.c +6 −4
  373. drivers/crypto/ccp/ccp-dev-v5.c +3 −3
  374. drivers/crypto/ccree/cc_aead.c +19 −21
  375. drivers/crypto/hisilicon/sec/sec_algs.c +2 −2
  376. drivers/crypto/hisilicon/sec/sec_drv.c +6 −9
  377. drivers/crypto/ixp4xx_crypto.c +3 −3
  378. drivers/crypto/mediatek/mtk-platform.c +8 −8
  379. drivers/crypto/qat/qat_common/adf_admin.c +6 −6
  380. drivers/crypto/qat/qat_common/qat_algs.c +12 −12
  381. drivers/crypto/qat/qat_common/qat_asym_algs.c +34 −34
  382. drivers/crypto/talitos.c +9 −17
  383. drivers/dma/at_xdmac.c +10 −9
  384. drivers/dma/bcm2835-dma.c +25 −45
  385. drivers/dma/dmatest.c +14 −18
  386. drivers/dma/imx-dma.c +4 −4
  387. drivers/dma/imx-sdma.c +4 −4
  388. drivers/dma/mediatek/mtk-hsdma.c +2 −2
  389. drivers/dma/mxs-dma.c +3 −3
  390. drivers/dma/xgene-dma.c +2 −2
  391. drivers/dma/xilinx/xilinx_dma.c +7 −7
  392. drivers/dma/xilinx/zynqmp_dma.c +3 −3
  393. drivers/edac/altera_edac.h +2 −2
  394. drivers/firewire/sbp2.c +1 −4
  395. drivers/firmware/arm_scmi/bus.c +7 −2
  396. drivers/firmware/efi/arm-runtime.c +3 −2
  397. drivers/fpga/stratix10-soc.c +1 −4
  398. drivers/gpio/gpio-altera-a10sr.c +3 −1
  399. drivers/gpio/gpio-eic-sprd.c +13 −1
  400. drivers/gpio/gpio-pca953x.c +1 −1
  401. drivers/gpio/gpio-pcf857x.c +12 −14
  402. drivers/gpio/gpio-vf610.c +5 −0
  403. drivers/gpio/gpiolib-acpi.c +1 −6
  404. drivers/gpio/gpiolib.c +8 −1
  405. drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +1 −0
  406. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 −6
  407. drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +12 −8
  408. drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +16 −9
  409. drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c +51 −8
  410. drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +3 −5
  411. drivers/gpu/drm/amd/amdgpu/dce_virtual.c +3 −14
  412. drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +34 −14
  413. drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +9 −5
  414. drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +1 −1
  415. drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c +13 −0
  416. drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +2 −1
  417. drivers/gpu/drm/amd/amdgpu/soc15.c +4 −2
  418. drivers/gpu/drm/amd/amdkfd/Kconfig +2 −2
  419. drivers/gpu/drm/amd/amdkfd/kfd_crat.c +8 −0
  420. drivers/gpu/drm/amd/amdkfd/kfd_topology.c +14 −7
  421. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +29 −15
  422. drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 −11
  423. drivers/gpu/drm/amd/display/dc/dc_link.h +1 −2
  424. drivers/gpu/drm/amd/display/dc/dc_stream.h +0 −1
  425. drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c +9 −1
  426. drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +6 −1
  427. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +1 −1
  428. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +1 −1
  429. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +6 −13
  430. drivers/gpu/drm/amd/display/modules/power/power_helpers.c +2 −0
  431. drivers/gpu/drm/amd/include/kgd_pp_interface.h +7 −6
  432. drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +13 −11
  433. drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +1 −0
  434. drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +5 −3
  435. drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +7 −5
  436. drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c +21 −1
  437. drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +21 −0
  438. drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +24 −10
  439. drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +1 −1
  440. drivers/gpu/drm/bridge/tc358767.c +38 −10
  441. drivers/gpu/drm/drm_atomic_uapi.c +1 −2
  442. drivers/gpu/drm/drm_dp_helper.c +2 −0
  443. drivers/gpu/drm/drm_fb_helper.c +79 −54
  444. drivers/gpu/drm/drm_mode_object.c +2 −2
  445. drivers/gpu/drm/drm_modes.c +1 −1
  446. drivers/gpu/drm/drm_pci.c +3 −2
  447. drivers/gpu/drm/i915/gvt/handlers.c +1 −0
  448. drivers/gpu/drm/i915/gvt/hypercall.h +1 −1
  449. drivers/gpu/drm/i915/gvt/kvmgt.c +26 −4
  450. drivers/gpu/drm/i915/gvt/mpt.h +1 −1
  451. drivers/gpu/drm/i915/gvt/scheduler.c +48 −27
  452. drivers/gpu/drm/i915/gvt/scheduler.h +1 −0
  453. drivers/gpu/drm/i915/i915_debugfs.c +9 −3
  454. drivers/gpu/drm/i915/i915_gem_gtt.c +12 −3
  455. drivers/gpu/drm/i915/i915_gpu_error.c +14 −9
  456. drivers/gpu/drm/i915/i915_sysfs.c +3 −1
  457. drivers/gpu/drm/i915/intel_ddi.c +1 −1
  458. drivers/gpu/drm/i915/intel_display.c +44 −6
  459. drivers/gpu/drm/i915/intel_lrc.c +6 −1
  460. drivers/gpu/drm/i915/intel_psr.c +6 −0
  461. drivers/gpu/drm/i915/intel_sprite.c +1 −1
  462. drivers/gpu/drm/meson/meson_crtc.c +2 −21
  463. drivers/gpu/drm/meson/meson_drv.c +12 −2
  464. drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 −1
  465. drivers/gpu/drm/msm/adreno/adreno_gpu.c +0 −1
  466. drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +13 −13
  467. drivers/gpu/drm/msm/msm_drv.h +5 −1
  468. drivers/gpu/drm/msm/msm_gem.c +6 −2
  469. drivers/gpu/drm/msm/msm_gem_vma.c +3 −2
  470. drivers/gpu/drm/msm/msm_gpu.c +1 −1
  471. drivers/gpu/drm/msm/msm_gpu.h +1 −2
  472. drivers/gpu/drm/msm/msm_rd.c +6 −1
  473. drivers/gpu/drm/nouveau/nouveau_backlight.c +3 −0
  474. drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +33 −0
  475. drivers/gpu/drm/nouveau/nvkm/engine/falcon.c +5 −2
  476. drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c +4 −3
  477. drivers/gpu/drm/omapdrm/dss/dsi.c +19 −8
  478. drivers/gpu/drm/qxl/qxl_drv.c +0 −4
  479. drivers/gpu/drm/qxl/qxl_prime.c +0 −14
  480. drivers/gpu/drm/radeon/ci_dpm.c +3 −2
  481. drivers/gpu/drm/radeon/si_dpm.c +3 −2
  482. drivers/gpu/drm/rockchip/rockchip_rgb.c +4 −11
  483. drivers/gpu/drm/rockchip/rockchip_rgb.h +1 −10
  484. drivers/gpu/drm/sun4i/sun4i_backend.c +3 −2
  485. drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +4 −0
  486. drivers/gpu/drm/sun4i/sun4i_tcon.c +2 −0
  487. drivers/gpu/drm/virtio/virtgpu_drv.c +0 −4
  488. drivers/gpu/drm/virtio/virtgpu_drv.h +0 −4
  489. drivers/gpu/drm/virtio/virtgpu_prime.c +0 −14
  490. drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +32 −49
  491. drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +1 −1
  492. drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +3 −3
  493. drivers/gpu/vga/Kconfig +1 −0
  494. drivers/hid/hid-core.c +12 −11
  495. drivers/hid/hid-debug.c +47 −73
  496. drivers/hid/hid-ids.h +3 −0
  497. drivers/hid/i2c-hid/i2c-hid-core.c +2 −0
  498. drivers/hv/channel.c +1 −8
  499. drivers/hv/hv_balloon.c +6 −4
  500. drivers/hv/ring_buffer.c +15 −16
  501. drivers/hv/vmbus_drv.c +61 −30
  502. drivers/hwmon/lm80.c +3 −1
  503. drivers/hwmon/nct6775.c +7 −5
  504. drivers/hwmon/occ/common.c +12 −12
  505. drivers/hwmon/tmp421.c +1 −1
  506. drivers/i2c/busses/i2c-omap.c +5 −8
  507. drivers/i2c/busses/i2c-tegra.c +14 −1
  508. drivers/i2c/i2c-dev.c +6 −0
  509. drivers/i3c/master.c +1 −1
  510. drivers/i3c/master/dw-i3c-master.c +14 −11
  511. drivers/i3c/master/i3c-master-cdns.c +2 −2
  512. drivers/ide/ide-atapi.c +8 −1
  513. drivers/ide/ide-io.c +31 −30
  514. drivers/ide/ide-park.c +2 −0
  515. drivers/ide/ide-probe.c +16 −7
  516. drivers/ide/ide-proc.c +1 −1
  517. drivers/iio/adc/axp288_adc.c +60 −16
  518. drivers/iio/adc/ti-ads8688.c +2 −1
  519. drivers/iio/adc/ti_am335x_adc.c +4 −1
  520. drivers/iio/chemical/atlas-ph-sensor.c +3 −4
  521. drivers/infiniband/core/cma.c +4 −1
  522. drivers/infiniband/core/core_priv.h +0 −1
  523. drivers/infiniband/core/device.c +10 −3
  524. drivers/infiniband/core/nldev.c +0 −4
  525. drivers/infiniband/core/rdma_core.h +2 −0
  526. drivers/infiniband/core/umem_odp.c +3 −0
  527. drivers/infiniband/core/uverbs_cmd.c +10 −1
  528. drivers/infiniband/core/uverbs_ioctl.c +49 −13
  529. drivers/infiniband/core/uverbs_main.c +17 −9
  530. drivers/infiniband/core/uverbs_std_types_device.c +7 −1
  531. drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +2 −2
  532. drivers/infiniband/hw/bnxt_re/qplib_res.c +4 −4
  533. drivers/infiniband/hw/cxgb3/cxio_hal.c +3 −3
  534. drivers/infiniband/hw/cxgb4/qp.c +2 −3
  535. drivers/infiniband/hw/hfi1/file_ops.c +1 −1
  536. drivers/infiniband/hw/hfi1/init.c +15 −14
  537. drivers/infiniband/hw/hfi1/pio.c +4 −5
  538. drivers/infiniband/hw/hfi1/sdma.c +9 −18
  539. drivers/infiniband/hw/hfi1/ud.c +0 −1
  540. drivers/infiniband/hw/hns/hns_roce_alloc.c +6 −5
  541. drivers/infiniband/hw/hns/hns_roce_hw_v2.c +5 −5
  542. drivers/infiniband/hw/hns/hns_roce_srq.c +8 −2
  543. drivers/infiniband/hw/i40iw/i40iw_utils.c +2 −2
  544. drivers/infiniband/hw/mlx4/mad.c +3 −3
  545. drivers/infiniband/hw/mlx5/flow.c +1 −2
  546. drivers/infiniband/hw/mlx5/odp.c +5 −5
  547. drivers/infiniband/hw/mlx5/qp.c +9 −7
  548. drivers/infiniband/hw/mthca/mthca_memfree.c +3 −2
  549. drivers/infiniband/hw/mthca/mthca_provider.c +2 −2
  550. drivers/infiniband/hw/ocrdma/ocrdma_hw.c +7 −7
  551. drivers/infiniband/hw/ocrdma/ocrdma_stats.c +2 −2
  552. drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +3 −3
  553. drivers/infiniband/hw/qedr/verbs.c +2 −2
  554. drivers/infiniband/hw/qib/qib_ud.c +0 −1
  555. drivers/infiniband/hw/vmw_pvrdma/pvrdma.h +34 −1
  556. drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +2 −2
  557. drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c +6 −0
  558. drivers/infiniband/sw/rdmavt/qp.c +6 −1
  559. drivers/infiniband/ulp/ipoib/ipoib.h +0 −1
  560. drivers/infiniband/ulp/ipoib/ipoib_cm.c +1 −2
  561. drivers/input/joystick/xpad.c +3 −0
  562. drivers/input/misc/uinput.c +3 −2
  563. drivers/input/serio/olpc_apsp.c +2 −15
  564. drivers/input/touchscreen/Kconfig +1 −1
  565. drivers/input/touchscreen/raspberrypi-ts.c +2 −2
  566. drivers/iommu/amd_iommu.c +13 −6
  567. drivers/iommu/intel-iommu.c +5 −5
  568. drivers/iommu/mtk_iommu_v1.c +6 −3
  569. drivers/iommu/of_iommu.c +1 −1
  570. drivers/irqchip/irq-csky-apb-intc.c +42 −35
  571. drivers/irqchip/irq-gic-v3-its.c +92 −34
  572. drivers/irqchip/irq-gic-v3-mbi.c +1 −1
  573. drivers/irqchip/irq-madera.c +0 −2
  574. drivers/irqchip/irq-mmp.c +5 −1
  575. drivers/irqchip/irq-stm32-exti.c +1 −0
  576. drivers/irqchip/irq-xtensa-mx.c +25 −15
  577. drivers/irqchip/irq-xtensa-pic.c +5 −1
  578. drivers/isdn/hardware/avm/b1.c +1 −1
  579. drivers/isdn/hardware/mISDN/hfcsusb.c +1 −2
  580. drivers/isdn/i4l/isdn_tty.c +5 −1
  581. drivers/isdn/mISDN/timerdev.c +1 −1
  582. drivers/leds/leds-lp5523.c +3 −1
  583. drivers/md/dm-crypt.c +17 −8
  584. drivers/md/dm-rq.c +1 −1
  585. drivers/md/dm-thin-metadata.c +2 −2
  586. drivers/md/dm-thin-metadata.h +1 −1
  587. drivers/md/dm-thin.c +5 −5
  588. drivers/md/dm.c +32 −9
  589. drivers/md/md.c +1 −6
  590. drivers/md/raid5-cache.c +22 −11
  591. drivers/md/raid5.c +6 −2
  592. drivers/media/pci/intel/ipu3/ipu3-cio2.c +2 −2
  593. drivers/media/platform/mtk-vcodec/mtk_vcodec_util.c +1 −1
  594. drivers/media/platform/vim2m.c +3 −1
  595. drivers/media/v4l2-core/v4l2-ioctl.c +19 −5
  596. drivers/mfd/Kconfig +2 −1
  597. drivers/mfd/ab8500-core.c +1 −1
  598. drivers/mfd/axp20x.c +70 −56
  599. drivers/mfd/bd9571mwv.c +1 −0
  600. drivers/mfd/cros_ec_dev.c +1 −0
  601. drivers/mfd/db8500-prcmu.c +2 −2
  602. drivers/mfd/exynos-lpass.c +3 −1
  603. drivers/mfd/madera-core.c +4 −1
  604. drivers/mfd/max77620.c +1 −1
  605. drivers/mfd/mc13xxx-core.c +3 −1
  606. drivers/mfd/mt6397-core.c +1 −2
  607. drivers/mfd/qcom_rpm.c +4 −0
  608. drivers/mfd/rave-sp.c +1 −1
  609. drivers/mfd/stmpe.c +6 −6
  610. drivers/mfd/ti_am335x_tscadc.c +3 −2
  611. drivers/mfd/tps65218.c +3 −21
  612. drivers/mfd/tps6586x.c +24 −0
  613. drivers/mfd/twl-core.c +2 −2
  614. drivers/mfd/wm5110-tables.c +2 −0
  615. drivers/misc/genwqe/card_utils.c +2 −2
  616. drivers/misc/ibmvmc.c +5 −2
  617. drivers/misc/mei/client.c +4 −1
  618. drivers/misc/mei/hbm.c +9 −3
  619. drivers/misc/mei/hw-me-regs.h +4 −0
  620. drivers/misc/mei/pci-me.c +5 −1
  621. drivers/misc/mic/vop/vop_main.c +50 −32
  622. drivers/misc/pvpanic.c +4 −0
  623. drivers/mmc/core/host.c +1 −1
  624. drivers/mmc/host/Kconfig +2 −2
  625. drivers/mmc/host/bcm2835.c +2 −0
  626. drivers/mmc/host/dw_mmc-bluefield.c +0 −5
  627. drivers/mmc/host/meson-gx-mmc.c +20 −12
  628. drivers/mmc/host/mtk-sd.c +1 −1
  629. drivers/mmc/host/sdhci-iproc.c +4 −1
  630. drivers/mmc/host/sdhci.c +3 −2
  631. drivers/mtd/mtdcore.c +1 −1
  632. drivers/mtd/mtdcore.h +1 −1
  633. drivers/mtd/mtdpart.c +34 −5
  634. drivers/mtd/nand/raw/denali.c +1 −1
  635. drivers/mtd/nand/raw/fsmc_nand.c +0 −21
  636. drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c +6 −7
  637. drivers/mtd/nand/raw/jz4740_nand.c +1 −1
  638. drivers/mtd/nand/raw/nand_base.c +1 −0
  639. drivers/mtd/nand/raw/nand_bbt.c +1 −1
  640. drivers/mtd/nand/raw/qcom_nandc.c +10 −10
  641. drivers/mtd/nand/spi/core.c +22 −24
  642. drivers/net/Kconfig +1 −1
  643. drivers/net/bonding/bond_main.c +3 −0
  644. drivers/net/caif/caif_serial.c +1 −4
  645. drivers/net/can/dev.c +13 −14
  646. drivers/net/can/flexcan.c +2 −2
  647. drivers/net/dsa/b53/b53_srab.c +0 −3
  648. drivers/net/dsa/microchip/ksz_common.c +0 −2
  649. drivers/net/dsa/mt7530.c +0 −1
  650. drivers/net/dsa/mv88e6xxx/chip.c +113 −0
  651. drivers/net/dsa/mv88e6xxx/chip.h +5 −0
  652. drivers/net/dsa/mv88e6xxx/global1_atu.c +12 −9
  653. drivers/net/dsa/mv88e6xxx/port.h +10 −0
  654. drivers/net/dsa/mv88e6xxx/serdes.c +1 −1
  655. drivers/net/dsa/realtek-smi.c +13 −5
  656. drivers/net/ethernet/aeroflex/greth.c +6 −6
  657. drivers/net/ethernet/alacritech/slicoss.c +6 −6
  658. drivers/net/ethernet/alteon/acenic.c +1 −1
  659. drivers/net/ethernet/altera/altera_msgdma.c +2 −1
  660. drivers/net/ethernet/altera/altera_tse_main.c +3 −1
  661. drivers/net/ethernet/amazon/ena/ena_com.c +31 −30
  662. drivers/net/ethernet/amd/amd8111e.c +1 −1
  663. drivers/net/ethernet/amd/xgbe/xgbe-common.h +0 −2
  664. drivers/net/ethernet/amd/xgbe/xgbe-dev.c +16 −6
  665. drivers/net/ethernet/apm/xgene-v2/main.c +4 −4
  666. drivers/net/ethernet/apple/bmac.c +1 −1
  667. drivers/net/ethernet/atheros/alx/main.c +3 −4
  668. drivers/net/ethernet/atheros/atl1c/atl1c_main.c +2 −2
  669. drivers/net/ethernet/broadcom/b44.c +2 −2
  670. drivers/net/ethernet/broadcom/bcm63xx_enet.c +4 −4
  671. drivers/net/ethernet/broadcom/bcmsysport.c +12 −17
  672. drivers/net/ethernet/broadcom/bcmsysport.h +2 −0
  673. drivers/net/ethernet/broadcom/bgmac.c +6 −6
  674. drivers/net/ethernet/broadcom/bnx2.c +2 −2
  675. drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +1 −1
  676. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +1 −1
  677. drivers/net/ethernet/broadcom/bnxt/bnxt.c +23 −13
  678. drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c +2 −2
  679. drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +2 −2
  680. drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h +3 −2
  681. drivers/net/ethernet/broadcom/sb1250-mac.c +1 −1
  682. drivers/net/ethernet/broadcom/tg3.c +11 −11
  683. drivers/net/ethernet/cadence/macb.h +3 −0
  684. drivers/net/ethernet/cadence/macb_main.c +19 −17
  685. drivers/net/ethernet/cavium/Kconfig +0 −1
  686. drivers/net/ethernet/cavium/thunder/nicvf_queues.c +1 −1
  687. drivers/net/ethernet/chelsio/cxgb3/sge.c +8 −6
  688. drivers/net/ethernet/chelsio/cxgb3/t3_hw.c +3 −3
  689. drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c +4 −4
  690. drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c +1 −1
  691. drivers/net/ethernet/chelsio/cxgb4/sge.c +1 −1
  692. drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +1 −1
  693. drivers/net/ethernet/chelsio/cxgb4vf/sge.c +1 −1
  694. drivers/net/ethernet/cisco/enic/enic_main.c +2 −1
  695. drivers/net/ethernet/dec/tulip/de2104x.c +1 −1
  696. drivers/net/ethernet/emulex/benet/be_cmds.c +34 −34
  697. drivers/net/ethernet/emulex/benet/be_ethtool.c +9 −9
  698. drivers/net/ethernet/emulex/benet/be_main.c +9 −9
  699. drivers/net/ethernet/faraday/ftgmac100.c +6 −8
  700. drivers/net/ethernet/faraday/ftmac100.c +3 −4
  701. drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +6 −0
  702. drivers/net/ethernet/freescale/dpaa2/Kconfig +3 −2
  703. drivers/net/ethernet/freescale/fec_main.c +1 −1
  704. drivers/net/ethernet/freescale/fec_mpc52xx.c +1 −1
  705. drivers/net/ethernet/freescale/ucc_geth.c +2 −0
  706. drivers/net/ethernet/hisilicon/hix5hd2_gmac.c +2 −2
  707. drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c +2 −4
  708. drivers/net/ethernet/hisilicon/hns/hns_enet.c +12 −10
  709. drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +9 −7
  710. drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +2 −3
  711. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c +2 −3
  712. drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c +2 −3
  713. drivers/net/ethernet/hisilicon/hns_mdio.c +1 −1
  714. drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c +8 −8
  715. drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.c +4 −4
  716. drivers/net/ethernet/huawei/hinic/hinic_hw_io.c +3 −3
  717. drivers/net/ethernet/huawei/hinic/hinic_hw_qp.c +5 −5
  718. drivers/net/ethernet/huawei/hinic/hinic_hw_wq.c +4 −4
  719. drivers/net/ethernet/i825xx/82596.c +1 −1
  720. drivers/net/ethernet/ibm/emac/mal.c +2 −2
  721. drivers/net/ethernet/ibm/ibmveth.c +0 −2
  722. drivers/net/ethernet/intel/Kconfig +1 −1
  723. drivers/net/ethernet/intel/e1000/e1000_ethtool.c +4 −4
  724. drivers/net/ethernet/intel/e1000e/netdev.c +2 −2
  725. drivers/net/ethernet/intel/i40e/i40e_main.c +2 −2
  726. drivers/net/ethernet/intel/igb/igb.h +1 −1
  727. drivers/net/ethernet/intel/igb/igb_ethtool.c +2 −2
  728. drivers/net/ethernet/intel/igb/igb_main.c +7 −7
  729. drivers/net/ethernet/intel/ixgb/ixgb_main.c +4 −4
  730. drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +3 −3
  731. drivers/net/ethernet/marvell/octeontx2/af/cgx.c +3 −1
  732. drivers/net/ethernet/marvell/octeontx2/af/common.h +1 −1
  733. drivers/net/ethernet/marvell/pxa168_eth.c +9 −9
  734. drivers/net/ethernet/marvell/skge.c +4 −2
  735. drivers/net/ethernet/mediatek/mtk_eth_soc.c +9 −25
  736. drivers/net/ethernet/mellanox/mlx4/alloc.c +4 −4
  737. drivers/net/ethernet/mellanox/mlx4/cq.c +4 −2
  738. drivers/net/ethernet/mellanox/mlx4/fw.c +46 −29
  739. drivers/net/ethernet/mellanox/mlx4/icm.c +60 −41
  740. drivers/net/ethernet/mellanox/mlx4/icm.h +19 −3
  741. drivers/net/ethernet/mellanox/mlx5/core/alloc.c +2 −2
  742. drivers/net/ethernet/mellanox/mlx5/core/cmd.c +5 −5
  743. drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c +5 −1
  744. drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h +1 −1
  745. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +4 −1
  746. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1 −1
  747. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +44 −15
  748. drivers/net/ethernet/mellanox/mlx5/core/en_rep.h +1 −0
  749. drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +13 −0
  750. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +32 −20
  751. drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +6 −0
  752. drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +8 −14
  753. drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +1 −0
  754. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +9 −8
  755. drivers/net/ethernet/mellanox/mlx5/core/lag.c +21 −0
  756. drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +2 −0
  757. drivers/net/ethernet/mellanox/mlx5/core/qp.c +3 −2
  758. drivers/net/ethernet/mellanox/mlxsw/Kconfig +1 −0
  759. drivers/net/ethernet/mellanox/mlxsw/pci.c +9 −7
  760. drivers/net/ethernet/mellanox/mlxsw/pci_hw.h +2 −1
  761. drivers/net/ethernet/mellanox/mlxsw/spectrum.c +5 −2
  762. drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c +9 −1
  763. drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c +0 −2
  764. drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c +2 −2
  765. drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c +2 −2
  766. drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +16 −19
  767. drivers/net/ethernet/microchip/lan743x_main.c +4 −7
  768. drivers/net/ethernet/myricom/myri10ge/myri10ge.c +3 −3
  769. drivers/net/ethernet/netronome/nfp/nfp_net_common.c +6 −6
  770. drivers/net/ethernet/ni/nixge.c +6 −6
  771. drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +6 −6
  772. drivers/net/ethernet/pasemi/pasemi_mac.c +3 −3
  773. drivers/net/ethernet/qlogic/qed/qed.h +1 −1
  774. drivers/net/ethernet/qlogic/qed/qed_cxt.c +8 −8
  775. drivers/net/ethernet/qlogic/qed/qed_dev.c +4 −4
  776. drivers/net/ethernet/qlogic/qed/qed_l2.c +16 −4
  777. drivers/net/ethernet/qlogic/qed/qed_l2.h +3 −0
  778. drivers/net/ethernet/qlogic/qed/qed_ll2.c +19 −5
  779. drivers/net/ethernet/qlogic/qed/qed_sp.h +1 −0
  780. drivers/net/ethernet/qlogic/qed/qed_sp_commands.c +3 −0
  781. drivers/net/ethernet/qlogic/qed/qed_spq.c +7 −8
  782. drivers/net/ethernet/qlogic/qed/qed_sriov.c +8 −2
  783. drivers/net/ethernet/qlogic/qed/qed_vf.c +10 −0
  784. drivers/net/ethernet/qlogic/qede/qede.h +4 −1
  785. drivers/net/ethernet/qlogic/qede/qede_fp.c +13 −0
  786. drivers/net/ethernet/qlogic/qede/qede_main.c +3 −0
  787. drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c +14 −14
  788. drivers/net/ethernet/qualcomm/emac/emac-mac.c +1 −1
  789. drivers/net/ethernet/realtek/8139cp.c +1 −1
  790. drivers/net/ethernet/realtek/r8169.c +7 −2
  791. drivers/net/ethernet/renesas/ravb_main.c +7 −5
  792. drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c +6 −6
  793. drivers/net/ethernet/sfc/ef10.c +21 −8
  794. drivers/net/ethernet/sfc/falcon/nic.c +2 −2
  795. drivers/net/ethernet/sfc/nic.c +2 −2
  796. drivers/net/ethernet/sgi/meth.c +2 −2
  797. drivers/net/ethernet/smsc/epic100.c +1 −1
  798. drivers/net/ethernet/socionext/netsec.c +2 −2
  799. drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +3 −1
  800. drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c +3 −3
  801. drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +10 −4
  802. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +55 −53
  803. drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +10 −0
  804. drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c +2 −0
  805. drivers/net/ethernet/sun/cassini.c +2 −15
  806. drivers/net/ethernet/sun/cassini.h +1 −14
  807. drivers/net/ethernet/sun/sunbmac.c +1 −1
  808. drivers/net/ethernet/sun/sunhme.c +1 −1
  809. drivers/net/ethernet/tehuti/tehuti.c +1 −1
  810. drivers/net/ethernet/ti/cpmac.c +1 −1
  811. drivers/net/ethernet/tundra/tsi108_eth.c +4 −4
  812. drivers/net/ethernet/via/via-velocity.c +1 −1
  813. drivers/net/ethernet/xilinx/ll_temac_main.c +6 −6
  814. drivers/net/ethernet/xilinx/xilinx_axienet_main.c +6 −6
  815. drivers/net/fddi/defxx.c +4 −4
  816. drivers/net/fddi/skfp/skfddi.c +4 −4
  817. drivers/net/geneve.c +7 −3
  818. drivers/net/hyperv/hyperv_net.h +8 −4
  819. drivers/net/hyperv/netvsc.c +2 −2
  820. drivers/net/hyperv/netvsc_drv.c +92 −53
  821. drivers/net/hyperv/rndis_filter.c +27 −9
  822. drivers/net/ieee802154/mcr20a.c +3 −3
  823. drivers/net/ipvlan/ipvlan_main.c +3 −3
  824. drivers/net/macvlan.c +1 −1
  825. drivers/net/phy/asix.c +1 −7
  826. drivers/net/phy/bcm87xx.c +2 −0
  827. drivers/net/phy/cortina.c +1 −0
  828. drivers/net/phy/dp83640.c +10 −3
  829. drivers/net/phy/marvell.c +35 −18
  830. drivers/net/phy/mdio-hisi-femac.c +2 −14
  831. drivers/net/phy/mdio_bus.c +1 −0
  832. drivers/net/phy/meson-gxl.c +1 −0
  833. drivers/net/phy/micrel.c +2 −0
  834. drivers/net/phy/phy.c +7 −12
  835. drivers/net/phy/phy_device.c +17 −0
  836. drivers/net/phy/rockchip.c +2 −7
  837. drivers/net/phy/teranetics.c +1 −0
  838. drivers/net/ppp/pppoe.c +1 −0
  839. drivers/net/tun.c +8 −6
  840. drivers/net/usb/aqc111.c +15 −0
  841. drivers/net/usb/asix_devices.c +7 −2
  842. drivers/net/usb/cdc_ether.c +19 −15
  843. drivers/net/usb/qmi_wwan.c +1 −0
  844. drivers/net/virtio_net.c +129 −52
  845. drivers/net/vmxnet3/vmxnet3_drv.c +4 −4
  846. drivers/net/wan/dscc4.c +1 −1
  847. drivers/net/wan/fsl_ucc_hdlc.c +65 −6
  848. drivers/net/wireless/ath/ath10k/ce.c +3 −4
  849. drivers/net/wireless/ath/ath10k/core.c +1 −1
  850. drivers/net/wireless/ath/ath10k/mac.c +4 −4
  851. drivers/net/wireless/ath/ath10k/pci.c +1 −2
  852. drivers/net/wireless/ath/ath10k/wmi.c +1 −1
  853. drivers/net/wireless/ath/wcn36xx/dxe.c +8 −9
  854. drivers/net/wireless/ath/wil6210/txrx_edma.c +4 −4
  855. drivers/net/wireless/broadcom/b43/dma.c +3 −3
  856. drivers/net/wireless/broadcom/b43legacy/dma.c +3 −3
  857. drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +8 −8
  858. drivers/net/wireless/intel/iwlwifi/Kconfig +2 −1
  859. drivers/net/wireless/intel/iwlwifi/pcie/rx.c +15 −24
  860. drivers/net/wireless/mac80211_hwsim.c +5 −0
  861. drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c +19 −21
  862. drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.h +1 −1
  863. drivers/net/wireless/mediatek/mt76/mt76x0/phy.c +5 −5
  864. drivers/net/wireless/ralink/rt2x00/rt2x00mmio.c +3 −3
  865. drivers/net/wireless/ti/wlcore/sdio.c +7 −8
  866. drivers/net/wireless/virt_wifi.c +3 −1
  867. drivers/ntb/hw/mscc/ntb_hw_switchtec.c +4 −4
  868. drivers/nvdimm/dimm.c +6 −0
  869. drivers/nvdimm/dimm_devs.c +17 −5
  870. drivers/nvdimm/nd-core.h +2 −2
  871. drivers/nvdimm/nd.h +1 −0
  872. drivers/nvme/host/core.c +17 −10
  873. drivers/nvme/host/fabrics.c +2 −0
  874. drivers/nvme/host/multipath.c +3 −2
  875. drivers/nvme/host/nvme.h +6 −0
  876. drivers/nvme/host/pci.c +76 −42
  877. drivers/nvme/host/rdma.c +43 −21
  878. drivers/nvme/host/tcp.c +17 −18
  879. drivers/nvme/target/rdma.c +14 −1
  880. drivers/nvme/target/tcp.c +1 −1
  881. drivers/of/dynamic.c +0 −3
  882. drivers/of/fdt.c +0 −4
  883. drivers/of/overlay.c +0 −3
  884. drivers/of/pdt.c +0 −1
  885. drivers/of/property.c +1 −0
  886. drivers/opp/core.c +58 −5
  887. drivers/pci/Kconfig +8 −14
  888. drivers/pci/controller/dwc/pci-imx6.c +7 −4
  889. drivers/pci/controller/dwc/pci-meson.c +1 −0
  890. drivers/pci/controller/dwc/pcie-armada8k.c +0 −16
  891. drivers/pci/controller/pcie-iproc-msi.c +3 −3
  892. drivers/pci/msi.c +13 −9
  893. drivers/pci/pci.c +2 −1
  894. drivers/pci/quirks.c +3 −2
  895. drivers/pci/switch/switchtec.c +4 −4
  896. drivers/phy/marvell/phy-berlin-sata.c +3 −2
  897. drivers/phy/qualcomm/phy-ath79-usb.c +2 −2
  898. drivers/phy/ti/Kconfig +1 −0
  899. drivers/phy/ti/phy-gmii-sel.c +2 −2
  900. drivers/pinctrl/intel/pinctrl-cherryview.c +4 −4
  901. drivers/pinctrl/mediatek/Kconfig +3 −0
  902. drivers/pinctrl/pinctrl-mcp23s08.c +6 −1
  903. drivers/pinctrl/sunxi/pinctrl-sun50i-h6.c +1 −1
  904. drivers/pinctrl/sunxi/pinctrl-sunxi.c +22 −22
  905. drivers/pinctrl/sunxi/pinctrl-sunxi.h +1 −1
  906. drivers/platform/x86/Kconfig +5 −3
  907. drivers/ptp/ptp_chardev.c +2 −1
  908. drivers/rapidio/devices/tsi721.c +11 −11
  909. drivers/rapidio/devices/tsi721_dma.c +4 −4
  910. drivers/remoteproc/remoteproc_virtio.c +7 −2
  911. drivers/reset/Kconfig +14 −6
  912. drivers/reset/Makefile +2 −1
  913. drivers/reset/core.c +42 −0
  914. drivers/reset/reset-hsdk.c +1 −0
  915. drivers/reset/reset-simple.c +3 −10
  916. drivers/reset/reset-socfpga.c +88 −0
  917. drivers/reset/reset-uniphier-glue.c +31 −19
  918. drivers/s390/char/sclp_config.c +2 −0
  919. drivers/s390/net/ism_drv.c +7 −8
  920. drivers/s390/net/qeth_core.h +2 −1
  921. drivers/s390/net/qeth_core_main.c +20 −11
  922. drivers/s390/net/qeth_l2_main.c +6 −2
  923. drivers/s390/net/qeth_l3_main.c +3 −0
  924. drivers/s390/scsi/zfcp_aux.c +0 −1
  925. drivers/s390/scsi/zfcp_scsi.c +2 −0
  926. drivers/s390/virtio/virtio_ccw.c +9 −3
  927. drivers/scsi/3w-sas.c +3 −2
  928. drivers/scsi/53c700.c +1 −1
  929. drivers/scsi/a100u2w.c +4 −4
  930. drivers/scsi/aacraid/linit.c +4 −5
  931. drivers/scsi/aic94xx/aic94xx_init.c +4 −4
  932. drivers/scsi/arcmsr/arcmsr_hba.c +12 −6
  933. drivers/scsi/be2iscsi/be_main.c +2 −2
  934. drivers/scsi/be2iscsi/be_mgmt.c +5 −6
  935. drivers/scsi/bfa/bfad_bsg.c +3 −3
  936. drivers/scsi/bnx2fc/bnx2fc_hwi.c +24 −25
  937. drivers/scsi/bnx2fc/bnx2fc_io.c +2 −2
  938. drivers/scsi/bnx2fc/bnx2fc_tgt.c +22 −22
  939. drivers/scsi/bnx2i/bnx2i_hwi.c +4 −4
  940. drivers/scsi/csiostor/csio_attr.c +1 −1
  941. drivers/scsi/csiostor/csio_wr.c +2 −2
  942. drivers/scsi/cxgbi/cxgb3i/cxgb3i.c +4 −5
  943. drivers/scsi/cxgbi/cxgb4i/cxgb4i.c +20 −8
  944. drivers/scsi/cxgbi/libcxgbi.c +4 −3
  945. drivers/scsi/cxgbi/libcxgbi.h +3 −2
  946. drivers/scsi/cxlflash/main.c +2 −0
  947. drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +6 −6
  948. drivers/scsi/isci/init.c +7 −7
  949. drivers/scsi/libfc/fc_lport.c +3 −3
  950. drivers/scsi/libfc/fc_rport.c +0 −1
  951. drivers/scsi/lpfc/lpfc_bsg.c +2 −2
  952. drivers/scsi/lpfc/lpfc_init.c +7 −7
  953. drivers/scsi/lpfc/lpfc_mbox.c +3 −3
  954. drivers/scsi/lpfc/lpfc_nvme.c +9 −7
  955. drivers/scsi/lpfc/lpfc_nvme.h +1 −1
  956. drivers/scsi/lpfc/lpfc_nvmet.c +5 −3
  957. drivers/scsi/lpfc/lpfc_nvmet.h +1 −1
  958. drivers/scsi/lpfc/lpfc_sli.c +18 −17
  959. drivers/scsi/megaraid/megaraid_mbox.c +8 −7
  960. drivers/scsi/megaraid/megaraid_sas_base.c +14 −14
  961. drivers/scsi/megaraid/megaraid_sas_fusion.c +5 −3
  962. drivers/scsi/mesh.c +3 −2
  963. drivers/scsi/mvumi.c +5 −4
  964. drivers/scsi/pm8001/pm8001_sas.c +3 −3
  965. drivers/scsi/qedf/qedf_main.c +17 −12
  966. drivers/scsi/qedi/qedi_iscsi.c +3 −0
  967. drivers/scsi/qedi/qedi_iscsi.h +1 −0
  968. drivers/scsi/qedi/qedi_main.c +19 −20
  969. drivers/scsi/qla1280.c +1 −1
  970. drivers/scsi/qla2xxx/qla_attr.c +2 −2
  971. drivers/scsi/qla2xxx/qla_bsg.c +2 −2
  972. drivers/scsi/qla2xxx/qla_def.h +2 −0
  973. drivers/scsi/qla2xxx/qla_gs.c +8 −6
  974. drivers/scsi/qla2xxx/qla_init.c +4 −4
  975. drivers/scsi/qla2xxx/qla_isr.c +1 −0
  976. drivers/scsi/qla2xxx/qla_os.c +1 −1
  977. drivers/scsi/qla4xxx/ql4_init.c +2 −2
  978. drivers/scsi/qla4xxx/ql4_mbx.c +9 −9
  979. drivers/scsi/qla4xxx/ql4_nx.c +2 −2
  980. drivers/scsi/qla4xxx/ql4_os.c +7 −5
  981. drivers/scsi/scsi_debug.c +21 −20
  982. drivers/scsi/scsi_lib.c +2 −2
  983. drivers/scsi/scsi_pm.c +15 −11
  984. drivers/scsi/sd.c +6 −0
  985. drivers/scsi/sd_zbc.c +8 −4
  986. drivers/scsi/smartpqi/smartpqi_init.c +17 −17
  987. drivers/scsi/ufs/ufs.h +1 −1
  988. drivers/scsi/ufs/ufshcd.c +10 −2
  989. drivers/soc/fsl/qbman/dpaa_sys.c +1 −1
  990. drivers/soc/fsl/qbman/qman.c +5 −4
  991. drivers/soc/fsl/qe/qe_tdm.c +0 −55
  992. drivers/soc/renesas/Kconfig +1 −1
  993. drivers/soc/renesas/r8a774c0-sysc.c +4 −19
  994. drivers/spi/spi-pic32-sqi.c +3 −3
  995. drivers/staging/android/ion/ion.c +1 −1
  996. drivers/staging/mt7621-eth/mtk_eth_soc.c +1 −2
  997. drivers/staging/octeon/ethernet-mdio.c +1 −1
  998. drivers/staging/rtl8188eu/core/rtw_security.c +3 −3
  999. drivers/staging/rtl8188eu/os_dep/usb_intf.c +1 −0
  1000. drivers/staging/rtl8723bs/include/ieee80211.h +3 −3
  1001. drivers/staging/rtl8723bs/os_dep/sdio_intf.c +1 −1
  1002. drivers/staging/speakup/spk_ttyio.c +4 −2
  1003. drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +2 −4
  1004. drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +1 −0
  1005. drivers/staging/vt6655/device_main.c +6 −13
  1006. drivers/staging/wilc1000/host_interface.c +2 −3
  1007. drivers/staging/wilc1000/wilc_wlan.c +4 −3
  1008. drivers/target/iscsi/iscsi_target.c +1 −1
  1009. drivers/target/target_core_configfs.c +7 −1
  1010. drivers/target/target_core_user.c +62 −27
  1011. drivers/thermal/intel/int340x_thermal/Kconfig +1 −1
  1012. drivers/thermal/intel/int340x_thermal/processor_thermal_device.c +16 −14
  1013. drivers/tty/n_hdlc.c +1 −0
  1014. drivers/tty/serial/8250/8250_core.c +9 −8
  1015. drivers/tty/serial/8250/8250_mtk.c +3 −0
  1016. drivers/tty/serial/8250/8250_pci.c +5 −4
  1017. drivers/tty/serial/Kconfig +12 −0
  1018. drivers/tty/serial/Makefile +1 −0
  1019. drivers/tty/serial/earlycon-riscv-sbi.c +31 −0
  1020. drivers/tty/serial/fsl_lpuart.c +1 −1
  1021. drivers/tty/serial/lantiq.c +19 −17
  1022. drivers/tty/serial/qcom_geni_serial.c +2 −2
  1023. drivers/tty/serial/serial_core.c +14 −4
  1024. drivers/tty/serial/sh-sci.c +8 −1
  1025. drivers/tty/tty_io.c +15 −8
  1026. drivers/tty/vt/vt.c +17 −33
  1027. drivers/usb/chipidea/ci_hdrc_imx.c +2 −1
  1028. drivers/usb/class/cdc-acm.c +7 −0
  1029. drivers/usb/core/generic.c +6 −3
  1030. drivers/usb/core/ledtrig-usbport.c +10 −7
  1031. drivers/usb/core/quirks.c +2 −1
  1032. drivers/usb/dwc2/gadget.c +1 −1
  1033. drivers/usb/dwc3/dwc3-exynos.c +2 −2
  1034. drivers/usb/dwc3/gadget.c +5 −1
  1035. drivers/usb/gadget/function/f_sourcesink.c +1 −1
  1036. drivers/usb/gadget/udc/bdc/bdc_core.c +6 −7
  1037. drivers/usb/gadget/udc/net2272.c +1 −1
  1038. drivers/usb/host/ehci-mv.c +1 −0
  1039. drivers/usb/host/uhci-hcd.c +3 −3
  1040. drivers/usb/host/xhci-mem.c +4 −4
  1041. drivers/usb/musb/musb_gadget.c +1 −12
  1042. drivers/usb/musb/musbhsdma.c +11 −10
  1043. drivers/usb/phy/Kconfig +1 −1
  1044. drivers/usb/phy/phy-am335x.c +1 −4
  1045. drivers/usb/serial/ftdi_sio.c +14 −1
  1046. drivers/usb/serial/keyspan_usa26msg.h +1 −0
  1047. drivers/usb/serial/keyspan_usa28msg.h +1 −0
  1048. drivers/usb/serial/keyspan_usa49msg.h +1 −0
  1049. drivers/usb/serial/keyspan_usa67msg.h +1 −0
  1050. drivers/usb/serial/keyspan_usa90msg.h +1 −0
  1051. drivers/usb/serial/pl2303.c +1 −0
  1052. drivers/usb/serial/pl2303.h +2 −0
  1053. drivers/usb/serial/usb-serial-simple.c +2 −1
  1054. drivers/usb/storage/scsiglue.c +6 −2
  1055. drivers/usb/storage/unusual_devs.h +12 −0
  1056. drivers/usb/typec/tcpm/tcpm.c +2 −1
  1057. drivers/usb/usbip/README +0 −7
  1058. drivers/vfio/pci/trace.h +2 −6
  1059. drivers/vfio/pci/vfio_pci_nvlink2.c +16 −20
  1060. drivers/vfio/vfio_iommu_type1.c +1 −1
  1061. drivers/vhost/net.c +4 −2
  1062. drivers/vhost/scsi.c +13 −9
  1063. drivers/vhost/vhost.c +93 −19
  1064. drivers/vhost/vhost.h +5 −2
  1065. drivers/vhost/vsock.c +2 −2
  1066. drivers/video/backlight/88pm860x_bl.c +1 −1
  1067. drivers/video/backlight/pwm_bl.c +17 −11
  1068. drivers/video/console/vgacon.c +4 −3
  1069. drivers/video/fbdev/core/fbcon.c +7 −0
  1070. drivers/video/fbdev/core/fbmem.c +10 −9
  1071. drivers/video/fbdev/da8xx-fb.c +3 −3
  1072. drivers/video/fbdev/offb.c +9 −9
  1073. drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c +2 −0
  1074. drivers/video/logo/Kconfig +0 −9
  1075. drivers/virtio/virtio_balloon.c +65 −33
  1076. drivers/virtio/virtio_mmio.c +7 −2
  1077. drivers/virtio/virtio_pci_common.c +4 −4
  1078. drivers/virtio/virtio_ring.c +14 −1
  1079. drivers/watchdog/mt7621_wdt.c +1 −0
  1080. drivers/watchdog/rt2880_wdt.c +1 −0
  1081. drivers/watchdog/tqmx86_wdt.c +4 −4
  1082. drivers/xen/events/events_base.c +1 −1
  1083. drivers/xen/pvcalls-back.c +4 −5
  1084. drivers/xen/pvcalls-front.c +75 −29
  1085. drivers/xen/swiotlb-xen.c +2 −2
  1086. fs/afs/flock.c +2 −2
  1087. fs/afs/inode.c +2 −1
  1088. fs/afs/protocol_yfs.h +11 −0
  1089. fs/afs/rxrpc.c +42 −11
  1090. fs/afs/server_list.c +1 −3
  1091. fs/afs/yfsclient.c +1 −1
  1092. fs/aio.c +1 −0
  1093. fs/autofs/expire.c +2 −1
  1094. fs/autofs/inode.c +3 −1
  1095. fs/block_dev.c +18 −10
  1096. fs/btrfs/ctree.c +50 −26
  1097. fs/btrfs/ctree.h +7 −0
  1098. fs/btrfs/disk-io.c +12 −0
  1099. fs/btrfs/extent-tree.c +14 −7
  1100. fs/btrfs/inode.c +2 −3
  1101. fs/btrfs/ioctl.c +43 −6
  1102. fs/btrfs/super.c +3 −0
  1103. fs/btrfs/transaction.c +16 −8
  1104. fs/btrfs/volumes.c +14 −2
  1105. fs/buffer.c +10 −9
  1106. fs/ceph/addr.c +1 −4
  1107. fs/ceph/caps.c +2 −0
  1108. fs/ceph/quota.c +0 −13
  1109. fs/ceph/super.c +2 −2
  1110. fs/cifs/cifs_debug.c +1 −0
  1111. fs/cifs/cifsfs.h +1 −1
  1112. fs/cifs/cifsglob.h +20 −0
  1113. fs/cifs/cifssmb.c +43 −22
  1114. fs/cifs/connect.c +25 −3
  1115. fs/cifs/dfs_cache.c +1 −0
  1116. fs/cifs/file.c +43 −13
  1117. fs/cifs/inode.c +10 −0
  1118. fs/cifs/smb2file.c +6 −2
  1119. fs/cifs/smb2inode.c +17 −0
  1120. fs/cifs/smb2misc.c +7 −0
  1121. fs/cifs/smb2ops.c +50 −22
  1122. fs/cifs/smb2pdu.c +75 −33
  1123. fs/cifs/smb2pdu.h +15 −4
  1124. fs/cifs/trace.c +0 −10
  1125. fs/cifs/trace.h +0 −10
  1126. fs/cifs/transport.c +83 −30
  1127. fs/dcache.c +33 −5
  1128. fs/debugfs/inode.c +24 −12
  1129. fs/direct-io.c +3 −2
  1130. fs/drop_caches.c +7 −1
  1131. fs/fs-writeback.c +38 −2
  1132. fs/fuse/dev.c +3 −1
  1133. fs/fuse/file.c +1 −1
  1134. fs/fuse/inode.c +1 −1
  1135. fs/gfs2/rgrp.c +1 −1
  1136. fs/hugetlbfs/inode.c +33 −28
  1137. fs/iomap.c +30 −7
  1138. fs/nfs/nfs4file.c +1 −7
  1139. fs/nfs/super.c +5 −0
  1140. fs/nfs/write.c +5 −4
  1141. fs/nfsd/vfs.c +4 −2
  1142. fs/notify/inotify/inotify_user.c +4 −2
  1143. fs/proc/generic.c +3 −1
  1144. fs/proc/internal.h +1 −0
  1145. fs/proc/proc_net.c +20 −0
  1146. fs/pstore/ram.c +4 −8
  1147. fs/sysfs/dir.c +2 −1
  1148. fs/sysfs/file.c +4 −2
  1149. fs/sysfs/group.c +2 −1
  1150. fs/sysfs/symlink.c +2 −1
  1151. fs/xfs/scrub/repair.c +8 −3
  1152. fs/xfs/xfs_aops.c +2 −0
  1153. fs/xfs/xfs_buf.c +17 −2
  1154. include/drm/drm_dp_helper.h +7 −0
  1155. include/drm/drm_dp_mst_helper.h +2 −1
  1156. include/dt-bindings/clock/imx8mq-clock.h +13 −13
  1157. include/dt-bindings/clock/marvell,mmp2.h +0 −1
  1158. include/dt-bindings/reset/amlogic,meson-axg-reset.h +1 −2
  1159. include/linux/backing-dev-defs.h +1 −0
  1160. include/linux/bcma/bcma_soc.h +1 −0
  1161. include/linux/blk_types.h +1 −1
  1162. include/linux/blktrace_api.h +7 −1
  1163. include/linux/bpf_verifier.h +1 −0
  1164. include/linux/bpfilter.h +12 −3
  1165. include/linux/ceph/libceph.h +4 −2
  1166. include/linux/ceph/osd_client.h +0 −1
  1167. include/linux/compiler-clang.h +2 −3
  1168. include/linux/compiler-gcc.h +1 −5
  1169. include/linux/compiler-intel.h +1 −3
  1170. include/linux/compiler.h +3 −1
  1171. include/linux/cpu.h +0 −2
  1172. include/linux/dcache.h +4 −3
  1173. include/linux/dma-mapping.h +0 −9
  1174. include/linux/fb.h +1 −0
  1175. include/linux/filter.h +18 −3
  1176. include/linux/fs.h +5 −4
  1177. include/linux/hid-debug.h +4 −5
  1178. include/linux/hid.h +1 −2
  1179. include/linux/hyperv.h +3 −2
  1180. include/linux/ide.h +2 −0
  1181. include/linux/if_arp.h +1 −0
  1182. include/linux/interrupt.h +1 −0
  1183. include/linux/irqchip/arm-gic-v3.h +1 −1
  1184. include/linux/libnvdimm.h +1 −1
  1185. include/linux/memory_hotplug.h +10 −8
  1186. include/linux/mfd/cros_ec_commands.h +94 −0
  1187. include/linux/mfd/ingenic-tcu.h +1 −1
  1188. include/linux/mfd/madera/core.h +7 −0
  1189. include/linux/mfd/ti_am335x_tscadc.h +4 −0
  1190. include/linux/mfd/tmio.h +1 −1
  1191. include/linux/mmzone.h +6 −0
  1192. include/linux/module.h +1 −1
  1193. include/linux/netdevice.h +8 −0
  1194. include/linux/of.h +0 −1
  1195. include/linux/pci-dma-compat.h +1 −1
  1196. include/linux/phy.h +4 −2
  1197. include/linux/phy/phy.h +1 −0
  1198. include/linux/pm_opp.h +5 −0
  1199. include/linux/pm_runtime.h +1 −1
  1200. include/linux/qcom_scm.h +1 −0
  1201. include/linux/qed/qed_chain.h +31 −0
  1202. include/linux/reset.h +11 −4
  1203. include/linux/sched.h +10 −1
  1204. include/linux/sched/coredump.h +1 −0
  1205. include/linux/sched/wake_q.h +5 −1
  1206. include/linux/signal.h +1 −1
  1207. include/linux/skbuff.h +1 −0
  1208. include/linux/stmmac.h +1 −0
  1209. include/linux/umh.h +2 −0
  1210. include/linux/virtio_config.h +9 −4
  1211. include/linux/xarray.h +170 −57
  1212. include/net/af_rxrpc.h +0 −16
  1213. include/net/ax25.h +12 −0
  1214. include/net/ip_fib.h +1 −1
  1215. include/net/l3mdev.h +2 −1
  1216. include/net/netfilter/nf_flow_table.h +0 −1
  1217. include/net/netfilter/nf_tables.h +13 −4
  1218. include/net/tls.h +2 −0
  1219. include/rdma/ib_verbs.h +22 −2
  1220. include/sound/compress_driver.h +5 −1
  1221. include/sound/hda_codec.h +1 −0
  1222. include/sound/soc.h +6 −0
  1223. include/trace/events/afs.h +2 −0
  1224. include/uapi/linux/android/binderfs.h +5 −5
  1225. include/uapi/linux/audit.h +2 −0
  1226. include/uapi/linux/blkzoned.h +1 −0
  1227. include/uapi/linux/in.h +1 −1
  1228. include/uapi/linux/input.h +5 −1
  1229. include/uapi/linux/ptp_clock.h +1 −1
  1230. include/uapi/linux/virtio_config.h +6 −0
  1231. include/uapi/linux/virtio_ring.h +0 −10
  1232. include/uapi/rdma/hns-abi.h +5 −0
  1233. include/uapi/rdma/vmw_pvrdma-abi.h +1 −0
  1234. include/xen/arm/page-coherent.h +3 −94
  1235. init/Kconfig +13 −1
  1236. kernel/bpf/btf.c +9 −8
  1237. kernel/bpf/cgroup.c +2 −1
  1238. kernel/bpf/hashtab.c +2 −2
  1239. kernel/bpf/map_in_map.c +15 −2
  1240. kernel/bpf/percpu_freelist.c +29 −12
  1241. kernel/bpf/percpu_freelist.h +4 −0
  1242. kernel/bpf/stackmap.c +9 −3
  1243. kernel/bpf/syscall.c +10 −2
  1244. kernel/bpf/verifier.c +48 −13
  1245. kernel/cpu.c +5 −33
  1246. kernel/dma/swiotlb.c +2 −0
  1247. kernel/events/core.c +7 −7
  1248. kernel/events/ring_buffer.c +3 −0
  1249. kernel/exit.c +12 −3
  1250. kernel/fork.c +12 −2
  1251. kernel/futex.c +28 −17
  1252. kernel/irq/irqdesc.c +1 −1
  1253. kernel/irq/manage.c +3 −0
  1254. kernel/locking/rtmutex.c +32 −5
  1255. kernel/locking/rwsem-xadd.c +9 −2
  1256. kernel/relay.c +3 −1
  1257. kernel/sched/core.c +16 −3
  1258. kernel/sched/fair.c +1 −0
  1259. kernel/sched/psi.c +17 −4
  1260. kernel/seccomp.c +4 −0
  1261. kernel/signal.c +59 −4
  1262. kernel/smp.c +0 −2
  1263. kernel/sys.c +2 −1
  1264. kernel/time/posix-cpu-timers.c +1 −0
  1265. kernel/trace/bpf_trace.c +2 −12
  1266. kernel/trace/trace_kprobe.c +9 −3
  1267. kernel/trace/trace_uprobe.c +8 −1
  1268. kernel/umh.c +31 −2
  1269. kernel/workqueue.c +23 −0
  1270. kernel/workqueue_internal.h +5 −1
  1271. lib/int_sqrt.c +1 −1
  1272. lib/sbitmap.c +3 −10
  1273. lib/test_kmod.c +1 −1
  1274. lib/test_rhashtable.c +15 −8
  1275. lib/test_xarray.c +45 −12
  1276. lib/xarray.c +54 −38
  1277. mm/backing-dev.c +1 −0
  1278. mm/hugetlb.c +26 −58
  1279. mm/kasan/Makefile +1 −0
  1280. mm/kasan/common.c +43 −22
  1281. mm/memory-failure.c +4 −15
  1282. mm/memory.c +24 −2
  1283. mm/memory_hotplug.c +27 −35
  1284. mm/migrate.c +6 −19
  1285. mm/mincore.c +81 −13
  1286. mm/oom_kill.c +10 −2
  1287. mm/page_alloc.c +7 −13
  1288. mm/rmap.c +2 −6
  1289. mm/slab.c +4 −2
  1290. mm/slub.c +2 −0
  1291. mm/usercopy.c +5 −4
  1292. mm/userfaultfd.c +2 −9
  1293. mm/util.c +1 −1
  1294. net/ax25/ax25_ip.c +2 −2
  1295. net/ax25/ax25_route.c +8 −11
  1296. net/batman-adv/bat_v_elp.c +3 −0
  1297. net/batman-adv/hard-interface.c +3 −2
  1298. net/batman-adv/soft-interface.c +2 −0
  1299. net/bpfilter/bpfilter_kern.c +42 −34
  1300. net/bpfilter/bpfilter_umh_blob.S +1 −1
  1301. net/bridge/br_fdb.c +5 −0
  1302. net/bridge/br_forward.c +5 −5
  1303. net/bridge/br_netfilter_hooks.c +1 −1
  1304. net/bridge/br_netfilter_ipv6.c +1 −0
  1305. net/bridge/br_private.h +1 −0
  1306. net/bridge/br_vlan.c +13 −13
  1307. net/bridge/netfilter/ebtables.c +10 −5
  1308. net/bridge/netfilter/nft_reject_bridge.c +1 −0
  1309. net/can/bcm.c +27 −0
  1310. net/can/gw.c +27 −3
  1311. net/ceph/ceph_common.c +10 −1
  1312. net/ceph/debugfs.c +1 −1
  1313. net/ceph/messenger.c +3 −2
  1314. net/ceph/osd_client.c +2 −2
  1315. net/core/dev.c +3 −0
  1316. net/core/filter.c +23 −13
  1317. net/core/lwt_bpf.c +1 −0
  1318. net/core/neighbour.c +10 −5
  1319. net/core/skbuff.c +1 −6
  1320. net/core/skmsg.c +1 −2
  1321. net/dccp/ccid.h +2 −2
  1322. net/decnet/dn_dev.c +1 −1
  1323. net/dsa/master.c +4 −0
  1324. net/dsa/slave.c +10 −7
  1325. net/ipv4/bpfilter/sockopt.c +48 −10
  1326. net/ipv4/devinet.c +1 −1
  1327. net/ipv4/fib_frontend.c +2 −2
  1328. net/ipv4/fib_trie.c +12 −3
  1329. net/ipv4/fou.c +9 −3
  1330. net/ipv4/gre_demux.c +17 −0
  1331. net/ipv4/ip_gre.c +20 −19
  1332. net/ipv4/ip_input.c +1 −0
  1333. net/ipv4/ip_sockglue.c +5 −7
  1334. net/ipv4/ip_tunnel.c +7 −1
  1335. net/ipv4/ip_vti.c +50 −0
  1336. net/ipv4/netfilter/ipt_CLUSTERIP.c +1 −1
  1337. net/ipv4/tcp.c +1 −1
  1338. net/ipv4/tcp_timer.c +1 −1
  1339. net/ipv4/udp.c +13 −5
  1340. net/ipv4/udp_impl.h +1 −0
  1341. net/ipv4/udplite.c +1 −0
  1342. net/ipv6/addrconf.c +5 −3
  1343. net/ipv6/af_inet6.c +13 −1
  1344. net/ipv6/datagram.c +5 −6
  1345. net/ipv6/fou6.c +15 −2
  1346. net/ipv6/icmp.c +6 −2
  1347. net/ipv6/ip6_gre.c +16 −9
  1348. net/ipv6/ip6mr.c +3 −4
  1349. net/ipv6/netfilter.c +3 −1
  1350. net/ipv6/route.c +2 −12
  1351. net/ipv6/seg6_iptunnel.c +2 −0
  1352. net/ipv6/sit.c +2 −1
  1353. net/ipv6/udp.c +17 −9
  1354. net/ipv6/udp_impl.h +1 −0
  1355. net/ipv6/udplite.c +1 −0
  1356. net/l2tp/l2tp_core.c +6 −3
  1357. net/l2tp/l2tp_core.h +20 −0
  1358. net/l2tp/l2tp_ip.c +3 −0
  1359. net/l2tp/l2tp_ip6.c +3 −0
  1360. net/mac80211/cfg.c +4 −0
  1361. net/mac80211/rx.c +4 −2
  1362. net/mac80211/tx.c +9 −3
  1363. net/netfilter/ipvs/ip_vs_ctl.c +12 −0
  1364. net/netfilter/nf_conntrack_core.c +16 −0
  1365. net/netfilter/nf_flow_table_core.c +3 −2
  1366. net/netfilter/nf_tables_api.c +48 −51
  1367. net/netfilter/nfnetlink_osf.c +4 −0
  1368. net/netfilter/nft_compat.c +130 −47
  1369. net/netfilter/nft_dynset.c +7 −11
  1370. net/netfilter/nft_flow_offload.c +8 −5
  1371. net/netfilter/nft_immediate.c +5 −1
  1372. net/netfilter/nft_lookup.c +7 −11
  1373. net/netfilter/nft_objref.c +7 −11
  1374. net/netrom/nr_timer.c +10 −10
  1375. net/openvswitch/flow.c +5 −3
  1376. net/openvswitch/flow_netlink.c +1 −1
  1377. net/packet/af_packet.c +4 −3
  1378. net/rds/bind.c +3 −3
  1379. net/rds/ib_send.c +2 −2
  1380. net/rds/message.c +2 −2
  1381. net/rds/rds.h +0 −4
  1382. net/rds/send.c +1 −1
  1383. net/rose/rose_route.c +5 −0
  1384. net/rxrpc/af_rxrpc.c +0 −70
  1385. net/rxrpc/ar-internal.h +12 −7
  1386. net/rxrpc/call_object.c +0 −97
  1387. net/rxrpc/conn_client.c +1 −4
  1388. net/rxrpc/recvmsg.c +2 −1
  1389. net/rxrpc/sendmsg.c +11 −13
  1390. net/sched/act_tunnel_key.c +11 −8
  1391. net/sched/cls_api.c +1 −2
  1392. net/sched/cls_flower.c +19 −6
  1393. net/sched/sch_cake.c +3 −2
  1394. net/sched/sch_cbs.c +2 −1
  1395. net/sched/sch_drr.c +5 −2
  1396. net/sched/sch_dsmark.c +2 −1
  1397. net/sched/sch_hfsc.c +5 −4
  1398. net/sched/sch_htb.c +2 −1
  1399. net/sched/sch_prio.c +2 −1
  1400. net/sched/sch_qfq.c +12 −8
  1401. net/sched/sch_tbf.c +2 −1
  1402. net/sctp/ipv6.c +3 −5
  1403. net/sctp/protocol.c +3 −4
  1404. net/sctp/sm_make_chunk.c +8 −3
  1405. net/sctp/socket.c +2 −2
  1406. net/sctp/stream.c +45 −33
  1407. net/smc/af_smc.c +13 −2
  1408. net/smc/smc_cdc.c +10 −11
  1409. net/smc/smc_cdc.h +32 −2
  1410. net/smc/smc_clc.c +1 −1
  1411. net/smc/smc_close.c +1 −8
  1412. net/smc/smc_core.c +5 −1
  1413. net/smc/smc_core.h +20 −0
  1414. net/smc/smc_ib.c +3 −3
  1415. net/smc/smc_llc.c +2 −1
  1416. net/smc/smc_pnet.c +1 −1
  1417. net/smc/smc_tx.c +31 −33
  1418. net/smc/smc_wr.c +41 −5
  1419. net/smc/smc_wr.h +1 −0
  1420. net/socket.c +63 −19
  1421. net/sunrpc/auth.c +3 −0
  1422. net/sunrpc/auth_gss/auth_gss.c +9 −3
  1423. net/sunrpc/clnt.c +12 −8
  1424. net/sunrpc/xprt.c +2 −1
  1425. net/sunrpc/xprtrdma/svc_rdma_sendto.c +99 −6
  1426. net/sunrpc/xprtrdma/svc_rdma_transport.c +3 −6
  1427. net/sunrpc/xprtrdma/verbs.c +4 −6
  1428. net/sunrpc/xprtsock.c +22 −0
  1429. net/tipc/netlink_compat.c +52 −2
  1430. net/tipc/topsrv.c +1 −1
  1431. net/tls/tls_sw.c +5 −1
  1432. net/vmw_vsock/virtio_transport.c +21 −8
  1433. net/wireless/ap.c +2 −0
  1434. net/wireless/core.h +2 −0
  1435. net/wireless/nl80211.c +1 −1
  1436. net/wireless/reg.c +9 −4
  1437. net/wireless/sme.c +1 −1
  1438. net/xdp/xdp_umem.c +13 −3
  1439. net/xfrm/xfrm_policy.c +33 −30
  1440. net/xfrm/xfrm_user.c +9 −4
  1441. samples/bpf/Makefile +1 −0
  1442. samples/bpf/asm_goto_workaround.h +16 −0
  1443. samples/bpf/test_cgrp2_attach2.c +7 −7
  1444. samples/bpf/test_current_task_under_cgroup_user.c +1 −1
  1445. samples/bpf/xdp1_user.c +1 −1
  1446. samples/mei/mei-amt-version.c +1 −1
  1447. samples/seccomp/Makefile +1 −0
  1448. scripts/Kbuild.include +0 −4
  1449. scripts/coccinelle/api/alloc/alloc_cast.cocci +4 −4
  1450. scripts/coccinelle/api/alloc/zalloc-simple.cocci +1 −10
  1451. scripts/gcc-plugins/arm_ssp_per_task_plugin.c +21 −2
  1452. scripts/kconfig/Makefile +1 −1
  1453. scripts/mod/modpost.c +1 −1
  1454. security/apparmor/domain.c +4 −1
  1455. security/apparmor/lsm.c +2 −0
  1456. security/security.c +7 −0
  1457. security/selinux/ss/policydb.c +2 −1
  1458. security/yama/yama_lsm.c +3 −1
  1459. sound/aoa/soundbus/i2sbus/core.c +2 −2
  1460. sound/core/compress_offload.c +2 −1
  1461. sound/core/pcm_lib.c +8 −1
  1462. sound/pci/cs46xx/dsp_spos.c +3 −0
  1463. sound/pci/hda/hda_bind.c +2 −1
  1464. sound/pci/hda/hda_intel.c +2 −0
  1465. sound/pci/hda/patch_ca0132.c +3 −1
  1466. sound/pci/hda/patch_conexant.c +1 −0
  1467. sound/pci/hda/patch_realtek.c +97 −61
  1468. sound/soc/amd/raven/acp3x-pcm-dma.c +4 −2
  1469. sound/soc/codecs/hdac_hdmi.c +13 −103
  1470. sound/soc/codecs/pcm512x.c +4 −7
  1471. sound/soc/codecs/rt274.c +4 −1
  1472. sound/soc/codecs/rt5514-spi.c +2 −0
  1473. sound/soc/codecs/rt5682.c +1 −0
  1474. sound/soc/codecs/rt5682.h +12 −12
  1475. sound/soc/codecs/tlv320aic32x4.c +4 −0
  1476. sound/soc/fsl/imx-audmux.c +12 −12
  1477. sound/soc/intel/Kconfig +1 −1
  1478. sound/soc/intel/atom/sst-mfld-platform-pcm.c +7 −1
  1479. sound/soc/intel/boards/broadwell.c +1 −1
  1480. sound/soc/intel/boards/glk_rt5682_max98357a.c +7 −38
  1481. sound/soc/intel/boards/haswell.c +1 −1
  1482. sound/soc/intel/skylake/skl.c +4 −9
  1483. sound/soc/qcom/qdsp6/q6asm-dai.c +12 −5
  1484. sound/soc/qcom/sdm845.c +22 −9
  1485. sound/soc/sh/dma-sh7760.c +1 −1
  1486. sound/soc/soc-core.c +28 −6
  1487. sound/soc/soc-dapm.c +5 −5
  1488. sound/soc/ti/davinci-mcasp.c +64 −72
  1489. sound/soc/xilinx/Kconfig +1 −1
  1490. sound/soc/xilinx/xlnx_i2s.c +7 −8
  1491. sound/sparc/dbri.c +2 −2
  1492. sound/usb/card.c +1 −1
  1493. sound/usb/mixer.c +23 −6
  1494. sound/usb/quirks-table.h +6 −0
  1495. sound/usb/quirks.c +3 −1
  1496. sound/usb/stream.c +25 −11
  1497. tools/arch/powerpc/include/uapi/asm/perf_regs.h +1 −0
  1498. tools/arch/powerpc/include/uapi/asm/unistd.h +0 −404
  1499. tools/arch/riscv/include/uapi/asm/bitsperlong.h +25 −0
  1500. tools/arch/x86/include/asm/cpufeatures.h +2 −0
  1501. tools/arch/x86/include/asm/disabled-features.h +7 −1
  1502. tools/bpf/bpftool/Makefile +8 −1
  1503. tools/bpf/bpftool/btf_dumper.c +7 −6
  1504. tools/bpf/bpftool/common.c +1 −5
  1505. tools/bpf/bpftool/json_writer.c +1 −6
  1506. tools/bpf/bpftool/json_writer.h +0 −5
  1507. tools/bpf/bpftool/map.c +24 −9
  1508. tools/bpf/bpftool/prog.c +3 −2
  1509. tools/iio/iio_generic_buffer.c +1 −1
  1510. tools/include/uapi/asm-generic/unistd.h +3 −1
  1511. tools/include/uapi/asm/bitsperlong.h +2 −0
  1512. tools/include/uapi/drm/i915_drm.h +8 −0
  1513. tools/include/uapi/linux/fs.h +8 −52
  1514. tools/include/uapi/linux/if_link.h +19 −0
  1515. tools/include/uapi/linux/in.h +7 −3
  1516. tools/include/uapi/linux/kvm.h +19 −0
  1517. tools/include/uapi/linux/mount.h +58 −0
  1518. tools/include/uapi/linux/pkt_sched.h +1163 −0
  1519. tools/include/uapi/linux/prctl.h +8 −0
  1520. tools/include/uapi/linux/vhost.h +2 −111
  1521. tools/lib/bpf/.gitignore +1 −0
  1522. tools/lib/bpf/README.rst +14 −0
  1523. tools/lib/bpf/bpf.c +15 −4
  1524. tools/lib/traceevent/event-parse-api.c +2 −2
  1525. tools/lib/traceevent/event-parse-local.h +2 −2
  1526. tools/lib/traceevent/event-parse.c +82 −47
  1527. tools/lib/traceevent/event-parse.h +11 −6
  1528. tools/lib/traceevent/plugin_kvm.c +1 −1
  1529. tools/lib/traceevent/trace-seq.c +12 −5
  1530. tools/perf/Documentation/perf-c2c.txt +12 −4
  1531. tools/perf/Documentation/perf-mem.txt +1 −1
  1532. tools/perf/Makefile.perf +5 −3
  1533. tools/perf/arch/arm/tests/Build +1 −0
  1534. tools/perf/arch/arm/tests/arch-tests.c +4 −0
  1535. tools/perf/arch/arm/tests/vectors-page.c +24 −0
  1536. tools/perf/arch/powerpc/Makefile +11 −4
  1537. tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl +12 −10
  1538. tools/perf/arch/powerpc/entry/syscalls/syscall.tbl +427 −0
  1539. tools/perf/arch/powerpc/include/perf_regs.h +2 −1
  1540. tools/perf/arch/powerpc/util/Build +1 −0
  1541. tools/perf/arch/powerpc/util/mem-events.c +11 −0
  1542. tools/perf/arch/powerpc/util/perf_regs.c +1 −0
  1543. tools/perf/builtin-script.c +3 −6
  1544. tools/perf/builtin-stat.c +2 −1
  1545. tools/perf/builtin-top.c +1 −6
  1546. tools/perf/builtin-trace.c +29 −11
  1547. tools/perf/check-headers.sh +1 −1
  1548. tools/perf/perf-read-vdso.c +3 −3
  1549. tools/perf/tests/attr.py +19 −13
  1550. tools/perf/tests/evsel-tp-sched.c +1 −1
  1551. tools/perf/tests/shell/lib/probe_vfs_getname.sh +2 −1
  1552. tools/perf/tests/tests.h +5 −0
  1553. tools/perf/trace/beauty/mount_flags.sh +2 −2
  1554. tools/perf/trace/beauty/prctl_option.sh +1 −1
  1555. tools/perf/ui/browsers/annotate.c +10 −6
  1556. tools/perf/util/annotate.c +4 −4
  1557. tools/perf/util/c++/clang.cpp +1 −1
  1558. tools/perf/util/callchain.c +20 −12
  1559. tools/perf/util/callchain.h +1 −0
  1560. tools/perf/util/cpumap.c +9 −2
  1561. tools/perf/util/find-map.c +3 −4
  1562. tools/perf/util/machine.c +1 −1
  1563. tools/perf/util/mem-events.c +1 −1
  1564. tools/perf/util/ordered-events.c +4 −2
  1565. tools/perf/util/setup.py +2 −0
  1566. tools/perf/util/strbuf.c +0 −1
  1567. tools/perf/util/symbol-elf.c +22 −1
  1568. tools/perf/util/symbol.c +1 −0
  1569. tools/perf/util/vdso.c +3 −3
  1570. tools/testing/nvdimm/dimm_devs.c +2 −2
  1571. tools/testing/selftests/Makefile +1 −0
  1572. tools/testing/selftests/bpf/.gitignore +1 −0
  1573. tools/testing/selftests/bpf/Makefile +4 −1
  1574. tools/testing/selftests/bpf/bpf_util.h +20 −10
  1575. tools/testing/selftests/bpf/cgroup_helpers.c +3 −3
  1576. tools/testing/selftests/bpf/test_btf.c +24 −14
  1577. tools/testing/selftests/bpf/test_cgroup_storage.c +1 −1
  1578. tools/testing/selftests/bpf/test_dev_cgroup.c +1 −1
  1579. tools/testing/selftests/bpf/test_netcnt.c +1 −1
  1580. tools/testing/selftests/bpf/test_progs.c +30 −0
  1581. tools/testing/selftests/bpf/test_skb_cgroup_id_user.c +1 −1
  1582. tools/testing/selftests/bpf/test_sock.c +1 −1
  1583. tools/testing/selftests/bpf/test_sock_addr.c +51 −4
  1584. tools/testing/selftests/bpf/test_socket_cookie.c +1 −1
  1585. tools/testing/selftests/bpf/test_tcpbpf_user.c +1 −1
  1586. tools/testing/selftests/bpf/test_tcpnotify_user.c +1 −1
  1587. tools/testing/selftests/bpf/test_verifier.c +120 −0
  1588. tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh +10 −3
  1589. tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh +20 −0
  1590. tools/testing/selftests/drivers/net/mlxsw/vxlan.sh +18 −0
  1591. tools/testing/selftests/filesystems/binderfs/.gitignore +1 −0
  1592. tools/testing/selftests/filesystems/binderfs/Makefile +6 −0
  1593. tools/testing/selftests/filesystems/binderfs/binderfs_test.c +275 −0
  1594. tools/testing/selftests/filesystems/binderfs/config +3 −0
  1595. tools/testing/selftests/gpio/gpio-mockup-chardev.c +6 −3
  1596. tools/testing/selftests/ir/Makefile +2 −0
  1597. tools/testing/selftests/kvm/lib/kvm_util.c +2 −7
  1598. tools/testing/selftests/kvm/x86_64/evmcs_test.c +6 −0
  1599. tools/testing/selftests/net/Makefile +1 −1
  1600. tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh +46 −1
  1601. tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh +1 −1
  1602. tools/testing/selftests/net/ip_defrag.c +87 −9
  1603. tools/testing/selftests/net/ip_defrag.sh +8 −1
  1604. tools/testing/selftests/net/xfrm_policy.sh +131 −22
  1605. tools/testing/selftests/netfilter/Makefile +1 −1
  1606. tools/testing/selftests/netfilter/config +1 −1
  1607. tools/testing/selftests/netfilter/nft_nat.sh +762 −0
  1608. tools/testing/selftests/networking/timestamping/txtimestamp.c +1 −1
  1609. tools/testing/selftests/proc/.gitignore +1 −0
  1610. tools/testing/selftests/proc/Makefile +1 −0
  1611. tools/testing/selftests/proc/setns-dcache.c +129 −0
  1612. tools/testing/selftests/rtc/rtctest.c +104 −5
  1613. tools/testing/selftests/seccomp/Makefile +1 −1
  1614. tools/testing/selftests/seccomp/seccomp_bpf.c +62 −20
  1615. tools/testing/selftests/tc-testing/tc-tests/actions/ife.json +44 −44
  1616. tools/testing/selftests/tc-testing/tc-tests/actions/tunnel_key.json +1 −30
  1617. tools/testing/selftests/timers/Makefile +1 −1
  1618. tools/testing/selftests/vm/gup_benchmark.c +1 −0
  1619. tools/testing/selftests/x86/mpx-mini-test.c +1 −1
  1620. tools/testing/selftests/x86/protection_keys.c +31 −10
  1621. tools/testing/selftests/x86/unwind_vdso.c +0 −1
  1622. tools/thermal/tmon/Makefile +1 −1
  1623. tools/vm/page_owner_sort.c +3 −1
  1624. virt/kvm/kvm_main.c +9 −3
.clang-format+42−1
@@ -72,6 +72,10 @@ ForEachMacros: · 71 unmodified lines
7272 - 'apei_estatus_for_each_section'
7373 - 'ata_for_each_dev'
7474 - 'ata_for_each_link'
75+ - '__ata_qc_for_each'
76+ - 'ata_qc_for_each'
77+ - 'ata_qc_for_each_raw'
78+ - 'ata_qc_for_each_with_internal'
7579 - 'ax25_for_each'
7680 - 'ax25_uid_for_each'
7781 - 'bio_for_each_integrity_vec'
@@ -85,6 +89,7 @@ ForEachMacros: · 7 unmodified lines
8589 - 'blk_queue_for_each_rl'
8690 - 'bond_for_each_slave'
8791 - 'bond_for_each_slave_rcu'
92+ - 'bpf_for_each_spilled_reg'
8893 - 'btree_for_each_safe128'
8994 - 'btree_for_each_safe32'
9095 - 'btree_for_each_safe64'
@@ -103,6 +108,8 @@ ForEachMacros: · 12 unmodified lines
103108 - 'drm_atomic_crtc_for_each_plane'
104109 - 'drm_atomic_crtc_state_for_each_plane'
105110 - 'drm_atomic_crtc_state_for_each_plane_state'
111+ - 'drm_atomic_for_each_plane_damage'
112+ - 'drm_connector_for_each_possible_encoder'
106113 - 'drm_for_each_connector_iter'
107114 - 'drm_for_each_crtc'
108115 - 'drm_for_each_encoder'
@@ -121,11 +128,21 @@ ForEachMacros: · 12 unmodified lines
121128 - 'for_each_bio'
122129 - 'for_each_board_func_rsrc'
123130 - 'for_each_bvec'
131+ - 'for_each_card_components'
132+ - 'for_each_card_links'
133+ - 'for_each_card_links_safe'
134+ - 'for_each_card_prelinks'
135+ - 'for_each_card_rtds'
136+ - 'for_each_card_rtds_safe'
137+ - 'for_each_cgroup_storage_type'
124138 - 'for_each_child_of_node'
125139 - 'for_each_clear_bit'
126140 - 'for_each_clear_bit_from'
127141 - 'for_each_cmsghdr'
128142 - 'for_each_compatible_node'
143+ - 'for_each_component_dais'
144+ - 'for_each_component_dais_safe'
145+ - 'for_each_comp_order'
129146 - 'for_each_console'
130147 - 'for_each_cpu'
131148 - 'for_each_cpu_and'
@@ -133,6 +150,10 @@ ForEachMacros: · 1 unmodified line
133150 - 'for_each_cpu_wrap'
134151 - 'for_each_dev_addr'
135152 - 'for_each_dma_cap_mask'
153+ - 'for_each_dpcm_be'
154+ - 'for_each_dpcm_be_rollback'
155+ - 'for_each_dpcm_be_safe'
156+ - 'for_each_dpcm_fe'
136157 - 'for_each_drhd_unit'
137158 - 'for_each_dss_dev'
138159 - 'for_each_efi_memory_desc'
@@ -149,6 +170,7 @@ ForEachMacros: · 10 unmodified lines
149170 - 'for_each_iommu'
150171 - 'for_each_ip_tunnel_rcu'
151172 - 'for_each_irq_nr'
173+ - 'for_each_link_codecs'
152174 - 'for_each_lru'
153175 - 'for_each_matching_node'
154176 - 'for_each_matching_node_and_match'
@@ -160,6 +182,7 @@ ForEachMacros: · 5 unmodified lines
160182 - 'for_each_mem_range_rev'
161183 - 'for_each_migratetype_order'
162184 - 'for_each_msi_entry'
185+ - 'for_each_msi_entry_safe'
163186 - 'for_each_net'
164187 - 'for_each_netdev'
165188 - 'for_each_netdev_continue'
@@ -183,12 +206,14 @@ ForEachMacros: · 17 unmodified lines
183206 - 'for_each_node_with_property'
184207 - 'for_each_of_allnodes'
185208 - 'for_each_of_allnodes_from'
209+ - 'for_each_of_cpu_node'
186210 - 'for_each_of_pci_range'
187211 - 'for_each_old_connector_in_state'
188212 - 'for_each_old_crtc_in_state'
189213 - 'for_each_oldnew_connector_in_state'
190214 - 'for_each_oldnew_crtc_in_state'
191215 - 'for_each_oldnew_plane_in_state'
216+ - 'for_each_oldnew_plane_in_state_reverse'
192217 - 'for_each_oldnew_private_obj_in_state'
193218 - 'for_each_old_plane_in_state'
194219 - 'for_each_old_private_obj_in_state'
@@ -206,14 +231,17 @@ ForEachMacros: · 11 unmodified lines
206231 - 'for_each_process'
207232 - 'for_each_process_thread'
208233 - 'for_each_property_of_node'
234+ - 'for_each_registered_fb'
209235 - 'for_each_reserved_mem_region'
210− - 'for_each_resv_unavail_range'
236+ - 'for_each_rtd_codec_dai'
237+ - 'for_each_rtd_codec_dai_rollback'
211238 - 'for_each_rtdcom'
212239 - 'for_each_rtdcom_safe'
213240 - 'for_each_set_bit'
214241 - 'for_each_set_bit_from'
215242 - 'for_each_sg'
216243 - 'for_each_sg_page'
244+ - 'for_each_sibling_event'
217245 - '__for_each_thread'
218246 - 'for_each_thread'
219247 - 'for_each_zone'
@@ -251,6 +279,8 @@ ForEachMacros: · 31 unmodified lines
251279 - 'hlist_nulls_for_each_entry_from'
252280 - 'hlist_nulls_for_each_entry_rcu'
253281 - 'hlist_nulls_for_each_entry_safe'
282+ - 'i3c_bus_for_each_i2cdev'
283+ - 'i3c_bus_for_each_i3cdev'
254284 - 'ide_host_for_each_port'
255285 - 'ide_port_for_each_dev'
256286 - 'ide_port_for_each_present_dev'
@@ -267,11 +297,14 @@ ForEachMacros: · 10 unmodified lines
267297 - 'kvm_for_each_memslot'
268298 - 'kvm_for_each_vcpu'
269299 - 'list_for_each'
300+ - 'list_for_each_codec'
301+ - 'list_for_each_codec_safe'
270302 - 'list_for_each_entry'
271303 - 'list_for_each_entry_continue'
272304 - 'list_for_each_entry_continue_rcu'
273305 - 'list_for_each_entry_continue_reverse'
274306 - 'list_for_each_entry_from'
307+ - 'list_for_each_entry_from_rcu'
275308 - 'list_for_each_entry_from_reverse'
276309 - 'list_for_each_entry_lockless'
277310 - 'list_for_each_entry_rcu'
@@ -291,6 +324,7 @@ ForEachMacros: · 13 unmodified lines
291324 - 'media_device_for_each_intf'
292325 - 'media_device_for_each_link'
293326 - 'media_device_for_each_pad'
327+ - 'nanddev_io_for_each_page'
294328 - 'netdev_for_each_lower_dev'
295329 - 'netdev_for_each_lower_private'
296330 - 'netdev_for_each_lower_private_rcu'
@@ -357,12 +391,14 @@ ForEachMacros: · 60 unmodified lines
357391 - 'sk_nulls_for_each'
358392 - 'sk_nulls_for_each_from'
359393 - 'sk_nulls_for_each_rcu'
394+ - 'snd_array_for_each'
360395 - 'snd_pcm_group_for_each_entry'
361396 - 'snd_soc_dapm_widget_for_each_path'
362397 - 'snd_soc_dapm_widget_for_each_path_safe'
363398 - 'snd_soc_dapm_widget_for_each_sink_path'
364399 - 'snd_soc_dapm_widget_for_each_source_path'
365400 - 'tb_property_for_each'
401+ - 'tcf_exts_for_each_action'
366402 - 'udp_portaddr_for_each_entry'
367403 - 'udp_portaddr_for_each_entry_rcu'
368404 - 'usb_hub_for_each_child'
@@ -371,6 +407,11 @@ ForEachMacros: · 2 unmodified lines
371407 - 'v4l2_m2m_for_each_dst_buf_safe'
372408 - 'v4l2_m2m_for_each_src_buf'
373409 - 'v4l2_m2m_for_each_src_buf_safe'
410+ - 'virtio_device_for_each_vq'
411+ - 'xa_for_each'
412+ - 'xas_for_each'
413+ - 'xas_for_each_conflict'
414+ - 'xas_for_each_marked'
374415 - 'zorro_for_each_dev'
375416
376417 #IncludeBlocks: Preserve # Unknown to clang-format-5.0
Documentation/ABI/stable/sysfs-driver-mlxreg-io+3−3
@@ -24,7 +24,7 @@ What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/ · 23 unmodified lines
2424 cpld3_version
2525
2626 Date: November 2018
27−KernelVersion: 4.21
27+KernelVersion: 5.0
2828 Contact: Vadim Pasternak <vadimpmellanox.com>
2929 Description: These files show with which CPLD versions have been burned
3030 on LED board.
@@ -35,7 +35,7 @@ What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/ · 4 unmodified lines
3535 jtag_enable
3636
3737 Date: November 2018
38−KernelVersion: 4.21
38+KernelVersion: 5.0
3939 Contact: Vadim Pasternak <vadimpmellanox.com>
4040 Description: These files enable and disable the access to the JTAG domain.
4141 By default access to the JTAG domain is disabled.
@@ -105,7 +105,7 @@ What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/ · 63 unmodified lines
105105 reset_voltmon_upgrade_fail
106106
107107 Date: November 2018
108−KernelVersion: 4.21
108+KernelVersion: 5.0
109109 Contact: Vadim Pasternak <vadimpmellanox.com>
110110 Description: These files show the system reset cause, as following: ComEx
111111 power fail, reset from ComEx, system platform reset, reset
Documentation/ABI/testing/sysfs-block+9−0
@@ -279,3 +279,12 @@ Description: · 278 unmodified lines
279279 size in 512B sectors of the zones of the device, with
280280 the eventual exception of the last zone of the device
281281 which may be smaller.
282+
283+What: /sys/block/<disk>/queue/io_timeout
284+Date: November 2018
285+Contact: Weiping Zhang <zhangweiping@didiglobal.com>
286+Description:
287+ io_timeout is the request timeout in milliseconds. If a request
288+ does not complete in this time then the block driver timeout
289+ handler is invoked. That timeout handler can decide to retry
290+ the request, to fail it or to start a device recovery strategy.
Documentation/ABI/testing/sysfs-block-zram+9−2
@@ -122,11 +122,18 @@ Description: · 121 unmodified lines
122122 statistics (bd_count, bd_reads, bd_writes) in a format
123123 similar to block layer statistics file format.
124124
125+What: /sys/block/zram<id>/writeback_limit_enable
126+Date: November 2018
127+Contact: Minchan Kim <minchan@kernel.org>
128+Description:
129+ The writeback_limit_enable file is read-write and specifies
130+ eanbe of writeback_limit feature. "1" means eable the feature.
131+ No limit "0" is the initial state.
132+
125133 What: /sys/block/zram<id>/writeback_limit
126134 Date: November 2018
127135 Contact: Minchan Kim <minchan@kernel.org>
128136 Description:
129137 The writeback_limit file is read-write and specifies the maximum
130138 amount of writeback ZRAM can do. The limit could be changed
131− in run time and "0" means disable the limit.
132− No limit is the initial state.
139+ in run time.
Documentation/admin-guide/kernel-parameters.txt+3−4
@@ -1696,12 +1696,11 @@ · 1695 unmodified lines
16961696 By default, super page will be supported if Intel IOMMU
16971697 has the capability. With this option, super page will
16981698 not be supported.
1699− sm_off [Default Off]
1700− By default, scalable mode will be supported if the
1699+ sm_on [Default Off]
1700+ By default, scalable mode will be disabled even if the
17011701 hardware advertises that it has support for the scalable
17021702 mode translation. With this option set, scalable mode
1703− will not be used even on hardware which claims to support
1704− it.
1703+ will be used on hardware which claims to support it.
17051704 tboot_noforce [Default Off]
17061705 Do not force the Intel IOMMU enabled under tboot.
17071706 By default, tboot will force Intel IOMMU on, which
Documentation/block/bfq-iosched.txt+7−0
@@ -357,6 +357,13 @@ video playing/streaming, a very low drop rate may be more important · 356 unmodified lines
357357 than maximum throughput. In these cases, consider setting the
358358 strict_guarantees parameter.
359359
360+slice_idle_us
361+-------------
362+
363+Controls the same tuning parameter as slice_idle, but in microseconds.
364+Either tunable can be used to set idling behavior. Afterwards, the
365+other tunable will reflect the newly set value in sysfs.
366+
360367 strict_guarantees
361368 -----------------
362369
Documentation/block/null_blk.txt+2−1
@@ -88,7 +88,8 @@ shared_tags=[0/1]: Default: 0 · 87 unmodified lines
8888
8989 zoned=[0/1]: Default: 0
9090 0: Block device is exposed as a random-access block device.
91− 1: Block device is exposed as a host-managed zoned block device.
91+ 1: Block device is exposed as a host-managed zoned block device. Requires
92+ CONFIG_BLK_DEV_ZONED.
9293
9394 zone_size=[MB]: Default: 256
9495 Per zone size when exposed as a zoned block device. Must be a power of two.
Documentation/block/queue-sysfs.txt+7−0
@@ -67,6 +67,13 @@ If set to a value larger than 0, the kernel will put the process issuing · 66 unmodified lines
6767 IO to sleep for this amount of microseconds before entering classic
6868 polling.
6969
70+io_timeout (RW)
71+---------------
72+io_timeout is the request timeout in milliseconds. If a request does not
73+complete in this time then the block driver timeout handler is invoked.
74+That timeout handler can decide to retry the request, to fail it or to start
75+a device recovery strategy.
76+
7077 iostats (RW)
7178 -------------
7279 This file is used to control (on/off) the iostats accounting of the
Documentation/blockdev/zram.txt+47−27
@@ -156,22 +156,23 @@ Per-device statistics are exported as various nodes under /sys/block/zram<id>/ · 155 unmodified lines
156156 A brief description of exported device attributes. For more details please
157157 read Documentation/ABI/testing/sysfs-block-zram.
158158
159−Name access description
160−---- ------ -----------
161−disksize RW show and set the device's disk size
162−initstate RO shows the initialization state of the device
163−reset WO trigger device reset
164−mem_used_max WO reset the `mem_used_max' counter (see later)
165−mem_limit WO specifies the maximum amount of memory ZRAM can use
166− to store the compressed data
167−writeback_limit WO specifies the maximum amount of write IO zram can
168− write out to backing device as 4KB unit
169−max_comp_streams RW the number of possible concurrent compress operations
170−comp_algorithm RW show and change the compression algorithm
171−compact WO trigger memory compaction
172−debug_stat RO this file is used for zram debugging purposes
173−backing_dev RW set up backend storage for zram to write out
174−idle WO mark allocated slot as idle
159+Name access description
160+---- ------ -----------
161+disksize RW show and set the device's disk size
162+initstate RO shows the initialization state of the device
163+reset WO trigger device reset
164+mem_used_max WO reset the `mem_used_max' counter (see later)
165+mem_limit WO specifies the maximum amount of memory ZRAM can use
166+ to store the compressed data
167+writeback_limit WO specifies the maximum amount of write IO zram can
168+ write out to backing device as 4KB unit
169+writeback_limit_enable RW show and set writeback_limit feature
170+max_comp_streams RW the number of possible concurrent compress operations
171+comp_algorithm RW show and change the compression algorithm
172+compact WO trigger memory compaction
173+debug_stat RO this file is used for zram debugging purposes
174+backing_dev RW set up backend storage for zram to write out
175+idle WO mark allocated slot as idle
175176
176177
177178 User space is advised to use the following files to read the device statistics.
@@ -280,32 +281,51 @@ With the command, zram writeback idle pages from memory to the storage. · 102 unmodified lines
280281 If there are lots of write IO with flash device, potentially, it has
281282 flash wearout problem so that admin needs to design write limitation
282283 to guarantee storage health for entire product life.
283−To overcome the concern, zram supports "writeback_limit".
284−The "writeback_limit"'s default value is 0 so that it doesn't limit
285−any writeback. If admin want to measure writeback count in a certain
286−period, he could know it via /sys/block/zram0/bd_stat's 3rd column.
284+
285+To overcome the concern, zram supports "writeback_limit" feature.
286+The "writeback_limit_enable"'s default value is 0 so that it doesn't limit
287+any writeback. IOW, if admin want to apply writeback budget, he should
288+enable writeback_limit_enable via
289+
290+ $ echo 1 > /sys/block/zramX/writeback_limit_enable
291+
292+Once writeback_limit_enable is set, zram doesn't allow any writeback
293+until admin set the budget via /sys/block/zramX/writeback_limit.
294+
295+(If admin doesn't enable writeback_limit_enable, writeback_limit's value
296+assigned via /sys/block/zramX/writeback_limit is meaninless.)
287297
288298 If admin want to limit writeback as per-day 400M, he could do it
289299 like below.
290300
291− MB_SHIFT=20
292− 4K_SHIFT=12
293− echo $((400<<MB_SHIFT>>4K_SHIFT)) > \
294− /sys/block/zram0/writeback_limit.
301+ $ MB_SHIFT=20
302+ $ 4K_SHIFT=12
303+ $ echo $((400<<MB_SHIFT>>4K_SHIFT)) > \
304+ /sys/block/zram0/writeback_limit.
305+ $ echo 1 > /sys/block/zram0/writeback_limit_enable
295306
296−If admin want to allow further write again, he could do it like below
307+If admin want to allow further write again once the bugdet is exausted,
308+he could do it like below
297309
298− echo 0 > /sys/block/zram0/writeback_limit
310+ $ echo $((400<<MB_SHIFT>>4K_SHIFT)) > \
311+ /sys/block/zram0/writeback_limit
299312
300313 If admin want to see remaining writeback budget since he set,
301314
302− cat /sys/block/zram0/writeback_limit
315+ $ cat /sys/block/zramX/writeback_limit
316+
317+If admin want to disable writeback limit, he could do
318+
319+ $ echo 0 > /sys/block/zramX/writeback_limit_enable
303320
304321 The writeback_limit count will reset whenever you reset zram(e.g.,
305322 system reboot, echo 1 > /sys/block/zramX/reset) so keeping how many of
306323 writeback happened until you reset the zram to allocate extra writeback
307324 budget in next setting is user's job.
308325
326+If admin want to measure writeback count in a certain period, he could
327+know it via /sys/block/zram0/bd_stat's 3rd column.
328+
309329 = memory tracking
310330
311331 With CONFIG_ZRAM_MEMORY_TRACKING, user can know information of the
Documentation/bpf/bpf_design_QA.rst+5−6
@@ -157,12 +157,11 @@ Q: Does BPF have a stable ABI? · 156 unmodified lines
157157 ------------------------------
158158 A: YES. BPF instructions, arguments to BPF programs, set of helper
159159 functions and their arguments, recognized return codes are all part
160−of ABI. However when tracing programs are using bpf_probe_read() helper
161−to walk kernel internal datastructures and compile with kernel
162−internal headers these accesses can and will break with newer
163−kernels. The union bpf_attr -> kern_version is checked at load time
164−to prevent accidentally loading kprobe-based bpf programs written
165−for a different kernel. Networking programs don't do kern_version check.
160+of ABI. However there is one specific exception to tracing programs
161+which are using helpers like bpf_probe_read() to walk kernel internal
162+data structures and compile with kernel internal headers. Both of these
163+kernel internals are subject to change and can break with newer kernels
164+such that the program needs to be adapted accordingly.
166165
167166 Q: How much stack space a BPF program uses?
168167 -------------------------------------------
Documentation/core-api/xarray.rst+9−6
@@ -108,12 +108,13 @@ some, but not all of the other indices changing. · 107 unmodified lines
108108
109109 Sometimes you need to ensure that a subsequent call to :c:func:`xa_store`
110110 will not need to allocate memory. The :c:func:`xa_reserve` function
111−will store a reserved entry at the indicated index. Users of the normal
112−API will see this entry as containing ``NULL``. If you do not need to
113−use the reserved entry, you can call :c:func:`xa_release` to remove the
114−unused entry. If another user has stored to the entry in the meantime,
115−:c:func:`xa_release` will do nothing; if instead you want the entry to
116−become ``NULL``, you should use :c:func:`xa_erase`.
111+will store a reserved entry at the indicated index. Users of the
112+normal API will see this entry as containing ``NULL``. If you do
113+not need to use the reserved entry, you can call :c:func:`xa_release`
114+to remove the unused entry. If another user has stored to the entry
115+in the meantime, :c:func:`xa_release` will do nothing; if instead you
116+want the entry to become ``NULL``, you should use :c:func:`xa_erase`.
117+Using :c:func:`xa_insert` on a reserved entry will fail.
117118
118119 If all entries in the array are ``NULL``, the :c:func:`xa_empty` function
119120 will return ``true``.
@@ -183,6 +184,8 @@ Takes xa_lock internally: · 63 unmodified lines
183184 * :c:func:`xa_store_bh`
184185 * :c:func:`xa_store_irq`
185186 * :c:func:`xa_insert`
187+ * :c:func:`xa_insert_bh`
188+ * :c:func:`xa_insert_irq`
186189 * :c:func:`xa_erase`
187190 * :c:func:`xa_erase_bh`
188191 * :c:func:`xa_erase_irq`
Documentation/devicetree/bindings/Makefile+5−1
@@ -17,7 +17,11 @@ extra-y += $(DT_TMP_SCHEMA) · 16 unmodified lines
1717 quiet_cmd_mk_schema = SCHEMA $@
1818 cmd_mk_schema = $(DT_MK_SCHEMA) $(DT_MK_SCHEMA_FLAGS) -o $@ $(filter-out FORCE, $^)
1919
20−DT_DOCS = $(shell cd $(srctree)/$(src) && find * -name '*.yaml')
20+DT_DOCS = $(shell \
21+ cd $(srctree)/$(src) && \
22+ find * \( -name '*.yaml' ! -name $(DT_TMP_SCHEMA) \) \
23+ )
24+
2125 DT_SCHEMA_FILES ?= $(addprefix $(src)/,$(DT_DOCS))
2226
2327 extra-y += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES))
Documentation/devicetree/bindings/arm/cpu-capacity.txt+1−1
@@ -235,4 +235,4 @@ cpus { · 234 unmodified lines
235235 ===========================================
236236
237237 [1] ARM Linux Kernel documentation - CPUs bindings
238− Documentation/devicetree/bindings/arm/cpus.txt
238+ Documentation/devicetree/bindings/arm/cpus.yaml
Documentation/devicetree/bindings/arm/idle-states.txt+1−1
@@ -684,7 +684,7 @@ cpus { · 683 unmodified lines
684684 ===========================================
685685
686686 [1] ARM Linux Kernel documentation - CPUs bindings
687− Documentation/devicetree/bindings/arm/cpus.txt
687+ Documentation/devicetree/bindings/arm/cpus.yaml
688688
689689 [2] ARM Linux Kernel documentation - PSCI bindings
690690 Documentation/devicetree/bindings/arm/psci.txt
Documentation/devicetree/bindings/arm/sp810.txt+1−1
@@ -4,7 +4,7 @@ SP810 System Controller · 3 unmodified lines
44 Required properties:
55
66 - compatible: standard compatible string for a Primecell peripheral,
7− see Documentation/devicetree/bindings/arm/primecell.txt
7+ see Documentation/devicetree/bindings/arm/primecell.yaml
88 for more details
99 should be: "arm,sp810", "arm,primecell"
1010
Documentation/devicetree/bindings/arm/topology.txt+1−1
@@ -472,4 +472,4 @@ cpus { · 471 unmodified lines
472472
473473 ===============================================================================
474474 [1] ARM Linux kernel documentation
475− Documentation/devicetree/bindings/arm/cpus.txt
475+ Documentation/devicetree/bindings/arm/cpus.yaml
Documentation/devicetree/bindings/clock/marvell,mmp2.txt+1−1
@@ -18,4 +18,4 @@ Required Properties: · 17 unmodified lines
1818 Each clock is assigned an identifier and client nodes use this identifier
1919 to specify the clock which they consume.
2020
21−All these identifier could be found in <dt-bindings/clock/marvell-mmp2.h>.
21+All these identifiers could be found in <dt-bindings/clock/marvell,mmp2.h>.
Documentation/devicetree/bindings/display/arm,pl11x.txt+1−1
@@ -1,6 +1,6 @@
11 * ARM PrimeCell Color LCD Controller PL110/PL111
22
3−See also Documentation/devicetree/bindings/arm/primecell.txt
3+See also Documentation/devicetree/bindings/arm/primecell.yaml
44
55 Required properties:
66
Documentation/devicetree/bindings/display/msm/gpu.txt+0−1
@@ -27,7 +27,6 @@ Example: · 26 unmodified lines
2727 reg = <0x04300000 0x20000>;
2828 reg-names = "kgsl_3d0_reg_memory";
2929 interrupts = <GIC_SPI 80 0>;
30− interrupt-names = "kgsl_3d0_irq";
3130 clock-names =
3231 "core",
3332 "iface",
Documentation/devicetree/bindings/gpio/gpio-mvebu.txt+0−2
@@ -14,8 +14,6 @@ Required properties: · 13 unmodified lines
1414
1515 "marvell,armada-8k-gpio" should be used for the Armada 7K and 8K
1616 SoCs (either from AP or CP), see
17− Documentation/devicetree/bindings/arm/marvell/cp110-system-controller0.txt
18− and
1917 Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
2018 for specific details about the offset property.
2119
Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.txt+1−1
@@ -78,7 +78,7 @@ Sub-nodes: · 77 unmodified lines
7878 PPI affinity can be expressed as a single "ppi-partitions" node,
7979 containing a set of sub-nodes, each with the following property:
8080 - affinity: Should be a list of phandles to CPU nodes (as described in
81−Documentation/devicetree/bindings/arm/cpus.txt).
81+ Documentation/devicetree/bindings/arm/cpus.yaml).
8282
8383 GICv3 has one or more Interrupt Translation Services (ITS) that are
8484 used to route Message Signalled Interrupts (MSI) to the CPUs.
Documentation/devicetree/bindings/reset/socfpga-reset.txt+2−1
@@ -1,7 +1,8 @@
11 Altera SOCFPGA Reset Manager
22
33 Required properties:
4−- compatible : "altr,rst-mgr"
4+- compatible : "altr,rst-mgr" for (Cyclone5/Arria5/Arria10)
5+ "altr,stratix10-rst-mgr","altr,rst-mgr" for Stratix10 ARM64 SoC
56 - reg : Should contain 1 register ranges(address and length)
67 - altr,modrst-offset : Should contain the offset of the first modrst register.
78 - #reset-cells: 1
Documentation/devicetree/bindings/reset/uniphier-reset.txt+14−11
@@ -120,27 +120,30 @@ Example: · 119 unmodified lines
120120 };
121121
122122
123−USB3 core reset
124−---------------
123+Peripheral core reset in glue layer
124+-----------------------------------
125125
126−USB3 core reset belongs to USB3 glue layer. Before using the core reset,
127−it is necessary to control the clocks and resets to enable this layer.
128−These clocks and resets should be described in each property.
126+Some peripheral core reset belongs to its own glue layer. Before using
127+this core reset, it is necessary to control the clocks and resets to enable
128+this layer. These clocks and resets should be described in each property.
129129
130130 Required properties:
131131 - compatible: Should be
132− "socionext,uniphier-pro4-usb3-reset" - for Pro4 SoC
133− "socionext,uniphier-pxs2-usb3-reset" - for PXs2 SoC
134− "socionext,uniphier-ld20-usb3-reset" - for LD20 SoC
135− "socionext,uniphier-pxs3-usb3-reset" - for PXs3 SoC
132+ "socionext,uniphier-pro4-usb3-reset" - for Pro4 SoC USB3
133+ "socionext,uniphier-pxs2-usb3-reset" - for PXs2 SoC USB3
134+ "socionext,uniphier-ld20-usb3-reset" - for LD20 SoC USB3
135+ "socionext,uniphier-pxs3-usb3-reset" - for PXs3 SoC USB3
136+ "socionext,uniphier-pro4-ahci-reset" - for Pro4 SoC AHCI
137+ "socionext,uniphier-pxs2-ahci-reset" - for PXs2 SoC AHCI
138+ "socionext,uniphier-pxs3-ahci-reset" - for PXs3 SoC AHCI
136139 - #reset-cells: Should be 1.
137140 - reg: Specifies offset and length of the register set for the device.
138−- clocks: A list of phandles to the clock gate for USB3 glue layer.
141+- clocks: A list of phandles to the clock gate for the glue layer.
139142 According to the clock-names, appropriate clocks are required.
140143 - clock-names: Should contain
141144 "gio", "link" - for Pro4 SoC
142145 "link" - for others
143−- resets: A list of phandles to the reset control for USB3 glue layer.
146+- resets: A list of phandles to the reset control for the glue layer.
144147 According to the reset-names, appropriate resets are required.
145148 - reset-names: Should contain
146149 "gio", "link" - for Pro4 SoC
Documentation/devicetree/bindings/serio/olpc,ap-sp.txt+0−4
@@ -4,14 +4,10 @@ Required properties: · 3 unmodified lines
44 - compatible : "olpc,ap-sp"
55 - reg : base address and length of SoC's WTM registers
66 - interrupts : SP-AP interrupt
7−- clocks : phandle + clock-specifier for the clock that drives the WTM
8−- clock-names: should be "sp"
97
108 Example:
119 ap-sp@d4290000 {
1210 compatible = "olpc,ap-sp";
1311 reg = <0xd4290000 0x1000>;
1412 interrupts = <40>;
15− clocks = <&soc_clocks MMP2_CLK_SP>;
16− clock-names = "sp";
1713 }
Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt+1−1
@@ -55,7 +55,7 @@ of these nodes are defined by the individual bindings for the specific function · 54 unmodified lines
5555 = EXAMPLE
5656 The following example represents the GLINK RPM node on a MSM8996 device, with
5757 the function for the "rpm_request" channel defined, which is used for
58−regualtors and root clocks.
58+regulators and root clocks.
5959
6060 apcs_glb: mailbox@9820000 {
6161 compatible = "qcom,msm8996-apcs-hmss-global";
Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.txt+2−2
@@ -41,12 +41,12 @@ processor ID) and a string identifier. · 40 unmodified lines
4141 - qcom,local-pid:
4242 Usage: required
4343 Value type: <u32>
44− Definition: specifies the identfier of the local endpoint of this edge
44+ Definition: specifies the identifier of the local endpoint of this edge
4545
4646 - qcom,remote-pid:
4747 Usage: required
4848 Value type: <u32>
49− Definition: specifies the identfier of the remote endpoint of this edge
49+ Definition: specifies the identifier of the remote endpoint of this edge
5050
5151 = SUBNODES
5252 Each SMP2P pair contain a set of inbound and outbound entries, these are
Documentation/driver-model/bus.txt+4−4
@@ -124,11 +124,11 @@ struct bus_attribute { · 123 unmodified lines
124124 ssize_t (*store)(struct bus_type *, const char * buf, size_t count);
125125 };
126126
127−Bus drivers can export attributes using the BUS_ATTR macro that works
128−similarly to the DEVICE_ATTR macro for devices. For example, a definition
129−like this:
127+Bus drivers can export attributes using the BUS_ATTR_RW macro that works
128+similarly to the DEVICE_ATTR_RW macro for devices. For example, a
129+definition like this:
130130
131−static BUS_ATTR(debug,0644,show_debug,store_debug);
131+static BUS_ATTR_RW(debug);
132132
133133 is equivalent to declaring:
134134
Documentation/fb/fbcon.txt+8−0
@@ -163,6 +163,14 @@ C. Boot options · 162 unmodified lines
163163 be preserved until there actually is some text is output to the console.
164164 This option causes fbcon to bind immediately to the fbdev device.
165165
166+7. fbcon=logo-pos:<location>
167+
168+ The only possible 'location' is 'center' (without quotes), and when
169+ given, the bootup logo is moved from the default top-left corner
170+ location to the center of the framebuffer. If more than one logo is
171+ displayed due to multiple CPUs, the collected line of logos is moved
172+ as a whole.
173+
166174 C. Attaching, Detaching and Unloading
167175
168176 Before going on to how to attach, detach and unload the framebuffer console, an
Documentation/features/core/cBPF-JIT/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | TODO |
1212 | arm64: | TODO |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/core/eBPF-JIT/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/core/generic-idle-thread/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | ok |
1415 | h8300: | TODO |
1516 | hexagon: | ok |
1617 | ia64: | ok |
Documentation/features/core/jump-labels/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/core/tracehook/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | ok |
14+ | csky: | ok |
1415 | h8300: | TODO |
1516 | hexagon: | ok |
1617 | ia64: | ok |
Documentation/features/debug/KASAN/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | TODO |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/debug/gcov-profile-all/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/debug/kgdb/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | ok |
1516 | hexagon: | ok |
1617 | ia64: | TODO |
Documentation/features/debug/kprobes-on-ftrace/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | TODO |
1212 | arm64: | TODO |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/debug/kprobes/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | ok |
Documentation/features/debug/kretprobes/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | ok |
Documentation/features/debug/optprobes/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | TODO |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/debug/stackprotector/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/debug/uprobes/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/debug/user-ret-profiler/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | TODO |
1212 | arm64: | TODO |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/io/dma-contiguous/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | ok |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/locking/cmpxchg-local/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | TODO |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/locking/lockdep/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | ok |
1617 | ia64: | TODO |
Documentation/features/locking/queued-rwlocks/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | TODO |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | ok |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/locking/queued-spinlocks/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | TODO |
1212 | arm64: | TODO |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/locking/rwsem-optimized/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | ok |
Documentation/features/perf/kprobes-event/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | ok |
1617 | ia64: | TODO |
Documentation/features/perf/perf-regs/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/perf/perf-stackdump/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/sched/membarrier-sync-core/arch-support.txt+1−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 | arm: | ok |
3535 | arm64: | ok |
3636 | c6x: | TODO |
37+ | csky: | TODO |
3738 | h8300: | TODO |
3839 | hexagon: | TODO |
3940 | ia64: | TODO |
Documentation/features/sched/numa-balancing/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | .. |
1212 | arm64: | ok |
1313 | c6x: | .. |
14+ | csky: | .. |
1415 | h8300: | .. |
1516 | hexagon: | .. |
1617 | ia64: | TODO |
Documentation/features/seccomp/seccomp-filter/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/time/arch-tick-broadcast/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/time/clockevents/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | ok |
14+ | csky: | ok |
1415 | h8300: | ok |
1516 | hexagon: | ok |
1617 | ia64: | TODO |
Documentation/features/time/context-tracking/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/time/irq-time-acct/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | .. |
Documentation/features/time/modern-timekeeping/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | TODO |
1212 | arm64: | ok |
1313 | c6x: | ok |
14+ | csky: | ok |
1415 | h8300: | ok |
1516 | hexagon: | ok |
1617 | ia64: | ok |
Documentation/features/time/virt-cpuacct/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | ok |
Documentation/features/vm/ELF-ASLR/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/vm/PG_uncached/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | TODO |
1212 | arm64: | TODO |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | ok |
Documentation/features/vm/THP/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | .. |
14+ | csky: | .. |
1415 | h8300: | .. |
1516 | hexagon: | .. |
1617 | ia64: | TODO |
Documentation/features/vm/TLB/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | TODO |
1212 | arm64: | TODO |
1313 | c6x: | .. |
14+ | csky: | TODO |
1415 | h8300: | .. |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/vm/huge-vmap/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | TODO |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/vm/ioremap_prot/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | TODO |
1212 | arm64: | TODO |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/features/vm/numa-memblock/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | .. |
1212 | arm64: | ok |
1313 | c6x: | .. |
14+ | csky: | .. |
1415 | h8300: | .. |
1516 | hexagon: | .. |
1617 | ia64: | ok |
Documentation/features/vm/pte_special/arch-support.txt+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 | arm: | ok |
1212 | arm64: | ok |
1313 | c6x: | TODO |
14+ | csky: | TODO |
1415 | h8300: | TODO |
1516 | hexagon: | TODO |
1617 | ia64: | TODO |
Documentation/filesystems/sysfs.txt+3−1
@@ -344,7 +344,9 @@ struct bus_attribute { · 343 unmodified lines
344344
345345 Declaring:
346346
347−BUS_ATTR(_name, _mode, _show, _store)
347+static BUS_ATTR_RW(name);
348+static BUS_ATTR_RO(name);
349+static BUS_ATTR_WO(name);
348350
349351 Creation/Removal:
350352
Documentation/networking/index.rst+13−13
@@ -11,19 +11,19 @@ Contents: · 10 unmodified lines
1111 batman-adv
1212 can
1313 can_ucan_protocol
14− dpaa2/index
15− e100
16− e1000
17− e1000e
18− fm10k
19− igb
20− igbvf
21− ixgb
22− ixgbe
23− ixgbevf
24− i40e
25− iavf
26− ice
14+ device_drivers/freescale/dpaa2/index
15+ device_drivers/intel/e100
16+ device_drivers/intel/e1000
17+ device_drivers/intel/e1000e
18+ device_drivers/intel/fm10k
19+ device_drivers/intel/igb
20+ device_drivers/intel/igbvf
21+ device_drivers/intel/ixgb
22+ device_drivers/intel/ixgbe
23+ device_drivers/intel/ixgbevf
24+ device_drivers/intel/i40e
25+ device_drivers/intel/iavf
26+ device_drivers/intel/ice
2727 kapi
2828 z8530book
2929 msg_zerocopy
Documentation/networking/rxrpc.txt+0−45
@@ -1000,51 +1000,6 @@ The kernel interface functions are as follows: · 999 unmodified lines
10001000 size should be set when the call is begun. tx_total_len may not be less
10011001 than zero.
10021002
1003− (*) Check to see the completion state of a call so that the caller can assess
1004− whether it needs to be retried.
1005−
1006− enum rxrpc_call_completion {
1007− RXRPC_CALL_SUCCEEDED,
1008− RXRPC_CALL_REMOTELY_ABORTED,
1009− RXRPC_CALL_LOCALLY_ABORTED,
1010− RXRPC_CALL_LOCAL_ERROR,
1011− RXRPC_CALL_NETWORK_ERROR,
1012− };
1013−
1014− int rxrpc_kernel_check_call(struct socket *sock, struct rxrpc_call *call,
1015− enum rxrpc_call_completion *_compl,
1016− u32 *_abort_code);
1017−
1018− On return, -EINPROGRESS will be returned if the call is still ongoing; if
1019− it is finished, *_compl will be set to indicate the manner of completion,
1020− *_abort_code will be set to any abort code that occurred. 0 will be
1021− returned on a successful completion, -ECONNABORTED will be returned if the
1022− client failed due to a remote abort and anything else will return an
1023− appropriate error code.
1024−
1025− The caller should look at this information to decide if it's worth
1026− retrying the call.
1027−
1028− (*) Retry a client call.
1029−
1030− int rxrpc_kernel_retry_call(struct socket *sock,
1031− struct rxrpc_call *call,
1032− struct sockaddr_rxrpc *srx,
1033− struct key *key);
1034−
1035− This attempts to partially reinitialise a call and submit it again while
1036− reusing the original call's Tx queue to avoid the need to repackage and
1037− re-encrypt the data to be sent. call indicates the call to retry, srx the
1038− new address to send it to and key the encryption key to use for signing or
1039− encrypting the packets.
1040−
1041− For this to work, the first Tx data packet must still be in the transmit
1042− queue, and currently this is only permitted for local and network errors
1043− and the call must not have been aborted. Any partially constructed Tx
1044− packet is left as is and can continue being filled afterwards.
1045−
1046− It returns 0 if the call was requeued and an error otherwise.
1047−
10481003 (*) Get call RTT.
10491004
10501005 u64 rxrpc_kernel_get_rtt(struct socket *sock, struct rxrpc_call *call);
Documentation/networking/snmp_counter.rst+125−5
@@ -336,7 +336,26 @@ time client replies ACK, this socket will get another chance to move · 335 unmodified lines
336336 to the accept queue.
337337
338338
339−TCP Fast Open
339+* TcpEstabResets
340+Defined in `RFC1213 tcpEstabResets`_.
341+
342+.. _RFC1213 tcpEstabResets: https://tools.ietf.org/html/rfc1213#page-48
343+
344+* TcpAttemptFails
345+Defined in `RFC1213 tcpAttemptFails`_.
346+
347+.. _RFC1213 tcpAttemptFails: https://tools.ietf.org/html/rfc1213#page-48
348+
349+* TcpOutRsts
350+Defined in `RFC1213 tcpOutRsts`_. The RFC says this counter indicates
351+the 'segments sent containing the RST flag', but in linux kernel, this
352+couner indicates the segments kerenl tried to send. The sending
353+process might be failed due to some errors (e.g. memory alloc failed).
354+
355+.. _RFC1213 tcpOutRsts: https://tools.ietf.org/html/rfc1213#page-52
356+
357+
358+TCP Fast Path
340359 ============
341360 When kernel receives a TCP packet, it has two paths to handler the
342361 packet, one is fast path, another is slow path. The comment in kernel
@@ -383,8 +402,6 @@ increase 1. · 40 unmodified lines
383402
384403 TCP abort
385404 ========
386−
387−
388405 * TcpExtTCPAbortOnData
389406 It means TCP layer has data in flight, but need to close the
390407 connection. So TCP layer sends a RST to the other side, indicate the
@@ -545,7 +562,6 @@ packet yet, the sender would know packet 4 is out of order. The TCP · 154 unmodified lines
545562 stack of kernel will increase TcpExtTCPSACKReorder for both of the
546563 above scenarios.
547564
548−
549565 DSACK
550566 =====
551567 The DSACK is defined in `RFC2883`_. The receiver uses DSACK to report
@@ -566,13 +582,63 @@ The TCP stack receives an out of order duplicate packet, so it sends a · 14 unmodified lines
566582 DSACK to the sender.
567583
568584 * TcpExtTCPDSACKRecv
569−The TCP stack receives a DSACK, which indicate an acknowledged
585+The TCP stack receives a DSACK, which indicates an acknowledged
570586 duplicate packet is received.
571587
572588 * TcpExtTCPDSACKOfoRecv
573589 The TCP stack receives a DSACK, which indicate an out of order
574590 duplicate packet is received.
575591
592+invalid SACK and DSACK
593+====================
594+When a SACK (or DSACK) block is invalid, a corresponding counter would
595+be updated. The validation method is base on the start/end sequence
596+number of the SACK block. For more details, please refer the comment
597+of the function tcp_is_sackblock_valid in the kernel source code. A
598+SACK option could have up to 4 blocks, they are checked
599+individually. E.g., if 3 blocks of a SACk is invalid, the
600+corresponding counter would be updated 3 times. The comment of the
601+`Add counters for discarded SACK blocks`_ patch has additional
602+explaination:
603+
604+.. _Add counters for discarded SACK blocks: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=18f02545a9a16c9a89778b91a162ad16d510bb32
605+
606+* TcpExtTCPSACKDiscard
607+This counter indicates how many SACK blocks are invalid. If the invalid
608+SACK block is caused by ACK recording, the TCP stack will only ignore
609+it and won't update this counter.
610+
611+* TcpExtTCPDSACKIgnoredOld and TcpExtTCPDSACKIgnoredNoUndo
612+When a DSACK block is invalid, one of these two counters would be
613+updated. Which counter will be updated depends on the undo_marker flag
614+of the TCP socket. If the undo_marker is not set, the TCP stack isn't
615+likely to re-transmit any packets, and we still receive an invalid
616+DSACK block, the reason might be that the packet is duplicated in the
617+middle of the network. In such scenario, TcpExtTCPDSACKIgnoredNoUndo
618+will be updated. If the undo_marker is set, TcpExtTCPDSACKIgnoredOld
619+will be updated. As implied in its name, it might be an old packet.
620+
621+SACK shift
622+=========
623+The linux networking stack stores data in sk_buff struct (skb for
624+short). If a SACK block acrosses multiple skb, the TCP stack will try
625+to re-arrange data in these skb. E.g. if a SACK block acknowledges seq
626+10 to 15, skb1 has seq 10 to 13, skb2 has seq 14 to 20. The seq 14 and
627+15 in skb2 would be moved to skb1. This operation is 'shift'. If a
628+SACK block acknowledges seq 10 to 20, skb1 has seq 10 to 13, skb2 has
629+seq 14 to 20. All data in skb2 will be moved to skb1, and skb2 will be
630+discard, this operation is 'merge'.
631+
632+* TcpExtTCPSackShifted
633+A skb is shifted
634+
635+* TcpExtTCPSackMerged
636+A skb is merged
637+
638+* TcpExtTCPSackShiftFallback
639+A skb should be shifted or merged, but the TCP stack doesn't do it for
640+some reasons.
641+
576642 TCP out of order
577643 ===============
578644 * TcpExtTCPOFOQueue
@@ -662,6 +728,60 @@ unacknowledged number (more strict than `RFC 5961 section 5.2`_). · 83 unmodified lines
662728 .. _RFC 5961 section 4.2: https://tools.ietf.org/html/rfc5961#page-9
663729 .. _RFC 5961 section 5.2: https://tools.ietf.org/html/rfc5961#page-11
664730
731+TCP receive window
732+=================
733+* TcpExtTCPWantZeroWindowAdv
734+Depending on current memory usage, the TCP stack tries to set receive
735+window to zero. But the receive window might still be a no-zero
736+value. For example, if the previous window size is 10, and the TCP
737+stack receives 3 bytes, the current window size would be 7 even if the
738+window size calculated by the memory usage is zero.
739+
740+* TcpExtTCPToZeroWindowAdv
741+The TCP receive window is set to zero from a no-zero value.
742+
743+* TcpExtTCPFromZeroWindowAdv
744+The TCP receive window is set to no-zero value from zero.
745+
746+
747+Delayed ACK
748+==========
749+The TCP Delayed ACK is a technique which is used for reducing the
750+packet count in the network. For more details, please refer the
751+`Delayed ACK wiki`_
752+
753+.. _Delayed ACK wiki: https://en.wikipedia.org/wiki/TCP_delayed_acknowledgment
754+
755+* TcpExtDelayedACKs
756+A delayed ACK timer expires. The TCP stack will send a pure ACK packet
757+and exit the delayed ACK mode.
758+
759+* TcpExtDelayedACKLocked
760+A delayed ACK timer expires, but the TCP stack can't send an ACK
761+immediately due to the socket is locked by a userspace program. The
762+TCP stack will send a pure ACK later (after the userspace program
763+unlock the socket). When the TCP stack sends the pure ACK later, the
764+TCP stack will also update TcpExtDelayedACKs and exit the delayed ACK
765+mode.
766+
767+* TcpExtDelayedACKLost
768+It will be updated when the TCP stack receives a packet which has been
769+ACKed. A Delayed ACK loss might cause this issue, but it would also be
770+triggered by other reasons, such as a packet is duplicated in the
771+network.
772+
773+Tail Loss Probe (TLP)
774+===================
775+TLP is an algorithm which is used to detect TCP packet loss. For more
776+details, please refer the `TLP paper`_.
777+
778+.. _TLP paper: https://tools.ietf.org/html/draft-dukkipati-tcpm-tcp-loss-probe-01
779+
780+* TcpExtTCPLossProbes
781+A TLP probe packet is sent.
782+
783+* TcpExtTCPLossProbeRecovery
784+A packet loss is detected and recovered by TLP.
665785
666786 examples
667787 =======
Documentation/networking/timestamping.txt+2−2
@@ -417,7 +417,7 @@ is again deprecated and ts[2] holds a hardware timestamp if set. · 416 unmodified lines
417417
418418 Hardware time stamping must also be initialized for each device driver
419419 that is expected to do hardware time stamping. The parameter is defined in
420−/include/linux/net_tstamp.h as:
420+include/uapi/linux/net_tstamp.h as:
421421
422422 struct hwtstamp_config {
423423 int flags; /* no flags defined right now, must be zero */
@@ -487,7 +487,7 @@ enum { · 63 unmodified lines
487487 HWTSTAMP_FILTER_PTP_V1_L4_EVENT,
488488
489489 /* for the complete list of values, please check
490− * the include file /include/linux/net_tstamp.h
490+ * the include file include/uapi/linux/net_tstamp.h
491491 */
492492 };
493493
Documentation/sysctl/fs.txt+16−10
@@ -56,26 +56,32 @@ of any kernel data structures. · 55 unmodified lines
5656
5757 dentry-state:
5858
59−From linux/fs/dentry.c:
59+From linux/include/linux/dcache.h:
6060 --------------------------------------------------------------
61−struct {
61+struct dentry_stat_t dentry_stat {
6262 int nr_dentry;
6363 int nr_unused;
6464 int age_limit; /* age in seconds */
6565 int want_pages; /* pages requested by system */
66− int dummy[2];
67−} dentry_stat = {0, 0, 45, 0,};
68−--------------------------------------------------------------
69−
70−Dentries are dynamically allocated and deallocated, and
71−nr_dentry seems to be 0 all the time. Hence it's safe to
72−assume that only nr_unused, age_limit and want_pages are
73−used. Nr_unused seems to be exactly what its name says.
66+ int nr_negative; /* # of unused negative dentries */
67+ int dummy; /* Reserved for future use */
68+};
69+--------------------------------------------------------------
70+
71+Dentries are dynamically allocated and deallocated.
72+
73+nr_dentry shows the total number of dentries allocated (active
74++ unused). nr_unused shows the number of dentries that are not
75+actively used, but are saved in the LRU list for future reuse.
76+
7477 Age_limit is the age in seconds after which dcache entries
7578 can be reclaimed when memory is short and want_pages is
7679 nonzero when shrink_dcache_pages() has been called and the
7780 dcache isn't pruned yet.
7881
82+nr_negative shows the number of unused dentries that are also
83+negative dentries which do not mapped to actual files.
84+
7985 ==============================================================
8086
8187 dquot-max & dquot-nr:
Documentation/trace/coresight-cpu-debug.txt+1−1
@@ -165,7 +165,7 @@ Do some work... · 164 unmodified lines
165165 The same can also be done from an application program.
166166
167167 Disable specific CPU's specific idle state from cpuidle sysfs (see
168−Documentation/cpuidle/sysfs.txt):
168+Documentation/admin-guide/pm/cpuidle.rst):
169169 # echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable
170170
171171
Documentation/virtual/kvm/amd-memory-encryption.rst+1−1
@@ -242,6 +242,6 @@ References · 241 unmodified lines
242242 ==========
243243
244244 .. [white-paper] http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/12/AMD_Memory_Encryption_Whitepaper_v7-Public.pdf
245−.. [api-spec] http://support.amd.com/TechDocs/55766_SEV-KM%20API_Specification.pdf
245+.. [api-spec] http://support.amd.com/TechDocs/55766_SEV-KM_API_Specification.pdf
246246 .. [amd-apm] http://support.amd.com/TechDocs/24593.pdf (section 15.34)
247247 .. [kvm-forum] http://www.linux-kvm.org/images/7/74/02x08A-Thomas_Lendacky-AMDs_Virtualizatoin_Memory_Encryption_Technology.pdf
Documentation/x86/resctrl_ui.txt+1−1
@@ -9,7 +9,7 @@ Fenghua Yu <fenghua.yu@intel.com> · 8 unmodified lines
99 Tony Luck <tony.luck@intel.com>
1010 Vikas Shivappa <vikas.shivappa@intel.com>
1111
12−This feature is enabled by the CONFIG_RESCTRL and the X86 /proc/cpuinfo
12+This feature is enabled by the CONFIG_X86_CPU_RESCTRL and the x86 /proc/cpuinfo
1313 flag bits:
1414 RDT (Resource Director Technology) Allocation - "rdt_a"
1515 CAT (Cache Allocation Technology) - "cat_l3", "cat_l2"
MAINTAINERS+90−30
@@ -2848,6 +2848,9 @@ F: include/uapi/linux/if_bonding.h · 2847 unmodified lines
28482848 BPF (Safe dynamic programs and tools)
28492849 M: Alexei Starovoitov <ast@kernel.org>
28502850 M: Daniel Borkmann <daniel@iogearbox.net>
2851+R: Martin KaFai Lau <kafai@fb.com>
2852+R: Song Liu <songliubraving@fb.com>
2853+R: Yonghong Song <yhs@fb.com>
28512854 L: netdev@vger.kernel.org
28522855 L: linux-kernel@vger.kernel.org
28532856 T: git git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git
@@ -2873,6 +2876,8 @@ F: samples/bpf/ · 19 unmodified lines
28732876 F: tools/bpf/
28742877 F: tools/lib/bpf/
28752878 F: tools/testing/selftests/bpf/
2879+K: bpf
2880+N: bpf
28762881
28772882 BPF JIT for ARM
28782883 M: Shubham Bansal <illusionist.neo@gmail.com>
@@ -3052,8 +3057,8 @@ F: include/linux/bcm963xx_nvram.h · 173 unmodified lines
30523057 F: include/linux/bcm963xx_tag.h
30533058
30543059 BROADCOM BNX2 GIGABIT ETHERNET DRIVER
3055−M: Rasesh Mody <rasesh.mody@cavium.com>
3056−M: Dept-GELinuxNICDev@cavium.com
3060+M: Rasesh Mody <rmody@marvell.com>
3061+M: GR-Linux-NIC-Dev@marvell.com
30573062 L: netdev@vger.kernel.org
30583063 S: Supported
30593064 F: drivers/net/ethernet/broadcom/bnx2.*
@@ -3072,9 +3077,9 @@ S: Supported · 12 unmodified lines
30723077 F: drivers/scsi/bnx2i/
30733078
30743079 BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
3075−M: Ariel Elior <ariel.elior@cavium.com>
3076−M: Sudarsana Kalluru <sudarsana.kalluru@cavium.com>
3077−M: everest-linux-l2@cavium.com
3080+M: Ariel Elior <aelior@marvell.com>
3081+M: Sudarsana Kalluru <skalluru@marvell.com>
3082+M: GR-everest-linux-l2@marvell.com
30783083 L: netdev@vger.kernel.org
30793084 S: Supported
30803085 F: drivers/net/ethernet/broadcom/bnx2x/
@@ -3249,9 +3254,9 @@ S: Supported · 168 unmodified lines
32493254 F: drivers/scsi/bfa/
32503255
32513256 BROCADE BNA 10 GIGABIT ETHERNET DRIVER
3252−M: Rasesh Mody <rasesh.mody@cavium.com>
3253−M: Sudarsana Kalluru <sudarsana.kalluru@cavium.com>
3254−M: Dept-GELinuxNICDev@cavium.com
3257+M: Rasesh Mody <rmody@marvell.com>
3258+M: Sudarsana Kalluru <skalluru@marvell.com>
3259+M: GR-Linux-NIC-Dev@marvell.com
32553260 L: netdev@vger.kernel.org
32563261 S: Supported
32573262 F: drivers/net/ethernet/brocade/bna/
@@ -3471,10 +3476,9 @@ F: drivers/i2c/busses/i2c-octeon* · 213 unmodified lines
34713476 F: drivers/i2c/busses/i2c-thunderx*
34723477
34733478 CAVIUM LIQUIDIO NETWORK DRIVER
3474−M: Derek Chickles <derek.chickles@caviumnetworks.com>
3475−M: Satanand Burla <satananda.burla@caviumnetworks.com>
3476−M: Felix Manlunas <felix.manlunas@caviumnetworks.com>
3477−M: Raghu Vatsavayi <raghu.vatsavayi@caviumnetworks.com>
3479+M: Derek Chickles <dchickles@marvell.com>
3480+M: Satanand Burla <sburla@marvell.com>
3481+M: Felix Manlunas <fmanlunas@marvell.com>
34783482 L: netdev@vger.kernel.org
34793483 W: http://www.cavium.com
34803484 S: Supported
@@ -3951,7 +3955,7 @@ L: netdev@vger.kernel.org · 470 unmodified lines
39513955 S: Maintained
39523956 F: drivers/net/ethernet/ti/cpmac.c
39533957
3954−CPU FREQUENCY DRIVERS
3958+CPU FREQUENCY SCALING FRAMEWORK
39553959 M: "Rafael J. Wysocki" <rjw@rjwysocki.net>
39563960 M: Viresh Kumar <viresh.kumar@linaro.org>
39573961 L: linux-pm@vger.kernel.org
@@ -3959,6 +3963,8 @@ S: Maintained · 1 unmodified line
39593963 T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
39603964 T: git git://git.linaro.org/people/vireshk/linux.git (For ARM Updates)
39613965 B: https://bugzilla.kernel.org
3966+F: Documentation/admin-guide/pm/cpufreq.rst
3967+F: Documentation/admin-guide/pm/intel_pstate.rst
39623968 F: Documentation/cpu-freq/
39633969 F: Documentation/devicetree/bindings/cpufreq/
39643970 F: drivers/cpufreq/
@@ -3977,6 +3983,7 @@ F: drivers/cpufreq/arm_big_little.c · 12 unmodified lines
39773983 CPU POWER MONITORING SUBSYSTEM
39783984 M: Thomas Renninger <trenn@suse.com>
39793985 M: Shuah Khan <shuah@kernel.org>
3986+M: Shuah Khan <skhan@linuxfoundation.org>
39803987 L: linux-pm@vger.kernel.org
39813988 S: Maintained
39823989 F: tools/power/cpupower/
@@ -4006,13 +4013,14 @@ S: Supported · 23 unmodified lines
40064013 F: drivers/cpuidle/cpuidle-exynos.c
40074014 F: arch/arm/mach-exynos/pm.c
40084015
4009−CPUIDLE DRIVERS
4016+CPU IDLE TIME MANAGEMENT FRAMEWORK
40104017 M: "Rafael J. Wysocki" <rjw@rjwysocki.net>
40114018 M: Daniel Lezcano <daniel.lezcano@linaro.org>
40124019 L: linux-pm@vger.kernel.org
40134020 S: Maintained
40144021 T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
40154022 B: https://bugzilla.kernel.org
4023+F: Documentation/admin-guide/pm/cpuidle.rst
40164024 F: drivers/cpuidle/*
40174025 F: include/linux/cpuidle.h
40184026
@@ -5178,7 +5186,7 @@ DRM DRIVERS FOR XEN · 1159 unmodified lines
51785186 M: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
51795187 T: git git://anongit.freedesktop.org/drm/drm-misc
51805188 L: dri-devel@lists.freedesktop.org
5181−L: xen-devel@lists.xen.org
5189+L: xen-devel@lists.xenproject.org (moderated for non-subscribers)
51825190 S: Supported
51835191 F: drivers/gpu/drm/xen/
51845192 F: Documentation/gpu/xen-front.rst
@@ -8256,6 +8264,7 @@ F: include/uapi/linux/sunrpc/ · 3071 unmodified lines
82568264
82578265 KERNEL SELFTEST FRAMEWORK
82588266 M: Shuah Khan <shuah@kernel.org>
8267+M: Shuah Khan <skhan@linuxfoundation.org>
82598268 L: linux-kselftest@vger.kernel.org
82608269 T: git git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git
82618270 Q: https://patchwork.kernel.org/project/linux-kselftest/list/
@@ -10686,9 +10695,9 @@ S: Maintained · 2424 unmodified lines
1068610695 F: drivers/net/netdevsim/*
1068710696
1068810697 NETXEN (1/10) GbE SUPPORT
10689−M: Manish Chopra <manish.chopra@cavium.com>
10690−M: Rahul Verma <rahul.verma@cavium.com>
10691−M: Dept-GELinuxNICDev@cavium.com
10698+M: Manish Chopra <manishc@marvell.com>
10699+M: Rahul Verma <rahulv@marvell.com>
10700+M: GR-Linux-NIC-Dev@marvell.com
1069210701 L: netdev@vger.kernel.org
1069310702 S: Supported
1069410703 F: drivers/net/ethernet/qlogic/netxen/
@@ -11303,10 +11312,12 @@ F: include/dt-bindings/ · 608 unmodified lines
1130311312
1130411313 OPENCORES I2C BUS DRIVER
1130511314 M: Peter Korsgaard <peter@korsgaard.com>
11315+M: Andrew Lunn <andrew@lunn.ch>
1130611316 L: linux-i2c@vger.kernel.org
1130711317 S: Maintained
1130811318 F: Documentation/i2c/busses/i2c-ocores
1130911319 F: drivers/i2c/busses/i2c-ocores.c
11320+F: include/linux/platform_data/i2c-ocores.h
1131011321
1131111322 OPENRISC ARCHITECTURE
1131211323 M: Jonas Bonn <jonas@southpole.se>
@@ -12472,8 +12483,8 @@ S: Supported · 1159 unmodified lines
1247212483 F: drivers/scsi/qedi/
1247312484
1247412485 QLOGIC QL4xxx ETHERNET DRIVER
12475−M: Ariel Elior <Ariel.Elior@cavium.com>
12476−M: everest-linux-l2@cavium.com
12486+M: Ariel Elior <aelior@marvell.com>
12487+M: GR-everest-linux-l2@marvell.com
1247712488 L: netdev@vger.kernel.org
1247812489 S: Supported
1247912490 F: drivers/net/ethernet/qlogic/qed/
@@ -12481,8 +12492,8 @@ F: include/linux/qed/ · 1 unmodified line
1248112492 F: drivers/net/ethernet/qlogic/qede/
1248212493
1248312494 QLOGIC QL4xxx RDMA DRIVER
12484−M: Michal Kalderon <Michal.Kalderon@cavium.com>
12485−M: Ariel Elior <Ariel.Elior@cavium.com>
12495+M: Michal Kalderon <mkalderon@marvell.com>
12496+M: Ariel Elior <aelior@marvell.com>
1248612497 L: linux-rdma@vger.kernel.org
1248712498 S: Supported
1248812499 F: drivers/infiniband/hw/qedr/
@@ -12502,7 +12513,7 @@ F: Documentation/scsi/LICENSE.qla2xxx · 13 unmodified lines
1250212513 F: drivers/scsi/qla2xxx/
1250312514
1250412515 QLOGIC QLA3XXX NETWORK DRIVER
12505−M: Dept-GELinuxNICDev@cavium.com
12516+M: GR-Linux-NIC-Dev@marvell.com
1250612517 L: netdev@vger.kernel.org
1250712518 S: Supported
1250812519 F: Documentation/networking/device_drivers/qlogic/LICENSE.qla3xxx
@@ -12516,16 +12527,16 @@ F: Documentation/scsi/LICENSE.qla4xxx · 7 unmodified lines
1251612527 F: drivers/scsi/qla4xxx/
1251712528
1251812529 QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER
12519−M: Shahed Shaikh <Shahed.Shaikh@cavium.com>
12520−M: Manish Chopra <manish.chopra@cavium.com>
12521−M: Dept-GELinuxNICDev@cavium.com
12530+M: Shahed Shaikh <shshaikh@marvell.com>
12531+M: Manish Chopra <manishc@marvell.com>
12532+M: GR-Linux-NIC-Dev@marvell.com
1252212533 L: netdev@vger.kernel.org
1252312534 S: Supported
1252412535 F: drivers/net/ethernet/qlogic/qlcnic/
1252512536
1252612537 QLOGIC QLGE 10Gb ETHERNET DRIVER
12527−M: Manish Chopra <manish.chopra@cavium.com>
12528−M: Dept-GELinuxNICDev@cavium.com
12538+M: Manish Chopra <manishc@marvell.com>
12539+M: GR-Linux-NIC-Dev@marvell.com
1252912540 L: netdev@vger.kernel.org
1253012541 S: Supported
1253112542 F: drivers/net/ethernet/qlogic/qlge/
@@ -12864,6 +12875,13 @@ F: Documentation/devicetree/bindings/net/dsa/realtek-smi.txt · 332 unmodified lines
1286412875 F: drivers/net/dsa/realtek-smi*
1286512876 F: drivers/net/dsa/rtl83*
1286612877
12878+REDPINE WIRELESS DRIVER
12879+M: Amitkumar Karwar <amitkarwar@gmail.com>
12880+M: Siva Rebbagondla <siva8118@gmail.com>
12881+L: linux-wireless@vger.kernel.org
12882+S: Maintained
12883+F: drivers/net/wireless/rsi/
12884+
1286712885 REGISTER MAP ABSTRACTION
1286812886 M: Mark Brown <broonie@kernel.org>
1286912887 L: linux-kernel@vger.kernel.org
@@ -13692,6 +13710,15 @@ L: netdev@vger.kernel.org · 822 unmodified lines
1369213710 S: Supported
1369313711 F: drivers/net/ethernet/sfc/
1369413712
13713+SFF/SFP/SFP+ MODULE SUPPORT
13714+M: Russell King <linux@armlinux.org.uk>
13715+L: netdev@vger.kernel.org
13716+S: Maintained
13717+F: drivers/net/phy/phylink.c
13718+F: drivers/net/phy/sfp*
13719+F: include/linux/phylink.h
13720+F: include/linux/sfp.h
13721+
1369513722 SGI GRU DRIVER
1369613723 M: Dimitri Sivanich <sivanich@sgi.com>
1369713724 S: Maintained
@@ -13820,8 +13847,9 @@ F: drivers/media/mmc/siano/ · 122 unmodified lines
1382013847
1382113848 SIFIVE DRIVERS
1382213849 M: Palmer Dabbelt <palmer@sifive.com>
13850+M: Paul Walmsley <paul.walmsley@sifive.com>
1382313851 L: linux-riscv@lists.infradead.org
13824−T: git git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux.git
13852+T: git git://github.com/sifive/riscv-linux.git
1382513853 S: Supported
1382613854 K: sifive
1382713855 N: sifive
@@ -14432,6 +14460,11 @@ M: Florian Schilhabel <florian.c.schilhabel@googlemail.com>. · 604 unmodified lines
1443214460 S: Odd Fixes
1443314461 F: drivers/staging/rtl8712/
1443414462
14463+STAGING - REALTEK RTL8188EU DRIVERS
14464+M: Larry Finger <Larry.Finger@lwfinger.net>
14465+S: Odd Fixes
14466+F: drivers/staging/rtl8188eu/
14467+
1443514468 STAGING - SILICON MOTION SM750 FRAME BUFFER DRIVER
1443614469 M: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
1443714470 M: Teddy Wang <teddy.wang@siliconmotion.com>
@@ -15802,7 +15835,6 @@ M: Alan Stern <stern@rowland.harvard.edu> · 1364 unmodified lines
1580215835 L: linux-usb@vger.kernel.org
1580315836 L: usb-storage@lists.one-eyed-alien.net
1580415837 S: Maintained
15805−W: http://www.one-eyed-alien.net/~mdharm/linux-usb/
1580615838 F: drivers/usb/storage/
1580715839
1580815840 USB MIDI DRIVER
@@ -15834,6 +15866,7 @@ F: drivers/usb/common/usb-otg-fsm.c · 25 unmodified lines
1583415866 USB OVER IP DRIVER
1583515867 M: Valentina Manea <valentina.manea.m@gmail.com>
1583615868 M: Shuah Khan <shuah@kernel.org>
15869+M: Shuah Khan <skhan@linuxfoundation.org>
1583715870 L: linux-usb@vger.kernel.org
1583815871 S: Maintained
1583915872 F: Documentation/usb/usbip_protocol.txt
@@ -16631,6 +16664,15 @@ S: Maintained · 791 unmodified lines
1663116664 F: drivers/platform/x86/
1663216665 F: drivers/platform/olpc/
1663316666
16667+X86 PLATFORM DRIVERS - ARCH
16668+R: Darren Hart <dvhart@infradead.org>
16669+R: Andy Shevchenko <andy@infradead.org>
16670+L: platform-driver-x86@vger.kernel.org
16671+L: x86@kernel.org
16672+T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core
16673+S: Maintained
16674+F: arch/x86/platform
16675+
1663416676 X86 VDSO
1663516677 M: Andy Lutomirski <luto@kernel.org>
1663616678 L: linux-kernel@vger.kernel.org
@@ -16663,6 +16705,24 @@ T: git git://linuxtv.org/media_tree.git · 26 unmodified lines
1666316705 S: Maintained
1666416706 F: drivers/media/tuners/tuner-xc2028.*
1666516707
16708+XDP (eXpress Data Path)
16709+M: Alexei Starovoitov <ast@kernel.org>
16710+M: Daniel Borkmann <daniel@iogearbox.net>
16711+M: David S. Miller <davem@davemloft.net>
16712+M: Jakub Kicinski <jakub.kicinski@netronome.com>
16713+M: Jesper Dangaard Brouer <hawk@kernel.org>
16714+M: John Fastabend <john.fastabend@gmail.com>
16715+L: netdev@vger.kernel.org
16716+L: xdp-newbies@vger.kernel.org
16717+S: Supported
16718+F: net/core/xdp.c
16719+F: include/net/xdp.h
16720+F: kernel/bpf/devmap.c
16721+F: kernel/bpf/cpumap.c
16722+F: include/trace/events/xdp.h
16723+K: xdp
16724+N: xdp
16725+
1666616726 XDP SOCKETS (AF_XDP)
1666716727 M: Björn Töpel <bjorn.topel@intel.com>
1666816728 M: Magnus Karlsson <magnus.karlsson@intel.com>
Makefile+5−5
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 0
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc1
5+EXTRAVERSION = -rc6
66 NAME = Shy Crocodile
77
88 # *DOCUMENTATION*
@@ -955,6 +955,7 @@ ifdef CONFIG_STACK_VALIDATION · 946 unmodified lines
955955 endif
956956 endif
957957
958+PHONY += prepare0
958959
959960 ifeq ($(KBUILD_EXTMOD),)
960961 core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
@@ -1061,8 +1062,7 @@ scripts: scripts_basic scripts_dtc · 100 unmodified lines
10611062 # archprepare is used in arch Makefiles and when processed asm symlink,
10621063 # version.h and scripts_basic is processed / created.
10631064
1064−# Listed in dependency order
1065−PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
1065+PHONY += prepare archprepare prepare1 prepare2 prepare3
10661066
10671067 # prepare3 is used to check if we are building in a separate output directory,
10681068 # and if so do:
@@ -1360,11 +1360,11 @@ mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS)) · 291 unmodified lines
13601360 mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
13611361 mrproper-dirs := $(addprefix _mrproper_,scripts)
13621362
1363−PHONY += $(mrproper-dirs) mrproper archmrproper
1363+PHONY += $(mrproper-dirs) mrproper
13641364 $(mrproper-dirs):
13651365 $(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
13661366
1367−mrproper: clean archmrproper $(mrproper-dirs)
1367+mrproper: clean $(mrproper-dirs)
13681368 $(call cmd,rmdirs)
13691369 $(call cmd,rmfiles)
13701370
arch/arc/include/asm/Kbuild+0−4
@@ -3,23 +3,19 @@ generic-y += bugs.h · 2 unmodified lines
33 generic-y += compat.h
44 generic-y += device.h
55 generic-y += div64.h
6−generic-y += dma-mapping.h
76 generic-y += emergency-restart.h
87 generic-y += extable.h
9−generic-y += fb.h
108 generic-y += ftrace.h
119 generic-y += hardirq.h
1210 generic-y += hw_irq.h
1311 generic-y += irq_regs.h
1412 generic-y += irq_work.h
15−generic-y += kmap_types.h
1613 generic-y += local.h
1714 generic-y += local64.h
1815 generic-y += mcs_spinlock.h
1916 generic-y += mm-arch-hooks.h
2017 generic-y += msi.h
2118 generic-y += parport.h
22−generic-y += pci.h
2319 generic-y += percpu.h
2420 generic-y += preempt.h
2521 generic-y += topology.h
arch/arc/include/asm/arcregs.h+10−2
@@ -216,6 +216,14 @@ struct bcr_fp_arcv2 { · 215 unmodified lines
216216 #endif
217217 };
218218
219+struct bcr_actionpoint {
220+#ifdef CONFIG_CPU_BIG_ENDIAN
221+ unsigned int pad:21, min:1, num:2, ver:8;
222+#else
223+ unsigned int ver:8, num:2, min:1, pad:21;
224+#endif
225+};
226+
219227 #include <soc/arc/timers.h>
220228
221229 struct bcr_bpu_arcompact {
@@ -283,7 +291,7 @@ struct cpuinfo_arc_cache { · 61 unmodified lines
283291 };
284292
285293 struct cpuinfo_arc_bpu {
286− unsigned int ver, full, num_cache, num_pred;
294+ unsigned int ver, full, num_cache, num_pred, ret_stk;
287295 };
288296
289297 struct cpuinfo_arc_ccm {
@@ -302,7 +310,7 @@ struct cpuinfo_arc { · 12 unmodified lines
302310 struct {
303311 unsigned int swap:1, norm:1, minmax:1, barrel:1, crc:1, swape:1, pad1:2,
304312 fpu_sp:1, fpu_dp:1, dual:1, dual_enb:1, pad2:4,
305− debug:1, ap:1, smart:1, rtt:1, pad3:4,
313+ ap_num:4, ap_full:1, smart:1, rtt:1, pad3:1,
306314 timer0:1, timer1:1, rtc:1, gfrc:1, pad4:4;
307315 } extn;
308316 struct bcr_mpy extn_mpy;
arch/arc/include/asm/bitops.h+3−3
@@ -340,7 +340,7 @@ static inline __attribute__ ((const)) int __fls(unsigned long x) · 339 unmodified lines
340340 /*
341341 * __ffs: Similar to ffs, but zero based (0-31)
342342 */
343−static inline __attribute__ ((const)) int __ffs(unsigned long word)
343+static inline __attribute__ ((const)) unsigned long __ffs(unsigned long word)
344344 {
345345 if (!word)
346346 return word;
@@ -400,9 +400,9 @@ static inline __attribute__ ((const)) int ffs(unsigned long x) · 53 unmodified lines
400400 /*
401401 * __ffs: Similar to ffs, but zero based (0-31)
402402 */
403−static inline __attribute__ ((const)) int __ffs(unsigned long x)
403+static inline __attribute__ ((const)) unsigned long __ffs(unsigned long x)
404404 {
405− int n;
405+ unsigned long n;
406406
407407 asm volatile(
408408 " ffs.f %0, %1 \n" /* 0:31; 31(Z) if src 0 */
arch/arc/include/asm/perf_event.h+2−1
@@ -103,7 +103,8 @@ static const char * const arc_pmu_ev_hw_map[] = { · 102 unmodified lines
103103
104104 /* counts condition */
105105 [PERF_COUNT_HW_INSTRUCTIONS] = "iall",
106− [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = "ijmp", /* Excludes ZOL jumps */
106+ /* All jump instructions that are taken */
107+ [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = "ijmptak",
107108 [PERF_COUNT_ARC_BPOK] = "bpok", /* NP-NT, PT-T, PNT-NT */
108109 #ifdef CONFIG_ISA_ARCV2
109110 [PERF_COUNT_HW_BRANCH_MISSES] = "bpmp",
arch/arc/kernel/perf_event.c+182−59
@@ -1,15 +1,10 @@
1−/*
2− * Linux performance counter support for ARC700 series
3− *
4− * Copyright (C) 2013-2015 Synopsys, Inc. (www.synopsys.com)
5− *
6− * This code is inspired by the perf support of various other architectures.
7− *
8− * This program is free software; you can redistribute it and/or modify
9− * it under the terms of the GNU General Public License version 2 as
10− * published by the Free Software Foundation.
11− *
12− */
1+// SPDX-License-Identifier: GPL-2.0+
2+//
3+// Linux performance counter support for ARC CPUs.
4+// This code is inspired by the perf support of various other architectures.
5+//
6+// Copyright (C) 2013-2018 Synopsys, Inc. (www.synopsys.com)
7+
138 #include <linux/errno.h>
149 #include <linux/interrupt.h>
1510 #include <linux/module.h>
@@ -19,12 +14,31 @@ · 3 unmodified lines
1914 #include <asm/arcregs.h>
2015 #include <asm/stacktrace.h>
2116
17+/* HW holds 8 symbols + one for null terminator */
18+#define ARCPMU_EVENT_NAME_LEN 9
19+
20+enum arc_pmu_attr_groups {
21+ ARCPMU_ATTR_GR_EVENTS,
22+ ARCPMU_ATTR_GR_FORMATS,
23+ ARCPMU_NR_ATTR_GR
24+};
25+
26+struct arc_pmu_raw_event_entry {
27+ char name[ARCPMU_EVENT_NAME_LEN];
28+};
29+
2230 struct arc_pmu {
2331 struct pmu pmu;
2432 unsigned int irq;
2533 int n_counters;
34+ int n_events;
2635 u64 max_period;
2736 int ev_hw_idx[PERF_COUNT_ARC_HW_MAX];
37+
38+ struct arc_pmu_raw_event_entry *raw_entry;
39+ struct attribute **attrs;
40+ struct perf_pmu_events_attr *attr;
41+ const struct attribute_group *attr_groups[ARCPMU_NR_ATTR_GR + 1];
2842 };
2943
3044 struct arc_pmu_cpu {
@@ -49,6 +63,7 @@ static int callchain_trace(unsigned int addr, void *data) · 18 unmodified lines
4963 {
5064 struct arc_callchain_trace *ctrl = data;
5165 struct perf_callchain_entry_ctx *entry = ctrl->perf_stuff;
66+
5267 perf_callchain_store(entry, addr);
5368
5469 if (ctrl->depth++ < 3)
@@ -57,8 +72,8 @@ static int callchain_trace(unsigned int addr, void *data) · 2 unmodified lines
5772 return -1;
5873 }
5974
60−void
61−perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
75+void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
76+ struct pt_regs *regs)
6277 {
6378 struct arc_callchain_trace ctrl = {
6479 .depth = 0,
@@ -68,8 +83,8 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *re · 3 unmodified lines
6883 arc_unwind_core(NULL, regs, callchain_trace, &ctrl);
6984 }
7085
71−void
72−perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
86+void perf_callchain_user(struct perf_callchain_entry_ctx *entry,
87+ struct pt_regs *regs)
7388 {
7489 /*
7590 * User stack can't be unwound trivially with kernel dwarf unwinder
@@ -82,10 +97,10 @@ static struct arc_pmu *arc_pmu; · 6 unmodified lines
8297 static DEFINE_PER_CPU(struct arc_pmu_cpu, arc_pmu_cpu);
8398
8499 /* read counter #idx; note that counter# != event# on ARC! */
85−static uint64_t arc_pmu_read_counter(int idx)
100+static u64 arc_pmu_read_counter(int idx)
86101 {
87− uint32_t tmp;
88− uint64_t result;
102+ u32 tmp;
103+ u64 result;
89104
90105 /*
91106 * ARC supports making 'snapshots' of the counters, so we don't
@@ -94,7 +109,7 @@ static uint64_t arc_pmu_read_counter(int idx) · 2 unmodified lines
94109 write_aux_reg(ARC_REG_PCT_INDEX, idx);
95110 tmp = read_aux_reg(ARC_REG_PCT_CONTROL);
96111 write_aux_reg(ARC_REG_PCT_CONTROL, tmp | ARC_REG_PCT_CONTROL_SN);
97− result = (uint64_t) (read_aux_reg(ARC_REG_PCT_SNAPH)) << 32;
112+ result = (u64) (read_aux_reg(ARC_REG_PCT_SNAPH)) << 32;
98113 result |= read_aux_reg(ARC_REG_PCT_SNAPL);
99114
100115 return result;
@@ -103,9 +118,9 @@ static uint64_t arc_pmu_read_counter(int idx) · 2 unmodified lines
103118 static void arc_perf_event_update(struct perf_event *event,
104119 struct hw_perf_event *hwc, int idx)
105120 {
106− uint64_t prev_raw_count = local64_read(&hwc->prev_count);
107− uint64_t new_raw_count = arc_pmu_read_counter(idx);
108− int64_t delta = new_raw_count - prev_raw_count;
121+ u64 prev_raw_count = local64_read(&hwc->prev_count);
122+ u64 new_raw_count = arc_pmu_read_counter(idx);
123+ s64 delta = new_raw_count - prev_raw_count;
109124
110125 /*
111126 * We aren't afraid of hwc->prev_count changing beneath our feet
@@ -155,7 +170,7 @@ static int arc_pmu_event_init(struct perf_event *event) · 43 unmodified lines
155170 int ret;
156171
157172 if (!is_sampling_event(event)) {
158− hwc->sample_period = arc_pmu->max_period;
173+ hwc->sample_period = arc_pmu->max_period;
159174 hwc->last_period = hwc->sample_period;
160175 local64_set(&hwc->period_left, hwc->sample_period);
161176 }
@@ -192,6 +207,18 @@ static int arc_pmu_event_init(struct perf_event *event) · 30 unmodified lines
192207 pr_debug("init cache event with h/w %08x \'%s\'\n",
193208 (int)hwc->config, arc_pmu_ev_hw_map[ret]);
194209 return 0;
210+
211+ case PERF_TYPE_RAW:
212+ if (event->attr.config >= arc_pmu->n_events)
213+ return -ENOENT;
214+
215+ hwc->config |= event->attr.config;
216+ pr_debug("init raw event with idx %lld \'%s\'\n",
217+ event->attr.config,
218+ arc_pmu->raw_entry[event->attr.config].name);
219+
220+ return 0;
221+
195222 default:
196223 return -ENOENT;
197224 }
@@ -200,7 +227,7 @@ static int arc_pmu_event_init(struct perf_event *event) · 2 unmodified lines
200227 /* starts all counters */
201228 static void arc_pmu_enable(struct pmu *pmu)
202229 {
203− uint32_t tmp;
230+ u32 tmp;
204231 tmp = read_aux_reg(ARC_REG_PCT_CONTROL);
205232 write_aux_reg(ARC_REG_PCT_CONTROL, (tmp & 0xffff0000) | 0x1);
206233 }
@@ -208,7 +235,7 @@ static void arc_pmu_enable(struct pmu *pmu) · 1 unmodified line
208235 /* stops all counters */
209236 static void arc_pmu_disable(struct pmu *pmu)
210237 {
211− uint32_t tmp;
238+ u32 tmp;
212239 tmp = read_aux_reg(ARC_REG_PCT_CONTROL);
213240 write_aux_reg(ARC_REG_PCT_CONTROL, (tmp & 0xffff0000) | 0x0);
214241 }
@@ -228,7 +255,7 @@ static int arc_pmu_event_set_period(struct perf_event *event) · 13 unmodified lines
228255 local64_set(&hwc->period_left, left);
229256 hwc->last_period = period;
230257 overflow = 1;
231− } else if (unlikely(left <= 0)) {
258+ } else if (unlikely(left <= 0)) {
232259 /* left underflowed by less than period. */
233260 left += period;
234261 local64_set(&hwc->period_left, left);
@@ -246,8 +273,8 @@ static int arc_pmu_event_set_period(struct perf_event *event) · 11 unmodified lines
246273 write_aux_reg(ARC_REG_PCT_INDEX, idx);
247274
248275 /* Write value */
249− write_aux_reg(ARC_REG_PCT_COUNTL, (u32)value);
250− write_aux_reg(ARC_REG_PCT_COUNTH, (value >> 32));
276+ write_aux_reg(ARC_REG_PCT_COUNTL, lower_32_bits(value));
277+ write_aux_reg(ARC_REG_PCT_COUNTH, upper_32_bits(value));
251278
252279 perf_event_update_userpage(event);
253280
@@ -277,7 +304,7 @@ static void arc_pmu_start(struct perf_event *event, int flags) · 23 unmodified lines
277304 /* Enable interrupt for this counter */
278305 if (is_sampling_event(event))
279306 write_aux_reg(ARC_REG_PCT_INT_CTRL,
280− read_aux_reg(ARC_REG_PCT_INT_CTRL) | (1 << idx));
307+ read_aux_reg(ARC_REG_PCT_INT_CTRL) | BIT(idx));
281308
282309 /* enable ARC pmu here */
283310 write_aux_reg(ARC_REG_PCT_INDEX, idx); /* counter # */
@@ -295,9 +322,9 @@ static void arc_pmu_stop(struct perf_event *event, int flags) · 11 unmodified lines
295322 * Reset interrupt flag by writing of 1. This is required
296323 * to make sure pending interrupt was not left.
297324 */
298− write_aux_reg(ARC_REG_PCT_INT_ACT, 1 << idx);
325+ write_aux_reg(ARC_REG_PCT_INT_ACT, BIT(idx));
299326 write_aux_reg(ARC_REG_PCT_INT_CTRL,
300− read_aux_reg(ARC_REG_PCT_INT_CTRL) & ~(1 << idx));
327+ read_aux_reg(ARC_REG_PCT_INT_CTRL) & ~BIT(idx));
301328 }
302329
303330 if (!(event->hw.state & PERF_HES_STOPPED)) {
@@ -349,9 +376,10 @@ static int arc_pmu_add(struct perf_event *event, int flags) · 45 unmodified lines
349376
350377 if (is_sampling_event(event)) {
351378 /* Mimic full counter overflow as other arches do */
352− write_aux_reg(ARC_REG_PCT_INT_CNTL, (u32)arc_pmu->max_period);
379+ write_aux_reg(ARC_REG_PCT_INT_CNTL,
380+ lower_32_bits(arc_pmu->max_period));
353381 write_aux_reg(ARC_REG_PCT_INT_CNTH,
354− (arc_pmu->max_period >> 32));
382+ upper_32_bits(arc_pmu->max_period));
355383 }
356384
357385 write_aux_reg(ARC_REG_PCT_CONFIG, 0);
@@ -392,7 +420,7 @@ static irqreturn_t arc_pmu_intr(int irq, void *dev) · 34 unmodified lines
392420 idx = __ffs(active_ints);
393421
394422 /* Reset interrupt flag by writing of 1 */
395− write_aux_reg(ARC_REG_PCT_INT_ACT, 1 << idx);
423+ write_aux_reg(ARC_REG_PCT_INT_ACT, BIT(idx));
396424
397425 /*
398426 * On reset of "interrupt active" bit corresponding
@@ -400,7 +428,7 @@ static irqreturn_t arc_pmu_intr(int irq, void *dev) · 1 unmodified line
400428 * Now we need to re-enable interrupt for the counter.
401429 */
402430 write_aux_reg(ARC_REG_PCT_INT_CTRL,
403− read_aux_reg(ARC_REG_PCT_INT_CTRL) | (1 << idx));
431+ read_aux_reg(ARC_REG_PCT_INT_CTRL) | BIT(idx));
404432
405433 event = pmu_cpu->act_counter[idx];
406434 hwc = &event->hw;
@@ -414,7 +442,7 @@ static irqreturn_t arc_pmu_intr(int irq, void *dev) · 7 unmodified lines
414442 arc_pmu_stop(event, 0);
415443 }
416444
417− active_ints &= ~(1U << idx);
445+ active_ints &= ~BIT(idx);
418446 } while (active_ints);
419447
420448 done:
@@ -441,19 +469,108 @@ static void arc_cpu_pmu_irq_init(void *data) · 20 unmodified lines
441469 write_aux_reg(ARC_REG_PCT_INT_ACT, 0xffffffff);
442470 }
443471
472+/* Event field occupies the bottom 15 bits of our config field */
473+PMU_FORMAT_ATTR(event, "config:0-14");
474+static struct attribute *arc_pmu_format_attrs[] = {
475+ &format_attr_event.attr,
476+ NULL,
477+};
478+
479+static struct attribute_group arc_pmu_format_attr_gr = {
480+ .name = "format",
481+ .attrs = arc_pmu_format_attrs,
482+};
483+
484+static ssize_t arc_pmu_events_sysfs_show(struct device *dev,
485+ struct device_attribute *attr,
486+ char *page)
487+{
488+ struct perf_pmu_events_attr *pmu_attr;
489+
490+ pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr);
491+ return sprintf(page, "event=0x%04llx\n", pmu_attr->id);
492+}
493+
494+/*
495+ * We don't add attrs here as we don't have pre-defined list of perf events.
496+ * We will generate and add attrs dynamically in probe() after we read HW
497+ * configuration.
498+ */
499+static struct attribute_group arc_pmu_events_attr_gr = {
500+ .name = "events",
501+};
502+
503+static void arc_pmu_add_raw_event_attr(int j, char *str)
504+{
505+ memmove(arc_pmu->raw_entry[j].name, str, ARCPMU_EVENT_NAME_LEN - 1);
506+ arc_pmu->attr[j].attr.attr.name = arc_pmu->raw_entry[j].name;
507+ arc_pmu->attr[j].attr.attr.mode = VERIFY_OCTAL_PERMISSIONS(0444);
508+ arc_pmu->attr[j].attr.show = arc_pmu_events_sysfs_show;
509+ arc_pmu->attr[j].id = j;
510+ arc_pmu->attrs[j] = &(arc_pmu->attr[j].attr.attr);
511+}
512+
513+static int arc_pmu_raw_alloc(struct device *dev)
514+{
515+ arc_pmu->attr = devm_kmalloc_array(dev, arc_pmu->n_events + 1,
516+ sizeof(*arc_pmu->attr), GFP_KERNEL | __GFP_ZERO);
517+ if (!arc_pmu->attr)
518+ return -ENOMEM;
519+
520+ arc_pmu->attrs = devm_kmalloc_array(dev, arc_pmu->n_events + 1,
521+ sizeof(*arc_pmu->attrs), GFP_KERNEL | __GFP_ZERO);
522+ if (!arc_pmu->attrs)
523+ return -ENOMEM;
524+
525+ arc_pmu->raw_entry = devm_kmalloc_array(dev, arc_pmu->n_events,
526+ sizeof(*arc_pmu->raw_entry), GFP_KERNEL | __GFP_ZERO);
527+ if (!arc_pmu->raw_entry)
528+ return -ENOMEM;
529+
530+ return 0;
531+}
532+
533+static inline bool event_in_hw_event_map(int i, char *name)
534+{
535+ if (!arc_pmu_ev_hw_map[i])
536+ return false;
537+
538+ if (!strlen(arc_pmu_ev_hw_map[i]))
539+ return false;
540+
541+ if (strcmp(arc_pmu_ev_hw_map[i], name))
542+ return false;
543+
544+ return true;
545+}
546+
547+static void arc_pmu_map_hw_event(int j, char *str)
548+{
549+ int i;
550+
551+ /* See if HW condition has been mapped to a perf event_id */
552+ for (i = 0; i < ARRAY_SIZE(arc_pmu_ev_hw_map); i++) {
553+ if (event_in_hw_event_map(i, str)) {
554+ pr_debug("mapping perf event %2d to h/w event \'%8s\' (idx %d)\n",
555+ i, str, j);
556+ arc_pmu->ev_hw_idx[i] = j;
557+ }
558+ }
559+}
560+
444561 static int arc_pmu_device_probe(struct platform_device *pdev)
445562 {
446563 struct arc_reg_pct_build pct_bcr;
447564 struct arc_reg_cc_build cc_bcr;
448− int i, j, has_interrupts;
565+ int i, has_interrupts;
449566 int counter_size; /* in bits */
450567
451568 union cc_name {
452569 struct {
453− uint32_t word0, word1;
570+ u32 word0, word1;
454571 char sentinel;
455572 } indiv;
456− char str[9];
573+ char str[ARCPMU_EVENT_NAME_LEN];
457574 } cc_name;
458575
459576
@@ -463,15 +580,22 @@ static int arc_pmu_device_probe(struct platform_device *pdev) · 3 unmodified lines
463580 return -ENODEV;
464581 }
465582 BUILD_BUG_ON(ARC_PERF_MAX_COUNTERS > 32);
466− BUG_ON(pct_bcr.c > ARC_PERF_MAX_COUNTERS);
583+ if (WARN_ON(pct_bcr.c > ARC_PERF_MAX_COUNTERS))
584+ return -EINVAL;
467585
468586 READ_BCR(ARC_REG_CC_BUILD, cc_bcr);
469− BUG_ON(!cc_bcr.v); /* Counters exist but No countable conditions ? */
587+ if (WARN(!cc_bcr.v, "Counters exist but No countable conditions?"))
588+ return -EINVAL;
470589
471590 arc_pmu = devm_kzalloc(&pdev->dev, sizeof(struct arc_pmu), GFP_KERNEL);
472591 if (!arc_pmu)
473592 return -ENOMEM;
474593
594+ arc_pmu->n_events = cc_bcr.c;
595+
596+ if (arc_pmu_raw_alloc(&pdev->dev))
597+ return -ENOMEM;
598+
475599 has_interrupts = is_isa_arcv2() ? pct_bcr.i : 0;
476600
477601 arc_pmu->n_counters = pct_bcr.c;
@@ -481,30 +605,26 @@ static int arc_pmu_device_probe(struct platform_device *pdev) · 3 unmodified lines
481605
482606 pr_info("ARC perf\t: %d counters (%d bits), %d conditions%s\n",
483607 arc_pmu->n_counters, counter_size, cc_bcr.c,
484− has_interrupts ? ", [overflow IRQ support]":"");
608+ has_interrupts ? ", [overflow IRQ support]" : "");
485609
486− cc_name.str[8] = 0;
610+ cc_name.str[ARCPMU_EVENT_NAME_LEN - 1] = 0;
487611 for (i = 0; i < PERF_COUNT_ARC_HW_MAX; i++)
488612 arc_pmu->ev_hw_idx[i] = -1;
489613
490614 /* loop thru all available h/w condition indexes */
491− for (j = 0; j < cc_bcr.c; j++) {
492− write_aux_reg(ARC_REG_CC_INDEX, j);
615+ for (i = 0; i < cc_bcr.c; i++) {
616+ write_aux_reg(ARC_REG_CC_INDEX, i);
493617 cc_name.indiv.word0 = read_aux_reg(ARC_REG_CC_NAME0);
494618 cc_name.indiv.word1 = read_aux_reg(ARC_REG_CC_NAME1);
495619
496− /* See if it has been mapped to a perf event_id */
497− for (i = 0; i < ARRAY_SIZE(arc_pmu_ev_hw_map); i++) {
498− if (arc_pmu_ev_hw_map[i] &&
499− !strcmp(arc_pmu_ev_hw_map[i], cc_name.str) &&
500− strlen(arc_pmu_ev_hw_map[i])) {
501− pr_debug("mapping perf event %2d to h/w event \'%8s\' (idx %d)\n",
502− i, cc_name.str, j);
503− arc_pmu->ev_hw_idx[i] = j;
504− }
505− }
620+ arc_pmu_map_hw_event(i, cc_name.str);
621+ arc_pmu_add_raw_event_attr(i, cc_name.str);
506622 }
507623
624+ arc_pmu_events_attr_gr.attrs = arc_pmu->attrs;
625+ arc_pmu->attr_groups[ARCPMU_ATTR_GR_EVENTS] = &arc_pmu_events_attr_gr;
626+ arc_pmu->attr_groups[ARCPMU_ATTR_GR_FORMATS] = &arc_pmu_format_attr_gr;
627+
508628 arc_pmu->pmu = (struct pmu) {
509629 .pmu_enable = arc_pmu_enable,
510630 .pmu_disable = arc_pmu_disable,
@@ -514,6 +634,7 @@ static int arc_pmu_device_probe(struct platform_device *pdev) · 3 unmodified lines
514634 .start = arc_pmu_start,
515635 .stop = arc_pmu_stop,
516636 .read = arc_pmu_read,
637+ .attr_groups = arc_pmu->attr_groups,
517638 };
518639
519640 if (has_interrupts) {
@@ -535,17 +656,19 @@ static int arc_pmu_device_probe(struct platform_device *pdev) · 15 unmodified lines
535656 } else
536657 arc_pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT;
537658
538− return perf_pmu_register(&arc_pmu->pmu, pdev->name, PERF_TYPE_RAW);
659+ /*
660+ * perf parser doesn't really like '-' symbol in events name, so let's
661+ * use '_' in arc pct name as it goes to kernel PMU event prefix.
662+ */
663+ return perf_pmu_register(&arc_pmu->pmu, "arc_pct", PERF_TYPE_RAW);
539664 }
540665
541−#ifdef CONFIG_OF
542666 static const struct of_device_id arc_pmu_match[] = {
543667 { .compatible = "snps,arc700-pct" },
544668 { .compatible = "snps,archs-pct" },
545669 {},
546670 };
547671 MODULE_DEVICE_TABLE(of, arc_pmu_match);
548−#endif
549672
550673 static struct platform_driver arc_pmu_driver = {
551674 .driver = {
arch/arc/kernel/setup.c+18−9
@@ -123,6 +123,7 @@ static void read_arc_build_cfg_regs(void) · 122 unmodified lines
123123 struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()];
124124 const struct id_to_str *tbl;
125125 struct bcr_isa_arcv2 isa;
126+ struct bcr_actionpoint ap;
126127
127128 FIX_PTR(cpu);
128129
@@ -195,6 +196,7 @@ static void read_arc_build_cfg_regs(void) · 66 unmodified lines
195196 cpu->bpu.full = bpu.ft;
196197 cpu->bpu.num_cache = 256 << bpu.bce;
197198 cpu->bpu.num_pred = 2048 << bpu.pte;
199+ cpu->bpu.ret_stk = 4 << bpu.rse;
198200
199201 if (cpu->core.family >= 0x54) {
200202 unsigned int exec_ctrl;
@@ -207,8 +209,11 @@ static void read_arc_build_cfg_regs(void) · 6 unmodified lines
207209 }
208210 }
209211
210− READ_BCR(ARC_REG_AP_BCR, bcr);
211− cpu->extn.ap = bcr.ver ? 1 : 0;
212+ READ_BCR(ARC_REG_AP_BCR, ap);
213+ if (ap.ver) {
214+ cpu->extn.ap_num = 2 << ap.num;
215+ cpu->extn.ap_full = !!ap.min;
216+ }
212217
213218 READ_BCR(ARC_REG_SMART_BCR, bcr);
214219 cpu->extn.smart = bcr.ver ? 1 : 0;
@@ -216,8 +221,6 @@ static void read_arc_build_cfg_regs(void) · 1 unmodified line
216221 READ_BCR(ARC_REG_RTT_BCR, bcr);
217222 cpu->extn.rtt = bcr.ver ? 1 : 0;
218223
219− cpu->extn.debug = cpu->extn.ap | cpu->extn.smart | cpu->extn.rtt;
220−
221224 READ_BCR(ARC_REG_ISA_CFG_BCR, isa);
222225
223226 /* some hacks for lack of feature BCR info in old ARC700 cores */
@@ -299,10 +302,10 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len) · 75 unmodified lines
299302
300303 if (cpu->bpu.ver)
301304 n += scnprintf(buf + n, len - n,
302− "BPU\t\t: %s%s match, cache:%d, Predict Table:%d",
305+ "BPU\t\t: %s%s match, cache:%d, Predict Table:%d Return stk: %d",
303306 IS_AVAIL1(cpu->bpu.full, "full"),
304307 IS_AVAIL1(!cpu->bpu.full, "partial"),
305− cpu->bpu.num_cache, cpu->bpu.num_pred);
308+ cpu->bpu.num_cache, cpu->bpu.num_pred, cpu->bpu.ret_stk);
306309
307310 if (is_isa_arcv2()) {
308311 struct bcr_lpb lpb;
@@ -336,11 +339,17 @@ static char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len) · 27 unmodified lines
336339 IS_AVAIL1(cpu->extn.fpu_sp, "SP "),
337340 IS_AVAIL1(cpu->extn.fpu_dp, "DP "));
338341
339− if (cpu->extn.debug)
340− n += scnprintf(buf + n, len - n, "DEBUG\t\t: %s%s%s\n",
341− IS_AVAIL1(cpu->extn.ap, "ActionPoint "),
342+ if (cpu->extn.ap_num | cpu->extn.smart | cpu->extn.rtt) {
343+ n += scnprintf(buf + n, len - n, "DEBUG\t\t: %s%s",
342344 IS_AVAIL1(cpu->extn.smart, "smaRT "),
343345 IS_AVAIL1(cpu->extn.rtt, "RTT "));
346+ if (cpu->extn.ap_num) {
347+ n += scnprintf(buf + n, len - n, "ActionPoint %d/%s",
348+ cpu->extn.ap_num,
349+ cpu->extn.ap_full ? "full":"min");
350+ }
351+ n += scnprintf(buf + n, len - n, "\n");
352+ }
344353
345354 if (cpu->dccm.sz || cpu->iccm.sz)
346355 n += scnprintf(buf + n, len - n, "Extn [CCM]\t: DCCM @ %x, %d KB / ICCM: @ %x, %d KB\n",
arch/arc/kernel/troubleshoot.c+18−12
@@ -18,6 +18,8 @@ · 17 unmodified lines
1818 #include <asm/arcregs.h>
1919 #include <asm/irqflags.h>
2020
21+#define ARC_PATH_MAX 256
22+
2123 /*
2224 * Common routine to print scratch regs (r0-r12) or callee regs (r13-r25)
2325 * -Prints 3 regs per line and a CR.
@@ -58,11 +60,12 @@ static void show_callee_regs(struct callee_regs *cregs) · 34 unmodified lines
5860 print_reg_file(&(cregs->r13), 13);
5961 }
6062
61−static void print_task_path_n_nm(struct task_struct *tsk, char *buf)
63+static void print_task_path_n_nm(struct task_struct *tsk)
6264 {
6365 char *path_nm = NULL;
6466 struct mm_struct *mm;
6567 struct file *exe_file;
68+ char buf[ARC_PATH_MAX];
6669
6770 mm = get_task_mm(tsk);
6871 if (!mm)
@@ -72,7 +75,7 @@ static void print_task_path_n_nm(struct task_struct *tsk, char *buf) · 3 unmodified lines
7275 mmput(mm);
7376
7477 if (exe_file) {
75− path_nm = file_path(exe_file, buf, 255);
78+ path_nm = file_path(exe_file, buf, ARC_PATH_MAX-1);
7679 fput(exe_file);
7780 }
7881
@@ -80,10 +83,9 @@ done: · 1 unmodified line
8083 pr_info("Path: %s\n", !IS_ERR(path_nm) ? path_nm : "?");
8184 }
8285
83−static void show_faulting_vma(unsigned long address, char *buf)
86+static void show_faulting_vma(unsigned long address)
8487 {
8588 struct vm_area_struct *vma;
86− char *nm = buf;
8789 struct mm_struct *active_mm = current->active_mm;
8890
8991 /* can't use print_vma_addr() yet as it doesn't check for
@@ -96,8 +98,11 @@ static void show_faulting_vma(unsigned long address, char *buf) · 6 unmodified lines
9698 * if the container VMA is not found
9799 */
98100 if (vma && (vma->vm_start <= address)) {
101+ char buf[ARC_PATH_MAX];
102+ char *nm = "?";
103+
99104 if (vma->vm_file) {
100− nm = file_path(vma->vm_file, buf, PAGE_SIZE - 1);
105+ nm = file_path(vma->vm_file, buf, ARC_PATH_MAX-1);
101106 if (IS_ERR(nm))
102107 nm = "?";
103108 }
@@ -173,13 +178,14 @@ void show_regs(struct pt_regs *regs) · 69 unmodified lines
173178 {
174179 struct task_struct *tsk = current;
175180 struct callee_regs *cregs;
176− char *buf;
177181
178− buf = (char *)__get_free_page(GFP_KERNEL);
179− if (!buf)
180− return;
182+ /*
183+ * generic code calls us with preemption disabled, but some calls
184+ * here could sleep, so re-enable to avoid lockdep splat
185+ */
186+ preempt_enable();
181187
182− print_task_path_n_nm(tsk, buf);
188+ print_task_path_n_nm(tsk);
183189 show_regs_print_info(KERN_INFO);
184190
185191 show_ecr_verbose(regs);
@@ -189,7 +195,7 @@ void show_regs(struct pt_regs *regs) · 3 unmodified lines
189195 (void *)regs->blink, (void *)regs->ret);
190196
191197 if (user_mode(regs))
192− show_faulting_vma(regs->ret, buf); /* faulting code, not data */
198+ show_faulting_vma(regs->ret); /* faulting code, not data */
193199
194200 pr_info("[STAT32]: 0x%08lx", regs->status32);
195201
@@ -222,7 +228,7 @@ void show_regs(struct pt_regs *regs) · 26 unmodified lines
222228 if (cregs)
223229 show_callee_regs(cregs);
224230
225− free_page((unsigned long)buf);
231+ preempt_disable();
226232 }
227233
228234 void show_kernel_fault_diag(const char *str, struct pt_regs *regs,
arch/arc/lib/memset-archs.S+32−8
@@ -7,11 +7,39 @@ · 6 unmodified lines
77 */
88
99 #include <linux/linkage.h>
10+#include <asm/cache.h>
1011
11−#undef PREALLOC_NOT_AVAIL
12+/*
13+ * The memset implementation below is optimized to use prefetchw and prealloc
14+ * instruction in case of CPU with 64B L1 data cache line (L1_CACHE_SHIFT == 6)
15+ * If you want to implement optimized memset for other possible L1 data cache
16+ * line lengths (32B and 128B) you should rewrite code carefully checking
17+ * we don't call any prefetchw/prealloc instruction for L1 cache lines which
18+ * don't belongs to memset area.
19+ */
20+
21+#if L1_CACHE_SHIFT == 6
22+
23+.macro PREALLOC_INSTR reg, off
24+ prealloc [\reg, \off]
25+.endm
26+
27+.macro PREFETCHW_INSTR reg, off
28+ prefetchw [\reg, \off]
29+.endm
30+
31+#else
32+
33+.macro PREALLOC_INSTR
34+.endm
35+
36+.macro PREFETCHW_INSTR
37+.endm
38+
39+#endif
1240
1341 ENTRY_CFI(memset)
14− prefetchw [r0] ; Prefetch the write location
42+ PREFETCHW_INSTR r0, 0 ; Prefetch the first write location
1543 mov.f 0, r2
1644 ;;; if size is zero
1745 jz.d [blink]
@@ -48,11 +76,8 @@ ENTRY_CFI(memset) · 30 unmodified lines
4876
4977 lpnz @.Lset64bytes
5078 ;; LOOP START
51−#ifdef PREALLOC_NOT_AVAIL
52− prefetchw [r3, 64] ;Prefetch the next write location
53−#else
54− prealloc [r3, 64]
55−#endif
79+ PREALLOC_INSTR r3, 64 ; alloc next line w/o fetching
80+
5681 #ifdef CONFIG_ARC_HAS_LL64
5782 std.ab r4, [r3, 8]
5883 std.ab r4, [r3, 8]
@@ -85,7 +110,6 @@ ENTRY_CFI(memset) · 26 unmodified lines
85110 lsr.f lp_count, r2, 5 ;Last remaining max 124 bytes
86111 lpnz .Lset32bytes
87112 ;; LOOP START
88− prefetchw [r3, 32] ;Prefetch the next write location
89113 #ifdef CONFIG_ARC_HAS_LL64
90114 std.ab r4, [r3, 8]
91115 std.ab r4, [r3, 8]
arch/arc/mm/fault.c+9−4
@@ -141,12 +141,17 @@ good_area: · 140 unmodified lines
141141 */
142142 fault = handle_mm_fault(vma, address, flags);
143143
144− /* If Pagefault was interrupted by SIGKILL, exit page fault "early" */
145144 if (fatal_signal_pending(current)) {
146− if ((fault & VM_FAULT_ERROR) && !(fault & VM_FAULT_RETRY))
147− up_read(&mm->mmap_sem);
148− if (user_mode(regs))
145+
146+ /*
147+ * if fault retry, mmap_sem already relinquished by core mm
148+ * so OK to return to user mode (with signal handled first)
149+ */
150+ if (fault & VM_FAULT_RETRY) {
151+ if (!user_mode(regs))
152+ goto no_context;
149153 return;
154+ }
150155 }
151156
152157 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
arch/arc/mm/init.c+2−1
@@ -119,7 +119,8 @@ void __init setup_arch_memory(void) · 118 unmodified lines
119119 */
120120
121121 memblock_add_node(low_mem_start, low_mem_sz, 0);
122− memblock_reserve(low_mem_start, __pa(_end) - low_mem_start);
122+ memblock_reserve(CONFIG_LINUX_LINK_BASE,
123+ __pa(_end) - CONFIG_LINUX_LINK_BASE);
123124
124125 #ifdef CONFIG_BLK_DEV_INITRD
125126 if (phys_initrd_size) {
arch/arm/boot/dts/am335x-shc.dts+1−1
@@ -215,7 +215,7 @@ · 214 unmodified lines
215215 pinctrl-names = "default";
216216 pinctrl-0 = <&mmc1_pins>;
217217 bus-width = <0x4>;
218− cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
218+ cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
219219 cd-inverted;
220220 max-frequency = <26000000>;
221221 vmmc-supply = <&vmmcsd_fixed>;
arch/arm/boot/dts/da850-evm.dts+26−5
@@ -94,6 +94,28 @@ · 93 unmodified lines
9494 regulator-boot-on;
9595 };
9696
97+ baseboard_3v3: fixedregulator-3v3 {
98+ /* TPS73701DCQ */
99+ compatible = "regulator-fixed";
100+ regulator-name = "baseboard_3v3";
101+ regulator-min-microvolt = <3300000>;
102+ regulator-max-microvolt = <3300000>;
103+ vin-supply = <&vbat>;
104+ regulator-always-on;
105+ regulator-boot-on;
106+ };
107+
108+ baseboard_1v8: fixedregulator-1v8 {
109+ /* TPS73701DCQ */
110+ compatible = "regulator-fixed";
111+ regulator-name = "baseboard_1v8";
112+ regulator-min-microvolt = <1800000>;
113+ regulator-max-microvolt = <1800000>;
114+ vin-supply = <&vbat>;
115+ regulator-always-on;
116+ regulator-boot-on;
117+ };
118+
97119 backlight_lcd: backlight-regulator {
98120 compatible = "regulator-fixed";
99121 regulator-name = "lcd_backlight_pwr";
@@ -105,7 +127,7 @@ · 5 unmodified lines
105127
106128 sound {
107129 compatible = "simple-audio-card";
108− simple-audio-card,name = "DA850/OMAP-L138 EVM";
130+ simple-audio-card,name = "DA850-OMAPL138 EVM";
109131 simple-audio-card,widgets =
110132 "Line", "Line In",
111133 "Line", "Line Out";
@@ -210,10 +232,9 @@ · 98 unmodified lines
210232
211233 /* Regulators */
212234 IOVDD-supply = <&vdcdc2_reg>;
213− /* Derived from VBAT: Baseboard 3.3V / 1.8V */
214− AVDD-supply = <&vbat>;
215− DRVDD-supply = <&vbat>;
216− DVDD-supply = <&vbat>;
235+ AVDD-supply = <&baseboard_3v3>;
236+ DRVDD-supply = <&baseboard_3v3>;
237+ DVDD-supply = <&baseboard_1v8>;
217238 };
218239 tca6416: gpio@20 {
219240 compatible = "ti,tca6416";
arch/arm/boot/dts/da850-lcdk.dts+37−1
@@ -39,9 +39,39 @@ · 38 unmodified lines
3939 };
4040 };
4141
42+ vcc_5vd: fixedregulator-vcc_5vd {
43+ compatible = "regulator-fixed";
44+ regulator-name = "vcc_5vd";
45+ regulator-min-microvolt = <5000000>;
46+ regulator-max-microvolt = <5000000>;
47+ regulator-boot-on;
48+ };
49+
50+ vcc_3v3d: fixedregulator-vcc_3v3d {
51+ /* TPS650250 - VDCDC1 */
52+ compatible = "regulator-fixed";
53+ regulator-name = "vcc_3v3d";
54+ regulator-min-microvolt = <3300000>;
55+ regulator-max-microvolt = <3300000>;
56+ vin-supply = <&vcc_5vd>;
57+ regulator-always-on;
58+ regulator-boot-on;
59+ };
60+
61+ vcc_1v8d: fixedregulator-vcc_1v8d {
62+ /* TPS650250 - VDCDC2 */
63+ compatible = "regulator-fixed";
64+ regulator-name = "vcc_1v8d";
65+ regulator-min-microvolt = <1800000>;
66+ regulator-max-microvolt = <1800000>;
67+ vin-supply = <&vcc_5vd>;
68+ regulator-always-on;
69+ regulator-boot-on;
70+ };
71+
4272 sound {
4373 compatible = "simple-audio-card";
44− simple-audio-card,name = "DA850/OMAP-L138 LCDK";
74+ simple-audio-card,name = "DA850-OMAPL138 LCDK";
4575 simple-audio-card,widgets =
4676 "Line", "Line In",
4777 "Line", "Line Out";
@@ -221,6 +251,12 @@ · 173 unmodified lines
221251 compatible = "ti,tlv320aic3106";
222252 reg = <0x18>;
223253 status = "okay";
254+
255+ /* Regulators */
256+ IOVDD-supply = <&vcc_3v3d>;
257+ AVDD-supply = <&vcc_3v3d>;
258+ DRVDD-supply = <&vcc_3v3d>;
259+ DVDD-supply = <&vcc_1v8d>;
224260 };
225261 };
226262
arch/arm/boot/dts/da850.dtsi+1−1
@@ -476,7 +476,7 @@ · 475 unmodified lines
476476 clocksource: timer@20000 {
477477 compatible = "ti,da830-timer";
478478 reg = <0x20000 0x1000>;
479− interrupts = <12>, <13>;
479+ interrupts = <21>, <22>;
480480 interrupt-names = "tint12", "tint34";
481481 clocks = <&pll0_auxclk>;
482482 };
arch/arm/boot/dts/imx6q-pistachio.dts+1−1
@@ -103,7 +103,7 @@ · 102 unmodified lines
103103 power {
104104 label = "Power Button";
105105 gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
106− gpio-key,wakeup;
106+ wakeup-source;
107107 linux,code = <KEY_POWER>;
108108 };
109109 };
arch/arm/boot/dts/imx6sll-evk.dts+1−1
@@ -309,7 +309,7 @@ · 308 unmodified lines
309309 pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
310310 cd-gpios = <&gpio3 22 GPIO_ACTIVE_LOW>;
311311 keep-power-in-suspend;
312− enable-sdio-wakeup;
312+ wakeup-source;
313313 vmmc-supply = <&reg_sd3_vmmc>;
314314 status = "okay";
315315 };
arch/arm/boot/dts/imx6sx.dtsi+1−1
@@ -467,7 +467,7 @@ · 466 unmodified lines
467467 };
468468
469469 gpt: gpt@2098000 {
470− compatible = "fsl,imx6sx-gpt", "fsl,imx31-gpt";
470+ compatible = "fsl,imx6sx-gpt", "fsl,imx6dl-gpt";
471471 reg = <0x02098000 0x4000>;
472472 interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
473473 clocks = <&clks IMX6SX_CLK_GPT_BUS>,
arch/arm/boot/dts/kirkwood-dnskw.dtsi+2−2
@@ -36,8 +36,8 @@ · 35 unmodified lines
3636 compatible = "gpio-fan";
3737 pinctrl-0 = <&pmx_fan_high_speed &pmx_fan_low_speed>;
3838 pinctrl-names = "default";
39− gpios = <&gpio1 14 GPIO_ACTIVE_LOW
40− &gpio1 13 GPIO_ACTIVE_LOW>;
39+ gpios = <&gpio1 14 GPIO_ACTIVE_HIGH
40+ &gpio1 13 GPIO_ACTIVE_HIGH>;
4141 gpio-fan,speed-map = <0 0
4242 3000 1
4343 6000 2>;
arch/arm/boot/dts/meson.dtsi+1−1
@@ -274,7 +274,7 @@ · 273 unmodified lines
274274 compatible = "amlogic,meson6-dwmac", "snps,dwmac";
275275 reg = <0xc9410000 0x10000
276276 0xc1108108 0x4>;
277− interrupts = <GIC_SPI 8 IRQ_TYPE_EDGE_RISING>;
277+ interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
278278 interrupt-names = "macirq";
279279 status = "disabled";
280280 };
arch/arm/boot/dts/meson8b-ec100.dts+1−2
@@ -205,8 +205,7 @@ · 204 unmodified lines
205205 cap-sd-highspeed;
206206 disable-wp;
207207
208− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
209− cd-inverted;
208+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
210209
211210 vmmc-supply = <&vcc_3v3>;
212211 };
arch/arm/boot/dts/meson8b-odroidc1.dts+1−3
@@ -221,7 +221,6 @@ · 220 unmodified lines
221221 /* Realtek RTL8211F (0x001cc916) */
222222 eth_phy: ethernet-phy@0 {
223223 reg = <0>;
224− eee-broken-1000t;
225224 interrupt-parent = <&gpio_intc>;
226225 /* GPIOH_3 */
227226 interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
@@ -273,8 +272,7 @@ · 45 unmodified lines
273272 cap-sd-highspeed;
274273 disable-wp;
275274
276− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
277− cd-inverted;
275+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
278276
279277 vmmc-supply = <&tflash_vdd>;
280278 vqmmc-supply = <&tf_io>;
arch/arm/boot/dts/meson8m2-mxiii-plus.dts+1−2
@@ -206,8 +206,7 @@ · 205 unmodified lines
206206 cap-sd-highspeed;
207207 disable-wp;
208208
209− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
210− cd-inverted;
209+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
211210
212211 vmmc-supply = <&vcc_3v3>;
213212 };
arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi+1−1
@@ -105,7 +105,7 @@ · 104 unmodified lines
105105 interrupts-extended = <
106106 &cpcap 15 0 &cpcap 14 0 &cpcap 28 0 &cpcap 19 0
107107 &cpcap 18 0 &cpcap 17 0 &cpcap 16 0 &cpcap 49 0
108− &cpcap 48 1
108+ &cpcap 48 0
109109 >;
110110 interrupt-names =
111111 "id_ground", "id_float", "se0conn", "vbusvld",
arch/arm/boot/dts/omap3-gta04.dtsi+0−4
@@ -714,11 +714,7 @@ · 713 unmodified lines
714714
715715 vdda-supply = <&vdac>;
716716
717− #address-cells = <1>;
718− #size-cells = <0>;
719−
720717 port {
721− reg = <0>;
722718 venc_out: endpoint {
723719 remote-endpoint = <&opa_in>;
724720 ti,channels = <1>;
arch/arm/boot/dts/omap3-n900.dts+1−1
@@ -814,7 +814,7 @@ · 813 unmodified lines
814814 /* For debugging, it is often good idea to remove this GPIO.
815815 It means you can remove back cover (to reboot by removing
816816 battery) and still use the MMC card. */
817− cd-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>; /* 160 */
817+ cd-gpios = <&gpio6 0 GPIO_ACTIVE_LOW>; /* 160 */
818818 };
819819
820820 /* most boards use vaux3, only some old versions use vmmc2 instead */
arch/arm/boot/dts/omap3-n950-n9.dtsi+28−14
@@ -370,6 +370,19 @@ · 369 unmodified lines
370370 compatible = "ti,omap2-onenand";
371371 reg = <0 0 0x20000>; /* CS0, offset 0, IO size 128K */
372372
373+ /*
374+ * These timings are based on CONFIG_OMAP_GPMC_DEBUG=y reported
375+ * bootloader set values when booted with v4.19 using both N950
376+ * and N9 devices (OneNAND Manufacturer: Samsung):
377+ *
378+ * gpmc cs0 before gpmc_cs_program_settings:
379+ * cs0 GPMC_CS_CONFIG1: 0xfd001202
380+ * cs0 GPMC_CS_CONFIG2: 0x00181800
381+ * cs0 GPMC_CS_CONFIG3: 0x00030300
382+ * cs0 GPMC_CS_CONFIG4: 0x18001804
383+ * cs0 GPMC_CS_CONFIG5: 0x03171d1d
384+ * cs0 GPMC_CS_CONFIG6: 0x97080000
385+ */
373386 gpmc,sync-read;
374387 gpmc,sync-write;
375388 gpmc,burst-length = <16>;
@@ -379,26 +392,27 @@ · 3 unmodified lines
379392 gpmc,device-width = <2>;
380393 gpmc,mux-add-data = <2>;
381394 gpmc,cs-on-ns = <0>;
382− gpmc,cs-rd-off-ns = <87>;
383− gpmc,cs-wr-off-ns = <87>;
395+ gpmc,cs-rd-off-ns = <122>;
396+ gpmc,cs-wr-off-ns = <122>;
384397 gpmc,adv-on-ns = <0>;
385− gpmc,adv-rd-off-ns = <10>;
386− gpmc,adv-wr-off-ns = <10>;
387− gpmc,oe-on-ns = <15>;
388− gpmc,oe-off-ns = <87>;
398+ gpmc,adv-rd-off-ns = <15>;
399+ gpmc,adv-wr-off-ns = <15>;
400+ gpmc,oe-on-ns = <20>;
401+ gpmc,oe-off-ns = <122>;
389402 gpmc,we-on-ns = <0>;
390− gpmc,we-off-ns = <87>;
391− gpmc,rd-cycle-ns = <112>;
392− gpmc,wr-cycle-ns = <112>;
393− gpmc,access-ns = <81>;
403+ gpmc,we-off-ns = <122>;
404+ gpmc,rd-cycle-ns = <148>;
405+ gpmc,wr-cycle-ns = <148>;
406+ gpmc,access-ns = <117>;
394407 gpmc,page-burst-access-ns = <15>;
395408 gpmc,bus-turnaround-ns = <0>;
396409 gpmc,cycle2cycle-delay-ns = <0>;
397410 gpmc,wait-monitoring-ns = <0>;
398− gpmc,clk-activation-ns = <5>;
399− gpmc,wr-data-mux-bus-ns = <30>;
400− gpmc,wr-access-ns = <81>;
401− gpmc,sync-clk-ps = <15000>;
411+ gpmc,clk-activation-ns = <10>;
412+ gpmc,wr-data-mux-bus-ns = <40>;
413+ gpmc,wr-access-ns = <117>;
414+
415+ gpmc,sync-clk-ps = <15000>; /* TBC; Where this value came? */
402416
403417 /*
404418 * MTD partition table corresponding to Nokia's MeeGo 1.2
arch/arm/boot/dts/omap5-l4.dtsi+0−2
@@ -1046,8 +1046,6 @@ · 1045 unmodified lines
10461046 <SYSC_IDLE_SMART>,
10471047 <SYSC_IDLE_SMART_WKUP>;
10481048 ti,syss-mask = <1>;
1049− ti,no-reset-on-init;
1050− ti,no-idle-on-init;
10511049 /* Domains (V, P, C): core, core_pwrdm, l4per_clkdm */
10521050 clocks = <&l4per_clkctrl OMAP5_UART3_CLKCTRL 0>;
10531051 clock-names = "fck";
arch/arm/boot/dts/r8a7743.dtsi+30−6
@@ -1681,15 +1681,12 @@ · 1680 unmodified lines
16811681
16821682 du: display@feb00000 {
16831683 compatible = "renesas,du-r8a7743";
1684− reg = <0 0xfeb00000 0 0x40000>,
1685− <0 0xfeb90000 0 0x1c>;
1686− reg-names = "du", "lvds.0";
1684+ reg = <0 0xfeb00000 0 0x40000>;
16871685 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
16881686 <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>;
16891687 clocks = <&cpg CPG_MOD 724>,
1690− <&cpg CPG_MOD 723>,
1691− <&cpg CPG_MOD 726>;
1692− clock-names = "du.0", "du.1", "lvds.0";
1688+ <&cpg CPG_MOD 723>;
1689+ clock-names = "du.0", "du.1";
16931690 status = "disabled";
16941691
16951692 ports {
@@ -1704,6 +1701,33 @@ · 8 unmodified lines
17041701 port@1 {
17051702 reg = <1>;
17061703 du_out_lvds0: endpoint {
1704+ remote-endpoint = <&lvds0_in>;
1705+ };
1706+ };
1707+ };
1708+ };
1709+
1710+ lvds0: lvds@feb90000 {
1711+ compatible = "renesas,r8a7743-lvds";
1712+ reg = <0 0xfeb90000 0 0x1c>;
1713+ clocks = <&cpg CPG_MOD 726>;
1714+ power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1715+ resets = <&cpg 726>;
1716+ status = "disabled";
1717+
1718+ ports {
1719+ #address-cells = <1>;
1720+ #size-cells = <0>;
1721+
1722+ port@0 {
1723+ reg = <0>;
1724+ lvds0_in: endpoint {
1725+ remote-endpoint = <&du_out_lvds0>;
1726+ };
1727+ };
1728+ port@1 {
1729+ reg = <1>;
1730+ lvds0_out: endpoint {
17071731 };
17081732 };
17091733 };
arch/arm/boot/dts/sun6i-a31.dtsi+1−0
@@ -216,6 +216,7 @@ · 215 unmodified lines
216216 #clock-cells = <0>;
217217 compatible = "fixed-clock";
218218 clock-frequency = <24000000>;
219+ clock-output-names = "osc24M";
219220 };
220221
221222 osc32k: clk-32k {
arch/arm/boot/dts/sun8i-h3-beelink-x2.dts+1−1
@@ -53,7 +53,7 @@ · 52 unmodified lines
5353
5454 aliases {
5555 serial0 = &uart0;
56− /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
56+ ethernet0 = &emac;
5757 ethernet1 = &sdiowifi;
5858 };
5959
arch/arm/boot/dts/vf610-bk4.dts+2−2
@@ -110,11 +110,11 @@ · 109 unmodified lines
110110 bus-num = <3>;
111111 status = "okay";
112112 spi-slave;
113+ #address-cells = <0>;
113114
114− slave@0 {
115+ slave {
115116 compatible = "lwn,bk4";
116117 spi-max-frequency = <30000000>;
117− reg = <0>;
118118 };
119119 };
120120
arch/arm/include/asm/xen/page-coherent.h+94−0
@@ -1 +1,95 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _ASM_ARM_XEN_PAGE_COHERENT_H
3+#define _ASM_ARM_XEN_PAGE_COHERENT_H
4+
5+#include <linux/dma-mapping.h>
6+#include <asm/page.h>
17 #include <xen/arm/page-coherent.h>
8+
9+static inline const struct dma_map_ops *xen_get_dma_ops(struct device *dev)
10+{
11+ if (dev && dev->archdata.dev_dma_ops)
12+ return dev->archdata.dev_dma_ops;
13+ return get_arch_dma_ops(NULL);
14+}
15+
16+static inline void *xen_alloc_coherent_pages(struct device *hwdev, size_t size,
17+ dma_addr_t *dma_handle, gfp_t flags, unsigned long attrs)
18+{
19+ return xen_get_dma_ops(hwdev)->alloc(hwdev, size, dma_handle, flags, attrs);
20+}
21+
22+static inline void xen_free_coherent_pages(struct device *hwdev, size_t size,
23+ void *cpu_addr, dma_addr_t dma_handle, unsigned long attrs)
24+{
25+ xen_get_dma_ops(hwdev)->free(hwdev, size, cpu_addr, dma_handle, attrs);
26+}
27+
28+static inline void xen_dma_map_page(struct device *hwdev, struct page *page,
29+ dma_addr_t dev_addr, unsigned long offset, size_t size,
30+ enum dma_data_direction dir, unsigned long attrs)
31+{
32+ unsigned long page_pfn = page_to_xen_pfn(page);
33+ unsigned long dev_pfn = XEN_PFN_DOWN(dev_addr);
34+ unsigned long compound_pages =
35+ (1<<compound_order(page)) * XEN_PFN_PER_PAGE;
36+ bool local = (page_pfn <= dev_pfn) &&
37+ (dev_pfn - page_pfn < compound_pages);
38+
39+ /*
40+ * Dom0 is mapped 1:1, while the Linux page can span across
41+ * multiple Xen pages, it's not possible for it to contain a
42+ * mix of local and foreign Xen pages. So if the first xen_pfn
43+ * == mfn the page is local otherwise it's a foreign page
44+ * grant-mapped in dom0. If the page is local we can safely
45+ * call the native dma_ops function, otherwise we call the xen
46+ * specific function.
47+ */
48+ if (local)
49+ xen_get_dma_ops(hwdev)->map_page(hwdev, page, offset, size, dir, attrs);
50+ else
51+ __xen_dma_map_page(hwdev, page, dev_addr, offset, size, dir, attrs);
52+}
53+
54+static inline void xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle,
55+ size_t size, enum dma_data_direction dir, unsigned long attrs)
56+{
57+ unsigned long pfn = PFN_DOWN(handle);
58+ /*
59+ * Dom0 is mapped 1:1, while the Linux page can be spanned accross
60+ * multiple Xen page, it's not possible to have a mix of local and
61+ * foreign Xen page. Dom0 is mapped 1:1, so calling pfn_valid on a
62+ * foreign mfn will always return false. If the page is local we can
63+ * safely call the native dma_ops function, otherwise we call the xen
64+ * specific function.
65+ */
66+ if (pfn_valid(pfn)) {
67+ if (xen_get_dma_ops(hwdev)->unmap_page)
68+ xen_get_dma_ops(hwdev)->unmap_page(hwdev, handle, size, dir, attrs);
69+ } else
70+ __xen_dma_unmap_page(hwdev, handle, size, dir, attrs);
71+}
72+
73+static inline void xen_dma_sync_single_for_cpu(struct device *hwdev,
74+ dma_addr_t handle, size_t size, enum dma_data_direction dir)
75+{
76+ unsigned long pfn = PFN_DOWN(handle);
77+ if (pfn_valid(pfn)) {
78+ if (xen_get_dma_ops(hwdev)->sync_single_for_cpu)
79+ xen_get_dma_ops(hwdev)->sync_single_for_cpu(hwdev, handle, size, dir);
80+ } else
81+ __xen_dma_sync_single_for_cpu(hwdev, handle, size, dir);
82+}
83+
84+static inline void xen_dma_sync_single_for_device(struct device *hwdev,
85+ dma_addr_t handle, size_t size, enum dma_data_direction dir)
86+{
87+ unsigned long pfn = PFN_DOWN(handle);
88+ if (pfn_valid(pfn)) {
89+ if (xen_get_dma_ops(hwdev)->sync_single_for_device)
90+ xen_get_dma_ops(hwdev)->sync_single_for_device(hwdev, handle, size, dir);
91+ } else
92+ __xen_dma_sync_single_for_device(hwdev, handle, size, dir);
93+}
94+
95+#endif /* _ASM_ARM_XEN_PAGE_COHERENT_H */
arch/arm/mach-cns3xxx/pcie.c+2−2
@@ -83,7 +83,7 @@ static void __iomem *cns3xxx_pci_map_bus(struct pci_bus *bus, · 82 unmodified lines
8383 } else /* remote PCI bus */
8484 base = cnspci->cfg1_regs + ((busno & 0xf) << 20);
8585
86− return base + (where & 0xffc) + (devfn << 12);
86+ return base + where + (devfn << 12);
8787 }
8888
8989 static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
@@ -93,7 +93,7 @@ static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn, · 3 unmodified lines
9393 u32 mask = (0x1ull << (size * 8)) - 1;
9494 int shift = (where % 4) * 8;
9595
96− ret = pci_generic_config_read32(bus, devfn, where, size, val);
96+ ret = pci_generic_config_read(bus, devfn, where, size, val);
9797
9898 if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn &&
9999 (where & 0xffc) == PCI_CLASS_REVISION)
arch/arm/mach-davinci/board-da830-evm.c+2−2
@@ -208,9 +208,9 @@ static struct gpiod_lookup_table mmc_gpios_table = { · 207 unmodified lines
208208 .dev_id = "da830-mmc.0",
209209 .table = {
210210 /* gpio chip 1 contains gpio range 32-63 */
211− GPIO_LOOKUP("davinci_gpio.0", DA830_MMCSD_CD_PIN, "cd",
211+ GPIO_LOOKUP("davinci_gpio", DA830_MMCSD_CD_PIN, "cd",
212212 GPIO_ACTIVE_LOW),
213− GPIO_LOOKUP("davinci_gpio.0", DA830_MMCSD_WP_PIN, "wp",
213+ GPIO_LOOKUP("davinci_gpio", DA830_MMCSD_WP_PIN, "wp",
214214 GPIO_ACTIVE_LOW),
215215 },
216216 };
arch/arm/mach-davinci/board-da850-evm.c+2−2
@@ -805,9 +805,9 @@ static struct gpiod_lookup_table mmc_gpios_table = { · 804 unmodified lines
805805 .dev_id = "da830-mmc.0",
806806 .table = {
807807 /* gpio chip 2 contains gpio range 64-95 */
808− GPIO_LOOKUP("davinci_gpio.0", DA850_MMCSD_CD_PIN, "cd",
808+ GPIO_LOOKUP("davinci_gpio", DA850_MMCSD_CD_PIN, "cd",
809809 GPIO_ACTIVE_LOW),
810− GPIO_LOOKUP("davinci_gpio.0", DA850_MMCSD_WP_PIN, "wp",
810+ GPIO_LOOKUP("davinci_gpio", DA850_MMCSD_WP_PIN, "wp",
811811 GPIO_ACTIVE_HIGH),
812812 },
813813 };
arch/arm/mach-davinci/board-dm355-evm.c+2−2
@@ -117,9 +117,9 @@ static struct platform_device davinci_nand_device = { · 116 unmodified lines
117117 static struct gpiod_lookup_table i2c_recovery_gpiod_table = {
118118 .dev_id = "i2c_davinci.1",
119119 .table = {
120− GPIO_LOOKUP("davinci_gpio.0", DM355_I2C_SDA_PIN, "sda",
120+ GPIO_LOOKUP("davinci_gpio", DM355_I2C_SDA_PIN, "sda",
121121 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
122− GPIO_LOOKUP("davinci_gpio.0", DM355_I2C_SCL_PIN, "scl",
122+ GPIO_LOOKUP("davinci_gpio", DM355_I2C_SCL_PIN, "scl",
123123 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
124124 },
125125 };
arch/arm/mach-davinci/board-dm644x-evm.c+2−2
@@ -660,9 +660,9 @@ static struct i2c_board_info __initdata i2c_info[] = { · 659 unmodified lines
660660 static struct gpiod_lookup_table i2c_recovery_gpiod_table = {
661661 .dev_id = "i2c_davinci.1",
662662 .table = {
663− GPIO_LOOKUP("davinci_gpio.0", DM644X_I2C_SDA_PIN, "sda",
663+ GPIO_LOOKUP("davinci_gpio", DM644X_I2C_SDA_PIN, "sda",
664664 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
665− GPIO_LOOKUP("davinci_gpio.0", DM644X_I2C_SCL_PIN, "scl",
665+ GPIO_LOOKUP("davinci_gpio", DM644X_I2C_SCL_PIN, "scl",
666666 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
667667 },
668668 };
arch/arm/mach-davinci/board-omapl138-hawk.c+2−2
@@ -134,9 +134,9 @@ static const short hawk_mmcsd0_pins[] = { · 133 unmodified lines
134134 static struct gpiod_lookup_table mmc_gpios_table = {
135135 .dev_id = "da830-mmc.0",
136136 .table = {
137− GPIO_LOOKUP("davinci_gpio.0", DA850_HAWK_MMCSD_CD_PIN, "cd",
137+ GPIO_LOOKUP("davinci_gpio", DA850_HAWK_MMCSD_CD_PIN, "cd",
138138 GPIO_ACTIVE_LOW),
139− GPIO_LOOKUP("davinci_gpio.0", DA850_HAWK_MMCSD_WP_PIN, "wp",
139+ GPIO_LOOKUP("davinci_gpio", DA850_HAWK_MMCSD_WP_PIN, "wp",
140140 GPIO_ACTIVE_LOW),
141141 },
142142 };
arch/arm/mach-integrator/impd1.c+6−2
@@ -390,10 +390,14 @@ static int __ref impd1_probe(struct lm_device *dev) · 389 unmodified lines
390390 char *mmciname;
391391
392392 lookup = devm_kzalloc(&dev->dev,
393− sizeof(*lookup) + 3 * sizeof(struct gpiod_lookup),
393+ struct_size(lookup, table, 3),
394394 GFP_KERNEL);
395395 chipname = devm_kstrdup(&dev->dev, devname, GFP_KERNEL);
396− mmciname = kasprintf(GFP_KERNEL, "lm%x:00700", dev->id);
396+ mmciname = devm_kasprintf(&dev->dev, GFP_KERNEL,
397+ "lm%x:00700", dev->id);
398+ if (!lookup || !chipname || !mmciname)
399+ return -ENOMEM;
400+
397401 lookup->dev_id = mmciname;
398402 /*
399403 * Offsets on GPIO block 1:
arch/arm/mach-iop32x/n2100.c+1−2
@@ -75,8 +75,7 @@ void __init n2100_map_io(void) · 74 unmodified lines
7575 /*
7676 * N2100 PCI.
7777 */
78−static int __init
79−n2100_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
78+static int n2100_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
8079 {
8180 int irq;
8281
arch/arm/mach-socfpga/socfpga.c+4−0
@@ -32,6 +32,8 @@ void __iomem *rst_manager_base_addr; · 31 unmodified lines
3232 void __iomem *sdr_ctl_base_addr;
3333 unsigned long socfpga_cpu1start_addr;
3434
35+extern void __init socfpga_reset_init(void);
36+
3537 static void __init socfpga_sysmgr_init(void)
3638 {
3739 struct device_node *np;
@@ -64,6 +66,7 @@ static void __init socfpga_init_irq(void) · 26 unmodified lines
6466
6567 if (IS_ENABLED(CONFIG_EDAC_ALTERA_OCRAM))
6668 socfpga_init_ocram_ecc();
69+ socfpga_reset_init();
6770 }
6871
6972 static void __init socfpga_arria10_init_irq(void)
@@ -74,6 +77,7 @@ static void __init socfpga_arria10_init_irq(void) · 4 unmodified lines
7477 socfpga_init_arria10_l2_ecc();
7578 if (IS_ENABLED(CONFIG_EDAC_ALTERA_OCRAM))
7679 socfpga_init_arria10_ocram_ecc();
80+ socfpga_reset_init();
7781 }
7882
7983 static void socfpga_cyclone5_restart(enum reboot_mode mode, const char *cmd)
arch/arm/mach-tango/pm.c+2−4
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 #include <linux/suspend.h>
44 #include <asm/suspend.h>
55 #include "smc.h"
6+#include "pm.h"
67
78 static int tango_pm_powerdown(unsigned long arg)
89 {
@@ -24,10 +25,7 @@ static const struct platform_suspend_ops tango_pm_ops = { · 15 unmodified lines
2425 .valid = suspend_valid_only_mem,
2526 };
2627
27−static int __init tango_pm_init(void)
28+void __init tango_pm_init(void)
2829 {
2930 suspend_set_ops(&tango_pm_ops);
30− return 0;
3131 }
32−
33−late_initcall(tango_pm_init);
arch/arm/mach-tango/pm.h+7−0
@@ -0,0 +1,7 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+
3+#ifdef CONFIG_SUSPEND
4+void __init tango_pm_init(void);
5+#else
6+#define tango_pm_init NULL
7+#endif
arch/arm/mach-tango/setup.c+2−0
@@ -2,6 +2,7 @@ · 1 unmodified line
22 #include <asm/mach/arch.h>
33 #include <asm/hardware/cache-l2x0.h>
44 #include "smc.h"
5+#include "pm.h"
56
67 static void tango_l2c_write(unsigned long val, unsigned int reg)
78 {
@@ -15,4 +16,5 @@ DT_MACHINE_START(TANGO_DT, "Sigma Tango DT") · 7 unmodified lines
1516 .dt_compat = tango_dt_compat,
1617 .l2c_aux_mask = ~0,
1718 .l2c_write_sec = tango_l2c_write,
19+ .init_late = tango_pm_init,
1820 MACHINE_END
arch/arm/plat-pxa/ssp.c+0−3
@@ -190,8 +190,6 @@ static int pxa_ssp_remove(struct platform_device *pdev) · 189 unmodified lines
190190 if (ssp == NULL)
191191 return -ENODEV;
192192
193− iounmap(ssp->mmio_base);
194−
195193 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
196194 release_mem_region(res->start, resource_size(res));
197195
@@ -201,7 +199,6 @@ static int pxa_ssp_remove(struct platform_device *pdev) · 3 unmodified lines
201199 list_del(&ssp->node);
202200 mutex_unlock(&ssp_lock);
203201
204− kfree(ssp);
205202 return 0;
206203 }
207204
arch/arm/xen/mm.c+0−1
@@ -7,7 +7,6 @@ · 6 unmodified lines
77 #include <linux/of_address.h>
88 #include <linux/slab.h>
99 #include <linux/types.h>
10−#include <linux/dma-mapping.h>
1110 #include <linux/vmalloc.h>
1211 #include <linux/swiotlb.h>
1312
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts+1−0
@@ -188,6 +188,7 @@ · 187 unmodified lines
188188 reg = <0x3a3>;
189189 interrupt-parent = <&r_intc>;
190190 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
191+ x-powers,drive-vbus-en; /* set N_VBUSEN as output pin */
191192 };
192193 };
193194
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi+1−1
@@ -390,7 +390,7 @@ · 389 unmodified lines
390390 };
391391
392392 video-codec@1c0e000 {
393− compatible = "allwinner,sun50i-h5-video-engine";
393+ compatible = "allwinner,sun50i-a64-video-engine";
394394 reg = <0x01c0e000 0x1000>;
395395 clocks = <&ccu CLK_BUS_VE>, <&ccu CLK_VE>,
396396 <&ccu CLK_DRAM_VE>;
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi+1−2
@@ -187,8 +187,7 @@ · 186 unmodified lines
187187 max-frequency = <100000000>;
188188 disable-wp;
189189
190− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
191− cd-inverted;
190+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
192191
193192 vmmc-supply = <&vddao_3v3>;
194193 vqmmc-supply = <&vddio_boot>;
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts+1−2
@@ -305,8 +305,7 @@ · 304 unmodified lines
305305 max-frequency = <200000000>;
306306 disable-wp;
307307
308− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
309− cd-inverted;
308+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
310309
311310 vmmc-supply = <&vddio_ao3v3>;
312311 vqmmc-supply = <&vddio_tf>;
arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts+1−2
@@ -238,8 +238,7 @@ · 237 unmodified lines
238238 max-frequency = <100000000>;
239239 disable-wp;
240240
241− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
242− cd-inverted;
241+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
243242
244243 vmmc-supply = <&vddao_3v3>;
245244 vqmmc-supply = <&vddio_card>;
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts+1−2
@@ -258,8 +258,7 @@ · 257 unmodified lines
258258 max-frequency = <100000000>;
259259 disable-wp;
260260
261− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
262− cd-inverted;
261+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
263262
264263 vmmc-supply = <&tflash_vdd>;
265264 vqmmc-supply = <&tf_io>;
arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi+1−2
@@ -196,8 +196,7 @@ · 195 unmodified lines
196196 max-frequency = <100000000>;
197197 disable-wp;
198198
199− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
200− cd-inverted;
199+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
201200
202201 vmmc-supply = <&vddao_3v3>;
203202 vqmmc-supply = <&vddio_card>;
arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi+1−2
@@ -154,8 +154,7 @@ · 153 unmodified lines
154154 max-frequency = <100000000>;
155155 disable-wp;
156156
157− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
158− cd-inverted;
157+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
159158
160159 vmmc-supply = <&vcc_3v3>;
161160 };
arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi+1−2
@@ -211,8 +211,7 @@ · 210 unmodified lines
211211 max-frequency = <100000000>;
212212 disable-wp;
213213
214− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
215− cd-inverted;
214+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
216215
217216 vmmc-supply = <&vddao_3v3>;
218217 vqmmc-supply = <&vcc_3v3>;
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts+1−2
@@ -131,8 +131,7 @@ · 130 unmodified lines
131131 max-frequency = <100000000>;
132132 disable-wp;
133133
134− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
135− cd-inverted;
134+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
136135
137136 vmmc-supply = <&vddao_3v3>;
138137 vqmmc-supply = <&vddio_card>;
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts+1−2
@@ -238,8 +238,7 @@ · 237 unmodified lines
238238 max-frequency = <100000000>;
239239 disable-wp;
240240
241− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
242− cd-inverted;
241+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
243242
244243 vmmc-supply = <&vcc_3v3>;
245244 vqmmc-supply = <&vcc_card>;
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts+1−2
@@ -183,8 +183,7 @@ · 182 unmodified lines
183183 max-frequency = <100000000>;
184184 disable-wp;
185185
186− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
187− cd-inverted;
186+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
188187
189188 vmmc-supply = <&vddao_3v3>;
190189 vqmmc-supply = <&vddio_card>;
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi+1−2
@@ -137,8 +137,7 @@ · 136 unmodified lines
137137 max-frequency = <100000000>;
138138 disable-wp;
139139
140− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
141− cd-inverted;
140+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
142141
143142 vmmc-supply = <&vddao_3v3>;
144143 vqmmc-supply = <&vddio_boot>;
arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts+1−2
@@ -356,8 +356,7 @@ · 355 unmodified lines
356356 max-frequency = <100000000>;
357357 disable-wp;
358358
359− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
360− cd-inverted;
359+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
361360
362361 vmmc-supply = <&vddao_3v3>;
363362 vqmmc-supply = <&vddio_boot>;
arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts+1−2
@@ -147,8 +147,7 @@ · 146 unmodified lines
147147 max-frequency = <100000000>;
148148 disable-wp;
149149
150− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
151− cd-inverted;
150+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
152151
153152 vmmc-supply = <&vddao_3v3>;
154153 vqmmc-supply = <&vddio_boot>;
arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts+1−2
@@ -170,8 +170,7 @@ · 169 unmodified lines
170170 max-frequency = <100000000>;
171171 disable-wp;
172172
173− cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
174− cd-inverted;
173+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
175174
176175 vmmc-supply = <&vddao_3v3>;
177176 vqmmc-supply = <&vddio_boot>;
arch/arm64/boot/dts/marvell/armada-8040-mcbin.dtsi+1−1
@@ -183,7 +183,7 @@ · 182 unmodified lines
183183 pinctrl-0 = <&cp0_pcie_pins>;
184184 num-lanes = <4>;
185185 num-viewport = <8>;
186− reset-gpio = <&cp0_gpio1 20 GPIO_ACTIVE_LOW>;
186+ reset-gpios = <&cp0_gpio2 20 GPIO_ACTIVE_LOW>;
187187 status = "okay";
188188 };
189189
arch/arm64/boot/dts/marvell/armada-ap806.dtsi+17−0
@@ -28,6 +28,23 @@ · 27 unmodified lines
2828 method = "smc";
2929 };
3030
31+ reserved-memory {
32+ #address-cells = <2>;
33+ #size-cells = <2>;
34+ ranges;
35+
36+ /*
37+ * This area matches the mapping done with a
38+ * mainline U-Boot, and should be updated by the
39+ * bootloader.
40+ */
41+
42+ psci-area@4000000 {
43+ reg = <0x0 0x4000000 0x0 0x200000>;
44+ no-map;
45+ };
46+ };
47+
3148 ap806 {
3249 #address-cells = <2>;
3350 #size-cells = <2>;
arch/arm64/boot/dts/qcom/msm8996.dtsi+1−1
@@ -404,7 +404,7 @@ · 403 unmodified lines
404404 };
405405
406406 intc: interrupt-controller@9bc0000 {
407− compatible = "arm,gic-v3";
407+ compatible = "qcom,msm8996-gic-v3", "arm,gic-v3";
408408 #interrupt-cells = <3>;
409409 interrupt-controller;
410410 #redistributor-regions = <1>;
arch/arm64/boot/dts/renesas/r8a774a1.dtsi+3−0
@@ -1011,6 +1011,9 @@ · 1010 unmodified lines
10111011 <&cpg CPG_CORE R8A774A1_CLK_S3D1>,
10121012 <&scif_clk>;
10131013 clock-names = "fck", "brg_int", "scif_clk";
1014+ dmas = <&dmac1 0x13>, <&dmac1 0x12>,
1015+ <&dmac2 0x13>, <&dmac2 0x12>;
1016+ dma-names = "tx", "rx", "tx", "rx";
10141017 power-domains = <&sysc R8A774A1_PD_ALWAYS_ON>;
10151018 resets = <&cpg 310>;
10161019 status = "disabled";
arch/arm64/boot/dts/renesas/r8a7796.dtsi+3−0
@@ -1262,6 +1262,9 @@ · 1261 unmodified lines
12621262 <&cpg CPG_CORE R8A7796_CLK_S3D1>,
12631263 <&scif_clk>;
12641264 clock-names = "fck", "brg_int", "scif_clk";
1265+ dmas = <&dmac1 0x13>, <&dmac1 0x12>,
1266+ <&dmac2 0x13>, <&dmac2 0x12>;
1267+ dma-names = "tx", "rx", "tx", "rx";
12651268 power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
12661269 resets = <&cpg 310>;
12671270 status = "disabled";
arch/arm64/boot/dts/renesas/r8a77965.dtsi+3−0
@@ -1068,6 +1068,9 @@ · 1067 unmodified lines
10681068 <&cpg CPG_CORE R8A77965_CLK_S3D1>,
10691069 <&scif_clk>;
10701070 clock-names = "fck", "brg_int", "scif_clk";
1071+ dmas = <&dmac1 0x13>, <&dmac1 0x12>,
1072+ <&dmac2 0x13>, <&dmac2 0x12>;
1073+ dma-names = "tx", "rx", "tx", "rx";
10711074 power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
10721075 resets = <&cpg 310>;
10731076 status = "disabled";
arch/arm64/configs/defconfig+4−0
@@ -506,11 +506,15 @@ CONFIG_SND_SOC_ROCKCHIP=m · 505 unmodified lines
506506 CONFIG_SND_SOC_ROCKCHIP_SPDIF=m
507507 CONFIG_SND_SOC_ROCKCHIP_RT5645=m
508508 CONFIG_SND_SOC_RK3399_GRU_SOUND=m
509+CONFIG_SND_MESON_AXG_SOUND_CARD=m
509510 CONFIG_SND_SOC_SAMSUNG=y
510511 CONFIG_SND_SOC_RCAR=m
511512 CONFIG_SND_SOC_AK4613=m
512513 CONFIG_SND_SIMPLE_CARD=m
513514 CONFIG_SND_AUDIO_GRAPH_CARD=m
515+CONFIG_SND_SOC_ES7134=m
516+CONFIG_SND_SOC_ES7241=m
517+CONFIG_SND_SOC_TAS571X=m
514518 CONFIG_I2C_HID=m
515519 CONFIG_USB=y
516520 CONFIG_USB_OTG=y
arch/arm64/include/asm/asm-prototypes.h+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 #ifndef __ASM_PROTOTYPES_H
33 #define __ASM_PROTOTYPES_H
44 /*
5− * CONFIG_MODEVERIONS requires a C declaration to generate the appropriate CRC
5+ * CONFIG_MODVERSIONS requires a C declaration to generate the appropriate CRC
66 * for each symbol. Since commit:
77 *
88 * 4efca4ed05cbdfd1 ("kbuild: modversions for EXPORT_SYMBOL() for asm")
arch/arm64/include/asm/cache.h+4−0
@@ -58,6 +58,10 @@ · 57 unmodified lines
5858 */
5959 #define ARCH_DMA_MINALIGN (128)
6060
61+#ifdef CONFIG_KASAN_SW_TAGS
62+#define ARCH_SLAB_MINALIGN (1ULL << KASAN_SHADOW_SCALE_SHIFT)
63+#endif
64+
6165 #ifndef __ASSEMBLY__
6266
6367 #include <linux/bitops.h>
arch/arm64/include/asm/device.h+0−3
@@ -20,9 +20,6 @@ struct dev_archdata { · 19 unmodified lines
2020 #ifdef CONFIG_IOMMU_API
2121 void *iommu; /* private IOMMU data */
2222 #endif
23−#ifdef CONFIG_XEN
24− const struct dma_map_ops *dev_dma_ops;
25−#endif
2623 };
2724
2825 struct pdev_archdata {
arch/arm64/include/asm/mmu.h+44−0
@@ -16,6 +16,8 @@ · 15 unmodified lines
1616 #ifndef __ASM_MMU_H
1717 #define __ASM_MMU_H
1818
19+#include <asm/cputype.h>
20+
1921 #define MMCF_AARCH32 0x1 /* mm context flag for AArch32 executables */
2022 #define USER_ASID_BIT 48
2123 #define USER_ASID_FLAG (UL(1) << USER_ASID_BIT)
@@ -44,6 +46,48 @@ static inline bool arm64_kernel_unmapped_at_el0(void) · 22 unmodified lines
4446 cpus_have_const_cap(ARM64_UNMAP_KERNEL_AT_EL0);
4547 }
4648
49+static inline bool arm64_kernel_use_ng_mappings(void)
50+{
51+ bool tx1_bug;
52+
53+ /* What's a kpti? Use global mappings if we don't know. */
54+ if (!IS_ENABLED(CONFIG_UNMAP_KERNEL_AT_EL0))
55+ return false;
56+
57+ /*
58+ * Note: this function is called before the CPU capabilities have
59+ * been configured, so our early mappings will be global. If we
60+ * later determine that kpti is required, then
61+ * kpti_install_ng_mappings() will make them non-global.
62+ */
63+ if (arm64_kernel_unmapped_at_el0())
64+ return true;
65+
66+ if (!IS_ENABLED(CONFIG_RANDOMIZE_BASE))
67+ return false;
68+
69+ /*
70+ * KASLR is enabled so we're going to be enabling kpti on non-broken
71+ * CPUs regardless of their susceptibility to Meltdown. Rather
72+ * than force everybody to go through the G -> nG dance later on,
73+ * just put down non-global mappings from the beginning.
74+ */
75+ if (!IS_ENABLED(CONFIG_CAVIUM_ERRATUM_27456)) {
76+ tx1_bug = false;
77+#ifndef MODULE
78+ } else if (!static_branch_likely(&arm64_const_caps_ready)) {
79+ extern const struct midr_range cavium_erratum_27456_cpus[];
80+
81+ tx1_bug = is_midr_in_range_list(read_cpuid_id(),
82+ cavium_erratum_27456_cpus);
83+#endif
84+ } else {
85+ tx1_bug = __cpus_have_const_cap(ARM64_WORKAROUND_CAVIUM_27456);
86+ }
87+
88+ return !tx1_bug && kaslr_offset() > 0;
89+}
90+
4791 typedef void (*bp_hardening_cb_t)(void);
4892
4993 struct bp_hardening_data {
arch/arm64/include/asm/pgtable-prot.h+2−2
@@ -37,8 +37,8 @@ · 36 unmodified lines
3737 #define _PROT_DEFAULT (PTE_TYPE_PAGE | PTE_AF | PTE_SHARED)
3838 #define _PROT_SECT_DEFAULT (PMD_TYPE_SECT | PMD_SECT_AF | PMD_SECT_S)
3939
40−#define PTE_MAYBE_NG (arm64_kernel_unmapped_at_el0() ? PTE_NG : 0)
41−#define PMD_MAYBE_NG (arm64_kernel_unmapped_at_el0() ? PMD_SECT_NG : 0)
40+#define PTE_MAYBE_NG (arm64_kernel_use_ng_mappings() ? PTE_NG : 0)
41+#define PMD_MAYBE_NG (arm64_kernel_use_ng_mappings() ? PMD_SECT_NG : 0)
4242
4343 #define PROT_DEFAULT (_PROT_DEFAULT | PTE_MAYBE_NG)
4444 #define PROT_SECT_DEFAULT (_PROT_SECT_DEFAULT | PMD_MAYBE_NG)
arch/arm64/include/asm/xen/page-coherent.h+76−0
@@ -1 +1,77 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _ASM_ARM64_XEN_PAGE_COHERENT_H
3+#define _ASM_ARM64_XEN_PAGE_COHERENT_H
4+
5+#include <linux/dma-mapping.h>
6+#include <asm/page.h>
17 #include <xen/arm/page-coherent.h>
8+
9+static inline void *xen_alloc_coherent_pages(struct device *hwdev, size_t size,
10+ dma_addr_t *dma_handle, gfp_t flags, unsigned long attrs)
11+{
12+ return dma_direct_alloc(hwdev, size, dma_handle, flags, attrs);
13+}
14+
15+static inline void xen_free_coherent_pages(struct device *hwdev, size_t size,
16+ void *cpu_addr, dma_addr_t dma_handle, unsigned long attrs)
17+{
18+ dma_direct_free(hwdev, size, cpu_addr, dma_handle, attrs);
19+}
20+
21+static inline void xen_dma_sync_single_for_cpu(struct device *hwdev,
22+ dma_addr_t handle, size_t size, enum dma_data_direction dir)
23+{
24+ unsigned long pfn = PFN_DOWN(handle);
25+
26+ if (pfn_valid(pfn))
27+ dma_direct_sync_single_for_cpu(hwdev, handle, size, dir);
28+ else
29+ __xen_dma_sync_single_for_cpu(hwdev, handle, size, dir);
30+}
31+
32+static inline void xen_dma_sync_single_for_device(struct device *hwdev,
33+ dma_addr_t handle, size_t size, enum dma_data_direction dir)
34+{
35+ unsigned long pfn = PFN_DOWN(handle);
36+ if (pfn_valid(pfn))
37+ dma_direct_sync_single_for_device(hwdev, handle, size, dir);
38+ else
39+ __xen_dma_sync_single_for_device(hwdev, handle, size, dir);
40+}
41+
42+static inline void xen_dma_map_page(struct device *hwdev, struct page *page,
43+ dma_addr_t dev_addr, unsigned long offset, size_t size,
44+ enum dma_data_direction dir, unsigned long attrs)
45+{
46+ unsigned long page_pfn = page_to_xen_pfn(page);
47+ unsigned long dev_pfn = XEN_PFN_DOWN(dev_addr);
48+ unsigned long compound_pages =
49+ (1<<compound_order(page)) * XEN_PFN_PER_PAGE;
50+ bool local = (page_pfn <= dev_pfn) &&
51+ (dev_pfn - page_pfn < compound_pages);
52+
53+ if (local)
54+ dma_direct_map_page(hwdev, page, offset, size, dir, attrs);
55+ else
56+ __xen_dma_map_page(hwdev, page, dev_addr, offset, size, dir, attrs);
57+}
58+
59+static inline void xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle,
60+ size_t size, enum dma_data_direction dir, unsigned long attrs)
61+{
62+ unsigned long pfn = PFN_DOWN(handle);
63+ /*
64+ * Dom0 is mapped 1:1, while the Linux page can be spanned accross
65+ * multiple Xen page, it's not possible to have a mix of local and
66+ * foreign Xen page. Dom0 is mapped 1:1, so calling pfn_valid on a
67+ * foreign mfn will always return false. If the page is local we can
68+ * safely call the native dma_ops function, otherwise we call the xen
69+ * specific function.
70+ */
71+ if (pfn_valid(pfn))
72+ dma_direct_unmap_page(hwdev, handle, size, dir, attrs);
73+ else
74+ __xen_dma_unmap_page(hwdev, handle, size, dir, attrs);
75+}
76+
77+#endif /* _ASM_ARM64_XEN_PAGE_COHERENT_H */
arch/arm64/kernel/cpu_errata.c+1−1
@@ -553,7 +553,7 @@ static const struct midr_range arm64_repeat_tlbi_cpus[] = { · 552 unmodified lines
553553 #endif
554554
555555 #ifdef CONFIG_CAVIUM_ERRATUM_27456
556−static const struct midr_range cavium_erratum_27456_cpus[] = {
556+const struct midr_range cavium_erratum_27456_cpus[] = {
557557 /* Cavium ThunderX, T88 pass 1.x - 2.1 */
558558 MIDR_RANGE(MIDR_THUNDERX, 0, 0, 1, 1),
559559 /* Cavium ThunderX, T81 pass 1.0 */
arch/arm64/kernel/cpufeature.c+7−2
@@ -983,7 +983,7 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry, · 982 unmodified lines
983983
984984 /* Useful for KASLR robustness */
985985 if (IS_ENABLED(CONFIG_RANDOMIZE_BASE))
986− return true;
986+ return kaslr_offset() > 0;
987987
988988 /* Don't force KPTI for CPUs that are not vulnerable */
989989 if (is_midr_in_range_list(read_cpuid_id(), kpti_safe_list))
@@ -1003,7 +1003,12 @@ kpti_install_ng_mappings(const struct arm64_cpu_capabilities *__unused) · 13 unmodified lines
10031003 static bool kpti_applied = false;
10041004 int cpu = smp_processor_id();
10051005
1006− if (kpti_applied)
1006+ /*
1007+ * We don't need to rewrite the page-tables if either we've done
1008+ * it already or we have KASLR enabled and therefore have not
1009+ * created any global mappings at all.
1010+ */
1011+ if (kpti_applied || kaslr_offset() > 0)
10071012 return;
10081013
10091014 remap_fn = (void *)__pa_symbol(idmap_kpti_install_ng_mappings);
arch/arm64/kernel/head.S+1−0
@@ -475,6 +475,7 @@ ENDPROC(__primary_switched) · 474 unmodified lines
475475
476476 ENTRY(kimage_vaddr)
477477 .quad _text - TEXT_OFFSET
478+EXPORT_SYMBOL(kimage_vaddr)
478479
479480 /*
480481 * If we're fortunate enough to boot at EL2, ensure that the world is
arch/arm64/kernel/hibernate.c+3−1
@@ -299,8 +299,10 @@ int swsusp_arch_suspend(void) · 298 unmodified lines
299299 dcache_clean_range(__idmap_text_start, __idmap_text_end);
300300
301301 /* Clean kvm setup code to PoC? */
302− if (el2_reset_needed())
302+ if (el2_reset_needed()) {
303303 dcache_clean_range(__hyp_idmap_text_start, __hyp_idmap_text_end);
304+ dcache_clean_range(__hyp_text_start, __hyp_text_end);
305+ }
304306
305307 /* make the crash dump kernel image protected again */
306308 crash_post_resume();
arch/arm64/kernel/hyp-stub.S+2−0
@@ -28,6 +28,8 @@ · 27 unmodified lines
2828 #include <asm/virt.h>
2929
3030 .text
31+ .pushsection .hyp.text, "ax"
32+
3133 .align 11
3234
3335 ENTRY(__hyp_stub_vectors)
arch/arm64/kernel/kaslr.c+7−2
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <linux/sched.h>
1515 #include <linux/types.h>
1616
17+#include <asm/cacheflush.h>
1718 #include <asm/fixmap.h>
1819 #include <asm/kernel-pgtable.h>
1920 #include <asm/memory.h>
@@ -43,7 +44,7 @@ static __init u64 get_kaslr_seed(void *fdt) · 23 unmodified lines
4344 return ret;
4445 }
4546
46−static __init const u8 *get_cmdline(void *fdt)
47+static __init const u8 *kaslr_get_cmdline(void *fdt)
4748 {
4849 static __initconst const u8 default_cmdline[] = CONFIG_CMDLINE;
4950
@@ -87,6 +88,7 @@ u64 __init kaslr_early_init(u64 dt_phys) · 37 unmodified lines
8788 * we end up running with module randomization disabled.
8889 */
8990 module_alloc_base = (u64)_etext - MODULES_VSIZE;
91+ __flush_dcache_area(&module_alloc_base, sizeof(module_alloc_base));
9092
9193 /*
9294 * Try to map the FDT early. If this fails, we simply bail,
@@ -109,7 +111,7 @@ u64 __init kaslr_early_init(u64 dt_phys) · 16 unmodified lines
109111 * Check if 'nokaslr' appears on the command line, and
110112 * return 0 if that is the case.
111113 */
112− cmdline = get_cmdline(fdt);
114+ cmdline = kaslr_get_cmdline(fdt);
113115 str = strstr(cmdline, "nokaslr");
114116 if (str == cmdline || (str > cmdline && *(str - 1) == ' '))
115117 return 0;
@@ -169,5 +171,8 @@ u64 __init kaslr_early_init(u64 dt_phys) · 53 unmodified lines
169171 module_alloc_base += (module_range * (seed & ((1 << 21) - 1))) >> 21;
170172 module_alloc_base &= PAGE_MASK;
171173
174+ __flush_dcache_area(&module_alloc_base, sizeof(module_alloc_base));
175+ __flush_dcache_area(&memstart_offset_seed, sizeof(memstart_offset_seed));
176+
172177 return offset;
173178 }
arch/arm64/kernel/machine_kexec_file.c+6−2
@@ -87,7 +87,9 @@ static int setup_dtb(struct kimage *image, · 86 unmodified lines
8787
8888 /* add kaslr-seed */
8989 ret = fdt_delprop(dtb, off, FDT_PROP_KASLR_SEED);
90− if (ret && (ret != -FDT_ERR_NOTFOUND))
90+ if (ret == -FDT_ERR_NOTFOUND)
91+ ret = 0;
92+ else if (ret)
9193 goto out;
9294
9395 if (rng_is_initialized()) {
@@ -118,10 +120,12 @@ static int create_dtb(struct kimage *image, · 24 unmodified lines
118120 {
119121 void *buf;
120122 size_t buf_size;
123+ size_t cmdline_len;
121124 int ret;
122125
126+ cmdline_len = cmdline ? strlen(cmdline) : 0;
123127 buf_size = fdt_totalsize(initial_boot_params)
124− + strlen(cmdline) + DTB_EXTRA_SPACE;
128+ + cmdline_len + DTB_EXTRA_SPACE;
125129
126130 for (;;) {
127131 buf = vmalloc(buf_size);
arch/arm64/kernel/probes/kprobes.c+3−3
@@ -478,13 +478,13 @@ bool arch_within_kprobe_blacklist(unsigned long addr) · 477 unmodified lines
478478 addr < (unsigned long)__entry_text_end) ||
479479 (addr >= (unsigned long)__idmap_text_start &&
480480 addr < (unsigned long)__idmap_text_end) ||
481+ (addr >= (unsigned long)__hyp_text_start &&
482+ addr < (unsigned long)__hyp_text_end) ||
481483 !!search_exception_tables(addr))
482484 return true;
483485
484486 if (!is_kernel_in_hyp_mode()) {
485− if ((addr >= (unsigned long)__hyp_text_start &&
486− addr < (unsigned long)__hyp_text_end) ||
487− (addr >= (unsigned long)__hyp_idmap_text_start &&
487+ if ((addr >= (unsigned long)__hyp_idmap_text_start &&
488488 addr < (unsigned long)__hyp_idmap_text_end))
489489 return true;
490490 }
arch/arm64/mm/dma-mapping.c+1−3
@@ -466,9 +466,7 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, · 465 unmodified lines
466466 __iommu_setup_dma_ops(dev, dma_base, size, iommu);
467467
468468 #ifdef CONFIG_XEN
469− if (xen_initial_domain()) {
470− dev->archdata.dev_dma_ops = dev->dma_ops;
469+ if (xen_initial_domain())
471470 dev->dma_ops = xen_dma_ops;
472− }
473471 #endif
474472 }
arch/arm64/mm/dump.c+29−30
@@ -286,74 +286,73 @@ static void note_page(struct pg_state *st, unsigned long addr, unsigned level, · 285 unmodified lines
286286
287287 }
288288
289−static void walk_pte(struct pg_state *st, pmd_t *pmdp, unsigned long start)
289+static void walk_pte(struct pg_state *st, pmd_t *pmdp, unsigned long start,
290+ unsigned long end)
290291 {
291− pte_t *ptep = pte_offset_kernel(pmdp, 0UL);
292− unsigned long addr;
293− unsigned i;
292+ unsigned long addr = start;
293+ pte_t *ptep = pte_offset_kernel(pmdp, start);
294294
295− for (i = 0; i < PTRS_PER_PTE; i++, ptep++) {
296− addr = start + i * PAGE_SIZE;
295+ do {
297296 note_page(st, addr, 4, READ_ONCE(pte_val(*ptep)));
298− }
297+ } while (ptep++, addr += PAGE_SIZE, addr != end);
299298 }
300299
301−static void walk_pmd(struct pg_state *st, pud_t *pudp, unsigned long start)
300+static void walk_pmd(struct pg_state *st, pud_t *pudp, unsigned long start,
301+ unsigned long end)
302302 {
303− pmd_t *pmdp = pmd_offset(pudp, 0UL);
304− unsigned long addr;
305− unsigned i;
303+ unsigned long next, addr = start;
304+ pmd_t *pmdp = pmd_offset(pudp, start);
306305
307− for (i = 0; i < PTRS_PER_PMD; i++, pmdp++) {
306+ do {
308307 pmd_t pmd = READ_ONCE(*pmdp);
308+ next = pmd_addr_end(addr, end);
309309
310− addr = start + i * PMD_SIZE;
311310 if (pmd_none(pmd) || pmd_sect(pmd)) {
312311 note_page(st, addr, 3, pmd_val(pmd));
313312 } else {
314313 BUG_ON(pmd_bad(pmd));
315− walk_pte(st, pmdp, addr);
314+ walk_pte(st, pmdp, addr, next);
316315 }
317− }
316+ } while (pmdp++, addr = next, addr != end);
318317 }
319318
320−static void walk_pud(struct pg_state *st, pgd_t *pgdp, unsigned long start)
319+static void walk_pud(struct pg_state *st, pgd_t *pgdp, unsigned long start,
320+ unsigned long end)
321321 {
322− pud_t *pudp = pud_offset(pgdp, 0UL);
323− unsigned long addr;
324− unsigned i;
322+ unsigned long next, addr = start;
323+ pud_t *pudp = pud_offset(pgdp, start);
325324
326− for (i = 0; i < PTRS_PER_PUD; i++, pudp++) {
325+ do {
327326 pud_t pud = READ_ONCE(*pudp);
327+ next = pud_addr_end(addr, end);
328328
329− addr = start + i * PUD_SIZE;
330329 if (pud_none(pud) || pud_sect(pud)) {
331330 note_page(st, addr, 2, pud_val(pud));
332331 } else {
333332 BUG_ON(pud_bad(pud));
334− walk_pmd(st, pudp, addr);
333+ walk_pmd(st, pudp, addr, next);
335334 }
336− }
335+ } while (pudp++, addr = next, addr != end);
337336 }
338337
339338 static void walk_pgd(struct pg_state *st, struct mm_struct *mm,
340339 unsigned long start)
341340 {
342− pgd_t *pgdp = pgd_offset(mm, 0UL);
343− unsigned i;
344− unsigned long addr;
341+ unsigned long end = (start < TASK_SIZE_64) ? TASK_SIZE_64 : 0;
342+ unsigned long next, addr = start;
343+ pgd_t *pgdp = pgd_offset(mm, start);
345344
346− for (i = 0; i < PTRS_PER_PGD; i++, pgdp++) {
345+ do {
347346 pgd_t pgd = READ_ONCE(*pgdp);
347+ next = pgd_addr_end(addr, end);
348348
349− addr = start + i * PGDIR_SIZE;
350349 if (pgd_none(pgd)) {
351350 note_page(st, addr, 1, pgd_val(pgd));
352351 } else {
353352 BUG_ON(pgd_bad(pgd));
354− walk_pud(st, pgdp, addr);
353+ walk_pud(st, pgdp, addr, next);
355354 }
356− }
355+ } while (pgdp++, addr = next, addr != end);
357356 }
358357
359358 void ptdump_walk_pgd(struct seq_file *m, struct ptdump_info *info)
arch/arm64/mm/flush.c+5−1
@@ -33,7 +33,11 @@ void sync_icache_aliases(void *kaddr, unsigned long len) · 32 unmodified lines
3333 __clean_dcache_area_pou(kaddr, len);
3434 __flush_icache_all();
3535 } else {
36− flush_icache_range(addr, addr + len);
36+ /*
37+ * Don't issue kick_all_cpus_sync() after I-cache invalidation
38+ * for user mappings.
39+ */
40+ __flush_icache_range(addr, addr + len);
3741 }
3842 }
3943
arch/c6x/include/asm/Kbuild+1−0
@@ -30,6 +30,7 @@ generic-y += pgalloc.h · 29 unmodified lines
3030 generic-y += preempt.h
3131 generic-y += segment.h
3232 generic-y += serial.h
33+generic-y += shmparam.h
3334 generic-y += tlbflush.h
3435 generic-y += topology.h
3536 generic-y += trace_clock.h
arch/csky/include/asm/io.h+25−0
@@ -15,6 +15,31 @@ extern void iounmap(void *addr); · 14 unmodified lines
1515 extern int remap_area_pages(unsigned long address, phys_addr_t phys_addr,
1616 size_t size, unsigned long flags);
1717
18+/*
19+ * I/O memory access primitives. Reads are ordered relative to any
20+ * following Normal memory access. Writes are ordered relative to any prior
21+ * Normal memory access.
22+ *
23+ * For CACHEV1 (807, 810), store instruction could fast retire, so we need
24+ * another mb() to prevent st fast retire.
25+ *
26+ * For CACHEV2 (860), store instruction with PAGE_ATTR_NO_BUFFERABLE won't
27+ * fast retire.
28+ */
29+#define readb(c) ({ u8 __v = readb_relaxed(c); rmb(); __v; })
30+#define readw(c) ({ u16 __v = readw_relaxed(c); rmb(); __v; })
31+#define readl(c) ({ u32 __v = readl_relaxed(c); rmb(); __v; })
32+
33+#ifdef CONFIG_CPU_HAS_CACHEV2
34+#define writeb(v,c) ({ wmb(); writeb_relaxed((v),(c)); })
35+#define writew(v,c) ({ wmb(); writew_relaxed((v),(c)); })
36+#define writel(v,c) ({ wmb(); writel_relaxed((v),(c)); })
37+#else
38+#define writeb(v,c) ({ wmb(); writeb_relaxed((v),(c)); mb(); })
39+#define writew(v,c) ({ wmb(); writew_relaxed((v),(c)); mb(); })
40+#define writel(v,c) ({ wmb(); writel_relaxed((v),(c)); mb(); })
41+#endif
42+
1843 #define ioremap_nocache(phy, sz) ioremap(phy, sz)
1944 #define ioremap_wc ioremap_nocache
2045 #define ioremap_wt ioremap_nocache
arch/csky/include/asm/pgalloc.h+18−25
@@ -24,41 +24,34 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, · 23 unmodified lines
2424
2525 extern void pgd_init(unsigned long *p);
2626
27−static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
28− unsigned long address)
27+static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
2928 {
3029 pte_t *pte;
31− unsigned long *kaddr, i;
30+ unsigned long i;
3231
33− pte = (pte_t *) __get_free_pages(GFP_KERNEL | __GFP_RETRY_MAYFAIL,
34− PTE_ORDER);
35− kaddr = (unsigned long *)pte;
36− if (address & 0x80000000)
37− for (i = 0; i < (PAGE_SIZE/4); i++)
38− *(kaddr + i) = 0x1;
39− else
40− clear_page(kaddr);
32+ pte = (pte_t *) __get_free_page(GFP_KERNEL);
33+ if (!pte)
34+ return NULL;
35+
36+ for (i = 0; i < PAGE_SIZE/sizeof(pte_t); i++)
37+ (pte + i)->pte_low = _PAGE_GLOBAL;
4138
4239 return pte;
4340 }
4441
45−static inline struct page *pte_alloc_one(struct mm_struct *mm,
46− unsigned long address)
42+static inline struct page *pte_alloc_one(struct mm_struct *mm)
4743 {
4844 struct page *pte;
49− unsigned long *kaddr, i;
50−
51− pte = alloc_pages(GFP_KERNEL | __GFP_RETRY_MAYFAIL, PTE_ORDER);
52− if (pte) {
53− kaddr = kmap_atomic(pte);
54− if (address & 0x80000000) {
55− for (i = 0; i < (PAGE_SIZE/4); i++)
56− *(kaddr + i) = 0x1;
57− } else
58− clear_page(kaddr);
59− kunmap_atomic(kaddr);
60− pgtable_page_ctor(pte);
45+
46+ pte = alloc_pages(GFP_KERNEL | __GFP_ZERO, 0);
47+ if (!pte)
48+ return NULL;
49+
50+ if (!pgtable_page_ctor(pte)) {
51+ __free_page(pte);
52+ return NULL;
6153 }
54+
6255 return pte;
6356 }
6457
arch/csky/kernel/module.c+22−16
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 #include <linux/spinlock.h>
1313 #include <asm/pgtable.h>
1414
15−#if defined(__CSKYABIV2__)
15+#ifdef CONFIG_CPU_CK810
1616 #define IS_BSR32(hi16, lo16) (((hi16) & 0xFC00) == 0xE000)
1717 #define IS_JSRI32(hi16, lo16) ((hi16) == 0xEAE0)
1818
@@ -25,6 +25,26 @@ · 6 unmodified lines
2525 *(uint16_t *)(addr) = 0xE8Fa; \
2626 *((uint16_t *)(addr) + 1) = 0x0000; \
2727 } while (0)
28+
29+static void jsri_2_lrw_jsr(uint32_t *location)
30+{
31+ uint16_t *location_tmp = (uint16_t *)location;
32+
33+ if (IS_BSR32(*location_tmp, *(location_tmp + 1)))
34+ return;
35+
36+ if (IS_JSRI32(*location_tmp, *(location_tmp + 1))) {
37+ /* jsri 0x... --> lrw r26, 0x... */
38+ CHANGE_JSRI_TO_LRW(location);
39+ /* lsli r0, r0 --> jsr r26 */
40+ SET_JSR32_R26(location + 1);
41+ }
42+}
43+#else
44+static void inline jsri_2_lrw_jsr(uint32_t *location)
45+{
46+ return;
47+}
2848 #endif
2949
3050 int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
@@ -35,9 +55,6 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, · 4 unmodified lines
3555 Elf32_Sym *sym;
3656 uint32_t *location;
3757 short *temp;
38−#if defined(__CSKYABIV2__)
39− uint16_t *location_tmp;
40−#endif
4158
4259 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
4360 /* This is where to make the change */
@@ -59,18 +76,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, · 15 unmodified lines
5976 case R_CSKY_PCRELJSR_IMM11BY2:
6077 break;
6178 case R_CSKY_PCRELJSR_IMM26BY2:
62−#if defined(__CSKYABIV2__)
63− location_tmp = (uint16_t *)location;
64− if (IS_BSR32(*location_tmp, *(location_tmp + 1)))
65− break;
66−
67− if (IS_JSRI32(*location_tmp, *(location_tmp + 1))) {
68− /* jsri 0x... --> lrw r26, 0x... */
69− CHANGE_JSRI_TO_LRW(location);
70− /* lsli r0, r0 --> jsr r26 */
71− SET_JSR32_R26(location + 1);
72− }
73−#endif
79+ jsri_2_lrw_jsr(location);
7480 break;
7581 case R_CSKY_ADDR_HI16:
7682 temp = ((short *)location) + 1;
arch/h8300/Makefile+0−2
@@ -37,8 +37,6 @@ libs-y += arch/$(ARCH)/lib/ · 36 unmodified lines
3737
3838 boot := arch/h8300/boot
3939
40−archmrproper:
41−
4240 archclean:
4341 $(Q)$(MAKE) $(clean)=$(boot)
4442
arch/h8300/include/asm/Kbuild+1−0
@@ -40,6 +40,7 @@ generic-y += preempt.h · 39 unmodified lines
4040 generic-y += scatterlist.h
4141 generic-y += sections.h
4242 generic-y += serial.h
43+generic-y += shmparam.h
4344 generic-y += sizes.h
4445 generic-y += spinlock.h
4546 generic-y += timex.h
arch/hexagon/include/asm/Kbuild+1−0
@@ -30,6 +30,7 @@ generic-y += rwsem.h · 29 unmodified lines
3030 generic-y += sections.h
3131 generic-y += segment.h
3232 generic-y += serial.h
33+generic-y += shmparam.h
3334 generic-y += sizes.h
3435 generic-y += topology.h
3536 generic-y += trace_clock.h
arch/ia64/Makefile+0−2
@@ -16,8 +16,6 @@ KBUILD_DEFCONFIG := generic_defconfig · 15 unmodified lines
1616 NM := $(CROSS_COMPILE)nm -B
1717 READELF := $(CROSS_COMPILE)readelf
1818
19−export AWK
20−
2119 CHECKFLAGS += -D__ia64=1 -D__ia64__=1 -D_LP64 -D__LP64__
2220
2321 OBJCOPYFLAGS := --strip-all
arch/m68k/emu/nfblock.c+7−3
@@ -155,18 +155,22 @@ out: · 154 unmodified lines
155155 static int __init nfhd_init(void)
156156 {
157157 u32 blocks, bsize;
158+ int ret;
158159 int i;
159160
160161 nfhd_id = nf_get_id("XHDI");
161162 if (!nfhd_id)
162163 return -ENODEV;
163164
164− major_num = register_blkdev(major_num, "nfhd");
165− if (major_num <= 0) {
165+ ret = register_blkdev(major_num, "nfhd");
166+ if (ret < 0) {
166167 pr_warn("nfhd: unable to get major number\n");
167− return major_num;
168+ return ret;
168169 }
169170
171+ if (!major_num)
172+ major_num = ret;
173+
170174 for (i = NFHD_DEV_OFFSET; i < 24; i++) {
171175 if (nfhd_get_capacity(i, 0, &blocks, &bsize))
172176 continue;
arch/m68k/include/asm/Kbuild+1−0
@@ -20,6 +20,7 @@ generic-y += mm-arch-hooks.h · 19 unmodified lines
2020 generic-y += percpu.h
2121 generic-y += preempt.h
2222 generic-y += sections.h
23+generic-y += shmparam.h
2324 generic-y += spinlock.h
2425 generic-y += topology.h
2526 generic-y += trace_clock.h
arch/microblaze/include/asm/Kbuild+1−0
@@ -26,6 +26,7 @@ generic-y += parport.h · 25 unmodified lines
2626 generic-y += percpu.h
2727 generic-y += preempt.h
2828 generic-y += serial.h
29+generic-y += shmparam.h
2930 generic-y += syscalls.h
3031 generic-y += topology.h
3132 generic-y += trace_clock.h
arch/mips/Kconfig+16−0
@@ -1403,6 +1403,21 @@ config LOONGSON3_ENHANCEMENT · 1402 unmodified lines
14031403 please say 'N' here. If you want a high-performance kernel to run on
14041404 new Loongson 3 machines only, please say 'Y' here.
14051405
1406+config CPU_LOONGSON3_WORKAROUNDS
1407+ bool "Old Loongson 3 LLSC Workarounds"
1408+ default y if SMP
1409+ depends on CPU_LOONGSON3
1410+ help
1411+ Loongson 3 processors have the llsc issues which require workarounds.
1412+ Without workarounds the system may hang unexpectedly.
1413+
1414+ Newer Loongson 3 will fix these issues and no workarounds are needed.
1415+ The workarounds have no significant side effect on them but may
1416+ decrease the performance of the system so this option should be
1417+ disabled unless the kernel is intended to be run on old systems.
1418+
1419+ If unsure, please say Y.
1420+
14061421 config CPU_LOONGSON2E
14071422 bool "Loongson 2E"
14081423 depends on SYS_HAS_CPU_LOONGSON2E
@@ -3155,6 +3170,7 @@ config MIPS32_O32 · 1746 unmodified lines
31553170 config MIPS32_N32
31563171 bool "Kernel support for n32 binaries"
31573172 depends on 64BIT
3173+ select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
31583174 select COMPAT
31593175 select MIPS32_COMPAT
31603176 select SYSVIPC_COMPAT if SYSVIPC
arch/mips/bcm47xx/setup.c+31−0
@@ -173,6 +173,31 @@ void __init plat_mem_setup(void) · 172 unmodified lines
173173 pm_power_off = bcm47xx_machine_halt;
174174 }
175175
176+#ifdef CONFIG_BCM47XX_BCMA
177+static struct device * __init bcm47xx_setup_device(void)
178+{
179+ struct device *dev;
180+ int err;
181+
182+ dev = kzalloc(sizeof(*dev), GFP_KERNEL);
183+ if (!dev)
184+ return NULL;
185+
186+ err = dev_set_name(dev, "bcm47xx_soc");
187+ if (err) {
188+ pr_err("Failed to set SoC device name: %d\n", err);
189+ kfree(dev);
190+ return NULL;
191+ }
192+
193+ err = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
194+ if (err)
195+ pr_err("Failed to set SoC DMA mask: %d\n", err);
196+
197+ return dev;
198+}
199+#endif
200+
176201 /*
177202 * This finishes bus initialization doing things that were not possible without
178203 * kmalloc. Make sure to call it late enough (after mm_init).
@@ -183,6 +208,10 @@ void __init bcm47xx_bus_setup(void) · 4 unmodified lines
183208 if (bcm47xx_bus_type == BCM47XX_BUS_TYPE_BCMA) {
184209 int err;
185210
211+ bcm47xx_bus.bcma.dev = bcm47xx_setup_device();
212+ if (!bcm47xx_bus.bcma.dev)
213+ panic("Failed to setup SoC device\n");
214+
186215 err = bcma_host_soc_init(&bcm47xx_bus.bcma);
187216 if (err)
188217 panic("Failed to initialize BCMA bus (err %d)", err);
@@ -235,6 +264,8 @@ static int __init bcm47xx_register_bus_complete(void) · 46 unmodified lines
235264 #endif
236265 #ifdef CONFIG_BCM47XX_BCMA
237266 case BCM47XX_BUS_TYPE_BCMA:
267+ if (device_register(bcm47xx_bus.bcma.dev))
268+ pr_err("Failed to register SoC device\n");
238269 bcma_bus_register(&bcm47xx_bus.bcma.bus);
239270 break;
240271 #endif
arch/mips/boot/dts/ingenic/ci20.dts+4−4
@@ -76,7 +76,7 @@ · 75 unmodified lines
7676 status = "okay";
7777
7878 pinctrl-names = "default";
79− pinctrl-0 = <&pins_uart2>;
79+ pinctrl-0 = <&pins_uart3>;
8080 };
8181
8282 &uart4 {
@@ -196,9 +196,9 @@ · 113 unmodified lines
196196 bias-disable;
197197 };
198198
199− pins_uart2: uart2 {
200− function = "uart2";
201− groups = "uart2-data", "uart2-hwflow";
199+ pins_uart3: uart3 {
200+ function = "uart3";
201+ groups = "uart3-data", "uart3-hwflow";
202202 bias-disable;
203203 };
204204
arch/mips/boot/dts/ingenic/jz4740.dtsi+1−1
@@ -161,7 +161,7 @@ · 160 unmodified lines
161161 #dma-cells = <2>;
162162
163163 interrupt-parent = <&intc>;
164− interrupts = <29>;
164+ interrupts = <20>;
165165
166166 clocks = <&cgu JZ4740_CLK_DMA>;
167167
arch/mips/boot/dts/xilfpga/nexys4ddr.dts+4−4
@@ -90,11 +90,11 @@ · 89 unmodified lines
9090 interrupts = <0>;
9191 };
9292
93− axi_i2c: i2c@10A00000 {
93+ axi_i2c: i2c@10a00000 {
9494 compatible = "xlnx,xps-iic-2.00.a";
9595 interrupt-parent = <&axi_intc>;
9696 interrupts = <4>;
97− reg = < 0x10A00000 0x10000 >;
97+ reg = < 0x10a00000 0x10000 >;
9898 clocks = <&ext>;
9999 xlnx,clk-freq = <0x5f5e100>;
100100 xlnx,family = "Artix7";
@@ -106,9 +106,9 @@ · 5 unmodified lines
106106 #address-cells = <1>;
107107 #size-cells = <0>;
108108
109− ad7420@4B {
109+ ad7420@4b {
110110 compatible = "adi,adt7420";
111− reg = <0x4B>;
111+ reg = <0x4b>;
112112 };
113113 } ;
114114 };
arch/mips/cavium-octeon/setup.c+1−1
@@ -98,7 +98,7 @@ static void octeon_kexec_smp_down(void *ignored) · 97 unmodified lines
9898 " sync \n"
9999 " synci ($0) \n");
100100
101− relocated_kexec_smp_wait(NULL);
101+ kexec_reboot();
102102 }
103103 #endif
104104
arch/mips/configs/ath79_defconfig+1−0
@@ -66,6 +66,7 @@ CONFIG_SERIAL_8250_CONSOLE=y · 65 unmodified lines
6666 # CONFIG_SERIAL_8250_PCI is not set
6767 CONFIG_SERIAL_8250_NR_UARTS=1
6868 CONFIG_SERIAL_8250_RUNTIME_UARTS=1
69+CONFIG_SERIAL_OF_PLATFORM=y
6970 CONFIG_SERIAL_AR933X=y
7071 CONFIG_SERIAL_AR933X_CONSOLE=y
7172 # CONFIG_HW_RANDOM is not set
arch/mips/include/asm/atomic.h+6−0
@@ -58,6 +58,7 @@ static __inline__ void atomic_##op(int i, atomic_t * v) \ · 57 unmodified lines
5858 if (kernel_uses_llsc) { \
5959 int temp; \
6060 \
61+ loongson_llsc_mb(); \
6162 __asm__ __volatile__( \
6263 " .set push \n" \
6364 " .set "MIPS_ISA_LEVEL" \n" \
@@ -85,6 +86,7 @@ static __inline__ int atomic_##op##_return_relaxed(int i, atomic_t * v) \ · 21 unmodified lines
8586 if (kernel_uses_llsc) { \
8687 int temp; \
8788 \
89+ loongson_llsc_mb(); \
8890 __asm__ __volatile__( \
8991 " .set push \n" \
9092 " .set "MIPS_ISA_LEVEL" \n" \
@@ -118,6 +120,7 @@ static __inline__ int atomic_fetch_##op##_relaxed(int i, atomic_t * v) \ · 27 unmodified lines
118120 if (kernel_uses_llsc) { \
119121 int temp; \
120122 \
123+ loongson_llsc_mb(); \
121124 __asm__ __volatile__( \
122125 " .set push \n" \
123126 " .set "MIPS_ISA_LEVEL" \n" \
@@ -256,6 +259,7 @@ static __inline__ void atomic64_##op(long i, atomic64_t * v) \ · 132 unmodified lines
256259 if (kernel_uses_llsc) { \
257260 long temp; \
258261 \
262+ loongson_llsc_mb(); \
259263 __asm__ __volatile__( \
260264 " .set push \n" \
261265 " .set "MIPS_ISA_LEVEL" \n" \
@@ -283,6 +287,7 @@ static __inline__ long atomic64_##op##_return_relaxed(long i, atomic64_t * v) \ · 21 unmodified lines
283287 if (kernel_uses_llsc) { \
284288 long temp; \
285289 \
290+ loongson_llsc_mb(); \
286291 __asm__ __volatile__( \
287292 " .set push \n" \
288293 " .set "MIPS_ISA_LEVEL" \n" \
@@ -316,6 +321,7 @@ static __inline__ long atomic64_fetch_##op##_relaxed(long i, atomic64_t * v) \ · 27 unmodified lines
316321 if (kernel_uses_llsc) { \
317322 long temp; \
318323 \
324+ loongson_llsc_mb(); \
319325 __asm__ __volatile__( \
320326 " .set push \n" \
321327 " .set "MIPS_ISA_LEVEL" \n" \
arch/mips/include/asm/barrier.h+36−0
@@ -222,6 +222,42 @@ · 221 unmodified lines
222222 #define __smp_mb__before_atomic() __smp_mb__before_llsc()
223223 #define __smp_mb__after_atomic() smp_llsc_mb()
224224
225+/*
226+ * Some Loongson 3 CPUs have a bug wherein execution of a memory access (load,
227+ * store or pref) in between an ll & sc can cause the sc instruction to
228+ * erroneously succeed, breaking atomicity. Whilst it's unusual to write code
229+ * containing such sequences, this bug bites harder than we might otherwise
230+ * expect due to reordering & speculation:
231+ *
232+ * 1) A memory access appearing prior to the ll in program order may actually
233+ * be executed after the ll - this is the reordering case.
234+ *
235+ * In order to avoid this we need to place a memory barrier (ie. a sync
236+ * instruction) prior to every ll instruction, in between it & any earlier
237+ * memory access instructions. Many of these cases are already covered by
238+ * smp_mb__before_llsc() but for the remaining cases, typically ones in
239+ * which multiple CPUs may operate on a memory location but ordering is not
240+ * usually guaranteed, we use loongson_llsc_mb() below.
241+ *
242+ * This reordering case is fixed by 3A R2 CPUs, ie. 3A2000 models and later.
243+ *
244+ * 2) If a conditional branch exists between an ll & sc with a target outside
245+ * of the ll-sc loop, for example an exit upon value mismatch in cmpxchg()
246+ * or similar, then misprediction of the branch may allow speculative
247+ * execution of memory accesses from outside of the ll-sc loop.
248+ *
249+ * In order to avoid this we need a memory barrier (ie. a sync instruction)
250+ * at each affected branch target, for which we also use loongson_llsc_mb()
251+ * defined below.
252+ *
253+ * This case affects all current Loongson 3 CPUs.
254+ */
255+#ifdef CONFIG_CPU_LOONGSON3_WORKAROUNDS /* Loongson-3's LLSC workaround */
256+#define loongson_llsc_mb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
257+#else
258+#define loongson_llsc_mb() do { } while (0)
259+#endif
260+
225261 #include <asm-generic/barrier.h>
226262
227263 #endif /* __ASM_BARRIER_H */
arch/mips/include/asm/bitops.h+5−0
@@ -69,6 +69,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr) · 68 unmodified lines
6969 : "ir" (1UL << bit), GCC_OFF_SMALL_ASM() (*m));
7070 #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6)
7171 } else if (kernel_uses_llsc && __builtin_constant_p(bit)) {
72+ loongson_llsc_mb();
7273 do {
7374 __asm__ __volatile__(
7475 " " __LL "%0, %1 # set_bit \n"
@@ -79,6 +80,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr) · 4 unmodified lines
7980 } while (unlikely(!temp));
8081 #endif /* CONFIG_CPU_MIPSR2 || CONFIG_CPU_MIPSR6 */
8182 } else if (kernel_uses_llsc) {
83+ loongson_llsc_mb();
8284 do {
8385 __asm__ __volatile__(
8486 " .set push \n"
@@ -123,6 +125,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) · 38 unmodified lines
123125 : "ir" (~(1UL << bit)));
124126 #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6)
125127 } else if (kernel_uses_llsc && __builtin_constant_p(bit)) {
128+ loongson_llsc_mb();
126129 do {
127130 __asm__ __volatile__(
128131 " " __LL "%0, %1 # clear_bit \n"
@@ -133,6 +136,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) · 4 unmodified lines
133136 } while (unlikely(!temp));
134137 #endif /* CONFIG_CPU_MIPSR2 || CONFIG_CPU_MIPSR6 */
135138 } else if (kernel_uses_llsc) {
139+ loongson_llsc_mb();
136140 do {
137141 __asm__ __volatile__(
138142 " .set push \n"
@@ -193,6 +197,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr) · 54 unmodified lines
193197 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
194198 unsigned long temp;
195199
200+ loongson_llsc_mb();
196201 do {
197202 __asm__ __volatile__(
198203 " .set push \n"
arch/mips/include/asm/futex.h+3−0
@@ -50,6 +50,7 @@ · 49 unmodified lines
5050 "i" (-EFAULT) \
5151 : "memory"); \
5252 } else if (cpu_has_llsc) { \
53+ loongson_llsc_mb(); \
5354 __asm__ __volatile__( \
5455 " .set push \n" \
5556 " .set noat \n" \
@@ -163,6 +164,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, · 107 unmodified lines
163164 "i" (-EFAULT)
164165 : "memory");
165166 } else if (cpu_has_llsc) {
167+ loongson_llsc_mb();
166168 __asm__ __volatile__(
167169 "# futex_atomic_cmpxchg_inatomic \n"
168170 " .set push \n"
@@ -192,6 +194,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, · 23 unmodified lines
192194 : GCC_OFF_SMALL_ASM() (*uaddr), "Jr" (oldval), "Jr" (newval),
193195 "i" (-EFAULT)
194196 : "memory");
197+ loongson_llsc_mb();
195198 } else
196199 return -ENOSYS;
197200
arch/mips/include/asm/mach-lantiq/falcon/falcon_irq.h+0−2
@@ -18,8 +18,6 @@ · 17 unmodified lines
1818 #define INT_NUM_EXTRA_START (INT_NUM_IM4_IRL0 + 32)
1919 #define INT_NUM_IM_OFFSET (INT_NUM_IM1_IRL0 - INT_NUM_IM0_IRL0)
2020
21−#define MIPS_CPU_TIMER_IRQ 7
22−
2321 #define MAX_IM 5
2422
2523 #endif /* _FALCON_IRQ__ */
arch/mips/include/asm/mach-lantiq/xway/lantiq_irq.h+0−2
@@ -19,8 +19,6 @@ · 18 unmodified lines
1919
2020 #define LTQ_DMA_CH0_INT (INT_NUM_IM2_IRL0)
2121
22−#define MIPS_CPU_TIMER_IRQ 7
23−
2422 #define MAX_IM 5
2523
2624 #endif
arch/mips/include/asm/pgtable.h+2−0
@@ -228,6 +228,7 @@ static inline void set_pte(pte_t *ptep, pte_t pteval) · 227 unmodified lines
228228 : [buddy] "+m" (buddy->pte), [tmp] "=&r" (tmp)
229229 : [global] "r" (page_global));
230230 } else if (kernel_uses_llsc) {
231+ loongson_llsc_mb();
231232 __asm__ __volatile__ (
232233 " .set push \n"
233234 " .set "MIPS_ISA_ARCH_LEVEL" \n"
@@ -242,6 +243,7 @@ static inline void set_pte(pte_t *ptep, pte_t pteval) · 8 unmodified lines
242243 " .set pop \n"
243244 : [buddy] "+m" (buddy->pte), [tmp] "=&r" (tmp)
244245 : [global] "r" (page_global));
246+ loongson_llsc_mb();
245247 }
246248 #else /* !CONFIG_SMP */
247249 if (pte_none(*buddy))
arch/mips/jazz/jazzdma.c+3−2
@@ -74,14 +74,15 @@ static int __init vdma_init(void) · 73 unmodified lines
7474 get_order(VDMA_PGTBL_SIZE));
7575 BUG_ON(!pgtbl);
7676 dma_cache_wback_inv((unsigned long)pgtbl, VDMA_PGTBL_SIZE);
77− pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl);
77+ pgtbl = (VDMA_PGTBL_ENTRY *)CKSEG1ADDR((unsigned long)pgtbl);
7878
7979 /*
8080 * Clear the R4030 translation table
8181 */
8282 vdma_pgtbl_init();
8383
84− r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE, CPHYSADDR(pgtbl));
84+ r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE,
85+ CPHYSADDR((unsigned long)pgtbl));
8586 r4030_write_reg32(JAZZ_R4030_TRSTBL_LIM, VDMA_PGTBL_SIZE);
8687 r4030_write_reg32(JAZZ_R4030_TRSTBL_INV, 0);
8788
arch/mips/kernel/mips-cm.c+1−1
@@ -457,5 +457,5 @@ void mips_cm_error_report(void) · 456 unmodified lines
457457 }
458458
459459 /* reprime cause register */
460− write_gcr_error_cause(0);
460+ write_gcr_error_cause(cm_error);
461461 }
arch/mips/kernel/process.c+3−4
@@ -371,7 +371,7 @@ static inline int is_sp_move_ins(union mips_instruction *ip, int *frame_size) · 370 unmodified lines
371371 static int get_frame_info(struct mips_frame_info *info)
372372 {
373373 bool is_mmips = IS_ENABLED(CONFIG_CPU_MICROMIPS);
374− union mips_instruction insn, *ip, *ip_end;
374+ union mips_instruction insn, *ip;
375375 const unsigned int max_insns = 128;
376376 unsigned int last_insn_size = 0;
377377 unsigned int i;
@@ -384,10 +384,9 @@ static int get_frame_info(struct mips_frame_info *info) · 6 unmodified lines
384384 if (!ip)
385385 goto err;
386386
387− ip_end = (void *)ip + info->func_size;
388−
389− for (i = 0; i < max_insns && ip < ip_end; i++) {
387+ for (i = 0; i < max_insns; i++) {
390388 ip = (void *)ip + last_insn_size;
389+
391390 if (is_mmips && mm_insn_16bit(ip->halfword[0])) {
392391 insn.word = ip->halfword[0] << 16;
393392 last_insn_size = 2;
arch/mips/lantiq/irq.c+6−71
@@ -224,9 +224,11 @@ static struct irq_chip ltq_eiu_type = { · 223 unmodified lines
224224 .irq_set_type = ltq_eiu_settype,
225225 };
226226
227−static void ltq_hw_irqdispatch(int module)
227+static void ltq_hw_irq_handler(struct irq_desc *desc)
228228 {
229+ int module = irq_desc_get_irq(desc) - 2;
229230 u32 irq;
231+ int hwirq;
230232
231233 irq = ltq_icu_r32(module, LTQ_ICU_IM0_IOSR);
232234 if (irq == 0)
@@ -237,7 +239,8 @@ static void ltq_hw_irqdispatch(int module) · 4 unmodified lines
237239 * other bits might be bogus
238240 */
239241 irq = __fls(irq);
240− do_IRQ((int)irq + MIPS_CPU_IRQ_CASCADE + (INT_NUM_IM_OFFSET * module));
242+ hwirq = irq + MIPS_CPU_IRQ_CASCADE + (INT_NUM_IM_OFFSET * module);
243+ generic_handle_irq(irq_linear_revmap(ltq_domain, hwirq));
241244
242245 /* if this is a EBU irq, we need to ack it or get a deadlock */
243246 if ((irq == LTQ_ICU_EBU_IRQ) && (module == 0) && LTQ_EBU_PCC_ISTAT)
@@ -245,49 +248,6 @@ static void ltq_hw_irqdispatch(int module) · 1 unmodified line
245248 LTQ_EBU_PCC_ISTAT);
246249 }
247250
248−#define DEFINE_HWx_IRQDISPATCH(x) \
249− static void ltq_hw ## x ## _irqdispatch(void) \
250− { \
251− ltq_hw_irqdispatch(x); \
252− }
253−DEFINE_HWx_IRQDISPATCH(0)
254−DEFINE_HWx_IRQDISPATCH(1)
255−DEFINE_HWx_IRQDISPATCH(2)
256−DEFINE_HWx_IRQDISPATCH(3)
257−DEFINE_HWx_IRQDISPATCH(4)
258−
259−#if MIPS_CPU_TIMER_IRQ == 7
260−static void ltq_hw5_irqdispatch(void)
261−{
262− do_IRQ(MIPS_CPU_TIMER_IRQ);
263−}
264−#else
265−DEFINE_HWx_IRQDISPATCH(5)
266−#endif
267−
268−static void ltq_hw_irq_handler(struct irq_desc *desc)
269−{
270− ltq_hw_irqdispatch(irq_desc_get_irq(desc) - 2);
271−}
272−
273−asmlinkage void plat_irq_dispatch(void)
274−{
275− unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
276− int irq;
277−
278− if (!pending) {
279− spurious_interrupt();
280− return;
281− }
282−
283− pending >>= CAUSEB_IP;
284− while (pending) {
285− irq = fls(pending) - 1;
286− do_IRQ(MIPS_CPU_IRQ_BASE + irq);
287− pending &= ~BIT(irq);
288− }
289−}
290−
291251 static int icu_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)
292252 {
293253 struct irq_chip *chip = &ltq_irq_type;
@@ -343,38 +303,13 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent) · 49 unmodified lines
343303 for (i = 0; i < MAX_IM; i++)
344304 irq_set_chained_handler(i + 2, ltq_hw_irq_handler);
345305
346− if (cpu_has_vint) {
347− pr_info("Setting up vectored interrupts\n");
348− set_vi_handler(2, ltq_hw0_irqdispatch);
349− set_vi_handler(3, ltq_hw1_irqdispatch);
350− set_vi_handler(4, ltq_hw2_irqdispatch);
351− set_vi_handler(5, ltq_hw3_irqdispatch);
352− set_vi_handler(6, ltq_hw4_irqdispatch);
353− set_vi_handler(7, ltq_hw5_irqdispatch);
354− }
355−
356306 ltq_domain = irq_domain_add_linear(node,
357307 (MAX_IM * INT_NUM_IM_OFFSET) + MIPS_CPU_IRQ_CASCADE,
358308 &irq_domain_ops, 0);
359309
360−#ifndef CONFIG_MIPS_MT_SMP
361− set_c0_status(IE_IRQ0 | IE_IRQ1 | IE_IRQ2 |
362− IE_IRQ3 | IE_IRQ4 | IE_IRQ5);
363−#else
364− set_c0_status(IE_SW0 | IE_SW1 | IE_IRQ0 | IE_IRQ1 |
365− IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5);
366−#endif
367−
368310 /* tell oprofile which irq to use */
369311 ltq_perfcount_irq = irq_create_mapping(ltq_domain, LTQ_PERF_IRQ);
370312
371− /*
372− * if the timer irq is not one of the mips irqs we need to
373− * create a mapping
374− */
375− if (MIPS_CPU_TIMER_IRQ != 7)
376− irq_create_mapping(ltq_domain, MIPS_CPU_TIMER_IRQ);
377−
378313 /* the external interrupts are optional and xway only */
379314 eiu_node = of_find_compatible_node(NULL, NULL, "lantiq,eiu-xway");
380315 if (eiu_node && !of_address_to_resource(eiu_node, 0, &res)) {
@@ -411,7 +346,7 @@ EXPORT_SYMBOL_GPL(get_c0_perfcount_int); · 30 unmodified lines
411346
412347 unsigned int get_c0_compare_int(void)
413348 {
414− return MIPS_CPU_TIMER_IRQ;
349+ return CP0_LEGACY_COMPARE_IRQ;
415350 }
416351
417352 static struct of_device_id __initdata of_irq_ids[] = {
arch/mips/lantiq/xway/dma.c+3−3
@@ -129,9 +129,9 @@ ltq_dma_alloc(struct ltq_dma_channel *ch) · 128 unmodified lines
129129 unsigned long flags;
130130
131131 ch->desc = 0;
132− ch->desc_base = dma_zalloc_coherent(ch->dev,
133− LTQ_DESC_NUM * LTQ_DESC_SIZE,
134− &ch->phys, GFP_ATOMIC);
132+ ch->desc_base = dma_alloc_coherent(ch->dev,
133+ LTQ_DESC_NUM * LTQ_DESC_SIZE,
134+ &ch->phys, GFP_ATOMIC);
135135
136136 spin_lock_irqsave(&ltq_dma_lock, flags);
137137 ltq_dma_w32(ch->nr, LTQ_DMA_CS);
arch/mips/loongson64/Platform+23−0
@@ -23,6 +23,29 @@ ifdef CONFIG_CPU_LOONGSON2F_WORKAROUNDS · 22 unmodified lines
2323 endif
2424
2525 cflags-$(CONFIG_CPU_LOONGSON3) += -Wa,--trap
26+
27+#
28+# Some versions of binutils, not currently mainline as of 2019/02/04, support
29+# an -mfix-loongson3-llsc flag which emits a sync prior to each ll instruction
30+# to work around a CPU bug (see loongson_llsc_mb() in asm/barrier.h for a
31+# description).
32+#
33+# We disable this in order to prevent the assembler meddling with the
34+# instruction that labels refer to, ie. if we label an ll instruction:
35+#
36+# 1: ll v0, 0(a0)
37+#
38+# ...then with the assembler fix applied the label may actually point at a sync
39+# instruction inserted by the assembler, and if we were using the label in an
40+# exception table the table would no longer contain the address of the ll
41+# instruction.
42+#
43+# Avoid this by explicitly disabling that assembler behaviour. If upstream
44+# binutils does not merge support for the flag then we can revisit & remove
45+# this later - for now it ensures vendor toolchains don't cause problems.
46+#
47+cflags-$(CONFIG_CPU_LOONGSON3) += $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,)
48+
2649 #
2750 # binutils from v2.25 on and gcc starting from v4.9.0 treat -march=loongson3a
2851 # as MIPS64 R2; older versions as just R1. This leaves the possibility open
arch/mips/loongson64/common/reset.c+6−1
@@ -59,7 +59,12 @@ static void loongson_poweroff(void) · 58 unmodified lines
5959 {
6060 #ifndef CONFIG_LEFI_FIRMWARE_INTERFACE
6161 mach_prepare_shutdown();
62− unreachable();
62+
63+ /*
64+ * It needs a wait loop here, but mips/kernel/reset.c already calls
65+ * a generic delay loop, machine_hang(), so simply return.
66+ */
67+ return;
6368 #else
6469 void (*fw_poweroff)(void) = (void *)loongson_sysconf.poweroff_addr;
6570
arch/mips/mm/tlbex.c+10−0
@@ -932,6 +932,8 @@ build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r, · 931 unmodified lines
932932 * to mimic that here by taking a load/istream page
933933 * fault.
934934 */
935+ if (IS_ENABLED(CONFIG_CPU_LOONGSON3_WORKAROUNDS))
936+ uasm_i_sync(p, 0);
935937 UASM_i_LA(p, ptr, (unsigned long)tlb_do_page_fault_0);
936938 uasm_i_jr(p, ptr);
937939
@@ -1646,6 +1648,8 @@ static void · 708 unmodified lines
16461648 iPTE_LW(u32 **p, unsigned int pte, unsigned int ptr)
16471649 {
16481650 #ifdef CONFIG_SMP
1651+ if (IS_ENABLED(CONFIG_CPU_LOONGSON3_WORKAROUNDS))
1652+ uasm_i_sync(p, 0);
16491653 # ifdef CONFIG_PHYS_ADDR_T_64BIT
16501654 if (cpu_has_64bits)
16511655 uasm_i_lld(p, pte, 0, ptr);
@@ -2259,6 +2263,8 @@ static void build_r4000_tlb_load_handler(void) · 607 unmodified lines
22592263 #endif
22602264
22612265 uasm_l_nopage_tlbl(&l, p);
2266+ if (IS_ENABLED(CONFIG_CPU_LOONGSON3_WORKAROUNDS))
2267+ uasm_i_sync(&p, 0);
22622268 build_restore_work_registers(&p);
22632269 #ifdef CONFIG_CPU_MICROMIPS
22642270 if ((unsigned long)tlb_do_page_fault_0 & 1) {
@@ -2313,6 +2319,8 @@ static void build_r4000_tlb_store_handler(void) · 48 unmodified lines
23132319 #endif
23142320
23152321 uasm_l_nopage_tlbs(&l, p);
2322+ if (IS_ENABLED(CONFIG_CPU_LOONGSON3_WORKAROUNDS))
2323+ uasm_i_sync(&p, 0);
23162324 build_restore_work_registers(&p);
23172325 #ifdef CONFIG_CPU_MICROMIPS
23182326 if ((unsigned long)tlb_do_page_fault_1 & 1) {
@@ -2368,6 +2376,8 @@ static void build_r4000_tlb_modify_handler(void) · 49 unmodified lines
23682376 #endif
23692377
23702378 uasm_l_nopage_tlbm(&l, p);
2379+ if (IS_ENABLED(CONFIG_CPU_LOONGSON3_WORKAROUNDS))
2380+ uasm_i_sync(&p, 0);
23712381 build_restore_work_registers(&p);
23722382 #ifdef CONFIG_CPU_MICROMIPS
23732383 if ((unsigned long)tlb_do_page_fault_1 & 1) {
arch/mips/pci/msi-octeon.c+3−1
@@ -369,7 +369,9 @@ int __init octeon_msi_initialize(void) · 368 unmodified lines
369369 int irq;
370370 struct irq_chip *msi;
371371
372− if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
372+ if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_INVALID) {
373+ return 0;
374+ } else if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
373375 msi_rcv_reg[0] = CVMX_PEXP_NPEI_MSI_RCV0;
374376 msi_rcv_reg[1] = CVMX_PEXP_NPEI_MSI_RCV1;
375377 msi_rcv_reg[2] = CVMX_PEXP_NPEI_MSI_RCV2;
arch/mips/pci/pci-octeon.c+5−5
@@ -568,6 +568,11 @@ static int __init octeon_pci_setup(void) · 567 unmodified lines
568568 if (octeon_has_feature(OCTEON_FEATURE_PCIE))
569569 return 0;
570570
571+ if (!octeon_is_pci_host()) {
572+ pr_notice("Not in host mode, PCI Controller not initialized\n");
573+ return 0;
574+ }
575+
571576 /* Point pcibios_map_irq() to the PCI version of it */
572577 octeon_pcibios_map_irq = octeon_pci_pcibios_map_irq;
573578
@@ -579,11 +584,6 @@ static int __init octeon_pci_setup(void) · 5 unmodified lines
579584 else
580585 octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_BIG;
581586
582− if (!octeon_is_pci_host()) {
583− pr_notice("Not in host mode, PCI Controller not initialized\n");
584− return 0;
585− }
586−
587587 /* PCI I/O and PCI MEM values */
588588 set_io_port_base(OCTEON_PCI_IOSPACE_BASE);
589589 ioport_resource.start = 0;
arch/mips/vdso/Makefile+3−2
@@ -8,6 +8,7 @@ ccflags-vdso := \ · 7 unmodified lines
88 $(filter -E%,$(KBUILD_CFLAGS)) \
99 $(filter -mmicromips,$(KBUILD_CFLAGS)) \
1010 $(filter -march=%,$(KBUILD_CFLAGS)) \
11+ $(filter -m%-float,$(KBUILD_CFLAGS)) \
1112 -D__VDSO__
1213
1314 ifdef CONFIG_CC_IS_CLANG
@@ -129,7 +130,7 @@ $(obj)/%-o32.o: $(src)/%.c FORCE · 115 unmodified lines
129130 $(call cmd,force_checksrc)
130131 $(call if_changed_rule,cc_o_c)
131132
132−$(obj)/vdso-o32.lds: KBUILD_CPPFLAGS := -mabi=32
133+$(obj)/vdso-o32.lds: KBUILD_CPPFLAGS := $(ccflags-vdso) -mabi=32
133134 $(obj)/vdso-o32.lds: $(src)/vdso.lds.S FORCE
134135 $(call if_changed_dep,cpp_lds_S)
135136
@@ -169,7 +170,7 @@ $(obj)/%-n32.o: $(src)/%.c FORCE · 33 unmodified lines
169170 $(call cmd,force_checksrc)
170171 $(call if_changed_rule,cc_o_c)
171172
172−$(obj)/vdso-n32.lds: KBUILD_CPPFLAGS := -mabi=n32
173+$(obj)/vdso-n32.lds: KBUILD_CPPFLAGS := $(ccflags-vdso) -mabi=n32
173174 $(obj)/vdso-n32.lds: $(src)/vdso.lds.S FORCE
174175 $(call if_changed_dep,cpp_lds_S)
175176
arch/nds32/Makefile+0−8
@@ -3,9 +3,6 @@ OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment -S · 2 unmodified lines
33
44 KBUILD_DEFCONFIG := defconfig
55
6−comma = ,
7−
8−
96 ifdef CONFIG_FUNCTION_TRACER
107 arch-y += -malways-save-lp -mno-relax
118 endif
@@ -54,8 +51,6 @@ endif · 42 unmodified lines
5451 boot := arch/nds32/boot
5552 core-y += $(boot)/dts/
5653
57−.PHONY: FORCE
58−
5954 Image: vmlinux
6055 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
6156
@@ -68,9 +63,6 @@ prepare: vdso_prepare · 6 unmodified lines
6863 vdso_prepare: prepare0
6964 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso include/generated/vdso-offsets.h
7065
71−CLEAN_FILES += include/asm-nds32/constants.h*
72−
73−# We use MRPROPER_FILES and CLEAN_FILES now
7466 archclean:
7567 $(Q)$(MAKE) $(clean)=$(boot)
7668
arch/openrisc/Makefile+0−3
@@ -20,7 +20,6 @@ · 19 unmodified lines
2020 KBUILD_DEFCONFIG := or1ksim_defconfig
2121
2222 OBJCOPYFLAGS := -O binary -R .note -R .comment -S
23−LDFLAGS_vmlinux :=
2423 LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
2524
2625 KBUILD_CFLAGS += -pipe -ffixed-r10 -D__linux__
@@ -50,5 +49,3 @@ else · 23 unmodified lines
5049 BUILTIN_DTB := n
5150 endif
5251 core-$(BUILTIN_DTB) += arch/openrisc/boot/dts/
53−
54−all: vmlinux
arch/openrisc/include/asm/Kbuild+1−0
@@ -34,6 +34,7 @@ generic-y += qrwlock_types.h · 33 unmodified lines
3434 generic-y += qrwlock.h
3535 generic-y += sections.h
3636 generic-y += segment.h
37+generic-y += shmparam.h
3738 generic-y += string.h
3839 generic-y += switch_to.h
3940 generic-y += topology.h
arch/openrisc/include/asm/uaccess.h+6−2
@@ -58,8 +58,12 @@ · 57 unmodified lines
5858 /* Ensure that addr is below task's addr_limit */
5959 #define __addr_ok(addr) ((unsigned long) addr < get_fs())
6060
61−#define access_ok(addr, size) \
62− __range_ok((unsigned long)addr, (unsigned long)size)
61+#define access_ok(addr, size) \
62+({ \
63+ unsigned long __ao_addr = (unsigned long)(addr); \
64+ unsigned long __ao_size = (unsigned long)(size); \
65+ __range_ok(__ao_addr, __ao_size); \
66+})
6367
6468 /*
6569 * These are the main single-value transfer routines. They automatically
arch/powerpc/include/asm/book3s/64/pgtable.h+7−15
@@ -1258,21 +1258,13 @@ extern pmd_t pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, · 1257 unmodified lines
12581258
12591259 #define pmd_move_must_withdraw pmd_move_must_withdraw
12601260 struct spinlock;
1261−static inline int pmd_move_must_withdraw(struct spinlock *new_pmd_ptl,
1262− struct spinlock *old_pmd_ptl,
1263− struct vm_area_struct *vma)
1264−{
1265− if (radix_enabled())
1266− return false;
1267− /*
1268− * Archs like ppc64 use pgtable to store per pmd
1269− * specific information. So when we switch the pmd,
1270− * we should also withdraw and deposit the pgtable
1271− */
1272− return true;
1273−}
1274−
1275−
1261+extern int pmd_move_must_withdraw(struct spinlock *new_pmd_ptl,
1262+ struct spinlock *old_pmd_ptl,
1263+ struct vm_area_struct *vma);
1264+/*
1265+ * Hash translation mode use the deposited table to store hash pte
1266+ * slot information.
1267+ */
12761268 #define arch_needs_pgtable_deposit arch_needs_pgtable_deposit
12771269 static inline bool arch_needs_pgtable_deposit(void)
12781270 {
arch/powerpc/include/uapi/asm/perf_regs.h+1−0
@@ -47,6 +47,7 @@ enum perf_event_powerpc_regs { · 46 unmodified lines
4747 PERF_REG_POWERPC_DAR,
4848 PERF_REG_POWERPC_DSISR,
4949 PERF_REG_POWERPC_SIER,
50+ PERF_REG_POWERPC_MMCRA,
5051 PERF_REG_POWERPC_MAX,
5152 };
5253 #endif /* _UAPI_ASM_POWERPC_PERF_REGS_H */
arch/powerpc/kernel/head_8xx.S+2−1
@@ -852,11 +852,12 @@ start_here: · 851 unmodified lines
852852
853853 /* set up the PTE pointers for the Abatron bdiGDB.
854854 */
855− tovirt(r6,r6)
856855 lis r5, abatron_pteptrs@h
857856 ori r5, r5, abatron_pteptrs@l
858857 stw r5, 0xf0(0) /* Must match your Abatron config file */
859858 tophys(r5,r5)
859+ lis r6, swapper_pg_dir@h
860+ ori r6, r6, swapper_pg_dir@l
860861 stw r6, 0(r5)
861862
862863 /* Now turn on the MMU for real! */
arch/powerpc/kernel/signal_64.c+4−3
@@ -755,11 +755,12 @@ SYSCALL_DEFINE0(rt_sigreturn) · 754 unmodified lines
755755 if (restore_tm_sigcontexts(current, &uc->uc_mcontext,
756756 &uc_transact->uc_mcontext))
757757 goto badframe;
758− }
758+ } else
759759 #endif
760− /* Fall through, for non-TM restore */
761− if (!MSR_TM_ACTIVE(msr)) {
760+ {
762761 /*
762+ * Fall through, for non-TM restore
763+ *
763764 * Unset MSR[TS] on the thread regs since MSR from user
764765 * context does not have MSR active, and recheckpoint was
765766 * not called since restore_tm_sigcontexts() was not called
arch/powerpc/kernel/trace/ftrace.c+0−7
@@ -967,13 +967,6 @@ out: · 966 unmodified lines
967967 }
968968 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
969969
970−#if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_PPC64)
971−unsigned long __init arch_syscall_addr(int nr)
972−{
973− return sys_call_table[nr*2];
974−}
975−#endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_PPC64 */
976−
977970 #ifdef PPC64_ELF_ABI_v1
978971 char *arch_ftrace_match_adjust(char *str, const char *search)
979972 {
arch/powerpc/mm/pgtable-book3s64.c+22−0
@@ -400,3 +400,25 @@ void arch_report_meminfo(struct seq_file *m) · 399 unmodified lines
400400 atomic_long_read(&direct_pages_count[MMU_PAGE_1G]) << 20);
401401 }
402402 #endif /* CONFIG_PROC_FS */
403+
404+/*
405+ * For hash translation mode, we use the deposited table to store hash slot
406+ * information and they are stored at PTRS_PER_PMD offset from related pmd
407+ * location. Hence a pmd move requires deposit and withdraw.
408+ *
409+ * For radix translation with split pmd ptl, we store the deposited table in the
410+ * pmd page. Hence if we have different pmd page we need to withdraw during pmd
411+ * move.
412+ *
413+ * With hash we use deposited table always irrespective of anon or not.
414+ * With radix we use deposited table only for anonymous mapping.
415+ */
416+int pmd_move_must_withdraw(struct spinlock *new_pmd_ptl,
417+ struct spinlock *old_pmd_ptl,
418+ struct vm_area_struct *vma)
419+{
420+ if (radix_enabled())
421+ return (new_pmd_ptl != old_pmd_ptl) && vma_is_anonymous(vma);
422+
423+ return true;
424+}
arch/powerpc/perf/perf_regs.c+6−0
@@ -70,6 +70,7 @@ static unsigned int pt_regs_offset[PERF_REG_POWERPC_MAX] = { · 69 unmodified lines
7070 PT_REGS_OFFSET(PERF_REG_POWERPC_DAR, dar),
7171 PT_REGS_OFFSET(PERF_REG_POWERPC_DSISR, dsisr),
7272 PT_REGS_OFFSET(PERF_REG_POWERPC_SIER, dar),
73+ PT_REGS_OFFSET(PERF_REG_POWERPC_MMCRA, dsisr),
7374 };
7475
7576 u64 perf_reg_value(struct pt_regs *regs, int idx)
@@ -83,6 +84,11 @@ u64 perf_reg_value(struct pt_regs *regs, int idx) · 7 unmodified lines
8384 !is_sier_available()))
8485 return 0;
8586
87+ if (idx == PERF_REG_POWERPC_MMCRA &&
88+ (IS_ENABLED(CONFIG_FSL_EMB_PERF_EVENT) ||
89+ IS_ENABLED(CONFIG_PPC32)))
90+ return 0;
91+
8692 return regs_get_register(regs, pt_regs_offset[idx]);
8793 }
8894
arch/powerpc/platforms/4xx/ocm.c+3−3
@@ -237,12 +237,12 @@ static int ocm_debugfs_show(struct seq_file *m, void *v) · 236 unmodified lines
237237 continue;
238238
239239 seq_printf(m, "PPC4XX OCM : %d\n", ocm->index);
240− seq_printf(m, "PhysAddr : %pa[p]\n", &(ocm->phys));
240+ seq_printf(m, "PhysAddr : %pa\n", &(ocm->phys));
241241 seq_printf(m, "MemTotal : %d Bytes\n", ocm->memtotal);
242242 seq_printf(m, "MemTotal(NC) : %d Bytes\n", ocm->nc.memtotal);
243243 seq_printf(m, "MemTotal(C) : %d Bytes\n\n", ocm->c.memtotal);
244244
245− seq_printf(m, "NC.PhysAddr : %pa[p]\n", &(ocm->nc.phys));
245+ seq_printf(m, "NC.PhysAddr : %pa\n", &(ocm->nc.phys));
246246 seq_printf(m, "NC.VirtAddr : 0x%p\n", ocm->nc.virt);
247247 seq_printf(m, "NC.MemTotal : %d Bytes\n", ocm->nc.memtotal);
248248 seq_printf(m, "NC.MemFree : %d Bytes\n", ocm->nc.memfree);
@@ -252,7 +252,7 @@ static int ocm_debugfs_show(struct seq_file *m, void *v) · 3 unmodified lines
252252 blk->size, blk->owner);
253253 }
254254
255− seq_printf(m, "\nC.PhysAddr : %pa[p]\n", &(ocm->c.phys));
255+ seq_printf(m, "\nC.PhysAddr : %pa\n", &(ocm->c.phys));
256256 seq_printf(m, "C.VirtAddr : 0x%p\n", ocm->c.virt);
257257 seq_printf(m, "C.MemTotal : %d Bytes\n", ocm->c.memtotal);
258258 seq_printf(m, "C.MemFree : %d Bytes\n", ocm->c.memfree);
arch/powerpc/platforms/chrp/setup.c+1−2
@@ -538,8 +538,7 @@ static void __init chrp_init_IRQ(void) · 537 unmodified lines
538538 /* see if there is a keyboard in the device tree
539539 with a parent of type "adb" */
540540 for_each_node_by_name(kbd, "keyboard")
541− if (kbd->parent && kbd->parent->type
542− && strcmp(kbd->parent->type, "adb") == 0)
541+ if (of_node_is_type(kbd->parent, "adb"))
543542 break;
544543 of_node_put(kbd);
545544 if (kbd)
arch/powerpc/platforms/pasemi/dma_lib.c+1−1
@@ -255,7 +255,7 @@ int pasemi_dma_alloc_ring(struct pasemi_dmachan *chan, int ring_size) · 254 unmodified lines
255255
256256 chan->ring_size = ring_size;
257257
258− chan->ring_virt = dma_zalloc_coherent(&dma_pdev->dev,
258+ chan->ring_virt = dma_alloc_coherent(&dma_pdev->dev,
259259 ring_size * sizeof(u64),
260260 &chan->ring_dma, GFP_KERNEL);
261261
arch/powerpc/platforms/powernv/npu-dma.c+1−1
@@ -564,7 +564,7 @@ struct iommu_table_group *pnv_try_setup_npu_table_group(struct pnv_ioda_pe *pe) · 563 unmodified lines
564564 }
565565 } else {
566566 /* Create a group for 1 GPU and attached NPUs for POWER8 */
567− pe->npucomp = kzalloc(sizeof(pe->npucomp), GFP_KERNEL);
567+ pe->npucomp = kzalloc(sizeof(*pe->npucomp), GFP_KERNEL);
568568 table_group = &pe->npucomp->table_group;
569569 table_group->ops = &pnv_npu_peers_ops;
570570 iommu_register_group(table_group, hose->global_number,
arch/powerpc/platforms/powernv/pci-ioda.c+2−1
@@ -2681,7 +2681,8 @@ static void pnv_pci_ioda_setup_iommu_api(void) · 2680 unmodified lines
26812681 list_for_each_entry(hose, &hose_list, list_node) {
26822682 phb = hose->private_data;
26832683
2684− if (phb->type == PNV_PHB_NPU_NVLINK)
2684+ if (phb->type == PNV_PHB_NPU_NVLINK ||
2685+ phb->type == PNV_PHB_NPU_OCAPI)
26852686 continue;
26862687
26872688 list_for_each_entry(pe, &phb->ioda.pe_list, list) {
arch/powerpc/platforms/pseries/papr_scm.c+4−1
@@ -43,6 +43,7 @@ static int drc_pmem_bind(struct papr_scm_priv *p) · 42 unmodified lines
4343 {
4444 unsigned long ret[PLPAR_HCALL_BUFSIZE];
4545 uint64_t rc, token;
46+ uint64_t saved = 0;
4647
4748 /*
4849 * When the hypervisor cannot map all the requested memory in a single
@@ -56,6 +57,8 @@ static int drc_pmem_bind(struct papr_scm_priv *p) · 7 unmodified lines
5657 rc = plpar_hcall(H_SCM_BIND_MEM, ret, p->drc_index, 0,
5758 p->blocks, BIND_ANY_ADDR, token);
5859 token = ret[0];
60+ if (!saved)
61+ saved = ret[1];
5962 cond_resched();
6063 } while (rc == H_BUSY);
6164
@@ -64,7 +67,7 @@ static int drc_pmem_bind(struct papr_scm_priv *p) · 2 unmodified lines
6467 return -ENXIO;
6568 }
6669
67− p->bound_addr = ret[1];
70+ p->bound_addr = saved;
6871
6972 dev_dbg(&p->pdev->dev, "bound drc %x to %pR\n", p->drc_index, &p->res);
7073
arch/powerpc/platforms/pseries/pci.c+2−0
@@ -264,7 +264,9 @@ void __init pSeries_final_fixup(void) · 263 unmodified lines
264264 if (!of_device_is_compatible(nvdn->parent,
265265 "ibm,power9-npu"))
266266 continue;
267+#ifdef CONFIG_PPC_POWERNV
267268 WARN_ON_ONCE(pnv_npu2_init(hose));
269+#endif
268270 break;
269271 }
270272 }
arch/powerpc/sysdev/fsl_rmu.c+4−3
@@ -756,9 +756,10 @@ fsl_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries) · 755 unmodified lines
756756 }
757757
758758 /* Initialize outbound message descriptor ring */
759− rmu->msg_tx_ring.virt = dma_zalloc_coherent(priv->dev,
760− rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
761− &rmu->msg_tx_ring.phys, GFP_KERNEL);
759+ rmu->msg_tx_ring.virt = dma_alloc_coherent(priv->dev,
760+ rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
761+ &rmu->msg_tx_ring.phys,
762+ GFP_KERNEL);
762763 if (!rmu->msg_tx_ring.virt) {
763764 rc = -ENOMEM;
764765 goto out_dma;
arch/riscv/Kconfig+4−2
@@ -28,11 +28,13 @@ config RISCV · 27 unmodified lines
2828 select GENERIC_STRNLEN_USER
2929 select GENERIC_SMP_IDLE_THREAD
3030 select GENERIC_ATOMIC64 if !64BIT || !RISCV_ISA_A
31+ select HAVE_ARCH_AUDITSYSCALL
3132 select HAVE_MEMBLOCK_NODE_MAP
3233 select HAVE_DMA_CONTIGUOUS
3334 select HAVE_FUTEX_CMPXCHG if FUTEX
3435 select HAVE_GENERIC_DMA_COHERENT
3536 select HAVE_PERF_EVENTS
37+ select HAVE_SYSCALL_TRACEPOINTS
3638 select IRQ_DOMAIN
3739 select RISCV_ISA_A if SMP
3840 select SPARSE_IRQ
@@ -40,6 +42,7 @@ config RISCV · 1 unmodified line
4042 select HAVE_ARCH_TRACEHOOK
4143 select HAVE_PCI
4244 select MODULES_USE_ELF_RELA if MODULES
45+ select MODULE_SECTIONS if MODULES
4346 select THREAD_INFO_IN_TASK
4447 select PCI_DOMAINS_GENERIC if PCI
4548 select PCI_MSI if PCI
@@ -100,7 +103,7 @@ choice · 54 unmodified lines
100103 prompt "Base ISA"
101104 default ARCH_RV64I
102105 help
103− This selects the base ISA that this kernel will traget and must match
106+ This selects the base ISA that this kernel will target and must match
104107 the target platform.
105108
106109 config ARCH_RV32I
@@ -152,7 +155,6 @@ choice · 45 unmodified lines
152155 bool "2GiB"
153156 config MAXPHYSMEM_128GB
154157 depends on 64BIT && CMODEL_MEDANY
155− select MODULE_SECTIONS if MODULES
156158 bool "128GiB"
157159 endchoice
158160
arch/riscv/configs/defconfig+5−3
@@ -13,8 +13,6 @@ CONFIG_BLK_DEV_INITRD=y · 12 unmodified lines
1313 CONFIG_EXPERT=y
1414 CONFIG_BPF_SYSCALL=y
1515 CONFIG_SMP=y
16−CONFIG_PCI=y
17−CONFIG_PCIE_XILINX=y
1816 CONFIG_MODULES=y
1917 CONFIG_MODULE_UNLOAD=y
2018 CONFIG_NET=y
@@ -28,6 +26,10 @@ CONFIG_IP_PNP_DHCP=y · 7 unmodified lines
2826 CONFIG_IP_PNP_BOOTP=y
2927 CONFIG_IP_PNP_RARP=y
3028 CONFIG_NETLINK_DIAG=y
29+CONFIG_PCI=y
30+CONFIG_PCIEPORTBUS=y
31+CONFIG_PCI_HOST_GENERIC=y
32+CONFIG_PCIE_XILINX=y
3133 CONFIG_DEVTMPFS=y
3234 CONFIG_BLK_DEV_LOOP=y
3335 CONFIG_VIRTIO_BLK=y
@@ -63,7 +65,6 @@ CONFIG_USB_STORAGE=y · 29 unmodified lines
6365 CONFIG_USB_UAS=y
6466 CONFIG_VIRTIO_MMIO=y
6567 CONFIG_SIFIVE_PLIC=y
66−CONFIG_RAS=y
6768 CONFIG_EXT4_FS=y
6869 CONFIG_EXT4_FS_POSIX_ACL=y
6970 CONFIG_AUTOFS4_FS=y
@@ -77,5 +78,6 @@ CONFIG_NFS_V4_1=y · 7 unmodified lines
7778 CONFIG_NFS_V4_2=y
7879 CONFIG_ROOT_NFS=y
7980 CONFIG_CRYPTO_USER_API_HASH=y
81+CONFIG_CRYPTO_DEV_VIRTIO=y
8082 CONFIG_PRINTK_TIME=y
8183 # CONFIG_RCU_TRACE is not set
arch/riscv/include/asm/module.h+15−13
@@ -9,12 +9,12 @@ · 8 unmodified lines
99 #define MODULE_ARCH_VERMAGIC "riscv"
1010
1111 struct module;
12−u64 module_emit_got_entry(struct module *mod, u64 val);
13−u64 module_emit_plt_entry(struct module *mod, u64 val);
12+unsigned long module_emit_got_entry(struct module *mod, unsigned long val);
13+unsigned long module_emit_plt_entry(struct module *mod, unsigned long val);
1414
1515 #ifdef CONFIG_MODULE_SECTIONS
1616 struct mod_section {
17− struct elf64_shdr *shdr;
17+ Elf_Shdr *shdr;
1818 int num_entries;
1919 int max_entries;
2020 };
@@ -26,18 +26,18 @@ struct mod_arch_specific { · 5 unmodified lines
2626 };
2727
2828 struct got_entry {
29− u64 symbol_addr; /* the real variable address */
29+ unsigned long symbol_addr; /* the real variable address */
3030 };
3131
32−static inline struct got_entry emit_got_entry(u64 val)
32+static inline struct got_entry emit_got_entry(unsigned long val)
3333 {
3434 return (struct got_entry) {val};
3535 }
3636
37−static inline struct got_entry *get_got_entry(u64 val,
37+static inline struct got_entry *get_got_entry(unsigned long val,
3838 const struct mod_section *sec)
3939 {
40− struct got_entry *got = (struct got_entry *)sec->shdr->sh_addr;
40+ struct got_entry *got = (struct got_entry *)(sec->shdr->sh_addr);
4141 int i;
4242 for (i = 0; i < sec->num_entries; i++) {
4343 if (got[i].symbol_addr == val)
@@ -62,7 +62,9 @@ struct plt_entry { · 18 unmodified lines
6262 #define REG_T0 0x5
6363 #define REG_T1 0x6
6464
65−static inline struct plt_entry emit_plt_entry(u64 val, u64 plt, u64 got_plt)
65+static inline struct plt_entry emit_plt_entry(unsigned long val,
66+ unsigned long plt,
67+ unsigned long got_plt)
6668 {
6769 /*
6870 * U-Type encoding:
@@ -76,7 +78,7 @@ static inline struct plt_entry emit_plt_entry(u64 val, u64 plt, u64 got_plt) · 7 unmodified lines
7678 * +------------+------------+--------+----------+----------+
7779 *
7880 */
79− u64 offset = got_plt - plt;
81+ unsigned long offset = got_plt - plt;
8082 u32 hi20 = (offset + 0x800) & 0xfffff000;
8183 u32 lo12 = (offset - hi20);
8284 return (struct plt_entry) {
@@ -86,7 +88,7 @@ static inline struct plt_entry emit_plt_entry(u64 val, u64 plt, u64 got_plt) · 3 unmodified lines
8688 };
8789 }
8890
89−static inline int get_got_plt_idx(u64 val, const struct mod_section *sec)
91+static inline int get_got_plt_idx(unsigned long val, const struct mod_section *sec)
9092 {
9193 struct got_entry *got_plt = (struct got_entry *)sec->shdr->sh_addr;
9294 int i;
@@ -97,9 +99,9 @@ static inline int get_got_plt_idx(u64 val, const struct mod_section *sec) · 4 unmodified lines
9799 return -1;
98100 }
99101
100−static inline struct plt_entry *get_plt_entry(u64 val,
101− const struct mod_section *sec_plt,
102− const struct mod_section *sec_got_plt)
102+static inline struct plt_entry *get_plt_entry(unsigned long val,
103+ const struct mod_section *sec_plt,
104+ const struct mod_section *sec_got_plt)
103105 {
104106 struct plt_entry *plt = (struct plt_entry *)sec_plt->shdr->sh_addr;
105107 int got_plt_idx = get_got_plt_idx(val, sec_got_plt);
arch/riscv/include/asm/page.h+1−1
@@ -80,7 +80,7 @@ typedef struct page *pgtable_t; · 79 unmodified lines
8080 #define __pgd(x) ((pgd_t) { (x) })
8181 #define __pgprot(x) ((pgprot_t) { (x) })
8282
83−#ifdef CONFIG_64BITS
83+#ifdef CONFIG_64BIT
8484 #define PTE_FMT "%016lx"
8585 #else
8686 #define PTE_FMT "%08lx"
arch/riscv/include/asm/processor.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 * This decides where the kernel will search for a free chunk of vm
2323 * space during mmap's.
2424 */
25−#define TASK_UNMAPPED_BASE PAGE_ALIGN(TASK_SIZE >> 1)
25+#define TASK_UNMAPPED_BASE PAGE_ALIGN(TASK_SIZE / 3)
2626
2727 #define STACK_TOP TASK_SIZE
2828 #define STACK_TOP_MAX STACK_TOP
arch/riscv/include/asm/ptrace.h+5−0
@@ -113,6 +113,11 @@ static inline void frame_pointer_set(struct pt_regs *regs, · 112 unmodified lines
113113 SET_FP(regs, val);
114114 }
115115
116+static inline unsigned long regs_return_value(struct pt_regs *regs)
117+{
118+ return regs->a0;
119+}
120+
116121 #endif /* __ASSEMBLY__ */
117122
118123 #endif /* _ASM_RISCV_PTRACE_H */
arch/riscv/include/asm/syscall.h+10−0
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #ifndef _ASM_RISCV_SYSCALL_H
1919 #define _ASM_RISCV_SYSCALL_H
2020
21+#include <uapi/linux/audit.h>
2122 #include <linux/sched.h>
2223 #include <linux/err.h>
2324
@@ -99,4 +100,13 @@ static inline void syscall_set_arguments(struct task_struct *task, · 75 unmodified lines
99100 memcpy(&regs->a1 + i * sizeof(regs->a1), args, n * sizeof(regs->a0));
100101 }
101102
103+static inline int syscall_get_arch(void)
104+{
105+#ifdef CONFIG_64BIT
106+ return AUDIT_ARCH_RISCV64;
107+#else
108+ return AUDIT_ARCH_RISCV32;
109+#endif
110+}
111+
102112 #endif /* _ASM_RISCV_SYSCALL_H */
arch/riscv/include/asm/thread_info.h+6−0
@@ -80,13 +80,19 @@ struct thread_info { · 79 unmodified lines
8080 #define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */
8181 #define TIF_MEMDIE 5 /* is terminating due to OOM killer */
8282 #define TIF_SYSCALL_TRACEPOINT 6 /* syscall tracepoint instrumentation */
83+#define TIF_SYSCALL_AUDIT 7 /* syscall auditing */
8384
8485 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
8586 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
8687 #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
8788 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
89+#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
90+#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
8891
8992 #define _TIF_WORK_MASK \
9093 (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | _TIF_NEED_RESCHED)
9194
95+#define _TIF_SYSCALL_WORK \
96+ (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_TRACEPOINT | _TIF_SYSCALL_AUDIT)
97+
9298 #endif /* _ASM_RISCV_THREAD_INFO_H */
arch/riscv/include/asm/unistd.h+2−0
@@ -19,3 +19,5 @@ · 18 unmodified lines
1919 #define __ARCH_WANT_SYS_CLONE
2020
2121 #include <uapi/asm/unistd.h>
22+
23+#define NR_syscalls (__NR_syscalls)
arch/riscv/kernel/asm-offsets.c+1−0
@@ -39,6 +39,7 @@ void asm_offsets(void) · 38 unmodified lines
3939 OFFSET(TASK_STACK, task_struct, stack);
4040 OFFSET(TASK_TI, task_struct, thread_info);
4141 OFFSET(TASK_TI_FLAGS, task_struct, thread_info.flags);
42+ OFFSET(TASK_TI_PREEMPT_COUNT, task_struct, thread_info.preempt_count);
4243 OFFSET(TASK_TI_KERNEL_SP, task_struct, thread_info.kernel_sp);
4344 OFFSET(TASK_TI_USER_SP, task_struct, thread_info.user_sp);
4445 OFFSET(TASK_TI_CPU, task_struct, thread_info.cpu);
arch/riscv/kernel/entry.S+19−3
@@ -144,6 +144,10 @@ _save_context: · 143 unmodified lines
144144 REG_L x2, PT_SP(sp)
145145 .endm
146146
147+#if !IS_ENABLED(CONFIG_PREEMPT)
148+.set resume_kernel, restore_all
149+#endif
150+
147151 ENTRY(handle_exception)
148152 SAVE_ALL
149153
@@ -201,7 +205,7 @@ handle_syscall: · 51 unmodified lines
201205 REG_S s2, PT_SEPC(sp)
202206 /* Trace syscalls, but only if requested by the user. */
203207 REG_L t0, TASK_TI_FLAGS(tp)
204− andi t0, t0, _TIF_SYSCALL_TRACE
208+ andi t0, t0, _TIF_SYSCALL_WORK
205209 bnez t0, handle_syscall_trace_enter
206210 check_syscall_nr:
207211 /* Check to make sure we don't jump to a bogus syscall number. */
@@ -221,14 +225,14 @@ ret_from_syscall: · 13 unmodified lines
221225 REG_S a0, PT_A0(sp)
222226 /* Trace syscalls, but only if requested by the user. */
223227 REG_L t0, TASK_TI_FLAGS(tp)
224− andi t0, t0, _TIF_SYSCALL_TRACE
228+ andi t0, t0, _TIF_SYSCALL_WORK
225229 bnez t0, handle_syscall_trace_exit
226230
227231 ret_from_exception:
228232 REG_L s0, PT_SSTATUS(sp)
229233 csrc sstatus, SR_SIE
230234 andi s0, s0, SR_SPP
231− bnez s0, restore_all
235+ bnez s0, resume_kernel
232236
233237 resume_userspace:
234238 /* Interrupts must be disabled here so flags are checked atomically */
@@ -250,6 +254,18 @@ restore_all: · 15 unmodified lines
250254 RESTORE_ALL
251255 sret
252256
257+#if IS_ENABLED(CONFIG_PREEMPT)
258+resume_kernel:
259+ REG_L s0, TASK_TI_PREEMPT_COUNT(tp)
260+ bnez s0, restore_all
261+need_resched:
262+ REG_L s0, TASK_TI_FLAGS(tp)
263+ andi s0, s0, _TIF_NEED_RESCHED
264+ beqz s0, restore_all
265+ call preempt_schedule_irq
266+ j need_resched
267+#endif
268+
253269 work_pending:
254270 /* Enter slow path for supplementary processing */
255271 la ra, ret_from_exception
arch/riscv/kernel/module-sections.c+16−14
@@ -9,14 +9,14 @@ · 8 unmodified lines
99 #include <linux/kernel.h>
1010 #include <linux/module.h>
1111
12−u64 module_emit_got_entry(struct module *mod, u64 val)
12+unsigned long module_emit_got_entry(struct module *mod, unsigned long val)
1313 {
1414 struct mod_section *got_sec = &mod->arch.got;
1515 int i = got_sec->num_entries;
1616 struct got_entry *got = get_got_entry(val, got_sec);
1717
1818 if (got)
19− return (u64)got;
19+ return (unsigned long)got;
2020
2121 /* There is no duplicate entry, create a new one */
2222 got = (struct got_entry *)got_sec->shdr->sh_addr;
@@ -25,10 +25,10 @@ u64 module_emit_got_entry(struct module *mod, u64 val) · 2 unmodified lines
2525 got_sec->num_entries++;
2626 BUG_ON(got_sec->num_entries > got_sec->max_entries);
2727
28− return (u64)&got[i];
28+ return (unsigned long)&got[i];
2929 }
3030
31−u64 module_emit_plt_entry(struct module *mod, u64 val)
31+unsigned long module_emit_plt_entry(struct module *mod, unsigned long val)
3232 {
3333 struct mod_section *got_plt_sec = &mod->arch.got_plt;
3434 struct got_entry *got_plt;
@@ -37,27 +37,29 @@ u64 module_emit_plt_entry(struct module *mod, u64 val) · 2 unmodified lines
3737 int i = plt_sec->num_entries;
3838
3939 if (plt)
40− return (u64)plt;
40+ return (unsigned long)plt;
4141
4242 /* There is no duplicate entry, create a new one */
4343 got_plt = (struct got_entry *)got_plt_sec->shdr->sh_addr;
4444 got_plt[i] = emit_got_entry(val);
4545 plt = (struct plt_entry *)plt_sec->shdr->sh_addr;
46− plt[i] = emit_plt_entry(val, (u64)&plt[i], (u64)&got_plt[i]);
46+ plt[i] = emit_plt_entry(val,
47+ (unsigned long)&plt[i],
48+ (unsigned long)&got_plt[i]);
4749
4850 plt_sec->num_entries++;
4951 got_plt_sec->num_entries++;
5052 BUG_ON(plt_sec->num_entries > plt_sec->max_entries);
5153
52− return (u64)&plt[i];
54+ return (unsigned long)&plt[i];
5355 }
5456
55−static int is_rela_equal(const Elf64_Rela *x, const Elf64_Rela *y)
57+static int is_rela_equal(const Elf_Rela *x, const Elf_Rela *y)
5658 {
5759 return x->r_info == y->r_info && x->r_addend == y->r_addend;
5860 }
5961
60−static bool duplicate_rela(const Elf64_Rela *rela, int idx)
62+static bool duplicate_rela(const Elf_Rela *rela, int idx)
6163 {
6264 int i;
6365 for (i = 0; i < idx; i++) {
@@ -67,13 +69,13 @@ static bool duplicate_rela(const Elf64_Rela *rela, int idx) · 3 unmodified lines
6769 return false;
6870 }
6971
70−static void count_max_entries(Elf64_Rela *relas, int num,
72+static void count_max_entries(Elf_Rela *relas, int num,
7173 unsigned int *plts, unsigned int *gots)
7274 {
7375 unsigned int type, i;
7476
7577 for (i = 0; i < num; i++) {
76− type = ELF64_R_TYPE(relas[i].r_info);
78+ type = ELF_RISCV_R_TYPE(relas[i].r_info);
7779 if (type == R_RISCV_CALL_PLT) {
7880 if (!duplicate_rela(relas, i))
7981 (*plts)++;
@@ -118,9 +120,9 @@ int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, · 38 unmodified lines
118120
119121 /* Calculate the maxinum number of entries */
120122 for (i = 0; i < ehdr->e_shnum; i++) {
121− Elf64_Rela *relas = (void *)ehdr + sechdrs[i].sh_offset;
122− int num_rela = sechdrs[i].sh_size / sizeof(Elf64_Rela);
123− Elf64_Shdr *dst_sec = sechdrs + sechdrs[i].sh_info;
123+ Elf_Rela *relas = (void *)ehdr + sechdrs[i].sh_offset;
124+ int num_rela = sechdrs[i].sh_size / sizeof(Elf_Rela);
125+ Elf_Shdr *dst_sec = sechdrs + sechdrs[i].sh_info;
124126
125127 if (sechdrs[i].sh_type != SHT_RELA)
126128 continue;
arch/riscv/kernel/ptrace.c+8−1
@@ -18,12 +18,15 @@ · 17 unmodified lines
1818 #include <asm/ptrace.h>
1919 #include <asm/syscall.h>
2020 #include <asm/thread_info.h>
21+#include <linux/audit.h>
2122 #include <linux/ptrace.h>
2223 #include <linux/elf.h>
2324 #include <linux/regset.h>
2425 #include <linux/sched.h>
2526 #include <linux/sched/task_stack.h>
2627 #include <linux/tracehook.h>
28+
29+#define CREATE_TRACE_POINTS
2730 #include <trace/events/syscalls.h>
2831
2932 enum riscv_regset {
@@ -163,15 +166,19 @@ void do_syscall_trace_enter(struct pt_regs *regs) · 133 unmodified lines
163166 if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
164167 trace_sys_enter(regs, syscall_get_nr(current, regs));
165168 #endif
169+
170+ audit_syscall_entry(regs->a7, regs->a0, regs->a1, regs->a2, regs->a3);
166171 }
167172
168173 void do_syscall_trace_exit(struct pt_regs *regs)
169174 {
175+ audit_syscall_exit(regs);
176+
170177 if (test_thread_flag(TIF_SYSCALL_TRACE))
171178 tracehook_report_syscall_exit(regs, 0);
172179
173180 #ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
174181 if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
175− trace_sys_exit(regs, regs->regs[0]);
182+ trace_sys_exit(regs, regs_return_value(regs));
176183 #endif
177184 }
arch/riscv/kernel/setup.c+9−2
@@ -149,7 +149,14 @@ asmlinkage void __init setup_vm(void) · 148 unmodified lines
149149
150150 void __init parse_dtb(unsigned int hartid, void *dtb)
151151 {
152− early_init_dt_scan(__va(dtb));
152+ if (!early_init_dt_scan(__va(dtb)))
153+ return;
154+
155+ pr_err("No DTB passed to the kernel\n");
156+#ifdef CONFIG_CMDLINE_FORCE
157+ strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
158+ pr_info("Forcing kernel command line to: %s\n", boot_command_line);
159+#endif
153160 }
154161
155162 static void __init setup_bootmem(void)
@@ -174,7 +181,7 @@ static void __init setup_bootmem(void) · 18 unmodified lines
174181 BUG_ON(mem_size == 0);
175182
176183 set_max_mapnr(PFN_DOWN(mem_size));
177− max_low_pfn = memblock_end_of_DRAM();
184+ max_low_pfn = PFN_DOWN(memblock_end_of_DRAM());
178185
179186 #ifdef CONFIG_BLK_DEV_INITRD
180187 setup_initrd();
arch/riscv/kernel/smp.c+36−7
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <linux/smp.h>
2424 #include <linux/sched.h>
2525 #include <linux/seq_file.h>
26+#include <linux/delay.h>
2627
2728 #include <asm/sbi.h>
2829 #include <asm/tlbflush.h>
@@ -31,6 +32,7 @@ · 2 unmodified lines
3132 enum ipi_message_type {
3233 IPI_RESCHEDULE,
3334 IPI_CALL_FUNC,
35+ IPI_CPU_STOP,
3436 IPI_MAX
3537 };
3638
@@ -66,6 +68,13 @@ int setup_profiling_timer(unsigned int multiplier) · 29 unmodified lines
6668 return -EINVAL;
6769 }
6870
71+static void ipi_stop(void)
72+{
73+ set_cpu_online(smp_processor_id(), false);
74+ while (1)
75+ wait_for_interrupt();
76+}
77+
6978 void riscv_software_interrupt(void)
7079 {
7180 unsigned long *pending_ipis = &ipi_data[smp_processor_id()].bits;
@@ -94,6 +103,11 @@ void riscv_software_interrupt(void) · 22 unmodified lines
94103 generic_smp_call_function_interrupt();
95104 }
96105
106+ if (ops & (1 << IPI_CPU_STOP)) {
107+ stats[IPI_CPU_STOP]++;
108+ ipi_stop();
109+ }
110+
97111 BUG_ON((ops >> IPI_MAX) != 0);
98112
99113 /* Order data access and bit testing. */
@@ -121,6 +135,7 @@ send_ipi_message(const struct cpumask *to_whom, enum ipi_message_type operation) · 21 unmodified lines
121135 static const char * const ipi_names[] = {
122136 [IPI_RESCHEDULE] = "Rescheduling interrupts",
123137 [IPI_CALL_FUNC] = "Function call interrupts",
138+ [IPI_CPU_STOP] = "CPU stop interrupts",
124139 };
125140
126141 void show_ipi_stats(struct seq_file *p, int prec)
@@ -146,15 +161,29 @@ void arch_send_call_function_single_ipi(int cpu) · 19 unmodified lines
146161 send_ipi_message(cpumask_of(cpu), IPI_CALL_FUNC);
147162 }
148163
149−static void ipi_stop(void *unused)
150−{
151− while (1)
152− wait_for_interrupt();
153−}
154−
155164 void smp_send_stop(void)
156165 {
157− on_each_cpu(ipi_stop, NULL, 1);
166+ unsigned long timeout;
167+
168+ if (num_online_cpus() > 1) {
169+ cpumask_t mask;
170+
171+ cpumask_copy(&mask, cpu_online_mask);
172+ cpumask_clear_cpu(smp_processor_id(), &mask);
173+
174+ if (system_state <= SYSTEM_RUNNING)
175+ pr_crit("SMP: stopping secondary CPUs\n");
176+ send_ipi_message(&mask, IPI_CPU_STOP);
177+ }
178+
179+ /* Wait up to one second for other CPUs to stop */
180+ timeout = USEC_PER_SEC;
181+ while (num_online_cpus() > 1 && timeout--)
182+ udelay(1);
183+
184+ if (num_online_cpus() > 1)
185+ pr_warn("SMP: failed to stop secondary CPUs %*pbl\n",
186+ cpumask_pr_args(cpu_online_mask));
158187 }
159188
160189 void smp_send_reschedule(int cpu)
arch/riscv/kernel/smpboot.c+1−5
@@ -57,15 +57,12 @@ void __init setup_smp(void) · 56 unmodified lines
5757
5858 while ((dn = of_find_node_by_type(dn, "cpu"))) {
5959 hart = riscv_of_processor_hartid(dn);
60− if (hart < 0) {
61− of_node_put(dn);
60+ if (hart < 0)
6261 continue;
63− }
6462
6563 if (hart == cpuid_to_hartid_map(0)) {
6664 BUG_ON(found_boot_cpu);
6765 found_boot_cpu = 1;
68− of_node_put(dn);
6966 continue;
7067 }
7168
@@ -73,7 +70,6 @@ void __init setup_smp(void) · 1 unmodified line
7370 set_cpu_possible(cpuid, true);
7471 set_cpu_present(cpuid, true);
7572 cpuid++;
76− of_node_put(dn);
7773 }
7874
7975 BUG_ON(!found_boot_cpu);
arch/riscv/kernel/vmlinux.lds.S+6−2
@@ -18,6 +18,8 @@ · 17 unmodified lines
1818 #include <asm/cache.h>
1919 #include <asm/thread_info.h>
2020
21+#define MAX_BYTES_PER_LONG 0x10
22+
2123 OUTPUT_ARCH(riscv)
2224 ENTRY(_start)
2325
@@ -74,8 +76,6 @@ SECTIONS · 50 unmodified lines
7476 *(.sbss*)
7577 }
7678
77− BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)
78−
7979 EXCEPTION_TABLE(0x10)
8080 NOTES
8181
@@ -83,6 +83,10 @@ SECTIONS · 1 unmodified line
8383 *(.rel.dyn*)
8484 }
8585
86+ BSS_SECTION(MAX_BYTES_PER_LONG,
87+ MAX_BYTES_PER_LONG,
88+ MAX_BYTES_PER_LONG)
89+
8690 _end = .;
8791
8892 STABS_DEBUG
arch/riscv/mm/init.c+2−1
@@ -28,7 +28,8 @@ static void __init zone_sizes_init(void) · 27 unmodified lines
2828 unsigned long max_zone_pfns[MAX_NR_ZONES] = { 0, };
2929
3030 #ifdef CONFIG_ZONE_DMA32
31− max_zone_pfns[ZONE_DMA32] = PFN_DOWN(min(4UL * SZ_1G, max_low_pfn));
31+ max_zone_pfns[ZONE_DMA32] = PFN_DOWN(min(4UL * SZ_1G,
32+ (unsigned long) PFN_PHYS(max_low_pfn)));
3233 #endif
3334 max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
3435
arch/s390/include/asm/mmu_context.h+3−4
@@ -25,7 +25,7 @@ static inline int init_new_context(struct task_struct *tsk, · 24 unmodified lines
2525 atomic_set(&mm->context.flush_count, 0);
2626 mm->context.gmap_asce = 0;
2727 mm->context.flush_mm = 0;
28− mm->context.compat_mm = 0;
28+ mm->context.compat_mm = test_thread_flag(TIF_31BIT);
2929 #ifdef CONFIG_PGSTE
3030 mm->context.alloc_pgste = page_table_allocate_pgste ||
3131 test_thread_flag(TIF_PGSTE) ||
@@ -90,8 +90,6 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, · 58 unmodified lines
9090 {
9191 int cpu = smp_processor_id();
9292
93− if (prev == next)
94− return;
9593 S390_lowcore.user_asce = next->context.asce;
9694 cpumask_set_cpu(cpu, &next->context.cpu_attach_mask);
9795 /* Clear previous user-ASCE from CR1 and CR7 */
@@ -103,7 +101,8 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, · 5 unmodified lines
103101 __ctl_load(S390_lowcore.vdso_asce, 7, 7);
104102 clear_cpu_flag(CIF_ASCE_SECONDARY);
105103 }
106− cpumask_clear_cpu(cpu, &prev->context.cpu_attach_mask);
104+ if (prev != next)
105+ cpumask_clear_cpu(cpu, &prev->context.cpu_attach_mask);
107106 }
108107
109108 #define finish_arch_post_lock_switch finish_arch_post_lock_switch
arch/s390/kernel/early.c+2−2
@@ -63,10 +63,10 @@ static noinline __init void detect_machine_type(void) · 62 unmodified lines
6363 if (stsi(vmms, 3, 2, 2) || !vmms->count)
6464 return;
6565
66− /* Running under KVM? If not we assume z/VM */
66+ /* Detect known hypervisors */
6767 if (!memcmp(vmms->vm[0].cpi, "\xd2\xe5\xd4", 3))
6868 S390_lowcore.machine_flags |= MACHINE_FLAG_KVM;
69− else
69+ else if (!memcmp(vmms->vm[0].cpi, "\xa9\x61\xe5\xd4", 4))
7070 S390_lowcore.machine_flags |= MACHINE_FLAG_VM;
7171 }
7272
arch/s390/kernel/setup.c+2−0
@@ -1006,6 +1006,8 @@ void __init setup_arch(char **cmdline_p) · 1005 unmodified lines
10061006 pr_info("Linux is running under KVM in 64-bit mode\n");
10071007 else if (MACHINE_IS_LPAR)
10081008 pr_info("Linux is running natively in 64-bit mode\n");
1009+ else
1010+ pr_info("Linux is running as a guest in 64-bit mode\n");
10091011
10101012 /* Have one command line that is parsed and saved in /proc/cmdline */
10111013 /* boot_command_line has been already set up in early.c */
arch/s390/kernel/smp.c+10−1
@@ -381,8 +381,13 @@ void smp_call_online_cpu(void (*func)(void *), void *data) · 380 unmodified lines
381381 */
382382 void smp_call_ipl_cpu(void (*func)(void *), void *data)
383383 {
384+ struct lowcore *lc = pcpu_devices->lowcore;
385+
386+ if (pcpu_devices[0].address == stap())
387+ lc = &S390_lowcore;
388+
384389 pcpu_delegate(&pcpu_devices[0], func, data,
385− pcpu_devices->lowcore->nodat_stack);
390+ lc->nodat_stack);
386391 }
387392
388393 int smp_find_processor_id(u16 address)
@@ -1166,7 +1171,11 @@ static ssize_t __ref rescan_store(struct device *dev, · 777 unmodified lines
11661171 {
11671172 int rc;
11681173
1174+ rc = lock_device_hotplug_sysfs();
1175+ if (rc)
1176+ return rc;
11691177 rc = smp_rescan_cpus();
1178+ unlock_device_hotplug();
11701179 return rc ? rc : count;
11711180 }
11721181 static DEVICE_ATTR_WO(rescan);
arch/s390/kernel/vdso.c+2−3
@@ -224,10 +224,9 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) · 223 unmodified lines
224224
225225 vdso_pages = vdso64_pages;
226226 #ifdef CONFIG_COMPAT
227− if (is_compat_task()) {
227+ mm->context.compat_mm = is_compat_task();
228+ if (mm->context.compat_mm)
228229 vdso_pages = vdso32_pages;
229− mm->context.compat_mm = 1;
230− }
231230 #endif
232231 /*
233232 * vDSO has a problem and was disabled, just don't "enable" it for
arch/unicore32/include/asm/Kbuild+1−0
@@ -28,6 +28,7 @@ generic-y += preempt.h · 27 unmodified lines
2828 generic-y += sections.h
2929 generic-y += segment.h
3030 generic-y += serial.h
31+generic-y += shmparam.h
3132 generic-y += sizes.h
3233 generic-y += syscalls.h
3334 generic-y += topology.h
arch/x86/Kconfig+5−5
@@ -198,7 +198,7 @@ config X86 · 197 unmodified lines
198198 select IRQ_FORCED_THREADING
199199 select NEED_SG_DMA_LENGTH
200200 select PCI_DOMAINS if PCI
201− select PCI_LOCKLESS_CONFIG
201+ select PCI_LOCKLESS_CONFIG if PCI
202202 select PERF_EVENTS
203203 select RTC_LIB
204204 select RTC_MC146818_LIB
@@ -446,12 +446,12 @@ config RETPOLINE · 241 unmodified lines
446446 branches. Requires a compiler with -mindirect-branch=thunk-extern
447447 support for full protection. The kernel may run slower.
448448
449−config RESCTRL
450− bool "Resource Control support"
449+config X86_CPU_RESCTRL
450+ bool "x86 CPU resource control support"
451451 depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)
452452 select KERNFS
453453 help
454− Enable Resource Control support.
454+ Enable x86 CPU resource control support.
455455
456456 Provide support for the allocation and monitoring of system resources
457457 usage by the CPU.
@@ -617,7 +617,7 @@ config X86_INTEL_QUARK · 159 unmodified lines
617617
618618 config X86_INTEL_LPSS
619619 bool "Intel Low Power Subsystem Support"
620− depends on X86 && ACPI
620+ depends on X86 && ACPI && PCI
621621 select COMMON_CLK
622622 select PINCTRL
623623 select IOSF_MBI
arch/x86/boot/compressed/head_64.S+10−0
@@ -600,6 +600,16 @@ ENTRY(trampoline_32bit_src) · 599 unmodified lines
600600 leal TRAMPOLINE_32BIT_PGTABLE_OFFSET(%ecx), %eax
601601 movl %eax, %cr3
602602 3:
603+ /* Set EFER.LME=1 as a precaution in case hypervsior pulls the rug */
604+ pushl %ecx
605+ pushl %edx
606+ movl $MSR_EFER, %ecx
607+ rdmsr
608+ btsl $_EFER_LME, %eax
609+ wrmsr
610+ popl %edx
611+ popl %ecx
612+
603613 /* Enable PAE and LA57 (if required) paging modes */
604614 movl $X86_CR4_PAE, %eax
605615 cmpl $0, %edx
arch/x86/boot/compressed/pgtable.h+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 #define TRAMPOLINE_32BIT_PGTABLE_OFFSET 0
77
88 #define TRAMPOLINE_32BIT_CODE_OFFSET PAGE_SIZE
9−#define TRAMPOLINE_32BIT_CODE_SIZE 0x60
9+#define TRAMPOLINE_32BIT_CODE_SIZE 0x70
1010
1111 #define TRAMPOLINE_32BIT_STACK_END TRAMPOLINE_32BIT_SIZE
1212
arch/x86/entry/entry_64_compat.S+4−2
@@ -361,7 +361,8 @@ ENTRY(entry_INT80_compat) · 360 unmodified lines
361361
362362 /* Need to switch before accessing the thread stack. */
363363 SWITCH_TO_KERNEL_CR3 scratch_reg=%rdi
364− movq %rsp, %rdi
364+ /* In the Xen PV case we already run on the thread stack. */
365+ ALTERNATIVE "movq %rsp, %rdi", "jmp .Lint80_keep_stack", X86_FEATURE_XENPV
365366 movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp
366367
367368 pushq 6*8(%rdi) /* regs->ss */
@@ -370,8 +371,9 @@ ENTRY(entry_INT80_compat) · 2 unmodified lines
370371 pushq 3*8(%rdi) /* regs->cs */
371372 pushq 2*8(%rdi) /* regs->ip */
372373 pushq 1*8(%rdi) /* regs->orig_ax */
373−
374374 pushq (%rdi) /* pt_regs->di */
375+.Lint80_keep_stack:
376+
375377 pushq %rsi /* pt_regs->si */
376378 xorl %esi, %esi /* nospec si */
377379 pushq %rdx /* pt_regs->dx */
arch/x86/events/intel/core.c+11−5
@@ -3558,6 +3558,14 @@ static void free_excl_cntrs(int cpu) · 3557 unmodified lines
35583558 }
35593559
35603560 static void intel_pmu_cpu_dying(int cpu)
3561+{
3562+ fini_debug_store_on_cpu(cpu);
3563+
3564+ if (x86_pmu.counter_freezing)
3565+ disable_counter_freeze();
3566+}
3567+
3568+static void intel_pmu_cpu_dead(int cpu)
35613569 {
35623570 struct cpu_hw_events *cpuc = &per_cpu(cpu_hw_events, cpu);
35633571 struct intel_shared_regs *pc;
@@ -3570,11 +3578,6 @@ static void intel_pmu_cpu_dying(int cpu) · 6 unmodified lines
35703578 }
35713579
35723580 free_excl_cntrs(cpu);
3573−
3574− fini_debug_store_on_cpu(cpu);
3575−
3576− if (x86_pmu.counter_freezing)
3577− disable_counter_freeze();
35783581 }
35793582
35803583 static void intel_pmu_sched_task(struct perf_event_context *ctx,
@@ -3663,6 +3666,7 @@ static __initconst const struct x86_pmu core_pmu = { · 82 unmodified lines
36633666 .cpu_prepare = intel_pmu_cpu_prepare,
36643667 .cpu_starting = intel_pmu_cpu_starting,
36653668 .cpu_dying = intel_pmu_cpu_dying,
3669+ .cpu_dead = intel_pmu_cpu_dead,
36663670 };
36673671
36683672 static struct attribute *intel_pmu_attrs[];
@@ -3703,6 +3707,8 @@ static __initconst const struct x86_pmu intel_pmu = { · 34 unmodified lines
37033707 .cpu_prepare = intel_pmu_cpu_prepare,
37043708 .cpu_starting = intel_pmu_cpu_starting,
37053709 .cpu_dying = intel_pmu_cpu_dying,
3710+ .cpu_dead = intel_pmu_cpu_dead,
3711+
37063712 .guest_get_msrs = intel_guest_get_msrs,
37073713 .sched_task = intel_pmu_sched_task,
37083714 };
arch/x86/events/intel/uncore_snbep.c+3−1
@@ -1222,6 +1222,8 @@ static struct pci_driver snbep_uncore_pci_driver = { · 1221 unmodified lines
12221222 .id_table = snbep_uncore_pci_ids,
12231223 };
12241224
1225+#define NODE_ID_MASK 0x7
1226+
12251227 /*
12261228 * build pci bus to socket mapping
12271229 */
@@ -1243,7 +1245,7 @@ static int snbep_pci2phy_map_init(int devid, int nodeid_loc, int idmap_loc, bool · 15 unmodified lines
12431245 err = pci_read_config_dword(ubox_dev, nodeid_loc, &config);
12441246 if (err)
12451247 break;
1246− nodeid = config;
1248+ nodeid = config & NODE_ID_MASK;
12471249 /* get the Node ID mapping */
12481250 err = pci_read_config_dword(ubox_dev, idmap_loc, &config);
12491251 if (err)
arch/x86/include/asm/intel-family.h+2−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 * "Big Core" Processors (Branded as Core, Xeon, etc...)
77 *
88 * The "_X" parts are generally the EP and EX Xeons, or the
9− * "Extreme" ones, like Broadwell-E.
9+ * "Extreme" ones, like Broadwell-E, or Atom microserver.
1010 *
1111 * While adding a new CPUID for a new microarchitecture, add a new
1212 * group to keep logically sorted out in chronological order. Within
@@ -71,6 +71,7 @@ · 58 unmodified lines
7171 #define INTEL_FAM6_ATOM_GOLDMONT 0x5C /* Apollo Lake */
7272 #define INTEL_FAM6_ATOM_GOLDMONT_X 0x5F /* Denverton */
7373 #define INTEL_FAM6_ATOM_GOLDMONT_PLUS 0x7A /* Gemini Lake */
74+#define INTEL_FAM6_ATOM_TREMONT_X 0x86 /* Jacobsville */
7475
7576 /* Xeon Phi */
7677
arch/x86/include/asm/mmu_context.h+18−0
@@ -178,6 +178,10 @@ static inline void switch_ldt(struct mm_struct *prev, struct mm_struct *next) · 177 unmodified lines
178178
179179 void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk);
180180
181+/*
182+ * Init a new mm. Used on mm copies, like at fork()
183+ * and on mm's that are brand-new, like at execve().
184+ */
181185 static inline int init_new_context(struct task_struct *tsk,
182186 struct mm_struct *mm)
183187 {
@@ -228,8 +232,22 @@ do { \ · 44 unmodified lines
228232 } while (0)
229233 #endif
230234
235+static inline void arch_dup_pkeys(struct mm_struct *oldmm,
236+ struct mm_struct *mm)
237+{
238+#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
239+ if (!cpu_feature_enabled(X86_FEATURE_OSPKE))
240+ return;
241+
242+ /* Duplicate the oldmm pkey state in mm: */
243+ mm->context.pkey_allocation_map = oldmm->context.pkey_allocation_map;
244+ mm->context.execute_only_pkey = oldmm->context.execute_only_pkey;
245+#endif
246+}
247+
231248 static inline int arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm)
232249 {
250+ arch_dup_pkeys(oldmm, mm);
233251 paravirt_arch_dup_mmap(oldmm, mm);
234252 return ldt_dup_context(oldmm, mm);
235253 }
arch/x86/include/asm/page_64_types.h+4−0
@@ -7,7 +7,11 @@ · 6 unmodified lines
77 #endif
88
99 #ifdef CONFIG_KASAN
10+#ifdef CONFIG_KASAN_EXTRA
11+#define KASAN_STACK_ORDER 2
12+#else
1013 #define KASAN_STACK_ORDER 1
14+#endif
1115 #else
1216 #define KASAN_STACK_ORDER 0
1317 #endif
arch/x86/include/asm/pgtable.h+1−1
@@ -1065,7 +1065,7 @@ static inline void native_set_pte_at(struct mm_struct *mm, unsigned long addr, · 1064 unmodified lines
10651065 static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
10661066 pmd_t *pmdp, pmd_t pmd)
10671067 {
1068− native_set_pmd(pmdp, pmd);
1068+ set_pmd(pmdp, pmd);
10691069 }
10701070
10711071 static inline void set_pud_at(struct mm_struct *mm, unsigned long addr,
arch/x86/include/asm/resctrl_sched.h+2−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 #ifndef _ASM_X86_RESCTRL_SCHED_H
33 #define _ASM_X86_RESCTRL_SCHED_H
44
5−#ifdef CONFIG_RESCTRL
5+#ifdef CONFIG_X86_CPU_RESCTRL
66
77 #include <linux/sched.h>
88 #include <linux/jump_label.h>
@@ -88,6 +88,6 @@ static inline void resctrl_sched_in(void) · 79 unmodified lines
8888
8989 static inline void resctrl_sched_in(void) {}
9090
91−#endif /* CONFIG_RESCTRL */
91+#endif /* CONFIG_X86_CPU_RESCTRL */
9292
9393 #endif /* _ASM_X86_RESCTRL_SCHED_H */
arch/x86/include/asm/uaccess.h+1−1
@@ -711,7 +711,7 @@ static __must_check inline bool user_access_begin(const void __user *ptr, size_t · 710 unmodified lines
711711 {
712712 if (unlikely(!access_ok(ptr,len)))
713713 return 0;
714− __uaccess_begin();
714+ __uaccess_begin_nospec();
715715 return 1;
716716 }
717717 #define user_access_begin(a,b) user_access_begin(a,b)
arch/x86/kernel/cpu/Makefile+1−1
@@ -39,7 +39,7 @@ obj-$(CONFIG_CPU_SUP_UMC_32) += umc.o · 38 unmodified lines
3939 obj-$(CONFIG_X86_MCE) += mce/
4040 obj-$(CONFIG_MTRR) += mtrr/
4141 obj-$(CONFIG_MICROCODE) += microcode/
42−obj-$(CONFIG_RESCTRL) += resctrl/
42+obj-$(CONFIG_X86_CPU_RESCTRL) += resctrl/
4343
4444 obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o
4545
arch/x86/kernel/cpu/bugs.c+2−2
@@ -71,7 +71,7 @@ void __init check_bugs(void) · 70 unmodified lines
7171 * identify_boot_cpu() initialized SMT support information, let the
7272 * core code know.
7373 */
74− cpu_smt_check_topology_early();
74+ cpu_smt_check_topology();
7575
7676 if (!IS_ENABLED(CONFIG_SMP)) {
7777 pr_info("CPU: ");
@@ -215,7 +215,7 @@ static enum spectre_v2_mitigation spectre_v2_enabled __ro_after_init = · 137 unmodified lines
215215 static enum spectre_v2_user_mitigation spectre_v2_user __ro_after_init =
216216 SPECTRE_V2_USER_NONE;
217217
218−#ifdef RETPOLINE
218+#ifdef CONFIG_RETPOLINE
219219 static bool spectre_v2_bad_module;
220220
221221 bool retpoline_module_ok(bool has_retpoline)
arch/x86/kernel/cpu/mce/core.c+1−0
@@ -784,6 +784,7 @@ static int mce_no_way_out(struct mce *m, char **msg, unsigned long *validp, · 783 unmodified lines
784784 quirk_no_way_out(i, m, regs);
785785
786786 if (mce_severity(m, mca_cfg.tolerant, &tmp, true) >= MCE_PANIC_SEVERITY) {
787+ m->bank = i;
787788 mce_read_aux(m, i);
788789 *msg = tmp;
789790 return 1;
arch/x86/kernel/cpu/microcode/amd.c+1−1
@@ -855,7 +855,7 @@ load_microcode_amd(bool save, u8 family, const u8 *data, size_t size) · 854 unmodified lines
855855 if (!p) {
856856 return ret;
857857 } else {
858− if (boot_cpu_data.microcode == p->patch_id)
858+ if (boot_cpu_data.microcode >= p->patch_id)
859859 return ret;
860860
861861 ret = UCODE_NEW;
arch/x86/kernel/cpu/resctrl/Makefile+2−2
@@ -1,4 +1,4 @@
11 # SPDX-License-Identifier: GPL-2.0
2−obj-$(CONFIG_RESCTRL) += core.o rdtgroup.o monitor.o
3−obj-$(CONFIG_RESCTRL) += ctrlmondata.o pseudo_lock.o
2+obj-$(CONFIG_X86_CPU_RESCTRL) += core.o rdtgroup.o monitor.o
3+obj-$(CONFIG_X86_CPU_RESCTRL) += ctrlmondata.o pseudo_lock.o
44 CFLAGS_pseudo_lock.o = -I$(src)
arch/x86/kernel/crash.c+1−0
@@ -470,6 +470,7 @@ int crash_load_segments(struct kimage *image) · 469 unmodified lines
470470
471471 kbuf.memsz = kbuf.bufsz;
472472 kbuf.buf_align = ELF_CORE_HEADER_ALIGN;
473+ kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
473474 ret = kexec_add_buffer(&kbuf);
474475 if (ret) {
475476 vfree((void *)image->arch.elf_headers);
arch/x86/kernel/hpet.c+0−4
@@ -21,10 +21,6 @@ · 20 unmodified lines
2121
2222 #define HPET_MASK CLOCKSOURCE_MASK(32)
2323
24−/* FSEC = 10^-15
25− NSEC = 10^-9 */
26−#define FSEC_PER_NSEC 1000000L
27−
2824 #define HPET_DEV_USED_BIT 2
2925 #define HPET_DEV_USED (1 << HPET_DEV_USED_BIT)
3026 #define HPET_DEV_VALID 0x8
arch/x86/kernel/kexec-bzimage64.c+5−0
@@ -167,6 +167,9 @@ setup_efi_state(struct boot_params *params, unsigned long params_load_addr, · 166 unmodified lines
167167 struct efi_info *current_ei = &boot_params.efi_info;
168168 struct efi_info *ei = &params->efi_info;
169169
170+ if (!efi_enabled(EFI_RUNTIME_SERVICES))
171+ return 0;
172+
170173 if (!current_ei->efi_memmap_size)
171174 return 0;
172175
@@ -434,6 +437,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel, · 261 unmodified lines
434437 kbuf.memsz = PAGE_ALIGN(header->init_size);
435438 kbuf.buf_align = header->kernel_alignment;
436439 kbuf.buf_min = MIN_KERNEL_LOAD_ADDR;
440+ kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
437441 ret = kexec_add_buffer(&kbuf);
438442 if (ret)
439443 goto out_free_params;
@@ -448,6 +452,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel, · 8 unmodified lines
448452 kbuf.bufsz = kbuf.memsz = initrd_len;
449453 kbuf.buf_align = PAGE_SIZE;
450454 kbuf.buf_min = MIN_INITRD_LOAD_ADDR;
455+ kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
451456 ret = kexec_add_buffer(&kbuf);
452457 if (ret)
453458 goto out_free_params;
arch/x86/kernel/kvm.c+5−2
@@ -457,6 +457,7 @@ static void __send_ipi_mask(const struct cpumask *mask, int vector) · 456 unmodified lines
457457 #else
458458 u64 ipi_bitmap = 0;
459459 #endif
460+ long ret;
460461
461462 if (cpumask_empty(mask))
462463 return;
@@ -482,8 +483,9 @@ static void __send_ipi_mask(const struct cpumask *mask, int vector) · 19 unmodified lines
482483 } else if (apic_id < min + KVM_IPI_CLUSTER_SIZE) {
483484 max = apic_id < max ? max : apic_id;
484485 } else {
485− kvm_hypercall4(KVM_HC_SEND_IPI, (unsigned long)ipi_bitmap,
486+ ret = kvm_hypercall4(KVM_HC_SEND_IPI, (unsigned long)ipi_bitmap,
486487 (unsigned long)(ipi_bitmap >> BITS_PER_LONG), min, icr);
488+ WARN_ONCE(ret < 0, "KVM: failed to send PV IPI: %ld", ret);
487489 min = max = apic_id;
488490 ipi_bitmap = 0;
489491 }
@@ -491,8 +493,9 @@ static void __send_ipi_mask(const struct cpumask *mask, int vector) · 1 unmodified line
491493 }
492494
493495 if (ipi_bitmap) {
494− kvm_hypercall4(KVM_HC_SEND_IPI, (unsigned long)ipi_bitmap,
496+ ret = kvm_hypercall4(KVM_HC_SEND_IPI, (unsigned long)ipi_bitmap,
495497 (unsigned long)(ipi_bitmap >> BITS_PER_LONG), min, icr);
498+ WARN_ONCE(ret < 0, "KVM: failed to send PV IPI: %ld", ret);
496499 }
497500
498501 local_irq_restore(flags);
arch/x86/kernel/tsc.c+16−14
@@ -297,15 +297,16 @@ static int __init tsc_setup(char *str) · 296 unmodified lines
297297
298298 __setup("tsc=", tsc_setup);
299299
300−#define MAX_RETRIES 5
301−#define SMI_TRESHOLD 50000
300+#define MAX_RETRIES 5
301+#define TSC_DEFAULT_THRESHOLD 0x20000
302302
303303 /*
304− * Read TSC and the reference counters. Take care of SMI disturbance
304+ * Read TSC and the reference counters. Take care of any disturbances
305305 */
306306 static u64 tsc_read_refs(u64 *p, int hpet)
307307 {
308308 u64 t1, t2;
309+ u64 thresh = tsc_khz ? tsc_khz >> 5 : TSC_DEFAULT_THRESHOLD;
309310 int i;
310311
311312 for (i = 0; i < MAX_RETRIES; i++) {
@@ -315,7 +316,7 @@ static u64 tsc_read_refs(u64 *p, int hpet) · 3 unmodified lines
315316 else
316317 *p = acpi_pm_read_early();
317318 t2 = get_cycles();
318− if ((t2 - t1) < SMI_TRESHOLD)
319+ if ((t2 - t1) < thresh)
319320 return t2;
320321 }
321322 return ULLONG_MAX;
@@ -703,15 +704,15 @@ static unsigned long pit_hpet_ptimer_calibrate_cpu(void) · 381 unmodified lines
703704 * zero. In each wait loop iteration we read the TSC and check
704705 * the delta to the previous read. We keep track of the min
705706 * and max values of that delta. The delta is mostly defined
706− * by the IO time of the PIT access, so we can detect when a
707− * SMI/SMM disturbance happened between the two reads. If the
707+ * by the IO time of the PIT access, so we can detect when
708+ * any disturbance happened between the two reads. If the
708709 * maximum time is significantly larger than the minimum time,
709710 * then we discard the result and have another try.
710711 *
711712 * 2) Reference counter. If available we use the HPET or the
712713 * PMTIMER as a reference to check the sanity of that value.
713714 * We use separate TSC readouts and check inside of the
714− * reference read for a SMI/SMM disturbance. We dicard
715+ * reference read for any possible disturbance. We dicard
715716 * disturbed values here as well. We do that around the PIT
716717 * calibration delay loop as we have to wait for a certain
717718 * amount of time anyway.
@@ -744,7 +745,7 @@ static unsigned long pit_hpet_ptimer_calibrate_cpu(void) · 26 unmodified lines
744745 if (ref1 == ref2)
745746 continue;
746747
747− /* Check, whether the sampling was disturbed by an SMI */
748+ /* Check, whether the sampling was disturbed */
748749 if (tsc1 == ULLONG_MAX || tsc2 == ULLONG_MAX)
749750 continue;
750751
@@ -1268,7 +1269,7 @@ static DECLARE_DELAYED_WORK(tsc_irqwork, tsc_refine_calibration_work); · 517 unmodified lines
12681269 */
12691270 static void tsc_refine_calibration_work(struct work_struct *work)
12701271 {
1271− static u64 tsc_start = -1, ref_start;
1272+ static u64 tsc_start = ULLONG_MAX, ref_start;
12721273 static int hpet;
12731274 u64 tsc_stop, ref_stop, delta;
12741275 unsigned long freq;
@@ -1283,14 +1284,15 @@ static void tsc_refine_calibration_work(struct work_struct *work) · 8 unmodified lines
12831284 * delayed the first time we expire. So set the workqueue
12841285 * again once we know timers are working.
12851286 */
1286− if (tsc_start == -1) {
1287+ if (tsc_start == ULLONG_MAX) {
1288+restart:
12871289 /*
12881290 * Only set hpet once, to avoid mixing hardware
12891291 * if the hpet becomes enabled later.
12901292 */
12911293 hpet = is_hpet_enabled();
1292− schedule_delayed_work(&tsc_irqwork, HZ);
12931294 tsc_start = tsc_read_refs(&ref_start, hpet);
1295+ schedule_delayed_work(&tsc_irqwork, HZ);
12941296 return;
12951297 }
12961298
@@ -1300,9 +1302,9 @@ static void tsc_refine_calibration_work(struct work_struct *work) · 3 unmodified lines
13001302 if (ref_start == ref_stop)
13011303 goto out;
13021304
1303− /* Check, whether the sampling was disturbed by an SMI */
1304− if (tsc_start == ULLONG_MAX || tsc_stop == ULLONG_MAX)
1305− goto out;
1305+ /* Check, whether the sampling was disturbed */
1306+ if (tsc_stop == ULLONG_MAX)
1307+ goto restart;
13061308
13071309 delta = tsc_stop - tsc_start;
13081310 delta *= 1000000LL;
arch/x86/kvm/Makefile+0−4
@@ -2,10 +2,6 @@ · 1 unmodified line
22
33 ccflags-y += -Iarch/x86/kvm
44
5−CFLAGS_x86.o := -I.
6−CFLAGS_svm.o := -I.
7−CFLAGS_vmx.o := -I.
8−
95 KVM := ../../../virt/kvm
106
117 kvm-y += $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o \
arch/x86/kvm/hyperv.c+3−4
@@ -1636,7 +1636,7 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu) · 1635 unmodified lines
16361636 ret = kvm_hvcall_signal_event(vcpu, fast, ingpa);
16371637 if (ret != HV_STATUS_INVALID_PORT_ID)
16381638 break;
1639− /* maybe userspace knows this conn_id: fall through */
1639+ /* fall through - maybe userspace knows this conn_id. */
16401640 case HVCALL_POST_MESSAGE:
16411641 /* don't bother userspace if it has no way to handle it */
16421642 if (unlikely(rep || !vcpu_to_synic(vcpu)->active)) {
@@ -1832,7 +1832,6 @@ int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid, · 189 unmodified lines
18321832 ent->eax |= HV_X64_MSR_VP_INDEX_AVAILABLE;
18331833 ent->eax |= HV_X64_MSR_RESET_AVAILABLE;
18341834 ent->eax |= HV_MSR_REFERENCE_TSC_AVAILABLE;
1835− ent->eax |= HV_X64_MSR_GUEST_IDLE_AVAILABLE;
18361835 ent->eax |= HV_X64_ACCESS_FREQUENCY_MSRS;
18371836 ent->eax |= HV_X64_ACCESS_REENLIGHTENMENT;
18381837
@@ -1848,11 +1847,11 @@ int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid, · 9 unmodified lines
18481847 case HYPERV_CPUID_ENLIGHTMENT_INFO:
18491848 ent->eax |= HV_X64_REMOTE_TLB_FLUSH_RECOMMENDED;
18501849 ent->eax |= HV_X64_APIC_ACCESS_RECOMMENDED;
1851− ent->eax |= HV_X64_SYSTEM_RESET_RECOMMENDED;
18521850 ent->eax |= HV_X64_RELAXED_TIMING_RECOMMENDED;
18531851 ent->eax |= HV_X64_CLUSTER_IPI_RECOMMENDED;
18541852 ent->eax |= HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED;
1855− ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
1853+ if (evmcs_ver)
1854+ ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
18561855
18571856 /*
18581857 * Default number of spinlock retry attempts, matches
arch/x86/kvm/lapic.c+2−0
@@ -1035,6 +1035,7 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode, · 1034 unmodified lines
10351035 switch (delivery_mode) {
10361036 case APIC_DM_LOWEST:
10371037 vcpu->arch.apic_arb_prio++;
1038+ /* fall through */
10381039 case APIC_DM_FIXED:
10391040 if (unlikely(trig_mode && !level))
10401041 break;
@@ -1874,6 +1875,7 @@ int kvm_lapic_reg_write(struct kvm_lapic *apic, u32 reg, u32 val) · 833 unmodified lines
18741875
18751876 case APIC_LVT0:
18761877 apic_manage_nmi_watchdog(apic, val);
1878+ /* fall through */
18771879 case APIC_LVTTHMR:
18781880 case APIC_LVTPC:
18791881 case APIC_LVT1:
arch/x86/kvm/mmu.c+1−0
@@ -4371,6 +4371,7 @@ __reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, · 4370 unmodified lines
43714371 rsvd_bits(maxphyaddr, 51);
43724372 rsvd_check->rsvd_bits_mask[1][4] =
43734373 rsvd_check->rsvd_bits_mask[0][4];
4374+ /* fall through */
43744375 case PT64_ROOT_4LEVEL:
43754376 rsvd_check->rsvd_bits_mask[0][3] = exb_bit_rsvd |
43764377 nonleaf_bit8_rsvd | rsvd_bits(7, 7) |
arch/x86/kvm/svm.c+18−16
@@ -3414,6 +3414,14 @@ static int nested_svm_vmexit(struct vcpu_svm *svm) · 3413 unmodified lines
34143414 kvm_mmu_reset_context(&svm->vcpu);
34153415 kvm_mmu_load(&svm->vcpu);
34163416
3417+ /*
3418+ * Drop what we picked up for L2 via svm_complete_interrupts() so it
3419+ * doesn't end up in L1.
3420+ */
3421+ svm->vcpu.arch.nmi_injected = false;
3422+ kvm_clear_exception_queue(&svm->vcpu);
3423+ kvm_clear_interrupt_queue(&svm->vcpu);
3424+
34173425 return 0;
34183426 }
34193427
@@ -4395,7 +4403,7 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr) · 975 unmodified lines
43954403 case MSR_IA32_APICBASE:
43964404 if (kvm_vcpu_apicv_active(vcpu))
43974405 avic_update_vapic_bar(to_svm(vcpu), data);
4398− /* Follow through */
4406+ /* Fall through */
43994407 default:
44004408 return kvm_set_msr_common(vcpu, msr);
44014409 }
@@ -4504,28 +4512,19 @@ static int avic_incomplete_ipi_interception(struct vcpu_svm *svm) · 102 unmodified lines
45044512 kvm_lapic_reg_write(apic, APIC_ICR, icrl);
45054513 break;
45064514 case AVIC_IPI_FAILURE_TARGET_NOT_RUNNING: {
4507− int i;
4508− struct kvm_vcpu *vcpu;
4509− struct kvm *kvm = svm->vcpu.kvm;
45104515 struct kvm_lapic *apic = svm->vcpu.arch.apic;
45114516
45124517 /*
4513− * At this point, we expect that the AVIC HW has already
4514− * set the appropriate IRR bits on the valid target
4515− * vcpus. So, we just need to kick the appropriate vcpu.
4518+ * Update ICR high and low, then emulate sending IPI,
4519+ * which is handled when writing APIC_ICR.
45164520 */
4517− kvm_for_each_vcpu(i, vcpu, kvm) {
4518− bool m = kvm_apic_match_dest(vcpu, apic,
4519− icrl & KVM_APIC_SHORT_MASK,
4520− GET_APIC_DEST_FIELD(icrh),
4521− icrl & KVM_APIC_DEST_MASK);
4522−
4523− if (m && !avic_vcpu_is_running(vcpu))
4524− kvm_vcpu_wake_up(vcpu);
4525− }
4521+ kvm_lapic_reg_write(apic, APIC_ICR2, icrh);
4522+ kvm_lapic_reg_write(apic, APIC_ICR, icrl);
45264523 break;
45274524 }
45284525 case AVIC_IPI_FAILURE_INVALID_TARGET:
4526+ WARN_ONCE(1, "Invalid IPI target: index=%u, vcpu=%d, icr=%#0x:%#0x\n",
4527+ index, svm->vcpu.vcpu_id, icrh, icrl);
45294528 break;
45304529 case AVIC_IPI_FAILURE_INVALID_BACKING_PAGE:
45314530 WARN_ONCE(1, "Invalid backing page\n");
@@ -6278,6 +6277,9 @@ static int sev_guest_init(struct kvm *kvm, struct kvm_sev_cmd *argp) · 1746 unmodified lines
62786277 int asid, ret;
62796278
62806279 ret = -EBUSY;
6280+ if (unlikely(sev->active))
6281+ return ret;
6282+
62816283 asid = sev_asid_new();
62826284 if (asid < 0)
62836285 return ret;
arch/x86/kvm/trace.h+1−1
@@ -1465,7 +1465,7 @@ TRACE_EVENT(kvm_hv_send_ipi_ex, · 1464 unmodified lines
14651465 #endif /* _TRACE_KVM_H */
14661466
14671467 #undef TRACE_INCLUDE_PATH
1468−#define TRACE_INCLUDE_PATH arch/x86/kvm
1468+#define TRACE_INCLUDE_PATH ../../arch/x86/kvm
14691469 #undef TRACE_INCLUDE_FILE
14701470 #define TRACE_INCLUDE_FILE trace
14711471
arch/x86/kvm/vmx/evmcs.c+4−3
@@ -332,16 +332,17 @@ int nested_enable_evmcs(struct kvm_vcpu *vcpu, · 331 unmodified lines
332332 uint16_t *vmcs_version)
333333 {
334334 struct vcpu_vmx *vmx = to_vmx(vcpu);
335+ bool evmcs_already_enabled = vmx->nested.enlightened_vmcs_enabled;
336+
337+ vmx->nested.enlightened_vmcs_enabled = true;
335338
336339 if (vmcs_version)
337340 *vmcs_version = nested_get_evmcs_version(vcpu);
338341
339342 /* We don't support disabling the feature for simplicity. */
340− if (vmx->nested.enlightened_vmcs_enabled)
343+ if (evmcs_already_enabled)
341344 return 0;
342345
343− vmx->nested.enlightened_vmcs_enabled = true;
344−
345346 vmx->nested.msrs.pinbased_ctls_high &= ~EVMCS1_UNSUPPORTED_PINCTRL;
346347 vmx->nested.msrs.entry_ctls_high &= ~EVMCS1_UNSUPPORTED_VMENTRY_CTRL;
347348 vmx->nested.msrs.exit_ctls_high &= ~EVMCS1_UNSUPPORTED_VMEXIT_CTRL;
arch/x86/kvm/vmx/nested.c+11−7
@@ -55,7 +55,7 @@ static u16 shadow_read_write_fields[] = { · 54 unmodified lines
5555 static int max_shadow_read_write_fields =
5656 ARRAY_SIZE(shadow_read_write_fields);
5757
58−void init_vmcs_shadow_fields(void)
58+static void init_vmcs_shadow_fields(void)
5959 {
6060 int i, j;
6161
@@ -211,6 +211,7 @@ static void free_nested(struct kvm_vcpu *vcpu) · 149 unmodified lines
211211 if (!vmx->nested.vmxon && !vmx->nested.smm.vmxon)
212212 return;
213213
214+ hrtimer_cancel(&vmx->nested.preemption_timer);
214215 vmx->nested.vmxon = false;
215216 vmx->nested.smm.vmxon = false;
216217 free_vpid(vmx->nested.vpid02);
@@ -4140,11 +4141,11 @@ static int enter_vmx_operation(struct kvm_vcpu *vcpu) · 3923 unmodified lines
41404141 if (r < 0)
41414142 goto out_vmcs02;
41424143
4143− vmx->nested.cached_vmcs12 = kmalloc(VMCS12_SIZE, GFP_KERNEL);
4144+ vmx->nested.cached_vmcs12 = kzalloc(VMCS12_SIZE, GFP_KERNEL);
41444145 if (!vmx->nested.cached_vmcs12)
41454146 goto out_cached_vmcs12;
41464147
4147− vmx->nested.cached_shadow_vmcs12 = kmalloc(VMCS12_SIZE, GFP_KERNEL);
4148+ vmx->nested.cached_shadow_vmcs12 = kzalloc(VMCS12_SIZE, GFP_KERNEL);
41484149 if (!vmx->nested.cached_shadow_vmcs12)
41494150 goto out_cached_shadow_vmcs12;
41504151
@@ -4540,9 +4541,8 @@ static int handle_vmptrld(struct kvm_vcpu *vcpu) · 389 unmodified lines
45404541 * given physical address won't match the required
45414542 * VMCS12_REVISION identifier.
45424543 */
4543− nested_vmx_failValid(vcpu,
4544+ return nested_vmx_failValid(vcpu,
45444545 VMXERR_VMPTRLD_INCORRECT_VMCS_REVISION_ID);
4545− return kvm_skip_emulated_instruction(vcpu);
45464546 }
45474547 new_vmcs12 = kmap(page);
45484548 if (new_vmcs12->hdr.revision_id != VMCS12_REVISION ||
@@ -5264,13 +5264,17 @@ static int vmx_get_nested_state(struct kvm_vcpu *vcpu, · 715 unmodified lines
52645264 copy_shadow_to_vmcs12(vmx);
52655265 }
52665266
5267− if (copy_to_user(user_kvm_nested_state->data, vmcs12, sizeof(*vmcs12)))
5267+ /*
5268+ * Copy over the full allocated size of vmcs12 rather than just the size
5269+ * of the struct.
5270+ */
5271+ if (copy_to_user(user_kvm_nested_state->data, vmcs12, VMCS12_SIZE))
52685272 return -EFAULT;
52695273
52705274 if (nested_cpu_has_shadow_vmcs(vmcs12) &&
52715275 vmcs12->vmcs_link_pointer != -1ull) {
52725276 if (copy_to_user(user_kvm_nested_state->data + VMCS12_SIZE,
5273− get_shadow_vmcs12(vcpu), sizeof(*vmcs12)))
5277+ get_shadow_vmcs12(vcpu), VMCS12_SIZE))
52745278 return -EFAULT;
52755279 }
52765280
arch/x86/kvm/vmx/vmx.c+81−73
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include <linux/mod_devicetable.h>
2727 #include <linux/mm.h>
2828 #include <linux/sched.h>
29+#include <linux/sched/smt.h>
2930 #include <linux/slab.h>
3031 #include <linux/tboot.h>
3132 #include <linux/trace_events.h>
@@ -423,7 +424,7 @@ static void check_ept_pointer_match(struct kvm *kvm) · 391 unmodified lines
423424 to_kvm_vmx(kvm)->ept_pointers_match = EPT_POINTERS_MATCH;
424425 }
425426
426−int kvm_fill_hv_flush_list_func(struct hv_guest_mapping_flush_list *flush,
427+static int kvm_fill_hv_flush_list_func(struct hv_guest_mapping_flush_list *flush,
427428 void *data)
428429 {
429430 struct kvm_tlb_range *range = data;
@@ -453,7 +454,7 @@ static int hv_remote_flush_tlb_with_range(struct kvm *kvm, · 23 unmodified lines
453454 struct kvm_tlb_range *range)
454455 {
455456 struct kvm_vcpu *vcpu;
456− int ret = -ENOTSUPP, i;
457+ int ret = 0, i;
457458
458459 spin_lock(&to_kvm_vmx(kvm)->ept_pointer_lock);
459460
@@ -1773,7 +1774,7 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 1313 unmodified lines
17731774 if (!msr_info->host_initiated &&
17741775 !guest_cpuid_has(vcpu, X86_FEATURE_RDTSCP))
17751776 return 1;
1776− /* Otherwise falls through */
1777+ /* Else, falls through */
17771778 default:
17781779 msr = find_msr_entry(vmx, msr_info->index);
17791780 if (msr) {
@@ -2014,7 +2015,7 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 234 unmodified lines
20142015 /* Check reserved bit, higher 32 bits should be zero */
20152016 if ((data >> 32) != 0)
20162017 return 1;
2017− /* Otherwise falls through */
2018+ /* Else, falls through */
20182019 default:
20192020 msr = find_msr_entry(vmx, msr_index);
20202021 if (msr) {
@@ -2344,7 +2345,7 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf, · 323 unmodified lines
23442345 case 37: /* AAT100 */
23452346 case 44: /* BC86,AAY89,BD102 */
23462347 case 46: /* BA97 */
2347− _vmexit_control &= ~VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL;
2348+ _vmentry_control &= ~VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL;
23482349 _vmexit_control &= ~VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL;
23492350 pr_warn_once("kvm: VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL "
23502351 "does not work properly. Using workaround\n");
@@ -6362,72 +6363,9 @@ static void vmx_update_hv_timer(struct kvm_vcpu *vcpu) · 4011 unmodified lines
63626363 vmx->loaded_vmcs->hv_timer_armed = false;
63636364 }
63646365
6365−static void vmx_vcpu_run(struct kvm_vcpu *vcpu)
6366+static void __vmx_vcpu_run(struct kvm_vcpu *vcpu, struct vcpu_vmx *vmx)
63666367 {
6367− struct vcpu_vmx *vmx = to_vmx(vcpu);
6368− unsigned long cr3, cr4, evmcs_rsp;
6369−
6370− /* Record the guest's net vcpu time for enforced NMI injections. */
6371− if (unlikely(!enable_vnmi &&
6372− vmx->loaded_vmcs->soft_vnmi_blocked))
6373− vmx->loaded_vmcs->entry_time = ktime_get();
6374−
6375− /* Don't enter VMX if guest state is invalid, let the exit handler
6376− start emulation until we arrive back to a valid state */
6377− if (vmx->emulation_required)
6378− return;
6379−
6380− if (vmx->ple_window_dirty) {
6381− vmx->ple_window_dirty = false;
6382− vmcs_write32(PLE_WINDOW, vmx->ple_window);
6383− }
6384−
6385− if (vmx->nested.need_vmcs12_sync)
6386− nested_sync_from_vmcs12(vcpu);
6387−
6388− if (test_bit(VCPU_REGS_RSP, (unsigned long *)&vcpu->arch.regs_dirty))
6389− vmcs_writel(GUEST_RSP, vcpu->arch.regs[VCPU_REGS_RSP]);
6390− if (test_bit(VCPU_REGS_RIP, (unsigned long *)&vcpu->arch.regs_dirty))
6391− vmcs_writel(GUEST_RIP, vcpu->arch.regs[VCPU_REGS_RIP]);
6392−
6393− cr3 = __get_current_cr3_fast();
6394− if (unlikely(cr3 != vmx->loaded_vmcs->host_state.cr3)) {
6395− vmcs_writel(HOST_CR3, cr3);
6396− vmx->loaded_vmcs->host_state.cr3 = cr3;
6397− }
6398−
6399− cr4 = cr4_read_shadow();
6400− if (unlikely(cr4 != vmx->loaded_vmcs->host_state.cr4)) {
6401− vmcs_writel(HOST_CR4, cr4);
6402− vmx->loaded_vmcs->host_state.cr4 = cr4;
6403− }
6404−
6405− /* When single-stepping over STI and MOV SS, we must clear the
6406− * corresponding interruptibility bits in the guest state. Otherwise
6407− * vmentry fails as it then expects bit 14 (BS) in pending debug
6408− * exceptions being set, but that's not correct for the guest debugging
6409− * case. */
6410− if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
6411− vmx_set_interrupt_shadow(vcpu, 0);
6412−
6413− if (static_cpu_has(X86_FEATURE_PKU) &&
6414− kvm_read_cr4_bits(vcpu, X86_CR4_PKE) &&
6415− vcpu->arch.pkru != vmx->host_pkru)
6416− __write_pkru(vcpu->arch.pkru);
6417−
6418− pt_guest_enter(vmx);
6419−
6420− atomic_switch_perf_msrs(vmx);
6421−
6422− vmx_update_hv_timer(vcpu);
6423−
6424− /*
6425− * If this vCPU has touched SPEC_CTRL, restore the guest's value if
6426− * it's non-zero. Since vmentry is serialising on affected CPUs, there
6427− * is no need to worry about the conditional branch over the wrmsr
6428− * being speculatively taken.
6429− */
6430− x86_spec_ctrl_set_guest(vmx->spec_ctrl, 0);
6368+ unsigned long evmcs_rsp;
64316369
64326370 vmx->__launched = vmx->loaded_vmcs->launched;
64336371
@@ -6567,6 +6505,77 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu) · 133 unmodified lines
65676505 , "eax", "ebx", "edi"
65686506 #endif
65696507 );
6508+}
6509+STACK_FRAME_NON_STANDARD(__vmx_vcpu_run);
6510+
6511+static void vmx_vcpu_run(struct kvm_vcpu *vcpu)
6512+{
6513+ struct vcpu_vmx *vmx = to_vmx(vcpu);
6514+ unsigned long cr3, cr4;
6515+
6516+ /* Record the guest's net vcpu time for enforced NMI injections. */
6517+ if (unlikely(!enable_vnmi &&
6518+ vmx->loaded_vmcs->soft_vnmi_blocked))
6519+ vmx->loaded_vmcs->entry_time = ktime_get();
6520+
6521+ /* Don't enter VMX if guest state is invalid, let the exit handler
6522+ start emulation until we arrive back to a valid state */
6523+ if (vmx->emulation_required)
6524+ return;
6525+
6526+ if (vmx->ple_window_dirty) {
6527+ vmx->ple_window_dirty = false;
6528+ vmcs_write32(PLE_WINDOW, vmx->ple_window);
6529+ }
6530+
6531+ if (vmx->nested.need_vmcs12_sync)
6532+ nested_sync_from_vmcs12(vcpu);
6533+
6534+ if (test_bit(VCPU_REGS_RSP, (unsigned long *)&vcpu->arch.regs_dirty))
6535+ vmcs_writel(GUEST_RSP, vcpu->arch.regs[VCPU_REGS_RSP]);
6536+ if (test_bit(VCPU_REGS_RIP, (unsigned long *)&vcpu->arch.regs_dirty))
6537+ vmcs_writel(GUEST_RIP, vcpu->arch.regs[VCPU_REGS_RIP]);
6538+
6539+ cr3 = __get_current_cr3_fast();
6540+ if (unlikely(cr3 != vmx->loaded_vmcs->host_state.cr3)) {
6541+ vmcs_writel(HOST_CR3, cr3);
6542+ vmx->loaded_vmcs->host_state.cr3 = cr3;
6543+ }
6544+
6545+ cr4 = cr4_read_shadow();
6546+ if (unlikely(cr4 != vmx->loaded_vmcs->host_state.cr4)) {
6547+ vmcs_writel(HOST_CR4, cr4);
6548+ vmx->loaded_vmcs->host_state.cr4 = cr4;
6549+ }
6550+
6551+ /* When single-stepping over STI and MOV SS, we must clear the
6552+ * corresponding interruptibility bits in the guest state. Otherwise
6553+ * vmentry fails as it then expects bit 14 (BS) in pending debug
6554+ * exceptions being set, but that's not correct for the guest debugging
6555+ * case. */
6556+ if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
6557+ vmx_set_interrupt_shadow(vcpu, 0);
6558+
6559+ if (static_cpu_has(X86_FEATURE_PKU) &&
6560+ kvm_read_cr4_bits(vcpu, X86_CR4_PKE) &&
6561+ vcpu->arch.pkru != vmx->host_pkru)
6562+ __write_pkru(vcpu->arch.pkru);
6563+
6564+ pt_guest_enter(vmx);
6565+
6566+ atomic_switch_perf_msrs(vmx);
6567+
6568+ vmx_update_hv_timer(vcpu);
6569+
6570+ /*
6571+ * If this vCPU has touched SPEC_CTRL, restore the guest's value if
6572+ * it's non-zero. Since vmentry is serialising on affected CPUs, there
6573+ * is no need to worry about the conditional branch over the wrmsr
6574+ * being speculatively taken.
6575+ */
6576+ x86_spec_ctrl_set_guest(vmx->spec_ctrl, 0);
6577+
6578+ __vmx_vcpu_run(vcpu, vmx);
65706579
65716580 /*
65726581 * We do not use IBRS in the kernel. If this vCPU has used the
@@ -6648,7 +6657,6 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu) · 75 unmodified lines
66486657 vmx_recover_nmi_blocking(vmx);
66496658 vmx_complete_interrupts(vmx);
66506659 }
6651−STACK_FRAME_NON_STANDARD(vmx_vcpu_run);
66526660
66536661 static struct kvm *vmx_vm_alloc(void)
66546662 {
@@ -6816,7 +6824,7 @@ static int vmx_vm_init(struct kvm *kvm) · 161 unmodified lines
68166824 * Warn upon starting the first VM in a potentially
68176825 * insecure environment.
68186826 */
6819− if (cpu_smt_control == CPU_SMT_ENABLED)
6827+ if (sched_smt_active())
68206828 pr_warn_once(L1TF_MSG_SMT);
68216829 if (l1tf_vmx_mitigation == VMENTER_L1D_FLUSH_NEVER)
68226830 pr_warn_once(L1TF_MSG_L1D);
@@ -7044,7 +7052,7 @@ static void update_intel_pt_cfg(struct kvm_vcpu *vcpu) · 221 unmodified lines
70447052
70457053 /* unmask address range configure area */
70467054 for (i = 0; i < vmx->pt_desc.addr_range; i++)
7047− vmx->pt_desc.ctl_bitmask &= ~(0xf << (32 + i * 4));
7055+ vmx->pt_desc.ctl_bitmask &= ~(0xfULL << (32 + i * 4));
70487056 }
70497057
70507058 static void vmx_cpuid_update(struct kvm_vcpu *vcpu)
arch/x86/kvm/x86.c+12−3
@@ -3834,6 +3834,8 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu, · 3833 unmodified lines
38343834 case KVM_CAP_HYPERV_SYNIC2:
38353835 if (cap->args[0])
38363836 return -EINVAL;
3837+ /* fall through */
3838+
38373839 case KVM_CAP_HYPERV_SYNIC:
38383840 if (!irqchip_in_kernel(vcpu->kvm))
38393841 return -EINVAL;
@@ -5114,6 +5116,13 @@ int kvm_read_guest_virt(struct kvm_vcpu *vcpu, · 1274 unmodified lines
51145116 {
51155117 u32 access = (kvm_x86_ops->get_cpl(vcpu) == 3) ? PFERR_USER_MASK : 0;
51165118
5119+ /*
5120+ * FIXME: this should call handle_emulation_failure if X86EMUL_IO_NEEDED
5121+ * is returned, but our callers are not ready for that and they blindly
5122+ * call kvm_inject_page_fault. Ensure that they at least do not leak
5123+ * uninitialized kernel stack memory into cr2 and error code.
5124+ */
5125+ memset(exception, 0, sizeof(*exception));
51175126 return kvm_read_guest_virt_helper(addr, val, bytes, vcpu, access,
51185127 exception);
51195128 }
@@ -6480,8 +6489,7 @@ restart: · 1360 unmodified lines
64806489 toggle_interruptibility(vcpu, ctxt->interruptibility);
64816490 vcpu->arch.emulate_regs_need_sync_to_vcpu = false;
64826491 kvm_rip_write(vcpu, ctxt->eip);
6483− if (r == EMULATE_DONE &&
6484− (ctxt->tf || (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)))
6492+ if (r == EMULATE_DONE && ctxt->tf)
64856493 kvm_vcpu_do_singlestep(vcpu, &r);
64866494 if (!ctxt->have_exception ||
64876495 exception_type(ctxt->exception.vector) == EXCPT_TRAP)
@@ -7093,10 +7101,10 @@ int kvm_emulate_hypercall(struct kvm_vcpu *vcpu) · 605 unmodified lines
70937101 case KVM_HC_CLOCK_PAIRING:
70947102 ret = kvm_pv_clock_pairing(vcpu, a0, a1);
70957103 break;
7104+#endif
70967105 case KVM_HC_SEND_IPI:
70977106 ret = kvm_pv_send_ipi(vcpu->kvm, a0, a1, a2, a3, op_64_bit);
70987107 break;
7099−#endif
71007108 default:
71017109 ret = -KVM_ENOSYS;
71027110 break;
@@ -7937,6 +7945,7 @@ static inline int vcpu_block(struct kvm *kvm, struct kvm_vcpu *vcpu) · 834 unmodified lines
79377945 vcpu->arch.pv.pv_unhalted = false;
79387946 vcpu->arch.mp_state =
79397947 KVM_MP_STATE_RUNNABLE;
7948+ /* fall through */
79407949 case KVM_MP_STATE_RUNNABLE:
79417950 vcpu->arch.apf.halted = false;
79427951 break;
arch/x86/lib/iomem.c+30−3
@@ -2,8 +2,11 @@ · 1 unmodified line
22 #include <linux/module.h>
33 #include <linux/io.h>
44
5+#define movs(type,to,from) \
6+ asm volatile("movs" type:"=&D" (to), "=&S" (from):"0" (to), "1" (from):"memory")
7+
58 /* Originally from i386/string.h */
6−static __always_inline void __iomem_memcpy(void *to, const void *from, size_t n)
9+static __always_inline void rep_movs(void *to, const void *from, size_t n)
710 {
811 unsigned long d0, d1, d2;
912 asm volatile("rep ; movsl\n\t"
@@ -21,13 +24,37 @@ static __always_inline void __iomem_memcpy(void *to, const void *from, size_t n) · 11 unmodified lines
2124
2225 void memcpy_fromio(void *to, const volatile void __iomem *from, size_t n)
2326 {
24− __iomem_memcpy(to, (const void *)from, n);
27+ if (unlikely(!n))
28+ return;
29+
30+ /* Align any unaligned source IO */
31+ if (unlikely(1 & (unsigned long)from)) {
32+ movs("b", to, from);
33+ n--;
34+ }
35+ if (n > 1 && unlikely(2 & (unsigned long)from)) {
36+ movs("w", to, from);
37+ n-=2;
38+ }
39+ rep_movs(to, (const void *)from, n);
2540 }
2641 EXPORT_SYMBOL(memcpy_fromio);
2742
2843 void memcpy_toio(volatile void __iomem *to, const void *from, size_t n)
2944 {
30− __iomem_memcpy((void *)to, (const void *) from, n);
45+ if (unlikely(!n))
46+ return;
47+
48+ /* Align any unaligned destination IO */
49+ if (unlikely(1 & (unsigned long)to)) {
50+ movs("b", to, from);
51+ n--;
52+ }
53+ if (n > 1 && unlikely(2 & (unsigned long)to)) {
54+ movs("w", to, from);
55+ n-=2;
56+ }
57+ rep_movs((void *)to, (const void *) from, n);
3158 }
3259 EXPORT_SYMBOL(memcpy_toio);
3360
arch/x86/lib/kaslr.c+2−2
@@ -36,8 +36,8 @@ static inline u16 i8254(void) · 35 unmodified lines
3636 u16 status, timer;
3737
3838 do {
39− outb(I8254_PORT_CONTROL,
40− I8254_CMD_READBACK | I8254_SELECT_COUNTER0);
39+ outb(I8254_CMD_READBACK | I8254_SELECT_COUNTER0,
40+ I8254_PORT_CONTROL);
4141 status = inb(I8254_PORT_COUNTER0);
4242 timer = inb(I8254_PORT_COUNTER0);
4343 timer |= inb(I8254_PORT_COUNTER0) << 8;
arch/x86/mm/fault.c+1−1
@@ -595,7 +595,7 @@ static void show_ldttss(const struct desc_ptr *gdt, const char *name, u16 index) · 594 unmodified lines
595595 return;
596596 }
597597
598− addr = desc.base0 | (desc.base1 << 16) | (desc.base2 << 24);
598+ addr = desc.base0 | (desc.base1 << 16) | ((unsigned long)desc.base2 << 24);
599599 #ifdef CONFIG_X86_64
600600 addr |= ((u64)desc.base3 << 32);
601601 #endif
arch/x86/mm/mem_encrypt_identity.c+2−2
@@ -158,8 +158,8 @@ static void __init sme_populate_pgd(struct sme_populate_pgd_data *ppd) · 157 unmodified lines
158158 pmd = pmd_offset(pud, ppd->vaddr);
159159 if (pmd_none(*pmd)) {
160160 pte = ppd->pgtable_area;
161− memset(pte, 0, sizeof(pte) * PTRS_PER_PTE);
162− ppd->pgtable_area += sizeof(pte) * PTRS_PER_PTE;
161+ memset(pte, 0, sizeof(*pte) * PTRS_PER_PTE);
162+ ppd->pgtable_area += sizeof(*pte) * PTRS_PER_PTE;
163163 set_pmd(pmd, __pmd(PMD_FLAGS | __pa(pte)));
164164 }
165165
arch/x86/mm/pageattr.c+25−25
@@ -230,6 +230,29 @@ static bool __cpa_pfn_in_highmap(unsigned long pfn) · 229 unmodified lines
230230
231231 #endif
232232
233+/*
234+ * See set_mce_nospec().
235+ *
236+ * Machine check recovery code needs to change cache mode of poisoned pages to
237+ * UC to avoid speculative access logging another error. But passing the
238+ * address of the 1:1 mapping to set_memory_uc() is a fine way to encourage a
239+ * speculative access. So we cheat and flip the top bit of the address. This
240+ * works fine for the code that updates the page tables. But at the end of the
241+ * process we need to flush the TLB and cache and the non-canonical address
242+ * causes a #GP fault when used by the INVLPG and CLFLUSH instructions.
243+ *
244+ * But in the common case we already have a canonical address. This code
245+ * will fix the top bit if needed and is a no-op otherwise.
246+ */
247+static inline unsigned long fix_addr(unsigned long addr)
248+{
249+#ifdef CONFIG_X86_64
250+ return (long)(addr << 1) >> 1;
251+#else
252+ return addr;
253+#endif
254+}
255+
233256 static unsigned long __cpa_addr(struct cpa_data *cpa, unsigned long idx)
234257 {
235258 if (cpa->flags & CPA_PAGES_ARRAY) {
@@ -313,7 +336,7 @@ void __cpa_flush_tlb(void *data) · 77 unmodified lines
313336 unsigned int i;
314337
315338 for (i = 0; i < cpa->numpages; i++)
316− __flush_tlb_one_kernel(__cpa_addr(cpa, i));
339+ __flush_tlb_one_kernel(fix_addr(__cpa_addr(cpa, i)));
317340 }
318341
319342 static void cpa_flush(struct cpa_data *data, int cache)
@@ -347,7 +370,7 @@ static void cpa_flush(struct cpa_data *data, int cache) · 27 unmodified lines
347370 * Only flush present addresses:
348371 */
349372 if (pte && (pte_val(*pte) & _PAGE_PRESENT))
350− clflush_cache_range_opt((void *)addr, PAGE_SIZE);
373+ clflush_cache_range_opt((void *)fix_addr(addr), PAGE_SIZE);
351374 }
352375 mb();
353376 }
@@ -1627,29 +1650,6 @@ out: · 1273 unmodified lines
16271650 return ret;
16281651 }
16291652
1630−/*
1631− * Machine check recovery code needs to change cache mode of poisoned
1632− * pages to UC to avoid speculative access logging another error. But
1633− * passing the address of the 1:1 mapping to set_memory_uc() is a fine
1634− * way to encourage a speculative access. So we cheat and flip the top
1635− * bit of the address. This works fine for the code that updates the
1636− * page tables. But at the end of the process we need to flush the cache
1637− * and the non-canonical address causes a #GP fault when used by the
1638− * CLFLUSH instruction.
1639− *
1640− * But in the common case we already have a canonical address. This code
1641− * will fix the top bit if needed and is a no-op otherwise.
1642− */
1643−static inline unsigned long make_addr_canonical_again(unsigned long addr)
1644−{
1645−#ifdef CONFIG_X86_64
1646− return (long)(addr << 1) >> 1;
1647−#else
1648− return addr;
1649−#endif
1650−}
1651−
1652−
16531653 static int change_page_attr_set_clr(unsigned long *addr, int numpages,
16541654 pgprot_t mask_set, pgprot_t mask_clr,
16551655 int force_split, int in_flag,
arch/x86/xen/enlighten_pv.c+1−4
@@ -898,10 +898,7 @@ static u64 xen_read_msr_safe(unsigned int msr, int *err) · 897 unmodified lines
898898 val = native_read_msr_safe(msr, err);
899899 switch (msr) {
900900 case MSR_IA32_APICBASE:
901−#ifdef CONFIG_X86_X2APIC
902− if (!(cpuid_ecx(1) & (1 << (X86_FEATURE_X2APIC & 31))))
903−#endif
904− val &= ~X2APIC_ENABLE;
901+ val &= ~X2APIC_ENABLE;
905902 break;
906903 }
907904 return val;
arch/x86/xen/time.c+9−3
@@ -361,8 +361,6 @@ void xen_timer_resume(void) · 360 unmodified lines
361361 {
362362 int cpu;
363363
364− pvclock_resume();
365−
366364 if (xen_clockevent != &xen_vcpuop_clockevent)
367365 return;
368366
@@ -379,12 +377,15 @@ static const struct pv_time_ops xen_time_ops __initconst = { · 10 unmodified lines
379377 };
380378
381379 static struct pvclock_vsyscall_time_info *xen_clock __read_mostly;
380+static u64 xen_clock_value_saved;
382381
383382 void xen_save_time_memory_area(void)
384383 {
385384 struct vcpu_register_time_memory_area t;
386385 int ret;
387386
387+ xen_clock_value_saved = xen_clocksource_read() - xen_sched_clock_offset;
388+
388389 if (!xen_clock)
389390 return;
390391
@@ -404,7 +405,7 @@ void xen_restore_time_memory_area(void) · 13 unmodified lines
404405 int ret;
405406
406407 if (!xen_clock)
407− return;
408+ goto out;
408409
409410 t.addr.v = &xen_clock->pvti;
410411
@@ -421,6 +422,11 @@ void xen_restore_time_memory_area(void) · 10 unmodified lines
421422 if (ret != 0)
422423 pr_notice("Cannot restore secondary vcpu_time_info (err %d)",
423424 ret);
425+
426+out:
427+ /* Need pvclock_resume() before using xen_clocksource_read(). */
428+ pvclock_resume();
429+ xen_sched_clock_offset = xen_clocksource_read() - xen_clock_value_saved;
424430 }
425431
426432 static void xen_setup_vsyscall_time_info(void)
arch/xtensa/Kconfig+2−2
@@ -164,7 +164,7 @@ config XTENSA_FAKE_NMI · 163 unmodified lines
164164 If unsure, say N.
165165
166166 config XTENSA_UNALIGNED_USER
167− bool "Unaligned memory access in use space"
167+ bool "Unaligned memory access in user space"
168168 help
169169 The Xtensa architecture currently does not handle unaligned
170170 memory accesses in hardware but through an exception handler.
@@ -451,7 +451,7 @@ config USE_OF · 280 unmodified lines
451451 help
452452 Include support for flattened device tree machine descriptions.
453453
454−config BUILTIN_DTB
454+config BUILTIN_DTB_SOURCE
455455 string "DTB to build into the kernel image"
456456 depends on OF
457457
arch/xtensa/boot/dts/Makefile+3−3
@@ -7,9 +7,9 @@ · 6 unmodified lines
77 #
88 #
99
10−BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB)).dtb.o
11−ifneq ($(CONFIG_BUILTIN_DTB),"")
12−obj-$(CONFIG_OF) += $(BUILTIN_DTB)
10+BUILTIN_DTB_SOURCE := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_SOURCE)).dtb.o
11+ifneq ($(CONFIG_BUILTIN_DTB_SOURCE),"")
12+obj-$(CONFIG_OF) += $(BUILTIN_DTB_SOURCE)
1313 endif
1414
1515 # for CONFIG_OF_ALL_DTBS test
arch/xtensa/configs/audio_kc705_defconfig+1−1
@@ -34,7 +34,7 @@ CONFIG_XTENSA_PLATFORM_XTFPGA=y · 33 unmodified lines
3434 CONFIG_CMDLINE_BOOL=y
3535 CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x38000000@0"
3636 CONFIG_USE_OF=y
37−CONFIG_BUILTIN_DTB="kc705"
37+CONFIG_BUILTIN_DTB_SOURCE="kc705"
3838 # CONFIG_COMPACTION is not set
3939 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
4040 CONFIG_PM=y
arch/xtensa/configs/cadence_csp_defconfig+1−1
@@ -38,7 +38,7 @@ CONFIG_HIGHMEM=y · 37 unmodified lines
3838 # CONFIG_PCI is not set
3939 CONFIG_XTENSA_PLATFORM_XTFPGA=y
4040 CONFIG_USE_OF=y
41−CONFIG_BUILTIN_DTB="csp"
41+CONFIG_BUILTIN_DTB_SOURCE="csp"
4242 # CONFIG_COMPACTION is not set
4343 CONFIG_XTFPGA_LCD=y
4444 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
arch/xtensa/configs/generic_kc705_defconfig+1−1
@@ -33,7 +33,7 @@ CONFIG_XTENSA_PLATFORM_XTFPGA=y · 32 unmodified lines
3333 CONFIG_CMDLINE_BOOL=y
3434 CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x38000000@0"
3535 CONFIG_USE_OF=y
36−CONFIG_BUILTIN_DTB="kc705"
36+CONFIG_BUILTIN_DTB_SOURCE="kc705"
3737 # CONFIG_COMPACTION is not set
3838 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
3939 CONFIG_NET=y
arch/xtensa/configs/nommu_kc705_defconfig+1−1
@@ -39,7 +39,7 @@ CONFIG_XTENSA_PLATFORM_XTFPGA=y · 38 unmodified lines
3939 CONFIG_CMDLINE_BOOL=y
4040 CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0x9d050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=256M@0x60000000"
4141 CONFIG_USE_OF=y
42−CONFIG_BUILTIN_DTB="kc705_nommu"
42+CONFIG_BUILTIN_DTB_SOURCE="kc705_nommu"
4343 CONFIG_BINFMT_FLAT=y
4444 CONFIG_NET=y
4545 CONFIG_PACKET=y
arch/xtensa/configs/smp_lx200_defconfig+2−1
@@ -33,11 +33,12 @@ CONFIG_SMP=y · 32 unmodified lines
3333 CONFIG_HOTPLUG_CPU=y
3434 # CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX is not set
3535 # CONFIG_PCI is not set
36+CONFIG_VECTORS_OFFSET=0x00002000
3637 CONFIG_XTENSA_PLATFORM_XTFPGA=y
3738 CONFIG_CMDLINE_BOOL=y
3839 CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=96M@0"
3940 CONFIG_USE_OF=y
40−CONFIG_BUILTIN_DTB="lx200mx"
41+CONFIG_BUILTIN_DTB_SOURCE="lx200mx"
4142 # CONFIG_COMPACTION is not set
4243 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
4344 CONFIG_NET=y
arch/xtensa/kernel/head.S+4−1
@@ -276,12 +276,13 @@ should_never_return: · 275 unmodified lines
276276
277277 movi a2, cpu_start_ccount
278278 1:
279+ memw
279280 l32i a3, a2, 0
280281 beqi a3, 0, 1b
281282 movi a3, 0
282283 s32i a3, a2, 0
283− memw
284284 1:
285+ memw
285286 l32i a3, a2, 0
286287 beqi a3, 0, 1b
287288 wsr a3, ccount
@@ -317,11 +318,13 @@ ENTRY(cpu_restart) · 29 unmodified lines
317318 rsr a0, prid
318319 neg a2, a0
319320 movi a3, cpu_start_id
321+ memw
320322 s32i a2, a3, 0
321323 #if XCHAL_DCACHE_IS_WRITEBACK
322324 dhwbi a3, 0
323325 #endif
324326 1:
327+ memw
325328 l32i a2, a3, 0
326329 dhi a3, 0
327330 bne a2, a0, 1b
arch/xtensa/kernel/smp.c+27−14
@@ -83,7 +83,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) · 82 unmodified lines
8383 {
8484 unsigned i;
8585
86− for (i = 0; i < max_cpus; ++i)
86+ for_each_possible_cpu(i)
8787 set_cpu_present(i, true);
8888 }
8989
@@ -96,6 +96,11 @@ void __init smp_init_cpus(void) · 6 unmodified lines
9696 pr_info("%s: Core Count = %d\n", __func__, ncpus);
9797 pr_info("%s: Core Id = %d\n", __func__, core_id);
9898
99+ if (ncpus > NR_CPUS) {
100+ ncpus = NR_CPUS;
101+ pr_info("%s: limiting core count by %d\n", __func__, ncpus);
102+ }
103+
99104 for (i = 0; i < ncpus; ++i)
100105 set_cpu_possible(i, true);
101106 }
@@ -195,9 +200,11 @@ static int boot_secondary(unsigned int cpu, struct task_struct *ts) · 93 unmodified lines
195200 int i;
196201
197202 #ifdef CONFIG_HOTPLUG_CPU
198− cpu_start_id = cpu;
199− system_flush_invalidate_dcache_range(
200− (unsigned long)&cpu_start_id, sizeof(cpu_start_id));
203+ WRITE_ONCE(cpu_start_id, cpu);
204+ /* Pairs with the third memw in the cpu_restart */
205+ mb();
206+ system_flush_invalidate_dcache_range((unsigned long)&cpu_start_id,
207+ sizeof(cpu_start_id));
201208 #endif
202209 smp_call_function_single(0, mx_cpu_start, (void *)cpu, 1);
203210
@@ -206,18 +213,21 @@ static int boot_secondary(unsigned int cpu, struct task_struct *ts) · 2 unmodified lines
206213 ccount = get_ccount();
207214 while (!ccount);
208215
209− cpu_start_ccount = ccount;
216+ WRITE_ONCE(cpu_start_ccount, ccount);
210217
211− while (time_before(jiffies, timeout)) {
218+ do {
219+ /*
220+ * Pairs with the first two memws in the
221+ * .Lboot_secondary.
222+ */
212223 mb();
213− if (!cpu_start_ccount)
214− break;
215− }
224+ ccount = READ_ONCE(cpu_start_ccount);
225+ } while (ccount && time_before(jiffies, timeout));
216226
217− if (cpu_start_ccount) {
227+ if (ccount) {
218228 smp_call_function_single(0, mx_cpu_stop,
219− (void *)cpu, 1);
220− cpu_start_ccount = 0;
229+ (void *)cpu, 1);
230+ WRITE_ONCE(cpu_start_ccount, 0);
221231 return -EIO;
222232 }
223233 }
@@ -237,6 +247,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) · 13 unmodified lines
237247 pr_debug("%s: Calling wakeup_secondary(cpu:%d, idle:%p, sp: %08lx)\n",
238248 __func__, cpu, idle, start_info.stack);
239249
250+ init_completion(&cpu_running);
240251 ret = boot_secondary(cpu, idle);
241252 if (ret == 0) {
242253 wait_for_completion_timeout(&cpu_running,
@@ -298,8 +309,10 @@ void __cpu_die(unsigned int cpu) · 55 unmodified lines
298309 unsigned long timeout = jiffies + msecs_to_jiffies(1000);
299310 while (time_before(jiffies, timeout)) {
300311 system_invalidate_dcache_range((unsigned long)&cpu_start_id,
301− sizeof(cpu_start_id));
302− if (cpu_start_id == -cpu) {
312+ sizeof(cpu_start_id));
313+ /* Pairs with the second memw in the cpu_restart */
314+ mb();
315+ if (READ_ONCE(cpu_start_id) == -cpu) {
303316 platform_cpu_kill(cpu);
304317 return;
305318 }
arch/xtensa/kernel/time.c+1−1
@@ -89,7 +89,7 @@ static int ccount_timer_shutdown(struct clock_event_device *evt) · 88 unmodified lines
8989 container_of(evt, struct ccount_timer, evt);
9090
9191 if (timer->irq_enabled) {
92− disable_irq(evt->irq);
92+ disable_irq_nosync(evt->irq);
9393 timer->irq_enabled = 0;
9494 }
9595 return 0;
block/bfq-wf2q.c+5−6
@@ -1154,15 +1154,14 @@ static void bfq_activate_requeue_entity(struct bfq_entity *entity, · 1153 unmodified lines
11541154 }
11551155
11561156 /**
1157− * __bfq_deactivate_entity - deactivate an entity from its service tree.
1158− * @entity: the entity to deactivate.
1157+ * __bfq_deactivate_entity - update sched_data and service trees for
1158+ * entity, so as to represent entity as inactive
1159+ * @entity: the entity being deactivated.
11591160 * @ins_into_idle_tree: if false, the entity will not be put into the
11601161 * idle tree.
11611162 *
1162− * Deactivates an entity, independently of its previous state. Must
1163− * be invoked only if entity is on a service tree. Extracts the entity
1164− * from that tree, and if necessary and allowed, puts it into the idle
1165− * tree.
1163+ * If necessary and allowed, puts entity into the idle tree. NOTE:
1164+ * entity may be on no tree if in service.
11661165 */
11671166 bool __bfq_deactivate_entity(struct bfq_entity *entity, bool ins_into_idle_tree)
11681167 {
block/blk-core.c+24−2
@@ -462,6 +462,10 @@ static void blk_rq_timed_out_timer(struct timer_list *t) · 461 unmodified lines
462462 kblockd_schedule_work(&q->timeout_work);
463463 }
464464
465+static void blk_timeout_work(struct work_struct *work)
466+{
467+}
468+
465469 /**
466470 * blk_alloc_queue_node - allocate a request queue
467471 * @gfp_mask: memory allocation flags
@@ -505,7 +509,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) · 37 unmodified lines
505509 timer_setup(&q->backing_dev_info->laptop_mode_wb_timer,
506510 laptop_mode_timer_fn, 0);
507511 timer_setup(&q->timeout, blk_rq_timed_out_timer, 0);
508− INIT_WORK(&q->timeout_work, NULL);
512+ INIT_WORK(&q->timeout_work, blk_timeout_work);
509513 INIT_LIST_HEAD(&q->icq_list);
510514 #ifdef CONFIG_BLK_CGROUP
511515 INIT_LIST_HEAD(&q->blkg_list);
@@ -661,7 +665,6 @@ no_merge: · 149 unmodified lines
661665 * blk_attempt_plug_merge - try to merge with %current's plugged list
662666 * @q: request_queue new bio is being queued at
663667 * @bio: new bio being queued
664− * @request_count: out parameter for number of traversed plugged requests
665668 * @same_queue_rq: pointer to &struct request that gets filled in when
666669 * another request associated with @q is found on the plug list
667670 * (optional, may be %NULL)
@@ -1683,6 +1686,15 @@ EXPORT_SYMBOL(kblockd_mod_delayed_work_on); · 1015 unmodified lines
16831686 * @plug: The &struct blk_plug that needs to be initialized
16841687 *
16851688 * Description:
1689+ * blk_start_plug() indicates to the block layer an intent by the caller
1690+ * to submit multiple I/O requests in a batch. The block layer may use
1691+ * this hint to defer submitting I/Os from the caller until blk_finish_plug()
1692+ * is called. However, the block layer may choose to submit requests
1693+ * before a call to blk_finish_plug() if the number of queued I/Os
1694+ * exceeds %BLK_MAX_REQUEST_COUNT, or if the size of the I/O is larger than
1695+ * %BLK_PLUG_FLUSH_SIZE. The queued I/Os may also be submitted early if
1696+ * the task schedules (see below).
1697+ *
16861698 * Tracking blk_plug inside the task_struct will help with auto-flushing the
16871699 * pending I/O should the task end up blocking between blk_start_plug() and
16881700 * blk_finish_plug(). This is important from a performance perspective, but
@@ -1765,6 +1777,16 @@ void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule) · 76 unmodified lines
17651777 blk_mq_flush_plug_list(plug, from_schedule);
17661778 }
17671779
1780+/**
1781+ * blk_finish_plug - mark the end of a batch of submitted I/O
1782+ * @plug: The &struct blk_plug passed to blk_start_plug()
1783+ *
1784+ * Description:
1785+ * Indicate that a batch of I/O submissions is complete. This function
1786+ * must be paired with an initial call to blk_start_plug(). The intent
1787+ * is to allow the block layer to optimize I/O submission. See the
1788+ * documentation for blk_start_plug() for more information.
1789+ */
17681790 void blk_finish_plug(struct blk_plug *plug)
17691791 {
17701792 if (plug != current->plug)
block/blk-flush.c+1−1
@@ -335,7 +335,7 @@ static void mq_flush_data_end_io(struct request *rq, blk_status_t error) · 334 unmodified lines
335335 blk_flush_complete_seq(rq, fq, REQ_FSEQ_DATA, error);
336336 spin_unlock_irqrestore(&fq->mq_flush_lock, flags);
337337
338− blk_mq_run_hw_queue(hctx, true);
338+ blk_mq_sched_restart(hctx);
339339 }
340340
341341 /**
block/blk-iolatency.c+48−8
@@ -72,6 +72,7 @@ · 71 unmodified lines
7272 #include <linux/sched/loadavg.h>
7373 #include <linux/sched/signal.h>
7474 #include <trace/events/block.h>
75+#include <linux/blk-mq.h>
7576 #include "blk-rq-qos.h"
7677 #include "blk-stat.h"
7778
@@ -591,6 +592,7 @@ static void blkcg_iolatency_done_bio(struct rq_qos *rqos, struct bio *bio) · 513 unmodified lines
591592 u64 now = ktime_to_ns(ktime_get());
592593 bool issue_as_root = bio_issue_as_root_blkg(bio);
593594 bool enabled = false;
595+ int inflight = 0;
594596
595597 blkg = bio->bi_blkg;
596598 if (!blkg || !bio_flagged(bio, BIO_TRACKED))
@@ -601,6 +603,9 @@ static void blkcg_iolatency_done_bio(struct rq_qos *rqos, struct bio *bio) · 4 unmodified lines
601603 return;
602604
603605 enabled = blk_iolatency_enabled(iolat->blkiolat);
606+ if (!enabled)
607+ return;
608+
604609 while (blkg && blkg->parent) {
605610 iolat = blkg_to_lat(blkg);
606611 if (!iolat) {
@@ -609,8 +614,9 @@ static void blkcg_iolatency_done_bio(struct rq_qos *rqos, struct bio *bio) · 2 unmodified lines
609614 }
610615 rqw = &iolat->rq_wait;
611616
612− atomic_dec(&rqw->inflight);
613− if (!enabled || iolat->min_lat_nsec == 0)
617+ inflight = atomic_dec_return(&rqw->inflight);
618+ WARN_ON_ONCE(inflight < 0);
619+ if (iolat->min_lat_nsec == 0)
614620 goto next;
615621 iolatency_record_time(iolat, &bio->bi_issue, now,
616622 issue_as_root);
@@ -754,10 +760,13 @@ int blk_iolatency_init(struct request_queue *q) · 137 unmodified lines
754760 return 0;
755761 }
756762
757−static void iolatency_set_min_lat_nsec(struct blkcg_gq *blkg, u64 val)
763+/*
764+ * return 1 for enabling iolatency, return -1 for disabling iolatency, otherwise
765+ * return 0.
766+ */
767+static int iolatency_set_min_lat_nsec(struct blkcg_gq *blkg, u64 val)
758768 {
759769 struct iolatency_grp *iolat = blkg_to_lat(blkg);
760− struct blk_iolatency *blkiolat = iolat->blkiolat;
761770 u64 oldval = iolat->min_lat_nsec;
762771
763772 iolat->min_lat_nsec = val;
@@ -766,9 +775,10 @@ static void iolatency_set_min_lat_nsec(struct blkcg_gq *blkg, u64 val) · 2 unmodified lines
766775 BLKIOLATENCY_MAX_WIN_SIZE);
767776
768777 if (!oldval && val)
769− atomic_inc(&blkiolat->enabled);
778+ return 1;
770779 if (oldval && !val)
771− atomic_dec(&blkiolat->enabled);
780+ return -1;
781+ return 0;
772782 }
773783
774784 static void iolatency_clear_scaling(struct blkcg_gq *blkg)
@@ -800,6 +810,7 @@ static ssize_t iolatency_set_limit(struct kernfs_open_file *of, char *buf, · 25 unmodified lines
800810 u64 lat_val = 0;
801811 u64 oldval;
802812 int ret;
813+ int enable = 0;
803814
804815 ret = blkg_conf_prep(blkcg, &blkcg_policy_iolatency, buf, &ctx);
805816 if (ret)
@@ -834,7 +845,12 @@ static ssize_t iolatency_set_limit(struct kernfs_open_file *of, char *buf, · 28 unmodified lines
834845 blkg = ctx.blkg;
835846 oldval = iolat->min_lat_nsec;
836847
837− iolatency_set_min_lat_nsec(blkg, lat_val);
848+ enable = iolatency_set_min_lat_nsec(blkg, lat_val);
849+ if (enable) {
850+ WARN_ON_ONCE(!blk_get_queue(blkg->q));
851+ blkg_get(blkg);
852+ }
853+
838854 if (oldval != iolat->min_lat_nsec) {
839855 iolatency_clear_scaling(blkg);
840856 }
@@ -842,6 +858,24 @@ static ssize_t iolatency_set_limit(struct kernfs_open_file *of, char *buf, · 1 unmodified line
842858 ret = 0;
843859 out:
844860 blkg_conf_finish(&ctx);
861+ if (ret == 0 && enable) {
862+ struct iolatency_grp *tmp = blkg_to_lat(blkg);
863+ struct blk_iolatency *blkiolat = tmp->blkiolat;
864+
865+ blk_mq_freeze_queue(blkg->q);
866+
867+ if (enable == 1)
868+ atomic_inc(&blkiolat->enabled);
869+ else if (enable == -1)
870+ atomic_dec(&blkiolat->enabled);
871+ else
872+ WARN_ON_ONCE(1);
873+
874+ blk_mq_unfreeze_queue(blkg->q);
875+
876+ blkg_put(blkg);
877+ blk_put_queue(blkg->q);
878+ }
845879 return ret ?: nbytes;
846880 }
847881
@@ -977,8 +1011,14 @@ static void iolatency_pd_offline(struct blkg_policy_data *pd) · 129 unmodified lines
9771011 {
9781012 struct iolatency_grp *iolat = pd_to_lat(pd);
9791013 struct blkcg_gq *blkg = lat_to_blkg(iolat);
1014+ struct blk_iolatency *blkiolat = iolat->blkiolat;
1015+ int ret;
9801016
981− iolatency_set_min_lat_nsec(blkg, 0);
1017+ ret = iolatency_set_min_lat_nsec(blkg, 0);
1018+ if (ret == 1)
1019+ atomic_inc(&blkiolat->enabled);
1020+ if (ret == -1)
1021+ atomic_dec(&blkiolat->enabled);
9821022 iolatency_clear_scaling(blkg);
9831023 }
9841024
block/blk-mq-debugfs-zoned.c+0−2
@@ -1,8 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0
22 /*
33 * Copyright (C) 2017 Western Digital Corporation or its affiliates.
4− *
5− * This file is released under the GPL.
64 */
75
86 #include <linux/blkdev.h>
block/blk-mq-debugfs.c+5−1
@@ -308,8 +308,9 @@ static const char *const cmd_flag_name[] = { · 307 unmodified lines
308308 CMD_FLAG_NAME(PREFLUSH),
309309 CMD_FLAG_NAME(RAHEAD),
310310 CMD_FLAG_NAME(BACKGROUND),
311− CMD_FLAG_NAME(NOUNMAP),
312311 CMD_FLAG_NAME(NOWAIT),
312+ CMD_FLAG_NAME(NOUNMAP),
313+ CMD_FLAG_NAME(HIPRI),
313314 };
314315 #undef CMD_FLAG_NAME
315316
@@ -838,6 +839,9 @@ static const struct blk_mq_debugfs_attr blk_mq_debugfs_ctx_attrs[] = { · 522 unmodified lines
838839 static bool debugfs_create_files(struct dentry *parent, void *data,
839840 const struct blk_mq_debugfs_attr *attr)
840841 {
842+ if (IS_ERR_OR_NULL(parent))
843+ return false;
844+
841845 d_inode(parent)->i_private = data;
842846
843847 for (; attr->name; attr++) {
block/blk-mq.c+2−1
@@ -1906,7 +1906,7 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) · 1905 unmodified lines
19061906 {
19071907 const int is_sync = op_is_sync(bio->bi_opf);
19081908 const int is_flush_fua = op_is_flush(bio->bi_opf);
1909− struct blk_mq_alloc_data data = { .flags = 0, .cmd_flags = bio->bi_opf };
1909+ struct blk_mq_alloc_data data = { .flags = 0};
19101910 struct request *rq;
19111911 struct blk_plug *plug;
19121912 struct request *same_queue_rq = NULL;
@@ -1928,6 +1928,7 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) · 15 unmodified lines
19281928
19291929 rq_qos_throttle(q, bio);
19301930
1931+ data.cmd_flags = bio->bi_opf;
19311932 rq = blk_mq_get_request(q, bio, &data);
19321933 if (unlikely(!rq)) {
19331934 rq_qos_cleanup(q, bio);
block/blk-mq.h+0−1
@@ -36,7 +36,6 @@ struct blk_mq_ctx { · 35 unmodified lines
3636 struct kobject kobj;
3737 } ____cacheline_aligned_in_smp;
3838
39−void blk_mq_freeze_queue(struct request_queue *q);
4039 void blk_mq_free_queue(struct request_queue *q);
4140 int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr);
4241 void blk_mq_wake_waiters(struct request_queue *q);
block/blk-wbt.c+2−2
@@ -597,7 +597,7 @@ static void wbt_track(struct rq_qos *rqos, struct request *rq, struct bio *bio) · 596 unmodified lines
597597 rq->wbt_flags |= bio_to_wbt_flags(rwb, bio);
598598 }
599599
600−void wbt_issue(struct rq_qos *rqos, struct request *rq)
600+static void wbt_issue(struct rq_qos *rqos, struct request *rq)
601601 {
602602 struct rq_wb *rwb = RQWB(rqos);
603603
@@ -617,7 +617,7 @@ void wbt_issue(struct rq_qos *rqos, struct request *rq) · 13 unmodified lines
617617 }
618618 }
619619
620−void wbt_requeue(struct rq_qos *rqos, struct request *rq)
620+static void wbt_requeue(struct rq_qos *rqos, struct request *rq)
621621 {
622622 struct rq_wb *rwb = RQWB(rqos);
623623 if (!rwb_enabled(rwb))
crypto/adiantum.c+4−0
@@ -539,6 +539,8 @@ static int adiantum_create(struct crypto_template *tmpl, struct rtattr **tb) · 538 unmodified lines
539539 ictx = skcipher_instance_ctx(inst);
540540
541541 /* Stream cipher, e.g. "xchacha12" */
542+ crypto_set_skcipher_spawn(&ictx->streamcipher_spawn,
543+ skcipher_crypto_instance(inst));
542544 err = crypto_grab_skcipher(&ictx->streamcipher_spawn, streamcipher_name,
543545 0, crypto_requires_sync(algt->type,
544546 algt->mask));
@@ -547,6 +549,8 @@ static int adiantum_create(struct crypto_template *tmpl, struct rtattr **tb) · 2 unmodified lines
547549 streamcipher_alg = crypto_spawn_skcipher_alg(&ictx->streamcipher_spawn);
548550
549551 /* Block cipher, e.g. "aes" */
552+ crypto_set_spawn(&ictx->blockcipher_spawn,
553+ skcipher_crypto_instance(inst));
550554 err = crypto_grab_spawn(&ictx->blockcipher_spawn, blockcipher_name,
551555 CRYPTO_ALG_TYPE_CIPHER, CRYPTO_ALG_TYPE_MASK);
552556 if (err)
crypto/authenc.c+11−3
@@ -58,14 +58,22 @@ int crypto_authenc_extractkeys(struct crypto_authenc_keys *keys, const u8 *key, · 57 unmodified lines
5858 return -EINVAL;
5959 if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM)
6060 return -EINVAL;
61− if (RTA_PAYLOAD(rta) < sizeof(*param))
61+
62+ /*
63+ * RTA_OK() didn't align the rtattr's payload when validating that it
64+ * fits in the buffer. Yet, the keys should start on the next 4-byte
65+ * aligned boundary. To avoid confusion, require that the rtattr
66+ * payload be exactly the param struct, which has a 4-byte aligned size.
67+ */
68+ if (RTA_PAYLOAD(rta) != sizeof(*param))
6269 return -EINVAL;
70+ BUILD_BUG_ON(sizeof(*param) % RTA_ALIGNTO);
6371
6472 param = RTA_DATA(rta);
6573 keys->enckeylen = be32_to_cpu(param->enckeylen);
6674
67− key += RTA_ALIGN(rta->rta_len);
68− keylen -= RTA_ALIGN(rta->rta_len);
75+ key += rta->rta_len;
76+ keylen -= rta->rta_len;
6977
7078 if (keylen < keys->enckeylen)
7179 return -EINVAL;
crypto/authencesn.c+1−1
@@ -279,7 +279,7 @@ static void authenc_esn_verify_ahash_done(struct crypto_async_request *areq, · 278 unmodified lines
279279 struct aead_request *req = areq->data;
280280
281281 err = err ?: crypto_authenc_esn_decrypt_tail(req, 0);
282− aead_request_complete(req, err);
282+ authenc_esn_request_complete(req, err);
283283 }
284284
285285 static int crypto_authenc_esn_decrypt(struct aead_request *req)
crypto/sm3_generic.c+1−1
@@ -100,7 +100,7 @@ static void sm3_compress(u32 *w, u32 *wt, u32 *m) · 99 unmodified lines
100100
101101 for (i = 0; i <= 63; i++) {
102102
103− ss1 = rol32((rol32(a, 12) + e + rol32(t(i), i)), 7);
103+ ss1 = rol32((rol32(a, 12) + e + rol32(t(i), i & 31)), 7);
104104
105105 ss2 = ss1 ^ rol32(a, 12);
106106
drivers/acpi/Kconfig+1−0
@@ -10,6 +10,7 @@ menuconfig ACPI · 9 unmodified lines
1010 bool "ACPI (Advanced Configuration and Power Interface) Support"
1111 depends on ARCH_SUPPORTS_ACPI
1212 select PNP
13+ select NLS
1314 default y if X86
1415 help
1516 Advanced Configuration and Power Interface (ACPI) support for
drivers/acpi/Makefile+2−1
@@ -41,7 +41,8 @@ acpi-y += ec.o · 40 unmodified lines
4141 acpi-$(CONFIG_ACPI_DOCK) += dock.o
4242 acpi-$(CONFIG_PCI) += pci_root.o pci_link.o pci_irq.o
4343 obj-$(CONFIG_ACPI_MCFG) += pci_mcfg.o
44−acpi-y += acpi_lpss.o acpi_apd.o
44+acpi-$(CONFIG_PCI) += acpi_lpss.o
45+acpi-y += acpi_apd.o
4546 acpi-y += acpi_platform.o
4647 acpi-y += acpi_pnp.o
4748 acpi-$(CONFIG_ARM_AMBA) += acpi_amba.o
drivers/acpi/arm64/iort.c+3−2
@@ -876,7 +876,7 @@ int iort_iommu_msi_get_resv_regions(struct device *dev, struct list_head *head) · 875 unmodified lines
876876 return (resv == its->its_count) ? resv : -ENODEV;
877877 }
878878 #else
879−static inline const struct iommu_ops *iort_fwspec_iommu_ops(struct device *dev);
879+static inline const struct iommu_ops *iort_fwspec_iommu_ops(struct device *dev)
880880 { return NULL; }
881881 static inline int iort_add_device_replay(const struct iommu_ops *ops,
882882 struct device *dev)
@@ -952,9 +952,10 @@ static int rc_dma_get_range(struct device *dev, u64 *size) · 69 unmodified lines
952952 {
953953 struct acpi_iort_node *node;
954954 struct acpi_iort_root_complex *rc;
955+ struct pci_bus *pbus = to_pci_dev(dev)->bus;
955956
956957 node = iort_scan_node(ACPI_IORT_NODE_PCI_ROOT_COMPLEX,
957− iort_match_node_callback, dev);
958+ iort_match_node_callback, &pbus->dev);
958959 if (!node || node->revision < 1)
959960 return -ENODEV;
960961
drivers/acpi/bus.c+15−12
@@ -1029,6 +1029,9 @@ void __init acpi_early_init(void) · 1028 unmodified lines
10291029
10301030 acpi_permanent_mmap = true;
10311031
1032+ /* Initialize debug output. Linux does not use ACPICA defaults */
1033+ acpi_dbg_level = ACPI_LV_INFO | ACPI_LV_REPAIR;
1034+
10321035 #ifdef CONFIG_X86
10331036 /*
10341037 * If the machine falls into the DMI check table,
@@ -1054,18 +1057,6 @@ void __init acpi_early_init(void) · 19 unmodified lines
10541057 goto error0;
10551058 }
10561059
1057− /*
1058− * ACPI 2.0 requires the EC driver to be loaded and work before
1059− * the EC device is found in the namespace (i.e. before
1060− * acpi_load_tables() is called).
1061− *
1062− * This is accomplished by looking for the ECDT table, and getting
1063− * the EC parameters out of that.
1064− *
1065− * Ignore the result. Not having an ECDT is not fatal.
1066− */
1067− status = acpi_ec_ecdt_probe();
1068−
10691060 #ifdef CONFIG_X86
10701061 if (!acpi_ioapic) {
10711062 /* compatible (0) means level (3) */
@@ -1142,6 +1133,18 @@ static int __init acpi_bus_init(void) · 70 unmodified lines
11421133 goto error1;
11431134 }
11441135
1136+ /*
1137+ * ACPI 2.0 requires the EC driver to be loaded and work before the EC
1138+ * device is found in the namespace.
1139+ *
1140+ * This is accomplished by looking for the ECDT table and getting the EC
1141+ * parameters out of that.
1142+ *
1143+ * Do that before calling acpi_initialize_objects() which may trigger EC
1144+ * address space accesses.
1145+ */
1146+ acpi_ec_ecdt_probe();
1147+
11451148 status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE);
11461149 if (ACPI_FAILURE(status)) {
11471150 printk(KERN_ERR PREFIX
drivers/acpi/internal.h+4−0
@@ -81,7 +81,11 @@ void acpi_debugfs_init(void); · 80 unmodified lines
8181 #else
8282 static inline void acpi_debugfs_init(void) { return; }
8383 #endif
84+#ifdef CONFIG_PCI
8485 void acpi_lpss_init(void);
86+#else
87+static inline void acpi_lpss_init(void) {}
88+#endif
8589
8690 void acpi_apd_init(void);
8791
drivers/acpi/nfit/core.c+54−32
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626 #include <acpi/nfit.h>
2727 #include "intel.h"
2828 #include "nfit.h"
29−#include "intel.h"
3029
3130 /*
3231 * For readq() and writeq() on 32-bit builds, the hi-lo, lo-hi order is
@@ -78,12 +77,6 @@ const guid_t *to_nfit_uuid(enum nfit_uuids id) · 45 unmodified lines
7877 }
7978 EXPORT_SYMBOL(to_nfit_uuid);
8079
81−static struct acpi_nfit_desc *to_acpi_nfit_desc(
82− struct nvdimm_bus_descriptor *nd_desc)
83−{
84− return container_of(nd_desc, struct acpi_nfit_desc, nd_desc);
85−}
86−
8780 static struct acpi_device *to_acpi_dev(struct acpi_nfit_desc *acpi_desc)
8881 {
8982 struct nvdimm_bus_descriptor *nd_desc = &acpi_desc->nd_desc;
@@ -416,10 +409,36 @@ static bool payload_dumpable(struct nvdimm *nvdimm, unsigned int func) · 326 unmodified lines
416409 return true;
417410 }
418411
412+static int cmd_to_func(struct nfit_mem *nfit_mem, unsigned int cmd,
413+ struct nd_cmd_pkg *call_pkg)
414+{
415+ if (call_pkg) {
416+ int i;
417+
418+ if (nfit_mem->family != call_pkg->nd_family)
419+ return -ENOTTY;
420+
421+ for (i = 0; i < ARRAY_SIZE(call_pkg->nd_reserved2); i++)
422+ if (call_pkg->nd_reserved2[i])
423+ return -EINVAL;
424+ return call_pkg->nd_command;
425+ }
426+
427+ /* Linux ND commands == NVDIMM_FAMILY_INTEL function numbers */
428+ if (nfit_mem->family == NVDIMM_FAMILY_INTEL)
429+ return cmd;
430+
431+ /*
432+ * Force function number validation to fail since 0 is never
433+ * published as a valid function in dsm_mask.
434+ */
435+ return 0;
436+}
437+
419438 int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
420439 unsigned int cmd, void *buf, unsigned int buf_len, int *cmd_rc)
421440 {
422− struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc);
441+ struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc);
423442 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm);
424443 union acpi_object in_obj, in_buf, *out_obj;
425444 const struct nd_cmd_desc *desc = NULL;
@@ -429,30 +448,23 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, · 3 unmodified lines
429448 unsigned long cmd_mask, dsm_mask;
430449 u32 offset, fw_status = 0;
431450 acpi_handle handle;
432− unsigned int func;
433451 const guid_t *guid;
434− int rc, i;
452+ int func, rc, i;
435453
436454 if (cmd_rc)
437455 *cmd_rc = -EINVAL;
438− func = cmd;
439− if (cmd == ND_CMD_CALL) {
440− call_pkg = buf;
441− func = call_pkg->nd_command;
442−
443− for (i = 0; i < ARRAY_SIZE(call_pkg->nd_reserved2); i++)
444− if (call_pkg->nd_reserved2[i])
445− return -EINVAL;
446− }
447456
448457 if (nvdimm) {
449458 struct acpi_device *adev = nfit_mem->adev;
450459
451460 if (!adev)
452461 return -ENOTTY;
453− if (call_pkg && nfit_mem->family != call_pkg->nd_family)
454− return -ENOTTY;
455462
463+ if (cmd == ND_CMD_CALL)
464+ call_pkg = buf;
465+ func = cmd_to_func(nfit_mem, cmd, call_pkg);
466+ if (func < 0)
467+ return func;
456468 dimm_name = nvdimm_name(nvdimm);
457469 cmd_name = nvdimm_cmd_name(cmd);
458470 cmd_mask = nvdimm_cmd_mask(nvdimm);
@@ -463,6 +475,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, · 4 unmodified lines
463475 } else {
464476 struct acpi_device *adev = to_acpi_dev(acpi_desc);
465477
478+ func = cmd;
466479 cmd_name = nvdimm_bus_cmd_name(cmd);
467480 cmd_mask = nd_desc->cmd_mask;
468481 dsm_mask = cmd_mask;
@@ -477,7 +490,13 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, · 8 unmodified lines
477490 if (!desc || (cmd && (desc->out_num + desc->in_num == 0)))
478491 return -ENOTTY;
479492
480− if (!test_bit(cmd, &cmd_mask) || !test_bit(func, &dsm_mask))
493+ /*
494+ * Check for a valid command. For ND_CMD_CALL, we also have to
495+ * make sure that the DSM function is supported.
496+ */
497+ if (cmd == ND_CMD_CALL && !test_bit(func, &dsm_mask))
498+ return -ENOTTY;
499+ else if (!test_bit(cmd, &cmd_mask))
481500 return -ENOTTY;
482501
483502 in_obj.type = ACPI_TYPE_PACKAGE;
@@ -721,6 +740,7 @@ int nfit_get_smbios_id(u32 device_handle, u16 *flags) · 237 unmodified lines
721740 struct acpi_nfit_memory_map *memdev;
722741 struct acpi_nfit_desc *acpi_desc;
723742 struct nfit_mem *nfit_mem;
743+ u16 physical_id;
724744
725745 mutex_lock(&acpi_desc_lock);
726746 list_for_each_entry(acpi_desc, &acpi_descs, list) {
@@ -728,10 +748,11 @@ int nfit_get_smbios_id(u32 device_handle, u16 *flags) · 1 unmodified line
728748 list_for_each_entry(nfit_mem, &acpi_desc->dimms, list) {
729749 memdev = __to_nfit_memdev(nfit_mem);
730750 if (memdev->device_handle == device_handle) {
751+ *flags = memdev->flags;
752+ physical_id = memdev->physical_id;
731753 mutex_unlock(&acpi_desc->init_mutex);
732754 mutex_unlock(&acpi_desc_lock);
733− *flags = memdev->flags;
734− return memdev->physical_id;
755+ return physical_id;
735756 }
736757 }
737758 mutex_unlock(&acpi_desc->init_mutex);
@@ -1872,6 +1893,13 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc, · 1134 unmodified lines
18721893 return 0;
18731894 }
18741895
1896+ /*
1897+ * Function 0 is the command interrogation function, don't
1898+ * export it to potential userspace use, and enable it to be
1899+ * used as an error value in acpi_nfit_ctl().
1900+ */
1901+ dsm_mask &= ~1UL;
1902+
18751903 guid = to_nfit_uuid(nfit_mem->family);
18761904 for_each_set_bit(i, &dsm_mask, BITS_PER_LONG)
18771905 if (acpi_check_dsm(adev_dimm->handle, guid,
@@ -2047,11 +2075,6 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc) · 169 unmodified lines
20472075 if (!nvdimm)
20482076 continue;
20492077
2050− rc = nvdimm_security_setup_events(nvdimm);
2051− if (rc < 0)
2052− dev_warn(acpi_desc->dev,
2053− "security event setup failed: %d\n", rc);
2054−
20552078 nfit_kernfs = sysfs_get_dirent(nvdimm_kobj(nvdimm)->sd, "nfit");
20562079 if (nfit_kernfs)
20572080 nfit_mem->flags_attr = sysfs_get_dirent(nfit_kernfs,
@@ -2231,7 +2254,6 @@ static int acpi_nfit_init_interleave_set(struct acpi_nfit_desc *acpi_desc, · 173 unmodified lines
22312254 nd_set = devm_kzalloc(dev, sizeof(*nd_set), GFP_KERNEL);
22322255 if (!nd_set)
22332256 return -ENOMEM;
2234− ndr_desc->nd_set = nd_set;
22352257 guid_copy(&nd_set->type_guid, (guid_t *) spa->range_guid);
22362258
22372259 info = devm_kzalloc(dev, sizeof_nfit_set_info(nr), GFP_KERNEL);
@@ -3367,7 +3389,7 @@ EXPORT_SYMBOL_GPL(acpi_nfit_init); · 1129 unmodified lines
33673389
33683390 static int acpi_nfit_flush_probe(struct nvdimm_bus_descriptor *nd_desc)
33693391 {
3370− struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc);
3392+ struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc);
33713393 struct device *dev = acpi_desc->dev;
33723394
33733395 /* Bounce the device lock to flush acpi_nfit_add / acpi_nfit_notify */
@@ -3384,7 +3406,7 @@ static int acpi_nfit_flush_probe(struct nvdimm_bus_descriptor *nd_desc) · 10 unmodified lines
33843406 static int __acpi_nfit_clear_to_send(struct nvdimm_bus_descriptor *nd_desc,
33853407 struct nvdimm *nvdimm, unsigned int cmd)
33863408 {
3387− struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc);
3409+ struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc);
33883410
33893411 if (nvdimm)
33903412 return 0;
drivers/acpi/nfit/intel.c+4−4
@@ -146,7 +146,7 @@ static int intel_security_change_key(struct nvdimm *nvdimm, · 145 unmodified lines
146146
147147 static void nvdimm_invalidate_cache(void);
148148
149−static int intel_security_unlock(struct nvdimm *nvdimm,
149+static int __maybe_unused intel_security_unlock(struct nvdimm *nvdimm,
150150 const struct nvdimm_key_data *key_data)
151151 {
152152 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm);
@@ -227,7 +227,7 @@ static int intel_security_disable(struct nvdimm *nvdimm, · 74 unmodified lines
227227 return 0;
228228 }
229229
230−static int intel_security_erase(struct nvdimm *nvdimm,
230+static int __maybe_unused intel_security_erase(struct nvdimm *nvdimm,
231231 const struct nvdimm_key_data *key,
232232 enum nvdimm_passphrase_type ptype)
233233 {
@@ -276,7 +276,7 @@ static int intel_security_erase(struct nvdimm *nvdimm, · 42 unmodified lines
276276 return 0;
277277 }
278278
279−static int intel_security_query_overwrite(struct nvdimm *nvdimm)
279+static int __maybe_unused intel_security_query_overwrite(struct nvdimm *nvdimm)
280280 {
281281 int rc;
282282 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm);
@@ -313,7 +313,7 @@ static int intel_security_query_overwrite(struct nvdimm *nvdimm) · 30 unmodified lines
313313 return 0;
314314 }
315315
316−static int intel_security_overwrite(struct nvdimm *nvdimm,
316+static int __maybe_unused intel_security_overwrite(struct nvdimm *nvdimm,
317317 const struct nvdimm_key_data *nkey)
318318 {
319319 int rc;
drivers/acpi/numa.c+3−3
@@ -146,9 +146,9 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header) · 145 unmodified lines
146146 {
147147 struct acpi_srat_mem_affinity *p =
148148 (struct acpi_srat_mem_affinity *)header;
149− pr_debug("SRAT Memory (0x%lx length 0x%lx) in proximity domain %d %s%s%s\n",
150− (unsigned long)p->base_address,
151− (unsigned long)p->length,
149+ pr_debug("SRAT Memory (0x%llx length 0x%llx) in proximity domain %d %s%s%s\n",
150+ (unsigned long long)p->base_address,
151+ (unsigned long long)p->length,
152152 p->proximity_domain,
153153 (p->flags & ACPI_SRAT_MEM_ENABLED) ?
154154 "enabled" : "disabled",
drivers/acpi/pmic/intel_pmic_xpower.c+33−8
@@ -20,8 +20,11 @@ · 19 unmodified lines
2020 #define GPI1_LDO_ON (3 << 0)
2121 #define GPI1_LDO_OFF (4 << 0)
2222
23−#define AXP288_ADC_TS_PIN_GPADC 0xf2
24−#define AXP288_ADC_TS_PIN_ON 0xf3
23+#define AXP288_ADC_TS_CURRENT_ON_OFF_MASK GENMASK(1, 0)
24+#define AXP288_ADC_TS_CURRENT_OFF (0 << 0)
25+#define AXP288_ADC_TS_CURRENT_ON_WHEN_CHARGING (1 << 0)
26+#define AXP288_ADC_TS_CURRENT_ON_ONDEMAND (2 << 0)
27+#define AXP288_ADC_TS_CURRENT_ON (3 << 0)
2528
2629 static struct pmic_table power_table[] = {
2730 {
@@ -212,22 +215,44 @@ out: · 184 unmodified lines
212215 */
213216 static int intel_xpower_pmic_get_raw_temp(struct regmap *regmap, int reg)
214217 {
218+ int ret, adc_ts_pin_ctrl;
215219 u8 buf[2];
216− int ret;
217220
218− ret = regmap_write(regmap, AXP288_ADC_TS_PIN_CTRL,
219− AXP288_ADC_TS_PIN_GPADC);
221+ /*
222+ * The current-source used for the battery temp-sensor (TS) is shared
223+ * with the GPADC. For proper fuel-gauge and charger operation the TS
224+ * current-source needs to be permanently on. But to read the GPADC we
225+ * need to temporary switch the TS current-source to ondemand, so that
226+ * the GPADC can use it, otherwise we will always read an all 0 value.
227+ *
228+ * Note that the switching from on to on-ondemand is not necessary
229+ * when the TS current-source is off (this happens on devices which
230+ * do not use the TS-pin).
231+ */
232+ ret = regmap_read(regmap, AXP288_ADC_TS_PIN_CTRL, &adc_ts_pin_ctrl);
220233 if (ret)
221234 return ret;
222235
223− /* After switching to the GPADC pin give things some time to settle */
224− usleep_range(6000, 10000);
236+ if (adc_ts_pin_ctrl & AXP288_ADC_TS_CURRENT_ON_OFF_MASK) {
237+ ret = regmap_update_bits(regmap, AXP288_ADC_TS_PIN_CTRL,
238+ AXP288_ADC_TS_CURRENT_ON_OFF_MASK,
239+ AXP288_ADC_TS_CURRENT_ON_ONDEMAND);
240+ if (ret)
241+ return ret;
242+
243+ /* Wait a bit after switching the current-source */
244+ usleep_range(6000, 10000);
245+ }
225246
226247 ret = regmap_bulk_read(regmap, AXP288_GP_ADC_H, buf, 2);
227248 if (ret == 0)
228249 ret = (buf[0] << 4) + ((buf[1] >> 4) & 0x0f);
229250
230− regmap_write(regmap, AXP288_ADC_TS_PIN_CTRL, AXP288_ADC_TS_PIN_ON);
251+ if (adc_ts_pin_ctrl & AXP288_ADC_TS_CURRENT_ON_OFF_MASK) {
252+ regmap_update_bits(regmap, AXP288_ADC_TS_PIN_CTRL,
253+ AXP288_ADC_TS_CURRENT_ON_OFF_MASK,
254+ AXP288_ADC_TS_CURRENT_ON);
255+ }
231256
232257 return ret;
233258 }
drivers/acpi/power.c+22−0
@@ -131,6 +131,23 @@ void acpi_power_resources_list_free(struct list_head *list) · 130 unmodified lines
131131 }
132132 }
133133
134+static bool acpi_power_resource_is_dup(union acpi_object *package,
135+ unsigned int start, unsigned int i)
136+{
137+ acpi_handle rhandle, dup;
138+ unsigned int j;
139+
140+ /* The caller is expected to check the package element types */
141+ rhandle = package->package.elements[i].reference.handle;
142+ for (j = start; j < i; j++) {
143+ dup = package->package.elements[j].reference.handle;
144+ if (dup == rhandle)
145+ return true;
146+ }
147+
148+ return false;
149+}
150+
134151 int acpi_extract_power_resources(union acpi_object *package, unsigned int start,
135152 struct list_head *list)
136153 {
@@ -150,6 +167,11 @@ int acpi_extract_power_resources(union acpi_object *package, unsigned int start, · 13 unmodified lines
150167 err = -ENODEV;
151168 break;
152169 }
170+
171+ /* Some ACPI tables contain duplicate power resource references */
172+ if (acpi_power_resource_is_dup(package, start, i))
173+ continue;
174+
153175 err = acpi_add_power_resource(rhandle);
154176 if (err)
155177 break;
drivers/android/binder.c+22−15
@@ -5854,9 +5854,10 @@ static int __init init_binder_device(const char *name) · 5853 unmodified lines
58545854 static int __init binder_init(void)
58555855 {
58565856 int ret;
5857− char *device_name, *device_names, *device_tmp;
5857+ char *device_name, *device_tmp;
58585858 struct binder_device *device;
58595859 struct hlist_node *tmp;
5860+ char *device_names = NULL;
58605861
58615862 ret = binder_alloc_shrinker_init();
58625863 if (ret)
@@ -5898,23 +5899,29 @@ static int __init binder_init(void) · 35 unmodified lines
58985899 &transaction_log_fops);
58995900 }
59005901
5901− /*
5902− * Copy the module_parameter string, because we don't want to
5903− * tokenize it in-place.
5904− */
5905− device_names = kstrdup(binder_devices_param, GFP_KERNEL);
5906− if (!device_names) {
5907− ret = -ENOMEM;
5908− goto err_alloc_device_names_failed;
5909− }
5902+ if (strcmp(binder_devices_param, "") != 0) {
5903+ /*
5904+ * Copy the module_parameter string, because we don't want to
5905+ * tokenize it in-place.
5906+ */
5907+ device_names = kstrdup(binder_devices_param, GFP_KERNEL);
5908+ if (!device_names) {
5909+ ret = -ENOMEM;
5910+ goto err_alloc_device_names_failed;
5911+ }
59105912
5911− device_tmp = device_names;
5912− while ((device_name = strsep(&device_tmp, ","))) {
5913− ret = init_binder_device(device_name);
5914− if (ret)
5915− goto err_init_binder_device_failed;
5913+ device_tmp = device_names;
5914+ while ((device_name = strsep(&device_tmp, ","))) {
5915+ ret = init_binder_device(device_name);
5916+ if (ret)
5917+ goto err_init_binder_device_failed;
5918+ }
59165919 }
59175920
5921+ ret = init_binderfs();
5922+ if (ret)
5923+ goto err_init_binder_device_failed;
5924+
59185925 return ret;
59195926
59205927 err_init_binder_device_failed:
drivers/android/binder_internal.h+9−0
@@ -46,4 +46,13 @@ static inline bool is_binderfs_device(const struct inode *inode) · 45 unmodified lines
4646 }
4747 #endif
4848
49+#ifdef CONFIG_ANDROID_BINDERFS
50+extern int __init init_binderfs(void);
51+#else
52+static inline int __init init_binderfs(void)
53+{
54+ return 0;
55+}
56+#endif
57+
4958 #endif /* _LINUX_BINDER_INTERNAL_H */
drivers/android/binderfs.c+161−135
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/kdev_t.h>
1212 #include <linux/kernel.h>
1313 #include <linux/list.h>
14+#include <linux/namei.h>
1415 #include <linux/magic.h>
1516 #include <linux/major.h>
1617 #include <linux/miscdevice.h>
@@ -20,6 +21,7 @@ · 3 unmodified lines
2021 #include <linux/parser.h>
2122 #include <linux/radix-tree.h>
2223 #include <linux/sched.h>
24+#include <linux/seq_file.h>
2325 #include <linux/slab.h>
2426 #include <linux/spinlock_types.h>
2527 #include <linux/stddef.h>
@@ -30,7 +32,7 @@ · 4 unmodified lines
3032 #include <linux/xarray.h>
3133 #include <uapi/asm-generic/errno-base.h>
3234 #include <uapi/linux/android/binder.h>
33−#include <uapi/linux/android/binder_ctl.h>
35+#include <uapi/linux/android/binderfs.h>
3436
3537 #include "binder_internal.h"
3638
@@ -39,13 +41,31 @@ · 2 unmodified lines
3941 #define INODE_OFFSET 3
4042 #define INTSTRLEN 21
4143 #define BINDERFS_MAX_MINOR (1U << MINORBITS)
42−
43−static struct vfsmount *binderfs_mnt;
44+/* Ensure that the initial ipc namespace always has devices available. */
45+#define BINDERFS_MAX_MINOR_CAPPED (BINDERFS_MAX_MINOR - 4)
4446
4547 static dev_t binderfs_dev;
4648 static DEFINE_MUTEX(binderfs_minors_mutex);
4749 static DEFINE_IDA(binderfs_minors);
4850
51+/**
52+ * binderfs_mount_opts - mount options for binderfs
53+ * @max: maximum number of allocatable binderfs binder devices
54+ */
55+struct binderfs_mount_opts {
56+ int max;
57+};
58+
59+enum {
60+ Opt_max,
61+ Opt_err
62+};
63+
64+static const match_table_t tokens = {
65+ { Opt_max, "max=%d" },
66+ { Opt_err, NULL }
67+};
68+
4969 /**
5070 * binderfs_info - information about a binderfs mount
5171 * @ipc_ns: The ipc namespace the binderfs mount belongs to.
@@ -55,13 +75,16 @@ static DEFINE_IDA(binderfs_minors); · 3 unmodified lines
5575 * created.
5676 * @root_gid: gid that needs to be used when a new binder device is
5777 * created.
78+ * @mount_opts: The mount options in use.
79+ * @device_count: The current number of allocated binder devices.
5880 */
5981 struct binderfs_info {
6082 struct ipc_namespace *ipc_ns;
6183 struct dentry *control_dentry;
6284 kuid_t root_uid;
6385 kgid_t root_gid;
64−
86+ struct binderfs_mount_opts mount_opts;
87+ int device_count;
6588 };
6689
6790 static inline struct binderfs_info *BINDERFS_I(const struct inode *inode)
@@ -84,7 +107,7 @@ bool is_binderfs_device(const struct inode *inode) · 16 unmodified lines
84107 * @userp: buffer to copy information about new device for userspace to
85108 * @req: struct binderfs_device as copied from userspace
86109 *
87− * This function allocated a new binder_device and reserves a new minor
110+ * This function allocates a new binder_device and reserves a new minor
88111 * number for it.
89112 * Minor numbers are limited and tracked globally in binderfs_minors. The
90113 * function will stash a struct binder_device for the specific binder
@@ -100,20 +123,34 @@ static int binderfs_binder_device_create(struct inode *ref_inode, · 9 unmodified lines
100123 struct binderfs_device *req)
101124 {
102125 int minor, ret;
103− struct dentry *dentry, *dup, *root;
126+ struct dentry *dentry, *root;
104127 struct binder_device *device;
105− size_t name_len = BINDERFS_MAX_NAME + 1;
106128 char *name = NULL;
129+ size_t name_len;
107130 struct inode *inode = NULL;
108131 struct super_block *sb = ref_inode->i_sb;
109132 struct binderfs_info *info = sb->s_fs_info;
133+#if defined(CONFIG_IPC_NS)
134+ bool use_reserve = (info->ipc_ns == &init_ipc_ns);
135+#else
136+ bool use_reserve = true;
137+#endif
110138
111139 /* Reserve new minor number for the new device. */
112140 mutex_lock(&binderfs_minors_mutex);
113− minor = ida_alloc_max(&binderfs_minors, BINDERFS_MAX_MINOR, GFP_KERNEL);
114− mutex_unlock(&binderfs_minors_mutex);
115− if (minor < 0)
141+ if (++info->device_count <= info->mount_opts.max)
142+ minor = ida_alloc_max(&binderfs_minors,
143+ use_reserve ? BINDERFS_MAX_MINOR :
144+ BINDERFS_MAX_MINOR_CAPPED,
145+ GFP_KERNEL);
146+ else
147+ minor = -ENOSPC;
148+ if (minor < 0) {
149+ --info->device_count;
150+ mutex_unlock(&binderfs_minors_mutex);
116151 return minor;
152+ }
153+ mutex_unlock(&binderfs_minors_mutex);
117154
118155 ret = -ENOMEM;
119156 device = kzalloc(sizeof(*device), GFP_KERNEL);
@@ -132,12 +169,13 @@ static int binderfs_binder_device_create(struct inode *ref_inode, · 12 unmodified lines
132169 inode->i_uid = info->root_uid;
133170 inode->i_gid = info->root_gid;
134171
135− name = kmalloc(name_len, GFP_KERNEL);
172+ req->name[BINDERFS_MAX_NAME] = '\0'; /* NUL-terminate */
173+ name_len = strlen(req->name);
174+ /* Make sure to include terminating NUL byte */
175+ name = kmemdup(req->name, name_len + 1, GFP_KERNEL);
136176 if (!name)
137177 goto err;
138178
139− strscpy(name, req->name, name_len);
140−
141179 device->binderfs_inode = inode;
142180 device->context.binder_context_mgr_uid = INVALID_UID;
143181 device->context.name = name;
@@ -156,28 +194,25 @@ static int binderfs_binder_device_create(struct inode *ref_inode, · 12 unmodified lines
156194
157195 root = sb->s_root;
158196 inode_lock(d_inode(root));
159− dentry = d_alloc_name(root, name);
160− if (!dentry) {
197+
198+ /* look it up */
199+ dentry = lookup_one_len(name, root, name_len);
200+ if (IS_ERR(dentry)) {
161201 inode_unlock(d_inode(root));
162− ret = -ENOMEM;
202+ ret = PTR_ERR(dentry);
163203 goto err;
164204 }
165205
166− /* Verify that the name userspace gave us is not already in use. */
167− dup = d_lookup(root, &dentry->d_name);
168− if (dup) {
169− if (d_really_is_positive(dup)) {
170− dput(dup);
171− dput(dentry);
172− inode_unlock(d_inode(root));
173− ret = -EEXIST;
174− goto err;
175− }
176− dput(dup);
206+ if (d_really_is_positive(dentry)) {
207+ /* already exists */
208+ dput(dentry);
209+ inode_unlock(d_inode(root));
210+ ret = -EEXIST;
211+ goto err;
177212 }
178213
179214 inode->i_private = device;
180− d_add(dentry, inode);
215+ d_instantiate(dentry, inode);
181216 fsnotify_create(root->d_inode, dentry);
182217 inode_unlock(d_inode(root));
183218
@@ -187,6 +222,7 @@ err: · 3 unmodified lines
187222 kfree(name);
188223 kfree(device);
189224 mutex_lock(&binderfs_minors_mutex);
225+ --info->device_count;
190226 ida_free(&binderfs_minors, minor);
191227 mutex_unlock(&binderfs_minors_mutex);
192228 iput(inode);
@@ -232,6 +268,7 @@ static long binder_ctl_ioctl(struct file *file, unsigned int cmd, · 39 unmodified lines
232268 static void binderfs_evict_inode(struct inode *inode)
233269 {
234270 struct binder_device *device = inode->i_private;
271+ struct binderfs_info *info = BINDERFS_I(inode);
235272
236273 clear_inode(inode);
237274
@@ -239,6 +276,7 @@ static void binderfs_evict_inode(struct inode *inode) · 1 unmodified line
239276 return;
240277
241278 mutex_lock(&binderfs_minors_mutex);
279+ --info->device_count;
242280 ida_free(&binderfs_minors, device->miscdev.minor);
243281 mutex_unlock(&binderfs_minors_mutex);
244282
@@ -246,43 +284,87 @@ static void binderfs_evict_inode(struct inode *inode) · 1 unmodified line
246284 kfree(device);
247285 }
248286
287+/**
288+ * binderfs_parse_mount_opts - parse binderfs mount options
289+ * @data: options to set (can be NULL in which case defaults are used)
290+ */
291+static int binderfs_parse_mount_opts(char *data,
292+ struct binderfs_mount_opts *opts)
293+{
294+ char *p;
295+ opts->max = BINDERFS_MAX_MINOR;
296+
297+ while ((p = strsep(&data, ",")) != NULL) {
298+ substring_t args[MAX_OPT_ARGS];
299+ int token;
300+ int max_devices;
301+
302+ if (!*p)
303+ continue;
304+
305+ token = match_token(p, tokens, args);
306+ switch (token) {
307+ case Opt_max:
308+ if (match_int(&args[0], &max_devices) ||
309+ (max_devices < 0 ||
310+ (max_devices > BINDERFS_MAX_MINOR)))
311+ return -EINVAL;
312+
313+ opts->max = max_devices;
314+ break;
315+ default:
316+ pr_err("Invalid mount options\n");
317+ return -EINVAL;
318+ }
319+ }
320+
321+ return 0;
322+}
323+
324+static int binderfs_remount(struct super_block *sb, int *flags, char *data)
325+{
326+ struct binderfs_info *info = sb->s_fs_info;
327+ return binderfs_parse_mount_opts(data, &info->mount_opts);
328+}
329+
330+static int binderfs_show_mount_opts(struct seq_file *seq, struct dentry *root)
331+{
332+ struct binderfs_info *info;
333+
334+ info = root->d_sb->s_fs_info;
335+ if (info->mount_opts.max <= BINDERFS_MAX_MINOR)
336+ seq_printf(seq, ",max=%d", info->mount_opts.max);
337+
338+ return 0;
339+}
340+
249341 static const struct super_operations binderfs_super_ops = {
250− .statfs = simple_statfs,
251− .evict_inode = binderfs_evict_inode,
342+ .evict_inode = binderfs_evict_inode,
343+ .remount_fs = binderfs_remount,
344+ .show_options = binderfs_show_mount_opts,
345+ .statfs = simple_statfs,
252346 };
253347
348+static inline bool is_binderfs_control_device(const struct dentry *dentry)
349+{
350+ struct binderfs_info *info = dentry->d_sb->s_fs_info;
351+ return info->control_dentry == dentry;
352+}
353+
254354 static int binderfs_rename(struct inode *old_dir, struct dentry *old_dentry,
255355 struct inode *new_dir, struct dentry *new_dentry,
256356 unsigned int flags)
257357 {
258− struct inode *inode = d_inode(old_dentry);
259−
260− /* binderfs doesn't support directories. */
261− if (d_is_dir(old_dentry))
358+ if (is_binderfs_control_device(old_dentry) ||
359+ is_binderfs_control_device(new_dentry))
262360 return -EPERM;
263361
264− if (flags & ~RENAME_NOREPLACE)
265− return -EINVAL;
266−
267− if (!simple_empty(new_dentry))
268− return -ENOTEMPTY;
269−
270− if (d_really_is_positive(new_dentry))
271− simple_unlink(new_dir, new_dentry);
272−
273− old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime =
274− new_dir->i_mtime = inode->i_ctime = current_time(old_dir);
275−
276− return 0;
362+ return simple_rename(old_dir, old_dentry, new_dir, new_dentry, flags);
277363 }
278364
279365 static int binderfs_unlink(struct inode *dir, struct dentry *dentry)
280366 {
281− /*
282− * The control dentry is only ever touched during mount so checking it
283− * here should not require us to take lock.
284− */
285− if (BINDERFS_I(dir)->control_dentry == dentry)
367+ if (is_binderfs_control_device(dentry))
286368 return -EPERM;
287369
288370 return simple_unlink(dir, dentry);
@@ -313,13 +395,16 @@ static int binderfs_binder_ctl_create(struct super_block *sb) · 24 unmodified lines
313395 struct inode *inode = NULL;
314396 struct dentry *root = sb->s_root;
315397 struct binderfs_info *info = sb->s_fs_info;
398+#if defined(CONFIG_IPC_NS)
399+ bool use_reserve = (info->ipc_ns == &init_ipc_ns);
400+#else
401+ bool use_reserve = true;
402+#endif
316403
317404 device = kzalloc(sizeof(*device), GFP_KERNEL);
318405 if (!device)
319406 return -ENOMEM;
320407
321− inode_lock(d_inode(root));
322−
323408 /* If we have already created a binder-control node, return. */
324409 if (info->control_dentry) {
325410 ret = 0;
@@ -333,7 +418,10 @@ static int binderfs_binder_ctl_create(struct super_block *sb) · 7 unmodified lines
333418
334419 /* Reserve a new minor number for the new device. */
335420 mutex_lock(&binderfs_minors_mutex);
336− minor = ida_alloc_max(&binderfs_minors, BINDERFS_MAX_MINOR, GFP_KERNEL);
421+ minor = ida_alloc_max(&binderfs_minors,
422+ use_reserve ? BINDERFS_MAX_MINOR :
423+ BINDERFS_MAX_MINOR_CAPPED,
424+ GFP_KERNEL);
337425 mutex_unlock(&binderfs_minors_mutex);
338426 if (minor < 0) {
339427 ret = minor;
@@ -358,12 +446,10 @@ static int binderfs_binder_ctl_create(struct super_block *sb) · 18 unmodified lines
358446 inode->i_private = device;
359447 info->control_dentry = dentry;
360448 d_add(dentry, inode);
361− inode_unlock(d_inode(root));
362449
363450 return 0;
364451
365452 out:
366− inode_unlock(d_inode(root));
367453 kfree(device);
368454 iput(inode);
369455
@@ -378,12 +464,9 @@ static const struct inode_operations binderfs_dir_inode_operations = { · 8 unmodified lines
378464
379465 static int binderfs_fill_super(struct super_block *sb, void *data, int silent)
380466 {
467+ int ret;
381468 struct binderfs_info *info;
382− int ret = -ENOMEM;
383469 struct inode *inode = NULL;
384− struct ipc_namespace *ipc_ns = sb->s_fs_info;
385−
386− get_ipc_ns(ipc_ns);
387470
388471 sb->s_blocksize = PAGE_SIZE;
389472 sb->s_blocksize_bits = PAGE_SHIFT;
@@ -405,11 +488,17 @@ static int binderfs_fill_super(struct super_block *sb, void *data, int silent) · 15 unmodified lines
405488 sb->s_op = &binderfs_super_ops;
406489 sb->s_time_gran = 1;
407490
408− info = kzalloc(sizeof(struct binderfs_info), GFP_KERNEL);
409− if (!info)
410− goto err_without_dentry;
491+ sb->s_fs_info = kzalloc(sizeof(struct binderfs_info), GFP_KERNEL);
492+ if (!sb->s_fs_info)
493+ return -ENOMEM;
494+ info = sb->s_fs_info;
495+
496+ info->ipc_ns = get_ipc_ns(current->nsproxy->ipc_ns);
497+
498+ ret = binderfs_parse_mount_opts(data, &info->mount_opts);
499+ if (ret)
500+ return ret;
411501
412− info->ipc_ns = ipc_ns;
413502 info->root_gid = make_kgid(sb->s_user_ns, 0);
414503 if (!gid_valid(info->root_gid))
415504 info->root_gid = GLOBAL_ROOT_GID;
@@ -417,11 +506,9 @@ static int binderfs_fill_super(struct super_block *sb, void *data, int silent) · 1 unmodified line
417506 if (!uid_valid(info->root_uid))
418507 info->root_uid = GLOBAL_ROOT_UID;
419508
420− sb->s_fs_info = info;
421−
422509 inode = new_inode(sb);
423510 if (!inode)
424− goto err_without_dentry;
511+ return -ENOMEM;
425512
426513 inode->i_ino = FIRST_INODE;
427514 inode->i_fop = &simple_dir_operations;
@@ -432,79 +519,28 @@ static int binderfs_fill_super(struct super_block *sb, void *data, int silent) · 4 unmodified lines
432519
433520 sb->s_root = d_make_root(inode);
434521 if (!sb->s_root)
435− goto err_without_dentry;
436−
437− ret = binderfs_binder_ctl_create(sb);
438− if (ret)
439− goto err_with_dentry;
440−
441− return 0;
442−
443−err_with_dentry:
444− dput(sb->s_root);
445− sb->s_root = NULL;
446−
447−err_without_dentry:
448− put_ipc_ns(ipc_ns);
449− iput(inode);
450− kfree(info);
451−
452− return ret;
453−}
454−
455−static int binderfs_test_super(struct super_block *sb, void *data)
456−{
457− struct binderfs_info *info = sb->s_fs_info;
458−
459− if (info)
460− return info->ipc_ns == data;
461−
462− return 0;
463−}
522+ return -ENOMEM;
464523
465−static int binderfs_set_super(struct super_block *sb, void *data)
466−{
467− sb->s_fs_info = data;
468− return set_anon_super(sb, NULL);
524+ return binderfs_binder_ctl_create(sb);
469525 }
470526
471527 static struct dentry *binderfs_mount(struct file_system_type *fs_type,
472528 int flags, const char *dev_name,
473529 void *data)
474530 {
475− struct super_block *sb;
476− struct ipc_namespace *ipc_ns = current->nsproxy->ipc_ns;
477−
478− if (!ns_capable(ipc_ns->user_ns, CAP_SYS_ADMIN))
479− return ERR_PTR(-EPERM);
480−
481− sb = sget_userns(fs_type, binderfs_test_super, binderfs_set_super,
482− flags, ipc_ns->user_ns, ipc_ns);
483− if (IS_ERR(sb))
484− return ERR_CAST(sb);
485−
486− if (!sb->s_root) {
487− int ret = binderfs_fill_super(sb, data, flags & SB_SILENT ? 1 : 0);
488− if (ret) {
489− deactivate_locked_super(sb);
490− return ERR_PTR(ret);
491− }
492−
493− sb->s_flags |= SB_ACTIVE;
494− }
495−
496− return dget(sb->s_root);
531+ return mount_nodev(fs_type, flags, data, binderfs_fill_super);
497532 }
498533
499534 static void binderfs_kill_super(struct super_block *sb)
500535 {
501536 struct binderfs_info *info = sb->s_fs_info;
502537
538+ kill_litter_super(sb);
539+
503540 if (info && info->ipc_ns)
504541 put_ipc_ns(info->ipc_ns);
505542
506543 kfree(info);
507− kill_litter_super(sb);
508544 }
509545
510546 static struct file_system_type binder_fs_type = {
@@ -514,7 +550,7 @@ static struct file_system_type binder_fs_type = { · 3 unmodified lines
514550 .fs_flags = FS_USERNS_MOUNT,
515551 };
516552
517−static int __init init_binderfs(void)
553+int __init init_binderfs(void)
518554 {
519555 int ret;
520556
@@ -530,15 +566,5 @@ static int __init init_binderfs(void) · 9 unmodified lines
530566 return ret;
531567 }
532568
533− binderfs_mnt = kern_mount(&binder_fs_type);
534− if (IS_ERR(binderfs_mnt)) {
535− ret = PTR_ERR(binderfs_mnt);
536− binderfs_mnt = NULL;
537− unregister_filesystem(&binder_fs_type);
538− unregister_chrdev_region(binderfs_dev, BINDERFS_MAX_MINOR);
539− }
540−
541569 return ret;
542570 }
543−
544−device_initcall(init_binderfs);
drivers/ata/Kconfig+1−1
@@ -1091,7 +1091,7 @@ comment "Generic fallback / legacy drivers" · 1090 unmodified lines
10911091
10921092 config PATA_ACPI
10931093 tristate "ACPI firmware driver for PATA"
1094− depends on ATA_ACPI && ATA_BMDMA
1094+ depends on ATA_ACPI && ATA_BMDMA && PCI
10951095 help
10961096 This option enables an ACPI method driver which drives
10971097 motherboard PATA controller interfaces through the ACPI
drivers/ata/ahci.h+2−0
@@ -254,6 +254,8 @@ enum { · 253 unmodified lines
254254 AHCI_HFLAG_IS_MOBILE = (1 << 25), /* mobile chipset, use
255255 SATA_MOBILE_LPM_POLICY
256256 as default lpm_policy */
257+ AHCI_HFLAG_SUSPEND_PHYS = (1 << 26), /* handle PHYs during
258+ suspend/resume */
257259
258260 /* ap->flags bits */
259261
drivers/ata/ahci_mvebu.c+64−23
@@ -28,6 +28,11 @@ · 27 unmodified lines
2828 #define AHCI_WINDOW_BASE(win) (0x64 + ((win) << 4))
2929 #define AHCI_WINDOW_SIZE(win) (0x68 + ((win) << 4))
3030
31+struct ahci_mvebu_plat_data {
32+ int (*plat_config)(struct ahci_host_priv *hpriv);
33+ unsigned int flags;
34+};
35+
3136 static void ahci_mvebu_mbus_config(struct ahci_host_priv *hpriv,
3237 const struct mbus_dram_target_info *dram)
3338 {
@@ -62,6 +67,35 @@ static void ahci_mvebu_regret_option(struct ahci_host_priv *hpriv) · 28 unmodified lines
6267 writel(0x80, hpriv->mmio + AHCI_VENDOR_SPECIFIC_0_DATA);
6368 }
6469
70+static int ahci_mvebu_armada_380_config(struct ahci_host_priv *hpriv)
71+{
72+ const struct mbus_dram_target_info *dram;
73+ int rc = 0;
74+
75+ dram = mv_mbus_dram_info();
76+ if (dram)
77+ ahci_mvebu_mbus_config(hpriv, dram);
78+ else
79+ rc = -ENODEV;
80+
81+ ahci_mvebu_regret_option(hpriv);
82+
83+ return rc;
84+}
85+
86+static int ahci_mvebu_armada_3700_config(struct ahci_host_priv *hpriv)
87+{
88+ u32 reg;
89+
90+ writel(0, hpriv->mmio + AHCI_VENDOR_SPECIFIC_0_ADDR);
91+
92+ reg = readl(hpriv->mmio + AHCI_VENDOR_SPECIFIC_0_DATA);
93+ reg |= BIT(6);
94+ writel(reg, hpriv->mmio + AHCI_VENDOR_SPECIFIC_0_DATA);
95+
96+ return 0;
97+}
98+
6599 /**
66100 * ahci_mvebu_stop_engine
67101 *
@@ -126,13 +160,9 @@ static int ahci_mvebu_resume(struct platform_device *pdev) · 58 unmodified lines
126160 {
127161 struct ata_host *host = platform_get_drvdata(pdev);
128162 struct ahci_host_priv *hpriv = host->private_data;
129− const struct mbus_dram_target_info *dram;
163+ const struct ahci_mvebu_plat_data *pdata = hpriv->plat_data;
130164
131− dram = mv_mbus_dram_info();
132− if (dram)
133− ahci_mvebu_mbus_config(hpriv, dram);
134−
135− ahci_mvebu_regret_option(hpriv);
165+ pdata->plat_config(hpriv);
136166
137167 return ahci_platform_resume_host(&pdev->dev);
138168 }
@@ -154,29 +184,30 @@ static struct scsi_host_template ahci_platform_sht = { · 15 unmodified lines
154184
155185 static int ahci_mvebu_probe(struct platform_device *pdev)
156186 {
187+ const struct ahci_mvebu_plat_data *pdata;
157188 struct ahci_host_priv *hpriv;
158− const struct mbus_dram_target_info *dram;
159189 int rc;
160190
191+ pdata = of_device_get_match_data(&pdev->dev);
192+ if (!pdata)
193+ return -EINVAL;
194+
161195 hpriv = ahci_platform_get_resources(pdev, 0);
162196 if (IS_ERR(hpriv))
163197 return PTR_ERR(hpriv);
164198
199+ hpriv->flags |= pdata->flags;
200+ hpriv->plat_data = (void *)pdata;
201+
165202 rc = ahci_platform_enable_resources(hpriv);
166203 if (rc)
167204 return rc;
168205
169206 hpriv->stop_engine = ahci_mvebu_stop_engine;
170207
171− if (of_device_is_compatible(pdev->dev.of_node,
172− "marvell,armada-380-ahci")) {
173− dram = mv_mbus_dram_info();
174− if (!dram)
175− return -ENODEV;
176−
177− ahci_mvebu_mbus_config(hpriv, dram);
178− ahci_mvebu_regret_option(hpriv);
179− }
208+ rc = pdata->plat_config(hpriv);
209+ if (rc)
210+ goto disable_resources;
180211
181212 rc = ahci_platform_init_host(pdev, hpriv, &ahci_mvebu_port_info,
182213 &ahci_platform_sht);
@@ -190,18 +221,28 @@ disable_resources: · 7 unmodified lines
190221 return rc;
191222 }
192223
224+static const struct ahci_mvebu_plat_data ahci_mvebu_armada_380_plat_data = {
225+ .plat_config = ahci_mvebu_armada_380_config,
226+};
227+
228+static const struct ahci_mvebu_plat_data ahci_mvebu_armada_3700_plat_data = {
229+ .plat_config = ahci_mvebu_armada_3700_config,
230+ .flags = AHCI_HFLAG_SUSPEND_PHYS,
231+};
232+
193233 static const struct of_device_id ahci_mvebu_of_match[] = {
194− { .compatible = "marvell,armada-380-ahci", },
195− { .compatible = "marvell,armada-3700-ahci", },
234+ {
235+ .compatible = "marvell,armada-380-ahci",
236+ .data = &ahci_mvebu_armada_380_plat_data,
237+ },
238+ {
239+ .compatible = "marvell,armada-3700-ahci",
240+ .data = &ahci_mvebu_armada_3700_plat_data,
241+ },
196242 { },
197243 };
198244 MODULE_DEVICE_TABLE(of, ahci_mvebu_of_match);
199245
200−/*
201− * We currently don't provide power management related operations,
202− * since there is no suspend/resume support at the platform level for
203− * Armada 38x for the moment.
204− */
205246 static struct platform_driver ahci_mvebu_driver = {
206247 .probe = ahci_mvebu_probe,
207248 .remove = ata_platform_remove_one,
drivers/ata/libahci_platform.c+13−0
@@ -56,6 +56,12 @@ static int ahci_platform_enable_phys(struct ahci_host_priv *hpriv) · 55 unmodified lines
5656 if (rc)
5757 goto disable_phys;
5858
59+ rc = phy_set_mode(hpriv->phys[i], PHY_MODE_SATA);
60+ if (rc) {
61+ phy_exit(hpriv->phys[i]);
62+ goto disable_phys;
63+ }
64+
5965 rc = phy_power_on(hpriv->phys[i]);
6066 if (rc) {
6167 phy_exit(hpriv->phys[i]);
@@ -738,6 +744,9 @@ int ahci_platform_suspend_host(struct device *dev) · 676 unmodified lines
738744 writel(ctl, mmio + HOST_CTL);
739745 readl(mmio + HOST_CTL); /* flush */
740746
747+ if (hpriv->flags & AHCI_HFLAG_SUSPEND_PHYS)
748+ ahci_platform_disable_phys(hpriv);
749+
741750 return ata_host_suspend(host, PMSG_SUSPEND);
742751 }
743752 EXPORT_SYMBOL_GPL(ahci_platform_suspend_host);
@@ -756,6 +765,7 @@ EXPORT_SYMBOL_GPL(ahci_platform_suspend_host); · 12 unmodified lines
756765 int ahci_platform_resume_host(struct device *dev)
757766 {
758767 struct ata_host *host = dev_get_drvdata(dev);
768+ struct ahci_host_priv *hpriv = host->private_data;
759769 int rc;
760770
761771 if (dev->power.power_state.event == PM_EVENT_SUSPEND) {
@@ -766,6 +776,9 @@ int ahci_platform_resume_host(struct device *dev) · 4 unmodified lines
766776 ahci_init_controller(host);
767777 }
768778
779+ if (hpriv->flags & AHCI_HFLAG_SUSPEND_PHYS)
780+ ahci_platform_enable_phys(hpriv);
781+
769782 ata_host_resume(host);
770783
771784 return 0;
drivers/ata/libata-core.c+1−0
@@ -4554,6 +4554,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { · 4553 unmodified lines
45544554 { "SAMSUNG MZMPC128HBFU-000MV", "CXM14M1Q", ATA_HORKAGE_NOLPM, },
45554555 { "SAMSUNG SSD PM830 mSATA *", "CXM13D1Q", ATA_HORKAGE_NOLPM, },
45564556 { "SAMSUNG MZ7TD256HAFV-000L9", NULL, ATA_HORKAGE_NOLPM, },
4557+ { "SAMSUNG MZ7TE512HMHP-000L1", "EXT06L0Q", ATA_HORKAGE_NOLPM, },
45574558
45584559 /* devices that don't properly handle queued TRIM commands */
45594560 { "Micron_M500IT_*", "MU01", ATA_HORKAGE_NO_NCQ_TRIM |
drivers/ata/pata_macio.c+4−5
@@ -915,6 +915,10 @@ static struct scsi_host_template pata_macio_sht = { · 914 unmodified lines
915915 .sg_tablesize = MAX_DCMDS,
916916 /* We may not need that strict one */
917917 .dma_boundary = ATA_DMA_BOUNDARY,
918+ /* Not sure what the real max is but we know it's less than 64K, let's
919+ * use 64K minus 256
920+ */
921+ .max_segment_size = MAX_DBDMA_SEG,
918922 .slave_configure = pata_macio_slave_config,
919923 };
920924
@@ -1044,11 +1048,6 @@ static int pata_macio_common_init(struct pata_macio_priv *priv, · 123 unmodified lines
10441048 /* Make sure we have sane initial timings in the cache */
10451049 pata_macio_default_timings(priv);
10461050
1047− /* Not sure what the real max is but we know it's less than 64K, let's
1048− * use 64K minus 256
1049− */
1050− dma_set_max_seg_size(priv->dev, MAX_DBDMA_SEG);
1051−
10521051 /* Allocate libata host for 1 port */
10531052 memset(&pinfo, 0, sizeof(struct ata_port_info));
10541053 pmac_macio_calc_timing_masks(priv, &pinfo);
drivers/ata/sata_fsl.c+2−2
@@ -729,8 +729,8 @@ static int sata_fsl_port_start(struct ata_port *ap) · 728 unmodified lines
729729 if (!pp)
730730 return -ENOMEM;
731731
732− mem = dma_zalloc_coherent(dev, SATA_FSL_PORT_PRIV_DMA_SZ, &mem_dma,
733− GFP_KERNEL);
732+ mem = dma_alloc_coherent(dev, SATA_FSL_PORT_PRIV_DMA_SZ, &mem_dma,
733+ GFP_KERNEL);
734734 if (!mem) {
735735 kfree(pp);
736736 return -ENOMEM;
drivers/ata/sata_inic162x.c+9−13
@@ -245,8 +245,15 @@ struct inic_port_priv { · 244 unmodified lines
245245
246246 static struct scsi_host_template inic_sht = {
247247 ATA_BASE_SHT(DRV_NAME),
248− .sg_tablesize = LIBATA_MAX_PRD, /* maybe it can be larger? */
249− .dma_boundary = INIC_DMA_BOUNDARY,
248+ .sg_tablesize = LIBATA_MAX_PRD, /* maybe it can be larger? */
249+
250+ /*
251+ * This controller is braindamaged. dma_boundary is 0xffff like others
252+ * but it will lock up the whole machine HARD if 65536 byte PRD entry
253+ * is fed. Reduce maximum segment size.
254+ */
255+ .dma_boundary = INIC_DMA_BOUNDARY,
256+ .max_segment_size = 65536 - 512,
250257 };
251258
252259 static const int scr_map[] = {
@@ -868,17 +875,6 @@ static int inic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 615 unmodified lines
868875 return rc;
869876 }
870877
871− /*
872− * This controller is braindamaged. dma_boundary is 0xffff
873− * like others but it will lock up the whole machine HARD if
874− * 65536 byte PRD entry is fed. Reduce maximum segment size.
875− */
876− rc = dma_set_max_seg_size(&pdev->dev, 65536 - 512);
877− if (rc) {
878− dev_err(&pdev->dev, "failed to set the maximum segment size\n");
879− return rc;
880− }
881−
882878 rc = init_controller(hpriv->mmio_base, hpriv->cached_hctl);
883879 if (rc) {
884880 dev_err(&pdev->dev, "failed to initialize controller\n");
drivers/atm/he.c+20−21
@@ -533,9 +533,10 @@ static void he_init_tx_lbfp(struct he_dev *he_dev) · 532 unmodified lines
533533
534534 static int he_init_tpdrq(struct he_dev *he_dev)
535535 {
536− he_dev->tpdrq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
537− CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq),
538− &he_dev->tpdrq_phys, GFP_KERNEL);
536+ he_dev->tpdrq_base = dma_alloc_coherent(&he_dev->pci_dev->dev,
537+ CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq),
538+ &he_dev->tpdrq_phys,
539+ GFP_KERNEL);
539540 if (he_dev->tpdrq_base == NULL) {
540541 hprintk("failed to alloc tpdrq\n");
541542 return -ENOMEM;
@@ -717,7 +718,7 @@ static int he_init_cs_block_rcm(struct he_dev *he_dev) · 175 unmodified lines
717718 instead of '/ 512', use '>> 9' to prevent a call
718719 to divdu3 on x86 platforms
719720 */
720− rate_cps = (unsigned long long) (1 << exp) * (man + 512) >> 9;
721+ rate_cps = (unsigned long long) (1UL << exp) * (man + 512) >> 9;
721722
722723 if (rate_cps < 10)
723724 rate_cps = 10; /* 2.2.1 minimum payload rate is 10 cps */
@@ -805,9 +806,9 @@ static int he_init_group(struct he_dev *he_dev, int group) · 81 unmodified lines
805806 goto out_free_rbpl_virt;
806807 }
807808
808− he_dev->rbpl_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
809− CONFIG_RBPL_SIZE * sizeof(struct he_rbp),
810− &he_dev->rbpl_phys, GFP_KERNEL);
809+ he_dev->rbpl_base = dma_alloc_coherent(&he_dev->pci_dev->dev,
810+ CONFIG_RBPL_SIZE * sizeof(struct he_rbp),
811+ &he_dev->rbpl_phys, GFP_KERNEL);
811812 if (he_dev->rbpl_base == NULL) {
812813 hprintk("failed to alloc rbpl_base\n");
813814 goto out_destroy_rbpl_pool;
@@ -844,9 +845,9 @@ static int he_init_group(struct he_dev *he_dev, int group) · 30 unmodified lines
844845
845846 /* rx buffer ready queue */
846847
847− he_dev->rbrq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
848− CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq),
849− &he_dev->rbrq_phys, GFP_KERNEL);
848+ he_dev->rbrq_base = dma_alloc_coherent(&he_dev->pci_dev->dev,
849+ CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq),
850+ &he_dev->rbrq_phys, GFP_KERNEL);
850851 if (he_dev->rbrq_base == NULL) {
851852 hprintk("failed to allocate rbrq\n");
852853 goto out_free_rbpl;
@@ -868,9 +869,9 @@ static int he_init_group(struct he_dev *he_dev, int group) · 15 unmodified lines
868869
869870 /* tx buffer ready queue */
870871
871− he_dev->tbrq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
872− CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq),
873− &he_dev->tbrq_phys, GFP_KERNEL);
872+ he_dev->tbrq_base = dma_alloc_coherent(&he_dev->pci_dev->dev,
873+ CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq),
874+ &he_dev->tbrq_phys, GFP_KERNEL);
874875 if (he_dev->tbrq_base == NULL) {
875876 hprintk("failed to allocate tbrq\n");
876877 goto out_free_rbpq_base;
@@ -913,11 +914,9 @@ static int he_init_irq(struct he_dev *he_dev) · 36 unmodified lines
913914 /* 2.9.3.5 tail offset for each interrupt queue is located after the
914915 end of the interrupt queue */
915916
916− he_dev->irq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
917− (CONFIG_IRQ_SIZE + 1)
918− * sizeof(struct he_irq),
919− &he_dev->irq_phys,
920− GFP_KERNEL);
917+ he_dev->irq_base = dma_alloc_coherent(&he_dev->pci_dev->dev,
918+ (CONFIG_IRQ_SIZE + 1) * sizeof(struct he_irq),
919+ &he_dev->irq_phys, GFP_KERNEL);
921920 if (he_dev->irq_base == NULL) {
922921 hprintk("failed to allocate irq\n");
923922 return -ENOMEM;
@@ -1464,9 +1463,9 @@ static int he_start(struct atm_dev *dev) · 540 unmodified lines
14641463
14651464 /* host status page */
14661465
1467− he_dev->hsp = dma_zalloc_coherent(&he_dev->pci_dev->dev,
1468− sizeof(struct he_hsp),
1469− &he_dev->hsp_phys, GFP_KERNEL);
1466+ he_dev->hsp = dma_alloc_coherent(&he_dev->pci_dev->dev,
1467+ sizeof(struct he_hsp),
1468+ &he_dev->hsp_phys, GFP_KERNEL);
14701469 if (he_dev->hsp == NULL) {
14711470 hprintk("failed to allocate host status page\n");
14721471 return -ENOMEM;
drivers/atm/idt77252.c+8−8
@@ -641,8 +641,8 @@ alloc_scq(struct idt77252_dev *card, int class) · 640 unmodified lines
641641 scq = kzalloc(sizeof(struct scq_info), GFP_KERNEL);
642642 if (!scq)
643643 return NULL;
644− scq->base = dma_zalloc_coherent(&card->pcidev->dev, SCQ_SIZE,
645− &scq->paddr, GFP_KERNEL);
644+ scq->base = dma_alloc_coherent(&card->pcidev->dev, SCQ_SIZE,
645+ &scq->paddr, GFP_KERNEL);
646646 if (scq->base == NULL) {
647647 kfree(scq);
648648 return NULL;
@@ -971,8 +971,8 @@ init_rsq(struct idt77252_dev *card) · 322 unmodified lines
971971 {
972972 struct rsq_entry *rsqe;
973973
974− card->rsq.base = dma_zalloc_coherent(&card->pcidev->dev, RSQSIZE,
975− &card->rsq.paddr, GFP_KERNEL);
974+ card->rsq.base = dma_alloc_coherent(&card->pcidev->dev, RSQSIZE,
975+ &card->rsq.paddr, GFP_KERNEL);
976976 if (card->rsq.base == NULL) {
977977 printk("%s: can't allocate RSQ.\n", card->name);
978978 return -1;
@@ -3390,10 +3390,10 @@ static int init_card(struct atm_dev *dev) · 2411 unmodified lines
33903390 writel(0, SAR_REG_GP);
33913391
33923392 /* Initialize RAW Cell Handle Register */
3393− card->raw_cell_hnd = dma_zalloc_coherent(&card->pcidev->dev,
3394− 2 * sizeof(u32),
3395− &card->raw_cell_paddr,
3396− GFP_KERNEL);
3393+ card->raw_cell_hnd = dma_alloc_coherent(&card->pcidev->dev,
3394+ 2 * sizeof(u32),
3395+ &card->raw_cell_paddr,
3396+ GFP_KERNEL);
33973397 if (!card->raw_cell_hnd) {
33983398 printk("%s: memory allocation failure.\n", card->name);
33993399 deinit_card(card);
drivers/base/cacheinfo.c+2−4
@@ -79,8 +79,7 @@ static void cache_size(struct cacheinfo *this_leaf, struct device_node *np) · 78 unmodified lines
7979 ct_idx = get_cacheinfo_idx(this_leaf->type);
8080 propname = cache_type_info[ct_idx].size_prop;
8181
82− if (of_property_read_u32(np, propname, &this_leaf->size))
83− this_leaf->size = 0;
82+ of_property_read_u32(np, propname, &this_leaf->size);
8483 }
8584
8685 /* not cache_line_size() because that's a macro in include/linux/cache.h */
@@ -114,8 +113,7 @@ static void cache_nr_sets(struct cacheinfo *this_leaf, struct device_node *np) · 27 unmodified lines
114113 ct_idx = get_cacheinfo_idx(this_leaf->type);
115114 propname = cache_type_info[ct_idx].nr_sets_prop;
116115
117− if (of_property_read_u32(np, propname, &this_leaf->number_of_sets))
118− this_leaf->number_of_sets = 0;
116+ of_property_read_u32(np, propname, &this_leaf->number_of_sets);
119117 }
120118
121119 static void cache_associativity(struct cacheinfo *this_leaf)
drivers/base/power/main.c+3−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include <trace/events/power.h>
3333 #include <linux/cpufreq.h>
3434 #include <linux/cpuidle.h>
35+#include <linux/devfreq.h>
3536 #include <linux/timer.h>
3637
3738 #include "../base.h"
@@ -1078,6 +1079,7 @@ void dpm_resume(pm_message_t state) · 1040 unmodified lines
10781079 dpm_show_time(starttime, state, 0, NULL);
10791080
10801081 cpufreq_resume();
1082+ devfreq_resume();
10811083 trace_suspend_resume(TPS("dpm_resume"), state.event, false);
10821084 }
10831085
@@ -1852,6 +1854,7 @@ int dpm_suspend(pm_message_t state) · 768 unmodified lines
18521854 trace_suspend_resume(TPS("dpm_suspend"), state.event, true);
18531855 might_sleep();
18541856
1857+ devfreq_suspend();
18551858 cpufreq_suspend();
18561859
18571860 mutex_lock(&dpm_list_mtx);
drivers/base/power/runtime.c+12−9
@@ -121,7 +121,7 @@ static void pm_runtime_cancel_pending(struct device *dev) · 120 unmodified lines
121121 * Compute the autosuspend-delay expiration time based on the device's
122122 * power.last_busy time. If the delay has already expired or is disabled
123123 * (negative) or the power.use_autosuspend flag isn't set, return 0.
124− * Otherwise return the expiration time in jiffies (adjusted to be nonzero).
124+ * Otherwise return the expiration time in nanoseconds (adjusted to be nonzero).
125125 *
126126 * This function may be called either with or without dev->power.lock held.
127127 * Either way it can be racy, since power.last_busy may be updated at any time.
@@ -130,7 +130,7 @@ u64 pm_runtime_autosuspend_expiration(struct device *dev) · 2 unmodified lines
130130 {
131131 int autosuspend_delay;
132132 u64 last_busy, expires = 0;
133− u64 now = ktime_to_ns(ktime_get());
133+ u64 now = ktime_get_mono_fast_ns();
134134
135135 if (!dev->power.use_autosuspend)
136136 goto out;
@@ -141,7 +141,7 @@ u64 pm_runtime_autosuspend_expiration(struct device *dev) · 4 unmodified lines
141141
142142 last_busy = READ_ONCE(dev->power.last_busy);
143143
144− expires = last_busy + autosuspend_delay * NSEC_PER_MSEC;
144+ expires = last_busy + (u64)autosuspend_delay * NSEC_PER_MSEC;
145145 if (expires <= now)
146146 expires = 0; /* Already expired. */
147147
@@ -525,7 +525,7 @@ static int rpm_suspend(struct device *dev, int rpmflags) · 377 unmodified lines
525525 * We add a slack of 25% to gather wakeups
526526 * without sacrificing the granularity.
527527 */
528− u64 slack = READ_ONCE(dev->power.autosuspend_delay) *
528+ u64 slack = (u64)READ_ONCE(dev->power.autosuspend_delay) *
529529 (NSEC_PER_MSEC >> 2);
530530
531531 dev->power.timer_expires = expires;
@@ -905,8 +905,11 @@ static enum hrtimer_restart pm_suspend_timer_fn(struct hrtimer *timer) · 373 unmodified lines
905905 spin_lock_irqsave(&dev->power.lock, flags);
906906
907907 expires = dev->power.timer_expires;
908− /* If 'expire' is after 'jiffies' we've been called too early. */
909− if (expires > 0 && expires < ktime_to_ns(ktime_get())) {
908+ /*
909+ * If 'expires' is after the current time, we've been called
910+ * too early.
911+ */
912+ if (expires > 0 && expires < ktime_get_mono_fast_ns()) {
910913 dev->power.timer_expires = 0;
911914 rpm_suspend(dev, dev->power.timer_autosuspends ?
912915 (RPM_ASYNC | RPM_AUTO) : RPM_ASYNC);
@@ -925,7 +928,7 @@ static enum hrtimer_restart pm_suspend_timer_fn(struct hrtimer *timer) · 12 unmodified lines
925928 int pm_schedule_suspend(struct device *dev, unsigned int delay)
926929 {
927930 unsigned long flags;
928− ktime_t expires;
931+ u64 expires;
929932 int retval;
930933
931934 spin_lock_irqsave(&dev->power.lock, flags);
@@ -942,8 +945,8 @@ int pm_schedule_suspend(struct device *dev, unsigned int delay) · 10 unmodified lines
942945 /* Other scheduled or pending requests need to be canceled. */
943946 pm_runtime_cancel_pending(dev);
944947
945− expires = ktime_add(ktime_get(), ms_to_ktime(delay));
946− dev->power.timer_expires = ktime_to_ns(expires);
948+ expires = ktime_get_mono_fast_ns() + (u64)delay * NSEC_PER_MSEC;
949+ dev->power.timer_expires = expires;
947950 dev->power.timer_autosuspends = 0;
948951 hrtimer_start(&dev->power.suspend_timer, expires, HRTIMER_MODE_ABS);
949952
drivers/base/regmap/regmap-irq.c+7−1
@@ -108,6 +108,9 @@ static void regmap_irq_sync_unlock(struct irq_data *data) · 107 unmodified lines
108108 * suppress pointless writes.
109109 */
110110 for (i = 0; i < d->chip->num_regs; i++) {
111+ if (!d->chip->mask_base)
112+ continue;
113+
111114 reg = d->chip->mask_base +
112115 (i * map->reg_stride * d->irq_reg_stride);
113116 if (d->chip->mask_invert) {
@@ -258,7 +261,7 @@ static int regmap_irq_set_type(struct irq_data *data, unsigned int type) · 144 unmodified lines
258261 const struct regmap_irq_type *t = &irq_data->type;
259262
260263 if ((t->types_supported & type) != type)
261− return -ENOTSUPP;
264+ return 0;
262265
263266 reg = t->type_reg_offset / map->reg_stride;
264267
@@ -588,6 +591,9 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, · 323 unmodified lines
588591 /* Mask all the interrupts by default */
589592 for (i = 0; i < chip->num_regs; i++) {
590593 d->mask_buf[i] = d->mask_buf_def[i];
594+ if (!chip->mask_base)
595+ continue;
596+
591597 reg = chip->mask_base +
592598 (i * map->reg_stride * d->irq_reg_stride);
593599 if (chip->mask_invert)
drivers/block/loop.c+33−2
@@ -1190,6 +1190,12 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info) · 1189 unmodified lines
11901190 goto out_unlock;
11911191 }
11921192
1193+ if (lo->lo_offset != info->lo_offset ||
1194+ lo->lo_sizelimit != info->lo_sizelimit) {
1195+ sync_blockdev(lo->lo_device);
1196+ kill_bdev(lo->lo_device);
1197+ }
1198+
11931199 /* I/O need to be drained during transfer transition */
11941200 blk_mq_freeze_queue(lo->lo_queue);
11951201
@@ -1218,6 +1224,14 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info) · 22 unmodified lines
12181224
12191225 if (lo->lo_offset != info->lo_offset ||
12201226 lo->lo_sizelimit != info->lo_sizelimit) {
1227+ /* kill_bdev should have truncated all the pages */
1228+ if (lo->lo_device->bd_inode->i_mapping->nrpages) {
1229+ err = -EAGAIN;
1230+ pr_warn("%s: loop%d (%s) has still dirty pages (nrpages=%lu)\n",
1231+ __func__, lo->lo_number, lo->lo_file_name,
1232+ lo->lo_device->bd_inode->i_mapping->nrpages);
1233+ goto out_unfreeze;
1234+ }
12211235 if (figure_loop_size(lo, info->lo_offset, info->lo_sizelimit)) {
12221236 err = -EFBIG;
12231237 goto out_unfreeze;
@@ -1443,22 +1457,39 @@ static int loop_set_dio(struct loop_device *lo, unsigned long arg) · 219 unmodified lines
14431457
14441458 static int loop_set_block_size(struct loop_device *lo, unsigned long arg)
14451459 {
1460+ int err = 0;
1461+
14461462 if (lo->lo_state != Lo_bound)
14471463 return -ENXIO;
14481464
14491465 if (arg < 512 || arg > PAGE_SIZE || !is_power_of_2(arg))
14501466 return -EINVAL;
14511467
1468+ if (lo->lo_queue->limits.logical_block_size != arg) {
1469+ sync_blockdev(lo->lo_device);
1470+ kill_bdev(lo->lo_device);
1471+ }
1472+
14521473 blk_mq_freeze_queue(lo->lo_queue);
14531474
1475+ /* kill_bdev should have truncated all the pages */
1476+ if (lo->lo_queue->limits.logical_block_size != arg &&
1477+ lo->lo_device->bd_inode->i_mapping->nrpages) {
1478+ err = -EAGAIN;
1479+ pr_warn("%s: loop%d (%s) has still dirty pages (nrpages=%lu)\n",
1480+ __func__, lo->lo_number, lo->lo_file_name,
1481+ lo->lo_device->bd_inode->i_mapping->nrpages);
1482+ goto out_unfreeze;
1483+ }
1484+
14541485 blk_queue_logical_block_size(lo->lo_queue, arg);
14551486 blk_queue_physical_block_size(lo->lo_queue, arg);
14561487 blk_queue_io_min(lo->lo_queue, arg);
14571488 loop_update_dio(lo);
1458−
1489+out_unfreeze:
14591490 blk_mq_unfreeze_queue(lo->lo_queue);
14601491
1461− return 0;
1492+ return err;
14621493 }
14631494
14641495 static int lo_simple_ioctl(struct loop_device *lo, unsigned int cmd,
drivers/block/nbd.c+3−2
@@ -288,9 +288,10 @@ static void nbd_size_update(struct nbd_device *nbd) · 287 unmodified lines
288288 blk_queue_physical_block_size(nbd->disk->queue, config->blksize);
289289 set_capacity(nbd->disk, config->bytesize >> 9);
290290 if (bdev) {
291− if (bdev->bd_disk)
291+ if (bdev->bd_disk) {
292292 bd_set_size(bdev, config->bytesize);
293− else
293+ set_blocksize(bdev, config->blksize);
294+ } else
294295 bdev->bd_invalidated = 1;
295296 bdput(bdev);
296297 }
drivers/block/null_blk.h+1−0
@@ -97,6 +97,7 @@ void null_zone_reset(struct nullb_cmd *cmd, sector_t sector); · 96 unmodified lines
9797 #else
9898 static inline int null_zone_init(struct nullb_device *dev)
9999 {
100+ pr_err("null_blk: CONFIG_BLK_DEV_ZONED not enabled\n");
100101 return -EINVAL;
101102 }
102103 static inline void null_zone_exit(struct nullb_device *dev) {}
drivers/block/rbd.c+4−5
@@ -5986,7 +5986,6 @@ static ssize_t do_rbd_remove(struct bus_type *bus, · 5985 unmodified lines
59865986 struct list_head *tmp;
59875987 int dev_id;
59885988 char opt_buf[6];
5989− bool already = false;
59905989 bool force = false;
59915990 int ret;
59925991
@@ -6019,13 +6018,13 @@ static ssize_t do_rbd_remove(struct bus_type *bus, · 26 unmodified lines
60196018 spin_lock_irq(&rbd_dev->lock);
60206019 if (rbd_dev->open_count && !force)
60216020 ret = -EBUSY;
6022− else
6023− already = test_and_set_bit(RBD_DEV_FLAG_REMOVING,
6024− &rbd_dev->flags);
6021+ else if (test_and_set_bit(RBD_DEV_FLAG_REMOVING,
6022+ &rbd_dev->flags))
6023+ ret = -EINPROGRESS;
60256024 spin_unlock_irq(&rbd_dev->lock);
60266025 }
60276026 spin_unlock(&rbd_dev_list_lock);
6028− if (ret < 0 || already)
6027+ if (ret)
60296028 return ret;
60306029
60316030 if (force) {
drivers/block/skd_main.c+2−2
@@ -2641,8 +2641,8 @@ static int skd_cons_skcomp(struct skd_device *skdev) · 2640 unmodified lines
26412641 "comp pci_alloc, total bytes %zd entries %d\n",
26422642 SKD_SKCOMP_SIZE, SKD_N_COMPLETION_ENTRY);
26432643
2644− skcomp = dma_zalloc_coherent(&skdev->pdev->dev, SKD_SKCOMP_SIZE,
2645− &skdev->cq_dma_address, GFP_KERNEL);
2644+ skcomp = dma_alloc_coherent(&skdev->pdev->dev, SKD_SKCOMP_SIZE,
2645+ &skdev->cq_dma_address, GFP_KERNEL);
26462646
26472647 if (skcomp == NULL) {
26482648 rc = -ENOMEM;
drivers/block/zram/zram_drv.c+66−24
@@ -316,11 +316,9 @@ static ssize_t idle_store(struct device *dev, · 315 unmodified lines
316316 * See the comment in writeback_store.
317317 */
318318 zram_slot_lock(zram, index);
319− if (!zram_allocated(zram, index) ||
320− zram_test_flag(zram, index, ZRAM_UNDER_WB))
321− goto next;
322− zram_set_flag(zram, index, ZRAM_IDLE);
323−next:
319+ if (zram_allocated(zram, index) &&
320+ !zram_test_flag(zram, index, ZRAM_UNDER_WB))
321+ zram_set_flag(zram, index, ZRAM_IDLE);
324322 zram_slot_unlock(zram, index);
325323 }
326324
@@ -330,6 +328,41 @@ next: · 3 unmodified lines
330328 }
331329
332330 #ifdef CONFIG_ZRAM_WRITEBACK
331+static ssize_t writeback_limit_enable_store(struct device *dev,
332+ struct device_attribute *attr, const char *buf, size_t len)
333+{
334+ struct zram *zram = dev_to_zram(dev);
335+ u64 val;
336+ ssize_t ret = -EINVAL;
337+
338+ if (kstrtoull(buf, 10, &val))
339+ return ret;
340+
341+ down_read(&zram->init_lock);
342+ spin_lock(&zram->wb_limit_lock);
343+ zram->wb_limit_enable = val;
344+ spin_unlock(&zram->wb_limit_lock);
345+ up_read(&zram->init_lock);
346+ ret = len;
347+
348+ return ret;
349+}
350+
351+static ssize_t writeback_limit_enable_show(struct device *dev,
352+ struct device_attribute *attr, char *buf)
353+{
354+ bool val;
355+ struct zram *zram = dev_to_zram(dev);
356+
357+ down_read(&zram->init_lock);
358+ spin_lock(&zram->wb_limit_lock);
359+ val = zram->wb_limit_enable;
360+ spin_unlock(&zram->wb_limit_lock);
361+ up_read(&zram->init_lock);
362+
363+ return scnprintf(buf, PAGE_SIZE, "%d\n", val);
364+}
365+
333366 static ssize_t writeback_limit_store(struct device *dev,
334367 struct device_attribute *attr, const char *buf, size_t len)
335368 {
@@ -341,9 +374,9 @@ static ssize_t writeback_limit_store(struct device *dev, · 5 unmodified lines
341374 return ret;
342375
343376 down_read(&zram->init_lock);
344− atomic64_set(&zram->stats.bd_wb_limit, val);
345− if (val == 0)
346− zram->stop_writeback = false;
377+ spin_lock(&zram->wb_limit_lock);
378+ zram->bd_wb_limit = val;
379+ spin_unlock(&zram->wb_limit_lock);
347380 up_read(&zram->init_lock);
348381 ret = len;
349382
@@ -357,7 +390,9 @@ static ssize_t writeback_limit_show(struct device *dev, · 7 unmodified lines
357390 struct zram *zram = dev_to_zram(dev);
358391
359392 down_read(&zram->init_lock);
360− val = atomic64_read(&zram->stats.bd_wb_limit);
393+ spin_lock(&zram->wb_limit_lock);
394+ val = zram->bd_wb_limit;
395+ spin_unlock(&zram->wb_limit_lock);
361396 up_read(&zram->init_lock);
362397
363398 return scnprintf(buf, PAGE_SIZE, "%llu\n", val);
@@ -588,8 +623,8 @@ static int read_from_bdev_async(struct zram *zram, struct bio_vec *bvec, · 224 unmodified lines
588623 return 1;
589624 }
590625
591−#define HUGE_WRITEBACK 0x1
592−#define IDLE_WRITEBACK 0x2
626+#define HUGE_WRITEBACK 1
627+#define IDLE_WRITEBACK 2
593628
594629 static ssize_t writeback_store(struct device *dev,
595630 struct device_attribute *attr, const char *buf, size_t len)
@@ -602,7 +637,7 @@ static ssize_t writeback_store(struct device *dev, · 6 unmodified lines
602637 struct page *page;
603638 ssize_t ret, sz;
604639 char mode_buf[8];
605− unsigned long mode = -1UL;
640+ int mode = -1;
606641 unsigned long blk_idx = 0;
607642
608643 sz = strscpy(mode_buf, buf, sizeof(mode_buf));
@@ -618,7 +653,7 @@ static ssize_t writeback_store(struct device *dev, · 9 unmodified lines
618653 else if (!strcmp(mode_buf, "huge"))
619654 mode = HUGE_WRITEBACK;
620655
621− if (mode == -1UL)
656+ if (mode == -1)
622657 return -EINVAL;
623658
624659 down_read(&zram->init_lock);
@@ -645,10 +680,13 @@ static ssize_t writeback_store(struct device *dev, · 20 unmodified lines
645680 bvec.bv_len = PAGE_SIZE;
646681 bvec.bv_offset = 0;
647682
648− if (zram->stop_writeback) {
683+ spin_lock(&zram->wb_limit_lock);
684+ if (zram->wb_limit_enable && !zram->bd_wb_limit) {
685+ spin_unlock(&zram->wb_limit_lock);
649686 ret = -EIO;
650687 break;
651688 }
689+ spin_unlock(&zram->wb_limit_lock);
652690
653691 if (!blk_idx) {
654692 blk_idx = alloc_block_bdev(zram);
@@ -667,10 +705,11 @@ static ssize_t writeback_store(struct device *dev, · 12 unmodified lines
667705 zram_test_flag(zram, index, ZRAM_UNDER_WB))
668706 goto next;
669707
670− if ((mode & IDLE_WRITEBACK &&
671− !zram_test_flag(zram, index, ZRAM_IDLE)) &&
672− (mode & HUGE_WRITEBACK &&
673− !zram_test_flag(zram, index, ZRAM_HUGE)))
708+ if (mode == IDLE_WRITEBACK &&
709+ !zram_test_flag(zram, index, ZRAM_IDLE))
710+ goto next;
711+ if (mode == HUGE_WRITEBACK &&
712+ !zram_test_flag(zram, index, ZRAM_HUGE))
674713 goto next;
675714 /*
676715 * Clearing ZRAM_UNDER_WB is duty of caller.
@@ -732,11 +771,10 @@ static ssize_t writeback_store(struct device *dev, · 55 unmodified lines
732771 zram_set_element(zram, index, blk_idx);
733772 blk_idx = 0;
734773 atomic64_inc(&zram->stats.pages_stored);
735− if (atomic64_add_unless(&zram->stats.bd_wb_limit,
736− -1 << (PAGE_SHIFT - 12), 0)) {
737− if (atomic64_read(&zram->stats.bd_wb_limit) == 0)
738− zram->stop_writeback = true;
739− }
774+ spin_lock(&zram->wb_limit_lock);
775+ if (zram->wb_limit_enable && zram->bd_wb_limit > 0)
776+ zram->bd_wb_limit -= 1UL << (PAGE_SHIFT - 12);
777+ spin_unlock(&zram->wb_limit_lock);
740778 next:
741779 zram_slot_unlock(zram, index);
742780 }
@@ -1812,6 +1850,7 @@ static DEVICE_ATTR_RW(comp_algorithm); · 1069 unmodified lines
18121850 static DEVICE_ATTR_RW(backing_dev);
18131851 static DEVICE_ATTR_WO(writeback);
18141852 static DEVICE_ATTR_RW(writeback_limit);
1853+static DEVICE_ATTR_RW(writeback_limit_enable);
18151854 #endif
18161855
18171856 static struct attribute *zram_disk_attrs[] = {
@@ -1828,6 +1867,7 @@ static struct attribute *zram_disk_attrs[] = { · 10 unmodified lines
18281867 &dev_attr_backing_dev.attr,
18291868 &dev_attr_writeback.attr,
18301869 &dev_attr_writeback_limit.attr,
1870+ &dev_attr_writeback_limit_enable.attr,
18311871 #endif
18321872 &dev_attr_io_stat.attr,
18331873 &dev_attr_mm_stat.attr,
@@ -1867,7 +1907,9 @@ static int zram_add(void) · 33 unmodified lines
18671907 device_id = ret;
18681908
18691909 init_rwsem(&zram->init_lock);
1870−
1910+#ifdef CONFIG_ZRAM_WRITEBACK
1911+ spin_lock_init(&zram->wb_limit_lock);
1912+#endif
18711913 queue = blk_alloc_queue(GFP_KERNEL);
18721914 if (!queue) {
18731915 pr_err("Error allocating disk queue for device %d\n",
drivers/block/zram/zram_drv.h+3−2
@@ -86,7 +86,6 @@ struct zram_stats { · 85 unmodified lines
8686 atomic64_t bd_count; /* no. of pages in backing device */
8787 atomic64_t bd_reads; /* no. of reads from backing device */
8888 atomic64_t bd_writes; /* no. of writes from backing device */
89− atomic64_t bd_wb_limit; /* writeback limit of backing device */
9089 #endif
9190 };
9291
@@ -114,8 +113,10 @@ struct zram { · 21 unmodified lines
114113 */
115114 bool claim; /* Protected by bdev->bd_mutex */
116115 struct file *backing_dev;
117− bool stop_writeback;
118116 #ifdef CONFIG_ZRAM_WRITEBACK
117+ spinlock_t wb_limit_lock;
118+ bool wb_limit_enable;
119+ u64 bd_wb_limit;
119120 struct block_device *bdev;
120121 unsigned int old_block_size;
121122 unsigned long *bitmap;
drivers/char/ipmi/ipmi_msghandler.c+100−73
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include <linux/moduleparam.h>
3333 #include <linux/workqueue.h>
3434 #include <linux/uuid.h>
35+#include <linux/nospec.h>
3536
3637 #define IPMI_DRIVER_VERSION "39.2"
3738
@@ -62,7 +63,8 @@ static void ipmi_debug_msg(const char *title, unsigned char *data, · 24 unmodified lines
6263 { }
6364 #endif
6465
65−static int initialized;
66+static bool initialized;
67+static bool drvregistered;
6668
6769 enum ipmi_panic_event_op {
6870 IPMI_SEND_PANIC_EVENT_NONE,
@@ -612,7 +614,7 @@ static DEFINE_MUTEX(ipmidriver_mutex); · 543 unmodified lines
612614
613615 static LIST_HEAD(ipmi_interfaces);
614616 static DEFINE_MUTEX(ipmi_interfaces_mutex);
615−DEFINE_STATIC_SRCU(ipmi_interfaces_srcu);
617+struct srcu_struct ipmi_interfaces_srcu;
616618
617619 /*
618620 * List of watchers that want to know when smi's are added and deleted.
@@ -720,7 +722,15 @@ struct watcher_entry { · 101 unmodified lines
720722 int ipmi_smi_watcher_register(struct ipmi_smi_watcher *watcher)
721723 {
722724 struct ipmi_smi *intf;
723− int index;
725+ int index, rv;
726+
727+ /*
728+ * Make sure the driver is actually initialized, this handles
729+ * problems with initialization order.
730+ */
731+ rv = ipmi_init_msghandler();
732+ if (rv)
733+ return rv;
724734
725735 mutex_lock(&smi_watchers_mutex);
726736
@@ -884,7 +894,7 @@ static int deliver_response(struct ipmi_smi *intf, struct ipmi_recv_msg *msg) · 157 unmodified lines
884894
885895 if (user) {
886896 user->handler->ipmi_recv_hndl(msg, user->handler_data);
887− release_ipmi_user(msg->user, index);
897+ release_ipmi_user(user, index);
888898 } else {
889899 /* User went away, give up. */
890900 ipmi_free_recv_msg(msg);
@@ -1076,7 +1086,7 @@ int ipmi_create_user(unsigned int if_num, · 185 unmodified lines
10761086 {
10771087 unsigned long flags;
10781088 struct ipmi_user *new_user;
1079− int rv = 0, index;
1089+ int rv, index;
10801090 struct ipmi_smi *intf;
10811091
10821092 /*
@@ -1094,18 +1104,9 @@ int ipmi_create_user(unsigned int if_num, · 11 unmodified lines
10941104 * Make sure the driver is actually initialized, this handles
10951105 * problems with initialization order.
10961106 */
1097− if (!initialized) {
1098− rv = ipmi_init_msghandler();
1099− if (rv)
1100− return rv;
1101−
1102− /*
1103− * The init code doesn't return an error if it was turned
1104− * off, but it won't initialize. Check that.
1105− */
1106− if (!initialized)
1107− return -ENODEV;
1108− }
1107+ rv = ipmi_init_msghandler();
1108+ if (rv)
1109+ return rv;
11091110
11101111 new_user = kmalloc(sizeof(*new_user), GFP_KERNEL);
11111112 if (!new_user)
@@ -1183,6 +1184,7 @@ EXPORT_SYMBOL(ipmi_get_smi_info); · 71 unmodified lines
11831184 static void free_user(struct kref *ref)
11841185 {
11851186 struct ipmi_user *user = container_of(ref, struct ipmi_user, refcount);
1187+ cleanup_srcu_struct(&user->release_barrier);
11861188 kfree(user);
11871189 }
11881190
@@ -1259,7 +1261,6 @@ int ipmi_destroy_user(struct ipmi_user *user) · 70 unmodified lines
12591261 {
12601262 _ipmi_destroy_user(user);
12611263
1262− cleanup_srcu_struct(&user->release_barrier);
12631264 kref_put(&user->refcount, free_user);
12641265
12651266 return 0;
@@ -1298,10 +1299,12 @@ int ipmi_set_my_address(struct ipmi_user *user, · 32 unmodified lines
12981299 if (!user)
12991300 return -ENODEV;
13001301
1301− if (channel >= IPMI_MAX_CHANNELS)
1302+ if (channel >= IPMI_MAX_CHANNELS) {
13021303 rv = -EINVAL;
1303− else
1304+ } else {
1305+ channel = array_index_nospec(channel, IPMI_MAX_CHANNELS);
13041306 user->intf->addrinfo[channel].address = address;
1307+ }
13051308 release_ipmi_user(user, index);
13061309
13071310 return rv;
@@ -1318,10 +1321,12 @@ int ipmi_get_my_address(struct ipmi_user *user, · 10 unmodified lines
13181321 if (!user)
13191322 return -ENODEV;
13201323
1321− if (channel >= IPMI_MAX_CHANNELS)
1324+ if (channel >= IPMI_MAX_CHANNELS) {
13221325 rv = -EINVAL;
1323− else
1326+ } else {
1327+ channel = array_index_nospec(channel, IPMI_MAX_CHANNELS);
13241328 *address = user->intf->addrinfo[channel].address;
1329+ }
13251330 release_ipmi_user(user, index);
13261331
13271332 return rv;
@@ -1338,10 +1343,12 @@ int ipmi_set_my_LUN(struct ipmi_user *user, · 10 unmodified lines
13381343 if (!user)
13391344 return -ENODEV;
13401345
1341− if (channel >= IPMI_MAX_CHANNELS)
1346+ if (channel >= IPMI_MAX_CHANNELS) {
13421347 rv = -EINVAL;
1343− else
1348+ } else {
1349+ channel = array_index_nospec(channel, IPMI_MAX_CHANNELS);
13441350 user->intf->addrinfo[channel].lun = LUN & 0x3;
1351+ }
13451352 release_ipmi_user(user, index);
13461353
13471354 return rv;
@@ -1358,10 +1365,12 @@ int ipmi_get_my_LUN(struct ipmi_user *user, · 10 unmodified lines
13581365 if (!user)
13591366 return -ENODEV;
13601367
1361− if (channel >= IPMI_MAX_CHANNELS)
1368+ if (channel >= IPMI_MAX_CHANNELS) {
13621369 rv = -EINVAL;
1363− else
1370+ } else {
1371+ channel = array_index_nospec(channel, IPMI_MAX_CHANNELS);
13641372 *address = user->intf->addrinfo[channel].lun;
1373+ }
13651374 release_ipmi_user(user, index);
13661375
13671376 return rv;
@@ -2184,6 +2193,7 @@ static int check_addr(struct ipmi_smi *intf, · 816 unmodified lines
21842193 {
21852194 if (addr->channel >= IPMI_MAX_CHANNELS)
21862195 return -EINVAL;
2196+ addr->channel = array_index_nospec(addr->channel, IPMI_MAX_CHANNELS);
21872197 *lun = intf->addrinfo[addr->channel].lun;
21882198 *saddr = intf->addrinfo[addr->channel].address;
21892199 return 0;
@@ -3291,17 +3301,9 @@ int ipmi_register_smi(const struct ipmi_smi_handlers *handlers, · 1101 unmodified lines
32913301 * Make sure the driver is actually initialized, this handles
32923302 * problems with initialization order.
32933303 */
3294− if (!initialized) {
3295− rv = ipmi_init_msghandler();
3296− if (rv)
3297− return rv;
3298− /*
3299− * The init code doesn't return an error if it was turned
3300− * off, but it won't initialize. Check that.
3301− */
3302− if (!initialized)
3303− return -ENODEV;
3304− }
3304+ rv = ipmi_init_msghandler();
3305+ if (rv)
3306+ return rv;
33053307
33063308 intf = kzalloc(sizeof(*intf), GFP_KERNEL);
33073309 if (!intf)
@@ -5017,6 +5019,22 @@ static int panic_event(struct notifier_block *this, · 1709 unmodified lines
50175019 return NOTIFY_DONE;
50185020 }
50195021
5022+/* Must be called with ipmi_interfaces_mutex held. */
5023+static int ipmi_register_driver(void)
5024+{
5025+ int rv;
5026+
5027+ if (drvregistered)
5028+ return 0;
5029+
5030+ rv = driver_register(&ipmidriver.driver);
5031+ if (rv)
5032+ pr_err("Could not register IPMI driver\n");
5033+ else
5034+ drvregistered = true;
5035+ return rv;
5036+}
5037+
50205038 static struct notifier_block panic_block = {
50215039 .notifier_call = panic_event,
50225040 .next = NULL,
@@ -5027,66 +5045,75 @@ static int ipmi_init_msghandler(void) · 4 unmodified lines
50275045 {
50285046 int rv;
50295047
5048+ mutex_lock(&ipmi_interfaces_mutex);
5049+ rv = ipmi_register_driver();
5050+ if (rv)
5051+ goto out;
50305052 if (initialized)
5031− return 0;
5032−
5033− rv = driver_register(&ipmidriver.driver);
5034− if (rv) {
5035− pr_err("Could not register IPMI driver\n");
5036− return rv;
5037− }
5053+ goto out;
50385054
5039− pr_info("version " IPMI_DRIVER_VERSION "\n");
5055+ init_srcu_struct(&ipmi_interfaces_srcu);
50405056
50415057 timer_setup(&ipmi_timer, ipmi_timeout, 0);
50425058 mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES);
50435059
50445060 atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
50455061
5046− initialized = 1;
5062+ initialized = true;
50475063
5048− return 0;
5064+out:
5065+ mutex_unlock(&ipmi_interfaces_mutex);
5066+ return rv;
50495067 }
50505068
50515069 static int __init ipmi_init_msghandler_mod(void)
50525070 {
5053− ipmi_init_msghandler();
5054− return 0;
5071+ int rv;
5072+
5073+ pr_info("version " IPMI_DRIVER_VERSION "\n");
5074+
5075+ mutex_lock(&ipmi_interfaces_mutex);
5076+ rv = ipmi_register_driver();
5077+ mutex_unlock(&ipmi_interfaces_mutex);
5078+
5079+ return rv;
50555080 }
50565081
50575082 static void __exit cleanup_ipmi(void)
50585083 {
50595084 int count;
50605085
5061− if (!initialized)
5062− return;
5063−
5064− atomic_notifier_chain_unregister(&panic_notifier_list, &panic_block);
5086+ if (initialized) {
5087+ atomic_notifier_chain_unregister(&panic_notifier_list,
5088+ &panic_block);
50655089
5066− /*
5067− * This can't be called if any interfaces exist, so no worry
5068− * about shutting down the interfaces.
5069− */
5090+ /*
5091+ * This can't be called if any interfaces exist, so no worry
5092+ * about shutting down the interfaces.
5093+ */
50705094
5071− /*
5072− * Tell the timer to stop, then wait for it to stop. This
5073− * avoids problems with race conditions removing the timer
5074− * here.
5075− */
5076− atomic_inc(&stop_operation);
5077− del_timer_sync(&ipmi_timer);
5095+ /*
5096+ * Tell the timer to stop, then wait for it to stop. This
5097+ * avoids problems with race conditions removing the timer
5098+ * here.
5099+ */
5100+ atomic_inc(&stop_operation);
5101+ del_timer_sync(&ipmi_timer);
50785102
5079− driver_unregister(&ipmidriver.driver);
5103+ initialized = false;
50805104
5081− initialized = 0;
5105+ /* Check for buffer leaks. */
5106+ count = atomic_read(&smi_msg_inuse_count);
5107+ if (count != 0)
5108+ pr_warn("SMI message count %d at exit\n", count);
5109+ count = atomic_read(&recv_msg_inuse_count);
5110+ if (count != 0)
5111+ pr_warn("recv message count %d at exit\n", count);
50825112
5083− /* Check for buffer leaks. */
5084− count = atomic_read(&smi_msg_inuse_count);
5085− if (count != 0)
5086− pr_warn("SMI message count %d at exit\n", count);
5087− count = atomic_read(&recv_msg_inuse_count);
5088− if (count != 0)
5089− pr_warn("recv message count %d at exit\n", count);
5113+ cleanup_srcu_struct(&ipmi_interfaces_srcu);
5114+ }
5115+ if (drvregistered)
5116+ driver_unregister(&ipmidriver.driver);
50905117 }
50915118 module_exit(cleanup_ipmi);
50925119
drivers/char/ipmi/ipmi_ssif.c+17−8
@@ -632,8 +632,9 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, · 631 unmodified lines
632632
633633 /* Remove the multi-part read marker. */
634634 len -= 2;
635+ data += 2;
635636 for (i = 0; i < len; i++)
636− ssif_info->data[i] = data[i+2];
637+ ssif_info->data[i] = data[i];
637638 ssif_info->multi_len = len;
638639 ssif_info->multi_pos = 1;
639640
@@ -661,8 +662,19 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, · 21 unmodified lines
661662 }
662663
663664 blocknum = data[0];
665+ len--;
666+ data++;
667+
668+ if (blocknum != 0xff && len != 31) {
669+ /* All blocks but the last must have 31 data bytes. */
670+ result = -EIO;
671+ if (ssif_info->ssif_debug & SSIF_DEBUG_MSG)
672+ pr_info("Received middle message <31\n");
664673
665− if (ssif_info->multi_len + len - 1 > IPMI_MAX_MSG_LENGTH) {
674+ goto continue_op;
675+ }
676+
677+ if (ssif_info->multi_len + len > IPMI_MAX_MSG_LENGTH) {
666678 /* Received message too big, abort the operation. */
667679 result = -E2BIG;
668680 if (ssif_info->ssif_debug & SSIF_DEBUG_MSG)
@@ -671,16 +683,14 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, · 2 unmodified lines
671683 goto continue_op;
672684 }
673685
674− /* Remove the blocknum from the data. */
675− len--;
676686 for (i = 0; i < len; i++)
677− ssif_info->data[i + ssif_info->multi_len] = data[i + 1];
687+ ssif_info->data[i + ssif_info->multi_len] = data[i];
678688 ssif_info->multi_len += len;
679689 if (blocknum == 0xff) {
680690 /* End of read */
681691 len = ssif_info->multi_len;
682692 data = ssif_info->data;
683− } else if (blocknum + 1 != ssif_info->multi_pos) {
693+ } else if (blocknum != ssif_info->multi_pos) {
684694 /*
685695 * Out of sequence block, just abort. Block
686696 * numbers start at zero for the second block,
@@ -707,6 +717,7 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, · 20 unmodified lines
707717 }
708718 }
709719
720+ continue_op:
710721 if (result < 0) {
711722 ssif_inc_stat(ssif_info, receive_errors);
712723 } else {
@@ -714,8 +725,6 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, · 1 unmodified line
714725 ssif_inc_stat(ssif_info, received_message_parts);
715726 }
716727
717−
718− continue_op:
719728 if (ssif_info->ssif_debug & SSIF_DEBUG_STATE)
720729 pr_info("DONE 1: state = %d, result=%d\n",
721730 ssif_info->ssif_state, result);
drivers/char/mwave/mwavedd.c+7−0
@@ -59,6 +59,7 @@ · 58 unmodified lines
5959 #include <linux/mutex.h>
6060 #include <linux/delay.h>
6161 #include <linux/serial_8250.h>
62+#include <linux/nospec.h>
6263 #include "smapi.h"
6364 #include "mwavedd.h"
6465 #include "3780i.h"
@@ -289,6 +290,8 @@ static long mwave_ioctl(struct file *file, unsigned int iocmd, · 224 unmodified lines
289290 ipcnum);
290291 return -EINVAL;
291292 }
293+ ipcnum = array_index_nospec(ipcnum,
294+ ARRAY_SIZE(pDrvData->IPCs));
292295 PRINTK_3(TRACE_MWAVE,
293296 "mwavedd::mwave_ioctl IOCTL_MW_REGISTER_IPC"
294297 " ipcnum %x entry usIntCount %x\n",
@@ -317,6 +320,8 @@ static long mwave_ioctl(struct file *file, unsigned int iocmd, · 22 unmodified lines
317320 " Invalid ipcnum %x\n", ipcnum);
318321 return -EINVAL;
319322 }
323+ ipcnum = array_index_nospec(ipcnum,
324+ ARRAY_SIZE(pDrvData->IPCs));
320325 PRINTK_3(TRACE_MWAVE,
321326 "mwavedd::mwave_ioctl IOCTL_MW_GET_IPC"
322327 " ipcnum %x, usIntCount %x\n",
@@ -383,6 +388,8 @@ static long mwave_ioctl(struct file *file, unsigned int iocmd, · 60 unmodified lines
383388 ipcnum);
384389 return -EINVAL;
385390 }
391+ ipcnum = array_index_nospec(ipcnum,
392+ ARRAY_SIZE(pDrvData->IPCs));
386393 mutex_lock(&mwave_mutex);
387394 if (pDrvData->IPCs[ipcnum].bIsEnabled == true) {
388395 pDrvData->IPCs[ipcnum].bIsEnabled = false;
drivers/clk/Kconfig+0−1
@@ -293,7 +293,6 @@ config COMMON_CLK_BD718XX · 292 unmodified lines
293293 source "drivers/clk/actions/Kconfig"
294294 source "drivers/clk/bcm/Kconfig"
295295 source "drivers/clk/hisilicon/Kconfig"
296−source "drivers/clk/imx/Kconfig"
297296 source "drivers/clk/imgtec/Kconfig"
298297 source "drivers/clk/imx/Kconfig"
299298 source "drivers/clk/ingenic/Kconfig"
drivers/clk/clk-versaclock5.c+3−1
@@ -262,8 +262,10 @@ static int vc5_mux_set_parent(struct clk_hw *hw, u8 index) · 261 unmodified lines
262262
263263 if (vc5->clk_mux_ins == VC5_MUX_IN_XIN)
264264 src = VC5_PRIM_SRC_SHDN_EN_XTAL;
265− if (vc5->clk_mux_ins == VC5_MUX_IN_CLKIN)
265+ else if (vc5->clk_mux_ins == VC5_MUX_IN_CLKIN)
266266 src = VC5_PRIM_SRC_SHDN_EN_CLKIN;
267+ else /* Invalid; should have been caught by vc5_probe() */
268+ return -EINVAL;
267269 }
268270
269271 return regmap_update_bits(vc5->regmap, VC5_PRIM_SRC_SHDN, mask, src);
drivers/clk/clk.c+13−3
@@ -1513,9 +1513,19 @@ static int clk_fetch_parent_index(struct clk_core *core, · 1512 unmodified lines
15131513 if (!parent)
15141514 return -EINVAL;
15151515
1516− for (i = 0; i < core->num_parents; i++)
1517− if (clk_core_get_parent_by_index(core, i) == parent)
1516+ for (i = 0; i < core->num_parents; i++) {
1517+ if (core->parents[i] == parent)
1518+ return i;
1519+
1520+ if (core->parents[i])
1521+ continue;
1522+
1523+ /* Fallback to comparing globally unique names */
1524+ if (!strcmp(parent->name, core->parent_names[i])) {
1525+ core->parents[i] = parent;
15181526 return i;
1527+ }
1528+ }
15191529
15201530 return -EINVAL;
15211531 }
@@ -2779,7 +2789,7 @@ static void clk_dump_one(struct seq_file *s, struct clk_core *c, int level) · 1257 unmodified lines
27792789 seq_printf(s, "\"protect_count\": %d,", c->protect_count);
27802790 seq_printf(s, "\"rate\": %lu,", clk_core_get_rate(c));
27812791 seq_printf(s, "\"accuracy\": %lu,", clk_core_get_accuracy(c));
2782− seq_printf(s, "\"phase\": %d", clk_core_get_phase(c));
2792+ seq_printf(s, "\"phase\": %d,", clk_core_get_phase(c));
27832793 seq_printf(s, "\"duty_cycle\": %u",
27842794 clk_core_get_scaled_duty_cycle(c, 100000));
27852795 }
drivers/clk/imx/clk-frac-pll.c+3−2
@@ -155,13 +155,14 @@ static int clk_pll_set_rate(struct clk_hw *hw, unsigned long rate, · 154 unmodified lines
155155 {
156156 struct clk_frac_pll *pll = to_clk_frac_pll(hw);
157157 u32 val, divfi, divff;
158− u64 temp64 = parent_rate;
158+ u64 temp64;
159159 int ret;
160160
161161 parent_rate *= 8;
162162 rate *= 2;
163163 divfi = rate / parent_rate;
164− temp64 *= rate - divfi;
164+ temp64 = parent_rate * divfi;
165+ temp64 = rate - temp64;
165166 temp64 *= PLL_FRAC_DENOM;
166167 do_div(temp64, parent_rate);
167168 divff = temp64;
drivers/clk/imx/clk-imx8qxp-lpcg.c+2−0
@@ -169,6 +169,8 @@ static int imx8qxp_lpcg_clk_probe(struct platform_device *pdev) · 168 unmodified lines
169169 return -ENODEV;
170170
171171 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
172+ if (!res)
173+ return -EINVAL;
172174 base = devm_ioremap(dev, res->start, resource_size(res));
173175 if (!base)
174176 return -ENOMEM;
drivers/clk/mmp/clk-of-mmp2.c+0−4
@@ -53,7 +53,6 @@ · 52 unmodified lines
5353 #define APMU_DISP1 0x110
5454 #define APMU_CCIC0 0x50
5555 #define APMU_CCIC1 0xf4
56−#define APMU_SP 0x68
5756 #define MPMU_UART_PLL 0x14
5857
5958 struct mmp2_clk_unit {
@@ -210,8 +209,6 @@ static struct mmp_clk_mix_config ccic1_mix_config = { · 150 unmodified lines
210209 .reg_info = DEFINE_MIX_REG_INFO(4, 16, 2, 6, 32),
211210 };
212211
213−static DEFINE_SPINLOCK(sp_lock);
214−
215212 static struct mmp_param_mux_clk apmu_mux_clks[] = {
216213 {MMP2_CLK_DISP0_MUX, "disp0_mux", disp_parent_names, ARRAY_SIZE(disp_parent_names), CLK_SET_RATE_PARENT, APMU_DISP0, 6, 2, 0, &disp0_lock},
217214 {MMP2_CLK_DISP1_MUX, "disp1_mux", disp_parent_names, ARRAY_SIZE(disp_parent_names), CLK_SET_RATE_PARENT, APMU_DISP1, 6, 2, 0, &disp1_lock},
@@ -242,7 +239,6 @@ static struct mmp_param_gate_clk apmu_gate_clks[] = { · 24 unmodified lines
242239 {MMP2_CLK_CCIC1, "ccic1_clk", "ccic1_mix_clk", CLK_SET_RATE_PARENT, APMU_CCIC1, 0x1b, 0x1b, 0x0, 0, &ccic1_lock},
243240 {MMP2_CLK_CCIC1_PHY, "ccic1_phy_clk", "ccic1_mix_clk", CLK_SET_RATE_PARENT, APMU_CCIC1, 0x24, 0x24, 0x0, 0, &ccic1_lock},
244241 {MMP2_CLK_CCIC1_SPHY, "ccic1_sphy_clk", "ccic1_sphy_div", CLK_SET_RATE_PARENT, APMU_CCIC1, 0x300, 0x300, 0x0, 0, &ccic1_lock},
245− {MMP2_CLK_SP, "sp_clk", NULL, CLK_SET_RATE_PARENT, APMU_SP, 0x1b, 0x1b, 0x0, 0, &sp_lock},
246242 };
247243
248244 static void mmp2_axi_periph_clk_init(struct mmp2_clk_unit *pxa_unit)
drivers/clk/qcom/Kconfig+1−0
@@ -215,6 +215,7 @@ config MSM_MMCC_8996 · 214 unmodified lines
215215
216216 config MSM_GCC_8998
217217 tristate "MSM8998 Global Clock Controller"
218+ select QCOM_GDSC
218219 help
219220 Support for the global clock controller on msm8998 devices.
220221 Say Y if you want to use peripheral devices such as UART, SPI,
drivers/clk/qcom/gcc-sdm845.c+10−4
@@ -115,8 +115,8 @@ static const char * const gcc_parent_names_6[] = { · 114 unmodified lines
115115 "core_bi_pll_test_se",
116116 };
117117
118−static const char * const gcc_parent_names_7[] = {
119− "bi_tcxo",
118+static const char * const gcc_parent_names_7_ao[] = {
119+ "bi_tcxo_ao",
120120 "gpll0",
121121 "gpll0_out_even",
122122 "core_bi_pll_test_se",
@@ -128,6 +128,12 @@ static const char * const gcc_parent_names_8[] = { · 5 unmodified lines
128128 "core_bi_pll_test_se",
129129 };
130130
131+static const char * const gcc_parent_names_8_ao[] = {
132+ "bi_tcxo_ao",
133+ "gpll0",
134+ "core_bi_pll_test_se",
135+};
136+
131137 static const struct parent_map gcc_parent_map_10[] = {
132138 { P_BI_TCXO, 0 },
133139 { P_GPLL0_OUT_MAIN, 1 },
@@ -210,7 +216,7 @@ static struct clk_rcg2 gcc_cpuss_ahb_clk_src = { · 76 unmodified lines
210216 .freq_tbl = ftbl_gcc_cpuss_ahb_clk_src,
211217 .clkr.hw.init = &(struct clk_init_data){
212218 .name = "gcc_cpuss_ahb_clk_src",
213− .parent_names = gcc_parent_names_7,
219+ .parent_names = gcc_parent_names_7_ao,
214220 .num_parents = 4,
215221 .ops = &clk_rcg2_ops,
216222 },
@@ -229,7 +235,7 @@ static struct clk_rcg2 gcc_cpuss_rbcpr_clk_src = { · 12 unmodified lines
229235 .freq_tbl = ftbl_gcc_cpuss_rbcpr_clk_src,
230236 .clkr.hw.init = &(struct clk_init_data){
231237 .name = "gcc_cpuss_rbcpr_clk_src",
232− .parent_names = gcc_parent_names_8,
238+ .parent_names = gcc_parent_names_8_ao,
233239 .num_parents = 3,
234240 .ops = &clk_rcg2_ops,
235241 },
drivers/clk/socfpga/clk-pll-s10.c+1−1
@@ -43,7 +43,7 @@ static unsigned long clk_pll_recalc_rate(struct clk_hw *hwclk, · 42 unmodified lines
4343 /* Read mdiv and fdiv from the fdbck register */
4444 reg = readl(socfpgaclk->hw.reg + 0x4);
4545 mdiv = (reg & SOCFPGA_PLL_MDIV_MASK) >> SOCFPGA_PLL_MDIV_SHIFT;
46− vco_freq = (unsigned long long)parent_rate * (mdiv + 6);
46+ vco_freq = (unsigned long long)vco_freq * (mdiv + 6);
4747
4848 return (unsigned long)vco_freq;
4949 }
drivers/clk/socfpga/clk-s10.c+10−10
@@ -12,17 +12,17 @@ · 11 unmodified lines
1212
1313 #include "stratix10-clk.h"
1414
15−static const char * const pll_mux[] = { "osc1", "cb_intosc_hs_div2_clk",
16− "f2s_free_clk",};
15+static const char * const pll_mux[] = { "osc1", "cb-intosc-hs-div2-clk",
16+ "f2s-free-clk",};
1717 static const char * const cntr_mux[] = { "main_pll", "periph_pll",
18− "osc1", "cb_intosc_hs_div2_clk",
19− "f2s_free_clk"};
20−static const char * const boot_mux[] = { "osc1", "cb_intosc_hs_div2_clk",};
18+ "osc1", "cb-intosc-hs-div2-clk",
19+ "f2s-free-clk"};
20+static const char * const boot_mux[] = { "osc1", "cb-intosc-hs-div2-clk",};
2121
2222 static const char * const noc_free_mux[] = {"main_noc_base_clk",
2323 "peri_noc_base_clk",
24− "osc1", "cb_intosc_hs_div2_clk",
25− "f2s_free_clk"};
24+ "osc1", "cb-intosc-hs-div2-clk",
25+ "f2s-free-clk"};
2626
2727 static const char * const emaca_free_mux[] = {"peri_emaca_clk", "boot_clk"};
2828 static const char * const emacb_free_mux[] = {"peri_emacb_clk", "boot_clk"};
@@ -33,14 +33,14 @@ static const char * const s2f_usr1_free_mux[] = {"peri_s2f_usr1_clk", "boot_clk" · 4 unmodified lines
3333 static const char * const psi_ref_free_mux[] = {"peri_psi_ref_clk", "boot_clk"};
3434 static const char * const mpu_mux[] = { "mpu_free_clk", "boot_clk",};
3535
36−static const char * const s2f_usr0_mux[] = {"f2s_free_clk", "boot_clk"};
36+static const char * const s2f_usr0_mux[] = {"f2s-free-clk", "boot_clk"};
3737 static const char * const emac_mux[] = {"emaca_free_clk", "emacb_free_clk"};
3838 static const char * const noc_mux[] = {"noc_free_clk", "boot_clk"};
3939
4040 static const char * const mpu_free_mux[] = {"main_mpu_base_clk",
4141 "peri_mpu_base_clk",
42− "osc1", "cb_intosc_hs_div2_clk",
43− "f2s_free_clk"};
42+ "osc1", "cb-intosc-hs-div2-clk",
43+ "f2s-free-clk"};
4444
4545 /* clocks in AO (always on) controller */
4646 static const struct stratix10_pll_clock s10_pll_clks[] = {
drivers/clk/tegra/clk-tegra124-dfll-fcpu.c+3−1
@@ -133,9 +133,11 @@ static int tegra124_dfll_fcpu_remove(struct platform_device *pdev) · 132 unmodified lines
133133 struct tegra_dfll_soc_data *soc;
134134
135135 soc = tegra_dfll_unregister(pdev);
136− if (IS_ERR(soc))
136+ if (IS_ERR(soc)) {
137137 dev_err(&pdev->dev, "failed to unregister DFLL: %ld\n",
138138 PTR_ERR(soc));
139+ return PTR_ERR(soc);
140+ }
139141
140142 tegra_cvb_remove_opp_table(soc->dev, soc->cvb, soc->max_freq);
141143
drivers/clk/ti/divider.c+10−1
@@ -403,8 +403,10 @@ int ti_clk_parse_divider_data(int *div_table, int num_dividers, int max_div, · 402 unmodified lines
403403 num_dividers = i;
404404
405405 tmp = kcalloc(valid_div + 1, sizeof(*tmp), GFP_KERNEL);
406− if (!tmp)
406+ if (!tmp) {
407+ *table = ERR_PTR(-ENOMEM);
407408 return -ENOMEM;
409+ }
408410
409411 valid_div = 0;
410412 *width = 0;
@@ -439,6 +441,7 @@ struct clk_hw *ti_clk_build_component_div(struct ti_clk_divider *setup) · 28 unmodified lines
439441 {
440442 struct clk_omap_divider *div;
441443 struct clk_omap_reg *reg;
444+ int ret;
442445
443446 if (!setup)
444447 return NULL;
@@ -458,6 +461,12 @@ struct clk_hw *ti_clk_build_component_div(struct ti_clk_divider *setup) · 13 unmodified lines
458461 div->flags |= CLK_DIVIDER_POWER_OF_TWO;
459462
460463 div->table = _get_div_table_from_setup(setup, &div->width);
464+ if (IS_ERR(div->table)) {
465+ ret = PTR_ERR(div->table);
466+ kfree(div);
467+ return ERR_PTR(ret);
468+ }
469+
461470
462471 div->shift = setup->bit_shift;
463472 div->latch = -EINVAL;
drivers/clk/zynqmp/clkc.c+2−2
@@ -669,8 +669,8 @@ static int zynqmp_clk_setup(struct device_node *np) · 668 unmodified lines
669669 if (ret)
670670 return ret;
671671
672− zynqmp_data = kzalloc(sizeof(*zynqmp_data) + sizeof(*zynqmp_data) *
673− clock_max_idx, GFP_KERNEL);
672+ zynqmp_data = kzalloc(struct_size(zynqmp_data, hws, clock_max_idx),
673+ GFP_KERNEL);
674674 if (!zynqmp_data)
675675 return -ENOMEM;
676676
drivers/cpufreq/cpufreq.c+4−8
@@ -1530,17 +1530,16 @@ static unsigned int __cpufreq_get(struct cpufreq_policy *policy) · 1529 unmodified lines
15301530 {
15311531 unsigned int ret_freq = 0;
15321532
1533− if (!cpufreq_driver->get)
1533+ if (unlikely(policy_is_inactive(policy)) || !cpufreq_driver->get)
15341534 return ret_freq;
15351535
15361536 ret_freq = cpufreq_driver->get(policy->cpu);
15371537
15381538 /*
1539− * Updating inactive policies is invalid, so avoid doing that. Also
1540− * if fast frequency switching is used with the given policy, the check
1539+ * If fast frequency switching is used with the given policy, the check
15411540 * against policy->cur is pointless, so skip it in that case too.
15421541 */
1543− if (unlikely(policy_is_inactive(policy)) || policy->fast_switch_enabled)
1542+ if (policy->fast_switch_enabled)
15441543 return ret_freq;
15451544
15461545 if (ret_freq && policy->cur &&
@@ -1569,10 +1568,7 @@ unsigned int cpufreq_get(unsigned int cpu) · 22 unmodified lines
15691568
15701569 if (policy) {
15711570 down_read(&policy->rwsem);
1572−
1573− if (!policy_is_inactive(policy))
1574− ret_freq = __cpufreq_get(policy);
1575−
1571+ ret_freq = __cpufreq_get(policy);
15761572 up_read(&policy->rwsem);
15771573
15781574 cpufreq_cpu_put(policy);
drivers/cpufreq/scmi-cpufreq.c+4−4
@@ -52,9 +52,9 @@ scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index) · 51 unmodified lines
5252 int ret;
5353 struct scmi_data *priv = policy->driver_data;
5454 struct scmi_perf_ops *perf_ops = handle->perf_ops;
55− u64 freq = policy->freq_table[index].frequency * 1000;
55+ u64 freq = policy->freq_table[index].frequency;
5656
57− ret = perf_ops->freq_set(handle, priv->domain_id, freq, false);
57+ ret = perf_ops->freq_set(handle, priv->domain_id, freq * 1000, false);
5858 if (!ret)
5959 arch_set_freq_scale(policy->related_cpus, freq,
6060 policy->cpuinfo.max_freq);
@@ -176,7 +176,7 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) · 115 unmodified lines
176176 out_free_priv:
177177 kfree(priv);
178178 out_free_opp:
179− dev_pm_opp_cpumask_remove_table(policy->cpus);
179+ dev_pm_opp_remove_all_dynamic(cpu_dev);
180180
181181 return ret;
182182 }
@@ -188,7 +188,7 @@ static int scmi_cpufreq_exit(struct cpufreq_policy *policy) · 5 unmodified lines
188188 cpufreq_cooling_unregister(priv->cdev);
189189 dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table);
190190 kfree(priv);
191− dev_pm_opp_cpumask_remove_table(policy->related_cpus);
191+ dev_pm_opp_remove_all_dynamic(priv->cpu_dev);
192192
193193 return 0;
194194 }
drivers/cpufreq/scpi-cpufreq.c+2−2
@@ -177,7 +177,7 @@ out_free_cpufreq_table: · 176 unmodified lines
177177 out_free_priv:
178178 kfree(priv);
179179 out_free_opp:
180− dev_pm_opp_cpumask_remove_table(policy->cpus);
180+ dev_pm_opp_remove_all_dynamic(cpu_dev);
181181
182182 return ret;
183183 }
@@ -190,7 +190,7 @@ static int scpi_cpufreq_exit(struct cpufreq_policy *policy) · 6 unmodified lines
190190 clk_put(priv->clk);
191191 dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table);
192192 kfree(priv);
193− dev_pm_opp_cpumask_remove_table(policy->related_cpus);
193+ dev_pm_opp_remove_all_dynamic(priv->cpu_dev);
194194
195195 return 0;
196196 }
drivers/cpuidle/poll_state.c+1−1
@@ -21,7 +21,7 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev, · 20 unmodified lines
2121 local_irq_enable();
2222 if (!current_set_polling_and_test()) {
2323 unsigned int loop_count = 0;
24− u64 limit = TICK_USEC;
24+ u64 limit = TICK_NSEC;
2525 int i;
2626
2727 for (i = 1; i < drv->state_count; i++) {
drivers/crypto/Kconfig+1−0
@@ -692,6 +692,7 @@ config CRYPTO_DEV_BCM_SPU · 691 unmodified lines
692692 depends on ARCH_BCM_IPROC
693693 depends on MAILBOX
694694 default m
695+ select CRYPTO_AUTHENC
695696 select CRYPTO_DES
696697 select CRYPTO_MD5
697698 select CRYPTO_SHA1
drivers/crypto/amcc/crypto4xx_core.c+3−3
@@ -283,9 +283,9 @@ static u32 crypto4xx_put_pd_to_pdr(struct crypto4xx_device *dev, u32 idx) · 282 unmodified lines
283283 */
284284 static u32 crypto4xx_build_gdr(struct crypto4xx_device *dev)
285285 {
286− dev->gdr = dma_zalloc_coherent(dev->core_dev->device,
287− sizeof(struct ce_gd) * PPC4XX_NUM_GD,
288− &dev->gdr_pa, GFP_ATOMIC);
286+ dev->gdr = dma_alloc_coherent(dev->core_dev->device,
287+ sizeof(struct ce_gd) * PPC4XX_NUM_GD,
288+ &dev->gdr_pa, GFP_ATOMIC);
289289 if (!dev->gdr)
290290 return -ENOMEM;
291291
drivers/crypto/bcm/cipher.c+13−31
@@ -2845,44 +2845,28 @@ static int aead_authenc_setkey(struct crypto_aead *cipher, · 2844 unmodified lines
28452845 struct spu_hw *spu = &iproc_priv.spu;
28462846 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher);
28472847 struct crypto_tfm *tfm = crypto_aead_tfm(cipher);
2848− struct rtattr *rta = (void *)key;
2849− struct crypto_authenc_key_param *param;
2850− const u8 *origkey = key;
2851− const unsigned int origkeylen = keylen;
2852−
2853− int ret = 0;
2848+ struct crypto_authenc_keys keys;
2849+ int ret;
28542850
28552851 flow_log("%s() aead:%p key:%p keylen:%u\n", __func__, cipher, key,
28562852 keylen);
28572853 flow_dump(" key: ", key, keylen);
28582854
2859− if (!RTA_OK(rta, keylen))
2860− goto badkey;
2861− if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM)
2862− goto badkey;
2863− if (RTA_PAYLOAD(rta) < sizeof(*param))
2855+ ret = crypto_authenc_extractkeys(&keys, key, keylen);
2856+ if (ret)
28642857 goto badkey;
28652858
2866− param = RTA_DATA(rta);
2867− ctx->enckeylen = be32_to_cpu(param->enckeylen);
2868−
2869− key += RTA_ALIGN(rta->rta_len);
2870− keylen -= RTA_ALIGN(rta->rta_len);
2871−
2872− if (keylen < ctx->enckeylen)
2873− goto badkey;
2874− if (ctx->enckeylen > MAX_KEY_SIZE)
2859+ if (keys.enckeylen > MAX_KEY_SIZE ||
2860+ keys.authkeylen > MAX_KEY_SIZE)
28752861 goto badkey;
28762862
2877− ctx->authkeylen = keylen - ctx->enckeylen;
2878−
2879− if (ctx->authkeylen > MAX_KEY_SIZE)
2880− goto badkey;
2863+ ctx->enckeylen = keys.enckeylen;
2864+ ctx->authkeylen = keys.authkeylen;
28812865
2882− memcpy(ctx->enckey, key + ctx->authkeylen, ctx->enckeylen);
2866+ memcpy(ctx->enckey, keys.enckey, keys.enckeylen);
28832867 /* May end up padding auth key. So make sure it's zeroed. */
28842868 memset(ctx->authkey, 0, sizeof(ctx->authkey));
2885− memcpy(ctx->authkey, key, ctx->authkeylen);
2869+ memcpy(ctx->authkey, keys.authkey, keys.authkeylen);
28862870
28872871 switch (ctx->alg->cipher_info.alg) {
28882872 case CIPHER_ALG_DES:
@@ -2890,7 +2874,7 @@ static int aead_authenc_setkey(struct crypto_aead *cipher, · 1 unmodified line
28902874 u32 tmp[DES_EXPKEY_WORDS];
28912875 u32 flags = CRYPTO_TFM_RES_WEAK_KEY;
28922876
2893− if (des_ekey(tmp, key) == 0) {
2877+ if (des_ekey(tmp, keys.enckey) == 0) {
28942878 if (crypto_aead_get_flags(cipher) &
28952879 CRYPTO_TFM_REQ_WEAK_KEY) {
28962880 crypto_aead_set_flags(cipher, flags);
@@ -2905,7 +2889,7 @@ static int aead_authenc_setkey(struct crypto_aead *cipher, · 8 unmodified lines
29052889 break;
29062890 case CIPHER_ALG_3DES:
29072891 if (ctx->enckeylen == (DES_KEY_SIZE * 3)) {
2908− const u32 *K = (const u32 *)key;
2892+ const u32 *K = (const u32 *)keys.enckey;
29092893 u32 flags = CRYPTO_TFM_RES_BAD_KEY_SCHED;
29102894
29112895 if (!((K[0] ^ K[2]) | (K[1] ^ K[3])) ||
@@ -2956,9 +2940,7 @@ static int aead_authenc_setkey(struct crypto_aead *cipher, · 44 unmodified lines
29562940 ctx->fallback_cipher->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK;
29572941 ctx->fallback_cipher->base.crt_flags |=
29582942 tfm->crt_flags & CRYPTO_TFM_REQ_MASK;
2959− ret =
2960− crypto_aead_setkey(ctx->fallback_cipher, origkey,
2961− origkeylen);
2943+ ret = crypto_aead_setkey(ctx->fallback_cipher, key, keylen);
29622944 if (ret) {
29632945 flow_log(" fallback setkey() returned:%d\n", ret);
29642946 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK;
drivers/crypto/caam/caamalg.c+1−1
@@ -3476,7 +3476,7 @@ static int __init caam_algapi_init(void) · 3475 unmodified lines
34763476 * Skip algorithms requiring message digests
34773477 * if MD or MD size is not supported by device.
34783478 */
3479− if ((c2_alg_sel & ~OP_ALG_ALGSEL_SUBMASK) == 0x40 &&
3479+ if (is_mdha(c2_alg_sel) &&
34803480 (!md_inst || t_alg->aead.maxauthsize > md_limit))
34813481 continue;
34823482
drivers/crypto/caam/caamhash.c+9−6
@@ -1072,13 +1072,16 @@ static int ahash_final_no_ctx(struct ahash_request *req) · 1071 unmodified lines
10721072
10731073 desc = edesc->hw_desc;
10741074
1075− state->buf_dma = dma_map_single(jrdev, buf, buflen, DMA_TO_DEVICE);
1076− if (dma_mapping_error(jrdev, state->buf_dma)) {
1077− dev_err(jrdev, "unable to map src\n");
1078− goto unmap;
1079− }
1075+ if (buflen) {
1076+ state->buf_dma = dma_map_single(jrdev, buf, buflen,
1077+ DMA_TO_DEVICE);
1078+ if (dma_mapping_error(jrdev, state->buf_dma)) {
1079+ dev_err(jrdev, "unable to map src\n");
1080+ goto unmap;
1081+ }
10801082
1081− append_seq_in_ptr(desc, state->buf_dma, buflen, 0);
1083+ append_seq_in_ptr(desc, state->buf_dma, buflen, 0);
1084+ }
10821085
10831086 edesc->dst_dma = map_seq_out_ptr_result(desc, jrdev, req->result,
10841087 digestsize);
drivers/crypto/caam/desc.h+1−0
@@ -1155,6 +1155,7 @@ · 1154 unmodified lines
11551155 #define OP_ALG_ALGSEL_DES (0x20 << OP_ALG_ALGSEL_SHIFT)
11561156 #define OP_ALG_ALGSEL_3DES (0x21 << OP_ALG_ALGSEL_SHIFT)
11571157 #define OP_ALG_ALGSEL_ARC4 (0x30 << OP_ALG_ALGSEL_SHIFT)
1158+#define OP_ALG_CHA_MDHA (0x40 << OP_ALG_ALGSEL_SHIFT)
11581159 #define OP_ALG_ALGSEL_MD5 (0x40 << OP_ALG_ALGSEL_SHIFT)
11591160 #define OP_ALG_ALGSEL_SHA1 (0x41 << OP_ALG_ALGSEL_SHIFT)
11601161 #define OP_ALG_ALGSEL_SHA224 (0x42 << OP_ALG_ALGSEL_SHIFT)
drivers/crypto/caam/error.h+9−0
@@ -7,6 +7,9 @@ · 6 unmodified lines
77
88 #ifndef CAAM_ERROR_H
99 #define CAAM_ERROR_H
10+
11+#include "desc.h"
12+
1013 #define CAAM_ERROR_STR_MAX 302
1114
1215 void caam_strstatus(struct device *dev, u32 status, bool qi_v2);
@@ -17,4 +20,10 @@ void caam_strstatus(struct device *dev, u32 status, bool qi_v2); · 4 unmodified lines
1720 void caam_dump_sg(const char *level, const char *prefix_str, int prefix_type,
1821 int rowsize, int groupsize, struct scatterlist *sg,
1922 size_t tlen, bool ascii);
23+
24+static inline bool is_mdha(u32 algtype)
25+{
26+ return (algtype & OP_ALG_ALGSEL_MASK & ~OP_ALG_ALGSEL_SUBMASK) ==
27+ OP_ALG_CHA_MDHA;
28+}
2029 #endif /* CAAM_ERROR_H */
drivers/crypto/cavium/cpt/cptpf_main.c+2−2
@@ -278,8 +278,8 @@ static int cpt_ucode_load_fw(struct cpt_device *cpt, const u8 *fw, bool is_ae) · 277 unmodified lines
278278 mcode->num_cores = is_ae ? 6 : 10;
279279
280280 /* Allocate DMAable space */
281− mcode->code = dma_zalloc_coherent(&cpt->pdev->dev, mcode->code_size,
282− &mcode->phys_base, GFP_KERNEL);
281+ mcode->code = dma_alloc_coherent(&cpt->pdev->dev, mcode->code_size,
282+ &mcode->phys_base, GFP_KERNEL);
283283 if (!mcode->code) {
284284 dev_err(dev, "Unable to allocate space for microcode");
285285 ret = -ENOMEM;
drivers/crypto/cavium/cpt/cptvf_main.c+4−3
@@ -236,9 +236,10 @@ static int alloc_command_queues(struct cpt_vf *cptvf, · 235 unmodified lines
236236
237237 c_size = (rem_q_size > qcsize_bytes) ? qcsize_bytes :
238238 rem_q_size;
239− curr->head = (u8 *)dma_zalloc_coherent(&pdev->dev,
240− c_size + CPT_NEXT_CHUNK_PTR_SIZE,
241− &curr->dma_addr, GFP_KERNEL);
239+ curr->head = (u8 *)dma_alloc_coherent(&pdev->dev,
240+ c_size + CPT_NEXT_CHUNK_PTR_SIZE,
241+ &curr->dma_addr,
242+ GFP_KERNEL);
242243 if (!curr->head) {
243244 dev_err(&pdev->dev, "Command Q (%d) chunk (%d) allocation failed\n",
244245 i, queue->nchunks);
drivers/crypto/cavium/nitrox/nitrox_lib.c+3−3
@@ -25,9 +25,9 @@ static int nitrox_cmdq_init(struct nitrox_cmdq *cmdq, int align_bytes) · 24 unmodified lines
2525 struct nitrox_device *ndev = cmdq->ndev;
2626
2727 cmdq->qsize = (ndev->qlen * cmdq->instr_size) + align_bytes;
28− cmdq->unalign_base = dma_zalloc_coherent(DEV(ndev), cmdq->qsize,
29− &cmdq->unalign_dma,
30− GFP_KERNEL);
28+ cmdq->unalign_base = dma_alloc_coherent(DEV(ndev), cmdq->qsize,
29+ &cmdq->unalign_dma,
30+ GFP_KERNEL);
3131 if (!cmdq->unalign_base)
3232 return -ENOMEM;
3333
drivers/crypto/cavium/nitrox/nitrox_reqmgr.c+6−4
@@ -537,6 +537,8 @@ static void process_response_list(struct nitrox_cmdq *cmdq) · 536 unmodified lines
537537 struct nitrox_device *ndev = cmdq->ndev;
538538 struct nitrox_softreq *sr;
539539 int req_completed = 0, err = 0, budget;
540+ completion_t callback;
541+ void *cb_arg;
540542
541543 /* check all pending requests */
542544 budget = atomic_read(&cmdq->pending_count);
@@ -564,13 +566,13 @@ static void process_response_list(struct nitrox_cmdq *cmdq) · 21 unmodified lines
564566 smp_mb__after_atomic();
565567 /* remove from response list */
566568 response_list_del(sr, cmdq);
567−
568569 /* ORH error code */
569570 err = READ_ONCE(*sr->resp.orh) & 0xff;
571+ callback = sr->callback;
572+ cb_arg = sr->cb_arg;
570573 softreq_destroy(sr);
571−
572− if (sr->callback)
573− sr->callback(sr->cb_arg, err);
574+ if (callback)
575+ callback(cb_arg, err);
574576
575577 req_completed++;
576578 }
drivers/crypto/ccp/ccp-dev-v5.c+3−3
@@ -822,9 +822,9 @@ static int ccp5_init(struct ccp_device *ccp) · 821 unmodified lines
822822 /* Page alignment satisfies our needs for N <= 128 */
823823 BUILD_BUG_ON(COMMANDS_PER_QUEUE > 128);
824824 cmd_q->qsize = Q_SIZE(Q_DESC_SIZE);
825− cmd_q->qbase = dma_zalloc_coherent(dev, cmd_q->qsize,
826− &cmd_q->qbase_dma,
827− GFP_KERNEL);
825+ cmd_q->qbase = dma_alloc_coherent(dev, cmd_q->qsize,
826+ &cmd_q->qbase_dma,
827+ GFP_KERNEL);
828828 if (!cmd_q->qbase) {
829829 dev_err(dev, "unable to allocate command queue\n");
830830 ret = -ENOMEM;
drivers/crypto/ccree/cc_aead.c+19−21
@@ -549,13 +549,12 @@ static int cc_aead_setkey(struct crypto_aead *tfm, const u8 *key, · 548 unmodified lines
549549 unsigned int keylen)
550550 {
551551 struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm);
552− struct rtattr *rta = (struct rtattr *)key;
553552 struct cc_crypto_req cc_req = {};
554− struct crypto_authenc_key_param *param;
555553 struct cc_hw_desc desc[MAX_AEAD_SETKEY_SEQ];
556− int rc = -EINVAL;
557554 unsigned int seq_len = 0;
558555 struct device *dev = drvdata_to_dev(ctx->drvdata);
556+ const u8 *enckey, *authkey;
557+ int rc;
559558
560559 dev_dbg(dev, "Setting key in context @%p for %s. key=%p keylen=%u\n",
561560 ctx, crypto_tfm_alg_name(crypto_aead_tfm(tfm)), key, keylen);
@@ -563,35 +562,33 @@ static int cc_aead_setkey(struct crypto_aead *tfm, const u8 *key, · 1 unmodified line
563562 /* STAT_PHASE_0: Init and sanity checks */
564563
565564 if (ctx->auth_mode != DRV_HASH_NULL) { /* authenc() alg. */
566− if (!RTA_OK(rta, keylen))
567− goto badkey;
568− if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM)
569− goto badkey;
570− if (RTA_PAYLOAD(rta) < sizeof(*param))
571− goto badkey;
572− param = RTA_DATA(rta);
573− ctx->enc_keylen = be32_to_cpu(param->enckeylen);
574− key += RTA_ALIGN(rta->rta_len);
575− keylen -= RTA_ALIGN(rta->rta_len);
576− if (keylen < ctx->enc_keylen)
565+ struct crypto_authenc_keys keys;
566+
567+ rc = crypto_authenc_extractkeys(&keys, key, keylen);
568+ if (rc)
577569 goto badkey;
578− ctx->auth_keylen = keylen - ctx->enc_keylen;
570+ enckey = keys.enckey;
571+ authkey = keys.authkey;
572+ ctx->enc_keylen = keys.enckeylen;
573+ ctx->auth_keylen = keys.authkeylen;
579574
580575 if (ctx->cipher_mode == DRV_CIPHER_CTR) {
581576 /* the nonce is stored in bytes at end of key */
577+ rc = -EINVAL;
582578 if (ctx->enc_keylen <
583579 (AES_MIN_KEY_SIZE + CTR_RFC3686_NONCE_SIZE))
584580 goto badkey;
585581 /* Copy nonce from last 4 bytes in CTR key to
586582 * first 4 bytes in CTR IV
587583 */
588− memcpy(ctx->ctr_nonce, key + ctx->auth_keylen +
589− ctx->enc_keylen - CTR_RFC3686_NONCE_SIZE,
590− CTR_RFC3686_NONCE_SIZE);
584+ memcpy(ctx->ctr_nonce, enckey + ctx->enc_keylen -
585+ CTR_RFC3686_NONCE_SIZE, CTR_RFC3686_NONCE_SIZE);
591586 /* Set CTR key size */
592587 ctx->enc_keylen -= CTR_RFC3686_NONCE_SIZE;
593588 }
594589 } else { /* non-authenc - has just one key */
590+ enckey = key;
591+ authkey = NULL;
595592 ctx->enc_keylen = keylen;
596593 ctx->auth_keylen = 0;
597594 }
@@ -603,13 +600,14 @@ static int cc_aead_setkey(struct crypto_aead *tfm, const u8 *key, · 5 unmodified lines
603600 /* STAT_PHASE_1: Copy key to ctx */
604601
605602 /* Get key material */
606− memcpy(ctx->enckey, key + ctx->auth_keylen, ctx->enc_keylen);
603+ memcpy(ctx->enckey, enckey, ctx->enc_keylen);
607604 if (ctx->enc_keylen == 24)
608605 memset(ctx->enckey + 24, 0, CC_AES_KEY_SIZE_MAX - 24);
609606 if (ctx->auth_mode == DRV_HASH_XCBC_MAC) {
610− memcpy(ctx->auth_state.xcbc.xcbc_keys, key, ctx->auth_keylen);
607+ memcpy(ctx->auth_state.xcbc.xcbc_keys, authkey,
608+ ctx->auth_keylen);
611609 } else if (ctx->auth_mode != DRV_HASH_NULL) { /* HMAC */
612− rc = cc_get_plain_hmac_key(tfm, key, ctx->auth_keylen);
610+ rc = cc_get_plain_hmac_key(tfm, authkey, ctx->auth_keylen);
613611 if (rc)
614612 goto badkey;
615613 }
drivers/crypto/hisilicon/sec/sec_algs.c+2−2
@@ -241,8 +241,8 @@ static int sec_alg_skcipher_setkey(struct crypto_skcipher *tfm, · 240 unmodified lines
241241 memset(ctx->key, 0, SEC_MAX_CIPHER_KEY);
242242 } else {
243243 /* new key */
244− ctx->key = dma_zalloc_coherent(dev, SEC_MAX_CIPHER_KEY,
245− &ctx->pkey, GFP_KERNEL);
244+ ctx->key = dma_alloc_coherent(dev, SEC_MAX_CIPHER_KEY,
245+ &ctx->pkey, GFP_KERNEL);
246246 if (!ctx->key) {
247247 mutex_unlock(&ctx->lock);
248248 return -ENOMEM;
drivers/crypto/hisilicon/sec/sec_drv.c+6−9
@@ -1082,9 +1082,8 @@ static int sec_queue_res_cfg(struct sec_queue *queue) · 1081 unmodified lines
10821082 struct sec_queue_ring_db *ring_db = &queue->ring_db;
10831083 int ret;
10841084
1085− ring_cmd->vaddr = dma_zalloc_coherent(dev, SEC_Q_CMD_SIZE,
1086− &ring_cmd->paddr,
1087− GFP_KERNEL);
1085+ ring_cmd->vaddr = dma_alloc_coherent(dev, SEC_Q_CMD_SIZE,
1086+ &ring_cmd->paddr, GFP_KERNEL);
10881087 if (!ring_cmd->vaddr)
10891088 return -ENOMEM;
10901089
@@ -1092,17 +1091,15 @@ static int sec_queue_res_cfg(struct sec_queue *queue) · 1 unmodified line
10921091 mutex_init(&ring_cmd->lock);
10931092 ring_cmd->callback = sec_alg_callback;
10941093
1095− ring_cq->vaddr = dma_zalloc_coherent(dev, SEC_Q_CQ_SIZE,
1096− &ring_cq->paddr,
1097− GFP_KERNEL);
1094+ ring_cq->vaddr = dma_alloc_coherent(dev, SEC_Q_CQ_SIZE,
1095+ &ring_cq->paddr, GFP_KERNEL);
10981096 if (!ring_cq->vaddr) {
10991097 ret = -ENOMEM;
11001098 goto err_free_ring_cmd;
11011099 }
11021100
1103− ring_db->vaddr = dma_zalloc_coherent(dev, SEC_Q_DB_SIZE,
1104− &ring_db->paddr,
1105− GFP_KERNEL);
1101+ ring_db->vaddr = dma_alloc_coherent(dev, SEC_Q_DB_SIZE,
1102+ &ring_db->paddr, GFP_KERNEL);
11061103 if (!ring_db->vaddr) {
11071104 ret = -ENOMEM;
11081105 goto err_free_ring_cq;
drivers/crypto/ixp4xx_crypto.c+3−3
@@ -260,9 +260,9 @@ static int setup_crypt_desc(void) · 259 unmodified lines
260260 {
261261 struct device *dev = &pdev->dev;
262262 BUILD_BUG_ON(sizeof(struct crypt_ctl) != 64);
263− crypt_virt = dma_zalloc_coherent(dev,
264− NPE_QLEN * sizeof(struct crypt_ctl),
265− &crypt_phys, GFP_ATOMIC);
263+ crypt_virt = dma_alloc_coherent(dev,
264+ NPE_QLEN * sizeof(struct crypt_ctl),
265+ &crypt_phys, GFP_ATOMIC);
266266 if (!crypt_virt)
267267 return -ENOMEM;
268268 return 0;
drivers/crypto/mediatek/mtk-platform.c+8−8
@@ -453,17 +453,17 @@ static int mtk_desc_ring_alloc(struct mtk_cryp *cryp) · 452 unmodified lines
453453 if (!ring[i])
454454 goto err_cleanup;
455455
456− ring[i]->cmd_base = dma_zalloc_coherent(cryp->dev,
457− MTK_DESC_RING_SZ,
458− &ring[i]->cmd_dma,
459− GFP_KERNEL);
456+ ring[i]->cmd_base = dma_alloc_coherent(cryp->dev,
457+ MTK_DESC_RING_SZ,
458+ &ring[i]->cmd_dma,
459+ GFP_KERNEL);
460460 if (!ring[i]->cmd_base)
461461 goto err_cleanup;
462462
463− ring[i]->res_base = dma_zalloc_coherent(cryp->dev,
464− MTK_DESC_RING_SZ,
465− &ring[i]->res_dma,
466− GFP_KERNEL);
463+ ring[i]->res_base = dma_alloc_coherent(cryp->dev,
464+ MTK_DESC_RING_SZ,
465+ &ring[i]->res_dma,
466+ GFP_KERNEL);
467467 if (!ring[i]->res_base)
468468 goto err_cleanup;
469469
drivers/crypto/qat/qat_common/adf_admin.c+6−6
@@ -244,18 +244,18 @@ int adf_init_admin_comms(struct adf_accel_dev *accel_dev) · 243 unmodified lines
244244 dev_to_node(&GET_DEV(accel_dev)));
245245 if (!admin)
246246 return -ENOMEM;
247− admin->virt_addr = dma_zalloc_coherent(&GET_DEV(accel_dev), PAGE_SIZE,
248− &admin->phy_addr, GFP_KERNEL);
247+ admin->virt_addr = dma_alloc_coherent(&GET_DEV(accel_dev), PAGE_SIZE,
248+ &admin->phy_addr, GFP_KERNEL);
249249 if (!admin->virt_addr) {
250250 dev_err(&GET_DEV(accel_dev), "Failed to allocate dma buff\n");
251251 kfree(admin);
252252 return -ENOMEM;
253253 }
254254
255− admin->virt_tbl_addr = dma_zalloc_coherent(&GET_DEV(accel_dev),
256− PAGE_SIZE,
257− &admin->const_tbl_addr,
258− GFP_KERNEL);
255+ admin->virt_tbl_addr = dma_alloc_coherent(&GET_DEV(accel_dev),
256+ PAGE_SIZE,
257+ &admin->const_tbl_addr,
258+ GFP_KERNEL);
259259 if (!admin->virt_tbl_addr) {
260260 dev_err(&GET_DEV(accel_dev), "Failed to allocate const_tbl\n");
261261 dma_free_coherent(&GET_DEV(accel_dev), PAGE_SIZE,
drivers/crypto/qat/qat_common/qat_algs.c+12−12
@@ -601,15 +601,15 @@ static int qat_alg_aead_setkey(struct crypto_aead *tfm, const uint8_t *key, · 600 unmodified lines
601601
602602 dev = &GET_DEV(inst->accel_dev);
603603 ctx->inst = inst;
604− ctx->enc_cd = dma_zalloc_coherent(dev, sizeof(*ctx->enc_cd),
605− &ctx->enc_cd_paddr,
606− GFP_ATOMIC);
604+ ctx->enc_cd = dma_alloc_coherent(dev, sizeof(*ctx->enc_cd),
605+ &ctx->enc_cd_paddr,
606+ GFP_ATOMIC);
607607 if (!ctx->enc_cd) {
608608 return -ENOMEM;
609609 }
610− ctx->dec_cd = dma_zalloc_coherent(dev, sizeof(*ctx->dec_cd),
611− &ctx->dec_cd_paddr,
612− GFP_ATOMIC);
610+ ctx->dec_cd = dma_alloc_coherent(dev, sizeof(*ctx->dec_cd),
611+ &ctx->dec_cd_paddr,
612+ GFP_ATOMIC);
613613 if (!ctx->dec_cd) {
614614 goto out_free_enc;
615615 }
@@ -933,16 +933,16 @@ static int qat_alg_ablkcipher_setkey(struct crypto_ablkcipher *tfm, · 317 unmodified lines
933933
934934 dev = &GET_DEV(inst->accel_dev);
935935 ctx->inst = inst;
936− ctx->enc_cd = dma_zalloc_coherent(dev, sizeof(*ctx->enc_cd),
937− &ctx->enc_cd_paddr,
938− GFP_ATOMIC);
936+ ctx->enc_cd = dma_alloc_coherent(dev, sizeof(*ctx->enc_cd),
937+ &ctx->enc_cd_paddr,
938+ GFP_ATOMIC);
939939 if (!ctx->enc_cd) {
940940 spin_unlock(&ctx->lock);
941941 return -ENOMEM;
942942 }
943− ctx->dec_cd = dma_zalloc_coherent(dev, sizeof(*ctx->dec_cd),
944− &ctx->dec_cd_paddr,
945− GFP_ATOMIC);
943+ ctx->dec_cd = dma_alloc_coherent(dev, sizeof(*ctx->dec_cd),
944+ &ctx->dec_cd_paddr,
945+ GFP_ATOMIC);
946946 if (!ctx->dec_cd) {
947947 spin_unlock(&ctx->lock);
948948 goto out_free_enc;
drivers/crypto/qat/qat_common/qat_asym_algs.c+34−34
@@ -332,10 +332,10 @@ static int qat_dh_compute_value(struct kpp_request *req) · 331 unmodified lines
332332 } else {
333333 int shift = ctx->p_size - req->src_len;
334334
335− qat_req->src_align = dma_zalloc_coherent(dev,
336− ctx->p_size,
337− &qat_req->in.dh.in.b,
338− GFP_KERNEL);
335+ qat_req->src_align = dma_alloc_coherent(dev,
336+ ctx->p_size,
337+ &qat_req->in.dh.in.b,
338+ GFP_KERNEL);
339339 if (unlikely(!qat_req->src_align))
340340 return ret;
341341
@@ -360,9 +360,9 @@ static int qat_dh_compute_value(struct kpp_request *req) · 18 unmodified lines
360360 goto unmap_src;
361361
362362 } else {
363− qat_req->dst_align = dma_zalloc_coherent(dev, ctx->p_size,
364− &qat_req->out.dh.r,
365− GFP_KERNEL);
363+ qat_req->dst_align = dma_alloc_coherent(dev, ctx->p_size,
364+ &qat_req->out.dh.r,
365+ GFP_KERNEL);
366366 if (unlikely(!qat_req->dst_align))
367367 goto unmap_src;
368368 }
@@ -447,7 +447,7 @@ static int qat_dh_set_params(struct qat_dh_ctx *ctx, struct dh *params) · 78 unmodified lines
447447 return -EINVAL;
448448
449449 ctx->p_size = params->p_size;
450− ctx->p = dma_zalloc_coherent(dev, ctx->p_size, &ctx->dma_p, GFP_KERNEL);
450+ ctx->p = dma_alloc_coherent(dev, ctx->p_size, &ctx->dma_p, GFP_KERNEL);
451451 if (!ctx->p)
452452 return -ENOMEM;
453453 memcpy(ctx->p, params->p, ctx->p_size);
@@ -458,7 +458,7 @@ static int qat_dh_set_params(struct qat_dh_ctx *ctx, struct dh *params) · 4 unmodified lines
458458 return 0;
459459 }
460460
461− ctx->g = dma_zalloc_coherent(dev, ctx->p_size, &ctx->dma_g, GFP_KERNEL);
461+ ctx->g = dma_alloc_coherent(dev, ctx->p_size, &ctx->dma_g, GFP_KERNEL);
462462 if (!ctx->g)
463463 return -ENOMEM;
464464 memcpy(ctx->g + (ctx->p_size - params->g_size), params->g,
@@ -503,8 +503,8 @@ static int qat_dh_set_secret(struct crypto_kpp *tfm, const void *buf, · 38 unmodified lines
503503 if (ret < 0)
504504 goto err_clear_ctx;
505505
506− ctx->xa = dma_zalloc_coherent(dev, ctx->p_size, &ctx->dma_xa,
507− GFP_KERNEL);
506+ ctx->xa = dma_alloc_coherent(dev, ctx->p_size, &ctx->dma_xa,
507+ GFP_KERNEL);
508508 if (!ctx->xa) {
509509 ret = -ENOMEM;
510510 goto err_clear_ctx;
@@ -737,9 +737,9 @@ static int qat_rsa_enc(struct akcipher_request *req) · 226 unmodified lines
737737 } else {
738738 int shift = ctx->key_sz - req->src_len;
739739
740− qat_req->src_align = dma_zalloc_coherent(dev, ctx->key_sz,
741− &qat_req->in.rsa.enc.m,
742− GFP_KERNEL);
740+ qat_req->src_align = dma_alloc_coherent(dev, ctx->key_sz,
741+ &qat_req->in.rsa.enc.m,
742+ GFP_KERNEL);
743743 if (unlikely(!qat_req->src_align))
744744 return ret;
745745
@@ -756,9 +756,9 @@ static int qat_rsa_enc(struct akcipher_request *req) · 10 unmodified lines
756756 goto unmap_src;
757757
758758 } else {
759− qat_req->dst_align = dma_zalloc_coherent(dev, ctx->key_sz,
760− &qat_req->out.rsa.enc.c,
761− GFP_KERNEL);
759+ qat_req->dst_align = dma_alloc_coherent(dev, ctx->key_sz,
760+ &qat_req->out.rsa.enc.c,
761+ GFP_KERNEL);
762762 if (unlikely(!qat_req->dst_align))
763763 goto unmap_src;
764764
@@ -881,9 +881,9 @@ static int qat_rsa_dec(struct akcipher_request *req) · 116 unmodified lines
881881 } else {
882882 int shift = ctx->key_sz - req->src_len;
883883
884− qat_req->src_align = dma_zalloc_coherent(dev, ctx->key_sz,
885− &qat_req->in.rsa.dec.c,
886− GFP_KERNEL);
884+ qat_req->src_align = dma_alloc_coherent(dev, ctx->key_sz,
885+ &qat_req->in.rsa.dec.c,
886+ GFP_KERNEL);
887887 if (unlikely(!qat_req->src_align))
888888 return ret;
889889
@@ -900,9 +900,9 @@ static int qat_rsa_dec(struct akcipher_request *req) · 10 unmodified lines
900900 goto unmap_src;
901901
902902 } else {
903− qat_req->dst_align = dma_zalloc_coherent(dev, ctx->key_sz,
904− &qat_req->out.rsa.dec.m,
905− GFP_KERNEL);
903+ qat_req->dst_align = dma_alloc_coherent(dev, ctx->key_sz,
904+ &qat_req->out.rsa.dec.m,
905+ GFP_KERNEL);
906906 if (unlikely(!qat_req->dst_align))
907907 goto unmap_src;
908908
@@ -989,7 +989,7 @@ static int qat_rsa_set_n(struct qat_rsa_ctx *ctx, const char *value, · 80 unmodified lines
989989 goto err;
990990
991991 ret = -ENOMEM;
992− ctx->n = dma_zalloc_coherent(dev, ctx->key_sz, &ctx->dma_n, GFP_KERNEL);
992+ ctx->n = dma_alloc_coherent(dev, ctx->key_sz, &ctx->dma_n, GFP_KERNEL);
993993 if (!ctx->n)
994994 goto err;
995995
@@ -1018,7 +1018,7 @@ static int qat_rsa_set_e(struct qat_rsa_ctx *ctx, const char *value, · 22 unmodified lines
10181018 return -EINVAL;
10191019 }
10201020
1021− ctx->e = dma_zalloc_coherent(dev, ctx->key_sz, &ctx->dma_e, GFP_KERNEL);
1021+ ctx->e = dma_alloc_coherent(dev, ctx->key_sz, &ctx->dma_e, GFP_KERNEL);
10221022 if (!ctx->e)
10231023 return -ENOMEM;
10241024
@@ -1044,7 +1044,7 @@ static int qat_rsa_set_d(struct qat_rsa_ctx *ctx, const char *value, · 19 unmodified lines
10441044 goto err;
10451045
10461046 ret = -ENOMEM;
1047− ctx->d = dma_zalloc_coherent(dev, ctx->key_sz, &ctx->dma_d, GFP_KERNEL);
1047+ ctx->d = dma_alloc_coherent(dev, ctx->key_sz, &ctx->dma_d, GFP_KERNEL);
10481048 if (!ctx->d)
10491049 goto err;
10501050
@@ -1077,7 +1077,7 @@ static void qat_rsa_setkey_crt(struct qat_rsa_ctx *ctx, struct rsa_key *rsa_key) · 26 unmodified lines
10771077 qat_rsa_drop_leading_zeros(&ptr, &len);
10781078 if (!len)
10791079 goto err;
1080− ctx->p = dma_zalloc_coherent(dev, half_key_sz, &ctx->dma_p, GFP_KERNEL);
1080+ ctx->p = dma_alloc_coherent(dev, half_key_sz, &ctx->dma_p, GFP_KERNEL);
10811081 if (!ctx->p)
10821082 goto err;
10831083 memcpy(ctx->p + (half_key_sz - len), ptr, len);
@@ -1088,7 +1088,7 @@ static void qat_rsa_setkey_crt(struct qat_rsa_ctx *ctx, struct rsa_key *rsa_key) · 4 unmodified lines
10881088 qat_rsa_drop_leading_zeros(&ptr, &len);
10891089 if (!len)
10901090 goto free_p;
1091− ctx->q = dma_zalloc_coherent(dev, half_key_sz, &ctx->dma_q, GFP_KERNEL);
1091+ ctx->q = dma_alloc_coherent(dev, half_key_sz, &ctx->dma_q, GFP_KERNEL);
10921092 if (!ctx->q)
10931093 goto free_p;
10941094 memcpy(ctx->q + (half_key_sz - len), ptr, len);
@@ -1099,8 +1099,8 @@ static void qat_rsa_setkey_crt(struct qat_rsa_ctx *ctx, struct rsa_key *rsa_key) · 4 unmodified lines
10991099 qat_rsa_drop_leading_zeros(&ptr, &len);
11001100 if (!len)
11011101 goto free_q;
1102− ctx->dp = dma_zalloc_coherent(dev, half_key_sz, &ctx->dma_dp,
1103− GFP_KERNEL);
1102+ ctx->dp = dma_alloc_coherent(dev, half_key_sz, &ctx->dma_dp,
1103+ GFP_KERNEL);
11041104 if (!ctx->dp)
11051105 goto free_q;
11061106 memcpy(ctx->dp + (half_key_sz - len), ptr, len);
@@ -1111,8 +1111,8 @@ static void qat_rsa_setkey_crt(struct qat_rsa_ctx *ctx, struct rsa_key *rsa_key) · 4 unmodified lines
11111111 qat_rsa_drop_leading_zeros(&ptr, &len);
11121112 if (!len)
11131113 goto free_dp;
1114− ctx->dq = dma_zalloc_coherent(dev, half_key_sz, &ctx->dma_dq,
1115− GFP_KERNEL);
1114+ ctx->dq = dma_alloc_coherent(dev, half_key_sz, &ctx->dma_dq,
1115+ GFP_KERNEL);
11161116 if (!ctx->dq)
11171117 goto free_dp;
11181118 memcpy(ctx->dq + (half_key_sz - len), ptr, len);
@@ -1123,8 +1123,8 @@ static void qat_rsa_setkey_crt(struct qat_rsa_ctx *ctx, struct rsa_key *rsa_key) · 4 unmodified lines
11231123 qat_rsa_drop_leading_zeros(&ptr, &len);
11241124 if (!len)
11251125 goto free_dq;
1126− ctx->qinv = dma_zalloc_coherent(dev, half_key_sz, &ctx->dma_qinv,
1127− GFP_KERNEL);
1126+ ctx->qinv = dma_alloc_coherent(dev, half_key_sz, &ctx->dma_qinv,
1127+ GFP_KERNEL);
11281128 if (!ctx->qinv)
11291129 goto free_dq;
11301130 memcpy(ctx->qinv + (half_key_sz - len), ptr, len);
drivers/crypto/talitos.c+9−17
@@ -1361,23 +1361,18 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, · 1360 unmodified lines
13611361 struct talitos_private *priv = dev_get_drvdata(dev);
13621362 bool is_sec1 = has_ftr_sec1(priv);
13631363 int max_len = is_sec1 ? TALITOS1_MAX_DATA_LEN : TALITOS2_MAX_DATA_LEN;
1364− void *err;
13651364
13661365 if (cryptlen + authsize > max_len) {
13671366 dev_err(dev, "length exceeds h/w max limit\n");
13681367 return ERR_PTR(-EINVAL);
13691368 }
13701369
1371− if (ivsize)
1372− iv_dma = dma_map_single(dev, iv, ivsize, DMA_TO_DEVICE);
1373−
13741370 if (!dst || dst == src) {
13751371 src_len = assoclen + cryptlen + authsize;
13761372 src_nents = sg_nents_for_len(src, src_len);
13771373 if (src_nents < 0) {
13781374 dev_err(dev, "Invalid number of src SG.\n");
1379− err = ERR_PTR(-EINVAL);
1380− goto error_sg;
1375+ return ERR_PTR(-EINVAL);
13811376 }
13821377 src_nents = (src_nents == 1) ? 0 : src_nents;
13831378 dst_nents = dst ? src_nents : 0;
@@ -1387,16 +1382,14 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, · 3 unmodified lines
13871382 src_nents = sg_nents_for_len(src, src_len);
13881383 if (src_nents < 0) {
13891384 dev_err(dev, "Invalid number of src SG.\n");
1390− err = ERR_PTR(-EINVAL);
1391− goto error_sg;
1385+ return ERR_PTR(-EINVAL);
13921386 }
13931387 src_nents = (src_nents == 1) ? 0 : src_nents;
13941388 dst_len = assoclen + cryptlen + (encrypt ? authsize : 0);
13951389 dst_nents = sg_nents_for_len(dst, dst_len);
13961390 if (dst_nents < 0) {
13971391 dev_err(dev, "Invalid number of dst SG.\n");
1398− err = ERR_PTR(-EINVAL);
1399− goto error_sg;
1392+ return ERR_PTR(-EINVAL);
14001393 }
14011394 dst_nents = (dst_nents == 1) ? 0 : dst_nents;
14021395 }
@@ -1423,11 +1416,14 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, · 20 unmodified lines
14231416 /* if its a ahash, add space for a second desc next to the first one */
14241417 if (is_sec1 && !dst)
14251418 alloc_len += sizeof(struct talitos_desc);
1419+ alloc_len += ivsize;
14261420
14271421 edesc = kmalloc(alloc_len, GFP_DMA | flags);
1428− if (!edesc) {
1429− err = ERR_PTR(-ENOMEM);
1430− goto error_sg;
1422+ if (!edesc)
1423+ return ERR_PTR(-ENOMEM);
1424+ if (ivsize) {
1425+ iv = memcpy(((u8 *)edesc) + alloc_len - ivsize, iv, ivsize);
1426+ iv_dma = dma_map_single(dev, iv, ivsize, DMA_TO_DEVICE);
14311427 }
14321428 memset(&edesc->desc, 0, sizeof(edesc->desc));
14331429
@@ -1445,10 +1441,6 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, · 11 unmodified lines
14451441 DMA_BIDIRECTIONAL);
14461442 }
14471443 return edesc;
1448−error_sg:
1449− if (iv_dma)
1450− dma_unmap_single(dev, iv_dma, ivsize, DMA_TO_DEVICE);
1451− return err;
14521444 }
14531445
14541446 static struct talitos_edesc *aead_edesc_alloc(struct aead_request *areq, u8 *iv,
drivers/dma/at_xdmac.c+10−9
@@ -203,6 +203,7 @@ struct at_xdmac_chan { · 202 unmodified lines
203203 u32 save_cim;
204204 u32 save_cnda;
205205 u32 save_cndc;
206+ u32 irq_status;
206207 unsigned long status;
207208 struct tasklet_struct tasklet;
208209 struct dma_slave_config sconfig;
@@ -1580,8 +1581,8 @@ static void at_xdmac_tasklet(unsigned long data) · 1371 unmodified lines
15801581 struct at_xdmac_desc *desc;
15811582 u32 error_mask;
15821583
1583− dev_dbg(chan2dev(&atchan->chan), "%s: status=0x%08lx\n",
1584− __func__, atchan->status);
1584+ dev_dbg(chan2dev(&atchan->chan), "%s: status=0x%08x\n",
1585+ __func__, atchan->irq_status);
15851586
15861587 error_mask = AT_XDMAC_CIS_RBEIS
15871588 | AT_XDMAC_CIS_WBEIS
@@ -1589,15 +1590,15 @@ static void at_xdmac_tasklet(unsigned long data) · 1 unmodified line
15891590
15901591 if (at_xdmac_chan_is_cyclic(atchan)) {
15911592 at_xdmac_handle_cyclic(atchan);
1592− } else if ((atchan->status & AT_XDMAC_CIS_LIS)
1593− || (atchan->status & error_mask)) {
1593+ } else if ((atchan->irq_status & AT_XDMAC_CIS_LIS)
1594+ || (atchan->irq_status & error_mask)) {
15941595 struct dma_async_tx_descriptor *txd;
15951596
1596− if (atchan->status & AT_XDMAC_CIS_RBEIS)
1597+ if (atchan->irq_status & AT_XDMAC_CIS_RBEIS)
15971598 dev_err(chan2dev(&atchan->chan), "read bus error!!!");
1598− if (atchan->status & AT_XDMAC_CIS_WBEIS)
1599+ if (atchan->irq_status & AT_XDMAC_CIS_WBEIS)
15991600 dev_err(chan2dev(&atchan->chan), "write bus error!!!");
1600− if (atchan->status & AT_XDMAC_CIS_ROIS)
1601+ if (atchan->irq_status & AT_XDMAC_CIS_ROIS)
16011602 dev_err(chan2dev(&atchan->chan), "request overflow error!!!");
16021603
16031604 spin_lock(&atchan->lock);
@@ -1652,7 +1653,7 @@ static irqreturn_t at_xdmac_interrupt(int irq, void *dev_id) · 48 unmodified lines
16521653 atchan = &atxdmac->chan[i];
16531654 chan_imr = at_xdmac_chan_read(atchan, AT_XDMAC_CIM);
16541655 chan_status = at_xdmac_chan_read(atchan, AT_XDMAC_CIS);
1655− atchan->status = chan_status & chan_imr;
1656+ atchan->irq_status = chan_status & chan_imr;
16561657 dev_vdbg(atxdmac->dma.dev,
16571658 "%s: chan%d: imr=0x%x, status=0x%x\n",
16581659 __func__, i, chan_imr, chan_status);
@@ -1666,7 +1667,7 @@ static irqreturn_t at_xdmac_interrupt(int irq, void *dev_id) · 7 unmodified lines
16661667 at_xdmac_chan_read(atchan, AT_XDMAC_CDA),
16671668 at_xdmac_chan_read(atchan, AT_XDMAC_CUBC));
16681669
1669− if (atchan->status & (AT_XDMAC_CIS_RBEIS | AT_XDMAC_CIS_WBEIS))
1670+ if (atchan->irq_status & (AT_XDMAC_CIS_RBEIS | AT_XDMAC_CIS_WBEIS))
16701671 at_xdmac_write(atxdmac, AT_XDMAC_GD, atchan->mask);
16711672
16721673 tasklet_schedule(&atchan->tasklet);
drivers/dma/bcm2835-dma.c+25−45
@@ -406,38 +406,32 @@ static void bcm2835_dma_fill_cb_chain_with_sg( · 405 unmodified lines
406406 }
407407 }
408408
409−static int bcm2835_dma_abort(void __iomem *chan_base)
409+static int bcm2835_dma_abort(struct bcm2835_chan *c)
410410 {
411− unsigned long cs;
411+ void __iomem *chan_base = c->chan_base;
412412 long int timeout = 10000;
413413
414− cs = readl(chan_base + BCM2835_DMA_CS);
415− if (!(cs & BCM2835_DMA_ACTIVE))
414+ /*
415+ * A zero control block address means the channel is idle.
416+ * (The ACTIVE flag in the CS register is not a reliable indicator.)
417+ */
418+ if (!readl(chan_base + BCM2835_DMA_ADDR))
416419 return 0;
417420
418421 /* Write 0 to the active bit - Pause the DMA */
419422 writel(0, chan_base + BCM2835_DMA_CS);
420423
421424 /* Wait for any current AXI transfer to complete */
422− while ((cs & BCM2835_DMA_ISPAUSED) && --timeout) {
425+ while ((readl(chan_base + BCM2835_DMA_CS) &
426+ BCM2835_DMA_WAITING_FOR_WRITES) && --timeout)
423427 cpu_relax();
424− cs = readl(chan_base + BCM2835_DMA_CS);
425− }
426428
427− /* We'll un-pause when we set of our next DMA */
429+ /* Peripheral might be stuck and fail to signal AXI write responses */
428430 if (!timeout)
429− return -ETIMEDOUT;
430−
431− if (!(cs & BCM2835_DMA_ACTIVE))
432− return 0;
433−
434− /* Terminate the control block chain */
435− writel(0, chan_base + BCM2835_DMA_NEXTCB);
436−
437− /* Abort the whole DMA */
438− writel(BCM2835_DMA_ABORT | BCM2835_DMA_ACTIVE,
439− chan_base + BCM2835_DMA_CS);
431+ dev_err(c->vc.chan.device->dev,
432+ "failed to complete outstanding writes\n");
440433
434+ writel(BCM2835_DMA_RESET, chan_base + BCM2835_DMA_CS);
441435 return 0;
442436 }
443437
@@ -476,8 +470,15 @@ static irqreturn_t bcm2835_dma_callback(int irq, void *data) · 32 unmodified lines
476470
477471 spin_lock_irqsave(&c->vc.lock, flags);
478472
479− /* Acknowledge interrupt */
480− writel(BCM2835_DMA_INT, c->chan_base + BCM2835_DMA_CS);
473+ /*
474+ * Clear the INT flag to receive further interrupts. Keep the channel
475+ * active in case the descriptor is cyclic or in case the client has
476+ * already terminated the descriptor and issued a new one. (May happen
477+ * if this IRQ handler is threaded.) If the channel is finished, it
478+ * will remain idle despite the ACTIVE flag being set.
479+ */
480+ writel(BCM2835_DMA_INT | BCM2835_DMA_ACTIVE,
481+ c->chan_base + BCM2835_DMA_CS);
481482
482483 d = c->desc;
483484
@@ -485,11 +486,7 @@ static irqreturn_t bcm2835_dma_callback(int irq, void *data) · 1 unmodified line
485486 if (d->cyclic) {
486487 /* call the cyclic callback */
487488 vchan_cyclic_callback(&d->vd);
488−
489− /* Keep the DMA engine running */
490− writel(BCM2835_DMA_ACTIVE,
491− c->chan_base + BCM2835_DMA_CS);
492− } else {
489+ } else if (!readl(c->chan_base + BCM2835_DMA_ADDR)) {
493490 vchan_cookie_complete(&c->desc->vd);
494491 bcm2835_dma_start_desc(c);
495492 }
@@ -779,7 +776,6 @@ static int bcm2835_dma_terminate_all(struct dma_chan *chan) · 283 unmodified lines
779776 struct bcm2835_chan *c = to_bcm2835_dma_chan(chan);
780777 struct bcm2835_dmadev *d = to_bcm2835_dma_dev(c->vc.chan.device);
781778 unsigned long flags;
782− int timeout = 10000;
783779 LIST_HEAD(head);
784780
785781 spin_lock_irqsave(&c->vc.lock, flags);
@@ -789,27 +785,11 @@ static int bcm2835_dma_terminate_all(struct dma_chan *chan) · 3 unmodified lines
789785 list_del_init(&c->node);
790786 spin_unlock(&d->lock);
791787
792− /*
793− * Stop DMA activity: we assume the callback will not be called
794− * after bcm_dma_abort() returns (even if it does, it will see
795− * c->desc is NULL and exit.)
796− */
788+ /* stop DMA activity */
797789 if (c->desc) {
798790 vchan_terminate_vdesc(&c->desc->vd);
799791 c->desc = NULL;
800− bcm2835_dma_abort(c->chan_base);
801−
802− /* Wait for stopping */
803− while (--timeout) {
804− if (!(readl(c->chan_base + BCM2835_DMA_CS) &
805− BCM2835_DMA_ACTIVE))
806− break;
807−
808− cpu_relax();
809− }
810−
811− if (!timeout)
812− dev_err(d->ddev.dev, "DMA transfer could not be terminated\n");
792+ bcm2835_dma_abort(c);
813793 }
814794
815795 vchan_get_all_descriptors(&c->vc, &head);
drivers/dma/dmatest.c+14−18
@@ -711,11 +711,9 @@ static int dmatest_func(void *data) · 710 unmodified lines
711711 srcs[i] = um->addr[i] + src_off;
712712 ret = dma_mapping_error(dev->dev, um->addr[i]);
713713 if (ret) {
714− dmaengine_unmap_put(um);
715714 result("src mapping error", total_tests,
716715 src_off, dst_off, len, ret);
717− failed_tests++;
718− continue;
716+ goto error_unmap_continue;
719717 }
720718 um->to_cnt++;
721719 }
@@ -730,11 +728,9 @@ static int dmatest_func(void *data) · 8 unmodified lines
730728 DMA_BIDIRECTIONAL);
731729 ret = dma_mapping_error(dev->dev, dsts[i]);
732730 if (ret) {
733− dmaengine_unmap_put(um);
734731 result("dst mapping error", total_tests,
735732 src_off, dst_off, len, ret);
736− failed_tests++;
737− continue;
733+ goto error_unmap_continue;
738734 }
739735 um->bidi_cnt++;
740736 }
@@ -762,12 +758,10 @@ static int dmatest_func(void *data) · 21 unmodified lines
762758 }
763759
764760 if (!tx) {
765− dmaengine_unmap_put(um);
766761 result("prep error", total_tests, src_off,
767762 dst_off, len, ret);
768763 msleep(100);
769− failed_tests++;
770− continue;
764+ goto error_unmap_continue;
771765 }
772766
773767 done->done = false;
@@ -776,12 +770,10 @@ static int dmatest_func(void *data) · 2 unmodified lines
776770 cookie = tx->tx_submit(tx);
777771
778772 if (dma_submit_error(cookie)) {
779− dmaengine_unmap_put(um);
780773 result("submit error", total_tests, src_off,
781774 dst_off, len, ret);
782775 msleep(100);
783− failed_tests++;
784− continue;
776+ goto error_unmap_continue;
785777 }
786778 dma_async_issue_pending(chan);
787779
@@ -790,22 +782,20 @@ static int dmatest_func(void *data) · 2 unmodified lines
790782
791783 status = dma_async_is_tx_complete(chan, cookie, NULL, NULL);
792784
793− dmaengine_unmap_put(um);
794−
795785 if (!done->done) {
796786 result("test timed out", total_tests, src_off, dst_off,
797787 len, 0);
798− failed_tests++;
799− continue;
788+ goto error_unmap_continue;
800789 } else if (status != DMA_COMPLETE) {
801790 result(status == DMA_ERROR ?
802791 "completion error status" :
803792 "completion busy status", total_tests, src_off,
804793 dst_off, len, ret);
805− failed_tests++;
806− continue;
794+ goto error_unmap_continue;
807795 }
808796
797+ dmaengine_unmap_put(um);
798+
809799 if (params->noverify) {
810800 verbose_result("test passed", total_tests, src_off,
811801 dst_off, len, 0);
@@ -846,6 +836,12 @@ static int dmatest_func(void *data) · 34 unmodified lines
846836 verbose_result("test passed", total_tests, src_off,
847837 dst_off, len, 0);
848838 }
839+
840+ continue;
841+
842+error_unmap_continue:
843+ dmaengine_unmap_put(um);
844+ failed_tests++;
849845 }
850846 ktime = ktime_sub(ktime_get(), ktime);
851847 ktime = ktime_sub(ktime, comparetime);
drivers/dma/imx-dma.c+4−4
@@ -618,7 +618,7 @@ static void imxdma_tasklet(unsigned long data) · 617 unmodified lines
618618 {
619619 struct imxdma_channel *imxdmac = (void *)data;
620620 struct imxdma_engine *imxdma = imxdmac->imxdma;
621− struct imxdma_desc *desc;
621+ struct imxdma_desc *desc, *next_desc;
622622 unsigned long flags;
623623
624624 spin_lock_irqsave(&imxdma->lock, flags);
@@ -648,10 +648,10 @@ static void imxdma_tasklet(unsigned long data) · 23 unmodified lines
648648 list_move_tail(imxdmac->ld_active.next, &imxdmac->ld_free);
649649
650650 if (!list_empty(&imxdmac->ld_queue)) {
651− desc = list_first_entry(&imxdmac->ld_queue, struct imxdma_desc,
652− node);
651+ next_desc = list_first_entry(&imxdmac->ld_queue,
652+ struct imxdma_desc, node);
653653 list_move_tail(imxdmac->ld_queue.next, &imxdmac->ld_active);
654− if (imxdma_xfer_desc(desc) < 0)
654+ if (imxdma_xfer_desc(next_desc) < 0)
655655 dev_warn(imxdma->dev, "%s: channel: %d couldn't xfer desc\n",
656656 __func__, imxdmac->channel);
657657 }
drivers/dma/imx-sdma.c+4−4
@@ -1182,8 +1182,8 @@ static int sdma_request_channel0(struct sdma_engine *sdma) · 1181 unmodified lines
11821182 {
11831183 int ret = -EBUSY;
11841184
1185− sdma->bd0 = dma_zalloc_coherent(NULL, PAGE_SIZE, &sdma->bd0_phys,
1186− GFP_NOWAIT);
1185+ sdma->bd0 = dma_alloc_coherent(NULL, PAGE_SIZE, &sdma->bd0_phys,
1186+ GFP_NOWAIT);
11871187 if (!sdma->bd0) {
11881188 ret = -ENOMEM;
11891189 goto out;
@@ -1205,8 +1205,8 @@ static int sdma_alloc_bd(struct sdma_desc *desc) · 15 unmodified lines
12051205 u32 bd_size = desc->num_bd * sizeof(struct sdma_buffer_descriptor);
12061206 int ret = 0;
12071207
1208− desc->bd = dma_zalloc_coherent(NULL, bd_size, &desc->bd_phys,
1209− GFP_NOWAIT);
1208+ desc->bd = dma_alloc_coherent(NULL, bd_size, &desc->bd_phys,
1209+ GFP_NOWAIT);
12101210 if (!desc->bd) {
12111211 ret = -ENOMEM;
12121212 goto out;
drivers/dma/mediatek/mtk-hsdma.c+2−2
@@ -325,8 +325,8 @@ static int mtk_hsdma_alloc_pchan(struct mtk_hsdma_device *hsdma, · 324 unmodified lines
325325 * and [MTK_DMA_SIZE ... 2 * MTK_DMA_SIZE - 1] is for RX ring.
326326 */
327327 pc->sz_ring = 2 * MTK_DMA_SIZE * sizeof(*ring->txd);
328− ring->txd = dma_zalloc_coherent(hsdma2dev(hsdma), pc->sz_ring,
329− &ring->tphys, GFP_NOWAIT);
328+ ring->txd = dma_alloc_coherent(hsdma2dev(hsdma), pc->sz_ring,
329+ &ring->tphys, GFP_NOWAIT);
330330 if (!ring->txd)
331331 return -ENOMEM;
332332
drivers/dma/mxs-dma.c+3−3
@@ -416,9 +416,9 @@ static int mxs_dma_alloc_chan_resources(struct dma_chan *chan) · 415 unmodified lines
416416 struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
417417 int ret;
418418
419− mxs_chan->ccw = dma_zalloc_coherent(mxs_dma->dma_device.dev,
420− CCW_BLOCK_SIZE,
421− &mxs_chan->ccw_phys, GFP_KERNEL);
419+ mxs_chan->ccw = dma_alloc_coherent(mxs_dma->dma_device.dev,
420+ CCW_BLOCK_SIZE,
421+ &mxs_chan->ccw_phys, GFP_KERNEL);
422422 if (!mxs_chan->ccw) {
423423 ret = -ENOMEM;
424424 goto err_alloc;
drivers/dma/xgene-dma.c+2−2
@@ -1208,8 +1208,8 @@ static int xgene_dma_create_ring_one(struct xgene_dma_chan *chan, · 1207 unmodified lines
12081208 ring->size = ret;
12091209
12101210 /* Allocate memory for DMA ring descriptor */
1211− ring->desc_vaddr = dma_zalloc_coherent(chan->dev, ring->size,
1212− &ring->desc_paddr, GFP_KERNEL);
1211+ ring->desc_vaddr = dma_alloc_coherent(chan->dev, ring->size,
1212+ &ring->desc_paddr, GFP_KERNEL);
12131213 if (!ring->desc_vaddr) {
12141214 chan_err(chan, "Failed to allocate ring desc\n");
12151215 return -ENOMEM;
drivers/dma/xilinx/xilinx_dma.c+7−7
@@ -879,10 +879,9 @@ static int xilinx_dma_alloc_chan_resources(struct dma_chan *dchan) · 878 unmodified lines
879879 */
880880 if (chan->xdev->dma_config->dmatype == XDMA_TYPE_AXIDMA) {
881881 /* Allocate the buffer descriptors. */
882− chan->seg_v = dma_zalloc_coherent(chan->dev,
883− sizeof(*chan->seg_v) *
884− XILINX_DMA_NUM_DESCS,
885− &chan->seg_p, GFP_KERNEL);
882+ chan->seg_v = dma_alloc_coherent(chan->dev,
883+ sizeof(*chan->seg_v) * XILINX_DMA_NUM_DESCS,
884+ &chan->seg_p, GFP_KERNEL);
886885 if (!chan->seg_v) {
887886 dev_err(chan->dev,
888887 "unable to allocate channel %d descriptors\n",
@@ -895,9 +894,10 @@ static int xilinx_dma_alloc_chan_resources(struct dma_chan *dchan) · 6 unmodified lines
895894 * so allocating a desc segment during channel allocation for
896895 * programming tail descriptor.
897896 */
898− chan->cyclic_seg_v = dma_zalloc_coherent(chan->dev,
899− sizeof(*chan->cyclic_seg_v),
900− &chan->cyclic_seg_p, GFP_KERNEL);
897+ chan->cyclic_seg_v = dma_alloc_coherent(chan->dev,
898+ sizeof(*chan->cyclic_seg_v),
899+ &chan->cyclic_seg_p,
900+ GFP_KERNEL);
901901 if (!chan->cyclic_seg_v) {
902902 dev_err(chan->dev,
903903 "unable to allocate desc segment for cyclic DMA\n");
drivers/dma/xilinx/zynqmp_dma.c+3−3
@@ -490,9 +490,9 @@ static int zynqmp_dma_alloc_chan_resources(struct dma_chan *dchan) · 489 unmodified lines
490490 list_add_tail(&desc->node, &chan->free_list);
491491 }
492492
493− chan->desc_pool_v = dma_zalloc_coherent(chan->dev,
494− (2 * chan->desc_size * ZYNQMP_DMA_NUM_DESCS),
495− &chan->desc_pool_p, GFP_KERNEL);
493+ chan->desc_pool_v = dma_alloc_coherent(chan->dev,
494+ (2 * chan->desc_size * ZYNQMP_DMA_NUM_DESCS),
495+ &chan->desc_pool_p, GFP_KERNEL);
496496 if (!chan->desc_pool_v)
497497 return -ENOMEM;
498498
drivers/edac/altera_edac.h+2−2
@@ -295,8 +295,8 @@ struct altr_sdram_mc_data { · 294 unmodified lines
295295 #define S10_SYSMGR_ECC_INTSTAT_DERR_OFST 0xA0
296296
297297 /* Sticky registers for Uncorrected Errors */
298−#define S10_SYSMGR_UE_VAL_OFST 0x120
299−#define S10_SYSMGR_UE_ADDR_OFST 0x124
298+#define S10_SYSMGR_UE_VAL_OFST 0x220
299+#define S10_SYSMGR_UE_ADDR_OFST 0x224
300300
301301 #define S10_DDR0_IRQ_MASK BIT(16)
302302
drivers/firewire/sbp2.c+1−4
@@ -1144,10 +1144,6 @@ static int sbp2_probe(struct fw_unit *unit, const struct ieee1394_device_id *id) · 1143 unmodified lines
11441144 if (device->is_local)
11451145 return -ENODEV;
11461146
1147− if (dma_get_max_seg_size(device->card->device) > SBP2_MAX_SEG_SIZE)
1148− WARN_ON(dma_set_max_seg_size(device->card->device,
1149− SBP2_MAX_SEG_SIZE));
1150−
11511147 shost = scsi_host_alloc(&scsi_driver_template, sizeof(*tgt));
11521148 if (shost == NULL)
11531149 return -ENOMEM;
@@ -1610,6 +1606,7 @@ static struct scsi_host_template scsi_driver_template = { · 456 unmodified lines
16101606 .eh_abort_handler = sbp2_scsi_abort,
16111607 .this_id = -1,
16121608 .sg_tablesize = SG_ALL,
1609+ .max_segment_size = SBP2_MAX_SEG_SIZE,
16131610 .can_queue = 1,
16141611 .sdev_attrs = sbp2_scsi_sysfs_attrs,
16151612 };
drivers/firmware/arm_scmi/bus.c+7−2
@@ -119,6 +119,11 @@ void scmi_driver_unregister(struct scmi_driver *driver) · 118 unmodified lines
119119 }
120120 EXPORT_SYMBOL_GPL(scmi_driver_unregister);
121121
122+static void scmi_device_release(struct device *dev)
123+{
124+ kfree(to_scmi_dev(dev));
125+}
126+
122127 struct scmi_device *
123128 scmi_device_create(struct device_node *np, struct device *parent, int protocol)
124129 {
@@ -138,6 +143,7 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol) · 13 unmodified lines
138143 scmi_dev->dev.parent = parent;
139144 scmi_dev->dev.of_node = np;
140145 scmi_dev->dev.bus = &scmi_bus_type;
146+ scmi_dev->dev.release = scmi_device_release;
141147 dev_set_name(&scmi_dev->dev, "scmi_dev.%d", id);
142148
143149 retval = device_register(&scmi_dev->dev);
@@ -156,9 +162,8 @@ free_mem: · 12 unmodified lines
156162 void scmi_device_destroy(struct scmi_device *scmi_dev)
157163 {
158164 scmi_handle_put(scmi_dev->handle);
159− device_unregister(&scmi_dev->dev);
160165 ida_simple_remove(&scmi_bus_id, scmi_dev->id);
161− kfree(scmi_dev);
166+ device_unregister(&scmi_dev->dev);
162167 }
163168
164169 void scmi_set_handle(struct scmi_device *scmi_dev)
drivers/firmware/efi/arm-runtime.c+3−2
@@ -37,8 +37,9 @@ extern u64 efi_system_table; · 36 unmodified lines
3737 static struct ptdump_info efi_ptdump_info = {
3838 .mm = &efi_mm,
3939 .markers = (struct addr_marker[]){
40− { 0, "UEFI runtime start" },
41− { DEFAULT_MAP_WINDOW_64, "UEFI runtime end" }
40+ { 0, "UEFI runtime start" },
41+ { DEFAULT_MAP_WINDOW_64, "UEFI runtime end" },
42+ { -1, NULL }
4243 },
4344 .base_addr = 0,
4445 };
drivers/fpga/stratix10-soc.c+1−4
@@ -508,14 +508,11 @@ static int __init s10_init(void) · 507 unmodified lines
508508 return -ENODEV;
509509
510510 np = of_find_matching_node(fw_np, s10_of_match);
511− if (!np) {
512− of_node_put(fw_np);
511+ if (!np)
513512 return -ENODEV;
514− }
515513
516514 of_node_put(np);
517515 ret = of_platform_populate(fw_np, s10_of_match, NULL, NULL);
518− of_node_put(fw_np);
519516 if (ret)
520517 return ret;
521518
drivers/gpio/gpio-altera-a10sr.c+3−1
@@ -66,8 +66,10 @@ static int altr_a10sr_gpio_direction_input(struct gpio_chip *gc, · 65 unmodified lines
6666 static int altr_a10sr_gpio_direction_output(struct gpio_chip *gc,
6767 unsigned int nr, int value)
6868 {
69− if (nr <= (ALTR_A10SR_OUT_VALID_RANGE_HI - ALTR_A10SR_LED_VALID_SHIFT))
69+ if (nr <= (ALTR_A10SR_OUT_VALID_RANGE_HI - ALTR_A10SR_LED_VALID_SHIFT)) {
70+ altr_a10sr_gpio_set(gc, nr, value);
7071 return 0;
72+ }
7173 return -EINVAL;
7274 }
7375
drivers/gpio/gpio-eic-sprd.c+13−1
@@ -180,7 +180,18 @@ static void sprd_eic_free(struct gpio_chip *chip, unsigned int offset) · 179 unmodified lines
180180
181181 static int sprd_eic_get(struct gpio_chip *chip, unsigned int offset)
182182 {
183− return sprd_eic_read(chip, offset, SPRD_EIC_DBNC_DATA);
183+ struct sprd_eic *sprd_eic = gpiochip_get_data(chip);
184+
185+ switch (sprd_eic->type) {
186+ case SPRD_EIC_DEBOUNCE:
187+ return sprd_eic_read(chip, offset, SPRD_EIC_DBNC_DATA);
188+ case SPRD_EIC_ASYNC:
189+ return sprd_eic_read(chip, offset, SPRD_EIC_ASYNC_DATA);
190+ case SPRD_EIC_SYNC:
191+ return sprd_eic_read(chip, offset, SPRD_EIC_SYNC_DATA);
192+ default:
193+ return -ENOTSUPP;
194+ }
184195 }
185196
186197 static int sprd_eic_direction_input(struct gpio_chip *chip, unsigned int offset)
@@ -368,6 +379,7 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type) · 181 unmodified lines
368379 irq_set_handler_locked(data, handle_edge_irq);
369380 break;
370381 case IRQ_TYPE_EDGE_BOTH:
382+ sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
371383 sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 1);
372384 irq_set_handler_locked(data, handle_edge_irq);
373385 break;
drivers/gpio/gpio-pca953x.c+1−1
@@ -289,7 +289,7 @@ static bool pca953x_volatile_register(struct device *dev, unsigned int reg) · 288 unmodified lines
289289 return pca953x_check_register(chip, reg, bank);
290290 }
291291
292−const struct regmap_config pca953x_i2c_regmap = {
292+static const struct regmap_config pca953x_i2c_regmap = {
293293 .reg_bits = 8,
294294 .val_bits = 8,
295295
drivers/gpio/gpio-pcf857x.c+12−14
@@ -84,6 +84,7 @@ MODULE_DEVICE_TABLE(of, pcf857x_of_table); · 83 unmodified lines
8484 */
8585 struct pcf857x {
8686 struct gpio_chip chip;
87+ struct irq_chip irqchip;
8788 struct i2c_client *client;
8889 struct mutex lock; /* protect 'out' */
8990 unsigned out; /* software latch */
@@ -252,18 +253,6 @@ static void pcf857x_irq_bus_sync_unlock(struct irq_data *data) · 162 unmodified lines
252253 mutex_unlock(&gpio->lock);
253254 }
254255
255−static struct irq_chip pcf857x_irq_chip = {
256− .name = "pcf857x",
257− .irq_enable = pcf857x_irq_enable,
258− .irq_disable = pcf857x_irq_disable,
259− .irq_ack = noop,
260− .irq_mask = noop,
261− .irq_unmask = noop,
262− .irq_set_wake = pcf857x_irq_set_wake,
263− .irq_bus_lock = pcf857x_irq_bus_lock,
264− .irq_bus_sync_unlock = pcf857x_irq_bus_sync_unlock,
265−};
266−
267256 /*-------------------------------------------------------------------------*/
268257
269258 static int pcf857x_probe(struct i2c_client *client,
@@ -376,8 +365,17 @@ static int pcf857x_probe(struct i2c_client *client, · 106 unmodified lines
376365
377366 /* Enable irqchip if we have an interrupt */
378367 if (client->irq) {
368+ gpio->irqchip.name = "pcf857x",
369+ gpio->irqchip.irq_enable = pcf857x_irq_enable,
370+ gpio->irqchip.irq_disable = pcf857x_irq_disable,
371+ gpio->irqchip.irq_ack = noop,
372+ gpio->irqchip.irq_mask = noop,
373+ gpio->irqchip.irq_unmask = noop,
374+ gpio->irqchip.irq_set_wake = pcf857x_irq_set_wake,
375+ gpio->irqchip.irq_bus_lock = pcf857x_irq_bus_lock,
376+ gpio->irqchip.irq_bus_sync_unlock = pcf857x_irq_bus_sync_unlock,
379377 status = gpiochip_irqchip_add_nested(&gpio->chip,
380− &pcf857x_irq_chip,
378+ &gpio->irqchip,
381379 0, handle_level_irq,
382380 IRQ_TYPE_NONE);
383381 if (status) {
@@ -392,7 +390,7 @@ static int pcf857x_probe(struct i2c_client *client, · 8 unmodified lines
392390 if (status)
393391 goto fail;
394392
395− gpiochip_set_nested_irqchip(&gpio->chip, &pcf857x_irq_chip,
393+ gpiochip_set_nested_irqchip(&gpio->chip, &gpio->irqchip,
396394 client->irq);
397395 gpio->irq_parent = client->irq;
398396 }
drivers/gpio/gpio-vf610.c+5−0
@@ -253,6 +253,7 @@ static int vf610_gpio_probe(struct platform_device *pdev) · 252 unmodified lines
253253 struct vf610_gpio_port *port;
254254 struct resource *iores;
255255 struct gpio_chip *gc;
256+ int i;
256257 int ret;
257258
258259 port = devm_kzalloc(&pdev->dev, sizeof(*port), GFP_KERNEL);
@@ -319,6 +320,10 @@ static int vf610_gpio_probe(struct platform_device *pdev) · 60 unmodified lines
319320 if (ret < 0)
320321 return ret;
321322
323+ /* Mask all GPIO interrupts */
324+ for (i = 0; i < gc->ngpio; i++)
325+ vf610_gpio_writel(0, port->base + PORT_PCR(i));
326+
322327 /* Clear the interrupt status register for all GPIO's */
323328 vf610_gpio_writel(~0, port->base + PORT_ISFR);
324329
drivers/gpio/gpiolib-acpi.c+1−6
@@ -357,8 +357,6 @@ void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) · 356 unmodified lines
357357 mutex_unlock(&acpi_gpio_deferred_req_irqs_lock);
358358
359359 list_for_each_entry_safe_reverse(event, ep, &acpi_gpio->events, node) {
360− struct gpio_desc *desc;
361−
362360 if (event->irq_requested) {
363361 if (event->irq_is_wake)
364362 disable_irq_wake(event->irq);
@@ -366,11 +364,8 @@ void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) · 1 unmodified line
366364 free_irq(event->irq, event);
367365 }
368366
369− desc = event->desc;
370− if (WARN_ON(IS_ERR(desc)))
371− continue;
372367 gpiochip_unlock_as_irq(chip, event->pin);
373− gpiochip_free_own_desc(desc);
368+ gpiochip_free_own_desc(event->desc);
374369 list_del(&event->node);
375370 kfree(event);
376371 }
drivers/gpio/gpiolib.c+8−1
@@ -828,7 +828,14 @@ static irqreturn_t lineevent_irq_thread(int irq, void *p) · 827 unmodified lines
828828 /* Do not leak kernel stack to userspace */
829829 memset(&ge, 0, sizeof(ge));
830830
831− ge.timestamp = le->timestamp;
831+ /*
832+ * We may be running from a nested threaded interrupt in which case
833+ * we didn't get the timestamp from lineevent_irq_handler().
834+ */
835+ if (!le->timestamp)
836+ ge.timestamp = ktime_get_real_ns();
837+ else
838+ ge.timestamp = le->timestamp;
832839
833840 if (le->eflags & GPIOEVENT_REQUEST_RISING_EDGE
834841 && le->eflags & GPIOEVENT_REQUEST_FALLING_EDGE) {
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c+1−0
@@ -576,6 +576,7 @@ static const struct amdgpu_px_quirk amdgpu_px_quirk_list[] = { · 575 unmodified lines
576576 { 0x1002, 0x6900, 0x1028, 0x0812, AMDGPU_PX_QUIRK_FORCE_ATPX },
577577 { 0x1002, 0x6900, 0x1028, 0x0813, AMDGPU_PX_QUIRK_FORCE_ATPX },
578578 { 0x1002, 0x6900, 0x1025, 0x125A, AMDGPU_PX_QUIRK_FORCE_ATPX },
579+ { 0x1002, 0x6900, 0x17AA, 0x3806, AMDGPU_PX_QUIRK_FORCE_ATPX },
579580 { 0, 0, 0, 0, 0 },
580581 };
581582
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+6−6
@@ -1701,8 +1701,10 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev) · 1700 unmodified lines
17011701 amdgpu_xgmi_add_device(adev);
17021702 amdgpu_amdkfd_device_init(adev);
17031703
1704− if (amdgpu_sriov_vf(adev))
1704+ if (amdgpu_sriov_vf(adev)) {
1705+ amdgpu_virt_init_data_exchange(adev);
17051706 amdgpu_virt_release_full_gpu(adev, true);
1707+ }
17061708
17071709 return 0;
17081710 }
@@ -2632,9 +2634,6 @@ fence_driver_init: · 923 unmodified lines
26322634 goto failed;
26332635 }
26342636
2635− if (amdgpu_sriov_vf(adev))
2636− amdgpu_virt_init_data_exchange(adev);
2637−
26382637 amdgpu_fbdev_init(adev);
26392638
26402639 r = amdgpu_pm_sysfs_init(adev);
@@ -2798,7 +2797,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon) · 157 unmodified lines
27982797 struct drm_framebuffer *fb = crtc->primary->fb;
27992798 struct amdgpu_bo *robj;
28002799
2801− if (amdgpu_crtc->cursor_bo) {
2800+ if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) {
28022801 struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo);
28032802 r = amdgpu_bo_reserve(aobj, true);
28042803 if (r == 0) {
@@ -2906,7 +2905,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon) · 101 unmodified lines
29062905 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
29072906 struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
29082907
2909− if (amdgpu_crtc->cursor_bo) {
2908+ if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) {
29102909 struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo);
29112910 r = amdgpu_bo_reserve(aobj, true);
29122911 if (r == 0) {
@@ -3226,6 +3225,7 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev, · 313 unmodified lines
32263225 r = amdgpu_ib_ring_tests(adev);
32273226
32283227 error:
3228+ amdgpu_virt_init_data_exchange(adev);
32293229 amdgpu_virt_release_full_gpu(adev, true);
32303230 if (!r && adev->virt.gim_feature & AMDGIM_FEATURE_GIM_FLR_VRAMLOST) {
32313231 atomic_inc(&adev->vram_lost_counter);
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c+12−8
@@ -188,10 +188,12 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, · 187 unmodified lines
188188 goto cleanup;
189189 }
190190
191− r = amdgpu_bo_pin(new_abo, amdgpu_display_supported_domains(adev));
192− if (unlikely(r != 0)) {
193− DRM_ERROR("failed to pin new abo buffer before flip\n");
194− goto unreserve;
191+ if (!adev->enable_virtual_display) {
192+ r = amdgpu_bo_pin(new_abo, amdgpu_display_supported_domains(adev));
193+ if (unlikely(r != 0)) {
194+ DRM_ERROR("failed to pin new abo buffer before flip\n");
195+ goto unreserve;
196+ }
195197 }
196198
197199 r = amdgpu_ttm_alloc_gart(&new_abo->tbo);
@@ -211,7 +213,8 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, · 13 unmodified lines
211213 amdgpu_bo_get_tiling_flags(new_abo, &tiling_flags);
212214 amdgpu_bo_unreserve(new_abo);
213215
214− work->base = amdgpu_bo_gpu_offset(new_abo);
216+ if (!adev->enable_virtual_display)
217+ work->base = amdgpu_bo_gpu_offset(new_abo);
215218 work->target_vblank = target - (uint32_t)drm_crtc_vblank_count(crtc) +
216219 amdgpu_get_vblank_counter_kms(dev, work->crtc_id);
217220
@@ -242,9 +245,10 @@ pflip_cleanup: · 24 unmodified lines
242245 goto cleanup;
243246 }
244247 unpin:
245− if (unlikely(amdgpu_bo_unpin(new_abo) != 0)) {
246− DRM_ERROR("failed to unpin new abo in error path\n");
247− }
248+ if (!adev->enable_virtual_display)
249+ if (unlikely(amdgpu_bo_unpin(new_abo) != 0))
250+ DRM_ERROR("failed to unpin new abo in error path\n");
251+
248252 unreserve:
249253 amdgpu_bo_unreserve(new_abo);
250254
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c+16−9
@@ -1686,7 +1686,8 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj, · 1685 unmodified lines
16861686 effective_mode &= ~S_IWUSR;
16871687
16881688 if ((adev->flags & AMD_IS_APU) &&
1689− (attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
1689+ (attr == &sensor_dev_attr_power1_average.dev_attr.attr ||
1690+ attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
16901691 attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr||
16911692 attr == &sensor_dev_attr_power1_cap.dev_attr.attr))
16921693 return 0;
@@ -2008,6 +2009,7 @@ void amdgpu_pm_print_power_states(struct amdgpu_device *adev) · 315 unmodified lines
20082009
20092010 int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
20102011 {
2012+ struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
20112013 int ret;
20122014
20132015 if (adev->pm.sysfs_initialized)
@@ -2091,12 +2093,14 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev) · 77 unmodified lines
20912093 "pp_power_profile_mode\n");
20922094 return ret;
20932095 }
2094− ret = device_create_file(adev->dev,
2095− &dev_attr_pp_od_clk_voltage);
2096− if (ret) {
2097− DRM_ERROR("failed to create device file "
2098− "pp_od_clk_voltage\n");
2099− return ret;
2096+ if (hwmgr->od_enabled) {
2097+ ret = device_create_file(adev->dev,
2098+ &dev_attr_pp_od_clk_voltage);
2099+ if (ret) {
2100+ DRM_ERROR("failed to create device file "
2101+ "pp_od_clk_voltage\n");
2102+ return ret;
2103+ }
21002104 }
21012105 ret = device_create_file(adev->dev,
21022106 &dev_attr_gpu_busy_percent);
@@ -2118,6 +2122,8 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev) · 15 unmodified lines
21182122
21192123 void amdgpu_pm_sysfs_fini(struct amdgpu_device *adev)
21202124 {
2125+ struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
2126+
21212127 if (adev->pm.dpm_enabled == 0)
21222128 return;
21232129
@@ -2138,8 +2144,9 @@ void amdgpu_pm_sysfs_fini(struct amdgpu_device *adev) · 14 unmodified lines
21382144 device_remove_file(adev->dev, &dev_attr_pp_mclk_od);
21392145 device_remove_file(adev->dev,
21402146 &dev_attr_pp_power_profile_mode);
2141− device_remove_file(adev->dev,
2142− &dev_attr_pp_od_clk_voltage);
2147+ if (hwmgr->od_enabled)
2148+ device_remove_file(adev->dev,
2149+ &dev_attr_pp_od_clk_voltage);
21432150 device_remove_file(adev->dev, &dev_attr_gpu_busy_percent);
21442151 }
21452152
drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c+51−8
@@ -38,6 +38,7 @@ · 37 unmodified lines
3838 #include "amdgpu_gem.h"
3939 #include <drm/amdgpu_drm.h>
4040 #include <linux/dma-buf.h>
41+#include <linux/dma-fence-array.h>
4142
4243 /**
4344 * amdgpu_gem_prime_get_sg_table - &drm_driver.gem_prime_get_sg_table
@@ -187,6 +188,48 @@ error: · 143 unmodified lines
187188 return ERR_PTR(ret);
188189 }
189190
191+static int
192+__reservation_object_make_exclusive(struct reservation_object *obj)
193+{
194+ struct dma_fence **fences;
195+ unsigned int count;
196+ int r;
197+
198+ if (!reservation_object_get_list(obj)) /* no shared fences to convert */
199+ return 0;
200+
201+ r = reservation_object_get_fences_rcu(obj, NULL, &count, &fences);
202+ if (r)
203+ return r;
204+
205+ if (count == 0) {
206+ /* Now that was unexpected. */
207+ } else if (count == 1) {
208+ reservation_object_add_excl_fence(obj, fences[0]);
209+ dma_fence_put(fences[0]);
210+ kfree(fences);
211+ } else {
212+ struct dma_fence_array *array;
213+
214+ array = dma_fence_array_create(count, fences,
215+ dma_fence_context_alloc(1), 0,
216+ false);
217+ if (!array)
218+ goto err_fences_put;
219+
220+ reservation_object_add_excl_fence(obj, &array->base);
221+ dma_fence_put(&array->base);
222+ }
223+
224+ return 0;
225+
226+err_fences_put:
227+ while (count--)
228+ dma_fence_put(fences[count]);
229+ kfree(fences);
230+ return -ENOMEM;
231+}
232+
190233 /**
191234 * amdgpu_gem_map_attach - &dma_buf_ops.attach implementation
192235 * @dma_buf: Shared DMA buffer
@@ -218,16 +261,16 @@ static int amdgpu_gem_map_attach(struct dma_buf *dma_buf, · 25 unmodified lines
218261
219262 if (attach->dev->driver != adev->dev->driver) {
220263 /*
221− * Wait for all shared fences to complete before we switch to future
222− * use of exclusive fence on this prime shared bo.
264+ * We only create shared fences for internal use, but importers
265+ * of the dmabuf rely on exclusive fences for implicitly
266+ * tracking write hazards. As any of the current fences may
267+ * correspond to a write, we need to convert all existing
268+ * fences on the reservation object into a single exclusive
269+ * fence.
223270 */
224− r = reservation_object_wait_timeout_rcu(bo->tbo.resv,
225− true, false,
226− MAX_SCHEDULE_TIMEOUT);
227− if (unlikely(r < 0)) {
228− DRM_DEBUG_PRIME("Fence wait failed: %li\n", r);
271+ r = __reservation_object_make_exclusive(bo->tbo.resv);
272+ if (r)
229273 goto error_unreserve;
230− }
231274 }
232275
233276 /* pin buffer into GTT */
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c+3−5
@@ -847,9 +847,6 @@ static void amdgpu_vm_bo_param(struct amdgpu_device *adev, struct amdgpu_vm *vm, · 846 unmodified lines
847847 bp->size = amdgpu_vm_bo_size(adev, level);
848848 bp->byte_align = AMDGPU_GPU_PAGE_SIZE;
849849 bp->domain = AMDGPU_GEM_DOMAIN_VRAM;
850− if (bp->size <= PAGE_SIZE && adev->asic_type >= CHIP_VEGA10 &&
851− adev->flags & AMD_IS_APU)
852− bp->domain |= AMDGPU_GEM_DOMAIN_GTT;
853850 bp->domain = amdgpu_bo_get_preferred_pin_domain(adev, bp->domain);
854851 bp->flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS |
855852 AMDGPU_GEM_CREATE_CPU_GTT_USWC;
@@ -3366,14 +3363,15 @@ void amdgpu_vm_get_task_info(struct amdgpu_device *adev, unsigned int pasid, · 2510 unmodified lines
33663363 struct amdgpu_task_info *task_info)
33673364 {
33683365 struct amdgpu_vm *vm;
3366+ unsigned long flags;
33693367
3370− spin_lock(&adev->vm_manager.pasid_lock);
3368+ spin_lock_irqsave(&adev->vm_manager.pasid_lock, flags);
33713369
33723370 vm = idr_find(&adev->vm_manager.pasid_idr, pasid);
33733371 if (vm)
33743372 *task_info = vm->task_info;
33753373
3376− spin_unlock(&adev->vm_manager.pasid_lock);
3374+ spin_unlock_irqrestore(&adev->vm_manager.pasid_lock, flags);
33773375 }
33783376
33793377 /**
drivers/gpu/drm/amd/amdgpu/dce_virtual.c+3−14
@@ -167,19 +167,6 @@ static void dce_virtual_crtc_disable(struct drm_crtc *crtc) · 166 unmodified lines
167167 struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
168168
169169 dce_virtual_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
170− if (crtc->primary->fb) {
171− int r;
172− struct amdgpu_bo *abo;
173−
174− abo = gem_to_amdgpu_bo(crtc->primary->fb->obj[0]);
175− r = amdgpu_bo_reserve(abo, true);
176− if (unlikely(r))
177− DRM_ERROR("failed to reserve abo before unpin\n");
178− else {
179− amdgpu_bo_unpin(abo);
180− amdgpu_bo_unreserve(abo);
181− }
182− }
183170
184171 amdgpu_crtc->pll_id = ATOM_PPLL_INVALID;
185172 amdgpu_crtc->encoder = NULL;
@@ -692,7 +679,9 @@ static int dce_virtual_pageflip(struct amdgpu_device *adev, · 506 unmodified lines
692679 spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
693680
694681 drm_crtc_vblank_put(&amdgpu_crtc->base);
695− schedule_work(&works->unpin_work);
682+ amdgpu_bo_unref(&works->old_abo);
683+ kfree(works->shared);
684+ kfree(works);
696685
697686 return 0;
698687 }
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c+34−14
@@ -4233,7 +4233,6 @@ static int gfx_v8_0_cp_gfx_resume(struct amdgpu_device *adev) · 4232 unmodified lines
42334233 u32 tmp;
42344234 u32 rb_bufsz;
42354235 u64 rb_addr, rptr_addr, wptr_gpu_addr;
4236− int r;
42374236
42384237 /* Set the write pointer delay */
42394238 WREG32(mmCP_RB_WPTR_DELAY, 0);
@@ -4278,9 +4277,8 @@ static int gfx_v8_0_cp_gfx_resume(struct amdgpu_device *adev) · 38 unmodified lines
42784277 amdgpu_ring_clear_ring(ring);
42794278 gfx_v8_0_cp_gfx_start(adev);
42804279 ring->sched.ready = true;
4281− r = amdgpu_ring_test_helper(ring);
42824280
4283− return r;
4281+ return 0;
42844282 }
42854283
42864284 static void gfx_v8_0_cp_compute_enable(struct amdgpu_device *adev, bool enable)
@@ -4369,10 +4367,9 @@ static int gfx_v8_0_kiq_kcq_enable(struct amdgpu_device *adev) · 82 unmodified lines
43694367 amdgpu_ring_write(kiq_ring, upper_32_bits(wptr_addr));
43704368 }
43714369
4372− r = amdgpu_ring_test_helper(kiq_ring);
4373− if (r)
4374− DRM_ERROR("KCQ enable failed\n");
4375− return r;
4370+ amdgpu_ring_commit(kiq_ring);
4371+
4372+ return 0;
43764373 }
43774374
43784375 static int gfx_v8_0_deactivate_hqd(struct amdgpu_device *adev, u32 req)
@@ -4709,16 +4706,32 @@ static int gfx_v8_0_kcq_resume(struct amdgpu_device *adev) · 330 unmodified lines
47094706 if (r)
47104707 goto done;
47114708
4712− /* Test KCQs - reversing the order of rings seems to fix ring test failure
4713− * after GPU reset
4714− */
4715− for (i = adev->gfx.num_compute_rings - 1; i >= 0; i--) {
4709+done:
4710+ return r;
4711+}
4712+
4713+static int gfx_v8_0_cp_test_all_rings(struct amdgpu_device *adev)
4714+{
4715+ int r, i;
4716+ struct amdgpu_ring *ring;
4717+
4718+ /* collect all the ring_tests here, gfx, kiq, compute */
4719+ ring = &adev->gfx.gfx_ring[0];
4720+ r = amdgpu_ring_test_helper(ring);
4721+ if (r)
4722+ return r;
4723+
4724+ ring = &adev->gfx.kiq.ring;
4725+ r = amdgpu_ring_test_helper(ring);
4726+ if (r)
4727+ return r;
4728+
4729+ for (i = 0; i < adev->gfx.num_compute_rings; i++) {
47164730 ring = &adev->gfx.compute_ring[i];
4717− r = amdgpu_ring_test_helper(ring);
4731+ amdgpu_ring_test_helper(ring);
47184732 }
47194733
4720−done:
4721− return r;
4734+ return 0;
47224735 }
47234736
47244737 static int gfx_v8_0_cp_resume(struct amdgpu_device *adev)
@@ -4739,6 +4752,11 @@ static int gfx_v8_0_cp_resume(struct amdgpu_device *adev) · 14 unmodified lines
47394752 r = gfx_v8_0_kcq_resume(adev);
47404753 if (r)
47414754 return r;
4755+
4756+ r = gfx_v8_0_cp_test_all_rings(adev);
4757+ if (r)
4758+ return r;
4759+
47424760 gfx_v8_0_enable_gui_idle_interrupt(adev, true);
47434761
47444762 return 0;
@@ -5086,6 +5104,8 @@ static int gfx_v8_0_post_soft_reset(void *handle) · 341 unmodified lines
50865104 REG_GET_FIELD(grbm_soft_reset, GRBM_SOFT_RESET, SOFT_RESET_GFX))
50875105 gfx_v8_0_cp_gfx_resume(adev);
50885106
5107+ gfx_v8_0_cp_test_all_rings(adev);
5108+
50895109 adev->gfx.rlc.funcs->start(adev);
50905110
50915111 return 0;
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c+9−5
@@ -113,7 +113,10 @@ static const struct soc15_reg_golden golden_settings_gc_9_0[] = · 112 unmodified lines
113113 SOC15_REG_GOLDEN_VALUE(GC, 0, mmTCP_CHAN_STEER_HI, 0xffffffff, 0x4a2c0e68),
114114 SOC15_REG_GOLDEN_VALUE(GC, 0, mmTCP_CHAN_STEER_LO, 0xffffffff, 0xb5d3f197),
115115 SOC15_REG_GOLDEN_VALUE(GC, 0, mmVGT_CACHE_INVALIDATION, 0x3fff3af3, 0x19200000),
116− SOC15_REG_GOLDEN_VALUE(GC, 0, mmVGT_GS_MAX_WAVE_ID, 0x00000fff, 0x000003ff)
116+ SOC15_REG_GOLDEN_VALUE(GC, 0, mmVGT_GS_MAX_WAVE_ID, 0x00000fff, 0x000003ff),
117+ SOC15_REG_GOLDEN_VALUE(GC, 0, mmCP_MEC1_F32_INT_DIS, 0x00000000, 0x00000800),
118+ SOC15_REG_GOLDEN_VALUE(GC, 0, mmCP_MEC2_F32_INT_DIS, 0x00000000, 0x00000800),
119+ SOC15_REG_GOLDEN_VALUE(GC, 0, mmCP_DEBUG, 0x00000000, 0x00008000)
117120 };
118121
119122 static const struct soc15_reg_golden golden_settings_gc_9_0_vg10[] =
@@ -135,10 +138,7 @@ static const struct soc15_reg_golden golden_settings_gc_9_0_vg10[] = · 15 unmodified lines
135138 SOC15_REG_GOLDEN_VALUE(GC, 0, mmRMI_UTCL1_CNTL2, 0x00030000, 0x00020000),
136139 SOC15_REG_GOLDEN_VALUE(GC, 0, mmSPI_CONFIG_CNTL_1, 0x0000000f, 0x01000107),
137140 SOC15_REG_GOLDEN_VALUE(GC, 0, mmTD_CNTL, 0x00001800, 0x00000800),
138− SOC15_REG_GOLDEN_VALUE(GC, 0, mmWD_UTCL1_CNTL, 0x08000000, 0x08000080),
139− SOC15_REG_GOLDEN_VALUE(GC, 0, mmCP_MEC1_F32_INT_DIS, 0x00000000, 0x00000800),
140− SOC15_REG_GOLDEN_VALUE(GC, 0, mmCP_MEC2_F32_INT_DIS, 0x00000000, 0x00000800),
141− SOC15_REG_GOLDEN_VALUE(GC, 0, mmCP_DEBUG, 0x00000000, 0x00008000)
141+ SOC15_REG_GOLDEN_VALUE(GC, 0, mmWD_UTCL1_CNTL, 0x08000000, 0x08000080)
142142 };
143143
144144 static const struct soc15_reg_golden golden_settings_gc_9_0_vg20[] =
@@ -3587,6 +3587,8 @@ static void gfx_v9_0_update_medium_grain_clock_gating(struct amdgpu_device *adev · 3442 unmodified lines
35873587 {
35883588 uint32_t data, def;
35893589
3590+ amdgpu_gfx_rlc_enter_safe_mode(adev);
3591+
35903592 /* It is disabled by HW by default */
35913593 if (enable && (adev->cg_flags & AMD_CG_SUPPORT_GFX_MGCG)) {
35923594 /* 1 - RLC_CGTT_MGCG_OVERRIDE */
@@ -3651,6 +3653,8 @@ static void gfx_v9_0_update_medium_grain_clock_gating(struct amdgpu_device *adev · 58 unmodified lines
36513653 WREG32_SOC15(GC, 0, mmCP_MEM_SLP_CNTL, data);
36523654 }
36533655 }
3656+
3657+ amdgpu_gfx_rlc_exit_safe_mode(adev);
36543658 }
36553659
36563660 static void gfx_v9_0_update_3d_clock_gating(struct amdgpu_device *adev,
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c+1−1
@@ -174,7 +174,7 @@ static int xgpu_ai_send_access_requests(struct amdgpu_device *adev, · 173 unmodified lines
174174 return r;
175175 }
176176 /* Retrieve checksum from mailbox2 */
177− if (req == IDH_REQ_GPU_INIT_ACCESS) {
177+ if (req == IDH_REQ_GPU_INIT_ACCESS || req == IDH_REQ_GPU_RESET_ACCESS) {
178178 adev->virt.fw_reserve.checksum_key =
179179 RREG32_NO_KIQ(SOC15_REG_OFFSET(NBIO, 0,
180180 mmBIF_BX_PF0_MAILBOX_MSGBUF_RCV_DW2));
drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c+13−0
@@ -93,7 +93,20 @@ static void nbio_v7_4_enable_doorbell_aperture(struct amdgpu_device *adev, · 92 unmodified lines
9393 static void nbio_v7_4_enable_doorbell_selfring_aperture(struct amdgpu_device *adev,
9494 bool enable)
9595 {
96+ u32 tmp = 0;
9697
98+ if (enable) {
99+ tmp = REG_SET_FIELD(tmp, DOORBELL_SELFRING_GPA_APER_CNTL, DOORBELL_SELFRING_GPA_APER_EN, 1) |
100+ REG_SET_FIELD(tmp, DOORBELL_SELFRING_GPA_APER_CNTL, DOORBELL_SELFRING_GPA_APER_MODE, 1) |
101+ REG_SET_FIELD(tmp, DOORBELL_SELFRING_GPA_APER_CNTL, DOORBELL_SELFRING_GPA_APER_SIZE, 0);
102+
103+ WREG32_SOC15(NBIO, 0, mmDOORBELL_SELFRING_GPA_APER_BASE_LOW,
104+ lower_32_bits(adev->doorbell.base));
105+ WREG32_SOC15(NBIO, 0, mmDOORBELL_SELFRING_GPA_APER_BASE_HIGH,
106+ upper_32_bits(adev->doorbell.base));
107+ }
108+
109+ WREG32_SOC15(NBIO, 0, mmDOORBELL_SELFRING_GPA_APER_CNTL, tmp);
97110 }
98111
99112 static void nbio_v7_4_ih_doorbell_range(struct amdgpu_device *adev,
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c+2−1
@@ -78,7 +78,6 @@ static const struct soc15_reg_golden golden_settings_sdma_4[] = { · 77 unmodified lines
7878 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_RLC1_RB_WPTR_POLL_CNTL, 0x0000fff0, 0x00403000),
7979 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_UTCL1_PAGE, 0x000003ff, 0x000003c0),
8080 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_UTCL1_WATERMK, 0xfc000000, 0x00000000),
81− SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_CHICKEN_BITS, 0xfe931f07, 0x02831f07),
8281 SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_CLK_CTRL, 0xffffffff, 0x3f000100),
8382 SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GFX_IB_CNTL, 0x800f0100, 0x00000100),
8483 SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GFX_RB_WPTR_POLL_CNTL, 0x0000fff0, 0x00403000),
@@ -96,6 +95,7 @@ static const struct soc15_reg_golden golden_settings_sdma_4[] = { · 11 unmodified lines
9695 static const struct soc15_reg_golden golden_settings_sdma_vg10[] = {
9796 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_GB_ADDR_CONFIG, 0x0018773f, 0x00104002),
9897 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_GB_ADDR_CONFIG_READ, 0x0018773f, 0x00104002),
98+ SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_CHICKEN_BITS, 0xfe931f07, 0x02831d07),
9999 SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GB_ADDR_CONFIG, 0x0018773f, 0x00104002),
100100 SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GB_ADDR_CONFIG_READ, 0x0018773f, 0x00104002)
101101 };
@@ -103,6 +103,7 @@ static const struct soc15_reg_golden golden_settings_sdma_vg10[] = { · 1 unmodified line
103103 static const struct soc15_reg_golden golden_settings_sdma_vg12[] = {
104104 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_GB_ADDR_CONFIG, 0x0018773f, 0x00104001),
105105 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_GB_ADDR_CONFIG_READ, 0x0018773f, 0x00104001),
106+ SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_CHICKEN_BITS, 0xfe931f07, 0x02831d07),
106107 SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GB_ADDR_CONFIG, 0x0018773f, 0x00104001),
107108 SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GB_ADDR_CONFIG_READ, 0x0018773f, 0x00104001)
108109 };
drivers/gpu/drm/amd/amdgpu/soc15.c+4−2
@@ -729,11 +729,13 @@ static int soc15_common_early_init(void *handle) · 728 unmodified lines
729729 case CHIP_RAVEN:
730730 adev->asic_funcs = &soc15_asic_funcs;
731731 if (adev->rev_id >= 0x8)
732− adev->external_rev_id = adev->rev_id + 0x81;
732+ adev->external_rev_id = adev->rev_id + 0x79;
733733 else if (adev->pdev->device == 0x15d8)
734734 adev->external_rev_id = adev->rev_id + 0x41;
735+ else if (adev->rev_id == 1)
736+ adev->external_rev_id = adev->rev_id + 0x20;
735737 else
736− adev->external_rev_id = 0x1;
738+ adev->external_rev_id = adev->rev_id + 0x01;
737739
738740 if (adev->rev_id >= 0x8) {
739741 adev->cg_flags = AMD_CG_SUPPORT_GFX_MGCG |
drivers/gpu/drm/amd/amdkfd/Kconfig+2−2
@@ -4,8 +4,8 @@ · 3 unmodified lines
44
55 config HSA_AMD
66 bool "HSA kernel driver for AMD GPU devices"
7− depends on DRM_AMDGPU && X86_64
8− imply AMD_IOMMU_V2
7+ depends on DRM_AMDGPU && (X86_64 || ARM64)
8+ imply AMD_IOMMU_V2 if X86_64
99 select MMU_NOTIFIER
1010 help
1111 Enable this if you want to use HSA features on AMD GPU devices.
drivers/gpu/drm/amd/amdkfd/kfd_crat.c+8−0
@@ -863,6 +863,7 @@ static int kfd_fill_mem_info_for_cpu(int numa_node_id, int *avail_size, · 862 unmodified lines
863863 return 0;
864864 }
865865
866+#ifdef CONFIG_X86_64
866867 static int kfd_fill_iolink_info_for_cpu(int numa_node_id, int *avail_size,
867868 uint32_t *num_entries,
868869 struct crat_subtype_iolink *sub_type_hdr)
@@ -905,6 +906,7 @@ static int kfd_fill_iolink_info_for_cpu(int numa_node_id, int *avail_size, · 36 unmodified lines
905906
906907 return 0;
907908 }
909+#endif
908910
909911 /* kfd_create_vcrat_image_cpu - Create Virtual CRAT for CPU
910912 *
@@ -920,7 +922,9 @@ static int kfd_create_vcrat_image_cpu(void *pcrat_image, size_t *size) · 9 unmodified lines
920922 struct crat_subtype_generic *sub_type_hdr;
921923 int avail_size = *size;
922924 int numa_node_id;
925+#ifdef CONFIG_X86_64
923926 uint32_t entries = 0;
927+#endif
924928 int ret = 0;
925929
926930 if (!pcrat_image || avail_size < VCRAT_SIZE_FOR_CPU)
@@ -982,6 +986,7 @@ static int kfd_create_vcrat_image_cpu(void *pcrat_image, size_t *size) · 55 unmodified lines
982986 sub_type_hdr->length);
983987
984988 /* Fill in Subtype: IO Link */
989+#ifdef CONFIG_X86_64
985990 ret = kfd_fill_iolink_info_for_cpu(numa_node_id, &avail_size,
986991 &entries,
987992 (struct crat_subtype_iolink *)sub_type_hdr);
@@ -992,6 +997,9 @@ static int kfd_create_vcrat_image_cpu(void *pcrat_image, size_t *size) · 4 unmodified lines
992997
993998 sub_type_hdr = (typeof(sub_type_hdr))((char *)sub_type_hdr +
994999 sub_type_hdr->length * entries);
1000+#else
1001+ pr_info("IO link not available for non x86 platforms\n");
1002+#endif
9951003
9961004 crat_table->num_domains++;
9971005 }
drivers/gpu/drm/amd/amdkfd/kfd_topology.c+14−7
@@ -1093,8 +1093,6 @@ static uint32_t kfd_generate_gpu_id(struct kfd_dev *gpu) · 1092 unmodified lines
10931093 * the GPU device is not already present in the topology device
10941094 * list then return NULL. This means a new topology device has to
10951095 * be created for this GPU.
1096− * TODO: Rather than assiging @gpu to first topology device withtout
1097− * gpu attached, it will better to have more stringent check.
10981096 */
10991097 static struct kfd_topology_device *kfd_assign_gpu(struct kfd_dev *gpu)
11001098 {
@@ -1102,12 +1100,20 @@ static struct kfd_topology_device *kfd_assign_gpu(struct kfd_dev *gpu) · 1 unmodified line
11021100 struct kfd_topology_device *out_dev = NULL;
11031101
11041102 down_write(&topology_lock);
1105− list_for_each_entry(dev, &topology_device_list, list)
1103+ list_for_each_entry(dev, &topology_device_list, list) {
1104+ /* Discrete GPUs need their own topology device list
1105+ * entries. Don't assign them to CPU/APU nodes.
1106+ */
1107+ if (!gpu->device_info->needs_iommu_device &&
1108+ dev->node_props.cpu_cores_count)
1109+ continue;
1110+
11061111 if (!dev->gpu && (dev->node_props.simd_count > 0)) {
11071112 dev->gpu = gpu;
11081113 out_dev = dev;
11091114 break;
11101115 }
1116+ }
11111117 up_write(&topology_lock);
11121118 return out_dev;
11131119 }
@@ -1392,7 +1398,6 @@ int kfd_topology_enum_kfd_devices(uint8_t idx, struct kfd_dev **kdev) · 278 unmodified lines
13921398
13931399 static int kfd_cpumask_to_apic_id(const struct cpumask *cpumask)
13941400 {
1395− const struct cpuinfo_x86 *cpuinfo;
13961401 int first_cpu_of_numa_node;
13971402
13981403 if (!cpumask || cpumask == cpu_none_mask)
@@ -1400,9 +1405,11 @@ static int kfd_cpumask_to_apic_id(const struct cpumask *cpumask) · 1 unmodified line
14001405 first_cpu_of_numa_node = cpumask_first(cpumask);
14011406 if (first_cpu_of_numa_node >= nr_cpu_ids)
14021407 return -1;
1403− cpuinfo = &cpu_data(first_cpu_of_numa_node);
1404−
1405− return cpuinfo->apicid;
1408+#ifdef CONFIG_X86_64
1409+ return cpu_data(first_cpu_of_numa_node).apicid;
1410+#else
1411+ return first_cpu_of_numa_node;
1412+#endif
14061413 }
14071414
14081415 /* kfd_numa_node_to_apic_id - Returns the APIC ID of the first logical processor
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+29−15
@@ -699,22 +699,36 @@ static void s3_handle_mst(struct drm_device *dev, bool suspend) · 698 unmodified lines
699699 {
700700 struct amdgpu_dm_connector *aconnector;
701701 struct drm_connector *connector;
702+ struct drm_dp_mst_topology_mgr *mgr;
703+ int ret;
704+ bool need_hotplug = false;
702705
703706 drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
704707
705− list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
706− aconnector = to_amdgpu_dm_connector(connector);
707− if (aconnector->dc_link->type == dc_connection_mst_branch &&
708− !aconnector->mst_port) {
708+ list_for_each_entry(connector, &dev->mode_config.connector_list,
709+ head) {
710+ aconnector = to_amdgpu_dm_connector(connector);
711+ if (aconnector->dc_link->type != dc_connection_mst_branch ||
712+ aconnector->mst_port)
713+ continue;
709714
710− if (suspend)
711− drm_dp_mst_topology_mgr_suspend(&aconnector->mst_mgr);
712− else
713− drm_dp_mst_topology_mgr_resume(&aconnector->mst_mgr);
714− }
715+ mgr = &aconnector->mst_mgr;
716+
717+ if (suspend) {
718+ drm_dp_mst_topology_mgr_suspend(mgr);
719+ } else {
720+ ret = drm_dp_mst_topology_mgr_resume(mgr);
721+ if (ret < 0) {
722+ drm_dp_mst_topology_mgr_set_mst(mgr, false);
723+ need_hotplug = true;
724+ }
725+ }
715726 }
716727
717728 drm_modeset_unlock(&dev->mode_config.connection_mutex);
729+
730+ if (need_hotplug)
731+ drm_kms_helper_hotplug_event(dev);
718732 }
719733
720734 /**
@@ -898,7 +912,6 @@ static int dm_resume(void *handle) · 177 unmodified lines
898912 struct drm_plane_state *new_plane_state;
899913 struct dm_plane_state *dm_new_plane_state;
900914 enum dc_connection_type new_connection_type = dc_connection_none;
901− int ret;
902915 int i;
903916
904917 /* power on hardware */
@@ -971,13 +984,13 @@ static int dm_resume(void *handle) · 66 unmodified lines
971984 }
972985 }
973986
974− ret = drm_atomic_helper_resume(ddev, dm->cached_state);
987+ drm_atomic_helper_resume(ddev, dm->cached_state);
975988
976989 dm->cached_state = NULL;
977990
978991 amdgpu_dm_irq_resume_late(adev);
979992
980− return ret;
993+ return 0;
981994 }
982995
983996 /**
@@ -1759,7 +1772,7 @@ static int amdgpu_dm_backlight_update_status(struct backlight_device *bd) · 775 unmodified lines
17591772 + caps.min_input_signal * 0x101;
17601773
17611774 if (dc_link_set_backlight_level(dm->backlight_link,
1762− brightness, 0, 0))
1775+ brightness, 0))
17631776 return 0;
17641777 else
17651778 return 1;
@@ -4069,7 +4082,8 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, · 2303 unmodified lines
40694082 }
40704083
40714084 if (connector_type == DRM_MODE_CONNECTOR_HDMIA ||
4072− connector_type == DRM_MODE_CONNECTOR_DisplayPort) {
4085+ connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
4086+ connector_type == DRM_MODE_CONNECTOR_eDP) {
40734087 drm_connector_attach_vrr_capable_property(
40744088 &aconnector->base);
40754089 }
@@ -5920,7 +5934,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, · 1844 unmodified lines
59205934 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
59215935 if (!drm_atomic_crtc_needs_modeset(new_crtc_state) &&
59225936 !new_crtc_state->color_mgmt_changed &&
5923− !new_crtc_state->vrr_enabled)
5937+ old_crtc_state->vrr_enabled == new_crtc_state->vrr_enabled)
59245938 continue;
59255939
59265940 if (!new_crtc_state->enable)
drivers/gpu/drm/amd/display/dc/core/dc_link.c+1−11
@@ -2190,8 +2190,7 @@ int dc_link_get_backlight_level(const struct dc_link *link) · 2189 unmodified lines
21902190
21912191 bool dc_link_set_backlight_level(const struct dc_link *link,
21922192 uint32_t backlight_pwm_u16_16,
2193− uint32_t frame_ramp,
2194− const struct dc_stream_state *stream)
2193+ uint32_t frame_ramp)
21952194 {
21962195 struct dc *core_dc = link->ctx->dc;
21972196 struct abm *abm = core_dc->res_pool->abm;
@@ -2206,10 +2205,6 @@ bool dc_link_set_backlight_level(const struct dc_link *link, · 8 unmodified lines
22062205 (abm->funcs->set_backlight_level_pwm == NULL))
22072206 return false;
22082207
2209− if (stream)
2210− ((struct dc_stream_state *)stream)->bl_pwm_level =
2211− backlight_pwm_u16_16;
2212−
22132208 use_smooth_brightness = dmcu->funcs->is_dmcu_initialized(dmcu);
22142209
22152210 DC_LOG_BACKLIGHT("New Backlight level: %d (0x%X)\n",
@@ -2637,11 +2632,6 @@ void core_link_enable_stream( · 421 unmodified lines
26372632
26382633 if (dc_is_dp_signal(pipe_ctx->stream->signal))
26392634 enable_stream_features(pipe_ctx);
2640−
2641− dc_link_set_backlight_level(pipe_ctx->stream->sink->link,
2642− pipe_ctx->stream->bl_pwm_level,
2643− 0,
2644− pipe_ctx->stream);
26452635 }
26462636
26472637 }
drivers/gpu/drm/amd/display/dc/dc_link.h+1−2
@@ -146,8 +146,7 @@ static inline struct dc_link *dc_get_link_at_index(struct dc *dc, uint32_t link_ · 145 unmodified lines
146146 */
147147 bool dc_link_set_backlight_level(const struct dc_link *dc_link,
148148 uint32_t backlight_pwm_u16_16,
149− uint32_t frame_ramp,
150− const struct dc_stream_state *stream);
149+ uint32_t frame_ramp);
151150
152151 int dc_link_get_backlight_level(const struct dc_link *dc_link);
153152
drivers/gpu/drm/amd/display/dc/dc_stream.h+0−1
@@ -91,7 +91,6 @@ struct dc_stream_state { · 90 unmodified lines
9191
9292 /* DMCU info */
9393 unsigned int abm_level;
94− unsigned int bl_pwm_level;
9594
9695 /* from core_stream struct */
9796 struct dc_context *ctx;
drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c+9−1
@@ -591,7 +591,15 @@ static void dce11_pplib_apply_display_requirements( · 590 unmodified lines
591591 dc,
592592 context->bw.dce.sclk_khz);
593593
594− pp_display_cfg->min_dcfclock_khz = pp_display_cfg->min_engine_clock_khz;
594+ /*
595+ * As workaround for >4x4K lightup set dcfclock to min_engine_clock value.
596+ * This is not required for less than 5 displays,
597+ * thus don't request decfclk in dc to avoid impact
598+ * on power saving.
599+ *
600+ */
601+ pp_display_cfg->min_dcfclock_khz = (context->stream_count > 4)?
602+ pp_display_cfg->min_engine_clock_khz : 0;
595603
596604 pp_display_cfg->min_engine_clock_deep_sleep_khz
597605 = context->bw.dce.sclk_deep_sleep_khz;
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c+6−1
@@ -1000,7 +1000,7 @@ void dce110_enable_audio_stream(struct pipe_ctx *pipe_ctx) · 999 unmodified lines
10001000
10011001 pipe_ctx->stream_res.audio->funcs->az_enable(pipe_ctx->stream_res.audio);
10021002
1003− if (num_audio == 1 && pp_smu != NULL && pp_smu->set_pme_wa_enable != NULL)
1003+ if (num_audio >= 1 && pp_smu != NULL && pp_smu->set_pme_wa_enable != NULL)
10041004 /*this is the first audio. apply the PME w/a in order to wake AZ from D3*/
10051005 pp_smu->set_pme_wa_enable(&pp_smu->pp_smu);
10061006 /* un-mute audio */
@@ -1017,6 +1017,8 @@ void dce110_disable_audio_stream(struct pipe_ctx *pipe_ctx, int option) · 10 unmodified lines
10171017 pipe_ctx->stream_res.stream_enc->funcs->audio_mute_control(
10181018 pipe_ctx->stream_res.stream_enc, true);
10191019 if (pipe_ctx->stream_res.audio) {
1020+ struct pp_smu_funcs_rv *pp_smu = dc->res_pool->pp_smu;
1021+
10201022 if (option != KEEP_ACQUIRED_RESOURCE ||
10211023 !dc->debug.az_endpoint_mute_only) {
10221024 /*only disalbe az_endpoint if power down or free*/
@@ -1036,6 +1038,9 @@ void dce110_disable_audio_stream(struct pipe_ctx *pipe_ctx, int option) · 13 unmodified lines
10361038 update_audio_usage(&dc->current_state->res_ctx, dc->res_pool, pipe_ctx->stream_res.audio, false);
10371039 pipe_ctx->stream_res.audio = NULL;
10381040 }
1041+ if (pp_smu != NULL && pp_smu->set_pme_wa_enable != NULL)
1042+ /*this is the first audio. apply the PME w/a in order to wake AZ from D3*/
1043+ pp_smu->set_pme_wa_enable(&pp_smu->pp_smu);
10391044
10401045 /* TODO: notify audio driver for if audio modes list changed
10411046 * add audio mode list change flag */
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c+1−1
@@ -463,7 +463,7 @@ void dpp1_set_cursor_position( · 462 unmodified lines
463463 if (src_y_offset >= (int)param->viewport.height)
464464 cur_en = 0; /* not visible beyond bottom edge*/
465465
466− if (src_y_offset < 0)
466+ if (src_y_offset + (int)height <= 0)
467467 cur_en = 0; /* not visible beyond top edge*/
468468
469469 REG_UPDATE(CURSOR0_CONTROL,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c+1−1
@@ -1140,7 +1140,7 @@ void hubp1_cursor_set_position( · 1139 unmodified lines
11401140 if (src_y_offset >= (int)param->viewport.height)
11411141 cur_en = 0; /* not visible beyond bottom edge*/
11421142
1143− if (src_y_offset < 0) //+ (int)hubp->curs_attr.height
1143+ if (src_y_offset + (int)hubp->curs_attr.height <= 0)
11441144 cur_en = 0; /* not visible beyond top edge*/
11451145
11461146 if (cur_en && REG_READ(CURSOR_SURFACE_ADDRESS) == 0)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c+6−13
@@ -2355,29 +2355,22 @@ static void dcn10_apply_ctx_for_surface( · 2354 unmodified lines
23552355 top_pipe_to_program->plane_state->update_flags.bits.full_update)
23562356 for (i = 0; i < dc->res_pool->pipe_count; i++) {
23572357 struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
2358−
2358+ tg = pipe_ctx->stream_res.tg;
23592359 /* Skip inactive pipes and ones already updated */
23602360 if (!pipe_ctx->stream || pipe_ctx->stream == stream
2361− || !pipe_ctx->plane_state)
2361+ || !pipe_ctx->plane_state
2362+ || !tg->funcs->is_tg_enabled(tg))
23622363 continue;
23632364
2364− pipe_ctx->stream_res.tg->funcs->lock(pipe_ctx->stream_res.tg);
2365+ tg->funcs->lock(tg);
23652366
23662367 pipe_ctx->plane_res.hubp->funcs->hubp_setup_interdependent(
23672368 pipe_ctx->plane_res.hubp,
23682369 &pipe_ctx->dlg_regs,
23692370 &pipe_ctx->ttu_regs);
2370− }
2371−
2372− for (i = 0; i < dc->res_pool->pipe_count; i++) {
2373− struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
23742371
2375− if (!pipe_ctx->stream || pipe_ctx->stream == stream
2376− || !pipe_ctx->plane_state)
2377− continue;
2378−
2379− dcn10_pipe_control_lock(dc, pipe_ctx, false);
2380− }
2372+ tg->funcs->unlock(tg);
2373+ }
23812374
23822375 if (num_planes == 0)
23832376 false_optc_underflow_wa(dc, stream, tg);
drivers/gpu/drm/amd/display/modules/power/power_helpers.c+2−0
@@ -57,6 +57,7 @@ static const unsigned char abm_config[abm_defines_max_config][abm_defines_max_le · 56 unmodified lines
5757 #define NUM_POWER_FN_SEGS 8
5858 #define NUM_BL_CURVE_SEGS 16
5959
60+#pragma pack(push, 1)
6061 /* NOTE: iRAM is 256B in size */
6162 struct iram_table_v_2 {
6263 /* flags */
@@ -100,6 +101,7 @@ struct iram_table_v_2 { · 37 unmodified lines
100101 uint8_t dummy8; /* 0xfe */
101102 uint8_t dummy9; /* 0xff */
102103 };
104+#pragma pack(pop)
103105
104106 static uint16_t backlight_8_to_16(unsigned int backlight_8bit)
105107 {
drivers/gpu/drm/amd/include/kgd_pp_interface.h+7−6
@@ -127,12 +127,13 @@ enum amd_pp_task { · 126 unmodified lines
127127 };
128128
129129 enum PP_SMC_POWER_PROFILE {
130− PP_SMC_POWER_PROFILE_FULLSCREEN3D = 0x0,
131− PP_SMC_POWER_PROFILE_POWERSAVING = 0x1,
132− PP_SMC_POWER_PROFILE_VIDEO = 0x2,
133− PP_SMC_POWER_PROFILE_VR = 0x3,
134− PP_SMC_POWER_PROFILE_COMPUTE = 0x4,
135− PP_SMC_POWER_PROFILE_CUSTOM = 0x5,
130+ PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT = 0x0,
131+ PP_SMC_POWER_PROFILE_FULLSCREEN3D = 0x1,
132+ PP_SMC_POWER_PROFILE_POWERSAVING = 0x2,
133+ PP_SMC_POWER_PROFILE_VIDEO = 0x3,
134+ PP_SMC_POWER_PROFILE_VR = 0x4,
135+ PP_SMC_POWER_PROFILE_COMPUTE = 0x5,
136+ PP_SMC_POWER_PROFILE_CUSTOM = 0x6,
136137 };
137138
138139 enum {
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c+13−11
@@ -64,17 +64,19 @@ static int ci_set_asic_special_caps(struct pp_hwmgr *hwmgr); · 63 unmodified lines
6464
6565 static void hwmgr_init_workload_prority(struct pp_hwmgr *hwmgr)
6666 {
67− hwmgr->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D] = 2;
68− hwmgr->workload_prority[PP_SMC_POWER_PROFILE_POWERSAVING] = 0;
69− hwmgr->workload_prority[PP_SMC_POWER_PROFILE_VIDEO] = 1;
70− hwmgr->workload_prority[PP_SMC_POWER_PROFILE_VR] = 3;
71− hwmgr->workload_prority[PP_SMC_POWER_PROFILE_COMPUTE] = 4;
72−
73− hwmgr->workload_setting[0] = PP_SMC_POWER_PROFILE_POWERSAVING;
74− hwmgr->workload_setting[1] = PP_SMC_POWER_PROFILE_VIDEO;
75− hwmgr->workload_setting[2] = PP_SMC_POWER_PROFILE_FULLSCREEN3D;
76− hwmgr->workload_setting[3] = PP_SMC_POWER_PROFILE_VR;
77− hwmgr->workload_setting[4] = PP_SMC_POWER_PROFILE_COMPUTE;
67+ hwmgr->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT] = 0;
68+ hwmgr->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D] = 1;
69+ hwmgr->workload_prority[PP_SMC_POWER_PROFILE_POWERSAVING] = 2;
70+ hwmgr->workload_prority[PP_SMC_POWER_PROFILE_VIDEO] = 3;
71+ hwmgr->workload_prority[PP_SMC_POWER_PROFILE_VR] = 4;
72+ hwmgr->workload_prority[PP_SMC_POWER_PROFILE_COMPUTE] = 5;
73+
74+ hwmgr->workload_setting[0] = PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT;
75+ hwmgr->workload_setting[1] = PP_SMC_POWER_PROFILE_FULLSCREEN3D;
76+ hwmgr->workload_setting[2] = PP_SMC_POWER_PROFILE_POWERSAVING;
77+ hwmgr->workload_setting[3] = PP_SMC_POWER_PROFILE_VIDEO;
78+ hwmgr->workload_setting[4] = PP_SMC_POWER_PROFILE_VR;
79+ hwmgr->workload_setting[5] = PP_SMC_POWER_PROFILE_COMPUTE;
7880 }
7981
8082 int hwmgr_early_init(struct pp_hwmgr *hwmgr)
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c+1−0
@@ -1033,6 +1033,7 @@ static int smu10_get_clock_by_type_with_latency(struct pp_hwmgr *hwmgr, · 1032 unmodified lines
10331033 break;
10341034 case amd_pp_dpp_clock:
10351035 pclk_vol_table = pinfo->vdd_dep_on_dppclk;
1036+ break;
10361037 default:
10371038 return -EINVAL;
10381039 }
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c+5−3
@@ -77,8 +77,9 @@ · 76 unmodified lines
7777 #define PCIE_BUS_CLK 10000
7878 #define TCLK (PCIE_BUS_CLK / 10)
7979
80−static const struct profile_mode_setting smu7_profiling[6] =
81− {{1, 0, 100, 30, 1, 0, 100, 10},
80+static const struct profile_mode_setting smu7_profiling[7] =
81+ {{0, 0, 0, 0, 0, 0, 0, 0},
82+ {1, 0, 100, 30, 1, 0, 100, 10},
8283 {1, 10, 0, 30, 0, 0, 0, 0},
8384 {0, 0, 0, 0, 1, 10, 16, 31},
8485 {1, 0, 11, 50, 1, 0, 100, 10},
@@ -4889,7 +4890,8 @@ static int smu7_get_power_profile_mode(struct pp_hwmgr *hwmgr, char *buf) · 4804 unmodified lines
48894890 uint32_t i, size = 0;
48904891 uint32_t len;
48914892
4892− static const char *profile_name[6] = {"3D_FULL_SCREEN",
4893+ static const char *profile_name[7] = {"BOOTUP_DEFAULT",
4894+ "3D_FULL_SCREEN",
48934895 "POWER_SAVING",
48944896 "VIDEO",
48954897 "VR",
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c+7−5
@@ -804,9 +804,9 @@ static int vega10_hwmgr_backend_init(struct pp_hwmgr *hwmgr) · 803 unmodified lines
804804
805805 hwmgr->backend = data;
806806
807− hwmgr->workload_mask = 1 << hwmgr->workload_prority[PP_SMC_POWER_PROFILE_VIDEO];
808− hwmgr->power_profile_mode = PP_SMC_POWER_PROFILE_VIDEO;
809− hwmgr->default_power_profile_mode = PP_SMC_POWER_PROFILE_VIDEO;
807+ hwmgr->workload_mask = 1 << hwmgr->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];
808+ hwmgr->power_profile_mode = PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT;
809+ hwmgr->default_power_profile_mode = PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT;
810810
811811 vega10_set_default_registry_data(hwmgr);
812812 data->disable_dpm_mask = 0xff;
@@ -4668,13 +4668,15 @@ static int vega10_get_power_profile_mode(struct pp_hwmgr *hwmgr, char *buf) · 3855 unmodified lines
46684668 {
46694669 struct vega10_hwmgr *data = hwmgr->backend;
46704670 uint32_t i, size = 0;
4671− static const uint8_t profile_mode_setting[5][4] = {{70, 60, 1, 3,},
4671+ static const uint8_t profile_mode_setting[6][4] = {{70, 60, 0, 0,},
4672+ {70, 60, 1, 3,},
46724673 {90, 60, 0, 0,},
46734674 {70, 60, 0, 0,},
46744675 {70, 90, 0, 0,},
46754676 {30, 60, 0, 6,},
46764677 };
4677− static const char *profile_name[6] = {"3D_FULL_SCREEN",
4678+ static const char *profile_name[7] = {"BOOTUP_DEFAULT",
4679+ "3D_FULL_SCREEN",
46784680 "POWER_SAVING",
46794681 "VIDEO",
46804682 "VR",
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c+21−1
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include "vega10_pptable.h"
3333
3434 #define NUM_DSPCLK_LEVELS 8
35+#define VEGA10_ENGINECLOCK_HARDMAX 198000
3536
3637 static void set_hw_cap(struct pp_hwmgr *hwmgr, bool enable,
3738 enum phm_platform_caps cap)
@@ -258,7 +259,26 @@ static int init_over_drive_limits( · 220 unmodified lines
258259 struct pp_hwmgr *hwmgr,
259260 const ATOM_Vega10_POWERPLAYTABLE *powerplay_table)
260261 {
261− hwmgr->platform_descriptor.overdriveLimit.engineClock =
262+ const ATOM_Vega10_GFXCLK_Dependency_Table *gfxclk_dep_table =
263+ (const ATOM_Vega10_GFXCLK_Dependency_Table *)
264+ (((unsigned long) powerplay_table) +
265+ le16_to_cpu(powerplay_table->usGfxclkDependencyTableOffset));
266+ bool is_acg_enabled = false;
267+ ATOM_Vega10_GFXCLK_Dependency_Record_V2 *patom_record_v2;
268+
269+ if (gfxclk_dep_table->ucRevId == 1) {
270+ patom_record_v2 =
271+ (ATOM_Vega10_GFXCLK_Dependency_Record_V2 *)gfxclk_dep_table->entries;
272+ is_acg_enabled =
273+ (bool)patom_record_v2[gfxclk_dep_table->ucNumEntries-1].ucACGEnable;
274+ }
275+
276+ if (powerplay_table->ulMaxODEngineClock > VEGA10_ENGINECLOCK_HARDMAX &&
277+ !is_acg_enabled)
278+ hwmgr->platform_descriptor.overdriveLimit.engineClock =
279+ VEGA10_ENGINECLOCK_HARDMAX;
280+ else
281+ hwmgr->platform_descriptor.overdriveLimit.engineClock =
262282 le32_to_cpu(powerplay_table->ulMaxODEngineClock);
263283 hwmgr->platform_descriptor.overdriveLimit.memoryClock =
264284 le32_to_cpu(powerplay_table->ulMaxODMemoryClock);
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c+21−0
@@ -753,6 +753,22 @@ static int vega12_init_smc_table(struct pp_hwmgr *hwmgr) · 752 unmodified lines
753753 return 0;
754754 }
755755
756+static int vega12_run_acg_btc(struct pp_hwmgr *hwmgr)
757+{
758+ uint32_t result;
759+
760+ PP_ASSERT_WITH_CODE(
761+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_RunAcgBtc) == 0,
762+ "[Run_ACG_BTC] Attempt to run ACG BTC failed!",
763+ return -EINVAL);
764+
765+ result = smum_get_argument(hwmgr);
766+ PP_ASSERT_WITH_CODE(result == 1,
767+ "Failed to run ACG BTC!", return -EINVAL);
768+
769+ return 0;
770+}
771+
756772 static int vega12_set_allowed_featuresmask(struct pp_hwmgr *hwmgr)
757773 {
758774 struct vega12_hwmgr *data =
@@ -931,6 +947,11 @@ static int vega12_enable_dpm_tasks(struct pp_hwmgr *hwmgr) · 172 unmodified lines
931947 "Failed to initialize SMC table!",
932948 result = tmp_result);
933949
950+ tmp_result = vega12_run_acg_btc(hwmgr);
951+ PP_ASSERT_WITH_CODE(!tmp_result,
952+ "Failed to run ACG BTC!",
953+ result = tmp_result);
954+
934955 result = vega12_enable_all_smu_features(hwmgr);
935956 PP_ASSERT_WITH_CODE(!result,
936957 "Failed to enable all smu features!",
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c+24−10
@@ -390,9 +390,9 @@ static int vega20_hwmgr_backend_init(struct pp_hwmgr *hwmgr) · 389 unmodified lines
390390
391391 hwmgr->backend = data;
392392
393− hwmgr->workload_mask = 1 << hwmgr->workload_prority[PP_SMC_POWER_PROFILE_VIDEO];
394− hwmgr->power_profile_mode = PP_SMC_POWER_PROFILE_VIDEO;
395− hwmgr->default_power_profile_mode = PP_SMC_POWER_PROFILE_VIDEO;
393+ hwmgr->workload_mask = 1 << hwmgr->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];
394+ hwmgr->power_profile_mode = PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT;
395+ hwmgr->default_power_profile_mode = PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT;
396396
397397 vega20_set_default_registry_data(hwmgr);
398398
@@ -980,6 +980,9 @@ static int vega20_od8_set_feature_capabilities( · 581 unmodified lines
980980 pp_table->FanZeroRpmEnable)
981981 od_settings->overdrive8_capabilities |= OD8_FAN_ZERO_RPM_CONTROL;
982982
983+ if (!od_settings->overdrive8_capabilities)
984+ hwmgr->od_enabled = false;
985+
983986 return 0;
984987 }
985988
@@ -1689,13 +1692,6 @@ static int vega20_upload_dpm_min_level(struct pp_hwmgr *hwmgr, uint32_t feature_ · 703 unmodified lines
16891692 (PPCLK_UCLK << 16) | (min_freq & 0xffff))),
16901693 "Failed to set soft min memclk !",
16911694 return ret);
1692−
1693− min_freq = data->dpm_table.mem_table.dpm_state.hard_min_level;
1694− PP_ASSERT_WITH_CODE(!(ret = smum_send_msg_to_smc_with_parameter(
1695− hwmgr, PPSMC_MSG_SetHardMinByFreq,
1696− (PPCLK_UCLK << 16) | (min_freq & 0xffff))),
1697− "Failed to set hard min memclk !",
1698− return ret);
16991695 }
17001696
17011697 if (data->smu_features[GNLD_DPM_UVD].enabled &&
@@ -2248,6 +2244,13 @@ static int vega20_force_clock_level(struct pp_hwmgr *hwmgr, · 546 unmodified lines
22482244 soft_min_level = mask ? (ffs(mask) - 1) : 0;
22492245 soft_max_level = mask ? (fls(mask) - 1) : 0;
22502246
2247+ if (soft_max_level >= data->dpm_table.gfx_table.count) {
2248+ pr_err("Clock level specified %d is over max allowed %d\n",
2249+ soft_max_level,
2250+ data->dpm_table.gfx_table.count - 1);
2251+ return -EINVAL;
2252+ }
2253+
22512254 data->dpm_table.gfx_table.dpm_state.soft_min_level =
22522255 data->dpm_table.gfx_table.dpm_levels[soft_min_level].value;
22532256 data->dpm_table.gfx_table.dpm_state.soft_max_level =
@@ -2268,6 +2271,13 @@ static int vega20_force_clock_level(struct pp_hwmgr *hwmgr, · 14 unmodified lines
22682271 soft_min_level = mask ? (ffs(mask) - 1) : 0;
22692272 soft_max_level = mask ? (fls(mask) - 1) : 0;
22702273
2274+ if (soft_max_level >= data->dpm_table.mem_table.count) {
2275+ pr_err("Clock level specified %d is over max allowed %d\n",
2276+ soft_max_level,
2277+ data->dpm_table.mem_table.count - 1);
2278+ return -EINVAL;
2279+ }
2280+
22712281 data->dpm_table.mem_table.dpm_state.soft_min_level =
22722282 data->dpm_table.mem_table.dpm_levels[soft_min_level].value;
22732283 data->dpm_table.mem_table.dpm_state.soft_max_level =
@@ -3261,6 +3271,9 @@ static int conv_power_profile_to_pplib_workload(int power_profile) · 987 unmodified lines
32613271 int pplib_workload = 0;
32623272
32633273 switch (power_profile) {
3274+ case PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT:
3275+ pplib_workload = WORKLOAD_DEFAULT_BIT;
3276+ break;
32643277 case PP_SMC_POWER_PROFILE_FULLSCREEN3D:
32653278 pplib_workload = WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT;
32663279 break;
@@ -3290,6 +3303,7 @@ static int vega20_get_power_profile_mode(struct pp_hwmgr *hwmgr, char *buf) · 23 unmodified lines
32903303 uint32_t i, size = 0;
32913304 uint16_t workload_type = 0;
32923305 static const char *profile_name[] = {
3306+ "BOOTUP_DEFAULT",
32933307 "3D_FULL_SCREEN",
32943308 "POWER_SAVING",
32953309 "VIDEO",
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h+1−1
@@ -705,7 +705,7 @@ enum PP_TABLE_VERSION { · 704 unmodified lines
705705 /**
706706 * The main hardware manager structure.
707707 */
708−#define Workload_Policy_Max 5
708+#define Workload_Policy_Max 6
709709
710710 struct pp_hwmgr {
711711 void *adev;
drivers/gpu/drm/bridge/tc358767.c+38−10
@@ -98,6 +98,8 @@ · 97 unmodified lines
9898 #define DP0_STARTVAL 0x064c
9999 #define DP0_ACTIVEVAL 0x0650
100100 #define DP0_SYNCVAL 0x0654
101+#define SYNCVAL_HS_POL_ACTIVE_LOW (1 << 15)
102+#define SYNCVAL_VS_POL_ACTIVE_LOW (1 << 31)
101103 #define DP0_MISC 0x0658
102104 #define TU_SIZE_RECOMMENDED (63) /* LSCLK cycles per TU */
103105 #define BPC_6 (0 << 5)
@@ -142,6 +144,8 @@ · 38 unmodified lines
142144 #define DP0_LTLOOPCTRL 0x06d8
143145 #define DP0_SNKLTCTRL 0x06e4
144146
147+#define DP1_SRCCTRL 0x07a0
148+
145149 /* PHY */
146150 #define DP_PHY_CTRL 0x0800
147151 #define DP_PHY_RST BIT(28) /* DP PHY Global Soft Reset */
@@ -150,6 +154,7 @@ · 2 unmodified lines
150154 #define PHY_M1_RST BIT(12) /* Reset PHY1 Main Channel */
151155 #define PHY_RDY BIT(16) /* PHY Main Channels Ready */
152156 #define PHY_M0_RST BIT(8) /* Reset PHY0 Main Channel */
157+#define PHY_2LANE BIT(2) /* PHY Enable 2 lanes */
153158 #define PHY_A0_EN BIT(1) /* PHY Aux Channel0 Enable */
154159 #define PHY_M0_EN BIT(0) /* PHY Main Channel0 Enable */
155160
@@ -540,6 +545,7 @@ static int tc_aux_link_setup(struct tc_data *tc) · 384 unmodified lines
540545 unsigned long rate;
541546 u32 value;
542547 int ret;
548+ u32 dp_phy_ctrl;
543549
544550 rate = clk_get_rate(tc->refclk);
545551 switch (rate) {
@@ -564,7 +570,10 @@ static int tc_aux_link_setup(struct tc_data *tc) · 18 unmodified lines
564570 value |= SYSCLK_SEL_LSCLK | LSCLK_DIV_2;
565571 tc_write(SYS_PLLPARAM, value);
566572
567− tc_write(DP_PHY_CTRL, BGREN | PWR_SW_EN | BIT(2) | PHY_A0_EN);
573+ dp_phy_ctrl = BGREN | PWR_SW_EN | PHY_A0_EN;
574+ if (tc->link.base.num_lanes == 2)
575+ dp_phy_ctrl |= PHY_2LANE;
576+ tc_write(DP_PHY_CTRL, dp_phy_ctrl);
568577
569578 /*
570579 * Initially PLLs are in bypass. Force PLL parameter update,
@@ -719,7 +728,9 @@ static int tc_set_video_mode(struct tc_data *tc, struct drm_display_mode *mode) · 148 unmodified lines
719728
720729 tc_write(DP0_ACTIVEVAL, (mode->vdisplay << 16) | (mode->hdisplay));
721730
722− tc_write(DP0_SYNCVAL, (vsync_len << 16) | (hsync_len << 0));
731+ tc_write(DP0_SYNCVAL, (vsync_len << 16) | (hsync_len << 0) |
732+ ((mode->flags & DRM_MODE_FLAG_NHSYNC) ? SYNCVAL_HS_POL_ACTIVE_LOW : 0) |
733+ ((mode->flags & DRM_MODE_FLAG_NVSYNC) ? SYNCVAL_VS_POL_ACTIVE_LOW : 0));
723734
724735 tc_write(DPIPXLFMT, VS_POL_ACTIVE_LOW | HS_POL_ACTIVE_LOW |
725736 DE_POL_ACTIVE_HIGH | SUB_CFG_TYPE_CONFIG1 | DPI_BPP_RGB888);
@@ -829,12 +840,11 @@ static int tc_main_link_setup(struct tc_data *tc) · 103 unmodified lines
829840 if (!tc->mode)
830841 return -EINVAL;
831842
832− /* from excel file - DP0_SrcCtrl */
833− tc_write(DP0_SRCCTRL, DP0_SRCCTRL_SCRMBLDIS | DP0_SRCCTRL_EN810B |
834− DP0_SRCCTRL_LANESKEW | DP0_SRCCTRL_LANES_2 |
835− DP0_SRCCTRL_BW27 | DP0_SRCCTRL_AUTOCORRECT);
836− /* from excel file - DP1_SrcCtrl */
837− tc_write(0x07a0, 0x00003083);
843+ tc_write(DP0_SRCCTRL, tc_srcctrl(tc));
844+ /* SSCG and BW27 on DP1 must be set to the same as on DP0 */
845+ tc_write(DP1_SRCCTRL,
846+ (tc->link.spread ? DP0_SRCCTRL_SSCG : 0) |
847+ ((tc->link.base.rate != 162000) ? DP0_SRCCTRL_BW27 : 0));
838848
839849 rate = clk_get_rate(tc->refclk);
840850 switch (rate) {
@@ -855,8 +865,11 @@ static int tc_main_link_setup(struct tc_data *tc) · 14 unmodified lines
855865 }
856866 value |= SYSCLK_SEL_LSCLK | LSCLK_DIV_2;
857867 tc_write(SYS_PLLPARAM, value);
868+
858869 /* Setup Main Link */
859− dp_phy_ctrl = BGREN | PWR_SW_EN | BIT(2) | PHY_A0_EN | PHY_M0_EN;
870+ dp_phy_ctrl = BGREN | PWR_SW_EN | PHY_A0_EN | PHY_M0_EN;
871+ if (tc->link.base.num_lanes == 2)
872+ dp_phy_ctrl |= PHY_2LANE;
860873 tc_write(DP_PHY_CTRL, dp_phy_ctrl);
861874 msleep(100);
862875
@@ -1105,10 +1118,20 @@ static bool tc_bridge_mode_fixup(struct drm_bridge *bridge, · 242 unmodified lines
11051118 static enum drm_mode_status tc_connector_mode_valid(struct drm_connector *connector,
11061119 struct drm_display_mode *mode)
11071120 {
1121+ struct tc_data *tc = connector_to_tc(connector);
1122+ u32 req, avail;
1123+ u32 bits_per_pixel = 24;
1124+
11081125 /* DPI interface clock limitation: upto 154 MHz */
11091126 if (mode->clock > 154000)
11101127 return MODE_CLOCK_HIGH;
11111128
1129+ req = mode->clock * bits_per_pixel / 8;
1130+ avail = tc->link.base.num_lanes * tc->link.base.rate;
1131+
1132+ if (req > avail)
1133+ return MODE_BAD;
1134+
11121135 return MODE_OK;
11131136 }
11141137
@@ -1186,7 +1209,8 @@ static int tc_bridge_attach(struct drm_bridge *bridge) · 71 unmodified lines
11861209 /* Create eDP connector */
11871210 drm_connector_helper_add(&tc->connector, &tc_connector_helper_funcs);
11881211 ret = drm_connector_init(drm, &tc->connector, &tc_connector_funcs,
1189− DRM_MODE_CONNECTOR_eDP);
1212+ tc->panel ? DRM_MODE_CONNECTOR_eDP :
1213+ DRM_MODE_CONNECTOR_DisplayPort);
11901214 if (ret)
11911215 return ret;
11921216
@@ -1195,6 +1219,10 @@ static int tc_bridge_attach(struct drm_bridge *bridge) · 2 unmodified lines
11951219
11961220 drm_display_info_set_bus_formats(&tc->connector.display_info,
11971221 &bus_format, 1);
1222+ tc->connector.display_info.bus_flags =
1223+ DRM_BUS_FLAG_DE_HIGH |
1224+ DRM_BUS_FLAG_PIXDATA_NEGEDGE |
1225+ DRM_BUS_FLAG_SYNC_NEGEDGE;
11981226 drm_connector_attach_encoder(&tc->connector, tc->bridge.encoder);
11991227
12001228 return 0;
drivers/gpu/drm/drm_atomic_uapi.c+1−2
@@ -1296,12 +1296,11 @@ int drm_mode_atomic_ioctl(struct drm_device *dev, · 1295 unmodified lines
12961296 (arg->flags & DRM_MODE_PAGE_FLIP_EVENT))
12971297 return -EINVAL;
12981298
1299− drm_modeset_acquire_init(&ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE);
1300−
13011299 state = drm_atomic_state_alloc(dev);
13021300 if (!state)
13031301 return -ENOMEM;
13041302
1303+ drm_modeset_acquire_init(&ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE);
13051304 state->acquire_ctx = &ctx;
13061305 state->allow_modeset = !!(arg->flags & DRM_MODE_ATOMIC_ALLOW_MODESET);
13071306
drivers/gpu/drm/drm_dp_helper.c+2−0
@@ -1273,6 +1273,8 @@ static const struct dpcd_quirk dpcd_quirk_list[] = { · 1272 unmodified lines
12731273 { OUI(0x00, 0x22, 0xb9), DEVICE_ID_ANY, true, BIT(DP_DPCD_QUIRK_CONSTANT_N) },
12741274 /* LG LP140WF6-SPM1 eDP panel */
12751275 { OUI(0x00, 0x22, 0xb9), DEVICE_ID('s', 'i', 'v', 'a', 'r', 'T'), false, BIT(DP_DPCD_QUIRK_CONSTANT_N) },
1276+ /* Apple panels need some additional handling to support PSR */
1277+ { OUI(0x00, 0x10, 0xfa), DEVICE_ID_ANY, false, BIT(DP_DPCD_QUIRK_NO_PSR) }
12761278 };
12771279
12781280 #undef OUI
drivers/gpu/drm/drm_fb_helper.c+79−54
@@ -1621,6 +1621,64 @@ static bool drm_fb_pixel_format_equal(const struct fb_var_screeninfo *var_1, · 1620 unmodified lines
16211621 var_1->transp.msb_right == var_2->transp.msb_right;
16221622 }
16231623
1624+static void drm_fb_helper_fill_pixel_fmt(struct fb_var_screeninfo *var,
1625+ u8 depth)
1626+{
1627+ switch (depth) {
1628+ case 8:
1629+ var->red.offset = 0;
1630+ var->green.offset = 0;
1631+ var->blue.offset = 0;
1632+ var->red.length = 8; /* 8bit DAC */
1633+ var->green.length = 8;
1634+ var->blue.length = 8;
1635+ var->transp.offset = 0;
1636+ var->transp.length = 0;
1637+ break;
1638+ case 15:
1639+ var->red.offset = 10;
1640+ var->green.offset = 5;
1641+ var->blue.offset = 0;
1642+ var->red.length = 5;
1643+ var->green.length = 5;
1644+ var->blue.length = 5;
1645+ var->transp.offset = 15;
1646+ var->transp.length = 1;
1647+ break;
1648+ case 16:
1649+ var->red.offset = 11;
1650+ var->green.offset = 5;
1651+ var->blue.offset = 0;
1652+ var->red.length = 5;
1653+ var->green.length = 6;
1654+ var->blue.length = 5;
1655+ var->transp.offset = 0;
1656+ break;
1657+ case 24:
1658+ var->red.offset = 16;
1659+ var->green.offset = 8;
1660+ var->blue.offset = 0;
1661+ var->red.length = 8;
1662+ var->green.length = 8;
1663+ var->blue.length = 8;
1664+ var->transp.offset = 0;
1665+ var->transp.length = 0;
1666+ break;
1667+ case 32:
1668+ var->red.offset = 16;
1669+ var->green.offset = 8;
1670+ var->blue.offset = 0;
1671+ var->red.length = 8;
1672+ var->green.length = 8;
1673+ var->blue.length = 8;
1674+ var->transp.offset = 24;
1675+ var->transp.length = 8;
1676+ break;
1677+ default:
1678+ break;
1679+ }
1680+}
1681+
16241682 /**
16251683 * drm_fb_helper_check_var - implementation for &fb_ops.fb_check_var
16261684 * @var: screeninfo to check
@@ -1632,9 +1690,14 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var, · 5 unmodified lines
16321690 struct drm_fb_helper *fb_helper = info->par;
16331691 struct drm_framebuffer *fb = fb_helper->fb;
16341692
1635− if (var->pixclock != 0 || in_dbg_master())
1693+ if (in_dbg_master())
16361694 return -EINVAL;
16371695
1696+ if (var->pixclock != 0) {
1697+ DRM_DEBUG("fbdev emulation doesn't support changing the pixel clock, value of pixclock is ignored\n");
1698+ var->pixclock = 0;
1699+ }
1700+
16381701 if ((drm_format_info_block_width(fb->format, 0) > 1) ||
16391702 (drm_format_info_block_height(fb->format, 0) > 1))
16401703 return -EINVAL;
@@ -1654,6 +1717,20 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var, · 13 unmodified lines
16541717 return -EINVAL;
16551718 }
16561719
1720+ /*
1721+ * Workaround for SDL 1.2, which is known to be setting all pixel format
1722+ * fields values to zero in some cases. We treat this situation as a
1723+ * kind of "use some reasonable autodetected values".
1724+ */
1725+ if (!var->red.offset && !var->green.offset &&
1726+ !var->blue.offset && !var->transp.offset &&
1727+ !var->red.length && !var->green.length &&
1728+ !var->blue.length && !var->transp.length &&
1729+ !var->red.msb_right && !var->green.msb_right &&
1730+ !var->blue.msb_right && !var->transp.msb_right) {
1731+ drm_fb_helper_fill_pixel_fmt(var, fb->format->depth);
1732+ }
1733+
16571734 /*
16581735 * drm fbdev emulation doesn't support changing the pixel format at all,
16591736 * so reject all pixel format changing requests.
@@ -1967,59 +2044,7 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe · 307 unmodified lines
19672044 info->var.yoffset = 0;
19682045 info->var.activate = FB_ACTIVATE_NOW;
19692046
1970− switch (fb->format->depth) {
1971− case 8:
1972− info->var.red.offset = 0;
1973− info->var.green.offset = 0;
1974− info->var.blue.offset = 0;
1975− info->var.red.length = 8; /* 8bit DAC */
1976− info->var.green.length = 8;
1977− info->var.blue.length = 8;
1978− info->var.transp.offset = 0;
1979− info->var.transp.length = 0;
1980− break;
1981− case 15:
1982− info->var.red.offset = 10;
1983− info->var.green.offset = 5;
1984− info->var.blue.offset = 0;
1985− info->var.red.length = 5;
1986− info->var.green.length = 5;
1987− info->var.blue.length = 5;
1988− info->var.transp.offset = 15;
1989− info->var.transp.length = 1;
1990− break;
1991− case 16:
1992− info->var.red.offset = 11;
1993− info->var.green.offset = 5;
1994− info->var.blue.offset = 0;
1995− info->var.red.length = 5;
1996− info->var.green.length = 6;
1997− info->var.blue.length = 5;
1998− info->var.transp.offset = 0;
1999− break;
2000− case 24:
2001− info->var.red.offset = 16;
2002− info->var.green.offset = 8;
2003− info->var.blue.offset = 0;
2004− info->var.red.length = 8;
2005− info->var.green.length = 8;
2006− info->var.blue.length = 8;
2007− info->var.transp.offset = 0;
2008− info->var.transp.length = 0;
2009− break;
2010− case 32:
2011− info->var.red.offset = 16;
2012− info->var.green.offset = 8;
2013− info->var.blue.offset = 0;
2014− info->var.red.length = 8;
2015− info->var.green.length = 8;
2016− info->var.blue.length = 8;
2017− info->var.transp.offset = 24;
2018− info->var.transp.length = 8;
2019− break;
2020− default:
2021− break;
2022− }
2047+ drm_fb_helper_fill_pixel_fmt(&info->var, fb->format->depth);
20232048
20242049 info->var.xres = fb_width;
20252050 info->var.yres = fb_height;
drivers/gpu/drm/drm_mode_object.c+2−2
@@ -459,11 +459,11 @@ static int set_property_atomic(struct drm_mode_object *obj, · 458 unmodified lines
459459 struct drm_modeset_acquire_ctx ctx;
460460 int ret;
461461
462− drm_modeset_acquire_init(&ctx, 0);
463−
464462 state = drm_atomic_state_alloc(dev);
465463 if (!state)
466464 return -ENOMEM;
465+
466+ drm_modeset_acquire_init(&ctx, 0);
467467 state->acquire_ctx = &ctx;
468468 retry:
469469 if (prop == state->dev->mode_config.dpms_property) {
drivers/gpu/drm/drm_modes.c+1−1
@@ -758,7 +758,7 @@ int drm_mode_hsync(const struct drm_display_mode *mode) · 757 unmodified lines
758758 if (mode->hsync)
759759 return mode->hsync;
760760
761− if (mode->htotal < 0)
761+ if (mode->htotal <= 0)
762762 return 0;
763763
764764 calc_val = (mode->clock * 1000) / mode->htotal; /* hsync in Hz */
drivers/gpu/drm/drm_pci.c+3−2
@@ -61,8 +61,9 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali · 60 unmodified lines
6161 return NULL;
6262
6363 dmah->size = size;
64− dmah->vaddr = dma_zalloc_coherent(&dev->pdev->dev, size, &dmah->busaddr,
65− GFP_KERNEL | __GFP_COMP);
64+ dmah->vaddr = dma_alloc_coherent(&dev->pdev->dev, size,
65+ &dmah->busaddr,
66+ GFP_KERNEL | __GFP_COMP);
6667
6768 if (dmah->vaddr == NULL) {
6869 kfree(dmah);
drivers/gpu/drm/i915/gvt/handlers.c+1−0
@@ -2799,6 +2799,7 @@ static int init_broadwell_mmio_info(struct intel_gvt *gvt) · 2798 unmodified lines
27992799 MMIO_DFH(_MMIO(0xe2a0), D_BDW_PLUS, F_CMD_ACCESS, NULL, NULL);
28002800 MMIO_DFH(_MMIO(0xe2b0), D_BDW_PLUS, F_CMD_ACCESS, NULL, NULL);
28012801 MMIO_DFH(_MMIO(0xe2c0), D_BDW_PLUS, F_CMD_ACCESS, NULL, NULL);
2802+ MMIO_DFH(_MMIO(0x21f0), D_BDW_PLUS, F_CMD_ACCESS, NULL, NULL);
28022803 return 0;
28032804 }
28042805
drivers/gpu/drm/i915/gvt/hypercall.h+1−1
@@ -41,7 +41,7 @@ struct intel_gvt_mpt { · 40 unmodified lines
4141 int (*host_init)(struct device *dev, void *gvt, const void *ops);
4242 void (*host_exit)(struct device *dev, void *gvt);
4343 int (*attach_vgpu)(void *vgpu, unsigned long *handle);
44− void (*detach_vgpu)(unsigned long handle);
44+ void (*detach_vgpu)(void *vgpu);
4545 int (*inject_msi)(unsigned long handle, u32 addr, u16 data);
4646 unsigned long (*from_virt_to_mfn)(void *p);
4747 int (*enable_page_track)(unsigned long handle, u64 gfn);
drivers/gpu/drm/i915/gvt/kvmgt.c+26−4
@@ -996,7 +996,7 @@ static int intel_vgpu_mmap(struct mdev_device *mdev, struct vm_area_struct *vma) · 995 unmodified lines
996996 {
997997 unsigned int index;
998998 u64 virtaddr;
999− unsigned long req_size, pgoff = 0;
999+ unsigned long req_size, pgoff, req_start;
10001000 pgprot_t pg_prot;
10011001 struct intel_vgpu *vgpu = mdev_get_drvdata(mdev);
10021002
@@ -1014,7 +1014,17 @@ static int intel_vgpu_mmap(struct mdev_device *mdev, struct vm_area_struct *vma) · 11 unmodified lines
10141014 pg_prot = vma->vm_page_prot;
10151015 virtaddr = vma->vm_start;
10161016 req_size = vma->vm_end - vma->vm_start;
1017− pgoff = vgpu_aperture_pa_base(vgpu) >> PAGE_SHIFT;
1017+ pgoff = vma->vm_pgoff &
1018+ ((1U << (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT)) - 1);
1019+ req_start = pgoff << PAGE_SHIFT;
1020+
1021+ if (!intel_vgpu_in_aperture(vgpu, req_start))
1022+ return -EINVAL;
1023+ if (req_start + req_size >
1024+ vgpu_aperture_offset(vgpu) + vgpu_aperture_sz(vgpu))
1025+ return -EINVAL;
1026+
1027+ pgoff = (gvt_aperture_pa_base(vgpu->gvt) >> PAGE_SHIFT) + pgoff;
10181028
10191029 return remap_pfn_range(vma, virtaddr, pgoff, req_size, pg_prot);
10201030 }
@@ -1662,9 +1672,21 @@ static int kvmgt_attach_vgpu(void *vgpu, unsigned long *handle) · 641 unmodified lines
16621672 return 0;
16631673 }
16641674
1665−static void kvmgt_detach_vgpu(unsigned long handle)
1675+static void kvmgt_detach_vgpu(void *p_vgpu)
16661676 {
1667− /* nothing to do here */
1677+ int i;
1678+ struct intel_vgpu *vgpu = (struct intel_vgpu *)p_vgpu;
1679+
1680+ if (!vgpu->vdev.region)
1681+ return;
1682+
1683+ for (i = 0; i < vgpu->vdev.num_regions; i++)
1684+ if (vgpu->vdev.region[i].ops->release)
1685+ vgpu->vdev.region[i].ops->release(vgpu,
1686+ &vgpu->vdev.region[i]);
1687+ vgpu->vdev.num_regions = 0;
1688+ kfree(vgpu->vdev.region);
1689+ vgpu->vdev.region = NULL;
16681690 }
16691691
16701692 static int kvmgt_inject_msi(unsigned long handle, u32 addr, u16 data)
drivers/gpu/drm/i915/gvt/mpt.h+1−1
@@ -101,7 +101,7 @@ static inline void intel_gvt_hypervisor_detach_vgpu(struct intel_vgpu *vgpu) · 100 unmodified lines
101101 if (!intel_gvt_host.mpt->detach_vgpu)
102102 return;
103103
104− intel_gvt_host.mpt->detach_vgpu(vgpu->handle);
104+ intel_gvt_host.mpt->detach_vgpu(vgpu);
105105 }
106106
107107 #define MSI_CAP_CONTROL(offset) (offset + 2)
drivers/gpu/drm/i915/gvt/scheduler.c+48−27
@@ -332,6 +332,9 @@ static void release_shadow_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx) · 331 unmodified lines
332332
333333 i915_gem_object_unpin_map(wa_ctx->indirect_ctx.obj);
334334 i915_gem_object_put(wa_ctx->indirect_ctx.obj);
335+
336+ wa_ctx->indirect_ctx.obj = NULL;
337+ wa_ctx->indirect_ctx.shadow_va = NULL;
335338 }
336339
337340 static int set_context_ppgtt_from_shadow(struct intel_vgpu_workload *workload,
@@ -356,6 +359,33 @@ static int set_context_ppgtt_from_shadow(struct intel_vgpu_workload *workload, · 18 unmodified lines
356359 return 0;
357360 }
358361
362+static int
363+intel_gvt_workload_req_alloc(struct intel_vgpu_workload *workload)
364+{
365+ struct intel_vgpu *vgpu = workload->vgpu;
366+ struct intel_vgpu_submission *s = &vgpu->submission;
367+ struct i915_gem_context *shadow_ctx = s->shadow_ctx;
368+ struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;
369+ struct intel_engine_cs *engine = dev_priv->engine[workload->ring_id];
370+ struct i915_request *rq;
371+ int ret = 0;
372+
373+ lockdep_assert_held(&dev_priv->drm.struct_mutex);
374+
375+ if (workload->req)
376+ goto out;
377+
378+ rq = i915_request_alloc(engine, shadow_ctx);
379+ if (IS_ERR(rq)) {
380+ gvt_vgpu_err("fail to allocate gem request\n");
381+ ret = PTR_ERR(rq);
382+ goto out;
383+ }
384+ workload->req = i915_request_get(rq);
385+out:
386+ return ret;
387+}
388+
359389 /**
360390 * intel_gvt_scan_and_shadow_workload - audit the workload by scanning and
361391 * shadow it as well, include ringbuffer,wa_ctx and ctx.
@@ -372,12 +402,11 @@ int intel_gvt_scan_and_shadow_workload(struct intel_vgpu_workload *workload) · 10 unmodified lines
372402 struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;
373403 struct intel_engine_cs *engine = dev_priv->engine[workload->ring_id];
374404 struct intel_context *ce;
375− struct i915_request *rq;
376405 int ret;
377406
378407 lockdep_assert_held(&dev_priv->drm.struct_mutex);
379408
380− if (workload->req)
409+ if (workload->shadow)
381410 return 0;
382411
383412 ret = set_context_ppgtt_from_shadow(workload, shadow_ctx);
@@ -417,22 +446,8 @@ int intel_gvt_scan_and_shadow_workload(struct intel_vgpu_workload *workload) · 33 unmodified lines
417446 goto err_shadow;
418447 }
419448
420− rq = i915_request_alloc(engine, shadow_ctx);
421− if (IS_ERR(rq)) {
422− gvt_vgpu_err("fail to allocate gem request\n");
423− ret = PTR_ERR(rq);
424− goto err_shadow;
425− }
426− workload->req = i915_request_get(rq);
427−
428− ret = populate_shadow_context(workload);
429− if (ret)
430− goto err_req;
431−
449+ workload->shadow = true;
432450 return 0;
433−err_req:
434− rq = fetch_and_zero(&workload->req);
435− i915_request_put(rq);
436451 err_shadow:
437452 release_shadow_wa_ctx(&workload->wa_ctx);
438453 err_unpin:
@@ -671,23 +686,31 @@ static int dispatch_workload(struct intel_vgpu_workload *workload) · 232 unmodified lines
671686 mutex_lock(&vgpu->vgpu_lock);
672687 mutex_lock(&dev_priv->drm.struct_mutex);
673688
689+ ret = intel_gvt_workload_req_alloc(workload);
690+ if (ret)
691+ goto err_req;
692+
674693 ret = intel_gvt_scan_and_shadow_workload(workload);
675694 if (ret)
676695 goto out;
677696
678− ret = prepare_workload(workload);
697+ ret = populate_shadow_context(workload);
698+ if (ret) {
699+ release_shadow_wa_ctx(&workload->wa_ctx);
700+ goto out;
701+ }
679702
703+ ret = prepare_workload(workload);
680704 out:
681− if (ret)
682− workload->status = ret;
683−
684705 if (!IS_ERR_OR_NULL(workload->req)) {
685706 gvt_dbg_sched("ring id %d submit workload to i915 %p\n",
686707 ring_id, workload->req);
687708 i915_request_add(workload->req);
688709 workload->dispatched = true;
689710 }
690−
711+err_req:
712+ if (ret)
713+ workload->status = ret;
691714 mutex_unlock(&dev_priv->drm.struct_mutex);
692715 mutex_unlock(&vgpu->vgpu_lock);
693716 return ret;
@@ -891,11 +914,6 @@ static void complete_current_workload(struct intel_gvt *gvt, int ring_id) · 197 unmodified lines
891914
892915 list_del_init(&workload->list);
893916
894− if (!workload->status) {
895− release_shadow_batch_buffer(workload);
896− release_shadow_wa_ctx(&workload->wa_ctx);
897− }
898−
899917 if (workload->status || (vgpu->resetting_eng & ENGINE_MASK(ring_id))) {
900918 /* if workload->status is not successful means HW GPU
901919 * has occurred GPU hang or something wrong with i915/GVT,
@@ -1263,6 +1281,9 @@ void intel_vgpu_destroy_workload(struct intel_vgpu_workload *workload) · 361 unmodified lines
12631281 {
12641282 struct intel_vgpu_submission *s = &workload->vgpu->submission;
12651283
1284+ release_shadow_batch_buffer(workload);
1285+ release_shadow_wa_ctx(&workload->wa_ctx);
1286+
12661287 if (workload->shadow_mm)
12671288 intel_vgpu_mm_put(workload->shadow_mm);
12681289
drivers/gpu/drm/i915/gvt/scheduler.h+1−0
@@ -83,6 +83,7 @@ struct intel_vgpu_workload { · 82 unmodified lines
8383 struct i915_request *req;
8484 /* if this workload has been dispatched to i915? */
8585 bool dispatched;
86+ bool shadow; /* if workload has done shadow of guest request */
8687 int status;
8788
8889 struct intel_vgpu_mm *shadow_mm;
drivers/gpu/drm/i915/i915_debugfs.c+9−3
@@ -984,8 +984,8 @@ static int i915_gpu_info_open(struct inode *inode, struct file *file) · 983 unmodified lines
984984 intel_runtime_pm_get(i915);
985985 gpu = i915_capture_gpu_state(i915);
986986 intel_runtime_pm_put(i915);
987− if (!gpu)
988− return -ENOMEM;
987+ if (IS_ERR(gpu))
988+ return PTR_ERR(gpu);
989989
990990 file->private_data = gpu;
991991 return 0;
@@ -1018,7 +1018,13 @@ i915_error_state_write(struct file *filp, · 26 unmodified lines
10181018
10191019 static int i915_error_state_open(struct inode *inode, struct file *file)
10201020 {
1021− file->private_data = i915_first_error_state(inode->i_private);
1021+ struct i915_gpu_state *error;
1022+
1023+ error = i915_first_error_state(inode->i_private);
1024+ if (IS_ERR(error))
1025+ return PTR_ERR(error);
1026+
1027+ file->private_data = error;
10221028 return 0;
10231029 }
10241030
drivers/gpu/drm/i915/i915_gem_gtt.c+12−3
@@ -2075,6 +2075,7 @@ static struct i915_vma *pd_vma_create(struct gen6_hw_ppgtt *ppgtt, int size) · 2074 unmodified lines
20752075 int gen6_ppgtt_pin(struct i915_hw_ppgtt *base)
20762076 {
20772077 struct gen6_hw_ppgtt *ppgtt = to_gen6_ppgtt(base);
2078+ int err;
20782079
20792080 /*
20802081 * Workaround the limited maximum vma->pin_count and the aliasing_ppgtt
@@ -2090,9 +2091,17 @@ int gen6_ppgtt_pin(struct i915_hw_ppgtt *base) · 9 unmodified lines
20902091 * allocator works in address space sizes, so it's multiplied by page
20912092 * size. We allocate at the top of the GTT to avoid fragmentation.
20922093 */
2093− return i915_vma_pin(ppgtt->vma,
2094− 0, GEN6_PD_ALIGN,
2095− PIN_GLOBAL | PIN_HIGH);
2094+ err = i915_vma_pin(ppgtt->vma,
2095+ 0, GEN6_PD_ALIGN,
2096+ PIN_GLOBAL | PIN_HIGH);
2097+ if (err)
2098+ goto unpin;
2099+
2100+ return 0;
2101+
2102+unpin:
2103+ ppgtt->pin_count = 0;
2104+ return err;
20962105 }
20972106
20982107 void gen6_ppgtt_unpin(struct i915_hw_ppgtt *base)
drivers/gpu/drm/i915/i915_gpu_error.c+14−9
@@ -1907,9 +1907,16 @@ i915_capture_gpu_state(struct drm_i915_private *i915) · 1906 unmodified lines
19071907 {
19081908 struct i915_gpu_state *error;
19091909
1910+ /* Check if GPU capture has been disabled */
1911+ error = READ_ONCE(i915->gpu_error.first_error);
1912+ if (IS_ERR(error))
1913+ return error;
1914+
19101915 error = kzalloc(sizeof(*error), GFP_ATOMIC);
1911− if (!error)
1912− return NULL;
1916+ if (!error) {
1917+ i915_disable_error_state(i915, -ENOMEM);
1918+ return ERR_PTR(-ENOMEM);
1919+ }
19131920
19141921 kref_init(&error->ref);
19151922 error->i915 = i915;
@@ -1945,11 +1952,8 @@ void i915_capture_error_state(struct drm_i915_private *i915, · 29 unmodified lines
19451952 return;
19461953
19471954 error = i915_capture_gpu_state(i915);
1948− if (!error) {
1949− DRM_DEBUG_DRIVER("out of memory, not capturing error state\n");
1950− i915_disable_error_state(i915, -ENOMEM);
1955+ if (IS_ERR(error))
19511956 return;
1952− }
19531957
19541958 i915_error_capture_msg(i915, error, engine_mask, error_msg);
19551959 DRM_INFO("%s\n", error->error_msg);
@@ -1987,7 +1991,7 @@ i915_first_error_state(struct drm_i915_private *i915) · 31 unmodified lines
19871991
19881992 spin_lock_irq(&i915->gpu_error.lock);
19891993 error = i915->gpu_error.first_error;
1990− if (error)
1994+ if (!IS_ERR_OR_NULL(error))
19911995 i915_gpu_state_get(error);
19921996 spin_unlock_irq(&i915->gpu_error.lock);
19931997
@@ -2000,10 +2004,11 @@ void i915_reset_error_state(struct drm_i915_private *i915) · 6 unmodified lines
20002004
20012005 spin_lock_irq(&i915->gpu_error.lock);
20022006 error = i915->gpu_error.first_error;
2003− i915->gpu_error.first_error = NULL;
2007+ if (error != ERR_PTR(-ENODEV)) /* if disabled, always disabled */
2008+ i915->gpu_error.first_error = NULL;
20042009 spin_unlock_irq(&i915->gpu_error.lock);
20052010
2006− if (!IS_ERR(error))
2011+ if (!IS_ERR_OR_NULL(error))
20072012 i915_gpu_state_put(error);
20082013 }
20092014
drivers/gpu/drm/i915/i915_sysfs.c+3−1
@@ -521,7 +521,9 @@ static ssize_t error_state_read(struct file *filp, struct kobject *kobj, · 520 unmodified lines
521521 ssize_t ret;
522522
523523 gpu = i915_first_error_state(i915);
524− if (gpu) {
524+ if (IS_ERR(gpu)) {
525+ ret = PTR_ERR(gpu);
526+ } else if (gpu) {
525527 ret = i915_gpu_state_copy_to_buffer(gpu, buf, off, count);
526528 i915_gpu_state_put(gpu);
527529 } else {
drivers/gpu/drm/i915/intel_ddi.c+1−1
@@ -1086,7 +1086,7 @@ static uint32_t icl_pll_to_ddi_pll_sel(struct intel_encoder *encoder, · 1085 unmodified lines
10861086 return DDI_CLK_SEL_TBT_810;
10871087 default:
10881088 MISSING_CASE(clock);
1089− break;
1089+ return DDI_CLK_SEL_NONE;
10901090 }
10911091 case DPLL_ID_ICL_MGPLL1:
10921092 case DPLL_ID_ICL_MGPLL2:
drivers/gpu/drm/i915/intel_display.c+44−6
@@ -15415,16 +15415,45 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc, · 15414 unmodified lines
1541515415 }
1541615416 }
1541715417
15418+static bool has_bogus_dpll_config(const struct intel_crtc_state *crtc_state)
15419+{
15420+ struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev);
15421+
15422+ /*
15423+ * Some SNB BIOSen (eg. ASUS K53SV) are known to misprogram
15424+ * the hardware when a high res displays plugged in. DPLL P
15425+ * divider is zero, and the pipe timings are bonkers. We'll
15426+ * try to disable everything in that case.
15427+ *
15428+ * FIXME would be nice to be able to sanitize this state
15429+ * without several WARNs, but for now let's take the easy
15430+ * road.
15431+ */
15432+ return IS_GEN6(dev_priv) &&
15433+ crtc_state->base.active &&
15434+ crtc_state->shared_dpll &&
15435+ crtc_state->port_clock == 0;
15436+}
15437+
1541815438 static void intel_sanitize_encoder(struct intel_encoder *encoder)
1541915439 {
1542015440 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
1542115441 struct intel_connector *connector;
15442+ struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
15443+ struct intel_crtc_state *crtc_state = crtc ?
15444+ to_intel_crtc_state(crtc->base.state) : NULL;
1542215445
1542315446 /* We need to check both for a crtc link (meaning that the
1542415447 * encoder is active and trying to read from a pipe) and the
1542515448 * pipe itself being active. */
15426− bool has_active_crtc = encoder->base.crtc &&
15427− to_intel_crtc(encoder->base.crtc)->active;
15449+ bool has_active_crtc = crtc_state &&
15450+ crtc_state->base.active;
15451+
15452+ if (crtc_state && has_bogus_dpll_config(crtc_state)) {
15453+ DRM_DEBUG_KMS("BIOS has misprogrammed the hardware. Disabling pipe %c\n",
15454+ pipe_name(crtc->pipe));
15455+ has_active_crtc = false;
15456+ }
1542815457
1542915458 connector = intel_encoder_find_connector(encoder);
1543015459 if (connector && !has_active_crtc) {
@@ -15435,16 +15464,25 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder) · 4 unmodified lines
1543515464 /* Connector is active, but has no active pipe. This is
1543615465 * fallout from our resume register restoring. Disable
1543715466 * the encoder manually again. */
15438− if (encoder->base.crtc) {
15439− struct drm_crtc_state *crtc_state = encoder->base.crtc->state;
15467+ if (crtc_state) {
15468+ struct drm_encoder *best_encoder;
1544015469
1544115470 DRM_DEBUG_KMS("[ENCODER:%d:%s] manually disabled\n",
1544215471 encoder->base.base.id,
1544315472 encoder->base.name);
15473+
15474+ /* avoid oopsing in case the hooks consult best_encoder */
15475+ best_encoder = connector->base.state->best_encoder;
15476+ connector->base.state->best_encoder = &encoder->base;
15477+
1544415478 if (encoder->disable)
15445− encoder->disable(encoder, to_intel_crtc_state(crtc_state), connector->base.state);
15479+ encoder->disable(encoder, crtc_state,
15480+ connector->base.state);
1544615481 if (encoder->post_disable)
15447− encoder->post_disable(encoder, to_intel_crtc_state(crtc_state), connector->base.state);
15482+ encoder->post_disable(encoder, crtc_state,
15483+ connector->base.state);
15484+
15485+ connector->base.state->best_encoder = best_encoder;
1544815486 }
1544915487 encoder->base.crtc = NULL;
1545015488
drivers/gpu/drm/i915/intel_lrc.c+6−1
@@ -303,6 +303,7 @@ static void __unwind_incomplete_requests(struct intel_engine_cs *engine) · 302 unmodified lines
303303 */
304304 if (!(prio & I915_PRIORITY_NEWCLIENT)) {
305305 prio |= I915_PRIORITY_NEWCLIENT;
306+ active->sched.attr.priority = prio;
306307 list_move_tail(&active->sched.link,
307308 i915_sched_lookup_priolist(engine, prio));
308309 }
@@ -645,6 +646,9 @@ static void execlists_dequeue(struct intel_engine_cs *engine) · 336 unmodified lines
645646 int i;
646647
647648 priolist_for_each_request_consume(rq, rn, p, i) {
649+ GEM_BUG_ON(last &&
650+ need_preempt(engine, last, rq_prio(rq)));
651+
648652 /*
649653 * Can we combine this request with the current port?
650654 * It has to be the same context/ringbuffer and not
@@ -2244,6 +2248,8 @@ static int logical_ring_init(struct intel_engine_cs *engine) · 1593 unmodified lines
22442248 if (ret)
22452249 return ret;
22462250
2251+ intel_engine_init_workarounds(engine);
2252+
22472253 if (HAS_LOGICAL_RING_ELSQ(i915)) {
22482254 execlists->submit_reg = i915->regs +
22492255 i915_mmio_reg_offset(RING_EXECLIST_SQ_CONTENTS(engine));
@@ -2310,7 +2316,6 @@ int logical_render_ring_init(struct intel_engine_cs *engine) · 60 unmodified lines
23102316 }
23112317
23122318 intel_engine_init_whitelist(engine);
2313− intel_engine_init_workarounds(engine);
23142319
23152320 return 0;
23162321 }
drivers/gpu/drm/i915/intel_psr.c+6−0
@@ -274,10 +274,16 @@ void intel_psr_init_dpcd(struct intel_dp *intel_dp) · 273 unmodified lines
274274 DRM_DEBUG_KMS("eDP panel supports PSR version %x\n",
275275 intel_dp->psr_dpcd[0]);
276276
277+ if (drm_dp_has_quirk(&intel_dp->desc, DP_DPCD_QUIRK_NO_PSR)) {
278+ DRM_DEBUG_KMS("PSR support not currently available for this panel\n");
279+ return;
280+ }
281+
277282 if (!(intel_dp->edp_dpcd[1] & DP_EDP_SET_POWER_CAP)) {
278283 DRM_DEBUG_KMS("Panel lacks power state control, PSR cannot be enabled\n");
279284 return;
280285 }
286+
281287 dev_priv->psr.sink_support = true;
282288 dev_priv->psr.sink_sync_latency =
283289 intel_dp_get_sink_sync_latency(intel_dp);
drivers/gpu/drm/i915/intel_sprite.c+1−1
@@ -494,7 +494,7 @@ skl_program_plane(struct intel_plane *plane, · 493 unmodified lines
494494
495495 keymax = (key->max_value & 0xffffff) | PLANE_KEYMAX_ALPHA(alpha);
496496
497− keymsk = key->channel_mask & 0x3ffffff;
497+ keymsk = key->channel_mask & 0x7ffffff;
498498 if (alpha < 0xff)
499499 keymsk |= PLANE_KEYMSK_ALPHA_ENABLE;
500500
drivers/gpu/drm/meson/meson_crtc.c+2−21
@@ -46,7 +46,6 @@ struct meson_crtc { · 45 unmodified lines
4646 struct drm_crtc base;
4747 struct drm_pending_vblank_event *event;
4848 struct meson_drm *priv;
49− bool enabled;
5049 };
5150 #define to_meson_crtc(x) container_of(x, struct meson_crtc, base)
5251
@@ -82,7 +81,8 @@ static const struct drm_crtc_funcs meson_crtc_funcs = { · 29 unmodified lines
8281
8382 };
8483
85−static void meson_crtc_enable(struct drm_crtc *crtc)
84+static void meson_crtc_atomic_enable(struct drm_crtc *crtc,
85+ struct drm_crtc_state *old_state)
8686 {
8787 struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
8888 struct drm_crtc_state *crtc_state = crtc->state;
@@ -108,20 +108,6 @@ static void meson_crtc_enable(struct drm_crtc *crtc) · 19 unmodified lines
108108
109109 drm_crtc_vblank_on(crtc);
110110
111− meson_crtc->enabled = true;
112−}
113−
114−static void meson_crtc_atomic_enable(struct drm_crtc *crtc,
115− struct drm_crtc_state *old_state)
116−{
117− struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
118− struct meson_drm *priv = meson_crtc->priv;
119−
120− DRM_DEBUG_DRIVER("\n");
121−
122− if (!meson_crtc->enabled)
123− meson_crtc_enable(crtc);
124−
125111 priv->viu.osd1_enabled = true;
126112 }
127113
@@ -153,8 +139,6 @@ static void meson_crtc_atomic_disable(struct drm_crtc *crtc, · 25 unmodified lines
153139
154140 crtc->state->event = NULL;
155141 }
156−
157− meson_crtc->enabled = false;
158142 }
159143
160144 static void meson_crtc_atomic_begin(struct drm_crtc *crtc,
@@ -163,9 +147,6 @@ static void meson_crtc_atomic_begin(struct drm_crtc *crtc, · 2 unmodified lines
163147 struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
164148 unsigned long flags;
165149
166− if (crtc->state->enable && !meson_crtc->enabled)
167− meson_crtc_enable(crtc);
168−
169150 if (crtc->state->event) {
170151 WARN_ON(drm_crtc_vblank_get(crtc) != 0);
171152
drivers/gpu/drm/meson/meson_drv.c+12−2
@@ -75,6 +75,10 @@ static const struct drm_mode_config_funcs meson_mode_config_funcs = { · 74 unmodified lines
7575 .fb_create = drm_gem_fb_create,
7676 };
7777
78+static const struct drm_mode_config_helper_funcs meson_mode_config_helpers = {
79+ .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
80+};
81+
7882 static irqreturn_t meson_irq(int irq, void *arg)
7983 {
8084 struct drm_device *dev = arg;
@@ -266,6 +270,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) · 185 unmodified lines
266270 drm->mode_config.max_width = 3840;
267271 drm->mode_config.max_height = 2160;
268272 drm->mode_config.funcs = &meson_mode_config_funcs;
273+ drm->mode_config.helper_private = &meson_mode_config_helpers;
269274
270275 /* Hardware Initialization */
271276
@@ -388,8 +393,10 @@ static int meson_probe_remote(struct platform_device *pdev, · 116 unmodified lines
388393 remote_node = of_graph_get_remote_port_parent(ep);
389394 if (!remote_node ||
390395 remote_node == parent || /* Ignore parent endpoint */
391− !of_device_is_available(remote_node))
396+ !of_device_is_available(remote_node)) {
397+ of_node_put(remote_node);
392398 continue;
399+ }
393400
394401 count += meson_probe_remote(pdev, match, remote, remote_node);
395402
@@ -408,10 +415,13 @@ static int meson_drv_probe(struct platform_device *pdev) · 12 unmodified lines
408415
409416 for_each_endpoint_of_node(np, ep) {
410417 remote = of_graph_get_remote_port_parent(ep);
411− if (!remote || !of_device_is_available(remote))
418+ if (!remote || !of_device_is_available(remote)) {
419+ of_node_put(remote);
412420 continue;
421+ }
413422
414423 count += meson_probe_remote(pdev, &match, np, remote);
424+ of_node_put(remote);
415425 }
416426
417427 if (count && !match)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c+1−1
@@ -944,7 +944,7 @@ static u32 a6xx_gmu_get_arc_level(struct device *dev, unsigned long freq) · 943 unmodified lines
944944 np = dev_pm_opp_get_of_node(opp);
945945
946946 if (np) {
947− of_property_read_u32(np, "qcom,level", &val);
947+ of_property_read_u32(np, "opp-level", &val);
948948 of_node_put(np);
949949 }
950950
drivers/gpu/drm/msm/adreno/adreno_gpu.c+0−1
@@ -765,7 +765,6 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev, · 764 unmodified lines
765765 adreno_gpu->rev = config->rev;
766766
767767 adreno_gpu_config.ioname = "kgsl_3d0_reg_memory";
768− adreno_gpu_config.irqname = "kgsl_3d0_irq";
769768
770769 adreno_gpu_config.va_start = SZ_16M;
771770 adreno_gpu_config.va_end = 0xffffffff;
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c+13−13
@@ -365,19 +365,6 @@ static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane, · 364 unmodified lines
365365 &pdpu->pipe_qos_cfg);
366366 }
367367
368−static void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable)
369−{
370− struct dpu_plane *pdpu = to_dpu_plane(plane);
371− struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
372−
373− if (!pdpu->is_rt_pipe)
374− return;
375−
376− pm_runtime_get_sync(&dpu_kms->pdev->dev);
377− _dpu_plane_set_qos_ctrl(plane, enable, DPU_PLANE_QOS_PANIC_CTRL);
378− pm_runtime_put_sync(&dpu_kms->pdev->dev);
379−}
380−
381368 /**
382369 * _dpu_plane_set_ot_limit - set OT limit for the given plane
383370 * @plane: Pointer to drm plane
@@ -1248,6 +1235,19 @@ static void dpu_plane_reset(struct drm_plane *plane) · 864 unmodified lines
12481235 }
12491236
12501237 #ifdef CONFIG_DEBUG_FS
1238+static void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable)
1239+{
1240+ struct dpu_plane *pdpu = to_dpu_plane(plane);
1241+ struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
1242+
1243+ if (!pdpu->is_rt_pipe)
1244+ return;
1245+
1246+ pm_runtime_get_sync(&dpu_kms->pdev->dev);
1247+ _dpu_plane_set_qos_ctrl(plane, enable, DPU_PLANE_QOS_PANIC_CTRL);
1248+ pm_runtime_put_sync(&dpu_kms->pdev->dev);
1249+}
1250+
12511251 static ssize_t _dpu_plane_danger_read(struct file *file,
12521252 char __user *buff, size_t count, loff_t *ppos)
12531253 {
drivers/gpu/drm/msm/msm_drv.h+5−1
@@ -250,7 +250,8 @@ void msm_gem_purge_vma(struct msm_gem_address_space *aspace, · 249 unmodified lines
250250 void msm_gem_unmap_vma(struct msm_gem_address_space *aspace,
251251 struct msm_gem_vma *vma);
252252 int msm_gem_map_vma(struct msm_gem_address_space *aspace,
253− struct msm_gem_vma *vma, struct sg_table *sgt, int npages);
253+ struct msm_gem_vma *vma, int prot,
254+ struct sg_table *sgt, int npages);
254255 void msm_gem_close_vma(struct msm_gem_address_space *aspace,
255256 struct msm_gem_vma *vma);
256257
@@ -333,6 +334,7 @@ void msm_gem_kernel_put(struct drm_gem_object *bo, · 76 unmodified lines
333334 struct drm_gem_object *msm_gem_import(struct drm_device *dev,
334335 struct dma_buf *dmabuf, struct sg_table *sgt);
335336
337+__printf(2, 3)
336338 void msm_gem_object_set_name(struct drm_gem_object *bo, const char *fmt, ...);
337339
338340 int msm_framebuffer_prepare(struct drm_framebuffer *fb,
@@ -396,12 +398,14 @@ void msm_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m); · 57 unmodified lines
396398 int msm_debugfs_late_init(struct drm_device *dev);
397399 int msm_rd_debugfs_init(struct drm_minor *minor);
398400 void msm_rd_debugfs_cleanup(struct msm_drm_private *priv);
401+__printf(3, 4)
399402 void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_submit *submit,
400403 const char *fmt, ...);
401404 int msm_perf_debugfs_init(struct drm_minor *minor);
402405 void msm_perf_debugfs_cleanup(struct msm_drm_private *priv);
403406 #else
404407 static inline int msm_debugfs_late_init(struct drm_device *dev) { return 0; }
408+__printf(3, 4)
405409 static inline void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_submit *submit,
406410 const char *fmt, ...) {}
407411 static inline void msm_rd_debugfs_cleanup(struct msm_drm_private *priv) {}
drivers/gpu/drm/msm/msm_gem.c+6−2
@@ -391,6 +391,10 @@ static int msm_gem_pin_iova(struct drm_gem_object *obj, · 390 unmodified lines
391391 struct msm_gem_object *msm_obj = to_msm_bo(obj);
392392 struct msm_gem_vma *vma;
393393 struct page **pages;
394+ int prot = IOMMU_READ;
395+
396+ if (!(msm_obj->flags & MSM_BO_GPU_READONLY))
397+ prot |= IOMMU_WRITE;
394398
395399 WARN_ON(!mutex_is_locked(&msm_obj->lock));
396400
@@ -405,8 +409,8 @@ static int msm_gem_pin_iova(struct drm_gem_object *obj, · 8 unmodified lines
405409 if (IS_ERR(pages))
406410 return PTR_ERR(pages);
407411
408− return msm_gem_map_vma(aspace, vma, msm_obj->sgt,
409− obj->size >> PAGE_SHIFT);
412+ return msm_gem_map_vma(aspace, vma, prot,
413+ msm_obj->sgt, obj->size >> PAGE_SHIFT);
410414 }
411415
412416 /* get iova and pin it. Should have a matching put */
drivers/gpu/drm/msm/msm_gem_vma.c+3−2
@@ -68,7 +68,8 @@ void msm_gem_unmap_vma(struct msm_gem_address_space *aspace, · 67 unmodified lines
6868
6969 int
7070 msm_gem_map_vma(struct msm_gem_address_space *aspace,
71− struct msm_gem_vma *vma, struct sg_table *sgt, int npages)
71+ struct msm_gem_vma *vma, int prot,
72+ struct sg_table *sgt, int npages)
7273 {
7374 unsigned size = npages << PAGE_SHIFT;
7475 int ret = 0;
@@ -86,7 +87,7 @@ msm_gem_map_vma(struct msm_gem_address_space *aspace, · 11 unmodified lines
8687
8788 if (aspace->mmu)
8889 ret = aspace->mmu->funcs->map(aspace->mmu, vma->iova, sgt,
89− size, IOMMU_READ | IOMMU_WRITE);
90+ size, prot);
9091
9192 if (ret)
9293 vma->mapped = false;
drivers/gpu/drm/msm/msm_gpu.c+1−1
@@ -900,7 +900,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev, · 899 unmodified lines
900900 }
901901
902902 /* Get Interrupt: */
903− gpu->irq = platform_get_irq_byname(pdev, config->irqname);
903+ gpu->irq = platform_get_irq(pdev, 0);
904904 if (gpu->irq < 0) {
905905 ret = gpu->irq;
906906 DRM_DEV_ERROR(drm->dev, "failed to get irq: %d\n", ret);
drivers/gpu/drm/msm/msm_gpu.h+1−2
@@ -31,7 +31,6 @@ struct msm_gpu_state; · 30 unmodified lines
3131
3232 struct msm_gpu_config {
3333 const char *ioname;
34− const char *irqname;
3534 uint64_t va_start;
3635 uint64_t va_end;
3736 unsigned int nr_rings;
@@ -63,7 +62,7 @@ struct msm_gpu_funcs { · 25 unmodified lines
6362 struct msm_ringbuffer *(*active_ring)(struct msm_gpu *gpu);
6463 void (*recover)(struct msm_gpu *gpu);
6564 void (*destroy)(struct msm_gpu *gpu);
66−#ifdef CONFIG_DEBUG_FS
65+#if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
6766 /* show GPU status in debugfs: */
6867 void (*show)(struct msm_gpu *gpu, struct msm_gpu_state *state,
6968 struct drm_printer *p);
drivers/gpu/drm/msm/msm_rd.c+6−1
@@ -115,7 +115,9 @@ static void rd_write(struct msm_rd_state *rd, const void *buf, int sz) · 114 unmodified lines
115115 char *fptr = &fifo->buf[fifo->head];
116116 int n;
117117
118− wait_event(rd->fifo_event, circ_space(&rd->fifo) > 0);
118+ wait_event(rd->fifo_event, circ_space(&rd->fifo) > 0 || !rd->open);
119+ if (!rd->open)
120+ return;
119121
120122 /* Note that smp_load_acquire() is not strictly required
121123 * as CIRC_SPACE_TO_END() does not access the tail more
@@ -213,7 +215,10 @@ out: · 91 unmodified lines
213215 static int rd_release(struct inode *inode, struct file *file)
214216 {
215217 struct msm_rd_state *rd = inode->i_private;
218+
216219 rd->open = false;
220+ wake_up_all(&rd->fifo_event);
221+
217222 return 0;
218223 }
219224
drivers/gpu/drm/nouveau/nouveau_backlight.c+3−0
@@ -253,6 +253,9 @@ nouveau_backlight_init(struct drm_connector *connector) · 252 unmodified lines
253253 case NV_DEVICE_INFO_V0_FERMI:
254254 case NV_DEVICE_INFO_V0_KEPLER:
255255 case NV_DEVICE_INFO_V0_MAXWELL:
256+ case NV_DEVICE_INFO_V0_PASCAL:
257+ case NV_DEVICE_INFO_V0_VOLTA:
258+ case NV_DEVICE_INFO_V0_TURING:
256259 ret = nv50_backlight_init(nv_encoder, &props, &ops);
257260 break;
258261 default:
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c+33−0
@@ -2434,6 +2434,38 @@ nv140_chipset = { · 2433 unmodified lines
24342434 .sec2 = gp102_sec2_new,
24352435 };
24362436
2437+static const struct nvkm_device_chip
2438+nv162_chipset = {
2439+ .name = "TU102",
2440+ .bar = tu104_bar_new,
2441+ .bios = nvkm_bios_new,
2442+ .bus = gf100_bus_new,
2443+ .devinit = tu104_devinit_new,
2444+ .fault = tu104_fault_new,
2445+ .fb = gv100_fb_new,
2446+ .fuse = gm107_fuse_new,
2447+ .gpio = gk104_gpio_new,
2448+ .i2c = gm200_i2c_new,
2449+ .ibus = gm200_ibus_new,
2450+ .imem = nv50_instmem_new,
2451+ .ltc = gp102_ltc_new,
2452+ .mc = tu104_mc_new,
2453+ .mmu = tu104_mmu_new,
2454+ .pci = gp100_pci_new,
2455+ .pmu = gp102_pmu_new,
2456+ .therm = gp100_therm_new,
2457+ .timer = gk20a_timer_new,
2458+ .top = gk104_top_new,
2459+ .ce[0] = tu104_ce_new,
2460+ .ce[1] = tu104_ce_new,
2461+ .ce[2] = tu104_ce_new,
2462+ .ce[3] = tu104_ce_new,
2463+ .ce[4] = tu104_ce_new,
2464+ .disp = tu104_disp_new,
2465+ .dma = gv100_dma_new,
2466+ .fifo = tu104_fifo_new,
2467+};
2468+
24372469 static const struct nvkm_device_chip
24382470 nv164_chipset = {
24392471 .name = "TU104",
@@ -2950,6 +2982,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func, · 510 unmodified lines
29502982 case 0x138: device->chip = &nv138_chipset; break;
29512983 case 0x13b: device->chip = &nv13b_chipset; break;
29522984 case 0x140: device->chip = &nv140_chipset; break;
2985+ case 0x162: device->chip = &nv162_chipset; break;
29532986 case 0x164: device->chip = &nv164_chipset; break;
29542987 case 0x166: device->chip = &nv166_chipset; break;
29552988 default:
drivers/gpu/drm/nouveau/nvkm/engine/falcon.c+5−2
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <engine/falcon.h>
2323
2424 #include <core/gpuobj.h>
25+#include <subdev/mc.h>
2526 #include <subdev/timer.h>
2627 #include <engine/fifo.h>
2728
@@ -107,8 +108,10 @@ nvkm_falcon_fini(struct nvkm_engine *engine, bool suspend) · 79 unmodified lines
107108 }
108109 }
109110
110− nvkm_mask(device, base + 0x048, 0x00000003, 0x00000000);
111− nvkm_wr32(device, base + 0x014, 0xffffffff);
111+ if (nvkm_mc_enabled(device, engine->subdev.index)) {
112+ nvkm_mask(device, base + 0x048, 0x00000003, 0x00000000);
113+ nvkm_wr32(device, base + 0x014, 0xffffffff);
114+ }
112115 return 0;
113116 }
114117
drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c+4−3
@@ -132,11 +132,12 @@ nvkm_therm_update(struct nvkm_therm *therm, int mode) · 131 unmodified lines
132132 duty = nvkm_therm_update_linear(therm);
133133 break;
134134 case NVBIOS_THERM_FAN_OTHER:
135− if (therm->cstate)
135+ if (therm->cstate) {
136136 duty = therm->cstate;
137− else
137+ poll = false;
138+ } else {
138139 duty = nvkm_therm_update_linear_fallback(therm);
139− poll = false;
140+ }
140141 break;
141142 }
142143 immd = false;
drivers/gpu/drm/omapdrm/dss/dsi.c+19−8
@@ -1406,7 +1406,7 @@ static void dsi_pll_disable(struct dss_pll *pll) · 1405 unmodified lines
14061406
14071407 static int dsi_dump_dsi_clocks(struct seq_file *s, void *p)
14081408 {
1409− struct dsi_data *dsi = p;
1409+ struct dsi_data *dsi = s->private;
14101410 struct dss_pll_clock_info *cinfo = &dsi->pll.cinfo;
14111411 enum dss_clk_source dispc_clk_src, dsi_clk_src;
14121412 int dsi_module = dsi->module_id;
@@ -1467,7 +1467,7 @@ static int dsi_dump_dsi_clocks(struct seq_file *s, void *p) · 54 unmodified lines
14671467 #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
14681468 static int dsi_dump_dsi_irqs(struct seq_file *s, void *p)
14691469 {
1470− struct dsi_data *dsi = p;
1470+ struct dsi_data *dsi = s->private;
14711471 unsigned long flags;
14721472 struct dsi_irq_stats stats;
14731473
@@ -1558,7 +1558,7 @@ static int dsi_dump_dsi_irqs(struct seq_file *s, void *p) · 84 unmodified lines
15581558
15591559 static int dsi_dump_dsi_regs(struct seq_file *s, void *p)
15601560 {
1561− struct dsi_data *dsi = p;
1561+ struct dsi_data *dsi = s->private;
15621562
15631563 if (dsi_runtime_get(dsi))
15641564 return 0;
@@ -4751,6 +4751,17 @@ static int dsi_set_config(struct omap_dss_device *dssdev, · 3186 unmodified lines
47514751 dsi->vm.flags |= DISPLAY_FLAGS_HSYNC_HIGH;
47524752 dsi->vm.flags &= ~DISPLAY_FLAGS_VSYNC_LOW;
47534753 dsi->vm.flags |= DISPLAY_FLAGS_VSYNC_HIGH;
4754+ /*
4755+ * HACK: These flags should be handled through the omap_dss_device bus
4756+ * flags, but this will only be possible when the DSI encoder will be
4757+ * converted to the omapdrm-managed encoder model.
4758+ */
4759+ dsi->vm.flags &= ~DISPLAY_FLAGS_PIXDATA_NEGEDGE;
4760+ dsi->vm.flags |= DISPLAY_FLAGS_PIXDATA_POSEDGE;
4761+ dsi->vm.flags &= ~DISPLAY_FLAGS_DE_LOW;
4762+ dsi->vm.flags |= DISPLAY_FLAGS_DE_HIGH;
4763+ dsi->vm.flags &= ~DISPLAY_FLAGS_SYNC_POSEDGE;
4764+ dsi->vm.flags |= DISPLAY_FLAGS_SYNC_NEGEDGE;
47544765
47554766 dss_mgr_set_timings(&dsi->output, &dsi->vm);
47564767
@@ -5083,15 +5094,15 @@ static int dsi_bind(struct device *dev, struct device *master, void *data) · 326 unmodified lines
50835094
50845095 snprintf(name, sizeof(name), "dsi%u_regs", dsi->module_id + 1);
50855096 dsi->debugfs.regs = dss_debugfs_create_file(dss, name,
5086− dsi_dump_dsi_regs, &dsi);
5097+ dsi_dump_dsi_regs, dsi);
50875098 #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
50885099 snprintf(name, sizeof(name), "dsi%u_irqs", dsi->module_id + 1);
50895100 dsi->debugfs.irqs = dss_debugfs_create_file(dss, name,
5090− dsi_dump_dsi_irqs, &dsi);
5101+ dsi_dump_dsi_irqs, dsi);
50915102 #endif
50925103 snprintf(name, sizeof(name), "dsi%u_clks", dsi->module_id + 1);
50935104 dsi->debugfs.clks = dss_debugfs_create_file(dss, name,
5094− dsi_dump_dsi_clocks, &dsi);
5105+ dsi_dump_dsi_clocks, dsi);
50955106
50965107 return 0;
50975108 }
@@ -5104,8 +5115,6 @@ static void dsi_unbind(struct device *dev, struct device *master, void *data) · 6 unmodified lines
51045115 dss_debugfs_remove_file(dsi->debugfs.irqs);
51055116 dss_debugfs_remove_file(dsi->debugfs.regs);
51065117
5107− of_platform_depopulate(dev);
5108−
51095118 WARN_ON(dsi->scp_clk_refcount > 0);
51105119
51115120 dss_pll_unregister(&dsi->pll);
@@ -5457,6 +5466,8 @@ static int dsi_remove(struct platform_device *pdev) · 345 unmodified lines
54575466
54585467 dsi_uninit_output(dsi);
54595468
5469+ of_platform_depopulate(&pdev->dev);
5470+
54605471 pm_runtime_disable(&pdev->dev);
54615472
54625473 if (dsi->vdds_dsi_reg != NULL && dsi->vdds_dsi_enabled) {
drivers/gpu/drm/qxl/qxl_drv.c+0−4
@@ -250,14 +250,10 @@ static struct drm_driver qxl_driver = { · 249 unmodified lines
250250 #if defined(CONFIG_DEBUG_FS)
251251 .debugfs_init = qxl_debugfs_init,
252252 #endif
253− .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
254− .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
255253 .gem_prime_export = drm_gem_prime_export,
256254 .gem_prime_import = drm_gem_prime_import,
257255 .gem_prime_pin = qxl_gem_prime_pin,
258256 .gem_prime_unpin = qxl_gem_prime_unpin,
259− .gem_prime_get_sg_table = qxl_gem_prime_get_sg_table,
260− .gem_prime_import_sg_table = qxl_gem_prime_import_sg_table,
261257 .gem_prime_vmap = qxl_gem_prime_vmap,
262258 .gem_prime_vunmap = qxl_gem_prime_vunmap,
263259 .gem_prime_mmap = qxl_gem_prime_mmap,
drivers/gpu/drm/qxl/qxl_prime.c+0−14
@@ -38,20 +38,6 @@ void qxl_gem_prime_unpin(struct drm_gem_object *obj) · 37 unmodified lines
3838 WARN_ONCE(1, "not implemented");
3939 }
4040
41−struct sg_table *qxl_gem_prime_get_sg_table(struct drm_gem_object *obj)
42−{
43− WARN_ONCE(1, "not implemented");
44− return ERR_PTR(-ENOSYS);
45−}
46−
47−struct drm_gem_object *qxl_gem_prime_import_sg_table(
48− struct drm_device *dev, struct dma_buf_attachment *attach,
49− struct sg_table *table)
50−{
51− WARN_ONCE(1, "not implemented");
52− return ERR_PTR(-ENOSYS);
53−}
54−
5541 void *qxl_gem_prime_vmap(struct drm_gem_object *obj)
5642 {
5743 WARN_ONCE(1, "not implemented");
drivers/gpu/drm/radeon/ci_dpm.c+3−2
@@ -5676,7 +5676,7 @@ int ci_dpm_init(struct radeon_device *rdev) · 5675 unmodified lines
56765676 u16 data_offset, size;
56775677 u8 frev, crev;
56785678 struct ci_power_info *pi;
5679− enum pci_bus_speed speed_cap;
5679+ enum pci_bus_speed speed_cap = PCI_SPEED_UNKNOWN;
56805680 struct pci_dev *root = rdev->pdev->bus->self;
56815681 int ret;
56825682
@@ -5685,7 +5685,8 @@ int ci_dpm_init(struct radeon_device *rdev) · 2 unmodified lines
56855685 return -ENOMEM;
56865686 rdev->pm.dpm.priv = pi;
56875687
5688− speed_cap = pcie_get_speed_cap(root);
5688+ if (!pci_is_root_bus(rdev->pdev->bus))
5689+ speed_cap = pcie_get_speed_cap(root);
56895690 if (speed_cap == PCI_SPEED_UNKNOWN) {
56905691 pi->sys_pcie_mask = 0;
56915692 } else {
drivers/gpu/drm/radeon/si_dpm.c+3−2
@@ -6899,7 +6899,7 @@ int si_dpm_init(struct radeon_device *rdev) · 6898 unmodified lines
68996899 struct ni_power_info *ni_pi;
69006900 struct si_power_info *si_pi;
69016901 struct atom_clock_dividers dividers;
6902− enum pci_bus_speed speed_cap;
6902+ enum pci_bus_speed speed_cap = PCI_SPEED_UNKNOWN;
69036903 struct pci_dev *root = rdev->pdev->bus->self;
69046904 int ret;
69056905
@@ -6911,7 +6911,8 @@ int si_dpm_init(struct radeon_device *rdev) · 5 unmodified lines
69116911 eg_pi = &ni_pi->eg;
69126912 pi = &eg_pi->rv7xx;
69136913
6914− speed_cap = pcie_get_speed_cap(root);
6914+ if (!pci_is_root_bus(rdev->pdev->bus))
6915+ speed_cap = pcie_get_speed_cap(root);
69156916 if (speed_cap == PCI_SPEED_UNKNOWN) {
69166917 si_pi->sys_pcie_mask = 0;
69176918 } else {
drivers/gpu/drm/rockchip/rockchip_rgb.c+4−11
@@ -1,17 +1,8 @@
1−//SPDX-License-Identifier: GPL-2.0+
1+// SPDX-License-Identifier: GPL-2.0
22 /*
33 * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd
44 * Author:
55 * Sandy Huang <hjc@rock-chips.com>
6− *
7− * This software is licensed under the terms of the GNU General Public
8− * License version 2, as published by the Free Software Foundation, and
9− * may be copied, distributed, and modified under those terms.
10− *
11− * This program is distributed in the hope that it will be useful,
12− * but WITHOUT ANY WARRANTY; without even the implied warranty of
13− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14− * GNU General Public License for more details.
156 */
167
178 #include <drm/drmP.h>
@@ -113,8 +104,10 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev, · 95 unmodified lines
113104 child_count++;
114105 ret = drm_of_find_panel_or_bridge(dev->of_node, 0, endpoint_id,
115106 &panel, &bridge);
116− if (!ret)
107+ if (!ret) {
108+ of_node_put(endpoint);
117109 break;
110+ }
118111 }
119112
120113 of_node_put(port);
drivers/gpu/drm/rockchip/rockchip_rgb.h+1−10
@@ -1,17 +1,8 @@
1−//SPDX-License-Identifier: GPL-2.0+
1+/* SPDX-License-Identifier: GPL-2.0 */
22 /*
33 * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd
44 * Author:
55 * Sandy Huang <hjc@rock-chips.com>
6− *
7− * This software is licensed under the terms of the GNU General Public
8− * License version 2, as published by the Free Software Foundation, and
9− * may be copied, distributed, and modified under those terms.
10− *
11− * This program is distributed in the hope that it will be useful,
12− * but WITHOUT ANY WARRANTY; without even the implied warranty of
13− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14− * GNU General Public License for more details.
156 */
167
178 #ifdef CONFIG_ROCKCHIP_RGB
drivers/gpu/drm/sun4i/sun4i_backend.c+3−2
@@ -786,17 +786,18 @@ static struct sun4i_frontend *sun4i_backend_find_frontend(struct sun4i_drv *drv, · 785 unmodified lines
786786 remote = of_graph_get_remote_port_parent(ep);
787787 if (!remote)
788788 continue;
789+ of_node_put(remote);
789790
790791 /* does this node match any registered engines? */
791792 list_for_each_entry(frontend, &drv->frontend_list, list) {
792793 if (remote == frontend->node) {
793− of_node_put(remote);
794794 of_node_put(port);
795+ of_node_put(ep);
795796 return frontend;
796797 }
797798 }
798799 }
799−
800+ of_node_put(port);
800801 return ERR_PTR(-EINVAL);
801802 }
802803
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c+4−0
@@ -92,6 +92,8 @@ static void sun4i_hdmi_disable(struct drm_encoder *encoder) · 91 unmodified lines
9292 val = readl(hdmi->base + SUN4I_HDMI_VID_CTRL_REG);
9393 val &= ~SUN4I_HDMI_VID_CTRL_ENABLE;
9494 writel(val, hdmi->base + SUN4I_HDMI_VID_CTRL_REG);
95+
96+ clk_disable_unprepare(hdmi->tmds_clk);
9597 }
9698
9799 static void sun4i_hdmi_enable(struct drm_encoder *encoder)
@@ -102,6 +104,8 @@ static void sun4i_hdmi_enable(struct drm_encoder *encoder) · 4 unmodified lines
102104
103105 DRM_DEBUG_DRIVER("Enabling the HDMI Output\n");
104106
107+ clk_prepare_enable(hdmi->tmds_clk);
108+
105109 sun4i_hdmi_setup_avi_infoframes(hdmi, mode);
106110 val |= SUN4I_HDMI_PKT_CTRL_TYPE(0, SUN4I_HDMI_PKT_AVI);
107111 val |= SUN4I_HDMI_PKT_CTRL_TYPE(1, SUN4I_HDMI_PKT_END);
drivers/gpu/drm/sun4i/sun4i_tcon.c+2−0
@@ -761,6 +761,7 @@ static int sun4i_tcon_init_clocks(struct device *dev, · 760 unmodified lines
761761 return PTR_ERR(tcon->sclk0);
762762 }
763763 }
764+ clk_prepare_enable(tcon->sclk0);
764765
765766 if (tcon->quirks->has_channel_1) {
766767 tcon->sclk1 = devm_clk_get(dev, "tcon-ch1");
@@ -775,6 +776,7 @@ static int sun4i_tcon_init_clocks(struct device *dev, · 8 unmodified lines
775776
776777 static void sun4i_tcon_free_clocks(struct sun4i_tcon *tcon)
777778 {
779+ clk_disable_unprepare(tcon->sclk0);
778780 clk_disable_unprepare(tcon->clk);
779781 }
780782
drivers/gpu/drm/virtio/virtgpu_drv.c+0−4
@@ -127,14 +127,10 @@ static struct drm_driver driver = { · 126 unmodified lines
127127 #if defined(CONFIG_DEBUG_FS)
128128 .debugfs_init = virtio_gpu_debugfs_init,
129129 #endif
130− .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
131− .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
132130 .gem_prime_export = drm_gem_prime_export,
133131 .gem_prime_import = drm_gem_prime_import,
134132 .gem_prime_pin = virtgpu_gem_prime_pin,
135133 .gem_prime_unpin = virtgpu_gem_prime_unpin,
136− .gem_prime_get_sg_table = virtgpu_gem_prime_get_sg_table,
137− .gem_prime_import_sg_table = virtgpu_gem_prime_import_sg_table,
138134 .gem_prime_vmap = virtgpu_gem_prime_vmap,
139135 .gem_prime_vunmap = virtgpu_gem_prime_vunmap,
140136 .gem_prime_mmap = virtgpu_gem_prime_mmap,
drivers/gpu/drm/virtio/virtgpu_drv.h+0−4
@@ -372,10 +372,6 @@ int virtio_gpu_object_wait(struct virtio_gpu_object *bo, bool no_wait); · 371 unmodified lines
372372 /* virtgpu_prime.c */
373373 int virtgpu_gem_prime_pin(struct drm_gem_object *obj);
374374 void virtgpu_gem_prime_unpin(struct drm_gem_object *obj);
375−struct sg_table *virtgpu_gem_prime_get_sg_table(struct drm_gem_object *obj);
376−struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
377− struct drm_device *dev, struct dma_buf_attachment *attach,
378− struct sg_table *sgt);
379375 void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj);
380376 void virtgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
381377 int virtgpu_gem_prime_mmap(struct drm_gem_object *obj,
drivers/gpu/drm/virtio/virtgpu_prime.c+0−14
@@ -39,20 +39,6 @@ void virtgpu_gem_prime_unpin(struct drm_gem_object *obj) · 38 unmodified lines
3939 WARN_ONCE(1, "not implemented");
4040 }
4141
42−struct sg_table *virtgpu_gem_prime_get_sg_table(struct drm_gem_object *obj)
43−{
44− WARN_ONCE(1, "not implemented");
45− return ERR_PTR(-ENODEV);
46−}
47−
48−struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
49− struct drm_device *dev, struct dma_buf_attachment *attach,
50− struct sg_table *table)
51−{
52− WARN_ONCE(1, "not implemented");
53− return ERR_PTR(-ENODEV);
54−}
55−
5642 void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj)
5743 {
5844 struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj);
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c+32−49
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 **************************************************************************/
2727 #include <linux/module.h>
2828 #include <linux/console.h>
29+#include <linux/dma-mapping.h>
2930
3031 #include <drm/drmP.h>
3132 #include "vmwgfx_drv.h"
@@ -34,7 +35,6 @@ · 2 unmodified lines
3435 #include <drm/ttm/ttm_placement.h>
3536 #include <drm/ttm/ttm_bo_driver.h>
3637 #include <drm/ttm/ttm_module.h>
37−#include <linux/intel-iommu.h>
3838
3939 #define VMWGFX_DRIVER_DESC "Linux drm driver for VMware graphics devices"
4040 #define VMWGFX_CHIP_SVGAII 0
@@ -545,6 +545,21 @@ static void vmw_get_initial_size(struct vmw_private *dev_priv) · 504 unmodified lines
545545 dev_priv->initial_height = height;
546546 }
547547
548+/**
549+ * vmw_assume_iommu - Figure out whether coherent dma-remapping might be
550+ * taking place.
551+ * @dev: Pointer to the struct drm_device.
552+ *
553+ * Return: true if iommu present, false otherwise.
554+ */
555+static bool vmw_assume_iommu(struct drm_device *dev)
556+{
557+ const struct dma_map_ops *ops = get_dma_ops(dev->dev);
558+
559+ return !dma_is_direct(ops) && ops &&
560+ ops->map_page != dma_direct_map_page;
561+}
562+
548563 /**
549564 * vmw_dma_select_mode - Determine how DMA mappings should be set up for this
550565 * system.
@@ -565,55 +580,27 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv) · 14 unmodified lines
565580 [vmw_dma_alloc_coherent] = "Using coherent TTM pages.",
566581 [vmw_dma_map_populate] = "Keeping DMA mappings.",
567582 [vmw_dma_map_bind] = "Giving up DMA mappings early."};
568−#ifdef CONFIG_X86
569− const struct dma_map_ops *dma_ops = get_dma_ops(dev_priv->dev->dev);
570583
571−#ifdef CONFIG_INTEL_IOMMU
572− if (intel_iommu_enabled) {
584+ if (vmw_force_coherent)
585+ dev_priv->map_mode = vmw_dma_alloc_coherent;
586+ else if (vmw_assume_iommu(dev_priv->dev))
573587 dev_priv->map_mode = vmw_dma_map_populate;
574− goto out_fixup;
575− }
576−#endif
577−
578− if (!(vmw_force_iommu || vmw_force_coherent)) {
588+ else if (!vmw_force_iommu)
579589 dev_priv->map_mode = vmw_dma_phys;
580− DRM_INFO("DMA map mode: %s\n", names[dev_priv->map_mode]);
581− return 0;
582− }
583−
584− dev_priv->map_mode = vmw_dma_map_populate;
585−
586− if (dma_ops && dma_ops->sync_single_for_cpu)
590+ else if (IS_ENABLED(CONFIG_SWIOTLB) && swiotlb_nr_tbl())
587591 dev_priv->map_mode = vmw_dma_alloc_coherent;
588−#ifdef CONFIG_SWIOTLB
589− if (swiotlb_nr_tbl() == 0)
592+ else
590593 dev_priv->map_mode = vmw_dma_map_populate;
591−#endif
592594
593−#ifdef CONFIG_INTEL_IOMMU
594−out_fixup:
595−#endif
596− if (dev_priv->map_mode == vmw_dma_map_populate &&
597− vmw_restrict_iommu)
595+ if (dev_priv->map_mode == vmw_dma_map_populate && vmw_restrict_iommu)
598596 dev_priv->map_mode = vmw_dma_map_bind;
599597
600− if (vmw_force_coherent)
601− dev_priv->map_mode = vmw_dma_alloc_coherent;
602−
603−#if !defined(CONFIG_SWIOTLB) && !defined(CONFIG_INTEL_IOMMU)
604− /*
605− * No coherent page pool
606− */
607− if (dev_priv->map_mode == vmw_dma_alloc_coherent)
598+ /* No TTM coherent page pool? FIXME: Ask TTM instead! */
599+ if (!(IS_ENABLED(CONFIG_SWIOTLB) || IS_ENABLED(CONFIG_INTEL_IOMMU)) &&
600+ (dev_priv->map_mode == vmw_dma_alloc_coherent))
608601 return -EINVAL;
609−#endif
610−
611−#else /* CONFIG_X86 */
612− dev_priv->map_mode = vmw_dma_map_populate;
613−#endif /* CONFIG_X86 */
614602
615603 DRM_INFO("DMA map mode: %s\n", names[dev_priv->map_mode]);
616−
617604 return 0;
618605 }
619606
@@ -625,24 +612,20 @@ out_fixup: · 5 unmodified lines
625612 * With 32-bit we can only handle 32 bit PFNs. Optionally set that
626613 * restriction also for 64-bit systems.
627614 */
628−#ifdef CONFIG_INTEL_IOMMU
629615 static int vmw_dma_masks(struct vmw_private *dev_priv)
630616 {
631617 struct drm_device *dev = dev_priv->dev;
618+ int ret = 0;
632619
633− if (intel_iommu_enabled &&
620+ ret = dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(64));
621+ if (dev_priv->map_mode != vmw_dma_phys &&
634622 (sizeof(unsigned long) == 4 || vmw_restrict_dma_mask)) {
635623 DRM_INFO("Restricting DMA addresses to 44 bits.\n");
636− return dma_set_mask(dev->dev, DMA_BIT_MASK(44));
624+ return dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(44));
637625 }
638− return 0;
639−}
640−#else
641−static int vmw_dma_masks(struct vmw_private *dev_priv)
642−{
643− return 0;
626+
627+ return ret;
644628 }
645−#endif
646629
647630 static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
648631 {
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c+1−1
@@ -3570,7 +3570,7 @@ int vmw_execbuf_fence_commands(struct drm_file *file_priv, · 3569 unmodified lines
35703570 *p_fence = NULL;
35713571 }
35723572
3573− return 0;
3573+ return ret;
35743574 }
35753575
35763576 /**
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c+3−3
@@ -1646,7 +1646,7 @@ static int vmw_kms_check_topology(struct drm_device *dev, · 1645 unmodified lines
16461646 struct drm_connector_state *conn_state;
16471647 struct vmw_connector_state *vmw_conn_state;
16481648
1649− if (!du->pref_active) {
1649+ if (!du->pref_active && new_crtc_state->enable) {
16501650 ret = -EINVAL;
16511651 goto clean;
16521652 }
@@ -2554,8 +2554,8 @@ void vmw_kms_helper_validation_finish(struct vmw_private *dev_priv, · 901 unmodified lines
25542554 user_fence_rep)
25552555 {
25562556 struct vmw_fence_obj *fence = NULL;
2557− uint32_t handle;
2558− int ret;
2557+ uint32_t handle = 0;
2558+ int ret = 0;
25592559
25602560 if (file_priv || user_fence_rep || vmw_validation_has_bos(ctx) ||
25612561 out_fence)
drivers/gpu/vga/Kconfig+1−0
@@ -21,6 +21,7 @@ config VGA_SWITCHEROO · 20 unmodified lines
2121 bool "Laptop Hybrid Graphics - GPU switching support"
2222 depends on X86
2323 depends on ACPI
24+ depends on PCI
2425 select VGA_ARB
2526 help
2627 Many laptops released in 2008/9/10 have two GPUs with a multiplexer
drivers/hid/hid-core.c+12−11
@@ -125,6 +125,7 @@ static int open_collection(struct hid_parser *parser, unsigned type) · 124 unmodified lines
125125 {
126126 struct hid_collection *collection;
127127 unsigned usage;
128+ int collection_index;
128129
129130 usage = parser->local.usage[0];
130131
@@ -167,13 +168,13 @@ static int open_collection(struct hid_parser *parser, unsigned type) · 36 unmodified lines
167168 parser->collection_stack[parser->collection_stack_ptr++] =
168169 parser->device->maxcollection;
169170
170− collection = parser->device->collection +
171− parser->device->maxcollection++;
171+ collection_index = parser->device->maxcollection++;
172+ collection = parser->device->collection + collection_index;
172173 collection->type = type;
173174 collection->usage = usage;
174175 collection->level = parser->collection_stack_ptr - 1;
175− collection->parent = parser->active_collection;
176− parser->active_collection = collection;
176+ collection->parent_idx = (collection->level == 0) ? -1 :
177+ parser->collection_stack[collection->level - 1];
177178
178179 if (type == HID_COLLECTION_APPLICATION)
179180 parser->device->maxapplication++;
@@ -192,8 +193,6 @@ static int close_collection(struct hid_parser *parser) · 12 unmodified lines
192193 return -EINVAL;
193194 }
194195 parser->collection_stack_ptr--;
195− if (parser->active_collection)
196− parser->active_collection = parser->active_collection->parent;
197196 return 0;
198197 }
199198
@@ -1006,10 +1005,12 @@ static void hid_apply_multiplier_to_field(struct hid_device *hid, · 806 unmodified lines
10061005 usage = &field->usage[i];
10071006
10081007 collection = &hid->collection[usage->collection_index];
1009− while (collection && collection != multiplier_collection)
1010− collection = collection->parent;
1008+ while (collection->parent_idx != -1 &&
1009+ collection != multiplier_collection)
1010+ collection = &hid->collection[collection->parent_idx];
10111011
1012− if (collection || multiplier_collection == NULL)
1012+ if (collection->parent_idx != -1 ||
1013+ multiplier_collection == NULL)
10131014 usage->resolution_multiplier = effective_multiplier;
10141015
10151016 }
@@ -1044,9 +1045,9 @@ static void hid_apply_multiplier(struct hid_device *hid, · 28 unmodified lines
10441045 * applicable fields later.
10451046 */
10461047 multiplier_collection = &hid->collection[multiplier->usage->collection_index];
1047− while (multiplier_collection &&
1048+ while (multiplier_collection->parent_idx != -1 &&
10481049 multiplier_collection->type != HID_COLLECTION_LOGICAL)
1049− multiplier_collection = multiplier_collection->parent;
1050+ multiplier_collection = &hid->collection[multiplier_collection->parent_idx];
10501051
10511052 effective_multiplier = hid_calculate_multiplier(hid, multiplier);
10521053
drivers/hid/hid-debug.c+47−73
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030
3131 #include <linux/debugfs.h>
3232 #include <linux/seq_file.h>
33+#include <linux/kfifo.h>
3334 #include <linux/sched/signal.h>
3435 #include <linux/export.h>
3536 #include <linux/slab.h>
@@ -661,17 +662,12 @@ EXPORT_SYMBOL_GPL(hid_dump_device); · 625 unmodified lines
661662 /* enqueue string to 'events' ring buffer */
662663 void hid_debug_event(struct hid_device *hdev, char *buf)
663664 {
664− unsigned i;
665665 struct hid_debug_list *list;
666666 unsigned long flags;
667667
668668 spin_lock_irqsave(&hdev->debug_list_lock, flags);
669− list_for_each_entry(list, &hdev->debug_list, node) {
670− for (i = 0; buf[i]; i++)
671− list->hid_debug_buf[(list->tail + i) % HID_DEBUG_BUFSIZE] =
672− buf[i];
673− list->tail = (list->tail + i) % HID_DEBUG_BUFSIZE;
674− }
669+ list_for_each_entry(list, &hdev->debug_list, node)
670+ kfifo_in(&list->hid_debug_fifo, buf, strlen(buf));
675671 spin_unlock_irqrestore(&hdev->debug_list_lock, flags);
676672
677673 wake_up_interruptible(&hdev->debug_wait);
@@ -722,8 +718,7 @@ void hid_dump_input(struct hid_device *hdev, struct hid_usage *usage, __s32 valu · 44 unmodified lines
722718 hid_debug_event(hdev, buf);
723719
724720 kfree(buf);
725− wake_up_interruptible(&hdev->debug_wait);
726−
721+ wake_up_interruptible(&hdev->debug_wait);
727722 }
728723 EXPORT_SYMBOL_GPL(hid_dump_input);
729724
@@ -1083,8 +1078,8 @@ static int hid_debug_events_open(struct inode *inode, struct file *file) · 353 unmodified lines
10831078 goto out;
10841079 }
10851080
1086− if (!(list->hid_debug_buf = kzalloc(HID_DEBUG_BUFSIZE, GFP_KERNEL))) {
1087− err = -ENOMEM;
1081+ err = kfifo_alloc(&list->hid_debug_fifo, HID_DEBUG_FIFOSIZE, GFP_KERNEL);
1082+ if (err) {
10881083 kfree(list);
10891084 goto out;
10901085 }
@@ -1104,77 +1099,57 @@ static ssize_t hid_debug_events_read(struct file *file, char __user *buffer, · 13 unmodified lines
11041099 size_t count, loff_t *ppos)
11051100 {
11061101 struct hid_debug_list *list = file->private_data;
1107− int ret = 0, len;
1102+ int ret = 0, copied;
11081103 DECLARE_WAITQUEUE(wait, current);
11091104
11101105 mutex_lock(&list->read_mutex);
1111− while (ret == 0) {
1112− if (list->head == list->tail) {
1113− add_wait_queue(&list->hdev->debug_wait, &wait);
1114− set_current_state(TASK_INTERRUPTIBLE);
1115−
1116− while (list->head == list->tail) {
1117− if (file->f_flags & O_NONBLOCK) {
1118− ret = -EAGAIN;
1119− break;
1120− }
1121− if (signal_pending(current)) {
1122− ret = -ERESTARTSYS;
1123− break;
1124− }
1106+ if (kfifo_is_empty(&list->hid_debug_fifo)) {
1107+ add_wait_queue(&list->hdev->debug_wait, &wait);
1108+ set_current_state(TASK_INTERRUPTIBLE);
1109+
1110+ while (kfifo_is_empty(&list->hid_debug_fifo)) {
1111+ if (file->f_flags & O_NONBLOCK) {
1112+ ret = -EAGAIN;
1113+ break;
1114+ }
11251115
1126− if (!list->hdev || !list->hdev->debug) {
1127− ret = -EIO;
1128− set_current_state(TASK_RUNNING);
1129− goto out;
1130− }
1116+ if (signal_pending(current)) {
1117+ ret = -ERESTARTSYS;
1118+ break;
1119+ }
11311120
1132− /* allow O_NONBLOCK from other threads */
1133− mutex_unlock(&list->read_mutex);
1134− schedule();
1135− mutex_lock(&list->read_mutex);
1136− set_current_state(TASK_INTERRUPTIBLE);
1121+ /* if list->hdev is NULL we cannot remove_wait_queue().
1122+ * if list->hdev->debug is 0 then hid_debug_unregister()
1123+ * was already called and list->hdev is being destroyed.
1124+ * if we add remove_wait_queue() here we can hit a race.
1125+ */
1126+ if (!list->hdev || !list->hdev->debug) {
1127+ ret = -EIO;
1128+ set_current_state(TASK_RUNNING);
1129+ goto out;
11371130 }
11381131
1139− set_current_state(TASK_RUNNING);
1140− remove_wait_queue(&list->hdev->debug_wait, &wait);
1132+ /* allow O_NONBLOCK from other threads */
1133+ mutex_unlock(&list->read_mutex);
1134+ schedule();
1135+ mutex_lock(&list->read_mutex);
1136+ set_current_state(TASK_INTERRUPTIBLE);
11411137 }
11421138
1143− if (ret)
1144− goto out;
1139+ __set_current_state(TASK_RUNNING);
1140+ remove_wait_queue(&list->hdev->debug_wait, &wait);
11451141
1146− /* pass the ringbuffer contents to userspace */
1147−copy_rest:
1148− if (list->tail == list->head)
1142+ if (ret)
11491143 goto out;
1150− if (list->tail > list->head) {
1151− len = list->tail - list->head;
1152− if (len > count)
1153− len = count;
1154−
1155− if (copy_to_user(buffer + ret, &list->hid_debug_buf[list->head], len)) {
1156− ret = -EFAULT;
1157− goto out;
1158− }
1159− ret += len;
1160− list->head += len;
1161− } else {
1162− len = HID_DEBUG_BUFSIZE - list->head;
1163− if (len > count)
1164− len = count;
1165−
1166− if (copy_to_user(buffer, &list->hid_debug_buf[list->head], len)) {
1167− ret = -EFAULT;
1168− goto out;
1169− }
1170− list->head = 0;
1171− ret += len;
1172− count -= len;
1173− if (count > 0)
1174− goto copy_rest;
1175− }
1176−
11771144 }
1145+
1146+ /* pass the fifo content to userspace, locking is not needed with only
1147+ * one concurrent reader and one concurrent writer
1148+ */
1149+ ret = kfifo_to_user(&list->hid_debug_fifo, buffer, count, &copied);
1150+ if (ret)
1151+ goto out;
1152+ ret = copied;
11781153 out:
11791154 mutex_unlock(&list->read_mutex);
11801155 return ret;
@@ -1185,7 +1160,7 @@ static __poll_t hid_debug_events_poll(struct file *file, poll_table *wait) · 4 unmodified lines
11851160 struct hid_debug_list *list = file->private_data;
11861161
11871162 poll_wait(file, &list->hdev->debug_wait, wait);
1188− if (list->head != list->tail)
1163+ if (!kfifo_is_empty(&list->hid_debug_fifo))
11891164 return EPOLLIN | EPOLLRDNORM;
11901165 if (!list->hdev->debug)
11911166 return EPOLLERR | EPOLLHUP;
@@ -1200,7 +1175,7 @@ static int hid_debug_events_release(struct inode *inode, struct file *file) · 8 unmodified lines
12001175 spin_lock_irqsave(&list->hdev->debug_list_lock, flags);
12011176 list_del(&list->node);
12021177 spin_unlock_irqrestore(&list->hdev->debug_list_lock, flags);
1203− kfree(list->hid_debug_buf);
1178+ kfifo_free(&list->hid_debug_fifo);
12041179 kfree(list);
12051180
12061181 return 0;
@@ -1246,4 +1221,3 @@ void hid_debug_exit(void) · 39 unmodified lines
12461221 {
12471222 debugfs_remove_recursive(hid_debug_root);
12481223 }
1249−
drivers/hid/hid-ids.h+3−0
@@ -461,6 +461,9 @@ · 460 unmodified lines
461461 #define USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_010A 0x010a
462462 #define USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_E100 0xe100
463463
464+#define I2C_VENDOR_ID_GOODIX 0x27c6
465+#define I2C_DEVICE_ID_GOODIX_01F0 0x01f0
466+
464467 #define USB_VENDOR_ID_GOODTOUCH 0x1aad
465468 #define USB_DEVICE_ID_GOODTOUCH_000f 0x000f
466469
drivers/hid/i2c-hid/i2c-hid-core.c+2−0
@@ -179,6 +179,8 @@ static const struct i2c_hid_quirks { · 178 unmodified lines
179179 I2C_HID_QUIRK_DELAY_AFTER_SLEEP },
180180 { USB_VENDOR_ID_LG, I2C_DEVICE_ID_LG_8001,
181181 I2C_HID_QUIRK_NO_RUNTIME_PM },
182+ { I2C_VENDOR_ID_GOODIX, I2C_DEVICE_ID_GOODIX_01F0,
183+ I2C_HID_QUIRK_NO_RUNTIME_PM },
182184 { 0, 0 }
183185 };
184186
drivers/hv/channel.c+1−8
@@ -701,19 +701,12 @@ static int vmbus_close_internal(struct vmbus_channel *channel) · 700 unmodified lines
701701 int vmbus_disconnect_ring(struct vmbus_channel *channel)
702702 {
703703 struct vmbus_channel *cur_channel, *tmp;
704− unsigned long flags;
705− LIST_HEAD(list);
706704 int ret;
707705
708706 if (channel->primary_channel != NULL)
709707 return -EINVAL;
710708
711− /* Snapshot the list of subchannels */
712− spin_lock_irqsave(&channel->lock, flags);
713− list_splice_init(&channel->sc_list, &list);
714− spin_unlock_irqrestore(&channel->lock, flags);
715−
716− list_for_each_entry_safe(cur_channel, tmp, &list, sc_list) {
709+ list_for_each_entry_safe(cur_channel, tmp, &channel->sc_list, sc_list) {
717710 if (cur_channel->rescind)
718711 wait_for_completion(&cur_channel->rescind_event);
719712
drivers/hv/hv_balloon.c+6−4
@@ -888,12 +888,14 @@ static unsigned long handle_pg_range(unsigned long pg_start, · 887 unmodified lines
888888 pfn_cnt -= pgs_ol;
889889 /*
890890 * Check if the corresponding memory block is already
891− * online by checking its last previously backed page.
892− * In case it is we need to bring rest (which was not
893− * backed previously) online too.
891+ * online. It is possible to observe struct pages still
892+ * being uninitialized here so check section instead.
893+ * In case the section is online we need to bring the
894+ * rest of pfns (which were not backed previously)
895+ * online too.
894896 */
895897 if (start_pfn > has->start_pfn &&
896− !PageReserved(pfn_to_page(start_pfn - 1)))
898+ online_section_nr(pfn_to_section_nr(start_pfn)))
897899 hv_bring_pgs_online(has, start_pfn, pgs_ol);
898900
899901 }
drivers/hv/ring_buffer.c+15−16
@@ -164,26 +164,25 @@ hv_get_ringbuffer_availbytes(const struct hv_ring_buffer_info *rbi, · 163 unmodified lines
164164 }
165165
166166 /* Get various debug metrics for the specified ring buffer. */
167−void hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_info,
168− struct hv_ring_buffer_debug_info *debug_info)
167+int hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_info,
168+ struct hv_ring_buffer_debug_info *debug_info)
169169 {
170170 u32 bytes_avail_towrite;
171171 u32 bytes_avail_toread;
172172
173− if (ring_info->ring_buffer) {
174− hv_get_ringbuffer_availbytes(ring_info,
175− &bytes_avail_toread,
176− &bytes_avail_towrite);
177−
178− debug_info->bytes_avail_toread = bytes_avail_toread;
179− debug_info->bytes_avail_towrite = bytes_avail_towrite;
180− debug_info->current_read_index =
181− ring_info->ring_buffer->read_index;
182− debug_info->current_write_index =
183− ring_info->ring_buffer->write_index;
184− debug_info->current_interrupt_mask =
185− ring_info->ring_buffer->interrupt_mask;
186− }
173+ if (!ring_info->ring_buffer)
174+ return -EINVAL;
175+
176+ hv_get_ringbuffer_availbytes(ring_info,
177+ &bytes_avail_toread,
178+ &bytes_avail_towrite);
179+ debug_info->bytes_avail_toread = bytes_avail_toread;
180+ debug_info->bytes_avail_towrite = bytes_avail_towrite;
181+ debug_info->current_read_index = ring_info->ring_buffer->read_index;
182+ debug_info->current_write_index = ring_info->ring_buffer->write_index;
183+ debug_info->current_interrupt_mask
184+ = ring_info->ring_buffer->interrupt_mask;
185+ return 0;
187186 }
188187 EXPORT_SYMBOL_GPL(hv_ringbuffer_get_debuginfo);
189188
drivers/hv/vmbus_drv.c+61−30
@@ -313,12 +313,16 @@ static ssize_t out_intr_mask_show(struct device *dev, · 312 unmodified lines
313313 {
314314 struct hv_device *hv_dev = device_to_hv_device(dev);
315315 struct hv_ring_buffer_debug_info outbound;
316+ int ret;
316317
317318 if (!hv_dev->channel)
318319 return -ENODEV;
319− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
320− return -EINVAL;
321− hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound);
320+
321+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound,
322+ &outbound);
323+ if (ret < 0)
324+ return ret;
325+
322326 return sprintf(buf, "%d\n", outbound.current_interrupt_mask);
323327 }
324328 static DEVICE_ATTR_RO(out_intr_mask);
@@ -328,12 +332,15 @@ static ssize_t out_read_index_show(struct device *dev, · 3 unmodified lines
328332 {
329333 struct hv_device *hv_dev = device_to_hv_device(dev);
330334 struct hv_ring_buffer_debug_info outbound;
335+ int ret;
331336
332337 if (!hv_dev->channel)
333338 return -ENODEV;
334− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
335− return -EINVAL;
336− hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound);
339+
340+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound,
341+ &outbound);
342+ if (ret < 0)
343+ return ret;
337344 return sprintf(buf, "%d\n", outbound.current_read_index);
338345 }
339346 static DEVICE_ATTR_RO(out_read_index);
@@ -344,12 +351,15 @@ static ssize_t out_write_index_show(struct device *dev, · 4 unmodified lines
344351 {
345352 struct hv_device *hv_dev = device_to_hv_device(dev);
346353 struct hv_ring_buffer_debug_info outbound;
354+ int ret;
347355
348356 if (!hv_dev->channel)
349357 return -ENODEV;
350− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
351− return -EINVAL;
352− hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound);
358+
359+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound,
360+ &outbound);
361+ if (ret < 0)
362+ return ret;
353363 return sprintf(buf, "%d\n", outbound.current_write_index);
354364 }
355365 static DEVICE_ATTR_RO(out_write_index);
@@ -360,12 +370,15 @@ static ssize_t out_read_bytes_avail_show(struct device *dev, · 4 unmodified lines
360370 {
361371 struct hv_device *hv_dev = device_to_hv_device(dev);
362372 struct hv_ring_buffer_debug_info outbound;
373+ int ret;
363374
364375 if (!hv_dev->channel)
365376 return -ENODEV;
366− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
367− return -EINVAL;
368− hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound);
377+
378+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound,
379+ &outbound);
380+ if (ret < 0)
381+ return ret;
369382 return sprintf(buf, "%d\n", outbound.bytes_avail_toread);
370383 }
371384 static DEVICE_ATTR_RO(out_read_bytes_avail);
@@ -376,12 +389,15 @@ static ssize_t out_write_bytes_avail_show(struct device *dev, · 4 unmodified lines
376389 {
377390 struct hv_device *hv_dev = device_to_hv_device(dev);
378391 struct hv_ring_buffer_debug_info outbound;
392+ int ret;
379393
380394 if (!hv_dev->channel)
381395 return -ENODEV;
382− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
383− return -EINVAL;
384− hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound);
396+
397+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound,
398+ &outbound);
399+ if (ret < 0)
400+ return ret;
385401 return sprintf(buf, "%d\n", outbound.bytes_avail_towrite);
386402 }
387403 static DEVICE_ATTR_RO(out_write_bytes_avail);
@@ -391,12 +407,15 @@ static ssize_t in_intr_mask_show(struct device *dev, · 3 unmodified lines
391407 {
392408 struct hv_device *hv_dev = device_to_hv_device(dev);
393409 struct hv_ring_buffer_debug_info inbound;
410+ int ret;
394411
395412 if (!hv_dev->channel)
396413 return -ENODEV;
397− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
398− return -EINVAL;
399− hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
414+
415+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
416+ if (ret < 0)
417+ return ret;
418+
400419 return sprintf(buf, "%d\n", inbound.current_interrupt_mask);
401420 }
402421 static DEVICE_ATTR_RO(in_intr_mask);
@@ -406,12 +425,15 @@ static ssize_t in_read_index_show(struct device *dev, · 3 unmodified lines
406425 {
407426 struct hv_device *hv_dev = device_to_hv_device(dev);
408427 struct hv_ring_buffer_debug_info inbound;
428+ int ret;
409429
410430 if (!hv_dev->channel)
411431 return -ENODEV;
412− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
413− return -EINVAL;
414− hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
432+
433+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
434+ if (ret < 0)
435+ return ret;
436+
415437 return sprintf(buf, "%d\n", inbound.current_read_index);
416438 }
417439 static DEVICE_ATTR_RO(in_read_index);
@@ -421,12 +443,15 @@ static ssize_t in_write_index_show(struct device *dev, · 3 unmodified lines
421443 {
422444 struct hv_device *hv_dev = device_to_hv_device(dev);
423445 struct hv_ring_buffer_debug_info inbound;
446+ int ret;
424447
425448 if (!hv_dev->channel)
426449 return -ENODEV;
427− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
428− return -EINVAL;
429− hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
450+
451+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
452+ if (ret < 0)
453+ return ret;
454+
430455 return sprintf(buf, "%d\n", inbound.current_write_index);
431456 }
432457 static DEVICE_ATTR_RO(in_write_index);
@@ -437,12 +462,15 @@ static ssize_t in_read_bytes_avail_show(struct device *dev, · 4 unmodified lines
437462 {
438463 struct hv_device *hv_dev = device_to_hv_device(dev);
439464 struct hv_ring_buffer_debug_info inbound;
465+ int ret;
440466
441467 if (!hv_dev->channel)
442468 return -ENODEV;
443− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
444− return -EINVAL;
445− hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
469+
470+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
471+ if (ret < 0)
472+ return ret;
473+
446474 return sprintf(buf, "%d\n", inbound.bytes_avail_toread);
447475 }
448476 static DEVICE_ATTR_RO(in_read_bytes_avail);
@@ -453,12 +481,15 @@ static ssize_t in_write_bytes_avail_show(struct device *dev, · 4 unmodified lines
453481 {
454482 struct hv_device *hv_dev = device_to_hv_device(dev);
455483 struct hv_ring_buffer_debug_info inbound;
484+ int ret;
456485
457486 if (!hv_dev->channel)
458487 return -ENODEV;
459− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
460− return -EINVAL;
461− hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
488+
489+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
490+ if (ret < 0)
491+ return ret;
492+
462493 return sprintf(buf, "%d\n", inbound.bytes_avail_towrite);
463494 }
464495 static DEVICE_ATTR_RO(in_write_bytes_avail);
drivers/hwmon/lm80.c+3−1
@@ -393,8 +393,10 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr, · 392 unmodified lines
393393 }
394394
395395 rv = lm80_read_value(client, LM80_REG_FANDIV);
396− if (rv < 0)
396+ if (rv < 0) {
397+ mutex_unlock(&data->update_lock);
397398 return rv;
399+ }
398400 reg = (rv & ~(3 << (2 * (nr + 1))))
399401 | (data->fan_div[nr] << (2 * (nr + 1)));
400402 lm80_write_value(client, LM80_REG_FANDIV, reg);
drivers/hwmon/nct6775.c+7−5
@@ -44,8 +44,8 @@ · 43 unmodified lines
4444 * nct6796d 14 7 7 2+6 0xd420 0xc1 0x5ca3
4545 * nct6797d 14 7 7 2+6 0xd450 0xc1 0x5ca3
4646 * (0xd451)
47− * nct6798d 14 7 7 2+6 0xd458 0xc1 0x5ca3
48− * (0xd459)
47+ * nct6798d 14 7 7 2+6 0xd428 0xc1 0x5ca3
48+ * (0xd429)
4949 *
5050 * #temp lists the number of monitored temperature sources (first value) plus
5151 * the number of directly connectable temperature sensors (second value).
@@ -138,7 +138,7 @@ MODULE_PARM_DESC(fan_debounce, "Enable debouncing for fan RPM signal"); · 86 unmodified lines
138138 #define SIO_NCT6795_ID 0xd350
139139 #define SIO_NCT6796_ID 0xd420
140140 #define SIO_NCT6797_ID 0xd450
141−#define SIO_NCT6798_ID 0xd458
141+#define SIO_NCT6798_ID 0xd428
142142 #define SIO_ID_MASK 0xFFF8
143143
144144 enum pwm_enable { off, manual, thermal_cruise, speed_cruise, sf3, sf4 };
@@ -4508,7 +4508,8 @@ static int __maybe_unused nct6775_resume(struct device *dev) · 4363 unmodified lines
45084508
45094509 if (data->kind == nct6791 || data->kind == nct6792 ||
45104510 data->kind == nct6793 || data->kind == nct6795 ||
4511− data->kind == nct6796)
4511+ data->kind == nct6796 || data->kind == nct6797 ||
4512+ data->kind == nct6798)
45124513 nct6791_enable_io_mapping(sioreg);
45134514
45144515 superio_exit(sioreg);
@@ -4644,7 +4645,8 @@ static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data) · 129 unmodified lines
46444645
46454646 if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
46464647 sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
4647− sio_data->kind == nct6796)
4648+ sio_data->kind == nct6796 || sio_data->kind == nct6797 ||
4649+ sio_data->kind == nct6798)
46484650 nct6791_enable_io_mapping(sioaddr);
46494651
46504652 superio_exit(sioaddr);
drivers/hwmon/occ/common.c+12−12
@@ -380,8 +380,8 @@ static ssize_t occ_show_power_1(struct device *dev, · 379 unmodified lines
380380 val *= 1000000ULL;
381381 break;
382382 case 2:
383− val = get_unaligned_be32(&power->update_tag) *
384− occ->powr_sample_time_us;
383+ val = (u64)get_unaligned_be32(&power->update_tag) *
384+ occ->powr_sample_time_us;
385385 break;
386386 case 3:
387387 val = get_unaligned_be16(&power->value) * 1000000ULL;
@@ -425,8 +425,8 @@ static ssize_t occ_show_power_2(struct device *dev, · 37 unmodified lines
425425 &power->update_tag);
426426 break;
427427 case 2:
428− val = get_unaligned_be32(&power->update_tag) *
429− occ->powr_sample_time_us;
428+ val = (u64)get_unaligned_be32(&power->update_tag) *
429+ occ->powr_sample_time_us;
430430 break;
431431 case 3:
432432 val = get_unaligned_be16(&power->value) * 1000000ULL;
@@ -463,8 +463,8 @@ static ssize_t occ_show_power_a0(struct device *dev, · 30 unmodified lines
463463 &power->system.update_tag);
464464 break;
465465 case 2:
466− val = get_unaligned_be32(&power->system.update_tag) *
467− occ->powr_sample_time_us;
466+ val = (u64)get_unaligned_be32(&power->system.update_tag) *
467+ occ->powr_sample_time_us;
468468 break;
469469 case 3:
470470 val = get_unaligned_be16(&power->system.value) * 1000000ULL;
@@ -477,8 +477,8 @@ static ssize_t occ_show_power_a0(struct device *dev, · 6 unmodified lines
477477 &power->proc.update_tag);
478478 break;
479479 case 6:
480− val = get_unaligned_be32(&power->proc.update_tag) *
481− occ->powr_sample_time_us;
480+ val = (u64)get_unaligned_be32(&power->proc.update_tag) *
481+ occ->powr_sample_time_us;
482482 break;
483483 case 7:
484484 val = get_unaligned_be16(&power->proc.value) * 1000000ULL;
@@ -491,8 +491,8 @@ static ssize_t occ_show_power_a0(struct device *dev, · 6 unmodified lines
491491 &power->vdd.update_tag);
492492 break;
493493 case 10:
494− val = get_unaligned_be32(&power->vdd.update_tag) *
495− occ->powr_sample_time_us;
494+ val = (u64)get_unaligned_be32(&power->vdd.update_tag) *
495+ occ->powr_sample_time_us;
496496 break;
497497 case 11:
498498 val = get_unaligned_be16(&power->vdd.value) * 1000000ULL;
@@ -505,8 +505,8 @@ static ssize_t occ_show_power_a0(struct device *dev, · 6 unmodified lines
505505 &power->vdn.update_tag);
506506 break;
507507 case 14:
508− val = get_unaligned_be32(&power->vdn.update_tag) *
509− occ->powr_sample_time_us;
508+ val = (u64)get_unaligned_be32(&power->vdn.update_tag) *
509+ occ->powr_sample_time_us;
510510 break;
511511 case 15:
512512 val = get_unaligned_be16(&power->vdn.value) * 1000000ULL;
drivers/hwmon/tmp421.c+1−1
@@ -88,7 +88,7 @@ static const struct of_device_id tmp421_of_match[] = { · 87 unmodified lines
8888 .data = (void *)2
8989 },
9090 {
91− .compatible = "ti,tmp422",
91+ .compatible = "ti,tmp442",
9292 .data = (void *)3
9393 },
9494 { },
drivers/i2c/busses/i2c-omap.c+5−8
@@ -1500,8 +1500,7 @@ static int omap_i2c_remove(struct platform_device *pdev) · 1499 unmodified lines
15001500 return 0;
15011501 }
15021502
1503−#ifdef CONFIG_PM
1504−static int omap_i2c_runtime_suspend(struct device *dev)
1503+static int __maybe_unused omap_i2c_runtime_suspend(struct device *dev)
15051504 {
15061505 struct omap_i2c_dev *omap = dev_get_drvdata(dev);
15071506
@@ -1527,7 +1526,7 @@ static int omap_i2c_runtime_suspend(struct device *dev) · 19 unmodified lines
15271526 return 0;
15281527 }
15291528
1530−static int omap_i2c_runtime_resume(struct device *dev)
1529+static int __maybe_unused omap_i2c_runtime_resume(struct device *dev)
15311530 {
15321531 struct omap_i2c_dev *omap = dev_get_drvdata(dev);
15331532
@@ -1542,20 +1541,18 @@ static int omap_i2c_runtime_resume(struct device *dev) · 8 unmodified lines
15421541 }
15431542
15441543 static const struct dev_pm_ops omap_i2c_pm_ops = {
1544+ SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
1545+ pm_runtime_force_resume)
15451546 SET_RUNTIME_PM_OPS(omap_i2c_runtime_suspend,
15461547 omap_i2c_runtime_resume, NULL)
15471548 };
1548−#define OMAP_I2C_PM_OPS (&omap_i2c_pm_ops)
1549−#else
1550−#define OMAP_I2C_PM_OPS NULL
1551−#endif /* CONFIG_PM */
15521549
15531550 static struct platform_driver omap_i2c_driver = {
15541551 .probe = omap_i2c_probe,
15551552 .remove = omap_i2c_remove,
15561553 .driver = {
15571554 .name = "omap_i2c",
1558− .pm = OMAP_I2C_PM_OPS,
1555+ .pm = &omap_i2c_pm_ops,
15591556 .of_match_table = of_match_ptr(omap_i2c_of_match),
15601557 },
15611558 };
drivers/i2c/busses/i2c-tegra.c+14−1
@@ -155,6 +155,8 @@ enum msg_end_type { · 154 unmodified lines
155155 * @has_mst_fifo: The I2C controller contains the new MST FIFO interface that
156156 * provides additional features and allows for longer messages to
157157 * be transferred in one go.
158+ * @quirks: i2c adapter quirks for limiting write/read transfer size and not
159+ * allowing 0 length transfers.
158160 */
159161 struct tegra_i2c_hw_feature {
160162 bool has_continue_xfer_support;
@@ -167,6 +169,7 @@ struct tegra_i2c_hw_feature { · 6 unmodified lines
167169 bool has_multi_master_mode;
168170 bool has_slcg_override_reg;
169171 bool has_mst_fifo;
172+ const struct i2c_adapter_quirks *quirks;
170173 };
171174
172175 /**
@@ -837,6 +840,10 @@ static const struct i2c_adapter_quirks tegra_i2c_quirks = { · 664 unmodified lines
837840 .max_write_len = 4096,
838841 };
839842
843+static const struct i2c_adapter_quirks tegra194_i2c_quirks = {
844+ .flags = I2C_AQ_NO_ZERO_LEN,
845+};
846+
840847 static const struct tegra_i2c_hw_feature tegra20_i2c_hw = {
841848 .has_continue_xfer_support = false,
842849 .has_per_pkt_xfer_complete_irq = false,
@@ -848,6 +855,7 @@ static const struct tegra_i2c_hw_feature tegra20_i2c_hw = { · 5 unmodified lines
848855 .has_multi_master_mode = false,
849856 .has_slcg_override_reg = false,
850857 .has_mst_fifo = false,
858+ .quirks = &tegra_i2c_quirks,
851859 };
852860
853861 static const struct tegra_i2c_hw_feature tegra30_i2c_hw = {
@@ -861,6 +869,7 @@ static const struct tegra_i2c_hw_feature tegra30_i2c_hw = { · 7 unmodified lines
861869 .has_multi_master_mode = false,
862870 .has_slcg_override_reg = false,
863871 .has_mst_fifo = false,
872+ .quirks = &tegra_i2c_quirks,
864873 };
865874
866875 static const struct tegra_i2c_hw_feature tegra114_i2c_hw = {
@@ -874,6 +883,7 @@ static const struct tegra_i2c_hw_feature tegra114_i2c_hw = { · 7 unmodified lines
874883 .has_multi_master_mode = false,
875884 .has_slcg_override_reg = false,
876885 .has_mst_fifo = false,
886+ .quirks = &tegra_i2c_quirks,
877887 };
878888
879889 static const struct tegra_i2c_hw_feature tegra124_i2c_hw = {
@@ -887,6 +897,7 @@ static const struct tegra_i2c_hw_feature tegra124_i2c_hw = { · 7 unmodified lines
887897 .has_multi_master_mode = false,
888898 .has_slcg_override_reg = true,
889899 .has_mst_fifo = false,
900+ .quirks = &tegra_i2c_quirks,
890901 };
891902
892903 static const struct tegra_i2c_hw_feature tegra210_i2c_hw = {
@@ -900,6 +911,7 @@ static const struct tegra_i2c_hw_feature tegra210_i2c_hw = { · 7 unmodified lines
900911 .has_multi_master_mode = true,
901912 .has_slcg_override_reg = true,
902913 .has_mst_fifo = false,
914+ .quirks = &tegra_i2c_quirks,
903915 };
904916
905917 static const struct tegra_i2c_hw_feature tegra194_i2c_hw = {
@@ -913,6 +925,7 @@ static const struct tegra_i2c_hw_feature tegra194_i2c_hw = { · 7 unmodified lines
913925 .has_multi_master_mode = true,
914926 .has_slcg_override_reg = true,
915927 .has_mst_fifo = true,
928+ .quirks = &tegra194_i2c_quirks,
916929 };
917930
918931 /* Match table for of_platform binding */
@@ -964,7 +977,6 @@ static int tegra_i2c_probe(struct platform_device *pdev) · 45 unmodified lines
964977 i2c_dev->base = base;
965978 i2c_dev->div_clk = div_clk;
966979 i2c_dev->adapter.algo = &tegra_i2c_algo;
967− i2c_dev->adapter.quirks = &tegra_i2c_quirks;
968980 i2c_dev->irq = irq;
969981 i2c_dev->cont_id = pdev->id;
970982 i2c_dev->dev = &pdev->dev;
@@ -980,6 +992,7 @@ static int tegra_i2c_probe(struct platform_device *pdev) · 9 unmodified lines
980992 i2c_dev->hw = of_device_get_match_data(&pdev->dev);
981993 i2c_dev->is_dvc = of_device_is_compatible(pdev->dev.of_node,
982994 "nvidia,tegra20-i2c-dvc");
995+ i2c_dev->adapter.quirks = i2c_dev->hw->quirks;
983996 init_completion(&i2c_dev->msg_complete);
984997 spin_lock_init(&i2c_dev->xfer_lock);
985998
drivers/i2c/i2c-dev.c+6−0
@@ -470,9 +470,15 @@ static long i2cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 469 unmodified lines
470470 data_arg.data);
471471 }
472472 case I2C_RETRIES:
473+ if (arg > INT_MAX)
474+ return -EINVAL;
475+
473476 client->adapter->retries = arg;
474477 break;
475478 case I2C_TIMEOUT:
479+ if (arg > INT_MAX)
480+ return -EINVAL;
481+
476482 /* For historical reasons, user-space sets the timeout
477483 * value in units of 10 ms.
478484 */
drivers/i3c/master.c+1−1
@@ -1828,7 +1828,7 @@ int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master, · 1827 unmodified lines
18281828
18291829 ret = i3c_master_retrieve_dev_info(newdev);
18301830 if (ret)
1831− goto err_free_dev;
1831+ goto err_detach_dev;
18321832
18331833 olddev = i3c_master_search_i3c_dev_duplicate(newdev);
18341834 if (olddev) {
drivers/i3c/master/dw-i3c-master.c+14−11
@@ -419,12 +419,9 @@ static void dw_i3c_master_enqueue_xfer(struct dw_i3c_master *master, · 418 unmodified lines
419419 spin_unlock_irqrestore(&master->xferqueue.lock, flags);
420420 }
421421
422−static void dw_i3c_master_dequeue_xfer(struct dw_i3c_master *master,
423− struct dw_i3c_xfer *xfer)
422+static void dw_i3c_master_dequeue_xfer_locked(struct dw_i3c_master *master,
423+ struct dw_i3c_xfer *xfer)
424424 {
425− unsigned long flags;
426−
427− spin_lock_irqsave(&master->xferqueue.lock, flags);
428425 if (master->xferqueue.cur == xfer) {
429426 u32 status;
430427
@@ -439,6 +436,15 @@ static void dw_i3c_master_dequeue_xfer(struct dw_i3c_master *master, · 8 unmodified lines
439436 } else {
440437 list_del_init(&xfer->node);
441438 }
439+}
440+
441+static void dw_i3c_master_dequeue_xfer(struct dw_i3c_master *master,
442+ struct dw_i3c_xfer *xfer)
443+{
444+ unsigned long flags;
445+
446+ spin_lock_irqsave(&master->xferqueue.lock, flags);
447+ dw_i3c_master_dequeue_xfer_locked(master, xfer);
442448 spin_unlock_irqrestore(&master->xferqueue.lock, flags);
443449 }
444450
@@ -494,7 +500,7 @@ static void dw_i3c_master_end_xfer_locked(struct dw_i3c_master *master, u32 isr) · 49 unmodified lines
494500 complete(&xfer->comp);
495501
496502 if (ret < 0) {
497− dw_i3c_master_dequeue_xfer(master, xfer);
503+ dw_i3c_master_dequeue_xfer_locked(master, xfer);
498504 writel(readl(master->regs + DEVICE_CTRL) | DEV_CTRL_RESUME,
499505 master->regs + DEVICE_CTRL);
500506 }
@@ -901,9 +907,6 @@ static int dw_i3c_master_reattach_i3c_dev(struct i3c_dev_desc *dev, · 400 unmodified lines
901907 master->regs +
902908 DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index));
903909
904− if (!old_dyn_addr)
905− return 0;
906−
907910 master->addrs[data->index] = dev->info.dyn_addr;
908911
909912 return 0;
@@ -925,11 +928,11 @@ static int dw_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev) · 15 unmodified lines
925928 return -ENOMEM;
926929
927930 data->index = pos;
928− master->addrs[pos] = dev->info.dyn_addr;
931+ master->addrs[pos] = dev->info.dyn_addr ? : dev->info.static_addr;
929932 master->free_pos &= ~BIT(pos);
930933 i3c_dev_set_master_data(dev, data);
931934
932− writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(dev->info.dyn_addr),
935+ writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(master->addrs[pos]),
933936 master->regs +
934937 DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index));
935938
drivers/i3c/master/i3c-master-cdns.c+2−2
@@ -1556,8 +1556,8 @@ static int cdns_i3c_master_probe(struct platform_device *pdev) · 1555 unmodified lines
15561556 return PTR_ERR(master->pclk);
15571557
15581558 master->sysclk = devm_clk_get(&pdev->dev, "sysclk");
1559− if (IS_ERR(master->pclk))
1560− return PTR_ERR(master->pclk);
1559+ if (IS_ERR(master->sysclk))
1560+ return PTR_ERR(master->sysclk);
15611561
15621562 irq = platform_get_irq(pdev, 0);
15631563 if (irq < 0)
drivers/ide/ide-atapi.c+8−1
@@ -235,21 +235,28 @@ EXPORT_SYMBOL_GPL(ide_prep_sense); · 234 unmodified lines
235235
236236 int ide_queue_sense_rq(ide_drive_t *drive, void *special)
237237 {
238− struct request *sense_rq = drive->sense_rq;
238+ ide_hwif_t *hwif = drive->hwif;
239+ struct request *sense_rq;
240+ unsigned long flags;
241+
242+ spin_lock_irqsave(&hwif->lock, flags);
239243
240244 /* deferred failure from ide_prep_sense() */
241245 if (!drive->sense_rq_armed) {
242246 printk(KERN_WARNING PFX "%s: error queuing a sense request\n",
243247 drive->name);
248+ spin_unlock_irqrestore(&hwif->lock, flags);
244249 return -ENOMEM;
245250 }
246251
252+ sense_rq = drive->sense_rq;
247253 ide_req(sense_rq)->special = special;
248254 drive->sense_rq_armed = false;
249255
250256 drive->hwif->rq = NULL;
251257
252258 ide_insert_request_head(drive, sense_rq);
259+ spin_unlock_irqrestore(&hwif->lock, flags);
253260 return 0;
254261 }
255262 EXPORT_SYMBOL_GPL(ide_queue_sense_rq);
drivers/ide/ide-io.c+31−30
@@ -68,8 +68,10 @@ int ide_end_rq(ide_drive_t *drive, struct request *rq, blk_status_t error, · 67 unmodified lines
6868 }
6969
7070 if (!blk_update_request(rq, error, nr_bytes)) {
71− if (rq == drive->sense_rq)
71+ if (rq == drive->sense_rq) {
7272 drive->sense_rq = NULL;
73+ drive->sense_rq_active = false;
74+ }
7375
7476 __blk_mq_end_request(rq, error);
7577 return 0;
@@ -451,16 +453,11 @@ void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq) · 375 unmodified lines
451453 blk_mq_delay_run_hw_queue(q->queue_hw_ctx[0], 3);
452454 }
453455
454−/*
455− * Issue a new request to a device.
456− */
457−blk_status_t ide_queue_rq(struct blk_mq_hw_ctx *hctx,
458− const struct blk_mq_queue_data *bd)
456+blk_status_t ide_issue_rq(ide_drive_t *drive, struct request *rq,
457+ bool local_requeue)
459458 {
460− ide_drive_t *drive = hctx->queue->queuedata;
461− ide_hwif_t *hwif = drive->hwif;
459+ ide_hwif_t *hwif = drive->hwif;
462460 struct ide_host *host = hwif->host;
463− struct request *rq = bd->rq;
464461 ide_startstop_t startstop;
465462
466463 if (!blk_rq_is_passthrough(rq) && !(rq->rq_flags & RQF_DONTPREP)) {
@@ -474,8 +471,6 @@ blk_status_t ide_queue_rq(struct blk_mq_hw_ctx *hctx, · 7 unmodified lines
474471 if (ide_lock_host(host, hwif))
475472 return BLK_STS_DEV_RESOURCE;
476473
477− blk_mq_start_request(rq);
478−
479474 spin_lock_irq(&hwif->lock);
480475
481476 if (!ide_lock_port(hwif)) {
@@ -510,18 +505,6 @@ repeat: · 28 unmodified lines
510505 hwif->cur_dev = drive;
511506 drive->dev_flags &= ~(IDE_DFLAG_SLEEPING | IDE_DFLAG_PARKED);
512507
513− /*
514− * we know that the queue isn't empty, but this can happen
515− * if ->prep_rq() decides to kill a request
516− */
517− if (!rq) {
518− rq = bd->rq;
519− if (!rq) {
520− ide_unlock_port(hwif);
521− goto out;
522− }
523− }
524−
525508 /*
526509 * Sanity: don't accept a request that isn't a PM request
527510 * if we are currently power managed. This is very important as
@@ -560,9 +543,12 @@ repeat: · 32 unmodified lines
560543 }
561544 } else {
562545 plug_device:
546+ if (local_requeue)
547+ list_add(&rq->queuelist, &drive->rq_list);
563548 spin_unlock_irq(&hwif->lock);
564549 ide_unlock_host(host);
565− ide_requeue_and_plug(drive, rq);
550+ if (!local_requeue)
551+ ide_requeue_and_plug(drive, rq);
566552 return BLK_STS_OK;
567553 }
568554
@@ -573,6 +559,26 @@ out: · 4 unmodified lines
573559 return BLK_STS_OK;
574560 }
575561
562+/*
563+ * Issue a new request to a device.
564+ */
565+blk_status_t ide_queue_rq(struct blk_mq_hw_ctx *hctx,
566+ const struct blk_mq_queue_data *bd)
567+{
568+ ide_drive_t *drive = hctx->queue->queuedata;
569+ ide_hwif_t *hwif = drive->hwif;
570+
571+ spin_lock_irq(&hwif->lock);
572+ if (drive->sense_rq_active) {
573+ spin_unlock_irq(&hwif->lock);
574+ return BLK_STS_DEV_RESOURCE;
575+ }
576+ spin_unlock_irq(&hwif->lock);
577+
578+ blk_mq_start_request(bd->rq);
579+ return ide_issue_rq(drive, bd->rq, false);
580+}
581+
576582 static int drive_is_ready(ide_drive_t *drive)
577583 {
578584 ide_hwif_t *hwif = drive->hwif;
@@ -893,13 +899,8 @@ EXPORT_SYMBOL_GPL(ide_pad_transfer); · 314 unmodified lines
893899
894900 void ide_insert_request_head(ide_drive_t *drive, struct request *rq)
895901 {
896− ide_hwif_t *hwif = drive->hwif;
897− unsigned long flags;
898−
899− spin_lock_irqsave(&hwif->lock, flags);
902+ drive->sense_rq_active = true;
900903 list_add_tail(&rq->queuelist, &drive->rq_list);
901− spin_unlock_irqrestore(&hwif->lock, flags);
902−
903904 kblockd_schedule_work(&drive->rq_work);
904905 }
905906 EXPORT_SYMBOL_GPL(ide_insert_request_head);
drivers/ide/ide-park.c+2−0
@@ -54,7 +54,9 @@ static void issue_park_cmd(ide_drive_t *drive, unsigned long timeout) · 53 unmodified lines
5454 scsi_req(rq)->cmd[0] = REQ_UNPARK_HEADS;
5555 scsi_req(rq)->cmd_len = 1;
5656 ide_req(rq)->type = ATA_PRIV_MISC;
57+ spin_lock_irq(&hwif->lock);
5758 ide_insert_request_head(drive, rq);
59+ spin_unlock_irq(&hwif->lock);
5860
5961 out:
6062 return;
drivers/ide/ide-probe.c+16−7
@@ -1159,18 +1159,27 @@ static void drive_rq_insert_work(struct work_struct *work) · 1158 unmodified lines
11591159 ide_drive_t *drive = container_of(work, ide_drive_t, rq_work);
11601160 ide_hwif_t *hwif = drive->hwif;
11611161 struct request *rq;
1162+ blk_status_t ret;
11621163 LIST_HEAD(list);
11631164
1164− spin_lock_irq(&hwif->lock);
1165− if (!list_empty(&drive->rq_list))
1166− list_splice_init(&drive->rq_list, &list);
1167− spin_unlock_irq(&hwif->lock);
1165+ blk_mq_quiesce_queue(drive->queue);
11681166
1169− while (!list_empty(&list)) {
1170− rq = list_first_entry(&list, struct request, queuelist);
1167+ ret = BLK_STS_OK;
1168+ spin_lock_irq(&hwif->lock);
1169+ while (!list_empty(&drive->rq_list)) {
1170+ rq = list_first_entry(&drive->rq_list, struct request, queuelist);
11711171 list_del_init(&rq->queuelist);
1172− blk_execute_rq_nowait(drive->queue, rq->rq_disk, rq, true, NULL);
1172+
1173+ spin_unlock_irq(&hwif->lock);
1174+ ret = ide_issue_rq(drive, rq, true);
1175+ spin_lock_irq(&hwif->lock);
11731176 }
1177+ spin_unlock_irq(&hwif->lock);
1178+
1179+ blk_mq_unquiesce_queue(drive->queue);
1180+
1181+ if (ret != BLK_STS_OK)
1182+ kblockd_schedule_work(&drive->rq_work);
11741183 }
11751184
11761185 static const u8 ide_hwif_to_major[] =
drivers/ide/ide-proc.c+1−1
@@ -544,7 +544,7 @@ void ide_proc_port_register_devices(ide_hwif_t *hwif) · 543 unmodified lines
544544 drive->proc = proc_mkdir(drive->name, parent);
545545 if (drive->proc) {
546546 ide_add_proc_entries(drive->proc, generic_drive_entries, drive);
547− proc_create_data("setting", S_IFREG|S_IRUSR|S_IWUSR,
547+ proc_create_data("settings", S_IFREG|S_IRUSR|S_IWUSR,
548548 drive->proc, &ide_settings_proc_fops,
549549 drive);
550550 }
drivers/iio/adc/axp288_adc.c+60−16
@@ -27,9 +27,18 @@ · 26 unmodified lines
2727 #include <linux/iio/machine.h>
2828 #include <linux/iio/driver.h>
2929
30−#define AXP288_ADC_EN_MASK 0xF1
31−#define AXP288_ADC_TS_PIN_GPADC 0xF2
32−#define AXP288_ADC_TS_PIN_ON 0xF3
30+/*
31+ * This mask enables all ADCs except for the battery temp-sensor (TS), that is
32+ * left as-is to avoid breaking charging on devices without a temp-sensor.
33+ */
34+#define AXP288_ADC_EN_MASK 0xF0
35+#define AXP288_ADC_TS_ENABLE 0x01
36+
37+#define AXP288_ADC_TS_CURRENT_ON_OFF_MASK GENMASK(1, 0)
38+#define AXP288_ADC_TS_CURRENT_OFF (0 << 0)
39+#define AXP288_ADC_TS_CURRENT_ON_WHEN_CHARGING (1 << 0)
40+#define AXP288_ADC_TS_CURRENT_ON_ONDEMAND (2 << 0)
41+#define AXP288_ADC_TS_CURRENT_ON (3 << 0)
3342
3443 enum axp288_adc_id {
3544 AXP288_ADC_TS,
@@ -44,6 +53,7 @@ enum axp288_adc_id { · 8 unmodified lines
4453 struct axp288_adc_info {
4554 int irq;
4655 struct regmap *regmap;
56+ bool ts_enabled;
4757 };
4858
4959 static const struct iio_chan_spec axp288_adc_channels[] = {
@@ -115,21 +125,33 @@ static int axp288_adc_read_channel(int *val, unsigned long address, · 65 unmodified lines
115125 return IIO_VAL_INT;
116126 }
117127
118−static int axp288_adc_set_ts(struct regmap *regmap, unsigned int mode,
119− unsigned long address)
128+/*
129+ * The current-source used for the battery temp-sensor (TS) is shared
130+ * with the GPADC. For proper fuel-gauge and charger operation the TS
131+ * current-source needs to be permanently on. But to read the GPADC we
132+ * need to temporary switch the TS current-source to ondemand, so that
133+ * the GPADC can use it, otherwise we will always read an all 0 value.
134+ */
135+static int axp288_adc_set_ts(struct axp288_adc_info *info,
136+ unsigned int mode, unsigned long address)
120137 {
121138 int ret;
122139
123− /* channels other than GPADC do not need to switch TS pin */
140+ /* No need to switch the current-source if the TS pin is disabled */
141+ if (!info->ts_enabled)
142+ return 0;
143+
144+ /* Channels other than GPADC do not need the current source */
124145 if (address != AXP288_GP_ADC_H)
125146 return 0;
126147
127− ret = regmap_write(regmap, AXP288_ADC_TS_PIN_CTRL, mode);
148+ ret = regmap_update_bits(info->regmap, AXP288_ADC_TS_PIN_CTRL,
149+ AXP288_ADC_TS_CURRENT_ON_OFF_MASK, mode);
128150 if (ret)
129151 return ret;
130152
131153 /* When switching to the GPADC pin give things some time to settle */
132− if (mode == AXP288_ADC_TS_PIN_GPADC)
154+ if (mode == AXP288_ADC_TS_CURRENT_ON_ONDEMAND)
133155 usleep_range(6000, 10000);
134156
135157 return 0;
@@ -145,14 +167,14 @@ static int axp288_adc_read_raw(struct iio_dev *indio_dev, · 9 unmodified lines
145167 mutex_lock(&indio_dev->mlock);
146168 switch (mask) {
147169 case IIO_CHAN_INFO_RAW:
148− if (axp288_adc_set_ts(info->regmap, AXP288_ADC_TS_PIN_GPADC,
170+ if (axp288_adc_set_ts(info, AXP288_ADC_TS_CURRENT_ON_ONDEMAND,
149171 chan->address)) {
150172 dev_err(&indio_dev->dev, "GPADC mode\n");
151173 ret = -EINVAL;
152174 break;
153175 }
154176 ret = axp288_adc_read_channel(val, chan->address, info->regmap);
155− if (axp288_adc_set_ts(info->regmap, AXP288_ADC_TS_PIN_ON,
177+ if (axp288_adc_set_ts(info, AXP288_ADC_TS_CURRENT_ON,
156178 chan->address))
157179 dev_err(&indio_dev->dev, "TS pin restore\n");
158180 break;
@@ -164,13 +186,35 @@ static int axp288_adc_read_raw(struct iio_dev *indio_dev, · 5 unmodified lines
164186 return ret;
165187 }
166188
167−static int axp288_adc_set_state(struct regmap *regmap)
189+static int axp288_adc_initialize(struct axp288_adc_info *info)
168190 {
169− /* ADC should be always enabled for internal FG to function */
170− if (regmap_write(regmap, AXP288_ADC_TS_PIN_CTRL, AXP288_ADC_TS_PIN_ON))
171− return -EIO;
191+ int ret, adc_enable_val;
192+
193+ /*
194+ * Determine if the TS pin is enabled and set the TS current-source
195+ * accordingly.
196+ */
197+ ret = regmap_read(info->regmap, AXP20X_ADC_EN1, &adc_enable_val);
198+ if (ret)
199+ return ret;
200+
201+ if (adc_enable_val & AXP288_ADC_TS_ENABLE) {
202+ info->ts_enabled = true;
203+ ret = regmap_update_bits(info->regmap, AXP288_ADC_TS_PIN_CTRL,
204+ AXP288_ADC_TS_CURRENT_ON_OFF_MASK,
205+ AXP288_ADC_TS_CURRENT_ON);
206+ } else {
207+ info->ts_enabled = false;
208+ ret = regmap_update_bits(info->regmap, AXP288_ADC_TS_PIN_CTRL,
209+ AXP288_ADC_TS_CURRENT_ON_OFF_MASK,
210+ AXP288_ADC_TS_CURRENT_OFF);
211+ }
212+ if (ret)
213+ return ret;
172214
173− return regmap_write(regmap, AXP20X_ADC_EN1, AXP288_ADC_EN_MASK);
215+ /* Turn on the ADC for all channels except TS, leave TS as is */
216+ return regmap_update_bits(info->regmap, AXP20X_ADC_EN1,
217+ AXP288_ADC_EN_MASK, AXP288_ADC_EN_MASK);
174218 }
175219
176220 static const struct iio_info axp288_adc_iio_info = {
@@ -200,7 +244,7 @@ static int axp288_adc_probe(struct platform_device *pdev) · 23 unmodified lines
200244 * Set ADC to enabled state at all time, including system suspend.
201245 * otherwise internal fuel gauge functionality may be affected.
202246 */
203− ret = axp288_adc_set_state(axp20x->regmap);
247+ ret = axp288_adc_initialize(info);
204248 if (ret) {
205249 dev_err(&pdev->dev, "unable to enable ADC device\n");
206250 return ret;
drivers/iio/adc/ti-ads8688.c+2−1
@@ -41,6 +41,7 @@ · 40 unmodified lines
4141
4242 #define ADS8688_VREF_MV 4096
4343 #define ADS8688_REALBITS 16
44+#define ADS8688_MAX_CHANNELS 8
4445
4546 /*
4647 * enum ads8688_range - ADS8688 reference voltage range
@@ -385,7 +386,7 @@ static irqreturn_t ads8688_trigger_handler(int irq, void *p) · 338 unmodified lines
385386 {
386387 struct iio_poll_func *pf = p;
387388 struct iio_dev *indio_dev = pf->indio_dev;
388− u16 buffer[8];
389+ u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)];
389390 int i, j = 0;
390391
391392 for (i = 0; i < indio_dev->masklength; i++) {
drivers/iio/adc/ti_am335x_adc.c+4−1
@@ -142,7 +142,10 @@ static void tiadc_step_config(struct iio_dev *indio_dev) · 141 unmodified lines
142142 stepconfig |= STEPCONFIG_MODE_SWCNT;
143143
144144 tiadc_writel(adc_dev, REG_STEPCONFIG(steps),
145− stepconfig | STEPCONFIG_INP(chan));
145+ stepconfig | STEPCONFIG_INP(chan) |
146+ STEPCONFIG_INM_ADCREFM |
147+ STEPCONFIG_RFP_VREFP |
148+ STEPCONFIG_RFM_VREFN);
146149
147150 if (adc_dev->open_delay[i] > STEPDELAY_OPEN_MASK) {
148151 dev_warn(dev, "chan %d open delay truncating to 0x3FFFF\n",
drivers/iio/chemical/atlas-ph-sensor.c+3−4
@@ -444,9 +444,8 @@ static int atlas_read_raw(struct iio_dev *indio_dev, · 443 unmodified lines
444444 case IIO_CHAN_INFO_SCALE:
445445 switch (chan->type) {
446446 case IIO_TEMP:
447− *val = 1; /* 0.01 */
448− *val2 = 100;
449− break;
447+ *val = 10;
448+ return IIO_VAL_INT;
450449 case IIO_PH:
451450 *val = 1; /* 0.001 */
452451 *val2 = 1000;
@@ -477,7 +476,7 @@ static int atlas_write_raw(struct iio_dev *indio_dev, · 24 unmodified lines
477476 int val, int val2, long mask)
478477 {
479478 struct atlas_data *data = iio_priv(indio_dev);
480− __be32 reg = cpu_to_be32(val);
479+ __be32 reg = cpu_to_be32(val / 10);
481480
482481 if (val2 != 0 || val < 0 || val > 20000)
483482 return -EINVAL;
drivers/infiniband/core/cma.c+4−1
@@ -494,7 +494,10 @@ static void _cma_attach_to_dev(struct rdma_id_private *id_priv, · 493 unmodified lines
494494 id_priv->id.route.addr.dev_addr.transport =
495495 rdma_node_get_transport(cma_dev->device->node_type);
496496 list_add_tail(&id_priv->list, &cma_dev->id_list);
497− rdma_restrack_kadd(&id_priv->res);
497+ if (id_priv->res.kern_name)
498+ rdma_restrack_kadd(&id_priv->res);
499+ else
500+ rdma_restrack_uadd(&id_priv->res);
498501 }
499502
500503 static void cma_attach_to_dev(struct rdma_id_private *id_priv,
drivers/infiniband/core/core_priv.h+0−1
@@ -267,7 +267,6 @@ static inline int ib_mad_enforce_security(struct ib_mad_agent_private *map, · 266 unmodified lines
267267 #endif
268268
269269 struct ib_device *ib_device_get_by_index(u32 ifindex);
270−void ib_device_put(struct ib_device *device);
271270 /* RDMA device netlink */
272271 void nldev_init(void);
273272 void nldev_exit(void);
drivers/infiniband/core/device.c+10−3
@@ -156,19 +156,26 @@ struct ib_device *ib_device_get_by_index(u32 index) · 155 unmodified lines
156156 down_read(&lists_rwsem);
157157 device = __ib_device_get_by_index(index);
158158 if (device) {
159− /* Do not return a device if unregistration has started. */
160− if (!refcount_inc_not_zero(&device->refcount))
159+ if (!ib_device_try_get(device))
161160 device = NULL;
162161 }
163162 up_read(&lists_rwsem);
164163 return device;
165164 }
166165
166+/**
167+ * ib_device_put - Release IB device reference
168+ * @device: device whose reference to be released
169+ *
170+ * ib_device_put() releases reference to the IB device to allow it to be
171+ * unregistered and eventually free.
172+ */
167173 void ib_device_put(struct ib_device *device)
168174 {
169175 if (refcount_dec_and_test(&device->refcount))
170176 complete(&device->unreg_completion);
171177 }
178+EXPORT_SYMBOL(ib_device_put);
172179
173180 static struct ib_device *__ib_device_get_by_name(const char *name)
174181 {
@@ -303,7 +310,6 @@ struct ib_device *ib_alloc_device(size_t size) · 128 unmodified lines
303310 rwlock_init(&device->client_data_lock);
304311 INIT_LIST_HEAD(&device->client_data_list);
305312 INIT_LIST_HEAD(&device->port_list);
306− refcount_set(&device->refcount, 1);
307313 init_completion(&device->unreg_completion);
308314
309315 return device;
@@ -620,6 +626,7 @@ int ib_register_device(struct ib_device *device, const char *name, · 310 unmodified lines
620626 goto cg_cleanup;
621627 }
622628
629+ refcount_set(&device->refcount, 1);
623630 device->reg_state = IB_DEV_REGISTERED;
624631
625632 list_for_each_entry(client, &client_list, list)
drivers/infiniband/core/nldev.c+0−4
@@ -584,10 +584,6 @@ static int fill_res_pd_entry(struct sk_buff *msg, struct netlink_callback *cb, · 583 unmodified lines
584584 if (nla_put_u64_64bit(msg, RDMA_NLDEV_ATTR_RES_USECNT,
585585 atomic_read(&pd->usecnt), RDMA_NLDEV_ATTR_PAD))
586586 goto err;
587− if ((pd->flags & IB_PD_UNSAFE_GLOBAL_RKEY) &&
588− nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY,
589− pd->unsafe_global_rkey))
590− goto err;
591587
592588 if (fill_res_name_pid(msg, res))
593589 goto err;
drivers/infiniband/core/rdma_core.h+2−0
@@ -106,6 +106,8 @@ int uverbs_finalize_object(struct ib_uobject *uobj, · 105 unmodified lines
106106 enum uverbs_obj_access access,
107107 bool commit);
108108
109+int uverbs_output_written(const struct uverbs_attr_bundle *bundle, size_t idx);
110+
109111 void setup_ufile_idr_uobject(struct ib_uverbs_file *ufile);
110112 void release_ufile_idr_uobject(struct ib_uverbs_file *ufile);
111113
drivers/infiniband/core/umem_odp.c+3−0
@@ -352,6 +352,8 @@ struct ib_umem_odp *ib_alloc_odp_umem(struct ib_ucontext_per_mm *per_mm, · 351 unmodified lines
352352 umem->writable = 1;
353353 umem->is_odp = 1;
354354 odp_data->per_mm = per_mm;
355+ umem->owning_mm = per_mm->mm;
356+ mmgrab(umem->owning_mm);
355357
356358 mutex_init(&odp_data->umem_mutex);
357359 init_completion(&odp_data->notifier_completion);
@@ -384,6 +386,7 @@ struct ib_umem_odp *ib_alloc_odp_umem(struct ib_ucontext_per_mm *per_mm, · 26 unmodified lines
384386 out_page_list:
385387 vfree(odp_data->page_list);
386388 out_odp_data:
389+ mmdrop(umem->owning_mm);
387390 kfree(odp_data);
388391 return ERR_PTR(ret);
389392 }
drivers/infiniband/core/uverbs_cmd.c+10−1
@@ -60,6 +60,10 @@ static int uverbs_response(struct uverbs_attr_bundle *attrs, const void *resp, · 59 unmodified lines
6060 {
6161 int ret;
6262
63+ if (uverbs_attr_is_valid(attrs, UVERBS_ATTR_CORE_OUT))
64+ return uverbs_copy_to_struct_or_zero(
65+ attrs, UVERBS_ATTR_CORE_OUT, resp, resp_len);
66+
6367 if (copy_to_user(attrs->ucore.outbuf, resp,
6468 min(attrs->ucore.outlen, resp_len)))
6569 return -EFAULT;
@@ -1181,6 +1185,9 @@ static int ib_uverbs_poll_cq(struct uverbs_attr_bundle *attrs) · 1115 unmodified lines
11811185 goto out_put;
11821186 }
11831187
1188+ if (uverbs_attr_is_valid(attrs, UVERBS_ATTR_CORE_OUT))
1189+ ret = uverbs_output_written(attrs, UVERBS_ATTR_CORE_OUT);
1190+
11841191 ret = 0;
11851192
11861193 out_put:
@@ -2012,8 +2019,10 @@ static int ib_uverbs_post_send(struct uverbs_attr_bundle *attrs) · 825 unmodified lines
20122019 return -ENOMEM;
20132020
20142021 qp = uobj_get_obj_read(qp, UVERBS_OBJECT_QP, cmd.qp_handle, attrs);
2015− if (!qp)
2022+ if (!qp) {
2023+ ret = -EINVAL;
20162024 goto out;
2025+ }
20172026
20182027 is_ud = qp->qp_type == IB_QPT_UD;
20192028 sg_ind = 0;
drivers/infiniband/core/uverbs_ioctl.c+49−13
@@ -144,6 +144,21 @@ static bool uverbs_is_attr_cleared(const struct ib_uverbs_attr *uattr, · 143 unmodified lines
144144 0, uattr->len - len);
145145 }
146146
147+static int uverbs_set_output(const struct uverbs_attr_bundle *bundle,
148+ const struct uverbs_attr *attr)
149+{
150+ struct bundle_priv *pbundle =
151+ container_of(bundle, struct bundle_priv, bundle);
152+ u16 flags;
153+
154+ flags = pbundle->uattrs[attr->ptr_attr.uattr_idx].flags |
155+ UVERBS_ATTR_F_VALID_OUTPUT;
156+ if (put_user(flags,
157+ &pbundle->user_attrs[attr->ptr_attr.uattr_idx].flags))
158+ return -EFAULT;
159+ return 0;
160+}
161+
147162 static int uverbs_process_idrs_array(struct bundle_priv *pbundle,
148163 const struct uverbs_api_attr *attr_uapi,
149164 struct uverbs_objs_arr_attr *attr,
@@ -455,6 +470,19 @@ static int ib_uverbs_run_method(struct bundle_priv *pbundle, · 305 unmodified lines
455470 ret = handler(&pbundle->bundle);
456471 }
457472
473+ /*
474+ * Until the drivers are revised to use the bundle directly we have to
475+ * assume that the driver wrote to its UHW_OUT and flag userspace
476+ * appropriately.
477+ */
478+ if (!ret && pbundle->method_elm->has_udata) {
479+ const struct uverbs_attr *attr =
480+ uverbs_attr_get(&pbundle->bundle, UVERBS_ATTR_UHW_OUT);
481+
482+ if (!IS_ERR(attr))
483+ ret = uverbs_set_output(&pbundle->bundle, attr);
484+ }
485+
458486 /*
459487 * EPROTONOSUPPORT is ONLY to be returned if the ioctl framework can
460488 * not invoke the method because the request is not supported. No
@@ -706,10 +734,7 @@ void uverbs_fill_udata(struct uverbs_attr_bundle *bundle, · 245 unmodified lines
706734 int uverbs_copy_to(const struct uverbs_attr_bundle *bundle, size_t idx,
707735 const void *from, size_t size)
708736 {
709− struct bundle_priv *pbundle =
710− container_of(bundle, struct bundle_priv, bundle);
711737 const struct uverbs_attr *attr = uverbs_attr_get(bundle, idx);
712− u16 flags;
713738 size_t min_size;
714739
715740 if (IS_ERR(attr))
@@ -719,16 +744,25 @@ int uverbs_copy_to(const struct uverbs_attr_bundle *bundle, size_t idx, · 3 unmodified lines
719744 if (copy_to_user(u64_to_user_ptr(attr->ptr_attr.data), from, min_size))
720745 return -EFAULT;
721746
722− flags = pbundle->uattrs[attr->ptr_attr.uattr_idx].flags |
723− UVERBS_ATTR_F_VALID_OUTPUT;
724− if (put_user(flags,
725− &pbundle->user_attrs[attr->ptr_attr.uattr_idx].flags))
726− return -EFAULT;
727−
728− return 0;
747+ return uverbs_set_output(bundle, attr);
729748 }
730749 EXPORT_SYMBOL(uverbs_copy_to);
731750
751+
752+/*
753+ * This is only used if the caller has directly used copy_to_use to write the
754+ * data. It signals to user space that the buffer is filled in.
755+ */
756+int uverbs_output_written(const struct uverbs_attr_bundle *bundle, size_t idx)
757+{
758+ const struct uverbs_attr *attr = uverbs_attr_get(bundle, idx);
759+
760+ if (IS_ERR(attr))
761+ return PTR_ERR(attr);
762+
763+ return uverbs_set_output(bundle, attr);
764+}
765+
732766 int _uverbs_get_const(s64 *to, const struct uverbs_attr_bundle *attrs_bundle,
733767 size_t idx, s64 lower_bound, u64 upper_bound,
734768 s64 *def_val)
@@ -757,8 +791,10 @@ int uverbs_copy_to_struct_or_zero(const struct uverbs_attr_bundle *bundle, · 22 unmodified lines
757791 {
758792 const struct uverbs_attr *attr = uverbs_attr_get(bundle, idx);
759793
760− if (clear_user(u64_to_user_ptr(attr->ptr_attr.data),
761− attr->ptr_attr.len))
762− return -EFAULT;
794+ if (size < attr->ptr_attr.len) {
795+ if (clear_user(u64_to_user_ptr(attr->ptr_attr.data) + size,
796+ attr->ptr_attr.len - size))
797+ return -EFAULT;
798+ }
763799 return uverbs_copy_to(bundle, idx, from, size);
764800 }
drivers/infiniband/core/uverbs_main.c+17−9
@@ -204,6 +204,9 @@ void ib_uverbs_release_file(struct kref *ref) · 203 unmodified lines
204204 if (atomic_dec_and_test(&file->device->refcount))
205205 ib_uverbs_comp_dev(file->device);
206206
207+ if (file->async_file)
208+ kref_put(&file->async_file->ref,
209+ ib_uverbs_release_async_event_file);
207210 put_device(&file->device->dev);
208211 kfree(file);
209212 }
@@ -690,6 +693,7 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, · 480 unmodified lines
690693
691694 buf += sizeof(hdr);
692695
696+ memset(bundle.attr_present, 0, sizeof(bundle.attr_present));
693697 bundle.ufile = file;
694698 if (!method_elm->is_ex) {
695699 size_t in_len = hdr.in_words * 4 - sizeof(hdr);
@@ -963,11 +967,19 @@ void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile) · 267 unmodified lines
963967
964968 /* Get an arbitrary mm pointer that hasn't been cleaned yet */
965969 mutex_lock(&ufile->umap_lock);
966− if (!list_empty(&ufile->umaps)) {
967− mm = list_first_entry(&ufile->umaps,
968− struct rdma_umap_priv, list)
969− ->vma->vm_mm;
970− mmget(mm);
970+ while (!list_empty(&ufile->umaps)) {
971+ int ret;
972+
973+ priv = list_first_entry(&ufile->umaps,
974+ struct rdma_umap_priv, list);
975+ mm = priv->vma->vm_mm;
976+ ret = mmget_not_zero(mm);
977+ if (!ret) {
978+ list_del_init(&priv->list);
979+ mm = NULL;
980+ continue;
981+ }
982+ break;
971983 }
972984 mutex_unlock(&ufile->umap_lock);
973985 if (!mm)
@@ -1095,10 +1107,6 @@ static int ib_uverbs_close(struct inode *inode, struct file *filp) · 121 unmodified lines
10951107 list_del_init(&file->list);
10961108 mutex_unlock(&file->device->lists_mutex);
10971109
1098− if (file->async_file)
1099− kref_put(&file->async_file->ref,
1100− ib_uverbs_release_async_event_file);
1101−
11021110 kref_put(&file->ref, ib_uverbs_release_file);
11031111
11041112 return 0;
drivers/infiniband/core/uverbs_std_types_device.c+7−1
@@ -168,12 +168,18 @@ void copy_port_attr_to_resp(struct ib_port_attr *attr, · 167 unmodified lines
168168 static int UVERBS_HANDLER(UVERBS_METHOD_QUERY_PORT)(
169169 struct uverbs_attr_bundle *attrs)
170170 {
171− struct ib_device *ib_dev = attrs->ufile->device->ib_dev;
171+ struct ib_device *ib_dev;
172172 struct ib_port_attr attr = {};
173173 struct ib_uverbs_query_port_resp_ex resp = {};
174+ struct ib_ucontext *ucontext;
174175 int ret;
175176 u8 port_num;
176177
178+ ucontext = ib_uverbs_get_ucontext(attrs);
179+ if (IS_ERR(ucontext))
180+ return PTR_ERR(ucontext);
181+ ib_dev = ucontext->device;
182+
177183 /* FIXME: Extend the UAPI_DEF_OBJ_NEEDS_FN stuff.. */
178184 if (!ib_dev->ops.query_port)
179185 return -EOPNOTSUPP;
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c+2−2
@@ -766,8 +766,8 @@ struct bnxt_qplib_rcfw_sbuf *bnxt_qplib_rcfw_alloc_sbuf( · 765 unmodified lines
766766 return NULL;
767767
768768 sbuf->size = size;
769− sbuf->sb = dma_zalloc_coherent(&rcfw->pdev->dev, sbuf->size,
770− &sbuf->dma_addr, GFP_ATOMIC);
769+ sbuf->sb = dma_alloc_coherent(&rcfw->pdev->dev, sbuf->size,
770+ &sbuf->dma_addr, GFP_ATOMIC);
771771 if (!sbuf->sb)
772772 goto bail;
773773
drivers/infiniband/hw/bnxt_re/qplib_res.c+4−4
@@ -105,10 +105,10 @@ static int __alloc_pbl(struct pci_dev *pdev, struct bnxt_qplib_pbl *pbl, · 104 unmodified lines
105105
106106 if (!sghead) {
107107 for (i = 0; i < pages; i++) {
108− pbl->pg_arr[i] = dma_zalloc_coherent(&pdev->dev,
109− pbl->pg_size,
110− &pbl->pg_map_arr[i],
111− GFP_KERNEL);
108+ pbl->pg_arr[i] = dma_alloc_coherent(&pdev->dev,
109+ pbl->pg_size,
110+ &pbl->pg_map_arr[i],
111+ GFP_KERNEL);
112112 if (!pbl->pg_arr[i])
113113 goto fail;
114114 pbl->pg_count++;
drivers/infiniband/hw/cxgb3/cxio_hal.c+3−3
@@ -291,9 +291,9 @@ int cxio_create_qp(struct cxio_rdev *rdev_p, u32 kernel_domain, · 290 unmodified lines
291291 if (!wq->sq)
292292 goto err3;
293293
294− wq->queue = dma_zalloc_coherent(&(rdev_p->rnic_info.pdev->dev),
295− depth * sizeof(union t3_wr),
296− &(wq->dma_addr), GFP_KERNEL);
294+ wq->queue = dma_alloc_coherent(&(rdev_p->rnic_info.pdev->dev),
295+ depth * sizeof(union t3_wr),
296+ &(wq->dma_addr), GFP_KERNEL);
297297 if (!wq->queue)
298298 goto err4;
299299
drivers/infiniband/hw/cxgb4/qp.c+2−3
@@ -2564,9 +2564,8 @@ static int alloc_srq_queue(struct c4iw_srq *srq, struct c4iw_dev_ucontext *uctx, · 2563 unmodified lines
25642564 wq->rqt_abs_idx = (wq->rqt_hwaddr - rdev->lldi.vr->rq.start) >>
25652565 T4_RQT_ENTRY_SHIFT;
25662566
2567− wq->queue = dma_zalloc_coherent(&rdev->lldi.pdev->dev,
2568− wq->memsize, &wq->dma_addr,
2569− GFP_KERNEL);
2567+ wq->queue = dma_alloc_coherent(&rdev->lldi.pdev->dev, wq->memsize,
2568+ &wq->dma_addr, GFP_KERNEL);
25702569 if (!wq->queue)
25712570 goto err_free_rqtpool;
25722571
drivers/infiniband/hw/hfi1/file_ops.c+1−1
@@ -488,7 +488,7 @@ static int hfi1_file_mmap(struct file *fp, struct vm_area_struct *vma) · 487 unmodified lines
488488 vmf = 1;
489489 break;
490490 case STATUS:
491− if (flags & (unsigned long)(VM_WRITE | VM_EXEC)) {
491+ if (flags & VM_WRITE) {
492492 ret = -EPERM;
493493 goto done;
494494 }
drivers/infiniband/hw/hfi1/init.c+15−14
@@ -899,10 +899,10 @@ int hfi1_init(struct hfi1_devdata *dd, int reinit) · 898 unmodified lines
899899 goto done;
900900
901901 /* allocate dummy tail memory for all receive contexts */
902− dd->rcvhdrtail_dummy_kvaddr = dma_zalloc_coherent(
903− &dd->pcidev->dev, sizeof(u64),
904− &dd->rcvhdrtail_dummy_dma,
905− GFP_KERNEL);
902+ dd->rcvhdrtail_dummy_kvaddr = dma_alloc_coherent(&dd->pcidev->dev,
903+ sizeof(u64),
904+ &dd->rcvhdrtail_dummy_dma,
905+ GFP_KERNEL);
906906
907907 if (!dd->rcvhdrtail_dummy_kvaddr) {
908908 dd_dev_err(dd, "cannot allocate dummy tail memory\n");
@@ -1863,9 +1863,9 @@ int hfi1_create_rcvhdrq(struct hfi1_devdata *dd, struct hfi1_ctxtdata *rcd) · 954 unmodified lines
18631863 gfp_flags = GFP_KERNEL;
18641864 else
18651865 gfp_flags = GFP_USER;
1866− rcd->rcvhdrq = dma_zalloc_coherent(
1867− &dd->pcidev->dev, amt, &rcd->rcvhdrq_dma,
1868− gfp_flags | __GFP_COMP);
1866+ rcd->rcvhdrq = dma_alloc_coherent(&dd->pcidev->dev, amt,
1867+ &rcd->rcvhdrq_dma,
1868+ gfp_flags | __GFP_COMP);
18691869
18701870 if (!rcd->rcvhdrq) {
18711871 dd_dev_err(dd,
@@ -1876,9 +1876,10 @@ int hfi1_create_rcvhdrq(struct hfi1_devdata *dd, struct hfi1_ctxtdata *rcd) · 4 unmodified lines
18761876
18771877 if (HFI1_CAP_KGET_MASK(rcd->flags, DMA_RTAIL) ||
18781878 HFI1_CAP_UGET_MASK(rcd->flags, DMA_RTAIL)) {
1879− rcd->rcvhdrtail_kvaddr = dma_zalloc_coherent(
1880− &dd->pcidev->dev, PAGE_SIZE,
1881− &rcd->rcvhdrqtailaddr_dma, gfp_flags);
1879+ rcd->rcvhdrtail_kvaddr = dma_alloc_coherent(&dd->pcidev->dev,
1880+ PAGE_SIZE,
1881+ &rcd->rcvhdrqtailaddr_dma,
1882+ gfp_flags);
18821883 if (!rcd->rcvhdrtail_kvaddr)
18831884 goto bail_free;
18841885 }
@@ -1974,10 +1975,10 @@ int hfi1_setup_eagerbufs(struct hfi1_ctxtdata *rcd) · 89 unmodified lines
19741975 while (alloced_bytes < rcd->egrbufs.size &&
19751976 rcd->egrbufs.alloced < rcd->egrbufs.count) {
19761977 rcd->egrbufs.buffers[idx].addr =
1977− dma_zalloc_coherent(&dd->pcidev->dev,
1978− rcd->egrbufs.rcvtid_size,
1979− &rcd->egrbufs.buffers[idx].dma,
1980− gfp_flags);
1978+ dma_alloc_coherent(&dd->pcidev->dev,
1979+ rcd->egrbufs.rcvtid_size,
1980+ &rcd->egrbufs.buffers[idx].dma,
1981+ gfp_flags);
19811982 if (rcd->egrbufs.buffers[idx].addr) {
19821983 rcd->egrbufs.buffers[idx].len =
19831984 rcd->egrbufs.rcvtid_size;
drivers/infiniband/hw/hfi1/pio.c+4−5
@@ -2098,11 +2098,10 @@ int init_credit_return(struct hfi1_devdata *dd) · 2097 unmodified lines
20982098 int bytes = TXE_NUM_CONTEXTS * sizeof(struct credit_return);
20992099
21002100 set_dev_node(&dd->pcidev->dev, i);
2101− dd->cr_base[i].va = dma_zalloc_coherent(
2102− &dd->pcidev->dev,
2103− bytes,
2104− &dd->cr_base[i].dma,
2105− GFP_KERNEL);
2101+ dd->cr_base[i].va = dma_alloc_coherent(&dd->pcidev->dev,
2102+ bytes,
2103+ &dd->cr_base[i].dma,
2104+ GFP_KERNEL);
21062105 if (!dd->cr_base[i].va) {
21072106 set_dev_node(&dd->pcidev->dev, dd->node);
21082107 dd_dev_err(dd,
drivers/infiniband/hw/hfi1/sdma.c+9−18
@@ -1453,12 +1453,9 @@ int sdma_init(struct hfi1_devdata *dd, u8 port) · 1452 unmodified lines
14531453 timer_setup(&sde->err_progress_check_timer,
14541454 sdma_err_progress_check, 0);
14551455
1456− sde->descq = dma_zalloc_coherent(
1457− &dd->pcidev->dev,
1458− descq_cnt * sizeof(u64[2]),
1459− &sde->descq_phys,
1460− GFP_KERNEL
1461− );
1456+ sde->descq = dma_alloc_coherent(&dd->pcidev->dev,
1457+ descq_cnt * sizeof(u64[2]),
1458+ &sde->descq_phys, GFP_KERNEL);
14621459 if (!sde->descq)
14631460 goto bail;
14641461 sde->tx_ring =
@@ -1471,24 +1468,18 @@ int sdma_init(struct hfi1_devdata *dd, u8 port) · 6 unmodified lines
14711468
14721469 dd->sdma_heads_size = L1_CACHE_BYTES * num_engines;
14731470 /* Allocate memory for DMA of head registers to memory */
1474− dd->sdma_heads_dma = dma_zalloc_coherent(
1475− &dd->pcidev->dev,
1476− dd->sdma_heads_size,
1477− &dd->sdma_heads_phys,
1478− GFP_KERNEL
1479− );
1471+ dd->sdma_heads_dma = dma_alloc_coherent(&dd->pcidev->dev,
1472+ dd->sdma_heads_size,
1473+ &dd->sdma_heads_phys,
1474+ GFP_KERNEL);
14801475 if (!dd->sdma_heads_dma) {
14811476 dd_dev_err(dd, "failed to allocate SendDMA head memory\n");
14821477 goto bail;
14831478 }
14841479
14851480 /* Allocate memory for pad */
1486− dd->sdma_pad_dma = dma_zalloc_coherent(
1487− &dd->pcidev->dev,
1488− sizeof(u32),
1489− &dd->sdma_pad_phys,
1490− GFP_KERNEL
1491− );
1481+ dd->sdma_pad_dma = dma_alloc_coherent(&dd->pcidev->dev, sizeof(u32),
1482+ &dd->sdma_pad_phys, GFP_KERNEL);
14921483 if (!dd->sdma_pad_dma) {
14931484 dd_dev_err(dd, "failed to allocate SendDMA pad memory\n");
14941485 goto bail;
drivers/infiniband/hw/hfi1/ud.c+0−1
@@ -987,7 +987,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) · 986 unmodified lines
987987 opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
988988 wc.ex.imm_data = packet->ohdr->u.ud.imm_data;
989989 wc.wc_flags = IB_WC_WITH_IMM;
990− tlen -= sizeof(u32);
991990 } else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
992991 wc.ex.imm_data = 0;
993992 wc.wc_flags = 0;
drivers/infiniband/hw/hns/hns_roce_alloc.c+6−5
@@ -197,8 +197,8 @@ int hns_roce_buf_alloc(struct hns_roce_dev *hr_dev, u32 size, u32 max_direct, · 196 unmodified lines
197197 buf->npages = 1 << order;
198198 buf->page_shift = page_shift;
199199 /* MTT PA must be recorded in 4k alignment, t is 4k aligned */
200− buf->direct.buf = dma_zalloc_coherent(dev,
201− size, &t, GFP_KERNEL);
200+ buf->direct.buf = dma_alloc_coherent(dev, size, &t,
201+ GFP_KERNEL);
202202 if (!buf->direct.buf)
203203 return -ENOMEM;
204204
@@ -219,9 +219,10 @@ int hns_roce_buf_alloc(struct hns_roce_dev *hr_dev, u32 size, u32 max_direct, · 14 unmodified lines
219219 return -ENOMEM;
220220
221221 for (i = 0; i < buf->nbufs; ++i) {
222− buf->page_list[i].buf = dma_zalloc_coherent(dev,
223− page_size, &t,
224− GFP_KERNEL);
222+ buf->page_list[i].buf = dma_alloc_coherent(dev,
223+ page_size,
224+ &t,
225+ GFP_KERNEL);
225226
226227 if (!buf->page_list[i].buf)
227228 goto err_free;
drivers/infiniband/hw/hns/hns_roce_hw_v2.c+5−5
@@ -5091,7 +5091,7 @@ static int hns_roce_mhop_alloc_eq(struct hns_roce_dev *hr_dev, · 5090 unmodified lines
50915091 eqe_alloc = i * (buf_chk_sz / eq->eqe_size);
50925092 size = (eq->entries - eqe_alloc) * eq->eqe_size;
50935093 }
5094− eq->buf[i] = dma_zalloc_coherent(dev, size,
5094+ eq->buf[i] = dma_alloc_coherent(dev, size,
50955095 &(eq->buf_dma[i]),
50965096 GFP_KERNEL);
50975097 if (!eq->buf[i])
@@ -5126,9 +5126,9 @@ static int hns_roce_mhop_alloc_eq(struct hns_roce_dev *hr_dev, · 28 unmodified lines
51265126 size = (eq->entries - eqe_alloc)
51275127 * eq->eqe_size;
51285128 }
5129− eq->buf[idx] = dma_zalloc_coherent(dev, size,
5130− &(eq->buf_dma[idx]),
5131− GFP_KERNEL);
5129+ eq->buf[idx] = dma_alloc_coherent(dev, size,
5130+ &(eq->buf_dma[idx]),
5131+ GFP_KERNEL);
51325132 if (!eq->buf[idx])
51335133 goto err_dma_alloc_buf;
51345134
@@ -5241,7 +5241,7 @@ static int hns_roce_v2_create_eq(struct hns_roce_dev *hr_dev, · 106 unmodified lines
52415241 goto free_cmd_mbox;
52425242 }
52435243
5244− eq->buf_list->buf = dma_zalloc_coherent(dev, buf_chk_sz,
5244+ eq->buf_list->buf = dma_alloc_coherent(dev, buf_chk_sz,
52455245 &(eq->buf_list->map),
52465246 GFP_KERNEL);
52475247 if (!eq->buf_list->buf) {
drivers/infiniband/hw/hns/hns_roce_srq.c+8−2
@@ -210,6 +210,7 @@ struct ib_srq *hns_roce_create_srq(struct ib_pd *pd, · 209 unmodified lines
210210 struct ib_udata *udata)
211211 {
212212 struct hns_roce_dev *hr_dev = to_hr_dev(pd->device);
213+ struct hns_roce_ib_create_srq_resp resp = {};
213214 struct hns_roce_srq *srq;
214215 int srq_desc_size;
215216 int srq_buf_size;
@@ -378,16 +379,21 @@ struct ib_srq *hns_roce_create_srq(struct ib_pd *pd, · 162 unmodified lines
378379
379380 srq->event = hns_roce_ib_srq_event;
380381 srq->ibsrq.ext.xrc.srq_num = srq->srqn;
382+ resp.srqn = srq->srqn;
381383
382384 if (udata) {
383− if (ib_copy_to_udata(udata, &srq->srqn, sizeof(__u32))) {
385+ if (ib_copy_to_udata(udata, &resp,
386+ min(udata->outlen, sizeof(resp)))) {
384387 ret = -EFAULT;
385− goto err_wrid;
388+ goto err_srqc_alloc;
386389 }
387390 }
388391
389392 return &srq->ibsrq;
390393
394+err_srqc_alloc:
395+ hns_roce_srq_free(hr_dev, srq);
396+
391397 err_wrid:
392398 kvfree(srq->wrid);
393399
drivers/infiniband/hw/i40iw/i40iw_utils.c+2−2
@@ -745,8 +745,8 @@ enum i40iw_status_code i40iw_allocate_dma_mem(struct i40iw_hw *hw, · 744 unmodified lines
745745 if (!mem)
746746 return I40IW_ERR_PARAM;
747747 mem->size = ALIGN(size, alignment);
748− mem->va = dma_zalloc_coherent(&pcidev->dev, mem->size,
749− (dma_addr_t *)&mem->pa, GFP_KERNEL);
748+ mem->va = dma_alloc_coherent(&pcidev->dev, mem->size,
749+ (dma_addr_t *)&mem->pa, GFP_KERNEL);
750750 if (!mem->va)
751751 return I40IW_ERR_NO_MEMORY;
752752 return 0;
drivers/infiniband/hw/mlx4/mad.c+3−3
@@ -1411,7 +1411,7 @@ int mlx4_ib_send_to_wire(struct mlx4_ib_dev *dev, int slave, u8 port, · 1410 unmodified lines
14111411
14121412 sqp_mad = (struct mlx4_mad_snd_buf *) (sqp->tx_ring[wire_tx_ix].buf.addr);
14131413 if (sqp->tx_ring[wire_tx_ix].ah)
1414− rdma_destroy_ah(sqp->tx_ring[wire_tx_ix].ah, 0);
1414+ mlx4_ib_destroy_ah(sqp->tx_ring[wire_tx_ix].ah, 0);
14151415 sqp->tx_ring[wire_tx_ix].ah = ah;
14161416 ib_dma_sync_single_for_cpu(&dev->ib_dev,
14171417 sqp->tx_ring[wire_tx_ix].buf.map,
@@ -1902,7 +1902,7 @@ static void mlx4_ib_sqp_comp_worker(struct work_struct *work) · 484 unmodified lines
19021902 if (wc.status == IB_WC_SUCCESS) {
19031903 switch (wc.opcode) {
19041904 case IB_WC_SEND:
1905− rdma_destroy_ah(sqp->tx_ring[wc.wr_id &
1905+ mlx4_ib_destroy_ah(sqp->tx_ring[wc.wr_id &
19061906 (MLX4_NUM_TUNNEL_BUFS - 1)].ah, 0);
19071907 sqp->tx_ring[wc.wr_id & (MLX4_NUM_TUNNEL_BUFS - 1)].ah
19081908 = NULL;
@@ -1931,7 +1931,7 @@ static void mlx4_ib_sqp_comp_worker(struct work_struct *work) · 22 unmodified lines
19311931 " status = %d, wrid = 0x%llx\n",
19321932 ctx->slave, wc.status, wc.wr_id);
19331933 if (!MLX4_TUN_IS_RECV(wc.wr_id)) {
1934− rdma_destroy_ah(sqp->tx_ring[wc.wr_id &
1934+ mlx4_ib_destroy_ah(sqp->tx_ring[wc.wr_id &
19351935 (MLX4_NUM_TUNNEL_BUFS - 1)].ah, 0);
19361936 sqp->tx_ring[wc.wr_id & (MLX4_NUM_TUNNEL_BUFS - 1)].ah
19371937 = NULL;
drivers/infiniband/hw/mlx5/flow.c+1−2
@@ -630,8 +630,7 @@ const struct uapi_definition mlx5_ib_flow_defs[] = { · 629 unmodified lines
630630 UAPI_DEF_IS_OBJ_SUPPORTED(flow_is_supported)),
631631 UAPI_DEF_CHAIN_OBJ_TREE(
632632 UVERBS_OBJECT_FLOW,
633− &mlx5_ib_fs,
634− UAPI_DEF_IS_OBJ_SUPPORTED(flow_is_supported)),
633+ &mlx5_ib_fs),
635634 UAPI_DEF_CHAIN_OBJ_TREE(UVERBS_OBJECT_FLOW_ACTION,
636635 &mlx5_ib_flow_actions),
637636 {},
drivers/infiniband/hw/mlx5/odp.c+5−5
@@ -1595,10 +1595,12 @@ static void mlx5_ib_prefetch_mr_work(struct work_struct *work) · 1594 unmodified lines
15951595 struct prefetch_mr_work *w =
15961596 container_of(work, struct prefetch_mr_work, work);
15971597
1598− if (w->dev->ib_dev.reg_state == IB_DEV_REGISTERED)
1598+ if (ib_device_try_get(&w->dev->ib_dev)) {
15991599 mlx5_ib_prefetch_sg_list(w->dev, w->pf_flags, w->sg_list,
16001600 w->num_sge);
1601−
1601+ ib_device_put(&w->dev->ib_dev);
1602+ }
1603+ put_device(&w->dev->ib_dev.dev);
16021604 kfree(w);
16031605 }
16041606
@@ -1617,15 +1619,13 @@ int mlx5_ib_advise_mr_prefetch(struct ib_pd *pd, · 12 unmodified lines
16171619 return mlx5_ib_prefetch_sg_list(dev, pf_flags, sg_list,
16181620 num_sge);
16191621
1620− if (dev->ib_dev.reg_state != IB_DEV_REGISTERED)
1621− return -ENODEV;
1622−
16231622 work = kvzalloc(struct_size(work, sg_list, num_sge), GFP_KERNEL);
16241623 if (!work)
16251624 return -ENOMEM;
16261625
16271626 memcpy(work->sg_list, sg_list, num_sge * sizeof(struct ib_sge));
16281627
1628+ get_device(&dev->ib_dev.dev);
16291629 work->dev = dev;
16301630 work->pf_flags = pf_flags;
16311631 work->num_sge = num_sge;
drivers/infiniband/hw/mlx5/qp.c+9−7
@@ -1912,14 +1912,16 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, · 1911 unmodified lines
19121912 }
19131913
19141914 if (!check_flags_mask(ucmd.flags,
1915+ MLX5_QP_FLAG_ALLOW_SCATTER_CQE |
1916+ MLX5_QP_FLAG_BFREG_INDEX |
1917+ MLX5_QP_FLAG_PACKET_BASED_CREDIT_MODE |
1918+ MLX5_QP_FLAG_SCATTER_CQE |
19151919 MLX5_QP_FLAG_SIGNATURE |
1916− MLX5_QP_FLAG_SCATTER_CQE |
1917− MLX5_QP_FLAG_TUNNEL_OFFLOADS |
1918− MLX5_QP_FLAG_BFREG_INDEX |
1919− MLX5_QP_FLAG_TYPE_DCT |
1920− MLX5_QP_FLAG_TYPE_DCI |
1921− MLX5_QP_FLAG_ALLOW_SCATTER_CQE |
1922− MLX5_QP_FLAG_PACKET_BASED_CREDIT_MODE))
1920+ MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_MC |
1921+ MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_UC |
1922+ MLX5_QP_FLAG_TUNNEL_OFFLOADS |
1923+ MLX5_QP_FLAG_TYPE_DCI |
1924+ MLX5_QP_FLAG_TYPE_DCT))
19231925 return -EINVAL;
19241926
19251927 err = get_qp_user_index(to_mucontext(pd->uobject->context),
drivers/infiniband/hw/mthca/mthca_memfree.c+3−2
@@ -623,8 +623,9 @@ int mthca_alloc_db(struct mthca_dev *dev, enum mthca_db_type type, · 622 unmodified lines
623623 page = dev->db_tab->page + end;
624624
625625 alloc:
626− page->db_rec = dma_zalloc_coherent(&dev->pdev->dev, MTHCA_ICM_PAGE_SIZE,
627− &page->mapping, GFP_KERNEL);
626+ page->db_rec = dma_alloc_coherent(&dev->pdev->dev,
627+ MTHCA_ICM_PAGE_SIZE, &page->mapping,
628+ GFP_KERNEL);
628629 if (!page->db_rec) {
629630 ret = -ENOMEM;
630631 goto out;
drivers/infiniband/hw/mthca/mthca_provider.c+2−2
@@ -534,7 +534,7 @@ static struct ib_qp *mthca_create_qp(struct ib_pd *pd, · 533 unmodified lines
534534 {
535535 struct mthca_ucontext *context;
536536
537− qp = kmalloc(sizeof *qp, GFP_KERNEL);
537+ qp = kzalloc(sizeof(*qp), GFP_KERNEL);
538538 if (!qp)
539539 return ERR_PTR(-ENOMEM);
540540
@@ -600,7 +600,7 @@ static struct ib_qp *mthca_create_qp(struct ib_pd *pd, · 59 unmodified lines
600600 if (udata)
601601 return ERR_PTR(-EINVAL);
602602
603− qp = kmalloc(sizeof (struct mthca_sqp), GFP_KERNEL);
603+ qp = kzalloc(sizeof(struct mthca_sqp), GFP_KERNEL);
604604 if (!qp)
605605 return ERR_PTR(-ENOMEM);
606606
drivers/infiniband/hw/ocrdma/ocrdma_hw.c+7−7
@@ -380,8 +380,8 @@ static int ocrdma_alloc_q(struct ocrdma_dev *dev, · 379 unmodified lines
380380 q->len = len;
381381 q->entry_size = entry_size;
382382 q->size = len * entry_size;
383− q->va = dma_zalloc_coherent(&dev->nic_info.pdev->dev, q->size,
384− &q->dma, GFP_KERNEL);
383+ q->va = dma_alloc_coherent(&dev->nic_info.pdev->dev, q->size, &q->dma,
384+ GFP_KERNEL);
385385 if (!q->va)
386386 return -ENOMEM;
387387 return 0;
@@ -1819,7 +1819,7 @@ int ocrdma_mbx_create_cq(struct ocrdma_dev *dev, struct ocrdma_cq *cq, · 1431 unmodified lines
18191819 return -ENOMEM;
18201820 ocrdma_init_mch(&cmd->cmd.req, OCRDMA_CMD_CREATE_CQ,
18211821 OCRDMA_SUBSYS_COMMON, sizeof(*cmd));
1822− cq->va = dma_zalloc_coherent(&pdev->dev, cq->len, &cq->pa, GFP_KERNEL);
1822+ cq->va = dma_alloc_coherent(&pdev->dev, cq->len, &cq->pa, GFP_KERNEL);
18231823 if (!cq->va) {
18241824 status = -ENOMEM;
18251825 goto mem_err;
@@ -2209,7 +2209,7 @@ static int ocrdma_set_create_qp_sq_cmd(struct ocrdma_create_qp_req *cmd, · 383 unmodified lines
22092209 qp->sq.max_cnt = max_wqe_allocated;
22102210 len = (hw_pages * hw_page_size);
22112211
2212− qp->sq.va = dma_zalloc_coherent(&pdev->dev, len, &pa, GFP_KERNEL);
2212+ qp->sq.va = dma_alloc_coherent(&pdev->dev, len, &pa, GFP_KERNEL);
22132213 if (!qp->sq.va)
22142214 return -EINVAL;
22152215 qp->sq.len = len;
@@ -2259,7 +2259,7 @@ static int ocrdma_set_create_qp_rq_cmd(struct ocrdma_create_qp_req *cmd, · 43 unmodified lines
22592259 qp->rq.max_cnt = max_rqe_allocated;
22602260 len = (hw_pages * hw_page_size);
22612261
2262− qp->rq.va = dma_zalloc_coherent(&pdev->dev, len, &pa, GFP_KERNEL);
2262+ qp->rq.va = dma_alloc_coherent(&pdev->dev, len, &pa, GFP_KERNEL);
22632263 if (!qp->rq.va)
22642264 return -ENOMEM;
22652265 qp->rq.pa = pa;
@@ -2315,8 +2315,8 @@ static int ocrdma_set_create_qp_ird_cmd(struct ocrdma_create_qp_req *cmd, · 49 unmodified lines
23152315 if (dev->attr.ird == 0)
23162316 return 0;
23172317
2318− qp->ird_q_va = dma_zalloc_coherent(&pdev->dev, ird_q_len, &pa,
2319− GFP_KERNEL);
2318+ qp->ird_q_va = dma_alloc_coherent(&pdev->dev, ird_q_len, &pa,
2319+ GFP_KERNEL);
23202320 if (!qp->ird_q_va)
23212321 return -ENOMEM;
23222322 ocrdma_build_q_pages(&cmd->ird_addr[0], dev->attr.num_ird_pages,
drivers/infiniband/hw/ocrdma/ocrdma_stats.c+2−2
@@ -73,8 +73,8 @@ bool ocrdma_alloc_stats_resources(struct ocrdma_dev *dev) · 72 unmodified lines
7373 mem->size = max_t(u32, sizeof(struct ocrdma_rdma_stats_req),
7474 sizeof(struct ocrdma_rdma_stats_resp));
7575
76− mem->va = dma_zalloc_coherent(&dev->nic_info.pdev->dev, mem->size,
77− &mem->pa, GFP_KERNEL);
76+ mem->va = dma_alloc_coherent(&dev->nic_info.pdev->dev, mem->size,
77+ &mem->pa, GFP_KERNEL);
7878 if (!mem->va) {
7979 pr_err("%s: stats mbox allocation failed\n", __func__);
8080 return false;
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c+3−3
@@ -504,8 +504,8 @@ struct ib_ucontext *ocrdma_alloc_ucontext(struct ib_device *ibdev, · 503 unmodified lines
504504 INIT_LIST_HEAD(&ctx->mm_head);
505505 mutex_init(&ctx->mm_list_lock);
506506
507− ctx->ah_tbl.va = dma_zalloc_coherent(&pdev->dev, map_len,
508− &ctx->ah_tbl.pa, GFP_KERNEL);
507+ ctx->ah_tbl.va = dma_alloc_coherent(&pdev->dev, map_len,
508+ &ctx->ah_tbl.pa, GFP_KERNEL);
509509 if (!ctx->ah_tbl.va) {
510510 kfree(ctx);
511511 return ERR_PTR(-ENOMEM);
@@ -838,7 +838,7 @@ static int ocrdma_build_pbl_tbl(struct ocrdma_dev *dev, struct ocrdma_hw_mr *mr) · 326 unmodified lines
838838 return -ENOMEM;
839839
840840 for (i = 0; i < mr->num_pbls; i++) {
841− va = dma_zalloc_coherent(&pdev->dev, dma_len, &pa, GFP_KERNEL);
841+ va = dma_alloc_coherent(&pdev->dev, dma_len, &pa, GFP_KERNEL);
842842 if (!va) {
843843 ocrdma_free_mr_pbl_tbl(dev, mr);
844844 status = -ENOMEM;
drivers/infiniband/hw/qedr/verbs.c+2−2
@@ -556,8 +556,8 @@ static struct qedr_pbl *qedr_alloc_pbl_tbl(struct qedr_dev *dev, · 555 unmodified lines
556556 return ERR_PTR(-ENOMEM);
557557
558558 for (i = 0; i < pbl_info->num_pbls; i++) {
559− va = dma_zalloc_coherent(&pdev->dev, pbl_info->pbl_size,
560− &pa, flags);
559+ va = dma_alloc_coherent(&pdev->dev, pbl_info->pbl_size, &pa,
560+ flags);
561561 if (!va)
562562 goto err;
563563
drivers/infiniband/hw/qib/qib_ud.c+0−1
@@ -512,7 +512,6 @@ void qib_ud_rcv(struct qib_ibport *ibp, struct ib_header *hdr, · 511 unmodified lines
512512 opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
513513 wc.ex.imm_data = ohdr->u.ud.imm_data;
514514 wc.wc_flags = IB_WC_WITH_IMM;
515− tlen -= sizeof(u32);
516515 } else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
517516 wc.ex.imm_data = 0;
518517 wc.wc_flags = 0;
drivers/infiniband/hw/vmw_pvrdma/pvrdma.h+34−1
@@ -427,7 +427,40 @@ static inline enum ib_qp_state pvrdma_qp_state_to_ib(enum pvrdma_qp_state state) · 426 unmodified lines
427427
428428 static inline enum pvrdma_wr_opcode ib_wr_opcode_to_pvrdma(enum ib_wr_opcode op)
429429 {
430− return (enum pvrdma_wr_opcode)op;
430+ switch (op) {
431+ case IB_WR_RDMA_WRITE:
432+ return PVRDMA_WR_RDMA_WRITE;
433+ case IB_WR_RDMA_WRITE_WITH_IMM:
434+ return PVRDMA_WR_RDMA_WRITE_WITH_IMM;
435+ case IB_WR_SEND:
436+ return PVRDMA_WR_SEND;
437+ case IB_WR_SEND_WITH_IMM:
438+ return PVRDMA_WR_SEND_WITH_IMM;
439+ case IB_WR_RDMA_READ:
440+ return PVRDMA_WR_RDMA_READ;
441+ case IB_WR_ATOMIC_CMP_AND_SWP:
442+ return PVRDMA_WR_ATOMIC_CMP_AND_SWP;
443+ case IB_WR_ATOMIC_FETCH_AND_ADD:
444+ return PVRDMA_WR_ATOMIC_FETCH_AND_ADD;
445+ case IB_WR_LSO:
446+ return PVRDMA_WR_LSO;
447+ case IB_WR_SEND_WITH_INV:
448+ return PVRDMA_WR_SEND_WITH_INV;
449+ case IB_WR_RDMA_READ_WITH_INV:
450+ return PVRDMA_WR_RDMA_READ_WITH_INV;
451+ case IB_WR_LOCAL_INV:
452+ return PVRDMA_WR_LOCAL_INV;
453+ case IB_WR_REG_MR:
454+ return PVRDMA_WR_FAST_REG_MR;
455+ case IB_WR_MASKED_ATOMIC_CMP_AND_SWP:
456+ return PVRDMA_WR_MASKED_ATOMIC_CMP_AND_SWP;
457+ case IB_WR_MASKED_ATOMIC_FETCH_AND_ADD:
458+ return PVRDMA_WR_MASKED_ATOMIC_FETCH_AND_ADD;
459+ case IB_WR_REG_SIG_MR:
460+ return PVRDMA_WR_REG_SIG_MR;
461+ default:
462+ return PVRDMA_WR_ERROR;
463+ }
431464 }
432465
433466 static inline enum ib_wc_status pvrdma_wc_status_to_ib(
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c+2−2
@@ -890,8 +890,8 @@ static int pvrdma_pci_probe(struct pci_dev *pdev, · 889 unmodified lines
890890 dev_info(&pdev->dev, "device version %d, driver version %d\n",
891891 dev->dsr_version, PVRDMA_VERSION);
892892
893− dev->dsr = dma_zalloc_coherent(&pdev->dev, sizeof(*dev->dsr),
894− &dev->dsrbase, GFP_KERNEL);
893+ dev->dsr = dma_alloc_coherent(&pdev->dev, sizeof(*dev->dsr),
894+ &dev->dsrbase, GFP_KERNEL);
895895 if (!dev->dsr) {
896896 dev_err(&pdev->dev, "failed to allocate shared region\n");
897897 ret = -ENOMEM;
drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c+6−0
@@ -721,6 +721,12 @@ int pvrdma_post_send(struct ib_qp *ibqp, const struct ib_send_wr *wr, · 720 unmodified lines
721721 wr->opcode == IB_WR_RDMA_WRITE_WITH_IMM)
722722 wqe_hdr->ex.imm_data = wr->ex.imm_data;
723723
724+ if (unlikely(wqe_hdr->opcode == PVRDMA_WR_ERROR)) {
725+ *bad_wr = wr;
726+ ret = -EINVAL;
727+ goto out;
728+ }
729+
724730 switch (qp->ibqp.qp_type) {
725731 case IB_QPT_GSI:
726732 case IB_QPT_UD:
drivers/infiniband/sw/rdmavt/qp.c+6−1
@@ -2910,6 +2910,8 @@ send: · 2909 unmodified lines
29102910 goto op_err;
29112911 if (!ret)
29122912 goto rnr_nak;
2913+ if (wqe->length > qp->r_len)
2914+ goto inv_err;
29132915 break;
29142916
29152917 case IB_WR_RDMA_WRITE_WITH_IMM:
@@ -3078,7 +3080,10 @@ op_err: · 162 unmodified lines
30783080 goto err;
30793081
30803082 inv_err:
3081− send_status = IB_WC_REM_INV_REQ_ERR;
3083+ send_status =
3084+ sqp->ibqp.qp_type == IB_QPT_RC ?
3085+ IB_WC_REM_INV_REQ_ERR :
3086+ IB_WC_SUCCESS;
30823087 wc.status = IB_WC_LOC_QP_OP_ERR;
30833088 goto err;
30843089
drivers/infiniband/ulp/ipoib/ipoib.h+0−1
@@ -248,7 +248,6 @@ struct ipoib_cm_tx { · 247 unmodified lines
248248 struct list_head list;
249249 struct net_device *dev;
250250 struct ipoib_neigh *neigh;
251− struct ipoib_path *path;
252251 struct ipoib_tx_buf *tx_ring;
253252 unsigned int tx_head;
254253 unsigned int tx_tail;
drivers/infiniband/ulp/ipoib/ipoib_cm.c+1−2
@@ -1312,7 +1312,6 @@ struct ipoib_cm_tx *ipoib_cm_create_tx(struct net_device *dev, struct ipoib_path · 1311 unmodified lines
13121312
13131313 neigh->cm = tx;
13141314 tx->neigh = neigh;
1315− tx->path = path;
13161315 tx->dev = dev;
13171316 list_add(&tx->list, &priv->cm.start_list);
13181317 set_bit(IPOIB_FLAG_INITIALIZED, &tx->flags);
@@ -1371,7 +1370,7 @@ static void ipoib_cm_tx_start(struct work_struct *work) · 52 unmodified lines
13711370 neigh->daddr + QPN_AND_OPTIONS_OFFSET);
13721371 goto free_neigh;
13731372 }
1374− memcpy(&pathrec, &p->path->pathrec, sizeof(pathrec));
1373+ memcpy(&pathrec, &path->pathrec, sizeof(pathrec));
13751374
13761375 spin_unlock_irqrestore(&priv->lock, flags);
13771376 netif_tx_unlock_bh(dev);
drivers/input/joystick/xpad.c+3−0
@@ -252,6 +252,8 @@ static const struct xpad_device { · 251 unmodified lines
252252 { 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX },
253253 { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX },
254254 { 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", 0, XTYPE_XBOX },
255+ { 0x1038, 0x1430, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 },
256+ { 0x1038, 0x1431, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 },
255257 { 0x11c9, 0x55f0, "Nacon GC-100XF", 0, XTYPE_XBOX360 },
256258 { 0x12ab, 0x0004, "Honey Bee Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
257259 { 0x12ab, 0x0301, "PDP AFTERGLOW AX.1", 0, XTYPE_XBOX360 },
@@ -428,6 +430,7 @@ static const struct usb_device_id xpad_table[] = { · 170 unmodified lines
428430 XPAD_XBOXONE_VENDOR(0x0e6f), /* 0x0e6f X-Box One controllers */
429431 XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */
430432 XPAD_XBOXONE_VENDOR(0x0f0d), /* Hori Controllers */
433+ XPAD_XBOX360_VENDOR(0x1038), /* SteelSeries Controllers */
431434 XPAD_XBOX360_VENDOR(0x11c9), /* Nacon GC100XF */
432435 XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */
433436 XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */
drivers/input/misc/uinput.c+3−2
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 #include <linux/init.h>
4040 #include <linux/fs.h>
4141 #include <linux/miscdevice.h>
42+#include <linux/overflow.h>
4243 #include <linux/input/mt.h>
4344 #include "../input-compat.h"
4445
@@ -405,7 +406,7 @@ static int uinput_open(struct inode *inode, struct file *file) · 360 unmodified lines
405406 static int uinput_validate_absinfo(struct input_dev *dev, unsigned int code,
406407 const struct input_absinfo *abs)
407408 {
408− int min, max;
409+ int min, max, range;
409410
410411 min = abs->minimum;
411412 max = abs->maximum;
@@ -417,7 +418,7 @@ static int uinput_validate_absinfo(struct input_dev *dev, unsigned int code, · 5 unmodified lines
417418 return -EINVAL;
418419 }
419420
420− if (abs->flat > max - min) {
421+ if (!check_sub_overflow(max, min, &range) && abs->flat > range) {
421422 printk(KERN_DEBUG
422423 "%s: abs_flat #%02x out of range: %d (min:%d/max:%d)\n",
423424 UINPUT_NAME, code, abs->flat, min, max);
drivers/input/serio/olpc_apsp.c+2−15
@@ -23,7 +23,6 @@ · 22 unmodified lines
2323 #include <linux/of.h>
2424 #include <linux/slab.h>
2525 #include <linux/delay.h>
26−#include <linux/clk.h>
2726
2827 /*
2928 * The OLPC XO-1.75 and XO-4 laptops do not have a hardware PS/2 controller.
@@ -75,7 +74,6 @@ struct olpc_apsp { · 45 unmodified lines
7574 struct serio *kbio;
7675 struct serio *padio;
7776 void __iomem *base;
78− struct clk *clk;
7977 int open_count;
8078 int irq;
8179 };
@@ -148,17 +146,11 @@ static int olpc_apsp_open(struct serio *port) · 66 unmodified lines
148146 struct olpc_apsp *priv = port->port_data;
149147 unsigned int tmp;
150148 unsigned long l;
151− int error;
152149
153150 if (priv->open_count++ == 0) {
154− error = clk_prepare_enable(priv->clk);
155− if (error)
156− return error;
157−
158151 l = readl(priv->base + COMMAND_FIFO_STATUS);
159152 if (!(l & CMD_STS_MASK)) {
160153 dev_err(priv->dev, "SP cannot accept commands.\n");
161− clk_disable_unprepare(priv->clk);
162154 return -EIO;
163155 }
164156
@@ -179,8 +171,6 @@ static void olpc_apsp_close(struct serio *port) · 14 unmodified lines
179171 /* Disable interrupt 0 */
180172 tmp = readl(priv->base + PJ_INTERRUPT_MASK);
181173 writel(tmp | INT_0, priv->base + PJ_INTERRUPT_MASK);
182−
183− clk_disable_unprepare(priv->clk);
184174 }
185175 }
186176
@@ -195,6 +185,8 @@ static int olpc_apsp_probe(struct platform_device *pdev) · 8 unmodified lines
195185 if (!priv)
196186 return -ENOMEM;
197187
188+ priv->dev = &pdev->dev;
189+
198190 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
199191 priv->base = devm_ioremap_resource(&pdev->dev, res);
200192 if (IS_ERR(priv->base)) {
@@ -206,10 +198,6 @@ static int olpc_apsp_probe(struct platform_device *pdev) · 5 unmodified lines
206198 if (priv->irq < 0)
207199 return priv->irq;
208200
209− priv->clk = devm_clk_get(&pdev->dev, "sp");
210− if (IS_ERR(priv->clk))
211− return PTR_ERR(priv->clk);
212−
213201 /* KEYBOARD */
214202 kb_serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
215203 if (!kb_serio)
@@ -248,7 +236,6 @@ static int olpc_apsp_probe(struct platform_device *pdev) · 32 unmodified lines
248236 goto err_irq;
249237 }
250238
251− priv->dev = &pdev->dev;
252239 device_init_wakeup(priv->dev, 1);
253240 platform_set_drvdata(pdev, priv);
254241
drivers/input/touchscreen/Kconfig+1−1
@@ -698,7 +698,7 @@ config TOUCHSCREEN_EDT_FT5X06 · 697 unmodified lines
698698
699699 config TOUCHSCREEN_RASPBERRYPI_FW
700700 tristate "Raspberry Pi's firmware base touch screen support"
701− depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST
701+ depends on RASPBERRYPI_FIRMWARE || (RASPBERRYPI_FIRMWARE=n && COMPILE_TEST)
702702 help
703703 Say Y here if you have the official Raspberry Pi 7 inch screen on
704704 your system.
drivers/input/touchscreen/raspberrypi-ts.c+2−2
@@ -147,8 +147,8 @@ static int rpi_ts_probe(struct platform_device *pdev) · 146 unmodified lines
147147 return -ENOMEM;
148148 ts->pdev = pdev;
149149
150− ts->fw_regs_va = dma_zalloc_coherent(dev, PAGE_SIZE, &ts->fw_regs_phys,
151− GFP_KERNEL);
150+ ts->fw_regs_va = dma_alloc_coherent(dev, PAGE_SIZE, &ts->fw_regs_phys,
151+ GFP_KERNEL);
152152 if (!ts->fw_regs_va) {
153153 dev_err(dev, "failed to dma_alloc_coherent\n");
154154 return -ENOMEM;
drivers/iommu/amd_iommu.c+13−6
@@ -1991,16 +1991,13 @@ static void do_attach(struct iommu_dev_data *dev_data, · 1990 unmodified lines
19911991
19921992 static void do_detach(struct iommu_dev_data *dev_data)
19931993 {
1994+ struct protection_domain *domain = dev_data->domain;
19941995 struct amd_iommu *iommu;
19951996 u16 alias;
19961997
19971998 iommu = amd_iommu_rlookup_table[dev_data->devid];
19981999 alias = dev_data->alias;
19992000
2000− /* decrease reference counters */
2001− dev_data->domain->dev_iommu[iommu->index] -= 1;
2002− dev_data->domain->dev_cnt -= 1;
2003−
20042001 /* Update data structures */
20052002 dev_data->domain = NULL;
20062003 list_del(&dev_data->list);
@@ -2010,6 +2007,16 @@ static void do_detach(struct iommu_dev_data *dev_data) · 3 unmodified lines
20102007
20112008 /* Flush the DTE entry */
20122009 device_flush_dte(dev_data);
2010+
2011+ /* Flush IOTLB */
2012+ domain_flush_tlb_pde(domain);
2013+
2014+ /* Wait for the flushes to finish */
2015+ domain_flush_complete(domain);
2016+
2017+ /* decrease reference counters - needs to happen after the flushes */
2018+ domain->dev_iommu[iommu->index] -= 1;
2019+ domain->dev_cnt -= 1;
20132020 }
20142021
20152022 /*
@@ -2617,13 +2624,13 @@ out_unmap: · 601 unmodified lines
26172624 bus_addr = address + s->dma_address + (j << PAGE_SHIFT);
26182625 iommu_unmap_page(domain, bus_addr, PAGE_SIZE);
26192626
2620− if (--mapped_pages)
2627+ if (--mapped_pages == 0)
26212628 goto out_free_iova;
26222629 }
26232630 }
26242631
26252632 out_free_iova:
2626− free_iova_fast(&dma_dom->iovad, address, npages);
2633+ free_iova_fast(&dma_dom->iovad, address >> PAGE_SHIFT, npages);
26272634
26282635 out_err:
26292636 return 0;
drivers/iommu/intel-iommu.c+5−5
@@ -363,7 +363,7 @@ static int dmar_map_gfx = 1; · 362 unmodified lines
363363 static int dmar_forcedac;
364364 static int intel_iommu_strict;
365365 static int intel_iommu_superpage = 1;
366−static int intel_iommu_sm = 1;
366+static int intel_iommu_sm;
367367 static int iommu_identity_mapping;
368368
369369 #define IDENTMAP_ALL 1
@@ -456,9 +456,9 @@ static int __init intel_iommu_setup(char *str) · 86 unmodified lines
456456 } else if (!strncmp(str, "sp_off", 6)) {
457457 pr_info("Disable supported super page\n");
458458 intel_iommu_superpage = 0;
459− } else if (!strncmp(str, "sm_off", 6)) {
460− pr_info("Intel-IOMMU: disable scalable mode support\n");
461− intel_iommu_sm = 0;
459+ } else if (!strncmp(str, "sm_on", 5)) {
460+ pr_info("Intel-IOMMU: scalable mode supported\n");
461+ intel_iommu_sm = 1;
462462 } else if (!strncmp(str, "tboot_noforce", 13)) {
463463 printk(KERN_INFO
464464 "Intel-IOMMU: not forcing on after tboot. This could expose security risk for tboot\n");
@@ -5294,7 +5294,7 @@ static void intel_iommu_put_resv_regions(struct device *dev, · 4829 unmodified lines
52945294 struct iommu_resv_region *entry, *next;
52955295
52965296 list_for_each_entry_safe(entry, next, head, list) {
5297− if (entry->type == IOMMU_RESV_RESERVED)
5297+ if (entry->type == IOMMU_RESV_MSI)
52985298 kfree(entry);
52995299 }
53005300 }
drivers/iommu/mtk_iommu_v1.c+6−3
@@ -232,9 +232,8 @@ static int mtk_iommu_domain_finalise(struct mtk_iommu_data *data) · 231 unmodified lines
232232
233233 spin_lock_init(&dom->pgtlock);
234234
235− dom->pgt_va = dma_zalloc_coherent(data->dev,
236− M2701_IOMMU_PGT_SIZE,
237− &dom->pgt_pa, GFP_KERNEL);
235+ dom->pgt_va = dma_alloc_coherent(data->dev, M2701_IOMMU_PGT_SIZE,
236+ &dom->pgt_pa, GFP_KERNEL);
238237 if (!dom->pgt_va)
239238 return -ENOMEM;
240239
@@ -442,6 +441,10 @@ static int mtk_iommu_add_device(struct device *dev) · 201 unmodified lines
442441 iommu_spec.args_count = count;
443442
444443 mtk_iommu_create_mapping(dev, &iommu_spec);
444+
445+ /* dev->iommu_fwspec might have changed */
446+ fwspec = dev_iommu_fwspec_get(dev);
447+
445448 of_node_put(iommu_spec.np);
446449 }
447450
drivers/iommu/of_iommu.c+1−1
@@ -224,7 +224,7 @@ const struct iommu_ops *of_iommu_configure(struct device *dev, · 223 unmodified lines
224224 * If we have reason to believe the IOMMU driver missed the initial
225225 * probe for dev, replay it to get things in order.
226226 */
227− if (dev->bus && !device_iommu_mapped(dev))
227+ if (!err && dev->bus && !device_iommu_mapped(dev))
228228 err = iommu_probe_device(dev);
229229
230230 /* Ignore all other errors apart from EPROBE_DEFER */
drivers/irqchip/irq-csky-apb-intc.c+42−35
@@ -95,7 +95,7 @@ static inline void setup_irq_channel(u32 magic, void __iomem *reg_addr) · 94 unmodified lines
9595
9696 /* Setup 64 channel slots */
9797 for (i = 0; i < INTC_IRQS; i += 4)
98− writel_relaxed(build_channel_val(i, magic), reg_addr + i);
98+ writel(build_channel_val(i, magic), reg_addr + i);
9999 }
100100
101101 static int __init
@@ -135,16 +135,10 @@ ck_intc_init_comm(struct device_node *node, struct device_node *parent) · 33 unmodified lines
135135 static inline bool handle_irq_perbit(struct pt_regs *regs, u32 hwirq,
136136 u32 irq_base)
137137 {
138− u32 irq;
139−
140138 if (hwirq == 0)
141139 return 0;
142140
143− while (hwirq) {
144− irq = __ffs(hwirq);
145− hwirq &= ~BIT(irq);
146− handle_domain_irq(root_domain, irq_base + irq, regs);
147− }
141+ handle_domain_irq(root_domain, irq_base + __fls(hwirq), regs);
148142
149143 return 1;
150144 }
@@ -154,12 +148,16 @@ static void gx_irq_handler(struct pt_regs *regs) · 3 unmodified lines
154148 {
155149 bool ret;
156150
157− do {
158− ret = handle_irq_perbit(regs,
159− readl_relaxed(reg_base + GX_INTC_PEN31_00), 0);
160− ret |= handle_irq_perbit(regs,
161− readl_relaxed(reg_base + GX_INTC_PEN63_32), 32);
162− } while (ret);
151+retry:
152+ ret = handle_irq_perbit(regs,
153+ readl(reg_base + GX_INTC_PEN63_32), 32);
154+ if (ret)
155+ goto retry;
156+
157+ ret = handle_irq_perbit(regs,
158+ readl(reg_base + GX_INTC_PEN31_00), 0);
159+ if (ret)
160+ goto retry;
163161 }
164162
165163 static int __init
@@ -174,14 +172,14 @@ gx_intc_init(struct device_node *node, struct device_node *parent) · 8 unmodified lines
174172 /*
175173 * Initial enable reg to disable all interrupts
176174 */
177− writel_relaxed(0x0, reg_base + GX_INTC_NEN31_00);
178− writel_relaxed(0x0, reg_base + GX_INTC_NEN63_32);
175+ writel(0x0, reg_base + GX_INTC_NEN31_00);
176+ writel(0x0, reg_base + GX_INTC_NEN63_32);
179177
180178 /*
181179 * Initial mask reg with all unmasked, because we only use enalbe reg
182180 */
183− writel_relaxed(0x0, reg_base + GX_INTC_NMASK31_00);
184− writel_relaxed(0x0, reg_base + GX_INTC_NMASK63_32);
181+ writel(0x0, reg_base + GX_INTC_NMASK31_00);
182+ writel(0x0, reg_base + GX_INTC_NMASK63_32);
185183
186184 setup_irq_channel(0x03020100, reg_base + GX_INTC_SOURCE);
187185
@@ -204,20 +202,29 @@ static void ck_irq_handler(struct pt_regs *regs) · 16 unmodified lines
204202 void __iomem *reg_pen_lo = reg_base + CK_INTC_PEN31_00;
205203 void __iomem *reg_pen_hi = reg_base + CK_INTC_PEN63_32;
206204
207− do {
208− /* handle 0 - 31 irqs */
209− ret = handle_irq_perbit(regs, readl_relaxed(reg_pen_lo), 0);
210− ret |= handle_irq_perbit(regs, readl_relaxed(reg_pen_hi), 32);
205+retry:
206+ /* handle 0 - 63 irqs */
207+ ret = handle_irq_perbit(regs, readl(reg_pen_hi), 32);
208+ if (ret)
209+ goto retry;
211210
212− if (nr_irq == INTC_IRQS)
213− continue;
211+ ret = handle_irq_perbit(regs, readl(reg_pen_lo), 0);
212+ if (ret)
213+ goto retry;
214+
215+ if (nr_irq == INTC_IRQS)
216+ return;
214217
215− /* handle 64 - 127 irqs */
216− ret |= handle_irq_perbit(regs,
217− readl_relaxed(reg_pen_lo + CK_INTC_DUAL_BASE), 64);
218− ret |= handle_irq_perbit(regs,
219− readl_relaxed(reg_pen_hi + CK_INTC_DUAL_BASE), 96);
220− } while (ret);
218+ /* handle 64 - 127 irqs */
219+ ret = handle_irq_perbit(regs,
220+ readl(reg_pen_hi + CK_INTC_DUAL_BASE), 96);
221+ if (ret)
222+ goto retry;
223+
224+ ret = handle_irq_perbit(regs,
225+ readl(reg_pen_lo + CK_INTC_DUAL_BASE), 64);
226+ if (ret)
227+ goto retry;
221228 }
222229
223230 static int __init
@@ -230,11 +237,11 @@ ck_intc_init(struct device_node *node, struct device_node *parent) · 6 unmodified lines
230237 return ret;
231238
232239 /* Initial enable reg to disable all interrupts */
233− writel_relaxed(0, reg_base + CK_INTC_NEN31_00);
234− writel_relaxed(0, reg_base + CK_INTC_NEN63_32);
240+ writel(0, reg_base + CK_INTC_NEN31_00);
241+ writel(0, reg_base + CK_INTC_NEN63_32);
235242
236243 /* Enable irq intc */
237− writel_relaxed(BIT(31), reg_base + CK_INTC_ICR);
244+ writel(BIT(31), reg_base + CK_INTC_ICR);
238245
239246 ck_set_gc(node, reg_base, CK_INTC_NEN31_00, 0);
240247 ck_set_gc(node, reg_base, CK_INTC_NEN63_32, 32);
@@ -260,8 +267,8 @@ ck_dual_intc_init(struct device_node *node, struct device_node *parent) · 19 unmodified lines
260267 return ret;
261268
262269 /* Initial enable reg to disable all interrupts */
263− writel_relaxed(0, reg_base + CK_INTC_NEN31_00 + CK_INTC_DUAL_BASE);
264− writel_relaxed(0, reg_base + CK_INTC_NEN63_32 + CK_INTC_DUAL_BASE);
270+ writel(0, reg_base + CK_INTC_NEN31_00 + CK_INTC_DUAL_BASE);
271+ writel(0, reg_base + CK_INTC_NEN63_32 + CK_INTC_DUAL_BASE);
265272
266273 ck_set_gc(node, reg_base + CK_INTC_DUAL_BASE, CK_INTC_NEN31_00, 64);
267274 ck_set_gc(node, reg_base + CK_INTC_DUAL_BASE, CK_INTC_NEN63_32, 96);
drivers/irqchip/irq-gic-v3-its.c+92−34
@@ -97,9 +97,14 @@ struct its_device; · 96 unmodified lines
9797 * The ITS structure - contains most of the infrastructure, with the
9898 * top-level MSI domain, the command queue, the collections, and the
9999 * list of devices writing to it.
100+ *
101+ * dev_alloc_lock has to be taken for device allocations, while the
102+ * spinlock must be taken to parse data structures such as the device
103+ * list.
100104 */
101105 struct its_node {
102106 raw_spinlock_t lock;
107+ struct mutex dev_alloc_lock;
103108 struct list_head entry;
104109 void __iomem *base;
105110 phys_addr_t phys_base;
@@ -156,6 +161,7 @@ struct its_device { · 50 unmodified lines
156161 void *itt;
157162 u32 nr_ites;
158163 u32 device_id;
164+ bool shared;
159165 };
160166
161167 static struct {
@@ -1580,6 +1586,9 @@ static unsigned long *its_lpi_alloc(int nr_irqs, u32 *base, int *nr_ids) · 1418 unmodified lines
15801586 nr_irqs /= 2;
15811587 } while (nr_irqs > 0);
15821588
1589+ if (!nr_irqs)
1590+ err = -ENOSPC;
1591+
15831592 if (err)
15841593 goto out;
15851594
@@ -2059,6 +2068,29 @@ static int __init allocate_lpi_tables(void) · 473 unmodified lines
20592068 return 0;
20602069 }
20612070
2071+static u64 its_clear_vpend_valid(void __iomem *vlpi_base)
2072+{
2073+ u32 count = 1000000; /* 1s! */
2074+ bool clean;
2075+ u64 val;
2076+
2077+ val = gits_read_vpendbaser(vlpi_base + GICR_VPENDBASER);
2078+ val &= ~GICR_VPENDBASER_Valid;
2079+ gits_write_vpendbaser(val, vlpi_base + GICR_VPENDBASER);
2080+
2081+ do {
2082+ val = gits_read_vpendbaser(vlpi_base + GICR_VPENDBASER);
2083+ clean = !(val & GICR_VPENDBASER_Dirty);
2084+ if (!clean) {
2085+ count--;
2086+ cpu_relax();
2087+ udelay(1);
2088+ }
2089+ } while (!clean && count);
2090+
2091+ return val;
2092+}
2093+
20622094 static void its_cpu_init_lpis(void)
20632095 {
20642096 void __iomem *rbase = gic_data_rdist_rd_base();
@@ -2144,6 +2176,30 @@ static void its_cpu_init_lpis(void) · 79 unmodified lines
21442176 val |= GICR_CTLR_ENABLE_LPIS;
21452177 writel_relaxed(val, rbase + GICR_CTLR);
21462178
2179+ if (gic_rdists->has_vlpis) {
2180+ void __iomem *vlpi_base = gic_data_rdist_vlpi_base();
2181+
2182+ /*
2183+ * It's possible for CPU to receive VLPIs before it is
2184+ * sheduled as a vPE, especially for the first CPU, and the
2185+ * VLPI with INTID larger than 2^(IDbits+1) will be considered
2186+ * as out of range and dropped by GIC.
2187+ * So we initialize IDbits to known value to avoid VLPI drop.
2188+ */
2189+ val = (LPI_NRBITS - 1) & GICR_VPROPBASER_IDBITS_MASK;
2190+ pr_debug("GICv4: CPU%d: Init IDbits to 0x%llx for GICR_VPROPBASER\n",
2191+ smp_processor_id(), val);
2192+ gits_write_vpropbaser(val, vlpi_base + GICR_VPROPBASER);
2193+
2194+ /*
2195+ * Also clear Valid bit of GICR_VPENDBASER, in case some
2196+ * ancient programming gets left in and has possibility of
2197+ * corrupting memory.
2198+ */
2199+ val = its_clear_vpend_valid(vlpi_base);
2200+ WARN_ON(val & GICR_VPENDBASER_Dirty);
2201+ }
2202+
21472203 /* Make sure the GIC has seen the above */
21482204 dsb(sy);
21492205 out:
@@ -2399,13 +2455,14 @@ static void its_free_device(struct its_device *its_dev) · 249 unmodified lines
23992455 kfree(its_dev);
24002456 }
24012457
2402−static int its_alloc_device_irq(struct its_device *dev, irq_hw_number_t *hwirq)
2458+static int its_alloc_device_irq(struct its_device *dev, int nvecs, irq_hw_number_t *hwirq)
24032459 {
24042460 int idx;
24052461
2406− idx = find_first_zero_bit(dev->event_map.lpi_map,
2407− dev->event_map.nr_lpis);
2408− if (idx == dev->event_map.nr_lpis)
2462+ idx = bitmap_find_free_region(dev->event_map.lpi_map,
2463+ dev->event_map.nr_lpis,
2464+ get_count_order(nvecs));
2465+ if (idx < 0)
24092466 return -ENOSPC;
24102467
24112468 *hwirq = dev->event_map.lpi_base + idx;
@@ -2421,6 +2478,7 @@ static int its_msi_prepare(struct irq_domain *domain, struct device *dev, · 9 unmodified lines
24212478 struct its_device *its_dev;
24222479 struct msi_domain_info *msi_info;
24232480 u32 dev_id;
2481+ int err = 0;
24242482
24252483 /*
24262484 * We ignore "dev" entierely, and rely on the dev_id that has
@@ -2443,6 +2501,7 @@ static int its_msi_prepare(struct irq_domain *domain, struct device *dev, · 16 unmodified lines
24432501 return -EINVAL;
24442502 }
24452503
2504+ mutex_lock(&its->dev_alloc_lock);
24462505 its_dev = its_find_device(its, dev_id);
24472506 if (its_dev) {
24482507 /*
@@ -2450,18 +2509,22 @@ static int its_msi_prepare(struct irq_domain *domain, struct device *dev, · 1 unmodified line
24502509 * another alias (PCI bridge of some sort). No need to
24512510 * create the device.
24522511 */
2512+ its_dev->shared = true;
24532513 pr_debug("Reusing ITT for devID %x\n", dev_id);
24542514 goto out;
24552515 }
24562516
24572517 its_dev = its_create_device(its, dev_id, nvec, true);
2458− if (!its_dev)
2459− return -ENOMEM;
2518+ if (!its_dev) {
2519+ err = -ENOMEM;
2520+ goto out;
2521+ }
24602522
24612523 pr_debug("ITT %d entries, %d bits\n", nvec, ilog2(nvec));
24622524 out:
2525+ mutex_unlock(&its->dev_alloc_lock);
24632526 info->scratchpad[0].ptr = its_dev;
2464− return 0;
2527+ return err;
24652528 }
24662529
24672530 static struct msi_domain_ops its_msi_domain_ops = {
@@ -2501,21 +2564,21 @@ static int its_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, · 33 unmodified lines
25012564 int err;
25022565 int i;
25032566
2504− for (i = 0; i < nr_irqs; i++) {
2505− err = its_alloc_device_irq(its_dev, &hwirq);
2506− if (err)
2507− return err;
2567+ err = its_alloc_device_irq(its_dev, nr_irqs, &hwirq);
2568+ if (err)
2569+ return err;
25082570
2509− err = its_irq_gic_domain_alloc(domain, virq + i, hwirq);
2571+ for (i = 0; i < nr_irqs; i++) {
2572+ err = its_irq_gic_domain_alloc(domain, virq + i, hwirq + i);
25102573 if (err)
25112574 return err;
25122575
25132576 irq_domain_set_hwirq_and_chip(domain, virq + i,
2514− hwirq, &its_irq_chip, its_dev);
2577+ hwirq + i, &its_irq_chip, its_dev);
25152578 irqd_set_single_target(irq_desc_get_irq_data(irq_to_desc(virq + i)));
25162579 pr_debug("ID:%d pID:%d vID:%d\n",
2517− (int)(hwirq - its_dev->event_map.lpi_base),
2518− (int) hwirq, virq + i);
2580+ (int)(hwirq + i - its_dev->event_map.lpi_base),
2581+ (int)(hwirq + i), virq + i);
25192582 }
25202583
25212584 return 0;
@@ -2565,6 +2628,7 @@ static void its_irq_domain_free(struct irq_domain *domain, unsigned int virq, · 43 unmodified lines
25652628 {
25662629 struct irq_data *d = irq_domain_get_irq_data(domain, virq);
25672630 struct its_device *its_dev = irq_data_get_irq_chip_data(d);
2631+ struct its_node *its = its_dev->its;
25682632 int i;
25692633
25702634 for (i = 0; i < nr_irqs; i++) {
@@ -2579,8 +2643,14 @@ static void its_irq_domain_free(struct irq_domain *domain, unsigned int virq, · 8 unmodified lines
25792643 irq_domain_reset_irq_data(data);
25802644 }
25812645
2582− /* If all interrupts have been freed, start mopping the floor */
2583− if (bitmap_empty(its_dev->event_map.lpi_map,
2646+ mutex_lock(&its->dev_alloc_lock);
2647+
2648+ /*
2649+ * If all interrupts have been freed, start mopping the
2650+ * floor. This is conditionned on the device not being shared.
2651+ */
2652+ if (!its_dev->shared &&
2653+ bitmap_empty(its_dev->event_map.lpi_map,
25842654 its_dev->event_map.nr_lpis)) {
25852655 its_lpi_free(its_dev->event_map.lpi_map,
25862656 its_dev->event_map.lpi_base,
@@ -2592,6 +2662,8 @@ static void its_irq_domain_free(struct irq_domain *domain, unsigned int virq, · 5 unmodified lines
25922662 its_free_device(its_dev);
25932663 }
25942664
2665+ mutex_unlock(&its->dev_alloc_lock);
2666+
25952667 irq_domain_free_irqs_parent(domain, virq, nr_irqs);
25962668 }
25972669
@@ -2754,26 +2826,11 @@ static void its_vpe_schedule(struct its_vpe *vpe) · 156 unmodified lines
27542826 static void its_vpe_deschedule(struct its_vpe *vpe)
27552827 {
27562828 void __iomem *vlpi_base = gic_data_rdist_vlpi_base();
2757− u32 count = 1000000; /* 1s! */
2758− bool clean;
27592829 u64 val;
27602830
2761− /* We're being scheduled out */
2762− val = gits_read_vpendbaser(vlpi_base + GICR_VPENDBASER);
2763− val &= ~GICR_VPENDBASER_Valid;
2764− gits_write_vpendbaser(val, vlpi_base + GICR_VPENDBASER);
2765−
2766− do {
2767− val = gits_read_vpendbaser(vlpi_base + GICR_VPENDBASER);
2768− clean = !(val & GICR_VPENDBASER_Dirty);
2769− if (!clean) {
2770− count--;
2771− cpu_relax();
2772− udelay(1);
2773− }
2774− } while (!clean && count);
2831+ val = its_clear_vpend_valid(vlpi_base);
27752832
2776− if (unlikely(!clean && !count)) {
2833+ if (unlikely(val & GICR_VPENDBASER_Dirty)) {
27772834 pr_err_ratelimited("ITS virtual pending table not cleaning\n");
27782835 vpe->idai = false;
27792836 vpe->pending_last = true;
@@ -3516,6 +3573,7 @@ static int __init its_probe_one(struct resource *res, · 736 unmodified lines
35163573 }
35173574
35183575 raw_spin_lock_init(&its->lock);
3576+ mutex_init(&its->dev_alloc_lock);
35193577 INIT_LIST_HEAD(&its->entry);
35203578 INIT_LIST_HEAD(&its->its_device_list);
35213579 typer = gic_read_typer(its_base + GITS_TYPER);
drivers/irqchip/irq-gic-v3-mbi.c+1−1
@@ -24,7 +24,7 @@ struct mbi_range { · 23 unmodified lines
2424 unsigned long *bm;
2525 };
2626
27−static struct mutex mbi_lock;
27+static DEFINE_MUTEX(mbi_lock);
2828 static phys_addr_t mbi_phys_base;
2929 static struct mbi_range *mbi_ranges;
3030 static unsigned int mbi_range_nr;
drivers/irqchip/irq-madera.c+0−2
@@ -7,7 +7,6 @@ · 6 unmodified lines
77 */
88
99 #include <linux/module.h>
10−#include <linux/gpio.h>
1110 #include <linux/interrupt.h>
1211 #include <linux/irq.h>
1312 #include <linux/irqdomain.h>
@@ -16,7 +15,6 @@ · 2 unmodified lines
1615 #include <linux/slab.h>
1716 #include <linux/of.h>
1817 #include <linux/of_device.h>
19−#include <linux/of_gpio.h>
2018 #include <linux/of_irq.h>
2119 #include <linux/irqchip/irq-madera.h>
2220 #include <linux/mfd/madera/core.h>
drivers/irqchip/irq-mmp.c+5−1
@@ -34,6 +34,9 @@ · 33 unmodified lines
3434 #define SEL_INT_PENDING (1 << 6)
3535 #define SEL_INT_NUM_MASK 0x3f
3636
37+#define MMP2_ICU_INT_ROUTE_PJ4_IRQ (1 << 5)
38+#define MMP2_ICU_INT_ROUTE_PJ4_FIQ (1 << 6)
39+
3740 struct icu_chip_data {
3841 int nr_irqs;
3942 unsigned int virq_base;
@@ -190,7 +193,8 @@ static const struct mmp_intc_conf mmp_conf = { · 150 unmodified lines
190193 static const struct mmp_intc_conf mmp2_conf = {
191194 .conf_enable = 0x20,
192195 .conf_disable = 0x0,
193− .conf_mask = 0x7f,
196+ .conf_mask = MMP2_ICU_INT_ROUTE_PJ4_IRQ |
197+ MMP2_ICU_INT_ROUTE_PJ4_FIQ,
194198 };
195199
196200 static void __exception_irq_entry mmp_handle_irq(struct pt_regs *regs)
drivers/irqchip/irq-stm32-exti.c+1−0
@@ -822,6 +822,7 @@ out_unmap: · 821 unmodified lines
822822 static const struct irq_domain_ops stm32_exti_h_domain_ops = {
823823 .alloc = stm32_exti_h_domain_alloc,
824824 .free = irq_domain_free_irqs_common,
825+ .xlate = irq_domain_xlate_twocell,
825826 };
826827
827828 static int
drivers/irqchip/irq-xtensa-mx.c+25−15
@@ -71,14 +71,17 @@ static void xtensa_mx_irq_mask(struct irq_data *d) · 70 unmodified lines
7171 unsigned int mask = 1u << d->hwirq;
7272
7373 if (mask & (XCHAL_INTTYPE_MASK_EXTERN_EDGE |
74− XCHAL_INTTYPE_MASK_EXTERN_LEVEL)) {
75− set_er(1u << (xtensa_get_ext_irq_no(d->hwirq) -
76− HW_IRQ_MX_BASE), MIENG);
77− } else {
78− mask = __this_cpu_read(cached_irq_mask) & ~mask;
79− __this_cpu_write(cached_irq_mask, mask);
80− xtensa_set_sr(mask, intenable);
74+ XCHAL_INTTYPE_MASK_EXTERN_LEVEL)) {
75+ unsigned int ext_irq = xtensa_get_ext_irq_no(d->hwirq);
76+
77+ if (ext_irq >= HW_IRQ_MX_BASE) {
78+ set_er(1u << (ext_irq - HW_IRQ_MX_BASE), MIENG);
79+ return;
80+ }
8181 }
82+ mask = __this_cpu_read(cached_irq_mask) & ~mask;
83+ __this_cpu_write(cached_irq_mask, mask);
84+ xtensa_set_sr(mask, intenable);
8285 }
8386
8487 static void xtensa_mx_irq_unmask(struct irq_data *d)
@@ -86,14 +89,17 @@ static void xtensa_mx_irq_unmask(struct irq_data *d) · 1 unmodified line
8689 unsigned int mask = 1u << d->hwirq;
8790
8891 if (mask & (XCHAL_INTTYPE_MASK_EXTERN_EDGE |
89− XCHAL_INTTYPE_MASK_EXTERN_LEVEL)) {
90− set_er(1u << (xtensa_get_ext_irq_no(d->hwirq) -
91− HW_IRQ_MX_BASE), MIENGSET);
92− } else {
93− mask |= __this_cpu_read(cached_irq_mask);
94− __this_cpu_write(cached_irq_mask, mask);
95− xtensa_set_sr(mask, intenable);
92+ XCHAL_INTTYPE_MASK_EXTERN_LEVEL)) {
93+ unsigned int ext_irq = xtensa_get_ext_irq_no(d->hwirq);
94+
95+ if (ext_irq >= HW_IRQ_MX_BASE) {
96+ set_er(1u << (ext_irq - HW_IRQ_MX_BASE), MIENGSET);
97+ return;
98+ }
9699 }
100+ mask |= __this_cpu_read(cached_irq_mask);
101+ __this_cpu_write(cached_irq_mask, mask);
102+ xtensa_set_sr(mask, intenable);
97103 }
98104
99105 static void xtensa_mx_irq_enable(struct irq_data *d)
@@ -113,7 +119,11 @@ static void xtensa_mx_irq_ack(struct irq_data *d) · 13 unmodified lines
113119
114120 static int xtensa_mx_irq_retrigger(struct irq_data *d)
115121 {
116− xtensa_set_sr(1 << d->hwirq, intset);
122+ unsigned int mask = 1u << d->hwirq;
123+
124+ if (WARN_ON(mask & ~XCHAL_INTTYPE_MASK_SOFTWARE))
125+ return 0;
126+ xtensa_set_sr(mask, intset);
117127 return 1;
118128 }
119129
drivers/irqchip/irq-xtensa-pic.c+5−1
@@ -70,7 +70,11 @@ static void xtensa_irq_ack(struct irq_data *d) · 69 unmodified lines
7070
7171 static int xtensa_irq_retrigger(struct irq_data *d)
7272 {
73− xtensa_set_sr(1 << d->hwirq, intset);
73+ unsigned int mask = 1u << d->hwirq;
74+
75+ if (WARN_ON(mask & ~XCHAL_INTTYPE_MASK_SOFTWARE))
76+ return 0;
77+ xtensa_set_sr(mask, intset);
7478 return 1;
7579 }
7680
drivers/isdn/hardware/avm/b1.c+1−1
@@ -423,7 +423,7 @@ void b1_parse_version(avmctrl_info *cinfo) · 422 unmodified lines
423423 int i, j;
424424
425425 for (j = 0; j < AVM_MAXVERSION; j++)
426− cinfo->version[j] = "\0\0" + 1;
426+ cinfo->version[j] = "";
427427 for (i = 0, j = 0;
428428 j < AVM_MAXVERSION && i < cinfo->versionlen;
429429 j++, i += cinfo->versionbuf[i] + 1)
drivers/isdn/hardware/mISDN/hfcsusb.c+1−2
@@ -262,8 +262,7 @@ hfcsusb_ph_info(struct hfcsusb *hw) · 261 unmodified lines
262262 struct dchannel *dch = &hw->dch;
263263 int i;
264264
265− phi = kzalloc(sizeof(struct ph_info) +
266− dch->dev.nrbchan * sizeof(struct ph_info_ch), GFP_ATOMIC);
265+ phi = kzalloc(struct_size(phi, bch, dch->dev.nrbchan), GFP_ATOMIC);
267266 phi->dch.ch.protocol = hw->protocol;
268267 phi->dch.ch.Flags = dch->Flags;
269268 phi->dch.state = dch->state;
drivers/isdn/i4l/isdn_tty.c+5−1
@@ -1437,15 +1437,19 @@ isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios) · 1436 unmodified lines
14371437 {
14381438 modem_info *info = (modem_info *) tty->driver_data;
14391439
1440+ mutex_lock(&modem_info_mutex);
14401441 if (!old_termios)
14411442 isdn_tty_change_speed(info);
14421443 else {
14431444 if (tty->termios.c_cflag == old_termios->c_cflag &&
14441445 tty->termios.c_ispeed == old_termios->c_ispeed &&
1445− tty->termios.c_ospeed == old_termios->c_ospeed)
1446+ tty->termios.c_ospeed == old_termios->c_ospeed) {
1447+ mutex_unlock(&modem_info_mutex);
14461448 return;
1449+ }
14471450 isdn_tty_change_speed(info);
14481451 }
1452+ mutex_unlock(&modem_info_mutex);
14491453 }
14501454
14511455 /*
drivers/isdn/mISDN/timerdev.c+1−1
@@ -170,8 +170,8 @@ dev_expire_timer(struct timer_list *t) · 169 unmodified lines
170170 spin_lock_irqsave(&timer->dev->lock, flags);
171171 if (timer->id >= 0)
172172 list_move_tail(&timer->list, &timer->dev->expired);
173− spin_unlock_irqrestore(&timer->dev->lock, flags);
174173 wake_up_interruptible(&timer->dev->wait);
174+ spin_unlock_irqrestore(&timer->dev->lock, flags);
175175 }
176176
177177 static int
drivers/leds/leds-lp5523.c+3−1
@@ -318,7 +318,9 @@ static int lp5523_init_program_engine(struct lp55xx_chip *chip) · 317 unmodified lines
318318
319319 /* Let the programs run for couple of ms and check the engine status */
320320 usleep_range(3000, 6000);
321− lp55xx_read(chip, LP5523_REG_STATUS, &status);
321+ ret = lp55xx_read(chip, LP5523_REG_STATUS, &status);
322+ if (ret)
323+ return ret;
322324 status &= LP5523_ENG_STATUS_MASK;
323325
324326 if (status != LP5523_ENG_STATUS_MASK) {
drivers/md/dm-crypt.c+17−8
@@ -2414,9 +2414,21 @@ static int crypt_ctr_cipher_new(struct dm_target *ti, char *cipher_in, char *key · 2413 unmodified lines
24142414 * capi:cipher_api_spec-iv:ivopts
24152415 */
24162416 tmp = &cipher_in[strlen("capi:")];
2417− cipher_api = strsep(&tmp, "-");
2418− *ivmode = strsep(&tmp, ":");
2419− *ivopts = tmp;
2417+
2418+ /* Separate IV options if present, it can contain another '-' in hash name */
2419+ *ivopts = strrchr(tmp, ':');
2420+ if (*ivopts) {
2421+ **ivopts = '\0';
2422+ (*ivopts)++;
2423+ }
2424+ /* Parse IV mode */
2425+ *ivmode = strrchr(tmp, '-');
2426+ if (*ivmode) {
2427+ **ivmode = '\0';
2428+ (*ivmode)++;
2429+ }
2430+ /* The rest is crypto API spec */
2431+ cipher_api = tmp;
24202432
24212433 if (*ivmode && !strcmp(*ivmode, "lmk"))
24222434 cc->tfms_count = 64;
@@ -2486,11 +2498,8 @@ static int crypt_ctr_cipher_old(struct dm_target *ti, char *cipher_in, char *key · 63 unmodified lines
24862498 goto bad_mem;
24872499
24882500 chainmode = strsep(&tmp, "-");
2489− *ivopts = strsep(&tmp, "-");
2490− *ivmode = strsep(&*ivopts, ":");
2491−
2492− if (tmp)
2493− DMWARN("Ignoring unexpected additional cipher options");
2501+ *ivmode = strsep(&tmp, ":");
2502+ *ivopts = tmp;
24942503
24952504 /*
24962505 * For compatibility with the original dm-crypt mapping format, if
drivers/md/dm-rq.c+1−1
@@ -131,7 +131,7 @@ static void rq_end_stats(struct mapped_device *md, struct request *orig) · 130 unmodified lines
131131 static void rq_completed(struct mapped_device *md)
132132 {
133133 /* nudge anyone waiting on suspend queue */
134− if (unlikely(waitqueue_active(&md->wait)))
134+ if (unlikely(wq_has_sleeper(&md->wait)))
135135 wake_up(&md->wait);
136136
137137 /*
drivers/md/dm-thin-metadata.c+2−2
@@ -1678,7 +1678,7 @@ int dm_thin_remove_range(struct dm_thin_device *td, · 1677 unmodified lines
16781678 return r;
16791679 }
16801680
1681−int dm_pool_block_is_used(struct dm_pool_metadata *pmd, dm_block_t b, bool *result)
1681+int dm_pool_block_is_shared(struct dm_pool_metadata *pmd, dm_block_t b, bool *result)
16821682 {
16831683 int r;
16841684 uint32_t ref_count;
@@ -1686,7 +1686,7 @@ int dm_pool_block_is_used(struct dm_pool_metadata *pmd, dm_block_t b, bool *resu · 1 unmodified line
16861686 down_read(&pmd->root_lock);
16871687 r = dm_sm_get_count(pmd->data_sm, b, &ref_count);
16881688 if (!r)
1689− *result = (ref_count != 0);
1689+ *result = (ref_count > 1);
16901690 up_read(&pmd->root_lock);
16911691
16921692 return r;
drivers/md/dm-thin-metadata.h+1−1
@@ -195,7 +195,7 @@ int dm_pool_get_metadata_dev_size(struct dm_pool_metadata *pmd, · 194 unmodified lines
195195
196196 int dm_pool_get_data_dev_size(struct dm_pool_metadata *pmd, dm_block_t *result);
197197
198−int dm_pool_block_is_used(struct dm_pool_metadata *pmd, dm_block_t b, bool *result);
198+int dm_pool_block_is_shared(struct dm_pool_metadata *pmd, dm_block_t b, bool *result);
199199
200200 int dm_pool_inc_data_range(struct dm_pool_metadata *pmd, dm_block_t b, dm_block_t e);
201201 int dm_pool_dec_data_range(struct dm_pool_metadata *pmd, dm_block_t b, dm_block_t e);
drivers/md/dm-thin.c+5−5
@@ -1048,7 +1048,7 @@ static void passdown_double_checking_shared_status(struct dm_thin_new_mapping *m · 1047 unmodified lines
10481048 * passdown we have to check that these blocks are now unused.
10491049 */
10501050 int r = 0;
1051− bool used = true;
1051+ bool shared = true;
10521052 struct thin_c *tc = m->tc;
10531053 struct pool *pool = tc->pool;
10541054 dm_block_t b = m->data_block, e, end = m->data_block + m->virt_end - m->virt_begin;
@@ -1058,11 +1058,11 @@ static void passdown_double_checking_shared_status(struct dm_thin_new_mapping *m · 3 unmodified lines
10581058 while (b != end) {
10591059 /* find start of unmapped run */
10601060 for (; b < end; b++) {
1061− r = dm_pool_block_is_used(pool->pmd, b, &used);
1061+ r = dm_pool_block_is_shared(pool->pmd, b, &shared);
10621062 if (r)
10631063 goto out;
10641064
1065− if (!used)
1065+ if (!shared)
10661066 break;
10671067 }
10681068
@@ -1071,11 +1071,11 @@ static void passdown_double_checking_shared_status(struct dm_thin_new_mapping *m · 2 unmodified lines
10711071
10721072 /* find end of run */
10731073 for (e = b + 1; e != end; e++) {
1074− r = dm_pool_block_is_used(pool->pmd, e, &used);
1074+ r = dm_pool_block_is_shared(pool->pmd, e, &shared);
10751075 if (r)
10761076 goto out;
10771077
1078− if (used)
1078+ if (shared)
10791079 break;
10801080 }
10811081
drivers/md/dm.c+32−9
@@ -699,7 +699,7 @@ static void end_io_acct(struct dm_io *io) · 698 unmodified lines
699699 true, duration, &io->stats_aux);
700700
701701 /* nudge anyone waiting on suspend queue */
702− if (unlikely(waitqueue_active(&md->wait)))
702+ if (unlikely(wq_has_sleeper(&md->wait)))
703703 wake_up(&md->wait);
704704 }
705705
@@ -1320,7 +1320,7 @@ static int clone_bio(struct dm_target_io *tio, struct bio *bio, · 614 unmodified lines
13201320
13211321 __bio_clone_fast(clone, bio);
13221322
1323− if (unlikely(bio_integrity(bio) != NULL)) {
1323+ if (bio_integrity(bio)) {
13241324 int r;
13251325
13261326 if (unlikely(!dm_target_has_integrity(tio->ti->type) &&
@@ -1339,7 +1339,7 @@ static int clone_bio(struct dm_target_io *tio, struct bio *bio, · 12 unmodified lines
13391339 bio_advance(clone, to_bytes(sector - clone->bi_iter.bi_sector));
13401340 clone->bi_iter.bi_size = to_bytes(len);
13411341
1342− if (unlikely(bio_integrity(bio) != NULL))
1342+ if (bio_integrity(bio))
13431343 bio_integrity_trim(clone);
13441344
13451345 return 0;
@@ -1588,6 +1588,9 @@ static void init_clone_info(struct clone_info *ci, struct mapped_device *md, · 242 unmodified lines
15881588 ci->sector = bio->bi_iter.bi_sector;
15891589 }
15901590
1591+#define __dm_part_stat_sub(part, field, subnd) \
1592+ (part_stat_get(part, field) -= (subnd))
1593+
15911594 /*
15921595 * Entry point to split a bio into clones and submit them to the targets.
15931596 */
@@ -1642,7 +1645,21 @@ static blk_qc_t __split_and_process_bio(struct mapped_device *md, · 48 unmodified lines
16421645 struct bio *b = bio_split(bio, bio_sectors(bio) - ci.sector_count,
16431646 GFP_NOIO, &md->queue->bio_split);
16441647 ci.io->orig_bio = b;
1648+
1649+ /*
1650+ * Adjust IO stats for each split, otherwise upon queue
1651+ * reentry there will be redundant IO accounting.
1652+ * NOTE: this is a stop-gap fix, a proper fix involves
1653+ * significant refactoring of DM core's bio splitting
1654+ * (by eliminating DM's splitting and just using bio_split)
1655+ */
1656+ part_stat_lock();
1657+ __dm_part_stat_sub(&dm_disk(md)->part0,
1658+ sectors[op_stat_group(bio_op(bio))], ci.sector_count);
1659+ part_stat_unlock();
1660+
16451661 bio_chain(b, bio);
1662+ trace_block_split(md->queue, b, bio->bi_iter.bi_sector);
16461663 ret = generic_make_request(bio);
16471664 break;
16481665 }
@@ -1713,6 +1730,15 @@ out: · 64 unmodified lines
17131730 return ret;
17141731 }
17151732
1733+static blk_qc_t dm_process_bio(struct mapped_device *md,
1734+ struct dm_table *map, struct bio *bio)
1735+{
1736+ if (dm_get_md_type(md) == DM_TYPE_NVME_BIO_BASED)
1737+ return __process_bio(md, map, bio);
1738+ else
1739+ return __split_and_process_bio(md, map, bio);
1740+}
1741+
17161742 static blk_qc_t dm_make_request(struct request_queue *q, struct bio *bio)
17171743 {
17181744 struct mapped_device *md = q->queuedata;
@@ -1733,10 +1759,7 @@ static blk_qc_t dm_make_request(struct request_queue *q, struct bio *bio) · 14 unmodified lines
17331759 return ret;
17341760 }
17351761
1736− if (dm_get_md_type(md) == DM_TYPE_NVME_BIO_BASED)
1737− ret = __process_bio(md, map, bio);
1738− else
1739− ret = __split_and_process_bio(md, map, bio);
1762+ ret = dm_process_bio(md, map, bio);
17401763
17411764 dm_put_live_table(md, srcu_idx);
17421765 return ret;
@@ -2415,9 +2438,9 @@ static void dm_wq_work(struct work_struct *work) · 672 unmodified lines
24152438 break;
24162439
24172440 if (dm_request_based(md))
2418− generic_make_request(c);
2441+ (void) generic_make_request(c);
24192442 else
2420− __split_and_process_bio(md, map, c);
2443+ (void) dm_process_bio(md, map, c);
24212444 }
24222445
24232446 dm_put_live_table(md, srcu_idx);
drivers/md/md.c+1−6
@@ -207,15 +207,10 @@ static bool create_on_open = true; · 206 unmodified lines
207207 struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs,
208208 struct mddev *mddev)
209209 {
210− struct bio *b;
211−
212210 if (!mddev || !bioset_initialized(&mddev->bio_set))
213211 return bio_alloc(gfp_mask, nr_iovecs);
214212
215− b = bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set);
216− if (!b)
217− return NULL;
218− return b;
213+ return bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set);
219214 }
220215 EXPORT_SYMBOL_GPL(bio_alloc_mddev);
221216
drivers/md/raid5-cache.c+22−11
@@ -1935,12 +1935,14 @@ out: · 1934 unmodified lines
19351935 }
19361936
19371937 static struct stripe_head *
1938−r5c_recovery_alloc_stripe(struct r5conf *conf,
1939− sector_t stripe_sect)
1938+r5c_recovery_alloc_stripe(
1939+ struct r5conf *conf,
1940+ sector_t stripe_sect,
1941+ int noblock)
19401942 {
19411943 struct stripe_head *sh;
19421944
1943− sh = raid5_get_active_stripe(conf, stripe_sect, 0, 1, 0);
1945+ sh = raid5_get_active_stripe(conf, stripe_sect, 0, noblock, 0);
19441946 if (!sh)
19451947 return NULL; /* no more stripe available */
19461948
@@ -2150,7 +2152,7 @@ r5c_recovery_analyze_meta_block(struct r5l_log *log, · 203 unmodified lines
21502152 stripe_sect);
21512153
21522154 if (!sh) {
2153− sh = r5c_recovery_alloc_stripe(conf, stripe_sect);
2155+ sh = r5c_recovery_alloc_stripe(conf, stripe_sect, 1);
21542156 /*
21552157 * cannot get stripe from raid5_get_active_stripe
21562158 * try replay some stripes
@@ -2159,20 +2161,29 @@ r5c_recovery_analyze_meta_block(struct r5l_log *log, · 2 unmodified lines
21592161 r5c_recovery_replay_stripes(
21602162 cached_stripe_list, ctx);
21612163 sh = r5c_recovery_alloc_stripe(
2162− conf, stripe_sect);
2164+ conf, stripe_sect, 1);
21632165 }
21642166 if (!sh) {
2167+ int new_size = conf->min_nr_stripes * 2;
21652168 pr_debug("md/raid:%s: Increasing stripe cache size to %d to recovery data on journal.\n",
21662169 mdname(mddev),
2167− conf->min_nr_stripes * 2);
2168− raid5_set_cache_size(mddev,
2169− conf->min_nr_stripes * 2);
2170− sh = r5c_recovery_alloc_stripe(conf,
2171− stripe_sect);
2170+ new_size);
2171+ ret = raid5_set_cache_size(mddev, new_size);
2172+ if (conf->min_nr_stripes <= new_size / 2) {
2173+ pr_err("md/raid:%s: Cannot increase cache size, ret=%d, new_size=%d, min_nr_stripes=%d, max_nr_stripes=%d\n",
2174+ mdname(mddev),
2175+ ret,
2176+ new_size,
2177+ conf->min_nr_stripes,
2178+ conf->max_nr_stripes);
2179+ return -ENOMEM;
2180+ }
2181+ sh = r5c_recovery_alloc_stripe(
2182+ conf, stripe_sect, 0);
21722183 }
21732184 if (!sh) {
21742185 pr_err("md/raid:%s: Cannot get enough stripes due to memory pressure. Recovery failed.\n",
2175− mdname(mddev));
2186+ mdname(mddev));
21762187 return -ENOMEM;
21772188 }
21782189 list_add_tail(&sh->lru, cached_stripe_list);
drivers/md/raid5.c+6−2
@@ -6369,6 +6369,7 @@ raid5_show_stripe_cache_size(struct mddev *mddev, char *page) · 6368 unmodified lines
63696369 int
63706370 raid5_set_cache_size(struct mddev *mddev, int size)
63716371 {
6372+ int result = 0;
63726373 struct r5conf *conf = mddev->private;
63736374
63746375 if (size <= 16 || size > 32768)
@@ -6385,11 +6386,14 @@ raid5_set_cache_size(struct mddev *mddev, int size) · 10 unmodified lines
63856386
63866387 mutex_lock(&conf->cache_size_mutex);
63876388 while (size > conf->max_nr_stripes)
6388− if (!grow_one_stripe(conf, GFP_KERNEL))
6389+ if (!grow_one_stripe(conf, GFP_KERNEL)) {
6390+ conf->min_nr_stripes = conf->max_nr_stripes;
6391+ result = -ENOMEM;
63896392 break;
6393+ }
63906394 mutex_unlock(&conf->cache_size_mutex);
63916395
6392− return 0;
6396+ return result;
63936397 }
63946398 EXPORT_SYMBOL(raid5_set_cache_size);
63956399
drivers/media/pci/intel/ipu3/ipu3-cio2.c+2−2
@@ -218,8 +218,8 @@ static int cio2_fbpt_init(struct cio2_device *cio2, struct cio2_queue *q) · 217 unmodified lines
218218 {
219219 struct device *dev = &cio2->pci_dev->dev;
220220
221− q->fbpt = dma_zalloc_coherent(dev, CIO2_FBPT_SIZE, &q->fbpt_bus_addr,
222− GFP_KERNEL);
221+ q->fbpt = dma_alloc_coherent(dev, CIO2_FBPT_SIZE, &q->fbpt_bus_addr,
222+ GFP_KERNEL);
223223 if (!q->fbpt)
224224 return -ENOMEM;
225225
drivers/media/platform/mtk-vcodec/mtk_vcodec_util.c+1−1
@@ -49,7 +49,7 @@ int mtk_vcodec_mem_alloc(struct mtk_vcodec_ctx *data, · 48 unmodified lines
4949 struct mtk_vcodec_ctx *ctx = (struct mtk_vcodec_ctx *)data;
5050 struct device *dev = &ctx->dev->plat_dev->dev;
5151
52− mem->va = dma_zalloc_coherent(dev, size, &mem->dma_addr, GFP_KERNEL);
52+ mem->va = dma_alloc_coherent(dev, size, &mem->dma_addr, GFP_KERNEL);
5353 if (!mem->va) {
5454 mtk_v4l2_err("%s dma_alloc size=%ld failed!", dev_name(dev),
5555 size);
drivers/media/platform/vim2m.c+3−1
@@ -807,7 +807,9 @@ static void vim2m_stop_streaming(struct vb2_queue *q) · 806 unmodified lines
807807 struct vb2_v4l2_buffer *vbuf;
808808 unsigned long flags;
809809
810− cancel_delayed_work_sync(&dev->work_run);
810+ if (v4l2_m2m_get_curr_priv(dev->m2m_dev) == ctx)
811+ cancel_delayed_work_sync(&dev->work_run);
812+
811813 for (;;) {
812814 if (V4L2_TYPE_IS_OUTPUT(q->type))
813815 vbuf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);
drivers/media/v4l2-core/v4l2-ioctl.c+19−5
@@ -287,6 +287,7 @@ static void v4l_print_format(const void *arg, bool write_only) · 286 unmodified lines
287287 const struct v4l2_window *win;
288288 const struct v4l2_sdr_format *sdr;
289289 const struct v4l2_meta_format *meta;
290+ u32 planes;
290291 unsigned i;
291292
292293 pr_cont("type=%s", prt_names(p->type, v4l2_type_names));
@@ -317,7 +318,8 @@ static void v4l_print_format(const void *arg, bool write_only) · 24 unmodified lines
317318 prt_names(mp->field, v4l2_field_names),
318319 mp->colorspace, mp->num_planes, mp->flags,
319320 mp->ycbcr_enc, mp->quantization, mp->xfer_func);
320− for (i = 0; i < mp->num_planes; i++)
321+ planes = min_t(u32, mp->num_planes, VIDEO_MAX_PLANES);
322+ for (i = 0; i < planes; i++)
321323 printk(KERN_DEBUG "plane %u: bytesperline=%u sizeimage=%u\n", i,
322324 mp->plane_fmt[i].bytesperline,
323325 mp->plane_fmt[i].sizeimage);
@@ -1551,8 +1553,11 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops, · 1227 unmodified lines
15511553 if (unlikely(!ops->vidioc_s_fmt_vid_cap_mplane))
15521554 break;
15531555 CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
1556+ if (p->fmt.pix_mp.num_planes > VIDEO_MAX_PLANES)
1557+ break;
15541558 for (i = 0; i < p->fmt.pix_mp.num_planes; i++)
1555− CLEAR_AFTER_FIELD(p, fmt.pix_mp.plane_fmt[i].bytesperline);
1559+ CLEAR_AFTER_FIELD(&p->fmt.pix_mp.plane_fmt[i],
1560+ bytesperline);
15561561 return ops->vidioc_s_fmt_vid_cap_mplane(file, fh, arg);
15571562 case V4L2_BUF_TYPE_VIDEO_OVERLAY:
15581563 if (unlikely(!ops->vidioc_s_fmt_vid_overlay))
@@ -1581,8 +1586,11 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops, · 22 unmodified lines
15811586 if (unlikely(!ops->vidioc_s_fmt_vid_out_mplane))
15821587 break;
15831588 CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
1589+ if (p->fmt.pix_mp.num_planes > VIDEO_MAX_PLANES)
1590+ break;
15841591 for (i = 0; i < p->fmt.pix_mp.num_planes; i++)
1585− CLEAR_AFTER_FIELD(p, fmt.pix_mp.plane_fmt[i].bytesperline);
1592+ CLEAR_AFTER_FIELD(&p->fmt.pix_mp.plane_fmt[i],
1593+ bytesperline);
15861594 return ops->vidioc_s_fmt_vid_out_mplane(file, fh, arg);
15871595 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
15881596 if (unlikely(!ops->vidioc_s_fmt_vid_out_overlay))
@@ -1648,8 +1656,11 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops, · 59 unmodified lines
16481656 if (unlikely(!ops->vidioc_try_fmt_vid_cap_mplane))
16491657 break;
16501658 CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
1659+ if (p->fmt.pix_mp.num_planes > VIDEO_MAX_PLANES)
1660+ break;
16511661 for (i = 0; i < p->fmt.pix_mp.num_planes; i++)
1652− CLEAR_AFTER_FIELD(p, fmt.pix_mp.plane_fmt[i].bytesperline);
1662+ CLEAR_AFTER_FIELD(&p->fmt.pix_mp.plane_fmt[i],
1663+ bytesperline);
16531664 return ops->vidioc_try_fmt_vid_cap_mplane(file, fh, arg);
16541665 case V4L2_BUF_TYPE_VIDEO_OVERLAY:
16551666 if (unlikely(!ops->vidioc_try_fmt_vid_overlay))
@@ -1678,8 +1689,11 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops, · 22 unmodified lines
16781689 if (unlikely(!ops->vidioc_try_fmt_vid_out_mplane))
16791690 break;
16801691 CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
1692+ if (p->fmt.pix_mp.num_planes > VIDEO_MAX_PLANES)
1693+ break;
16811694 for (i = 0; i < p->fmt.pix_mp.num_planes; i++)
1682− CLEAR_AFTER_FIELD(p, fmt.pix_mp.plane_fmt[i].bytesperline);
1695+ CLEAR_AFTER_FIELD(&p->fmt.pix_mp.plane_fmt[i],
1696+ bytesperline);
16831697 return ops->vidioc_try_fmt_vid_out_mplane(file, fh, arg);
16841698 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
16851699 if (unlikely(!ops->vidioc_try_fmt_vid_out_overlay))
drivers/mfd/Kconfig+2−1
@@ -102,6 +102,7 @@ config MFD_AAT2870_CORE · 101 unmodified lines
102102 config MFD_AT91_USART
103103 tristate "AT91 USART Driver"
104104 select MFD_CORE
105+ depends on ARCH_AT91 || COMPILE_TEST
105106 help
106107 Select this to get support for AT91 USART IP. This is a wrapper
107108 over at91-usart-serial driver and usart-spi-driver. Only one function
@@ -1418,7 +1419,7 @@ config MFD_TPS65217 · 1310 unmodified lines
14181419
14191420 config MFD_TPS68470
14201421 bool "TI TPS68470 Power Management / LED chips"
1421− depends on ACPI && I2C=y
1422+ depends on ACPI && PCI && I2C=y
14221423 select MFD_CORE
14231424 select REGMAP_I2C
14241425 select I2C_DESIGNWARE_PLATFORM
drivers/mfd/ab8500-core.c+1−1
@@ -261,7 +261,7 @@ static int get_register_interruptible(struct ab8500 *ab8500, u8 bank, · 260 unmodified lines
261261 mutex_unlock(&ab8500->lock);
262262 dev_vdbg(ab8500->dev, "rd: addr %#x => data %#x\n", addr, ret);
263263
264− return ret;
264+ return (ret < 0) ? ret : 0;
265265 }
266266
267267 static int ab8500_get_register(struct device *dev, u8 bank,
drivers/mfd/axp20x.c+70−56
@@ -641,9 +641,9 @@ static const struct mfd_cell axp221_cells[] = { · 640 unmodified lines
641641
642642 static const struct mfd_cell axp223_cells[] = {
643643 {
644− .name = "axp221-pek",
645− .num_resources = ARRAY_SIZE(axp22x_pek_resources),
646− .resources = axp22x_pek_resources,
644+ .name = "axp221-pek",
645+ .num_resources = ARRAY_SIZE(axp22x_pek_resources),
646+ .resources = axp22x_pek_resources,
647647 }, {
648648 .name = "axp22x-adc",
649649 .of_compatible = "x-powers,axp221-adc",
@@ -651,7 +651,7 @@ static const struct mfd_cell axp223_cells[] = { · 1 unmodified line
651651 .name = "axp20x-battery-power-supply",
652652 .of_compatible = "x-powers,axp221-battery-power-supply",
653653 }, {
654− .name = "axp20x-regulator",
654+ .name = "axp20x-regulator",
655655 }, {
656656 .name = "axp20x-ac-power-supply",
657657 .of_compatible = "x-powers,axp221-ac-power-supply",
@@ -667,9 +667,9 @@ static const struct mfd_cell axp223_cells[] = { · 9 unmodified lines
667667
668668 static const struct mfd_cell axp152_cells[] = {
669669 {
670− .name = "axp20x-pek",
671− .num_resources = ARRAY_SIZE(axp152_pek_resources),
672− .resources = axp152_pek_resources,
670+ .name = "axp20x-pek",
671+ .num_resources = ARRAY_SIZE(axp152_pek_resources),
672+ .resources = axp152_pek_resources,
673673 },
674674 };
675675
@@ -698,87 +698,101 @@ static const struct resource axp288_charger_resources[] = { · 22 unmodified lines
698698
699699 static const struct mfd_cell axp288_cells[] = {
700700 {
701− .name = "axp288_adc",
702− .num_resources = ARRAY_SIZE(axp288_adc_resources),
703− .resources = axp288_adc_resources,
704− },
705− {
706− .name = "axp288_extcon",
707− .num_resources = ARRAY_SIZE(axp288_extcon_resources),
708− .resources = axp288_extcon_resources,
709− },
710− {
711− .name = "axp288_charger",
712− .num_resources = ARRAY_SIZE(axp288_charger_resources),
713− .resources = axp288_charger_resources,
714− },
715− {
716− .name = "axp288_fuel_gauge",
717− .num_resources = ARRAY_SIZE(axp288_fuel_gauge_resources),
718− .resources = axp288_fuel_gauge_resources,
719− },
720− {
721− .name = "axp221-pek",
722− .num_resources = ARRAY_SIZE(axp288_power_button_resources),
723− .resources = axp288_power_button_resources,
724− },
725− {
726− .name = "axp288_pmic_acpi",
701+ .name = "axp288_adc",
702+ .num_resources = ARRAY_SIZE(axp288_adc_resources),
703+ .resources = axp288_adc_resources,
704+ }, {
705+ .name = "axp288_extcon",
706+ .num_resources = ARRAY_SIZE(axp288_extcon_resources),
707+ .resources = axp288_extcon_resources,
708+ }, {
709+ .name = "axp288_charger",
710+ .num_resources = ARRAY_SIZE(axp288_charger_resources),
711+ .resources = axp288_charger_resources,
712+ }, {
713+ .name = "axp288_fuel_gauge",
714+ .num_resources = ARRAY_SIZE(axp288_fuel_gauge_resources),
715+ .resources = axp288_fuel_gauge_resources,
716+ }, {
717+ .name = "axp221-pek",
718+ .num_resources = ARRAY_SIZE(axp288_power_button_resources),
719+ .resources = axp288_power_button_resources,
720+ }, {
721+ .name = "axp288_pmic_acpi",
727722 },
728723 };
729724
730725 static const struct mfd_cell axp803_cells[] = {
731726 {
732− .name = "axp221-pek",
733− .num_resources = ARRAY_SIZE(axp803_pek_resources),
734− .resources = axp803_pek_resources,
727+ .name = "axp221-pek",
728+ .num_resources = ARRAY_SIZE(axp803_pek_resources),
729+ .resources = axp803_pek_resources,
730+ }, {
731+ .name = "axp20x-gpio",
732+ .of_compatible = "x-powers,axp813-gpio",
733+ }, {
734+ .name = "axp813-adc",
735+ .of_compatible = "x-powers,axp813-adc",
736+ }, {
737+ .name = "axp20x-battery-power-supply",
738+ .of_compatible = "x-powers,axp813-battery-power-supply",
739+ }, {
740+ .name = "axp20x-ac-power-supply",
741+ .of_compatible = "x-powers,axp813-ac-power-supply",
742+ .num_resources = ARRAY_SIZE(axp20x_ac_power_supply_resources),
743+ .resources = axp20x_ac_power_supply_resources,
735744 },
736− { .name = "axp20x-regulator" },
745+ { .name = "axp20x-regulator" },
737746 };
738747
739748 static const struct mfd_cell axp806_self_working_cells[] = {
740749 {
741− .name = "axp221-pek",
742− .num_resources = ARRAY_SIZE(axp806_pek_resources),
743− .resources = axp806_pek_resources,
750+ .name = "axp221-pek",
751+ .num_resources = ARRAY_SIZE(axp806_pek_resources),
752+ .resources = axp806_pek_resources,
744753 },
745− { .name = "axp20x-regulator" },
754+ { .name = "axp20x-regulator" },
746755 };
747756
748757 static const struct mfd_cell axp806_cells[] = {
749758 {
750− .id = 2,
751− .name = "axp20x-regulator",
759+ .id = 2,
760+ .name = "axp20x-regulator",
752761 },
753762 };
754763
755764 static const struct mfd_cell axp809_cells[] = {
756765 {
757− .name = "axp221-pek",
758− .num_resources = ARRAY_SIZE(axp809_pek_resources),
759− .resources = axp809_pek_resources,
766+ .name = "axp221-pek",
767+ .num_resources = ARRAY_SIZE(axp809_pek_resources),
768+ .resources = axp809_pek_resources,
760769 }, {
761− .id = 1,
762− .name = "axp20x-regulator",
770+ .id = 1,
771+ .name = "axp20x-regulator",
763772 },
764773 };
765774
766775 static const struct mfd_cell axp813_cells[] = {
767776 {
768− .name = "axp221-pek",
769− .num_resources = ARRAY_SIZE(axp803_pek_resources),
770− .resources = axp803_pek_resources,
777+ .name = "axp221-pek",
778+ .num_resources = ARRAY_SIZE(axp803_pek_resources),
779+ .resources = axp803_pek_resources,
771780 }, {
772− .name = "axp20x-regulator",
781+ .name = "axp20x-regulator",
773782 }, {
774− .name = "axp20x-gpio",
775− .of_compatible = "x-powers,axp813-gpio",
783+ .name = "axp20x-gpio",
784+ .of_compatible = "x-powers,axp813-gpio",
776785 }, {
777− .name = "axp813-adc",
778− .of_compatible = "x-powers,axp813-adc",
786+ .name = "axp813-adc",
787+ .of_compatible = "x-powers,axp813-adc",
779788 }, {
780789 .name = "axp20x-battery-power-supply",
781790 .of_compatible = "x-powers,axp813-battery-power-supply",
791+ }, {
792+ .name = "axp20x-ac-power-supply",
793+ .of_compatible = "x-powers,axp813-ac-power-supply",
794+ .num_resources = ARRAY_SIZE(axp20x_ac_power_supply_resources),
795+ .resources = axp20x_ac_power_supply_resources,
782796 },
783797 };
784798
drivers/mfd/bd9571mwv.c+1−0
@@ -59,6 +59,7 @@ static const struct regmap_access_table bd9571mwv_writable_table = { · 58 unmodified lines
5959 };
6060
6161 static const struct regmap_range bd9571mwv_volatile_yes_ranges[] = {
62+ regmap_reg_range(BD9571MWV_DVFS_MONIVDAC, BD9571MWV_DVFS_MONIVDAC),
6263 regmap_reg_range(BD9571MWV_GPIO_IN, BD9571MWV_GPIO_IN),
6364 regmap_reg_range(BD9571MWV_GPIO_INT, BD9571MWV_GPIO_INT),
6465 regmap_reg_range(BD9571MWV_INT_INTREQ, BD9571MWV_INT_INTREQ),
drivers/mfd/cros_ec_dev.c+1−0
@@ -499,6 +499,7 @@ static int ec_device_remove(struct platform_device *pdev) · 498 unmodified lines
499499
500500 cros_ec_debugfs_remove(ec);
501501
502+ mfd_remove_devices(ec->dev);
502503 cdev_del(&ec->cdev);
503504 device_unregister(&ec->class_dev);
504505 return 0;
drivers/mfd/db8500-prcmu.c+2−2
@@ -2584,7 +2584,7 @@ static struct irq_chip prcmu_irq_chip = { · 2583 unmodified lines
25842584 .irq_unmask = prcmu_irq_unmask,
25852585 };
25862586
2587−static __init char *fw_project_name(u32 project)
2587+static char *fw_project_name(u32 project)
25882588 {
25892589 switch (project) {
25902590 case PRCMU_FW_PROJECT_U8500:
@@ -2732,7 +2732,7 @@ void __init db8500_prcmu_early_init(u32 phy_base, u32 size) · 141 unmodified lines
27322732 INIT_WORK(&mb0_transfer.mask_work, prcmu_mask_work);
27332733 }
27342734
2735−static void __init init_prcm_registers(void)
2735+static void init_prcm_registers(void)
27362736 {
27372737 u32 val;
27382738
drivers/mfd/exynos-lpass.c+3−1
@@ -82,11 +82,13 @@ static void exynos_lpass_enable(struct exynos_lpass *lpass) · 81 unmodified lines
8282 LPASS_INTR_SFR | LPASS_INTR_DMA | LPASS_INTR_I2S);
8383
8484 regmap_write(lpass->top, SFR_LPASS_INTR_CPU_MASK,
85− LPASS_INTR_SFR | LPASS_INTR_DMA | LPASS_INTR_I2S);
85+ LPASS_INTR_SFR | LPASS_INTR_DMA | LPASS_INTR_I2S |
86+ LPASS_INTR_UART);
8687
8788 exynos_lpass_core_sw_reset(lpass, LPASS_I2S_SW_RESET);
8889 exynos_lpass_core_sw_reset(lpass, LPASS_DMA_SW_RESET);
8990 exynos_lpass_core_sw_reset(lpass, LPASS_MEM_SW_RESET);
91+ exynos_lpass_core_sw_reset(lpass, LPASS_UART_SW_RESET);
9092 }
9193
9294 static void exynos_lpass_disable(struct exynos_lpass *lpass)
drivers/mfd/madera-core.c+4−1
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/gpio.h>
1616 #include <linux/mfd/core.h>
1717 #include <linux/module.h>
18+#include <linux/mutex.h>
1819 #include <linux/notifier.h>
1920 #include <linux/of.h>
2021 #include <linux/of_gpio.h>
@@ -155,7 +156,7 @@ static int madera_wait_for_boot(struct madera *madera) · 134 unmodified lines
155156 usleep_range(MADERA_BOOT_POLL_INTERVAL_USEC / 2,
156157 MADERA_BOOT_POLL_INTERVAL_USEC);
157158 regmap_read(madera->regmap, MADERA_IRQ1_RAW_STATUS_1, &val);
158− };
159+ }
159160
160161 if (!(val & MADERA_BOOT_DONE_STS1)) {
161162 dev_err(madera->dev, "Polling BOOT_DONE_STS timed out\n");
@@ -357,6 +358,8 @@ int madera_dev_init(struct madera *madera) · 195 unmodified lines
357358
358359 dev_set_drvdata(madera->dev, madera);
359360 BLOCKING_INIT_NOTIFIER_HEAD(&madera->notifier);
361+ mutex_init(&madera->dapm_ptr_lock);
362+
360363 madera_set_micbias_info(madera);
361364
362365 /*
drivers/mfd/max77620.c+1−1
@@ -280,7 +280,7 @@ static int max77620_config_fps(struct max77620_chip *chip, · 279 unmodified lines
280280
281281 for (fps_id = 0; fps_id < MAX77620_FPS_COUNT; fps_id++) {
282282 sprintf(fps_name, "fps%d", fps_id);
283− if (!strcmp(fps_np->name, fps_name))
283+ if (of_node_name_eq(fps_np, fps_name))
284284 break;
285285 }
286286
drivers/mfd/mc13xxx-core.c+3−1
@@ -274,7 +274,9 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode, · 273 unmodified lines
274274
275275 mc13xxx->adcflags |= MC13XXX_ADC_WORKING;
276276
277− mc13xxx_reg_read(mc13xxx, MC13XXX_ADC0, &old_adc0);
277+ ret = mc13xxx_reg_read(mc13xxx, MC13XXX_ADC0, &old_adc0);
278+ if (ret)
279+ goto out;
278280
279281 adc0 = MC13XXX_ADC0_ADINC1 | MC13XXX_ADC0_ADINC2 |
280282 MC13XXX_ADC0_CHRGRAWDIV;
drivers/mfd/mt6397-core.c+1−2
@@ -329,8 +329,7 @@ static int mt6397_probe(struct platform_device *pdev) · 328 unmodified lines
329329
330330 default:
331331 dev_err(&pdev->dev, "unsupported chip: %d\n", id);
332− ret = -ENODEV;
333− break;
332+ return -ENODEV;
334333 }
335334
336335 if (ret) {
drivers/mfd/qcom_rpm.c+4−0
@@ -638,6 +638,10 @@ static int qcom_rpm_probe(struct platform_device *pdev) · 637 unmodified lines
638638 return -EFAULT;
639639 }
640640
641+ writel(fw_version[0], RPM_CTRL_REG(rpm, 0));
642+ writel(fw_version[1], RPM_CTRL_REG(rpm, 1));
643+ writel(fw_version[2], RPM_CTRL_REG(rpm, 2));
644+
641645 dev_info(&pdev->dev, "RPM firmware %u.%u.%u\n", fw_version[0],
642646 fw_version[1],
643647 fw_version[2]);
drivers/mfd/rave-sp.c+1−1
@@ -109,7 +109,7 @@ struct rave_sp_reply { · 108 unmodified lines
109109 /**
110110 * struct rave_sp_checksum - Variant specific checksum implementation details
111111 *
112− * @length: Caculated checksum length
112+ * @length: Calculated checksum length
113113 * @subroutine: Utilized checksum algorithm implementation
114114 */
115115 struct rave_sp_checksum {
drivers/mfd/stmpe.c+6−6
@@ -1302,17 +1302,17 @@ static void stmpe_of_probe(struct stmpe_platform_data *pdata, · 1301 unmodified lines
13021302 pdata->autosleep = (pdata->autosleep_timeout) ? true : false;
13031303
13041304 for_each_child_of_node(np, child) {
1305− if (!strcmp(child->name, "stmpe_gpio")) {
1305+ if (of_node_name_eq(child, "stmpe_gpio")) {
13061306 pdata->blocks |= STMPE_BLOCK_GPIO;
1307− } else if (!strcmp(child->name, "stmpe_keypad")) {
1307+ } else if (of_node_name_eq(child, "stmpe_keypad")) {
13081308 pdata->blocks |= STMPE_BLOCK_KEYPAD;
1309− } else if (!strcmp(child->name, "stmpe_touchscreen")) {
1309+ } else if (of_node_name_eq(child, "stmpe_touchscreen")) {
13101310 pdata->blocks |= STMPE_BLOCK_TOUCHSCREEN;
1311− } else if (!strcmp(child->name, "stmpe_adc")) {
1311+ } else if (of_node_name_eq(child, "stmpe_adc")) {
13121312 pdata->blocks |= STMPE_BLOCK_ADC;
1313− } else if (!strcmp(child->name, "stmpe_pwm")) {
1313+ } else if (of_node_name_eq(child, "stmpe_pwm")) {
13141314 pdata->blocks |= STMPE_BLOCK_PWM;
1315− } else if (!strcmp(child->name, "stmpe_rotator")) {
1315+ } else if (of_node_name_eq(child, "stmpe_rotator")) {
13161316 pdata->blocks |= STMPE_BLOCK_ROTATOR;
13171317 }
13181318 }
drivers/mfd/ti_am335x_tscadc.c+3−2
@@ -264,8 +264,9 @@ static int ti_tscadc_probe(struct platform_device *pdev) · 263 unmodified lines
264264 cell->pdata_size = sizeof(tscadc);
265265 }
266266
267− err = mfd_add_devices(&pdev->dev, pdev->id, tscadc->cells,
268− tscadc->used_cells, NULL, 0, NULL);
267+ err = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
268+ tscadc->cells, tscadc->used_cells, NULL,
269+ 0, NULL);
269270 if (err < 0)
270271 goto err_disable_clk;
271272
drivers/mfd/tps65218.c+3−21
@@ -235,9 +235,9 @@ static int tps65218_probe(struct i2c_client *client, · 234 unmodified lines
235235
236236 mutex_init(&tps->tps_lock);
237237
238− ret = regmap_add_irq_chip(tps->regmap, tps->irq,
239− IRQF_ONESHOT, 0, &tps65218_irq_chip,
240− &tps->irq_data);
238+ ret = devm_regmap_add_irq_chip(&client->dev, tps->regmap, tps->irq,
239+ IRQF_ONESHOT, 0, &tps65218_irq_chip,
240+ &tps->irq_data);
241241 if (ret < 0)
242242 return ret;
243243
@@ -253,26 +253,9 @@ static int tps65218_probe(struct i2c_client *client, · 9 unmodified lines
253253 ARRAY_SIZE(tps65218_cells), NULL, 0,
254254 regmap_irq_get_domain(tps->irq_data));
255255
256− if (ret < 0)
257− goto err_irq;
258−
259− return 0;
260−
261−err_irq:
262− regmap_del_irq_chip(tps->irq, tps->irq_data);
263−
264256 return ret;
265257 }
266258
267−static int tps65218_remove(struct i2c_client *client)
268−{
269− struct tps65218 *tps = i2c_get_clientdata(client);
270−
271− regmap_del_irq_chip(tps->irq, tps->irq_data);
272−
273− return 0;
274−}
275−
276259 static const struct i2c_device_id tps65218_id_table[] = {
277260 { "tps65218", TPS65218 },
278261 { },
@@ -285,7 +268,6 @@ static struct i2c_driver tps65218_driver = { · 6 unmodified lines
285268 .of_match_table = of_tps65218_match_table,
286269 },
287270 .probe = tps65218_probe,
288− .remove = tps65218_remove,
289271 .id_table = tps65218_id_table,
290272 };
291273
drivers/mfd/tps6586x.c+24−0
@@ -592,6 +592,29 @@ static int tps6586x_i2c_remove(struct i2c_client *client) · 591 unmodified lines
592592 return 0;
593593 }
594594
595+static int __maybe_unused tps6586x_i2c_suspend(struct device *dev)
596+{
597+ struct tps6586x *tps6586x = dev_get_drvdata(dev);
598+
599+ if (tps6586x->client->irq)
600+ disable_irq(tps6586x->client->irq);
601+
602+ return 0;
603+}
604+
605+static int __maybe_unused tps6586x_i2c_resume(struct device *dev)
606+{
607+ struct tps6586x *tps6586x = dev_get_drvdata(dev);
608+
609+ if (tps6586x->client->irq)
610+ enable_irq(tps6586x->client->irq);
611+
612+ return 0;
613+}
614+
615+static SIMPLE_DEV_PM_OPS(tps6586x_pm_ops, tps6586x_i2c_suspend,
616+ tps6586x_i2c_resume);
617+
595618 static const struct i2c_device_id tps6586x_id_table[] = {
596619 { "tps6586x", 0 },
597620 { },
@@ -602,6 +625,7 @@ static struct i2c_driver tps6586x_driver = { · 4 unmodified lines
602625 .driver = {
603626 .name = "tps6586x",
604627 .of_match_table = of_match_ptr(tps6586x_of_match),
628+ .pm = &tps6586x_pm_ops,
605629 },
606630 .probe = tps6586x_i2c_probe,
607631 .remove = tps6586x_i2c_remove,
drivers/mfd/twl-core.c+2−2
@@ -979,7 +979,7 @@ add_children(struct twl4030_platform_data *pdata, unsigned irq_base, · 978 unmodified lines
979979 * letting it generate the right frequencies for USB, MADC, and
980980 * other purposes.
981981 */
982−static inline int __init protect_pm_master(void)
982+static inline int protect_pm_master(void)
983983 {
984984 int e = 0;
985985
@@ -988,7 +988,7 @@ static inline int __init protect_pm_master(void) · 2 unmodified lines
988988 return e;
989989 }
990990
991−static inline int __init unprotect_pm_master(void)
991+static inline int unprotect_pm_master(void)
992992 {
993993 int e = 0;
994994
drivers/mfd/wm5110-tables.c+2−0
@@ -1618,6 +1618,7 @@ static const struct reg_default wm5110_reg_default[] = { · 1617 unmodified lines
16181618 { 0x00000ECD, 0x0000 }, /* R3789 - HPLPF4_2 */
16191619 { 0x00000EE0, 0x0000 }, /* R3808 - ASRC_ENABLE */
16201620 { 0x00000EE2, 0x0000 }, /* R3810 - ASRC_RATE1 */
1621+ { 0x00000EE3, 0x4000 }, /* R3811 - ASRC_RATE2 */
16211622 { 0x00000EF0, 0x0000 }, /* R3824 - ISRC 1 CTRL 1 */
16221623 { 0x00000EF1, 0x0000 }, /* R3825 - ISRC 1 CTRL 2 */
16231624 { 0x00000EF2, 0x0000 }, /* R3826 - ISRC 1 CTRL 3 */
@@ -2869,6 +2870,7 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg) · 1245 unmodified lines
28692870 case ARIZONA_ASRC_ENABLE:
28702871 case ARIZONA_ASRC_STATUS:
28712872 case ARIZONA_ASRC_RATE1:
2873+ case ARIZONA_ASRC_RATE2:
28722874 case ARIZONA_ISRC_1_CTRL_1:
28732875 case ARIZONA_ISRC_1_CTRL_2:
28742876 case ARIZONA_ISRC_1_CTRL_3:
drivers/misc/genwqe/card_utils.c+2−2
@@ -218,8 +218,8 @@ void *__genwqe_alloc_consistent(struct genwqe_dev *cd, size_t size, · 217 unmodified lines
218218 if (get_order(size) >= MAX_ORDER)
219219 return NULL;
220220
221− return dma_zalloc_coherent(&cd->pci_dev->dev, size, dma_handle,
222− GFP_KERNEL);
221+ return dma_alloc_coherent(&cd->pci_dev->dev, size, dma_handle,
222+ GFP_KERNEL);
223223 }
224224
225225 void __genwqe_free_consistent(struct genwqe_dev *cd, size_t size,
drivers/misc/ibmvmc.c+5−2
@@ -820,21 +820,24 @@ static int ibmvmc_send_msg(struct crq_server_adapter *adapter, · 819 unmodified lines
820820 *
821821 * Return:
822822 * 0 - Success
823+ * Non-zero - Failure
823824 */
824825 static int ibmvmc_open(struct inode *inode, struct file *file)
825826 {
826827 struct ibmvmc_file_session *session;
827− int rc = 0;
828828
829829 pr_debug("%s: inode = 0x%lx, file = 0x%lx, state = 0x%x\n", __func__,
830830 (unsigned long)inode, (unsigned long)file,
831831 ibmvmc.state);
832832
833833 session = kzalloc(sizeof(*session), GFP_KERNEL);
834+ if (!session)
835+ return -ENOMEM;
836+
834837 session->file = file;
835838 file->private_data = session;
836839
837− return rc;
840+ return 0;
838841 }
839842
840843 /**
drivers/misc/mei/client.c+4−1
@@ -401,8 +401,11 @@ static void mei_io_list_flush_cl(struct list_head *head, · 400 unmodified lines
401401 struct mei_cl_cb *cb, *next;
402402
403403 list_for_each_entry_safe(cb, next, head, list) {
404− if (cl == cb->cl)
404+ if (cl == cb->cl) {
405405 list_del_init(&cb->list);
406+ if (cb->fop_type == MEI_FOP_READ)
407+ mei_io_cb_free(cb);
408+ }
406409 }
407410 }
408411
drivers/misc/mei/hbm.c+9−3
@@ -1187,9 +1187,15 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr) · 1186 unmodified lines
11871187 dma_setup_res = (struct hbm_dma_setup_response *)mei_msg;
11881188
11891189 if (dma_setup_res->status) {
1190− dev_info(dev->dev, "hbm: dma setup response: failure = %d %s\n",
1191− dma_setup_res->status,
1192− mei_hbm_status_str(dma_setup_res->status));
1190+ u8 status = dma_setup_res->status;
1191+
1192+ if (status == MEI_HBMS_NOT_ALLOWED) {
1193+ dev_dbg(dev->dev, "hbm: dma setup not allowed\n");
1194+ } else {
1195+ dev_info(dev->dev, "hbm: dma setup response: failure = %d %s\n",
1196+ status,
1197+ mei_hbm_status_str(status));
1198+ }
11931199 dev->hbm_f_dr_supported = 0;
11941200 mei_dmam_ring_free(dev);
11951201 }
drivers/misc/mei/hw-me-regs.h+4−0
@@ -127,6 +127,8 @@ · 126 unmodified lines
127127 #define MEI_DEV_ID_BXT_M 0x1A9A /* Broxton M */
128128 #define MEI_DEV_ID_APL_I 0x5A9A /* Apollo Lake I */
129129
130+#define MEI_DEV_ID_DNV_IE 0x19E5 /* Denverton IE */
131+
130132 #define MEI_DEV_ID_GLK 0x319A /* Gemini Lake */
131133
132134 #define MEI_DEV_ID_KBP 0xA2BA /* Kaby Point */
@@ -137,6 +139,8 @@ · 4 unmodified lines
137139 #define MEI_DEV_ID_CNP_H 0xA360 /* Cannon Point H */
138140 #define MEI_DEV_ID_CNP_H_4 0xA364 /* Cannon Point H 4 (iTouch) */
139141
142+#define MEI_DEV_ID_ICP_LP 0x34E0 /* Ice Lake Point LP */
143+
140144 /*
141145 * MEI HW Section
142146 */
drivers/misc/mei/pci-me.c+5−1
@@ -88,11 +88,13 @@ static const struct pci_device_id mei_me_pci_tbl[] = { · 87 unmodified lines
8888 {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_2, MEI_ME_PCH8_CFG)},
8989 {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H, MEI_ME_PCH8_SPS_CFG)},
9090 {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H_2, MEI_ME_PCH8_SPS_CFG)},
91− {MEI_PCI_DEVICE(MEI_DEV_ID_LBG, MEI_ME_PCH8_CFG)},
91+ {MEI_PCI_DEVICE(MEI_DEV_ID_LBG, MEI_ME_PCH12_CFG)},
9292
9393 {MEI_PCI_DEVICE(MEI_DEV_ID_BXT_M, MEI_ME_PCH8_CFG)},
9494 {MEI_PCI_DEVICE(MEI_DEV_ID_APL_I, MEI_ME_PCH8_CFG)},
9595
96+ {MEI_PCI_DEVICE(MEI_DEV_ID_DNV_IE, MEI_ME_PCH8_CFG)},
97+
9698 {MEI_PCI_DEVICE(MEI_DEV_ID_GLK, MEI_ME_PCH8_CFG)},
9799
98100 {MEI_PCI_DEVICE(MEI_DEV_ID_KBP, MEI_ME_PCH8_CFG)},
@@ -103,6 +105,8 @@ static const struct pci_device_id mei_me_pci_tbl[] = { · 4 unmodified lines
103105 {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H, MEI_ME_PCH12_CFG)},
104106 {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H_4, MEI_ME_PCH8_CFG)},
105107
108+ {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_LP, MEI_ME_PCH12_CFG)},
109+
106110 /* required last entry */
107111 {0, }
108112 };
drivers/misc/mic/vop/vop_main.c+50−32
@@ -47,7 +47,8 @@ · 46 unmodified lines
4747 * @dc: Virtio device control
4848 * @vpdev: VOP device which is the parent for this virtio device
4949 * @vr: Buffer for accessing the VRING
50− * @used: Buffer for used
50+ * @used_virt: Virtual address of used ring
51+ * @used: DMA address of used ring
5152 * @used_size: Size of the used buffer
5253 * @reset_done: Track whether VOP reset is complete
5354 * @virtio_cookie: Cookie returned upon requesting a interrupt
@@ -61,6 +62,7 @@ struct _vop_vdev { · 7 unmodified lines
6162 struct mic_device_ctrl __iomem *dc;
6263 struct vop_device *vpdev;
6364 void __iomem *vr[VOP_MAX_VRINGS];
65+ void *used_virt[VOP_MAX_VRINGS];
6466 dma_addr_t used[VOP_MAX_VRINGS];
6567 int used_size[VOP_MAX_VRINGS];
6668 struct completion reset_done;
@@ -260,12 +262,12 @@ static bool vop_notify(struct virtqueue *vq) · 193 unmodified lines
260262 static void vop_del_vq(struct virtqueue *vq, int n)
261263 {
262264 struct _vop_vdev *vdev = to_vopvdev(vq->vdev);
263− struct vring *vr = (struct vring *)(vq + 1);
264265 struct vop_device *vpdev = vdev->vpdev;
265266
266267 dma_unmap_single(&vpdev->dev, vdev->used[n],
267268 vdev->used_size[n], DMA_BIDIRECTIONAL);
268− free_pages((unsigned long)vr->used, get_order(vdev->used_size[n]));
269+ free_pages((unsigned long)vdev->used_virt[n],
270+ get_order(vdev->used_size[n]));
269271 vring_del_virtqueue(vq);
270272 vpdev->hw_ops->iounmap(vpdev, vdev->vr[n]);
271273 vdev->vr[n] = NULL;
@@ -283,6 +285,26 @@ static void vop_del_vqs(struct virtio_device *dev) · 11 unmodified lines
283285 vop_del_vq(vq, idx++);
284286 }
285287
288+static struct virtqueue *vop_new_virtqueue(unsigned int index,
289+ unsigned int num,
290+ struct virtio_device *vdev,
291+ bool context,
292+ void *pages,
293+ bool (*notify)(struct virtqueue *vq),
294+ void (*callback)(struct virtqueue *vq),
295+ const char *name,
296+ void *used)
297+{
298+ bool weak_barriers = false;
299+ struct vring vring;
300+
301+ vring_init(&vring, num, pages, MIC_VIRTIO_RING_ALIGN);
302+ vring.used = used;
303+
304+ return __vring_new_virtqueue(index, vring, vdev, weak_barriers, context,
305+ notify, callback, name);
306+}
307+
286308 /*
287309 * This routine will assign vring's allocated in host/io memory. Code in
288310 * virtio_ring.c however continues to access this io memory as if it were local
@@ -302,7 +324,6 @@ static struct virtqueue *vop_find_vq(struct virtio_device *dev, · 13 unmodified lines
302324 struct _mic_vring_info __iomem *info;
303325 void *used;
304326 int vr_size, _vr_size, err, magic;
305− struct vring *vr;
306327 u8 type = ioread8(&vdev->desc->type);
307328
308329 if (index >= ioread8(&vdev->desc->num_vq))
@@ -322,17 +343,7 @@ static struct virtqueue *vop_find_vq(struct virtio_device *dev, · 13 unmodified lines
322343 return ERR_PTR(-ENOMEM);
323344 vdev->vr[index] = va;
324345 memset_io(va, 0x0, _vr_size);
325− vq = vring_new_virtqueue(
326− index,
327− le16_to_cpu(config.num), MIC_VIRTIO_RING_ALIGN,
328− dev,
329− false,
330− ctx,
331− (void __force *)va, vop_notify, callback, name);
332− if (!vq) {
333− err = -ENOMEM;
334− goto unmap;
335− }
346+
336347 info = va + _vr_size;
337348 magic = ioread32(&info->magic);
338349
@@ -341,18 +352,27 @@ static struct virtqueue *vop_find_vq(struct virtio_device *dev, · 2 unmodified lines
341352 goto unmap;
342353 }
343354
344− /* Allocate and reassign used ring now */
345355 vdev->used_size[index] = PAGE_ALIGN(sizeof(__u16) * 3 +
346356 sizeof(struct vring_used_elem) *
347357 le16_to_cpu(config.num));
348358 used = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
349359 get_order(vdev->used_size[index]));
360+ vdev->used_virt[index] = used;
350361 if (!used) {
351362 err = -ENOMEM;
352363 dev_err(_vop_dev(vdev), "%s %d err %d\n",
353364 __func__, __LINE__, err);
354− goto del_vq;
365+ goto unmap;
355366 }
367+
368+ vq = vop_new_virtqueue(index, le16_to_cpu(config.num), dev, ctx,
369+ (void __force *)va, vop_notify, callback,
370+ name, used);
371+ if (!vq) {
372+ err = -ENOMEM;
373+ goto free_used;
374+ }
375+
356376 vdev->used[index] = dma_map_single(&vpdev->dev, used,
357377 vdev->used_size[index],
358378 DMA_BIDIRECTIONAL);
@@ -360,26 +380,17 @@ static struct virtqueue *vop_find_vq(struct virtio_device *dev, · 1 unmodified line
360380 err = -ENOMEM;
361381 dev_err(_vop_dev(vdev), "%s %d err %d\n",
362382 __func__, __LINE__, err);
363− goto free_used;
383+ goto del_vq;
364384 }
365385 writeq(vdev->used[index], &vqconfig->used_address);
366− /*
367− * To reassign the used ring here we are directly accessing
368− * struct vring_virtqueue which is a private data structure
369− * in virtio_ring.c. At the minimum, a BUILD_BUG_ON() in
370− * vring_new_virtqueue() would ensure that
371− * (&vq->vring == (struct vring *) (&vq->vq + 1));
372− */
373− vr = (struct vring *)(vq + 1);
374− vr->used = used;
375386
376387 vq->priv = vdev;
377388 return vq;
389+del_vq:
390+ vring_del_virtqueue(vq);
378391 free_used:
379392 free_pages((unsigned long)used,
380393 get_order(vdev->used_size[index]));
381−del_vq:
382− vring_del_virtqueue(vq);
383394 unmap:
384395 vpdev->hw_ops->iounmap(vpdev, vdev->vr[index]);
385396 return ERR_PTR(err);
@@ -394,16 +405,21 @@ static int vop_find_vqs(struct virtio_device *dev, unsigned nvqs, · 8 unmodified lines
394405 struct _vop_vdev *vdev = to_vopvdev(dev);
395406 struct vop_device *vpdev = vdev->vpdev;
396407 struct mic_device_ctrl __iomem *dc = vdev->dc;
397− int i, err, retry;
408+ int i, err, retry, queue_idx = 0;
398409
399410 /* We must have this many virtqueues. */
400411 if (nvqs > ioread8(&vdev->desc->num_vq))
401412 return -ENOENT;
402413
403414 for (i = 0; i < nvqs; ++i) {
415+ if (!names[i]) {
416+ vqs[i] = NULL;
417+ continue;
418+ }
419+
404420 dev_dbg(_vop_dev(vdev), "%s: %d: %s\n",
405421 __func__, i, names[i]);
406− vqs[i] = vop_find_vq(dev, i, callbacks[i], names[i],
422+ vqs[i] = vop_find_vq(dev, queue_idx++, callbacks[i], names[i],
407423 ctx ? ctx[i] : false);
408424 if (IS_ERR(vqs[i])) {
409425 err = PTR_ERR(vqs[i]);
@@ -576,6 +592,8 @@ static int _vop_remove_device(struct mic_device_desc __iomem *d, · 166 unmodified lines
576592 int ret = -1;
577593
578594 if (ioread8(&dc->config_change) == MIC_VIRTIO_PARAM_DEV_REMOVE) {
595+ struct device *dev = get_device(&vdev->vdev.dev);
596+
579597 dev_dbg(&vpdev->dev,
580598 "%s %d config_change %d type %d vdev %p\n",
581599 __func__, __LINE__,
@@ -587,7 +605,7 @@ static int _vop_remove_device(struct mic_device_desc __iomem *d, · 5 unmodified lines
587605 iowrite8(-1, &dc->h2c_vdev_db);
588606 if (status & VIRTIO_CONFIG_S_DRIVER_OK)
589607 wait_for_completion(&vdev->reset_done);
590− put_device(&vdev->vdev.dev);
608+ put_device(dev);
591609 iowrite8(1, &dc->guest_ack);
592610 dev_dbg(&vpdev->dev, "%s %d guest_ack %d\n",
593611 __func__, __LINE__, ioread8(&dc->guest_ack));
drivers/misc/pvpanic.c+4−0
@@ -70,8 +70,12 @@ pvpanic_walk_resources(struct acpi_resource *res, void *context) · 69 unmodified lines
7070 struct resource r;
7171
7272 if (acpi_dev_resource_io(res, &r)) {
73+#ifdef CONFIG_HAS_IOPORT_MAP
7374 base = ioport_map(r.start, resource_size(&r));
7475 return AE_OK;
76+#else
77+ return AE_ERROR;
78+#endif
7579 } else if (acpi_dev_resource_memory(res, &r)) {
7680 base = ioremap(r.start, resource_size(&r));
7781 return AE_OK;
drivers/mmc/core/host.c+1−1
@@ -234,7 +234,7 @@ int mmc_of_parse(struct mmc_host *host) · 233 unmodified lines
234234 if (device_property_read_bool(dev, "broken-cd"))
235235 host->caps |= MMC_CAP_NEEDS_POLL;
236236
237− ret = mmc_gpiod_request_cd(host, "cd", 0, true,
237+ ret = mmc_gpiod_request_cd(host, "cd", 0, false,
238238 cd_debounce_delay_ms * 1000,
239239 &cd_gpio_invert);
240240 if (!ret)
drivers/mmc/host/Kconfig+2−2
@@ -116,7 +116,7 @@ config MMC_RICOH_MMC · 115 unmodified lines
116116
117117 config MMC_SDHCI_ACPI
118118 tristate "SDHCI support for ACPI enumerated SDHCI controllers"
119− depends on MMC_SDHCI && ACPI
119+ depends on MMC_SDHCI && ACPI && PCI
120120 select IOSF_MBI if X86
121121 help
122122 This selects support for ACPI enumerated SDHCI controllers,
@@ -978,7 +978,7 @@ config MMC_SDHCI_OMAP · 855 unmodified lines
978978 tristate "TI SDHCI Controller Support"
979979 depends on MMC_SDHCI_PLTFM && OF
980980 select THERMAL
981− select TI_SOC_THERMAL
981+ imply TI_SOC_THERMAL
982982 help
983983 This selects the Secure Digital Host Controller Interface (SDHCI)
984984 support present in TI's DRA7 SOCs. The controller supports
drivers/mmc/host/bcm2835.c+2−0
@@ -1431,6 +1431,8 @@ static int bcm2835_probe(struct platform_device *pdev) · 1430 unmodified lines
14311431
14321432 err:
14331433 dev_dbg(dev, "%s -> err %d\n", __func__, ret);
1434+ if (host->dma_chan_rxtx)
1435+ dma_release_channel(host->dma_chan_rxtx);
14341436 mmc_free_host(mmc);
14351437
14361438 return ret;
drivers/mmc/host/dw_mmc-bluefield.c+0−5
@@ -1,11 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0
22 /*
33 * Copyright (C) 2018 Mellanox Technologies.
4− *
5− * This program is free software; you can redistribute it and/or modify
6− * it under the terms of the GNU General Public License as published by
7− * the Free Software Foundation; either version 2 of the License, or
8− * (at your option) any later version.
94 */
105
116 #include <linux/bitfield.h>
drivers/mmc/host/meson-gx-mmc.c+20−12
@@ -179,6 +179,8 @@ struct meson_host { · 178 unmodified lines
179179 struct sd_emmc_desc *descs;
180180 dma_addr_t descs_dma_addr;
181181
182+ int irq;
183+
182184 bool vqmmc_enabled;
183185 };
184186
@@ -738,6 +740,11 @@ static int meson_mmc_clk_phase_tuning(struct mmc_host *mmc, u32 opcode, · 553 unmodified lines
738740 static int meson_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
739741 {
740742 struct meson_host *host = mmc_priv(mmc);
743+ int adj = 0;
744+
745+ /* enable signal resampling w/o delay */
746+ adj = ADJUST_ADJ_EN;
747+ writel(adj, host->regs + host->data->adjust);
741748
742749 return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk);
743750 }
@@ -768,6 +775,9 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) · 24 unmodified lines
768775 if (!IS_ERR(mmc->supply.vmmc))
769776 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
770777
778+ /* disable signal resampling */
779+ writel(0, host->regs + host->data->adjust);
780+
771781 /* Reset rx phase */
772782 clk_set_phase(host->rx_clk, 0);
773783
@@ -1166,7 +1176,7 @@ static int meson_mmc_get_cd(struct mmc_host *mmc) · 392 unmodified lines
11661176
11671177 static void meson_mmc_cfg_init(struct meson_host *host)
11681178 {
1169− u32 cfg = 0, adj = 0;
1179+ u32 cfg = 0;
11701180
11711181 cfg |= FIELD_PREP(CFG_RESP_TIMEOUT_MASK,
11721182 ilog2(SD_EMMC_CFG_RESP_TIMEOUT));
@@ -1177,10 +1187,6 @@ static void meson_mmc_cfg_init(struct meson_host *host) · 4 unmodified lines
11771187 cfg |= CFG_ERR_ABORT;
11781188
11791189 writel(cfg, host->regs + SD_EMMC_CFG);
1180−
1181− /* enable signal resampling w/o delay */
1182− adj = ADJUST_ADJ_EN;
1183− writel(adj, host->regs + host->data->adjust);
11841190 }
11851191
11861192 static int meson_mmc_card_busy(struct mmc_host *mmc)
@@ -1231,7 +1237,7 @@ static int meson_mmc_probe(struct platform_device *pdev) · 44 unmodified lines
12311237 struct resource *res;
12321238 struct meson_host *host;
12331239 struct mmc_host *mmc;
1234− int ret, irq;
1240+ int ret;
12351241
12361242 mmc = mmc_alloc_host(sizeof(struct meson_host), &pdev->dev);
12371243 if (!mmc)
@@ -1276,8 +1282,8 @@ static int meson_mmc_probe(struct platform_device *pdev) · 38 unmodified lines
12761282 goto free_host;
12771283 }
12781284
1279− irq = platform_get_irq(pdev, 0);
1280− if (irq <= 0) {
1285+ host->irq = platform_get_irq(pdev, 0);
1286+ if (host->irq <= 0) {
12811287 dev_err(&pdev->dev, "failed to get interrupt resource.\n");
12821288 ret = -EINVAL;
12831289 goto free_host;
@@ -1331,9 +1337,8 @@ static int meson_mmc_probe(struct platform_device *pdev) · 47 unmodified lines
13311337 writel(IRQ_CRC_ERR | IRQ_TIMEOUTS | IRQ_END_OF_CHAIN,
13321338 host->regs + SD_EMMC_IRQ_EN);
13331339
1334− ret = devm_request_threaded_irq(&pdev->dev, irq, meson_mmc_irq,
1335− meson_mmc_irq_thread, IRQF_SHARED,
1336− NULL, host);
1340+ ret = request_threaded_irq(host->irq, meson_mmc_irq,
1341+ meson_mmc_irq_thread, IRQF_SHARED, NULL, host);
13371342 if (ret)
13381343 goto err_init_clk;
13391344
@@ -1351,7 +1356,7 @@ static int meson_mmc_probe(struct platform_device *pdev) · 11 unmodified lines
13511356 if (host->bounce_buf == NULL) {
13521357 dev_err(host->dev, "Unable to map allocate DMA bounce buffer.\n");
13531358 ret = -ENOMEM;
1354− goto err_init_clk;
1359+ goto err_free_irq;
13551360 }
13561361
13571362 host->descs = dma_alloc_coherent(host->dev, SD_EMMC_DESC_BUF_LEN,
@@ -1370,6 +1375,8 @@ static int meson_mmc_probe(struct platform_device *pdev) · 12 unmodified lines
13701375 err_bounce_buf:
13711376 dma_free_coherent(host->dev, host->bounce_buf_size,
13721377 host->bounce_buf, host->bounce_dma_addr);
1378+err_free_irq:
1379+ free_irq(host->irq, host);
13731380 err_init_clk:
13741381 clk_disable_unprepare(host->mmc_clk);
13751382 err_core_clk:
@@ -1387,6 +1394,7 @@ static int meson_mmc_remove(struct platform_device *pdev) · 11 unmodified lines
13871394
13881395 /* disable interrupts */
13891396 writel(0, host->regs + SD_EMMC_IRQ_EN);
1397+ free_irq(host->irq, host);
13901398
13911399 dma_free_coherent(host->dev, SD_EMMC_DESC_BUF_LEN,
13921400 host->descs, host->descs_dma_addr);
drivers/mmc/host/mtk-sd.c+1−1
@@ -846,7 +846,7 @@ static void msdc_set_mclk(struct msdc_host *host, unsigned char timing, u32 hz) · 845 unmodified lines
846846
847847 if (timing == MMC_TIMING_MMC_HS400 &&
848848 host->dev_comp->hs400_tune)
849− sdr_set_field(host->base + PAD_CMD_TUNE,
849+ sdr_set_field(host->base + tune_reg,
850850 MSDC_PAD_TUNE_CMDRRDLY,
851851 host->hs400_cmd_int_delay);
852852 dev_dbg(host->dev, "sclk: %d, timing: %d\n", host->mmc->actual_clock,
drivers/mmc/host/sdhci-iproc.c+4−1
@@ -296,7 +296,10 @@ static int sdhci_iproc_probe(struct platform_device *pdev) · 295 unmodified lines
296296
297297 iproc_host->data = iproc_data;
298298
299− mmc_of_parse(host->mmc);
299+ ret = mmc_of_parse(host->mmc);
300+ if (ret)
301+ goto err;
302+
300303 sdhci_get_property(pdev);
301304
302305 host->mmc->caps |= iproc_host->data->mmc_caps;
drivers/mmc/host/sdhci.c+3−2
@@ -3763,8 +3763,9 @@ int sdhci_setup_host(struct sdhci_host *host) · 3762 unmodified lines
37633763 * Use zalloc to zero the reserved high 32-bits of 128-bit
37643764 * descriptors so that they never need to be written.
37653765 */
3766− buf = dma_zalloc_coherent(mmc_dev(mmc), host->align_buffer_sz +
3767− host->adma_table_sz, &dma, GFP_KERNEL);
3766+ buf = dma_alloc_coherent(mmc_dev(mmc),
3767+ host->align_buffer_sz + host->adma_table_sz,
3768+ &dma, GFP_KERNEL);
37683769 if (!buf) {
37693770 pr_warn("%s: Unable to allocate ADMA buffers - falling back to standard DMA\n",
37703771 mmc_hostname(mmc));
drivers/mtd/mtdcore.c+1−1
@@ -522,7 +522,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd) · 521 unmodified lines
522522 mtd->nvmem = nvmem_register(&config);
523523 if (IS_ERR(mtd->nvmem)) {
524524 /* Just ignore if there is no NVMEM support in the kernel */
525− if (PTR_ERR(mtd->nvmem) == -ENOSYS) {
525+ if (PTR_ERR(mtd->nvmem) == -EOPNOTSUPP) {
526526 mtd->nvmem = NULL;
527527 } else {
528528 dev_err(&mtd->dev, "Failed to register NVMEM device\n");
drivers/mtd/mtdcore.h+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 extern struct mutex mtd_table_mutex;
88
99 struct mtd_info *__mtd_next_device(int i);
10−int add_mtd_device(struct mtd_info *mtd);
10+int __must_check add_mtd_device(struct mtd_info *mtd);
1111 int del_mtd_device(struct mtd_info *mtd);
1212 int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int);
1313 int del_mtd_partitions(struct mtd_info *);
drivers/mtd/mtdpart.c+34−5
@@ -480,6 +480,10 @@ static struct mtd_part *allocate_partition(struct mtd_info *parent, · 479 unmodified lines
480480 /* let's register it anyway to preserve ordering */
481481 slave->offset = 0;
482482 slave->mtd.size = 0;
483+
484+ /* Initialize ->erasesize to make add_mtd_device() happy. */
485+ slave->mtd.erasesize = parent->erasesize;
486+
483487 printk(KERN_ERR"mtd: partition \"%s\" is out of reach -- disabled\n",
484488 part->name);
485489 goto out_register;
@@ -618,10 +622,21 @@ int mtd_add_partition(struct mtd_info *parent, const char *name, · 132 unmodified lines
618622 list_add(&new->list, &mtd_partitions);
619623 mutex_unlock(&mtd_partitions_mutex);
620624
621− add_mtd_device(&new->mtd);
625+ ret = add_mtd_device(&new->mtd);
626+ if (ret)
627+ goto err_remove_part;
622628
623629 mtd_add_partition_attrs(new);
624630
631+ return 0;
632+
633+err_remove_part:
634+ mutex_lock(&mtd_partitions_mutex);
635+ list_del(&new->list);
636+ mutex_unlock(&mtd_partitions_mutex);
637+
638+ free_partition(new);
639+
625640 return ret;
626641 }
627642 EXPORT_SYMBOL_GPL(mtd_add_partition);
@@ -712,22 +727,31 @@ int add_mtd_partitions(struct mtd_info *master, · 84 unmodified lines
712727 {
713728 struct mtd_part *slave;
714729 uint64_t cur_offset = 0;
715− int i;
730+ int i, ret;
716731
717732 printk(KERN_NOTICE "Creating %d MTD partitions on \"%s\":\n", nbparts, master->name);
718733
719734 for (i = 0; i < nbparts; i++) {
720735 slave = allocate_partition(master, parts + i, i, cur_offset);
721736 if (IS_ERR(slave)) {
722− del_mtd_partitions(master);
723− return PTR_ERR(slave);
737+ ret = PTR_ERR(slave);
738+ goto err_del_partitions;
724739 }
725740
726741 mutex_lock(&mtd_partitions_mutex);
727742 list_add(&slave->list, &mtd_partitions);
728743 mutex_unlock(&mtd_partitions_mutex);
729744
730− add_mtd_device(&slave->mtd);
745+ ret = add_mtd_device(&slave->mtd);
746+ if (ret) {
747+ mutex_lock(&mtd_partitions_mutex);
748+ list_del(&slave->list);
749+ mutex_unlock(&mtd_partitions_mutex);
750+
751+ free_partition(slave);
752+ goto err_del_partitions;
753+ }
754+
731755 mtd_add_partition_attrs(slave);
732756 /* Look for subpartitions */
733757 parse_mtd_partitions(&slave->mtd, parts[i].types, NULL);
@@ -736,6 +760,11 @@ int add_mtd_partitions(struct mtd_info *master, · 2 unmodified lines
736760 }
737761
738762 return 0;
763+
764+err_del_partitions:
765+ del_mtd_partitions(master);
766+
767+ return ret;
739768 }
740769
741770 static DEFINE_SPINLOCK(part_parser_lock);
drivers/mtd/nand/raw/denali.c+1−1
@@ -1322,7 +1322,7 @@ int denali_init(struct denali_nand_info *denali) · 1321 unmodified lines
13221322 }
13231323
13241324 /* clk rate info is needed for setup_data_interface */
1325− if (denali->clk_rate && denali->clk_x_rate)
1325+ if (!denali->clk_rate || !denali->clk_x_rate)
13261326 chip->options |= NAND_KEEP_TIMINGS;
13271327
13281328 chip->legacy.dummy_controller.ops = &denali_controller_ops;
drivers/mtd/nand/raw/fsmc_nand.c+0−21
@@ -593,23 +593,6 @@ static void fsmc_write_buf_dma(struct fsmc_nand_data *host, const u8 *buf, · 592 unmodified lines
593593 dma_xfer(host, (void *)buf, len, DMA_TO_DEVICE);
594594 }
595595
596−/* fsmc_select_chip - assert or deassert nCE */
597−static void fsmc_ce_ctrl(struct fsmc_nand_data *host, bool assert)
598−{
599− u32 pc = readl(host->regs_va + FSMC_PC);
600−
601− if (!assert)
602− writel_relaxed(pc & ~FSMC_ENABLE, host->regs_va + FSMC_PC);
603− else
604− writel_relaxed(pc | FSMC_ENABLE, host->regs_va + FSMC_PC);
605−
606− /*
607− * nCE line changes must be applied before returning from this
608− * function.
609− */
610− mb();
611−}
612−
613596 /*
614597 * fsmc_exec_op - hook called by the core to execute NAND operations
615598 *
@@ -627,8 +610,6 @@ static int fsmc_exec_op(struct nand_chip *chip, const struct nand_operation *op, · 11 unmodified lines
627610
628611 pr_debug("Executing operation [%d instructions]:\n", op->ninstrs);
629612
630− fsmc_ce_ctrl(host, true);
631−
632613 for (op_id = 0; op_id < op->ninstrs; op_id++) {
633614 instr = &op->instrs[op_id];
634615
@@ -686,8 +667,6 @@ static int fsmc_exec_op(struct nand_chip *chip, const struct nand_operation *op, · 51 unmodified lines
686667 }
687668 }
688669
689− fsmc_ce_ctrl(host, false);
690−
691670 return ret;
692671 }
693672
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c+6−7
@@ -155,9 +155,10 @@ int gpmi_init(struct gpmi_nand_data *this) · 154 unmodified lines
155155
156156 /*
157157 * Reset BCH here, too. We got failures otherwise :(
158− * See later BCH reset for explanation of MX23 handling
158+ * See later BCH reset for explanation of MX23 and MX28 handling
159159 */
160− ret = gpmi_reset_block(r->bch_regs, GPMI_IS_MX23(this));
160+ ret = gpmi_reset_block(r->bch_regs,
161+ GPMI_IS_MX23(this) || GPMI_IS_MX28(this));
161162 if (ret)
162163 goto err_out;
163164
@@ -263,12 +264,10 @@ int bch_set_geometry(struct gpmi_nand_data *this) · 99 unmodified lines
263264 /*
264265 * Due to erratum #2847 of the MX23, the BCH cannot be soft reset on this
265266 * chip, otherwise it will lock up. So we skip resetting BCH on the MX23.
266− * On the other hand, the MX28 needs the reset, because one case has been
267− * seen where the BCH produced ECC errors constantly after 10000
268− * consecutive reboots. The latter case has not been seen on the MX23
269− * yet, still we don't know if it could happen there as well.
267+ * and MX28.
270268 */
271− ret = gpmi_reset_block(r->bch_regs, GPMI_IS_MX23(this));
269+ ret = gpmi_reset_block(r->bch_regs,
270+ GPMI_IS_MX23(this) || GPMI_IS_MX28(this));
272271 if (ret)
273272 goto err_out;
274273
drivers/mtd/nand/raw/jz4740_nand.c+1−1
@@ -260,7 +260,7 @@ static int jz_nand_correct_ecc_rs(struct nand_chip *chip, uint8_t *dat, · 259 unmodified lines
260260 }
261261
262262 static int jz_nand_ioremap_resource(struct platform_device *pdev,
263− const char *name, struct resource **res, void *__iomem *base)
263+ const char *name, struct resource **res, void __iomem **base)
264264 {
265265 int ret;
266266
drivers/mtd/nand/raw/nand_base.c+1−0
@@ -410,6 +410,7 @@ static int nand_check_wp(struct nand_chip *chip) · 409 unmodified lines
410410
411411 /**
412412 * nand_fill_oob - [INTERN] Transfer client buffer to oob
413+ * @chip: NAND chip object
413414 * @oob: oob data buffer
414415 * @len: oob data write length
415416 * @ops: oob ops structure
drivers/mtd/nand/raw/nand_bbt.c+1−1
@@ -158,7 +158,7 @@ static u32 add_marker_len(struct nand_bbt_descr *td) · 157 unmodified lines
158158
159159 /**
160160 * read_bbt - [GENERIC] Read the bad block table starting from page
161− * @chip: NAND chip object
161+ * @this: NAND chip object
162162 * @buf: temporary buffer
163163 * @page: the starting page
164164 * @num: the number of bbt descriptors to read
drivers/mtd/nand/raw/qcom_nandc.c+10−10
@@ -2833,6 +2833,16 @@ static int qcom_nand_host_init_and_register(struct qcom_nand_controller *nandc, · 2832 unmodified lines
28332833 if (ret)
28342834 return ret;
28352835
2836+ if (nandc->props->is_bam) {
2837+ free_bam_transaction(nandc);
2838+ nandc->bam_txn = alloc_bam_transaction(nandc);
2839+ if (!nandc->bam_txn) {
2840+ dev_err(nandc->dev,
2841+ "failed to allocate bam transaction\n");
2842+ return -ENOMEM;
2843+ }
2844+ }
2845+
28362846 ret = mtd_device_register(mtd, NULL, 0);
28372847 if (ret)
28382848 nand_cleanup(chip);
@@ -2847,16 +2857,6 @@ static int qcom_probe_nand_devices(struct qcom_nand_controller *nandc) · 8 unmodified lines
28472857 struct qcom_nand_host *host;
28482858 int ret;
28492859
2850− if (nandc->props->is_bam) {
2851− free_bam_transaction(nandc);
2852− nandc->bam_txn = alloc_bam_transaction(nandc);
2853− if (!nandc->bam_txn) {
2854− dev_err(nandc->dev,
2855− "failed to allocate bam transaction\n");
2856− return -ENOMEM;
2857− }
2858− }
2859−
28602860 for_each_available_child_of_node(dn, child) {
28612861 host = devm_kzalloc(dev, sizeof(*host), GFP_KERNEL);
28622862 if (!host) {
drivers/mtd/nand/spi/core.c+22−24
@@ -304,24 +304,30 @@ static int spinand_write_to_cache_op(struct spinand_device *spinand, · 303 unmodified lines
304304 struct nand_device *nand = spinand_to_nand(spinand);
305305 struct mtd_info *mtd = nanddev_to_mtd(nand);
306306 struct nand_page_io_req adjreq = *req;
307− unsigned int nbytes = 0;
308− void *buf = NULL;
307+ void *buf = spinand->databuf;
308+ unsigned int nbytes;
309309 u16 column = 0;
310310 int ret;
311311
312− memset(spinand->databuf, 0xff,
313− nanddev_page_size(nand) +
314− nanddev_per_page_oobsize(nand));
312+ /*
313+ * Looks like PROGRAM LOAD (AKA write cache) does not necessarily reset
314+ * the cache content to 0xFF (depends on vendor implementation), so we
315+ * must fill the page cache entirely even if we only want to program
316+ * the data portion of the page, otherwise we might corrupt the BBM or
317+ * user data previously programmed in OOB area.
318+ */
319+ nbytes = nanddev_page_size(nand) + nanddev_per_page_oobsize(nand);
320+ memset(spinand->databuf, 0xff, nbytes);
321+ adjreq.dataoffs = 0;
322+ adjreq.datalen = nanddev_page_size(nand);
323+ adjreq.databuf.out = spinand->databuf;
324+ adjreq.ooblen = nanddev_per_page_oobsize(nand);
325+ adjreq.ooboffs = 0;
326+ adjreq.oobbuf.out = spinand->oobbuf;
315327
316− if (req->datalen) {
328+ if (req->datalen)
317329 memcpy(spinand->databuf + req->dataoffs, req->databuf.out,
318330 req->datalen);
319− adjreq.dataoffs = 0;
320− adjreq.datalen = nanddev_page_size(nand);
321− adjreq.databuf.out = spinand->databuf;
322− nbytes = adjreq.datalen;
323− buf = spinand->databuf;
324− }
325331
326332 if (req->ooblen) {
327333 if (req->mode == MTD_OPS_AUTO_OOB)
@@ -332,14 +338,6 @@ static int spinand_write_to_cache_op(struct spinand_device *spinand, · 4 unmodified lines
332338 else
333339 memcpy(spinand->oobbuf + req->ooboffs, req->oobbuf.out,
334340 req->ooblen);
335−
336− adjreq.ooblen = nanddev_per_page_oobsize(nand);
337− adjreq.ooboffs = 0;
338− nbytes += nanddev_per_page_oobsize(nand);
339− if (!buf) {
340− buf = spinand->oobbuf;
341− column = nanddev_page_size(nand);
342− }
343341 }
344342
345343 spinand_cache_op_adjust_colum(spinand, &adjreq, &column);
@@ -370,8 +368,8 @@ static int spinand_write_to_cache_op(struct spinand_device *spinand, · 24 unmodified lines
370368
371369 /*
372370 * We need to use the RANDOM LOAD CACHE operation if there's
373− * more than one iteration, because the LOAD operation resets
374− * the cache to 0xff.
371+ * more than one iteration, because the LOAD operation might
372+ * reset the cache to 0xff.
375373 */
376374 if (nbytes) {
377375 column = op.addr.val;
@@ -1018,11 +1016,11 @@ static int spinand_init(struct spinand_device *spinand) · 640 unmodified lines
10181016 for (i = 0; i < nand->memorg.ntargets; i++) {
10191017 ret = spinand_select_target(spinand, i);
10201018 if (ret)
1021− goto err_free_bufs;
1019+ goto err_manuf_cleanup;
10221020
10231021 ret = spinand_lock_block(spinand, BL_ALL_UNLOCKED);
10241022 if (ret)
1025− goto err_free_bufs;
1023+ goto err_manuf_cleanup;
10261024 }
10271025
10281026 ret = nanddev_init(nand, &spinand_ops, THIS_MODULE);
drivers/net/Kconfig+1−1
@@ -519,7 +519,7 @@ config NET_FAILOVER · 518 unmodified lines
519519 and destroy a failover master netdev and manages a primary and
520520 standby slave netdevs that get registered via the generic failover
521521 infrastructure. This can be used by paravirtual drivers to enable
522− an alternate low latency datapath. It alsoenables live migration of
522+ an alternate low latency datapath. It also enables live migration of
523523 a VM with direct attached VF by failing over to the paravirtual
524524 datapath when the VF is unplugged.
525525
drivers/net/bonding/bond_main.c+3−0
@@ -1963,6 +1963,9 @@ static int __bond_release_one(struct net_device *bond_dev, · 1962 unmodified lines
19631963 if (!bond_has_slaves(bond)) {
19641964 bond_set_carrier(bond);
19651965 eth_hw_addr_random(bond_dev);
1966+ bond->nest_level = SINGLE_DEPTH_NESTING;
1967+ } else {
1968+ bond->nest_level = dev_get_nest_level(bond_dev) + 1;
19661969 }
19671970
19681971 unblock_netpoll_tx();
drivers/net/caif/caif_serial.c+1−4
@@ -257,10 +257,7 @@ static int handle_tx(struct ser_device *ser) · 256 unmodified lines
257257 if (skb->len == 0) {
258258 struct sk_buff *tmp = skb_dequeue(&ser->head);
259259 WARN_ON(tmp != skb);
260− if (in_interrupt())
261− dev_kfree_skb_irq(skb);
262− else
263− kfree_skb(skb);
260+ dev_consume_skb_any(skb);
264261 }
265262 }
266263 /* Send flow off if queue is empty */
drivers/net/can/dev.c+13−14
@@ -480,8 +480,6 @@ EXPORT_SYMBOL_GPL(can_put_echo_skb); · 479 unmodified lines
480480 struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8 *len_ptr)
481481 {
482482 struct can_priv *priv = netdev_priv(dev);
483− struct sk_buff *skb = priv->echo_skb[idx];
484− struct canfd_frame *cf;
485483
486484 if (idx >= priv->echo_skb_max) {
487485 netdev_err(dev, "%s: BUG! Trying to access can_priv::echo_skb out of bounds (%u/max %u)\n",
@@ -489,20 +487,21 @@ struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8 · 1 unmodified line
489487 return NULL;
490488 }
491489
492− if (!skb) {
493− netdev_err(dev, "%s: BUG! Trying to echo non existing skb: can_priv::echo_skb[%u]\n",
494− __func__, idx);
495− return NULL;
496− }
490+ if (priv->echo_skb[idx]) {
491+ /* Using "struct canfd_frame::len" for the frame
492+ * length is supported on both CAN and CANFD frames.
493+ */
494+ struct sk_buff *skb = priv->echo_skb[idx];
495+ struct canfd_frame *cf = (struct canfd_frame *)skb->data;
496+ u8 len = cf->len;
497497
498− /* Using "struct canfd_frame::len" for the frame
499− * length is supported on both CAN and CANFD frames.
500− */
501− cf = (struct canfd_frame *)skb->data;
502− *len_ptr = cf->len;
503− priv->echo_skb[idx] = NULL;
498+ *len_ptr = len;
499+ priv->echo_skb[idx] = NULL;
504500
505− return skb;
501+ return skb;
502+ }
503+
504+ return NULL;
506505 }
507506
508507 /*
drivers/net/can/flexcan.c+2−2
@@ -1106,7 +1106,7 @@ static int flexcan_chip_start(struct net_device *dev) · 1105 unmodified lines
11061106 }
11071107 } else {
11081108 /* clear and invalidate unused mailboxes first */
1109− for (i = FLEXCAN_TX_MB_RESERVED_OFF_FIFO; i <= priv->mb_count; i++) {
1109+ for (i = FLEXCAN_TX_MB_RESERVED_OFF_FIFO; i < priv->mb_count; i++) {
11101110 mb = flexcan_get_mb(priv, i);
11111111 priv->write(FLEXCAN_MB_CODE_RX_INACTIVE,
11121112 &mb->can_ctrl);
@@ -1432,7 +1432,7 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev) · 319 unmodified lines
14321432 gpr_np = of_find_node_by_phandle(phandle);
14331433 if (!gpr_np) {
14341434 dev_dbg(&pdev->dev, "could not find gpr node by phandle\n");
1435− return PTR_ERR(gpr_np);
1435+ return -ENODEV;
14361436 }
14371437
14381438 priv = netdev_priv(dev);
drivers/net/dsa/b53/b53_srab.c+0−3
@@ -511,9 +511,6 @@ static void b53_srab_prepare_irq(struct platform_device *pdev) · 510 unmodified lines
511511 /* Clear all pending interrupts */
512512 writel(0xffffffff, priv->regs + B53_SRAB_INTR);
513513
514− if (dev->pdata && dev->pdata->chip_id != BCM58XX_DEVICE_ID)
515− return;
516−
517514 for (i = 0; i < B53_N_PORTS; i++) {
518515 port = &priv->port_intrs[i];
519516
drivers/net/dsa/microchip/ksz_common.c+0−2
@@ -7,7 +7,6 @@ · 6 unmodified lines
77
88 #include <linux/delay.h>
99 #include <linux/export.h>
10−#include <linux/gpio.h>
1110 #include <linux/gpio/consumer.h>
1211 #include <linux/kernel.h>
1312 #include <linux/module.h>
@@ -15,7 +14,6 @@ · 1 unmodified line
1514 #include <linux/phy.h>
1615 #include <linux/etherdevice.h>
1716 #include <linux/if_bridge.h>
18−#include <linux/of_gpio.h>
1917 #include <linux/of_net.h>
2018 #include <net/dsa.h>
2119 #include <net/switchdev.h>
drivers/net/dsa/mt7530.c+0−1
@@ -18,7 +18,6 @@ · 17 unmodified lines
1818 #include <linux/mfd/syscon.h>
1919 #include <linux/module.h>
2020 #include <linux/netdevice.h>
21−#include <linux/of_gpio.h>
2221 #include <linux/of_mdio.h>
2322 #include <linux/of_net.h>
2423 #include <linux/of_platform.h>
drivers/net/dsa/mv88e6xxx/chip.c+113−0
@@ -2403,6 +2403,107 @@ static int mv88e6xxx_stats_setup(struct mv88e6xxx_chip *chip) · 2402 unmodified lines
24032403 return mv88e6xxx_g1_stats_clear(chip);
24042404 }
24052405
2406+/* The mv88e6390 has some hidden registers used for debug and
2407+ * development. The errata also makes use of them.
2408+ */
2409+static int mv88e6390_hidden_write(struct mv88e6xxx_chip *chip, int port,
2410+ int reg, u16 val)
2411+{
2412+ u16 ctrl;
2413+ int err;
2414+
2415+ err = mv88e6xxx_port_write(chip, PORT_RESERVED_1A_DATA_PORT,
2416+ PORT_RESERVED_1A, val);
2417+ if (err)
2418+ return err;
2419+
2420+ ctrl = PORT_RESERVED_1A_BUSY | PORT_RESERVED_1A_WRITE |
2421+ PORT_RESERVED_1A_BLOCK | port << PORT_RESERVED_1A_PORT_SHIFT |
2422+ reg;
2423+
2424+ return mv88e6xxx_port_write(chip, PORT_RESERVED_1A_CTRL_PORT,
2425+ PORT_RESERVED_1A, ctrl);
2426+}
2427+
2428+static int mv88e6390_hidden_wait(struct mv88e6xxx_chip *chip)
2429+{
2430+ return mv88e6xxx_wait(chip, PORT_RESERVED_1A_CTRL_PORT,
2431+ PORT_RESERVED_1A, PORT_RESERVED_1A_BUSY);
2432+}
2433+
2434+
2435+static int mv88e6390_hidden_read(struct mv88e6xxx_chip *chip, int port,
2436+ int reg, u16 *val)
2437+{
2438+ u16 ctrl;
2439+ int err;
2440+
2441+ ctrl = PORT_RESERVED_1A_BUSY | PORT_RESERVED_1A_READ |
2442+ PORT_RESERVED_1A_BLOCK | port << PORT_RESERVED_1A_PORT_SHIFT |
2443+ reg;
2444+
2445+ err = mv88e6xxx_port_write(chip, PORT_RESERVED_1A_CTRL_PORT,
2446+ PORT_RESERVED_1A, ctrl);
2447+ if (err)
2448+ return err;
2449+
2450+ err = mv88e6390_hidden_wait(chip);
2451+ if (err)
2452+ return err;
2453+
2454+ return mv88e6xxx_port_read(chip, PORT_RESERVED_1A_DATA_PORT,
2455+ PORT_RESERVED_1A, val);
2456+}
2457+
2458+/* Check if the errata has already been applied. */
2459+static bool mv88e6390_setup_errata_applied(struct mv88e6xxx_chip *chip)
2460+{
2461+ int port;
2462+ int err;
2463+ u16 val;
2464+
2465+ for (port = 0; port < mv88e6xxx_num_ports(chip); port++) {
2466+ err = mv88e6390_hidden_read(chip, port, 0, &val);
2467+ if (err) {
2468+ dev_err(chip->dev,
2469+ "Error reading hidden register: %d\n", err);
2470+ return false;
2471+ }
2472+ if (val != 0x01c0)
2473+ return false;
2474+ }
2475+
2476+ return true;
2477+}
2478+
2479+/* The 6390 copper ports have an errata which require poking magic
2480+ * values into undocumented hidden registers and then performing a
2481+ * software reset.
2482+ */
2483+static int mv88e6390_setup_errata(struct mv88e6xxx_chip *chip)
2484+{
2485+ int port;
2486+ int err;
2487+
2488+ if (mv88e6390_setup_errata_applied(chip))
2489+ return 0;
2490+
2491+ /* Set the ports into blocking mode */
2492+ for (port = 0; port < mv88e6xxx_num_ports(chip); port++) {
2493+ err = mv88e6xxx_port_set_state(chip, port, BR_STATE_DISABLED);
2494+ if (err)
2495+ return err;
2496+ }
2497+
2498+ for (port = 0; port < mv88e6xxx_num_ports(chip); port++) {
2499+ err = mv88e6390_hidden_write(chip, port, 0, 0x01c0);
2500+ if (err)
2501+ return err;
2502+ }
2503+
2504+ return mv88e6xxx_software_reset(chip);
2505+}
2506+
24062507 static int mv88e6xxx_setup(struct dsa_switch *ds)
24072508 {
24082509 struct mv88e6xxx_chip *chip = ds->priv;
@@ -2415,6 +2516,12 @@ static int mv88e6xxx_setup(struct dsa_switch *ds) · 6 unmodified lines
24152516
24162517 mutex_lock(&chip->reg_lock);
24172518
2519+ if (chip->info->ops->setup_errata) {
2520+ err = chip->info->ops->setup_errata(chip);
2521+ if (err)
2522+ goto unlock;
2523+ }
2524+
24182525 /* Cache the cmode of each port. */
24192526 for (i = 0; i < mv88e6xxx_num_ports(chip); i++) {
24202527 if (chip->info->ops->port_get_cmode) {
@@ -3226,6 +3333,7 @@ static const struct mv88e6xxx_ops mv88e6185_ops = { · 805 unmodified lines
32263333
32273334 static const struct mv88e6xxx_ops mv88e6190_ops = {
32283335 /* MV88E6XXX_FAMILY_6390 */
3336+ .setup_errata = mv88e6390_setup_errata,
32293337 .irl_init_all = mv88e6390_g2_irl_init_all,
32303338 .get_eeprom = mv88e6xxx_g2_get_eeprom8,
32313339 .set_eeprom = mv88e6xxx_g2_set_eeprom8,
@@ -3269,6 +3377,7 @@ static const struct mv88e6xxx_ops mv88e6190_ops = { · 37 unmodified lines
32693377
32703378 static const struct mv88e6xxx_ops mv88e6190x_ops = {
32713379 /* MV88E6XXX_FAMILY_6390 */
3380+ .setup_errata = mv88e6390_setup_errata,
32723381 .irl_init_all = mv88e6390_g2_irl_init_all,
32733382 .get_eeprom = mv88e6xxx_g2_get_eeprom8,
32743383 .set_eeprom = mv88e6xxx_g2_set_eeprom8,
@@ -3312,6 +3421,7 @@ static const struct mv88e6xxx_ops mv88e6190x_ops = { · 37 unmodified lines
33123421
33133422 static const struct mv88e6xxx_ops mv88e6191_ops = {
33143423 /* MV88E6XXX_FAMILY_6390 */
3424+ .setup_errata = mv88e6390_setup_errata,
33153425 .irl_init_all = mv88e6390_g2_irl_init_all,
33163426 .get_eeprom = mv88e6xxx_g2_get_eeprom8,
33173427 .set_eeprom = mv88e6xxx_g2_set_eeprom8,
@@ -3404,6 +3514,7 @@ static const struct mv88e6xxx_ops mv88e6240_ops = { · 86 unmodified lines
34043514
34053515 static const struct mv88e6xxx_ops mv88e6290_ops = {
34063516 /* MV88E6XXX_FAMILY_6390 */
3517+ .setup_errata = mv88e6390_setup_errata,
34073518 .irl_init_all = mv88e6390_g2_irl_init_all,
34083519 .get_eeprom = mv88e6xxx_g2_get_eeprom8,
34093520 .set_eeprom = mv88e6xxx_g2_set_eeprom8,
@@ -3709,6 +3820,7 @@ static const struct mv88e6xxx_ops mv88e6352_ops = { · 299 unmodified lines
37093820
37103821 static const struct mv88e6xxx_ops mv88e6390_ops = {
37113822 /* MV88E6XXX_FAMILY_6390 */
3823+ .setup_errata = mv88e6390_setup_errata,
37123824 .irl_init_all = mv88e6390_g2_irl_init_all,
37133825 .get_eeprom = mv88e6xxx_g2_get_eeprom8,
37143826 .set_eeprom = mv88e6xxx_g2_set_eeprom8,
@@ -3756,6 +3868,7 @@ static const struct mv88e6xxx_ops mv88e6390_ops = { · 41 unmodified lines
37563868
37573869 static const struct mv88e6xxx_ops mv88e6390x_ops = {
37583870 /* MV88E6XXX_FAMILY_6390 */
3871+ .setup_errata = mv88e6390_setup_errata,
37593872 .irl_init_all = mv88e6390_g2_irl_init_all,
37603873 .get_eeprom = mv88e6xxx_g2_get_eeprom8,
37613874 .set_eeprom = mv88e6xxx_g2_set_eeprom8,
drivers/net/dsa/mv88e6xxx/chip.h+5−0
@@ -300,6 +300,11 @@ struct mv88e6xxx_mdio_bus { · 299 unmodified lines
300300 };
301301
302302 struct mv88e6xxx_ops {
303+ /* Switch Setup Errata, called early in the switch setup to
304+ * allow any errata actions to be performed
305+ */
306+ int (*setup_errata)(struct mv88e6xxx_chip *chip);
307+
303308 int (*ieee_pri_map)(struct mv88e6xxx_chip *chip);
304309 int (*ip_pri_map)(struct mv88e6xxx_chip *chip);
305310
drivers/net/dsa/mv88e6xxx/global1_atu.c+12−9
@@ -314,6 +314,7 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id) · 313 unmodified lines
314314 {
315315 struct mv88e6xxx_chip *chip = dev_id;
316316 struct mv88e6xxx_atu_entry entry;
317+ int spid;
317318 int err;
318319 u16 val;
319320
@@ -336,6 +337,8 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id) · 16 unmodified lines
336337 if (err)
337338 goto out;
338339
340+ spid = entry.state;
341+
339342 if (val & MV88E6XXX_G1_ATU_OP_AGE_OUT_VIOLATION) {
340343 dev_err_ratelimited(chip->dev,
341344 "ATU age out violation for %pM\n",
@@ -344,23 +347,23 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id) · 2 unmodified lines
344347
345348 if (val & MV88E6XXX_G1_ATU_OP_MEMBER_VIOLATION) {
346349 dev_err_ratelimited(chip->dev,
347− "ATU member violation for %pM portvec %x\n",
348− entry.mac, entry.portvec);
349− chip->ports[entry.portvec].atu_member_violation++;
350+ "ATU member violation for %pM portvec %x spid %d\n",
351+ entry.mac, entry.portvec, spid);
352+ chip->ports[spid].atu_member_violation++;
350353 }
351354
352355 if (val & MV88E6XXX_G1_ATU_OP_MISS_VIOLATION) {
353356 dev_err_ratelimited(chip->dev,
354− "ATU miss violation for %pM portvec %x\n",
355− entry.mac, entry.portvec);
356− chip->ports[entry.portvec].atu_miss_violation++;
357+ "ATU miss violation for %pM portvec %x spid %d\n",
358+ entry.mac, entry.portvec, spid);
359+ chip->ports[spid].atu_miss_violation++;
357360 }
358361
359362 if (val & MV88E6XXX_G1_ATU_OP_FULL_VIOLATION) {
360363 dev_err_ratelimited(chip->dev,
361− "ATU full violation for %pM portvec %x\n",
362− entry.mac, entry.portvec);
363− chip->ports[entry.portvec].atu_full_violation++;
364+ "ATU full violation for %pM portvec %x spid %d\n",
365+ entry.mac, entry.portvec, spid);
366+ chip->ports[spid].atu_full_violation++;
364367 }
365368 mutex_unlock(&chip->reg_lock);
366369
drivers/net/dsa/mv88e6xxx/port.h+10−0
@@ -251,6 +251,16 @@ · 250 unmodified lines
251251 /* Offset 0x19: Port IEEE Priority Remapping Registers (4-7) */
252252 #define MV88E6095_PORT_IEEE_PRIO_REMAP_4567 0x19
253253
254+/* Offset 0x1a: Magic undocumented errata register */
255+#define PORT_RESERVED_1A 0x1a
256+#define PORT_RESERVED_1A_BUSY BIT(15)
257+#define PORT_RESERVED_1A_WRITE BIT(14)
258+#define PORT_RESERVED_1A_READ 0
259+#define PORT_RESERVED_1A_PORT_SHIFT 5
260+#define PORT_RESERVED_1A_BLOCK (0xf << 10)
261+#define PORT_RESERVED_1A_CTRL_PORT 4
262+#define PORT_RESERVED_1A_DATA_PORT 5
263+
254264 int mv88e6xxx_port_read(struct mv88e6xxx_chip *chip, int port, int reg,
255265 u16 *val);
256266 int mv88e6xxx_port_write(struct mv88e6xxx_chip *chip, int port, int reg,
drivers/net/dsa/mv88e6xxx/serdes.c+1−1
@@ -664,7 +664,7 @@ int mv88e6390_serdes_irq_setup(struct mv88e6xxx_chip *chip, int port) · 663 unmodified lines
664664 if (port < 9)
665665 return 0;
666666
667− return mv88e6390_serdes_irq_setup(chip, port);
667+ return mv88e6390x_serdes_irq_setup(chip, port);
668668 }
669669
670670 void mv88e6390x_serdes_irq_free(struct mv88e6xxx_chip *chip, int port)
drivers/net/dsa/realtek-smi.c+13−5
@@ -347,16 +347,17 @@ int realtek_smi_setup_mdio(struct realtek_smi *smi) · 346 unmodified lines
347347 struct device_node *mdio_np;
348348 int ret;
349349
350− mdio_np = of_find_compatible_node(smi->dev->of_node, NULL,
351− "realtek,smi-mdio");
350+ mdio_np = of_get_compatible_child(smi->dev->of_node, "realtek,smi-mdio");
352351 if (!mdio_np) {
353352 dev_err(smi->dev, "no MDIO bus node\n");
354353 return -ENODEV;
355354 }
356355
357356 smi->slave_mii_bus = devm_mdiobus_alloc(smi->dev);
358− if (!smi->slave_mii_bus)
359− return -ENOMEM;
357+ if (!smi->slave_mii_bus) {
358+ ret = -ENOMEM;
359+ goto err_put_node;
360+ }
360361 smi->slave_mii_bus->priv = smi;
361362 smi->slave_mii_bus->name = "SMI slave MII";
362363 smi->slave_mii_bus->read = realtek_smi_mdio_read;
@@ -371,10 +372,15 @@ int realtek_smi_setup_mdio(struct realtek_smi *smi) · 8 unmodified lines
371372 if (ret) {
372373 dev_err(smi->dev, "unable to register MDIO bus %s\n",
373374 smi->slave_mii_bus->id);
374− of_node_put(mdio_np);
375+ goto err_put_node;
375376 }
376377
377378 return 0;
379+
380+err_put_node:
381+ of_node_put(mdio_np);
382+
383+ return ret;
378384 }
379385
380386 static int realtek_smi_probe(struct platform_device *pdev)
@@ -457,6 +463,8 @@ static int realtek_smi_remove(struct platform_device *pdev) · 76 unmodified lines
457463 struct realtek_smi *smi = dev_get_drvdata(&pdev->dev);
458464
459465 dsa_unregister_switch(smi->ds);
466+ if (smi->slave_mii_bus)
467+ of_node_put(smi->slave_mii_bus->dev.of_node);
460468 gpiod_set_value(smi->reset, 1);
461469
462470 return 0;
drivers/net/ethernet/aeroflex/greth.c+6−6
@@ -1433,18 +1433,18 @@ static int greth_of_probe(struct platform_device *ofdev) · 1432 unmodified lines
14331433 }
14341434
14351435 /* Allocate TX descriptor ring in coherent memory */
1436− greth->tx_bd_base = dma_zalloc_coherent(greth->dev, 1024,
1437− &greth->tx_bd_base_phys,
1438− GFP_KERNEL);
1436+ greth->tx_bd_base = dma_alloc_coherent(greth->dev, 1024,
1437+ &greth->tx_bd_base_phys,
1438+ GFP_KERNEL);
14391439 if (!greth->tx_bd_base) {
14401440 err = -ENOMEM;
14411441 goto error3;
14421442 }
14431443
14441444 /* Allocate RX descriptor ring in coherent memory */
1445− greth->rx_bd_base = dma_zalloc_coherent(greth->dev, 1024,
1446− &greth->rx_bd_base_phys,
1447− GFP_KERNEL);
1445+ greth->rx_bd_base = dma_alloc_coherent(greth->dev, 1024,
1446+ &greth->rx_bd_base_phys,
1447+ GFP_KERNEL);
14481448 if (!greth->rx_bd_base) {
14491449 err = -ENOMEM;
14501450 goto error4;
drivers/net/ethernet/alacritech/slicoss.c+6−6
@@ -795,8 +795,8 @@ static int slic_init_stat_queue(struct slic_device *sdev) · 794 unmodified lines
795795 size = stq->len * sizeof(*descs) + DESC_ALIGN_MASK;
796796
797797 for (i = 0; i < SLIC_NUM_STAT_DESC_ARRAYS; i++) {
798− descs = dma_zalloc_coherent(&sdev->pdev->dev, size, &paddr,
799− GFP_KERNEL);
798+ descs = dma_alloc_coherent(&sdev->pdev->dev, size, &paddr,
799+ GFP_KERNEL);
800800 if (!descs) {
801801 netdev_err(sdev->netdev,
802802 "failed to allocate status descriptors\n");
@@ -1240,8 +1240,8 @@ static int slic_init_shmem(struct slic_device *sdev) · 437 unmodified lines
12401240 struct slic_shmem_data *sm_data;
12411241 dma_addr_t paddr;
12421242
1243− sm_data = dma_zalloc_coherent(&sdev->pdev->dev, sizeof(*sm_data),
1244− &paddr, GFP_KERNEL);
1243+ sm_data = dma_alloc_coherent(&sdev->pdev->dev, sizeof(*sm_data),
1244+ &paddr, GFP_KERNEL);
12451245 if (!sm_data) {
12461246 dev_err(&sdev->pdev->dev, "failed to allocate shared memory\n");
12471247 return -ENOMEM;
@@ -1621,8 +1621,8 @@ static int slic_read_eeprom(struct slic_device *sdev) · 373 unmodified lines
16211621 int err = 0;
16221622 u8 *mac[2];
16231623
1624− eeprom = dma_zalloc_coherent(&sdev->pdev->dev, SLIC_EEPROM_SIZE,
1625− &paddr, GFP_KERNEL);
1624+ eeprom = dma_alloc_coherent(&sdev->pdev->dev, SLIC_EEPROM_SIZE,
1625+ &paddr, GFP_KERNEL);
16261626 if (!eeprom)
16271627 return -ENOMEM;
16281628
drivers/net/ethernet/alteon/acenic.c+1−1
@@ -2059,7 +2059,7 @@ static inline void ace_tx_int(struct net_device *dev, · 2058 unmodified lines
20592059 if (skb) {
20602060 dev->stats.tx_packets++;
20612061 dev->stats.tx_bytes += skb->len;
2062− dev_kfree_skb_irq(skb);
2062+ dev_consume_skb_irq(skb);
20632063 info->skb = NULL;
20642064 }
20652065
drivers/net/ethernet/altera/altera_msgdma.c+2−1
@@ -145,7 +145,8 @@ u32 msgdma_tx_completions(struct altera_tse_private *priv) · 144 unmodified lines
145145 & 0xffff;
146146
147147 if (inuse) { /* Tx FIFO is not empty */
148− ready = priv->tx_prod - priv->tx_cons - inuse - 1;
148+ ready = max_t(int,
149+ priv->tx_prod - priv->tx_cons - inuse - 1, 0);
149150 } else {
150151 /* Check for buffered last packet */
151152 status = csrrd32(priv->tx_dma_csr, msgdma_csroffs(status));
drivers/net/ethernet/altera/altera_tse_main.c+3−1
@@ -714,8 +714,10 @@ static struct phy_device *connect_local_phy(struct net_device *dev) · 713 unmodified lines
714714
715715 phydev = phy_connect(dev, phy_id_fmt, &altera_tse_adjust_link,
716716 priv->phy_iface);
717− if (IS_ERR(phydev))
717+ if (IS_ERR(phydev)) {
718718 netdev_err(dev, "Could not attach to PHY\n");
719+ phydev = NULL;
720+ }
719721
720722 } else {
721723 int ret;
drivers/net/ethernet/amazon/ena/ena_com.c+31−30
@@ -111,8 +111,8 @@ static int ena_com_admin_init_sq(struct ena_com_admin_queue *queue) · 110 unmodified lines
111111 struct ena_com_admin_sq *sq = &queue->sq;
112112 u16 size = ADMIN_SQ_SIZE(queue->q_depth);
113113
114− sq->entries = dma_zalloc_coherent(queue->q_dmadev, size, &sq->dma_addr,
115− GFP_KERNEL);
114+ sq->entries = dma_alloc_coherent(queue->q_dmadev, size, &sq->dma_addr,
115+ GFP_KERNEL);
116116
117117 if (!sq->entries) {
118118 pr_err("memory allocation failed");
@@ -133,8 +133,8 @@ static int ena_com_admin_init_cq(struct ena_com_admin_queue *queue) · 14 unmodified lines
133133 struct ena_com_admin_cq *cq = &queue->cq;
134134 u16 size = ADMIN_CQ_SIZE(queue->q_depth);
135135
136− cq->entries = dma_zalloc_coherent(queue->q_dmadev, size, &cq->dma_addr,
137− GFP_KERNEL);
136+ cq->entries = dma_alloc_coherent(queue->q_dmadev, size, &cq->dma_addr,
137+ GFP_KERNEL);
138138
139139 if (!cq->entries) {
140140 pr_err("memory allocation failed");
@@ -156,8 +156,8 @@ static int ena_com_admin_init_aenq(struct ena_com_dev *dev, · 15 unmodified lines
156156
157157 dev->aenq.q_depth = ENA_ASYNC_QUEUE_DEPTH;
158158 size = ADMIN_AENQ_SIZE(ENA_ASYNC_QUEUE_DEPTH);
159− aenq->entries = dma_zalloc_coherent(dev->dmadev, size, &aenq->dma_addr,
160− GFP_KERNEL);
159+ aenq->entries = dma_alloc_coherent(dev->dmadev, size, &aenq->dma_addr,
160+ GFP_KERNEL);
161161
162162 if (!aenq->entries) {
163163 pr_err("memory allocation failed");
@@ -344,15 +344,15 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_dev, · 180 unmodified lines
344344 dev_node = dev_to_node(ena_dev->dmadev);
345345 set_dev_node(ena_dev->dmadev, ctx->numa_node);
346346 io_sq->desc_addr.virt_addr =
347− dma_zalloc_coherent(ena_dev->dmadev, size,
348− &io_sq->desc_addr.phys_addr,
349− GFP_KERNEL);
347+ dma_alloc_coherent(ena_dev->dmadev, size,
348+ &io_sq->desc_addr.phys_addr,
349+ GFP_KERNEL);
350350 set_dev_node(ena_dev->dmadev, dev_node);
351351 if (!io_sq->desc_addr.virt_addr) {
352352 io_sq->desc_addr.virt_addr =
353− dma_zalloc_coherent(ena_dev->dmadev, size,
354− &io_sq->desc_addr.phys_addr,
355− GFP_KERNEL);
353+ dma_alloc_coherent(ena_dev->dmadev, size,
354+ &io_sq->desc_addr.phys_addr,
355+ GFP_KERNEL);
356356 }
357357
358358 if (!io_sq->desc_addr.virt_addr) {
@@ -425,14 +425,14 @@ static int ena_com_init_io_cq(struct ena_com_dev *ena_dev, · 66 unmodified lines
425425 prev_node = dev_to_node(ena_dev->dmadev);
426426 set_dev_node(ena_dev->dmadev, ctx->numa_node);
427427 io_cq->cdesc_addr.virt_addr =
428− dma_zalloc_coherent(ena_dev->dmadev, size,
429− &io_cq->cdesc_addr.phys_addr, GFP_KERNEL);
428+ dma_alloc_coherent(ena_dev->dmadev, size,
429+ &io_cq->cdesc_addr.phys_addr, GFP_KERNEL);
430430 set_dev_node(ena_dev->dmadev, prev_node);
431431 if (!io_cq->cdesc_addr.virt_addr) {
432432 io_cq->cdesc_addr.virt_addr =
433− dma_zalloc_coherent(ena_dev->dmadev, size,
434− &io_cq->cdesc_addr.phys_addr,
435− GFP_KERNEL);
433+ dma_alloc_coherent(ena_dev->dmadev, size,
434+ &io_cq->cdesc_addr.phys_addr,
435+ GFP_KERNEL);
436436 }
437437
438438 if (!io_cq->cdesc_addr.virt_addr) {
@@ -1026,8 +1026,8 @@ static int ena_com_hash_key_allocate(struct ena_com_dev *ena_dev) · 587 unmodified lines
10261026 struct ena_rss *rss = &ena_dev->rss;
10271027
10281028 rss->hash_key =
1029− dma_zalloc_coherent(ena_dev->dmadev, sizeof(*rss->hash_key),
1030− &rss->hash_key_dma_addr, GFP_KERNEL);
1029+ dma_alloc_coherent(ena_dev->dmadev, sizeof(*rss->hash_key),
1030+ &rss->hash_key_dma_addr, GFP_KERNEL);
10311031
10321032 if (unlikely(!rss->hash_key))
10331033 return -ENOMEM;
@@ -1050,8 +1050,8 @@ static int ena_com_hash_ctrl_init(struct ena_com_dev *ena_dev) · 16 unmodified lines
10501050 struct ena_rss *rss = &ena_dev->rss;
10511051
10521052 rss->hash_ctrl =
1053− dma_zalloc_coherent(ena_dev->dmadev, sizeof(*rss->hash_ctrl),
1054− &rss->hash_ctrl_dma_addr, GFP_KERNEL);
1053+ dma_alloc_coherent(ena_dev->dmadev, sizeof(*rss->hash_ctrl),
1054+ &rss->hash_ctrl_dma_addr, GFP_KERNEL);
10551055
10561056 if (unlikely(!rss->hash_ctrl))
10571057 return -ENOMEM;
@@ -1094,8 +1094,8 @@ static int ena_com_indirect_table_allocate(struct ena_com_dev *ena_dev, · 36 unmodified lines
10941094 sizeof(struct ena_admin_rss_ind_table_entry);
10951095
10961096 rss->rss_ind_tbl =
1097− dma_zalloc_coherent(ena_dev->dmadev, tbl_size,
1098− &rss->rss_ind_tbl_dma_addr, GFP_KERNEL);
1097+ dma_alloc_coherent(ena_dev->dmadev, tbl_size,
1098+ &rss->rss_ind_tbl_dma_addr, GFP_KERNEL);
10991099 if (unlikely(!rss->rss_ind_tbl))
11001100 goto mem_err1;
11011101
@@ -1649,9 +1649,9 @@ int ena_com_mmio_reg_read_request_init(struct ena_com_dev *ena_dev) · 547 unmodified lines
16491649
16501650 spin_lock_init(&mmio_read->lock);
16511651 mmio_read->read_resp =
1652− dma_zalloc_coherent(ena_dev->dmadev,
1653− sizeof(*mmio_read->read_resp),
1654− &mmio_read->read_resp_dma_addr, GFP_KERNEL);
1652+ dma_alloc_coherent(ena_dev->dmadev,
1653+ sizeof(*mmio_read->read_resp),
1654+ &mmio_read->read_resp_dma_addr, GFP_KERNEL);
16551655 if (unlikely(!mmio_read->read_resp))
16561656 goto err;
16571657
@@ -2623,8 +2623,8 @@ int ena_com_allocate_host_info(struct ena_com_dev *ena_dev) · 965 unmodified lines
26232623 struct ena_host_attribute *host_attr = &ena_dev->host_attr;
26242624
26252625 host_attr->host_info =
2626− dma_zalloc_coherent(ena_dev->dmadev, SZ_4K,
2627− &host_attr->host_info_dma_addr, GFP_KERNEL);
2626+ dma_alloc_coherent(ena_dev->dmadev, SZ_4K,
2627+ &host_attr->host_info_dma_addr, GFP_KERNEL);
26282628 if (unlikely(!host_attr->host_info))
26292629 return -ENOMEM;
26302630
@@ -2641,8 +2641,9 @@ int ena_com_allocate_debug_area(struct ena_com_dev *ena_dev, · 10 unmodified lines
26412641 struct ena_host_attribute *host_attr = &ena_dev->host_attr;
26422642
26432643 host_attr->debug_area_virt_addr =
2644− dma_zalloc_coherent(ena_dev->dmadev, debug_area_size,
2645− &host_attr->debug_area_dma_addr, GFP_KERNEL);
2644+ dma_alloc_coherent(ena_dev->dmadev, debug_area_size,
2645+ &host_attr->debug_area_dma_addr,
2646+ GFP_KERNEL);
26462647 if (unlikely(!host_attr->debug_area_virt_addr)) {
26472648 host_attr->debug_area_size = 0;
26482649 return -ENOMEM;
drivers/net/ethernet/amd/amd8111e.c+1−1
@@ -666,7 +666,7 @@ static int amd8111e_tx(struct net_device *dev) · 665 unmodified lines
666666 pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[tx_index],
667667 lp->tx_skbuff[tx_index]->len,
668668 PCI_DMA_TODEVICE);
669− dev_kfree_skb_irq (lp->tx_skbuff[tx_index]);
669+ dev_consume_skb_irq(lp->tx_skbuff[tx_index]);
670670 lp->tx_skbuff[tx_index] = NULL;
671671 lp->tx_dma_addr[tx_index] = 0;
672672 }
drivers/net/ethernet/amd/xgbe/xgbe-common.h+0−2
@@ -431,8 +431,6 @@ · 430 unmodified lines
431431 #define MAC_MDIOSCAR_PA_WIDTH 5
432432 #define MAC_MDIOSCAR_RA_INDEX 0
433433 #define MAC_MDIOSCAR_RA_WIDTH 16
434−#define MAC_MDIOSCAR_REG_INDEX 0
435−#define MAC_MDIOSCAR_REG_WIDTH 21
436434 #define MAC_MDIOSCCDR_BUSY_INDEX 22
437435 #define MAC_MDIOSCCDR_BUSY_WIDTH 1
438436 #define MAC_MDIOSCCDR_CMD_INDEX 16
drivers/net/ethernet/amd/xgbe/xgbe-dev.c+16−6
@@ -1284,6 +1284,20 @@ static void xgbe_write_mmd_regs(struct xgbe_prv_data *pdata, int prtad, · 1283 unmodified lines
12841284 }
12851285 }
12861286
1287+static unsigned int xgbe_create_mdio_sca(int port, int reg)
1288+{
1289+ unsigned int mdio_sca, da;
1290+
1291+ da = (reg & MII_ADDR_C45) ? reg >> 16 : 0;
1292+
1293+ mdio_sca = 0;
1294+ XGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, RA, reg);
1295+ XGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, PA, port);
1296+ XGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, DA, da);
1297+
1298+ return mdio_sca;
1299+}
1300+
12871301 static int xgbe_write_ext_mii_regs(struct xgbe_prv_data *pdata, int addr,
12881302 int reg, u16 val)
12891303 {
@@ -1291,9 +1305,7 @@ static int xgbe_write_ext_mii_regs(struct xgbe_prv_data *pdata, int addr, · 1 unmodified line
12911305
12921306 reinit_completion(&pdata->mdio_complete);
12931307
1294− mdio_sca = 0;
1295− XGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, REG, reg);
1296− XGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, DA, addr);
1308+ mdio_sca = xgbe_create_mdio_sca(addr, reg);
12971309 XGMAC_IOWRITE(pdata, MAC_MDIOSCAR, mdio_sca);
12981310
12991311 mdio_sccd = 0;
@@ -1317,9 +1329,7 @@ static int xgbe_read_ext_mii_regs(struct xgbe_prv_data *pdata, int addr, · 17 unmodified lines
13171329
13181330 reinit_completion(&pdata->mdio_complete);
13191331
1320− mdio_sca = 0;

6 more lines aren’t shown here.

drivers/net/ethernet/apm/xgene-v2/main.c+4−4

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

drivers/net/ethernet/apple/bmac.c+1−1

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

drivers/net/ethernet/atheros/alx/main.c+3−4

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

drivers/net/ethernet/atheros/atl1c/atl1c_main.c+2−2

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

drivers/net/ethernet/broadcom/b44.c+2−2

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

drivers/net/ethernet/broadcom/bcm63xx_enet.c+4−4

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

drivers/net/ethernet/broadcom/bcmsysport.c+12−17

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

drivers/net/ethernet/broadcom/bcmsysport.h+2−0

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

drivers/net/ethernet/broadcom/bgmac.c+6−6

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

drivers/net/ethernet/broadcom/bnx2.c+2−2

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

drivers/net/ethernet/broadcom/bnx2x/bnx2x.h+1−1

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

drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h+1−1

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

drivers/net/ethernet/broadcom/bnxt/bnxt.c+23−13

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

drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c+2−2

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

drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c+2−2

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

drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h+3−2

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

drivers/net/ethernet/broadcom/sb1250-mac.c+1−1

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

drivers/net/ethernet/broadcom/tg3.c+11−11

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

drivers/net/ethernet/cadence/macb.h+3−0

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

drivers/net/ethernet/cadence/macb_main.c+19−17

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

drivers/net/ethernet/cavium/Kconfig+0−1

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

drivers/net/ethernet/cavium/thunder/nicvf_queues.c+1−1

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

drivers/net/ethernet/chelsio/cxgb3/sge.c+8−6

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

drivers/net/ethernet/chelsio/cxgb3/t3_hw.c+3−3

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

drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c+4−4

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

drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c+1−1

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

drivers/net/ethernet/chelsio/cxgb4/sge.c+1−1

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

drivers/net/ethernet/chelsio/cxgb4/t4_hw.c+1−1

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

drivers/net/ethernet/chelsio/cxgb4vf/sge.c+1−1

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

drivers/net/ethernet/cisco/enic/enic_main.c+2−1

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

drivers/net/ethernet/dec/tulip/de2104x.c+1−1

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

drivers/net/ethernet/emulex/benet/be_cmds.c+34−34

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

drivers/net/ethernet/emulex/benet/be_ethtool.c+9−9

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

drivers/net/ethernet/emulex/benet/be_main.c+9−9

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

drivers/net/ethernet/faraday/ftgmac100.c+6−8

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

drivers/net/ethernet/faraday/ftmac100.c+3−4

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

drivers/net/ethernet/freescale/dpaa/dpaa_eth.c+6−0

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

drivers/net/ethernet/freescale/dpaa2/Kconfig+3−2

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

drivers/net/ethernet/freescale/fec_main.c+1−1

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

drivers/net/ethernet/freescale/fec_mpc52xx.c+1−1

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

drivers/net/ethernet/freescale/ucc_geth.c+2−0

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

drivers/net/ethernet/hisilicon/hix5hd2_gmac.c+2−2

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

drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c+2−4

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

drivers/net/ethernet/hisilicon/hns/hns_enet.c+12−10

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

drivers/net/ethernet/hisilicon/hns/hns_ethtool.c+9−7

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

drivers/net/ethernet/hisilicon/hns3/hns3_enet.c+2−3

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

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c+2−3

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

drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c+2−3

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

drivers/net/ethernet/hisilicon/hns_mdio.c+1−1

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

drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c+8−8

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

drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.c+4−4

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

drivers/net/ethernet/huawei/hinic/hinic_hw_io.c+3−3

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

drivers/net/ethernet/huawei/hinic/hinic_hw_qp.c+5−5

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

drivers/net/ethernet/huawei/hinic/hinic_hw_wq.c+4−4

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

drivers/net/ethernet/i825xx/82596.c+1−1

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

drivers/net/ethernet/ibm/emac/mal.c+2−2

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

drivers/net/ethernet/ibm/ibmveth.c+0−2

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

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

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

drivers/net/ethernet/intel/e1000/e1000_ethtool.c+4−4

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

drivers/net/ethernet/intel/e1000e/netdev.c+2−2

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

drivers/net/ethernet/intel/i40e/i40e_main.c+2−2

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

drivers/net/ethernet/intel/igb/igb.h+1−1

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

drivers/net/ethernet/intel/igb/igb_ethtool.c+2−2

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

drivers/net/ethernet/intel/igb/igb_main.c+7−7

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

drivers/net/ethernet/intel/ixgb/ixgb_main.c+4−4

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

drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c+3−3

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

drivers/net/ethernet/marvell/octeontx2/af/cgx.c+3−1

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

drivers/net/ethernet/marvell/octeontx2/af/common.h+1−1

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

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

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

drivers/net/ethernet/marvell/skge.c+4−2

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

drivers/net/ethernet/mediatek/mtk_eth_soc.c+9−25

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

drivers/net/ethernet/mellanox/mlx4/alloc.c+4−4

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

drivers/net/ethernet/mellanox/mlx4/cq.c+4−2

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

drivers/net/ethernet/mellanox/mlx4/fw.c+46−29

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

drivers/net/ethernet/mellanox/mlx4/icm.c+60−41

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

drivers/net/ethernet/mellanox/mlx4/icm.h+19−3

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

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

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c+5−1

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h+1−1

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

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

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+44−15

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c+13−0

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

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+32−20

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c+8−14

This diff is large: its 59 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+9−8

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

drivers/net/ethernet/mellanox/mlx5/core/lag.c+21−0

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

drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h+2−0

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

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

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

drivers/net/ethernet/mellanox/mlxsw/Kconfig+1−0

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

drivers/net/ethernet/mellanox/mlxsw/pci.c+9−7

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

drivers/net/ethernet/mellanox/mlxsw/pci_hw.h+2−1

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

drivers/net/ethernet/mellanox/mlxsw/spectrum.c+5−2

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c+9−1

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c+0−2

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c+2−2

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c+2−2

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

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

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

drivers/net/ethernet/microchip/lan743x_main.c+4−7

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

drivers/net/ethernet/myricom/myri10ge/myri10ge.c+3−3

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

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

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

drivers/net/ethernet/ni/nixge.c+6−6

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

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

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

drivers/net/ethernet/pasemi/pasemi_mac.c+3−3

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

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

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

drivers/net/ethernet/qlogic/qed/qed_cxt.c+8−8

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

drivers/net/ethernet/qlogic/qed/qed_dev.c+4−4

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

drivers/net/ethernet/qlogic/qed/qed_l2.c+16−4

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

drivers/net/ethernet/qlogic/qed/qed_l2.h+3−0

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

drivers/net/ethernet/qlogic/qed/qed_ll2.c+19−5

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

drivers/net/ethernet/qlogic/qed/qed_sp.h+1−0

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

drivers/net/ethernet/qlogic/qed/qed_sp_commands.c+3−0

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

drivers/net/ethernet/qlogic/qed/qed_spq.c+7−8

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

drivers/net/ethernet/qlogic/qed/qed_sriov.c+8−2

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

drivers/net/ethernet/qlogic/qed/qed_vf.c+10−0

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

drivers/net/ethernet/qlogic/qede/qede.h+4−1

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

drivers/net/ethernet/qlogic/qede/qede_fp.c+13−0

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

drivers/net/ethernet/qlogic/qede/qede_main.c+3−0

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c+14−14

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

drivers/net/ethernet/qualcomm/emac/emac-mac.c+1−1

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

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

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

drivers/net/ethernet/realtek/r8169.c+7−2

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

drivers/net/ethernet/renesas/ravb_main.c+7−5

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

drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c+6−6

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

drivers/net/ethernet/sfc/ef10.c+21−8

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

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

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

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

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

drivers/net/ethernet/sgi/meth.c+2−2

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

drivers/net/ethernet/smsc/epic100.c+1−1

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

drivers/net/ethernet/socionext/netsec.c+2−2

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

drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c+3−1

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

drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c+3−3

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

drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c+10−4

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

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+55−53

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

drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c+10−0

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

drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c+2−0

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

drivers/net/ethernet/sun/cassini.c+2−15

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

drivers/net/ethernet/sun/cassini.h+1−14

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

drivers/net/ethernet/sun/sunbmac.c+1−1

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

drivers/net/ethernet/sun/sunhme.c+1−1

This diff is large: its 9 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/cpmac.c+1−1

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

drivers/net/ethernet/tundra/tsi108_eth.c+4−4

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

drivers/net/ethernet/via/via-velocity.c+1−1

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

drivers/net/ethernet/xilinx/ll_temac_main.c+6−6

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

drivers/net/ethernet/xilinx/xilinx_axienet_main.c+6−6

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

drivers/net/fddi/defxx.c+4−4

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

drivers/net/fddi/skfp/skfddi.c+4−4

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

drivers/net/geneve.c+7−3

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

drivers/net/hyperv/hyperv_net.h+8−4

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

drivers/net/hyperv/netvsc.c+2−2

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

drivers/net/hyperv/netvsc_drv.c+92−53

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

drivers/net/hyperv/rndis_filter.c+27−9

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

drivers/net/ieee802154/mcr20a.c+3−3

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

drivers/net/ipvlan/ipvlan_main.c+3−3

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

drivers/net/macvlan.c+1−1

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

drivers/net/phy/asix.c+1−7

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

drivers/net/phy/bcm87xx.c+2−0

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

drivers/net/phy/cortina.c+1−0

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

drivers/net/phy/dp83640.c+10−3

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

drivers/net/phy/marvell.c+35−18

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

drivers/net/phy/mdio-hisi-femac.c+2−14

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

drivers/net/phy/mdio_bus.c+1−0

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

drivers/net/phy/meson-gxl.c+1−0

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

drivers/net/phy/micrel.c+2−0

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

drivers/net/phy/phy.c+7−12

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

drivers/net/phy/phy_device.c+17−0

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

drivers/net/phy/rockchip.c+2−7

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

drivers/net/phy/teranetics.c+1−0

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

drivers/net/ppp/pppoe.c+1−0

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

drivers/net/tun.c+8−6

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

drivers/net/usb/aqc111.c+15−0

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

drivers/net/usb/asix_devices.c+7−2

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

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

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

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

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

drivers/net/virtio_net.c+129−52

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

drivers/net/vmxnet3/vmxnet3_drv.c+4−4

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

drivers/net/wan/dscc4.c+1−1

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

drivers/net/wan/fsl_ucc_hdlc.c+65−6

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

drivers/net/wireless/ath/ath10k/ce.c+3−4

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

drivers/net/wireless/ath/ath10k/core.c+1−1

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

drivers/net/wireless/ath/ath10k/mac.c+4−4

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

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

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

drivers/net/wireless/ath/ath10k/wmi.c+1−1

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

drivers/net/wireless/ath/wcn36xx/dxe.c+8−9

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

drivers/net/wireless/ath/wil6210/txrx_edma.c+4−4

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

drivers/net/wireless/broadcom/b43/dma.c+3−3

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

drivers/net/wireless/broadcom/b43legacy/dma.c+3−3

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c+8−8

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

drivers/net/wireless/intel/iwlwifi/Kconfig+2−1

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

drivers/net/wireless/intel/iwlwifi/pcie/rx.c+15−24

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

drivers/net/wireless/mac80211_hwsim.c+5−0

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

drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c+19−21

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

drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.h+1−1

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

drivers/net/wireless/mediatek/mt76/mt76x0/phy.c+5−5

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

drivers/net/wireless/ralink/rt2x00/rt2x00mmio.c+3−3

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

drivers/net/wireless/ti/wlcore/sdio.c+7−8

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

drivers/net/wireless/virt_wifi.c+3−1

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

drivers/ntb/hw/mscc/ntb_hw_switchtec.c+4−4

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

drivers/nvdimm/dimm.c+6−0

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

drivers/nvdimm/dimm_devs.c+17−5

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

drivers/nvdimm/nd-core.h+2−2

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

drivers/nvdimm/nd.h+1−0

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

drivers/nvme/host/core.c+17−10

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

drivers/nvme/host/fabrics.c+2−0

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

drivers/nvme/host/multipath.c+3−2

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

drivers/nvme/host/nvme.h+6−0

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

drivers/nvme/host/pci.c+76−42

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

drivers/nvme/host/rdma.c+43−21

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

drivers/nvme/host/tcp.c+17−18

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

drivers/nvme/target/rdma.c+14−1

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

drivers/nvme/target/tcp.c+1−1

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

drivers/of/dynamic.c+0−3

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

drivers/of/fdt.c+0−4

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

drivers/of/overlay.c+0−3

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

drivers/of/pdt.c+0−1

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

drivers/of/property.c+1−0

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

drivers/opp/core.c+58−5

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

drivers/pci/Kconfig+8−14

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

drivers/pci/controller/dwc/pci-imx6.c+7−4

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

drivers/pci/controller/dwc/pci-meson.c+1−0

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

drivers/pci/controller/dwc/pcie-armada8k.c+0−16

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

drivers/pci/controller/pcie-iproc-msi.c+3−3

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

drivers/pci/msi.c+13−9

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

drivers/pci/pci.c+2−1

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

drivers/pci/quirks.c+3−2

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

drivers/pci/switch/switchtec.c+4−4

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

drivers/phy/marvell/phy-berlin-sata.c+3−2

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

drivers/phy/qualcomm/phy-ath79-usb.c+2−2

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

drivers/phy/ti/Kconfig+1−0

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

drivers/phy/ti/phy-gmii-sel.c+2−2

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

drivers/pinctrl/intel/pinctrl-cherryview.c+4−4

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

drivers/pinctrl/mediatek/Kconfig+3−0

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

drivers/pinctrl/pinctrl-mcp23s08.c+6−1

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

drivers/pinctrl/sunxi/pinctrl-sun50i-h6.c+1−1

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

drivers/pinctrl/sunxi/pinctrl-sunxi.c+22−22

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

drivers/pinctrl/sunxi/pinctrl-sunxi.h+1−1

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

drivers/platform/x86/Kconfig+5−3

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

drivers/ptp/ptp_chardev.c+2−1

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

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

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

drivers/rapidio/devices/tsi721_dma.c+4−4

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

drivers/remoteproc/remoteproc_virtio.c+7−2

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

drivers/reset/Kconfig+14−6

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

drivers/reset/Makefile+2−1

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

drivers/reset/core.c+42−0

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

drivers/reset/reset-hsdk.c+1−0

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

drivers/reset/reset-simple.c+3−10

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

drivers/reset/reset-socfpga.c+88−0

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

drivers/reset/reset-uniphier-glue.crenamed from drivers/reset/reset-uniphier-usb3.c+31−19

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

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

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

drivers/s390/net/ism_drv.c+7−8

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

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

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

drivers/s390/net/qeth_core_main.c+20−11

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

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

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

drivers/s390/net/qeth_l3_main.c+3−0

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

drivers/s390/scsi/zfcp_aux.c+0−1

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

drivers/s390/scsi/zfcp_scsi.c+2−0

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

drivers/s390/virtio/virtio_ccw.c+9−3

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

drivers/scsi/3w-sas.c+3−2

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

drivers/scsi/53c700.c+1−1

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

drivers/scsi/a100u2w.c+4−4

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

drivers/scsi/aacraid/linit.c+4−5

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

drivers/scsi/aic94xx/aic94xx_init.c+4−4

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

drivers/scsi/arcmsr/arcmsr_hba.c+12−6

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

drivers/scsi/be2iscsi/be_main.c+2−2

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

drivers/scsi/be2iscsi/be_mgmt.c+5−6

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

drivers/scsi/bfa/bfad_bsg.c+3−3

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

drivers/scsi/bnx2fc/bnx2fc_hwi.c+24−25

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

drivers/scsi/bnx2fc/bnx2fc_io.c+2−2

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

drivers/scsi/bnx2fc/bnx2fc_tgt.c+22−22

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

drivers/scsi/bnx2i/bnx2i_hwi.c+4−4

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

drivers/scsi/csiostor/csio_attr.c+1−1

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

drivers/scsi/csiostor/csio_wr.c+2−2

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

drivers/scsi/cxgbi/cxgb3i/cxgb3i.c+4−5

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

drivers/scsi/cxgbi/cxgb4i/cxgb4i.c+20−8

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

drivers/scsi/cxgbi/libcxgbi.c+4−3

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

drivers/scsi/cxgbi/libcxgbi.h+3−2

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

drivers/scsi/cxlflash/main.c+2−0

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

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c+6−6

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

drivers/scsi/isci/init.c+7−7

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

drivers/scsi/libfc/fc_lport.c+3−3

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

drivers/scsi/libfc/fc_rport.c+0−1

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

drivers/scsi/lpfc/lpfc_bsg.c+2−2

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

drivers/scsi/lpfc/lpfc_init.c+7−7

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

drivers/scsi/lpfc/lpfc_mbox.c+3−3

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

drivers/scsi/lpfc/lpfc_nvme.c+9−7

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

drivers/scsi/lpfc/lpfc_nvme.h+1−1

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

drivers/scsi/lpfc/lpfc_nvmet.c+5−3

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

drivers/scsi/lpfc/lpfc_nvmet.h+1−1

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

drivers/scsi/lpfc/lpfc_sli.c+18−17

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

drivers/scsi/megaraid/megaraid_mbox.c+8−7

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

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

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

drivers/scsi/megaraid/megaraid_sas_fusion.c+5−3

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

drivers/scsi/mesh.c+3−2

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

drivers/scsi/mvumi.c+5−4

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

drivers/scsi/pm8001/pm8001_sas.c+3−3

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

drivers/scsi/qedf/qedf_main.c+17−12

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

drivers/scsi/qedi/qedi_iscsi.c+3−0

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

drivers/scsi/qedi/qedi_iscsi.h+1−0

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

drivers/scsi/qedi/qedi_main.c+19−20

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

drivers/scsi/qla1280.c+1−1

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

drivers/scsi/qla2xxx/qla_attr.c+2−2

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

drivers/scsi/qla2xxx/qla_bsg.c+2−2

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

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

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

drivers/scsi/qla2xxx/qla_gs.c+8−6

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

drivers/scsi/qla2xxx/qla_init.c+4−4

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

drivers/scsi/qla2xxx/qla_isr.c+1−0

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

drivers/scsi/qla2xxx/qla_os.c+1−1

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

drivers/scsi/qla4xxx/ql4_init.c+2−2

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

drivers/scsi/qla4xxx/ql4_mbx.c+9−9

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

drivers/scsi/qla4xxx/ql4_nx.c+2−2

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

drivers/scsi/qla4xxx/ql4_os.c+7−5

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

drivers/scsi/scsi_debug.c+21−20

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

drivers/scsi/scsi_lib.c+2−2

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

drivers/scsi/scsi_pm.c+15−11

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

drivers/scsi/sd.c+6−0

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

drivers/scsi/sd_zbc.c+8−4

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

drivers/scsi/smartpqi/smartpqi_init.c+17−17

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

drivers/scsi/ufs/ufs.h+1−1

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

drivers/scsi/ufs/ufshcd.c+10−2

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

drivers/soc/fsl/qbman/dpaa_sys.c+1−1

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

drivers/soc/fsl/qbman/qman.c+5−4

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

drivers/soc/fsl/qe/qe_tdm.c+0−55

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

drivers/soc/renesas/Kconfig+1−1

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

drivers/soc/renesas/r8a774c0-sysc.c+4−19

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

drivers/spi/spi-pic32-sqi.c+3−3

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

drivers/staging/android/ion/ion.c+1−1

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

drivers/staging/mt7621-eth/mtk_eth_soc.c+1−2

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

drivers/staging/octeon/ethernet-mdio.c+1−1

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

drivers/staging/rtl8188eu/core/rtw_security.c+3−3

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

drivers/staging/rtl8188eu/os_dep/usb_intf.c+1−0

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

drivers/staging/rtl8723bs/include/ieee80211.h+3−3

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

drivers/staging/rtl8723bs/os_dep/sdio_intf.c+1−1

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

drivers/staging/speakup/spk_ttyio.c+4−2

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

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c+2−4

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

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c+1−0

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

drivers/staging/vt6655/device_main.c+6−13

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

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

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

drivers/staging/wilc1000/wilc_wlan.c+4−3

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

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

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

drivers/target/target_core_configfs.c+7−1

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

drivers/target/target_core_user.c+62−27

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

drivers/thermal/intel/int340x_thermal/Kconfig+1−1

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

drivers/thermal/intel/int340x_thermal/processor_thermal_device.c+16−14

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

drivers/tty/n_hdlc.c+1−0

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

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

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

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

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

drivers/tty/serial/8250/8250_pci.c+5−4

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

drivers/tty/serial/Kconfig+12−0

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

drivers/tty/serial/Makefile+1−0

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

drivers/tty/serial/earlycon-riscv-sbi.c+31−0

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

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

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

drivers/tty/serial/lantiq.c+19−17

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

drivers/tty/serial/qcom_geni_serial.c+2−2

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

drivers/tty/serial/serial_core.c+14−4

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

drivers/tty/serial/sh-sci.c+8−1

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

drivers/tty/tty_io.c+15−8

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

drivers/tty/vt/vt.c+17−33

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

drivers/usb/chipidea/ci_hdrc_imx.c+2−1

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

drivers/usb/class/cdc-acm.c+7−0

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

drivers/usb/core/generic.c+6−3

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

drivers/usb/core/ledtrig-usbport.c+10−7

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

drivers/usb/core/quirks.c+2−1

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

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

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

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

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

drivers/usb/dwc3/gadget.c+5−1

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

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

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

drivers/usb/gadget/udc/bdc/bdc_core.c+6−7

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

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

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

drivers/usb/host/ehci-mv.c+1−0

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

drivers/usb/host/uhci-hcd.c+3−3

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

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

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

drivers/usb/musb/musb_gadget.c+1−12

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

drivers/usb/musb/musbhsdma.c+11−10

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

drivers/usb/phy/Kconfig+1−1

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

drivers/usb/phy/phy-am335x.c+1−4

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

drivers/usb/serial/ftdi_sio.c+14−1

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

drivers/usb/serial/keyspan_usa26msg.h+1−0

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

drivers/usb/serial/keyspan_usa28msg.h+1−0

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

drivers/usb/serial/keyspan_usa49msg.h+1−0

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

drivers/usb/serial/keyspan_usa67msg.h+1−0

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

drivers/usb/serial/keyspan_usa90msg.h+1−0

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

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

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

drivers/usb/serial/pl2303.h+2−0

This diff is large: its 16 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/storage/scsiglue.c+6−2

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

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

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

drivers/usb/typec/tcpm/tcpm.c+2−1

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

drivers/usb/usbip/README+0−7

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

drivers/vfio/pci/trace.h+2−6

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

drivers/vfio/pci/vfio_pci_nvlink2.c+16−20

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

drivers/vfio/vfio_iommu_type1.c+1−1

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

drivers/vhost/net.c+4−2

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

drivers/vhost/scsi.c+13−9

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

drivers/vhost/vhost.c+93−19

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

drivers/vhost/vhost.h+5−2

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

drivers/vhost/vsock.c+2−2

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

drivers/video/backlight/88pm860x_bl.c+1−1

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

drivers/video/backlight/pwm_bl.c+17−11

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

drivers/video/console/vgacon.c+4−3

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

drivers/video/fbdev/core/fbcon.c+7−0

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

drivers/video/fbdev/core/fbmem.c+10−9

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

drivers/video/fbdev/da8xx-fb.c+3−3

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

drivers/video/fbdev/offb.c+9−9

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

drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c+2−0

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

drivers/video/logo/Kconfig+0−9

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

drivers/virtio/virtio_balloon.c+65−33

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

drivers/virtio/virtio_mmio.c+7−2

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

drivers/virtio/virtio_pci_common.c+4−4

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

drivers/virtio/virtio_ring.c+14−1

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

drivers/watchdog/mt7621_wdt.c+1−0

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

drivers/watchdog/rt2880_wdt.c+1−0

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

drivers/watchdog/tqmx86_wdt.c+4−4

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

drivers/xen/events/events_base.c+1−1

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

drivers/xen/pvcalls-back.c+4−5

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

drivers/xen/pvcalls-front.c+75−29

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

drivers/xen/swiotlb-xen.c+2−2

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

fs/afs/flock.c+2−2

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

fs/afs/inode.c+2−1

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

fs/afs/protocol_yfs.h+11−0

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

fs/afs/rxrpc.c+42−11

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

fs/afs/server_list.c+1−3

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

fs/afs/yfsclient.c+1−1

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

fs/aio.c+1−0

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

fs/autofs/expire.c+2−1

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

fs/autofs/inode.c+3−1

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

fs/block_dev.c+18−10

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

fs/btrfs/ctree.c+50−26

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

fs/btrfs/ctree.h+7−0

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

fs/btrfs/disk-io.c+12−0

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

fs/btrfs/extent-tree.c+14−7

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

fs/btrfs/inode.c+2−3

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

fs/btrfs/ioctl.c+43−6

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

fs/btrfs/super.c+3−0

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

fs/btrfs/transaction.c+16−8

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

fs/btrfs/volumes.c+14−2

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

fs/buffer.c+10−9

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

fs/ceph/addr.c+1−4

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

fs/ceph/caps.c+2−0

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

fs/ceph/quota.c+0−13

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

fs/ceph/super.c+2−2

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

fs/cifs/cifs_debug.c+1−0

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

fs/cifs/cifsfs.h+1−1

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

fs/cifs/cifsglob.h+20−0

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

fs/cifs/cifssmb.c+43−22

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

fs/cifs/connect.c+25−3

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

fs/cifs/dfs_cache.c+1−0

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

fs/cifs/file.c+43−13

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

fs/cifs/inode.c+10−0

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

fs/cifs/smb2file.c+6−2

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

fs/cifs/smb2inode.c+17−0

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

fs/cifs/smb2misc.c+7−0

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

fs/cifs/smb2ops.c+50−22

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

fs/cifs/smb2pdu.c+75−33

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

fs/cifs/smb2pdu.h+15−4

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

fs/cifs/trace.c+0−10

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

fs/cifs/trace.h+0−10

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

fs/cifs/transport.c+83−30

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

fs/dcache.c+33−5

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

fs/debugfs/inode.c+24−12

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

fs/direct-io.c+3−2

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

fs/drop_caches.c+7−1

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

fs/fs-writeback.c+38−2

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

fs/fuse/dev.c+3−1

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

fs/fuse/file.c+1−1

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

fs/fuse/inode.c+1−1

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

fs/gfs2/rgrp.c+1−1

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

fs/hugetlbfs/inode.c+33−28

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

fs/iomap.c+30−7

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

fs/nfs/nfs4file.c+1−7

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

fs/nfs/super.c+5−0

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

fs/nfs/write.c+5−4

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

fs/nfsd/vfs.c+4−2

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

fs/notify/inotify/inotify_user.c+4−2

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

fs/proc/generic.c+3−1

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

fs/proc/internal.h+1−0

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

fs/proc/proc_net.c+20−0

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

fs/pstore/ram.c+4−8

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

fs/sysfs/dir.c+2−1

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

fs/sysfs/file.c+4−2

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

fs/sysfs/group.c+2−1

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

fs/sysfs/symlink.c+2−1

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

fs/xfs/scrub/repair.c+8−3

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

fs/xfs/xfs_aops.c+2−0

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

fs/xfs/xfs_buf.c+17−2

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

include/drm/drm_dp_helper.h+7−0

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

include/drm/drm_dp_mst_helper.h+2−1

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

include/dt-bindings/clock/imx8mq-clock.h+13−13

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

include/dt-bindings/clock/marvell,mmp2.h+0−1

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

include/dt-bindings/reset/amlogic,meson-axg-reset.h+1−2

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

include/linux/backing-dev-defs.h+1−0

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

include/linux/bcma/bcma_soc.h+1−0

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

include/linux/blk_types.h+1−1

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

include/linux/blktrace_api.h+7−1

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

include/linux/bpf_verifier.h+1−0

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

include/linux/bpfilter.h+12−3

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

include/linux/ceph/libceph.h+4−2

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

include/linux/ceph/osd_client.h+0−1

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

include/linux/compiler-clang.h+2−3

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

include/linux/compiler-gcc.h+1−5

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

include/linux/compiler-intel.h+1−3

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

include/linux/compiler.h+3−1

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

include/linux/cpu.h+0−2

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

include/linux/dcache.h+4−3

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

include/linux/dma-mapping.h+0−9

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

include/linux/fb.h+1−0

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

include/linux/filter.h+18−3

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

include/linux/fs.h+5−4

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

include/linux/hid-debug.h+4−5

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

include/linux/hid.h+1−2

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

include/linux/hyperv.h+3−2

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

include/linux/ide.h+2−0

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

include/linux/if_arp.h+1−0

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

include/linux/interrupt.h+1−0

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

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

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

include/linux/libnvdimm.h+1−1

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

include/linux/memory_hotplug.h+10−8

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

include/linux/mfd/cros_ec_commands.h+94−0

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

include/linux/mfd/ingenic-tcu.h+1−1

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

include/linux/mfd/madera/core.h+7−0

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

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

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

include/linux/mfd/tmio.h+1−1

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

include/linux/mmzone.h+6−0

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

include/linux/module.h+1−1

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

include/linux/netdevice.h+8−0

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

include/linux/of.h+0−1

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

include/linux/pci-dma-compat.h+1−1

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

include/linux/phy.h+4−2

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

include/linux/phy/phy.h+1−0

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

include/linux/pm_opp.h+5−0

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

include/linux/pm_runtime.h+1−1

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

include/linux/qcom_scm.h+1−0

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

include/linux/qed/qed_chain.h+31−0

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

include/linux/reset.h+11−4

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

include/linux/sched.h+10−1

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

include/linux/sched/coredump.h+1−0

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

include/linux/sched/wake_q.h+5−1

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

include/linux/signal.h+1−1

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

include/linux/skbuff.h+1−0

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

include/linux/stmmac.h+1−0

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

include/linux/umh.h+2−0

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

include/linux/virtio_config.h+9−4

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

include/linux/xarray.h+170−57

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

include/net/af_rxrpc.h+0−16

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

include/net/ax25.h+12−0

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

include/net/ip_fib.h+1−1

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

include/net/l3mdev.h+2−1

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

include/net/netfilter/nf_flow_table.h+0−1

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

include/net/netfilter/nf_tables.h+13−4

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

include/net/tls.h+2−0

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

include/rdma/ib_verbs.h+22−2

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

include/sound/compress_driver.h+5−1

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

include/sound/hda_codec.h+1−0

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

include/sound/soc.h+6−0

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

include/trace/events/afs.h+2−0

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

include/uapi/linux/android/binderfs.hrenamed from include/uapi/linux/android/binder_ctl.h+5−5

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

include/uapi/linux/audit.h+2−0

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

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

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

include/uapi/linux/in.h+1−1

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

include/uapi/linux/input.h+5−1

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

include/uapi/linux/ptp_clock.h+1−1

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

include/uapi/linux/virtio_config.h+6−0

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

include/uapi/linux/virtio_ring.h+0−10

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

include/uapi/rdma/hns-abi.h+5−0

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

include/uapi/rdma/vmw_pvrdma-abi.h+1−0

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

include/xen/arm/page-coherent.h+3−94

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

init/Kconfig+13−1

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

kernel/bpf/btf.c+9−8

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

kernel/bpf/cgroup.c+2−1

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

kernel/bpf/hashtab.c+2−2

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

kernel/bpf/map_in_map.c+15−2

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

kernel/bpf/percpu_freelist.c+29−12

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

kernel/bpf/percpu_freelist.h+4−0

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

kernel/bpf/stackmap.c+9−3

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

kernel/bpf/syscall.c+10−2

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

kernel/bpf/verifier.c+48−13

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

kernel/cpu.c+5−33

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

kernel/dma/swiotlb.c+2−0

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

kernel/events/core.c+7−7

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

kernel/events/ring_buffer.c+3−0

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

kernel/exit.c+12−3

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

kernel/fork.c+12−2

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

kernel/futex.c+28−17

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

kernel/irq/irqdesc.c+1−1

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

kernel/irq/manage.c+3−0

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

kernel/locking/rtmutex.c+32−5

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

kernel/locking/rwsem-xadd.c+9−2

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

kernel/relay.c+3−1

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

kernel/sched/core.c+16−3

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

kernel/sched/fair.c+1−0

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

kernel/sched/psi.c+17−4

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

kernel/seccomp.c+4−0

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

kernel/signal.c+59−4

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

kernel/smp.c+0−2

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

kernel/sys.c+2−1

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

kernel/time/posix-cpu-timers.c+1−0

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

kernel/trace/bpf_trace.c+2−12

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

kernel/trace/trace_kprobe.c+9−3

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

kernel/trace/trace_uprobe.c+8−1

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

kernel/umh.c+31−2

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

kernel/workqueue.c+23−0

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

kernel/workqueue_internal.h+5−1

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

lib/int_sqrt.c+1−1

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

lib/sbitmap.c+3−10

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

lib/test_kmod.c+1−1

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

lib/test_rhashtable.c+15−8

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

lib/test_xarray.c+45−12

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

lib/xarray.c+54−38

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

mm/backing-dev.c+1−0

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

mm/hugetlb.c+26−58

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

mm/kasan/Makefile+1−0

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

mm/kasan/common.c+43−22

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

mm/memory-failure.c+4−15

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

mm/memory.c+24−2

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

mm/memory_hotplug.c+27−35

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

mm/migrate.c+6−19

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

mm/mincore.c+81−13

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

mm/oom_kill.c+10−2

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

mm/page_alloc.c+7−13

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

mm/rmap.c+2−6

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

mm/slab.c+4−2

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

mm/slub.c+2−0

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

mm/usercopy.c+5−4

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

mm/userfaultfd.c+2−9

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

mm/util.c+1−1

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

net/ax25/ax25_ip.c+2−2

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

net/ax25/ax25_route.c+8−11

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

net/batman-adv/bat_v_elp.c+3−0

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

net/batman-adv/hard-interface.c+3−2

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

net/batman-adv/soft-interface.c+2−0

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

net/bpfilter/bpfilter_kern.c+42−34

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

net/bpfilter/bpfilter_umh_blob.S+1−1

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

net/bridge/br_fdb.c+5−0

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

net/bridge/br_forward.c+5−5

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

net/bridge/br_netfilter_hooks.c+1−1

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

net/bridge/br_netfilter_ipv6.c+1−0

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

net/bridge/br_private.h+1−0

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

net/bridge/br_vlan.c+13−13

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

net/bridge/netfilter/ebtables.c+10−5

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

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

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

net/can/bcm.c+27−0

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

net/can/gw.c+27−3

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

net/ceph/ceph_common.c+10−1

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

net/ceph/debugfs.c+1−1

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

net/ceph/messenger.c+3−2

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

net/ceph/osd_client.c+2−2

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

net/core/dev.c+3−0

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

net/core/filter.c+23−13

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

net/core/lwt_bpf.c+1−0

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

net/core/neighbour.c+10−5

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

net/core/skbuff.c+1−6

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

net/core/skmsg.c+1−2

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

net/dccp/ccid.h+2−2

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

net/decnet/dn_dev.c+1−1

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

net/dsa/master.c+4−0

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

net/dsa/slave.c+10−7

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

net/ipv4/bpfilter/sockopt.c+48−10

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

net/ipv4/devinet.c+1−1

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

net/ipv4/fib_frontend.c+2−2

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

net/ipv4/fib_trie.c+12−3

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

net/ipv4/fou.c+9−3

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

net/ipv4/gre_demux.c+17−0

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

net/ipv4/ip_gre.c+20−19

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

net/ipv4/ip_input.c+1−0

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

net/ipv4/ip_sockglue.c+5−7

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

net/ipv4/ip_tunnel.c+7−1

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

net/ipv4/ip_vti.c+50−0

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

net/ipv4/netfilter/ipt_CLUSTERIP.c+1−1

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

net/ipv4/tcp.c+1−1

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

net/ipv4/tcp_timer.c+1−1

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

net/ipv4/udp.c+13−5

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

net/ipv4/udp_impl.h+1−0

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

net/ipv4/udplite.c+1−0

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

net/ipv6/addrconf.c+5−3

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

net/ipv6/af_inet6.c+13−1

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

net/ipv6/datagram.c+5−6

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

net/ipv6/fou6.c+15−2

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

net/ipv6/icmp.c+6−2

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

net/ipv6/ip6_gre.c+16−9

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

net/ipv6/ip6mr.c+3−4

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

net/ipv6/netfilter.c+3−1

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

net/ipv6/route.c+2−12

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

net/ipv6/seg6_iptunnel.c+2−0

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

net/ipv6/sit.c+2−1

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

net/ipv6/udp.c+17−9

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

net/ipv6/udp_impl.h+1−0

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

net/ipv6/udplite.c+1−0

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

net/l2tp/l2tp_core.c+6−3

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

net/l2tp/l2tp_core.h+20−0

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

net/l2tp/l2tp_ip.c+3−0

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

net/l2tp/l2tp_ip6.c+3−0

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

net/mac80211/cfg.c+4−0

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

net/mac80211/rx.c+4−2

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

net/mac80211/tx.c+9−3

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

net/netfilter/ipvs/ip_vs_ctl.c+12−0

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

net/netfilter/nf_conntrack_core.c+16−0

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

net/netfilter/nf_flow_table_core.c+3−2

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

net/netfilter/nf_tables_api.c+48−51

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

net/netfilter/nfnetlink_osf.c+4−0

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

net/netfilter/nft_compat.c+130−47

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

net/netfilter/nft_dynset.c+7−11

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

net/netfilter/nft_flow_offload.c+8−5

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

net/netfilter/nft_immediate.c+5−1

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

net/netfilter/nft_lookup.c+7−11

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

net/netfilter/nft_objref.c+7−11

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

net/netrom/nr_timer.c+10−10

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

net/openvswitch/flow.c+5−3

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

net/openvswitch/flow_netlink.c+1−1

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

net/packet/af_packet.c+4−3

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

net/rds/bind.c+3−3

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

net/rds/ib_send.c+2−2

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

net/rds/message.c+2−2

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

net/rds/rds.h+0−4

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

net/rds/send.c+1−1

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

net/rose/rose_route.c+5−0

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

net/rxrpc/af_rxrpc.c+0−70

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

net/rxrpc/ar-internal.h+12−7

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

net/rxrpc/call_object.c+0−97

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

net/rxrpc/conn_client.c+1−4

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

net/rxrpc/recvmsg.c+2−1

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

net/rxrpc/sendmsg.c+11−13

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

net/sched/act_tunnel_key.c+11−8

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

net/sched/cls_api.c+1−2

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

net/sched/cls_flower.c+19−6

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

net/sched/sch_cake.c+3−2

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

net/sched/sch_cbs.c+2−1

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

net/sched/sch_drr.c+5−2

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

net/sched/sch_dsmark.c+2−1

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

net/sched/sch_hfsc.c+5−4

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

net/sched/sch_htb.c+2−1

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

net/sched/sch_prio.c+2−1

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

net/sched/sch_qfq.c+12−8

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

net/sched/sch_tbf.c+2−1

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

net/sctp/ipv6.c+3−5

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

net/sctp/protocol.c+3−4

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

net/sctp/sm_make_chunk.c+8−3

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

net/sctp/socket.c+2−2

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

net/sctp/stream.c+45−33

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

net/smc/af_smc.c+13−2

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

net/smc/smc_cdc.c+10−11

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

net/smc/smc_cdc.h+32−2

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

net/smc/smc_clc.c+1−1

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

net/smc/smc_close.c+1−8

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

net/smc/smc_core.c+5−1

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

net/smc/smc_core.h+20−0

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

net/smc/smc_ib.c+3−3

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

net/smc/smc_llc.c+2−1

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

net/smc/smc_pnet.c+1−1

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

net/smc/smc_tx.c+31−33

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

net/smc/smc_wr.c+41−5

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

net/smc/smc_wr.h+1−0

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

net/socket.c+63−19

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

net/sunrpc/auth.c+3−0

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

net/sunrpc/auth_gss/auth_gss.c+9−3

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

net/sunrpc/clnt.c+12−8

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

net/sunrpc/xprt.c+2−1

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

net/sunrpc/xprtrdma/svc_rdma_sendto.c+99−6

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

net/sunrpc/xprtrdma/svc_rdma_transport.c+3−6

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

net/sunrpc/xprtrdma/verbs.c+4−6

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

net/sunrpc/xprtsock.c+22−0

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

net/tipc/netlink_compat.c+52−2

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

net/tipc/topsrv.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/tls/tls_sw.c+5−1

This diff is large: its 28 lines aren’t shown here.

net/vmw_vsock/virtio_transport.c+21−8

This diff is large: its 78 lines aren’t shown here.

net/wireless/ap.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/wireless/core.h+2−0

This diff is large: its 9 lines aren’t shown here.

net/wireless/nl80211.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/wireless/reg.c+9−4

This diff is large: its 34 lines aren’t shown here.

net/wireless/sme.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/xdp/xdp_umem.c+13−3

This diff is large: its 35 lines aren’t shown here.

net/xfrm/xfrm_policy.c+33−30

This diff is large: its 169 lines aren’t shown here.

net/xfrm/xfrm_user.c+9−4

This diff is large: its 20 lines aren’t shown here.

samples/bpf/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

samples/bpf/asm_goto_workaround.h+16−0

This diff is large: its 17 lines aren’t shown here.

samples/bpf/test_cgrp2_attach2.c+7−7

This diff is large: its 43 lines aren’t shown here.

samples/bpf/test_current_task_under_cgroup_user.c+1−1

This diff is large: its 9 lines aren’t shown here.

samples/bpf/xdp1_user.c+1−1

This diff is large: its 9 lines aren’t shown here.

samples/mei/mei-amt-version.c+1−1

This diff is large: its 9 lines aren’t shown here.

samples/seccomp/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

scripts/Kbuild.include+0−4

This diff is large: its 11 lines aren’t shown here.

scripts/coccinelle/api/alloc/alloc_cast.cocci+4−4

This diff is large: its 36 lines aren’t shown here.

scripts/coccinelle/api/alloc/zalloc-simple.cocci+1−10

This diff is large: its 25 lines aren’t shown here.

scripts/gcc-plugins/arm_ssp_per_task_plugin.c+21−2

This diff is large: its 55 lines aren’t shown here.

scripts/kconfig/Makefile+1−1

This diff is large: its 6 lines aren’t shown here.

scripts/mod/modpost.c+1−1

This diff is large: its 9 lines aren’t shown here.

security/apparmor/domain.c+4−1

This diff is large: its 12 lines aren’t shown here.

security/apparmor/lsm.c+2−0

This diff is large: its 15 lines aren’t shown here.

security/security.c+7−0

This diff is large: its 14 lines aren’t shown here.

security/selinux/ss/policydb.c+2−1

This diff is large: its 10 lines aren’t shown here.

security/yama/yama_lsm.c+3−1

This diff is large: its 11 lines aren’t shown here.

sound/aoa/soundbus/i2sbus/core.c+2−2

This diff is large: its 11 lines aren’t shown here.

sound/core/compress_offload.c+2−1

This diff is large: its 10 lines aren’t shown here.

sound/core/pcm_lib.c+8−1

This diff is large: its 23 lines aren’t shown here.

sound/pci/cs46xx/dsp_spos.c+3−0

This diff is large: its 10 lines aren’t shown here.

sound/pci/hda/hda_bind.c+2−1

This diff is large: its 10 lines aren’t shown here.

sound/pci/hda/hda_intel.c+2−0

This diff is large: its 16 lines aren’t shown here.

sound/pci/hda/patch_ca0132.c+3−1

This diff is large: its 12 lines aren’t shown here.

sound/pci/hda/patch_conexant.c+1−0

This diff is large: its 8 lines aren’t shown here.

sound/pci/hda/patch_realtek.c+97−61

This diff is large: its 372 lines aren’t shown here.

sound/soc/amd/raven/acp3x-pcm-dma.c+4−2

This diff is large: its 19 lines aren’t shown here.

sound/soc/codecs/hdac_hdmi.c+13−103

This diff is large: its 150 lines aren’t shown here.

sound/soc/codecs/pcm512x.c+4−7

This diff is large: its 39 lines aren’t shown here.

sound/soc/codecs/rt274.c+4−1

This diff is large: its 13 lines aren’t shown here.

sound/soc/codecs/rt5514-spi.c+2−0

This diff is large: its 9 lines aren’t shown here.

sound/soc/codecs/rt5682.c+1−0

This diff is large: its 8 lines aren’t shown here.

sound/soc/codecs/rt5682.h+12−12

This diff is large: its 31 lines aren’t shown here.

sound/soc/codecs/tlv320aic32x4.c+4−0

This diff is large: its 11 lines aren’t shown here.

sound/soc/fsl/imx-audmux.c+12−12

This diff is large: its 62 lines aren’t shown here.

sound/soc/intel/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/intel/atom/sst-mfld-platform-pcm.c+7−1

This diff is large: its 15 lines aren’t shown here.

sound/soc/intel/boards/broadwell.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/intel/boards/glk_rt5682_max98357a.c+7−38

This diff is large: its 77 lines aren’t shown here.

sound/soc/intel/boards/haswell.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/intel/skylake/skl.c+4−9

This diff is large: its 42 lines aren’t shown here.

sound/soc/qcom/qdsp6/q6asm-dai.c+12−5

This diff is large: its 46 lines aren’t shown here.

sound/soc/qcom/sdm845.c+22−9

This diff is large: its 57 lines aren’t shown here.

sound/soc/sh/dma-sh7760.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/soc-core.c+28−6

This diff is large: its 84 lines aren’t shown here.

sound/soc/soc-dapm.c+5−5

This diff is large: its 33 lines aren’t shown here.

sound/soc/ti/davinci-mcasp.c+64−72

This diff is large: its 176 lines aren’t shown here.

sound/soc/xilinx/Kconfig+1−1

This diff is large: its 7 lines aren’t shown here.

sound/soc/xilinx/xlnx_i2s.c+7−8

This diff is large: its 20 lines aren’t shown here.

sound/sparc/dbri.c+2−2

This diff is large: its 11 lines aren’t shown here.

sound/usb/card.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/usb/mixer.c+23−6

This diff is large: its 91 lines aren’t shown here.

sound/usb/quirks-table.h+6−0

This diff is large: its 20 lines aren’t shown here.

sound/usb/quirks.c+3−1

This diff is large: its 25 lines aren’t shown here.

sound/usb/stream.c+25−11

This diff is large: its 104 lines aren’t shown here.

tools/arch/powerpc/include/uapi/asm/perf_regs.h+1−0

This diff is large: its 8 lines aren’t shown here.

tools/arch/powerpc/include/uapi/asm/unistd.h+0−404

This diff is large: its 405 lines aren’t shown here.

tools/arch/riscv/include/uapi/asm/bitsperlong.h+25−0

This diff is large: its 26 lines aren’t shown here.

tools/arch/x86/include/asm/cpufeatures.h+2−0

This diff is large: its 12 lines aren’t shown here.

tools/arch/x86/include/asm/disabled-features.h+7−1

This diff is large: its 22 lines aren’t shown here.

tools/bpf/bpftool/Makefile+8−1

This diff is large: its 18 lines aren’t shown here.

tools/bpf/bpftool/btf_dumper.c+7−6

This diff is large: its 36 lines aren’t shown here.

tools/bpf/bpftool/common.c+1−5

This diff is large: its 28 lines aren’t shown here.

tools/bpf/bpftool/json_writer.c+1−6

This diff is large: its 17 lines aren’t shown here.

tools/bpf/bpftool/json_writer.h+0−5

This diff is large: its 12 lines aren’t shown here.

tools/bpf/bpftool/map.c+24−9

This diff is large: its 68 lines aren’t shown here.

tools/bpf/bpftool/prog.c+3−2

This diff is large: its 17 lines aren’t shown here.

tools/iio/iio_generic_buffer.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/include/uapi/asm-generic/unistd.h+3−1

This diff is large: its 13 lines aren’t shown here.

tools/include/uapi/asm/bitsperlong.h+2−0

This diff is large: its 9 lines aren’t shown here.

tools/include/uapi/drm/i915_drm.h+8−0

This diff is large: its 15 lines aren’t shown here.

tools/include/uapi/linux/fs.h+8−52

This diff is large: its 88 lines aren’t shown here.

tools/include/uapi/linux/if_link.h+19−0

This diff is large: its 51 lines aren’t shown here.

tools/include/uapi/linux/in.h+7−3

This diff is large: its 18 lines aren’t shown here.

tools/include/uapi/linux/kvm.h+19−0

This diff is large: its 40 lines aren’t shown here.

tools/include/uapi/linux/mount.h+58−0

This diff is large: its 59 lines aren’t shown here.

tools/include/uapi/linux/pkt_sched.h+1163−0

This diff is large: its 1164 lines aren’t shown here.

tools/include/uapi/linux/prctl.h+8−0

This diff is large: its 13 lines aren’t shown here.

tools/include/uapi/linux/vhost.h+2−111

This diff is large: its 129 lines aren’t shown here.

tools/lib/bpf/.gitignore+1−0

This diff is large: its 4 lines aren’t shown here.

tools/lib/bpf/README.rst+14−0

This diff is large: its 21 lines aren’t shown here.

tools/lib/bpf/bpf.c+15−4

This diff is large: its 54 lines aren’t shown here.

tools/lib/traceevent/event-parse-api.c+2−2

This diff is large: its 16 lines aren’t shown here.

tools/lib/traceevent/event-parse-local.h+2−2

This diff is large: its 18 lines aren’t shown here.

tools/lib/traceevent/event-parse.c+82−47

This diff is large: its 261 lines aren’t shown here.

tools/lib/traceevent/event-parse.h+11−6

This diff is large: its 49 lines aren’t shown here.

tools/lib/traceevent/plugin_kvm.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/lib/traceevent/trace-seq.c+12−5

This diff is large: its 47 lines aren’t shown here.

tools/perf/Documentation/perf-c2c.txt+12−4

This diff is large: its 41 lines aren’t shown here.

tools/perf/Documentation/perf-mem.txt+1−1

This diff is large: its 9 lines aren’t shown here.

tools/perf/Makefile.perf+5−3

This diff is large: its 31 lines aren’t shown here.

tools/perf/arch/arm/tests/Build+1−0

This diff is large: its 6 lines aren’t shown here.

tools/perf/arch/arm/tests/arch-tests.c+4−0

This diff is large: its 11 lines aren’t shown here.

tools/perf/arch/arm/tests/vectors-page.c+24−0

This diff is large: its 25 lines aren’t shown here.

tools/perf/arch/powerpc/Makefile+11−4

This diff is large: its 30 lines aren’t shown here.

tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl+12−10

This diff is large: its 42 lines aren’t shown here.

tools/perf/arch/powerpc/entry/syscalls/syscall.tbl+427−0

This diff is large: its 428 lines aren’t shown here.

tools/perf/arch/powerpc/include/perf_regs.h+2−1

This diff is large: its 10 lines aren’t shown here.

tools/perf/arch/powerpc/util/Build+1−0

This diff is large: its 8 lines aren’t shown here.

tools/perf/arch/powerpc/util/mem-events.c+11−0

This diff is large: its 12 lines aren’t shown here.

tools/perf/arch/powerpc/util/perf_regs.c+1−0

This diff is large: its 8 lines aren’t shown here.

tools/perf/builtin-script.c+3−6

This diff is large: its 32 lines aren’t shown here.

tools/perf/builtin-stat.c+2−1

This diff is large: its 10 lines aren’t shown here.

tools/perf/builtin-top.c+1−6

This diff is large: its 14 lines aren’t shown here.

tools/perf/builtin-trace.c+29−11

This diff is large: its 76 lines aren’t shown here.

tools/perf/check-headers.sh+1−1

This diff is large: its 16 lines aren’t shown here.

tools/perf/perf-read-vdso.c+3−3

This diff is large: its 21 lines aren’t shown here.

tools/perf/tests/attr.py+19−13

This diff is large: its 114 lines aren’t shown here.

tools/perf/tests/evsel-tp-sched.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/perf/tests/shell/lib/probe_vfs_getname.sh+2−1

This diff is large: its 10 lines aren’t shown here.

tools/perf/tests/tests.h+5−0

This diff is large: its 10 lines aren’t shown here.

tools/perf/trace/beauty/mount_flags.sh+2−2

This diff is large: its 14 lines aren’t shown here.

tools/perf/trace/beauty/prctl_option.sh+1−1

This diff is large: its 9 lines aren’t shown here.

tools/perf/ui/browsers/annotate.c+10−6

This diff is large: its 47 lines aren’t shown here.

tools/perf/util/annotate.c+4−4

This diff is large: its 28 lines aren’t shown here.

tools/perf/util/c++/clang.cpp+1−1

This diff is large: its 9 lines aren’t shown here.

tools/perf/util/callchain.c+20−12

This diff is large: its 101 lines aren’t shown here.

tools/perf/util/callchain.h+1−0

This diff is large: its 8 lines aren’t shown here.

tools/perf/util/cpumap.c+9−2

This diff is large: its 26 lines aren’t shown here.

tools/perf/util/find-map.crenamed from tools/perf/util/find-vdso-map.c+3−4

This diff is large: its 26 lines aren’t shown here.

tools/perf/util/machine.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/perf/util/mem-events.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/perf/util/ordered-events.c+4−2

This diff is large: its 13 lines aren’t shown here.

tools/perf/util/setup.py+2−0

This diff is large: its 9 lines aren’t shown here.

tools/perf/util/strbuf.c+0−1

This diff is large: its 8 lines aren’t shown here.

tools/perf/util/symbol-elf.c+22−1

This diff is large: its 44 lines aren’t shown here.

tools/perf/util/symbol.c+1−0

This diff is large: its 8 lines aren’t shown here.

tools/perf/util/vdso.c+3−3

This diff is large: its 22 lines aren’t shown here.

tools/testing/nvdimm/dimm_devs.c+2−2

This diff is large: its 11 lines aren’t shown here.

tools/testing/selftests/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/bpf/.gitignore+1−0

This diff is large: its 5 lines aren’t shown here.

tools/testing/selftests/bpf/Makefile+4−1

This diff is large: its 12 lines aren’t shown here.

tools/testing/selftests/bpf/bpf_util.h+20−10

This diff is large: its 46 lines aren’t shown here.

tools/testing/selftests/bpf/cgroup_helpers.c+3−3

This diff is large: its 25 lines aren’t shown here.

tools/testing/selftests/bpf/test_btf.c+24−14

This diff is large: its 135 lines aren’t shown here.

tools/testing/selftests/bpf/test_cgroup_storage.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/test_dev_cgroup.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/test_netcnt.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/test_progs.c+30−0

This diff is large: its 60 lines aren’t shown here.

tools/testing/selftests/bpf/test_skb_cgroup_id_user.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/test_sock.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/test_sock_addr.c+51−4

This diff is large: its 110 lines aren’t shown here.

tools/testing/selftests/bpf/test_socket_cookie.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/test_tcpbpf_user.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/test_tcpnotify_user.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/test_verifier.c+120−0

This diff is large: its 127 lines aren’t shown here.

tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh+10−3

This diff is large: its 34 lines aren’t shown here.

tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh+20−0

This diff is large: its 34 lines aren’t shown here.

tools/testing/selftests/drivers/net/mlxsw/vxlan.sh+18−0

This diff is large: its 25 lines aren’t shown here.

tools/testing/selftests/filesystems/binderfs/.gitignore+1−0

This diff is large: its 2 lines aren’t shown here.

tools/testing/selftests/filesystems/binderfs/Makefile+6−0

This diff is large: its 7 lines aren’t shown here.

tools/testing/selftests/filesystems/binderfs/binderfs_test.c+275−0

This diff is large: its 276 lines aren’t shown here.

tools/testing/selftests/filesystems/binderfs/config+3−0

This diff is large: its 4 lines aren’t shown here.

tools/testing/selftests/gpio/gpio-mockup-chardev.c+6−3

This diff is large: its 23 lines aren’t shown here.

tools/testing/selftests/ir/Makefile+2−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/kvm/lib/kvm_util.c+2−7

This diff is large: its 26 lines aren’t shown here.

tools/testing/selftests/kvm/x86_64/evmcs_test.c+6−0

This diff is large: its 13 lines aren’t shown here.

tools/testing/selftests/net/Makefile+1−1

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh+46−1

This diff is large: its 61 lines aren’t shown here.

tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/net/ip_defrag.c+87−9

This diff is large: its 156 lines aren’t shown here.

tools/testing/selftests/net/ip_defrag.sh+8−1

This diff is large: its 31 lines aren’t shown here.

tools/testing/selftests/net/xfrm_policy.sh+131−22

This diff is large: its 190 lines aren’t shown here.

tools/testing/selftests/netfilter/Makefile+1−1

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/netfilter/config+1−1

This diff is large: its 4 lines aren’t shown here.

tools/testing/selftests/netfilter/nft_nat.sh+762−0

This diff is large: its 763 lines aren’t shown here.

tools/testing/selftests/networking/timestamping/txtimestamp.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/proc/.gitignore+1−0

This diff is large: its 6 lines aren’t shown here.

tools/testing/selftests/proc/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/proc/setns-dcache.c+129−0

This diff is large: its 130 lines aren’t shown here.

tools/testing/selftests/rtc/rtctest.c+104−5

This diff is large: its 128 lines aren’t shown here.

tools/testing/selftests/seccomp/Makefile+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/seccomp/seccomp_bpf.c+62−20

This diff is large: its 193 lines aren’t shown here.

tools/testing/selftests/tc-testing/tc-tests/actions/ife.json+44−44

This diff is large: its 396 lines aren’t shown here.

tools/testing/selftests/tc-testing/tc-tests/actions/tunnel_key.json+1−30

This diff is large: its 45 lines aren’t shown here.

tools/testing/selftests/timers/Makefile+1−1

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/vm/gup_benchmark.c+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/x86/mpx-mini-test.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/x86/protection_keys.c+31−10

This diff is large: its 67 lines aren’t shown here.

tools/testing/selftests/x86/unwind_vdso.c+0−1

This diff is large: its 8 lines aren’t shown here.

tools/thermal/tmon/Makefile+1−1

This diff is large: its 9 lines aren’t shown here.

tools/vm/page_owner_sort.c+3−1

This diff is large: its 11 lines aren’t shown here.

virt/kvm/kvm_main.c+9−3

This diff is large: its 43 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